PageSourceSearch

https://interview-pro-six.vercel.app/assets/index-BvsgMZIN.js

js interview-pro-six.vercel.app collected 2026-10-03 07:07:35 UTC 2,638,531 bytes, 508 lines download raw bytes

vendor: 7,751 bytes, lines 1-2
1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/background-filters-D2U5UBbH.es-C_OaaGVI.js","assets/jsx-runtime-CnSBKPes.js","assets/latency-chart-Bj5OSYzg.es-Bm2HqoQy.js","assets/ReactPlayerWrapper.d2ae5941-uzUSB_vO.js"])))=>i.map(i=>d[i]);
2import{a as e,n as t,r as n,s as r,t as i}from"./jsx-runtime-CnSBKPes.js";(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var a=n((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0<n;){var r=n-1>>>1,a=e[r];if(0<i(a,t))e[r]=t,e[n]=a,n=r;else break a}}function n(e){return e.length===0?null:e[0]}function r(e){if(e.length===0)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;a:for(var r=0,a=e.length,o=a>>>1;r<o;){var s=2*(r+1)-1,c=e[s],l=s+1,u=e[l];if(0>i(c,n))l<a&&0>i(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(l<a&&0>i(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(e.unstable_now=void 0,typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=!1,_=typeof setTimeout==`function`?setTimeout:null,v=typeof clearTimeout==`function`?clearTimeout:null,y=typeof setImmediate<`u`?setImmediate:null;function b(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function x(e){if(h=!1,b(e),!m)if(n(c)!==null)m=!0,S||(S=!0,O());else{var t=n(l);t!==null&&j(x,t.startTime-e)}}var S=!1,C=-1,w=5,T=-1;function E(){return g?!0:!(e.unstable_now()-T<w)}function D(){if(g=!1,S){var t=e.unstable_now();T=t;var i=!0;try{a:{m=!1,h&&(h=!1,v(C),C=-1),p=!0;var a=f;try{b:{for(b(t),d=n(c);d!==null&&!(d.expirationTime>t&&E());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=t);if(t=e.unstable_now(),typeof s==`function`){d.callback=s,b(t),i=!0;break b}d===n(c)&&r(c),b(t)}else r(c);d=n(c)}if(d!==null)i=!0;else{var u=n(l);u!==null&&j(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?O():S=!1}}}var O;if(typeof y==`function`)O=function(){y(D)};else if(typeof MessageChannel<`u`){var k=new MessageChannel,A=k.port2;k.port1.onmessage=D,O=function(){A.postMessage(null)}}else O=function(){_(D,0)};function j(t,n){C=_(function(){t(e.unstable_now())},n)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error(`forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported`):w=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_next=function(e){switch(f){case 1:case 2:case 3:var t=3;break;default:t=f}var n=f;f=t;try{return e()}finally{f=n}},e.unstable_requestPaint=function(){g=!0},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=f;f=e;try{return t()}finally{f=n}},e.unstable_scheduleCallback=function(r,i,a){var o=e.unstable_now();switch(typeof a==`object`&&a?(a=a.delay,a=typeof a==`number`&&0<a?o+a:o):a=o,r){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return s=a+s,r={id:u++,callback:i,priorityLevel:r,startTime:a,expirationTime:s,sortIndex:-1},a>o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(v(C),C=-1):h=!0,j(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,S||(S=!0,O()))),r},e.unstable_shouldYield=E,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),o=n(((e,t)=>{t.exports=a()})),s=n((e=>{var n=t();function r(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function i(){}var a={d:{f:i,r:function(){throw Error(r(522))},D:i,C:i,L:i,m:i,X:i,S:i,M:i},p:0,findDOMNode:null},o=Symbol.for(`react.portal`);function s(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:o,key:r==null?null:``+r,children:e,containerInfo:t,implementation:n}}var c=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function l(e,t){if(e===`font`)return``;if(typeof t==`string`)return t===`use-credentials`?t:``}e.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=a,e.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(r(299));return s(e,t,null,n)},e.flushSync=function(e){var t=c.T,n=a.p;try{if(c.T=null,a.p=2,e)return e()}finally{c.T=t,a.p=n,a.d.f()}},e.preconnect=function(e,t){typeof e==`string`&&(t?(t=t.crossOrigin,t=typeof t==`string`?t===`use-credentials`?t:``:void 0):t=null,a.d.C(e,t))},e.prefetchDNS=function(e){typeof e==`string`&&a.d.D(e)},e.preinit=function(e,t){if(typeof e==`string`&&t&&typeof t.as==`string`){var n=t.as,r=l(n,t.crossOrigin),i=typeof t.integrity==`string`?t.integrity:void 0,o=typeof t.fetchPriority==`string`?t.fetchPriority:void 0;n===`style`?a.d.S(e,typeof t.precedence==`string`?t.precedence:void 0,{crossOrigin:r,integrity:i,fetchPriority:o}):n===`script`&&a.d.X(e,{crossOrigin:r,integrity:i,fetchPriority:o,nonce:typeof t.nonce==`string`?t.nonce:void 0})}},e.preinitModule=function(e,t){if(typeof e==`string`)if(typeof t==`object`&&t){if(t.as==null||t.as===`script`){var n=l(t.as,t.crossOrigin);a.d.M(e,{crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0})}}else t??a.d.M(e)},e.preload=function(e,t){if(typeof e==`string`&&typeof t==`object`&&t&&typeof t.as==`string`){var n=t.as,r=l(n,t.crossOrigin);a.d.L(e,n,{crossOrigin:r,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,type:typeof t.type==`string`?t.type:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0,referrerPolicy:typeof t.referrerPolicy==`string`?t.referrerPolicy:void 0,imageSrcSet:typeof t.imageSrcSet==`string`?t.imageSrcSet:void 0,imageSizes:typeof t.imageSizes==`string`?t.imageSizes:void 0,media:typeof t.media==`string`?t.media:void 0})}},e.preloadModule=function(e,t){if(typeof e==`string`)if(t){var n=l(t.as,t.crossOrigin);a.d.m(e,{as:typeof t.as==`string`&&t.as!==`script`?t.as:void 0,crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0})}else a.d.m(e)},e.requestFormReset=function(e){a.d.r(e)},e.unstable_batchedUpdates=function(e,t){return e(t)},e.useFormState=function(e,t,n){return c.H.useFormState(e,t,n)},e.useFormStatus=function(){return c.H.useHostTransitionStatus()}
vendor: 5,013 bytes, lines 2-4
2,e.version=`19.2.6`})),c=n(((e,t)=>{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=s()})),l=n((e=>{var n=o(),r=t(),i=c();function a(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function s(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function l(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function u(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function d(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function f(e){if(l(e)!==e)throw Error(a(188))}function p(e){var t=e.alternate;if(!t){if(t=l(e),t===null)throw Error(a(188));return t===e?e:null}for(var n=e,r=t;;){var i=n.return;if(i===null)break;var o=i.alternate;if(o===null){if(r=i.return,r!==null){n=r;continue}break}if(i.child===o.child){for(o=i.child;o;){if(o===n)return f(i),e;if(o===r)return f(i),t;o=o.sibling}throw Error(a(188))}if(n.return!==r.return)n=i,r=o;else{for(var s=!1,c=i.child;c;){if(c===n){s=!0,n=i,r=o;break}if(c===r){s=!0,r=i,n=o;break}c=c.sibling}if(!s){for(c=o.child;c;){if(c===n){s=!0,n=o,r=i;break}if(c===r){s=!0,r=o,n=i;break}c=c.sibling}if(!s)throw Error(a(189))}}if(n.alternate!==r)throw Error(a(190))}if(n.tag!==3)throw Error(a(188));return n.stateNode.current===n?e:t}function m(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=m(e),t!==null)return t;e=e.sibling}return null}var h=Object.assign,g=Symbol.for(`react.element`),_=Symbol.for(`react.transitional.element`),v=Symbol.for(`react.portal`),y=Symbol.for(`react.fragment`),b=Symbol.for(`react.strict_mode`),x=Symbol.for(`react.profiler`),S=Symbol.for(`react.consumer`),C=Symbol.for(`react.context`),w=Symbol.for(`react.forward_ref`),T=Symbol.for(`react.suspense`),E=Symbol.for(`react.suspense_list`),D=Symbol.for(`react.memo`),O=Symbol.for(`react.lazy`),k=Symbol.for(`react.activity`),A=Symbol.for(`react.memo_cache_sentinel`),j=Symbol.iterator;function M(e){return typeof e!=`object`||!e?null:(e=j&&e[j]||e[`@@iterator`],typeof e==`function`?e:null)}var N=Symbol.for(`react.client.reference`);function P(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===N?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case y:return`Fragment`;case x:return`Profiler`;case b:return`StrictMode`;case T:return`Suspense`;case E:return`SuspenseList`;case k:return`Activity`}if(typeof e==`object`)switch(e.$$typeof){case v:return`Portal`;case C:return e.displayName||`Context`;case S:return(e._context.displayName||`Context`)+`.Consumer`;case w:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case D:return t=e.displayName||null,t===null?P(e.type)||`Memo`:t;case O:t=e._payload,e=e._init;try{return P(e(t))}catch{}}return null}var ee=Array.isArray,F=r.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,te=i.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ne={pending:!1,data:null,method:null,action:null},re=[],I=-1;function ie(e){return{current:e}}function ae(e){0>I||(e.current=re[I],re[I]=null,I--)}function oe(e,t){I++,re[I]=e.current,e.current=t}var L=ie(null),se=ie(null),ce=ie(null),le=ie(null);function ue(e,t){switch(oe(ce,t),oe(se,e),oe(L,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?tf(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=tf(t),e=nf(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}ae(L),oe(L,e)}function de(){ae(L),ae(se),ae(ce)}function fe(e){e.memoizedState!==null&&oe(le,e);var t=L.current,n=nf(t,e.type);t!==n&&(oe(se,e),oe(L,n))}function pe(e){se.current===e&&(ae(L),ae(se)),le.current===e&&(ae(le),fp._currentValue=ne)}var me,he;function ge(e){if(me===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);me=t&&t[1]||``,he=-1<e.stack.indexOf(`
3    at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return`
4`+me+e+he}var _e=!1;function ve(e,t){if(!e||_e)return``;_e=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var n=function(){throw Error()};if(Object.defineProperty(n.prototype,`props`,{set:function(){throw Error()}}),typeof Reflect==`object`&&Reflect.construct){try{Reflect.construct(n,[])}catch(e){var r=e}Reflect.construct(e,[],n)}
vendor: 6,586 bytes, lines 4-9
4else{try{n.call()}catch(e){r=e}e.call(n.prototype)}}else{try{throw Error()}catch(e){r=e}(n=e())&&typeof n.catch==`function`&&n.catch(function(){})}}catch(e){if(e&&r&&typeof e.stack==`string`)return[e.stack,r.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName=`DetermineComponentFrameRoot`;var i=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,`name`);i&&i.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,`name`,{value:`DetermineComponentFrameRoot`});var a=r.DetermineComponentFrameRoot(),o=a[0],s=a[1];if(o&&s){var c=o.split(`
5`),l=s.split(`
6`);for(i=r=0;r<c.length&&!c[r].includes(`DetermineComponentFrameRoot`);)r++;for(;i<l.length&&!l[i].includes(`DetermineComponentFrameRoot`);)i++;if(r===c.length||i===l.length)for(r=c.length-1,i=l.length-1;1<=r&&0<=i&&c[r]!==l[i];)i--;for(;1<=r&&0<=i;r--,i--)if(c[r]!==l[i]){if(r!==1||i!==1)do if(r--,i--,0>i||c[r]!==l[i]){var u=`
7`+c[r].replace(` at new `,` at `);return e.displayName&&u.includes(`<anonymous>`)&&(u=u.replace(`<anonymous>`,e.displayName)),u}while(1<=r&&0<=i);break}}}finally{_e=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?ge(n):``}function ye(e,t){switch(e.tag){case 26:case 27:case 5:return ge(e.type);case 16:return ge(`Lazy`);case 13:return e.child!==t&&t!==null?ge(`Suspense Fallback`):ge(`Suspense`);case 19:return ge(`SuspenseList`);case 0:case 15:return ve(e.type,!1);case 11:return ve(e.type.render,!1);case 1:return ve(e.type,!0);case 31:return ge(`Activity`);default:return``}}function be(e){try{var t=``,n=null;do t+=ye(e,n),n=e,e=e.return;while(e);return t}catch(e){return`
8Error generating stack: `+e.message+`
9`+e.stack}}var xe=Object.prototype.hasOwnProperty,Se=n.unstable_scheduleCallback,Ce=n.unstable_cancelCallback,we=n.unstable_shouldYield,Te=n.unstable_requestPaint,Ee=n.unstable_now,De=n.unstable_getCurrentPriorityLevel,Oe=n.unstable_ImmediatePriority,ke=n.unstable_UserBlockingPriority,Ae=n.unstable_NormalPriority,je=n.unstable_LowPriority,Me=n.unstable_IdlePriority,Ne=n.log,Pe=n.unstable_setDisableYieldValue,Fe=null,Ie=null;function Le(e){if(typeof Ne==`function`&&Pe(e),Ie&&typeof Ie.setStrictMode==`function`)try{Ie.setStrictMode(Fe,e)}catch{}}var Re=Math.clz32?Math.clz32:Ve,ze=Math.log,Be=Math.LN2;function Ve(e){return e>>>=0,e===0?32:31-(ze(e)/Be|0)|0}var He=256,Ue=262144,We=4194304;function Ge(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function Ke(e,t,n){var r=e.pendingLanes;if(r===0)return 0;var i=0,a=e.suspendedLanes,o=e.pingedLanes;e=e.warmLanes;var s=r&134217727;return s===0?(s=r&~a,s===0?o===0?n||(n=r&~e,n!==0&&(i=Ge(n))):i=Ge(o):i=Ge(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=Ge(n))):i=Ge(o)):i=Ge(r)),i===0?0:t!==0&&t!==i&&(t&a)===0&&(a=i&-i,n=t&-t,a>=n||a===32&&n&4194048)?t:i}function qe(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function Je(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Ye(){var e=We;return We<<=1,!(We&62914560)&&(We=4194304),e}function Xe(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Ze(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Qe(e,t,n,r,i,a){var o=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var s=e.entanglements,c=e.expirationTimes,l=e.hiddenUpdates;for(n=o&~n;0<n;){var u=31-Re(n),d=1<<u;s[u]=0,c[u]=-1;var f=l[u];if(f!==null)for(l[u]=null,u=0;u<f.length;u++){var p=f[u];p!==null&&(p.lane&=-536870913)}n&=~d}r!==0&&$e(e,r,0),a!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=a&~(o&~t))}function $e(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-Re(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function et(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Re(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}function tt(e,t){var n=t&-t;return n=n&42?1:nt(n),(n&(e.suspendedLanes|t))===0?n:0}function nt(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function rt(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function it(){var e=te.p;return e===0?(e=window.event,e===void 0?32:Op(e.type)):e}function at(e,t){var n=te.p;try{return te.p=e,t()}finally{te.p=n}}var ot=Math.random().toString(36).slice(2),st=`__reactFiber$`+ot,ct=`__reactProps$`+ot,lt=`__reactContainer$`+ot,ut=`__reactEvents$`+ot,dt=`__reactListeners$`+ot,ft=`__reactHandles$`+ot,pt=`__reactResources$`+ot,mt=`__reactMarker$`+ot;function ht(e){delete e[st],delete e[ct],delete e[ut],delete e[dt],delete e[ft]}function gt(e){var t=e[st];if(t)return t;for(var n=e.parentNode;n;){if(t=n[lt]||n[st]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=Tf(e);e!==null;){if(n=e[st])return n;e=Tf(e)}return t}e=n,n=e.parentNode}return null}function _t(e){if(e=e[st]||e[lt]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function vt(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(a(33))}function yt(e){var t=e[pt];return t||=e[pt]={hoistableStyles:new Map,hoistableScripts:new Map},t}function bt(e){e[mt]=!0}var xt=new Set,St={};function Ct(e,t){wt(e,t),wt(e+`Capture`,t)}function wt(e,t){for(St[e]=t,e=0;e<t.length;e++)xt.add(t[e])}var Tt=RegExp(`^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u
9037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$`),Et={},Dt={};function Ot(e){return xe.call(Dt,e)?!0:xe.call(Et,e)?!1:Tt.test(e)?Dt[e]=!0:(Et[e]=!0,!1)}function kt(e,t,n){if(Ot(t))if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:e.removeAttribute(t);return;case`boolean`:var r=t.toLowerCase().slice(0,5);if(r!==`data-`&&r!==`aria-`){e.removeAttribute(t);return}}e.setAttribute(t,``+n)}}function At(e,t,n){if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(t);return}e.setAttribute(t,``+n)}}function jt(e,t,n,r){if(r===null)e.removeAttribute(n);else{switch(typeof r){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(n);return}e.setAttributeNS(t,n,``+r)}}function Mt(e){switch(typeof e){case`bigint`:case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function Nt(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function Pt(e,t,n){var r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&r!==void 0&&typeof r.get==`function`&&typeof r.set==`function`){var i=r.get,a=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(e){n=``+e,a.call(this,e)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(e){n=``+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Ft(e){if(!e._valueTracker){var t=Nt(e)?`checked`:`value`;e._valueTracker=Pt(e,t,``+e[t])}}function It(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=Nt(e)?e.checked?`true`:`false`:e.value),e=r,e===n?!1:(t.setValue(e),!0)}function Lt(e){if(e||=typeof document<`u`?document:void 0,e===void 0)return null;try{return e.activeElement||e.body}catch{return e.body}}var Rt=/[\n"\\]/g;function zt(e){return e.replace(Rt,function(e){return`\\`+e.charCodeAt(0).toString(16)+` `})}function Bt(e,t,n,r,i,a,o,s){e.name=``,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`?e.type=o:e.removeAttribute(`type`),t==null?o!==`submit`&&o!==`reset`||e.removeAttribute(`value`):o===`number`?(t===0&&e.value===``||e.value!=t)&&(e.value=``+Mt(t)):e.value!==``+Mt(t)&&(e.value=``+Mt(t)),t==null?n==null?r!=null&&e.removeAttribute(`value`):Ht(e,o,Mt(n)):Ht(e,o,Mt(t)),i==null&&a!=null&&(e.defaultChecked=!!a),i!=null&&(e.checked=i&&typeof i!=`function`&&typeof i!=`symbol`),s!=null&&typeof s!=`function`&&typeof s!=`symbol`&&typeof s!=`boolean`?e.name=``+Mt(s):e.removeAttribute(`name`)}function Vt(e,t,n,r,i,a,o,s){if(a!=null&&typeof a!=`function`&&typeof a!=`symbol`&&typeof a!=`boolean`&&(e.type=a),t!=null||n!=null){if(!(a!==`submit`&&a!==`reset`||t!=null)){Ft(e);return}n=n==null?``:``+Mt(n),t=t==null?n:``+Mt(t),s||t===e.value||(e.value=t),e.defaultValue=t}r??=i,r=typeof r!=`function`&&typeof r!=`symbol`&&!!r,e.checked=s?e.checked:!!r,e.defaultChecked=!!r,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`&&(e.name=o),Ft(e)}function Ht(e,t,n){t===`number`&&Lt(e.ownerDocument)===e||e.defaultValue===``+n||(e.defaultValue=``+n)}function Ut(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t[`$`+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty(`$`+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&r&&(e[n].defaultSelected=!0)}else{for(n=``+Mt(n),t=null,i=0;i<e.length;i++){if(e[i].value===n){e[i].selected=!0,r&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function Wt(e,t,n){if(t!=null&&(t=``+Mt(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n==null?``:``+Mt(n)}function Gt(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error(a(92));if(ee(r)){if(1<r.length)throw Error(a(93));r=r[0]}n=r}n??=``,t=n}
vendor: 87,497 bytes, line 9
9n=Mt(t),e.defaultValue=n,r=e.textContent,r===n&&r!==``&&r!==null&&(e.value=r),Ft(e)}function Kt(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var qt=new Set(`animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp`.split(` `));function Jt(e,t,n){var r=t.indexOf(`--`)===0;n==null||typeof n==`boolean`||n===``?r?e.setProperty(t,``):t===`float`?e.cssFloat=``:e[t]=``:r?e.setProperty(t,n):typeof n!=`number`||n===0||qt.has(t)?t===`float`?e.cssFloat=n:e[t]=(``+n).trim():e[t]=n+`px`}function Yt(e,t,n){if(t!=null&&typeof t!=`object`)throw Error(a(62));if(e=e.style,n!=null){for(var r in n)!n.hasOwnProperty(r)||t!=null&&t.hasOwnProperty(r)||(r.indexOf(`--`)===0?e.setProperty(r,``):r===`float`?e.cssFloat=``:e[r]=``);for(var i in t)r=t[i],t.hasOwnProperty(i)&&n[i]!==r&&Jt(e,i,r)}else for(var o in t)t.hasOwnProperty(o)&&Jt(e,o,t[o])}function Xt(e){if(e.indexOf(`-`)===-1)return!1;switch(e){case`annotation-xml`:case`color-profile`:case`font-face`:case`font-face-src`:case`font-face-uri`:case`font-face-format`:case`font-face-name`:case`missing-glyph`:return!1;default:return!0}}var Zt=new Map([[`acceptCharset`,`accept-charset`],[`htmlFor`,`for`],[`httpEquiv`,`http-equiv`],[`crossOrigin`,`crossorigin`],[`accentHeight`,`accent-height`],[`alignmentBaseline`,`alignment-baseline`],[`arabicForm`,`arabic-form`],[`baselineShift`,`baseline-shift`],[`capHeight`,`cap-height`],[`clipPath`,`clip-path`],[`clipRule`,`clip-rule`],[`colorInterpolation`,`color-interpolation`],[`colorInterpolationFilters`,`color-interpolation-filters`],[`colorProfile`,`color-profile`],[`colorRendering`,`color-rendering`],[`dominantBaseline`,`dominant-baseline`],[`enableBackground`,`enable-background`],[`fillOpacity`,`fill-opacity`],[`fillRule`,`fill-rule`],[`floodColor`,`flood-color`],[`floodOpacity`,`flood-opacity`],[`fontFamily`,`font-family`],[`fontSize`,`font-size`],[`fontSizeAdjust`,`font-size-adjust`],[`fontStretch`,`font-stretch`],[`fontStyle`,`font-style`],[`fontVariant`,`font-variant`],[`fontWeight`,`font-weight`],[`glyphName`,`glyph-name`],[`glyphOrientationHorizontal`,`glyph-orientation-horizontal`],[`glyphOrientationVertical`,`glyph-orientation-vertical`],[`horizAdvX`,`horiz-adv-x`],[`horizOriginX`,`horiz-origin-x`],[`imageRendering`,`image-rendering`],[`letterSpacing`,`letter-spacing`],[`lightingColor`,`lighting-color`],[`markerEnd`,`marker-end`],[`markerMid`,`marker-mid`],[`markerStart`,`marker-start`],[`overlinePosition`,`overline-position`],[`overlineThickness`,`overline-thickness`],[`paintOrder`,`paint-order`],[`panose-1`,`panose-1`],[`pointerEvents`,`pointer-events`],[`renderingIntent`,`rendering-intent`],[`shapeRendering`,`shape-rendering`],[`stopColor`,`stop-color`],[`stopOpacity`,`stop-opacity`],[`strikethroughPosition`,`strikethrough-position`],[`strikethroughThickness`,`strikethrough-thickness`],[`strokeDasharray`,`stroke-dasharray`],[`strokeDashoffset`,`stroke-dashoffset`],[`strokeLinecap`,`stroke-linecap`],[`strokeLinejoin`,`stroke-linejoin`],[`strokeMiterlimit`,`stroke-miterlimit`],[`strokeOpacity`,`stroke-opacity`],[`strokeWidth`,`stroke-width`],[`textAnchor`,`text-anchor`],[`textDecoration`,`text-decoration`],[`textRendering`,`text-rendering`],[`transformOrigin`,`transform-origin`],[`underlinePosition`,`underline-position`],[`underlineThickness`,`underline-thickness`],[`unicodeBidi`,`unicode-bidi`],[`unicodeRange`,`unicode-range`],[`unitsPerEm`,`units-per-em`],[`vAlphabetic`,`v-alphabetic`],[`vHanging`,`v-hanging`],[`vIdeographic`,`v-ideographic`],[`vMathematical`,`v-mathematical`],[`vectorEffect`,`vector-effect`],[`vertAdvY`,`vert-adv-y`],[`vertOriginX`,`vert-origin-x`],[`vertOriginY`,`vert-origin-y`],[`wordSpacing`,`word-spacing`],[`writingMode`,`writing-mode`],[`xmlnsXlink`,`xmlns:xlink`],[`xHeight`,`x-height`]]),Qt=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function $t(e){return Qt.test(``+e)?`javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')`:e}function en(){}var tn=null;function nn(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var rn=null,an=null;function on(e){var t=_t(e);if(t&&(e=t.stateNode)){var n=e[ct]||null;a:switch(e=t.stateNode,t.type){case`input`:if(Bt(e,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),t=n.name,n.type===`radio`&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll(`input[name="`+zt(``+t)+`"][type="radio"]`),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var i=r[ct]||null;if(!i)throw Error(a(90));Bt(r,i.value,i.defaultValue,i.defaultValue,i.checked,i.defaultChecked,i.type,i.name)}}for(t=0;t<n.length;t++)r=n[t],r.form===e.form&&It(r)}break a;case`textarea`:Wt(e,n.value,n.defaultValue);break a;case`select`:t=n.value,t!=null&&Ut(e,!!n.multiple,t,!1)}}}var sn=!1;function cn(e,t,n){if(sn)return e(t,n);sn=!0;try{return e(t)}finally{if(sn=!1,(rn!==null||an!==null)&&(Mu(),rn&&(t=rn,e=an,an=rn=null,on(t),e)))for(t=0;t<e.length;t++)on(e[t])}}function ln(e,t){var n=e.stateNode;if(n===null)return null;var r=n[ct]||null;if(r===null)return null;n=r[t];a:switch(t){case`onClick`:case`onClickCapture`:case`onDoubleClick`:case`onDoubleClickCapture`:case`onMouseDown`:case`onMouseDownCapture`:case`onMouseMove`:case`onMouseMoveCapture`:case`onMouseUp`:case`onMouseUpCapture`:case`onMouseEnter`:(r=!r.disabled)||(e=e.type,r=!(e===`button`||e===`input`||e===`select`||e===`textarea`)),e=!r;break a;default:e=!1}if(e)return null;if(n&&typeof n!=`function`)throw Error(a(231,t,typeof n));return n}var un=!(typeof window>`u`||window.document===void 0||window.document.createElement===void 0),dn=!1;if(un)try{var fn={};Object.defineProperty(fn,`passive`,{get:function(){dn=!0}}),window.addEventListener(`test`,fn,fn),window.removeEventListener(`test`,fn,fn)}catch{dn=!1}var pn=null,mn=null,hn=null;function gn(){if(hn)return hn;var e,t=mn,n=t.length,r,i=`value`in pn?pn.value:pn.textContent,a=i.length;for(e=0;e<n&&t[e]===i[e];e++);var o=n-e;for(r=1;r<=o&&t[n-r]===i[a-r];r++);return hn=i.slice(e,1<r?1-r:void 0)}function _n(e){var t=e.keyCode;return`charCode`in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function vn(){return!0}function yn(){return!1}function bn(e){function t(t,n,r,i,a){for(var o in this._reactName=t,this._targetInst=r,this.type=n,this.nativeEvent=i,this.target=a,this.currentTarget=null,e)e.hasOwnProperty(o)&&(t=e[o],this[o]=t?t(i):i[o]);return this.isDefaultPrevented=(i.defaultPrevented==null?!1===i.returnValue:i.defaultPrevented)?vn:yn,this.isPropagationStopped=yn,this}return h(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():typeof e.returnValue!=`unknown`&&(e.returnValue=!1),this.isDefaultPrevented=vn)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():typeof e.cancelBubble!=`unknown`&&(e.cancelBubble=!0),this.isPropagationStopped=vn)},persist:function(){},isPersistent:vn}),t}var xn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Sn=bn(xn),Cn=h({},xn,{view:0,detail:0}),wn=bn(Cn),Tn,En,Dn,On=h({},Cn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:zn,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return`movementX`in e?e.movementX:(e!==Dn&&(Dn&&e.type===`mousemove`?(Tn=e.screenX-Dn.screenX,En=e.screenY-Dn.screenY):En=Tn=0,Dn=e),Tn)},movementY:function(e){return`movementY`in e?e.movementY:En}}),kn=bn(On),An=bn(h({},On,{dataTransfer:0})),jn=bn(h({},Cn,{relatedTarget:0})),Mn=bn(h({},xn,{animationName:0,elapsedTime:0,pseudoElement:0})),Nn=bn(h({},xn,{clipboardData:function(e){return`clipboardData`in e?e.clipboardData:window.clipboardData}})),Pn=bn(h({},xn,{data:0})),Fn={Esc:`Escape`,Spacebar:` `,Left:`ArrowLeft`,Up:`ArrowUp`,Right:`ArrowRight`,Down:`ArrowDown`,Del:`Delete`,Win:`OS`,Menu:`ContextMenu`,Apps:`ContextMenu`,Scroll:`ScrollLock`,MozPrintableKey:`Unidentified`},In={8:`Backspace`,9:`Tab`,12:`Clear`,13:`Enter`,16:`Shift`,17:`Control`,18:`Alt`,19:`Pause`,20:`CapsLock`,27:`Escape`,32:` `,33:`PageUp`,34:`PageDown`,35:`End`,36:`Home`,37:`ArrowLeft`,38:`ArrowUp`,39:`ArrowRight`,40:`ArrowDown`,45:`Insert`,46:`Delete`,112:`F1`,113:`F2`,114:`F3`,115:`F4`,116:`F5`,117:`F6`,118:`F7`,119:`F8`,120:`F9`,121:`F10`,122:`F11`,123:`F12`,144:`NumLock`,145:`ScrollLock`,224:`Meta`},Ln={Alt:`altKey`,Control:`ctrlKey`,Meta:`metaKey`,Shift:`shiftKey`};function Rn(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Ln[e])?!!t[e]:!1}function zn(){return Rn}var Bn=bn(h({},Cn,{key:function(e){if(e.key){var t=Fn[e.key]||e.key;if(t!==`Unidentified`)return t}return e.type===`keypress`?(e=_n(e),e===13?`Enter`:String.fromCharCode(e)):e.type===`keydown`||e.type===`keyup`?In[e.keyCode]||`Unidentified`:``},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:zn,charCode:function(e){return e.type===`keypress`?_n(e):0},keyCode:function(e){return e.type===`keydown`||e.type===`keyup`?e.keyCode:0},which:function(e){return e.type===`keypress`?_n(e):e.type===`keydown`||e.type===`keyup`?e.keyCode:0}})),Vn=bn(h({},On,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),Hn=bn(h({},Cn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:zn})),Un=bn(h({},xn,{propertyName:0,elapsedTime:0,pseudoElement:0})),Wn=bn(h({},On,{deltaX:function(e){return`deltaX`in e?e.deltaX:`wheelDeltaX`in e?-e.wheelDeltaX:0},deltaY:function(e){return`deltaY`in e?e.deltaY:`wheelDeltaY`in e?-e.wheelDeltaY:`wheelDelta`in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0})),Gn=bn(h({},xn,{newState:0,oldState:0})),Kn=[9,13,27,32],qn=un&&`CompositionEvent`in window,Jn=null;un&&`documentMode`in document&&(Jn=document.documentMode);var Yn=un&&`TextEvent`in window&&!Jn,Xn=un&&(!qn||Jn&&8<Jn&&11>=Jn),Zn=` `,Qn=!1;function $n(e,t){switch(e){case`keyup`:return Kn.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function er(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var tr=!1;function nr(e,t){switch(e){case`compositionend`:return er(t);case`keypress`:return t.which===32?(Qn=!0,Zn):null;case`textInput`:return e=t.data,e===Zn&&Qn?null:e;default:return null}}function rr(e,t){if(tr)return e===`compositionend`||!qn&&$n(e,t)?(e=gn(),hn=mn=pn=null,tr=!1,e):null;switch(e){case`paste`:return null;case`keypress`:if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case`compositionend`:return Xn&&t.locale!==`ko`?null:t.data;default:return null}}var ir={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function ar(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t===`input`?!!ir[e.type]:t===`textarea`}function or(e,t,n,r){rn?an?an.push(r):an=[r]:rn=r,t=zd(t,`onChange`),0<t.length&&(n=new Sn(`onChange`,`change`,null,n,r),e.push({event:n,listeners:t}))}var sr=null,cr=null;function lr(e){jd(e,0)}function ur(e){if(It(vt(e)))return e}function dr(e,t){if(e===`change`)return t}var fr=!1;if(un){var pr;if(un){var mr=`oninput`in document;if(!mr){var hr=document.createElement(`div`);hr.setAttribute(`oninput`,`return;`),mr=typeof hr.oninput==`function`}pr=mr}else pr=!1;fr=pr&&(!document.documentMode||9<document.documentMode)}function gr(){sr&&(sr.detachEvent(`onpropertychange`,_r),cr=sr=null)}function _r(e){if(e.propertyName===`value`&&ur(cr)){var t=[];or(t,cr,e,nn(e)),cn(lr,t)}}function vr(e,t,n){e===`focusin`?(gr(),sr=t,cr=n,sr.attachEvent(`onpropertychange`,_r)):e===`focusout`&&gr()}function yr(e){if(e===`selectionchange`||e===`keyup`||e===`keydown`)return ur(cr)}function br(e,t){if(e===`click`)return ur(t)}function xr(e,t){if(e===`input`||e===`change`)return ur(t)}function Sr(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var Cr=typeof Object.is==`function`?Object.is:Sr;function wr(e,t){if(Cr(e,t))return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var i=n[r];if(!xe.call(t,i)||!Cr(e[i],t[i]))return!1}return!0}function Tr(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Er(e,t){var n=Tr(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}a:{for(;n;){if(n.nextSibling){n=n.nextSibling;break a}n=n.parentNode}n=void 0}n=Tr(n)}}function Dr(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Dr(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Or(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Lt(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href==`string`}catch{n=!1}if(n)e=t.contentWindow;else break;t=Lt(e.document)}return t}function kr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t===`input`&&(e.type===`text`||e.type===`search`||e.type===`tel`||e.type===`url`||e.type===`password`)||t===`textarea`||e.contentEditable===`true`)}var Ar=un&&`documentMode`in document&&11>=document.documentMode,jr=null,Mr=null,Nr=null,Pr=!1;function Fr(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Pr||jr==null||jr!==Lt(r)||(r=jr,`selectionStart`in r&&kr(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Nr&&wr(Nr,r)||(Nr=r,r=zd(Mr,`onSelect`),0<r.length&&(t=new Sn(`onSelect`,`select`,null,t,n),e.push({event:t,listeners:r}),t.target=jr)))}function Ir(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n[`Webkit`+e]=`webkit`+t,n[`Moz`+e]=`moz`+t,n}var Lr={animationend:Ir(`Animation`,`AnimationEnd`),animationiteration:Ir(`Animation`,`AnimationIteration`),animationstart:Ir(`Animation`,`AnimationStart`),transitionrun:Ir(`Transition`,`TransitionRun`),transitionstart:Ir(`Transition`,`TransitionStart`),transitioncancel:Ir(`Transition`,`TransitionCancel`),transitionend:Ir(`Transition`,`TransitionEnd`)},Rr={},zr={};un&&(zr=document.createElement(`div`).style,`AnimationEvent`in window||(delete Lr.animationend.animation,delete Lr.animationiteration.animation,delete Lr.animationstart.animation),`TransitionEvent`in window||delete Lr.transitionend.transition);function Br(e){if(Rr[e])return Rr[e];if(!Lr[e])return e;var t=Lr[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in zr)return Rr[e]=t[n];return e}var Vr=Br(`animationend`),Hr=Br(`animationiteration`),Ur=Br(`animationstart`),Wr=Br(`transitionrun`),Gr=Br(`transitionstart`),Kr=Br(`transitioncancel`),qr=Br(`transitionend`),Jr=new Map,Yr=`abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel`.split(` `);Yr.push(`scrollEnd`);function Xr(e,t){Jr.set(e,t),Ct(t,[e])}var Zr=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)},Qr=[],$r=0,ei=0;function ti(){for(var e=$r,t=ei=$r=0;t<e;){var n=Qr[t];Qr[t++]=null;var r=Qr[t];Qr[t++]=null;var i=Qr[t];Qr[t++]=null;var a=Qr[t];if(Qr[t++]=null,r!==null&&i!==null){var o=r.pending;o===null?i.next=i:(i.next=o.next,o.next=i),r.pending=i}a!==0&&ai(n,i,a)}}function ni(e,t,n,r){Qr[$r++]=e,Qr[$r++]=t,Qr[$r++]=n,Qr[$r++]=r,ei|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function ri(e,t,n,r){return ni(e,t,n,r),oi(e)}function ii(e,t){return ni(e,null,null,t),oi(e)}function ai(e,t,n){e.lanes|=n;var r=e.alternate;r!==null&&(r.lanes|=n);for(var i=!1,a=e.return;a!==null;)a.childLanes|=n,r=a.alternate,r!==null&&(r.childLanes|=n),a.tag===22&&(e=a.stateNode,e===null||e._visibility&1||(i=!0)),e=a,a=a.return;return e.tag===3?(a=e.stateNode,i&&t!==null&&(i=31-Re(n),e=a.hiddenUpdates,r=e[i],r===null?e[i]=[t]:r.push(t),t.lane=n|536870912),a):null}function oi(e){if(50<Cu)throw Cu=0,wu=null,Error(a(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var si={};function ci(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function li(e,t,n,r){return new ci(e,t,n,r)}function ui(e){return e=e.prototype,!(!e||!e.isReactComponent)}function di(e,t){var n=e.alternate;return n===null?(n=li(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&65011712,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n.refCleanup=e.refCleanup,n}function fi(e,t){e.flags&=65011714;var n=e.alternate;return n===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type,t=n.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function pi(e,t,n,r,i,o){var s=0;if(r=e,typeof e==`function`)ui(e)&&(s=1);else if(typeof e==`string`)s=rp(e,n,L.current)?26:e===`html`||e===`head`||e===`body`?27:5;else a:switch(e){case k:return e=li(31,n,t,i),e.elementType=k,e.lanes=o,e;case y:return mi(n.children,i,o,t);case b:s=8,i|=24;break;case x:return e=li(12,n,t,i|2),e.elementType=x,e.lanes=o,e;case T:return e=li(13,n,t,i),e.elementType=T,e.lanes=o,e;case E:return e=li(19,n,t,i),e.elementType=E,e.lanes=o,e;default:if(typeof e==`object`&&e)switch(e.$$typeof){case C:s=10;break a;case S:s=9;break a;case w:s=11;break a;case D:s=14;break a;case O:s=16,r=null;break a}s=29,n=Error(a(130,e===null?`null`:typeof e,``)),r=null}return t=li(s,n,t,i),t.elementType=e,t.type=r,t.lanes=o,t}function mi(e,t,n,r){return e=li(7,e,r,t),e.lanes=n,e}function hi(e,t,n){return e=li(6,e,null,t),e.lanes=n,e}function gi(e){var t=li(18,null,null,0);return t.stateNode=e,t}function _i(e,t,n){return t=li(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var vi=new WeakMap;function yi(e,t){if(typeof e==`object`&&e){var n=vi.get(e);return n===void 0?(t={value:e,source:t,stack:be(t)},vi.set(e,t),t):n}return{value:e,source:t,stack:be(t)}}var bi=[],xi=0,Si=null,Ci=0,wi=[],Ti=0,Ei=null,Di=1,Oi=``;function ki(e,t){bi[xi++]=Ci,bi[xi++]=Si,Si=e,Ci=t}function Ai(e,t,n){wi[Ti++]=Di,wi[Ti++]=Oi,wi[Ti++]=Ei,Ei=e;var r=Di;e=Oi;var i=32-Re(r)-1;r&=~(1<<i),n+=1;var a=32-Re(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,Di=1<<32-Re(t)+i|n<<i|r,Oi=a+e}else Di=1<<a|n<<i|r,Oi=e}function ji(e){e.return!==null&&(ki(e,1),Ai(e,1,0))}function Mi(e){for(;e===Si;)Si=bi[--xi],bi[xi]=null,Ci=bi[--xi],bi[xi]=null;for(;e===Ei;)Ei=wi[--Ti],wi[Ti]=null,Oi=wi[--Ti],wi[Ti]=null,Di=wi[--Ti],wi[Ti]=null}function Ni(e,t){wi[Ti++]=Di,wi[Ti++]=Oi,wi[Ti++]=Ei,Di=t.id,Oi=t.overflow,Ei=e}var Pi=null,Fi=null,Ii=!1,Li=null,Ri=!1,zi=Error(a(519));function Bi(e){throw Ki(yi(Error(a(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?`text`:`HTML`,``)),e)),zi}function Vi(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[st]=e,t[ct]=r,n){case`dialog`:Md(`cancel`,t),Md(`close`,t);break;case`iframe`:case`object`:case`embed`:Md(`load`,t);break;case`video`:case`audio`:for(n=0;n<kd.length;n++)Md(kd[n],t);break;case`source`:Md(`error`,t);break;case`img`:case`image`:case`link`:Md(`error`,t),Md(`load`,t);break;case`details`:Md(`toggle`,t);break;case`input`:Md(`invalid`,t),Vt(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case`select`:Md(`invalid`,t);break;case`textarea`:Md(`invalid`,t),Gt(t,r.value,r.defaultValue,r.children)}n=r.children,typeof n!=`string`&&typeof n!=`number`&&typeof n!=`bigint`||t.textContent===``+n||!0===r.suppressHydrationWarning||Gd(t.textContent,n)?(r.popover!=null&&(Md(`beforetoggle`,t),Md(`toggle`,t)),r.onScroll!=null&&Md(`scroll`,t),r.onScrollEnd!=null&&Md(`scrollend`,t),r.onClick!=null&&(t.onclick=en),t=!0):t=!1,t||Bi(e,!0)}function Hi(e){for(Pi=e.return;Pi;)switch(Pi.tag){case 5:case 31:case 13:Ri=!1;return;case 27:case 3:Ri=!0;return;default:Pi=Pi.return}}function Ui(e){if(e!==Pi)return!1;if(!Ii)return Hi(e),Ii=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=!(n!==`form`&&n!==`button`)||rf(e.type,e.memoizedProps)),n=!n),n&&Fi&&Bi(e),Hi(e),t===13){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(a(317));Fi=wf(e)}else if(t===31){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(a(317));Fi=wf(e)}else t===27?(t=Fi,ff(e.type)?(e=Cf,Cf=null,Fi=e):Fi=t):Fi=Pi?Sf(e.stateNode.nextSibling):null;return!0}function Wi(){Fi=Pi=null,Ii=!1}function Gi(){var e=Li;return e!==null&&(lu===null?lu=e:lu.push.apply(lu,e),Li=null),e}function Ki(e){Li===null?Li=[e]:Li.push(e)}var qi=ie(null),Ji=null,Yi=null;function Xi(e,t,n){oe(qi,t._currentValue),t._currentValue=n}function Zi(e){e._currentValue=qi.current,ae(qi)}function Qi(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)===t?r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t):(e.childLanes|=t,r!==null&&(r.childLanes|=t)),e===n)break;e=e.return}}function $i(e,t,n,r){var i=e.child;for(i!==null&&(i.return=e);i!==null;){var o=i.dependencies;if(o!==null){var s=i.child;o=o.firstContext;a:for(;o!==null;){var c=o;o=i;for(var l=0;l<t.length;l++)if(c.context===t[l]){o.lanes|=n,c=o.alternate,c!==null&&(c.lanes|=n),Qi(o.return,n,e),r||(s=null);break a}o=c.next}}else if(i.tag===18){if(s=i.return,s===null)throw Error(a(341));s.lanes|=n,o=s.alternate,o!==null&&(o.lanes|=n),Qi(s,n,e),s=null}else s=i.child;if(s!==null)s.return=i;else for(s=i;s!==null;){if(s===e){s=null;break}if(i=s.sibling,i!==null){i.return=s.return,s=i;break}s=s.return}i=s}}function ea(e,t,n,r){e=null;for(var i=t,o=!1;i!==null;){if(!o){if(i.flags&524288)o=!0;else if(i.flags&262144)break}if(i.tag===10){var s=i.alternate;if(s===null)throw Error(a(387));if(s=s.memoizedProps,s!==null){var c=i.type;Cr(i.pendingProps.value,s.value)||(e===null?e=[c]:e.push(c))}}else if(i===le.current){if(s=i.alternate,s===null)throw Error(a(387));s.memoizedState.memoizedState!==i.memoizedState.memoizedState&&(e===null?e=[fp]:e.push(fp))}i=i.return}e!==null&&$i(t,e,n,r),t.flags|=262144}function ta(e){for(e=e.firstContext;e!==null;){if(!Cr(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function na(e){Ji=e,Yi=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function ra(e){return aa(Ji,e)}function ia(e,t){return Ji===null&&na(e),aa(e,t)}function aa(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},Yi===null){if(e===null)throw Error(a(308));Yi=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Yi=Yi.next=t;return n}var oa=typeof AbortController<`u`?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(t,n){e.push(n)}};this.abort=function(){t.aborted=!0,e.forEach(function(e){return e()})}},sa=n.unstable_scheduleCallback,ca=n.unstable_NormalPriority,R={$$typeof:C,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function la(){return{controller:new oa,data:new Map,refCount:0}}function ua(e){e.refCount--,e.refCount===0&&sa(ca,function(){e.controller.abort()})}var da=null,fa=0,pa=0,ma=null;function ha(e,t){if(da===null){var n=da=[];fa=0,pa=Cd(),ma={status:`pending`,value:void 0,then:function(e){n.push(e)}}}return fa++,t.then(ga,ga),t}function ga(){if(--fa===0&&da!==null){ma!==null&&(ma.status=`fulfilled`);var e=da;da=null,pa=0,ma=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function _a(e,t){var n=[],r={status:`pending`,value:null,reason:null,then:function(e){n.push(e)}};return e.then(function(){r.status=`fulfilled`,r.value=t;for(var e=0;e<n.length;e++)(0,n[e])(t)},function(e){for(r.status=`rejected`,r.reason=e,e=0;e<n.length;e++)(0,n[e])(void 0)}),r}var va=F.S;F.S=function(e,t){fu=Ee(),typeof t==`object`&&t&&typeof t.then==`function`&&ha(e,t),va!==null&&va(e,t)};var ya=ie(null);function ba(){var e=ya.current;return e===null?ql.pooledCache:e}function xa(e,t){t===null?oe(ya,ya.current):oe(ya,t.pool)}function Sa(){var e=ba();return e===null?null:{parent:R._currentValue,pool:e}}var Ca=Error(a(460)),wa=Error(a(474)),Ta=Error(a(542)),Ea={then:function(){}};function Da(e){return e=e.status,e===`fulfilled`||e===`rejected`}function Oa(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(en,en),t=n),t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,Ma(e),e;default:if(typeof t.status==`string`)t.then(en,en);else{if(e=ql,e!==null&&100<e.shellSuspendCounter)throw Error(a(482));e=t,e.status=`pending`,e.then(function(e){if(t.status===`pending`){var n=t;n.status=`fulfilled`,n.value=e}},function(e){if(t.status===`pending`){var n=t;n.status=`rejected`,n.reason=e}})}switch(t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,Ma(e),e}throw Aa=t,Ca}}function ka(e){try{var t=e._init;return t(e._payload)}catch(e){throw typeof e==`object`&&e&&typeof e.then==`function`?(Aa=e,Ca):e}}var Aa=null;function ja(){if(Aa===null)throw Error(a(459));var e=Aa;return Aa=null,e}function Ma(e){if(e===Ca||e===Ta)throw Error(a(483))}var Na=null,Pa=0;function Fa(e){var t=Pa;return Pa+=1,Na===null&&(Na=[]),Oa(Na,e,t)}function Ia(e,t){t=t.props.ref,e.ref=t===void 0?null:t}function La(e,t){throw t.$$typeof===g?Error(a(525)):(e=Object.prototype.toString.call(t),Error(a(31,e===`[object Object]`?`object with keys {`+Object.keys(t).join(`, `)+`}`:e)))}function Ra(e){function t(t,n){if(e){var r=t.deletions;r===null?(t.deletions=[n],t.flags|=16):r.push(n)}}function n(n,r){if(!e)return null;for(;r!==null;)t(n,r),r=r.sibling;return null}function r(e){for(var t=new Map;e!==null;)e.key===null?t.set(e.index,e):t.set(e.key,e),e=e.sibling;return t}function i(e,t){return e=di(e,t),e.index=0,e.sibling=null,e}function o(t,n,r){return t.index=r,e?(r=t.alternate,r===null?(t.flags|=67108866,n):(r=r.index,r<n?(t.flags|=67108866,n):r)):(t.flags|=1048576,n)}function s(t){return e&&t.alternate===null&&(t.flags|=67108866),t}function c(e,t,n,r){return t===null||t.tag!==6?(t=hi(n,e.mode,r),t.return=e,t):(t=i(t,n),t.return=e,t)}function l(e,t,n,r){var a=n.type;return a===y?d(e,t,n.props.children,r,n.key):t!==null&&(t.elementType===a||typeof a==`object`&&a&&a.$$typeof===O&&ka(a)===t.type)?(t=i(t,n.props),Ia(t,n),t.return=e,t):(t=pi(n.type,n.key,n.props,null,e.mode,r),Ia(t,n),t.return=e,t)}function u(e,t,n,r){return t===null||t.tag!==4||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?(t=_i(n,e.mode,r),t.return=e,t):(t=i(t,n.children||[]),t.return=e,t)}function d(e,t,n,r,a){return t===null||t.tag!==7?(t=mi(n,e.mode,r,a),t.return=e,t):(t=i(t,n),t.return=e,t)}function f(e,t,n){if(typeof t==`string`&&t!==``||typeof t==`number`||typeof t==`bigint`)return t=hi(``+t,e.mode,n),t.return=e,t;if(typeof t==`object`&&t){switch(t.$$typeof){case _:return n=pi(t.type,t.key,t.props,null,e.mode,n),Ia(n,t),n.return=e,n;case v:return t=_i(t,e.mode,n),t.return=e,t;case O:return t=ka(t),f(e,t,n)}if(ee(t)||M(t))return t=mi(t,e.mode,n,null),t.return=e,t;if(typeof t.then==`function`)return f(e,Fa(t),n);if(t.$$typeof===C)return f(e,ia(e,t),n);La(e,t)}return null}function p(e,t,n,r){var i=t===null?null:t.key;if(typeof n==`string`&&n!==``||typeof n==`number`||typeof n==`bigint`)return i===null?c(e,t,``+n,r):null;if(typeof n==`object`&&n){switch(n.$$typeof){case _:return n.key===i?l(e,t,n,r):null;case v:return n.key===i?u(e,t,n,r):null;case O:return n=ka(n),p(e,t,n,r)}if(ee(n)||M(n))return i===null?d(e,t,n,r,null):null;if(typeof n.then==`function`)return p(e,t,Fa(n),r);if(n.$$typeof===C)return p(e,t,ia(e,n),r);La(e,n)}return null}function m(e,t,n,r,i){if(typeof r==`string`&&r!==``||typeof r==`number`||typeof r==`bigint`)return e=e.get(n)||null,c(t,e,``+r,i);if(typeof r==`object`&&r){switch(r.$$typeof){case _:return e=e.get(r.key===null?n:r.key)||null,l(t,e,r,i);case v:return e=e.get(r.key===null?n:r.key)||null,u(t,e,r,i);case O:return r=ka(r),m(e,t,n,r,i)}if(ee(r)||M(r))return e=e.get(n)||null,d(t,e,r,i,null);if(typeof r.then==`function`)return m(e,t,n,Fa(r),i);if(r.$$typeof===C)return m(e,t,n,ia(t,r),i);La(t,r)}return null}function h(i,a,s,c){for(var l=null,u=null,d=a,h=a=0,g=null;d!==null&&h<s.length;h++){d.index>h?(g=d,d=null):g=d.sibling;var _=p(i,d,s[h],c);if(_===null){d===null&&(d=g);break}e&&d&&_.alternate===null&&t(i,d),a=o(_,a,h),u===null?l=_:u.sibling=_,u=_,d=g}if(h===s.length)return n(i,d),Ii&&ki(i,h),l;if(d===null){for(;h<s.length;h++)d=f(i,s[h],c),d!==null&&(a=o(d,a,h),u===null?l=d:u.sibling=d,u=d);return Ii&&ki(i,h),l}for(d=r(d);h<s.length;h++)g=m(d,i,h,s[h],c),g!==null&&(e&&g.alternate!==null&&d.delete(g.key===null?h:g.key),a=o(g,a,h),u===null?l=g:u.sibling=g,u=g);return e&&d.forEach(function(e){return t(i,e)}),Ii&&ki(i,h),l}function g(i,s,c,l){if(c==null)throw Error(a(151));for(var u=null,d=null,h=s,g=s=0,_=null,v=c.next();h!==null&&!v.done;g++,v=c.next()){h.index>g?(_=h,h=null):_=h.sibling;var y=p(i,h,v.value,l);if(y===null){h===null&&(h=_);break}e&&h&&y.alternate===null&&t(i,h),s=o(y,s,g),d===null?u=y:d.sibling=y,d=y,h=_}if(v.done)return n(i,h),Ii&&ki(i,g),u;if(h===null){for(;!v.done;g++,v=c.next())v=f(i,v.value,l),v!==null&&(s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return Ii&&ki(i,g),u}for(h=r(h);!v.done;g++,v=c.next())v=m(h,i,g,v.value,l),v!==null&&(e&&v.alternate!==null&&h.delete(v.key===null?g:v.key),s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return e&&h.forEach(function(e){return t(i,e)}),Ii&&ki(i,g),u}function b(e,r,o,c){if(typeof o==`object`&&o&&o.type===y&&o.key===null&&(o=o.props.children),typeof o==`object`&&o){switch(o.$$typeof){case _:a:{for(var l=o.key;r!==null;){if(r.key===l){if(l=o.type,l===y){if(r.tag===7){n(e,r.sibling),c=i(r,o.props.children),c.return=e,e=c;break a}}else if(r.elementType===l||typeof l==`object`&&l&&l.$$typeof===O&&ka(l)===r.type){n(e,r.sibling),c=i(r,o.props),Ia(c,o),c.return=e,e=c;break a}n(e,r);break}else t(e,r);r=r.sibling}o.type===y?(c=mi(o.props.children,e.mode,c,o.key),c.return=e,e=c):(c=pi(o.type,o.key,o.props,null,e.mode,c),Ia(c,o),c.return=e,e=c)}return s(e);case v:a:{for(l=o.key;r!==null;){if(r.key===l)if(r.tag===4&&r.stateNode.containerInfo===o.containerInfo&&r.stateNode.implementation===o.implementation){n(e,r.sibling),c=i(r,o.children||[]),c.return=e,e=c;break a}else{n(e,r);break}else t(e,r);r=r.sibling}c=_i(o,e.mode,c),c.return=e,e=c}return s(e);case O:return o=ka(o),b(e,r,o,c)}if(ee(o))return h(e,r,o,c);if(M(o)){if(l=M(o),typeof l!=`function`)throw Error(a(150));return o=l.call(o),g(e,r,o,c)}if(typeof o.then==`function`)return b(e,r,Fa(o),c);if(o.$$typeof===C)return b(e,r,ia(e,o),c);La(e,o)}return typeof o==`string`&&o!==``||typeof o==`number`||typeof o==`bigint`?(o=``+o,r!==null&&r.tag===6?(n(e,r.sibling),c=i(r,o),c.return=e,e=c):(n(e,r),c=hi(o,e.mode,c),c.return=e,e=c),s(e)):n(e,r)}return function(e,t,n,r){try{Pa=0;var i=b(e,t,n,r);return Na=null,i}catch(t){if(t===Ca||t===Ta)throw t;var a=li(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var za=Ra(!0),Ba=Ra(!1),Va=!1;function Ha(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Ua(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function Wa(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Ga(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,Kl&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=oi(e),ai(e,null,n),t}return ni(e,r,t,n),oi(e)}function Ka(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,n&4194048)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,et(e,n)}}function qa(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var o={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};a===null?i=a=o:a=a.next=o,n=n.next}while(n!==null);a===null?i=a=t:a=a.next=t}else i=a=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:r.shared,callbacks:r.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var Ja=!1;function Ya(){if(Ja){var e=ma;if(e!==null)throw e}}function Xa(e,t,n,r){Ja=!1;var i=e.updateQueue;Va=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var c=s,l=c.next;c.next=null,o===null?a=l:o.next=l,o=c;var u=e.alternate;u!==null&&(u=u.updateQueue,s=u.lastBaseUpdate,s!==o&&(s===null?u.firstBaseUpdate=l:s.next=l,u.lastBaseUpdate=c))}if(a!==null){var d=i.baseState;o=0,u=l=c=null,s=a;do{var f=s.lane&-536870913,p=f!==s.lane;if(p?(Yl&f)===f:(r&f)===f){f!==0&&f===pa&&(Ja=!0),u!==null&&(u=u.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});a:{var m=e,g=s;f=t;var _=n;switch(g.tag){case 1:if(m=g.payload,typeof m==`function`){d=m.call(_,d,f);break a}d=m;break a;case 3:m.flags=m.flags&-65537|128;case 0:if(m=g.payload,f=typeof m==`function`?m.call(_,d,f):m,f==null)break a;d=h({},d,f);break a;case 2:Va=!0}}f=s.callback,f!==null&&(e.flags|=64,p&&(e.flags|=8192),p=i.callbacks,p===null?i.callbacks=[f]:p.push(f))}else p={lane:f,tag:s.tag,payload:s.payload,callback:s.callback,next:null},u===null?(l=u=p,c=d):u=u.next=p,o|=f;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;p=s,s=p.next,p.next=null,i.lastBaseUpdate=p,i.shared.pending=null}}while(1);u===null&&(c=d),i.baseState=c,i.firstBaseUpdate=l,i.lastBaseUpdate=u,a===null&&(i.shared.lanes=0),ru|=o,e.lanes=o,e.memoizedState=d}}function Za(e,t){if(typeof e!=`function`)throw Error(a(191,e));e.call(t)}function Qa(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)Za(n[e],t)}var $a=ie(null),eo=ie(0);function to(e,t){e=tu,oe(eo,e),oe($a,t),tu=e|t.baseLanes}function no(){oe(eo,tu),oe($a,$a.current)}function ro(){tu=eo.current,ae($a),ae(eo)}var io=ie(null),ao=null;function oo(e){var t=e.alternate;oe(fo,fo.current&1),oe(io,e),ao===null&&(t===null||$a.current!==null||t.memoizedState!==null)&&(ao=e)}function so(e){oe(fo,fo.current),oe(io,e),ao===null&&(ao=e)}function co(e){e.tag===22?(oe(fo,fo.current),oe(io,e),ao===null&&(ao=e)):lo(e)}function lo(){oe(fo,fo.current),oe(io,io.current)}function uo(e){ae(io),ao===e&&(ao=null),ae(fo)}var fo=ie(0);function po(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||yf(n)||bf(n)))return t}else if(t.tag===19&&(t.memoizedProps.revealOrder===`forwards`||t.memoizedProps.revealOrder===`backwards`||t.memoizedProps.revealOrder===`unstable_legacy-backwards`||t.memoizedProps.revealOrder===`together`)){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var mo=0,ho=null,go=null,_o=null,vo=!1,yo=!1,bo=!1,xo=0,So=0,Co=null,wo=0;function To(){throw Error(a(321))}function Eo(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Cr(e[n],t[n]))return!1;return!0}function Do(e,t,n,r,i,a){return mo=a,ho=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,F.H=e===null||e.memoizedState===null?Ws:Gs,bo=!1,a=n(r,i),bo=!1,yo&&(a=ko(t,n,r,i)),Oo(e),a}function Oo(e){F.H=Us;var t=go!==null&&go.next!==null;if(mo=0,_o=go=ho=null,vo=!1,So=0,Co=null,t)throw Error(a(300));e===null||cc||(e=e.dependencies,e!==null&&ta(e)&&(cc=!0))}function ko(e,t,n,r){ho=e;var i=0;do{if(yo&&(Co=null),So=0,yo=!1,25<=i)throw Error(a(301));if(i+=1,_o=go=null,e.updateQueue!=null){var o=e.updateQueue;o.lastEffect=null,o.events=null,o.stores=null,o.memoCache!=null&&(o.memoCache.index=0)}F.H=Ks,o=t(n,r)}while(yo);return o}function Ao(){var e=F.H,t=e.useState()[0];return t=typeof t.then==`function`?Lo(t):t,e=e.useState()[0],(go===null?null:go.memoizedState)!==e&&(ho.flags|=1024),t}function jo(){var e=xo!==0;return xo=0,e}function Mo(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function No(e){if(vo){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}vo=!1}mo=0,_o=go=ho=null,yo=!1,So=xo=0,Co=null}function Po(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return _o===null?ho.memoizedState=_o=e:_o=_o.next=e,_o}function Fo(){if(go===null){var e=ho.alternate;e=e===null?null:e.memoizedState}else e=go.next;var t=_o===null?ho.memoizedState:_o.next;if(t!==null)_o=t,go=e;else{if(e===null)throw ho.alternate===null?Error(a(467)):Error(a(310));go=e,e={memoizedState:go.memoizedState,baseState:go.baseState,baseQueue:go.baseQueue,queue:go.queue,next:null},_o===null?ho.memoizedState=_o=e:_o=_o.next=e}return _o}function Io(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Lo(e){var t=So;return So+=1,Co===null&&(Co=[]),e=Oa(Co,e,t),t=ho,(_o===null?t.memoizedState:_o.next)===null&&(t=t.alternate,F.H=t===null||t.memoizedState===null?Ws:Gs),e}function Ro(e){if(typeof e==`object`&&e){if(typeof e.then==`function`)return Lo(e);if(e.$$typeof===C)return ra(e)}throw Error(a(438,String(e)))}function zo(e){var t=null,n=ho.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=ho.alternate;r!==null&&(r=r.updateQueue,r!==null&&(r=r.memoCache,r!=null&&(t={data:r.data.map(function(e){return e.slice()}),index:0})))}if(t??={data:[],index:0},n===null&&(n=Io(),ho.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),r=0;r<e;r++)n[r]=A;return t.index++,n}function Bo(e,t){return typeof t==`function`?t(e):t}function Vo(e){return Ho(Fo(),go,e)}function Ho(e,t,n){var r=e.queue;if(r===null)throw Error(a(311));r.lastRenderedReducer=n;var i=e.baseQueue,o=r.pending;if(o!==null){if(i!==null){var s=i.next;i.next=o.next,o.next=s}t.baseQueue=i=o,r.pending=null}if(o=e.baseState,i===null)e.memoizedState=o;else{t=i.next;var c=s=null,l=null,u=t,d=!1;do{var f=u.lane&-536870913;if(f===u.lane?(mo&f)===f:(Yl&f)===f){var p=u.revertLane;if(p===0)l!==null&&(l=l.next={lane:0,revertLane:0,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),f===pa&&(d=!0);else if((mo&p)===p){u=u.next,p===pa&&(d=!0);continue}else f={lane:0,revertLane:u.revertLane,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=f,s=o):l=l.next=f,ho.lanes|=p,ru|=p;f=u.action,bo&&n(o,f),o=u.hasEagerState?u.eagerState:n(o,f)}else p={lane:f,revertLane:u.revertLane,gesture:u.gesture,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=p,s=o):l=l.next=p,ho.lanes|=f,ru|=f;u=u.next}while(u!==null&&u!==t);if(l===null?s=o:l.next=c,!Cr(o,e.memoizedState)&&(cc=!0,d&&(n=ma,n!==null)))throw n;e.memoizedState=o,e.baseState=s,e.baseQueue=l,r.lastRenderedState=o}return i===null&&(r.lanes=0),[e.memoizedState,r.dispatch]}function Uo(e){var t=Fo(),n=t.queue;if(n===null)throw Error(a(311));n.lastRenderedReducer=e;var r=n.dispatch,i=n.pending,o=t.memoizedState;if(i!==null){n.pending=null;var s=i=i.next;do o=e(o,s.action),s=s.next;while(s!==i);Cr(o,t.memoizedState)||(cc=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function Wo(e,t,n){var r=ho,i=Fo(),o=Ii;if(o){if(n===void 0)throw Error(a(407));n=n()}else n=t();var s=!Cr((go||i).memoizedState,n);if(s&&(i.memoizedState=n,cc=!0),i=i.queue,hs(qo.bind(null,r,i,e),[e]),i.getSnapshot!==t||s||_o!==null&&_o.memoizedState.tag&1){if(r.flags|=2048,us(9,{destroy:void 0},Ko.bind(null,r,i,n,t),null),ql===null)throw Error(a(349));o||mo&127||Go(r,t,n)}return n}function Go(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=ho.updateQueue,t===null?(t=Io(),ho.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function Ko(e,t,n,r){t.value=n,t.getSnapshot=r,Jo(t)&&Yo(e)}function qo(e,t,n){return n(function(){Jo(t)&&Yo(e)})}function Jo(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Cr(e,n)}catch{return!0}}function Yo(e){var t=ii(e,2);t!==null&&Du(t,e,2)}function Xo(e){var t=Po();if(typeof e==`function`){var n=e;if(e=n(),bo){Le(!0);try{n()}finally{Le(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Bo,lastRenderedState:e},t}function Zo(e,t,n,r){return e.baseState=n,Ho(e,go,typeof r==`function`?r:Bo)}function Qo(e,t,n,r,i){if(Bs(e))throw Error(a(485));if(e=t.action,e!==null){var o={payload:i,action:e,next:null,isTransition:!0,status:`pending`,value:null,reason:null,listeners:[],then:function(e){o.listeners.push(e)}};F.T===null?o.isTransition=!1:n(!0),r(o),n=t.pending,n===null?(o.next=t.pending=o,$o(t,o)):(o.next=n.next,t.pending=n.next=o)}}function $o(e,t){var n=t.action,r=t.payload,i=e.state;if(t.isTransition){var a=F.T,o={};F.T=o;try{var s=n(i,r),c=F.S;c!==null&&c(o,s),es(e,t,s)}catch(n){ns(e,t,n)}finally{a!==null&&o.types!==null&&(a.types=o.types),F.T=a}}else try{a=n(i,r),es(e,t,a)}catch(n){ns(e,t,n)}}function es(e,t,n){typeof n==`object`&&n&&typeof n.then==`function`?n.then(function(n){ts(e,t,n)},function(n){return ns(e,t,n)}):ts(e,t,n)}function ts(e,t,n){t.status=`fulfilled`,t.value=n,rs(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,$o(e,n)))}function ns(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status=`rejected`,t.reason=n,rs(t),t=t.next;while(t!==r)}e.action=null}function rs(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function is(e,t){return t}function as(e,t){if(Ii){var n=ql.formState;if(n!==null){a:{var r=ho;if(Ii){if(Fi){b:{for(var i=Fi,a=Ri;i.nodeType!==8;){if(!a){i=null;break b}if(i=Sf(i.nextSibling),i===null){i=null;break b}}a=i.data,i=a===`F!`||a===`F`?i:null}if(i){Fi=Sf(i.nextSibling),r=i.data===`F!`;break a}}Bi(r)}r=!1}r&&(t=n[0])}}return n=Po(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:is,lastRenderedState:t},n.queue=r,n=Ls.bind(null,ho,r),r.dispatch=n,r=Xo(!1),a=zs.bind(null,ho,!1,r.queue),r=Po(),i={state:t,dispatch:null,action:e,pending:null},r.queue=i,n=Qo.bind(null,ho,i,a,n),i.dispatch=n,r.memoizedState=e,[t,n,!1]}function os(e){return ss(Fo(),go,e)}function ss(e,t,n){if(t=Ho(e,t,is)[0],e=Vo(Bo)[0],typeof t==`object`&&t&&typeof t.then==`function`)try{var r=Lo(t)}catch(e){throw e===Ca?Ta:e}else r=t;t=Fo();var i=t.queue,a=i.dispatch;return n!==t.memoizedState&&(ho.flags|=2048,us(9,{destroy:void 0},cs.bind(null,i,n),null)),[r,a,e]}function cs(e,t){e.action=t}function ls(e){var t=Fo(),n=go;if(n!==null)return ss(t,n,e);Fo(),t=t.memoizedState,n=Fo();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function us(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=ho.updateQueue,t===null&&(t=Io(),ho.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e),e}function ds(){return Fo().memoizedState}function fs(e,t,n,r){var i=Po();ho.flags|=e,i.memoizedState=us(1|t,{destroy:void 0},n,r===void 0?null:r)}function ps(e,t,n,r){var i=Fo();r=r===void 0?null:r;var a=i.memoizedState.inst;go!==null&&r!==null&&Eo(r,go.memoizedState.deps)?i.memoizedState=us(t,a,n,r):(ho.flags|=e,i.memoizedState=us(1|t,a,n,r))}function ms(e,t){fs(8390656,8,e,t)}function hs(e,t){ps(2048,8,e,t)}function gs(e){ho.flags|=4;var t=ho.updateQueue;if(t===null)t=Io(),ho.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function _s(e){var t=Fo().memoizedState;return gs({ref:t,nextImpl:e}),function(){if(Kl&2)throw Error(a(440));return t.impl.apply(void 0,arguments)}}function vs(e,t){return ps(4,2,e,t)}function ys(e,t){return ps(4,4,e,t)}function bs(e,t){if(typeof t==`function`){e=e();var n=t(e);return function(){typeof n==`function`?n():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function xs(e,t,n){n=n==null?null:n.concat([e]),ps(4,4,bs.bind(null,t,e),n)}function Ss(){}function Cs(e,t){var n=Fo();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&Eo(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function ws(e,t){var n=Fo();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&Eo(t,r[1]))return r[0];if(r=e(),bo){Le(!0);try{e()}finally{Le(!1)}}return n.memoizedState=[r,t],r}function Ts(e,t,n){return n===void 0||mo&1073741824&&!(Yl&261930)?e.memoizedState=t:(e.memoizedState=n,e=Eu(),ho.lanes|=e,ru|=e,n)}function Es(e,t,n,r){return Cr(n,t)?n:$a.current===null?!(mo&42)||mo&1073741824&&!(Yl&261930)?(cc=!0,e.memoizedState=n):(e=Eu(),ho.lanes|=e,ru|=e,t):(e=Ts(e,n,r),Cr(e,t)||(cc=!0),e)}function Ds(e,t,n,r,i){var a=te.p;te.p=a!==0&&8>a?a:8;var o=F.T,s={};F.T=s,zs(e,!1,t,n);try{var c=i(),l=F.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?Rs(e,t,_a(c,r),Tu(e)):Rs(e,t,r,Tu(e))}catch(n){Rs(e,t,{then:function(){},status:`rejected`,reason:n},Tu())}finally{te.p=a,o!==null&&s.types!==null&&(o.types=s.types),F.T=o}}function Os(){}function ks(e,t,n,r){if(e.tag!==5)throw Error(a(476));var i=As(e).queue;Ds(e,i,t,ne,n===null?Os:function(){return js(e),n(r)})}function As(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:ne,baseState:ne,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Bo,lastRenderedState:ne},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Bo,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function js(e){var t=As(e);t.next===null&&(t=e.alternate.memoizedState),Rs(e,t.next.queue,{},Tu())}function Ms(){return ra(fp)}function Ns(){return Fo().memoizedState}function Ps(){return Fo().memoizedState}function Fs(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=Tu();e=Wa(n);var r=Ga(t,e,n);r!==null&&(Du(r,t,n),Ka(r,t,n)),t={cache:la()},e.payload=t;return}t=t.return}}function Is(e,t,n){var r=Tu();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},Bs(e)?Vs(t,n):(n=ri(e,t,n,r),n!==null&&(Du(n,e,r),Hs(n,t,r)))}function Ls(e,t,n){Rs(e,t,n,Tu())}function Rs(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(Bs(e))Vs(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var o=t.lastRenderedState,s=a(o,n);if(i.hasEagerState=!0,i.eagerState=s,Cr(s,o))return ni(e,t,i,0),ql===null&&ti(),!1}catch{}if(n=ri(e,t,i,r),n!==null)return Du(n,e,r),Hs(n,t,r),!0}return!1}function zs(e,t,n,r){if(r={lane:2,revertLane:Cd(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},Bs(e)){if(t)throw Error(a(479))}else t=ri(e,n,r,2),t!==null&&Du(t,e,2)}function Bs(e){var t=e.alternate;return e===ho||t!==null&&t===ho}function Vs(e,t){yo=vo=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Hs(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,et(e,n)}}var Us={readContext:ra,use:Ro,useCallback:To,useContext:To,useEffect:To,useImperativeHandle:To,useLayoutEffect:To,useInsertionEffect:To,useMemo:To,useReducer:To,useRef:To,useState:To,useDebugValue:To,useDeferredValue:To,useTransition:To,useSyncExternalStore:To,useId:To,useHostTransitionStatus:To,useFormState:To,useActionState:To,useOptimistic:To,useMemoCache:To,useCacheRefresh:To};Us.useEffectEvent=To;var Ws={readContext:ra,use:Ro,useCallback:function(e,t){return Po().memoizedState=[e,t===void 0?null:t],e},useContext:ra,useEffect:ms,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),fs(4194308,4,bs.bind(null,t,e),n)},useLayoutEffect:function(e,t){return fs(4194308,4,e,t)},useInsertionEffect:function(e,t){fs(4,2,e,t)},useMemo:function(e,t){var n=Po();t=t===void 0?null:t;var r=e();if(bo){Le(!0);try{e()}finally{Le(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=Po();if(n!==void 0){var i=n(t);if(bo){Le(!0);try{n(t)}finally{Le(!1)}}}else i=t;return r.memoizedState=r.baseState=i,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:i},r.queue=e,e=e.dispatch=Is.bind(null,ho,e),[r.memoizedState,e]},useRef:function(e){var t=Po();return e={current:e},t.memoizedState=e},useState:function(e){e=Xo(e);var t=e.queue,n=Ls.bind(null,ho,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:Ss,useDeferredValue:function(e,t){return Ts(Po(),e,t)},useTransition:function(){var e=Xo(!1);return e=Ds.bind(null,ho,e.queue,!0,!1),Po().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=ho,i=Po();if(Ii){if(n===void 0)throw Error(a(407));n=n()}else{if(n=t(),ql===null)throw Error(a(349));Yl&127||Go(r,t,n)}i.memoizedState=n;var o={value:n,getSnapshot:t};return i.queue=o,ms(qo.bind(null,r,o,e),[e]),r.flags|=2048,us(9,{destroy:void 0},Ko.bind(null,r,o,n,t),null),n},useId:function(){var e=Po(),t=ql.identifierPrefix;if(Ii){var n=Oi,r=Di;n=(r&~(1<<32-Re(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=xo++,0<n&&(t+=`H`+n.toString(32)),t+=`_`}else n=wo++,t=`_`+t+`r_`+n.toString(32)+`_`;return e.memoizedState=t},useHostTransitionStatus:Ms,useFormState:as,useActionState:as,useOptimistic:function(e){var t=Po();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=zs.bind(null,ho,!0,n),n.dispatch=t,[e,t]},useMemoCache:zo,useCacheRefresh:function(){return Po().memoizedState=Fs.bind(null,ho)},useEffectEvent:function(e){var t=Po(),n={impl:e};return t.memoizedState=n,function(){if(Kl&2)throw Error(a(440));return n.impl.apply(void 0,arguments)}}},Gs={readContext:ra,use:Ro,useCallback:Cs,useContext:ra,useEffect:hs,useImperativeHandle:xs,useInsertionEffect:vs,useLayoutEffect:ys,useMemo:ws,useReducer:Vo,useRef:ds,useState:function(){return Vo(Bo)},useDebugValue:Ss,useDeferredValue:function(e,t){return Es(Fo(),go.memoizedState,e,t)},useTransition:function(){var e=Vo(Bo)[0],t=Fo().memoizedState;return[typeof e==`boolean`?e:Lo(e),t]},useSyncExternalStore:Wo,useId:Ns,useHostTransitionStatus:Ms,useFormState:os,useActionState:os,useOptimistic:function(e,t){return Zo(Fo(),go,e,t)},useMemoCache:zo,useCacheRefresh:Ps};Gs.useEffectEvent=_s;var Ks={readContext:ra,use:Ro,useCallback:Cs,useContext:ra,useEffect:hs,useImperativeHandle:xs,useInsertionEffect:vs,useLayoutEffect:ys,useMemo:ws,useReducer:Uo,useRef:ds,useState:function(){return Uo(Bo)},useDebugValue:Ss,useDeferredValue:function(e,t){var n=Fo();return go===null?Ts(n,e,t):Es(n,go.memoizedState,e,t)},useTransition:function(){var e=Uo(Bo)[0],t=Fo().memoizedState;return[typeof e==`boolean`?e:Lo(e),t]},useSyncExternalStore:Wo,useId:Ns,useHostTransitionStatus:Ms,useFormState:ls,useActionState:ls,useOptimistic:function(e,t){var n=Fo();return go===null?(n.baseState=e,[e,n.queue.dispatch]):Zo(n,go,e,t)},useMemoCache:zo,useCacheRefresh:Ps};Ks.useEffectEvent=_s;function qs(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:h({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Js={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=Tu(),i=Wa(r);i.payload=t,n!=null&&(i.callback=n),t=Ga(e,i,r),t!==null&&(Du(t,e,r),Ka(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=Tu(),i=Wa(r);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=Ga(e,i,r),t!==null&&(Du(t,e,r),Ka(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Tu(),r=Wa(n);r.tag=2,t!=null&&(r.callback=t),t=Ga(e,r,n),t!==null&&(Du(t,e,n),Ka(t,e,n))}};function Ys(e,t,n,r,i,a,o){return e=e.stateNode,typeof e.shouldComponentUpdate==`function`?e.shouldComponentUpdate(r,a,o):t.prototype&&t.prototype.isPureReactComponent?!wr(n,r)||!wr(i,a):!0}function Xs(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps==`function`&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps==`function`&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&Js.enqueueReplaceState(t,t.state,null)}function Zs(e,t){var n=t;if(`ref`in t)for(var r in n={},t)r!==`ref`&&(n[r]=t[r]);if(e=e.defaultProps)for(var i in n===t&&(n=h({},n)),e)n[i]===void 0&&(n[i]=e[i]);return n}function Qs(e){Zr(e)}function $s(e){console.error(e)}function ec(e){Zr(e)}function tc(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(e){setTimeout(function(){throw e})}}function nc(e,t,n){try{var r=e.onCaughtError;r(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(e){setTimeout(function(){throw e})}}function rc(e,t,n){return n=Wa(n),n.tag=3,n.payload={element:null},n.callback=function(){tc(e,t)},n}function ic(e){return e=Wa(e),e.tag=3,e}function ac(e,t,n,r){var i=n.type.getDerivedStateFromError;if(typeof i==`function`){var a=r.value;e.payload=function(){return i(a)},e.callback=function(){nc(t,n,r)}}var o=n.stateNode;o!==null&&typeof o.componentDidCatch==`function`&&(e.callback=function(){nc(t,n,r),typeof i!=`function`&&(hu===null?hu=new Set([this]):hu.add(this));var e=r.stack;this.componentDidCatch(r.value,{componentStack:e===null?``:e})})}function oc(e,t,n,r,i){if(n.flags|=32768,typeof r==`object`&&r&&typeof r.then==`function`){if(t=n.alternate,t!==null&&ea(t,n,i,!0),n=io.current,n!==null){switch(n.tag){case 31:case 13:return ao===null?zu():n.alternate===null&&nu===0&&(nu=3),n.flags&=-257,n.flags|=65536,n.lanes=i,r===Ea?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([r]):t.add(r),id(e,r,i)),!1;case 22:return n.flags|=65536,r===Ea?n.flags|=16384:(t=n.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([r])},n.updateQueue=t):(n=t.retryQueue,n===null?t.retryQueue=new Set([r]):n.add(r)),id(e,r,i)),!1}throw Error(a(435,n.tag))}return id(e,r,i),zu(),!1}if(Ii)return t=io.current,t===null?(r!==zi&&(t=Error(a(423),{cause:r}),Ki(yi(t,n))),e=e.current.alternate,e.flags|=65536,i&=-i,e.lanes|=i,r=yi(r,n),i=rc(e.stateNode,r,i),qa(e,i),nu!==4&&(nu=2)):(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=i,r!==zi&&(e=Error(a(422),{cause:r}),Ki(yi(e,n)))),!1;var o=Error(a(520),{cause:r});if(o=yi(o,n),cu===null?cu=[o]:cu.push(o),nu!==4&&(nu=2),t===null)return!0;r=yi(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=i&-i,n.lanes|=e,e=rc(n.stateNode,r,e),qa(n,e),!1;case 1:if(t=n.type,o=n.stateNode,!(n.flags&128)&&(typeof t.getDerivedStateFromError==`function`||o!==null&&typeof o.componentDidCatch==`function`&&(hu===null||!hu.has(o))))return n.flags|=65536,i&=-i,n.lanes|=i,i=ic(i),ac(i,e,n,r),qa(n,i),!1}n=n.return}while(n!==null);return!1}var sc=Error(a(461)),cc=!1;function lc(e,t,n,r){t.child=e===null?Ba(t,null,n,r):za(t,e.child,n,r)}function uc(e,t,n,r,i){n=n.render;var a=t.ref;if(`ref`in r){var o={};for(var s in r)s!==`ref`&&(o[s]=r[s])}else o=r;return na(t),r=Do(e,t,n,o,a,i),s=jo(),e!==null&&!cc?(Mo(e,t,i),Pc(e,t,i)):(Ii&&s&&ji(t),t.flags|=1,lc(e,t,r,i),t.child)}function dc(e,t,n,r,i){if(e===null){var a=n.type;return typeof a==`function`&&!ui(a)&&a.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=a,fc(e,t,a,r,i)):(e=pi(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!Fc(e,i)){var o=a.memoizedProps;if(n=n.compare,n=n===null?wr:n,n(o,r)&&e.ref===t.ref)return Pc(e,t,i)}return t.flags|=1,e=di(a,r),e.ref=t.ref,e.return=t,t.child=e}function fc(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(wr(a,r)&&e.ref===t.ref)if(cc=!1,t.pendingProps=r=a,Fc(e,i))e.flags&131072&&(cc=!0);else return t.lanes=e.lanes,Pc(e,t,i)}return bc(e,t,n,r,i)}function pc(e,t,n,r){var i=r.children,a=e===null?null:e.memoizedState;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.mode===`hidden`){if(t.flags&128){if(a=a===null?n:a.baseLanes|n,e!==null){for(r=t.child=e.child,i=0;r!==null;)i=i|r.lanes|r.childLanes,r=r.sibling;r=i&~a}else r=0,t.child=null;return hc(e,t,a,n,r)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&xa(t,a===null?null:a.cachePool),a===null?no():to(t,a),co(t);else return r=t.lanes=536870912,hc(e,t,a===null?n:a.baseLanes|n,n,r)}else a===null?(e!==null&&xa(t,null),no(),lo(t)):(xa(t,a.cachePool),to(t,a),lo(t),t.memoizedState=null);return lc(e,t,i,n),t.child}function mc(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function hc(e,t,n,r,i){var a=ba();return a=a===null?null:{parent:R._currentValue,pool:a},t.memoizedState={baseLanes:n,cachePool:a},e!==null&&xa(t,null),no(),co(t),e!==null&&ea(e,t,r,!0),t.childLanes=i,null}function gc(e,t){return t=kc({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function _c(e,t,n){return za(t,e.child,null,n),e=gc(t,t.pendingProps),e.flags|=2,uo(t),t.memoizedState=null,e}function vc(e,t,n){var r=t.pendingProps,i=(t.flags&128)!=0;if(t.flags&=-129,e===null){if(Ii){if(r.mode===`hidden`)return e=gc(t,r),t.lanes=536870912,mc(null,e);if(so(t),(e=Fi)?(e=vf(e,Ri),e=e!==null&&e.data===`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Ei===null?null:{id:Di,overflow:Oi},retryLane:536870912,hydrationErrors:null},n=gi(e),n.return=t,t.child=n,Pi=t,Fi=null)):e=null,e===null)throw Bi(t);return t.lanes=536870912,null}return gc(t,r)}var o=e.memoizedState;if(o!==null){var s=o.dehydrated;if(so(t),i)if(t.flags&256)t.flags&=-257,t=_c(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(a(558));else if(cc||ea(e,t,n,!1),i=(n&e.childLanes)!==0,cc||i){if(r=ql,r!==null&&(s=tt(r,n),s!==0&&s!==o.retryLane))throw o.retryLane=s,ii(e,s),Du(r,e,s),sc;zu(),t=_c(e,t,n)}else e=o.treeContext,Fi=Sf(s.nextSibling),Pi=t,Ii=!0,Li=null,Ri=!1,e!==null&&Ni(t,e),t=gc(t,r),t.flags|=4096;return t}return e=di(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function yc(e,t){var n=t.ref;if(n===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof n!=`function`&&typeof n!=`object`)throw Error(a(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function bc(e,t,n,r,i){return na(t),n=Do(e,t,n,r,void 0,i),r=jo(),e!==null&&!cc?(Mo(e,t,i),Pc(e,t,i)):(Ii&&r&&ji(t),t.flags|=1,lc(e,t,n,i),t.child)}function xc(e,t,n,r,i,a){return na(t),t.updateQueue=null,n=ko(t,r,n,i),Oo(e),r=jo(),e!==null&&!cc?(Mo(e,t,a),Pc(e,t,a)):(Ii&&r&&ji(t),t.flags|=1,lc(e,t,n,a),t.child)}function Sc(e,t,n,r,i){if(na(t),t.stateNode===null){var a=si,o=n.contextType;typeof o==`object`&&o&&(a=ra(o)),a=new n(r,a),t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=Js,t.stateNode=a,a._reactInternals=t,a=t.stateNode,a.props=r,a.state=t.memoizedState,a.refs={},Ha(t),o=n.contextType,a.context=typeof o==`object`&&o?ra(o):si,a.state=t.memoizedState,o=n.getDerivedStateFromProps,typeof o==`function`&&(qs(t,n,o,r),a.state=t.memoizedState),typeof n.getDerivedStateFromProps==`function`||typeof a.getSnapshotBeforeUpdate==`function`||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(o=a.state,typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount(),o!==a.state&&Js.enqueueReplaceState(a,a.state,null),Xa(t,r,a,i),Ya(),a.state=t.memoizedState),typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!0}else if(e===null){a=t.stateNode;var s=t.memoizedProps,c=Zs(n,s);a.props=c;var l=a.context,u=n.contextType;o=si,typeof u==`object`&&u&&(o=ra(u));var d=n.getDerivedStateFromProps;u=typeof d==`function`||typeof a.getSnapshotBeforeUpdate==`function`,s=t.pendingProps!==s,u||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(s||l!==o)&&Xs(t,a,r,o),Va=!1;var f=t.memoizedState;a.state=f,Xa(t,r,a,i),Ya(),l=t.memoizedState,s||f!==l||Va?(typeof d==`function`&&(qs(t,n,d,r),l=t.memoizedState),(c=Va||Ys(t,n,c,r,f,l,o))?(u||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount()),typeof a.componentDidMount==`function`&&(t.flags|=4194308)):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=l),a.props=r,a.state=l,a.context=o,r=c):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!1)}else{a=t.stateNode,Ua(e,t),o=t.memoizedProps,u=Zs(n,o),a.props=u,d=t.pendingProps,f=a.context,l=n.contextType,c=si,typeof l==`object`&&l&&(c=ra(l)),s=n.getDerivedStateFromProps,(l=typeof s==`function`||typeof a.getSnapshotBeforeUpdate==`function`)||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(o!==d||f!==c)&&Xs(t,a,r,c),Va=!1,f=t.memoizedState,a.state=f,Xa(t,r,a,i),Ya();var p=t.memoizedState;o!==d||f!==p||Va||e!==null&&e.dependencies!==null&&ta(e.dependencies)?(typeof s==`function`&&(qs(t,n,s,r),p=t.memoizedState),(u=Va||Ys(t,n,u,r,f,p,c)||e!==null&&e.dependencies!==null&&ta(e.dependencies))?(l||typeof a.UNSAFE_componentWillUpdate!=`function`&&typeof a.componentWillUpdate!=`function`||(typeof a.componentWillUpdate==`function`&&a.componentWillUpdate(r,p,c),typeof a.UNSAFE_componentWillUpdate==`function`&&a.UNSAFE_componentWillUpdate(r,p,c)),typeof a.componentDidUpdate==`function`&&(t.flags|=4),typeof a.getSnapshotBeforeUpdate==`function`&&(t.flags|=1024)):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=p),a.props=r,a.state=p,a.context=c,r=u):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return a=r,yc(e,t),r=(t.flags&128)!=0,a||r?(a=t.stateNode,n=r&&typeof n.getDerivedStateFromError!=`function`?null:a.render(),t.flags|=1,e!==null&&r?(t.child=za(t,e.child,null,i),t.child=za(t,null,n,i)):lc(e,t,n,i),t.memoizedState=a.state,e=t.child):e=Pc(e,t,i),e}function Cc(e,t,n,r){return Wi(),t.flags|=256,lc(e,t,n,r),t.child}var wc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Tc(e){return{baseLanes:e,cachePool:Sa()}}function Ec(e,t,n){return e=e===null?0:e.childLanes&~n,t&&(e|=ou),e}function Dc(e,t,n){var r=t.pendingProps,i=!1,o=(t.flags&128)!=0,s;if((s=o)||(s=e!==null&&e.memoizedState===null?!1:(fo.current&2)!=0),s&&(i=!0,t.flags&=-129),s=(t.flags&32)!=0,t.flags&=-33,e===null){if(Ii){if(i?oo(t):lo(t),(e=Fi)?(e=vf(e,Ri),e=e!==null&&e.data!==`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Ei===null?null:{id:Di,overflow:Oi},retryLane:536870912,hydrationErrors:null},n=gi(e),n.return=t,t.child=n,Pi=t,Fi=null)):e=null,e===null)throw Bi(t);return bf(e)?t.lanes=32:t.lanes=536870912,null}var c=r.children;return r=r.fallback,i?(lo(t),i=t.mode,c=kc({mode:`hidden`,children:c},i),r=mi(r,i,n,null),c.return=t,r.return=t,c.sibling=r,t.child=c,r=t.child,r.memoizedState=Tc(n),r.childLanes=Ec(e,s,n),t.memoizedState=wc,mc(null,r)):(oo(t),Oc(t,c))}var l=e.memoizedState;if(l!==null&&(c=l.dehydrated,c!==null)){if(o)t.flags&256?(oo(t),t.flags&=-257,t=Ac(e,t,n)):t.memoizedState===null?(lo(t),c=r.fallback,i=t.mode,r=kc({mode:`visible`,children:r.children},i),c=mi(c,i,n,null),c.flags|=2,r.return=t,c.return=t,r.sibling=c,t.child=r,za(t,e.child,null,n),r=t.child,r.memoizedState=Tc(n),r.childLanes=Ec(e,s,n),t.memoizedState=wc,t=mc(null,r)):(lo(t),t.child=e.child,t.flags|=128,t=null);else if(oo(t),bf(c)){if(s=c.nextSibling&&c.nextSibling.dataset,s)var u=s.dgst;s=u,r=Error(a(419)),r.stack=``,r.digest=s,Ki({value:r,source:null,stack:null}),t=Ac(e,t,n)}else if(cc||ea(e,t,n,!1),s=(n&e.childLanes)!==0,cc||s){if(s=ql,s!==null&&(r=tt(s,n),r!==0&&r!==l.retryLane))throw l.retryLane=r,ii(e,r),Du(s,e,r),sc;yf(c)||zu(),t=Ac(e,t,n)}else yf(c)?(t.flags|=192,t.child=e.child,t=null):(e=l.treeContext,Fi=Sf(c.nextSibling),Pi=t,Ii=!0,Li=null,Ri=!1,e!==null&&Ni(t,e),t=Oc(t,r.children),t.flags|=4096);return t}return i?(lo(t),c=r.fallback,i=t.mode,l=e.child,u=l.sibling,r=di(l,{mode:`hidden`,children:r.children}),r.subtreeFlags=l.subtreeFlags&65011712,u===null?(c=mi(c,i,n,null),c.flags|=2):c=di(u,c),c.return=t,r.return=t,r.sibling=c,t.child=r,mc(null,r),r=t.child,c=e.child.memoizedState,c===null?c=Tc(n):(i=c.cachePool,i===null?i=Sa():(l=R._currentValue,i=i.parent===l?i:{parent:l,pool:l}),c={baseLanes:c.baseLanes|n,cachePool:i}),r.memoizedState=c,r.childLanes=Ec(e,s,n),t.memoizedState=wc,mc(e.child,r)):(oo(t),n=e.child,e=n.sibling,n=di(n,{mode:`visible`,children:r.children}),n.return=t,n.sibling=null,e!==null&&(s=t.deletions,s===null?(t.deletions=[e],t.flags|=16):s.push(e)),t.child=n,t.memoizedState=null,n)}function Oc(e,t){return t=kc({mode:`visible`,children:t},e.mode),t.return=e,e.child=t}function kc(e,t){return e=li(22,e,null,t),e.lanes=0,e}function Ac(e,t,n){return za(t,e.child,null,n),e=Oc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function jc(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Qi(e.return,t,n)}function Mc(e,t,n,r,i,a){var o=e.memoizedState;o===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i,treeForkCount:a}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=r,o.tail=n,o.tailMode=i,o.treeForkCount=a)}function Nc(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;r=r.children;var o=fo.current,s=(o&2)!=0;if(s?(o=o&1|2,t.flags|=128):o&=1,oe(fo,o),lc(e,t,r,n),r=Ii?Ci:0,!s&&e!==null&&e.flags&128)a:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&jc(e,n,t);else if(e.tag===19)jc(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break a;for(;e.sibling===null;){if(e.return===null||e.return===t)break a;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(i){case`forwards`:for(n=t.child,i=null;n!==null;)e=n.alternate,e!==null&&po(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),Mc(t,!1,i,n,a,r);break;case`backwards`:case`unstable_legacy-backwards`:for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&po(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}Mc(t,!0,n,null,a,r);break;case`together`:Mc(t,!1,null,null,void 0,r);break;default:t.memoizedState=null}return t.child}function Pc(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),ru|=t.lanes,(n&t.childLanes)===0)if(e!==null){if(ea(e,t,n,!1),(n&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(a(153));if(t.child!==null){for(e=t.child,n=di(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=di(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function Fc(e,t){return(e.lanes&t)===0?(e=e.dependencies,!!(e!==null&&ta(e))):!0}function Ic(e,t,n){switch(t.tag){case 3:ue(t,t.stateNode.containerInfo),Xi(t,R,e.memoizedState.cache),Wi();break;case 27:case 5:fe(t);break;case 4:ue(t,t.stateNode.containerInfo);break;case 10:Xi(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,so(t),null;break;case 13:var r=t.memoizedState;if(r!==null)return r.dehydrated===null?(n&t.child.childLanes)===0?(oo(t),e=Pc(e,t,n),e===null?null:e.sibling):Dc(e,t,n):(oo(t),t.flags|=128,null);oo(t);break;case 19:var i=(e.flags&128)!=0;if(r=(n&t.childLanes)!==0,r||=(ea(e,t,n,!1),(n&t.childLanes)!==0),i){if(r)return Nc(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),oe(fo,fo.current),r)break;return null;case 22:return t.lanes=0,pc(e,t,n,t.pendingProps);case 24:Xi(t,R,e.memoizedState.cache)}return Pc(e,t,n)}function Lc(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps)cc=!0;else{if(!Fc(e,n)&&!(t.flags&128))return cc=!1,Ic(e,t,n);cc=!!(e.flags&131072)}else cc=!1,Ii&&t.flags&1048576&&Ai(t,Ci,t.index);switch(t.lanes=0,t.tag){case 16:a:{var r=t.pendingProps;if(e=ka(t.elementType),t.type=e,typeof e==`function`)ui(e)?(r=Zs(e,r),t.tag=1,t=Sc(null,t,e,r,n)):(t.tag=0,t=bc(null,t,e,r,n));else{if(e!=null){var i=e.$$typeof;if(i===w){t.tag=11,t=uc(null,t,e,r,n);break a}else if(i===D){t.tag=14,t=dc(null,t,e,r,n);break a}}throw t=P(e)||e,Error(a(306,t,``))}}return t;case 0:return bc(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,i=Zs(r,t.pendingProps),Sc(e,t,r,i,n);case 3:a:{if(ue(t,t.stateNode.containerInfo),e===null)throw Error(a(387));r=t.pendingProps;var o=t.memoizedState;i=o.element,Ua(e,t),Xa(t,r,null,n);var s=t.memoizedState;if(r=s.cache,Xi(t,R,r),r!==o.cache&&$i(t,[R],n,!0),Ya(),r=s.element,o.isDehydrated)if(o={element:r,isDehydrated:!1,cache:s.cache},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){t=Cc(e,t,r,n);break a}else if(r!==i){i=yi(Error(a(424)),t),Ki(i),t=Cc(e,t,r,n);break a}else{switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName===`HTML`?e.ownerDocument.body:e}for(Fi=Sf(e.firstChild),Pi=t,Ii=!0,Li=null,Ri=!0,n=Ba(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling}else{if(Wi(),r===i){t=Pc(e,t,n);break a}lc(e,t,r,n)}t=t.child}return t;case 26:return yc(e,t),e===null?(n=Uf(t.type,null,t.pendingProps,null))?t.memoizedState=n:Ii||(n=t.type,e=t.pendingProps,r=ef(ce.current).createElement(n),r[st]=t,r[ct]=e,Jd(r,n,e),bt(r),t.stateNode=r):t.memoizedState=Uf(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return fe(t),e===null&&Ii&&(r=t.stateNode=Ef(t.type,t.pendingProps,ce.current),Pi=t,Ri=!0,i=Fi,ff(t.type)?(Cf=i,Fi=Sf(r.firstChild)):Fi=i),lc(e,t,t.pendingProps.children,n),yc(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Ii&&((i=r=Fi)&&(r=gf(r,t.type,t.pendingProps,Ri),r===null?i=!1:(t.stateNode=r,Pi=t,Fi=Sf(r.firstChild),Ri=!1,i=!0)),i||Bi(t)),fe(t),i=t.type,o=t.pendingProps,s=e===null?null:e.memoizedProps,r=o.children,rf(i,o)?r=null:s!==null&&rf(i,s)&&(t.flags|=32),t.memoizedState!==null&&(i=Do(e,t,Ao,null,null,n),fp._currentValue=i),yc(e,t),lc(e,t,r,n),t.child;case 6:return e===null&&Ii&&((e=n=Fi)&&(n=_f(n,t.pendingProps,Ri),n===null?e=!1:(t.stateNode=n,Pi=t,Fi=null,e=!0)),e||Bi(t)),null;case 13:return Dc(e,t,n);case 4:return ue(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=za(t,null,r,n):lc(e,t,r,n),t.child;case 11:return uc(e,t,t.type,t.pendingProps,n);case 7:return lc(e,t,t.pendingProps,n),t.child;case 8:return lc(e,t,t.pendingProps.children,n),t.child;case 12:return lc(e,t,t.pendingProps.children,n),t.child;case 10:return r=t.pendingProps,Xi(t,t.type,r.value),lc(e,t,r.children,n),t.child;case 9:return i=t.type._context,r=t.pendingProps.children,na(t),i=ra(i),r=r(i),t.flags|=1,lc(e,t,r,n),t.child;case 14:return dc(e,t,t.type,t.pendingProps,n);case 15:return fc(e,t,t.type,t.pendingProps,n);case 19:return Nc(e,t,n);case 31:return vc(e,t,n);case 22:return pc(e,t,n,t.pendingProps);case 24:return na(t),r=ra(R),e===null?(i=ba(),i===null&&(i=ql,o=la(),i.pooledCache=o,o.refCount++,o!==null&&(i.pooledCacheLanes|=n),i=o),t.memoizedState={parent:r,cache:i},Ha(t),Xi(t,R,i)):((e.lanes&n)!==0&&(Ua(e,t),Xa(t,null,null,n),Ya()),i=e.memoizedState,o=t.memoizedState,i.parent===r?(r=o.cache,Xi(t,R,r),r!==i.cache&&$i(t,[R],n,!0)):(i={parent:r,cache:r},t.memoizedState=i,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=i),Xi(t,R,r))),lc(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(a(156,t.tag))}function Rc(e){e.flags|=4}function zc(e,t,n,r,i){if((t=(e.mode&32)!=0)&&(t=!1),t){if(e.flags|=16777216,(i&335544128)===i)if(e.stateNode.complete)e.flags|=8192;else if(Iu())e.flags|=8192;else throw Aa=Ea,wa}else e.flags&=-16777217}function Bc(e,t){if(t.type!==`stylesheet`||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!ip(t))if(Iu())e.flags|=8192;else throw Aa=Ea,wa}function Vc(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag===22?536870912:Ye(),e.lanes|=t,su|=t)}function Hc(e,t){if(!Ii)switch(e.tailMode){case`hidden`:t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case`collapsed`:n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function Uc(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&65011712,r|=i.flags&65011712,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function Wc(e,t,n){var r=t.pendingProps;switch(Mi(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Uc(t),null;case 1:return Uc(t),null;case 3:return n=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),Zi(R),de(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(Ui(t)?Rc(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Gi())),Uc(t),null;case 26:var i=t.type,o=t.memoizedState;return e===null?(Rc(t),o===null?(Uc(t),zc(t,i,null,r,n)):(Uc(t),Bc(t,o))):o?o===e.memoizedState?(Uc(t),t.flags&=-16777217):(Rc(t),Uc(t),Bc(t,o)):(e=e.memoizedProps,e!==r&&Rc(t),Uc(t),zc(t,i,e,r,n)),null;case 27:if(pe(t),n=ce.current,i=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Rc(t);else{if(!r){if(t.stateNode===null)throw Error(a(166));return Uc(t),null}e=L.current,Ui(t)?Vi(t,e):(e=Ef(i,r,n),t.stateNode=e,Rc(t))}return Uc(t),null;case 5:if(pe(t),i=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Rc(t);else{if(!r){if(t.stateNode===null)throw Error(a(166));return Uc(t),null}if(o=L.current,Ui(t))Vi(t,o);else{var s=ef(ce.current);switch(o){case 1:o=s.createElementNS(`http://www.w3.org/2000/svg`,i);break;case 2:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,i);break;default:switch(i){case`svg`:o=s.createElementNS(`http://www.w3.org/2000/svg`,i);break;case`math`:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,i);break;case`script`:o=s.createElement(`div`),o.innerHTML=`<script><\/script>`,o=o.removeChild(o.firstChild);break;case`select`:o=typeof r.is==`string`?s.createElement(`select`,{is:r.is}):s.createElement(`select`),r.multiple?o.multiple=!0:r.size&&(o.size=r.size);break;default:o=typeof r.is==`string`?s.createElement(i,{is:r.is}):s.createElement(i)}}o[st]=t,o[ct]=r;a:for(s=t.child;s!==null;){if(s.tag===5||s.tag===6)o.appendChild(s.stateNode);else if(s.tag!==4&&s.tag!==27&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===t)break a;for(;s.sibling===null;){if(s.return===null||s.return===t)break a;s=s.return}s.sibling.return=s.return,s=s.sibling}t.stateNode=o;a:switch(Jd(o,i,r),i){case`button`:case`input`:case`select`:case`textarea`:r=!!r.autoFocus;break a;case`img`:r=!0;break a;default:r=!1}r&&Rc(t)}}return Uc(t),zc(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&Rc(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(a(166));if(e=ce.current,Ui(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,i=Pi,i!==null)switch(i.tag){case 27:case 5:r=i.memoizedProps}e[st]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||Gd(e.nodeValue,n)),e||Bi(t,!0)}else e=ef(e).createTextNode(r),e[st]=t,t.stateNode=e}return Uc(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=Ui(t),n!==null){if(e===null){if(!r)throw Error(a(318));if(e=t.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(a(557));e[st]=t}else Wi(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Uc(t),e=!1}else n=Gi(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(uo(t),t):(uo(t),null);if(t.flags&128)throw Error(a(558))}return Uc(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(i=Ui(t),r!==null&&r.dehydrated!==null){if(e===null){if(!i)throw Error(a(318));if(i=t.memoizedState,i=i===null?null:i.dehydrated,!i)throw Error(a(317));i[st]=t}else Wi(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Uc(t),i=!1}else i=Gi(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=i),i=!0;if(!i)return t.flags&256?(uo(t),t):(uo(t),null)}return uo(t),t.flags&128?(t.lanes=n,t):(n=r!==null,e=e!==null&&e.memoizedState!==null,n&&(r=t.child,i=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(i=r.alternate.memoizedState.cachePool.pool),o=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(o=r.memoizedState.cachePool.pool),o!==i&&(r.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),Vc(t,t.updateQueue),Uc(t),null);case 4:return de(),e===null&&Fd(t.stateNode.containerInfo),Uc(t),null;case 10:return Zi(t.type),Uc(t),null;case 19:if(ae(fo),r=t.memoizedState,r===null)return Uc(t),null;if(i=(t.flags&128)!=0,o=r.rendering,o===null)if(i)Hc(r,!1);else{if(nu!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=po(e),o!==null){for(t.flags|=128,Hc(r,!1),e=o.updateQueue,t.updateQueue=e,Vc(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)fi(n,e),n=n.sibling;return oe(fo,fo.current&1|2),Ii&&ki(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&Ee()>pu&&(t.flags|=128,i=!0,Hc(r,!1),t.lanes=4194304)}else{if(!i)if(e=po(o),e!==null){if(t.flags|=128,i=!0,e=e.updateQueue,t.updateQueue=e,Vc(t,e),Hc(r,!0),r.tail===null&&r.tailMode===`hidden`&&!o.alternate&&!Ii)return Uc(t),null}else 2*Ee()-r.renderingStartTime>pu&&n!==536870912&&(t.flags|=128,i=!0,Hc(r,!1),t.lanes=4194304);r.isBackwards?(o.sibling=t.child,t.child=o):(e=r.last,e===null?t.child=o:e.sibling=o,r.last=o)}return r.tail===null?(Uc(t),null):(e=r.tail,r.rendering=e,r.tail=e.sibling,r.renderingStartTime=Ee(),e.sibling=null,n=fo.current,oe(fo,i?n&1|2:n&1),Ii&&ki(t,r.treeForkCount),e);case 22:case 23:return uo(t),ro(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(Uc(t),t.subtreeFlags&6&&(t.flags|=8192)):Uc(t),n=t.updateQueue,n!==null&&Vc(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),r=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),r!==n&&(t.flags|=2048),e!==null&&ae(ya),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),Zi(R),Uc(t),null;case 25:return null;case 30:return null}throw Error(a(156,t.tag))}function Gc(e,t){switch(Mi(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Zi(R),de(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return pe(t),null;case 31:if(t.memoizedState!==null){if(uo(t),t.alternate===null)throw Error(a(340));Wi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(uo(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(a(340));Wi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return ae(fo),null;case 4:return de(),null;case 10:return Zi(t.type),null;case 22:case 23:return uo(t),ro(),e!==null&&ae(ya),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Zi(R),null;case 25:return null;default:return null}}function Kc(e,t){switch(Mi(t),t.tag){case 3:Zi(R),de();break;case 26:case 27:case 5:pe(t);break;case 4:de();break;case 31:t.memoizedState!==null&&uo(t);break;case 13:uo(t);break;case 19:ae(fo);break;case 10:Zi(t.type);break;case 22:case 23:uo(t),ro(),e!==null&&ae(ya);break;case 24:Zi(R)}}function qc(e,t){try{var n=t.updateQueue,r=n===null?null:n.lastEffect;if(r!==null){var i=r.next;n=i;do{if((n.tag&e)===e){r=void 0;var a=n.create,o=n.inst;r=a(),o.destroy=r}n=n.next}while(n!==i)}}catch(e){rd(t,t.return,e)}}function Jc(e,t,n){try{var r=t.updateQueue,i=r===null?null:r.lastEffect;if(i!==null){var a=i.next;r=a;do{if((r.tag&e)===e){var o=r.inst,s=o.destroy;if(s!==void 0){o.destroy=void 0,i=t;var c=n,l=s;try{l()}catch(e){rd(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){rd(t,t.return,e)}}function Yc(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{Qa(t,n)}catch(t){rd(e,e.return,t)}}}function Xc(e,t,n){n.props=Zs(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){rd(e,t,n)}}function Zc(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;case 30:r=e.stateNode;break;default:r=e.stateNode}typeof n==`function`?e.refCleanup=n(r):n.current=r}}catch(n){rd(e,t,n)}}function Qc(e,t){var n=e.ref,r=e.refCleanup;if(n!==null)if(typeof r==`function`)try{r()}catch(n){rd(e,t,n)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n==`function`)try{n(null)}catch(n){rd(e,t,n)}else n.current=null}function $c(e){var t=e.type,n=e.memoizedProps,r=e.stateNode;try{a:switch(t){case`button`:case`input`:case`select`:case`textarea`:n.autoFocus&&r.focus();break a;case`img`:n.src?r.src=n.src:n.srcSet&&(r.srcset=n.srcSet)}}catch(t){rd(e,e.return,t)}}function el(e,t,n){try{var r=e.stateNode;Yd(r,e.type,n,t),r[ct]=t}catch(t){rd(e,e.return,t)}}function tl(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&ff(e.type)||e.tag===4}function nl(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||tl(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&ff(e.type)||e.flags&2||e.child===null||e.tag===4)continue a;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function rl(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n).insertBefore(e,t):(t=n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n,t.appendChild(e),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=en));else if(r!==4&&(r===27&&ff(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(rl(e,t,n),e=e.sibling;e!==null;)rl(e,t,n),e=e.sibling}function il(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(r===27&&ff(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(il(e,t,n),e=e.sibling;e!==null;)il(e,t,n),e=e.sibling}function al(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);Jd(t,r,n),t[st]=e,t[ct]=n}catch(t){rd(e,e.return,t)}}var ol=!1,sl=!1,cl=!1,ll=typeof WeakSet==`function`?WeakSet:Set,ul=null;function dl(e,t){if(e=e.containerInfo,Qd=xp,e=Or(e),kr(e)){if(`selectionStart`in e)var n={start:e.selectionStart,end:e.selectionEnd};else a:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var i=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break a}var s=0,c=-1,l=-1,u=0,d=0,f=e,p=null;b:for(;;){for(var m;f!==n||i!==0&&f.nodeType!==3||(c=s+i),f!==o||r!==0&&f.nodeType!==3||(l=s+r),f.nodeType===3&&(s+=f.nodeValue.length),(m=f.firstChild)!==null;)p=f,f=m;for(;;){if(f===e)break b;if(p===n&&++u===i&&(c=s),p===o&&++d===r&&(l=s),(m=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=m}n=c===-1||l===-1?null:{start:c,end:l}}else n=null}n||={start:0,end:0}}else n=null;for($d={focusedElem:e,selectionRange:n},xp=!1,ul=t;ul!==null;)if(t=ul,e=t.child,t.subtreeFlags&1028&&e!==null)e.return=t,ul=e;else for(;ul!==null;){switch(t=ul,o=t.alternate,e=t.flags,t.tag){case 0:if(e&4&&(e=t.updateQueue,e=e===null?null:e.events,e!==null))for(n=0;n<e.length;n++)i=e[n],i.ref.impl=i.nextImpl;break;case 11:case 15:break;case 1:if(e&1024&&o!==null){e=void 0,n=t,i=o.memoizedProps,o=o.memoizedState,r=n.stateNode;try{var h=Zs(n.type,i);e=r.getSnapshotBeforeUpdate(h,o),r.__reactInternalSnapshotBeforeUpdate=e}catch(e){rd(n,n.return,e)}}break;case 3:if(e&1024){if(e=t.stateNode.containerInfo,n=e.nodeType,n===9)hf(e);else if(n===1)switch(e.nodeName){case`HEAD`:case`HTML`:case`BODY`:hf(e);break;default:e.textContent=``}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if(e&1024)throw Error(a(163))}if(e=t.sibling,e!==null){e.return=t.return,ul=e;break}ul=t.return}}function fl(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:Dl(e,n),r&4&&qc(5,n);break;case 1:if(Dl(e,n),r&4)if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(e){rd(n,n.return,e)}else{var i=Zs(n.type,t.memoizedProps);t=t.memoizedState;
vendor: 5,412 bytes, line 9
9try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(e){rd(n,n.return,e)}}r&64&&Yc(n),r&512&&Zc(n,n.return);break;case 3:if(Dl(e,n),r&64&&(e=n.updateQueue,e!==null)){if(t=null,n.child!==null)switch(n.child.tag){case 27:case 5:t=n.child.stateNode;break;case 1:t=n.child.stateNode}try{Qa(e,t)}catch(e){rd(n,n.return,e)}}break;case 27:t===null&&r&4&&al(n);case 26:case 5:Dl(e,n),t===null&&r&4&&$c(n),r&512&&Zc(n,n.return);break;case 12:Dl(e,n);break;case 31:Dl(e,n),r&4&&vl(e,n);break;case 13:Dl(e,n),r&4&&yl(e,n),r&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=od.bind(null,n),xf(e,n))));break;case 22:if(r=n.memoizedState!==null||ol,!r){t=t!==null&&t.memoizedState!==null||sl,i=ol;var a=sl;ol=r,(sl=t)&&!a?kl(e,n,(n.subtreeFlags&8772)!=0):Dl(e,n),ol=i,sl=a}break;case 30:break;default:Dl(e,n)}}function pl(e){var t=e.alternate;t!==null&&(e.alternate=null,pl(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&ht(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var ml=null,hl=!1;function gl(e,t,n){for(n=n.child;n!==null;)_l(e,t,n),n=n.sibling}function _l(e,t,n){if(Ie&&typeof Ie.onCommitFiberUnmount==`function`)try{Ie.onCommitFiberUnmount(Fe,n)}catch{}switch(n.tag){case 26:sl||Qc(n,t),gl(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:sl||Qc(n,t);var r=ml,i=hl;ff(n.type)&&(ml=n.stateNode,hl=!1),gl(e,t,n),Df(n.stateNode),ml=r,hl=i;break;case 5:sl||Qc(n,t);case 6:if(r=ml,i=hl,ml=null,gl(e,t,n),ml=r,hl=i,ml!==null)if(hl)try{(ml.nodeType===9?ml.body:ml.nodeName===`HTML`?ml.ownerDocument.body:ml).removeChild(n.stateNode)}catch(e){rd(n,t,e)}else try{ml.removeChild(n.stateNode)}catch(e){rd(n,t,e)}break;case 18:ml!==null&&(hl?(e=ml,pf(e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,n.stateNode),qp(e)):pf(ml,n.stateNode));break;case 4:r=ml,i=hl,ml=n.stateNode.containerInfo,hl=!0,gl(e,t,n),ml=r,hl=i;break;case 0:case 11:case 14:case 15:Jc(2,n,t),sl||Jc(4,n,t),gl(e,t,n);break;case 1:sl||(Qc(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`&&Xc(n,t,r)),gl(e,t,n);break;case 21:gl(e,t,n);break;case 22:sl=(r=sl)||n.memoizedState!==null,gl(e,t,n),sl=r;break;default:gl(e,t,n)}}function vl(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{qp(e)}catch(e){rd(t,t.return,e)}}}function yl(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{qp(e)}catch(e){rd(t,t.return,e)}}function bl(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new ll),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new ll),t;default:throw Error(a(435,e.tag))}}function xl(e,t){var n=bl(e);t.forEach(function(t){if(!n.has(t)){n.add(t);var r=sd.bind(null,e,t);t.then(r,r)}})}function Sl(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r],o=e,s=t,c=s;a:for(;c!==null;){switch(c.tag){case 27:if(ff(c.type)){ml=c.stateNode,hl=!1;break a}break;case 5:ml=c.stateNode,hl=!1;break a;case 3:case 4:ml=c.stateNode.containerInfo,hl=!0;break a}c=c.return}if(ml===null)throw Error(a(160));_l(o,s,i),ml=null,hl=!1,o=i.alternate,o!==null&&(o.return=null),i.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)wl(t,e),t=t.sibling}var Cl=null;function wl(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:Sl(t,e),Tl(e),r&4&&(Jc(3,e,e.return),qc(3,e),Jc(5,e,e.return));break;case 1:Sl(t,e),Tl(e),r&512&&(sl||n===null||Qc(n,n.return)),r&64&&ol&&(e=e.updateQueue,e!==null&&(r=e.callbacks,r!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?r:n.concat(r))));break;case 26:var i=Cl;if(Sl(t,e),Tl(e),r&512&&(sl||n===null||Qc(n,n.return)),r&4){var o=n===null?null:n.memoizedState;if(r=e.memoizedState,n===null)if(r===null)if(e.stateNode===null){a:{r=e.type,n=e.memoizedProps,i=i.ownerDocument||i;b:switch(r){case`title`:o=i.getElementsByTagName(`title`)[0],(!o||o[mt]||o[st]||o.namespaceURI===`http://www.w3.org/2000/svg`||o.hasAttribute(`itemprop`))&&(o=i.createElement(r),i.head.insertBefore(o,i.querySelector(`head > title`))),Jd(o,r,n),o[st]=e,bt(o),r=o;break a;case`link`:var s=tp(`link`,`href`,i).get(r+(n.href||``));if(s){for(var c=0;c<s.length;c++)if(o=s[c],o.getAttribute(`href`)===(n.href==null||n.href===``?null:n.href)&&o.getAttribute(`rel`)===(n.rel==null?null:n.rel)&&o.getAttribute(`title`)===(n.title==null?null:n.title)&&o.getAttribute(`crossorigin`)===(n.crossOrigin==null?null:n.crossOrigin)){s.splice(c,1);break b}}o=i.createElement(r),Jd(o,r,n),i.head.appendChild(o);break;case`meta`:if(s=tp(`meta`,`content`,i).get(r+(n.content||``))){for(c=0;c<s.length;c++)if(o=s[c],o.getAttribute(`content`)===(n.content==null?null:``+n.content)&&o.getAttribute(`name`)===(n.name==null?null:n.name)&&o.getAttribute(`property`)===(n.property==null?null:n.property)&&o.getAttribute(`http-equiv`)===(n.httpEquiv==null?null:n.httpEquiv)&&o.getAttribute(`charset`)===(n.charSet==null?null:n.charSet)){s.splice(c,1);break b}}o=i.createElement(r),Jd(o,r,n),i.head.appendChild(o);break;default:throw Error(a(468,r))}o[st]=e,bt(o),r=o}e.stateNode=r}else np(i,e.type,e.stateNode);else e.stateNode=Xf(i,r,e.memoizedProps);
vendor: 40,696 bytes, lines 9-10
9else o===r?r===null&&e.stateNode!==null&&el(e,e.memoizedProps,n.memoizedProps):(o===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):o.count--,r===null?np(i,e.type,e.stateNode):Xf(i,r,e.memoizedProps))}break;case 27:Sl(t,e),Tl(e),r&512&&(sl||n===null||Qc(n,n.return)),n!==null&&r&4&&el(e,e.memoizedProps,n.memoizedProps);break;case 5:if(Sl(t,e),Tl(e),r&512&&(sl||n===null||Qc(n,n.return)),e.flags&32){i=e.stateNode;try{Kt(i,``)}catch(t){rd(e,e.return,t)}}r&4&&e.stateNode!=null&&(i=e.memoizedProps,el(e,i,n===null?i:n.memoizedProps)),r&1024&&(cl=!0);break;case 6:if(Sl(t,e),Tl(e),r&4){if(e.stateNode===null)throw Error(a(162));r=e.memoizedProps,n=e.stateNode;try{n.nodeValue=r}catch(t){rd(e,e.return,t)}}break;case 3:if(ep=null,i=Cl,Cl=Af(t.containerInfo),Sl(t,e),Cl=i,Tl(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{qp(t.containerInfo)}catch(t){rd(e,e.return,t)}cl&&(cl=!1,El(e));break;case 4:r=Cl,Cl=Af(e.stateNode.containerInfo),Sl(t,e),Tl(e),Cl=r;break;case 12:Sl(t,e),Tl(e);break;case 31:Sl(t,e),Tl(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,xl(e,r)));break;case 13:Sl(t,e),Tl(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(du=Ee()),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,xl(e,r)));break;case 22:i=e.memoizedState!==null;var l=n!==null&&n.memoizedState!==null,u=ol,d=sl;if(ol=u||i,sl=d||l,Sl(t,e),sl=d,ol=u,Tl(e),r&8192)a:for(t=e.stateNode,t._visibility=i?t._visibility&-2:t._visibility|1,i&&(n===null||l||ol||sl||Ol(e)),n=null,t=e;;){if(t.tag===5||t.tag===26){if(n===null){l=n=t;try{if(o=l.stateNode,i)s=o.style,typeof s.setProperty==`function`?s.setProperty(`display`,`none`,`important`):s.display=`none`;else{c=l.stateNode;var f=l.memoizedProps.style,p=f!=null&&f.hasOwnProperty(`display`)?f.display:null;c.style.display=p==null||typeof p==`boolean`?``:(``+p).trim()}}catch(e){rd(l,l.return,e)}}}else if(t.tag===6){if(n===null){l=t;try{l.stateNode.nodeValue=i?``:l.memoizedProps}catch(e){rd(l,l.return,e)}}}else if(t.tag===18){if(n===null){l=t;try{var m=l.stateNode;i?mf(m,!0):mf(l.stateNode,!1)}catch(e){rd(l,l.return,e)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break a;for(;t.sibling===null;){if(t.return===null||t.return===e)break a;n===t&&(n=null),t=t.return}n===t&&(n=null),t.sibling.return=t.return,t=t.sibling}r&4&&(r=e.updateQueue,r!==null&&(n=r.retryQueue,n!==null&&(r.retryQueue=null,xl(e,n))));break;case 19:Sl(t,e),Tl(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,xl(e,r)));break;case 30:break;case 21:break;default:Sl(t,e),Tl(e)}}function Tl(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(tl(r)){n=r;break}r=r.return}if(n==null)throw Error(a(160));switch(n.tag){case 27:var i=n.stateNode;il(e,nl(e),i);break;case 5:var o=n.stateNode;n.flags&32&&(Kt(o,``),n.flags&=-33),il(e,nl(e),o);break;case 3:case 4:var s=n.stateNode.containerInfo;rl(e,nl(e),s);break;default:throw Error(a(161))}}catch(t){rd(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function El(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;El(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function Dl(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)fl(e,t.alternate,t),t=t.sibling}function Ol(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Jc(4,t,t.return),Ol(t);break;case 1:Qc(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount==`function`&&Xc(t,t.return,n),Ol(t);break;case 27:Df(t.stateNode);case 26:case 5:Qc(t,t.return),Ol(t);break;case 22:t.memoizedState===null&&Ol(t);break;case 30:Ol(t);break;default:Ol(t)}e=e.sibling}}function kl(e,t,n){for(n&&=(t.subtreeFlags&8772)!=0,t=t.child;t!==null;){var r=t.alternate,i=e,a=t,o=a.flags;switch(a.tag){case 0:case 11:case 15:kl(i,a,n),qc(4,a);break;case 1:if(kl(i,a,n),r=a,i=r.stateNode,typeof i.componentDidMount==`function`)try{i.componentDidMount()}catch(e){rd(r,r.return,e)}if(r=a,i=r.updateQueue,i!==null){var s=r.stateNode;try{var c=i.shared.hiddenCallbacks;if(c!==null)for(i.shared.hiddenCallbacks=null,i=0;i<c.length;i++)Za(c[i],s)}catch(e){rd(r,r.return,e)}}n&&o&64&&Yc(a),Zc(a,a.return);break;case 27:al(a);case 26:case 5:kl(i,a,n),n&&r===null&&o&4&&$c(a),Zc(a,a.return);break;case 12:kl(i,a,n);break;case 31:kl(i,a,n),n&&o&4&&vl(i,a);break;case 13:kl(i,a,n),n&&o&4&&yl(i,a);break;case 22:a.memoizedState===null&&kl(i,a,n),Zc(a,a.return);break;case 30:break;default:kl(i,a,n)}t=t.sibling}}function Al(e,t){var n=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==n&&(e!=null&&e.refCount++,n!=null&&ua(n))}function jl(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&ua(e))}function Ml(e,t,n,r){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Nl(e,t,n,r),t=t.sibling}function Nl(e,t,n,r){var i=t.flags;switch(t.tag){case 0:case 11:case 15:Ml(e,t,n,r),i&2048&&qc(9,t);break;case 1:Ml(e,t,n,r);break;case 3:Ml(e,t,n,r),i&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&ua(e)));break;case 12:if(i&2048){Ml(e,t,n,r),e=t.stateNode;try{var a=t.memoizedProps,o=a.id,s=a.onPostCommit;typeof s==`function`&&s(o,t.alternate===null?`mount`:`update`,e.passiveEffectDuration,-0)}catch(e){rd(t,t.return,e)}}else Ml(e,t,n,r);break;case 31:Ml(e,t,n,r);break;case 13:Ml(e,t,n,r);break;case 23:break;case 22:a=t.stateNode,o=t.alternate,t.memoizedState===null?a._visibility&2?Ml(e,t,n,r):(a._visibility|=2,Pl(e,t,n,r,(t.subtreeFlags&10256)!=0||!1)):a._visibility&2?Ml(e,t,n,r):Fl(e,t),i&2048&&Al(o,t);break;case 24:Ml(e,t,n,r),i&2048&&jl(t.alternate,t);break;default:Ml(e,t,n,r)}}function Pl(e,t,n,r,i){for(i&&=(t.subtreeFlags&10256)!=0||!1,t=t.child;t!==null;){var a=e,o=t,s=n,c=r,l=o.flags;switch(o.tag){case 0:case 11:case 15:Pl(a,o,s,c,i),qc(8,o);break;case 23:break;case 22:var u=o.stateNode;o.memoizedState===null?(u._visibility|=2,Pl(a,o,s,c,i)):u._visibility&2?Pl(a,o,s,c,i):Fl(a,o),i&&l&2048&&Al(o.alternate,o);break;case 24:Pl(a,o,s,c,i),i&&l&2048&&jl(o.alternate,o);break;default:Pl(a,o,s,c,i)}t=t.sibling}}function Fl(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,r=t,i=r.flags;switch(r.tag){case 22:Fl(n,r),i&2048&&Al(r.alternate,r);break;case 24:Fl(n,r),i&2048&&jl(r.alternate,r);break;default:Fl(n,r)}t=t.sibling}}var Il=8192;function Ll(e,t,n){if(e.subtreeFlags&Il)for(e=e.child;e!==null;)Rl(e,t,n),e=e.sibling}function Rl(e,t,n){switch(e.tag){case 26:Ll(e,t,n),e.flags&Il&&e.memoizedState!==null&&ap(n,Cl,e.memoizedState,e.memoizedProps);break;case 5:Ll(e,t,n);break;case 3:case 4:var r=Cl;Cl=Af(e.stateNode.containerInfo),Ll(e,t,n),Cl=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=Il,Il=16777216,Ll(e,t,n),Il=r):Ll(e,t,n));break;default:Ll(e,t,n)}}function zl(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function Bl(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];ul=r,Ul(r,e)}zl(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Vl(e),e=e.sibling}function Vl(e){switch(e.tag){case 0:case 11:case 15:Bl(e),e.flags&2048&&Jc(9,e,e.return);break;case 3:Bl(e);break;case 12:Bl(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Hl(e)):Bl(e);break;default:Bl(e)}}function Hl(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];ul=r,Ul(r,e)}zl(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Jc(8,t,t.return),Hl(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,Hl(t));break;default:Hl(t)}e=e.sibling}}function Ul(e,t){for(;ul!==null;){var n=ul;switch(n.tag){case 0:case 11:case 15:Jc(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var r=n.memoizedState.cachePool.pool;r!=null&&r.refCount++}break;case 24:ua(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,ul=r;else a:for(n=e;ul!==null;){r=ul;var i=r.sibling,a=r.return;if(pl(r),r===n){ul=null;break a}if(i!==null){i.return=a,ul=i;break a}ul=a}}}var Wl={getCacheForType:function(e){var t=ra(R),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return ra(R).controller.signal}},Gl=typeof WeakMap==`function`?WeakMap:Map,Kl=0,ql=null,Jl=null,Yl=0,Xl=0,Zl=null,Ql=!1,$l=!1,eu=!1,tu=0,nu=0,ru=0,iu=0,au=0,ou=0,su=0,cu=null,lu=null,uu=!1,du=0,fu=0,pu=1/0,mu=null,hu=null,gu=0,_u=null,vu=null,yu=0,bu=0,xu=null,Su=null,Cu=0,wu=null;function Tu(){return Kl&2&&Yl!==0?Yl&-Yl:F.T===null?it():Cd()}function Eu(){if(ou===0)if(!(Yl&536870912)||Ii){var e=Ue;Ue<<=1,!(Ue&3932160)&&(Ue=262144),ou=e}else ou=536870912;return e=io.current,e!==null&&(e.flags|=32),ou}function Du(e,t,n){(e===ql&&(Xl===2||Xl===9)||e.cancelPendingCommit!==null)&&(Pu(e,0),ju(e,Yl,ou,!1)),Ze(e,n),(!(Kl&2)||e!==ql)&&(e===ql&&(!(Kl&2)&&(iu|=n),nu===4&&ju(e,Yl,ou,!1)),hd(e))}function Ou(e,t,n){if(Kl&6)throw Error(a(327));var r=!n&&(t&127)==0&&(t&e.expiredLanes)===0||qe(e,t),i=r?Hu(e,t):Bu(e,t,!0),o=r;do{if(i===0){$l&&!r&&ju(e,t,0,!1);break}else{if(n=e.current.alternate,o&&!Au(n)){i=Bu(e,t,!1),o=!1;continue}if(i===2){if(o=t,e.errorRecoveryDisabledLanes&o)var s=0;else s=e.pendingLanes&-536870913,s=s===0?s&536870912?536870912:0:s;if(s!==0){t=s;a:{var c=e;i=cu;var l=c.current.memoizedState.isDehydrated;if(l&&(Pu(c,s).flags|=256),s=Bu(c,s,!1),s!==2){if(eu&&!l){c.errorRecoveryDisabledLanes|=o,iu|=o,i=4;break a}o=lu,lu=i,o!==null&&(lu===null?lu=o:lu.push.apply(lu,o))}i=s}if(o=!1,i!==2)continue}}if(i===1){Pu(e,0),ju(e,t,0,!0);break}a:{switch(r=e,o=i,o){case 0:case 1:throw Error(a(345));case 4:if((t&4194048)!==t)break;case 6:ju(r,t,ou,!Ql);break a;case 2:lu=null;break;case 3:case 5:break;default:throw Error(a(329))}if((t&62914560)===t&&(i=du+300-Ee(),10<i)){if(ju(r,t,ou,!Ql),Ke(r,0,!0)!==0)break a;yu=t,r.timeoutHandle=sf(ku.bind(null,r,n,lu,mu,uu,t,ou,iu,su,Ql,o,`Throttled`,-0,0),i);break a}ku(r,n,lu,mu,uu,t,ou,iu,su,Ql,o,null,-0,0)}}break}while(1);hd(e)}function ku(e,t,n,r,i,a,o,s,c,l,u,d,f,p){if(e.timeoutHandle=-1,d=t.subtreeFlags,d&8192||(d&16785408)==16785408){d={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:en},Rl(t,a,d);var m=(a&62914560)===a?du-Ee():(a&4194048)===a?fu-Ee():0;if(m=sp(d,m),m!==null){yu=a,e.cancelPendingCommit=m(Yu.bind(null,e,t,a,n,r,i,o,s,c,u,d,null,f,p)),ju(e,a,o,!l);return}}Yu(e,t,a,n,r,i,o,s,c)}function Au(e){for(var t=e;;){var n=t.tag;if((n===0||n===11||n===15)&&t.flags&16384&&(n=t.updateQueue,n!==null&&(n=n.stores,n!==null)))for(var r=0;r<n.length;r++){var i=n[r],a=i.getSnapshot;i=i.value;try{if(!Cr(a(),i))return!1}catch{return!1}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function ju(e,t,n,r){t&=~au,t&=~iu,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var i=t;0<i;){var a=31-Re(i),o=1<<a;r[a]=-1,i&=~o}n!==0&&$e(e,n,t)}function Mu(){return Kl&6?!0:(gd(0,!1),!1)}function Nu(){if(Jl!==null){if(Xl===0)var e=Jl.return;else e=Jl,Yi=Ji=null,No(e),Na=null,Pa=0,e=Jl;for(;e!==null;)Kc(e.alternate,e),e=e.return;Jl=null}}function Pu(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,cf(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),yu=0,Nu(),ql=e,Jl=n=di(e.current,null),Yl=t,Xl=0,Zl=null,Ql=!1,$l=qe(e,t),eu=!1,su=ou=au=iu=ru=nu=0,lu=cu=null,uu=!1,t&8&&(t|=t&32);var r=e.entangledLanes;if(r!==0)for(e=e.entanglements,r&=t;0<r;){var i=31-Re(r),a=1<<i;t|=e[i],r&=~a}return tu=t,ti(),n}function Fu(e,t){ho=null,F.H=Us,t===Ca||t===Ta?(t=ja(),Xl=3):t===wa?(t=ja(),Xl=4):Xl=t===sc?8:typeof t==`object`&&t&&typeof t.then==`function`?6:1,Zl=t,Jl===null&&(nu=1,tc(e,yi(t,e.current)))}function Iu(){var e=io.current;return e===null?!0:(Yl&4194048)===Yl?ao===null:(Yl&62914560)===Yl||Yl&536870912?e===ao:!1}function Lu(){var e=F.H;return F.H=Us,e===null?Us:e}function Ru(){var e=F.A;return F.A=Wl,e}function zu(){nu=4,Ql||(Yl&4194048)!==Yl&&io.current!==null||($l=!0),!(ru&134217727)&&!(iu&134217727)||ql===null||ju(ql,Yl,ou,!1)}function Bu(e,t,n){var r=Kl;Kl|=2;var i=Lu(),a=Ru();(ql!==e||Yl!==t)&&(mu=null,Pu(e,t)),t=!1;var o=nu;a:do try{if(Xl!==0&&Jl!==null){var s=Jl,c=Zl;switch(Xl){case 8:Nu(),o=6;break a;case 3:case 2:case 9:case 6:io.current===null&&(t=!0);var l=Xl;if(Xl=0,Zl=null,Ku(e,s,c,l),n&&$l){o=0;break a}break;default:l=Xl,Xl=0,Zl=null,Ku(e,s,c,l)}}Vu(),o=nu;break}catch(t){Fu(e,t)}while(1);return t&&e.shellSuspendCounter++,Yi=Ji=null,Kl=r,F.H=i,F.A=a,Jl===null&&(ql=null,Yl=0,ti()),o}function Vu(){for(;Jl!==null;)Wu(Jl)}function Hu(e,t){var n=Kl;Kl|=2;var r=Lu(),i=Ru();ql!==e||Yl!==t?(mu=null,pu=Ee()+500,Pu(e,t)):$l=qe(e,t);a:do try{if(Xl!==0&&Jl!==null){t=Jl;var o=Zl;b:switch(Xl){case 1:Xl=0,Zl=null,Ku(e,t,o,1);break;case 2:case 9:if(Da(o)){Xl=0,Zl=null,Gu(t);break}t=function(){Xl!==2&&Xl!==9||ql!==e||(Xl=7),hd(e)},o.then(t,t);break a;case 3:Xl=7;break a;case 4:Xl=5;break a;case 7:Da(o)?(Xl=0,Zl=null,Gu(t)):(Xl=0,Zl=null,Ku(e,t,o,7));break;case 5:var s=null;switch(Jl.tag){case 26:s=Jl.memoizedState;case 5:case 27:var c=Jl;if(s?ip(s):c.stateNode.complete){Xl=0,Zl=null;var l=c.sibling;if(l!==null)Jl=l;else{var u=c.return;u===null?Jl=null:(Jl=u,qu(u))}break b}}Xl=0,Zl=null,Ku(e,t,o,5);break;case 6:Xl=0,Zl=null,Ku(e,t,o,6);break;case 8:Nu(),nu=6;break a;default:throw Error(a(462))}}Uu();break}catch(t){Fu(e,t)}while(1);return Yi=Ji=null,F.H=r,F.A=i,Kl=n,Jl===null?(ql=null,Yl=0,ti(),nu):0}function Uu(){for(;Jl!==null&&!we();)Wu(Jl)}function Wu(e){var t=Lc(e.alternate,e,tu);e.memoizedProps=e.pendingProps,t===null?qu(e):Jl=t}function Gu(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=xc(n,t,t.pendingProps,t.type,void 0,Yl);break;case 11:t=xc(n,t,t.pendingProps,t.type.render,t.ref,Yl);break;case 5:No(t);default:Kc(n,t),t=Jl=fi(t,tu),t=Lc(n,t,tu)}e.memoizedProps=e.pendingProps,t===null?qu(e):Jl=t}function Ku(e,t,n,r){Yi=Ji=null,No(t),Na=null,Pa=0;var i=t.return;try{if(oc(e,i,t,n,Yl)){nu=1,tc(e,yi(n,e.current)),Jl=null;return}}catch(t){if(i!==null)throw Jl=i,t;nu=1,tc(e,yi(n,e.current)),Jl=null;return}t.flags&32768?(Ii||r===1?e=!0:$l||Yl&536870912?e=!1:(Ql=e=!0,(r===2||r===9||r===3||r===6)&&(r=io.current,r!==null&&r.tag===13&&(r.flags|=16384))),Ju(t,e)):qu(t)}function qu(e){var t=e;do{if(t.flags&32768){Ju(t,Ql);return}e=t.return;var n=Wc(t.alternate,t,tu);if(n!==null){Jl=n;return}if(t=t.sibling,t!==null){Jl=t;return}Jl=t=e}while(t!==null);nu===0&&(nu=5)}function Ju(e,t){do{var n=Gc(e.alternate,e);if(n!==null){n.flags&=32767,Jl=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){Jl=e;return}Jl=e=n}while(e!==null);nu=6,Jl=null}function Yu(e,t,n,r,i,o,s,c,l){e.cancelPendingCommit=null;do ed();while(gu!==0);if(Kl&6)throw Error(a(327));if(t!==null){if(t===e.current)throw Error(a(177));if(o=t.lanes|t.childLanes,o|=ei,Qe(e,n,o,s,c,l),e===ql&&(Jl=ql=null,Yl=0),vu=t,_u=e,yu=n,bu=o,xu=i,Su=r,t.subtreeFlags&10256||t.flags&10256?(e.callbackNode=null,e.callbackPriority=0,cd(Ae,function(){return td(),null})):(e.callbackNode=null,e.callbackPriority=0),r=(t.flags&13878)!=0,t.subtreeFlags&13878||r){r=F.T,F.T=null,i=te.p,te.p=2,s=Kl,Kl|=4;try{dl(e,t,n)}finally{Kl=s,te.p=i,F.T=r}}gu=1,Xu(),Zu(),Qu()}}function Xu(){if(gu===1){gu=0;var e=_u,t=vu,n=(t.flags&13878)!=0;if(t.subtreeFlags&13878||n){n=F.T,F.T=null;var r=te.p;te.p=2;var i=Kl;Kl|=4;try{wl(t,e);var a=$d,o=Or(e.containerInfo),s=a.focusedElem,c=a.selectionRange;if(o!==s&&s&&s.ownerDocument&&Dr(s.ownerDocument.documentElement,s)){if(c!==null&&kr(s)){var l=c.start,u=c.end;if(u===void 0&&(u=l),`selectionStart`in s)s.selectionStart=l,s.selectionEnd=Math.min(u,s.value.length);else{var d=s.ownerDocument||document,f=d&&d.defaultView||window;if(f.getSelection){var p=f.getSelection(),m=s.textContent.length,h=Math.min(c.start,m),g=c.end===void 0?h:Math.min(c.end,m);!p.extend&&h>g&&(o=g,g=h,h=o);var _=Er(s,h),v=Er(s,g);if(_&&v&&(p.rangeCount!==1||p.anchorNode!==_.node||p.anchorOffset!==_.offset||p.focusNode!==v.node||p.focusOffset!==v.offset)){var y=d.createRange();y.setStart(_.node,_.offset),p.removeAllRanges(),h>g?(p.addRange(y),p.extend(v.node,v.offset)):(y.setEnd(v.node,v.offset),p.addRange(y))}}}}for(d=[],p=s;p=p.parentNode;)p.nodeType===1&&d.push({element:p,left:p.scrollLeft,top:p.scrollTop});for(typeof s.focus==`function`&&s.focus(),s=0;s<d.length;s++){var b=d[s];b.element.scrollLeft=b.left,b.element.scrollTop=b.top}}xp=!!Qd,$d=Qd=null}finally{Kl=i,te.p=r,F.T=n}}e.current=t,gu=2}}function Zu(){if(gu===2){gu=0;var e=_u,t=vu,n=(t.flags&8772)!=0;if(t.subtreeFlags&8772||n){n=F.T,F.T=null;var r=te.p;te.p=2;var i=Kl;Kl|=4;try{fl(e,t.alternate,t)}finally{Kl=i,te.p=r,F.T=n}}gu=3}}function Qu(){if(gu===4||gu===3){gu=0,Te();var e=_u,t=vu,n=yu,r=Su;t.subtreeFlags&10256||t.flags&10256?gu=5:(gu=0,vu=_u=null,$u(e,e.pendingLanes));var i=e.pendingLanes;if(i===0&&(hu=null),rt(n),t=t.stateNode,Ie&&typeof Ie.onCommitFiberRoot==`function`)try{Ie.onCommitFiberRoot(Fe,t,void 0,(t.current.flags&128)==128)}catch{}if(r!==null){t=F.T,i=te.p,te.p=2,F.T=null;try{for(var a=e.onRecoverableError,o=0;o<r.length;o++){var s=r[o];a(s.value,{componentStack:s.stack})}}finally{F.T=t,te.p=i}}yu&3&&ed(),hd(e),i=e.pendingLanes,n&261930&&i&42?e===wu?Cu++:(Cu=0,wu=e):Cu=0,gd(0,!1)}}function $u(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,ua(t)))}function ed(){return Xu(),Zu(),Qu(),td()}function td(){if(gu!==5)return!1;var e=_u,t=bu;bu=0;var n=rt(yu),r=F.T,i=te.p;try{te.p=32>n?32:n,F.T=null,n=xu,xu=null;var o=_u,s=yu;if(gu=0,vu=_u=null,yu=0,Kl&6)throw Error(a(331));var c=Kl;if(Kl|=4,Vl(o.current),Nl(o,o.current,s,n),Kl=c,gd(0,!1),Ie&&typeof Ie.onPostCommitFiberRoot==`function`)try{Ie.onPostCommitFiberRoot(Fe,o)}catch{}return!0}finally{te.p=i,F.T=r,$u(e,t)}}function nd(e,t,n){t=yi(n,t),t=rc(e.stateNode,t,2),e=Ga(e,t,2),e!==null&&(Ze(e,2),hd(e))}function rd(e,t,n){if(e.tag===3)nd(e,e,n);else for(;t!==null;){if(t.tag===3){nd(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(hu===null||!hu.has(r))){e=yi(n,e),n=ic(2),r=Ga(t,n,2),r!==null&&(ac(n,r,t,e),Ze(r,2),hd(r));break}}t=t.return}}function id(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Gl;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(eu=!0,i.add(n),e=z.bind(null,e,t,n),t.then(e,e))}function z(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,ql===e&&(Yl&n)===n&&(nu===4||nu===3&&(Yl&62914560)===Yl&&300>Ee()-du?!(Kl&2)&&Pu(e,0):au|=n,su===Yl&&(su=0)),hd(e)}function ad(e,t){t===0&&(t=Ye()),e=ii(e,t),e!==null&&(Ze(e,t),hd(e))}function od(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),ad(e,n)}function sd(e,t){var n=0;switch(e.tag){case 31:case 13:var r=e.stateNode,i=e.memoizedState;i!==null&&(n=i.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(a(314))}r!==null&&r.delete(t),ad(e,n)}function cd(e,t){return Se(e,t)}var ld=null,ud=null,dd=!1,fd=!1,pd=!1,md=0;function hd(e){e!==ud&&e.next===null&&(ud===null?ld=ud=e:ud=ud.next=e),fd=!0,dd||(dd=!0,Sd())}function gd(e,t){if(!pd&&fd){pd=!0;do for(var n=!1,r=ld;r!==null;){if(!t)if(e!==0){var i=r.pendingLanes;if(i===0)var a=0;else{var o=r.suspendedLanes,s=r.pingedLanes;a=(1<<31-Re(42|e)+1)-1,a&=i&~(o&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,xd(r,a))}else a=Yl,a=Ke(r,r===ql?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||qe(r,a)||(n=!0,xd(r,a));r=r.next}while(n);pd=!1}}function _d(){vd()}function vd(){fd=dd=!1;var e=0;md!==0&&of()&&(e=md);for(var t=Ee(),n=null,r=ld;r!==null;){var i=r.next,a=yd(r,t);a===0?(r.next=null,n===null?ld=i:n.next=i,i===null&&(ud=n)):(n=r,(e!==0||a&3)&&(fd=!0)),r=i}gu!==0&&gu!==5||gd(e,!1),md!==0&&(md=0)}function yd(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes&-62914561;0<a;){var o=31-Re(a),s=1<<o,c=i[o];c===-1?((s&n)===0||(s&r)!==0)&&(i[o]=Je(s,t)):c<=t&&(e.expiredLanes|=s),a&=~s}if(t=ql,n=Yl,n=Ke(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,n===0||e===t&&(Xl===2||Xl===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&Ce(r),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||qe(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(r!==null&&Ce(r),rt(n)){case 2:case 8:n=ke;break;case 32:n=Ae;break;case 268435456:n=Me;break;default:n=Ae}return r=bd.bind(null,e),n=Se(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&Ce(r),e.callbackPriority=2,e.callbackNode=null,2}function bd(e,t){if(gu!==0&&gu!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(ed()&&e.callbackNode!==n)return null;var r=Yl;return r=Ke(e,e===ql?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(Ou(e,r,t),yd(e,Ee()),e.callbackNode!=null&&e.callbackNode===n?bd.bind(null,e):null)}function xd(e,t){if(ed())return null;Ou(e,t,!0)}function Sd(){uf(function(){Kl&6?Se(Oe,_d):vd()})}function Cd(){if(md===0){var e=pa;e===0&&(e=He,He<<=1,!(He&261888)&&(He=256)),md=e}return md}function wd(e){return e==null||typeof e==`symbol`||typeof e==`boolean`?null:typeof e==`function`?e:$t(``+e)}function Td(e,t){var n=t.ownerDocument.createElement(`input`);return n.name=t.name,n.value=t.value,e.id&&n.setAttribute(`form`,e.id),t.parentNode.insertBefore(n,t),e=new FormData(e),n.parentNode.removeChild(n),e}function Ed(e,t,n,r,i){if(t===`submit`&&n&&n.stateNode===i){var a=wd((i[ct]||null).action),o=r.submitter;o&&(t=(t=o[ct]||null)?wd(t.formAction):o.getAttribute(`formAction`),t!==null&&(a=t,o=null));var s=new Sn(`action`,`action`,null,r,i);e.push({event:s,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(md!==0){var e=o?Td(i,o):new FormData(i);ks(n,{pending:!0,data:e,method:i.method,action:a},null,e)}}else typeof a==`function`&&(s.preventDefault(),e=o?Td(i,o):new FormData(i),ks(n,{pending:!0,data:e,method:i.method,action:a},a,e))},currentTarget:i}]})}}for(var Dd=0;Dd<Yr.length;Dd++){var Od=Yr[Dd];Xr(Od.toLowerCase(),`on`+(Od[0].toUpperCase()+Od.slice(1)))}Xr(Vr,`onAnimationEnd`),Xr(Hr,`onAnimationIteration`),Xr(Ur,`onAnimationStart`),Xr(`dblclick`,`onDoubleClick`),Xr(`focusin`,`onFocus`),Xr(`focusout`,`onBlur`),Xr(Wr,`onTransitionRun`),Xr(Gr,`onTransitionStart`),Xr(Kr,`onTransitionCancel`),Xr(qr,`onTransitionEnd`),wt(`onMouseEnter`,[`mouseout`,`mouseover`]),wt(`onMouseLeave`,[`mouseout`,`mouseover`]),wt(`onPointerEnter`,[`pointerout`,`pointerover`]),wt(`onPointerLeave`,[`pointerout`,`pointerover`]),Ct(`onChange`,`change click focusin focusout input keydown keyup selectionchange`.split(` `)),Ct(`onSelect`,`focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange`.split(` `)),Ct(`onBeforeInput`,[`compositionend`,`keypress`,`textInput`,`paste`]),Ct(`onCompositionEnd`,`compositionend focusout keydown keypress keyup mousedown`.split(` `)),Ct(`onCompositionStart`,`compositionstart focusout keydown keypress keyup mousedown`.split(` `)),Ct(`onCompositionUpdate`,`compositionupdate focusout keydown keypress keyup mousedown`.split(` `));var kd=`abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting`.split(` `),Ad=new Set(`beforetoggle cancel close invalid load scroll scrollend toggle`.split(` `).concat(kd));function jd(e,t){t=(t&4)!=0;for(var n=0;n<e.length;n++){var r=e[n],i=r.event;r=r.listeners;a:{var a=void 0;if(t)for(var o=r.length-1;0<=o;o--){var s=r[o],c=s.instance,l=s.currentTarget;if(s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){Zr(e)}i.currentTarget=null,a=c}else for(o=0;o<r.length;o++){if(s=r[o],c=s.instance,l=s.currentTarget,s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){Zr(e)}i.currentTarget=null,a=c}}}}function Md(e,t){var n=t[ut];n===void 0&&(n=t[ut]=new Set);var r=e+`__bubble`;n.has(r)||(Id(t,e,2,!1),n.add(r))}function Nd(e,t,n){var r=0;t&&(r|=4),Id(n,e,r,t)}var Pd=`_reactListening`+Math.random().toString(36).slice(2);function Fd(e){if(!e[Pd]){e[Pd]=!0,xt.forEach(function(t){t!==`selectionchange`&&(Ad.has(t)||Nd(t,!1,e),Nd(t,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Pd]||(t[Pd]=!0,Nd(`selectionchange`,!1,t))}}function Id(e,t,n,r){switch(Op(t)){case 2:var i=Sp;break;case 8:i=Cp;break;default:i=wp}n=i.bind(null,t,n,e),i=void 0,!dn||t!==`touchstart`&&t!==`touchmove`&&t!==`wheel`||(i=!0),r?i===void 0?e.addEventListener(t,n,!0):e.addEventListener(t,n,{capture:!0,passive:i}):i===void 0?e.addEventListener(t,n,!1):e.addEventListener(t,n,{passive:i})}function Ld(e,t,n,r,i){var a=r;if(!(t&1)&&!(t&2)&&r!==null)a:for(;;){if(r===null)return;var o=r.tag;if(o===3||o===4){var s=r.stateNode.containerInfo;if(s===i)break;if(o===4)for(o=r.return;o!==null;){var c=o.tag;if((c===3||c===4)&&o.stateNode.containerInfo===i)return;o=o.return}for(;s!==null;){if(o=gt(s),o===null)return;if(c=o.tag,c===5||c===6||c===26||c===27){r=a=o;continue a}s=s.parentNode}}r=r.return}cn(function(){var r=a,i=nn(n),o=[];a:{var s=Jr.get(e);if(s!==void 0){var c=Sn,u=e;switch(e){case`keypress`:if(_n(n)===0)break a;case`keydown`:case`keyup`:c=Bn;break;case`focusin`:u=`focus`,c=jn;break;case`focusout`:u=`blur`,c=jn;break;case`beforeblur`:case`afterblur`:c=jn;break;case`click`:if(n.button===2)break a;case`auxclick`:case`dblclick`:case`mousedown`:case`mousemove`:case`mouseup`:case`mouseout`:case`mouseover`:case`contextmenu`:c=kn;break;case`drag`:case`dragend`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`dragstart`:case`drop`:c=An;break;case`touchcancel`:case`touchend`:case`touchmove`:case`touchstart`:c=Hn;break;case Vr:case Hr:case Ur:c=Mn;break;case qr:c=Un;break;case`scroll`:case`scrollend`:c=wn;break;case`wheel`:c=Wn;break;case`copy`:case`cut`:case`paste`:c=Nn;break;case`gotpointercapture`:case`lostpointercapture`:case`pointercancel`:case`pointerdown`:case`pointermove`:case`pointerout`:case`pointerover`:case`pointerup`:c=Vn;break;case`toggle`:case`beforetoggle`:c=Gn}var d=(t&4)!=0,f=!d&&(e===`scroll`||e===`scrollend`),p=d?s===null?null:s+`Capture`:s;d=[];for(var m=r,h;m!==null;){var g=m;if(h=g.stateNode,g=g.tag,g!==5&&g!==26&&g!==27||h===null||p===null||(g=ln(m,p),g!=null&&d.push(Rd(m,g,h))),f)break;m=m.return}0<d.length&&(s=new c(s,u,null,n,i),o.push({event:s,listeners:d}))}}if(!(t&7)){a:{if(s=e===`mouseover`||e===`pointerover`,c=e===`mouseout`||e===`pointerout`,s&&n!==tn&&(u=n.relatedTarget||n.fromElement)&&(gt(u)||u[lt]))break a;if((c||s)&&(s=i.window===i?i:(s=i.ownerDocument)?s.defaultView||s.parentWindow:window,c?(u=n.relatedTarget||n.toElement,c=r,u=u?gt(u):null,u!==null&&(f=l(u),d=u.tag,u!==f||d!==5&&d!==27&&d!==6)&&(u=null)):(c=null,u=r),c!==u)){if(d=kn,g=`onMouseLeave`,p=`onMouseEnter`,m=`mouse`,(e===`pointerout`||e===`pointerover`)&&(d=Vn,g=`onPointerLeave`,p=`onPointerEnter`,m=`pointer`),f=c==null?s:vt(c),h=u==null?s:vt(u),s=new d(g,m+`leave`,c,n,i),s.target=f,s.relatedTarget=h,g=null,gt(i)===r&&(d=new d(p,m+`enter`,u,n,i),d.target=h,d.relatedTarget=f,g=d),f=g,c&&u)b:{for(d=Bd,p=c,m=u,h=0,g=p;g;g=d(g))h++;g=0;for(var _=m;_;_=d(_))g++;for(;0<h-g;)p=d(p),h--;for(;0<g-h;)m=d(m),g--;for(;h--;){if(p===m||m!==null&&p===m.alternate){d=p;break b}p=d(p),m=d(m)}d=null}else d=null;c!==null&&Vd(o,s,c,d,!1),u!==null&&f!==null&&Vd(o,f,u,d,!0)}}a:{if(s=r?vt(r):window,c=s.nodeName&&s.nodeName.toLowerCase(),c===`select`||c===`input`&&s.type===`file`)var v=dr;else if(ar(s))if(fr)v=xr;else{v=yr;var y=vr}else c=s.nodeName,!c||c.toLowerCase()!==`input`||s.type!==`checkbox`&&s.type!==`radio`?r&&Xt(r.elementType)&&(v=dr):v=br;if(v&&=v(e,r)){or(o,v,n,i);break a}y&&y(e,s,r),e===`focusout`&&r&&s.type===`number`&&r.memoizedProps.value!=null&&Ht(s,`number`,s.value)}switch(y=r?vt(r):window,e){case`focusin`:(ar(y)||y.contentEditable===`true`)&&(jr=y,Mr=r,Nr=null);break;case`focusout`:Nr=Mr=jr=null;break;case`mousedown`:Pr=!0;break;case`contextmenu`:case`mouseup`:case`dragend`:Pr=!1,Fr(o,n,i);break;case`selectionchange`:if(Ar)break;case`keydown`:case`keyup`:Fr(o,n,i)}var b;if(qn)b:{switch(e){case`compositionstart`:var x=`onCompositionStart`;break b;case`compositionend`:x=`onCompositionEnd`;break b;case`compositionupdate`:x=`onCompositionUpdate`;break b}x=void 0}else tr?$n(e,n)&&(x=`onCompositionEnd`):e===`keydown`&&n.keyCode===229&&(x=`onCompositionStart`);x&&(Xn&&n.locale!==`ko`&&(tr||x!==`onCompositionStart`?x===`onCompositionEnd`&&tr&&(b=gn()):(pn=i,mn=`value`in pn?pn.value:pn.textContent,tr=!0)),y=zd(r,x),0<y.length&&(x=new Pn(x,e,null,n,i),o.push({event:x,listeners:y}),b?x.data=b:(b=er(n),b!==null&&(x.data=b)))),(b=Yn?nr(e,n):rr(e,n))&&(x=zd(r,`onBeforeInput`),0<x.length&&(y=new Pn(`onBeforeInput`,`beforeinput`,null,n,i),o.push({event:y,listeners:x}),y.data=b)),Ed(o,e,r,n,i)}jd(o,t)})}function Rd(e,t,n){return{instance:e,listener:t,currentTarget:n}}function zd(e,t){for(var n=t+`Capture`,r=[];e!==null;){var i=e,a=i.stateNode;if(i=i.tag,i!==5&&i!==26&&i!==27||a===null||(i=ln(e,n),i!=null&&r.unshift(Rd(e,i,a)),i=ln(e,t),i!=null&&r.push(Rd(e,i,a))),e.tag===3)return r;e=e.return}return[]}function Bd(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Vd(e,t,n,r,i){for(var a=t._reactName,o=[];n!==null&&n!==r;){var s=n,c=s.alternate,l=s.stateNode;if(s=s.tag,c!==null&&c===r)break;s!==5&&s!==26&&s!==27||l===null||(c=l,i?(l=ln(n,a),l!=null&&o.unshift(Rd(n,l,c))):i||(l=ln(n,a),l!=null&&o.push(Rd(n,l,c)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var Hd=/\r\n?/g,Ud=/\u0000|\uFFFD/g;function Wd(e){return(typeof e==`string`?e:``+e).replace(Hd,`
10`).replace(Ud,``)}function Gd(e,t){return t=Wd(t),Wd(e)===t}function Kd(e,t,n,r,i,o){switch(n){case`children`:typeof r==`string`?t===`body`||t===`textarea`&&r===``||Kt(e,r):(typeof r==`number`||typeof r==`bigint`)&&t!==`body`&&Kt(e,``+r);break;case`className`:At(e,`class`,r);break;case`tabIndex`:At(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:At(e,n,r);break;case`style`:Yt(e,r,o);break;case`data`:if(t!==`object`){At(e,`data`,r);break}case`src`:case`href`:if(r===``&&(t!==`a`||n!==`href`)){e.removeAttribute(n);break}if(r==null||typeof r==`function`||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=$t(``+r),e.setAttribute(n,r);break;case`action`:case`formAction`:if(typeof r==`function`){e.setAttribute(n,`javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')`);break}else typeof o==`function`&&(n===`formAction`?(t!==`input`&&Kd(e,t,`name`,i.name,i,null),Kd(e,t,`formEncType`,i.formEncType,i,null),Kd(e,t,`formMethod`,i.formMethod,i,null),Kd(e,t,`formTarget`,i.formTarget,i,null)):(Kd(e,t,`encType`,i.encType,i,null),Kd(e,t,`method`,i.method,i,null),Kd(e,t,`target`,i.target,i,null)));if(r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=$t(``+r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=en);break;case`onScroll`:r!=null&&Md(`scroll`,e);break;case`onScrollEnd`:r!=null&&Md(`scrollend`,e);break;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(a(61));if(n=r.__html,n!=null){if(i.children!=null)throw Error(a(60));e.innerHTML=n}}break;case`multiple`:e.multiple=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`muted`:e.muted=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`defaultValue`:case`defaultChecked`:case`innerHTML`:case`ref`:break;case`autoFocus`:break;case`xlinkHref`:if(r==null||typeof r==`function`||typeof r==`boolean`||typeof r==`symbol`){e.removeAttribute(`xlink:href`);break}n=$t(``+r),e.setAttributeNS(`http://www.w3.org/1999/xlink`,`xlink:href`,n);break;case`contentEditable`:case`spellCheck`:case`draggable`:case`value`:case`autoReverse`:case`externalResourcesRequired`:case`focusable`:case`preserveAlpha`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``+r):e.removeAttribute(n);break;case`inert`:case`allowFullScreen`:case`async`:case`autoPlay`:case`controls`:case`default`:case`defer`:case`disabled`:case`disablePictureInPicture`:case`disableRemotePlayback`:case`formNoValidate`:case`hidden`:case`loop`:case`noModule`:case`noValidate`:case`open`:case`playsInline`:case`readOnly`:case`required`:case`reversed`:case`scoped`:case`seamless`:case`itemScope`:r&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``):e.removeAttribute(n);break;case`capture`:case`download`:!0===r?e.setAttribute(n,``):!1!==r&&r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,r):e.removeAttribute(n);break;case`cols`:case`rows`:case`size`:case`span`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`&&!isNaN(r)&&1<=r?e.setAttribute(n,r):e.removeAttribute(n);break;case`rowSpan`:case`start`:r==null||typeof r==`function`||typeof r==`symbol`||isNaN(r)?e.removeAttribute(n):e.setAttribute(n,r);break;case`popover`:Md(`beforetoggle`,e),Md(`toggle`,e),kt(e,`popover`,r);break;case`xlinkActuate`:jt(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:jt(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:jt(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:jt(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:jt(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:jt(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:jt(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:jt(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:jt(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:kt(e,`is`,r);break;case`innerText`:case`textContent`:break;default:(!(2<n.length)||n[0]!==`o`&&n[0]!==`O`||n[1]!==`n`&&n[1]!==`N`)&&(n=Zt.get(n)||n,kt(e,n,r))}}function qd(e,t,n,r,i,o){switch(n){case`style`:Yt(e,r,o);break;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(a(61));if(n=r.__html,n!=null){if(i.children!=null)throw Error(a(60));e.innerHTML=n}}break;case`children`:typeof r==`string`?Kt(e,r):(typeof r==`number`||typeof r==`bigint`)&&Kt(e,``+r);break;case`onScroll`:r!=null&&Md(`scroll`,e);break;case`onScrollEnd`:r!=null&&Md(`scrollend`,e);break;case`onClick`:r!=null&&(e.onclick=en);break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`:case`ref`:break;case`innerText`:case`textContent`:break;default:if(!St.hasOwnProperty(n))a:{if(n[0]===`o`&&n[1]===`n`&&(i=n.endsWith(`Capture`),t=n.slice(2,i?n.length-7:void 0),o=e[ct]||null,o=o==null?null:o[n],typeof o==`function`&&e.removeEventListener(t,o,i),typeof r==`function`)){typeof o!=`function`&&o!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(t,r,i);break a}n in e?e[n]=r:!0===r?e.setAttribute(n,``):kt(e,n,r)}}}function Jd(e,t,n){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`img`:Md(`error`,e),Md(`load`,e);var r=!1,i=!1,o;for(o in n)if(n.hasOwnProperty(o)){var s=n[o];if(s!=null)switch(o){case`src`:r=!0;break;case`srcSet`:i=!0;break;case`children`:case`dangerouslySetInnerHTML`:throw Error(a(137,t));default:Kd(e,t,o,s,n,null)}}i&&Kd(e,t,`srcSet`,n.srcSet,n,null),r&&Kd(e,t,`src`,n.src,n,null);return;case`input`:Md(`invalid`,e);var c=o=s=i=null,l=null,u=null;for(r in n)if(n.hasOwnProperty(r)){var d=n[r];if(d!=null)switch(r){case`name`:i=d;break;case`type`:s=d;break;case`checked`:l=d;break;case`defaultChecked`:u=d;break;case`value`:o=d;break;case`defaultValue`:c=d;break;case`children`:case`dangerouslySetInnerHTML`:if(d!=null)throw Error(a(137,t));break;default:Kd(e,t,r,d,n,null)}}Vt(e,o,c,l,u,s,i,!1);return;case`select`:for(i in Md(`invalid`,e),r=s=o=null,n)if(n.hasOwnProperty(i)&&(c=n[i],c!=null))switch(i){case`value`:o=c;break;case`defaultValue`:s=c;break;case`multiple`:r=c;default:Kd(e,t,i,c,n,null)}t=o,n=s,e.multiple=!!r,t==null?n!=null&&Ut(e,!!r,n,!0):Ut(e,!!r,t,!1);return;case`textarea`:for(s in Md(`invalid`,e),o=i=r=null,n)if(n.hasOwnProperty(s)&&(c=n[s],c!=null))switch(s){case`value`:r=c;break;case`defaultValue`:i=c;break;case`children`:o=c;break;case`dangerouslySetInnerHTML`:if(c!=null)throw Error(a(91));break;default:Kd(e,t,s,c,n,null)}Gt(e,r,i,o);return;case`option`:for(l in n)if(n.hasOwnProperty(l)&&(r=n[l],r!=null))switch(l){case`selected`:e.selected=r&&typeof r!=`function`&&typeof r!=`symbol`;break;default:Kd(e,t,l,r,n,null)}return;case`dialog`:Md(`beforetoggle`,e),Md(`toggle`,e),Md(`cancel`,e),Md(`close`,e);break;case`iframe`:case`object`:Md(`load`,e);break;case`video`:case`audio`:for(r=0;r<kd.length;r++)Md(kd[r],e);break;case`image`:Md(`error`,e),Md(`load`,e);break;case`details`:Md(`toggle`,e);break;case`embed`:case`source`:case`link`:Md(`error`,e),Md(`load`,e);case`area`:case`base`:case`br`:case`col`:case`hr`:case`keygen`:case`meta`:case`param`:case`track`:case`wbr`:case`menuitem`:for(u in n)if(n.hasOwnProperty(u)&&(r=n[u],r!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:throw Error(a(137,t));default:Kd(e,t,u,r,n,null)}return;default:if(Xt(t)){for(d in n)n.hasOwnProperty(d)&&(r=n[d],r!==void 0&&qd(e,t,d,r,n,void 0));return}}for(c in n)n.hasOwnProperty(c)&&(r=n[c],r!=null&&Kd(e,t,c,r,n,null))}function Yd(e,t,n,r){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`input`:var i=null,o=null,s=null,c=null,l=null,u=null,d=null;for(m in n){var f=n[m];if(n.hasOwnProperty(m)&&f!=null)switch(m){case`checked`:break;case`value`:break;case`defaultValue`:l=f;default:r.hasOwnProperty(m)||Kd(e,t,m,null,r,f)}}for(var p in r){var m=r[p];if(f=n[p],r.hasOwnProperty(p)&&(m!=null||f!=null))switch(p){case`type`:o=m;break;case`name`:i=m;break;case`checked`:u=m;break;case`defaultChecked`:d=m;break;case`value`:s=m;break;case`defaultValue`:c=m;break;case`children`:case`dangerouslySetInnerHTML`:if(m!=null)throw Error(a(137,t));break;default:m!==f&&Kd(e,t,p,m,r,f)}}Bt(e,s,c,l,u,d,o,i);return;case`select`:for(o in m=s=c=p=null,n)if(l=n[o],n.hasOwnProperty(o)&&l!=null)switch(o){case`value`:break;case`multiple`:m=l;default:r.hasOwnProperty(o)||Kd(e,t,o,null,r,l)}for(i in r)if(o=r[i],l=n[i],r.hasOwnProperty(i)&&(o!=null||l!=null))switch(i){case`value`:p=o;break;case`defaultValue`:c=o;break;case`multiple`:s=o;default:o!==l&&Kd(e,t,i,o,r,l)}t=c,n=s,r=m,p==null?!!r!=!!n&&(t==null?Ut(e,!!n,n?[]:``,!1):Ut(e,!!n,t,!0)):Ut(e,!!n,p,!1);return;case`textarea`:for(c in m=p=null,n)if(i=n[c],n.hasOwnProperty(c)&&i!=null&&!r.hasOwnProperty(c))switch(c){case`value`:break;case`children`:break;default:Kd(e,t,c,null,r,i)}for(s in r)if(i=r[s],o=n[s],r.hasOwnProperty(s)&&(i!=null||o!=null))switch(s){case`value`:p=i;break;case`defaultValue`:m=i;break;case`children`:break;case`dangerouslySetInnerHTML`:if(i!=null)throw Error(a(91));break;default:i!==o&&Kd(e,t,s,i,r,o)}Wt(e,p,m);return;case`option`:for(var h in n)if(p=n[h],n.hasOwnProperty(h)&&p!=null&&!r.hasOwnProperty(h))switch(h){case`selected`:e.selected=!1;break;default:Kd(e,t,h,null,r,p)}for(l in r)if(p=r[l],m=n[l],r.hasOwnProperty(l)&&p!==m&&(p!=null||m!=null))switch(l){case`selected`:e.selected=p&&typeof p!=`function`&&typeof p!=`symbol`;break;default:Kd(e,t,l,p,r,m)}return;case`img`:case`link`:case`area`:case`base`:case`br`:case`col`:case`embed`:case`hr`:case`keygen`:case`meta`:case`param`:case`source`:case`track`:case`wbr`:case`menuitem`:for(var g in n)p=n[g],n.hasOwnProperty(g)&&p!=null&&!r.hasOwnProperty(g)&&Kd(e,t,g,null,r,p);for(u in r)if(p=r[u],m=n[u],r.hasOwnProperty(u)&&p!==m&&(p!=null||m!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:if(p!=null)throw Error(a(137,t));break;default:Kd(e,t,u,p,r,m)}return;default:if(Xt(t)){for(var _ in n)p=n[_],n.hasOwnProperty(_)&&p!==void 0&&!r.hasOwnProperty(_)&&qd(e,t,_,void 0,r,p);
vendor: 4,463 bytes, line 10
10for(d in r)p=r[d],m=n[d],!r.hasOwnProperty(d)||p===m||p===void 0&&m===void 0||qd(e,t,d,p,r,m);return}}for(var v in n)p=n[v],n.hasOwnProperty(v)&&p!=null&&!r.hasOwnProperty(v)&&Kd(e,t,v,null,r,p);for(f in r)p=r[f],m=n[f],!r.hasOwnProperty(f)||p===m||p==null&&m==null||Kd(e,t,f,p,r,m)}function Xd(e){switch(e){case`css`:case`script`:case`font`:case`img`:case`image`:case`input`:case`link`:return!0;default:return!1}}function Zd(){if(typeof performance.getEntriesByType==`function`){for(var e=0,t=0,n=performance.getEntriesByType(`resource`),r=0;r<n.length;r++){var i=n[r],a=i.transferSize,o=i.initiatorType,s=i.duration;if(a&&s&&Xd(o)){for(o=0,s=i.responseEnd,r+=1;r<n.length;r++){var c=n[r],l=c.startTime;if(l>s)break;var u=c.transferSize,d=c.initiatorType;u&&Xd(d)&&(c=c.responseEnd,o+=u*(c<s?1:(s-l)/(c-l)))}if(--r,t+=8*(a+o)/(i.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e==`number`)?e:5}var Qd=null,$d=null;function ef(e){return e.nodeType===9?e:e.ownerDocument}function tf(e){switch(e){case`http://www.w3.org/2000/svg`:return 1;case`http://www.w3.org/1998/Math/MathML`:return 2;default:return 0}}function nf(e,t){if(e===0)switch(t){case`svg`:return 1;case`math`:return 2;default:return 0}return e===1&&t===`foreignObject`?0:e}function rf(e,t){return e===`textarea`||e===`noscript`||typeof t.children==`string`||typeof t.children==`number`||typeof t.children==`bigint`||typeof t.dangerouslySetInnerHTML==`object`&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var af=null;function of(){var e=window.event;return e&&e.type===`popstate`?e===af?!1:(af=e,!0):(af=null,!1)}var sf=typeof setTimeout==`function`?setTimeout:void 0,cf=typeof clearTimeout==`function`?clearTimeout:void 0,lf=typeof Promise==`function`?Promise:void 0,uf=typeof queueMicrotask==`function`?queueMicrotask:lf===void 0?sf:function(e){return lf.resolve(null).then(e).catch(df)};function df(e){setTimeout(function(){throw e})}function ff(e){return e===`head`}function pf(e,t){var n=t,r=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8)if(n=i.data,n===`/$`||n===`/&`){if(r===0){e.removeChild(i),qp(t);return}r--}else if(n===`$`||n===`$?`||n===`$~`||n===`$!`||n===`&`)r++;else if(n===`html`)Df(e.ownerDocument.documentElement);else if(n===`head`){n=e.ownerDocument.head,Df(n);for(var a=n.firstChild;a;){var o=a.nextSibling,s=a.nodeName;a[mt]||s===`SCRIPT`||s===`STYLE`||s===`LINK`&&a.rel.toLowerCase()===`stylesheet`||n.removeChild(a),a=o}}else n===`body`&&Df(e.ownerDocument.body);n=i}while(n);qp(t)}function mf(e,t){var n=e;e=0;do{var r=n.nextSibling;if(n.nodeType===1?t?(n._stashedDisplay=n.style.display,n.style.display=`none`):(n.style.display=n._stashedDisplay||``,n.getAttribute(`style`)===``&&n.removeAttribute(`style`)):n.nodeType===3&&(t?(n._stashedText=n.nodeValue,n.nodeValue=``):n.nodeValue=n._stashedText||``),r&&r.nodeType===8)if(n=r.data,n===`/$`){if(e===0)break;e--}else n!==`$`&&n!==`$?`&&n!==`$~`&&n!==`$!`||e++;n=r}while(n)}function hf(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case`HTML`:case`HEAD`:case`BODY`:hf(n),ht(n);continue;case`SCRIPT`:case`STYLE`:continue;case`LINK`:if(n.rel.toLowerCase()===`stylesheet`)continue}e.removeChild(n)}}function gf(e,t,n,r){for(;e.nodeType===1;){var i=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!r&&(e.nodeName!==`INPUT`||e.type!==`hidden`))break}else if(!r)if(t===`input`&&e.type===`hidden`){var a=i.name==null?null:``+i.name;if(i.type===`hidden`&&e.getAttribute(`name`)===a)return e}else return e;else if(!e[mt])switch(t){case`meta`:if(!e.hasAttribute(`itemprop`))break;return e;case`link`:if(a=e.getAttribute(`rel`),a===`stylesheet`&&e.hasAttribute(`data-precedence`)||a!==i.rel||e.getAttribute(`href`)!==(i.href==null||i.href===``?null:i.href)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin)||e.getAttribute(`title`)!==(i.title==null?null:i.title))break;return e;case`style`:if(e.hasAttribute(`data-precedence`))break;return e;case`script`:if(a=e.getAttribute(`src`),(a!==(i.src==null?null:i.src)||e.getAttribute(`type`)!==(i.type==null?null:i.type)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin))&&a&&e.hasAttribute(`async`)&&!e.hasAttribute(`itemprop`))break;return e;default:return e}if(e=Sf(e.nextSibling),e===null)break}return null}function _f(e,t,n){if(t===``)return null;for(;
vendor: 17,951 bytes, line 10
10e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!n||(e=Sf(e.nextSibling),e===null))return null;return e}function vf(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!t||(e=Sf(e.nextSibling),e===null))return null;return e}function yf(e){return e.data===`$?`||e.data===`$~`}function bf(e){return e.data===`$!`||e.data===`$?`&&e.ownerDocument.readyState!==`loading`}function xf(e,t){var n=e.ownerDocument;if(e.data===`$~`)e._reactRetry=t;else if(e.data!==`$?`||n.readyState!==`loading`)t();else{var r=function(){t(),n.removeEventListener(`DOMContentLoaded`,r)};n.addEventListener(`DOMContentLoaded`,r),e._reactRetry=r}}function Sf(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t===`$`||t===`$!`||t===`$?`||t===`$~`||t===`&`||t===`F!`||t===`F`)break;if(t===`/$`||t===`/&`)return null}}return e}var Cf=null;function wf(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`||n===`/&`){if(t===0)return Sf(e.nextSibling);t--}else n!==`$`&&n!==`$!`&&n!==`$?`&&n!==`$~`&&n!==`&`||t++}e=e.nextSibling}return null}function Tf(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`$`||n===`$!`||n===`$?`||n===`$~`||n===`&`){if(t===0)return e;t--}else n!==`/$`&&n!==`/&`||t++}e=e.previousSibling}return null}function Ef(e,t,n){switch(t=ef(n),e){case`html`:if(e=t.documentElement,!e)throw Error(a(452));return e;case`head`:if(e=t.head,!e)throw Error(a(453));return e;case`body`:if(e=t.body,!e)throw Error(a(454));return e;default:throw Error(a(451))}}function Df(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);ht(e)}var Of=new Map,kf=new Set;function Af(e){return typeof e.getRootNode==`function`?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var jf=te.d;te.d={f:Mf,r:Nf,D:If,C:Lf,L:Rf,m:zf,X:Vf,S:Bf,M:Hf};function Mf(){var e=jf.f(),t=Mu();return e||t}function Nf(e){var t=_t(e);t!==null&&t.tag===5&&t.type===`form`?js(t):jf.r(e)}var Pf=typeof document>`u`?null:document;function Ff(e,t,n){var r=Pf;if(r&&typeof t==`string`&&t){var i=zt(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),kf.has(i)||(kf.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),Jd(t,`link`,e),bt(t),r.head.appendChild(t)))}}function If(e){jf.D(e),Ff(`dns-prefetch`,e,null)}function Lf(e,t){jf.C(e,t),Ff(`preconnect`,e,t)}function Rf(e,t,n){jf.L(e,t,n);var r=Pf;if(r&&e&&t){var i=`link[rel="preload"][as="`+zt(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+zt(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+zt(n.imageSizes)+`"]`)):i+=`[href="`+zt(e)+`"]`;var a=i;switch(t){case`style`:a=Wf(e);break;case`script`:a=Jf(e)}Of.has(a)||(e=h({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),Of.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(Gf(a))||t===`script`&&r.querySelector(Yf(a))||(t=r.createElement(`link`),Jd(t,`link`,e),bt(t),r.head.appendChild(t)))}}function zf(e,t){jf.m(e,t);var n=Pf;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+zt(r)+`"][href="`+zt(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=Jf(e)}if(!Of.has(a)&&(e=h({rel:`modulepreload`,href:e},t),Of.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(Yf(a)))return}r=n.createElement(`link`),Jd(r,`link`,e),bt(r),n.head.appendChild(r)}}}function Bf(e,t,n){jf.S(e,t,n);var r=Pf;if(r&&e){var i=yt(r).hoistableStyles,a=Wf(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(Gf(a)))s.loading=5;else{e=h({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=Of.get(a))&&Qf(e,n);var c=o=r.createElement(`link`);bt(c),Jd(c,`link`,e),c._p=new Promise(function(e,t){c.onload=e,c.onerror=t}),c.addEventListener(`load`,function(){s.loading|=1}),c.addEventListener(`error`,function(){s.loading|=2}),s.loading|=4,Zf(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function Vf(e,t){jf.X(e,t);var n=Pf;if(n&&e){var r=yt(n).hoistableScripts,i=Jf(e),a=r.get(i);a||(a=n.querySelector(Yf(i)),a||(e=h({src:e,async:!0},t),(t=Of.get(i))&&$f(e,t),a=n.createElement(`script`),bt(a),Jd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Hf(e,t){jf.M(e,t);var n=Pf;if(n&&e){var r=yt(n).hoistableScripts,i=Jf(e),a=r.get(i);a||(a=n.querySelector(Yf(i)),a||(e=h({src:e,async:!0,type:`module`},t),(t=Of.get(i))&&$f(e,t),a=n.createElement(`script`),bt(a),Jd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Uf(e,t,n,r){var i=(i=ce.current)?Af(i):null;if(!i)throw Error(a(446));switch(e){case`meta`:case`title`:return null;case`style`:return typeof n.precedence==`string`&&typeof n.href==`string`?(t=Wf(n.href),n=yt(i).hoistableStyles,r=n.get(t),r||(r={type:`style`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};case`link`:if(n.rel===`stylesheet`&&typeof n.href==`string`&&typeof n.precedence==`string`){e=Wf(n.href);var o=yt(i).hoistableStyles,s=o.get(e);if(s||(i=i.ownerDocument||i,s={type:`stylesheet`,instance:null,count:0,state:{loading:0,preload:null}},o.set(e,s),(o=i.querySelector(Gf(e)))&&!o._p&&(s.instance=o,s.state.loading=5),Of.has(e)||(n={rel:`preload`,as:`style`,href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},Of.set(e,n),o||qf(i,e,n,s.state))),t&&r===null)throw Error(a(528,``));return s}if(t&&r!==null)throw Error(a(529,``));return null;case`script`:return t=n.async,n=n.src,typeof n==`string`&&t&&typeof t!=`function`&&typeof t!=`symbol`?(t=Jf(n),n=yt(i).hoistableScripts,r=n.get(t),r||(r={type:`script`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};default:throw Error(a(444,e))}}function Wf(e){return`href="`+zt(e)+`"`}function Gf(e){return`link[rel="stylesheet"][`+e+`]`}function Kf(e){return h({},e,{"data-precedence":e.precedence,precedence:null})}function qf(e,t,n,r){e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)?r.loading=1:(t=e.createElement(`link`),r.preload=t,t.addEventListener(`load`,function(){return r.loading|=1}),t.addEventListener(`error`,function(){return r.loading|=2}),Jd(t,`link`,n),bt(t),e.head.appendChild(t))}function Jf(e){return`[src="`+zt(e)+`"]`}function Yf(e){return`script[async]`+e}function Xf(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+zt(n.href)+`"]`);if(r)return t.instance=r,bt(r),r;var i=h({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),bt(r),Jd(r,`style`,i),Zf(r,n.precedence,e),t.instance=r;case`stylesheet`:i=Wf(n.href);var o=e.querySelector(Gf(i));if(o)return t.state.loading|=4,t.instance=o,bt(o),o;r=Kf(n),(i=Of.get(i))&&Qf(r,i),o=(e.ownerDocument||e).createElement(`link`),bt(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),Jd(o,`link`,r),t.state.loading|=4,Zf(o,n.precedence,e),t.instance=o;case`script`:return o=Jf(n.src),(i=e.querySelector(Yf(o)))?(t.instance=i,bt(i),i):(r=n,(i=Of.get(o))&&(r=h({},n),$f(r,i)),e=e.ownerDocument||e,i=e.createElement(`script`),bt(i),Jd(i,`link`,r),e.head.appendChild(i),t.instance=i);case`void`:return null;default:throw Error(a(443,t.type))}else t.type===`stylesheet`&&!(t.state.loading&4)&&(r=t.instance,t.state.loading|=4,Zf(r,n.precedence,e));return t.instance}function Zf(e,t,n){for(var r=n.querySelectorAll(`link[rel="stylesheet"][data-precedence],style[data-precedence]`),i=r.length?r[r.length-1]:null,a=i,o=0;o<r.length;o++){var s=r[o];if(s.dataset.precedence===t)a=s;else if(a!==i)break}a?a.parentNode.insertBefore(e,a.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function Qf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.title??=t.title}function $f(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.integrity??=t.integrity}var ep=null;function tp(e,t,n){if(ep===null){var r=new Map,i=ep=new Map;i.set(n,r)}else i=ep,r=i.get(n),r||(r=new Map,i.set(n,r));if(r.has(e))return r;for(r.set(e,null),n=n.getElementsByTagName(e),i=0;i<n.length;i++){var a=n[i];if(!(a[mt]||a[st]||e===`link`&&a.getAttribute(`rel`)===`stylesheet`)&&a.namespaceURI!==`http://www.w3.org/2000/svg`){var o=a.getAttribute(t)||``;o=e+o;var s=r.get(o);s?s.push(a):r.set(o,[a])}}return r}function np(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t===`title`?e.querySelector(`head > title`):null)}function rp(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case`meta`:case`title`:return!0;case`style`:if(typeof t.precedence!=`string`||typeof t.href!=`string`||t.href===``)break;return!0;case`link`:if(typeof t.rel!=`string`||typeof t.href!=`string`||t.href===``||t.onLoad||t.onError)break;switch(t.rel){case`stylesheet`:return e=t.disabled,typeof t.precedence==`string`&&e==null;default:return!0}case`script`:if(t.async&&typeof t.async!=`function`&&typeof t.async!=`symbol`&&!t.onLoad&&!t.onError&&t.src&&typeof t.src==`string`)return!0}return!1}function ip(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function ap(e,t,n,r){if(n.type===`stylesheet`&&(typeof r.media!=`string`||!1!==matchMedia(r.media).matches)&&!(n.state.loading&4)){if(n.instance===null){var i=Wf(r.href),a=t.querySelector(Gf(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=cp.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,bt(a);return}a=t.ownerDocument||t,r=Kf(r),(i=Of.get(i))&&Qf(r,i),a=a.createElement(`link`),bt(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),Jd(a,`link`,r),n.instance=a}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&!(n.state.loading&3)&&(e.count++,n=cp.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var op=0;function sp(e,t){return e.stylesheets&&e.count===0&&up(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&up(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4+t);0<e.imgBytes&&op===0&&(op=62500*Zd());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&up(e,e.stylesheets),e.unsuspend)){var t=e.unsuspend;e.unsuspend=null,t()}},(e.imgBytes>op?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function cp(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)up(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var lp=null;function up(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,lp=new Map,t.forEach(dp,e),lp=null,cp.call(e))}function dp(e,t){if(!(t.state.loading&4)){var n=lp.get(e);if(n)var r=n.get(null);else{n=new Map,lp.set(e,n);for(var i=e.querySelectorAll(`link[data-precedence],style[data-precedence]`),a=0;a<i.length;a++){var o=i[a];(o.nodeName===`LINK`||o.getAttribute(`media`)!==`not all`)&&(n.set(o.dataset.precedence,o),r=o)}r&&n.set(null,r)}i=t.instance,o=i.getAttribute(`data-precedence`),a=n.get(o)||r,a===r&&n.set(null,i),n.set(o,i),this.count++,r=cp.bind(this),i.addEventListener(`load`,r),i.addEventListener(`error`,r),a?a.parentNode.insertBefore(i,a.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(i,e.firstChild)),t.state.loading|=4}}var fp={$$typeof:C,Provider:null,Consumer:null,_currentValue:ne,_currentValue2:ne,_threadCount:0};function pp(e,t,n,r,i,a,o,s,c){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Xe(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Xe(0),this.hiddenUpdates=Xe(null),this.identifierPrefix=r,this.onUncaughtError=i,this.onCaughtError=a,this.onRecoverableError=o,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=c,this.incompleteTransitions=new Map}function mp(e,t,n,r,i,a,o,s,c,l,u,d){return e=new pp(e,t,n,o,c,l,u,d,s),t=1,!0===a&&(t|=24),a=li(3,null,null,t),e.current=a,a.stateNode=e,t=la(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},Ha(a),e}function hp(e){return e?(e=si,e):si}function gp(e,t,n,r,i,a){i=hp(i),r.context===null?r.context=i:r.pendingContext=i,r=Wa(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=Ga(e,r,t),n!==null&&(Du(n,e,t),Ka(n,e,t))}function _p(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function vp(e,t){_p(e,t),(e=e.alternate)&&_p(e,t)}function yp(e){if(e.tag===13||e.tag===31){var t=ii(e,67108864);t!==null&&Du(t,e,67108864),vp(e,67108864)}}function bp(e){if(e.tag===13||e.tag===31){var t=Tu();t=nt(t);var n=ii(e,t);n!==null&&Du(n,e,t),vp(e,t)}}var xp=!0;function Sp(e,t,n,r){var i=F.T;F.T=null;var a=te.p;try{te.p=2,wp(e,t,n,r)}finally{te.p=a,F.T=i}}function Cp(e,t,n,r){var i=F.T;F.T=null;var a=te.p;try{te.p=8,wp(e,t,n,r)}finally{te.p=a,F.T=i}}function wp(e,t,n,r){if(xp){var i=Tp(r);if(i===null)Ld(e,t,r,Ep,n),Lp(e,r);else if(zp(i,e,t,n,r))r.stopPropagation();else if(Lp(e,r),t&4&&-1<Ip.indexOf(e)){for(;i!==null;){var a=_t(i);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=Ge(a.pendingLanes);if(o!==0){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var c=1<<31-Re(o);s.entanglements[1]|=c,o&=~c}hd(a),!(Kl&6)&&(pu=Ee()+500,gd(0,!1))}}break;case 31:case 13:s=ii(a,2),s!==null&&Du(s,a,2),Mu(),vp(a,2)}if(a=Tp(r),a===null&&Ld(e,t,r,Ep,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else Ld(e,t,r,null,n)}}function Tp(e){return e=nn(e),Dp(e)}var Ep=null;function Dp(e){if(Ep=null,e=gt(e),e!==null){var t=l(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=u(t),e!==null)return e;e=null}else if(n===31){if(e=d(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return Ep=e,null}function Op(e){switch(e){case`beforetoggle`:case`cancel`:case`click`:case`close`:case`contextmenu`:case`copy`:case`cut`:case`auxclick`:case`dblclick`:case`dragend`:case`dragstart`:case`drop`:case`focusin`:case`focusout`:case`input`:case`invalid`:case`keydown`:case`keypress`:case`keyup`:case`mousedown`:case`mouseup`:case`paste`:case`pause`:case`play`:case`pointercancel`:case`pointerdown`:case`pointerup`:case`ratechange`:case`reset`:case`resize`:case`seeked`:case`submit`:case`toggle`:case`touchcancel`:case`touchend`:case`touchstart`:case`volumechange`:case`change`:case`selectionchange`:case`textInput`:case`compositionstart`:case`compositionend`:case`compositionupdate`:case`beforeblur`:case`afterblur`:case`beforeinput`:case`blur`:case`fullscreenchange`:case`focus`:case`hashchange`:case`popstate`:case`select`:case`selectstart`:return 2;case`drag`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`mousemove`:case`mouseout`:case`mouseover`:case`pointermove`:case`pointerout`:case`pointerover`:case`scroll`:case`touchmove`:case`wheel`:case`mouseenter`:case`mouseleave`:case`pointerenter`:case`pointerleave`:return 8;case`message`:switch(De()){case Oe:return 2;case ke:return 8;case Ae:case je:return 32;case Me:return 268435456;default:return 32}default:return 32}}var kp=!1,Ap=null,jp=null,Mp=null,Np=new Map,Pp=new Map,Fp=[],Ip=`mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset`.split(` `);function Lp(e,t){switch(e){case`focusin`:case`focusout`:Ap=null;break;case`dragenter`:case`dragleave`:jp=null;break;case`mouseover`:case`mouseout`:Mp=null;break;case`pointerover`:case`pointerout`:Np.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:Pp.delete(t.pointerId)}}function Rp(e,t,n,r,i,a){return e===null||e.nativeEvent!==a?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:a,targetContainers:[i]},t!==null&&(t=_t(t),t!==null&&yp(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function zp(e,t,n,r,i){switch(t){case`focusin`:return Ap=Rp(Ap,e,t,n,r,i),!0;case`dragenter`:return jp=Rp(jp,e,t,n,r,i),!0;case`mouseover`:return Mp=Rp(Mp,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return Np.set(a,Rp(Np.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,Pp.set(a,Rp(Pp.get(a)||null,e,t,n,r,i)),!0}return!1}function Bp(e){var t=gt(e.target);if(t!==null){var n=l(t);if(n!==null){if(t=n.tag,t===13){if(t=u(n),t!==null){e.blockedOn=t,at(e.priority,function(){bp(n)});return}}else if(t===31){if(t=d(n),t!==null){e.blockedOn=t,at(e.priority,function(){bp(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Vp(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Tp(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);tn=r,n.target.dispatchEvent(r),tn=null}else return t=_t(n),t!==null&&yp(t),e.blockedOn=n,!1;t.shift()}return!0}function Hp(e,t,n){Vp(e)&&n.delete(t)}function Up(){kp=!1,Ap!==null&&Vp(Ap)&&(Ap=null),jp!==null&&Vp(jp)&&(jp=null),Mp!==null&&Vp(Mp)&&(Mp=null),Np.forEac
vendor: 4,360 bytes, line 10
10h(Hp),Pp.forEach(Hp)}function Wp(e,t){e.blockedOn===t&&(e.blockedOn=null,kp||(kp=!0,n.unstable_scheduleCallback(n.unstable_NormalPriority,Up)))}var Gp=null;function Kp(e){Gp!==e&&(Gp=e,n.unstable_scheduleCallback(n.unstable_NormalPriority,function(){Gp===e&&(Gp=null);for(var t=0;t<e.length;t+=3){var n=e[t],r=e[t+1],i=e[t+2];if(typeof r!=`function`){if(Dp(r||n)===null)continue;break}var a=_t(n);a!==null&&(e.splice(t,3),t-=3,ks(a,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function qp(e){function t(t){return Wp(t,e)}Ap!==null&&Wp(Ap,e),jp!==null&&Wp(jp,e),Mp!==null&&Wp(Mp,e),Np.forEach(t),Pp.forEach(t);for(var n=0;n<Fp.length;n++){var r=Fp[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<Fp.length&&(n=Fp[0],n.blockedOn===null);)Bp(n),n.blockedOn===null&&Fp.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(r=0;r<n.length;r+=3){var i=n[r],a=n[r+1],o=i[ct]||null;if(typeof a==`function`)o||Kp(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[ct]||null)s=o.formAction;else if(Dp(i)!==null)continue}else s=o.action;typeof s==`function`?n[r+1]=s:(n.splice(r,3),r-=3),Kp(n)}}}function Jp(){function e(e){e.canIntercept&&e.info===`react-transition`&&e.intercept({handler:function(){return new Promise(function(e){return i=e})},focusReset:`manual`,scroll:`manual`})}function t(){i!==null&&(i(),i=null),r||setTimeout(n,20)}function n(){if(!r&&!navigation.transition){var e=navigation.currentEntry;e&&e.url!=null&&navigation.navigate(e.url,{state:e.getState(),info:`react-transition`,history:`replace`})}}if(typeof navigation==`object`){var r=!1,i=null;return navigation.addEventListener(`navigate`,e),navigation.addEventListener(`navigatesuccess`,t),navigation.addEventListener(`navigateerror`,t),setTimeout(n,100),function(){r=!0,navigation.removeEventListener(`navigate`,e),navigation.removeEventListener(`navigatesuccess`,t),navigation.removeEventListener(`navigateerror`,t),i!==null&&(i(),i=null)}}}function Yp(e){this._internalRoot=e}Xp.prototype.render=Yp.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(a(409));var n=t.current;gp(n,Tu(),e,t,null,null)},Xp.prototype.unmount=Yp.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;gp(e.current,2,null,e,null,null),Mu(),t[lt]=null}};function Xp(e){this._internalRoot=e}Xp.prototype.unstable_scheduleHydration=function(e){if(e){var t=it();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Fp.length&&t!==0&&t<Fp[n].priority;n++);Fp.splice(n,0,e),n===0&&Bp(e)}};var Zp=r.version;if(Zp!==`19.2.6`)throw Error(a(527,Zp,`19.2.6`));te.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render==`function`?Error(a(188)):(e=Object.keys(e).join(`,`),Error(a(268,e)));return e=p(t),e=e===null?null:m(e),e=e===null?null:e.stateNode,e};var Qp={bundleType:0,version:`19.2.6`,rendererPackageName:`react-dom`,currentDispatcherRef:F,reconcilerVersion:`19.2.6`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var $p=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!$p.isDisabled&&$p.supportsFiber)try{Fe=$p.inject(Qp),Ie=$p}catch{}}e.createRoot=function(e,t){if(!s(e))throw Error(a(299));var n=!1,r=``,i=Qs,o=$s,c=ec;return t!=null&&(!0===t.unstable_strictMode&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onUncaughtError!==void 0&&(i=t.onUncaughtError),t.onCaughtError!==void 0&&(o=t.onCaughtError),t.onRecoverableError!==void 0&&(c=t.onRecoverableError)),t=mp(e,1,!1,null,null,n,r,null,i,o,c,Jp),e[lt]=t.current,Fd(e),new Yp(t)},e.hydrateRoot=function(e,t,n){if(!s(e))throw Error(a(299));var r=!1,i=``,o=Qs,c=$s,l=ec,u=null;return n!=null&&(!0===n.unstable_strictMode&&(r=!0),n.identifierPrefix!==void 0&&(i=n.identifierPrefix),n.onUncaughtError!==void 0&&(o=n.onUncaughtError),n.onCaughtError!==void 0&&(c=n.onCaughtError),n.onRecoverableError!==void 0&&(l=n.onRecoverableError),n.formState!==void 0&&(u=n.formState)),t=mp(e,1,!0,t,n??null,r,i,u,o,c,l,Jp),t.context=hp(null),n=t.current,r=Tu(),r=nt(r),i=Wa(r),i.callback=null,Ga(n,i,r),n=r,t.current.lanes=n,Ze(t,n),hd(t),e[lt]=t.current,Fd(e),new Xp(t)},e.version=`19.2.6`})),u=n(((e,t)=>{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=l()}
10)),d=r(t(),1),f=r(u(),1),p=class e extends Error{static kind=`ClerkError`;clerkError=!0;code;longMessage;docsUrl;cause;get name(){return this.constructor.name}constructor(t){super(new.target.formatMessage(new.target.kind,t.message,t.code,t.docsUrl),{cause:t.cause}),Object.setPrototypeOf(this,e.prototype),this.code=t.code,this.docsUrl=t.docsUrl,this.longMessage=t.longMessage,this.cause=t.cause}toString(){return`[${this.name}]\nMessage:${this.message}`}static formatMessage(e,t,n,r){let i=`Clerk:`,a=new RegExp(i.replace(` `,`\\s*`),`i`);return t=t.replace(a,``),t=`${i} ${t.trim()}\n\n(code="${n}")\n\n`,r&&(t+=`\n\nDocs: ${r}`),t}},m=class e extends p{static kind=`ClerkRuntimeError`;clerkRuntimeError=!0;constructor(t,n){super({...n,message:t}),Object.setPrototypeOf(this,e.prototype)}},h=Object.freeze({InvalidProxyUrlErrorMessage:`The proxyUrl passed to Clerk is invalid. The expected value for proxyUrl is an absolute URL or a relative path with a leading '/'. (key={{url}})`,InvalidPublishableKeyErrorMessage:`The publishableKey passed to Clerk is invali
10d. You can get your Publishable key at https://dashboard.clerk.com/last-active?path=api-keys. (key={{key}})`,MissingPublishableKeyErrorMessage:`Missing publishableKey. You can get your key at https://dashboard.clerk.com/last-active?path=api-keys.`,MissingSecretKeyErrorMessage:`Missing secretKey. You can get your key at https://dashboard.clerk.com/last-active?path=api-keys.`,MissingClerkProvider:`{{source}} can only be used within the <ClerkProvider /> component. Learn more: https://clerk.com/docs/components/clerk-provider`});function g({packageName:e,customMessages:t}){let n=e;function r(e,t){if(!t)return`${n}: ${e}`;let r=e,i=e.matchAll(/{{([a-zA-Z0-9-_]+)}}/g);for(let e of i){let n=(t[e[1]]||``).toString();r=r.replace(`{{${e[1]}}}`,n)}return`${n}: ${r}`}let i={...h,...t};return{setPackageName({packageName:e}){return typeof e==`string`&&(n=e),this},setMessages({customMessages:e}){return Object.assign(i,e||{}),this},throwInvalidPublishableKeyError(e){throw Error(r(i.InvalidPublishableKeyErrorMessage,e))},throwInvalidProxyUrl(e){throw Error(r(i.InvalidProxyUrlErrorMessage,e))},throwMissingPublishableKeyError(){throw Error(r(i.MissingPublishableKeyErrorMessage))},throwMissingSecretKeyError(){throw Error(r(i.MissingSecretKeyErrorMessage))},throwMissingClerkProviderError(e){throw Error(r(i.MissingClerkProvider,e))},throw(e){throw Error(r(e))}}}var _=[`.lcl.dev`,`.stg.dev`,`.lclstage.dev`,`.stgstage.dev`,`.dev.lclclerk.com`,`.stg.lclclerk.com`,`.accounts.lclclerk.com`,`accountsstage.dev`,`accounts.dev`],v=e=>typeof atob<`u`&&typeof atob==`function`?atob(e):globalThis.Buffer===void 0?e:globalThis.Buffer.from(e,`base64`).toString(),y=`pk_live_`,b=`pk_test_`;function x(e){if(!e.endsWith(`$`))return!1;let t=e.slice(0,-1);return t.includes(`$`)?!1:t.includes(`.`)}function S(e,t={}){if(e||=``,!e||!C(e)){if(t.fatal&&!e)throw Error(`Publishable key is missing. Ensure that your publishable key is correctly configured. Double-check your environment configuration for your keys, or access them here: https://dashboard.clerk.com/last-active?path=api-keys`);if(t.fatal&&!C(e))throw Error(`Publishable key not valid.`);return null}let n=e.startsWith(y)?`production`:`development`,r;try{r=v(e.split(`_`)[2])}catch{if(t.fatal)throw Error(`Publishable key not valid: Failed to decode key.`);return null}if(!x(r)){if(t.fatal)throw Error(`Publishable key not valid: Decoded key has invalid format.`);return null}let i=r.slice(0,-1);return t.proxyUrl?i=t.proxyUrl:n!==`development`&&t.domain&&t.isSatellite&&(i=`clerk.${t.domain}`),{instanceType:n,frontendApi:i}}function C(e=``){try{if(!(e.startsWith(y)||e.startsWith(b)))return!1;let t=e.split(`_`);if(t.length!==3)return!1;let n=t[2];return n?x(v(n)):!1}catch{return!1}}function w(){let e=new Map;return{isDevOrStagingUrl:t=>{if(!t)return!1;let n=typeof t==`string`?t:t.hostname,r=e.get(n);return r===void 0&&(r=_.some(e=>n.endsWith(e)),e.set(n,r)),r}}}var T=`METHOD_CALLED`,E=.1;function D(e,t){return{event:T,eventSamplingRate:E,payload:{method:e,...t}}}var O=`ClerkJS:`;function k(){throw Error(`${O} Clerk instance not found. Make sure Clerk is initialized before using any Clerk components.`)}var A=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},j=new class extends A{#e;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e();return window.addEventListener(`visibilitychange`,t,!1),()=>{window.removeEventListener(`visibilitychange`,t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(e=>{typeof e==`boolean`?this.setFocused(e):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){let e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e==`boolean`?this.#e:globalThis.document?.visibilityState!==`hidden`}},M={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},N=new class{#e=M;setTimeoutProvider(e){this.#e=e}setTimeout(e,t){return this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}};function P(e){setTimeout(e,0)}var ee=typeof window>`u`||`Deno`in globalThis;function F(){}function te(e,t){return typeof e==`function`?e(t):e}function ne(e){return typeof e==`number`&&e>=0&&e!==1/0}function re(e,t){return Math.max(e+(t||0)-Date.now(),0)}function I(e,t){return typeof e==`function`?e(t):e}function ie(e,t){return typeof e==`function`?e(t):e}function ae(e,t){let{type:n=`all`,exact:r,fetchStatus:i,predicate:a,queryKey:o,stale:s}=e;if(o){if(r){if(t.queryHash!==L(o,t.options))return!1}else if(!ce(t.queryKey,o))return!1}if(n!==`all`){let e=t.isActive();if(n===`active`&&!e||n===`inactive`&&e)return!1}return!(typeof s==`boolean`&&t.isStale()!==s||i&&i!==t.state.fetchStatus||a&&!a(t))}function oe(e,t){let{exact:n,status:r,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(se(t.options.mutationKey)!==se(a))return!1}else if(!ce(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function L(e,t){return(t?.queryKeyHashFn||se)(e)}function se(e){return JSON.stringify(e,(e,t)=>pe(t)?Object.keys(t).sort().reduce((e,n)=>(e[n]=t[n],e),{}):t)}function ce(e,t){return e===t?!0:typeof e==typeof t&&e&&t&&typeof e==`object`&&typeof t==`object`?Object.keys(t).every(n=>ce(e[n],t[n])):!1}var le=Object.prototype.hasOwnProperty;function ue(e,t,n=0){if(e===t)return e;if(n>500)return t;let r=fe(e)&&fe(t);if(!r&&!(pe(e)&&pe(t)))return t;let i=(r?e:Object.keys(e)).length,a=r?t:Object.keys(t),o=a.length,s=r?Array(o):{},c=0;for(let l=0;l<o;l++){let o=r?l:a[l],u=e[o],d=t[o];if(u===d){s[o]=u,(r?l<i:le.call(e,o))&&c++;continue}if(u===null||d===null||typeof u!=`object`||typeof d!=`object`){s[o]=d;continue}let f=ue(u,d,n+1);s[o]=f,f===u&&c++}return i===o&&c===i?e:s}function de(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(let n in e)if(e[n]!==t[n])return!1;return!0}function fe(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function pe(e){if(!me(e))return!1;let t=e.constructor;if(t===void 0)return!0;let n=t.prototype;return!(!me(n)||!n.hasOwnProperty(`isPrototypeOf`)||Object.getPrototypeOf(e)!==Object.prototype)}function me(e){return Object.prototype.toString.call(e)===`[object Object]`}function he(e){return new Promise(t=>{N.setTimeout(t,e)})}function ge(e,t,n){return typeof n.structuralSharing==`function`?n.structuralSharing(e,t):n.structuralSharing===!1?t:ue(e,t)}function _e(e,t,n=0){let r=[...e,t];return n&&r.length>n?r.slice(1):r}function ve(e,t,n=0){let r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var ye=Symbol();function be(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===ye?()=>Promise.reject(Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function xe(e,t){return typeof e==`function`?e(...t):!!e}function Se(e,t,n){let r=!1,i;return Object.defineProperty(e,`signal`,{enumerable:!0,get:()=>(i??=t(),r?i:(r=!0,i.aborted?n():i.addEventListener(`abort`,n,{once:!0}),i))}),e}var Ce=(()=>{let e=()=>ee;return{isServer(){return e()},setIsServer(t){e=t}}})();function we(){let e,t,n=new Promise((n,r)=>{e=n,t=r});n.status=`pending`,n.catch(()=>{});function r(e){Object.assign(n,e),delete n.resolve,delete n.reject}return n.resolve=t=>{r({status:`fulfilled`,value:t}),e(t)},n.reject=e=>{r({status:`rejected`,reason:e}),t(e)},n}var Te=P;function Ee(){let e=[],t=0,n=e=>{e()},r=e=>{e()},i=Te,a=r=>{t?e.push(r):i(()=>{n(r)})},o=()=>{let t=e;e=[],t.length&&i(()=>{r(()=>
10{t.forEach(e=>{n(e)})})})};return{batch:e=>{let n;t++;try{n=e()}finally{t--,t||o()}return n},batchCalls:e=>(...t)=>{a(()=>{e(...t)})},schedule:a,setNotifyFunction:e=>{n=e},setBatchNotifyFunction:e=>{r=e},setScheduler:e=>{i=e}}}var De=Ee(),Oe=new class extends A{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e(!0),n=()=>e(!1);return window.addEventListener(`online`,t,!1),window.addEventListener(`offline`,n,!1),()=>{window.removeEventListener(`online`,t),window.removeEventListener(`offline`,n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(t=>{t(e)}))}isOnline(){return this.#e}};function ke(e){return Math.min(1e3*2**e,3e4)}function Ae(e){return(e??`online`)===`online`?Oe.isOnline():!0}var je=class extends Error{constructor(e){super(`CancelledError`),this.revert=e?.revert,this.silent=e?.silent}};function Me(e){let t=!1,n=0,r,i=we(),a=()=>i.status!==`pending`,o=t=>{if(!a()){let n=new je(t);f(n),e.onCancel?.(n)}},s=()=>{t=!0},c=()=>{t=!1},l=()=>j.isFocused()&&(e.networkMode===`always`||Oe.isOnline())&&e.canRun(),u=()=>Ae(e.networkMode)&&e.canRun(),d=e=>{a()||(r?.(),i.resolve(e))},f=e=>{a()||(r?.(),i.reject(e))},p=()=>new Promise(t=>{r=e=>{(a()||l())&&t(e)},e.onPause?.()}).then(()=>{r=void 0,a()||e.onContinue?.()}),m=()=>{if(a())return;let r,i=n===0?e.initialPromise:void 0;try{r=i??e.fn()}catch(e){r=Promise.reject(e)}Promise.resolve(r).then(d).catch(r=>{if(a())return;let i=e.retry??(Ce.isServer()?0:3),o=e.retryDelay??ke,s=typeof o==`function`?o(n,r):o,c=i===!0||typeof i==`number`&&n<i||typeof i==`function`&&i(n,r);if(t||!c){f(r);return}n++,e.onFail?.(n,r),he(s).then(()=>l()?void 0:p()).then(()=>{t?f(r):m()})})};return{promise:i,status:()=>i.status,cancel:o,continue:()=>(r?.(),i),cancelRetry:s,continueRetry:c,canStart:u,start:()=>(u()?m():p().then(m),i)}}var Ne=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),ne(this.gcTime)&&(this.#e=N.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Ce.isServer()?1/0:300*1e3))}clearGcTimeout(){this.#e!==void 0&&(N.clearTimeout(this.#e),this.#e=void 0)}};function Pe(e){return{onFetch:(t,n)=>{let r=t.options,i=t.fetchOptions?.meta?.fetchMore?.direction,a=t.state.data?.pages||[],o=t.state.data?.pageParams||[],s={pages:[],pageParams:[]},c=0,l=async()=>{let n=!1,l=e=>{Se(e,()=>t.signal,()=>n=!0)},u=be(t.options,t.fetchOptions),d=async(e,r,i)=>{if(n)return Promise.reject(t.signal.reason);if(r==null&&e.pages.length)return Promise.resolve(e);let a=await u((()=>{let e={client:t.client,queryKey:t.queryKey,pageParam:r,direction:i?`backward`:`forward`,meta:t.options.meta};return l(e),e})()),{maxPages:o}=t.options,s=i?ve:_e;return{pages:s(e.pages,a,o),pageParams:s(e.pageParams,r,o)}};if(i&&a.length){let e=i===`backward`,t=e?Ie:Fe,n={pages:a,pageParams:o};s=await d(n,t(r,n),e)}else{let t=e??a.length;do{let e=c===0?o[0]??r.initialPageParam:Fe(r,s);if(c>0&&e==null)break;s=await d(s,e),c++}while(c<t)}return s};t.options.persister?t.fetchFn=()=>t.options.persister?.(l,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):t.fetchFn=l}}}function Fe(e,{pages:t,pageParams:n}){let r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function Ie(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}function Le(e,t){return t?Fe(e,t)!=null:!1}function Re(e,t){return!t||!e.getPreviousPageParam?!1:Ie(e,t)!=null}var ze=class extends Ne{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e){super(),this.#s=!1,this.#o=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#i=e.client,this.#r=this.#i.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#t=He(this.options),this.state=e.state??this.#t,this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return this.#e}get promise(){return this.#a?.promise}setOptions(e){if(this.options={...this.#o,...e},e?._type&&(this.#e=e._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){let e=He(this.options);e.data!==void 0&&(this.setState(Ve(e.data,e.dataUpdatedAt)),this.#t=e)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus===`idle`&&this.#r.remove(this)}setData(e,t){let n=ge(this.state.data,e,this.options);return this.#l({data:n,type:`success`,dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e){this.#l({type:`setState`,state:e})}cancel(e){let t=this.#a?.promise;return this.#a?.cancel(e),t?t.then(F).catch(F):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#t}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>ie(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===ye||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdate
10Count>0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>I(e.options.staleTime,this)===`static`):!1}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e===`static`?!1:this.state.isInvalidated?!0:!re(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(e=>e.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#a?.continue()}onOnline(){this.observers.find(e=>e.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#a?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#r.notify({type:`observerAdded`,query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#a&&(this.#s||this.#c()?this.#a.cancel({revert:!0}):this.#a.cancelRetry()),this.scheduleGc()),this.#r.notify({type:`observerRemoved`,query:this,observer:e}))}getObserversCount(){return this.observers.length}#c(){return this.state.fetchStatus===`paused`&&this.state.status===`pending`}invalidate(){this.state.isInvalidated||this.#l({type:`invalidate`})}async fetch(e,t){if(this.state.fetchStatus!==`idle`&&this.#a?.status()!==`rejected`){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#a)return this.#a.continueRetry(),this.#a.promise}if(e&&this.setOptions(e),!this.options.queryFn){let e=this.observers.find(e=>e.options.queryFn);e&&this.setOptions(e.options)}let n=new AbortController,r=e=>{Object.defineProperty(e,`signal`,{enumerable:!0,get:()=>(this.#s=!0,n.signal)})},i=()=>{let e=be(this.options,t),n=(()=>{let e={client:this.#i,queryKey:this.queryKey,meta:this.meta};return r(e),e})();return this.#s=!1,this.options.persister?this.options.persister(e,n,this):e(n)},a=(()=>{let e={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#i,state:this.state,fetchFn:i};return r(e),e})();(this.#e===`infinite`?Pe(this.options.pages):this.options.behavior)?.onFetch(a,this),this.#n=this.state,(this.state.fetchStatus===`idle`||this.state.fetchMeta!==a.fetchOptions?.meta)&&this.#l({type:`fetch`,meta:a.fetchOptions?.meta}),this.#a=Me({initialPromise:t?.initialPromise,fn:a.fetchFn,onCancel:e=>{e instanceof je&&e.revert&&this.setState({...this.#n,fetchStatus:`idle`}),n.abort()},onFail:(e,t)=>{this.#l({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#l({type:`pause`})},onContinue:()=>{this.#l({type:`continue`})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0});try{let e=await this.#a.start();if(e===void 0)throw Error(`${this.queryHash} data is undefined`);return this.setData(e),this.#r.config.onSuccess?.(e,this),this.#r.config.onSettled?.(e,this.state.error,this),e}catch(e){if(e instanceof je){if(e.silent)return this.#a.promise;if(e.revert){if(this.state.data===void 0)throw e;return this.state.data}}throw this.#l({type:`error`,error:e}),this.#r.config.onError?.(e,this),this.#r.config.onSettled?.(this.state.data,e,this),e}finally{this.scheduleGc()}}#l(e){let t=t=>{switch(e.type){case`failed`:return{...t,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case`pause`:return{...t,fetchStatus:`paused`};case`continue`:return{...t,fetchStatus:`fetching`};case`fetch`:return{...t,...Be(t.data,this.options),fetchMeta:e.meta??null};case`success`:let n={...t,...Ve(e.data,e.dataUpdatedAt),dataUpdateCount:t.dataUpdateCount+1,...!e.manual&&{fetchStatus:`idle`,fetchFailureCount:0,fetchFailureReason:null}};return this.#n=e.manual?n:void 0,n;case`error`:let r=e.error;return{...t,error:r,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:r,fetchStatus:`idle`,status:`error`,isInvalidated:!0};case`invalidate`:return{...t,isInvalidated:!0};case`setState`:return{...t,...e.state}}};this.state=t(this.state),De.batch(()=>{this.observers.forEach(e=>{e.onQueryUpdate()}),this.#r.notify({query:this,type:`updated`,action:e})})}};function Be(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Ae(t.networkMode)?`fetching`:`paused`,...e===void 0&&{error:null,status:`pending`}}}function Ve(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:`success`}}function He(e){let t=typeof e.initialData==`function`?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt==`function`?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdate
vendor: 4,625 bytes, line 10
10Count:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?`success`:`pending`,fetchStatus:`idle`}}var Ue=class extends A{constructor(e,t){super(),this.options=t,this.#e=e,this.#s=null,this.#o=we(),this.bindMethods(),this.setOptions(t)}#e;#t=void 0;#n=void 0;#r=void 0;#i;#a;#o;#s;#c;#l;#u;#d;#f;#p;#m=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),Ge(this.#t,this.options)?this.#h():this.updateResult(),this.#y())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Ke(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Ke(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#b(),this.#x(),this.#t.removeObserver(this)}setOptions(e){let t=this.options,n=this.#t;if(this.options=this.#e.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!=`boolean`&&typeof this.options.enabled!=`function`&&typeof ie(this.options.enabled,this.#t)!=`boolean`)throw Error(`Expected enabled to be a boolean or a callback that returns a boolean`);this.#S(),this.#t.setOptions(this.options),t._defaulted&&!de(this.options,t)&&this.#e.getQueryCache().notify({type:`observerOptionsUpdated`,query:this.#t,observer:this});let r=this.hasListeners();r&&qe(this.#t,n,this.options,t)&&this.#h(),this.updateResult(),r&&(this.#t!==n||ie(this.options.enabled,this.#t)!==ie(t.enabled,this.#t)||I(this.options.staleTime,this.#t)!==I(t.staleTime,this.#t))&&this.#g();let i=this.#_();r&&(this.#t!==n||ie(this.options.enabled,this.#t)!==ie(t.enabled,this.#t)||i!==this.#p)&&this.#v(i)}getOptimisticResult(e){let t=this.#e.getQueryCache().build(this.#e,e),n=this.createResult(t,e);return Ye(this,n)&&(this.#r=n,this.#a=this.options,this.#i=this.#t.state),n}getCurrentResult(){return this.#r}trackResult(e,t){return new Proxy(e,{get:(e,n)=>(this.trackProp(n),t?.(n),n===`promise`&&(this.trackProp(`data`),!this.options.experimental_prefetchInRender&&this.#o.status===`pending`&&this.#o.reject(Error(`experimental_prefetchInRender feature flag is not enabled`))),Reflect.get(e,n))})}trackProp(e){this.#m.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){let t=this.#e.defaultQueryOptions(e),n=this.#e.getQueryCache().build(this.#e,t);return n.fetch().then(()=>this.createResult(n,t))}fetch(e){return this.#h({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#r))}#h(e){this.#S();let t=this.#t.fetch(this.options,e);return e?.throwOnError||(t=t.catch(F)),t}#g(){this.#b();let e=I(this.options.staleTime,this.#t);if(Ce.isServer()||this.#r.isStale||!ne(e))return;let t=re(this.#r.dataUpdatedAt,e)+1;this.#d=N.setTimeout(()=>{this.#r.isStale||this.updateResult()},t)}#_(){return(typeof this.options.refetchInterval==`function`?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#v(e){this.#x(),this.#p=e,!(Ce.isServer()||ie(this.options.enabled,this.#t)===!1||!ne(this.#p)||this.#p===0)&&(this.#f=N.setInterval(()=>{(this.options.refetchIntervalInBackground||j.isFocused())&&this.#h()},this.#p))}#y(){this.#g(),this.#v(this.#_())}#b(){this.#d!==void 0&&(N.clearTimeout(this.#d),this.#d=void 0)}#x(){this.#f!==void 0&&(N.clearInterval(this.#f),this.#f=void 0)}createResult(e,t){let n=this.#t,r=this.options,i=this.#r,a=this.#i,o=this.#a,s=e===n?this.#n:e.state,{state:c}=e,l={...c},u=!1,d;if(t._optimisticResults){let i=this.hasListeners(),a=!i&&Ge(e,t),o=i&&qe(e,n,t,r);(a||o)&&(l={...l,...Be(c.data,e.options)}),t._optimisticResults===`isRestoring`&&(l.fetchStatus=`idle`)}let{error:f,errorUpdatedAt:p,status:m}=l;d=l.data;let h=!1;if(t.placeholderData!==void 0&&d===void 0&&m===`pending`){let e;i?.isPlaceholderData&&t.placeholderData===o?.placeholderData?(e=i.data,h=!0):e=typeof t.placeholderData==`function`?t.placeholderData(this.#u?.state.data,this.#u):t.placeholderData,e!==void 0&&(m=`success`,d=ge(i?.data,e,t),u=!0)}if(t.select&&d!==void 0&&!h)if(i&&d===a?.data&&t.select===this.#c)d=this.#l;else try{this.#c=t.select,d=t.select(d),d=ge(i?.data,d,t),this.#l=d,this.#s=null}catch(e){this.#s=e}this.#s&&(f=this.#s,d=this.#l,p=Date.now(),m=`error`);let g=l.fetchStatus===`fetching`,_=m===`pending`,v=m===`error`,y=_&&g,b=d!==void 0,x={status:m,fetchStatus:l.fetchStatus,isPending:_,isSuccess:m===`success`,isError:v,isInitialLoading:y,isLoading:y,data:d,dataUpdatedAt:l.dataUpdatedAt,error:f,errorUpdatedAt:p,failureCount:l.fetchFailureCount,failureReason:l.fetchFailureReason,errorUpdate
10Count:l.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:l.dataUpdateCount>s.dataUpdateCount||l.errorUpdateCount>s.errorUpdateCount,isFetching:g,isRefetching:g&&!_,isLoadingError:v&&!b,isPaused:l.fetchStatus===`paused`,isPlaceholderData:u,isRefetchError:v&&b,isStale:Je(e,t),refetch:this.refetch,promise:this.#o,isEnabled:ie(t.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){let t=x.data!==void 0,r=x.status===`error`&&!t,i=e=>{r?e.reject(x.error):t&&e.resolve(x.data)},a=()=>{i(this.#o=x.promise=we())},o=this.#o;switch(o.status){case`pending`:e.queryHash===n.queryHash&&i(o);break;case`fulfilled`:(r||x.data!==o.value)&&a();break;case`rejected`:(!r||x.error!==o.reason)&&a();break}}return x}updateResult(){let e=this.#r,t=this.createResult(this.#t,this.options);this.#i=this.#t.state,this.#a=this.options,this.#i.data!==void 0&&(this.#u=this.#t),!de(t,e)&&(this.#r=t,this.#C({listeners:(()=>{if(!e)return!0;let{notifyOnChangeProps:t}=this.options,n=typeof t==`function`?t():t;if(n===`all`||!n&&!this.#m.size)return!0;let r=new Set(n??this.#m);return this.options.throwOnError&&r.add(`error`),Object.keys(this.#r).some(t=>{let n=t;return this.#r[n]!==e[n]&&r.has(n)})})()}))}#S(){let e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;let t=this.#t;this.#t=e,this.#n=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#y()}#C(e){De.batch(()=>{e.listeners&&this.listeners.forEach(e=>{e(this.#r)}),this.#e.getQueryCache().notify({query:this.#t,type:`observerResultsUpdated`})})}};function We(e,t){return ie(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status===`error`&&ie(t.retryOnMount,e)===!1)}function Ge(e,t){return We(e,t)||e.state.data!==void 0&&Ke(e,t,t.refetchOnMount)}function Ke(e,t,n){if(ie(t.enabled,e)!==!1&&I(t.staleTime,e)!==`static`){let r=typeof n==`function`?n(e):n;return r===`always`||r!==!1&&Je(e,t)}return!1}function qe(e,t,n,r){return(e!==t||ie(r.enabled,e)===!1)&&(!n.suspense||e.state.status!==`error`)&&Je(e,n)}function Je(e,t){return ie(t.enabled,e)!==!1&&e.isStaleByTime(I(t.staleTime,e))}function Ye(e,t){return!de(e.getCurrentResult(),t)}var Xe=class extends Ue{constructor(e,t){super(e,t)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(e){e._type=`infinite`,super.setOptions(e)}getOptimisticResult(e){return e._type=`infinite`,super.getOptimisticResult(e)}fetchNextPage(e){return this.fetch({...e,meta:{fetchMore:{direction:`forward`}}})}fetchPreviousPage(e){return this.fetch({...e,meta:{fetchMore:{direction:`backward`}}})}createResult(e,t){let{state:n}=e,r=super.createResult(e,t),{isFetching:i,isRefetching:a,isError:o,isRefetchError:s}=r,c=n.fetchMeta?.fetchMore?.direction,l=o&&c===`forward`,u=i&&c===`forward`,d=o&&c===`backward`,f=i&&c===`backward`;return{...r,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:Le(t,n.data),hasPreviousPage:Re(t,n.data),isFetchNextPageError:l,isFetchingNextPage:u,isFetchPreviousPageError:d,isFetchingPreviousPage:f,isRefetchError:s&&!l&&!d,isRefetching:a&&!u&&!f}}},Ze=class extends Ne{#e;#t;#n;#r;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#t=[],this.state=e.state||Qe(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#n.notify({type:`observerAdded`,mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.scheduleGc(),this.#n.notify({type:`observerRemoved`,mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status===`pending`?this.scheduleGc():this.#n.remove(this))}continue(){return this.#r?.continue()??this.execute(this.state.variables)}async execute(e){let t=()=>{this.#i({type:`continue`})},n={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#r=Me({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(Error(`No mutationFn found`)),onFail:(e,t)=>{this.#i({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#i({type:`pause`})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)});
vendor: 2,873 bytes, line 10
10let r=this.state.status===`pending`,i=!this.#r.canStart();try{if(r)t();else{this.#i({type:`pending`,variables:e,isPaused:i}),this.#n.config.onMutate&&await this.#n.config.onMutate(e,this,n);let t=await this.options.onMutate?.(e,n);t!==this.state.context&&this.#i({type:`pending`,context:t,variables:e,isPaused:i})}let a=await this.#r.start();return await this.#n.config.onSuccess?.(a,e,this.state.context,this,n),await this.options.onSuccess?.(a,e,this.state.context,n),await this.#n.config.onSettled?.(a,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(a,null,e,this.state.context,n),this.#i({type:`success`,data:a}),a}catch(t){try{await this.#n.config.onError?.(t,e,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onError?.(t,e,this.state.context,n)}catch(e){Promise.reject(e)}try{await this.#n.config.onSettled?.(void 0,t,this.state.variables,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onSettled?.(void 0,t,e,this.state.context,n)}catch(e){Promise.reject(e)}throw this.#i({type:`error`,error:t}),t}finally{this.#n.runNext(this)}}#i(e){let t=t=>{switch(e.type){case`failed`:return{...t,failureCount:e.failureCount,failureReason:e.error};case`pause`:return{...t,isPaused:!0};case`continue`:return{...t,isPaused:!1};case`pending`:return{...t,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:`pending`,variables:e.variables,submittedAt:Date.now()};case`success`:return{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:`success`,isPaused:!1};case`error`:return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:!1,status:`error`}}};this.state=t(this.state),De.batch(()=>{this.#t.forEach(t=>{t.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:`updated`,action:e})})}};function Qe(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:`idle`,variables:void 0,submittedAt:0}}var $e=class extends A{constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}#e;#t;#n;build(e,t,n){let r=new Ze({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(t),state:n});return this.add(r),r}add(e){this.#e.add(e);let t=et(e);if(typeof t==`string`){let n=this.#t.get(t);n?n.push(e):this.#t.set(t,[e])}this.notify({type:`added`,mutation:e})}remove(e){if(this.#e.delete(e)){let t=et(e);if(typeof t==`string`){let n=this.#t.get(t);if(n)if(n.length>1){let t=n.indexOf(e);t!==-1&&n.splice(t,1)}else n[0]===e&&this.#t.delete(t)}}this.notify({type:`removed`,mutation:e})}canRun(e){let t=et(e);if(typeof t==`string`){let n=this.#t.get(t)?.find(e=>e.state.status===`pending`);return!n||n===e}else return!0}runNext(e){let t=et(e);return typeof t==`string`?(this.#t.get(t)?.find(t=>
10t!==e&&t.state.isPaused))?.continue()??Promise.resolve():Promise.resolve()}clear(){De.batch(()=>{this.#e.forEach(e=>{this.notify({type:`removed`,mutation:e})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(e){let t={exact:!0,...e};return this.getAll().find(e=>oe(t,e))}findAll(e={}){return this.getAll().filter(t=>oe(e,t))}notify(e){De.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){let e=this.getAll().filter(e=>e.state.isPaused);return De.batch(()=>Promise.all(e.map(e=>e.continue().catch(F))))}};function et(e){return e.options.scope?.id}var tt=class extends A{#e;#t=void 0;#n;#r;constructor(e,t){super(),this.#e=e,this.setOptions(t),this.bindMethods(),this.#i()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){let t=this.options;this.options=this.#e.defaultMutationOptions(e),de(this.options,t)||this.#e.getMutationCache().notify({type:`observerOptionsUpdated`,mutation:this.#n,observer:this}),t?.mutationKey&&this.options.mutationKey&&se(t.mutationKey)!==se(this.options.mutationKey)?this.reset():this.#n?.state.status===`pending`&&this.#n.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#n?.removeObserver(this)}onMutationUpdate(e){this.#i(),this.#a(e)}getCurrentResult(){return this.#t}reset(){this.#n?.removeObserver(this),this.#n=void 0,this.#i(),this.#a()}mutate(e,t){return this.#r=t,this.#n?.removeObserver(this),this.#n=this.#e.getMutationCache().build(this.#e,this.options),this.#n.addObserver(this),this.#n.execute(e)}#i(){let e=this.#n?.state??Qe();this.#t={...e,isPending:e.status===`pending`,isSuccess:e.status===`success`,isError:e.status===`error`,isIdle:e.status===`idle`,mutate:this.mutate,reset:this.reset}}#a(e){De.batch(()=>{if(this.#r&&this.hasListeners()){let t=this.#t.variables,n=this.#t.context,r={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};if(e?.type===`success`){try{this.#r.onSuccess?.(e.data,t,n,r)}catch(e){Promise.reject(e)}try{this.#r.onSettled?.(e.data,null,t,n,r)}catch(e){Promise.reject(e)}}else if(e?.type===`error`){try{this.#r.onError?.(e.error,t,n,r)}catch(e){Promise.reject(e)}try{this.#r.onSettled?.(void 0,e.error,t,n,r)}catch(e){Promise.reject(e)}}}this.listeners.forEach(e=>{e(this.#t)})})}},nt=class extends A{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,t,n){let r=t.queryKey,i=t.queryHash??L(r,t),a=this.get(i);return a||(a=new ze({client:e,queryKey:r,queryHash:i,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(r)}),this.add(a)),a}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:`added`,query:e}))}remove(e){let t=this.#e.get(e.queryHash);t&&(e.destroy(),t===e&&this.#e.delete(e.queryHash),this.notify({type:`removed`,query:e}))}clear(){De.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){let t={exact:!0,...e};return this.getAll().find(e=>ae(t,e))}findAll(e={}){let t=this.getAll();return Object.keys(e).length>0?t.filter(t=>ae(e,t)):t}notify(e){De.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){De.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){De.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},rt=class{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e={}){this.#e=e.queryCache||new nt,this.#t=e.mutationCache||new $e,this.#n=e.defaultOptions||{},this.#r=new Map,this.#i=new Map,this.#a=0}mount(){this.#a++,this.#a===1&&(this.#o=j.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#s=Oe.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#a--,this.#a===0&&(this.#o?.(),this.#o=void 0,this.#s?.(),this.#s=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:`fetching`}).length}isMutating(e){return this.#t.findAll({...e,status:`pending`}).length}getQueryData(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state.data}ensureQueryData(e){let t=this.defaultQueryOptions(e),n=this.#e.build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(I(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:e,state:t})=>[e,t.data])}setQueryData(e,t,n){let r=this.defaultQueryOptions({queryKey:e}),i=this.#e.get(r.queryHash)?.state.data,a=te(t,i);if(a!==void 0)return this.#e.build(this,r).setData(a,{...n,manual:!0})}
10setQueriesData(e,t,n){return De.batch(()=>this.#e.findAll(e).map(({queryKey:e})=>[e,this.setQueryData(e,t,n)]))}getQueryState(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){let t=this.#e;De.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){let n=this.#e;return De.batch(()=>(n.findAll(e).forEach(e=>{e.reset()}),this.refetchQueries({type:`active`,...e},t)))}cancelQueries(e,t={}){let n={revert:!0,...t},r=De.batch(()=>this.#e.findAll(e).map(e=>e.cancel(n)));return Promise.all(r).then(F).catch(F)}invalidateQueries(e,t={}){return De.batch(()=>(this.#e.findAll(e).forEach(e=>{e.invalidate()}),e?.refetchType===`none`?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??`active`},t)))}refetchQueries(e,t={}){let n={...t,cancelRefetch:t.cancelRefetch??!0},r=De.batch(()=>this.#e.findAll(e).filter(e=>!e.isDisabled()&&!e.isStatic()).map(e=>{let t=e.fetch(void 0,n);return n.throwOnError||(t=t.catch(F)),e.state.fetchStatus===`paused`?Promise.resolve():t}));return Promise.all(r).then(F)}fetchQuery(e){let t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);let n=this.#e.build(this,t);return n.isStaleByTime(I(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(F).catch(F)}fetchInfiniteQuery(e){return e._type=`infinite`,this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(F).catch(F)}ensureInfiniteQueryData(e){return e._type=`infinite`,this.ensureQueryData(e)}resumePausedMutations(){return Oe.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,t){this.#r.set(se(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){let t=[...this.#r.values()],n={};return t.forEach(t=>{ce(e,t.queryKey)&&Object.assign(n,t.defaultOptions)}),n}setMutationDefaults(e,t){this.#i.set(se(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){let t=[...this.#i.values()],n={};return t.forEach(t=>{ce(e,t.mutationKey)&&Object.assign(n,t.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;let t={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||=L(t.queryKey,t),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!==`always`),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode=`offlineFirst`),t.queryFn===ye&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},it=Object.prototype.hasOwnProperty;function at(e,t,n){for(n of e.keys())if(ot(n,t))return n}function ot(e,t){var n,r,i;if(e===t)return!0;if(e&&t&&(n=e.constructor)===t.constructor){if(n===Date)return e.getTime()===t.getTime();if(n===RegExp)return e.toString()===t.toString();if(n===Array){if((r=e.length)===t.length)for(;r--&&ot(e[r],t[r]););return r===-1}if(n===Set){if(e.size!==t.size)return!1;for(r of e)if(i=r,i&&typeof i==`object`&&(i=at(t,i),!i)||!t.has(i))return!1;return!0}if(n===Map){if(e.size!==t.size)return!1;for(r of e)if(i=r[0],i&&typeof i==`object`&&(i=at(t,i),!i)||!ot(r[1],t.get(i)))return!1;return!0}if(n===ArrayBuffer)e=new Uint8Array(e),t=new Uint8Array(t);else if(n===DataView){if((r=e.byteLength)===t.byteLength)for(;r--&&e.getInt8(r)===t.getInt8(r););return r===-1}if(ArrayBuffer.isView(e)){if((r=e.byteLength)===t.byteLength)for(;r--&&e[r]===t[r];);return r===-1}if(!n||typeof e==`object`){for(n in r=0,e)if(it.call(e,n)&&++r&&!it.call(t,n)||!(n in t)||!ot(e[n],t[n]))return!1;return Object.keys(t).length===r}}return e!==e&&t!==t}function st(e,t){if(!e)throw Error(typeof t==`string`?t:`${t.displayName} not found`)}var ct=(e,t)=>{let{assertCtxFn:n=st}=t||{},r=d.createContext(void 0);return r.displayName=e,[r,()=>{let t=d.useContext(r);return n(t,`${e} not found`),t.value},()=>{let e=d.useContext(r);return e?e.value:{}}]},[lt,ut]=ct(`ClerkInstanceContext`),[dt,ft]=ct(`InitialStateContext`);function pt({children:e,initialState:t}){let[n]=(0,d.useState)(t),r=d.useMemo(()=>({value:n}),[n]);return d.createElement(dt.Provider,{value:r},e)}function mt(){let e=ft();if(e instanceof Promise){if(`use`in d.default&&typeof d.use==`function`)return d.use(e);throw Error(`initialState cannot be a promise if React version is less than 19`)}return e}d.createContext({});var[ht,gt]=ct(`CheckoutContext`),_t=({children:e,...t})=>d.createElement(ht.Provider,{value:{value:t}},e);function vt(e){if(!d.useContext(lt)){if(typeof e==`function`){e();return}throw Error(`${e} can only be used within the <ClerkProvider /> component.
11
12Possible fixes:
131. Ensure that the <ClerkProvider /> is correctly wrapping your application where this component is used.
142. Check for multiple versions of the \`@clerk/shared\` package in y
14our project. Use a tool like \`npm ls @clerk/shared\` to identify multiple versions, and update your dependencies to only rely on one.
15
16Learn more: https://clerk.com/docs/components/clerk-provider`.trim())}}var yt={USER_MEMBERSHIPS_KEY:`userMemberships`,USER_INVITATIONS_KEY:`userInvitations`,USER_SUGGESTIONS_KEY:`userSuggestions`,DOMAINS_KEY:`domains`,MEMBERSHIP_REQUESTS_KEY:`membershipRequests`,MEMBERSHIPS_KEY:`memberships`,INVITATIONS_KEY:`invitations`,PLANS_KEY:`billing-plans`,SUBSCRIPTION_KEY:`billing-subscription`,PAYMENT_METHODS_KEY:`billing-payment-methods`,PAYMENT_ATTEMPTS_KEY:`billing-payment-attempts`,STATEMENTS_KEY:`billing-statements`,API_KEYS_KEY:`apiKeys`,ORGANIZATION_CREATION_DEFAULTS_KEY:`organizationCreationDefaults`,OAUTH_CONSENT_INFO_KEY:`oauthConsentInfo`};function bt(e){return{queryKey:[e.stablePrefix,e.authenticated,e.tracked,e.untracked],invalidationKey:[e.stablePrefix,e.authenticated,e.tracked],stableKey:e.stablePrefix,authenticated:e.authenticated}}function xt(e){if(e)return function(e){return e}}var St,Ct=!1;function wt(){if(!(typeof window>`u`))return Ct||=(St=new rt,!0),St}function Tt(e){let t=function(){},n;return n=new Proxy(t,{get(t,r){if(r!==`then`)return r===`toString`?()=>`[${e}]`:r===Symbol.toPrimitive?()=>0:n},apply(){return n},construct(){return n},has(){return!1},set(){return!1}}),n}var Et=Tt(`ClerkMockQueryClient`),Dt=()=>{let e=wt();return[e??Et,!!e]};function Ot(e,t){let[n,r]=Dt(),i=r?n.defaultQueryOptions(e):e;i._optimisticResults=`optimistic`;let a=d.useMemo(()=>new t(n,i),[n]),o=a.getOptimisticResult(i),s=e.subscribed!==!1;return d.useSyncExternalStore(d.useCallback(e=>{let t=s?a.subscribe(De.batchCalls(e)):F;return a.updateResult(),t},[a,s]),()=>a.getCurrentResult(),()=>a.getCurrentResult()),d.useEffect(()=>{a.setOptions(i)},[i,a]),r?i.notifyOnChangeProps?o:a.trackResult(o):{data:void 0,error:null,isLoading:e.enabled!==!1,isFetching:!1,status:`pending`}}function kt(e){return Ot(e,Xe)}function At(e){return Ot(e,Ue)}function jt(e){let t=(0,d.useRef)(e),n=(0,d.useRef)(null);return t.current!==e&&(n.current=t.current,t.current=e),n.current}var Mt=e=>[e,`${e}-inf`];function Nt(e){let{isSignedOut:t,stableKeys:n,authenticated:r=!0,onCleanup:i}=e,a=(0,d.useRef)(n),[o]=Dt(),s=jt(!t);(0,d.useEffect)(()=>{r===!0&&s&&t===!0&&(o.removeQueries({predicate:e=>{let[t,n]=e.queryKey;return n===!0&&typeof t==`string`&&(Array.isArray(a.current)?a.current.includes(t):a.current===t)}}),i?.())},[r,t,s,o])}var Pt=(e,t)=>{let n=typeof e==`boolean`&&e,r=(0,d.useRef)(n?t.initialPage:e?.initialPage??t.initialPage),i=(0,d.useRef)(n?t.pageSize:e?.pageSize??t.pageSize),a={};for(let r of Object.keys(t))a[r]=n?t[r]:e?.[r]??t[r];return{...a,initialPage:r.current,pageSize:i.current}};function Ft(e,t){return(e-1)*t}function It(e,t,n){return Math.ceil((e-t)/n)}function Lt(e,t,n,r){return e-t>n*r}function Rt(e,t,n){return(e-1)*t>n}var zt=e=>{let{fetcher:t,config:n,keys:r}=e,[i,a]=(0,d.useState)(n.initialPage??1),o=(0,d.useRef)(n.initialPage??1),s=(0,d.useRef)(n.pageSize??10),c=n.enabled??!0,l=n.isSignedIn,u=n.infinite??!1,f=n.__experimental_mode===`cache`,p=n.keepPreviousData??!1,[m]=Dt(),h=c&&!!t&&!f&&l!==!1,[g,_]=(0,d.useState)(0),v=(0,d.useCallback)(e=>{_(e)},[]),y=(0,d.useMemo)(()=>{let[e,t,n,a]=r.queryKey;return[e,t,n,{...a,args:{...a.args,initialPage:i,pageSize:s.current}}]},[r.queryKey,i]),b=At({queryKey:y,queryFn:({queryKey:e})=>{let{args:n}=e[3];if(t)return t(n)},staleTime:6e4,enabled:h&&!u,placeholderData:xt(p)}),x=(0,d.useMemo)(()=>{let[e,t,n,i]=r.queryKey;return[e+`-inf`,t,n,i]},[r.queryKey]),S=kt({queryKey:x,initialPageParam:n.initialPage??1,getNextPageParam:(e,t,r)=>{let i=e?.total_count??0;return(t.length+(n.initialPage?n.initialPage-1:0))*(n.pageSize??10)<i?r+1:void 0},queryFn:({pageParam:e,queryKey:n})=>{let{args:r}=n[3];if(t)return t({...r,initialPage:e,pageSize:s.current})},staleTime:6e4,enabled:h&&u});Nt({isSignedOut:l===!1,authenticated:r.authenticated,stableKeys:Mt(r.stableKey),onCleanup:()=>{a(o.current),Promise.resolve().then(()=>v(e=>e+1))}});let{data:C,count:w,page:T}=(0,d.useMemo)(()=>
16{if(u){let e=m.getQueryData(x),t=h?S.data?.pages??e?.pages??[]:e?.pages??[],n=Array.isArray(t)?t.filter(Boolean):[];return{data:n.map(e=>e?.data).flat().filter(Boolean)??[],count:n[n.length-1]?.total_count??0,page:n.length>0?n.length:o.current}}let e=h?b.data??m.getQueryData(y):m.getQueryData(y);return{data:Array.isArray(e?.data)?e.data:[],count:typeof e?.total_count==`number`?e.total_count:0,page:i}},[h,g,u,S.data?.pages,b.data,m,x,y,i]),E=(0,d.useCallback)(e=>{if(u){let t=typeof e==`function`?e(T):e,n=Math.max(0,t),r=m.getQueryData(x);n-(S.data?.pages??r?.pages??[]).length>0&&S.fetchNextPage({cancelRefetch:!1});return}return a(e)},[S,T,u,m,x]),D=u?S.isLoading:b.isLoading,O=u?S.isFetching:b.isFetching,k=(u?S.error:b.error)??null,A=!!k,j=(0,d.useCallback)(()=>{if(u){S.fetchNextPage({cancelRefetch:!1});return}a(e=>Math.max(0,e+1))},[S,u]),M=(0,d.useCallback)(()=>{u||a(e=>Math.max(0,e-1))},[u]),N=Ft(o.current,s.current);return{data:C,count:w,error:k,isLoading:D,isFetching:O,isError:A,page:T,pageCount:It(w,N,s.current),fetchPage:E,fetchNext:j,fetchPrevious:M,hasNextPage:u?!!S.hasNextPage:Lt(w,N,T,s.current),hasPreviousPage:u?!!S.hasPreviousPage:Rt(T,s.current,N),revalidate:async()=>
16{await m.invalidateQueries({queryKey:r.invalidationKey});let[e,...t]=r.invalidationKey;return m.invalidateQueries({queryKey:[e+`-inf`,...t]})},setData:e=>u?(m.setQueryData(x,(t={})=>{let n=Array.isArray(t?.pages)?t.pages:[],r=typeof e==`function`?e(n):e;return{...t,pages:r}}),v(e=>e+1),Promise.resolve()):(m.setQueryData(y,(t={data:[],total_count:0})=>typeof e==`function`?e(t):e),v(e=>e+1),Promise.resolve())}};function Bt(){let e=ut(),t=mt(),n=(0,d.useCallback)(()=>t?.user,[t?.user]);return(0,d.useSyncExternalStore)((0,d.useCallback)(t=>e.addListener(t,{skipInitialEmit:!0}),[e]),(0,d.useCallback)(()=>!e.loaded||!e.__internal_lastEmittedResources?n():e.__internal_lastEmittedResources.user,[e,n]),n)}function Vt(){let e=ut(),t=mt(),n=(0,d.useCallback)(()=>t?.organization,[t?.organization]);return(0,d.useSyncExternalStore)((0,d.useCallback)(t=>e.addListener(t,{skipInitialEmit:!0}),[e]),(0,d.useCallback)(()=>!e.loaded||!e.__internal_lastEmittedResources?n():e.__internal_lastEmittedResources.organization,[e,n]),n)}typeof window<`u`?d.useLayoutEffect:d.useEffect;var Ht=`useUser`;function Ut(){vt(Ht);let e=Bt();return ut().telemetry?.record(D(Ht)),e===void 0?{isLoaded:!1,isSignedIn:void 0,user:void 0}:e===null?{isLoaded:!0,isSignedIn:!1,user:null}:{isLoaded:!0,isSignedIn:!0,user:e}}var Wt=ot;function Gt(e){let t=ut(),n=e?.enabled??!0,r=t.__internal_environment,i=Bt(),a=Vt(),o=r?.commerceSettings.billing.user.enabled,s=r?.commerceSettings.billing.organization.enabled,c=e?.for===`organization`?s:e?.for===`user`?o:o||s,l=e?.for===`organization`,u=e?.authenticated??!0?(l?!!a?.id:!0)&&!!i?.id:!0;return c&&n&&t.loaded&&u}function Kt({hookName:e,resourceType:t,useFetcher:n,options:r}){return function(i){let{for:a,enabled:o,...s}=i||{},c=a||`user`;vt(e);let l=n(c),u=Pt(s,{initialPage:1,pageSize:10,keepPreviousData:!1,infinite:!1,__experimental_mode:void 0}),d=ut(),f=Bt(),p=Vt();d.telemetry?.record(D(e));let m=c===`organization`,h=Gt({for:c,enabled:o,authenticated:!r?.unauthenticated}),g=s===void 0?void 0:{initialPage:u.initialPage,pageSize:u.pageSize,...r?.unauthenticated?{}:m?{orgId:p?.id}:{}},_=!!g&&d.loaded&&!!h;return zt({fetcher:l,config:{keepPreviousData:u.keepPreviousData,infinite:u.infinite,enabled:_,...r?.unauthenticated?{}:{isSignedIn:f!==null},__experimental_mode:u.__experimental_mode,initialPage:u.initialPage,pageSize:u.pageSize},keys:bt({stablePrefix:t,authenticated:!r?.unauthenticated,tracked:r?.unauthenticated?{for:c}:{userId:f?.id,...m?{orgId:p?.id}:{}},untracked:{args:g}})})}}Kt({hookName:`useStatements`,resourceType:yt.STATEMENTS_KEY,useFetcher:()=>{let e=ut();if(e.loaded)return e.billing.getStatements}}),Kt({hookName:`usePaymentAttempts`,resourceType:yt.PAYMENT_ATTEMPTS_KEY,useFetcher:()=>{let e=ut();if(e.loaded)return e.billing.getPaymentAttempts}}),Kt({hookName:`usePaymentMethods`,resourceType:yt.PAYMENT_METHODS_KEY,useFetcher:e=>{let t=Vt(),n=Bt();return e===`organization`?t?.getPaymentMethods:n?.getPaymentMethods}}),Kt({hookName:`usePlans`,resourceType:yt.PLANS_KEY,useFetcher:e=>{let t=ut();if(t.loaded)return n=>t.billing.getPlans({...n,for:e})},options:{unauthenticated:!0}});function qt(e){e||k()}function Jt(e){let t=e.clerk;if(qt(t),e.initialState instanceof Promise&&!(`use`in d.default&&typeof d.use==`function`))throw Error(`initialState cannot be a promise if React version is less than 19`);let n=d.useMemo(()=>({value:t}),[e.clerkStatus]);return d.createElement(pt,{initialState:e.initialState},d.createElement(lt.Provider,{value:n},d.createElement(_t,{value:void 0},e.children)))}var Yt=e=>{let t=(0,d.useRef)(e);return(0,d.useEffect)(()=>{t.current=e},[e]),t.current},Xt=(e,t,n)=>{let r=!!n,i=(0,d.useRef)(n);(0,d.useEffect)(()=>{i.current=n},[n]),(0,d.useEffect)(()=>{if(!r||!e)return()=>{};let n=(...e)=>{i.current&&i.current(...e)};return e.on(t,n),()=>{e.off(t,n)}},[r,t,e,i])},Zt=d.createContext(null);Zt.displayName=`ElementsContext`;var Qt=(e,t)=>{if(!e)throw Error(`Could not find Elements context; You need to wrap the part of your app that ${t} in an <Elements> provider.`);return e},$t=e=>typeof e==`object`&&!!e,en=(e,t,n)=>$t(e)?Object.keys(e).reduce((r,i)=>{let a=!$t(t)||!nn(e[i],t[i]);return n.includes(i)?(a&&console.warn(`Unsupported prop change: options.${i} is not a mutable property.`),r):a?{...r||{},[i]:e[i]}:r},null):null,tn=`[object Object]`,nn=(e,t)=>{if(!$t(e)||!$t(t))return e===t;let n=Array.isArray(e);if(n!==Array.isArray(t))return!1;let r=Object.prototype.toString.call(e)===tn;if(r!==(Object.prototype.toString.call(t)===tn))return!1;if(!r&&!n)return e===t;let i=Object.keys(e),a=Object.keys(t);if(i.length!==a.length)return!1;let o={};for(let e=0;e<i.length;e+=1)o[i[e]]=!0;for(let e=0;e<a.length;e+=1)o[a[e]]=!0;let s=Object.keys(o);if(s.length!==i.length)return!1;let c=e,l=t;return s.every(e=>nn(c[e],l[e]))},rn=e=>Qt(d.useContext(Zt),e),an=e=>e.charAt(0).toUpperCase()+e.slice(1);((e,t)=>
16{let n=`${an(e)}Element`,r=t?e=>{rn(`mounts <${n}>`);let{id:t,className:r}=e;return d.createElement(`div`,{id:t,className:r})}:({id:t,className:r,fallback:i,options:a={},onBlur:o,onFocus:s,onReady:c,onChange:l,onEscape:u,onClick:f,onLoadError:p,onLoaderStart:m,onNetworksChange:h,onConfirm:g,onCancel:_,onShippingAddressChange:v,onShippingRateChange:y})=>{let b=rn(`mounts <${n}>`),x=`elements`in b?b.elements:null,[S,C]=d.useState(null),w=d.useRef(null),T=d.useRef(null),[E,D]=(0,d.useState)(!1);Xt(S,`blur`,o),Xt(S,`focus`,s),Xt(S,`escape`,u),Xt(S,`click`,f),Xt(S,`loaderror`,p),Xt(S,`loaderstart`,m),Xt(S,`networkschange`,h),Xt(S,`confirm`,g),Xt(S,`cancel`,_),Xt(S,`shippingaddresschange`,v),Xt(S,`shippingratechange`,y),Xt(S,`change`,l);let O;c&&(O=()=>{D(!0),c(S)}),Xt(S,`ready`,O),d.useLayoutEffect(()=>{if(w.current===null&&T.current!==null&&x){let t=null;x&&(t=x.create(e,a)),w.current=t,C(t),t&&t.mount(T.current)}},[x,a]);let k=Yt(a);return d.useEffect(()=>{if(!w.current)return;let e=en(a,k,[`paymentRequest`]);e&&`update`in w.current&&w.current.update(e)},[a,k]),d.useLayoutEffect(()=>()=>{if(w.current&&typeof w.current.destroy==`function`)try{w.current.destroy(),w.current=null}catch{}},[]),d.createElement(d.Fragment,null,!E&&i,d.createElement(`div`,{id:t,style:{height:E?`unset`:`0px`,visibility:E?`visible`:`hidden`},className:r,ref:T}))};return r.displayName=n,r.__elementType=e,r})(`payment`,typeof window>`u`);var[on,sn]=ct(`PaymentElementContext`),[cn,ln]=ct(`StripeUtilsContext`),[un,,dn]=ct(`PortalProvider`),fn=({children:e,getContainer:t})=>{let n=d.useMemo(()=>({value:{getContainer:t}}),[t]);return d.createElement(un.Provider,{value:n},e)};fn.displayName=`UNSAFE_PortalProvider`;var pn=()=>{let e=dn();return e&&`getContainer`in e&&e.getContainer?e.getContainer:()=>null},mn=g({packageName:`@clerk/react`});function hn(e){mn.setMessages(e).setPackageName(e)}var gn=ut,_n=e=>{vt(()=>{mn.throwMissingClerkProviderError({source:e})})},vn=()=>{try{return!1}catch{}return!1},yn=()=>{try{return!1}catch{}return!1},bn=()=>{try{return!0}catch{}return!1};function xn(e,t,n){if(typeof e==`function`)return e(t);if(e!==void 0)return e;if(n!==void 0)return n}var Sn=e=>{vn()&&console.error(`Clerk: ${e}`)},Cn=e=>!!e?.cloudflare?.env,wn=e=>!!e?.env,Tn=(e,t)=>{if(typeof process<`u`&&typeof{}[e]==`string`)return{}[e];if(typeof{BASE_URL:`/`,DEV:!1,MODE:`production`,PROD:!0,SSR:!1,VITE_API_URL:`https://interview-pro-4br8.vercel.app/api`,VITE_CLERK_PUBLISHABLE_KEY:`pk_test_ZW1lcmdpbmctY295b3RlLTU0LmNsZXJrLmFjY291bnRzLmRldiQ`,VITE_STREAM_API_KEY:`a26s76cq57aj`,VITE_VERCEL_BRANCH_URL:`interview-pro-git-main-divyansh369s-projects.vercel.app`,VITE_VERCEL_DEPLOYMENT_ID:`dpl_9xEghSPi6AxYf5Pz7RFt56u4UHoW`,VITE_VERCEL_ENV:`production`,VITE_VERCEL_GIT_COMMIT_AUTHOR_LOGIN:`divyansh369`,VITE_VERCEL_GIT_COMMIT_AUTHOR_NAME:`Divyansh Srivastava`,VITE_VERCEL_GIT_COMMIT_MESSAGE:`(SYSTEM DESIGN): Apply the Sliding window rate limiter`,VITE_VERCEL_GIT_COMMIT_REF:`main`,VITE_VERCEL_GIT_COMMIT_SHA:`222d0ce1b2a41215d95161e8bc302b4075888b53`,VITE_VERCEL_GIT_PREVIOUS_SHA:``,VITE_VERCEL_GIT_PROVIDER:`github`,VITE_VERCEL_GIT_PULL_REQUEST_ID:``,VITE_VERCEL_GIT_REPO_ID:`1234103413`,VITE_VERCEL_GIT_REPO_OWNER:`divyansh369`,VITE_VERCEL_GIT_REPO_SLUG:`InterviewPro`,VITE_VERCEL_OBSERVABILITY_CLIENT_CONFIG:`{"analytics":{"scriptSrc":"d0a52cb02cf755d0/script.
16js","viewEndpoint":"d0a52cb02cf755d0/view","eventEndpoint":"d0a52cb02cf755d0/event","sessionEndpoint":"d0a52cb02cf755d0/session"},"speedInsights":{"scriptSrc":"1916915bb4d33b41/script.js","endpoint":"1916915bb4d33b41/vitals"}}`,VITE_VERCEL_PROJECT_ID:`prj_voyhvLs7M11Ni7O8XGip51tXJiFX`,VITE_VERCEL_PROJECT_PRODUCTION_URL:`interview-pro-six.vercel.app`,VITE_VERCEL_TARGET_ENV:`production`,VITE_VERCEL_URL:`interview-c9nuoxyev-divyansh369s-projects.vercel.app`}[e]==`string`)return{BASE_URL:`/`,DEV:!1,MODE:`production`,PROD:!0,SSR:!1,VITE_API_URL:`https://interview-pro-4br8.vercel.app/api`,VITE_CLERK_PUBLISHABLE_KEY:`pk_test_ZW1lcmdpbmctY295b3RlLTU0LmNsZXJrLmFjY291bnRzLmRldiQ`,VITE_STREAM_API_KEY:`a26s76cq57aj`,VITE_VERCEL_BRANCH_URL:`interview-pro-git-main-divyansh369s-projects.vercel.app`,VITE_VERCEL_DEPLOYMENT_ID:`dpl_9xEghSPi6AxYf5Pz7RFt56u4UHoW`,VITE_VERCEL_ENV:`production`,VITE_VERCEL_GIT_COMMIT_AUTHOR_LOGIN:`divyansh369`,VITE_VERCEL_GIT_COMMIT_AUTHOR_NAME:`Divyansh Srivastava`,VITE_VERCEL_GIT_COMMIT_MESSAGE:`(SYSTEM DESIGN): Apply the Sliding window rate limiter`,VITE_VERCEL_GIT_COMMIT_REF:`main`,VITE_VERCEL_GIT_COMMIT_SHA:`222d0ce1b2a41215d95161e8bc302b4075888b53`,VITE_VERCEL_GIT_PREVIOUS_SHA:``,VITE_VERCEL_GIT_PROVIDER:`github`,VITE_VERCEL_GIT_PULL_REQUEST_ID:``,VITE_VERCEL_GIT_REPO_ID:`1234103413`,VITE_VERCEL_GIT_REPO_OWNER:`divyansh369`,VITE_VERCEL_GIT_REPO_SLUG:`InterviewPro`,VITE_VERCEL_OBSERVABILITY_CLIENT_CONFIG:`{"analytics":{"scriptSrc":"d0a52cb02cf755d0/script.
16js","viewEndpoint":"d0a52cb02cf755d0/view","eventEndpoint":"d0a52cb02cf755d0/event","sessionEndpoint":"d0a52cb02cf755d0/session"},"speedInsights":{"scriptSrc":"1916915bb4d33b41/script.js","endpoint":"1916915bb4d33b41/vitals"}}`,VITE_VERCEL_PROJECT_ID:`prj_voyhvLs7M11Ni7O8XGip51tXJiFX`,VITE_VERCEL_PROJECT_PRODUCTION_URL:`interview-pro-six.vercel.app`,VITE_VERCEL_TARGET_ENV:`production`,VITE_VERCEL_URL:`interview-c9nuoxyev-divyansh369s-projects.vercel.app`}[e];if(Cn(t))return t.cloudflare.env[e]||``;if(wn(t))return t.env[e]||``;if(t&&typeof t[e]==`string`)return t[e];try{return globalThis[e]}catch{}return``},En=(e,...t)=>{let n={...e};for(let e of t)delete n[e];return n},Dn=r(c(),1);function On(){return typeof window<`u`}new RegExp(`bot.spider.crawl.APIs-Google.AdsBot.Googlebot.mediapartners.Google Favicon.FeedFetcher.Google-Read-Aloud.DuplexWeb-Google.googleweblight.bing.yandex.baidu.duckduck.yahoo.ecosia.ia_archiver.facebook.instagram.pinterest.reddit.slack.twitter.whatsapp.youtube.semrush`.split(`.`).join(`|`),`i`);var kn=`You've added multiple <ClerkProvider> components in your React component tree. Wrap your components in a single <ClerkProvider>.`,An=e=>`You've passed multiple children components to <${e}/>. You can only pass a single child component or text.`,jn=`Unsupported usage of isSatellite, domain or proxyUrl. The usage of isSatellite, domain or proxyUrl as function is not supported in non-browser environments.`,Mn="<UserProfile.Page /> component needs to be a direct child of `<UserProfile />` or `<UserButton />`.",Nn="<UserProfile.Link /> component needs to be a direct child of `<UserProfile />` or `<UserButton />`.",Pn="<OrganizationProfile.Page /> component needs to be a direct child of `<OrganizationProfile />` or `<OrganizationSwitcher />`.",Fn="<OrganizationProfile.Link /> component needs to be a direct child of `<OrganizationProfile />` or `<OrganizationSwitcher />`.",In=e=>`<${e} /> can only accept <${e}.Page /> and <${e}.Link /> as its children. Any other provided component will be ignored. Additionally, please ensure that the component is rendered in a client component.`,Ln=e=>`Missing props. <${e}.Page /> component requires the following props: url, label, labelIcon, alongside with children to be rendered inside the page.`,Rn=e=>`Missing props. <${e}.Link /> component requires the following props: url, label and labelIcon.`,zn=`<UserButton /> can only accept <UserButton.UserProfilePage />, <UserButton.UserProfileLink /> and <UserButton.MenuItems /> as its children. Any other provided component will be ignored. Additionally, please ensure that the component is rendered in a client component.`,Bn=`<UserButton.MenuItems /> component can only accept <UserButton.Action /> and <UserButton.Link /> as its children. Any other provided component will be ignored. Additionally, please ensure that the component is rendered in a client component.`,Vn="<UserButton.MenuItems /> component needs to be a direct child of `<UserButton />`.",Hn="<UserButton.Action /> component needs to be a direct child of `<UserButton.MenuItems />`.",Un="<UserButton.Link /> component needs to be a direct child of `<UserButton.MenuItems />`.",Wn=`Missing props. <UserButton.Link /> component requires the following props: href, label and labelIcon.`,Gn=`Missing props. <UserButton.Action /> component requires the following props: label.`,Kn=e=>t=>{try{return d.Children.only(e)}catch{return mn.throw(An(t))}},qn=(e,t)=>(e||=t,typeof e==`string`&&(e=d.createElement(`button`,null,e)),e),Jn=e=>(...t)=>{if(e&&typeof e==`function`)return e(...t)},Yn=e=>Tn(`VITE_${e}`)||Tn(e),Xn=(e,t)=>e===void 0?Yn(t)||void 0:e,Zn=e=>{let t=Xn(e.publishableKey,`CLERK_PUBLISHABLE_KEY`);return{...e,...t!==void 0&&{publishableKey:t}}};function Qn(e){return typeof e==`function`}var $n=new Map;function er(e,t,n=1){d.useEffect(()=>{let r=$n.get(e)||0;return r==n?mn.throw(t):($n.set(e,r+1),()=>{$n.set(e,($n.get(e)||1)-1)})},[])}function tr(e,t,n){let r=e.displayName||e.name||t||`Component`,i=r=>(er(t,n),d.createElement(e,{...r}));return i.displayName=`withMaxAllowedInstancesGuard(${r})`,i}var nr=e=>{let[t,n]=(0,d.useState)(new Map);return e.map(e=>({id:e.id,mount:t=>n(n=>new Map(n).set(String(e.id),t)),unmount:()=>n(t=>{let n=new Map(t);return n.set(String(e.id),null),n}),portal:()=>{let n=t.get(String(e.id));return n?(0,Dn.createPortal)(e.component,n):null}}))},rr=(e,t)=>!!e&&d.isValidElement(e)&&e?.type===t,ir=(e,t)=>
16sr({children:e,reorderItemsLabels:[`account`,`security`,`billing`,`apiKeys`],LinkComponent:Tr,PageComponent:wr,MenuItemsComponent:kr,componentName:`UserProfile`},t),ar=(e,t)=>sr({children:e,reorderItemsLabels:[`general`,`members`,`billing`,`apiKeys`],LinkComponent:Fr,PageComponent:Pr,componentName:`OrganizationProfile`},t),or=e=>{let t=[],n=[Fr,Pr,kr,wr,Tr];return d.Children.forEach(e,e=>{n.some(t=>rr(e,t))||t.push(e)}),t},sr=(e,t)=>{let{children:n,LinkComponent:r,PageComponent:i,MenuItemsComponent:a,reorderItemsLabels:o,componentName:s}=e,{allowForAnyChildren:c=!1}=t||{},l=[];d.Children.forEach(n,e=>{if(!rr(e,i)&&!rr(e,r)&&!rr(e,a)){e&&!c&&Sn(In(s));return}let{props:t}=e,{children:n,label:u,url:d,labelIcon:f}=t;if(rr(e,i))if(cr(t,o))l.push({label:u});else if(lr(t))l.push({label:u,labelIcon:f,children:n,url:d});else{Sn(Ln(s));return}if(rr(e,r))if(ur(t))l.push({label:u,labelIcon:f,url:d});else{Sn(Rn(s));return}});let u=[],f=[],p=[];l.forEach((e,t)=>{if(lr(e)){u.push({component:e.children,id:t}),f.push({component:e.labelIcon,id:t});return}ur(e)&&p.push({component:e.labelIcon,id:t})});let m=nr(u),h=nr(f),g=nr(p),_=[],v=[];return l.forEach((e,t)=>{if(cr(e,o)){_.push({label:e.label});return}if(lr(e)){let{portal:n,mount:r,unmount:i}=m.find(e=>e.id===t),{portal:a,mount:o,unmount:s}=h.find(e=>e.id===t);_.push({label:e.label,url:e.url,mount:r,unmount:i,mountIcon:o,unmountIcon:s}),v.push(n),v.push(a);return}if(ur(e)){let{portal:n,mount:r,unmount:i}=g.find(e=>e.id===t);_.push({label:e.label,url:e.url,mountIcon:r,unmountIcon:i}),v.push(n);return}}),{customPages:_,customPagesPortals:v}},cr=(e,t)=>{let{children:n,label:r,url:i,labelIcon:a}=e;return!n&&!i&&!a&&t.some(e=>e===r)},lr=e=>{let{children:t,label:n,url:r,labelIcon:i}=e;return!!t&&!!r&&!!i&&!!n},ur=e=>{let{children:t,label:n,url:r,labelIcon:i}=e;return!t&&!!r&&!!i&&!!n},dr=(e,t)=>fr({children:e,reorderItemsLabels:[`manageAccount`,`signOut`],MenuItemsComponent:kr,MenuActionComponent:Ar,MenuLinkComponent:jr,UserProfileLinkComponent:Tr,UserProfilePageComponent:wr,allowForAnyChildren:t?.allowForAnyChildren??!1}),fr=({children:e,MenuItemsComponent:t,MenuActionComponent:n,MenuLinkComponent:r,UserProfileLinkComponent:i,UserProfilePageComponent:a,reorderItemsLabels:o,allowForAnyChildren:s=!1})=>{let c=[],l=[],u=[];d.Children.forEach(e,e=>{if(!rr(e,t)&&!rr(e,i)&&!rr(e,a)){e&&!s&&Sn(zn);return}if(rr(e,i)||rr(e,a))return;let{props:l}=e;d.Children.forEach(l.children,e=>{if(!rr(e,n)&&!rr(e,r)){e&&Sn(Bn);return}let{props:t}=e,{label:i,labelIcon:a,href:s,onClick:l,open:u}=t;if(rr(e,n))if(pr(t,o))c.push({label:i});else if(mr(t)){let e={label:i,labelIcon:a};if(l!==void 0)c.push({...e,onClick:l});else if(u!==void 0)c.push({...e,open:u.startsWith(`/`)?u:`/${u}`});else{Sn(`Custom menu item must have either onClick or open property`);return}}else{Sn(Gn);return}if(rr(e,r))if(hr(t))c.push({label:i,labelIcon:a,href:s});else{Sn(Wn);return}})});let f=[],p=[];c.forEach((e,t)=>{mr(e)&&f.push({component:e.labelIcon,id:t}),hr(e)&&p.push({component:e.labelIcon,id:t})});let m=nr(f),h=nr(p);return c.forEach((e,t)=>{if(pr(e,o)&&l.push({label:e.label}),mr(e)){let{portal:n,mount:r,unmount:i}=m.find(e=>e.id===t),a={label:e.label,mountIcon:r,unmountIcon:i};`onClick`in e?a.onClick=e.onClick:`open`in e&&(a.open=e.open),l.push(a),u.push(n)}if(hr(e)){let{portal:n,mount:r,unmount:i}=h.find(e=>e.id===t);l.push({label:e.label,href:e.href,mountIcon:r,unmountIcon:i}),u.push(n)}}),{customMenuItems:l,customMenuItemsPortals:u}},pr=(e,t)=>{let{children:n,label:r,onClick:i,labelIcon:a}=e;return!n&&!i&&!a&&t.some(e=>e===r)},mr=e=>{let{label:t,labelIcon:n,onClick:r,open:i}=e;return!!n&&!!t&&(typeof r==`function`||typeof i==`string`)},hr=e=>{let{label:t,href:n,labelIcon:r}=e;return!!n&&!!r&&!!t},gr=(e=>{let t=e?.isReady;return n=>new Promise((r,i)=>{let{root:a=document==null?void 0:document.body,selector:o,timeout:s=0}=n;if(!a){i(Error(`No root element provided`));return}let c=a;if(o&&(c=a?.querySelector(o)),t(c,o)){r();return}let l=new MutationObserver(n=>{for(let i of n)if(!c&&o&&(c=a?.querySelector(o)),(e.childList&&i.type===`childList`||e.attributes&&i.type===`attributes`)&&t(c,o)){l.disconnect(),r();return}});l.observe(a,e),s>0&&setTimeout(()=>{l.disconnect(),i(Error(`Timeout waiting for ${o}`))},s)})})({childList:!0,subtree:!0,isReady:(e,t)=>!!e?.childElementCount&&(e?.matches)?.call(e,t)&&e.childElementCount>0});function _r(e,t){let n=(0,d.useRef)(),[r,i]=(0,d.useState)(`rendering`);return(0,d.useEffect)(()=>
16{if(!e)throw Error(`Clerk: no component name provided, unable to detect mount.`);if(typeof window<`u`&&!n.current){let r=`[data-clerk-component="${e}"]`,a=t?.selector;n.current=gr({selector:a?r+a:r}).then(()=>{i(`rendered`)}).catch(()=>{i(`error`)})}},[e,t?.selector]),r}var vr=e=>`mount`in e,yr=e=>`open`in e,br=e=>e?.map(({mountIcon:e,unmountIcon:t,...n})=>n),xr=class extends d.PureComponent{constructor(){super(...arguments),this.rootRef=d.createRef()}componentDidUpdate(e){if(!vr(e)||!vr(this.props))return;let t=En(e.props,`customPages`,`customMenuItems`,`children`),n=En(this.props.props,`customPages`,`customMenuItems`,`children`),r=t.customPages?.length!==n.customPages?.length,i=t.customMenuItems?.length!==n.customMenuItems?.length,a=br(e.props.customMenuItems),o=br(this.props.props.customMenuItems);(!Wt(t,n)||!Wt(a,o)||r||i)&&this.rootRef.current&&this.props.updateProps({node:this.rootRef.current,props:this.props.props})}componentDidMount(){this.rootRef.current&&(vr(this.props)&&this.props.mount(this.rootRef.current,this.props.props),yr(this.props)&&this.props.open(this.props.props))}componentWillUnmount(){this.rootRef.current&&(vr(this.props)&&this.props.unmount(this.rootRef.current),yr(this.props)&&this.props.close())}render(){let{hideRootHtmlElement:e=!1}=this.props,t={ref:this.rootRef,...this.props.rootProps,...this.props.component&&{"data-clerk-component":this.props.component}};return d.createElement(d.Fragment,null,!e&&d.createElement(`div`,{...t}),this.props.children)}},Sr=(e,t)=>{let n=(typeof t==`string`?t:t?.component)||e.displayName||e.name||`Component`;e.displayName=n;let r=typeof t==`string`?void 0:t,i=t=>{_n(n||`withClerk`);let i=gn(),a=pn();return!i.loaded&&!r?.renderWhileLoading?null:d.createElement(e,{getContainer:a,...t,component:n,clerk:i})};return i.displayName=`withClerk(${n})`,i},Cr=e=>d.createElement(d.Fragment,null,(e?.customPagesPortals)?.map((e,t)=>(0,d.createElement)(e,{key:t})),(e?.customMenuItemsPortals)?.map((e,t)=>(0,d.createElement)(e,{key:t}
16)));Sr(({clerk:e,component:t,fallback:n,...r})=>{let i=_r(t)===`rendering`||!e.loaded,a={...i&&n&&{style:{display:`none`}}};return d.createElement(d.Fragment,null,i&&n,e.loaded&&d.createElement(xr,{component:t,mount:e.mountSignIn,unmount:e.unmountSignIn,updateProps:e.__internal_updateProps,props:r,rootProps:a}))},{component:`SignIn`,renderWhileLoading:!0}),Sr(({clerk:e,component:t,fallback:n,...r})=>{let i=_r(t)===`rendering`||!e.loaded,a={...i&&n&&{style:{display:`none`}}};return d.createElement(d.Fragment,null,i&&n,e.loaded&&d.createElement(xr,{component:t,mount:e.mountSignUp,unmount:e.unmountSignUp,updateProps:e.__internal_updateProps,props:r,rootProps:a}))},{component:`SignUp`,renderWhileLoading:!0});function wr({children:e}){return Sn(Mn),d.createElement(d.Fragment,null,e)}function Tr({children:e}){return Sn(Nn),d.createElement(d.Fragment,null,e)}var Er=Sr(({clerk:e,component:t,fallback:n,...r})=>{let i=_r(t)===`rendering`||!e.loaded,a={...i&&n&&{style:{display:`none`}}},{customPages:o,customPagesPortals:s}=ir(r.children);return d.createElement(d.Fragment,null,i&&n,d.createElement(xr,{component:t,mount:e.mountUserProfile,unmount:e.unmountUserProfile,updateProps:e.__internal_updateProps,props:{...r,customPages:o},rootProps:a},d.createElement(Cr,{customPagesPortals:s})))},{component:`UserProfile`,renderWhileLoading:!0});Object.assign(Er,{Page:wr,Link:Tr});var Dr=(0,d.createContext)({mount:()=>{},unmount:()=>{},updateProps:()=>{}}),Or=Sr(({clerk:e,component:t,fallback:n,...r})=>{let i=_r(t)===`rendering`||!e.loaded,a={...i&&n&&{style:{display:`none`}}},{customPages:o,customPagesPortals:s}=ir(r.children,{allowForAnyChildren:!!r.__experimental_asProvider}),c={...r.userProfileProps,customPages:o},{customMenuItems:l,customMenuItemsPortals:u}=dr(r.children,{allowForAnyChildren:!!r.__experimental_asProvider}),f=or(r.children),p={mount:e.mountUserButton,unmount:e.unmountUserButton,updateProps:e.__internal_updateProps,props:{...r,userProfileProps:c,customMenuItems:l}},m={customPagesPortals:s,customMenuItemsPortals:u};return d.createElement(Dr.Provider,{value:p},i&&n,e.loaded&&d.createElement(xr,{component:t,...p,hideRootHtmlElement:!!r.__experimental_asProvider,rootProps:a},r.__experimental_asProvider?f:null,d.createElement(Cr,{...m})))},{component:`UserButton`,renderWhileLoading:!0});function kr({children:e}){return Sn(Vn),d.createElement(d.Fragment,null,e)}function Ar({children:e}){return Sn(Hn),d.createElement(d.Fragment,null,e)}function jr({children:e}){return Sn(Un),d.createElement(d.Fragment,null,e)}function Mr(e){let t=(0,d.useContext)(Dr),n={...t,props:{...t.props,...e}};return d.createElement(xr,{...n})}var Nr=Object.assign(Or,{UserProfilePage:wr,UserProfileLink:Tr,MenuItems:kr,Action:Ar,Link:jr,__experimental_Outlet:Mr});function Pr({children:e}){return Sn(Pn),d.createElement(d.Fragment,null,e)}function Fr({children:e}){return Sn(Fn),d.createElement(d.Fragment,null,e)}var Ir=Sr(({clerk:e,component:t,fallback:n,...r})=>{let i=_r(t)===`rendering`||!e.loaded,a={...i&&n&&{style:{display:`none`}}},{customPages:o,customPagesPortals:s}=ar(r.children);return d.createElement(d.Fragment,null,i&&n,e.loaded&&d.createElement(xr,{component:t,mount:e.mountOrganizationProfile,unmount:e.unmountOrganizationProfile,updateProps:e.__internal_updateProps,props:{...r,customPages:o},rootProps:a},d.createElement(Cr,{customPagesPortals:s})))},{component:`OrganizationProfile`,renderWhileLoading:!0});Object.assign(Ir,{Page:Pr,Link:Fr}),Sr(({clerk:e,component:t,fallback:n,...r})=>{let i=_r(t)===`rendering`||!e.loaded,a={...i&&n&&{style:{display:`none`}}};return d.createElement(d.Fragment,null,i&&n,e.loaded&&d.createElement(xr,{component:t,mount:e.mountCreateOrganization,unmount:e.unmountCreateOrganization,updateProps:e.__internal_updateProps,props:r,rootProps:a}))},{component:`CreateOrganization`,renderWhileLoading:!0});var Lr=(0,d.createContext)({mount:()=>{},unmount:()=>{},updateProps:()=>{}}),Rr=Sr(({clerk:e,component:t,fallback:n,...r})=>{let i=_r(t)===`rendering`||!e.loaded,a={...i&&n&&{style:{display:`none`}}},{customPages:o,customPagesPortals:s}=ar(r.children,{allowForAnyChildren:!!r.__experimental_asProvider}),c={...r.organizationProfileProps,customPages:o},l=or(r.children),u={mount:e.mountOrganizationSwitcher,unmount:e.unmountOrganizationSwitcher,updateProps:e.__internal_updateProps,props:{...r,organizationProfileProps:c},rootProps:a,component:t};return e.__experimental_prefetchOrganizationSwitcher(),d.createElement(Lr.Provider,{value:u},d.createElement(d.Fragment,null,i&&n,e.loaded&&d.createElement(xr,{...u,hideRootHtmlElement:!!r.__experimental_asProvider},r.__experimental_asProvider?l:null,d.createElement(Cr,{customPagesPortals:s}))))},{component:`OrganizationSwitcher`,renderWhileLoading:!0});function zr(e){let t=(0,d.useContext)(Lr),n={...t,props:{...t.props,...e}};return d.createElement(xr,{...n})}Object.assign(Rr,{OrganizationProfilePage:Pr,OrganizationProfileLink:Fr,__experimental_Outlet:zr}),Sr(({clerk:e,component:t,fallback:n,...r})=>{let i=_r(t)===`rendering`||!e.loaded,a={...i&&n&&{style:{display:`none`}}};return d.createElement(d.Fragment,null,i&&n,e.loaded&&d.createElement(xr,{component:t,mount:e.mountOrganizationList,unmount:e.unmountOrganizationList,updateProps:e.__internal_updateProps,props:r,rootProps:a}))},{component:`OrganizationList`,renderWhileLoading:!0}),Sr(({clerk:e,component:t,fallback:n,...r})=>{let i=_r(t)===`rendering`||!e.loaded,a={...i&&n&&{style:{display:`none`}}};return d.createElement(d.Fragment,null,i&&n,e.loaded&&d.createElement(xr,{component:t,open:e.openGoogleOneTap,close:e.closeGoogleOneTap,updateProps:e.__internal_updateProps,props:r,rootProps:a}))},{component:`GoogleOneTap`,renderWhileLoading:!0}),Sr(({clerk:e,component:t,fallback:n,...r})=>{let i=_r(t)===`rendering`||!e.loaded,a={...i&&n&&{style:{display:`none`}}};return d.createElement(d.Fragment,null,i&&n,e.loaded&&d.createElement(xr,{component:t,mount:e.mountWaitlist,unmount:e.unmountWaitlist,updateProps:e.__internal_updateProps,props:r,rootProps:a}))},{component:`Waitlist`,renderWhileLoading:!0}),Sr(({clerk:e,component:t,fallback:n,...r})=>{let i=_r(t,{selector:`[data-component-status="ready"]`})===`rendering`||!e.loaded,a={...i&&n&&{style:{display:`none`}}};return d.createElement(d.Fragment,null,i&&n,e.loaded&&d.createElement(xr,{component:t,mount:e.mountPricingTable,unmount:e.unmountPricingTable,updateProps:e.__internal_updateProps,props:r,rootProps:a}))},{component:`PricingTable`,renderWhileLoading:!0}),Sr(({clerk:e,component:t,fallback:n,...r})=>{let i=_r(t)===`rendering`||!e.loaded,a={...i&&n&&{style:{display:`none`}}};return d.createElement(d.Fragment,null,i&&n,e.loaded&&d.createElement(xr,{component:t,mount:e.mountAPIKeys,unmount:e.unmountAPIKeys,updateProps:e.__internal_updateProps,props:r,rootProps:a}))},{component:`ApiKeys`,renderWhileLoading:!0}),Sr(({clerk:e,component:t,fallback:n,...r})=>{let i=_r(t)===`rendering`||!e.loaded,a={...i&&n&&{style:{display:`none`}}};return d.createElement(d.Fragment,null,i&&n,e.loaded&&d.createElement(xr,{component:t,mount:e.__experimental_mountConfigureSSO,unmount:e.__experimental_unmountConfigureSSO,updateProps:e.__internal_updateProps,props:r,rootProps:a}))},{component:`ConfigureSSO`,renderWhileLoading:!0}),Sr(({clerk:e,component:t,fallback:n,...r})=>{let i=_r(t)===`rendering`||!e.loaded,a={...i&&n&&{style:{display:`none`}}};return d.createElement(d.Fragment,null,i&&n,e.loaded&&d.createElement(xr,{component:t,mount:e.__internal_mountOAuthConsent,unmount:e.__internal_unmountOAuthConsent,updateProps:e.__internal_updateProps,props:r,rootProps:a}))},{component:`OAuthConsent`,renderWhileLoading:!0}),Sr(({clerk:e,component:t,fallback:n,...r})=>{let i=_r(t)===`rendering`||!e.loaded,a={...i&&n&&{style:{display:`none`}}};return d.createElement(d.Fragment,null,i&&n,e.loaded&&d.createElement(xr,{component:t,mount:e.mountUserAvatar,unmount:e.unmountUserAvatar,updateProps:e.__internal_updateProps,props:r,rootProps:a}))},{component:`UserAvatar`,renderWhileLoading:!0}),Sr(({clerk:e,component:t,fallback:n,...r})=>{let i=_r(t)===`rendering`||!e.loaded,a={...i&&n&&{style:{display:`none`}}};return d.createElement(d.Fragment,null,i&&n,e.loaded&&d.createElement(xr,{component:t,mount:e.mountTaskChooseOrganization,unmount:e.unmountTaskChooseOrganization,updateProps:e.__internal_updateProps,props:r,rootProps:a}))},{component:`TaskChooseOrganization`,renderWhileLoading:!0}),Sr(({clerk:e,component:t,fallback:n,...r})=>{let i=_r(t)===`rendering`||!e.loaded,a={...i&&n&&{style:{display:`none`}}};return d.createElement(d.Fragment,null,i&&n,e.loaded&&d.createElement(xr,{component:t,mount:e.mountTaskResetPassword,unmount:e.unmountTaskResetPassword,updateProps:e.__internal_updateProps,props:r,rootProps:a}))},{component:`TaskResetPassword`,renderWhileLoading:!0}),Sr(({clerk:e,component:t,fallback:n,...r})=>{let i=_r(t)===`rendering`||!e.loaded,a={...i&&n&&{style:{display:`none`}}};return d.createElement(d.Fragment,null,i&&n,e.loaded&&d.createElement(xr,{component:t,mount:e.mountTaskSetupMFA,unmount:e.unmountTaskSetupMFA,updateProps:e.__internal_updateProps,props:r,rootProps:a}))},{component:`TaskSetupMFA`,renderWhileLoading:!0});var Br=e=>{throw TypeError(e)}
16,Vr=(e,t,n)=>t.has(e)||Br(`Cannot `+n),Hr=(e,t,n)=>(Vr(e,t,`read from private field`),n?n.call(e):t.get(e)),Ur=(e,t,n)=>t.has(e)?Br(`Cannot add the same private member more than once`):t instanceof WeakSet?t.add(e):t.set(e,n),Wr=(e,t,n,r)=>(Vr(e,t,`write to private field`),r?r.call(e,n):t.set(e,n),n),Gr=(e,t,n)=>(Vr(e,t,`access private method`),n),Kr=[[18,0,-1,0],[19,0,0,3],[19,1,1,4],[19,2,2,3],[19,3,3,0]],qr=new Set,Jr=(e,t,n)=>{let r=yn()||bn(),i=n??e;qr.has(i)||r||(qr.add(i),console.warn(`Clerk - DEPRECATION WARNING: "${e}" is deprecated and will be removed in the next major release.\n${t}`))};function Yr(e){let t=e.match(/^(\d+)\.(\d+)\.(\d+)/);if(!t)return null;let[,n,r,i]=t;return{major:parseInt(n,10),minor:parseInt(r,10),patch:parseInt(i,10)}}function Xr(e,t){let{major:n,minor:r,patch:i}=e;return t.some(([e,t,a,o])=>n===e?a===-1?r>t||r===t&&i>=o:r===a&&i>=o:!1)}function Zr(e,t){let n=Yr(e);return n?Xr(n,t):!1}var Qr=(e,t,n,r,i)=>{let{notify:a}=i||{},o=e.get(n);o||(o=[],e.set(n,o)),o.push(r),a&&t.has(n)&&r(t.get(n))},$r=(e,t,n)=>(e.get(t)||[]).map(e=>e(n)),ei=(e,t,n)=>{let r=e.get(t);r&&(n?r.splice(r.indexOf(n)>>>0,1):e.set(t,[]))},ti=()=>{let e=new Map,t=new Map,n=new Map;return{on:(...n)=>Qr(e,t,...n),prioritizedOn:(...e)=>Qr(n,t,...e),emit:(r,i)=>{t.set(r,i),$r(n,r,i),$r(e,r,i)},off:(...t)=>ei(e,...t),prioritizedOff:(...e)=>ei(n,...e),internal:{retrieveListeners:t=>e.get(t)||[]}}},ni={Status:`status`},ri=()=>ti(),ii={initialDelay:125,maxDelayBetweenRetries:0,factor:2,shouldRetry:(e,t)=>t<5,retryImmediately:!1,jitter:!0},ai=100,oi=async e=>new Promise(t=>setTimeout(t,e)),si=(e,t)=>t?e*(1+Math.random()):e,ci=e=>{let t=0,n=()=>{let n=e.initialDelay*e.factor**+t;return n=si(n,e.jitter),Math.min(e.maxDelayBetweenRetries||n,n)};return async()=>{await oi(n()),t++}},li=async(e,t={})=>{let n=0,{shouldRetry:r,initialDelay:i,maxDelayBetweenRetries:a,factor:o,retryImmediately:s,jitter:c,onBeforeRetry:l}={...ii,...t},u=ci({initialDelay:i,maxDelayBetweenRetries:a,factor:o,jitter:c});for(;;)try{return await e()}catch(e){if(n++,!r(e,n))throw e;l&&await l(n),s&&n===1?await oi(si(ai,c)):await u()}},ui=`loadScript cannot be called when document does not exist`,di=`loadScript cannot be called without a src`;async function fi(e=``,t){let{async:n,defer:r,beforeLoad:i,crossOrigin:a,nonce:o}=t||{};return li(()=>new Promise((t,s)=>{e||s(Error(di)),(!document||!document.body)&&s(Error(ui));let c=document.createElement(`script`);a&&c.setAttribute(`crossorigin`,a),c.async=n||!1,c.defer=r||!1,c.addEventListener(`load`,()=>{c.remove(),t(c)}),c.addEventListener(`error`,t=>{c.remove(),s(t.error??Error(`failed to load script: ${e}`))}),c.src=e,c.nonce=o,i?.(c),document.body.appendChild(c)}),{shouldRetry:(e,t)=>t<=5})}function pi(e){return e?mi(e)||hi(e):!0}function mi(e){return/^http(s)?:\/\//.test(e||``)}function hi(e){return e.startsWith(`/`)}function gi(e){return e?!hi(e)||typeof window>`u`||!window.location?.origin?e:new URL(e,window.location.origin).toString():``}function _i(e){if(!e)return``;let t;if(e.match(/^(clerk\.)+\w*$/))t=/(clerk\.)*(?=clerk\.)/;else if(e.match(/\.clerk.accounts/))return e;else t=/^(clerk\.)*/gi;return`clerk.${e.replace(t,``)}`}var vi=(e,t=`6.10.1`)=>{if(e)return e;let n=yi(t);return n?n===`snapshot`?t:n:bi(t)},yi=e=>e.trim().replace(/^v/,``).match(/-(.+?)(\.|$)/)?.[1],bi=e=>e.trim().replace(/^v/,``).split(`.`)[0],{isDevOrStagingUrl:xi}=w(),Si=g({packageName:`@clerk/shared`});function Ci(e){return typeof window>`u`||!window[e]?!1:!!window[e]}var wi=()=>Ci(`Clerk`),Ti=()=>Ci(`__internal_ClerkUICtor`);function Ei(e){if(typeof window>`u`||!window.performance)return!1;let t=performance.getEntriesByName(e,`resource`);if(t.length===0)return!1;let n=t[t.length-1];return n.transferSize===0&&n.decodedBodySize===0&&(n.responseEnd===0||n.responseEnd>0&&n.responseStart>0||`responseStatus`in n&&(n.responseStatus>=400||n.responseStatus===0))}var Di=async e=>{let t=e?.scriptLoadTimeout??15e3,n=e=>
16new m(`Failed to load Clerk JS`+(e?.message?`, ${e.message}`:``),{code:`failed_to_load_clerk_js`,cause:e});if(wi())return null;if(!e?.publishableKey)return Si.throwMissingPublishableKeyError(),null;let r=ki(e),i=document.querySelector(`script[data-clerk-js-script]`);if(i)if(Ei(r))i.remove();else try{return await Li(t,wi,n(),i),null}catch{i.remove()}let a=Li(t,wi,n());return fi(r,{async:!0,crossOrigin:`anonymous`,nonce:e.nonce,beforeLoad:Ni(ji(e))}).catch(e=>{throw n(e)}),a},Oi=async e=>{let t=e?.scriptLoadTimeout??15e3,n=e=>new m(`Failed to load Clerk UI`+(e?.message?`, ${e.message}`:``),{code:`failed_to_load_clerk_ui`,cause:e});if(Ti())return null;if(!e?.publishableKey)return Si.throwMissingPublishableKeyError(),null;let r=Ai(e),i=document.querySelector(`script[data-clerk-ui-script]`);if(i)if(Ei(r))i.remove();else try{return await Li(t,Ti,n(),i),null}catch{i.remove()}let a=Li(t,Ti,n());return fi(r,{async:!0,crossOrigin:`anonymous`,nonce:e.nonce,beforeLoad:Ni(Mi(e))}).catch(e=>{throw n(e)}),a},ki=e=>{let{__internal_clerkJSUrl:t,__internal_clerkJSVersion:n,proxyUrl:r,domain:i,publishableKey:a}=e;if(t)return t;let o=vi(n);return r&&hi(r)?Fi(r,`clerk-js`,o,`clerk.browser.js`):`https://${Ii({publishableKey:a,proxyUrl:r,domain:i})}/npm/@clerk/clerk-js@${o}/dist/clerk.browser.js`},Ai=e=>{let{__internal_clerkUIUrl:t,__internal_clerkUIVersion:n,proxyUrl:r,domain:i,publishableKey:a}=e;if(t)return t;let o=vi(n,`1.9.1`);return r&&hi(r)?Fi(r,`ui`,o,`ui.browser.js`):`https://${Ii({publishableKey:a,proxyUrl:r,domain:i})}/npm/@clerk/ui@${o}/dist/ui.browser.js`},ji=e=>{let t={};return e.publishableKey&&(t[`data-clerk-publishable-key`]=e.publishableKey),e.proxyUrl&&(t[`data-clerk-proxy-url`]=e.proxyUrl),e.domain&&(t[`data-clerk-domain`]=e.domain),e.nonce&&(t.nonce=e.nonce),t},Mi=e=>ji(e),Ni=e=>t=>{for(let n in e)t.setAttribute(n,e[n])},Pi=e=>{for(;e.endsWith(`/`);)e=e.slice(0,-1);return e},Fi=(e,t,n,r)=>`${Pi(e)}/npm/@clerk/${t}@${n}/dist/${r}`,Ii=e=>{let{proxyUrl:t,domain:n,publishableKey:r}=e;if(t&&pi(t)){let e=gi(t);return hi(e)?S(r)?.frontendApi||``:e.replace(/http(s)?:\/\//,``)}else if(n&&!xi(S(r)?.frontendApi||``))return _i(n);else return S(r)?.frontendApi||``};function Li(e,t,n,r){return new Promise((i,a)=>{let o=!1,s=(e,t)=>{clearTimeout(e),clearInterval(t)};r?.addEventListener(`error`,()=>{s(l,u),a(n)});let c=()=>{o||t()&&(o=!0,s(l,u),i(null))},l=setTimeout(()=>{o||(o=!0,s(l,u),t()?i(null):a(n))},e);c();let u=setInterval(()=>{if(o){clearInterval(u);return}c()},100)})}function Ri(e){Si.setPackageName({packageName:e})}Sr(({clerk:e,...t})=>{let{client:n,session:r}=e,i=(n.signedInSessions?.length??0)>0;return d.useEffect(()=>{r===null&&i?e.redirectToAfterSignOut():e.redirectToSignIn(t)},[]),null},`RedirectToSignIn`),Sr(({clerk:e,...t})=>(d.useEffect(()=>{e.redirectToSignUp(t)},[]),null),`RedirectToSignUp`),Sr(({clerk:e,...t})=>(d.useEffect(()=>{e.redirectToTasks(t)},[]),null),`RedirectToTasks`),Sr(({clerk:e})=>(d.useEffect(()=>{Jr(`RedirectToUserProfile`,"Use the `redirectToUserProfile()` method instead."),e.redirectToUserProfile()},[]),null),`RedirectToUserProfile`),Sr(({clerk:e})=>(d.useEffect(()=>{Jr(`RedirectToOrganizationProfile`,"Use the `redirectToOrganizationProfile()` method instead."),e.redirectToOrganizationProfile()},[]),null),`RedirectToOrganizationProfile`),Sr(({clerk:e})=>(d.useEffect(()=>{Jr(`RedirectToCreateOrganization`,"Use the `redirectToCreateOrganization()` method instead."),e.redirectToCreateOrganization()},[]),null),`RedirectToCreateOrganization`),Sr(({clerk:e,...t})=>(d.useEffect(()=>{e.handleRedirectCallback(t)},[]),null),`AuthenticateWithRedirectCallback`);function zi(){try{return Zr(`19.2.6`,Kr)}catch{return!1}}var Bi=zi(),Vi=()=>({fields:{identifier:null,password:null,code:null},raw:null,global:null}),Hi=()=>({fields:{firstName:null,lastName:null,emailAddress:null,phoneNumber:null,password:null,username:null,code:null,captcha:null,legalAccepted:null},raw:null,global:null}),Ui=()=>({fields:{emailAddress:null},raw:null,global:null}),Wi=()=>({pathRoot:``,attempts:null,error:null,expireAt:null,externalVerificationRedirectURL:null,nonce:null,message:null,status:null,strategy:null,verifiedAtClient:null,verifiedFromTheSameClient(){return!1},reload(){throw Error(`reload() called before Clerk is loaded`)},__internal_toSnapshot(){return{object:`verification`,id:``,attempts:null,error:{code:``,message:``},expire_at:null,externalVerificationRedirectURL:null,nonce:null,message:null,status:null,strategy:null,verified_at_client:null}}}),Gi=()=>({...Wi(),supportedStrategies:[],nextAction:``,reload(){throw Error(`reload() called before Clerk is loaded`)},__internal_toSnapshot(){return{...Wi().__internal_toSnapshot(),next_action:this.nextAction,supported_strategies:this.supportedStrategies}}}),Ki=class{constructor(e){this.isomorphicClerk=e,this.signInSignalProxy=this.buildSignInProxy(),this.signUpSignalProxy=this.buildSignUpProxy(),this.waitlistSignalProxy=this.buildWaitlistProxy()}signInSignal(){return this.signInSignalProxy}signUpSignal(){return this.signUpSignalProxy}waitlistSignal(){return this.waitlistSignalProxy}get __internal_waitlist(){return this.state.__internal_waitlist}checkoutSignal(e){return this.buildCheckoutProxy(e)}buildSignInProxy(){let e=this.gateProperty.bind(this),t=()=>this.client.signIn.__internal_future;return{errors:Vi(),fetchStatus:`idle`,signIn:{status:`needs_identifier`,availableStrategies:[],get isTransferable(){return e(t,`isTransferable`,!1)},get id(){return e(t,`id`,void 0)},get supportedFirstFactors(){return e(t,`supportedFirstFactors`,[])},get supportedSecondFactors(){return e(t,`supportedSecondFactors`,[])},get secondFactorVerification(){return e(t,`secondFactorVerification`,{status:null,error:null,expireAt:null,externalVerificationRedirectURL:null,nonce:null,attempts:null,message:null,strategy:null,verifiedAtClient:null,verifiedFromTheSameClient:()=>!1,__internal_toSnapshot:()=>{throw Error(`__internal_toSnapshot called before Clerk is loaded`)},pathRoot:``,reload:()=>{throw Error(`__internal_toSnapshot called before Clerk is loaded`)}})},get identifier(){return e(t,`identifier`,null)}
16,get createdSessionId(){return e(t,`createdSessionId`,null)},get userData(){return e(t,`userData`,{})},get firstFactorVerification(){return e(t,`firstFactorVerification`,{status:null,error:null,expireAt:null,externalVerificationRedirectURL:null,nonce:null,attempts:null,message:null,strategy:null,verifiedAtClient:null,verifiedFromTheSameClient:()=>!1,__internal_toSnapshot:()=>{throw Error(`__internal_toSnapshot called before Clerk is loaded`)},pathRoot:``,reload:()=>{throw Error(`__internal_toSnapshot called before Clerk is loaded`)}})},get canBeDiscarded(){return e(t,`canBeDiscarded`,!1)},create:this.gateMethod(t,`create`),password:this.gateMethod(t,`password`),sso:this.gateMethod(t,`sso`),finalize:this.gateMethod(t,`finalize`),reset:this.gateMethod(t,`reset`),emailCode:this.wrapMethods(()=>t().emailCode,[`sendCode`,`verifyCode`]),emailLink:this.wrapStruct(()=>t().emailLink,[`sendLink`,`waitForVerification`],[`verification`],{verification:null}),resetPasswordEmailCode:this.wrapMethods(()=>t().resetPasswordEmailCode,[`sendCode`,`verifyCode`,`submitPassword`]),resetPasswordPhoneCode:this.wrapMethods(()=>t().resetPasswordPhoneCode,[`sendCode`,`verifyCode`,`submitPassword`]),phoneCode:this.wrapMethods(()=>t().phoneCode,[`sendCode`,`verifyCode`]),mfa:this.wrapMethods(()=>t().mfa,[`sendPhoneCode`,`verifyPhoneCode`,`sendEmailCode`,`verifyEmailCode`,`verifyTOTP`,`verifyBackupCode`]),ticket:this.gateMethod(t,`ticket`),passkey:this.gateMethod(t,`passkey`),web3:this.gateMethod(t,`web3`)}}}buildSignUpProxy(){let e=this.gateProperty.bind(this),t=this.gateMethod.bind(this),n=()=>this.client.signUp.__internal_future;return{errors:Hi(),fetchStatus:`idle`,signUp:{get id(){return e(n,`id`,void 0)},get requiredFields(){return e(n,`requiredFields`,[])},get optionalFields(){return e(n,`optionalFields`,[])},get missingFields(){return e(n,`missingFields`,[])},get username(){return e(n,`username`,null)},get firstName(){return e(n,`firstName`,null)},get lastName(){return e(n,`lastName`,null)},get emailAddress(){return e(n,`emailAddress`,null)},get phoneNumber(){return e(n,`phoneNumber`,null)},get web3Wallet(){return e(n,`web3Wallet`,null)},get hasPassword(){return e(n,`hasPassword`,!1)},get unsafeMetadata(){return e(n,`unsafeMetadata`,{})},get createdSessionId(){return e(n,`createdSessionId`,null)},get createdUserId(){return e(n,`createdUserId`,null)},get abandonAt(){return e(n,`abandonAt`,null)},get legalAcceptedAt(){return e(n,`legalAcceptedAt`,null)},get locale(){return e(n,`locale`,null)},get status(){return e(n,`status`,`missing_requirements`)},get unverifiedFields(){return e(n,`unverifiedFields`,[])},get isTransferable(){return e(n,`isTransferable`,!1)},get canBeDiscarded(){return e(n,`canBeDiscarded`,!1)},create:t(n,`create`),update:t(n,`update`),sso:t(n,`sso`),password:t(n,`password`),ticket:t(n,`ticket`),web3:t(n,`web3`),finalize:t(n,`finalize`),reset:t(n,`reset`),verifications:this.wrapStruct(()=>n().verifications,[`sendEmailCode`,`verifyEmailCode`,`sendEmailLink`,`waitForEmailLinkVerification`,`sendPhoneCode`,`verifyPhoneCode`],[`emailAddress`,`phoneNumber`,`web3Wallet`,`externalAccount`,`emailLinkVerification`],{emailAddress:Gi(),phoneNumber:Gi(),web3Wallet:Gi(),externalAccount:Gi(),emailLinkVerification:null})}}}buildWaitlistProxy(){let e=this.gateProperty.bind(this),t=this.gateMethod.bind(this),n=()=>this.state.__internal_waitlist;return{errors:Ui(),fetchStatus:`idle`,waitlist:{pathRoot:`/waitlist`,get id(){return e(n,`id`,``)},get createdAt(){return e(n,`createdAt`,null)},get updatedAt(){return e(n,`updatedAt`,null)},join:t(n,`join`),reload:t(n,`reload`)}}}buildCheckoutProxy(e){let t=this.gateProperty.bind(this),n=()=>this.checkout(e),r=()=>n().checkout;return{errors:{raw:null,global:null},fetchStatus:`idle`,checkout:{get status(){return t(r,`status`,`needs_initialization`)},get externalClientSecret(){return t(r,`externalClientSecret`,null)},get externalGatewayId(){return t(r,`externalGatewayId`,null)},get paymentMethod(){return t(r,`paymentMethod`,null)},get plan(){return t(r,`plan`,null)},get planPeriod(){return t(r,`planPeriod`,null)},get totals(){return t(r,`totals`,null)},get isImmediatePlanChange(){return t(r,`isImmediatePlanChange`,!1)},get freeTrialEndsAt(){return t(r,`freeTrialEndsAt`,null)},get payer(){return t(r,`payer`,null)},get planPeriodStart(){return t(r,`planPeriodStart`,null)},get needsPaymentMethod(){return t(r,`needsPaymentMethod`,null)},start:this.gateMethod(r,`start`),confirm:this.gateMethod(r,`confirm`),finalize:this.gateMethod(r,`finalize`)}}}__internal_effect(e){throw Error(`__internal_effect called before Clerk is loaded`)}__internal_computed(e){throw Error(`__internal_computed called before Clerk is loaded`)}get state(){let e=this.isomorphicClerk.__internal_state;if(!e)throw Error(`Clerk state not ready`);return e}get client(){let e=this.isomorphicClerk.client;if(!e)throw Error(`Clerk client not ready`);return e}get checkout(){let e=this.isomorphicClerk.__experimental_checkout;if(!e)throw Error(`Clerk checkout not ready`);return e}gateProperty(e,t,n){return!On()||!this.isomorphicClerk.loaded?n:e()[t]}gateMethod(e,t){return(async(...n)=>{if(!On())return mn.throw(`Attempted to call a method (${t}) that is not supported on the server.`);this.isomorphicClerk.loaded||await new Promise(e=>this.isomorphicClerk.addOnLoaded(e));let r=e();return r[t].apply(r,n)})}wrapMethods(e,t){return Object.fromEntries(t.map(t=>[t,this.gateMethod(e,t)]))}wrapStruct(e,t,n,r){let i={};for(let n of t)i[n]=this.gateMethod(e,n);for(let t of n)Object.defineProperty(i,t,{get:()=>this.gateProperty(e,t,r[t]),enumerable:!0});return i}};globalThis.__BUILD_DISABLE_RHC__===void 0&&(globalThis.__BUILD_DISABLE_RHC__=!1);
16var qi={name:`@clerk/react`,version:`6.6.2`,environment:`production`},Ji,Yi,Xi,Zi,Qi,$i,ea,ta,na,ra=class e{constructor(e){Ur(this,ta),this.clerkjs=null,this.preopenOneTap=null,this.preopenUserVerification=null,this.preopenEnableOrganizationsPrompt=null,this.preopenSignIn=null,this.preopenCheckout=null,this.preopenPlanDetails=null,this.preopenSubscriptionDetails=null,this.preopenSignUp=null,this.preopenUserProfile=null,this.preopenOrganizationProfile=null,this.preopenCreateOrganization=null,this.preOpenWaitlist=null,this.premountSignInNodes=new Map,this.premountSignUpNodes=new Map,this.premountUserAvatarNodes=new Map,this.premountUserProfileNodes=new Map,this.premountUserButtonNodes=new Map,this.premountOrganizationProfileNodes=new Map,this.premountCreateOrganizationNodes=new Map,this.premountOrganizationSwitcherNodes=new Map,this.premountOrganizationListNodes=new Map,this.premountMethodCalls=new Map,this.premountWaitlistNodes=new Map,this.premountPricingTableNodes=new Map,this.premountAPIKeysNodes=new Map,this.premountConfigureSSONodes=new Map,this.premountOAuthConsentNodes=new Map,this.premountTaskChooseOrganizationNodes=new Map,this.premountTaskResetPasswordNodes=new Map,this.premountTaskSetupMFANodes=new Map,this.premountAddListenerCalls=new Map,this.loadedListeners=[],Ur(this,Ji,`loading`),Ur(this,Yi),Ur(this,Xi),Ur(this,Zi),Ur(this,Qi,ri()),Ur(this,$i),this.buildSignInUrl=e=>{let t=()=>this.clerkjs?.buildSignInUrl(e)||``;if(this.clerkjs&&this.loaded)return t();this.premountMethodCalls.set(`buildSignInUrl`,t)},this.buildSignUpUrl=e=>{let t=()=>this.clerkjs?.buildSignUpUrl(e)||``;if(this.clerkjs&&this.loaded)return t();this.premountMethodCalls.set(`buildSignUpUrl`,t)},this.buildAfterSignInUrl=(...e)=>{let t=()=>this.clerkjs?.buildAfterSignInUrl(...e)||``;if(this.clerkjs&&this.loaded)return t();this.premountMethodCalls.set(`buildAfterSignInUrl`,t)},this.buildAfterSignUpUrl=(...e)=>{let t=()=>this.clerkjs?.buildAfterSignUpUrl(...e)||``;if(this.clerkjs&&this.loaded)return t();this.premountMethodCalls.set(`buildAfterSignUpUrl`,t)},this.buildAfterSignOutUrl=()=>{let e=()=>this.clerkjs?.buildAfterSignOutUrl()||``;if(this.clerkjs&&this.loaded)return e();this.premountMethodCalls.set(`buildAfterSignOutUrl`,e)},this.buildNewSubscriptionRedirectUrl=()=>{let e=()=>this.clerkjs?.buildNewSubscriptionRedirectUrl()||``;if(this.clerkjs&&this.loaded)return e();this.premountMethodCalls.set(`buildNewSubscriptionRedirectUrl`,e)},this.buildAfterMultiSessionSingleSignOutUrl=()=>{let e=()=>this.clerkjs?.buildAfterMultiSessionSingleSignOutUrl()||``;if(this.clerkjs&&this.loaded)return e();this.premountMethodCalls.set(`buildAfterMultiSessionSingleSignOutUrl`,e)},this.buildUserProfileUrl=()=>{let e=()=>this.clerkjs?.buildUserProfileUrl()||``;if(this.clerkjs&&this.loaded)return e();this.premountMethodCalls.set(`buildUserProfileUrl`,e)},this.buildCreateOrganizationUrl=()=>{let e=()=>this.clerkjs?.buildCreateOrganizationUrl()||``;if(this.clerkjs&&this.loaded)return e();this.premountMethodCalls.set(`buildCreateOrganizationUrl`,e)},this.buildOrganizationProfileUrl=()=>{let e=()=>this.clerkjs?.buildOrganizationProfileUrl()||``;if(this.clerkjs&&this.loaded)return e();this.premountMethodCalls.set(`buildOrganizationProfileUrl`,e)},this.buildWaitlistUrl=()=>{let e=()=>this.clerkjs?.buildWaitlistUrl()||``;if(this.clerkjs&&this.loaded)return e();this.premountMethodCalls.set(`buildWaitlistUrl`,e)},this.buildTasksUrl=()=>{let e=()=>this.clerkjs?.buildTasksUrl()||``;if(this.clerkjs&&this.loaded)return e();this.premountMethodCalls.set(`buildTasksUrl`,e)},this.buildUrlWithAuth=e=>{let t=()=>this.clerkjs?.buildUrlWithAuth(e)||``;if(this.clerkjs&&this.loaded)return t();this.premountMethodCalls.set(`buildUrlWithAuth`,t)},this.handleUnauthenticated=async()=>{let e=()=>this.clerkjs?.handleUnauthenticated();this.clerkjs&&this.loaded?e():this.premountMethodCalls.set(`handleUnauthenticated`,e)},this.on=(...e)=>{if(this.clerkjs?.on)return this.clerkjs.on(...e);Hr(this,Qi).on(...e)},this.off=(...e)=>{if(this.clerkjs?.off)return this.clerkjs.off(...e);Hr(this,Qi).off(...e)},this.addOnLoaded=e=>{this.loadedListeners.push(e),this.loaded&&this.emitLoaded()},this.emitLoaded=()=>
16{this.loadedListeners.forEach(e=>e()),this.loadedListeners=[]},this.beforeLoad=e=>{if(!e)throw Error(`Failed to hydrate latest Clerk JS`)},this.replayInterceptedInvocations=e=>{var t;if(!e)throw Error(`Failed to hydrate latest Clerk JS`);return this.clerkjs=e,this.premountMethodCalls.forEach(e=>e()),this.premountAddListenerCalls.forEach((t,n)=>{t.handlers.nativeUnsubscribe=e.addListener(n,t.options)}),(t=Hr(this,Qi).internal.retrieveListeners(`status`))==null||t.forEach(e=>{this.on(`status`,e,{notify:!0})}),this.preopenSignIn!==null&&e.openSignIn(this.preopenSignIn),this.preopenCheckout!==null&&e.__internal_openCheckout(this.preopenCheckout),this.preopenPlanDetails!==null&&e.__internal_openPlanDetails(this.preopenPlanDetails),this.preopenSubscriptionDetails!==null&&e.__internal_openSubscriptionDetails(this.preopenSubscriptionDetails),this.preopenSignUp!==null&&e.openSignUp(this.preopenSignUp),this.preopenUserProfile!==null&&e.openUserProfile(this.preopenUserProfile),this.preopenUserVerification!==null&&e.__internal_openReverification(this.preopenUserVerification),this.preopenOneTap!==null&&e.openGoogleOneTap(this.preopenOneTap),this.preopenOrganizationProfile!==null&&e.openOrganizationProfile(this.preopenOrganizationProfile),this.preopenCreateOrganization!==null&&e.openCreateOrganization(this.preopenCreateOrganization),this.preOpenWaitlist!==null&&e.openWaitlist(this.preOpenWaitlist),this.preopenEnableOrganizationsPrompt&&e.__internal_openEnableOrganizationsPrompt(this.preopenEnableOrganizationsPrompt),this.premountSignInNodes.forEach((t,n)=>{e.mountSignIn(n,t)}),this.premountSignUpNodes.forEach((t,n)=>{e.mountSignUp(n,t)}),this.premountUserProfileNodes.forEach((t,n)=>{e.mountUserProfile(n,t)}),this.premountUserAvatarNodes.forEach((t,n)=>{e.mountUserAvatar(n,t)}),this.premountUserButtonNodes.forEach((t,n)=>{e.mountUserButton(n,t)}),this.premountOrganizationListNodes.forEach((t,n)=>{e.mountOrganizationList(n,t)}),this.premountWaitlistNodes.forEach((t,n)=>{e.mountWaitlist(n,t)}),this.premountPricingTableNodes.forEach((t,n)=>{e.mountPricingTable(n,t)}),this.premountAPIKeysNodes.forEach((t,n)=>{e.mountAPIKeys(n,t)}),this.premountConfigureSSONodes.forEach((t,n)=>{e.__experimental_mountConfigureSSO(n,t)}),this.premountOAuthConsentNodes.forEach((t,n)=>{e.__internal_mountOAuthConsent(n,t)}),this.premountTaskChooseOrganizationNodes.forEach((t,n)=>{e.mountTaskChooseOrganization(n,t)}),this.premountTaskResetPasswordNodes.forEach((t,n)=>{e.mountTaskResetPassword(n,t)}),this.premountTaskSetupMFANodes.forEach((t,n)=>{e.mountTaskSetupMFA(n,t)}),this.clerkjs.status===void 0&&Hr(this,Qi).emit(ni.Status,`ready`),this.emitLoaded(),this.clerkjs},this.__experimental_checkout=(...e)=>this.loaded&&this.clerkjs?this.clerkjs.__experimental_checkout(...e):Hr(this,$i).checkoutSignal(...e),this.__internal_updateProps=async e=>{let t=await Gr(this,ta,na).call(this);if(t&&`__internal_updateProps`in t)return t.__internal_updateProps(e)},this.setActive=e=>this.clerkjs?this.clerkjs.setActive(e):Promise.reject(),this.openSignIn=e=>{this.clerkjs&&this.loaded?this.clerkjs.openSignIn(e):this.preopenSignIn=e},this.closeSignIn=()=>{this.clerkjs&&this.loaded?this.clerkjs.closeSignIn():this.preopenSignIn=null},this.__internal_openCheckout=e=>{this.clerkjs&&this.loaded?this.clerkjs.__internal_openCheckout(e):this.preopenCheckout=e},this.__internal_closeCheckout=()=>{this.clerkjs&&this.loaded?this.clerkjs.__internal_closeCheckout():this.preopenCheckout=null},this.__internal_openPlanDetails=e=>{this.clerkjs&&this.loaded?this.clerkjs.__internal_openPlanDetails(e):this.preopenPlanDetails=e},this.__internal_closePlanDetails=()=>{this.clerkjs&&this.loaded?this.clerkjs.__internal_closePlanDetails():this.preopenPlanDetails=null},this.__internal_openSubscriptionDetails=e=>{this.clerkjs&&this.loaded?this.clerkjs.__internal_openSubscriptionDetails(e):this.preopenSubscriptionDetails=e??null},this.__internal_closeSubscriptionDetails=()=>{this.clerkjs&&this.loaded?this.clerkjs.__internal_closeSubscriptionDetails():this.preopenSubscriptionDetails=null},this.__internal_openReverification=e=>{this.clerkjs&&this.loaded?this.clerkjs.__internal_openReverification(e):this.preopenUserVerification=e},this.__internal_closeReverification=()=>{this.clerkjs&&this.loaded?this.clerkjs.__internal_closeReverification():this.preopenUserVerification=null},this.__internal_openEnableOrganizationsPrompt=e=>{this.clerkjs&&this.loaded?this.clerkjs.__internal_openEnableOrganizationsPrompt(e):this.preopenEnableOrganizationsPrompt=e},this.__internal_closeEnableOrganizationsPrompt=()=>{this.clerkjs&&this.loaded?this.clerkjs.__internal_closeEnableOrganizationsPrompt():this.preopenEnableOrganizationsPrompt=null},this.openGoogleOneTap=e=>{this.clerkjs&&this.loaded?this.clerkjs.openGoogleOneTap(e):this.preopenOneTap=e},this.closeGoogleOneTap=()=>{this.clerkjs&&this.loaded?this.clerkjs.closeGoogleOneTap():this.preopenOneTap=null},this.openUserProfile=e=>{this.clerkjs&&this.loaded?this.clerkjs.openUserProfile(e):this.preopenUserProfile=e},this.closeUserProfile=()=>{this.clerkjs&&this.loaded?this.clerkjs.closeUserProfile():this.preopenUserProfile=null},this.openOrganizationProfile=e=>{this.clerkjs&&this.loaded?this.clerkjs.openOrganizationProfile(e):this.preopenOrganizationProfile=e},this.closeOrganizationProfile=()=>{this.clerkjs&&this.loaded?this.clerkjs.closeOrganizationProfile():this.preopenOrganizationProfile=null},this.openCreateOrganization=e=>{this.clerkjs&&this.loaded?this.clerkjs.openCreateOrganization(e):this.preopenCreateOrganization=e},this.closeCreateOrganization=()=>{this.clerkjs&&this.loaded?this.clerkjs.closeCreateOrganization():this.preopenCreateOrganization=null},this.openWaitlist=e=>{this.clerkjs&&this.loaded?this.clerkjs.openWaitlist(e):this.preOpenWaitlist=e},this.closeWaitlist=()=>{this.clerkjs&&this.loaded?this.clerkjs.closeWaitlist():this.preOpenWaitlist=null},this.openSignUp=e=>{this.clerkjs&&this.loaded?this.clerkjs.openSignUp(e):this.preopenSignUp=e},this.closeSignUp=()=>{this.clerkjs&&this.loaded?this.clerkjs.closeSignUp():this.preopenSignUp=null}
16,this.mountSignIn=(e,t)=>{this.clerkjs&&this.loaded?this.clerkjs.mountSignIn(e,t):this.premountSignInNodes.set(e,t)},this.unmountSignIn=e=>{this.clerkjs&&this.loaded?this.clerkjs.unmountSignIn(e):this.premountSignInNodes.delete(e)},this.mountSignUp=(e,t)=>{this.clerkjs&&this.loaded?this.clerkjs.mountSignUp(e,t):this.premountSignUpNodes.set(e,t)},this.unmountSignUp=e=>{this.clerkjs&&this.loaded?this.clerkjs.unmountSignUp(e):this.premountSignUpNodes.delete(e)},this.mountUserAvatar=(e,t)=>{this.clerkjs&&this.loaded?this.clerkjs.mountUserAvatar(e,t):this.premountUserAvatarNodes.set(e,t)},this.unmountUserAvatar=e=>{this.clerkjs&&this.loaded?this.clerkjs.unmountUserAvatar(e):this.premountUserAvatarNodes.delete(e)},this.mountUserProfile=(e,t)=>{this.clerkjs&&this.loaded?this.clerkjs.mountUserProfile(e,t):this.premountUserProfileNodes.set(e,t)},this.unmountUserProfile=e=>{this.clerkjs&&this.loaded?this.clerkjs.unmountUserProfile(e):this.premountUserProfileNodes.delete(e)},this.mountOrganizationProfile=(e,t)=>{this.clerkjs&&this.loaded?this.clerkjs.mountOrganizationProfile(e,t):this.premountOrganizationProfileNodes.set(e,t)},this.unmountOrganizationProfile=e=>{this.clerkjs&&this.loaded?this.clerkjs.unmountOrganizationProfile(e):this.premountOrganizationProfileNodes.delete(e)},this.mountCreateOrganization=(e,t)=>{this.clerkjs&&this.loaded?this.clerkjs.mountCreateOrganization(e,t):this.premountCreateOrganizationNodes.set(e,t)},this.unmountCreateOrganization=e=>{this.clerkjs&&this.loaded?this.clerkjs.unmountCreateOrganization(e):this.premountCreateOrganizationNodes.delete(e)},this.mountOrganizationSwitcher=(e,t)=>{this.clerkjs&&this.loaded?this.clerkjs.mountOrganizationSwitcher(e,t):this.premountOrganizationSwitcherNodes.set(e,t)},this.unmountOrganizationSwitcher=e=>{this.clerkjs&&this.loaded?this.clerkjs.unmountOrganizationSwitcher(e):this.premountOrganizationSwitcherNodes.delete(e)},this.__experimental_prefetchOrganizationSwitcher=()=>{let e=()=>this.clerkjs?.__experimental_prefetchOrganizationSwitcher();this.clerkjs&&this.loaded?e():this.premountMethodCalls.set(`__experimental_prefetchOrganizationSwitcher`,e)},this.mountOrganizationList=(e,t)=>{this.clerkjs&&this.loaded?this.clerkjs.mountOrganizationList(e,t):this.premountOrganizationListNodes.set(e,t)},this.unmountOrganizationList=e=>{this.clerkjs&&this.loaded?this.clerkjs.unmountOrganizationList(e):this.premountOrganizationListNodes.delete(e)},this.mountUserButton=(e,t)=>{this.clerkjs&&this.loaded?this.clerkjs.mountUserButton(e,t):this.premountUserButtonNodes.set(e,t)},this.unmountUserButton=e=>{this.clerkjs&&this.loaded?this.clerkjs.unmountUserButton(e):this.premountUserButtonNodes.delete(e)},this.mountWaitlist=(e,t)=>{this.clerkjs&&this.loaded?this.clerkjs.mountWaitlist(e,t):this.premountWaitlistNodes.set(e,t)},this.unmountWaitlist=e=>{this.clerkjs&&this.loaded?this.clerkjs.unmountWaitlist(e):this.premountWaitlistNodes.delete(e)},this.mountPricingTable=(e,t)=>{this.clerkjs&&this.loaded?this.clerkjs.mountPricingTable(e,t):this.premountPricingTableNodes.set(e,t)},this.unmountPricingTable=e=>{this.clerkjs&&this.loaded?this.clerkjs.unmountPricingTable(e):this.premountPricingTableNodes.delete(e)},this.mountAPIKeys=(e,t)=>{this.clerkjs&&this.loaded?this.clerkjs.mountAPIKeys(e,t):this.premountAPIKeysNodes.set(e,t)},this.unmountAPIKeys=e=>{this.clerkjs&&this.loaded?this.clerkjs.unmountAPIKeys(e):this.premountAPIKeysNodes.delete(e)},this.__experimental_mountConfigureSSO=(e,t)=>{this.clerkjs&&this.loaded?this.clerkjs.__experimental_mountConfigureSSO(e,t):this.premountConfigureSSONodes.set(e,t)},this.__experimental_unmountConfigureSSO=e=>{this.clerkjs&&this.loaded?this.clerkjs.__experimental_unmountConfigureSSO(e):this.premountConfigureSSONodes.delete(e)},this.__internal_mountOAuthConsent=(e,t)=>{this.clerkjs&&this.loaded?this.clerkjs.__internal_mountOAuthConsent(e,t):this.premountOAuthConsentNodes.set(e,t)},this.__internal_unmountOAuthConsent=e=>{this.clerkjs&&this.loaded?this.clerkjs.__internal_unmountOAuthConsent(e):this.premountOAuthConsentNodes.delete(e)},this.mountOAuthConsent=(e,t)=>
16{this.__internal_mountOAuthConsent(e,t)},this.unmountOAuthConsent=e=>{this.__internal_unmountOAuthConsent(e)},this.mountTaskChooseOrganization=(e,t)=>{this.clerkjs&&this.loaded?this.clerkjs.mountTaskChooseOrganization(e,t):this.premountTaskChooseOrganizationNodes.set(e,t)},this.unmountTaskChooseOrganization=e=>{this.clerkjs&&this.loaded?this.clerkjs.unmountTaskChooseOrganization(e):this.premountTaskChooseOrganizationNodes.delete(e)},this.mountTaskResetPassword=(e,t)=>{this.clerkjs&&this.loaded?this.clerkjs.mountTaskResetPassword(e,t):this.premountTaskResetPasswordNodes.set(e,t)},this.unmountTaskResetPassword=e=>{this.clerkjs&&this.loaded?this.clerkjs.unmountTaskResetPassword(e):this.premountTaskResetPasswordNodes.delete(e)},this.mountTaskSetupMFA=(e,t)=>{this.clerkjs&&this.loaded?this.clerkjs.mountTaskSetupMFA(e,t):this.premountTaskSetupMFANodes.set(e,t)},this.unmountTaskSetupMFA=e=>{this.clerkjs&&this.loaded?this.clerkjs.unmountTaskSetupMFA(e):this.premountTaskSetupMFANodes.delete(e)},this.addListener=(e,t)=>{if(this.clerkjs)return this.clerkjs.addListener(e,t);{let n=()=>{var t,n;let r=this.premountAddListenerCalls.get(e);r?.handlers&&((n=r==null?void 0:(t=r.handlers).nativeUnsubscribe)==null||n.call(t),this.premountAddListenerCalls.delete(e))};return this.premountAddListenerCalls.set(e,{options:t,handlers:{unsubscribe:n,nativeUnsubscribe:void 0}}),n}},this.navigate=e=>{let t=()=>this.clerkjs?.navigate(e);this.clerkjs&&this.loaded?t():this.premountMethodCalls.set(`navigate`,t)},this.redirectWithAuth=async(...e)=>{let t=()=>this.clerkjs?.redirectWithAuth(...e);if(this.clerkjs&&this.loaded)return t();this.premountMethodCalls.set(`redirectWithAuth`,t)},this.redirectToSignIn=async e=>{let t=()=>this.clerkjs?.redirectToSignIn(e);if(this.clerkjs&&this.loaded)return t();this.premountMethodCalls.set(`redirectToSignIn`,t)},this.redirectToSignUp=async e=>{let t=()=>this.clerkjs?.redirectToSignUp(e);if(this.clerkjs&&this.loaded)return t();this.premountMethodCalls.set(`redirectToSignUp`,t)},this.redirectToUserProfile=async()=>{let e=()=>this.clerkjs?.redirectToUserProfile();if(this.clerkjs&&this.loaded)return e();this.premountMethodCalls.set(`redirectToUserProfile`,e)},this.redirectToAfterSignUp=()=>{let e=()=>this.clerkjs?.redirectToAfterSignUp();if(this.clerkjs&&this.loaded)return e();this.premountMethodCalls.set(`redirectToAfterSignUp`,e)},this.redirectToAfterSignIn=()=>{let e=()=>this.clerkjs?.redirectToAfterSignIn();this.clerkjs&&this.loaded?e():this.premountMethodCalls.set(`redirectToAfterSignIn`,e)},this.redirectToAfterSignOut=()=>{let e=()=>this.clerkjs?.redirectToAfterSignOut();this.clerkjs&&this.loaded?e():this.premountMethodCalls.set(`redirectToAfterSignOut`,e)},this.redirectToOrganizationProfile=async()=>{let e=()=>this.clerkjs?.redirectToOrganizationProfile();if(this.clerkjs&&this.loaded)return e();this.premountMethodCalls.set(`redirectToOrganizationProfile`,e)},this.redirectToCreateOrganization=async()=>{let e=()=>this.clerkjs?.redirectToCreateOrganization();if(this.clerkjs&&this.loaded)return e();this.premountMethodCalls.set(`redirectToCreateOrganization`,e)},this.redirectToWaitlist=async()=>{let e=()=>this.clerkjs?.redirectToWaitlist();if(this.clerkjs&&this.loaded)return e();this.premountMethodCalls.set(`redirectToWaitlist`,e)},this.redirectToTasks=async e=>{let t=()=>this.clerkjs?.redirectToTasks(e);if(this.clerkjs&&this.loaded)return t();this.premountMethodCalls.set(`redirectToTasks`,t)},this.handleRedirectCallback=async e=>{var t;let n=()=>this.clerkjs?.handleRedirectCallback(e);this.clerkjs&&this.loaded?(t=n())==null||t.catch(()=>{}):this.premountMethodCalls.set(`handleRedirectCallback`,n)},this.handleGoogleOneTapCallback=async(e,t)=>{var n;let r=()=>this.clerkjs?.handleGoogleOneTapCallback(e,t);this.clerkjs&&this.loaded?(n=r())==null||n.catch(()=>{}):this.premountMethodCalls.set(`handleGoogleOneTapCallback`,r)},this.handleEmailLinkVerification=async e=>{let t=()=>this.clerkjs?.handleEmailLinkVerification(e);if(this.clerkjs&&this.loaded)return t();this.premountMethodCalls.set(`handleEmailLinkVerification`,t)},this.authenticateWithMetamask=async e=>{let t=()=>this.clerkjs?.authenticateWithMetamask(e);if(this.clerkjs&&this.loaded)return t();this.premountMethodCalls.set(`authenticateWithMetamask`,t)},this.authenticateWithCoinbaseWallet=async e=>{let t=()=>this.clerkjs?.authenticateWithCoinbaseWallet(e);if(this.clerkjs&&this.loaded)return t();this.premountMethodCalls.set(`authenticateWithCoinbaseWallet`,t)},this.authenticateWithBase=async e=>{let t=()=>this.clerkjs?.authenticateWithBase(e);if(this.clerkjs&&this.loaded)return t();this.premountMethodCalls.set(`authenticateWithBase`,t)},this.authenticateWithOKXWallet=async e=>{let t=()=>this.clerkjs?.authenticateWithOKXWallet(e);if(this.clerkjs&&this.loaded)return t();this.premountMethodCalls.set(`authenticateWithOKXWallet`,t)},this.authenticateWithSolana=async e=>{let t=()=>this.clerkjs?.authenticateWithSolana(e);if(this.clerkjs&&this.loaded)return t();this.premountMethodCalls.set(`authenticateWithSolana`,t)},this.authenticateWithWeb3=async e=>{let t=()=>this.clerkjs?.authenticateWithWeb3(e);
16if(this.clerkjs&&this.loaded)return t();this.premountMethodCalls.set(`authenticateWithWeb3`,t)},this.authenticateWithGoogleOneTap=async e=>(await Gr(this,ta,na).call(this)).authenticateWithGoogleOneTap(e),this.__internal_loadStripeJs=async()=>(await Gr(this,ta,na).call(this)).__internal_loadStripeJs(),this.createOrganization=async e=>{let t=()=>this.clerkjs?.createOrganization(e);if(this.clerkjs&&this.loaded)return t();this.premountMethodCalls.set(`createOrganization`,t)},this.getOrganization=async e=>{let t=()=>this.clerkjs?.getOrganization(e);if(this.clerkjs&&this.loaded)return t();this.premountMethodCalls.set(`getOrganization`,t)},this.joinWaitlist=async e=>{let t=()=>this.clerkjs?.joinWaitlist(e);if(this.clerkjs&&this.loaded)return t();this.premountMethodCalls.set(`joinWaitlist`,t)},this.signOut=async(...e)=>{let t=()=>this.clerkjs?.signOut(...e);if(this.clerkjs&&this.loaded)return t();this.premountMethodCalls.set(`signOut`,t)},this.__internal_attemptToEnableEnvironmentSetting=e=>{let t=()=>this.clerkjs?.__internal_attemptToEnableEnvironmentSetting(e);if(this.clerkjs&&this.loaded)return t();this.premountMethodCalls.set(`__internal_attemptToEnableEnvironmentSetting`,t)},Wr(this,Zi,e?.publishableKey),Wr(this,Xi,e?.proxyUrl),Wr(this,Yi,e?.domain),this.options=e,this.Clerk=e?.Clerk||null,this.mode=On()?`browser`:`server`,Wr(this,$i,new Ki(this)),this.options.sdkMetadata||(this.options.sdkMetadata=qi),Hr(this,Qi).emit(ni.Status,`loading`),Hr(this,Qi).prioritizedOn(ni.Status,e=>Wr(this,Ji,e)),Hr(this,Zi)&&this.options.experimental?.runtimeEnvironment===`headless`&&this.options.Clerk?this.loadHeadlessClerk():Hr(this,Zi)&&this.getEntryChunks()}get publishableKey(){return Hr(this,Zi)}get loaded(){return this.clerkjs?.loaded||!1}get status(){return this.clerkjs?this.clerkjs?.status||(this.clerkjs.loaded?`ready`:`loading`):Hr(this,Ji)}static getOrCreateInstance(t){return(!On()||!Hr(this,ea)||t.Clerk&&Hr(this,ea).Clerk!==t.Clerk||Hr(this,ea).publishableKey!==t.publishableKey)&&Wr(this,ea,new e(t)),Hr(this,ea)}static clearInstance(){Wr(this,ea,null)}get domain(){return typeof window<`u`&&window.location?xn(Hr(this,Yi),new URL(window.location.href),``):typeof Hr(this,Yi)==`function`?mn.throw(jn):Hr(this,Yi)||``}get proxyUrl(){return typeof window<`u`&&window.location?xn(Hr(this,Xi),new URL(window.location.href),``):typeof Hr(this,Xi)==`function`?mn.throw(jn):Hr(this,Xi)||``}__internal_getOption(e){return this.clerkjs?.__internal_getOption?this.clerkjs?.__internal_getOption(e):this.options[e]}loadHeadlessClerk(){let e=Qn(this.options.Clerk)?new this.options.Clerk(Hr(this,Zi),{proxyUrl:this.proxyUrl,domain:this.domain}):this.options.Clerk;if(!e){Hr(this,Qi).emit(ni.Status,`error`);return}let t=()=>{this.replayInterceptedInvocations(e)};e.loaded?t():e.load(this.options).then(()=>t()).catch(e=>{Hr(this,Qi).emit(ni.Status,`error`),this.emitLoaded()})}get sdkMetadata(){return this.clerkjs?.sdkMetadata||this.options.sdkMetadata||void 0}get instanceType(){return this.clerkjs?.instanceType}get frontendApi(){return this.clerkjs?.frontendApi||``}get isStandardBrowser(){return this.clerkjs?.isStandardBrowser||this.options.standardBrowser||!1}get isSatellite(){return typeof window<`u`&&window.location?xn(this.options.isSatellite,new URL(window.location.href),!1):typeof this.options.isSatellite==`function`?mn.throw(jn):!1}async getEntryChunks(){if(!(this.mode!==`browser`||this.loaded)){typeof window<`u`&&(window.__clerk_publishable_key=Hr(this,Zi),window.__clerk_proxy_url=this.proxyUrl,window.__clerk_domain=this.domain);try{let e=await this.getClerkJsEntryChunk();if(!e.loaded){this.beforeLoad(e);let t=this.options.standardBrowser!==!1&&!this.options.Clerk||this.options.ui?.ClerkUI?await this.getClerkUIEntryChunk():void 0;await e.load({...this.options,ui:{...this.options.ui,ClerkUI:t}})}e.loaded&&this.replayInterceptedInvocations(e)}catch(e){let t=e;Hr(this,Qi).emit(ni.Status,`error`),console.error(t.stack||t.message||t);return}}}async getClerkJsEntryChunk(){if((!this.options.Clerk||this.options.__internal_clerkJSUrl)&&!__BUILD_DISABLE_RHC__&&await Di({...this.options,publishableKey:Hr(this,Zi),proxyUrl:this.proxyUrl,domain:this.domain,nonce:this.options.nonce}
16),this.options.Clerk&&!this.options.__internal_clerkJSUrl&&(global.Clerk=Qn(this.options.Clerk)?new this.options.Clerk(Hr(this,Zi),{proxyUrl:this.proxyUrl,domain:this.domain}):this.options.Clerk),!global.Clerk)throw Error(`Failed to download latest ClerkJS. Contact [email protected].`);return global.Clerk}async getClerkUIEntryChunk(){let e=this.options.ui,t=!!this.options.__internal_clerkUIUrl;if(e?.ClerkUI&&!t)return e.ClerkUI;if(!((e||this.options.prefetchUI===!1)&&!t)){if(await Oi({...this.options,publishableKey:Hr(this,Zi),proxyUrl:this.proxyUrl,domain:this.domain,nonce:this.options.nonce}),!global.__internal_ClerkUICtor)throw Error(`Failed to download latest Clerk UI. Contact [email protected].`);return global.__internal_ClerkUICtor}}get version(){return this.clerkjs?.version}get client(){if(this.clerkjs)return this.clerkjs.client}get session(){if(this.clerkjs)return this.clerkjs.session}get user(){if(this.clerkjs)return this.clerkjs.user}get organization(){if(this.clerkjs)return this.clerkjs.organization}get telemetry(){if(this.clerkjs)return this.clerkjs.telemetry}get __internal_environment(){if(this.clerkjs)return this.clerkjs.__internal_environment}get isSignedIn(){return this.clerkjs?this.clerkjs.isSignedIn:!1}get billing(){return this.clerkjs?.billing}get __internal_state(){return this.loaded&&this.clerkjs?this.clerkjs.__internal_state:Hr(this,$i)}get apiKeys(){return this.clerkjs?.apiKeys}get oauthApplication(){return this.clerkjs?.oauthApplication}__internal_setEnvironment(...e){if(this.clerkjs&&`__internal_setEnvironment`in this.clerkjs)this.clerkjs.__internal_setEnvironment(e);else return}get __internal_lastEmittedResources(){return this.clerkjs?.__internal_lastEmittedResources}};Ji=new WeakMap,Yi=new WeakMap,Xi=new WeakMap,Zi=new WeakMap,Qi=new WeakMap,$i=new WeakMap,ea=new WeakMap,ta=new WeakSet,na=function(){return new Promise(e=>{this.addOnLoaded(()=>e(this.clerkjs))})},Ur(ra,ea);var ia=ra;function aa(e){let{initialState:t,children:n,...r}=e,{isomorphicClerk:i,clerkStatus:a}=ca(Zn(r));return d.createElement(Jt,{initialState:t,clerk:i,clerkStatus:a},n)}var oa=tr(aa,`ClerkProvider`,kn);oa.displayName=`ClerkProvider`;var sa=Bi?`shared`:``,ca=e=>{let t=d.useMemo(()=>({clerkUIVariant:sa,...e}),[e]),n=d.useRef(ia.getOrCreateInstance(t)),[r,i]=d.useState(n.current.status);return d.useEffect(()=>{n.current.__internal_updateProps({appearance:e.appearance})},[e.appearance]),d.useEffect(()=>{n.current.__internal_updateProps({options:e})},[e.localization]),d.useEffect(()=>(n.current.on(`status`,i),()=>{n.current&&n.current.off(`status`,i),ia.clearInstance()}),[]),{isomorphicClerk:n.current,clerkStatus:r}},R=r(i(),1);if(typeof window<`u`&&!window.global&&(window.global=typeof global>`u`?window:global),globalThis.__clerkSharedModules){let e=globalThis.__clerkSharedModules.react?.version;e&&e!==`19.2.6`&&console.warn(`[@clerk/ui/register] React version mismatch detected. Already registered: ${e}, current import: 19.2.6. This may cause issues with the shared @clerk/ui variant.`)}else globalThis.__clerkSharedModules={react:d,"react-dom":Dn,"react-dom/client":f,"react/jsx-runtime":R};var la=Sr(({clerk:e,children:t,...n})=>{let{appearance:r,getContainer:i,component:a,signUpFallbackRedirectUrl:o,forceRedirectUrl:s,fallbackRedirectUrl:c,signUpForceRedirectUrl:l,mode:u,initialValues:f,withSignUp:p,oauthFlow:m,...h}=n;t=qn(t,`Sign in`);let g=Kn(t)(`SignInButton`),_=()=>{let t={forceRedirectUrl:s,fallbackRedirectUrl:c,signUpFallbackRedirectUrl:o,signUpForceRedirectUrl:l,initialValues:f,withSignUp:p,oauthFlow:m};return u===`modal`?e.openSignIn({...t,appearance:r,getContainer:i}):e.redirectToSignIn({...t,signInFallbackRedirectUrl:c,signInForceRedirectUrl:s})},v=async e=>(g&&typeof g==`object`&&`props`in g&&await Jn(g.props.onClick)(e),_()),y={...h,onClick:v};return d.cloneElement(g,y)},{component:`SignInButton`,renderWhileLoading:!0});Sr(({clerk:e,children:t,...n})=>{let{redirectUrl:r,getContainer:i,component:a,...o}=n;t=qn(t,`Sign in with Metamask`);let s=Kn(t)(`SignInWithMetamaskButton`),c=async()=>{async function t(){await e.authenticateWithMetamask({redirectUrl:r||void 0})}t()},l=async e=>(await Jn(s.props.onClick)(e),c()),u={...o,onClick:l};return d.cloneElement(s,u)},{component:`SignInWithMetamask`,renderWhileLoading:!0}),Sr(({clerk:e,children:t,...n})=>{let{redirectUrl:r=`/`,sessionId:i,signOutOptions:a,getContainer:o,component:s,...c}=n;a&&Jr("SignOutButton `signOutOptions`","Use the `redirectUrl` and `sessionId` props directly instead."),t=qn(t,`Sign out`);let l=Kn(t)(`SignOutButton`),u=()=>e.signOut({redirectUrl:r,...i!==void 0&&{sessionId:i},...a}
16),f=async e=>(await Jn(l.props.onClick)(e),u()),p={...c,onClick:f};return d.cloneElement(l,p)},{component:`SignOutButton`,renderWhileLoading:!0}),Sr(({clerk:e,children:t,...n})=>{let{appearance:r,unsafeMetadata:i,getContainer:a,component:o,fallbackRedirectUrl:s,forceRedirectUrl:c,signInFallbackRedirectUrl:l,signInForceRedirectUrl:u,mode:f,initialValues:p,oauthFlow:m,...h}=n;t=qn(t,`Sign up`);let g=Kn(t)(`SignUpButton`),_=()=>{let t={fallbackRedirectUrl:s,forceRedirectUrl:c,signInFallbackRedirectUrl:l,signInForceRedirectUrl:u,initialValues:p,oauthFlow:m};return f===`modal`?e.openSignUp({...t,appearance:r,unsafeMetadata:i,getContainer:a}):e.redirectToSignUp({...t,signUpFallbackRedirectUrl:s,signUpForceRedirectUrl:c})},v=async e=>(g&&typeof g==`object`&&`props`in g&&await Jn(g.props.onClick)(e),_()),y={...h,onClick:v};return d.cloneElement(g,y)},{component:`SignUpButton`,renderWhileLoading:!0}),hn({packageName:`@clerk/react`}),Ri(`@clerk/react`);var ua=`modulepreload`,da=function(e){return`/`+e},fa={},pa=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}r=o(t.map(t=>{if(t=da(t,n),t in fa)return;fa[t]=!0;let r=t.endsWith(`.css`),i=r?`[rel="stylesheet"]`:``;if(n)for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.href===t&&(!r||i.rel===`stylesheet`))return}else if(document.querySelector(`link[href="${t}"]${i}`))return;let o=document.createElement(`link`);if(o.rel=r?`stylesheet`:ua,r||(o.as=`script`),o.crossOrigin=``,o.href=t,a&&o.setAttribute(`nonce`,a),document.head.appendChild(o),r)return new Promise((e,n)=>{o.addEventListener(`load`,e),o.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},ma=`popstate`;function ha(e){return typeof e==`object`&&!!e&&`pathname`in e&&`search`in e&&`hash`in e&&`state`in e&&`key`in e}function ga(e={}){function t(e,t){let n=t.state?.masked,{pathname:r,search:i,hash:a}=n||e.location;return xa(``,{pathname:r,search:i,hash:a},t.state&&t.state.usr||null,t.state&&t.state.key||`default`,n?{pathname:e.location.pathname,search:e.location.search,hash:e.location.hash}:void 0)}function n(e,t){return typeof t==`string`?t:Sa(t)}return wa(t,n,null,e)}function _a(e,t){if(e===!1||e==null)throw Error(t)}function va(e,t){if(!e){typeof console<`u`&&console.warn(t);try{throw Error(t)}catch{}}}function ya(){return Math.random().toString(36).substring(2,10)}function ba(e,t){return{usr:e.state,key:e.key,idx:t,masked:e.mask?{pathname:e.pathname,search:e.search,hash:e.hash}:void 0}}function xa(e,t,n=null,r,i){return{pathname:typeof e==`string`?e:e.pathname,search:``,hash:``,...typeof t==`string`?Ca(t):t,state:n,key:t&&t.key||r||ya(),mask:i}}function Sa({pathname:e=`/`,search:t=``,hash:n=``}){return t&&t!==`?`&&(e+=t.charAt(0)===`?`?t:`?`+t),n&&n!==`#`&&(e+=n.charAt(0)===`#`?n:`#`+n),e}function Ca(e){let t={};if(e){let n=e.indexOf(`#`);n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let r=e.indexOf(`?`);r>=0&&(t.search=e.substring(r),e=e.substring(0,r)),e&&(t.pathname=e)}return t}function wa(e,t,n,r={}){let{window:i=document.defaultView,v5Compat:a=!1}=r,o=i.history,s=`POP`,c=null,l=u();l??(l=0,o.replaceState({...o.state,idx:l},``));function u(){return(o.state||{idx:null}).idx}function d(){s=`POP`;let e=u(),t=e==null?null:e-l;l=e,c&&c({action:s,location:h.location,delta:t})}function f(e,t){s=`PUSH`;let r=ha(e)?e:xa(h.location,e,t);n&&n(r,e),l=u()+1;let d=ba(r,l),f=h.createHref(r.mask||r);try{o.pushState(d,``,f)}catch(e){if(e instanceof DOMException&&e.name===`DataCloneError`)throw e;i.location.assign(f)}a&&c&&c({action:s,location:h.location,delta:1})}function p(e,t){s=`REPLACE`;let r=ha(e)?e:xa(h.location,e,t);n&&n(r,e),l=u();let i=ba(r,l),d=h.createHref(r.mask||r);o.replaceState(i,``,d),a&&c&&c({action:s,location:h.location,delta:0})}function m(e){return Ta(e)}let h={get action(){return s},get location(){return e(i,o)},listen(e){if(c)throw Error(`A history only accepts one active listener`);return i.addEventListener(ma,d),c=e,()=>{i.removeEventListener(ma,d),c=null}},createHref(e){return t(i,e)},createURL:m,encodeLocation(e){let t=m(e);return{pathname:t.pathname,search:t.search,hash:t.hash}},push:f,replace:p,go(e){return o.go(e)}};return h}function Ta(e,t=!1){let n=`http://localhost`;typeof window<`u`&&(n=window.location.origin===`null`?window.location.href:window.location.origin),_a(n,`No window.location.(origin|href) available to create URL`);let r=typeof e==`string`?e:Sa(e);return r=r.replace(/ $/,`%20`),!t&&r.startsWith(`//`)&&(r=n+r),new URL(r,n)}function Ea(e,t,n=`/`){return Da(e,t,n,!1)}function Da(e,t,n,r,i){let a=Ka((typeof t==`string`?Ca(t):t).pathname||`/`,n);if(a==null)return null;let o=i??ka(e),s=null,c=Ga(a);for(let e=0;s==null&&e<o.length;++e)s=Ha(o[e],c,r);return s}function Oa(e,t){let{route:n,pathname:r,params:i}=e;return{id:n.id,pathname:r,params:i,data:t[n.id],loaderData:t[n.id],handle:n.handle}}function ka(e){let t=Aa(e);return Ma(t),t}function Aa(e,t=[],n=[],r=``,i=!1){let a=(e,a,o=i,s)=>{let c={relativePath:s===void 0?e.path||``:s,caseSensitive:e.caseSensitive===!0,childrenIndex:a,route:e};if(c.relativePath.startsWith(`/`)){if(!c.relativePath.startsWith(r)&&o)return;_a(c.relativePath.startsWith(r),`Absolute route path "${c.relativePath}" nested under path "${r}
16" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),c.relativePath=c.relativePath.slice(r.length)}let l=to([r,c.relativePath]),u=n.concat(c);e.children&&e.children.length>0&&(_a(e.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${l}".`),Aa(e.children,t,u,l,o)),!(e.path==null&&!e.index)&&t.push({path:l,score:Ba(l,e.index),routesMeta:u})};return e.forEach((e,t)=>{if(e.path===``||!e.path?.includes(`?`))a(e,t);else for(let n of ja(e.path))a(e,t,!0,n)}),t}function ja(e){let t=e.split(`/`);if(t.length===0)return[];let[n,...r]=t,i=n.endsWith(`?`),a=n.replace(/\?$/,``);if(r.length===0)return i?[a,``]:[a];let o=ja(r.join(`/`)),s=[];return s.push(...o.map(e=>e===``?a:[a,e].join(`/`))),i&&s.push(...o),s.map(t=>e.startsWith(`/`)&&t===``?`/`:t)}function Ma(e){e.sort((e,t)=>e.score===t.score?Va(e.routesMeta.map(e=>e.childrenIndex),t.routesMeta.map(e=>e.childrenIndex)):t.score-e.score)}var Na=/^:[\w-]+$/,Pa=3,Fa=2,Ia=1,La=10,Ra=-2,za=e=>e===`*`;function Ba(e,t){let n=e.split(`/`),r=n.length;return n.some(za)&&(r+=Ra),t&&(r+=Fa),n.filter(e=>!za(e)).reduce((e,t)=>e+(Na.test(t)?Pa:t===``?Ia:La),r)}function Va(e,t){return e.length===t.length&&e.slice(0,-1).every((e,n)=>e===t[n])?e[e.length-1]-t[t.length-1]:0}function Ha(e,t,n=!1){let{routesMeta:r}=e,i={},a=`/`,o=[];for(let e=0;e<r.length;++e){let s=r[e],c=e===r.length-1,l=a===`/`?t:t.slice(a.length)||`/`,u=Ua({path:s.relativePath,caseSensitive:s.caseSensitive,end:c},l),d=s.route;if(!u&&c&&n&&!r[r.length-1].route.index&&(u=Ua({path:s.relativePath,caseSensitive:s.caseSensitive,end:!1},l)),!u)return null;
16Object.assign(i,u.params),o.push({params:i,pathname:to([a,u.pathname]),pathnameBase:ro(to([a,u.pathnameBase])),route:d}),u.pathnameBase!==`/`&&(a=to([a,u.pathnameBase]))}return o}function Ua(e,t){typeof e==`string`&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=Wa(e.path,e.caseSensitive,e.end),i=t.match(n);if(!i)return null;let a=i[0],o=a.replace(/(.)\/+$/,`$1`),s=i.slice(1);return{params:r.reduce((e,{paramName:t,isOptional:n},r)=>{if(t===`*`){let e=s[r]||``;o=a.slice(0,a.length-e.length).replace(/(.)\/+$/,`$1`)}let i=s[r];return n&&!i?e[t]=void 0:e[t]=(i||``).replace(/%2F/g,`/`),e},{}),pathname:a,pathnameBase:o,pattern:e}}function Wa(e,t=!1,n=!0){va(e===`*`||!e.endsWith(`*`)||e.endsWith(`/*`),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,`/*`)}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,`/*`)}".`);let r=[],i=`^`+e.replace(/\/*\*?$/,``).replace(/^\/*/,`/`).replace(/[\\.*+^${}|()[\]]/g,`\\$&`).replace(/\/:([\w-]+)(\?)?/g,(e,t,n,i,a)=>{if(r.push({paramName:t,isOptional:n!=null}),n){let t=a.charAt(i+e.length);return t&&t!==`/`?`/([^\\/]*)`:`(?:/([^\\/]*))?`}return`/([^\\/]+)`}).replace(/\/([\w-]+)\?(\/|$)/g,`(/$1)?$2`);return e.endsWith(`*`)?(r.push({paramName:`*`}),i+=e===`*`||e===`/*`?`(.*)$`:`(?:\\/(.+)|\\/*)$`):n?i+=`\\/*$`:e!==``&&e!==`/`&&(i+=`(?:(?=\\/|$))`),[new RegExp(i,t?void 0:`i`),r]}function Ga(e){try{return e.split(`/`).map(e=>decodeURIComponent(e).replace(/\//g,`%2F`)).join(`/`)}catch(t){return va(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function Ka(e,t){if(t===`/`)return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith(`/`)?t.length-1:t.length,r=e.charAt(n);return r&&r!==`/`?null:e.slice(n)||`/`}var qa=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function Ja(e,t=`/`){let{pathname:n,search:r=``,hash:i=``}=typeof e==`string`?Ca(e):e,a;return n?(n=eo(n),a=n.startsWith(`/`)?Ya(n.substring(1),`/`):Ya(n,t)):a=t,{pathname:a,search:io(r),hash:ao(i)}}function Ya(e,t){let n=no(t).split(`/`);return e.split(`/`).forEach(e=>{e===`..`?n.length>1&&n.pop():e!==`.`&&n.push(e)}),n.length>1?n.join(`/`):`/`}function Xa(e,t,n,r){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(r)}].  Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function Za(e){return e.filter((e,t)=>t===0||e.route.path&&e.route.path.length>0)}function Qa(e){let t=Za(e);return t.map((e,n)=>n===t.length-1?e.pathname:e.pathnameBase)}function $a(e,t,n,r=!1){let i;typeof e==`string`?i=Ca(e):(i={...e},_a(!i.pathname||!i.pathname.includes(`?`),Xa(`?`,`pathname`,`search`,i)),_a(!i.pathname||!i.pathname.includes(`#`),Xa(`#`,`pathname`,`hash`,i)),_a(!i.search||!i.search.includes(`#`),Xa(`#`,`search`,`hash`,i)));let a=e===``||i.pathname===``,o=a?`/`:i.pathname,s;if(o==null)s=n;else{let e=t.length-1;if(!r&&o.startsWith(`..`)){let t=o.split(`/`);for(;t[0]===`..`;)t.shift(),--e;i.pathname=t.join(`/`)}s=e>=0?t[e]:`/`}let c=Ja(i,s),l=o&&o!==`/`&&o.endsWith(`/`),u=(a||o===`.`)&&n.endsWith(`/`);return!c.pathname.endsWith(`/`)&&(l||u)&&(c.pathname+=`/`),c}var eo=e=>e.replace(/\/\/+/g,`/`),to=e=>eo(e.join(`/`)),no=e=>e.replace(/\/+$/,``),ro=e=>no(e).replace(/^\/*/,`/`),io=e=>!e||e===`?`?``:e.startsWith(`?`)?e:`?`+e,ao=e=>!e||e===`#`?``:e.startsWith(`#`)?e:`#`+e,oo=class{constructor(e,t,n,r=!1){this.status=e,this.statusText=t||``,this.internal=r,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}};function so(e){return e!=null&&typeof e.status==`number`&&typeof e.statusText==`string`&&typeof e.internal==`boolean`&&`data`in e}function co(e){return to(e.map(e=>e.route.path).filter(Boolean))||`/`}var lo=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;function uo(e,t){let n=e;if(typeof n!=`string`||!qa.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let r=n,i=!1;if(lo)try{let e=new URL(window.location.href),r=n.startsWith(`//`)?new URL(e.protocol+n):new URL(n),a=Ka(r.pathname,t);r.origin===e.origin&&a!=null?n=a+r.search+r.hash:i=!0}catch{va(!1,`<Link to="${n}">
16 contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:r,isExternal:i,to:n}}Object.getOwnPropertyNames(Object.prototype).sort().join(`\0`);var fo=[`POST`,`PUT`,`PATCH`,`DELETE`];new Set(fo);var po=[`GET`,...fo];new Set(po);var mo=d.createContext(null);mo.displayName=`DataRouter`;var ho=d.createContext(null);ho.displayName=`DataRouterState`;var go=d.createContext(!1);function _o(){return d.useContext(go)}var vo=d.createContext({isTransitioning:!1});vo.displayName=`ViewTransition`;var yo=d.createContext(new Map);yo.displayName=`Fetchers`;var bo=d.createContext(null);bo.displayName=`Await`;var xo=d.createContext(null);xo.displayName=`Navigation`;var So=d.createContext(null);So.displayName=`Location`;var Co=d.createContext({outlet:null,matches:[],isDataRoute:!1});Co.displayName=`Route`;var wo=d.createContext(null);wo.displayName=`RouteError`;var To=`REACT_ROUTER_ERROR`,Eo=`REDIRECT`,Do=`ROUTE_ERROR_RESPONSE`;function Oo(e){if(e.startsWith(`${To}:${Eo}:{`))try{let t=JSON.parse(e.slice(28));if(typeof t==`object`&&t&&typeof t.status==`number`&&typeof t.statusText==`string`&&typeof t.location==`string`&&typeof t.reloadDocument==`boolean`&&typeof t.replace==`boolean`)return t}catch{}}function ko(e){if(e.startsWith(`${To}:${Do}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t==`object`&&t&&typeof t.status==`number`&&typeof t.statusText==`string`)return new oo(t.status,t.statusText,t.data)}catch{}}function Ao(e,{relative:t}={}){_a(jo(),`useHref() may be used only in the context of a <Router> component.`);let{basename:n,navigator:r}=d.useContext(xo),{hash:i,pathname:a,search:o}=Ro(e,{relative:t}),s=a;return n!==`/`&&(s=a===`/`?n:to([n,a])),r.createHref({pathname:s,search:o,hash:i})}function jo(){return d.useContext(So)!=null}
16function Mo(){return _a(jo(),`useLocation() may be used only in the context of a <Router> component.`),d.useContext(So).location}var No=`You should call navigate() in a React.useEffect(), not when your component is first rendered.`;function Po(e){d.useContext(xo).static||d.useLayoutEffect(e)}function Fo(){let{isDataRoute:e}=d.useContext(Co);return e?rs():Io()}function Io(){_a(jo(),`useNavigate() may be used only in the context of a <Router> component.`);let e=d.useContext(mo),{basename:t,navigator:n}=d.useContext(xo),{matches:r}=d.useContext(Co),{pathname:i}=Mo(),a=JSON.stringify(Qa(r)),o=d.useRef(!1);return Po(()=>{o.current=!0}),d.useCallback((r,s={})=>{if(va(o.current,No),!o.current)return;if(typeof r==`number`){n.go(r);return}let c=$a(r,JSON.parse(a),i,s.relative===`path`);e==null&&t!==`/`&&(c.pathname=c.pathname===`/`?t:to([t,c.pathname])),(s.replace?n.replace:n.push)(c,s.state,s)},[t,n,a,i,e])}d.createContext(null);function Lo(){let{matches:e}=d.useContext(Co);return e[e.length-1]?.params??{}}function Ro(e,{relative:t}={}){let{matches:n}=d.useContext(Co),{pathname:r}=Mo(),i=JSON.stringify(Qa(n));return d.useMemo(()=>$a(e,JSON.parse(i),r,t===`path`),[e,i,r,t])}function zo(e,t){return Bo(e,t)}function Bo(e,t,n){_a(jo(),`useRoutes() may be used only in the context of a <Router> component.`);let{navigator:r}=d.useContext(xo),{matches:i}=d.useContext(Co),a=i[i.length-1],o=a?a.params:{},s=a?a.pathname:`/`,c=a?a.pathnameBase:`/`,l=a&&a.route;{let e=l&&l.path||``;as(s,!l||e.endsWith(`*`)||e.endsWith(`*?`),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${s}" (under <Route path="${e}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
17
18Please change the parent <Route path="${e}"> to <Route path="${e===`/`?`*`:`${e}/*`}">.`)}let u=Mo(),f;if(t){let e=typeof t==`string`?Ca(t):t;_a(c===`/`||e.pathname?.startsWith(c),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${c}" but pathname "${e.pathname}" was given in the \`location\` prop.`),f=e}else f=u;let p=f.pathname||`/`,m=p;if(c!==`/`){let e=c.replace(/^\//,``).split(`/`);m=`/`+p.replace(/^\//,``).split(`/`).slice(e.length).join(`/`)}let h=n&&n.state.matches.length?n.state.matches.map(e=>Object.assign(e,{route:n.manifest[e.route.id]||e.route})):Ea(e,{pathname:m});va(l||h!=null,`No routes matched location "${f.pathname}${f.search}${f.hash}" `),va(h==null||h[h.length-1].route.element!==void 0||h[h.length-1].route.Component!==void 0||h[h.length-1].route.lazy!==void 0,`Matched leaf route at location "${f.pathname}${f.search}${f.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let g=qo(h&&h.map(e=>Object.assign({},e,{params:Object.assign({},o,e.params),pathname:to([c,r.encodeLocation?r.encodeLocation(e.pathname.replace(/%/g,`%25`).replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathname]),pathnameBase:e.pathnameBase===`/`?c:to([c,r.encodeLocation?r.encodeLocation(e.pathnameBase.replace(/%/g,`%25`).replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathnameBase])})),i,n);return t&&g?d.createElement(So.Provider,{value:{location:{pathname:`/`,search:``,hash:``,state:null,key:`default`,mask:void 0,...f},navigationType:`POP`}},g):g}function Vo(){let e=ns(),t=so(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,r=`rgba(200,200,200, 0.5)`,i={padding:`0.5rem`,backgroundColor:r},a={padding:`2px 4px`,backgroundColor:r},o=null;return console.error(`Error handled by React Router default ErrorBoundary:`,e),o=d.createElement(d.Fragment,null,d.createElement(`p`,null,`💿 Hey developer 👋`),d.createElement(`p`,null,`You can provide a way better UX than this when your app throws errors by providing your own `,d.createElement(`code`,{style:a},`ErrorBoundary`),` or`,` `,d.createElement(`code`,{style:a},`errorElement`),` prop on your route.`)),d.createElement(d.Fragment,null,d.createElement(`h2`,null,`Unexpected Application 
18Error!`),d.createElement(`h3`,{style:{fontStyle:`italic`}},t),n?d.createElement(`pre`,{style:i},n):null,o)}var Ho=d.createElement(Vo,null),Uo=class extends d.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!==`idle`&&e.revalidation===`idle`?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error===void 0?t.error:e.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):console.error(`React Router caught the following error during render`,e)}render(){let e=this.state.error;if(this.context&&typeof e==`object`&&e&&`digest`in e&&typeof e.digest==`string`){let t=ko(e.digest);t&&(e=t)}let t=e===void 0?this.props.children:d.createElement(Co.Provider,{value:this.props.routeContext},d.createElement(wo.Provider,{value:e,children:this.props.component}));return this.context?d.createElement(Go,{error:e},t):t}};Uo.contextType=go;var Wo=new WeakMap;function Go({children:e,error:t}){let{basename:n}=d.useContext(xo);if(typeof t==`object`&&t&&`digest`in t&&typeof t.digest==`string`){let e=Oo(t.digest);if(e){let r=Wo.get(t);if(r)throw r;let i=uo(e.location,n);if(lo&&!Wo.get(t))if(i.isExternal||e.reloadDocument)window.location.href=i.absoluteURL||i.to;else{let n=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(i.to,{replace:e.replace}));throw Wo.set(t,n),n}return d.createElement(`meta`,{httpEquiv:`refresh`,content:`0;url=${i.absoluteURL||i.to}`})}}return e}function Ko({routeContext:e,match:t,children:n}){let r=d.useContext(mo);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),d.createElement(Co.Provider,{value:e},n)}function qo(e,t=[],n){let r=n?.state;if(e==null){if(!r)return null;if(r.errors)e=r.matches;else if(t.length===0&&!r.initialized&&r.matches.length>0)e=r.matches;else return null}let i=e,a=r?.errors;if(a!=null){let e=i.findIndex(e=>e.route.id&&a?.[e.route.id]!==void 0);_a(e>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(a).join(`,`)}`),i=i.slice(0,Math.min(i.length,e+1))}let o=!1,s=-1;if(n&&r){o=r.renderFallback;for(let e=0;e<i.length;e++){let t=i[e];if((t.route.HydrateFallback||t.route.hydrateFallbackElement)&&(s=e),t.route.id){let{loaderData:e,errors:a}=r,c=t.route.loader&&!e.hasOwnProperty(t.route.id)&&(!a||a[t.route.id]===void 0);if(t.route.lazy||c){n.isStatic&&(o=!0),i=s>=0?i.slice(0,s+1):[i[0]];break}}}}let c=n?.onError,l=r&&c?(e,t)=>{c(e,{location:r.location,params:r.matches?.[0]?.params??{},pattern:co(r.matches),errorInfo:t})}:void 0;return i.reduceRight((e,n,c)=>{let u,f=!1,p=null,m=null;r&&(u=a&&n.route.id?a[n.route.id]:void 0,p=n.route.errorElement||Ho,o&&(s<0&&c===0?(as(`route-fallback`,!1,"No `HydrateFallback` element provided to render during initial hydration"),f=!0,m=null):s===c&&(f=!0,m=n.route.hydrateFallbackElement||null)));let h=t.concat(i.slice(0,c+1)),g=()=>{let t;return t=u?p:f?m:n.route.Component?d.createElement(n.route.Component,null):n.route.element?n.route.element:e,d.createElement(Ko,{match:n,routeContext:{outlet:e,matches:h,isDataRoute:r!=null},children:t})};return r&&(n.route.ErrorBoundary||n.route.errorElement||c===0)?d.createElement(Uo,{location:r.location,revalidation:r.revalidation,component:p,error:u,children:g(),routeContext:{outlet:null,matches:h,isDataRoute:!0},onError:l}):g()},null)}function Jo(e){return`${e} must be used within a data router.  See https://reactrouter.com/en/main/routers/picking-a-router.`}function Yo(e){let t=d.useContext(mo);return _a(t,Jo(e)),t}function Xo(e){let t=d.useContext(ho);return _a(t,Jo(e)),t}function Zo(e){let t=d.useContext(Co);return _a(t,Jo(e)),t}function Qo(e){let t=Zo(e),n=t.matches[t.matches.length-1];return _a(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function $o(){return Qo(`useRouteId`)}function es(){let e=Xo(`useNavigation`);return d.useMemo(()=>{let{matches:t,historyAction:n,...r}=e.navigation;return r},[e.navigation])}function ts(){let{matches:e,loaderData:t}=Xo(`useMatches`);return d.useMemo(()=>e.map(e=>Oa(e,t)),[e,t])}function ns(){let e=d.useContext(wo),t=Xo(`useRouteError`),n=Qo(`useRouteError`);return e===void 0?t.errors?.[n]:e}function rs(){let{router:e}=Yo(`useNavigate`),t=Qo(`useNavigate`),n=d.useRef(!1);return Po(()=>{n.current=!0}),d.useCallback(async(r,i={})=>
18{va(n.current,No),n.current&&(typeof r==`number`?await e.navigate(r):await e.navigate(r,{fromRouteId:t,...i}))},[e,t])}var is={};function as(e,t,n){!t&&!is[e]&&(is[e]=!0,va(!1,n))}d.memo(os);function os({routes:e,manifest:t,future:n,state:r,isStatic:i,onError:a}){return Bo(e,void 0,{manifest:t,state:r,isStatic:i,onError:a,future:n})}function ss({to:e,replace:t,state:n,relative:r}){_a(jo(),`<Navigate> may be used only in the context of a <Router> component.`);let{static:i}=d.useContext(xo);va(!i,`<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.`);let{matches:a}=d.useContext(Co),{pathname:o}=Mo(),s=Fo(),c=$a(e,Qa(a),o,r===`path`),l=JSON.stringify(c);return d.useEffect(()=>{s(JSON.parse(l),{replace:t,state:n,relative:r})},[s,l,r,t,n]),null}function cs(e){_a(!1,`A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.`)}function ls({basename:e=`/`,children:t=null,location:n,navigationType:r=`POP`,navigator:i,static:a=!1,useTransitions:o}){_a(!jo(),`You cannot render a <Router> inside another <Router>. You should never have more than one in your app.`);let s=e.replace(/^\/*/,`/`),c=d.useMemo(()=>({basename:s,navigator:i,static:a,useTransitions:o,future:{}}),[s,i,a,o]);typeof n==`string`&&(n=Ca(n));let{pathname:l=`/`,search:u=``,hash:f=``,state:p=null,key:m=`default`,mask:h}=n,g=d.useMemo(()=>{let e=Ka(l,s);return e==null?null:{location:{pathname:e,search:u,hash:f,state:p,key:m,mask:h},navigationType:r}},[s,l,u,f,p,m,r,h]);return va(g!=null,`<Router basename="${s}"> is not able to match the URL "${l}${u}${f}" because it does not start with the basename, so the <Router> won't render anything.`),g==null?null:d.createElement(xo.Provider,{value:c},d.createElement(So.Provider,{children:t,value:g}))}function us({children:e,location:t}){return zo(ds(e),t)}d.Component;function ds(e,t=[]){let n=[];return d.Children.forEach(e,(e,r)=>{if(!d.isValidElement(e))return;let i=[...t,r];if(e.type===d.Fragment){n.push.apply(n,ds(e.props.children,i));return}_a(e.type===cs,`[${typeof e.type==`string`?e.type:e.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),_a(!e.props.index||!e.props.children,`An index route cannot have child routes.`);let a={id:e.props.id||i.join(`-`),caseSensitive:e.props.caseSensitive,element:e.props.element,Component:e.props.Component,index:e.props.index,path:e.props.path,middleware:e.props.middleware,loader:e.props.loader,action:e.props.action,hydrateFallbackElement:e.props.hydrateFallbackElement,HydrateFallback:e.props.HydrateFallback,errorElement:e.props.errorElement,ErrorBoundary:e.props.ErrorBoundary,hasErrorBoundary:e.props.hasErrorBoundary===!0||e.props.ErrorBoundary!=null||e.props.errorElement!=null,shouldRevalidate:e.props.shouldRevalidate,handle:e.props.handle,lazy:e.props.lazy};e.props.children&&(a.children=ds(e.props.children,i)),n.push(a)}),n}var fs=`get`,ps=`application/x-www-form-urlencoded`;function ms(e){return typeof HTMLElement<`u`&&e instanceof HTMLElement}function hs(e){return ms(e)&&e.tagName.toLowerCase()===`button`}function gs(e){return ms(e)&&e.tagName.toLowerCase()===`form`}function _s(e){return ms(e)&&e.tagName.toLowerCase()===`input`}function vs(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function ys(e,t){return e.button===0&&(!t||t===`_self`)&&!vs(e)}var bs=null;function xs(){if(bs===null)try{new FormData(document.createElement(`form`),0),bs=!1}catch{bs=!0}return bs}var Ss=new Set([`application/x-www-form-urlencoded`,`multipart/form-data`,`text/plain`]);function Cs(e){return e!=null&&!Ss.has(e)?(va(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${ps}"`),null):e}function ws(e,t){let n,r,i,a,o;if(gs(e)){let o=e.getAttribute(`action`);r=o?Ka(o,t):null,n=e.getAttribute(`method`)||fs,i=Cs(e.getAttribute(`enctype`))||ps,a=new FormData(e)}else if(hs(e)||_s(e)&&(e.type===`submit`||e.type===`image`)){let o=e.form;if(o==null)throw Error(`Cannot submit a <button> or <input type="submit"> without a <form>`);let s=e.getAttribute(`formaction`)||o.getAttribute(`action`);if(r=s?Ka(s,t):null,n=e.getAttribute(`formmethod`)||o.getAttribute(`method`)||fs,i=Cs(e.getAttribute(`formenctype`))||Cs(o.getAttribute(`enctype`))||ps,a=new FormData(o,e),!xs()){let{name:t,type:n,value:r}=e;if(n===`image`){let e=t?`${t}.`:``;a.append(`${e}x`,`0`),a.append(`${e}y`,`0`)}else t&&a.append(t,r)}}else if(ms(e))throw Error(`Cannot submit element that is not <form>, <button>, or <input type="submit|image">`);else n=fs,r=null,i=ps,o=e;return a&&i===`text/plain`&&(o=a,a=void 0),{action:r,method:n.toLowerCase(),encType:i,formData:a,body:o}}Object.getOwnPropertyNames(Object.prototype).sort().join(`\0`);var Ts={"&":`\\u0026`,">":`\\u003e`,"<":`\\u003c`,"\u2028":`\\u2028`,"\u2029":`\\u2029`},Es=/[&><\u2028\u2029]/g;function Ds(e){return e.replace(Es,e=>Ts[e])}function Os(e,t){if(e===!1||e==null)throw Error(t)}function ks(e,t,n,r){let i=typeof e==`string`?new URL(e,typeof window>
18`u`?`server://singlefetch/`:window.location.origin):e;return n?i.pathname.endsWith(`/`)?i.pathname=`${i.pathname}_.${r}`:i.pathname=`${i.pathname}.${r}`:i.pathname===`/`?i.pathname=`_root.${r}`:t&&Ka(i.pathname,t)===`/`?i.pathname=`${no(t)}/_root.${r}`:i.pathname=`${no(i.pathname)}.${r}`,i}async function As(e,t){if(e.id in t)return t[e.id];try{let n=await pa(()=>import(e.module),[]);return t[e.id]=n,n}catch(t){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(t),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function js(e){return e!=null&&typeof e.page==`string`}function Ms(e){return e==null?!1:e.href==null?e.rel===`preload`&&typeof e.imageSrcSet==`string`&&typeof e.imageSizes==`string`:typeof e.rel==`string`&&typeof e.href==`string`}async function Ns(e,t,n){return Rs((await Promise.all(e.map(async e=>{let r=t.routes[e.route.id];if(r){let e=await As(r,n);return e.links?e.links():[]}return[]}))).flat(1).filter(Ms).filter(e=>e.rel===`stylesheet`||e.rel===`preload`).map(e=>e.rel===`stylesheet`?{...e,rel:`prefetch`,as:`style`}:{...e,rel:`prefetch`}))}function Ps(e,t,n,r,i,a){let o=(e,t)=>n[t]?e.route.id!==n[t].route.id:!0,s=(e,t)=>n[t].pathname!==e.pathname||n[t].route.path?.endsWith(`*`)&&n[t].params[`*`]!==e.params[`*`];return a===`assets`?t.filter((e,t)=>o(e,t)||s(e,t)):a===`data`?t.filter((t,a)=>{let c=r.routes[t.route.id];if(!c||!c.hasLoader)return!1;if(o(t,a)||s(t,a))return!0;if(t.route.shouldRevalidate){let r=t.route.shouldRevalidate({currentUrl:new URL(i.pathname+i.search+i.hash,window.origin),currentParams:n[0]?.params||{},nextUrl:new URL(e,window.origin),nextParams:t.params,defaultShouldRevalidate:!0});if(typeof r==`boolean`)return r}return!0}):[]}function Fs(e,t,{includeHydrateFallback:n}={}){return Is(e.map(e=>{let r=t.routes[e.route.id];if(!r)return[];let i=[r.module];return r.clientActionModule&&(i=i.concat(r.clientActionModule)),r.clientLoaderModule&&(i=i.concat(r.clientLoaderModule)),n&&r.hydrateFallbackModule&&(i=i.concat(r.hydrateFallbackModule)),r.imports&&(i=i.concat(r.imports)),i}).flat(1))}function Is(e){return[...new Set(e)]}function Ls(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function Rs(e,t){let n=new Set,r=new Set(t);return e.reduce((e,i)=>{if(t&&!js(i)&&i.as===`script`&&i.href&&r.has(i.href))return e;let a=JSON.stringify(Ls(i));return n.has(a)||(n.add(a),e.push({key:a,link:i})),e},[])}function zs(){let e=d.useContext(mo);return Os(e,`You must render this element inside a <DataRouterContext.Provider> element`),e}function Bs(){let e=d.useContext(ho);return Os(e,`You must render this element inside a <DataRouterStateContext.Provider> element`),e}var Vs=d.createContext(void 0);Vs.displayName=`FrameworkContext`;function Hs(){let e=d.useContext(Vs);return Os(e,`You must render this element inside a <HydratedRouter> element`),e}function Us(e,t){let n=d.useContext(Vs),[r,i]=d.useState(!1),[a,o]=d.useState(!1),{onFocus:s,onBlur:c,onMouseEnter:l,onMouseLeave:u,onTouchStart:f}=t,p=d.useRef(null);d.useEffect(()=>{if(e===`render`&&o(!0),e===`viewport`){let e=new IntersectionObserver(e=>{e.forEach(e=>{o(e.isIntersecting)})},{threshold:.5});return p.current&&e.observe(p.current),()=>{e.disconnect()}}},[e]),d.useEffect(()=>{if(r){let e=setTimeout(()=>{o(!0)},100);return()=>{clearTimeout(e)}}},[r]);let m=()=>{i(!0)},h=()=>{i(!1),o(!1)};return n?e===`intent`?[a,p,{onFocus:Ws(s,m),onBlur:Ws(c,h),onMouseEnter:Ws(l,m),onMouseLeave:Ws(u,h),onTouchStart:Ws(f,m)}]:[a,p,{}]:[!1,p,{}]}function Ws(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function Gs({page:e,...t}){let n=_o(),{router:r}=zs(),i=d.useMemo(()=>Ea(r.routes,e,r.basename),[r.routes,e,r.basename]);return i?n?d.createElement(qs,{page:e,matches:i,...t}):d.createElement(Js,{page:e,matches:i,...t}):null}function Ks(e){let{manifest:t,routeModules:n}=Hs(),[r,i]=d.useState([]);return d.useEffect(()=>{let r=!1;return Ns(e,t,n).then(e=>{r||i(e)}),()=>{r=!0}},[e,t,n]),r}function qs({page:e,matches:t,...n}){let r=Mo(),{future:i}=Hs(),{basename:a}=zs(),o=d.useMemo(()=>
18{if(e===r.pathname+r.search+r.hash)return[];let n=ks(e,a,i.unstable_trailingSlashAwareDataRequests,`rsc`),o=!1,s=[];for(let e of t)typeof e.route.shouldRevalidate==`function`?o=!0:s.push(e.route.id);return o&&s.length>0&&n.searchParams.set(`_routes`,s.join(`,`)),[n.pathname+n.search]},[a,i.unstable_trailingSlashAwareDataRequests,e,r,t]);return d.createElement(d.Fragment,null,o.map(e=>d.createElement(`link`,{key:e,rel:`prefetch`,as:`fetch`,href:e,...n})))}function Js({page:e,matches:t,...n}){let r=Mo(),{future:i,manifest:a,routeModules:o}=Hs(),{basename:s}=zs(),{loaderData:c,matches:l}=Bs(),u=d.useMemo(()=>Ps(e,t,l,a,r,`data`),[e,t,l,a,r]),f=d.useMemo(()=>Ps(e,t,l,a,r,`assets`),[e,t,l,a,r]),p=d.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let n=new Set,l=!1;if(t.forEach(e=>{let t=a.routes[e.route.id];!t||!t.hasLoader||(!u.some(t=>t.route.id===e.route.id)&&e.route.id in c&&o[e.route.id]?.shouldRevalidate||t.hasClientLoader?l=!0:n.add(e.route.id))}),n.size===0)return[];let d=ks(e,s,i.unstable_trailingSlashAwareDataRequests,`data`);return l&&n.size>0&&d.searchParams.set(`_routes`,t.filter(e=>n.has(e.route.id)).map(e=>e.route.id).join(`,`)),[d.pathname+d.search]},[s,i.unstable_trailingSlashAwareDataRequests,c,r,a,u,t,e,o]),m=d.useMemo(()=>Fs(f,a),[f,a]),h=Ks(f);return d.createElement(d.Fragment,null,p.map(e=>d.createElement(`link`,{key:e,rel:`prefetch`,as:`fetch`,href:e,...n})),m.map(e=>d.createElement(`link`,{key:e,rel:`modulepreload`,href:e,...n})),h.map(({key:e,link:t})=>d.createElement(`link`,{key:e,nonce:n.nonce,...t,crossOrigin:t.crossOrigin??n.crossOrigin})))}function Ys(...e){return t=>{e.forEach(e=>{typeof e==`function`?e(t):e!=null&&(e.current=t)})}}d.Component;var Xs=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;try{Xs&&(window.__reactRouterVersion=`7.15.1`)}catch{}function Zs({basename:e,children:t,useTransitions:n,window:r}){let i=d.useRef();i.current??=ga({window:r,v5Compat:!0});let a=i.current,[o,s]=d.useState({action:a.action,location:a.location}),c=d.useCallback(e=>{n===!1?s(e):d.startTransition(()=>s(e))},[n]);return d.useLayoutEffect(()=>a.listen(c),[a,c]),d.createElement(ls,{basename:e,children:t,location:o.location,navigationType:o.action,navigator:a,useTransitions:n})}function Qs({basename:e,children:t,history:n,useTransitions:r}){let[i,a]=d.useState({action:n.action,location:n.location}),o=d.useCallback(e=>{r===!1?a(e):d.startTransition(()=>a(e))},[r]);return d.useLayoutEffect(()=>n.listen(o),[n,o]),d.createElement(ls,{basename:e,children:t,location:i.location,navigationType:i.action,navigator:n,useTransitions:r})}Qs.displayName=`unstable_HistoryRouter`;var $s=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,ec=d.forwardRef(function({onClick:e,discover:t=`render`,prefetch:n=`none`,relative:r,reloadDocument:i,replace:a,mask:o,state:s,target:c,to:l,preventScrollReset:u,viewTransition:f,defaultShouldRevalidate:p,...m},h){let{basename:g,navigator:_,useTransitions:v}=d.useContext(xo),y=typeof l==`string`&&$s.test(l),b=uo(l,g);l=b.to;let x=Ao(l,{relative:r}),S=Mo(),C=null;if(o){let e=$a(o,[],S.mask?S.mask.pathname:`/`,!0);g!==`/`&&(e.pathname=e.pathname===`/`?g:to([g,e.pathname])),C=_.createHref(e)}let[w,T,E]=Us(n,m),D=sc(l,{replace:a,mask:o,state:s,target:c,preventScrollReset:u,relative:r,viewTransition:f,defaultShouldRevalidate:p,useTransitions:v});function O(t){e&&e(t),t.defaultPrevented||D(t)}let k=!(b.isExternal||i),A=d.createElement(`a`,{...m,...E,href:(k?C:void 0)||b.absoluteURL||x,onClick:k?O:e,ref:Ys(h,T),target:c,"data-discover":!y&&t===`render`?`true`:void 0});return w&&!y?d.createElement(d.Fragment,null,A,d.createElement(Gs,{page:x})):A});ec.displayName=`Link`;var tc=d.forwardRef(function({"aria-current":e=`page`,caseSensitive:t=!1,className:n=``,end:r=!1,style:i,to:a,viewTransition:o,children:s,...c},l){let u=Ro(a,{relative:c.relative}),f=Mo(),p=d.useContext(ho),{navigator:m,basename:h}=d.useContext(xo),g=p!=null&&_c(u)&&o===!0,_=m.encodeLocation?m.encodeLocation(u).pathname:u.pathname,v=f.pathname,y=p&&p.navigation&&p.navigation.location?p.navigation.location.pathname:null;t||(v=v.toLowerCase(),y=y?y.toLowerCase():null,_=_.toLowerCase()),y&&h&&(y=Ka(y,h)||y);let b=_!==`/`&&_.endsWith(`/`)?_.length-1:_.length,x=v===_||!r&&v.startsWith(_)&&v.charAt(b)===`/`,S=y!=null&&(y===_||!r&&y.startsWith(_)&&y.charAt(_.length)===`/`),C={isActive:x,isPending:S,isTransitioning:g},w=x?e:void 0,T;T=typeof n==`function`?n(C):[n,x?`active`:null,S?`pending`:null,g?`transitioning`:null].filter(
18Boolean).join(` `);let E=typeof i==`function`?i(C):i;return d.createElement(ec,{...c,"aria-current":w,className:T,ref:l,style:E,to:a,viewTransition:o},typeof s==`function`?s(C):s)});tc.displayName=`NavLink`;var nc=d.forwardRef(({discover:e=`render`,fetcherKey:t,navigate:n,reloadDocument:r,replace:i,state:a,method:o=fs,action:s,onSubmit:c,relative:l,preventScrollReset:u,viewTransition:f,defaultShouldRevalidate:p,...m},h)=>{let{useTransitions:g}=d.useContext(xo),_=uc(),v=dc(s,{relative:l}),y=o.toLowerCase()===`get`?`get`:`post`,b=typeof s==`string`&&$s.test(s);return d.createElement(`form`,{ref:h,method:y,action:v,onSubmit:r?c:e=>{if(c&&c(e),e.defaultPrevented)return;e.preventDefault();let r=e.nativeEvent.submitter,s=r?.getAttribute(`formmethod`)||o,m=()=>_(r||e.currentTarget,{fetcherKey:t,method:s,navigate:n,replace:i,state:a,relative:l,preventScrollReset:u,viewTransition:f,defaultShouldRevalidate:p});g&&n!==!1?d.startTransition(()=>m()):m()},...m,"data-discover":!b&&e===`render`?`true`:void 0})});nc.displayName=`Form`;function rc({getKey:e,storageKey:t,...n}){let r=d.useContext(Vs),{basename:i}=d.useContext(xo),a=Mo(),o=ts();hc({getKey:e,storageKey:t});let s=d.useMemo(()=>{if(!r||!e)return null;let t=mc(a,o,i,e);return t===a.key?null:t},[]);if(!r||r.isSpaMode)return null;let c=((e,t)=>{if(!window.history.state||!window.history.state.key){let e=Math.random().toString(32).slice(2);window.history.replaceState({key:e},``)}try{let n=JSON.parse(sessionStorage.getItem(e)||`{}`)[t||window.history.state.key];
18typeof n==`number`&&window.scrollTo(0,n)}catch(t){console.error(t),sessionStorage.removeItem(e)}}).toString();return d.createElement(`script`,{...n,suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:`(${c})(${Ds(JSON.stringify(t||fc))}, ${Ds(JSON.stringify(s))})`}})}rc.displayName=`ScrollRestoration`;function ic(e){return`${e} must be used within a data router.  See https://reactrouter.com/en/main/routers/picking-a-router.`}function ac(e){let t=d.useContext(mo);return _a(t,ic(e)),t}function oc(e){let t=d.useContext(ho);return _a(t,ic(e)),t}function sc(e,{target:t,replace:n,mask:r,state:i,preventScrollReset:a,relative:o,viewTransition:s,defaultShouldRevalidate:c,useTransitions:l}={}){let u=Fo(),f=Mo(),p=Ro(e,{relative:o});return d.useCallback(m=>{if(ys(m,t)){m.preventDefault();let t=n===void 0?Sa(f)===Sa(p):n,h=()=>u(e,{replace:t,mask:r,state:i,preventScrollReset:a,relative:o,viewTransition:s,defaultShouldRevalidate:c});l?d.startTransition(()=>h()):h()}},[f,u,p,n,r,i,t,e,a,o,s,c,l])}var cc=0,lc=()=>`__${String(++cc)}__`;function uc(){let{router:e}=ac(`useSubmit`),{basename:t}=d.useContext(xo),n=$o(),r=e.fetch,i=e.navigate;return d.useCallback(async(e,a={})=>{let{action:o,method:s,encType:c,formData:l,body:u}=ws(e,t);a.navigate===!1?await r(a.fetcherKey||lc(),n,a.action||o,{defaultShouldRevalidate:a.defaultShouldRevalidate,preventScrollReset:a.preventScrollReset,formData:l,body:u,formMethod:a.method||s,formEncType:a.encType||c,flushSync:a.flushSync}):await i(a.action||o,{defaultShouldRevalidate:a.defaultShouldRevalidate,preventScrollReset:a.preventScrollReset,formData:l,body:u,formMethod:a.method||s,formEncType:a.encType||c,replace:a.replace,state:a.state,fromRouteId:n,flushSync:a.flushSync,viewTransition:a.viewTransition})},[r,i,t,n])}function dc(e,{relative:t}={}){let{basename:n}=d.useContext(xo),r=d.useContext(Co);_a(r,`useFormAction must be used inside a RouteContext`);let[i]=r.matches.slice(-1),a={...Ro(e||`.`,{relative:t})},o=Mo();if(e==null){a.search=o.search;let e=new URLSearchParams(a.search),t=e.getAll(`index`);if(t.some(e=>e===``)){e.delete(`index`),t.filter(e=>e).forEach(t=>e.append(`index`,t));let n=e.toString();a.search=n?`?${n}`:``}}return(!e||e===`.`)&&i.route.index&&(a.search=a.search?a.search.replace(/^\?/,`?index&`):`?index`),n!==`/`&&(a.pathname=a.pathname===`/`?n:to([n,a.pathname])),Sa(a)}var fc=`react-router-scroll-positions`,pc={};function mc(e,t,n,r){let i=null;return r&&(i=r(n===`/`?e:{...e,pathname:Ka(e.pathname,n)||e.pathname},t)),i??=e.key,i}function hc({getKey:e,storageKey:t}={}){let{router:n}=ac(`useScrollRestoration`),{restoreScrollPosition:r,preventScrollReset:i}=oc(`useScrollRestoration`),{basename:a}=d.useContext(xo),o=Mo(),s=ts(),c=es();d.useEffect(()=>(window.history.scrollRestoration=`manual`,()=>{window.history.scrollRestoration=`auto`}),[]),gc(d.useCallback(()=>{if(c.state===`idle`){let t=mc(o,s,a,e);pc[t]=window.scrollY}try{sessionStorage.setItem(t||fc,JSON.stringify(pc))}catch(e){va(!1,`Failed to save scroll positions in sessionStorage, <ScrollRestoration /> will not work properly (${e}).`)}window.history.scrollRestoration=`auto`},[c.state,e,a,o,s,t])),typeof document<`u`&&(d.useLayoutEffect(()=>{try{let e=sessionStorage.getItem(t||fc);e&&(pc=JSON.parse(e))}catch{}},[t]),d.useLayoutEffect(()=>{let t=n?.enableScrollRestoration(pc,()=>window.scrollY,e?(t,n)=>mc(t,n,a,e):void 0);return()=>t&&t()},[n,a,e]),d.useLayoutEffect(()=>{if(r!==!1){if(typeof r==`number`){window.scrollTo(0,r);return}try{if(o.hash){let e=document.getElementById(decodeURIComponent(o.hash.slice(1)));if(e){e.scrollIntoView();return}}}catch{va(!1,`"${o.hash.slice(1)}" is not a decodable element ID. The view will not scroll to it.`)}i!==!0&&window.scrollTo(0,0)}},[o,r,i]))}function gc(e,t){let{capture:n}=t||{};d.useEffect(()=>{let t=n==null?void 0:{capture:n};return window.addEventListener(`pagehide`,e,t),()=>{window.removeEventListener(`pagehide`,e,t)}},[e,n])}function _c(e,{relative:t}={}){let n=d.useContext(vo);_a(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`.  Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=ac(`useViewTransitionState`),i=Ro(e,{relative:t});if(!n.isTransitioning)return!1;let a=Ka(n.currentLocation.pathname,r)||n.currentLocation.pathname,o=Ka(n.nextLocation.pathname,r)||n.nextLocation.pathname;return Ua(i.pathname,o)!=null||Ua(i.pathname,a)!=null}var vc=d.createContext(void 0),yc=e=>{let t=d.useContext(vc);if(e)return e;if(!t)throw Error(`No QueryClient set, use QueryClientProvider to set one`);return t},bc=({client:e,children:t})=>(d.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),(0,R.jsx)(vc.Provider,{value:e,children:t})),xc=d.createContext(!1),Sc=()=>d.useContext(xc);xc.Provider;function Cc(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}
18var wc=d.createContext(Cc()),Tc=()=>d.useContext(wc),Ec=(e,t,n)=>{let r=n?.state.error&&typeof e.throwOnError==`function`?xe(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||r)&&(t.isReset()||(e.retryOnMount=!1))},Dc=e=>{d.useEffect(()=>{e.clearReset()},[e])},Oc=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||xe(n,[e.error,r])),kc=e=>{if(e.suspense){let t=1e3,n=e=>e===`static`?e:Math.max(e??t,t),r=e.staleTime;e.staleTime=typeof r==`function`?(...e)=>n(r(...e)):n(r),typeof e.gcTime==`number`&&(e.gcTime=Math.max(e.gcTime,t))}},Ac=(e,t)=>e.isLoading&&e.isFetching&&!t,jc=(e,t)=>e?.suspense&&t.isPending,Mc=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function Nc(e,t,n){let r=Sc(),i=Tc(),a=yc(n),o=a.defaultQueryOptions(e);a.getDefaultOptions().queries?._experimental_beforeQuery?.(o);let s=a.getQueryCache().get(o.queryHash);o._optimisticResults=r?`isRestoring`:`optimistic`,kc(o),Ec(o,i,s),Dc(i);let c=!a.getQueryCache().get(o.queryHash),[l]=d.useState(()=>new t(a,o)),u=l.getOptimisticResult(o),f=!r&&e.subscribed!==!1;if(d.useSyncExternalStore(d.useCallback(e=>{let t=f?l.subscribe(De.batchCalls(e)):F;return l.updateResult(),t},[l,f]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),d.useEffect(()=>{l.setOptions(o)},[o,l]),jc(o,u))throw Mc(o,l,i);if(Oc({result:u,errorResetBoundary:i,throwOnError:o.throwOnError,query:s,suspense:o.suspense}))throw u.error;return a.getDefaultOptions().queries?._experimental_afterQuery?.(o,u),o.experimental_prefetchInRender&&!Ce.isServer()&&Ac(u,r)&&(c?Mc(o,l,i):s?.promise)?.catch(F).finally(()=>{l.updateResult()}),o.notifyOnChangeProps?u:l.trackResult(u)}function Pc(e,t){return Nc(e,Ue,t)}function Fc(e,t){let n=yc(t),[r]=d.useState(()=>new tt(n,e));d.useEffect(()=>{r.setOptions(e)},[r,e]);let i=d.useSyncExternalStore(d.useCallback(e=>r.subscribe(De.batchCalls(e)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),a=d.useCallback((e,t)=>{r.mutate(e,t).catch(F)},[r]);if(i.error&&xe(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:a,mutateAsync:i.mutate}}var Ic={data:``},Lc=e=>{if(typeof window==`object`){let t=(e?e.querySelector(`#_goober`):window._goober)||Object.assign(document.createElement(`style`),{innerHTML:` `,id:`_goober`});return t.nonce=window.__nonce__,t.parentNode||(e||document.head).appendChild(t),t.firstChild}return e||Ic},Rc=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,zc=/\/\*[^]*?\*\/|  +/g,Bc=/\n+/g,Vc=(e,t)=>{let n=``,r=``,i=``;for(let a in e){let o=e[a];a[0]==`@`?a[1]==`i`?n=a+` `+o+`;`:r+=a[1]==`f`?Vc(o,a):a+`{`+Vc(o,a[1]==`k`?``:t)+`}`:typeof o==`object`?r+=Vc(o,t?t.replace(/([^,])+/g,e=>a.replace(/([^,]*:\S+\([^)]*\))|([^,])+/g,t=>/&/.test(t)?t.replace(/&/g,e):e?e+` `+t:t)):a):o!=null&&(a=a[1]==`-`?a:a.replace(/[A-Z]/g,`-$&`).toLowerCase(),i+=Vc.p?Vc.p(a,o):a+`:`+o+`;`)}return n+(t&&i?t+`{`+i+`}`:i)+r},Hc={},Uc=e=>{if(typeof e==`object`){let t=``;for(let n in e)t+=n+Uc(e[n]);return t}return e},Wc=(e,t,n,r,i)=>{let a=Uc(e),o=Hc[a]||(Hc[a]=(e=>{let t=0,n=11;for(;t<e.length;)n=101*n+e.charCodeAt(t++)>>>0;return`go`+n})(a));if(!Hc[o]){let t=a===e?(e=>{let t,n,r=[{}];for(;t=Rc.exec(e.replace(zc,``));)t[4]?r.shift():t[3]?(n=t[3].replace(Bc,` `).trim(),r.unshift(r[0][n]=r[0][n]||{})):r[0][t[1]]=t[2].replace(Bc,` `).trim();return r[0]})(e):e;Hc[o]=Vc(i?{[`@keyframes `+o]:t}:t,n?``:`.`+o)}let s=n&&Hc.g;return n&&(Hc.g=Hc[o]),((e,t,n,r)=>{r?t.data=t.data.replace(r,e):t.data.indexOf(e)===-1&&(t.data=n?e+t.data:t.data+e)})(Hc[o],t,r,s),o},Gc=(e,t,n)=>e.reduce((e,r,i)=>{let a=t[i];if(a&&a.call){let e=a(n),t=e&&e.props&&e.props.className||/^go/.test(e)&&e;a=t?`.`+t:e&&typeof e==`object`?e.props?``:Vc(e,``):!1===e?``:e}return e+r+(a??``)},``);function Kc(e){let t=this||{},n=e.call?e(t.p):e;return Wc(n.unshift?n.raw?Gc(n,[].slice.call(arguments,1),t.p):n.reduce((e,n)=>Object.assign(e,n&&n.call?n(t.p):n),{}):n,Lc(t.target),t.g,t.o,t.k)}var qc,Jc,Yc;Kc.bind({g:1});var Xc=Kc.bind({k:1});function Zc(e,t,n,r){Vc.p=t,qc=e,Jc=n,Yc=r}function Qc(e,t){let n=this||{};return function(){let r=arguments;function i(a,o){let s=Object.assign({},a),c=s.className||i.className;n.p=Object.assign({theme:Jc&&Jc()},s),n.o=/go\d/.test(c),s.className=Kc.apply(n,r)+(c?` `+c:``),t&&(s.ref=o);let l=e;return e[0]&&(l=s.as||e,delete s.as),Yc&&l[0]&&Yc(s),qc(l,s)}return t?t(i):i}}var $c=e=>typeof e==`function`,el=(e,t)=>
18$c(e)?e(t):e,tl=(()=>{let e=0;return()=>(++e).toString()})(),nl=(()=>{let e;return()=>{if(e===void 0&&typeof window<`u`){let t=matchMedia(`(prefers-reduced-motion: reduce)`);e=!t||t.matches}return e}})(),rl=20,il=`default`,al=(e,t)=>{let{toastLimit:n}=e.settings;switch(t.type){case 0:return{...e,toasts:[t.toast,...e.toasts].slice(0,n)};case 1:return{...e,toasts:e.toasts.map(e=>e.id===t.toast.id?{...e,...t.toast}:e)};case 2:let{toast:r}=t;return al(e,{type:+!!e.toasts.find(e=>e.id===r.id),toast:r});case 3:let{toastId:i}=t;return{...e,toasts:e.toasts.map(e=>e.id===i||i===void 0?{...e,dismissed:!0,visible:!1}:e)};case 4:return t.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(e=>e.id!==t.toastId)};case 5:return{...e,pausedAt:t.time};case 6:let a=t.time-(e.pausedAt||0);return{...e,pausedAt:void 0,toasts:e.toasts.map(e=>({...e,pauseDuration:e.pauseDuration+a}))}}},ol=[],sl={toasts:[],pausedAt:void 0,settings:{toastLimit:rl}},cl={},ll=(e,t=il)=>{cl[t]=al(cl[t]||sl,e),ol.forEach(([e,n])=>{e===t&&n(cl[t])})},ul=e=>Object.keys(cl).forEach(t=>ll(e,t)),dl=e=>Object.keys(cl).find(t=>cl[t].toasts.some(t=>t.id===e)),fl=(e=il)=>t=>{ll(t,e)},pl={blank:4e3,error:4e3,success:2e3,loading:1/0,custom:4e3},ml=(e={},t=il)=>{let[n,r]=(0,d.useState)(cl[t]||sl),i=(0,d.useRef)(cl[t]);(0,d.useEffect)(()=>(i.current!==cl[t]&&r(cl[t]),ol.push([t,r]),()=>{let e=ol.findIndex(([e])=>e===t);e>-1&&ol.splice(e,1)}),[t]);let a=n.toasts.map(t=>({...e,...e[t.type],...t,removeDelay:t.removeDelay||e[t.type]?.removeDelay||e?.removeDelay,duration:t.duration||e[t.type]?.duration||e?.duration||pl[t.type],style:{...e.style,...e[t.type]?.style,...t.style}}));return{...n,toasts:a}},hl=(e,t=`blank`,n)=>({createdAt:Date.now(),visible:!0,dismissed:!1,type:t,ariaProps:{role:`status`,"aria-live":`polite`},message:e,pauseDuration:0,...n,id:n?.id||tl()}),gl=e=>(t,n)=>{let r=hl(t,e,n);return fl(r.toasterId||dl(r.id))({type:2,toast:r}),r.id},_l=(e,t)=>gl(`blank`)(e,t);_l.error=gl(`error`),_l.success=gl(`success`),_l.loading=gl(`loading`),_l.custom=gl(`custom`),_l.dismiss=(e,t)=>{let n={type:3,toastId:e};t?fl(t)(n):ul(n)},_l.dismissAll=e=>_l.dismiss(void 0,e),_l.remove=(e,t)=>{let n={type:4,toastId:e};t?fl(t)(n):ul(n)},_l.removeAll=e=>_l.remove(void 0,e),_l.promise=(e,t,n)=>{let r=_l.loading(t.loading,{...n,...n?.loading});return typeof e==`function`&&(e=e()),e.then(e=>{let i=t.success?el(t.success,e):void 0;return i?_l.success(i,{id:r,...n,...n?.success}):_l.dismiss(r),e}).catch(e=>{let i=t.error?el(t.error,e):void 0;i?_l.error(i,{id:r,...n,...n?.error}):_l.dismiss(r)}),e};var vl=1e3,yl=(e,t=`default`)=>{let{toasts:n,pausedAt:r}=ml(e,t),i=(0,d.useRef)(new Map).current,a=(0,d.useCallback)((e,t=vl)=>{if(i.has(e))return;let n=setTimeout(()=>{i.delete(e),o({type:4,toastId:e})},t);i.set(e,n)},[]);(0,d.useEffect)(()=>{if(r)return;let e=Date.now(),i=n.map(n=>{if(n.duration===1/0)return;let r=(n.duration||0)+n.pauseDuration-(e-n.createdAt);if(r<0){n.visible&&_l.dismiss(n.id);return}return setTimeout(()=>_l.dismiss(n.id,t),r)});return()=>{i.forEach(e=>e&&clearTimeout(e))}},[n,r,t]);let o=(0,d.useCallback)(fl(t),[t]),s=(0,d.useCallback)(()=>{o({type:5,time:Date.now()})},[o]),c=(0,d.useCallback)((e,t)=>{o({type:1,toast:{id:e,height:t}})},[o]),l=(0,d.useCallback)(()=>{r&&o({type:6,time:Date.now()})},[r,o]),u=(0,d.useCallback)((e,t)=>{let{reverseOrder:r=!1,gutter:i=8,defaultPosition:a}=t||{},o=n.filter(t=>(t.position||a)===(e.position||a)&&t.height),s=o.findIndex(t=>t.id===e.id),c=o.filter((e,t)=>t<s&&e.visible).length;return o.filter(e=>e.visible).slice(...r?[c+1]:[0,c]).reduce((e,t)=>e+(t.height||0)+i,0)},[n]);return(0,d.useEffect)(()=>{n.forEach(e=>{if(e.dismissed)a(e.id,e.removeDelay);else{let t=i.get(e.id);t&&(clearTimeout(t),i.delete(e.id))}})},[n,a]),{toasts:n,handlers:{updateHeight:c,startPause:s,endPause:l,calculateOffset:u}}},bl=Xc`
19from {
20  transform: scale(0) rotate(45deg);
21	opacity: 0;
22}
23to {
24 transform: scale(1) rotate(45deg);
25  opacity: 1;
26}`,xl=Xc`
27from {
28  transform: scale(0);
29  opacity: 0;
30}
31to {
32  transform: scale(1);
33  opacity: 1;
34}`,Sl=Xc`
35from {
36  transform: scale(0) rotate(90deg);
37	opacity: 0;
38}
39to {
40  transform: scale(1) rotate(90deg);
41	opacity: 1;
42}`,Cl=Qc(`div`)`
43  width: 20px;
44  opacity: 0;
45  height: 20px;
46  border-radius: 10px;
47  background: ${e=>e.primary||`#ff4b4b`};
48  position: relative;
49  transform: rotate(45deg);
50
51  animation: ${bl} 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275)
52    forwards;
53  animation-delay: 100ms;
54
55  &:after,
56  &:before {
57    content: '';
58    animation: ${xl} 0.15s ease-out forwards;
59    animation-delay: 150ms;
60    position: absolute;
61    border-radius: 3px;
62    opacity: 0;
63    background: ${e=>e.secondary||`#fff`};
64    bottom: 9px;
65    left: 4px;
66    height: 2px;
67    width: 12px;
68  }
69
70  &:before {
71    animation: ${Sl} 0.15s ease-out forwards;
72    animation-delay: 180ms;
73    transform: rotate(90deg);
74  }
75`,wl=Xc`
76  from {
77    transform: rotate(0deg);
78  }
79  to {
80    transform: rotate(360deg);
81  }
82`,Tl=Qc(`div`)`
83  width: 12px;
84  height: 12px;
85  box-sizing: border-box;
86  border: 2px solid;
87  border-radius: 100%;
88  border-color: ${e=>e.secondary||`#e0e0e0`};
89  border-right-color: ${e=>e.primary||`#616161`};
90  animation: ${wl} 1s linear infinite;
91`,El=Xc`
92from {
93  transform: scale(0) rotate(45deg);
94	opacity: 0;
95}
96to {
97  transform: scale(1) rotate(45deg);
98	opacity: 1;
99}`,Dl=Xc`
1000% {
101	height: 0;
102	width: 0;
103	opacity: 0;
104}
10540% {
106  height: 0;
107	width: 6px;
108	opacity: 1;
109}
110100% {
111  opacity: 1;
112  height: 10px;
113}`,Ol=Qc(`div`)`
114  width: 20px;
115  opacity: 0;
116  height: 20px;
117  border-radius: 10px;
118  background: ${e=>e.primary||`#61d345`};
119  position: relative;
120  transform: rotate(45deg);
121
122  animation: ${El} 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275)
123    forwards;
124  animation-delay: 100ms;
125  &:after {
126    content: '';
127    box-sizing: border-box;
128    animation: ${Dl} 0.2s ease-out forwards;
129    opacity: 0;
130    animation-delay: 200ms;
131    position: absolute;
132    border-right: 2px solid;
133    border-bottom: 2px solid;
134    border-color: ${e=>e.secondary||`#fff`};
135    bottom: 6px;
136    left: 6px;
137    height: 10px;
138    width: 6px;
139  }
140`,kl=Qc(`div`)`
141  position: absolute;
142`,Al=Qc(`div`)`
143  position: relative;
144  display: flex;
145  justify-content: center;
146  align-items: center;
147  min-width: 20px;
148  min-height: 20px;
149`,jl=Xc`
150from {
151  transform: scale(0.6);
152  opacity: 0.4;
153}
154to {
155  transform: scale(1);
156  opacity: 1;
157}`,Ml=Qc(`div`)`
158  position: relative;
159  transform: scale(0.6);
160  opacity: 0.4;
161  min-width: 20px;
162  animation: ${jl} 0.3s 0.12s cubic-bezier(0.175, 0.885, 0.32, 1.275)
163    forwards;
164`,Nl=({toast:e})=>{let{icon:t,type:n,iconTheme:r}=e;return t===void 0?n===`blank`?null:d.createElement(Al,null,d.createElement(Tl,{...r}),n!==`loading`&&d.createElement(kl,null,n===`error`?d.createElement(Cl,{...r}):d.createElement(Ol,{...r}))):typeof t==`string`?d.createElement(Ml,null,t):t},Pl=e=>`
1650% {transform: translate3d(0,${e*-200}%,0) scale(.6); opacity:.5;}
166100% {transform: translate3d(0,0,0) scale(1); opacity:1;}
167`,Fl=e=>`
1680% {transform: translate3d(0,0,-1px) scale(1); opacity:1;}
169100% {transform: translate3d(0,${e*-150}%,-1px) scale(.6); opacity:0;}
170`,Il=`0%{opacity:0;} 100%{opacity:1;}`,Ll=`0%{opacity:1;} 100%{opacity:0;}`,Rl=Qc(`div`)`
171  display: flex;
172  align-items: center;
173  background: #fff;
174  color: #363636;
175  line-height: 1.3;
176  will-change: transform;
177  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1), 0 3px 3px rgba(0, 0, 0, 0.05);
178  max-width: 350px;
179  pointer-events: auto;
180  padding: 8px 10px;
181  border-radius: 8px;
182`,zl=Qc(`div`)`
183  display: flex;
184  justify-content: center;
185  margin: 4px 10px;
186  color: inherit;
187  flex: 1 1 auto;
188  white-space: pre-line;
189`,Bl=(e,t)=>{let n=e.includes(`top`)?1:-1,[r,i]=nl()?[Il,Ll]:[Pl(n),Fl(n)];return{animation:t?`${Xc(r)} 0.35s cubic-bezier(.21,1.02,.73,1) forwards`:`${Xc(i)} 0.4s forwards cubic-bezier(.06,.71,.55,1)`}},Vl=d.memo(({toast:e,position:t,style:n,children:r})=>{let i=e.height?Bl(e.position||t||`top-center`,e.visible):{opacity:0},a=d.createElement(Nl,{toast:e}),o=d.createElement(zl,{...e.ariaProps},el(e.message,e));return d.createElement(Rl,{className:e.className,style:{...i,...n,...e.style}},typeof r==`function`?r({icon:a,message:o}):d.createElement(d.Fragment,null,a,o))});Zc(d.createElement);var Hl=({id:e,className:t,style:n,onHeightUpdate:r,children:i})=>{let a=d.useCallback(t=>{if(t){let n=()=>{let n=t.getBoundingClientRect().height;r(e,n)};n(),new MutationObserver(n).observe(t,{subtree:!0,childList:!0,characterData:!0}
189)}},[e,r]);return d.createElement(`div`,{ref:a,className:t,style:n},i)},Ul=(e,t)=>{let n=e.includes(`top`),r=n?{top:0}:{bottom:0},i=e.includes(`center`)?{justifyContent:`center`}:e.includes(`right`)?{justifyContent:`flex-end`}:{};return{left:0,right:0,display:`flex`,position:`absolute`,transition:nl()?void 0:`all 230ms cubic-bezier(.21,1.02,.73,1)`,transform:`translateY(${t*(n?1:-1)}px)`,...r,...i}},Wl=Kc`
190  z-index: 9999;
191  > * {
192    pointer-events: auto;
193  }
194`,Gl=16,Kl=({reverseOrder:e,position:t=`top-center`,toastOptions:n,gutter:r,children:i,toasterId:a,containerStyle:o,containerClassName:s})=>{let{toasts:c,handlers:l}=yl(n,a);return d.createElement(`div`,{"data-rht-toaster":a||``,style:{position:`fixed`,zIndex:9999,top:Gl,left:Gl,right:Gl,bottom:Gl,pointerEvents:`none`,...o},className:s,onMouseEnter:l.startPause,onMouseLeave:l.endPause},c.map(n=>{let a=n.position||t,o=Ul(a,l.calculateOffset(n,{reverseOrder:e,gutter:r,defaultPosition:t}));return d.createElement(Hl,{id:n.id,key:n.id,onHeightUpdate:l.updateHeight,className:n.visible?Wl:``,style:o},n.type===`custom`?el(n.message,n):i?i(n):d.createElement(Vl,{toast:n,position:a}))}))},ql=_l;function Jl(e,t){return function(){return e.apply(t,arguments)}}var{toString:Yl}=Object.prototype,{getPrototypeOf:Xl}=Object,{iterator:Zl,toStringTag:Ql}=Symbol,$l=(e=>t=>{let n=Yl.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),eu=e=>(e=e.toLowerCase(),t=>$l(t)===e),tu=e=>t=>typeof t===e,{isArray:nu}=Array,ru=tu(`undefined`);function iu(e){return e!==null&&!ru(e)&&e.constructor!==null&&!ru(e.constructor)&&cu(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}var au=eu(`ArrayBuffer`);function ou(e){let t;return t=typeof ArrayBuffer<`u`&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&au(e.buffer),t}var su=tu(`string`),cu=tu(`function`),lu=tu(`number`),uu=e=>typeof e==`object`&&!!e,du=e=>e===!0||e===!1,fu=e=>{if($l(e)!==`object`)return!1;let t=Xl(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Ql in e)&&!(Zl in e)},pu=e=>{if(!uu(e)||iu(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},mu=eu(`Date`),hu=eu(`File`),gu=e=>!!(e&&e.uri!==void 0),_u=e=>e&&e.getParts!==void 0,vu=eu(`Blob`),yu=eu(`FileList`),bu=e=>uu(e)&&cu(e.pipe);function xu(){return typeof globalThis<`u`?globalThis:typeof self<`u`?self:typeof window<`u`?window:typeof global<`u`?global:{}}var Su=xu(),Cu=Su.FormData===void 0?void 0:Su.FormData,wu=e=>{if(!e)return!1;if(Cu&&e instanceof Cu)return!0;let t=Xl(e);if(!t||t===Object.prototype||!cu(e.append))return!1;let n=$l(e);return n===`formdata`||n===`object`&&cu(e.toString)&&e.toString()===`[object FormData]`},Tu=eu(`URLSearchParams`),[Eu,Du,Ou,ku]=[`ReadableStream`,`Request`,`Response`,`Headers`].map(eu),Au=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,``);function ju(e,t,{allOwnKeys:n=!1}={}){if(e==null)return;let r,i;if(typeof e!=`object`&&(e=[e]),nu(e))for(r=0,i=e.length;r<i;r++)t.call(null,e[r],r,e);else{if(iu(e))return;let i=n?Object.getOwnPropertyNames(e):Object.keys(e),a=i.length,o;for(r=0;r<a;r++)o=i[r],t.call(null,e[o],o,e)}}function Mu(e,t){if(iu(e))return null;t=t.toLowerCase();let n=Object.keys(e),r=n.length,i;for(;r-- >0;)if(i=n[r],t===i.toLowerCase())return i;return null}var Nu=typeof globalThis<`u`?globalThis:typeof self<`u`?self:typeof window<`u`?window:global,Pu=e=>!ru(e)&&e!==Nu;function Fu(...e){let{caseless:t,skipUndefined:n}=Pu(this)&&this||{},r={},i=(e,i)=>{if(i===`__proto__`||i===`constructor`||i===`prototype`)return;let a=t&&Mu(r,i)||i,o=qu(r,a)?r[a]:void 0;fu(o)&&fu(e)?r[a]=Fu(o,e):fu(e)?r[a]=Fu({},e):nu(e)?r[a]=e.slice():(!n||!ru(e))&&(r[a]=e)};for(let t=0,n=e.length;t<n;t++)e[t]&&ju(e[t],i);return r}var Iu=(e,t,n,{allOwnKeys:r}={})=>(ju(t,(t,r)=>{n&&cu(t)?Object.defineProperty(e,r,{__proto__:null,value:Jl(t,n),writable:!0,enumerable:!0,configurable:!0}):Object.defineProperty(e,r,{__proto__:null,value:t,writable:!0,enumerable:!0,configurable:!0})},{allOwnKeys:r}),e),Lu=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),Ru=(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),Object.defineProperty(e.prototype,`constructor`,{__proto__:null,value:e,writable:!0,enumerable:!1,
194configurable:!0}),Object.defineProperty(e,`super`,{__proto__:null,value:t.prototype}),n&&Object.assign(e.prototype,n)},zu=(e,t,n,r)=>{let i,a,o,s={};if(t||={},e==null)return t;do{for(i=Object.getOwnPropertyNames(e),a=i.length;a-- >0;)o=i[a],(!r||r(o,e,t))&&!s[o]&&(t[o]=e[o],s[o]=!0);e=n!==!1&&Xl(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},Bu=(e,t,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=t.length;let r=e.indexOf(t,n);return r!==-1&&r===n},Vu=e=>{if(!e)return null;if(nu(e))return e;let t=e.length;if(!lu(t))return null;let n=Array(t);for(;t-- >0;)n[t]=e[t];return n},Hu=(e=>t=>e&&t instanceof e)(typeof Uint8Array<`u`&&Xl(Uint8Array)),Uu=(e,t)=>{let n=(e&&e[Zl]).call(e),r;for(;(r=n.next())&&!r.done;){let n=r.value;t.call(e,n[0],n[1])}},Wu=(e,t)=>{let n,r=[];for(;(n=e.exec(t))!==null;)r.push(n);return r},Gu=eu(`HTMLFormElement`),Ku=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(e,t,n){return t.toUpperCase()+n}),qu=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),Ju=eu(`RegExp`),Yu=(e,t)=>{let n=Object.getOwnPropertyDescriptors(e),r={};ju(n,(n,i)=>{let a;(a=t(n,i,e))!==!1&&(r[i]=a||n)}),Object.defineProperties(e,r)},Xu=e=>{Yu(e,(t,n)=>{if(cu(e)&&[`arguments`,`caller`,`callee`].includes(n))return!1;let r=e[n];if(cu(r)){if(t.enumerable=!1,`writable`in t){t.writable=!1;return}t.set||=()=>{throw Error(`Can not rewrite read-only method '`+n+`'`)}}})},Zu=(e,t)=>{let n={},r=e=>{e.forEach(e=>{n[e]=!0})};return nu(e)?r(e):r(String(e).split(t)),n},Qu=()=>{},$u=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function ed(e){return!!(e&&cu(e.append)&&e[Ql]===`FormData`&&e[Zl])}var td=e=>{let t=new WeakSet,n=e=>{if(uu(e)){if(t.has(e))return;if(iu(e))return e;if(!(`toJSON`in e)){t.add(e);let r=nu(e)?[]:{};return ju(e,(e,t)=>{let i=n(e);!ru(i)&&(r[t]=i)}),t.delete(e),r}}return e};return n(e)},nd=eu(`AsyncFunction`),rd=e=>e&&(uu(e)||cu(e))&&cu(e.then)&&cu(e.catch),id=((e,t)=>e?setImmediate:t?((e,t)=>(Nu.addEventListener(`message`,({source:n,data:r})=>{n===Nu&&r===e&&t.length&&t.shift()()},!1),n=>{t.push(n),Nu.postMessage(e,`*`)}))(`axios@${Math.random()}`,[]):e=>setTimeout(e))(typeof setImmediate==`function`,cu(Nu.postMessage)),z={isArray:nu,isArrayBuffer:au,isBuffer:iu,isFormData:wu,isArrayBufferView:ou,isString:su,isNumber:lu,isBoolean:du,isObject:uu,isPlainObject:fu,isEmptyObject:pu,isReadableStream:Eu,isRequest:Du,isResponse:Ou,isHeaders:ku,isUndefined:ru,isDate:mu,isFile:hu,isReactNativeBlob:gu,isReactNative:_u,isBlob:vu,isRegExp:Ju,isFunction:cu,isStream:bu,isURLSearchParams:Tu,isTypedArray:Hu,isFileList:yu,forEach:ju,merge:Fu,extend:Iu,trim:Au,stripBOM:Lu,inherits:Ru,toFlatObject:zu,kindOf:$l,kindOfTest:eu,endsWith:Bu,toArray:Vu,forEachEntry:Uu,matchAll:Wu,isHTMLForm:Gu,hasOwnProperty:qu,hasOwnProp:qu,reduceDescriptors:Yu,freezeMethods:Xu,toObjectSet:Zu,toCamelCase:Ku,noop:Qu,toFiniteNumber:$u,findKey:Mu,global:Nu,isContextDefined:Pu,isSpecCompliantForm:ed,toJSONObject:td,isAsyncFn:nd,isThenable:rd,setImmediate:id,asap:typeof queueMicrotask<`u`?queueMicrotask.bind(Nu):typeof process<`u`&&process.nextTick||id,isIterable:e=>e!=null&&cu(e[Zl])},ad=z.toObjectSet([`age`,`authorization`,`content-length`,`content-type`,`etag`,`expires`,`from`,`host`,`if-modified-since`,`if-unmodified-since`,`last-modified`,`location`,`max-forwards`,`proxy-authorization`,`referer`,`retry-after`,`user-agent`]),od=e=>{let t={},n,r,i;return e&&e.split(`
195`).forEach(function(e){i=e.indexOf(`:`),n=e.substring(0,i).trim().toLowerCase(),r=e.substring(i+1).trim(),!(!n||t[n]&&ad[n])&&(n===`set-cookie`?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+`, `+r:r)}),t};function sd(e){let t=0,n=e.length;for(;t<n;){let n=e.charCodeAt(t);if(n!==9&&n!==32)break;t+=1}for(;n>t;){let t=e.charCodeAt(n-1);if(t!==9&&t!==32)break;--n}return t===0&&n===e.length?e:e.slice(t,n)}var cd=RegExp(`[\\u0000-\\u0008\\u000a-\\u001f\\u007f]+`,`g`),ld=RegExp(`[^\\u0009\\u0020-\\u007e\\u0080-\\u00ff]+`,`g`);function ud(e,t){return z.isArray(e)?e.map(e=>ud(e,t)):sd(String(e).replace(t,``))}var dd=e=>ud(e,cd),fd=e=>ud(e,ld);function pd(e){let t=Object.create(null);return z.forEach(e.toJSON(),(e,n)=>{t[n]=fd(e)}),t}var md=Symbol(`internals`);function hd(e){return e&&String(e).trim().toLowerCase()}function gd(e){return e===!1||e==null?e:z.isArray(e)?e.map(gd):dd(String(e))}function _d(e){let t=Object.create(null),n=/([^\s,;
195=]+)\s*(?:=\s*([^,;]+))?/g,r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}var vd=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function yd(e,t,n,r,i){if(z.isFunction(r))return r.call(this,t,n);if(i&&(t=n),z.isString(t)){if(z.isString(r))return t.indexOf(r)!==-1;if(z.isRegExp(r))return r.test(t)}}function bd(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,t,n)=>t.toUpperCase()+n)}function xd(e,t){let n=z.toCamelCase(` `+t);[`get`,`set`,`has`].forEach(r=>{Object.defineProperty(e,r+n,{__proto__:null,value:function(e,n,i){return this[r].call(this,t,e,n,i)},configurable:!0})})}var Sd=class{constructor(e){e&&this.set(e)}set(e,t,n){let r=this;function i(e,t,n){let i=hd(t);if(!i)throw Error(`header name must be a non-empty string`);let a=z.findKey(r,i);(!a||r[a]===void 0||n===!0||n===void 0&&r[a]!==!1)&&(r[a||t]=gd(e))}let a=(e,t)=>z.forEach(e,(e,n)=>i(e,n,t));if(z.isPlainObject(e)||e instanceof this.constructor)a(e,t);else if(z.isString(e)&&(e=e.trim())&&!vd(e))a(od(e),t);else if(z.isObject(e)&&z.isIterable(e)){let n={},r,i;for(let t of e){if(!z.isArray(t))throw TypeError(`Object iterator must return a key-value pair`);n[i=t[0]]=(r=n[i])?z.isArray(r)?[...r,t[1]]:[r,t[1]]:t[1]}a(n,t)}else e!=null&&i(t,e,n);return this}get(e,t){if(e=hd(e),e){let n=z.findKey(this,e);if(n){let e=this[n];if(!t)return e;if(t===!0)return _d(e);if(z.isFunction(t))return t.call(this,e,n);if(z.isRegExp(t))return t.exec(e);throw TypeError(`parser must be boolean|regexp|function`)}}}has(e,t){if(e=hd(e),e){let n=z.findKey(this,e);return!!(n&&this[n]!==void 0&&(!t||yd(this,this[n],n,t)))}return!1}delete(e,t){let n=this,r=!1;function i(e){if(e=hd(e),e){let i=z.findKey(n,e);i&&(!t||yd(n,n[i],i,t))&&(delete n[i],r=!0)}}return z.isArray(e)?e.forEach(i):i(e),r}clear(e){let t=Object.keys(this),n=t.length,r=!1;for(;n--;){let i=t[n];(!e||yd(this,this[i],i,e,!0))&&(delete this[i],r=!0)}return r}normalize(e){let t=this,n={};return z.forEach(this,(r,i)=>{let a=z.findKey(n,i);if(a){t[a]=gd(r),delete t[i];return}let o=e?bd(i):String(i).trim();o!==i&&delete t[i],t[o]=gd(r),n[o]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){let t=Object.create(null);return z.forEach(this,(n,r)=>{n!=null&&n!==!1&&(t[r]=e&&z.isArray(n)?n.join(`, `):n)}),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,t])=>e+`: `+t).join(`
196`)}getSetCookie(){return this.get(`set-cookie`)||[]}get[Symbol.toStringTag](){return`AxiosHeaders`}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){let n=new this(e);return t.forEach(e=>n.set(e)),n}static accessor(e){let t=(this[md]=this[md]={accessors:{}}).accessors,n=this.prototype;function r(e){let r=hd(e);t[r]||(xd(n,e),t[r]=!0)}return z.isArray(e)?e.forEach(r):r(e),this}};Sd.accessor([`Content-Type`,`Content-Length`,`Accept`,`Accept-Encoding`,`User-Agent`,`Authorization`]),z.reduceDescriptors(Sd.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[n]=e}}}),z.freezeMethods(Sd);var Cd=`[REDACTED ****]`;function wd(e){if(z.hasOwnProp(e,`toJSON`))return!0;let t=Object.getPrototypeOf(e);for(;t&&t!==Object.prototype;){if(z.hasOwnProp(t,`toJSON`))return!0;t=Object.getPrototypeOf(t)}return!1}function Td(e,t){let n=new Set(t.map(e=>String(e).toLowerCase())),r=[],i=e=>{if(typeof e!=`object`||!e||z.isBuffer(e))return e;if(r.indexOf(e)!==-1)return;e instanceof Sd&&(e=e.toJSON()),r.push(e);let t;if(z.isArray(e))t=[],e.forEach((e,n)=>{let r=i(e);z.isUndefined(r)||(t[n]=r)});else{if(!z.isPlainObject(e)&&wd(e))return r.pop(),e;t=Object.create(null);for(let[r,a]of Object.entries(e)){let e=n.has(r.toLowerCase())?Cd:i(a);z.isUndefined(e)||(t[r]=e)}}return r.pop(),t};return i(e)}var Ed=class e extends Error{static from(t,n,r,i,a,o){let s=new e(t.message,n||t.code,r,i,a);return s.cause=t,s.name=t.name,t.status!=null&&s.status==null&&(s.status=t.status),o&&Object.assign(s,o),s}constructor(e,t,n,r,i){super(e),Object.defineProperty(this,`message`,{__proto__:null,value:e,enumerable:!0,writable:!0,configurable:!0}),this.name=`AxiosError`,this.isAxiosError=!0,t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),i&&(this.response=i,this.status=i.status)}toJSON(){let e=this.config,t=e&&z.hasOwnProp(e,`redact`)?e.redact:void 0,n=z.isArray(t)&&t.length>0?Td(e,t):z.toJSONObject(e);return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:n,code:this.code,status:this.status}}};Ed.ERR_BAD_OPTION_VALUE=`ERR_BAD_OPTION_VALUE`,Ed.ERR_BAD_OPTION=`ERR_BAD_OPTION`,Ed.ECONNABORTED=`ECONNABORTED`,Ed.ETIMEDOUT=`ETIMEDOUT`,Ed.ECONNREFUSED=`ECONNREFUSED`,Ed.ERR_NETWORK=`E
196RR_NETWORK`,Ed.ERR_FR_TOO_MANY_REDIRECTS=`ERR_FR_TOO_MANY_REDIRECTS`,Ed.ERR_DEPRECATED=`ERR_DEPRECATED`,Ed.ERR_BAD_RESPONSE=`ERR_BAD_RESPONSE`,Ed.ERR_BAD_REQUEST=`ERR_BAD_REQUEST`,Ed.ERR_CANCELED=`ERR_CANCELED`,Ed.ERR_NOT_SUPPORT=`ERR_NOT_SUPPORT`,Ed.ERR_INVALID_URL=`ERR_INVALID_URL`,Ed.ERR_FORM_DATA_DEPTH_EXCEEDED=`ERR_FORM_DATA_DEPTH_EXCEEDED`;function Dd(e){return z.isPlainObject(e)||z.isArray(e)}function Od(e){return z.endsWith(e,`[]`)?e.slice(0,-2):e}function kd(e,t,n){return e?e.concat(t).map(function(e,t){return e=Od(e),!n&&t?`[`+e+`]`:e}).join(n?`.`:``):t}function Ad(e){return z.isArray(e)&&!e.some(Dd)}var jd=z.toFlatObject(z,{},null,function(e){return/^is[A-Z]/.test(e)});function Md(e,t,n){if(!z.isObject(e))throw TypeError(`target must be an object`);t||=new FormData,n=z.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(e,t){return!z.isUndefined(t[e])});let r=n.metaTokens,i=n.visitor||d,a=n.dots,o=n.indexes,s=n.Blob||typeof Blob<`u`&&Blob,c=n.maxDepth===void 0?100:n.maxDepth,l=s&&z.isSpecCompliantForm(t);if(!z.isFunction(i))throw TypeError(`visitor must be a function`);function u(e){if(e===null)return``;if(z.isDate(e))return e.toISOString();if(z.isBoolean(e))return e.toString();if(!l&&z.isBlob(e))throw new Ed(`Blob is not supported. Use a Buffer instead.`);return z.isArrayBuffer(e)||z.isTypedArray(e)?l&&typeof Blob==`function`?new Blob([e]):Buffer.from(e):e}function d(e,n,i){let s=e;if(z.isReactNative(t)&&z.isReactNativeBlob(e))return t.append(kd(i,n,a),u(e)),!1;if(e&&!i&&typeof e==`object`){if(z.endsWith(n,`{}`))n=r?n:n.slice(0,-2),e=JSON.stringify(e);else if(z.isArray(e)&&Ad(e)||(z.isFileList(e)||z.endsWith(n,`[]`))&&(s=z.toArray(e)))return n=Od(n),s.forEac
196h(function(e,r){!(z.isUndefined(e)||e===null)&&t.append(o===!0?kd([n],r,a):o===null?n:n+`[]`,u(e))}),!1}return Dd(e)?!0:(t.append(kd(i,n,a),u(e)),!1)}let f=[],p=Object.assign(jd,{defaultVisitor:d,convertValue:u,isVisitable:Dd});function m(e,n,r=0){if(!z.isUndefined(e)){if(r>c)throw new Ed(`Object is too deeply nested (`+r+` levels). Max depth: `+c,Ed.ERR_FORM_DATA_DEPTH_EXCEEDED);if(f.indexOf(e)!==-1)throw Error(`Circular reference detected in `+n.join(`.`));f.push(e),z.forEach(e,function(e,a){(!(z.isUndefined(e)||e===null)&&i.call(t,e,z.isString(a)?a.trim():a,n,p))===!0&&m(e,n?n.concat(a):[a],r+1)}),f.pop()}}if(!z.isObject(e))throw TypeError(`data must be an object`);return m(e),t}function Nd(e){let t={"!":`%21`,"'":`%27`,"(":`%28`,")":`%29`,"~":`%7E`,"%20":`+`};return encodeURIComponent(e).replace(/[!'()~]|%20/g,function(e){return t[e]})}function Pd(e,t){this._pairs=[],e&&Md(e,this,t)}var Fd=Pd.prototype;Fd.append=function(e,t){this._pairs.push([e,t])},Fd.toString=function(e){let t=e?function(t){return e.call(this,t,Nd)}:Nd;return this._pairs.map(function(e){return t(e[0])+`=`+t(e[1])},``).join(`&`)};function Id(e){return encodeURIComponent(e).replace(/%3A/gi,`:`).replace(/%24/g,`$`).replace(/%2C/gi,`,`).replace(/%20/g,`+`)}function Ld(e,t,n){if(!t)return e;let r=n&&n.encode||Id,i=z.isFunction(n)?{serialize:n}:n,a=i&&i.serialize,o;if(o=a?a(t,i):z.isURLSearchParams(t)?t.toString():new Pd(t,i).toString(r),o){let t=e.indexOf(`#`);t!==-1&&(e=e.slice(0,t)),e+=(e.indexOf(`?`)===-1?`?`:`&`)+o}return e}var Rd=class{constructor(){this.handlers=[]}use(e,t,n){return this.handlers.push({fulfilled:e,rejected:t,synchronous:n?n.synchronous:!1,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&=[]}forEach(e){z.forEach(this.handlers,function(t){t!==null&&e(t)})}},zd={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1,legacyInterceptorReqResOrdering:!0},Bd={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<`u`?URLSearchParams:Pd,FormData:typeof FormData<`u`?FormData:null,Blob:typeof Blob<`u`?Blob:null},protocols:[`http`,`https`,`file`,`blob`,`url`,`data`]},Vd=e({hasBrowserEnv:()=>Hd,hasStandardBrowserEnv:()=>Wd,hasStandardBrowserWebWorkerEnv:()=>Gd,navigator:()=>Ud,origin:()=>Kd}),Hd=typeof window<`u`&&typeof document<`u`,Ud=typeof navigator==`object`&&navigator||void 0,Wd=Hd&&(!Ud||[`ReactNative`,`NativeScript`,`NS`].indexOf(Ud.product)<0),Gd=typeof WorkerGlobalScope<`u`&&self instanceof WorkerGlobalScope&&typeof self.importScripts==`function`,Kd=Hd&&window.location.href||`http://localhost`,qd={...Vd,...Bd};function Jd(e,t){return Md(e,new qd.classes.URLSearchParams,{visitor:function(e,t,n,r){return qd.isNode&&z.isBuffer(e)?(this.append(t,e.toString(`base64`)),!1):r.defaultVisitor.apply(this,arguments)},...t})}function Yd(e){return z.matchAll(/\w+|\[(\w*)]/g,e).map(e=>e[0]===`[]`?``:e[1]||e[0])}function Xd(e){let t={},n=Object.keys(e),r,i=n.length,a;for(r=0;r<i;r++)a=n[r],t[a]=e[a];return t}function Zd(e){function t(e,n,r,i){let a=e[i++];if(a===`__proto__`)return!0;let o=Number.isFinite(+a),s=i>=e.length;return a=!a&&z.isArray(r)?r.length:a,s?(z.hasOwnProp(r,a)?r[a]=z.isArray(r[a])?r[a].concat(n):[r[a],n]:r[a]=n,!o):((!z.hasOwnProp(r,a)||!z.isObject(r[a]))&&(r[a]=[]),t(e,n,r[a],i)&&z.isArray(r[a])&&(r[a]=Xd(r[a])),!o)}if(z.isFormData(e)&&z.isFunction(e.entries)){let n={};return z.forEachEntry(e,(e,r)=>{t(Yd(e),r,n,0)}),n}return null}var Qd=(e,t)=>e!=null&&z.hasOwnProp(e,t)?e[t]:void 0;function $d(e,t,n){if(z.isString(e))try{return(t||JSON.parse)(e),z.trim(e)}catch(e){if(e.name!==`SyntaxError`)throw e}return(n||JSON.stringify)(e)}var ef={transitional:zd,adapter:[`xhr`,`http`,`fetch`],transformRequest:[function(e,t){let n=t.getContentType()||``,r=n.indexOf(`application/json`)>-1,i=z.isObject(e);if(i&&z.isHTMLForm(e)&&(e=new FormData(e)),z.isFormData(e))return r?JSON.stringify(Zd(e)):e;if(z.isArrayBuffer(e)||z.isBuffer(e)||z.isStream(e)||z.isFile(e)||z.isBlob(e)||z.isReadableStream(e))return e;if(z.isArrayBufferView(e))return e.buffer;if(z.isURLSearchParams(e))return t.setContentType(`application/x-www-form-urlencoded;charset=utf-8`,!1),e.toString();let a;
196if(i){let t=Qd(this,`formSerializer`);if(n.indexOf(`application/x-www-form-urlencoded`)>-1)return Jd(e,t).toString();if((a=z.isFileList(e))||n.indexOf(`multipart/form-data`)>-1){let n=Qd(this,`env`),r=n&&n.FormData;return Md(a?{"files[]":e}:e,r&&new r,t)}}return i||r?(t.setContentType(`application/json`,!1),$d(e)):e}],transformResponse:[function(e){let t=Qd(this,`transitional`)||ef.transitional,n=t&&t.forcedJSONParsing,r=Qd(this,`responseType`),i=r===`json`;if(z.isResponse(e)||z.isReadableStream(e))return e;if(e&&z.isString(e)&&(n&&!r||i)){let n=!(t&&t.silentJSONParsing)&&i;try{return JSON.parse(e,Qd(this,`parseReviver`))}catch(e){if(n)throw e.name===`SyntaxError`?Ed.from(e,Ed.ERR_BAD_RESPONSE,this,null,Qd(this,`response`)):e}}return e}],timeout:0,xsrfCookieName:`XSRF-TOKEN`,xsrfHeaderName:`X-XSRF-TOKEN`,maxContentLength:-1,maxBodyLength:-1,env:{FormData:qd.classes.FormData,Blob:qd.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:`application/json, text/plain, */*`,"Content-Type":void 0}}};z.forEach([`delete`,`get`,`head`,`post`,`put`,`patch`,`query`],e=>{ef.headers[e]={}});function tf(e,t){let n=this||ef,r=t||n,i=Sd.from(r.headers),a=r.data;return z.forEach(e,function(e){a=e.call(n,a,i.normalize(),t?t.status:void 0)}),i.normalize(),a}function nf(e){return!!(e&&e.__CANCEL__)}var rf=class extends Ed{constructor(e,t,n){super(e??`canceled`,Ed.ERR_CANCELED,t,n),this.name=`CanceledError`,this.__CANCEL__=!0}};function af(e,t,n){let r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new Ed(`Request failed with status code `+n.status,n.status>=400&&n.status<500?Ed.ERR_BAD_REQUEST:Ed.ERR_BAD_RESPONSE,n.config,n.request,n))}function of(e){let t=/^([-+\w]{1,25}):(?:\/\/)?/.exec(e);return t&&t[1]||``}function sf(e,t){e||=10;let n=Array(e),r=Array(e),i=0,a=0,o;return t=t===void 0?1e3:t,function(s){let c=Date.now(),l=r[a];o||=c,n[i]=s,r[i]=c;let u=a,d=0;for(;u!==i;)d+=n[u++],u%=e;if(i=(i+1)%e,i===a&&(a=(a+1)%e),c-o<t)return;let f=l&&c-l;return f?Math.round(d*1e3/f):void 0}}function cf(e,t){let n=0,r=1e3/t,i,a,o=(t,r=Date.now())=>{n=r,i=null,a&&=(clearTimeout(a),null),e(...t)};return[(...e)=>{let t=Date.now(),s=t-n;s>=r?o(e,t):(i=e,a||=setTimeout(()=>{a=null,o(i)},r-s))},()=>i&&o(i)]}var lf=(e,t,n=3)=>{let r=0,i=sf(50,250);return cf(n=>{if(!n||typeof n.loaded!=`number`)return;let a=n.loaded,o=n.lengthComputable?n.total:void 0,s=o==null?a:Math.min(a,o),c=Math.max(0,s-r),l=i(c);r=Math.max(r,s),e({loaded:s,total:o,progress:o?s/o:void 0,bytes:c,rate:l||void 0,estimated:l&&o?(o-s)/l:void 0,event:n,lengthComputable:o!=null,[t?`download`:`upload`]:!0})},n)},uf=(e,t)=>{let n=e!=null;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},df=e=>(...t)=>z.asap(()=>e(...t)),ff=qd.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,qd.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(qd.origin),qd.navigator&&/(msie|trident)/i.test(qd.navigator.userAgent)):()=>!0,pf=qd.hasStandardBrowserEnv?{write(e,t,n,r,i,a,o){if(typeof document>`u`)return;let s=[`${e}=${encodeURIComponent(t)}`];z.isNumber(n)&&s.push(`expires=${new Date(n).toUTCString()}`),z.isString(r)&&s.push(`path=${r}`),z.isString(i)&&s.push(`domain=${i}`),a===!0&&s.push(`secure`),z.isString(o)&&s.push(`SameSite=${o}`),document.cookie=s.join(`; `)},read(e){if(typeof document>`u`)return null;let t=document.cookie.split(`;`);for(let n=0;n<t.length;n++){let r=t[n].replace(/^\s+/,``),i=r.indexOf(`=`);if(i!==-1&&r.slice(0,i)===e)return decodeURIComponent(r.slice(i+1))}return null},remove(e){this.write(e,``,Date.now()-864e5,`/`)}}:{write(){},read(){return null},remove(){}};function mf(e){return typeof e==`string`?/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e):!1}function hf(e,t){return t?e.replace(/\/?\/$/,``)+`/`+t.replace(/^\/+/,``):e}function gf(e,t,n){let r=!mf(t);return e&&(r||n===!1)?hf(e,t):t}var _f=e=>e instanceof Sd?{...e}:e;function vf(e,t){t||={};let n=Object.create(null);Object.defineProperty(n,`hasOwnProperty`,{__proto__:null,value:Object.prototype.hasOwnProperty,enumerable:!1,writable:!0,configurable:!0});function r(e,t,n,r){return z.isPlainObject(e)&&z.isPlainObject(t)?z.merge.call({caseless:r},e,t):z.isPlainObject(t)?z.merge({},t):z.isArray(t)?t.slice():t}function i(e,t,n,i){if(!z.isUndefined(t))return r(e,t,n,i);if(!z.isUndefined(e))return r(void 0,e,n,i)}function a(e,t){if(!z.isUndefined(t))return r(void 0,t)}function o(e,t){if(!z.isUndefined(t))return r(void 0,t);
196if(!z.isUndefined(e))return r(void 0,e)}function s(n,i,a){if(z.hasOwnProp(t,a))return r(n,i);if(z.hasOwnProp(e,a))return r(void 0,n)}let c={url:a,method:a,data:a,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,withXSRFToken:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,allowedSocketPaths:o,responseEncoding:o,validateStatus:s,headers:(e,t,n)=>i(_f(e),_f(t),n,!0)};return z.forEach(Object.keys({...e,...t}),function(r){if(r===`__proto__`||r===`constructor`||r===`prototype`)return;let a=z.hasOwnProp(c,r)?c[r]:i,o=a(z.hasOwnProp(e,r)?e[r]:void 0,z.hasOwnProp(t,r)?t[r]:void 0,r);z.isUndefined(o)&&a!==s||(n[r]=o)}),n}var yf=[`content-type`,`content-length`];function bf(e,t,n){if(n!==`content-only`){e.set(t);return}Object.entries(t).forEach(([t,n])=>{yf.includes(t.toLowerCase())&&e.set(t,n)})}var xf=e=>encodeURIComponent(e).replace(/%([0-9A-F]{2})/gi,(e,t)=>String.fromCharCode(parseInt(t,16))),Sf=e=>{let t=vf({},e),n=e=>z.hasOwnProp(t,e)?t[e]:void 0,r=n(`data`),i=n(`withXSRFToken`),a=n(`xsrfHeaderName`),o=n(`xsrfCookieName`),s=n(`headers`),c=n(`auth`),l=n(`baseURL`),u=n(`allowAbsoluteUrls`),d=n(`url`);if(t.headers=s=Sd.from(s),t.url=Ld(gf(l,d,u),e.params,e.paramsSerializer),c&&s.set(`Authorization`,`Basic `+btoa((c.username||``)+`:`+(c.password?xf(c.password):``))),z.isFormData(r)&&(qd.hasStandardBrowserEnv||qd.hasStandardBrowserWebWorkerEnv?s.setContentType(void 0):z.isFunction(r.getHeaders)&&bf(s,r.getHeaders(),n(`formDataHeaderPolicy`))),qd.hasStandardBrowserEnv&&(z.isFunction(i)&&(i=i(t)),i===!0||i==null&&ff(t.url))){let e=a&&o&&pf.read(o);e&&s.set(a,e)}return t},Cf=typeof XMLHttpRequest<`u`&&function(e){return new Promise(function(t,n){let r=Sf(e),i=r.data,a=Sd.from(r.headers).normalize(),{responseType:o,onUploadProgress:s,onDownloadProgress:c}=r,l,u,d,f,p;function m(){f&&f(),p&&p(),r.cancelToken&&r.cancelToken.unsubscribe(l),r.signal&&r.signal.removeEventListener(`abort`,l)}let h=new XMLHttpRequest;h.open(r.method.toUpperCase(),r.url,!0),h.timeout=r.timeout;function g(){if(!h)return;let r=Sd.from(`getAllResponseHeaders`in h&&h.getAllResponseHeaders());af(function(e){t(e),m()},function(e){n(e),m()},{data:!o||o===`text`||o===`json`?h.responseText:h.response,status:h.status,statusText:h.statusText,headers:r,config:e,request:h}),h=null}`onloadend`in h?h.onloadend=g:h.onreadystatechange=function(){!h||h.readyState!==4||h.status===0&&!(h.responseURL&&h.responseURL.startsWith(`file:`))||setTimeout(g)},h.onabort=function(){h&&=(n(new Ed(`Request aborted`,Ed.ECONNABORTED,e,h)),m(),null)},h.onerror=function(t){let r=new Ed(t&&t.message?t.message:`Network Error`,Ed.ERR_NETWORK,e,h);r.event=t||null,n(r),m(),h=null},h.ontimeout=function(){let t=r.timeout?`timeout of `+r.timeout+`ms exceeded`:`timeout exceeded`,i=r.transitional||zd;r.timeoutErrorMessage&&(t=r.timeoutErrorMessage),n(new Ed(t,i.clarifyTimeoutError?Ed.ETIMEDOUT:Ed.ECONNABORTED,e,h)),m(),h=null},i===void 0&&a.setContentType(null),`setRequestHeader`in h&&z.forEach(pd(a),function(e,t){h.setRequestHeader(t,e)}),z.isUndefined(r.withCredentials)||(h.withCredentials=!!r.withCredentials),o&&o!==`json`&&(h.responseType=r.responseType),c&&([d,p]=lf(c,!0),h.addEventListener(`progress`,d)),s&&h.upload&&([u,f]=lf(s),h.upload.addEventListener(`progress`,u),h.upload.addEventListener(`loadend`,f)),(r.cancelToken||r.signal)&&(l=t=>{h&&=(n(!t||t.type?new rf(null,e,h):t),h.abort(),m(),null)},r.cancelToken&&r.cancelToken.subscribe(l),r.signal&&(r.signal.aborted?l():r.signal.addEventListener(`abort`,l)));let _=of(r.url);if(_&&!qd.protocols.includes(_)){n(new Ed(`Unsupported protocol `+_+`:`,Ed.ERR_BAD_REQUEST,e));return}h.send(i||null)})},wf=(e,t)=>{if(e=e?e.filter(Boolean):[],!t&&!e.length)return;let n=new AbortController,r=!1,i=function(e){if(!r){r=!0,o();let t=e instanceof Error?e:this.reason;n.abort(t instanceof Ed?t:new rf(t instanceof Error?t.message:t))}},a=t&&setTimeout(()=>{a=null,i(new Ed(`timeout of ${t}ms exceeded`,Ed.ETIMEDOUT))},t),o=()=>
196{e&&=(a&&clearTimeout(a),a=null,e.forEach(e=>{e.unsubscribe?e.unsubscribe(i):e.removeEventListener(`abort`,i)}),null)};e.forEach(e=>e.addEventListener(`abort`,i));let{signal:s}=n;return s.unsubscribe=()=>z.asap(o),s},Tf=function*(e,t){let n=e.byteLength;if(!t||n<t){yield e;return}let r=0,i;for(;r<n;)i=r+t,yield e.slice(r,i),r=i},Ef=async function*(e,t){for await(let n of Df(e))yield*Tf(n,t)},Df=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}let t=e.getReader();try{for(;;){let{done:e,value:n}=await t.read();if(e)break;yield n}}finally{await t.cancel()}},Of=(e,t,n,r)=>{let i=Ef(e,t),a=0,o,s=e=>{o||(o=!0,r&&r(e))};return new ReadableStream({async pull(e){try{let{done:t,value:r}=await i.next();if(t){s(),e.close();return}let o=r.byteLength;n&&n(a+=o),e.enqueue(new Uint8Array(r))}catch(e){throw s(e),e}},cancel(e){return s(e),i.return()}},{highWaterMark:2})};function kf(e){if(!e||typeof e!=`string`||!e.startsWith(`data:`))return 0;let t=e.indexOf(`,`);if(t<0)return 0;let n=e.slice(5,t),r=e.slice(t+1);if(/;base64/i.test(n)){let e=r.length,t=r.length;for(let n=0;n<t;n++)if(r.charCodeAt(n)===37&&n+2<t){let t=r.charCodeAt(n+1),i=r.charCodeAt(n+2);(t>=48&&t<=57||t>=65&&t<=70||t>=97&&t<=102)&&(i>=48&&i<=57||i>=65&&i<=70||i>=97&&i<=102)&&(e-=2,n+=2)}let n=0,i=t-1,a=e=>e>=2&&r.charCodeAt(e-2)===37&&r.charCodeAt(e-1)===51&&(r.charCodeAt(e)===68||r.charCodeAt(e)===100);i>=0&&(r.charCodeAt(i)===61?(n++,i--):a(i)&&(n++,i-=3)),n===1&&i>=0&&(r.charCodeAt(i)===61||a(i))&&n++;let o=Math.floor(e/4)*3-(n||0);return o>0?o:0}if(typeof Buffer<`u`&&typeof Buffer.byteLength==`function`)return Buffer.byteLength(r,`utf8`);let i=0;for(let e=0,t=r.length;e<t;e++){let n=r.charCodeAt(e);if(n<128)i+=1;else if(n<2048)i+=2;else if(n>=55296&&n<=56319&&e+1<t){let t=r.charCodeAt(e+1);t>=56320&&t<=57343?(i+=4,e++):i+=3}else i+=3}return i}var Af=`1.16.1`,jf=64*1024,{isFunction:Mf}=z,Nf=(e,...t)=>{try{return!!e(...t)}catch{return!1}},Pf=e=>{let t=z.global!==void 0&&z.global!==null?z.global:globalThis,{ReadableStream:n,TextEncoder:r}=t;e=z.merge.call({skipUndefined:!0},{Request:t.Request,Response:t.Response},e);let{fetch:i,Request:a,Response:o}=e,s=i?Mf(i):typeof fetch==`function`,c=Mf(a),l=Mf(o);if(!s)return!1;let u=s&&Mf(n),d=s&&(typeof r==`function`?(e=>t=>e.encode(t))(new r):async e=>new Uint8Array(await new a(e).arrayBuffer())),f=c&&u&&Nf(()=>{let e=!1,t=new a(qd.origin,{body:new n,method:`POST`,get duplex(){return e=!0,`half`}}),r=t.headers.has(`Content-Type`);return t.body!=null&&t.body.cancel(),e&&!r}),p=l&&u&&Nf(()=>z.isReadableStream(new o(``).body)),m={stream:p&&(e=>e.body)};s&&[`text`,`arrayBuffer`,`blob`,`formData`,`stream`].forEach(e=>{!m[e]&&(m[e]=(t,n)=>{let r=t&&t[e];if(r)return r.call(t);throw new Ed(`Response type '${e}' is not supported`,Ed.ERR_NOT_SUPPORT,n)})});let h=async e=>{if(e==null)return 0;if(z.isBlob(e))return e.size;if(z.isSpecCompliantForm(e))return(await new a(qd.origin,{method:`POST`,body:e}).arrayBuffer()).byteLength;if(z.isArrayBufferView(e)||z.isArrayBuffer(e))return e.byteLength;if(z.isURLSearchParams(e)&&(e+=``),z.isString(e))return(await d(e)).byteLength},g=async(e,t)=>z.toFiniteNumber(e.getContentLength())??h(t);return async e=>{let{url:t,method:n,data:s,signal:l,cancelToken:u,timeout:d,onDownloadProgress:h,onUploadProgress:_,responseType:v,headers:y,withCredentials:b=`same-origin`,fetchOptions:x,maxContentLength:S,maxBodyLength:C}=Sf(e),w=z.isNumber(S)&&S>-1,T=z.isNumber(C)&&C>-1,E=i||fetch;v=v?(v+``).toLowerCase():`text`;let D=wf([l,u&&u.toAbortSignal()],d),O=null,k=D&&D.unsubscribe&&(()=>{D.unsubscribe()}),A;try{if(w&&typeof t==`string`&&t.startsWith(`data:`)&&kf(t)>S)throw new Ed(`maxContentLength size of `+S+` exceeded`,Ed.ERR_BAD_RESPONSE,e,O);if(T&&n!==`get`&&n!==`head`){let t=await g(y,s);if(typeof t==`number`&&isFinite(t)&&t>C)throw new Ed(`Request body larger than maxBodyLength limit`,Ed.ERR_BAD_REQUEST,e,O)}if(_&&f&&n!==`get`&&n!==`head`&&(A=await g(y,s))!==0){let e=new a(t,{method:`POST`,body:s,duplex:`half`}),n;if(z.isFormData(s)&&(n=e.headers.get(`content-type`))&&y.setContentType(n),e.body){let[t,n]=uf(A,lf(df(_)));s=Of(e.body,jf,t,n)}}z.isString(b)||(b=b?`include`:`omit`);let i=c&&`credentials`in a.prototype;
196if(z.isFormData(s)){let e=y.getContentType();e&&/^multipart\/form-data/i.test(e)&&!/boundary=/i.test(e)&&y.delete(`content-type`)}y.set(`User-Agent`,`axios/`+Af,!1);let l={...x,signal:D,method:n.toUpperCase(),headers:pd(y.normalize()),body:s,duplex:`half`,credentials:i?b:void 0};O=c&&new a(t,l);let u=await(c?E(O,x):E(t,l));if(w){let t=z.toFiniteNumber(u.headers.get(`content-length`));if(t!=null&&t>S)throw new Ed(`maxContentLength size of `+S+` exceeded`,Ed.ERR_BAD_RESPONSE,e,O)}let d=p&&(v===`stream`||v===`response`);if(p&&u.body&&(h||w||d&&k)){let t={};[`status`,`statusText`,`headers`].forEach(e=>{t[e]=u[e]});let n=z.toFiniteNumber(u.headers.get(`content-length`)),[r,i]=h&&uf(n,lf(df(h),!0))||[],a=0;u=new o(Of(u.body,jf,t=>{if(w&&(a=t,a>S))throw new Ed(`maxContentLength size of `+S+` exceeded`,Ed.ERR_BAD_RESPONSE,e,O);r&&r(t)},()=>{i&&i(),k&&k()}),t)}v||=`text`;let j=await m[z.findKey(m,v)||`text`](u,e);if(w&&!p&&!d){let t;if(j!=null&&(typeof j.byteLength==`number`?t=j.byteLength:typeof j.size==`number`?t=j.size:typeof j==`string`&&(t=typeof r==`function`?new r().encode(j).byteLength:j.length)),typeof t==`number`&&t>S)throw new Ed(`maxContentLength size of `+S+` exceeded`,Ed.ERR_BAD_RESPONSE,e,O)}return!d&&k&&k(),await new Promise((t,n)=>{af(t,n,{data:j,headers:Sd.from(u.headers),status:u.status,statusText:u.statusText,config:e,request:O})})}catch(t){if(k&&k(),D&&D.aborted&&D.reason instanceof Ed){let n=D.reason;throw n.config=e,O&&(n.request=O),t!==n&&(n.cause=t),n}throw t&&t.name===`TypeError`&&/Load failed|fetch/i.test(t.message)?Object.assign(new Ed(`Network Error`,Ed.ERR_NETWORK,e,O,t&&t.response),{cause:t.cause||t}):Ed.from(t,t&&t.code,e,O,t&&t.response)}}},Ff=new Map,If=e=>{let t=e&&e.env||{},{fetch:n,Request:r,Response:i}=t,a=[r,i,n],o=a.length,s,c,l=Ff;for(;o--;)s=a[o],c=l.get(s),c===void 0&&l.set(s,c=o?new Map:Pf(t)),l=c;return c};If();var Lf={http:null,xhr:Cf,fetch:{get:If}};z.forEach(Lf,(e,t)=>{if(e){try{Object.defineProperty(e,`name`,{__proto__:null,value:t})}catch{}Object.defineProperty(e,`adapterName`,{__proto__:null,value:t})}});var Rf=e=>`- ${e}`,zf=e=>z.isFunction(e)||e===null||e===!1;function Bf(e,t){e=z.isArray(e)?e:[e];let{length:n}=e,r,i,a={};for(let o=0;o<n;o++){r=e[o];let n;if(i=r,!zf(r)&&(i=Lf[(n=String(r)).toLowerCase()],i===void 0))throw new Ed(`Unknown adapter '${n}'`);if(i&&(z.isFunction(i)||(i=i.get(t))))break;a[n||`#`+o]=i}if(!i){let e=Object.entries(a).map(([e,t])=>`adapter ${e} `+(t===!1?`is not supported by the environment`:`is not available in the build`));throw new Ed(`There is no suitable adapter to dispatch the request `+(n?e.length>1?`since :
197`+e.map(Rf).join(`
198`):` `+Rf(e[0]):`as no adapter specified`),`ERR_NOT_SUPPORT`)}return i}var Vf={getAdapter:Bf,adapters:Lf};function Hf(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new rf(null,e)}function Uf(e){return Hf(e),e.headers=Sd.from(e.headers),e.data=tf.call(e,e.transformRequest),[`post`,`put`,`patch`].indexOf(e.method)!==-1&&e.headers.setContentType(`application/x-www-form-urlencoded`,!1),Vf.getAdapter(e.adapter||ef.adapter,e)(e).then(function(t){Hf(e),e.response=t;try{t.data=tf.call(e,e.transformResponse,t)}finally{delete e.response}return t.headers=Sd.from(t.headers),t},function(t){if(!nf(t)&&(Hf(e),t&&t.response)){e.response=t.response;try{t.response.data=tf.call(e,e.transformResponse,t.response)}finally{delete e.response}t.response.headers=Sd.from(t.response.headers)}return Promise.reject(t)})}var Wf={};[`object`,`boolean`,`number`,`function`,`string`,`symbol`].forEach((e,t)=>{Wf[e]=function(n){return typeof n===e||`a`+(t<1?`n `:` `)+e}});var Gf={};Wf.transitional=function(e,t,n){function r(e,t){return`[Axios v`+Af+`] Transitional option '`+e+`'`+t+(n?`. `+n:``)}return(n,i,a)=>{if(e===!1)throw new Ed(r(i,` has been removed`+(t?` in `+t:``)),Ed.ERR_DEPRECATED);return t&&!Gf[i]&&(Gf[i]=!0,console.warn(r(i,` has been deprecated since v`+t+` and will be removed in the near future`))),e?e(n,i,a):!0}},Wf.spelling=function(e){return(t,n)=>(console.warn(`${n} is likely a misspelling of ${e}`),!0)};function Kf(e,t,n){if(typeof e!=`object`)throw new Ed(`options must be an object`,Ed.ERR_BAD_OPTION_VALUE);let r=Object.keys(e),i=r.length;for(;i-- >0;){let a=r[i],o=Object.prototype.hasOwnProperty.call(t,a)?t[a]:void 0;if(o){let t=e[a],n=t===void 0||o(t,a,e);if(n!==!0)throw new Ed(`option `+a+` must be `+n,Ed.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new Ed(`Unknown option `+a,Ed.ERR_BAD_OPTION)}}var qf={assertOptions:Kf,validators:Wf},Jf=qf.validators,Yf=class{constructor(e){this.defaults=e||{},this.interceptors={request:new Rd,response:new Rd}}async request(e,t){try{return await this._request(e,t)}catch(e){if(e instanceof Error){let t={};Error.captureStackTrace?Error.captureStackTrace(t):t=Error();let n=(()=>
198{if(!t.stack)return``;let e=t.stack.indexOf(`
199`);return e===-1?``:t.stack.slice(e+1)})();try{if(!e.stack)e.stack=n;else if(n){let t=n.indexOf(`
200`),r=t===-1?-1:n.indexOf(`
201`,t+1),i=r===-1?``:n.slice(r+1);String(e.stack).endsWith(i)||(e.stack+=`
202`+n)}}catch{}}throw e}}_request(e,t){typeof e==`string`?(t||={},t.url=e):t=e||{},t=vf(this.defaults,t);let{transitional:n,paramsSerializer:r,headers:i}=t;n!==void 0&&qf.assertOptions(n,{silentJSONParsing:Jf.transitional(Jf.boolean),forcedJSONParsing:Jf.transitional(Jf.boolean),clarifyTimeoutError:Jf.transitional(Jf.boolean),legacyInterceptorReqResOrdering:Jf.transitional(Jf.boolean)},!1),r!=null&&(z.isFunction(r)?t.paramsSerializer={serialize:r}:qf.assertOptions(r,{encode:Jf.function,serialize:Jf.function},!0)),t.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls===void 0?t.allowAbsoluteUrls=!0:t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls),qf.assertOptions(t,{baseUrl:Jf.spelling(`baseURL`),withXsrfToken:Jf.spelling(`withXSRFToken`)},!0),t.method=(t.method||this.defaults.method||`get`).toLowerCase();let a=i&&z.merge(i.common,i[t.method]);i&&z.forEach([`delete`,`get`,`head`,`post`,`put`,`patch`,`query`,`common`],e=>{delete i[e]}),t.headers=Sd.concat(a,i);let o=[],s=!0;this.interceptors.request.forEach(function(e){if(typeof e.runWhen==`function`&&e.runWhen(t)===!1)return;s&&=e.synchronous;let n=t.transitional||zd;n&&n.legacyInterceptorReqResOrdering?o.unshift(e.fulfilled,e.rejected):o.push(e.fulfilled,e.rejected)});let c=[];this.interceptors.response.forEach(function(e){c.push(e.fulfilled,e.rejected)});let l,u=0,d;if(!s){let e=[Uf.bind(this),void 0];for(e.unshift(...o),e.push(...c),d=e.length,l=Promise.resolve(t);u<d;)l=l.then(e[u++],e[u++]);return l}d=o.length;let f=t;for(;u<d;){let e=o[u++],t=o[u++];try{f=e(f)}catch(e){t.call(this,e);break}}try{l=Uf.call(this,f)}catch(e){return Promise.reject(e)}for(u=0,d=c.length;u<d;)l=l.then(c[u++],c[u++]);return l}getUri(e){return e=vf(this.defaults,e),Ld(gf(e.baseURL,e.url,e.allowAbsoluteUrls),e.params,e.paramsSerializer)}};z.forEach([`delete`,`get`,`head`,`options`],function(e){Yf.prototype[e]=function(t,n){return this.request(vf(n||{},{method:e,url:t,data:(n||{}).data}))}}),z.forEach([`post`,`put`,`patch`,`query`],function(e){function t(t){return function(n,r,i){return this.request(vf(i||{},{method:e,headers:t?{"Content-Type":`multipart/form-data`}:{},url:n,data:r}))}}Yf.prototype[e]=t(),e!==`query`&&(Yf.prototype[e+`Form`]=t(!0))});var Xf=class e{constructor(e){if(typeof e!=`function`)throw TypeError(`executor must be a function.`);let t;this.promise=new Promise(function(e){t=e});let n=this;this.promise.then(e=>{if(!n._listeners)return;let t=n._listeners.length;for(;t-- >0;)n._listeners[t](e);n._listeners=null}),this.promise.then=e=>{let t,r=new Promise(e=>{n.subscribe(e),t=e}).then(e);return r.cancel=function(){n.unsubscribe(t)},r},e(function(e,r,i){n.reason||(n.reason=new rf(e,r,i),t(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;let t=this._listeners.indexOf(e);t!==-1&&this._listeners.splice(t,1)}toAbortSignal(){let e=new AbortController,t=t=>{e.abort(t)};return this.subscribe(t),e.signal.unsubscribe=()=>this.unsubscribe(t),e.signal}static source(){let t;return{token:new e(function(e){t=e}),cancel:t}}};function Zf(e){return function(t){return e.apply(null,t)}}function Qf(e){return z.isObject(e)&&e.isAxiosError===!0}var $f={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,Parti
202alContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries($f).forEach(([e,t])=>{$f[t]=e});function ep(e){let t=new Yf(e),n=Jl(Yf.prototype.request,t);return z.extend(n,Yf.prototype,t,{allOwnKeys:!0}),z.extend(n,t,null,{allOwnKeys:!0}),n.create=function(t){return ep(vf(e,t))},n}var tp=ep(ef);tp.Axios=Yf,tp.CanceledError=rf,tp.CancelToken=Xf,tp.isCancel=nf,tp.VERSION=Af,tp.toFormData=Md,tp.AxiosError=Ed,tp.Cancel=tp.CanceledError,tp.all=function(e){return Promise.all(e)},tp.spread=Zf,tp.isAxiosError=Qf,tp.mergeConfig=vf,tp.AxiosHeaders=Sd,tp.formToJSON=e=>Zd(z.isHTMLForm(e)?new FormData(e):e),tp.getAdapter=Vf.getAdapter,tp.HttpStatusCode=$f,tp.default=tp;var np=tp.create({baseURL:`https://interview-pro-4br8.vercel.app/api`,withCredentials:!0});np.interceptors.request.use(async e=>{let t=await window.Clerk?.session?.getToken();return t&&(e.headers.Authorization=`Bearer ${t}`),e});var rp={createSession:async e=>(await np.post(`/sessions`,e)).data,getActiveSessions:async()=>(await np.get(`/sessions/active`)).data,getMyRecentSessions:async()=>(await np.get(`/sessions/my-recent-sessions`)).data,getSessionById:async e=>(await np.get(`/sessions/${e}`)).data,joinSession:async e=>(await np.post(`/sessions/${e}/join`)).data,endSession:async e=>(await np.post(`/sessions/${e}/end`)).data,getStreamToken:async()=>(await np.get(`/chat/token`)).data,heartbeat:async e=>(await np.post(`/sessions/${e}/heartbeat`)).data},ip=()=>{let e=yc();return Fc({mutationKey:[`createSession`],mutationFn:rp.createSession,onSuccess:()=>{ql.success(`Session created successfully!`),e.invalidateQueries({queryKey:[`activeSessions`]})},onError:e=>ql.error(e.response?.data?.message||`Failed to create room`)})},ap=()=>Pc({queryKey:[`activeSessions`],queryFn:rp.getActiveSessions}),op=()=>Pc({queryKey:[`my-recent-sessions`],queryFn:rp.getMyRecentSessions}),sp=e=>Pc({queryKey:[`session`,e],queryFn:()=>rp.getSessionById(e),enabled:!!e,refetchInterval:5e3}),cp=()=>{let e=yc();return Fc({mutationKey:[`joinSession`],mutationFn:rp.joinSession,onSuccess:()=>{ql.success(`Joined session successfully!`),e.invalidateQueries({queryKey:[`activeSessions`]})},onError:e=>ql.error(e.response?.data?.message||`Failed to join session`)})},lp=()=>{let e=yc();return Fc({mutationKey:[`endSession`],mutationFn:rp.endSession,onSuccess:()=>{ql.success(`Session ended successfully!`),e.invalidateQueries({queryKey:[`activeSessions`]}),e.invalidateQueries({queryKey:[`myRecentSessions`]})},onError:e=>ql.error(e.response?.data?.message||`Failed to end session`)})},up=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),dp=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase(),fp=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,n)=>n?n.toUpperCase():t.toLowerCase()),pp=e=>{let t=fp(e);return t.charAt(0).toUpperCase()+t.slice(1)},mp={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`},hp=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},gp=(0,d.createContext)({}),_p=()=>(0,d.useContext)(gp),vp=(0,d.forwardRef)(({color:e,size:t,strokeWidth:n,absoluteStrokeWidth:r,className:i=``,children:a,iconNode:o,...s},c)=>
202{let{size:l=24,strokeWidth:u=2,absoluteStrokeWidth:f=!1,color:p=`currentColor`,className:m=``}=_p()??{},h=r??f?Number(n??u)*24/Number(t??l):n??u;return(0,d.createElement)(`svg`,{ref:c,...mp,width:t??l??mp.width,height:t??l??mp.height,stroke:e??p,strokeWidth:h,className:up(`lucide`,m,i),...!a&&!hp(s)&&{"aria-hidden":`true`},...s},[...o.map(([e,t])=>(0,d.createElement)(e,t)),...Array.isArray(a)?a:[a]])}),yp=(e,t)=>{let n=(0,d.forwardRef)(({className:n,...r},i)=>(0,d.createElement)(vp,{ref:i,iconNode:t,className:up(`lucide-${dp(pp(e))}`,`lucide-${e}`,n),...r}));return n.displayName=pp(e),n},bp=yp(`arrow-right`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`m12 5 7 7-7 7`,key:`xquz4c`}]]),xp=yp(`book-open`,[[`path`,{d:`M12 7v14`,key:`1akyts`}],[`path`,{d:`M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z`,key:`ruj8y`}]]),Sp=yp(`bookmark`,[[`path`,{d:`M17 3a2 2 0 0 1 2 2v15a1 1 0 0 1-1.496.868l-4.512-2.578a2 2 0 0 0-1.984 0l-4.512 2.578A1 1 0 0 1 5 20V5a2 2 0 0 1 2-2z`,key:`oz39mx`}]]),Cp=yp(`check`,[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]),wp=yp(`chevron-right`,[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]),Tp=yp(`circle-check-big`,[[`path`,{d:`M21.801 10A10 10 0 1 1 17 3.335`,key:`yps3ct`}],[`path`,{d:`m9 11 3 3L22 4`,key:`1pflzl`}]]),Ep=yp(`circle-x`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m15 9-6 6`,key:`1uzhvr`}],[`path`,{d:`m9 9 6 6`,key:`z0biqf`}]]),Dp=yp(`clock`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 6v6l4 2`,key:`mmk7yg`}]]),Op=yp(`code-xml`,[[`path`,{d:`m18 16 4-4-4-4`,key:`1inbqp`}],[`path`,{d:`m6 8-4 4 4 4`,key:`15zrgr`}],[`path`,{d:`m14.5 4-5 16`,key:`e7oirm`}]]),kp=yp(`crown`,[[`path`,{d:`M11.562 3.266a.5.5 0 0 1 .876 0L15.39 8.87a1 1 0 0 0 1.516.294L21.183 5.5a.5.5 0 0 1 .798.519l-2.834 10.246a1 1 0 0 1-.956.734H5.81a1 1 0 0 1-.957-.734L2.02 6.02a.5.5 0 0 1 .798-.519l4.276 3.664a1 1 0 0 0 1.516-.294z`,key:`1vdc57`}],[`path`,{d:`M5 21h14`,key:`11awu3`}]]),Ap=yp(`layout-dashboard`,[[`rect`,{width:`7`,height:`9`,x:`3`,y:`3`,rx:`1`,key:`10lvy0`}],[`rect`,{width:`7`,height:`5`,x:`14`,y:`3`,rx:`1`,key:`16une8`}],[`rect`,{width:`7`,height:`9`,x:`14`,y:`12`,rx:`1`,key:`1hutg5`}],[`rect`,{width:`7`,height:`5`,x:`3`,y:`16`,rx:`1`,key:`ldoo1y`}]]),jp=yp(`layout-list`,[[`rect`,{width:`7`,height:`7`,x:`3`,y:`3`,rx:`1`,key:`1g98yp`}],[`rect`,{width:`7`,height:`7`,x:`3`,y:`14`,rx:`1`,key:`1bb6yr`}],[`path`,{d:`M14 4h7`,key:`3xa0d5`}],[`path`,{d:`M14 9h7`,key:`1icrd9`}],[`path`,{d:`M14 15h7`,key:`1mj8o2`}],[`path`,{d:`M14 20h7`,key:`11slyb`}]]),Mp=yp(`loader-circle`,[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]]),Np=yp(`loader`,[[`path`,{d:`M12 2v4`,key:`3427ic`}],[`path`,{d:`m16.2 7.8 2.9-2.9`,key:`r700ao`}],[`path`,{d:`M18 12h4`,key:`wj9ykh`}],[`path`,{d:`m16.2 16.2 2.9 2.9`,key:`1bxg5t`}],[`path`,{d:`M12 18v4`,key:`jadmvz`}],[`path`,{d:`m4.9 19.1 2.9-2.9`,key:`bwix9q`}],[`path`,{d:`M2 12h4`,key:`j09sii`}],[`path`,{d:`m4.9 4.9 2.9 2.9`,key:`giyufr`}]]),Pp=yp(`log-out`,[[`path`,{d:`m16 17 5-5-5-5`,key:`1bji2h`}],[`path`,{d:`M21 12H9`,key:`dn1m92`}],[`path`,{d:`M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4`,key:`1uf3rs`}]]),Fp=yp(`message-square`,[[`path`,{d:`M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z`,key:`18887p`}]]),Ip=yp(`phone-off`,[[`path`,{d:`M10.1 13.9a14 14 0 0 0 3.732 2.668 1 1 0 0 0 1.213-.303l.355-.465A2 2 0 0 1 17 15h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2 18 18 0 0 1-12.728-5.272`,key:`1wngk7`}],[`path`,{d:`M22 2 2 22`,key:`y4kqgn`}],[`path`,{d:`M4.76 13.582A18 18 0 0 1 2 4a2 2 0 0 1 2-2h3a2 2 0 0 1 2 2v3a2 2 0 0 1-.8 1.6l-.468.351a1 1 0 0 0-.292 1.233 14 14 0 0 0 .244.473`,key:`10hv5p`}]]),Lp=yp(`play`,[[`path`,{d:`M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z`,key:`10ikf1`}]]),Rp=yp(`plus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]),zp=yp(`search`,[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]),Bp=yp(`sparkles`,[[`path`,{d:`M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 
2021.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z`,key:`1s2grr`}],[`path`,{d:`M20 2v4`,key:`1rf3ol`}],[`path`,{d:`M22 4h-4`,key:`gwowj6`}],[`circle`,{cx:`4`,cy:`20`,r:`2`,key:`6kqj1y`}]]),Vp=yp(`terminal`,[[`path`,{d:`M12 19h8`,key:`baeox8`}],[`path`,{d:`m4 17 6-6-6-6`,key:`1yngyt`}]]),Hp=yp(`trophy`,[[`path`,{d:`M10 14.66v1.626a2 2 0 0 1-.976 1.696A5 5 0 0 0 7 21.978`,key:`1n3hpd`}],[`path`,{d:`M14 14.66v1.626a2 2 0 0 0 .976 1.696A5 5 0 0 1 17 21.978`,key:`rfe1zi`}],[`path`,{d:`M18 9h1.5a1 1 0 0 0 0-5H18`,key:`7xy6bh`}],[`path`,{d:`M4 22h16`,key:`57wxv0`}],[`path`,{d:`M6 9a6 6 0 0 0 12 0V3a1 1 0 0 0-1-1H7a1 1 0 0 0-1 1z`,key:`1mhfuq`}],[`path`,{d:`M6 9H4.5a1 1 0 0 1 0-5H6`,key:`tex48p`}]]),Up=yp(`users`,[[`path`,{d:`M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2`,key:`1yyitq`}],[`path`,{d:`M16 3.128a4 4 0 0 1 0 7.744`,key:`16gr8j`}],[`path`,{d:`M22 21v-2a4 4 0 0 0-3-3.87`,key:`kshegd`}],[`circle`,{cx:`9`,cy:`7`,r:`4`,key:`nufk8`}]]),Wp=yp(`video`,[[`path`,{d:`m16 13 5.223 3.482a.5.5 0 0 0 .777-.416V7.87a.5.5 0 0 0-.752-.432L16 10.5`,key:`ftymec`}],[`rect`,{x:`2`,y:`6`,width:`14`,height:`12`,rx:`2`,key:`158x01`}]]),Gp=yp(`waypoints`,[[`path`,{d:`m10.586 5.414-5.172 5.172`,key:`4mc350`}],[`path`,{d:`m18.586 13.414-5.172 5.172`,key:`8c96vv`}],[`path`,{d:`M6 12h12`,key:`8npq4p`}],[`circle`,{cx:`12`,cy:`20`,r:`2`,key:`144qzu`}],[`circle`,{cx:`12`,cy:`4`,r:`2`,key:`muu5ef`}],[`circle`,{cx:`20`,cy:`12`,r:`2`,key:`1xzzfp`}],[`circle`,{cx:`4`,cy:`12`,r:`2`,key:`1hvhnz`}]]),Kp=yp(`x`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]),qp=yp(`zap`,[[`path`,{d:`M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z`,key:`1xq2db`}]]);function Jp(){let e=Mo(),t=t=>e.pathname===t;return(0,R.jsx)(`nav`,{className:`sticky top-0 z-50 border-b border-[#E0D9CF] bg-[#F5F0E8]`,children:(0,R.jsxs)(`div`,{className:`max-w-7xl mx-auto h-16 px-6 flex items-center relative`,children:[(0,R.jsx)(`div`,{className:`flex-1 flex justify-start`,children:(0,R.jsxs)(ec,{to:`/`,className:`flex items-center gap-2 hover:opacity-80 transition-opacity`,children:[(0,R.jsx)(`div`,{className:`size-8 rounded-lg border-2 border-[#1A1A1A] flex items-center justify-center`,children:(0,R.jsx)(Gp,{className:`size-5 text-[#1A1A1A]`,strokeWidth:2.2})}),(0,R.jsx)(`span`,{className:`text-[21px] font-semibold tracking-tight text-[#1A1A1A]`,children:`InterviewPro`})]})}),(0,R.jsxs)(`div`,{className:`absolute left-1/2 -translate-x-1/2 flex items-center gap-2`,children:[(0,R.jsxs)(ec,{to:`/dashboard`,className:`flex items-center gap-2 px-4 py-2 rounded-full transition-all duration-200`,style:{backgroundColor:t(`/dashboard`)?`#1A1A1A`:`transparent`,color:t(`/dashboard`)?`white`:`#6B7280`},children:[(0,R.jsx)(Ap,{className:`size-4`}),(0,R.jsx)(`span`,{className:`font-medium`,children:`Dashboard`})]}),(0,R.jsxs)(ec,{to:`/problems`,className:`flex items-center gap-2 px-4 py-2 rounded-full transition-all duration-200`,style:{backgroundColor:t(`/problems`)?`#1A1A1A`:`transparent`,color:t(`/problems`)?`white`:`#6B7280`},children:[(0,R.jsx)(xp,{className:`size-4`}),(0,R.jsx)(`span`,{className:`font-medium`,children:`Problems`})]})]}),(0,R.jsx)(`div`,{className:`flex-1 flex justify-end`,children:(0,R.jsx)(Nr,{})})]})})}function Yp({onCreateSession:e,activeSessionsCount:t}){let{user:n}=Ut(),r=`${n?.firstName?.[0]||``}${n?.lastName?.[0]||``}`.toUpperCase();return(0,R.jsx)(`div`,{className:`pt-16 pb-8`,children:(0,R.jsxs)(`div`,{className:`flex items-start justify-between gap-8`,children:[(0,R.jsxs)(`div`,{className:`flex-1`,children:[(0,R.jsxs)(`div`,{className:`flex items-center gap-2 mb-5`,children:[(0,R.jsx)(`span`,{className:`text-xs`,children:`♦`}),(0,R.jsx)(`span`,{className:`text-xs font-semibold tracking-widest text-[#9B9590] uppercase`,children:`Dashboard / Welcome`})]}),(0,R.jsxs)(`h1`,{className:`text-[48px] leading-[1.05] font-bold text-[#111111] mb-5`,style:{fontFamily:`'Playfair Display', serif`},children:[`Welcome back, `,n?.firstName||`there`,`.`,` `,`Ready to `,(0,R.jsx)(`em`,{children:`level up`}),` your craft?`]}),(0,R.jsx)(`p`,{className:`text-[15px] leading-7 text-[#667085] max-w-lg mb-8`,children:`A focused workspace for live collaborative coding interviews — track active rooms, replay past sessions, and jump back in where you left off.`}),(0,R.jsxs)(`button`,{onClick:e,className:`flex items-center rounded-full overflow-hidden`,style:{backgroundColor:`#111111`},children:[(0,R.jsx)(`span`,{className:`px-6 py-3 text-white font-semibold text-sm`,children:`Create session`}),(0,R.jsx)(`div`,{className:`size-10 rounded-full flex items-center justify-center m-1`,style:{backgroundColor:`#FFD60A`},children:(0,R.jsx)(bp,{className:`size-4 text-[#111111]`})})]})]}),(0,R.jsx)(`div`,{className:`flex-shrink-0 w-[280px]`,children:(0,R.jsxs)(`div`,{className:`rounded-[28px] border border-[#
202E8DED2] overflow-hidden`,style:{boxShadow:`0 10px 30px rgba(0,0,0,0.06)`},children:[(0,R.jsxs)(`div`,{className:`relative h-[110px]`,style:{background:`linear-gradient(135deg, #FF7A1A 0%, #F25C19 45%, #E24D12 100%)`},children:[(0,R.jsx)(`div`,{className:`absolute inset-0 opacity-30`,style:{background:`radial-gradient(circle at 30% 30%, rgba(255,255,255,0.35), transparent 45%)`}}),t>0&&(0,R.jsxs)(`div`,{className:`absolute top-4 left-4 flex items-center gap-2 px-3 py-1 rounded-full bg-white shadow-sm`,children:[(0,R.jsx)(`span`,{className:`size-2 rounded-full bg-red-400 animate-pulse`}),(0,R.jsxs)(`span`,{className:`text-[11px] font-bold text-[#111111]`,children:[t,` LIVE NOW`]})]}),(0,R.jsx)(`div`,{className:`absolute left-1/2 top-full -translate-x-1/2 -translate-y-1/2`,children:(0,R.jsx)(`div`,{className:`size-20 rounded-full border-4 border-white bg-[#EFE9DF] shadow-lg overflow-hidden flex items-center justify-center`,children:n?.imageUrl?(0,R.jsx)(`img`,{src:n.imageUrl,alt:``,className:`size-full object-cover`}):(0,R.jsx)(`span`,{className:`text-2xl font-bold text-[#111111]`,style:{fontFamily:`'Playfair Display', serif`},children:r})})})]}),(0,R.jsxs)(`div`,{className:`pt-12 pb-5 px-5 text-center`,style:{backgroundColor:`#FCFBF8`},children:[(0,R.jsxs)(`h3`,{className:`text-[18px] font-bold text-[#111111] mb-1`,style:{fontFamily:`'Playfair Display', serif`},children:[n?.firstName,` `,n?.lastName]}),(0,R.jsx)(`p`,{className:`text-[13px] text-[#7D766F] truncate mb-3`,children:n?.emailAddresses?.[0]?.emailAddress}),(0,R.jsxs)(`div`,{className:`flex items-center justify-center gap-3 text-[11px] text-[#8B8378]`,children:[(0,R.jsx)(`span`,{className:`px-3 py-1 rounded-full font-semibold`,style:{backgroundColor:`#F2EAE2`,color:`#5E564D`},children:`Developer`}),(0,R.jsx)(`span`,{className:`size-1 rounded-full`,style:{backgroundColor:`#C7BBAE`}}),(0,R.jsx)(`span`,{children:`14-day streak`})]})]})]})})]})})}function Xp({activeSessionsCount:e,recentSessionsCount:t}){return(0,R.jsxs)(`div`,{className:`lg:col-span-1 grid grid-cols-1 gap-6`,children:[(0,R.jsxs)(`div`,{className:`rounded-2xl border border-[#E0D9CF] p-6`,style:{backgroundColor:`white`},children:[(0,R.jsxs)(`div`,{className:`flex items-center justify-between mb-4`,children:[(0,R.jsx)(`div`,{className:`p-3 rounded-2xl`,style:{backgroundColor:`#F5F0E8`},children:(0,R.jsx)(Up,{className:`size-6 text-[#1A1A1A]`})}),(0,R.jsxs)(`span`,{className:`flex items-center gap-1.5 text-xs font-medium px-3 py-1 rounded-full`,style:{backgroundColor:`#DCFCE7`,color:`#166534`},children:[(0,R.jsx)(`span`,{className:`size-1.5 rounded-full bg-green-500 inline-block`}),`Live`]})]}),(0,R.jsx)(`div`,{className:`text-4xl font-black text-[#1A1A1A] mb-1`,style:{fontFamily:`'Playfair Display', serif`},children:e}),(0,R.jsx)(`div`,{className:`text-sm text-[#9B9590]`,children:`Active Sessions`})]}),(0,R.jsxs)(`div`,{className:`rounded-2xl border border-[#E0D9CF] p-6`,style:{backgroundColor:`white`},children:[(0,R.jsx)(`div`,{className:`flex items-center justify-between mb-4`,children:(0,R.jsx)(`div`,{className:`p-3 rounded-2xl`,style:{backgroundColor:`#F5F0E8`},children:(0,R.jsx)(Hp,{className:`size-6 text-[#1A1A1A]`})})}),(0,R.jsx)(`div`,{className:`text-4xl font-black text-[#1A1A1A] mb-1`,style:{fontFamily:`'Playfair Display', serif`},children:t}),(0,R.jsx)(`div`,{className:`text-sm text-[#9B9590]`,children:`Total Sessions`})]})]})}var Zp={easy:{backgroundColor:`#DCFCE7`,color:`#166534`},medium:{backgroundColor:`#FEF9C3`,color:`#854D0E`},hard:{backgroundColor:`#FEE2E2`,color:`#991B1B`}};function Qp({sessions:e,isLoading:t,isUserInSession:n}){return(0,R.jsxs)(`div`,{className:`lg:col-span-2 rounded-2xl border border-[#E0D9CF] p-6`,style:{backgroundColor:`white`},children:[(0,R.jsxs)(`div`,{className:`flex items-center justify-between mb-6`,children:[(0,R.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,R.jsx)(`div`,{className:`p-2 rounded-xl`,style:{backgroundColor:`#FFD60A`},children:(0,R.jsx)(qp,{className:`size-5 text-[#1A1A1A]`})}),(0,R.jsx)(`h2`,{className:`text-xl font-bold text-[#1A1A1A]`,style:{fontFamily:`'Playfair Display', serif`},children:`Live Sessions`})]}),(0,R.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,R.jsx)(`div`,{className:`size-2 roun
202ded-full bg-green-500`}),(0,R.jsxs)(`span`,{className:`text-sm text-[#6B7280]`,children:[e.length,` active`]})]})]}),(0,R.jsx)(`div`,{className:`space-y-3 max-h-[400px] overflow-y-auto pr-1`,children:t?(0,R.jsx)(`div`,{className:`flex items-center justify-center py-20`,children:(0,R.jsx)(Np,{className:`size-8 animate-spin text-[#1A1A1A]`})}):e.length>0?e.map(e=>(0,R.jsxs)(`div`,{className:`flex items-center justify-between gap-4 p-4 rounded-xl border border-[#E0D9CF] hover:border-[#C5BDB4] transition-all`,style:{backgroundColor:`#F5F0E8`},children:[(0,R.jsxs)(`div`,{className:`flex items-center gap-4 flex-1`,children:[(0,R.jsxs)(`div`,{className:`relative size-12 rounded-xl flex items-center justify-center flex-shrink-0`,style:{backgroundColor:`#FFD60A`},children:[(0,R.jsx)(Op,{className:`size-6 text-[#1A1A1A]`}),(0,R.jsx)(`div`,{className:`absolute -top-1 -right-1 size-3 bg-green-500 rounded-full border-2 border-white`})]}),(0,R.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,R.jsxs)(`div`,{className:`flex items-center gap-2 mb-1`,children:[(0,R.jsx)(`h3`,{className:`font-bold text-[#1A1A1A] truncate`,children:e.problem}),(0,R.jsx)(`span`,{className:`text-xs px-2 py-0.5 rounded-full font-medium flex-shrink-0`,style:Zp[e.difficulty]||{},children:e.difficulty})]}),(0,R.jsxs)(`div`,{className:`flex items-center gap-4 text-xs text-[#6B7280]`,children:[(0,R.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,R.jsx)(kp,{className:`size-3`}),(0,R.jsx)(`span`,{children:e.host?.name})]}),(0,R.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,R.jsx)(Up,{className:`size-3`}),(0,R.jsx)(`span`,{children:e.participants.length>=1?`2/2`:`1/2`})]}),(0,R.jsx)(`span`,{className:`text-xs px-2 py-0.5 rounded-full`,style:e.participants.length>=1&&!n(e)?{backgroundColor:`#FEE2E2`,color:`#991B1B`}:{backgroundColor:`#DCFCE7`,color:`#166534`},children:e.participants.length>=1&&!n(e)?`FULL`:`OPEN`})]})]})]}),e.participants.length>=1&&!n(e)?(0,R.jsx)(`button`,{className:`px-4 py-2 rounded-full text-sm font-medium border border-[#D0C9BF] text-[#9B9590]`,disabled:!0,children:`Full`}):(0,R.jsxs)(ec,{to:`/session/${e._id}`,className:`flex items-center gap-1.5 px-4 py-2 rounded-full text-sm font-medium text-white`,style:{backgroundColor:`#1A1A1A`},children:[n(e)?`Rejoin`:`Join`,(0,R.jsx)(bp,{className:`size-4`})]})]},e._id)):(0,R.jsxs)(`div`,{className:`text-center py-16`,children:[(0,R.jsx)(`div`,{className:`size-16 mx-auto mb-4 rounded-2xl flex items-center justify-center`,style:{backgroundColor:`#F5F0E8`},children:(0,R.jsx)(Bp,{className:`size-8 text-[#9B9590]`})}),(0,R.jsx)(`p`,{className:`font-semibold text-[#1A1A1A] mb-1`,children:`No active sessions`}),(0,R.jsx)(`p`,{className:`text-sm text-[#9B9590]`,children:`Be the first to create one!`})]})})]})}var $p=365.2425,em=43200,eee=1440,tm=3600*24;tm*7,tm*$p/12*3;var nm=Symbol.for(`constructDateFrom`);function rm(e,t){return typeof e==`function`?e(t):e&&typeof e==`object`&&nm in e?e[nm](t):e instanceof Date?new e.constructor(t):new Date(t)}function im(e,t){return rm(t||e,e)}var tee={};function nee(){return tee}function am(e){let t=im(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),e-+n}function om(e,...t){let n=rm.bind(null,e||t.find(e=>typeof e==`object`));return t.map(n)}function sm(e,t){let n=im(e)-+im(t);return n<0?-1:n>0?1:n}function ree(e){return rm(e,Date.now())}function iee(e,t,n){let[r,i]=om(n?.in,e,t),a=r.getFullYear()-i.getFullYear(),o=r.getMonth()-i.getMonth();return a*12+o}function cm(e){return t=>{let n=(e?Math[e]:Math.trunc)(t);return n===0?0:n}}function lm(e,t){return im(e)-+im(t)}function um(e,t){let n=im(e,t?.in);return n.setHours(23,59,59,999),n}function dm(e,t){let n=im(e,t?.in),r=n.getMonth();return n.setFullYear(n.getFullYear(),r+1,0),n.setHours(23,59,59,999),n}function fm(e,t){let n=im(e,t?.in);return+um(n,t)==+dm(n,t)}function pm(e,t,n){let[r,i,a]=om(n?.in,e,e,t),o=sm(i,a),s=Math.abs(iee(i,a));if(s<1)return 0;i.getMonth()===1&&i.getDate()>27&&i.setDate(30),i.setMonth(i.getMonth()-o*s);let c=sm(i,a)===-o;fm(r)&&s===1&&sm(r,a)===1&&(c=!1);let l=o*(s-+c);return l===0?0:l}function aee(e,t,n){let r=lm(e,t)/1e3;return cm(n?.roundingMethod)(r)}var oee={lessThanXSeconds:{one:`less than a second`,other:`less than {{count}} seconds`},xSeconds:{one:`1 second`,other:`{{count}} seconds`},halfAMinute:`half a minute`,lessThanXMinutes:{one:`less than a minute`,other:`less than {{count}} minutes`},xMinutes:{one:`1 minute`,other:`{{count}} minutes`},aboutXHours:{one:`about 1 hour`,other:`about {{count}} hours`},xHours:{one:`1 hour`,other:`{{count}} hours`},xDays:{one:`1 day`,other:`{{count}} days`},aboutXWeeks:{one:`about 1 week`,other:`about {{count}} weeks`},xWeeks:{one:`1 week`,other:`{{count}} weeks`},aboutXMonths:{one:`about 1 month`,other:`about {{count}} months`},xMonths:{one:`1 month`,other:`{{count}} months`},aboutXYears:{one:`about 1 year`,other:`about {{count}} years`},xYears:{one:`1 year`,other:`{{count}} years`},overXYears:{one:`over 1 year`,other:`over {{count}} years`},almostXYears:{one:`almost 1 year`,other:`almost {{count}} years`}}
202,see=(e,t,n)=>{let r,i=oee[e];return r=typeof i==`string`?i:t===1?i.one:i.other.replace(`{{count}}`,t.toString()),n?.addSuffix?n.comparison&&n.comparison>0?`in `+r:r+` ago`:r};function mm(e){return(t={})=>{let n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}var cee={date:mm({formats:{full:`EEEE, MMMM do, y`,long:`MMMM do, y`,medium:`MMM d, y`,short:`MM/dd/yyyy`},defaultWidth:`full`}),time:mm({formats:{full:`h:mm:ss a zzzz`,long:`h:mm:ss a z`,medium:`h:mm:ss a`,short:`h:mm a`},defaultWidth:`full`}),dateTime:mm({formats:{full:`{{date}} 'at' {{time}}`,long:`{{date}} 'at' {{time}}`,medium:`{{date}}, {{time}}`,short:`{{date}}, {{time}}`},defaultWidth:`full`})},lee={lastWeek:`'last' eeee 'at' p`,yesterday:`'yesterday at' p`,today:`'today at' p`,tomorrow:`'tomorrow at' p`,nextWeek:`eeee 'at' p`,other:`P`},uee=(e,t,n,r)=>lee[e];function hm(e){return(t,n)=>{let r=n?.context?String(n.context):`standalone`,i;if(r===`formatting`&&e.formattingValues){let t=e.defaultFormattingWidth||e.defaultWidth,r=n?.width?String(n.width):t;i=e.formattingValues[r]||e.formattingValues[t]}else{let t=e.defaultWidth,r=n?.width?String(n.width):e.defaultWidth;i=e.values[r]||e.values[t]}let a=e.argumentCallback?e.argumentCallback(t):t;return i[a]}}var dee={ordinalNumber:(e,t)=>{let n=Number(e),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+`st`;case 2:return n+`nd`;case 3:return n+`rd`}return n+`th`},era:hm({values:{narrow:[`B`,`A`],abbreviated:[`BC`,`AD`],wide:[`Before Christ`,`Anno Domini`]},defaultWidth:`wide`}),quarter:hm({values:{narrow:[`1`,`2`,`3`,`4`],abbreviated:[`Q1`,`Q2`,`Q3`,`Q4`],wide:[`1st quarter`,`2nd quarter`,`3rd quarter`,`4th quarter`]},defaultWidth:`wide`,argumentCallback:e=>e-1}),month:hm({values:{narrow:[`J`,`F`,`M`,`A`,`M`,`J`,`J`,`A`,`S`,`O`,`N`,`D`],abbreviated:[`Jan`,`Feb`,`Mar`,`Apr`,`May`,`Jun`,`Jul`,`Aug`,`Sep`,`Oct`,`Nov`,`Dec`],wide:[`January`,`February`,`March`,`April`,`May`,`June`,`July`,`August`,`September`,`October`,`November`,`December`]},defaultWidth:`wide`}),day:hm({values:{narrow:[`S`,`M`,`T`,`W`,`T`,`F`,`S`],short:[`Su`,`Mo`,`Tu`,`We`,`Th`,`Fr`,`Sa`],abbreviated:[`Sun`,`Mon`,`Tue`,`Wed`,`Thu`,`Fri`,`Sat`],wide:[`Sunday`,`Monday`,`Tuesday`,`Wednesday`,`Thursday`,`Friday`,`Saturday`]},defaultWidth:`wide`}),dayPeriod:hm({values:{narrow:{am:`a`,pm:`p`,midnight:`mi`,noon:`n`,morning:`morning`,afternoon:`afternoon`,evening:`evening`,night:`night`},abbreviated:{am:`AM`,pm:`PM`,midnight:`midnight`,noon:`noon`,morning:`morning`,afternoon:`afternoon`,evening:`evening`,night:`night`},wide:{am:`a.m.`,pm:`p.m.`,midnight:`midnight`,noon:`noon`,morning:`morning`,afternoon:`afternoon`,evening:`evening`,night:`night`}},defaultWidth:`wide`,formattingValues:{narrow:{am:`a`,pm:`p`,midnight:`mi`,noon:`n`,morning:`in the morning`,afternoon:`in the afternoon`,evening:`in the evening`,night:`at night`},abbreviated:{am:`AM`,pm:`PM`,midnight:`midnight`,noon:`noon`,morning:`in the morning`,afternoon:`in the afternoon`,evening:`in the evening`,night:`at night`},wide:{am:`a.m.`,pm:`p.m.`,midnight:`midnight`,noon:`noon`,morning:`in the morning`,afternoon:`in the afternoon`,evening:`in the evening`,night:`at night`}},defaultFormattingWidth:`wide`})};function gm(e){return(t,n={})=>{let r=n.width,i=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],a=t.match(i);if(!a)return null;let o=a[0],s=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],c=Array.isArray(s)?pee(s,e=>e.test(o)):fee(s,e=>e.test(o)),l;l=e.valueCallback?e.valueCallback(c):c,l=n.valueCallback?n.valueCallback(l):l;let u=t.slice(o.length);return{value:l,rest:u}}}function fee(e,t){for(let n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function pee(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function mee(e){return(t,n={})=>{let r=t.match(e.matchPattern);if(!r)return null;let i=r[0],a=t.match(e.parsePattern);if(!a)return null;let o=e.valueCallback?e.valueCallback(a[0]):a[0];o=n.valueCallback?n.valueCallback(o):o;let s=t.slice(i.length);return{value:o,rest:s}}}var hee={code:`en-US`,formatDistance:see,formatLong:cee,formatRelative:uee,localize:dee,match:{ordinalNumber:mee({matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:e=>parseInt(e,10)}),era:gm({matchPatterns:{narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},defaultMatchWidth:`wide`,parsePatterns:{any:[/^b/i,/^(a|c)/i]},defaultParseWidth:`any`}),quarter:gm({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},defaultMatchWidth:`wide`,parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:`any`,valueCallback:e=>e+1}),month:gm({matchPatterns:{narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},defaultMatchWidth:`wide`,parsePatterns:{narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},defaultParseWidth:`any`}),day:gm({matchPatterns:{narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},defaultMatchWidth:`wide`,parsePatterns:{narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},defaultParseWidth:`any`}),dayPeriod:gm({matchPatterns:{narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},defaultMatchWidth:`any`,parsePatterns:{any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},defaultParseWidth:`any`})},options:{weekStartsOn:0,firstWeekContainsDate:1}};function gee(e,t,n){let r=nee(),i=n?.locale??r.locale??hee,a=sm(e,t);if(isNaN(a))throw RangeError(`Invalid time value`);let o=Object.assign({},n,{addSuffix:n?.addSuffix,comparison:a}),[s,c]=om(n?.in,...a>0?[t,e]:[e,t]),l=aee(c,s),u=(am(c)-am(s))/1e3,d=Math.round((l-u)/60),f;if(d<2)return n?.includeSeconds?l<5?i.formatDistance(`lessThanXSeconds`,5,o):l<10?i.formatDistance(`lessThanXSeconds`,10,o):l<20?i.formatDistance(`lessThanXSeconds`,20,o):l<40?i.formatDistance(`halfAMinute`,0,o):l<60?i.formatDistance(`lessThanXMinutes`,1,o):i.formatDistance(`xMinutes`,1,o):d===0?i.formatDistance(`lessThanXMinutes`,1,o):i.formatDistance(`xMinutes`,d,o);if(d<45)return i.formatDistance(`xMinutes`,d,o);if(d<90)return i.formatDistance(`aboutXHours`,1,o);if(d<1440){let e=Math.round(d/60);return i.formatDistance(`aboutXHours`,e,o)}else if(d<2520)return i.formatDistance(`xDays`,1,o);else if(d<43200){let e=Math.round(d/eee);return i.formatDistance(`xDays`,e,o)}else if(d<43200*2)return f=Math.round(d/em),i.formatDistance(`aboutXMonths`,f,o);if(f=pm(c,s),f<12){let e=Math.round(d/em);return i.formatDistance(`xMonths`,e,o)}else{let e=f%12,t=Math.trunc(f/12);return e<3?i.formatDistance(`aboutXYears`,t,o):e<9?i.formatDistance(`overXYears`,t,o):i.formatDistance(`almostXYears`,t+1,o)}}function _ee(e,t){return gee(e,ree(e),t)}var vee={Easy:{backgroundColor:`#DCFCE7`,color:`#166534`},Medium:{backgroundColor:`#FEF9C3`,color:`#854D0E`},Hard:{backgroundColor:`#FEE2E2`,color:`#991B1B`}};
202function yee({sessions:e,isLoading:t}){return(0,R.jsxs)(`div`,{className:`mt-6 rounded-2xl border border-[#E0D9CF] p-6`,style:{backgroundColor:`white`},children:[(0,R.jsxs)(`div`,{className:`flex items-center gap-3 mb-6`,children:[(0,R.jsx)(`div`,{className:`p-2 rounded-xl`,style:{backgroundColor:`#1A1A1A`},children:(0,R.jsx)(Dp,{className:`size-5`,style:{color:`#FFD60A`}})}),(0,R.jsx)(`h2`,{className:`text-xl font-bold text-[#1A1A1A]`,style:{fontFamily:`'Playfair Display', serif`},children:`Your Past Sessions`})]}),(0,R.jsx)(`div`,{className:`grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4`,children:t?(0,R.jsx)(`div`,{className:`col-span-full flex items-center justify-center py-20`,children:(0,R.jsx)(Np,{className:`size-8 animate-spin text-[#1A1A1A]`})}):e.length>0?e.map(e=>(0,R.jsxs)(`div`,{className:`rounded-xl border border-[#E0D9CF] p-4 hover:border-[#C5BDB4] transition-all`,style:{backgroundColor:`#F5F0E8`},children:[e.status===`active`&&(0,R.jsx)(`div`,{className:`flex justify-end mb-2`,children:(0,R.jsxs)(`span`,{className:`flex items-center gap-1 text-xs px-2 py-0.5 rounded-full`,style:{backgroundColor:`#DCFCE7`,color:`#166534`},children:[(0,R.jsx)(`span`,{className:`size-1.5 rounded-full bg-green-500 inline-block animate-pulse`}),`ACTIVE`]})}),(0,R.jsxs)(`div`,{className:`flex items-start gap-3 mb-4`,children:[(0,R.jsx)(`div`,{className:`size-10 rounded-xl flex items-center justify-center flex-shrink-0`,style:{backgroundColor:`#FFD60A`},children:(0,R.jsx)(Op,{className:`size-5 text-[#1A1A1A]`})}),(0,R.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,R.jsx)(`h3`,{className:`font-bold text-[#1A1A1A] text-sm mb-1 truncate`,children:e.problem}),(0,R.jsx)(`span`,{className:`text-xs px-2 py-0.5 rounded-full font-medium`,style:vee[e.difficulty]||{},children:e.difficulty})]})]}),(0,R.jsxs)(`div`,{className:`space-y-1.5 text-xs text-[#6B7280] mb-4`,children:[(0,R.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,R.jsx)(Dp,{className:`size-3`}),(0,R.jsx)(`span`,{children:_ee(new Date(e.createdAt),{addSuffix:!0})})]}),(0,R.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,R.jsx)(Up,{className:`size-3`}),(0,R.jsxs)(`span`,{children:[e.participant?`2`:`1`,` participant`,e.participant?`s`:``]})]})]}),(0,R.jsxs)(`div`,{className:`flex items-center justify-between pt-3 border-t border-[#E0D9CF]`,children:[(0,R.jsx)(`span`,{className:`text-xs font-semibold text-[#9B9590] uppercase`,children:`Completed`}),(0,R.jsx)(`span`,{className:`text-xs text-[#9B9590]`,children:new Date(e.updatedAt).toLocaleDateString()})]})]},e._id)):(0,R.jsxs)(`div`,{className:`col-span-full text-center py-16`,children:[(0,R.jsx)(`div`,{className:`size-16 mx-auto mb-4 rounded-2xl flex items-center justify-center`,style:{backgroundColor:`#F5F0E8`},children:(0,R.jsx)(Hp,{className:`size-8 text-[#9B9590]`})}),(0,R.jsx)(`p`,{className:`font-semibold text-[#1A1A1A] mb-1`,children:`No sessions yet`}),(0,R.jsx)(`p`,{className:`text-sm text-[#9B9590]`,children:`Start your coding journey today!`})]})})]})}var _m={"two-sum":{id:`two-sum`,title:`Two Sum`,difficulty:`Easy`,category:`Array • Hash Table`,description:{text:`Given an array of integers nums and an integer target, return indices of the two numbers in the array such that they add up to target.`,notes:[`You may assume that each input would have exactly one solution, and you may 
202not use the same element twice.`,`You can return the answer in any order.`]},examples:[{input:`nums = [2,7,11,15], target = 9`,output:`[0,1]`,explanation:`Because nums[0] + nums[1] == 9, we return [0, 1].`},{input:`nums = [3,2,4], target = 6`,output:`[1,2]`},{input:`nums = [3,3], target = 6`,output:`[0,1]`}],constraints:[`2 ≤ nums.length ≤ 10⁴`,`-10⁹ ≤ nums[i] ≤ 10⁹`,`-10⁹ ≤ target ≤ 10⁹`,`Only one valid answer exists`],starterCode:{javascript:`function twoSum(nums, target) {
203  // Write your solution here
204  
205}
206
207// Test cases
208console.log(twoSum([2, 7, 11, 15], 9)); // Expected: [0, 1]
209console.log(twoSum([3, 2, 4], 6)); // Expected: [1, 2]
210console.log(twoSum([3, 3], 6)); // Expected: [0, 1]`,python:`def twoSum(nums, target):
211    # Write your solution here
212    pass
213
214# Test cases
215print(twoSum([2, 7, 11, 15], 9))  # Expected: [0, 1]
216print(twoSum([3, 2, 4], 6))  # Expected: [1, 2]
217print(twoSum([3, 3], 6))  # Expected: [0, 1]`,java:`import java.util.*;
218
219class Solution {
220    public static int[] twoSum(int[] nums, int target) {
221        // Write your solution here
222        
223        return new int[0];
224    }
225    
226    public static void main(String[] args) {
227        System.out.println(Arrays.toString(twoSum(new int[]{2, 7, 11, 15}, 9))); // Expected: [0, 1]
228        System.out.println(Arrays.toString(twoSum(new int[]{3, 2, 4}, 6))); // Expected: [1, 2]
229        System.out.println(Arrays.toString(twoSum(new int[]{3, 3}, 6))); // Expected: [0, 1]
230    }
231}`},expectedOutput:{javascript:`[0,1]
232[1,2]
233[0,1]`,python:`[0, 1]
234[1, 2]
235[0, 1]`,java:`[0, 1]
236[1, 2]
237[0, 1]`}},"reverse-string":{id:`reverse-string`,title:`Reverse String`,difficulty:`Easy`,category:`String • Two Pointers`,description:{text:`Write a function that reverses a string. The input string is given as an array of characters s.`,notes:[`You must do this by modifying the input array in-place with O(1) extra memory.`]},examples:[{input:`s = ["h","e","l","l","o"]`,output:`["o","l","l","e","h"]`},{input:`s = ["H","a","n","n","a","h"]`,output:`["h","a","n","n","a","H"]`}],constraints:[`1 ≤ s.length ≤ 10⁵`,`s[i] is a printable ascii character`],starterCode:{javascript:`function reverseString(s) {
238  // Write your solution here
239  
240}
241
242// Test cases
243let test1 = ["h","e","l","l","o"];
244reverseString(test1);
245console.log(test1); // Expected: ["o","l","l","e","h"]
246
247let test2 = ["H","a","n","n","a","h"];
248reverseString(test2);
249console.log(test2); // Expected: ["h","a","n","n","a","H"]`,python:`def reverseString(s):
250    # Write your solution here
251    pass
252
253# Test cases
254test1 = ["h","e","l","l","o"]
255reverseString(test1)
256print(test1)  # Expected: ["o","l","l","e","h"]
257
258test2 = ["H","a","n","n","a","h"]
259reverseString(test2)
260print(test2)  # Expected: ["h","a","n","n","a","H"]`,java:`import java.util.*;
261
262class Solution {
263    public static void reverseString(char[] s) {
264        // Write your solution here
265        
266    }
267    
268    public static void main(String[] args) {
269        char[] test1 = {'h','e','l','l','o'};
270        reverseString(test1);
271        System.out.println(Arrays.toString(test1)); // Expected: [o, l, l, e, h]
272        
273        char[] test2 = {'H','a','n','n','a','h'};
274        reverseString(test2);
275        System.out.println(Arrays.toString(test2)); // Expected: [h, a, n, n, a, H]
276    }
277}`},expectedOutput:{javascript:`["o","l","l","e","h"]
278["h","a","n","n","a","H"]`,python:`['o', 'l', 'l', 'e', 'h']
279['h', 'a', 'n', 'n', 'a', 'H']`,java:`[o, l, l, e, h]
280[h, a, n, n, a, H]`}},"valid-palindrome":{id:`valid-palindrome`,title:`Valid Palindrome`,difficulty:`Easy`,category:`String • Two Pointers`,description:{text:`A phrase is a palindrome if, after converting all uppercase letters into lowercase letters and removing all non-alphanumeric characters, it reads the same forward and backward. Alphanumeric characters include letters and numbers.`,notes:[`Given a string s, return true if it is a palindrome, or false otherwise.`]},examples:[{input:`s = "A man, a plan, a canal: Panama"`,output:`true`,explanation:`"amanaplanacanalpanama" is a palindrome.`},{input:`s = "race a car"`,output:`false`,explanation:`"raceacar" is not a palindrome.`},{input:`s = " "`,output:`true`,explanation:`s is an empty string "" after remov
280ing non-alphanumeric characters. Since an empty string reads the same forward and backward, it is a palindrome.`}],constraints:[`1 ≤ s.length ≤ 2 * 10⁵`,`s consists only of printable ASCII characters`],starterCode:{javascript:`function isPalindrome(s) {
281  // Write your solution here
282  
283}
284
285// Test cases
286console.log(isPalindrome("A man, a plan, a canal: Panama")); // Expected: true
287console.log(isPalindrome("race a car")); // Expected: false
288console.log(isPalindrome(" ")); // Expected: true`,python:`def isPalindrome(s):
289    # Write your solution here
290    pass
291
292# Test cases
293print(isPalindrome("A man, a plan, a canal: Panama"))  # Expected: True
294print(isPalindrome("race a car"))  # Expected: False
295print(isPalindrome(" "))  # Expected: True`,java:`class Solution {
296    public static boolean isPalindrome(String s) {
297        // Write your solution here
298        
299        return false;
300    }
301    
302    public static void main(String[] args) {
303        System.out.println(isPalindrome("A man, a plan, a canal: Panama")); // Expected: true
304        System.out.println(isPalindrome("race a car")); // Expected: false
305        System.out.println(isPalindrome(" ")); // Expected: true
306    }
307}`},expectedOutput:{javascript:`true
308false
309true`,python:`True
310False
311True`,java:`true
312false
313true`}},"maximum-subarray":{id:`maximum-subarray`,title:`Maximum Subarray`,difficulty:`Medium`,category:`Array • Dynamic Programming`,description:{text:`Given an integer array nums, find the subarray with the largest sum, and return its sum.`,notes:[]},examples:[{input:`nums = [-2,1,-3,4,-1,2,1,-5,4]`,output:`6`,explanation:`The subarray [4,-1,2,1] has the largest sum 6.`},{input:`nums = [1]`,output:`1`,explanation:`The subarray [1] has the largest sum 1.`},{input:`nums = [5,4,-1,7,8]`,output:`23`,explanation:`The subarray [5,4,-1,7,8] has the largest sum 23.`}],constraints:[`1 ≤ nums.length ≤ 10⁵`,`-10⁴ ≤ nums[i] ≤ 10⁴`],starterCode:{javascript:`function maxSubArray(nums) {
314  // Write your solution here
315  
316}
317
318// Test cases
319console.log(maxSubArray([-2,1,-3,4,-1,2,1,-5,4])); // Expected: 6
320console.log(maxSubArray([1])); // Expected: 1
321console.log(maxSubArray([5,4,-1,7,8])); // Expected: 23`,python:`def maxSubArray(nums):
322    # Write your solution here
323    pass
324
325# Test cases
326print(maxSubArray([-2,1,-3,4,-1,2,1,-5,4]))  # Expected: 6
327print(maxSubArray([1]))  # Expected: 1
328print(maxSubArray([5,4,-1,7,8]))  # Expected: 23`,java:`class Solution {
329    public static int maxSubArray(int[] nums) {
330        // Write your solution here
331        
332        return 0;
333    }
334    
335    public static void main(String[] args) {
336        System.out.println(maxSubArray(new int[]{-2,1,-3,4,-1,2,1,-5,4})); // Expected: 6
337        System.out.println(maxSubArray(new int[]{1})); // Expected: 1
338        System.out.println(maxSubArray(new int[]{5,4,-1,7,8})); // Expected: 23
339    }
340}`},expectedOutput:{javascript:`6
3411
34223`,python:`6
3431
34423`,java:`6
3451
34623`}},"container-with-most-water":{id:`container-with-most-water`,title:`Container With Most Water`,difficulty:`Medium`,category:`Array • Two Pointers`,description:{text:`You are given an integer array height of length n. There are n vertical lines drawn such that the two endpoints of the ith line are (i, 0) and (i, height[i]).`,notes:[`Find two lines that together with the x-axis form a container, such that the container contains the most water.`,`Return the maximum amount of water a container can store.`,`Notice that you may not slant the container.`]},examples:[{input:`height = [1,8,6,2,5,4,8,3,7]`,output:`49`,explanation:`The vertical lines are represented by array [1,8,6,2,5,4,8,3,7]. In this case, the max area of water the container can contain is 49.`},{input:`height = [1,1]`,output:`1`}],constraints:[`n == height.length`,`2 ≤ n ≤ 10⁵`,`0 ≤ height[i] ≤ 10⁴`],starterCode:{javascript:`function maxArea(height) {
347  // Write your solution here
348  
349}
350
351// Test cases
352console.log(maxArea([1,8,6,2,5,4,8,3,7])); // Expected: 49
353console.log(maxArea([1,1])); // Expected: 1`,python:`def maxArea(height):
354    # Write your solution here
355    pass
356
357# Test cases
358print(maxArea([1,8,6,2,5,4,8,3,7]))  # Expected: 49
359print(maxArea([1,1]))  # Expected: 1`,java:`class Solution {
360    public static int maxArea(int[] height) {
361        // Write your solution here
362        
363        return 0;
364    }
365    
366    public static void main(String[] args) {
367        System.out.println(maxArea(new int[]{1,8,6,2,5,4,8,3,7})); // Expected: 49
368        System.out.println(maxArea(new int[]{1,1})); // Expected: 1
369    }
370}`},expectedOutput:{javascript:`49
3711`,python:`49
3721`,java:`49
3731`}}},vm={javascript:{name:`JavaScript`,icon:`/javascript.png`,monacoLang:`javascript`},python:{name:`Python`,icon:`/python.png`,monacoLang:`python`},java:{name:`Java`,icon:`/java.png`,monacoLang:`java`}};function bee({isOpen:e,onClose:t,roomConfig:n,setRoomConfig:r,onCreateRoom:i,isCreating:a}){let o=Object.values(_m);return e?(0,R.jsx)(`div`,{className:`fixed inset-0 z-50 flex items-center justify-center`,style:{backgroundColor:`rgba(0,0,0,0.4)`},onClick:t,children:(0,R.jsxs)(`div`,{className:`w-full max-w-lg rounded-2xl border border-[#
373E0D9CF] p-8 shadow-xl`,style:{backgroundColor:`white`},onClick:e=>e.stopPropagation(),children:[(0,R.jsxs)(`div`,{className:`flex items-center justify-between mb-6`,children:[(0,R.jsx)(`h3`,{className:`text-2xl font-bold text-[#1A1A1A]`,style:{fontFamily:`'Playfair Display', serif`},children:`Create New Session`}),(0,R.jsx)(`button`,{onClick:t,className:`p-2 rounded-full hover:opacity-70 transition-opacity`,style:{backgroundColor:`#F5F0E8`},children:(0,R.jsx)(Kp,{className:`size-4 text-[#1A1A1A]`})})]}),(0,R.jsxs)(`div`,{className:`space-y-6`,children:[(0,R.jsxs)(`div`,{children:[(0,R.jsxs)(`label`,{className:`block text-sm font-semibold text-[#1A1A1A] mb-2`,children:[`Select Problem `,(0,R.jsx)(`span`,{style:{color:`#991B1B`},children:`*`})]}),(0,R.jsxs)(`select`,{className:`w-full px-4 py-3 rounded-xl border border-[#E0D9CF] outline-none text-sm text-[#1A1A1A]`,style:{backgroundColor:`#F5F0E8`},value:n.problem,onChange:e=>{r({difficulty:o.find(t=>t.title===e.target.value).difficulty,problem:e.target.value})},children:[(0,R.jsx)(`option`,{value:``,disabled:!0,children:`Choose a coding problem...`}),o.map(e=>(0,R.jsxs)(`option`,{value:e.title,children:[e.title,` (`,e.difficulty,`)`]},e.id))]})]}),n.problem&&(0,R.jsxs)(`div`,{className:`flex items-start gap-3 p-4 rounded-xl border border-[#E0D9CF]`,style:{backgroundColor:`#F5F0E8`},children:[(0,R.jsx)(Op,{className:`size-5 text-[#1A1A1A] flex-shrink-0 mt-0.5`}),(0,R.jsxs)(`div`,{className:`text-sm text-[#1A1A1A]`,children:[(0,R.jsx)(`p`,{className:`font-semibold mb-1`,children:`Room Summary`}),(0,R.jsxs)(`p`,{className:`text-[#6B7280]`,children:[`Problem: `,(0,R.jsx)(`span`,{className:`text-[#1A1A1A] font-medium`,children:n.problem})]}),(0,R.jsxs)(`p`,{className:`text-[#6B7280]`,children:[`Max Participants: `,(0,R.jsx)(`span`,{className:`text-[#1A1A1A] font-medium`,children:`2 (1-on-1 session)`})]})]})]})]}),(0,R.jsxs)(`div`,{className:`flex items-center gap-3 mt-8`,children:[(0,R.jsx)(`button`,{onClick:t,className:`flex-1 px-6 py-3 rounded-full text-sm font-medium border border-[#E0D9CF] text-[#6B7280] hover:border-[#C5BDB4] transition-all`,children:`Cancel`}),(0,R.jsx)(`button`,{onClick:i,disabled:a||!n.problem,className:`flex-1 flex items-center justify-center gap-2 px-6 py-3 rounded-full text-sm font-semibold text-white transition-all`,style:{backgroundColor:a||!n.problem?`#D0C9BF`:`#1A1A1A`,cursor:a||!n.problem?`not-allowed`:`pointer`},children:a?(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(Np,{className:`size-4 animate-spin`}),` Creating...`]}):(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(Rp,{className:`size-4`}),` Create Session`]})})]})]})}):null}function xee(){let e=Fo(),{user:t}=Ut(),[n,r]=(0,d.useState)(!1),[i,a]=(0,d.useState)({problem:``,difficulty:``}),o=ip(),{data:s,isLoading:c}=ap(),{data:l,isLoading:u}=op(),f=()=>{!i.problem||!i.difficulty||o.mutate({problem:i.problem,difficulty:i.difficulty.toLowerCase()},{onSuccess:t=>{r(!1),e(`/session/${t.session._id}`)}})},p=s?.sessions||[],m=l?.recentSessions||[];return(0,R.jsxs)(`div`,{className:`min-h-screen`,style:{backgroundColor:`#F5F0E8`},children:[(0,R.jsx)(Jp,{}),(0,R.jsxs)(`div`,{className:`max-w-7xl mx-auto px-8`,children:[(0,R.jsx)(Yp,{onCreateSession:()=>r(!0),activeSessionsCount:p.length}),(0,R.jsxs)(`div`,{className:`grid grid-cols-1 lg:grid-cols-3 gap-6 pb-8`,children:[(0,R.jsx)(Xp,{activeSessionsCount:p.length,recentSessionsCount:m.length}),(0,R.jsx)(Qp,{sessions:p,isLoading:c,isUserInSession:e=>t.id?e.host?.clerkId===t.id||e.participants?.some(e=>e.clerkId===t.id):!1})]}),(0,R.jsx)(`div`,{className:`pb-10`,children:(0,R.jsx)(yee,{sessions:m,isLoading:u})})]}),(0,R.jsx)(bee,{isOpen:n,onClose:()=>r(!1),roomConfig:i,setRoomConfig:a,onCreateRoom:f,isCreating:o.isPending})]})}var See=()=>(0,R.jsxs)(`div`,{className:`min-h-screen bg-[#F5F0E8]`,children:[(0,R.jsx)(`nav`,{className:`sticky top-0 z-50 border-b border-[#E0D9CF] bg-[#F5F0E8]/90 backdrop-blur`,children:(0,R.jsxs)(`div`,{className:`max-w-7xl mx-auto px-6 py-4 flex items-center justify-between`,children:[(0,R.jsxs)(ec,{to:`/`,className:`flex items-center gap-2 hover:opacity-80 transition-opacity`,children:[(0,R.jsx)(`div`,{className:`size-8 rounded-lg border-2 border-[#1A1A1A] flex items-center justify-center`,children:(0,R.jsx)(Gp,{className:`size-5 text-[#1A1A1A]`,strokeWidth:2.2})}),(0,R.jsx)(`span`,{className:`text-[21px] font-semibold tracking-tight text-[#1A1A1A]`,children:`InterviewPro`})]}),(0,R.jsx)(la,{mode:`modal`,children:(0,R.jsxs)(`button`,{className:`group flex items-center gap-2 px-5 py-2.5 border border-black text-black text-sm font-medium rounded-full hover:bg-black hover:text-white transition-all duration-200`,children:[(0,R.jsx)(`span`,{children:`Get Started`}),(0,R.jsx)(bp,{className:`size-4 group-hover:translate-x-0.5 transition-transform`})]})})]})}),(0,R.jsx)(`section`,{className:`max-w-7xl mx-auto px-6 py-20 lg:py-28`,children:(0,R.jsxs)(`div`,{className:`grid lg:grid-cols-2 gap-16 items-center`,children:[(0,R.jsxs)(`div`,{className:`space-y-8`,children:[(0,R.jsxs)(`div`,{className:`inline-flex items-center gap-2 px-4 py-2 rounded-full bg-[#EBC8C4] text-[#7A3E36] text-sm font-medium`,children:[(0,R.jsx)(qp,{className:`size-4`}),`Real-time Collaboration`]}),(0,R.jsxs)(`div`,{className:`space-y-4`,children:[(0,R.jsxs)(`h1`,{className:`text-5xl lg:text-7xl font-extrabold leading-tight tracking-tight`,children:[(0,R.jsx)(`span`,{className:`text-[#1A1A1A]`,children:`Code Together,`}),(0,R.jsx)(`br`,{}),(0,R.jsx)(`span`,{className:`text-[#9B5D2E]`,children:`Learn Together`})]}),(0,R.jsx)(`p`,{className:`text-lg text-[#6B665C] leading-relaxed max-w-xl`,children:`The ultimate platform for collaborative coding interviews and pair programming. C
373onnect face-to-face, code in real-time, and ace your technical interviews.`})]}),(0,R.jsxs)(`div`,{className:`flex flex-wrap gap-3`,children:[(0,R.jsxs)(`div`,{className:`flex items-center gap-2 px-4 py-2 border border-[#D8CCBC] rounded-full text-sm text-[#4A443D] bg-white/40`,children:[(0,R.jsx)(Cp,{className:`size-4 text-[#9B5D2E]`}),`Live Video Chat`]}),(0,R.jsxs)(`div`,{className:`flex items-center gap-2 px-4 py-2 border border-[#D8CCBC] rounded-full text-sm text-[#4A443D] bg-white/40`,children:[(0,R.jsx)(Cp,{className:`size-4 text-[#9B5D2E]`}),`Code Editor`]}),(0,R.jsxs)(`div`,{className:`flex items-center gap-2 px-4 py-2 border border-[#D8CCBC] rounded-full text-sm text-[#4A443D] bg-white/40`,children:[(0,R.jsx)(Cp,{className:`size-4 text-[#9B5D2E]`}),`Multi-Language`]})]}),(0,R.jsxs)(`div`,{className:`flex flex-wrap gap-4`,children:[(0,R.jsx)(la,{mode:`modal`,children:(0,R.jsxs)(`button`,{className:`group flex items-center gap-2 px-6 py-3 bg-[#1A1A1A] text-white rounded-full font-medium hover:bg-[#333] transition-all`,children:[`Start Coding Now`,(0,R.jsx)(bp,{className:`size-5 group-hover:translate-x-0.5 transition-transform`})]})}),(0,R.jsxs)(`button`,{className:`flex items-center gap-2 px-6 py-3 border border-[#1A1A1A] text-[#1A1A1A] rounded-full font-medium hover:bg-[#1A1A1A] hover:text-white transition-all`,children:[(0,R.jsx)(Wp,{className:`size-5`}),`Watch Demo`]})]}),(0,R.jsxs)(`div`,{className:`grid grid-cols-3 bg-[#EFE5D6] rounded-2xl overflow-hidden shadow-sm border border-[#E0D5C6] max-w-md`,children:[(0,R.jsxs)(`div`,{className:`p-5 text-center border-r border-[#DDCFBE]`,children:[(0,R.jsx)(`h3`,{className:`text-3xl font-bold text-[#1A1A1A]`,children:`10K+`}),(0,R.jsx)(`p`,{className:`text-sm text-[#6B665C] mt-1`,children:`Active Users`})]}),(0,R.jsxs)(`div`,{className:`p-5 text-center border-r border-[#DDCFBE]`,children:[(0,R.jsx)(`h3`,{className:`text-3xl font-bold text-[#9B5D2E]`,children:`50K+`}),(0,R.jsx)(`p`,{className:`text-sm text-[#6B665C] mt-1`,children:`Sessions`})]}),(0,R.jsxs)(`div`,{className:`p-5 text-center`,children:[(0,R.jsx)(`h3`,{className:`text-3xl font-bold text-[#1A1A1A]`,children:`99.9%`}),(0,R.jsx)(`p`,{className:`text-sm text-[#6B665C] mt-1`,children:`Uptime`})]})]})]}),(0,R.jsxs)(`div`,{className:`relative`,children:[(0,R.jsx)(`div`,{className:`absolute inset-0 bg-[#E9DDCD] rounded-[32px] blur-3xl opacity-50`}),(0,R.jsx)(`img`,{src:`/hero.png`,alt:`Collaborative coding platform`,className:`relative w-full rounded-[32px] border border-[#E5D9CA] shadow-xl`})]})]})}),(0,R.jsxs)(`section`,{className:`max-w-7xl mx-auto px-6 py-24`,children:[(0,R.jsxs)(`div`,{className:`text-center mb-16`,children:[(0,R.jsxs)(`h2`,{className:`text-4xl font-bold text-[#1A1A1A] mb-4 tracking-tight`,children:[`Everything You Need to`,` `,(0,R.jsx)(`span`,{className:`text-[#9B5D2E]`,children:`Succeed`})]}),(0,R.jsx)(`p`,{className:`text-lg text-[#6B665C] max-w-2xl mx-auto leading-relaxed`,children:`Powerful features designed to make your coding interviews seamless and productive.`})]}),(0,R.jsxs)(`div`,{className:`grid md:grid-cols-3 gap-8`,children:[(0,R.jsxs)(`div`,{className:`bg-white/50 border border-[#E5D9CA] rounded-3xl p-8 shadow-sm hover:shadow-md transition-all`,children:[(0,R.jsx)(`div`,{className:`size-16 bg-[#F3E5D7] rounded-2xl flex items-center justify-center mb-6`,children:(0,R.jsx)(Wp,{className:`size-8 text-[#9B5D2E]`})}),(0,R.jsx)(`h3`,{className:`text-xl font-semibold text-[#1A1A1A] mb-3`,children:`HD Video Call`}),(0,R.jsx)(`p`,{className:`text-[#6B665C] leading-relaxed`,children:`Crystal clear video and audio for seamless communication during technical interviews.`})]}),(0,R.jsxs)(`div`,{className:`bg-white/50 border border-[#E5D9CA] rounded-3xl p-8 shadow-sm hover:shadow-md transition-all`,children:[(0,R.jsx)(`div`,{className:`size-16 bg-[#F3E5D7] rounded-2xl flex items-center justify-center mb-6`,children:(0,R.jsx)(Op,{className:`size-8 text-[#9B5D2E]`})}),(0,R.jsx)(`h3`,{className:`text-xl font-semibold text-[#1A1A1A] mb-3`,children:`Live Code Editor`}),(0,R.jsx)(`p`,{className:`text-[#6B665C] leading-relaxed`,children:`Collaborate in real-time with syntax highlighting and multi-language support.`})]}
373),(0,R.jsxs)(`div`,{className:`bg-white/50 border border-[#E5D9CA] rounded-3xl p-8 shadow-sm hover:shadow-md transition-all`,children:[(0,R.jsx)(`div`,{className:`size-16 bg-[#F3E5D7] rounded-2xl flex items-center justify-center mb-6`,children:(0,R.jsx)(Up,{className:`size-8 text-[#9B5D2E]`})}),(0,R.jsx)(`h3`,{className:`text-xl font-semibold text-[#1A1A1A] mb-3`,children:`Easy Collaboration`}),(0,R.jsx)(`p`,{className:`text-[#6B665C] leading-relaxed`,children:`Share screens, discuss solutions, and solve problems together in real-time.`})]})]})]})]});function ym({onRunCode:e,isRunning:t,onToggleProblemList:n}){let r=Mo(),i=e=>r.pathname===e;return(0,R.jsx)(`nav`,{className:`sticky top-0 z-50 border-b border-[#E0D9CF]`,style:{backgroundColor:`#F5F0E8`},children:(0,R.jsxs)(`div`,{className:`w-full px-6 py-3 flex items-center justify-between`,children:[(0,R.jsxs)(`div`,{className:`flex items-center gap-4`,children:[(0,R.jsxs)(ec,{to:`/`,className:`flex items-center gap-2 hover:opacity-80 transition-opacity`,children:[(0,R.jsx)(`div`,{className:`size-8 rounded-lg border-2 border-[#1A1A1A] flex items-center justify-center`,children:(0,R.jsx)(Gp,{className:`size-5 text-[#1A1A1A]`,strokeWidth:2.2})}),(0,R.jsx)(`span`,{className:`text-[21px] font-semibold tracking-tight text-[#1A1A1A]`,children:`InterviewPro`})]}),(0,R.jsx)(`div`,{className:`w-px h-4 bg-[#D0C9BF]`}),(0,R.jsxs)(`button`,{onClick:n,className:`flex items-center gap-1.5 text-xs font-medium text-[#6B7280] hover:text-[#1A1A1A] transition-colors`,children:[(0,R.jsx)(jp,{className:`size-4`}),`Problem List`]})]}),(0,R.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,R.jsxs)(ec,{to:`/problems`,className:`flex items-center gap-2 px-4 py-2 rounded-full transition-all text-sm font-medium`,style:{backgroundColor:i(`/problems`)?`#1A1A1A`:`transparent`,color:i(`/problems`)?`white`:`#6B7280`},children:[(0,R.jsx)(xp,{className:`size-4`}),(0,R.jsx)(`span`,{className:`hidden sm:inline`,children:`Problems`})]}),(0,R.jsxs)(ec,{to:`/dashboard`,className:`flex items-center gap-2 px-4 py-2 rounded-full transition-all text-sm font-medium`,style:{backgroundColor:i(`/dashboard`)?`#1A1A1A`:`transparent`,color:i(`/dashboard`)?`white`:`#6B7280`},children:[(0,R.jsx)(Ap,{className:`size-4`}),(0,R.jsx)(`span`,{className:`hidden sm:inline`,children:`Dashboard`})]}),(0,R.jsx)(`div`,{className:`ml-2 mt-1`,children:(0,R.jsx)(Nr,{})})]})]})})}function bm(e,t){let n=getComputedStyle(e);return t*parseFloat(n.fontSize)}function xm(e,t){let n=getComputedStyle(e.ownerDocument.body);return t*parseFloat(n.fontSize)}function Sm(e){return e/100*window.innerHeight}function Cm(e){return e/100*window.innerWidth}function wm(e){switch(typeof e){case`number`:return[e,`px`];case`string`:{let t=parseFloat(e);return e.endsWith(`%`)?[t,`%`]:e.endsWith(`px`)?[t,`px`]:e.endsWith(`rem`)?[t,`rem`]:e.endsWith(`em`)?[t,`em`]:e.endsWith(`vh`)?[t,`vh`]:e.endsWith(`vw`)?[t,`vw`]:[t,`%`]}}}function Tm({groupSize:e,panelElement:t,styleProp:n}){let r,[i,a]=wm(n);switch(a){case`%`:r=i/100*e;break;case`px`:r=i;break;case`rem`:r=xm(t,i);break;case`em`:r=bm(t,i);break;case`vh`:r=Sm(i);break;case`vw`:r=Cm(i);break}return r}function Em(e){return parseFloat(e.toFixed(3))}function Dm({group:e}){let{orientation:t,panels:n}=e;return n.reduce((e,n)=>(e+=t===`horizontal`?n.element.offsetWidth:n.element.offsetHeight,e),0)}function Om(e){let{panels:t}=e,n=Dm({group:e});return n===0?t.map(e=>({groupResizeBehavior:e.panelConstraints.groupResizeBehavior,collapsedSize:0,collapsible:e.panelConstraints.collapsible===!0,defaultSize:void 0,disabled:e.panelConstraints.disabled,minSize:0,maxSize:100,panelId:e.id})):t.map(e=>{let{element:t,panelConstraints:r}=e,i=0;r.collapsedSize!==void 0&&(i=Em(Tm({groupSize:n,panelElement:t,styleProp:r.collapsedSize})/n*100));let a;r.defaultSize!==void 0&&(a=Em(Tm({groupSize:n,panelElement:t,styleProp:r.defaultSize})/n*100));let o=0;r.minSize!==void 0&&(o=Em(Tm({groupSize:n,panelElement:t,styleProp:r.minSize})/n*100));let s=100;return r.maxSize!==void 0&&(s=Em(Tm({groupSize:n,panelElement:t,styleProp:r.maxSize})/n*100)),{groupResizeBehavior:r.groupResizeBehavior,collapsedSize:i,collapsible:r.collapsible===!0,defaultSize:a,disabled:r.disabled,minSize:o,maxSize:s,panelId:e.id}})}function km(e,t=`Assertion error`){if(!e)throw Error(t)}function Am(e,t){return Array.from(t).sort(e===`horizontal`?jm:Mm)}function jm(e,t){let n=e.element.offsetLeft-t.element.offsetLeft;return n===0?e.element.offsetWidth-t.element.offsetWidth:n}function Mm(e,t){let n=e.element.offsetTop-t.element.offsetTop;return n===0?e.element.offsetHeight-t.element.offsetHeight:n}function Nm(e){return typeof e==`object`&&!!e&&`nodeType`in e&&e.nodeType===Node.ELEMENT_NODE}function Pm(e,t){return{x:e.x>=t.left&&e.x<=t.right?0:Math.min(Math.abs(e.x-t.left),Math.abs(e.x-t.right)),y:e.y>=t.top&&e.y<=t.bottom?0:Math.min(Math.abs(e.y-t.top),Math.abs(e.y-t.bottom))}}function Cee({orientation:e,rects:t,targetRect:n}){let r={x:n.x+n.width/2,y:n.y+n.height/2},i,a=Number.MAX_VALUE;for(let n of t){let{x:t,y:o}=Pm(r,n),s=e===`horizontal`?t:o;s<a&&(a=s,i=n)}return km(i,`No rect found`),i}var Fm;function wee(){return Fm===void 0&&(Fm=typeof matchMedia==`function`?!!matchMedia(`(pointer:coarse)`).matches:!1),Fm}function Im(e){let{element:t,orientation:n,panels:r,separators:i}=e,a=Am(n,Array.from(t.children).filter(Nm).map(e=>({element:e}))).map(({element:e})=>e),o=[],s=!1,c=!1,l=-1,u=-1,d=0,f,p=[];{let e=-1;for(let t of a)t.hasAttribute(`data-panel`)&&(e++,t.hasAttribute(`data-disabled`)||(d++,l===-1&&(l=e),u=e))}if(d>1){let t=-1;for(let d of a)if(d.hasAttribute(`data-panel`)){t++;let i=r.find(e=>e.element===d);if(i){if(f){let r=f.element.getBoundingClientRect(),a=d.getBoundingClientRect(),m;if(c){let e=n===`horizontal`?new DOMRect(r.right,r.top,0,r.height):new DOMRect(r.left,r.bottom,r.width,0),t=n===`horizontal`?new DOMRect(a.left,a.top,0,a.height):new DOMRect(a.left,a.top,a.width,0);switch(p.length){case 0:m=[e,t];break;case 1:{let i=p[0];m=[i,Cee({orientation:n,rects:[r,a],targetRect:i.element.getBoundingClientRect()})===r?t:e];break}default:m=p;break}}else m=p.length?p:[n===`horizontal`?new DOMRect(r.right,a.top,a.left-r.right,a.height):new DOMRect(a.left,r.bottom,a.width,a.top-r.bottom)];for(let n of m){let r=`width`in n?n:n.element.getBoundingClientRect(),a=wee()?e.resizeTargetMinimumSize.coarse:e.resizeTargetMinimumSize.fine;if(r.width<a){let e=a-r.width;r=new DOMRect(r.x-e/2,r.y,r.width+e,r.height)}if(r.height<a){let e=a-r.height;r=new DOMRect(r.x,r.y-e/2,r.width,r.height+e)}!s&&!(t<=l||t>u)&&o.push({group:e,groupSize:Dm({group:e}),panels:[f,i],separator:`width`in n?void 0:n,rect:r}),s=!1}}c=!1,f=i,p=[]}}else if(d.hasAttribute(`data-separator`)){d.ariaDisabled!==null&&(s=!0);let e=i.find(e=>e.element===d);e?p.push(e):(f=void 0,p=[])}else c=!0}return o}var Lm=class{#e={};addListener(e,t){let n=this.#e[e];return n===void 0?this.#e[e]=[t]:n.includes(t)||n.push(t),()=>{this.removeListener(e,t)}}emit(e,t){let n=this.#e[e];if(n!==void 0)if(n.length===1)n[0].call(null,t);else{let e=!1,r=null,i=Array.from(n);for(let n=0;n<i.length;n++){let a=i[n];try{a.call(null,t)}catch(t){r===null&&(e=!0,r=t)}}if(e)throw r}}removeAllListeners(){this.#e={}}removeListener(e,t){let n=this.#e[e];if(n!==void 0){let e=n.indexOf(t);e>=0&&n.splice(e,1)}}},Rm=new Map,zm=new Lm;function Tee(e){Rm=new Map(Rm),Rm.delete(e)}function Bm(e,t){for(let[t]of Rm)if(t.id===e)return t}function Vm(e,t){for(let[t,n]of Rm)if(t.id===e)return n;if(t)throw Error(`Could not find data for Group with id ${e}`)}function Hm(){return Rm}function Um(e,t){return zm.addListener(`groupChange`,n=>{n.group.id===e&&t(n)})}function Wm(e,t){let n=Rm.get(e);Rm=new Map(Rm),Rm.set(e,t),zm.emit(`groupChange`,{group:e,prev:n,next:t})}function Eee(e,t,n){let r,i={x:1/0,y:1/0};for(let a of t){let t=Pm(n,a.rect);switch(e){case`horizontal`:t.x<=i.x&&(r=a,i=t);break;case`vertical`:t.y<=i.y&&(r=a,i=t);break}}return r?{distance:i,hitRegion:r}:void 0}function Dee(e){return typeof e==`object`&&!!e&&`nodeType`in e&&e.nodeType===Node.DOCUMENT_FRAGMENT_NODE}function Oee(e,t){if(e===t)throw Error(`Cannot compare node with itself`);let n={a:qm(e),b:qm(t)},r;for(;n.a.at(-1)===n.b.at(-1);)r=n.a.pop(),n.b.pop();km(r,`Stacking order can only be calculated for elements with a common ancestor`);let i={a:Km(Gm(n.a)),b:Km(Gm(n.b))};if(i.a===i.b){let e=r.childNodes,t={a:n.a.at(-1),b:n.b.at(-1)},i=e.length;for(;i--;){let n=e[i];if(n===t.a)return 1;if(n===t.b)return-1}}return Math.sign(i.a-i.b)}var kee=/\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;function Aee(e){let t=getComputedStyle(Jm(e)??e).display;return t===`flex`||t===`inline-flex`}function jee(e){let t=getComputedStyle(e);return!!(t.position===`fixed`||t.zIndex!==`auto`&&(t.position!==`static`||Aee(e))||+t.opacity<1||`transform`in t&&t.transform!==`none`||`webkitTransform`in t&&t.webkitTransform!==`none`||`mixBlendMode`in t&&t.mixBlendMode!==`normal`||`filter`in t&&t.filter!==`none`||`webkitFilter`in t&&t.webkitFilter!==`none`||`isolation`in t&&t.isolation===`isolate`||kee.test(t.willChange)||t.webkitOverflowScrolling===`touch`)}function Gm(e){let t=e.length;for(;t--;){let n=e[t];if(km(n,`Missing node`),jee(n))return n}return null}function Km(e){return e&&Number(getComputedStyle(e).zIndex)||0}function qm(e){let t=[];for(;e;)t.push(e),e=Jm(e);return t}function Jm(e){let{parentNode:t}=e;return Dee(t)?t.host:t}function Mee(e,t){return e.x<t.x+t.width&&e.x+e.width>t.x&&e.y<t.y+t.height&&e.y+e.height>t.y}function Nee({groupElement:e,hitRegion:t,pointerEventTarget:n}){if(!Nm(n)||n.contains(e)||e.contains(n))return!0;
373if(Oee(n,e)>0){let r=n;for(;r;){if(r.contains(e))return!0;if(Mee(r.getBoundingClientRect(),t))return!1;r=r.parentElement}}return!0}function Ym(e,t){let n=[];return t.forEach((t,r)=>{if(r.disabled)return;let i=Im(r),a=Eee(r.orientation,i,{x:e.clientX,y:e.clientY});a&&a.distance.x<=0&&a.distance.y<=0&&Nee({groupElement:r.element,hitRegion:a.hitRegion.rect,pointerEventTarget:e.target})&&n.push(a.hitRegion)}),n}function Pee(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!=t[n])return!1;return!0}function Xm(e,t,n=0){return Math.abs(Em(e)-Em(t))<=n}function Zm(e,t){return Xm(e,t)?0:e>t?1:-1}function Qm({overrideDisabledPanels:e,panelConstraints:t,prevSize:n,size:r}){let{collapsedSize:i=0,collapsible:a,disabled:o,maxSize:s=100,minSize:c=0}=t;if(o&&!e)return n;if(Zm(r,c)<0)if(a){let e=(i+c)/2;r=Zm(r,e)<0?i:c}else r=c;return r=Math.min(s,r),r=Em(r),r}function $m({delta:e,initialLayout:t,panelConstraints:n,pivotIndices:r,prevLayout:i,trigger:a}){if(Xm(e,0))return t;let o=a===`imperative-api`,s=Object.values(t),c=Object.values(i),l=[...s],[u,d]=r;km(u!=null,`Invalid first pivot index`),km(d!=null,`Invalid second pivot index`);let f=0;switch(a){case`keyboard`:{let t=e<0?d:u,r=n[t];km(r,`Panel constraints not found for index ${t}`);let{collapsedSize:i=0,collapsible:a,minSize:o=0}=r;if(a){let n=s[t];if(km(n!=null,`Previous layout not found for panel index ${t}`),Xm(n,i)){let t=o-n;Zm(t,Math.abs(e))>0&&(e=e<0?0-t:t)}}}{let t=e<0?u:d,r=n[t];km(r,`No panel constraints found for index ${t}`);let{collapsedSize:i=0,collapsible:a,minSize:o=0}=r;if(a){let n=s[t];if(km(n!=null,`Previous layout not found for panel index ${t}`),Xm(n,o)){let t=n-i;Zm(t,Math.abs(e))>0&&(e=e<0?0-t:t)}}}break;default:{let t=e<0?d:u,r=n[t];km(r,`Panel constraints not found for index ${t}`);let i=s[t],{collapsible:a,collapsedSize:o,minSize:c}=r;if(a&&Zm(i,c)<0)if(e>0){let t=c-o,n=t/2;Zm(i+e,c)<0&&(e=Zm(e,n)<=0?0:t)}else{let t=c-o,n=100-t/2;Zm(i-e,c)<0&&(e=Zm(100+e,n)>0?0:-t)}break}}{let t=e<0?1:-1,r=e<0?d:u,i=0;for(;;){let e=s[r];km(e!=null,`Previous layout not found for panel index ${r}`);let a=Qm({overrideDisabledPanels:o,panelConstraints:n[r],prevSize:e,size:100})-e;if(i+=a,r+=t,r<0||r>=n.length)break}let a=Math.min(Math.abs(e),Math.abs(i));e=e<0?0-a:a}{let t=e<0?u:d;for(;t>=0&&t<n.length;){let r=Math.abs(e)-Math.abs(f),i=s[t];km(i!=null,`Previous layout not found for panel index ${t}`);let a=i-r,c=Qm({overrideDisabledPanels:o,panelConstraints:n[t],prevSize:i,size:a});if(!Xm(i,c)&&(f+=i-c,l[t]=c,f.toFixed(3).localeCompare(Math.abs(e).toFixed(3),void 0,{numeric:!0})>=0))break;e<0?t--:t++}}if(Pee(c,l))return i;{let t=e<0?d:u,r=s[t];km(r!=null,`Previous layout not found for panel index ${t}`);let i=r+f,a=Qm({overrideDisabledPanels:o,panelConstraints:n[t],prevSize:r,size:i});if(l[t]=a,!Xm(a,i)){let t=i-a,r=e<0?d:u;for(;r>=0&&r<n.length;){let i=l[r];km(i!=null,`Previous layout not found for panel index ${r}`);let a=i+t,s=Qm({overrideDisabledPanels:o,panelConstraints:n[r],prevSize:i,size:a});if(Xm(i,s)||(t-=s-i,l[r]=s),Xm(t,0))break;e>0?r--:r++}}}if(!Xm(Object.values(l).reduce((e,t)=>t+e,0),100,.1))return i;let p=Object.keys(i);return l.reduce((e,t,n)=>(e[p[n]]=t,e),{})}function eh(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(let n in e)if(t[n]===void 0||Zm(e[n],t[n])!==0)return!1;return!0}function th({layout:e,panelConstraints:t}){let n=Object.values(e),r=[...n],i=r.reduce((e,t)=>e+t,0);if(r.length!==t.length)throw Error(`Invalid ${t.length} panel layout: ${r.map(e=>`${e}%`).join(`, `)}`);if(!Xm(i,100)&&r.length>0)for(let e=0;e<t.length;e++){let t=r[e];km(t!=null,`No layout data found for index ${e}`),r[e]=100/i*t}let a=0;for(let e=0;e<t.length;e++){let i=n[e];km(i!=null,`No layout data found for index ${e}`);let o=r[e];km(o!=null,`No layout data found for index ${e}`);let s=Qm({overrideDisabledPanels:!0,panelConstraints:t[e],prevSize:i,size:o});o!=s&&(a+=o-s,r[e]=s)}if(!Xm(a,0))for(let e=0;e<t.length;e++){let n=r[e];km(n!=null,`No layout data found for index ${e}`);let i=n+a,o=Qm({overrideDisabledPanels:!0,panelConstraints:t[e],prevSize:n,size:i});if(n!==o&&(a-=o-n,r[e]=o,Xm(a,0)))break}let o=Object.keys(e);
373return r.reduce((e,t,n)=>(e[o[n]]=t,e),{})}function nh({groupId:e,panelId:t}){let n=()=>{let t=Hm();for(let[n,{defaultLayoutDeferred:r,derivedPanelConstraints:i,layout:a,groupSize:o,separatorToPanels:s}]of t)if(n.id===e)return{defaultLayoutDeferred:r,derivedPanelConstraints:i,group:n,groupSize:o,layout:a,separatorToPanels:s};throw Error(`Group ${e} not found`)},r=()=>{let e=n().derivedPanelConstraints.find(e=>e.panelId===t);if(e!==void 0)return e;throw Error(`Panel constraints not found for Panel ${t}`)},i=()=>{let e=n().group.panels.find(e=>e.id===t);if(e!==void 0)return e;throw Error(`Layout not found for Panel ${t}`)},a=()=>{let e=n().layout[t];if(e!==void 0)return e;throw Error(`Layout not found for Panel ${t}`)},o=({nextSize:e,panels:n,prevLayout:r,derivedPanelConstraints:i})=>{let o=a(),s=n.findIndex(e=>e.id===t),c=s===0,l=s===n.length-1;if(l&&e<o&&(c||n.slice(0,s).every((e,t)=>{let n=i[t];return n?.collapsible&&Xm(n.collapsedSize,r[n.panelId])}))){let e=n.slice(0,s).reduce((e,t)=>e+r[t.id],0);return{...r,[t]:Em(100-e)}}return $m({delta:l?o-e:e-o,initialLayout:r,panelConstraints:i,pivotIndices:l?[s-1,s]:[s,s+1],prevLayout:r,trigger:`imperative-api`})},s=e=>{if(e===a())return;let{defaultLayoutDeferred:t,derivedPanelConstraints:r,group:i,groupSize:s,layout:c,separatorToPanels:l}=n(),u=th({layout:o({nextSize:e,panels:i.panels,prevLayout:c,derivedPanelConstraints:r}),panelConstraints:r});eh(c,u)||Wm(i,{defaultLayoutDeferred:t,derivedPanelConstraints:r,groupSize:s,layout:u,separatorToPanels:l})};return{collapse:()=>{let{collapsible:e,collapsedSize:t}=r(),{mutableValues:n}=i(),o=a();e&&o!==t&&(n.expandToSize=o,s(t))},expand:()=>{let{collapsible:e,collapsedSize:t,minSize:n}=r(),{mutableValues:o}=i(),c=a();if(e&&c===t){let e=o.expandToSize??n;e===0&&(e=1),s(e)}},getSize:()=>{let{group:e}=n(),t=a(),{element:r}=i();return{asPercentage:t,inPixels:e.orientation===`horizontal`?r.offsetWidth:r.offsetHeight}},isCollapsed:()=>{let{collapsible:e,collapsedSize:t}=r(),n=a();return e&&Xm(t,n)},resize:e=>{let{group:t}=n(),{element:r}=i(),a=Dm({group:t});s(Em(Tm({groupSize:a,panelElement:r,styleProp:e})/a*100))}}}function rh(e){e.defaultPrevented||Ym(e,Hm()).forEach(t=>{if(t.separator&&!t.separator.disableDoubleClick){let n=t.panels.find(e=>e.panelConstraints.defaultSize!==void 0);if(n){let r=n.panelConstraints.defaultSize,i=nh({groupId:t.group.id,panelId:n.id});i&&r!==void 0&&(i.resize(r),e.preventDefault())}}})}function ih(e){let t=Hm();for(let[n]of t)if(n.separators.some(t=>t.element===e))return n;throw Error(`Could not find parent Group for separator element`)}function ah({groupId:e}){let t=()=>{let t=Hm();for(let[n,r]of t)if(n.id===e)return{group:n,...r};throw Error(`Could not find Group with id "${e}"`)};return{getLayout(){let{defaultLayoutDeferred:e,layout:n}=t();return e?{}:n},setLayout(e){let{defaultLayoutDeferred:n,derivedPanelConstraints:r,group:i,groupSize:a,layout:o,separatorToPanels:s}=t(),c=th({layout:e,panelConstraints:r});return n?o:(eh(o,c)||Wm(i,{defaultLayoutDeferred:n,derivedPanelConstraints:r,groupSize:a,layout:c,separatorToPanels:s}),c)}}}function oh(e,t){let n=ih(e),r=Vm(n.id,!0),i=n.separators.find(t=>t.element===e);km(i,`Matching separator not found`);let a=r.separatorToPanels.get(i);km(a,`Matching panels not found`);let o=a.map(e=>n.panels.indexOf(e)),s=ah({groupId:n.id}).getLayout(),c=th({layout:$m({delta:t,initialLayout:s,panelConstraints:r.derivedPanelConstraints,pivotIndices:o,prevLayout:s,trigger:`keyboard`}),panelConstraints:r.derivedPanelConstraints});eh(s,c)||Wm(n,{defaultLayoutDeferred:r.defaultLayoutDeferred,derivedPanelConstraints:r.derivedPanelConstraints,groupSize:r.groupSize,layout:c,separatorToPanels:r.separatorToPanels})}function sh(e){if(e.defaultPrevented)return;let t=e.currentTarget,n=ih(t);if(!n.disabled)switch(e.key){case`ArrowDown`:e.preventDefault(),n.orientation===`vertical`&&oh(t,5);break;case`ArrowLeft`:e.preventDefault(),n.orientation===`horizontal`&&oh(t,-5);break;case`ArrowRight`:e.preventDefault(),n.orientation===`horizontal`&&oh(t,5);break;case`ArrowUp`:e.preventDefault(),n.orientation===`vertical`&&oh(t,-5);break;case`End`:e.preventDefault(),oh(t,100);break;case`Enter`:{e.preventDefault();let n=ih(t),{derivedPanelConstraints:r,layout:i,separatorToPanels:a}=Vm(n.id,!0),o=n.separators.find(e=>e.element===t);km(o,`Matching separator not found`);let s=a.get(o);km(s,`Matching panels not found`);let c=s[0],l=r.find(e=>e.panelId===c.id);if(km(l,`Panel metadata not found`),l.collapsible){let e=i[c.id];oh(t,(l.collapsedSize===e?n.mutableState.expandedPanelSizes[c.id]??l.minSize:l.collapsedSize)-e)}break}case`F6`:{e.preventDefault();let n=ih(t).separators.map(e=>e.element),r=Array.from(n).findIndex(t=>t===e.currentTarget);km(r!==null,`Index not found`),n[e.shiftKey?r>0?r-1:n.length-1:r+1<n.length?r+1:0].focus({preventScroll:!0});break}case`Home`:e.preventDefault(),oh(t,-100);break}}var ch={cursorFlags:0,state:`inactive`},lh=new Lm;function uh(){return ch}function dh(e){return lh.addListener(`change`,e)}function fh(e){let t=ch,n={...ch};
373n.cursorFlags=e,ch=n,lh.emit(`change`,{prev:t,next:n})}function ph(e){let t=ch;ch=e,lh.emit(`change`,{prev:t,next:e})}function mh(e){if(e.defaultPrevented||e.pointerType===`mouse`&&e.button>0)return;let t=Hm(),n=Ym(e,t),r=new Map,i=!1;n.forEach(e=>{e.separator&&(i||(i=!0,e.separator.element.focus({focusVisible:!1,preventScroll:!0})));let n=t.get(e.group);n&&r.set(e.group,n.layout)}),ph({cursorFlags:0,hitRegions:n,initialLayoutMap:r,pointerDownAtPoint:{x:e.clientX,y:e.clientY},state:`active`}),n.length&&e.preventDefault()}var hh=e=>e,gh=()=>{},_h=1,vh=2,yh=4,bh=8,xh=3,Sh=12,Ch;function wh(){return Ch===void 0&&(Ch=!1,typeof window<`u`&&(window.navigator.userAgent.includes(`Chrome`)||window.navigator.userAgent.includes(`Firefox`))&&(Ch=!0)),Ch}function Fee({cursorFlags:e,groups:t,state:n}){let r=0,i=0;switch(n){case`active`:case`hover`:t.forEach(e=>{if(!e.mutableState.disableCursor)switch(e.orientation){case`horizontal`:r++;break;case`vertical`:i++;break}})}if(!(r===0&&i===0)){switch(n){case`active`:if(e&&wh()){let t=(e&_h)!==0,n=(e&vh)!==0,r=(e&yh)!==0,i=(e&bh)!==0;if(t)return r?`se-resize`:i?`ne-resize`:`e-resize`;if(n)return r?`sw-resize`:i?`nw-resize`:`w-resize`;if(r)return`s-resize`;if(i)return`n-resize`}break}return wh()?r>0&&i>0?`move`:r>0?`ew-resize`:`ns-resize`:r>0&&i>0?`grab`:r>0?`col-resize`:`row-resize`}}var Th=new WeakMap;function Eh(e){if(e.defaultView===null||e.defaultView===void 0)return;let{prevStyle:t,styleSheet:n}=Th.get(e)??{};n===void 0&&(n=new e.defaultView.CSSStyleSheet,e.adoptedStyleSheets&&(Object.isExtensible(e.adoptedStyleSheets)?e.adoptedStyleSheets.push(n):e.adoptedStyleSheets=[...e.adoptedStyleSheets,n]));let r=uh();switch(r.state){case`active`:case`hover`:{let e=Fee({cursorFlags:r.cursorFlags,groups:r.hitRegions.map(e=>e.group),state:r.state}),i=`*, *:hover {cursor: ${e} !important; }`;if(t===i)return;t=i,e?n.cssRules.length===0?n.insertRule(i):n.replaceSync(i):n.cssRules.length===1&&n.deleteRule(0);break}case`inactive`:t=void 0,n.cssRules.length===1&&n.deleteRule(0);break}Th.set(e,{prevStyle:t,styleSheet:n})}function Dh({document:e,event:t,hitRegions:n,initialLayoutMap:r,mountedGroups:i,pointerDownAtPoint:a,prevCursorFlags:o}){let s=0;n.forEach(e=>{let{group:n,groupSize:o}=e,{orientation:c,panels:l}=n,{disableCursor:u}=n.mutableState,d=0;d=a?c===`horizontal`?(t.clientX-a.x)/o*100:(t.clientY-a.y)/o*100:c===`horizontal`?t.clientX<0?-100:100:t.clientY<0?-100:100;let f=r.get(n),p=i.get(n);if(!f||!p)return;let{defaultLayoutDeferred:m,derivedPanelConstraints:h,groupSize:g,layout:_,separatorToPanels:v}=p;if(h&&_&&v){let t=$m({delta:d,initialLayout:f,panelConstraints:h,pivotIndices:e.panels.map(e=>l.indexOf(e)),prevLayout:_,trigger:`mouse-or-touch`});if(eh(t,_)){if(d!==0&&!u)switch(c){case`horizontal`:s|=d<0?_h:vh;break;case`vertical`:s|=d<0?yh:bh;break}}else Wm(e.group,{defaultLayoutDeferred:m,derivedPanelConstraints:h,groupSize:g,layout:t,separatorToPanels:v})}});let c=0;
373t.movementX===0?c|=o&xh:c|=s&xh,t.movementY===0?c|=o&Sh:c|=s&Sh,fh(c),Eh(e)}function Oh(e){let t=Hm(),n=uh();switch(n.state){case`active`:Dh({document:e.currentTarget,event:e,hitRegions:n.hitRegions,initialLayoutMap:n.initialLayoutMap,mountedGroups:t,prevCursorFlags:n.cursorFlags})}}function kh(e){if(e.defaultPrevented)return;let t=uh(),n=Hm();switch(t.state){case`active`:if(e.buttons===0){ph({cursorFlags:0,state:`inactive`}),t.hitRegions.forEach(e=>{let t=Vm(e.group.id,!0);Wm(e.group,t)});return}for(let n of t.hitRegions)if(n.separator){let{element:t}=n.separator;t.hasPointerCapture?.(e.pointerId)||t.setPointerCapture?.(e.pointerId)}Dh({document:e.currentTarget,event:e,hitRegions:t.hitRegions,initialLayoutMap:t.initialLayoutMap,mountedGroups:n,pointerDownAtPoint:t.pointerDownAtPoint,prevCursorFlags:t.cursorFlags});break;default:{let r=Ym(e,n);r.length===0?t.state!==`inactive`&&ph({cursorFlags:0,state:`inactive`}):ph({cursorFlags:0,hitRegions:r,state:`hover`}),Eh(e.currentTarget);break}}}function Ah(e){if(e.relatedTarget instanceof HTMLIFrameElement)switch(uh().state){case`hover`:ph({cursorFlags:0,state:`inactive`})}}function jh(e){if(e.defaultPrevented||e.pointerType===`mouse`&&e.button>0)return;let t=uh();switch(t.state){case`active`:ph({cursorFlags:0,state:`inactive`}),t.hitRegions.length>0&&(Eh(e.currentTarget),t.hitRegions.forEach(e=>{let t=Vm(e.group.id,!0);Wm(e.group,t)}),e.preventDefault())}}function Mh(e){let t=0,n=0,r={};for(let i of e)if(i.defaultSize!==void 0){t++;let e=Em(i.defaultSize);n+=e,r[i.panelId]=e}else r[i.panelId]=void 0;let i=e.length-t;if(i!==0){let t=Em((100-n)/i);for(let n of e)n.defaultSize===void 0&&(r[n.panelId]=t)}return r}function Iee(e,t,n){if(!n[0])return;let r=e.panels.find(e=>e.element===t);if(!r||!r.onResize)return;let i=Dm({group:e}),a=e.orientation===`horizontal`?r.element.offsetWidth:r.element.offsetHeight,o=r.mutableValues.prevSize,s={asPercentage:Em(a/i*100),inPixels:a};r.mutableValues.prevSize=s,r.onResize(s,r.id,o)}function Lee(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(let n in e)if(e[n]!==t[n])return!1;return!0}function Ree({group:e,nextGroupSize:t,prevGroupSize:n,prevLayout:r}){if(n<=0||t<=0||n===t)return r;let i=0,a=0,o=!1,s=new Map,c=[];for(let l of e.panels){let e=r[l.id]??0;switch(l.panelConstraints.groupResizeBehavior){case`preserve-pixel-size`:{o=!0;let r=Em(e/100*n/t*100);s.set(l.id,r),i+=r;break}default:c.push(l.id),a+=e;break}}if(!o||c.length===0)return r;let l=100-i,u={...r};if(s.forEach((e,t)=>{u[t]=e}),a>0)for(let e of c)u[e]=Em((r[e]??0)/a*l);else{let e=Em(l/c.length);for(let t of c)u[t]=e}return u}function zee(e,t){let n=e.map(e=>e.id),r=Object.keys(t);if(n.length!==r.length)return!1;for(let e of n)if(!r.includes(e))return!1;return!0}var Nh=new Map;function Bee(e){let t=!0;km(e.element.ownerDocument.defaultView,`Cannot register an unmounted Group`);let n=e.element.ownerDocument.defaultView.ResizeObserver,r=new Set,i=new Set,a=new n(n=>{for(let r of n){let{borderBoxSize:n,target:i}=r;if(i===e.element){if(t){let t=Dm({group:e});if(t===0)return;let n=Vm(e.id);if(!n)return;let r=Om(e),i=n.defaultLayoutDeferred?Mh(r):n.layout,a=th({layout:Ree({group:e,nextGroupSize:t,prevGroupSize:n.groupSize,prevLayout:i}),panelConstraints:r});if(!n.defaultLayoutDeferred&&eh(n.layout,a)&&Lee(n.derivedPanelConstraints,r)&&n.groupSize===t)return;Wm(e,{defaultLayoutDeferred:!1,derivedPanelConstraints:r,groupSize:t,layout:a,separatorToPanels:n.separatorToPanels})}}else Iee(e,i,n)}});a.observe(e.element),e.panels.forEach(e=>{km(!r.has(e.id),`Panel ids must be unique; id "${e.id}" was used more than once`),r.add(e.id),e.onResize&&a.observe(e.element)});let o=Dm({group:e}),s=Om(e),c=e.panels.map(({id:e})=>e).join(`,`),l=e.mutableState.defaultLayout;l&&(zee(e.panels,l)||(l=void 0));let u=th({layout:e.mutableState.layouts[c]??l??Mh(s),panelConstraints:s}),d=e.element.ownerDocument;Nh.set(d,(Nh.get(d)??0)+1);let f=new Map;return Im(e).forEach(e=>{e.separator&&f.set(e.separator,e.panels)}),Wm(e,{defaultLayoutDeferred:o===0,derivedPanelConstraints:s,groupSize:o,layout:u,separatorToPanels:f}
373),e.separators.forEach(e=>{km(!i.has(e.id),`Separator ids must be unique; id "${e.id}" was used more than once`),i.add(e.id),e.element.addEventListener(`keydown`,sh)}),Nh.get(d)===1&&(d.addEventListener(`dblclick`,rh,!0),d.addEventListener(`pointerdown`,mh,!0),d.addEventListener(`pointerleave`,Oh),d.addEventListener(`pointermove`,kh),d.addEventListener(`pointerout`,Ah),d.addEventListener(`pointerup`,jh,!0)),function(){t=!1,Nh.set(d,Math.max(0,(Nh.get(d)??0)-1)),Tee(e),e.separators.forEach(e=>{e.element.removeEventListener(`keydown`,sh)}),Nh.get(d)||(d.removeEventListener(`dblclick`,rh,!0),d.removeEventListener(`pointerdown`,mh,!0),d.removeEventListener(`pointerleave`,Oh),d.removeEventListener(`pointermove`,kh),d.removeEventListener(`pointerout`,Ah),d.removeEventListener(`pointerup`,jh,!0)),a.disconnect()}}function Vee(){let[e,t]=(0,d.useState)({});return[e,(0,d.useCallback)(()=>t({}),[])]}function Ph(e){let t=(0,d.useId)();return`${e??t}`}var Fh=typeof window<`u`?d.useLayoutEffect:d.useEffect;function Ih(e){let t=(0,d.useRef)(e);return Fh(()=>{t.current=e},[e]),(0,d.useCallback)((...e)=>t.current?.(...e),[t])}function Lh(...e){return Ih(t=>{e.forEach(e=>{if(e)switch(typeof e){case`function`:e(t);break;case`object`:e.current=t;break}})})}function Rh(e){let t=(0,d.useRef)({...e});return Fh(()=>{for(let n in e)t.current[n]=e[n]},[e]),t.current}var zh=(0,d.createContext)(null);function Hee(e,t){let n=(0,d.useRef)({getLayout:()=>({}),setLayout:hh});(0,d.useImperativeHandle)(t,()=>n.current,[]),Fh(()=>{Object.assign(n.current,ah({groupId:e}))})}function Bh({children:e,className:t,defaultLayout:n,disableCursor:r,disabled:i,elementRef:a,groupRef:o,id:s,onLayoutChange:c,onLayoutChanged:l,orientation:u=`horizontal`,resizeTargetMinimumSize:f={coarse:20,fine:10},style:p,...m}){let h=(0,d.useRef)({onLayoutChange:{},onLayoutChanged:{}}),g=Ih(e=>{eh(h.current.onLayoutChange,e)||(h.current.onLayoutChange=e,c?.(e))}),_=Ih(e=>{eh(h.current.onLayoutChanged,e)||(h.current.onLayoutChanged=e,l?.(e))}),v=Ph(s),y=(0,d.useRef)(null),[b,x]=Vee(),S=(0,d.useRef)({lastExpandedPanelSizes:{},layouts:{},panels:[],resizeTargetMinimumSize:f,separators:[]}),C=Lh(y,a);Hee(v,o);let w=Ih((e,t)=>{let r=uh(),i=Bm(e),a=Vm(e);if(a){let e=!1;switch(r.state){case`active`:e=r.hitRegions.some(e=>e.group===i);break}return{flexGrow:a.layout[t]??1,pointerEvents:e?`none`:void 0}}if(n?.[t])return{flexGrow:n?.[t]}}),T=Rh({defaultLayout:n,disableCursor:r}),E=(0,d.useMemo)(()=>({get disableCursor(){return!!T.disableCursor},getPanelStyles:w,id:v,orientation:u,registerPanel:e=>{let t=S.current;return t.panels=Am(u,[...t.panels,e]),x(),()=>{t.panels=t.panels.filter(t=>t!==e),x()}},registerSeparator:e=>{let t=S.current;return t.separators=Am(u,[...t.separators,e]),x(),()=>{t.separators=t.separators.filter(t=>t!==e),x()}},updatePanelProps:(e,{disabled:t})=>{let n=S.current.panels.find(t=>t.id===e);n&&(n.panelConstraints.disabled=t);let r=Bm(v),i=Vm(v);r&&i&&Wm(r,{...i,derivedPanelConstraints:Om(r)})},updateSeparatorProps:(e,{disabled:t,disableDoubleClick:n})=>{let r=S.current.separators.find(t=>t.id===e);r&&(r.disabled=t,r.disableDoubleClick=n)}}),[w,v,x,u,T]),D=(0,d.useRef)(null);return Fh(()=>{let e=y.current;if(e===null)return;let t=S.current,n;if(T.defaultLayout!==void 0&&Object.keys(T.defaultLayout).length===t.panels.length){n={};for(let e of t.panels){let t=T.defaultLayout[e.id];t!==void 0&&(n[e.id]=t)}}let r={disabled:!!i,element:e,id:v,mutableState:{defaultLayout:n,disableCursor:!!T.disableCursor,expandedPanelSizes:S.current.lastExpandedPanelSizes,layouts:S.current.layouts},orientation:u,panels:t.panels,resizeTargetMinimumSize:t.resizeTargetMinimumSize,separators:t.separators};D.current=r;let a=Bee(r),{defaultLayoutDeferred:o,derivedPanelConstraints:s,layout:c}=Vm(r.id,!0);!o&&s.length>0&&(g(c),_(c));let l=Um(v,e=>{let{defaultLayoutDeferred:t,derivedPanelConstraints:n,layout:i}=e.next;if(t||n.length===0)return;let a=r.panels.map(({id:e})=>e).join(`,`);r.mutableState.layouts[a]=i,n.forEach(t=>{if(t.collapsible){let{layout:n}=e.prev??{};if(n){let e=Xm(t.collapsedSize,i[t.panelId]),a=Xm(t.collapsedSize,n[t.panelId]);e&&!a&&(r.mutableState.expandedPanelSizes[t.panelId]=n[t.panelId])}}});let o=uh().state!==`active`;g(i),o&&_(i)});return()=>{D.current=null,a(),l()}},[i,v,_,g,u,b,T]),(0,d.useEffect)(()=>{let e=D.current;e&&(e.mutableState.defaultLayout=n,e.mutableState.disableCursor=!!r)}),(0,R.jsx)(zh.Provider,{value:E,children:(0,R.jsx)(`div`,{...m,className:t,"data-group":!0,"data-testid":v,id:v,ref:C,style:{height:`100%`,width:`100%`,overflow:`hidden`,...p,display:`flex`,flexDirection:u===`horizontal`?`row`:`column`,flexWrap:`nowrap`,touchAction:u===`horizontal`?`pan-y`
373:`pan-x`},children:e})})}Bh.displayName=`Group`;function Vh(){let e=(0,d.useContext)(zh);return km(e,`Group Context not found; did you render a Panel or Separator outside of a Group?`),e}function Uee(e,t){let{id:n}=Vh(),r=(0,d.useRef)({collapse:gh,expand:gh,getSize:()=>({asPercentage:0,inPixels:0}),isCollapsed:()=>!1,resize:gh});(0,d.useImperativeHandle)(t,()=>r.current,[]),Fh(()=>{Object.assign(r.current,nh({groupId:n,panelId:e}))})}function Hh({children:e,className:t,collapsedSize:n=`0%`,collapsible:r=!1,defaultSize:i,disabled:a,elementRef:o,groupResizeBehavior:s=`preserve-relative-size`,id:c,maxSize:l=`100%`,minSize:u=`0%`,onResize:f,panelRef:p,style:m,...h}){let g=!!c,_=Ph(c),v=Rh({disabled:a}),y=(0,d.useRef)(null),b=Lh(y,o),{getPanelStyles:x,id:S,orientation:C,registerPanel:w,updatePanelProps:T}=Vh(),E=f!==null,D=Ih((e,t,n)=>{f?.(e,c,n)});Fh(()=>{let e=y.current;if(e!==null)return w({element:e,id:_,idIsStable:g,mutableValues:{expandToSize:void 0,prevSize:void 0},onResize:E?D:void 0,panelConstraints:{groupResizeBehavior:s,collapsedSize:n,collapsible:r,defaultSize:i,disabled:v.disabled,maxSize:l,minSize:u}})},[s,n,r,i,E,_,g,l,u,D,w,v]),(0,d.useEffect)(()=>{T(_,{disabled:a})},[a,_,T]),Uee(_,p);let O=()=>{let e=x(S,_);if(e)return JSON.stringify(e)},k=(0,d.useSyncExternalStore)(e=>Um(S,e),O,O),A;return A=k?JSON.parse(k):i===void 0?{flexGrow:1}:{flexGrow:void 0,flexShrink:void 0,flexBasis:i},(0,R.jsx)(`div`,{...h,"data-disabled":a||void 0,"data-panel":!0,"data-testid":_,id:_,ref:b,style:{...Wee,display:`flex`,flexBasis:0,flexShrink:1,overflow:`visible`,...A},children:(0,R.jsx)(`div`,{className:t,style:{maxHeight:`100%`,maxWidth:`100%`,flexGrow:1,overflow:`auto`,...m,touchAction:C===`horizontal`?`pan-y`:`pan-x`},children:e})})}Hh.displayName=`Panel`;var Wee={minHeight:0,maxHeight:`100%`,height:`auto`,minWidth:0,maxWidth:`100%`,width:`auto`,border:`none`,borderWidth:0,padding:0,margin:0};function Gee({layout:e,panelConstraints:t,panelId:n,panelIndex:r}){let i,a,o=e[n],s=t.find(e=>e.panelId===n);if(s){let c=s.maxSize,l=s.collapsible?s.collapsedSize:s.minSize,u=[r,r+1];a=th({layout:$m({delta:l-o,initialLayout:e,panelConstraints:t,pivotIndices:u,prevLayout:e}),panelConstraints:t})[n],i=th({layout:$m({delta:c-o,initialLayout:e,panelConstraints:t,pivotIndices:u,prevLayout:e}),panelConstraints:t})[n]}return{valueControls:n,valueMax:i,valueMin:a,valueNow:o}}function Uh({children:e,className:t,disabled:n,disableDoubleClick:r,elementRef:i,id:a,style:o,...s}){let c=Ph(a),l=Rh({disabled:n,disableDoubleClick:r}),[u,f]=(0,d.useState)({}),[p,m]=(0,d.useState)(`inactive`),[h,g]=(0,d.useState)(!1),_=(0,d.useRef)(null),v=Lh(_,i),{disableCursor:y,id:b,orientation:x,registerSeparator:S,updateSeparatorProps:C}=Vh(),w=x===`horizontal`?`vertical`:`horizontal`;Fh(()=>{let e=_.current;if(e!==null){let t={disabled:l.disabled,disableDoubleClick:l.disableDoubleClick,element:e,id:c},n=S(t),r=dh(e=>{m(e.next.state!==`inactive`&&e.next.hitRegions.some(e=>e.separator===t)?e.next.state:`inactive`)}),i=Um(b,e=>{let{derivedPanelConstraints:n,layout:r,separatorToPanels:i}=e.next,a=i.get(t);if(a){let e=a[0],t=a.indexOf(e);f(Gee({layout:r,panelConstraints:n,panelId:e.id,panelIndex:t}))}});return()=>{r(),i(),n()}}},[b,c,S,l]),(0,d.useEffect)(()=>{C(c,{disabled:n,disableDoubleClick:r})},[n,r,c,C]);let T;n&&!y&&(T=`not-allowed`);let E;if(n)E=`disabled`;else switch(p){case`active`:E=`active`;break;default:E=h?`focus`:p}return(0,R.jsx)(`div`,{...s,"aria-controls":u.valueControls,"aria-disabled":n||void 0,"aria-orientation":w,"aria-valuemax":u.valueMax,"aria-valuemin":u.valueMin,"aria-valuenow":u.valueNow,children:e,className:t,"data-separator":E,"data-testid":c,id:c,onBlur:()=>g(!1),onFocus:()=>g(!0),ref:v,role:`separator`,style:{flexBasis:`auto`,cursor:T,...o,flexGrow:0,flexShrink:0,touchAction:`none`},tabIndex:n?void 0:0})}Uh.displayName=`Separator`;var Kee={Easy:{backgroundColor:`#DCFCE7`,color:`#166534`},Medium:{backgroundColor:`#FEF9C3`,color:`#854D0E`},Hard:{backgroundColor:`#FEE2E2`,color:`#991B1B`}};function qee({problem:e,currentProblemId:t,onProblemChange:n,allProblems:r}){return(0,R.jsxs)(`div`,{className:`h-full overflow-y-auto`,style:{backgroundColor:`#F5F0E8`},children:[(0,R.jsxs)(`div`,{className:`px-6 pt-6 pb-4 border-b border-[#
373E0D9CF]`,style:{backgroundColor:`#F5F0E8`},children:[(0,R.jsxs)(`div`,{className:`flex items-center justify-between mb-1`,children:[(0,R.jsx)(`h1`,{className:`text-2xl font-bold text-[#1A1A1A]`,style:{fontFamily:`'Playfair Display', serif`},children:e.title}),(0,R.jsx)(`span`,{className:`text-xs font-medium px-3 py-1 rounded-full`,style:Kee[e.difficulty]||{},children:e.difficulty})]}),(0,R.jsx)(`p`,{className:`text-sm text-[#9B9590] mb-4`,children:e.category})]}),(0,R.jsxs)(`div`,{className:`p-6 space-y-4`,children:[(0,R.jsxs)(`div`,{className:`rounded-2xl border border-[#E0D9CF] p-5`,style:{backgroundColor:`white`},children:[(0,R.jsx)(`h2`,{className:`text-base font-bold text-[#1A1A1A] mb-3`,children:`Description`}),(0,R.jsxs)(`div`,{className:`space-y-2 text-sm text-[#4B4540] leading-relaxed`,children:[(0,R.jsx)(`p`,{children:e.description.text}),e.description.notes.map((e,t)=>(0,R.jsx)(`p`,{children:e},t))]})]}),(0,R.jsxs)(`div`,{className:`rounded-2xl border border-[#E0D9CF] p-5`,style:{backgroundColor:`white`},children:[(0,R.jsx)(`h2`,{className:`text-base font-bold text-[#1A1A1A] mb-4`,children:`Examples`}),(0,R.jsx)(`div`,{className:`space-y-4`,children:e.examples.map((e,t)=>(0,R.jsxs)(`div`,{children:[(0,R.jsxs)(`p`,{className:`text-sm font-semibold text-[#1A1A1A] mb-2`,children:[`Example `,t+1]}),(0,R.jsxs)(`div`,{className:`rounded-xl p-4 font-mono text-sm space-y-1.5 border border-[#E0D9CF]`,style:{backgroundColor:`#F5F0E8`},children:[(0,R.jsxs)(`div`,{className:`flex gap-2`,children:[(0,R.jsx)(`span`,{className:`font-bold min-w-[70px]`,style:{color:`#854D0E`},children:`Input:`}),(0,R.jsx)(`span`,{className:`text-[#1A1A1A]`,children:e.input})]}),(0,R.jsxs)(`div`,{className:`flex gap-2`,children:[(0,R.jsx)(`span`,{className:`font-bold min-w-[70px]`,style:{color:`#166534`},children:`Output:`}),(0,R.jsx)(`span`,{className:`text-[#1A1A1A]`,children:e.output})]}),e.explanation&&(0,R.jsx)(`div`,{className:`pt-2 mt-1 border-t border-[#E0D9CF]`,children:(0,R.jsxs)(`span`,{className:`text-xs text-[#6B7280] font-sans`,children:[(0,R.jsx)(`span`,{className:`font-semibold`,children:`Explanation:`}),` `,e.explanation]})})]})]},t))})]}),(0,R.jsxs)(`div`,{className:`rounded-2xl border border-[#E0D9CF] p-5`,style:{backgroundColor:`white`},children:[(0,R.jsx)(`h2`,{className:`text-base font-bold text-[#1A1A1A] mb-3`,children:`Constraints`}),(0,R.jsx)(`ul`,{className:`space-y-2`,children:e.constraints.map((e,t)=>(0,R.jsxs)(`li`,{className:`flex items-start gap-2`,children:[(0,R.jsx)(`span`,{className:`mt-0.5 text-[#FFD60A]`,children:`♦`}),(0,R.jsx)(`code`,{className:`text-sm text-[#4B4540]`,children:e})]},t))})]})]})]})}function Wh({output:e}){return(0,R.jsxs)(`div`,{className:`h-full flex flex-col bg-[#0d1117]`,children:[(0,R.jsxs)(`div`,{className:`flex items-center justify-between px-4 py-3 border-b border-[#30363d] bg-[#161b22]`,children:[(0,R.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,R.jsx)(Vp,{className:`size-4 text-[#8b949e]`}),(0,R.jsx)(`span`,{className:`text-sm font-medium text-[#e6edf3]`,children:`Console Output`})]}),e&&(0,R.jsx)(`div`,{className:`
374              flex items-center gap-1
375              text-xs
376              px-2 py-1
377              rounded-full
378              border
379              ${e.success?`bg-[#12261e] border-[#1f6f43] text-[#3fb950]`:`bg-[#2d1617] border-[#8b1e24] text-[#f85149]`}
380            `,children:e.success?(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(Tp,{className:`size-3`}),`Success`]}):(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(Ep,{className:`size-3`}),`Failed`]})})]}),(0,R.jsx)(`div`,{className:`flex-1 p-4 overflow-auto`,children:e===null?(0,R.jsxs)(`div`,{className:`flex flex-col items-center justify-center h-full text-center`,children:[(0,R.jsx)(Vp,{className:`size-10 text-[#30363d] mb-3`}),(0,R.jsx)(`p`,{className:`text-[#8b949e] text-sm`,children:`Run your code to see execution results`})]}):e.success?(0,R.jsxs)(`div`,{className:`space-y-3`,children:[(0,R.jsx)(`p`,{className:`text-xs uppercase tracking-wide text-[#8b949e]`,children:`Standard Output`}),(0,R.jsx)(`pre`,{className:`
381                text-sm
382                font-mono
383                whitespace-pre-wrap
384                rounded-xl
385                p-4
386                border
387                border-[#30363d]
388                bg-[#010409]
389                text-[#3fb950]
390                overflow-auto
391              `,children:e.output})]}):(0,R.jsxs)(`div`,{className:`space-y-4`,children:[e.output&&(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`p`,{className:`text-xs uppercase tracking-wide text-[#8b949e] mb-2`,children:`Standard Output`}),(0,R.jsx)(`pre`,{className:`
392                    text-sm
393                    font-mono
394                    whitespace-pre-wrap
395                    rounded-xl
396                    p-4
397                    border
398                    border-[#30363d]
399                    bg-[#010409]
400                    text-[#e6edf3]
401                  `,children:e.output})]}),(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`p`,{className:`text-xs uppercase tracking-wide text-[#8b949e] mb-2`,children:`Error Output`}),(0,R.jsx)(`pre`,{className:`
402                  text-sm
403                  font-mono
404                  whitespace-pre-wrap
405                  rounded-xl
406                  p-4
407                  border
408                  border-[#5a1e24]
409                  bg-[#160b0d]
410                  text-[#ff7b72]
411                `,children:e.error})]})]})})]})}function Gh(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Jee(e){if(Array.isArray(e))return e}function Yee(e,t,n){return(t=nte(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Xee(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t!==0)for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}
411finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function Zee(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
412In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Kh(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function qh(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?Kh(Object(n),!0).forEach(function(t){Yee(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Kh(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Qee(e,t){if(e==null)return{};var n,r,i=$ee(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function $ee(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function ete(e,t){return Jee(e)||Xee(e,t)||rte(e,t)||Zee()}function tte(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function nte(e){var t=tte(e,`string`);return typeof t==`symbol`?t:t+``}function rte(e,t){if(e){if(typeof e==`string`)return Gh(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Gh(e,t):void 0}}function ite(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Jh(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Yh(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?Jh(Object(n),!0).forEach(function(t){ite(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Jh(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function ate(){var e=[...arguments];return function(t){return e.reduceRight(function(e,t){return t(e)},t)}}function Xh(e){return function t(){var n=this,r=[...arguments];return r.length>=e.length?e.apply(this,r):function(){var e=[...arguments];return t.apply(n,[].concat(r,e))}}}function Zh(e){return{}.toString.call(e).includes(`Object`)}function ote(e){return!Object.keys(e).length}function Qh(e){return typeof e==`function`}function ste(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function cte(e,t){return Zh(t)||$h(`changeType`),Object.keys(t).some(function(t){return!ste(e,t)})&&$h(`changeField`),t}function lte(e){Qh(e)||$h(`selectorType`)}function ute(e){Qh(e)||Zh(e)||$h(`handlerType`),Zh(e)&&Object.values(e).some(function(e){return!Qh(e)})&&$h(`handlersType`)}function dte(e){e||$h(`initialIsRequired`),Zh(e)||$h(`initialType`),ote(e)&&$h(`initialContent`)}function fte(e,t){throw Error(e[t]||e.default)}var $h=Xh(fte)({initialIsRequired:`initial state is required`,initialType:`initial state should be an object`,initialContent:`initial state shouldn't be an empty object`,handlerType:`handler should be an object or a function`,handlersType:`all handlers should be a functions`,selectorType:`selector should be a function`,changeType:`provided value of changes should be an object`,changeField:`it seams you want to change a field in the state which is not specified in the "initial" state`,default:"an unknown error accured in `state-local` package"}),eg={changes:cte,selector:lte,handler:ute,initial:dte};function tg(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};eg.initial(e),eg.handler(t);var n={current:e},r=Xh(ig)(n,t),i=Xh(rg)(n),a=Xh(eg.changes)(e),o=Xh(ng)(n);function s(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:function(e){return e};return eg.selector(e),e(n.current)}function c(e){ate(r,i,a,o)(e)}return[s,c]}function ng(e,t){return Qh(t)?t(e.current):t}function rg(e,t){return e.current=Yh(Yh({},e.current),t),t}function ig(e,t,n){return Qh(t)?t(e.current):Object.keys(n).forEac
412h(function(n){return t[n]?.call(t,e.current[n])}),n}var ag={create:tg},og={paths:{vs:`https://cdn.jsdelivr.net/npm/[email protected]/min/vs`}};function sg(e){return function t(){var n=this,r=[...arguments];return r.length>=e.length?e.apply(this,r):function(){var e=[...arguments];return t.apply(n,[].concat(r,e))}}}function cg(e){return{}.toString.call(e).includes(`Object`)}function lg(e){return e||pg(`configIsRequired`),cg(e)||pg(`configType`),e.urls?(ug(),{paths:{vs:e.urls.monacoBase}}):e}function ug(){console.warn(fg.deprecation)}function dg(e,t){throw Error(e[t]||e.default)}var fg={configIsRequired:`the configuration object is required`,configType:`the configuration object should be an object`,default:"an unknown error accured in `@monaco-editor/loader` package",deprecation:`Deprecation warning!
413    You are using deprecated way of configuration.
414
415    Instead of using
416      monaco.config({ urls: { monacoBase: '...' } })
417    use
418      monaco.config({ paths: { vs: '...' } })
419
420    For more please check the link https://github.com/suren-atoyan/monaco-loader#config
421  `},pg=sg(dg)(fg),mg={config:lg},hg=function(){var e=[...arguments];return function(t){return e.reduceRight(function(e,t){return t(e)},t)}};function gg(e,t){return Object.keys(t).forEach(function(n){t[n]instanceof Object&&e[n]&&Object.assign(t[n],gg(e[n],t[n]))}),qh(qh({},e),t)}var _g={type:`cancelation`,msg:`operation is manually canceled`};function vg(e){var t=!1,n=new Promise(function(n,r){e.then(function(e){return t?r(_g):n(e)}),e.catch(r)});return n.cancel=function(){return t=!0},n}var yg=[`monaco`],bg=ete(ag.create({config:og,isInitialized:!1,resolve:null,reject:null,monaco:null}),2),xg=bg[0],Sg=bg[1];function Cg(e){var t=mg.config(e),n=t.monaco,r=Qee(t,yg);Sg(function(e){return{config:gg(e.config,r),monaco:n}})}function wg(){var e=xg(function(e){return{monaco:e.monaco,isInitialized:e.isInitialized,resolve:e.resolve}});if(!e.isInitialized){if(Sg({isInitialized:!0}),e.monaco)return e.resolve(e.monaco),vg(jg);if(window.monaco&&window.monaco.editor)return kg(window.monaco),e.resolve(window.monaco),vg(jg);hg(Tg,Dg)(Og)}return vg(jg)}function Tg(e){return document.body.appendChild(e)}function Eg(e){var t=document.createElement(`script`);return e&&(t.src=e),t}function Dg(e){var t=xg(function(e){return{config:e.config,reject:e.reject}}),n=Eg(`${t.config.paths.vs}/loader.js`);return n.onload=function(){return e()},n.onerror=t.reject,n}function Og(){var e=xg(function(e){return{config:e.config,resolve:e.resolve,reject:e.reject}}),t=window.require;t.config(e.config),t([`vs/editor/editor.main`],function(t){var n=t.m||t;kg(n),e.resolve(n)},function(t){e.reject(t)})}function kg(e){xg().monaco||Sg({monaco:e})}function Ag(){return xg(function(e){return e.monaco})}var jg=new Promise(function(e,t){return Sg({resolve:e,reject:t})}),Mg={config:Cg,init:wg,__getMonacoInstance:Ag},Ng={wrapper:{display:`flex`,position:`relative`,textAlign:`initial`},fullWidth:{width:`100%`},hide:{display:`none`}},Pg={container:{display:`flex`,height:`100%`,width:`100%`,justifyContent:`center`,alignItems:`center`}};function Fg({children:e}){return d.createElement(`div`,{style:Pg.container},e)}var Ig=Fg;function Lg({width:e,height:t,isEditorReady:n,loading:r,_ref:i,className:a,wrapperProps:o}){return d.createElement(`section`,{style:{...Ng.wrapper,width:e,height:t},...o},!n&&d.createElement(Ig,null,r),d.createElement(`div`,{ref:i,style:{...Ng.fullWidth,...!n&&Ng.hide},className:a}))}var Rg=(0,d.memo)(Lg);function zg(e){(0,d.useEffect)(e,[])}var Bg=zg;function Vg(e,t,n=!0){let r=(0,d.useRef)(!0);(0,d.useEffect)(r.current||!n?()=>{r.current=!1}:e,t)}var Hg=Vg;function Ug(){}function Wg(e,t,n,r){return Gg(e,r)||pte(e,t,n,r)}function Gg(e,t){return e.editor.getModel(Kg(e,t))}function pte(e,t,n,r){return e.editor.createModel(t,n,r?Kg(e,r):void 0)}function Kg(e,t){return e.Uri.parse(t)}function mte({original:e,modified:t,language:n,originalLanguage:r,modifiedLanguage:i,originalModelPath:a,modifiedModelPath:o,keepCurrentOriginalModel:s=!1,keepCurrentModifiedModel:c=!1,theme:l=`light`,loading:u=`Loading...`,options:f={},height:p=`100%`,width:m=`100%`,className:h,wrapperProps:g={},beforeMount:_=Ug,onMount:v=Ug}){let[y,b]=(0,d.useState)(!1),[x,S]=(0,d.useState)(!0),C=(0,d.useRef)(null),w=(0,d.useRef)(null),T=(0,d.useRef)(null),E=(0,d.useRef)(v),D=(0,d.useRef)(_),O=(0,d.useRef)(!1);Bg(()=>{let e=Mg.init();return e.then(e=>(w.current=e)&&S(!1)).catch(e=>e?.type!==`cancelation`&&console.error(`Monaco initialization: error:`,e)),()=>C.current?j():e.cancel()}),Hg(()=>{if(C.current&&w.current){let t=C.current.getOriginalEditor(),i=Wg(w.current,e||``,r||n||`text`,a||``);i!==t.getModel()&&t.setModel(i)}},[a],y),Hg(()=>{if(C.current&&w.current){let e=C.current.getModifiedEditor(),r=Wg(w.current,t||``,i||n||`text`,o||``);r!==e.getModel()&&e.setModel(r)}}
421,[o],y),Hg(()=>{let e=C.current.getModifiedEditor();e.getOption(w.current.editor.EditorOption.readOnly)?e.setValue(t||``):t!==e.getValue()&&(e.executeEdits(``,[{range:e.getModel().getFullModelRange(),text:t||``,forceMoveMarkers:!0}]),e.pushUndoStop())},[t],y),Hg(()=>{C.current?.getModel()?.original.setValue(e||``)},[e],y),Hg(()=>{let{original:e,modified:t}=C.current.getModel();w.current.editor.setModelLanguage(e,r||n||`text`),w.current.editor.setModelLanguage(t,i||n||`text`)},[n,r,i],y),Hg(()=>{w.current?.editor.setTheme(l)},[l],y),Hg(()=>{C.current?.updateOptions(f)},[f],y);let k=(0,d.useCallback)(()=>{if(!w.current)return;D.current(w.current);let s=Wg(w.current,e||``,r||n||`text`,a||``),c=Wg(w.current,t||``,i||n||`text`,o||``);C.current?.setModel({original:s,modified:c})},[n,t,i,e,r,a,o]),A=(0,d.useCallback)(()=>{!O.current&&T.current&&(C.current=w.current.editor.createDiffEditor(T.current,{automaticLayout:!0,...f}),k(),w.current?.editor.setTheme(l),b(!0),O.current=!0)},[f,l,k]);(0,d.useEffect)(()=>{y&&E.current(C.current,w.current)},[y]),(0,d.useEffect)(()=>{!x&&!y&&A()},[x,y,A]);function j(){let e=C.current?.getModel();s||e?.original?.dispose(),c||e?.modified?.dispose(),C.current?.dispose()}return d.createElement(Rg,{width:m,height:p,isEditorReady:y,loading:u,_ref:T,className:h,wrapperProps:g})}(0,d.memo)(mte);function hte(e){let t=(0,d.useRef)();return(0,d.useEffect)(()=>{t.current=e},[e]),t.current}var gte=hte,qg=new Map;function _te({defaultValue:e,defaultLanguage:t,defaultPath:n,value:r,language:i,path:a,theme:o=`light`,line:s,loading:c=`Loading...`,options:l={},overrideServices:u={},saveViewState:f=!0,keepCurrentModel:p=!1,width:m=`100%`,height:h=`100%`,className:g,wrapperProps:_={},beforeMount:v=Ug,onMount:y=Ug,onChange:b,onValidate:x=Ug}){let[S,C]=(0,d.useState)(!1),[w,T]=(0,d.useState)(!0),E=(0,d.useRef)(null),D=(0,d.useRef)(null),O=(0,d.useRef)(null),k=(0,d.useRef)(y),A=(0,d.useRef)(v),j=(0,d.useRef)(),M=(0,d.useRef)(r),N=gte(a),P=(0,d.useRef)(!1),ee=(0,d.useRef)(!1);Bg(()=>{let e=Mg.init();return e.then(e=>(E.current=e)&&T(!1)).catch(e=>e?.type!==`cancelation`&&console.error(`Monaco initialization: error:`,e)),()=>D.current?te():e.cancel()}),Hg(()=>{let o=Wg(E.current,e||r||``,t||i||``,a||n||``);o!==D.current?.getModel()&&(f&&qg.set(N,D.current?.saveViewState()),D.current?.setModel(o),f&&D.current?.restoreViewState(qg.get(a)))},[a],S),Hg(()=>{D.current?.updateOptions(l)},[l],S),Hg(()=>{!D.current||r===void 0||(D.current.getOption(E.current.editor.EditorOption.readOnly)?D.current.setValue(r):r!==D.current.getValue()&&(ee.current=!0,D.current.executeEdits(``,[{range:D.current.getModel().getFullModelRange(),text:r,forceMoveMarkers:!0}]),D.current.pushUndoStop(),ee.current=!1))},[r],S),Hg(()=>{let e=D.current?.getModel();e&&i&&E.current?.editor.setModelLanguage(e,i)},[i],S),Hg(()=>{s!==void 0&&D.current?.revealLine(s)},[s],S),Hg(()=>{E.current?.editor.setTheme(o)},[o],S);let F=(0,d.useCallback)(()=>{if(!(!O.current||!E.current)&&!P.current){A.current(E.current);let c=a||n,d=Wg(E.current,r||e||``,t||i||``,c||``);D.current=E.current?.editor.create(O.current,{model:d,automaticLayout:!0,...l},u),f&&D.current.restoreViewState(qg.get(c)),E.current.editor.setTheme(o),s!==void 0&&D.current.revealLine(s),C(!0),P.current=!0}},[e,t,n,r,i,a,l,u,f,o,s]);(0,d.useEffect)(()=>{S&&k.current(D.current,E.current)},[S]),(0,d.useEffect)(()=>{!w&&!S&&F()},[w,S,F]),M.current=r,(0,d.useEffect)(()=>{S&&b&&(j.current?.dispose(),j.current=D.current?.onDidChangeModelContent(e=>{ee.current||b(D.current.getValue(),e)}))},[S,b]),(0,d.useEffect)(()=>{if(S){let e=E.current.editor.onDidChangeMarkers(e=>{let t=D.current.getModel()?.uri;if(t&&e.find(e=>e.path===t.path)){let e=E.current.editor.getModelMarkers({resource:t});x?.(e)}});return()=>{e?.dispose()}}return()=>{}},[S,x]);function te(){j.current?.dispose(),p?f&&qg.set(a,D.current.saveViewState()):D.current.getModel()?.dispose(),D.current.dispose()}return d.createElement(Rg,{width:m,height:h,isEditorReady:S,loading:c,_ref:O,className:g,wrapperProps:_})}var vte=(0,d.memo)(_te);function Jg({selectedLanguage:e,code:t,isRunning:n,onLanguageChange:r,onCodeChange:i,onRunCode:a}){return(0,R.jsxs)(`div`,{className:`h-full flex flex-col bg-[#0d1117]`,children:[(0,R.jsxs)(`div`,{className:`flex items-center justify-between px-4 py-3 border-b`,style:{backgroundColor:`#161b22`,borderColor:`#30363d`},children:[(0,R.jsx)(`div`,{className:`flex items-center gap-3`,children:(0,R.jsxs)(`div`,{className:`flex items-center gap-2 px-3 py-1.5 rounded-md bg-[#21262d] border border-[#30363d]`,children:[(0,R.jsx)(`img`,{src:vm[e].icon,alt:vm[e].name,className:`size-5`}
421),(0,R.jsx)(`select`,{value:e,onChange:r,className:`bg-transparent text-[#e6edf3] text-sm outline-none cursor-pointer`,children:Object.entries(vm).map(([e,t])=>(0,R.jsx)(`option`,{value:e,className:`bg-[#161b22]`,children:t.name},e))})]})}),(0,R.jsx)(`button`,{onClick:a,disabled:n,className:`flex items-center gap-2 px-4 py-2 rounded-full text-sm font-medium transition-all disabled:cursor-not-allowed`,style:{backgroundColor:n?`#30363d`:`#FFD60A`,color:n?`#8b949e`:`#1A1A1A`},children:n?(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(Mp,{className:`size-4 animate-spin`}),`Running...`]}):(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(Lp,{className:`size-4`}),`Run Code`]})})]}),(0,R.jsx)(`div`,{className:`flex-1 p-3 bg-[#0d1117] overflow-hidden`,children:(0,R.jsx)(`div`,{className:`h-full overflow-hidden rounded-xl border border-[#30363d]`,children:(0,R.jsx)(vte,{height:`100%`,language:vm[e].monacoLang,value:t,onChange:i,theme:`vs-dark`,options:{fontSize:15,minimap:{enabled:!1},scrollBeyondLastLine:!1,automaticLayout:!0,fontFamily:`JetBrains Mono, monospace`,fontLigatures:!0,padding:{top:16},lineHeight:24,smoothScrolling:!0,cursorBlinking:`smooth`,renderLineHighlight:`all`,roundedSelection:!0}})})})]})}var yte=`https://emkc.org/api/v2/piston`,bte={javascript:{language:`javascript`,version:`18.15.0`},python:{language:`python`,version:`3.10.0`},java:{language:`java`,version:`15.0.2`}};async function Yg(e,t){try{let n=bte[e];if(!n)return{success:!1,error:`Unsupported language: ${e}`};let r=await fetch(`${yte}/execute`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({language:n.language,version:n.version,files:[{name:`main.${xte(e)}`,content:t}]})});if(!r.ok)return{success:!1,error:`HTTP error! status: ${r.status}`};let i=await r.json(),a=i.run.output||``,o=i.run.stderr||``;return o?{success:!1,output:a,error:o}:{success:!0,output:a||`No output`}}catch(e){return{success:!1,error:`Failed to execute code: ${e.message}`}}}function xte(e){return{javascript:`js`,python:`py`,java:`java`}[e]||`txt`}var Xg={};(function e(t,n,r,i){var a=!!(t.Worker&&t.Blob&&t.Promise&&t.OffscreenCanvas&&t.OffscreenCanvasRenderingContext2D&&t.HTMLCanvasElement&&t.HTMLCanvasElement.prototype.transferControlToOffscreen&&t.URL&&t.URL.createObjectURL),o=typeof Path2D==`function`&&typeof DOMMatrix==`function`,s=(function(){if(!t.OffscreenCanvas)return!1;try{var e=new OffscreenCanvas(1,1),n=e.getContext(`2d`);n.fillRect(0,0,1,1);var r=e.transferToImageBitmap();n.createPattern(r,`no-repeat`)}catch{return!1}return!0})();function c(){}function l(e){var r=n.exports.Promise,i=r===void 0?t.Promise:r;return typeof i==`function`?new i(e):(e(c,c),null)}var u=(function(e,t){return{transform:function(n){if(e)return n;if(t.has(n))return t.get(n);var r=new OffscreenCanvas(n.width,n.height);return r.getContext(`2d`).drawImage(n,0,0),t.set(n,r),r},clear:function(){t.clear()}}})(s,new Map),d=function(){var e=16,t,n,r={},i=0;return typeof requestAnimationFrame==`function`&&typeof cancelAnimationFrame==`function`?(t=function(t){var n=Math.random();return r[n]=requestAnimationFrame(function a(o){i===o||i+e-1<o?(i=o,delete r[n],t()):r[n]=requestAnimationFrame(a)}),n},n=function(e){r[e]&&cancelAnimationFrame(r[e])}):(t=function(t){return setTimeout(t,e)},n=function(e){return clearTimeout(e)}),{frame:t,cancel:n}}(),f=(function(){var t,n,i={};function o(e){function t(t,n){e.postMessage({options:t||{},callback:n})}e.init=function(t){var n=t.transferControlToOffscreen();e.postMessage({canvas:n},[n])},e.fire=function(r,a,o){if(n)return t(r,null),n;var s=Math.random().toString(36).slice(2);return n=l(function(a){function c(t){t.data.callback===s&&(delete i[s],e.removeEventListener(`message`,c),n=null,u.clear(),o(),a())}e.addEventListener(`message`,c),t(r,s),i[s]=c.bind(null,{data:{callback:s}})}),n},e.reset=function(){for(var t in e.postMessage({reset:!0}),i)i[t](),delete i[t]}}return function(){if(t)return t;if(!r&&a){var n=[`var CONFETTI, SIZE = {}, module = {};`,`(`+e.toString()+`)(this, module, true, SIZE);`,`onmessage = function(msg) {`,`  if (msg.data.options) {`,`    CONFETTI(msg.data.options).then(function () {`,`      if (msg.data.callback) {`,`        postMessage({ callback: msg.data.callback });`,`      }`,`    });`,`  } else if (msg.data.reset) {`,`    CONFETTI && CONFETTI.reset();`,`  } else if (msg.data.resize) {`,`    SIZE.width = msg.data.resize.width;`,`    SIZE.height = msg.data.resize.height;`,`  } else if (msg.data.canvas) {`,`    SIZE.width = msg.data.canvas.width;`,`    SIZE.height = msg.data.canvas.height;`,`    CONFETTI = module.exports.create(msg.data.canvas);`,`  }`,`}`].join(`
422`);try{t=new Worker(URL.createObjectURL(new Blob([n])))}catch(e){return typeof console<`u`&&typeof console.warn==`function`&&console.warn(`🎊 Could not load worker`,e),null}o(t)}return t}})(),p={particleCount:50,angle:90,spread:45,startVelocity:45,decay:.9,gravity:1,drift:0,ticks:200,x:.5,y:.5,shapes:[`square`,`circle`],zIndex:100,colors:[`#26ccff`,`#a25afd`,`#ff5e7e`,`#88ff5a`,`#fcff42`,`#ffa62d`,`#ff36ff`],disableForReducedMotion:!1,scalar:1};function m(e,t){return t?t(e):e}function h(e){return e!=null}function g(e,t,n){return m(e&&h(e[t])?e[t]:p[t],n)}function _(e){return e<0?0:Math.floor(e)}function v(e,t){return Math.floor(Math.random()*(t-e))+e}function y(e){return parseInt(e,16)}function b(e){return e.map(x)}function x(e){var t=String(e).replace(/[^0-9a-f]/gi,``);return t.length<6&&(t=t[0]+t[0]+t[1]+t[1]+t[2]+t[2]),{r:y(t.substring(0,2)),g:y(t.substring(2,4)),b:y(t.substring(4,6))}}function S(e){var t=g(e,`origin`,Object);return t.x=g(t,`x`,Number),t.y=g(t,`y`,Number),t}function C(e){e.width=document.documentElement.clientWidth,e.height=document.documentElement.clientHeight}function w(e){var t=e.getBoundingClientRect();e.width=t.width,e.height=t.height}function T(e){var t=document.createElement(`canvas`);return t.style.position=`fixed`,t.style.top=`0px`,t.style.left=`0px`,t.style.pointerEvents=`none`,t.style.zIndex=e,t}function E(e,t,n,r,i,a,o,s,c){e.save(),e.translate(t,n),e.rotate(a),e.scale(r,i),e.arc(0,0,1,o,s,c),e.restore(
vendor: 4,784 bytes, line 422
422)}function D(e){var t=e.angle*(Math.PI/180),n=e.spread*(Math.PI/180);return{x:e.x,y:e.y,wobble:Math.random()*10,wobbleSpeed:Math.min(.11,Math.random()*.1+.05),velocity:e.startVelocity*.5+Math.random()*e.startVelocity,angle2D:-t+(.5*n-Math.random()*n),tiltAngle:(Math.random()*.5+.25)*Math.PI,color:e.color,shape:e.shape,tick:0,totalTicks:e.ticks,decay:e.decay,drift:e.drift,random:Math.random()+2,tiltSin:0,tiltCos:0,wobbleX:0,wobbleY:0,gravity:e.gravity*3,ovalScalar:.6,scalar:e.scalar,flat:e.flat}}function O(e,t){t.x+=Math.cos(t.angle2D)*t.velocity+t.drift,t.y+=Math.sin(t.angle2D)*t.velocity+t.gravity,t.velocity*=t.decay,t.flat?(t.wobble=0,t.wobbleX=t.x+10*t.scalar,t.wobbleY=t.y+10*t.scalar,t.tiltSin=0,t.tiltCos=0,t.random=1):(t.wobble+=t.wobbleSpeed,t.wobbleX=t.x+10*t.scalar*Math.cos(t.wobble),t.wobbleY=t.y+10*t.scalar*Math.sin(t.wobble),t.tiltAngle+=.1,t.tiltSin=Math.sin(t.tiltAngle),t.tiltCos=Math.cos(t.tiltAngle),t.random=Math.random()+2);var n=t.tick++/t.totalTicks,r=t.x+t.random*t.tiltCos,i=t.y+t.random*t.tiltSin,a=t.wobbleX+t.random*t.tiltCos,s=t.wobbleY+t.random*t.tiltSin;if(e.fillStyle=`rgba(`+t.color.r+`, `+t.color.g+`, `+t.color.b+`, `+(1-n)+`)`,e.beginPath(),o&&t.shape.type===`path`&&typeof t.shape.path==`string`&&Array.isArray(t.shape.matrix))e.fill(N(t.shape.path,t.shape.matrix,t.x,t.y,Math.abs(a-r)*.1,Math.abs(s-i)*.1,Math.PI/10*t.wobble));else if(t.shape.type===`bitmap`){var c=Math.PI/10*t.wobble,l=Math.abs(a-r)*.1,d=Math.abs(s-i)*.1,f=t.shape.bitmap.width*t.scalar,p=t.shape.bitmap.height*t.scalar,m=new DOMMatrix([Math.cos(c)*l,Math.sin(c)*l,-Math.sin(c)*d,Math.cos(c)*d,t.x,t.y]);m.multiplySelf(new DOMMatrix(t.shape.matrix));var h=e.createPattern(u.transform(t.shape.bitmap),`no-repeat`);h.setTransform(m),e.globalAlpha=1-n,e.fillStyle=h,e.fillRect(t.x-f/2,t.y-p/2,f,p),e.globalAlpha=1}else if(t.shape===`circle`)e.ellipse?e.ellipse(t.x,t.y,Math.abs(a-r)*t.ovalScalar,Math.abs(s-i)*t.ovalScalar,Math.PI/10*t.wobble,0,2*Math.PI):E(e,t.x,t.y,Math.abs(a-r)*t.ovalScalar,Math.abs(s-i)*t.ovalScalar,Math.PI/10*t.wobble,0,2*Math.PI);else if(t.shape===`star`)for(var g=Math.PI/2*3,_=4*t.scalar,v=8*t.scalar,y=t.x,b=t.y,x=5,S=Math.PI/x;x--;)y=t.x+Math.cos(g)*v,b=t.y+Math.sin(g)*v,e.lineTo(y,b),g+=S,y=t.x+Math.cos(g)*_,b=t.y+Math.sin(g)*_,e.lineTo(y,b),g+=S;else e.moveTo(Math.floor(t.x),Math.floor(t.y)),e.lineTo(Math.floor(t.wobbleX),Math.floor(i)),e.lineTo(Math.floor(a),Math.floor(s)),e.lineTo(Math.floor(r),Math.floor(t.wobbleY));return e.closePath(),e.fill(),t.tick<t.totalTicks}function k(e,t,n,a,o){var s=t.slice(),c=e.getContext(`2d`),f,p,m=l(function(t){function l(){f=p=null,c.clearRect(0,0,a.width,a.height),u.clear(),o(),t()}function m(){r&&!(a.width===i.width&&a.height===i.height)&&(a.width=e.width=i.width,a.height=e.height=i.height),!a.width&&!a.height&&(n(e),a.width=e.width,a.height=e.height),c.clearRect(0,0,a.width,a.height),s=s.filter(function(e){return O(c,e)}),s.length?f=d.frame(m):l()}f=d.frame(m),p=l});return{addFettis:function(e){return s=s.concat(e),m},canvas:e,promise:m,reset:function(){f&&d.cancel(f),p&&p()}}}function A(e,n){var r=!e,i=!!g(n||{},`resize`),o=!1,s=g(n,`disableForReducedMotion`,Boolean),c=a&&g(n||{},`useWorker`)?f():null,u=r?C:w,d=e&&c?!!e.__confetti_initialized:!1,p=typeof matchMedia==`function`&&matchMedia(`(prefers-reduced-motion)`).matches,m;function h(t,n,r){for(var i=g(t,`particleCount`,_),a=g(t,`angle`,Number),o=g(t,`spread`,Number),s=g(t,`startVelocity`,Number),c=g(t,`decay`,Number),l=g(t,`gravity`,Number),d=g(t,`drift`,Number),f=g(t,`colors`,b),p=g(t,`ticks`,Number),h=g(t,`shapes`),y=g(t,`scalar`),x=!!g(t,`flat`),C=S(t),w=i,T=[],E=e.width*C.x,O=e.height*C.y;w--;)T.push(D({x:E,y:O,angle:a,spread:o,startVelocity:s,color:f[w%f.length],shape:h[v(0,h.length)],ticks:p,decay:c,gravity:l,drift:d,scalar:y,flat:x}));return m?m.addFettis(T):(m=k(e,T,u,n,r),m.promise)}function y(n){var a=s||g(n,`disableForReducedMotion`,Boolean),f=g(n,`zIndex`,Number);if(a&&p)return l(function(e){e()});r&&m?e=m.canvas:r&&!e&&(e=T(f),document.body.appendChild(e)),i&&!d&&u(e);var _={width:e.width,height:e.height};c&&!d&&c.init(e),d=!0,c&&(e.__confetti_initialized=!0);function v(){if(c){var t={getBoundingClientRect:function(){if(!r)return e.getBoundingClientRect()}};u(t),c.postMessage({resize:{width:t.width,height:t.height}});return}_.width=_.height=null}function y(){m=null,i&&(o=!1,t.removeEventListener(`resize`,v)),r&&e&&(document.body.contains(e)&&document.body.removeChild(e),e=null,d=!1)}return i&&!o&&(o=!0,t.addEventListener(`resize`,v,!1)),c?c.fire(n,_,y):h(n,_,y)}return y.reset=function(){c&&c.reset(),m&&m.reset()},y}var j;function M(){return j||=A(null,{useWorker:!0,resize:!0}),j}function N(e,t,n,r,i,a,o){var s=new Path2D(e),c=new Path2D;c.addPath(s,new DOMMatrix(t));var l=new Path2D;
422return l.addPath(c,new DOMMatrix([Math.cos(o)*i,Math.sin(o)*i,-Math.sin(o)*a,Math.cos(o)*a,n,r])),l}function P(e){if(!o)throw Error(`path confetti are not supported in this browser`);var t,n;typeof e==`string`?t=e:(t=e.path,n=e.matrix);var r=new Path2D(t),i=document.createElement(`canvas`).getContext(`2d`);if(!n){for(var a=1e3,s=a,c=a,l=0,u=0,d,f,p=0;p<a;p+=2)for(var m=0;m<a;m+=2)i.isPointInPath(r,p,m,`nonzero`)&&(s=Math.min(s,p),c=Math.min(c,m),l=Math.max(l,p),u=Math.max(u,m));d=l-s,f=u-c;var h=10,g=Math.min(h/d,h/f);n=[g,0,0,g,-Math.round(d/2+s)*g,-Math.round(f/2+c)*g]}return{type:`path`,path:t,matrix:n}}function ee(e){var t,n=1,r=`#000000`,i=`"Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji", "EmojiOne Color", "Android Emoji", "Twemoji Mozilla", "system emoji", sans-serif`;typeof e==`string`?t=e:(t=e.text,n=`scalar`in e?e.scalar:n,i=`fontFamily`in e?e.fontFamily:i,r=`color`in e?e.color:r);var a=10*n,o=``+a+`px `+i,s=new OffscreenCanvas(a,a),c=s.getContext(`2d`);c.font=o;var l=c.measureText(t),u=Math.ceil(l.actualBoundingBoxRight+l.actualBoundingBoxLeft),d=Math.ceil(l.actualBoundingBoxAscent+l.actualBoundingBoxDescent),f=2,p=l.actualBoundingBoxLeft+f,m=l.actualBoundingBoxAscent+f;u+=f+f,d+=f+f,s=new OffscreenCanvas(u,d),c=s.getContext(`2d`),c.font=o,c.fillStyle=r,c.fillText(t,p,m);var h=1/n;return{type:`bitmap`,bitmap:s.transferToImageBitmap(),matrix:[h,0,0,h,-u*h/2,-d*h/2]}}n.exports=function(){return M().apply(this,arguments)},n.exports.reset=function(){M().reset()},n.exports.create=A,n.exports.shapeFromPath=P,n.exports.shapeFromText=ee})((function(){return typeof window<`u`?window:typeof self<`u`?self:this||{}})(),Xg,!1);var Zg=Xg.exports;Xg.exports.create;function Ste(){let{id:e}=Lo(),t=Fo(),n=e&&_m[e]?e:`two-sum`,r=_m[n],[i,a]=(0,d.useState)(`javascript`),[o,s]=(0,d.useState)(r.starterCode.javascript),[c,l]=(0,d.useState)(null),[u,f]=(0,d.useState)(!1),[p,m]=(0,d.useState)(!1),h=e=>{let t=e.target.value;a(t),s(r.starterCode[t]),l(null)},g=e=>{s(_m[e].starterCode[i]),l(null),t(`/problem/${e}`)},_=()=>{Zg({particleCount:80,spread:250,origin:{x:.2,y:.6}}),Zg({particleCount:80,spread:250,origin:{x:.8,y:.6}})},v=e=>e.trim().split(`
423`).map(e=>e.trim().replace(/\[\s+/g,`[`).replace(/\s+\]/g,`]`).replace(/\s*,\s*/g,`,`)).filter(e=>e.length>0).join(`
424`),y=(e,t)=>v(e)===v(t),b=async()=>{f(!0),l(null);let e=await Yg(i,o);if(l(e),f(!1),e.success){let t=r.expectedOutput[i];y(e.output,t)?(_(),ql.success(`All tests passed! Great job!`)):ql.error(`Tests failed. Check your output!`)}else ql.error(`Code execution failed!`)};return(0,R.jsxs)(`div`,{className:`flex flex-col`,style:{height:`100vh`},children:[(0,R.jsx)(ym,{onRunCode:b,isRunning:u,onToggleProblemList:()=>m(!p)}),(0,R.jsxs)(`div`,{className:`flex-1 min-h-0 relative`,children:[(0,R.jsxs)(`div`,{className:`absolute top-0 left-0 h-full z-40 flex flex-col border-r overflow-hidden transition-all duration-300`,style:{width:p?`300px`:`0px`,backgroundColor:`#2d2d2d`,borderColor:`#3d3d3d`},children:[(0,R.jsxs)(`div`,{className:`flex items-center justify-between px-4 py-3 border-b flex-shrink-0`,style:{borderColor:`#3d3d3d`},children:[(0,R.jsx)(`span`,{className:`text-sm font-semibold`,style:{color:`#d4d4d4`},children:`Problem List`}),(0,R.jsx)(`button`,{onClick:()=>m(!1),className:`hover:opacity-70 transition-opacity text-lg`,style:{color:`#888`},children:`✕`})]}),(0,R.jsx)(`div`,{className:`flex-1 overflow-y-auto`,children:Object.values(_m).map((e,t)=>(0,R.jsxs)(`button`,{onClick:()=>{g(e.id),m(!1)},className:`w-full flex items-center justify-between px-4 py-3 text-left border-b transition-colors hover:opacity-80`,style:{borderColor:`#3d3d3d`,backgroundColor:n===e.id?`#3d3d3d`:`transparent`},children:[(0,R.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,R.jsx)(`span`,{className:`text-xs w-5 flex-shrink-0`,style:{color:`#666`},children:t+1}),(0,R.jsx)(`span`,{className:`text-sm`,style:{color:n===e.id?`#FFD60A`:`#d4d4d4`},children:e.title})]}),(0,R.jsx)(`span`,{className:`text-xs flex-shrink-0`,style:{color:e.difficulty===`Easy`?`#86efac`:e.difficulty===`Medium`?`#fcd34d`:`#fca5a5`},children:e.difficulty})]},e.id))})]}),p&&(0,R.jsx)(`div`,{className:`absolute inset-0 z-30`,style:{backgroundColor:`rgba(0,0,0,0.3)`},onClick:()=>m(!1)}),(0,R.jsxs)(Bh,{orientation:`horizontal`,style:{height:`100%`},children:[(0,R.jsx)(Hh,{defaultSize:40,minSize:30,style:{overflowY:`auto`}
424,children:(0,R.jsx)(qee,{problem:r,currentProblemId:n,onProblemChange:g,allProblems:Object.values(_m)})}),(0,R.jsx)(Uh,{className:`w-2 cursor-col-resize`,style:{backgroundColor:`#E0D9CF`}}),(0,R.jsx)(Hh,{defaultSize:60,minSize:30,style:{padding:`12px 12px 12px 6px`},children:(0,R.jsx)(`div`,{style:{height:`100%`,borderRadius:`12px`,overflow:`hidden`,border:`1px solid #3d3d3d`},children:(0,R.jsxs)(Bh,{orientation:`vertical`,style:{height:`100%`},children:[(0,R.jsx)(Hh,{defaultSize:70,minSize:30,children:(0,R.jsx)(Jg,{selectedLanguage:i,code:o,isRunning:u,onLanguageChange:h,onCodeChange:s,onRunCode:b})}),(0,R.jsx)(Uh,{className:`h-2 cursor-row-resize`,style:{backgroundColor:`#3d3d3d`}}),(0,R.jsx)(Hh,{defaultSize:30,minSize:15,children:(0,R.jsx)(Wh,{output:c})})]})})})]})]})]})}var Cte={Easy:{backgroundColor:`#DCFCE7`,color:`#166534`},Medium:{backgroundColor:`#FEF9C3`,color:`#854D0E`},Hard:{backgroundColor:`#FEE2E2`,color:`#991B1B`}};function wte(){let e=Object.values(_m),[t,n]=(0,d.useState)(``),[r,i]=(0,d.useState)(`All`),a=e.filter(e=>e.difficulty===`Easy`).length,o=e.filter(e=>e.difficulty===`Medium`).length,s=e.filter(e=>e.difficulty===`Hard`).length,c=e.filter(e=>{let n=e.title.toLowerCase().includes(t.toLowerCase()),i=r===`All`||e.difficulty===r;return n&&i});return(0,R.jsxs)(`div`,{className:`min-h-screen`,style:{backgroundColor:`#F5F0E8`},children:[(0,R.jsx)(Jp,{}),(0,R.jsxs)(`div`,{className:`max-w-6xl mx-auto px-4 py-12`,children:[(0,R.jsxs)(`div`,{className:`flex items-start justify-between gap-4 mb-8 flex-wrap`,children:[(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`h1`,{className:`text-4xl font-bold mb-1 text-[#1A1A1A]`,style:{fontFamily:`'Playfair Display', serif`},children:`Practice Problems`}),(0,R.jsx)(`p`,{className:`text-[#6B7280] text-sm`,children:`Sharpen your skills, one problem at a time`})]}),(0,R.jsxs)(`div`,{className:`flex items-center gap-3 flex-wrap`,children:[(0,R.jsxs)(`div`,{className:`flex items-center gap-2 px-4 py-2 rounded-full border border-[#E0D9CF]`,style:{backgroundColor:`white`},children:[(0,R.jsx)(zp,{className:`size-4 text-[#9B9590]`}),(0,R.jsx)(`input`,{type:`text`,placeholder:`Search problems...`,value:t,onChange:e=>n(e.target.value),className:`outline-none text-sm bg-transparent text-[#1A1A1A] placeholder-[#9B9590] w-48`})]}),[`All`,`Easy`,`Medium`,`Hard`].map(e=>(0,R.jsx)(`button`,{onClick:()=>i(e),className:`px-4 py-2 rounded-full text-sm font-medium transition-all border`,style:{backgroundColor:r===e?`#1A1A1A`:`white`,color:r===e?`white`:`#6B7280`,borderColor:r===e?`#1A1A1A`:`#E0D9CF`},children:e},e))]})]}),(0,R.jsxs)(`div`,{className:`flex gap-6 items-start`,children:[(0,R.jsxs)(`div`,{className:`flex-1 space-y-3`,children:[c.map((e,t)=>(0,R.jsxs)(ec,{to:`/problem/${e.id}`,className:`flex items-center justify-between gap-4 rounded-2xl px-6 py-4 border border-[#E0D9CF] hover:border-[#C5BDB4] hover:scale-[1.01] transition-all duration-200`,style:{backgroundColor:`white`},children:[(0,R.jsxs)(`div`,{className:`flex items-center gap-4 flex-1`,children:[(0,R.jsx)(`span`,{className:`text-sm font-medium text-[#9B9590] w-6 flex-shrink-0`,children:String(t+1).padStart(2,`0`)}),(0,R.jsx)(`div`,{className:`size-10 rounded-xl flex items-center justify-center flex-shrink-0`,style:{backgroundColor:`#FFD60A`},children:(0,R.jsx)(Op,{className:`size-5 text-[#1A1A1A]`})}),(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`h2`,{className:`text-base font-bold text-[#1A1A1A] mb-1`,children:e.title}),(0,R.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:e.category.split(`•`).map(e=>(0,R.jsx)(`span`,{className:`text-xs px-2.5 py-0.5 rounded-full border border-[#D0C9BF] text-[#6B7280]`,style:{backgroundColor:`#F5F0E8`},children:e.trim()},e))})]})]}),(0,R.jsxs)(`div`,{className:`flex items-center gap-3 flex-shrink-0`,children:[(0,R.jsx)(`span`,{className:`text-xs font-medium px-3 py-1 rounded-full`,style:Cte[e.difficulty]||{},children:e.difficulty}),(0,R.jsxs)(`button`,{className:`flex items-center gap-1.5 px-4 py-2 rounded-full text-white text-sm font-medium`,style:{backgroundColor:`#1A1A1A`},children:[`Solve `,(0,R.jsx)(wp,{className:`size-4`})]})]})]},e.id)),c.length===0&&(0,R.jsx)(`div`,{className:`text-center py-16 text-[#9B9590]`,children:`No problems found`})]}),(0,R.jsxs)(`div`,{className:`w-72 flex-shrink-0 rounded-2xl border border-[#
424E0D9CF] p-6 sticky top-24`,style:{backgroundColor:`white`},children:[(0,R.jsx)(`p`,{className:`text-xs font-semibold text-[#9B9590] tracking-widest mb-4`,children:`YOUR PROGRESS`}),(0,R.jsxs)(`div`,{className:`flex items-baseline gap-2 mb-3`,children:[(0,R.jsx)(`span`,{className:`text-5xl font-black text-[#1A1A1A]`,style:{fontFamily:`'Playfair Display', serif`},children:a+o+s}),(0,R.jsx)(`span`,{className:`text-sm text-[#9B9590]`,children:`problems solved`})]}),(0,R.jsx)(`div`,{className:`h-1.5 rounded-full mb-2 overflow-hidden`,style:{backgroundColor:`#E0D9CF`},children:(0,R.jsx)(`div`,{className:`h-full rounded-full`,style:{backgroundColor:`#1A1A1A`,width:`${Math.round((a+o+s)/e.length*100)}%`}})}),(0,R.jsxs)(`p`,{className:`text-xs text-[#9B9590] mb-6`,children:[Math.round((a+o+s)/e.length*100),`% of `,e.length]}),(0,R.jsx)(`div`,{className:`space-y-3`,children:[{label:`Easy`,count:a,dot:`#22c55e`},{label:`Medium`,count:o,dot:`#eab308`},{label:`Hard`,count:s,dot:`#ef4444`}].map(({label:e,count:t,dot:n})=>(0,R.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,R.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,R.jsx)(`div`,{className:`size-2 rounded-full`,style:{backgroundColor:n}}),(0,R.jsx)(`span`,{className:`text-sm text-[#6B7280]`,children:e})]}),(0,R.jsx)(`span`,{className:`text-sm font-semibold text-[#1A1A1A]`,children:t})]},e))})]})]})]})]})}var Tte=n((e=>{e.fromByteArray=c;for(var t=[],n=[],r=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`,i=0,a=r.length;i<a;++i)t[i]=r[i],n[r.charCodeAt(i)]=i;n[45]=62,n[95]=63;function o(e){return t[e>>18&63]+t[e>>12&63]+t[e>>6&63]+t[e&63]}function s(e,t,n){for(var r,i=[],a=t;a<n;a+=3)r=(e[a]<<16&16711680)+(e[a+1]<<8&65280)+(e[a+2]&255),i.push(o(r));return i.join(``)}function c(e){for(var n,r=e.length,i=r%3,a=[],o=16383,c=0,l=r-i;c<l;c+=o)a.push(s(e,c,c+o>l?l:c+o));return i===1?(n=e[r-1],a.push(t[n>>2]+t[n<<4&63]+`==`)):i===2&&(n=(e[r-2]<<8)+e[r-1],a.push(t[n>>10]+t[n>>4&63]+t[n<<2&63]+`=`)),a.join(``)}})),Ete=n(((e,t)=>{t.exports=typeof self==`object`?self.FormData:window.FormData})),Dte=Tte(),Ote=r(Ete(),1),kte=`aaa1rp3bb0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4w0s2x0a2z0ure5ba0by2idu3namex4d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re3c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y3k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking4l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dad1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t1u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d1tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2odyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0els3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6properties14fh2g1h1i0a1ds2m1ndle4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3nd0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4k2ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rck0msd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic4v1w1x1y1z2na0b1goya4me2vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rton4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3y2
424ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0axi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp3ell3ia1ksha5oes2p0ping5uji3w3i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5mögensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2oodside6rk0s2ld3w2s1tc1f3xbox3erox4ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2`,Ate=`ελ1υ2бг1ел3дети4ею2католик6ом3мÐ
424ºÐ´2он1сква6онлайн5рг3рус2ф2сайт3рб3укр3қаз3Õ°Õ¡Õµ3ישראל5קום3ابوظبي5رامكو5لاردن4بحرين5جزائر5سعودية6عليان5مغرب5مارات5یران5بارت2زار4يتك3ھارت5تونس4سودان3رية5شبكة4عراق2ب2مان4فلسطين6قطر3كاثوليك6وم3مصر2ليسيا5وريتانيا7قع4همراه5پاکستان7ڀارت4कॉम3नेट3भारत0म्3ोत5संगठन5বাংলা5ভারত2ৰত4ਭਾਰਤ4ભારત4ଭାରତ4இந்தியா6லங்கை6சிங்கப்பூர்11భారత్5ಭಾರತ4ഭാരതം5ලංකා4คอม3ไทย3ລາວ3გე2みんな3アマゾン4クラウド4グーグル4コム2ストア3セール3ファッション6ポイント4世界2中信1国1國1文网3亚马逊3企业2佛山2信息2健康2八卦2公司1益2台湾1灣2商城1店1标2嘉里0大酒店5在线2大拿2天主教3娱乐2家電2广东2微博2慈善2我爱你3手机2招聘2政务1府2新加坡2闻2时尚2書籍2机构2淡马锡3游戏2澳門2点看2移动2组织机构4网址1店1站1络2联通2谷歌2购物2通販2集团2電訊盈科4飞利浦3食品2餐厅2香格里拉3港2닷넷1ì»´2삼성2한국2`,Qg=`numeric`,$g=`ascii`,e_=`alpha`,t_=`asciinumeric`,n_=`alphanumeric`,r_=`domain`,i_=`emoji`,jte=`scheme`,Mte=`slashscheme`,a_=`whitespace`;function Nte(e,t){return e in t||(t[e]=[]),t[e]}function o_(e,t,n){t[Qg]&&(t[t_]=!0,t[n_]=!0),t[$g]&&(t[t_]=!0,t[e_]=!0),t[t_]&&(t[n_]=!0),t[e_]&&(t[n_]=!0),t[n_]&&(t[r_]=!0),t[i_]&&(t[r_]=!0);for(let r in t){let t=Nte(r,n);t.indexOf(e)<0&&t.push(e)}}function Pte(e,t){let n={};for(let r in t)t[r].indexOf(e)>=0&&(n[r]=!0);return n}function s_(e=null){this.j={},this.jr=[],this.jd=null,this.t=e}s_.groups={},s_.prototype={accepts(){return!!this.t},go(e){let t=this,n=t.j[e];if(n)return n;for(let n=0;n<t.jr.length;n++){let r=t.jr[n][0],i=t.jr[n][1];if(i&&r.test(e))return i}return t.jd},has(e,t=!1){return t?e in this.j:!!this.go(e)},ta(e,t,n,r){for(let i=0;i<e.length;i++)this.tt(e[i],t,n,r)},tr(e,t,n,r){r||=s_.groups;let i;return t&&t.j?i=t:(i=new s_(t),n&&r&&o_(t,n,r)),this.jr.push([e,i]),i},ts(e,t,n,r){let i=this,a=e.length;if(!a)return i;for(let t=0;t<a-1;t++)i=i.tt(e[t]);return i.tt(e[a-1],t,n,r)},tt(e,t,n,r){r||=s_.groups;let i=this;if(t&&t.j)return i.j[e]=t,t;let a=t,o,s=i.go(e);return s?(o=new s_,Object.assign(o.j,s.j),o.jr.push.apply(o.jr,s.jr),o.jd=s.jd,o.t=s.t):o=new s_,a&&(r&&(o.t&&typeof o.t==`string`?o_(a,Object.assign(Pte(o.t,r),n),r):n&&o_(a,n,r)),o.t=a),i.j[e]=o,o}};var c_=(e,t,n,r,i)=>e.ta(t,n,r,i),l_=(e,t,n,r,i)=>e.tr(t,n,r,i),u_=(e,t,n,r,i)=>e.ts(t,n,r,i),B=(e,t,n,r,i)=>e.tt(t,n,r,i),d_=`WORD`,f_=`UWORD`,p_=`ASCIINUMERICAL`,m_=`ALPHANUMERICAL`,h_=`LOCALHOST`,g_=`TLD`,__=`UTLD`,v_=`SCHEME`,y_=`SLASH_SCHEME`,b_=`NUM`,x_=`WS`,S_=`NL`,C_=`OPENBRACE`,w_=`CLOSEBRACE`,T_=`OPENBRACKET`,E_=`CLOSEBRACKET`,D_=`OPENPAREN`,O_=`CLOSEPAREN`,k_=`OPENANGLEBRACKET`,A_=`CLOSEANGLEBRACKET`,j_=`FULLWIDTHLEFTPAREN`,M_=`FULLWIDTHRIGHTPAREN`,N_=`LEFTCORNERBRACKET`,P_=`RIGHTCORNERBRACKET`,F_=`LEFTWHITECORNERBRACKET`,I_=`RIGHTWHITECORNERBRACKET`,L_=`FULLWIDTHLESSTHAN`,R_=`FULLWIDTHGREATERTHAN`,z_=`AMPERSAND`,B_=`APOSTROPHE`,V_=`ASTERISK`,H_=`AT`,U_=`BACKSLASH`,W_=`BACKTICK`,G_=`CARET`,K_=`COLON`,q_=`COMMA`,J_=`DOLLAR`,Y_=`DOT`,X_=`EQUALS`,Z_=`EXCLAMATION`,Q_=`HYPHEN`,$_=`PERCENT`,ev=`PIPE`,tv=`PLUS`,nv=`POUND`,rv=`QUERY`,iv=`QUOTE`,av=`FULLWIDTHMIDDLEDOT`,ov=`SEMI`,sv=`SLASH`,cv=`TILDE`,lv=`UNDERSCORE`,uv=`EMOJI`,dv=`SYM`,fv=Object.freeze({__proto__:null,ALPHANUMERICAL:m_,AMPERSAND:z_,APOSTROPHE:B_,ASCIINUMERICAL:p_,ASTERISK:V_,AT:H_,BACKSLASH:U_,BACKTICK:W_,CARET:G_,CLOSEANGLEBRACKET:A_,CLOSEBRACE:w_,CLOSEBRACKET:E_,CLOSEPAREN:O_,COLON:K_,COMMA:q_,DOLLAR:J_,DOT:Y_,EMOJI:uv,EQUALS:X_,EXCLAMATION:Z_,FULLWIDTHGREATERTHAN:R_,FULLWIDTHLEFTPAREN:j_,FULLWIDTHLESSTHAN:L_,FULLWIDTHMIDDLEDOT:av,FULLWIDTHRIGHTPAREN:M_,HYPHEN:Q_,LEFTCORNERBRACKET:N_,LEFTWHITECORNERBRACKET:F_,LOCALHOST:h_,NL:S_,NUM:b_,OPENANGLEBRACKET:k_,OPENBRACE:C_,OPENBRACKET:T_,OPENPAREN:D_,PERCENT:$_,PIPE:ev,PLUS:tv,POUND:nv,QUERY:rv,QUOTE:iv,RIGHTCORNERBRACKET:P_,RIGHTWHITECORNERBRACKET:I_,SCHEME:v_,SEMI:ov,SLASH:sv,SLASH_SCHEME:y_,SYM:dv,TILDE:cv,TLD:g_,UNDERSCORE:lv,UTLD:__,UWORD:f_,WORD:d_,WS:x_}),pv=/[a-z]/,mv=/\p{L}/u,hv=/\p{Emoji}/u,gv=/\d/,_v=/\s/,vv=`\r`,yv=`
425`,bv=`️`,xv=`‍`,Sv=``,Cv=null,wv=null;function Tv(e=[]){let t={};s_.groups=t;let n=new s_;Cv??=kv(kte),wv??=kv(Ate),B(n,`'`,B_),B(n,`{`,C_),B(n,`}`,w_),B(n,`[`,T_),B(n,`]`,E_),B(n,`(`,D_),B(n,`)`,O_),B(n,`<`,k_),B(n,`>`,A_),B(n,`(`,j_),B(n,`)`,M_),B(n,`「`,N_),B(n,`」`,P_),B(n,`『`,F_),B(n,`』`,I_),B(n,`<`,L_),B(n,`>`,R_),B(n,`&`,z_),B(n,`*`,V_),B(n,`@`,H_),B(n,"`",W_),B(n,`^`,G_),B(n,`:`,K_),B(n,`,`,q_),B(n,`$`,J_),B(n,`.`,Y_),B(n,`=`,X_),B(n,`!`,Z_),B(n,`-`,Q_),B(n,`%`,$_),B(n,`|`,ev),B(n,`+`,tv),B(n,`#`,nv),B(n,`?`,rv),B(n,`"`,iv),B(n,`/`,sv),B(n,`;`,ov),B(n,`~`,cv),B(n,`_`,lv),B(n,`\\`,U_),B(n,`・`,av);let r=l_(n,gv,b_,{[Qg]:!0});l_(r,gv,r);let i=l_(r,pv,p_,{[t_]:!0}),a=l_(r,mv,m_,{[n_]:!0}),o=l_(n,pv,d_,{[$g]:!0});l_(o,gv,i),l_(o,pv,o),l_(i,gv,i),l_(i,pv,i);let s=l_(n,mv,f_,{[e_]:!0});l_(s,pv),l_(s,gv,a),l_(s,mv,s),l_(a,gv,a),l_(a,pv),l_(a,mv,a);let c=B(n,yv,S_,{[a_]:!0}
vendor: 4,701 bytes, line 425
425),l=B(n,vv,x_,{[a_]:!0}),u=l_(n,_v,x_,{[a_]:!0});B(n,Sv,u),B(l,yv,c),B(l,Sv,u),l_(l,_v,u),B(u,vv),B(u,yv),l_(u,_v,u),B(u,Sv,u);let d=l_(n,hv,uv,{[i_]:!0});B(d,`#`),l_(d,hv,d),B(d,bv,d);let f=B(d,xv);B(f,`#`),l_(f,hv,d);let p=[[pv,o],[gv,i]],m=[[pv,null],[mv,s],[gv,a]];for(let e=0;e<Cv.length;e++)Ov(n,Cv[e],g_,d_,p);for(let e=0;e<wv.length;e++)Ov(n,wv[e],__,f_,m);o_(g_,{tld:!0,ascii:!0},t),o_(__,{utld:!0,alpha:!0},t),Ov(n,`file`,v_,d_,p),Ov(n,`mailto`,v_,d_,p),Ov(n,`http`,y_,d_,p),Ov(n,`https`,y_,d_,p),Ov(n,`ftp`,y_,d_,p),Ov(n,`ftps`,y_,d_,p),o_(v_,{scheme:!0,ascii:!0},t),o_(y_,{slashscheme:!0,ascii:!0},t),e=e.sort((e,t)=>e[0]>t[0]?1:-1);for(let t=0;t<e.length;t++){let r=e[t][0],i=e[t][1]?{[jte]:!0}:{[Mte]:!0};r.indexOf(`-`)>=0?i[r_]=!0:pv.test(r)?gv.test(r)?i[t_]=!0:i[$g]=!0:i[Qg]=!0,u_(n,r,r,i)}return u_(n,`localhost`,h_,{ascii:!0}),n.jd=new s_(dv),{start:n,tokens:Object.assign({groups:t},fv)}}function Ev(e,t){let n=Dv(t.replace(/[A-Z]/g,e=>e.toLowerCase())),r=n.length,i=[],a=0,o=0;for(;o<r;){let s=e,c=null,l=0,u=null,d=-1,f=-1;for(;o<r&&(c=s.go(n[o]));)s=c,s.accepts()?(d=0,f=0,u=s):d>=0&&(d+=n[o].length,f++),l+=n[o].length,a+=n[o].length,o++;a-=d,o-=f,l-=d,i.push({t:u.t,v:t.slice(a-l,a),s:a-l,e:a})}return i}function Dv(e){let t=[],n=e.length,r=0;for(;r<n;){let i=e.charCodeAt(r),a,o=i<55296||i>56319||r+1===n||(a=e.charCodeAt(r+1))<56320||a>57343?e[r]:e.slice(r,r+2);t.push(o),r+=o.length}return t}function Ov(e,t,n,r,i){let a,o=t.length;for(let n=0;n<o-1;n++){let o=t[n];e.j[o]?a=e.j[o]:(a=new s_(r),a.jr=i.slice(),e.j[o]=a),e=a}return a=new s_(n),a.jr=i.slice(),e.j[t[o-1]]=a,a}function kv(e){let t=[],n=[],r=0;for(;r<e.length;){let i=0;for(;`0123456789`.indexOf(e[r+i])>=0;)i++;if(i>0){t.push(n.join(``));for(let t=parseInt(e.substring(r,r+i),10);t>0;t--)n.pop();r+=i}else n.push(e[r]),r++}return t}var Av={defaultProtocol:`http`,events:null,format:Mv,formatHref:Mv,nl2br:!1,tagName:`a`,target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null};function jv(e,t=null){let n=Object.assign({},Av);e&&(n=Object.assign(n,e instanceof jv?e.o:e));let r=n.ignoreTags,i=[];for(let e=0;e<r.length;e++)i.push(r[e].toUpperCase());this.o=n,t&&(this.defaultRender=t),this.ignoreTags=i}jv.prototype={o:Av,ignoreTags:[],defaultRender(e){return e},check(e){return this.get(`validate`,e.toString(),e)},get(e,t,n){let r=t!=null,i=this.o[e];return i&&(typeof i==`object`?(i=n.t in i?i[n.t]:Av[e],typeof i==`function`&&r&&(i=i(t,n))):typeof i==`function`&&r&&(i=i(t,n.t,n)),i)},getObj(e,t,n){let r=this.o[e];return typeof r==`function`&&t!=null&&(r=r(t,n.t,n)),r},render(e){let t=e.render(this);return(this.get(`render`,null,e)||this.defaultRender)(t,e.t,e)}};function Mv(e){return e}function Nv(e,t){this.t=`token`,this.v=e,this.tk=t}Nv.prototype={isLink:!1,toString(){return this.v},toHref(e){return this.toString()},toFormattedString(e){let t=this.toString(),n=e.get(`truncate`,t,this),r=e.get(`format`,t,this);return n&&r.length>n?r.substring(0,n)+`…`:r},toFormattedHref(e){return e.get(`formatHref`,this.toHref(e.get(`defaultProtocol`)),this)},startIndex(){return this.tk[0].s},endIndex(){return this.tk[this.tk.length-1].e},toObject(e=Av.defaultProtocol){return{type:this.t,value:this.toString(),isLink:this.isLink,href:this.toHref(e),start:this.startIndex(),end:this.endIndex()}},toFormattedObject(e){return{type:this.t,value:this.toFormattedString(e),isLink:this.isLink,href:this.toFormattedHref(e),start:this.startIndex(),end:this.endIndex()}},validate(e){return e.get(`validate`,this.toString(),this)},render(e){let t=this,n=this.toHref(e.get(`defaultProtocol`)),r=e.get(`formatHref`,n,this),i=e.get(`tagName`,n,t),a=this.toFormattedString(e),o={},s=e.get(`className`,n,t),c=e.get(`target`,n,t),l=e.get(`rel`,n,t),u=e.getObj(`attributes`,n,t),d=e.getObj(`events`,n,t);return o.href=r,s&&(o.class=s),c&&(o.target=c),l&&(o.rel=l),u&&Object.assign(o,u),{tagName:i,attributes:o,content:a,eventListeners:d}}};function Pv(e,t){class n extends Nv{constructor(t,n){super(t,n),this.t=e}}for(let e in t)n.prototype[e]=t[e];return n.t=e,n}var Fv=Pv(`email`,{isLink:!0,toHref(){return`mailto:`+this.toString()}}),Iv=Pv(`text`),Lv=Pv(`nl`),Rv=Pv(`url`,{isLink:!0,toHref(e=Av.defaultProtocol){return this.hasProtocol()?this.v:`${e}://${this.v}`},hasProtocol(){let e=this.tk;return e.length>=2&&e[0].t!==h_&&e[1].t===K_}}),zv=e=>new s_(e);function Bv({groups:e}){let t=e.domain.concat([z_,V_,H_,U_,W_,G_,J_,X_,Q_,b_,$_,ev,tv,nv,sv,dv,cv,lv]),n=[B_,K_,q_,Y_,Z_,$_,rv,iv,ov,k_,A_,C_,w_,E_,T_,D_,O_,j_,M_,N_,P_,F_,I_,L_,R_],r=[z_,B_,V_,U_,W_,G_,J_,X_,Q_,C_,w_,$_,ev,tv,nv,rv,sv,dv,cv,lv],i=zv(),a=B(i,cv);c_(a,r,a),c_(a,e.domain,a);let o=zv(),s=zv(),c=zv();
425c_(i,e.domain,o),c_(i,e.scheme,s),c_(i,e.slashscheme,c),c_(o,r,a),c_(o,e.domain,o);let l=B(o,H_);B(a,H_,l),B(s,H_,l),B(c,H_,l);let u=B(a,Y_);c_(u,r,a),c_(u,e.domain,a);let d=zv();c_(l,e.domain,d),c_(d,e.domain,d);let f=B(d,Y_);c_(f,e.domain,d);let p=zv(Fv);c_(f,e.tld,p),c_(f,e.utld,p),B(l,h_,p);let m=B(d,Q_);B(m,Q_,m),c_(m,e.domain,d),c_(p,e.domain,d),B(p,Y_,f),B(p,Q_,m);let h=B(o,Q_),g=B(o,Y_);B(h,Q_,h),c_(h,e.domain,o),c_(g,r,a),c_(g,e.domain,o);let _=zv(Rv);c_(g,e.tld,_),c_(g,e.utld,_),c_(_,e.domain,o),c_(_,r,a),B(_,Y_,g),B(_,Q_,h),B(_,H_,l);let v=B(_,K_),y=zv(Rv);c_(v,e.numeric,y);let b=zv(Rv),x=zv();c_(b,t,b),c_(b,n,x),c_(x,t,b),c_(x,n,x),B(_,sv,b),B(y,sv,b);let S=B(s,K_),C=B(B(B(c,K_),sv),sv);c_(s,e.domain,o),B(s,Y_,g),B(s,Q_,h),c_(c,e.domain,o),B(c,Y_,g),B(c,Q_,h),c_(S,e.domain,b),B(S,sv,b),B(S,rv,b),c_(C,e.domain,b),c_(C,t,b),B(C,sv,b);let w=[[C_,w_],[T_,E_],[D_,O_],[k_,A_],[j_,M_],[N_,P_],[F_,I_],[L_,R_]];for(let e=0;e<w.length;e++){let[r,i]=w[e],a=B(b,r);B(x,r,a);let o=zv(Rv);c_(a,t,o);let s=zv();c_(a,n,s),B(a,i,b),c_(o,t,o),c_(o,n,s),c_(s,t,o),c_(s,n,s),B(o,i,b),B(s,i,b)}return B(i,h_,_),B(i,S_,Lv),{start:i,tokens:fv}}function Vv(e,t,n){let r=n.length,i=0,a=[],o=[];for(;i<r;){let s=e,c=null,l=null,u=0,d=null,f=-1;for(;i<r&&!(c=s.go(n[i].t));)o.push(n[i++]);for(;i<r&&(l=c||s.go(n[i].t));)c=null,s=l,s.accepts()?(f=0,d=s):f>=0&&f++,i++,u++;if(f<0)i-=u,i<r&&(o.push(n[i]),i++);else{o.length>0&&(a.push(Hv(Iv,t,o)),o=[]),i-=f,u-=f;let e=d.t,r=n.slice(i-u,i);a.push(Hv(e,t,r))}}return o.length>0&&a.push(Hv(Iv,t,o)),a}function Hv(e,t,n){let r=n[0].s,i=n[n.length-1].e;return new e(t.slice(r,i),n)}var Uv={scanner:null,parser:null,tokenQueue:[],pluginQueue:[],customSchemes:[],initialized:!1};function Wv(){Uv.scanner=Tv(Uv.customSchemes);for(let e=0;e<Uv.tokenQueue.length;e++)Uv.tokenQueue[e][1]({scanner:Uv.scanner});Uv.parser=Bv(Uv.scanner.tokens);for(let e=0;e<Uv.pluginQueue.length;e++)Uv.pluginQueue[e][1]({scanner:Uv.scanner,parser:Uv.parser});return Uv.initialized=!0,Uv}function Gv(e){return Uv.initialized||Wv(),Vv(Uv.parser.start,e,Ev(Uv.scanner.start,e))}Gv.scan=Ev;function Kv(e,t=null,n=null){if(t&&typeof t==`object`){if(n)throw Error(`linkifyjs: Invalid link type ${t}; must be a string`);n=t,t=null}let r=new jv(n),i=Gv(e),a=[];for(let e=0;e<i.length;e++){let n=i[e];n.isLink&&(!t||n.t===t)&&r.check(n)&&a.push(n.toFormattedObject(r))}return a}function qv(e,t=null){let n=Gv(e);return n.length===1&&n[0].isLink&&(!t||n[0].t===t)}var Jv=null;typeof WebSocket<`u`?Jv=WebSocket:typeof MozWebSocket<`u`?Jv=MozWebSocket:typeof global<`u`?Jv=global.WebSocket||global.MozWebSocket:typeof window<`u`?Jv=window.WebSocket||window.MozWebSocket:typeof self<`u`&&(Jv=self.WebSocket||self.MozWebSocket);var Yv=Jv,Xv=Object.create,Zv=Object.defineProperty,Qv=Object.getOwnPropertyDescriptor,$v=Object.getOwnPropertyNames,ey=Object.getPrototypeOf,ty=Object.prototype.hasOwnProperty,ny=(e,t)=>function(){return t||(0,e[$v(e)[0]])((t={exports:{}}).exports,t),t.exports},ry=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(let i of $v(t))!ty.call(e,i)&&i!==n&&Zv(e,i,{get:()=>t[i],enumerable:!(r=Qv(t,i))||r.enumerable});return e},iy=(e,t,n)=>(n=e==null?{}:Xv(ey(e)),ry(t||!e||!e.__esModule?Zv(n,`default`,{value:e,enumerable:!0}):n,e)),ay=ny({"(disabled):https"(){}}),oy=ny({"(disabled):node_modules/jsonwebtoken/index.js"(){}}),sy=ny({"(disabled):crypto"(){}}),cy=ny({"(disabled):zlib"(){}});function ly(e){return typeof e==`string`}function uy(e,t){return!!t&&ly(e)}function dy(e,t){let n=[];if(ly(e)&&uy(e,t))for(let r=0,i=e.length;r<i;r++)e.charAt(r)&&(n[r]=t(e.charAt(r),r,e));else if(!ly(e)&&!uy(e,t)){for(let r=0,i=e.length;r<i;r++)if(r in e){let i=e[r];n[r]=t(i,r,e)}}return n}var fy=e=>(0,Dte.fromByteArray)(new Uint8Array(dy(e,e=>e.charCodeAt(0)))),py=e=>{let t={},n=String.fromCharCode,r=e.length,i,a=0,o,s,c=0,l,u=``;for(i=0;i<64;i++)t[`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`.charAt(i)]=i;for(s=0;s<r;s++)for(o=t[e.charAt(s)],a=(a<<6)+o,c+=6;c>=8;)((l=a>>>(c-=8)&255)||s<r-2)&&(u+=n(l));return u},my=class{constructor(e,t,n){this.client=e,this.id=t,this.data=n}
425async create(){let e={id:this.id,message_template:this.data?.message_template,segment_ids:this.data?.segment_ids,sender_id:this.data?.sender_id,sender_mode:this.data?.sender_mode,sender_visibility:this.data?.sender_visibility,channel_template:this.data?.channel_template,create_channels:this.data?.create_channels,show_channels:this.data?.show_channels,description:this.data?.description,name:this.data?.name,skip_push:this.data?.skip_push,skip_webhook:this.data?.skip_webhook,user_ids:this.data?.user_ids},t=await this.client.createCampaign(e);return this.id=t.campaign.id,this.data=t.campaign,t}verifyCampaignId(){if(!this.id)throw Error(`Campaign id is missing. Either create the campaign using campaign.create() or set the id during instantiation - const campaign = client.campaign(id)`)}async start(e){return this.verifyCampaignId(),await this.client.startCampaign(this.id,e)}update(e){return this.verifyCampaignId(),this.client.updateCampaign(this.id,e)}async delete(){return this.verifyCampaignId(),await this.client.deleteCampaign(this.id)}stop(){return this.verifyCampaignId(),this.client.stopCampaign(this.id)}get(e){return this.verifyCampaignId(),this.client.getCampaign(this.id,e)}},hy=class{constructor(e){this.client=e}async addMembers(e,t){return await this.client.updateChannelsBatch({operation:`addMembers`,filter:e,members:t})}async removeMembers(e,t){return await this.client.updateChannelsBatch({operation:`removeMembers`,filter:e,members:t})}async inviteMembers(e,t){return await this.client.updateChannelsBatch({operation:`inviteMembers`,filter:e,members:t})}async addModerators(e,t){return await this.client.updateChannelsBatch({operation:`addModerators`,filter:e,members:t})}async demoteModerators(e,t){return await this.client.updateChannelsBatch({operation:`demoteModerators`,filter:e,members:t})}async assignRoles(e,t){return await this.client.updateChannelsBatch({operation:`assignRoles`,filter:e,members:t})}async hide(e){return await this.client.updateChannelsBatch({operation:`hide`,filter:e})}async show(e){return await this.client.updateChannelsBatch({operation:`show`,filter:e})}async archive(e){return await this.client.updateChannelsBatch({operation:`archive`,filter:e})}async unarchive(e){return await this.client.updateChannelsBatch({operation:`unarchive`,filter:e})}async updateData(e,t){return await this.client.updateChannelsBatch({operation:`updateData`,filter:e,data:t})}},gy=iy(ay()),_y=25,vy=100,yy=Object.freeze({hasNext:!1,hasPrev:!1}),by=100*1024*1024,xy=10,Sy=100,Cy=Object.freeze({created_at:!0,deleted_at:!0,pinned_at:!0,updated_at:!0,command:!0,mentioned_groups:!0,mentioned_users:!0,quoted_message:!0,latest_reactions:!0,own_reactions:!0,reaction_counts:!0,reply_count:!0,i18n:!0,t
425ype:!0,html:!0,__html:!0,user:!0}),wy=Object.freeze({error:!0}),Ty=3,Ey=1e3;function Dy(e,t){e.then().catch(e=>{console.warn(`failed to do ${t}, ran into error: `,e)})}var Oy=e=>new Promise(t=>setTimeout(t,e));function ky(e){return typeof e==`function`||e instanceof Function||Object.prototype.toString.call(e)===`[object Function]`}var Ay={TOKEN_EXPIRED:40,WS_CLOSED_SUCCESS:1e3};function Fte(e){return typeof e==`object`&&!!e&&(e.readable||typeof e._read==`function`)}function Ite(e){return e!=null&&e.constructor!=null&&typeof e.constructor.isBuffer==`function`&&e.constructor.isBuffer(e)}function Lte(e){return typeof window<`u`&&`File`in window&&e instanceof File}function Rte(e){return typeof window<`u`&&`Blob`in window&&e instanceof Blob}function zte(e){return{channel_mutes:!0,devices:!0,mutes:!0,total_unread_count:!0,unread_channels:!0,unread_count:!0,unread_threads:!0,invisible:!0,privacy_settings:!0,roles:!0,push_preferences:!0,total_unread_count_by_team:!0}[e]}function Bte(e,t,n){let r=new Ote.default;return Fte(e)||Ite(e)||Lte(e)||Rte(e)?t?r.append(`file`,e,t):r.append(`file`,e):r.append(`file`,{uri:e,name:t||e.split(`/`).reverse()[0],contentType:n||void 0,type:n||void 0}),r}function jy(e){let t=[],n=Array.isArray(e)?e:[e];for(let e of n){let n=Object.entries(e);n.length>1&&console.warn(`client._buildSort() - multiple fields in a single sort object detected. Object's field order is not guaranteed`);for(let[e,r]of n)t.push({field:e,direction:r})}return t}function My(e){let t=Math.min(500+e*2e3,25e3),n=Math.min(Math.max(250,(e-1)*2e3),25e3);return Math.floor(Math.random()*(t-n)+n)}function Ny(){return Fy()}function Py(e){let t=``;for(let n=0;n<e.length;n++)t+=e[n].toString(16).padStart(2,`0`);return t}function Fy(){let e=Ute(16);return e[6]=e[6]&15|64,e[8]=e[8]&191|128,Py(e.subarray(0,4))+`-`+Py(e.subarray(4,6))+`-`+Py(e.subarray(6,8))+`-`+Py(e.subarray(8,10))+`-`+Py(e.subarray(10,16))}function Vte(e){let t=2**(8*e.byteLength/e.length);for(let n=0;n<e.length;n++)e[n]=Math.random()*t}var Hte=typeof crypto<`u`&&crypto?.getRandomValues!==void 0?crypto.getRandomValues.bind(crypto):typeof msCrypto<`u`?msCrypto.getRandomValues.bind(msCrypto):Vte;function Ute(e){let t=new Uint8Array(e);return Hte(t),t}function Wte(e){let t={};if(!e)return t;try{Object.getOwnPropertyNames(e).forEach(n=>{t[n]=Object.getOwnPropertyDescriptor(e,n)})}catch{return{error:`failed to serialize the error`}}return t}function Gte(){let e=typeof navigator<`u`?navigator:typeof window<`u`&&window.navigator?window.navigator:void 0;return e?typeof e.onLine==`boolean`?e.onLine:!0:(console.warn(`isOnline failed to access window.navigator and assume browser is online`),!0)}function Iy(e){typeof window<`u`&&window.addEventListener&&(window.addEventListener(`offline`,e),window.addEventListener(`online`,e))}function Ly(e){typeof window<`u`&&window.removeEventListener&&(window.removeEventListener(`offline`,e),window.removeEventListener(`online`,e))}var Kte=e=>{let t=[];for(let n in e)e[n]!==void 0&&(Array.isArray(e[n])||typeof e[n]==`object`?t.push(`${n}=${encodeURIComponent(JSON.stringify(e[n]))}`):t.push(`${n}=${encodeURIComponent(e[n])}`));return t.join(`&`)};function Ry(e){let t=e=>e?{...e,created_at:e.created_at?new Date(e.created_at):new Date,deleted_at:e.deleted_at?new Date(e.deleted_at):null,pinned_at:e.pinned_at?new Date(e.pinned_at):null,reaction_groups:Yte(e.reaction_groups,e.reaction_counts,e.reaction_scores),status:e.status||`received`,updated_at:e.updated_at?new Date(e.updated_at):new Date}:null;return{...t(e),error:e.error??null,quoted_message:t(e.quoted_message)}}function qte(e){let t=t=>{if(!t)return null;let n=new Date().toISOString();return{...t,created_at:e.created_at?e.created_at.toISOString():n,deleted_at:e.deleted_at?e.deleted_at.toISOString():void 0,pinned_at:e.pinned_at?e.pinned_at.toISOString():void 0,updated_at:e.updated_at?e.updated_at.toISOString():n}};return{...t(e),quoted_message:t(e.quoted_message)}}var Jte=e=>{let{created_at:t,updated_at:n,deleted_at:r,error:i,status:a,latest_reactions:o,own_reactions:s,reaction_counts:c,reaction_scores:l,reply_count:u,command:d,html:f,i18n:p,mentioned_groups:m,quoted_message:h,mentioned_users:g,..._}=e;return{..._,pinned_at:_.pinned_at?.toISOString(),mentioned_users:g?.map(e=>e.id)}},zy=e=>{let t={...Cy,...wy};return{...Object.fromEntries(Object.entries(e).filter(([e])=>!t[e])),pinned:!!e.pinned_at,mentioned_users:e.mentioned_users?.map(e=>typeof e==`string`?e:e.id)}},By=({message:e,deletedAt:t,hardDelete:n=!1})=>n?{attachments:[],cid:e.cid,created_at:e.created_at,deleted_at:t,
425id:e.id,latest_reactions:[],mentioned_users:[],own_reactions:[],parent_id:e.parent_id,reply_count:e.reply_count,status:e.status,thread_participants:e.thread_participants,type:`deleted`,updated_at:e.updated_at,user:e.user}:{...e,attachments:[],type:`deleted`,deleted_at:t},Vy=({messages:e,user:t,hardDelete:n=!1,deletedAt:r})=>{for(let i=0;i<e.length;i++){let a=e[i];a.user?.id===t.id&&(e[i]=a.type===`deleted`?a:By({message:a,hardDelete:n,deletedAt:r})),e[i].quoted_message&&a.quoted_message?.user?.id===t.id&&(e[i].quoted_message=a.quoted_message.type===`deleted`?a.quoted_message:By({message:e[i].quoted_message,hardDelete:n,deletedAt:r}))}},Hy=({needle:e,sortedArray:t,selectKey:n,selectValueToCompare:r=e=>e,sortDirection:i=`ascending`})=>{if(!t.length)return 0;let a=0,o=t.length-1,s=0,c=()=>{s=Math.round((a+o)/2)},l=r(e);for(;a<=o;){c();let e=r(t[s]);i===`ascending`&&l<e||i===`descending`&&l>=e?o=s-1:a=s+1}if(n){let o=n(e),s=i===`ascending`?-1:1;for(let e=a+s;0<=e&&e<t.length&&r(t[e])===l;e+=s)if(n(t[e])===o)return e}return a};function Uy(e,t,n=!1,r=`created_at`,i=!0){let a=i||n,o=[...e];if(n&&(o=o.filter(e=>!(e.id&&t.id===e.id))),o.length===0&&a)return o.concat(t);if(o.length===0)return o;let s=t[r].getTime(),c=o.at(-1)[r].getTime()<s;if(c&&a)return o.concat(t);if(c)return o;let l=Hy({needle:t,sortedArray:o,sortDirection:`ascending`,selectValueToCompare:e=>e[r].getTime(),selectKey:e=>e.id});return!n&&t.id&&o[l]&&t.id===o[l].id?(o[l]=t,o):(a&&o.splice(l,0,t),o)}function Yte(e,t,n){if(e)return e;if(t&&n){let e={};for(let r of Object.keys(t))e[r]={count:t[r],sum_scores:n[r]};return e}return null}var Wy=(e,t=0,{leading:n=!1,trailing:r=!0}={})=>{let i=null,a=null,o,s=(...s)=>(i?clearTimeout(i):n&&(o=e(...s)),r&&(a=s),i=setTimeout(()=>{a&&=(o=e(...a),null),i=null},t),o);return s.cancel=()=>{i&&clearTimeout(i)},s.flush=()=>(i&&(clearTimeout(i),i=null,a&&(o=e(...a))),o),s},Gy=(e,t=200,{leading:n=!0,trailing:r=!1}={})=>{let i=null,a=null;return(...o)=>{if(i){r&&(a=o);return}n&&e(...o);let s=()=>{if(a){e(...a),a=null,i=setTimeout(s,t);return}i=null};i=setTimeout(s,t)}},Xte=(e,t)=>t.split(`.`).reduce((e,t)=>{if(e&&typeof e==`object`&&t in e)return e[t]},e),Zte=(e,t)=>{if(!Array.isArray(e))return[];let n=new Set;return e.filter(e=>{let r=typeof t==`function`?t(e):Xte(e,t);return n.has(r)?!1:(n.add(r),!0)})};function Qte(e,t){let n=0,r=e.length-1;for(;n<=r;){let i=Math.floor((n+r)/2),a=e[i].created_at;if(!a){n+=1;continue}let o=new Date(a);if(o.getTime()===t.getTime())return i;o.getTime()<t.getTime()?n=i+1:r=i-1}return n}var $te=({parentSet:e,requestedPageSize:t,returnedPage:n,filteredReturnedPage:r,messagePaginationOptions:i})=>{let a={...e.pagination};if(!i?.created_at_around)return a;let o,s,c,l,u=new Date(i.created_at_around),[d,f]=[n[0],n.slice(-1)[0]],p=!!d?.created_at&&new Date(d.created_at)>u,m=!!f?.created_at&&new Date(f.created_at)<u,h=t>e.messages.length&&t>n.length,g=(t>e.messages.length||e.messages.length>=n.length)&&t>n.length;if(p)o=!1,c=!0,h&&(s=!1,l=!0);else if(m)s=!1,l=!0,h&&(o=!1,c=!0);else if(g)s=o=!1,c=l=!0;else{let[t,i]=[r[0],r.slice(-1)[0]],[a,d]=[t?.id&&t.id===e.messages[0]?.id,i?.id&&i.id===e.messages.slice(-1)[0]?.id];c=a,l=d;let f=Math.floor(n.length/2),p=Qte(n,u);p!==-1&&(o=f<=p,s=f>=p)}return c&&o!==void 0&&(a.hasPrev=o),l&&s!==void 0&&(a.hasNext=s),a},ene=({parentSet:e,requestedPageSize:t,returnedPage:n,filteredReturnedPage:r,messagePaginationOptions:i})=>{let a={...e.pagination},{id_around:o}=i||{};if(!o)return a;let s,c,[l,u]=[r[0],r.slice(-1)[0]],[d,f]=[l?.id===e.messages[0]?.id,u?.id===e.messages.slice(-1)[0]?.id],p=d,m=f,h=Math.floor(n.length/2);if((t>e.messages.length||e.messages.length>=n.length)&&t>n.length)c=s=!1,p=m=!0;else if(!n[h])return a;else if(n[h].id===o)s=c=!0;else{let e,t=[n.slice(0,h),n.slice(h)];s=c=!0;for(let n=0;n<t.length;n++)e=t[n].find(e=>e.id===o),e&&n===0&&(s=!1),e&&n===1&&(c=!1)}return p&&s!==void 0&&(a.hasPrev=s),m&&c!==void 0&&(a.hasNext=c),a},tne=({parentSet:e,requestedPageSize:t,returnedPage:n,filteredReturnedPage:r,messagePaginationOptions:i})=>{let a={...e.pagination},o,s,[c,l]=[r[0],r.slice(-1)[0]],[u,d]=[c?.id&&c.id===e.messages[0]?.id,l?.id&&l.id===e.messages.slice(-1)[0]?.id],f=i&&(i.created_at_after_or_equal||i.created_at_after||i.id_gt||i.id_gte),p=i===void 0?!0:i.created_at_before_or_equal||i.created_at_before||i.id_lt||i.id_lte||i.offset,m=!f&&!p&&!i?.id_around&&!i?.created_at_around,h=n.length>=t;(p!==void 0||m)&&(o=h),f!==void 0&&(s=h);let g=n.length===0;return(u||g)&&o!==void 0&&(a.hasPrev=o),(d||g)&&s!==void 0&&(a.hasNext=s),a},Ky=e=>e.parentSet.messages.length+(e.returnedPage.length-e.filteredReturnedPage.length)<e.returnedPage.length?(e.logger?.(`error`,`Corrupted message set state: parent set size < returned page size`),e.parentSet.pagination):e.messagePaginationOptions?.created_at_around?$te(e):e.messagePaginationOptions?.id_around?ene(e):tne(e),qy={},Jy=async({channel:e,client:t,id:n,members:r,options:i,type:a})=>{if(!e&&!a)throw Error(`Channel or channel type have to be provided to query a channel.`);let o=e||t.channel(a,n,{members:r}),s=o.id?o.cid:r&&r.length?Yy(o.type,r):void 0;if(!s)throw Error(`Channel ID or channel members array have to be provided to query a channel.`);let c=qy[s];if(c)await c;else try{qy[s]=o.watch(i),await qy[s]}finally{delete qy[s]}return o},Yy=(e,t)=>{if(!t)return;let n=[...t].sort().join(`,`);if(n)return`${e}:!members-${n}`},Xy=e=>e?!!e.state.membership?.pinned_at:!1,Zy=e=>e?!!e.state.membership?.archived_at:!1,Qy=e=>e?typeof e.archived==`boolean`:!1,$y=({atIndex:e,sort:t,targetKey:n})=>{if(!t)return null;let r=null;if(Array.isArray(t))r=t[e]??null;else{let i=0;for(let a in t){if(i!==e){i++;continue}if(a!==n)return null;r=t;break}}return r?.[n]??null},eb=e=>{let t=nne({sort:e});return typeof t==`number`?Math.abs(t)===1:!1},nne=({sort:e})=>$y({atIndex:0,sort:e,targetKey:`pinned_at`}),tb=({channels:e})=>{let t=null;for(let n of e){if(!Xy(n))break;typeof t==`number`?t++:t=0}return t},nb=({channels:e,channelToMove:t,channelToMoveIndexWithinChannels:n,sort:r})=>{let i=n??e.findIndex(e=>e.cid===t.cid),a=i>=0,o=i===0,s=eb(r),c=Xy(t);if(o||s&&c)return e;let l=[...e];a&&l.splice(i,1);let u=null;return s&&(u=tb({channels:l})),l.splice(typeof u==`number`?u+1:0,0,t),l},rne=e=>!!e.getTime,ine=e=>rne(e.created_at),ane=e=>e.type===`error`&&(e.moderation_details?.action===`MESSAGE_RESPONSE_ACTION_REMOVE`||e.moderation?.action===`remove`),rb=(e,t)=>({newestMessageA:new Date(e[0]?.created_at??0),oldestMessageA:new Date(e.slice(-1)[0]?.created_at??0),newestMessageB:new Date(t[0]?.created_at??0),oldestMessageB:new Date(t.slice(-1)[0]?.created_at??0)}),ib=(e,t)=>
425{let{newestMessageA:n,newestMessageB:r,oldestMessageA:i,oldestMessageB:a}=rb(e,t);return n>=r&&a>=i},ab=(e,t)=>{let{newestMessageA:n,newestMessageB:r,oldestMessageA:i,oldestMessageB:a}=rb(e,t);return i<a&&a<n&&n<r},one=(e,t)=>ib(e,t)||ib(t,e)||ab(e,t)||ab(t,e),sne=class{constructor(e){this.messageSets=[],this.formatMessage=e=>Ry(e),this.setIsUpToDate=e=>{this.isUpToDate=e},this.removeMessageFromArray=(e,t)=>{let n=e.filter(e=>!(e.id&&t.id&&e.id===t.id));return{removed:n.length<e.length,result:n}},this.updateUserMessages=e=>{let t=(e,t)=>{for(let n=0;n<e.length;n++){let r=e[n];r.user?.id===t.id&&(e[n]={...r,user:t})}};this.messageSets.forEach(n=>t(n.messages,e));for(let n in this.threads)t(this.threads[n],e);t(this.pinnedMessages,e)},this.deleteUserMessages=(e,t=!1,n)=>{this.messageSets.forEach(({messages:r})=>Vy({messages:r,user:e,hardDelete:t,deletedAt:n??null}));for(let r in this.threads)Vy({messages:this.threads[r],user:e,hardDelete:t,deletedAt:n??null});Vy({messages:this.pinnedMessages,user:e,hardDelete:t,deletedAt:n??null})},this.findMessageSetByOldestTimestamp=e=>{let t=0,n=this.messageSets.length;for(;t<n;){let r=t+n>>>1,i=this.messageSets[r];if(i.messages.length===0)return-1;i.messages[0].created_at.getTime()<=e?n=r:t=r+1}return t},this._channel=e,this.watcher_count=0,this.typing={},this.read={},this.initMessages(),this.pinnedMessages=[],this.pending_messages=[],this.threads={},this.mutedUsers=[],this.watchers={},this.members={},this.membership={},this.unreadCount=0,this.isUpToDate=!0,this.last_message_at=e?.state?.last_message_at==null?null:new Date(e.state.last_message_at)}get messages(){return this.messageSets.find(e=>e.isCurrent)?.messages||[]}set messages(e){let t=this.messageSets.findIndex(e=>e.isCurrent);this.messageSets[t].messages=e}get latestMessages(){return this.messageSets.find(e=>e.isLatest)?.messages||[]}set latestMessages(e){let t=this.messageSets.findIndex(e=>e.isLatest);this.messageSets[t].messages=e}get messagePagination(){return this.messageSets.find(e=>e.isCurrent)?.pagination||yy}pruneOldest(e){let t=this.messageSets.findIndex(e=>e.isCurrent);if(this.messageSets[t].isLatest){let n=this.messageSets[t].messages;this.messageSets[t].messages=n.slice(-e),this.messageSets[t].pagination.hasPrev=!0}}addMessageSorted(e,t=!1,n=!0,r=`latest`){return this.addMessagesSorted([e],t,!1,n,r)}addMessagesSorted(e,t=!1,n=!1,r=!0,i=`current`){let{messagesToAdd:a,targetMessageSetIndex:o}=this.findTargetMessageSet(e,r,i),s=[];for(let e=0;e<a.length;e+=1){if(a[e].shadowed&&r){s.push(a[e].id);continue}let i=a[e].created_at instanceof Date,c;i?c=a[e]:(c=this.formatMessage(a[e]),c.user&&this._channel?.cid&&this._channel.getClient().state.updateUserReference(c.user,this._channel.cid),n&&c.id&&this.threads[c.id]&&!this._channel.getClient().preventThreadCleanup&&delete this.threads[c.id],!(this._channel.getConfig()?.skip_last_msg_update_for_system_msgs&&c.type===`system`)&&(!this.last_message_at||c.created_at.getTime()>this.last_message_at.getTime())&&(this.last_message_at=new Date(c.created_at.getTime())));let l=c.parent_id;if((!l||c.show_in_channel)&&o!==-1&&(this.messageSets[o].messages=this._addToMessageList(this.messageSets[o].messages,c,t,`created_at`,r)),l&&!n){let e=this.threads[l]||[];this.threads[l]=this._addToMessageList(e,c,t,`created_at`,r)}}return{messageSet:this.messageSets[o],filteredMessageIds:s}}addPinnedMessages(e){for(let t=0;t<e.length;t+=1)this.addPinnedMessage(e[t])}addPinnedMessage(e){this.pinnedMessages=this._addToMessageList(this.pinnedMessages,this.formatMessage(e),!1,`pinned_at`)}removePinnedMessage(e){let{result:t}=this.removeMessageFromArray(this.pinnedMessages,e);this.pinnedMessages=t}addReaction(e,t,n){let r=t,i;if(r||(i=this.findMessage(e.message_id)),!r&&!i)return;let a=r??i,o={id:a?.id,parent_id:a?.parent_id,pinned:a?.pinned,show_in_channel:a?.show_in_channel};return this._updateMessage(o,t=>{if(r){let i={...r};return r.own_reactions=this._addOwnReactionToMessage(t.own_reactions,e,n),i.own_reactions=this._channel.getClient().userID===e.user_id?r.own_reactions:t.own_reactions,this.formatMessage(i)}return i?this._addReactionToState(i,e,n):t}),r??i}_addReactionToState(e,t,n){if(e.reaction_groups||={},n)for(let t of e.own_reactions??[]){let n=e.reaction_groups[t.type];e.reaction_groups[t.type]={...n,count:n.count-1,sum_scores:n.sum_scores-(t.score??1)},e.reaction_groups[t.type].count<1&&delete e.reaction_groups[t.type]}let r=e.reaction_groups[t.type],i=t.score??1;e.reaction_groups[t.type]=r?{...r,count:r.count+1,sum_scores:r.sum_scores+i,last_reaction_at:t.created_at}:{count:1,first_reaction_at:t.created_at,last_reaction_at:t.created_at,
425sum_scores:i},e.own_reactions=this._addOwnReactionToMessage(e.own_reactions,t,n);let a=this._channel.getClient().userID;return e.latest_reactions=n?[...(e.latest_reactions||[]).filter(e=>e.user_id!==a),t]:[...e.latest_reactions||[],t],e}_addOwnReactionToMessage(e,t,n){return e=n?[]:this._removeOwnReactionFromMessage(e,t),e||=[],this._channel.getClient().userID===t.user_id&&e.push(t),e}_removeOwnReactionFromMessage(e,t){return e&&e.filter(e=>e.user_id!==t.user_id||e.type!==t.type)}removeReaction(e,t){let n=t,r;if(n||(r=this.findMessage(e.message_id)),!n&&!r)return;let i=n??r,a={id:i?.id,parent_id:i?.parent_id,pinned:i?.pinned,show_in_channel:i?.show_in_channel};return this._updateMessage(a,t=>n?(n.own_reactions=this._removeOwnReactionFromMessage(t.own_reactions,e),this.formatMessage(n)):r?this._removeReactionFromState(r,e):t),n}_removeReactionFromState(e,t){let n=e.own_reactions?.find(e=>e.type===t.type);if(n&&e.reaction_groups?.[n.type]){let t=e.reaction_groups[n.type];e.reaction_groups[n.type]={...t,count:t.count-1,sum_scores:t.sum_scores-(n.score??1)},e.reaction_groups[n.type].count<1&&delete e.reaction_groups[n.type]}e.own_reactions=e.own_reactions?.filter(e=>e.type!==t.type);let r=this._channel.getClient().userID;return e.latest_reactions=e.latest_reactions?.filter(e=>!(e.user_id===r&&e.type===t.type)),e}_updateQuotedMessageReferences({message:e,remove:t}){let n=e=>({...e,created_at:e.created_at.toISOString(),pinned_at:e.pinned_at?.toISOString(),updated_at:e.updated_at?.toISOString()}),r=r=>{let i=r.reduce((r,i)=>(i.quoted_message_id===e.id&&r.push({...n(i),quoted_message:t?{...e,attachments:[]}:e}),r),[]);this.addMessagesSorted(i,!0)};e.parent_id?e.parent_id&&this.threads[e.parent_id]&&r(this.threads[e.parent_id]):this.messageSets.forEach(e=>r(e.messages))}removeQuotedMessageReferences(e){this._updateQuotedMessageReferences({message:e,remove:!0})}_updateMessage(e,t){let{parent_id:n,show_in_channel:r,pinned:i}=e;if(n&&this.threads[n]){let r=this.threads[n],i=r.findIndex(t=>t.id===e.id);i!==-1&&(r[i]=t(r[i]),this.threads[n]=r)}if(!r&&!n||r){let n=this.findMessageSetIndex(e);if(n!==-1){let r=this.messageSets[n].messages.findIndex(t=>t.id===e.id);if(r!==-1){let e=t(this.messageSets[n].messages[r]);this.messageSets[n].messages[r]=e}}}if(i){let n=this.pinnedMessages.findIndex(t=>t.id===e.id);n!==-1&&(this.pinnedMessages[n]=t(this.pinnedMessages[n]))}}_addToMessageList(e,t,n=!1,r=`created_at`,i=!0){return Uy(e,t,n,r,i)}removeMessage(e){let t=!1;if(e.parent_id&&this.threads[e.parent_id]){let{removed:n,result:r}=this.removeMessageFromArray(this.threads[e.parent_id],e);this.threads[e.parent_id]=r,t=n}else{let n=e.messageSetIndex??this.findMessageSetIndex(e);if(n!==-1){let{removed:r,result:i}=this.removeMessageFromArray(this.messageSets[n].messages,e);this.messageSets[n].messages=i,t=r}}return t}filterErrorMessages(){let e=this.latestMessages.filter(e=>e.type!==`error`),t=this.latestMessages.filter(ane);for(let e of t)this._channel.getClient().offlineDb?.hardDeleteMessage({id:e.id});this.latestMessages=e}clean(){let e=new Date;for(let[t,n]of Object.entries(this.typing)){let r=typeof n.received_at==`string`?new Date(n.received_at):n.received_at||new Date;e.getTime()-r.getTime()>7e3&&(delete this.typing[t],this._channel.getClient().dispatchEvent({cid:this._channel.cid,type:`typing.stop`,user:{id:t}}))}}clearMessages(){this.initMessages(),this.pinnedMessages=[]}initMessages(){this.messageSets=[{messages:[],isLatest:!0,isCurrent:!0,pagination:{...yy}}]}async loadMessageIntoState(e,t,n=25){let r,i=!1,a=!1,o=t||e;if(e===`latest`){if(this.messages===this.latestMessages)return;r=this.messageSets.findIndex(e=>e.isLatest)}else r=this.findMessageSetIndex({id:o});r!==-1&&(this.switchToMessageSet(r),i=!0),a=!t||!!this.threads[t]?.find(t=>t.id===e),!(i&&a)&&(i||await this._channel.query({messages:{id_around:o,limit:n}},`new`),!a&&t&&await this._channel.getReplies(t,{id_around:e,limit:n}),r=this.findMessageSetIndex({id:o}),r!==-1&&this.switchToMessageSet(r))}findMessage(e,t){if(t){let n=this.threads[t];return n?n.find(t=>t.id===e):void 0}let n=this.findMessageSetIndex({id:e});if(n!==-1)return this.messageSets[n].messages.find(t=>
425t.id===e)}findMessageByTimestamp(e,t,n=!1){if(t&&!this.threads[t]||this.messageSets.length===0)return null;let r=this.findMessageSetByOldestTimestamp(e),i=this.messageSets[r]?.messages;if(!i?.length)return null;let a=i[0].created_at.getTime(),o=i.slice(-1)[0].created_at.getTime();if((e<a||o<e)&&n)return null;let s=0,c=i.length-1;for(;s<c;){let t=s+c>>>1;e<=i[t].created_at.getTime()?c=t:s=t+1}let l=i[s];return n?l.created_at.getTime()===e?l:null:l}switchToMessageSet(e){let t=this.messageSets.find(e=>e.isCurrent);t&&(t.isCurrent=!1,this.messageSets[e].isCurrent=!0)}areMessageSetsOverlap(e,t){return e.some(e=>t.find(t=>e.id===t.id))}findMessageSetIndex(e){return this.messageSets.findIndex(t=>!!t.messages.find(t=>t.id===e.id))}findTargetMessageSet(e,t=!0,n=`current`){let r=e,i;if(e.length===0)return{targetMessageSetIndex:0,messagesToAdd:e};if(t){let t=this.messageSets.map((e,t)=>t).filter(t=>this.areMessageSetsOverlap(this.messageSets[t].messages,e)),a=this.messageSets.map((e,t)=>t).filter(t=>one(this.messageSets[t].messages,e.map(Ry)));switch(n){case`new`:if(t.length>0)i=t[0];else if(a.length>0)i=a[0];else if(e.some(e=>!e.parent_id)){let t=this.findMessageSetByOldestTimestamp(new Date(e[0].created_at).getTime());if(t===-1)this.messageSets.push({messages:[],isCurrent:!1,isLatest:!1,pagination:{...yy}}),i=this.messageSets.length-1;else{let e=t===0;this.messageSets.splice(t,0,{messages:[],isCurrent:!1,isLatest:e,pagination:{...yy}}),e&&this.messageSets.slice(1).forEach(e=>{e.isLatest=!1}),i=t}}break;case`current`:i=a.length>0?a[0]:this.messageSets.findIndex(e=>e.isCurrent);break;case`latest`:i=a.length>0?a[0]:this.messageSets.findIndex(e=>e.isLatest);break;default:i=-1}let o=t.splice(0,1)[0],s=[...t];if(o!==void 0&&o!==i&&s.push(i),s.length>0){let t=this.messageSets[o],n=this.messageSets.filter((e,t)=>s.indexOf(t)!==-1);n.forEach(e=>{t.isLatest=t.isLatest||e.isLatest,t.isCurrent=t.isCurrent||e.isCurrent,t.pagination.hasPrev=e.messages[0].created_at<t.messages[0].created_at?e.pagination.hasPrev:t.pagination.hasPrev,t.pagination.hasNext=t.messages.slice(-1)[0].created_at<e.messages.slice(-1)[0].created_at?e.pagination.hasNext:t.pagination.hasNext,r=[...r,...e.messages]}),n.forEach(e=>this.messageSets.splice(this.messageSets.indexOf(e),1)),i=this.messageSets.findIndex(t=>this.areMessageSetsOverlap(t.messages,e))}}else i=this.findMessageSetIndex(e[0]);return{targetMessageSetIndex:i,messagesToAdd:r}}},ob=e=>typeof e==`function`,cne=()=>{},sb=class{constructor(e){this.value=e,this.handlers=new Set,this.preprocessors=new Set,this.partialNext=e=>this.next(t=>({...t,...e})),this.subscribeWithSelector=(e,t)=>{let n;return this.subscribe(r=>{let i=e(r),a=n===void 0;for(let e in n)if(n[e]!==i[e]){a=!0;break}if(!a)return;let o=n;n=i,t(i,o)})}}merge(e){return new lne({original:this,merged:e})}next(e){let t=ob(e)?e(this.value):e;if(t===this.value)return;this.preprocessors.forEach(e=>e(t,this.value));let n=this.value;this.value=t,this.handlers.forEach(e=>e(this.value,n))}getLatestValue(){return this.value}subscribe(e){return e(this.value,void 0),this.handlers.add(e),()=>{this.handlers.delete(e)}}addPreprocessor(e){return this.preprocessors.add(e),()=>{this.preprocessors.delete(e)}}},lne=class e extends sb{constructor({original:t,merged:n}){let r=t.getLatestValue(),i=n.getLatestValue();super({...r,...i}),this.next=()=>{console.warn(`${e.name}.next is disabled, call original.next or merged.next instead`)},this.partialNext=()=>{console.warn(`${e.name}.partialNext is disabled, call original.partialNext or merged.partialNext instead`)},this.cachedOriginalValue=r,this.cachedMergedValue=i,this.original=t,this.merged=n}subscribe(e){let t=[];if(!this.handlers.size){let e=e=>{super.next(t=>({...t,...e}))};t.push(this.original.subscribe(t=>{t!==this.cachedOriginalValue&&(this.cachedOriginalValue=t,e(t))}),this.merged.subscribe(t=>{t!==this.cachedMergedValue&&(this.cachedMergedValue=t,e(t))}))}return t.push(super.subscribe(e)),()=>{t.forEach(e=>e())}}getLatestValue(){if(!this.handlers.size){let e=this.original.getLatestValue(),t=this.merged.getLatestValue();(e!==this.cachedOriginalValue||t!==this.cachedMergedValue)&&(this.value={...e,...t},this.cachedMergedValue=t,this.cachedOriginalValue=e)}return super.getLatestValue()}addPreprocessor(){return console.warn(`${e.name}.addPreprocessor is disabled, call original.addPreprocessor or merged.addPreprocessor instead`),cne}},cb=class e{constructor(){this.unsubscribeFunctions=new Set,this.refCount=0}get hasSubscriptions(){return this.unsubscribeFunctions.size>0}addUnsubscribeFunction(e){this.unsubscribeFunctions.add(e)}incrementRefCount(){return++this.refCount}unregisterSubscriptions(){return this.refCount>1?(this.refCount--,e.symbol):(this.unsubscribeFunctions.forEach(e
425=>e()),this.unsubscribeFunctions.clear(),this.refCount=0,e.symbol)}};cb.symbol=Symbol(cb.name);var lb=cb,ub=e=>{if(e instanceof Date)return e;if(typeof e==`string`||typeof e==`number`){let t=new Date(e);if(!Number.isNaN(t.getTime()))return t}},une=class extends lb{constructor({channel:e}){super(),this.timeout=null,this.registerSubscriptions=()=>{this.incrementRefCount(),!this.hasSubscriptions&&(this.addUnsubscribeFunction(this.channel.on(`message.new`,e=>{e.message?.user?.id&&e.message.user.id===this.getOwnUserId()&&this.setOwnLatestMessageDate(ub(e.message?.created_at))}).unsubscribe),this.addUnsubscribeFunction(this.channel.on(`channel.updated`,e=>{e.channel?.cooldown!==this.cooldownConfigSeconds&&this.refresh()}).unsubscribe))},this.setCooldownRemaining=e=>{this.state.partialNext({cooldownRemaining:e})},this.clearTimeout=()=>{this.timeout&&=(clearTimeout(this.timeout),null)},this.refresh=()=>{let{cooldown:e=0,own_capabilities:t}=this.channel.data??{},n=(t??[]).includes(`skip-slow-mode`),r=this.findOwnLatestMessageDate({messages:this.channel.state.latestMessages});if((e!==this.cooldownConfigSeconds||r?.getTime()!==this.ownLatestMessageDate?.getTime()||n!==this.canSkipCooldown)&&this.state.partialNext({cooldownConfigSeconds:e,ownLatestMessageDate:r,canSkipCooldown:n}),this.canSkipCooldown||this.cooldownConfigSeconds===0){this.clearTimeout(),this.cooldownRemaining!==0&&this.setCooldownRemaining(0);return}this.recalculate()},this.setOwnLatestMessageDate=e=>{this.state.partialNext({ownLatestMessageDate:e}),this.recalculate()},this.recalculate=()=>{this.clearTimeout();let{cooldownConfigSeconds:e,ownLatestMessageDate:t,canSkipCooldown:n}=this.state.getLatestValue(),r=t==null?void 0:Math.max(0,(Date.now()-t.getTime())/1e3),i=!n&&r!==void 0&&e>r?Math.round(e-r):0;i!==this.cooldownRemaining&&this.setCooldownRemaining(i),!(i<=0)&&(this.timeout=setTimeout(()=>{this.recalculate()},1e3))},this.channel=e,this.state=new sb({cooldownConfigSeconds:0,cooldownRemaining:0,ownLatestMessageDate:void 0,canSkipCooldown:!1}),this.refresh()}get cooldownConfigSeconds(){return this.state.getLatestValue().cooldownConfigSeconds}get cooldownRemaining(){return this.state.getLatestValue().cooldownRemaining}get canSkipCooldown(){return this.state.getLatestValue().canSkipCooldown}get ownLatestMessageDate(){return this.state.getLatestValue().ownLatestMessageDate}getOwnUserId(){let e=this.channel.getClient();return e.userID??e.user?.id}findOwnLatestMessageDate({messages:e}){let t=this.getOwnUserId();if(!t)return;let n;for(let r=e.length-1;r>=0;--r){let i=e[r];if(i.user?.id!==t)continue;let a=ub(i.created_at);if(a&&((!n||a.getTime()>n.getTime())&&(n=a),n.getTime()>a.getTime()))break}return n}},db=e=>!!e?.og_scrape_url||!!e?.title_link,fb=e=>!!e?.localMetadata?.id,pb=(e,t=[])=>e.type===`file`||!!(e.mime_type&&t.indexOf(e.mime_type)===-1&&e.type!==`video`),dne=e=>pb(e)&&fb(e),mb=e=>e.type===`image`&&!db(e),hb=e=>mb(e)&&fb(e),gb=e=>e.type===`audio`,fne=e=>gb(e)&&fb(e),_b=e=>e.type===`voiceRecording`,vb=e=>_b(e)&&fb(e),yb=(e,t=[])=>e.type===`video`||!!(e.mime_type&&t.indexOf(e.mime_type)!==-1),bb=e=>yb(e)&&fb(e),pne=e=>gb(e)||pb(e)||mb(e)||yb(e)||_b(e),xb=e=>!!e.latitude&&!!e.longitude&&!!e.channel_cid,Sb=e=>e.type===`giphy`,Cb=e=>!!e.lastModified&&!(`uri`in e),mne=e=>typeof e!=`object`||!e?!1:typeof FileList<`u`&&e instanceof FileList||`item`in e&&`length`in e&&!Array.isArray(e),hne=e=>e instanceof Blob&&!(e instanceof File),wb=e=>typeof e==`object`&&!!e&&!Cb(e)&&!hne(e)&&typeof e.name==`string`&&typeof e.uri==`string`&&typeof e.size==`number`&&typeof e.type==`string`,Tb=({blobsArray:e,fileName:t,mimeType:n})=>{let r=new Blob(e,{type:n});return new File([r],t,{type:r.type})},gne=e=>e.match(/\/([^/;]+)/)?.[1],Eb=e=>{let t=gne(e);return`file_${new Date().toISOString()}${t?`.`+t:``}`},Db=e=>{let t=e.type;return t.startsWith(`image/`)&&!t.endsWith(`.photoshop`)},_ne=e=>e.startsWith(`image/`)&&!e.endsWith(`.photoshop`)?`image`:e.includes(`video/`)?`video`:e.includes(`audio/`)?`audio`:`file`,Ob=e=>{if(!e)return null;if(fb(e))return e;let{localMetadata:t,...n}=e;return{localMetadata:{...t??{},id:t?.id||Fy()},...n}},vne=()=>({id:`stream-io/attachment-manager-middleware/post-upload-enrichment`,handlers:{postProcess:({state:e,discard:t,forward:n,next:r})=>{let{attachment:i,error:a,response:o}=e;if(a)return n();if(!i||!o)return t();let s={...i},c=i.localMetadata.previewUri;return c&&(c.startsWith(`blob:`)&&URL.revokeObjectURL(c),delete s.localMetadata.previewUri),hb(i)?s.image_url=o.file:s.asset_url=o.file,o.thumb_url&&(s.thumb_url=o.thumb_url),r({...e,attachment:s})}}}),kb=yne(bne),Ab=new Map;function yne(e){return function(t,n){let{cb:r,onContinued:i}=e(t,n),a=Ab.get(t);a?.onContinued();let o=a?a.promise.then(r,r):r();return Ab.set(t,{promise:o,onContinued:i}),o}}function bne(e,t){let n=new AbortController;return{cb:()=>n.signal.aborted?Promise.resolve(`canceled`):t(n.signal).finally(()=>{n.signal.aborted||Ab.delete(e)}),onContinued:()=>n.abort()}}var jb=class{constructor(){this.middleware=[],this.id=Fy()}use(e){return this.middleware=this.middleware.concat(e),this}replace(e){let t=[...this.middleware];
425return e.forEach(e=>{let n=this.middleware.findIndex(t=>t.id===e.id);n>=0?t.splice(n,1,e):t.push(e)}),this.middleware=t,this}insert({middleware:e,position:t,unique:n}){n&&e.forEach(e=>{let t=this.middleware.findIndex(t=>t.id===e.id);t>=0&&this.middleware.splice(t,1)});let r=t.after||t.before,i=this.middleware.findIndex(e=>e.id===r),a=t.after?i+1:i;return this.middleware.splice(a,0,...e),this}setOrder(e){this.middleware=e.map(e=>this.middleware.find(t=>t.id===e)).filter(Boolean)}remove(e){!e&&!e.length||(this.middleware=this.middleware.filter(t=>typeof e==`string`?e!==t.id:!e.includes(t.id)))}async executeMiddlewareChain({eventName:e,initialValue:t,mode:n=`cancelable`}){let r=-1,i=async(t,n,a)=>{if(t<=r)throw Error(`next() called multiple times`);if(r=t,t===this.middleware.length||a&&[`complete`,`discard`].includes(a))return{state:n,status:a};let o=this.middleware[t].handlers[e];return o?await o({state:n,next:e=>i(t+1,e),complete:e=>i(t+1,e,`complete`),discard:()=>i(t+1,n,`discard`),forward:()=>i(t+1,n)}):i(t+1,n,a)},a=n===`cancelable`?await kb(`middleware-execution-${this.id}-${e}`,async e=>{let n=await i(0,t);return e.aborted?`canceled`:n}):await i(0,t);return a===`canceled`?{state:t,status:`discard`}:a}async execute({eventName:e,initialValue:t,mode:n}){return await this.executeMiddlewareChain({eventName:e,initialValue:t,mode:n})}},xne=e=>({id:`stream-io/attachment-manager-middleware/upload-error`,handlers:{postProcess:({state:t,discard:n,forward:r})=>{let{attachment:i,error:a}=t;if(!a)return r();if(!i)return n();let o=a instanceof Error?a.message:`unknown error`;return e.client.notifications.addError({message:`Error uploading attachment`,origin:{emitter:`AttachmentManager`,context:{attachment:i}},options:{type:`api:attachment:upload:failed`,metadata:{reason:o},originalError:a}}),r()}}}),Sne=class extends jb{constructor({composer:e}){super(),this.use([xne(e),vne()])}},Cne=e=>({id:`stream-io/attachment-manager-middleware/file-upload-config-check`,handlers:{prepare:async({state:t,next:n,discard:r})=>{let{attachmentManager:i}=e;if(!i||!t.attachment)return r();let a=await i.getUploadConfigCheck(t.attachment.localMetadata.file),o={...t.attachment,localMetadata:{...t.attachment.localMetadata,uploadPermissionCheck:a,uploadState:a.uploadBlocked?`blocked`:`pending`}};return n({...t,attachment:o})}}}),wne=e=>({id:`stream-io/attachment-manager-middleware/blocked-upload-notification`,handlers:{prepare:({state:{attachment:t},forward:n})=>(t&&t.localMetadata.uploadPermissionCheck?.uploadBlocked&&e.client.notifications.addError({message:`The attachment upload was blocked`,origin:{emitter:`AttachmentManager`,context:{blockedAttachment:t}},options:{type:`validation:attachment:upload:blocked`,metadata:{reason:t.localMetadata.uploadPermissionCheck?.reason}}}),n())}}),Tne=class extends jb{constructor({composer:e}){super(),this.use([Cne(e),wne(e)])}},Mb=e=>{if(!e||typeof e!=`object`||Array.isArray(e))return!1;let t=Object.getPrototypeOf(e);return t===null||t===Object.prototype?!1:e.constructor&&e.constructor!==Object},Nb=(e,t,n=new Set,r=new WeakSet,i=new WeakSet)=>{if(e===t)return!0;if(e==null||t==null)return!1;let a=typeof e;if(a!==typeof t)return!1;if(a!==`object`)return e!==e&&t!==t?!0:e===t;let o=e,s=t;if(r.has(o)||i.has(s))return r.has(o)&&i.has(s);if(r.add(o),i.add(s),e instanceof Date&&t instanceof Date)return r.delete(o),i.delete(s),e.getTime()===t.getTime();if(e instanceof RegExp&&t instanceof RegExp)return r.delete(o),i.delete(s),e.toString()===t.toString();if(Mb(e)||Mb(t))return r.delete(o),i.delete(s),!1;let c=Array.isArray(e),l=Array.isArray(t);if(c!==l)return r.delete(o),i.delete(s),!1;if(c&&l){let a=e,c=t;if(a.length!==c.length)return r.delete(o),i.delete(s),!1;let l=[e,t];if(n.has(l))return r.delete(o),i.delete(s),!0;n.add(l);for(let e=0;e<a.length;e++)if(!Nb(a[e],c[e],n,r,i))return n.delete(l),r.delete(o),i.delete(s),!1;return n.delete(l),r.delete(o),i.delete(s),!0}let u=e,d=t,f=Object.keys(u),p=Object.keys(d);if(f.length!==p.length)return r.delete(o),i.delete(s),!1;for(let e of p)if(!Object.prototype.hasOwnProperty.call(u,e))return r.delete(o),i.delete(s),!1;let m=[e,t];if(n.has(m))return r.delete(o),i.delete(s),!0;n.add(m);for(let e of f)if(!Nb(u[e],d[e],n,r,i))return n.delete(m),r.delete(o),i.delete(s),!1;return n.delete(m),r.delete(o),i.delete(s),!0};function Ene(e,t){let n={children:{}};return Pb(e,t,n),Ib(n)}function Pb(e,t,n,r,i=new Set,a=new Set){if(Nb(e,t,new Set(i)))return;if(e==null){r!==void 0&&(n.children[String(r)]={type:`added`,value:t,children:{}});return}if(typeof e==`object`&&e){if(a.has(e)){r!==void 0&&(n.children[String(r)]={type:`circular`,value:t,oldValue:e,children:{}});return}a.add(e)}if(typeof e!=`object`||typeof t!=`object`||e===null||t===null||Array.isArray(e)!==Array.isArray(t)||Mb(e)||Mb(t)){r!==void 0&&(n.children[String(r)]={type:`updated`,value:t,oldValue:e,children:{}}),typeof e==`object`&&e&&a.delete(e);return}let o=e,s=t,c=r===void 0?n:{type:`updated`,children:{},oldValue:e,value:t};r!==void 0&&(n.children[String(r)]=c);let l=[e,t];if(i.has(l)){typeof e==`object`&&e&&a.delete(e);return}i.add(l);let u=new Set([...Object.keys(o),...Object.getOwnPropertySymbols(o),...Object.keys(s),...Object.getOwnPropertySymbols(s)]);for(let e of u){let t=o[e],n=s[e];if(e in s){if(!(e in o)){c.children[String(e)]={type:`added`,value:n,children:{}};continue}Pb(t,n,c,e,i,a)}}i.delete(l),typeof e==`object`&&e&&a.delete(e)}function Fb(e={}){let{trackDiff:t=!1}=e;return function({target:e,source:n,customizer:r}){let i=Array.isArray(n)?n:[n],a=t?structuredClone(e):void 0;function o(e,t,n,i,a,o){let s=r?.(e,t,n,i,a,o);return s===void 0?!1:(Object.defineProperty(i,n,{value:s,enumerable:!0,writable:!0,configurable:!0}),!0)}function s(e,t){if(e==null||!Array.isArray(e)&&typeof e!=`object`)return t;if(e&&typeof e==`object`){let n=Mb(e),r=Mb(t);return n||r?r?t:e:Array.isArray(e)?[...e]:{...e}}return Array.isArray(t)?[]:{}}function c(e,t,n,r,i){let a=t[n],c=e[n];if(!o(c,a,n,e,t,r))if(a&&typeof a==`object`){if(!r.has(a)){let t=s(c,a);if(Object.defineProperty(e,n,{value:t,enumerable:!0,writable:!0,configurable:!0}),Mb(t))return;i.push({target:t,source:a,sourceKey:n,parentTarget:e})}}else a!==void 0&&(e[n]=a)}function l(e,t,n,r){let i=[...Object.keys(t),...Object.getOwnPropertySymbols(t)];for(let a of i)c(e,t,a,n,r)}function u({target:e,source:n,sourceKey:r,parentTarget:i},a,o){if(a.has(n)){t&&r&&i&&Object.defineProperty(i,r,{value:e,enumerable:!0,writable:!0,configurable:!0});return}!a.has(e)&&!a.has(n)&&(a.add(e),a.add(n),l(e,n,a,o),a.delete(n),a.delete(e))}function d(e,t,n=new Set){if(n.has(e)||n.has(t))return{...e};let r={...e},i=[];for(n.add(r),n.add(t),l(r,t,n,i);i.length;)u(i.pop(),n,i);return n.delete(t),n.delete(r),r}let f=i.reduce((e,t)=>
425d(e,t),{...e});return{result:f,diff:t&&a?Ene(a,f):null}}}function Ib(e){let t={},n=!1;for(let r in e.children){let i=Ib(e.children[r]);i&&(t[r]=i,n=!0)}return e.type||n?{...e,children:t}:null}function Lb(e,t,n){return Fb()({target:e,source:t,customizer:n}).result}function Rb(e,t,n){let{result:r,diff:i}=Fb({trackDiff:!0})({target:e,source:t,customizer:n});return{result:r,diff:Ib(i??{children:{}})||{children:{}}}}var zb=({message:e})=>({attachments:(e?.attachments??[])?.filter(({og_scrape_url:e})=>!e).map(e=>{let t=pne(e)?{id:Fy(),uploadState:`finished`}:{id:Fy()};return{...e,localMetadata:t}})}),Bb=class e{constructor({composer:t,message:n}){this.setCustomUploadFn=e=>{this.composer.updateConfig({attachments:{doUploadRequest:e}})},this.cancelAttachmentUploads=(e=this.attachments)=>{for(let{localMetadata:t}of e)this.client.uploadManager.deleteUploadRecord(t.id)},this.normalizeSnapshotAttachment=e=>e.localMetadata.uploadState===`uploading`?(this.client.uploadManager.deleteUploadRecord(e.localMetadata.id),{...e,localMetadata:{...e.localMetadata,uploadProgress:void 0,uploadState:`failed`}}):e,this.initState=({message:e}={})=>{this.state.next(zb({message:e}))},this.getSnapshot=()=>{let e=this.state.getLatestValue(),t=!1,n=e.attachments.map(this.normalizeSnapshotAttachment);for(let r=0;r<n.length;r++)if(n[r]!==e.attachments[r]){t=!0;break}return t?{...e,attachments:n}:e},this.restoreSnapshot=e=>{this.cancelAttachmentUploads(this.attachments),this.state.next(e)},this.setAttachments=e=>{this.state.partialNext({attachments:e})},this.clearAttachments=()=>{this.attachments.length&&this.removeAttachments(this.attachments.map(e=>e.localMetadata.id))},this.getAttachmentIndex=e=>{let t=this.attachmentsById;return this.attachments.indexOf(t[e])},this.prepareAttachmentUpdate=e=>{let t=this.attachments,n=[...this.attachments],r=this.getAttachmentIndex(e.localMetadata.id);if(r===-1)return null;let i=Rb(t[r],e);if(i.diff&&Object.keys(i.diff.children).length){let e=Ob(i.result);if(e)return n.splice(r,1,e),n}return t},this.updateAttachment=e=>{let t=this.prepareAttachmentUpdate(e);t&&t!==this.attachments&&this.state.partialNext({attachments:t})},this.upsertAttachments=e=>{if(!e.length)return;let t=[...this.attachments],n=!1;e.forEach(e=>{let r=this.prepareAttachmentUpdate(e);if(r===null){let r=Ob(e);r&&(t.push(r),n=!0)}else r!==this.attachments&&(t=r,n=!0)}),n&&this.state.partialNext({attachments:t})},this.removeAttachments=e=>{if(e.length){this.state.partialNext({attachments:this.attachments.filter(t=>!e.includes(t.localMetadata?.id))});for(let t of e)this.client.uploadManager.deleteUploadRecord(t)}},this.getUploadConfigCheck=async e=>{let t=this.channel.getClient(),n;n=t.appSettingsPromise?await t.appSettingsPromise:await t.getAppSettings();let r=Db(e)?n?.app?.image_upload_config:n?.app?.file_upload_config;if(!r)return{uploadBlocked:!1};let{allowed_file_extensions:i,allowed_mime_types:a,blocked_file_extensions:o,blocked_mime_types:s,size_limit:c}=r,l=c||by,u=e.type;if(Cb(e)||wb(e)){if(i?.length&&!i.some(t=>e.name.toLowerCase().endsWith(t.toLowerCase())))return{uploadBlocked:!0,reason:`allowed_file_extensions`};if(o?.length&&o.some(t=>e.name.toLowerCase().endsWith(t.toLowerCase())))return{uploadBlocked:!0,reason:`blocked_file_extensions`}}return a?.length&&!a.some(e=>e.toLowerCase()===u?.toLowerCase())?{uploadBlocked:!0,reason:`allowed_mime_types`}:s?.length&&s.some(e=>e.toLowerCase()===u?.toLowerCase())?{uploadBlocked:!0,reason:`blocked_mime_types`}:e.size&&e.size>l?{uploadBlocked:!0,reason:`size_limit`}:{uploadBlocked:!1}},this.fileToLocalUploadAttachment=async t=>{let n=e.toLocalUploadAttachment(t),r=await this.getUploadConfigCheck(n.localMetadata.file);return n.localMetadata.uploadPermissionCheck=r,n.localMetadata.uploadState=r.uploadBlocked?`blocked`:`pending`,n},this.ensureLocalUploadAttachment=async e=>{if(!e.localMetadata?.file){this.client.notifications.addError({message:`File is required for upload attachment`,origin:{emitter:`AttachmentManager`,context:{attachment:e}},options:{type:`validation:attachment:file:missing`}}
425);return}if(!e.localMetadata.id){this.client.notifications.addError({message:`Local upload attachment missing local id`,origin:{emitter:`AttachmentManager`,context:{attachment:e}},options:{type:`validation:attachment:id:missing`}});return}if(!this.fileUploadFilter(e))return;let t=await this.fileToLocalUploadAttachment(e.localMetadata.file);return e.localMetadata.id&&(t.localMetadata.id=e.localMetadata.id),t},this.doDefaultUploadRequest=async(e,t)=>{let n=t?.onProgress?e=>{let n=e.lengthComputable&&e.total?Math.round(e.loaded*100/e.total):void 0;t.onProgress?.(n)}:void 0,r=n||t?.abortSignal?{...n?{onUploadProgress:n}:{},...t?.abortSignal?{signal:t.abortSignal}:{}}:void 0;if(wb(e))return this.channel[Db(e)?`sendImage`:`sendFile`](e.uri,e.name,e.type,void 0,r);let i=Cb(e)?e:Tb({blobsArray:[e],fileName:Eb(e.type),mimeType:e.type}),{duration:a,...o}=await this.channel[Db(e)?`sendImage`:`sendFile`](i,void 0,void 0,void 0,r);return o},this.doUploadRequest=async(e,t)=>{let n=this.config.doUploadRequest;return n?await n(e,t):this.doDefaultUploadRequest(e,t)},this.uploadAttachment=async e=>{if(!this.isUploadEnabled)return;let t=await this.ensureLocalUploadAttachment(e);if(t===void 0)return;if(t.localMetadata.uploadState===`blocked`)return this.upsertAttachments([t]),this.client.notifications.addError({message:`The attachment upload was blocked`,origin:{emitter:`AttachmentManager`,context:{attachment:e,blockedAttachment:t}},options:{type:`validation:attachment:upload:blocked`,metadata:{reason:t.localMetadata.uploadPermissionCheck?.reason}}}),t;let n;try{n=await this.upload(e)}catch(t){let n=t instanceof Error?t.message:`unknown error`,r={...e,localMetadata:{...e.localMetadata,uploadState:`failed`,uploadProgress:void 0}};return this.client.notifications.addError({message:`Error uploading attachment`,origin:{emitter:`AttachmentManager`,context:{attachment:e,failedAttachment:r}},options:{type:`api:attachment:upload:failed`,metadata:{reason:n},originalError:t instanceof Error?t:void 0}}),this.updateAttachment(r),r}if(!n){this.removeAttachments([e.localMetadata.id]);return}let r={...e,localMetadata:{...e.localMetadata,uploadState:`finished`,uploadProgress:void 0}},i=r.localMetadata.previewUri;return i&&(i.startsWith(`blob:`)&&URL.revokeObjectURL(i),delete r.localMetadata.previewUri),hb(r)?r.image_url=n.file:r.asset_url=n.file,n.thumb_url&&(r.thumb_url=n.thumb_url),this.updateAttachment(r),r},this.uploadFile=async t=>{let n=await this.preUploadMiddlewareExecutor.execute({eventName:`prepare`,initialValue:{attachment:e.toLocalUploadAttachment(t)},mode:`concurrent`}),r=n.state.attachment;if(n.status===`discard`||!this.fileUploadFilter(r))return r;if(r.localMetadata.uploadState===`blocked`)return this.upsertAttachments([r]),n.state.attachment;let i,a;try{i=await this.upload(r)}catch(e){a=e instanceof Error?e:void 0}let o=await this.postUploadMiddlewareExecutor.execute({eventName:`postProcess`,initialValue:{attachment:{...r,localMetadata:{...r.localMetadata,uploadState:a?`failed`:`finished`,uploadProgress:void 0}},error:a,response:i},mode:`concurrent`});return r=o.state.attachment,o.status===`discard`?(this.removeAttachments([r.localMetadata.id]),r):(this.updateAttachment(r),r)},this.uploadFiles=async e=>{if(!this.isUploadEnabled)return;let t=mne(e)?Array.from(e):e;return await Promise.all(t.slice(0,this.availableUploadSlots).map(this.uploadFile))},this.composer=t,this.state=new sb(zb({message:n})),this.attachmentsByIdGetterCache={attachmentsById:{},attachments:[]},this.preUploadMiddlewareExecutor=new Tne({composer:t}),this.postUploadMiddlewareExecutor=new Sne({composer:t})}get attachmentsById(){let{attachments:e}=this.state.getLatestValue();return e!==this.attachmentsByIdGetterCache.attachments&&(this.attachmentsByIdGetterCache.attachments=e,this.attachmentsByIdGetterCache.attachmentsById=e.reduce((e,t)=>{var n;return t.localMetadata.id&&(e[n=t.localMetadata.id]??(e[n]=t)),e},{})),this.attachmentsByIdGetterCache.attachmentsById}get client(){return this.composer.client}get channel(){return this.composer.channel}get config(){return this.composer.config.attachments}get acceptedFiles(){return this.config.acceptedFiles}set acceptedFiles(e){this.composer.updateConfig({attachments:{acceptedFiles:e}})}get fileUploadFilter(){return this.config.fileUploadFilter}set fileUploadFilter(e){this.composer.updateConfig({attachments:{fileUploadFilter:e}})}get maxNumberOfFilesPerMessage(){return this.config.maxNumberOfFilesPerMessage}set maxNumberOfFilesPerMessage(e){e!==this.maxNumberOfFilesPerMessage&&this.composer.updateConfig({attachments:{maxNumberOfFilesPerMessage:e}})}get attachments(){return this.state.getLatestValue().attachments}get hasUploadPermission(){return!!this.channel.data?.own_capabilities?.includes(`upload-file`)}get isUploadEnabled(){return this.hasUploadPermission&&this.availableUploadSlots>0}get successfulUploads(){return this.getUploadsByState(`finished`)}get successfulUploadsCount(){return this.successfulUploads.length}get uploadsInProgressCount(){return this.getUploadsByState(`uploading`).length}get failedUploadsCount(){return this.getUploadsByState(`failed`).length}get blockedUploadsCount(){return this.getUploadsByState(`blocked`).length}get pendingUploadsCount(){return this.getUploadsByState(`pending`).length}get availableUploadSlots(){return this.config.maxNumberOfFilesPerMessage-this.successfulUploadsCount-this.uploadsInProgressCount}getUploadsByState(e){return Object.values(this.attachments).filter(({localMetadata:t})=>t.uploadState===e)}upload(e){let t=e.localMetadata.id;this.upsertAttachments([{...e,localMetadata:{...e.localMetadata,uploadState:`uploading`,uploadProgress:this.config.trackUploadProgress?0:void 0}}]);let n=this.client.uploadManager.state.subscribeWithSelector(e=>({upload:e.uploads[t]}),({upload:t})=>{t&&this.updateAttachment({...e,localMetadata:{...e.localMetadata,uploadState:`uploading`,uploadProgress:t.uploadProgress}})});return this.client.uploadManager.upload({id:t,channelCid:this.channel.cid,file:e.localMetadata.file}).finally(()=>{n()})}};Bb.toLocalUploadAttachment=e=>{let t=wb(e)||Cb(e)?e:Tb({blobsArray:[e],fileName:Eb(e.type),mimeType:e.type}
425),n={file_size:t.size,mime_type:t.type,localMetadata:{file:t,id:Fy(),uploadState:`pending`},type:_ne(t.type)};return n[Db(t)?`fallback`:`title`]=t.name,n.localMetadata.previewUri=wb(e)?e.uri:URL.createObjectURL?.(e),wb(e)&&e.height&&e.width&&Db(t)&&(n.original_height=e.height,n.original_width=e.width),wb(e)&&e.thumb_url&&(n.thumb_url=e.thumb_url),wb(e)&&e.duration&&(n.duration=e.duration),n};var Dne=Bb,Vb=e=>{let{localMetadata:t,...n}=e;return n},One=e=>({id:`stream-io/message-composer-middleware/attachments`,handlers:{compose:({state:t,next:n,discard:r,forward:i})=>{let{attachmentManager:a}=e;if(!a)return i();if(a.uploadsInProgressCount>0)return e.client.notifications.addWarning({message:`Wait until all attachments have uploaded`,origin:{emitter:`MessageComposer`,context:{composer:e}},options:{type:`validation:attachment:upload:in-progress`}}),r();let o=(t.message.attachments??[]).concat(a.successfulUploads.map(Vb));return o.length?n({...t,localMessage:{...t.localMessage,attachments:o},message:{...t.message,attachments:o}}):i()}}}),kne=e=>({id:`stream-io/message-composer-middleware/draft-attachments`,handlers:{compose:({state:t,next:n,forward:r})=>{let{attachmentManager:i}=e;if(!i)return r();let a=i.successfulUploads,o=a.length?(t.draft.attachments??[]).concat(a.map(Vb)):void 0;return n({...t,draft:{...t.draft,attachments:o}})}}}),Ane=e=>({id:`stream-io/message-composer-middleware/data-cleanup`,handlers:{compose:({state:t,next:n})=>{let r={type:!e.editedMessage?.type||e.editedMessage.type===`error`?`regular`:e.editedMessage.type},i=e.editedMessage?zy(e.editedMessage):void 0;return n({...t,localMessage:Ry({...e.editedMessage,...t.localMessage,...r}),message:{...i,...t.message,...r},sendOptions:e.editedMessage&&t.sendOptions?.skip_enrich_url?{skip_enrich_url:t.sendOptions?.skip_enrich_url}:t.sendOptions})}}}),jne=e=>({id:`stream-io/message-composer-middleware/custom-data`,handlers:{compose:({state:t,next:n,forward:r})=>{let i=e.customDataManager.customMessageData;return i?n({...t,localMessage:{...t.localMessage,...i},message:{...t.message,...i}}):r()}}}),Mne=e=>({id:`stream-io/message-composer-middleware/draft-custom-data`,handlers:{compose:({state:t,next:n,forward:r})=>{let i=e.customDataManager.customMessageData;return i?n({...t,draft:{...t.draft,...i}}):r()}}}),Hb=e=>e.mentionType===`user`,Ub=e=>({...e,mentionType:`user`}),Nne=e=>e.map(Ub),Wb=e=>{let{mentionType:t,...n}=e;return n},Gb=e=>{let{mentionType:t,tokenizedDisplayName:n,...r}=e;return r},Pne=e=>Ub(Gb(e)),Kb=e=>{let t=e.trim();return t===``||t===`>`||t==="``````"||t==="``"||t===`**`||t===`____`||t===`__`||t===`****`},Fne=e=>{if(!e)return[];let t=(e.mentioned_users??[]).map(e=>typeof e==`string`?{id:e,mentionType:`user`}:{...e,mentionType:`user`});return e.mentioned_channel&&t.push({id:`channel`,mentionType:`channel`,name:`channel`}),e.mentioned_here&&t.push({id:`here`,mentionType:`here`,name:`here`}),e.mentioned_roles?.length&&t.push(...e.mentioned_roles.map(e=>({id:e,mentionType:`role`,name:e}))),e.mentioned_groups?.length?t.push(...e.mentioned_groups.map(e=>({id:e.id,mentionType:`user_group`,name:e.name}))):e.mentioned_group_ids?.length&&t.push(...e.mentioned_group_ids.map(e=>({id:e,mentionType:`user_group`}))),t},Ine=(e,t)=>e.id===t.id&&e.mentionType===t.mentionType,Lne=e=>e.mentions??e.mentionedUsers.map(Ub),qb=({composer:e,message:t})=>{if(!t){let t=e.config.text.defaultValue??``;return{command:null,mentionedUsers:[],mentions:[],text:t,selection:{start:t.length,end:t.length}}}let n=t.text??``,r=Fne(t);return{mentionedUsers:(t.mentioned_users??[]).map(e=>typeof e==`string`?{id:e}:e),mentions:r,text:n,selection:{start:n.length,end:n.length}}},Rne=class{constructor({composer:e,message:t}){this.initState=({message:e}={})=>{this.state.next(qb({composer:this.composer,message:e}))},this.getSnapshot=(e=this.state.getLatestValue())=>e,this.restoreSnapshot=e=>{this.state.next(e)},this.upsertMentionedUser=e=>{let t=[...this.mentionedUsers],n=t.findIndex(t=>t.id===e.id);n>=0?(t.splice(n,1,e),this.setMentionedUsers(t)):(t.push(e),this.setMentionedUsers(t))},this.getMentionedUser=e=>this.mentionedUsers.find(t=>
425t.id===e),this.removeMentionedUser=e=>{let t=this.mentionedUsers.findIndex(t=>t.id===e);if(t===-1)return;let n=[...this.mentionedUsers];n.splice(t,1),this.setMentionedUsers(n)},this.upsertMentionEntity=e=>{let t=[...this.mentions],n=t.findIndex(t=>Ine(t,e));n>=0?t.splice(n,1,e):t.push(e),this.setMentions(t)},this.getMentionEntity=(e,t)=>this.mentions.find(n=>n.mentionType===e&&n.id===t),this.removeMentionEntity=(e,t)=>{let n=this.mentions.findIndex(n=>n.mentionType===e&&n.id===t);if(n===-1)return;let r=[...this.mentions];r.splice(n,1),this.setMentions(r)},this.setCommand=e=>{if(!e){this.clearCommand();return}if(e.name===this.command?.name||this.composer.isCommandDisabled(e))return;let t={command:null};this.commitState({...this.state.getLatestValue(),command:e,effects:[{command:e,stateToRestore:t,type:`command.activate`}],suggestions:void 0})},this.setText=e=>{!this.enabled||e===this.text||this.state.partialNext({text:e})},this.setSelection=e=>{let t=e.start!==this.selection.start||e.end!==this.selection.end;!this.enabled||!t||this.state.partialNext({selection:e})},this.insertText=async({text:e,selection:t})=>{if(!this.enabled)return;let n=e.replace(/\r\n/g,`
426`),r=t??this.selection,{maxLengthOnEdit:i}=this.composer.config.text??{},a=this.text,o=[a.slice(0,r.start),n,a.slice(r.end)].join(``),s=o.slice(0,typeof i==`number`?i:o.length),c=r.start+n.length,l=Math.min(c,s.length);await this.handleChange({text:s,selection:{start:l,end:l}})},this.wrapSelection=({head:e=``,selection:t,tail:n=``})=>{if(!this.enabled)return;let r=t??this.selection,i=this.text.slice(0,r.start),a=this.text.slice(r.start,r.end),o=this.text.slice(r.end),s={start:i.length+e.length,end:i.length+e.length+a.length};this.state.partialNext({text:[i,e,a,n,o].join(``),selection:s})},this.setSuggestions=e=>{this.state.partialNext({suggestions:e})},this.closeSuggestions=()=>{let{suggestions:e}=this.state.getLatestValue();e&&this.state.partialNext({suggestions:void 0})},this.commitState=e=>{let{change:t,effects:n,...r}=e;this.state.next(r),this.composer.applyEffects(n)},this.handleChange=async({text:e,selection:t})=>{if(!this.enabled)return;let n=await this.middlewareExecutor.execute({eventName:`onChange`,initialValue:{...this.state.getLatestValue(),text:e,selection:t}});n.status!==`discard`&&(this.commitState(n.state),this.config.publishTypingEvents&&e&&Dy(this.channel.keystroke(this.composer.threadId??void 0),`start typing event`))},this.handleSelect=async e=>{if(!this.enabled)return;let t=await this.middlewareExecutor.execute({eventName:`onSuggestionItemSelect`,initialValue:{...this.state.getLatestValue(),change:{selectedSuggestion:e}}});t?.status!==`discard`&&this.commitState(t.state)},this.composer=e,this.state=new sb(qb({composer:e,message:t})),this.middlewareExecutor=new Qx({composer:e})}get channel(){return this.composer.channel}get config(){return this.composer.config.text}get enabled(){return this.composer.config.text.enabled}set enabled(e){e!==this.enabled&&this.composer.updateConfig({text:{enabled:e}})}get defaultValue(){return this.composer.config.text.defaultValue}set defaultValue(e){e!==this.defaultValue&&this.composer.updateConfig({text:{defaultValue:e}})}get maxLengthOnEdit(){return this.composer.config.text.maxLengthOnEdit}set maxLengthOnEdit(e){e!==this.maxLengthOnEdit&&this.composer.updateConfig({text:{maxLengthOnEdit:e}})}get maxLengthOnSend(){return this.composer.config.text.maxLengthOnSend}set maxLengthOnSend(e){e!==this.maxLengthOnSend&&this.composer.updateConfig({text:{maxLengthOnSend:e}})}get publishTypingEvents(){return this.composer.config.text.publishTypingEvents}set publishTypingEvents(e){e!==this.publishTypingEvents&&this.composer.updateConfig({text:{publishTypingEvents:e}})}get command(){return this.state.getLatestValue().command}get mentionedUsers(){return this.state.getLatestValue().mentionedUsers}get mentions(){return Lne(this.state.getLatestValue())}get selection(){return this.state.getLatestValue().selection}get suggestions(){return this.state.getLatestValue().suggestions}get text(){return this.state.getLatestValue().text}get textIsEmpty(){return Kb(this.text)}setMentionedUsers(e){let t=this.mentions.filter(e=>!Hb(e));this.state.partialNext({mentionedUsers:e,mentions:[...t,...e.map(Ub)]})}
426setMentions(e){this.state.partialNext({mentionedUsers:e.filter(Hb).map(Wb),mentions:e})}clearCommand(){this.command&&this.commitState({...this.state.getLatestValue(),command:null,effects:[{type:`command.clear`}]})}},zne={"-1":{name:`InternalSystemError`,retryable:!0},2:{name:`AccessKeyError`,retryable:!1},3:{name:`AuthenticationFailedError`,retryable:!0},4:{name:`InputError`,retryable:!1},6:{name:`DuplicateUsernameError`,retryable:!1},9:{name:`RateLimitError`,retryable:!0},16:{name:`DoesNotExistError`,retryable:!1},17:{name:`NotAllowedError`,retryable:!1},18:{name:`EventNotSupportedError`,retryable:!1},19:{name:`ChannelFeatureNotSupportedError`,retryable:!1},20:{name:`MessageTooLongError`,retryable:!1},21:{name:`MultipleNestingLevelError`,retryable:!1},22:{name:`PayloadTooBigError`,retryable:!1},23:{name:`RequestTimeoutError`,retryable:!0},24:{name:`MaxHeaderSizeExceededError`,retryable:!1},40:{name:`AuthErrorTokenExpired`,retryable:!1},41:{name:`AuthErrorTokenNotValidYet`,retryable:!1},42:{name:`AuthErrorTokenUsedBeforeIssuedAt`,retryable:!1},43:{name:`AuthErrorTokenSignatureInvalid`,retryable:!1},44:{name:`CustomCommandEndpointMissingError`,retryable:!1},45:{name:`CustomCommandEndpointCallError`,retryable:!0},46:{name:`ConnectionIDNotFoundError`,retryable:!1},60:{name:`CoolDownError`,retryable:!0},69:{name:`ErrWrongRegion`,retryable:!1},70:{name:`ErrQueryChannelPermissions`,retryable:!1},71:{name:`ErrTooManyConnections`,retryable:!0},99:{name:`AppSuspendedError`,retryable:!1}};function Jb(e){return e.code!==void 0}function Yb(e){if(!e.code)return!1;let t=zne[`${e.code}`];return t?t.retryable:!1}function Bne(e){return e.code===46}function Vne(e){if(typeof e.isWSFailure==`boolean`)return e.isWSFailure;try{return JSON.parse(e.message).isWSFailure}catch{return!1}}function Hne(e){return!e.status||e.status<200||300<=e.status}var Xb={debounceMs:300,pageSize:10,allowEmptySearchString:!1,resetOnNewSearchQuery:!0},Zb=class{constructor(e){this.activate=()=>{this.isActive||this.state.partialNext({isActive:!0})},this.deactivate=()=>{this.isActive&&this.state.partialNext({isActive:!1})},this.canExecuteQuery=e=>{let t=e!==void 0,n=e??this.searchQuery;return!!(this.isActive&&!this.isLoading&&(this.hasNext||t)&&(this.allowEmptySearchString||n))};let{pageSize:t,allowEmptySearchString:n,resetOnNewSearchQuery:r}={...Xb,...e};this.pageSize=t,this.allowEmptySearchString=n,this.resetOnNewSearchQuery=r,this.state=new sb(this.initialState)}get lastQueryError(){return this.state.getLatestValue().lastQueryError}get hasNext(){return this.state.getLatestValue().hasNext}get hasResults(){return Array.isArray(this.state.getLatestValue().items)}get isActive(){return this.state.getLatestValue().isActive}get isLoading(){return this.state.getLatestValue().isLoading}get initialState(){return{hasNext:!0,isActive:!1,isLoading:!1,items:void 0,lastQueryError:void 0,next:void 0,offset:0,searchQuery:``}}get items(){return this.state.getLatestValue().items}get next(){return this.state.getLatestValue().next}get offset(){return this.state.getLatestValue().offset}get searchQuery(){return this.state.getLatestValue().searchQuery}getStateBeforeFirstQuery(e){let t=this.initialState,n=this.items,r=this.resetOnNewSearchQuery?t.items:n;return{...t,items:r,isActive:this.isActive,isLoading:this.resetOnNewSearchQuery?!0:!n,searchQuery:e}}getStateAfterQuery(e,t){return{...this.state.getLatestValue(),lastQueryError:void 0,...e,isLoading:!1,items:t?e.items:[...this.items??[],...e.items||[]]}}prepareStateForQuery(e){let t=e!==void 0,n=e??this.searchQuery;return t?this.state.next(this.getStateBeforeFirstQuery(e??``)):this.state.partialNext({isLoading:!0}),{searchString:n,hasNewSearchQuery:t}}updatePaginationStateFromQuery(e){let{items:t,next:n}=e,r={};return Object.prototype.hasOwnProperty.call(e,`next`)?(r.next=n,r.hasNext=!!n):(r.offset=(this.offset??0)+t.length,r.hasNext=t.length===this.pageSize),r}resetState(){this.state.next(this.initialState)}resetStateAndActivate(){this.resetState(),this.activate()}},Qb=class extends Zb{constructor(e){let{debounceMs:t}={...Xb,...e};super(e),this.setDebounceOptions=({debounceMs:e})=>{this.searchDebounced=Wy(this.executeQuery.bind(this),e)},this.search=e=>this.searchDebounced(e),this.setDebounceOptions({debounceMs:t})}async executeQuery(e){if(!this.canExecuteQuery(e))return;let{hasNewSearchQuery:t,searchString:n}=this.prepareStateForQuery(e),r={};try{let e=await this.query(n);if(!e)return;let{items:t}=e;r=this.updatePaginationStateFromQuery(e),r.items=await this.filterQueryResults(t)}catch(e){r.lastQueryError=e,Jb(e)&&!Yb(e)&&(r.hasNext=!1)}finally{this.state.next(this.getStateAfterQuery(r,t))}}cancelScheduledQuery(){this.searchDebounced.cancel()}},Une=class extends Zb{constructor(e){let{debounceMs:t}={...Xb,...e};super(e),this.setDebounceOptions=({debounceMs:e})=>{this.searchDebounced=Wy(this.executeQuery.bind(this),e)},this.search=e=>this.searchDebounced(e),this.setDebounceOptions({debounceMs:t})}executeQuery(e){if(!this.canExecuteQuery(e))return;let{hasNewSearchQuery:t,searchString:n}=this.prepareStateForQuery(e),r={};try{let e=this.query(n);if(!e)return;let{items:t}=e;r=this.updatePaginationStateFromQuery(e),r.items=this.filterQueryResults(t)}catch(e){r.lastQueryError=e,Jb(e)&&!Yb(e)&&(r.hasNext=!1)}finally{this.state.next(this.getStateAfterQuery(r,t))}}cancelScheduledQuery(){this.searchDebounced.cancel()}},Wne={debounceMs:300,pageSize:10},Gne=class{constructor(e){this._isCursorPagination=!1,this.setDebounceOptions=({debounceMs:e})=>{this._executeQueryDebounced=Wy(this.executeQuery.bind(this),e)},this.canExecuteQuery=e=>!this.isLoading&&e===`next`&&this.hasNext||e===`prev`&&this.hasPrev,this.next=()=>this.executeQuery({direction:`next`}),this.prev=()=>this.executeQuery({direction:`prev`}),this.nextDebounced=()=>{this._executeQueryDebounced({direction:`next`})},this.prevDebounced=()=>{this._executeQueryDebounced({direction:`prev`})};let{debounceMs:t,pageSize:n}={...Wne,...e};this.pageSize=n,this.state=new sb(this.initialState),this.setDebounceOptions({debounceMs:t})}get lastQueryError(){return this.state.getLatestValue().lastQueryError}get hasNext(){return this.state.getLatestValue().hasNext}get hasPrev(){return this.state.getLatestValue().hasPrev}get hasResults(){return Array.isArray(this.state.getLatestValue().items)}get isLoading(){return this.state.getLatestValue().isLoading}get initialState(){return{hasNext:!0,hasPrev:!0,isLoading:!1,items:void 0,lastQueryError:void 0,cursor:void 0,offset:0}}get items(){return this.state.getLatestValue().items}
426get cursor(){return this.state.getLatestValue().cursor}get offset(){return this.state.getLatestValue().offset}getStateBeforeFirstQuery(){return{...this.initialState,isLoading:!0}}getStateAfterQuery(e,t){return{...this.state.getLatestValue(),lastQueryError:void 0,...e,isLoading:!1,items:t?e.items:[...this.items??[],...e.items||[]]}}async executeQuery({direction:e}){if(!this.canExecuteQuery(e))return;let t=this.items===void 0;t?this.state.next(this.getStateBeforeFirstQuery()):this.state.partialNext({isLoading:!0});let n={};try{let r=await this.query({direction:e});if(!r)return;let{items:i,next:a,prev:o}=r;t&&(a||o)&&(this._isCursorPagination=!0),this._isCursorPagination?(n.cursor={next:a||null,prev:o||null},n.hasNext=!!a,n.hasPrev=!!o):(n.offset=(this.offset??0)+i.length,n.hasNext=i.length===this.pageSize),n.items=await this.filterQueryResults(i)}catch(e){n.lastQueryError=e}finally{this.state.next(this.getStateAfterQuery(n,t))}}cancelScheduledQuery(){this._executeQueryDebounced.cancel()}resetState(){this.state.next(this.initialState)}},$b=class{constructor(e){this.context=new sb(e?.initialContext??{}),this.filterConfig=new sb(e?.initialFilterConfig??{})}updateFilterConfig(e){this.filterConfig.partialNext(e)}enableFilter(e){let t=this.filterConfig.getLatestValue();t[e]&&this.filterConfig.partialNext({[e]:{...t[e],enabled:!0}})}disableFilter(e){let t=this.filterConfig.getLatestValue();t[e]&&this.filterConfig.partialNext({[e]:{...t[e],enabled:!1}})}updateContext(e){this.context.partialNext(e)}buildFilters(e){let t={...e?.baseFilters??{}},n=this.filterConfig.getLatestValue();for(let r in n){let i=n[r];if(!i?.enabled)continue;let a=i.generate({...this.context.getLatestValue(),...e?.context??{}});a&&Object.assign(t,a)}return t}},Kne=class extends Gne{constructor(e,t){super(t),this.query=async({direction:e})=>{let t=this.cursor?.[e],{reminders:n,next:r,prev:i}=await this.client.queryReminders({filter:this.filters,sort:this.sort,limit:this.pageSize,[e]:t});return{items:n,next:r,prev:i}},this.filterQueryResults=e=>e,this.client=e}get filters(){return this._filters}get sort(){return this._sort}set filters(e){this._filters=e,this.resetState()}set sort(e){this._sort=e,this.resetState()}},qne=class{constructor({config:e,sources:t}={}){this.addSource=e=>{this.state.partialNext({sources:[...this.sources,e]})},this.getSource=e=>this.sources.find(t=>t.type===e),this.removeSource=e=>{let t=this.sources.filter(t=>t.type!==e);t.length!==this.sources.length&&this.state.partialNext({sources:t})},this.activateSource=e=>{let t=this.getSource(e);!t||t.isActive||(this.config.keepSingleActiveSource&&this.sources.forEach(t=>{t.type!==e&&t.deactivate()}),t.activate(),this.state.partialNext({sources:[...this.sources]}))},this.deactivateSource=e=>{let t=this.getSource(e);t?.isActive&&this.activeSources.length!==1&&(t.deactivate(),this.state.partialNext({sources:[...this.sources]}))},this.activate=()=>{this.activeSources.length||(this.config.keepSingleActiveSource?this.sources.slice(0,1):this.sources).forEach(e=>e.activate()),!this.isActive&&this.state.partialNext({isActive:!0})},this.search=async e=>{let t=this.activeSources;this.state.partialNext({searchQuery:e}),await Promise.all(t.map(t=>t.search(e)))},this.cancelSearchQueries=()=>{this.activeSources.forEach(e=>e.cancelScheduledQuery())},this.clear=()=>{this.cancelSearchQueries(),this.sources.forEach(e=>e.state.next({...e.initialState,isActive:e.isActive})),this.state.next(e=>({...e,isActive:!0,queriesInProgress:[],searchQuery:``}))},this.exit=()=>{this.cancelSearchQueries(),this.sources.forEach(e=>e.state.next({...e.initialState,isActive:e.isActive})),this.state.next(e=>({...e,isActive:!1,queriesInProgress:[],searchQuery:``}))},this.state=new sb({isActive:!1,searchQuery:``,sources:t??[]}),this._internalState=new sb({}),this.config={keepSingleActiveSource:!0,...e}}get hasNext(){return this.sources.some(e=>e.hasNext)}get sources(){return this.state.getLatestValue().sources}get activeSources(){return this.state.getLatestValue().sources.filter(e=>e.isActive)}get isActive(){return this.state.getLatestValue().isActive}get searchQuery(){return this.state.getLatestValue().searchQuery}get searchSourceTypes(){return this.sources.map(e=>e.type)}},Jne=class extends Qb{constructor(e,t,n={}){super(t),this.type=`users`,this.client=e,this.filterBuilder=new $b({initialFilterConfig:{$or:{enabled:!0,generate:({searchQuery:e})=>e?{$or:[{id:{$autocomplete:e}},{name:{$autocomplete:e}}]}:null}},...n})}async query(e){let t=this.filterBuilder.buildFilters({baseFilters:this.filters,context:{searchQuery:e}}),n;n=Array.isArray(this.sort)?this.sort.some(e=>`id`in e)?this.sort:[...this.sort,{id:1}]:{id:1,...this.sort};let r={...this.searchOptions,limit:this.pageSize,offset:this.offset},{users:i}=await this.client.queryUsers(t,n,r);return{items:i}}filterQueryResults(e){return e.filter(e=>e.id!==this.client.user?.id)}},Yne=class extends Qb{constructor(e,t,n={}){super(t),this.type=`channels`,this.client=e,this.filterBuilder=new $b({...n,initialFilterConfig:{name:{enabled:!0,generate:({searchQuery:e})=>e?{name:{$autocomplete:e}}:null},...n.initialFilterConfig}})}async query(e){let t=this.filterBuilder.buildFilters({baseFilters:{...this.client.userID?{members:{$in:[this.client.userID]}}:{},...this.filters},context:{searchQuery:e}}),n=this.sort??{},r={...this.searchOptions,limit:this.pageSize,offset:this.offset};return{items:await this.client.queryChannels(t,n,r)}}filterQueryResults(e){return e}},Xne=class extends Qb{constructor(e,t,n){super(t),this.type=`messages`,this.client=e,this.messageSearchChannelFilterBuilder=new $b(n?.messageSearchChannel),this.messageSearchFilterBuilder=new $b({...n?.messageSearch,initialFilterConfig:{text:{enabled:!0,generate:({searchQuery:e})=>e?{text:e}:null},...n?.messageSearch?.initialFilterConfig}}),this.channelQueryFilterBuilder=new $b({...n?.channelQuery,initialFilterConfig:{cid:{enabled:!0,generate:({cids:e})=>e?{cid:{$in:e}}:null},...n?.channelQuery?.initialFilterConfig}})}async query(e){if(!this.client.userID||this.next===null)return{items:[]};let t=this.messageSearchChannelFilterBuilder.buildFilters({baseFilters:{...this.client.userID?{members:{$in:[this.client.userID]}}:{},...this.messageSearchChannelFilters},context:{searchQuery:e}}),n=this.messageSearchFilterBuilder.buildFilters({baseFilters:{type:`regular`,...this.messageSearchFilters},context:{searchQuery:e}}),r={created_at:-1,...this.messageSearchSort},i={limit:this.pageSize,next:this.next,sort:r},{next:a,results:o}=await this.client.search(t,n,i),s=o.map(({message:e})=>e),c=Array.from(s.reduce((e,t)=>
426(t.cid&&!this.client.activeChannels[t.cid]&&e.add(t.cid),e),new Set));if(c.length>0){let e=this.channelQueryFilterBuilder.buildFilters({baseFilters:this.channelQueryFilters,context:{cids:c}});await this.client.queryChannels(e,{last_message_at:-1,...this.channelQuerySort},this.channelQueryOptions)}return{items:s,next:a}}filterQueryResults(e){return e}};function ex(e){return e.replace(/[-[\]{}()*+?.,/\\^$|#]/g,`\\$&`)}var tx=e=>e?.match(/^\/(\S+)(?:\s.*)?$/)?.[1],Zne=e=>{let t=e.match(/^\/(\S+)\s+.*/);return t&&t[1]},Qne=(e,t)=>e.replace(RegExp(`^${ex(`/${t}`)}\\s*`),``),$ne=(e,t,n=`@`)=>t.reduce((e,t)=>{let r=e.replace(`${n}${t.id}`,``);return t.name&&(r=r.replace(`${n}${t.name}`,``)),r.trim()},e.trim()),nx=(e,t)=>Array.from(new Set(t.filter(({id:t,name:n})=>e.includes(`@${t}`)||!!n&&e.includes(`@${n}`)))),rx=(e,t)=>{if(!t)return;let n=t.toLowerCase();return e.query(n).items.find(e=>e.name?.toLowerCase()===n)},ix=(e,t)=>{let n=e.getCommandDisabledReason(t);if(n)return e.client.notifications.addWarning({message:n===`editing`?`Command not available while editing`:`Command not available while replying`,origin:{emitter:`MessageComposer`,context:{command:t,composer:e}},options:{type:`validation:command:disabled`,metadata:{command:t.name,reason:n}}}),!0},ere=({composer:e,sendability:t})=>{if(!t.ready)return e.client.notifications.addWarning({message:`Command not ready to be sent`,origin:{emitter:`MessageComposer`,context:{command:t.command,composer:e}},options:{type:`validation:command:not-ready`,metadata:{command:t.command.name,...t.reason?{reason:t.reason}:{},...t.metadata??{}}}}),!0},ax=({trigger:e,text:t,isCommand:n=!1,acceptTrailingSpaces:r=!0})=>{let i=ex(e),a=`[^\\s${i}]*`,o=t.match(RegExp(n?`^[${i}]${a}$`:r?`(?!^|\\W)?[${i}]${a}\\s?${a}$`:`(?!^|\\W)?[${i}]${a}$`,`g`));return o&&o[o.length-1].trim()},ox=({insertText:e,selection:t,text:n,trigger:r})=>{let i=n.slice(0,t.end),a=n.slice(t.end),o=i.lastIndexOf(r);return{text:i.slice(0,o)+e+a,selection:{start:o+e.length,end:o+e.length}}},sx=({displayName:e,searchToken:t})=>({tokenizedDisplayName:{token:t,parts:t?e.split(RegExp(`(${ex(t)})`,`gi`)).filter(Boolean):[e]}}),cx=class extends Une{constructor(e,t){super(t),this.type=`commands`,this.canExecuteQuery=e=>{let t=e!==void 0;return this.isActive&&!this.isLoading&&(this.hasNext||t)},this.channel=e}getStateBeforeFirstQuery(e){let t=super.getStateBeforeFirstQuery(e),{items:n}=this.state.getLatestValue();return{...t,items:n}}query(e){let t=(this.channel.getConfig()?.commands||[]).filter(t=>!!(t.name&&t.name.toLowerCase().indexOf(e.toLowerCase())!==-1));return t.sort((t,n)=>{let r=t.name?.toLowerCase(),i=n.name?.toLowerCase();if(r?.indexOf(e)===0&&(r=`0${r}`),i?.indexOf(e)===0&&(i=`0${i}`),r!=null&&i!=null){if(r<i)return-1;if(r>i)return 1}return 0}),{items:t.map(e=>({...e,id:e.name})),next:null}}filterQueryResults(e){return e}},tre={minChars:1,trigger:`/`},nre=(e,t)=>{let n=Lb(tre,t??{}),r=new cx(e);return t?.searchSource&&(r=t.searchSource,r.resetState()),r.activate(),{id:`stream-io/text-composer/commands-middleware`,handlers:{onChange:({state:e,next:i,complete:a,forward:o})=>{if(!e.selection)return o();let s=e.text.slice(0,e.selection.end),c=Zne(s);if(c){let n=rx(r,c),a=t?.composer;if(n&&!a?.isCommandDisabled(n))return i({...e,command:n,suggestions:void 0})}let l=ax({trigger:n.trigger,text:s,acceptTrailingSpaces:!1,isCommand:!0});if(l&&l.length===n.minChars&&r.resetStateAndActivate(),!l||l.length<n.minChars){let t=e.suggestions?.trigger===n.trigger,r={...e};return t&&delete r.suggestions,i(r)}return a({...e,command:null,suggestions:{query:l.slice(1),searchSource:r,trigger:n.trigger}})},onSuggestionItemSelect:({state:e,next:i,forward:a})=>{let{selectedSuggestion:o}=e.change??{};if(!o||e.suggestions?.trigger!==n.trigger)return a();let s=t?.composer;return s&&ix(s,o)?a():(r.resetStateAndActivate(),i({...e,...ox({insertText:`/${o.name} `,selection:e.selection,text:e.text,trigger:n.trigger}),command:o,suggestions:void 0}))}}}},rre=(e,t,n)=>{let r=rx(t,tx(n));if(r&&e.isCommandDisabled(r))return r},ire=(e,t)=>{let n=t??new cx(e.channel);return{id:`stream-io/message-composer-middleware/data-validation`,handlers:{compose:async({state:t,discard:r,forward:i})=>{let{maxLengthOnSend:a}=e.config.text??{},o=t.message.text??``,s=rre(e,n,o);if(s)return ix(e,s),await r();let c=e.textComposer.command??rx(n,tx(o));
426if(c&&ere({composer:e,sendability:e.validateCommandSendability(c,o)}))return await r();let l=typeof a==`number`&&o.length>a;return e.compositionIsEmpty||l?await r():await i()}}}},are=e=>({id:`stream-io/message-composer-middleware/draft-data-validation`,handlers:{compose:async({state:t,discard:n,forward:r})=>{let i=!Kb(t.draft.text??``)||t.draft.attachments?.length||t.draft.poll_id||t.draft.quoted_message_id;return e.lastChangeOriginIsLocal&&i?await r():await n()}}}),ore=e=>({id:`stream-io/message-composer-middleware/link-previews`,handlers:{compose:({state:t,next:n,forward:r})=>{let{linkPreviewsManager:i}=e;if(!i)return r();i.cancelURLEnrichment();let a=i.loadingPreviews.length>0,o=i.dismissedPreviews.length>0,s=i.loadingPreviews.length>0?[]:i.loadedPreviews.map(e=>cS.getPreviewData(e)),c=(t.message.attachments??[]).concat(s);if(!c.length)return r();let l={...t.sendOptions};return(!a&&s.length>0||o)&&(l.skip_enrich_url=!0),n({...t,message:{...t.message,attachments:c},localMessage:{...t.localMessage,attachments:c},sendOptions:l})}}}),sre=e=>({id:`stream-io/message-composer-middleware/draft-link-previews`,handlers:{compose:({state:t,next:n,forward:r})=>{let{linkPreviewsManager:i}=e;if(!i)return r();i.cancelURLEnrichment();let a=i.loadedPreviews.map(e=>cS.getPreviewData(e));return a.length?n({...t,draft:{...t.draft,attachments:(t.draft.attachments??[]).concat(a)}}):r()}}}),cre=(e,t)=>
426e.includes(`@${t}`),lx=e=>e!==void 0,lre=e=>e.mentionType===`channel`?[`channel`]:e.mentionType===`here`?[`here`]:e.mentionType===`user`?[e.id,e.name].filter(lx):e.mentionType===`role`||e.mentionType===`user_group`&&e.name?[e.name,e.id].filter(lx):[],ure=(e,t)=>{let n=lre(e);return n.length?n.some(e=>cre(t,e)):!0},ux=(e,t)=>{let n=new Map;return e.forEach(e=>{n.set(t(e),e)}),[...n.values()]},dx=({mentions:e,text:t})=>ux(e.filter(e=>ure(e,t)),e=>`${e.mentionType}:${e.id}`).reduce((e,t)=>(t.mentionType===`user`?e.mentioned_users.push(Wb(t)):t.mentionType===`channel`?e.mentioned_channel=!0:t.mentionType===`here`?e.mentioned_here=!0:t.mentionType===`role`?e.mentioned_roles.push(t.id):t.mentionType===`user_group`&&e.mentioned_group_ids.push(t.id),e),{mentioned_channel:!1,mentioned_group_ids:[],mentioned_here:!1,mentioned_roles:[],mentioned_users:[]}),fx=e=>({id:`stream-io/message-composer-middleware/text-composition`,handlers:{compose:({state:t,next:n,forward:r})=>{if(!e.textComposer)return r();let{mentions:i,text:a}=e.textComposer,{mentioned_channel:o,mentioned_group_ids:s,mentioned_here:c,mentioned_roles:l,mentioned_users:u}=dx({mentions:i,text:a});return!a&&!o&&!c&&s.length===0&&l.length===0&&u.length===0?r():n({...t,localMessage:{...t.localMessage,mentioned_channel:o,mentioned_group_ids:s,mentioned_here:c,mentioned_roles:l,mentioned_users:u,text:a},message:{...t.message,mentioned_channel:o,mentioned_group_ids:s,mentioned_here:c,mentioned_roles:l,mentioned_users:u.map(e=>e.id),text:a}})}}}),px=e=>({id:`stream-io/message-composer-middleware/draft-text-composition`,handlers:{compose:({state:t,next:n,forward:r})=>{if(!e.textComposer)return r();let{maxLengthOnSend:i}=e.config.text??{},{mentions:a,text:o}=e.textComposer,s=typeof i==`number`&&o.length>i?o.slice(0,i):o,{mentioned_channel:c,mentioned_group_ids:l,mentioned_here:u,mentioned_roles:d,mentioned_users:f}=dx({mentions:a,text:s}),p={...c?{mentioned_channel:!0}:{},...l.length?{mentioned_group_ids:l}:{},...u?{mentioned_here:!0}:{},...d.length?{mentioned_roles:d}:{},...f.length?{mentioned_users:f.map(e=>e.id)}:{}};return n({...t,draft:{...t.draft,...p,text:s}})}}}),mx=e=>({id:`stream-io/message-composer-middleware/own-state`,handlers:{compose:({state:t,next:n})=>{let r={};return e.quotedMessage&&(r.quoted_message_id=e.quotedMessage.id),e.pollId&&(r.poll_id=e.pollId),e.showReplyInChannel&&(r.show_in_channel=!0),n({...t,localMessage:{...t.localMessage,...r,quoted_message:e.quotedMessage??void 0},message:{...t.message,...r}})}}}),hx=e=>({id:`stream-io/message-composer-middleware/draft-own-state`,handlers:{compose:({state:t,next:n})=>{let r={};return e.quotedMessage&&(r.quoted_message_id=e.quotedMessage.id),e.pollId&&(r.poll_id=e.pollId),e.showReplyInChannel&&(r.show_in_channel=!0),n({...t,draft:{...t.draft,...r}})}}}),gx=e=>({id:`stream-io/message-composer-middleware/user-data-injection`,handlers:{compose:({state:t,next:n,forward:r})=>{if(!e.client.user)return r();let{channel_mutes:i,devices:a,mutes:o,...s}=e.client.user;return n({...t,localMessage:{...t.localMessage,user:s,user_id:s.id}})}}}),_x={attachments:[],mentioned_users:[],parent_id:void 0,quoted_message:void 0,text:``},vx=e=>({id:`stream-io/message-composer-middleware/poll-only`,handlers:{compose:({state:t,complete:n,forward:r})=>{let i=e.pollId,a=!!e.editedMessage,o=!!e.threadId;return!i||o||a?r():n({...t,localMessage:{...t.localMessage,..._x,poll_id:i},message:{id:t.localMessage.id,poll_id:i}})}}}),yx=e=>({id:`stream-io/message-composer-middleware/shared-location`,handlers:{compose:({state:t,next:n,forward:r})=>{let{locationComposer:i}=e,a=i.validLocation;if(!i||!a||!e.client.user)return r();let o=new Date().toISOString();return n({...t,localMessage:{...t.localMessage,shared_location:{...a,channel_cid:e.channel.cid,created_at:o,updated_at:o,user_id:e.client.user.id}},message:{...t.message,shared_location:a}})}}}),bx=class extends jb{constructor({composer:e}){super(),this.use([gx(e),vx(e),fx(e),One(e),ore(e),yx(e),mx(e),jne(e),ire(e),Ane(e)])}},xx=class extends jb{constructor({composer:e}){super(),this.use([px(e),kne(e),sre(e),hx(e),Mne(e),are(e)])}},Sx=/^([2-9]|10)$/,Cx=e=>!e.trim(),wx={enforce_unique_vote:()=>({max_votes_allowed:void 0}),max_votes_allowed:({data:e,value:t})=>e.enforce_unique_vote&&t?{max_votes_allowed:`Enforce unique vote is enabled`}:!t.match(/^[0-9]+$/)&&t?{max_votes_allowed:`Only numbers are allowed`}:t?.length>1&&!t.match(Sx)?{max_votes_allowed:`Type a number from 2 to 10`}:{max_votes_allowed:void 0},options:({value:e})=>{let t={},n=new Set;
426return e.forEach(e=>{n.has(e.text)&&e.text.length?t[e.id]=`Option already exists`:n.add(e.text)}),Object.keys(t).length>0?{options:t}:{options:void 0}}},Tx={name:({currentError:e,value:t})=>t&&e?{name:void 0}:{name:typeof e==`string`?e:void 0}},Ex={max_votes_allowed:({value:e})=>e&&!e.match(Sx)?{max_votes_allowed:`Type a number from 2 to 10`}:{max_votes_allowed:void 0},name:({value:e})=>Cx(e)?{name:`Question is required`}:{name:void 0},options:e=>{let t=wx.options?.(e)?.options??{};return e.value.forEach((n,r)=>{let i=r===e.value.length-1;Cx(n.text)&&!i&&(t[n.id]=`Option is empty`)}),Object.keys(t).length>0?{options:t}:{options:void 0}}},Dx=e=>!Array.isArray(e)&&typeof e?.index==`number`&&typeof e?.text==`string`,Ox=e=>{if(e===``||e==null)return``;let t=typeof e==`string`?parseInt(e,10):Number(e);return!Number.isInteger(t)||Number.isNaN(t)?``:String(Math.min(10,Math.max(2,t)))},kx={enforce_unique_vote:({value:e})=>({enforce_unique_vote:e,max_votes_allowed:``}),max_votes_allowed:({value:e})=>({max_votes_allowed:Ox(e)}),options:({value:e,data:t})=>{if(Array.isArray(e))return{options:e.map(e=>({id:e.id,text:e.text.trim()}))};let{index:n,text:r}=e,i=t.options||[],a=i&&i.slice(n+1).length>0&&!r,o=i.slice(0,n),s=i.slice(n+1),c=[...o,...a?[]:[{...i[n],text:r}],...s];return i.length<100&&!c.some(e=>!e.text.trim())&&c.push({id:Fy(),text:``}),{options:c}}},Ax=({processors:e,validators:t}={})=>{let n=({state:e,validators:t,processors:n})=>{let{previousState:r,targetFields:i}=e,a;if(!n&&Dx(i.options)){let e=[...r.data.options],t=r.data.options[i.options.index];t&&(t.text=i.options.text,e.splice(i.options.index,1,t)),a={...i,options:e}}else a=n?Object.entries(i).reduce((e,[t,i])=>{let a=n[t];return e={...e,...a?a({data:r.data,value:i}):{[t]:i}},e},{}):i;let o=Object.keys(i).reduce((e,n)=>{let i=t[n];if(i){let t=i({currentError:r.errors[n],data:r.data,value:a[n]});e={...e,...t}}return e},{});return{newData:a,newErrors:o}};return{id:`stream-io/poll-composer-state-processing`,handlers:{handleFieldChange:({state:r,next:i,forward:a})=>{if(!r.targetFields)return a();let{previousState:o,injectedFieldErrors:s}=r,{newData:c,newErrors:l}=n({processors:{...kx,...e?.handleFieldChange},state:r,validators:{...wx,...Tx,...t?.handleFieldChange}});return i({...r,nextState:{...o,data:{...o.data,...c},errors:{...o.errors,...l,...s}}})},handleFieldBlur:({state:r,next:i,forward:a})=>{if(!r.targetFields)return a();let{previousState:o}=r,{newData:s,newErrors:c}=n({processors:e?.handleFieldBlur,state:r,validators:{...wx,...Ex,...t?.handleFieldBlur}});return i({...r,nextState:{...o,data:{...o.data,...s},errors:{...o.errors,...c,...r.injectedFieldErrors}}})}}}},jx=e=>({id:`stream-io/poll-composer-composition`,handlers:{compose:({discard:t,forward:n})=>e.pollComposer.canCreatePoll?n():t()}}),Mx=class extends jb{constructor({composer:e}){super(),this.use([jx(e)])}},Nx=class extends jb{constructor(){super(),this.use([Ax()])}},Px={selection:{start:0,end:0},text:``},Fx=e=>({command:e,stateToRestore:Px,type:`command.activate`}),Ix=e=>typeof e?.name==`string`,Lx=()=>({handlers:{onChange:({forward:e})=>e(),onSuggestionItemSelect:({state:e,next:t,forward:n})=>{let{selectedSuggestion:r}=e.change??{};return!Ix(r)||!e.command||e.command.name!==r.name?n():t({...e,effects:[...e.effects??[],Fx(e.command)]})}},id:`stream-io/text-composer/command-effects-middleware`}),Rx={a:`á|à|ã|â|À|Á|Ã|Â`,c:`ç|Ç`,e:`é|è|ê|É|È|Ê`,i:`í|ì|î|Í|Ì|Î`,n:`ñ|Ñ`,o:`ó|ò|ô|ő|õ|Ó|Ò|Ô|Õ`,u:`ú|ù|û|ü|Ú|Ù|Û|Ü`},zx=e=>e?Object.keys(Rx).reduce((e,t)=>e.replace(new RegExp(Rx[t],`g`),t),e):``,Bx=(e,t)=>{if(e.length===0)return t.length;if(t.length===0)return e.length;let n=[],r;for(r=0;r<=t.length;r++)n[r]=[r];let i;for(i=0;i<=e.length;i++)n[0][i]=i;for(r=1;r<=t.length;r++)for(i=1;i<=e.length;i++)t.charAt(r-1)===e.charAt(i-1)?n[r][i]=n[r-1][i-1]:n[r][i]=Math.min(n[r-1][i-1]+1,Math.min(n[r][i-1]+1,n[r-1][i]+1));return n[t.length][e.length]},Vx={channel:!0,here:!0,role:!0,user:!0,user_group:!0},Hx=e=>{if(e)try{return JSON.parse(e)}catch{return}},Ux=(e,t)=>{let n=e.findIndex(e=>e.id===t.id);if(n===-1)return e.concat(t);let r=[...e];return r.splice(n,1,t),r},Wx=(e,t)=>{let n=e.findIndex(e=>e.id===t.id&&e.mentionType===t.mentionType);if(n===-1)return e.concat(t);let r=[...e];return r.splice(n,1,t),r}
426,Gx=e=>{if(e.mentionType===`user`)return Pne(e);if(e.mentionType===`channel`)return{id:`channel`,mentionType:`channel`,name:`channel`};if(e.mentionType===`here`)return{id:`here`,mentionType:`here`,name:`here`};if(e.mentionType===`role`)return{id:e.id,mentionType:`role`,name:e.name};if(e.mentionType===`user_group`)return{id:e.id,mentionType:`user_group`,name:e.name};throw Error(`Unsupported mention suggestion type: ${JSON.stringify(e)}`)},Kx=e=>`@${e.name||e.id} `,qx={channel:(e,{searchToken:t})=>{let n=String(e);return{id:n,mentionType:`channel`,name:`channel`,...sx({displayName:n,searchToken:t})}},here:(e,{searchToken:t})=>{let n=String(e);return{id:n,mentionType:`here`,name:`here`,...sx({displayName:n,searchToken:t})}},role:(e,{searchToken:t})=>{let n=String(e);return{id:n,mentionType:`role`,name:n,...sx({displayName:n,searchToken:t})}},user:(e,{searchToken:t})=>{let n=e;return{...n,mentionType:`user`,...sx({displayName:n.name||n.id,searchToken:t})}},user_group:(e,{searchToken:t})=>{let n=e;return{description:n.description,id:n.id,memberCount:n.members?.length,mentionType:`user_group`,name:n.name,...sx({displayName:n.name||n.id,searchToken:t})}}},Jx=class extends Qb{constructor(e,t){let{allowedMentionTypes:n,mentionAllAppUsers:r,suggestionFactoryMappers:i,textComposerText:a,transliterate:o,trigger:s,...c}=t||{};super(c),this.type=`mentions`,this.normalizeSearchValue=e=>this.transliterate(zx(e)).toLowerCase(),this.matchesSearchQuery=(e,t)=>t?this.normalizeSearchValue(e).includes(this.normalizeSearchValue(t)):!0,this.matchesPrefixSearchQuery=(e,t)=>t?this.normalizeSearchValue(e).startsWith(this.normalizeSearchValue(t)):!0,this.matchesUserNameSearchQuery=(e,t)=>{if(!t)return!0;let n=this.normalizeSearchValue(e).split(/\s+/).filter(Boolean),r=this.normalizeSearchValue(t).split(/\s+/).filter(Boolean);if(!n.length||!r.length)return!1;let i=r.slice(0,-1),a=r[r.length-1];return i.every(e=>n.includes(e))&&n.some(e=>e.startsWith(a))},this.isMentionTypeAllowed=e=>this.config.allowedMentionTypes?.[e]??!0,this.mapMentionSuggestion=(e,t,n=this.searchQuery)=>(this.config.suggestionFactoryMappers?.[e]??qx[e])(t,{searchToken:n,source:this}),this.getChannelTeam=()=>this.channel.data?.team,this.toUserSuggestion=(e,t=this.searchQuery)=>this.mapMentionSuggestion(`user`,e,t),this.toChannelMentionSuggestion=(e=this.searchQuery)=>this.mapMentionSuggestion(`channel`,`channel`,e),this.toHereMentionSuggestion=(e=this.searchQuery)=>this.mapMentionSuggestion(`here`,`here`,e),this.toRoleMentionSuggestion=(e,t=this.searchQuery)=>this.mapMentionSuggestion(`role`,e,t),this.toUserGroupMentionSuggestion=(e,t=this.searchQuery)=>this.mapMentionSuggestion(`user_group`,e,t),this.canExecuteQuery=e=>{let t=e!==void 0;return this.isActive&&!this.isLoading&&(t||this.hasNext)},this.transliterate=e=>e,this.getMembersAndWatchers=()=>{let e=Object.values(this.channel.state.members??{}).map(({user:e})=>e),t=Object.values(this.channel.state.watchers??{}),n=[...e,...t],r={};return n.forEach(e=>{e&&!r[e.id]&&(r[e.id]=e)}),Object.values(r)},this.getBuiltinMentionSuggestions=e=>[...this.isMentionTypeAllowed(`channel`)?[this.toChannelMentionSuggestion(e)]:[],...this.isMentionTypeAllowed(`here`)?[this.toHereMentionSuggestion(e)]:[]].filter(({name:t})=>this.matchesPrefixSearchQuery(t,e)),this.getRoleMentionSuggestions=async e=>{if(!this.isMentionTypeAllowed(`role`)||!e)return[];let{roles:t}=await this.client.searchRoles({query:e});return[...t?.map(e=>e.name)??[]].sort((e,t)=>e.localeCompare(t)).map(t=>this.toRoleMentionSuggestion(t,e))},this.searchMembersLocally=e=>{let{textComposerText:t}=this.config;return t?this.getMembersAndWatchers().filter(n=>{if(n.id===this.client.userID)return!1;if(!e)return!0;let r=this.transliterate(zx(n.id)).toLowerCase(),i=this.transliterate(zx(e)).toLowerCase(),a=this.config.trigger??`@`,o=t.slice(-4).includes(a);if(this.matchesUserNameSearchQuery(n.name,i))return!0;let s=Bx(i,r);return r.includes(i)||s<=3&&o}).sort((e,t)=>{if(!this.memberSort)return(e.name||``).localeCompare(t.name||``);for(let[n,r]of Object.entries(this.memberSort)){let i=e[n],a=t[n];if(i!==a)return r===1?String(i||``).localeCompare(String(a||``)):String(a||``).localeCompare(String(i||``))}return 0}):[]},this.prepareQueryUsersParams=(e,t=0)=>({filters:{$or:[{id:{$autocomplete:e}},{name:{$autocomplete:e}}],...this.userFilters},sort:this.userSort??[{name:1},{id:1}],options:{...this.searchOptions,limit:this.pageSize,offset:t}}),this.prepareQueryMembersParams=(e,t=0)=>{let n=[{user_id:1}];return this.memberSort?Array.isArray(this.memberSort)?n=this.memberSort[0]:Object.keys(this.memberSort).length===1&&(n=this.memberSort):n=[{user_id:1}],{filters:this.memberFilters??{name:{$autocomplete:e}},sort:n,options:{...this.searchOptions,limit:this.pageSize,offset:t}}},this.queryUsers=async(e,t=0)=>{let{filters:n,sort:r,options:i}=this.prepareQueryUsersParams(e,t),{users:a}=await this.client.queryUsers(n,r,i);return a},this.queryMembers=async(e,t=0)=>{let{filters:n,sort:r,options:i}=this.prepareQueryMembersParams(e,t);return(await this.channel.queryMembers(n,r,i)).members.map(e=>e.user)},this.getUserSuggestionsPage=async(e,t=0)=>{if(!this.isMentionTypeAllowed(`user`))return{items:[],nextOffset:void 0};let n,r=this.allMembersLoadedWithInitialChannelQuery||!e;if(this.config.mentionAllAppUsers)n=await this.queryUsers(e,t);else if(r){let n=this.searchMembersLocally(e),r=n.slice(t,t+this.pageSize).map(t=>this.toUserSuggestion(t,e));return{items:r,nextOffset:n.length>t+this.pageSize?t+r.length:void 0}}else n=await this.queryMembers(e,t);return{items:n.map(t=>this.toUserSuggestion(t,e)),nextOffset:n.length===this.pageSize?t+n.length:void 0}},this.buildUserGroupSearchCursor=e=>{if(e.length<this.pageSize)return;let t=e[e.length-1];if(t?.name)return JSON.stringify({id_gt:t.id,name_gt:t.name})},this.getUserGroupSuggestionsPage=async(e,t)=>{if(!this.isMentionTypeAllowed(`user_group`)||!e)return{items:[],next:void 0};let n=this.getChannelTeam(),r=Hx(t),i={query:e,limit:this.pageSize,...n?{team_id:n}:{},...r?.id_gt?{id_gt:r.id_gt}:{},...r?.name_gt?{name_gt:r.name_gt}:{}},{user_groups:a}=await this.client.searchUserGroups(i);return{items:a.map(t=>this.toUserGroupMentionSuggestion(t,e)),next:this.buildUserGroupSearchCursor(a)}},this.client=e.getClient(),this.channel=e,this.config={allowedMentionTypes:{...Vx,...n},mentionAllAppUsers:r,suggestionFactoryMappers:i,textComposerText:a,trigger:s},o&&(this.transliterate=o)}get allMembersLoadedWithInitialChannelQuery(){return Object.keys(this.channel.state.members||{}).length<Sy}getStateBeforeFirstQuery(e){this.userGroupCursor=void 0;let t=super.getStateBeforeFirstQuery(e),{items:n}=this.state.getLatestValue();return{...t,items:n}}updatePaginationStateFromQuery(){let e=this.latestUserPaginationState??{itemCount:0};return{hasNext:e.nextOffset!==void 0||this.userGroupCursor!==void 0,next:void 0,offset:(this.offset??0)+e.itemCount}}async query(e){let t=this.offset??0,n=t===0&&this.userGroupCursor===void 0,r=this.latestUserPaginationState,i=this.userGroupCursor,[a,o,s]=await Promise.allSettled([this.getUserSuggestionsPage(e,t),this.getUserGroupSuggestionsPage(e,i),n?this.getRoleMentionSuggestions(e):Promise.resolve([])]),c=a.status===`fulfilled`?a.value:{items:[],nextOffset:n?void 0:r?.nextOffset},l=o.status===`fulfilled`?o.value:{items:[],next:n?void 0:i},u=s.status===`fulfilled`?s.value:[],d=[...n?this.getBuiltinMentionSuggestions(e):[],...u,...l.items,...c.items];return this.latestUserPaginationState={itemCount:c.items.length,nextOffset:c.nextOffset},this.userGroupCursor=l.next,{items:d}}filterMutes(e){let{textComposerText:t}=this.config;if(!t)return[];let{mutedUsers:n}=this.client;return t.includes(`/unmute`)&&!n.length?[]:n.length?t.includes(`/unmute`)?e.filter(e=>e.mentionType===`user`&&n.some(t=>t.target.id===e.id)):e.filter(e=>e.mentionType!==`user`||n.every(t=>t.target.id!==e.id)):e}filterQueryResults(e){return this.filterMutes(e)}resetState(){this.latestUserPaginationState=void 0,this.userGroupCursor=void 0,super.resetState()}},Yx={minChars:1,trigger:`@`},Xx=(e,t)=>{let n=Lb(Yx,t??{}),r;t?.searchSource?(r=t.searchSource,r.resetState()):r=new Jx(e,{trigger:n.trigger}),r.activate();let i;return{id:`stream-io/text-composer/mentions-middleware`,handlers:{onChange:({state:e,next:t,complete:a,forward:o})=>{if(!e.selection)return o();let s=i!==void 0&&e.selection.end===i;i=void 0;let c=e.command||e.text.trimStart().startsWith(`/`)?e.mentionedUsers:nx(e.text,e.mentionedUsers),l=c.length!==e.mentionedUsers.length||c.some((t,n)=>t.id!==e.mentionedUsers[n]?.id)?{...e,mentionedUsers:c}:e,u=l.text.slice(0,l.selection.end),d=ax({trigger:n.trigger,text:u});d&&d.length===n.minChars&&r.resetStateAndActivate();let f=!!d&&/\s$/.test(u)&&(s||(l.mentions??[]).some(e=>{let t=e.name??e.id;if(!t)return!1;let n=`@${t} `;if(!u.endsWith(n))return!1;let r=n.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`);return(u.match(new RegExp(r,`g`))?.length??0)===1}));if(!d||d.length<n.minChars||f){let e=l.suggestions?.trigger===n.trigger,r={...l};return e&&delete r.suggestions,t(r)}return r.config.textComposerText=l.text,a({...l,suggestions:{query:d.slice(1),searchSource:r,trigger:n.trigger}})},onSuggestionItemSelect:({state:e,complete:t,forward:a})=>{let{selectedSuggestion:o}=e.change??{};if(!o||e.suggestions?.trigger!==n.trigger)return a();r.resetStateAndActivate();let s=Gx(o),c=Wx(e.mentions??Nne(e.mentionedUsers),s),l=ox({insertText:Kx(o),selection:e.selection,text:e.text,trigger:n.trigger});return i=l.selection.end,t({...e,...l,mentionedUsers:o.mentionType===`user`?Ux(e.mentionedUsers,Gb(o)):e.mentionedUsers,mentions:c,suggestions:void 0})}}}},Zx=e=>({id:`stream-io/text-composer/pre-validation-middleware`,handlers:{onChange:({state:t,next:n,forward:r})=>{let{maxLengthOnEdit:i}=e.config.text??{};return typeof i==`number`&&t.text.length>i?(t.text=t.text.slice(0,i),n({...t,text:t.text})):r()},onSuggestionItemSelect:({forward:e})=>e()}}),Qx=class extends jb{constructor({composer:e}){super(),this.use([Zx(e),Xx(e.channel),nre(e.channel,{composer:e}),Lx()])}async execute({eventName:e,initialValue:t}){let n=await this.executeMiddlewareChain({eventName:e,initialValue:t}),{query:r,searchSource:i}=n.state.suggestions??{};return i?.search(r)?.catch(console.error),n}},$x=new Set([`mute`,`unmute`,`unban`]),eS={sendValidator:({command:e,commandArgsText:t,mentionedUsersInText:n})=>{if(!(e.name!==`ban`&&!$x.has(e.name??``)))return n.length===0?{command:e,ready:!1,reason:`missing-mention`}:e.name===`ban`?$ne(t,n).length?{command:e,ready:!0}:{command:e,ready:!1,reason:`missing-ban-reason`}:{command:e,ready:!0}}},tS=(e,t)=>{let n=t?.commands?.sendValidator;return n===void 0?e:{...e,commands:{...e.commands,sendValidator:n}}},nS={attachments:{acceptedFiles:[],fileUploadFilter:()=>!0,maxNumberOfFilesPerMessage:xy,trackUploadProgress:!0},commands:eS,drafts:{enabled:!1},linkPreviews:{debounceURLEnrichmentMs:1500,enabled:!1,findURLFn:e=>Kv(e,`url`,{defaultProtocol:`https`}).reduce((e,t)=>
426{try{let n=new URL(t.href);t.isLink&&/^[a-zA-Z0-9-.]+\.[a-zA-Z]{2,}$/.test(n.hostname)&&e.push(t.href)}catch{}return e},[])},location:{enabled:!0,getDeviceId:()=>Fy()},text:{enabled:!0,publishTypingEvents:!0}},rS=e=>({message:{},custom:{}}),iS=class{constructor({composer:e,message:t}){this.isMessageDataEqual=(e,t)=>JSON.stringify(e.message)===JSON.stringify(t?.message),this.initState=({message:e}={})=>{this.state.next(rS({composer:this.composer,message:e}))},this.getSnapshot=()=>this.state.getLatestValue(),this.restoreSnapshot=e=>{this.state.next(e)},this.composer=e,this.state=new sb(rS({composer:e,message:t}))}get customMessageData(){return this.state.getLatestValue().message}get customComposerData(){return this.state.getLatestValue().custom}setMessageData(e){this.state.partialNext({message:{...this.state.getLatestValue().message,...e}})}setCustomData(e){this.state.partialNext({custom:{...this.state.getLatestValue().custom,...e}})}},aS=e=>new Map(e.map(e=>[e.og_scrape_url,e])),oS=({message:e})=>e?{previews:e.attachments?.reduce((e,t)=>(t.og_scrape_url&&e.set(t.og_scrape_url,{...t,status:`loaded`}),e),new Map)??new Map}:{previews:new Map},sS=class e{constructor({composer:t,message:n}){this.shouldDiscardEnrichQueries=!1,this.initState=({message:e}={})=>{this.cancelURLEnrichment(),this.state.next(oS({message:this.enabled?e:void 0}))},this.getSnapshot=()=>this.state.getLatestValue(),this.restoreSnapshot=e=>{this.state.next(e)},this._findAndEnrichUrls=async e=>{if(!this.enabled)return;let t=this.config.findURLFn(e);if(this.shouldDiscardEnrichQueries=!t.length,this.shouldDiscardEnrichQueries){this.state.next({previews:new Map});return}let n=new Map(Array.from(this.previews).filter(([e])=>t.includes(e)||t.includes(e+`/`))),r=t.filter(e=>{let t=this.previews;return!(t.get(e)||t.get(e+`/`))}).map(e=>({og_scrape_url:e.trim(),status:`loading`}));r.length&&(this.state.partialNext({previews:new Map([...n,...aS(r)])}),await Promise.all(r.map(async e=>{try{let{duration:t,...n}=await this.client.enrichURL(e.og_scrape_url);if(this.shouldDiscardEnrichQueries)return;this.previews.has(e.og_scrape_url)&&this.updatePreview(e.og_scrape_url,{status:`loaded`,...n})}catch{this.previews.has(e.og_scrape_url)&&this.updatePreview(e.og_scrape_url,{status:`failed`})}return e})))},this.cancelURLEnrichment=()=>{this.findAndEnrichUrls.cancel?.(),this.findAndEnrichUrls.flush?.()},this.clearPreviews=()=>{let t=this.previews,n=new Map;t.forEach((t,r)=>{e.previewIsDismissed(t)&&n.set(r,t)}),this.state.partialNext({previews:n})},this.updatePreview=(e,t)=>{if(!e)return;let n=this.previews.get(e),r=t.status??this.previews.get(e)?.status??`pending`,i=t;if(n){let e=Rb(n,t);if(!e.diff||Object.keys(e.diff).length===0)return;i=e.result}this.state.partialNext({previews:new Map(this.previews).set(e,{...i,og_scrape_url:e,status:r})})},this.dismissPreview=e=>{let t=this.previews.get(e);t&&(this.onLinkPreviewDismissed?.(t),this.updatePreview(e,{status:`dismissed`}))},this.composer=t,this.state=new sb(oS({message:this.enabled?n:void 0})),this.findAndEnrichUrls=Wy(this._findAndEnrichUrls.bind(this),this.config.debounceURLEnrichmentMs)}get client(){return this.composer.client}get channel(){return this.composer.channel}get previews(){return this.state.getLatestValue().previews}get loadingPreviews(){return Array.from(this.previews.values()).filter(t=>e.previewIsLoading(t))}get loadedPreviews(){return Array.from(this.previews.values()).filter(t=>e.previewIsLoaded(t))}get dismissedPreviews(){return Array.from(this.previews.values()).filter(t=>e.previewIsDismissed(t))}get failedPreviews(){return Array.from(this.previews.values()).filter(t=>e.previewIsFailed(t))}get pendingPreviews(){return Array.from(this.previews.values()).filter(t=>e.previewIsPending(t))}get config(){return this.composer.config.linkPreviews}get debounceURLEnrichmentMs(){return this.config.debounceURLEnrichmentMs}set debounceURLEnrichmentMs(e){this.cancelURLEnrichment(),this.findAndEnrichUrls=Wy(this._findAndEnrichUrls.bind(this),this.config.debounceURLEnrichmentMs),this.composer.updateConfig({linkPreviews:{debounceURLEnrichmentMs:e}})}get enabled(){return!!this.channel.getConfig()?.url_enrichment&&this.composer.config.linkPreviews.enabled}set enabled(e){e!==this.enabled&&this.composer.updateConfig({linkPreviews:{enabled:e}})}get findURLFn(){return this.config.findURLFn}set findURLFn(e){this.composer.updateConfig({linkPreviews:{findURLFn:e}})}get onLinkPreviewDismissed(){return this.config.onLinkPreviewDismissed}set onLinkPreviewDismissed(e){this.composer.updateConfig({linkPreviews:{onLinkPreviewDismissed:e}})}};sS.previewIsLoading=e=>e.status===`loading`,sS.previewIsLoaded=e=>e.status===`loaded`,sS.previewIsDismissed=e=>e.status===`dismissed`,sS.previewIsFailed=e=>e.status===`failed`,sS.previewIsPending=e=>
426e.status===`pending`,sS.getPreviewData=e=>{let{status:t,...n}=e;return n};var cS=sS,lS=60*1e3,uS=({message:e})=>({location:e?.shared_location??null}),dS=class{constructor({composer:e,message:t}){this.initState=({message:e}={})=>{this.state.next(uS({message:e}))},this.getSnapshot=()=>this.state.getLatestValue(),this.restoreSnapshot=e=>{this.state.next(e)},this.setData=e=>{this.config.enabled&&(!e.latitude||!e.longitude||this.state.partialNext({location:{...e,message_id:this.composer.id,created_by_device_id:this.deviceId}}))},this.composer=e,this.state=new sb(uS({message:t})),this._deviceId=this.config.getDeviceId()}get config(){return this.composer.config.location}get deviceId(){return this._deviceId}get location(){return this.state.getLatestValue().location}get validLocation(){let{durationMs:e,...t}=this.location??{};return t?.created_by_device_id&&t.message_id&&t.latitude&&t.longitude&&(e===void 0||e>=lS)?{...t,end_at:e&&new Date(Date.now()+e).toISOString()}:null}},fS=(e,t)=>{let n=t.getSnapshot();e.stateToRestore&&(n.textComposer={...n.textComposer,...e.stateToRestore,command:null}),t.captureSnapshot(n),t.textComposer.state.next({command:e.command,mentionedUsers:[],mentions:[],suggestions:void 0,selection:{start:0,end:0},text:``});let r=t.attachmentManager.attachments;t.attachmentManager.initState(),t.attachmentManager.cancelAttachmentUploads(r),t.linkPreviewsManager.initState(),t.locationComposer.initState(),t.pollComposer.initState(),t.customDataManager.initState()},pS=(e,t)=>{let n=t.popSnapshot();n&&t.restoreSnapshot(n)},mS=class{constructor(e){this.options=e,this.handlers=new Map,this.registerDefaultHandlers=()=>{this.registerEffectHandler(`command.activate`,fS),this.registerEffectHandler(`command.clear`,pS)},this.registerEffectHandler=(e,t)=>{this.handlers.set(e,t)},this.applyEffects=(e=[])=>{e.forEach(e=>this.applyEffect(e))},this.applyEffect=e=>{this.handlers.get(e.type)?.(e,this.options.composer)},this.registerDefaultHandlers()}},hS=class extends Error{constructor(e,{code:t,status:n,response:r}){super(e),this.name=`ErrorFromResponse`,this.code=t,this.response=r,this.status=n}toJSON(){let e=[[`status`,this.status],[`code`,this.code]],t=[];for(let[n,r]of e)r!=null&&t.push(`${n}: ${r}`);return{message:`(${t.join(`, `)}) - ${this.message}`,stack:this.stack,name:this.name,code:this.code,status:this.status}}},gS=(e=>(e.anonymous=`anonymous`,e.public=`public`,e))(gS||{}),_S=class{constructor({composer:e}){this.initState=()=>{this.state.next(this.initialState)},this.getSnapshot=()=>this.state.getLatestValue(),this.restoreSnapshot=e=>{this.state.next(e)},this.updateFields=async(e,t)=>{let{state:n,status:r}=await this.stateMiddlewareExecutor.execute({eventName:`handleFieldChange`,initialValue:{nextState:{...this.state.getLatestValue()},previousState:{...this.state.getLatestValue()},targetFields:e,injectedFieldErrors:t}});r!==`discard`&&this.state.next(n.nextState)},this.handleFieldBlur=async e=>{let t=await this.stateMiddlewareExecutor.execute({eventName:`handleFieldBlur`,initialValue:{nextState:{...this.state.getLatestValue()},previousState:{...this.state.getLatestValue()},targetFields:{[e]:this.state.getLatestValue().data[e]}}});t.status!==`discard`&&this.state.next(t.state.nextState)},this.compose=async()=>{let{data:e,errors:t}=this.state.getLatestValue(),n=await this.compositionMiddlewareExecutor.execute({eventName:`compose`,initialValue:{data:{...e,max_votes_allowed:e.max_votes_allowed?parseInt(e.max_votes_allowed):void 0,options:e.options?.filter(e=>e.text.trim()).map(e=>({text:e.text}))},errors:t}});if(n.status!==`discard`)return n.state},this.composer=e,this.state=new sb(this.initialState),this.compositionMiddlewareExecutor=new Mx({composer:e}),this.stateMiddlewareExecutor=new Nx}get initialState(){return{data:{allow_answers:!1,allow_user_suggested_options:!1,description:``,enforce_unique_vote:!0,id:Fy(),max_votes_allowed:``,name:``,options:[{id:Fy(),text:``}],user_id:this.composer.client.user?.id,voting_visibility:`public`},errors:{}}}get allow_answers(){return this.state.getLatestValue().data.allow_answers}get allow_user_suggested_options(){return this.state.getLatestValue().data.allow_user_suggested_options}get description(){return this.state.getLatestValue().data.description}get enforce_unique_vote(){return this.state.getLatestValue().data.enforce_unique_vote}get id(){return this.state.getLatestValue().data.id}get max_votes_allowed(){return this.state.getLatestValue().data.max_votes_allowed}get name(){return this.state.getLatestValue().data.name}get options(){return this.state.getLatestValue().data.options}get user_id(){return this.state.getLatestValue().data.user_id}get voting_visibility(){return this.state.getLatestValue().data.voting_visibility}
426get canCreatePoll(){let{data:e,errors:t}=this.state.getLatestValue(),n=e.options.filter(e=>!!e.text.trim()).length>0,r=!!e.name,i=parseInt(e.max_votes_allowed?.match(Sx)?.[0]||``),a=e.max_votes_allowed===``||!!i&&(2<=i||i<=10);return n&&r&&a&&Object.values(t).filter(e=>!!e).length===0}},vS=50,yS=[{created_at:-1}],bS=1e3,xS={active_participant_count:!0,channel:!0,channel_cid:!0,created_at:!0,created_by:!0,created_by_user_id:!0,deleted_at:!0,draft:!0,last_message_at:!0,latest_replies:!0,parent_message:!0,parent_message_id:!0,participant_count:!0,read:!0,reply_count:!0,thread_participants:!0,title:!0,updated_at:!0},SS=e=>{let t={};for(let n in e){if(xS[n])continue;let r=n;t[r]=e[r]}return t},CS=class extends lb{constructor({client:e,threadData:t}){super(),this.failedRepliesMap=new Map,this.activate=()=>{this.state.partialNext({active:!0})},this.deactivate=()=>{this.state.partialNext({active:!1})},this.reload=async()=>{if(!this.state.getLatestValue().isLoading){this.state.partialNext({isLoading:!0});try{let e=await this.client.getThread(this.id,{watch:!0});this.hydrateState(e)}finally{this.state.partialNext({isLoading:!1})}}},this.hydrateState=e=>{if(e===this)return;if(e.id!==this.id)throw Error(`Cannot hydrate thread's state using thread with different threadId`);let{createdAt:t,custom:n,title:r,deletedAt:i,parentMessage:a,participants:o,read:s,replyCount:c,replies:l,updatedAt:u}=e.state.getLatestValue(),d=Array.from(this.failedRepliesMap.values());this.state.partialNext({title:r,createdAt:t,custom:n,deletedAt:i,parentMessage:a,participants:o,read:s,replyCount:c,replies:d.length?l.concat(d):l,updatedAt:u,isStateStale:!1})},this.registerSubscriptions=()=>{this.hasSubscriptions||(this.addUnsubscribeFunction(this.subscribeThreadUpdated()),this.addUnsubscribeFunction(this.subscribeMarkActiveThreadRead()),this.addUnsubscribeFunction(this.subscribeReloadActiveStaleThread()),this.addUnsubscribeFunction(this.subscribeMarkThreadStale()),this.addUnsubscribeFunction(this.subscribeNewReplies()),this.addUnsubscribeFunction(this.subscribeRepliesRead()),this.addUnsubscribeFunction(this.subscribeMessageDeleted()),this.addUnsubscribeFunction(this.subscribeMessageUpdated()))},this.subscribeThreadUpdated=()=>this.client.on(`thread.updated`,e=>{if(!e.thread||e.thread.parent_message_id!==this.id)return;let t=e.thread;this.state.partialNext({title:t.title,updatedAt:new Date(t.updated_at),deletedAt:t.deleted_at?new Date(t.deleted_at):null,custom:SS(t)})}).unsubscribe,this.subscribeMarkActiveThreadRead=()=>this.state.subscribeWithSelector(e=>({active:e.active,unreadMessageCount:ES(this.client.userID)(e)}),({active:e,unreadMessageCount:t})=>{!e||!t||this.throttledMarkAsRead()}),this.subscribeReloadActiveStaleThread=()=>this.state.subscribeWithSelector(e=>({active:e.active,isStateStale:e.isStateStale}),({active:e,isStateStale:t})=>{e&&t&&this.reload()}),this.subscribeMarkThreadStale=()=>this.client.on(`user.watching.stop`,e=>{let{channel:t}=this.state.getLatestValue();!this.client.userID||this.client.userID!==e.user?.id||e.channel?.cid!==t.cid||this.state.partialNext({isStateStale:!0})}).unsubscribe,this.subscribeNewReplies=()=>this.client.on(`message.new`,e=>{if(!this.client.userID||e.message?.parent_id!==this.id)return;let t=e.message.user?.id===this.client.userID,{active:n,read:r}=this.state.getLatestValue();this.upsertReplyLocally({message:e.message,timestampChanged:t}),n&&this.throttledMarkAsRead();let i={};for(let t of Object.keys(r)){let a=r[t];if(a){let r=a;t===e.user?.id?r={...r,lastReadAt:e.created_at?new Date(e.created_at):new Date,user:e.user,unreadMessageCount:0}:n&&t===this.client.userID||(r={...r,unreadMessageCount:a.unreadMessageCount+1}),i[t]=r}}this.state.partialNext({read:i})}).unsubscribe,this.subscribeRepliesRead=()=>this.client.on(`message.read`,e=>{if(!e.user||!e.created_at||!e.thread||e.thread.parent_message_id!==this.id)return;let t=e.user.id,n=e.created_at,r=e.user;this.state.next(i=>({...i,read:{...i.read,[t]:{lastReadAt:new Date(n),user:r,lastReadMessageId:e.last_read_message_id,unreadMessageCount:0}}}))}).unsubscribe,this.subscribeMessageDeleted=()=>this.client.on(`message.deleted`,e=>{e.message&&(e.message.parent_id===this.id&&(e.hard_delete?this.deleteReplyLocally({message:e.message}):this.upsertReplyLocally({message:e.message})),e.message.id===this.id&&this.updateParentMessageLocally({message:e.message}))}).unsubscribe,this.subscribeMessageUpdated=()=>{let e=[`message.updated`,`reaction.new`,`reaction.deleted`,`reaction.updated`].map(e=>this.client.on(e,e=>{e.message&&this.updateParentMessageOrReplyLocally(e.message)}).unsubscribe);return()=>
426e.forEach(e=>e())},this.unregisterSubscriptions=()=>{let e=super.unregisterSubscriptions();return this.state.partialNext({isStateStale:!0}),e},this.deleteReplyLocally=({message:e})=>{let{replies:t}=this.state.getLatestValue(),n=Hy({needle:Ry(e),sortedArray:t,sortDirection:`ascending`,selectValueToCompare:e=>e.created_at.getTime(),selectKey:e=>e.id});if(t[n]?.id!==e.id)return;let r=[...t];r.splice(n,1),this.state.partialNext({replies:r})},this.upsertReplyLocally=({message:e,timestampChanged:t=!1})=>{if(e.parent_id!==this.id)throw Error(`Reply does not belong to this thread`);let n=Ry(e);e.status===`failed`?this.failedRepliesMap.set(n.id,n):this.failedRepliesMap.has(e.id)&&this.failedRepliesMap.delete(e.id),this.state.next(e=>({...e,replies:Uy(e.replies,n,t)}))},this.updateParentMessageLocally=({message:e})=>{if(e.id!==this.id)throw Error(`Message does not belong to this thread`);this.state.next(t=>{let n=Ry(e);return{...t,deletedAt:n.deleted_at,parentMessage:n,replyCount:e.reply_count??t.replyCount}})},this.updateParentMessageOrReplyLocally=e=>{e.parent_id===this.id&&this.upsertReplyLocally({message:e}),!e.parent_id&&e.id===this.id&&this.updateParentMessageLocally({message:e})},this.markAsRead=async({force:e=!1}={})=>this.ownUnreadCount===0&&!e?null:await this.client.messageDeliveryReporter.markRead(this),this.throttledMarkAsRead=Gy(()=>this.markAsRead(),bS,{trailing:!0}),this.queryReplies=({limit:e=vS,sort:t=yS,...n}={})=>this.channel.getReplies(this.id,{limit:e,...n},t),this.loadNextPage=({limit:e=vS}={})=>this.loadPage(e),this.loadPrevPage=({limit:e=vS}={})=>this.loadPage(-e),this.loadPage=async e=>{let{pagination:t}=this.state.getLatestValue(),[n,r,i]=e>0?[`isLoadingNext`,`nextCursor`,`push`]:[`isLoadingPrev`,`prevCursor`,`unshift`];if(t[n]||t[r]===null)return;let a={[e>0?`id_gt`:`id_lt`]:t[r]},o=Math.abs(e);this.state.partialNext({pagination:{...t,[n]:!0}});try{let t=await this.queryReplies({...a,limit:o}),s=t.messages.map(Ry),c=s.at(e>0?-1:0)?.id??null;this.state.next(e=>{let a=e.replies;return s.length>0&&(a=[...e.replies],a[i](...s)),{...e,replies:a,pagination:{...e.pagination,[r]:t.messages.length<o?null:c,[n]:!1}}})}catch(e){this.client.logger(`error`,e.message),this.state.next(e=>({...e,pagination:{...e.pagination,[n]:!1}}))}};
426let n=e.channel(t.channel.type,t.channel.id,{name:t.channel.name});n._hydrateMembers({members:t.channel.members??[],overrideCurrentState:!1});let r=e.userID?[{user:{id:e.userID},unread_messages:0,last_read:new Date().toISOString()}]:[];this.state=new sb({active:!1,isLoading:!1,isStateStale:!1,channel:n,createdAt:new Date(t.created_at),deletedAt:t.deleted_at?new Date(t.deleted_at):null,pagination:TS(t),parentMessage:Ry(t.parent_message),participants:t.thread_participants,read:wS(!t.read||t.read.length===0?r:t.read),replies:t.latest_replies.map(Ry),replyCount:t.reply_count??0,updatedAt:t.updated_at?new Date(t.updated_at):null,title:t.title,custom:SS(t)}),this.id=t.parent_message_id,this.client=e,this.messageComposer=new jS({client:e,composition:t.draft,compositionContext:this})}get channel(){return this.state.getLatestValue().channel}get hasStaleState(){return this.state.getLatestValue().isStateStale}get ownUnreadCount(){return ES(this.client.userID)(this.state.getLatestValue())}},wS=e=>e.reduce((e,t)=>(e[t.user.id]={user:t.user,lastReadMessageId:t.last_read_message_id,unreadMessageCount:t.unread_messages??0,lastReadAt:new Date(t.last_read)},e),{}),TS=e=>({nextCursor:null,prevCursor:e.latest_replies.length===e.reply_count?null:e.latest_replies.at(0)?.id??null,isLoadingNext:!1,isLoadingPrev:!1}),ES=e=>t=>e&&t.read[e]?.unreadMessageCount||0,DS=e=>!!e?.message,OS=e=>{let t=null,n=new Date().getTime();return DS(e)?n=t=new Date(e.created_at).getTime():e&&ine(e)&&(n=new Date(e.updated_at).getTime()),{lastChange:{draftUpdate:t,stateUpdate:n}}},kS=e=>{if(!e)return{draftId:null,id:jS.generateId(),pollId:null,quotedMessage:null,showReplyInChannel:!1,editedMessage:null};let t=e.quoted_message,n=DS(e)?null:Ry(e),r,i=null,a=jS.generateId();return DS(e)?(r=e.message,i=e.message.id):(r=e,a=e.id),{draftId:i,id:a,pollId:r.poll_id??null,quotedMessage:t?Ry(t):null,showReplyInChannel:!1,editedMessage:n}},AS=class e extends lb{constructor({composition:t,config:n,compositionContext:r,client:i}){if(super(),this.snapshots=[],this.setEditedMessage=e=>{this.state.partialNext({editedMessage:e??null}),e&&this.textComposer.clearCommand()},this.getCommandDisabledReason=e=>{if(this.editedMessage)return`editing`;if(this.quotedMessage&&(e.set===`moderation_set`||e.name===`moderation_set`))return`quoted_message`},this.isCommandDisabled=e=>
426!!this.getCommandDisabledReason(e),this.validateCommandSendability=(e,t=this.textComposer.text)=>{let n=this.textComposer.mentionedUsers,r=nx(t,n),i={command:e,commandArgsText:e.name?Qne(t,e.name).trim():t.trim(),composer:this,mentionedUsersInText:r,rawText:t},a=this.config.commands.sendValidator(i);return a&&!a.ready?a:{command:e,ready:!0}},this.refreshId=()=>{this.state.partialNext({id:e.generateId()})},this.initState=({composition:e}={})=>{this.clearSnapshots(),this.editingAuditState.partialNext(this.initEditingAuditState(e));let t=e===void 0?e:DS(e)?e.message:Ry(e);this.attachmentManager.initState({message:t}),this.linkPreviewsManager.initState({message:t}),this.locationComposer.initState({message:t}),this.textComposer.initState({message:t}),this.pollComposer.initState(),this.customDataManager.initState({message:t}),this.state.next(kS(e))},this.initStateFromChannelResponse=e=>{this.channel.cid===e.channel.cid&&(e.draft?this.initState({composition:e.draft}):this.state.getLatestValue().draftId&&(this.clear(),this.client.offlineDb?.executeQuerySafely(e=>e.deleteDraft({cid:this.channel.cid,parent_id:void 0}),{method:`deleteDraft`})))},this.initEditingAuditState=e=>OS(e),this.clearSnapshots=()=>{this.snapshots=[]},this.getSnapshot=()=>({attachmentManager:this.attachmentManager.getSnapshot(),customDataManager:this.customDataManager.getSnapshot(),linkPreviewsManager:this.linkPreviewsManager.getSnapshot(),locationComposer:this.locationComposer.getSnapshot(),pollComposer:this.pollComposer.getSnapshot(),textComposer:this.textComposer.getSnapshot()}),this.restoreSnapshot=e=>{this.attachmentManager.restoreSnapshot(e.attachmentManager),this.linkPreviewsManager.restoreSnapshot(e.linkPreviewsManager),this.locationComposer.restoreSnapshot(e.locationComposer),this.pollComposer.restoreSnapshot(e.pollComposer),this.customDataManager.restoreSnapshot(e.customDataManager),this.textComposer.restoreSnapshot(e.textComposer)},this.captureSnapshot=(e=this.getSnapshot())=>{this.snapshots.length||this.snapshots.push(e)},this.popSnapshot=()=>this.snapshots.pop(),this.registerEffectHandler=(e,t)=>{this.effectHandlers.registerEffectHandler(e,t)},this.applyEffects=(e=[])=>{this.effectHandlers.applyEffects(e)},this.registerDraftEventSubscriptions=()=>{let e=this.subscribeDraftUpdated(),t=this.subscribeDraftDeleted();return()=>{e(),t()}},this.registerSubscriptions=()=>(this.hasSubscriptions||(this.addUnsubscribeFunction(this.subscribeMessageComposerSetupStateChange()),this.addUnsubscribeFunction(this.subscribeMessageUpdated()),this.addUnsubscribeFunction(this.subscribeMessageDeleted()),this.addUnsubscribeFunction(this.subscribeTextComposerStateChanged()),this.addUnsubscribeFunction(this.subscribeAttachmentManagerStateChanged()),this.addUnsubscribeFunction(this.subscribeLinkPreviewsManagerStateChanged()),this.addUnsubscribeFunction(this.subscribeLocationComposerStateChanged()),this.addUnsubscribeFunction(this.subscribePollComposerStateChanged()),this.addUnsubscribeFunction(this.subscribeCustomDataManagerStateChanged()),this.addUnsubscribeFunction(this.subscribeMessageComposerStateChanged()),this.addUnsubscribeFunction(this.subscribeMessageComposerConfigStateChanged())),this.incrementRefCount(),()=>this.unregisterSubscriptions()),this.subscribeMessageUpdated=()=>{let e=[`message.updated`,`reaction.new`,`reaction.deleted`,`reaction.updated`].map(e=>this.client.on(e,e=>{e.message&&(e.message.id===this.id&&this.initState({composition:e.message}),this.quotedMessage?.id&&e.message.id===this.quotedMessage.id&&this.setQuotedMessage(Ry(e.message)))}).unsubscribe);return()=>e.forEach(e=>e())},this.subscribeMessageComposerSetupStateChange=()=>{let e=null,t=this.client._messageComposerSetupState.subscribeWithSelector(({setupFunction:e})=>({setup:e}),({setup:t})=>{e?.(),e=t?.({composer:this})??null});return()=>{e?.(),t()}},this.subscribeMessageDeleted=()=>this.client.on(`message.deleted`,e=>{e.message&&(e.message.id===this.id?this.clear():this.quotedMessage&&e.message.id===this.quotedMessage.id&&this.setQuotedMessage(null))}).unsubscribe,this.subscribeDraftUpdated=()=>this.client.on(`draft.updated`,e=>{let t=e.draft;!t||(t.parent_id??null)!==(this.threadId??null)||t.channel_cid!==this.channel.cid||this.editedMessage||this.initState({composition:t})}).unsubscribe,this.subscribeDraftDeleted=()=>this.client.on(`draft.deleted`,e=>{let t=e.draft;!t||(t.parent_id??null)!==(this.threadId??null)||t.channel_cid!==this.channel.cid||this.editedMessage||(this.logDraftUpdateTimestamp(),!this.compositionIsEmpty&&this.clear())}).unsubscribe,this.subscribeTextComposerStateChanged=()=>this.textComposer.state.subscribeWithSelector(({text:e})=>[e],([e],t)=>{if(t!==void 0){if(this.logStateUpdateTimestamp(),this.compositionIsEmpty){this.deleteDraft();return}this.linkPreviewsManager.enabled&&(e?this.linkPreviewsManager.findAndEnrichUrls(e):this.linkPreviewsManager.clearPreviews())}}),this.subscribeAttachmentManagerStateChanged=()=>this.attachmentManager.state.subscribe((e,t)=>{if(t!==void 0&&(this.logStateUpdateTimestamp(),this.compositionIsEmpty)){this.deleteDraft();return}}),this.subscribeLocationComposerStateChanged=()=>this.locationComposer.state.subscribe((e,t)=>{if(t!==void 0&&(this.logStateUpdateTimestamp(),this.compositionIsEmpty)){this.deleteDraft();return}}),this.subscribeLinkPreviewsManagerStateChanged=()=>this.linkPreviewsManager.state.subscribe((e,t)=>{if(t!==void 0&&(this.logStateUpdateTimestamp(),this.compositionIsEmpty)){this.deleteDraft();return}}),this.subscribePollComposerStateChanged=()=>this.pollComposer.state.subscribe((e,t)=>{if(t!==void 0&&(this.logStateUpdateTimestamp(),this.compositionIsEmpty)){this.deleteDraft();return}}),this.subscribeCustomDataManagerStateChanged=()=>this.customDataManager.state.subscribe((e,t)=>{t!==void 0&&!this.customDataManager.isMessageDataEqual(e,t)&&this.logStateUpdateTimestamp()}),this.subscribeMessageComposerStateChanged=()=>this.state.subscribe((e,t)=>{t!==void 0&&(this.logStateUpdateTimestamp(),this.compositionIsEmpty&&this.deleteDraft())}),this.subscribeMessageComposerConfigStateChanged=()=>{let e,t=this.configState.subscribeWithSelector(e=>({textDefaultValue:e.text.defaultValue,draftsEnabled:e.drafts.enabled}),({textDefaultValue:t,draftsEnabled:n})=>{this.textComposer.text===``&&t&&this.textComposer.insertText({text:t,selection:{start:0,end:0}}),n&&!e?e=this.registerDraftEventSubscriptions():!n&&e&&(e(),e=null)});return()=>{e?.(),t()}},this.setQuotedMessage=e=>{this.state.partialNext({quotedMessage:e});let t=this.textComposer.command;e&&t&&this.isCommandDisabled(t)&&this.textComposer.clearCommand()},this.toggleShowReplyInChannel=()=>{this.state.partialNext({showReplyInChannel:!this.showReplyInChannel})},this.clear=()=>{this.setQuotedMessage(null),this.initState()},this.restore=()=>{let{editedMessage:e}=this;if(e){this.initState({composition:e});return}this.clear()},this.compose=async()=>{let e=this.editedMessage?.created_at??new Date,t=await this.compositionMiddlewareExecutor.execute({eventName:`compose`,
426initialValue:{message:{id:this.id,parent_id:this.threadId??void 0,type:`regular`},localMessage:{attachments:[],created_at:e,deleted_at:null,error:void 0,id:this.id,mentioned_users:[],parent_id:this.threadId??void 0,pinned_at:this.editedMessage?.pinned_at||null,reaction_groups:null,status:this.editedMessage?this.editedMessage.status:`sending`,text:``,type:`regular`,updated_at:e},sendOptions:{}}});if(t.status!==`discard`)return t.state},this.composeDraft=async()=>{let{state:e,status:t}=await this.draftCompositionMiddlewareExecutor.execute({eventName:`compose`,initialValue:{draft:{id:this.id,parent_id:this.threadId??void 0,text:``}}});if(t!==`discard`)return e},this.createDraft=async()=>{if(this.editedMessage||!this.config.drafts.enabled)return;let e=await this.composeDraft();if(!e)return;let{draft:t}=e;if(this.state.partialNext({draftId:t.id}),this.client.offlineDb)try{let e={channel_cid:this.channel.cid,created_at:new Date().toISOString(),message:t,parent_id:t.parent_id,quoted_message:this.quotedMessage?qte(this.quotedMessage):void 0};await this.client.offlineDb.upsertDraft({draft:e})}catch(e){this.client.logger(`error`,`offlineDb:upsertDraft`,{tags:[`channel`,`offlineDb`],error:e})}this.logDraftUpdateTimestamp(),await this.channel.createDraft(t)},this.deleteDraft=async()=>{if(this.editedMessage||!this.config.drafts.enabled||!this.draftId)return;this.state.partialNext({draftId:null});let e=this.threadId??void 0;if(this.client.offlineDb)try{await this.client.offlineDb.deleteDraft({cid:this.channel.cid,parent_id:e})}catch(e){this.client.logger(`error`,`offlineDb:deleteDraft`,{tags:[`channel`,`offlineDb`],error:e})}this.logDraftUpdateTimestamp(),await this.channel.deleteDraft({parent_id:e})},this.getDraft=async()=>{if(this.editedMessage||!this.config.drafts.enabled||!this.client.userID)return;let e=await this.client.offlineDb?.getDraft({cid:this.channel.cid,userId:this.client.userID,parent_id:this.threadId??void 0});e&&this.initState({composition:e});try{let{draft:e}=await this.channel.getDraft({parent_id:this.threadId??void 0});if(!e)return;this.client.offlineDb?.executeQuerySafely(t=>t.upsertDraft({draft:e}),{method:`upsertDraft`}),this.initState({composition:e})}catch(e){this.client.logger(`error`,`messageComposer:getDraft`,{tags:[`channel`,`messageComposer`],error:e})}},this.createPoll=async()=>{let e=await this.pollComposer.compose();if(!(!e||!e.data.id))try{let t=await this.client.polls.createPoll(e.data);this.state.partialNext({pollId:t?.id})}catch(e){throw this.client.notifications.addError({message:`Failed to create the poll`,origin:{emitter:`MessageComposer`,context:{composer:this}},options:{type:`api:poll:create:failed`,metadata:{reason:e.message},originalError:e instanceof Error?e:void 0}}),e}},this.sendLocation=async()=>{let e=this.locationComposer.validLocation;if(!(this.threadId||!e))try{await this.channel.sendSharedLocation(e),this.refreshId(),this.locationComposer.initState()}catch(e){throw this.client.notifications.addError({message:`Failed to share the location`,origin:{emitter:`MessageComposer`,context:{composer:this}},options:{type:`api:location:create:failed`,metadata:{reason:e.message},originalError:e instanceof Error?e:void 0}}),e}},this.compositionContext=r,r instanceof KS)this.channel=r;else if(r instanceof CS)this.channel=r.channel;else if(r.cid){let[e,t]=r.cid.split(`:`);this.channel=i.channel(e,t)}else throw Error(`MessageComposer requires composition context pointing to channel (channel or context.cid)`);let a=(e,t,n)=>typeof e==`object`?void 0:e===!1&&n===`enabled`?!1:[`string`,`number`,`bigint`,`boolean`,`symbol`].includes(typeof t)?t:e;this.configState=new sb(tS(Lb(Lb(nS,n??{}),{location:{enabled:this.channel.getConfig()?.shared_locations}},a),n));let o;DS(t)?o=t.message:t&&(o=Ry(t)),this.attachmentManager=new Dne({composer:this,message:o}),this.linkPreviewsManager=new cS({composer:this,message:o}),this.locationComposer=new dS({composer:this,message:o}),this.textComposer=new Rne({composer:this,message:o}),this.pollComposer=new _S({composer:this}),this.customDataManager=new iS({composer:this,message:o}),this.editingAuditState=new sb(this.initEditingAuditState(t)),this.state=new sb(kS(t)),this.compositionMiddlewareExecutor=new bx({composer:this}),this.draftCompositionMiddlewareExecutor=new xx({composer:this}),this.effectHandlers=new mS({composer:this})}static evaluateContextType(e){return e instanceof KS?`channel`:e instanceof CS?`thread`:typeof e.legacyThreadId==`string`?`legacy_thread`:`message`}static constructTag(e){return`${this.evaluateContextType(e)}_${e.id}`}get config(){return this.configState.getLatestValue()}get editedMessage(){return this.state.getLatestValue().editedMessage??void 0}set editedMessage(e){this.state.partialNext({editedMessage:e??null})}get contextType(){return e.evaluateContextType(this.compositionContext)}get tag(){return e.constructTag(this.compositionContext)}get threadId(){return this.compositionContext instanceof KS?null:this.compositionContext instanceof CS?this.compositionContext.id:typeof this.compositionContext.legacyThreadId==`string`?this.compositionContext.legacyThreadId:typeof this.compositionContext.parent_id==`string`?this.compositionContext.parent_id:null}get client(){return this.channel.getClient()}get id(){return this.state.getLatestValue().id}get draftId(){return this.state.getLatestValue().draftId}get lastChange(){return this.editingAuditState.getLatestValue().lastChange}get quotedMessage(){return this.state.getLatestValue().quotedMessage}get pollId(){return this.state.getLatestValue().pollId}
426get showReplyInChannel(){return this.state.getLatestValue().showReplyInChannel}get isCommandSendable(){let e=this.textComposer.command;return!e||this.validateCommandSendability(e).ready}get hasSendableData(){return this.isCommandSendable&&!!(!this.attachmentManager.uploadsInProgressCount&&(!this.textComposer.textIsEmpty||this.attachmentManager.successfulUploadsCount>0)||this.pollId||this.locationComposer.validLocation)}get compositionIsEmpty(){return!this.quotedMessage&&this.contentIsEmpty}get contentIsEmpty(){return this.textComposer.textIsEmpty&&!this.attachmentManager.attachments.length&&!this.pollId&&!this.locationComposer.validLocation}get lastChangeOriginIsLocal(){let e=this.lastChange.draftUpdate===null&&!this.editedMessage,t=!!this.editedMessage?.updated_at&&new Date(this.editedMessage.updated_at).getTime()<this.lastChange.stateUpdate,n=!!this.lastChange.draftUpdate&&this.lastChange.draftUpdate<this.lastChange.stateUpdate;return t||n||e}updateConfig(e){this.configState.partialNext(tS(Lb(this.config,e),e))}logStateUpdateTimestamp(){this.editingAuditState.partialNext({lastChange:{...this.lastChange,stateUpdate:new Date().getTime()}})}logDraftUpdateTimestamp(){if(!this.config.drafts.enabled)return;let e=new Date().getTime();this.editingAuditState.partialNext({lastChange:{draftUpdate:e,stateUpdate:e}})}};AS.generateId=Fy;var jS=AS,MS=100,NS=1e3,PS=1e3,FS=3,IS=e=>e instanceof KS,LS=e=>e instanceof CS,RS=class e{constructor({client:e}){this.deliveryReportCandidates=new Map,this.nextDeliveryReportCandidates=new Map,this.markDeliveredRequestPromise=null,this.markDeliveredTimeout=null,this.requestTimeoutMs=NS,this.requestRetryCount=0,this.getNextDeliveryReportCandidate=e=>{let t=this.client.user?.id;if(!t)return;let n=[],r,i,a;if(IS(e)){n=e.state.latestMessages;let o=e.state.read[t]??{};i=o?.last_read,r=o?.last_delivered_at,a=e.cid}else if(LS(e)){n=e.state.getLatestValue().replies;let o=e.state.getLatestValue().read[t]??{};i=o?.lastReadAt,r=o?.lastDeliveredAt,a=`${e.channel.cid}:${e.id}`;return}else return;if(!a)return;let[o]=n.slice(-1);return!o||i>=o.created_at||!o||(r??0)>=o.created_at?{key:a,id:null}:{key:a,id:o.id||null}},this.announceDelivery=e=>{if(!this.canExecuteRequest)return;let{latest_delivered_messages:t,sendBuffer:n}=this.confirmationsFromDeliveryReportCandidates();if(!t.length)return;let r={...e,latest_delivered_messages:t},i=({preventSchedulingRetry:t}={})=>{this.markDeliveredRequestPromise=null;for(let[e,t]of this.nextDeliveryReportCandidates.entries())this.deliveryReportCandidates.set(e,t);this.nextDeliveryReportCandidates=new Map,!t&&this.announceDeliveryBuffered(e)},a=()=>{this.resetBackOff(),i()},o=e=>{let t=new Map(n);for(let[e,n]of this.deliveryReportCandidates.entries())t.set(e,n);this.deliveryReportCandidates=t,Jb(e)&&Yb(e)||e.status>=500?(this.increaseBackOff(),i()):i({preventSchedulingRetry:!0})};this.markDeliveredRequestPromise=this.client.markChannelsDelivered(r).then(a,o)},this.announceDeliveryBuffered=e=>{this.hasTimer||!this.canExecuteRequest||(this.markDeliveredTimeout=setTimeout(()=>{this.markDeliveredTimeout=null,this.announceDelivery(e)},this.requestTimeoutMs))},this.markRead=async(e,t)=>{let n=null;return IS(e)?n=await e.markAsReadRequest(t):LS(e)&&(n=await e.channel.markAsReadRequest({...t,thread_id:e.id})),this.removeCandidateFor(e),n},this.throttledMarkRead=Gy(this.markRead,PS,{leading:!1,trailing:!0}),this.client=e}get markDeliveredRequestInFlight(){return this.markDeliveredRequestPromise!==null}get hasTimer(){return this.markDeliveredTimeout!==null}get hasDeliveryCandidates(){return this.deliveryReportCandidates.size>0}get canExecuteRequest(){return!this.markDeliveredRequestInFlight&&this.hasDeliveryCandidates}static hasPermissionToReportDeliveryFor(e){if(IS(e))return!!e.getConfig()?.delivery_events;if(LS(e))return!!e.channel.getConfig()?.delivery_events}increaseBackOff(){this.requestRetryCount>=FS||(this.requestRetryCount+=1,this.requestTimeoutMs*=2)}resetBackOff(){this.requestTimeoutMs=NS,this.requestRetryCount=0}confirmationsFrom(e){return Array.from(e.entries()).map(([e,t])=>{let[n,r,i]=e.split(`:`);return i?{cid:`${n}:${r}`,id:t,parent_id:i}:{cid:e,id:t}})}confirmationsFromDeliveryReportCandidates(){let e=Array.from(this.deliveryReportCandidates),t=new Map(e.slice(0,MS));return this.deliveryReportCandidates=new Map(e.slice(MS)),{latest_delivered_messages:this.confirmationsFrom(t),sendBuffer:t}}candidateKeyFor(e){if(IS(e))return e.cid;if(LS(e))return`${e.channel.cid}:${e.id}`}trackDeliveredCandidate(t){if(!e.hasPermissionToReportDeliveryFor(t))return;let n=this.getNextDeliveryReportCandidate(t);
426if(!n?.key)return;let r=this.markDeliveredRequestInFlight?this.nextDeliveryReportCandidates:this.deliveryReportCandidates;n.id===null?r.delete(n.key):r.set(n.key,n.id)}removeCandidateFor(e){let t=this.candidateKeyFor(e);t&&(this.deliveryReportCandidates.delete(t),this.nextDeliveryReportCandidates.delete(t))}syncDeliveredCandidates(e){if(this.client.user?.privacy_settings?.delivery_receipts?.enabled!==!1){for(let t of e)this.trackDeliveredCandidate(t);this.announceDeliveryBuffered()}}},zS={timestampMs:-1/0,msgId:``},BS=(e,t)=>e.timestampMs===t.timestampMs?0:e.timestampMs-t.timestampMs,VS=(e,t,n)=>{let r=0,i=e.length;for(;r<i;){let a=r+i>>>1;BS(n(e[a]),t)>=0?i=a:r=a+1}return r},HS=(e,t,n)=>{let r=0,i=e.length;for(;r<i;){let a=r+i>>>1;BS(n(e[a]),t)>0?i=a:r=a+1}return r},US=(e,t,n)=>e.splice(HS(e,n(t),n),0,t),WS=(e,t,n,r)=>{let i=VS(e,n,r);for(;i<e.length&&BS(r(e[i]),n)===0;){if(e[i].user.id===t.user.id){e.splice(i,1);return}i++}},GS=class{constructor({locateMessage:e}){this.byUser=new Map,this.readSorted=[],this.deliveredSorted=[],this.locateMessage=e}ingestInitial(e){this.byUser.clear(),this.readSorted=[],this.deliveredSorted=[];for(let t of e){let e=t.last_read?new Date(t.last_read).getTime():null,n=t.last_delivered_at?new Date(t.last_delivered_at).getTime():null,r=e?this.locateMessage(e)??zS:zS,i=n?this.locateMessage(n)??zS:zS;BS(i,r)<0&&(i=r);let a={user:t.user,lastReadRef:r,lastDeliveredRef:i};this.byUser.set(t.user.id,a),this.readSorted.splice(VS(this.readSorted,r,e=>e.lastReadRef),0,a),this.deliveredSorted.splice(VS(this.deliveredSorted,i,e=>e.lastDeliveredRef),0,a)}}onMessageDelivered({user:e,deliveredAt:t,lastDeliveredMessageId:n}){let r=new Date(t).getTime(),i=n?{timestampMs:r,msgId:n}:this.locateMessage(new Date(t).getTime());if(!i)return;let a=this.ensureUser(e),o=BS(i,a.lastReadRef)<0?a.lastReadRef:i;BS(o,a.lastDeliveredRef)<=0||(WS(this.deliveredSorted,a,a.lastDeliveredRef,e=>e.lastDeliveredRef),a.lastDeliveredRef=o,US(this.deliveredSorted,a,e=>e.lastDeliveredRef))}onMessageRead({user:e,readAt:t,lastReadMessageId:n}){let r=new Date(t).getTime(),i=n?{timestampMs:r,msgId:n}:this.locateMessage(r);if(!i)return;let a=this.ensureUser(e);BS(i,a.lastReadRef)<=0||(WS(this.readSorted,a,a.lastReadRef,e=>e.lastReadRef),a.lastReadRef=i,US(this.readSorted,a,e=>e.lastReadRef),BS(a.lastDeliveredRef,a.lastReadRef)<0&&(WS(this.deliveredSorted,a,a.lastDeliveredRef,e=>e.lastDeliveredRef),a.lastDeliveredRef=a.lastReadRef,US(this.deliveredSorted,a,e=>e.lastDeliveredRef)))}onNotificationMarkUnread({user:e,lastReadAt:t,lastReadMessageId:n}){let r=this.ensureUser(e),i=t?{timestampMs:new Date(t).getTime(),msgId:n??``}:{...zS};BS(i,r.lastReadRef)===0&&i.msgId===r.lastReadRef.msgId||(WS(this.readSorted,r,r.lastReadRef,e=>e.lastReadRef),r.lastReadRef=i,US(this.readSorted,r,e=>e.lastReadRef),BS(r.lastDeliveredRef,r.lastReadRef)<0&&(WS(this.deliveredSorted,r,r.lastDeliveredRef,e=>e.lastDeliveredRef),r.lastDeliveredRef=r.lastReadRef,US(this.deliveredSorted,r,e=>e.lastDeliveredRef)))}readersForMessage(e){let t=VS(this.readSorted,e,({lastReadRef:e})=>e);return this.readSorted.slice(t).map(e=>e.user)}deliveredForMessage(e){let t=VS(this.deliveredSorted,e,({lastDeliveredRef:e})=>e);return this.deliveredSorted.slice(t).map(e=>e.user)}deliveredNotReadForMessage(e){let t=VS(this.deliveredSorted,e,({lastDeliveredRef:e})=>e),n=[];for(let r=t;r<this.deliveredSorted.length;r++){let t=this.deliveredSorted[r];BS(t.lastReadRef,e)<0&&n.push(t.user)}return n}usersWhoseLastReadIs(e){if(!e.msgId)return[];let t=VS(this.readSorted,e,e=>e.lastReadRef),n=HS(this.readSorted,e,e=>e.lastReadRef),r=[];for(let i=t;i<n;i++){let t=this.readSorted[i];t.lastReadRef.msgId===e.msgId&&r.push(t.user)}return r}usersWhoseLastDeliveredIs(e){if(!e.msgId)return[];let t=VS(this.deliveredSorted,e,e=>e.lastDeliveredRef),n=HS(this.deliveredSorted,e,e=>e.lastDeliveredRef),r=[];for(let i=t;i<n;i++){let t=this.deliveredSorted[i];t.lastDeliveredRef.msgId===e.msgId&&r.push(t.user)}return r}hasUserRead(e,t){let n=this.byUser.get(t);return!!n&&BS(n.lastReadRef,e)>=0}hasUserDelivered(e,t){let n=this.byUser.get(t);return!!n&&BS(n.lastDeliveredRef,e)>=0}getUserProgress(e){return this.byUser.get(e)||null}groupUsersByLastReadMessage(){return Array.from(this.byUser.values()).reduce((e,t)=>
426{let n=t.lastReadRef.msgId;return n?(e[n]||(e[n]=[]),e[n].push(t.user),e):e},{})}groupUsersByLastDeliveredMessage(){return Array.from(this.byUser.values()).reduce((e,t)=>{let n=t.lastDeliveredRef.msgId;return n?(e[n]||(e[n]=[]),e[n].push(t.user),e):e},{})}ensureUser(e){let t=this.byUser.get(e.id);return t||(t={user:e,lastReadRef:zS,lastDeliveredRef:zS},this.byUser.set(e.id,t),US(this.readSorted,t,e=>e.lastReadRef),US(this.deliveredSorted,t,e=>e.lastDeliveredRef)),t}},KS=class{constructor(e,t,n,r){this.create=async e=>{let t={...e,watch:!1,state:!1,presence:!1};return await this.query(t,`latest`)},this._callChannelListeners=e=>{let t=this,n=[];t.listeners.all&&n.push(...t.listeners.all),t.listeners[e.type]&&n.push(...t.listeners[e.type]);for(let t of n)typeof t!=`string`&&t(e)},this._channelURL=()=>{if(!this.id)throw Error(`channel id is not defined`);return`${this.getClient().baseURL}/channels/${encodeURIComponent(this.type)}/${encodeURIComponent(this.id)}`};let i=/^[\w_-]+$/,a=/^[\w!_-]+$/;if(!i.test(t))throw Error(`Invalid chat type ${t}, letters, numbers and "_-" are allowed`);if(typeof n==`string`&&!a.test(n))throw Error(`Invalid chat id ${n}, letters, numbers and "!-_" are allowed`);this._client=e,this.type=t,this.id=n,this.data=r,this._data={...r},this.cid=`${t}:${n}`,this.listeners={},this.state=new sne(this),this.initialized=!1,this.offlineMode=!1,this.lastTypingEvent=null,this.isTyping=!1,this.disconnected=!1,this.messageComposer=new jS({client:this._client,compositionContext:this}),this.messageReceiptsTracker=new GS({locateMessage:e=>{let t=this.state.findMessageByTimestamp(e);return t&&{timestampMs:e,msgId:t.id}}}),this.cooldownTimer=new une({channel:this})}getClient(){if(this.disconnected===!0)throw Error(`You can't use a channel after client.disconnect() was called`);return this._client}getConfig(){return this.getClient().configs[this.cid]}async _sendMessage(e,t){return await this.getClient().post(this._channelURL()+`/message`,{message:e,...t})}async sendMessage(e,t){try{let n=this.getClient().offlineDb;if(n){let r=e.id;if(r)return await n.queueTask({task:{channelId:this.id,channelType:this.type,messageId:r,payload:[e,t],type:`send-message`}})}}catch(e){this._client.logger(`error`,`offlineDb:send-message`,{tags:[`channel`,`offlineDb`],error:e})}return await this._sendMessage(e,t)}sendFile(e,t,n,r,i){return this.getClient().sendFile(`${this._channelURL()}/file`,e,t,n,r,i)}sendImage(e,t,n,r,i){return this.getClient().sendFile(`${this._channelURL()}/image`,e,t,n,r,i)}deleteFile(e){return this.getClient().delete(`${this._channelURL()}/file`,{url:e})}deleteImage(e){return this.getClient().delete(`${this._channelURL()}/image`,{url:e})}async sendEvent(e){return this._checkInitialized(),await this.getClient().post(this._channelURL()+`/event`,{event:e})}async search(e,t={}){if(t.offset&&t.next)throw Error(`Cannot specify offset with next`);let n={filter_conditions:{cid:this.cid},...t,sort:t.sort?jy(t.sort):void 0};if(typeof e==`string`)n.query=e;else if(typeof e==`object`)n.message_filter_conditions=e;else throw Error(`Invalid type ${typeof e} for query parameter`);return await this.getClient().wsPromise,await this.getClient().get(this.getClient().baseURL+`/search`,{payload:n})}async queryMembers(e,t=[],n={}){let r,i=this.type,a;return this.id?r=this.id:this.data?.members&&Array.isArray(this.data.members)&&(a=this.data.members),await this.getClient().get(this.getClient().baseURL+`/members`,{payload:{type:i,id:r,members:a,sort:jy(t),filter_conditions:e,...n}})}async updateMemberPartial(e,t){let n=new URL(`${this._channelURL()}/member`);return t?.userId&&n.searchParams.append(`user_id`,t.userId),await this.getClient().patch(n.toString(),e)}async partialUpdateMember(e,t){if(!e)throw Error(`Please specify the user id`);return await this.getClient().patch(this._channelURL()+`/member/${encodeURIComponent(e)}`,t)}async sendReaction(e,t,n){if(!e)throw Error(`Message id is missing`);if(!t||Object.keys(t).length===0)throw Error(`Reaction object is missing`);try{let r=this.getClient().offlineDb;if(r)return await r.queueTask({task:{channelId:this.id,channelType:this.t
426ype,messageId:e,payload:[e,t,n],type:`send-reaction`}})}catch(e){this._client.logger(`error`,`offlineDb:send-reaction`,{tags:[`channel`,`offlineDb`],error:e})}return this._sendReaction(e,t,n)}async _sendReaction(e,t,n){if(!e)throw Error(`Message id is missing`);if(!t||Object.keys(t).length===0)throw Error(`Reaction object is missing`);return await this.getClient().post(this.getClient().baseURL+`/messages/${encodeURIComponent(e)}/reaction`,{reaction:t,...n})}async deleteReaction(e,t,n){if(this._checkInitialized(),!t||!e)throw Error(`Deleting a reaction requires specifying both the message and reaction type`);try{let r=this.getClient().offlineDb;if(r){let i=this.state.messages.find(({id:t})=>t===e),a={created_at:``,updated_at:``,message_id:e,type:t,user_id:this.getClient().userID??n};return i&&await r.deleteReaction({message:i,reaction:a}),await r.queueTask({task:{channelId:this.id,channelType:this.type,messageId:e,payload:[e,t],type:`delete-reaction`}})}}catch(e){this._client.logger(`error`,`offlineDb:delete-reaction`,{tags:[`channel`,`offlineDb`],error:e})}return await this._deleteReaction(e,t,n)}async _deleteReaction(e,t,n){if(this._checkInitialized(),!t||!e)throw Error(`Deleting a reaction requires specifying both the message and reaction type`);let r=this.getClient().baseURL+`/messages/${encodeURIComponent(e)}/reaction/${encodeURIComponent(t)}`;return n?await this.getClient().delete(r,{user_id:n}):await this.getClient().delete(r,{})}async update(e={},t,n){return[`config`,`cid`,`created_by`,`id`,`member_count`,`type`,`created_at`,`updated_at`,`last_message_at`,`own_capabilities`].forEach(t=>{delete e[t]}),await this._update({message:t,data:e,...n})}async updatePartial(e){let t=await this.getClient().patch(this._channelURL(),e),n=[...t.channel.own_capabilities||[]].sort().join()!==[...Array.isArray(this.data?.own_capabilities)?this.data?.own_capabilities:[]].sort().join();return this.data=t.channel,n&&this.getClient().dispatchEvent({type:`capabilities.changed`,cid:this.cid,own_capabilities:t.channel.own_capabilities}),t}async enableSlowMode(e){let t=await this.getClient().post(this._channelURL(),{cooldown:e});return this.data=t.channel,t}async disableSlowMode(){let e=await this.getClient().post(this._channelURL(),{cooldown:0});return this.data=e.channel,e}async sendSharedLocation(e,t){let n=await this.sendMessage({id:e.message_id,shared_location:e,user:t?{id:t}:void 0});return e.end_at&&this.getClient().dispatchEvent({message:n.message,type:`live_location_sharing.started`}),n}async stopLiveLocationSharing(e){let t=await this.getClient().updateLocation({...e,end_at:new Date().toISOString()});this.getClient().dispatchEvent({live_location:t,type:`live_location_sharing.stopped`})}async delete(e={}){return await this.getClient().delete(this._channelURL(),{...e})}async truncate(e={}){return await this.getClient().post(this._channelURL()+`/truncate`,e)}async acceptInvite(e={}){return await this._update({accept_invite:!0,...e})}async rejectInvite(e={}){return await this._update({reject_invite:!0,...e})}async addMembers(e,t,n={}){return await this._update({add_members:e,message:t,...n})}async addFilterTags(e,t,n={}){return await this._update({add_filter_tags:e,message:t,...n})}async removeFilterTags(e,t,n={}){return await this._update({remove_filter_tags:e,message:t,...n})}async addModerators(e,t,n={}){return await this._update({add_moderators:e,message:t,...n})}async assignRoles(e,t,n={}){return await this._update({assign_roles:e,message:t,...n})}async inviteMembers(e,t,n={}){return await this._update({invites:e,message:t,...n})}async removeMembers(e,t,n={}){return await this._update({remove_members:e,message:t,...n})}async demoteModerators(e,t,n={}){return await this._update({demote_moderators:e,message:t,...n})}async _update(e){let t=await this.getClient().post(this._channelURL(),e);return this.data=t.channel,t}async mute(e={}){return await this.getClient().post(this.getClient().baseURL+`/moderation/mute/channel`,{channel_cid:this.cid,...e})}async unmute(e={}){return await this.getClient().post(this.getClient().baseURL+`/moderation/unmute/channel`,{channel_cid:this.cid,...e})}async archive(e={}){let t=this.getClient(),n=e.user_id||t.userID;if(!n)throw Error(`A user_id is required for archiving a channel`);return(await this.partialUpdateMember(n,{set:{archived:!0}})).channel_member}async unarchive(e={}){let t=this.getClient(),n=e.user_id||t.userID;if(!n)throw Error(`A user_id is required for unarchiving a channel`);return(await this.partialUpdateMember(n,{set:{archived:!1}})).channel_member}async pin(e={}){let t=this.getClient(),n=e.user_id||t.userID;if(!n)throw Error(`A user_id is required for pinning a channel`);return(await this.partialUpdateMember(n,{set:{pinned:!0}})).channel_member}async unpin(e={}){let t=this.getClient(),n=e.user_id||t.userID;if(!n)throw Error(`A user_id is required for unpinning a channel`);return(await this.partialUpdateMember(n,{set:{pinned:!1}
426})).channel_member}muteStatus(){return this._checkInitialized(),this.getClient()._muteStatus(this.cid)}sendAction(e,t){if(this._checkInitialized(),!e)throw Error(`Message id is missing`);return this.getClient().post(this.getClient().baseURL+`/messages/${encodeURIComponent(e)}/action`,{message_id:e,form_data:t,id:this.id,type:this.type})}async keystroke(e,t){if(!this._isTypingIndicatorsEnabled())return;let n=new Date,r=this.lastTypingEvent&&n.getTime()-this.lastTypingEvent.getTime();this.lastKeyStroke=n,this.isTyping=!0,(r===null||r>2e3)&&(this.lastTypingEvent=new Date,await this.sendEvent({type:`typing.start`,parent_id:e,...t||{}}))}async updateAIState(e,t,n={}){await this.sendEvent({...n,type:`ai_indicator.update`,message_id:e,ai_state:t})}async clearAIIndicator(){await this.sendEvent({type:`ai_indicator.clear`})}async stopAIResponse(){await this.sendEvent({type:`ai_indicator.stop`})}async stopTyping(e,t){this._isTypingIndicatorsEnabled()&&(this.lastTypingEvent=null,this.isTyping=!1,await this.sendEvent({type:`typing.stop`,parent_id:e,...t||{}}))}_isTypingIndicatorsEnabled(){return!this.getConfig()?.typing_events||!this.getClient().wsConnection?.isHealthy?!1:this.getClient().user?.privacy_settings?.typing_indicators?.enabled??!0}lastMessage(){let e=this.state.latestMessages.length-5;e<0&&(e=0);let t=this.state.latestMessages.length+1,n=this.state.latestMessages.slice(e,t);return n.sort((e,t)=>t.created_at.getTime()-e.created_at.getTime()),n[0]}async markRead(e={}){return await this.getClient().messageDeliveryReporter.markRead(this,e)}async markAsReadRequest(e={}){return this._checkInitialized(),!this.getConfig()?.read_events&&!this.getClient()._isUsingServerAuth()?null:await this.getClient().post(this._channelURL()+`/read`,{...e})}async markUnread(e){return this._checkInitialized(),!this.getConfig()?.read_events&&!this.getClient()._isUsingServerAuth()?Promise.resolve(null):await this.getClient().post(this._channelURL()+`/unread`,{...e})}clean(){this.lastKeyStroke&&new Date().getTime()-this.lastKeyStroke.getTime()>1e3&&this.isTyping&&Dy(this.stopTyping(),`stop typing event`),this.state.clean()}async watch(e){let t={state:!0,watch:!0,presence:!1};await this.getClient().wsPromise,this.getClient()._hasConnectionID()||(t.watch=!1);let n={...t,...e},r=await this.query(n,`latest`);return this.initialized=!0,this.data=r.channel,this._client.logger(`info`,`channel:watch() - started watching channel ${this.cid}`,{tags:[`channel`],channel:this}),r}async stopWatching(){let e=await this.getClient().post(this._channelURL()+`/stop-watching`,{});return this._client.logger(`info`,`channel:watch() - stopped watching channel ${this.cid}`,{tags:[`channel`],channel:this}),e}async getReplies(e,t,n){let r=n?jy(n):void 0,i=await this.getClient().get(this.getClient().baseURL+`/messages/${encodeURIComponent(e)}/replies`,{sort:r,...t});return i.messages&&this.state.addMessagesSorted(i.messages),i}async getPinnedMessages(e,t=[]){return await this.getClient().get(this._channelURL()+`/pinned_messages`,{payload:{...e,sort:jy(t)}})}getReactions(e,t){return this.getClient().get(this.getClient().baseURL+`/messages/${encodeURIComponent(e)}/reactions`,{...t})}getMessagesById(e){return this.getClient().get(this._channelURL()+`/messages`,{ids:e.join(`,`)})}lastRead(){let{userID:e}=this.getClient();if(e)return this.state.read[e]?this.state.read[e].last_read:null}_countMessageAsUnread(e){return!(e.shadowed||e.silent||e.parent_id&&!e.show_in_channel||e.user?.id===this.getClient().userID||e.user?.id&&this.getClient().userMuteStatus(e.user.id)||Array.isArray(this.data?.own_capabilities)&&!this.data?.own_capabilities.includes(`read-events`)||this.getClient()._muteStatus(this.cid).muted)}countUnread(e){if(!e)return this.state.unreadCount;let t=0;for(let n=0;n<this.state.latestMessages.length;n+=1){let r=this.state.latestMessages[n];r.created_at>e&&this._countMessageAsUnread(r)&&t++}return t}countUnreadMentions(){let e=this.lastRead(),t=this.getClient().userID,n=0;for(let r=0;r<this.state.latestMessages.length;r+=1){let i=this.state.latestMessages[r];this._countMessageAsUnread(i)&&(!e||i.created_at>e)&&i.mentioned_users?.some(e=>e.id===t)&&n++}return n}async query(e={},t=`current`){await this.getClient().wsPromise;let n=e.created_by?.id??e.created_by_id??this._data?.created_by?.id??this._data?.created_by_id;this.getClient()._isUsingServerAuth()&&typeof n!=`string`&&this.getClient().logger(`warn`,"Either `created_by` (with `id` property) or `created_by_id` are missing from both `Channel._data` and `options` parameter");let r=`${this.getClient().baseURL}
426/channels/${encodeURIComponent(this.type)}`;this.id&&(r+=`/${encodeURIComponent(this.id)}`);let i=await this.getClient().post(r+`/query`,{data:this._data,state:!0,...e});if(!this.id){this.id=i.channel.id,this.cid=i.channel.cid;let e=Yy(this.type,i.members.map(e=>e.user_id||e.user?.id||``));e&&e in this.getClient().activeChannels&&delete this.getClient().activeChannels[e],!(this.cid in this.getClient().activeChannels)&&this.getClient()._cacheEnabled()&&(this.getClient().activeChannels[this.cid]=this)}this.getClient()._addChannelConfig(i.channel),i.channel.config?.shared_locations!==void 0&&this.messageComposer.updateConfig({location:{enabled:i.channel.config.shared_locations}});let{messageSet:a,filteredMessageIds:o}=this._initializeState(i,t);a.pagination={...a.pagination,...Ky({parentSet:a,messagePaginationOptions:e?.messages,requestedPageSize:e?.messages?.limit??vy,returnedPage:i.messages,filteredReturnedPage:i.messages.filter(e=>!o.includes(e.id)),logger:this.getClient().logger})},this.getClient().polls.hydratePollCache(i.messages,!0),this.getClient().reminders.hydrateState(i.messages),this.messageComposer.initStateFromChannelResponse(i);let s=[...i.channel.own_capabilities||[]].sort().join()!==[...this.data&&Array.isArray(this.data?.own_capabilities)?this.data.own_capabilities:[]].sort().join();return this.data=i.channel,this.offlineMode=!1,this.cooldownTimer.refresh(),s&&this.getClient().dispatchEvent({type:`capabilities.changed`,cid:this.cid,own_capabilities:i.channel.own_capabilities}),this.getClient().dispatchEvent({type:`channels.queried`,queriedChannels:{channels:[i],isLatestMessageSet:a.isLatest}}),this.getClient().offlineDb?.executeQuerySafely(e=>e.upsertChannels?.({channels:[i],isLatestMessagesSet:a.isLatest}),{method:`upsertChannels`}),this.getClient().syncDeliveredCandidates([this]),i}async banUser(e,t){return this._checkInitialized(),await this.getClient().banUser(e,{...t,type:this.type,id:this.id})}async hide(e=null,t=!1){return this._checkInitialized(),await this.getClient().post(`${this._channelURL()}/hide`,{user_id:e,clear_history:t})}async show(e=null){return this._checkInitialized(),await this.getClient().post(`${this._channelURL()}/show`,{user_id:e})}async unbanUser(e,t){return this._checkInitialized(),await this.getClient().unbanUser(e,{...t,type:this.type,id:this.id})}async shadowBan(e,t){return this._checkInitialized(),await this.getClient().shadowBan(e,{...t,type:this.type,id:this.id})}async removeShadowBan(e){return this._checkInitialized(),await this.getClient().removeShadowBan(e,{type:this.t
426ype,id:this.id})}async vote(e,t,n){return await this.getClient().castPollVote(e,t,n)}async removeVote(e,t,n){return await this.getClient().removePollVote(e,t,n)}async _createDraft(e){return await this.getClient().post(this._channelURL()+`/draft`,{message:e})}async createDraft(e){try{let t=this.getClient().offlineDb;if(t)return await t.queueTask({task:{channelId:this.id,channelType:this.type,threadId:e.parent_id,payload:[e],type:`create-draft`}})}catch(e){this._client.logger(`error`,`offlineDb:create-draft`,{tags:[`channel`,`offlineDb`],error:e})}return this._createDraft(e)}async _deleteDraft({parent_id:e}={}){return await this.getClient().delete(this._channelURL()+`/draft`,{parent_id:e})}async deleteDraft(e={}){let{parent_id:t}=e;try{let n=this.getClient().offlineDb;if(n)return await n.queueTask({task:{channelId:this.id,channelType:this.type,threadId:t,payload:[e],type:`delete-draft`}})}catch(e){this._client.logger(`error`,`offlineDb:delete-draft`,{tags:[`channel`,`offlineDb`],error:e})}return this._deleteDraft(e)}async getDraft({parent_id:e}={}){return await this.getClient().get(this._channelURL()+`/draft`,{parent_id:e})}on(e,t){let n=t?e:`all`,r=t||e;return n in this.listeners||(this.listeners[n]=[]),this._client.logger(`info`,`Attaching listener for ${n} event on channel ${this.cid}`,{tags:[`event`,`channel`],channel:this}),this.listeners[n].push(r),{unsubscribe:()=>{this._client.logger(`info`,`Removing listener for ${n} event from channel ${this.cid}`,{tags:[`event`,`channel`],channel:this}),this.listeners[n]=this.listeners[n].filter(e=>e!==r)}}}off(e,t){let n=t?e:`all`,r=t||e;n in this.listeners||(this.listeners[n]=[]),this._client.logger(`info`,`Removing listener for ${n} event from channel ${this.cid}`,{tags:[`event`,`channel`],channel:this}),this.listeners[n]=this.listeners[n].filter(e=>e!==r)}_handleChannelEvent(e){let t=this;this._client.logger(`info`,`channel:_handleChannelEvent - Received event of type { ${e.type} } on ${this.cid}`,{tags:[`event`,`channel`],channel:this});let n=t.state;switch(e.type){case`typing.start`:e.user?.id&&(n.typing[e.user.id]=e);break;case`typing.stop`:e.user?.id&&delete n.typing[e.user.id];break;case`message.read`:if(e.user?.id&&e.created_at){let t=n.read[e.user.id];n.read[e.user.id]={...t,last_read:new Date(e.created_at),last_read_message_id:e.last_read_message_id,user:e.user,unread_messages:0},this.messageReceiptsTracker.onMessageRead({user:e.user,readAt:e.created_at,lastReadMessageId:e.last_read_message_id});let r=this.getClient();e.user?.id===r.user?.id&&(n.unreadCount=0,r.syncDeliveredCandidates([this]))}break;case`message.delivered`:if(e.user?.id&&e.created_at){let t=n.read[e.user.id];n.read[e.user.id]={...t,last_delivered_at:e.last_delivered_at?new Date(e.last_delivered_at):void 0,last_delivered_message_id:e.last_delivered_message_id,user:e.user},this.messageReceiptsTracker.onMessageDelivered({user:e.user,deliveredAt:e.created_at,lastDeliveredMessageId:e.last_delivered_message_id});let r=this.getClient();e.user?.id===r.user?.id&&r.syncDeliveredCandidates([this])}break;case`user.watching.start`:case`user.updated`:e.user?.id&&(n.watchers[e.user.id]=e.user);break;case`user.watching.stop`:e.user?.id&&delete n.watchers[e.user.id];break;case`message.deleted`:e.message&&(this._extendEventWithOwnReactions(e),e.hard_delete?n.removeMessage(e.message):n.addMessageSorted(e.message,!1,!1),n.removeQuotedMessageReferences(e.message),e.message.pinned&&n.removePinnedMessage(e.message));break;case`user.messages.deleted`:e.user&&this.state.deleteUserMessages(e.user,!!e.hard_delete,new Date(e.created_at??Date.now()));break;case`message.new`:if(e.message){let t=this.getClient(),r=e.user?.id===t.user?.id,i=e.message.parent_id&&!e.message.show_in_channel;(this.state.isUpToDate||i)&&n.addMessageSorted(e.message,r),e.message.pinned&&n.addPinnedMessage(e.message);let a=r||i;if(r&&this.cooldownTimer.refresh(),a)break;if(e.user?.id)for(let t in n.read)t===e.user.id?n.read[e.user.id]={last_read:new Date(e.created_at),user:e.user,unread_messages:0,last_delivered_at:new Date(e.created_at),last_delivered_message_id:e.message.id}:n.read[t].unread_messages+=1;this._countMessageAsUnread(e.message)&&(n.unreadCount+=1),t.syncDeliveredCandidates([this])}break;case`message.updated`:case`message.undeleted`:e.message&&(this._extendEventWithOwnReactions(e),n.addMessageSorted(e.message,!1,!1),n._updateQuotedMessageReferences({message:e.message}),e.message.pinned?n.addPinnedMessage(e.message):n.removePinnedMessage(e.message));break;case`channel.truncated`:if(e.channel?.truncated_at){let t=+new Date(e.channel.truncated_at);
426n.messageSets.forEach((e,r)=>{e.messages.forEach(({created_at:e,id:i})=>{t>+e&&n.removeMessage({id:i,messageSetIndex:r})})}),n.pinnedMessages.forEach(({id:e,created_at:r})=>{t>+r&&n.removePinnedMessage({id:e})}),n.unreadCount=this.countUnread(new Date(e.channel.truncated_at))}else n.clearMessages(),n.unreadCount=0;e.message&&(n.addMessageSorted(e.message),e.message.pinned&&n.addPinnedMessage(e.message));break;case`member.added`:case`member.updated`:{let t={...e.member};t.pinned_at===null&&delete t.pinned_at,t.archived_at===null&&delete t.archived_at,t?.user&&(n.members={...n.members,[t.user.id]:t});let r=this.getClient().userID;typeof r==`string`&&typeof t?.user?.id==`string`&&t.user.id===r&&(n.membership=t);break}case`member.removed`:if(e.user?.id){let t={...n.members};delete t[e.user.id],n.members=t}break;case`notification.mark_unread`:{if(e.user?.id!==this.getClient().user?.id||!e.user)break;let t=e.unread_messages??0,r=n.read[e.user.id];n.read[e.user.id]={...r,first_unread_message_id:e.first_unread_message_id,last_read:new Date(e.last_read_at),last_read_message_id:e.last_read_message_id,user:e.user,unread_messages:t},n.unreadCount=t,this.messageReceiptsTracker.onNotificationMarkUnread({user:e.user,lastReadAt:e.last_read_at,lastReadMessageId:e.last_read_message_id});break}case`channel.updated`:e.channel&&(e.channel?.frozen!==void 0&&e.channel.frozen!==t.data?.frozen&&this.query({state:!1,messages:{limit:0},watchers:{limit:0}}),t.data={...e.channel,hidden:e.channel?.hidden??t.data?.hidden,own_capabilities:e.channel?.own_capabilities??t.data?.own_capabilities},this.cooldownTimer.refresh());break;case`reaction.new`:if(e.message&&e.reaction){let{message:t,reaction:r}=e;e.message=n.addReaction(r,t)}break;case`reaction.deleted`:if(e.message&&e.reaction){let{message:t,reaction:r}=e;e.message=n.removeReaction(r,t)}break;case`reaction.updated`:if(e.message&&e.reaction){let{message:t,reaction:r}=e;e.message=n.addReaction(r,t,!0)}break;case`channel.hidden`:t.data={...t.data,blocked:!!e.channel?.blocked,hidden:!0},e.clear_history&&n.clearMessages();break;case`channel.visible`:t.data={...t.data,blocked:!!e.channel?.blocked,hidden:!1},this.getClient().offlineDb?.handleChannelVisibilityEvent({event:e});break;case`user.banned`:if(!e.user?.id)break;n.members[e.user.id]={...n.members[e.user.id]||{},shadow_banned:!!e.shadow,banned:!e.shadow,user:{...n.members[e.user.id]?.user||{},...e.user}};break;case`user.unbanned`:if(!e.user?.id)break;n.members[e.user.id]={...n.members[e.user.id]||{},shadow_banned:!1,banned:!1,user:{...n.members[e.user.id]?.user||{},...e.user}};break;default:}e.watcher_count!==void 0&&(t.state.watcher_count=e.watcher_count)}_checkInitialized(){if(!this.initialized&&!this.offlineMode&&!this.getClient()._isUsingServerAuth())throw Error(`Channel ${this.cid} hasn't been initialized yet. Make sure to call .watch() and wait for it to resolve`)}_initializeState(e,t=`latest`){let{state:n,user:r,userID:i}=this.getClient();if(e.members){this._hydrateMembers({members:e.members});for(let t of e.members)t.user&&n.updateUserReference(t.user,this.cid)}this.state.membership=e.membership||{};let a=e.messages||[];this.state.messages||this.state.initMessages();let{messageSet:o,filteredMessageIds:s}=this.state.addMessagesSorted(a,!1,!0,!0,t);if(this.state.pinnedMessages||(this.state.pinnedMessages=[]),this.state.addPinnedMessages(e.pinned_messages||[]),e.pending_messages&&(this.state.pending_messages=e.pending_messages),e.watcher_count!==void 0&&(this.state.watcher_count=e.watcher_count),e.watchers)for(let t of e.watchers)t&&(n.updateUserReference(t,this.cid),this.state.watchers[t.id]=t);if(i!=null){let e=this.state.last_message_at||new Date;r&&(this.state.read[r.id]={user:r,last_read:e,unread_messages:0})}if(e.read){for(let t of e.read)this.state.read[t.user.id]={last_delivered_at:t.last_delivered_at?new Date(t.last_delivered_at):void 0,last_delivered_message_id:t.last_delivered_message_id,last_read:new Date(t.last_read),last_read_message_id:t.last_read_message_id,unread_messages:t.unread_messages??0,user:t.user},t.user.id===r?.id&&(this.state.unreadCount=this.state.read[t.user.id].unread_messages);this.messageReceiptsTracker.ingestInitial(e.read)}return{messageSet:o,filteredMessageIds:s}}_extendEventWithOwnReactions(e){if(!e.message)return;let t=this.state.findMessage(e.message.id,e.message.parent_id);t&&(e.message.own_reactions=t.own_reactions)}_hydrateMembers({members:e,overrideCurrentState:t=!0}){let n=e.reduce((e,t)=>
426(t.user&&(e[t.user.id]=t),e),{});t?this.state.members=n:!t&&e.length&&(this.state.members={...this.state.members,...n})}_disconnect(){this._client.logger(`info`,`channel:disconnect() - Disconnecting the channel ${this.cid}`,{tags:[`connection`,`channel`],channel:this}),this.disconnected=!0,this.cooldownTimer.clearTimeout(),this.state.setIsUpToDate(!1)}},qS=class{constructor({client:e}){this.client=e,this.users={},this.userChannelReferences={}}updateUsers(e){for(let t of e)this.updateUser(t)}updateUser(e){e!=null&&this.client._cacheEnabled()&&(this.users[e.id]=e)}updateUserReference(e,t){e==null||!this.client._cacheEnabled()||(this.updateUser(e),this.userChannelReferences[e.id]||(this.userChannelReferences[e.id]={}),this.userChannelReferences[e.id][t]=!0)}deleteAllChannelReference(e){for(let t in this.userChannelReferences)delete this.userChannelReferences[t][e]}},JS=class{constructor(){this.connectionStartTimestamp=null,this.wsTotalFailures=0,this.wsConsecutiveFailures=0,this.instanceClientId=Ny()}},YS=async(e,t)=>{for(let n=0;n<3;n++){try{await tp.post(`https://chat-insights.getstream.io/insights/${e}`,t)}catch{await Oy((n+1)*3e3);continue}break}};function XS(e,t){return{...t,...ZS(e)}}function ZS(e){let{client:t}=e;return{ready_state:e.ws?.readyState,url:e._buildUrl(),api_key:t.key,start_ts:t.insightMetrics.connectionStartTimestamp,end_ts:new Date().getTime(),auth_type:t.getAuthType(),token:t.tokenManager.token,user_id:t.userID,user_details:t._user,device:t.options.device,client_id:e.connectionID,ws_details:e.ws,ws_consecutive_failures:t.insightMetrics.wsConsecutiveFailures,ws_total_failures:t.insightMetrics.wsTotalFailures,request_id:e.requestID,online:typeof navigator<`u`?navigator?.onLine:null,user_agent:typeof navigator<`u`?navigator?.userAgent:null,instance_client_id:t.insightMetrics.instanceClientId}}function QS(e){return ZS(e)}var $S=e=>e.code!==void 0,eC=e=>e.error!==void 0,tC=class{constructor({client:e}){this._buildUrl=()=>{let e=this.client._buildWSPayload(this.requestID),t=this.client.tokenManager.getToken(),n=this.client.options.wsUrlParams,r=new URLSearchParams(n);return r.set(`json`,e),r.set(`api_key`,this.client.key),r.set(`authorization`,`${t}`),r.set(`stream-auth-type`,this.client.getAuthType()),r.set(`X-Stream-Client`,this.client.getUserAgent()),`${this.client.wsBaseURL}/connect?${r.toString()}`},this.onlineStatusChanged=e=>{e.type===`offline`?(this._log(`onlineStatusChanged() - Status changing to offline`),this._setHealth(!1)):e.type===`online`&&(this._log(`onlineStatusChanged() - Status changing to online. isHealthy: ${this.isHealthy}`),this.isHealthy||this._reconnect({interval:10}))},this.onopen=e=>{this.wsID===e&&this._log(`onopen() - onopen callback`,{wsID:e})},this.onmessage=(e,t)=>{if(this.wsID!==e||(this._log(`onmessage() - onmessage callback`,{event:t,wsID:e}),typeof t.data!=`string`))return;let n=JSON.parse(t.data);if(!this.isResolved){if(this.isResolved=!0,n.error){this.rejectPromise?.(this._errorFromWSEvent(n,!1));return}this.resolvePromise?.(n),this._setHealth(!0)}this.lastEvent=new Date,n.type===`health.check`&&this.scheduleNextPing(),this.client.dispatchEvent(n),this.scheduleConnectionCheck()},this.onclose=(e,t)=>{if(this.wsID===e)if(this._log(`onclose() - onclose callback - `+t.code,{event:t,wsID:e}),t.code===Ay.WS_CLOSED_SUCCESS){let e=Error(`WS connection reject with error ${t.reason}`);e.reason=t.reason,e.code=t.code,e.wasClean=t.wasClean,e.target=t.target,this.rejectPromise?.(e),this._log(`onclose() - WS connection reject with error ${t.reason}`,{event:t})}else this.consecutiveFailures+=1,this.totalFailures+=1,this._setHealth(!1),this.isConnecting=!1,this.rejectPromise?.(this._errorFromWSEvent(t)),this._log(`onclose() - WS connection closed. Calling reconnect ...`,{event:t}),this._reconnect()},this.onerror=(e,t)=>{this.wsID===e&&(this.consecutiveFailures+=1,this.totalFailures+=1,this._setHealth(!1),this.isConnecting=!1,this.rejectPromise?.(this._errorFromWSEvent(t)),this._log(`onerror() - WS connection resulted into error`,{event:t}),this._reconnect())},this._setHealth=e=>{if(e!==this.isHealthy){if(this.isHealthy=e,this.isHealthy){this.client.dispatchEvent({type:`connection.changed`,online:this.isHealthy});return}setTimeout(()=>{this.isHealthy||this.client.dispatchEvent({type:`connection.changed`,online:this.isHealthy})},5e3)}},this._errorFromWSEvent=(e,t=!0)=>{let n,r,i;$S(e)&&(n=e.code,r=`unknown`,i=e.reason),eC(e)&&(n=e.error.code,r=e.error.StatusCode,i=e.error.message),this._log(`_errorFromWSEvent() - WS failed with code ${n}`,{event:e},`warn`);let a=Error(`WS failed with code ${n} and reason - ${i}`);return a.code=n,a.StatusCode=r,a.isWSFailure=t,a},this._setupConnectionPromise=()=>{this.isResolved=!1,this.connectionOpen=new Promise((e,t)=>
426{this.resolvePromise=e,this.rejectPromise=t})},this.scheduleNextPing=()=>{this.healthCheckTimeoutRef&&clearTimeout(this.healthCheckTimeoutRef),this.healthCheckTimeoutRef=setTimeout(()=>{let e=[{type:`health.check`,client_id:this.client.clientID}];try{this.ws?.send(JSON.stringify(e))}catch{}},this.pingInterval)},this.scheduleConnectionCheck=()=>{this.connectionCheckTimeoutRef&&clearTimeout(this.connectionCheckTimeoutRef),this.connectionCheckTimeoutRef=setTimeout(()=>{let e=new Date;this.lastEvent&&e.getTime()-this.lastEvent.getTime()>this.connectionCheckTimeout&&(this._log(`scheduleConnectionCheck - going to reconnect`),this._setHealth(!1),this._reconnect())},this.connectionCheckTimeout)},this.client=e,this.consecutiveFailures=0,this.totalFailures=0,this.isConnecting=!1,this.isDisconnected=!1,this.isResolved=!1,this.isHealthy=!1,this.wsID=1,this.lastEvent=null,this.pingInterval=25*1e3,this.connectionCheckTimeout=this.pingInterval+10*1e3,Iy(this.onlineStatusChanged)}_log(e,t={},n=`info`){this.client.logger(n,`connection:`+e,{tags:[`connection`],...t})}setClient(e){this.client=e}async connect(e=15e3){if(this.isConnecting)throw Error(`You've called connect twice, can only attempt 1 connection at the time`);this.isDisconnected=!1;try{let e=await this._connect();this.consecutiveFailures=0,this._log(`connect() - Established ws connection with healthcheck: ${e}`)}catch(e){this.isHealthy=!1,this.consecutiveFailures+=1;let t=e;if(t.code===Ay.TOKEN_EXPIRED&&!this.client.tokenManager.isStatic())this._log(`connect() - WS failure due to expired token, so going to try to reload token and reconnect`),this._reconnect({refreshToken:!0});else if(!t.isWSFailure)throw Error(JSON.stringify({code:t.code,StatusCode:t.StatusCode,message:t.message,isWSFailure:t.isWSFailure}))}return await this._waitForHealthy(e)}_waitForHealthy(e=15e3){return Promise.race([(async()=>{for(let t=0;t<=e;t+=50)try{return await this.connectionOpen}catch(n){if(t===e)throw Error(JSON.stringify({code:n.code,StatusCode:n.StatusCode,message:n.message,isWSFailure:n.isWSFailure}));await Oy(50)}})(),(async()=>{throw await Oy(e),this.isConnecting=!1,Error(JSON.stringify({code:``,StatusCode:``,message:`initial WS connection could not be established`,isWSFailure:!0}))})()])}disconnect(e){this._log(`disconnect() - Closing the websocket connection for wsID ${this.wsID}`),this.wsID+=1,this.isConnecting=!1,this.isDisconnected=!0,this.healthCheckTimeoutRef&&clearInterval(this.healthCheckTimeoutRef),this.connectionCheckTimeoutRef&&clearInterval(this.connectionCheckTimeoutRef),Ly(this.onlineStatusChanged),this.isHealthy=!1,this.ws&&this.ws.removeAllListeners&&this.ws.removeAllListeners();let t,{ws:n}=this;return n&&n.close&&n.readyState===n.OPEN?(t=new Promise(t=>{let r=e=>{this._log(`disconnect() - resolving isClosedPromise ${e?`with`:`without`} close frame`,{event:e}),t()};n.onclose=r,setTimeout(r,e??1e3)}),this._log(`disconnect() - Manually closed connection by calling client.disconnect()`),n.close(Ay.WS_CLOSED_SUCCESS,`Manually closed connection by calling client.disconnect()`)):(this._log(`disconnect() - ws connection doesn't exist or it is already closed.`),t=Promise.resolve()),delete this.ws,t}async _connect(){if(this.isConnecting||this.isDisconnected&&this.client.options.enableWSFallback)return;this.isConnecting=!0,this.requestID=Ny(),this.client.insightMetrics.connectionStartTimestamp=new Date().getTime();let e=!1;try{this._log(`_connect() - waiting for token`),await this.client.tokenManager.tokenReady(),e=!0}catch{}try{e||(this._log(`_connect() - tokenProvider failed before, so going to retry`),await this.client.tokenManager.loadToken()),this._setupConnectionPromise();let t=this._buildUrl();this._log(`_connect() - Connecting to ${t}`,{wsURL:t,requestID:this.requestID}),this.ws=new Yv(t),this.ws.onopen=this.onopen.bind(this,this.wsID),this.ws.onclose=this.onclose.bind(this,this.wsID),this.ws.onerror=this.onerror.bind(this,this.wsID),this.ws.onmessage=this.onmessage.bind(this,this.wsID);let n=await this.connectionOpen;if(this.isConnecting=!1,n)return this.connectionID=n.connection_id,this.client.insightMetrics.wsConsecutiveFailures>0&&this.client.options.enableInsights&&(YS(`ws_success_after_failure`,QS(this)),this.client.insightMetrics.wsConsecutiveFailures=0),n}catch(e){if(this.isConnecting=!1,this._log(`_connect() - Error - `,e),this.client.options.enableInsights){this.client.insightMetrics.wsConsecutiveFailures++,this.client.insightMetrics.wsTotalFailures++;let t=XS(this,Wte(e));YS?.(`ws_fatal`,t)}throw e}}async _reconnect(e={}){if(this._log(`_reconnect() - Initiating the reconnect`),this.isConnecting||this.isHealthy){this._log(`_reconnect() - Abort (1) since already connecting or healthy`);return}let t=e.interval;if(t||=My(this.consecutiveFailures),await Oy(t),this.isConnecting||this.isHealthy){this._log(`_reconnect() - Abort (2) since already connecting or healthy`);return}if(this.isDisconnected&&this.client.options.enableWSFallback){this._log(`_reconnect() - Abort (3) since disconnect() is called`);return}this._log(`_reconnect() - Destroying current WS connection`),this._destroyCurrentWSConnection(),e.refreshToken&&await this.client.tokenManager.loadToken();try{await this._connect(),this._log(`_reconnect() - Waiting for recoverCallBack`),await this.client.re
426coverState(),this._log(`_reconnect() - Finished recoverCallBack`),this.consecutiveFailures=0}catch(e){if(this.isHealthy=!1,this.consecutiveFailures+=1,e.code===Ay.TOKEN_EXPIRED&&!this.client.tokenManager.isStatic())return this._log(`_reconnect() - WS failure due to expired token, so going to try to reload token and reconnect`),this._reconnect({refreshToken:!0});e.isWSFailure&&(this._log(`_reconnect() - WS failure, so going to try to reconnect`),this._reconnect())}this._log(`_reconnect() - == END ==`)}_destroyCurrentWSConnection(){this.wsID+=1;try{this?.ws?.removeAllListeners(),this?.ws?.close()}catch{}}},nC=()=>({uploads:{}}),rC=(e,t)=>({...e,[t.id]:{...e[t.id],...t}}),iC=(e,t)=>{if(!(t.id in e))return null;let n=e[t.id];return{...e,[t.id]:{...n,...t}}},aC=class{constructor(e){this.client=e,this.inFlightUploads=new Map,this.getUpload=e=>this.uploads[e],this.reset=()=>{for(let{abortController:e}of this.inFlightUploads.values())e.abort();this.inFlightUploads.clear(),this.state.next(nC())},this.deleteUploadRecord=e=>{let t=this.inFlightUploads.get(e);t&&(this.inFlightUploads.delete(e),t.abortController.abort()),this.state.next(t=>{if(!(e in t.uploads))return t;let n={...t.uploads};return delete n[e],{...t,uploads:n}})},this.upload=({id:e,channelCid:t,file:n})=>{let r=this.inFlightUploads.get(e);if(r)return r.promise;let i,a,o=new Promise((e,t)=>{i=e,a=t}),s=new AbortController;return this.inFlightUploads.set(e,{promise:o,abortController:s}),(async()=>{let r=this.resolveAttachmentManager(t),o=r.config.trackUploadProgress;try{this.upsertUpload({id:e,uploadProgress:o?0:void 0});let t=o?t=>{this.updateUpload({id:e,uploadProgress:t})}:void 0,a={abortSignal:s.signal,...t?{onProgress:t}:{}},c=await r.doUploadRequest(n,a);i(c)}catch(e){a(e)}finally{this.inFlightUploads.delete(e),this.deleteUploadRecord(e)}})(),o},this.upsertUpload=e=>{this.state.partialNext({uploads:rC(this.uploads,e)})},this.updateUpload=e=>{this.state.next(t=>{let n=iC(t.uploads,e);return n?{...t,uploads:n}:t})},this.state=new sb(nC())}resolveAttachmentManager(e){let t=e.indexOf(`:`);if(t<=0||t===e.length-1)throw Error(`Invalid channelCid: ${e}`);let n=e.slice(0,t),r=e.slice(t+1);return this.client.channel(n,r).messageComposer.attachmentManager}get uploads(){return this.state.getLatestValue().uploads}},oC=iy(oy()),sC=iy(sy()),cC=iy(cy());function lC(e,t,n={},r={}){if(typeof t!=`string`)throw TypeError(`userId should be a string`);let i={user_id:t,...n};if(oC.default==null||oC.default.sign==null)throw Error(`Unable to find jwt crypto, if you are getting this error is probably because you are trying to generate tokens on browser or React Native (or other environment where crypto functions are not available). Please Note: token should only be generated server-side.`);let a=Object.assign({algorithm:`HS256`,noTimestamp:!0},r);return i.iat&&(a.noTimestamp=!1),oC.default.sign(i,e,a)}function uC(e,t={}){let n={server:!0},r=Object.assign({algorithm:`HS256`,noTimestamp:!0},t);return oC.default.sign(n,e,r)}function dC(e){let t=e.split(`.`);if(t.length!==3)return``;let n=t[1],r=py(n);return JSON.parse(r).user_id}function fC(e){return[`eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9`,fy(JSON.stringify({user_id:e})),`devtoken`].join(`.`)}function pC(e,t,n){let r=Buffer.from(n,`utf8`),i=sC.default.createHmac(`sha256`,r).update(e).digest(`hex`);try{return sC.default.timingSafeEqual(Buffer.from(i),Buffer.from(t))}catch{return!1}}var mC={signatureMismatch:`signature mismatch`,invalidBase64:`invalid base64 encoding`,gzipFailed:`gzip decompression failed`,invalidJson:`invalid JSON payload`},hC=class extends Error{constructor(e=mC.signatureMismatch){super(e),this.name=`InvalidWebhookError`}};function gC(e){let t=Buffer.from([31,139]),n=Buffer.isBuffer(e)?e:Buffer.from(e);if(n.length>=2&&n.subarray(0,2).equals(t))try{return cC.default.gunzipSync(n)}catch{throw new hC(mC.gzipFailed)}return n}function _C(e){if(!/^[A-Za-z0-9+/]*={0,2}$/.test(e)||e.length%4!=0)throw new hC(mC.invalidBase64);let t=Buffer.from(e,`base64`);if(t.toString(`base64`).length!==e.length)throw new hC(mC.invalidBase64);return gC(t)}function vC(e){return _C(yC(e)??e)}function yC(e){let t=e.replace(/^[\s\uFEFF]+/,``);if(!t.startsWith(`{`))return null;let n;try{n=JSON.parse(t)}catch{return null}return typeof n!=`object`||!n||Array.isArray(n)||typeof n.Message!=`string`?null:n.Message}function bC(e){let t=Buffer.isBuffer(e)?e.toString(`utf8`):e;try{return JSON.parse(t)}catch{throw new hC(mC.invalidJson)}}function xC(e,t,n){if(!pC(e,t,n))throw new hC(mC.signatureMismatch);return bC(e)}function SC(e,t,n){return xC(gC(e),t,n)}function CC(e){return bC(_C(e))}function wC(e){return bC(vC(e))}var TC=class{constructor(e){this.setTokenOrProvider=async(e,t)=>{this.validateToken(e,t),this.user=t,ky(e)&&(this.tokenProvider=e,this.type=`provider`),typeof e==`string`&&(this.token=e,this.type=`static`),!e&&this.user&&this.secret&&(this.token=lC(this.secret,t.id,{},{}),this.type=`static`),await this.loadToken()},this.reset=()=>{this.token=void 0,this.tokenProvider=void 0,this.type=`static`,this.user=void 0,this.loadTokenPromise=null},this.validateToken=(e,t)=>{if(!(t&&t.anon&&!e)){if(!this.secret&&!e)throw Error(`User token can not be empty`);if(e&&typeof e!=`string`&&!ky(e))throw Error(`user token should either be a string or a function`);if(typeof e==`string`){if(t.anon&&e===``)return;let n=dC(e);if(e!=null&&(n==null||n===``||n!==t.id))throw Error(`userToken does not have a user_id or is not matching with user.id`)}}},this.tokenReady=()=>this.loadTokenPromise,this.loadToken=()=>(this.loadTokenPromise=new Promise(async(e,t)=>
426{if(this.type===`static`)return e(this.token);if(this.tokenProvider&&typeof this.tokenProvider!=`string`){try{this.token=await this.tokenProvider()}catch(e){return t(Error(`Call to tokenProvider failed with message: ${e}`,{cause:e}))}e(this.token)}}),this.loadTokenPromise),this.getToken=()=>{if(this.token||this.user&&this.user.anon&&!this.token)return this.token;if(this.secret)return uC(this.secret);throw Error(`Both secret and user tokens are not set. Either client.connectUser wasn't called or client.disconnect was called`)},this.isStatic=()=>this.type===`static`,this.loadTokenPromise=null,e&&(this.secret=e),this.type=`static`,this.secret&&(this.token=uC(this.secret))}},EC=class{constructor({client:e}){this._onlineStatusChanged=e=>{if(this._log(`_onlineStatusChanged() - ${e.type}`),e.type===`offline`){this._setState(`CLOSED`),this.cancelToken?.cancel(`disconnect() is called`),this.cancelToken=void 0;return}e.type===`online`&&this.state===`CLOSED`&&this.connect(!0)},this._req=async(e,t,n)=>{!this.cancelToken&&!e.close&&(this.cancelToken=tp.CancelToken.source());try{let n=await this.client.doAxiosRequest(`get`,this.client.baseURL.replace(`:3030`,`:8900`)+`/longpoll`,void 0,{config:{...t,cancelToken:this.cancelToken?.token},params:e});return this.consecutiveFailures=0,n}catch(r){if(this.consecutiveFailures+=1,n&&Yb(r))return this._log(`_req() - Retryable error, retrying request`),await Oy(My(this.consecutiveFailures)),this._req(e,t,n);throw r}},this._poll=async()=>{for(;this.state===`CONNECTED`;)try{let e=await this._req({},{timeout:3e4},!0);if(e.events?.length)for(let t=0;t<e.events.length;t++)this.client.dispatchEvent(e.events[t])}catch(e){if(tp.isCancel(e)){this._log(`_poll() - axios canceled request`);return}if(Bne(e)){this._log(`_poll() - ConnectionID error, connecting without ID...`),this._setState(`DISCONNECTED`),this.connect(!0);return}if(Jb(e)&&!Yb(e)){this._setState(`CLOSED`);return}await Oy(My(this.consecutiveFailures))}},this.connect=async(e=!1)=>{if(this.state===`CONNECTING`){this._log(`connect() - connecting already in progress`,{reconnect:e},`warn`);return}if(this.state===`CONNECTED`){this._log(`connect() - already connected and polling`,{reconnect:e},`warn`);return}this._setState(`CONNECTING`),this.connectionID=void 0;try{let{event:t}=await this._req({json:this.client._buildWSPayload()},{timeout:8e3},e);return this._setState(`CONNECTED`),this.connectionID=t.connection_id,this.client.dispatchEvent(t),this._poll(),e&&this.client.recoverState(),t}catch(e){throw this._setState(`CLOSED`),e}},this.isHealthy=()=>!!this.connectionID&&this.state===`CONNECTED`,this.disconnect=async(e=2e3)=>{Ly(this._onlineStatusChanged),this._setState(`DISCONNECTED`),this.cancelToken?.cancel(`disconnect() is called`),this.cancelToken=void 0;let t=this.connectionID;this.connectionID=void 0;try{await this._req({close:!0,connection_id:t},{timeout:e},!1),this._log(`disconnect() - Closed connectionID`)}catch(e){this._log(`disconnect() - Failed`,{err:e},`error`)}},this.client=e,this.state=`INIT`,this.consecutiveFailures=0,Iy(this._onlineStatusChanged)}_log(e,t={},n=`info`){this.client.logger(n,`WSConnectionFallback:`+e,{tags:[`connection_fallback`,`connection`],...t})}_setState(e){this._log(`_setState() - ${e}`),this.state===`CONNECTING`&&e===`CONNECTED`&&this.client.dispatchEvent({type:`connection.changed`,online:!0}),(e===`CLOSED`||e===`DISCONNECTED`)&&this.client.dispatchEvent({type:`connection.changed`,online:!1}),this.state=e}},DC=class{constructor(e,t,n,r){this.client=e,this.type=t,this.id=n,this.data=r}create(){let e={name:this.data?.name,filter:this.data?.filter,description:this.data?.description,all_sender_channels:this.data?.all_sender_channels,all_users:this.data?.all_users};return this.client.createSegment(this.type,this.id,e)}verifySegmentId(){if(!this.id)throw Error(`Segment id is missing. Either create the segment using segment.create() or set the id during instantiation - const segment = client.segment(id)`)}get(){return this.verifySegmentId(),this.client.getSegment(this.id)}update(e){return this.verifySegmentId(),this.client.updateSegment(this.id,e)}addTargets(e){return this.verifySegmentId(),this.client.addSegmentTargets(this.id,e)}removeTargets(e){return this.verifySegmentId(),this.client.removeSegmentTargets(this.id,e)}delete(){return this.verifySegmentId(),this.client.deleteSegment(this.id
426)}targetExists(e){return this.verifySegmentId(),this.client.segmentTargetExists(this.id,e)}queryTargets(e={},t=[],n={}){return this.verifySegmentId(),this.client.querySegmentTargets(this.id,e,t,n)}},OC={user:`stream:user`,message:`stream:chat:v1:message`,userprofile:`stream:v1:user_profile`},kC=class{constructor(e){this.client=e}flagUser(e,t,n={}){return this.flag(OC.user,e,``,t,n)}flagMessage(e,t,n={}){return this.flag(OC.message,e,``,t,n)}async flag(e,t,n,r,i={}){return await this.client.post(this.client.baseURL+`/api/v2/moderation/flag`,{entity_type:e,entity_id:t,entity_creator_id:n,reason:r,...i})}async muteUser(e,t={}){return await this.client.post(this.client.baseURL+`/api/v2/moderation/mute`,{target_ids:[e],...t})}async unmuteUser(e,t){return await this.client.post(this.client.baseURL+`/api/v2/moderation/unmute`,{target_ids:[e],...t})}async getUserModerationReport(e,t={}){return await this.client.get(this.client.baseURL+`/api/v2/moderation/user_report`,{user_id:e,...t})}async queryReviewQueue(e={},t=[],n={}){return await this.client.post(this.client.baseURL+`/api/v2/moderation/review_queue`,{filter:e,sort:jy(t),...n})}async upsertConfig(e){return await this.client.post(this.client.baseURL+`/api/v2/moderation/config`,e)}async getConfig(e,t){return await this.client.get(this.client.baseURL+`/api/v2/moderation/config/`+e,t)}async deleteConfig(e,t){return await this.client.delete(this.client.baseURL+`/api/v2/moderation/config/`+e,t)}async queryConfigs(e,t,n={}){return await this.client.post(this.client.baseURL+`/api/v2/moderation/configs`,{filter:e,sort:t,...n})}async submitAction(e,t,n={}){return await this.client.post(this.client.baseURL+`/api/v2/moderation/submit_action`,{action_type:e,item_id:t,...n})}async check(e,t,n,r,i,a,o){return await this.client.post(this.client.baseURL+`/api/v2/moderation/check`,{entity_type:e,entity_id:t,entity_creator_id:n,moderation_payload:r,config_key:i,options:a,test_mode:o})}async checkUserProfile(e,t){if(!t.username&&!t.image)throw Error(`Either username or image must be provided`);let n={};return t.username&&(n.texts=[t.username]),t.image&&(n.images=[t.image]),await this.check(OC.userprofile,e,e,n,`user_profile:default`,{force_sync:!0},!0)}async addCustomFlags(e,t,n,r,i){return await this.client.post(this.client.baseURL+`/api/v2/moderation/custom_check`,{entity_type:e,entity_id:t,entity_creator_id:n,moderation_payload:r,flags:i})}async addCustomMessageFlags(e,t){return await this.addCustomFlags(OC.message,e,``,{},t)}async upsertModerationRule(e){return await this.client.post(this.client.baseURL+`/api/v2/moderation/moderation_rule`,e)}async queryModerationRules(e={},t=[],n={}){return await this.client.post(this.client.baseURL+`/api/v2/moderation/moderation_rules`,{filter:e,sort:t,...n})}async getModerationRule(e){return await this.client.get(this.client.baseURL+`/api/v2/moderation/moderation_rule/`+e)}async deleteModerationRule(e){return await this.client.delete(this.client.baseURL+`/api/v2/moderation/moderation_rule/`+e)}},AC=1e3,jC=25,MC={active:!1,isThreadOrderStale:!1,threads:[],unreadThreadCount:0,unseenThreadIds:[],lastConnectionDropAt:null,pagination:{isLoading:!1,isLoadingNext:!1,nextCursor:null},ready:!1},NC=class extends lb{constructor({client:e}){super(),this.resetState=()=>{this.state.next(MC)},this.activate=()=>{this.state.partialNext({active:!0})},this.deactivate=()=>{this.state.partialNext({active:!1})},this.registerSubscriptions=()=>{this.hasSubscriptions||(this.addUnsubscribeFunction(this.subscribeUnreadThreadsCountChange()),this.addUnsubscribeFunction(this.subscribeManageThreadSubscriptions()),this.addUnsubscribeFunction(this.subscribeReloadOnActivation()),this.addUnsubscribeFunction(this.subscribeNewReplies()),this.addUnsubscribeFunction(this.subscribeRecoverAfterConnectionDrop()),this.addUnsubscribeFunction(this.subscribeChannelDeleted()))},this.subscribeUnreadThreadsCountChange=()=>{let{unread_threads:e=0}=this.client.user??{};this.state.partialNext({unreadThreadCount:e});let t=[`health.check`,`notification.mark_read`,`notification.thread_message_new`,`notification.channel_deleted`].map(e=>this.client.on(e,e=>{let{unread_threads:t}=e.me??e;typeof t==`number`&&this.state.partialNext({unreadThreadCount:t})}).unsubscribe);return()=>
426t.forEach(e=>e())},this.subscribeChannelDeleted=()=>this.client.on(`notification.channel_deleted`,e=>{let{cid:t}=e,{threads:n}=this.state.getLatestValue(),r=n.filter(e=>e.channel.cid!==t);this.state.partialNext({threads:r})}).unsubscribe,this.subscribeManageThreadSubscriptions=()=>this.state.subscribeWithSelector(e=>({threads:e.threads}),({threads:e},t)=>{let{threads:n=[]}=t??{},r=n.filter(e=>e!==this.threadsById[e.id]);e.forEach(e=>e.registerSubscriptions()),r.forEach(e=>e.unregisterSubscriptions())}),this.subscribeReloadOnActivation=()=>this.state.subscribeWithSelector(e=>({active:e.active}),({active:e})=>{e&&this.reload()}),this.subscribeNewReplies=()=>this.client.on(`notification.thread_message_new`,e=>{let t=e.message?.parent_id;if(!t)return;let{unseenThreadIds:n,ready:r}=this.state.getLatestValue();r&&(this.threadsById[t]?this.state.partialNext({isThreadOrderStale:!0}):n.includes(t)||this.state.partialNext({unseenThreadIds:n.concat(t)}))}).unsubscribe,this.subscribeRecoverAfterConnectionDrop=()=>{let e=this.client.on(`connection.changed`,e=>{e.online===!1&&this.state.next(e=>e.lastConnectionDropAt?e:{...e,lastConnectionDropAt:new Date})}).unsubscribe,t=Gy(()=>{let{lastConnectionDropAt:e}=this.state.getLatestValue();e&&this.reload({force:!0})},AC,{trailing:!0}),n=this.client.on(`connection.recovered`,t).unsubscribe;return()=>{e(),n()}},this.unregisterSubscriptions=()=>(this.state.getLatestValue().threads.forEach(e=>e.unregisterSubscriptions()),super.unregisterSubscriptions()),this.reload=async({force:e=!1}={})=>{let{threads:t,unseenThreadIds:n,isThreadOrderStale:r,pagination:i,ready:a}=this.state.getLatestValue();if(i.isLoading||!e&&a&&!n.length&&!r)return;let o=t.length+n.length;try{this.state.next(e=>({...e,pagination:{...e.pagination,isLoading:!0}}));let e=await this.queryThreads({limit:Math.min(o,jC)||jC}),t=[];for(let n of e.threads){let e=this.threadsById[n.id];e?(t.push(e),e.hasStaleState&&e.hydrateState(n)):t.push(n)}this.state.next(n=>({...n,threads:t,unseenThreadIds:[],isThreadOrderStale:!1,pagination:{...n.pagination,isLoading:!1,nextCursor:e.next??null},ready:!0}))}catch(e){this.client.logger(`error`,e.message),this.state.next(e=>({...e,pagination:{...e.pagination,isLoading:!1}}))}},this.queryThreads=(e={})=>this.client.queryThreads({limit:25,participant_limit:10,reply_limit:10,watch:!0,...e}),this.loadNextPage=async(e={})=>{let{pagination:t}=this.state.getLatestValue();if(!(t.isLoadingNext||!t.nextCursor))try{this.state.partialNext({pagination:{...t,isLoadingNext:!0}});let n=await this.queryThreads({...e,next:t.nextCursor});this.state.next(e=>({...e,threads:n.threads.length?e.threads.concat(n.threads):e.threads,pagination:{...e.pagination,nextCursor:n.next??null,isLoadingNext:!1}}))}catch(e){this.client.logger(`error`,e.message),this.state.next(e=>({...e,pagination:{...e.pagination,isLoadingNext:!1}}))}},this.client=e,this.state=new sb(MC),this.threadsByIdGetterCache={threads:[],threadsById:{}}}get threadsById(){let{threads:e}=this.state.getLatestValue();if(e===this.threadsByIdGetterCache.threads)return this.threadsByIdGetterCache.threadsById;let t=e.reduce((e,t)=>(e[t.id]=t,e),{});return this.threadsByIdGetterCache.threads=e,this.threadsByIdGetterCache.threadsById=t,t}},PC=e=>e.type===`poll.updated`,FC=e=>e.type===`poll.closed`,IC=e=>e.type===`poll.vote_casted`,LC=e=>e.type===`poll.vote_changed`,RC=e=>e.type===`poll.vote_removed`,zC=e=>!!e?.answer_text,BC=class{constructor({client:e,poll:t}){this.getInitialStateFromPollResponse=e=>{let{own_votes:t,id:n,...r}=e,{ownAnswer:i,ownVotes:a}=t?.reduce((e,t)=>(zC(t)?e.ownAnswer=t:e.ownVotes.push(t),e),{ownVotes:[]})??{ownVotes:[]};return{...r,lastActivityAt:new Date,maxVotedOptionIds:VC(r.vote_counts_by_option),ownAnswer:i,ownVotesByOptionId:HC(a)}},this.upsertOfflineDb=()=>{this.client.offlineDb?.executeQuerySafely(e=>e.upsertPoll({poll:WC(this)}),{method:`upsertPoll`})},this.reinitializeState=e=>{this.state.partialNext(this.getInitialStateFromPollResponse(e))},this.handlePollUpdated=e=>{if(e.poll?.id&&e.poll.id!==this.id||!PC(e))return;let{id:t,...n}=UC(e.poll);this.state.partialNext({...n,lastActivityAt:new Date(e.created_at)}),this.upsertOfflineDb()},this.handlePollClosed=e=>{e.poll?.id&&e.poll.id!==this.id||FC(e)&&(this.state.partialNext({is_closed:!0,lastActivityAt:new Date(e.created_at)}),this.upsertOfflineDb())},this.handleVoteCasted=e=>{if(e.poll?.id&&e.poll.id!==this.id||!IC(e))return;let t=this.data,n=e.poll_vote.user_id===this.client.userID,r=[...t.latest_answers],i=t.ownAnswer,a=t.ownVotesByOptionId,o=t.maxVotedOptionIds;n&&(zC(e.poll_vote)?i=e.poll_vote:e.poll_vote.option_id&&(a[e.poll_vote.option_id]=e.poll_vote)),zC(e.poll_vote)?r=[e.poll_vote,...r]:o=VC(e.poll.vote_counts_by_option);let s=GC(e.poll);this.state.partialNext({...s,latest_answers:r,lastActivityAt:new Date(e.created_at),ownAnswer:i,ownVotesByOptionId:a,maxVotedOptionIds:o}),this.upsertOfflineDb()},this.handleVoteChanged=e=>{if(e.poll?.id&&e.poll.id!==this.id||!LC(e))return;let t=this.data,n=e.poll_vote.user_id===this.client.userID,r=[...t.latest_answers],i=t.ownAnswer,a=t.ownVotesByOptionId,o=t.maxVotedOptionIds;n?zC(e.poll_vote)?(r=[e.poll_vote,...r.filter(t=>t.id!==e.poll_vote.id)],i=e.poll_vote):e.poll_vote.option_id&&(e.poll.enforce_unique_vote?a={[e.poll_vote.option_id]:e.poll_vote}:(a=Object.entries(a).reduce((t,[n,r])=>(n!==e.poll_vote.option_id&&r.id===e.poll_vote.id||(t[n]=r),t),{}),a[e.poll_vote.option_id]=e.poll_vote),i?.id===e.poll_vote.id&&(i=void 0),o=VC(e.poll.vote_counts_by_option)):zC(e.poll_vote)?r=[e.poll_vote,...r]:o=VC(e.poll.vote_counts_by_option);let s=GC(e.poll);this.state.partialNext({...s,latest_answers:r,lastActivityAt:new Date(e.created_at),ownAnswer:i,ownVotesByOptionId:a,maxVotedOptionIds:o}),this.upsertOfflineDb()},this.handleVoteRemoved=e=>{if(e.poll?.id&&e.poll.id!==this.id||!RC(e))return;let t=this.data,n=e.poll_vote.user_id===this.client.userID,r=[...t.latest_answers],i=t.ownAnswer,a={...t.ownVotesByOptionId},o=t.maxVotedOptionIds;zC(e.poll_vote)?(r=r.filter(t=>t.id!==e.poll_vote.id),n&&(i=void 0)):(o=VC(e.poll.vote_counts_by_option),n&&e.poll_vote.option_id&&delete a[e.poll_vote.option_id]);let s=GC(e.poll);this.state.partialNext({...s,latest_answers:r,lastActivityAt:new Date(e.created_at),ownAnswer:i,ownVotesByOptionId:a,maxVotedOptionIds:o}),this.upsertOfflineDb()},this.query=async e=>{let{poll:t}=await this.client.getPoll(e);return this.state.partialNext({...t,lastActivityAt:new Date}),t},this.update=async e=>await this.client.updatePoll({...e,id:this.id}),this.partialUpdate=async e=>await this.client.partialUpdatePoll(this.id,e),this.close=async()=>
426await this.client.closePoll(this.id),this.delete=async()=>await this.client.deletePoll(this.id),this.createOption=async e=>await this.client.createPollOption(this.id,e),this.updateOption=async e=>await this.client.updatePollOption(this.id,e),this.deleteOption=async e=>await this.client.deletePollOption(this.id,e),this.castVote=async(e,t)=>{let{max_votes_allowed:n,ownVotesByOptionId:r}=this.data;if(n&&n===Object.keys(r).length){this.client.notifications.addInfo({message:`Reached the vote limit. Remove an existing vote first.`,origin:{emitter:`Poll`,context:{messageId:t,optionId:e}},options:{type:`validation:poll:castVote:limit`}});return}return await this.client.castPollVote(t,this.id,{option_id:e})},this.removeVote=async(e,t)=>await this.client.removePollVote(t,this.id,e),this.addAnswer=async(e,t)=>await this.client.addPollAnswer(t,this.id,e),this.removeAnswer=async(e,t)=>await this.client.removePollVote(t,this.id,e),this.queryAnswers=async e=>await this.client.queryPollAnswers(this.id,e.filter,e.sort,e.options),this.queryOptionVotes=async e=>await this.client.queryPollVotes(this.id,e.filter,e.sort,e.options),this.client=e,this.id=t.id,this.state=new sb(this.getInitialStateFromPollResponse(t))}get data(){return this.state.getLatestValue()}};function VC(e){let t=0,n=[];for(let[r,i]of Object.entries(e??{}))i>t?(n=[r],t=i):i===t&&n.push(r);return n}function HC(e){return e?e.reduce((e,t)=>(zC(t)||!t.option_id||(e[t.option_id]=t),e),{}):{}}function UC(e){return{allow_answers:e.allow_answers,allow_user_suggested_options:e.allow_user_suggested_options,description:e.description,enforce_unique_vote:e.enforce_unique_vote,id:e.id,is_closed:e.is_closed,max_votes_allowed:e.max_votes_allowed,name:e.name,options:e.options,voting_visibility:e.voting_visibility}}function WC(e){let{lastActivityAt:t,maxVotedOptionIds:n,ownVotesByOptionId:r,ownAnswer:i,...a}=e.data,o=[...Object.values(r),...i?[i]:[]].sort((e,t)=>Date.parse(e.created_at)-Date.parse(t.created_at));return{...a,own_votes:o,id:e.id}}function GC(e){return{answers_count:e.answers_count,latest_votes_by_option:e.latest_votes_by_option,vote_count:e.vote_count,vote_counts_by_option:e.vote_counts_by_option}}var KC=class extends lb{constructor({client:e}){super(),this.pollCache=new Map,this.fromState=e=>this.pollCache.get(e),this.registerSubscriptions=()=>{this.hasSubscriptions||(this.addUnsubscribeFunction(this.subscribeMessageNew()),this.addUnsubscribeFunction(this.subscribePollUpdated()),this.addUnsubscribeFunction(this.subscribePollClosed()),this.addUnsubscribeFunction(this.subscribeVoteCasted()),this.addUnsubscribeFunction(this.subscribeVoteChanged()),this.addUnsubscribeFunction(this.subscribeVoteRemoved()))},this.createPoll=async e=>{let{poll:t}=await this.client.createPoll(e);return t.vote_counts_by_option||={},this.setOrOverwriteInCache(t),this.fromState(t.id)},this.getPoll=async e=>{let t=this.fromState(e);if(t)return this.client.getPoll(e).then(({poll:e})=>this.setOrOverwriteInCache(e,!0)),t;let{poll:n}=await this.client.getPoll(e);return this.setOrOverwriteInCache(n),this.fromState(e)},this.queryPolls=async(e,t=[],n={})=>{let{polls:r,next:i}=await this.client.queryPolls(e,t,n);return{polls:r.map(e=>(this.setOrOverwriteInCache(e,!0),this.fromState(e.id))),next:i}},this.hydratePollCache=(e,t)=>{for(let n of e){if(!n.poll)continue;let e=n.poll;this.setOrOverwriteInCache(e,t)}},this.setOrOverwriteInCache=(e,t)=>{if(!this.client._cacheEnabled())return;let n=this.fromState(e.id);if(n)t&&n.reinitializeState(e);else{let t=new BC({client:this.client,poll:e});this.pollCache.set(t.id,t)}},this.subscribePollUpdated=()=>this.client.on(`poll.updated`,e=>{e.poll?.id&&this.fromState(e.poll.id)?.handlePollUpdated(e)}).unsubscribe,this.subscribePollClosed=()=>this.client.on(`poll.closed`,e=>{e.poll?.id&&this.fromState(e.poll.id)?.handlePollClosed(e)}).unsubscribe,this.subscribeVoteCasted=()=>this.client.on(`poll.vote_casted`,e=>{e.poll?.id&&this.fromState(e.poll.id)?.handleVoteCasted(e)}).unsubscribe,this.subscribeVoteChanged=()=>this.client.on(`poll.vote_changed`,e=>{e.poll?.id&&this.fromState(e.poll.id)?.handleVoteChanged(e)}).unsubscribe,this.subscribeVoteRemoved=()=>this.client.on(`poll.vote_removed`,e=>{e.poll?.id&&this.fromState(e.poll.id)?.handleVoteRemoved(e)}).unsubscribe,this.subscribeMessageNew=()=>this.client.on(`message.new`,e=>{let{message:t}=e;if(t){let e=Ry(t);this.hydratePollCache([e])}}).unsubscribe,this.client=e}get data(){return this.pollCache}},qC={"channel.deleted":`channelDeletedHandler`,"channel.hidden":`channelHiddenHandler`,"channel.truncated":`channelTruncatedHandler`,"channel.updated":`channelUpdatedHandler`,"channel.visible":`channelVisibleHandler`,"message.new":`newMessageHandler`,"member.updated":`memberUpdatedHandler`,"notification.added_to_channel":`notificationAddedToChannelHandler`,"notification.message_new":`notificationNewMessageHandler`,"notification.removed_from_channel":`notificationRemovedFromChannelHandler`},JC={abortInFlightQuery:!1,allowNotLoadedChannelPromotionForEvent:{"channel.visible":!0,"message.new":!0,"notification.added_to_channel":!0,"notification.message_new":!0},lockChannelOrder:!1},YC={offset:0},XC=e=>(e??[]).map(({direction:e=1,field:t})=>({[t]:e})),ZC=({queryChannelsResponse:e,sort:t})=>{let n=e?.predefined_filter;return n?{responseFilters:n.filter,responseSort:n.sort===void 0?t:XC(n.sort)}:{}},QC=e=>({filters:e.responseFilters??e.filters,sort:e.responseSort??e.sort}),$C=e=>{let t={...e};return delete t.responseFilters,delete t.responseSort,t},ew=e=>!Array.isArray(e),tw=class extends lb{constructor({client:e,eventHandlerOverrides:t={},options:n={},queryChannelsOverride:r}){super(),this.eventHandlers=new Map,this.eventHandlerOverrides=new Map,this.options={},this.stateOptions={},this.setChannels=e=>{this.state.next(t=>{let{channels:n}=t,r=ob(e)?e(n):e;return n===r?t:{...t,channels:r}});let{channels:t,pagination:{filters:n,options:r,sort:i}}=this.state.getLatestValue();this.client.offlineDb?.executeQuerySafely(e=>e.upsertCidsForQuery({cids:t.map(e=>e.cid),filters:n,options:r,sort:i}),{method:`upsertCidsForQuery`})},this.setEventHandlerOverrides=(e={})=>{let t=Object.entries(e).reduce((e,[t,n])=>(n&&(e[t]=n),e),{});this.eventHandlerOverrides=new Map(Object.entries(t))},this.setQueryChannelsRequest=e=>{this.queryChannelsRequest=e},this.setOptions=(e={})=>{this.options={...JC,...e}},this.executeChannelsQuery=async(e,t=0)=>{let{filters:n,sort:r,options:i,stateOptions:a}=e,{offset:o,limit:s}={...YC,...i};try{let e=await this.queryChannelsRequest(n,r,i,{...a,withResponse:!0}),t=ew(e)?e.channels:e,c=o+(t?.length??0),l={...i,offset:c},{pagination:u}=this.state.getLatestValue(),d=ZC({queryChannelsResponse:ew(e)?e:void 0,sort:r}),f=$C(u);this.state.partialNext({channels:t,pagination:{...f,hasNext:(t?.length??0)>=(s??1),isLoading:!1,options:l,...d},initialized:!0,error:void 0}),this.client.offlineDb?.executeQuerySafely(e=>e.upsertCidsForQuery({cids:t.map(e=>e.cid),filters:u.filters,options:i,sort:u.sort}),{method:`upsertCidsForQuery`})}catch(n){if(t>=Ty){console.warn(n);let e=Error(`Maximum number of retries reached in queryChannels. Last error message is: ${n}`),t=this.state.getLatestValue(),r=this.client.offlineDb&&t.channels.length>0;this.state.partialNext({error:r?void 0:e,pagination:{...t.pagination,isLoading:!1,isLoadingNext:!1}});return}return await Oy(Ey),this.executeChannelsQuery(e,t+1)}},this.queryChannels=async(e,t=[],n={},r={})=>{let{pagination:{isLoading:i,filters:a},initialized:o}=this.state.getLatestValue();if(i&&!this.options.abortInFlightQuery&&JSON.stringify(a)===JSON.stringify(e))return;let s={filters:e,sort:t,options:n,stateOptions:r};try{if(this.stateOptions=r,this.state.next(r=>({...r,pagination:{...$C(r.pagination),isLoading:!0,isLoadingNext:!1,filters:e,sort:t,options:n},error:void 0})),this.client.offlineDb?.getChannelsForQuery&&this.client.user?.id){if(!o){let r=await this.client.offlineDb.getChannelsForQuery({userId:this.client.user.id,filters:e,options:n,sort:t});if(r){let e=this.client.hydrateActiveChannels(r,{offlineMode:!0,skipInitialization:[]});this.state.partialNext({channels:e})}}if(!this.client.offlineDb.syncManager.syncStatus){this.client.offlineDb.syncManager.scheduleSyncStatusChangeCallback(this.id,async()=>{await this.executeChannelsQuery(s)});return}}await this.executeChannelsQuery(s)}catch(e){throw this.client.logger(`error`,e.message),this.state.next(e=>({...e,pagination:{...e.pagination,isLoading:!1}})),e}},this.loadNext=async()=>{let{pagination:e,initialized:t}=this.state.getLatestValue(),{filters:n,sort:r,options:i,isLoadingNext:a,hasNext:o}=e;if(!(!t||a||!o))try{let{offset:t,limit:a}={...YC,...i};this.state.partialNext({pagination:{...e,isLoading:!1,isLoadingNext:!0}});let o=await this.queryChannelsRequest(n,r,i,this.stateOptions),s=ew(o)?o.channels:o,{channels:c}=this.state.getLatestValue(),l=t+(s?.length??0),u={...i,offset:l};this.state.partialNext({channels:Zte([...c||[],...s],`cid`),pagination:{...e,hasNext:(s?.length??0)>=(a??1),isLoading:!1,isLoadingNext:!1,options:u}})}catch(e){throw this.client.logger(`error`,e.message),this.state.next(e=>({...e,pagination:{...e.pagination,isLoadingNext:!1,isLoading:!1}})),e}},this.notificationAddedToChannelHandler=async e=>{let{id:t,type:n,members:r}=e?.channel??{};if(!n||!this.options.allowNotLoadedChannelPromotionForEvent?.[`notification.added_to_channel`])return;let i=await Jy({client:this.client,id:t,members:r?.reduce((e,{user:t,user_id:n})=>{let r=n||t?.id;return r&&e.push(r),e},[]),type:n}),{pagination:a,channels:o}=this.state.getLatestValue();if(!o)return;let{sort:s}=QC(a);this.setChannels(nb({channels:o,channelToMove:i,sort:s}))},this.channelDeletedHandler=e=>{let{channels:t}=this.state.getLatestValue();if(!t)return;let n=[...t],r=n.findIndex(t=>t.cid===(e.cid||e.channel?.cid));r<0||(n.splice(r,1),this.setChannels(n))},this.channelHiddenHandler=this.channelDeletedHandler,this.newMessageHandler=e=>{let{pagination:t,channels:n}=this.state.getLatestValue();if(!n)return;let{filters:r,sort:i}=QC(t),a=e.channel_type,o=e.channel_id;if(!a||!o)return;let s=this.client.channel(a,o),c=n.indexOf(s),l=c>=0,u=Xy(s),d=Zy(s),f=Qy(r),p=eb(i);f&&d&&!r.archived||f&&!d&&r.archived||p&&u||this.options.lockChannelOrder||!l&&!this.options.allowNotLoadedChannelPromotionForEvent?.[`message.new`]||this.setChannels(nb({channels:n,channelToMove:s,channelToMoveIndexWithinChannels:c,sort:i}))},this.notificationNewMessageHandler=async e=>{let{id:t,type:n}=e?.channel??{};if(!t||!n)return;let r=await Jy({client:this.client,id:t,type:n}),{channels:i,pagination:a}=this.state.getLatestValue(),{filters:o,sort:s}=QC(a),c=Qy(o),l=Zy(r);!i||c&&l&&!o.archived||c&&!l&&o.archived||!this.options.allowNotLoadedChannelPromotionForEvent?.[`notification.message_new`]||this.setChannels(nb({channels:i,channelToMove:r,sort:s}))},this.channelVisibleHandler=async e=>{let{channel_type:t,channel_id:n}=e;if(!t||!n)return;let r=await Jy({client:this.client,id:e.channel_id,type:e.channel_type}),{channels:i,pagination:a}=this.state.getLatestValue(),{filters:o,sort:s}=QC(a),c=Qy(o),l=Zy(r);!i||c&&l&&!o.archived||c&&!l&&o.archived||!this.options.allowNotLoadedChannelPromotionForEvent?.[`channel.visible`]||this.setChannels(nb({channels:i,channelToMove:r,sort:s}))},this.notificationRemovedFromChannelHandler=this.channelDeletedHandler,this.memberUpdatedHandler=e=>{let{pagination:t,channels:n}=this.state.getLatestValue(),{filters:r,sort:i}=QC(t);if(!e.member?.user||e.member.user.id!==this.client.userID||!e.channel_type||!e.channel_id)return;
426let a=e.channel_type,o=e.channel_id,s=eb(i),c=Qy(r),l=$y({atIndex:0,sort:i,targetKey:`pinned_at`});if(!n||!s&&!c||this.options.lockChannelOrder)return;let u=this.client.channel(a,o),d=n.indexOf(u),f=d>=0,p=Xy(u),m=Zy(u),h=[...n];if(f&&h.splice(d,1),c&&!m&&r?.archived||c&&m&&!r?.archived){this.setChannels(h);return}let g=null;(l===1||l===-1&&!p)&&(g=tb({channels:h}));let _=typeof g==`number`?g+1:0;n[_]!==u&&(h.splice(_,0,u),this.setChannels(h))},this.subscriptionOrOverride=e=>{let t=qC[e.type],n=this.eventHandlers.get(t),r=this.eventHandlerOverrides.get(t);if(r&&typeof r==`function`){r(this.setChannels,e);return}n&&typeof n==`function`&&n(e)},this.registerSubscriptions=()=>{if(!this.hasSubscriptions)for(let e of Object.keys(qC))this.addUnsubscribeFunction(this.client.on(e,this.subscriptionOrOverride).unsubscribe)},this.id=`channel-manager-${Fy()}`,this.client=e,this.state=new sb({channels:[],pagination:{isLoading:!1,isLoadingNext:!1,hasNext:!1,filters:{},sort:{},options:YC},initialized:!1,error:void 0}),this.setEventHandlerOverrides(t),this.setOptions(n),this.queryChannelsRequest=r??((...e)=>this.client.queryChannels(...e)),this.eventHandlers=new Map(Object.entries({channelDeletedHandler:this.channelDeletedHandler,channelHiddenHandler:this.channelHiddenHandler,channelVisibleHandler:this.channelVisibleHandler,memberUpdatedHandler:this.memberUpdatedHandler,newMessageHandler:this.newMessageHandler,notificationAddedToChannelHandler:this.notificationAddedToChannelHandler,notificationNewMessageHandler:this.notificationNewMessageHandler,notificationRemovedFromChannelHandler:this.notificationRemovedFromChannelHandler}))}},nw=3e3,rw={durations:{error:nw,info:nw,success:nw,warning:nw}},iw=class{constructor(e={}){this.timeouts=new Map,this.store=new sb({notifications:[]}),this.config=Lb(rw,e)}get notifications(){return this.store.getLatestValue().notifications}get warning(){return this.notifications.filter(e=>e.severity===`warning`)}get error(){return this.notifications.filter(e=>e.severity===`error`)}get info(){return this.notifications.filter(e=>e.severity===`info`)}get success(){return this.notifications.filter(e=>e.severity===`success`)}add({message:e,origin:t,options:n={}}){let r=Fy(),i=Date.now(),a=n.severity,o=n.duration??(a?this.config.durations[a]:void 0),s={id:r,message:e,origin:t,type:n?.type,severity:a,createdAt:i,duration:o,actions:n.actions,metadata:n.metadata,tags:n.tags,originalError:n.originalError},c=[...this.store.getLatestValue().notifications,s];return this.store.partialNext({notifications:this.config.sortComparator?[...c].sort(this.config.sortComparator):c}),r}addError({message:e,origin:t,options:n}){return this.add({message:e,origin:t,options:{...n,severity:`error`}})}addWarning({message:e,origin:t,options:n}){return this.add({message:e,origin:t,options:{...n,severity:`warning`}})}addInfo({message:e,origin:t,options:n}){return this.add({message:e,origin:t,options:{...n,severity:`info`}})}addSuccess({message:e,origin:t,options:n}){return this.add({message:e,origin:t,options:{...n,severity:`success`}})}clearTimeout(e){let t=this.timeouts.get(e);t&&(clearTimeout(t),this.timeouts.delete(e))}startTimeout(e,t){let n=this.store.getLatestValue().notifications.find(t=>t.id===e),r=t??n?.duration;if(!n||!r)return;this.clearTimeout(e);let i=setTimeout(()=>{this.remove(e)},r);this.timeouts.set(e,i)}remove(e){this.clearTimeout(e),this.store.partialNext({notifications:this.store.getLatestValue().notifications.filter(t=>t.id!==e)})}clear(){this.timeouts.forEach(e=>clearTimeout(e)),this.timeouts.clear(),this.store.partialNext({notifications:[]})}},aw=60*1e3,ow=60*aw,sw=24*ow,cw=7*sw,lw={minute:{lower:aw,upper:ow},hour:{lower:ow,upper:sw},day:{lower:sw,upper:cw}},uw=2*cw,dw=class{constructor({reminder:e,config:t}){this.timeout=null,this.stopRefreshBoundaryMs=uw,this.getRefreshIntervalLength=()=>{if(!this.reminder.remindAt)return null;let e=Math.abs(fw(this.reminder.remindAt.getTime())),t;return t=e===0?aw:e<lw.minute.lower?e:e<=lw.minute.upper?aw:e<=lw.hour.upper?ow:sw,t},this.init=()=>{if(!this.reminder.remindAt)return null;let e=this.getRefreshIntervalLength();if(e===null)return null;
426if(this.reminder.remindAt?.getTime()+this.stopRefreshBoundaryMs-Date.now()<=0){this.timeout=null;return}this.timeout&&clearTimeout(this.timeout),this.timeout=setTimeout(()=>{this.reminder.refreshTimeLeft(),this.init()},e)},this.clear=()=>{this.timeout&&=(clearInterval(this.timeout),null)},this.reminder=e,typeof t?.stopRefreshBoundaryMs==`number`&&(this.stopRefreshBoundaryMs=t.stopRefreshBoundaryMs)}},fw=e=>e-new Date().getTime(),pw=class e{constructor({data:t,config:n}){this.setState=t=>{this.state.next(n=>{let r={...n,...e.toStateValue(t)};return r.remind_at&&(r.timeLeftMs=fw(r.remind_at.getTime())),r}),t.remind_at?this.initTimer():t.remind_at||this.clearTimer()},this.refreshTimeLeft=()=>{this.remindAt&&this.state.partialNext({timeLeftMs:fw(this.remindAt.getTime())})},this.initTimer=()=>{this.timer.init()},this.clearTimer=()=>{this.timer.clear()},this.state=new sb(e.toStateValue(t)),this.timer=new dw({reminder:this,config:n}),this.initTimer()}get id(){return this.state.getLatestValue().message_id}get remindAt(){return this.state.getLatestValue().remind_at}get timeLeftMs(){return this.state.getLatestValue().timeLeftMs}};pw.toStateValue=e=>({...e,created_at:new Date(e.created_at),message:e.message||null,remind_at:e.remind_at?new Date(e.remind_at):null,timeLeftMs:e.remind_at?fw(new Date(e.remind_at).getTime()):null,updated_at:new Date(e.updated_at),user:e.user||null});var mw=pw,hw=60*1e3,gw=60*hw,_w=24*gw,vw={scheduledOffsetsMs:[2*hw,30*hw,gw,2*gw,8*gw,_w],stopTimerRefreshBoundaryMs:uw},yw=e=>e.message.match(`already has reminder created for this message_id`),bw=e=>e.message.match(`reminder does not exist`),xw=class e extends lb{constructor({client:t,config:n}){super(),this.upsertToState=({data:e,overwrite:t=!0})=>{if(!this.client._cacheEnabled())return;let n=this.getFromState(e.message_id);if(n)t&&n.setState(e);else{let t=new mw({data:e,config:{stopRefreshBoundaryMs:this.stopTimerRefreshBoundaryMs}});this.state.partialNext({reminders:new Map(this.reminders.set(e.message_id,t))})}return n},this.removeFromState=e=>{let t=this.getFromState(e);if(!t)return;t.clearTimer();let n=this.reminders;n.delete(e),this.state.partialNext({reminders:new Map(n)})},this.hydrateState=e=>{e.forEach(({reminder:e})=>{e&&this.upsertToState({data:e})})},this.initTimers=()=>{this.reminders.forEach(e=>e.initTimer())},this.clearTimers=()=>{this.reminders.forEach(e=>e.clearTimer())},this.registerSubscriptions=()=>{this.hasSubscriptions||(this.addUnsubscribeFunction(this.subscribeReminderCreated()),this.addUnsubscribeFunction(this.subscribeReminderUpdated()),this.addUnsubscribeFunction(this.subscribeReminderDeleted()),this.addUnsubscribeFunction(this.subscribeNotificationReminderDue()),this.addUnsubscribeFunction(this.subscribeMessageDeleted()),this.addUnsubscribeFunction(this.subscribeMessageUndeleted()),this.addUnsubscribeFunction(this.subscribePaginatorStateUpdated()),this.addUnsubscribeFunction(this.subscribeConfigStateUpdated()))},this.subscribeReminderCreated=()=>this.client.on(`reminder.created`,t=>{if(!e.isReminderWsEventPayload(t))return;let{reminder:n}=t;this.upsertToState({data:n})}).unsubscribe,this.subscribeReminderUpdated=()=>this.client.on(`reminder.updated`,t=>{if(!e.isReminderWsEventPayload(t))return;let{reminder:n}=t;this.upsertToState({data:n})}).unsubscribe,this.subscribeReminderDeleted=()=>this.client.on(`reminder.deleted`,t=>{e.isReminderWsEventPayload(t)&&this.removeFromState(t.message_id)}).unsubscribe,this.subscribeMessageDeleted=()=>this.client.on(`message.deleted`,e=>{e.message?.id&&this.removeFromState(e.message.id)}).unsubscribe,this.subscribeMessageUndeleted=()=>this.client.on(`message.undeleted`,e=>{e.message?.reminder&&this.upsertToState({data:e.message.reminder})}).unsubscribe,this.subscribeNotificationReminderDue=()=>this.client.on(`notification.reminder_due`,()=>null).unsubscribe,this.subscribePaginatorStateUpdated=()=>this.paginator.state.subscribeWithSelector(({items:e})=>[e],([e])=>{if(e)for(let t of e)this.upsertToState({data:t})}),this.subscribeConfigStateUpdated=()=>this.configState.subscribeWithSelector(({stopTimerRefreshBoundaryMs:e})=>({stopTimerRefreshBoundaryMs:e}),({stopTimerRefreshBoundaryMs:e},t)=>{typeof e==`number`&&e!==t?.stopTimerRefreshBoundaryMs&&this.reminders.forEac
426h(t=>{t.timer&&(t.timer.stopRefreshBoundaryMs=e)})}),this.upsertReminder=async e=>{let{messageId:t}=e;if(this.getFromState(t))try{return await this.updateReminder(e)}catch(t){if(bw(t))return await this.createReminder(e);throw t}else try{return await this.createReminder(e)}catch(t){if(yw(t))return await this.updateReminder(e);throw t}},this.createReminder=async e=>{let{reminder:t}=await this.client.createReminder(e);return this.upsertToState({data:t,overwrite:!1})},this.updateReminder=async e=>{let{reminder:t}=await this.client.updateReminder(e);return this.upsertToState({data:t})},this.deleteReminder=async e=>{await this.client.deleteReminder(e),this.removeFromState(e)},this.queryNextReminders=async()=>{await this.paginator.next()},this.queryPreviousReminders=async()=>{await this.paginator.prev()},this.client=t,this.configState=new sb({scheduledOffsetsMs:n?.scheduledOffsetsMs??vw.scheduledOffsetsMs,stopTimerRefreshBoundaryMs:n?.stopTimerRefreshBoundaryMs??vw.stopTimerRefreshBoundaryMs}),this.state=new sb({reminders:new Map}),this.paginator=new Kne(t)}updateConfig(e){typeof e.stopTimerRefreshBoundaryMs==`number`&&e.stopTimerRefreshBoundaryMs!==this.stopTimerRefreshBoundaryMs&&this.reminders.forEach(t=>{t.timer.stopRefreshBoundaryMs=e?.stopTimerRefreshBoundaryMs}),this.configState.partialNext(e)}get stopTimerRefreshBoundaryMs(){return this.configState.getLatestValue().stopTimerRefreshBoundaryMs}get scheduledOffsetsMs(){return this.configState.getLatestValue().scheduledOffsetsMs}get reminders(){return this.state.getLatestValue().reminders}getFromState(e){return this.reminders.get(e)}};xw.isReminderWsEventPayload=e=>!!e.reminder&&(e.type.startsWith(`reminder.`)||e.type===`notification.reminder_due`);var Sw=xw,Cw=e=>{if(!e)return{};let t=e.indexOf(`:`);return t<=0||t===e.length-1?{}:{channelId:e.slice(t+1),channelType:e.slice(0,t)}},ww=class{constructor(e,t){if(!e)throw Error(`Size must be greater than 0`);this.keys=[],this.size=e,this.map=new Map,this.dispose=t?.dispose??null}add(e,t){if(this.keys.indexOf(e)>-1)this.keys.splice(this.keys.indexOf(e),1);else if(this.keys.length>=this.size){let e=this.keys.shift();if(e){let t=this.peek(e);t&&this.dispose?.(e,t),this.map.delete(e)}}this.keys.push(e),this.map.set(e,t)}peek(e){return this.map.get(e)}get(e){let t=this.peek(e);return t&&this.keys.indexOf(e)!==this.size-1&&(this.keys.splice(this.keys.indexOf(e),1),this.keys.push(e)),t}clear(){this.dispose&&this.map.forEach((e,t)=>this.dispose?.(t,e)),this.map.clear(),this.keys=[]}};function Tw(e){return typeof e==`string`||e instanceof String}var Ew=class e{constructor(e,t,n){this.preventThreadCleanup=!1,this.nextRequestAbortController=null,this._messageComposerSetupState=new sb({setupFunction:null}),this._getConnectionID=()=>this.wsConnection?.connectionID||this.wsFallback?.connectionID,this._hasConnectionID=()=>!!this._getConnectionID(),this.setMessageComposerSetupFunction=e=>{this._messageComposerSetupState.partialNext({setupFunction:e})},this.connectUser=async(e,t)=>{if(!e.id)throw Error(`The "id" field on the user is missing`);if(this.userID===e.id&&this.setUserPromise)return console.warn(`Consecutive calls to connectUser is detected, ideally you should only call this function once in your app.`),this.setUserPromise;if(this.userID)throw Error(`Use client.disconnect() before trying to connect as a different user. connectUser was called twice.`);(this._isUsingServerAuth()||this.node)&&!this.options.allowServerSideConnect&&console.warn(`Please do not use connectUser server side. connectUser impacts MAU and concurrent connection usage and thus your bill. If you have a valid use-case, add "allowServerSideConnect: true" to the client options to disable this warning.`),this.userID=e.id,this.anonymous=!1;let n=this._setToken(e,t);this._setUser(e);let r=this.openConnection();this.setUserPromise=Promise.all([n,r]).then(e=>e[1]);try{return await this.setUserPromise}catch(e){throw this.persistUserOnConnectionFailure?this.closeConnection():this.disconnectUser(),e}},this.setUser=this.connectUser,this._setToken=(e,t)=>this.tokenManager.setTokenOrProvider(t,e),this.closeConnection=async e=>(this.cleaningIntervalRef!=null&&(clearInterval(this.cleaningIntervalRef),this.cleaningIntervalRef=void 0),await Promise.all([this.wsConnection?.disconnect(e),this.wsFallback?.disconnect(e)]),this.offlineDb?.executeQuerySafely(async e=>{this.userID&&await e.upsertUserSyncStatus({userId:this.userID,lastSyncedAt:new Date().toString()})},{method:`upsertUserSyncStatus`}),Promise.resolve()),this.createChannelManager=({eventHandlerOverrides:e={},options:t={},queryChannelsOverride:n})=>new tw({client:this,eventHandlerOverrides:e,options:t,queryChannelsOverride:n}),this.openConnection=()=>
426{if(!this.userID)throw Error(`User is not set on client, use client.connectUser or client.connectAnonymousUser instead`);if(this.wsConnection?.isConnecting&&this.wsPromise)return this.logger(`info`,`client:openConnection() - connection already in progress`,{tags:[`connection`,`client`]}),this.wsPromise;if((this.wsConnection?.isHealthy||this.wsFallback?.isHealthy())&&this._hasConnectionID()){this.logger(`info`,`client:openConnection() - openConnection called twice, healthy connection already exists`,{tags:[`connection`,`client`]});return}return this.clientID=`${this.userID}--${Ny()}`,this.wsPromise=this.connect(),this._startCleaning(),this.wsPromise},this._setupConnection=this.openConnection,this._normalizeDate=e=>{if(e instanceof Date&&(e=e.toISOString()),e===``)throw Error(`Don't pass blank string for since, use null instead if resetting the token revoke`);return e},this.disconnectUser=e=>{this.logger(`info`,`client:disconnect() - Disconnecting the client`,{tags:[`connection`,`client`]}),delete this.user,delete this._user,delete this.userID,this.anonymous=!1;let t=this.closeConnection(e);for(let e of Object.values(this.activeChannels))e._disconnect();return this.activeChannels={},this.state=new qS({client:this}),this.threads.resetState(),this.uploadManager.reset(),this.messageComposerCache.clear(),t.finally(()=>{this.tokenManager.reset()}).catch(e=>console.error(e)),t},this.disconnect=this.disconnectUser,this.connectAnonymousUser=()=>{(this._isUsingServerAuth()||this.node)&&!this.options.allowServerSideConnect&&console.warn(`Please do not use connectUser server side. connectUser impacts MAU and concurrent connection usage and thus your bill. If you have a valid use-case, add "allowServerSideConnect: true" to the client options to disable this warning.`),this.anonymous=!0,this.userID=Ny();let e={id:this.userID,anon:!0};return this._setToken(e,``),this._setUser(e),this._setupConnection()},this.setAnonymousUser=this.connectAnonymousUser,this.doAxiosRequest=async(e,t,n,r={})=>{await this.tokenManager.tokenReady();let i=this._enrichAxiosOptions(r);try{let r;switch(this._logApiRequest(e,t,n,i),e){case`get`:r=await this.axiosInstance.get(t,i);break;case`delete`:r=await this.axiosInstance.delete(t,i);break;case`post`:r=await this.axiosInstance.post(t,n,i);break;case`postForm`:r=await this.axiosInstance.postForm(t,n,i);break;case`put`:r=await this.axiosInstance.put(t,n,i);break;case`patch`:r=await this.axiosInstance.patch(t,n,i);break;case`options`:r=await this.axiosInstance.options(t,i);break;default:throw Error(`Invalid request type`)}return this._logApiResponse(e,t,r),this.consecutiveFailures=0,this.handleResponse(r)}catch(a){if(a.client_request_id=i.headers?.[`x-client-request-id`],this._logApiError(e,t,a),this.consecutiveFailures+=1,a.response)return a.response.data.code===Ay.TOKEN_EXPIRED&&!this.tokenManager.isStatic()?(this.consecutiveFailures>1&&await Oy(My(this.consecutiveFailures)),this.tokenManager.loadToken(),await this.doAxiosRequest(e,t,n,r)):this.handleResponse(a.response);throw a}},this.dispatchEvent=e=>{e.received_at||=new Date;let t=this._handleClientEvent(e),n=e.cid,r=n?this.activeChannels[n]:void 0;r&&r._handleChannelEvent(e),this._callClientListeners(e),r&&r._callChannelListeners(e),t.forEach(e=>e()),this.offlineDb?.executeQuerySafely(t=>t.handleEvent({event:e}),{method:`handleEvent;${e.type}`})},this._updateMemberWatcherReferences=e=>{let t=this.state.userChannelReferences[e.id]||{};for(let n in t){let t=this.activeChannels[n];t?.state&&(t.state.members[e.id]&&(t.state.members[e.id].user=e),t.state.watchers[e.id]&&(t.state.watchers[e.id]=e),t.state.read[e.id]&&(t.state.read[e.id].user=e))}},this._updateUserReferences=this._updateMemberWatcherReferences,this._updateUserMessageReferences=e=>{let t=this.state.userChannelReferences[e.id]||{};for(let n in t){let t=this.activeChannels[n];t&&t.state?.updateUserMessages(e)}},this._deleteUserMessageReference=(e,t=!1,n)=>{let r=this.state.userChannelReferences[e.id]||{};for(let i in r){let r=this.activeChannels[i];r&&r.state?.deleteUserMessages(e,t,n)}},this._handleUserEvent=e=>{if(e.user){if(e.type===`user.presence.changed`||e.type===`user.updated`){if(e.user.id===this.userID){let t={...this.user},n={...this._user};for(let r in this.user){if(r in e.user||zte(r))continue;let i=r;delete t[i],delete n[i]}for(let t in n){let r=t;r in e.user&&(n[r]=e.user[r])}this._user=n,this.user={...t,...e.user}}this.state.updateUser(e.user),this._updateMemberWatcherReferences(e.user)}e.type===`user.updated`&&this._updateUserMessageReferences(e.user),e.type===`user.deleted`&&e.user.deleted_at&&(e.mark_messages_deleted||e.hard_delete)&&this._deleteUserMessageReference(e.user,e.hard_delete,e.user.deleted_at?new Date(e.user.deleted_at):null)}},this._callClientListeners=e=>{let t=this,n=[];t.listeners.all&&n.push(...t.listeners.all),t.listeners[e.type]&&n.push(...t.listeners[e.type]);for(let t of n)t(e)},this.recoverState=async()=>{this.logger(`info`,`client:recoverState() - Start of recoverState with connectionID ${this._getConnectionID()}`,{tags:[`connection`]});let e=Object.keys(this.activeChannels);e.length&&this.recoverStateOnReconnect?(this.logger(`info`,`client:recoverState() - Start the querying of ${e.length} channels`,{tags:[`connection`,`client`]}),await this.queryChannels({cid:{$in:e}},{last_message_at:-1},{limit:30}),this.logger(`info`,`client:recoverState() - Querying channels finished`,{tags:[`connection`,`client`]}),this.dispatchEvent({type:`connection.recovered`})):this.dispatchEvent({type:`connection.recovered`}),this.wsPromise=Promise.resolve(),this.setUserPromise=Promise.resolve()},this.getChannelByMembers=(e,t)=>{let n=(t.members??[]).map(e=>typeof e==`string`?e:e.user_id??``),r=n.sort().join(`,`),i=Yy(e,n);if(!i)throw Error(`Please specify atleast one member when creating unique conversation`);for(let t in this.activeChannels){let n=this.activeChannels[t];if(!n.disconnected&&(t===i||t.indexOf(`${e}:!members-`)===0&&Object.keys(n.state.members).sort().join(`,`)===r))return n}let a=new KS(this,e,void 0,t);return this._cacheEnabled()&&(this.activeChannels[i]=a),a},this.getChannelById=(e,t,n)=>{if(typeof t==`string`&&~t.indexOf(`:`))throw Error(`Invalid channel id ${t}, can't contain the : character`);let r=`${e}:${t}`;if(r in this.activeChannels&&this.activeChannels[r]&&!this.activeChannels[r].disconnected){let e=this.activeChannels[r];return Object.keys(n).length>0&&(e.data={...e.data,...n},e._data={...e._data,...n}),e}let i=new KS(this,e,t,n);return this._cacheEnabled()&&(this.activeChannels[i.cid]=i),i},this.updateUsers=this.upsertUsers,this.updateUser=this.upsertUser,this._unblockMessage=this.unblockMessage,this.markAllRead=this.markChannelsRead,this._isUsingServerAuth=()=>!!this.secret,this._cacheEnabled=()=>!this._isUsingServerAuth()||!this.options.disableCache,this._buildWSPayload=e=>JSON.stringify({user_id:this.userID,user_details:this._user,device:this.options.device,client_request_id:e}),this.key=e,this.listeners={},this.state=new qS({client:this}),this.mutedChannels=[],this.mutedUsers=[],this.blockedUsers=new sb({userIds:[]}),this.moderation=new kC(this),this.notifications=n?.notifications??new iw,this.uploadManager=new aC(this),t&&Tw(t)&&(this.secret=t);let r=n||(t&&!Tw(t)?t:{});this.browser=r.browser===void 0?typeof window<`u`:r.browser,this.node=!this.browser,this.options={timeout:3e3,withCredentials:!1,warmUp:!1,recoverStateOnReconnect:!0,disableCache:!1,wsUrlParams:new URLSearchParams({}),...r},this.node&&!this.options.httpsAgent&&(this.options.httpsAgent=new gy.default.Agent({keepAlive:!0,keepAliveMsecs:3e3})),this.axiosInstance=tp.create(this.options),this.setBaseURL(this.options.baseURL||`https://chat.stream-io-api.com`),typeof process<`u`&&`env`in process&&{}.STREAM_LOCAL_TEST_RUN&&this.setBaseURL(`http://localhost:3030`),typeof process<`u`&&`env`in process&&{}.STREAM_LOCAL_TEST_HOST&&this.setBaseURL(`http://`+{}.STREAM_LOCAL_TEST_HOST),this.wsConnection=null,this.wsPromise=null,this.setUserPromise=null,this.activeChannels={},this.configs={},this.anonymous=!1,this.persistUserOnConnectionFailure=this.options?.persistUserOnConnectionFailure,this.tokenManager=new TC(this.secret),this.consecutiveFailures=0,this.insightMetrics=new JS,this.defaultWSTimeoutWithFallback=6*1e3,this.defaultWSTimeout=15*1e3,this.axiosInstance.defaults.paramsSerializer
426=Kte,this.logger=ky(r.logger)?r.logger:()=>null,this.recoverStateOnReconnect=this.options.recoverStateOnReconnect,this.threads=new NC({client:this}),this.polls=new KC({client:this}),this.reminders=new Sw({client:this}),this.messageDeliveryReporter=new RS({client:this}),this.messageComposerCache=new ww(64)}static getInstance(t,n,r){return e._instance||(typeof n==`string`?e._instance=new e(t,n,r):e._instance=new e(t,n)),e._instance}setOfflineDBApi(e){this.offlineDb||=e}devToken(e){return fC(e)}getAuthType(){return this.anonymous?`anonymous`:`jwt`}setBaseURL(e){this.baseURL=e,this.wsBaseURL=this.baseURL.replace(`http`,`ws`).replace(`:3030`,`:8800`)}_setUser(e){this.user=e,this.userID=e.id,this._user={...e}}async updateAppSettings(e){let t=e.apn_config;return t?.p12_cert&&(e={...e,apn_config:{...t,p12_cert:Buffer.from(t.p12_cert).toString(`base64`)}}),await this.patch(this.baseURL+`/app`,e)}async revokeTokens(e){return await this.updateAppSettings({revoke_tokens_issued_before:this._normalizeDate(e)})}async revokeUserToken(e,t){return await this.revokeUsersToken([e],t)}async revokeUsersToken(e,t){t=t===void 0?new Date().toISOString():this._normalizeDate(t);let n=[];for(let r of e)n.push({id:r,set:{revoke_tokens_issued_before:t}});return await this.partialUpdateUsers(n)}async getAppSettings(){return this.appSettingsPromise=this.get(this.baseURL+`/app`),await this.appSettingsPromise}async testPushSettings(e,t={}){return await this.post(this.baseURL+`/check_push`,{user_id:e,...t.messageID?{message_id:t.messageID}:{},...t.apnTemplate?{apn_template:t.apnTemplate}:{},...t.firebaseTemplate?{firebase_template:t.firebaseTemplate}:{},...t.firebaseDataTemplate?{firebase_data_template:t.firebaseDataTemplate}:{},...t.skipDevices?{skip_devices:!0}:{},...t.pushProviderName?{push_provider_name:t.pushProviderName}:{},...t.pushProviderType?{push_provider_type:t.pushProviderType}:{}})}async testSQSSettings(e={}){return await this.post(this.baseURL+`/check_sqs`,e)}async testSNSSettings(e={}){return await this.post(this.baseURL+`/check_sns`,e)}async setGuestUser(e){let t;this.anonymous=!0;try{t=await this.post(this.baseURL+`/guest`,{user:e})}catch(e){throw this.anonymous=!1,e}this.anonymous=!1;let{created_at:n,updated_at:r,last_active:i,online:a,...o}=t.user;return await this.connectUser(o,t.access_token)}createToken(e,t,n){if(this.secret==null)throw Error(`tokens can only be created server-side using the API Secret`);let r={};return t&&(r.exp=t),n&&(r.iat=n),lC(this.secret,e,r,{})}on(e,t){let n=t?e:`all`,r=t||e;return n in this.listeners||(this.listeners[n]=[]),this.logger(`info`,`Attaching listener for ${n} event`,{tags:[`event`,`client`]}),this.listeners[n].push(r),{unsubscribe:()=>{this.logger(`info`,`Removing listener for ${n} event`,{tags:[`event`,`client`]}),this.listeners[n]=this.listeners[n].filter(e=>e!==r)}}}off(e,t){let n=t?e:`all`,r=t||e;n in this.listeners||(this.listeners[n]=[]),this.logger(`info`,`Removing listener for ${n} event`,{tags:[`event`,`client`]}),this.listeners[n]=this.listeners[n].filter(e=>e!==r)}_logApiRequest(e,t,n,r){this.logger(`info`,`client: ${e} - Request - ${t}`,{tags:[`api`,`api_request`,`client`],url:t,payload:n,config:r})}_logApiResponse(e,t,n){this.logger(`info`,`client:${e} - Response - url: ${t} > status ${n.status}`,{tags:[`api`,`api_response`,`client`],url:t,response:n})}_logApiError(e,t,n){this.logger(`error`,`client:${e} - Error - url: ${t}`,{tags:[`api`,`api_response`,`client`],url:t,error:n})}get(e,t){return this.doAxiosRequest(`get`,e,null,{params:t})}put(e,t){return this.doAxiosRequest(`put`,e,t)}post(e,t){return this.doAxiosRequest(`post`,e,t)}patch(e,t){return this.doAxiosRequest(`patch`,e,t)}delete(e,t){return this.doAxiosRequest(`delete`,e,null,{params:t})}sendFile(e,t,n,r,i,a){let o=Bte(t,n,r||`multipart/form-data`);return i!=null&&o.append(`user`,JSON.stringify(i)),this.doAxiosRequest(`postForm`,e,o,{headers:o.getHeaders?o.getHeaders():{},config:{timeout:0,maxContentLength:1/0,maxBodyLength:1/0,...a}})}errorFromResponse(e){return new hS(e.data.code===void 0?`StreamChat error HTTP code: ${e.status}`:`StreamChat error code ${e.data.code}: ${e.data.message}
426`,{code:e.data.code??null,response:e,status:e.status})}handleResponse(e){let t=e.data;if(Hne(e))throw this.errorFromResponse(e);return t}_handleClientEvent(e){let t=this,n=[];if(this.logger(`info`,`client:_handleClientEvent - Received event of type { ${e.type} }`,{tags:[`event`,`client`],event:e}),(e.type===`user.presence.changed`||e.type===`user.updated`||e.type===`user.deleted`)&&this._handleUserEvent(e),e.type===`user.messages.deleted`&&!e.cid&&e.user&&this._deleteUserMessageReference(e.user,e.hard_delete,e.created_at?new Date(e.created_at):null),e.type===`health.check`&&e.me&&(t.user=e.me,t.state.updateUser(e.me),t.mutedChannels=e.me.channel_mutes,t.mutedUsers=e.me.mutes,t.blockedUsers.partialNext({userIds:e.me.blocked_user_ids??[]})),e.channel&&e.type===`notification.message_new`){let{channel:t}=e;this._addChannelConfig(t)}if(e.type===`notification.channel_mutes_updated`&&e.me?.channel_mutes&&(this.mutedChannels=e.me.channel_mutes),e.type===`notification.mutes_updated`&&e.me?.mutes&&(this.mutedUsers=e.me.mutes),e.type===`notification.mark_read`&&e.unread_channels===0&&Object.keys(this.activeChannels).forEach(e=>this.activeChannels[e].state.unreadCount=0),(e.type===`channel.deleted`||e.type===`notification.channel_deleted`)&&e.cid){let{cid:r}=e;t.state.deleteAllChannelReference(r),this.activeChannels[e.cid]?._disconnect(),n.push(()=>{r&&delete this.activeChannels[r]})}return n}_muteStatus(e){let t;for(let n=0;n<this.mutedChannels.length;n++){let r=this.mutedChannels[n];if(r.channel?.cid===e){t={muted:r.expires?new Date(r.expires).getTime()>new Date().getTime():!0,createdAt:r.created_at?new Date(r.created_at):new Date,expiresAt:r.expires?new Date(r.expires):null};break}}return t||{muted:!1,createdAt:null,expiresAt:null}}async connect(){if(!this.userID||!this._user)throw Error(`Call connectUser or connectAnonymousUser before starting the connection`);if(!this.wsBaseURL)throw Error(`Websocket base url not set`);if(!this.clientID)throw Error(`clientID is not set`);!this.wsConnection&&(this.options.warmUp||this.options.enableInsights)&&this._sayHi(),this.options.wsConnection&&this.node?(this.options.wsConnection.setClient(this),this.wsConnection=this.options.wsConnection):this.wsConnection=new tC({client:this});try{return this.wsFallback?await this.wsFallback.connect():await this.wsConnection.connect(this.options.enableWSFallback?this.defaultWSTimeoutWithFallback:this.defaultWSTimeout)}catch(e){if(this.options.enableWSFallback&&Vne(e)&&Gte())return this.logger(`info`,`client:connect() - WS failed, fallback to longpoll`,{tags:[`connection`,`client`]}),this.dispatchEvent({type:`transport.changed`,mode:`longpoll`}),this.wsConnection._destroyCurrentWSConnection(),this.wsConnection.disconnect().then(),this.wsFallback=new EC({client:this}),await this.wsFallback.connect();throw e}}_sayHi(){let e=Ny(),t={headers:{"x-client-request-id":e}};this.doAxiosRequest(`get`,this.baseURL+`/hi`,null,t).catch(t=>{this.options.enableInsights&&YS(`http_hi_failed`,{api_key:this.key,err:t,client_request_id:e})})}async queryUsers(e,t=[],n={}){let r={presence:!1};await this.wsPromise,this._hasConnectionID()||(r.presence=!1);let i=await this.get(this.baseURL+`/users`,{payload:{filter_conditions:e,sort:jy(t),...r,...n}});return this.state.updateUsers(i.users),i}async queryUserGroups(e={}){return await this.get(this.baseURL+`/usergroups`,e)}async createUserGroup(e){return await this.post(this.baseURL+`/usergroups`,e)}async getUserGroup(e,t={}){return await this.get(`${this.baseURL}/usergroups/${encodeURIComponent(e)}`,t)}async searchUserGroups(e){return await this.get(this.baseURL+`/usergroups/search`,e)}async updateUserGroup(e,t){return await this.put(`${this.baseURL}/usergroups/${encodeURIComponent(e)}`,t)}async deleteUserGroup(e,t={}){return await this.delete(`${this.baseURL}/usergroups/${encodeURIComponent(e)}`,t)}async addUserGroupMembers(e,t){return await this.post(`${this.baseURL}/usergroups/${encodeURIComponent(e)}/members`,t)}async removeUserGroupMembers(e,t){return await this.post(`${this.baseURL}/usergroups/${encodeURIComponent(e)}/members/delete`,t)}async queryBannedUsers(e={},t=[],n={}){return await this.get(this.baseURL+`/query_banned_users`,{payload:{filter_conditions:e,sort:jy(t),...n}})}async queryFutureChannelBans(e={}){return await this.get(this.baseURL+`/query_future_channel_bans`,{payload:e})}async queryMessageFlags(e={},t={}){return await this.get(this.baseURL+`/moderation/flags/message`,{payload:{filter_conditions:e,...t}})}async queryChannelsRequestWithResponse(e,t=[],n={}){let r={state:!0,watch:!0,presence:!1};await this.wsPromise,this._hasConnectionID()||(r.watch=!1);let{predefined_filter:i,filter_values:a,sort_values:o,...s}=n,c=jy(t),l=i?{predefined_filter:i,filter_values:a,sort_values:o,sort:c,...r,...s}:{filter_conditions:e,sort:c,...r,...s};return await this.post(this.baseURL+`/channels`,l)}
426async queryChannelsRequest(e,t=[],n={}){return(await this.queryChannelsRequestWithResponse(e,t,n)).channels}async queryChannels(e,t=[],n={},r={}){let i=await this.queryChannelsRequestWithResponse(e,t,n),a=i.channels;this.dispatchEvent({type:`channels.queried`,queriedChannels:{channels:a,isLatestMessageSet:!0}}),a?.length&&this.offlineDb?.upsertChannels&&await this.offlineDb.upsertChannels({channels:a,isLatestMessagesSet:!0});let o=this.hydrateActiveChannels(a,r,n);return r.withResponse?{...i,channels:o}:o}async queryReactions(e,t,n=[],r={}){let i={filter:t,sort:jy(n),...r};if(this.offlineDb?.getReactions&&!r.next)try{let i=await this.offlineDb.getReactions({messageId:e,filters:t,sort:n,limit:r.limit});i&&this.dispatchEvent({type:`offline_reactions.queried`,offlineReactions:i})}catch(e){this.logger(`warn`,`An error has occurred while querying offline reactions`,{error:e})}return await this.wsPromise,await this.post(this.baseURL+`/messages/`+encodeURIComponent(e)+`/reactions`,i)}hydrateActiveChannels(e=[],t={},n){let{skipInitialization:r,offlineMode:i=!1}=t,a=[];for(let t of e){this._addChannelConfig(t.channel);
426let e=this.channel(t.channel.type,t.channel.id);e.data=t.channel,e.offlineMode=i,e.initialized=!i,e.push_preferences=t.push_preferences;let o,s=[];if(r===void 0){let{messageSet:n,filteredMessageIds:r}=e._initializeState(t,`latest`);s=r,o=n}else if(!r.includes(t.channel.id)){e.state.clearMessages();let{messageSet:n,filteredMessageIds:r}=e._initializeState(t,`latest`);s=r,o=n}o&&(o.pagination={...o.pagination,...Ky({parentSet:o,requestedPageSize:n?.message_limit||_y,returnedPage:t.messages,filteredReturnedPage:t.messages.filter(e=>!s.includes(e.id)),logger:this.logger})},this.polls.hydratePollCache(t.messages,!0),this.reminders.hydrateState(t.messages)),e.messageComposer.initStateFromChannelResponse(t),e.cooldownTimer.refresh(),a.push(e)}return this.syncDeliveredCandidates(a),a}async search(e,t,n={}){if(n.offset&&n.next)throw Error(`Cannot specify offset with next`);let r={filter_conditions:e,...n,sort:n.sort?jy(n.sort):void 0};if(typeof t==`string`)r.query=t;else if(typeof t==`object`)r.message_filter_conditions=t;else throw Error(`Invalid type ${typeof t} for query parameter`);return await this.wsPromise,await this.get(this.baseURL+`/search`,{payload:r})}setLocalDevice(e){if(this.wsConnection?.isConnecting&&this.wsPromise||(this.wsConnection?.isHealthy||this.wsFallback?.isHealthy())&&this._hasConnectionID())throw Error(`you can only set device before opening a websocket connection`);this.options.device=e}async addDevice(e,t,n,r){return await this.post(this.baseURL+`/devices`,{id:e,push_provider:t,...n==null?{}:{user_id:n},...r==null?{}:{push_provider_name:r}})}async getDevices(e){return await this.get(this.baseURL+`/devices`,e?{user_id:e}:{})}async getUnreadCount(e){return await this.get(this.baseURL+`/unread`,e?{user_id:e}:{})}async getUnreadCountBatch(e){return await this.post(this.baseURL+`/unread_batch`,{user_ids:e})}async setPushPreferences(e){return await this.post(this.baseURL+`/push_preferences`,{preferences:e})}async removeDevice(e,t){return await this.delete(this.baseURL+`/devices`,{id:e,...t?{user_id:t}:{}})}getRateLimits(e){let{serverSide:t,web:n,android:r,ios:i,endpoints:a}=e||{};return this.get(this.baseURL+`/rate_limits`,{server_side:t,web:n,android:r,ios:i,endpoints:a?a.join(`,`):void 0})}async getHookEvents(e){let t=e&&e.length>0?{product:e.join(`,`)}:{};return await this.get(this.baseURL+`/hook/events`,t)}_addChannelConfig({cid:e,config:t}){this._cacheEnabled()&&(this.configs[e]=t)}channel(e,t,n={}){if(!this.userID&&!this._isUsingServerAuth())throw Error(`Call connectUser or connectAnonymousUser before creating a channel`);if(~e.indexOf(`:`))throw Error(`Invalid channel group ${e}, can't contain the : character`);return t&&typeof t==`object`?this.getChannelByMembers(e,t):!t&&typeof n==`object`&&n.members?.length?this.getChannelByMembers(e,n):t?this.getChannelById(e,t,n):new KS(this,e,void 0,n)}async partialUpdateUser(e){return await this.partialUpdateUsers([e])}async upsertUsers(e){let t={};for(let n of e){if(!n.id)throw Error(`User ID is required when updating a user`);t[n.id]=n}return await this.post(this.baseURL+`/users`,{users:t})}upsertUser(e){return this.upsertUsers([e])}async partialUpdateUsers(e){for(let t of e)if(!t.id)throw Error(`User ID is required when updating a user`);return await this.patch(this.baseURL+`/users`,{users:e})}async deleteUser(e,t){return await this.delete(this.baseURL+`/users/${encodeURIComponent(e)}`,t)}async restoreUsers(e){return await this.post(this.baseURL+`/users/restore`,{user_ids:e})}async reactivateUser(e,t){return await this.post(this.baseURL+`/users/${encodeURIComponent(e)}/reactivate`,{...t})}async reactivateUsers(e,t){return await this.post(this.baseURL+`/users/reactivate`,{user_ids:e,...t})}async deactivateUser(e,t){return await this.post(this.baseURL+`/users/${encodeURIComponent(e)}/deactivate`,{...t})}async deactivateUsers(e,t){return await this.post(this.baseURL+`/users/deactivate`,{user_ids:e,...t})}async exportUser(e,t){return await this.get(this.baseURL+`/users/${encodeURIComponent(e)}/export`,{...t})}async banUser(e,t){return await this.post(this.baseURL+`/moderation/ban`,{target_user_id:e,...t})}async unbanUser(e,t){return await this.delete(this.baseURL+`/moderation/ban`,{target_user_id:e,...t})}async shadowBan(e,t){return await this.banUser(e,{shadow:!0,...t})}async removeShadowBan(e,t){return await this.unbanUser(e,{shadow:!0,...t})}async blockUser(e,t){let n=await this.post(this.baseURL+`/users/block`,{blocked_user_id:e,...t?{user_id:t}:{}});return this._cacheEnabled()&&this.blockedUsers.next(({userIds:t})=>({userIds:t.concat(e)})),n}async getBlockedUsers(e){let t=await this.get(this.baseURL+`/users/block`,{...e?{user_id:e}:{}});return this._cacheEnabled()&&this.blockedUsers.partialNext({userIds:t.blocks.map(({blocked_user_id:e})=>e)}
426),t}async unBlockUser(e,t){let n=await this.post(this.baseURL+`/users/unblock`,{blocked_user_id:e,...t?{user_id:t}:{}});return this._cacheEnabled()&&this.blockedUsers.next(({userIds:t})=>({userIds:t.filter(t=>t!==e)})),n}async getSharedLocations(){return await this.get(this.baseURL+`/users/live_locations`)}async muteUser(e,t,n={}){return await this.post(this.baseURL+`/moderation/mute`,{target_id:e,...t?{user_id:t}:{},...n})}async unmuteUser(e,t){return await this.post(this.baseURL+`/moderation/unmute`,{target_id:e,...t?{user_id:t}:{}})}userMuteStatus(e){if(!this.user||!this.wsPromise)throw Error(`Make sure to await connectUser() first.`);for(let t=0;t<this.mutedUsers.length;t+=1)if(this.mutedUsers[t].target.id===e)return!0;return!1}async flagMessage(e,t={}){return await this.post(this.baseURL+`/moderation/flag`,{target_message_id:e,...t})}async flagUser(e,t={}){return await this.post(this.baseURL+`/moderation/flag`,{target_user_id:e,...t})}async unflagMessage(e,t={}){return await this.post(this.baseURL+`/moderation/unflag`,{target_message_id:e,...t})}async unflagUser(e,t={}){return await this.post(this.baseURL+`/moderation/unflag`,{target_user_id:e,...t})}async _queryFlags(e={},t={}){return await this.post(this.baseURL+`/moderation/flags`,{filter_conditions:e,...t})}async _queryFlagReports(e={},t={}){return await this.post(this.baseURL+`/moderation/reports`,{filter_conditions:e,...t})}async _reviewFlagReport(e,t,n={}){return await this.patch(this.baseURL+`/moderation/reports/${encodeURIComponent(e)}`,{review_result:t,...n})}async unblockMessage(e,t={}){return await this.post(this.baseURL+`/moderation/unblock_message`,{target_message_id:e,...t})}async markChannelsRead(e={}){await this.post(this.baseURL+`/channels/read`,{...e})}createCommand(e){return this.post(this.baseURL+`/commands`,e)}getCommand(e){return this.get(this.baseURL+`/commands/${encodeURIComponent(e)}`)}updateCommand(e,t){return this.put(this.baseURL+`/commands/${encodeURIComponent(e)}`,t)}deleteCommand(e){return this.delete(this.baseURL+`/commands/${encodeURIComponent(e)}`)}listCommands(){return this.get(this.baseURL+`/commands`)}createChannelType(e){let t=Object.assign({},{commands:[`all`]},e);return this.post(this.baseURL+`/channeltypes`,t)}getChannelType(e){return this.get(this.baseURL+`/channeltypes/${encodeURIComponent(e)}`)}updateChannelType(e,t){return this.put(this.baseURL+`/channeltypes/${encodeURIComponent(e)}`,t)}deleteChannelType(e){return this.delete(this.baseURL+`/channeltypes/${encodeURIComponent(e)}`)}listChannelTypes(){return this.get(this.baseURL+`/channeltypes`)}async translateMessage(e,t){return await this.post(this.baseURL+`/messages/${encodeURIComponent(e)}/translate`,{language:t})}async translate(e,t,n){return await this.post(this.baseURL+`/translate`,{text:e,source_language:n,destination_language:t})}_normalizeExpiration(e){let t=null;if(typeof e==`number`){let n=new Date;n.setSeconds(n.getSeconds()+e),t=n.toISOString()}else Tw(e)?t=e:e instanceof Date&&(t=e.toISOString());return t}_validateAndGetMessageId(e,t){let n;if(typeof e==`string`)n=e;else{if(!e.id)throw Error(t);n=e.id}return n}pinMessage(e,t,n,r){let i=this._validateAndGetMessageId(e,`Please specify the message id when calling unpinMessage`);return this.partialUpdateMessage(i,{set:{pinned:!0,pin_expires:this._normalizeExpiration(t),pinned_at:this._normalizeExpiration(r)}},n)}unpinMessage(e,t){let n=this._validateAndGetMessageId(e,`Please specify the message id when calling unpinMessage`);return this.partialUpdateMessage(n,{set:{pinned:!1}},t)}async updateMessage(e,t,n){if(!e.id)throw Error(`Please specify the message.id when calling updateMessage`);let r=e.id;try{if(this.offlineDb)return await this.offlineDb.queueTask({task:{...Cw(e.cid),messageId:r,payload:[e,t,n],type:`update-message`}})}catch(e){this.logger(`error`,`offlineDb:updateMessage`,{tags:[`channel`,`offlineDb`],error:e})}return await this._updateMessage(e,t,n)}async _updateMessage(e,t,n){if(!e.id)throw Error(`Please specify the message.id when calling updateMessage`);let r=zy(e);return typeof t==`string`?r.user_id=t:typeof t?.id==`string`&&(r.user_id=t.id),await this.post(this.baseURL+`/messages/${encodeURIComponent(e.id)}`,{message:r,...n})}async partialUpdateMessage(e,t,n,r){if(!e)throw Error(`Please specify the message.id when calling partialUpdateMessage`);let i;return typeof n==`string`?i={id:n}:typeof n?.id==`string`&&(i={id:n.id}),await this.put(this.baseURL+`/messages/${encodeURIComponent(e)}`,{...t,...r,user:i})}async ephemeralUpdateMessage(e,t,n,r){if(!e)throw Error(`messageId is required`);let i;return typeof n==`string`?i={id:n}:typeof n?.id==`string`&&(i={id:n.id}),await this.patch(`${this.baseURL}
426/messages/${encodeURIComponent(e)}/ephemeral`,{...t,...r,user:i})}async deleteMessage(e,t){let n={};typeof t==`boolean`?n=t?{hardDelete:!0}:{}:t?.deleteForMe?n={deleteForMe:!0}:t?.hardDelete&&(n={hardDelete:!0});try{if(this.offlineDb)return n.hardDelete?await this.offlineDb.hardDeleteMessage({id:e}):await this.offlineDb.softDeleteMessage({id:e,deleteForMe:n.deleteForMe}),await this.offlineDb.queueTask({task:{messageId:e,payload:[e,n],type:`delete-message`}})}catch(e){this.logger(`error`,`offlineDb:deleteMessage`,{tags:[`channel`,`offlineDb`],error:e})}return this._deleteMessage(e,n)}async _deleteMessage(e,t){let{deleteForMe:n,hardDelete:r}=typeof t==`boolean`?{hardDelete:t}:t??{},i={};r&&(i={hard:!0}),n&&(i={...i,delete_for_me:!0});let a=await this.delete(this.baseURL+`/messages/${encodeURIComponent(e)}`,i);return n&&(a.message.deleted_for_me=!0,a.message.type=`deleted`),a}async undeleteMessage(e,t){return await this.post(this.baseURL+`/messages/${encodeURIComponent(e)}/undelete`,{undeleted_by:t})}async getMessage(e,t){return await this.get(this.baseURL+`/messages/${encodeURIComponent(e)}`,{...t})}async queryThreads(e={}){let t={limit:10,participant_limit:10,reply_limit:3,watch:!0,...e},n={...t};t.filter&&Object.keys(t.filter).length>0&&(n.filter=t.filter),t.sort&&(Array.isArray(t.sort)?t.sort.length>0:Object.keys(t.sort).length>0)&&(n.sort=jy(t.sort));let r=await this.post(`${this.baseURL}/threads`,n),i=r.threads.map(e=>e.parent_message);return this.polls.hydratePollCache(i),{threads:r.threads.map(e=>new CS({client:this,threadData:e})),next:r.next}}async getThread(e,t={}){if(!e)throw Error(`Please specify the messageId when calling getThread`);let n={participant_limit:100,reply_limit:3,watch:!0,...t},r=await this.get(`${this.baseURL}/threads/${encodeURIComponent(e)}`,n);return new CS({client:this,threadData:r.thread})}async partialUpdateThread(e,t){if(!e)throw Error(`Please specify the message id when calling partialUpdateThread`);let n=[`created_at`,`id`,`last_message_at`,`type`,`updated_at`,`user`,`reply_count`,`participants`,`channel`,`custom`];for(let e in{...t.set,...t.unset})if(n.includes(e))throw Error(`You cannot set ${e} field on Thread object. ${e} is reserved for server-side use. Please omit ${e} from your set object.`);return await this.patch(`${this.baseURL}/threads/${encodeURIComponent(e)}`,t)}getUserAgent(){if(this.userAgent)return this.userAgent;let e=`9.46.0`,t=``;t=this.sdkIdentifier?`stream-chat-${this.sdkIdentifier.name}-v${this.sdkIdentifier.version}-llc-v${e}`:`stream-chat-js-v${e}-${this.node?`node`:`browser`}`;let{os:n,model:r}=this.deviceIdentifier??{};return[[`os`,n],[`device_model`,r],[`client_bundle`,`browser-esm`]].reduce((e,[t,n])=>n&&n.length>0?e.concat(`|${t}=${n}`):e,t)}setUserAgent(e){this.userAgent=e}_enrichAxiosOptions(e={params:{},headers:{},config:{}}){let t=this._getToken(),n=t?{Authorization:t}:void 0,r=null;this.nextRequestAbortController!==null&&(r=this.nextRequestAbortController.signal,this.nextRequestAbortController=null),e.headers?.[`x-client-request-id`]||(e.headers={...e.headers,"x-client-request-id":Ny()});let{params:i,headers:a,...o}=this.options.axiosRequestConfig||{};return{params:{user_id:this.userID,connection_id:this._getConnectionID(),api_key:this.key,...e.params,...i||{}},headers:{...n,"stream-auth-type":this.getAuthType(),"X-Stream-Client":this.getUserAgent(),...e.headers,...a||{}},...r?{signal:r}:{},...e.config,...o||{}}}_getToken(){return!this.tokenManager||this.anonymous?null:this.tokenManager.getToken()}_startCleaning(){let e=this;this.cleaningIntervalRef??=setInterval(()=>{for(let t of Object.values(e.activeChannels))t.clean()},500)}verifyWebhook(e,t){return!!this.secret&&pC(e,t,this.secret)}verifyAndParseWebhook(e,t){if(!this.secret)throw new hC(`cannot verify webhook signature without an API secret on the client`);return SC(e,t,this.secret)}parseSqs(e){return CC(e)}parseSns(e){return wC(e)}getPermission(e){return this.get(`${this.baseURL}/permissions/${encodeURIComponent(e)}`)}createPermission(e){return this.post(`${this.baseURL}/permissions`,{...e})}updatePermission(e,t){return this.put(`${this.baseURL}
426/permissions/${encodeURIComponent(e)}`,{...t})}deletePermission(e){return this.delete(`${this.baseURL}/permissions/${encodeURIComponent(e)}`)}listPermissions(){return this.get(`${this.baseURL}/permissions`)}createRole(e){return this.post(`${this.baseURL}/roles`,{name:e})}listRoles(){return this.get(`${this.baseURL}/roles`)}searchRoles(e){return this.get(`${this.baseURL}/roles/search`,e)}deleteRole(e){return this.delete(`${this.baseURL}/roles/${encodeURIComponent(e)}`)}sync(e,t,n={}){return this.post(`${this.baseURL}/sync`,{channel_cids:e,last_sync_at:t,...n})}async sendUserCustomEvent(e,t){return await this.post(`${this.baseURL}/users/${encodeURIComponent(e)}/event`,{event:t})}createBlockList(e){return this.post(`${this.baseURL}/blocklists`,e)}listBlockLists(e){return this.get(`${this.baseURL}/blocklists`,e)}getBlockList(e,t){return this.get(`${this.baseURL}/blocklists/${encodeURIComponent(e)}`,t)}updateBlockList(e,t){return this.put(`${this.baseURL}/blocklists/${encodeURIComponent(e)}`,t)}deleteBlockList(e,t){return this.delete(`${this.baseURL}/blocklists/${encodeURIComponent(e)}`,t)}exportChannels(e,t={}){let n={channels:e,...t};return this.post(`${this.baseURL}/export_channels`,n)}exportUsers(e){return this.post(`${this.baseURL}/export/users`,e)}exportChannel(e,t){return this.exportChannels([e],t)}getExportChannelStatus(e){return this.get(`${this.baseURL}/export_channels/${encodeURIComponent(e)}`)}campaign(e,t){return e&&typeof e==`object`?new my(this,null,e):new my(this,e,t)}channelBatchUpdater(){return new hy(this)}segment(e,t,n){return typeof t==`string`?new DC(this,e,t,n):new DC(this,e,null,t)}validateServerSideAuth(){if(!this.secret)throw Error(`This feature can be used server-side only. Please initialize the client with a secret to use this feature.`)}createSegment(e,t,n){this.validateServerSideAuth();let r={id:t,type:e,...n};return this.post(this.baseURL+`/segments`,r)}createUserSegment(e,t){return this.validateServerSideAuth(),this.createSegment(`user`,e,t)}createChannelSegment(e,t){return this.validateServerSideAuth(),this.createSegment(`channel`,e,t)}getSegment(e){return this.validateServerSideAuth(),this.get(this.baseURL+`/segments/${encodeURIComponent(e)}`)}updateSegment(e,t){return this.validateServerSideAuth(),this.put(this.baseURL+`/segments/${encodeURIComponent(e)}`,t)}addSegmentTargets(e,t){this.validateServerSideAuth();let n={target_ids:t};return this.post(this.baseURL+`/segments/${encodeURIComponent(e)}/addtargets`,n)}querySegmentTargets(e,t={},n=[],r={}){return this.validateServerSideAuth(),this.post(this.baseURL+`/segments/${encodeURIComponent(e)}/targets/query`,{filter:t||{},sort:n||[],...r})}removeSegmentTargets(e,t){this.validateServerSideAuth();let n={target_ids:t};return this.post(this.baseURL+`/segments/${encodeURIComponent(e)}/deletetargets`,n)}querySegments(e,t,n={}){return this.validateServerSideAuth(),this.post(this.baseURL+`/segments/query`,{filter:e,sort:t,...n})}deleteSegment(e){return this.validateServerSideAuth(),this.delete(this.baseURL+`/segments/${encodeURIComponent(e)}`)}segmentTargetExists(e,t){return this.validateServerSideAuth(),this.get(this.baseURL+`/segments/${encodeURIComponent(e)}/target/${encodeURIComponent(t)}`)}createCampaign(e){return this.validateServerSideAuth(),this.post(this.baseURL+`/campaigns`,{...e})}getCampaign(e,t){return this.validateServerSideAuth(),this.get(this.baseURL+`/campaigns/${encodeURIComponent(e)}`,{...t?.users})}startCampaign(e,t){return this.validateServerSideAuth(),this.post(this.baseURL+`/campaigns/${encodeURIComponent(e)}/start`,{scheduled_for:t?.scheduledFor,stop_at:t?.stopAt})}async queryCampaigns(e,t,n){return this.validateServerSideAuth(),await this.post(this.baseURL+`/campaigns/query`,{filter:e,sort:t,...n||{}})}updateCampaign(e,t){return this.validateServerSideAuth(),this.put(this.baseURL+`/campaigns/${encodeURIComponent(e)}`,t)}deleteCampaign(e){return this.validateServerSideAuth(),this.delete(this.baseURL+`/campaigns/${encodeURIComponent(e)}`)}stopCampaign(e){return this.validateServerSideAuth(),this.post(this.baseURL+`/campaigns/${encodeURIComponent(e)}/stop`)}enrichURL(e){return this.get(this.baseURL+`/og`,{url:e})}getTask(e){return this.get(`${this.baseURL}
426/tasks/${encodeURIComponent(e)}`)}async deleteChannels(e,t={}){return await this.post(this.baseURL+`/channels/delete`,{cids:e,...t})}async deleteUsers(e,t={}){if(t.user!==void 0&&![`soft`,`hard`,`pruning`].includes(t.user))throw Error(`Invalid delete user options. user must be one of [soft hard pruning]`);if(t.conversations!==void 0&&![`soft`,`hard`].includes(t.conversations))throw Error(`Invalid delete user options. conversations must be one of [soft hard]`);if(t.messages!==void 0&&![`soft`,`hard`,`pruning`].includes(t.messages))throw Error(`Invalid delete user options. messages must be one of [soft hard pruning]`);return await this.post(this.baseURL+`/users/delete`,{user_ids:e,...t})}async _createImportURL(e){return await this.post(this.baseURL+`/import_urls`,{filename:e})}async _createImport(e,t={mode:`upsert`}){return await this.post(this.baseURL+`/imports`,{path:e,...t})}async _getImport(e){return await this.get(this.baseURL+`/imports/${encodeURIComponent(e)}`)}async _listImports(e){return await this.get(this.baseURL+`/imports`,e)}async upsertPushProvider(e){return await this.post(this.baseURL+`/push_providers`,{push_provider:e})}async deletePushProvider({type:e,name:t}){return await this.delete(this.baseURL+`/push_providers/${encodeURIComponent(e)}/${encodeURIComponent(t)}`)}async listPushProviders(){return await this.get(this.baseURL+`/push_providers`)}createAbortControllerForNextRequest(){return this.nextRequestAbortController=new AbortController}async commitMessage(e){return await this.post(this.baseURL+`/messages/${encodeURIComponent(e)}/commit`)}async createPoll(e,t){return await this.post(this.baseURL+`/polls`,{...e,...t?{user_id:t}:{}})}async getPoll(e,t){return await this.get(this.baseURL+`/polls/${encodeURIComponent(e)}`,t?{user_id:t}:{})}async updatePoll(e,t){return await this.put(this.baseURL+`/polls`,{...e,...t?{user_id:t}:{}})}async partialUpdatePoll(e,t,n){return await this.patch(this.baseURL+`/polls/${encodeURIComponent(e)}`,{...t,...n?{user_id:n}:{}})}async deletePoll(e,t){return await this.delete(this.baseURL+`/polls/${encodeURIComponent(e)}`,{...t?{user_id:t}:{}})}closePoll(e,t){return this.partialUpdatePoll(e,{set:{is_closed:!0}},t)}async createPollOption(e,t,n){return await this.post(this.baseURL+`/polls/${encodeURIComponent(e)}/options`,{...t,...n?{user_id:n}:{}})}async getPollOption(e,t,n){return await this.get(this.baseURL+`/polls/${encodeURIComponent(e)}/options/${encodeURIComponent(t)}`,n?{user_id:n}:{})}async updatePollOption(e,t,n){return await this.put(this.baseURL+`/polls/${encodeURIComponent(e)}/options`,{...t,...n?{user_id:n}:{}})}async deletePollOption(e,t,n){return await this.delete(this.baseURL+`/polls/${encodeURIComponent(e)}/options/${encodeURIComponent(t)}`,n?{user_id:n}:{})}async castPollVote(e,t,n,r){return await this.post(this.baseURL+`/messages/${encodeURIComponent(e)}/polls/${encodeURIComponent(t)}/vote`,{vote:n,...r?{user_id:r}:{}})}addPollAnswer(e,t,n,r){return this.castPollVote(e,t,{answer_text:n},r)}async removePollVote(e,t,n,r){return await this.delete(this.baseURL+`/messages/${encodeURIComponent(e)}/polls/${encodeURIComponent(t)}/vote/${encodeURIComponent(n)}`,{...r?{user_id:r}:{}})}async queryPolls(e={},t=[],n={},r){let i=r?`?user_id=${r}`:``;return await this.post(this.baseURL+`/polls/query${i}`,{filter:e,sort:jy(t),...n})}async queryPollVotes(e,t={},n=[],r={},i){let a=i?`?user_id=${i}`:``;return await this.post(this.baseURL+`/polls/${encodeURIComponent(e)}/votes${a}`,{filter:t,sort:jy(n),...r})}async queryPollAnswers(e,t={},n=[],r={},i){let a=i?`?user_id=${i}`:``;return await this.post(this.baseURL+`/polls/${encodeURIComponent(e)}/votes${a}`,{filter:{...t,is_answer:!0},sort:jy(n),...r})}async queryMessageHistory(e={},t=[],n={}){return await this.post(this.baseURL+`/messages/history`,{filter:e,sort:jy(t),...n})}async updateFlags(e,t,n={}){return await this.post(this.baseURL+`/automod/v1/moderation/update_flags`,{message_ids:e,reviewed_by:t,...n})}async queryDrafts(e={}){let t={...e,sort:e.sort?jy(e.sort):void 0};return await this.post(this.baseURL+`/drafts/query`,t)}async createReminder({messageId:e,...t}){return await this.post(`${this.baseURL}
426/messages/${e}/reminders`,t)}async updateReminder({messageId:e,...t}){return await this.patch(`${this.baseURL}/messages/${e}/reminders`,t)}async deleteReminder(e,t){return await this.delete(`${this.baseURL}/messages/${e}/reminders`,t?{user_id:t}:{})}async queryReminders({filter:e,sort:t,...n}={}){return await this.post(`${this.baseURL}/reminders/query`,{filter:e,sort:t&&jy(t),...n})}async queryTeamUsageStats(e={}){return await this.post(`${this.baseURL}/stats/team_usage`,e)}async updateLocation(e){return await this.put(this.baseURL+`/users/live_locations`,e)}uploadFile(e,t,n,r,i){return this.sendFile(`${this.baseURL}/uploads/file`,e,t,n,r,i)}uploadImage(e,t,n,r,i){return this.sendFile(`${this.baseURL}/uploads/image`,e,t,n,r,i)}deleteFile(e){return this.delete(`${this.baseURL}/uploads/file`,{url:e})}deleteImage(e){return this.delete(`${this.baseURL}/uploads/image`,{url:e})}async markChannelsDelivered(e){if(e?.latest_delivered_messages?.length)return await this.post(this.baseURL+`/channels/delivered`,e)}syncDeliveredCandidates(e){this.messageDeliveryReporter.syncDeliveredCandidates(e)}async updateChannelsBatch(e){return await this.put(this.baseURL+`/channels/batch`,e)}async createPredefinedFilter(e){return this.validateServerSideAuth(),await this.post(`${this.baseURL}/predefined_filters`,e)}async getPredefinedFilter(e){return this.validateServerSideAuth(),await this.get(`${this.baseURL}/predefined_filters/${encodeURIComponent(e)}`)}async updatePredefinedFilter(e,t){return this.validateServerSideAuth(),await this.put(`${this.baseURL}/predefined_filters/${encodeURIComponent(e)}`,t)}async deletePredefinedFilter(e){return this.validateServerSideAuth(),await this.delete(`${this.baseURL}/predefined_filters/${encodeURIComponent(e)}`)}async listPredefinedFilters(e={}){this.validateServerSideAuth();let{sort:t,...n}=e;return await this.get(`${this.baseURL}/predefined_filters`,{...n,...t?{sort:JSON.stringify(t)}:{}})}async setRetentionPolicy(e,t){return this.validateServerSideAuth(),await this.post(this.baseURL+`/retention_policy`,{policy:e,max_age_hours:t})}async deleteRetentionPolicy(e){return this.validateServerSideAuth(),await this.post(this.baseURL+`/retention_policy/delete`,{policy:e})}async getRetentionPolicy(){return this.validateServerSideAuth(),await this.get(this.baseURL+`/retention_policy`)}async getRetentionPolicyRuns(e={}){return this.validateServerSideAuth(),await this.post(this.baseURL+`/retention_policy/runs`,e)}},Dw=`Allow`,Ow=`Deny`,kw=[`*`],Aw=[`*`],jw=class{constructor(e,t,n=kw,r=Aw,i=!1,a=Dw){this.name=e,this.action=a,this.owner=i,this.priority=t,this.resources=n,this.roles=r}};new jw(`Allow all`,999,kw,Aw,!1,Dw),new jw(`Deny all`,1,kw,Aw,!1,Ow);var Mw=e=>new Date(e.end_at).getTime()<Date.now();function Nw(e){return!e||e.type===`deleted`||!e.shared_location?.end_at?!1:!Mw(e.shared_location)}var dre=3e3,Pw=class e extends lb{constructor({client:e,getDeviceId:t,watchLocation:n}){if(!e.userID)throw Error(`Live-location sharing is reserved for client-side use only`);super(),this.registerSubscriptions=()=>{this.incrementRefCount(),!this.hasSubscriptions&&(this.addUnsubscribeFunction(this.subscribeLiveLocationSharingUpdates()),this.addUnsubscribeFunction(this.subscribeTargetMessagesChange()))},this.unregisterSubscriptions=()=>super.unregisterSubscriptions(),this.client=e,this.state=new sb({messages:new Map,ready:!1}),this._deviceId=t(),this.getDeviceId=t,this.watchLocation=n}
426async init(){await this.assureStateInit(),this.registerSubscriptions()}get messages(){return this.state.getLatestValue().messages}get stateIsReady(){return this.state.getLatestValue().ready}get deviceId(){return this._deviceId||=this.getDeviceId(),this._deviceId}async assureStateInit(){if(this.stateIsReady)return;let{active_live_locations:e}=await this.client.getSharedLocations();this.state.next({messages:new Map(e.filter(e=>!Mw(e)).map(e=>[e.message_id,{...e,stopSharingTimeout:setTimeout(()=>{this.unregisterMessages([e.message_id])},new Date(e.end_at).getTime()-Date.now())}])),ready:!0})}subscribeTargetMessagesChange(){let e=null,t=this.state.subscribeWithSelector(({messages:e})=>({messages:e}),({messages:t})=>{t.size?t.size&&!e&&(e=this.subscribeWatchLocation()):(e?.(),e=null)});return()=>{t(),e?.()}}subscribeWatchLocation(){let t=Date.now();return this.watchLocation(({latitude:n,longitude:r})=>{Date.now()<t||(t=Date.now()+dre,kb(e.symbol,async()=>{let e=[];await this.assureStateInit();let t=[];for(let[i,a]of this.messages){if(Mw(a)){t.push(a.message_id);continue}if(a.latitude===n&&a.longitude===r)continue;let o=this.client.updateLocation({created_by_device_id:a.created_by_device_id,message_id:i,latitude:n,longitude:r});e.push(o)}this.unregisterMessages(t),e.length>0&&await Promise.allSettled(e)}))})}subscribeLiveLocationSharingUpdates(){let e=[...[`live_location_sharing.started`,`message.updated`,`message.deleted`].map(e=>this.client.on(e,e=>{e.message&&(e.type===`live_location_sharing.started`?this.registerMessage(e.message):e.type===`message.updated`?(this.messages.has(e.message.id)&&!Nw(e.message)&&this.unregisterMessages([e.message.id]),this.registerMessage(e.message)):this.unregisterMessages([e.message.id]))})),this.client.on(`live_location_sharing.stopped`,e=>{e.live_location&&this.unregisterMessages([e.live_location?.message_id])})];return()=>e.forEach(e=>e.unsubscribe())}registerMessage(e){!this.client.userID||e?.user?.id!==this.client.userID||!Nw(e)||this.state.next(t=>{let n=new Map(t.messages);return n.set(e.id,{...e.shared_location,stopSharingTimeout:setTimeout(()=>{this.unregisterMessages([e.id])},new Date(e.shared_location.end_at).getTime()-Date.now())}),{...t,messages:n}})}unregisterMessages(e){let t=this.messages,n=new Set(e),r=new Map(Array.from(t).filter(([e,t])=>(n.has(e)&&t.stopSharingTimeout&&(clearTimeout(t.stopSharingTimeout),t.stopSharingTimeout=null),!n.has(e))));r.size!==t.size&&this.state.partialNext({messages:r})}};Pw.symbol=Symbol(Pw.name);var Fw=!0,Iw=!0;function Lw(e,t,n){let r=e.match(t);return r&&r.length>=n&&parseFloat(r[n],10)}function Rw(e,t,n){if(!e.RTCPeerConnection)return;let r=e.RTCPeerConnection.prototype,i=r.addEventListener;r.addEventListener=function(e,r){if(e!==t)return i.apply(this,arguments);let a=e=>{let t=n(e);t&&(r.handleEvent?r.handleEvent(t):r(t))};return this._eventMap=this._eventMap||{},this._eventMap[t]||(this._eventMap[t]=new Map),this._eventMap[t].set(r,a),i.apply(this,[e,a])};let a=r.removeEventListener;r.removeEventListener=function(e,n){if(e!==t||!this._eventMap||!this._eventMap[t]||!this._eventMap[t].has(n))return a.apply(this,arguments);let r=this._eventMap[t].get(n);return this._eventMap[t].delete(n),this._eventMap[t].size===0&&delete this._eventMap[t],Object.keys(this._eventMap).length===0&&delete this._eventMap,a.apply(this,[e,r])},Object.defineProperty(r,`on`+t,{get(){return this[`_on`+t]},set(e){this[`_on`+t]&&(this.removeEventListener(t,this[`_on`+t]),delete this[`_on`+t]),e&&this.addEventListener(t,this[`_on`+t]=e)},enumerable:!0,configurable:!0})}function fre(e){return typeof e==`boolean`?(Fw=e,e?`adapter.js logging disabled`:`adapter.js logging enabled`):Error(`Argument type: `+typeof e+`. Please use a boolean.`)}function pre(e){return typeof e==`boolean`?(Iw=!e,`adapter.js deprecation warnings `+(e?`disabled`:`enabled`)):Error(`Argument type: `+typeof e+`. Please use a boolean.`)}function zw(){if(typeof window==`object`){if(Fw)return;typeof console<`u`&&typeof console.log==`function`&&console.log.apply(console,arguments)}}function Bw(e,t){Iw&&console.warn(e+` is deprecated, please use `+t+` instead.`)}function mre(e){let t={browser:null,version:null};if(e===void 0||!e.navigator||!e.navigator.userAgent)return t.browser=`Not a browser.`,t;let{navigator:n}=e;if(n.mozGetUserMedia)t.browser=`firefox`,t.version=parseInt(Lw(n.userAgent,/Firefox\/(\d+)\./,1));else if(n.webkitGetUserMedia||e.isSecureContext===!1&&e.webkitRTCPeerConnection)t.browser=`chrome`,t.version=parseInt(Lw(n.userAgent,/Chrom(e|ium)\/(\d+)\./,2));
vendor: 4,127 bytes, line 426
426else if(e.RTCPeerConnection&&n.userAgent.match(/AppleWebKit\/(\d+)\./))t.browser=`safari`,t.version=parseInt(Lw(n.userAgent,/AppleWebKit\/(\d+)\./,1)),t.supportsUnifiedPlan=e.RTCRtpTransceiver&&`currentDirection`in e.RTCRtpTransceiver.prototype,t._safariVersion=Lw(n.userAgent,/Version\/(\d+(\.?\d+))/,1);else return t.browser=`Not a supported browser.`,t;return t}function Vw(e){return Object.prototype.toString.call(e)===`[object Object]`}function Hw(e){return Vw(e)?Object.keys(e).reduce(function(t,n){let r=Vw(e[n]),i=r?Hw(e[n]):e[n],a=r&&!Object.keys(i).length;return i===void 0||a?t:Object.assign(t,{[n]:i})},{}):e}function Uw(e,t,n){!t||n.has(t.id)||(n.set(t.id,t),Object.keys(t).forEach(r=>{r.endsWith(`Id`)?Uw(e,e.get(t[r]),n):r.endsWith(`Ids`)&&t[r].forEach(t=>{Uw(e,e.get(t),n)})}))}function Ww(e,t,n){let r=n?`outbound-rtp`:`inbound-rtp`,i=new Map;if(t===null)return i;let a=[];return e.forEach(e=>{e.type===`track`&&e.trackIdentifier===t.id&&a.push(e)}),a.forEach(t=>{e.forEach(n=>{n.type===r&&n.trackId===t.id&&Uw(e,n,i)})}),i}var Gw=zw;function Kw(e,t){let n=e&&e.navigator;if(!n.mediaDevices)return;let r=function(e){if(typeof e!=`object`||e.mandatory||e.optional)return e;let t={};return Object.keys(e).forEach(n=>{if(n===`require`||n===`advanced`||n===`mediaSource`)return;let r=typeof e[n]==`object`?e[n]:{ideal:e[n]};r.exact!==void 0&&typeof r.exact==`number`&&(r.min=r.max=r.exact);let i=function(e,t){return e?e+t.charAt(0).toUpperCase()+t.slice(1):t===`deviceId`?`sourceId`:t};if(r.ideal!==void 0){t.optional=t.optional||[];let e={};typeof r.ideal==`number`?(e[i(`min`,n)]=r.ideal,t.optional.push(e),e={},e[i(`max`,n)]=r.ideal,t.optional.push(e)):(e[i(``,n)]=r.ideal,t.optional.push(e))}r.exact!==void 0&&typeof r.exact!=`number`?(t.mandatory=t.mandatory||{},t.mandatory[i(``,n)]=r.exact):[`min`,`max`].forEach(e=>{r[e]!==void 0&&(t.mandatory=t.mandatory||{},t.mandatory[i(e,n)]=r[e])})}),e.advanced&&(t.optional=(t.optional||[]).concat(e.advanced)),t},i=function(e,i){if(t.version>=61)return i(e);if(e=JSON.parse(JSON.stringify(e)),e&&typeof e.audio==`object`){let t=function(e,t,n){t in e&&!(n in e)&&(e[n]=e[t],delete e[t])};e=JSON.parse(JSON.stringify(e)),t(e.audio,`autoGainControl`,`googAutoGainControl`),t(e.audio,`noiseSuppression`,`googNoiseSuppression`),e.audio=r(e.audio)}if(e&&typeof e.video==`object`){let a=e.video.facingMode;a&&=typeof a==`object`?a:{ideal:a};let o=t.version<66;if(a&&(a.exact===`user`||a.exact===`environment`||a.ideal===`user`||a.ideal===`environment`)&&!(n.mediaDevices.getSupportedConstraints&&n.mediaDevices.getSupportedConstraints().facingMode&&!o)){delete e.video.facingMode;let t;if(a.exact===`environment`||a.ideal===`environment`?t=[`back`,`rear`]:(a.exact===`user`||a.ideal===`user`)&&(t=[`front`]),t)return n.mediaDevices.enumerateDevices().then(n=>{n=n.filter(e=>e.kind===`videoinput`);let o=n.find(e=>t.some(t=>e.label.toLowerCase().includes(t)));return!o&&n.length&&t.includes(`back`)&&(o=n[n.length-1]),o&&(e.video.deviceId=a.exact?{exact:o.deviceId}:{ideal:o.deviceId}),e.video=r(e.video),Gw(`chrome: `+JSON.stringify(e)),i(e)})}e.video=r(e.video)}return Gw(`chrome: `+JSON.stringify(e)),i(e)},a=function(e){return t.version>=64?e:{name:{PermissionDeniedError:`NotAllowedError`,PermissionDismissedError:`NotAllowedError`,InvalidStateError:`NotAllowedError`,DevicesNotFoundError:`NotFoundError`,ConstraintNotSatisfiedError:`OverconstrainedError`,TrackStartError:`NotReadableError`,MediaDeviceFailedDueToShutdown:`NotAllowedError`,MediaDeviceKillSwitchOn:`NotAllowedError`,TabCaptureError:`AbortError`,ScreenCaptureError:`AbortError`,DeviceCaptureError:`AbortError`}[e.name]||e.name,message:e.message,constraint:e.constraint||e.constraintName,toString(){return this.name+(this.message&&`: `)+this.message}}};if(n.getUserMedia=function(e,t,r){i(e,e=>{n.webkitGetUserMedia(e,t,e=>{r&&r(a(e))})})}.bind(n),n.mediaDevices.getUserMedia){let e=n.mediaDevices.getUserMedia.bind(n.mediaDevices);n.mediaDevices.getUserMedia=function(t){return i(t,t=>e(t).then(e=>{if(t.audio&&!e.getAudioTracks().length||t.video&&!e.getVideoTracks().length)throw e.getTracks().forEac
vendor: 8,855 bytes, line 426
426h(e=>{e.stop()}),new DOMException(``,`NotFoundError`);return e},e=>Promise.reject(a(e))))}}}function hre(e,t){if(!(e.navigator.mediaDevices&&`getDisplayMedia`in e.navigator.mediaDevices)&&e.navigator.mediaDevices){if(typeof t!=`function`){console.error(`shimGetDisplayMedia: getSourceId argument is not a function`);return}e.navigator.mediaDevices.getDisplayMedia=function(n){return t(n).then(t=>{let r=n.video&&n.video.width,i=n.video&&n.video.height;return n.video={mandatory:{chromeMediaSource:`desktop`,chromeMediaSourceId:t,maxFrameRate:n.video&&n.video.frameRate||3}},r&&(n.video.mandatory.maxWidth=r),i&&(n.video.mandatory.maxHeight=i),e.navigator.mediaDevices.getUserMedia(n)})}}}var qw=e({fixNegotiationNeeded:()=>nT,shimAddTrackRemoveTrack:()=>eT,shimAddTrackRemoveTrackWithNative:()=>$w,shimGetDisplayMedia:()=>hre,shimGetSendersWithDtmf:()=>Xw,shimGetStats:()=>Zw,shimGetUserMedia:()=>Kw,shimMediaStream:()=>Jw,shimOnTrack:()=>Yw,shimPeerConnection:()=>tT,shimSenderReceiverGetStats:()=>Qw});function Jw(e){e.MediaStream=e.MediaStream||e.webkitMediaStream}function Yw(e){if(typeof e==`object`&&e.RTCPeerConnection&&!(`ontrack`in e.RTCPeerConnection.prototype)){Object.defineProperty(e.RTCPeerConnection.prototype,`ontrack`,{get(){return this._ontrack},set(e){this._ontrack&&this.removeEventListener(`track`,this._ontrack),this.addEventListener(`track`,this._ontrack=e)},enumerable:!0,configurable:!0});let t=e.RTCPeerConnection.prototype.setRemoteDescription;e.RTCPeerConnection.prototype.setRemoteDescription=function(){return this._ontrackpoly||(this._ontrackpoly=t=>{t.stream.addEventListener(`addtrack`,n=>{let r;r=e.RTCPeerConnection.prototype.getReceivers?this.getReceivers().find(e=>e.track&&e.track.id===n.track.id):{track:n.track};let i=new Event(`track`);i.track=n.track,i.receiver=r,i.transceiver={receiver:r},i.streams=[t.stream],this.dispatchEvent(i)}),t.stream.getTracks().forEach(n=>{let r;r=e.RTCPeerConnection.prototype.getReceivers?this.getReceivers().find(e=>e.track&&e.track.id===n.id):{track:n};let i=new Event(`track`);i.track=n,i.receiver=r,i.transceiver={receiver:r},i.streams=[t.stream],this.dispatchEvent(i)})},this.addEventListener(`addstream`,this._ontrackpoly)),t.apply(this,arguments)}}else Rw(e,`track`,e=>(e.transceiver||Object.defineProperty(e,`transceiver`,{value:{receiver:e.receiver}}),e))}function Xw(e){if(typeof e==`object`&&e.RTCPeerConnection&&!(`getSenders`in e.RTCPeerConnection.prototype)&&`createDTMFSender`in e.RTCPeerConnection.prototype){let t=function(e,t){return{track:t,get dtmf(){return this._dtmf===void 0&&(t.kind===`audio`?this._dtmf=e.createDTMFSender(t):this._dtmf=null),this._dtmf},_pc:e}};if(!e.RTCPeerConnection.prototype.getSenders){e.RTCPeerConnection.prototype.getSenders=function(){return this._senders=this._senders||[],this._senders.slice()};let n=e.RTCPeerConnection.prototype.addTrack;e.RTCPeerConnection.prototype.addTrack=function(e,r){let i=n.apply(this,arguments);return i||(i=t(this,e),this._senders.push(i)),i};let r=e.RTCPeerConnection.prototype.removeTrack;e.RTCPeerConnection.prototype.removeTrack=function(e){r.apply(this,arguments);let t=this._senders.indexOf(e);t!==-1&&this._senders.splice(t,1)}}let n=e.RTCPeerConnection.prototype.addStream;e.RTCPeerConnection.prototype.addStream=function(e){this._senders=this._senders||[],n.apply(this,[e]),e.getTracks().forEach(e=>{this._senders.push(t(this,e))})};let r=e.RTCPeerConnection.prototype.removeStream;e.RTCPeerConnection.prototype.removeStream=function(e){this._senders=this._senders||[],r.apply(this,[e]),e.getTracks().forEach(e=>{let t=this._senders.find(t=>t.track===e);t&&this._senders.splice(this._senders.indexOf(t),1)})}}else if(typeof e==`object`&&e.RTCPeerConnection&&`getSenders`in e.RTCPeerConnection.prototype&&`createDTMFSender`in e.RTCPeerConnection.prototype&&e.RTCRtpSender&&!(`dtmf`in e.RTCRtpSender.prototype)){let t=e.RTCPeerConnection.prototype.getSenders;e.RTCPeerConnection.prototype.getSenders=function(){let e=t.apply(this,[]);return e.forEach(e=>e._pc=this),e},Object.defineProperty(e.RTCRtpSender.prototype,`dtmf`,{get(){return this._dtmf===void 0&&(this.track.kind===`audio`?this._dtmf=this._pc.createDTMFSender(this.track):this._dtmf=null),this._dtmf}})}}function Zw(e){if(!e.RTCPeerConnection)return;let t=e.RTCPeerConnection.prototype.getStats;e.RTCPeerConnection.prototype.getStats=function(){let[e,n,r]=arguments;if(arguments.length>0&&typeof e==`function`)return t.apply(this,arguments);if(t.length===0&&(arguments.length===0||typeof e!=`function`))return t.apply(this,[]);let i=function(e){let t={};return e.result().forEach(e=>{let n={id:e.id,timestamp:e.timestamp,type:{localcandidate:`local-candidate`,remotecandidate:`remote-candidate`}[e.type]||e.type};e.names().forEach(t=>{n[t]=e.stat(t)}),t[n.id]=n}),t},a=function(e){return new Map(Object.keys(e).map(t=>[t,e[t]]))};return arguments.length>=2?t.apply(this,[function(e){n(a(i(e)))},e]):new Promise((e,n)=>{t.apply(this,[function(t){e(a(i(t)))},n])}).then(n,r)}}function Qw(e){if(!(typeof e==`object`&&e.RTCPeerConnection&&e.RTCRtpSender&&e.RTCRtpReceiver))return;if(!(`getStats`in e.RTCRtpSender.prototype)){let t=e.RTCPeerConnection.prototype.getSenders;t&&(e.RTCPeerConnection.prototype.getSenders=function(){let e=t.apply(this,[]);return e.forEach(e=>e._pc=this),e});let n=e.RTCPeerConnection.prototype.addTrack;n&&(e.RTCPeerConnection.prototype.addTrack=function(){let e=n.apply(this,arguments);return e._pc=this,e}),e.RTCRtpSender.prototype.getStats=function(){let e=this;return this._pc.getStats().then(t=>Ww(t,e.track,!0))}}if(!(`getStats`in e.RTCRtpReceiver.prototype)){let t=e.RTCPeerConnection.prototype.getReceivers;t&&(e.RTCPeerConnection.prototype.getReceivers=function(){let e=t.apply(this,[]);return e.forEach(e=>e._pc=this),e}),Rw(e,`track`,e=>(e.receiver._pc=e.srcElement,e)),e.RTCRtpReceiver.prototype.getStats=function(){let e=this;return this._pc.getStats().then(t=>Ww(t,e.track,!1))}}if(!(`getStats`in e.RTCRtpSender.prototype&&`getStats`in e.RTCRtpReceiver.prototype))return;let t=e.RTCPeerConnection.prototype.getStats;e.RTCPeerConnection.prototype.getStats=function(){if(arguments.length>0&&arguments[0]instanceof e.MediaStreamTrack){let e=arguments[0],t,n,r;return this.getSenders().forEach(n=>{n.track===e&&(t?r=!0:t=n)}),this.getReceivers().forEach(t=>(t.track===e&&(n?r=!0:n=t),t.track===e)),r||t&&n?Promise.reject(new DOMException(`There are more than one sender or receiver for the track.`,`InvalidAccessError`)):t?t.getStats():n?n.getStats():Promise.reject(new DOMException(`There is no sender or receiver for the track.`,`InvalidAccessError`))}return t.apply(this,arguments)}}function $w(e){e.RTCPeerConnection.prototype.getLocalStreams=function(){return this._shimmedLocalStreams=this._shimmedLocalStreams||{},Object.keys(this._shimmedLocalStreams).map(e=>this._shimmedLocalStreams[e][0])};let t=e.RTCPeerConnection.prototype.addTrack;e.RTCPeerConnection.prototype.addTrack=function(e,n){if(!n)return t.apply(this,arguments);this._shimmedLocalStreams=this._shimmedLocalStreams||{};let r=t.apply(this,arguments);return this._shimmedLocalStreams[n.id]?this._shimmedLocalStreams[n.id].indexOf(r)===-1&&this._shimmedLocalStreams[n.id].push(r):this._shimmedLocalStreams[n.id]=[n,r],r};let n=e.RTCPeerConnection.prototype.addStream;e.RTCPeerConnection.prototype.addStream=function(e){this._shimmedLocalStreams=this._shimmedLocalStreams||{},e.getTracks().forEach(e=>{if(this.getSenders().find(t=>t.track===e))throw new DOMException(`Track already exists.`,`InvalidAccessError`)});let t=this.getSenders();n.apply(this,arguments);let r=this.getSenders().filter(e=>t.indexOf(e)===-1);this._shimmedLocalStreams[e.id]=[e].concat(r)};let r=e.RTCPeerConnection.prototype.removeStream;e.RTCPeerConnection.prototype.removeStream=function(e){return this._shimmedLocalStreams=this._shimmedLocalStreams||{},delete this._shimmedLocalStreams[e.id],r.apply(this,arguments)};let i=e.RTCPeerConnection.prototype.removeTrack;e.RTCPeerConnection.prototype.removeTrack=function(e){return this._shimmedLocalStreams=this._shimmedLocalStreams||{},e&&Object.keys(this._shimmedLocalStreams).forEach(t=>{let n=this._shimmedLocalStreams[t].indexOf(e);n!==-1&&this._shimmedLocalStreams[t].splice(n,1),this._shimmedLocalStreams[t].length===1&&delete this._shimmedLocalStreams[t]}),i.apply(this,arguments)}}function eT(e,t){if(!e.RTCPeerConnection)return;if(e.RTCPeerConnection.prototype.addTrack&&t.version>=65)return $w(e);let n=e.RTCPeerConnection.prototype.getLocalStreams;e.RTCPeerConnection.prototype.getLocalStreams=function(){let e=n.apply(this);return this._reverseStreams=this._reverseStreams||{},e.map(e=>this._reverseStreams[e.id])};let r=e.RTCPeerConnection.prototype.addStream;e.RTCPeerConnection.prototype.addStream=function(t){if(this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{}
vendor: 6,757 bytes, line 426
426,t.getTracks().forEach(e=>{if(this.getSenders().find(t=>t.track===e))throw new DOMException(`Track already exists.`,`InvalidAccessError`)}),!this._reverseStreams[t.id]){let n=new e.MediaStream(t.getTracks());this._streams[t.id]=n,this._reverseStreams[n.id]=t,t=n}r.apply(this,[t])};let i=e.RTCPeerConnection.prototype.removeStream;e.RTCPeerConnection.prototype.removeStream=function(e){this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{},i.apply(this,[this._streams[e.id]||e]),delete this._reverseStreams[this._streams[e.id]?this._streams[e.id].id:e.id],delete this._streams[e.id]},e.RTCPeerConnection.prototype.addTrack=function(t,n){if(this.signalingState===`closed`)throw new DOMException(`The RTCPeerConnection's signalingState is 'closed'.`,`InvalidStateError`);let r=[].slice.call(arguments,1);if(r.length!==1||!r[0].getTracks().find(e=>e===t))throw new DOMException(`The adapter.js addTrack polyfill only supports a single  stream which is associated with the specified track.`,`NotSupportedError`);if(this.getSenders().find(e=>e.track===t))throw new DOMException(`Track already exists.`,`InvalidAccessError`);this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{};let i=this._streams[n.id];if(i)i.addTrack(t),Promise.resolve().then(()=>{this.dispatchEvent(new Event(`negotiationneeded`))});else{let r=new e.MediaStream([t]);this._streams[n.id]=r,this._reverseStreams[r.id]=n,this.addStream(r)}return this.getSenders().find(e=>e.track===t)};function a(e,t){let n=t.sdp;return Object.keys(e._reverseStreams||[]).forEach(t=>{let r=e._reverseStreams[t],i=e._streams[r.id];n=n.replace(new RegExp(i.id,`g`),r.id)}),new RTCSessionDescription({type:t.type,sdp:n})}function o(e,t){let n=t.sdp;return Object.keys(e._reverseStreams||[]).forEach(t=>{let r=e._reverseStreams[t],i=e._streams[r.id];n=n.replace(new RegExp(r.id,`g`),i.id)}),new RTCSessionDescription({type:t.type,sdp:n})}[`createOffer`,`createAnswer`].forEach(function(t){let n=e.RTCPeerConnection.prototype[t],r={[t](){let e=arguments;return arguments.length&&typeof arguments[0]==`function`?n.apply(this,[t=>{let n=a(this,t);e[0].apply(null,[n])},t=>{e[1]&&e[1].apply(null,t)},arguments[2]]):n.apply(this,arguments).then(e=>a(this,e))}};e.RTCPeerConnection.prototype[t]=r[t]});let s=e.RTCPeerConnection.prototype.setLocalDescription;e.RTCPeerConnection.prototype.setLocalDescription=function(){return!arguments.length||!arguments[0].type||(arguments[0]=o(this,arguments[0])),s.apply(this,arguments)};let c=Object.getOwnPropertyDescriptor(e.RTCPeerConnection.prototype,`localDescription`);Object.defineProperty(e.RTCPeerConnection.prototype,`localDescription`,{get(){let e=c.get.apply(this);return e.type===``?e:a(this,e)}}),e.RTCPeerConnection.prototype.removeTrack=function(e){if(this.signalingState===`closed`)throw new DOMException(`The RTCPeerConnection's signalingState is 'closed'.`,`InvalidStateError`);if(!e._pc)throw new DOMException(`Argument 1 of RTCPeerConnection.removeTrack does not implement interface RTCRtpSender.`,`TypeError`);if(e._pc!==this)throw new DOMException(`Sender was not created by this connection.`,`InvalidAccessError`);this._streams=this._streams||{};let t;Object.keys(this._streams).forEach(n=>{this._streams[n].getTracks().find(t=>e.track===t)&&(t=this._streams[n])}),t&&(t.getTracks().length===1?this.removeStream(this._reverseStreams[t.id]):t.removeTrack(e.track),this.dispatchEvent(new Event(`negotiationneeded`)))}}function tT(e,t){!e.RTCPeerConnection&&e.webkitRTCPeerConnection&&(e.RTCPeerConnection=e.webkitRTCPeerConnection),e.RTCPeerConnection&&t.version<53&&[`setLocalDescription`,`setRemoteDescription`,`addIceCandidate`].forEach(function(t){let n=e.RTCPeerConnection.prototype[t],r={[t](){return arguments[0]=new(t===`addIceCandidate`?e.RTCIceCandidate:e.RTCSessionDescription)(arguments[0]),n.apply(this,arguments)}};e.RTCPeerConnection.prototype[t]=r[t]})}function nT(e,t){Rw(e,`negotiationneeded`,e=>{let n=e.target;if(!((t.version<72||n.getConfiguration&&n.getConfiguration().sdpSemantics===`plan-b`)&&n.signalingState!==`stable`))return e})}function rT(e,t){let n=e&&e.navigator,r=e&&e.MediaStreamTrack;if(n.getUserMedia=function(e,t,r){Bw(`navigator.getUserMedia`,`navigator.mediaDevices.getUserMedia`),n.mediaDevices.getUserMedia(e).then(t,r)},!(t.version>55&&`autoGainControl`in n.mediaDevices.getSupportedConstraints())){let e=function(e,t,n){t in e&&!(n in e)&&(e[n]=e[t],delete e[t])},t=n.mediaDevices.getUserMedia.bind(n.mediaDevices);if(n.mediaDevices.getUserMedia=function(n){return typeof n==`object`&&typeof n.audio==`object`&&(n=JSON.parse(JSON.stringify(n)),e(n.audio,`autoGainControl`,`mozAutoGainControl`),e(n.audio,`noiseSuppression`,`mozNoiseSuppression`)),t(n)},r&&r.prototype.getSettings){let t=r.prototype.getSettings;r.prototype.getSettings=function(){let n=t.apply(this,arguments);return e(n,`mozAutoGainControl`,`autoGainControl`),e(n,`mozNoiseSuppression`,`noiseSuppression`),n}}if(r&&r.prototype.applyConstraints){let t=r.prototype.applyConstraints;r.prototype.applyConstraints=function(n){return this.kind===`audio`&&typeof n==`object`&&(n=JSON.parse(JSON.stringify(n)),e(n,`autoGainControl`,`mozAutoGainControl`),e(n,`noiseSuppression`,`mozNoiseSuppression`)),t.apply(this,[n])}}}}function gre(e,t){e.navigator.mediaDevices&&`getDisplayMedia`in e.navigator.mediaDevices||e.navigator.mediaDevices&&(e.navigator.mediaDevices.getDisplayMedia=function(n){if(!(n&&n.video)){let e=new DOMException(`getDisplayMedia without video constraints is undefined`);return e.name=`NotFoundError`,e.code=8,Promise.reject(e)}return n.video===!0?n.video={mediaSource:t}:n.video.mediaSource=t,e.navigator.mediaDevices.getUserMedia(n)})}var iT=e({shimAddTransceiver:()=>dT,shimCreateAnswer:()=>mT,shimCreateOffer:()=>pT,shimGetDisplayMedia:()=>gre,shimGetParameters:()=>fT,shimGetUserMedia:()=>rT,shimOnTrack:()=>aT,shimPeerConnection:()=>oT,shimRTCDataChannel:()=>uT,shimReceiverGetStats:()=>cT,shimRemoveStream:()=>lT,shimSenderGetStats:()=>sT});function aT(e){typeof e==`object`&&e.RTCTrackEvent&&`receiver`in e.RTCTrackEvent.prototype&&!(`transceiver`in e.RTCTrackEvent.prototype)&&Object.defineProperty(e.RTCTrackEvent.prototype,`transceiver`,{get(){return{receiver:this.receiver}}})}function oT(e,t){if(typeof e!=`object`||!(e.RTCPeerConnection||e.mozRTCPeerConnection))return;!e.RTCPeerConnection&&e.mozRTCPeerConnection&&(e.RTCPeerConnection=e.mozRTCPeerConnection),t.version<53&&[`setLocalDescription`,`setRemoteDescription`,`addIceCandidate`].forEach(function(t){let n=e.RTCPeerConnection.prototype[t],r={[t](){return arguments[0]=new(t===`addIceCandidate`?e.RTCIceCandidate:e.RTCSessionDescription)(arguments[0]),n.apply(this,arguments)}};e.RTCPeerConnection.prototype[t]=r[t]});
vendor: 4,208 bytes, line 426
426let n={inboundrtp:`inbound-rtp`,outboundrtp:`outbound-rtp`,candidatepair:`candidate-pair`,localcandidate:`local-candidate`,remotecandidate:`remote-candidate`},r=e.RTCPeerConnection.prototype.getStats;e.RTCPeerConnection.prototype.getStats=function(){let[e,i,a]=arguments;return r.apply(this,[e||null]).then(e=>{if(t.version<53&&!i)try{e.forEach(e=>{e.type=n[e.type]||e.type})}catch(t){if(t.name!==`TypeError`)throw t;e.forEach((t,r)=>{e.set(r,Object.assign({},t,{type:n[t.type]||t.type}))})}return e}).then(i,a)}}function sT(e){if(!(typeof e==`object`&&e.RTCPeerConnection&&e.RTCRtpSender)||e.RTCRtpSender&&`getStats`in e.RTCRtpSender.prototype)return;let t=e.RTCPeerConnection.prototype.getSenders;t&&(e.RTCPeerConnection.prototype.getSenders=function(){let e=t.apply(this,[]);return e.forEach(e=>e._pc=this),e});let n=e.RTCPeerConnection.prototype.addTrack;n&&(e.RTCPeerConnection.prototype.addTrack=function(){let e=n.apply(this,arguments);return e._pc=this,e}),e.RTCRtpSender.prototype.getStats=function(){return this.track?this._pc.getStats(this.track):Promise.resolve(new Map)}}function cT(e){if(!(typeof e==`object`&&e.RTCPeerConnection&&e.RTCRtpSender)||e.RTCRtpSender&&`getStats`in e.RTCRtpReceiver.prototype)return;let t=e.RTCPeerConnection.prototype.getReceivers;t&&(e.RTCPeerConnection.prototype.getReceivers=function(){let e=t.apply(this,[]);return e.forEach(e=>e._pc=this),e}),Rw(e,`track`,e=>(e.receiver._pc=e.srcElement,e)),e.RTCRtpReceiver.prototype.getStats=function(){return this._pc.getStats(this.track)}}function lT(e){!e.RTCPeerConnection||`removeStream`in e.RTCPeerConnection.prototype||(e.RTCPeerConnection.prototype.removeStream=function(e){Bw(`removeStream`,`removeTrack`),this.getSenders().forEach(t=>{t.track&&e.getTracks().includes(t.track)&&this.removeTrack(t)})})}function uT(e){e.DataChannel&&!e.RTCDataChannel&&(e.RTCDataChannel=e.DataChannel)}function dT(e){if(!(typeof e==`object`&&e.RTCPeerConnection))return;let t=e.RTCPeerConnection.prototype.addTransceiver;t&&(e.RTCPeerConnection.prototype.addTransceiver=function(){this.setParametersPromises=[];let e=arguments[1]&&arguments[1].sendEncodings;e===void 0&&(e=[]),e=[...e];let n=e.length>0;n&&e.forEach(e=>{if(`rid`in e&&!/^[a-z0-9]{0,16}$/i.test(e.rid))throw TypeError(`Invalid RID value provided.`);if(`scaleResolutionDownBy`in e&&!(parseFloat(e.scaleResolutionDownBy)>=1))throw RangeError(`scale_resolution_down_by must be >= 1.0`);if(`maxFramerate`in e&&!(parseFloat(e.maxFramerate)>=0))throw RangeError(`max_framerate must be >= 0.0`)});let r=t.apply(this,arguments);if(n){let{sender:t}=r,n=t.getParameters();(!(`encodings`in n)||n.encodings.length===1&&Object.keys(n.encodings[0]).length===0)&&(n.encodings=e,t.sendEncodings=e,this.setParametersPromises.push(t.setParameters(n).then(()=>{delete t.sendEncodings}).catch(()=>{delete t.sendEncodings})))}return r})}function fT(e){if(!(typeof e==`object`&&e.RTCRtpSender))return;let t=e.RTCRtpSender.prototype.getParameters;t&&(e.RTCRtpSender.prototype.getParameters=function(){let e=t.apply(this,arguments);return`encodings`in e||(e.encodings=[].concat(this.sendEncodings||[{}])),e})}function pT(e){if(!(typeof e==`object`&&e.RTCPeerConnection))return;let t=e.RTCPeerConnection.prototype.createOffer;e.RTCPeerConnection.prototype.createOffer=function(){return this.setParametersPromises&&this.setParametersPromises.length?Promise.all(this.setParametersPromises).then(()=>t.apply(this,arguments)).finally(()=>{this.setParametersPromises=[]}):t.apply(this,arguments)}}function mT(e){if(!(typeof e==`object`&&e.RTCPeerConnection))return;let t=e.RTCPeerConnection.prototype.createAnswer;e.RTCPeerConnection.prototype.createAnswer=function(){return this.setParametersPromises&&this.setParametersPromises.length?Promise.all(this.setParametersPromises).then(()=>t.apply(this,arguments)).finally(()=>{this.setParametersPromises=[]}):t.apply(this,arguments)}}var hT=e({shimAudioContext:()=>wT,shimCallbacksAPI:()=>vT,shimConstraints:()=>bT,shimCreateOfferLegacy:()=>CT,shimGetUserMedia:()=>yT,shimLocalStreamsAPI:()=>gT,shimRTCIceServerUrls:()=>xT,shimRemoteStreamsAPI:()=>_T,shimTrackEventTransceiver:()=>ST});function gT(e){if(!(typeof e!=`object`||!e.RTCPeerConnection)){if
vendor: 4,714 bytes, line 426
426(`getLocalStreams`in e.RTCPeerConnection.prototype||(e.RTCPeerConnection.prototype.getLocalStreams=function(){return this._localStreams||=[],this._localStreams}),!(`addStream`in e.RTCPeerConnection.prototype)){let t=e.RTCPeerConnection.prototype.addTrack;e.RTCPeerConnection.prototype.addStream=function(e){this._localStreams||=[],this._localStreams.includes(e)||this._localStreams.push(e),e.getAudioTracks().forEach(n=>t.call(this,n,e)),e.getVideoTracks().forEach(n=>t.call(this,n,e))},e.RTCPeerConnection.prototype.addTrack=function(e,...n){return n&&n.forEach(e=>{this._localStreams?this._localStreams.includes(e)||this._localStreams.push(e):this._localStreams=[e]}),t.apply(this,arguments)}}`removeStream`in e.RTCPeerConnection.prototype||(e.RTCPeerConnection.prototype.removeStream=function(e){this._localStreams||=[];let t=this._localStreams.indexOf(e);if(t===-1)return;this._localStreams.splice(t,1);let n=e.getTracks();this.getSenders().forEach(e=>{n.includes(e.track)&&this.removeTrack(e)})})}}function _T(e){if(!(typeof e!=`object`||!e.RTCPeerConnection)&&(`getRemoteStreams`in e.RTCPeerConnection.prototype||(e.RTCPeerConnection.prototype.getRemoteStreams=function(){return this._remoteStreams?this._remoteStreams:[]}),!(`onaddstream`in e.RTCPeerConnection.prototype))){Object.defineProperty(e.RTCPeerConnection.prototype,`onaddstream`,{get(){return this._onaddstream},set(e){this._onaddstream&&(this.removeEventListener(`addstream`,this._onaddstream),this.removeEventListener(`track`,this._onaddstreampoly)),this.addEventListener(`addstream`,this._onaddstream=e),this.addEventListener(`track`,this._onaddstreampoly=e=>{e.streams.forEach(e=>{if(this._remoteStreams||=[],this._remoteStreams.includes(e))return;this._remoteStreams.push(e);let t=new Event(`addstream`);t.stream=e,this.dispatchEvent(t)})})}});let t=e.RTCPeerConnection.prototype.setRemoteDescription;e.RTCPeerConnection.prototype.setRemoteDescription=function(){let e=this;return this._onaddstreampoly||this.addEventListener(`track`,this._onaddstreampoly=function(t){t.streams.forEach(t=>{if(e._remoteStreams||=[],e._remoteStreams.indexOf(t)>=0)return;e._remoteStreams.push(t);let n=new Event(`addstream`);n.stream=t,e.dispatchEvent(n)})}),t.apply(e,arguments)}}}function vT(e){if(typeof e!=`object`||!e.RTCPeerConnection)return;let t=e.RTCPeerConnection.prototype,n=t.createOffer,r=t.createAnswer,i=t.setLocalDescription,a=t.setRemoteDescription,o=t.addIceCandidate;t.createOffer=function(e,t){let r=arguments.length>=2?arguments[2]:arguments[0],i=n.apply(this,[r]);return t?(i.then(e,t),Promise.resolve()):i},t.createAnswer=function(e,t){let n=arguments.length>=2?arguments[2]:arguments[0],i=r.apply(this,[n]);return t?(i.then(e,t),Promise.resolve()):i};let s=function(e,t,n){let r=i.apply(this,[e]);return n?(r.then(t,n),Promise.resolve()):r};t.setLocalDescription=s,s=function(e,t,n){let r=a.apply(this,[e]);return n?(r.then(t,n),Promise.resolve()):r},t.setRemoteDescription=s,s=function(e,t,n){let r=o.apply(this,[e]);return n?(r.then(t,n),Promise.resolve()):r},t.addIceCandidate=s}function yT(e){let t=e&&e.navigator;if(t.mediaDevices&&t.mediaDevices.getUserMedia){let e=t.mediaDevices,n=e.getUserMedia.bind(e);t.mediaDevices.getUserMedia=e=>n(bT(e))}!t.getUserMedia&&t.mediaDevices&&t.mediaDevices.getUserMedia&&(t.getUserMedia=function(e,n,r){t.mediaDevices.getUserMedia(e).then(n,r)}.bind(t))}function bT(e){return e&&e.video!==void 0?Object.assign({},e,{video:Hw(e.video)}):e}function xT(e){if(!e.RTCPeerConnection)return;let t=e.RTCPeerConnection;e.RTCPeerConnection=function(e,n){if(e&&e.iceServers){let t=[];for(let n=0;n<e.iceServers.length;n++){let r=e.iceServers[n];r.urls===void 0&&r.url?(Bw(`RTCIceServer.url`,`RTCIceServer.urls`),r=JSON.parse(JSON.stringify(r)),r.urls=r.url,delete r.url,t.push(r)):t.push(e.iceServers[n])}e.iceServers=t}return new t(e,n)},e.RTCPeerConnection.prototype=t.prototype,`generateCertificate`in t&&Object.defineProperty(e.RTCPeerConnection,`generateCertificate`,{get(){return t.generateCertificate}})}function ST(e){typeof e==`object`&&e.RTCTrackEvent&&`receiver`in e.RTCTrackEvent.prototype&&!(`transceiver`in e.RTCTrackEvent.prototype)&&Object.defineProperty(e.RTCTrackEvent.prototype,`transceiver`,{get(){return{receiver:this.receiver}}})}function CT(e){let t=e.RTCPeerConnection.prototype.createOffer;e.RTCPeerConnection.prototype.createOffer=function(e){if(e){e.offerToReceiveAudio!==void 0&&(e.offerToReceiveAudio=!!e.offerToReceiveAudio);let t=this.getTransceivers().find(e=>e.receiver.track.kind===`audio`);e.offerToReceiveAudio===!1&&t?t.direction===`sendrecv`?t.setDirection?t.setDirection(`sendonly`):t.direction=`sendonly`:t.direction===`recvonly`&&(t.setDirection?t.setDirection(`
426inactive`):t.direction=`inactive`):e.offerToReceiveAudio===!0&&!t&&this.addTransceiver(`audio`,{direction:`recvonly`}),e.offerToReceiveVideo!==void 0&&(e.offerToReceiveVideo=!!e.offerToReceiveVideo);let n=this.getTransceivers().find(e=>e.receiver.track.kind===`video`);e.offerToReceiveVideo===!1&&n?n.direction===`sendrecv`?n.setDirection?n.setDirection(`sendonly`):n.direction=`sendonly`:n.direction===`recvonly`&&(n.setDirection?n.setDirection(`inactive`):n.direction=`inactive`):e.offerToReceiveVideo===!0&&!n&&this.addTransceiver(`video`,{direction:`recvonly`})}return t.apply(this,arguments)}}function wT(e){typeof e!=`object`||e.AudioContext||(e.AudioContext=e.webkitAudioContext)}var _re=n(((e,t)=>{var n={};n.generateIdentifier=function(){return Math.random().toString(36).substring(2,12)},n.localCName=n.generateIdentifier(),n.splitLines=function(e){return e.trim().split(`
427`).map(e=>e.trim())},n.splitSections=function(e){return e.split(`
428m=`).map((e,t)=>(t>0?`m=`+e:e).trim()+`\r
429`)},n.getDescription=function(e){let t=n.splitSections(e);return t&&t[0]},n.getMediaSections=function(e){let t=n.splitSections(e);return t.shift(),t},n.matchPrefix=function(e,t){return n.splitLines(e).filter(e=>e.indexOf(t)===0)},n.parseCandidate=function(e){let t;t=e.indexOf(`a=candidate:`)===0?e.substring(12).split(` `):e.substring(10).split(` `);let n={foundation:t[0],component:{1:`rtp`,2:`rtcp`}[t[1]]||t[1],protocol:t[2].toLowerCase(),priority:parseInt(t[3],10),ip:t[4],address:t[4],port:parseInt(t[5],10),type:t[7]};for(let e=8;e<t.length;e+=2)switch(t[e]){case`raddr`:n.relatedAddress=t[e+1];break;case`rport`:n.relatedPort=parseInt(t[e+1],10);break;case`tcptype`:n.tcpType=t[e+1];break;case`ufrag`:n.ufrag=t[e+1],n.usernameFragment=t[e+1];break;default:n[t[e]]===void 0&&(n[t[e]]=t[e+1]);break}return n},n.writeCandidate=function(e){let t=[];t.push(e.foundation);let n=e.component;n===`rtp`?t.push(1):n===`rtcp`?t.push(2):t.push(n),t.push(e.protocol.toUpperCase()),t.push(e.priority),t.push(e.address||e.ip),t.push(e.port);let r=e.type;return t.push(`typ`),t.push(r),r!==`host`&&e.relatedAddress&&e.relatedPort!==void 0&&(t.push(`raddr`),t.push(e.relatedAddress),t.push(`rport`),t.push(e.relatedPort)),e.tcpType&&e.protocol.toLowerCase()===`tcp`&&(t.push(`tcptype`),t.push(e.tcpType)),(e.usernameFragment||e.ufrag)&&(t.push(`ufrag`),t.push(e.usernameFragment||e.ufrag)),`candidate:`+t.join(` `)},n.parseIceOptions=function(e){return e.substring(14).split(` `)},n.parseRtpMap=function(e){let t=e.substring(9).split(` `),n={payloadType:parseInt(t.shift(),10)};return t=t[0].split(`/`),n.name=t[0],n.clockRate=parseInt(t[1],10),n.channels=t.length===3?parseInt(t[2],10):1,n.numChannels=n.channels,n},n.writeRtpMap=function(e){let t=e.payloadType;e.preferredPayloadType!==void 0&&(t=e.preferredPayloadType);let n=e.channels||e.numChannels||1;return`a=rtpmap:`+t+` `+e.name+`/`+e.clockRate+(n===1?``:`/`+n)+`\r
430`},n.parseExtmap=function(e){let t=e.substring(9).split(` `);return{id:parseInt(t[0],10),direction:t[0].indexOf(`/`)>0?t[0].split(`/`)[1]:`sendrecv`,uri:t[1],attributes:t.slice(2).join(` `)}},n.writeExtmap=function(e){return`a=extmap:`+(e.id||e.preferredId)+(e.direction&&e.direction!==`sendrecv`?`/`+e.direction:``)+` `+e.uri+(e.attributes?` `+e.attributes:``)+`\r
431`},n.parseFmtp=function(e){let t={},n,r=e.substring(e.indexOf(` `)+1).split(`;`);for(let e=0;e<r.length;e++)n=r[e].trim().split(`=`),t[n[0].trim()]=n[1];return t},n.writeFmtp=function(e){let t=``,n=e.payloadType;if(e.preferredPayloadType!==void 0&&(n=e.preferredPayloadType),e.parameters&&Object.keys(e.parameters).length){let r=[];Object.keys(e.parameters).forEach(t=>{e.parameters[t]===void 0?r.push(t):r.push(t+`=`+e.parameters[t])}),t+=`a=fmtp:`+n+` `+r.join(`;`)+`\r
432`}return t},n.parseRtcpFb=function(e){let t=e.substring(e.indexOf(` `)+1).split(` `);return{type:t.shift(),parameter:t.join(` `)}},n.writeRtcpFb=function(e){let t=``,n=e.payloadType;return e.preferredPayloadType!==void 0&&(n=e.preferredPayloadType),e.rtcpFeedback&&e.rtcpFeedback.length&&e.rtcpFeedback.forEach(e=>{t+=`a=rtcp-fb:`+n+` `+e.type+(e.parameter&&e.parameter.length?` `+e.parameter:``)+`\r
433`}),t},n.parseSsrcMedia=function(e){let t=e.indexOf(` `),n={ssrc:parseInt(e.substring(7,t),10)},r=e.indexOf(`:`,t);return r>-1?(n.attribute=e.substring(t+1,r),n.value=e.substring(r+1)):n.attribute=e.substring(t+1),n},n.parseSsrcGroup=function(e){let t=e.substring(13).split(` `);return{semantics:t.shift(),ssrcs:t.map(e=>parseInt(e,10))}},n.getMid=function(e){let t=n.matchPrefix(e,`a=mid:`)[0];if(t)return t.substring(6)},n.parseFingerprint=function(e){let t=e.substring(14).split(` `);return{algorithm:t[0].toLowerCase(),value:t[1].toUpperCase()}},n.getDtlsParameters=function(e,t){return{role:`auto`,fingerprints:n.matchPrefix(e+t,`a=fingerprint:`).map(n.parseFingerprint)}},n.writeDtlsParameters=function(e,t){let n=`a=setup:`+t+`\r
434`;
vendor: 4,605 bytes, lines 434-446
434return e.fingerprints.forEach(e=>{n+=`a=fingerprint:`+e.algorithm+` `+e.value+`\r
435`}),n},n.parseCryptoLine=function(e){let t=e.substring(9).split(` `);return{tag:parseInt(t[0],10),cryptoSuite:t[1],keyParams:t[2],sessionParams:t.slice(3)}},n.writeCryptoLine=function(e){return`a=crypto:`+e.tag+` `+e.cryptoSuite+` `+(typeof e.keyParams==`object`?n.writeCryptoKeyParams(e.keyParams):e.keyParams)+(e.sessionParams?` `+e.sessionParams.join(` `):``)+`\r
436`},n.parseCryptoKeyParams=function(e){if(e.indexOf(`inline:`)!==0)return null;let t=e.substring(7).split(`|`);return{keyMethod:`inline`,keySalt:t[0],lifeTime:t[1],mkiValue:t[2]?t[2].split(`:`)[0]:void 0,mkiLength:t[2]?t[2].split(`:`)[1]:void 0}},n.writeCryptoKeyParams=function(e){return e.keyMethod+`:`+e.keySalt+(e.lifeTime?`|`+e.lifeTime:``)+(e.mkiValue&&e.mkiLength?`|`+e.mkiValue+`:`+e.mkiLength:``)},n.getCryptoParameters=function(e,t){return n.matchPrefix(e+t,`a=crypto:`).map(n.parseCryptoLine)},n.getIceParameters=function(e,t){let r=n.matchPrefix(e+t,`a=ice-ufrag:`)[0],i=n.matchPrefix(e+t,`a=ice-pwd:`)[0];return r&&i?{usernameFragment:r.substring(12),password:i.substring(10)}:null},n.writeIceParameters=function(e){let t=`a=ice-ufrag:`+e.usernameFragment+`\r
437a=ice-pwd:`+e.password+`\r
438`;return e.iceLite&&(t+=`a=ice-lite\r
439`),t},n.parseRtpParameters=function(e){let t={codecs:[],headerExtensions:[],fecMechanisms:[],rtcp:[]},r=n.splitLines(e)[0].split(` `);t.profile=r[2];for(let i=3;i<r.length;i++){let a=r[i],o=n.matchPrefix(e,`a=rtpmap:`+a+` `)[0];if(o){let r=n.parseRtpMap(o),i=n.matchPrefix(e,`a=fmtp:`+a+` `);switch(r.parameters=i.length?n.parseFmtp(i[0]):{},r.rtcpFeedback=n.matchPrefix(e,`a=rtcp-fb:`+a+` `).map(n.parseRtcpFb),t.codecs.push(r),r.name.toUpperCase()){case`RED`:case`ULPFEC`:t.fecMechanisms.push(r.name.toUpperCase());break;default:break}}}n.matchPrefix(e,`a=extmap:`).forEach(e=>{t.headerExtensions.push(n.parseExtmap(e))});let i=n.matchPrefix(e,`a=rtcp-fb:* `).map(n.parseRtcpFb);return t.codecs.forEach(e=>{i.forEach(t=>{e.rtcpFeedback.find(e=>e.type===t.type&&e.parameter===t.parameter)||e.rtcpFeedback.push(t)})}),t},n.writeRtpDescription=function(e,t){let r=``;r+=`m=`+e+` `,r+=t.codecs.length>0?`9`:`0`,r+=` `+(t.profile||`UDP/TLS/RTP/SAVPF`)+` `,r+=t.codecs.map(e=>e.preferredPayloadType===void 0?e.payloadType:e.preferredPayloadType).join(` `)+`\r
440`,r+=`c=IN IP4 0.0.0.0\r
441`,r+=`a=rtcp:9 IN IP4 0.0.0.0\r
442`,t.codecs.forEach(e=>{r+=n.writeRtpMap(e),r+=n.writeFmtp(e),r+=n.writeRtcpFb(e)});let i=0;return t.codecs.forEach(e=>{e.maxptime>i&&(i=e.maxptime)}),i>0&&(r+=`a=maxptime:`+i+`\r
443`),t.headerExtensions&&t.headerExtensions.forEach(e=>{r+=n.writeExtmap(e)}),r},n.parseRtpEncodingParameters=function(e){let t=[],r=n.parseRtpParameters(e),i=r.fecMechanisms.indexOf(`RED`)!==-1,a=r.fecMechanisms.indexOf(`ULPFEC`)!==-1,o=n.matchPrefix(e,`a=ssrc:`).map(e=>n.parseSsrcMedia(e)).filter(e=>e.attribute===`cname`),s=o.length>0&&o[0].ssrc,c,l=n.matchPrefix(e,`a=ssrc-group:FID`).map(e=>e.substring(17).split(` `).map(e=>parseInt(e,10)));l.length>0&&l[0].length>1&&l[0][0]===s&&(c=l[0][1]),r.codecs.forEach(e=>{if(e.name.toUpperCase()===`RTX`&&e.parameters.apt){let n={ssrc:s,codecPayloadType:parseInt(e.parameters.apt,10)};s&&c&&(n.rtx={ssrc:c}),t.push(n),i&&(n=JSON.parse(JSON.stringify(n)),n.fec={ssrc:s,mechanism:a?`red+ulpfec`:`red`},t.push(n))}}),t.length===0&&s&&t.push({ssrc:s});let u=n.matchPrefix(e,`b=`);return u.length&&(u=u[0].indexOf(`b=TIAS:`)===0?parseInt(u[0].substring(7),10):u[0].indexOf(`b=AS:`)===0?parseInt(u[0].substring(5),10)*1e3*.95-2e3*8:void 0,t.forEach(e=>{e.maxBitrate=u})),t},n.parseRtcpParameters=function(e){let t={},r=n.matchPrefix(e,`a=ssrc:`).map(e=>n.parseSsrcMedia(e)).filter(e=>e.attribute===`cname`)[0];r&&(t.cname=r.value,t.ssrc=r.ssrc);let i=n.matchPrefix(e,`a=rtcp-rsize`);return t.reducedSize=i.length>0,t.compound=i.length===0,t.mux=n.matchPrefix(e,`a=rtcp-mux`).length>0,t},n.writeRtcpParameters=function(e){let t=``;return e.reducedSize&&(t+=`a=rtcp-rsize\r
444`),e.mux&&(t+=`a=rtcp-mux\r
445`),e.ssrc!==void 0&&e.cname&&(t+=`a=ssrc:`+e.ssrc+` cname:`+e.cname+`\r
446`),t},n.parseMsid=function(e){let t,r=n.matchPrefix(e,`a=msid:`);if(r.length===1)return t=r[0].substring(7).split(` `),{stream:t[0],track:t[1]};let i=n.matchPrefix(e,`a=ssrc:`).map(e=>n.parseSsrcMedia(e)).filter(e=>e.attribute===`msid`);if(i.length>0)return t=i[0].value.split(` `),{stream:t[0],track:t[1]}},n.parseSctpDescription=function(e){let t=n.parseMLine(e),r=n.matchPrefix(e,`a=max-message-size:`),i;r.length>0&&(i=parseInt(r[0].substring(19),10)),isNaN(i)&&(i=65536);let a=n.matchPrefix(e,`a=sctp-port:`);
446if(a.length>0)return{port:parseInt(a[0].substring(12),10),protocol:t.fmt,maxMessageSize:i};let o=n.matchPrefix(e,`a=sctpmap:`);if(o.length>0){let e=o[0].substring(10).split(` `);return{port:parseInt(e[0],10),protocol:e[1],maxMessageSize:i}}},n.writeSctpDescription=function(e,t){let n=[];return n=e.protocol===`DTLS/SCTP`?[`m=`+e.kind+` 9 `+e.protocol+` `+t.port+`\r
447`,`c=IN IP4 0.0.0.0\r
448`,`a=sctpmap:`+t.port+` `+t.protocol+` 65535\r
449`]:[`m=`+e.kind+` 9 `+e.protocol+` `+t.protocol+`\r
450`,`c=IN IP4 0.0.0.0\r
451`,`a=sctp-port:`+t.port+`\r
452`],t.maxMessageSize!==void 0&&n.push(`a=max-message-size:`+t.maxMessageSize+`\r
453`),n.join(``)},n.generateSessionId=function(){return Math.random().toString().substr(2,22)},n.writeSessionBoilerplate=function(e,t,r){let i,a=t===void 0?2:t;return i=e||n.generateSessionId(),`v=0\r
454o=`+(r||`thisisadapterortc`)+` `+i+` `+a+` IN IP4 127.0.0.1\r
455s=-\r
456t=0 0\r
457`},n.getDirection=function(e,t){let r=n.splitLines(e);for(let e=0;e<r.length;e++)switch(r[e]){case`a=sendrecv`:case`a=sendonly`:case`a=recvonly`:case`a=inactive`:return r[e].substring(2);default:}return t?n.getDirection(t):`sendrecv`},n.getKind=function(e){return n.splitLines(e)[0].split(` `)[0].substring(2)},n.isRejected=function(e){return e.split(` `,2)[1]===`0`},n.parseMLine=function(e){let t=n.splitLines(e)[0].substring(2).split(` `);return{kind:t[0],port:parseInt(t[1],10),protocol:t[2],fmt:t.slice(3).join(` `)}},n.parseOLine=function(e){let t=n.matchPrefix(e,`o=`)[0].substring(2).split(` `);return{username:t[0],sessionId:t[1],sessionVersion:parseInt(t[2],10),netType:t[3],addressType:t[4],address:t[5]}},n.isValidSDP=function(e){if(typeof e!=`string`||e.length===0)return!1;let t=n.splitLines(e);for(let e=0;e<t.length;e++)if(t[e].length<2||t[e].charAt(1)!==`=`)return!1;return!0},typeof t==`object`&&(t.exports=n)})),vre=e({removeExtmapAllowMixed:()=>jT,shimAddIceCandidateNullOrEmpty:()=>MT,shimConnectionState:()=>AT,shimMaxMessageSize:()=>OT,shimParameterlessSetLocalDescription:()=>NT,shimRTCIceCandidate:()=>ET,shimRTCIceCandidateRelayProtocol:()=>DT,shimSendThrowTypeError:()=>kT}),TT=r(_re());function ET(e){if(!e.RTCIceCandidate||e.RTCIceCandidate&&`foundation`in e.RTCIceCandidate.prototype)return;let t=e.RTCIceCandidate;e.RTCIceCandidate=function(e){if(typeof e==`object`&&e.candidate&&e.candidate.indexOf(`a=`)===0&&(e=JSON.parse(JSON.stringify(e)),e.candidate=e.candidate.substring(2)),e.candidate&&e.candidate.length){let n=new t(e),r=TT.default.parseCandidate(e.candidate);for(let e in r)e in n||Object.defineProperty(n,e,{value:r[e]});return n.toJSON=function(){return{candidate:n.candidate,sdpMid:n.sdpMid,sdpMLineIndex:n.sdpMLineIndex,usernameFragment:n.usernameFragment}},n}return new t(e)},e.RTCIceCandidate.prototype=t.prototype,Rw(e,`icecandidate`,t=>(t.candidate&&Object.defineProperty(t,`candidate`,{value:new e.RTCIceCandidate(t.candidate),writable:`false`}),t))}function DT(e){!e.RTCIceCandidate||e.RTCIceCandidate&&`relayProtocol`in e.RTCIceCandidate.prototype||Rw(e,`icecandidate`,e=>{if(e.candidate){let t=TT.default.parseCandidate(e.candidate.candidate);t.type===`relay`&&(e.candidate.relayProtocol={0:`tls`,1:`tcp`,2:`udp`}[t.priority>>24])}return e})}function OT(e,t){if(!e.RTCPeerConnection)return;`sctp`in e.RTCPeerConnection.prototype||Object.defineProperty(e.RTCPeerConnection.prototype,`sctp`,{get(){return this._sctp===void 0?null:this._sctp}});let n=function(e){if(!e||!e.sdp)return!1;let t=TT.default.splitSections(e.sdp);return t.shift(),t.some(e=>{let t=TT.default.parseMLine(e);return t&&t.kind===`application`&&t.protocol.indexOf(`SCTP`)!==-1})},r=function(e){let t=e.sdp.match(/mozilla...THIS_IS_SDPARTA-(\d+)/);if(t===null||t.length<2)return-1;let n=parseInt(t[1],10);return n===n?n:-1},i=function(e){let n=65536;return t.browser===`firefox`&&(n=t.version<57?e===-1?16384:2147483637:t.version<60?t.version===57?65535:65536:2147483637),n},a=function(e,n){let r=65536;t.browser===`firefox`&&t.version===57&&(r=65535);let i=TT.default.matchPrefix(e.sdp,`a=max-message-size:`);return i.length>0?r=parseInt(i[0].substring(19),10):t.browser===`firefox`&&n!==-1&&(r=2147483637),r},o=e.RTCPeerConnection.prototype.setRemoteDescription;e.RTCPeerConnection.prototype.setRemoteDescription=function(){if(this._sctp=null,t.browser===`chrome`&&t.version>=76){let{sdpSemantics:e}=this.getConfiguration();e===`plan-b`&&Object.defineProperty(this,`sctp`,{get(){return this._sctp===void 0?null:this._sctp},enumerable:!0,configurable:!0})}if(n(arguments[0])){let e=r(arguments[0]),t=i(e),n=a(arguments[0],e),o;o=t===0&&n===0?1/0:t===0||n===0?Math.max(t,n):Math.min(t,n);let s={};Object.defineProperty(s,`maxMessageSize`,{get(){return o}}),this._sctp=s}return o.apply(this,arguments)}}function kT(e){if(!(e.RTCPeerConnection&&`createDataChannel`in e.RTCPeerConnection.prototype))return;function t(e,t){let n=e.send;e.send=function(){let r=arguments[0],i=r.length||r.size||r.byteLength;if(e.readyState===`open`&&t.sctp&&i>t.sctp.maxMessageSize)throw TypeError(`Message too large (can send a maximum of `+t.sctp.maxMessageSize+` bytes)`);return n.apply(e,arguments)}}let n=e.RTCPeerConnection.prototype.createDataChannel;e.RTCPeerConnection.prototype.createDataChannel=function(){let e=n.apply(this,arguments);return t(e,this),e},Rw(e,`datachannel`,e=>(t(e.channel,e.target),e))}
vendor: 4,328 bytes, lines 457-460
457function AT(e){if(!e.RTCPeerConnection||`connectionState`in e.RTCPeerConnection.prototype)return;let t=e.RTCPeerConnection.prototype;Object.defineProperty(t,`connectionState`,{get(){return{completed:`connected`,checking:`connecting`}[this.iceConnectionState]||this.iceConnectionState},enumerable:!0,configurable:!0}),Object.defineProperty(t,`onconnectionstatechange`,{get(){return this._onconnectionstatechange||null},set(e){this._onconnectionstatechange&&(this.removeEventListener(`connectionstatechange`,this._onconnectionstatechange),delete this._onconnectionstatechange),e&&this.addEventListener(`connectionstatechange`,this._onconnectionstatechange=e)},enumerable:!0,configurable:!0}),[`setLocalDescription`,`setRemoteDescription`].forEach(e=>{let n=t[e];t[e]=function(){return this._connectionstatechangepoly||(this._connectionstatechangepoly=e=>{let t=e.target;if(t._lastConnectionState!==t.connectionState){t._lastConnectionState=t.connectionState;let n=new Event(`connectionstatechange`,e);t.dispatchEvent(n)}return e},this.addEventListener(`iceconnectionstatechange`,this._connectionstatechangepoly)),n.apply(this,arguments)}})}function jT(e,t){if(!e.RTCPeerConnection||t.browser===`chrome`&&t.version>=71||t.browser===`safari`&&t._safariVersion>=13.1)return;let n=e.RTCPeerConnection.prototype.setRemoteDescription;e.RTCPeerConnection.prototype.setRemoteDescription=function(t){if(t&&t.sdp&&t.sdp.indexOf(`
458a=extmap-allow-mixed`)!==-1){let n=t.sdp.split(`
459`).filter(e=>e.trim()!==`a=extmap-allow-mixed`).join(`
460`);e.RTCSessionDescription&&t instanceof e.RTCSessionDescription?arguments[0]=new e.RTCSessionDescription({type:t.type,sdp:n}):t.sdp=n}return n.apply(this,arguments)}}function MT(e,t){if(!(e.RTCPeerConnection&&e.RTCPeerConnection.prototype))return;let n=e.RTCPeerConnection.prototype.addIceCandidate;!n||n.length===0||(e.RTCPeerConnection.prototype.addIceCandidate=function(){return arguments[0]?(t.browser===`chrome`&&t.version<78||t.browser===`firefox`&&t.version<68||t.browser===`safari`)&&arguments[0]&&arguments[0].candidate===``?Promise.resolve():n.apply(this,arguments):(arguments[1]&&arguments[1].apply(null),Promise.resolve())})}function NT(e,t){if(!(e.RTCPeerConnection&&e.RTCPeerConnection.prototype))return;let n=e.RTCPeerConnection.prototype.setLocalDescription;!n||n.length===0||(e.RTCPeerConnection.prototype.setLocalDescription=function(){let e=arguments[0]||{};if(typeof e!=`object`||e.type&&e.sdp)return n.apply(this,arguments);if(e={type:e.type,sdp:e.sdp},!e.type)switch(this.signalingState){case`stable`:case`have-local-offer`:case`have-remote-pranswer`:e.type=`offer`;break;default:e.type=`answer`;break}return e.sdp||e.type!==`offer`&&e.type!==`answer`?n.apply(this,[e]):(e.type===`offer`?this.createOffer:this.createAnswer).apply(this).then(e=>n.apply(this,[e]))})}function yre({window:e}={},t={shimChrome:!0,shimFirefox:!0,shimSafari:!0}){let n=zw,r=mre(e),i={browserDetails:r,commonShim:vre,extractVersion:Lw,disableLog:fre,disableWarnings:pre,sdp:TT};switch(r.browser){case`chrome`:if(!qw||!tT||!t.shimChrome)return n(`Chrome shim is not included in this adapter release.`),i;if(r.version===null)return n(`Chrome shim can not determine version, not shimming.`),i;n(`adapter.js shimming chrome.`),i.browserShim=qw,MT(e,r),NT(e,r),Kw(e,r),Jw(e,r),tT(e,r),Yw(e,r),eT(e,r),Xw(e,r),Zw(e,r),Qw(e,r),nT(e,r),ET(e,r),DT(e,r),AT(e,r),OT(e,r),kT(e,r),jT(e,r);break;case`firefox`:if(!iT||!oT||!t.shimFirefox)return n(`Firefox shim is not included in this adapter release.`),i;n(`adapter.js shimming firefox.`),i.browserShim=iT,MT(e,r),NT(e,r),rT(e,r),oT(e,r),aT(e,r),lT(e,r),sT(e,r),cT(e,r),uT(e,r),dT(e,r),fT(e,r),pT(e,r),mT(e,r),ET(e,r),AT(e,r),OT(e,r),kT(e,r);break;case`safari`:if(!hT||!t.shimSafari)return n(`Safari shim is not included in this adapter release.`),i;n(`adapter.js shimming safari.`),i.browserShim=hT,MT(e,r),NT(e,r),xT(e,r),CT(e,r),vT(e,r),gT(e,r),_T(e,r),ST(e,r),yT(e,r),wT(e,r),ET(e,r),DT(e,r),OT(e,r),kT(e,r),jT(e,r);break;default:n(`Unsupported browser!`);break}return i}yre({window:typeof window>`u`?void 0:window});function PT(e){let t=typeof e;if(t==`object`){if(Array.isArray(e))return`array`;if(e===null)return`null`}return t}function FT(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}var IT=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789
460+/`.split(``),LT=[];for(let e=0;e<IT.length;e++)LT[IT[e].charCodeAt(0)]=e;LT[45]=IT.indexOf(`+`),LT[95]=IT.indexOf(`/`);function bre(e){let t=e.length*3/4;e[e.length-2]==`=`?t-=2:e[e.length-1]==`=`&&--t;let n=new Uint8Array(t),r=0,i=0,a,o=0;for(let t=0;t<e.length;t++){if(a=LT[e.charCodeAt(t)],a===void 0)switch(e[t]){case`=`:i=0;case`
461`:case`\r`:case`	`:case` `:continue;default:throw Error(`invalid base64 string.`)}switch(i){case 0:o=a,i=1;break;case 1:n[r++]=o<<2|(a&48)>>4,o=a,i=2;break;case 2:n[r++]=(o&15)<<4|(a&60)>>2,o=a,i=3;break;case 3:n[r++]=(o&3)<<6|a,i=0;break}}if(i==1)throw Error(`invalid base64 string.`);return n.subarray(0,r)}function xre(e){let t=``,n=0,r,i=0;for(let a=0;a<e.length;a++)switch(r=e[a],n){case 0:t+=IT[r>>2],i=(r&3)<<4,n=1;break;case 1:t+=IT[i|r>>4],i=(r&15)<<2,n=2;break;case 2:t+=IT[i|r>>6],t+=IT[r&63],n=0;break}return n&&(t+=IT[i],t+=`=`,n==1&&(t+=`=`)),t}var RT;(function(e){e.symbol=Symbol.for(`protobuf-ts/unknown`),e.onRead=(n,r,i,a,o)=>{(t(r)?r[e.symbol]:r[e.symbol]=[]).push({no:i,wireType:a,data:o})},e.onWrite=(t,n,r)=>{for(let{no:t,wireType:i,data:a}of e.list(n))r.tag(t,i).raw(a)},e.list=(n,r)=>{if(t(n)){let t=n[e.symbol];return r?t.filter(e=>e.no==r):t}return[]},e.last=(t,n)=>e.list(t,n).slice(-1)[0];let t=t=>t&&Array.isArray(t[e.symbol])})(RT||={});function Sre(e,t){return Object.assign(Object.assign({},e),t)}var zT;(function(e){e[e.Varint=0]=`Varint`,e[e.Bit64=1]=`Bit64`,e[e.LengthDelimited=2]=`LengthDelimited`,e[e.StartGroup=3]=`StartGroup`,e[e.EndGroup=4]=`EndGroup`,e[e.Bit32=5]=`Bit32`})(zT||={});function Cre(){let e=0,t=0;for(let n=0;n<28;n+=7){let r=this.buf[this.pos++];if(e|=(r&127)<<n,!(r&128))return this.assertBounds(),[e,t]}let n=this.buf[this.pos++];if(e|=(n&15)<<28,t=(n&112)>>4,!(n&128))return this.assertBounds(),[e,t];for(let n=3;n<=31;n+=7){let r=this.buf[this.pos++];if(t|=(r&127)<<n,!(r&128))return this.assertBounds(),[e,t]}throw Error(`invalid varint`)}function BT(e,t,n){for(let r=0;r<28;r+=7){let i=e>>>r,a=!(!(i>>>7)&&t==0),o=(a?i|128:i)&255;if(n.push(o),!a)return}let r=e>>>28&15|(t&7)<<4,i=!!(t>>3);if(n.push((i?r|128:r)&255),i){for(let e=3;e<31;e+=7){let r=t>>>e,i=!!(r>>>7),a=(i?r|128:r)&255;if(n.push(a),!i)return}n.push(t>>>31&1)}}var VT=65536*65536;function HT(e){let t=e[0]==`-`;t&&(e=e.slice(1));let n=1e6,r=0,i=0;function a(t,a){let o=Number(e.slice(t,a));i*=n,r=r*n+o,r>=VT&&(i+=r/VT|0,r%=VT)}return a(-24,-18),a(-18,-12),a(-12,-6),a(-6),[t,r,i]}function UT(e,t){if(t>>>0<=2097151)return``+(VT*t+(e>>>0));let n=e&16777215,r=(e>>>24|t<<8)>>>0&16777215,i=t>>16&65535,a=n+r*6777216+i*6710656,o=r+i*8147497,s=i*2,c=1e7;a>=c&&(o+=Math.floor(a/c),a%=c),o>=c&&(s+=Math.floor(o/c),o%=c);function l(e,t){let n=e?String(e):``;return t?`0000000`.slice(n.length)+n:n}return l(s,0)+l(o,s)+l(a,1)}function WT(e,t){if(e>=0){for(;e>127;)t.push(e&127|128),e>>>=7;t.push(e)}else{for(let n=0;n<9;n++)t.push(e&127|128),e>>=7;t.push(1)}}function wre(){let e=this.buf[this.pos++],t=e&127;if(!(e&128)||(e=this.buf[this.pos++],t|=(e&127)<<7,!(e&128))||(e=this.buf[this.pos++],t|=(e&127)<<14,!(e&128))||(e=this.buf[this.pos++],t|=(e&127)<<21,!(e&128)))return this.assertBounds(),t;e=this.buf[this.pos++],t|=(e&15)<<28;for(let t=5;e&128&&t<10;t++)e=this.buf[this.pos++];if(e&128)throw Error(`invalid varint`);return this.assertBounds(),t>>>0}var GT;function Tre(){let e=new DataView(new ArrayBuffer(8));GT=globalThis.BigInt!==void 0&&typeof e.getBigInt64==`function`&&typeof e.getBigUint64==`function`&&typeof e.setBigInt64==`function`&&typeof e.setBigUint64==`function`?{MIN:BigInt(`-9223372036854775808`),MAX:BigInt(`9223372036854775807`),UMIN:BigInt(`0`),UMAX:BigInt(`18446744073709551615`),C:BigInt,V:e}:void 0}Tre();function KT(e){if(!e)throw Error(`BigInt unavailable, see https://github.com/timostamm/protobuf-ts/blob/v1.0.8/MANUAL.md#bigint-support`)}var qT=/^-?[0-9]+$/,JT=4294967296,YT=2147483648,XT=class{constructor(e,t){this.lo=e|0,this.hi=t|0}isZero(){return this.lo==0&&this.hi==0}toNumber(){let e=this.hi*JT+(this.lo>>>0);if(!Number.isSafeInteger(e))throw Error(`cannot convert to safe number`);return e}},ZT=class e extends XT{static from(t){if(GT)switch(typeof t){case`string`:if(t==`0`)return this.ZERO;if(t==``)throw Error(`string is no integer`);t=GT.C(t);case`number`:if(t===0)return this.ZERO;t=GT.C(t);case`bigint`:if(!t)return this.ZERO;if(t<GT.UMIN)throw Error(`signed value for ulong`);
461if(t>GT.UMAX)throw Error(`ulong too large`);return GT.V.setBigUint64(0,t,!0),new e(GT.V.getInt32(0,!0),GT.V.getInt32(4,!0))}else switch(typeof t){case`string`:if(t==`0`)return this.ZERO;if(t=t.trim(),!qT.test(t))throw Error(`string is no integer`);let[n,r,i]=HT(t);if(n)throw Error(`signed value for ulong`);return new e(r,i);case`number`:if(t==0)return this.ZERO;if(!Number.isSafeInteger(t))throw Error(`number is no integer`);if(t<0)throw Error(`signed value for ulong`);return new e(t,t/JT)}throw Error(`unknown value `+typeof t)}toString(){return GT?this.toBigInt().toString():UT(this.lo,this.hi)}toBigInt(){return KT(GT),GT.V.setInt32(0,this.lo,!0),GT.V.setInt32(4,this.hi,!0),GT.V.getBigUint64(0,!0)}};ZT.ZERO=new ZT(0,0);var QT=class e extends XT{static from(t){if(GT)switch(typeof t){case`string`:if(t==`0`)return this.ZERO;if(t==``)throw Error(`string is no integer`);t=GT.C(t);case`number`:if(t===0)return this.ZERO;t=GT.C(t);case`bigint`:if(!t)return this.ZERO;if(t<GT.MIN)throw Error(`signed long too small`);if(t>GT.MAX)throw Error(`signed long too large`);return GT.V.setBigInt64(0,t,!0),new e(GT.V.getInt32(0,!0),GT.V.getInt32(4,!0))}else switch(typeof t){case`string`:if(t==`0`)return this.ZERO;if(t=t.trim(),!qT.test(t))throw Error(`string is no integer`);let[n,r,i]=HT(t);if(n){if(i>YT||i==YT&&r!=0)throw Error(`signed long too small`)}else if(i>=YT)throw Error(`signed long too large`);let a=new e(r,i);return n?a.negate():a;case`number`:if(t==0)return this.ZERO;if(!Number.isSafeInteger(t))throw Error(`number is no integer`);return t>0?new e(t,t/JT):new e(-t,-t/JT).negate()}throw Error(`unknown value `+typeof t)}isNegative(){return(this.hi&YT)!==0}negate(){let t=~this.hi,n=this.lo;return n?n=~n+1:t+=1,new e(n,t)}toString(){if(GT)return this.toBigInt().toString();if(this.isNegative()){let e=this.negate();return`-`+UT(e.lo,e.hi)}return UT(this.lo,this.hi)}toBigInt(){return KT(GT),GT.V.setInt32(0,this.lo,!0),GT.V.setInt32(4,this.hi,!0),GT.V.getBigInt64(0,!0)}};QT.ZERO=new QT(0,0);var $T={readUnknownField:!0,readerFactory:e=>new Dre(e)};function Ere(e){return e?Object.assign(Object.assign({},$T),e):$T}var Dre=class{constructor(e,t){this.varint64=Cre,this.uint32=wre,this.buf=e,this.len=e.length,this.pos=0,this.view=new DataView(e.buffer,e.byteOffset,e.byteLength),this.textDecoder=t??new TextDecoder(`utf-8`,{fatal:!0,ignoreBOM:!0})}tag(){let e=this.uint32(),t=e>>>3,n=e&7;if(t<=0||n<0||n>5)throw Error(`illegal tag: field no `+t+` wire type `+n);return[t,n]}skip(e){let t=this.pos;switch(e){case zT.Varint:for(;this.buf[this.pos++]&128;);break;case zT.Bit64:this.pos+=4;case zT.Bit32:this.pos+=4;break;case zT.LengthDelimited:let t=this.uint32();this.pos+=t;break;case zT.StartGroup:let n;for(;(n=this.tag()[1])!==zT.EndGroup;)this.skip(n);break;default:throw Error(`cant skip wire type `+e)}return this.assertBounds(),this.buf.subarray(t,this.pos)}assertBounds(){if(this.pos>this.len)throw RangeError(`premature EOF`)}int32(){return this.uint32()|0}sint32(){let e=this.uint32();return e>>>1^-(e&1)}int64(){return new QT(...this.varint64())}uint64(){return new ZT(...this.varint64())}sint64(){let[e,t]=this.varint64(),n=-(e&1);return e=(e>>>1|(t&1)<<31)^n,t=t>>>1^n,new QT(e,t)}bool(){let[e,t]=this.varint64();return e!==0||t!==0}fixed32(){return this.view.getUint32((this.pos+=4)-4,!0)}sfixed32(){return this.view.getInt32((this.pos+=4)-4,!0)}fixed64(){return new ZT(this.sfixed32(),this.sfixed32())}sfixed64(){return new QT(this.sfixed32(),this.sfixed32())}float(){return this.view.getFloat32((this.pos+=4)-4,!0)}double(){return this.view.getFloat64((this.pos+=8)-8,!0)}bytes(){let e=this.uint32(),t=this.pos;return this.pos+=e,this.assertBounds(),this.buf.subarray(t,t+e)}string(){return this.textDecoder.decode(this.bytes())}};function eE(e,t){if(!e)throw Error(t)}function Ore(e,t){throw Error(t??`Unexpected object: `+e)}var kre=34028234663852886e22,Are=-34028234663852886e22,jre=4294967295,Mre=2147483647,Nre=-2147483648;function tE(e){if(typeof e!=`number`)throw Error(`invalid int 32: `+typeof e);if(!Number.isInteger(e)||e>Mre||e<Nre)throw Error(`invalid int 32: `+e)}function nE(e){if(typeof e!=`number`)throw Error(`invalid uint 32: `+typeof e);if(!Number.isInteger(e)||e>jre||e<0)throw Error(`invalid uint 32: `+e)}function rE(e){if(typeof e!=`number`)throw Error(`invalid float 32: `+typeof e);if(Number.isFinite(e)&&(e>kre||e<Are))throw Error(`invalid float 32: `+e)}var iE={writeUnknownFields:!0,writerFactory:()=>new Fre};function Pre(e){return e?Object.assign(Object.assign({},iE),e):iE}var Fre=class{constructor(e){this.stack=[],this.textEncoder=e??new TextEncoder,this.chunks=[],this.buf=[]}finish(){this.chunks.push(new Uint8Array(this.buf));let e=0;for(let t=0;t<this.chunks.length;t++)e+=this.chunks[t].length;let t=new Uint8Array(e),n=0;for(let e=0;e<this.chunks.length;e++)t.set(this.chunks[e],n),n+=this.chunks[e].length;return this.chunks=[],t}fork(){return this.stack.push({chunks:this.chunks,buf:this.buf}),this.chunks=[],this.buf=[],this}join(){let e=this.finish(),t=this.stack.pop();if(!t)throw Error(`invalid state, fork stack empty`);return this.chunks=t.chunks,this.buf=t.buf,this.uint32(e.byteLength),this.raw(e)}tag(e,t){return this.uint32((e<<3|t)>>>0)}raw(e){return this.buf.length&&(this.chunks.push(new Uint8Array(this.buf)),this.buf=[]),this.chunks.push(e),this}uint32(e){for(nE(e);e>127;)this.buf.push(e&127|128),e>>>=7;return this.buf.push(e),this}int32(e){return tE(e),WT(e,this.buf),this}bool(e){return this.buf.push(+!!e),this}bytes(e){return this.uint32(e.byteLength),this.raw(e)}string(e){let t=this.textEncoder.encode(e);return this.uint32(t.byteLength),this.raw(t)}float(e){rE(e);let t=new Uint8Array(4);return new DataView(t.buffer).setFloat32(0,e,!0),this.raw(t)}double(e){let t=new Uint8Array(8);return new DataView(t.buffer).setFloat64(0,e,!0),this.raw(t)}fixed32(e){nE(e);let t=new Uint8Array(4);return new DataView(t.buffer).setUint32(0,e,!0),this.raw(t)}sfixed32(e){tE(e);let t=new Uint8Array(4);return new DataView(t.buffer).setInt32(0,e,!0),this.raw(t)}sint32(e){return tE(e),e=(e<<1^e>>31)>>>0,WT(e,this.buf),this}sfixed64(e){let t=new Uint8Array(8),n=new DataView(t.buffer),r=QT.from(e);return n.setInt32(0,r.lo,!0),n.setInt32(4,r.hi,!0),this.raw(t)}fixed64(e){let t=new Uint8Array(8),n=new DataView(t.buffer),r=ZT.from(e);return n.setInt32(0,r.lo,!0),n.setInt32(4,r.hi,!0),this.raw(t)}int64(e){let t=QT.from(e);return BT(t.lo,t.hi,this.buf),this}sint64(e){let t=QT.from(e),n=t.hi>>31;return BT(t.lo<<1^n,(t.hi<<1|t.lo>>>31)^n,this.buf),this}uint64(e){let t=ZT.from(e);return BT(t.lo,t.hi,this.buf),this}},aE={emitDefaultValues:!1,enumAsInteger:!1,useProtoFieldName:!1,prettySpaces:0},oE={ignoreUnknownFields:!1};function Ire(e){return e?Object.assign(Object.assign({},oE),e):oE}function Lre(e){return e?Object.assign(Object.assign({},aE),e):aE}function Rre(e,t){let n=Object.assign(Object.assign({},e),t);return n.typeRegistry=[...e?.typeRegistry??[],...t?.typeRegistry??[]],n}var sE=Symbol.for(`protobuf-ts/message-type`);function cE(e){let t=!1,n=[];for(let r=0;r<e.length;r++){let i=e.charAt(r);i==`_`?t=!0:/\d/.test(i)?(n.push(i),t=!0):t?(n.push(i.toUpperCase()),t=!1):r==0?n.push(i.toLowerCase()):n.push(i)}return n.join(``)}var V;(function(e){e[e.DOUBLE=1]=`DOUBLE`,e[e.FLOAT=2]=`FLOAT`,e[e.INT64=3]=`INT64`,e[e.UINT64=4]=`UINT64`,e[e.INT32=5]=`INT32`,e[e.FIXED64=6]=`FIXED64`,e[e.FIXED32=7]=`FIXED32`,e[e.BOOL=8]=`BOOL`,e[e.STRING=9]=`STRING`,e[e.BYTES=12]=`BYTES`,e[e.UINT32=13]=`UINT32`,e[e.SFIXED32=15]=`SFIXED32`,e[e.SFIXED64=16]=`SFIXED64`,e[e.SINT32=17]=`SINT32`,e[e.SINT64=18]=`SINT64`})(V||={});var lE;(function(e){e[e.BIGINT=0]=`BIGINT`,e[e.STRING=1]=`STRING`,e[e.NUMBER=2]=`NUMBER`})(lE||={});var uE;(function(e){e[e.NO=0]=`NO`,e[e.PACKED=1]=`PACKED`,e[e.UNPACKED=2]=`UNPACKED`})(uE||={});function zre(e){return e.localName=e.localName??cE(e.name),e.jsonName=e.jsonName??cE(e.name),e.repeat=e.repeat??uE.NO,e.opt=e.opt??(e.repeat||e.oneof?!1:e.kind==`message`),e}function Bre(e){if(typeof e!=`object`||!e||!e.hasOwnProperty(`oneofKind`))return!1;switch(typeof e.oneofKind){case`string`:return e[e.oneofKind]===void 0?!1:Object.keys(e).length==2;case`undefined`:return Object.keys(e).length==1;default:return!1}}var Vre=class{constructor(e){this.fields=e.fields??[]}prepare(){if(this.data)return;let e=[],t=[],n=[];for(let r of this.fields)if(r.oneof)n.includes(r.oneof)||(n.push(r.oneof),e.push(r.oneof),t.push(r.oneof));else switch(t.push(r.localName),r.kind){case`scalar`:case`enum`:(!r.opt||r.repeat)&&e.push(r.localName);break;case`message`:r.repeat&&e.push(r.localName);break;case`map`:e.push(r.localName);break}this.data={req:e,known:t,oneofs:Object.values(n)}}is(e,t,n=!1){if(t<0)return!0;
461if(typeof e!=`object`||!e)return!1;this.prepare();let r=Object.keys(e),i=this.data;if(r.length<i.req.length||i.req.some(e=>!r.includes(e))||!n&&r.some(e=>!i.known.includes(e)))return!1;if(t<1)return!0;for(let r of i.oneofs){let i=e[r];if(!Bre(i))return!1;if(i.oneofKind===void 0)continue;let a=this.fields.find(e=>e.localName===i.oneofKind);if(!a||!this.field(i[i.oneofKind],a,n,t))return!1}for(let r of this.fields)if(r.oneof===void 0&&!this.field(e[r.localName],r,n,t))return!1;return!0}field(e,t,n,r){let i=t.repeat;switch(t.kind){case`scalar`:return e===void 0?t.opt:i?this.scalars(e,t.T,r,t.L):this.scalar(e,t.T,t.L);case`enum`:return e===void 0?t.opt:i?this.scalars(e,V.INT32,r):this.scalar(e,V.INT32);case`message`:return e===void 0?!0:i?this.messages(e,t.T(),n,r):this.message(e,t.T(),n,r);case`map`:if(typeof e!=`object`||!e)return!1;if(r<2)return!0;if(!this.mapKeys(e,t.K,r))return!1;switch(t.V.kind){case`scalar`:return this.scalars(Object.values(e),t.V.T,r,t.V.L);case`enum`:return this.scalars(Object.values(e),V.INT32,r);case`message`:return this.messages(Object.values(e),t.V.T(),n,r)}break}return!0}message(e,t,n,r){return n?t.isAssignable(e,r):t.is(e,r)}messages(e,t,n,r){if(!Array.isArray(e))return!1;if(r<2)return!0;if(n){for(let n=0;n<e.length&&n<r;n++)if(!t.isAssignable(e[n],r-1))return!1}else for(let n=0;n<e.length&&n<r;n++)if(!t.is(e[n],r-1))return!1;return!0}scalar(e,t,n){let r=typeof e;switch(t){case V.UINT64:case V.FIXED64:case V.INT64:case V.SFIXED64:case V.SINT64:switch(n){case lE.BIGINT:return r==`bigint`;case lE.NUMBER:return r==`number`&&!isNaN(e);default:return r==`string`}case V.BOOL:return r==`boolean`;case V.STRING:return r==`string`;case V.BYTES:return e instanceof Uint8Array;case V.DOUBLE:case V.FLOAT:return r==`number`&&!isNaN(e);default:return r==`number`&&Number.isInteger(e)}}scalars(e,t,n,r){if(!Array.isArray(e))return!1;if(n<2)return!0;if(Array.isArray(e)){for(let i=0;i<e.length&&i<n;i++)if(!this.scalar(e[i],t,r))return!1}return!0}mapKeys(e,t,n){let r=Object.keys(e);switch(t){case V.INT32:case V.FIXED32:case V.SFIXED32:case V.SINT32:case V.UINT32:return this.scalars(r.slice(0,n).map(e=>parseInt(e)),t,n);case V.BOOL:return this.scalars(r.slice(0,n).map(e=>e==`true`?!0:e==`false`?!1:e),t,n);default:return this.scalars(r,t,n,lE.STRING)}}};function dE(e,t){switch(t){case lE.BIGINT:return e.toBigInt();case lE.NUMBER:return e.toNumber();default:return e.toString()}}var Hre=class{constructor(e){this.info=e}prepare(){if(this.fMap===void 0){this.fMap={};let e=this.info.fields??[];for(let t of e)this.fMap[t.name]=t,this.fMap[t.jsonName]=t,this.fMap[t.localName]=t}}assert(e,t,n){if(!e){let e=PT(n);throw(e==`number`||e==`boolean`)&&(e=n.toString()),Error(`Cannot parse JSON ${e} for ${this.info.typeName}#${t}`)}}read(e,t,n){this.prepare();let r=[];for(let[i,a]of Object.entries(e)){let e=this.fMap[i];if(!e){if(!n.ignoreUnknownFields)throw Error(`Found unknown field while reading ${this.info.typeName} from JSON format. JSON key: ${i}`);continue}let o=e.localName,s;if(e.oneof){if(a===null&&(e.kind!==`enum`||e.T()[0]!==`google.protobuf.NullValue`))continue;if(r.includes(e.oneof))throw Error(`Multiple members of the oneof group "${e.oneof}" of ${this.info.typeName} are present in JSON.`);r.push(e.oneof),s=t[e.oneof]={oneofKind:o}}else s=t;if(e.kind==`map`){if(a===null)continue;this.assert(FT(a),e.name,a);let t=s[o];for(let[r,i]of Object.entries(a)){this.assert(i!==null,e.name+` map value`,null);let a;switch(e.V.kind){case`message`:a=e.V.T().internalJsonRead(i,n);break;case`enum`:if(a=this.enum(e.V.T(),i,e.name,n.ignoreUnknownFields),a===!1)continue;break;case`scalar`:a=this.scalar(i,e.V.T,e.V.L,e.name);break}this.assert(a!==void 0,e.name+` map value`,i);let o=r;e.K==V.BOOL&&(o=o==`true`?!0:o==`false`?!1:o),o=this.scalar(o,e.K,lE.STRING,e.name).toString(),t[o]=a}}else if(e.repeat){if(a===null)continue;this.assert(Array.isArray(a),e.name,a);let t=s[o];for(let r of a){this.assert(r!==null,e.name,null);let i;switch(e.kind){case`message`:i=e.T().internalJsonRead(r,n);break;case`enum`:if(i=this.enum(e.T(),r,e.name,n.ignoreUnknownFields),i===!1)continue;break;case`scalar`:i=this.scalar(r,e.T,e.L,e.name);break}this.assert(i!==void 0,e.name,a),t.push(i)}}else switch(e.kind){case`message`:if(a===null&&e.T().typeName!=`google.protobuf.Value`){this.assert(e.oneof===void 0,e.name+` (oneof member)`,null);continue}s[o]=e.T().internalJsonRead(a,n,s[o]);break;case`enum`:if(a===null)continue;let t=this.enum(e.T(),a,e.name,n.ignoreUnknownFields);if(t===!1)continue;s[o]=t;break;case`scalar`:if(a===null)continue;s[o]=this.scalar(a,e.T,e.L,e.name);break}}}enum(e,t,n,r){if(e[0]==`google.protobuf.NullValue`&&eE(t===null||t===`NULL_VALUE`,`Unable to parse field ${this.info.typeName}#${n}, enum ${e[0]} only accepts null.`),t===null)return 0;switch(typeof t){case`number`:return eE(Number.isInteger(t),`Unable to parse field ${this.info.typeName}#${n}, enum can only be integral number, got ${t}.`),t;case`string`:let i=t;e[2]&&t.substring(0,e[2].length)===e[2]&&(i=t.substring(e[2].length));let a=e[1][i];return a===void 0&&r?!1:(eE(typeof a==`number`,`Unable to parse field ${this.info.typeName}#${n}, enum ${e[0]} has no value for "${t}".`),a)}eE(!1,`Unable to parse field ${this.info.typeName}#${n}, cannot parse enum value from ${typeof t}".`)}
461scalar(e,t,n,r){let i;try{switch(t){case V.DOUBLE:case V.FLOAT:if(e===null)return 0;if(e===`NaN`)return NaN;if(e===`Infinity`)return 1/0;if(e===`-Infinity`)return-1/0;if(e===``){i=`empty string`;break}if(typeof e==`string`&&e.trim().length!==e.length){i=`extra whitespace`;break}if(typeof e!=`string`&&typeof e!=`number`)break;let r=Number(e);if(Number.isNaN(r)){i=`not a number`;break}if(!Number.isFinite(r)){i=`too large or small`;break}return t==V.FLOAT&&rE(r),r;case V.INT32:case V.FIXED32:case V.SFIXED32:case V.SINT32:case V.UINT32:if(e===null)return 0;let a;if(typeof e==`number`?a=e:e===``?i=`empty string`:typeof e==`string`&&(e.trim().length===e.length?a=Number(e):i=`extra whitespace`),a===void 0)break;return t==V.UINT32?nE(a):tE(a),a;case V.INT64:case V.SFIXED64:case V.SINT64:if(e===null)return dE(QT.ZERO,n);if(typeof e!=`number`&&typeof e!=`string`)break;return dE(QT.from(e),n);case V.FIXED64:case V.UINT64:if(e===null)return dE(ZT.ZERO,n);if(typeof e!=`number`&&typeof e!=`string`)break;return dE(ZT.from(e),n);case V.BOOL:if(e===null)return!1;if(typeof e!=`boolean`)break;return e;case V.STRING:if(e===null)return``;if(typeof e!=`string`){i=`extra whitespace`;break}return e;case V.BYTES:if(e===null||e===``)return new Uint8Array;
461if(typeof e!=`string`)break;return bre(e)}}catch(e){i=e.message}this.assert(!1,r+(i?` - `+i:``),e)}},Ure=class{constructor(e){this.fields=e.fields??[]}write(e,t){let n={},r=e;for(let e of this.fields){if(!e.oneof){let i=this.field(e,r[e.localName],t);i!==void 0&&(n[t.useProtoFieldName?e.name:e.jsonName]=i);continue}let i=r[e.oneof];if(i.oneofKind!==e.localName)continue;let a=e.kind==`scalar`||e.kind==`enum`?Object.assign(Object.assign({},t),{emitDefaultValues:!0}):t,o=this.field(e,i[e.localName],a);eE(o!==void 0),n[t.useProtoFieldName?e.name:e.jsonName]=o}return n}field(e,t,n){let r;if(e.kind==`map`){eE(typeof t==`object`&&!!t);let i={};switch(e.V.kind){case`scalar`:for(let[n,r]of Object.entries(t)){let t=this.scalar(e.V.T,r,e.name,!1,!0);eE(t!==void 0),i[n.toString()]=t}break;case`message`:let r=e.V.T();for(let[a,o]of Object.entries(t)){let t=this.message(r,o,e.name,n);eE(t!==void 0),i[a.toString()]=t}break;case`enum`:let a=e.V.T();for(let[r,o]of Object.entries(t)){eE(o===void 0||typeof o==`number`);let t=this.enum(a,o,e.name,!1,!0,n.enumAsInteger);eE(t!==void 0),i[r.toString()]=t}break}(n.emitDefaultValues||Object.keys(i).length>0)&&(r=i)}else if(e.repeat){eE(Array.isArray(t));let i=[];switch(e.kind){case`scalar`:for(let n=0;n<t.length;n++){let r=this.scalar(e.T,t[n],e.name,e.opt,!0);eE(r!==void 0),i.push(r)}break;case`enum`:let r=e.T();for(let a=0;a<t.length;a++){eE(t[a]===void 0||typeof t[a]==`number`);let o=this.enum(r,t[a],e.name,e.opt,!0,n.enumAsInteger);eE(o!==void 0),i.push(o)}break;case`message`:let a=e.T();for(let r=0;r<t.length;r++){let o=this.message(a,t[r],e.name,n);eE(o!==void 0),i.push(o)}break}(n.emitDefaultValues||i.length>0||n.emitDefaultValues)&&(r=i)}else switch(e.kind){case`scalar`:r=this.scalar(e.T,t,e.name,e.opt,n.emitDefaultValues);break;case`enum`:r=this.enum(e.T(),t,e.name,e.opt,n.emitDefaultValues,n.enumAsInteger);break;case`message`:r=this.message(e.T(),t,e.name,n);break}return r}enum(e,t,n,r,i,a){if(e[0]==`google.protobuf.NullValue`)return!i&&!r?void 0:null;if(t===void 0){eE(r);return}if(!(t===0&&!i&&!r))return eE(typeof t==`number`),eE(Number.isInteger(t)),a||!e[1].hasOwnProperty(t)?t:e[2]?e[2]+e[1][t]:e[1][t]}message(e,t,n,r){return t===void 0?r.emitDefaultValues?null:void 0:e.internalJsonWrite(t,r)}scalar(e,t,n,r,i){if(t===void 0){eE(r);return}let a=i||r;switch(e){case V.INT32:case V.SFIXED32:case V.SINT32:return t===0?a?0:void 0:(tE(t),t);case V.FIXED32:case V.UINT32:return t===0?a?0:void 0:(nE(t),t);case V.FLOAT:rE(t);case V.DOUBLE:return t===0?a?0:void 0:(eE(typeof t==`number`),Number.isNaN(t)?`NaN`:t===1/0?`Infinity`:t===-1/0?`-Infinity`:t);case V.STRING:return t===``?a?``:void 0:(eE(typeof t==`string`),t);case V.BOOL:return t===!1?a?!1:void 0:(eE(typeof t==`boolean`),t);case V.UINT64:case V.FIXED64:eE(typeof t==`number`||typeof t==`string`||typeof t==`bigint`);let e=ZT.from(t);return e.isZero()&&!a?void 0:e.toString();case V.INT64:case V.SFIXED64:case V.SINT64:eE(typeof t==`number`||typeof t==`string`||typeof t==`bigint`);let n=QT.from(t);return n.isZero()&&!a?void 0:n.toString();case V.BYTES:return eE(t instanceof Uint8Array),t.byteLength?xre(t):a?``:void 0}}};function fE(e,t=lE.STRING){switch(e){case V.BOOL:return!1;case V.UINT64:case V.FIXED64:return dE(ZT.ZERO,t);case V.INT64:case V.SFIXED64:case V.SINT64:return dE(QT.ZERO,t);case V.DOUBLE:case V.FLOAT:return 0;case V.BYTES:return new Uint8Array;case V.STRING:return``;default:return 0}}var Wre=class{constructor(e){this.info=e}prepare(){if(!this.fieldNoToField){let e=this.info.fields??[];this.fieldNoToField=new Map(e.map(e=>[e.no,e]))}}read(e,t,n,r){this.prepare();let i=r===void 0?e.len:e.pos+r;for(;e.pos<i;){let[r,i]=e.tag(),a=this.fieldNoToField.get(r);if(!a){let a=n.readUnknownField;if(a==`throw`)throw Error(`Unknown field ${r} (wire type ${i}) for ${this.info.typeName}`);let o=e.skip(i);a!==!1&&(a===!0?RT.onRead:a)(this.info.typeName,t,r,i,o);continue}let o=t,s=a.repeat,c=a.localName;switch(a.oneof&&(o=o[a.oneof],o.oneofKind!==c&&(o=t[a.oneof]={oneofKind:c})),a.kind){case`scalar`:case`enum`:let t=a.kind==`enum`?V.INT32:a.T,r=a.kind==`scalar`?a.L:void 0;if(s){let n=o[c];if(i==zT.LengthDelimited&&t!=V.STRING&&t!=V.BYTES){let i=e.uint32()+e.pos;for(;e.pos<i;)n.push(this.scalar(e,t,r))}else n.push(this.scalar(e,t,r))}else o[c]=this.scalar(e,t,r);break;
vendor: 4,988 bytes, line 461
461case`message`:if(s){let t=o[c],r=a.T().internalBinaryRead(e,e.uint32(),n);t.push(r)}else o[c]=a.T().internalBinaryRead(e,e.uint32(),n,o[c]);break;case`map`:let[l,u]=this.mapEntry(a,e,n);o[c][l]=u;break}}}mapEntry(e,t,n){let r=t.uint32(),i=t.pos+r,a,o;for(;t.pos<i;){let[r,i]=t.tag();switch(r){case 1:a=e.K==V.BOOL?t.bool().toString():this.scalar(t,e.K,lE.STRING);break;case 2:switch(e.V.kind){case`scalar`:o=this.scalar(t,e.V.T,e.V.L);break;case`enum`:o=t.int32();break;case`message`:o=e.V.T().internalBinaryRead(t,t.uint32(),n);break}break;default:throw Error(`Unknown field ${r} (wire type ${i}) in map entry for ${this.info.typeName}#${e.name}`)}}if(a===void 0){let t=fE(e.K);a=e.K==V.BOOL?t.toString():t}if(o===void 0)switch(e.V.kind){case`scalar`:o=fE(e.V.T,e.V.L);break;case`enum`:o=0;break;case`message`:o=e.V.T().create();break}return[a,o]}scalar(e,t,n){switch(t){case V.INT32:return e.int32();case V.STRING:return e.string();case V.BOOL:return e.bool();case V.DOUBLE:return e.double();case V.FLOAT:return e.float();case V.INT64:return dE(e.int64(),n);case V.UINT64:return dE(e.uint64(),n);case V.FIXED64:return dE(e.fixed64(),n);case V.FIXED32:return e.fixed32();case V.BYTES:return e.bytes();case V.UINT32:return e.uint32();case V.SFIXED32:return e.sfixed32();case V.SFIXED64:return dE(e.sfixed64(),n);case V.SINT32:return e.sint32();case V.SINT64:return dE(e.sint64(),n)}}},Gre=class{constructor(e){this.info=e}prepare(){if(!this.fields){let e=this.info.fields?this.info.fields.concat():[];this.fields=e.sort((e,t)=>e.no-t.no)}}write(e,t,n){this.prepare();for(let r of this.fields){let i,a,o=r.repeat,s=r.localName;if(r.oneof){let t=e[r.oneof];if(t.oneofKind!==s)continue;i=t[s],a=!0}else i=e[s],a=!1;switch(r.kind){case`scalar`:case`enum`:let e=r.kind==`enum`?V.INT32:r.T;if(o)if(eE(Array.isArray(i)),o==uE.PACKED)this.packed(t,e,r.no,i);else for(let n of i)this.scalar(t,e,r.no,n,!0);else i===void 0?eE(r.opt):this.scalar(t,e,r.no,i,a||r.opt);break;case`message`:if(o){eE(Array.isArray(i));for(let e of i)this.message(t,n,r.T(),r.no,e)}else this.message(t,n,r.T(),r.no,i);break;case`map`:eE(typeof i==`object`&&!!i);for(let[e,a]of Object.entries(i))this.mapEntry(t,n,r,e,a);break}}let r=n.writeUnknownFields;r!==!1&&(r===!0?RT.onWrite:r)(this.info.typeName,e,t)}mapEntry(e,t,n,r,i){e.tag(n.no,zT.LengthDelimited),e.fork();let a=r;switch(n.K){case V.INT32:case V.FIXED32:case V.UINT32:case V.SFIXED32:case V.SINT32:a=Number.parseInt(r);break;case V.BOOL:eE(r==`true`||r==`false`),a=r==`true`;break}switch(this.scalar(e,n.K,1,a,!0),n.V.kind){case`scalar`:this.scalar(e,n.V.T,2,i,!0);break;case`enum`:this.scalar(e,V.INT32,2,i,!0);break;case`message`:this.message(e,t,n.V.T(),2,i);break}e.join()}message(e,t,n,r,i){i!==void 0&&(n.internalBinaryWrite(i,e.tag(r,zT.LengthDelimited).fork(),t),e.join())}scalar(e,t,n,r,i){let[a,o,s]=this.scalarInfo(t,r);(!s||i)&&(e.tag(n,a),e[o](r))}packed(e,t,n,r){if(!r.length)return;eE(t!==V.BYTES&&t!==V.STRING),e.tag(n,zT.LengthDelimited),e.fork();let[,i]=this.scalarInfo(t);for(let t=0;t<r.length;t++)e[i](r[t]);e.join()}scalarInfo(e,t){let n=zT.Varint,r,i=t===void 0,a=t===0;switch(e){case V.INT32:r=`int32`;break;case V.STRING:a=i||!t.length,n=zT.LengthDelimited,r=`string`;break;case V.BOOL:a=t===!1,r=`bool`;break;case V.UINT32:r=`uint32`;break;case V.DOUBLE:n=zT.Bit64,r=`double`;break;case V.FLOAT:n=zT.Bit32,r=`float`;break;case V.INT64:a=i||QT.from(t).isZero(),r=`int64`;break;case V.UINT64:a=i||ZT.from(t).isZero(),r=`uint64`;break;case V.FIXED64:a=i||ZT.from(t).isZero(),n=zT.Bit64,r=`fixed64`;break;case V.BYTES:a=i||!t.byteLength,n=zT.LengthDelimited,r=`bytes`;break;case V.FIXED32:n=zT.Bit32,r=`fixed32`;break;case V.SFIXED32:n=zT.Bit32,r=`sfixed32`;break;case V.SFIXED64:a=i||QT.from(t).isZero(),n=zT.Bit64,r=`sfixed64`;break;case V.SINT32:r=`sint32`;break;case V.SINT64:a=i||QT.from(t).isZero(),r=`sint64`;break}return[n,r,i||a]}};function Kre(e){let t=e.messagePrototype?Object.create(e.messagePrototype):Object.defineProperty({},sE,{value:e});for(let n of e.fields){let e=n.localName;if(!n.opt)if(n.oneof)t[n.oneof]={oneofKind:void 0};else if(n.repeat)t[e]=[];else switch(n.kind){case`scalar`:t[e]=fE(n.T,n.L);break;case`enum`:t[e]=0;break;case`map`:t[e]={};break}}return t}function pE(e,t,n){let r,i=n,a;for(let n of e.fields){let e=n.localName;if(n.oneof){let o=i[n.oneof];if(o?.oneofKind==null)continue;if(r=o[e],a=t[n.oneof],a.oneofKind=o.oneofKind,r==null){delete a[e];continue}}else if(r=i[e],a=t,r==null)continue;switch(n.repeat&&(a[e].length=r.length),n.kind){case`scalar`:case`enum`:if(n.repeat)for(let t=0;t<r.length;t++)a[e][t]=r[t];else a[e]=r;break;case`message`:let t=n.T();if(n.repeat)for(let n=0;n<r.length;n++)a[e][n]=t.create(r[n]);else a[e]===void 0?a[e]=t.create(r):t.mergePartial(a[e],r);break;case`map`:switch(n.V.kind){case`scalar`:case`enum`:Object.assign(a[e],r);break;case`message`:let t=n.V.T();for(let n of Object.keys(r))a[e][n]=t.create(r[n]);break}break}}}function qre(e,t,n){if(t===n)return!0;
461if(!t||!n)return!1;for(let r of e.fields){let e=r.localName,i=r.oneof?t[r.oneof][e]:t[e],a=r.oneof?n[r.oneof][e]:n[e];switch(r.kind){case`enum`:case`scalar`:let e=r.kind==`enum`?V.INT32:r.T;if(!(r.repeat?gE(e,i,a):hE(e,i,a)))return!1;break;case`map`:if(!(r.V.kind==`message`?_E(r.V.T(),mE(i),mE(a)):gE(r.V.kind==`enum`?V.INT32:r.V.T,mE(i),mE(a))))return!1;break;case`message`:let t=r.T();if(!(r.repeat?_E(t,i,a):t.equals(i,a)))return!1;break}}return!0}var mE=Object.values;function hE(e,t,n){if(t===n)return!0;if(e!==V.BYTES)return!1;let r=t,i=n;if(r.length!==i.length)return!1;for(let e=0;e<r.length;e++)if(r[e]!=i[e])return!1;return!0}function gE(e,t,n){if(t.length!==n.length)return!1;for(let r=0;r<t.length;r++)if(!hE(e,t[r],n[r]))return!1;return!0}function _E(e,t,n){if(t.length!==n.length)return!1;for(let r=0;r<t.length;r++)if(!e.equals(t[r],n[r]))return!1;return!0}var vE=Object.getOwnPropertyDescriptors(Object.getPrototypeOf({})),Jre=vE[sE]={},H=class{constructor(e,t,n){this.defaultCheckDepth=16,this.typeName=e,this.fields=t.map(zre),this.options=n??{},Jre.value=this,this.messagePrototype=Object.create(null,vE),this.refTypeCheck=new Vre(this),this.refJsonReader=new Hre(this),this.refJsonWriter=new Ure(this),this.refBinReader=new Wre(this),this.refBinWriter=new Gre(this)}create(e){let t=Kre(this);return e!==void 0&&pE(this,t,e),t}clone(e){let t=this.create();return pE(this,t,e),t}equals(e,t){return qre(this,e,t)}is(e,t=this.defaultCheckDepth){return this.refTypeCheck.is(e,t,!1)}isAssignable(e,t=this.defaultCheckDepth){return this.refTypeCheck.is(e,t,!0)}mergePartial(e,t){pE(this,e,t)}fromBinary(e,t){let n=Ere(t);return this.internalBinaryRead(n.readerFactory(e),e.byteLength,n)}fromJson(e,t){return this.internalJsonRead(e,Ire(t))}fromJsonString(e,t){let n=JSON.parse(e);return this.fromJson(n,t)}toJson(e,t){return this.internalJsonWrite(e,Lre(t))}toJsonString(e,t){let n=this.toJson(e,t);return JSON.stringify(n,null,t?.prettySpaces??0)}toBinary(e,t){let n=Pre(t);return this.internalBinaryWrite(e,n.writerFactory(),n).finish()}internalJsonRead(e,t,n){if(typeof e==`object`&&e&&!Array.isArray(e)){let r=n??this.create();return this.refJsonReader.read(e,r,t),r}throw Error(`Unable to parse message ${this.typeName} from JSON ${PT(e)}.`)}internalJsonWrite(e,t){return this.refJsonWriter.write(e,t)}internalBinaryWrite(e,t,n){return this.refBinWriter.write(e,t,n),t}internalBinaryRead(e,t,n,r){let i=r??this.create();return this.refBinReader.read(e,i,n,t),i}};function Yre(e,t){let n=e;return n.service=t,n.localName=n.localName??cE(n.name),n.serverStreaming=!!n.serverStreaming,n.clientStreaming=!!n.clientStreaming,n.options=n.options??{},n.idempotency=n.idempotency??void 0,n}var Xre=class{constructor(e,t,n){this.typeName=e,this.methods=t.map(e=>Yre(e,this)),this.options=n??{}}},yE=class extends Error{constructor(e,t=`UNKNOWN`,n){super(e),this.name=`RpcError`,Object.setPrototypeOf(this,new.target.prototype),this.code=t,this.meta=n??{}}toString(){let e=[this.name+`: `+this.message];this.code&&(e.push(``),e.push(`Code: `+this.code)),this.serviceName&&this.methodName&&e.push(`Method: `+this.serviceName+`/`+this.methodName);let t=Object.entries(this.meta);if(t.length){e.push(``),e.push(`Meta:`);for(let[n,r]of t)e.push(`  ${n}: ${r}`)}return e.join(`
462`)}};function Zre(e,t){if(!t)return e;let n={};bE(e,n),bE(t,n);for(let r of Object.keys(t)){let i=t[r];switch(r){case`jsonOptions`:n.jsonOptions=Rre(e.jsonOptions,n.jsonOptions);break;case`binaryOptions`:n.binaryOptions=Sre(e.binaryOptions,n.binaryOptions);break;case`meta`:n.meta={},bE(e.meta,n.meta),bE(t.meta,n.meta);break;case`interceptors`:n.interceptors=e.interceptors?e.interceptors.concat(i):i.concat();break}}return n}function bE(e,t){if(!e)return;let n=t;for(let[t,r]of Object.entries(e))r instanceof Date?n[t]=new Date(r.getTime()):Array.isArray(r)?n[t]=r.concat():n[t]=r}var xE;(function(e){e[e.PENDING=0]=`PENDING`,e[e.REJECTED=1]=`REJECTED`,e[e.RESOLVED=2]=`RESOLVED`})(xE||={});var SE=class{constructor(e=!0){this._state=xE.PENDING,this._promise=new Promise((e,t)=>{this._resolve=e,this._reject=t}),e&&this._promise.catch(e=>{})}get state(){return this._state}get promise(){return this._promise}resolve(e){if(this.state!==xE.PENDING)throw Error(`cannot resolve ${xE[this.state].toLowerCase()}`);this._resolve(e),this._state=xE.RESOLVED}reject(e){if(this.state!==xE.PENDING)throw Error(`cannot reject ${xE[this.state].toLowerCase()}`);this._reject(e),this._state=xE.REJECTED}resolvePending(e){this._state===xE.PENDING&&this.resolve(e)}rejectPending(e){this._state===xE.PENDING&&this.reject(e)}},Qre=function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})},$re=class{constructor(e,t,n,r,i,a,o){this.method=e,this.requestHeaders=t,this.request=n,this.headers=r,this.response=i,this.status=a,this.trailers=o}then(e,t){return this.promiseFinished().then(t=>e?Promise.resolve(e(t)):t,e=>t?Promise.resolve(t(e)):Promise.reject(e))}promiseFinished(){return Qre(this,void 0,void 0,function*(){let[e,t,n,r]=yield Promise.all([this.headers,this.response,this.status,this.trailers]);return{method:this.method,requestHeaders:this.requestHeaders,request:this.request,headers:e,response:t,status:n,trailers:r}})}};function CE(e,t,n,r,i){if(e==`unary`){let e=(e,n,r)=>t.unary(e,n,r);for(let t of(r.interceptors??[]).filter(e=>e.interceptUnary).reverse()){let n=e;e=(e,r,i)=>t.interceptUnary(n,e,r,i)}return e(n,i,r)}if(e==`serverStreaming`){let e=(e,n,r)=>t.serverStreaming(e,n,r);for(let t of(r.interceptors??[]).filter(e=>e.interceptServerStreaming).reverse()){let n=e;e=(e,r,i)=>t.interceptServerStreaming(n,e,r,i)}return e(n,i,r)}
462if(e==`clientStreaming`){let e=(e,n)=>t.clientStreaming(e,n);for(let t of(r.interceptors??[]).filter(e=>e.interceptClientStreaming).reverse()){let n=e;e=(e,r)=>t.interceptClientStreaming(n,e,r)}return e(n,r)}if(e==`duplex`){let e=(e,n)=>t.duplex(e,n);for(let t of(r.interceptors??[]).filter(e=>e.interceptDuplex).reverse()){let n=e;e=(e,r)=>t.interceptDuplex(n,e,r)}return e(n,r)}Ore(e)}var wE;(function(e){e[e.cancelled=0]=`cancelled`,e[e.unknown=1]=`unknown`,e[e.invalid_argument=2]=`invalid_argument`,e[e.malformed=3]=`malformed`,e[e.deadline_exceeded=4]=`deadline_exceeded`,e[e.not_found=5]=`not_found`,e[e.bad_route=6]=`bad_route`,e[e.already_exists=7]=`already_exists`,e[e.permission_denied=8]=`permission_denied`,e[e.unauthenticated=9]=`unauthenticated`,e[e.resource_exhausted=10]=`resource_exhausted`,e[e.failed_precondition=11]=`failed_precondition`,e[e.aborted=12]=`aborted`,e[e.out_of_range=13]=`out_of_range`,e[e.unimplemented=14]=`unimplemented`,e[e.internal=15]=`internal`,e[e.unavailable=16]=`unavailable`,e[e.dataloss=17]=`dataloss`})(wE||={});function eie(e,t,n){if(n)for(let[t,r]of Object.entries(n))if(typeof r==`string`)e.append(t,r);else for(let n of r)e.append(t,n);return e.set(`Content-Type`,t?`application/json`:`application/protobuf`),e.set(`Accept`,t?`application/json`:`application/protobuf, application/json`),e}function tie(e){if(!FT(e)||typeof e.code!=`string`||typeof e.msg!=`string`)return new yE(`cannot read twirp error response`,wE[wE.internal]);let t={};if(FT(e.meta))for(let[n,r]of Object.entries(e.meta))typeof r==`string`&&(t[n]=r);return new yE(e.msg,e.code,t)}function nie(e){let t={};return e.forEach((e,n)=>{n.toLowerCase()!==`content-type`&&n.toLowerCase()!==`content-length`&&(t.hasOwnProperty(n)?t[n].push(e):t[n]=e)}),t}var rie=class{constructor(e){this.defaultOptions=e}mergeOptions(e){return Zre(this.defaultOptions,e)}unary(e,t,n){let r=n,i=this.makeUrl(e,r),a=r.fetchInit??{},o=r.sendJson?e.I.toJsonString(t,r.jsonOptions):e.I.toBinary(t,r.binaryOptions),s=new SE,c=new SE,l=new SE,u=new SE;return globalThis.fetch(i,Object.assign(Object.assign({},a),{method:`POST`,headers:eie(new globalThis.Headers,!!r.sendJson,r.meta),body:o,signal:n.abort??null})).then(t=>{s.resolve(nie(t.headers));let n;try{n=t.type}catch{}switch(n){case`error`:case`opaque`:case`opaqueredirect`:throw new yE(`fetch response type ${t.type}`,wE[wE.unknown])}return t.ok?r.sendJson?t.json().then(t=>e.O.fromJson(t,r.jsonOptions),()=>{throw new yE(`unable to read response body as json`,wE[wE.dataloss])}):t.arrayBuffer().then(t=>e.O.fromBinary(new Uint8Array(t),r.binaryOptions),()=>{throw new yE(`unable to read response body`,wE[wE.dataloss])}):t.json().then(e=>{throw tie(e)},()=>{throw new yE(`received HTTP `+t.status+`, unable to read response body as json`,wE[wE.internal])})},e=>{throw e instanceof Error&&e.name===`AbortError`?new yE(e.message,wE[wE.cancelled]):new yE(e instanceof Error?e.message:e)}).then(e=>{c.resolve(e),l.resolve({code:`OK`,detail:``}),u.resolve({})}).catch(t=>{let n=t instanceof yE?t:new yE(t instanceof Error?t.message:t,wE[wE.internal]);
462n.methodName=e.name,n.serviceName=e.service.typeName,s.rejectPending(n),c.rejectPending(n),l.rejectPending(n),u.rejectPending(n)}),new $re(e,r.meta??{},t,s.promise,c.promise,l.promise,u.promise)}makeUrl(e,t){let n=t.baseUrl;n.endsWith(`/`)&&(n=n.substring(0,n.length-1));let r=e.name;return t.useProtoMethodName!==!0&&(r=cE(r),r=r.substring(0,1).toUpperCase()+r.substring(1)),`${n}/${e.service.typeName}/${r}`}clientStreaming(e){let t=new yE(`Client streaming is not supported by Twirp`,wE[wE.unimplemented]);throw t.methodName=e.name,t.serviceName=e.service.typeName,t}duplex(e){let t=new yE(`Duplex streaming is not supported by Twirp`,wE[wE.unimplemented]);throw t.methodName=e.name,t.serviceName=e.service.typeName,t}serverStreaming(e){let t=new yE(`Server streaming is not supported by Twirp`,wE[wE.unimplemented]);throw t.methodName=e.name,t.serviceName=e.service.typeName,t}},TE=()=>typeof navigator>`u`?!1:navigator.product?.toLowerCase()===`reactnative`,EE;(function(e){e[e.trace=0]=`trace`,e[e.debug=1]=`debug`,e[e.info=2]=`info`,e[e.warn=3]=`warn`,e[e.error=4]=`error`})(EE||={});var iie=(e,t,...n)=>{let r;switch(e){case`error`:if(TE()){t=`ERROR: ${t}`,r=console.info;break}r=console.error;break;case`warn`:if(TE()){t=`WARN: ${t}`,r=console.info;break}r=console.warn;break;case`info`:r=console.info;break;case`trace`:r=console.trace;break;default:r=console.log;break}r(t,...n)},DE=`info`,OE=iie,aie=()=>{let e=new Map([[`default`,OE]]),t=new Map([[`default`,DE]]),n=(r,i={})=>{let a=(i.tags??[]).filter(Boolean).join(`,`),o=n=>(i,...o)=>{let s=t.get(r)??t.get(`default`);EE[n]>=EE[s]&&(e.get(r)??e.get(`default`))(n,`[${r}]${a.length?`(${a})`:``}: ${i}`,...o)};return{withExtraTags:(...e)=>n(r,{...i,tags:i.tags?i.tags.concat(e):e}),getLogLevel:()=>t.get(r)??t.get(`default`),error:o(`error`),trace:o(`trace`),debug:o(`debug`),info:o(`info`),warn:o(`warn`)}};return{getLogger:n,configureLoggers:n=>{for(let r in n){let i=n[r];i.sink?e.set(r,i.sink):i.sink===null&&r!==`default`&&e.delete(r),i.level?t.set(r,i.level):i.level===null&&r!==`default`&&t.delete(r)}},restoreDefaults:()=>{e.clear(),t.clear(),e.set(`default`,OE),t.set(`default`,DE)}}},kE=n(((e,t)=>{var n=t.exports={v:[{name:`version`,reg:/^(\d*)$/}],o:[{name:`origin`,reg:/^(\S*) (\d*) (\d*) (\S*) IP(\d) (\S*)/,names:[`username`,`sessionId`,`sessionVersion`,`netType`,`ipVer`,`address`],format:`%s %s %d %s IP%d %s`}],s:[{name:`name`}],i:[{name:`description`}],u:[{name:`uri`}],e:[{name:`email`}],p:[{name:`phone`}],z:[{name:`timezones`}],r:[{name:`repeats`}],t:[{name:`timing`,reg:/^(\d*) (\d*)/,names:[`start`,`stop`],format:`%d %d`}],c:[{name:`connection`,reg:/^IN IP(\d) (\S*)/,names:[`version`,`ip`],format:`IN IP%d %s`}],b:[{push:`bandwidth`,reg:/^(TIAS|AS|CT|RR|RS):(\d*)/,names:[`type`,`limit`],format:`%s:%s`}],m:[{reg:/^(\w*) (\d*) ([\w/]*)(?: (.*))?/,names:[`type`,`port`,`protocol`,`payloads`],format:`%s %d %s %s`}],a:[{push:`rtp`,reg:/^rtpmap:(\d*) ([\w\-.]*)(?:\s*\/(\d*)(?:\s*\/(\S*))?)?/,names:[`payload`,`codec`,`rate`,`encoding`],format:function(e){return e.encoding?`rtpmap:%d %s/%s/%s`:e.rate?`rtpmap:%d %s/%s`:`rtpmap:%d %s`}},{push:`fmtp`,reg:/^fmtp:(\d*) ([\S| ]*)/,names:[`payload`,`config`],format:`fmtp:%d %s`},{name:`control`,reg:/^control:(.*)/,format:`control:%s`},{name:`rtcp`,reg:/^rtcp:(\d*)(?: (\S*) IP(\d) (\S*))?/,names:[`port`,`netType`,`ipVer`,`address`],format:function(e){return e.address==null?`rtcp:%d`:`rtcp:%d %s IP%d %s`}},{push:`rtcpFbTrrInt`,reg:/^rtcp-fb:(\*|\d*) trr-int (\d*)/,names:[`payload`,`value`],format:`rtcp-fb:%s trr-int %d`},{push:`rtcpFb`,reg:/^rtcp-fb:(\*|\d*) ([\w-_]*)(?: ([\w-_]*))?/,names:[`payload`,`type`,`subtype`],format:function(e){return e.subtype==null?`rtcp-fb:%s %s`:`rtcp-fb:%s %s %s`}},{push:`ext`,reg:/^extmap:(\d+)(?:\/(\w+))?(?: (urn:ietf:params:rtp-hdrext:encrypt))? (\S*)(?: (\S*))?/,names:[`value`,`direction`,`encrypt-uri`,`uri`,`config`],format:function(e){return`extmap:%d`+(e.direction?`/%s`:`%v`)+(e[`encrypt-uri`]?` %s`:`%v`)+` %s`+(e.config?` %s`:``)}},{name:`extmapAllowMixed`,reg:/^(extmap-allow-mixed)/},{push:`crypto`,reg:/^crypto:(\d*) ([\w_]*) (\S*)(?: (\S*))?/,names:[`id`,`suite`,`config`,`sessionConfig`],format:function(e){return e.sessionConfig==null?`crypto:%d %s %s`:`crypto:%d %s %s %s`}},{name:`setup`,reg:/^setup:(\w*)/,format:`setup:%s`},{name:`connectionType`,reg:/^connection:(new|existing)/,format:`connection:%s`},{name:`mid`,reg:/^mid:([^\s]*)/,format:`mid:%s`},{name:`msid`,reg:/^msid:(.*)/,format:`msid:%s`},{name:`ptime`,reg:/^ptime:(\d*(?:\.\d*)*)/,format:`ptime:%d`},{name:`maxptime`,reg:/^maxptime:(\d*(?:\.\d*)*)/,format:`maxptime:%d`},{name:`direction`,reg:/^(sendrecv|recvonly|sendonly|inactive)/},{name:`icelite`,reg:/^(ice-lite)/},{name:`iceUfrag`,reg:/^ice-ufrag:(\S*)/,format:`ice-ufrag:%s`},{name:`icePwd`,reg:/^ice-pwd:(\S*)/,format:`ice-pwd:%s`},{name:`fingerprint`,reg:/^fingerprint:(\S*) (\S*)/,names:[`type`,`hash`],format:`fingerprint:%s %s`},{push:`candidates`,reg:/^candidate:(\S*) (\d*) (\S*) (\d*) (\S*) (\d*) typ (\S*)(?: raddr (\S*) rport (\d*))?(?: tcptype (\S*))?(?: generation (\d*))?(?: network-id (\d*))?(?: network-cost (\d*))?/,names:[`foundation`,`component`,`transport`,`priority`,`ip`,`port`,`type`,`raddr`,`rport`,`tcptype`,`generation`,`network-id`,`network-cost`],format:function(e){var t=`candidate:%s %d %s %d %s %d typ %s`;return t+=e.raddr==null?`%v%v`:` raddr %s rport %d`,t+=e.tcptype==null?`%v`:` tcptype %s`,e.generation!=null&&(t+=` generation %d`),t+=e[`network-id`]==null?`%v`:` network-id %d`,t+=e[`network-cost`]==null?`%v`:` network-cost %d`,t}},{name:`endOfCandidates`,reg:/^(end-of-candidates)/},{name:`remoteCandidates`,reg:/^remote-candidates:(.*)/,format:`remote-candidates:%s`},{name:`iceOptions`,reg:/^ice-options:(\S*)/,format:`ice-options:%s`},{push:`ssrcs`,reg:/^ssrc:(\d*) ([\w_-]*)(?::(.*))?/,names:[`id`,`attribute`,`value`],format:function(e){var t=`ssrc:%d`;return e.attribute!=null&&(t+=` %s`,e.value!=null&&(t+=`:%s`)),t}},{push:`ssrcGroups`,reg:/^ssrc-group:([\x21\x23\x24\x25\x26\x27\x2A\x2B\x2D\x2E\w]*) (.*)/,names:[`semantics`,`ssrcs`],format:`ssrc-group:%s %s`},{name:`msidSemantic`,reg:/^msid-semantic:\s?(\w*) (\S*)/,names:[`semantic`,`token`],format:`msid-semantic: %s %s`},{push:`groups`,reg:/^group:(\w*) (.*)/,names:[`type`,`mids`],format:`group:%s %s`},{name:`rtcpMux`,reg:/^(rtcp-mux)/},{name:`rtcpRsize`,reg:/^(rtcp-rsize)/},{name:`sctpmap`,reg:/^sctpmap:([\w_/]*) (\S*)(?: (\S*))?/,names:[`sctpmapNumber`,`app`,`maxMessageSize`],format:function(e){return e.maxMessageSize==null?`sctpmap:%s %s`:`sctpmap:%s %s %s`}},{name:`xGoogleFlag`,reg:/^x-google-flag:([^\s]*)/,format:`x-google-flag:%s`},{push:`rids`,reg:/^rid:([\d\w]+) (\w+)(?: ([\S| ]*))?/,names:[`id`,`direction`,`params`],format:function(e){return e.params?`rid:%s %s %s`:`rid:%s %s`}},{push:`imageattrs`,reg:RegExp(`^imageattr:(\\d+|\\*)[\\s\\t]+(send|recv)[\\s\\t]+(\\*|\\[\\S+\\](?:[\\s\\t]+\\[\\S+\\])*)(?:[\\s\\t]+(recv|send)[\\s\\t]+(\\*|\\[\\S+\\](?:[\\s\\t]+\\[\\S+\\])*))?`),names:[`pt`,`dir1`,`attrs1`,`dir2`,`attrs2`],format:function(e){return`imageattr:%s %s %s`+(e.dir2?` %s %s`:``)}}
vendor: 4,294 bytes, line 462
462,{name:`simulcast`,reg:RegExp(`^simulcast:(send|recv) ([a-zA-Z0-9\\-_~;,]+)(?:\\s?(send|recv) ([a-zA-Z0-9\\-_~;,]+))?$`),names:[`dir1`,`list1`,`dir2`,`list2`],format:function(e){return`simulcast:%s %s`+(e.dir2?` %s %s`:``)}},{name:`simulcast_03`,reg:/^simulcast:[\s\t]+([\S+\s\t]+)$/,names:[`value`],format:`simulcast: %s`},{name:`framerate`,reg:/^framerate:(\d+(?:$|\.\d+))/,format:`framerate:%s`},{name:`sourceFilter`,reg:/^source-filter: *(excl|incl) (\S*) (IP4|IP6|\*) (\S*) (.*)/,names:[`filterMode`,`netType`,`addressTypes`,`destAddress`,`srcList`],format:`source-filter: %s %s %s %s %s`},{name:`bundleOnly`,reg:/^(bundle-only)/},{name:`label`,reg:/^label:(.+)/,format:`label:%s`},{name:`sctpPort`,reg:/^sctp-port:(\d+)$/,format:`sctp-port:%s`},{name:`maxMessageSize`,reg:/^max-message-size:(\d+)$/,format:`max-message-size:%s`},{push:`tsRefClocks`,reg:/^ts-refclk:([^\s=]*)(?:=(\S*))?/,names:[`clksrc`,`clksrcExt`],format:function(e){return`ts-refclk:%s`+(e.clksrcExt==null?``:`=%s`)}},{name:`mediaClk`,reg:/^mediaclk:(?:id=(\S*))? *([^\s=]*)(?:=(\S*))?(?: *rate=(\d+)\/(\d+))?/,names:[`id`,`mediaClockName`,`mediaClockValue`,`rateNumerator`,`rateDenominator`],format:function(e){var t=`mediaclk:`;return t+=e.id==null?`%v%s`:`id=%s %s`,t+=e.mediaClockValue==null?``:`=%s`,t+=e.rateNumerator==null?``:` rate=%s`,t+=e.rateDenominator==null?``:`/%s`,t}},{name:`keywords`,reg:/^keywds:(.+)$/,format:`keywds:%s`},{name:`content`,reg:/^content:(.+)/,format:`content:%s`},{name:`bfcpFloorCtrl`,reg:/^floorctrl:(c-only|s-only|c-s)/,format:`floorctrl:%s`},{name:`bfcpConfId`,reg:/^confid:(\d+)/,format:`confid:%s`},{name:`bfcpUserId`,reg:/^userid:(\d+)/,format:`userid:%s`},{name:`bfcpFloorId`,reg:/^floorid:(.+) (?:m-stream|mstrm):(.+)/,names:[`id`,`mStream`],format:`floorid:%s mstrm:%s`},{push:`invalid`,names:[`value`]}]};Object.keys(n).forEach(function(e){n[e].forEach(function(e){e.reg||=/(.*)/,e.format||=`%s`})})})),oie=n((e=>{var t=function(e){return String(Number(e))===e?Number(e):e},n=function(e,n,r,i){if(i&&!r)n[i]=t(e[1]);else for(var a=0;a<r.length;a+=1)e[a+1]!=null&&(n[r[a]]=t(e[a+1]))},r=function(e,t,r){var i=e.name&&e.names;e.push&&!t[e.push]?t[e.push]=[]:i&&!t[e.name]&&(t[e.name]={});var a=e.push?{}:i?t[e.name]:t;n(r.match(e.reg),a,e.names,e.name),e.push&&t[e.push].push(a)},i=kE(),a=RegExp.prototype.test.bind(/^([a-z])=(.*)/);e.parse=function(e){var t={},n=[],o=t;return e.split(/(\r\n|\r|\n)/).filter(a).forEach(function(e){var t=e[0],a=e.slice(2);t===`m`&&(n.push({rtp:[],fmtp:[]}),o=n[n.length-1]);for(var s=0;s<(i[t]||[]).length;s+=1){var c=i[t][s];if(c.reg.test(a))return r(c,o,a)}}),t.media=n,t};var o=function(e,n){var r=n.split(/=(.+)/,2);return r.length===2?e[r[0]]=t(r[1]):r.length===1&&n.length>1&&(e[r[0]]=void 0),e};e.parseParams=function(e){return e.split(/;\s?/).reduce(o,{})},e.parseFmtpConfig=e.parseParams,e.parsePayloads=function(e){return e.toString().split(` `).map(Number)},e.parseRemoteCandidates=function(e){for(var n=[],r=e.split(` `).map(t),i=0;i<r.length;i+=3)n.push({component:r[i],ip:r[i+1],port:r[i+2]});return n},e.parseImageAttributes=function(e){return e.split(` `).map(function(e){return e.substring(1,e.length-1).split(`,`).reduce(o,{})})},e.parseSimulcastStreamList=function(e){return e.split(`;`).map(function(e){return e.split(`,`).map(function(e){var n,r=!1;return e[0]===`~`?(n=t(e.substring(1,e.length)),r=!0):n=t(e),{scid:n,paused:r}})})}})),sie=n(((e,t)=>{var n=kE(),r=/%[sdv%]/g,i=function(e){var t=1,n=arguments,i=n.length;return e.replace(r,function(e){if(t>=i)return e;var r=n[t];switch(t+=1,e){case`%%`:return`%`;case`%s`:return String(r);case`%d`:return Number(r);case`%v`:return``}})},a=function(e,t,n){var r=t.format instanceof Function?t.format(t.push?n:n[t.name]):t.format,a=[e+`=`+r];if(t.names)for(var o=0;o<t.names.length;o+=1){var s=t.names[o];t.name?a.push(n[t.name][s]):a.push(n[t.names[o]])}else a.push(n[t.name]);return i.apply(null,a)},o=[`v`,`o`,`s`,`i`,`u`,`e`,`p`,`c`,`b`,`t`,`r`,`z`,`a`],s=[`i`,`c`,`b`,`a`];t.exports=function(e,t){t||={},e.version??=0,e.name??=` `,e.media.forEach(function(e){e.payloads??=``});var r=t.outerOrder||o,i=t.innerOrder||s,c=[];return r.forEach(function(t){n[t].forEach(function(n){n.name in e&&e[n.name]!=null?c.push(a(t,n,e)):n.push in e&&e[n.push]!=null&&e[n.push].forEac
vendor: 24,449 bytes, lines 462-466
462h(function(e){c.push(a(t,n,e))})})}),e.media.forEach(function(e){c.push(a(`m`,n.m[0],e)),i.forEach(function(t){n[t].forEach(function(n){n.name in e&&e[n.name]!=null?c.push(a(t,n,e)):n.push in e&&e[n.push]!=null&&e[n.push].forEach(function(e){c.push(a(t,n,e))})})})}),c.join(`\r
463`)+`\r
464`}})),cie=n((e=>{var t=oie(),n=sie();kE(),e.write=n,e.parse=t.parse,e.parseParams=t.parseParams,e.parseFmtpConfig=t.parseFmtpConfig,e.parsePayloads=t.parsePayloads,e.parseRemoteCandidates=t.parseRemoteCandidates,e.parseImageAttributes=t.parseImageAttributes,e.parseSimulcastStreamList=t.parseSimulcastStreamList})),AE=function(e,t){return AE=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},AE(e,t)};function jE(e,t){if(typeof t!=`function`&&t!==null)throw TypeError(`Class extends value `+String(t)+` is not a constructor or null`);AE(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}function ME(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})}function NE(e,t){var n={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},r,i,a,o=Object.create((typeof Iterator==`function`?Iterator:Object).prototype);return o.next=s(0),o.throw=s(1),o.return=s(2),typeof Symbol==`function`&&(o[Symbol.iterator]=function(){return this}),o;function s(e){return function(t){return c([e,t])}}function c(s){if(r)throw TypeError(`Generator is already executing.`);for(;o&&(o=0,s[0]&&(n=0)),n;)try{if(r=1,i&&(a=s[0]&2?i.return:s[0]?i.throw||((a=i.return)&&a.call(i),0):i.next)&&!(a=a.call(i,s[1])).done)return a;switch(i=0,a&&(s=[s[0]&2,a.value]),s[0]){case 0:case 1:a=s;break;case 4:return n.label++,{value:s[1],done:!1};case 5:n.label++,i=s[1],s=[0];continue;case 7:s=n.ops.pop(),n.trys.pop();continue;default:if((a=n.trys,!(a=a.length>0&&a[a.length-1]))&&(s[0]===6||s[0]===2)){n=0;continue}if(s[0]===3&&(!a||s[1]>a[0]&&s[1]<a[3])){n.label=s[1];break}if(s[0]===6&&n.label<a[1]){n.label=a[1],a=s;break}if(a&&n.label<a[2]){n.label=a[2],n.ops.push(s);break}a[2]&&n.ops.pop(),n.trys.pop();continue}s=t.call(e,n)}catch(e){s=[6,e],i=0}finally{r=a=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}}function PE(e){var t=typeof Symbol==`function`&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length==`number`)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?`Object is not iterable.`:`Symbol.iterator is not defined.`)}function FE(e,t){var n=typeof Symbol==`function`&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,a=[],o;try{for(;(t===void 0||t-- >0)&&!(i=r.next()).done;)a.push(i.value)}catch(e){o={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return a}function IE(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||=Array.prototype.slice.call(t,0,r),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}function LE(e){return this instanceof LE?(this.v=e,this):new LE(e)}function lie(e,t,n){if(!Symbol.asyncIterator)throw TypeError(`Symbol.asyncIterator is not defined.`);var r=n.apply(e,t||[]),i,a=[];return i=Object.create((typeof AsyncIterator==`function`?AsyncIterator:Object).prototype),s(`next`),s(`throw`),s(`return`,o),i[Symbol.asyncIterator]=function(){return this},i;function o(e){return function(t){return Promise.resolve(t).then(e,d)}}function s(e,t){r[e]&&(i[e]=function(t){return new Promise(function(n,r){a.push([e,t,n,r])>1||c(e,t)})},t&&(i[e]=t(i[e])))}function c(e,t){try{l(r[e](t))}catch(e){f(a[0][3],e)}}function l(e){e.value instanceof LE?Promise.resolve(e.value.v).then(u,d):f(a[0][2],e)}function u(e){c(`next`,e)}function d(e){c(`throw`,e)}function f(e,t){e(t),a.shift(),a.length&&c(a[0][0],a[0][1])}}function uie(e){if(!Symbol.asyncIterator)throw TypeError(`Symbol.asyncIterator is not defined.`);var t=e[Symbol.asyncIterator],n;return t?t.call(e):(e=typeof PE==`function`?PE(e):e[Symbol.iterator](),n={},r(`next`),r(`throw`),r(`return`),n[Symbol.asyncIterator]=function(){return this},n);function r(t){n[t]=e[t]&&function(n){return new Promise(function(r,a){n=e[t](n),i(r,a,n.done,n.value)})}}function i(e,t,n,r){Promise.resolve(r).then(function(t){e({value:t,done:n})},t)}}function RE(e){return typeof e==`function`}function zE(e){var t=e(function(e){Error.call(e),e.stack=Error().stack});return t.prototype=Object.create(Error.prototype),t.prototype.constructor=t,t}var BE=zE(function(e){return function(t){e(this),this.message=t?t.length+` errors occurred during unsubscription:
465`+t.map(function(e,t){return t+1+`) `+e.toString()}).join(`
466  `):``,this.name=`UnsubscriptionError`,this.errors=t}});function VE(e,t){if(e){var n=e.indexOf(t);0<=n&&e.splice(n,1)}}var HE=function(){function e(e){this.initialTeardown=e,this.closed=!1,this._parentage=null,this._finalizers=null}return e.prototype.unsubscribe=function(){var e,t,n,r,i;if(!this.closed){this.closed=!0;var a=this._parentage;if(a)if(this._parentage=null,Array.isArray(a))try{for(var o=PE(a),s=o.next();!s.done;s=o.next())s.value.remove(this)}catch(t){e={error:t}}finally{try{s&&!s.done&&(t=o.return)&&t.call(o)}finally{if(e)throw e.error}}else a.remove(this);var c=this.initialTeardown;if(RE(c))try{c()}catch(e){i=e instanceof BE?e.errors:[e]}var l=this._finalizers;if(l){this._finalizers=null;try{for(var u=PE(l),d=u.next();!d.done;d=u.next()){var f=d.value;try{GE(f)}catch(e){i??=[],e instanceof BE?i=IE(IE([],FE(i)),FE(e.errors)):i.push(e)}}}catch(e){n={error:e}}finally{try{d&&!d.done&&(r=u.return)&&r.call(u)}finally{if(n)throw n.error}}}if(i)throw new BE(i)}},e.prototype.add=function(t){if(t&&t!==this)if(this.closed)GE(t);else{if(t instanceof e){if(t.closed||t._hasParent(this))return;t._addParent(this)}(this._finalizers=this._finalizers??[]).push(t)}},e.prototype._hasParent=function(e){var t=this._parentage;return t===e||Array.isArray(t)&&t.includes(e)},e.prototype._addParent=function(e){var t=this._parentage;this._parentage=Array.isArray(t)?(t.push(e),t):t?[t,e]:e},e.prototype._removeParent=function(e){var t=this._parentage;t===e?this._parentage=null:Array.isArray(t)&&VE(t,e)},e.prototype.remove=function(t){var n=this._finalizers;n&&VE(n,t),t instanceof e&&t._removeParent(this)},e.EMPTY=(function(){var t=new e;return t.closed=!0,t})(),e}(),UE=HE.EMPTY;function WE(e){return e instanceof HE||e&&`closed`in e&&RE(e.remove)&&RE(e.add)&&RE(e.unsubscribe)}function GE(e){RE(e)?e():e.unsubscribe()}var KE={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},qE={setTimeout:function(e,t){var n=[...arguments].slice(2),r=qE.delegate;return r?.setTimeout?r.setTimeout.apply(r,IE([e,t],FE(n))):setTimeout.apply(void 0,IE([e,t],FE(n)))},clearTimeout:function(e){return(qE.delegate?.clearTimeout||clearTimeout)(e)},delegate:void 0};function JE(e){qE.setTimeout(function(){var t=KE.onUnhandledError;if(t)t(e);else throw e})}function YE(){}var die=(function(){return XE(`C`,void 0,void 0)})();function fie(e){return XE(`E`,void 0,e)}function pie(e){return XE(`N`,e,void 0)}function XE(e,t,n){return{kind:e,value:t,error:n}}var ZE=null;function QE(e){if(KE.useDeprecatedSynchronousErrorHandling){var t=!ZE;if(t&&(ZE={errorThrown:!1,error:null}),e(),t){var n=ZE,r=n.errorThrown,i=n.error;if(ZE=null,r)throw i}}else e()}function mie(e){KE.useDeprecatedSynchronousErrorHandling&&ZE&&(ZE.errorThrown=!0,ZE.error=e)}var $E=function(e){jE(t,e);function t(t){var n=e.call(this)||this;return n.isStopped=!1,t?(n.destination=t,WE(t)&&t.add(n)):n.destination=vie,n}return t.create=function(e,t,n){return new tD(e,t,n)},t.prototype.next=function(e){this.isStopped?rD(pie(e),this):this._next(e)},t.prototype.error=function(e){this.isStopped?rD(fie(e),this):(this.isStopped=!0,this._error(e))},t.prototype.complete=function(){this.isStopped?rD(die,this):(this.isStopped=!0,this._complete())},t.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,e.prototype.unsubscribe.call(this),this.destination=null)},t.prototype._next=function(e){this.destination.next(e)},t.prototype._error=function(e){try{this.destination.error(e)}finally{this.unsubscribe()}},t.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},t}(HE),hie=Function.prototype.bind;function eD(e,t){return hie.call(e,t)}var gie=function(){function e(e){this.partialObserver=e}return e.prototype.next=function(e){var t=this.partialObserver;if(t.next)try{t.next(e)}catch(e){nD(e)}},e.prototype.error=function(e){var t=this.partialObserver;if(t.error)try{t.error(e)}catch(e){nD(e)}else nD(e)},e.prototype.complete=function(){var e=this.partialObserver;if(e.complete)try{e.complete()}catch(e){nD(e)}},e}(),tD=function(e){jE(t,e);function t(t,n,r){var i=e.call(this)||this,a;if(RE(t)||!t)a={next:t??void 0,error:n??void 0,complete:r??void 0};else{var o;i&&KE.useDeprecatedNextContext?(o=Object.create(t),o.unsubscribe=function(){return i.unsubscribe()},a={next:t.next&&eD(t.next,o),error:t.error&&eD(t.error,o),complete:t.complete&&eD(t.complete,o)}):a=t}return i.destination=new gie(a),i}return t}($E);function nD(e){KE.useDeprecatedSynchronousErrorHandling?mie(e):JE(e)}function _ie(e){throw e}function rD(e,t){var n=KE.onStoppedNotification;n&&qE.setTimeout(function(){return n(e,t)})}var vie={closed:!0,next:YE,error:_ie,complete:YE},iD=(function(){return typeof Symbol==`function`&&Symbol.observable||`@@observable`})();function aD(e){return e}function yie(e){return e.length===0?aD:e.length===1?e[0]:function(t){return e.reduce(function(e,t){return t(e)},t)}}var oD=function(){function e(e){e&&(this._subscribe=e)}return e.prototype.lift=function(t){var n=new e;return n.source=this,n.operator=t,n},e.prototype.subscribe=function(e,t,n){var r=this,i=xie(e)?e:new tD(e,t,n);return QE(function(){var e=r,t=e.operator,n=e.source;i.add(t?t.call(i,n):n?r._subscribe(i):r._trySubscribe(i))}),i},e.prototype._trySubscribe=function(e){try{return this._subscribe(e)}catch(t){e.error(t)}},e.prototype.forEach=function(e,t){var n=this;return t=sD(t),new t(function(t,r){var i=new tD({next:function(t){try{e(t)}catch(e){r(e),i.unsubscribe()}},error:r,complete:t});n.subscribe(i)})},e.prototype._subscribe=function(e){return this.source?.subscribe(e)},e.prototype[iD]=function(){return this},e.prototype.pipe=function(){return yie([...arguments])(this)},e.prototype.toPromise=function(e){var t=this;return e=sD(e),new e(function(e,n){var r;t.subscribe(function(e){return r=e},function(e){return n(e)},function(){return e(r)})})},e.create=function(t){return new e(t)},e}();function sD(e){return e??KE.Promise??Promise}function bie(e){return e&&RE(e.next)&&RE(e.error)&&RE(e.complete)}function xie(e){return e&&e instanceof $E||bie(e)&&WE(e)}function Sie(e){return RE(e?.lift)}function cD(e){return function(t){if(Sie(t))return t.lift(function(t){try{return e(t,this)}catch(e){this.error(e)}});throw TypeError(`Unable to lift unknown Observable type`)}}function lD(e,t,n,r,i){return new Cie(e,t,n,r,i)}var Cie=function(e){jE(t,e);function t(t,n,r,i,a,o){var s=e.call(this,t)||this;return s.onFinalize=a,s.shouldUnsubscribe=o,s._next=n?function(e){try{n(e)}catch(e){t.error(e)}}:e.prototype._next,s._error=i?function(e){try{i(e)}catch(e){t.error(e)}finally{this.unsubscribe()}}:e.prototype._error,s._complete=r?function(){try{r()}catch(e){t.error(e)}finally{this.unsubscribe()}}:e.prototype._complete,s}return t.prototype.unsubscribe=function(){var t;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var n=this.closed;e.prototype.unsubscribe.call(this),!n&&((t=this.onFinalize)==null||t.call(this))}},t}($E),wie=zE(function(e){return function(){e(this),this.name=`ObjectUnsubscribedError`,this.message=`object unsubscribed`}}),uD=function(e){jE(t,e);function t(){var t=e.call(this)||this;return t.closed=!1,t.currentObservers=null,t.observers=[],t.isStopped=!1,t.hasError=!1,t.thrownError=null,t}return t.prototype.lift=function(e){var t=new dD(this,this);return t.operator=e,t},t.prototype._throwIfClosed=function(){if(this.closed)throw new wie},t.prototype.next=function(e){var t=this;QE(function(){var n,r;if(t._throwIfClosed(),!t.isStopped){t.currentObservers||=Array.from(t.observers);try{for(var i=PE(t.currentObservers),a=i.next();!a.done;a=i.next())a.value.next(e)}catch(e){n={error:e}}finally{try{a&&!a.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}}})},t.prototype.error=function(e){var t=this;QE(function(){if(t._throwIfClosed(),!t.isStopped){t.hasError=t.isStopped=!0,t.thrownError=e;for(var n=t.observers;n.length;)n.shift().error(e)}})},t.prototype.complete=function(){var e=this;QE(function(){if(e._throwIfClosed(),!e.isStopped){e.isStopped=!0;for(var t=e.observers;t.length;)t.shift().complete()}})},t.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(t.prototype,`observed`,{get:function(){return this.observers?.length>0},enumerable:!1,configurable:!0}),t.prototype._trySubscribe=function(t){return this._throwIfClosed(),e.prototype._trySubscribe.call(this,t)},t.prototype._subscribe=function(e){return this._throwIfClosed(),this._checkFinalizedStatuses(e),this._innerSubscribe(e)},t.prototype._innerSubscribe=function(e){var t=this,n=this,r=n.hasError,i=n.isStopped,a=n.observers;return r||i?UE:(this.currentObservers=null,a.push(e),new HE(function(){t.currentObservers=null,VE(a,e)}))},t.prototype._checkFinalizedStatuses=function(e){var t=this,n=t.hasError,r=t.thrownError,i=t.isStopped;n?e.error(r):i&&e.complete()},t.prototype.asObservable=function(){var e=new oD;return e.source=this,e},t.create=function(e,t){return new dD(e,t)},t}(oD),dD=function(e){jE(t,e);function t(t,n){var r=e.call(this)||this;return r.destination=t,r.source=n,r}return t.prototype.next=function(e){var t,n;(n=(t=this.destination)?.next)==null||n.call(t,e)},t.prototype.error=function(e){var t,n;(n=(t=this.destination)?.error)==null||n.call(t,e)},t.prototype.complete=function(){var e,t;(t=(e=this.destination)?.complete)==null||t.call(e)},t.prototype._subscribe=function(e){return this.source?.subscribe(e)??UE},t}(uD),fD=function(e){jE(t,e);function t(t){var n=e.call(this)||this;return n._value=t,n}return Object.defineProperty(t.prototype,`value`,{get:function(){return this.getValue()},enumerable:!1,configurable:!0}),t.prototype._subscribe=function(t){var n=e.prototype._subscribe.call(this,t);return!n.closed&&t.next(this._value),n},t.prototype.getValue=function(){var e=this,t=e.hasError,n=e.thrownError,r=e._value;if(t)throw n;return this._throwIfClosed(),r},t.prototype.next=function(t){e.prototype.next.call(this,this._value=t)},t}(uD),pD={now:function(){return(pD.delegate||Date).now()},delegate:void 0},mD=function(e){jE(t,e);function t(t,n,r){t===void 0&&(t=1/0),n===void 0&&(n=1/0),r===void 0&&(r=pD);var i=e.call(this)||this;return i._bufferSize=t,i._windowTime=n,i._timestampProvider=r,i._buffer=[],i._infiniteTimeWindow=!0,i._infiniteTimeWindow=n===1/0,i._bufferSize=Math.max(1,t),i._windowTime=Math.max(1,n),i}return t.prototype.next=function(t){var n=this,r=n.isStopped,i=n._buffer,a=n._infiniteTimeWindow,o=n._timestampProvider,s=n._windowTime;r||(i.push(t),!a&&i.push(o.now()+s)),this._trimBuffer(),e.prototype.next.call(this,t)},t.prototype._subscribe=function(e){this._throwIfClosed(),this._trimBuffer();for(var t=this._innerSubscribe(e),n=this,r=n._infiniteTimeWindow,i=n._buffer.slice(),a=0;a<i.length&&!e.closed;a+=r?1:2)e.next(i[a]);return this._checkFinalizedStatuses(e),t},t.prototype._trimBuffer=function(){var e=this,t=e._bufferSize,n=e._timestampProvider,r=e._buffer,i=e._infiniteTimeWindow,a=(i?1:2)*t;if(t<1/0&&a<r.length&&r.splice(0,r.length-a),!i){for(var o=n.now(),s=0,c=1;c<r.length&&r[c]<=o;c+=2)s=c;s&&r.splice(0,s+1)}},t}(uD),Tie=function(e){jE(t,e);function t(t,n){return e.call(this)||this}return t.prototype.schedule=function(e,t){return t===void 0&&(t=0),this},t}(HE),hD={setInterval:function(e,t){var n=[...arguments].slice(2),r=hD.delegate;return r?.setInterval?r.setInterval.apply(r,IE([e,t],FE(n))):setInterval.apply(void 0,IE([e,t],FE(n)))},clearInterval:function(e){return(hD.delegate?.clearInterval||clearInterval)(e)},delegate:void 0},Eie=function(e){jE(t,e);function t(t,n){var r=e.call(this,t,n)||this;return r.scheduler=t,r.work=n,r.pending=!1,r}return t.prototype.schedule=function(e,t){if(t===void 0&&(t=0),this.closed)return this;this.state=e;var n=this.id,r=this.scheduler;return n!=null&&(this.id=this.recycleAsyncId(r,n,t)),this.pending=!0,this.delay=t,this.id=this.id??this.requestAsyncId(r,this.id,t),this},t.prototype.requestAsyncId=function(e,t,n){return n===void 0&&(n=0),hD.setInterval(e.flush.bind(e,this),n)},t.prototype.recycleAsyncId=function(e,t,n){if(n===void 0&&(n=0),n!=null&&this.delay===n&&this.pending===!1)return t;t!=null&&hD.clearInterval(t)},t.prototype.execute=function(e,t){if(this.closed)return Error(`executing a cancelled action`);this.pending=!1;var n=this._execute(e,t);if(n)return n;this.pending===!1&&this.id!=null&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},t.prototype._execute=function(e,t){var n=!1,r;try{this.work(e)}catch(e){n=!0,r=e||Error(`Scheduled action threw falsy error`)}if(n)return this.unsubscribe(),r},t.prototype.unsubscribe=function(){if(!this.closed){var t=this,n=t.id,r=t.scheduler,i=r.actions;this.work=this.state=this.scheduler=null,this.pending=!1,VE(i,this),n!=null&&(this.id=this.recycleAsyncId(r,n,null)),this.delay=null,e.prototype.unsubscribe.call(this)}},t}(Tie),gD=function(){function e(t,n){n===void 0&&(n=e.now),this.schedulerActionCtor=t,this.now=n}return e.prototype.schedule=function(e,t,n){return t===void 0&&(t=0),new this.schedulerActionCtor(this,e).schedule(n,t)},e.now=pD.now,e}(),Die=new(function(e){jE(t,e);function t(t,n){n===void 0&&(n=gD.now);var r=e.call(this,t,n)||this;return r.actions=[],r._active=!1,r}return t.prototype.flush=function(e){var t=this.actions;if(this._active){t.push(e);return}var n;this._active=!0;do if(n=e.execute(e.state,e.delay))break;while(e=t.shift());if(this._active=!1,n){for(;e=t.shift();)e.unsubscribe();throw n}},t}(gD))(Eie),Oie=new oD(function(e){return e.complete()});function kie(e){return e&&RE(e.schedule)}function _D(e){return e[e.length-1]}function Aie(e){return RE(_D(e))?e.pop():void 0}function vD(e){return kie(_D(e))?e.pop():void 0}function jie(e,t){return typeof _D(e)==`number`?e.pop():t}var yD=(function(e){return e&&typeof e.length==`number`&&typeof e!=`function`});function bD(e){return RE(e?.then)}function xD(e){return RE(e[iD])}function SD(e){return Symbol.asyncIterator&&RE(e?.[Symbol.asyncIterator])}function CD(e){return TypeError(`You provided `+(typeof e==`object`&&e?`an invalid object`:`'`+e+`'`)+` where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.`)}function Mie(){return typeof Symbol!=`function`||!Symbol.iterator?`@@iterator`:Symbol.iterator}var wD=Mie();function TD(e){return RE(e?.[wD])}function ED(e){return lie(this,arguments,function(){var t,n,r,i;return NE(this,function(a){switch(a.label){case 0:t=e.getReader(),a.label=1;case 1:a.trys.push([1,,9,10]),a.label=2;case 2:return[4,LE(t.read())];case 3:return n=a.sent(),r=n.value,i=n.done,i?[4,LE(void 0)]:[3,5];case 4:return[2,a.sent()];case 5:return[4,LE(r)];case 6:return[4,a.sent()];case 7:return a.sent(),[3,2];case 8:return[3,10];case 9:return t.releaseLock(),[7];case 10:return[2]}})})}function DD(e){return RE(e?.getReader)}function OD(e){if(e instanceof oD)return e;if(e!=null){if(xD(e))return Nie(e);if(yD(e))return Pie(e);if(bD(e))return Fie(e);if(SD(e))return kD(e);if(TD(e))return Iie(e);if(DD(e))return Lie(e)}throw CD(e)}function Nie(e){return new oD(function(t){var n=e[iD]();if(RE(n.subscribe))return n.subscribe(t);throw TypeError(`Provided object does not correctly implement Symbol.observable`)})}function Pie(e){return new oD(function(t){for(var n=0;n<e.length&&!t.closed;n++)t.next(e[n]);t.complete()})}function Fie(e){return new oD(function(t){e.then(function(e){t.closed||(t.next(e),t.complete())},function(e){return t.error(e)}).then(null,JE)})}function Iie(e){return new oD(function(t){var n,r;try{for(var i=PE(e),a=i.next();!a.done;a=i.next()){var o=a.value;if(t.next(o),t.closed)return}}catch(e){n={error:e}}finally{try{a&&!a.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}t.complete()})}function kD(e){return new oD(function(t){Rie(e,t).catch(function(e){return t.error(e)})})}function Lie(e){return kD(ED(e))}function Rie(e,t){var n,r,i,a;return ME(this,void 0,void 0,function(){var o,s;return NE(this,function(c){switch(c.label){case 0:c.trys.push([0,5,6,11]),n=uie(e),c.label=1;case 1:return[4,n.next()];case 2:if(r=c.sent(),r.done)return[3,4];if(o=r.value,t.next(o),t.closed)return[2];c.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return s=c.sent(),i={error:s},[3,11];case 6:return c.trys.push([6,,9,10]),r&&!r.done&&(a=n.return)?[4,a.call(n)]:[3,8];case 7:c.sent(),c.label=8;case 8:return[3,10];case 9:if(i)throw i.error;return[7];case 10:return[7];case 11:return t.complete(),[2]}})})}function AD(e,t,n,r,i){r===void 0&&(r=0),i===void 0&&(i=!1);var a=t.schedule(function(){n(),i?e.add(this.schedule(null,r)):this.unsubscribe()},r);if(e.add(a),!i)return a}function jD(e,t){return t===void 0&&(t=0),cD(function(n,r){n.subscribe(lD(r,function(n){return AD(r,e,function(){return r.next(n)},t)},function(){return AD(r,e,function(){return r.complete()},t)},function(n){return AD(r,e,function(){return r.error(n)},t)}))})}function MD(e,t){return t===void 0&&(t=0),cD(function(n,r){r.add(e.schedule(function(){return n.subscribe(r)},t))})}function zie(e,t){return OD(e).pipe(MD(t),jD(t))}function Bie(e,t){return OD(e).pipe(MD(t),jD(t))}function Vie(e,t){return new oD(function(n){var r=0;return t.schedule(function(){r===e.length?n.complete():(n.next(e[r++]),n.closed||this.schedule())})})}function Hie(e,t){return new oD(function(n){var r;return AD(n,t,function(){r=e[wD](),AD(n,t,function(){var e,t,i;try{e=r.next(),t=e.value,i=e.done}catch(e){n.error(e);return}i?n.complete():n.next(t)},0,!0)}),function(){return RE(r?.return)&&r.return()}})}function ND(e,t){if(!e)throw Error(`Iterable cannot be null`);return new oD(function(n){AD(n,t,function(){var r=e[Symbol.asyncIterator]();AD(n,t,function(){r.next().then(function(e){e.done?n.complete():n.next(e.value)})},0,!0)})})}function Uie(e,t){return ND(ED(e),t)}function Wie(e,t){if(e!=null){if(xD(e))return zie(e,t);if(yD(e))return Vie(e,t);if(bD(e))return Bie(e,t);if(SD(e))return ND(e,t);if(TD(e))return Hie(e,t);if(DD(e))return Uie(e,t)}throw CD(e)}function PD(e,t){return t?Wie(e,t):OD(e)}function FD(){var e=[...arguments];return PD(e,vD(e))}var Gie=zE(function(e){return function(){e(this),this.name=`EmptyError`,this.message=`no elements in sequence`}});function ID(e,t){var n=typeof t==`object`;return new Promise(function(r,i){var a=new tD({next:function(e){r(e),a.unsubscribe()},error:i,complete:function(){n?r(t.defaultValue):i(new Gie)}});e.subscribe(a)})}function LD(e,t){return cD(function(n,r){var i=0;n.subscribe(lD(r,function(n){r.next(e.call(t,n,i++))}))})}var Kie=Array.isArray;function qie(e,t){return Kie(t)?e.apply(void 0,IE([],FE(t))):e(t)}function RD(e){return LD(function(t){return qie(e,t)})}var Jie=Array.isArray,Yie=Object.getPrototypeOf,Xie=Object.prototype,Zie=Object.keys;function Qie(e){if(e.length===1){var t=e[0];if(Jie(t))return{args:t,keys:null};if($ie(t)){var n=Zie(t);return{args:n.map(function(e){return t[e]}),keys:n}}}return{args:e,keys:null}}function $ie(e){return e&&typeof e==`object`&&Yie(e)===Xie}function eae(e,t){return e.reduce(function(e,n,r){return e[n]=t[r],e},{})}function zD(){var e=[...arguments],t=vD(e),n=Aie(e),r=Qie(e),i=r.args,a=r.keys;if(i.length===0)return PD([],t);var o=new oD(tae(i,t,a?function(e){return eae(a,e)}:aD));return n?o.pipe(RD(n)):o}function tae(e,t,n){return n===void 0&&(n=aD),function(r){BD(t,function(){for(var i=e.length,a=Array(i),o=i,s=i,c=function(i){BD(t,function(){var c=PD(e[i],t),l=!1;c.subscribe(lD(r,function(e){a[i]=e,l||(l=!0,s--),s||r.next(n(a.slice()))},function(){--o||r.complete()}
466))},r)},l=0;l<i;l++)c(l)},r)}}function BD(e,t,n){e?AD(n,e,t):t()}function nae(e,t,n,r,i,a,o,s){var c=[],l=0,u=0,d=!1,f=function(){d&&!c.length&&!l&&t.complete()},p=function(e){return l<r?m(e):c.push(e)},m=function(e){a&&t.next(e),l++;var s=!1;OD(n(e,u++)).subscribe(lD(t,function(e){i?.(e),a?p(e):t.next(e)},function(){s=!0},void 0,function(){if(s)try{l--;for(var e=function(){var e=c.shift();o?AD(t,o,function(){return m(e)}):m(e)};c.length&&l<r;)e();f()}catch(e){t.error(e)}}))};return e.subscribe(lD(t,p,function(){d=!0,f()})),function(){s?.()}}function VD(e,t,n){return n===void 0&&(n=1/0),RE(t)?VD(function(n,r){return LD(function(e,i){return t(n,e,r,i)})(OD(e(n,r)))},n):(typeof t==`number`&&(n=t),cD(function(t,r){return nae(t,r,e,n)}))}function HD(e){return e===void 0&&(e=1/0),VD(aD,e)}function UD(){return HD(1)}function WD(){var e=[...arguments];return UD()(PD(e,vD(e)))}var GD=[`addListener`,`removeListener`],KD=[`addEventListener`,`removeEventListener`],qD=[`on`,`off`];function JD(e,t,n,r){if(RE(n)&&(r=n,n=void 0),r)return JD(e,t,n).pipe(RD(r));var i=FE(QD(e)?KD.map(function(r){return function(i){return e[r](t,i,n)}}):XD(e)?GD.map(YD(e,t)):ZD(e)?qD.map(YD(e,t)):[],2),a=i[0],o=i[1];if(!a&&yD(e))return VD(function(e){return JD(e,t,n)})(OD(e));if(!a)throw TypeError(`Invalid event target`);return new oD(function(e){var t=function(){var t=[...arguments];return e.next(1<t.length?t:t[0])};return a(t),function(){return o(t)}})}function YD(e,t){return function(n){return function(r){return e[n](t,r)}}}function XD(e){return RE(e.addListener)&&RE(e.removeListener)}function ZD(e){return RE(e.on)&&RE(e.off)}function QD(e){return RE(e.addEventListener)&&RE(e.removeEventListener)}function $D(e,t,n){return n?$D(e,t).pipe(RD(n)):new oD(function(n){var r=function(){var e=[...arguments];return n.next(e.length===1?e[0]:e)},i=e(r);return RE(t)?function(){return t(r,i)}:void 0})}function eO(){var e=[...arguments],t=vD(e),n=jie(e,1/0),r=e;return r.length?r.length===1?OD(r[0]):HD(n)(PD(r,t)):Oie}function tO(e,t){return RE(t)?VD(e,t,1):VD(e,1)}function nO(e,t){return t===void 0&&(t=Die),cD(function(n,r){var i=null,a=null,o=null,s=function(){if(i){i.unsubscribe(),i=null;var e=a;a=null,r.next(e)}};function c(){var n=o+e,a=t.now();if(a<n){i=this.schedule(void 0,n-a),r.add(i);return}s()}n.subscribe(lD(r,function(n){a=n,o=t.now(),i||(i=t.schedule(c,e),r.add(i))},function(){s(),r.complete()},void 0,function(){a=i=null}))})}function rO(e,t){return t===void 0&&(t=aD),e??=iO,cD(function(n,r){var i,a=!0;n.subscribe(lD(r,function(n){var o=t(n);(a||!e(i,o))&&(a=!1,i=o,r.next(n))}))})}function iO(e,t){return e===t}function aO(e,t){return rO(function(n,r){return t?t(n[e],r[e]):n[e]===r[e]})}function oO(){return cD(function(e,t){var n,r=!1;e.subscribe(lD(t,function(e){var i=n;n=e,r&&t.next([i,e]),r=!0}))})}function sO(e){e===void 0&&(e={});var t=e.connector,n=t===void 0?function(){return new uD}:t,r=e.resetOnError,i=r===void 0?!0:r,a=e.resetOnComplete,o=a===void 0?!0:a,s=e.resetOnRefCountZero,c=s===void 0?!0:s;return function(e){var t,r,a,s=0,l=!1,u=!1,d=function(){r?.unsubscribe(),r=void 0},f=function(){d(),t=a=void 0,l=u=!1},p=function(){var e=t;f(),e?.unsubscribe()};return cD(function(e,m){s++,!u&&!l&&d();var h=a??=n();m.add(function(){s--,s===0&&!u&&!l&&(r=cO(p,c))}),h.subscribe(m),!t&&s>0&&(t=new tD({next:function(e){return h.next(e)},error:function(e){u=!0,d(),r=cO(f,i,e),h.error(e)},complete:function(){l=!0,d(),r=cO(f,o),h.complete()}}),OD(e).subscribe(t))})(e)}}function cO(e,t){var n=[...arguments].slice(2);if(t===!0){e();return}if(t!==!1){var r=new tD({next:function(){r.unsubscribe(),e()}});return OD(t.apply(void 0,IE([],FE(n)))).subscribe(r)}}function lO(e,t,n){var r,i,a,o,s=!1;return e&&typeof e==`object`?(r=e.bufferSize,o=r===void 0?1/0:r,i=e.windowTime,t=i===void 0?1/0:i,a=e.refCount,s=a===void 0?!1:a,n=e.scheduler):o=e??1/0,sO({connector:function(){return new mD(o,t,n)},resetOnError:!0,resetOnComplete:!1,resetOnRefCountZero:s})}function uO(){var e=[...arguments],t=vD(e);return cD(function(n,r){(t?WD(e,n,t):WD(e,n)).subscribe(r)})}function dO(e,t){return t===void 0&&(t=!1),cD(function(n,r){var i=0;n.subscribe(lD(r,function(n){var a=e(n,i++);(a||t)&&r.next(n),!a&&r.complete()}
466))})}function fO(e,t,n){var r=RE(e)||t||n?{next:e,error:t,complete:n}:e;return r?cD(function(e,t){var n;(n=r.subscribe)==null||n.call(r);var i=!0;e.subscribe(lD(t,function(e){var n;(n=r.next)==null||n.call(r,e),t.next(e)},function(){var e;i=!1,(e=r.complete)==null||e.call(r),t.complete()},function(e){var n;i=!1,(n=r.error)==null||n.call(r,e),t.error(e)},function(){var e,t;i&&((e=r.unsubscribe)==null||e.call(r)),(t=r.finalize)==null||t.call(r)}))}):aD}var pO=n(((e,t)=>{(function(n,r){var i=`1.0.41`,a=``,o=`?`,s=`function`,c=`undefined`,l=`object`,u=`string`,d=`major`,f=`model`,p=`name`,m=`type`,h=`vendor`,g=`version`,_=`architecture`,v=`console`,y=`mobile`,b=`tablet`,x=`smarttv`,S=`wearable`,C=`embedded`,w=500,T=`Amazon`,E=`Apple`,D=`ASUS`,O=`BlackBerry`,k=`Browser`,A=`Chrome`,j=`Edge`,M=`Firefox`,N=`Google`,P=`Honor`,ee=`Huawei`,F=`Lenovo`,te=`LG`,ne=`Microsoft`,re=`Motorola`,I=`Nvidia`,ie=`OnePlus`,ae=`Opera`,oe=`OPPO`,L=`Samsung`,se=`Sharp`,ce=`Sony`,le=`Xiaomi`,ue=`Zebra`,de=`Facebook`,fe=`Chromium OS`,pe=`Mac OS`,me=` Browser`,he=function(e,t){var n={};for(var r in e)t[r]&&t[r].length%2==0?n[r]=t[r].concat(e[r]):n[r]=e[r];return n},ge=function(e){for(var t={},n=0;n<e.length;n++)t[e[n].toUpperCase()]=e[n];return t},_e=function(e,t){return typeof e===u?ve(t).indexOf(ve(e))!==-1:!1},ve=function(e){return e.toLowerCase()},ye=function(e){return typeof e===u?e.replace(/[^\d\.]/g,a).split(`.`)[0]:r},be=function(e,t){if(typeof e===u)return e=e.replace(/^\s\s*/,a),typeof t===c?e:e.substring(0,w)},xe=function(e,t){for(var n=0,i,a,o,c,u,d;n<t.length&&!u;){var f=t[n],p=t[n+1];for(i=a=0;i<f.length&&!u&&f[i];)if(u=f[i++].exec(e),u)for(o=0;o<p.length;o++)d=u[++a],c=p[o],typeof c===l&&c.length>0?c.length===2?typeof c[1]==s?this[c[0]]=c[1].call(this,d):this[c[0]]=c[1]:c.length===3?typeof c[1]===s&&!(c[1].exec&&c[1].test)?this[c[0]]=d?c[1].call(this,d,c[2]):r:this[c[0]]=d?d.replace(c[1],c[2]):r:c.length===4&&(this[c[0]]=d?c[3].call(this,d.replace(c[1],c[2])):r):this[c]=d||r;n+=2}},Se=function(e,t){for(var n in t)if(typeof t[n]===l&&t[n].length>0){for(var i=0;i<t[n].length;i++)if(_e(t[n][i],e))return n===o?r:n}else if(_e(t[n],e))return n===o?r:n;return t.hasOwnProperty(`*`)?t[`*`]:e},Ce={"1.0":`/8`,"1.2":`/1`,"1.3":`/3`,"2.0":`/412`,"2.0.2":`/416`,"2.0.3":`/417`,"2.0.4":`/419`,"?":`/`},we={ME:`4.90`,"NT 3.11":`NT3.51`,"NT 4.0":`NT4.0`,2e3:`NT 5.0`,XP:[`NT 5.1`,`NT 5.2`],Vista:`NT 6.0`,7:`NT 6.1`,8:`NT 6.2`,"8.1":`NT 6.3`,10:[`NT 6.4`,`NT 10.0`],RT:`ARM`},Te={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[g,[p,`Chrome`]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[g,[p,`Edge`]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[p,g],[/opios[\/ ]+([\w\.]+)/i],[g,[p,ae+` Mini`]],[/\bop(?:rg)?x\/([\w\.]+)/i],[g,[p,ae+` GX`]],[/\bopr\/([\w\.]+)/i],[g,[p,ae]],[/\bb[ai]*d(?:uhd|[ub]*[aekoprswx]{5,6})[\/ ]?([\w\.]+)/i],[g,[p,`Baidu`]],[/\b(?:mxbrowser|mxios|myie2)\/?([-\w\.]*)\b/i],[g,[p,`Maxthon`]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer|sleipnir)[\/ ]?([\w\.]*)/i,/(avant|iemobile|slim(?:browser|boat|jet))[\/ ]?([\d\.]*)/i,/(?:ms|\()(ie) ([\w\.]+)/i,/(flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser|qupzilla|falkon|rekonq|puffin|brave|whale(?!.+naver)|qqbrowserlite|duckduckgo|klar|helio|(?=comodo_)?dragon)\/([-\w\.]+)/i,/(heytap|ovi|115)browser\/([\d\.]+)/i,/(weibo)__([\d\.]+)/i],[p,g],[/quark(?:pc)?\/([-\w\.]+)/i],[g,[p,`Quark`]],[/\bddg\/([\w\.]+)/i],[g,[p,`DuckDuckGo`]],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[g,[p,`UC`+k]],[/microm.+\bqbcore\/([\w\.]+)/i,/\bqbcore\/([\w\.]+).+microm/i,/micromessenger\/([\w\.]+)/i],[g,[p,`WeChat`]],[/konqueror\/([\w\.]+)/i],[g,[p,`Konqueror`]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[g,[p,`IE`]],[/ya(?:search)?browser\/([\w\.]+)/i],[g,[p,`Yandex`]],[/slbrowser\/([\w\.]+)/i],[g,[p,`Smart Lenovo `+k]],[/(avast|avg)\/([\w\.]+)/i],[[p,/(.+)/,`$1 Secure `+k],g],[/\bfocus\/([\w\.]+)/i],[g,[p,M+` Focus`]],[/\bopt\/([\w\.]+)/i],[g,[p,ae+` Touch`]],[/coc_coc\w+\/([\w\.]+)/i],[g,[p,`Coc Coc`]],[/dolfin\/([\w\.]+)/i],[g,[p,`Dolphin`]],[/coast\/([\w\.]+)/i],[g,[p,ae+` Coast`]],[/miuibrowser\/([\w\.]+)/i],[g,[p,`MIUI`+me]],[/fxios\/([\w\.-]+)/i],[g,[p,M]],[/\bqihoobrowser\/?([\w\.]*)/i],[g,[p,`360`]],[/\b(qq)\/([\w\.]+)/i],[[p,/(.+)/,`$1Browser`],g],[/(oculus|sailfish|huawei|vivo|pico)browser\/([\w\.]+)/i],[[p,/(.+)/,`$1`+me],g],[/samsungbrowser\/([\w\.]+)/i],[g,[p,L+` Internet`]],[/metasr[\/ ]?([\d\.]+)/i],[g,[p,`Sogou Explorer`]],[/(sogou)mo\w+\/([\d\.]+)/i],[[p,`Sogou Mobile`],g],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|2345(?=browser|chrome|explorer))\w*[\/ ]?v?([\w\.]+)/i],[p,g],[/(lbbrowser|rekonq)/i,/\[(linkedin)app\]/i],[p],[/ome\/([\w\.]+) \w* ?(iron) saf/i,/ome\/([\w\.]+).+qihu (360)[es]e/i],[g,p],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[p,de],g],[/(Klarna)\/([\w\.]+)/i,/(kakao(?:talk|story))[\/ ]([\w\.]+)/i,/(naver)\(.*?(\d+\.[\w\.]+).*\)/i,/(daum)apps[\/ ]([\w\.]+)/i,/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(alipay)client\/([\w\.]+)/i,/(twitter)(?:and| f.+e\/([\w\.]+))/i,/(chromium|instagram|snapchat)[\/ ]([-\w\.]+)/i],[p,g],[/\bgsa\/([\w\.]+) .*safari\//i],[g,[p,`GSA`]],[/musical_ly(?:.
466+app_?version\/|_)([\w\.]+)/i],[g,[p,`TikTok`]],[/headlesschrome(?:\/([\w\.]+)| )/i],[g,[p,A+` Headless`]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[p,A+` WebView`],g],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[g,[p,`Android `+k]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[p,g],[/version\/([\w\.\,]+) .*mobile\/\w+ (safari)/i],[g,[p,`Mobile Safari`]],[/version\/([\w(\.|\,)]+) .*(mobile ?safari|safari)/i],[g,p],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[p,[g,Se,Ce]],[/(webkit|khtml)\/([\w\.]+)/i],[p,g],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[p,`Netscape`],g],[/(wolvic|librewolf)\/([\w\.]+)/i],[p,g],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[g,[p,M+` Reality`]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror)[\/ ]?([\w\.\+]+)/i,/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([-\w\.]+)$/i,/(firefox)\/([\w\.]+)/i,/(mozilla)\/([\w\.]+) .+rv\:.+gecko\/\d+/i,/(amaya|dillo|doris|icab|ladybird|lynx|mosaic|netsurf|obigo|polaris|w3m|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/\b(links) \(([\w\.]+)/i],[p,[g,/_/g,`.`]],[/(cobalt)\/([\w\.]+)/i],[p,[g,/master.|lts./,``]]],cpu:[[/\b((amd|x|x86[-_]?|wow|win)64)\b/i],[[_,`amd64`]],[/(ia32(?=;))/i,/\b((i[346]|x)86)(pc)?\b/i],[[_,`ia32`]],[/\b(aarch64|arm(v?[89]e?l?|_?64))\b/i],[[_,`arm64`]],[/\b(arm(v[67])?ht?n?[fl]p?)\b/i],[[_,`armhf`]],[/( (ce|mobile); ppc;|\/[\w\.]+arm\b)/i],[[_,`arm`]],[/((ppc|powerpc)(64)?)( mac|;|\))/i],[[_,/ower/,a,ve]],[/ sun4\w[;\)]/i],[[_,`sparc`]],[/\b(avr32|ia64(?=;)|68k(?=\))|\barm(?=v([1-7]|[5-7]1)l?|;|eabi)|(irix|mips|sparc)(64)?\b|pa-risc)/i],[[_,ve]]],device:[[/\b(sch-i[89]0\d|shw-m380s|sm-[ptx]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i],[f,[h,L],[m,b]],[/\b((?:s[cgp]h|gt|sm)-(?![lr])\w+|sc[g-]?[\d]+a?|galaxy nexus)/i,/samsung[- ]((?!sm-[lr])[-\w]+)/i,/sec-(sgh\w+)/i],[f,[h,L],[m,y]],[/(?:\/|\()(ip(?:hone|od)[\w, ]*)(?:\/|;)/i],[f,[h,E],[m,y]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[f,[h,E],[m,b]],[/(macintosh);/i],[f,[h,E]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[f,[h,se],[m,y]],[/\b((?:brt|eln|hey2?|gdi|jdn)-a?[lnw]09|(?:ag[rm]3?|jdn2|kob2)-a?[lw]0[09]hn)(?: bui|\)|;)/i],[f,[h,P],[m,b]],[/honor([-\w ]+)[;\)]/i],[f,[h,P],[m,y]],[/\b((?:ag[rs][2356]?k?|bah[234]?|bg[2o]|bt[kv]|cmr|cpn|db[ry]2?|jdn2|got|kob2?k?|mon|pce|scm|sht?|[tw]gr|vrd)-[ad]?[lw][0125][09]b?|605hw|bg2-u03|(?:gem|fdr|m2|ple|t1)-[7a]0[1-4][lu]|t1-a2[13][lw]|mediapad[\w\. ]*(?= bui|\)))\b(?!.+d\/s)/i],[f,[h,ee],[m,b]],[/(?:huawei)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[f,[h,ee],[m,y]],[/oid[^\)]+; (2[\dbc]{4}(182|283|rp\w{2})[cgl]|m2105k81a?c)(?: bui|\))/i,/\b((?:red)?mi[-_ ]?pad[\w- ]*)(?: bui|\))/i],[[f,/_/g,` `],[h,le],[m,b]],[/\b(poco[\w ]+|m2\d{3}j\d\d[a-z]{2})(?: bui|\))/i,/\b; (\w+) build\/hm\1/i,/\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,/\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i,/oid[^\)]+; (m?[12][0-389][01]\w{3,6}[c-y])( bui|; wv|\))/i,/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max|cc)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite|pro)?)(?: bui|\))/i,/ ([\w ]+) miui\/v?\d/i],[[f,/_/g,` `],[h,le],[m,y]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[f,[h,oe],[m,y]],[/\b(opd2(\d{3}a?))(?: bui|\))/i],[f,[h,Se,{OnePlus:[`304`,`403`,`203`],"*":oe}],[m,b]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[f,[h,`Vivo`],[m,y]],[/\b(rmx[1-3]\d{3})(?: bui|;|\))/i],[f,[h,`Realme`],[m,y]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ](\w*)/i,/((?:moto(?! 360)[\w\(\) ]+|xt\d{3,4}|nexus 6)(?= bui|\)))/i],[f,[h,re],[m,y]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[f,[h,re],[m,b]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[f,[h,te],[m,b]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv|watch)\w+)/i,/\blg-?([\d\w]+) bui/i],[f,[h,te],[m,y]],[/(ideatab[-\w ]+|602lv|d-42a|a101lv|a2109a|a3500-hv|s[56]000|pb-6505[my]|tb-?x?\d{3,4}
466(?:f[cu]|xu|[av])|yt\d?-[jx]?\d+[lfmx])( bui|;|\)|\/)/i,/lenovo ?(b[68]0[08]0-?[hf]?|tab(?:[\w- ]+?)|tb[\w-]{6,7})( bui|;|\)|\/)/i],[f,[h,F],[m,b]],[/(nokia) (t[12][01])/i],[h,f,[m,b]],[/(?:maemo|nokia).*(n900|lumia \d+|rm-\d+)/i,/nokia[-_ ]?(([-\w\. ]*))/i],[[f,/_/g,` `],[m,y],[h,`Nokia`]],[/(pixel (c|tablet))\b/i],[f,[h,N],[m,b]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[f,[h,N],[m,y]],[/droid.+; (a?\d[0-2]{2}so|[c-g]\d{4}|so[-gl]\w+|xq-a\w[4-7][12])(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[f,[h,ce],[m,y]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[f,`Xperia Tablet`],[h,ce],[m,b]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[f,[h,ie],[m,y]],[/(alexa)webm/i,/(kf[a-z]{2}wi|aeo(?!bc)\w\w)( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[f,[h,T],[m,b]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[f,/(.+)/g,`Fire Phone $1`],[h,T],[m,y]],[/(playbook);[-\w\),; ]+(rim)/i],[f,h,[m,b]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[f,[h,O],[m,y]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[f,[h,D],[m,b]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[f,[h,D],[m,y]],[/(nexus 9)/i],[f,[h,`HTC`],[m,b]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic(?!(?:;|\.))|sony(?!-bra))[-_ ]?([-\w]*)/i],[h,[f,/_/g,` `],[m,y]],[/droid [\w\.]+; ((?:8[14]9[16]|9(?:0(?:48|60|8[01])|1(?:3[27]|66)|2(?:6[69]|9[56])|466))[gqswx])\w*(\)| bui)/i],[f,[h,`TCL`],[m,b]],[/(itel) ((\w+))/i],[[h,ve],f,[m,Se,{tablet:[`p10001l`,`w7001`],"*":`mobile`}]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[f,[h,`Acer`],[m,b]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[f,[h,`Meizu`],[m,y]],[/; ((?:power )?armor(?:[\w ]{0,8}))(?: bui|\))/i],[f,[h,`Ulefone`],[m,y]],[/; (energy ?\w+)(?: bui|\))/i,/; energizer ([\w ]+)(?: bui|\))/i],[f,[h,`Energizer`],[m,y]],[/; cat (b35);/i,/; (b15q?|s22 flip|s48c|s62 pro)(?: bui|\))/i],[f,[h,`Cat`],[m,y]],[/((?:new )?andromax[\w- ]+)(?: bui|\))/i],[f,[h,`Smartfren`],[m,y]],[/droid.+; (a(?:015|06[35]|142p?))/i],[f,[h,`Nothing`],[m,y]],[/; (x67 5g|tikeasy \w+|ac[1789]\d\w+)( b|\))/i,/archos ?(5|gamepad2?|([\w ]*[t1789]|hello) ?\d+[\w ]*)( b|\))/i],[f,[h,`Archos`],[m,b]],[/archos ([\w ]+)( b|\))/i,/; (ac[3-6]\d\w{2,8})( b|\))/i],[f,[h,`Archos`],[m,y]],[/(imo) (tab \w+)/i,/(infinix) (x1101b?)/i],[h,f,[m,b]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus(?! zenw)|dell|jolla|meizu|motorola|polytron|infinix|tecno|micromax|advan)[-_ ]?([-\w]*)/i,/; (hmd|imo) ([\w ]+?)(?: bui|\))/i,/(hp) ([\w ]+\w)/i,/(microsoft); (lumia[\w ]+)/i,/(lenovo)[-_ ]?([-\w ]+?)(?: bui|\)|\/)/i,/(oppo) ?([\w ]+) bui/i],[h,f,[m,y]],[/(kobo)\s(ereader|touch)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i,/(nook)[\w ]+build\/(\w+)/i,/(dell) (strea[kpr\d ]*[\dko])/i,/(le[- ]+pan)[- ]+(\w{1,9}) bui/i,/(trinity)[- ]*(t\d{3}) bui/i,/(gigaset)[- ]+(q\w{1,9}) bui/i,/(vodafone) ([\w ]+)(?:\)| bui)/i],[h,f,[m,b]],[/(surface duo)/i],[f,[h,ne],[m,b]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[f,[h,`Fairphone`],[m,y]],[/(u304aa)/i],[f,[h,`AT&T`],[m,y]],[/\bsie-(\w*)/i],[f,[h,`Siemens`],[m,y]],[/\b(rct\w+) b/i],[f,[h,`RCA`],[m,b]],[/\b(venue[\d ]{2,7}) b/i],[f,[h,`Dell`],[m,b]],[/\b(q(?:mv|ta)\w+) b/i],[f,[h,`Verizon`],[m,b]],[/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i],[f,[h,`Barnes & Noble`],[m,b]],[/\b(tm\d{3}\w+) b/i],[f,[h,`NuVision`],[m,b]],[/\b(k88) b/i],[f,[h,`ZTE`],[m,b]],[/\b(nx\d{3}j) b/i],[f,[h,`ZTE`],[m,y]],[/\b(gen\d{3}) b.+49h/i],[f,[h,`Swiss`],[m,y]],[/\b(zur\d{3}) b/i],[f,[h,`Swiss`],[m,b]],[/\b((zeki)?tb.*\b) b/i],[f,[h,`Zeki`],[m,b]],[/\b([yr]\d{2}) b/i,/\b(dragon[- ]+touch |dt)(\w{5}) b/i],[[h,`Dragon Touch`],f,[m,b]],[/\b(ns-?\w{0,9}) b/i],[f,[h,`Insignia`],[m,b]],[/\b((nxa|next)-?\w{0,9}) b/i],[f,[h,`NextBook`],[m,b]],[/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[h,`Voice`],f,[m,y]],[/\b(lvtel\-)?(v1[12]) b/i],[[h,`LvTel`],f,[m,y]],[/\b(ph-1) /i],[f,[h,`Essential`],[m,y]],[/\b(v(100md|700na|7011|917g).*\b) b/i],[f,[h,`Envizen`],[m,b]],[/\b(trio[-\w\. ]+) b/i],[f,[h,`MachSpeed`],[m,b]],[/\btu_(1491) b/i],[f,[h,`Rotor`],[m,b]],[/((?:tegranote|shield t(?!.+d tv))[\w- ]*?)(?: b|\))/i],[f,[h,I],[m,b]],[/(sprint) (\w+)/i],[h,f,[m,y]],[/(kin\.[onetw]{3})/i],[[f,/\./g,` `],[h,ne],[m,y]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[f,[h,ue],[m,b]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[f,[h,ue],[m,y]],[/smart-tv.+(samsung)/i],[h,[m,x]],[/hbbtv.+maple;(\d+)/i],[[f,/^/,`SmartTV`],[h,L],[m,x]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[h,te],[m,x]],[/(apple) ?tv/i],[h,[f,E+` TV`],[m,x]],[/crkey/i],[[f,A+`cast`],[h,N],[m,x]],[/droid.+aft(\w+)( bui|\))/i],[f,[h,T],[m,x]],[/(shield \w+ tv)/i],[f,[h,I],[m,x]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[f,[h,se],[m,x]],[/(bravia[\w ]+)( bui|\))/i],[f,[h,ce],[m,x]],[/(mi(tv|box)-?\w+) bui/i],[f,[h,le],[m,x]],[/Hbbtv.*(technisat) (.*);/i],[h,f,[m,x]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w\+ ]*; *([\w\d][^;]*);([^;]*)/i],[[h,be],[f,be],[m,x]],[/droid.+; ([\w- ]+) (?:android tv|smart[- ]?tv)/i],[f,[m,x]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[m,x]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[h,f,[m,v]],[/droid.+; (shield)( bui|\))/i],[f,[h,I],[m,v]],[/(playstation \w+)/i],[f,[h,ce],[m,v]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[f,[h,ne],[m,v]],[/\b(sm-[lr]\d\d[0156][fnuw]?s?|gear live)\b/i],[f,[h,L],[m,S]],[/((pebble))app/i,/(asu
vendor: 4,969 bytes, line 466
466s|google|lg|oppo) ((pixel |zen)?watch[\w ]*)( bui|\))/i],[h,f,[m,S]],[/(ow(?:19|20)?we?[1-3]{1,3})/i],[f,[h,oe],[m,S]],[/(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i],[f,[h,E],[m,S]],[/(opwwe\d{3})/i],[f,[h,ie],[m,S]],[/(moto 360)/i],[f,[h,re],[m,S]],[/(smartwatch 3)/i],[f,[h,ce],[m,S]],[/(g watch r)/i],[f,[h,te],[m,S]],[/droid.+; (wt63?0{2,3})\)/i],[f,[h,ue],[m,S]],[/droid.+; (glass) \d/i],[f,[h,N],[m,S]],[/(pico) (4|neo3(?: link|pro)?)/i],[h,f,[m,S]],[/; (quest( \d| pro)?)/i],[f,[h,de],[m,S]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[h,[m,C]],[/(aeobc)\b/i],[f,[h,T],[m,C]],[/(homepod).+mac os/i],[f,[h,E],[m,C]],[/windows iot/i],[[m,C]],[/droid .+?; ([^;]+?)(?: bui|; wv\)|\) applew).+? mobile safari/i],[f,[m,y]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[f,[m,b]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[m,b]],[/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[m,y]],[/droid .+?; ([\w\. -]+)( bui|\))/i],[f,[h,`Generic`]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[g,[p,j+`HTML`]],[/(arkweb)\/([\w\.]+)/i],[p,g],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[g,[p,`Blink`]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna|servo)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i,/(icab)[\/ ]([23]\.[\d\.]+)/i,/\b(libweb)/i],[p,g],[/ladybird\//i],[[p,`LibWeb`]],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[g,p]],os:[[/microsoft (windows) (vista|xp)/i],[p,g],[/(windows (?:phone(?: os)?|mobile|iot))[\/ ]?([\d\.\w ]*)/i],[p,[g,Se,we]],[/windows nt 6\.2; (arm)/i,/windows[\/ ]([ntce\d\. ]+\w)(?!.+xbox)/i,/(?:win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[g,Se,we],[p,`Windows`]],[/[adehimnop]{4,7}\b(?:.*os ([\w]+) like mac|; opera)/i,/(?:ios;fbsv\/|iphone.+ios[\/ ])([\d\.]+)/i,/cfnetwork\/.+darwin/i],[[g,/_/g,`.`],[p,`iOS`]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[p,pe],[g,/_/g,`.`]],[/droid ([\w\.]+)\b.+(android[- ]x86|harmonyos)/i],[g,p],[/(ubuntu) ([\w\.]+) like android/i],[[p,/(.+)/,`$1 Touch`],g],[/(android|bada|blackberry|kaios|maemo|meego|openharmony|qnx|rim tablet os|sailfish|series40|symbian|tizen|webos)\w*[-\/; ]?([\d\.]*)/i],[p,g],[/\(bb(10);/i],[g,[p,O]],[/(?:symbian ?os|symbos|s60(?=;)|series ?60)[-\/ ]?([\w\.]*)/i],[g,[p,`Symbian`]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[g,[p,M+` OS`]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[g,[p,`webOS`]],[/watch(?: ?os[,\/]|\d,\d\/)([\d\.]+)/i],[g,[p,`watchOS`]],[/crkey\/([\d\.]+)/i],[g,[p,A+`cast`]],[/(cros) [\w]+(?:\)| ([\w\.]+)\b)/i],[[p,fe],g],[/panasonic;(viera)/i,/(netrange)mmh/i,/(nettv)\/(\d+\.[\w\.]+)/i,/(nintendo|playstation) ([wids345portablevuch]+)/i,/(xbox); +xbox ([^\);]+)/i,/\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i,/(mint)[\/\(\) ]?(\w*)/i,/(mageia|vectorlinux)[; ]/i,/([kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?= linux)|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire)(?: gnu\/linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i,/(hurd|linux)(?: arm\w*| x86\w*| ?)([\w\.]*)/i,/(gnu) ?([\w\.]*)/i,/\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku) (\w+)/i],[p,g],[/(sunos) ?([\w\.\d]*)/i],[[p,`Solaris`],g],[/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/(aix) ((\d)(?=\.|\)| )[\w\.])*/i,/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux|serenityos)/i,/(unix) ?([\w\.]*)/i],[p,g]]},Ee=function(e,t){if(typeof e===l&&(t=e,e=r),!(this instanceof Ee))return new Ee(e,t).getResult();var i=typeof n!==c&&n.navigator?n.navigator:r,o=e||(i&&i.userAgent?i.userAgent:a),v=i&&i.userAgentData?i.userAgentData:r,x=t?he(Te,t):Te,S=i&&i.userAgent==o;return this.getBrowser=function(){var e={};return e[p]=r,e[g]=r,xe.call(e,o,x.browser),e[d]=ye(e[g]),S&&i&&i.brave&&typeof i.brave.isBrave==s&&(e[p]=`Brave`),e},this.getCPU=function(){var e={};return e[_]=r,xe.call(e,o,x.cpu),e},this.getDevice=function(){var e={};return e[h]=r,e[f]=r,e[m]=r,xe.call(e,o,x.device),S&&!e[m]&&v&&v.mobile&&(e[m]=y),S&&e[f]==`Macintosh`&&i&&typeof i.standalone!==c&&i.maxTouchPoints&&i.maxTouchPoints>2&&(e[f]=`iPad`,e[m]=b),e},this.getEngine=function(){var e={};return e[p]=r,e[g]=r,xe.call(e,o,x.engine),e},this.getOS=function(){var e={};return e[p]=r,e[g]=r,xe.call(e,o,x.os),S&&!e[p]&&v&&v.platform&&v.platform!=`Unknown`&&(e[p]=v.platform.replace(/chrome os/i,fe).replace(/macos/i,pe)),e},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return o},this.setUA=function(e){return o=typeof e===u&&e.length>w?be(e,w):e,this},this.setUA(o),this};Ee.VERSION=i,Ee.BROWSER=ge([p,g,d]),Ee.CPU=ge([_]),Ee.DEVICE=ge([f,h,m,v,y,x,b,S,C]),Ee.ENGINE=Ee.OS=ge([p,g]),typeof e===c?typeof define===s&&define.amd?define(function(){return Ee}
466):typeof n!==c&&(n.UAParser=Ee):(typeof t!==c&&t.exports&&(e=t.exports=Ee),e.UAParser=Ee);var De=typeof n!==c&&(n.jQuery||n.Zepto);if(De&&!De.ua){var Oe=new Ee;De.ua=Oe.getResult(),De.ua.get=function(){return Oe.getUA()},De.ua.set=function(e){Oe.setUA(e);var t=Oe.getResult();for(var n in t)De.ua[n]=t[n]}}})(typeof window==`object`?window:e)})),mO=cie(),hO=pO(),gO={src:`const e=new Map;self.addEventListener("message",t=>{const s=t.data;switch(s.type){case"setTimeout":case"setInterval":e.set(s.id,("setTimeout"===s.type?setTimeout:setInterval)(()=>{!function(e){const t={type:"tick",id:e};self.postMessage(t)}(s.id),"setTimeout"===s.type&&e.delete(s.id)},s.timeout));break;case"clearTimeout":case"clearInterval":("clearTimeout"===s.type?clearTimeout:clearInterval)(e.get(s.id)),e.delete(s.id)}});`},_O=class{constructor(e={}){this.currentTimerId=1,this.callbacks=new Map,this.fallback=!1,this.setup=({useWorker:e=!0,name:t=`@stream-io/worker-timer`}={})=>{if(!e){this.fallback=!0;return}try{let e=gO.src,n=new Blob([e],{type:`application/javascript; charset=utf-8`}),r=URL.createObjectURL(n);this.worker=new Worker(r,{name:t}),this.worker.addEventListener(`message`,e=>{let{type:t,id:n}=e.data;t===`tick`&&this.callbacks.get(n)?.()})}catch(e){console.error(`Failed to create timer worker: `,e),this.fallback=!0}},this.destroy=()=>{this.callbacks.clear(),this.worker?.terminate(),this.worker=void 0,this.fallback=!1},this.setInterval=(e,t)=>this.setTimer(`setInterval`,e,t),this.clearInterval=e=>{this.clearTimer(`clearInterval`,e)},this.setTimeout=(e,t)=>this.setTimer(`setTimeout`,e,t),this.clearTimeout=e=>{this.clearTimer(`clearTimeout`,e)},this.setTimer=(e,t,n)=>{if(this.ready||this.setup(),this.fallback)return(e===`setTimeout`?setTimeout:setInterval)(t,n);let r=this.getTimerId();return this.callbacks.set(r,()=>{t(),e===`setTimeout`&&this.callbacks.delete(r)}),this.sendMessage({type:e,id:r,timeout:n}),r},this.clearTimer=(e,t)=>{if(t){if(this.ready||this.setup(),this.fallback){(e===`clearTimeout`?clearTimeout:clearInterval)(t);return}this.callbacks.delete(t),this.sendMessage({type:e,id:t})}},this.getTimerId=()=>this.currentTimerId++,this.sendMessage=e=>{if(!this.worker)throw Error(`Cannot use timer worker before it's set up`);this.worker.postMessage(e)},this.setup(e)}get ready(){return this.fallback||!!this.worker}},vO={SPEAKER:`speaker`,EARPIECE:`earpiece`},yO={AVAILABLE:`available`,DISABLED:`disabled`,AUTO_ON:`auto-on`},bO={BLOCK_USERS:`block-users`,CHANGE_MAX_DURATION:`change-max-duration`,CREATE_CALL:`create-call`,CREATE_REACTION:`create-reaction`,ENABLE_NOISE_CANCELLATION:`enable-noise-cancellation`,END_CALL:`end-call`,JOIN_BACKSTAGE:`join-backstage`,JOIN_CALL:`join-call`,JOIN_ENDED_CALL:`join-ended-call`,KICK_USER:`kick-user`,MUTE_USERS:`mute-users`,PIN_FOR_EVERYONE:`pin-for-everyone`,READ_CALL:`read-call`,REMOVE_CALL_MEMBER:`remove-call-member`,SCREENSHARE:`screenshare`,SEND_AUDIO:`send-audio`,SEND_CLOSED_CAPTIONS_CALL:`send-closed-captions-call`,SEND_VIDEO:`send-video`,START_BROADCAST_CALL:`start-broadcast-call`,START_CLOSED_CAPTIONS_CALL:`start-closed-captions-call`,START_FRAME_RECORD_CALL:`start-frame-record-call`,START_INDIVIDUAL_RECORD_CALL:`start-individual-record-call`,START_RAW_RECORD_CALL:`start-raw-record-call`,START_RECORD_CALL:`start-record-call`,START_TRANSCRIPTION_CALL:`start-transcription-call`,STOP_BROADCAST_CALL:`stop-broadcast-call`,STOP_CLOSED_CAPTIONS_CALL:`stop-closed-captions-call`,STOP_FRAME_RECORD_CALL:`stop-frame-record-call`,STOP_INDIVIDUAL_RECORD_CALL:`stop-individual-record-call`,STOP_RAW_RECORD_CALL:`stop-raw-record-call`,STOP_RECORD_CALL:`stop-record-call`,STOP_TRANSCRIPTION_CALL:`stop-transcription-call`,UPDATE_CALL:`update-call`,UPDATE_CALL_MEMBER:`update-call-member`,UPDATE_CALL_PERMISSIONS:`update-call-permissions`,UPDATE_CALL_SETTINGS:`update-call-settings`},xO=class extends Error{constructor({message:e,code:t,status:n,response:r,unrecoverable:i}){super(e),this.name=`ErrorFromResponse`,this.code=t,this.response=r,this.status=n,this.unrecoverable=i}
466toJSON(){let e=[[`status`,this.status],[`code`,this.code],[`unrecoverable`,this.unrecoverable]],t=[];for(let[n,r]of e)r!=null&&t.push(`${n}: ${r}`);return{message:`(${t.join(`, `)}) - ${this.message}`,stack:this.stack,name:this.name}}},SO;(function(e){e[e.NULL_VALUE=0]=`NULL_VALUE`})(SO||={});var CO=new class extends H{constructor(){super(`google.protobuf.Struct`,[{no:1,name:`fields`,kind:`map`,K:9,V:{kind:`message`,T:()=>wO}}])}internalJsonWrite(e,t){let n={};for(let[t,r]of Object.entries(e.fields))n[t]=wO.toJson(r);return n}internalJsonRead(e,t,n){if(!FT(e))throw new globalThis.Error(`Unable to parse message `+this.typeName+` from JSON `+PT(e)+`.`);n||=this.create();for(let[t,r]of globalThis.Object.entries(e))n.fields[t]=wO.fromJson(r);return n}},wO=new class extends H{constructor(){super(`google.protobuf.Value`,[{no:1,name:`null_value`,kind:`enum`,oneof:`kind`,T:()=>[`google.protobuf.NullValue`,SO]},{no:2,name:`number_value`,kind:`scalar`,oneof:`kind`,T:1},{no:3,name:`string_value`,kind:`scalar`,oneof:`kind`,T:9},{no:4,name:`bool_value`,kind:`scalar`,oneof:`kind`,T:8},{no:5,name:`struct_value`,kind:`message`,oneof:`kind`,T:()=>CO},{no:6,name:`list_value`,kind:`message`,oneof:`kind`,T:()=>TO}])}internalJsonWrite(e,t){if(e.kind.oneofKind===void 0)throw new globalThis.Error;switch(e.kind.oneofKind){case void 0:throw new globalThis.Error;case`boolValue`:return e.kind.boolValue;case`nullValue`:return null;case`numberValue`:let t=e.kind.numberValue;if(typeof t==`number`&&!Number.isFinite(t))throw new globalThis.Error;return t;case`stringValue`:return e.kind.stringValue;case`listValue`:let n=this.fields.find(e=>e.no===6);if(n?.kind!==`message`)throw new globalThis.Error;return n.T().toJson(e.kind.listValue);case`structValue`:let r=this.fields.find(e=>e.no===5);if(r?.kind!==`message`)throw new globalThis.Error;return r.T().toJson(e.kind.structValue)}}internalJsonRead(e,t,n){switch(n||=this.create(),typeof e){case`number`:n.kind={oneofKind:`numberValue`,numberValue:e};break;case`string`:n.kind={oneofKind:`stringValue`,stringValue:e};break;case`boolean`:n.kind={oneofKind:`boolValue`,boolValue:e};break;case`object`:e===null?n.kind={oneofKind:`nullValue`,nullValue:SO.NULL_VALUE}:globalThis.Array.isArray(e)?n.kind={oneofKind:`listValue`,listValue:TO.fromJson(e)}:n.kind={oneofKind:`structValue`,structValue:CO.fromJson(e)};break;default:throw new globalThis.Error(`Unable to parse `+this.typeName+` from JSON `+PT(e))}return n}},TO=new class extends H{constructor(){super(`google.protobuf.ListValue`,[{no:1,name:`values`,kind:`message`,repeat:2,T:()=>wO}])}internalJsonWrite(e,t){return e.values.map(e=>wO.toJson(e))}internalJsonRead(e,t,n){if(!globalThis.Array.isArray(e))throw new globalThis.Error(`Unable to parse `+this.typeName+` from JSON `+PT(e));n||=this.create();let r=e.map(e=>wO.fromJson(e));return n.values.push(...r),n}},EO=new class extends H{constructor(){super(`google.protobuf.Timestamp`,[{no:1,name:`seconds`,kind:`scalar`,T:3},{no:2,name:`nanos`,kind:`scalar`,T:5}])}now(){let e=this.create(),t=Date.now();return e.seconds=QT.from(Math.floor(t/1e3)).toString(),e.nanos=t%1e3*1e6,e}toDate(e){return new Date(QT.from(e.seconds).toNumber()*1e3+Math.ceil(e.nanos/1e6))}fromDate(e){let t=this.create(),n=e.getTime();return t.seconds=QT.from(Math.floor(n/1e3)).toString(),t.nanos=(n%1e3+(n<0&&n%1e3!=0?1e3:0))*1e6,t}internalJsonWrite(e,t){let n=QT.from(e.seconds).toNumber()*1e3;if(n<Date.parse(`0001-01-01T00:00:00Z`)||n>Date.parse(`9999-12-31T23:59:59Z`))throw Error(`Unable to encode Timestamp to JSON. Must be from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z inclusive.`);if(e.nanos<0)throw Error(`Unable to encode invalid Timestamp to JSON. Nanos must not be negative.`);let r=`Z`;if(e.nanos>0){let t=(e.nanos+1e9).toString().substring(1);r=t.substring(3)===`000000`?`.`+t.substring(0,3)+`Z`:t.substring(6)===`000`?`.`+t.substring(0,6)+`Z`:`.`+t+`Z`}return new Date(n).toISOString().replace(`.000Z`,r)}internalJsonRead(e,t,n){if(typeof e!=`string`)throw Error(`Unable to parse Timestamp from JSON `+PT(e)+`.`);let r=e.match(/^([0-9]{4})-([0-9]{2})-([0-9]{2})T([0-9]{2}):([0-9]{2}):([0-9]{2})(?:Z|\.([0-9]{3,9})Z|([+-][0-9][0-9]:[0-9][0-9]))$/);if(!r)throw Error(`Unable to parse Timestamp from JSON. Invalid format.`);let i=Date.parse(r[1]+`-`+r[2]+`-`+r[3]+`T`+r[4]+`:`+r[5]+`:`+r[6]+(r[8]?r[8]:`Z`));if(Number.isNaN(i))throw Error(`Unable to parse Timestamp from JSON. Invalid value.`);if(i<Date.parse(`0001-01-01T00:00:00Z`)||i>Date.parse(`9999-12-31T23:59:59Z`))throw new globalThis.Error(`Unable to parse Timestamp from JSON. Must be from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z inclusive.`);return n||=this.create(),n.seconds=QT.from(i/1e3).toString(),n.nanos=0,r[7]&&(n.nanos=parseInt(`1`+r[7]+`0`.repeat(9-r[7].length))-1e9),n}},DO;(function(e){e[e.PUBLISHER_UNSPECIFIED=0]=`PUBLISHER_UNSPECIFIED`,e[e.SUBSCRIBER=1]=`SUBSCRIBER`})(DO||={});var OO;(function(e){e[e.UNSPECIFIED=0]=`UNSPECIFIED`,e[e.POOR=1]=`POOR`,e[e.GOOD=2]=`GOOD`,e[e.EXCELLENT=3]=`EXCELLENT`})(OO||={});var kO;(function(e){e[e.LOW_UNSPECIFIED=0]=`LOW_UNSPECIFIED`,e[e.MID=1]=`MID`,e[e.HIGH=2]=`HIGH`,e[e.OFF=3]=`OFF`})(kO||={});var U;(function(e){e[e.UNSPECIFIED=0]=`UNSPECIFIED`,e[e.AUDIO=1]=`AUDIO`,e[e.VIDEO=2]=`VIDEO`,e[e.SCREEN_SHARE=3]=`SCREEN_SHARE`,e[e.SCREEN_SHARE_AUDIO=4]=`SCREEN_SHARE_AUDIO`})(U||={});var AO;(function(e){e[e.WEBRTC_UNSPECIFIED=0]=`WEBRTC_UNSPECIFIED`,e[e.RTMP=1]=`RTMP`,e[e.WHIP=2]=`WHIP`,e[e.SIP=3]=`SIP`,e[e.RTSP=4]=`RTSP`,e[e.SRT=5]=`SRT`})(AO||={});var jO;(function(e){e[e.VOICE_STANDARD_UNSPECIFIED=0]=`VOICE_STANDARD_UNSPECIFIED`,e[e.VOICE_HIGH_QUALITY=1]=`VOICE_HIGH_QUALITY`,e[e.MUSIC_HIGH_QUALITY=2]=`MUSIC_HIGH_QUALITY`})(jO||={});var MO;(function(e){e[e.UNSPECIFIED=0]=`UNSPECIFIED`,e[e.PUBLISH_TRACK_NOT_FOUND=100]=`PUBLISH_TRACK_NOT_FOUND`,e[e.PUBLISH_TRACKS_MISMATCH=101]=`PUBLISH_TRACKS_MISMATCH`,e[e.PUBLISH_TRACK_OUT_OF_ORDER=102]=`PUBLISH_TRACK_OUT_OF_ORDER`,e[e.PUBLISH_TRACK_VIDEO_LAYER_NOT_FOUND=103]=`PUBLISH_TRACK_VIDEO_LAYER_NOT_FOUND`,e[e.LIVE_ENDED=104]=`LIVE_ENDED`,e[e.PARTICIPANT_NOT_FOUND=200]=`PARTICIPANT_NOT_FOUND`,e[e.PARTICIPANT_MIGRATING_OUT=201]=`PARTICIPANT_MIGRATING_OUT`,e[e.PARTICIPANT_MIGRATION_FAILED=202]=`PARTICIPANT_MIGRATION_FAILED`,e[e.PARTICIPANT_MIGRATING=203]=`PARTICIPANT_MIGRATING`,e[e.PARTICIPANT_RECONNECT_FAILED=204]=`PARTICIPANT_RECONNECT_FAILED`,e[e.PARTICIPANT_MEDIA_TRANSPORT_FAILURE=205]=`PARTICIPANT_MEDIA_TRANSPORT_FAILURE`,e[e.PARTICIPANT_SIGNAL_LOST=206]=`PARTICIPANT_SIGNAL_LOST`,e[e.CALL_NOT_FOUND=300]=`CALL_NOT_FOUND`,e[e.CALL_PARTICIPANT_LIMIT_REACHED=301]=`CALL_PARTICIPANT_LIMIT_REACHED`,e[e.REQUEST_VALIDATION_FAILED=400]=`REQUEST_VALIDATION_FAILED`,e[e.UNAUTHENTICATED=401]=`UNAUTHENTICATED`,e[e.PERMISSION_DENIED=403]=`PERMISSION_DENIED`,e[e.TOO_MANY_REQUESTS=429]=`TOO_MANY_REQUESTS`,e[e.INTERNAL_SERVER_ERROR=500]=`INTERNAL_SERVER_ERROR`,e[e.SFU_SHUTTING_DOWN=600]=`SFU_SHUTTING_DOWN`,e[e.SFU_FULL=700]=`SFU_FULL`})(MO||={});var NO;(function(e){e[e.UNSPECIFIED=0]=`UNSPECIFIED`,e[e.REACT=1]=`REACT`,e[e.ANGULAR=2]=`ANGULAR`,e[e.ANDROID=3]=`ANDROID`,e[e.IOS=4]=`IOS`,e[e.FLUTTER=5]=`FLUTTER`,e[e.REACT_NATIVE=6]=`REACT_NATIVE`,e[e.UNITY=7]=`UNITY`,e[e.GO=8]=`GO`,e[e.PLAIN_JAVASCRIPT=9]=`PLAIN_JAVASCRIPT`,e[e.PYTHON=10]=`PYTHON`,e[e.VISION_AGENTS=11]=`VISION_AGENTS`})(NO||={});var PO;(function(e){e[e.UNSPECIFIED=0]=`UNSPECIFIED`,e[e.USER_MUTED=1]=`USER_MUTED`,e[e.PERMISSION_REVOKED=2]=`PERMISSION_REVOKED`,e[e.MODERATION=3]=`MODERATION`})(PO||={});var FO;(function(e){e[e.UNSPECIFIED=0]=`UNSPECIFIED`,e[e.SHUTTING_DOWN=1]=`SHUTTING_DOWN`,e[e.REBALANCE=2]=`REBALANCE`})(FO||={});var IO;(function(e){e[e.UNSPECIFIED=0]=`UNSPECIFIED`,e[e.ENDED=1]=`ENDED`,e[e.LIVE_ENDED=2]=`LIVE_ENDED`,e[e.KICKED=3]=`KICKED`,e[e.SESSION_ENDED=4]=`SESSION_ENDED`})(IO||={});var LO;(function(e){e[e.UNSPECIFIED=0]=`UNSPECIFIED`,e[e.DISCONNECT=1]=`DISCONNECT`,e[e.FAST=2]=`FAST`,e[e.REJOIN=3]=`REJOIN`,e[e.MIGRATE=4]=`MIGRATE`})(LO||={});var RO;(function(e){e[e.UNSPECIFIED=0]=`UNSPECIFIED`,e[e.NONE=1]=`NONE`,e[e.LIGHT=2]=`LIGHT`,e[e.MODERATE=3]=`MODERATE`,e[e.SEVERE=4]=`SEVERE`,e[e.CRITICAL=5]=`CRITICAL`,e[e.EMERGENCY=6]=`EMERGENCY`,e[e.SHUTDOWN=7]=`SHUTDOWN`})(RO||={});var zO;(function(e){e[e.UNSPECIFIED=0]=`UNSPECIFIED`,e[e.NOMINAL=1]=`NOMINAL`,e[e.FAIR=2]=`FAIR`,e[e.SERIOUS=3]=`SERIOUS`,e[e.CRITICAL=4]=`CRITICAL`})(zO||={});var BO;(function(e){e[e.UNSPECIFIED=0]=`UNSPECIFIED`,e[e.SUBSCRIBER_VIDEO_PAUSE=1]=`SUBSCRIBER_VIDEO_PAUSE`,e[e.COORDINATOR_STATS=2]=`COORDINATOR_STATS`})(BO||={});var VO;(function(e){e[e.UNSPECIFIED=0]=`UNSPECIFIED`,e[e.BALANCED=1]=`BALANCED`,e[e.MAINTAIN_FRAMERATE=2]=`MAINTAIN_FRAMERATE`,e[e.MAINTAIN_RESOLUTION=3]=`MAINTAIN_RESOLUTION`,e[e.MAINTAIN_FRAMERATE_AND_RESOLUTION=4]=`MAINTAIN_FRAMERATE_AND_RESOLUTION`})(VO||={});var HO=new class extends H{constructor(){super(`stream.video.sfu.models.CallState`,[{no:1,name:`participants`,kind:`message`,repeat:2,T:()=>GO},{no:2,name:`started_at`,kind:`message`,T:()=>EO},{no:3,name:`participant_count`,kind:`message`,T:()=>UO},{no:4,name:`pins`,kind:`message`,repeat:2,T:()=>WO}])}},UO=new class extends H{constructor(){super(`stream.video.sfu.models.ParticipantCount`,[{no:1,name:`total`,kind:`scalar`,T:13},{no:2,name:`anonymous`,kind:`scalar`,T:13}])}},WO=new class extends H{constructor(){super(`stream.video.sfu.models.Pin`,[{no:1,name:`user_id`,kind:`scalar`,T:9},{no:2,name:`session_id`,kind:`scalar`,T:9}])}},GO=new class extends H{constructor(){super(`stream.video.sfu.models.Participant`,[{no:1,name:`user_id`,kind:`scalar`,T:9},{no:2,name:`session_id`,kind:`scalar`,T:9},{no:3,name:`published_tracks`,kind:`enum`,repeat:1,T:()=>[`stream.video.sfu.models.TrackType`,U,`TRACK_TYPE_`]},{no:4,name:`joined_at`,kind:`message`,T:()=>EO},{no:5,name:`track_lookup_prefix`,kind:`scalar`,T:9},{no:6,name:`connection_quality`,kind:`enum`,T:()=>[`stream.video.sfu.models.ConnectionQuality`,OO,`CONNECTION_QUALITY_`]},{no:7,name:`is_speaking`,kind:`scalar`,T:8},{no:8,name:`is_dominant_speaker`,kind:`scalar`,T:8},{no:9,name:`audio_level`,kind:`scalar`,T:2},{no:10,name:`name`,kind:`scalar`,T:9},{no:11,name:`image`,kind:`scalar`,T:9},{no:12,name:`custom`,kind:`message`,T:()=>CO},{no:13,name:`roles`,kind:`scalar`,repeat:2,T:9},{no:14,name:`source`,kind:`enum`,T:()=>[`stream.video.sfu.models.ParticipantSource`,AO,`PARTICIPANT_SOURCE_`]}])}},KO=new class extends H{constructor(){super(`stream.video.sfu.models.StreamQuality`,[{no:1,name:`video_quality`,kind:`enum`,T:()=>[`stream.video.sfu.models.VideoQuality`,kO,`VIDEO_QUALITY_`]},{no:2,name:`user_id`,kind:`scalar`,T:9}])}},qO=new class extends H{constructor(){super(`stream.video.sfu.models.VideoDimension`,[{no:1,name:`width`,kind:`scalar`,T:13},{no:2,name:`height`,kind:`scalar`,T:13}])}},JO=new class extends H{constructor(){super(`stream.video.sfu.models.VideoLayer`,[{no:1,name:`rid`,kind:`scalar`,T:9},{no:2,name:`video_dimension`,kind:`message`,T:()=>qO},{no:4,name:`bitrate`,kind:`scalar`,T:13},{no:5,name:`fps`,kind:`scalar`,T:13},{no:6,name:`quality`,kind:`enum`,T:()=>[`stream.video.sfu.models.VideoQuality`,kO,`VIDEO_QUALITY_`]}])}},YO=new class extends H{constructor(){super(`stream.video.sfu.models.SubscribeOption`,[{no:1,name:`track_type`,kind:`enum`,T:()=>[`stream.video.sfu.models.TrackType`,U,`TRACK_TYPE_`]},{no:2,name:`codecs`,kind:`message`,repeat:2,T:()=>ZO}])}},XO=new class extends H{constructor(){super(`stream.video.sfu.models.PublishOption`,[{no:1,name:`track_type`,kind:`enum`,T:()=>[`stream.video.sfu.models.TrackType`,U,`TRACK_TYPE_`]},{no:2,name:`codec`,kind:`message`,T:()=>ZO},{no:3,name:`bitrate`,kind:`scalar`,T:5},{no:4,name:`fps`,kind:`scalar`,T:5},{no:5,name:`max_spatial_layers`,kind:`scalar`,T:5},{no:6,name:`max_temporal_layers`,kind:`scalar`,T:5},{no:7,name:`video_dimension`,kind:`message`,T:()=>qO},{no:8,name:`id`,kind:`scalar`,T:5},{no:9,name:`use_single_layer`,kind:`scalar`,T:8},{no:10,name:`audio_bitrate_profiles`,kind:`message`,repeat:2,T:()=>$O},{no:11,name:`degradation_preference`,kind:`enum`,T:()=>[`stream.video.sfu.models.DegradationPreference`,VO,`DEGRADATION_PREFERENCE_`]}])}},ZO=new class extends H{constructor(){super(`stream.video.sfu.models.Codec`,[{no:16,name:`payload_type`,kind:`scalar`,T:13},{no:10,name:`name`,kind:`scalar`,T:9},{no:14,name:`clock_rate`,kind:`scalar`,T:13},{no:15,name:`encoding_parameters`,kind:`scalar`,T:9},{no:12,name:`fmtp`,kind:`scalar`,T:9}])}}
466,QO=new class extends H{constructor(){super(`stream.video.sfu.models.ICETrickle`,[{no:1,name:`peer_type`,kind:`enum`,T:()=>[`stream.video.sfu.models.PeerType`,DO,`PEER_TYPE_`]},{no:2,name:`ice_candidate`,kind:`scalar`,T:9},{no:3,name:`session_id`,kind:`scalar`,T:9}])}},$O=new class extends H{constructor(){super(`stream.video.sfu.models.AudioBitrate`,[{no:1,name:`profile`,kind:`enum`,T:()=>[`stream.video.sfu.models.AudioBitrateProfile`,jO,`AUDIO_BITRATE_PROFILE_`]},{no:2,name:`bitrate`,kind:`scalar`,T:5}])}},ek=new class extends H{constructor(){super(`stream.video.sfu.models.TrackInfo`,[{no:1,name:`track_id`,kind:`scalar`,T:9},{no:2,name:`track_type`,kind:`enum`,T:()=>[`stream.video.sfu.models.TrackType`,U,`TRACK_TYPE_`]},{no:5,name:`layers`,kind:`message`,repeat:2,T:()=>JO},{no:6,name:`mid`,kind:`scalar`,T:9},{no:7,name:`dtx`,kind:`scalar`,T:8},{no:8,name:`stereo`,kind:`scalar`,T:8},{no:9,name:`red`,kind:`scalar`,T:8},{no:10,name:`muted`,kind:`scalar`,T:8},{no:11,name:`codec`,kind:`message`,T:()=>ZO},{no:12,name:`publish_option_id`,kind:`scalar`,T:5}])}},tk=new class extends H{constructor(){super(`stream.video.sfu.models.Error`,[{no:1,name:`code`,kind:`enum`,T:()=>[`stream.video.sfu.models.ErrorCode`,MO,`ERROR_CODE_`]},{no:2,name:`message`,kind:`scalar`,T:9},{no:3,name:`should_retry`,kind:`scalar`,T:8}])}},nk=new class extends H{constructor(){super(`stream.video.sfu.models.ClientDetails`,[{no:1,name:`sdk`,kind:`message`,T:()=>rk},{no:2,name:`os`,kind:`message`,T:()=>ik},{no:3,name:`browser`,kind:`message`,T:()=>ak},{no:4,name:`device`,kind:`message`,T:()=>sk},{no:5,name:`webrtc_version`,kind:`scalar`,T:9}])}},rk=new class extends H{constructor(){super(`stream.video.sfu.models.Sdk`,[{no:1,name:`type`,kind:`enum`,T:()=>[`stream.video.sfu.models.SdkType`,NO,`SDK_TYPE_`]},{no:2,name:`major`,kind:`scalar`,T:9},{no:3,name:`minor`,kind:`scalar`,T:9},{no:4,name:`patch`,kind:`scalar`,T:9}])}},ik=new class extends H{constructor(){super(`stream.video.sfu.models.OS`,[{no:1,name:`name`,kind:`scalar`,T:9},{no:2,name:`version`,kind:`scalar`,T:9},{no:3,name:`architecture`,kind:`scalar`,T:9}])}},ak=new class extends H{constructor(){super(`stream.video.sfu.models.Browser`,[{no:1,name:`name`,kind:`scalar`,T:9},{no:2,name:`version`,kind:`scalar`,T:9}])}},ok=new class extends H{constructor(){super(`stream.video.sfu.models.RTMPIngress`,[{no:1,name:`width`,kind:`scalar`,T:13},{no:2,name:`height`,kind:`scalar`,T:13},{no:3,name:`frame_rate`,kind:`scalar`,T:1},{no:4,name:`software`,kind:`scalar`,T:9},{no:5,name:`version`,kind:`scalar`,T:9},{no:6,name:`encoder`,kind:`scalar`,T:9},{no:7,name:`remote_addr`,kind:`scalar`,T:9}])}},sk=new class extends H{constructor(){super(`stream.video.sfu.models.Device`,[{no:1,name:`name`,kind:`scalar`,T:9},{no:2,name:`version`,kind:`scalar`,T:9}])}},ck=new class extends H{constructor(){super(`stream.video.sfu.models.Call`,[{no:1,name:`type`,kind:`scalar`,T:9},{no:2,name:`id`,kind:`scalar`,T:9},{no:3,name:`created_by_user_id`,kind:`scalar`,T:9},{no:4,name:`host_user_id`,kind:`scalar`,T:9},{no:5,name:`custom`,kind:`message`,T:()=>CO},{no:6,name:`created_at`,kind:`message`,T:()=>EO},{no:7,name:`updated_at`,kind:`message`,T:()=>EO}])}},lk=new class extends H{constructor(){super(`stream.video.sfu.models.CallGrants`,[{no:1,name:`can_publish_audio`,kind:`scalar`,T:8},{no:2,name:`can_publish_video`,kind:`scalar`,T:8},{no:3,name:`can_screenshare`,kind:`scalar`,T:8}])}},uk=new class extends H{constructor(){super(`stream.video.sfu.models.InputDevices`,[{no:1,name:`available_devices`,kind:`scalar`,repeat:2,T:9},{no:2,name:`current_device`,kind:`scalar`,T:9},{no:3,name:`is_permitted`,kind:`scalar`,T:8}])}},dk=new class extends H{constructor(){super(`stream.video.sfu.models.AndroidState`,[{no:1,name:`thermal_state`,kind:`enum`,T:()=>[`stream.video.sfu.models.AndroidThermalState`,RO,`ANDROID_THERMAL_STATE_`]},{no:2,name:`is_power_saver_mode`,kind:`scalar`,T:8}])}},fk=new class extends H{constructor(){super(`stream.video.sfu.models.AppleState`,[{no:1,name:`thermal_state`,kind:`enum`,T:()=>[`stream.video.sfu.models.AppleThermalState`,zO,`APPLE_THERMAL_STATE_`]},{no:2,name:`is_low_power_mode_enabled`,kind:`scalar`,T:8}])}},pk=new class extends H{constructor(){super(`stream.video.sfu.models.PerformanceStats`,[{no:1,name:`track_type`,kind:`enum`,T:()=>[`stream.video.sfu.models.TrackType`,U,`TRACK_TYPE_`]},{no:2,name:`codec`,kind:`message`,T:()=>ZO},{no:3,name:`avg_frame_time_ms`,kind:`scalar`,T:2},{no:4,name:`avg_fps`,kind:`scalar`,T:2},{no:5,name:`video_dimension`,kind:`message`,T:()=>qO},{no:6,name:`target_bitrate`,kind:`scalar`,T:5}])}},mk=new class extends H{constructor(){super(`stream.video.sfu.models.RtpBase`,[{no:1,name:`ssrc`,kind:`scalar`,T:13},{no:2,name:`kind`,kind:`scalar`,T:9},{no:3,name:`timestamp_ms`,kind:`scalar`,T:1}])}},hk=new class extends H{constructor(){super(`stream.video.sfu.models.InboundRtp`,[{no:1,name:`base`,kind:`message`,T:()=>mk},{no:2,name:`jitter_seconds`,kind:`scalar`,T:1},{no:3,name:`packets_received`,kind:`scalar`,T:4},{no:4,name:`packets_lost`,kind:`scalar`,T:4},{no:5,name:`packet_loss_percent`,kind:`scalar`,T:1},{no:10,name:`concealment_events`,kind:`scalar`,T:13},{no:11,name:`concealment_percent`,kind:`scalar`,T:1},{no:20,name:`fps`,kind:`scalar`,T:1},{no:21,name:`freeze_duration_seconds`,kind:`scalar`,T:1},{no:22,name:`avg_decode_time_seconds`,kind:`scalar`,T:1},{no:23,name:`min_dimension_px`,kind:`scalar`,T:13}])}},gk=new class extends H{constructor(){super(`stream.video.sfu.models.OutboundRtp`,[{no:1,name:`base`,kind:`message`,T:()=>mk},{no:10,name:`fps`,kind:`scalar`,T:1},{no:11,name:`avg_encode_time_seconds`,kind:`scalar`,T:1},{no:12,name:`bitrate_bps`,kind:`scalar`,T:1},{no:13,name:`min_dimension_px`,kind:`scalar`,T:13}])}},_k=new class extends H{constructor(){super(`stream.video.sfu.models.RemoteInboundRtp`,[{no:1,name:`base`,kind:`message`,T:()=>mk},{no:2,name:`jitter_seconds`,kind:`scalar`,T:1},{no:3,name:`round_trip_time_s`,kind:`scalar`,T:1}])}},vk=new class extends H{constructor(){super(`stream.video.sfu.models.RemoteOutboundRtp`,[{no:1,name:`base`,kind:`message`,T:()=>mk},{no:2,name:`jitter_seconds`,kind:`scalar`,T:1},{no:3,name:`round_trip_time_s`,kind:`scalar`,T:1}])}},yk=Object.freeze({__proto__:null,AndroidState:dk,get AndroidThermalState(){return RO},AppleState:fk,get AppleThermalState(){return zO},AudioBitrate:$O,get AudioBitrateProfile(){return jO},Browser:ak,Call:ck,get CallEndedReason(){return IO},CallGrants:lk,CallState:HO,get ClientCapability(){return BO},ClientDetails:nk,Codec:ZO,get ConnectionQuality(){return OO},get DegradationPreference(){return VO},Device:sk,Error:tk,get ErrorCode(){return MO},get GoAwayReason(){return FO},ICETrickle:QO,InboundRtp:hk,InputDevices:uk,OS:ik,OutboundRtp:gk,Participant:GO,ParticipantCount:UO,get ParticipantSource(){return AO},get PeerType(){return DO},PerformanceStats:pk,Pin:WO,PublishOption:XO,RTMPIngress:ok,RemoteInboundRtp:_k,RemoteOutboundRtp:vk,RtpBase:mk,Sdk:rk,get SdkType(){return NO},StreamQuality:KO,SubscribeOption:YO,TrackInfo:ek,get TrackType(){return U},get TrackUnpublishReason(){return PO},VideoDimension:qO,VideoLayer:JO,get VideoQuality(){return kO},get WebsocketReconnectStrategy(){return LO}}),bk=new class extends H{constructor(){super(`stream.video.sfu.signal.StartNoiseCancellationRequest`,[{no:1,name:`session_id`,kind:`scalar`,T:9}])}},xk=new class extends H{constructor(){super(`stream.video.sfu.signal.StartNoiseCancellationResponse`,[{no:1,name:`error`,kind:`message`,T:()=>tk}])}},Sk=new class extends H{constructor(){super(`stream.video.sfu.signal.StopNoiseCancellationRequest`,[{no:1,name:`session_id`,kind:`scalar`,T:9}])}},Ck=new class extends H{constructor(){super(`stream.video.sfu.signal.StopNoiseCancellationResponse`,[{no:1,name:`error`,kind:`message`,T:()=>tk}])}},wk=new class extends H{constructor(){super(`stream.video.sfu.signal.Reconnection`,[{no:1,name:`time_seconds`,kind:`scalar`,T:2},{no:2,name:`strategy`,kind:`enum`,T:()=>[`stream.video.sfu.models.WebsocketReconnectStrategy`,LO,`WEBSOCKET_RECONNECT_STRATEGY_`]}])}},Tk=new class extends H{constructor(){super(`stream.video.sfu.signal.Telemetry`,[{no:1,name:`connection_time_seconds`,kind:`scalar`,oneof:`data`,T:2},{no:2,name:`reconnection`,kind:`message`,oneof:`data`,T:()=>wk}])}},Ek=new class extends H{constructor(){super(`stream.video.sfu.signal.SendMetricsRequest`,[{no:1,name:`session_id`,kind:`scalar`,T:9},{no:2,name:`unified_session_id`,kind:`scalar`,T:9},{no:3,name:`inbounds`,kind:`message`,repeat:2,T:()=>hk},{no:4,name:`outbounds`,kind:`message`,repeat:2,T:()=>gk},{no:5,name:`remote_inbounds`,kind:`message`,repeat:2,T:()=>_k},{no:6,name:`remote_outbounds`,kind:`message`,repeat:2,T:()=>vk}])}},Dk=new class extends H{constructor(){super(`stream.video.sfu.signal.SendMetricsResponse`,[])}},Ok=new class extends H{constructor(){super(`stream.video.sfu.signal.SendStatsRequest`,[{no:1,name:`session_id`,kind:`scalar`,T:9},{no:2,name:`subscriber_stats`,kind:`scalar`,T:9},{no:3,name:`publisher_stats`,kind:`scalar`,T:9},{no:4,name:`webrtc_version`,kind:`scalar`,T:9},{no:5,name:`sdk`,kind:`scalar`,T:9},{no:6,name:`sdk_version`,kind:`scalar`,T:9},{no:7,name:`audio_devices`,kind:`message`,T:()=>uk},{no:8,name:`video_devices`,kind:`message`,T:()=>uk},{no:9,name:`android`,kind:`message`,oneof:`deviceState`,T:()=>dk},{no:10,name:`apple`,kind:`message`,oneof:`deviceState`,T:()=>fk},{no:11,name:`telemetry`,kind:`message`,T:()=>Tk},{no:12,name:`rtmp`,kind:`message`,T:()=>ok},{no:13,name:`subscriber_rtc_stats`,kind:`scalar`,T:9},{no:14,name:`publisher_rtc_stats`,kind:`scalar`,T:9},{no:15,name:`rtc_stats`,kind:`scalar`,T:9},{no:16,name:`encode_stats`,kind:`message`,repeat:2,T:()=>pk},{no:17,name:`decode_stats`,kind:`message`,repeat:2,T:()=>pk},{no:18,name:`unified_session_id`,kind:`scalar`,T:9}])}},kk=new class extends H{constructor(){super(`stream.video.sfu.signal.SendStatsResponse`,[{no:1,name:`error`,kind:`message`,T:()=>tk}])}},Ak=new class extends H{constructor(){super(`stream.video.sfu.signal.ICERestartRequest`,[{no:1,name:`session_id`,kind:`scalar`,T:9},{no:2,name:`peer_type`,kind:`enum`,T:()=>[`stream.video.sfu.models.PeerType`,DO,`PEER_TYPE_`]}])}},jk=new class extends H{constructor(){super(`stream.video.sfu.signal.ICERestartResponse`,[{no:1,name:`error`,kind:`message`,T:()=>tk}])}},Mk=new class extends H{constructor(){super(`stream.video.sfu.signal.UpdateMuteStatesRequest`,[{no:1,name:`session_id`,kind:`scalar`,T:9},{no:3,name:`mute_states`,kind:`message`,repeat:2,T:()=>Pk}])}},Nk=new class extends H{constructor(){super(`stream.video.sfu.signal.UpdateMuteStatesResponse`,[{no:4,name:`error`,kind:`message`,T:()=>tk}])}},Pk=new class extends H{constructor(){super(`stream.video.sfu.signal.TrackMuteState`,[{no:1,name:`track_type`,kind:`enum`,T:()=>[`stream.video.sfu.models.TrackType`,U,`TRACK_TYPE_`]},{no:2,name:`muted`,kind:`scalar`,T:8}])}};new class extends H{constructor(){super(`stream.video.sfu.signal.AudioMuteChanged`,[{no:1,name:`muted`,kind:`scalar`,T:8}])}},new class extends H{constructor(){super(`stream.video.sfu.signal.VideoMuteChanged`,[{no:2,name:`muted`,kind:`scalar`,T:8}])}};var Fk=new class extends H{constructor(){super(`stream.video.sfu.signal.UpdateSubscriptionsRequest`,[{no:2,name:`session_id`,kind:`scalar`,T:9},{no:3,name:`tracks`,kind:`message`,repeat:2,T:()=>Lk}])}},Ik=new class extends H{constructor(){super(`stream.video.sfu.signal.UpdateSubscriptionsResponse`,[{no:4,name:`error`,kind:`message`,T:()=>tk}])}},Lk=new class extends H{constructor(){super(`stream.video.sfu.signal.TrackSubscriptionDetail
466s`,[{no:1,name:`user_id`,kind:`scalar`,T:9},{no:2,name:`session_id`,kind:`scalar`,T:9},{no:3,name:`track_type`,kind:`enum`,T:()=>[`stream.video.sfu.models.TrackType`,U,`TRACK_TYPE_`]},{no:4,name:`dimension`,kind:`message`,T:()=>qO}])}},Rk=new class extends H{constructor(){super(`stream.video.sfu.signal.SendAnswerRequest`,[{no:1,name:`peer_type`,kind:`enum`,T:()=>[`stream.video.sfu.models.PeerType`,DO,`PEER_TYPE_`]},{no:2,name:`sdp`,kind:`scalar`,T:9},{no:3,name:`session_id`,kind:`scalar`,T:9},{no:4,name:`negotiation_id`,kind:`scalar`,T:13}])}},zk=new class extends H{constructor(){super(`stream.video.sfu.signal.SendAnswerResponse`,[{no:4,name:`error`,kind:`message`,T:()=>tk}])}},Bk=new class extends H{constructor(){super(`stream.video.sfu.signal.ICETrickleResponse`,[{no:4,name:`error`,kind:`message`,T:()=>tk}])}},Vk=new Xre(`stream.video.sfu.signal.SignalServer`,[{name:`SetPublisher`,options:{},I:new class extends H{constructor(){super(`stream.video.sfu.signal.SetPublisherRequest`,[{no:1,name:`sdp`,kind:`scalar`,T:9},{no:2,name:`session_id`,kind:`scalar`,T:9},{no:3,name:`tracks`,kind:`message`,repeat:2,T:()=>ek}])}},O:new class extends H{constructor(){super(`stream.video.sfu.signal.SetPublisherResponse`,[{no:1,name:`sdp`,kind:`scalar`,T:9},{no:2,name:`session_id`,kind:`scalar`,T:9},{no:3,name:`ice_restart`,kind:`scalar`,T:8},{no:4,name:`error`,kind:`message`,T:()=>tk}])}}},{name:`SendAnswer`,options:{},I:Rk,O:zk},{name:`IceTrickle`,options:{},I:QO,O:Bk},{name:`UpdateSubscriptions`,options:{},I:Fk,O:Ik},{name:`UpdateMuteStates`,options:{},I:Mk,O:Nk},{name:`IceRestart`,options:{},I:Ak,O:jk},{name:`SendStats`,options:{},I:Ok,O:kk},{name:`SendMetrics`,options:{},I:Ek,O:Dk},{name:`StartNoiseCancellation`,options:{},I:bk,O:xk},{name:`StopNoiseCancellation`,options:{},I:Sk,O:Ck}]),Hk=new class extends H{constructor(){super(`stream.video.sfu.event.SfuEvent`,[{no:1,name:`subscriber_offer`,kind:`message`,oneof:`eventPayload`,T:()=>sA},{no:2,name:`publisher_answer`,kind:`message`,oneof:`eventPayload`,T:()=>cA},{no:3,name:`connection_quality_changed`,kind:`message`,oneof:`eventPayload`,T:()=>lA},{no:4,name:`audio_level_changed`,kind:`message`,oneof:`eventPayload`,T:()=>pA},{no:5,name:`ice_trickle`,kind:`message`,oneof:`eventPayload`,T:()=>QO},{no:6,name:`change_publish_quality`,kind:`message`,oneof:`eventPayload`,T:()=>_A},{no:10,name:`participant_joined`,kind:`message`,oneof:`eventPayload`,T:()=>iA},{no:11,name:`participant_left`,kind:`message`,oneof:`eventPayload`,T:()=>aA},{no:12,name:`dominant_speaker_changed`,kind:`message`,oneof:`eventPayload`,T:()=>dA},{no:13,name:`join_response`,kind:`message`,oneof:`eventPayload`,T:()=>rA},{no:14,name:`health_check_response`,kind:`message`,oneof:`eventPayload`,T:()=>Zk},{no:16,name:`track_published`,kind:`message`,oneof:`eventPayload`,T:()=>Qk},{no:17,name:`track_unpublished`,kind:`message`,oneof:`eventPayload`,T:()=>$k},{no:18,name:`error`,kind:`message`,oneof:`eventPayload`,T:()=>Kk},{no:19,name:`call_grants_updated`,kind:`message`,oneof:`eventPayload`,T:()=>vA},{no:20,name:`go_away`,kind:`message`,oneof:`eventPayload`,T:()=>yA},{no:21,name:`ice_restart`,kind:`message`,oneof:`eventPayload`,T:()=>qk},{no:22,name:`pins_updated`,kind:`message`,oneof:`eventPayload`,T:()=>Gk},{no:23,name:`call_ended`,kind:`message`,oneof:`eventPayload`,T:()=>bA},{no:24,name:`participant_updated`,kind:`message`,oneof:`eventPayload`,T:()=>oA},{no:25,name:`participant_migration_complete`,kind:`message`,oneof:`eventPayload`,T:()=>Wk},{no:27,name:`change_publish_options`,kind:`message`,oneof:`eventPayload`,T:()=>Uk},{no:28,name:`inbound_state_notification`,kind:`message`,oneof:`eventPayload`,T:()=>xA}])}},Uk=new class extends H{constructor(){super(`stream.video.sfu.event.ChangePublishOptions`,[{no:1,name:`publish_options`,kind:`message`,repeat:2,T:()=>XO},{no:2,name:`reason`,kind:`scalar`,T:9}])}};new class extends H{constructor(){super(`stream.video.sfu.event.ChangePublishOptionsComplete`,[])}};var Wk=new class extends H{constructor(){super(`stream.video.sfu.event.ParticipantMigrationComplete`,[])}},Gk=new class extends H{constructor(){super(`stream.video.sfu.event.PinsChanged`,[{no:1,name:`pins`,kind:`message`,repeat:2,T:()=>WO}])}},Kk=new class extends H{constructor(){super(`stream.video.sfu.event.Error`,[{no:4,name:`error`,kind:`message`,T:()=>tk},{no:5,name:`reconnect_strategy`,kind:`enum`,T:()=>[`stream.video.sfu.models.WebsocketReconnectStrategy`,LO,`WEBSOCKET_RECONNECT_STRATEGY_`]}])}};new class extends H{constructor(){super(`stream.video.sfu.event.ICETrickle`,[{no:1,name:`peer_type`,kind:`enum`,T:()=>[`stream.video.sfu.models.PeerType`,DO,`PEER_TYPE_`]},{no:2,name:`ice_candidate`,kind:`scalar`,T:9}])}};var qk=new class extends H{constructor(){super(`stream.video.sfu.event.ICERestart`,[{no:1,name:`peer_type`,kind:`enum`,T:()=>[`stream.video.sfu.models.PeerType`,DO,`PEER_TYPE_`]}])}},Jk=new class extends H{constructor(){super(`stream.video.sfu.event.SfuRequest`,[{no:1,name:`join_request`,kind:`message`,oneof:`requestPayload`,T:()=>eA},{no:2,name:`health_check_request`,kind:`message`,oneof:`requestPayload`,T:()=>Xk},{no:3,name:`leave_call_request`,kind:`message`,oneof:`requestPayload`,T:()=>Yk}])}},Yk=new class extends H{constructor(){super(`stream.video.sfu.event.LeaveCallRequest`,[{no:1,name:`session_id`,kind:`scalar`,T:9},{no:2,name:`reason`,kind:`scalar`,T:9}])}},Xk=new class extends H{constructor(){super(`stream.video.sfu.event.HealthCheckRequest`,[])}},Zk=new class extends H{constructor(){super(`stream.video.sfu.event.HealthCheckResponse`,[{no:1,name:`participant_count`,kind:`message`,T:()=>UO}])}},Qk=new class extends H{constructor(){super(`stream.video.sfu.event.TrackPublished`,[{no:1,name:`user_id`,kind:`scalar`,T:9},{no:2,name:`session_id`,kind:`scalar`,T:9},{no:3,name:`type`,kind:`enum`,T:()=>[`stream.video.sfu.models.TrackType`,U,`TRACK_TYPE_`]},{no:4,name:`participant`,kind:`message`,T:()=>GO}])}},$k=new class extends H{constructor(){super(`stream.video.sfu.event.TrackUnpublished`,[{no:1,name:`user_id`,kind:`scalar`,T:9},{no:2,name:`session_id`,kind:`scalar`,T:9},{no:3,name:`type`,kind:`enum`,T:()=>[`stream.video.sfu.models.TrackType`,U,`TRACK_TYPE_`]},{no:4,name:`cause`,kind:`enum`,T:()=>[`stream.video.sfu.models.TrackUnpublishReason`,PO,`TRACK_UNPUBLISH_REASON_`]},{no:5,name:`participant`,kind:`message`,T:()=>GO}])}},eA=new class extends H{constructor(){super(`stream.video.sfu.event.JoinRequest`,[{no:1,name:`token`,kind:`scalar`,T:9},{no:2,name:`session_id`,kind:`scalar`,T:9},{no:13,name:`unified_session_id`,kind:`scalar`,T:9},{no:3,name:`subscriber_sdp`,kind:`scalar`,T:9},{no:8,name:`publisher_sdp`,kind:`scalar`,T:9},{no:4,name:`client_details`,kind:`message`,T:()=>nk},{no:5,name:`migration`,kind:`message`,T:()=>nA},{no:6,name:`fast_reconnect`,kind:`scalar`,T:8},{no:7,name:`reconnect_details`,kind:`message`,T:()=>tA},{no:9,name:`preferred_publish_options`,kind:`message`,repeat:2,T:()=>XO},{no:10,name:`preferred_subscribe_options`,kind:`message`,repeat:2,T:()=>YO},{no:11,name:`capabilities`,kind:`enum`,repeat:1,T:()=>[`stream.video.sfu.models.ClientCapability`,BO,`CLIENT_CAPABILITY_`]},{no:12,name:`source`,kind:`enum`,T:()=>[`stream.video.sfu.models.ParticipantSource`,AO,`PARTICIPANT_SOURCE_`]}])}}
466,tA=new class extends H{constructor(){super(`stream.video.sfu.event.ReconnectDetails`,[{no:1,name:`strategy`,kind:`enum`,T:()=>[`stream.video.sfu.models.WebsocketReconnectStrategy`,LO,`WEBSOCKET_RECONNECT_STRATEGY_`]},{no:3,name:`announced_tracks`,kind:`message`,repeat:2,T:()=>ek},{no:4,name:`subscriptions`,kind:`message`,repeat:2,T:()=>Lk},{no:5,name:`reconnect_attempt`,kind:`scalar`,T:13},{no:6,name:`from_sfu_id`,kind:`scalar`,T:9},{no:7,name:`previous_session_id`,kind:`scalar`,T:9},{no:8,name:`reason`,kind:`scalar`,T:9}])}},nA=new class extends H{constructor(){super(`stream.video.sfu.event.Migration`,[{no:1,name:`from_sfu_id`,kind:`scalar`,T:9},{no:2,name:`announced_tracks`,kind:`message`,repeat:2,T:()=>ek},{no:3,name:`subscriptions`,kind:`message`,repeat:2,T:()=>Lk}])}},rA=new class extends H{constructor(){super(`stream.video.sfu.event.JoinResponse`,[{no:1,name:`call_state`,kind:`message`,T:()=>HO},{no:2,name:`reconnected`,kind:`scalar`,T:8},{no:3,name:`fast_reconnect_deadline_seconds`,kind:`scalar`,T:5},{no:4,name:`publish_options`,kind:`message`,repeat:2,T:()=>XO}])}},iA=new class extends H{constructor(){super(`stream.video.sfu.event.ParticipantJoined`,[{no:1,name:`call_cid`,kind:`scalar`,T:9},{no:2,name:`participant`,kind:`message`,T:()=>GO},{no:3,name:`is_pinned`,kind:`scalar`,T:8}])}},aA=new class extends H{constructor(){super(`stream.video.sfu.event.ParticipantLeft`,[{no:1,name:`call_cid`,kind:`scalar`,T:9},{no:2,name:`participant`,kind:`message`,T:()=>GO}])}},oA=new class extends H{constructor(){super(`stream.video.sfu.event.ParticipantUpdated`,[{no:1,name:`call_cid`,kind:`scalar`,T:9},{no:2,name:`participant`,kind:`message`,T:()=>GO}])}},sA=new class extends H{constructor(){super(`stream.video.sfu.event.SubscriberOffer`,[{no:1,name:`ice_restart`,kind:`scalar`,T:8},{no:2,name:`sdp`,kind:`scalar`,T:9},{no:3,name:`negotiation_id`,kind:`scalar`,T:13}])}},cA=new class extends H{constructor(){super(`stream.video.sfu.event.PublisherAnswer`,[{no:1,name:`sdp`,kind:`scalar`,T:9}])}},lA=new class extends H{constructor(){super(`stream.video.sfu.event.ConnectionQualityChanged`,[{no:1,name:`connection_quality_updates`,kind:`message`,repeat:2,T:()=>uA}])}},uA=new class extends H{constructor(){super(`stream.video.sfu.event.ConnectionQualityInfo`,[{no:1,name:`user_id`,kind:`scalar`,T:9},{no:2,name:`session_id`,kind:`scalar`,T:9},{no:3,name:`connection_quality`,kind:`enum`,T:()=>[`stream.video.sfu.models.ConnectionQuality`,OO,`CONNECTION_QUALITY_`]}])}},dA=new class extends H{constructor(){super(`stream.video.sfu.event.DominantSpeakerChanged`,[{no:1,name:`user_id`,kind:`scalar`,T:9},{no:2,name:`session_id`,kind:`scalar`,T:9}])}},fA=new class extends H{constructor(){super(`stream.video.sfu.event.AudioLevel`,[{no:1,name:`user_id`,kind:`scalar`,T:9},{no:2,name:`session_id`,kind:`scalar`,T:9},{no:3,name:`level`,kind:`scalar`,T:2},{no:4,name:`is_speaking`,kind:`scalar`,T:8}])}},pA=new class extends H{constructor(){super(`stream.video.sfu.event.AudioLevelChanged`,[{no:1,name:`audio_levels`,kind:`message`,repeat:2,T:()=>fA}])}},mA=new class extends H{constructor(){super(`stream.video.sfu.event.AudioSender`,[{no:2,name:`codec`,kind:`message`,T:()=>ZO},{no:3,name:`track_type`,kind:`enum`,T:()=>[`stream.video.sfu.models.TrackType`,U,`TRACK_TYPE_`]},{no:4,name:`publish_option_id`,kind:`scalar`,T:5}])}},hA=new class extends H{constructor(){super(`stream.video.sfu.event.VideoLayerSetting`,[{no:1,name:`name`,kind:`scalar`,T:9},{no:2,name:`active`,kind:`scalar`,T:8},{no:3,name:`max_bitrate`,kind:`scalar`,T:5},{no:4,name:`scale_resolution_down_by`,kind:`scalar`,T:2},{no:6,name:`codec`,kind:`message`,T:()=>ZO},{no:7,name:`max_framerate`,kind:`scalar`,T:13},{no:8,name:`scalability_mode`,kind:`scalar`,T:9}])}},gA=new class extends H{constructor(){super(`stream.video.sfu.event.VideoSender`,[{no:2,name:`codec`,kind:`message`,T:()=>ZO},{no:3,name:`layers`,kind:`message`,repeat:2,T:()=>hA},{no:4,name:`track_type`,kind:`enum`,T:()=>[`stream.video.sfu.models.TrackType`,U,`TRACK_TYPE_`]},{no:5,name:`publish_option_id`,kind:`scalar`,T:5},{no:6,name:`degradation_preference`,kind:`enum`,T:()=>[`stream.video.sfu.models.DegradationPreference`,VO,`DEGRADATION_PREFERENCE_`]}])}},_A=new class extends H{constructor(){super(`stream.video.sfu.event.ChangePublishQuality`,[{no:1,name:`audio_senders`,kind:`message`,repeat:2,T:()=>mA},{no:2,name:`video_senders`,kind:`message`,repeat:2,T:()=>gA}])}},vA=new class extends H{constructor(){super(`stream.video.sfu.event.CallGrantsUpdated`,[{no:1,name:`current_grants`,kind:`message`,T:()=>lk},{no:2,name:`message`,kind:`scalar`,T:9}])}},yA=new class extends H{constructor(){super(`stream.video.sfu.event.GoAway`,[{no:1,name:`reason`,kind:`enum`,T:()=>
466[`stream.video.sfu.models.GoAwayReason`,FO,`GO_AWAY_REASON_`]}])}},bA=new class extends H{constructor(){super(`stream.video.sfu.event.CallEnded`,[{no:1,name:`reason`,kind:`enum`,T:()=>[`stream.video.sfu.models.CallEndedReason`,IO,`CALL_ENDED_REASON_`]}])}},xA=new class extends H{constructor(){super(`stream.video.sfu.event.InboundStateNotification`,[{no:1,name:`inbound_video_states`,kind:`message`,repeat:2,T:()=>SA}])}},SA=new class extends H{constructor(){super(`stream.video.sfu.event.InboundVideoState`,[{no:1,name:`user_id`,kind:`scalar`,T:9},{no:2,name:`session_id`,kind:`scalar`,T:9},{no:3,name:`track_type`,kind:`enum`,T:()=>[`stream.video.sfu.models.TrackType`,U,`TRACK_TYPE_`]},{no:4,name:`paused`,kind:`scalar`,T:8}])}},CA;(function(e){e.UNKNOWN=`UNKNOWN`,e.VISIBLE=`VISIBLE`,e.INVISIBLE=`INVISIBLE`})(CA||={});var wA;(function(e){e[e.IMMEDIATE=20]=`IMMEDIATE`,e[e.FAST=100]=`FAST`,e[e.MEDIUM=600]=`MEDIUM`,e[e.SLOW=1200]=`SLOW`})(wA||={});var TA=class{constructor(e){this._transport=e,this.typeName=Vk.typeName,this.methods=Vk.methods,this.options=Vk.options}setPublisher(e,t){let n=this.methods[0],r=this._transport.mergeOptions(t);return CE(`unary`,this._transport,n,r,e)}sendAnswer(e,t){let n=this.methods[1],r=this._transport.mergeOptions(t);return CE(`unary`,this._transport,n,r,e)}iceTrickle(e,t){let n=this.methods[2],r=this._transport.mergeOptions(t);return CE(`unary`,this._transport,n,r,e)}updateSubscriptions(e,t){let n=this.methods[3],r=this._transport.mergeOptions(t);return CE(`unary`,this._transport,n,r,e)}updateMuteStates(e,t){let n=this.methods[4],r=this._transport.mergeOptions(t);return CE(`unary`,this._transport,n,r,e)}iceRestart(e,t){let n=this.methods[5],r=this._transport.mergeOptions(t);return CE(`unary`,this._transport,n,r,e)}sendStats(e,t){let n=this.methods[6],r=this._transport.mergeOptions(t);return CE(`unary`,this._transport,n,r,e)}sendMetrics(e,t){let n=this.methods[7],r=this._transport.mergeOptions(t);return CE(`unary`,this._transport,n,r,e)}startNoiseCancellation(e,t){let n=this.methods[8],r=this._transport.mergeOptions(t);return CE(`unary`,this._transport,n,r,e)}stopNoiseCancellation(e,t){let n=this.methods[9],r=this._transport.mergeOptions(t);return CE(`unary`,this._transport,n,r,e)}},EA={baseUrl:``,sendJson:!0,timeout:5*1e3,jsonOptions:{ignoreUnknownFields:!0}},DA=e=>({interceptUnary(t,n,r,i){return i.meta={...i.meta,...e},t(n,r,i)}}),OA=`@@stream-io/timeout`,kA=(e,t)=>{let n=n=>{let r=new AbortController,i=setTimeout(()=>{t?.(`${n}Timeout`,[e]);let i=Error(OA);i.name=`AbortError`,r.abort(i)},e);return[r.signal,()=>clearTimeout(i)]};return{interceptUnary(e,t,r,i){if(i.abort)return e(t,r,i);let[a,o]=n(t.name),s=e(t,r,{...i,abort:a});return s.then(o,o),s}}},AA=(e,t=`trace`)=>({interceptUnary:(n,r,i,a)=>{let o=n(r,i,a);return e[t](`Invoked SFU RPC method ${r.name}`,{request:o.request,headers:o.requestHeaders,response:o.response}),o}}),jA=e=>{let t=new Set([`SendStats`]),n=new Set([`SetPublisher`]),r=(t,n,r)=>e(`${t}OnFailure`,[r,n]);return{interceptUnary(i,a,o,s){let c=a.name;if(t.has(c))return i(a,o,s);let{invocationMeta:{attempt:l=0}={}}=s,u=l===0?c:`${c}(${l})`;e(u,o);let d=i(a,o,s);return d.then(t=>{let i=t.response;i.error&&r(u,o,i.error),n.has(c)&&e(`${u}Response`,i)},e=>r(c,o,e)),d}}},MA=e=>new TA(new rie({...EA,...e})),NA=e=>new Promise(t=>setTimeout(t,e)),PA=async(e,t)=>{let n,r=new Promise((e,r)=>{n=setTimeout(()=>r(Error(`timebox error`)),t)});try{return await Promise.race([Promise.all(e),r])}finally{clearTimeout(n)}};function FA(e){return e&&(Object.prototype.toString.call(e)===`[object Function]`||typeof e==`function`||e instanceof Function)}var IA={TOKEN_EXPIRED:40,WS_CLOSED_SUCCESS:1e3};function LA(e){let t=Math.min(500+e*2e3,5e3),n=Math.min(Math.max(250,(e-1)*2e3),5e3);return Math.floor(Math.random()*(t-n)+n)}function RA(e){let t=``;for(let n=0;n<e.length;n++)t+=e[n].toString(16).padStart(2,`0`);return t}function zA(){let e=VA(16);return e[6]=e[6]&15|64,e[8]=e[8]&191|128,[RA(e.subarray(0,4)),RA(e.subarray(4,6)),RA(e.subarray(6,8)),RA(e.subarray(8,10)),RA(e.subarray(10,16))].join(`-`)}var BA=typeof crypto<`u`&&crypto.getRandomValues?crypto.getRandomValues.bind(crypto):function(e){let t=2**(8*e.byteLength/e.length);for(let n=0;n<e.length;n++)e[n]=Math.random()*t};function VA(e){let t=new Uint8Array(e);return BA(t),t}function HA(e){typeof window<`u`&&window.addEventListener&&(window.addEventListener(`offline`,e),window.addEventListener(`online`,e))}function UA(e){typeof window<`u`&&window.removeEventListener&&(window.removeEventListener(`offline`,e),window.removeEventListener(`online`,e))}function WA(e){return!e.status||e.status<200||300<=e.status}function GA(e){return e.code!==void 0}var KA=()=>typeof navigator>`u`?!1:navigator.product?.toLowerCase()===`reactnative`,qA=(e,t,...n)=>{let r;switch(e){case`error`:if(KA()){t=`ERROR: ${t}`,r=console.info;break}r=console.error;break;case`warn`:if(KA()){t=`WARN: ${t}`,r=console.info;break}r=console.warn;break;case`info`:r=console.info;break;case`trace`:r=console.trace;break;default:r=console.log;break}r(t,...n)},JA=aie(),YA=async(e,t,n=1/0)=>{let r=0,i;do{r>0&&await NA(LA(r));try{i=await e({attempt:r})}catch(e){let i=e instanceof yE&&e.message!==OA&&e.code===wE[wE.cancelled],a=t?.aborted??!1;if(i||a||r+1>=n)throw e;JA.getLogger(`sfu-client`,{tags:[`rpc`]}).debug(`rpc failed (${r})`,e),r++}}while(!i||i.response.error?.shouldRetry);return i},XA=(e,t,n)=>{if(e.mid)return e.mid;if(!n)return String(t);let r=e.sender.track,i=(0,mO.parse)(n).media.find(e=>e.type===r.kind&&(e.msid?.includes(r.id)??!0));return i?.mid===void 0?t<0?``:String(t):String(i.mid)},ZA=(e,t,n,r)=>{let i=Math.min(t,Math.max(300,n*t)),a=(0,mO.parse)(e),o=new Set([`av1`,`vp9`,`h264`]);for(let e of a.media)if(e.type===`video`&&String(e.mid)===r)for(let t of e.rtp){if(!o.has(t.codec.toLowerCase()))continue;let n=e.fmtp??=[],r=n.find(e=>e.payload===t.payload);if(r){let e=r.config??``;e.includes(`x-google-start-bitrate`)||(r.config=e?`${e};x-google-start-bitrate=${i}`:`x-google-start-bitrate=${i}`)}else n.push({payload:t.payload,config:`x-google-start-bitrate=${i}`})}return(0,mO.write)(a)},QA=(e,t)=>{let n=new Set,r=(0,mO.parse)(e);for(let e of r.media){if(e.type!==`audio`)continue;let t=e.rtp.find(e=>e.codec===`opus`);
466if(t)for(let r of e.fmtp)r.payload===t.payload&&r.config.includes(`stereo=1`)&&n.add(e.mid)}if(n.size===0)return t;let i=(0,mO.parse)(t);for(let e of i.media){if(e.type!==`audio`||!n.has(e.mid))continue;let t=e.rtp.find(e=>e.codec===`opus`);if(t)for(let n of e.fmtp)n.payload===t.payload&&!n.config.includes(`stereo=1`)&&(n.config+=`;stereo=1`)}return(0,mO.write)(i)},$A=(e,t,n)=>{let[r,i]=ej(t).split(`/`);if(!r||!i)return e;let a=(0,mO.parse)(e);for(let e of a.media){if(e.type!==r)continue;let t=new Set;for(let n of e.rtp)n.codec.toLowerCase()===i&&t.add(n.payload);if(n){let r=new Set,i=new Set(n.split(`;`));for(let n of e.fmtp)t.has(n.payload)&&i.difference(new Set(n.config.split(`;`))).size===0&&r.add(n.payload);t=r}if(t.size===0&&!n)continue;for(let n of e.fmtp){let e=/\s*apt\s*=\s*(\d+)\s*/i.exec(n.config);if(!e)continue;let r=Number(e[1]);t.has(r)&&t.add(n.payload)}e.rtp=e.rtp.filter(e=>t.has(e.payload)),e.fmtp=e.fmtp.filter(e=>t.has(e.payload)),e.rtcpFb=e.rtcpFb?.filter(e=>typeof e.payload==`number`?t.has(e.payload):!0);let a=[];for(let n of(e.payloads||``).split(/\s+/)){let e=Number(n);t.has(e)&&a.push(e)}e.payloads=a.join(` `)}return(0,mO.write)(a)},ej=(e,t=`video`)=>e.includes(`/`)?e:`${t}/${e}`,tj=async(e,t,n)=>{let r=new RTCPeerConnection;r.addTransceiver(`video`,{direction:e}),r.addTransceiver(`audio`,{direction:e});let{sdp:i=``}=await r.createOffer(),a=t?$A(i,t,n):i;return r.getTransceivers().forEach(e=>{e.stop?.()}),r.close(),a},nj=e=>e?(e=e.toLowerCase(),e===`vp9`||e===`av1`||e===`video/vp9`||e===`video/av1`):!1,rj={subscriberOffer:void 0,publisherAnswer:void 0,connectionQualityChanged:void 0,audioLevelChanged:void 0,iceTrickle:void 0,changePublishQuality:void 0,participantJoined:void 0,participantLeft:void 0,dominantSpeakerChanged:void 0,joinResponse:void 0,healthCheckResponse:void 0,trackPublished:void 0,trackUnpublished:void 0,error:void 0,callGrantsUpdated:void 0,goAway:void 0,iceRestart:void 0,pinsUpdated:void 0,callEnded:void 0,participantUpdated:void 0,participantMigrationComplete:void 0,changePublishOptions:void 0,inboundStateNotification:void 0},ij=e=>Object.prototype.hasOwnProperty.call(rj,e),aj=class{constructor(){this.logger=JA.getLogger(`Dispatcher`),this.subscribers=new Map,this.dispatch=(e,t=`*`)=>{let n=e.eventPayload.oneofKind;if(!n)return;let r=e.eventPayload[n];this.logger.debug(`Dispatching ${n}, tag=${t}`,r);let i=this.subscribers.get(n);if(!i)return;let{byTag:a,dynamic:o}=i;this.emit(r,a.get(t)),t!==`*`&&this.emit(r,a.get(`*`)),this.emitDynamic(r,t,o)},this.emit=(e,t=[])=>{for(let n of t)this.emitOne(e,n)},this.emitDynamic=(e,t,n)=>{for(let{tagSelector:r,listener:i}of n){let n=r();(n===t||t!==`*`&&n===`*`)&&this.emitOne(e,i)}},this.emitOne=(e,t)=>{try{t(e)}catch(e){this.logger.warn(`Listener failed with error`,e)}},this.on=(e,t,n)=>{let{byTag:r,dynamic:i}=this.getHandlers(e),a=n;if(typeof t==`string`){let e=r.get(t)??[];e.push(a),r.set(t,e)}else i.push({tagSelector:t,listener:a});return()=>{this.off(e,t,n)}},this.off=(e,t,n)=>{let r=this.subscribers.get(e);if(!r)return;let{byTag:i,dynamic:a}=r;if(typeof t==`string`){let e=i.get(t)||[],r=e.indexOf(n);r>=0&&e.splice(r,1)}else{let e=a.findIndex(({tagSelector:e,listener:r})=>e===t&&r===n);e>=0&&a.splice(e,1)}},this.getHandlers=e=>{let t=this.subscribers.get(e);if(t)return t;let n={byTag:new Map,dynamic:[]};return this.subscribers.set(e,n),n}}},oj=class extends Error{constructor(e){super(e.message),this.name=`NegotiationError`,this.error=e}},sj=class{constructor(){this.subscriberCandidates=new mD,this.publisherCandidates=new mD,this.push=e=>{let t=cj(e);t&&(e.peerType===DO.SUBSCRIBER?this.subscriberCandidates.next(t):e.peerType===DO.PUBLISHER_UNSPECIFIED?this.publisherCandidates.next(t):JA.getLogger(`sfu-client`).warn(`ICETrickle, Unknown peer type`,e))},this.dispose=()=>{this.subscriberCandidates.complete(),this.publisherCandidates.complete()}}},cj=e=>{try{return JSON.parse(e.iceCandidate)}catch(t){JA.getLogger(`sfu-client`).error(`Failed to parse ICE Trickle`,t,e);return}},lj=mj(hj),uj=mj(gj),dj=new Map;function fj(e){return dj.has(e)}async function pj(e){let t;for(;t=dj.get(e);)await t.promise}function mj(e){return function(t,n){let{cb:r,onContinued:i}=e(t,n),a=dj.get(t);a?.onContinued();let o=a?a.promise.then(r,r):r();return dj.set(t,{promise:o,onContinued:i}),o}}function hj(e,t){let n=!1;return{cb:()=>t().finally(()=>{n||dj.delete(e)}),onContinued:()=>n=!0}
466}function gj(e,t){let n=new AbortController;return{cb:()=>n.signal.aborted?Promise.resolve(`canceled`):t(n.signal).finally(()=>{n.signal.aborted||dj.delete(e)}),onContinued:()=>n.abort()}}var _j=e=>typeof e==`function`,vj=e=>{let t,n;if(zD([e]).subscribe({next:([e])=>{t=e},error:e=>{n=e}}).unsubscribe(),n)throw n;return t},yj=(e,t)=>{let n=_j(t)?t(vj(e)):t;return e.next(n),n},bj=async(e,t)=>lj(e,async()=>{let n=await t(vj(e));return e.next(n),n}),xj=(e,t)=>{let n=e.getValue();return{lastValue:n,value:yj(e,t),rollback:()=>yj(e,n)}},Sj=(e,t,n=e=>JA.getLogger(`RxUtils`).warn(`An observable emitted an error`,e))=>{let r=e.subscribe({next:t,error:n});return()=>{r.unsubscribe()}},Cj=(e,t)=>{let n=Symbol();return Sj(e,e=>{lj(n,()=>t(e))})},wj=Object.freeze({__proto__:null,createSafeAsyncSubscription:Cj,createSubscription:Sj,getCurrentValue:vj,setCurrentValue:yj,setCurrentValueAsync:bj,updateValue:xj}),W;(function(e){e.UNKNOWN=`unknown`,e.IDLE=`idle`,e.RINGING=`ringing`,e.JOINING=`joining`,e.JOINED=`joined`,e.LEFT=`left`,e.RECONNECTING=`reconnecting`,e.MIGRATING=`migrating`,e.RECONNECTING_FAILED=`reconnecting-failed`,e.OFFLINE=`offline`})(W||={});var Tj=class{constructor(){this.connectedUserSubject=new fD(void 0),this.callsSubject=new fD([]),this.setConnectedUser=e=>yj(this.connectedUserSubject,e),this.setCalls=e=>yj(this.callsSubject,e),this.registerCall=e=>{this.calls.find(t=>t.cid===e.cid)||this.setCalls(t=>[...t,e])},this.registerOrUpdateCall=e=>this.calls.find(t=>t.cid===e.cid)?this.setCalls(t=>t.map(t=>t.cid===e.cid?e:t)):this.registerCall(e),this.unregisterCall=e=>(JA.getLogger(`client-state`).trace(`Unregistering call: ${e.cid}`),this.setCalls(t=>t.filter(t=>t!==e))),this.findCall=(e,t)=>this.calls.find(n=>n.type===e&&n.id===t),this.connectedUserSubject.subscribe(async e=>{if(!e){let e=JA.getLogger(`client-state`);for(let t of this.calls)t.state.callingState!==W.LEFT&&(e.info(`User disconnected, leaving call: ${t.cid}`),await t.leave({message:`client.disconnectUser() called`}).catch(n=>{e.error(`Error leaving call: ${t.cid}`,n)}))}})}get connectedUser(){return this.connectedUserSubject.getValue()}get calls(){return vj(this.callsSubject)}},Ej=class{constructor(e){this.connectedUser$=e.connectedUserSubject.asObservable(),this.calls$=e.callsSubject.asObservable()}get connectedUser(){return vj(this.connectedUser$)}get calls(){return vj(this.calls$)}},Dj=(...e)=>(t,n)=>{for(let r of e){let e=r(t,n);if(e!==0)return e}return 0},Oj=e=>t=>(n,r)=>e(n,r)?t(n,r):0,kj=e=>e.publishedTracks.includes(U.VIDEO),Aj=e=>e.publishedTracks.includes(U.AUDIO),jj=e=>e.publishedTracks.includes(U.SCREEN_SHARE),Mj=e=>e.publishedTracks.includes(U.SCREEN_SHARE_AUDIO),Nj=e=>!!e.pin&&(e.pin.isLocalPin||e.pin.pinnedAt>0),Pj=(e,t)=>{if(!e.pausedTracks)return!1;let n=t===`videoTrack`?U.VIDEO:t===`screenShareTrack`?U.SCREEN_SHARE:void 0;return n?e.pausedTracks.includes(n):!1},Fj=(e,t)=>e.isDominantSpeaker&&!t.isDominantSpeaker?-1:!e.isDominantSpeaker&&t.isDominantSpeaker?1:0,Ij=(e,t)=>e.isSpeaking&&!t.isSpeaking?-1:!e.isSpeaking&&t.isSpeaking?1:0,Lj=(e,t)=>{let n=jj(e),r=jj(t);return n&&!r?-1:!n&&r?1:0},Rj=(e,t)=>{let n=kj(e),r=kj(t);return n&&!r?-1:!n&&r?1:0},zj=(e,t)=>{let n=Aj(e),r=Aj(t);return n&&!r?-1:!n&&r?1:0},Bj=(e,t)=>{if(e.pin&&t.pin){if(!e.pin.isLocalPin&&t.pin.isLocalPin)return-1;if(e.pin.isLocalPin&&!t.pin.isLocalPin)return 1;if(e.pin.pinnedAt>t.pin.pinnedAt)return-1;if(e.pin.pinnedAt<t.pin.pinnedAt)return 1}return e.pin&&!t.pin?-1:!e.pin&&t.pin?1:0},Vj=(...e)=>{let t=e=>e===-1?2**53-1:e;return(n,r)=>{let i=t(e.indexOf(n.source)),a=t(e.indexOf(r.source));return i<a?-1:+(i>a)}},Hj=e=>(t,n)=>t.reaction?.type===e&&n.reaction?.type!==e?-1:+(t.reaction?.type!==e&&n.reaction?.type===e),Uj=(...e)=>(t,n)=>{let r=Wj(t,e),i=Wj(n,e);return r&&!i?-1:!r&&i?1:0},Wj=(e,t)=>(e.roles||[]).some(e=>t.includes(e)),Gj=Oj((e,t)=>e.viewportVisibilityState?.videoTrack===CA.INVISIBLE||t.viewportVisibilityState?.videoTrack===CA.INVISIBLE),Kj=Oj((e,t)=>e.viewportVisibilityState?.videoTrack===CA.INVISIBLE||e.viewportVisibilityState?.videoTrack===CA.UNKNOWN||t.viewportVisibilityState?.videoTrack===CA.INVISIBLE||t.viewportVisibilityState?.videoTrack===CA.UNKNOWN),qj=Vj(AO.RTMP,AO.SRT,AO.WHIP,AO.RTSP),Jj=Dj(Lj,Bj,Gj(Dj(Fj,Ij,Hj(`raised-hand`),Rj,zj))),Yj=Dj(Lj,Bj,Fj,Gj(Dj(Ij,Hj(`raised-hand`),qj,Rj,zj))),Xj=Dj(Bj,Kj(Dj(Fj,Ij,Hj(`raised-hand`),qj,Rj,zj))),Zj=Dj(Kj(Dj(Fj,Ij,Hj(`raised-hand`),qj,Rj,zj)),Uj(`admin`,`host`,`speaker`)),Qj=(e,t)=>{JA.getLogger(`helpers`).warn(t,e)},$j={broadcasting:!1,hls:{playlist_url:``,status:``},rtmps:[]}
466,eM=class{constructor(){this.backstageSubject=new fD(!0),this.blockedUserIdsSubject=new fD([]),this.createdAtSubject=new fD(new Date),this.endedAtSubject=new fD(void 0),this.startsAtSubject=new fD(void 0),this.updatedAtSubject=new fD(new Date),this.createdBySubject=new fD(void 0),this.customSubject=new fD({}),this.egressSubject=new fD(void 0),this.ingressSubject=new fD(void 0),this.recordingSubject=new fD(!1),this.individualRecordingSubject=new fD(!1),this.rawRecordingSubject=new fD(!1),this.sessionSubject=new fD(void 0),this.settingsSubject=new fD(void 0),this.transcribingSubject=new fD(!1),this.captioningSubject=new fD(!1),this.endedBySubject=new fD(void 0),this.thumbnailsSubject=new fD(void 0),this.membersSubject=new fD([]),this.ownCapabilitiesSubject=new fD([]),this.callingStateSubject=new fD(W.UNKNOWN),this.startedAtSubject=new fD(void 0),this.participantCountSubject=new fD(0),this.anonymousParticipantCountSubject=new fD(0),this.participantsSubject=new fD([]),this.callStatsReportSubject=new fD(void 0),this.closedCaptionsSubject=new fD([]),this.orphanedTracks=[],this.callGrantsSubject=new mD(1),this.logger=JA.getLogger(`CallState`),this.sortParticipantsBy=Jj,this.closedCaptionsTasks=new Map,this.dispose=()=>{for(let[e,t]of this.closedCaptionsTasks.entries())clearTimeout(t),this.closedCaptionsTasks.delete(e)},this.setSortParticipantsBy=e=>{this.sortParticipantsBy=e,this.setCurrentValue(this.participantsSubject,e=>e)},this.getCurrentValue=vj,this.setCurrentValue=yj,this.setParticipantCount=e=>this.setCurrentValue(this.participantCountSubject,e),this.setStartedAt=e=>this.setCurrentValue(this.startedAtSubject,e),this.setCaptioning=e=>xj(this.captioningSubject,e),this.setAnonymousParticipantCount=e=>this.setCurrentValue(this.anonymousParticipantCountSubject,e),this.getParticipantsSnapshot=()=>this.participantsSubject.getValue(),this.setParticipants=e=>this.setCurrentValue(this.participantsSubject,e),this.setCallingState=e=>this.setCurrentValue(this.callingStateSubject,e),this.setCallStatsReport=e=>this.setCurrentValue(this.callStatsReportSubject,e),this.setMembers=e=>{this.setCurrentValue(this.membersSubject,e)},this.setOwnCapabilities=e=>this.setCurrentValue(this.ownCapabilitiesSubject,e),this.setCallGrants=e=>this.setCurrentValue(this.callGrantsSubject,e),this.setBackstage=e=>this.setCurrentValue(this.backstageSubject,e),this.setEndedAt=e=>this.setCurrentValue(this.endedAtSubject,e),this.findParticipantBySessionId=e=>this.participants.find(t=>t.sessionId===e),this.getParticipantLookupBySessionId=()=>this.participants.reduce((e,t)=>(e[t.sessionId]=t,e),{}),this.updateParticipant=(e,t)=>
466{let n=this.findParticipantBySessionId(e);if(!n){this.logger.debug(`Participant with sessionId ${e} not found`);return}let r=typeof t==`function`?t(n):t,i={...n,...r};return this.setParticipants(t=>t.map(t=>t.sessionId===e?i:t))},this.updateOrAddParticipant=(e,t,n)=>this.setParticipants(r=>{let i=!0,a=r.map(r=>{if(r.sessionId===e){i=!1;let e={...r,...t},a=typeof n==`function`?n(e):n;return Object.assign(e,a)}return r});return i&&a.push(t),a}),this.updateParticipants=e=>Object.keys(e).length===0?this.participants:this.setParticipants(t=>t.map(t=>{let n=e[t.sessionId];return n?{...t,...n}:t})),this.updateParticipantTracks=(e,t)=>this.updateParticipants(Object.entries(t).reduce((t,[n,r])=>{r.dimension&&(r.dimension.height=Math.ceil(r.dimension.height),r.dimension.width=Math.ceil(r.dimension.width));let i=e===`videoTrack`?`videoDimension`:e===`screenShareTrack`?`screenShareDimension`:void 0;return i&&(t[n]={[i]:r.dimension}),t},{})),this.updateFromEvent=e=>{let t=this.eventHandlers[e.type];t&&t(e)},this.setServerSidePins=e=>{let t=Date.now(),n=Symbol(`unknown`),r=e.reduce((r,i,a)=>{var o;let s=t+(e.length-a);return r[i.userId]?r[i.userId]=n:r[i.userId]=s,r[o=i.sessionId]??(r[o]=s),r},{});return this.setParticipants(e=>e.map(e=>{let t=r[e.sessionId]??r[e.userId];return typeof t==`number`&&typeof e.pin?.pinnedAt!=`number`?{...e,pin:{isLocalPin:!1,pinnedAt:t}}:typeof t!=`number`&&e.pin?.isLocalPin===!1?{...e,pin:void 0}:e}))},this.registerOrphanedTrack=e=>{this.orphanedTracks.push(e)},this.removeOrphanedTrack=e=>{this.orphanedTracks=this.orphanedTracks.filter(t=>t.id!==e)},this.takeOrphanedTracks=e=>{let t=this.orphanedTracks.filter(t=>t.trackLookupPrefix===e);return t.length>0&&(this.orphanedTracks=this.orphanedTracks.filter(t=>t.trackLookupPrefix!==e)),t},this.updateClosedCaptionSettings=e=>{this.closedCaptionsSettings={...this.closedCaptionsSettings,...e}},this.updateFromCallResponse=e=>{this.setBackstage(e.backstage),this.setCurrentValue(this.blockedUserIdsSubject,e.blocked_user_ids),this.setCurrentValue(this.createdAtSubject,new Date(e.created_at)),this.setCurrentValue(this.updatedAtSubject,new Date(e.updated_at)),this.setCurrentValue(this.startsAtSubject,e.
466starts_at?new Date(e.starts_at):void 0),this.setEndedAt(e.ended_at?new Date(e.ended_at):void 0),this.setCurrentValue(this.createdBySubject,e.created_by),this.setCurrentValue(this.customSubject,e.custom),this.setCurrentValue(this.egressSubject,e.egress),this.setCurrentValue(this.ingressSubject,e.ingress);let{individual_recording:t,composite_recording:n,raw_recording:r}=e.egress;this.setCurrentValue(this.recordingSubject,e.recording||n?.status===`running`),this.setCurrentValue(this.individualRecordingSubject,t?.status===`running`),this.setCurrentValue(this.rawRecordingSubject,r?.status===`running`);let i=this.setCurrentValue(this.sessionSubject,e.session);this.updateParticipantCountFromSession(i),this.setCurrentValue(this.settingsSubject,e.settings),this.setCurrentValue(this.transcribingSubject,e.transcribing),this.setCurrentValue(this.captioningSubject,e.captioning),this.setCurrentValue(this.thumbnailsSubject,e.thumbnails)},this.updateFromSfuCallState=(e,t,n)=>{let{participants:r,participantCount:i,startedAt:a,pins:o}=e,s=n?.announcedTracks.map(e=>e.trackType)??[];this.setParticipants(()=>{let e=this.getParticipantLookupBySessionId();return r.map(n=>{let r=e[n.sessionId],i=n.sessionId===t;return Object.assign({},r,n,{isLocalParticipant:i,publishedTracks:i?s:n.publishedTracks,viewportVisibilityState:r?.viewportVisibilityState??{videoTrack:CA.UNKNOWN,screenShareTrack:CA.UNKNOWN}})})}),this.setParticipantCount(i?.total||0),this.setAnonymousParticipantCount(i?.anonymous||0),this.setStartedAt(a?EO.toDate(a):new Date),this.setServerSidePins(o)},this.updateFromMemberRemoved=e=>{this.updateFromCallResponse(e.call),this.setCurrentValue(this.membersSubject,t=>t.filter(t=>e.members.indexOf(t.user_id)===-1))},this.updateFromMemberAdded=e=>{this.updateFromCallResponse(e.call),this.setCurrentValue(this.membersSubject,t=>[...t,...e.members])},this.updateFromHLSBroadcastStopped=()=>{this.setCurrentValue(this.egressSubject,(e=$j)=>({...e,broadcasting:!1,hls:{...e.hls,status:``}}))},this.updateFromHLSBroadcastingFailed=()=>{this.setCurrentValue(this.egressSubject,(e=$j)=>({...e,broadcasting:!1,hls:{...e.hls,status:``}}))},this.updateFromRecordingEvent=(e,t)=>{e===void 0||e===`composite`?this.setCurrentValue(this.recordingSubject,t):e===`individual`?this.setCurrentValue(this.individualRecordingSubject,t):e===`raw`?this.setCurrentValue(this.rawRecordingSubject,t):Qj(e,`Unknown recording type`)},this.updateParticipantCountFromSession=e=>{if(!e||this.callingState===W.JOINED)return;let t=Object.values(e.participants_count_by_role).reduce((e,t)=>e+t,0),n=Math.max(t,e.participants.length);this.setParticipantCount(n),this.setAnonymousParticipantCount(e.anonymous_participant_count||0)},this.updateFromSessionParticipantCountUpdate=e=>{let t=this.setCurrentValue(this.sessionSubject,t=>t&&{...t,anonymous_participant_count:e.anonymous_participant_count,participants_count_by_role:e.participants_count_by_role});this.updateParticipantCountFromSession(t)},this.updateFromSessionParticipantLeft=e=>{let t=this.setCurrentValue(this.sessionSubject,t=>{if(!t)return t;let{participants:n,participants_count_by_role:r}=t,{user:i,user_session_id:a}=e.participant;return{...t,participants:n.filter(e=>e.user_session_id!==a),participants_count_by_role:{...r,[i.role]:Math.max(0,(r[i.role]||0)-1)}}});this.updateParticipantCountFromSession(t)},this.updateFromSessionParticipantJoined=e=>{let t=this.setCurrentValue(this.sessionSubject,t=>{if(!t)return t;let{participants:n,participants_count_by_role:r}=t,{user:i,user_session_id:a}=e.participant,o=!0,s=n.map(t=>t.user_session_id===a?(o=!1,e.participant):t);o&&s.push(e.participant);let c=+!!o;return{...t,participants:s,participants_count_by_role:{...r,[i.role]:(r[i.role]||0)+c}}});this.updateParticipantCountFromSession(t)},this.updateMembers=e=>{this.updateFromCallResponse(e.call),this.setCurrentValue(this.membersSubject,t=>t.map(t=>e.members.find(e=>e.user_id===t.user_id)||t))},this.updateParticipantReaction=e=>{let{user:t,custom:n,type:r,emoji_code:i}=e.reaction;this.setParticipants(e=>e.map(e=>e.userId===t.id?{...e,reaction:{type:r,emoji_code:i,custom:n}}:e))},this.unblockUser=e=>{this.setCurrentValue(this.blockedUserIdsSubject,t=>t&&t.filter(t=>t!==e.user.id))},this.blockUser=e=>{this.setCurrentValue(this.blockedUserIdsSubject,t=>[...t||[],e.user.id])},this.updateOwnCapabilities=e=>{e.user.id===this.localParticipant?.userId&&this.setOwnCapabilities(e.own_capabilities)},this.updateFromClosedCaptions=e=>{this.setCurrentValue(this.closedCaptionsSubject,t=>{let{closed_caption:n}=e,r=e=>`${e.speaker_id}/${e.start_time}`,i=r(n);if(t.some(e=>r(e)===i))return t;let a=[...t,n],{visibilityDurationMs:o=2700,maxVisibleCaptions:s=2}=this.closedCaptionsSettings||{};if(o>0){let e=setTimeout(()=>{this.setCurrentValue(this.closedCaptionsSubject,e=>e.filter(e=>e!==n)),this.closedCaptionsTasks.delete(i)},o);this.closedCaptionsTasks.set(i,e);for(let e=0;e<a.length-s;e++){let t=r(a[e]),n=this.closedCaptionsTasks.get(t);clearTimeout(n),this.closedCaptionsTasks.delete(t)}}return a.slice(-s)})},this.rawParticipants$=this.participantsSubject.asObservable().pipe(lO({bufferSize:1,refCount:!0})),this.participants$=this.participantsSubject.asObservable().pipe(LD(e=>e.sort(this.sortParticipantsBy)),lO({bufferSize:1,refCount:!0})),this.localParticipant$=this.participants$.pipe(LD(e=>e.find(e=>e.isLocalParticipant)),lO({bufferSize:1,refCount:!0})),this.remoteParticipants$=this.participants$.pipe(LD(e=>e.filter(e=>!e.isLocalParticipant)),lO({bufferSize:1,refCount:!0})),this.pinnedParticipants$=this.participants$.pipe(LD(e=>e.filter(e=>!!e.pin)),lO({bufferSize:1,refCount:!0})),this.dominantSpeaker$=this.participants$.pipe(LD(e=>e.find(e=>e.isDominantSpeaker)),lO({bufferSize:1,refCount:!0})),this.hasOngoingScreenShare$=this.participants$.pipe(LD(e=>e.some(e=>jj(e))),rO(),lO({bufferSize:1,refCount:!0})),this.createdAt$=this.createdAtSubject.asObservable(),this.endedAt$=this.endedAtSubject.asObservable(),this.startsAt$=this.startsAtSubject.asObservable(),this.startedAt$=this.startedAtSubject.asObservable(),this.updatedAt$=this.updatedAtSubject.asObservable(),this.callStatsReport$=this.callStatsReportSubject.asObservable(),this.members$=this.membersSubject.asObservable(),this.createdBy$=this.createdBySubject.asObservable(),this.custom$=this.customSubject.asObservable(),this.egress$=this.egressSubject.asObservable(),this.ingress$=this.ingressSubject.asObservable(),this.session$=this.sessionSubject.asObservable(),this.settings$=this.settingsSubject.asObservable(),this.endedBy$=this.endedBySubject.asObservable(),this.thumbnails$=this.thumbnailsSubject.asObservable(),this.closedCaptions$=this.closedCaptionsSubject.asObservable();let e=(e,t)=>
466{if(e.length!==t.length)return!1;for(let n of e)if(!t.includes(n))return!1;for(let n of t)if(!e.includes(n))return!1;return!0},t=(e,t)=>e.pipe(rO(t));this.anonymousParticipantCount$=t(this.anonymousParticipantCountSubject),this.blockedUserIds$=t(this.blockedUserIdsSubject,e),this.backstage$=t(this.backstageSubject),this.callingState$=t(this.callingStateSubject),this.ownCapabilities$=zD([this.ownCapabilitiesSubject,this.callGrantsSubject.pipe(uO(void 0))]).pipe(LD(([e,t])=>{if(!t)return e;let{canPublishAudio:n,canPublishVideo:r,canScreenshare:i}=t,a={[bO.SEND_AUDIO]:n,[bO.SEND_VIDEO]:r,[bO.SCREENSHARE]:i},o=[...e];for(let e in a){let t=e,n=a[t];if(n&&!o.includes(t))o.push(t);else if(!n&&o.includes(t)){let e=o.indexOf(t);o.splice(e,1)}}return o}),rO(e),lO({bufferSize:1,refCount:!0})),this.participantCount$=t(this.participantCountSubject),this.recording$=t(this.recordingSubject),this.individualRecording$=t(this.individualRecordingSubject),this.rawRecording$=t(this.rawRecordingSubject),this.transcribing$=t(this.transcribingSubject),this.captioning$=t(this.captioningSubject),this.eventHandlers={"call.frame_recording_ready":void 0,"call.kicked_user":void 0,"call.moderation_blur":void 0,"call.moderation_warning":void 0,"call.permission_request":void 0,"call.recording_ready":void 0,"call.rtmp_broadcast_failed":void 0,"call.rtmp_broadcast_started":void 0,"call.rtmp_broadcast_stopped":void 0,"call.stats_report_ready":void 0,"call.transcription_ready":void 0,"call.user_feedback_submitted":void 0,"call.user_muted":void 0,"connection.error":void 0,"connection.ok":void 0,"health.check":void 0,"user.updated":void 0,custom:void 0,"call.accepted":e=>this.updateFromCallResponse(e.call),"call.blocked_user":this.blockUser,"call.closed_caption":this.updateFromClosedCaptions,"call.closed_captions_failed":()=>{this.setCurrentValue(this.captioningSubject,!1)},"call.closed_captions_started":()=>{this.setCurrentValue(this.captioningSubject,!0)},"call.closed_captions_stopped":()=>{this.setCurrentValue(this.captioningSubject,!1)},"call.created":e=>this.updateFromCallResponse(e.call),"call.deleted":e=>this.updateFromCallResponse(e.call),"call.ended":e=>{this.updateFromCallResponse(e.call),this.setCurrentValue(this.endedBySubject,e.user)},"call.frame_recording_failed":e=>{this.updateFromCallResponse(e.call)},"call.frame_recording_started":e=>{this.updateFromCallResponse(e.call)},"call.frame_recording_stopped":e=>{this.updateFromCallResponse(e.call)},"call.hls_broadcasting_failed":this.updateFromHLSBroadcastingFailed,"call.hls_broadcasting_started":e=>{this.updateFromCallResponse(e.call)},"call.hls_broadcasting_stopped":this.updateFromHLSBroadcastStopped,"call.live_started":e=>this.updateFromCallResponse(e.call),"call.member_added":this.updateFromMemberAdded,"call.member_removed":this.updateFromMemberRemoved,"call.member_updated_permission":this.updateMembers,"call.member_updated":this.updateMembers,"call.notification":e=>{this.updateFromCallResponse(e.call),this.setMembers(e.members)},"call.permissions_updated":this.updateOwnCapabilities,"call.reaction_new":this.updateParticipantReaction,"call.recording_started":e=>{this.updateFromRecordingEvent(e.recording_type,!0)},"call.recording_stopped":e=>{this.updateFromRecordingEvent(e.recording_type,!1)},"call.recording_failed":e=>{this.updateFromRecordingEvent(e.recording_type,!1)},"call.rejected":e=>this.updateFromCallResponse(e.call),"call.ring":e=>this.updateFromCallResponse(e.call),"call.missed":e=>this.updateFromCallResponse(e.call),"call.session_ended":e=>this.updateFromCallResponse(e.call),"call.session_participant_count_updated":this.updateFromSessionParticipantCountUpdate,"call.session_participant_joined":this.updateFromSessionParticipantJoined,"call.session_participant_left":this.updateFromSessionParticipantLeft,"call.session_started":e=>this.updateFromCallResponse(e.call),"call.transcription_started":()=>{this.setCurrentValue(this.transcribingSubject,!0)},"call.transcription_stopped":()=>{this.setCurrentValue(this.transcribingSubject,!1)},"call.transcription_failed":()=>{this.setCurrentValue(this.transcribingSubject,!1)},"call.unblocked_user":this.unblockUser,"call.updated":e=>this.updateFromCallResponse(e.call)}}get participantCount(){return this.getCurrentValue(this.participantCount$)}get startedAt(){return this.getCurrentValue(this.startedAt$)}get captioning(){return this.getCurrentValue(this.captioning$)}get anonymousParticipantCount(){return this.getCurrentValue(this.anonymousParticipantCount$)}get participants(){return this.getCurrentValue(this.participants$)}get rawParticipants(){return this.getCurrentValue(this.rawParticipants$)}get localParticipant(){return this.getCurrentValue(this.localParticipant$)}get remoteParticipants(){return this.getCurrentValue(this.remoteParticipants$)}get dominantSpeaker(){return this.getCurrentValue(this.dominantSpeaker$)}get pinnedParticipants(){return this.getCurrentValue(this.pinnedParticipants$)}get hasOngoingScreenShare(){return this.getCurrentValue(this.hasOngoingScreenShare$)}get callingState(){return this.getCurrentValue(this.callingState$)}get callStatsReport(){return this.getCurrentValue(this.callStatsReport$)}get isCallStatsReportObserved(){return this.callStatsReportSubject.observed}get members(){return this.getCurrentValue(this.members$)}get ownCapabilities(){return this.getCurrentValue(this.ownCapabilities$)}get backstage(){return this.getCurrentValue(this.backstage$)}get blockedUserIds(){return this.getCurrentValue(this.blockedUserIds$)}get createdAt(){return this.getCurrentValue(this.createdAt$)}get endedAt(){return this.getCurrentValue(this.endedAt$)}get startsAt(){return this.getCurrentValue(this.startsAt$)}get updatedAt(){return this.getCurrentValue(this.updatedAt$)}get createdBy(){return this.getCurrentValue(this.createdBy$)}get custom(){return this.getCurrentValue(this.custom$)}get egress(){return this.getCurrentValue(this.egress$)}get ingress(){return this.getCurrentValue(this.ingress$)}get recording(){return this.getCurrentValue(this.recording$)}get individualRecording(){return this.getCurrentValue(this.individualRecording$)}get rawRecording(){return this.getCurrentValue(this.rawRecording$)}get session(){return this.getCurrentValue(this.session$)}get settings(){return this.getCurrentValue(this.settings$)}get transcribing(){return this.getCurrentValue(this.transcribing$)}get endedBy(){return this.getCurrentValue(this.endedBy$)}get thumbnails(){return this.getCurrentValue(this.thumbnails$)}get closedCaptions(){return this.getCurrentValue(this.closedCaptions$)}},tM=e=>{let t=[];
466return e.forEach(e=>{t.push(e)}),t},nM=e=>({id:e.id,tracks:e.getTracks().map(e=>({id:e.id,kind:e.kind,label:e.label,enabled:e.enabled,muted:e.muted,readyState:e.readyState}))}),rM=e=>{let{sdk:t,...n}=e;return{sdkName:iM(t),sdkVersion:aM(t),...n}},iM=e=>e&&e.type===NO.REACT?`stream-react`:e&&e.type===NO.REACT_NATIVE?`stream-react-native`:`stream-js`,aM=e=>e?`${e.major}.${e.minor}.${e.patch}`:`0.0.0-development`,[oM,sM,cM]=`1.52.0`.split(`.`),lM={type:NO.PLAIN_JAVASCRIPT,major:oM,minor:sM,patch:cM},uM,dM,fM,pM={oneofKind:void 0},mM=e=>{lM=e},hM=()=>lM,gM=()=>fM,_M=()=>pM,vM=async()=>{if(KA())return{sdk:lM,os:uM,device:dM,webrtcVersion:fM?.version||``};let e=navigator.userAgentData,t;if(e&&e.getHighEntropyValues)try{t=await e.getHighEntropyValues([`platform`,`platformVersion`,`fullVersionList`])}catch{}let{browser:n,os:r,device:i,cpu:a}=new hO.UAParser(navigator.userAgent).getResult(),o=t?.fullVersionList?.find(e=>!e.brand.includes(`Chromium`)&&!e.brand.match(/[()\-./:;=?_]/g)),s=o?.version||n.version||``;return{sdk:lM,browser:{name:o?.brand||n.name||navigator.userAgent,version:s},os:{name:t?.platform||r.name||``,version:t?.platformVersion||r.version||``,architecture:a.architecture||``},device:{name:[i.vendor,i.model,i.type].filter(Boolean).join(` `),version:``},webrtcVersion:s}},yM=()=>typeof navigator>`u`?!1:/^((?!chrome|android).)*safari/i.test(navigator.userAgent||``),bM=()=>{if(typeof navigator>`u`)return!1;let e=navigator.userAgent||``;return/AppleWebKit\//.test(e)?!/Chrome\/|Chromium\/|Android/.test(e):!1},xM=()=>typeof navigator>`u`?!1:navigator.userAgent?.includes(`Firefox`),SM=Object.freeze({__proto__:null,isChrome:()=>typeof navigator>`u`?!1:navigator.userAgent?.includes(`Chrome`),isFirefox:xM,isSafari:yM,isSupportedBrowser:async()=>{let{browser:e}=await vM();if(!e)return!1;let t=e.name.toLowerCase(),[n]=e.version.split(`.`),r=parseInt(n,10);return t.includes(`chrome`)&&r>=124||t.includes(`edge`)&&r>=124||t.includes(`firefox`)&&r>=124||t.includes(`safari`)&&r>=17||t.includes(`webkit`)&&r>=605||t.includes(`webview`)&&r>=124},isWebKit:bM}
466),CM=({subscriber:e,publisher:t,state:n,datacenter:r,pollingIntervalInMs:i=2e3})=>{let a=JA.getLogger(`stats`),o=async(n,r)=>{if(n===`subscriber`&&e)return e.getStats(r);if(n===`publisher`&&t)return t.getStats(r)},s=async(n,r)=>{let i=n===`subscriber`?e:t;if(!i)return[];let a=[];for(let e of r){let t=TM(await i.getStats(e),{trackKind:e.kind,kind:n,publisher:void 0});a.push(t)}return a},c=e=>{u.add(e),d()},l=e=>{u.delete(e),d()},u=new Set,d=async()=>{let e={};if(u.size>0){let r=new Set(u);for(let i of n.participants){if(!r.has(i.sessionId))continue;let{audioStream:n,isLocalParticipant:o,sessionId:c,userId:l,videoStream:u}=i,d=o?`publisher`:`subscriber`;try{e[c]=await s(d,o?t?.getPublishedTracks()||[]:[...u?.getVideoTracks()||[],...n?.getAudioTracks()||[]])}catch(e){a.warn(`Failed to collect ${d} stats for ${l}`,e)}}}let[i,c]=await Promise.all([o(`subscriber`),t?o(`publisher`):void 0]),l=(e,n)=>({videoStats:OM(TM(e,{kind:n,trackKind:`video`,publisher:t})),audioStats:kM(TM(e,{kind:n,trackKind:`audio`,publisher:t}))}),d=i?l(i,`subscriber`):{videoStats:EM(),audioStats:DM()},f=c?l(c,`publisher`):{videoStats:EM(),audioStats:DM()};n.setCallStatsReport({datacenter:r,publisherStats:f.videoStats,publisherAudioStats:f.audioStats,subscriberStats:d.videoStats,subscriberAudioStats:d.audioStats,subscriberRawStats:i,publisherRawStats:c,participants:e,timestamp:Date.now()})},f;if(i>0){let e=async()=>{n.isCallStatsReportObserved&&await d().catch(e=>{a.debug(`Failed to collect stats`,e)}),f=setTimeout(e,i)};e()}return{getRawStatsForTrack:o,getStatsForStream:s,startReportingStatsFor:c,stopReportingStatsFor:l,stop:()=>{f&&clearTimeout(f)}}},wM=e=>({frameRate:e.framesPerSecond,frameWidth:e.width,frameHeight:e.height}),TM=(e,t)=>{let{trackKind:n,kind:r,publisher:i}=t,a=r===`subscriber`?`inbound-rtp`:`outbound-rtp`,o=tM(e);return{rawStats:e,streams:o.filter(e=>e.type===a&&e.kind===n).map(e=>{let t=e,a=o.find(e=>e.type===`codec`&&e.id===t.codecId),s=o.find(e=>e.type===`transport`&&e.id===t.transportId),c;s&&s.dtlsState===`connected`&&(c=o.find(e=>e.type===`candidate-pair`&&e.id===s.selectedCandidatePairId)?.currentRoundTripTime);let l,u,d,f,p,m,h;if(r===`publisher`&&i){let e=xM(),r=o.find(n=>n.type===`media-source`&&(e?!0:n.id===t.mediaSourceId));r&&(l=i.getTrackType(r.trackIdentifier),n===`audio`&&typeof r.audioLevel==`number`&&(u=r.audioLevel),n===`video`&&(d=wM(r)))}else if(r===`subscriber`&&n===`audio`){let e=t,n=e.audioLevel;typeof n==`number`&&(u=n),f=e.concealedSamples,p=e.concealmentEvents,m=e.packetsReceived,h=e.packetsLost}return{bytesSent:t.bytesSent,bytesReceived:t.bytesReceived,codec:a?.mimeType,currentRoundTripTime:c,frameHeight:t.frameHeight,frameWidth:t.frameWidth,framesPerSecond:t.framesPerSecond,jitter:t.jitter,kind:t.kind,mediaSourceId:t.mediaSourceId,qualityLimitationReason:t.qualityLimitationReason,rid:t.rid,ssrc:t.ssrc,trackType:l,audioLevel:u,concealedSamples:f,concealmentEvents:p,packetsReceived:m,packetsLost:h,camera:d}}),timestamp:Date.now()}},EM=e=>({rawReport:e??{streams:[],timestamp:Date.now()},totalBytesSent:0,totalBytesReceived:0,averageJitterInMs:0,averageRoundTripTimeInMs:0,qualityLimitationReasons:`none`,highestFrameWidth:0,highestFrameHeight:0,highestFramesPerSecond:0,camera:{},codec:``,codecPerTrackType:{},timestamp:Date.now()}),DM=()=>({totalBytesSent:0,totalBytesReceived:0,averageJitterInMs:0,averageRoundTripTimeInMs:0,codec:``,codecPerTrackType:{},timestamp:Date.now(),totalConcealedSamples:0,totalConcealmentEvents:0,totalPacketsReceived:0,totalPacketsLost:0}),OM=e=>{let t=EM(e),n=-1,r=(e,t)=>e*t,i=new Set,a=e.streams,o=a.reduce((e,t)=>{e.totalBytesSent+=t.bytesSent||0,e.totalBytesReceived+=t.bytesReceived||0,e.averageJitterInMs+=t.jitter||0,e.averageRoundTripTimeInMs+=t.currentRoundTripTime||0;let a=r(t.frameWidth||0,t.frameHeight||0);return a>n&&(e.highestFrameWidth=t.frameWidth||0,e.highestFrameHeight=t.frameHeight||0,e.highestFramesPerSecond=t.framesPerSecond||0,n=a),t.trackType===U.VIDEO&&(e.camera=t.camera),i.add(t.qualityLimitationReason||``),e},t);a.length>0&&(o.averageJitterInMs=Math.round(o.averageJitterInMs/a.length*1e3),o.averageRoundTripTimeInMs=Math.round(o.averageRoundTripTimeInMs/a.length*1e3),o.codec=a[0].codec||``,o.co
466decPerTrackType=a.reduce((e,t)=>(t.trackType&&(e[t.trackType]=t.codec||``),e),{}));let s=[i.has(`cpu`)&&`cpu`,i.has(`bandwidth`)&&`bandwidth`,i.has(`other`)&&`other`].filter(Boolean).join(`, `);return s&&(o.qualityLimitationReasons=s),o},kM=e=>{let t=e.streams,n=DM(),r=t.reduce((e,t)=>(e.totalBytesSent+=t.bytesSent||0,e.totalBytesReceived+=t.bytesReceived||0,e.averageJitterInMs+=t.jitter||0,e.averageRoundTripTimeInMs+=t.currentRoundTripTime||0,e.totalConcealedSamples+=t.concealedSamples||0,e.totalConcealmentEvents+=t.concealmentEvents||0,e.totalPacketsReceived+=t.packetsReceived||0,e.totalPacketsLost+=t.packetsLost||0,e),n);return t.length>0&&(r.averageJitterInMs=Math.round(r.averageJitterInMs/t.length*1e3),r.averageRoundTripTimeInMs=Math.round(r.averageRoundTripTimeInMs/t.length*1e3),r.codec=t[0].codec||``,r.codecPerTrackType=t.reduce((e,t)=>(t.trackType&&(e[t.trackType]=t.codec||``),e),{})),r},AM=class{constructor(e,{options:t,clientDetails:n,subscriber:r,publisher:i,microphone:a,camera:o,state:s,tracer:c,unifiedSessionId:l}){this.logger=JA.getLogger(`SfuStatsReporter`),this.reportCount=0,this.inputDevices=new Map,this.observeDevice=(e,t)=>{let{browserPermissionState$:n}=e.state;this.unsubscribeDevicePermissionsSubscription?.(),this.unsubscribeDevicePermissionsSubscription=Sj(zD([n,this.state.ownCapabilities$]),([n,r])=>{this.unsubscribeListDevicesSubscription?.();let i=t===`mic`?r.includes(bO.SEND_AUDIO):r.includes(bO.SEND_VIDEO);if(n!==`granted`||!i){this.inputDevices.set(t,{currentDevice:``,availableDevices:[],isPermitted:!1});return}this.unsubscribeListDevicesSubscription=Sj(zD([e.listDevices(),e.state.selectedDevice$]),([e,n])=>{let r=e.find(e=>e.deviceId===n);this.inputDevices.set(t,{currentDevice:r?.label||n||``,availableDevices:e.map(e=>e.label),isPermitted:!0})})})},this.sendConnectionTime=e=>{this.sendTelemetryData({data:{oneofKind:`connectionTimeSeconds`,connectionTimeSeconds:e}})},this.sendReconnectionTime=(e,t)=>{this.sendTelemetryData({data:{oneofKind:`reconnection`,reconnection:{strategy:e,timeSeconds:t}}})},this.sendTelemetryData=e=>{this.run(e).catch(e=>{this.logger.warn(`Failed to send telemetry data`,e)})},this.run=async e=>{let[t,n]=await Promise.all([this.subscriber.stats.get(),this.publisher?.stats.get()]);this.subscriber.tracer?.trace(`getstats`,t.delta),n&&this.publisher?.tracer?.trace(`getstats`,n.delta);let r=this.subscriber.tracer?.take(),i=this.publisher?.tracer?.take(),a=this.tracer.take(),o=this.sfuClient.getTrace(),s=[...a.snapshot,...o?.snapshot??[],...i?.snapshot??[],...r?.snapshot??[]];try{await this.sfuClient.sendStats({sdk:this.sdkName,sdkVersion:this.sdkVersion,webrtcVersion:this.webRTCVersion,subscriberStats:JSON.stringify(tM(t.stats)),publisherStats:n?JSON.stringify(tM(n.stats)):`[]`,subscriberRtcStats:``,publisherRtcStats:``,rtcStats:JSON.stringify(s),encodeStats:n?.performanceStats??[],decodeStats:t.performanceStats,audioDevices:this.inputDevices.get(`mic`),videoDevices:this.inputDevices.get(`camera`),unifiedSessionId:this.unifiedSessionId,deviceState:_M(),telemetry:e})}catch(e){throw i?.rollback(),r?.rollback(),a.rollback(),o?.rollback(),e}},this.scheduleNextReport=()=>{let e=[1500,3e3,3e3,5e3];this.reportCount<e.length?this.timeoutId=setTimeout(()=>{this.flush(),this.reportCount++,this.scheduleNextReport()},e[this.reportCount]):(clearInterval(this.intervalId),this.intervalId=setInterval(()=>{this.flush()},this.options.reporting_interval_ms))},this.start=()=>{this.options.reporting_interval_ms<=0||(this.observeDevice(this.microphone,`mic`),this.observeDevice(this.camera,`camera`),this.reportCount=0,clearInterval(this.intervalId),clearTimeout(this.timeoutId),this.scheduleNextReport())},this.stop=()=>{this.unsubscribeDevicePermissionsSubscription?.(),this.unsubscribeDevicePermissionsSubscription=void 0,this.unsubscribeListDevicesSubscription?.(),this.unsubscribeListDevicesSubscription=void 0,this.inputDevices.clear(),clearInterval(this.intervalId),this.intervalId=void 0,clearTimeout(this.timeoutId),this.timeoutId=void 0,this.reportCount=0},this.flush=()=>{this.run().catch(e=>{this.logger.warn(`Failed to flush report stats`,e)})},this.sfuClient=e,this.options=t,this.subscriber=r,this.publisher=i,this.microphone=a,this.camera=o,this.state=s,this.tracer=c,this.unifiedSessionId=l;let{sdk:u,browser:d}=n;this.sdkName=iM(u),this.sdkVersion=aM(u);let f=gM();
466this.webRTCVersion=f?.version||`${d?.name||``}-${d?.version||``}`||`N/A`}},jM=(e,t)=>{e.addEventListener(`icecandidate`,e=>{t(`onicecandidate`,e.candidate)}),e.addEventListener(`track`,e=>{let n=e.streams.map(e=>`stream:${e.id}`);t(`ontrack`,`${e.track.kind}:${e.track.id} ${n}`)}),e.addEventListener(`signalingstatechange`,()=>{t(`signalingstatechange`,e.signalingState)}),e.addEventListener(`iceconnectionstatechange`,()=>{t(`iceconnectionstatechange`,e.iceConnectionState)}),e.addEventListener(`icegatheringstatechange`,()=>{t(`icegatheringstatechange`,e.iceGatheringState)}),e.addEventListener(`connectionstatechange`,()=>{t(`connectionstatechange`,e.connectionState)}),e.addEventListener(`negotiationneeded`,()=>{t(`negotiationneeded`,void 0)}),e.addEventListener(`datachannel`,({channel:e})=>{t(`datachannel`,[e.id,e.label])});let n=e.close;e.close=function(){return t(`close`,void 0),n.call(this)};for(let n of[`createOffer`,`createAnswer`,`setLocalDescription`,`setRemoteDescription`,`addIceCandidate`]){let r=e[n];r&&(e[n]=async function(...e){try{t(n,e);let i=await r.apply(this,e);return t(`${n}OnSuccess`,i),i}catch(e){throw t(`${n}OnFailure`,e.toString()),e}})}},MM=class{constructor(e,t,n,r=0){this.previousStats={},this.frameTimeHistory=[],this.fpsHistory=[],this.get=async()=>{let e=await this.pc.getStats(),t=NM(e,Date.now(),this.driftThresholdMs),n=this.withOverrides(this.peerType===DO.SUBSCRIBER?this.getDecodeStats(t):this.getEncodeStats(t)),r=PM(this.previousStats,t);return this.previousStats=t,this.frameTimeHistory=this.frameTimeHistory.slice(-2),this.fpsHistory=this.fpsHistory.slice(-2),{performanceStats:n,delta:r,stats:e}},this.getEncodeStats=e=>{let t=[];for(let n of Object.values(e)){if(n.type!==`outbound-rtp`)continue;let{codecId:r,framesSent:i=0,kind:a,id:o,totalEncodeTime:s=0,framesPerSecond:c=0,frameHeight:l=0,frameWidth:u=0,targetBitrate:d=0,mediaSourceId:f}=n;if(a===`audio`||!this.previousStats[o])continue;let p=this.previousStats[o],m=s-(p.totalEncodeTime||0),h=i-(p.framesSent||0),g=h>0?m/h*1e3:0;this.frameTimeHistory.push(g),this.fpsHistory.push(c);let _=U.VIDEO;if(f&&e[f]){let t=e[f];_=this.trackIdToTrackType.get(t.trackIdentifier)||_}t.push({trackType:_,codec:IM(e,r),avgFrameTimeMs:FM(this.frameTimeHistory),avgFps:FM(this.fpsHistory),targetBitrate:Math.round(d),videoDimension:{width:u,height:l}})}return t},this.getDecodeStats=e=>{let t,n=0;for(let r of Object.values(e)){if(r.type!==`inbound-rtp`)continue;let e=r,{kind:i,frameWidth:a=0,frameHeight:o=0}=e,s=a*o;i===`video`&&s>n&&(t=e,n=s)}if(!t||!this.previousStats[t.id])return[];let r=this.previousStats[t.id],{framesDecoded:i=0,framesPerSecond:a=0,totalDecodeTime:o=0,trackIdentifier:s}=t,c=o-(r.totalDecodeTime||0),l=i-(r.framesDecoded||0),u=l>0?c/l*1e3:0;this.frameTimeHistory.push(u),this.fpsHistory.push(a);let d=this.trackIdToTrackType.get(s)||U.VIDEO;return[pk.create({trackType:d,codec:IM(e,t.codecId),avgFrameTimeMs:FM(this.frameTimeHistory),avgFps:FM(this.fpsHistory),videoDimension:{width:t.frameWidth,height:t.frameHeight}})]},this.withOverrides=e=>{if(this.costOverrides)for(let t of e){let e=this.costOverrides.get(t.trackType);e!==void 0&&(t.avgFrameTimeMs=e+(t.avgFrameTimeMs||0)/1e3)}return e},this.setCost=(e,t=U.VIDEO)=>{this.costOverrides||=new Map,this.costOverrides.set(t,e)},this.pc=e,this.peerType=t,this.trackIdToTrackType=n,this.driftThresholdMs=r}},NM=(e,t,n)=>{let r={},i=n>0;return e.forEach((e,a)=>{let o=Math.abs(e.timestamp-t);r[a]=i&&o>n?{...e,timestamp:t}:e}),r},PM=(e,t)=>{t=JSON.parse(JSON.stringify(t));for(let[n,r]of Object.entries(t))if(delete r.id,e[n])for(let[t,i]of Object.entries(r))i===e[n][t]&&delete r[t];let n=-1/0,r=Object.values(t);for(let e of r)e.timestamp>n&&(n=e.timestamp);for(let e of r)e.timestamp===n&&(e.timestamp=0);return t.timestamp=n,t},FM=e=>e.reduce((e,t)=>e+t,0)/e.length,IM=(e,t)=>{if(!t||!e[t])return;let n=e[t];return ZO.create({name:n.mimeType.split(`/`).pop(),clockRate:n.clockRate,payloadType:n.payloadType,fmtp:n.sdpFmtpLine})},LM=class{constructor(e){this.buffer=[],this.enabled=!0,this.setEnabled=e=>{this.enabled!==e&&(this.enabled=e,this.buffer=[])},this.trace=(e,t)=>{this.enabled&&this.buffer.push([e,this.id,t,Date.now()])},this.traceOnce=(e,t,n)=>{this.keys?.has(e)||(this.trace(t,n),(this.keys??=new Map).set(e,!0))},this.resetTrace=e=>{this.keys?.delete(e)},this.take=()=>{let e=this.buffer;return this.buffer=[],{snapshot:e,rollback:()=>{this.buffer.unshift(...e)}}},this.dispose=()=>{this.buffer=[],this.keys?.clear()},this.id=e}},RM={ICE_NEVER_CONNECTED:`ice_never_connected`,CONNECTION_FAILED:`connection_failed`,RESTART_ICE_FAILED:`restart_ice_failed`,GO_AWAY:`go_away`,NETWORK_BACK_ONLINE:`network_back_online`,SFU_ERROR:`sfu_error`},zM=class{constructor(e,{sfuClient:t,connectionConfig:n,state:r,dispatcher:i,onReconnectionNeeded:a,onIceConnected:o,tag:s,enableTracing:c,clientPublishOptions:l,iceRestartDelay:u=2500,statsTimestampDriftThresholdMs:d=0}){this.iceHasEverConnected=!1,this.isIceRestarting=!1,this.isDisposed=!1,this.trackIdToTrackType=new Map,this.subscriptions=[],this.lock=Math.random().toString(36).slice(2),this.createPeerConnection=e=>{let t=new RTCPeerConnection(e);return t.addEventListener(`icecandidate`,this.onIceCandidate),t.addEventListener(`icecandidateerror`,this.onIceCandidateError),t.addEventListener(`iceconnectionstatechange`,this.onIceConnectionStateChange),t.addEventListener(`icegatheringstatechange`,this.onIceGatherChange),t.addEventListener(`signalingstatechange`,this.onSignalingChange),t.addEventListener(`connectionstatechange`,this.onConnectionStateChange),t},this.tryRestartIce=()=>{this.restartIce().catch(e=>{this.logger.error(`restartICE() failed, initiating reconnect`,e);let t=e instanceof oj&&e.error.code===MO.PARTICIPANT_SIGNAL_LOST?LO.FAST:LO.REJOIN;this.onReconnectionNeeded?.(t,RM.RESTART_ICE_FAILED,this.peerType)})},this.on=(e,t)=>{this.subscriptions.push(this.dispatcher.on(e,()=>this.tag,n=>{lj(this.eventLockKey(e),async()=>t(n)).catch(t=>{this.isDisposed||this.logger.warn(`Error handling ${e}`,t)})}))},this.eventLockKey=e=>`pc.${this.lock}.${e}`,this.addTrickledIceCandidates=()=>{let{iceTrickleBuffer:e}=this.sfuClient,t=this.peerType===DO.SUBSCRIBER?e.subscriberCandidates:e.publisherCandidates;this.unsubscribeIceTrickle?.(),this.unsubscribeIceTrickle=Cj(t,async e=>this.pc.addIceCandidate(e).catch(t=>{this.isDisposed||this.logger.warn(`ICE candidate error`,t,e)}))},this.setSfuClient=e=>{this.sfuClient=e,this.tag=e.tag}
466,this.getStats=e=>this.pc.getStats(e),this.getTrackType=e=>this.trackIdToTrackType.get(e),this.isHealthy=()=>{let e=new Set([`failed`,`closed`]),t=this.pc.iceConnectionState,n=this.pc.connectionState;return!e.has(t)&&!e.has(n)},this.isStable=()=>{let e=this.pc.iceConnectionState,t=this.pc.connectionState;return(e===`connected`||e===`completed`)&&t===`connected`},this.onIceCandidate=e=>{let{candidate:t}=e;if(!t){this.logger.debug(`null ice candidate`);return}let n=this.asJSON(t);this.sfuClient.iceTrickle({peerType:this.peerType,iceCandidate:n}).catch(e=>{this.isDisposed||this.logger.warn(`ICETrickle failed`,e)})},this.asJSON=e=>{if(!e.usernameFragment){let t=e.candidate.split(` `),n=t[t.findIndex(e=>e===`ufrag`)+1];return JSON.stringify({...e,usernameFragment:n})}return JSON.stringify(e.toJSON())},this.onConnectionStateChange=async()=>{let e=this.pc.connectionState;if(this.logger.debug(`Connection state changed`,e),this.tracer&&(e===`connected`||e===`failed`))try{let e=await this.stats.get();this.tracer.trace(`getstats`,e.delta)}catch(e){this.tracer.trace(`getstatsOnFailure`,e.toString())}if(e===`failed`){this.onReconnectionNeeded?.(LO.REJOIN,RM.CONNECTION_FAILED,this.peerType);return}this.handleConnectionStateUpdate(e)},this.onIceConnectionStateChange=()=>{let e=this.pc.iceConnectionState;this.logger.debug(`ICE connection state changed`,e),this.handleConnectionStateUpdate(e)},this.handleConnectionStateUpdate=e=>{let{callingState:t}=this.state;if(t!==W.OFFLINE&&t!==W.RECONNECTING&&!this.isIceRestarting){if(!this.iceHasEverConnected){if(e===`failed`){this.logger.info(`ICE failed before connected, escalating to REJOIN`),clearTimeout(this.preConnectStuckTimeout),this.preConnectStuckTimeout=void 0,this.onReconnectionNeeded?.(LO.REJOIN,RM.ICE_NEVER_CONNECTED,this.peerType);return}if(e===`disconnected`){this.logger.info(`ICE disconnected before connected, wait to recover`),clearTimeout(this.preConnectStuckTimeout),this.preConnectStuckTimeout=setTimeout(()=>{!this.iceHasEverConnected&&this.pc.iceConnectionState===`disconnected`&&(this.logger.info(`ICE stuck in pre-connect disconnected, escalating to REJOIN`),this.onReconnectionNeeded?.(LO.REJOIN,RM.ICE_NEVER_CONNECTED,this.peerType))},this.iceRestartDelay*2);return}}switch(e){case`failed`:this.logger.info(`restartICE due to failed connection`),this.tryRestartIce();break;case`disconnected`:this.logger.info(`disconnected connection, scheduling restartICE`),clearTimeout(this.iceRestartTimeout),this.iceRestartTimeout=setTimeout(()=>{let e=this.pc.iceConnectionState;(e===`disconnected`||e===`failed`)&&this.tryRestartIce()},this.iceRestartDelay);break;case`connected`:case`completed`:this.iceHasEverConnected||(this.iceHasEverConnected=!0,this.onIceConnected?.(this.peerType)),this.iceRestartTimeout&&=(this.logger.info(`connected connection, canceling restartICE`),clearTimeout(this.iceRestartTimeout),void 0),clearTimeout(this.preConnectStuckTimeout),this.preConnectStuckTimeout=void 0;break}}},this.onIceCandidateError=e=>{let t=e instanceof RTCPeerConnectionIceErrorEvent?`${e.errorCode}: ${e.errorText}`:e;this.logger.debug(`ICE Candidate error`,t)},this.onIceGatherChange=()=>{this.logger.debug(`ICE Gathering State`,this.pc.iceGatheringState)},this.onSignalingChange=()=>{this.logger.debug(`Signaling state changed`,this.pc.signalingState)},this.peerType=e,this.sfuClient=t,this.state=r,this.dispatcher=i,this.iceRestartDelay=u,this.clientPublishOptions=l,this.tag=s,this.onReconnectionNeeded=a,this.onIceConnected=o,this.logger=JA.getLogger(e===DO.SUBSCRIBER?`Subscriber`:`Publisher`,{tags:[s]}),this.pc=this.createPeerConnection(n),this.stats=new MM(this.pc,e,this.trackIdToTrackType,d),c&&(this.tracer=new LM(`${s}-${e===DO.SUBSCRIBER?`sub`:`pub`}`),this.tracer.trace(`create`,{url:t.edgeName,...n}),jM(this.pc,this.tracer.trace))}async dispose(){clearTimeout(this.iceRestartTimeout),this.iceRestartTimeout=void 0,clearTimeout(this.preConnectStuckTimeout),this.preConnectStuckTimeout=void 0,this.onReconnectionNeeded=void 0,this.onIceConnected=void 0,this.isDisposed=!0,this.detachEventHandlers(),this.pc.close(),this.tracer?.dispose()}detachEventHandlers(){let e=this.pc;e.removeEventListener(`icecandidate`,this.onIceCandidate),e.removeEventListener(`icecandidateerror`,this.onIceCandidateError),e.removeEventListener(`signalingstatechange`,this.onSignalingChange),e.removeEventListener(`iceconnectionstatechange`,this.onIceConnectionStateChange),e.removeEventListener(`icegatheringstatechange`,this.onIceGatherChange),e.removeEventListener(`connectionstatechange`,this.onConnectionStateChange),this.unsubscribeIceTrickle?.(),this.subscriptions.forEach(e
466=>e()),this.subscriptions=[]}},BM=class{constructor(){this.cache=[],this.layers=[],this.transceiverOrder=[],this.add=e=>{this.cache.push(e),this.transceiverOrder.push(e.transceiver)},this.get=e=>this.getBy(e.id,e.trackType),this.getBy=(e,t)=>this.cache.find(n=>n.publishOption.id===e&&n.publishOption.trackType===t),this.update=(e,t)=>{let n=this.get(e);n&&Object.assign(n,t)},this.has=e=>!!this.get(e),this.find=e=>this.cache.find(e),this.items=()=>this.cache,this.indexOf=e=>this.transceiverOrder.indexOf(e),this.getLayers=e=>this.layers.find(t=>t.publishOption.id===e.id&&t.publishOption.trackType===e.trackType)?.layers,this.setLayers=(e,t=[])=>{let n=this.findLayer(e);n?n.layers=t:this.layers.push({publishOption:e,layers:t})},this.findLayer=e=>this.layers.find(t=>t.publishOption.id===e.id&&t.publishOption.trackType===e.trackType)}},VM=e=>{switch(e){case U.SCREEN_SHARE:return`screenShareStream`;case U.SCREEN_SHARE_AUDIO:return`screenShareAudioStream`;case U.VIDEO:return`videoStream`;case U.AUDIO:return`audioStream`;case U.UNSPECIFIED:throw Error(`Track type is unspecified`);default:Qj(e,`Unknown track type`)}},HM=e=>{switch(e){case`audio`:return U.AUDIO;case`video`:return U.VIDEO;case`screenshare`:return U.SCREEN_SHARE;case`screenshare_audio`:return U.SCREEN_SHARE_AUDIO;default:Qj(e,`Unknown mute type`)}},UM=e=>{switch(e){case`TRACK_TYPE_AUDIO`:return U.AUDIO;case`TRACK_TYPE_VIDEO`:return U.VIDEO;case`TRACK_TYPE_SCREEN_SHARE`:return U.SCREEN_SHARE;case`TRACK_TYPE_SCREEN_SHARE_AUDIO`:return U.SCREEN_SHARE_AUDIO;default:return}},WM=e=>e===U.AUDIO||e===U.SCREEN_SHARE_AUDIO,GM=(e,t)=>{let{audioBitrateProfile:n}=t;return[{maxBitrate:e.audioBitrateProfiles?.find(e=>e.profile===n)?.bitrate||{[jO.VOICE_STANDARD_UNSPECIFIED]:64e3,[jO.VOICE_HIGH_QUALITY]:128e3,[jO.MUSIC_HIGH_QUALITY]:128e3}[n||jO.VOICE_STANDARD_UNSPECIFIED]}]},KM=e=>{if(!e)return;let t=e=>t=>t.rid===e;return[{...e.find(t(`f`))||e.find(t(`h`))||e.find(t(`q`)),rid:`q`}]},qM=e=>e===`q`?kO.LOW_UNSPECIFIED:e===`h`?kO.MID:kO.HIGH,JM=(e=[])=>e.map(e=>({rid:e.rid||``,bitrate:e.maxBitrate||0,fps:e.maxFramerate||0,quality:qM(e.rid||``),videoDimension:{width:e.width,height:e.height}})),YM=(e,t)=>`L${e}T${t}${e>1?`_KEY`:``}`,XM=(e,t)=>{if(WM(t.trackType))return;let n=[],{bitrate:r,codec:i,fps:a=30,maxSpatialLayers:o=3,maxTemporalLayers:s=3,videoDimension:c={width:1280,height:720},useSingleLayer:l}=t,{width:u=c.width,height:d=c.height}=e.getSettings(),f=ZM(c,u,d,r),p=1,m=1,h=nj(i?.name);for(let e of[`f`,`h`,`q`].slice(0,o)){let t={active:!0,rid:e,width:Math.round(u/p),height:Math.round(d/p),maxBitrate:Math.round(f/m)||{q:3e5,h:75e4,f:125e4}[e],maxFramerate:a};h?t.scalabilityMode=YM(l?1:o,s):t.scaleResolutionDownBy=p,p*=2,m*=2,n.unshift(t)}return QM(u,d,n,l)},ZM=(e,t,n,r)=>{let{width:i,height:a}=e;if(t<i||n<a){let e=t*n/(i*a);return Math.round(r*e)}return r},QM=(e,t,n,r)=>{let i,a=Math.max(e,t);i=a<=320?n.filter(e=>e.rid===`f`):a<=640?n.filter(e=>e.rid!==`q`):n;let o=[`q`,`h`,`f`];return i.map((e,t,n)=>({...e,rid:o[t],active:r&&t<n.length-1?!1:e.active}))},$M=e=>{switch(e){case VO.BALANCED:return`balanced`;case VO.MAINTAIN_FRAMERATE:return`maintain-framerate`;case VO.MAINTAIN_RESOLUTION:return`maintain-resolution`;case VO.MAINTAIN_FRAMERATE_AND_RESOLUTION:return`maintain-framerate-and-resolution`;case VO.UNSPECIFIED:return;default:Qj(e,`Unknown degradation preference`)}},eN=e=>{switch(e){case`balanced`:return VO.BALANCED;case`maintain-framerate`:return VO.MAINTAIN_FRAMERATE;case`maintain-resolution`:return VO.MAINTAIN_RESOLUTION;case`maintain-framerate-and-resolution`:return VO.MAINTAIN_FRAMERATE_AND_RESOLUTION;default:return VO.UNSPECIFIED}},tN=class extends zM{constructor(e,t){super(DO.PUBLISHER_UNSPECIFIED,e),this.transceiverCache=new BM,this.clonedTracks=new Set,this.publish=async(e,t,n={})=>{if(!this.publishOptions.some(e=>e.trackType===t))throw Error(`No publish options found for ${U[t]}`);for(let r of this.publishOptions){if(r.trackType!==t)continue;let i=this.cloneTrack(e),a=this.transceiverCache.get(r);if(!a)await this.addTransceiver(i,r,n);else{let e=a.transceiver.sender.track;await this.updateTransceiver(a,i,n),KA()||this.stopTrack(e)}}},this.addTransceiver=async(e,t,n)=>
466{let r=WM(t.trackType)?GM(t,n):XM(e,t),i=nj(t.codec?.name)?KM(r):r,a=this.pc.addTransceiver(e,{direction:`sendonly`,sendEncodings:i}),o=a.sender.getParameters();o.degradationPreference=$M(t.degradationPreference)??`maintain-framerate`,await a.sender.setParameters(o);let s=t.trackType;this.logger.debug(`Added ${U[s]} transceiver`),this.transceiverCache.add({publishOption:t,transceiver:a,options:n}),this.trackIdToTrackType.set(e.id,s),await this.negotiate()},this.updateTransceiver=async(e,t,n={})=>{let{transceiver:r,publishOption:i}=e,a=i.trackType,o=r.sender;o.track&&this.trackIdToTrackType.delete(o.track.id),await o.replaceTrack(t),t&&(this.trackIdToTrackType.set(t.id,a),xM()&&e.videoSender&&await this.changePublishQuality(e.videoSender,e)),WM(a)&&await this.updateAudioPublishOptions(a,n)},this.updateAudioPublishOptions=async(e,t)=>{for(let n of this.publishOptions){if(n.trackType!==e)continue;let r=this.transceiverCache.get(n);if(!r)continue;let{transceiver:i,options:a}=r;if(a.audioBitrateProfile!==t.audioBitrateProfile){let e=GM(n,t);if(e&&e.length>0){let t=i.sender.getParameters(),[n]=t.encodings,[r]=e;n.maxBitrate!==r.maxBitrate&&(n.maxBitrate=r.maxBitrate),await i.sender.setParameters(t)}}this.transceiverCache.update(n,{options:t})}},this.syncPublishOptions=async()=>{for(let e of this.publishOptions){let{trackType:t}=e;if(!this.isPublishing(t)||this.transceiverCache.has(e))continue;let n=this.transceiverCache.find(e=>!!e.transceiver.sender.track&&e.publishOption.trackType===t);if(!n)continue;let r=this.cloneTrack(n.transceiver.sender.track);await this.addTransceiver(r,e,n.options)}for(let e of this.transceiverCache.items()){let{publishOption:t,transceiver:n}=e;this.publishOptions.some(e=>e.id===t.id&&e.trackType===t.trackType)||(this.stopTrack(n.sender.track),await this.updateTransceiver(e,null))}},this.isPublishing=e=>{for(let t of this.transceiverCache.items()){if(e&&t.publishOption.trackType!==e)continue;let n=t.transceiver.sender.track;if(n&&n.readyState===`live`&&n.enabled)return!0}return!1},this.refreshTrack=async e=>{for(let t of this.transceiverCache.items()){if(t.publishOption.trackType!==e)continue;let{sender:n}=t.transceiver,r=n.track;if(!(!r||r.readyState!==`live`))try{await n.replaceTrack(null),await n.replaceTrack(r),this.logger.debug(`Refreshed ${U[e]} sender`)}catch(t){this.logger.warn(`Failed to refresh ${U[e]}`,t)}}},this.stopTracks=async(...e)=>lj(this.eventLockKey(`changePublishQuality`),async()=>{for(let t of this.transceiverCache.items()){let{publishOption:n,transceiver:r}=t;if(!e.includes(n.trackType))continue;let i=r.sender.track;await this.silenceSenderOnFirefox(t),this.stopTrack(i)}}),this.stopAllTracks=async()=>lj(this.eventLockKey(`changePublishQuality`),async()=>{for(let e of this.transceiverCache.items()){let t=e.transceiver.sender.track;await this.silenceSenderOnFirefox(e),this.stopTrack(t)}for(let e of this.clonedTracks)this.stopTrack(e)}),this.changePublishQuality=async(e,t)=>{let n=e.layers.filter(e=>e.active),r=`Update publish quality:`;this.logger.info(`${r} requested layers by SFU:`,n);let i=t?.transceiver.sender;if(!i)return this.logger.warn(`${r} no video sender found.`);let a=i.getParameters();if(a.encodings.length===0)return this.logger.warn(`${r} there are no encodings set.`);let o=t?.publishOption.codec?.name,s=o&&nj(o),c=!1;for(let e of a.encodings){let t=s?n[0]:n.find(t=>t.name===e.rid)??(a.encodings.length===1?n[0]:void 0),r=!!t?.active;if(r!==e.active&&(e.active=r,c=!0),!t)continue;let{maxFramerate:i,scaleResolutionDownBy:o,maxBitrate:l,scalabilityMode:u}=t;o>=1&&o!==e.scaleResolutionDownBy&&(e.scaleResolutionDownBy=o,c=!0),l>0&&l!==e.maxBitrate&&(e.maxBitrate=l,c=!0),i>0&&i!==e.maxFramerate&&(e.maxFramerate=i,c=!0),u&&u!==e.scalabilityMode&&(e.scalabilityMode=u,c=!0)}let l=$M(e.degradationPreference);l&&a.degradationPreference!==l&&(a.degradationPreference=l,c=!0);let u=a.encodings.filter(e=>e.active);if(!c)return this.logger.info(`${r} no change:`,u);await i.setParameters(a),this.logger.info(`${r} enabled rids:`,u)},this.restartIce=async()=>{this.logger.debug(`Restarting ICE connection`);let e=this.pc.signalingState;if(this.isIceRestarting||e===`have-local-offer`){this.logger.debug(`ICE restart is already in progress`);return}await this.negotiate({iceRestart:!0})},this.negotiate=async e=>lj(`publisher.negotiate.${this.lock}`,async()=>{let t=await this.pc.createOffer(e),n=this.getAnnouncedTracks(t.sdp);if(!n.length)throw Error(`Can't negotiate without any tracks`);try{this.isIceRestarting=e?.iceRestart??!1,await this.pc.setLocalDescription(t);let{sdp:r=``}=t,{dangerouslyForceCodec:i,dangerouslySetStartBitrateFactor:a,fmtpLine:o}=this.clientPublishOptions||{},s=i?$A(r,i,o):r;
466a!==void 0&&this.transceiverCache.items().forEach(e=>{if(e.publishOption.trackType!==U.VIDEO)return;let t=e.publishOption.bitrate,r=e.transceiver.sender.track?.id;if(!r)return;let i=n.find(e=>e.trackId===r)?.mid;i&&(s=ZA(s,t/1e3,a,i))});let{response:c}=await this.sfuClient.setPublisher({sdp:s,tracks:n});if(c.error)throw new oj(c.error);let{sdp:l}=c;await this.pc.setRemoteDescription({type:`answer`,sdp:l})}catch(e){throw this.pc.signalingState===`have-local-offer`&&await this.pc.setLocalDescription({type:`rollback`}),e}finally{this.isIceRestarting=!1}this.addTrickledIceCandidates()}),this.getPublishedTracks=()=>{let e=[];for(let{transceiver:t}of this.transceiverCache.items()){let n=t.sender.track;n&&n.readyState===`live`&&e.push(n)}return e},this.getAnnouncedTracks=e=>{let t=[];for(let n of this.transceiverCache.items())n.transceiver.sender.track&&t.push(this.toTrackInfo(n,e));return t},this.getAnnouncedTracksForReconnect=()=>{let e=this.pc.localDescription?.sdp,t=[];for(let n of this.publishOptions){let r=this.transceiverCache.get(n),i=r?.transceiver.sender.track;!r||!i||i.readyState!==`live`||t.push(this.toTrackInfo(r,e))}return t},this.toTrackInfo=(e,t)=>{let{transceiver:n,publishOption:r}=e,i=n.sender.track,a=i.readyState===`live`,o=a?XM(i,r):this.transceiverCache.getLayers(r);this.transceiverCache.setLayers(r,o);let s=WM(r.trackType),c=this.transceiverCache.indexOf(n),l=this.state.settings?.audio,u=r.trackType===U.SCREEN_SHARE_AUDIO||s&&!!l?.hifi_audio_enabled;return{trackId:i.id,layers:JM(o),trackType:r.trackType,mid:XA(n,c,t),stereo:u,dtx:s&&!!l?.opus_dtx_enabled,red:s&&!!l?.redundant_coding_enabled,muted:!a,codec:r.codec,publishOptionId:r.id}},this.cloneTrack=e=>{let t=e.clone();return this.clonedTracks.add(t),t},this.stopTrack=e=>{e&&(e.stop(),this.clonedTracks.delete(e))},this.silenceSenderOnFirefox=async e=>{if(this.isDisposed||!xM())return;let{transceiver:t,publishOption:n}=e;if(WM(n.trackType)){await t.sender.replaceTrack(null).catch(e=>{this.logger.warn(`Failed to clear audio sender track`,e)});return}await this.disableAllEncodings(e)},this.disableAllEncodings=async e=>{let{transceiver:t,publishOption:n}=e,r=t.sender,i=r.getParameters();if(!i.encodings||i.encodings.length===0)return;e.videoSender||this.transceiverCache.update(n,{videoSender:{trackType:n.trackType,publishOptionId:n.id,codec:n.codec,degradationPreference:eN(i.degradationPreference),layers:i.encodings.map(e=>({name:e.rid??`q`,active:e.active??!0,maxBitrate:e.maxBitrate??0,scaleResolutionDownBy:e.scaleResolutionDownBy??0,maxFramerate:e.maxFramerate??0,scalabilityMode:e.scalabilityMode??``}))}});let a=!1;for(let e of i.encodings)e.active!==!1&&(e.active=!1,a=!0);a&&await r.setParameters(i).catch(e=>{this.logger.error(`Failed to disable video sender encodings:`,e)})},this.publishOptions=t,this.on(`iceRestart`,e=>{e.peerType===DO.PUBLISHER_UNSPECIFIED&&this.tryRestartIce()}),this.on(`changePublishQuality`,async e=>{for(let t of e.videoSenders){let{trackType:e,publishOptionId:n}=t,r=this.transceiverCache.getBy(n,e);r&&this.transceiverCache.update(r.publishOption,{videoSender:t}),!(xM()&&!this.isPublishing(e))&&await this.changePublishQuality(t,r)}}),this.on(`changePublishOptions`,e=>(this.publishOptions=e.publishOptions,this.syncPublishOptions()))}async dispose(){await super.dispose();try{await this.stopAllTracks()}catch(e){this.logger.warn(`Failed to stop tracks during dispose`,e)}this.clonedTracks.clear()}},nN=(e,...t)=>{for(let n of t)e.includes(n)||e.push(n);return e},rN=(e,...t)=>{for(let n of t){let t=e.indexOf(n);t!==-1&&e.splice(t,1)}return e},iN=class extends zM{constructor(e){super(DO.SUBSCRIBER,e),this.restartIce=async()=>{if(this.logger.debug(`Restarting ICE connection`),this.pc.signalingState===`have-remote-offer`){this.logger.debug(`ICE restart is already in progress`);return}if(this.pc.connectionState===`new`){this.logger.debug(`ICE connection is not yet established, skipping restart.`);return}let e=this.isIceRestarting;this.isIceRestarting=!0;try{let{response:e}=await this.sfuClient.iceRestart({peerType:DO.SUBSCRIBER});if(e.error)throw new oj(e.error)}catch(t){throw this.isIceRestarting=e,t}},this.handleOnTrack=e=>{let{streams:t,track:n}=e,[r]=t,[i,a]=r.id.split(`:`),o=this.state.participants.find(e=>e.trackLookupPrefix===i);this.logger.debug(`[onTrack]: Got remote ${a} track for userId: ${o?.userId}`,n.id,n);let s=UM(a);if(!s)return this.logger.error(`Unknown track type: ${a}`);let c=`${o?.userId} ${a}:${i}`;if(n.addEventListener(`mute`,()=>{this.logger.info(`[onTrack]: Track muted: ${c}`),this.setRemoteTrackInterrupted(i,s,!0)}),n.addEventListener(`unmute`,()=>{this.logger.info(`[onTrack]: Track unmuted: ${c}`),this.setRemoteTrackInterrupted(i,s,!1)}),n.addEventListener(`ended`,()=>{this.logger.info(`[onTrack]: Track ended: ${c}`),this.setRemoteTrackInterrupted(i,s,!1),this.state.removeOrphanedTrack(r.id)}),n.muted&&this.setRemoteTrackInterrupted(i,s,!0),this.trackIdToTrackType.set(n.id,s),!o){this.logger.warn(`[onTrack]: Received track for unknown participant: ${i}`,e),this.state.registerOrphanedTrack({id:r.id,trackLookupPrefix:i,track:r,trackType:s});return}let l=VM(s);if(!l){this.logger.error(`Unknown track type: ${a}`);return}let u=o[l];this.state.updateParticipant(o.sessionId,{[l]:r}),u&&(this.logger.info(`[onTrack]: Cleaning up previous remote ${n.kind} tracks for userId: ${o.userId}
466`),u.getTracks().forEach(e=>{e.stop(),u.removeTrack(e)}))},this.setRemoteTrackInterrupted=(e,t,n)=>{if(t!==U.AUDIO)return;let r=this.state.participants.find(t=>t.trackLookupPrefix===e);r&&this.state.updateParticipant(r.sessionId,e=>{let r=e.interruptedTracks??[];return n===r.includes(t)?{}:{interruptedTracks:n?nN([...r],t):rN([...r],t)}})},this.negotiate=async e=>{await this.pc.setRemoteDescription({type:`offer`,sdp:e.sdp}),this.addTrickledIceCandidates();let t=await this.pc.createAnswer();if(t.sdp){t.sdp=QA(e.sdp,t.sdp);let{dangerouslyForceCodec:n,subscriberFmtpLine:r}=this.clientPublishOptions||{};n&&(t.sdp=$A(t.sdp,n,r))}await this.pc.setLocalDescription(t),await this.sfuClient.sendAnswer({peerType:DO.SUBSCRIBER,sdp:t.sdp||``,negotiationId:e.negotiationId}),this.isIceRestarting=!1},this.pc.addEventListener(`track`,this.handleOnTrack),this.on(`subscriberOffer`,async e=>this.negotiate(e).catch(e=>{this.logger.error(`Negotiation failed.`,e)}))}detachEventHandlers(){super.detachEventHandlers(),this.pc.removeEventListener(`track`,this.handleOnTrack)}},aN=e=>{let{endpoint:t,onMessage:n,tag:r,tracer:i}=e,a=JA.getLogger(`SfuClientWS`,{tags:[r]});a.debug(`Creating signaling WS channel:`,t);let o=new WebSocket(t);return o.binaryType=`arraybuffer`,o.addEventListener(`error`,e=>{a.error(`Signaling WS channel error`,e),i?.trace(`signal.ws.error`,e)}),o.addEventListener(`close`,e=>{a.info(`Signaling WS channel is closed`,e),i?.trace(`signal.ws.close`,e)}),o.addEventListener(`open`,e=>{a.info(`Signaling WS channel is open`,e),i?.trace(`signal.ws.open`,e)}),o.addEventListener(`message`,e=>{try{n(e.data instanceof ArrayBuffer?Hk.fromBinary(new Uint8Array(e.data)):Hk.fromJsonString(e.data.toString()))}catch(t){let n=`Failed to decode a message. Check whether the Proto models match.`;a.error(n,{event:e,error:t}),i?.trace(`signal.ws.message.error`,n)}}),o},oN=e=>({bundlePolicy:`max-bundle`,iceServers:e.map(e=>({urls:e.urls,username:e.username,credential:e.password}))});function sN(e){let t=!0,n=e.then(e=>({status:`resolved`,result:e}),e=>({status:`rejected`,error:e})).finally(()=>t=!1),r=()=>n.then(e=>{if(e.status===`rejected`)throw e.error;return e.result});return r.checkPending=()=>t,r}var cN=()=>{let e,t,n=new Promise((n,r)=>{e=n,t=r}),r=!1,i=!1;return{promise:n,resolve:t=>{r=!0,e(t)},reject:e=>{i=!0,t(e)},isResolved:()=>r,isRejected:()=>i}},lN=Symbol(`uninitialized`);function uN(e){let t=lN;return(...n)=>(t===lN&&(t=e(...n)),t)}var dN=!1,fN=()=>{dN=!0},pN=uN(()=>new _O({useWorker:dN})),mN=class extends Error{constructor(e){super(e.error?.message||`Join Error`),this.errorEvent=e,this.unrecoverable=e.reconnectStrategy===LO.DISCONNECT}static isJoinErrorCode(e){let t=e.error?.code;return t===MO.SFU_FULL||t===MO.SFU_SHUTTING_DOWN||t===MO.CALL_PARTICIPANT_LIMIT_REACHED}},hN=()=>{let e=cN();return e.promise.catch(()=>{}),e},gN=class e{constructor({dispatcher:t,credentials:n,sessionId:r,cid:i,tag:a,joinResponseTimeout:o=5e3,rpcRequestTimeout:s=5e3,onSignalClose:c,streamClient:l,enableTracing:u}){this.iceTrickleBuffer=new sj,this.isLeaving=!1,this.isClosingClean=!1,this.pingIntervalInMs=5*1e3,this.unhealthyTimeoutInMs=15*1e3,this.subscriptionsConcurrencyTag=Symbol(`subscriptionsConcurrencyTag`),this.joinResponseTask=hN(),this.abortController=new AbortController,this.createWebSocket=e=>{let t={callEnded:!0,changePublishQuality:!0,changePublishOptions:!0,connectionQualityChanged:!0,error:!0,goAway:!0,inboundStateNotification:!0};this.signalWs=aN({tag:this.tag,endpoint:`${this.credentials.server.ws_endpoint}?${new URLSearchParams(e).toString()}`,tracer:this.tracer,onMessage:e=>{this.lastMessageTimestamp=new Date,this.scheduleConnectionCheck();let n=e.eventPayload.oneofKind;t[n]&&this.tracer?.trace(n,e),this.dispatcher.dispatch(e,this.tag)}});let n;this.signalReady=sN(Promise.race([new Promise((e,t)=>{let r=!1,i=()=>{r=!0,clearTimeout(n),this.signalWs.removeEventListener(`open`,i),e(this.signalWs)};this.signalWs.addEventListener(`open`,i),this.signalWs.addEventListener(`close`,e=>{this.handleWebSocketClose(e);let i=r?`SFU WS closed: ${e.code} ${e.reason}`:`SFU WS connection can't be established: ${e.code} ${e.reason}`;this.tracer?.trace(`signal.close`,i),clearTimeout(n),t(Error(i))})}),new Promise((e,t)=>
466{n=setTimeout(()=>{let e=`SFU WS connection failed to open after ${this.joinResponseTimeout}ms`;this.tracer?.trace(`signal.timeout`,e),t(Error(e))},this.joinResponseTimeout)})]))},this.handleWebSocketClose=e=>{this.signalWs.removeEventListener(`close`,this.handleWebSocketClose),pN().clearInterval(this.keepAliveInterval),clearTimeout(this.connectionCheckTimeout),this.onSignalClose?.(`${e.code} ${e.reason}`)},this.close=(t=e.NORMAL_CLOSURE,n)=>{this.isClosingClean=t!==e.ERROR_CONNECTION_UNHEALTHY;let r=this.signalWs;(r.readyState===WebSocket.OPEN||r.readyState===WebSocket.CONNECTING)&&(this.logger.debug(`Closing SFU WS connection: ${t} - ${n}`),r.close(t,`js-client: ${n}`),r.removeEventListener(`close`,this.handleWebSocketClose)),this.dispose(n)},this.dispose=e=>{this.logger.debug(`Disposing SFU client`),this.unsubscribeIceTrickle(),this.unsubscribeNetworkChanged(),clearInterval(this.keepAliveInterval),clearTimeout(this.connectionCheckTimeout),clearTimeout(this.migrateAwayTimeout),this.abortController.abort(),this.migrationTask?.resolve(),!this.joinResponseTask.isResolved()&&!this.joinResponseTask.isRejected()&&this.joinResponseTask.reject(Error(`SFU client disposed before join completed${e?`: ${e}`:``}`)),this.iceTrickleBuffer.dispose()},this.getTrace=()=>this.tracer?.take(),this.leaveAndClose=async t=>{try{this.isLeaving=!0,!this.joinResponseTask.isResolved()&&!this.joinResponseTask.isRejected()&&await Promise.race([this.joinResponseTask.promise.catch(()=>{}),NA(e.LEAVE_NOTIFY_GRACE_MS)]),this.joinResponseTask.isResolved()?await this.notifyLeave(t):this.logger.debug(`[leaveAndClose] join not completed within grace period, skipping notifyLeave`)}catch(e){this.logger.debug(`Error notifying SFU about leaving call`,e)}this.close(e.NORMAL_CLOSURE,t.substring(0,115))},this.updateSubscriptions=async e=>lj(this.subscriptionsConcurrencyTag,async()=>(await this.joinTask,YA(t=>this.rpc.updateSubscriptions({sessionId:this.sessionId,tracks:e},{invocationMeta:t}),this.abortController.signal))),this.setPublisher=async e=>(await this.joinTask,YA(t=>this.rpc.setPublisher({...e,sessionId:this.sessionId},{invocationMeta:t}),this.abortController.signal,3)),this.sendAnswer=async e=>(await this.joinTask,YA(t=>this.rpc.sendAnswer({...e,sessionId:this.sessionId},{invocationMeta:t}),this.abortController.signal)),this.iceTrickle=async e=>(await this.joinTask,YA(t=>this.rpc.iceTrickle({...e,sessionId:this.sessionId},{invocationMeta:t}),this.abortController.signal)),this.iceRestart=async e=>(await this.joinTask,YA(t=>this.rpc.iceRestart({...e,sessionId:this.sessionId},{invocationMeta:t}),this.abortController.signal)),this.updateMuteStates=async e=>(await this.joinTask,YA(t=>this.rpc.updateMuteStates({muteStates:e,sessionId:this.sessionId},{invocationMeta:t}),this.abortController.signal)),this.sendStats=async e=>(await this.joinTask,this.rpc.sendStats({...e,sessionId:this.sessionId})),this.startNoiseCancellation=async()=>(await this.joinTask,YA(e=>this.rpc.startNoiseCancellation({sessionId:this.sessionId},{invocationMeta:e}),this.abortController.signal)),this.stopNoiseCancellation=async()=>(await this.joinTask,YA(e=>this.rpc.stopNoiseCancellation({sessionId:this.sessionId},{invocationMeta:e}),this.abortController.signal)),this.enterMigration=async(e={})=>{this.isLeaving=!0;let{timeout:t=7*1e3}=e;this.migrationTask?.reject(Error(`Cancelled previous migration`));let n=this.migrationTask=cN(),r=this.dispatcher.on(`participantMigrationComplete`,this.tag,()=>{r(),clearTimeout(this.migrateAwayTimeout),n.resolve()});return this.migrateAwayTimeout=setTimeout(()=>{r(),n.reject(Error(`Migration (${this.tag}) failed to complete in ${t}ms`))},t),n.promise},this.join=async e=>{await this.signalReady(),(this.joinResponseTask.isResolved()||this.joinResponseTask.isRejected())&&(this.joinResponseTask=hN());let t=this.joinResponseTask,n,r,i,a=()=>{clearTimeout(n),n=void 0,i?.(),i=void 0,r?.(),r=void 0};i=this.dispatcher.on(`error`,this.tag,e=>{mN.isJoinErrorCode(e)&&(a(),t.reject(new mN(e)))}),r=this.dispatcher.on(`joinResponse`,this.tag,e=>{a(),this.keepAlive(),t.resolve(e)}),n=setTimeout(()=>{a();let e=`Waiting for "joinResponse" has timed out after ${this.joinResponseTimeout}ms`;this.tracer?.trace(`joinRequestTimeout`,e),t.reject(Error(e))},this.joinResponseTimeout);let o=Jk.create({requestPayload:{oneofKind:`joinRequest`,joinRequest:eA.create({...e,sessionId:this.sessionId,token:this.credentials.token})}});return this.tracer?.trace(`joinRequest`,o),await this.send(o),t.promise},this.ping=async()=>this.send(Jk.create({requestPayload:{oneofKind:`healthCheckRequest`,healthCheckRequest:{}}})),this.notifyLeave=async e=>this.send(Jk.create({requestPayload:{oneofKind:`leaveCallRequest`,leaveCallRequest:{sessionId:this.sessionId,reason:e}}})),this.send=async e=>{await this.signalReady();let t=Jk.toJson(e);if(this.signalWs.readyState!==WebSocket.OPEN){this.logger.debug(`Signal WS is not open. Skipping message`,t);return}this.logger.debug(`Sending message to: ${this.edgeName}`,t),this.signalWs.send(Jk.toBinary(e))},this.keepAlive=()=>{let e=pN();e.clearInterval(this.keepAliveInterval),this.keepAliveInterval=e.setInterval(()=>{this.ping().catch(e=>{this.logger.error(`Error sending healthCheckRequest to SFU`,e)})},this.pingIntervalInMs)},this.scheduleConnectionCheck=()=>{clearTimeout(this.connectionCheckTimeout),this.connectionCheckTimeout=setTimeout(()=>{this.lastMessageTimestamp&&new Date().getTime()-this.lastMessageTimestamp.getTime()>this.unhealthyTimeoutInMs&&this.close(e.ERROR_CONNECTION_UNHEALTHY,`SFU connection unhealthy. Didn't receive any message for ${this.unhealthyTimeoutInMs}ms`)},this.unhealthyTimeoutInMs)},this.dispatcher=t,this.sessionId=r||zA(),this.onSignalClose=c,this.credentials=n;let{server:d,token:f}=n;this.edgeName=d.edge_name,this.joinResponseTimeout=o,this.tag=a,this.logger=JA.getLogger(`SfuClient`,{tags:[a]}),this.tracer=u?new LM(`${a}-${this.edgeName}`):void 0,this.rpc=MA({baseUrl:d.url,interceptors:[DA({Authorization:`Bearer ${f}`}),this.tracer&&jA(this.tracer.trace),this.logger.getLogLevel()===`trace`&&AA(this.logger),kA(s,this.tracer?.trace)].filter(e=>!!e)}),this.unsubscribeIceTrickle=t.on(`iceTrickle`,a,e=>{this.iceTrickleBuffer.push(e)}),this.unsubscribeNetworkChanged=l.on(`network.changed`,e=>{e.online?this.networkAvailableTask?.resolve():this.networkAvailableTask=cN()}),this.createWebSocket({attempt:a,user_id:l.user?.id||``,api_key:l.key,user_session_id:this.sessionId,cid:i})}get isHealthy(){return this.signalWs.readyState===WebSocket.OPEN&&this.joinResponseTask.isResolved()}get joinTask(){return this.joinResponseTask.promise}};gN.NORMAL_CLOSURE=1e3,gN.ERROR_CONNECTION_UNHEALTHY=4001,gN.DISPOSE_OLD_SOCKET=4100,gN.JOIN_FAILED=4101,gN.LEAVE_NOTIFY_GRACE_MS=1e3;var _N=e=>async function(t){if(t.user.id===e.currentUserId)return;let{state:n}=e;t.call.created_by.id===e.currentUserId&&n.callingState===W.RINGING&&await e.join()},vN=e=>async function(t){if(t.user.id===e.currentUserId)return;let{call:n}=t,{session:r}=n;if(!r){e.logger.warn(`No call session provided. Ignoring call.rejected event.`,t);return}let i=r.rejected_by,{members:a,callingState:o}=e.state;if(o!==W.RINGING){e.logger.info(`Call is not in ringing mode (it is either accepted or rejected already). Ignoring call.rejected event.`,t);return}e.isCreatedByMe?a.filter(t=>t.user_id!==e.currentUserId).every(e=>i[e.user_id])&&(e.logger.info(`everyone rejected, leaving the call`),await e.leave({reject:!0,reason:`cancel`,message:`ring: everyone rejected`})):i[n.created_by.id]&&(e.logger.info(`call creator rejected, leaving call`),globalThis.streamRNVideoSDK?.callingX?.endCall(e,`remote`),await e.leave({message:`ring: creator rejected`}))},yN=e=>function(){globalThis.streamRNVideoSDK?.callingX?.endCall(e,`remote`);let{callingState:t}=e.state;t!==W.IDLE&&t!==W.LEFT&&e.leave({message:`call.ended event received`,reject:!1}
466).catch(t=>{e.logger.error(`Failed to leave call after call.ended `,t)})},bN=e=>e.on(`callEnded`,async t=>{if(e.state.callingState!==W.LEFT)try{if(t.reason===IO.LIVE_ENDED){e.state.setBackstage(!0);let{hasPermission:t}=e.permissionsContext;if(t(bO.JOIN_BACKSTAGE))return}e.state.setEndedAt(new Date);let n=IO[t.reason];globalThis.streamRNVideoSDK?.callingX?.endCall(e,`remote`),await e.leave({message:`callEnded received: ${n}`})}catch(t){e.logger.error(`Failed to leave call after being ended by the SFU`,t)}}),xN=e=>function(t){let{currentGrants:n}=t;n&&e.setCallGrants(n)},SN=(e,t)=>e.on(`connectionQualityChanged`,`*`,e=>{let{connectionQualityUpdates:n}=e;n&&t.updateParticipants(n.reduce((e,t)=>{let{sessionId:n,connectionQuality:r}=t;return e[n]={connectionQuality:r},e},{}))}),CN=(e,t)=>e.on(`healthCheckResponse`,`*`,e=>{let{participantCount:n}=e;n&&(t.setParticipantCount(n.total),t.setAnonymousParticipantCount(n.anonymous))}),wN=(e,t)=>e.on(`error`,`*`,e=>{e.error&&e.error.code!==MO.LIVE_ENDED||(t.state.setBackstage(!0),t.permissionsContext.hasPermission(bO.JOIN_BACKSTAGE)||t.leave({message:`live ended`}).catch(e=>{t.logger.error(`Failed to leave call after live ended`,e)}))}),TN=e=>e.on(`error`,`*`,e=>{if(!e.error)return;let t=JA.getLogger(`SfuClient`),{error:n,reconnectStrategy:r}=e;t.error(`SFU reported error`,{code:MO[n.code],reconnectStrategy:LO[r],message:n.message,shouldRetry:n.shouldRetry})}),EN=e=>function(t){let{pins:n}=t;e.setServerSidePins(n)},DN=e=>function(t){let{inboundVideoStates:n}=t,r=e.getParticipantLookupBySessionId(),i={};for(let{sessionId:e,trackType:t,paused:a}of n){let n=[...r[e]?.pausedTracks??[]];a?nN(n,t):rN(n,t),i[e]={pausedTracks:n}}e.updateParticipants(i)},ON=e=>e.on(`trackUnpublished`,async t=>{let{cause:n,type:r,sessionId:i}=t,{localParticipant:a}=e.state;if(n===PO.MODERATION&&i===a?.sessionId){let t=e.logger;t.info(`Local participant's ${U[r]} track is muted remotely`);try{r===U.VIDEO?await e.camera.disable():r===U.AUDIO?await e.microphone.disable():r===U.SCREEN_SHARE||r===U.SCREEN_SHARE_AUDIO?await e.screenShare.disable():t.warn(`Unsupported track type to soft mute`,U[r])}catch(e){t.error(`Failed to stop publishing`,e)}}}),kN=e=>function(t){let{participant:n}=t;if(!n)return;let r=PN(e,n);e.updateOrAddParticipant(n.sessionId,Object.assign(n,r,{...t.isPinned&&{pin:{isLocalPin:!1,pinnedAt:Date.now()}},viewportVisibilityState:{videoTrack:CA.UNKNOWN,screenShareTrack:CA.UNKNOWN}}))},AN=e=>function(t){let{participant:n}=t;n&&e.setParticipants(e=>e.filter(e=>e.sessionId!==n.sessionId))},jN=e=>function(t){let{participant:n}=t;n&&e.updateParticipant(n.sessionId,n)},MN=e=>function(t){let{type:n,sessionId:r}=t;if(t.participant){let n=PN(e,t.participant),i=Object.assign(t.participant,n);e.updateOrAddParticipant(r,i)}else e.updateParticipant(r,e=>({publishedTracks:nN([...e.publishedTracks],n)}))},NN=e=>function(t){let{type:n,sessionId:r}=t;if(t.participant){let i=PN(e,t.participant),a=Object.assign(t.participant,i);e.updateOrAddParticipant(r,a,e=>({pausedTracks:e.pausedTracks?.filter(e=>e!==n)}))}else e.updateParticipant(r,e=>({publishedTracks:e.publishedTracks.filter(e=>e!==n),pausedTracks:e.pausedTracks?.filter(e=>e!==n)}))},PN=(e,t)=>{let n=e.takeOrphanedTracks(t.trackLookupPrefix);if(!n.length)return;let r={};for(let e of n){let t=VM(e.trackType);t&&(r[t]=e.track)}return r},FN=(e,t)=>e.on(`dominantSpeakerChanged`,`*`,e=>{let{sessionId:n}=e;n!==t.dominantSpeaker?.sessionId&&t.setParticipants(e=>e.map(e=>e.sessionId===n?{...e,isDominantSpeaker:!0}:e.isDominantSpeaker?{...e,isDominantSpeaker:!1}:e))}),IN=(e,t)=>e.on(`audioLevelChanged`,`*`,e=>{let{audioLevels:n}=e;t.updateParticipants(n.reduce((e,t)=>(e[t.sessionId]={audioLevel:t.level,isSpeaking:t.isSpeaking},e),{}))}),LN=(e,t)=>{let n=e.state,r=[e.on(`call.ended`,yN(e)),bN(e),wN(t,e),TN(t),SN(t,n),CN(t,n),e.on(`participantJoined`,kN(n)),e.on(`participantLeft`,AN(n)),e.on(`participantUpdated`,jN(n)),e.on(`trackPublished`,MN(n)),e.on(`trackUnpublished`,NN(n)),IN(t,n),FN(t,n),e.on(`callGrantsUpdated`,xN(n)),e.on(`pinsUpdated`,EN(n)),e.on(`inboundStateNotification`,DN(n)),ON(e)];return()=>
466{r.forEach(e=>e())}},RN=e=>{let t={"call.accepted":_N(e),"call.rejected":vN(e)},n=Object.keys(t).map(n=>{let r=n;return e.on(r,t[r])});return()=>{n.forEach(e=>e())}},zN=(e,t=`audioTrack`)=>`${e}/${t}`,BN=class{constructor(e,t){this.bindings=new Map,this.enabled=!0,this.logger=JA.getLogger(`AudioBindingsWatchdog`),this.register=(e,t,n)=>{let r=zN(t,n),i=this.bindings.get(r);i&&i!==e&&(this.logger.warn(`Audio element already bound to ${t} and ${n}`),this.tracer.trace(`audioBinding.alreadyBoundWarning`,n)),this.bindings.set(r,e)},this.unregister=(e,t)=>{this.bindings.delete(zN(e,t))},this.setEnabled=e=>{this.enabled=e,e?this.start():this.stop()},this.dispose=()=>{this.stop(),this.bindings.clear(),this.unsubscribeCallingState()},this.start=()=>{clearInterval(this.watchdogInterval),this.watchdogInterval=setInterval(()=>{let e=[];for(let t of this.state.participants){if(t.isLocalParticipant)continue;let{audioStream:n,screenShareAudioStream:r,sessionId:i,userId:a,publishedTracks:o}=t;n&&o.includes(U.AUDIO)&&!this.bindings.has(zN(i))&&e.push(a),r&&o.includes(U.SCREEN_SHARE_AUDIO)&&!this.bindings.has(zN(i,`screenShareAudioTrack`))&&e.push(a)}if(e.length>0){let t=`audioBinding.danglingWarning`;this.tracer.traceOnce(t,t,e),this.logger.warn(`Dangling audio bindings detected. Did you forget to bind the audio element? user_ids: ${e}.`)}},3e3)},this.stop=()=>{clearInterval(this.watchdogInterval)},this.tracer=t,this.state=e,this.unsubscribeCallingState=Sj(e.callingState$,e=>{this.enabled&&(e===W.JOINED?this.start():this.stop())})}},VN=class{constructor(e){this.logger=JA.getLogger(`BlockedAudioTracker`),this.blockedElementsSubject=new fD(new Set),this.autoplayBlocked$=this.blockedElementsSubject.pipe(LD(e=>e.size>0),rO()),this.markBlocked=(e,t)=>{yj(this.blockedElementsSubject,n=>(t?n.add(e):n.delete(e),n))},this.isBlocked=e=>this.blockedElementsSubject.getValue().has(e),this.resumeAudio=async()=>{this.tracer.trace(`resumeAudio`,null),await bj(this.blockedElementsSubject,async e=>(await Promise.all(Array.from(e,async t=>{try{t.srcObject&&await PA([t.play()],2e3),e.delete(t)}catch(e){this.logger.warn(`Can't resume audio for element`,t,e)}})),e))},this.tracer=e}},HN=Symbol(`globalOverrideKey`),UN=class{constructor(e,t){this.logger=JA.getLogger(`TrackSubscriptionManager`),this.pendingUpdate=null,this.overridesSubject=new fD({}),this.overrides$=this.overridesSubject.asObservable(),this.incomingVideoSettings$=this.overrides$.pipe(LD(e=>{let{[HN]:t,...n}=e;return{enabled:t?.enabled!==!1,preferredResolution:t?.enabled?t.dimension:void 0,participants:Object.fromEntries(Object.entries(n).map(([e,t])=>[e,{enabled:t?.enabled!==!1,preferredResolution:t?.enabled?t.dimension:void 0}])),isParticipantVideoEnabled:t=>e[t]?.enabled??e[HN]?.enabled??!0}}),lO(1)),this.setSfuClient=e=>{this.sfuClient=e},this.dispose=()=>{this.pendingUpdate&&=(clearTimeout(this.pendingUpdate),null)},this.setOverrides=(e,t)=>(this.tracer.trace(`setOverrides`,[e,t]),t?yj(this.overridesSubject,n=>({...n,...Object.fromEntries(t.map(t=>[t,e]))})):yj(this.overridesSubject,e?{[HN]:e}:{})),this.apply=(e=wA.SLOW)=>{this.pendingUpdate&&clearTimeout(this.pendingUpdate);let t=()=>{this.pendingUpdate=null,this.sfuClient?.updateSubscriptions(this.subscriptions).catch(e=>{this.logger.debug(`Failed to update track subscriptions`,e)})};e?this.pendingUpdate=setTimeout(t,e):t()},this.tracer=t,this.callState=e}get subscriptions(){let e=[],t=this.callState.getParticipantsSnapshot(),n=this.overridesSubject.getValue();for(let r of t)if(!r.isLocalParticipant){if(r.videoDimension&&kj(r)){let t=n[r.sessionId]??n[HN];t?.enabled!==!1&&e.push({userId:r.userId,sessionId:r.sessionId,trackType:U.VIDEO,dimension:t?.dimension??r.videoDimension})}r.screenShareDimension&&jj(r)&&e.push({userId:r.userId,sessionId:r.sessionId,trackType:U.SCREEN_SHARE,dimension:r.screenShareDimension}),Mj(r)&&e.push({userId:r.userId,sessionId:r.sessionId,trackType:U.SCREEN_SHARE_AUDIO})}return e}get overrides(){return vj(this.overrides$)}},WN=class{constructor(e){this.logger=JA.getLogger(`MediaPlaybackWatchdog`),this.controller=new AbortController,this.attempt=0,this.disposed=!1,this.attach=()=>
466{if(this.disposed)return;let{signal:e}=this.controller;this.element.addEventListener(`pause`,this.onPauseOrSuspend,{signal:e}),this.element.addEventListener(`suspend`,this.onPauseOrSuspend,{signal:e}),this.element.addEventListener(`playing`,this.onPlaying,{signal:e})},this.dispose=()=>{this.disposed||(this.disposed=!0,this.controller.abort(),this.pendingTimer&&clearTimeout(this.pendingTimer),this.pendingTimer=void 0)},this.onPlaying=()=>{this.attempt>0&&this.tracer.trace(`mediaPlayback.recover.success`,{kind:this.kind,attempts:this.attempt}),this.attempt=0,this.pendingTimer&&clearTimeout(this.pendingTimer),this.pendingTimer=void 0},this.onPauseOrSuspend=e=>{this.disposed||(this.tracer.trace(`mediaPlayback.paused`,{kind:this.kind,reason:e.type}),this.scheduleRecovery())},this.scheduleRecovery=()=>{if(this.disposed||this.pendingTimer)return;let e=this.computeSkipReason();if(e){this.tracer.trace(`mediaPlayback.recover.skipped`,{kind:this.kind,reason:e});return}let t=this.attempt===0?0:LA(this.attempt);this.pendingTimer=setTimeout(this.attemptPlay,t)},this.computeSkipReason=()=>{if(this.disposed)return`disposed`;if(!this.element.srcObject)return`noSrc`;if(this.element.ended)return`ended`;if(this.isBlocked())return`blocked`;if(this.element.readyState<2)return`notReady`;if(!this.element.paused)return`notPaused`},this.attemptPlay=async()=>{if(this.pendingTimer=void 0,!this.disposed){this.attempt+=1,this.tracer.trace(`mediaPlayback.recover.attempt`,{kind:this.kind,attempt:this.attempt});try{await PA([this.element.play()],2e3)}catch(e){if(this.disposed)return;if(this.logger.warn(`Failed to recover ${this.kind} playback`,e),this.attempt>=10){this.tracer.trace(`mediaPlayback.recover.giveUp`,{kind:this.kind,attempts:this.attempt});return}this.scheduleRecovery()}}},this.element=e.element,this.kind=e.kind,this.tracer=e.tracer,this.isBlocked=e.isBlocked??(()=>!1),this.attach()}},GN=class{constructor(e,t,n,r,i){this.logger=JA.getLogger(`DynascaleManager`),this.useWebAudio=!1,this.dispose=async()=>{let e=this.audioContext;e&&e.state!==`closed`&&(document.removeEventListener(`click`,this.resumeAudioContext),await e.close(),this.audioContext=void 0)},this.setUseWebAudio=e=>{this.tracer.trace(`setUseWebAudio`,e),this.useWebAudio=e},this.bindVideoElement=(e,t,n)=>{let r=this.callState.findParticipantBySessionId(t);if(!r)return;let i=(e,i)=>{i&&(i.width===0||i.height===0)&&(this.logger.debug(`Ignoring 0x0 dimension`,r),i=void 0),this.callState.updateParticipantTracks(n,{[t]:{dimension:i}}),this.trackSubscriptionManager.apply(e)},a=this.callState.participants$.pipe(LD(e=>e.find(e=>e.sessionId===t)),dO(e=>!!e),rO(),lO({bufferSize:1,refCount:!0})),o,s=r.isLocalParticipant?null:a.pipe(LD(e=>e.viewportVisibilityState?.[n]),rO()).subscribe(t=>{if(!o){o=t??CA.UNKNOWN;return}if(o=t??CA.UNKNOWN,t===CA.INVISIBLE)return i(wA.MEDIUM,void 0);i(wA.MEDIUM,{width:e.clientWidth,height:e.clientHeight})}),c,l=r.isLocalParticipant?null:new ResizeObserver(()=>{let t={width:e.clientWidth,height:e.clientHeight};if(!c){c=t;return}c.width===t.width&&c.height===t.height||o===CA.INVISIBLE||(i(Math.max(t.width/c.width,t.height/c.height)>1.2?wA.IMMEDIATE:wA.MEDIUM,{width:e.clientWidth,height:e.clientHeight}),c=t)});l?.observe(e);let u=n===`videoTrack`,d=r.isLocalParticipant?null:a.pipe(aO(`publishedTracks`),LD(e=>u?kj(e):jj(e)),rO()).subscribe(t=>{t?i(wA.IMMEDIATE,{width:e.clientWidth,height:e.clientHeight}):i(wA.FAST,void 0)});e.autoplay=!0,e.playsInline=!0,e.muted=!0;let f=new WN({element:e,kind:`video`,tracer:this.tracer}),p=u?`videoStream`:`screenShareStream`,m=a.pipe(aO(p)).subscribe(t=>{let n=u?t.videoStream:t.screenShareStream;e.srcObject!==n&&(e.srcObject=n??null,(yM()||xM())&&setTimeout(async()=>{e.srcObject=n??null;try{await PA([e.play()],2e3)}catch(e){this.logger.warn(`Failed to play stream`,e)}},25))});return()=>{i(wA.FAST,void 0),s?.unsubscribe(),d?.unsubscribe(),m.unsubscribe(),l?.disconnect(),f.dispose()}},this.bindAudioElement=(e,t,n)=>{let r=this.callState.findParticipantBySessionId(t);if(!r||r.isLocalParticipant)return;let i=this.callState.participants$.pipe(LD(e=>e.find(e=>e.sessionId===t)),dO(e=>!!e),rO(),lO({bufferSize:1,refCount:!0})),a=(t,n)=>
466{t&&(`setSinkId`in e&&e.setSinkId(t).catch(e=>{this.logger.warn(`Can't to set AudioElement sinkId`,e)}),n&&`setSinkId`in n&&n.setSinkId(t).catch(e=>{this.logger.warn(`Can't to set AudioContext sinkId`,e)}))},o,s,c,l=n===`audioTrack`,u=l?`audioStream`:`screenShareAudioStream`,d=i.pipe(aO(u)).subscribe(t=>{let n=l?t.audioStream:t.screenShareAudioStream;e.srcObject!==n&&setTimeout(()=>{if(e.srcObject=n??null,c?.dispose(),c=void 0,!n){this.blockedAudioTracker.markBlocked(e,!1);return}let r=this.getOrCreateAudioContext();r?(e.muted=!0,o?.disconnect(),o=r.createMediaStreamSource(n),s??=r.createGain(),s.gain.value=t.audioVolume??this.speaker.state.volume,o.connect(s).connect(r.destination),this.resumeAudioContext()):(e.muted=!1,e.play().catch(t=>{this.tracer.trace(`audioPlaybackError`,t.message),t.name===`NotAllowedError`&&(this.tracer.trace(`audioPlaybackBlocked`,null),this.blockedAudioTracker.markBlocked(e,!0)),this.logger.warn(`Failed to play audio stream`,t)}),c=new WN({element:e,kind:`audio`,tracer:this.tracer,isBlocked:()=>this.blockedAudioTracker.isBlocked(e)}));let{selectedDevice:i}=this.speaker.state;i&&a(i,r)})}),f=`setSinkId`in e?this.speaker.state.selectedDevice$.subscribe(e=>{a(e,this.getOrCreateAudioContext())}):null,p=zD([this.speaker.state.volume$,i.pipe(aO(`audioVolume`))]).subscribe(([t,n])=>{let r=n.audioVolume??t;e.volume=r,s&&(s.gain.value=r)});return e.autoplay=!0,()=>{this.blockedAudioTracker.markBlocked(e,!1),f?.unsubscribe(),p.unsubscribe(),d.unsubscribe(),e.srcObject=null,o?.disconnect(),s?.disconnect(),c?.dispose(),c=void 0}},this.getOrCreateAudioContext=()=>{if(!this.useWebAudio)return;if(this.audioContext)return this.audioContext;let e=new AudioContext;this.tracer.trace(`audioContext.create`,e.state),e.state===`suspended`&&document.addEventListener(`click`,this.resumeAudioContext),e.addEventListener(`statechange`,()=>{this.tracer.trace(`audioContext.state`,e.state),e.state===`interrupted`&&this.resumeAudioContext()});let t=navigator.audioSession;if(t){t.type=`play-and-record`;let e=!1;t.addEventListener(`statechange`,()=>{this.tracer.trace(`audioSession.state`,t.state),t.state===`interrupted`?e=!0:e&&=(this.resumeAudioContext(),!1)})}return this.audioContext=e},this.resumeAudioContext=()=>{if(!this.audioContext)return;let{state:e}=this.audioContext;if(e===`suspended`||e===`interrupted`){let e=`audioContext.resume`;this.audioContext.resume().then(()=>{this.tracer.trace(e,this.audioContext?.state),document.removeEventListener(`click`,this.resumeAudioContext)},t=>{this.tracer.trace(`${e}Error`,this.audioContext?.state),this.logger.warn(`Can't resume audio context`,t)})}},this.callState=e,this.speaker=t,this.tracer=n,this.trackSubscriptionManager=r,this.blockedAudioTracker=i}},KN=.35,qN={videoTrack:CA.UNKNOWN,screenShareTrack:CA.UNKNOWN},JN=class{constructor(e){this.elementHandlerMap=new Map,this.observer=null,this.queueSet=new Set,this.setViewport=(e,t)=>{let n=()=>{this.observer?.disconnect(),this.observer=null,this.elementHandlerMap.clear()};return this.observer=new IntersectionObserver(e=>{e.forEach(e=>{this.elementHandlerMap.get(e.target)?.(e)})},{root:e,...t,threshold:t?.threshold??KN}),this.queueSet.size&&(this.queueSet.forEach(([t,n])=>{e.contains(t)&&(this.observer.observe(t),this.elementHandlerMap.set(t,n))}),this.queueSet.clear()),n},this.observe=(e,t)=>{let n=[e,t],r=()=>{this.elementHandlerMap.delete(e),this.observer?.unobserve(e),this.queueSet.delete(n)};return this.elementHandlerMap.has(e)?r:this.observer?(this.observer.root.contains(e)&&(this.elementHandlerMap.set(e,t),this.observer.observe(e)),r):(this.queueSet.add(n),r)},this.trackElementVisibility=(e,t,n)=>{let r=this.observe(e,r=>{this.callState.updateParticipant(t,t=>{let i=t.viewportVisibilityState??qN,a=r.isIntersecting||document.fullscreenElement===e?CA.VISIBLE:CA.INVISIBLE;return{...t,viewportVisibilityState:{...i,[n]:a}}})});return()=>{r(),this.callState.updateParticipant(t,e=>{let t=e.viewportVisibilityState??qN;return{...e,viewportVisibilityState:{...t,[n]:CA.UNKNOWN}}})}},this.callState=e}},YN=class{constructor(){this.permissions=[],this.setPermissions=e=>{this.permissions=e||[]},this.setCallSettings=e=>{this.settings=e},this.hasPermission=e=>this.permissions.includes(e),this.canPublish=e=>{switch(e){case U.AUDIO:return this.hasPermission(bO.SEND_AUDIO);case U.VIDEO:return this.hasPermission(bO.SEND_VIDEO);case U.SCREEN_SHARE:case U.SCREEN_SHARE_AUDIO:return this.hasPermission(bO.SCREENSHARE);case U.UNSPECIFIED:return!1;default:return Qj(e,`Unknown track type`),!1}},this.canRequest=(e,t=this.settings)=>{if(!t)return!1;let{audio:n,video:r,screensharing:i}=t;switch(e){case bO.SEND_AUDIO:return n.access_request_enabled;case bO.SEND_VIDEO:return r.access_request_enabled;case bO.SCREENSHARE:return i.access_request_enabled;default:return!1}}}},XN=class{constructor(e,t={sortParticipantsBy:Jj}){this.name=e,this.options=t}},ZN=new class{constructor(e){this.register=e=>{this.callTypes[e.name]=e},this.unregister=e=>{delete this.callTypes[e]},this.get=e=>(this.callTypes[e]||this.register(new XN(e)),this.callTypes[e]),this.callTypes=e.reduce((e,t)=>
466(e[t.name]=t,e),{})}}([new XN(`default`,{sortParticipantsBy:Jj}),new XN(`development`,{sortParticipantsBy:Jj}),new XN(`livestream`,{sortParticipantsBy:Zj}),new XN(`audio_room`,{sortParticipantsBy:Zj})]),QN=class{constructor(e,t){this.timestamps=[],this.tryRegister=(e=Date.now())=>(this.prune(e),this.timestamps.length>=this.maxAttempts?!1:(this.timestamps.push(e),!0)),this.reset=()=>{this.timestamps=[]},this.setLimits=(e,t)=>{this.maxAttempts=e,this.windowMs=t},this.prune=e=>{let t=e-this.windowMs;this.timestamps=this.timestamps.filter(e=>e>=t)},this.maxAttempts=e,this.windowMs=t}},$N=e=>{e.active&&(e.getTracks().forEach(e=>{e.stop()}),typeof e.release==`function`&&e.release())},eP=class{constructor(e){this.permission=e,this.disposeController=new AbortController,this.wasPrompted=!1,this.listeners=new Set,this.logger=JA.getLogger(`permissions`);let t=this.disposeController.signal;this.ready=(async()=>{let n=()=>{KA()?this.setState(`granted`):this.setState(`prompt`)};if(!tP())return n();try{let n=await navigator.permissions.query({name:e.queryName});t.aborted||(this.setState(n.state),n.addEventListener(`change`,()=>this.setState(n.state),{signal:t}))}catch(e){this.logger.debug(`Failed to query permission status`,e),n()}})()}dispose(){this.state=void 0,this.disposeController.abort()}async getState(){if(await this.ready,!this.state)throw Error(`BrowserPermission instance possibly disposed`);return this.state}async prompt({forcePrompt:e=!1,throwOnNotAllowed:t=!1}={}){return await lj(`permission-prompt-${this.permission.queryName}`,async()=>
466{if(await this.getState()!==`prompt`||this.wasPrompted&&!e){let e=this.state===`granted`;if(!e&&t)throw Error(`Permission was not granted previously, and prompting again is not allowed`);return e}try{return this.wasPrompted=!0,this.setState(`prompting`),$N(await navigator.mediaDevices.getUserMedia(this.permission.constraints)),this.setState(`granted`),!0}catch(e){if(e&&typeof e==`object`&&`name`in e&&(e.name===`NotAllowedError`||e.name===`SecurityError`)){if(this.logger.info(`Browser permission was not granted`,{permission:this.permission}),this.setState(`denied`),t)throw e;return!1}throw this.logger.error(`Failed to getUserMedia`,{error:e,permission:this.permission}),this.setState(`prompt`),e}})}listen(e){return this.listeners.add(e),this.state&&e(this.state),()=>this.listeners.delete(e)}asObservable(){return this.getStateObservable().pipe(LD(e=>e!==`denied`))}asStateObservable(){return this.getStateObservable()}getIsPromptingObservable(){return this.getStateObservable().pipe(LD(e=>e===`prompting`))}getStateObservable(){return $D(e=>this.listen(e),(e,t)=>t())}setState(e){if(this.state!==e){let{tracer:t,queryName:n}=this.permission,r=`navigator.mediaDevices.${n}.permission`;t?.trace(r,{previous:this.state,state:e}),this.state=e,this.listeners.forEach(t=>t(e))}}};function tP(){return!KA()&&typeof navigator<`u`&&!!navigator.permissions?.query}var nP=(e,t,n)=>PD((async()=>{let r=await navigator.mediaDevices.enumerateDevices();return r.some(e=>e.kind===t&&e.label===``)&&await e.prompt()&&(r=await navigator.mediaDevices.enumerateDevices()),n?.traceOnce(`device-enumeration`,`navigator.mediaDevices.enumerateDevices`,r),r.filter(e=>e.kind===t&&e.label!==``&&e.deviceId!==`default`)})()),rP=()=>typeof document>`u`?!1:`setSinkId`in document.createElement(`audio`),iP={audio:{autoGainControl:!0,noiseSuppression:!0,echoCancellation:!0}},aP={video:{width:1280,height:720}},oP=uN(e=>new eP({constraints:iP,queryName:`microphone`,tracer:e})),sP=uN(e=>new eP({constraints:aP,queryName:`camera`,tracer:e})),cP=uN(e=>navigator.mediaDevices.addEventListener?JD(navigator.mediaDevices,`devicechange`).pipe(fO(()=>e?.resetTrace(`device-enumeration`)),LD(()=>void 0),nO(500)):PD([])),lP=uN(e=>eO(cP(e),oP(e).asObservable()).pipe(uO([]),tO(()=>nP(oP(e),`audioinput`,e)),lO(1))),uP=uN(e=>eO(cP(e),sP(e).asObservable()).pipe(uO([]),tO(()=>nP(sP(e),`videoinput`,e)),lO(1))),dP=uN(e=>eO(cP(e),oP(e).asObservable()).pipe(uO([]),tO(()=>nP(oP(e),`audiooutput`,e)),lO(1))),fP=0,pP=async(e,t)=>{let n=`navigator.mediaDevices.getUserMedia.${fP++}.`;try{t?.trace(n,e);let r=await navigator.mediaDevices.getUserMedia(e);if(t?.trace(`${n}OnSuccess`,nM(r)),xM()&&navigator.mediaDevices.dispatchEvent(new Event(`devicechange`)),e.video){let[i]=r.getVideoTracks();if(i){let{width:r,height:a}=i.getSettings(),o=e.video;(r!==o.width||a!==o.height)&&t?.trace(`${n}Warn`,`Requested resolution ${o.width}x${o.height} but got ${r}x${a}`)}}return r}catch(e){throw t?.trace(`${n}OnFailure`,e.name),e}};function mP(e){if(!e||typeof e!=`object`)return!1;if(`name`in e&&typeof e.name==`string`){let t=e.name;if([`OverconstrainedError`,`NotFoundError`].includes(t))return!0}return!!(`message`in e&&typeof e.message==`string`&&e.message.startsWith(`OverconstrainedError`))}var hP=async(e,t)=>{let n={audio:{...iP.audio,...e}};try{return await oP(t).prompt({throwOnNotAllowed:!0,forcePrompt:!0}),await pP(n,t)}catch(r){let i=JA.getLogger(`devices`);if(mP(r)&&e?.deviceId){let{deviceId:a,...o}=e;return i.warn(`Failed to get audio stream, will try again with relaxed constraints`,{error:r,constraints:n,relaxedConstraints:o}),hP(o,t)}throw i.error(`Failed to get audio stream`,{error:r,constraints:n}),r}},gP=async(e,t)=>{let n={video:{...aP.video,...e}};try{return await sP(t).prompt({throwOnNotAllowed:!0,forcePrompt:!0}),await pP(n,t)}catch(r){let i=JA.getLogger(`devices`);if(mP(r)&&e?.deviceId){let{deviceId:a,...o}=e;return i.warn(`Failed to get video stream, will try again with relaxed constraints`,{error:r,constraints:n,relaxedConstraints:o}),gP(o,t)}throw i.error(`Failed to get video stream`,{error:r,constraints:n}),r}},rae=0,iae=async(e,t)=>{let n=`navigator.mediaDevices.getDisplayMedia.${rae++}.`;try{let r={systemAudio:`include`,...e,video:typeof e?.video==`boolean`?e.video:{width:{max:2560},height:{max:1440},frameRate:{ideal:30},...e?.video},audio:typeof e?.audio==`boolean`?e.audio:{channelCount:{ideal:2},restrictOwnAudio:!0,echoCancellation:!1,autoGainControl:!1,noiseSuppression:!1,...e?.audio}};t?.trace(n,r);let i=await navigator.mediaDevices.getDisplayMedia(r);return t?.trace(`${n}OnSuccess`,nM(i)),i}catch(e){throw t?.trace(`${n}OnFailure`,e.name),JA.getLogger(`devices`).error(`Failed to get screen share stream`,e),e}},_P=typeof navigator<`u`&&navigator.mediaDevices!==void 0?cP().pipe(uO(void 0),tO(()=>navigator.mediaDevices.enumerateDevices()),lO(1)):void 0;function aae(e,t){if(e!==`default`)return e;let n=_P&&vj(_P);if(!n)return e;let r=n.find(t=>t.deviceId===e);if(!r)return e;let i=r.groupId,a=n.filter(e=>e.kind===t&&e.deviceId!==`default`&&e.groupId===i);return a.length===1?a[0].deviceId:e}var vP=()=>/Mobi/i.test(navigator.userAgent),yP=`default`,bP=()=>typeof window<`u`&&window.localStorage!==void 0,xP=e=>({storageKey:e?.storageKey??`@stream-io/device-preferences`,enabled:bP()&&!KA()?e?.enabled??!0:!1}),SP=(e,t,n=``)=>({deviceId:e,kind:t,label:n,groupId:``}),CP=e=>{try{let t=window.localStorage.getItem(e)||`{}`;return JSON.parse(t)}catch{return{}}},wP=(e,t,n,r)=>{if(!bP())return;let i=e?.deviceId??yP,a=e?.label??``,o=CP(r),s=[o[t]??[]].flat().filter(e=>e.selectedDeviceId!==i&&(e.selectedDeviceLabel===``||e.selectedDeviceLabel!==a)),c={...o,[t]:[{selectedDeviceId:i,selectedDeviceLabel:a,...typeof n==`boolean`?{muted:n}:{}},...s].slice(0,3)};try{window.localStorage.setItem(r,JSON.stringify(c))}catch(e){JA.getLogger(`DevicePersistence`).error(`failed to save device preferences`,e)}},TP=e=>e?[e].flat():[],EP=class{constructor(e,t,n,r){this.stopOnLeave=!0,this.subscriptions=[],this.currentStreamCleanups=[],this.areSubscriptionsSetUp=!1,this.isTrackStoppedDueToTrackEnd=!1,this.filters=[],this.virtualDevicesSubject=ne
466w fD([]),this.virtualDeviceConcurrencyTag=Symbol(`virtualDeviceConcurrencyTag`),this.statusChangeConcurrencyTag=Symbol(`statusChangeConcurrencyTag`),this.filterRegistrationConcurrencyTag=Symbol(`filterRegistrationConcurrencyTag`),this.dispose=()=>{this.runCurrentStreamCleanups(),this.subscriptions.forEach(e=>e()),this.subscriptions=[],this.areSubscriptionsSetUp=!1,this.virtualDevicesSubject.next([])},this.runCurrentStreamCleanups=()=>{this.currentStreamCleanups.forEach(e=>e()),this.currentStreamCleanups=[]},this.setLocalInterrupted=e=>{let t=this.call.state.localParticipant;t&&this.call.state.updateParticipant(t.sessionId,t=>{let n=t.interruptedTracks??[];return e===n.includes(this.trackType)?{}:{interruptedTracks:e?nN([...n],this.trackType):rN([...n],this.trackType)}})},this.call=e,this.state=t,this.trackType=n,this.devicePersistence=r,this.logger=JA.getLogger(`${U[n].toLowerCase()} manager`),this.setup()}setup(){this.areSubscriptionsSetUp||(this.areSubscriptionsSetUp=!0,_P&&!KA()&&(this.trackType===U.AUDIO||this.trackType===U.VIDEO)&&this.handleDisconnectedOrReplacedDevices(),this.devicePersistence.enabled&&this.subscriptions.push(Sj(zD([this.state.selectedDevice$,this.state.status$,this.state.browserPermissionState$]),([e,t,n])=>{!t||this.isTrackStoppedDueToTrackEnd&&t===`disabled`||n!==`granted`||this.persistPreference(e,t)})))}listDevices(){return zD([this.getDevices(),this.virtualDevicesSubject]).pipe(LD(([e,t])=>[...e,...t.map(e=>SP(e.deviceId,e.kind,e.label))]))}registerVirtualDevice(e){if(KA())throw Error(`Virtual devices are not supported on React Native.`);if(this.trackType!==U.AUDIO&&this.trackType!==U.VIDEO)throw Error(`Virtual devices are only supported for camera and microphone.`);let t=`stream-virtual:${zA()}`,n={deviceId:t,kind:this.mediaDeviceKind,...e};return yj(this.virtualDevicesSubject,e=>[...e,n]),{deviceId:n.deviceId,unregister:async()=>{await lj(this.virtualDeviceConcurrencyTag,async()=>{yj(this.virtualDevicesSubject,e=>e.filter(e=>e!==n)),this.activeVirtualSession?.deviceId===t&&await this.stopActiveVirtualSession()}),this.state.selectedDevice===t&&(await this.statusChangeSettled(),await this.disable({forceStop:!0}),await this.select(void 0))}}}sanitizeVirtualStream(e){return e.getTracks().forEach(e=>{let t=e.getSettings.bind(e);e.getSettings=()=>{let{deviceId:e,...n}=t();return n}}),e}findVirtualDevice(e){if(e)return vj(this.virtualDevicesSubject).find(t=>t.deviceId===e)}async stopActiveVirtualSession(){let e=this.activeVirtualSession;this.activeVirtualSession=void 0,await e?.stop?.()}async getSelectedStream(e){let t=this.state.selectedDevice;return t?.startsWith(`stream-virtual`)?lj(this.virtualDeviceConcurrencyTag,async()=>{let n=this.findVirtualDevice(t);if(!n)throw Error(`Virtual device is not registered: ${t}`);await this.stopActiveVirtualSession();let{stream:r,stop:i}=await n.getUserMedia(e);return this.activeVirtualSession={deviceId:t,stop:i},this.sanitizeVirtualStream(r)}):this.getStream(e)}get enabled(){return this.state.status===`enabled`}async enable(){this.state.prevStatus=this.state.optimisticStatus,this.state.optimisticStatus!==`enabled`&&(this.state.setPendingStatus(`enabled`),await uj(this.statusChangeConcurrencyTag,async e=>{try{await this.unmuteStream(),this.state.setStatus(`enabled`)}finally{e.aborted||this.state.setPendingStatus(this.state.status)}}))}async disable(e){let t=typeof e==`boolean`?e:e?.forceStop??!1;this.state.prevStatus=this.state.optimisticStatus,!(!t&&this.state.optimisticStatus===`disabled`)&&(this.state.setPendingStatus(`disabled`),await uj(this.statusChangeConcurrencyTag,async e=>{try{let e=t||this.state.disableMode===`stop-tracks`;await this.muteStream(e),this.state.setStatus(`disabled`)}finally{e.aborted||this.state.setPendingStatus(this.state.status)}}))}async statusChangeSettled(){await pj(this.statusChangeConcurrencyTag)}async resume(){this.state.prevStatus===`enabled`&&this.state.status!==`enabled`&&await this.enable()}async toggle(){return this.state.optimisticStatus===`enabled`?await this.disable():await this.enable()}registerFilter(e){let t={start:e,stop:void 0};return this.call.tracer.trace(`registerFilter.${U[this.trackType]}`,null),{registered:lj(this.filterRegistrationConcurrencyTag,async()=>{await pj(this.statusChangeConcurrencyTag),this.filters.push(t),await this.applySettingsToStream()}),unregister:()=>lj(this.filterRegistrationConcurrencyTag,async()=>{await pj(this.statusChangeConcurrencyTag),t.stop?.(),this.filters=this.filters.filter(e=>e!==t),await this.applySettingsToStream(),this.call.tracer.trace(`unregisterFilter.${U[this.trackType]}`,null)})}}setDefaultConstraints(e){this.state.setDefaultConstraints(e)}async select(e){if(KA())throw Error(`This method is not supported in React Native.`);let t=this.state.selectedDevice;if(e!==t)try{this.state.setDevice(e),await this.applySettingsToStream()}catch(e){throw this.state.setDevice(t),e}}async applySettingsToStream(){await uj(this.statusChangeConcurrencyTag,async e=>{if(this.enabled)try{if(await this.muteStream(),this.state.setStatus(`disabled`),e.aborted)return;await this.unmuteStream(),this.state.setStatus(`enabled`)}finally{e.aborted||this.state.setPendingStatus(this.state.status)}})}getResolvedConstraints(e){return e}publishStream(e,t){return this.call.publish(e,this.trackType,t)}stopPublishStream(){return this.call.stopPublish(this.trackType)}getTracks(){return this.state.mediaStream?.getTracks()??[]}async muteStream(e=!0){let t=this.state.mediaStream;t&&(this.logger.debug(`${e?`Stopping`:`Disabling`} stream`),this.call.state.callingState===W.JOINED&&await this.stopPublishStream(),this.muteLocalStream(e),this.getTracks().every(e=>e.readyState===`ended`)&&(await this.stopActiveVirtualSession(),typeof t.release==`function`&&t.release(),this.runCurrentStreamCleanups(),this.state.setMediaStream(void 0,void 0),this.setLocalInterrupted(!1),this.filters.forEac
466h(e=>e.stop?.())))}disableTracks(){this.getTracks().forEach(e=>{e.enabled&&=!1})}enableTracks(){this.getTracks().forEach(e=>{e.enabled||=!0})}stopTracks(){this.getTracks().forEach(e=>{e.readyState===`live`&&e.stop()})}muteLocalStream(e){this.state.mediaStream&&(e?this.stopTracks():this.disableTracks())}async unmuteStream(){this.logger.debug(`Starting stream`);let e,t;if(this.state.mediaStream&&this.getTracks().every(e=>e.readyState===`live`))e=this.state.mediaStream,this.enableTracks();else{this.runCurrentStreamCleanups();let n=this.state.defaultConstraints,r=this.getResolvedConstraints({...n,deviceId:this.state.selectedDevice?{exact:this.state.selectedDevice}:void 0}),i=e=>async t=>{if(!e)return t;let n=await e;return t.getTracks().forEach(e=>{let t=e.stop;e.stop=function(){t.call(e),n.getTracks().forEach(t=>{t.kind===e.kind&&t.stop()})}}),n.getTracks().forEach(e=>{let n=()=>{t.getTracks().forEach(t=>{e.kind===t.kind&&(t.stop(),t.dispatchEvent(new Event(`ended`)))})};e.addEventListener(`ended`,n),this.currentStreamCleanups.push(()=>{e.removeEventListener(`ended`,n)})}),t};t=this.getSelectedStream(r),e=await this.filters.reduce((e,t)=>e.then(e=>{let{stop:n,output:r}=t.start(e);return t.stop=n,r}).then(i(e),t=>(this.logger.warn(`Filter failed to start and will be ignored`,t),e)),t)}if(this.call.state.callingState===W.JOINED&&await this.publishStream(e),this.state.mediaStream!==e){let n=await t;if(this.state.setMediaStream(e,n),n){let e=async()=>{this.setLocalInterrupted(!1),await this.statusChangeSettled(),this.enabled&&(this.isTrackStoppedDueToTrackEnd=!0,setTimeout(()=>{this.isTrackStoppedDueToTrackEnd=!1},2e3),await this.disable())},t=e=>()=>{this.setLocalInterrupted(e),!e&&bM()&&document.visibilityState!==`hidden`&&this.call.refreshPublishedTrack(this.trackType).catch(e=>{this.logger.warn(`Failed to refresh track on system unmute`,e)}),(vP()||this.trackType==U.VIDEO)&&(this.call.tracer.trace(`navigator.mediaDevices.muteStateUpdated`,{trackType:U[this.trackType],muted:e}),this.call.notifyTrackMuteState(e,this.trackType).catch(e=>{this.logger.warn(`Error while notifying track mute state`,e)}))};n.getTracks().forEach(n=>{let r=t(!0),i=t(!1);n.addEventListener(`mute`,r),n.addEventListener(`unmute`,i),n.addEventListener(`ended`,e),this.currentStreamCleanups.push(()=>{n.removeEventListener(`mute`,r),n.removeEventListener(`unmute`,i),n.removeEventListener(`ended`,e)})});let r=n.getTracks().some(e=>e.muted);this.setLocalInterrupted(r)}else this.setLocalInterrupted(!1)}}get mediaDeviceKind(){if(this.trackType===U.AUDIO)return`audioinput`;if(this.trackType===U.VIDEO)return`videoinput`;throw Error(`Invalid track type`)}handleDisconnectedOrReplacedDevices(){this.subscriptions.push(Sj(zD([_P.pipe(oO()),this.state.selectedDevice$]),async([[e,t],n])=>{try{if(!n)return;await this.statusChangeSettled();let r=!1,i=!1,a=this.findDevice(t,n),o=this.findDevice(e,n);!a&&o?r=!0:a&&o&&a.deviceId===o.deviceId&&a.groupId!==o.groupId&&(i=!0),r&&(this.dispatchDeviceDisconnectedEvent(o),await this.disable(),await this.select(void 0)),i&&(this.isTrackStoppedDueToTrackEnd&&this.state.status===`disabled`?(await this.enable(),this.isTrackStoppedDueToTrackEnd=!1):fj(this.statusChangeConcurrencyTag)||await this.applySettingsToStream())}catch(e){this.logger.warn(`Unexpected error while handling disconnected or replaced device`,e)}}))}findDevice(e,t){let n=this.mediaDeviceKind;return e.find(e=>e.deviceId===t&&e.kind===n)}dispatchDeviceDisconnectedEvent(e){let t={type:`device.disconnected`,call_cid:this.call.cid,status:this.isTrackStoppedDueToTrackEnd?this.state.prevStatus:this.state.status,deviceId:e.deviceId,label:e.label,kind:e.kind};this.call.tracer.trace(`device.disconnected`,t),this.call.streamClient.dispatchEvent(t)}persistPreference(e,t){let n=this.mediaDeviceKind,r=n===`audioinput`?`microphone`:`camera`,i=t===`disabled`?!0:t===`enabled`?!1:void 0,{storageKey:a}=this.devicePersistence;if(!e){wP(void 0,r,i,a);return}let o=vj(this.listDevices())||[];wP(this.findDevice(o,e)??SP(e,n),r,i,a)}async applyPersistedPreferences(e){let t=this.trackType===U.AUDIO?`microphone`:`camera`,n=TP(CP(this.devicePersistence.storageKey)[t]);if(n.length===0)return!1;let r,i=!1,a=!1,o=await ID(this.listDevices());for(let e of n){if(r??=e.muted,e.selectedDeviceId===yP)break;
466let t=o.find(t=>t.deviceId===e.selectedDeviceId)??o.find(t=>t.label===e.selectedDeviceLabel);if(t){i=!0,this.state.selectedDevice||await this.select(t.deviceId),r=e.muted;break}}let s=this.call.permissionsContext.canPublish(this.trackType);return typeof r==`boolean`&&e&&s&&(await this.applyMutedState(r),a=!0),i||a}async applyMutedState(e){this.state.status===void 0&&(e?await this.disable():await this.enable())}},DP=class{constructor(e,t){this.statusSubject=new fD(void 0),this.optimisticStatusSubject=new fD(void 0),this.mediaStreamSubject=new fD(void 0),this.rootMediaStreamSubject=new fD(void 0),this.selectedDeviceSubject=new fD(void 0),this.defaultConstraintsSubject=new fD(void 0),this.mediaStream$=this.mediaStreamSubject.asObservable(),this.rootMediaStream$=this.rootMediaStreamSubject.asObservable(),this.selectedDevice$=this.selectedDeviceSubject.asObservable().pipe(rO()),this.status$=this.statusSubject.asObservable().pipe(rO()),this.optimisticStatus$=this.optimisticStatusSubject.asObservable().pipe(rO()),this.defaultConstraints$=this.defaultConstraintsSubject.asObservable(),this.disableMode=e,this.hasBrowserPermission$=t?t.asObservable().pipe(lO(1)):FD(!0),this.browserPermissionState$=t?t.asStateObservable().pipe(lO(1)):FD(`prompt`),this.isPromptingPermission$=t?t.getIsPromptingObservable().pipe(lO(1)):FD(!1)}get status(){return vj(this.status$)}get optimisticStatus(){return vj(this.optimisticStatus$)}get selectedDevice(){return vj(this.selectedDevice$)}get mediaStream(){return vj(this.mediaStream$)}get rootMediaStream(){return vj(this.rootMediaStream$)}setStatus(e){yj(this.statusSubject,e)}setPendingStatus(e){yj(this.optimisticStatusSubject,e)}setMediaStream(e,t){if(yj(this.mediaStreamSubject,e),yj(this.rootMediaStreamSubject,t),t){let e=this.getDeviceIdFromStream(t);e&&this.setDevice(e)}}setDevice(e){yj(this.selectedDeviceSubject,e)}get defaultConstraints(){return vj(this.defaultConstraints$)}setDefaultConstraints(e){yj(this.defaultConstraintsSubject,e)}},oae=class extends DP{constructor(e){super(`stop-tracks`,sP(e)),this.directionSubject=ne
466w fD(void 0),this.direction$=this.directionSubject.asObservable().pipe(rO())}get direction(){return vj(this.direction$)}setDirection(e){yj(this.directionSubject,e)}setMediaStream(e,t){if(super.setMediaStream(e,t),e){let t=KA()?this.direction:e.getVideoTracks()[0]?.getSettings().facingMode===`environment`?`back`:`front`;this.setDirection(t)}}getDeviceIdFromStream(e){let[t]=e.getVideoTracks();return t?.getSettings().deviceId}},sae=class extends EP{constructor(e,t){super(e,new oae(e.tracer),U.VIDEO,t),this.targetResolution={width:1280,height:720}}isDirectionSupportedByDevice(){return KA()||vP()}async selectDirection(e,t={}){if(!this.isDirectionSupportedByDevice()){this.logger.warn(`Setting direction is not supported on this device`);return}KA()&&await this.getTracks()[0]?.applyConstraints({facingMode:e===`front`?`user`:`environment`}),this.state.setDirection(e),this.state.setDevice(void 0);let{enableCamera:n=!0}=t;if(!(KA()||!n)){this.getTracks().forEach(e=>e.stop());try{await this.unmuteStream()}catch(e){throw e instanceof Error&&e.name===`NotReadableError`&&(await this.muteStream(),await this.unmuteStream()),e}}}async flip(){let e=this.state.direction===`front`?`back`:`front`;await this.selectDirection(e)}async selectTargetResolution(e){let{width:t,height:n}=e;if(t<n&&([t,n]=[n,t]),this.targetResolution.height=n,this.targetResolution.width=t,this.state.optimisticStatus===`enabled`)try{await this.statusChangeSettled()}catch(e){this.logger.warn(`could not apply target resolution`,e)}if(this.enabled&&this.state.mediaStream){let[e]=this.state.mediaStream.getVideoTracks();if(!e)return;let{width:r,height:i}=e.getSettings();(r!==t||i!==n)&&(await this.applySettingsToStream(),this.logger.debug(`${t}x${n} target resolution applied to media stream`))}}async apply(e,t){await this.statusChangeSettled(),await this.selectTargetResolution(e.target_resolution);let n=e.enabled??!0,r=this.state.status===void 0&&this.state.optimisticStatus===void 0,i=!1,a=await ID(this.state.browserPermissionState$);r&&this.devicePersistence.enabled&&a===`granted`&&(i=await this.applyPersistedPreferences(n));let o=this.call.permissionsContext.canPublish(this.trackType);if(r&&!i){if(!this.state.direction&&!this.state.selectedDevice){let t=e.camera_facing===`front`?`front`:`back`;await this.selectDirection(t,{enableCamera:!1})}o&&e.camera_default_on&&n&&await this.enable()}let{mediaStream:s}=this.state;o&&t&&this.enabled&&s&&await this.publishStream(s)}getDevices(){return uP(this.call.tracer)}getResolvedConstraints(e){return e.width=this.targetResolution.width,e.height=this.targetResolution.height,!e.deviceId&&this.state.direction&&this.isDirectionSupportedByDevice()&&(e.facingMode=this.state.direction===`front`?`user`:`environment`),e}getStream(e){return gP(e,this.call.tracer)}},OP=class extends EP{async setAudioBitrateProfile(e){if(!this.call.state.settings?.audio.hifi_audio_enabled)throw Error(`High Fidelity audio is not enabled for this call`);this.doSetAudioBitrateProfile(e),this.state.setAudioBitrateProfile(e),this.enabled&&await this.applySettingsToStream()}publishStream(e,t){return super.publishStream(e,{audioBitrateProfile:this.state.audioBitrateProfile,...t})}},kP=e=>{let t=e===jO.MUSIC_HIGH_QUALITY;return{echoCancellation:!t,noiseSuppression:!t,autoGainControl:!t,channelCount:{ideal:t?2:1}}},AP=class extends DP{constructor(e,t,n){super(e,t),this.audioBitrateProfileSubject=new fD(n),this.audioBitrateProfile$=this.audioBitrateProfileSubject.asObservable().pipe(rO())}get audioBitrateProfile(){return vj(this.audioBitrateProfile$)}setAudioBitrateProfile(e){yj(this.audioBitrateProfileSubject,e)}},cae=class extends AP{constructor(e,t){super(e,oP(t),jO.VOICE_STANDARD_UNSPECIFIED),this.speakingWhileMutedSubject=ne
466w fD(!1),this.speakingWhileMuted$=this.speakingWhileMutedSubject.asObservable().pipe(rO())}get speakingWhileMuted(){return vj(this.speakingWhileMuted$)}setSpeakingWhileMuted(e){yj(this.speakingWhileMutedSubject,e)}getDeviceIdFromStream(e){let[t]=e.getAudioTracks(),n=t?.getSettings().deviceId;return aae(n,`audioinput`)}},jP=(e,t,n={})=>{let{detectionFrequencyInMs:r=500,audioLevelThreshold:i=150,fftSize:a=128,destroyStreamOnStop:o=!0}=n,s=new AudioContext,c=s.createAnalyser();c.fftSize=a;let l=s.createMediaStreamSource(e);l.connect(c);let u=setInterval(()=>{let n=new Uint8Array(c.frequencyBinCount);c.getByteFrequencyData(n);let r=n.some(e=>e>=i),a=n.reduce((e,t)=>e+t,0)/n.length,o=a>i?100:Math.round(a/i*100);e.getAudioTracks()[0]?.enabled?t({isSoundDetected:r,audioLevel:o}):t({isSoundDetected:!1,audioLevel:0})},r);return async function(){clearInterval(u),l.disconnect(),c.disconnect(),s.state!==`closed`&&await s.close(),o&&e.getTracks().forEach(t=>{t.stop(),e.removeTrack(t)})}},lae=e=>{let t=new Uint8Array(e.fftSize);e.getByteTimeDomainData(t);let n=0;for(let e of t){let t=e-128,r=Math.abs(t)<=1?0:t;n+=r*r}return Math.sqrt(n/t.length)>0},MP=e=>({shouldEmit:!1,nextState:e}),NP=(e,t)=>({shouldEmit:!0,nextState:t,capturesAudio:e}),uae=(e,t,n)=>{if(t)return NP(!0,{kind:`IDLE`});let{noAudioThresholdMs:r,emitIntervalMs:i}=n,a=Date.now();switch(e.kind){case`IDLE`:return MP({kind:`DETECTING`,noAudioStartTime:a});case`DETECTING`:{let{noAudioStartTime:t}=e;return a-t>=r?NP(!1,{kind:`EMITTING`,noAudioStartTime:t,lastEmitTime:a}):MP(e)}case`EMITTING`:return a-e.lastEmitTime>=i?NP(!1,{...e,lastEmitTime:a}):MP(e)}},dae=(e,t)=>{let n=new AudioContext,r=n.createAnalyser();return r.fftSize=t,n.createMediaStreamSource(e).connect(r),{audioContext:n,analyser:r}},PP=(e,t)=>{let{detectionFrequencyInMs:n=350,fftSize:r=512,onCaptureStatusChange:i}=t,a={kind:`IDLE`},{audioContext:o,analyser:s}=dae(e,r),c=setInterval(()=>{let[n]=e.getAudioTracks();if(n&&!n.enabled){a={kind:`IDLE`};return}let r=n?.readyState===`live`&&lae(s),o=uae(a,r,t);if(a=o.nextState,!o.shouldEmit)return;let{capturesAudio:c}=o;i(c),c&&l().catch(e=>{JA.getLogger(`NoAudioDetector`).error(`Error stopping no-audio detector`,e)})},n);async function l(){clearInterval(c),o.state!==`closed`&&await o.close()}return l},fae=class extends OP{constructor(e,t,n=`stop-tracks`){super(e,new cae(n,e.tracer),U.AUDIO,t),this.speakingWhileMutedNotificationEnabled=!0,this.soundDetectorConcurrencyTag=Symbol(`soundDetectorConcurrencyTag`),this.silenceThresholdMs=5e3}setup(){if(!this.areSubscriptionsSetUp&&(super.setup(),this.subscriptions.push(Cj(zD([this.call.state.callingState$,this.call.state.ownCapabilities$,this.state.selectedDevice$,this.state.status$,this.state.browserPermissionState$]),async([e,t,n,r,i])=>{try{if(e===W.LEFT&&await this.stopSpeakingWhileMutedDetection(),e!==W.JOINED||!this.speakingWhileMutedNotificationEnabled)return;t.includes(bO.SEND_AUDIO)&&await this.hasPermission(i)&&r!==`enabled`?await this.startSpeakingWhileMutedDetection(n):await this.stopSpeakingWhileMutedDetection()}catch(e){this.logger.warn(`Could not enable speaking while muted`,e)}})),this.subscriptions.push(Sj(this.call.state.callingState$,e=>{!this.noiseCancellationRegistration||!this.noiseCancellation||(this.call.state.settings?.audio.noise_cancellation?.mode===yO.AUTO_ON&&e===W.JOINED?this.noiseCancellationRegistration.then(()=>this.noiseCancellation?.canAutoEnable?this.noiseCancellation.canAutoEnable():!0).then(e=>{e&&this.noiseCancellation?.enable().catch(e=>{this.logger.warn(`Failed to enable noise cancellation`,e)})}).catch(e=>(this.logger.warn(`Failed to enable noise cancellation`,e),this.call.notifyNoiseCancellationStopped())):e===W.LEFT&&this.noiseCancellationRegistration.then(()=>this.noiseCancellation?.disable()).catch(e=>{this.logger.warn(`Failed to disable noise cancellation`,e)}))})),!KA())){let e=Cj(zD([this.state.status$,this.state.mediaStream$]),async([e,t])=>{if(this.noAudioDetectorCleanup){let e=this.noAudioDetectorCleanup;this.noAudioDetectorCleanup=void 0,await e().catch(e=>{this.logger.warn(`Failed to stop no-audio detector`,e)})}if(e!==`enabled`||!t||this.silenceThresholdMs<=0)return;let n=this.state.selectedDevice,r=(await ID(this.listDevices())).find(e=>e.deviceId===n)?.label,i;this.noAudioDetectorCleanup=PP(t,{noAudioThresholdMs:this.silenceThresholdMs,emitIntervalMs:this.silenceThresholdMs,onCaptureStatusChange:e=>{let t={type:`mic.capture_report`,call_cid:this.call.cid,capturesAudio:e,deviceId:n,label:r};e!==i&&(i=e,this.call.tracer.trace(`mic.capture_report`,t)),this.call.streamClient.dispatchEvent(t)}})});this.subscriptions.push(e)}}async enableNoiseCancellation(e){let{ownCapabilities:t,settings:n}=this.call.state;if(!t.includes(bO.ENABLE_NOISE_CANCELLATION))throw Error(`Noise cancellation is not available.`);let r=n?.audio.noise_cancellation;if(!r||r.mode===yO.DISABLED)throw Error(`Noise cancellation is disabled for this call type.`);try{if(this.noiseCancellation=e,this.noiseCancellationChangeUnsubscribe=this.noiseCancellation.on(`change`,e=>{this.call.tracer.trace(`noiseCancellation.enabled`,e),e?this.call.notifyNoiseCancellationStarting().catch(e=>{this.logger.warn(`notifyNoiseCancellationStart failed`,e)}):this.call.notifyNoiseCancellationStopped().catch(e=>{this.logger.warn(`notifyNoiseCancellationStop failed`,e)})}
466),KA())this.noiseCancellationRegistration=Promise.resolve();else{let t=this.registerFilter(e.toFilter());this.noiseCancellationRegistration=t.registered,this.unregisterNoiseCancellation=t.unregister,await this.noiseCancellationRegistration}if(r.mode===yO.AUTO_ON&&this.call.state.callingState===W.JOINED){let t=!0;e.canAutoEnable&&(t=await e.canAutoEnable()),t&&e.enable().catch(e=>{this.logger.warn(`Failed to enable noise cancellation`,e)})}}catch(e){throw this.logger.warn(`Failed to enable noise cancellation`,e),await this.disableNoiseCancellation().catch(e=>{this.logger.warn(`Failed to disable noise cancellation`,e)}),e}}async disableNoiseCancellation(){await(this.unregisterNoiseCancellation?.()??Promise.resolve()).then(()=>this.noiseCancellation?.disable()).then(()=>this.noiseCancellationChangeUnsubscribe?.()).catch(e=>{this.logger.warn(`Failed to unregister noise cancellation`,e)}),this.call.tracer.trace(`noiseCancellation.disabled`,!0),await this.call.notifyNoiseCancellationStopped()}async enableSpeakingWhileMutedNotification(){this.speakingWhileMutedNotificationEnabled=!0,this.state.status===`disabled`&&await this.startSpeakingWhileMutedDetection(this.state.selectedDevice)}async disableSpeakingWhileMutedNotification(){this.speakingWhileMutedNotificationEnabled=!1,await this.stopSpeakingWhileMutedDetection()}setSilenceThreshold(e){this.silenceThresholdMs=e}async performTest(e,t){if(KA())throw Error(`Not available in React Native`);
466let n=await this.getStream({deviceId:{exact:e}}),{testDurationMs:r=3e3}=t||{},{promise:i,resolve:a}=cN(),o=PP(n,{noAudioThresholdMs:r,emitIntervalMs:r,onCaptureStatusChange:async e=>{a(e),await o().catch(e=>{this.logger.warn(`Failed to stop detector during test`,e)}),$N(n)}});return i}async apply(e,t){await this.statusChangeSettled();let n=this.state.status===void 0&&this.state.optimisticStatus===void 0,r=!1,i=await ID(this.state.browserPermissionState$);n&&this.devicePersistence.enabled&&i===`granted`&&(r=await this.applyPersistedPreferences(!0));let a=this.call.permissionsContext.canPublish(this.trackType);n&&!r&&a&&e.mic_default_on&&await this.enable();let{mediaStream:o}=this.state;a&&t&&this.enabled&&o&&await this.publishStream(o)}getDevices(){return lP(this.call.tracer)}getStream(e){return hP(e,this.call.tracer)}doSetAudioBitrateProfile(e){this.setDefaultConstraints({...this.state.defaultConstraints,...kP(e)}),this.noiseCancellation&&(e===jO.MUSIC_HIGH_QUALITY?this.noiseCancellation.disable().catch(e=>{this.logger.warn(`Failed to disable noise cancellation for music mode`,e)}):this.noiseCancellation.enable().catch(e=>{this.logger.warn(`Failed to enable noise cancellation`,e)}))}async startSpeakingWhileMutedDetection(e){await lj(this.soundDetectorConcurrencyTag,async()=>{if(!(this.soundDetectorCleanup&&this.soundDetectorDeviceId===e)){if(await this.teardownSpeakingWhileMutedDetection(),KA()){let e=globalThis.streamRNVideoSDK?.nativeEvents?.speechActivity;if(!e){this.logger.warn(`Native speech activity not available, make sure the "@stream-io/react-native-webrtc" peer dependency version is satisfied`);return}let t=e.subscribe(e=>{this.state.setSpeakingWhileMuted(e.isSoundDetected)});this.soundDetectorCleanup=async()=>{t()}}
466else{let t=await this.getStream({...this.state.defaultConstraints,deviceId:{exact:e}});this.soundDetectorCleanup=jP(t,e=>{this.state.setSpeakingWhileMuted(e.isSoundDetected)})}this.soundDetectorDeviceId=e}})}async stopSpeakingWhileMutedDetection(){await lj(this.soundDetectorConcurrencyTag,async()=>this.teardownSpeakingWhileMutedDetection())}async teardownSpeakingWhileMutedDetection(){let e=this.soundDetectorCleanup;this.soundDetectorCleanup=void 0,this.soundDetectorDeviceId=void 0,this.state.setSpeakingWhileMuted(!1),e&&await e().catch(e=>{this.logger.warn(`Failed to stop speaking while muted detector`,e)})}async hasPermission(e){if(!KA())return e===`granted`;let t=globalThis.streamRNVideoSDK?.permissions;if(!t)return!0;try{return await t.check(`microphone`)}catch(e){return this.logger.warn(`Failed to check permission`,e),!1}}},pae=class extends AP{constructor(){super(`stop-tracks`,void 0,jO.MUSIC_HIGH_QUALITY),this.audioEnabledSubject=new fD(!0),this.settingsSubject=new fD(void 0),this.audioEnabled$=this.audioEnabledSubject.asObservable().pipe(rO()),this.settings$=this.settingsSubject.asObservable(),this.getDeviceIdFromStream=e=>{let[t]=e.getTracks();return t?.getSettings().deviceId}}get audioEnabled(){return vj(this.audioEnabled$)}setAudioEnabled(e){yj(this.audioEnabledSubject,e)}get settings(){return vj(this.settings$)}setSettings(e){yj(this.settingsSubject,e)}},mae=class extends OP{constructor(e){super(e,new pae,U.SCREEN_SHARE,xP({enabled:!1}))}setup(){this.areSubscriptionsSetUp||(super.setup(),this.subscriptions.push(Sj(this.call.state.settings$,e=>{let t=e?.screensharing.target_resolution;t&&this.setDefaultConstraints({...this.state.defaultConstraints,video:{width:t.width,height:t.height}})})))}enableScreenShareAudio(){this.state.setAudioEnabled(!0)}async disableScreenShareAudio(){this.state.setAudioEnabled(!1),this.call.publisher?.isPublishing(U.SCREEN_SHARE_AUDIO)&&await this.call.stopPublish(U.SCREEN_SHARE_AUDIO)}getSettings(){return this.state.settings}setSettings(e){this.state.setSettings(e)}getDevices(){return FD([])}async getStream(e){this.state.audioEnabled||(e.audio=!1);let t=await iae(e,this.call.tracer),[n]=t.getVideoTracks(),{contentHint:r}=this.state.settings||{};return r!==void 0&&n&&`contentHint`in n&&(this.call.tracer.trace(`navigator.mediaDevices.getDisplayMedia.contentHint`,r),n.contentHint=r),t}doSetAudioBitrateProfile(e){let{defaultConstraints:t}=this.state,n=typeof t?.audio==`boolean`?null:t?.audio;this.setDefaultConstraints({...t,audio:{...n,...kP(e)}})}async stopPublishStream(){return this.call.stopPublish(U.SCREEN_SHARE,U.SCREEN_SHARE_AUDIO)}async select(){throw Error(`Not supported`)}},hae=class{constructor(e){this.tracer=e,this.selectedDeviceSubject=new fD(``),this.volumeSubject=new fD(1),this.isDeviceSelectionSupported=rP(),this.selectedDevice$=this.selectedDeviceSubject.asObservable().pipe(rO()),this.volume$=this.volumeSubject.asObservable().pipe(rO())}get selectedDevice(){return vj(this.selectedDevice$)}get volume(){return vj(this.volume$)}setDevice(e){yj(this.selectedDeviceSubject,e),this.tracer.trace(`navigator.mediaDevices.setSinkId`,e)}setVolume(e){yj(this.volumeSubject,e)}},gae=class{constructor(e,t){this.subscriptions=[],this.areSubscriptionsSetUp=!1,this.dispose=()=>{this.subscriptions.forEach(e=>e()),this.subscriptions=[],this.areSubscriptionsSetUp=!1},this.call=e,this.state=new hae(e.tracer),this.devicePersistence=t,this.setup()}apply(e){return KA()?this.applyRN(e):this.applyWeb()}applyWeb(){let{enabled:e,storageKey:t}=this.devicePersistence;if(!e)return;let n=TP(CP(t).speaker);if(n.length===0)return;let r=n[0],i=r.selectedDeviceId===yP?``:r.selectedDeviceId;this.state.selectedDevice!==i&&this.select(i)}applyRN(e){let t=e.video.camera_default_on||e.audio.speaker_default_on||e.audio.default_device===vO.SPEAKER?vO.SPEAKER:vO.EARPIECE;this.defaultDevice!==t&&(this.call.logger.debug(`SpeakerManager: setting default device`,{defaultDevice:t}),this.defaultDevice=t,globalThis.streamRNVideoSDK?.callManager.setup({defaultDevice:t,isRingingTypeCall:this.call.ringing}))}setup(){this.areSubscriptionsSetUp||(this.areSubscriptionsSetUp=!0,_P&&!KA()&&this.subscriptions.push(Sj(zD([_P,this.state.selectedDevice$]),([e,t])=>{t&&(e.find(e=>e.deviceId===t&&e.kind===`audiooutput`)||this.select(``))})),!KA()&&this.devicePersistence.enabled&&this.subscriptions.push(Sj(zD([this.state.selectedDevice$,oP(this.call.tracer).asStateObservable()]),([e,t])=>{!e||t!==`granted`||this.persistSpeakerDevicePreference(e)})))}listDevices(){return FP(),dP(this.call.tracer)}select(e){FP(),this.state.setDevice(e)}setVolume(e){if(FP(),e&&(e<0||e>1))throw Error(`Volume must be between 0 and 1`);this.state.setVolume(e)}setParticipantVolume(e,t){if(t&&(t<0||t>1))throw Error(`Volume must be between 0 and 1, or undefined`);this.call.state.updateParticipant(e,e=>{if(KA()&&e.audioStream)for(let n of e.audioStream.getAudioTracks())n?._setVolume(t);return{audioVolume:t}})}persistSpeakerDevicePreference(e){let{storageKey:t}=this.devicePersistence;wP((vj(this.listDevices())||[]).find(t=>t.deviceId===e)??SP(e,`audiooutput`),`speaker`,void 0,t)}},FP=()=>{if(KA())throw Error(`Unsupported in React Native. See: https://getstream.io/video/docs/react-native/guides/camera-and-microphone/#speaker-management`)},IP=class{constructor({type:e,id:t,streamClient:n,members:r,ownCapabilities:i,sortParticipantsBy:a,clientStore:o,ringing:s=!1,watching:c=!1}){this.state=new eM,this.permissionsContext=new YN,this.tracer=new LM(null),this.dispatcher=new aj,this.statsReportingIntervalInMs=2e3,this.sfuClientTag=0,this.reconnectConcurrencyTag=Symbol(`reconnectConcurrencyTag`),this.reconnectAttempts=0,this.reconnectStrategy=LO.UNSPECIFIED,this.reconnectReason=``,this.fastReconnectDeadlineSeconds=0,this.disconnectionTimeoutSeconds=0,this.lastOfflineTimestamp=0,this.rejoinRateLimiter=new QN(10,12e4),this.maxIceFailuresWithoutConnect=2,this.iceFailuresWithoutConnect=0,this.maxConsecutiveNegotiationFailures=3,this.consecutiveNegotiationFailures=0,this.trackPublishOrder=[],this.hasJoinedOnce=!1,this.deviceSettingsAppliedOnce=!1,this.initialized=!1,this.acceptRejectConcurrencyTag=Symbol(`acceptRejectTag`),this.joinLeaveConcurrencyTag=Symbol(`joinLeaveConcurrencyTag`),this.leaveCallHooks=new Set,this.streamClientEventHandlers=new Map,this.clientCapabilities=new Set([BO.SUBSCRIBER_VIDEO_PAUSE]),this.setup=async()=>{await lj(this.joinLeaveConcurrencyTag,async()=>{this.initialized||=(this.leaveCallHooks.add(this.on(`all`,e=>{this.state.updateFromEvent(e)})),this.leaveCallHooks.add(this.on(`changePublishOptions`,e=>{this.currentPublishOptions=e.publishOptions})),this.leaveCallHooks.add(LN(this,this.dispatcher)),this.registerEffects(),this.registerReconnectHandlers(),this.camera.setup(),this.microphone.setup(),this.screenShare.setup(),this.speaker.setup(),this.state.callingState===W.LEFT&&this.state.setCallingState(W.IDLE),!0)})},this.registerEffects=()=>{this.leaveCallHooks.add(Sj(this.state.settings$,e=>{e&&this.permissionsContext.setCallSettings(e)})),this.leaveCallHooks.add(Cj(this.state.ownCapabilities$,this.handleOwnCapabilitiesUpdated)),this.leaveCallHooks.add(Sj(this.state.blockedUserIds$,async e=>{if(!e||e.length===0)return;let t=this.currentUserId;t&&e.includes(t)&&(this.logger.info(`Leaving call because of being blocked`),globalThis.streamRNVideoSDK?.callingX?.endCall(this,`restricted`),await this.leave({message:`user blocked`}).catch(e=>{this.logger.error(`Error leaving call after being blocked`,e)}))}
466)),this.ringing?this.handleRingingCall():this.leaveCallHooks.add(Sj(this.ringingSubject,e=>{e&&this.handleRingingCall()})),this.leaveCallHooks.add(Sj(this.state.session$,e=>{if(!this.ringing)return;let t=this.clientStore.connectedUser?.id;if(!t)return;let n=!!e?.accepted_by[t],r=!!e?.rejected_by[t];(n||r)&&this.cancelAutoDrop();let i=n&&this.state.callingState===W.RINGING;(i||r)&&!fj(this.joinLeaveConcurrencyTag)&&(globalThis.streamRNVideoSDK?.callingX?.endCall(this,i?`answeredElsewhere`:`rejected`),this.leave().catch(()=>{this.logger.error(`Could not leave a call that was accepted or rejected elsewhere`)}))}))},this.handleRingingCall=()=>{let e=this.state.session,t=this.clientStore.connectedUser?.id,n=e?.ended_at,r=this.state.createdBy?.id;this.currentUserId&&r===this.currentUserId&&globalThis.streamRNVideoSDK?.callingX?.registerOutgoingCall(this);let i=e?.rejected_by,a=e?.accepted_by,o=!1;n?o=!0:r&&i?i[r]&&(o=!0):t&&i?i[t]&&(o=!0):t&&a&&a[t]&&(o=!0),o?this.state.callingState!==W.IDLE&&this.state.setCallingState(W.IDLE):(this.state.callingState===W.IDLE&&this.state.setCallingState(W.RINGING),this.scheduleAutoDrop(),this.leaveCallHooks.add(RN(this)))},this.handleOwnCapabilitiesUpdated=async e=>{if(this.permissionsContext.setPermissions(e),!this.publisher)return;let t={[bO.SEND_AUDIO]:U.AUDIO,[bO.SEND_VIDEO]:U.VIDEO,[bO.SCREENSHARE]:U.SCREEN_SHARE};for(let[e,n]of Object.entries(t))if(!this.permissionsContext.hasPermission(e))try{switch(n){case U.AUDIO:this.microphone.enabled&&await this.microphone.disable();break;case U.VIDEO:this.camera.enabled&&await this.camera.disable();break;case U.SCREEN_SHARE:this.screenShare.enabled&&await this.screenShare.disable();break}}catch(e){this.logger.error(`Can't disable mic/camera/screenshare after revoked permissions`,e)}},this.on=(e,t)=>{if(ij(e))return this.dispatcher.on(e,`*`,t);let n=this.streamClient.on(e,e=>{let n=e;n.call_cid&&n.call_cid===this.cid&&t(n)});return this.streamClientEventHandlers.set(t,n),()=>{this.off(e,t)}},this.off=(e,t)=>{if(ij(e))return this.dispatcher.off(e,`*`,t);let n=this.streamClientEventHandlers.get(t);n&&n()},this.leave=async({reject:e,reason:t,message:n}={})=>{if(this.state.callingState===W.LEFT)throw Error(`Cannot leave call that has already been left.`);await lj(this.joinLeaveConcurrencyTag,async()=>{let r=this.state.callingState;if(r===W.LEFT)return;if(r===W.JOINING&&await new Promise(e=>{this.state.callingState$.pipe(dO(e=>e!==W.JOINED,!0)).subscribe(()=>e())}),r===W.RINGING&&e!==!1)if(e){let e={timeout:`missed`,cancel:`canceled`,busy:`busy`,decline:`rejected`},n=t??`decline`,r=e[n]??`rejected`;await this.reject(n),globalThis.streamRNVideoSDK?.callingX?.endCall(this,r)}else{let e=this.state.remoteParticipants.length>0;this.isCreatedByMe&&!e&&(await this.reject(`cancel`),globalThis.streamRNVideoSDK?.callingX?.endCall(this,`canceled`))}globalThis.streamRNVideoSDK?.callingX?.endCall(this),this.statsReporter?.stop(),this.statsReporter=void 0;let i=n??t??`user is leaving the call`;this.tracer.trace(`call.leaveReason`,i),this.sfuStatsReporter?.flush(),this.sfuStatsReporter?.stop(),this.sfuStatsReporter=void 0,this.lastStatsOptions=void 0,await this.subscriber?.dispose(),this.subscriber=void 0,await this.publisher?.dispose(),this.publisher=void 0,await this.sfuClient?.leaveAndClose(i),this.sfuClient=void 0,this.trackSubscriptionManager.setSfuClient(void 0),this.trackSubscriptionManager.dispose(),this.audioBindingsWatchdog?.dispose(),await this.dynascaleManager?.dispose(),this.state.setCallingState(W.LEFT),this.state.setParticipants([]),this.state.dispose(),this.rejoinRateLimiter.reset(),this.iceFailuresWithoutConnect=0,this.consecutiveNegotiationFailures=0,this.reconnectStrategy=LO.UNSPECIFIED,this.reconnectReason=``,this.reconnectAttempts=0,this.leaveCallHooks.forEach(e=>e()),this.initialized=!1,this.hasJoinedOnce=!1,this.unifiedSessionId=void 0,this.ringingSubject.next(!1),this.cancelAutoDrop(),this.clientStore.unregisterCall(this),globalThis.streamRNVideoSDK?.callManager.stop({isRingingTypeCall:this.ringing}),this.camera.dispose(),this.microphone.dispose(),this.screenShare.dispose(),this.speaker.dispose(),this.deviceSettingsAppliedOnce=!1;let a=[];this.camera.stopOnLeave&&a.push(this.camera.disable(!0)),this.microphone.stopOnLeave&&a.push(this.microphone.disable(!0)),this.screenShare.stopOnLeave&&a.push(this.screenShare.disable(!0)),await Promise.all(a)})},this.updateFromRingingEvent=async e=>{await this.setup();let{created_by:t,settings:n}=e.call,r=this.state.members.find(e=>e.user.id===t.id);r?this.state.setMembers([r,...e.members]):this.state.setMembers(e.members),this.state.updateFromCallResponse(e.call),this.watching=!0,this.ringingSubject.next(!0);let i=this.clientStore.calls.filter(e=>e.cid!==this.cid);this.clientStore.setCalls([this,...i]);let a=KA();await this.applyDeviceConfig(n,!1,a)},this.get=async e=>{await this.setup();let t=await this.streamClient.get(this.streamClientBasePath,e);this.state.updateFromCallResponse(t.call),this.state.setMembers(t.members),this.state.setOwnCapabilities(t.own_capabilities),e?.ring&&this.ringingSubject.next(!0),this.streamClient._hasConnectionID()&&(this.watching=!0,this.clientStore.registerOrUpd
466ateCall(this));let n=KA()?e?.ring===!0?!0:this.ringing:!1;return await this.applyDeviceConfig(t.call.settings,!1,n),t},this.getOrCreate=async e=>{await this.setup();let t=await this.streamClient.post(this.streamClientBasePath,e);this.state.updateFromCallResponse(t.call),this.state.setMembers(t.members),this.state.setOwnCapabilities(t.own_capabilities),e?.ring&&this.ringingSubject.next(!0),this.streamClient._hasConnectionID()&&(this.watching=!0,this.clientStore.registerOrUpdateCall(this));let n=KA()?e?.ring===!0?!0:this.ringing:!1;return await this.applyDeviceConfig(t.call.settings,!1,n),t},this.create=async e=>this.getOrCreate(e),this.delete=async(e={})=>this.streamClient.post(`${this.streamClientBasePath}/delete`,e),this.ring=async(e={})=>this.streamClient.post(`${this.streamClientBasePath}/ring`,e),this.notify=async()=>await this.get({notify:!0}),this.accept=async()=>lj(this.acceptRejectConcurrencyTag,()=>(this.tracer.trace(`call.accept`,``),this.streamClient.post(`${this.streamClientBasePath}/accept`))),this.reject=async(e=`decline`)=>lj(this.acceptRejectConcurrencyTag,()=>(this.tracer.trace(`call.reject`,e),this.streamClient.post(`${this.streamClientBasePath}/reject`,{reason:e}))),this.join=async({maxJoinRetries:e=3,joinResponseTimeout:t,rpcRequestTimeout:n,...r}={})=>{let i=this.state.callingState;if([W.JOINED,W.JOINING].includes(i))throw Error(`Illegal State: call.join() shall be called only once`);r?.ring&&this.ringingSubject.next(!0);let a=globalThis.streamRNVideoSDK?.callingX;a&&await a.joinCall(this,this.clientStore.calls),await this.setup(),this.joinResponseTimeout=t,this.rpcRequestTimeout=n;let o=new Map,s=r;e=Math.max(e,1);try{for(let t=0;t<e;t++){try{this.logger.trace(`Joining call (${t})`,this.cid),await this.doJoin(r),delete s.migrating_from,delete s.migrating_from_list;break}catch(n){if(this.logger.warn(`Failed to join call (${t})`,this.cid),n instanceof xO&&n.unrecoverable||n instanceof mN&&n.unrecoverable)throw n;let r=n instanceof mN&&mN.isJoinErrorCode(n.errorEvent),i=this.credentials?.server.edge_name||``,a=(o.get(i)||0)+1;if(o.set(i,a),(r||a>=2)&&(s.migrating_from=i,s.migrating_from_list=Array.from(o.keys())),t===e-1)throw n}await NA(LA(t))}}catch(e){throw a?.endCall(this,`error`),e}},this.doJoin=async e=>{let t=Date.now(),n=this.state.callingState;this.joinCallData=e,this.logger.debug(`Starting join flow`),this.state.setCallingState(W.JOINING);let r=this.reconnectStrategy===LO.MIGRATE,i=this.reconnectStrategy===LO.REJOIN,a=this.reconnectStrategy===LO.FAST,o=this.lastStatsOptions;if(!this.credentials||!o||i||r||e?.migrating_from)try{let t=await this.doJoinRequest(e);this.credentials=t.credentials,o=t.stats_options,this.lastStatsOptions=o}catch(e){throw this.state.callingState!==W.OFFLINE&&this.state.setCallingState(n),e}let s=this.sfuClient,c=s?.sessionId,l=!!s?.isHealthy,u=i||r||!l?new gN({tag:String(this.sfuClientTag++),cid:this.cid,dispatcher:this.dispatcher,credentials:this.credentials,streamClient:this.streamClient,enableTracing:o.enable_rtc_stats,joinResponseTimeout:this.joinResponseTimeout,rpcRequestTimeout:this.rpcRequestTimeout,sessionId:i?void 0:c,onSignalClose:e=>this.handleSfuSignalClose(u,e)}):s;this.sfuClient=u,this.unifiedSessionId??=u.sessionId,this.trackSubscriptionManager.setSfuClient(u);let d=await vM();if(s!==u){let{dangerouslyForceCodec:t,fmtpLine:r,subscriberFmtpLine:i}=this.clientPublishOptions||{},[o,s]=await Promise.all([tj(`recvonly`,t,i),tj(`sendonly`,t,r)]),l=this.reconnectStrategy!==LO.UNSPECIFIED,f=l?this.getReconnectDetails(e?.migrating_from,c):void 0,p=l?this.currentPublishOptions||[]:this.getPreferredPublishOptions(),m=l?[]:this.getPreferredSubscribeOptions();try{let{callState:e,fastReconnectDeadlineSeconds:t,publishOptions:n}=await u.join({unifiedSessionId:this.unifiedSessionId,subscriberSdp:o,publisherSdp:s,clientDetails:d,fastReconnect:a,reconnectDetails:f,preferredPublishOptions:p,preferredSubscribeOptions:m,capabilities:Array.from(this.clientCapabilities),source:AO.WEBRTC_UNSPECIFIED});this.currentPublishOptions=n,this.fastReconnectDeadlineSeconds=t,e&&this.state.updateFromSfuCallState(e,u.sessionId,f)}catch(e){throw this.logger.warn(`Join SFU request failed`,e),u.close(gN.JOIN_FAILED,`Join request failed, connection considered unhealthy`),this.state.setCallingState(n),e}}if(r||this.state.setCallingState(W.JOINED),this.hasJoinedOnce=!0,a){let e=this.publisher?.isStable()??!0,t=!!this.publisher?.isPublishing()&&!e;!t&&this.publisher?.isPublishing()&&this.logger.info(`[Reconnect] FAST: skipping publisher ICE restart, publisher PC is stable`),await this.restoreICE(u,{includeSubscriber:!1,includePublisher:t})}else{let e=oN(this.credentials.ice_servers);await this.initPublisherAndSubscriber({sfuClient:u,connectionConfig:e,clientDetails:d,statsOptions:o,publishOptions:this.currentPublishOptions||[],closePreviousInstances:!r,unifiedSessionId:this.unifiedSessionId})}if(!i&&!a&&!r&&this.sfuStatsReporter?.sendConnectionTime((Date.now()-t)/1e3),i&&l){let e=LO[this.reconnectStrategy];await s?.leaveAndClose(`Closing previous WS after reconnect with strategy: ${e}`)}else l||s?.close(gN.DISPOSE_OLD_SOCKET,`Closing unhealthy WS after reconnect`);!this.deviceSettingsAppliedOnce&&this.state.settings&&(await this.applyDeviceConfig(this.state.settings,!0,!1),globalThis.streamRNVideoSDK?.callManager.start({isRingingTypeCall:this.ringing}),this.deviceSettingsAppliedOnce=!0),delete this.joinCallData?.ring,delete this.joinCallData?.notify,this.reconnectStrategy=LO.UNSPECIFIED,this.reconnectReason=``,this.consecutiveNegotiationFailures=0,this.logger.info(`Joined call ${this.cid}`)},this.getReconnectDetails=(e,t)=>{let n=this.reconnectStrategy,r=n===LO.REJOIN;return{strategy:n,announcedTracks:this.publisher?.getAnnouncedTracksForReconnect()||[],subscriptions:this.trackSubscriptionManager.subscriptions,reconnectAttempt:this.reconnectAttempts,fromSfuId:e||``,previousSessionId:r&&t||``,reason:this.reconnectReason}},this.getPreferredPublishOptions=()=>{let{preferredCodec:e,fmtpLine:t,preferredBitrate:n,maxSimulcastLayers:r}=this.clientPublishOptions||{};if(!e&&!n&&!r)return[];let i=e?ZO.create({name:e.split(`/`).pop(),fmtp:t}):void 0,a=[XO.create({trackType:U.VIDEO,codec:i,bitrate:n,maxSpatialLayers:r})],o=this.screenShare.getSettings();return o&&a.push(XO.create({trackType:U.SCREEN_SHARE,fps:o.maxFramerate,bitrate:o.maxBitrate})),a},this.getPreferredSubscribeOptions=()=>{let{subscriberCodec:e,subscriberFmtpLine:t}=this.clientPublishOptions||{};return!e||!t?[]:[YO.create({trackType:U.VIDEO,codecs:[{name:e.split(`/`).pop(),fmtp:t}]})]},this.restoreICE=async(e,t={})=>{let{includeSubscriber:n=!0,includePublisher:r=!0}=t;this.subscriber&&(this.subscriber.setSfuClient(e),n&&await this.subscriber.restartIce()),this.publisher&&(this.publisher.setSfuClient(e),r&&this.publisher.isPublishing()&&await this.publisher.restartIce())},this.initPublisherAndSubscriber=async e=>{let{sfuClient:t,connectionConfig:n,clientDetails:r,statsOptions:i,publishOptions:a,closePreviousInstances:o,unifiedSessionId:s}=e,{enable_rtc_stats:c,reporting_interval_ms:l}=i;o&&this.subscriber&&await this.subscriber.dispose();let u={sfuClient:t,dispatcher:this.dispatcher,state:this.state,connectionConfig:n,tag:t.tag,enableTracing:c,statsTimestampDriftThresholdMs:l/2,clientPublishOptions:this.clientPublishOptions,onReconnectionNeeded:(e,t,n)=>{this.reconnect(e,t).catch(e=>{let r=`[Reconnect] Error reconnecting, after a ${DO[n]} error: ${t}`;this.logger.warn(r,e)})},onIceConnected:()=>{this.iceFailuresWithoutConnect=0}};this.subscriber=new iN(u),this.streamClient.user?.type!==`anonymous`&&(o&&this.publisher&&await this.publisher.dispose(),this.publisher=new tN(u,a)),this.statsReporter?.stop(),this.statsReportingIntervalInMs>0&&(this.statsReporter=CM({subscriber:this.subscriber,publisher:this.publisher,state:this.state,datacenter:t.edgeName,pollingIntervalInMs:this.statsReportingIntervalInMs})),this.tracer.setEnabled(c),this.sfuStatsReporter?.flush(),this.sfuStatsReporter?.stop(),i?.reporting_interval_ms>0&&(this.sfuStatsReporter=new AM(t,{clientDetails:r,options:i,subscriber:this.subscriber,publisher:this.publisher,microphone:this.microphone,camera:this.camera,state:this.state,tracer:this.tracer,unifiedSessionId:s}),this.sfuStatsReporter.start())},this.doJoinRequest=async e=>{let t=await this.streamClient.getLocationHint(),n={...e,location:t},r=await this.streamClient.post(`${this.streamClientBasePath}/join`,n);return this.state.updateFromCallResponse(r.call),this.state.setMembers(r.members),this.state.setOwnCapabilities(r.own_capabilities),e?.ring&&this.ringingSubject.next(!0),this.reconnectStrategy===LO.UNSPECIFIED&&this.ringing&&!this.isCreatedByMe&&await this.accept(),this.streamClient._hasConnectionID()&&(this.watching=!0,this.clientStore.registerOrUpd
466ateCall(this)),r},this.handleSfuSignalClose=(e,t)=>{this.logger.debug(`[Reconnect] SFU signal connection closed`);let{callingState:n}=this.state;if(n===W.JOINING||n===W.RECONNECTING||n===W.IDLE||n===W.LEFT||e.isLeaving||e.isClosingClean)return;let r=this.publisher?.isHealthy()&&this.subscriber?.isHealthy()?LO.FAST:LO.REJOIN;this.reconnect(r,t).catch(e=>{this.logger.warn(`[Reconnect] Error reconnecting`,e)})},this.reconnect=async(e,t)=>{if(!(this.state.callingState===W.JOINING||this.state.callingState===W.RECONNECTING||this.state.callingState===W.MIGRATING||this.state.callingState===W.RECONNECTING_FAILED)&&!fj(this.reconnectConcurrencyTag))return lj(this.reconnectConcurrencyTag,async()=>{let n=Date.now();this.reconnectStrategy=e,this.reconnectReason=t;let r=async()=>{try{await this.get()}finally{this.state.setCallingState(W.RECONNECTING_FAILED)}},i=async e=>{this.logger.warn(`[Reconnect] Giving up: ${e}. Leaving the call.`),this.state.callingState===W.JOINING&&this.state.setCallingState(W.RECONNECTING);try{await this.leave({message:e})}catch(t){this.logger.warn(`[Reconnect] leave() failed after ${e}`,t)}};if(t===RM.ICE_NEVER_CONNECTED&&(this.iceFailuresWithoutConnect++,this.iceFailuresWithoutConnect>=this.maxIceFailuresWithoutConnect)){await i(`webrtc_unsupported_network`);return}let a=0;do{let e=Date.now()-n;if(this.disconnectionTimeoutSeconds>0&&e/1e3>this.disconnectionTimeoutSeconds){this.logger.warn(`[Reconnect] Stopping reconnection attempts after reaching disconnection timeout`),await r();return}if((this.reconnectStrategy===LO.REJOIN||this.reconnectStrategy===LO.MIGRATE)&&!this.rejoinRateLimiter.tryRegister()){await i(`rejoin_attempt_limit_exceeded`);return}this.reconnectStrategy!==LO.FAST&&this.reconnectAttempts++;let t=LO[this.reconnectStrategy];try{switch(await this.networkAvailableTask?.promise,this.logger.info(`[Reconnect] Reconnecting with strategy ${LO[this.reconnectStrategy]}`),this.reconnectStrategy){case LO.UNSPECIFIED:case LO.DISCONNECT:this.logger.debug(`[Reconnect] No-op strategy ${t}`);break;case LO.FAST:await this.reconnectFast();break;case LO.REJOIN:await this.reconnectRejoin();break;case LO.MIGRATE:await this.reconnectMigrate();break;default:Qj(this.reconnectStrategy,`Unknown reconnection strategy`);break}this.consecutiveNegotiationFailures=0;break}catch(e){if(this.state.callingState===W.OFFLINE){this.logger.debug(`[Reconnect] Can't reconnect while offline, stopping reconnection attempts`);break}if(e instanceof xO&&e.unrecoverable){this.logger.warn(`[Reconnect] Can't reconnect due to coordinator unrecoverable error`,e),await r();return}if(e instanceof oj&&(this.consecutiveNegotiationFailures++,this.consecutiveNegotiationFailures>=this.maxConsecutiveNegotiationFailures)){await i(`repeated_negotiation_failures`);return}await NA(LA(a));let o=this.reconnectStrategy===LO.MIGRATE,s=(Date.now()-n)/1e3>this.fastReconnectDeadlineSeconds||o||a>=3||!(this.publisher?.isHealthy()??!0)||!(this.subscriber?.isHealthy()??!0);a++;let c=s?LO.REJOIN:LO.FAST;this.reconnectStrategy=c,this.logger.info(`[Reconnect] ${t} (${this.reconnectAttempts}) failed. Attempting with ${LO[c]}`,e)}}while(this.state.callingState!==W.JOINED&&this.state.callingState!==W.RECONNECTING_FAILED&&this.state.callingState!==W.LEFT);this.logger.info(`[Reconnect] Reconnection flow finished`)})},this.reconnectFast=async()=>{let e=Date.now();this.reconnectStrategy=LO.FAST,this.state.setCallingState(W.RECONNECTING),await this.doJoin(this.joinCallData),await this.get(),this.sfuStatsReporter?.sendReconnectionTime(LO.FAST,(Date.now()-e)/1e3)},this.reconnectRejoin=async()=>{let e=Date.now();this.reconnectStrategy=LO.REJOIN,this.state.setCallingState(W.RECONNECTING),await this.doJoin(this.joinCallData),await this.restorePublishedTracks(),this.restoreSubscribedTracks(),this.sfuStatsReporter?.sendReconnectionTime(LO.REJOIN,(Date.now()-e)/1e3)},this.reconnectMigrate=async()=>{let e=Date.now(),t=this.sfuClient;if(!t)throw Error(`Cannot migrate without an active SFU client`);this.reconnectStrategy=LO.MIGRATE,this.state.setCallingState(W.MIGRATING);let n=this.subscriber,r=this.publisher;n?.detachEventHandlers(),r?.detachEventHandlers();let i=sN(t.enterMigration());try{let e=t.edgeName;await this.doJoin({...this.joinCallData,migrating_from:e,migrating_from_list:[e]})}finally{delete this.joinCallData?.migrating_from,delete this.joinCallData?.migrating_from_list}await this.restorePublishedTracks(),this.restoreSubscribedTracks();try{await i(),this.state.setCallingState(W.JOINED)}finally{await n?.dispose(),await r?.dispose(),t.close(gN.NORMAL_CLOSURE,`Migrating away`)}this.sfuStatsReporter?.sendReconnectionTime(LO.MIGRATE,(Date.now()-e)/1e3)},this.registerReconnectHandlers=()=>{let e=this.on(`goAway`,()=>{this.reconnect(LO.MIGRATE,RM.GO_AWAY).catch(e=>this.logger.warn(`[Reconnect] Error reconnecting`,e))}),t=this.on(`error`,e=>{let{reconnectStrategy:t,error:n}=e;
466mN.isJoinErrorCode(e)||t!==LO.UNSPECIFIED&&(t===LO.DISCONNECT?(globalThis.streamRNVideoSDK?.callingX?.endCall(this,`error`),this.leave({message:`SFU instructed to disconnect`}).catch(e=>{this.logger.warn(`Can't leave call after disconnect request`,e)})):this.reconnect(t,n?.message||RM.SFU_ERROR).catch(e=>{this.logger.warn(`[Reconnect] Error reconnecting`,e)}))}),n=this.streamClient.on(`network.changed`,e=>{if(this.tracer.trace(`network.changed`,e),e.online)this.logger.debug(`[Reconnect] Going online`),this.sfuClient?.close(gN.DISPOSE_OLD_SOCKET,`Closing WS to reconnect after going online`),this.networkAvailableTask?.resolve(),this.networkAvailableTask=void 0,this.sfuStatsReporter?.start();else{if(this.logger.debug(`[Reconnect] Going offline`),!this.hasJoinedOnce)return;this.lastOfflineTimestamp=Date.now();let e=cN();e.promise.then(()=>{let e=LO.FAST;this.lastOfflineTimestamp&&(Date.now()-this.lastOfflineTimestamp)/1e3>this.fastReconnectDeadlineSeconds&&(e=LO.REJOIN),this.reconnect(e,RM.NETWORK_BACK_ONLINE).catch(e=>{this.logger.warn(`[Reconnect] Error reconnecting after going online`,e)})}),this.networkAvailableTask=e,this.sfuStatsReporter?.stop(),this.state.setCallingState(W.OFFLINE)}});this.leaveCallHooks.add(e).add(t).add(n)},this.restorePublishedTracks=async()=>{for(let e of this.trackPublishOrder){let t;switch(e){case U.AUDIO:t=this.microphone.state.mediaStream;break;case U.VIDEO:t=this.camera.state.mediaStream;break;case U.SCREEN_SHARE:t=this.screenShare.state.mediaStream;break;case U.SCREEN_SHARE_AUDIO:case U.UNSPECIFIED:break;default:Qj(e,`Unknown track type`);break}t&&await this.publish(t,e)}},this.restoreSubscribedTracks=()=>{let{remoteParticipants:e}=this.state;e.length<=0||this.trackSubscriptionManager.apply(void 0)},this.publishVideoStream=async e=>{await this.publish(e,U.VIDEO)},this.publishAudioStream=async e=>{await this.publish(e,U.AUDIO)},this.publishScreenShareStream=async e=>{await this.publish(e,U.SCREEN_SHARE)},this.publish=async(e,t,n)=>{if(!this.sfuClient)throw Error(`Call is not joined yet`);if(await this.sfuClient.joinTask,!this.permissionsContext.canPublish(t))throw Error(`No permission to publish ${U[t]}`);if(!this.publisher)throw Error(`Publisher is not initialized`);let[r]=WM(t)?e.getAudioTracks():e.getVideoTracks();if(!r)throw Error(`There is no ${U[t]} track in the stream`);if(r.readyState===`ended`)throw Error(`Can't publish ended tracks.`);nN(this.trackPublishOrder,t),await this.publisher.publish(r,t,n);let i=[t];if(t===U.SCREEN_SHARE){let[t]=e.getAudioTracks();if(t){let e=U.SCREEN_SHARE_AUDIO;nN(this.trackPublishOrder,e),await this.publisher.publish(t,e,n),i.push(e)}}await this.updateLocalStreamState(e,...i)},this.stopPublish=async(...e)=>{!this.sfuClient||!this.publisher||(await this.publisher.stopTracks(...e),await this.updateLocalStreamState(void 0,...e))},this.updateLocalStreamState=async(e,...t)=>{let n=this.sfuClient?.sessionId;if(n&&(await this.notifyTrackMuteState(!e,...t),this.sfuClient?.sessionId===n))for(let r of t){let t=VM(r);t&&this.state.updateParticipant(n,n=>({publishedTracks:e?nN([...n.publishedTracks],r):n.publishedTracks.filter(e=>e!==r),[t]:e}))}},this.refreshPublishedTrack=async e=>{this.publisher&&await this.publisher.refreshTrack(e)},this.updatePublishOptions=e=>{this.logger.warn(`[call.updatePublishOptions]: You are manually overriding the publish options for this call. This is not recommended, and it can cause call stability/compatibility issues. Use with caution.`),this.state.callingState===W.JOINED&&this.logger.warn(`Updating publish options after joining the call does not have an effect`),this.tracer.trace(`updatePublishOptions`,e),this.clientPublishOptions={...this.clientPublishOptions,...e}},this.notifyNoiseCancellationStarting=async()=>this.sfuClient?.startNoiseCancellation().catch(e=>{this.logger.warn(`Failed to notify start of noise cancellation`,e)}),this.notifyNoiseCancellationStopped=async()=>this.sfuClient?.stopNoiseCancellation().catch(e=>{this.logger.warn(`Failed to notify stop of noise cancellation`,e)}),this.notifyTrackMuteState=async(e,...t)=>{await lj(`muteState.${this.cid}.${t.join(`-`)}`,async()=>{this.sfuClient&&await this.sfuClient.updateMuteStates(t.map(t=>({trackType:t,muted:e})))})},this.startReportingStatsFor=e=>this.statsReporter?.startReportingStatsFor(e),this.stopReportingStatsFor=e=>this.statsReporter?.stopReportingStatsFor(e),this.setStatsReportingIntervalInMs=e=>{this.statsReportingIntervalInMs=e},this.resetReaction=e=>{this.state.updateParticipant(e,{reaction:void 0})},this.setSortParticipantsBy=e=>this.state.setSortParticipantsBy(e),this.sendReaction=async e=>this.streamClient.post(`${this.streamClientBasePath}/reaction`,e),this.blockUser=async e=>this.streamClient.post(`${this.streamClientBasePath}/block`,{user_id:e}),this.unblockUser=async e=>this.streamClient.post(`${this.streamClientBasePath}/unblock`,{user_id:e}),this.kickUser=async e=>this.streamClient.post(`${this.streamClientBasePath}/kick`,e),this.muteSelf=e=>{let t=this.currentUserId;if(t)return this.muteUser(t,e)},this.muteOthers=e=>{let t=HM(e);if(!t)return;let n=[];for(let e of this.state.remoteParticipants)e.publishedTracks.includes(t)&&n.push(e.userId);if(n.length>0)return this.muteUser(n,e)},this.muteUser=(e,t)=>this.streamClient.post(`${this.streamClientBasePath}/mute_users`,{user_ids:Array.isArray(e)?e:[e],[t]:!0}),this.muteAllUsers=e=>this.streamClient.post(`${this.streamClientBasePath}/mute_users`,{mute_all_users:!0,[e]:!0}),this.startRecording=async(e,t)=>{t=typeof e==`string`?e:t,e=typeof e==`string`?void 0:e;let n=t?`/recordings/${encodeURIComponent(t)}/start`:`/start_recording`;return this.streamClient.post(`${this.streamClientBasePath}${n}`,e)},this.stopRecording=async e=>{let t=e?`/recordings/${encodeURIComponent(e)}/stop`:`/stop_recording`;return this.streamClient.post(`${this.streamClientBasePath}${t}`)},this.startTranscription=async e=>this.streamClient.post(`${this.streamClientBasePath}/start_transcription`,e),this.stopTranscription=async()=>this.streamClient.post(`${this.streamClientBasePath}/stop_transcription`),this.startClosedCaptions=async e=>{let t=this.state.setCaptioning(!0);try{return await this.streamClient.post(`${this.streamClientBasePath}/start_closed_captions`,e)}catch(e){throw t.rollback(),e}},this.stopClosedCaptions=async e=>{let t=this.state.setCaptioning(!1);try{return await this.streamClient.post(`${this.streamClientBasePath}/stop_closed_captions`,e)}catch(e){throw t.rollback(),e}},this.updateClosedCaptionSettings=e=>{this.state.updateClosedCaptionSettings(e)},this.requestPermissions=async e=>{let{permissions:t}=e;if(!t.every(e=>this.permissionsContext.canRequest(e)))throw Error(`You are not allowed to request permissions: ${t.join(`, `)}`);return this.streamClient.post(`${this.streamClientBasePath}/request_permission`,e)},this.grantPermissions=async(e,t)=>this.updateUserPermissions({user_id:e,grant_permissions:t}),this.revokePermissions=async(e,t)=>this.updateUserPermissions({user_id:e,revoke_permissions:t}),this.updateUserPermissions=async e=>this.streamClient.post(`${this.streamClientBasePath}/user_permissions`,e),this.goLive=async(e={},t)=>this.streamClient.post(`${this.streamClientBasePath}/go_live`,e,t),this.stopLive=async(e={})=>this.streamClient.post(`${this.streamClientBasePath}/stop_live`,e),this.startHLS=async()=>this.streamClient.post(`${this.streamClientBasePath}/start_broadcasting`,{}),this.stopHLS=async()=>this.streamClient.post(`${this.streamClientBasePath}/stop_broadcasting`,{}),this.startRTMPBroadcasts=async e=>this.streamClient.post(`${this.streamClientBasePath}/rtmp_broadcasts`,e),this.stopAllRTMPBroadcasts=async()=>this.streamClient.post(`${this.streamClientBasePath}/rtmp_broadcasts/stop`),this.stopRTMPBroadcast=async e=>this.streamClient.post(`${this.streamClientBasePath}/rtmp_broadcasts/${e}/stop`),this.startFrameRecording=async e=>this.streamClient.post(`${this.streamClientBasePath}/start_frame_recording`,e),this.stopFrameRecording=async()=>this.streamClient.post(`${this.streamClientBasePath}/stop_frame_recording`),this.update=async e=>{let t=await this.streamClient.patch(`${this.streamClientBasePath}`,e),{call:n,members:r,own_capabilities:i}=t;return this.state.updateFromCallResponse(n),this.state.setMembers(r),this.state.setOwnCapabilities(i),t},this.endCall=async()=>this.streamClient.post(`${this.streamClientBasePath}
466/mark_ended`),this.pin=e=>{this.state.updateParticipant(e,{pin:{isLocalPin:!0,pinnedAt:Date.now()}})},this.unpin=e=>{this.state.updateParticipant(e,{pin:void 0})},this.pinForEveryone=async e=>this.streamClient.post(`${this.streamClientBasePath}/pin`,e),this.unpinForEveryone=async e=>this.streamClient.post(`${this.streamClientBasePath}/unpin`,e),this.queryMembers=e=>this.streamClient.post(`/call/members`,{...e||{},id:this.id,type:this.type}),this.queryParticipants=async(e={},t={})=>this.streamClient.post(`${this.streamClientBasePath}/participants`,e,t),this.updateCallMembers=async e=>this.streamClient.post(`${this.streamClientBasePath}/members`,e),this.scheduleAutoDrop=()=>{this.cancelAutoDrop();let e=this.state.settings;if(!e||this.state.callingState!==W.RINGING)return;let t=this.isCreatedByMe?e.ring.auto_cancel_timeout_ms:e.ring.incoming_call_timeout_ms;t<=0||(this.dropTimeout=setTimeout(()=>{this.state.callingState===W.RINGING&&this.leave({reject:!0,reason:`timeout`,message:`ringing timeout - ${this.isCreatedByMe?`no one accepted`:`user didn't interact with incoming call screen`}`}).catch(e=>{this.logger.error(`Failed to drop call`,e)})},t))},this.cancelAutoDrop=()=>{clearTimeout(this.dropTimeout),this.dropTimeout=void 0},this.queryRecordings=async e=>this.listRecordings(e),this.listRecordings=async e=>{let t=this.streamClientBasePath;return e&&(t=`${t}/${e}`),this.streamClient.get(`${t}/recordings`)},this.deleteRecording=async(e,t)=>this.streamClient.delete(`${this.streamClientBasePath}/${encodeURIComponent(e)}/recordings/${encodeURIComponent(t)}`),this.deleteTranscription=async(e,t)=>this.streamClient.delete(`${this.streamClientBasePath}/${encodeURIComponent(e)}/transcriptions/${encodeURIComponent(t)}`),this.queryTranscriptions=async()=>this.listTranscriptions(),this.listTranscriptions=async()=>this.streamClient.get(`${this.streamClientBasePath}/transcriptions`),this.getCallStats=async e=>{let t=`${this.streamClientBasePath}/stats/${e}`;return this.streamClient.get(t)},this.getCallReport=async(e=``)=>{let t=`${this.streamClientBasePath}/report`,n=e===``?{}:{session_id:e};return this.streamClient.get(t,n)},this.getCallParticipantsStats=async e=>{let{sessionId:t=this.state.session?.id,userId:n=this.currentUserId,userSessionId:r=this.unifiedSessionId,kind:i=`details`}=e;if(!t)return;let a=`${this.streamClient.baseURL}/call_stats/${this.type}/${this.id}/${t}`;return!n||!r?this.streamClient.get(`${a}/participants`):i===`details`?this.streamClient.get(`${a}/participant/${n}/${r}/details`):this.streamClient.get(`${a}/participants/${n}/${r}/timeline`)},this.submitFeedback=async(e,{reason:t,custom:n}={})=>{let{sdkName:r,sdkVersion:i,...a}=rM(await vM());return this.streamClient.post(`${this.streamClientBasePath}/feedback`,{rating:e,reason:t,user_session_id:this.sfuClient?.sessionId,sdk:r,sdk_version:i,custom:{...n,"x-stream-platform-data":a}})},this.getCallStatsMap=async(e={},t=this.state.session?.id)=>{if(!t)throw Error(`callSessionId is required`);return this.streamClient.get(`${this.streamClient.baseURL}/call_stats/${this.type}/${this.id}/${t}/map`,e)},this.sendCustomEvent=async e=>this.streamClient.post(`${this.streamClientBasePath}/event`,{custom:e}),this.applyDeviceConfig=async(e,t,n)=>{n||this.speaker.apply(e),await this.camera.apply(e.video,t).catch(e=>{this.logger.warn(`Camera init failed`,e)}),await this.microphone.apply(e.audio,t).catch(e=>{this.logger.warn(`Mic init failed`,e)})},this.trackElementVisibility=(e,t,n)=>this.viewportTracker?.trackElementVisibility(e,t,n),this.setViewport=e=>this.viewportTracker?.setViewport(e),this.bindVideoElement=(e,t,n)=>{let r=this.dynascaleManager?.bindVideoElement(e,t,n);if(r)return this.leaveCallHooks.add(r),()=>{this.leaveCallHooks.delete(r),r()}},this.bindAudioElement=(e,t,n=`audioTrack`)=>{let r=this.dynascaleManager?.bindAudioElement(e,t,n);if(!r)return;this.audioBindingsWatchdog?.register(e,t,n);let i=()=>{r(),this.audioBindingsWatchdog?.unregister(t,n)};return this.leaveCallHooks.add(i),()=>{this.leaveCallHooks.delete(i),i()}},this.resumeAudio=()=>
466this.blockedAudioTracker.resumeAudio(),this.bindCallThumbnailElement=(e,t={})=>{let n=()=>{e.src=t.fallbackImageSource||`https://getstream.io/random_svg/?name=x&id=x`},r=Sj(this.state.thumbnails$,t=>{if(!t)return;e.addEventListener(`error`,n);let r=new URL(t.image_url);r.searchParams.set(`w`,String(e.clientWidth)),r.searchParams.set(`h`,String(e.clientHeight)),e.src=r.toString()});return()=>{r(),e.removeEventListener(`error`,n)}},this.setPreferredIncomingVideoResolution=(e,t)=>{this.trackSubscriptionManager.setOverrides(e?{enabled:!0,dimension:e}:void 0,t),this.trackSubscriptionManager.apply()},this.setIncomingVideoEnabled=e=>{this.trackSubscriptionManager.setOverrides(e?void 0:{enabled:!1}),this.trackSubscriptionManager.apply()},this.setDisconnectionTimeout=e=>{this.disconnectionTimeoutSeconds=e},this.setRejoinAttemptLimit=(e,t)=>{this.rejoinRateLimiter.setLimits(Math.max(1,e),Math.max(1,t)*1e3)},this.setMaxIceFailuresWithoutConnect=e=>{this.maxIceFailuresWithoutConnect=Math.max(1,e)},this.setMaxConsecutiveNegotiationFailures=e=>{this.maxConsecutiveNegotiationFailures=Math.max(1,e)},this.enableClientCapabilities=(...e)=>{for(let t of e)this.clientCapabilities.add(t)},this.disableClientCapabilities=(...e)=>{for(let t of e)this.clientCapabilities.delete(t)},this.type=e,this.id=t,this.cid=`${e}:${t}`,this.ringingSubject=new fD(s),this.watching=c,this.streamClient=n,this.clientStore=o,this.streamClientBasePath=`/call/${this.type}/${this.id}`,this.logger=JA.getLogger(`Call`);let l=ZN.get(e),u=a||l.options.sortParticipantsBy;u&&this.state.setSortParticipantsBy(u),this.state.setMembers(r||[]),this.state.setOwnCapabilities(i||[]),this.state.setCallingState(s?W.RINGING:W.IDLE);let d=xP(n.options.devicePersistence);this.camera=new sae(this,d),this.microphone=new fae(this,d),this.speaker=new gae(this,d),this.screenShare=new mae(this),this.trackSubscriptionManager=new UN(this.state,this.tracer),this.blockedAudioTracker=new VN(this.tracer),typeof document<`u`&&(this.audioBindingsWatchdog=new BN(this.state,this.tracer),this.viewportTracker=new JN(this.state),this.dynascaleManager=new GN(this.state,this.speaker,this.tracer,this.trackSubscriptionManager,this.blockedAudioTracker))}get ringing(){return vj(this.ringingSubject)}get currentUserId(){return this.clientStore.connectedUser?.id}get isCreatedByMe(){return this.currentUserId&&this.state.createdBy?.id===this.currentUserId}},_ae=null,vae={[-1]:`InternalSystemError`,2:`AccessKeyError`,3:`AuthenticationFailedError`,4:`InputError`,5:`AuthenticationError`,6:`DuplicateUsernameError`,9:`RateLimitError`,16:`DoesNotExistError`,17:`NotAllowedError`,18:`EventNotSupportedError`,19:`ChannelFeatureNotSupportedError`,20:`MessageTooLongError`,21:`MultipleNestingLevelError`,22:`PayloadTooBigError`,23:`RequestTimeoutError`,24:`MaxHeaderSizeExceededError`,40:`AuthErrorTokenExpired`,41:`AuthErrorTokenNotValidYet`,42:`AuthErrorTokenUsedBeforeIssuedAt`,43:`AuthErrorTokenSignatureInvalid`,44:`CustomCommandEndpointMissingError`,45:`CustomCommandEndpointCallError`,46:`ConnectionIDNotFoundError`,60:`CoolDownError`,69:`ErrWrongRegion`,70:`ErrQueryChannelPermissions`,71:`ErrTooManyConnections`,73:`MessageModerationFailedError`,99:`AppSuspendedError`},yae=class{constructor(e){this.wsID=1,this.isConnecting=!1,this.isDisconnected=!1,this.isHealthy=!1,this.isConnectionOpenResolved=!1,this.consecutiveFailures=0,this.totalFailures=0,this.pingInterval=25*1e3,this.connectionCheckTimeout=this.pingInterval+10*1e3,this.lastEvent=null,this._log=(e,t={},n=`info`)=>{this.client.logger[n](`connection:${e}`,t)},this.setClient=e=>{this.client=e},this.connect=async(e=15e3)=>{if(this.isConnecting)throw Error(`You've called connect twice, can only attempt 1 connection at the time`);this.isDisconnected=!1;try{let t=await this._connect(e);this.consecutiveFailures=0,this._log(`connect() - Established ws connection with healthcheck: ${t}`)}catch(e){let t=e;if(this.isHealthy=!1,this.consecutiveFailures+=1,t.code===IA.TOKEN_EXPIRED&&!this.client.tokenManager.isStatic())this._log(`connect() - WS failure due to expired token, so going to try to reload token and reconnect`),this._reconnect({refreshToken:!0});else if(t.isWSFailure)this._reconnect();else throw Error(JSON.stringify({code:t.code,StatusCode:t.StatusCode,message:t.message,isWSFailure:t.isWSFailure}))}return await this._waitForHealthy(e)},this._waitForHealthy=async(e=15e3)=>Promise.race([(async()=>{for(let t=0;t<=e;t+=50)try{return await this.connectionOpen}catch(n){let r=n;if(t===e)throw Error(JSON.stringify({code:r.code,StatusCode:r.StatusCode,message:r.message,isWSFailure:r.isWSFailure}));await NA(50)}})(),(async()=>{throw await NA(e),this.isConnecting=!1,Error(JSON.stringify({code:``,StatusCode:``,message:`initial WS connection could not be established`,isWSFailure:!0}))})()]),this._buildUrl=()=>{let e=new URLSearchParams;return e.set(`api_key`,this.client.key),e.set(`stream-auth-type`,this.client.getAuthType()),e.set(`X-Stream-Client`,this.client.getUserAgent()),`${this.client.wsBaseURL}/connect?${e.toString()}`},this.disconnect=e=>{this._log(`disconnect() - Closing the websocket connection for wsID ${this.wsID}`),this.wsID+=1,this.isConnecting=!1,this.isDisconnected=!0,this.healthCheckTimeoutRef&&pN().clearInterval(this.healthCheckTimeoutRef),this.connectionCheckTimeoutRef&&clearInterval(this.connectionCheckTimeoutRef),UA(this.onlineStatusChanged),this.isHealthy=!1;let t,{ws:n}=this;return n&&n.close&&n.readyState===n.OPEN?(t=new Promise(t=>{let r=e=>{this._log(`disconnect() - resolving isClosedPromise ${e?`with`:`without`} close frame`,{event:e}),t()};
466n.onclose=r,setTimeout(r,e??1e3)}),this._log(`disconnect() - Manually closed connection by calling client.disconnect()`),n.close(IA.WS_CLOSED_SUCCESS,`Manually closed connection by calling client.disconnect()`)):(this._log(`disconnect() - ws connection doesn't exist or it is already closed.`),t=Promise.resolve()),delete this.ws,t},this._connect=async e=>{if(this.isConnecting)return;this.isConnecting=!0;let t=this.client.rejectConnectionId,n=!1;try{this._log(`_connect() - waiting for token`),await this.client.tokenManager.tokenReady(),n=!0}catch{}try{n||(this._log(`_connect() - tokenProvider failed before, so going to retry`),await this.client.tokenManager.loadToken()),this.client.isConnectionIdPromisePending||(this.client._setupConnectionIdPromise(),t=this.client.rejectConnectionId),this._setupConnectionPromise();let r=this._buildUrl();this._log(`_connect() - Connecting to ${r}`);let i=this.client.options.WebSocketImpl??WebSocket;this.ws=new i(r),this.ws.onopen=this.onopen.bind(this,this.wsID),this.ws.onclose=this.onclose.bind(this,this.wsID),this.ws.onerror=this.onerror.bind(this,this.wsID),this.ws.onmessage=this.onmessage.bind(this,this.wsID);let a=e??this.client.defaultWSTimeout,o=pN(),s,c;try{c=await Promise.race([this.connectionOpen,new Promise((e,t)=>{s=o.setTimeout(()=>{let e=Error(`WS handshake timed out after ${a}ms`);e.isWSFailure=!0,t(e)},a)})])}finally{o.clearTimeout(s)}if(this.isConnecting=!1,this.isDisconnected)throw this.ws&&this.ws.readyState!==this.ws.CLOSED&&this._destroyCurrentWSConnection(),Error(`WS handshake aborted: disconnect() ran while connecting`);if(c)return this.connectionID=c.connection_id,this.client.resolveConnectionId?.(this.connectionID),c}catch(e){let n=e;throw this.isConnecting=!1,this._log(`_connect() - Error - `,n),t?.(n),this.rejectConnectionOpen?.(n),this.ws&&this.ws.readyState!==this.ws.CLOSED&&this._destroyCurrentWSConnection(),n}},this.onlineStatusChanged=e=>{e.type===`offline`?(this._log(`onlineStatusChanged() - Status changing to offline`),this._setHealth(!1,!0)):e.type===`online`&&(this._log(`onlineStatusChanged() - Status changing to online. isHealthy: ${this.isHealthy}`),this.isHealthy||this._reconnect({interval:10}))},this.onopen=e=>{if(this.wsID!==e)return;let t=this.client.user;if(!t){this.client.logger.error(`User not set, can't connect to WS`);return}let n=this.client._getToken();if(!n){this.client.logger.error(`Token not set, can't connect authenticate`);return}let r=JSON.stringify({token:n,user_details:{id:t.id,name:t.name,image:t.image,custom:t.custom}});this._log(`onopen() - Sending auth message ${r}`,{},`trace`),this.ws?.send(r),this._log(`onopen() - onopen callback`,{wsID:e})},this.onmessage=(e,t)=>{if(this.wsID!==e)return;let n=typeof t.data==`string`?JSON.parse(t.data):null;if(!this.isConnectionOpenResolved&&n&&n.type===`connection.error`&&(this.isConnectionOpenResolved=!0,n.error)){this.rejectConnectionOpen?.(this._errorFromWSEvent(n,!1));return}if(this.lastEvent=new Date,n&&(n.type===`health.check`||n.type===`connection.ok`)&&this.scheduleNextPing(),n&&n.type===`connection.ok`&&(this.resolveConnectionOpen?.(n),this._setHealth(!0)),n&&n.type===`connection.error`&&n.error){let{code:e}=n.error;this.isHealthy=!1,this.isConnecting=!1,this.consecutiveFailures+=1,e===IA.TOKEN_EXPIRED&&!this.client.tokenManager.isStatic()&&(clearTimeout(this.connectionCheckTimeoutRef),this._log(`connect() - WS failure due to expired token, so going to try to reload token and reconnect`),this._reconnect({refreshToken:!0}))}n&&(n.received_at=new Date,this.client.dispatchEvent(n)),this.scheduleConnectionCheck()},this.onclose=(e,t)=>{if(this.wsID===e)if(this._log(`onclose() - onclose callback - `+t.code,{event:t,wsID:e}),t.code===IA.WS_CLOSED_SUCCESS){let e=Error(`WS connection reject with error ${t.reason}`);e.reason=t.reason,e.code=t.code,e.wasClean=t.wasClean,e.target=t.target,this.rejectConnectionOpen?.(e),this._log(`onclose() - WS connection reject with error ${t.reason}`,{event:t})}else this.consecutiveFailures+=1,this.totalFailures+=1,this._setHealth(!1),this.isConnecting=!1,this.rejectConnectionOpen?.(this._errorFromWSEvent(t)),this._log(`onclose() - WS connection closed. Calling reconnect ...`,{event:t}),this._reconnect()},this.onerror=(e,t)=>
466{this.wsID===e&&(this.consecutiveFailures+=1,this.totalFailures+=1,this._setHealth(!1),this.isConnecting=!1,this._log(`onerror() - WS connection resulted into error`,{event:t}),this._reconnect())},this._setHealth=(e,t=!1)=>{if(e!==this.isHealthy){if(this.isHealthy=e,this.isHealthy||t){this.client.dispatchEvent({type:`connection.changed`,online:this.isHealthy});return}setTimeout(()=>{this.isHealthy||this.client.dispatchEvent({type:`connection.changed`,online:this.isHealthy})},5e3)}},this._errorFromWSEvent=(e,t=!0)=>{let n,r,i;if(GA(e))n=e.code,i=e.reason,r=0;else{let{error:t}=e;n=t.code,i=t.message,r=t.StatusCode}let a=`WS failed with code: ${n}: ${vae[n]||n} and reason: ${i}`;this._log(a,{event:e},`warn`);let o=Error(a);return o.code=n,o.StatusCode=r,o.isWSFailure=t,o},this._setupConnectionPromise=()=>{this.isConnectionOpenResolved=!1,this.connectionOpenSafe=sN(new Promise((e,t)=>{this.resolveConnectionOpen=e,this.rejectConnectionOpen=t}))},this.scheduleNextPing=()=>{let e=pN();this.healthCheckTimeoutRef&&e.clearTimeout(this.healthCheckTimeoutRef),this.healthCheckTimeoutRef=e.setTimeout(()=>{let e=[{type:`health.check`,client_id:this.client.clientID}];try{this.ws?.send(JSON.stringify(e))}catch{}},this.pingInterval)},this.scheduleConnectionCheck=()=>{clearTimeout(this.connectionCheckTimeoutRef),this.connectionCheckTimeoutRef=setTimeout(()=>{let e=new Date;this.lastEvent&&e.getTime()-this.lastEvent.getTime()>this.connectionCheckTimeout&&(this._log(`scheduleConnectionCheck - going to reconnect`),this._setHealth(!1),this._reconnect())},this.connectionCheckTimeout)},this.client=e,HA(this.onlineStatusChanged)}async _reconnect(e={}){if(this._log(`_reconnect() - Initiating the reconnect`),this.isConnecting||this.isHealthy){this._log(`_reconnect() - Abort (1) since already connecting or healthy`);return}let t=e.interval;if(t||=LA(this.consecutiveFailures),await NA(t),this.isConnecting||this.isHealthy){this._log(`_reconnect() - Abort (2) since already connecting or healthy`);return}if(this.isDisconnected){this._log(`_reconnect() - Abort (3) since disconnect() is called`);return}this._log(`_reconnect() - Destroying current WS connection`),this._destroyCurrentWSConnection(),e.refreshToken&&await this.client.tokenManager.loadToken();try{await this._connect(),this._log(`_reconnect() - Waiting for recoverCallBack`),this._log(`_reconnect() - Finished recoverCallBack`),this.consecutiveFailures=0}catch(e){let t=e;if(this.isHealthy=!1,this.consecutiveFailures+=1,t.code===IA.TOKEN_EXPIRED&&!this.client.tokenManager.isStatic())return this._log(`_reconnect() - WS failure due to expired token, so going to try to reload token and reconnect`),this._reconnect({refreshToken:!0});t.isWSFailure&&(this._log(`_reconnect() - WS failure, so going to try to reconnect`),this._reconnect())}this._log(`_reconnect() - == END ==`)}_destroyCurrentWSConnection(){this.wsID+=1;try{this?.ws?.close()}catch{}}get connectionOpen(){return this.connectionOpenSafe?.()}};function bae(e){let t=e.split(`.`);if(t.length!==3)return``;let n=t[1],r=xae(n);return JSON.parse(r).user_id}var xae=e=>{let t={},n=String.fromCharCode,r=e.length,i,a=0,o,s,c=0,l,u=``;for(i=0;i<64;i++)t[`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`.charAt(i)]=i;for(s=0;s<r;s++)for(o=t[e.charAt(s)],a=(a<<6)+o,c+=6;c>=8;)((l=a>>>(c-=8)&255)||s<r-2)&&(u+=n(l));return u},Sae=class{constructor(e){this.loadTokenPromise=null,this.type=`static`,this.setTokenOrProvider=async(e,t,n)=>{this.user=t,this.isAnonymous=n,this.validateToken(e),FA(e)&&(this.tokenProvider=e,this.type=`provider`),typeof e==`string`&&(this.token=e,this.type=`static`),await this.loadToken()},this.reset=()=>{this.token=void 0,this.tokenProvider=void 0,this.type=`static`,this.user=void 0,this.loadTokenPromise=null},this.validateToken=e=>{if(!(this.user&&this.isAnonymous&&!e)){if(!this.secret&&!e)throw Error(`User token can not be empty`);if(typeof e!=`string`&&!FA(e))throw Error(`User token should either be a string or a function`);if(typeof e==`string`){if(this.isAnonymous&&e===``)return;let t=bae(e);if(e!=null&&(t==null||t===``||!this.isAnonymous&&t!==this.user.id))throw Error(`userToken does not have a user_id or is not matching with user.id`)}}},this.tokenReady=()=>this.loadTokenPromise,this.loadToken=()=>(this.loadTokenPromise=new Promise(async(e,t)=>
466{if(this.type===`static`)return e(this.token);if(this.tokenProvider&&typeof this.tokenProvider!=`string`){try{let e=await this.tokenProvider();this.validateToken(e),this.token=e}catch(e){return t(Error(`Call to tokenProvider failed with message: ${e}`,{cause:e}))}e(this.token)}}),this.loadTokenPromise),this.getToken=()=>{if(this.token||this.user&&!this.token)return this.token;throw Error(`User token is not set. Either client.connectUser wasn't called or client.disconnect was called`)},this.isStatic=()=>this.type===`static`,this.secret=e}},LP=async(e=`https://hint.stream-io-video.com/`,t=2e3,n=3)=>{let r=JA.getLogger(`location-hint`),i=0,a=`ERR`;do{let n=new AbortController,i=setTimeout(()=>n.abort(),t);try{let t=(await fetch(e,{method:`HEAD`,signal:n.signal})).headers.get(`x-amz-cf-pop`)||`ERR`;r.debug(`Location header: ${t}`),a=t.substring(0,3)}catch(t){r.warn(`Failed to get location hint from ${e}`,t),a=`ERR`}finally{clearTimeout(i)}}while(a===`ERR`&&++i<n);return a},Cae=class{constructor(e,t){this.listeners={},this.getAuthType=()=>this.anonymous?`anonymous`:`jwt`,this.setBaseURL=e=>{this.baseURL=e,this.wsBaseURL=this.baseURL.replace(`http`,`ws`).replace(`:3030`,`:8800`)},this.getLocationHint=async(e,t)=>{let n=await this.locationHint;return!n||n===`ERR`?(this.locationHint=LP(e??this.options.locationHintUrl,t??this.options.locationHintTimeout),this.locationHint):n},this._getConnectionID=()=>this.wsConnection?.connectionID,this._hasConnectionID=()=>!!this._getConnectionID(),this.connectUser=async(e,t)=>{if(!e.id)throw Error(`The "id" field on the user is missing`);if(this.userID===e.id&&this.connectUserTask)return this.logger.warn(`Consecutive calls to connectUser is detected, ideally you should only call this function once in your app.`),this.connectUserTask;if(this.userID)throw Error(`Use client.disconnect() before trying to connect as a different user. connectUser was called twice.`);(this.secret||this.node)&&!this.options.allowServerSideConnect&&this.logger.warn(`Please do not use connectUser server side. Use our @stream-io/node-sdk instead: https://getstream.io/video/docs/api/`),this.userID=e.id,this.anonymous=!1,await this.tokenManager.setTokenOrProvider(t,e,!1),this._setUser(e),this.connectUserTask=this.openConnection();try{return HA(this.updateNetworkConnectionStatus),await this.connectUserTask}catch(e){throw this.persistUserOnConnectionFailure?await this.closeConnection():await this.disconnectUser(),e}},this._setUser=e=>{this.user=e,this.userID=e.id,this._user={...e}},this.closeConnection=async e=>{await this.wsConnection?.disconnect(e)},this.openConnection=async()=>{if(!this.userID)throw Error(`UserWithId is not set on client, use client.connectUser or client.connectAnonymousUser instead`);let e=this.wsPromiseSafe?.();if(this.wsConnection?.isConnecting&&e)return this.logger.info(`client:openConnection() - connection already in progress`),await e;if(this.wsConnection?.isHealthy&&this._hasConnectionID()){this.logger.info(`client:openConnection() - openConnection called twice, healthy connection already exists`);return}this._setupConnectionIdPromise(),this.clientID=`${this.userID}--${zA()}`;let t=this.connect();return this.wsPromiseSafe=sN(t),await t},this.disconnectUser=async e=>{this.logger.info(`client:disconnect() - Disconnecting the client`),delete this.user,delete this._user,delete this.userID,this.anonymous=!1,await this.closeConnection(e),UA(this.updateNetworkConnectionStatus),this.tokenManager.reset(),this.connectionIdPromiseSafe=void 0,this.rejectConnectionId=void 0,this.resolveConnectionId=void 0},this.connectGuestUser=async e=>{this.guestUserCreatePromise=this.doAxiosRequest(`post`,`/guest`,{user:e},{publicEndpoint:!0});let t=await this.guestUserCreatePromise;return this.guestUserCreatePromise.finally(()=>this.guestUserCreatePromise=void 0),this.connectUser(t.user,t.access_token)},this.connectAnonymousUser=async(e,t)=>{HA(this.updateNetworkConnectionStatus),this._setupConnectionIdPromise(),this.anonymous=!0,await this.tokenManager.setTokenOrProvider(t,e,!0),this._setUser(e),this.resolveConnectionId?.()},this.on=(e,t)=>(this.listeners[e]||(this.listeners[e]=[]),this.logger.debug(`Adding listener for ${e} event`),this.listeners[e]?.push(t),()=>{this.off(e,t)}),this.off=(e,t)=>{this.listeners[e]||(this.listeners[e]=[]),this.logger.debug(`Removing listener for ${e} event`),this.listeners[e]=this.listeners[e]?.filter(e=>e!==t)},this._setupConnectionIdPromise=()=>{this.connectionIdPromiseSafe=sN(new Promise((e,t)=>
466{this.resolveConnectionId=e,this.rejectConnectionId=t}))},this._logApiRequest=(e,t,n,r)=>{this.logger.getLogLevel()===`trace`&&this.logger.trace(`client: ${e} - Request - ${t}`,{payload:n,config:r})},this._logApiResponse=(e,t,n)=>{this.logger.getLogLevel()===`trace`&&this.logger.trace(`client:${e} - Response - url: ${t} > status ${n.status}`,{response:n})},this.doAxiosRequest=async(e,t,n,r={})=>{if(!r.publicEndpoint){await Promise.all([this.tokenManager.tokenReady(),this.guestUserCreatePromise]);try{await this.connectionIdPromise}catch{await this.wsConnection?._waitForHealthy(),await this.connectionIdPromise}}let i=this._enrichAxiosOptions(r);try{let r;switch(this._logApiRequest(e,t,n,i),e){case`get`:r=await this.axiosInstance.get(t,i);break;case`delete`:r=await this.axiosInstance.delete(t,i);break;case`post`:r=await this.axiosInstance.post(t,n,i);break;case`put`:r=await this.axiosInstance.put(t,n,i);break;case`patch`:r=await this.axiosInstance.patch(t,n,i);break;case`options`:r=await this.axiosInstance.options(t,i);break;default:throw Error(`Invalid request type`)}return this._logApiResponse(e,t,r),this.consecutiveFailures=0,r.data}catch(a){a.client_request_id=i.headers?.[`x-client-request-id`],this.consecutiveFailures+=1;let{response:o}=a;if(!o||!WA(o))throw this.logger.error(`client:${e} url: ${t}`,a),a;let{data:s,status:c}=o;if(s.code===IA.TOKEN_EXPIRED&&!this.tokenManager.isStatic())return this.logger.warn(`client:${e}: url: ${t}`,o),this.consecutiveFailures>1&&await NA(LA(this.consecutiveFailures)),await this.tokenManager.loadToken(),await this.doAxiosRequest(e,t,n,r);throw this.logger.error(`client:${e} url: ${t}`,o),new xO({message:`Stream error code ${s.code}: ${s.message}`,code:s.code??null,unrecoverable:s.unrecoverable??null,response:o,status:c})}},this.get=(e,t)=>this.doAxiosRequest(`get`,e,null,{params:t}),this.put=(e,t,n)=>this.doAxiosRequest(`put`,e,t,{params:n}),this.post=(e,t,n)=>this.doAxiosRequest(`post`,e,t,{params:n}),this.patch=(e,t,n)=>this.doAxiosRequest(`patch`,e,t,{params:n}),this.delete=(e,t)=>this.doAxiosRequest(`delete`,e,null,{params:t}),this.dispatchEvent=e=>{if(this.logger.debug(`Dispatching event: ${e.type}`,e),this.listeners){for(let t of this.listeners.all||[])t(e);for(let t of this.listeners[e.type]||[])t(e)}},this.connect=async()=>{if(!this.userID||!this._user)throw Error(`Call connectUser or connectAnonymousUser before starting the connection`);if(!this.wsBaseURL)throw Error(`Websocket base url not set`);if(!this.clientID)throw Error(`clientID is not set`);return this.wsConnection=new yae(this),this.logger.info(`StreamClient.connect: this.wsConnection.connect()`),await this.wsConnection.connect(this.defaultWSTimeout)},this.getUserAgent=()=>{if(!this.cachedUserAgent){let{clientAppIdentifier:e={}}=this.options,{sdkName:t=`js`,sdkVersion:n=`1.52.0`,...r}=e;this.cachedUserAgent=[`stream-video-${t}-v${n}`,...Object.entries(r).map(([e,t])=>`${e}=${t}`),`client_bundle=browser-esm`].join(`|`)}return this.cachedUserAgent},this._enrichAxiosOptions=(e={params:{},headers:{},config:{}})=>{let t=e.publicEndpoint&&!this.user?void 0:this._getToken(),n=t?{Authorization:t}:void 0;e.headers?.[`x-client-request-id`]||(e.headers={...e.headers,"x-client-request-id":zA()});let{params:r,headers:i,...a}=this.options.axiosRequestConfig||{};return{params:{user_id:this.userID,connection_id:this._getConnectionID(),api_key:this.key,...e.params,...r},headers:{...n,"stream-auth-type":e.publicEndpoint&&!this.user?`anonymous`:this.getAuthType(),"X-Stream-Client":this.getUserAgent(),...e.headers,...i},...e.config,...a}},this._getToken=()=>this.tokenManager?this.tokenManager.getToken():null,this.updateNetworkConnectionStatus=e=>{e.type===`offline`?(this.logger.debug(`device went offline`),this.dispatchEvent({type:`network.changed`,online:!1})):e.type===`online`&&(this.logger.debug(`device went online`),this.dispatchEvent({type:`network.changed`,online:!0}))},this.key=e,this.secret=t?.secret;let n=t||{browser:typeof window<`u`};this.browser=n.browser||typeof window<`u`,this.node=!this.browser,this.browser&&(this.locationHint=LP(t?.locationHintUrl,t?.locationHintTimeout,t?.locationHintMaxAttempts)),this.options={timeout:5e3,withCredentials:!1,...n},this.node&&!this.options.httpsAgent&&(this.options.httpsAgent=new _ae.Agent({keepAlive:!0,keepAliveMsecs:3e3})),this.setBaseURL(this.options.baseURL||`https://video.stream-io-api.com/video`),this.axiosInstance=tp.create({...this.options,baseURL:this.baseURL}
466),this.wsConnection=null,this.wsPromiseSafe=null,this.connectUserTask=null,this.anonymous=!1,this.persistUserOnConnectionFailure=this.options?.persistUserOnConnectionFailure,this.tokenManager=new Sae(this.secret),this.consecutiveFailures=0,this.defaultWSTimeout=this.options.defaultWsTimeout??15e3,this.logger=JA.getLogger(`coordinator`)}get connectionIdPromise(){return this.connectionIdPromiseSafe?.()}get isConnectionIdPromisePending(){return this.connectionIdPromiseSafe?.checkPending()??!1}get wsPromise(){return this.wsPromiseSafe?.()}},RP=(e,t)=>`${e}/${t.id}`,zP=e=>`call.init-${e}`,wae=e=>{let t=e?.clientAppIdentifier||{},n=hM();return n&&(t.sdkName=NO[n.type].toLowerCase(),t.sdkVersion=`${n.major}.${n.minor}.${n.patch}`),t},Tae=(e,t)=>{let n=wae(t);return new Cae(e,{persistUserOnConnectionFailure:!0,...t,clientAppIdentifier:n})},Eae=e=>{let{token:t,tokenProvider:n}=e;if(t&&n){let e=!1;return async function(){return e?n():(e=!0,t)}}return t||n},BP=class e{constructor(t,n){this.effectsRegistered=!1,this.eventHandlersToUnregister=[],this.connectionConcurrencyTag=Symbol(`connectionConcurrencyTag`),this.rejectCallWhenBusy=!1,this.registerClientInstance=(t,n)=>{let r=RP(t,n);e._instances.has(r)&&this.logger.warn(`A StreamVideoClient already exists for ${n.id}; Prefer using getOrCreateInstance method`),e._instances.set(r,this)},this.registerEffects=()=>{this.effectsRegistered||=(this.eventHandlersToUnregister.push(this.on(`call.created`,e=>this.initCallFromEvent(e)),this.on(`call.ring`,e=>this.initCallFromEvent(e)),this.on(`connection.changed`,e=>{if(!e.online)return;let t=this.writeableStateStore.calls.filter(e=>e.watching).map(e=>e.cid);t.length<=0||this.rewatchCalls(t).catch(e=>{this.logger.error(`Failed to re-watch calls`,e)})})),!0)},this.initCallFromEvent=async e=>{try{await lj(zP(e.call_cid),async()=>{let t=e.type===`call.ring`,n=this.writeableStateStore.findCall(e.call.type,e.call.id);if(n){t?this.shouldRejectCall(n.cid)?(this.logger.info(`Leaving call with busy reject reason ${n.cid} because user is busy`),await n.leave(),await n.reject(`busy`)):await n.updateFromRingingEvent(e):n.state.updateFromCallResponse(e.call);return}n=new IP({streamClient:this.streamClient,type:e.call.type,id:e.call.id,members:e.members,clientStore:this.writeableStateStore,ringing:t}),t?this.shouldRejectCall(n.cid)?(this.logger.info(`Rejecting call ${n.cid} because user is busy`),await n.reject(`busy`)):(await n.updateFromRingingEvent(e),await n.get()):(n.state.updateFromCallResponse(e.call),this.writeableStateStore.registerCall(n),this.logger.info(`New call created and registered: ${n.cid}`))})}catch(t){this.logger.error(`Failed to init call from event ${e.type}`,t)}},this.rewatchCalls=async e=>{this.logger.info(`Rewatching calls ${e.join(`, `)}`);for(let t=0;t<3;t++){try{this.logger.info(`Rewatching calls ${e.join(`, `)} attempt ${t+1}`),await this.queryCalls({watch:!0,filter_conditions:{cid:{$in:e}}});return}catch(e){if(e instanceof xO&&e.unrecoverable||(this.logger.warn(`Failed to re-watch calls (attempt ${t+1}/3), retrying.`,e),t===2))throw e}await NA(LA(t))}},this.connectUser=async(e,t)=>{if(e.type===`anonymous`)return e.id=`!anon`,this.connectAnonymousUser(e,t);let n=await lj(this.connectionConcurrencyTag,async()=>{let n=this.streamClient,{onConnectUserError:r,persistUserOnConnectionFailure:i}=n.options,{maxConnectUserRetries:a=5}=n.options;a=Math.max(a,1);let o=[];for(let s=0;s<a;s++)try{return this.logger.trace(`Connecting user (${s})`,e),e.type===`guest`?await n.connectGuestUser(e):await n.connectUser(e,t)}catch(e){if(this.logger.warn(`Failed to connect a user (${s})`,e),o.push(e),s===a-1)throw r?.(e,o),e;i&&await n.disconnectUser(),await NA(LA(s))}});return n?.me&&this.writeableStateStore.setConnectedUser(n.me),this.registerEffects(),n},this.disconnectUser=async t=>{await lj(this.connectionConcurrencyTag,async()=>{let{user:n,key:r}=this.streamClient;n&&(await this.streamClient.disconnectUser(t),n.id&&e._instances.delete(RP(r,n)),this.eventHandlersToUnregister.forEach(e=>e()),this.eventHandlersToUnregister=[],this.effectsRegistered=!1,this.writeableStateStore.setConnectedUser(void 0))})},this.on=(e,t)=>this.streamClient.on(e,t),this.off=(e,t)=>this.streamClient.off(e,t),this.call=(e,t,n={})=>(n.reuseInstance?this.writeableStateStore.findCall(e,t):void 0)??new IP({streamClient:this.streamClient,id:t,type:e,clientStore:this.writeableStateStore}),this.createGuestUser=async e=>this.streamClient.doAxiosRequest(`post`,`/guest`,e,{publicEndpoint:!0}),this.queryCalls=async(e={})=>{let t=await this.streamClient.post(`/calls`,e),n=[];for(let r of t.calls){let t=new IP({streamClient:this.streamClient,id:r.call.id,type:r.call.type,members:r.members,ownCapabilities:r.own_capabilities,watching:e.watch,clientStore:this.writeableStateStore});t.state.updateFromCallResponse(r.call),await t.applyDeviceConfig(r.call.settings,!1,KA()),e.watch&&(await t.setup(),this.writeableStateStore.registerCall(t)),n.push(t)}return{...t,calls:n}},this.queryCallStats=async(e={})=>this.streamClient.post(`/call/stats`,e),this.queryAggregateCallStats=async(e={})=>this.streamClient.post(`/stats`,e),this.edges=async()=>this.streamClient.get(`/edges`),this.addDevice=async(e,t,n,r,i)=>await this.streamClient.post(`/devices`,{id:e,push_provider:t,voip_token:i,...r==null?{}:{user_id:r},...n==null?{}:{push_provider_name:n}}),this.addVoipDevice=async(e,t,n,r)=>await this.addDevice(e,t,n,r,!0),this.getDevices=async e=>await this.streamClient.get(`/devices`,e?{user_id:e}:{}),this.removeDevice=async(e,t)=>await this.streamClient.delete(`/devices`,{id:e,...t?{user_id:t}:{}}),this.onRingingCall=async e=>lj(zP(e),async()=>{let t=this.state.calls.find(t=>t.cid===e&&t.ringing);if(!t){let[n,r]=e.split(`:`);t=new IP({streamClient:this.streamClient,type:n,id:r,clientStore:this.writeableStateStore,ringing:!0}),await t.get()}return t}),this.connectAnonymousUser=async(e,t)=>lj(this.connectionConcurrencyTag,()=>this.streamClient.connectAnonymousUser(e,t)),this.shouldRejectCall=e=>this.rejectCallWhenBusy?this.state.calls.some(t=>t.cid!==e&&t.ringing&&t.state.callingState!==W.IDLE&&t.state.callingState!==W.LEFT&&t.state.callingState!==W.RECONNECTING_FAILED):!1;
466let r=typeof t==`string`?t:t.apiKey,i=typeof t==`string`?n:t.options;i?.enableTimerWorker&&fN();let a=i?.logger||qA;if(JA.configureLoggers({default:{sink:a,level:i?.logLevel||`warn`},...i?.logOptions}),this.logger=JA.getLogger(`client`),this.rejectCallWhenBusy=i?.rejectCallWhenBusy??!1,this.streamClient=Tae(r,i),this.writeableStateStore=new Tj,this.readOnlyStateStore=new Ej(this.writeableStateStore),typeof t!=`string`&&t.user){let e=t.user;e.type===`anonymous`&&(e.id=`!anon`),e.id&&this.registerClientInstance(r,e);let n=Eae(t);this.connectUser(e,n).catch(e=>{this.logger.error(`Failed to connect`,e)})}}static getOrCreateInstance(t){let{apiKey:n,user:r,token:i,tokenProvider:a}=t;if(!r.id&&r.type!==`anonymous`)throw Error(`user.id is required for a non-anonymous user`);if(!i&&!a&&r.type!==`anonymous`&&r.type!==`guest`)throw Error(`tokenProvider or token is required for a authenticated users`);return e._instances.get(RP(n,r))||new e(t)}get state(){return this.readOnlyStateStore}};BP._instances=new Map;var VP=e=>{if(e<1e3)return String(e);for(let{value:t,suffix:n}of[{value:1e9,suffix:`B`},{value:1e6,suffix:`M`},{value:1e3,suffix:`k`}])if(e>=t){let r=e/t,i=+(r<100);return`${r.toFixed(i).replace(/\.0$/g,``)}${n}`}return String(e)},HP=e=>typeof e==`string`,UP=()=>{let e,t,n=new Promise((n,r)=>{e=n,t=r});return n.resolve=e,n.reject=t,n},WP=e=>e==null?``:``+e,Dae=(e,t,n)=>{e.forEach(e=>{t[e]&&(n[e]=t[e])})},Oae=/###/g,GP=e=>e&&e.indexOf(`###`)>-1?e.replace(Oae,`.`):e,KP=e=>!e||HP(e),qP=(e,t,n)=>{let r=HP(t)?t.split(`.`):t,i=0;for(;i<r.length-1;){if(KP(e))return{};let t=GP(r[i]);!e[t]&&n&&(e[t]=new n),e=Object.prototype.hasOwnProperty.call(e,t)?e[t]:{},++i}return KP(e)?{}:{obj:e,k:GP(r[i])}},JP=(e,t,n)=>{let{obj:r,k:i}=qP(e,t,Object);if(r!==void 0||t.length===1){r[i]=n;return}let a=t[t.length-1],o=t.slice(0,t.length-1),s=qP(e,o,Object);for(;s.obj===void 0&&o.length;)a=`${o[o.length-1]}.${a}`,o=o.slice(0,o.length-1),s=qP(e,o,Object),s?.obj&&s.obj[`${s.k}.${a}`]!==void 0&&(s.obj=void 0);s.obj[`${s.k}.${a}`]=n},kae=(e,t,n,r)=>{let{obj:i,k:a}=qP(e,t,Object);i[a]=i[a]||[],i[a].push(n)},YP=(e,t)=>{let{obj:n,k:r}=qP(e,t);if(n&&Object.prototype.hasOwnProperty.call(n,r))return n[r]},Aae=(e,t,n)=>{let r=YP(e,n);return r===void 0?YP(t,n):r},XP=(e,t,n)=>{for(let r in t)r!==`__proto__`&&r!==`constructor`&&(r in e?HP(e[r])||e[r]instanceof String||HP(t[r])||t[r]instanceof String?n&&(e[r]=t[r]):XP(e[r],t[r],n):e[r]=t[r]);return e},ZP=e=>e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,`\\$&`),jae={"&":`&amp;`,"<":`&lt;`,">":`&gt;`,'"':`&quot;`,"'":`&#39;`,"/":`&#x2F;`},Mae=e=>HP(e)?e.replace(/[&<>"'\/]/g,e=>jae[e]):e,Nae=class{constructor(e){this.capacity=e,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(e){let t=this.regExpMap.get(e);if(t!==void 0)return t;let n=new RegExp(e);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(e,n),this.regExpQueue.push(e),n}},Pae=[` `,`,`,`?`,`!`,`;`],Fae=new Nae(20),Iae=(e,t,n)=>{t||=``,n||=``;let r=Pae.filter(e=>t.indexOf(e)<0&&n.indexOf(e)<0);if(r.length===0)return!0;let i=Fae.getRegExp(`(${r.map(e=>e===`?`?`\\?`:e).join(`|`)})`),a=!i.test(e);if(!a){let t=e.indexOf(n);t>0&&!i.test(e.substring(0,t))&&(a=!0)}return a},QP=(e,t,n=`.`)=>{if(!e)return;if(e[t])return Object.prototype.hasOwnProperty.call(e,t)?e[t]:void 0;let r=t.split(n),i=e;for(let e=0;e<r.length;){if(!i||typeof i!=`object`)return;let t,a=``;for(let o=e;o<r.length;++o)if(o!==e&&(a+=n),a+=r[o],t=i[a],t!==void 0){if([`string`,`number`,`boolean`].indexOf(typeof t)>-1&&o<r.length-1)continue;e+=o-e+1;break}i=t}return i},$P=e=>e?.replace(/_/g,`-`),Lae={type:`logger`,log(e){this.output(`log`,e)},warn(e){this.output(`warn`,e)},error(e){this.output(`error`,e)},output(e,t){console?.[e]?.apply?.(console,t)}},eF=new class e{constructor(e,t={}){this.init(e,t)}init(e,t={}){this.prefix=t.prefix||`i18next:`,this.logger=e||Lae,this.options=t,this.debug=t.debug}log(...e){return this.forward(e,`log`,``,!0)}warn(...e){return this.forward(e,`warn`,``,!0)}error(...e){return this.forward(e,`error`,``)}deprecate(...e){return this.forward(e,`warn`,`WARNING DEPRECATED: `,!0)}forward(e,t,n,r){return r&&!this.debug?null:(HP(e[0])&&(e[0]=`${n}${this.prefix} ${e[0]}`),this.logger[t](e))}create(t){return new e(this.logger,{prefix:`${this.prefix}:${t}:`,...this.options})}clone(t){return t||=this.options,t.prefix=t.prefix||this.prefix,new e(this.logger,t)}},tF=class{constructor(){this.observers={}}
466on(e,t){return e.split(` `).forEach(e=>{this.observers[e]||(this.observers[e]=new Map);let n=this.observers[e].get(t)||0;this.observers[e].set(t,n+1)}),this}off(e,t){if(this.observers[e]){if(!t){delete this.observers[e];return}this.observers[e].delete(t)}}emit(e,...t){this.observers[e]&&Array.from(this.observers[e].entries()).forEach(([e,n])=>{for(let r=0;r<n;r++)e(...t)}),this.observers[`*`]&&Array.from(this.observers[`*`].entries()).forEach(([n,r])=>{for(let i=0;i<r;i++)n.apply(n,[e,...t])})}},nF=class extends tF{constructor(e,t={ns:[`translation`],defaultNS:`translation`}){super(),this.data=e||{},this.options=t,this.options.keySeparator===void 0&&(this.options.keySeparator=`.`),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(e){this.options.ns.indexOf(e)<0&&this.options.ns.push(e)}removeNamespaces(e){let t=this.options.ns.indexOf(e);t>-1&&this.options.ns.splice(t,1)}getResource(e,t,n,r={}){let i=r.keySeparator===void 0?this.options.keySeparator:r.keySeparator,a=r.ignoreJSONStructure===void 0?this.options.ignoreJSONStructure:r.ignoreJSONStructure,o;e.indexOf(`.`)>-1?o=e.split(`.`):(o=[e,t],n&&(Array.isArray(n)?o.push(...n):HP(n)&&i?o.push(...n.split(i)):o.push(n)));let s=YP(this.data,o);return!s&&!t&&!n&&e.indexOf(`.`)>-1&&(e=o[0],t=o[1],n=o.slice(2).join(`.`)),s||!a||!HP(n)?s:QP(this.data?.[e]?.[t],n,i)}addResource(e,t,n,r,i={silent:!1}){let a=i.keySeparator===void 0?this.options.keySeparator:i.keySeparator,o=[e,t];
vendor: 10,565 bytes, line 466
466n&&(o=o.concat(a?n.split(a):n)),e.indexOf(`.`)>-1&&(o=e.split(`.`),r=t,t=o[1]),this.addNamespaces(t),JP(this.data,o,r),i.silent||this.emit(`added`,e,t,n,r)}addResources(e,t,n,r={silent:!1}){for(let r in n)(HP(n[r])||Array.isArray(n[r]))&&this.addResource(e,t,r,n[r],{silent:!0});r.silent||this.emit(`added`,e,t,n)}addResourceBundle(e,t,n,r,i,a={silent:!1,skipCopy:!1}){let o=[e,t];e.indexOf(`.`)>-1&&(o=e.split(`.`),r=n,n=t,t=o[1]),this.addNamespaces(t);let s=YP(this.data,o)||{};a.skipCopy||(n=JSON.parse(JSON.stringify(n))),r?XP(s,n,i):s={...s,...n},JP(this.data,o,s),a.silent||this.emit(`added`,e,t,n)}removeResourceBundle(e,t){this.hasResourceBundle(e,t)&&delete this.data[e][t],this.removeNamespaces(t),this.emit(`removed`,e,t)}hasResourceBundle(e,t){return this.getResource(e,t)!==void 0}getResourceBundle(e,t){return t||=this.options.defaultNS,this.getResource(e,t)}getDataByLanguage(e){return this.data[e]}hasLanguageSomeTranslations(e){let t=this.getDataByLanguage(e);return!!(t&&Object.keys(t)||[]).find(e=>t[e]&&Object.keys(t[e]).length>0)}toJSON(){return this.data}},rF={processors:{},addPostProcessor(e){this.processors[e.name]=e},handle(e,t,n,r,i){return e.forEach(e=>{t=this.processors[e]?.process(t,n,r,i)??t}),t}},iF=Symbol(`i18next/PATH_KEY`);function Rae(){let e=[],t=Object.create(null),n;return t.get=(r,i)=>(n?.revoke?.(),i===iF?e:(e.push(i),n=Proxy.revocable(r,t),n.proxy)),Proxy.revocable(Object.create(null),t).proxy}function aF(e,t){let{[iF]:n}=e(Rae()),r=t?.keySeparator??`.`,i=t?.nsSeparator??`:`;if(n.length>1&&i){let e=t?.ns,a=Array.isArray(e)?e:null;if(a&&a.length>1&&a.slice(1).includes(n[0]))return`${n[0]}${i}${n.slice(1).join(r)}`}return n.join(r)}var oF={},sF=e=>!HP(e)&&typeof e!=`boolean`&&typeof e!=`number`,cF=class e extends tF{constructor(e,t={}){super(),Dae([`resourceStore`,`languageUtils`,`pluralResolver`,`interpolator`,`backendConnector`,`i18nFormat`,`utils`],e,this),this.options=t,this.options.keySeparator===void 0&&(this.options.keySeparator=`.`),this.logger=eF.create(`translator`)}changeLanguage(e){e&&(this.language=e)}exists(e,t={interpolation:{}}){let n={...t};if(e==null)return!1;let r=this.resolve(e,n);if(r?.res===void 0)return!1;let i=sF(r.res);return!(n.returnObjects===!1&&i)}extractFromKey(e,t){let n=t.nsSeparator===void 0?this.options.nsSeparator:t.nsSeparator;n===void 0&&(n=`:`);let r=t.keySeparator===void 0?this.options.keySeparator:t.keySeparator,i=t.ns||this.options.defaultNS||[],a=n&&e.indexOf(n)>-1,o=!this.options.userDefinedKeySeparator&&!t.keySeparator&&!this.options.userDefinedNsSeparator&&!t.nsSeparator&&!Iae(e,n,r);if(a&&!o){let t=e.match(this.interpolator.nestingRegexp);if(t&&t.length>0)return{key:e,namespaces:HP(i)?[i]:i};let a=e.split(n);(n!==r||n===r&&this.options.ns.indexOf(a[0])>-1)&&(i=a.shift()),e=a.join(r)}return{key:e,namespaces:HP(i)?[i]:i}}translate(t,n,r){let i=typeof n==`object`?{...n}:n;if(typeof i!=`object`&&this.options.overloadTranslationOptionHandler&&(i=this.options.overloadTranslationOptionHandler(arguments)),typeof i==`object`&&(i={...i}),i||={},t==null)return``;typeof t==`function`&&(t=aF(t,{...this.options,...i})),Array.isArray(t)||(t=[String(t)]),t=t.map(e=>typeof e==`function`?aF(e,{...this.options,...i}):String(e));let a=i.returnDetails===void 0?this.options.returnDetails:i.returnDetails,o=i.keySeparator===void 0?this.options.keySeparator:i.keySeparator,{key:s,namespaces:c}=this.extractFromKey(t[t.length-1],i),l=c[c.length-1],u=i.nsSeparator===void 0?this.options.nsSeparator:i.nsSeparator;u===void 0&&(u=`:`);let d=i.lng||this.language,f=i.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(d?.toLowerCase()===`cimode`)return f?a?{res:`${l}${u}${s}`,usedKey:s,exactUsedKey:s,usedLng:d,usedNS:l,usedParams:this.getUsedParamsDetails(i)}:`${l}${u}${s}`:a?{res:s,usedKey:s,exactUsedKey:s,usedLng:d,usedNS:l,usedParams:this.getUsedParamsDetails(i)}:s;let p=this.resolve(t,i),m=p?.res,h=p?.usedKey||s,g=p?.exactUsedKey||s,_=[`[object Number]`,`[object Function]`,`[object RegExp]`],v=i.joinArrays===void 0?this.options.joinArrays:i.joinArrays,y=!this.i18nFormat||this.i18nFormat.handleAsObject,b=i.count!==void 0&&!HP(i.count),x=e.hasDefaultValue(i),S=b?this.pluralResolver.getSuffix(d,i.count,i):``,C=i.ordinal&&b?this.pluralResolver.getSuffix(d,i.count,{ordinal:!1}):``,w=b&&!i.ordinal&&i.count===0,T=w&&i[`defaultValue${this.options.pluralSeparator}zero`]||i[`defaultValue${S}`]||i[`defaultValue${C}`]||i.defaultValue,E=m;y&&!m&&x&&(E=T);let D=sF(E),O=Object.prototype.toString.apply(E);if(y&&E&&D&&_.indexOf(O)<0&&!(HP(v)&&Array.isArray(E))){if(!i.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn(`accessing an object - but returnObjects options is not enabled!`);let e=this.options.returnedObjectHandler?this.options.returnedObjectHandler(h,E,{...i,ns:c}):`key '${s} (${this.language})' returned an object instead of string.`;return a?(p.res=e,p.usedParams=this.getUsedParamsDetails(i),p):e}if(o){let e=Array.isArray(E),t=e?[]:{},n=e?g:h;for(let e in E)if(Object.prototype.hasOwnProperty.call(E,e)){let r=`${n}${o}${e}`;x&&!m?t[e]=this.translate(r,{...i,defaultValue:sF(T)?T[e]:void 0,joinArrays:!1,ns:c}):t[e]=this.translate(r,{...i,joinArrays:!1,ns:c}),t[e]===r&&(t[e]=E[e])}m=t}}else if(y&&HP(v)&&Array.isArray(m))m=m.join(v),m&&=this.extendTranslation(m,t,i,r);else{let e=!1,n=!1;!this.isValidLookup(m)&&x&&(e=!0,m=T),this.isValidLookup(m)||(n=!0,m=s);let a=(i.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&n?void 0:m,c=x&&T!==m&&this.options.updateMissing;if(n||e||c){if(this.logger.log(c?`updateKey`:`missingKey`,d,l,s,c?T:m),o){let e=this.resolve(s,{...i,keySeparator:!1});e&&e.res&&this.logger.warn(`Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.`)}let e=[],t=this.languageUtils.getFallbackCodes(this.options.fallbackLng,i.lng||this.language);if(this.options.saveMissingTo===`fallback`&&t&&t[0])for(let n=0;n<t.length;n++)e.push(t[n]);else this.options.saveMissingTo===`all`?e=this.languageUtils.toResolveHierarchy(i.lng||this.language):e.push(i.lng||this.language);let n=(e,t,n)=>{let r=x&&n!==m?n:a;this.options.missingKeyHandler?this.options.missingKeyHandler(e,l,t,r,c,i):this.backendConnector?.saveMissing&&this.backendConnector.saveMissing(e,l,t,r,c,i),this.emit(`missingKey`,e,l,t,m)};this.options.saveMissing&&(this.options.saveMissingPlurals&&b?e.forEach(e=>{let t=this.pluralResolver.getSuffixes(e,i);w&&i[`defaultValue${this.options.pluralSeparator}zero`]&&t.indexOf(`${this.options.pluralSeparator}zero`)<0&&t.push(`${this.options.pluralSeparator}zero`),t.forEach(t=>{n([e],s+t,i[`defaultValue${t}`]||T)})}):n(e,s,T))}m=this.extendTranslation(m,t,i,p,r),n&&m===s&&this.options.appendNamespaceToMissingKey&&(m=`${l}${u}${s}`),(n||e)&&this.options.parseMissingKeyHandler&&(m=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${l}${u}${s}`:s,e?m:void 0,i))}return a?(p.res=m,p.usedParams=this.getUsedParamsDetails(i),p):m}extendTranslation(e,t,n,r,i){if(this.i18nFormat?.parse)e=this.i18nFormat.parse(e,{...this.options.interpolation.defaultVariables,...n},n.lng||this.language||r.usedLng,r.usedNS,r.usedKey,{resolved:r});else if(!n.skipInterpolation){n.interpolation&&this.interpolator.init({...n,interpolation:{...this.options.interpolation,...n.interpolation}});let a=HP(e)&&(n?.interpolation?.skipOnVariables===void 0?this.options.interpolation.skipOnVariables:n.interpolation.skipOnVariables),o;if(a){let t=e.match(this.interpolator.nestingRegexp);o=t&&t.length}let s=n.replace&&!HP(n.replace)?n.replace:n;if(this.options.interpolation.defaultVariables&&(s={...this.options.interpolation.defaultVariables,...s}),e=this.interpolator.interpolate(e,s,n.lng||this.language||r.usedLng,n),a){let t=e.match(this.interpolator.nestingRegexp),r=t&&t.length;o<r&&(n.nest=!1)}!n.lng&&r&&r.res&&(n.lng=this.language||r.usedLng),n.nest!==!1&&(e=this.interpolator.nest(e,(...e)=>i?.[0]===e[0]&&!n.context?(this.logger.warn(`It seems you are nesting recursively key: ${e[0]} in key: ${t[0]}`),null):this.translate(...e,t),n)),n.interpolation&&this.interpolator.reset()}let a=n.postProcess||this.options.postProcess,o=HP(a)?[a]:a;return e!=null&&o?.length&&n.applyPostProcessor!==!1&&(e=rF.handle(o,e,t,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...r,usedParams:this.getUsedParamsDetails(n)},...n}:n,this)),e}resolve(e,t={}){let n,r,i,a,o;return HP(e)&&(e=[e]),Array.isArray(e)&&(e=e.map(e=>typeof e==`function`?aF(e,{...this.options,...t}):e)),e.forEach(e=>{if(this.isValidLookup(n))return;let s=this.extractFromKey(e,t),c=s.key;r=c;let l=s.namespaces;this.options.fallbackNS&&(l=l.concat(this.options.fallbackNS));let u=t.count!==void 0&&!HP(t.count),d=u&&!t.ordinal&&t.count===0,f=t.context!==void 0&&(HP(t.context)||typeof t.context==`number`)&&t.context!==``,p=t.lngs?t.lngs:this.languageUtils.toResolveHierarchy(t.lng||this.language,t.fallbackLng);l.forEach(e=>{this.isValidLookup(n)||(o=e,!oF[`${p[0]}-${e}`]&&this.utils?.hasLoadedNamespace&&!this.utils?.hasLoadedNamespace(o)&&(oF[`${p[0]}-${e}`]=!0,this.logger.warn(`key "${r}" for languages "${p.join(`, `)}" won't get resolved as namespace "${o}" was not yet loaded`,`This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!`)),p.forEach(r=>{if(this.isValidLookup(n))return;a=r;let o=[c];if(this.i18nFormat?.addLookupKeys)this.i18nFormat.addLookupKeys(o,c,r,e,t);else{let e;u&&(e=this.pluralResolver.getSuffix(r,t.count,t));let n=`${this.options.pluralSeparator}zero`,i=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(u&&(t.ordinal&&e.indexOf(i)===0&&o.push(c+e.replace(i,this.options.pluralSeparator)),o.push(c+e),d&&o.push(c+n)),f){let r=`${c}${this.options.contextSeparator||`_`}${t.context}`;o.push(r),u&&(t.ordinal&&e.indexOf(i)===0&&o.push(r+e.replace(i,this.options.pluralSeparator)),o.push(r+e),d&&o.push(r+n))}}let s;for(;s=o.pop();)this.isValidLookup(n)||(i=s,n=this.getResource(r,e,s,t))}))})}),{res:n,usedKey:r,exactUsedKey:i,usedLng:a,usedNS:o}}isValidLookup(e){return e!==void 0&&!(!this.options.returnNull&&e===null)&&!(!this.options.returnEmptyString&&e===``)}getResource(e,t,n,r={}){return this.i18nFormat?.getResource?this.i18nFormat.getResource(e,t,n,r):this.resourceStore.getResource(e,t,n,r)}
466getUsedParamsDetails(e={}){let t=[`defaultValue`,`ordinal`,`context`,`replace`,`lng`,`lngs`,`fallbackLng`,`ns`,`keySeparator`,`nsSeparator`,`returnObjects`,`returnDetails`,`joinArrays`,`postProcess`,`interpolation`],n=e.replace&&!HP(e.replace),r=n?e.replace:e;if(n&&e.count!==void 0&&(r.count=e.count),this.options.interpolation.defaultVariables&&(r={...this.options.interpolation.defaultVariables,...r}),!n){r={...r};for(let e of t)delete r[e]}return r}static hasDefaultValue(e){for(let t in e)if(Object.prototype.hasOwnProperty.call(e,t)&&t.substring(0,12)===`defaultValue`&&e[t]!==void 0)return!0;return!1}},lF=class{constructor(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=eF.create(`languageUtils`)}getScriptPartFromCode(e){if(e=$P(e),!e||e.indexOf(`-`)<0)return null;let t=e.split(`-`);return t.length===2||(t.pop(),t[t.length-1].toLowerCase()===`x`)?null:this.formatLanguageCode(t.join(`-`))}getLanguagePartFromCode(e){if(e=$P(e),!e||e.indexOf(`-`)<0)return e;let t=e.split(`-`);return this.formatLanguageCode(t[0])}formatLanguageCode(e){if(HP(e)&&e.indexOf(`-`)>-1){let t;try{t=Intl.getCanonicalLocales(e)[0]}catch{}return t&&this.options.lowerCaseLng&&(t=t.toLowerCase()),t||(this.options.lowerCaseLng?e.toLowerCase():e)}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e}isSupportedCode(e){return(this.options.load===`languageOnly`||this.options.nonExplicitSupportedLngs)&&(e=this.getLanguagePartFromCode(e)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(e)>-1}getBestMatchFromCodes(e){if(!e)return null;let t;return e.forEach(e=>{if(t)return;let n=this.formatLanguageCode(e);(!this.options.supportedLngs||this.isSupportedCode(n))&&(t=n)}),!t&&this.options.supportedLngs&&e.forEach(e=>{if(t)return;let n=this.getScriptPartFromCode(e);if(this.isSupportedCode(n))return t=n;let r=this.getLanguagePartFromCode(e);if(this.isSupportedCode(r))return t=r;t=this.options.supportedLngs.find(e=>{if(e===r||!(e.indexOf(`-`)<0&&r.indexOf(`-`)<0)&&(e.indexOf(`-`)>0&&r.indexOf(`-`)<0&&e.substring(0,e.indexOf(`-`))===r||e.indexOf(r)===0&&r.length>1))return e})}),t||=this.getFallbackCodes(this.options.fallbackLng)[0],t}getFallbackCodes(e,t){if(!e)return[];if(typeof e==`function`&&(e=e(t)),HP(e)&&(e=[e]),Array.isArray(e))return e;if(!t)return e.default||[];let n=e[t];return n||=e[this.getScriptPartFromCode(t)],n||=e[this.formatLanguageCode(t)],n||=e[this.getLanguagePartFromCode(t)],n||=e.default,n||[]}toResolveHierarchy(e,t){let n=this.getFallbackCodes((t===!1?[]:t)||this.options.fallbackLng||[],e),r=[],i=e=>{e&&(this.isSupportedCode(e)?r.push(e):this.logger.warn(`rejecting language code not found in supportedLngs: ${e}`))};return HP(e)&&(e.indexOf(`-`)>-1||e.indexOf(`_`)>-1)?(this.options.load!==`languageOnly`&&i(this.formatLanguageCode(e)),this.options.load!==`languageOnly`&&this.options.load!==`currentOnly`&&i(this.getScriptPartFromCode(e)),this.options.load!==`currentOnly`&&i(this.getLanguagePartFromCode(e))):HP(e)&&i(this.formatLanguageCode(e)),n.forEac
466h(e=>{r.indexOf(e)<0&&i(this.formatLanguageCode(e))}),r}},uF={zero:0,one:1,two:2,few:3,many:4,other:5},dF={select:e=>e===1?`one`:`other`,resolvedOptions:()=>({pluralCategories:[`one`,`other`]})},zae=class{constructor(e,t={}){this.languageUtils=e,this.options=t,this.logger=eF.create(`pluralResolver`),this.pluralRulesCache={}}clearCache(){this.pluralRulesCache={}}getRule(e,t={}){let n=$P(e===`dev`?`en`:e),r=t.ordinal?`ordinal`:`cardinal`,i=JSON.stringify({cleanedCode:n,type:r});if(i in this.pluralRulesCache)return this.pluralRulesCache[i];let a;try{a=new Intl.PluralRules(n,{type:r})}catch{if(typeof Intl>`u`)return this.logger.error(`No Intl support, please use an Intl polyfill!`),dF;if(!e.match(/-|_/))return dF;let n=this.languageUtils.getLanguagePartFromCode(e);a=this.getRule(n,t)}return this.pluralRulesCache[i]=a,a}needsPlural(e,t={}){let n=this.getRule(e,t);return n||=this.getRule(`dev`,t),n?.resolvedOptions().pluralCategories.length>1}getPluralFormsOfKey(e,t,n={}){return this.getSuffixes(e,n).map(e=>`${t}${e}`)}getSuffixes(e,t={}){let n=this.getRule(e,t);return n||=this.getRule(`dev`,t),n?n.resolvedOptions().pluralCategories.sort((e,t)=>uF[e]-uF[t]).map(e=>`${this.options.prepend}${t.ordinal?`ordinal${this.options.prepend}`:``}${e}`):[]}getSuffix(e,t,n={}){let r=this.getRule(e,n);return r?`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:``}${r.select(t)}`:(this.logger.warn(`no plural rule found for: ${e}`),this.getSuffix(`dev`,t,n))}},fF=(e,t,n,r=`.`,i=!0)=>{let a=Aae(e,t,n);return!a&&i&&HP(n)&&(a=QP(e,n,r),a===void 0&&(a=QP(t,n,r))),a},pF=e=>e.replace(/\$/g,`$$$$`),mF=class{constructor(e={}){this.logger=eF.create(`interpolator`),this.options=e,this.format=e?.interpolation?.format||(e=>e),this.init(e)}init(e={}){e.interpolation||={escapeValue:!0};let{escape:t,escapeValue:n,useRawValueToEscape:r,prefix:i,prefixEscaped:a,suffix:o,suffixEscaped:s,formatSeparator:c,unescapeSuffix:l,unescapePrefix:u,nestingPrefix:d,nestingPrefixEscaped:f,nestingSuffix:p,nestingSuffixEscaped:m,nestingOptionsSeparator:h,maxReplaces:g,alwaysFormat:_}=e.interpolation;this.escape=t===void 0?Mae:t,this.escapeValue=n===void 0?!0:n,this.useRawValueToEscape=r===void 0?!1:r,this.prefix=i?ZP(i):a||`{{`,this.suffix=o?ZP(o):s||`}}`,this.formatSeparator=c||`,`,this.unescapePrefix=l?``:u||`-`,this.unescapeSuffix=this.unescapePrefix?``:l||``,this.nestingPrefix=d?ZP(d):f||ZP(`$t(`),this.nestingSuffix=p?ZP(p):m||ZP(`)`),this.nestingOptionsSeparator=h||`,`,this.maxReplaces=g||1e3,this.alwaysFormat=_===void 0?!1:_,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){let e=(e,t)=>e?.source===t?(e.lastIndex=0,e):new RegExp(t,`g`);this.regexp=e(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=e(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=e(this.nestingRegexp,`${this.nestingPrefix}((?:[^()"']+|"[^"]*"|'[^']*'|\\((?:[^()]|"[^"]*"|'[^']*')*\\))*?)${this.nestingSuffix}`)}interpolate(e,t,n,r){let i,a,o,s=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},c=e=>{if(e.indexOf(this.formatSeparator)<0){let i=fF(t,s,e,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(i,void 0,n,{...r,...t,interpolationkey:e}):i}let i=e.split(this.formatSeparator),a=i.shift().trim(),o=i.join(this.formatSeparator).trim();return this.format(fF(t,s,a,this.options.keySeparator,this.options.ignoreJSONStructure),o,n,{...r,...t,interpolationkey:a})};this.resetRegExp();let l=r?.missingInterpolationHandler||this.options.missingInterpolationHandler,u=r?.interpolation?.skipOnVariables===void 0?this.options.interpolation.skipOnVariables:r.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:e=>pF(e)},{regex:this.regexp,safeValue:e=>this.escapeValue?pF(this.escape(e)):pF(e)}].forEach(t=>{for(o=0;i=t.regex.exec(e);){let n=i[1].trim();if(a=c(n),a===void 0)if(typeof l==`function`){let t=l(e,i,r);a=HP(t)?t:``}else if(r&&Object.prototype.hasOwnProperty.call(r,n))a=``;else if(u){a=i[0];continue}else this.logger.warn(`missed to pass in variable ${n} for interpolating ${e}`),a=``;else !HP(a)&&!this.useRawValueToEscape&&(a=WP(a));let s=t.safeValue(a);if(e=e.replace(i[0],s),u?(t.regex.lastIndex+=a.length,t.regex.lastIndex-=i[0].length):t.regex.lastIndex=0,o++,o>=this.maxReplaces)break}}),e}nest(e,t,n={}){let r,i,a,o=(e,t)=>{let n=this.nestingOptionsSeparator;if(e.indexOf(n)<0)return e;let r=e.split(RegExp(`${ZP(n)}[ ]*{`)),i=`{${r[1]}`;e=r[0],i=this.interpolate(i,a);let o=i.match(/'/g),s=i.match(/"/g);((o?.length??0)%2==0&&!s||(s?.length??0)%2!=0)&&(i=i.replace(/'/g,`"`));try{a=JSON.parse(i),t&&(a={...t,...a})}catch(t){return this.logger.warn(`failed parsing options string in nesting for key ${e}`,t),`${e}${n}${i}`}return a.defaultValue&&a.defaultValue.indexOf(this.prefix)>-1&&delete a.defaultValue,e};for(;r=this.nestingRegexp.exec(e);){let s=[];a={...n},a=a.replace&&!HP(a.replace)?a.replace:a,a.applyPostProcessor=!1,delete a.defaultValue;
466let c=/{.*}/.test(r[1])?r[1].lastIndexOf(`}`)+1:r[1].indexOf(this.formatSeparator);if(c!==-1&&(s=r[1].slice(c).split(this.formatSeparator).map(e=>e.trim()).filter(Boolean),r[1]=r[1].slice(0,c)),i=t(o.call(this,r[1].trim(),a),a),i&&r[0]===e&&!HP(i))return i;HP(i)||(i=WP(i)),i||=(this.logger.warn(`missed to resolve ${r[1]} for nesting ${e}`),``),s.length&&(i=s.reduce((e,t)=>this.format(e,t,n.lng,{...n,interpolationkey:r[1].trim()}),i.trim())),e=e.replace(r[0],i),this.regexp.lastIndex=0}return e}},Bae=e=>{let t=e.toLowerCase().trim(),n={};if(e.indexOf(`(`)>-1){let r=e.split(`(`);t=r[0].toLowerCase().trim();let i=r[1].substring(0,r[1].length-1);t===`currency`&&i.indexOf(`:`)<0?n.currency||=i.trim():t===`relativetime`&&i.indexOf(`:`)<0?n.range||=i.trim():i.split(`;`).forEach(e=>{if(e){let[t,...r]=e.split(`:`),i=r.join(`:`).trim().replace(/^'+|'+$/g,``),a=t.trim();n[a]||(n[a]=i),i===`false`&&(n[a]=!1),i===`true`&&(n[a]=!0),isNaN(i)||(n[a]=parseInt(i,10))}})}return{formatName:t,formatOptions:n}},hF=e=>{let t={};return(n,r,i)=>{let a=i;i&&i.interpolationkey&&i.formatParams&&i.formatParams[i.interpolationkey]&&i[i.interpolationkey]&&(a={...a,[i.interpolationkey]:void 0});let o=r+JSON.stringify(a),s=t[o];return s||(s=e($P(r),i),t[o]=s),s(n)}},Vae=e=>(t,n,r)=>e($P(n),r)(t),Hae=class{constructor(e={}){this.logger=eF.create(`formatter`),this.options=e,this.init(e)}init(e,t={interpolation:{}}){this.formatSeparator=t.interpolation.formatSeparator||`,`;let n=t.cacheInBuiltFormats?hF:Vae;this.formats={number:n((e,t)=>{let n=new Intl.NumberFormat(e,{...t});return e=>n.format(e)}),currency:n((e,t)=>{let n=new Intl.NumberFormat(e,{...t,style:`currency`});return e=>n.format(e)}),datetime:n((e,t)=>{let n=new Intl.DateTimeFormat(e,{...t});return e=>n.format(e)}),relativetime:n((e,t)=>{let n=new Intl.RelativeTimeFormat(e,{...t});return e=>n.format(e,t.range||`day`)}),list:n((e,t)=>{let n=new Intl.ListFormat(e,{...t});return e=>n.format(e)})}}add(e,t){this.formats[e.toLowerCase().trim()]=t}addCached(e,t){this.formats[e.toLowerCase().trim()]=hF(t)}format(e,t,n,r={}){let i=t.split(this.formatSeparator);if(i.length>1&&i[0].indexOf(`(`)>1&&i[0].indexOf(`)`)<0&&i.find(e=>e.indexOf(`)`)>-1)){let e=i.findIndex(e=>e.indexOf(`)`)>-1);i[0]=[i[0],...i.splice(1,e)].join(this.formatSeparator)}return i.reduce((e,t)=>{let{formatName:i,formatOptions:a}=Bae(t);if(this.formats[i]){let t=e;try{let o=r?.formatParams?.[r.interpolationkey]||{},s=o.locale||o.lng||r.locale||r.lng||n;t=this.formats[i](e,s,{...a,...r,...o})}catch(e){this.logger.warn(e)}return t}else this.logger.warn(`there was no format function for ${i}`);return e},e)}},Uae=(e,t)=>{e.pending[t]!==void 0&&(delete e.pending[t],e.pendingCount--)},Wae=class extends tF{constructor(e,t,n,r={}){super(),this.backend=e,this.store=t,this.services=n,this.languageUtils=n.languageUtils,this.options=r,this.logger=eF.create(`backendConnector`),this.waitingReads=[],this.maxParallelReads=r.maxParallelReads||10,this.readingCalls=0,this.maxRetries=r.maxRetries>=0?r.maxRetries:5,this.retryTimeout=r.retryTimeout>=1?r.retryTimeout:350,this.state={},this.queue=[],this.backend?.init?.(n,r.backend,r)}queueLoad(e,t,n,r){let i={},a={},o={},s={};return e.forEach(e=>{let r=!0;t.forEach(t=>{let o=`${e}|${t}`;!n.reload&&this.store.hasResourceBundle(e,t)?this.state[o]=2:this.state[o]<0||(this.state[o]===1?a[o]===void 0&&(a[o]=!0):(this.state[o]=1,r=!1,a[o]===void 0&&(a[o]=!0),i[o]===void 0&&(i[o]=!0),s[t]===void 0&&(s[t]=!0)))}),r||(o[e]=!0)}),(Object.keys(i).length||Object.keys(a).length)&&this.queue.push({pending:a,pendingCount:Object.keys(a).length,loaded:{},errors:[],callback:r}),{toLoad:Object.keys(i),pending:Object.keys(a),toLoadLanguages:Object.keys(o),toLoadNamespaces:Object.keys(s)}}loaded(e,t,n){let r=e.split(`|`),i=r[0],a=r[1];t&&this.emit(`failedLoading`,i,a,t),!t&&n&&this.store.addResourceBundle(i,a,n,void 0,void 0,{skipCopy:!0}),this.state[e]=t?-1:2,t&&n&&(this.state[e]=0);let o={};this.queue.forEach(n=>{kae(n.loaded,[i],a),Uae(n,e),t&&n.errors.push(t),n.pendingCount===0&&!n.done&&(Object.keys(n.loaded).forEach(e=>{o[e]||(o[e]={});let t=n.loaded[e];t.length&&t.forEach(t=>{o[e][t]===void 0&&(o[e][t]=!0)})}),n.done=!0,n.errors.length?n.callback(n.errors):n.callback())}
466),this.emit(`loaded`,o),this.queue=this.queue.filter(e=>!e.done)}read(e,t,n,r=0,i=this.retryTimeout,a){if(!e.length)return a(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:e,ns:t,fcName:n,tried:r,wait:i,callback:a});return}this.readingCalls++;let o=(o,s)=>{if(this.readingCalls--,this.waitingReads.length>0){let e=this.waitingReads.shift();this.read(e.lng,e.ns,e.fcName,e.tried,e.wait,e.callback)}if(o&&s&&r<this.maxRetries){setTimeout(()=>{this.read.call(this,e,t,n,r+1,i*2,a)},i);return}a(o,s)},s=this.backend[n].bind(this.backend);if(s.length===2){try{let n=s(e,t);n&&typeof n.then==`function`?n.then(e=>o(null,e)).catch(o):o(null,n)}catch(e){o(e)}return}return s(e,t,o)}prepareLoading(e,t,n={},r){if(!this.backend)return this.logger.warn(`No backend was added via i18next.use. Will not load resources.`),r&&r();HP(e)&&(e=this.languageUtils.toResolveHierarchy(e)),HP(t)&&(t=[t]);let i=this.queueLoad(e,t,n,r);if(!i.toLoad.length)return i.pending.length||r(),null;i.toLoad.forEach(e=>{this.loadOne(e)})}load(e,t,n){this.prepareLoading(e,t,{},n)}reload(e,t,n){this.prepareLoading(e,t,{reload:!0},n)}loadOne(e,t=``){let n=e.split(`|`),r=n[0],i=n[1];this.read(r,i,`read`,void 0,void 0,(n,a)=>{n&&this.logger.warn(`${t}loading namespace ${i} for language ${r} failed`,n),!n&&a&&this.logger.log(`${t}loaded namespace ${i} for language ${r}`,a),this.loaded(e,n,a)})}saveMissing(e,t,n,r,i,a={},o=()=>{}){if(this.services?.utils?.hasLoadedNamespace&&!this.services?.utils?.hasLoadedNamespace(t)){this.logger.warn(`did not save key "${n}" as the namespace "${t}" was not yet loaded`,`This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!`);return}if(!(n==null||n===``)){if(this.backend?.create){let s={...a,isUpdate:i},c=this.backend.create.bind(this.backend);if(c.length<6)try{let i;i=c.length===5?c(e,t,n,r,s):c(e,t,n,r),i&&typeof i.then==`function`?i.then(e=>o(null,e)).catch(o):o(null,i)}catch(e){o(e)}else c(e,t,n,r,o,s)}!e||!e[0]||this.store.addResource(e[0],t,n,r)}}},gF=()=>({debug:!1,initAsync:!0,ns:[`translation`],defaultNS:[`translation`],fallbackLng:[`dev`],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:`all`,preload:!1,simplifyPluralSuffix:!0,keySeparator:`.`,nsSeparator:`:`,pluralSeparator:`_`,contextSeparator:`_`,partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:`fallback`,saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:e=>{let t={};if(typeof e[1]==`object`&&(t=e[1]),HP(e[1])&&(t.defaultValue=e[1]),HP(e[2])&&(t.tDescription=e[2]),typeof e[2]==`object`||typeof e[3]==`object`){let n=e[3]||e[2];Object.keys(n).forEach(e=>{t[e]=n[e]})}return t},interpolation:{escapeValue:!0,format:e=>e,prefix:`{{`,suffix:`}}`,formatSeparator:`,`,unescapePrefix:`-`,nestingPrefix:`$t(`,nestingSuffix:`)`,nestingOptionsSeparator:`,`,maxReplaces:1e3,skipOnVariables:!0},cacheInBuiltFormats:!0}),_F=e=>(HP(e.ns)&&(e.ns=[e.ns]),HP(e.fallbackLng)&&(e.fallbackLng=[e.fallbackLng]),HP(e.fallbackNS)&&(e.fallbackNS=[e.fallbackNS]),e.supportedLngs?.indexOf?.(`cimode`)<0&&(e.supportedLngs=e.supportedLngs.concat([`cimode`])),typeof e.initImmediate==`boolean`&&(e.initAsync=e.initImmediate),e),vF=()=>{},Gae=e=>{Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach(t=>{typeof e[t]==`function`&&(e[t]=e[t].bind(e))})},yF=`__i18next_supportNoticeShown`,Kae=()=>!!(typeof globalThis<`u`&&globalThis[yF]||typeof process<`u`&&{}.I18NEXT_NO_SUPPORT_NOTICE||typeof process<`u`),qae=()=>{typeof globalThis<`u`&&(globalThis[yF]=!0)},Jae=e=>!!(e?.modules?.backend?.name?.indexOf(`Locize`)>0||e?.modules?.backend?.constructor?.name?.indexOf(`Locize`)>0||e?.options?.backend?.backends&&e.options.backend.backends.some(e=>e?.name?.indexOf(`Locize`)>0||e?.constructor?.name?.indexOf(`Locize`)>0)||e?.options?.backend?.projectId||e?.options?.backend?.backendOptions&&e.options.backend.backendOptions.some(e=>e?.projectId)),bF=class e extends tF{constructor(e={},t){if(super(),this.options=_F(e),this.services={},this.logger=eF,this.modules={external:[]},Gae(this),t&&!this.isInitialized&&!e.isClone){if(!this.options.initAsync)return this.init(e,t),this;setTimeout(()=>{this.init(e,t)},0)}}init(e={},t){this.isInitializing=!0,typeof e==`function`&&(t=e,e={}),e.defaultNS==null&&e.ns&&(HP(e.ns)?e.defaultNS=e.ns:e.ns.indexOf(`translation`)<0&&(e.defaultNS=e.ns[0]));let n=gF();this.options={...n,...this.options,..._F(e)},this.options.interpolation={...n.interpolation,...this.options.interpolation},e.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=e.keySeparator),e.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=e.nsSeparator),typeof this.options.overloadTranslationOptionHandler!=`function`&&(this.options.overloadTranslationOptionHandler=n.overloadTranslationOptionHandler),this.options.showSupportNotice!==!1&&!Jae(this)&&!Kae()&&(typeof console<`u`&&console.info!==void 0&&console.info(`🌐 i18next is made possible by our own product, Locize — consider powering your project with managed localization (AI, CDN, integrations): https://locize.com 💙`),qae());let r=e=>
466e?typeof e==`function`?new e:e:null;if(!this.options.isClone){this.modules.logger?eF.init(r(this.modules.logger),this.options):eF.init(null,this.options);let e;e=this.modules.formatter?this.modules.formatter:Hae;let t=new lF(this.options);this.store=new nF(this.options.resources,this.options);let i=this.services;i.logger=eF,i.resourceStore=this.store,i.languageUtils=t,i.pluralResolver=new zae(t,{prepend:this.options.pluralSeparator,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),this.options.interpolation.format&&this.options.interpolation.format!==n.interpolation.format&&this.logger.deprecate(`init: you are still using the legacy format function, please use the new approach: https://www.i18next.com/translation-function/formatting`),e&&(!this.options.interpolation.format||this.options.interpolation.format===n.interpolation.format)&&(i.formatter=r(e),i.formatter.init&&i.formatter.init(i,this.options),this.options.interpolation.format=i.formatter.format.bind(i.formatter)),i.interpolator=new mF(this.options),i.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},i.backendConnector=new Wae(r(this.modules.backend),i.resourceStore,i,this.options),i.backendConnector.on(`*`,(e,...t)=>{this.emit(e,...t)}),this.modules.languageDetector&&(i.languageDetector=r(this.modules.languageDetector),i.languageDetector.init&&i.languageDetector.init(i,this.options.detection,this.options)),this.modules.i18nFormat&&(i.i18nFormat=r(this.modules.i18nFormat),i.i18nFormat.init&&i.i18nFormat.init(this)),this.translator=new cF(this.services,this.options),this.translator.on(`*`,(e,...t)=>{this.emit(e,...t)}),this.modules.external.forEach(e=>{e.init&&e.init(this)})}if(this.format=this.options.interpolation.format,t||=vF,this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){let e=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);e.length>0&&e[0]!==`dev`&&(this.options.lng=e[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn(`init: no languageDetector is used and no lng is defined`),[`getResource`,`hasResourceBundle`,`getResourceBundle`,`getDataByLanguage`].forEach(e=>{this[e]=(...t)=>this.store[e](...t)}),[`addResource`,`addResources`,`addResourceBundle`,`removeResourceBundle`].forEach(e=>{this[e]=(...t)=>(this.store[e](...t),this)});let i=UP(),a=()=>{let e=(e,n)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn(`init: i18next is already initialized. You should call init just once!`),this.isInitialized=!0,this.options.isClone||this.logger.log(`initialized`,this.options),this.emit(`initialized`,this.options),i.resolve(n),t(e,n)};if(this.languages&&!this.isInitialized)return e(null,this.t.bind(this));this.changeLanguage(this.options.lng,e)};return this.options.resources||!this.options.initAsync?a():setTimeout(a,0),i}loadResources(e,t=vF){let n=t,r=HP(e)?e:this.language;if(typeof e==`function`&&(n=e),!this.options.resources||this.options.partialBundledLanguages){if(r?.toLowerCase()===`cimode`&&(!this.options.preload||this.options.preload.length===0))return n();let e=[],t=t=>{t&&t!==`cimode`&&this.services.languageUtils.toResolveHierarchy(t).forEach(t=>{t!==`cimode`&&e.indexOf(t)<0&&e.push(t)})};r?t(r):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(e=>t(e)),this.options.preload?.forEach?.(e=>t(e)),this.services.backendConnector.load(e,this.options.ns,e=>{!e&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),n(e)})}else n(null)}reloadResources(e,t,n){let r=UP();return typeof e==`function`&&(n=e,e=void 0),typeof t==`function`&&(n=t,t=void 0),e||=this.languages,t||=this.options.ns,n||=vF,this.services.backendConnector.reload(e,t,e=>{r.resolve(),n(e)}),r}use(e){if(!e)throw Error(`You are passing an undefined module! Please check the object you are passing to i18next.use()`);if(!e.type)throw Error(`You are passing a wrong module! Please check the object you are passing to i18next.use()`);return e.type===`backend`&&(this.modules.backend=e),(e.type===`logger`||e.log&&e.warn&&e.error)&&(this.modules.logger=e),e.type===`languageDetector`&&(this.modules.languageDetector=e),e.type===`i18nFormat`&&(this.modules.i18nFormat=e),e.type===`postProcessor`&&rF.addPostProcessor(e),e.type===`formatter`&&(this.modules.formatter=e),e.type===`3rdParty`&&this.modules.external.push(e),this}setResolvedLanguage(e){if(!(!e||!this.languages)&&!([`cimode`,`dev`].indexOf(e)>-1)){for(let e=0;e<this.languages.length;e++){let t=this.languages[e];if(!([`cimode`,`dev`].indexOf(t)>-1)&&this.store.hasLanguageSomeTranslations(t)){this.resolvedLanguage=t;break}}!this.resolvedLanguage&&this.languages.indexOf(e)<0&&this.store.hasLanguageSomeTranslations(e)&&(this.resolvedLanguage=e,this.languages.unshift(e))}}changeLanguage(e,t){this.isLanguageChangingTo=e;
vendor: 2,096 bytes, line 466
466let n=UP();this.emit(`languageChanging`,e);let r=e=>{this.language=e,this.languages=this.services.languageUtils.toResolveHierarchy(e),this.resolvedLanguage=void 0,this.setResolvedLanguage(e)},i=(i,a)=>{a?this.isLanguageChangingTo===e&&(r(a),this.translator.changeLanguage(a),this.isLanguageChangingTo=void 0,this.emit(`languageChanged`,a),this.logger.log(`languageChanged`,a)):this.isLanguageChangingTo=void 0,n.resolve((...e)=>this.t(...e)),t&&t(i,(...e)=>this.t(...e))},a=t=>{!e&&!t&&this.services.languageDetector&&(t=[]);let n=HP(t)?t:t&&t[0],a=this.store.hasLanguageSomeTranslations(n)?n:this.services.languageUtils.getBestMatchFromCodes(HP(t)?[t]:t);a&&(this.language||r(a),this.translator.language||this.translator.changeLanguage(a),this.services.languageDetector?.cacheUserLanguage?.(a)),this.loadResources(a,e=>{i(e,a)})};return!e&&this.services.languageDetector&&!this.services.languageDetector.async?a(this.services.languageDetector.detect()):!e&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(a):this.services.languageDetector.detect(a):a(e),n}getFixedT(e,t,n){let r=(e,t,...i)=>{let a;a=typeof t==`object`?{...t}:this.options.overloadTranslationOptionHandler([e,t].concat(i)),a.lng=a.lng||r.lng,a.lngs=a.lngs||r.lngs,a.ns=a.ns||r.ns,a.keyPrefix!==``&&(a.keyPrefix=a.keyPrefix||n||r.keyPrefix);let o={...this.options,...a};typeof a.keyPrefix==`function`&&(a.keyPrefix=aF(a.keyPrefix,o));let s=this.options.keySeparator||`.`,c;return a.keyPrefix&&Array.isArray(e)?c=e.map(e=>(typeof e==`function`&&(e=aF(e,o)),`${a.keyPrefix}${s}${e}`)):(typeof e==`function`&&(e=aF(e,o)),c=a.keyPrefix?`${a.keyPrefix}${s}${e}`:e),this.t(c,a)};return HP(e)?r.lng=e:r.lngs=e,r.ns=t,r.keyPrefix=n,r}t(...e){return this.translator?.translate(...e)}exists(...e){return this.translator?.exists(...e)}setDefaultNamespace(e){this.options.defaultNS=e}hasLoadedNamespace(e,t={}){if(!this.isInitialized)return this.logger.warn(`hasLoadedNamespace: i18next was not initialized`,this.languages),!1;
466if(!this.languages||!this.languages.length)return this.logger.warn(`hasLoadedNamespace: i18n.languages were undefined or empty`,this.languages),!1;let n=t.lng||this.resolvedLanguage||this.languages[0],r=this.options?this.options.fallbackLng:!1,i=this.languages[this.languages.length-1];if(n.toLowerCase()===`cimode`)return!0;let a=(e,t)=>{let n=this.services.backendConnector.state[`${e}|${t}`];return n===-1||n===0||n===2};if(t.precheck){let e=t.precheck(this,a);if(e!==void 0)return e}return!!(this.hasResourceBundle(n,e)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||a(n,e)&&(!r||a(i,e)))}loadNamespaces(e,t){let n=UP();return this.options.ns?(HP(e)&&(e=[e]),e.forEach(e=>{this.options.ns.indexOf(e)<0&&this.options.ns.push(e)}),this.loadResources(e=>{n.resolve(),t&&t(e)}),n):(t&&t(),Promise.resolve())}loadLanguages(e,t){let n=UP();HP(e)&&(e=[e]);let r=this.options.preload||[],i=e.filter(e=>r.indexOf(e)<0&&this.services.languageUtils.isSupportedCode(e));return i.length?(this.options.preload=r.concat(i),this.loadResources(e=>{n.resolve(),t&&t(e)}),n):(t&&t(),Promise.resolve())}dir(e){if(e||=this.resolvedLanguage||(this.languages?.length>0?this.languages[0]:this.language),!e)return`rtl`;try{let t=new Intl.Locale(e);if(t&&t.getTextInfo){let e=t.getTextInfo();if(e&&e.direction)return e.direction}}catch{}let t=`ar.shu.sqr.ssh.xaa.yhd.yud.aao.abh.abv.acm.acq.acw.acx.acy.adf.ads.aeb.aec.afb.ajp.apc.apd.arb.arq.ars.ary.arz.auz.avl.ayh.ayl.ayn.ayp.bbz.pga.he.iw.ps.pbt.pbu.pst.prp.prd.ug.ur.ydd.yds.yih.ji.yi.hbo.men.xmn.fa.jpr.peo.pes.prs.dv.sam.ckb`.split(`.`),n=this.services?.languageUtils||new lF(gF());return e.toLowerCase().indexOf(`-latn`)>1?`ltr`:t.indexOf(n.getLanguagePartFromCode(e))>-1||e.toLowerCase().indexOf(`-arab`)>1?`rtl`:`ltr`}static createInstance(t={},n){let r=new e(t,n);return r.createInstance=e.createInstance,r}cloneInstance(t={},n=vF){let r=t.forkResourceStore;r&&delete t.forkResourceStore;let i={...this.options,...t,isClone:!0},a=new e(i);if((t.debug!==void 0||t.prefix!==void 0)&&(a.logger=a.logger.clone(t)),[`store`,`services`,`language`].forEach(e=>{a[e]=this[e]}),a.services={...this.services},a.services.utils={hasLoadedNamespace:a.hasLoadedNamespace.bind(a)},r&&(a.store=new nF(Object.keys(this.store.data).reduce((e,t)=>(e[t]={...this.store.data[t]},e[t]=Object.keys(e[t]).reduce((n,r)=>(n[r]={...e[t][r]},n),e[t]),e),{}),i),a.services.resourceStore=a.store),t.interpolation){let e={...gF().interpolation,...this.options.interpolation,...t.interpolation},n={...i,interpolation:e};a.services.interpolator=new mF(n)}return a.translator=new cF(a.services,i),a.translator.on(`*`,(e,...t)=>{a.emit(e,...t)}),a.init(i,n),a.translator.options=i,a.translator.backendConnector.services.utils={hasLoadedNamespace:a.hasLoadedNamespace.bind(a)},a}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}.createInstance();bF.createInstance,bF.dir,bF.init,bF.loadResources,bF.reloadResources,bF.use,bF.changeLanguage,bF.getFixedT,bF.t,bF.exists,bF.setDefaultNamespace,bF.hasLoadedNamespace,bF.loadNamespaces,bF.loadLanguages;var xF=(0,d.createContext)(void 0),Yae=e=>{let{call:t,children:n}=e;return(0,R.jsx)(xF.Provider,{value:t,children:n})},SF=()=>(0,d.useContext)(xF),Xae=(e,t)=>Object.entries(e).reduce((e,[n,r])=>(e[n]={[t]:r},e),{}),CF=e=>e,Zae=class{constructor({debug:e=!1,currentLanguage:t=`en`,fallbackLanguage:n,translationsOverrides:r={en:{}}
466}={}){this.t=CF,this.init=async()=>(this.t=await this.i18nInstance.init(),this.t),this.changeLanguage=async e=>(this.t=await this.i18nInstance.changeLanguage(e),this.t);let i=`stream-video`;this.i18nInstance=bF.createInstance({debug:e,defaultNS:i,fallbackLng:n,interpolation:{escapeValue:!1},keySeparator:!1,lng:t,nsSeparator:!1,parseMissingKeyHandler:CF,resources:Xae(r,i)})}get currentLanguage(){return this.i18nInstance.language}get isInitialized(){return this.i18nInstance.isInitialized}},wF=(0,d.createContext)({t:CF}),Qae=({children:e,...t})=>{let n=$ae(t);return(0,R.jsx)(wF.Provider,{value:n,children:e})},$ae=({i18nInstance:e,language:t,fallbackLanguage:n,translationsOverrides:r})=>{let[i]=(0,d.useState)(()=>e||new Zae({currentLanguage:t,fallbackLanguage:n,translationsOverrides:r})),[a,o]=(0,d.useState)(()=>i.t);return(0,d.useEffect)(()=>{i.isInitialized?i.currentLanguage!==t&&i.changeLanguage(t).then(()=>o(()=>i.t)):i.init().then(()=>o(()=>i.t))},[i,t]),(0,d.useMemo)(()=>({i18n:i,t:a}),[i,a])},TF=()=>(0,d.useContext)(wF),eoe=(0,d.createContext)(void 0),toe=({children:e,client:t,i18nInstance:n,language:r,translationsOverrides:i})=>(0,R.jsx)(eoe.Provider,{value:t,children:(0,R.jsx)(Qae,{i18nInstance:n,language:r,translationsOverrides:i,children:e})}),noe=()=>typeof navigator>`u`?!1:navigator.product?.toLowerCase()===`reactnative`,EF=(e,t)=>{let[n,r]=(0,d.useState)(()=>{try{return wj.getCurrentValue(e)}catch(e){if(t===void 0)throw e;return t}});return(0,d.useEffect)(()=>wj.createSubscription(e,r,e=>{console.log(`An error occurred while reading an observable`,e),t&&r(t)}),[t,e]),n},DF=Object.freeze([]),OF=()=>{let e=SF();return e?e.state:(console.warn(`You are using useCallState() outside a Call context. Please wrap your component in <StreamCall /> and provide a "call" instance.`),new eM)},kF=()=>{let{recording$:e}=OF();return EF(e)},roe=()=>{let{rawRecording$:e}=OF();return EF(e)},ioe=()=>{let{individualRecording$:e}=OF();return EF(e)},aoe=()=>{let{egress$:e}=OF(),t=EF(e);return t?t.broadcasting:!1},ooe=()=>{let{backstage$:e}=OF();return!EF(e)},soe=()=>{let{blockedUserIds$:e}=OF();return EF(e)},coe=()=>{let{createdAt$:e}=OF();return EF(e)},loe=()=>{let{endedAt$:e}=OF();return EF(e)},uoe=()=>{let{startsAt$:e}=OF();return EF(e)},doe=()=>{let{updatedAt$:e}=OF();return EF(e)},foe=()=>{let{createdBy$:e}=OF();return EF(e)},poe=()=>{let{custom$:e}=OF();return EF(e)},moe=()=>{let{egress$:e}=OF();return EF(e)},hoe=()=>{let{ingress$:e}=OF();return EF(e)},goe=()=>{let{session$:e}=OF();return EF(e)},_oe=()=>{let{settings$:e}=OF();return EF(e)},voe=()=>{let{transcribing$:e}=OF();return EF(e)},yoe=()=>{let{endedBy$:e}=OF();return EF(e)},boe=()=>{let{hasOngoingScreenShare$:e}=OF();return EF(e)},xoe=()=>{let{callStatsReport$:e}=OF();return EF(e)},Soe=()=>{let{dominantSpeaker$:e}=OF();return EF(e)},Coe=()=>{let{members$:e}=OF();return EF(e)},woe=()=>{let{callingState$:e}=OF();return EF(e)},Toe=()=>{let{startedAt$:e}=OF();return EF(e)},Eoe=({sortBy:e}={})=>{let{participants$:t}=OF(),n=EF(t);return(0,d.useMemo)(()=>e?[...n].sort(e):n,[n,e])},Doe=()=>{let{rawParticipants$:e}=OF();return EF(e)},Ooe=()=>{let{localParticipant$:e}=OF();return EF(e)},koe=()=>{let{remoteParticipants$:e}=OF();return EF(e)},Aoe=()=>{let{pinnedParticipants$:e}=OF();return EF(e)},joe=()=>{let{participantCount$:e}=OF();return EF(e)},Moe=()=>{let{anonymousParticipantCount$:e}=OF();return EF(e)},Noe=()=>{let{thumbnails$:e}=OF();return EF(e)},AF=()=>{let{ownCapabilities$:e}=OF();return EF(e)},Poe=(...e)=>{let t=AF();return e.every(e=>t?.includes(e))},Foe=({optimisticUpdates:e=!0}={})=>{let{camera:t}=SF(),{state:n}=t,r=EF(n.direction$),i=EF(n.mediaStream$),a=EF(n.rootMediaStream$),o=EF(n.selectedDevice$),{getDevices:s}=MF(t);return{camera:t,direction:r,mediaStream:i,rootMediaStream:a,get devices(){return s()},hasBrowserPermission:EF(n.hasBrowserPermission$),isPromptingPermission:EF(n.isPromptingPermission$),selectedDevice:o,...jF(EF(n.status$),EF(n.optimisticStatus$),{optimisticUpdates:e})}},Ioe=({optimisticUpdates:e=!0}={})=>{let{microphone:t}=SF(),{state:n}=t,r=EF(n.mediaStream$),i=EF(n.selectedDevice$),{getDevices:a}=MF(t);return{microphone:t,mediaStream:r,get devices(){return a()},selectedDevice:i,hasBrowserPermission:EF(n.hasBrowserPermission$),isPromptingPermission:EF(n.isPromptingPermission$),isSpeakingWhileMuted:EF(n.speakingWhileMuted$),audioBitrateProfile:EF(n.audioBitrateProfile$),...jF(EF(n.status$),EF(n.optimisticStatus$),{optimisticUpdates:e})}},Loe=()=>{if(noe())throw Error(`This feature is not supported in React Native. Please visit https://getstream.io/video/docs/react-native/guides/camera-and-microphone/#speaker-management for more details`);let{speaker:e}=SF(),{getDevices:t}=MF(e),n=EF(e.state.selectedDevice$);return{speaker:e,volume:EF(e.state.volume$),get devices(){return t()},selectedDevice:n,isDeviceSelectionSupported:e.state.isDeviceSelectionSupported}},Roe=({optimisticUpdates:e=!0}={})=>{let{screenShare:t}=SF(),{state:n}=t;return{screenShare:t,mediaStream:EF(n.mediaStream$),audioBitrateProfile:EF(n.audioBitrateProfile$),...jF(EF(n.status$),EF(n.optimisticStatus$),{optimisticUpdates:e})}},zoe=()=>EF(SF().trackSubscriptionManager.incomingVideoSettings$),Boe=FD(!1),Voe=()=>EF(SF()?.blockedAudioTracker.autoplayBlocked$??Boe),Hoe=()=>{let{closedCaptions$:e}=OF();return EF(e)},Uoe=()=>{let{captioning$:e}=OF();return EF(e)};
466function jF(e,t,n){let r=t??e;return{status:e,optimisticStatus:r,isEnabled:e===`enabled`,isMute:e!==`enabled`,optimisticIsMute:r!==`enabled`,isTogglePending:r!==e,optionsAwareIsMute:n.optimisticUpdates?r!==`enabled`:e!==`enabled`}}function MF(e){let t=(0,d.useMemo)(()=>FD(DF),[]),[n,r]=(0,d.useState)(t),i=EF(n,DF);return{getDevices:()=>(n===t&&r(e.listDevices()),i??DF)}}var Woe=Object.freeze({__proto__:null,useAnonymousParticipantCount:Moe,useCallBlockedUserIds:soe,useCallCallingState:woe,useCallClosedCaptions:Hoe,useCallCreatedAt:coe,useCallCreatedBy:foe,useCallCustomData:poe,useCallEgress:moe,useCallEndedAt:loe,useCallEndedBy:yoe,useCallIngress:hoe,useCallMembers:Coe,useCallSession:goe,useCallSettings:_oe,useCallStartedAt:Toe,useCallStartsAt:uoe,useCallState:OF,useCallStatsReport:xoe,useCallThumbnail:Noe,useCallUpdatedAt:doe,useCameraState:Foe,useDominantSpeaker:Soe,useHasOngoingScreenShare:boe,useHasPermissions:Poe,useIncomingVideoSettings:zoe,useIsAutoplayBlocked:Voe,useIsCallCaptioningInProgress:Uoe,useIsCallHLSBroadcastingInProgress:aoe,useIsCallIndividualRecordingInProgress:ioe,useIsCallLive:ooe,useIsCallRawRecordingInProgress:roe,useIsCallRecordingInProgress:kF,useIsCallTranscribingInProgress:voe,useLocalParticipant:Ooe,useMicrophoneState:Ioe,useOwnCapabilities:AF,useParticipantCount:joe,useParticipants:Eoe,usePinnedParticipants:Aoe,useRawParticipants:Doe,useRemoteParticipants:koe,useScreenShareState:Roe,useSpeakerState:Loe}),Goe=()=>{let e=SF(),t=kF(),[n,r]=(0,d.useState)(!1);return(0,d.useEffect)(()=>{r(e=>e&&!1)},[t]),{toggleCallRecording:(0,d.useCallback)(async()=>{try{r(!0),t?await e?.stopRecording():await e?.startRecording()}catch(e){throw r(!1),e}},[e,t]),isAwaitingResponse:n,isCallRecordingInProgress:t}},Koe=e=>{let t=e.audioStream,n=Aj(e),r=t?.getAudioTracks()[0]?.id,[i,a]=(0,d.useState)(()=>{let e=t?.getAudioTracks()[0];return!!e&&!e.muted});return(0,d.useEffect)(()=>{let e=t?.getAudioTracks()[0];if(!e){a(!1);return}a(!e.muted);let n=()=>{a(!e.muted)};return e.addEventListener(`mute`,n),e.addEventListener(`unmute`,n),()=>{e.removeEventListener(`mute`,n),e.removeEventListener(`unmute`,n)}},[t,r]),n&&!i},NF=()=>Woe,PF=({canRequestOnly:e,hasPermissionsOnly:t,requiredGrants:n,requireAll:r=!0,children:i})=>{let a=SF(),{useCallSettings:o,useOwnCapabilities:s}=NF(),c=s(),l=o(),u=n[r?`every`:`some`](e=>c?.includes(e));if(t)return u?(0,R.jsx)(R.Fragment,{children:i}):null;let d=n.some(e=>a?.permissionsContext.canRequest(e,l));return e?d?(0,R.jsx)(R.Fragment,{children:i}):null:u||d?(0,R.jsx)(R.Fragment,{children:i}):null};function FF(){return typeof window<`u`}function IF(e){return zF(e)?(e.nodeName||``).toLowerCase():`#document`}function LF(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function RF(e){return((zF(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function zF(e){return FF()?e instanceof Node||e instanceof LF(e).Node:!1}function BF(e){return FF()?e instanceof Element||e instanceof LF(e).Element:!1}function VF(e){return FF()?e instanceof HTMLElement||e instanceof LF(e).HTMLElement:!1}function HF(e){return!FF()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof LF(e).ShadowRoot}function UF(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=XF(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function qoe(e){return/^(table|td|th)$/.test(IF(e))}function WF(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var Joe=/transform|translate|scale|rotate|perspective|filter/,Yoe=/paint|layout|strict|content/,GF=e=>!!e&&e!==`none`,KF;function qF(e){let t=BF(e)?XF(e):e;return GF(t.transform)||GF(t.translate)||GF(t.scale)||GF(t.rotate)||GF(t.perspective)||!JF()&&(GF(t.backdropFilter)||GF(t.filter))||Joe.test(t.willChange||``)||Yoe.test(t.contain||``)}function Xoe(e){let t=QF(e);for(;VF(t)&&!YF(t);){if(qF(t))return t;if(WF(t))return null;t=QF(t)}return null}function JF(){return KF??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),KF}function YF(e){return/^(html|body|#document)$/.test(IF(e))}function XF(e){return LF(e).getComputedStyle(e)}function ZF(e){return BF(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function QF(e){if(IF(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||HF(e)&&e.host||RF(e);return HF(t)?t.host:t}function $F(e){let t=QF(e);return YF(t)?e.ownerDocument?e.ownerDocument.body:e.body:VF(t)&&UF(t)?t:$F(t)}function eI(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=$F(e),i=r===e.ownerDocument?.body,a=LF(r);if(i){let e=tI(a);
466return t.concat(a,a.visualViewport||[],UF(r)?r:[],e&&n?eI(e):[])}else return t.concat(r,eI(r,[],n))}function tI(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}var Zoe=[`top`,`right`,`bottom`,`left`],nI=[`start`,`end`],rI=Zoe.reduce((e,t)=>e.concat(t,t+`-`+nI[0],t+`-`+nI[1]),[]),iI=Math.min,aI=Math.max,oI=Math.round,sI=Math.floor,cI=e=>({x:e,y:e}),Qoe={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function lI(e,t,n){return aI(e,iI(t,n))}function uI(e,t){return typeof e==`function`?e(t):e}function dI(e){return e.split(`-`)[0]}function fI(e){return e.split(`-`)[1]}function pI(e){return e===`x`?`y`:`x`}function mI(e){return e===`y`?`height`:`width`}function hI(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function gI(e){return pI(hI(e))}function _I(e,t,n){n===void 0&&(n=!1);let r=fI(e),i=gI(e),a=mI(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=xI(o)),[o,xI(o)]}function $oe(e){let t=xI(e);return[vI(e),t,vI(t)]}function vI(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var yI=[`left`,`right`],bI=[`right`,`left`],ese=[`top`,`bottom`],tse=[`bottom`,`top`];function nse(e,t,n){switch(e){case`top`:case`bottom`:return n?t?bI:yI:t?yI:bI;case`left`:case`right`:return t?ese:tse;default:return[]}}function rse(e,t,n,r){let i=fI(e),a=nse(dI(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(vI)))),a}function xI(e){let t=dI(e);return Qoe[t]+e.slice(t.length)}function ise(e){return{top:0,right:0,bottom:0,left:0,...e}}function SI(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:ise(e)}function CI(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}var wI=[`input:not([inert]):not([inert] *)`,`select:not([inert]):not([inert] *)`,`textarea:not([inert]):not([inert] *)`,`a[href]:not([inert]):not([inert] *)`,`button:not([inert]):not([inert] *)`,`[tabindex]:not(slot):not([inert]):not([inert] *)`,`audio[controls]:not([inert]):not([inert] *)`,`video[controls]:not([inert]):not([inert] *)`,`[contenteditable]:not([contenteditable="false"]):not([inert]):not([inert] *)`,`details>summary:first-of-type:not([inert]):not([inert] *)`,`details:not([inert]):not([inert] *)`].join(`,`),TI=typeof Element>`u`,EI=TI?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,DI=!TI&&Element.prototype.getRootNode?function(e){return e?.getRootNode?.call(e)}:function(e){return e?.ownerDocument},OI=function(e,t){t===void 0&&(t=!0);var n=e?.getAttribute?.call(e,`inert`);return n===``||n===`true`||t&&e&&(typeof e.closest==`function`?e.closest(`[inert]`):OI(e.parentNode))},ase=function(e){var t=e?.getAttribute?.call(e,`contenteditable`);return t===``||t===`true`},kI=function(e,t,n){if(OI(e))return[];var r=Array.prototype.slice.apply(e.querySelectorAll(wI));return t&&EI.call(e,wI)&&r.unshift(e),r=r.filter(n),r},AI=function(e,t,n){for(var r=[],i=Array.from(e);i.length;){var a=i.shift();if(!OI(a,!1))if(a.tagName===`SLOT`){var o=a.assignedElements(),s=AI(o.length?o:a.children,!0,n);
466n.flatten?r.push.apply(r,s):r.push({scopeParent:a,candidates:s})}else{EI.call(a,wI)&&n.filter(a)&&(t||!e.includes(a))&&r.push(a);var c=a.shadowRoot||typeof n.getShadowRoot==`function`&&n.getShadowRoot(a),l=!OI(c,!1)&&(!n.shadowRootFilter||n.shadowRootFilter(a));if(c&&l){var u=AI(c===!0?a.children:c.children,!0,n);n.flatten?r.push.apply(r,u):r.push({scopeParent:a,candidates:u})}else i.unshift.apply(i,a.children)}}return r},jI=function(e){return!isNaN(parseInt(e.getAttribute(`tabindex`),10))},MI=function(e){if(!e)throw Error(`No node provided`);return e.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName)||ase(e))&&!jI(e)?0:e.tabIndex},ose=function(e,t){var n=MI(e);return n<0&&t&&!jI(e)?0:n},sse=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},NI=function(e){return e.tagName===`INPUT`},cse=function(e){return NI(e)&&e.type===`hidden`},lse=function(e){return e.tagName===`DETAILS`&&Array.prototype.slice.apply(e.children).some(function(e){return e.tagName===`SUMMARY`})},use=function(e,t){for(var n=0;n<e.length;n++)if(e[n].checked&&e[n].form===t)return e[n]},dse=function(e){if(!e.name)return!0;var t=e.form||DI(e),n=function(e){return t.querySelectorAll(`input[type="radio"][name="`+e+`"]`)},r;if(typeof window<`u`&&window.CSS!==void 0&&typeof window.CSS.escape==`function`)r=n(window.CSS.escape(e.name));else try{r=n(e.name)}catch(e){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`,e.message),!1}var i=use(r,e.form);return!i||i===e},fse=function(e){return NI(e)&&e.type===`radio`},pse=function(e){return fse(e)&&!dse(e)},mse=function(e){var t=e&&DI(e),n=t?.host,r=!1;if(t&&t!==e){var i,a,o;for(r=!!((i=n)!=null&&(a=i.ownerDocument)!=null&&a.contains(n)||e!=null&&(o=e.ownerDocument)!=null&&o.contains(e));!r&&n;){var s,c;t=DI(n),n=t?.host,r=!!((s=n)!=null&&(c=s.ownerDocument)!=null&&c.contains(n))}}return r},PI=function(e){var t=e.getBoundingClientRect(),n=t.width,r=t.height;return n===0&&r===0},hse=function(e,t){var n=t.displayCheck,r=t.getShadowRoot;if(n===`full-native`&&`checkVisibility`in e)return!e.checkVisibility({checkOpacity:!1,opacityProperty:!1,contentVisibilityAuto:!0,visibilityProperty:!0,checkVisibilityCSS:!0});if(getComputedStyle(e).visibility===`hidden`)return!0;var i=EI.call(e,`details>summary:first-of-type`)?e.parentElement:e;if(EI.call(i,`details:not([open]) *`))return!0;if(!n||n===`full`||n===`full-native`||n===`legacy-full`){if(typeof r==`function`){for(var a=e;e;){var o=e.parentElement,s=DI(e);if(o&&!o.shadowRoot&&r(o)===!0)return PI(e);e=e.assignedSlot?e.assignedSlot:!o&&s!==e.ownerDocument?s.host:o}e=a}if(mse(e))return!e.getClientRects().length;if(n!==`legacy-full`)return!0}else if(n===`non-zero-area`)return PI(e);return!1},gse=function(e){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(e.tagName))for(var t=e.parentElement;t;){if(t.tagName===`FIELDSET`&&t.disabled){for(var n=0;n<t.children.length;n++){var r=t.children.item(n);if(r.tagName===`LEGEND`)return EI.call(t,`fieldset[disabled] *`)?!0:!r.contains(e)}return!0}t=t.parentElement}return!1},FI=function(e,t){return!(t.disabled||cse(t)||hse(t,e)||lse(t)||gse(t))},II=function(e,t){return!(pse(t)||MI(t)<0||!FI(e,t))},_se=function(e){var t=parseInt(e.getAttribute(`tabindex`),10);return!!(isNaN(t)||t>=0)},LI=function(e){var t=[],n=[];return e.forEach(function(e,r){var i=!!e.scopeParent,a=i?e.scopeParent:e,o=ose(a,i),s=i?LI(e.candidates):a;o===0?i?t.push.apply(t,s):t.push(a):n.push({documentOrder:r,tabIndex:o,item:e,isScope:i,content:s})}),n.sort(sse).reduce(function(e,t){return t.isScope?e.push.apply(e,t.content):e.push(t.content),e},[]).concat(t)},RI=function(e,t){return t||={},LI(t.getShadowRoot?AI([e],t.includeContainer,{filter:II.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:_se}):kI(e,t.includeContainer,II.bind(null,t)))},vse=function(e,t){return t||={},t.getShadowRoot?AI([e],t.includeContainer,{filter:FI.bind(null,t),flatten:!0,getShadowRoot:t.getShadowRoot}):kI(e,t.includeContainer,FI.bind(null,t))},zI=function(e,t){if(t||={},!e)throw Error(`No node provided`);return EI.call(e,wI)===!1?!1:II(t,e)};function BI(){let e=navigator.userAgentData;return e!=null&&e.platform?e.platform:navigator.platform}function VI(){let e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(e=>{let{brand:t,version:n}=e;return t+`/`+n}).join(` `):navigator.userAgent}function yse(){return/apple/i.test(navigator.vendor)}function HI(){let e=/android/i;return e.test(BI())||e.test(VI())}function bse(){return VI().includes(`jsdom/`)}var UI=`data-floating-ui-focusable`,xse=`input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])`,WI=`ArrowLeft`,GI=`ArrowRight`,Sse=`ArrowUp`,Cse=`ArrowDown`;function KI(e){let t=e.activeElement;for(;((n=t)==null||(n=n.shadowRoot)==null?void 0:n.activeElement)!=null;){var n;t=t.shadowRoot.activeElement}return t}function qI(e,t){if(!e||!t)return!1;let n=t.getRootNode==null?void 0:t.getRootNode();if(e.contains(t))return!0;
466if(n&&HF(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function JI(e){return`composedPath`in e?e.composedPath()[0]:e.target}function YI(e,t){if(t==null)return!1;if(`composedPath`in e)return e.composedPath().includes(t);let n=e;return n.target!=null&&t.contains(n.target)}function wse(e){return e.matches(`html,body`)}function XI(e){return e?.ownerDocument||document}function ZI(e){return VF(e)&&e.matches(xse)}function QI(e){return e?e.getAttribute(`role`)===`combobox`&&ZI(e):!1}function $I(e){return e?e.hasAttribute(UI)?e:e.querySelector(`[`+UI+`]`)||e:null}function eL(e,t,n){return n===void 0&&(n=!0),e.filter(e=>e.parentId===t&&(!n||e.context?.open)).flatMap(t=>[t,...eL(e,t.id,n)])}function Tse(e,t){let n,r=-1;function i(t,a){a>r&&(n=t,r=a),eL(e,t).forEach(e=>{i(e.id,a+1)})}return i(t,0),e.find(e=>e.id===n)}function tL(e,t){let n=[],r=e.find(e=>e.id===t)?.parentId;for(;r;){let t=e.find(e=>e.id===r);r=t?.parentId,t&&(n=n.concat(t))}return n}function nL(e){e.preventDefault(),e.stopPropagation()}function Ese(e){return`nativeEvent`in e}function rL(e){return e.mozInputSource===0&&e.isTrusted?!0:HI()&&e.pointerType?e.type===`click`&&e.buttons===1:e.detail===0&&!e.pointerType}function iL(e){return bse()?!1:!HI()&&e.width===0&&e.height===0||HI()&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType===`mouse`||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0&&e.pointerType===`touch`}function aL(e,t){let n=[`mouse`,`pen`];return t||n.push(``,void 0),n.includes(e)}var oL=typeof document<`u`?d.useLayoutEffect:function(){},Dse={...d};function sL(e){let t=d.useRef(e);return oL(()=>{t.current=e}),t}var Ose=Dse.useInsertionEffect||(e=>e());function cL(e){let t=d.useRef(()=>{});return Ose(()=>{t.current=e}),d.useCallback(function(){var e=[...arguments];return t.current==null?void 0:t.current(...e)},[])}function lL(e,t,n){return Math.floor(e/t)!==n}function uL(e,t){return t<0||t>=e.current.length}function dL(e,t){return pL(e,{disabledIndices:t})}function fL(e,t){return pL(e,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function pL(e,t){let{startingIndex:n=-1,decrement:r=!1,disabledIndices:i,amount:a=1}=t===void 0?{}:t,o=n;do o+=r?-a:a;while(o>=0&&o<=e.current.length-1&&mL(e,o,i));return o}function kse(e,t){let{event:n,orientation:r,loop:i,rtl:a,cols:o,disabledIndices:s,minIndex:c,maxIndex:l,prevIndex:u,stopEvent:d=!1}=t,f=u;if(n.key===Sse){if(d&&nL(n),u===-1)f=l;else if(f=pL(e,{startingIndex:f,amount:o,decrement:!0,disabledIndices:s}),i&&(u-o<c||f<0)){let e=u%o,t=l%o,n=l-(t-e);f=t===e?l:t>e?n:n-o}uL(e,f)&&(f=u)}if(n.key===Cse&&(d&&nL(n),u===-1?f=c:(f=pL(e,{startingIndex:u,amount:o,disabledIndices:s}),i&&u+o>l&&(f=pL(e,{startingIndex:u%o-o,amount:o,disabledIndices:s}))),uL(e,f)&&(f=u)),r===`both`){let t=sI(u/o);n.key===(a?WI:GI)&&(d&&nL(n),u%o===o-1?i&&(f=pL(e,{startingIndex:u-u%o-1,disabledIndices:s})):(f=pL(e,{startingIndex:u,disabledIndices:s}),i&&lL(f,o,t)&&(f=pL(e,{startingIndex:u-u%o-1,disabledIndices:s}))),lL(f,o,t)&&(f=u)),n.key===(a?GI:WI)&&(d&&nL(n),u%o===0?i&&(f=pL(e,{startingIndex:u+(o-u%o),decrement:!0,disabledIndices:s})):(f=pL(e,{startingIndex:u,decrement:!0,disabledIndices:s}),i&&lL(f,o,t)&&(f=pL(e,{startingIndex:u+(o-u%o),decrement:!0,disabledIndices:s}))),lL(f,o,t)&&(f=u));let r=sI(l/o)===t;uL(e,f)&&(f=i&&r?n.key===(a?GI:WI)?l:pL(e,{startingIndex:u-u%o-1,disabledIndices:s}):u)}return f}function Ase(e,t,n){let r=[],i=0;return e.forEach((e,a)=>{let{width:o,height:s}=e,c=!1;for(n&&(i=0);!c;){let e=[];for(let n=0;n<o;n++)for(let r=0;r<s;r++)e.push(i+n+r*t);i%t+o<=t&&e.every(e=>r[e]==null)?(e.forEach(e=>{r[e]=a}),c=!0):i++}}),[...r]}function jse(e,t,n,r,i){if(e===-1)return-1;let a=n.indexOf(e),o=t[e];switch(i){case`tl`:return a;case`tr`:return o?a+o.width-1:a;case`bl`:return o?a+(o.height-1)*r:a;case`br`:return n.lastIndexOf(e)}}function Mse(e,t){return t.flatMap((t,n)=>e.includes(t)?[n]:[])}function mL(e,t,n){if(typeof n==`function`)return n(t);if(n)return n.includes(t);let r=e.current[t];return r==null||r.hasAttribute(`disabled`)||r.getAttribute(`aria-disabled`)===`true`}var hL=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver==`function`&&ResizeObserver.toString().includes(`[native code]`)?`full`:`none`});function gL(e,t){let n=RI(e,hL()),r=n.length;if(r===0)return;let i=KI(XI(e)),a=n.indexOf(i);return n[a===-1?t===1?0:r-1:a+t]}function _L(e){return gL(XI(e).body,1)||e}function vL(e){return gL(XI(e).body,-1)||e}function yL(e,t){let n=t||e.currentTarget,r=e.relatedTarget;return!r||!qI(n,r)}
vendor: 4,344 bytes, line 466
466function Nse(e){RI(e,hL()).forEach(e=>{e.dataset.tabindex=e.getAttribute(`tabindex`)||``,e.setAttribute(`tabindex`,`-1`)})}function bL(e){e.querySelectorAll(`[data-tabindex]`).forEach(e=>{let t=e.dataset.tabindex;delete e.dataset.tabindex,t?e.setAttribute(`tabindex`,t):e.removeAttribute(`tabindex`)})}function xL(e,t,n){let{reference:r,floating:i}=e,a=hI(t),o=gI(t),s=mI(o),c=dI(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,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(fI(t)){case`start`:p[o]-=f*(n&&l?-1:1);break;case`end`:p[o]+=f*(n&&l?-1:1);break}return p}async function Pse(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:s}=e,{boundary:c=`clippingAncestors`,rootBoundary:l=`viewport`,elementContext:u=`floating`,altBoundary:d=!1,padding:f=0}=uI(t,e),p=SI(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=CI(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(m))??!0?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:l,strategy:s})),g=u===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),v=await(i.isElement==null?void 0:i.isElement(_))&&await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1},y=CI(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:_,strategy:s}):g);return{top:(h.top-y.top+p.top)/v.y,bottom:(y.bottom-h.bottom+p.bottom)/v.y,left:(h.left-y.left+p.left)/v.x,right:(y.right-h.right+p.right)/v.x}}var Fse=50,Ise=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:Pse},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=xL(l,r,c),f=r,p=0,m={};for(let n=0;n<a.length;n++){let h=a[n];if(!h)continue;let{name:g,fn:_}=h,{x:v,y,data:b,reset:x}=await _({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:m,rects:l,platform:s,elements:{reference:e,floating:t}});u=v??u,d=y??d,m[g]={...m[g],...b},x&&p<Fse&&(p++,typeof x==`object`&&(x.placement&&(f=x.placement),x.rects&&(l=x.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):x.rects),{x:u,y:d}=xL(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},Lse=e=>({name:`arrow`,options:e,async fn(t){let{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:c}=t,{element:l,padding:u=0}=uI(e,t)||{};if(l==null)return{};let d=SI(u),f={x:n,y:r},p=gI(i),m=mI(p),h=await o.getDimensions(l),g=p===`y`,_=g?`top`:`left`,v=g?`bottom`:`right`,y=g?`clientHeight`:`clientWidth`,b=a.reference[m]+a.reference[p]-f[p]-a.floating[m],x=f[p]-a.reference[p],S=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l)),C=S?S[y]:0;(!C||!await(o.isElement==null?void 0:o.isElement(S)))&&(C=s.floating[y]||a.floating[m]);let w=b/2-x/2,T=C/2-h[m]/2-1,E=iI(d[_],T),D=iI(d[v],T),O=E,k=C-h[m]-D,A=C/2-h[m]/2+w,j=lI(O,A,k),M=!c.arrow&&fI(i)!=null&&A!==j&&a.reference[m]/2-(A<O?E:D)-h[m]/2<0,N=M?A<O?A-O:A-k:0;return{[p]:f[p]+N,data:{[p]:j,centerOffset:A-j-N,...M&&{alignmentOffset:N}},reset:M}}});function Rse(e,t,n){return(e?[...n.filter(t=>fI(t)===e),...n.filter(t=>fI(t)!==e)]:n.filter(e=>dI(e)===e)).filter(n=>e?fI(n)===e||(t?vI(n)!==n:!1):!0)}var zse=function(e){return e===void 0&&(e={}),{name:`autoPlacement`,options:e,async fn(t){let{rects:n,middlewareData:r,placement:i,platform:a,elements:o}=t,{crossAxis:s=!1,alignment:c,allowedPlacements:l=rI,autoAlignment:u=!0,...d}=uI(e,t),f=c!==void 0||l===rI?Rse(c||null,u,l):l,p=await a.detectOverflow(t,d),m=r.autoPlacement?.index||0,h=f[m];if(h==null)return{};let g=_I(h,n,await(a.isRTL==null?void 0:a.isRTL(o.floating)));if(i!==h)return{reset:{placement:f[0]}};let _=[p[dI(h)],p[g[0]],p[g[1]]],v=[...r.autoPlacement?.overflows||[],{placement:h,overflows:_}],y=f[m+1];if(y)return{data:{index:m+1,overflows:v},reset:{placement:y}};let b=v.map(e=>{let t=fI(e.placement);return[e.placement,t&&s?e.overflows.slice(0,2).reduce((e,t)=>
vendor: 4,267 bytes, line 466
466e+t,0):e.overflows[0],e.overflows]}).sort((e,t)=>e[1]-t[1]),x=b.filter(e=>e[2].slice(0,fI(e[0])?2:3).every(e=>e<=0))[0]?.[0]||b[0][0];return x===i?{}:{data:{index:m+1,overflows:v},reset:{placement:x}}}}},Bse=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n;let{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:s,elements:c}=t,{mainAxis:l=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:f=`bestFit`,fallbackAxisSideDirection:p=`none`,flipAlignment:m=!0,...h}=uI(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=dI(r),_=hI(o),v=dI(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[xI(o)]:$oe(o)),x=p!==`none`;!d&&x&&b.push(...rse(o,m,p,y));let S=[o,...b],C=await s.detectOverflow(t,h),w=[],T=i.flip?.overflows||[];if(l&&w.push(C[g]),u){let e=_I(r,a,y);w.push(C[e[0]],C[e[1]])}if(T=[...T,{placement:r,overflows:w}],!w.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=S[e];if(t&&(!(u===`alignment`&&_!==hI(t))||T.every(e=>hI(e.placement)===_?e.overflows[0]>0:!0)))return{data:{index:e,overflows:T},reset:{placement:t}};let n=T.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=T.filter(e=>{if(x){let t=hI(e.placement);return t===_||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o;break}if(r!==n)return{reset:{placement:n}}}return{}}}},Vse=new Set([`left`,`top`]);async function Hse(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=dI(n),s=fI(n),c=hI(n)===`y`,l=Vse.has(o)?-1:1,u=a&&c?-1:1,d=uI(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}var Use=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await Hse(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}},Wse=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i,platform:a}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=uI(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=hI(dI(i)),p=pI(f),m=u[p],h=u[f];if(o){let e=p===`y`?`top`:`left`,t=p===`y`?`bottom`:`right`,n=m+d[e],r=m-d[t];m=lI(n,m,r)}if(s){let e=f===`y`?`top`:`left`,t=f===`y`?`bottom`:`right`,n=h+d[e],r=h-d[t];h=lI(n,h,r)}let g=c.fn({...t,[p]:m,[f]:h});return{...g,data:{x:g.x-n,y:g.y-r,enabled:{[p]:o,[f]:s}}}}}},Gse=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){var n,r;let{placement:i,rects:a,platform:o,elements:s}=t,{apply:c=()=>{},...l}=uI(e,t),u=await o.detectOverflow(t,l),d=dI(i),f=fI(i),p=hI(i)===`y`,{width:m,height:h}=a.floating,g,_;d===`top`||d===`bottom`?(g=d,_=f===(await(o.isRTL==null?void 0:o.isRTL(s.floating))?`start`:`end`)?`left`:`right`):(_=d,g=f===`end`?`top`:`bottom`);let v=h-u.top-u.bottom,y=m-u.left-u.right,b=iI(h-u[g],v),x=iI(m-u[_],y),S=!t.middlewareData.shift,C=b,w=x;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(w=y),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(C=v),S&&!f){let e=aI(u.left,0),t=aI(u.right,0),n=aI(u.top,0),r=aI(u.bottom,0);p?w=m-2*(e!==0||t!==0?e+t:aI(u.left,u.right)):C=h-2*(n!==0||r!==0?n+r:aI(u.top,u.bottom))}await c({...t,availableWidth:w,availableHeight:C});let T=await o.getDimensions(s.floating);return m!==T.width||h!==T.height?{reset:{rects:!0}}:{}}}};function SL(e){let t=XF(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=VF(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=oI(n)!==a||oI(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function CL(e){return BF(e)?e:e.contextElement}function wL(e){let t=CL(e);if(!VF(t))return cI(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=SL(t),o=(a?oI(n.width):n.width)/r,s=(a?oI(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var Kse=cI(0);function TL(e){let t=LF(e);
vendor: 5,800 bytes, line 466
466return!JF()||!t.visualViewport?Kse:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function qse(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==LF(e)?!1:t}function EL(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=CL(e),o=cI(1);t&&(r?BF(r)&&(o=wL(r)):o=wL(e));let s=qse(a,n,r)?TL(a):cI(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a){let e=LF(a),t=r&&BF(r)?LF(r):r,n=e,i=tI(n);for(;i&&r&&t!==n;){let e=wL(i),t=i.getBoundingClientRect(),r=XF(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=o,n=LF(i),i=tI(n)}}return CI({width:u,height:d,x:c,y:l})}function DL(e,t){let n=ZF(e).scrollLeft;return t?t.left+n:EL(RF(e)).left+n}function OL(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-DL(e,n),y:n.top+t.scrollTop}}function Jse(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=RF(r),s=t?WF(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=cI(1),u=cI(0),d=VF(r);if((d||!d&&!a)&&((IF(r)!==`body`||UF(o))&&(c=ZF(r)),d)){let e=EL(r);l=wL(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?OL(o,c):cI(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function Yse(e){return Array.from(e.getClientRects())}function Xse(e){let t=RF(e),n=ZF(e),r=e.ownerDocument.body,i=aI(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=aI(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight),o=-n.scrollLeft+DL(e),s=-n.scrollTop;return XF(r).direction===`rtl`&&(o+=aI(t.clientWidth,r.clientWidth)-i),{width:i,height:a,x:o,y:s}}var kL=25;function Zse(e,t){let n=LF(e),r=RF(e),i=n.visualViewport,a=r.clientWidth,o=r.clientHeight,s=0,c=0;if(i){a=i.width,o=i.height;let e=JF();(!e||e&&t===`fixed`)&&(s=i.offsetLeft,c=i.offsetTop)}let l=DL(r);if(l<=0){let e=r.ownerDocument,t=e.body,n=getComputedStyle(t),i=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,o=Math.abs(r.clientWidth-t.clientWidth-i);o<=kL&&(a-=o)}else l<=kL&&(a+=l);return{width:a,height:o,x:s,y:c}}function Qse(e,t){let n=EL(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=VF(e)?wL(e):cI(1);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function AL(e,t,n){let r;if(t===`viewport`)r=Zse(e,n);else if(t===`document`)r=Xse(RF(e));else if(BF(t))r=Qse(t,n);else{let n=TL(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return CI(r)}function jL(e,t){let n=QF(e);return n===t||!BF(n)||YF(n)?!1:XF(n).position===`fixed`||jL(n,t)}function $se(e,t){let n=t.get(e);if(n)return n;let r=eI(e,[],!1).filter(e=>BF(e)&&IF(e)!==`body`),i=null,a=XF(e).position===`fixed`,o=a?QF(e):e;for(;BF(o)&&!YF(o);){let t=XF(o),n=qF(o);!n&&t.position===`fixed`&&(i=null),(a?!n&&!i:!n&&t.position===`static`&&i&&(i.position===`absolute`||i.position===`fixed`)||UF(o)&&!n&&jL(e,o))?r=r.filter(e=>e!==o):i=t,o=QF(o)}return t.set(e,r),r}function ece(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?WF(t)?[]:$se(t,this._c):[].concat(n),r],o=AL(t,a[0],i),s=o.top,c=o.right,l=o.bottom,u=o.left;for(let e=1;e<a.length;e++){let n=AL(t,a[e],i);s=aI(n.top,s),c=iI(n.right,c),l=iI(n.bottom,l),u=aI(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function tce(e){let{width:t,height:n}=SL(e);return{width:t,height:n}}function nce(e,t,n){let r=VF(t),i=RF(t),a=n===`fixed`,o=EL(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=cI(0);function l(){c.x=DL(i)}if(r||!r&&!a)if((IF(t)!==`body`||UF(i))&&(s=ZF(t)),r){let e=EL(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}else i&&l();a&&!r&&i&&l();let u=i&&!r&&!a?OL(i,s):cI(0);return{x:o.left+s.scrollLeft-c.x-u.x,y:o.top+s.scrollTop-c.y-u.y,width:o.width,height:o.height}}function ML(e){return XF(e).position===`static`}function NL(e,t){if(!VF(e)||XF(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return RF(e)===n&&(n=n.ownerDocument.body),n}function PL(e,t){let n=LF(e);if(WF(e))return n;if(!VF(e)){let t=QF(e);for(;t&&!YF(t);){if(BF(t)&&!ML(t))return t;t=QF(t)}return n}let r=NL(e,t);for(;r&&qoe(r)&&ML(r);)r=NL(r,t);return r&&YF(r)&&ML(r)&&!qF(r)?n:r||Xoe(e)||n}var rce=async function(e){let t=this.getOffsetParent||PL,n=this.getDimensions,r=await n(e.floating);return{reference:nce(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function ice(e){return XF(e).direction===`rtl`}var ace={convertOffsetParentRelativeRectToViewportRelativeRect:Jse,getDocumentElement:RF,getClippingRect:ece,getOffsetParent:PL,getElementRects:rce,getClientRects:Yse,getDimensions:tce,getScale:wL,isElement:BF,isRTL:ice};function FL(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function oce(e,t){let n=null,r,i=RF(e);function a(){var e;clearTimeout(r),(e=n)==null||e.disconnect(),n=null}function o(s,c){s===void 0&&(s=!1),c===void 0&&(c=1),a();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(s||t(),!f||!p)return;let m=sI(d),h=sI(i.clientWidth-(u+f)),g=sI(i.clientHeight-(d+p)),_=sI(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:aI(0,iI(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(n!==c){if(!y)return o();n?o(!1,n):r=setTimeout(()=>{o(!1,1e-7)},1e3)}n===1&&!FL(l,e.getBoundingClientRect())&&o(),y=!1}try{n=new IntersectionObserver(b,{...v,root:i.ownerDocument})}catch{n=new IntersectionObserver(b,v)}n.observe(e)}return o(!0),a}function IL(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=CL(e),u=i||a?[...l?eI(l):[],...t?eI(t):[]]:[];
466u.forEach(e=>{i&&e.addEventListener(`scroll`,n,{passive:!0}),a&&e.addEventListener(`resize`,n)});let d=l&&s?oce(l,n):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&t&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),t&&p.observe(t));let m,h=c?EL(e):null;c&&g();function g(){let t=EL(e);h&&!FL(h,t)&&n(),h=t,m=requestAnimationFrame(g)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}var sce=Use,cce=zse,lce=Wse,uce=Bse,dce=Gse,LL=Lse,fce=(e,t,n)=>{let r=new Map,i={platform:ace,...n},a={...i.platform,_c:r};return Ise(e,t,{...i,platform:a})},RL=typeof document<`u`?d.useLayoutEffect:function(){};function zL(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e==`function`&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e==`object`){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!zL(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){let n=i[r];if(!(n===`_owner`&&e.$$typeof)&&!zL(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function BL(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function VL(e,t){let n=BL(e);return Math.round(t*n)/n}function HL(e){let t=d.useRef(e);return RL(()=>{t.current=e}),t}function pce(e){e===void 0&&(e={});let{placement:t=`bottom`,strategy:n=`absolute`,middleware:r=[],platform:i,elements:{reference:a,floating:o}={},transform:s=!0,whileElementsMounted:c,open:l}=e,[u,f]=d.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[p,m]=d.useState(r);zL(p,r)||m(r);let[h,g]=d.useState(null),[_,v]=d.useState(null),y=d.useCallback(e=>{e!==C.current&&(C.current=e,g(e))},[]),b=d.useCallback(e=>{e!==w.current&&(w.current=e,v(e))},[]),x=a||h,S=o||_,C=d.useRef(null),w=d.useRef(null),T=d.useRef(u),E=c!=null,D=HL(c),O=HL(i),k=HL(l),A=d.useCallback(()=>{if(!C.current||!w.current)return;let e={placement:t,strategy:n,middleware:p};O.current&&(e.platform=O.current),fce(C.current,w.current,e).then(e=>{let t={...e,isPositioned:k.current!==!1};j.current&&!zL(T.current,t)&&(T.current=t,Dn.flushSync(()=>{f(t)}))})},[p,t,n,O,k]);RL(()=>{l===!1&&T.current.isPositioned&&(T.current.isPositioned=!1,f(e=>({...e,isPositioned:!1})))},[l]);let j=d.useRef(!1);RL(()=>(j.current=!0,()=>{j.current=!1}),[]),RL(()=>{if(x&&(C.current=x),S&&(w.current=S),x&&S){if(D.current)return D.current(x,S,A);A()}},[x,S,A,D,E]);let M=d.useMemo(()=>({reference:C,floating:w,setReference:y,setFloating:b}),[y,b]),N=d.useMemo(()=>({reference:x,floating:S}),[x,S]),P=d.useMemo(()=>{let e={position:n,left:0,top:0};if(!N.floating)return e;let t=VL(N.floating,u.x),r=VL(N.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...BL(N.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,N.floating,u.x,u.y]);return d.useMemo(()=>({...u,update:A,refs:M,elements:N,floatingStyles:P}),[u,A,M,N,P])}var mce=e=>{function t(e){return{}.hasOwnProperty.call(e,`current`)}return{name:`arrow`,options:e,fn(n){let{element:r,padding:i}=typeof e==`function`?e(n):e;return r&&t(r)?r.current==null?{}:LL({element:r.current,padding:i}).fn(n):r?LL({element:r,padding:i}).fn(n):{}}}},UL=(e,t)=>{let n=sce(e);return{name:n.name,fn:n.fn,options:[e,t]}},WL=(e,t)=>{let n=lce(e);return{name:n.name,fn:n.fn,options:[e,t]}},GL=(e,t)=>{let n=uce(e);return{name:n.name,fn:n.fn,options:[e,t]}},KL=(e,t)=>{let n=dce(e);return{name:n.name,fn:n.fn,options:[e,t]}},hce=(e,t)=>{let n=cce(e);return{name:n.name,fn:n.fn,options:[e,t]}},gce=(e,t)=>{let n=mce(e);return{name:n.name,fn:n.fn,options:[e,t]}};function _ce(e,t){let n=e.compareDocumentPosition(t);return n&Node.DOCUMENT_POSITION_FOLLOWING||n&Node.DOCUMENT_POSITION_CONTAINED_BY?-1:n&Node.DOCUMENT_POSITION_PRECEDING||n&Node.DOCUMENT_POSITION_CONTAINS?1:0}var qL=d.createContext({register:()=>{},unregister:()=>{},map:new Map,elementsRef:{current:[]}});function vce(e){let{children:t,elementsRef:n,labelsRef:r}=e,[i,a]=d.useState(()=>new Set),o=d.useCallback(e=>{a(t=>new Set(t).add(e))},[]),s=d.useCallback(e=>{a(t=>{let n=new Set(t);return n.delete(e),n})},[]),c=d.useMemo(()=>{let e=new Map;return Array.from(i.keys()).sort(_ce).forEach((t,n)=>{e.set(t,n)}),e},[i]);return(0,R.jsx)(qL.Provider,{value:d.useMemo(()=>({register:o,unregister:s,map:c,elementsRef:n,labelsRef:r}),[o,s,c,n,r]),children:t})}function yce(e){e===void 0&&(e={});let{label:t}=e,{register:n,unregister:r,map:i,elementsRef:a,labelsRef:o}
466=d.useContext(qL),[s,c]=d.useState(null),l=d.useRef(null),u=d.useCallback(e=>{if(l.current=e,s!==null&&(a.current[s]=e,o)){let n=t!==void 0;o.current[s]=n?t:e?.textContent??null}},[s,a,o,t]);return oL(()=>{let e=l.current;if(e)return n(e),()=>{r(e)}},[n,r]),oL(()=>{let e=l.current?i.get(l.current):null;e!=null&&c(e)},[i]),d.useMemo(()=>({ref:u,index:s??-1}),[s,u])}var bce=`data-floating-ui-focusable`,JL=`active`,YL=`selected`,XL=`ArrowLeft`,ZL=`ArrowRight`,QL=`ArrowUp`,$L=`ArrowDown`,xce=[XL,ZL],Sce=[QL,$L];[...xce,...Sce];var Cce={...d},eR=!1,wce=0,tR=()=>`floating-ui-`+Math.random().toString(36).slice(2,6)+ wce++;function Tce(){let[e,t]=d.useState(()=>eR?tR():void 0);return oL(()=>{e??t(tR())},[]),d.useEffect(()=>{eR=!0},[]),e}var nR=Cce.useId||Tce,Ece=d.forwardRef(function(e,t){let{context:{placement:n,elements:{floating:r},middlewareData:{arrow:i,shift:a}},width:o=14,height:s=7,tipRadius:c=0,strokeWidth:l=0,staticOffset:u,stroke:f,d:p,style:{transform:m,...h}={},...g}=e,_=nR(),[v,y]=d.useState(!1);if(oL(()=>{r&&XF(r).direction===`rtl`&&y(!0)},[r]),!r)return null;let[b,x]=n.split(`-`),S=b===`top`||b===`bottom`,C=u;(S&&a!=null&&a.x||!S&&a!=null&&a.y)&&(C=null);let w=l*2,T=w/2,E=o/2*(c/-8+1),D=s/2*c/4,O=!!p,k=C&&x===`end`?`bottom`:`top`,A=C&&x===`end`?`right`:`left`;C&&v&&(A=x===`end`?`left`:`right`);let j=i?.x==null?``:C||i.x,M=i?.y==null?``:C||i.y,N=p||`M0,0`+(` H`+o)+(` L`+(o-E)+`,`+(s-D))+(` Q`+o/2+`,`+s+` `+E+`,`+(s-D))+` Z`,P={top:O?`rotate(180deg)`:``,left:O?`rotate(90deg)`:`rotate(-90deg)`,bottom:O?``:`rotate(180deg)`,right:O?`rotate(-90deg)`:`rotate(90deg)`}[b];return(0,R.jsxs)(`svg`,{...g,"aria-hidden":!0,ref:t,width:O?o:o+w,height:o,viewBox:`0 0 `+o+` `+(s>o?s:o),style:{position:`absolute`,pointerEvents:`none`,[A]:j,[k]:M,[b]:S||O?`100%`:`calc(100% - `+w/2+`px)`,transform:[P,m].filter(e=>!!e).join(` `),...h},children:[w>0&&(0,R.jsx)(`path`,{clipPath:`url(#`+_+`)`,fill:`none`,stroke:f,strokeWidth:w+ +!p,d:N}),(0,R.jsx)(`path`,{stroke:w&&!p?g.fill:`none`,d:N}),(0,R.jsx)(`clipPath`,{id:_,children:(0,R.jsx)(`rect`,{x:-T,y:T*(O?-1:1),width:o+w,height:o})})]})});function Dce(){let e=new Map;return{emit(t,n){var r;(r=e.get(t))==null||r.forEach(e=>e(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){var r;(r=e.get(t))==null||r.delete(n)}}}var Oce=d.createContext(null),kce=d.createContext(null),rR=()=>d.useContext(Oce)?.id||null,iR=()=>d.useContext(kce);function aR(e){return`data-floating-ui-`+e}function oR(e){e.current!==-1&&(clearTimeout(e.current),e.current=-1)}var sR=0;function cR(e,t){t===void 0&&(t={});let{preventScroll:n=!1,cancelPrevious:r=!0,sync:i=!1}=t;r&&cancelAnimationFrame(sR);let a=()=>e?.focus({preventScroll:n});i?a():sR=requestAnimationFrame(a)}function Ace(e){return e?.ownerDocument||document}var lR={inert:new WeakMap,"aria-hidden":new WeakMap,none:new WeakMap};function uR(e){return e===`inert`?lR.inert:e===`aria-hidden`?lR[`aria-hidden`]:lR.none}var dR=new WeakSet,fR={},pR=0,jce=()=>typeof HTMLElement<`u`&&`inert`in HTMLElement.prototype;function mR(e){return e?HF(e)?e.host:mR(e.parentNode):null}var Mce=(e,t)=>t.map(t=>{if(e.contains(t))return t;let n=mR(t);return e.contains(n)?n:null}).filter(e=>e!=null);function Nce(e,t,n,r){let i=`data-floating-ui-inert`,a=r?`inert`:n?`aria-hidden`:null,o=Mce(t,e),s=new Set,c=new Set(o),l=[];fR[i]||(fR[i]=new WeakMap);let u=fR[i];o.forEach(d),f(t),s.clear();function d(e){!e||s.has(e)||(s.add(e),e.parentNode&&d(e.parentNode))}function f(e){!e||c.has(e)||[].forEach.call(e.children,e=>{if(IF(e)!==`script`)if(s.has(e))f(e);else{let t=a?e.getAttribute(a):null,n=t!==null&&t!==`false`,r=uR(a),o=(r.get(e)||0)+1,s=(u.get(e)||0)+1;r.set(e,o),u.set(e,s),l.push(e),o===1&&n&&dR.add(e),s===1&&e.setAttribute(i,``),!n&&a&&e.setAttribute(a,a===`inert`?``:`true`)}})}return pR++,()=>{l.forEach(e=>{let t=uR(a),n=(t.get(e)||0)-1,r=(u.get(e)||0)-1;t.set(e,n),u.set(e,r),n||(!dR.has(e)&&a&&e.removeAttribute(a),dR.delete(e)),r||e.removeAttribute(i)}),pR--,pR||(lR.inert=new WeakMap,lR[`aria-hidden`]=new WeakMap,lR.none=new WeakMap,dR=new WeakSet,fR={})}}function hR(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!1);let r=Ace(e[0]).body;return Nce(e.concat(Array.from(r.querySelectorAll(`[aria-live],[role="status"],output`))),r,t,n)}var gR={border:0,clip:`rect(0 0 0 0)`,height:`1px`,margin:`-1px`,overflow:`hidden`,padding:0,position:`fixed`,whiteSpace:`nowrap`,width:`1px`,top:0,left:0},_R=d.forwardRef(function(e,t){let[n,r]=d.useState();oL(()=>{yse()&&r(`button`)},[]);let i={ref:t,tabIndex:0,role:n,"aria-hidden":n?void 0:!0,[aR(`focus-guard`)]:``,style:gR};return(0,R.jsx)(`span`,{...e,...i})}),Pce={clipPath:`inset(50%)`,position:`fixed`,top:0,left:0},vR=d.createContext(null),yR=aR(`portal`);function Fce(e){e===void 0&&(e={});let{id:t,root:n}=e,r=nR(),i=bR(),[a,o]=d.useState(null),s=d.useRef(null);return oL(()=>()=>{a?.remove(),queueMicrotask(()=>{s.current=null})},[a]),oL(()=>
466{if(!r||s.current)return;let e=t?document.getElementById(t):null;if(!e)return;let n=document.createElement(`div`);n.id=r,n.setAttribute(yR,``),e.appendChild(n),s.current=n,o(n)},[t,r]),oL(()=>{if(n===null||!r||s.current)return;let e=n||i?.portalNode;e&&!zF(e)&&(e=e.current),e||=document.body;let a=null;t&&(a=document.createElement(`div`),a.id=t,e.appendChild(a));let c=document.createElement(`div`);c.id=r,c.setAttribute(yR,``),e=a||e,e.appendChild(c),s.current=c,o(c)},[t,n,r,i]),a}function Ice(e){let{children:t,id:n,root:r,preserveTabOrder:i=!0}=e,a=Fce({id:n,root:r}),[o,s]=d.useState(null),c=d.useRef(null),l=d.useRef(null),u=d.useRef(null),f=d.useRef(null),p=o?.modal,m=o?.open,h=!!o&&!o.modal&&o.open&&i&&!!(r||a);return d.useEffect(()=>{if(!a||!i||p)return;function e(e){a&&yL(e)&&(e.type===`focusin`?bL:Nse)(a)}return a.addEventListener(`focusin`,e,!0),a.addEventListener(`focusout`,e,!0),()=>{a.removeEventListener(`focusin`,e,!0),a.removeEventListener(`focusout`,e,!0)}},[a,i,p]),d.useEffect(()=>{a&&(m||bL(a))},[m,a]),(0,R.jsxs)(vR.Provider,{value:d.useMemo(()=>({preserveTabOrder:i,beforeOutsideRef:c,afterOutsideRef:l,beforeInsideRef:u,afterInsideRef:f,portalNode:a,setFocusManagerState:s}),[i,a]),children:[h&&a&&(0,R.jsx)(_R,{"data-type":`outside`,ref:c,onFocus:e=>{if(yL(e,a)){var t;(t=u.current)==null||t.focus()}else vL(o?o.domReference:null)?.focus()}}),h&&a&&(0,R.jsx)(`span`,{"aria-owns":a.id,style:Pce}),a&&Dn.createPortal(t,a),h&&a&&(0,R.jsx)(_R,{"data-type":`outside`,ref:l,onFocus:e=>{if(yL(e,a)){var t;(t=f.current)==null||t.focus()}else _L(o?o.domReference:null)?.focus(),o!=null&&o.closeOnFocusOut&&o?.onOpenChange(!1,e.nativeEvent,`focus-out`)}})]})}var bR=()=>d.useContext(vR);function xR(e){return d.useMemo(()=>t=>{e.forEach(e=>{e&&(e.current=t)})},e)}var SR=20,CR=[];function wR(){CR=CR.filter(e=>e.deref()?.isConnected)}function Lce(e){wR(),e&&IF(e)!==`body`&&(CR.push(new WeakRef(e)),CR.length>SR&&(CR=CR.slice(-SR)))}function TR(){return wR(),CR[CR.length-1]?.deref()}function Rce(e){let t=hL();return zI(e,t)?e:RI(e,t)[0]||e}function ER(e,t){var n;if(!t.current.includes(`floating`)&&!((n=e.getAttribute(`role`))!=null&&n.includes(`dialog`)))return;let r=hL(),i=vse(e,r).filter(e=>{let t=e.getAttribute(`data-tabindex`)||``;return zI(e,r)||e.hasAttribute(`data-tabindex`)&&!t.startsWith(`-`)}),a=e.getAttribute(`tabindex`);t.current.includes(`floating`)||i.length===0?a!==`0`&&e.setAttribute(`tabindex`,`0`):(a!==`-1`||e.hasAttribute(`data-tabindex`)&&e.getAttribute(`data-tabindex`)!==`-1`)&&(e.setAttribute(`tabindex`,`-1`),e.setAttribute(`data-tabindex`,`-1`))}var zce=d.forwardRef(function(e,t){return(0,R.jsx)(`button`,{...e,type:`button`,ref:t,tabIndex:-1,style:gR})});function Bce(e){let{context:t,children:n,disabled:r=!1,order:i=[`content`],guards:a=!0,initialFocus:o=0,returnFocus:s=!0,restoreFocus:c=!1,modal:l=!0,visuallyHiddenDismiss:u=!1,closeOnFocusOut:f=!0,outsideElementsInert:p=!1,getInsideElements:m=()=>[]}=e,{open:h,onOpenChange:g,events:_,dataRef:v,elements:{domReference:y,floating:b}}=t,x=cL(()=>v.current.floatingContext?.nodeId),S=cL(m),C=typeof o==`number`&&o<0,w=QI(y)&&C,T=jce(),E=T?a:!0,D=!E||T&&p,O=sL(i),k=sL(o),A=sL(s),j=iR(),M=bR(),N=d.useRef(null),P=d.useRef(null),ee=d.useRef(!1),F=d.useRef(!1),te=d.useRef(-1),ne=d.useRef(-1),re=M!=null,I=$I(b),ie=cL(function(e){return e===void 0&&(e=I),e?RI(e,hL()):[]}),ae=cL(e=>{let t=ie(e);return O.current.map(e=>y&&e===`reference`?y:I&&e===`floating`?I:t).filter(Boolean).flat()});d.useEffect(()=>{if(r||!l)return;function e(e){if(e.key===`Tab`){qI(I,KI(XI(I)))&&ie().length===0&&!w&&nL(e);let t=ae(),n=JI(e);O.current[0]===`reference`&&n===y&&(nL(e),e.shiftKey?cR(t[t.length-1]):cR(t[1])),O.current[1]===`floating`&&n===I&&e.shiftKey&&(nL(e),cR(t[0]))}}let t=XI(I);return t.addEventListener(`keydown`,e),()=>{t.removeEventListener(`keydown`,e)}},[r,y,I,l,O,w,ie,ae]),d.useEffect(()=>{if(r||!b)return;function e(e){let t=JI(e),n=ie().indexOf(t);n!==-1&&(te.current=n)}return b.addEventListener(`focusin`,e),()=>{b.removeEventListener(`focusin`,e)}},[r,b,ie]),d.useEffect(()=>{if(r||!f)return;function e(){F.current=!0,setTimeout(()=>{F.current=!1})}function t(e){let t=e.relatedTarget,n=e.currentTarget,r=JI(e);queueMicrotask(()=>{let i=x(),a=!(qI(y,t)||qI(b,t)||qI(t,b)||qI(M?.portalNode,t)||t!=null&&t.hasAttribute(aR(`focus-guard`))||j&&(eL(j.nodesRef.current,i).find(e=>qI(e.context?.elements.floating,t)||qI(e.context?.elements.domReference,t))||tL(j.nodesRef.current,i).find(e=>[e.context?.elements.floating,$I(e.context?.elements.floating)].includes(t)||e.context?.elements.domReference===t)));if(n===y&&I&&ER(I,O),c&&n!==y&&!(r!=null&&r.isConnected)&&KI(XI(I))===XI(I).body){VF(I)&&I.focus();let e=te.current,t=ie(),n=t[e]||t[t.length-1]||I;VF(n)&&n.focus()}if(v.current.insideReactTree){v.current.insideReactTree=!1;return}(w||!l)&&t&&a&&!F.current&&t!==TR()&&(ee.current=!0,g(!1,e,`focus-out`))})}let n=!!(!j&&M);function i(){oR(ne),v.current.insideReactTree=!0,ne.current=window.setTimeout(()=>{v.current.insideReactTree=!1})}if(b&&VF(y))return y.addEventListener(`focusout`,t),y.addEventListener(`pointerdown`,e),b.addEventListener(`focusout`,t),n&&b.addEventListener(`focusout`,i,!0),()=>{y.removeEventListener(`focusout`,t),y.removeEventListener(`pointerdown`,e),b.removeEventListener(`focusout`,t),n&&b.removeEventListener(`focusout`,i,!0)}},[r,y,b,I,l,j,M,g,f,c,ie,w,x,O,v]);let oe=d.useRef(null),L=d.useRef(null),se=xR([oe,M?.beforeInsideRef]),ce=xR([L,M?.afterInsideRef]);d.useEffect(()=>{var e,t;if(r||!b)return;let n=Array.from((M==null||(e=M.portalNode)==null?void 0:e.querySelectorAll(`[`+
466aR(`portal`)+`]`))||[]),i=[b,(t=(j?tL(j.nodesRef.current,x()):[]).find(e=>QI(e.context?.elements.domReference||null)))==null||(t=t.context)==null?void 0:t.elements.domReference,...n,...S(),N.current,P.current,oe.current,L.current,M?.beforeOutsideRef.current,M?.afterOutsideRef.current,O.current.includes(`reference`)||w?y:null].filter(e=>e!=null),a=l||w?hR(i,!D,D):hR(i);return()=>{a()}},[r,y,b,l,O,M,w,E,D,j,x,S]),oL(()=>{if(r||!VF(I))return;let e=KI(XI(I));queueMicrotask(()=>{let t=ae(I),n=k.current,r=(typeof n==`number`?t[n]:n.current)||I,i=qI(I,e);!C&&!i&&h&&cR(r,{preventScroll:r===I})})},[r,h,I,C,ae,k]),oL(()=>{if(r||!I)return;let e=XI(I);Lce(KI(e));function t(e){let{reason:t,event:n,nested:r}=e;if([`hover`,`safe-polygon`].includes(t)&&n.type===`mouseleave`&&(ee.current=!0),t===`outside-press`)if(r)ee.current=!1;else if(rL(n)||iL(n))ee.current=!1;else{let e=!1;document.createElement(`div`).focus({get preventScroll(){return e=!0,!1}}),e?ee.current=!1:ee.current=!0}}_.on(`openchange`,t);let n=e.createElement(`span`);n.setAttribute(`tabindex`,`-1`),n.setAttribute(`aria-hidden`,`true`),Object.assign(n.style,gR),re&&y&&y.insertAdjacentElement(`afterend`,n);function i(){if(typeof A.current==`boolean`){let e=y||TR();return e&&e.isConnected?e:n}return A.current.current||n}return()=>{_.off(`openchange`,t);let r=KI(e),a=qI(b,r)||j&&eL(j.nodesRef.current,x(),!1).some(e=>qI(e.context?.elements.floating,r)),o=i();queueMicrotask(()=>{let t=Rce(o);A.current&&!ee.current&&VF(t)&&(!(t!==r&&r!==e.body)||a)&&t.focus({preventScroll:!0}),n.remove()})}},[r,b,I,A,v,_,j,re,y,x]),d.useEffect(()=>(queueMicrotask(()=>{ee.current=!1}),()=>{queueMicrotask(wR)}),[r]),oL(()=>{if(!r&&M)return M.setFocusManagerState({modal:l,closeOnFocusOut:f,open:h,onOpenChange:g,domReference:y}),()=>{M.setFocusManagerState(null)}},[r,M,l,h,g,f,y]),oL(()=>{r||I&&ER(I,O)},[r,I,O]);function le(e){return r||!u||!l?null:(0,R.jsx)(zce,{ref:e===`start`?N:P,onClick:e=>g(!1,e.nativeEvent),children:typeof u==`string`?u:`Dismiss`})}let ue=!r&&E&&(l?!w:!0)&&(re||l);return(0,R.jsxs)(R.Fragment,{children:[ue&&(0,R.jsx)(_R,{"data-type":`inside`,ref:se,onFocus:e=>{if(l){let e=ae();cR(i[0]===`reference`?e[0]:e[e.length-1])}else if(M!=null&&M.preserveTabOrder&&M.portalNode)if(ee.current=!1,yL(e,M.portalNode))_L(y)?.focu
466s();else{var t;(t=M.beforeOutsideRef.current)==null||t.focus()}}}),!w&&le(`start`),n,le(`end`),ue&&(0,R.jsx)(_R,{"data-type":`inside`,ref:ce,onFocus:e=>{if(l)cR(ae()[0]);else if(M!=null&&M.preserveTabOrder&&M.portalNode)if(f&&(ee.current=!0),yL(e,M.portalNode))vL(y)?.focus();else{var t;(t=M.afterOutsideRef.current)==null||t.focus()}}})]})}var DR=0,OR=`--floating-ui-scrollbar-width`;function Vce(){let e=BI(),t=/iP(hone|ad|od)|iOS/.test(e)||e===`MacIntel`&&navigator.maxTouchPoints>1,n=document.body.style,r=Math.round(document.documentElement.getBoundingClientRect().left)+document.documentElement.scrollLeft?`paddingLeft`:`paddingRight`,i=window.innerWidth-document.documentElement.clientWidth,a=n.left?parseFloat(n.left):window.scrollX,o=n.top?parseFloat(n.top):window.scrollY;if(n.overflow=`hidden`,n.setProperty(OR,i+`px`),i&&(n[r]=i+`px`),t){let e=window.visualViewport?.offsetLeft||0,t=window.visualViewport?.offsetTop||0;Object.assign(n,{position:`fixed`,top:-(o-Math.floor(t))+`px`,left:-(a-Math.floor(e))+`px`,right:`0`})}return()=>{Object.assign(n,{overflow:``,[r]:``}),n.removeProperty(OR),t&&(Object.assign(n,{position:``,top:``,left:``,right:``}),window.scrollTo(a,o))}}var kR=()=>{},Hce=d.forwardRef(function(e,t){let{lockScroll:n=!1,...r}=e;return oL(()=>{if(n)return DR++,DR===1&&(kR=Vce()),()=>{DR--,DR===0&&kR()}},[n]),(0,R.jsx)(`div`,{ref:t,...r,style:{position:`fixed`,overflow:`auto`,top:0,right:0,bottom:0,left:0,...r.style}})});function AR(e){return VF(e.target)&&e.target.tagName===`BUTTON`}function Uce(e){return VF(e.target)&&e.target.tagName===`A`}function jR(e){return ZI(e)}function Wce(e,t){t===void 0&&(t={});let{open:n,onOpenChange:r,dataRef:i,elements:{domReference:a}}=e,{enabled:o=!0,event:s=`click`,toggle:c=!0,ignoreMouse:l=!1,keyboardHandlers:u=!0,stickIfOpen:f=!0}=t,p=d.useRef(),m=d.useRef(!1),h=d.useMemo(()=>({onPointerDown(e){p.current=e.pointerType},onMouseDown(e){let t=p.current;
466e.button===0&&s!==`click`&&(aL(t,!0)&&l||(n&&c&&(!(i.current.openEvent&&f)||i.current.openEvent.type===`mousedown`)?r(!1,e.nativeEvent,`click`):(e.preventDefault(),r(!0,e.nativeEvent,`click`))))},onClick(e){let t=p.current;if(s===`mousedown`&&p.current){p.current=void 0;return}aL(t,!0)&&l||(n&&c&&(!(i.current.openEvent&&f)||i.current.openEvent.type===`click`)?r(!1,e.nativeEvent,`click`):r(!0,e.nativeEvent,`click`))},onKeyDown(e){p.current=void 0,!(e.defaultPrevented||!u||AR(e))&&(e.key===` `&&!jR(a)&&(e.preventDefault(),m.current=!0),!Uce(e)&&e.key===`Enter`&&r(!(n&&c),e.nativeEvent,`click`))},onKeyUp(e){e.defaultPrevented||!u||AR(e)||jR(a)||e.key===` `&&m.current&&(m.current=!1,r(!(n&&c),e.nativeEvent,`click`))}}),[i,a,s,l,u,r,n,f,c]);return d.useMemo(()=>o?{reference:h}:{},[o,h])}var Gce={pointerdown:`onPointerDown`,mousedown:`onMouseDown`,click:`onClick`},Kce={pointerdown:`onPointerDownCapture`,mousedown:`onMouseDownCapture`,click:`onClickCapture`},MR=e=>({escapeKey:typeof e==`boolean`?e:e?.escapeKey??!1,outsidePress:typeof e==`boolean`?e:e?.outsidePress??!0});function qce(e,t){t===void 0&&(t={});let{open:n,onOpenChange:r,elements:i,dataRef:a}=e,{enabled:o=!0,escapeKey:s=!0,outsidePress:c=!0,outsidePressEvent:l=`pointerdown`,referencePress:u=!1,referencePressEvent:f=`pointerdown`,ancestorScroll:p=!1,bubbles:m,capture:h}=t,g=iR(),_=cL(typeof c==`function`?c:()=>!1),v=typeof c==`function`?_:c,y=d.useRef(!1),{escapeKey:b,outsidePress:x}=MR(m),{escapeKey:S,outsidePress:C}=MR(h),w=d.useRef(!1),T=cL(e=>{if(!n||!o||!s||e.key!==`Escape`||w.current)return;let t=a.current.floatingContext?.nodeId,i=g?eL(g.nodesRef.current,t):[];if(!b&&(e.stopPropagation(),i.length>0)){let e=!0;if(i.forEach(t=>{var n;if((n=t.context)!=null&&n.open&&!t.context.dataRef.current.__escapeKeyBubbles){e=!1;return}}),!e)return}r(!1,Ese(e)?e.nativeEvent:e,`escape-key`)}),E=cL(e=>{var t;let n=()=>{var t;T(e),(t=JI(e))==null||t.removeEventListener(`keydown`,n)};(t=JI(e))==null||t.addEventListener(`keydown`,n)}),D=cL(e=>{let t=a.current.insideReactTree;a.current.insideReactTree=!1;let n=y.current;if(y.current=!1,l===`click`&&n||t||typeof v==`function`&&!v(e))return;let o=JI(e),s=`[`+aR(`inert`)+`]`,c=XI(i.floating).querySelectorAll(s),u=BF(o)?o:null;for(;u&&!YF(u);){let e=QF(u);if(YF(e)||!BF(e))break;u=e}if(c.length&&BF(o)&&!wse(o)&&!qI(o,i.floating)&&Array.from(c).every(e=>!qI(u,e)))return;if(VF(o)&&A){let t=YF(o),n=XF(o),r=/auto|scroll/,i=t||r.test(n.overflowX),a=t||r.test(n.overflowY),s=i&&o.clientWidth>0&&o.scrollWidth>o.clientWidth,c=a&&o.clientHeight>0&&o.scrollHeight>o.clientHeight,l=n.direction===`rtl`,u=c&&(l?e.offsetX<=o.offsetWidth-o.clientWidth:e.offsetX>o.clientWidth),d=s&&e.offsetY>o.clientHeight;if(u||d)return}let d=a.current.floatingContext?.nodeId,f=g&&eL(g.nodesRef.current,d).some(t=>YI(e,t.context?.elements.floating));if(YI(e,i.floating)||YI(e,i.domReference)||f)return;let p=g?eL(g.nodesRef.current,d):[];if(p.length>0){let e=!0;if(p.forEach(t=>{var n;if((n=t.context)!=null&&n.open&&!t.context.dataRef.current.__outsidePressBubbles){e=!1;return}}),!e)return}r(!1,e,`outside-press`)}),O=cL(e=>{var t;let n=()=>{var t;D(e),(t=JI(e))==null||t.removeEventListener(l,n)};(t=JI(e))==null||t.addEventListener(l,n)});d.useEffect(()=>{if(!n||!o)return;a.current.__escapeKeyBubbles=b,a.current.__outsidePressBubbles=x;let e=-1;function t(e){r(!1,e,`ancestor-scroll`)}function c(){window.clearTimeout(e),w.current=!0}function u(){e=window.setTimeout(()=>{w.current=!1},JF()?5:0)}let d=XI(i.floating);s&&(d.addEventListener(`keydown`,S?E:T,S),d.addEventListener(`compositionstart`,c),d.addEventListener(`compositionend`,u)),v&&d.addEventListener(l,C?O:D,C);let f=[];return p&&(BF(i.domReference)&&(f=eI(i.domReference)),BF(i.floating)&&(f=f.concat(eI(i.floating))),!BF(i.reference)&&i.reference&&i.reference.contextElement&&(f=f.concat(eI(i.reference.contextElement)))),f=f.filter(e=>e!==d.defaultView?.visualViewport),f.forEach(e=>{e.addEventListener(`scroll`,t,{passive:!0})}),()=>{s&&(d.removeEventListener(`keydown`,S?E:T,S),d.removeEventListener(`compositionstart`,c),d.removeEventListener(`compositionend`,u)),v&&d.removeEventListener(l,C?O:D,C),f.forEach(e
466=>{e.removeEventListener(`scroll`,t)}),window.clearTimeout(e)}},[a,i,s,v,l,n,r,p,o,b,x,T,S,E,D,C,O]),d.useEffect(()=>{a.current.insideReactTree=!1},[a,v,l]);let k=d.useMemo(()=>({onKeyDown:T,...u&&{[Gce[f]]:e=>{r(!1,e.nativeEvent,`reference-press`)},...f!==`click`&&{onClick(e){r(!1,e.nativeEvent,`reference-press`)}}}}),[T,r,u,f]),A=d.useMemo(()=>{function e(e){e.button===0&&(y.current=!0)}return{onKeyDown:T,onMouseDown:e,onMouseUp:e,[Kce[l]]:()=>{a.current.insideReactTree=!0}}},[T,l,a]);return d.useMemo(()=>o?{reference:k,floating:A}:{},[o,k,A])}function Jce(e){let{open:t=!1,onOpenChange:n,elements:r}=e,i=nR(),a=d.useRef({}),[o]=d.useState(()=>Dce()),s=rR()!=null,[c,l]=d.useState(r.reference),u=cL((e,t,r)=>{a.current.openEvent=e?t:void 0,o.emit(`openchange`,{open:e,event:t,reason:r,nested:s}),n?.(e,t,r)}),f=d.useMemo(()=>({setPositionReference:l}),[]),p=d.useMemo(()=>({reference:c||r.reference||null,floating:r.floating||null,domReference:r.reference}),[c,r.reference,r.floating]);return d.useMemo(()=>({dataRef:a,open:t,onOpenChange:u,elements:p,events:o,floatingId:i,refs:f}),[t,u,p,o,i,f])}function NR(e){e===void 0&&(e={});let{nodeId:t}=e,n=Jce({...e,elements:{reference:null,floating:null,...e.elements}}),r=e.rootContext||n,i=r.elements,[a,o]=d.useState(null),[s,c]=d.useState(null),l=i?.domReference||a,u=d.useRef(null),f=iR();oL(()=>{l&&(u.current=l)},[l]);let p=pce({...e,elements:{...i,...s&&{reference:s}}}),m=d.useCallback(e=>{let t=BF(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),getClientRects:()=>e.getClientRects(),contextElement:e}:e;c(t),p.refs.setReference(t)},[p.refs]),h=d.useCallback(e=>{(BF(e)||e===null)&&(u.current=e,o(e)),(BF(p.refs.reference.current)||p.refs.reference.current===null||e!==null&&!BF(e))&&p.refs.setReference(e)},[p.refs]),g=d.useMemo(()=>({...p.refs,setReference:h,setPositionReference:m,domReference:u}),[p.refs,h,m]),_=d.useMemo(()=>({...p.elements,domReference:l}),[p.elements,l]),v=d.useMemo(()=>({...p,...r,refs:g,elements:_,nodeId:t}),[p,g,_,t,r]);return oL(()=>{r.dataRef.current.floatingContext=v;let e=f?.nodesRef.current.find(e=>e.id===t);e&&(e.context=v)}),d.useMemo(()=>({...p,context:v,refs:g,elements:_}),[p,g,_,v])}function PR(e,t,n){let r=new Map,i=n===`item`,a=e;if(i&&e){let{[JL]:t,[YL]:n,...r}=e;a=r}return{...n===`floating`&&{tabIndex:-1,[bce]:``},...a,...t.map(t=>{let r=t?t[n]:null;return typeof r==`function`?e?r(e):null:r}).concat(e).reduce((e,t)=>(t&&Object.entries(t).forEach(t=>{let[n,a]=t;if(!(i&&[JL,YL].includes(n)))if(n.indexOf(`on`)===0){if(r.has(n)||r.set(n,[]),typeof a==`function`){var o;(o=r.get(n))==null||o.push(a),e[n]=function(){var e=[...arguments];return r.get(n)?.map(t=>t(...e)).find(e=>e!==void 0)}}}else e[n]=a}),e),{})}}function Yce(e){e===void 0&&(e=[]);let t=e.map(e=>e?.reference),n=e.map(e=>e?.floating),r=e.map(e=>e?.item),i=d.useCallback(t=>PR(t,e,`reference`),t),a=d.useCallback(t=>PR(t,e,`floating`),n),o=d.useCallback(t=>PR(t,e,`item`),r);return d.useMemo(()=>({getReferenceProps:i,getFloatingProps:a,getItemProps:o}),[i,a,o])}var Xce=`Escape`;function FR(e,t,n){switch(e){case`vertical`:return t;case`horizontal`:return n;default:return t||n}}function IR(e,t){return FR(t,e===QL||e===$L,e===XL||e===ZL)}function LR(e,t,n){return FR(t,e===$L,n?e===XL:e===ZL)||e===`Enter`||e===` `||e===``}function RR(e,t,n){return FR(t,n?e===XL:e===ZL,e===$L)}function zR(e,t,n,r){return t===`both`||t===`horizontal`&&r&&r>1?e===Xce:FR(t,n?e===ZL:e===XL,e===QL)}function Zce(e,t){let{open:n,onOpenChange:r,elements:i,floatingId:a}=e,{listRef:o,activeIndex:s,onNavigate:c=()=>{},enabled:l=!0,selectedIndex:u=null,allowEscape:f=!1,loop:p=!1,nested:m=!1,rtl:h=!1,virtual:g=!1,focusItemOnOpen:_=`auto`,focusItemOnHover:v=!0,openOnArrowKeyDown:y=!0,disabledIndices:b=void 0,orientation:x=`vertical`,parentOrientation:S,cols:C=1,scrollItemIntoView:w=!0,virtualItemRef:T,itemSizes:E,dense:D=!1}=t,O=sL($I(i.floating)),k=rR(),A=iR();oL(()=>{e.dataRef.current.orientation=x},[e,x]);let j=cL(()=>{c(P.current===-1?null:P.current)}),M=QI(i.domReference),N=d.useRef(_),P=d.useRef(u??-1),ee=d.useRef(null),F=d.useRef(!0),te=d.useRef(j),ne=d.useRef(!!i.floating),re=d.useRef(n),I=d.useRef(!1),ie=d.useRef(!1),ae=sL(b),oe=sL(n),L=sL(w),se=sL(u),[ce,le]=d.useState(),[ue,de]=d.useState(),fe=cL(()=>{function e(e){if(g){var t;(t=e.id)!=null&&t.endsWith(`-fui-option`)&&(e.id=a+`-`+Math.random().toString(16).slice(2,10)),le(e.id),A?.events.emit(`virtualfocus`,e),T&&(T.current=e)}else cR(e,{sync:I.current,preventScroll:!0})}let t=o.current[P.current],n=ie.current;t&&e(t),(I.current?e=>e():requestAnimationFrame)(()=>{let r=o.current[P.current]||t;if(!r)return;t||e(r);let i=L.current;i&&me&&(n||!F.current)&&(r.scrollIntoView==null||r.scrollIntoView(typeof i==`boolean`?{block:`nearest`,inline:`nearest`}:i))})});oL(()=>{l&&(n&&i.floating?N.current&&u!=null&&(ie.current=!0,P.current=u,j()):ne.current&&(P.current=-1,te.current()))},[l,n,i.floating,u,j]),oL(()=>
466{if(l&&n&&i.floating)if(s==null){if(I.current=!1,se.current!=null)return;if(ne.current&&(P.current=-1,fe()),(!re.current||!ne.current)&&N.current&&(ee.current!=null||N.current===!0&&ee.current==null)){let e=0,t=()=>{o.current[0]==null?(e<2&&(e?requestAnimationFrame:queueMicrotask)(t),e++):(P.current=ee.current==null||LR(ee.current,x,h)||m?dL(o,ae.current):fL(o,ae.current),ee.current=null,j())};t()}}else uL(o,s)||(P.current=s,fe(),ie.current=!1)},[l,n,i.floating,s,se,m,o,x,h,j,fe,ae]),oL(()=>{var e;if(!l||i.floating||!A||g||!ne.current)return;let t=A.nodesRef.current,n=(e=t.find(e=>e.id===k))==null||(e=e.context)==null?void 0:e.elements.floating,r=KI(XI(i.floating)),a=t.some(e=>e.context&&qI(e.context.elements.floating,r));n&&!a&&F.current&&n.focus({preventScroll:!0})},[l,i.floating,A,k,g]),oL(()=>{if(!l||!A||!g||k)return;function e(e){de(e.id),T&&(T.current=e)}return A.events.on(`virtualfocus`,e),()=>{A.events.off(`virtualfocus`,e)}},[l,A,g,k,T]),oL(()=>{te.current=j,re.current=n,ne.current=!!i.floating}),oL(()=>{n||(ee.current=null,N.current=_)},[n,_]);let pe=s!=null,me=d.useMemo(()=>{function e(e){if(!oe.current)return;let t=o.current.indexOf(e);t!==-1&&P.current!==t&&(P.current=t,j())}return{onFocus(t){let{currentTarget:n}=t;I.current=!0,e(n)},onClick:e=>{let{currentTarget:t}=e;return t.focus({preventScroll:!0})},onMouseMove(t){let{currentTarget:n}=t;I.current=!0,ie.current=!1,v&&e(n)},onPointerLeave(e){let{pointerType:t}=e;if(!(!F.current||t===`touch`)&&(I.current=!0,v&&(P.current=-1,j(),!g))){var n;(n=O.current)==null||n.focus({preventScroll:!0})}}}},[oe,O,v,o,j,g]),he=d.useCallback(()=>{var e;return S??(A==null||(e=A.nodesRef.current.find(e=>e.id===k))==null||(e=e.context)==null||(e=e.dataRef)==null?void 0:e.current.orientation)},[k,A,S]),ge=cL(e=>{if(F.current=!1,I.current=!0,e.which===229||!oe.current&&e.currentTarget===O.current)return;if(m&&zR(e.key,x,h,C)){IR(e.key,he())||nL(e),r(!1,e.nativeEvent,`list-navigation`),VF(i.domReference)&&(g?A?.events.emit(`virtualfocus`,i.domReference):i.domReference.focus());return}let t=P.current,a=dL(o,b),s=fL(o,b);if(M||(e.key===`Home`&&(nL(e),P.current=a,j()),e.key===`End`&&(nL(e),P.current=s,j())),C>1){let t=E||Array.from({length:o.current.length},()=>({width:1,height:1})),n=Ase(t,C,D),r=n.findIndex(e=>e!=null&&!mL(o,e,b)),i=n.reduce((e,t,n)=>t!=null&&!mL(o,t,b)?n:e,-1),c=n[kse({current:n.map(e=>e==null?null:o.current[e])},{event:e,orientation:x,loop:p,rtl:h,cols:C,disabledIndices:Mse([...(typeof b==`function`?null:b)||o.current.map((e,t)=>mL(o,t,b)?t:void 0),void 0],n),minIndex:r,maxIndex:i,prevIndex:jse(P.current>s?a:P.current,t,n,C,e.key===$L?`bl`:e.key===(h?XL:ZL)?`tr`:`tl`),stopEvent:!0})];if(c!=null&&(P.current=c,j()),x===`both`)return}if(IR(e.key,x)){if(nL(e),n&&!g&&KI(e.currentTarget.ownerDocument)===e.currentTarget){P.current=LR(e.key,x,h)?a:s,j();return}LR(e.key,x,h)?p?P.current=t>=s?f&&t!==o.current.length?-1:a:pL(o,{startingIndex:t,disabledIndices:b}):P.current=Math.min(s,pL(o,{startingIndex:t,disabledIndices:b})):p?P.current=t<=a?f&&t!==-1?o.current.length:s:pL(o,{startingIndex:t,decrement:!0,disabledIndices:b}):P.current=Math.max(a,pL(o,{startingIndex:t,decrement:!0,disabledIndices:b})),uL(o,P.current)&&(P.current=-1),j()}}),_e=d.useMemo(()=>g&&n&&pe&&{"aria-activedescendant":ue||ce},[g,n,pe,ue,ce]),ve=d.useMemo(()=>({"aria-orientation":x===`both`?void 0:x,...M?{}:_e,onKeyDown:ge,onPointerMove(){F.current=!0}}),[_e,ge,x,M]),ye=d.useMemo(()=>{function e(e){_===`auto`&&rL(e.nativeEvent)&&(N.current=!0)}function t(e){N.current=_,_===`auto`&&iL(e.nativeEvent)&&(N.current=!0)}return{..._e,onKeyDown(e){F.current=!1;let t=e.key.startsWith(`Arrow`),i=[`Home`,`End`].includes(e.key),a=t||i,s=RR(e.key,x,h),c=zR(e.key,x,h,C),l=RR(e.ke
466y,he(),h),d=IR(e.key,x),f=(m?l:d)||e.key===`Enter`||e.key.trim()===``;if(g&&n){let t=A?.nodesRef.current.find(e=>e.parentId==null),n=A&&t?Tse(A.nodesRef.current,t.id):null;if(a&&n&&T){let t=new KeyboardEvent(`keydown`,{key:e.key,bubbles:!0});if(s||c){let r=n.context?.elements.domReference===e.currentTarget,i=c&&!r?n.context?.elements.domReference:s?o.current.find(e=>e?.id===ce):null;i&&(nL(e),i.dispatchEvent(t),de(void 0))}if((d||i)&&n.context&&n.context.open&&n.parentId&&e.currentTarget!==n.context.elements.domReference){var p;nL(e),(p=n.context.elements.domReference)==null||p.dispatchEvent(t);return}}return ge(e)}if(!(!n&&!y&&t)){if(f){let t=IR(e.key,he());ee.current=m&&t?null:e.key}if(m){l&&(nL(e),n?(P.current=dL(o,ae.current),j()):r(!0,e.nativeEvent,`list-navigation`));return}d&&(u!=null&&(P.current=u),nL(e),!n&&y?r(!0,e.nativeEvent,`list-navigation`):ge(e),n&&j())}},onFocus(){n&&!g&&(P.current=-1,j())},onPointerDown:t,onPointerEnter:t,onMouseDown:e,onClick:e}},[ce,_e,C,ge,ae,_,o,m,j,r,n,y,x,he,h,u,A,g,T]);return d.useMemo(()=>l?{reference:ye,floating:ve,item:me}:{},[l,ye,ve,me])}var Qce=new Map([[`select`,`listbox`],[`combobox`,`listbox`],[`label`,!1]]);function $ce(e,t){t===void 0&&(t={});let{open:n,elements:r,floatingId:i}=e,{enabled:a=!0,role:o=`dialog`}=t,s=nR(),c=r.domReference?.id||s,l=d.useMemo(()=>$I(r.floating)?.id||i,[r.floating,i]),u=Qce.get(o)??o,f=rR()!=null,p=d.useMemo(()=>u===`tooltip`||o===`label`?{[`aria-`+(o===`label`?`labelledby`:`describedby`)]:n?l:void 0}:{"aria-expanded":n?`true`:`false`,"aria-haspopup":u===`alertdialog`?`dialog`:u,"aria-controls":n?l:void 0,...u===`listbox`&&{role:`combobox`},...u===`menu`&&{id:c},...u===`menu`&&f&&{role:`menuitem`},...o===`select`&&{"aria-autocomplete":`none`},...o===`combobox`&&{"aria-autocomplete":`list`}},[u,l,f,n,c,o]),m=d.useMemo(()=>{let e={id:l,...u&&{role:u}};return u===`tooltip`||o===`label`?e:{...e,...u===`menu`&&{"aria-labelledby":c}}},[u,l,c,o]),h=d.useCallback(e=>{let{active:t,selected:n}=e,r={role:`option`,...t&&{id:l+`-fui-option`}};switch(o){case`select`:case`combobox`:return{...r,"aria-selected":n}}return{}},[l,o]);return d.useMemo(()=>a?{reference:p,floating:m,item:h}:{},[a,p,m,h])}function ele(e,t){let{open:n,dataRef:r}=e,{listRef:i,activeIndex:a,onMatch:o,onTypingChange:s,enabled:c=!0,findMatch:l=null,resetMs:u=750,ignoreKeys:f=[],selectedIndex:p=null}=t,m=d.useRef(-1),h=d.useRef(``),g=d.useRef(p??a??-1),_=d.useRef(null),v=cL(o),y=cL(s),b=sL(l),x=sL(f);oL(()=>{n&&(oR(m),_.current=null,h.current=``)},[n]),oL(()=>{n&&h.current===``&&(g.current=p??a??-1)},[n,p,a]);let S=cL(e=>{e?r.current.typing||(r.current.typing=e,y(e)):r.current.typing&&(r.current.typing=e,y(e))}),C=cL(e=>{function t(e,t,n){let r=b.current?b.current(t,n):t.find(e=>e?.toLocaleLowerCase().indexOf(n.toLocaleLowerCase())===0);return r?e.indexOf(r):-1}let r=i.current;if(h.current.length>0&&h.current[0]!==` `&&(t(r,r,h.current)===-1?S(!1):e.key===` `&&nL(e)),r==null||x.current.includes(e.key)||e.key.length!==1||e.ctrlKey||e.metaKey||e.altKey)return;n&&e.key!==` `&&(nL(e),S(!0)),r.every(e=>e?e[0]?.toLocaleLowerCase()!==e[1]?.toLocaleLowerCase():!0)&&h.current===e.key&&(h.current=``,g.current=_.current),h.current+=e.key,oR(m),m.current=window.setTimeout(()=>{h.current=``,g.current=_.current,S(!1)},u);let a=g.current,o=t(r,[...r.slice((a||0)+1),...r.slice(0,(a||0)+1)],h.current);o===-1?e.key!==` `&&(h.current=``,S(!1)):(v(o),_.current=o)}),w=d.useMemo(()=>({onKeyDown:C}),[C]),T=d.useMemo(()=>({onKeyDown:C,onKeyUp(e){e.key===` `&&S(!1)}}),[C,S]);return d.useMemo(()=>c?{reference:w,floating:T}:{},[c,w,T])}function BR(e){var t,n,r=``;if(typeof e==`string`||typeof e==`number`)r+=e;else if(typeof e==`object`)if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=BR(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n);return r}function G(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=BR(e))&&(r&&(r+=` `),r+=t);return r}var VR=({participant:e,trackType:t=`audioTrack`,...n})=>{let r=SF(),[i,a]=(0,d.useState)(null),{userId:o,sessionId:s}=e;return(0,d.useEffect)(()=>
466{if(!r||!i)return;let e=r.bindAudioElement(i,s,t);return()=>{e?.()}},[r,s,i,t]),(0,R.jsx)(`audio`,{autoPlay:!0,...n,ref:a,"data-user-id":o,"data-session-id":s,"data-track-type":t})};VR.displayName=`Audio`;var HR=e=>{let{participants:t,audioProps:n}=e;return(0,R.jsx)(R.Fragment,{children:t.map(e=>{if(e.isLocalParticipant)return null;let{audioStream:t,screenShareAudioStream:r,sessionId:i}=e;return(0,R.jsxs)(d.Fragment,{children:[Aj(e)&&t&&(0,R.jsx)(VR,{...n,trackType:`audioTrack`,participant:e}),Mj(e)&&r&&(0,R.jsx)(VR,{...n,trackType:`screenShareAudioTrack`,participant:e})]},i)})})};HR.displayName=`ParticipantsAudio`;var UR=(0,d.createContext)(void 0),WR=()=>(0,d.useContext)(UR),GR=({middleware:e=[],placement:t,strategy:n,offset:r=10})=>{let{refs:i,x:a,y:o,update:s,elements:{domReference:c,floating:l},context:u}=NR({placement:t,strategy:n,middleware:[UL(r),WL(),GL(),KL({padding:10,apply:({availableHeight:e,elements:t})=>{Object.assign(t.floating.style,{maxHeight:`${e}px`})}}),...e]});return(0,d.useEffect)(()=>{if(!c||!l)return;let e=IL(c,l,s);return()=>e()},[c,l,s]),{refs:i,x:a,y:o,domReference:c,floating:l,strategy:n,context:u}},KR=10,tle=(e,t=KR)=>{let[n,r]=(0,d.useState)(null);return(0,d.useEffect)(()=>{if(!e)return;let n=()=>{let n=e;if(!(n.scrollHeight>n.clientHeight))return r(null);if(n.scrollTop<=t)return r(`top`);if(Math.abs(n.scrollHeight-n.scrollTop-n.clientHeight)<=t)return r(`bottom`);r(`between`)},i=new ResizeObserver(n);return i.observe(e),e.addEventListener(`scroll`,n),()=>{e.removeEventListener(`scroll`,n),i.disconnect()}},[e,t]),n},nle=(e,t=KR)=>{let[n,r]=(0,d.useState)(null);return(0,d.useEffect)(()=>{if(!e)return;let n=()=>{let n=e;if(!(n.scrollWidth>n.clientWidth))return r(null);if(n.scrollLeft<=t)return r(`start`);if(Math.abs(n.scrollWidth-n.scrollLeft-n.clientWidth)<=t)return r(`end`);r(`between`)},i=new ResizeObserver(n);return i.observe(e),e.addEventListener(`scroll`,n),()=>{e.removeEventListener(`scroll`,n),i.disconnect()}},[e,t]),n},qR=e=>{let t=SF(),{useHasPermissions:n}=NF(),r=n(e),[i,a]=(0,d.useState)(!1);return(0,d.useEffect)(()=>{r&&a(!1)},[r]),{requestPermission:(0,d.useCallback)(async()=>{if(r)return!0;let n=!!t?.permissionsContext.canRequest(e);if(i||!n)return!1;a(!0);try{await t?.requestPermissions({permissions:[e]})}catch(e){throw a(!1),Error(`requestPermission failed: ${e}`)}return!1},[t,r,i,e]),hasPermission:r,canRequestPermission:!!t?.permissionsContext.canRequest(e),isAwaitingPermission:i}};function JR(e,t){let{t:n}=TF();return(0,d.useMemo)(()=>{let r=null,i=null,a=e.map((e,n)=>{let a=e.deviceId===t,o={deviceId:e.deviceId,label:e.label,isSelected:a};return a&&(r=o,i=n),o});if(r===null||i===null){let e={deviceId:`default`,label:n(`Default`),isSelected:!0};r=e,i=0,a.unshift(e)}return{deviceList:a,selectedDeviceInfo:r,selectedIndex:i}},[e,t,n])}function rle(e,t={}){let n=(0,d.useRef)({isDragging:!1,isPointerActive:!1,prevX:0,prevY:0,velocityX:0,velocityY:0,rafId:0,startX:0,startY:0});(0,d.useEffect)(()=>{if(!e||!t.enabled)return;let{decay:r=.95,minVelocity:i=.5,dragThreshold:a=5}=t,o=n.current,s=()=>{o.rafId&&=(cancelAnimationFrame(o.rafId),0),o.velocityX=0,o.velocityY=0},c=()=>{if(o.velocityX*=r,o.velocityY*=r,e.scrollLeft-=o.velocityX,e.scrollTop-=o.velocityY,Math.abs(o.velocityX)<i&&Math.abs(o.velocityY)<i){o.rafId=0;return}o.rafId=requestAnimationFrame(c)},l=e=>{e.pointerType===`mouse`&&(s(),o.isDragging=!1,o.isPointerActive=!0,o.prevX=e.clientX,o.prevY=e.clientY,o.startX=e.clientX,o.startY=e.clientY)},u=t=>{if(t.pointerType!==`mouse`||!o.isPointerActive)return;let n=t.clientX-o.startX,r=t.clientY-o.startY;if(!o.isDragging&&Math.hypot(n,r)>a&&(o.isDragging=!0,t.preventDefault()),!o.isDragging)return;let i=t.clientX-o.prevX,s=t.clientY-o.prevY;e.scrollLeft-=i,e.scrollTop-=s,o.velocityX=i,o.velocityY=s,o.prevX=t.clientX,o.prevY=t.clientY},d=()=>{let e=o.isDragging;if(o.isDragging=!1,o.isPointerActive=!1,o.prevX=0,o.prevY=0,o.startX=0,o.startY=0,!e){s();return}if(Math.hypot(o.velocityX,o.velocityY)<i){s();return}o.rafId=requestAnimationFrame(c)};return e.addEventListener(`pointerdown`,l),e.addEventListener(`pointermove`,u),window.addEventListener(`pointerup`,d),window.addEventListener(`pointercancel`,d),()=>{e.removeEventListener(`pointerdown`,l),e.removeEventListener(`pointermove`,u),window.removeEventListener(`pointerup`,d),window.removeEventListener(`pointercancel`,d),s()}},[e,t])}var YR;(function(e){e.PORTAL=`portal`,e.MENU=`menu`})(YR||={});var XR=(0,d.createContext)({}),ZR=()=>(0,d.useContext)(XR),ile=({children:e,refs:t})=>{let[n,r]=(0,d.useState)(null);return(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(`div`,{ref:r,className:`str-video__portal`}),(0,R.jsx)(Hce,{children:(0,R.jsx)(Ice,{root:n,children:(0,R.jsx)(`div`,{className:`str-video__portal-content`,ref:t.setFloating,children:e})})})]})},QR=({ToggleButton:e,placement:t=`top-start`,strategy:n=`absolute`,offset:r,visualType:i=YR.MENU,children:a,onToggle:o})=>{let[s,c]=(0,d.useState)(!1),l=(0,d.useRef)(o);l.current=o;let{floating:u,domReference:f,refs:p,x:m,y:h}=GR({placement:t,strategy:n,offset:r});return(0,d.useEffect)(()=>{let e=f?.ownerDocument,t=e=>{!u&&f?.contains(e.target)?(c(!0),l.current?.(!0)):u&&!u?.contains(e.target)&&(c(!1),l.current?.(!1))},n=e=>{e.key&&e.key.toLowerCase()===`escape`&&!e.altKey&&!e.ctrlKey&&(c(!1),l.current?.(!1))};return e?.addEventListener(`click`,t,{capture:!0}
466),e?.addEventListener(`keydown`,n),()=>{e?.removeEventListener(`click`,t,{capture:!0}),e?.removeEventListener(`keydown`,n)}},[u,f]),(0,R.jsxs)(R.Fragment,{children:[s&&(0,R.jsx)(XR.Provider,{value:{close:()=>c(!1)},children:i===YR.PORTAL?(0,R.jsx)(ile,{refs:p,children:a}):i===YR.MENU?(0,R.jsx)(`div`,{className:`str-video__menu-container`,ref:p.setFloating,style:{position:n,top:h??0,left:m??0,overflowY:`auto`},role:`menu`,children:a}):null}),(0,R.jsx)(e,{menuShown:s,ref:p.setReference})]})},ale=({children:e,onItemClick:t})=>{let n=(0,d.useRef)(null);return(0,R.jsx)(`ul`,{className:`str-video__generic-menu`,ref:n,onClick:e=>{t&&e.target!==n.current&&n.current?.contains(e.target)&&t(e)},children:e})},$R=({children:e,...t})=>(0,R.jsx)(`li`,{className:`str-video__generic-menu--item`,children:(0,R.jsx)(`button`,{...t,children:e})}),ez=({className:e,icon:t})=>(0,R.jsx)(`span`,{className:G(`str-video__icon`,t&&`str-video__icon--${t}`,e)});function tz(e){let[t,n]=(0,d.useState)(document.pictureInPictureElement===e);return!e&&t&&n(!1),(0,d.useEffect)(()=>{if(!e)return;let t=()=>{n(document.pictureInPictureElement===e)};return e.addEventListener(`enterpictureinpicture`,t),e.addEventListener(`leavepictureinpicture`,t),()=>{e.removeEventListener(`enterpictureinpicture`,t),e.removeEventListener(`leavepictureinpicture`,t)}},[e]),t}var ole=()=>{let{participant:e,participantViewElement:t,videoElement:n}=WR(),[r,i]=(0,d.useState)(!!document.fullscreenElement),a=SF(),o=tz(n??void 0),{t:s}=TF(),{pin:c,sessionId:l,userId:u}=e,f=Aj(e),p=kj(e),m=jj(e),h=Mj(e),g=()=>a?.blockUser(u),_=()=>a?.kickUser({user_id:u}),v=()=>a?.muteUser(u,`audio`),y=()=>a?.muteUser(u,`video`),b=()=>a?.muteUser(u,`screenshare`),x=()=>a?.muteUser(u,`screenshare_audio`),S=e=>()=>{a?.updateUserPermissions({user_id:u,grant_permissions:[e]})},C=e=>()=>{a?.updateUserPermissions({user_id:u,revoke_permissions:[e]})},w=()=>{c?a?.unpin(l):a?.pin(l)},T=()=>{a?.pinForEveryone({user_id:u,session_id:l}).catch(e=>{console.error(`Failed to pin participant ${u}`,e)})},E=()=>{a?.unpinForEveryone({user_id:u,session_id:l}).catch(e=>{console.error(`Failed to unpin participant ${u}`,e)})},D=()=>r?document.exitFullscreen().catch(console.error):t?.requestFullscreen().catch(console.error);(0,d.useEffect)(()=>{let e=()=>{i(!!document.fullscreenElement)};return document.addEventListener(`fullscreenchange`,e),()=>{document.removeEventListener(`fullscreenchange`,e)}},[]);let O=()=>n&&!o?n.requestPictureInPicture().catch(console.error):document.exitPictureInPicture().catch(console.error),{close:k}=ZR()||{};return(0,R.jsxs)(ale,{onItemClick:k,children:[(0,R.jsxs)($R,{onClick:w,disabled:c&&!c.isLocalPin,children:[(0,R.jsx)(ez,{icon:`pin`}),s(c?`Unpin`:`Pin`)]}),(0,R.jsxs)(PF,{requiredGrants:[bO.PIN_FOR_EVERYONE],children:[(0,R.jsxs)($R,{onClick:T,disabled:c&&!c.isLocalPin,children:[(0,R.jsx)(ez,{icon:`pin`}),s(`Pin for everyone`)]}),(0,R.jsxs)($R,{onClick:E,disabled:!c||c.isLocalPin,children:[(0,R.jsx)(ez,{icon:`pin`}),s(`Unpin for everyone`)]})]}),(0,R.jsx)(PF,{requiredGrants:[bO.BLOCK_USERS],children:(0,R.jsxs)($R,{onClick:g,children:[(0,R.jsx)(ez,{icon:`not-allowed`}),s(`Block`)]})}),(0,R.jsx)(PF,{requiredGrants:[bO.KICK_USER],children:(0,R.jsxs)($R,{onClick:_,children:[(0,R.jsx)(ez,{icon:`kick-user`}),s(`Kick`)]})}),(0,R.jsxs)(PF,{requiredGrants:[bO.MUTE_USERS],children:[p&&(0,R.jsxs)($R,{onClick:y,children:[(0,R.jsx)(ez,{icon:`camera-off-outline`}),s(`Turn off video`)]}),m&&(0,R.jsxs)($R,{onClick:b,children:[(0,R.jsx)(ez,{icon:`screen-share-off`}),s(`Turn off screen share`)]}),f&&(0,R.jsxs)($R,{onClick:v,children:[(0,R.jsx)(ez,{icon:`no-audio`}),s(`Mute audio`)]}),h&&(0,R.jsxs)($R,{onClick:x,children:[(0,R.jsx)(ez,{icon:`no-audio`}),s(`Mute screen share audio`)]})]}),t&&t.requestFullscreen!==void 0&&(0,R.jsx)($R,{onClick:D,children:s(`{{ direction }} fullscreen`,{direction:s(r?`Leave`:`Enter`)})}),n&&document.pictureInPictureEnabled&&(0,R.jsx)($R,{onClick:O,children:s(`{{ direction }} picture-in-picture`,{direction:s(o?`Leave`:`Enter`)})}),(0,R.jsxs)(PF,{requiredGrants:[bO.UPDATE_CALL_PERMISSIONS],children:[(0,R.jsx)($R,{onClick:S(bO.SEND_AUDIO),children:s(`Allow audio`)}),(0,R.jsx)($R,{onClick:S(bO.SEND_VIDEO),children:s(`Allow video`)}),(0,R.jsx)($R,{onClick:S(bO.SCREENSHARE),children:s(`Allow screen sharing`)}),(0,R.jsx)($R,{onClick:C(bO.SEND_AUDIO),children:s(`Disable audio`)}),(0,R.jsx)($R,{onClick:C(bO.SEND_VIDEO),children:s(`Disable video`)}),(0,R.jsx)($R,{onClick:C(bO.SCREENSHARE),children:s(`Disable screen sharing`)})]})]})},nz=e=>e===null?!1:!(0,d.isValidElement)(e),rz=(e,t)=>{let n=Math.ceil(e.length/t);return Array.from({length:n},(n,r)=>e.slice(t*r,t*r+t))},iz=(e,t)=>
466{if(e){if(typeof e==`function`)return e(t);e.current=t}};(0,d.forwardRef)(function({stream:e,...t},n){let[r,i]=(0,d.useState)(null);return(0,d.useEffect)(()=>{if(!(!r||!e)&&e!==r.srcObject)return r.srcObject=e,(SM.isSafari()||SM.isFirefox())&&setTimeout(()=>{r.srcObject=e,r.play().catch(e=>{console.error(`Failed to play stream`,e)})},0),()=>{r.pause(),r.srcObject=null}},[e,r]),(0,R.jsx)(`video`,{autoPlay:!0,playsInline:!0,...t,ref:e=>{iz(n,e),i(e)}})});var az=(0,d.forwardRef)(function({participant:e,style:t,children:n},r){let[i,a]=(0,d.useState)(!1),o=e.name||e.userId;return(0,R.jsxs)(`div`,{className:`str-video__video-placeholder`,style:t,ref:r,children:[(!e.image||i)&&(o?(0,R.jsx)(sle,{name:o}):(0,R.jsx)(`div`,{className:`str-video__video-placeholder__no-video-label`,children:n})),e.image&&!i&&(0,R.jsx)(`img`,{onError:()=>a(!0),alt:o,className:`str-video__video-placeholder__avatar`,src:e.image})]})}),sle=e=>{let{name:t}=e;return(0,R.jsx)(`div`,{className:`str-video__video-placeholder__initials-fallback`,children:t.split(` `).slice(0,2).map(e=>e[0]).join(``)})},cle=(0,d.forwardRef)(function(e,t){let{t:n}=TF();return(0,R.jsx)(az,{ref:t,...e,children:n(`Video is disabled`)})}),lle=(0,d.forwardRef)(function(e,t){let{t:n}=TF();return(0,R.jsx)(az,{ref:t,...e,children:n(`Video is playing in a popup`)})}),oz=({enabled:e=!0,mirror:t,trackType:n,participant:r,className:i,VideoPlaceholder:a=cle,PictureInPicturePlaceholder:o=lle,refs:s,...c})=>{let{sessionId:l,videoStream:u,screenShareStream:f,viewportVisibilityState:p,isLocalParticipant:m,userId:h}=r,g=SF(),[_,v]=(0,d.useState)(null),[y,b]=(0,d.useState)(!0),[x,S]=(0,d.useState)(!0),C=tz(_??void 0),w=n===`videoTrack`?u:n===`screenShareTrack`?f:void 0;if((0,d.useLayoutEffect)(()=>{if(!g||!_||n===`none`)return;let e=g.bindVideoElement(_,l,n);return()=>{e?.()}},[g,n,l,_]),(0,d.useEffect)(()=>{if(!w||!_)return;let[e]=w.getVideoTracks();if(!e)return;let t=()=>{b(_.paused);let{width:t=0,height:n=0}=e.getSettings();S(t>=n)};return b(_.paused),_.addEventListener(`play`,t),_.addEventListener(`pause`,t),e.addEventListener(`unmute`,t),()=>{_.removeEventListener(`play`,t),_.removeEventListener(`pause`,t),e.removeEventListener(`unmute`,t),b(!0)}},[w,_]),!g)return null;let T=n===`videoTrack`?kj(r):n===`screenShareTrack`?jj(r):!1,E=n===`none`||p?.[n]===CA.INVISIBLE,D=!e||!T||E||Pj(r,n),O=t===void 0?m&&n===`videoTrack`:t,k=n===`screenShareTrack`;return(0,R.jsxs)(R.Fragment,{children:[!D&&(0,R.jsx)(`video`,{...c,className:G(`str-video__video`,i,{"str-video__video--not-playing":y,"str-video__video--tall":!x,"str-video__video--mirror":O,"str-video__video--screen-share":k}),"data-user-id":h,"data-session-id":l,ref:e=>{v(e),s?.setVideoElement?.(e)}}),C&&o&&(0,R.jsx)(o,{style:{position:`absolute`},participant:r}),(D||y)&&a&&(0,R.jsx)(a,{style:{position:`absolute`},participant:r,ref:s?.setVideoPlaceholderElement})]})};oz.displayName=`Video`;var ule=({trackedElement:e,sessionId:t,trackType:n})=>{let r=SF();(0,d.useEffect)(()=>{if(!(!e||!r||n===`none`))return r.trackElementVisibility(e,t,n)},[e,r,t,n])};(0,d.lazy)(()=>pa(()=>import(`./background-filters-D2U5UBbH.es-C_OaaGVI.js`).then(e=>({default:e.BackgroundFiltersProvider})),__vite__mapDeps([0,1]))),(0,d.createContext)(void 0);var sz=(0,d.forwardRef)(function(e,t){let{icon:n,enabled:r,variant:i,onClick:a,className:o,...s}=e;return(0,R.jsx)(`button`,{className:G(`str-video__call-controls__button`,o,{[`str-video__call-controls__button--variant-${i}`]:i,"str-video__call-controls__button--enabled":r}),onClick:e=>{e.preventDefault(),a?.(e)},ref:t,...s,children:(0,R.jsx)(ez,{icon:n})})}),cz=(0,d.forwardRef)(function({disabled:e,caption:t,children:n,className:r,active:i,Menu:a,menuPlacement:o,menuOffset:s,title:c,ToggleMenuButton:l=dle,variant:u,onClick:d,onMenuToggle:f,...p},m){return(0,R.jsxs)(`div`,{className:G(`str-video__composite-button`,r,{"str-video__composite-button--caption":t,"str-video__composite-button--menu":a}),title:c,ref:m,children:[(0,R.jsxs)(`div`,{className:G(`str-video__composite-button__button-group`,{"str-video__composite-button__button-group--active":i,"str-video__composite-button__button-group--active-primary":i&&u===`primary`,"str-video__composite-button__button-group--active-secondary":i&&u===`secondary`,"str-video__composite-button__button-group--disabled":e}),children:[(0,R.jsx)(`button`,{type:`button`,className:`str-video__composite-button__button`,onClick:e=>{e.preventDefault(),d?.(e)},disabled:e,...p,children:n}),a&&(0,R.jsx)(QR,{offset:s,placement:o,ToggleButton:l,onToggle:f,children:nz(a)?(0,R.jsx)(a,{}):a})]}),t&&(0,R.jsx)(`div`,{className:`str-video__composite-button__caption`,children:t})]})}),dle=(0,d.forwardRef)(function({menuShown:e},t){return(0,R.jsx)(sz,{className:G(`str-video__menu-toggle-button`,{"str-video__menu-toggle-button--active":e}),icon:e?`caret-down`:`caret-up`,ref:t})}),lz=e=>
466{let{isVisible:t,message:n,children:r,visibilityTimeout:i,resetIsVisible:a,placement:o=`top`,className:s,iconClassName:c=`str-video__notification__icon`,close:l}=e,{refs:u,x:f,y:p,strategy:m}=GR({placement:o,strategy:`absolute`});return(0,d.useEffect)(()=>{if(!t||!i||!a)return;let e=setTimeout(()=>{a()},i);return()=>clearTimeout(e)},[t,a,i]),(0,R.jsxs)(`div`,{className:`str-video__notification-wrapper`,ref:u.setReference,children:[t&&(0,R.jsxs)(`div`,{className:G(`str-video__notification`,s),ref:u.setFloating,style:{position:m,top:p??0,left:f??0,overflowY:`auto`},children:[c&&(0,R.jsx)(`i`,{className:c}),(0,R.jsx)(`span`,{className:`str-video__notification__message`,children:n}),l?(0,R.jsx)(`i`,{className:`str-video__icon str-video__icon--close str-video__notification__close`,onClick:l}):null]}),r]})},uz=e=>{let{permission:t,isAwaitingApproval:n,messageApproved:r,messageAwaitingApproval:i,messageRevoked:a,visibilityTimeout:o=3500,children:s}=e,{useHasPermissions:c}=NF(),l=c(t),u=(0,d.useRef)(l),[f,p]=(0,d.useState)();(0,d.useEffect)(()=>{u.current!==l&&(l?(p(`granted`),u.current=!0):(p(`revoked`),u.current=!1))},[l]);let m=(0,d.useCallback)(()=>p(void 0),[]);return n?(0,R.jsx)(lz,{isVisible:n&&!l,message:i,children:s}):(0,R.jsx)(lz,{isVisible:!!f,visibilityTimeout:o,resetIsVisible:m,message:f===`granted`?r:a,children:s})},fle=({children:e,text:t,placement:n})=>{let{useMicrophoneState:r}=NF(),{isSpeakingWhileMuted:i}=r(),{t:a}=TF();return(0,R.jsx)(lz,{message:t??a(`You are muted. Unmute to speak.`),isVisible:i,placement:n||`top-start`,children:e})},dz=({className:e,type:t=`spinner`,text:n,tooltip:r})=>(0,R.jsxs)(`div`,{className:G(`str-video__loading-indicator`,e),title:r,children:[(0,R.jsx)(`div`,{className:G(`str-video__loading-indicator__icon`,t)}),n&&(0,R.jsx)(`p`,{className:`str-video__loading-indicator-text`,children:n})]}),ple=({children:e,referenceElement:t,tooltipClassName:n,tooltipPlacement:r=`top`,visible:i=!1})=>{let a=(0,d.useRef)(null),{refs:o,x:s,y:c,strategy:l,context:u}=GR({placement:r,strategy:`absolute`,middleware:[gce({element:a})]});return(0,d.useEffect)(()=>{o.setReference(t)},[t,o]),i?(0,R.jsxs)(`div`,{className:G(`str-video__tooltip`,n),ref:o.setFloating,style:{position:l,top:c??0,left:s??0},children:[(0,R.jsx)(Ece,{ref:a,context:u,fill:`var(--str-video__tooltip--background-color)`}),e]}):null},mle=({onMouseEnter:e,onMouseLeave:t}={})=>{let[n,r]=(0,d.useState)(!1);return{handleMouseEnter:(0,d.useCallback)(t=>{r(!0),e?.(t)},[e]),handleMouseLeave:(0,d.useCallback)(e=>{r(!1),t?.(e)},[t]),tooltipVisible:n}},fz=({title:e,tooltipClassName:t,tooltipPlacement:n,tooltipDisabled:r,...i})=>{let{handleMouseEnter:a,handleMouseLeave:o,tooltipVisible:s}=mle(),[c,l]=(0,d.useState)(null);return(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(ple,{referenceElement:c,visible:!r&&!!e&&s,tooltipClassName:t,tooltipPlacement:n,children:e||``}),(0,R.jsx)(`div`,{ref:l,onMouseEnter:a,onMouseLeave:o,...i})]})},pz=(e,t)=>async()=>{try{await t()}catch(t){if(e.onError){e.onError(t);return}hle(t)||console.error(`Call control handler failed`,t)}};function hle(e){return e instanceof DOMException&&e.name===`NotAllowedError`}(0,d.forwardRef)(function(e,t){return(0,R.jsx)(cz,{ref:t,active:!0,variant:`secondary`,"data-testid":`recording-stop-button`,children:(0,R.jsx)(ez,{icon:`recording-off`})})});var gle=e=>{let{caption:t}=e,{t:n}=TF(),{toggleCallRecording:r,isAwaitingResponse:i,isCallRecordingInProgress:a}=Goe(),o=pz(e,r),s=t??n(`Record call`);return i&&(s=n(a?`Waiting for recording to stop...`:`Waiting for recording to start...`)),(0,R.jsx)(PF,{requiredGrants:[bO.START_RECORD_CALL,bO.STOP_RECORD_CALL],children:(0,R.jsx)(cz,{active:a,caption:t,variant:`secondary`,"data-testid":a?`recording-stop-button`:`recording-start-button`,title:s,onClick:i?void 0:o,children:i?(0,R.jsx)(dz,{}):(0,R.jsx)(ez,{icon:a?`recording-on`:`recording-off`})})})},mz={":like:":`👍`,":raise-hand:":`✋`,":fireworks:":`🎉`,":dislike:":`👎`,":heart:":`❤️`,":smile:":`😀`},_le=({participant:{reaction:e,sessionId:t},hideAfterTimeoutInMs:n=5500,emojiReactionMap:r=mz})=>{let i=SF();if((0,d.useEffect)(()=>
466{if(!i||!e)return;let r=setTimeout(()=>{i.resetReaction(t)},n);return()=>{clearTimeout(r)}},[i,n,e,t]),!e)return null;let{emoji_code:a}=e;return(0,R.jsx)(`div`,{className:`str-video__reaction`,children:(0,R.jsx)(`span`,{className:`str-video__reaction__emoji`,children:a&&r[a]})})},vle=[{type:`reaction`,emoji_code:`:like:`},{type:`raised-hand`,emoji_code:`:raise-hand:`},{type:`reaction`,emoji_code:`:fireworks:`},{type:`reaction`,emoji_code:`:dislike:`},{type:`reaction`,emoji_code:`:heart:`},{type:`reaction`,emoji_code:`:smile:`}],yle=({reactions:e=vle})=>(0,R.jsx)(PF,{requiredGrants:[bO.CREATE_REACTION],children:(0,R.jsx)(QR,{placement:`top`,ToggleButton:ble,visualType:YR.MENU,children:(0,R.jsx)(xle,{reactions:e})})}),ble=(0,d.forwardRef)(function({menuShown:e},t){let{t:n}=TF();return(0,R.jsx)(fz,{title:n(`Reactions`),tooltipDisabled:e,children:(0,R.jsx)(cz,{ref:t,active:e,variant:`primary`,children:(0,R.jsx)(ez,{icon:`reactions`})})})}),xle=({reactions:e,layout:t=`horizontal`})=>{let n=SF(),{close:r}=ZR();return(0,R.jsx)(`div`,{className:G(`str-video__reactions-menu`,{"str-video__reactions-menu--horizontal":t===`horizontal`,"str-video__reactions-menu--vertical":t===`vertical`}),children:e.map(e=>(0,R.jsx)(`button`,{type:`button`,className:`str-video__reactions-menu__button`,onClick:()=>{n?.sendReaction(e),r?.()},children:e.emoji_code&&mz[e.emoji_code]},e.emoji_code))})},Sle=e=>{let{t}=TF(),{caption:n,optimisticUpdates:r}=e,{useHasOngoingScreenShare:i,useScreenShareState:a,useCallSettings:o}=NF(),s=i(),{hasPermission:c,requestPermission:l,isAwaitingPermission:u}=qR(bO.SCREENSHARE),d=o()?.screensharing.enabled,{screenShare:f,optionsAwareIsMute:p,isTogglePending:m}=a({optimisticUpdates:r}),h=!p,g=!h&&(s||d===!1)||!r&&m,_=pz(e,async()=>{c?await f.toggle():await l()});return(0,R.jsx)(PF,{requiredGrants:[bO.SCREENSHARE],children:(0,R.jsx)(uz,{permission:bO.SCREENSHARE,isAwaitingApproval:u,messageApproved:t(`You can now share your screen.`),messageAwaitingApproval:t(`Awaiting for an approval to share screen.`),messageRevoked:t(`You can no longer share your screen.`),children:(0,R.jsx)(fz,{title:n??t(`Share screen`),children:(0,R.jsx)(cz,{active:s||h,caption:n,variant:`primary`,"data-testid":s?`screen-share-stop-button`:`screen-share-start-button`,disabled:g,onClick:_,children:(0,R.jsx)(ez,{icon:s?`screen-share-on`:`screen-share-off`})})})})})},Cle=()=>{let{useMicrophoneState:e}=NF(),{isEnabled:t,mediaStream:n}=e(),[r,i]=(0,d.useState)(0);return(0,d.useEffect)(()=>{if(!t||!n)return;let e=jP(n,({audioLevel:e})=>i(e),{detectionFrequencyInMs:80,destroyStreamOnStop:!1});return()=>{e().catch(console.error)}},[t,n]),(0,R.jsxs)(`div`,{className:`str-video__audio-volume-indicator`,children:[(0,R.jsx)(ez,{icon:t?`mic`:`mic-off`}),(0,R.jsx)(`div`,{className:`str-video__audio-volume-indicator__bar`,children:(0,R.jsx)(`div`,{className:`str-video__audio-volume-indicator__bar-value`,style:{transform:`scaleX(${r/100})`}})})]})},hz=5,wle=({deviceId:e})=>{let[t,n]=(0,d.useState)(0);(0,d.useEffect)(()=>{let t=!1,r;return navigator.mediaDevices.getUserMedia({audio:{deviceId:{exact:e}},video:!1}).then(e=>{if(t){e.getTracks().forEach(e=>e.stop());return}r=jP(e,({audioLevel:e})=>n(e),{detectionFrequencyInMs:80})}).catch(console.error),()=>{t=!0,r?.().catch(console.error)}},[e]);let r=Math.round(t/100*hz);return(0,R.jsx)(`div`,{className:`str-video__device-level-indicator`,"aria-label":`Audio level`,children:Array.from({length:hz},(e,t)=>(0,R.jsx)(`div`,{className:G(`str-video__device-level-indicator__bar`,{"str-video__device-level-indicator__bar--active":t<r})},t))})},Tle=({device:e,onSelect:t})=>e.deviceId===`default`?null:(0,R.jsxs)(`label`,{className:`str-video__device-settings__option${e.isSelected?` str-video__device-settings__option--selected`:``}`,htmlFor:`audioinput--${e.deviceId}`,children:[(0,R.jsx)(`input`,{type:`radio`,name:`audioinput`,value:e.deviceId,id:`audioinput--${e.deviceId}`,checked:e.isSelected,onChange:e=>t(e.target.value)}),e.label,(0,R.jsx)(wle,{deviceId:e.deviceId})]}),gz=(0,d.createContext)({}),Ele=e=>{let{children:t,icon:n,defaultSelectedLabel:r,defaultSelectedIndex:i,handleSelect:a}=e,[o,s]=(0,d.useState)(!1),[c,l]=(0,d.useState)(null),[u,f]=(0,d.useState)(i),[p,m]=(0,d.useState)(r),{refs:h,c
466ontext:g}=NR({placement:`bottom-start`,open:o,onOpenChange:s,whileElementsMounted:IL,middleware:[GL()]}),_=(0,d.useRef)([]),v=(0,d.useRef)([]),y=(0,d.useCallback)(e=>{f(e),a(e||0),s(!1),e!==null&&m(v.current[e])},[a]),{getReferenceProps:b,getFloatingProps:x,getItemProps:S}=Yce([Zce(g,{listRef:_,activeIndex:c,selectedIndex:u,onNavigate:l}),ele(g,{listRef:v,activeIndex:c,selectedIndex:u,onMatch:e=>{o?l(e):y(e)}}),Wce(g),qce(g),$ce(g,{role:`listbox`})]),C=(0,d.useMemo)(()=>({activeIndex:c,selectedIndex:u,getItemProps:S,handleSelect:y}),[c,u,S,y]);return(0,R.jsxs)(`div`,{className:`str-video__dropdown`,children:[(0,R.jsxs)(`div`,{className:`str-video__dropdown-selected`,ref:h.setReference,tabIndex:0,...b(),children:[(0,R.jsxs)(`label`,{className:`str-video__dropdown-selected__label`,children:[n&&(0,R.jsx)(ez,{className:`str-video__dropdown-selected__icon`,icon:n}),p]}),(0,R.jsx)(ez,{className:`str-video__dropdown-selected__chevron`,icon:o?`chevron-up`:`chevron-down`})]}),(0,R.jsx)(gz.Provider,{value:C,children:o&&(0,R.jsx)(Bce,{context:g,modal:!1,children:(0,R.jsx)(`div`,{className:`str-video__dropdown-list`,ref:h.setFloating,...x(),children:(0,R.jsx)(vce,{elementsRef:_,labelsRef:v,children:t})})})})]})},Dle=e=>{let{selected:t,label:n,icon:r}=e,{getItemProps:i,handleSelect:a}=(0,d.useContext)(gz),{ref:o,index:s}=yce();return(0,R.jsxs)(`div`,{className:G(`str-video__dropdown-option`,{"str-video__dropdown-option--selected":t}),ref:o,...i({onClick:()=>a(s)}),children:[r&&(0,R.jsx)(ez,{className:`str-video__dropdown-icon`,icon:r}),(0,R.jsx)(`span`,{className:`str-video__dropdown-label`,children:n})]})},Ole=e=>{let{children:t,icon:n,handleSelect:r,defaultSelectedLabel:i,defaultSelectedIndex:a}=e;return(0,R.jsx)(Ele,{icon:n,handleSelect:r,defaultSelectedIndex:a,defaultSelectedLabel:i,children:t})},kle=({disabled:e,id:t,label:n,onChange:r,name:i,selected:a,defaultChecked:o,value:s})=>(0,R.jsxs)(`label`,{className:G(`str-video__device-settings__option`,{"str-video__device-settings__option--selected":a,"str-video__device-settings__option--disabled":e}),htmlFor:t,children:[(0,R.jsx)(`input`,{type:`radio`,name:i,onChange:r,value:s,id:t,checked:a,defaultChecked:o,disabled:e}),n]}),Ale=e=>{let{devices:t=[],selectedDeviceId:n,title:r,type:i,onChange:a,children:o}=e,{close:s}=ZR(),{deviceList:c}=JR(t,n);return(0,R.jsxs)(`div`,{className:`str-video__device-settings__device-kind`,children:[r&&(0,R.jsx)(`div`,{className:`str-video__device-settings__device-selector-title`,children:r}),c.map(e=>(0,R.jsx)(kle,{id:`${i}--${e.deviceId}`,value:e.deviceId,label:e.label,onChange:e=>{let t=e.target.value;t!==`default`&&a?.(t),s?.()},name:i,selected:e.isSelected},e.deviceId)),o]})},jle=e=>{let{devices:t=[],selectedDeviceId:n,title:r,onChange:i,children:a,PreviewItem:o}=e,{close:s}=ZR(),{deviceList:c}=JR(t,n),l=(0,d.useCallback)(e=>{e!==`default`&&(i?.(e),s?.())},[i,s]);return(0,R.jsxs)(`div`,{className:`str-video__device-settings__device-kind`,children:[r&&(0,R.jsx)(`div`,{className:`str-video__device-settings__device-selector-title`,children:r}),c.map(e=>(0,R.jsx)(o,{device:e,onSelect:l},e.deviceId)),a]})},Mle=e=>{let{devices:t=[],selectedDeviceId:n,title:r,onChange:i,icon:a}=e,{deviceList:o,selectedDeviceInfo:s,selectedIndex:c}=JR(t,n),l=(0,d.useCallback)(e=>{let t=o[e].deviceId;t!==`default`&&i?.(t)},[o,i]);return(0,R.jsxs)(`div`,{className:`str-video__device-settings__device-kind`,children:[(0,R.jsx)(`div`,{className:`str-video__device-settings__device-selector-title`,children:r}),(0,R.jsx)(Ole,{icon:a,defaultSelectedIndex:c,defaultSelectedLabel:s.label,handleSelect:l,children:o.map(e=>(0,R.jsx)(Dle,{icon:a,label:e.label,selected:e.isSelected},e.deviceId))})]})},_z=e=>{if(e.visualType===`preview`){let{PreviewItem:t,...n}=e;return(0,R.jsx)(jle,{...n,PreviewItem:t})}let{visualType:t=`list`,icon:n,...r}=e;return t===`list`?(0,R.jsx)(Ale,{...r}):(0,R.jsx)(Mle,{...r,icon:n})},Nle=({title:e,visualType:t,volumeIndicatorVisible:n=!0})=>{let{useMicrophoneState:r}=NF(),{microphone:i,selectedDevice:a,devices:o}=r();return(0,R.jsx)(_z,{devices:o||[],selectedDeviceId:a,type:`audioinput`,onChange:async e=>{await i.select(e)},title:e,visualType:t,icon:`mic`,PreviewItem:Tle,children:n&&(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(`hr`,{className:`str-video__device-sett
466ings__separator`}),(0,R.jsx)(Cle,{})]})})},vz=({deviceId:e})=>{let t=(0,d.useRef)(null);return(0,d.useEffect)(()=>{let n=!1,r;return navigator.mediaDevices.getUserMedia({video:{deviceId:{exact:e}},audio:!1}).then(e=>{if(n){e.getTracks().forEach(e=>e.stop());return}r=e,t.current&&(t.current.srcObject=e)}).catch(console.error),()=>{n=!0,r?.getTracks().forEach(e=>e.stop())}},[e]),(0,R.jsx)(`div`,{className:`str-video__device-video-preview`,children:(0,R.jsx)(`video`,{ref:t,autoPlay:!0,playsInline:!0,muted:!0,className:`str-video__device-video-preview__video`})})},yz=({device:e,onSelect:t})=>e.deviceId===`default`?null:(0,R.jsxs)(`button`,{type:`button`,className:G(`str-video__device-preview`,{"str-video__device-preview--selected":e.isSelected}),onClick:()=>t(e.deviceId),"aria-pressed":e.isSelected,children:[(0,R.jsx)(vz,{deviceId:e.deviceId}),(0,R.jsx)(`span`,{className:`str-video__device-preview__label`,children:e.label})]}),bz=({title:e,visualType:t})=>{let{useCameraState:n}=NF(),{camera:r,devices:i,selectedDevice:a}=n();return(0,R.jsx)(_z,{devices:i||[],type:`videoinput`,selectedDeviceId:a,onChange:async e=>{await r.select(e)},title:e,visualType:t,icon:`camera`,PreviewItem:yz})};(0,d.forwardRef)(function({menuShown:e},t){let{t:n}=TF();return(0,R.jsx)(sz,{className:G(`str-video__device-settings__button`,{"str-video__device-settings__button--active":e}),title:n(`Toggle device menu`),icon:`device-settings`,ref:t})});var xz=e=>{let{t}=TF(),{caption:n,Menu:r=(0,R.jsx)(Nle,{visualType:`list`}),menuPlacement:i=`top`,onMenuToggle:a,optimisticUpdates:o,...s}=e,{hasPermission:c,requestPermission:l,isAwaitingPermission:u}=qR(bO.SEND_AUDIO),{useMicrophoneState:f,useLocalParticipant:p}=NF(),{microphone:m,hasBrowserPermission:h,isPromptingPermission:g,isTogglePending:_,optionsAwareIsMute:v}=f({optimisticUpdates:o}),y=!!p()?.interruptedTracks?.includes(yk.TrackType.AUDIO),[b,x]=(0,d.useState)(!1),S=pz(e,async()=>{c?await m.toggle():await l()});return(0,R.jsx)(PF,{requiredGrants:[bO.SEND_AUDIO],children:(0,R.jsx)(uz,{permission:bO.SEND_AUDIO,isAwaitingApproval:u,messageApproved:t(`You can now speak.`),messageAwaitingApproval:t(`Awaiting for an approval to speak.`),messageRevoked:t(`You can no longer speak.`),children:(0,R.jsx)(fz,{title:c?h?y?t(`Microphone is paused by your system`):n??t(`Mic`):t(`Check your browser mic permissions`):t(`You have no permission to share your audio`),tooltipDisabled:b,children:(0,R.jsxs)(cz,{active:v,caption:n,variant:`secondary`,disabled:!h||!c||!o&&_,"data-testid":v?`audio-unmute-button`:`audio-mute-button`,onClick:S,Menu:r,menuPlacement:i,menuOffset:16,...s,onMenuToggle:e=>{x(e),a?.(e)},children:[(0,R.jsx)(ez,{icon:v?`mic-off`:`mic`}),(!h||!c)&&(0,R.jsx)(`span`,{className:`str-video__no-media-permission`,children:`!`}),g&&(0,R.jsx)(`span`,{className:`str-video__pending-permission`,title:t(`Waiting for permission`),children:`?`}),y&&h&&c&&(0,R.jsx)(`span`,{className:`str-video__system-muted`,title:t(`Microphone is paused by your system`),children:`!`})]})})})})},Sz=e=>{let{t}=TF(),{caption:n,Menu:r=(0,R.jsx)(bz,{visualType:`list`}),menuPlacement:i=`top`,onMenuToggle:a,optimisticUpdates:o,...s}=e,{hasPermission:c,requestPermission:l,isAwaitingPermission:u}=qR(bO.SEND_VIDEO),{useCameraState:f,useCallSettings:p,useLocalParticipant:m}=NF(),{camera:h,optionsAwareIsMute:g,hasBrowserPermission:_,isPromptingPermission:v,isTogglePending:y}=f({optimisticUpdates:o}),b=!!m()?.interruptedTracks?.includes(yk.TrackType.VIDEO),x=p()?.video.enabled,[S,C]=(0,d.useState)(!1),w=pz(e,async()=>{c?await h.toggle():await l()});return(0,R.jsx)(PF,{requiredGrants:[bO.SEND_VIDEO],children:(0,R.jsx)(uz,{permission:bO.SEND_VIDEO,isAwaitingApproval:u,messageApproved:t(`You can now share your video.`),messageAwaitingApproval:t(`Awaiting for an approval to share your video.`),messageRevoked:t(`You can no longer share your video.`),children:(0,R.jsx)(fz,{title:c?_?x?b?t(`Camera is paused by your system`):n||t(`Video`):t(`Video publishing is disabled by the system`):t(`Check your browser video permissions`):t(`You have no permission to share your video`),tooltipDisabled:S,children:(0,R.jsxs)(cz,{active:g,caption:n,variant:`secondary`,disabled:!_||!c||!x||!o&&y,"data-testid":g?`video-unmute-button`:`video-mute-button`,onClick:w,Menu:r,menuPlacement:i,menuOffset:16,...s,onMenuToggle:e=>{C(e),a?.(e)},children:[(0,R.jsx)(ez,{icon:g?`camera-off`:`camera`}),(!_||!c||!x)&&(0,R.jsx)(`span`,{className:`str-video__no-media-permission`,children:`!`}),v&&(0,R.jsx)(`span`,{className:`str-video__pending-permission`,title:t(`Waiting for permission`),children:`?`}),b&&_&&c&&x&&(0,R.jsx)(`span`,{className:`str-video__system-muted`,title:t(`Camera is paused by your system`),children:`!`})]})})})})};(0,d.forwardRef)(function({menuShown:e},t){let{t:n}=TF();return(0,R.jsx)(fz,{title:n(`Leave call`),tooltipDisabled:e,children:(0,R.jsx)(sz,{icon:e?`close`:`call-end`,variant:e?`active`:`danger`,"data-testid":`leave-call-button`,ref:t})})});var Cz=({disabled:e,caption:t,onClick:n,onLeave:r})=>{let i=SF(),{t:a}=TF(),o=(0,d.useCallback)(async e=>{if(n)n(e);else if(i)try{await i.leave(),r?.()}catch(e){console.error(`Failed to leave call`,e),r?.(e)}},[n,r,i]);return(0,R.jsx)(sz,{disabled:e,icon:`call-end`,variant:`danger`,title:t??a(`Leave call`),"data-testid":`cancel-call-button`,onClick:o})},wz=({onLeave:e})=>
466(0,R.jsxs)(`div`,{className:`str-video__call-controls`,children:[(0,R.jsx)(PF,{requiredGrants:[bO.SEND_AUDIO],children:(0,R.jsx)(fle,{children:(0,R.jsx)(xz,{})})}),(0,R.jsx)(PF,{requiredGrants:[bO.SEND_VIDEO],children:(0,R.jsx)(Sz,{})}),(0,R.jsx)(PF,{requiredGrants:[bO.CREATE_REACTION],children:(0,R.jsx)(yle,{})}),(0,R.jsx)(PF,{requiredGrants:[bO.SCREENSHARE],children:(0,R.jsx)(Sle,{})}),(0,R.jsx)(PF,{requiredGrants:[bO.START_RECORD_CALL,bO.STOP_RECORD_CALL],children:(0,R.jsx)(gle,{})}),(0,R.jsx)(Cz,{onLeave:e})]});(0,d.lazy)(()=>pa(()=>import(`./latency-chart-Bj5OSYzg.es-Bm2HqoQy.js`),__vite__mapDeps([2,1])));var Tz;(function(e){e.GOOD=`Good`,e.OK=`Ok`,e.BAD=`Bad`})(Tz||={}),(0,d.forwardRef)(function(e,t){let{t:n}=TF(),{caption:r,menuShown:i}=e;return(0,R.jsx)(cz,{ref:t,active:i,caption:r,title:r||n(`Statistics`),"data-testid":`stats-button`,children:(0,R.jsx)(ez,{icon:`stats`})})}),(0,d.forwardRef)(function(e,t){return(0,R.jsx)(sz,{enabled:e.menuShown,icon:`ellipsis`,ref:t})}),(0,d.forwardRef)(function(e,t){return(0,R.jsx)(sz,{enabled:e.menuShown,icon:`filter`,ref:t})}),(0,d.createContext)(null),W.JOINING,W.RINGING,W.MIGRATING,W.RECONNECTING,W.RECONNECTING_FAILED,W.OFFLINE,W.IDLE,W.UNKNOWN,W.JOINED,W.LEFT,(0,d.forwardRef)(function(e,t){let{permissionRequests:n,handleUpdatePermission:r,...i}=e,{t:a}=TF();return(0,R.jsx)(`div`,{className:`str-video__permission-requests-list`,ref:t,...i,children:n.map((e,t)=>{let{user:n,permissions:i}=e;return(0,R.jsx)(d.Fragment,{children:i.map(t=>(0,R.jsxs)(`div`,{className:`str-video__permission-request`,children:[(0,R.jsx)(`div`,{className:`str-video__permission-request__message`,children:Dz(n.name||n.id,t,a)}),(0,R.jsx)(Ez,{className:`str-video__permission-request__button--allow`,type:`button`,onClick:r(e,`grant`),children:a(`Allow`)}),(0,R.jsx)(Ez,{className:`str-video__permission-request__button--reject`,type:`button`,onClick:r(e,`revoke`),children:a(`Revoke`)}),(0,R.jsx)(Ez,{className:`str-video__permission-request__button--reject`,type:`button`,onClick:r(e,`dismiss`),children:a(`Dismiss`)})]},t))},`${n.id}/${t}`)})})});var Ez=e=>{let{className:t,...n}=e;return(0,R.jsx)(`button`,{className:G(`str-video__permission-request__button`,t),...n})},Dz=(e,t,n)=>{switch(t){case bO.SEND_AUDIO:return n(`{{ userName }} is requesting to speak`,{userName:e});case bO.SEND_VIDEO:return n(`{{ userName }} is requesting to share their camera`,{userName:e});case bO.SCREENSHARE:return n(`{{ userName }} is requesting to present their screen`,{userName:e});default:return n(`{{ userName }} is requesting permission: {{ permission }}`,{userName:e,permission:t})}},Oz=(0,d.forwardRef)(function(e,t){return(0,R.jsx)(sz,{enabled:e.menuShown,icon:`ellipsis`,ref:t})}),kz=()=>{let e=SF(),{t}=TF();return(0,R.jsxs)(`div`,{className:`str-video__screen-share-overlay`,children:[(0,R.jsx)(ez,{icon:`screen-share-off`}),(0,R.jsx)(`span`,{className:`str-video__screen-share-overlay__title`,children:t(`You are presenting your screen`)}),(0,R.jsxs)(`button`,{onClick:()=>{e?.screenShare.disable().catch(e=>{console.error(`Failed to stop screen sharing:`,e)})},type:`button`,className:`str-video__screen-share-overlay__button`,children:[(0,R.jsx)(ez,{icon:`close`}),` `,t(`Stop Screen Sharing`)]})]})},Az=({indicatorsVisible:e=!0,menuPlacement:t=`bottom-start`,showMenuButton:n=!0,ParticipantActionsContextMenu:r=ole})=>{let{participant:i,trackType:a}=WR(),o=jj(i);return i.isLocalParticipant&&o&&a===`screenShareTrack`?(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(kz,{}),(0,R.jsx)(jz,{indicatorsVisible:e})]}):(0,R.jsxs)(R.Fragment,{children:[n&&(0,R.jsx)(QR,{strategy:`fixed`,placement:t,ToggleButton:Oz,children:(0,R.jsx)(r,{})}),(0,R.jsx)(_le,{participant:i}),(0,R.jsx)(jz,{indicatorsVisible:e})]})},jz=({indicatorsVisible:e=!0})=>{let{participant:t,trackType:n}=WR(),{isLocalParticipant:r,connectionQuality:i,pin:a,sessionId:o,name:s,userId:c}=t,l=SF(),{t:u}=TF(),d=!!i&&yk.ConnectionQuality[i].toLowerCase(),f=Aj(t),p=kj(t),m=!!a&&a.isLocalPin,h=n===`none`?!1:Pj(t,n),g=Koe(t);return(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(`div`,{className:`str-video__participant-details`,children:(0,R.jsxs)(`div`,{className:`str-video__participant-details__name`,children:[s||c,e&&g&&(0,R.jsx)(dz,{className:`str-video__participant-details__name--audio-connecting`,tooltip:u(`Audio is connecting...`)}),e&&!f&&(0,R.jsx)(`span`,{className:`str-video__participant-details__name--audio-muted`}),e&&!p&&(0,R.jsx)(`span`,{className:`str-video__participant-details__name--video-muted`}),e&&h&&(0,R.jsx)(`span`,{title:u(`Video paused due to insufficient bandwidth`),className:`str-video__participant-details__name--track-paused`}),e&&a&&(0,R.jsx)(`span`,{title:u(m?`Unpin`:`Pinned`),onClick:m?()=>l?.unpin(o):void 0,className:`str-video__participant-details__name--pinned`}),e&&(0,R.jsx)(Mz,{})]})}),e&&(0,R.jsx)(lz,{isVisible:r&&i===yk.ConnectionQuality.POOR,message:u(`Poor connection quality`),children:d&&(0,R.jsx)(`span`,{className:G(`str-video__participant-details__connection-quality`,`str-video__participant-details__connection-quality--${d}`),title:d})})]})},Mz=()=>{let{participant:e}=WR(),{isSpeaking:t,isDominantSpeaker:n}=e;return(0,R.jsxs)(`span`,{className:G(`str-video__speech-indicator`,t&&`str-video__speech-indicator--speaking`,n&&`str-video__speech-indicator--dominant`),children:[(0,R.jsx)(`span`,{className:`str-video__speech-indicator__bar`}),(0,R.jsx)(`span`,{className:`str-video__speech-indicator__bar`}),(0,R.jsx)(`span`,{className:`str-video__speech-indicator__bar`})]})},Nz=(0,d.forwardRef)(function({participant:e,trackType:t=`videoTrack`,mirror:n,muteAudio:r,refs:{setVideoElement:i,setVideoPlaceholderElement:a}={},className:o,VideoPlaceholder:s,PictureInPicturePlaceholder:c,ParticipantViewUI:l=Az},u){let{isLocalParticipant:f,isSpeaking:p,isDominantSpeaker:m,sessionId:h}=e,g=Aj(e),_=kj(e),v=Mj(e),[y,b]=(0,d.useState)(null),[x,S]=(0,d.useState)(null),[C,w]=(0,d.useState)(null);ule({sessionId:h,trackedElement:y,trackType:t});let{useIncomingVideoSettings:T}=NF(),{isParticipantVideoEnabled:E}=T(),D=(0,d.useMemo)(()=>({participant:e,participantViewElement:y,videoElement:x,videoPlaceholderElement:C,trackType:t}),[x,C,e,y,t]),O=(0,d.useMemo)(()=>({setVideoElement:e=>{i?.(e),S(e)},setVideoPlaceholderElement:e=>{a?.(e),w(e)}}),[i,a]);return(0,R.jsx)(`div`,{"data-testid":`participant-view`,ref:e=>{iz(u,e),b(e)},className:G(`str-video__participant-view`,m&&`str-video__participant-view--dominant-speaker`,p&&`str-video__participant-view--speaking`,!_&&`str-video__participant-view--no-video`,!g&&`str-video__participant-view--no-audio`,o),children:(0,R.jsxs)(UR.Provider,{value:D,children:[!f&&!r&&(0,R.jsxs)(R.Fragment,{children:[g&&(0,R.jsx)(VR,{participant:e,trackType:`audioTrack`}),v&&(0,R.jsx)(VR,{participant:e,trackType:`screenShareAudioTrack`})]}),(0,R.jsx)(oz,{VideoPlaceholder:s,PictureInPicturePlaceholder:c,participant:e,trackType:t,refs:O,enabled:f||t!==`videoTrack`||E(e.sessionId),mirror:n,autoPlay:!0}),nz(l)?(0,R.jsx)(l,{}):l]})})});Nz.displayName=`ParticipantView`;var Pz=Yae;Pz.displayName=`StreamCall`;var Fz={en:{Joining:`Joining`,Mic:`Mic`,"No internet connection":`No internet connection`,"Re-connecting":`Re-connecting`,Ringing:`Ringing`,"Screen Share":`Screen Share`,"Select a Camera":`Select a Camera`,"Select a Mic":`Select a Mic`,"Select Speakers":`Select Speakers`,Speakers:`Speakers`,Video:`Video`,"You are muted. Unmute to speak.":`You are muted. Unmute to speak.`,"Backgroun
466d filters performance is degraded. Consider disabling filters for better performance.":`Background filters performance is degraded. Consider disabling filters for better performance.`,Live:`Live`,"Livestream starts soon":`Livestream starts soon`,"Livestream starts at {{ time }}":`Livestream starts at {{ time }}`,"{{ count }} participants joined early_one":`{{ count }} participant joined early`,"{{ count }} participants joined early_other":`{{ count }} participants joined early`,"You can now speak.":`You can now speak.`,"Awaiting for an approval to speak.":`Awaiting for an approval to speak.`,"You can no longer speak.":`You can no longer speak.`,"You can now share your video.":`You can now share your video.`,"Awaiting for an approval to share your video.":`Awaiting for an approval to share your video.`,"You can no longer share your video.":`You can no longer share your video.`,"Waiting for recording to stop...":`Waiting for recording to stop...`,"Waiting for recording to start...":`Waiting for recording to start...`,"Record call":`Record call`,Reactions:`Reactions`,Statistics:`Statistics`,"You can now share your screen.":`You can now share your screen.`,"Awaiting for an approval to share screen.":`Awaiting for an approval to share screen.`,"You can no longer share your screen.":`You can no longer share your screen.`,"Share screen":`Share screen`,"Incoming Call...":`Incoming Call...`,"Calling...":`Calling...`,"Mute All":`Mute All`,Invite:`Invite`,Join:`Join`,You:`You`,Me:`Me`,Unknown:`Unknown`,"Toggle device menu":`Toggle device menu`,Default:`Default`,"Call Recordings":`Call Recordings`,Refresh:`Refresh`,"Check your browser video permissions":`Check your browser video permissions`,"Video publishing is disabled by the system":`Video publishing is disabled by the system`,"You have no permission to share your video":`You have no permission to share your video`,"You have no permission to share your audio":`You have no permission to share your audio`,"You are presenting your screen":`You are presenting your screen`,"Stop Screen Sharing":`Stop Screen Sharing`,Allow:`Allow`,Revoke:`Revoke`,Dismiss:`Dismiss`,"Microphone on":`Microphone on`,"Microphone off":`Microphone off`,"Microphone is paused by your system":`Microphone is paused by your system`,"Camera on":`Camera on`,"Camera off":`Camera off`,"Camera is paused by your system":`Camera is paused by your system`,"No camera found":`No camera found`,"Video is disabled":`Video is disabled`,Pinned:`Pinned`,Unpin:`Unpin`,Pin:`Pin`,"Pin for everyone":`Pin for everyone`,"Unpin for everyone":`Unpin for everyone`,Block:`Block`,Kick:`Kick`,"Turn off video":`Turn off video`,"Turn off screen share":`Turn off screen share`,"Mute audio":`Mute audio`,"Mute screen share audio":`Mute screen share audio`,"Allow audio":`Allow audio`,"Allow video":`Allow video`,"Allow screen sharing":`Allow screen sharing`,"Disable audio":`Disable audio`,"Disable video":`Disable video`,"Disable screen sharing":`Disable screen sharing`,Enter:`Enter`,Leave:`Leave`,"Leave call":`Leave call`,"End call for all":`End call for all`,"{{ direction }} fullscreen":`{{ direction }} fullscreen`,"{{ direction }} picture-in-picture":`{{ direction }} picture-in-picture`,"Dominant Speaker":`Dominant Speaker`,"Poor connection quality":`Poor connection quality. Please check your internet connection.`,"Video paused due to insufficient bandwidth":`Video paused due to insufficient bandwidth`,"Audio is connecting...":`Audio is connecting...`,Participants:`Participants`,Anonymous:`, and ({{ count }}) anonymous`,"No participants found":`No participants found`,"Participants ({{ numberOfParticipants }})":`Participants ({{ numberOfParticipants }})`,"{{ userName }} is sharing their screen":`{{ userName }} is sharing their screen`,"{{ userName }} is requesting to speak":`{{ userName }} is requesting to speak`,"{{ userName }} is requesting to share their camera":`{{ userName }} is requesting to share their camera`,"{{ userName }} is requesting to present their screen":`{{ userName }} is requesting to present their screen`,"{{ userName }} is requesting permission: {{ permission }}":`{{ userName }} is requesting permission: {{ permission }}`,"Applying...":`Applying...`,"Disable blur":`Disable blur`,"Blur background":`Blur background`,"Migrating...":`Migrating...`,"Reconnecting...":`Reconnecting...`,"You are offline. Check your internet connection.":`You are offline. Check your internet connection.`,"Failed to restore connection. Please try again.":`Failed to restore connection. Please try again.`,"Failed to join. Please try again.":`Failed to join. Please try again.`,"Set up your call before joining":`Set up your call before joining`,"Please grant your browser permission to access your camera and microphone.":`Please grant your browser permission to access your camera and microphone.`,"Start call":`Start call`,Speaker:`Speaker`,Microphone:`Microphone`,Backstage:`Backstage`,"Go Live":`Go Live`,"Stop Live":`End Live`,"Enter Backstage":`Enter Backstage`,"Prepare your livestream":`Prepare your livestream`,"Ready to go live":`Ready to go live`,"Stream is ready!":`Stream is ready!`,"Waiting for the livestream to start":`Waiting for the livestream to start`,"{{ count }} waiting":`{{ count }} waiting`,"Join Stream":`Join Stream`,"Join automatically when stream starts":`Join automatically when stream starts`,"Display name":`Display name`,"Permission needed":`Permission needed`,"Call ended":`Call ended`,"Rejoin call":`Rejoin call`,"Left by mistake?":`Left by mistake?`,"Help us improve":`Help us improve`,"Leave feedback":`Leave feedback`,"Failed to rejoin. Please try again.":`Failed to rejoin. Please try again.`,"Share your feedback":`Share your feedback`,"Tell us about your experience...":`Tell us about your experience...`,"Submit feedback":`Submit feedback`,"Feedback message":`Feedback message`,"How 
466was your call quality?":`How was your call quality?`,"Rate {{ count }} star_one":`Rate {{ count }} star`,"Rate {{ count }} star_other":`Rate {{ count }} stars`,"Thank you!":`Thank you!`,"Your feedback helps improve call quality.":`Your feedback helps improve call quality.`}},Iz=e=>(0,R.jsx)(toe,{translationsOverrides:Fz,...e});Iz.displayName=`StreamVideo`;function Lz(e,t){return`$and`in t?t.$and.every(t=>Lz(e,t)):`$or`in t?t.$or.some(t=>Lz(e,t)):`$not`in t?!Lz(e,t.$not):zz(e,t)}var Rz=e=>typeof e==`string`&&/^((?:(\d{4}-\d{2}-\d{2})T(\d{2}:\d{2}:\d{2}(?:\.\d+)?))(Z|[+-]\d{2}:\d{2})?)$/.test(e);function zz(e,t){let n=!0;for(let r of Object.keys(t)){let i=t[r],a=i&&typeof i==`object`,o=e[r];if(o instanceof Date?o=o.getTime():Rz(o)&&(o=new Date(o).getTime()),a&&`$eq`in i){let e=i,t=Rz(e.$eq)?new Date(e.$eq).getTime():e.$eq;n&&=t===o}else if(a&&`$neq`in i)n&&=i.$neq!==o;else if(a&&`$in`in i)n&&=i.$in.includes(o);else if(a&&`$contains`in i)if(Array.isArray(o)){let e=i;n&&=o.includes(e.$contains)}else n=!1;else if(a&&`$gt`in i){let e=i,t=Rz(e.$gt)?new Date(e.$gt).getTime():e.$gt;n&&=o>t}else if(a&&`$gte`in i){let e=i,t=Rz(e.$gte)?new Date(e.$gte).getTime():e.$gte;n&&=o>=t}else if(a&&`$lt`in i){let e=i,t=Rz(e.$lt)?new Date(e.$lt).getTime():e.$lt;n&&=o<t}else if(a&&`$lte`in i){let e=i,t=Rz(e.$lte)?new Date(e.$lte).getTime():e.$lte;n&&=o<=t}else n&&=i===o;if(!n)return!1}return!0}var Bz=({excludeLocalParticipant:e=!1,filterParticipants:t})=>{let{useParticipants:n,useRemoteParticipants:r}=NF(),i=n(),a=r();return(0,d.useMemo)(()=>{let n=e?a:i;return t?Vz(n,t):n},[i,a,e,t])},Vz=(e,t)=>{let n=typeof t==`function`?t:e=>Lz({userId:e.userId,isSpeaking:e.isSpeaking,isDominantSpeaker:e.isDominantSpeaker,name:e.name,roles:e.roles,isPinned:Nj(e),hasVideo:kj(e),hasAudio:Aj(e),hasScreenShare:jj(e)},t);return e.filter(n)},Hz=e=>{(0,d.useEffect)(()=>{if(e)return e.setSortParticipantsBy(Xj),()=>{Gz(e)}},[e])},Uz=(e,t)=>{(0,d.useEffect)(()=>{if(e)return t?e.setSortParticipantsBy(Dj(Lj,Kz)):e.setSortParticipantsBy(Yj),()=>{Gz(e)}},[e,t])},Wz=()=>{let{useRawParticipants:e}=NF(),t=e();return(0,d.useMemo)(()=>t.filter(e=>!e.isLocalParticipant),[t])},Gz=e=>{let t=ZN.get(e.type);e.setSortParticipantsBy(t.options.sortParticipantsBy||Jj)},Kz=(e,t)=>e.isLocalParticipant?1:t.isLocalParticipant?-1:0,qz=e=>{let{useParticipants:t,useHasOngoingScreenShare:n}=NF(),r=SF(),i=t(),[a]=i,o=Wz(),s=n(),c=s?i.find(jj):void 0;Hz(r);let{floatingParticipantProps:l,muted:u,ParticipantViewUI:d}=e,f=d??(0,R.jsx)(Yz,{showParticipantCount:e.showParticipantCount,showDuration:e.showDuration,showLiveBadge:e.showLiveBadge,showMuteButton:e.showMuteButton,showSpeakerName:e.showSpeakerName,enableFullScreen:e.enableFullScreen}),p=s&&(d??(0,R.jsx)(Yz,{showParticipantCount:l?.showParticipantCount??!1,showDuration:l?.showDuration??!1,showLiveBadge:l?.showLiveBadge??!1,showSpeakerName:l?.showSpeakerName??!0,enableFullScreen:l?.enableFullScreen??!0}));return(0,R.jsxs)(`div`,{className:`str-video__livestream-layout__wrapper`,children:[!u&&(0,R.jsx)(HR,{participants:o}),s&&c&&(0,R.jsx)(Nz,{className:`str-video__livestream-layout__screen-share`,participant:c,ParticipantViewUI:f,trackType:`screenShareTrack`,muteAudio:!0}),a&&(0,R.jsx)(Nz,{className:G(s&&G(`str-video__livestream-layout__floating-participant`,`str-video__livestream-layout__floating-participant--${l?.position??`top-right`}`)),participant:a,ParticipantViewUI:p||f,mirror:e.mirrorLocalParticipantVideo===!1?!1:void 0,muteAudio:!0})]})};qz.displayName=`LivestreamLayout`;var Jz=e=>{let{showEarlyParticipantCount:t=!0,humanizeParticipantCount:n=!0}=e,{useParticipantCount:r,useCallStartsAt:i}=NF(),a=r(),o=i(),{t:s}=TF(),[c,l]=(0,d.useState)(()=>!!o&&o.getTime()<Date.now());return(0,d.useEffect)(()=>{if(!o||c)return;let e=setInterval(()=>{o.getTime()<Date.now()&&l(!0)},1e3);return()=>clearInterval(e)},[o,c]),(0,R.jsx)(`div`,{className:`str-video__livestream-layout__wrapper`,children:(0,R.jsxs)(`div`,{className:`str-video__livestream-layout__backstage`,children:[o&&(0,R.jsx)(`span`,{className:`str-video__livestream-layout__starts-at`,children:c?s(`Livestream starts soon`):s(`Livestream starts at {{ time }}`,{time:o.toLocaleTimeString([],{hour:`2-digit`,minute:`2-digit`})})}),t&&(0,R.jsx)(`span`,{className:`str-video__livestream-layout__early-viewers-count`,children:s(`{{ count }} participants joined early`,{count:n?VP(a):a})})]})})};Jz.displayName=`BackstageLayout`;var Yz=e=>{let{enableFullScreen:t=!0,showParticipantCount:n=!0,humanizeParticipantCount:r=!0,showDuration:i=!0,showLiveBadge:a=!0,showMuteButton:o=!0,showSpeakerName:s=!1}=e,c=t||n||i||a||o||s,{participant:l,participantViewElement:u}
466=WR(),{useParticipantCount:d,useSpeakerState:f}=NF(),p=d(),m=Xz(),h=Zz(),{speaker:g,volume:_}=f(),v=_===0,{t:y}=TF();return(0,R.jsx)(`div`,{className:`str-video__livestream-layout__overlay`,children:c&&(0,R.jsxs)(`div`,{className:`str-video__livestream-layout__overlay__bar`,children:[(0,R.jsxs)(`div`,{className:`str-video__livestream-layout__overlay__bar-left`,children:[a&&(0,R.jsx)(`span`,{className:`str-video__livestream-layout__live-badge`,children:y(`Live`)}),n&&(0,R.jsx)(`span`,{className:`str-video__livestream-layout__viewers-count`,children:r?VP(p):p}),s&&(0,R.jsx)(`span`,{className:`str-video__livestream-layout__speaker-name`,title:l.name||l.userId||``,children:l.name||l.userId||``})]}),(0,R.jsx)(`div`,{className:`str-video__livestream-layout__overlay__bar-center`,children:i&&(0,R.jsx)(`span`,{className:`str-video__livestream-layout__duration`,children:Qz(m)})}),(0,R.jsxs)(`div`,{className:`str-video__livestream-layout__overlay__bar-right`,children:[o&&(0,R.jsx)(`span`,{className:G(`str-video__livestream-layout__mute-button`,v&&`str-video__livestream-layout__mute-button--muted`),onClick:()=>g.setVolume(+!!v)}),t&&u&&u.requestFullscreen!==void 0&&(0,R.jsx)(`span`,{className:`str-video__livestream-layout__go-fullscreen`,onClick:h})]})]})})},Xz=()=>{let{useIsCallLive:e,useCallSession:t}=NF(),n=e(),r=t(),[i,a]=(0,d.useState)(()=>{if(!r||!r.live_started_at)return 0;let e=new Date(r.live_started_at);return Math.floor((new Date().getTime()-e.getTime())/1e3)});return(0,d.useEffect)(()=>{if(!n)return;let e=setInterval(()=>{a(e=>e+1)},1e3);return()=>{clearInterval(e)}},[n]),i},Zz=()=>{let{participantViewElement:e}=WR(),[t,n]=(0,d.useState)(!!document.fullscreenElement);return(0,d.useEffect)(()=>{let e=()=>n(!!document.fullscreenElement);return document.addEventListener(`fullscreenchange`,e),()=>{document.removeEventListener(`fullscreenchange`,e)}},[]),(0,d.useCallback)(()=>{t?document.exitFullscreen().catch(e=>{console.error(`Failed to exit fullscreen`,e)}):e?.requestFullscreen().catch(e=>{console.error(`Failed to enter fullscreen`,e)})},[t,e])},Qz=e=>{let t=Math.floor(e/86400),n=Math.floor(e/3600),r=Math.floor(e%3600/60),i=e%60;return`${t?t+` `:``}${n?n+`:`:``}${r<10?`0`:``}${r}:${i<10?`0`:``}${i}`},$z=16,eB=({group:e,mirror:t,VideoPlaceholder:n,PictureInPicturePlaceholder:r,ParticipantViewUI:i})=>(0,R.jsx)(`div`,{"data-group-size":e.length,className:G(`str-video__paginated-grid-layout__group`,{"str-video__paginated-grid-layout--one":e.length===1,"str-video__paginated-grid-layout--two-four":e.length>=2&&e.length<=4,"str-video__paginated-grid-layout--five-nine":e.length>=5&&e.length<=9}),children:e.map(e=>(0,R.jsx)(Nz,{participant:e,muteAudio:!0,mirror:t,VideoPlaceholder:n,PictureInPicturePlaceholder:r,ParticipantViewUI:i},e.sessionId))}),tB=e=>{let{groupSize:t=(e.groupSize||0)>0&&e.groupSize||$z,excludeLocalParticipant:n=!1,filterParticipants:r,mirrorLocalParticipantVideo:i=!0,pageArrowsVisible:a=!0,VideoPlaceholder:o,ParticipantViewUI:s=Az,PictureInPicturePlaceholder:c,muted:l}=e,[u,f]=(0,d.useState)(0),[p,m]=(0,d.useState)(null),h=SF(),g=Wz(),_=Bz({excludeLocalParticipant:n,filterParticipants:r});Hz(h),(0,d.useEffect)(()=>{if(!p||!h)return;let e=h.setViewport(p);return()=>e?.()},[p,h]);let v=(0,d.useMemo)(()=>rz(_,t),[_,t]),y=v.length;(0,d.useEffect)(()=>{u>y-1&&f(Math.max(0,y-1))},[u,y]);let b=v[u],x=i?void 0:!1;return h?(0,R.jsxs)(`div`,{className:`str-video__paginated-grid-layout__wrapper`,ref:m,children:[!l&&(0,R.jsx)(HR,{participants:g}),(0,R.jsxs)(`div`,{className:`str-video__paginated-grid-layout`,children:[a&&y>1&&(0,R.jsx)(sz,{icon:`caret-left`,disabled:u===0,onClick:()=>f(e=>Math.max(0,e-1))}),b&&(0,R.jsx)(eB,{group:b,mirror:x,VideoPlaceholder:o,ParticipantViewUI:s,PictureInPicturePlaceholder:c}),a&&y>1&&(0,R.jsx)(sz,{disabled:u===y-1,icon:`caret-right`,onClick:()=>f(e=>Math.min(y-1,e+1))})]})]}):null};tB.displayName=`PaginatedGridLayout`;var nB=(e,t,n)=>{let[r,i]=(0,d.useState)({vertical:typeof n==`number`?n:null,horizontal:typeof n==`number`?n:null});return(0,d.useEffect)(()=>{if(!t||!e||typeof n==`number`||n===void 0)return;let r=null,a=null,o=new ResizeObserver((n,o)=>
466{if(n.length>1){let e=t.firstChild;e&&(a=e.clientHeight,r=e.clientWidth,o.unobserve(t))}if(a===null||r===null)return;let s=Math.floor(e.clientHeight/a),c=Math.floor(e.clientWidth/r);i(e=>e.vertical!==s||e.horizontal!==c?{vertical:s,horizontal:c}:e)});return o.observe(e),o.observe(t),()=>{o.disconnect()}},[t,n,e]),r},rB=()=>(0,R.jsx)(Az,{menuPlacement:`top-end`}),iB=({ParticipantViewUIBar:e=rB,ParticipantViewUISpotlight:t=Az,VideoPlaceholder:n,PictureInPicturePlaceholder:r,participantsBarPosition:i=`bottom`,participantsBarLimit:a,mirrorLocalParticipantVideo:o=!0,excludeLocalParticipant:s=!1,filterParticipants:c,pageArrowsVisible:l=!0,muted:u,enableDragToScroll:f=!1})=>{let p=SF(),{useParticipants:m}=NF(),h=m(),g=Wz(),[_,...v]=Bz({excludeLocalParticipant:s,filterParticipants:c}),[y,b]=(0,d.useState)(null),[x,S]=(0,d.useState)(null),[C,w]=(0,d.useState)(null),T=_&&jj(_),E=nB(C,x,a),D=i===`left`||i===`right`,O=i===`top`||i===`bottom`;(0,d.useEffect)(()=>{if(!y||!p)return;let e=p.setViewport(y);return()=>e?.()},[y,p]),Uz(p,h.length===2),rle(y,{enabled:f});let k=v,A=D?E.vertical:E.horizontal;a!==void 0&&A!==null&&(k=v.slice(0,A-+!!T));let j=o?void 0:!1;if(!p)return null;let M=i&&(k.length>0||T);return(0,R.jsxs)(`div`,{className:`str-video__speaker-layout__wrapper`,children:[!u&&(0,R.jsx)(HR,{participants:g}),(0,R.jsxs)(`div`,{className:G(`str-video__speaker-layout`,i&&`str-video__speaker-layout--variant-${i}`),children:[(0,R.jsx)(`div`,{className:`str-video__speaker-layout__spotlight`,children:_&&(0,R.jsx)(Nz,{participant:_,muteAudio:!0,mirror:j,trackType:T?`screenShareTrack`:`videoTrack`,ParticipantViewUI:t,VideoPlaceholder:n,PictureInPicturePlaceholder:r})}),M&&(0,R.jsxs)(`div`,{ref:w,className:`str-video__speaker-layout__participants-bar-buttons-wrapper`,children:[(0,R.jsx)(`div`,{className:`str-video__speaker-layout__participants-bar-wrapper`,ref:b,children:(0,R.jsxs)(`div`,{ref:S,className:`str-video__speaker-layout__participants-bar`,children:[T&&(0,R.jsx)(`div`,{className:`str-video__speaker-layout__participant-tile`,children:(0,R.jsx)(Nz,{participant:_,ParticipantViewUI:e,VideoPlaceholder:n,PictureInPicturePlaceholder:r,mirror:j,muteAudio:!0})},_.sessionId),k.map(t=>(0,R.jsx)(`div`,{className:`str-video__speaker-layout__participant-tile`,children:(0,R.jsx)(Nz,{participant:t,ParticipantViewUI:e,VideoPlaceholder:n,PictureInPicturePlaceholder:r,mirror:j,muteAudio:!0})},t.sessionId))]})}),l&&D&&(0,R.jsx)(oB,{scrollWrapper:y}),l&&O&&(0,R.jsx)(aB,{scrollWrapper:y})]})]})]})};iB.displayName=`SpeakerLayout`;var aB=({scrollWrapper:e})=>{let t=nle(e);return(0,R.jsxs)(R.Fragment,{children:[t&&t!==`start`&&(0,R.jsx)(sz,{onClick:()=>{e?.scrollBy({left:-150,behavior:`smooth`})},icon:`caret-left`,className:`str-video__speaker-layout__participants-bar--button-left`}),t&&t!==`end`&&(0,R.jsx)(sz,{onClick:()=>{e?.scrollBy({left:150,behavior:`smooth`})},icon:`caret-right`,className:`str-video__speaker-layout__participants-bar--button-right`})]})},oB=({scrollWrapper:e})=>{let t=tle(e);return(0,R.jsxs)(R.Fragment,{children:[t&&t!==`top`&&(0,R.jsx)(sz,{onClick:()=>{e?.scrollBy({top:-150,behavior:`smooth`})},icon:`caret-up`,className:`str-video__speaker-layout__participants-bar--button-top`}),t&&t!==`bottom`&&(0,R.jsx)(sz,{onClick:()=>{e?.scrollBy({top:150,behavior:`smooth`})},icon:`caret-down`,className:`str-video__speaker-layout__participants-bar--button-bottom`})]})},sB=e=>{let{t}=TF(),{excludeLocalParticipant:n=!1,filterParticipants:r,mirrorLocalParticipantVideo:i=!0,VideoPlaceholder:a,ParticipantViewUI:o=Az}=e,[s,c]=(0,d.useState)(null),l=SF(),u=Bz({excludeLocalParticipant:n,filterParticipants:r}),f=u.find(e=>jj(e));Hz(l),(0,d.useEffect)(()=>{if(!(!s||!l))return l.setViewport(s)},[s,l]);let p=i?void 0:!1;return l?(0,R.jsxs)(`div`,{className:`str-video__pip-layout`,ref:c,children:[f&&(f.isLocalParticipant?(0,R.jsxs)(`div`,{className:`str-video__pip-screen-share-local`,children:[(0,R.jsx)(ez,{icon:`screen-share-off`}),(0,R.jsx)(`span`,{className:`str-video__pip-screen-share-local__title`,children:t(`You are presenting your screen`)})]}):(0,R.jsx)(Nz,{participant:f,trackType:`screenShareTrack`,muteAudio:!0,mirror:!1,VideoPlaceholder:a,ParticipantViewUI:o})),u.map(e=>(0,R.jsx)(Nz,{participant:e,muteAudio:!0,mirror:p,VideoPlaceholder:a,ParticipantViewUI:o},e.sessionId))]}):null};sB.displayName=`PipLayout.Pip`;var cB=()=>(0,R.jsx)(HR,{participants:Wz()});cB.displayName=`PipLayout.Host`;var lB=e=>e===1?`single`:e<=5?`small`:e<=9?`medium`:e<=16?`large`:`overflow`,uB=e=>{let{t}=TF(),{excludeLocalParticipant:n=!1,filterParticipants:r,mirrorLocalParticipantVideo:i=!0,groupSize:a=9,pageArrowsVisible:o=!0,VideoPlaceholder:s,ParticipantViewUI:c=Az}=e,[l,u]=(0,d.useState)(0),[f,p]=(0,d.useState)(null),m=SF(),h=Bz({excludeLocalParticipant:n,filterParticipants:r}),g=h.find(e=>jj(e));Hz(m),(0,d.useEffect)(()=>
466{if(!(!f||!m))return m.setViewport(f)},[f,m]);let _=(0,d.useMemo)(()=>rz(h,a),[h,a]),v=_.length;l>v-1&&u(Math.max(0,v-1));let y=_[l],b=i?void 0:!1;return m?(0,R.jsxs)(`div`,{className:`str-video__pip-layout str-video__pip-layout--grid`,ref:p,children:[g&&(g.isLocalParticipant?(0,R.jsxs)(`div`,{className:`str-video__pip-screen-share-local`,children:[(0,R.jsx)(ez,{icon:`screen-share-off`}),(0,R.jsx)(`span`,{className:`str-video__pip-screen-share-local__title`,children:t(`You are presenting your screen`)})]}):(0,R.jsx)(Nz,{participant:g,trackType:`screenShareTrack`,muteAudio:!0,mirror:!1,VideoPlaceholder:s,ParticipantViewUI:c})),(0,R.jsxs)(`div`,{className:`str-video__pip-layout__grid-container`,children:[o&&l>0&&(0,R.jsx)(sz,{icon:`caret-left`,onClick:()=>u(e=>Math.max(0,e-1)),className:`str-video__pip-layout__pagination-button str-video__pip-layout__pagination-button--left`}),y&&(0,R.jsx)(`div`,{className:G(`str-video__pip-layout__grid`,`str-video__pip-layout__grid--${lB(y.length)}`),children:y.map(e=>(0,R.jsx)(Nz,{participant:e,muteAudio:!0,mirror:b,VideoPlaceholder:s,ParticipantViewUI:c},e.sessionId))}),o&&l<v-1&&(0,R.jsx)(sz,{icon:`caret-right`,onClick:()=>u(e=>Math.min(v-1,e+1)),className:`str-video__pip-layout__pagination-button str-video__pip-layout__pagination-button--right`})]})]}):null};uB.displayName=`PipLayout.Grid`;var[dB,fB,pB]=`1.37.4`.split(`.`);mM({type:yk.SdkType.REACT,major:dB,minor:fB,patch:pB});var mB=`a26s76cq57aj`,hB=null,gB=async(e,t)=>hB&&hB?.user?.id===e.id?hB:(hB&&await _B(),hB=new BP({apiKey:mB,user:e,token:t}),hB),_B=async()=>{if(hB)try{await hB.disconnectUser(),hB=null}catch(e){console.error(`Error disconnecting Stream client:`,e)}};function vB(e,t,n,r){let[i,a]=(0,d.useState)(null),[o,s]=(0,d.useState)(null),[c,l]=(0,d.useState)(null),[u,f]=(0,d.useState)(null),[p,m]=(0,d.useState)(!0);return(0,d.useEffect)(()=>{let i=null,o=null;return e&&!t&&(async()=>{if(e?.callId&&!(!n&&!r)&&e.status!==`completed`)try{let{token:t,userId:n,userName:r,userImage:c}=await rp.getStreamToken(),u=await gB({id:n,name:r,image:c},t);a(u),i=u.call(`default`,e.callId),await i.join({create:!0}),s(i),o=Ew.getInstance(`a26s76cq57aj`),o.userID!==n&&await o.connectUser({id:n,name:r,image:c},t),l(o);let d=[e.host?.clerkId].filter(Boolean);e.participant?.clerkId&&d.push(e.participant.clerkId);let p=o.channel(`messaging`,e.callId,{name:`Session: ${e.problem||`Interview`}`,members:d});await p.watch(),f(p)}catch(e){ql.error(`Failed to join video call`),console.error(`Error init call`,e)}finally{m(!1)}})(),()=>{(async()=>{try{i&&await i.leave(),o&&await o.disconnectUser(),await _B()}catch(e){console.error(`Cleanup error:`,e)}})()}},[e?.callId,t,n,r]),{streamClient:i,call:o,chatClient:c,channel:u,isInitializingCall:p}}var yB=(e=21)=>crypto.getRandomValues(new Uint8Array(e)).reduce((e,t)=>(t&=63,t<36?e+=t.toString(36):t<62?e+=(t-26).toString(36).toUpperCase():t>62?e+=`-`:e+=`_`,e),``),bB=n((e=>{var n=t();function r(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var i=typeof Object.is==`function`?Object.is:r,a=n.useState,o=n.useEffect,s=n.useLayoutEffect,c=n.useDebugValue;function l(e,t){var n=t(),r=a({inst:{value:n,getSnapshot:t}}),i=r[0].inst,l=r[1];return s(function(){i.value=n,i.getSnapshot=t,u(i)&&l({inst:i})},[e,n,t]),o(function(){return u(i)&&l({inst:i}),e(function(){u(i)&&l({inst:i})})},[e]),c(n),n}function u(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!i(e,n)}catch{return!0}}function d(e,t){return t()}var f=typeof window>`u`||window.document===void 0||window.document.createElement===void 0?d:l;e.useSyncExternalStore=n.useSyncExternalStore===void 0?f:n.useSyncExternalStore})),xB=n(((e,t)=>{t.exports=bB()})),SB=n(((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0?t.exports=r():typeof define==`function`&&define.amd?define(r):(n=typeof globalThis<`u`?globalThis:n||self).dayjs=r()})(e,(function(){var e=1e3,t=6e4,n=36e5,r=`millisecond`,i=`second`,a=`minute`,o=`hour`,s=`day`,c=`week`,l=`month`,u=`quarter`,d=`year`,f=`date`,p=`Invalid Date`,m=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,h=/\[([^\]]+)]|YYYY|YY
vendor: 6,667 bytes, line 466
466|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,g={name:`en`,weekdays:`Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday`.split(`_`),months:`January_February_March_April_May_June_July_August_September_October_November_December`.split(`_`),ordinal:function(e){var t=[`th`,`st`,`nd`,`rd`],n=e%100;return`[`+e+(t[(n-20)%10]||t[n]||t[0])+`]`}},_=function(e,t,n){var r=String(e);return!r||r.length>=t?e:``+Array(t+1-r.length).join(n)+e},v={s:_,z:function(e){var t=-e.utcOffset(),n=Math.abs(t),r=Math.floor(n/60),i=n%60;return(t<=0?`+`:`-`)+_(r,2,`0`)+`:`+_(i,2,`0`)},m:function e(t,n){if(t.date()<n.date())return-e(n,t);var r=12*(n.year()-t.year())+(n.month()-t.month()),i=t.clone().add(r,l),a=n-i<0,o=t.clone().add(r+(a?-1:1),l);return+(-(r+(n-i)/(a?i-o:o-i))||0)},a:function(e){return e<0?Math.ceil(e)||0:Math.floor(e)},p:function(e){return{M:l,y:d,w:c,d:s,D:f,h:o,m:a,s:i,ms:r,Q:u}[e]||String(e||``).toLowerCase().replace(/s$/,``)},u:function(e){return e===void 0}},y=`en`,b={};b[y]=g;var x=`$isDayjsObject`,S=function(e){return e instanceof E||!(!e||!e[x])},C=function e(t,n,r){var i;if(!t)return y;if(typeof t==`string`){var a=t.toLowerCase();b[a]&&(i=a),n&&(b[a]=n,i=a);var o=t.split(`-`);if(!i&&o.length>1)return e(o[0])}else{var s=t.name;b[s]=t,i=s}return!r&&i&&(y=i),i||!r&&y},w=function(e,t){if(S(e))return e.clone();var n=typeof t==`object`?t:{};return n.date=e,n.args=arguments,new E(n)},T=v;T.l=C,T.i=S,T.w=function(e,t){return w(e,{locale:t.$L,utc:t.$u,x:t.$x,$offset:t.$offset})};var E=function(){function g(e){this.$L=C(e.locale,null,!0),this.parse(e),this.$x=this.$x||e.x||{},this[x]=!0}var _=g.prototype;return _.parse=function(e){this.$d=function(e){var t=e.date,n=e.utc;if(t===null)return new Date(NaN);if(T.u(t))return new Date;if(t instanceof Date)return new Date(t);if(typeof t==`string`&&!/Z$/i.test(t)){var r=t.match(m);if(r){var i=r[2]-1||0,a=(r[7]||`0`).substring(0,3);return n?new Date(Date.UTC(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,a)):new Date(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,a)}}return new Date(t)}(e),this.init()},_.init=function(){var e=this.$d;this.$y=e.getFullYear(),this.$M=e.getMonth(),this.$D=e.getDate(),this.$W=e.getDay(),this.$H=e.getHours(),this.$m=e.getMinutes(),this.$s=e.getSeconds(),this.$ms=e.getMilliseconds()},_.$utils=function(){return T},_.isValid=function(){return this.$d.toString()!==p},_.isSame=function(e,t){var n=w(e);return this.startOf(t)<=n&&n<=this.endOf(t)},_.isAfter=function(e,t){return w(e)<this.startOf(t)},_.isBefore=function(e,t){return this.endOf(t)<w(e)},_.$g=function(e,t,n){return T.u(e)?this[t]:this.set(n,e)},_.unix=function(){return Math.floor(this.valueOf()/1e3)},_.valueOf=function(){return this.$d.getTime()},_.startOf=function(e,t){var n=this,r=!!T.u(t)||t,u=T.p(e),p=function(e,t){var i=T.w(n.$u?Date.UTC(n.$y,t,e):new Date(n.$y,t,e),n);return r?i:i.endOf(s)},m=function(e,t){return T.w(n.toDate()[e].apply(n.toDate(`s`),(r?[0,0,0,0]:[23,59,59,999]).slice(t)),n)},h=this.$W,g=this.$M,_=this.$D,v=`set`+(this.$u?`UTC`:``);switch(u){case d:return r?p(1,0):p(31,11);case l:return r?p(1,g):p(0,g+1);case c:var y=this.$locale().weekStart||0,b=(h<y?h+7:h)-y;return p(r?_-b:_+(6-b),g);case s:case f:return m(v+`Hours`,0);case o:return m(v+`Minutes`,1);case a:return m(v+`Seconds`,2);case i:return m(v+`Milliseconds`,3);default:return this.clone()}},_.endOf=function(e){return this.startOf(e,!1)},_.$set=function(e,t){var n,c=T.p(e),u=`set`+(this.$u?`UTC`:``),p=(n={},n[s]=u+`Date`,n[f]=u+`Date`,n[l]=u+`Month`,n[d]=u+`FullYear`,n[o]=u+`Hours`,n[a]=u+`Minutes`,n[i]=u+`Seconds`,n[r]=u+`Milliseconds`,n)[c],m=c===s?this.$D+(t-this.$W):t;if(c===l||c===d){var h=this.clone().set(f,1);h.$d[p](m),h.init(),this.$d=h.set(f,Math.min(this.$D,h.daysInMonth())).$d}else p&&this.$d[p](m);return this.init(),this},_.set=function(e,t){return this.clone().$set(e,t)},_.get=function(e){return this[T.p(e)]()},_.add=function(r,u){var f,p=this;r=Number(r);var m=T.p(u),h=function(e){var t=w(p);return T.w(t.date(t.date()+Math.round(e*r)),p)};if(m===l)return this.set(l,this.$M+r);if(m===d)return this.set(d,this.$y+r);if(m===s)return h(1);if(m===c)return h(7);var g=(f={},f[a]=t,f[o]=n,f[i]=e,f)[m]||1,_=this.$d.getTime()+r*g;return T.w(_,this)},_.subtract=function(e,t){return this.add(-1*e,t)},_.format=function(e){var t=this,n=this.$locale();if(!this.isValid())return n.invalidDate||p;var r=e||`YYYY-MM-DDTHH:mm:ssZ`,i=T.z(this),a=this.$H,o=this.$m,s=this.$M,c=n.weekdays,l=n.months,u=n.meridiem,d=function(e,n,i,a){return e&&(e[n]||e(t,r))||i[n].slice(0,a)},f=function(e){return T.s(a%12||12,e,`0`)},m=u||function(e,t,n){var r=e<12?`AM`:`PM`;return n?r.toLowerCase():r};return r.replace(h,(function(e,r){return r||function(e){switch(e){case`YY`:return String(t.$y).slice(-2);case`YYYY`:return T.s(t.$y,4,`0`);case`M`:return s+1;case`MM`:return T.s(s+1,2,`0`);case`MMM`:return d(n.monthsShort,s,l,3);case`MMMM`:return d(l,s);case`D`:return t.$D;case`DD`:return T.s(t.$D,2,`0`);case`d`:return String(t.$W);case`dd`:return d(n.weekdaysMin,t.$W,c,2);case`ddd`:return d(n.weekdaysShort,t.$W,c,3);case`dddd`:return c[t.$W];case`H`:return String(a);case`HH`:return T.s(a,2,`0`);case`h`:return f(1);case`hh`:return f(2);case`a`:return m(a,o,!0);case`A`:return m(a,o,!1);case`m`:return String(o);case`mm`:return T.s(o,2,`0`);case`s`:return String(t.$s);case`ss`:return T.s(t.$s,2,`0`);case`SSS`:return T.s(t.$ms,3,`0`);case`Z`:return i}return null}(e)||i.replace(`:`,``)}))},_.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},_.diff=function(r,f,p){var m,h=this,g=T.p(f),_=w(r),v=(_.utcOffset()-this.utcOffset())*t,y=this-_,b=function(){return T.m(h,_)};switch(g){case d:m=b()/12;break;case l:m=b();break;case u:m=b()/3;break;case c:m=(y-v)/6048e5;break;case s:m=(y-v)/864e5;break;case o:m=y/n;break;case a:m=y/t;break;case i:m=y/e;break;default:m=y}return p?m:T.a(m)},_.daysInMonth=function(){return this.endOf(l).$D},_.$locale=function(){return b[this.$L]},_.locale=function(e,t){if(!e)return this.$L;var n=this.clone(),r=C(e,t,!0);return r&&(n.$L=r),n},_.clone=function(){return T.w(this.$d,this)},_.toDate=function(){return new Date(this.valueOf())},_.toJSON=function(){return this.isValid()?this.toISOString():null},_.toISOString=function(){return this.$d.toISOString()},_.toString=function(){return this.$d.toUTCString()},g}(),D=E.prototype;return w.prototype=D,[[`$ms`,r],[`$s`,i],[`$m`,a],[`$H`,o],[`$W`,s],[`$M`,l],[`$y`,d],[`$D`,f]].forEach((function(e){D[e[1]]=function(t){return this.$g(t,e[0],e[1])}})),w.extend=function(e,t){return e.$i||=(e(t,E,w),!0),w},w.locale=C,w.isDayjs=S,w.unix=function(e){return w(1e3*e)},w.en=b[y],w.Ls=b,w.p={},w}))})),
466CB=n(((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0?t.exports=r():typeof define==`function`&&define.amd?define(r):(n=typeof globalThis<`u`?globalThis:n||self).dayjs_plugin_calendar=r()})(e,(function(){return function(e,t,n){var r=`h:mm A`,i={lastDay:`[Yesterday at] `+r,sameDay:`[Today at] `+r,nextDay:`[Tomorrow at] `+r,nextWeek:`dddd [at] `+r,lastWeek:`[Last] dddd [at] `+r,sameElse:`MM/DD/YYYY`};t.prototype.calendar=function(e,t){var r=t||this.$locale().calendar||i,a=n(e||void 0).startOf(`d`),o=this.diff(a,`d`,!0),s=`sameElse`,c=o<-6?s:o<-1?`lastWeek`:o<0?`lastDay`:o<1?`sameDay`:o<2?`nextDay`:o<7?`nextWeek`:s,l=r[c]||i[c];return typeof l==`function`?l.call(this,n()):this.format(l)}}}))})),wB=n(((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0?t.exports=r():typeof define==`function`&&define.amd?define(r):(n=typeof globalThis<`u`?globalThis:n||self).dayjs_plugin_localizedFormat=r()})(e,(function(){var e={LTS:`h:mm:ss A`,LT:`h:mm A`,L:`MM/DD/YYYY`,LL:`MMMM D, YYYY`,LLL:`MMMM D, YYYY h:mm A`,LLLL:`dddd, MMMM D, YYYY h:mm A`};return function(t,n,r){var i=n.prototype,a=i.format;r.en.formats=e,i.format=function(t){t===void 0&&(t=`YYYY-MM-DDTHH:mm:ssZ`);var n=this.$locale().formats,r=function(t,n){return t.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,(function(t,r,i){var a=i&&i.toUpperCase();return r||n[i]||e[i]||n[a].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,(function(e,t,n){return t||n.slice(1)}))}))}(t,n===void 0?{}:n);return a.call(this,r)}}}))})),TB=n(((e,t)=>{var n=`Expected a function`,r=NaN,i=`[object Symbol]`,a=/^\s+|\s+$/g,o=/^[-+]0x[0-9a-f]+$/i,s=/^0b[01]+$/i,c=/^0o[0-7]+$/i,l=parseInt,u=typeof global==`object`&&global&&global.Object===Object&&global,d=typeof self==`object`&&self&&self.Object===Object&&self,f=u||d||Function(`return this`)(),p=Object.prototype.toString,m=Math.max,h=Math.min,g=function(){return f.Date.now()};function _(e,t,r){var i,a,o,s,c,l,u=0,d=!1,f=!1,p=!0;if(typeof e!=`function`)throw TypeError(n);t=x(t)||0,v(r)&&(d=!!r.leading,f=`maxWait`in r,o=f?m(x(r.maxWait)||0,t):o,p=`trailing`in r?!!r.trailing:p);function _(t){var n=i,r=a;return i=a=void 0,u=t,s=e.apply(r,n),s}function y(e){return u=e,c=setTimeout(C,t),d?_(e):s}function b(e){var n=e-l,r=e-u,i=t-n;return f?h(i,o-r):i}function S(e){var n=e-l,r=e-u;return l===void 0||n>=t||n<0||f&&r>=o}function C(){var e=g();if(S(e))return w(e);c=setTimeout(C,b(e))}function w(e){return c=void 0,p&&i?_(e):(i=a=void 0,s)}function T(){c!==void 0&&clearTimeout(c),u=0,i=l=a=c=void 0}function E(){return c===void 0?s:w(g())}function D(){var e=g(),n=S(e);if(i=arguments,a=this,l=e,n){if(c===void 0)return y(l);if(f)return c=setTimeout(C,t),_(l)}return c===void 0&&(c=setTimeout(C,t)),s}return D.cancel=T,D.flush=E,D}function v(e){var t=typeof e;return!!e&&(t==`object`||t==`function`)}function y(e){return!!e&&typeof e==`object`}function b(e){return typeof e==`symbol`||y(e)&&p.call(e)==i}function x(e){if(typeof e==`number`)return e;if(b(e))return r;if(v(e)){var t=typeof e.valueOf==`function`?e.valueOf():e;e=v(t)?t+``:t}if(typeof e!=`string`)return e===0?e:+e;e=e.replace(a,``);var n=s.test(e);return n||c.test(e)?l(e.slice(2),n?2:8):o.test(e)?r:+e}t.exports=_})),EB=n(((e,t)=>{var n=`Expected a function`,r=NaN,i=`[object Symbol]`,a=/^\s+|\s+$/g,o=/^[-+]0x[0-9a-f]+$/i,s=/^0b[01]+$/i,c=/^0o[0-7]+$/i,l=parseInt,u=typeof global==`object`&&global&&global.Object===Object&&global,d=typeof self==`object`&&self&&self.Object===Object&&self,f=u||d||Function(`return this`)(),p=Object.prototype.toString,m=Math.max,h=Math.min,g=function(){return f.Date.now()};function _(e,t,r){var i,a,o,s,c,l,u=0,d=!1,f=!1,p=!0;if(typeof e!=`function`)throw TypeError(n);t=S(t)||0,y(r)&&(d=!!r.leading,f=`maxWait`in r,o=f?m(S(r.maxWait)||0,t):o,p=`trailing`in r?!!r.trailing:p);function _(t){var n=i,r=a;return i=a=void 0,u=t,s=e.apply(r,n),s}function v(e){return u=e,c=setTimeout(C,t),d?_(e):s}function b(e){var n=e-l,r=e-u,i=t-n;return f?h(i,o-r):i}function x(e){var n=e-l,r=e-u;return l===void 0||n>=t||n<0||f&&r>=o}function C(){var e=g();if(x(e))return w(e);c=setTimeout(C,b(e))}function w(e){return c=void 0,p&&i?_(e):(i=a=void 0,s)}function T(){c!==void 0&&clearTimeout(c),u=0,i=l=a=c=void 0}function E(){return c===void 0?s:w(g())}function D(){var e=g(),n=x(e);if(i=arguments,a=this,l=e,n){if(c===void 0)return v(l);
466if(f)return c=setTimeout(C,t),_(l)}return c===void 0&&(c=setTimeout(C,t)),s}return D.cancel=T,D.flush=E,D}function v(e,t,r){var i=!0,a=!0;if(typeof e!=`function`)throw TypeError(n);return y(r)&&(i=`leading`in r?!!r.leading:i,a=`trailing`in r?!!r.trailing:a),_(e,t,{leading:i,maxWait:t,trailing:a})}function y(e){var t=typeof e;return!!e&&(t==`object`||t==`function`)}function b(e){return!!e&&typeof e==`object`}function x(e){return typeof e==`symbol`||b(e)&&p.call(e)==i}function S(e){if(typeof e==`number`)return e;if(x(e))return r;if(y(e)){var t=typeof e.valueOf==`function`?e.valueOf():e;e=y(t)?t+``:t}if(typeof e!=`string`)return e===0?e:+e;e=e.replace(a,``);var n=s.test(e);return n||c.test(e)?l(e.slice(2),n?2:8):o.test(e)?r:+e}t.exports=v})),DB=n(((e,t)=>{var n=typeof Element<`u`,r=typeof Map==`function`,i=typeof Set==`function`,a=typeof ArrayBuffer==`function`&&!!ArrayBuffer.isView;function o(e,t){if(e===t)return!0;if(e&&t&&typeof e==`object`&&typeof t==`object`){if(e.constructor!==t.constructor)return!1;var s,c,l;if(Array.isArray(e)){if(s=e.length,s!=t.length)return!1;for(c=s;c--!==0;)if(!o(e[c],t[c]))return!1;return!0}var u;if(r&&e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(u=e.entries();!(c=u.next()).done;)if(!t.has(c.value[0]))return!1;for(u=e.entries();!(c=u.next()).done;)if(!o(c.value[1],t.get(c.value[0])))return!1;return!0}if(i&&e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(u=e.entries();!(c=u.next()).done;)if(!t.has(c.value[0]))return!1;return!0}if(a&&ArrayBuffer.isView(e)&&ArrayBuffer.isView(t)){if(s=e.length,s!=t.length)return!1;for(c=s;c--!==0;)if(e[c]!==t[c])return!1;return!0}if(e.constructor===RegExp)return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf&&typeof e.valueOf==`function`&&typeof t.valueOf==`function`)return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString&&typeof e.toString==`function`&&typeof t.toString==`function`)return e.toString()===t.toString();if(l=Object.keys(e),s=l.length,s!==Object.keys(t).length)return!1;for(c=s;c--!==0;)if(!Object.prototype.hasOwnProperty.call(t,l[c]))return!1;if(n&&e instanceof Element)return!1;for(c=s;c--!==0;)if(!((l[c]===`_owner`||l[c]===`__v`||l[c]===`__o`)&&e.$$typeof)&&!o(e[l[c]],t[l[c]]))return!1;return!0}return e!==e&&t!==t}t.exports=function(e,t){try{return o(e,t)}catch(e){if((e.message||``).match(/stack|recursion/i))return console.warn(`react-fast-compare cannot handle circular refs`),!1;throw e}}})),OB=n(((e,t)=>{t.exports
vendor: 15,667 bytes, line 466
466=function(){return/\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67)\uDB40\uDC7F|(?:\uD83E\uDDD1\uD83C\uDFFF\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFC-\uDFFF])|\uD83D\uDC68(?:\uD83C\uDFFB(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|[\u2695\u2696\u2708]\uFE0F|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))?|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFE])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])\uFE0F|\u200D(?:(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D[\uDC66\uDC67])|\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC)?|(?:\uD83D\uDC69(?:\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69]))|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC69(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83E\uDDD1(?:\u200D(?:\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDE36\u200D\uD83C\uDF2B|\uD83C\uDFF3\uFE0F\u200D\u26A7|\uD83D\uDC3B\u200D\u2744|(?:(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\uD83C\uDFF4\u200D\u2620|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])\u200D[\u2640\u2642]|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u2600-\u2604\u260E\u2611\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26B0\u26B1\u26C8\u26CF\u26D1\u26D3\u26E9\u26F0\u26F1\u26F4\u26F7\u26F8\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u3030\u303D\u3297\u3299]|\uD83C[\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]|\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|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83D\uDE35\u200D\uD83D\uDCAB|\uD83D\uDE2E\u200D\uD83D\uDCA8|\uD83D\uDC15\u200D\uD83E\uDDBA|\uD83E\uDDD1(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC|\uD83C\uDFFB)?|\uD83D\uDC69(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC|\uD83C\uDFFB)?|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF6\uD83C\uDDE6|\uD83C\uDDF4\uD83C\uDDF2|\uD83D\uDC08\u200D\u2B1B|\u2764\uFE0F\u200D(?:\uD83D\uDD25|\uD83E\uDE79)|\uD83D\uDC41\uFE0F|\uD83C\uDFF3\uFE0F|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|\uD83C\uDDFB(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDF8(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83C\uDDF5(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|\uD83C\uDDF3(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDF0(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDED(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|\uD83C\uDDEC(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|\uD83C\uDDEB(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|[#\*0-9]\uFE0F\u20E3|\u2764\uFE0F|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|\uD83C\uDFF4|(?:[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\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]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270C\u270D]|\uD83D[\uDD74\uDD90])(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC08\uDC15\uDC3B\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE2E\uDE35\uDE36\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5]|\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD]|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF]|[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\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-\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0D\uDD0E\uDD10-\uDD17\uDD1D\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78\uDD7A-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCB\uDDD0\uDDE0-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6]|(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])|(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26A7\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDED5-\uDED7\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])\uFE0F|(?:[\u261D\u26F9\u270A-\u270D]|\uD83C[\uDF85\uDFC2-\uDFC4\uDFC7\uDFCA-\uDFCC]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66-\uDC78\uDC7C\uDC81-\uDC83\uDC85-\uDC87\uDC8F\uDC91\uDCAA\uDD74\uDD75\uDD7A\uDD90\uDD95\uDD96\uDE45-\uDE47\uDE4B-\uDE4F\uDEA3\uDEB4-\uDEB6\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDD77\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g}
466})),kB=xB(),AB=r(SB(),1),jB=r(CB(),1),MB=r(wB(),1),NB=r(TB(),1),PB=r(EB(),1),FB=r(DB(),1),IB=r(OB(),1),LB=d.createContext(void 0),RB=({children:e,value:t})=>(0,R.jsx)(LB.Provider,{value:t,children:e}),zB=e=>(0,d.useContext)(LB)||(console.warn(`The useChannelActionContext hook was called outside of the ChannelActionContext provider. Make sure this hook is called within a child of the Channel component. The errored call is located in the ${e} component.`),{}),BB=(0,d.createContext)(void 0),VB=({children:e,value:t})=>(0,R.jsx)(BB.Provider,{value:t,children:e}),HB=()=>(0,d.useContext)(BB)||{},UB=d.createContext(void 0),WB=({children:e,value:t})=>(0,R.jsx)(UB.Provider,{value:t,children:e}),GB=1,KB=e=>(0,d.useContext)(UB)||(e&&GB>0&&(console.warn(`The useChannelStateContext hook was called outside of the ChannelStateContext provider. Make sure this hook is called within a child of the Channel component. The errored call is located in the ${e} component.`),--GB),{}),qB=d.createContext(void 0),JB=({children:e,value:t})=>(0,R.jsx)(qB.Provider,{value:t,children:e}),K=e=>(0,d.useContext)(qB)||(console.warn(`The useChatContext hook was called outside of the ChatContext provider. Make sure this hook is called within a child of the Chat component. The errored call is located in the ${e} component.`),{}),YB=d.createContext({}),q=e=>(0,d.useContext)(YB),XB=class{constructor({closeOnClickOutside:e=!0,id:t}={}){this.state=new sb({dialogsById:{},openedDialogIds:[]}),this.remove=e=>{let t=this.get(e);t&&(t.removalTimeout&&clearTimeout(t.removalTimeout),this.state.next(t=>{let n={...t.dialogsById};return delete n[e],{...t,dialogsById:n,openedDialogIds:t.openedDialogIds.filter(t=>t!==e)}}))},this.closeOnClickOutside=e,this.id=t??yB()}get openDialogCount(){return this.state.getLatestValue().openedDialogIds.length}get(e){return this.state.getLatestValue().dialogsById[e]}getOrCreate({closeOnClickOutside:e,id:t}){let n=this.get(t);return n||(n={close:()=>{this.close(t)},closeOnClickOutside:e,id:t,isOpen:!1,open:()=>{this.open({id:t})},removalTimeout:void 0,remove:()=>{this.remove(t)},toggle:(e=!1)=>{this.toggle({id:t},e)}},this.state.next(e=>({...e,dialogsById:{...e.dialogsById,[t]:n}}))),(n.closeOnClickOutside!==e||n.removalTimeout)&&(n.removalTimeout&&clearTimeout(n.removalTimeout),this.state.next(n=>({...n,dialogsById:{...n.dialogsById,[t]:{...n.dialogsById[t],closeOnClickOutside:e,removalTimeout:void 0}},openedDialogIds:n.dialogsById[t]?.isOpen?[...n.openedDialogIds.filter(e=>e!==t),t]:n.openedDialogIds}))),n}open(e,t){let n=this.getOrCreate(e);n.isOpen||(t&&this.closeAll(),this.state.next(e=>({...e,dialogsById:{...e.dialogsById,[n.id]:{...n,isOpen:!0}},openedDialogIds:[...e.openedDialogIds.filter(e=>e!==n.id),n.id]})))}close(e){let t=this.state.getLatestValue().dialogsById[e];t?.isOpen&&this.state.next(n=>({...n,dialogsById:{...n.dialogsById,[t.id]:{...t,isOpen:!1}},openedDialogIds:n.openedDialogIds.filter(t=>t!==e)}))}closeAll(){Object.values(this.state.getLatestValue().dialogsById).forEach(e=>e.close())}toggle(e,t=!1){this.state.getLatestValue().dialogsById[e.id]?.isOpen?this.close(e.id):this.open(e,t)}markForRemoval(e){let t=this.get(e);t&&this.state.next(n=>({...n,dialogsById:{...n.dialogsById,[e]:{...t,removalTimeout:setTimeout(()=>{this.remove(e)},16)}},openedDialogIds:n.openedDialogIds.filter(t=>t!==e)}))}cancelPendingRemoval(e){let t=this.get(e);t?.removalTimeout&&(clearTimeout(t.removalTimeout),this.state.next(t=>({...t,dialogsById:{...t.dialogsById,[e]:{...t.dialogsById[e],removalTimeout:void 0}},openedDialogIds:t.dialogsById[e]?.isOpen?[...t.openedDialogIds.filter(t=>t!==e),e]:t.openedDialogIds})))}},ZB=()=>{};function J(e,t){return(0,kB.useSyncExternalStore)((0,d.useCallback)(n=>e?.subscribeWithSelector(t,n)??ZB,[e,t]),(0,d.useMemo)(()=>{let n;return()=>{let r=e?.getLatestValue();if(!r)return;if(n&&n[0]===r)return n[1];let i=t(r);if(n){let e=!0;for(let t in n[1])if(n[1][t]!==i[t]){e=!1;break}if(e)return n[1]}return n=[r,i],n[1]}},[e,t]))}var QB=({closeOnClickOutside:e,dialogManagerId:t,id:n})=>{let{dialogManager:r}=yV({dialogManagerId:t});return(0,d.useEffect)(()=>(r.cancelPendingRemoval(n),()=>{r.markForRemoval(n)}),[r,n]),r.getOrCreate({closeOnClickOutside:e,id:n})},$B=({id:e})=>{let{dialogManager:t}=CV()??{};return{dialog:QB({dialogManagerId:t?.id,id:e}),dialogManager:t}}
466,eV=`modal-dialog`,tV=(e=eV)=>QB({dialogManagerId:bV,id:e}),nV=(e,t)=>{let{dialogManager:n}=yV({dialogManagerId:t}),r=(0,d.useCallback)(({dialogsById:t})=>({isOpen:!!t[e]?.isOpen}),[e]);return J(n.state,r).isOpen},rV=(e=eV)=>nV(e,bV),iV=(e,t)=>{let{dialogManager:n}=yV({dialogManagerId:t}),r=(0,d.useCallback)(({openedDialogIds:t})=>({isTopmost:t[t.length-1]===e}),[e]);return J(n.state,r).isTopmost},aV=(e=eV)=>iV(e,bV),oV=e=>({openedDialogCount:e.openedDialogIds.length}),sV=({dialogManagerId:e}={})=>{let{dialogManager:t}=yV({dialogManagerId:e});return J(t.state,oV).openedDialogCount},cV=({children:e,getPortalDestination:t,isOpen:n})=>{let[r,i]=(0,d.useState)(null);return(0,d.useLayoutEffect)(()=>{let e=t();!e||!n||i(e)},[t,n]),r?(0,Dn.createPortal)(e,r):null},lV=({dialog:e,managerCloseOnClickOutside:t})=>e.closeOnClickOutside??t,uV=()=>{let{dialogManager:e}=CV()??{},t=sV({dialogManagerId:e?.id}),[n,r]=(0,d.useState)(null);return(0,d.useEffect)(()=>{if(!n||!e)return;let t=t=>{let r=t.target,i=r.closest?.(`[data-str-chat__portal-id]`);i&&i!==n||r!==n&&n.contains(r)||setTimeout(()=>{Object.values(e.state.getLatestValue().dialogsById).forEach(t=>{t.isOpen&&lV({dialog:t,managerCloseOnClickOutside:e.closeOnClickOutside})&&e.close(t.id)})},0)};return document.addEventListener(`click`,t,{capture:!0}),()=>{document.removeEventListener(`click`,t,{capture:!0})}},[n,e]),t?(0,R.jsx)(`div`,{className:`str-chat__dialog-overlay`,"data-str-chat__portal-id":e?.id,"data-testid":`str-chat__dialog-overlay`,ref:r,style:{"--str-chat__dialog-overlay-height":t>0?`100%`:`0`}}):null},dV=({children:e,dialogId:t,dialogManagerId:n})=>{let{dialogManager:r}=yV({dialogId:t,dialogManagerId:n}),i=nV(t,n);return(0,R.jsx)(cV,{getPortalDestination:(0,d.useCallback)(()=>document.querySelector(`div[data-str-chat__portal-id="${r.id}"]`),[r.id]),isOpen:i,children:e})},fV=new sb({}),pV=e=>fV.getLatestValue()[e],mV=({closeOnClickOutside:e,id:t})=>{let n=pV(t);return n?typeof e==`boolean`&&(n.closeOnClickOutside=e):(n=new XB({closeOnClickOutside:e,id:t}),fV.partialNext({[t]:n})),n},hV=e=>{pV(e)&&fV.partialNext({[e]:void 0})},gV=d.createContext(void 0),_V=({children:e,closeOnClickOutside:t,id:n})=>{let[r,i]=(0,d.useState)(()=>n?pV(n)??null:new XB({closeOnClickOutside:t}));return(0,d.useEffect)(()=>{if(n)return i(mV({closeOnClickOutside:t,id:n})),()=>{hV(n),i(null)}},[t,n]),r?(0,R.jsxs)(gV.Provider,{value:{dialogManager:r},children:[e,(0,R.jsx)(uV,{})]}):null},vV=({dialogId:e,dialogManagerId:t,newState:n,previousState:r})=>{let i,a;return t?e?(n[t]?.get(e)&&(i=n[t]),r?.[t]?.get(e)&&(a=r[t])):(i=n[t],a=r?.[t]):e&&(i=Object.values(n).find(t=>e&&t?.get(e)),a=r&&Object.values(r).find(t=>e&&t?.get(e))),{managerInNewState:i,managerInPrevState:a}},yV=({dialogId:e,dialogManagerId:t}={})=>{let n=(0,d.useContext)(gV),[r,i]=(0,d.useState)(()=>{let{managerInNewState:r}=vV({dialogId:e,dialogManagerId:t,newState:fV.getLatestValue(),previousState:void 0});return r?{dialogManager:r}:n});return(0,d.useEffect)(()=>{if(!e&&!t)return;let r=fV.subscribeWithSelector(e=>e,(r,a)=>{let{managerInNewState:o,managerInPrevState:s}=vV({dialogId:e,dialogManagerId:t,newState:r,previousState:a});(!s||o?.id!==s.id)&&i(e=>e?.dialogManager.id===o?.id?e:{dialogManager:o||n?.dialogManager})});return()=>{r()}},[e,t,n?.dialogManager]),r?.dialogManager||console.warn(`Dialog manager (manager id: ${t}, dialog id: ${e}) is not available`),r},bV=`modal-dialog-manager`,xV=({children:e})=>(0,R.jsx)(_V,{id:bV,children:e}),SV=()=>(0,d.useMemo)(()=>pV(bV),[]),CV=()=>(0,d.useContext)(gV),wV=(0,d.createContext)(void 0),TV=({children:e,value:t})=>(0,R.jsx)(wV.Provider,{value:t,children:e}),EV=e=>(0,d.useContext)(wV)||{},DV=e=>typeof e==`string`||typeof e==`number`,OV=e=>!!e?.isSame,kV=e=>typeof e==`object`&&!!e&&typeof e.getTime==`function`,AV=6,jV=3;function MV(e,t,n,r=AV,i=jV){let a=n(e);if(!OV(a))return null;let o=n(new Date().toISOString());if(!OV(o))return null;let s=o.startOf(`day`).diff(a.startOf(`day`),`day`);if(s<0)return a.format(`DD/MM/YY`);if(s===0)return t(`timestamp/relativeToday`);if(s===1)return t(`timestamp/relativeYesterday`);if(s>=2&&s<=r)return t(`timestamp/relativeDaysAgo`,{count:s});if(i>0){let e=i*7;if(s>=7&&s<=e)return t(`timestamp/relativeWeeksAgo`,{count:Math.ceil(s/7)})}return a.format(`DD/MM/YY`)}function NV({calendar:e,calendarFormats:t,format:n,formatDate:r,messageCreatedAt:i,relativeCompact:a,relativeCompactMaxDays:o,relativeCompactMaxWeeks:s,t:c,tDateTimeParser:l,timestampTranslationKey:u}){if(!i||typeof i==`string`&&!Date.parse(i))return null;if(typeof r==`function`)return r(new Date(i));if(a&&c&&l){let e=typeof o==`number`?o:typeof o==`string`?parseInt(o,10):AV,t=typeof s==`
466number`?s:typeof s==`string`?parseInt(s,10):jV,n=MV(i,c,l,Number.isNaN(e)?AV:e,Number.isNaN(t)?jV:t);if(n)return n}if(c&&u){let r={};e!=null&&(r.calendar=e),t!=null&&(r.calendarFormats=t),n!=null&&(r.format=n);let a=c(u,{...r,timestamp:new Date(i)});if(u!==a)return a}if(!l)return null;let d=l(i);return OV(d)?e&&d.calendar?d.calendar(void 0,t||void 0):d.format(n||void 0):kV(d)?d.toDateString():DV(d)?d:null}var PV={durationFormatter:e=>(t,n,{format:r,withSuffix:i})=>{let a=t;return r&&AB.default.isDayjs(e.DateTimeParser)?e.DateTimeParser.duration(a).format(r):e.DateTimeParser.duration(a).humanize(!!i)},timestampFormatter:e=>(t,n,{calendarFormats:r,...i})=>{let a;try{i.calendar?typeof r==`string`?a=JSON.parse(r):typeof r==`object`&&(a=r):a={}}catch(e){console.error(`[TIMESTAMP FORMATTER]`,e)}let o=NV({...i,calendarFormats:a,messageCreatedAt:t,t:e.t,tDateTimeParser:e.tDateTimeParser});return!o||typeof o==`number`?JSON.stringify(t):o}},FV=(e=>e),IV=e=>(0,AB.default)(e),LV=e=>[`de`,`en`,`es`,`fr`,`hi`,`it`,`ja`,`ko`,`nl`,`pt`,`ru`,`tr`].some(t=>e===t);AB.default.extend(jB.default),AB.default.extend(MB.default);var RV=d.createContext({t:FV,tDateTimeParser:IV,userLanguage:`en`}),zV=({children:e,value:t})=>(0,R.jsx)(RV.Provider,{value:t,children:e}),Y=e=>(0,d.useContext)(RV)||(console.warn(`The useTranslationContext hook was called outside of the TranslationContext provider. Make sure this hook is called within a child of the Chat component. The errored call is located in the ${e} component.`),{}),BV=d.createContext(void 0),VV=({children:e,value:t})=>(0,R.jsx)(BV.Provider,{value:t,children:e}),HV=e=>(0,d.useContext)(BV)||(console.warn(`The useTypingContext hook was called outside of the TypingContext provider. Make sure this hook is called within a child of the Channel component. The errored call is located in the ${e} component.`),{}),UV=[`channel`,`thread`,`channel-list`,`thread-list`,`modal`],WV=e=>typeof e==`string`&&UV.includes(e),GV=e=>{let t=(e.tags??[]).filter(e=>e.startsWith(`target:`)).map(e=>e.slice(7)).filter(e=>WV(e));if(t.length>0)return Array.from(new Set(t));let n=e.origin.context?.panel;return WV(n)?[n]:[]},KV=e=>`target:${e}`,qV=(e,t)=>e?Array.from(new Set([KV(e),...t??[]])):t??[],JV=(e,t,n)=>{let r=GV(e);return r.length>0?r.includes(t):(n?.fallbackPanel??`channel`)===t},YV=typeof window<`u`&&`ResizeObserver`in window;function XV(e){return String(e).startsWith(`auto`)?hce({alignment:e===`auto-start`?`start`:e===`auto-end`?`end`:void 0}):null}function ZV(e){if(e==null)return null;if(Array.isArray(e)){let[t,n]=e;return UL({crossAxis:t,mainAxis:n})}return UL(e)}function QV({allowFlip:e=!0,allowShift:t=!0,autoUpdateOptions:n,fitAvailableSpace:r=!1,freeze:i=!1,offset:a,placement:o=`bottom-start`,shiftOptions:s}){let c=XV(o),l=ZV(a),u=o.startsWith(`left`)||o.startsWith(`right`),d=s?{padding:8,...s}:{padding:8};return NR({middleware:[...l?[l]:[],...c?[c]:e&&!u?[GL()]:[],...t?[WL(d)]:[],...r?[KL({apply:()=>{}})]:[]],placement:String(o).startsWith(`auto`)?`bottom`:o,strategy:`fixed`,whileElementsMounted:i?void 0:(e,t,r)=>IL(e,t,r,{ancestorResize:!0,ancestorScroll:!0,animationFrame:!1,elementResize:YV,...n})})}var $V={danger:`str-chat__button--destructive`,primary:`str-chat__button--primary`,secondary:`str-chat__button--secondary`},eH={ghost:`str-chat__button--ghost`,outline:`str-chat__button--outline`,solid:`str-chat__button--solid`},tH={lg:`str-chat__button--size-lg`,md:`str-chat__button--size-md`,sm:`str-chat__button--size-sm`,xs:`str-chat__button--size-xs`},nH=(0,d.forwardRef)(function({appearance:e,children:t,circular:n,className:r,inverseTheme:i,size:a,variant:o,...s},c){return(0,R.jsx)(`button`,{ref:c,type:`button`,...s,className:G(`str-chat__button`,o!=null&&$V[o],e!=null&&eH[e],n&&`str-chat__button--circular`,i&&`str-chat__theme-inverse`,a!=null&&tH[a],r),children:(0,R.jsx)(`div`,{className:`str-chat__button__content`,children:t})})}),rH=({className:e,decorative:t=!0,...n})=>{let r=n[`aria-hidden`]??(t?!0:void 0),i=n.focusable??(t?!1:void 0);return(0,R.jsx)(`svg`,{viewBox:`0 0 20 20`,xmlns:`http://www.w3.org/2000/svg`,...n,"aria-hidden":r,className:G(`str-chat__icon`,e),focusable:i})};function iH(e){return`str-chat__icon--`+e.replace(/^Icon/,``).replace(/([a-z])([A-Z])/g,`$1-$2`).replace(/([A-Za-z])(\d)/g,`$1-$2`).replace(/(\d)([A-Za-z])/g,`$1-$2`).replace(/_/g,`-`).toLowerCase()}
466function X(e,t,n){let r=iH(e),i=({className:e,...i})=>(0,R.jsx)(rH,{...n,...i,className:G(r,e),children:t});return i.displayName=e,i}var aH=X(`IconLeave`,(0,R.jsx)(`path`,{d:`M8.75 3.125H3.75V16.875H8.75M8.75 10H17.5M17.5 10L14.375 6.875M17.5 10L14.375 13.125`,fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`})),oH=X(`IconArrowDown`,(0,R.jsx)(`path`,{d:`M10 3.125V16.875M10 16.875L4.375 11.25M10 16.875L15.625 11.25`,fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`})),sH=X(`IconArrowDownCircle`,(0,R.jsx)(`path`,{d:`M7.5 10.625L10 13.125M10 13.125L12.5 10.625M10 13.125V6.875M17.5 10C17.5 14.1421 14.1421 17.5 10 17.5C5.85786 17.5 2.5 14.1421 2.5 10C2.5 5.85786 5.85786 2.5 10 2.5C14.1421 2.5 17.5 5.85786 17.5 10Z`,fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`})),cH=X(`IconArrowLeft`,(0,R.jsx)(`path`,{d:`M16.875 10H3.125M3.125 10L8.75 4.375M3.125 10L8.75 15.625`,fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`}),{"data-rtl-mirror":``}),lH=X(`IconArrowUpRight`,(0,R.jsx)(`path`,{d:`M5 15L15 5M15 5H6.875M15 5V13.125`,fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`}),{"data-rtl-mirror":``}),uH=X(`IconRetry`,(0,R.jsx)(`path`,{d:`M14.3751 8.12481H18.1251M18.1251 8.12481V4.37481M18.1251 8.12481L14.8618 5.13809C13.9063 4.18263 12.6904 3.52991 11.3661 3.26151C10.0418 2.9931 8.66771 3.12091 7.41561 3.62896C6.1635 4.137 5.08887 5.00276 4.32599 6.11806C3.5631 7.23336 3.1458 8.54875 3.12621 9.89986C3.10662 11.251 3.48562 12.5779 4.21585 13.7148C4.94609 14.8518 5.99517 15.7483 7.23202 16.2925C8.46887 16.8366 9.83865 17.0042 11.1702 16.7743C12.5018 16.5444 13.736 15.9272 14.7188 14.9998`,fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`})),dH=X(`IconRefresh`,(0,R.jsx)(`path`,{d:`M13.125 7.49978H16.875M16.875 7.49978V3.74978M16.875 7.49978L14.6656 5.29041C13.3861 4.01095 11.6538 3.2875 9.84437 3.27697C8.03494 3.26644 6.29431 3.96968 5 5.23416M6.875 12.4998H3.125M3.125 12.4998V16.2498M3.125 12.4998L5.33437 14.7092C6.61388 15.9886 8.34621 16.7121 10.1556 16.7226C11.9651 16.7331 13.7057 16.0299 15 14.7654`,fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`})),fH=X(`IconReply`,(0,R.jsx)(`path`,{d:`M17.5812 15.525C16.2953 14.1555 12.9195 11.25 8.12265 11.25V15L1.87265 8.75L8.12265 2.5V6.25C12.2476 6.25 17.5359 10.1914 18.1226 15.2766C18.1308 15.3424 18.1177 15.4091 18.0854 15.4671C18.0531 15.525 18.0031 15.5712 17.9428 15.5988C17.8825 15.6265 17.815 15.6343 17.75 15.621C17.685 15.6077 17.6259 15.5741 17.5812 15.525Z`,fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`}),{"data-rtl-mirror":``}),pH=X(`IconArrowUp`,(0,R.jsx)(`path`,{d:`M10 16.875V3.125M10 3.125L4.375 8.75M10 3.125L15.625 8.75`,fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`})),mH=X(`IconBell`,(0,R.jsx)(`path`,{d:`M7.50015 15C7.50015 15.663 7.76354 16.2989 8.23238 16.7678C8.70122 17.2366 9.33711 17.5 10.0001 17.5C10.6632 17.5 11.2991 17.2366 11.7679 16.7678C12.2368 16.2989 12.5001 15.663 12.5001 15M4.37515 8.125C4.37515 6.63316 4.96778 5.20242 6.02267 4.14752C7.07756 3.09263 8.5083 2.5 10.0001 2.5C11.492 2.5 12.9227 3.09263 13.9776 4.14752C15.0325 5.20242 15.6251 6.63316 15.6251 8.125C15.6251 10.9234 16.2736 13.1719 16.7892 14.0625C16.844 14.1574 16.8728 14.2649 16.8729 14.3745C16.873 14.484 16.8444 14.5916 16.7898 14.6865C16.7352 14.7815 16.6566 14.8604 16.5619 14.9154C16.4672 14.9705 16.3597 14.9996 16.2501 15H3.75015C3.64076 14.9993 3.53345 14.97 3.43896 14.9149C3.34448 14.8597 3.26611 14.7808 3.2117 14.6859C3.15729 14.591 3.12874 14.4835 3.12891 14.3741C3.12907 14.2647 3.15795 14.1572 3.21265 14.0625C3.72749 13.1719 4.37515 10.9227 4.37515 8.125Z`,fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`})),hH=X(`IconBellOff`,(0,R.jsx)(`path`,{d:`M3.75015 3.12492L10.0001 9.99992C10.0001 9.99992 13.8094 14.1901 16.2501 16.8749M7.50015 14.9999C7.50015 15.663 7.76354 16.2988 8.23238 16.7677C8.70122 17.2365 9.33711 17.4999 10.0001 17.4999C10.6632 17.4999 11.2991 17.2365 11.7679 16.7677C12.2368 16.2988 12.5001 15.663 12.5001 14.9999M7.22515 3.23117C8.0809 2.74583 9.04899 2.49341 10.0328 2.49912C11.0166 2.50482 11.9817 2.76845 12.8317 3.26369C13.6818 3.75893 14.3871 4.46846 14.8773 5.32147C15.3674 6.17447 15.6253 7.14111 15.6251 8.12492C15.6251 10.3984 16.0533 12.3093 16.49 13.4218M14.5455 14.9999H3.75015C3.64076 14.9993 3.53345 14.9699 3.43896 14.9148C3.34448 14.8597 3.26611 14.7807 3.2117 14.6858C3.15729 14.5909 3.12874 14.4834 3.12891 14.374C3.12907 14.2646 3.15795 14.1572 3.21265 14.0624C3.72749 13.1718 4.37515 10.9226 4.37515 8.12492C4.37327 6.97806 4.72371 5.85829 5.37905 4.91711`,fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`})),gH=X(`IconBookmark`,(0,R.jsx)(`path`,{d:`M15 17.5L10 14.375L5 17.5V3.75C5 3.58424 5.06585 3.42527 5.18306 3.30806C5.30027 3.19085 5.45924 3.125 5.625 3.125H14.375C14.5408 3.125 14.6997 3.19085 14.8169 3.30806C14.9342 3.42527 15 3.58424 15 3.75V17.5Z`,fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`})),_H=X(`IconBookmarkRemove`,(0,R.jsx)(`path`,{d:`M5 6.49074V17.5L10 14.375L15 17.5V16M5.125 3.125H14.375C14.5408 3.125 14.6997 3.19085 14.8169 3.30806C14.9342 3.42527 15 3.58424 15 3.75V13M5.125 3.125L3.5 1.5M5.125 3.125L15 13M15 13L17.5 15.5`,fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`})),vH=X(`IconMessageBubbles`,(0,R.jsx)(`path`,{d:`M12.8076 6.25836C13.7525 6.30974 14.6692 6.59868 15.4728 7.09845C16.2764 7.59821 16.941 8.29265 17.4049 9.11746C17.8688 9.94227 18.1172 10.8708 18.1269 11.8171C18.1367 12.7634 17.9075 13.6968 17.4607 14.531L18.0982 16.6998C18.1298 16.8075 18.1319 16.9217 18.1041 17.0304C18.0764 17.1392 18.0198 17.2385 17.9405 17.3178C17.8611 17.3972 17.7618 17.4537 17.6531 17.4815C17.5443 17.5092 17.4301 17.5072 17.3224 17.4756L15.156 16.8357C14.4404 17.2184 
46613.6504 17.4419 12.8404 17.4907C12.0303 17.5396 11.2192 17.4127 10.4628 17.1188C9.70632 16.8249 9.02237 16.3708 8.45781 15.7878C7.89325 15.2049 7.46143 14.5067 7.19195 13.7412M2.53882 10.781C1.90215 9.59158 1.71418 8.21294 2.00918 6.89647C2.30419 5.58 3.06253 4.41341 4.14591 3.60942C5.22929 2.80543 6.56555 2.4176 7.91103 2.51665C9.2565 2.6157 10.5216 3.19503 11.4755 4.149C12.4295 5.10297 13.0088 6.36803 13.1079 7.7135C13.2069 9.05898 12.8191 10.3952 12.0151 11.4786C11.2111 12.562 10.0445 13.3203 8.72806 13.6153C7.41159 13.9104 6.03295 13.7224 4.84351 13.0857L2.67476 13.7232C2.56707 13.7548 2.45285 13.7569 2.3441 13.7291C2.23535 13.7014 2.13608 13.6448 2.05671 13.5655C1.97735 13.4861 1.92082 13.3868 1.89307 13.2781C1.86531 13.1693 1.86735 13.0551 1.89898 12.9474L2.53882 10.781Z`,fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`})),yH=X(`IconMessageBubble`,(0,R.jsx)(`path`,{d:`M6.24431 16.4932C7.81972 17.405 9.67297 17.7127 11.4585 17.359C13.2441 17.0053 14.84 16.0143 15.9489 14.5708C17.0578 13.1273 17.6038 11.3298 17.4852 9.51341C17.3667 7.69704 16.5916 5.98577 15.3045 4.69866C14.0174 3.41156 12.3061 2.63646 10.4897 2.51789C8.67333 2.39932 6.87582 2.94537 5.43231 4.05422C3.9888 5.16308 2.99781 6.75906 2.64412 8.54461C2.29042 10.3302 2.59815 12.1834 3.50993 13.7588L2.53259 16.6768C2.49586 16.7869 2.49053 16.9051 2.5172 17.0181C2.54386 17.131 2.60146 17.2344 2.68355 17.3165C2.76563 17.3985 2.86895 17.4561 2.98194 17.4828C3.09492 17.5095 3.21309 17.5041 3.32321 17.4674L6.24431 16.4932Z`,fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`})),bH=X(`IconMessageBubbleFill`,(0,R.jsx)(`path`,{d:`M18.125 10.0001C18.1253 11.4028 17.7624 12.7818 17.0717 14.0027C16.381 15.2236 15.3859 16.2449 14.1834 16.9671C12.9808 17.6894 11.6118 18.088 10.2095 18.1242C8.80719 18.1603 7.41942 17.8328 6.18125 17.1735L3.52109 18.0602C3.30085 18.1337 3.0645 18.1444 2.83854 18.091C2.61257 18.0377 2.40593 17.9225 2.24176 17.7583C2.07759 17.5942 1.96239 17.3875 1.90906 17.1615C1.85573 16.9356 1.86639 16.6992 1.93984 16.479L2.82656 13.8188C2.24699 12.7292 1.92328 11.5218 1.88 10.2883C1.83672 9.0549 2.075 7.8278 2.57677 6.70019C3.07854 5.57258 3.8306 4.57411 4.77587 3.78055C5.72114 2.98699 6.83478 2.41921 8.03224 2.1203C9.22971 1.82139 10.4795 1.79922 11.6868 2.05545C12.8942 2.31169 14.0272 2.8396 15.0001 3.59912C15.9729 4.35865 16.7599 5.32981 17.3014 6.43891C17.8428 7.548 18.1245 8.76588 18.125 10.0001Z`})),xH=X(`IconThread`,(0,R.jsx)(`path`,{d:`M7.5 8.75H12.8125M7.5 11.25H12.8125M10.3125 16.875H3.75C3.58424 16.875 3.42527 16.8092 3.30806 16.6919C3.19085 16.5747 3.125 16.4158 3.125 16.25V9.6875C3.125 7.78126 3.88225 5.95309 5.23017 4.60517C6.57809 3.25725 8.40626 2.5 10.3125 2.5C11.2564 2.5 12.191 2.68591 13.063 3.04712C13.9351 3.40832 14.7274 3.93775 15.3948 4.60517C16.0623 5.27259 16.5917 6.06493 16.9529 6.93696C17.3141 7.80899 17.5 8.74362 17.5 9.6875C17.5 10.6314 17.3141 11.566 16.9529 12.438C16.5917 13.3101 16.0623 14.1024 15.3948 14.7698C14.7274 15.4373 13.9351 15.9667 13.063 16.3279C12.191 16.6891 11.2564 16.875 10.3125 16.875Z`,fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`})),SH=X(`IconThreadFill`,(0,R.jsx)(`path`,{d:`M10.3125 1.875C8.24119 1.87727 6.25538 2.70111 4.79074 4.16574C3.32611 5.63038 2.50227 7.61619 2.5 9.6875V16.25C2.5 16.5815 2.6317 16.8995 2.86612 17.1339C3.10054 17.3683 3.41848 17.5 3.75 17.5H10.3125C12.3845 17.5 14.3716 16.6769 15.8368 15.2118C17.3019 13.7466 18.125 11.7595 18.125 9.6875C18.125 7.6155 17.3019 5.62836 15.8368 4.16323C14.3716 2.6981 12.3845 1.875 10.3125 1.875ZM12.8125 11.875H7.5C7.33424 11.875 7.17527 11.8092 7.05806 11.6919C6.94085 11.5747 6.875 11.4158 6.875 11.25C6.875 11.0842 6.94085 10.9253 7.05806 10.8081C7.17527 10.6908 7.33424 10.625 7.5 10.625H12.8125C12.9783 10.625 13.1372 10.6908 13.2544 10.8081C13.3717 10.9253 13.4375 11.0842 13.4375 11.25C13.4375 11.4158 13.3717 11.5747 13.2544 11.6919C13.1372 11.8092 12.9783 11.875 12.8125 11.875ZM12.8125 9.375H7.5C7.33424 9.375 7.17527 9.30915 7.05806 9.19194C6.94085 9.07473 6.875 8.91576 6.875 8.75C6.875 8.58424 6.94085 8.42527 7.05806 8.30806C7.17527 8.19085 7.33424 8.125 7.5 8.125H12.8125C12.9783 8.125 13.1372 8.19085 13.2544 8.30806C13.3717 8.42527 13.4375 8.58424 13.4375 8.75C13.4375 8.91576 13.3717 9.07473 13.2544 9.19194C13.1372 9.30915 12.9783 9.375 12.8125 9.375Z`})),CH=X(`IconNotification`,(0,R.jsx)(`path`,{d:`M16.25 10V16.25C16.25 16.4158 16.1842 16.5747 16.0669 16.6919C15.9497 16.8092 15.7908 16.875 15.625 16.875H3.75C3.58424 16.875 3.42527 16.8092 3.30806 16.6919C3.19085 16.5747 3.125 16.4158 3.125 16.25V4.375C3.125 4.20924 3.19085 4.05027 3.30806 3.93306C3.42527 3.81585 3.58424 3.75 3.75 3.75H10M17.5 4.6875C17.5 5.89562 16.5206 6.875 15.3125 6.875C14.1044 6.875 13.125 5.89562 13.125 4.6875C13.125 3.47938 14.1044 2.5 15.3125 2.5C16.5206 2.5 17.5 3.47938 17.5 4.6875Z`,fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`})),wH=X(`IconCamera`,(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(`path`,{d:`M16.25 16.25H3.75C3.41848 16.25 3.10054 16.1183 2.86612 15.8839C2.6317 15.6495 2.5 15.3315 2.5 15V6.25C2.5 5.91848 2.6317 5.60054 2.86612 5.36612C3.10054 5.1317 3.41848 5 3.75 5H6.25L7.5 3.125H12.5L13.75 5H16.25C16.5815 5 16.8995 5.1317 17.1339 5.36612C17.3683 5.60054 17.5 5.91848 17.5 6.25V15C17.5 15.3315 17.3683 15.6495 17.1339 15.8839C16.8995 16.1183 16.5815 16.25 16.25 16.25Z`,fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`}),(0,R.jsx)(`path`,{d:`M10 13.125C11.5533 13.125 12.8125 11.8658 12.8125 10.3125C12.8125 8.7592 11.5533 7.5 10 7.5C8.4467 7.5 7.1875 8.7592 7.1875 10.3125C7.1875 11.8658 8.4467 13.125 10 13.125Z`,fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`})]})),TH=X(`IconLink`,(0,R.jsx)(`path`,{d:`M7.49989 12.4999L12.4999 7.49989M8.74989 5.94598L11.0983 3.60223C11.8035 2.90843 12.7543 2.52139 13.7436 2.52542C14.7328 2.52945 15.6804 2.92422 16.3799 3.62374C1
4667.0795 4.32326 17.4742 5.27086 17.4783 6.26012C17.4823 7.24938 17.0953 8.20016 16.4015 8.90536L14.053 11.2499M5.94598 8.74989L3.60223 11.0983C2.90843 11.8035 2.52139 12.7543 2.52542 13.7436C2.52945 14.7328 2.92422 15.6804 3.62374 16.3799C4.32326 17.0795 5.27086 17.4742 6.26012 17.4783C7.24938 17.4823 8.20016 17.0953 8.90536 16.4015L11.2499 14.053`,fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`})),EH=X(`IconPoll`,(0,R.jsx)(`path`,{d:`M3.75 16.25V10.625H7.5M17.5 16.25H2.5M7.5 16.25V6.875H11.875M11.875 16.25V3.125H16.25V16.25`,fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`})),DH=X(`IconCheckmark1Small`,(0,R.jsx)(`path`,{d:`M3.125 11.25L7.5 15.625L17.5 5.625`,fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`})),OH=X(`IconCheckmark`,(0,R.jsx)(`path`,{d:`M3.125 11.25L7.5 15.625L17.5 5.625`,fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`})),kH=X(`IconChevronDown`,(0,R.jsx)(`path`,{d:`M16.25 7.5L10 13.75L3.75 7.5`,fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`})),AH=X(`IconChevronLeft`,(0,R.jsx)(`path`,{d:`M12.5 16.25L6.25 10L12.5 3.75`,fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`}),{"data-rtl-mirror":``}),jH=X(`IconChevronRight`,(0,R.jsx)(`path`,{d:`M7.5 3.75L13.75 10L7.5 16.25`,fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`}),{"data-rtl-mirror":``}),MH=X(`IconNoSign`,(0,R.jsx)(`path`,{d:`M15.3031 15.3031L4.69688 4.69688M17.5 10C17.5 14.1421 14.1421 17.5 10 17.5C5.85786 17.5 2.5 14.1421 2.5 10C2.5 5.85786 5.85786 2.5 10 2.5C14.1421 2.5 17.5 5.85786 17.5 10Z`,fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeMiterlimit:`10`,strokeWidth:`1.5`})),NH=X(`IconMinusCircle`,(0,R.jsx)(`path`,{d:`M6.875 10H13.125M17.5 10C17.5 14.1421 14.1421 17.5 10 17.5C5.85786 17.5 2.5 14.1421 2.5 10C2.5 5.85786 5.85786 2.5 10 2.5C14.1421 2.5 17.5 5.85786 17.5 10Z`,fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeMiterlimit:`10`,strokeWidth:`1.5`})),PH=X(`IconMinus`,(0,R.jsx)(`path`,{d:`M16.875 9.40039C17.2064 9.40039 17.4746 9.66863 17.4746 10C17.4746 10.3314 17.2064 10.5996 16.875 10.5996H3.125C2.79363 10.5996 2.52539 10.3314 2.52539 10C2.52539 9.66863 2.79363 9.40039 3.125 9.40039H16.875Z`,fill:`currentColor`})),FH=X(`IconXCircle`,(0,R.jsx)(`path`,{d:`M12.5 7.5L7.5 12.5M7.5 7.5L12.5 12.5M17.5 10C17.5 14.1421 14.1421 17.5 10 17.5C5.85786 17.5 2.5 14.1421 2.5 10C2.5 5.85786 5.85786 2.5 10 2.5C14.1421 2.5 17.5 5.85786 17.5 10Z`,fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`})),IH=X(`IconClock`,(0,R.jsx)(`path`,{d:`M10 5.625V10H14.375M17.5 10C17.5 14.1421 14.1421 17.5 10 17.5C5.85786 17.5 2.5 14.1421 2.5 10C2.5 5.85786 5.85786 2.5 10 2.5C14.1421 2.5 17.5 5.85786 17.5 10Z`,fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`})),LH=X(`IconQuote`,(0,R.jsx)(`path`,{d:`M8.4375 11.25H3.125C2.95924 11.25 2.80027 11.1842 2.68306 11.0669C2.56585 10.9497 2.5 10.7908 2.5 10.625V5.625C2.5 5.45924 2.56585 5.30027 2.68306 5.18306C2.80027 5.06585 2.95924 5 3.125 5H7.8125C7.97826 5 8.13723 5.06585 8.25444 5.18306C8.37165 5.30027 8.4375 5.45924 8.4375 5.625V12.5C8.4375 13.3288 8.10826 14.1237 7.52221 14.7097C6.93616 15.2958 6.1413 15.625 5.3125 15.625M17.5 11.25H12.1875C12.0217 11.25 11.8628 11.1842 11.7456 11.0669C11.6283 10.9497 11.5625 10.7908 11.5625 10.625V5.625C11.5625 5.45924 11.6283 5.30027 11.7456 5.18306C11.8628 5.06585 12.0217 5 12.1875 5H16.875C17.0408 5 17.1997 5.06585 17.3169 5.18306C17.4342 5.30027 17.5 5.45924 17.5 5.625V12.5C17.5 13.3288 17.1708 14.1237 16.5847 14.7097C15.9987 15.2958 15.2038 15.625 14.375 15.625`,fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`})),RH=X(`IconXmark`,(0,R.jsx)(`path`,{d:`M15.625 4.375L4.375 15.625M15.625 15.625L4.375 4.375`,fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`2`})),zH=X(`IconXmarkSmall`,(0,R.jsx)(`path`,{d:`M13.5 6.5L6.5 13.5M13.5 13.5L6.5 6.5`,fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`})),BH=X(`IconMore`,(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(`path`,{d:`M10 11.25C10.6904 11.25 11.25 10.6904 11.25 10C11.25 9.30964 10.6904 8.75 10 8.75C9.30964 8.75 8.75 9.30964 8.75 10C8.75 10.6904 9.30964 11.25 10 11.25Z`}),(0,R.jsx)(`path`,{d:`M4.6875 11.25C5.37786 11.25 5.9375 10.6904 5.9375 10C5.9375 9.30964 5.37786 8.75 4.6875 8.75C3.99714 8.75 3.4375 9.30964 3.4375 10C3.4375 10.6904 3.99714 11.25 4.6875 11.25Z`}),(0,R.jsx)(`path`,{d:`M15.3125 11.25C16.0029 11.25 16.5625 10.6904 16.5625 10C16.5625 9.30964 16.0029 8.75 15.3125 8.75C14.6221 8.75 14.0625 9.30964 14.0625 10C14.0625 10.6904 14.6221 11.25 15.3125 11.25Z`})]})),VH=X(`IconReorder`,(0,R.jsx)(`path`,{d:`M8.875 15.3125C8.875 16.2445 8.11948 17 7.1875 17C6.25552 17 5.5 16.2445 5.5 15.3125C5.5 14.3805 6.25552 13.625 7.1875 13.625C8.11948 13.625 8.875 14.3805 8.875 15.3125ZM14.5 15.3125C14.5 16.2445 13.7445 17 12.8125 17C11.8805 17 11.125 16.2445 11.125 15.3125C11.125 14.3805 11.8805 13.625 12.8125 13.625C13.7445 13.625 14.5 14.3805 14.5 15.3125ZM8.875 10C8.875 10.932 8.11948 11.6875 7.1875 11.6875C6.25552 11.6875 5.5 10.932 5.5 10C5.5 9.06802 6.25552 8.3125 7.1875 8.3125C8.11948 8.3125 8.875 9.06802 8.875 10ZM14.5 10C14.5 10.932 13.7445 11.6875 12.8125 11.6875C11.8805 11.6875 11.125 10.932 11.125 10C11.125 9.06802 11.8805 8.3125 12.8125 8.3125C13.7445 8.3125 14.5 9.06802 14.5 10ZM8.875 4.6875C8.875 5.61948 8.11948 6.375 7.1875 6.375C6.25552 6.375 5.5 5.61948 5.5 4.6875C5.5 3.75552 6.25552 3 7.1875 3C8.11948 3 8.875 3.75552 8.875 4.6875ZM14.5 4.6875C14.5 5.61948 13.7445 6.375 12.8125 6.375C11.8805 6.375 11.125 5.61948 11.125 4.6875C11.125 3.75552 11.8805 3 12.8125 3C13.7445 3 14.5 3.75552 14.5 4.6875Z`})),HH=X(`IconChecks`,(0,R.jsx)(`path`,{d:`M1.5 10.5724L4.98387 13.9936L13.1129 6.00977M10.371 13.9936L18.5 6.00977`,fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`})),UH=X(`IconDownload`,(0,R.jsx)(`path`,{d:`M2.375 11.25C2.375 10.8358 2.71079 10.5 3.125 10.5C3.53921 10.5 3.875 10.8358 3.875 11.25V15.5H16.125V11.25C16.125 10.8358 16.4608 10.5 16.875 10.5C17.2892 10.5 17.625 10.8358 17.625 11.25V16.25C17.625 16.6642 17.2892 17 16.875 17H3.125C2.71079 17 2.375 16.6642 2.375 16.25V11.25ZM9.25 2.5C9.25 2.08579 9.58579 1.75 10 1.75C10.4142 1.75 10.75 2.08579 10.75 2.5V9.43945L12.5947 7.59473C12.8876 7.30183 13.3624 7.30183 13.6553 7.59473C13.9482 7.88762 13.9482 8.36238 13.6553 8.65527L10.5303 11.7803C10.2374 12.0732 9.76262 12.0732 9.46973 11.7803L6.34473 8.65527C6.05183 8.3
4666238 6.05183 7.88762 6.34473 7.59473C6.63762 7.30183 7.11238 7.30183 7.40527 7.59473L9.25 9.43945V2.5Z`,fill:`currentColor`})),WH=X(`IconEdit`,(0,R.jsx)(`path`,{d:`M10.625 5.0001L15 9.3751M7.24141 16.8751H3.75C3.58424 16.8751 3.42527 16.8093 3.30806 16.692C3.19085 16.5748 3.125 16.4159 3.125 16.2501V12.7587C3.12508 12.5932 3.19082 12.4344 3.30781 12.3173L12.9422 2.68291C13.0594 2.56579 13.2183 2.5 13.384 2.5C13.5497 2.5 13.7086 2.56579 13.8258 2.68291L17.3172 6.17198C17.4343 6.28917 17.5001 6.44808 17.5001 6.61377C17.5001 6.77946 17.4343 6.93837 17.3172 7.05557L7.68281 16.6923C7.56569 16.8093 7.40695 16.875 7.24141 16.8751Z`,fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`})),GH=X(`IconEmoji`,(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(`path`,{d:`M16.75 10C16.75 6.27208 13.7279 3.25 10 3.25C6.27208 3.25 3.25 6.27208 3.25 10C3.25 13.7279 6.27208 16.75 10 16.75C13.7279 16.75 16.75 13.7279 16.75 10ZM18.25 10C18.25 14.5563 14.5563 18.25 10 18.25C5.44365 18.25 1.75 14.5563 1.75 10C1.75 5.44365 5.44365 1.75 10 1.75C14.5563 1.75 18.25 5.44365 18.25 10Z`}),(0,R.jsx)(`path`,{d:`M7.1875 9.375C7.70527 9.375 8.125 8.95527 8.125 8.4375C8.125 7.91973 7.70527 7.5 7.1875 7.5C6.66973 7.5 6.25 7.91973 6.25 8.4375C6.25 8.95527 6.66973 9.375 7.1875 9.375Z`}),(0,R.jsx)(`path`,{d:`M12.8125 9.375C13.3303 9.375 13.75 8.95527 13.75 8.4375C13.75 7.91973 13.3303 7.5 12.8125 7.5C12.2947 7.5 11.875 7.91973 11.875 8.4375C11.875 8.95527 12.2947 9.375 12.8125 9.375Z`}),(0,R.jsx)(`path`,{d:`M12.4756 11.499C12.683 11.1407 13.1425 11.0182 13.501 11.2256C13.8593 11.433 13.9818 11.8925 13.7744 12.251C13.0125 13.568 11.6947 14.5 10 14.5C8.30531 14.5 6.98748 13.568 6.22559 12.251C6.01825 11.8925 6.14067 11.433 6.49902 11.2256C6.85749 11.0182 7.31695 11.1407 7.52441 11.499C8.05942 12.424 8.91824 13 10 13C11.0818 13 11.9406 12.424 12.4756 11.499Z`})]})),KH=X(`IconEmojiAdd`,(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(`path`,{d:`M1.75 10C1.75 5.44365 5.44365 1.75 10 1.75C10.4142 1.75 10.75 2.08579 10.75 2.5C10.75 2.91421 10.4142 3.25 10 3.25C6.27208 3.25 3.25 6.27208 3.25 10C3.25 13.7279 6.27208 16.75 10 16.75C13.7279 16.75 16.75 13.7279 16.75 10C16.75 9.58579 17.0858 9.25 17.5 9.25C17.9142 9.25 18.25 9.58579 18.25 10C18.25 14.5563 14.5563 18.25 10 18.25C5.44365 18.25 1.75 14.5563 1.75 10Z`,fill:`currentColor`}),(0,R.jsx)(`path`,{d:`M7.1875 9.375C7.70527 9.375 8.125 8.95527 8.125 8.4375C8.125 7.91973 7.70527 7.5 7.1875 7.5C6.66973 7.5 6.25 7.91973 6.25 8.4375C6.25 8.95527 6.66973 9.375 7.1875 9.375Z`,fill:`currentColor`}),(0,R.jsx)(`path`,{d:`M12.8125 9.375C13.3303 9.375 13.75 8.95527 13.75 8.4375C13.75 7.91973 13.3303 7.5 12.8125 7.5C12.2947 7.5 11.875 7.91973 11.875 8.4375C11.875 8.95527 12.2947 9.375 12.8125 9.375Z`,fill:`currentColor`}),(0,R.jsx)(`path`,{d:`M12.4756 11.499C12.683 11.1407 13.1425 11.0182 13.501 11.2256C13.8593 11.433 13.9818 11.8925 13.7744 12.251C13.0125 13.568 11.6947 14.5 10 14.5C8.30531 14.5 6.98748 13.568 6.22559 12.251C6.01825 11.8925 6.14067 11.433 6.49902 11.2256C6.85749 11.0182 7.31695 11.1407 7.52441 11.499C8.05942 12.424 8.91824 13 10 13C11.0818 13 11.9406 12.424 12.4756 11.499Z`,fill:`currentColor`}),(0,R.jsx)(`path`,{d:`M15.083 6.87524V4.91626H13.125C12.7108 4.91626 12.375 4.58047 12.375 4.16626C12.3752 3.7522 12.7109 3.41626 13.125 3.41626H15.083V1.45825C15.083 1.04415 15.4189 0.708427 15.833 0.708252C16.2472 0.708252 16.583 1.04404 16.583 1.45825V3.41626H18.542C18.9559 3.41644 19.2918 3.7523 19.292 4.16626C19.292 4.58036 18.9561 4.91608 18.542 4.91626H16.583V6.87524C16.5828 7.28931 16.2471 7.62524 15.833 7.62524C15.4191 7.62507 15.0832 7.2892 15.083 6.87524Z`,fill:`currentColor`})]})),qH=X(`IconExclamationMarkFill`,(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(`path`,{d:`M10 16.875C10.6904 16.875 11.25 16.3154 11.25 15.625C11.25 14.9346 10.6904 14.375 10 14.375C9.30964 14.375 8.75 14.9346 8.75 15.625C8.75 16.3154 9.30964 16.875 10 16.875Z`}),(0,R.jsx)(`path`,{d:`M9 11.875V3.75C9 3.19772 9.44772 2.75 10 2.75C10.5523 2.75 11 3.19772 11 3.75V11.875C11 12.4273 10.5523 12.875 10 12.875C9.44772 12.875 9 12.4273 9 11.875Z`})]})),JH=X(`IconExclamationCircleFill`,(0,R.jsx)(`path`,{d:`M10 1.875C8.39303 1.875 6.82214 2.35152 5.486 3.24431C4.14985 4.1371 3.10844 5.40605 2.49348 6.8907C1.87852 8.37535 1.71762 10.009 2.03112 11.5851C2.34463 13.1612 3.11846 14.6089 4.25476 15.7452C5.39106 16.8815 6.8388 17.6554 8.41489 17.9689C9.99099 18.2824 11.6247 18.1215 13.1093 17.5065C14.594 16.8916 15.8629 15.8502 16.7557 14.514C17.6485 13.1779 18.125 11.607 18.125 10C18.1227 7.84581 17.266 5.78051 15.7427 4.25727C14.2195 2.73403 12.1542 1.87727 10 1.875ZM9.375 6.25C9.375 6.08424 9.44085 5.92527 9.55806 5.80806C9.67527 5.69085 9.83424 5.625 10 5.625C10.1658 5.625 10.3247 5.69085 10.4419 5.80806C10.5592 5.92527 10.625 6.08424 10.625 6.25V10.625C10.625 10.7908 10.5592 10.9497 10.4419 11.0669C10.3247 11.1842 10.1658 11.25 10 11.25C9.83424 11.25 9.67527 11.1842 9.55806 11.0669C9.44085 10.9497 9.375 10.7908 9.375 10.625V6.25ZM10 14.375C9.81458 14.375 9.63333 14.32 9.47916 14.217C9.32499 14.114 9.20482 13.9676 9.13387 13.7963C9.06291 13.625 9.04434 13.4365 9.08052 13.2546C9.11669 13.0727 9.20598 12.9057 9.33709 12.7746C9.4682 12.6435 9.63525 12.5542 9.81711 12.518C9.99896 12.4818 10.187
4665 12.5004 10.3588 12.5714C10.5301 12.6423 10.6765 12.7625 10.7795 12.9167C10.8825 13.0708 10.9375 13.2521 10.9375 13.4375C10.9375 13.6861 10.8387 13.9246 10.6629 14.1004C10.4871 14.2762 10.2486 14.375 10 14.375Z`})),YH=X(`IconExclamationMark`,(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(`path`,{d:`M16.75 10C16.75 6.27208 13.7279 3.25 10 3.25C6.27208 3.25 3.25 6.27208 3.25 10C3.25 13.7279 6.27208 16.75 10 16.75C13.7279 16.75 16.75 13.7279 16.75 10ZM18.25 10C18.25 14.5563 14.5563 18.25 10 18.25C5.44365 18.25 1.75 14.5563 1.75 10C1.75 5.44365 5.44365 1.75 10 1.75C14.5563 1.75 18.25 5.44365 18.25 10Z`}),(0,R.jsx)(`path`,{d:`M9.25 10.625V6.25C9.25 5.83579 9.58579 5.5 10 5.5C10.4142 5.5 10.75 5.83579 10.75 6.25V10.625C10.75 11.0392 10.4142 11.375 10 11.375C9.58579 11.375 9.25 11.0392 9.25 10.625Z`}),(0,R.jsx)(`path`,{d:`M10 14.375C10.5178 14.375 10.9375 13.9553 10.9375 13.4375C10.9375 12.9197 10.5178 12.5 10 12.5C9.48223 12.5 9.0625 12.9197 9.0625 13.4375C9.0625 13.9553 9.48223 14.375 10 14.375Z`})]})),XH=X(`IconExclamationTriangleFill`,(0,R.jsx)(`path`,{d:`M18.4999 14.6946L11.6678 2.82974C11.4971 2.53906 11.2534 2.29803 10.9608 2.13057C10.6682 1.9631 10.337 1.875 9.99986 1.875C9.66275 1.875 9.33149 1.9631 9.03892 2.13057C8.74635 2.29803 8.50262 2.53906 8.33189 2.82974L1.49986 14.6946C1.33559 14.9757 1.24902 15.2955 1.24902 15.6211C1.24902 15.9468 1.33559 16.2665 1.49986 16.5477C1.6684 16.8401 1.91171 17.0825 2.20483 17.2498C2.49795 17.4172 2.83032 17.5036 3.16783 17.5001H16.8319C17.1691 17.5033 17.5012 17.4168 17.794 17.2494C18.0868 17.0821 18.3299 16.8399 18.4983 16.5477C18.6628 16.2667 18.7496 15.947 18.7499 15.6214C18.7502 15.2957 18.6639 14.9759 18.4999 14.6946ZM9.37486 8.12505C9.37486 7.95929 9.44071 7.80032 9.55792 7.68311C9.67513 7.5659 9.8341 7.50005 9.99986 7.50005C10.1656 7.50005 10.3246 7.5659 10.4418 7.68311C10.559 7.80032 10.6249 7.95929 10.6249 8.12505V11.2501C10.6249 11.4158 10.559 11.5748 10.4418 11.692C10.3246 11.8092 10.1656 11.8751 9.99986 11.8751C9.8341 11.8751 9.67513 11.8092 9.55792 11.692C9.44071 11.5748 9.37486 11.4158 9.37486 11.2501V8.12505ZM9.99986 15.0001C9.81444 15.0001 9.63319 14.9451 9.47901 14.8421C9.32484 14.739 9.20468 14.5926 9.13372 14.4213C9.06277 14.25 9.0442 14.0615 9.08038 13.8797C9.11655 13.6978 9.20584 13.5308 9.33695 13.3996C9.46806 13.2685 9.63511 13.1792 9.81696 13.1431C9.99882 13.1069 10.1873 13.1255 10.3586 13.1964C10.5299 13.2674 10.6764 13.3875 10.7794 13.5417C10.8824 13.6959 10.9374 13.8771 10.9374 14.0626C10.9374 14.3112 10.8386 14.5496 10.6628 14.7255C10.487 14.9013 10.2485 15.0001 9.99986 15.0001Z`})),ZH=X(`IconEyeFill`,(0,R.jsx)(`path`,{d:`M19.3211 9.74688C19.2937 9.68516 18.632 8.21719 17.1609 6.74609C15.2008 4.78594 12.725 3.75 9.99999 3.75C7.27499 3.75 4.79921 4.78594 2.83905 6.74609C1.36796 8.21719 0.703118 9.6875 0.678899 9.74688C0.643362 9.82681 0.625 9.91331 0.625 10.0008C0.625 10.0883 0.643362 10.1748 0.678899 10.2547C0.706243 10.3164 1.36796 11.7836 2.83905 13.2547C4.79921 15.2141 7.27499 16.25 9.99999 16.25C12.725 16.25 15.2008 15.2141 17.1609 13.2547C18.632 11.7836 19.2937 10.3164 19.3211 10.2547C19.3566 10.1748 19.375 10.0883 19.375 10.0008C19.375 9.91331 19.3566 9.82681 19.3211 9.74688ZM9.99999 13.125C9.38193 13.125 8.77774 12.9417 8.26384 12.5983C7.74993 12.255 7.34939 11.7669 7.11287 11.1959C6.87634 10.6249 6.81446 9.99653 6.93504 9.39034C7.05562 8.78415 7.35324 8.22733 7.79028 7.79029C8.22732 7.35325 8.78414 7.05562 9.39033 6.93505C9.99652 6.81447 10.6249 6.87635 11.1959 7.11288C11.7669 7.3494 12.25
4665 7.74994 12.5983 8.26384C12.9417 8.77775 13.125 9.38193 13.125 10C13.125 10.8288 12.7958 11.6237 12.2097 12.2097C11.6236 12.7958 10.8288 13.125 9.99999 13.125Z`})),QH=X(`IconUnsupportedAttachment`,(0,R.jsx)(`path`,{d:`M4.5 16.75H15.5V7.625H11.875C11.4608 7.625 11.125 7.28921 11.125 6.875V3.25H4.5V16.75ZM11.3447 9.46973C11.6376 9.17683 12.1124 9.17683 12.4053 9.46973C12.6982 9.76262 12.6982 10.2374 12.4053 10.5303L11.0605 11.875L12.4053 13.2197C12.6982 13.5126 12.6982 13.9874 12.4053 14.2803C12.1124 14.5732 11.6376 14.5732 11.3447 14.2803L10 12.9355L8.65527 14.2803C8.36238 14.5732 7.88762 14.5732 7.59473 14.2803C7.30183 13.9874 7.30183 13.5126 7.59473 13.2197L8.93945 11.875L7.59473 10.5303C7.30183 10.2374 7.30183 9.76262 7.59473 9.46973C7.88762 9.17683 8.36238 9.17683 8.65527 9.46973L10 10.8145L11.3447 9.46973ZM12.625 6.125H14.4395L12.625 4.31055V6.125ZM17 16.875C17 17.2397 16.8555 17.5898 16.5977 17.8477C16.3398 18.1055 15.9897 18.25 15.625 18.25H4.375C4.01033 18.25 3.66021 18.1055 3.40234 17.8477C3.14448 17.5898 3 17.2397 3 16.875V3.125C3 2.76033 3.14448 2.41021 3.40234 2.15234L3.50391 2.06152C3.74856 1.86111 4.05597 1.75 4.375 1.75H11.875C12.0739 1.75 12.2646 1.82907 12.4053 1.96973L16.7803 6.34473C16.9209 6.48538 17 6.67609 17 6.875V16.875Z`,fill:`currentColor`})),$H=X(`IconUpload`,(0,R.jsx)(`path`,{d:`M11.875 2.5H4.375C4.20924 2.5 4.05027 2.56585 3.93306 2.68306C3.81585 2.80027 3.75 2.95924 3.75 3.125V16.875C3.75 17.0408 3.81585 17.1997 3.93306 17.3169C4.05027 17.4342 4.20924 17.5 4.375 17.5H15.625C15.7908 17.5 15.9497 17.4342 16.0669 17.3169C16.1842 17.1997 16.25 17.0408 16.25 16.875V6.875M11.875 2.5L16.25 6.875M11.875 2.5V6.875H16.25M8.125 11.25L10 9.375M10 9.375L11.875 11.25M10 9.375V14.375`,fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`})),eU=X(`IconFile`,(0,R.jsx)(`path`,{d:`M11.875 2.5H4.375C4.20924 2.5 4.05027 2.56585 3.93306 2.68306C3.81585 2.80027 3.75 2.95924 3.75 3.125V16.875C3.75 17.0408 3.81585 17.1997 3.93306 17.3169C4.05027 17.4342 4.20924 17.5 4.375 17.5H15.625C15.7908 17.5 15.9497 17.4342 16.0669 17.3169C16.1842 17.1997 16.25 17.0408 16.25 16.875V6.875M11.875 2.5L16.25 6.875M11.875 2.5V6.875H16.25`,fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`})),tU=X(`IconFlag`,(0,R.jsx)(`path`,{d:`M3.75 17.5001V4.3751C8.75 0.0446299 12.5 8.70557 17.5 4.3751V13.7501C12.5 18.0806 8.75 9.41963 3.75 13.7501`,fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`})),nU=X(`IconImage`,(0,R.jsx)(`path`,{d:`M4.42891 16.875L12.9953 8.30781C13.0534 8.2497 13.1223 8.2036 13.1982 8.17215C13.274 8.1407 13.3554 8.12451 13.4375 8.12451C13.5196 8.12451 13.601 8.1407 13.6768 8.17215C13.7527 8.2036 13.8216 8.2497 13.8797 8.30781L16.875 11.3039M3.75 3.125H16.25C16.5952 3.125 16.875 3.40482 16.875 3.75V16.25C16.875 16.5952 16.5952 16.875 16.25 16.875H3.75C3.40482 16.875 3.125 16.5952 3.125 16.25V3.75C3.125 3.40482 3.40482 3.125 3.75 3.125ZM8.75 7.5C8.75 8.19036 8.19036 8.75 7.5 8.75C6.80964 8.75 6.25 8.19036 6.25 7.5C6.25 6.80964 6.80964 6.25 7.5 6.25C8.19036 6.25 8.75 6.80964 8.75 7.5Z`,fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`})),rU=X(`IconSearch`,(0,R.jsx)(`path`,{d:`M13.1695 13.1695L17.5 17.5M15 8.75C15 12.2018 12.2018 15 8.75 15C5.29822 15 2.5 12.2018 2.5 8.75C2.5 5.29822 5.29822 2.5 8.75 2.5C12.2018 2.5 15 5.29822 15 8.75Z`,fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`}),{"data-rtl-mirror":``}),iU=X(`IconLocation`,(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(`path`,{d:`M10 10.625C11.3807 10.625 12.5 9.50571 12.5 8.125C12.5 6.74429 11.3807 5.625 10 5.625C8.61929 5.625 7.5 6.74429 7.5 8.125C7.5 9.50571 8.61929 10.625 10 10.625Z`,fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`}),(0,R.jsx)(`path`,{d:`M16.25 8.125C16.25 13.75 10 18.125 10 18.125C10 18.125 3.75 13.75 3.75 8.125C3.75 6.4674 4.40848 4.87769 5.58058 3.70558C6.75269 2.53348 8.3424 1.875 10 1.875C11.6576 1.875 13.2473 2.53348 14.4194 3.70558C15.5915 4.87769 16.25 6.4674 16.25 8.125Z`,fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`})]})),aU=X(`IconVoice`,(0,R.jsx)(`path`,{d:`M10 15.625V18.75M10 15.625C11.4918 15.625 12.9226 15.0324 13.9775 13.9775C15.0324 12.9226 15.625 11.4918 15.625 10M10 15.625C8.50816 15.625 7.07742 15.0324 6.02252 13.9775C4.96763 12.9226 4.375 11.4918 4.375 10M10 1.875C11.7259 1.875 13.125 3.27411 13.125 5V10C13.125 11.7259 
46611.7259 13.125 10 13.125C8.27411 13.125 6.875 11.7259 6.875 10V5C6.875 3.27411 8.27411 1.875 10 1.875Z`,fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`})),oU=X(`IconMicrophoneSolid`,(0,R.jsx)(`path`,{d:`M6.25 10V5C6.25 4.00544 6.64509 3.05161 7.34835 2.34835C8.05161 1.64509 9.00544 1.25 10 1.25C10.9946 1.25 11.9484 1.64509 12.6517 2.34835C13.3549 3.05161 13.75 4.00544 13.75 5V10C13.75 10.9946 13.3549 11.9484 12.6517 12.6517C11.9484 13.3549 10.9946 13.75 10 13.75C9.00544 13.75 8.05161 13.3549 7.34835 12.6517C6.64509 11.9484 6.25 10.9946 6.25 10ZM16.25 10C16.25 9.83424 16.1842 9.67527 16.0669 9.55806C15.9497 9.44085 15.7908 9.375 15.625 9.375C15.4592 9.375 15.3003 9.44085 15.1831 9.55806C15.0658 9.67527 15 9.83424 15 10C15 11.3261 14.4732 12.5979 13.5355 13.5355C12.5979 14.4732 11.3261 15 10 15C8.67392 15 7.40215 14.4732 6.46447 13.5355C5.52678 12.5979 5 11.3261 5 10C5 9.83424 4.93415 9.67527 4.81694 9.55806C4.69973 9.44085 4.54076 9.375 4.375 9.375C4.20924 9.375 4.05027 9.44085 3.93306 9.55806C3.81585 9.67527 3.75 9.83424 3.75 10C3.7519 11.5489 4.32806 13.042 5.36707 14.1907C6.40607 15.3393 7.83409 16.062 9.375 16.2188V18.75C9.375 18.9158 9.44085 19.0747 9.55806 19.1919C9.67527 19.3092 9.83424 19.375 10 19.375C10.1658 19.375 10.3247 19.3092 10.4419 19.1919C10.5592 19.0747 10.625 18.9158 10.625 18.75V16.2188C12.1659 16.062 13.5939 15.3393 14.6329 14.1907C15.6719 13.042 16.2481 11.5489 16.25 10Z`,fill:`currentColor`})),sU=X(`IconMute`,(0,R.jsx)(`path`,{d:`M15.625 8.125V11.875M18.125 6.875V13.125M4.375 3.125L16.875 16.875M9.38672 4.92109L12.5 2.5V8.34609M12.5 12.0625V17.5L6.875 13.125H3.125C2.95924 13.125 2.80027 13.0592 2.68306 12.9419C2.56585 12.8247 2.5 12.6658 2.5 12.5V7.5C2.5 7.33424 2.56585 7.17527 2.68306 7.05806C2.80027 6.94085 2.95924 6.875 3.125 6.875H7.78437`,fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`}),{"data-rtl-mirror":``}),cU=X(`IconSend`,(0,R.jsx)(`path`,{d:`M11.2498 10H6.24982M6.24982 10L3.7881 2.71328C3.74537 2.59349 3.7402 2.4635 3.7733 2.34069C3.80639 2.21788 3.87616 2.10808 3.9733 2.02597C4.07044 1.94386 4.19032 1.89335 4.31693 1.88117C4.44353 1.86899 4.57084 1.89573 4.68185 1.95781L17.8069 9.4461C17.9045 9.50015 17.986 9.57937 18.0427 9.67555C18.0994 9.77172 18.1293 9.88133 18.1293 9.99297C18.1293 10.1046 18.0994 10.2142 18.0427 10.3104C17.986 10.4066 17.9045 10.4858 17.8069 10.5398L4.68185 18.0469C4.57051 18.1096 4.4426 18.1367 4.31537 18.1245C4.18815 18.1123 4.06772 18.0614 3.97032 17.9787C3.87292 17.8959 3.80323 17.7853 3.77065 17.6617C3.73807 17.5381 3.74416 17.4075 3.7881 17.2875L6.24982 10Z`,fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`}),{"data-rtl-mirror":``}),lU=X(`IconAttachment`,(0,R.jsx)(`path`,{d:`M12.4999 6.24998L5.9913 12.8664C5.76258 13.102 5.63576 13.4181 5.63823 13.7465C5.6407 14.0748 5.77227 14.389 6.00451 14.6211C6.23674 14.8533 6.55099 14.9847 6.87934 14.987C7.20769 14.9894 7.52376 14.8624 7.75927 14.6336L15.5179 6.76795C15.9868 6.29905 16.2502 5.6631 16.2502 4.99998C16.2502 4.33686 15.9868 3.70091 15.5179 3.23201C15.049 2.76312 14.413 2.49969 13.7499 2.49969C13.0868 2.49969 12.4508 2.76312 11.9819 3.23201L4.22333 11.0984C3.52953 11.8036 3.14249 12.7544 3.14652 13.7437C3.15054 14.7329 3.54531 15.6805 4.24483 16.38C4.94435 17.0796 5.89195 17.4743 6.88121 17.4784C7.87048 17.4824 8.82126 17.0953 9.52645 16.4015L15.9374 9.99998`,fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`})),uU=X(`IconPauseFill`,(0,R.jsx)(`path`,{d:`M16.875 3.75V16.25C16.875 16.5815 16.7433 16.8995 16.5089 17.1339C16.2745 17.3683 15.9565 17.5 15.625 17.5H12.5C12.1685 17.5 11.8505 17.3683 11.6161 17.1339C11.3817 16.8995 11.25 16.5815 11.25 16.25V3.75C11.25 3.41848 11.3817 3.10054 11.6161 2.86612C11.8505 2.6317 12.1685 2.5 12.5 2.5H15.625C15.9565 2.5 16.2745 2.6317 16.5089 2.86612C16.7433 3.10054 16.875 3.41848 16.875 3.75ZM7.5 2.5H4.375C4.04348 2.5 3.72554 2.6317 3.49112 2.86612C3.2567 3.10054 3.125 3.41848 3.125 3.75V16.25C3.125 16.5815 3.2567 16.8995 3.49112 17.1339C3.72554 17.3683 4.04348 17.5 4.375 17.5H7.5C7.83152 17.5 8.14946 17.3683 8.38388 17.1339C8.6183 16.8995 8.75 16.5815 8.75 16.25V3.75C8.75 3.41848 8.6183 3.10054 8.38388 2.86612C8.14946 2.6317 7.83152 2.5 7.5 2.5Z`})),dU=X(`IconUser`,(0,R.jsx)(`path`,{d:`M10 12.5C12.7614 12.5 15 10.2614 15 7.5C15 4.73858 12.7614 2.5 10 2.5C7.23858 2.5 5 4.73858 5 7.5C5 10.2614 7.23858 12.5 10 12.5ZM10 12.5C6.76172 12.5 4.01328 14.2602 2.5 16.875M10 12.5C13.2383 12.5 15.9867 14.2602 17.5 16.875`,fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`})),fU=X(`IconUserAdd`,(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(`g`,{clipPath:`url(#clip0_14246_498359)`,children:(0,R.jsx)(`path`,{d:`M15.625 10.625H19.375M17.5 8.75V12.5M8.4375 12.5C11.0263 12.5 13.125 10.4013 13.125 7.8125C13.125 5.22367 11.0263 3.125 8.4375 3.125C5.84867 3.125 3.75 5.22367 3.75 7.8125C3.75 10.4013 5.84867 12.5 8.4375 12.5ZM8.4375 12.5C5.74688 12.5 3.48047 13.7148 1.875 15.625M8.4375 12.5C11.1281 12.5 13.3945 13.7148 15 15.625`,fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`})}),(0,R.jsx)(`defs`,{children:(0,R.jsx)(`clipPath`,{id:`clip0_14246_498359`,children:(0,R.jsx)(`rect`,{fill:`white`,height:`20`,width:`20`})})})]})),pU=X(`IconUserCheck`,(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(`g`,{clipPath:`url(#clip0_14236_425131)`,children:(0,R.jsx)(`path`,{d:`M8.4375 12.5C11.0263 12.5 13.125 10.4013 13.125 7.8125C13.125 5.22367 11.0263 3.125 8.4375 3.125C5.84867 3.125 3.75 5.22367 3.75 7.8125C3.75 10.4013 5.84867 12.5 8.4375 12.5ZM8.4375 12.5C5.74688 12.5 3.48047 13.7148 1.875 15.625M8.4375 12.5C11.1281 12.5 13.3945 13.7148 15 15.625M15.625 11.25L16.875 12.5L19.375 10`,fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`})}),(0,R.jsx)(`defs`,{children:(0,R.jsx)(`clipPath`,{id:`clip0_14236_425131`,children:(0,R.jsx)(`rect`,{fill:`white`,height:`20`,width:`20`})})})]})),mU=X(`IconUserRemove`,(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(`g`,{clipPath:`url(#clip0_14246_434209)`,children:(0,R.jsx)(`path`,{d:`M15.625 10.625H19.375M8.4375 12.5C11.0263 12.5 13.125 10.4013 13.125 7.8125C13.125 5.22367 11.0263 3.125 8.4375 3.125C5.84867 3.125 3.75 5.22367 3.75 7.8125C3.75 10.4013 5.84867 12.5 8.4375 12.5ZM8.4375 12.5C5.74688 12.5 3.48047 13.7148 1.875 15.625M8.4375 12.5C11.1281 12.5 13.3945 13.7148 15 15.625`,fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`})}),(0,R.jsx)(`defs`,{children:(0,R.jsx)(`clipPath`,{id:`clip0_14246_434209`,children:(0,R.jsx)(`rect`,{fill:`white`,height:`20`,width:`20`})})})]})),hU=X(`IconPin`,(0,R.jsx)(`path`,{d:`M7.52271 12.4773L3.75006 16.25M17.9422 7.68279C18.0594 7.56559 18.1252 7.40668 18.1252 7.24099C18.1252 7.0753 18.0594 6.9164 17.9422 6.7992L13.2032 2.05779C13.086 1.94067 12.9271 1.87488 12.7614 1.87488C12.5957 1.87488 12.4368 1.94067 12.3196 2.05779L7.84303 6.54685C7.84303 6.54685 5.67506 5.46326 3.35943 7.33201C3.29077 7.38697 3.23447 7.45581 3.19424 7.53402C3.154 7.61224 3.13072 7.69806 3.12593 7.78589C3.12114 7.87371 3.13493 7.96156 3.16642 8.04369C3.19791 8.12581 3.24637 8.20037 3.30865 8.26248L11.7383 16.6914C11.8015 16.7541 11.8773 16.8025 11.9606 16.8336C12.044 16.8646 12.133 16.8775 12.2218 16.8713C12.3105 16.8652 12.3969 16.8402 12.4752 16.798C12.5535 16.7558 12.6219 16.6973 12.6758 16.6265C13.3313 15.7547 14.3
46661 13.9633 13.4657 12.1734L17.9422 7.68279Z`,fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`})),gU=X(`IconPlayFill`,(0,R.jsx)(`path`,{d:`M18.75 10C18.7505 10.2122 18.6961 10.4209 18.5921 10.6059C18.488 10.7908 18.3379 10.9457 18.1562 11.0555L6.9 17.9414C6.71022 18.0576 6.49287 18.1211 6.27037 18.1252C6.04788 18.1293 5.82832 18.0739 5.63438 17.9648C5.44227 17.8574 5.28225 17.7008 5.17075 17.511C5.05926 17.3213 5.00032 17.1052 5 16.8852V3.11484C5.00032 2.89475 5.05926 2.67872 5.17075 2.48896C5.28225 2.2992 5.44227 2.14257 5.63438 2.03516C5.82832 1.92605 6.04788 1.87071 6.27037 1.87483C6.49287 1.87895 6.71022 1.94239 6.9 2.05859L18.1562 8.94453C18.3379 9.05428 18.488 9.20916 18.5921 9.39411C18.6961 9.57906 18.7505 9.78779 18.75 10Z`})),_U=X(`IconPlus`,(0,R.jsx)(`path`,{d:`M3.125 10H16.875M10 3.125V16.875`,fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`2`})),vU=X(`IconPlusSmall`,(0,R.jsx)(`path`,{d:`M3.125 10H16.875M10 3.125V16.875`,fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`})),yU=X(`IconCommand`,(0,R.jsx)(`path`,{d:`M6.25 7.5L9.375 10L6.25 12.5M10.625 12.5H13.75M3.125 3.75H16.875C17.2202 3.75 17.5 4.02982 17.5 4.375V15.625C17.5 15.9702 17.2202 16.25 16.875 16.25H3.125C2.77982 16.25 2.5 15.9702 2.5 15.625V4.375C2.5 4.02982 2.77982 3.75 3.125 3.75Z`,fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`})),bU=X(`IconCopy`,(0,R.jsx)(`path`,{d:`M13.125 13.125H16.875V3.125H6.875V6.875M3.125 6.875H13.125V16.875H3.125V6.875Z`,fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`})),xU=X(`IconBolt`,(0,R.jsx)(`path`,{d:`M16.7071 9.80157L7.95711 19.1766C7.86438 19.2755 7.74198 19.3416 7.60839 19.3649C7.47479 19.3882 7.33724 19.3674 7.2165 19.3057C7.09576 19.244 6.99837 19.1446 6.93904 19.0227C6.8797 18.9007 6.86164 18.7628 6.88757 18.6297L8.03289 12.9008L3.53054 11.2102C3.43385 11.174 3.34762 11.1144 3.27956 11.0368C3.2115 10.9592 3.16373 10.8659 3.14052 10.7653C3.1173 10.6647 3.11937 10.5599 3.14653 10.4603C3.17369 10.3607 3.2251 10.2694 3.29617 10.1945L12.0462 0.819538C12.1389 0.720581 12.2613 0.654468 12.3949 0.631176C12.5285 0.607884 12.666 0.628675 12.7868 0.690414C12.9075 0.752152 13.0049 0.851488 13.0642 0.97343C13.1236 1.09537 13.1416 1.2333 13.1157 1.36641L11.9673 7.10157L16.4696 8.78985C16.5656 8.82626 16.6511 8.88576 16.7187 8.96307C16.7862 9.04039 16.8336 9.13315 16.8568 9.23316C16.88 9.33317 16.8781 9.43734 16.8515 9.53648C16.8248 9.63562 16.7742 9.72666 16.704 9.80157H16.7071Z`})),SU=X(`IconTranslate`,(0,R.jsx)(`path`,{d:`M18.75 16.875L14.375 8.125L10 16.875M11.25 14.375H17.5M7.5 2.5V4.375M2.5 4.375H12.5M10 4.375C10 6.36412 9.20982 8.27178 7.8033 9.6783C6.39678 11.0848 4.48912 11.875 2.5 11.875M5.42734 6.875C5.94442 8.33751 6.90226 9.60371 8.16893 10.4992C9.4356 11.3947 10.9488 11.8753 12.5 11.875`,fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`})),CU=X(`IconDelete`,(0,R.jsx)(`path`,{d:`M16.875 4.375H3.125M8.125 8.125V13.125M11.875 8.125V13.125M15.625 4.375V16.25C15.625 16.4158 15.5592 16.5747 15.4419 16.6919C15.3247 16.8092 15.1658 16.875 15 16.875H5C4.83424 16.875 4.67527 16.8092 4.55806 16.6919C4.44085 16.5747 4.375 16.4158 4.375 16.25V4.375M13.125 4.375V3.125C13.125 2.79348 12.9933 2.47554 12.7589 2.24112C12.5245 2.0067 12.2065 1.875 11.875 1.875H8.125C7.79348 1.875 7.47554 2.0067 7.24112 2.24112C7.0067 2.47554 6.875 2.79348 6.875 3.125V4.375`,fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`})),wU=X(`IconTrophy`,(0,R.jsx)(`path`,{d:`M7.5 17.5H12.5M10 14.375V17.5M4.53125 10H3.75C3.08696 10 2.45107 9.73661 1.98223 9.26777C1.51339 8.79893 1.25 8.16304 1.25 7.5V6.25C1.25 6.08424 1.31585 5.92527 1.43306 5.80806C1.55027 5.69085 1.70924 5.625 1.875 5.625H4.375M15.4688 10H16.25C16.913 10 17.5489 9.73661 18.0178 9.26777C18.4866 8.79893 18.75 8.16304 18.75 7.5V6.25C18.75 6.08424 18.6842 5.92527 18.5669 5.80806C18.4497 5.69085 18.2908 5.625 18.125 5.625H15.625M4.375 3.75H15.625V8.67969C15.625 11.7812 13.1445 14.3516 10.043 14.375C9.30068 14.3807 8.5646 14.2394 7.87718 13.9592C7.18975 13.6791 6.56458 13.2656 6.03769 12.7427C5.5108 12.2198 5.09262 11.5978 4.80725 10.9126C4.52188 10.2273 4.37498 9.49231 4.375 8.75V3.75Z`,fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`})),TU=X(`IconUnpin`,(0,R.jsx)(`path`,{d:`M7.52271 12.4773L3.75006 16.25M3.75006 3.12498L16.2501 16.875M14.4532 11.1828L17.9415 7.68279C18.0586 7.56559 18.1244 7.40668 18.1244 7.24099C18.1244 7.0753 18.0586 6.9164 17.9415 6.7992L13.2032 2.05779C13.086 1.94067 12.9271 1.87488 12.7614 1.87488C12.5957 1.87488 12.4368 1.94067 12.3196 2.05779L9.09615 5.28904M6.58756 6.24998C5.74537 6.18435 4.57271 6.3531 3.35943 7.33201C3.29077 7.38697 3.23447 7.45581 3.19424 7.53402C3.154 7.61224 3.13072 7.69806 3.12593 7.78589C3.12114 7.87371 3.13493 7.96156 3.16642 8.04369C3.19791 8.12581 3.24637 8.20037 3.30865 8.26248L11.7383 16.6914C11.8015 16.7541 11.8773 16.8025 11.9606 16.8336C12.044 16.8646 12.133 16.8775 12.2218 16.8713C12.3105 16.8652 12.3969 16.8402 12.4752 16.798C12.5535 16.7558 12.6219 16.6973 12.6758 16.6265C13.0829 16.0851 13.6344 15.1898 13.779 14.1594`,fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`})),EU=X(`IconVideo`,(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(`g`,{clipPath:`url(#clip0_14111_491476)`,children:(0,R.jsx)(`path`,{d:`M15.625 8.75L19.375 6.25V13.75L15.625 11.25M2.5 5H15C15.3452 5 15.625 5.27982 15.625 5.625V14.375C15.625 14.7202 15.3452 15 15 15H2.5C2.15482 15 1.875 14.7202 1.875 14.375V5.625C1.875 5.27982 2.15482 5 2.5 5Z`,fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`})}),(0,R.jsx)(`defs`,{children:(0,R.jsx)(`clipPath`,{id:`clip0_14111_491476`,children:(0,R.jsx)(`rect`,{fill:`white`,height:`20`,width:`20`})})})]}),{"data-rtl-mirror":``}),DU=X(`IconVideoFill`,(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(`g`,{clipPath:`url(#clip0_14064_467281)`,children:(0,R.jsx)(`path`,{d:`M15 5.625V14.375C15 14.7065 14.8683 15.0245 14.6339 15.2589C14.3995 15.4933 14.0815 15.625 13.75 15.625H2.5C2.16848 15.625 1.850
46654 15.4933 1.61612 15.2589C1.3817 15.0245 1.25 14.7065 1.25 14.375V5.625C1.25 5.29348 1.3817 4.97554 1.61612 4.74112C1.85054 4.5067 2.16848 4.375 2.5 4.375H13.75C14.0815 4.375 14.3995 4.5067 14.6339 4.74112C14.8683 4.97554 15 5.29348 15 5.625ZM19.5312 5.64453C19.4431 5.62295 19.3513 5.62029 19.2621 5.63672C19.1728 5.65315 19.088 5.68829 19.0133 5.73984L16.3891 7.48906C16.3463 7.51762 16.3112 7.55631 16.2869 7.6017C16.2626 7.64708 16.25 7.69776 16.25 7.74922V12.2508C16.25 12.3022 16.2626 12.3529 16.2869 12.3983C16.3112 12.4437 16.3463 12.4824 16.3891 12.5109L19.0281 14.2703C19.1269 14.3362 19.2424 14.3726 19.3611 14.3752C19.4798 14.3779 19.5968 14.3466 19.6984 14.2852C19.7924 14.2254 19.8695 14.1425 19.9223 14.0444C19.9751 13.9464 20.0019 13.8364 20 13.725V6.25C20.0001 6.11139 19.9541 5.97668 19.8692 5.86708C19.7843 5.75747 19.6655 5.67918 19.5312 5.64453Z`})}),(0,R.jsx)(`defs`,{children:(0,R.jsx)(`clipPath`,{id:`clip0_14064_467281`,children:(0,R.jsx)(`rect`,{fill:`white`,height:`20`,width:`20`})})})]}),{"data-rtl-mirror":``}),OU=X(`IconAudio`,(0,R.jsx)(`path`,{d:`M15.625 8.125V11.875M18.125 6.875V13.125M6.875 13.125H3.125C2.95924 13.125 2.80027 13.0592 2.68306 12.9419C2.56585 12.8247 2.5 12.6658 2.5 12.5V7.5C2.5 7.33424 2.56585 7.17527 2.68306 7.05806C2.80027 6.94085 2.95924 6.875 3.125 6.875H6.875L12.5 2.5V17.5L6.875 13.125Z`,fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`}),{"data-rtl-mirror":``}),kU=X(`IconArchive`,(0,R.jsx)(`path`,{d:`M16.875 7.5V15C16.875 15.1658 16.8092 15.3247 16.6919 15.4419C16.5747 15.5592 16.4158 15.625 16.25 15.625H3.75C3.58424 15.625 3.42527 15.5592 3.30806 15.4419C3.19085 15.3247 3.125 15.1658 3.125 15V7.5M8.125 10.625H11.875M2.5 4.375H17.5C17.8452 4.375 18.125 4.65482 18.125 5V6.875C18.125 7.22018 17.8452 7.5 17.5 7.5H2.5C2.15482 7.5 1.875 7.22018 1.875 6.875V5C1.875 4.65482 2.15482 4.375 2.5 4.375Z`,fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`})),AU=X(`IconLoading`,(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(`path`,{d:`M17.5 10C17.5 14.1422 14.1422 17.5 10 17.5C5.85787 17.5 2.5 14.1422 2.5 10C2.5 5.85787 5.85787 2.5 10 2.5C14.1422 2.5 17.5 5.85787 17.5 10Z`,fill:`none`,stroke:`currentColor`,strokeOpacity:`0.3`,strokeWidth:`2`}),(0,R.jsx)(`path`,{d:`M17.4544 10.8334C17.0701 14.3097 14.3098 17.07 10.8335 17.4543`,fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeWidth:`2`})]})),jU=X(`IconGiphy`,(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(`rect`,{fill:`black`,height:`20`,rx:`10`,width:`20`}),(0,R.jsx)(`path`,{clipRule:`evenodd`,d:`M6.5997 5.50024H13.4008V14.4999H6.59912L6.5997 5.50024Z`,fill:`black`,fillRule:`evenodd`}),(0,R.jsx)(`path`,{d:`M5.24023 5.1665H6.59998V14.8335H5.24023V5.1665Z`,fill:`#04FF8E`}),(0,R.jsx)(`path`,{d:`M13.4004 7.8335H14.7601V14.8335H13.4004V7.8335Z`,fill:`#8E2EFF`}),(0,R.jsx)(`path`,{d:`M5.24023 14.4998H14.7602V15.8333H5.24023V14.4998Z`,fill:`#00C5FF`}),(0,R.jsx)(`path`,{d:`M5.24023 4.16675H10.6804V5.50025H5.24023V4.16675Z`,fill:`#FFF152`}),(0,R.jsx)(`path`,{d:`M13.4003 6.83316V5.50025H12.0399V4.16675H10.6802V8.16666H14.76V6.83316`,fill:`#FF5B5B`}),(0,R.jsx)(`path`,{d:`M13.4004 9.5V8.1665H14.7601`,fill:`#551C99`}),(0,R.jsx)(`path`,{clipRule:`evenodd`,d:`M10.6802 4.16675V5.50025H9.31982`,fill:`#999131`,fillRule:`evenodd`})]})),MU=d.useId,NU=e=>e.replace(/[:«»]/g,``),PU=()=>MU?NU(MU()):(0,d.useMemo)(()=>yB(),[]),FU=d.memo(e=>{let{listType:t,messageText:n}=e,{t:r}=Y(`EmptyStateIndicator`);if(t===`thread`)return null;if(t===`channel`){let e=r(`No conversations yet`);return(0,R.jsxs)(`div`,{className:`str-chat__channel-list-empty`,children:[(0,R.jsx)(vH,{}),(0,R.jsx)(`p`,{role:`listitem`,children:e})]})}if(t===`message`){let e=r(n||`Send a message to start the conversation`);return(0,R.jsxs)(`div`,{className:`str-chat__empty-channel`,children:[(0,R.jsx)(yH,{}),(0,R.jsx)(`p`,{className:`str-chat__empty-channel-text`,role:`listitem`,children:e})]})}return(0,R.jsx)(`p`,{children:r(`No items exist`)})}),IU=()=>(e,t)=>{switch(t.type){case`closeThread`:return{...e,thread:null,threadLoadingMore:!1,threadMessages:[]};case`copyMessagesFromChannel`:{let{channel:n,parentId:r}=t;return{...e,messages:[...n.state.messages],pinnedMessages:[...n.state.pinnedMessages],suppressAutoscroll:!1,threadMessages:r?{...n.state.threads}[r]||[]:e.threadMessages}}case`copyStateFromChannelOnEvent`:{let{channel:n}=t;return{...e,members:{...n.state.members},messages:[...n.state.messages],pinnedMessages:[...n.state.pinnedMessages],read:{...n.state.read},watcherCount:n.state.watcher_count,watchers:{...n.state.watchers}}}case`initStateFromChannel`:{let{channel:n,hasMore:r}=t;return{...e,hasMore:r,loading:!1,members:{...n.state.members},messages:[...n.state.messages],pinnedMessages:[...n.state.pinnedMessages],read:{...n.state.read},watcherCount:n.state.watcher_count,watchers:{...n.state.watchers}}}case`jumpToLatestMessageFinished`:{let{hasMore:n,hasMoreNewer:r,messages:i}=t;return{...e,hasMore:n,hasMoreNewer:r,highlightedMessageId:void 0,loading:!1,messages:i,suppressAutoscroll:!1}}case`jumpToMessageFinished`:return{...e,hasMore:t.channel.state.messagePagination.hasPrev,hasMoreNewer:t.channel.state.messagePagination.hasNext,highlightedMessageId:t.highlightedMessageId,loadingMore:!1,loadingMoreForJumpToChannelMessage:!1,messages:t.channel.state.messages,suppressAutoscroll:!1};case`clearHighlightedMessage`:return{...e,highlightedMessageId:void 0};case`loadMoreFinished`:{let{hasMore:n,messages:r}=t;return{...e,hasMore:n,loadingMore:!1,messages:r,suppressAutoscroll:!1}}
466case`loadMoreNewerFinished`:{let{hasMoreNewer:n,messages:r}=t;return{...e,hasMoreNewer:n,loadingMoreNewer:!1,messages:r}}case`loadMoreThreadFinished`:{let{threadHasMore:n,threadMessages:r}=t;return{...e,threadHasMore:n,threadLoadingMore:!1,threadMessages:r}}case`openThread`:{let{channel:n,message:r}=t;return{...e,thread:r,threadHasMore:!0,threadMessages:r.id&&{...n.state.threads}[r.id]||[],threadSuppressAutoscroll:!1}}case`setError`:{let{error:n}=t;return{...e,error:n}}case`setLoadingMore`:{let{loadingMore:n}=t;return{...e,loadingMore:n,suppressAutoscroll:n}}case`setLoadingMoreForJumpToChannelMessage`:{let{loadingMoreForJumpToChannelMessage:n}=t;return{...e,loadingMoreForJumpToChannelMessage:n,suppressAutoscroll:n}}case`setLoadingMoreNewer`:{let{loadingMoreNewer:n}=t;return{...e,loadingMoreNewer:n}}case`setThread`:{let{message:n}=t;return{...e,thread:n}}case`setTyping`:{let{channel:n}=t;return{...e,typing:{...n.state.typing}}}case`startLoadingThread`:return{...e,threadLoadingMore:!0,threadSuppressAutoscroll:!0};case`updateThreadOnEvent`:{let{channel:n,message:r}=t;return e.thread?{...e,thread:r?.id===e.thread.id?n.state.formatMessage(r):e.thread,threadMessages:e.thread?.id&&{...n.state.threads}[e.thread.id]||[]}:e}default:return e}},LU={error:null,hasMore:!0,hasMoreNewer:!1,loading:!0,loadingMore:!1,loadingMoreForJumpToChannelMessage:!1,members:{},messages:[],pinnedMessages:[],read:{},suppressAutoscroll:!1,thread:null,threadHasMore:!0,threadLoadingMore:!1,threadMessages:[],threadSuppressAutoscroll:!1,typing:{},watcherCount:0,watchers:{}},RU=e=>{let{channel:t,channelCapabilitiesArray:n=[],channelConfig:r,channelUnreadUiState:i,error:a,giphyVersion:o,hasMore:s,hasMoreNewer:c,highlightedMessageId:l,imageAttachmentSizeHandler:u,loading:f,loadingMore:p,loadingMoreForJumpToChannelMessage:m,members:h,messages:g=[],mutes:_,notifications:v,pinnedMessages:y,read:b={},shouldGenerateVideoThumbnail:x,skipMessageDataMemoization:S,suppressAutoscroll:C,thread:w,threadHasMore:T,threadLoadingMore:E,threadMessages:D=[],videoAttachmentSizeHandler:O,watcher_count:k,watcherCount:A,watchers:j}=e,M=t.cid,N=t.initialized&&t.lastRead()?.getTime(),P=Object.keys(h||[]).length,ee=v.length,F=Object.values(b),te=F.length,ne=[];for(let{last_read:e}of F)N&&ne.push(e?.toISOString());let re=ne.join(),I=D?.length,ie={};n.forEach(e=>{ie[e]=!0});let ae=S?g:g.map(({deleted_at:e,latest_reactions:t,pinned:n,reply_count:r,status:i,type:a,updated_at:o,user:s})=>`${a}${e}${t?t.map(({type:e})=>e).join():``}${n}${r}${i}${o&&(OV(o)||kV(o))?o.toISOString():o||``}${s?.updated_at}`).join(),oe=D.map(({deleted_at:e,latest_reactions:t,pinned:n,status:r,updated_at:i,user:a})=>`${e}${t?t.map(({type:e})=>e).join():``}${n}${r}${i&&(OV(i)||kV(i))?i.toISOString():i||``}${a?.updated_at}`).join();return(0,d.useMemo)(()=>({channel:t,channelCapabilities:ie,channelConfig:r,channelUnreadUiState:i,error:a,giphyVersion:o,hasMore:s,hasMoreNewer:c,highlightedMessageId:l,imageAttachmentSizeHandler:u,loading:f,loadingMore:p,loadingMoreForJumpToChannelMessage:m,members:h,messages:g,mutes:_,notifications:v,pinnedMessages:y,read:b,shouldGenerateVideoThumbnail:x,suppressAutoscroll:C,thread:w,threadHasMore:T,threadLoadingMore:E,threadMessages:D,videoAttachmentSizeHandler:O,watcher_count:k,watcherCount:A,watchers:j}),[t.data?.name,M,i,a,s,c,l,N,f,p,m,P,ae,oe,ee,te,re,x,S,C,w,T,E,I,A])},zU=e=>{let{typing:t}=e;return(0,d.useMemo)(()=>({typing:t}),[Object.keys(t||{}).join()])},BU=e=>{let{channel:t,client:n}=K(`useEditMessageHandler`);return(r,i)=>e&&t?Promise.resolve(e(t.cid,r,i)):n.updateMessage(r,void 0,i)},VU=()=>{let e=(0,d.useRef)(!1);return(0,d.useEffect)(()=>(e.current=!0,()=>{e.current=!1}),[]),e},HU=(e,t)=>(0,d.useCallback)((n,r)=>{if(!e&&!t||!(n.target instanceof HTMLElement))return;let i=n.target.innerHTML.replace(`*`,``);if(i[0]===`@`){let a=i.replace(`@`,``),o=r?.find(({id:e,name:t})=>t===a||e===a);e&&typeof e==`function`&&n.type===`mouseover`&&e(n,o),t&&n.type===`click`&&typeof t==`function`&&t(n,o)}},[t,e]),UU=({bubbleSize:e,metadataSize:t,outgoing:n=!1})=>(0,R.jsxs)(`div`,{className:`str-chat__loading-channel-message ${n?`str-chat__loading-channel-message--outgoing`:`str-chat__loading-channel-message--incoming`}`,children:[n?null:(0,R.jsx)(`div`,{className:`str-chat__loading-channel-message-avatar`}),(0,R.jsxs)(`div`,{className:`str-chat__loading-channel-message-content`,children:[(0,R.jsx)(`div`,{className:`str-chat__loading-channel-message-bubble str-chat__loading-channel-message-bubble--${e}`}),(0,R.jsx)(`div`,{className:`str-chat__loading-channel-message-metadata str-chat__loading-channel-message-metadata--${t}`})]})]}),WU=()=>(0,R.jsx)(`div`,{className:`str-chat__message-composer-container str-chat__message-composer-container--loading`,children:(0,R.jsxs)(`div`,{className:`str-chat__message-composer`,children:[(0,R.jsx)(`div`,{className:`str-chat__loading-channel-message-input-button`}),(0,R.jsx)(`div`,{className:`str-chat__loading-channel-message-input-pill`})]})}),GU=()=>(0,R.jsxs)(`div`,{className:`str-chat__channel-header str-chat__channel-header--loading`,children:[(0,R.jsx)(`div`,{className:`str-chat__channel-header__data str-chat__channel-header__data--loading`,children:(0,R.jsx)(`div`,{className:`str-chat__loading-channel-header-name`})}),(0,R.jsx)(`div`,{className:`str-chat__loading-channel-header-avatar`})]}),KU=()=>(0,R.jsxs)(`div`,{className:`str-chat__loading-channel`,children:[(0,R.jsx)(GU,{}),(0,R.jsx)(`div`,{className:`str-chat__message-list str-chat__message-list--loading`,children:(0,R.jsx)(`div`,{className:`str-chat__message-list-scroll`,children:(0,R.jsxs)(`div`,{className:`str-chat__loading-channel-message-list`,children:[(0,R.jsx)(UU,{bubbleSize:`lg`,metadataSize:`md`}),(0,R.jsx)(UU,{bubbleSize:`md`,metadataSize:`sm`,outgoing:!0}),(0,R.jsx)(UU,{bubbleSize:`lg`,metadataSize:`md`})]})})}),(0,R.jsx)(WU,{})]}),qU=d.memo(({error:e})=>{let{t}=Y(`LoadingErrorIndicator`);return e?(0,R.jsx)(`div`,{children:t(`Error: {{ errorMessage }}`,{errorMessage:e.message})}):null},(e,t)=>e.error?.message===t.error?.message),JU=`str-chat__channel`,YU=(0,IB.default)(),XU=(e,t)=>!t||!e?!1:!!t.filter(t=>t.target.id===e.user?.id).length,ZU={deleteForMe:`deleteForMe`},QU={delete:`delete`,download:`download`,edit:`edit`,flag:`flag`,markUnread:`markUnread`,mute:`mute`,pin:`pin`,quote:`quote`,react:`react`,remindMe:`remindMe`,reply:`reply`,saveForLater:`saveForLater`}
466,$U=(e,{canDelete:t,canEdit:n,canFlag:r,canMarkUnread:i,canMute:a,canPin:o,canQuote:s,canReact:c,canReply:l},u)=>{let d=[],f=[];if(e&&typeof e==`boolean`)f=Object.keys(QU);else if(e&&Array.isArray(e)&&e.length>0)f=[...e];else return[];return t&&f.indexOf(QU.delete)>-1&&d.push(QU.delete),f.indexOf(QU.download)>-1&&d.push(QU.download),t&&f.indexOf(ZU.deleteForMe)>-1&&d.push(ZU.deleteForMe),n&&f.indexOf(QU.edit)>-1&&d.push(QU.edit),r&&f.indexOf(QU.flag)>-1&&d.push(QU.flag),i&&f.indexOf(QU.markUnread)>-1&&d.push(QU.markUnread),a&&f.indexOf(QU.mute)>-1&&d.push(QU.mute),o&&f.indexOf(QU.pin)>-1&&d.push(QU.pin),s&&f.indexOf(QU.quote)>-1&&d.push(QU.quote),c&&f.indexOf(QU.react)>-1&&d.push(QU.react),u?.user_message_reminders&&f.indexOf(QU.remindMe)>-1&&d.push(QU.remindMe),l&&f.indexOf(QU.reply)>-1&&d.push(QU.reply),u?.user_message_reminders&&f.indexOf(QU.saveForLater)>-1&&d.push(QU.saveForLater),d},eW=[QU.pin,QU.reply,QU.markUnread];function tW(e,t){let n=(e,t)=>e.deleted_at===t.deleted_at&&e.latest_reactions?.length===t.latest_reactions?.length&&e.own_reactions?.length===t.own_reactions?.length&&e.pinned===t.pinned&&e.reply_count===t.reply_count&&e.show_in_channel===t.show_in_channel&&e.status===t.status&&e.text===t.text&&e.type===t.type&&e.updated_at===t.updated_at&&e.user?.updated_at===t.user?.updated_at;return n(e,t)&&!!e.quoted_message==!!t.quoted_message&&(!e.quoted_message&&!t.quoted_message||n(e.quoted_message,t.quoted_message))}var nW=(e,t)=>{let{message:n,Message:r}=e,{message:i,Message:a}=t;return r!==a||t.showDetailedReactions!==e.showDetailedReactions||t.closeReactionSelectorOnClick!==e.closeReactionSelectorOnClick||!tW(n,i)||!((0,FB.default)(t.messageActions,e.messageActions)&&(0,FB.default)(t.readBy,e.readBy)&&(0,FB.default)(t.deliveredTo,e.deliveredTo)&&(0,FB.default)(t.highlighted,e.highlighted)&&(0,FB.default)(t.groupStyles,e.groupStyles)&&(0,FB.default)(t.mutes,e.mutes)&&(0,FB.default)(t.lastReceivedId,e.lastReceivedId))?!1:e.messageListRect===t.messageListRect},rW=(e,t)=>{let{lastReceivedId:n,message:r}=e,{lastReceivedId:i,message:a}=t;return e.highlighted!==t.highlighted||e.threadList!==t.threadList||e.endOfGroup!==t.endOfGroup||e.mutes?.length!==t.mutes?.length||e.readBy?.length!==t.readBy?.length||e.deliveredTo?.length!==t.deliveredTo?.length||e.groupStyles!==t.groupStyles||e.showDetailedReactions!==t.showDetailedReactions||(r.id===n||r.id===i)&&n!==i?!1:tW(r,a)},iW=e=>Object.values(e?.reaction_groups??{}).some(({count:e})=>e>0),aW=e=>!!e?.quoted_message,oW=e=>!!e?.attachments&&!!e.attachments.length,sW=e=>e?.attachments?.length===1,cW=e=>!!e?.attachments?.some(e=>e.type===`giphy`),lW=e=>
466e.name||e.id,uW=(e,t,n,r)=>{let i=``;if(!t)throw Error(`getReadByTooltipText was called, but translation function is not available`);if(!r)throw Error(`getReadByTooltipText was called, but tooltipUserNameMapper function is not available`);let a=e.filter(e=>e&&n?.user&&e.id!==n.user.id).map(r),o=a.slice(0,5),s=a.length-o.length;if(o.length===1)i=`${o[0]} `;else if(o.length===2)i=t(`{{ firstUser }} and {{ secondUser }}`,{firstUser:o[0],secondUser:o[1]});else if(o.length>2)if(s===0){let e=o.splice(o.length-1,1);i=t(`{{ commaSeparatedUsers }}, and {{ lastUser }}`,{commaSeparatedUsers:o.join(`, `),lastUser:e})}else i=t(`{{ commaSeparatedUsers }} and {{ moreCount }} more`,{commaSeparatedUsers:o.join(`, `),moreCount:s});return i},dW=e=>{let t=e?.match(YU);return t?t.length:0},fW=e=>e.text?!e.text.replace(YU,``).replace(/[\s\n]/gm,``):!1,pW=e=>e.status===`failed`&&e.error?.status!==403,mW=e=>e.status===`failed`&&e.error?.status===0,hW=e=>e.type===`error`&&(e.moderation_details?.action===`MESSAGE_RESPONSE_ACTION_BOUNCE`||e.moderation?.action===`bounce`),gW=e=>e.shadowed||e.type===`error`&&(e.moderation_details?.action===`MESSAGE_RESPONSE_ACTION_REMOVE`||e.moderation?.action===`remove`),_W=e=>!!(e.deleted_at||e.type===`deleted`||e.deleted_for_me),vW=e=>!!e.message_text_updated_at,yW=d.createContext({legacyThread:void 0}),bW=()=>(0,d.useContext)(yW),xW=[1,1.5,2],SW=e=>!(e.duration===1/0||isNaN(e.duration)),CW=({error:e}={})=>{e&&console.error(`[AUDIO PLAYER]`,e)},wW=e=>e&&!(e.paused||e.ended),TW=class{constructor({durationSeconds:e,fileSize:t,id:n,mimeType:r,playbackRates:i,plugins:a,pool:o,src:s,title:c,waveformData:l}){this._plugins=new Map,this.playTimeout=void 0,this.unsubscribeEventListeners=null,this._disposed=!1,this._metadataProbe=null,this._restoringPosition=!1,this._removalTimeout=void 0,this.setDurationSeconds=e=>{this._data.durationSeconds=e,this.state.partialNext({durationSeconds:e})},this.setPlaybackStartSafetyTimeout=()=>{clearTimeout(this.playTimeout),this.playTimeout=setTimeout(()=>{if(this.elementRef)try{this.elementRef.pause(),this.state.partialNext({isPlaying:!1})}catch{this.registerError({errCode:`failed-to-start`})}},2e3)},this.updateDurationFromElement=e=>{let t=e.duration;typeof t!=`number`||isNaN(t)||!isFinite(t)||t<=0||this.setDurationSeconds(t)},this.clearMetadataProbe=()=>{let e=this._metadataProbe;if(this._metadataProbe=null,this._metadataProbePromise=void 0,e){try{e.pause()}catch{}e.removeAttribute(`src`);try{e.load()}catch{}}},this.preloadMetadata=()=>{if(this._disposed||this.durationSeconds!=null||!this.src||this._metadataProbePromise||typeof document>`u`)return;let e=document.createElement(`audio`);e.preload=`metadata`,this._metadataProbe=e,this._metadataProbePromise=new Promise(t=>{let n=()=>{e.removeEventListener(`loadedmetadata`,r),e.removeEventListener(`error`,i),this._metadataProbe===e?this.clearMetadataProbe():this._metadataProbePromise=void 0,t()},r=()=>{this.updateDurationFromElement(e),n()},i=()=>{n()};e.addEventListener(`loadedmetadata`,r,{once:!0}),e.addEventListener(`error`,i,{once:!0}),e.src=this.src;try{e.load()}catch{n()}})},this.clearPlaybackStartSafetyTimeout=()=>{this.elementRef&&(clearTimeout(this.playTimeout),this.playTimeout=void 0)},this.clearPendingLoadedMeta=()=>{let e=this._pendingLoadedMeta;e?.element&&e.onLoaded&&e.element.removeEventListener(`loadedmetadata`,e.onLoaded),this._pendingLoadedMeta=void 0},this.restoreSavedPosition=e=>{let t=this.secondsElapsed;if(!t||t<=0)return;let n=()=>{let n=e.duration,r=typeof n==`number`&&!isNaN(n)&&isFinite(n)?Math.min(t,n):t;try{if(e.currentTime===r)return;e.currentTime=r,this.setSecondsElapsed(r)}catch{}};if(e.readyState<1){this.clearPendingLoadedMeta(),this._restoringPosition=!0;let t=()=>{if(this._pendingLoadedMeta?.onLoaded===t){if(this._pendingLoadedMeta=void 0,this.elementRef!==e){this._restoringPosition=!1;return}n(),this._restoringPosition=!1}};e.addEventListener(`loadedmetadata`,t,{once:!0}),this._pendingLoadedMeta={element:e,onLoaded:t}}else this._restoringPosition=!0,n(),this._restoringPosition=!1},this.elementIsReady=()=>(this._elementIsReadyPromise||=new Promise(e=>{if(!this.elementRef)return e(!1);let t=this.elementRef,n=()=>{t.removeEventListener(`loadedmetadata`,n),e(t.readyState>0)};t.addEventListener(`loadedmetadata`,n)}),this._elementIsReadyPromise),this.setRef=e=>{wW(this.elementRef)&&this.releaseElement({resetState:!1}),this.clearPendingLoadedMeta(),this.clearMetadataProbe(),this._restoringPosition=!1,this._elementIsReadyPromise=void 0,this.state.partialNext({elementRef:e}),e&&this.registerSubscriptions()},this.setSecondsElapsed=e=>{let t=this.elementRef?.duration??this.durationSeconds;this.state.partialNext({progressPercent:t&&e?e/t*100:0,secondsElapsed:e})},this.canPlayMimeType=e=>e?this.elementRef?!!this.elementRef.canPlayType(e):!!new Audio().canPlayType(e):!1,this.play=async e=>{if(this._disposed)return;let t=this.ensureElementRef();if(wW(this.elementRef)){if(this.isPlaying)return;this.state.partialNext({isPlaying:!0});return}let{currentPlaybackRate:n,playbackRates:r}={currentPlaybackRate:this.currentPlaybackRate,playbackRates:this.playbackRates,...e};if(!this.canPlayRecord){this.registerError({errCode:`not-playable`});return}this.restoreSavedPosition(t),t.playbackRate=n??this.currentPlaybackRate,this.setPlaybackStartSafetyTimeout();try{await t.play(),this.state.partialNext({currentPlaybackRate:n,isPlaying:!0,playbackRates:r}),this._pool.setActiveAudioPlayer(this)}catch(e){this.registerError({error:e}),this.state.partialNext({isPlaying:!1})}finally{this.clearPlaybackStartSafetyTimeout()}},this.pause=()=>{wW(this.elementRef)&&(this.clearPlaybackStartSafetyTimeout(),this.elementRef.pause(),this.state.partialNext({isPlaying:!1}))},this.stop=()=>{this.pause(),this.state.partialNext({isPlaying:!1}),this.setSecondsElapsed(0),this.elementRef&&(this.elementRef.currentTime=0)},this.togglePlay=async()=>this.isPlaying?this.pause():await this.play(),this.increasePlaybackRate=()=>{let e=this.state.getLatestValue().playbackRates.findIndex(e=>e===this.currentPlaybackRate);e===-1&&(e=0);let t=e===this.playbackRates.length-1?0:e+1,n=this.playbackRates[t];this.state.partialNext({currentPlaybackRate:n}),this.elementRef&&(this.elementRef.playbackRate=n)},this.seek=(0,PB.default)(async({clientX:e,currentTarget:t})=>{let n=this.elementRef;if(!this.elementRef&&(n=this.ensureElementRef(),!await this.elementIsReady())||!t||!n)return;if(!SW(n)){this.registerError({errCode:`seek-not-supported`});return}let{width:r,x:i}=t.getBoundingClientRect(),a=(e-i)/r;if(a>1||a<0)return;let o=a*n.duration;this.setSecondsElapsed(o),n.currentTime=o},16),this.registerError=e=>{CW(e),this.plugins.forEach(({onError:t})=>t?.({player:this,...e}))},this.requestRemoval=()=>{this._disposed=!0,this.cancelScheduledRemoval(),this.clearPendingLoadedMeta(),this.clearMetadataProbe(),this._restoringPosition=!1,this.releaseElement({resetState:!0}),this.unsubscribeEventListeners?.(),this.unsubscribeEventListeners=null,this.plugins.forEach(({onRemove:e})=>e?.({player:this}
466)),this._pool.deregister(this.id)},this.cancelScheduledRemoval=()=>{clearTimeout(this._removalTimeout),this._removalTimeout=void 0},this.scheduleRemoval=(e=0)=>{this.cancelScheduledRemoval(),this._removalTimeout=setTimeout(()=>{this.disposed||this.requestRemoval()},e)},this.releaseElementForHandoff=()=>{this.elementRef&&(this.releaseElement({resetState:!1}),this.unsubscribeEventListeners?.(),this.unsubscribeEventListeners=null)},this.registerSubscriptions=()=>{this.unsubscribeEventListeners?.();let e=this.elementRef;if(!e)return;let t=()=>{e&&this.updateDurationFromElement(e),this.stop()},n=e=>{let t=e.currentTarget,n={isPlaying:!1};if(!t?.error?.code){this.state.partialNext(n);return}t.error.code===4&&(n.canPlayRecord=!1,this.state.partialNext(n));let r=[void 0,`MEDIA_ERR_ABORTED: fetch aborted by user`,`MEDIA_ERR_NETWORK: network failed while fetching`,`MEDIA_ERR_DECODE: audio fetched but couldn’t decode`,`MEDIA_ERR_SRC_NOT_SUPPORTED: source not supported`][t?.error?.code];r&&CW({error:Error(r+` (${t.src})`)})},r=()=>{let t=e?.currentTime??0;this._restoringPosition&&t===0||!this.isPlaying&&t===0&&this.secondsElapsed>0||this.setSecondsElapsed(t)},i=()=>{e&&this.updateDurationFromElement(e)};e.addEventListener(`ended`,t),e.addEventListener(`error`,n),e.addEventListener(`loadedmetadata`,i),e.addEventListener(`timeupdate`,r),this.unsubscribeEventListeners=()=>{e.pause(),e.removeEventListener(`ended`,t),e.removeEventListener(`error`,n),e.removeEventListener(`loadedmetadata`,i),e.removeEventListener(`timeupdate`,r)}},this._data={durationSeconds:e,fileSize:t,id:n,mimeType:r,src:s,title:c,waveformData:l},this._pool=o,this.setPlugins(()=>a??[]);let u=i?.length?i:xW,d=r?!!new Audio().canPlayType(r):!0;this.state=new sb({canPlayRecord:d,currentPlaybackRate:u[0],durationSeconds:e,elementRef:null,isPlaying:!1,playbackError:null,playbackRates:u,progressPercent:0,secondsElapsed:0}),this.plugins.forEach(e=>e.onInit?.({player:this})),this.preloadMetadata()}get plugins(){return Array.from(this._plugins.values())}get canPlayRecord(){return this.state.getLatestValue().canPlayRecord}get elementRef(){return this.state.getLatestValue().elementRef}get isPlaying(){return this.state.getLatestValue().isPlaying}get currentPlaybackRate(){return this.state.getLatestValue().currentPlaybackRate}get playbackRates(){return this.state.getLatestValue().playbackRates}get durationSeconds(){return this.state.getLatestValue().durationSeconds}get fileSize(){return this._data.fileSize}get id(){return this._data.id}get src(){return this._data.src}get mimeType(){return this._data.mimeType}get title(){return this._data.title}get waveformData(){return this._data.waveformData}get secondsElapsed(){return this.state.getLatestValue().secondsElapsed}get progressPercent(){return this.state.getLatestValue().progressPercent}get disposed(){return this._disposed}ensureElementRef(){if(this._disposed)throw Error(`AudioPlayer is disposed`);if(!this.elementRef){let e=this._pool.acquireElement({ownerId:this.id,src:this.src});this.setRef(e)}return this.elementRef}setDescriptor(e){let t=this.src;if(this._data={...this._data,...e},e.src!==t&&this.elementRef&&(this.elementRef.src=e.src),e.src&&e.src!==t){this.clearMetadataProbe(),e.durationSeconds==null?(this.setDurationSeconds(void 0),this.preloadMetadata()):this.setDurationSeconds(e.durationSeconds);return}e.durationSeconds!=null&&this.setDurationSeconds(e.durationSeconds)}releaseElement({resetState:e}){if(this.clearPendingLoadedMeta(),this.clearMetadataProbe(),this._restoringPosition=!1,e)this.stop();else if(this.state.partialNext({isPlaying:!1}),this.elementRef)try{this.elementRef.pause()}catch{}this.elementRef&&(this._pool.releaseElement(this.id),this.setRef(null))}setPlugins(e){this._plugins=e(this.plugins).reduce((e,t)=>(t.id&&e.set(t.id,t),e),new Map)}},EW=class{constructor(e){this.state=new sb({activeAudioPlayer:null}),this.pool=new Map,this.audios=new Map,this.sharedAudio=null,this.sharedOwnerId=null,this.getOrAdd=e=>{let{playbackRates:t,plugins:n,...r}=e,i=this.pool.get(e.id);if(i){if(!i.disposed)return i.setDescriptor(r),i;this.deregister(e.id)}return i=new TW({playbackRates:t,plugins:n,...r,pool:this}),this.pool.set(e.id,i),i},this.acquireElement=({ownerId:e,src:t})=>{if(!this.allowConcurrentPlayback){if(this.sharedAudio||=new Audio,this.sharedOwnerId&&this.sharedOwnerId!==e){let e=this.pool.get(this.sharedOwnerId);e?.pause(),e?.releaseElementForHandoff()}return this.sharedOwnerId=e,this.sharedAudio.src!==t&&(this.sharedAudio.src=t),this.sharedAudio}let n=this.audios.get(e);return n||(n=new Audio,this.audios.set(e,n)),n.src!==t&&(n.src=t),n},this.releaseElement=e=>{if(!this.allowConcurrentPlayback){if(this.sharedOwnerId!==e)return;let t=this.sharedAudio;if(t){try{t.pause()}catch{}t.removeAttribute(`src`),t.load()}this.sharedOwnerId=null;return}let t=this.audios.get(e);if(t){try{t.pause()}catch{}t.removeAttribute(`src`),t.load(),this.audios.delete(e)}},this.setActiveAudioPlayer=e=>{this.allowConcurrentPlayback||this.state.partialNext({activeAudioPlayer:e})},this.remove=e=>{let t=this.pool.get(e);t&&t.requestRemoval()},this.clear=()=>
466{this.players.forEach(e=>{this.remove(e.id)})},this.registerSubscriptions=()=>{this.players.forEach(e=>{e.elementRef&&e.registerSubscriptions()})},this.allowConcurrentPlayback=!!e?.allowConcurrentPlayback}get players(){return Array.from(this.pool.values())}get activeAudioPlayer(){return this.state.getLatestValue().activeAudioPlayer}deregister(e){this.pool.has(e)&&this.pool.delete(e),this.activeAudioPlayer?.id===e&&this.setActiveAudioPlayer(null)}},DW=1e3,OW=({addNotification:e,panel:t=`channel`,t:n})=>{let r={"failed-to-start":Error(n(`Failed to play the recording`)),"not-playable":Error(n(`Recording format is not supported and cannot be reproduced`)),"seek-not-supported":Error(n(`Cannot seek in the recording`))},i;return{id:`AudioPlayerNotificationsPlugin`,onError:({errCode:a,error:o})=>{if(a===`seek-not-supported`){let e=Date.now();if(typeof i==`number`&&e-i<DW)return;i=e}let s=(a&&r[a])??o??Error(n(`Error reproducing the recording`));e({emitter:`AudioPlayer`,error:s,message:s.message,severity:`error`,targetPanels:[t],type:`browser:audio:playback:error`})}}},kW=d.createContext({audioPlayers:null}),AW=({allowConcurrentPlayback:e,children:t})=>{let[n]=(0,d.useState)(()=>new EW({allowConcurrentPlayback:e}));return(0,d.useEffect)(()=>()=>{n.clear()},[n]),(0,R.jsx)(kW.Provider,{value:{audioPlayers:n},children:t})},jW=({requester:e,src:t})=>`${e??`requester-unknown`}:${t}`,MW=({durationSeconds:e,fileSize:t,mimeType:n,playbackRates:r,plugins:i,requester:a=``,src:o,title:s,waveformData:c})=>{let{addNotification:l}=GG(),u=zG(),{t:f}=Y(),{audioPlayers:p}=(0,d.useContext)(kW),m=o&&p?p.getOrAdd({durationSeconds:e,fileSize:t,id:jW({requester:a,src:o}),mimeType:n,playbackRates:r,plugins:i,src:o,title:s,waveformData:c}):void 0;return(0,d.useEffect)(()=>{if(!m)return;let e=OW({addNotification:l,panel:u,t:f});m.setPlugins(t=>[...t.filter(t=>t.id!==e.id),e])},[l,m,u,f]),m},NW=e=>({isCooldownActive:!!e.cooldownRemaining}),PW=()=>{let{channel:e}=KB();return J(e.cooldownTimer.state,NW).isCooldownActive},FW=new ww(64),IW=()=>{let{client:e}=K(),{channel:t}=KB(),{legacyThread:n}=bW(),r=yG(),i=(0,d.useMemo)(()=>{if(n)return n},[n?.id]),a=(0,d.useMemo)(()=>{if(r)return r.messageComposer;if(i){let t={...i,legacyThreadId:i.id},n=jS.constructTag(t);return FW.get(n)||new jS({client:e,compositionContext:t})}else return t.messageComposer},[i,t,e,r]);return[`legacy_thread`,`message`].includes(a.contextType)&&!FW.peek(a.tag)&&FW.add(a.tag,a),(0,d.useEffect)(()=>{let e=a.registerSubscriptions();return()=>{e()}},[a]),a},LW={date:`message.date`,intro:`channel.intro`},RW=e=>{let{messages:t,reviewProcessedMessage:n,setGiphyPreviewMessage:r,...i}=e,{enableDateSeparator:a,hideDeletedMessages:o,hideNewMessageSeparator:s,lastRead:c,userId:l}=i,u=!1,d=!1,f,p=[];for(let e=0;e<t.length;e+=1){let m=t[e];if(o&&m.type===`deleted`)continue;if(r&&m.type===`ephemeral`&&m.command===`giphy`){d=!0,r(m);continue}let h=[],g=m.created_at&&kV(m.created_at)&&m.created_at.toDateString()||``,_=t[e-1],v=g;a&&_?.created_at&&kV(_.created_at)&&(v=_.created_at.toDateString()),!u&&!s&&(u=c&&m.created_at&&new Date(c)<m.created_at||!1,a&&u&&m.user?.id!==l&&h.push({customType:LW.date,date:m.created_at,id:BW(m.created_at),unread:u})),a&&(e===0||g!==v||o&&_?.type===`deleted`&&f!==g)&&!qW(h[h.length-1])?(f=g,h.push({customType:LW.date,date:m.created_at,id:BW(m.created_at)},m)):h.push(m),p.push(...n?.({changes:h,context:i,index:e,messages:t,processedMessages:p})||h)}return r&&!d&&r(void 0),p},zW=()=>({customType:LW.intro,id:yB()}),BW=e=>{let t;try{t=e?e instanceof Date?e.toISOString():e:yB()}catch{t=yB()}return`${LW.date}-${t}`},VW=e=>{for(let t=e.length-1;t>0;--t)if(e[t].status===`received`)return e[t].id;return null},HW=(e,t)=>
466{let n=e,r=zW();if(!t||!n.length)return n.unshift(r),n;for(let i=0;i<e.length;i+=1){let a=kV(e[i].created_at)?e[i].created_at.getTime():null,o=kV(e[i+1].created_at)?e[i+1].created_at.getTime():null;if(a&&a<t)if(o&&o<t){if(e[i+1]&&qW(e[i+1]))continue;if(!o)return n.push(r),n}else return n.splice(i+1,0,r),n}return n},UW=e=>{for(let t in e)if(Object.prototype.hasOwnProperty.call(e,t))return!0;return!1},WW=(e,t,n,r,i)=>{if(qW(e)||KW(e))return``;if(r||e.attachments?.length!==0)return`single`;let a=!t||KW(t)||qW(t)||t.type===`system`||t.type===`error`||t.attachments?.length!==0||e.user?.id!==t.user?.id||e.reaction_groups&&UW(e.reaction_groups)||vW(t)||i!==void 0&&t.created_at&&e.created_at&&new Date(e.created_at).getTime()-new Date(t.created_at).getTime()>i,o=!n||KW(n)||qW(n)||n.type===`system`||n.type===`error`||n.attachments?.length!==0||e.user?.id!==n.user?.id||n.reaction_groups&&UW(n.reaction_groups)||vW(e)||i!==void 0&&n.created_at&&e.created_at&&new Date(n.created_at).getTime()-new Date(e.created_at).getTime()>i;return!a&&!o?e.type===`error`?`single`:`middle`:o?a||e.type===`error`?`single`:`bottom`:a?`top`:``},GW=(e,t)=>e>=t;function KW(e){return e.customType===LW.intro}function qW(e){return typeof e==`object`&&!!e&&e.customType===LW.date&&kV(e.date)}function JW(e){return!qW(e)&&!KW(e)}var YW=({firstUnreadMessageId:e,isFirstMessage:t,lastReadDate:n,lastReadMessageId:r,message:i,previousMessage:a,unreadMessageCount:o=0})=>{if(i.parent_id)return!1;let s=i.created_at&&new Date(i.created_at).getTime(),c=n?.getTime(),l=!!s&&!!c&&s>c,u=!!r&&r===a?.id;return e===i.id||!!o&&l&&(t||u)},XW=()=>{let{useImageFlagEmojisOnWindows:e}=K(`Channel`);return e&&navigator.userAgent.match(/Win/)?`str-chat--windows-flags`:``},ZW=e=>e??`str-chat__container`,QW=({customClasses:e})=>{let t=XW();return{channelClass:e?.channel??`str-chat__channel`,chatClass:e?.chat??`str-chat`,chatContainerClass:ZW(e?.chatContainer),windowsEmojiClass:t}},$W=(e,t)=>{for(let n=t.length-1;n>=0;n--){let r=t[n];if(r.id===e)return{index:n,target:r}}return{index:-1}},eG=(e,t,n=!1)=>{let r=e.getTime(),i=0,a=0,o=t.length-1;for(;i<=o;){a=Math.floor((o+i)/2);let e=new Date(t[a].created_at).getTime(),n=t[a-1]?.created_at&&new Date(t[a-1].created_at).getTime(),s=t[a+1]?.created_at&&new Date(t[a+1].created_at).getTime();if(e===r||n&&s&&n<r&&r<s)return{index:a,target:t[a]};e<r?i=a+1:o=a-1}return!n||new Date(t[i].created_at).getTime()===r?{index:i,target:t[i]}:{index:-1}},tG=e=>{if(e instanceof hS)return e;
466let t=e instanceof Error?e.message:`Message send failed`,n=0,r=null;if(typeof e==`object`&&e){let i=e;if(i.name===`AxiosError`&&i.code===`ERR_NETWORK`)return t=typeof i.message==`string`?i.message:`Network Error`,n=i.response?.status??0,new hS(t,{code:null,response:i.response??{data:{duration:``,message:t,more_info:``,StatusCode:n},status:n},status:n});try{let i=JSON.stringify(e),a=i?JSON.parse(i):{};typeof a.message==`string`&&(t=a.message),typeof a.status==`number`&&(n=a.status),typeof a.code==`number`&&(r=a.code)}catch{}}return new hS(t,{code:r,response:{data:{duration:``,message:t,more_info:``,StatusCode:n},status:n},status:n})},nG={},rG=async({channel:e,client:t,id:n,members:r,options:i,type:a})=>{if(!e&&!a)throw Error(`Channel or channel type have to be provided to query a channel.`);let o=e||t.channel(a,n,{members:r}),s=o?.id?o.cid:r&&r.length?iG(o.type,r):void 0;if(!s)throw Error(`Channel ID or channel members array have to be provided to query a channel.`);let c=nG[s];if(c)await c;else try{nG[s]=o.watch(i),await nG[s]}finally{delete nG[s]}return o},iG=(e,t)=>{if(t)return`${e}:!members-${[...t].sort().join(`,`)}`},aG=(e,t)=>
466{let n,r=e.image_url||e.thumb_url||``;if(qv(r,`url`)){let e=new URL(r),i=sG(e,t);i&&(i.height*=2,i.width*=2,dG(i,e)),n=e.href}return{url:n||``}},oG=(e,t,n)=>{let r;if(e.thumb_url&&n&&qv(e.thumb_url,`url`)){let n=new URL(e.thumb_url),i=sG(n,t);i&&(i.height*=2,i.width*=2,dG(i,n)),r=n.href}return{thumbUrl:r,url:e.asset_url||``}},sG=(e,t)=>{let n=e.searchParams,r=Number(n.get(`oh`))||1,i=Number(n.get(`ow`))||1,a=lG(t),o;return o=(a.maxHeight||a.height)&&a.maxWidth?cG(r,i,a.maxHeight||a.height,a.maxWidth):void 0,o},cG=(e,t,n,r)=>({height:Math.round(Math.max(n,r/t*e)),width:Math.round(Math.max(n,r/e*t))}),lG=e=>{let t=getComputedStyle(e),n=uG(t.getPropertyValue(`height`)),r=uG(t.getPropertyValue(`max-height`)),i=uG(t.getPropertyValue(`max-width`));return(n||r)&&i||console.warn(`Invalid value set for height/max-height and/or max-width for HTML element, this can cause scrolling issues inside the message list, more info https://getstream.io/chat/docs/sdk/react/message-components/attachment/#image-and-video-sizing`),{height:n,maxHeight:r,maxWidth:i}},uG=e=>{if(!e.endsWith(`px`))return;let t=parseFloat(e);return isNaN(t)?void 0:t},dG=(e,t)=>
466{t.searchParams.set(`h`,e.height.toString()),t.searchParams.set(`w`,e.width.toString())},fG=e=>({focusedMessage:e.focusedMessage}),pG=()=>{let{searchController:e}=K(`Channel`),{focusedMessage:t}=J(e._internalState,fG);return t},mG=({children:e,className:t,...n})=>{let{customClasses:r,theme:i}=K(`Channel`),{channelClass:a,chatClass:o}=QW({customClasses:r}),s=G(o,i,a,t);return(0,R.jsx)(`div`,{id:JU,...n,className:s,children:e})},hG=e=>{let{channel:t,EmptyPlaceholder:n}=e,{EmptyStateIndicator:r=FU,LoadingErrorIndicator:i,LoadingIndicator:a=KU}=q(`Channel`),{channel:o,channelsQueryState:s}=K(`Channel`),c=t||o,l=`EmptyPlaceholder`in e?n:r&&(0,R.jsx)(r,{listType:`message`});return s.queryInProgress===`reload`&&a?(0,R.jsx)(mG,{children:(0,R.jsx)(a,{})}):s.error&&!c&&i?(0,R.jsx)(mG,{children:(0,R.jsx)(i,{error:s.error})}):s.error&&!c?(0,R.jsx)(mG,{}):c?.cid?(0,d.createElement)(gG,{...e,channel:c,key:c.cid}):(0,R.jsx)(mG,{children:l})},gG=e=>{let{activeUnreadHandler:t,allowConcurrentAudioPlayback:n,channel:r,channelQueryOptions:i,children:a,doDeleteMessageRequest:o,doMarkReadRequest:s,doSendMessageRequest:c,doUpdateMessageRequest:l,initializeOnMount:u=!0,markReadOnMount:f=!0,onMentionsClick:p,onMentionsHover:m,skipMessageDataMemoization:h}=e,{LoadingErrorIndicator:g=qU,LoadingIndicator:_=KU}=q(),{client:v,customClasses:y,latestMessageDatesByChannels:b,mutes:x,searchController:S}=K(`Channel`),{addNotification:C}=GG(),{t:w}=Y(`Channel`),T=ZW(y?.chatContainer),E=XW(),D=yG(),[O,k]=(0,d.useState)(r.getConfig()),[A,j]=(0,d.useState)(),[M,N]=(0,d.useReducer)((0,d.useMemo)(()=>IU(),[]),{...LU,hasMore:r.state.messagePagination.hasPrev,loading:!r.initialized,messages:r.state.messages}),P=pG(),ee=VU(),F=(0,d.useRef)(``),te=(0,d.useRef)(void 0),ne=(0,d.useRef)(!0),re=(0,d.useRef)(null),I=r.data?.own_capabilities,ie=(0,d.useMemo)(()=>(0,PB.default)(()=>N({channel:r,type:`copyStateFromChannelOnEvent`}),500,{leading:!0,trailing:!0}),[r]),ae=(0,d.useMemo)(()=>(0,PB.default)(j,200,{leading:!0,trailing:!1}),[]),oe=(0,d.useMemo)(()=>(0,PB.default)(async e=>{let{updateChannelUiUnreadState:n=!0}=e??{};if(!(r.disconnected||!O?.read_events)){te.current=new Date;try{if(s)s(r,n?ae:void 0);else{let e=await r.markRead();n&&e?.event&&j({last_read:te.current,last_read_message_id:e.event.last_read_message_id,unread_messages:0})}t?t(0,F.current):F.current&&(document.title=F.current)}catch{console.error(w(`Failed to mark channel as read`))}}},500,{leading:!0,trailing:!1}),[t,r,O,s,ae,w]),L=async e=>{if(e.message&&N({channel:r,message:e.message,type:`updateThreadOnEvent`}),!(e.type===`user.messages.deleted`&&e.cid&&e.cid!==r.cid)&&!(e.type===`user.watching.start`||e.type===`user.watching.stop`)){if(e.type===`typing.start`||e.type===`typing.stop`)return N({channel:r,type:`setTyping`});if(e.type===`connection.changed`&&typeof e.online==`boolean`&&(ne.current=e.online),e.type===`message.new`){if((!e.message?.parent_id||e.message?.show_in_channel)&&document.hidden&&O?.read_events&&!r.muteStatus().muted){let e=r.countUnread(te.current);t?t(e,F.current):document.title=`(${e}) ${F.current}`}if(e.message?.user?.id===v.userID&&e?.message?.created_at&&e?.message?.cid){let t=new Date(e.message.created_at),n=e.message.cid;(!b[n]||b[n].getTime()<t.getTime())&&(b[n]=t)}}if(e.type===`user.deleted`){let e=r.state?.messages?.[0]?.id;await r.query({messages:{id_lt:e,limit:25},watchers:{limit:25}})}e.type===`notification.mark_unread`&&j(t=>e.last_read_at&&e.user?{first_unread_message_id:e.first_unread_message_id,last_read:new Date(e.last_read_at),last_read_message_id:e.last_read_message_id,unread_messages:e.unread_messages??0}:t),e.type===`channel.truncated`&&e.cid===r.cid&&j(void 0),ie()}};(0,d.useLayoutEffect)(()=>{let e=!1,t=!1;return(async()=>{if(!r.initialized&&u)try{let e=[];
466if(!r.id&&r.data?.members)for(let t of r.data.members){let n;if(typeof t==`string`)n=t;else if(typeof t==`object`){let{user:e,user_id:r}=t;n=r||e?.id}n&&e.push(n)}await rG({channel:r,client:v,members:e,options:i}),k(r.getConfig())}catch(t){N({error:t,type:`setError`}),e=!0}if(t=!0,F.current=document.title,!e){if(N({channel:r,hasMore:r.state.messagePagination.hasPrev,type:`initStateFromChannel`}),v.user?.id&&r.state.read[v.user.id]){let{user:e,...t}=r.state.read[v.user.id];j(t)}r.countUnread()>0&&f&&oe({updateChannelUiUnreadState:!1}),v.on(`connection.changed`,L),v.on(`connection.recovered`,L),v.on(`user.updated`,L),v.on(`user.deleted`,L),v.on(`user.messages.deleted`,L),r.on(L)}})(),()=>{e||!t||(r?.off(L),v.off(`connection.changed`,L),v.off(`connection.recovered`,L),v.off(`user.deleted`,L))}},[r.cid,i,s,O?.read_events,u]),(0,d.useEffect)(()=>{if(!M.thread)return;let e=M.messages?.find(e=>e.id===M.thread?.id);e&&N({message:e,type:`setThread`})},[M.messages,M.thread]);let se=(0,d.useCallback)(({highlightDuration:e,highlightedMessageId:t})=>{N({channel:r,highlightedMessageId:t,type:`jumpToMessageFinished`}),re.current&&clearTimeout(re.current),re.current=setTimeout(()=>{S._internalState.getLatestValue().focusedMessage&&S._internalState.partialNext({focusedMessage:void 0}),re.current=null,N({type:`clearHighlightedMessage`})},e??500)},[r,S]);(0,d.useEffect)(()=>{P?.id&&se({highlightedMessageId:P.id})},[P,se]);let ce=(0,d.useCallback)(()=>{C({context:{feature:`jumpToFirstUnread`},emitter:`Channel`,message:w(`Failed to jump to the first unread message`),severity:`error`,targetPanels:[`channel`],type:`channel:jumpToFirstUnread:failed`})},[C,w]),le=(0,d.useCallback)((0,NB.default)((e,t)=>{ee.current&&N({hasMore:e,messages:t,type:`loadMoreFinished`})},2e3,{leading:!0,trailing:!0}),[]),ue=(0,d.useCallback)((e,t)=>{ee.current&&N({hasMore:e,messages:t,type:`loadMoreFinished`})},[ee]),de=async(e=25)=>{if(!ne.current||!window.navigator.onLine||!r.state.messagePagination.hasPrev)return 0;let t=M?.messages?.[0];if(M.loadingMore||M.loadingMoreNewer||t?.status!==`received`)return 0;N({loadingMore:!0,type:`setLoadingMore`});let n=t?.id,i=e,a;try{a=await r.query({messages:{id_lt:n,limit:i},watchers:{limit:i}})}catch(e){return console.warn(`message pagination request failed with error`,e),N({loadingMore:!1,type:`setLoadingMore`}),0}return le.cancel(),ue(r.state.messagePagination.hasPrev,r.state.messages),a.messages.length},fe=async(e=25)=>{if(!ne.current||!window.navigator.onLine||!r.state.messagePagination.hasNext)return 0;let t=M?.messages?.[M?.messages?.length-1];if(M.loadingMore||M.loadingMoreNewer)return 0;N({loadingMoreNewer:!0,type:`setLoadingMoreNewer`});let n=t?.id,i=e,a;try{a=await r.query({messages:{id_gt:n,limit:i},watchers:{limit:i}})}catch(e){return console.warn(`message pagination request failed with error`,e),N({loadingMoreNewer:!1,type:`setLoadingMoreNewer`}),0}return N({hasMoreNewer:r.state.messagePagination.hasNext,messages:r.state.messages,type:`loadMoreNewerFinished`}),a.messages.length},pe=(0,d.useCallback)(async(e,t=25,n=500)=>{N({loadingMoreForJumpToChannelMessage:!0,type:`setLoadingMoreForJumpToChannelMessage`}),le.cancel();try{await r.state.loadMessageIntoState(e,void 0,t),se({highlightDuration:n,highlightedMessageId:e})}catch(e){throw N({loadingMoreForJumpToChannelMessage:!1,type:`setLoadingMoreForJumpToChannelMessage`}),e}},[r,se,le]),me=(0,d.useCallback)(async()=>{le.cancel(),await r.state.loadMessageIntoState(`latest`),N({hasMore:r.state.messagePagination.hasPrev,hasMoreNewer:r.state.messagePagination.hasNext,messages:r.state.messages,type:`jumpToLatestMessageFinished`})},[r,le]),he=(0,d.useCallback)(async(e=25,t=500)=>{if(!A?.unread_messages)return;let n=A?.last_read_message_id,i=A?.first_unread_message_id,a=!1;if(i)a=$W(i,r.state.messages).index!==-1;else if(n){let e=$W(n,r.state.messages);a=!!e.target,i=e.index>-1?r.state.messages[e.index+1]?.id:void 0}else{let t=A.last_read.getTime(),{index:o,target:s}=eG(A.last_read,r.state.messages,!0);if(s)i=r.state.messages[o+1]?.id,a=!!i,n=s.id;else{N({loadingMore:!0,type:`setLoadingMore`});let a;try{a=(await r.query({messages:{created_at_around:A.last_read.toISOString(),limit:e}},`new`)).messages}catch{ce(),ue(r.state.messagePagination.hasPrev,r.state.messages);return}let o=a.find(e=>e.created_at);if(!o){ce(),ue(r.state.messagePagination.hasPrev,r.state.messages);return}t<new Date(o.created_at).getTime()?i=o.id:n=eG(A.last_read,a).target?.id,ue(r.state.messagePagination.hasPrev,r.state.messages)}}if(!i&&!n){ce();return}if(!a){N({loadingMore:!0,type:`setLoadingMore`});try{let t=i??n;await r.state.loadMessageIntoState(t,void 0,e);let a=r.state.messages.findIndex(e=>e.id===t);ue(r.state.messagePagination.hasPrev,r.state.messages),i??=r.state.messages[a+1]?.id}catch{ce(),ue(r.state.messagePagination.hasPrev,r.state.messages);return}}if(!i){ce();return}A.first_unread_message_id||j({...A,first_unread_message_id:i,last_read_message_id:n}),se({highlightDuration:t,highlightedMessageId:i})},[r,ue,se,ce,A]),ge=(0,d.useCallback)(async(e,t)=>
466{if(!e?.id)throw Error(`Cannot delete a message - missing message ID.`);let n;return n=o?await o(e,t):(await v.deleteMessage(e.id,t)).message,n},[v,o]),_e=e=>{r.state.addMessageSorted(e,!0),N({channel:r,parentId:M.thread&&e.parent_id,type:`copyMessagesFromChannel`})},ve=async({localMessage:e,message:t,options:n})=>{try{let e;e=c?await c(r,t,n):await r.sendMessage(t,n);let i;for(let e=r.state.messages.length-1;e>=0;e--){let n=r.state.messages[e];if(n.id&&n.id===t.id){i=n;break}}let a=new Date(e?.message?.updated_at||0).getTime()>(i?.updated_at?.getTime()||0);e?.message&&(a||i?.status===`sending`)&&_e({...e.message,status:`received`})}catch(t){let n=tG(t);n.code===4&&t instanceof Error&&t.message.includes(`already exists`)?_e({...e,status:`received`}):(_e({...e,error:n,status:`failed`}),D?.upsertReplyLocally({message:{...e,error:n,status:`failed`}}))}},ye=async({localMessage:e,message:t,options:n})=>{r.state.filterErrorMessages(),D?.upsertReplyLocally({message:e}),_e(e),await ve({localMessage:e,message:t,options:n})},be=async e=>{let t=e.type===`error`?`regular`:e.type;_e({...e,error:void 0,status:`sending`,type:t}),await ve({localMessage:e,message:Jte({...e,type:t})})},xe=e=>{r.state.removeMessage(e),N({channel:r,parentId:M.thread&&e.parent_id,type:`copyMessagesFromChannel`})},Se=(e,t)=>{t?.preventDefault(),N({channel:r,message:e,type:`openThread`})},Ce=e=>{e?.preventDefault(),N({type:`closeThread`})},we=(0,d.useCallback)((0,NB.default)((e,t)=>{N({threadHasMore:e,threadMessages:t,type:`loadMoreThreadFinished`})},2e3,{leading:!0,trailing:!0}),[]),Te=async(e=25)=>{if(M.threadLoadingMore||!M.thread||!M.threadHasMore)return;N({type:`startLoadingThread`});let t=M.thread.id;if(!t)return N({type:`closeThread`});let n=r.state.threads[t]||[],i=n[0]?.id;try{we(GW((await r.getReplies(t,{id_lt:i,limit:e})).messages.length,e),r.state.threads[t]||[])}catch{we(!1,n)}},Ee=HU(m,p),De=BU(l),{typing:Oe,...ke}=M,Ae=RU({...ke,channel:r,channelCapabilitiesArray:I,channelConfig:O,channelUnreadUiState:A,giphyVersion:e.giphyVersion||`fixed_height`,imageAttachmentSizeHandler:e.imageAttachmentSizeHandler||aG,mutes:x,notifications:[],shouldGenerateVideoThumbnail:e.shouldGenerateVideoThumbnail??!0,videoAttachmentSizeHandler:e.videoAttachmentSizeHandler||oG,watcher_count:M.watcherCount}),je=(0,d.useMemo)(()=>({closeThread:Ce,deleteMessage:ge,dispatch:N,editMessage:De,jumpToFirstUnreadMessage:he,jumpToLatestMessage:me,jumpToMessage:pe,loadMore:de,loadMoreNewer:fe,loadMoreThread:Te,markRead:oe,onMentionsClick:Ee,onMentionsHover:Ee,openThread:Se,removeMessage:xe,retrySendMessage:be,sendMessage:ye,setChannelUnreadUiState:ae,skipMessageDataMemoization:h,updateMessage:_e}),[r.cid,ge,de,fe,oe,he,pe,me,ae]),Me=zU({typing:Oe});return M.error?(0,R.jsx)(mG,{children:(0,R.jsx)(g,{error:M.error})}):M.loading?(0,R.jsx)(mG,{children:(0,R.jsx)(_,{})}):r.watch?(0,R.jsx)(mG,{className:E,children:(0,R.jsx)(WB,{value:Ae,children:(0,R.jsx)(RB,{value:je,children:(0,R.jsx)(VV,{value:Me,children:(0,R.jsx)(AW,{allowConcurrentPlayback:n,children:(0,R.jsx)(`div`,{className:G(T),children:a})})})})})}):(0,R.jsx)(mG,{children:(0,R.jsx)(`div`,{children:w(`Channel Missing`)})})},_G=d.memo(hG),vG=(0,d.createContext)(void 0),yG=()=>(0,d.useContext)(vG),bG=({children:e,thread:t})=>(0,R.jsx)(vG.Provider,{value:t,children:(0,R.jsx)(_G,{channel:t?.channel,children:e})}),xG=({children:e,count:t,position:n})=>(0,R.jsxs)(`div`,{className:`str-chat__unread-count-badge-container`,children:[e,t>0&&(0,R.jsx)(`div`,{className:G(`str-chat__unread-count-badge`,n&&`str-chat__unread-count-badge--${n}`),children:t})]}),SG={chatViewPanelIds:{channels:`str-chat__chat-view-panel-channels`,threads:`str-chat__chat-view-panel-threads`},chatViewTabIds:{channels:`str-chat__chat-view-tab-channels`,threads:`str-chat__chat-view-tab-threads`}},CG=e=>({chatViewPanelIds:{channels:`str-chat__chat-view-${e}-panel-channels`,threads:`str-chat__chat-view-${e}-panel-threads`},chatViewTabIds:{channels:`str-chat__chat-view-${e}-tab-channels`,threads:`str-chat__chat-view-${e}-tab-threads`}}),wG=(0,d.createContext)(void 0),TG=(0,d.createContext)(SG),EG=()=>(0,d.useContext)(wG)||(console.warn(`The useChatViewContext hook was called outside of the ChatView provider.`),{}),DG=()=>(0,d.useContext)(TG),OG=({children:e})=>{let[t,n]=(0,d.useState)(`channels`),r=PU(),{theme:i}=K(),a=(0,d.useMemo)(()=>CG(r),[r]),o=(0,d.useMemo)(()=>({activeChatView:t,setActiveChatView:n}),[t]);return(0,R.jsx)(TG.Provider,{value:a,children:(0,R.jsx)(wG.Provider,{value:o,children:(0,R.jsx)(`div`,{className:G(`str-chat`,i,`str-chat__chat-view`),children:e})})})},kG=({children:e})=>{let{activeChatView:t}=EG(),{chatViewPanelIds:n,chatViewTabIds:r}=DG();return t===`channels`?(0,R.jsx)(`div`,{"aria-labelledby":r.channels,className:`str-chat__chat-view__channels`,id:n.
466channels,role:`tabpanel`,children:e}):null},AG=(0,d.createContext)({activeThread:void 0,setActiveThread:()=>void 0}),jG=()=>(0,d.useContext)(AG),MG=({children:e})=>{let{activeChatView:t}=EG(),{chatViewPanelIds:n,chatViewTabIds:r}=DG(),[i,a]=(0,d.useState)(void 0),o=(0,d.useMemo)(()=>({activeThread:i,setActiveThread:a}),[i]);return t===`threads`?(0,R.jsx)(AG.Provider,{value:o,children:(0,R.jsx)(`div`,{"aria-labelledby":r.threads,className:`str-chat__chat-view__threads`,id:n.threads,role:`tabpanel`,children:e})}):null},NG=({activeThread:e})=>{(0,d.useEffect)(()=>{if(!e)return;let t=()=>{document.visibilityState===`visible`&&document.hasFocus()&&e.activate(),(document.visibilityState===`hidden`||!document.hasFocus())&&e.deactivate()};return t(),window.addEventListener(`focus`,t),window.addEventListener(`blur`,t),()=>{e.deactivate(),window.removeEventListener(`blur`,t),window.removeEventListener(`focus`,t)}},[e])},PG=({children:e})=>{let{client:t}=K(`ThreadAdapter`),{EmptyStateIndicator:n=FU}=q(`ThreadAdapter`),{activeThread:r}=jG(),{t:i}=Y(`ThreadAdapter`),{isLoading:a,ready:o}=J(t.threads.state,IG)??{isLoading:!1,ready:!1};return NG({activeThread:r}),!r&&o&&!a&&n?(0,R.jsx)(`div`,{className:`str-chat__thread-container str-chat__thread`,children:(0,R.jsx)(n,{listType:`message`,messageText:i(`Select a thread to continue the conversation`)})}):(0,R.jsx)(bG,{thread:r,children:e})},FG=({ActiveIcon:e,children:t,className:n,Icon:r,iconOnly:i=!0,isActive:a,text:o,...s})=>{let c=a&&e?e:r,l=!!o&&i;return(0,R.jsxs)(`div`,{className:`str-chat__chat-view__selector-button-container`,children:[(0,R.jsxs)(nH,{appearance:`ghost`,"aria-label":s[`aria-label`]??(l?o:void 0),className:G(`str-chat__chat-view__selector-button`,n),role:`tab`,variant:`secondary`,...s,children:[t??(c&&(0,R.jsx)(c,{})),!i&&o&&(0,R.jsx)(`div`,{className:`str-chat__chat-view__selector-button-text`,children:o})]}),l&&(0,R.jsx)(`div`,{"aria-hidden":`true`,className:`str-chat__chat-view__selector-button-tooltip str-chat__tooltip`,children:o})]})},IG=({pagination:e,ready:t})=>({isLoading:e.isLoading,ready:t}),LG=({unreadThreadCount:e})=>({unreadThreadCount:e}),RG=[{Component:({iconOnly:e=!0})=>{let{activeChatView:t,setActiveChatView:n}=EG(),{chatViewPanelIds:r,chatViewTabIds:i}=DG(),{t:a}=Y(),o=t===`channels`;return(0,R.jsx)(FG,{ActiveIcon:bH,"aria-controls":r.channels,"aria-selected":o,Icon:yH,iconOnly:e,id:i.channels,isActive:o,onClick:()=>n(`channels`),onPointerDown:()=>n(`channels`),tabIndex:0,text:a(`Channels`)})},type:`channels`},{Component:({iconOnly:e=!0})=>{let{client:t}=K(),{unreadThreadCount:n}=J(t.threads.state,LG)??{unreadThreadCount:0},{activeChatView:r,setActiveChatView:i}=EG(),{chatViewPanelIds:a,chatViewTabIds:o}=DG(),{t:s}=Y(),c=r===`threads`;return(0,R.jsx)(FG,{ActiveIcon:SH,"aria-controls":a.threads,"aria-selected":c,Icon:xH,iconOnly:e,id:o.threads,isActive:c,onClick:()=>i(`threads`),onPointerDown:()=>i(`threads`),tabIndex:0,text:s(`Threads`),children:(0,R.jsx)(xG,{count:n,position:`top-right`,children:c?(0,R.jsx)(SH,{}):(0,R.jsx)(xH,{})})})},type:`threads`}];OG.Channels=kG,OG.Threads=MG,OG.ThreadAdapter=PG,OG.Selector=({iconOnly:e=!0,itemSet:t=RG})=>{let{t:n}=Y();return(0,R.jsx)(`div`,{"aria-label":n(`aria/Chat view tabs`),className:`str-chat__chat-view__selector`,role:`tablist`,children:t.map(({Component:t,type:n})=>(0,R.jsx)(t,{iconOnly:e},n))})};var zG=()=>{let e=(0,d.useContext)(wG),{channels:t}=HB(),{channel:n}=KB(),r=yG(),{legacyThread:i}=bW();if(r||i)return`thread`;if(n)return`channel`;if(e?.activeChatView===`threads`)return`thread-list`;if(t)return`channel-list`},BG=({dialogsById:e})=>({isOpen:!!e[eV]?.isOpen}),VG=`system`,HG=e=>e.tags?.includes(`system`)??!1,UG=(e,t,n,r)=>{if(e){let t=r&&e.length>0?[...e,`modal`]:e;return Array.from(new Set([...t.map(KV),...n??[]]))}return r?Array.from(new Set([...t?[KV(t)]:[],KV(`modal`),...n??[]])):qV(t,n)},WG=({incident:e,severity:t,type:n})=>{if(n)return n;if(!e)return;let r=e.status??(t===`error`?`failed`:t===`success`?`success`:t);return[e.domain,e.entity,e.operation,r].filter(e=>!!e).join(`:`)},GG=()=>{let{client:e}=K(),t=zG(),n=J(SV()?.state,BG)?.isOpen??!1;return{addNotification:(0,d.useCallback)(({actions:r,context:i,duration:a,emitter:o,error:s,incident:c,message:l,severity:u,tags:d,targetPanels:f,type:p})=>{let m=UG(f,t,d,n),h=WG({incident:c,severity:u,type:p}),g=i?{context:i,emitter:o}:{emitter:o},_={...r?{actions:r}:{},...typeof a==`number`?{duration:a}:{},...s?{originalError:s}:{},...m.length>0?{tags:m}:{},...u?{severity:u}:{},...h?{type:h}:{}}
466;e.notifications.add({message:l,options:_,origin:g})},[e,t,n]),addSystemNotification:(0,d.useCallback)(({actions:t,context:n,duration:r,emitter:i,error:a,incident:o,message:s,severity:c,tags:l,type:u})=>{let d=Array.from(new Set([VG,...l??[]])),f=WG({incident:o,severity:c,type:u}),p=n?{context:n,emitter:i}:{emitter:i},m={...t?{actions:t}:{},...typeof r==`number`?{duration:r}:{},...a?{originalError:a}:{},...d.length>0?{tags:d}:{},...c?{severity:c}:{},...f?{type:f}:{}};return e.notifications.add({message:s,options:m,origin:p})},[e]),removeNotification:(0,d.useCallback)(t=>{e.notifications.remove(t)},[e]),startNotificationTimeout:(0,d.useCallback)(t=>{e.notifications.startTimeout(t)},[e])}},KG=(e=!1,t)=>(0,d.useCallback)(({currentTarget:n})=>{let{files:r}=n;if(r){try{t?.(Array.from(r))}catch(e){console.error(e)}e&&(n.value=``)}},[t,e]);async function qG(e){if(!e||!e.length)return[];let t=JG(e);if(t.length)return t;let n=[];for(let r of e)r.type===`text/html`&&n.push(new Promise(e=>{r.getAsString(async n=>{let r=XG(n).map(e=>YG(t,e));await Promise.all(r),e()})}));return await Promise.all(n),t}function JG(e){let t=[];for(let n of e)if(n.kind===`file`){let e=n.getAsFile();e&&t.push(e)}return t}async function YG(e,t){let n;try{n=await fetch(t)}catch{return}let r=n.headers.get(`Content-type`)||`application/octet-stream`,i=await n.arrayBuffer(),a=new Blob([i],{type:r});e.push(a)}var XG=e=>{let t=new DOMParser().parseFromString(e,`text/html`).getElementsByTagName(`img`);return Array.from(t,e=>e.src).filter(e=>e)},ZG=({blobsArray:e,fileName:t,mimeType:n})=>{let r=new Blob(e,{type:n});return new File([r],t,{type:r.type})},QG=e=>{let t=e.match(/\/([^/;]+)/);return t&&t[1]},$G=e=>{let t=e.match(/^(audio|video)\/.*$/);return t&&t[1]},eK=e=>new Promise((t,n)=>{let r=new FileReader;r.onload=()=>{t(r.result)},r.onerror=()=>{n(r.error)},r.readAsArrayBuffer(e)}),tK=async e=>{let t=new AudioContext,n=await eK(e),r=await t.decodeAudioData(n);return t.state!==`closed`&&await t.close(),r},nK=async(e,t)=>{let n=new OfflineAudioContext(e.numberOfChannels,e.duration*t,t),r=n.createBufferSource();return r.buffer=e,r.connect(n.destination),r.start(),await n.startRendering()},rK=e=>e?.ownerDocument??document,iK=e=>e&&`window`in e&&e.window===e?e:rK(e).defaultView||window;function aK(e){return typeof e==`object`&&!!e&&`nodeType`in e&&typeof e.nodeType==`number`}function oK(e){return aK(e)&&e.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&`host`in e}var sK=!1;function cK(){return sK}function lK(e,t){if(!cK())return t&&e?e.contains(t):!1;if(!e||!t)return!1;let n=t;for(;n!==null;){if(n===e)return!0;n=n.tagName===`SLOT`&&n.assignedSlot?n.assignedSlot.parentNode:oK(n)?n.host:n.parentNode}return!1}var uK=(e=document)=>{if(!cK())return e.activeElement;let t=e.activeElement;for(;t&&`shadowRoot`in t&&t.shadowRoot?.activeElement;)t=t.shadowRoot.activeElement;return t};function dK(e){if(cK()&&e.target instanceof Element&&e.target.shadowRoot){if(`composedPath`in e)return e.composedPath()[0]??null;if(`composedPath`in e.nativeEvent)return e.nativeEvent.composedPath()[0]??null}return e.target}var fK=class{constructor(e,t,n,r){this._walkerStack=[],this._currentSetFor=new Set,this._acceptNode=e=>{if(e.nodeType===Node.ELEMENT_NODE){let t=e.shadowRoot;if(t){let e=this._doc.createTreeWalker(t,this.whatToShow,{acceptNode:this._acceptNode});return this._walkerStack.unshift(e),NodeFilter.FILTER_ACCEPT}else if(typeof this.filter==`function`)return this.filter(e);else if(this.filter?.acceptNode)return this.filter.acceptNode(e);else if(this.filter===null)return NodeFilter.FILTER_ACCEPT}return NodeFilter.FILTER_SKIP},this._doc=e,this.root=t,this.filter=r??null,this.whatToShow=n??NodeFilter.SHOW_ALL,this._currentNode=t,this._walkerStack.unshift(e.createTreeWalker(t,n,this._acceptNode));let i=t.shadowRoot;if(i){let e=this._doc.createTreeWalker(i,this.whatToShow,{acceptNode:this._acceptNode});this._walkerStack.unshift(e)}}get currentNode(){return this._currentNode}set currentNode(e){if(!lK(this.root,e))throw Error(`Cannot set currentNode to a node that is not contained by the root node.`);let t=[],n=e,r=e;for(this._currentNode=e;n&&n!==this.root;)if(n.nodeType===Node.DOCUMENT_FRAGMENT_NODE){let e=n,i=this._doc.createTreeWalker(e,this.whatToShow,{acceptNode:this._acceptNode});t.push(i),i.currentNode=r,this._currentSetFor.add(i),n=r=e.host}else n=n.parentNode;let i=this._doc.createTreeWalker(this.root,this.whatToShow,{acceptNode:this._acceptNode});t.push(i),i.currentNode=r,this._currentSetFor.add(i),this._walkerStack=t}get doc(){return this._doc}firstChild(){let e=this.currentNode,t=this.nextNode();return lK(e,t)?(t&&(this.currentNode=t),t):(this.currentNode=e,null)}lastChild(){let e=this._walkerStack[0].lastChild();return e&&(this.currentNode=e),e}nextNode(){let e=this._walkerStack[0].nextNode();if(e){if(e.shadowRoot){let t;if(typeof this.filter==`function`?t=this.filter(e):this.filter?.acceptNode&&(t=this.filter.acceptNode(e)),t===NodeFilter.FILTER_ACCEPT)return this.currentNode=e,e;let n=this.nextNode();return n&&(this.currentNode=n),n}return e&&(this.currentNode=e),e}else if(this._walkerStack.length>1){this._walkerStack.shift();let e=this.nextNode();return e&&(this.currentNode=e),e}else return null}previousNode(){let e=this._walkerStack[0];if(e.currentNode===e.root){if(this._currentSetFor.has(e))if(this._currentSetFor.delete(e),this._walkerStack.length>1){this._walkerStack.shift();let e=this.previousNode();return e&&(this.currentNode=e),e}else return null;return null}let t=e.previousNode();if(t){if(t.shadowRoot){let e;if(typeof this.filter==`function`?e=this.filter(t):this.filter?.acceptNode&&(e=this.filter.acceptNode(t)),e===NodeFilter.FILTER_ACCEPT)return t&&(this.currentNode=t),t;let n=this.lastChild();return n&&(this.currentNode=n),n}return t&&(this.currentNode=t),t}else if(this._walkerStack.length>1){this._walkerStack.shift();let e=this.previousNode();return e&&(this.currentNode=e),e}else return null}nextSibling(){return null}previousSibling(){return null}parentNode(){return null}};function pK(e,t,n,r){return cK()?new fK(e,t,n,r):e.createTreeWalker(t,n,r)}function mK(e){if(gK())e.focus({preventScroll:!0});else{let t=_K(e);e.focus(),vK(t)}}var hK=null;function gK(){if(hK==null){hK=!1;try{document.createElement(`div`).focus({get preventScroll(){return hK=!0,!0}})}catch{}}return hK}function _K(e){let t=e.parentNode,n=[],r=document.scrollingElement||document.documentElement;for(;t instanceof HTMLElement&&t!==r;)(t.offsetHeight<t.scrollHeight||t.offsetWidth<t.scrollWidth)&&n.push({element:t,scrollTop:t.scrollTop,scrollLeft:t.scrollLeft}),t=t.parentNode;return r instanceof HTMLElement&&n.push({element:r,scrollTop:r.scrollTop,scrollLeft:r.scrollLeft}),n}function vK(e){for(let{element:t,scrollTop:n,scrollLeft:r}of e)t.scrollTop=n,t.scrollLeft=r}var yK=typeof Element<`u`&&`checkVisibility`in Element.prototype;function bK(e){let t=iK(e);if(!(e instanceof t.HTMLElement)&&!(e instanceof t.SVGElement))return!1;let{display:n,visibility:r}=e.style,i=n!==`none`&&r!==`hidden`&&r!==`collapse`;if(i){let{getComputedStyle:t}=e.ownerDocument.defaultView,{display:n,visibility:r}=t(e);i=n!==`none`&&r!==`hidden`&&r!==`collapse`}return i}function xK(e,t){return!e.hasAttribute(`hidden`)&&!e.hasAttribute(`data-react-aria-prevent-focus`)&&(e.nodeName===`DETAILS`&&t&&t.nodeName!==`SUMMARY`?e.hasAttribute(`open`):!0)}function SK(e,t){return yK?e.checkVisibility({visibilityProperty:!0})&&!e.closest(`[data-react-aria-prevent-focus]`):e.nodeName!==`#comment`&&bK(e)&&xK(e,t)&&(!e.parentElement||SK(e.parentElement,e))}var CK=[`input:not([disabled]):not([type=hidden])`,`select:not([disabled])`,`textarea:not([disabled])`,`button:not([disabled])`,`a[href]`,`area[href]`,`summary`,`iframe`,`object`,`embed`,`audio[controls]`,`video[controls]`,`[contenteditable]:not([contenteditable^="false"])`,`permission`],wK=CK.join(`:not([hidden]),`)+`,[tabindex]:not
466([disabled]):not([hidden])`;CK.push(`[tabindex]:not([tabindex="-1"]):not([disabled])`);var TK=CK.join(`:not([hidden]):not([tabindex="-1"]),`);function EK(e,t){return e.matches(wK)&&!OK(e)&&(t?.skipVisibilityCheck||SK(e))}function DK(e){return e.matches(TK)&&SK(e)&&!OK(e)}function OK(e){let t=e;for(;t!=null;){if(t instanceof t.ownerDocument.defaultView.HTMLElement&&t.inert)return!0;t=t.parentElement}return!1}var kK=typeof document<`u`?d.useLayoutEffect:()=>{},AK=!1;function jK(e){if(typeof window>`u`||window.navigator==null)return!1;let t=window.navigator.userAgentData?.brands;return Array.isArray(t)&&t.some(t=>e.test(t.brand))||e.test(window.navigator.userAgent)}function MK(e){return typeof window<`u`&&window.navigator!=null?e.test(window.navigator.userAgentData?.platform||window.navigator.platform):!1}function NK(e){let t=null;return()=>(t??=e(),t)}var PK=NK(function(){return MK(/^Mac/i)}),FK=NK(function(){return MK(/^iPad/i)||PK()&&navigator.maxTouchPoints>1}),IK=NK(function(){return jK(/AppleWebKit/i)&&!LK()}),LK=NK(function(){return jK(/Chrome/i)}),RK=NK(function(){return jK(/Android/i)}),zK=NK(function(){return jK(/Firefox/i)});function BK(e){return e.pointerType===``&&e.isTrusted?!0:RK()&&e.pointerType?e.type===`click`&&e.buttons===1:e.detail===0&&!e.pointerType}function VK(e,t,n=!0){let{metaKey:r,ctrlKey:i,altKey:a,shiftKey:o}=t;zK()&&window.event?.type?.startsWith(`key`)&&e.target===`_blank`&&(PK()?r=!0:i=!0);let s=IK()&&PK()&&!FK()?new KeyboardEvent(`keydown`,{keyIdentifier:`Enter`,metaKey:r,ctrlKey:i,altKey:a,shiftKey:o}):new MouseEvent(`click`,{metaKey:r,ctrlKey:i,altKey:a,shiftKey:o,detail:1,bubbles:!0,cancelable:!0});VK.isOpening=n,mK(e),e.dispatchEvent(s),VK.isOpening=!1}VK.isOpening=!1;var HK=null,UK=new Set,WK=new Map,GK=!1,KK=!1;function qK(e,t){for(let n of UK)n(e,t)}function JK(e){return!(e.metaKey||!PK()&&e.altKey||e.ctrlKey||e.key===`Control`||e.key===`Shift`||e.key===`Meta`)}function YK(e){GK=!0,!VK.isOpening&&JK(e)&&(HK=`keyboard`,qK(`keyboard`,e))}function XK(e){HK=`pointer`,`pointerType`in e&&e.pointerType,(e.type===`mousedown`||e.type===`pointerdown`)&&(GK=!0,qK(`pointer`,e))}function ZK(e){!VK.isOpening&&BK(e)&&(GK=!0,HK=`virtual`)}function QK(e){let t=iK(dK(e)),n=rK(dK(e));dK(e)===t||dK(e)===n||AK||!e.isTrusted||(!GK&&!KK&&(HK=`virtual`,qK(`virtual`,e)),GK=!1,KK=!1)}function $K(){AK||(GK=!1,KK=!0)}function eq(e){if(typeof window>`u`||typeof document>`u`)return;let t=iK(e),n=rK(e);if(WK.get(t))return;let r=t.HTMLElement.prototype.focus;t.HTMLElement.prototype.focus=function(){GK=!0,r.apply(this,arguments)},n.addEventListener(`keydown`,YK,!0),n.addEventListener(`keyup`,YK,!0),n.addEventListener(`click`,ZK,!0),t.addEventListener(`focus`,QK,!0),t.addEventListener(`blur`,$K,!1),typeof PointerEvent<`u`&&(n.addEventListener(`pointerdown`,XK,!0),n.addEventListener(`pointermove`,XK,!0),n.addEventListener(`pointerup`,XK,!0)),t.addEventListener(`beforeunload`,()=>{tq(e)},{once:!0}),WK.set(t,{focus:r})}var tq=(e,t)=>{let n=iK(e),r=rK(e);t&&r.removeEventListener(`DOMContentLoaded`,t),WK.has(n)&&(n.HTMLElement.prototype.focus=WK.get(n).focus,r.removeEventListener(`keydown`,YK,!0),r.removeEventListener(`keyup`,YK,!0),r.removeEventListener(`click`,ZK,!0),n.removeEventListener(`focus`,QK,!0),n.removeEventListener(`blur`,$K,!1),typeof PointerEvent<`u`&&(r.removeEventListener(`pointerdown`,XK,!0),r.removeEventListener(`pointermove`,XK,!0),r.removeEventListener(`pointerup`,XK,!0)),WK.delete(n))};function nq(e){let t=rK(e),n;return t.readyState===`loading`?(n=()=>{eq(e)},t.addEventListener(`DOMContentLoaded`,n)):eq(e),()=>tq(e,n)}typeof document<`u`&&nq();function rq(){return HK}var iq=new Map,aq=new Set;function oq(){if(typeof window>`u`)return;function e(e){return`propertyName`in e}let t=t=>{let r=dK(t);if(!e(t)||!r)return;let i=iq.get(r);i||(i=new Set,iq.set(r,i),r.addEventListener(`transitioncancel`,n,{once:!0})),i.add(t.propertyName)},n=t=>{let r=dK(t);if(!e(t)||!r)return;let i=iq.get(r);if(i&&(i.delete(t.propertyName),i.size===0&&(r.removeEventListener(`transitioncancel`,n),iq.delete(r)),iq.size===0)){for(let e of aq)e();aq.clear()}};document.body.addEventListener(`transitionrun`,t),document.body.addEventListener(`transitionend`,n)}typeof document<`u`&&(document.readyState===`loading`?document.addEventListener(`DOMContentLoaded`,oq):oq());function sq(){for(let[e]of iq)`isConnected`in e&&!e.isConnected&&iq.delete(e)}function cq(e){requestAnimationFrame(()=>{sq(),iq.size===0?e():aq.add(e)})}function lq(e){if(!e.isConnected)return;let t=rK(e);if(rq()===`virtual`){let n=uK(t);cq(()=>{let r=uK(t);(r===n||r===t.body)&&e.isConnected&&mK(e)})}else mK(e)}var uq=d.createContext(null),dq=`react-aria-focus-scope-restore`,fq=null;
vendor: 8,630 bytes, line 466
466function pq(e){let{children:t,contain:n,restoreFocus:r,autoFocus:i}=e,a=(0,d.useRef)(null),o=(0,d.useRef)(null),s=(0,d.useRef)([]),{parentNode:c}=(0,d.useContext)(uq)||{},l=(0,d.useMemo)(()=>new Pq({scopeRef:s}),[s]);kK(()=>{let e=c||Fq.root;if(Fq.getTreeNode(e.scopeRef)&&fq&&!Cq(fq,e.scopeRef)){let t=Fq.getTreeNode(fq);t&&(e=t)}e.addChild(l),Fq.addNode(l)},[l,c]),kK(()=>{let e=Fq.getTreeNode(s);e&&(e.contain=!!n)},[n]),kK(()=>{let e=a.current?.nextSibling,t=[],n=e=>e.stopPropagation();for(;e&&e!==o.current;)t.push(e),e.addEventListener(dq,n),e=e.nextSibling;return s.current=t,()=>{for(let e of t)e.removeEventListener(dq,n)}},[t]),Oq(s,r,n),yq(s,n),Aq(s,r,n),Dq(s,i),(0,d.useEffect)(()=>{let e=uK(rK(s.current?s.current[0]:void 0)),t=null;if(xq(e,s.current)){for(let n of Fq.traverse())n.scopeRef&&xq(e,n.scopeRef.current)&&(t=n);t===Fq.getTreeNode(s)&&(fq=t.scopeRef)}},[s]),kK(()=>()=>{let e=Fq.getTreeNode(s)?.parent?.scopeRef??null;(s===fq||Cq(s,fq))&&(!e||Fq.getTreeNode(e))&&(fq=e),Fq.removeTreeNode(s)},[s]);let u=(0,d.useMemo)(()=>mq(s),[]),f=(0,d.useMemo)(()=>({focusManager:u,parentNode:l}),[l,u]);return d.createElement(uq.Provider,{value:f},d.createElement(`span`,{"data-focus-scope-start":!0,hidden:!0,ref:a}),t,d.createElement(`span`,{"data-focus-scope-end":!0,hidden:!0,ref:o}))}function mq(e){return{focusNext(t={}){let n=e.current,{from:r,tabbable:i,wrap:a,accept:o}=t,s=r||uK(rK(n[0]??void 0)),c=n[0].previousElementSibling,l=Mq(hq(n),{tabbable:i,accept:o},n);l.currentNode=xq(s,n)?s:c;let u=l.nextNode();return!u&&a&&(l.currentNode=c,u=l.nextNode()),u&&wq(u,!0),u},focusPrevious(t={}){let n=e.current,{from:r,tabbable:i,wrap:a,accept:o}=t,s=r||uK(rK(n[0]??void 0)),c=n[n.length-1].nextElementSibling,l=Mq(hq(n),{tabbable:i,accept:o},n);l.currentNode=xq(s,n)?s:c;let u=l.previousNode();return!u&&a&&(l.currentNode=c,u=l.previousNode()),u&&wq(u,!0),u},focusFirst(t={}){let n=e.current,{tabbable:r,accept:i}=t,a=Mq(hq(n),{tabbable:r,accept:i},n);a.currentNode=n[0].previousElementSibling;let o=a.nextNode();return o&&wq(o,!0),o},focusLast(t={}){let n=e.current,{tabbable:r,accept:i}=t,a=Mq(hq(n),{tabbable:r,accept:i},n);a.currentNode=n[n.length-1].nextElementSibling;let o=a.previousNode();return o&&wq(o,!0),o}}}function hq(e){return e[0].parentElement}function gq(e){let t=Fq.getTreeNode(fq);for(;t&&t.scopeRef!==e;){if(t.contain)return!1;t=t.parent}return!0}function _q(e){if(!e.form)return Array.from(rK(e).querySelectorAll(`input[type="radio"][name="${CSS.escape(e.name)}"]`)).filter(e=>!e.form);let t=e.form.elements.namedItem(e.name),n=iK(e);return t instanceof n.RadioNodeList?Array.from(t).filter(e=>e instanceof n.HTMLInputElement):t instanceof n.HTMLInputElement?[t]:[]}function vq(e){if(e.checked)return!0;let t=_q(e);return t.length>0&&!t.some(e=>e.checked)}function yq(e,t){let n=(0,d.useRef)(void 0),r=(0,d.useRef)(void 0);kK(()=>{let i=e.current;if(!t){r.current&&=(cancelAnimationFrame(r.current),void 0);return}let a=rK(i?i[0]:void 0),o=t=>{if(t.key!==`Tab`||t.altKey||t.ctrlKey||t.metaKey||!gq(e)||t.isComposing)return;let n=uK(a),r=e.current;if(!r||!xq(n,r))return;let i=Mq(hq(r),{tabbable:!0},r);if(!n)return;i.currentNode=n;let o=t.shiftKey?i.previousNode():i.nextNode();o||=(i.currentNode=t.shiftKey?r[r.length-1].nextElementSibling:r[0].previousElementSibling,t.shiftKey?i.previousNode():i.nextNode()),t.preventDefault(),o&&(wq(o,!0),o instanceof iK(o).HTMLInputElement&&o.select())},s=t=>{(!fq||Cq(fq,e))&&xq(dK(t),e.current)?(fq=e,n.current=dK(t)):gq(e)&&!Sq(dK(t),e)?n.current?n.current.focus():fq&&fq.current&&Eq(fq.current):gq(e)&&(n.current=dK(t))},c=t=>{r.current&&cancelAnimationFrame(r.current),r.current=requestAnimationFrame(()=>{let r=rq(),i=(r===`virtual`||r===null)&&RK()&&LK(),o=uK(a);if(!i&&o&&gq(e)&&!Sq(o,e)){fq=e;let r=dK(t);r&&r.isConnected?(n.current=r,n.current?.focus()):fq.current&&Eq(fq.current)}})};return a.addEventListener(`keydown`,o,!1),a.addEventListener(`focusin`,s,!1),i?.forEach(e=>e.addEventListener(`focusin`,s,!1)),i?.forEach(e=>e.addEventListener(`focusout`,c,!1)),()=>{a.removeEventListener(`keydown`,o,!1),a.removeEventListener(`focusin`,s,!1),i?.forEach(e=>e.removeEventListener(`focusin`,s,!1)),i?.forEach(e=>e.removeEventListener(`focusout`,c,!1))}},[e,t]),kK(()=>()=>{r.current&&cancelAnimationFrame(r.current)},[r])}function bq(e){return Sq(e)}function xq(e,t){return!e||!t?!1:t.some(t=>lK(t,e))}function Sq(e,t=null){if(e instanceof Element&&e.closest(`[data-react-aria-top-layer]`))return!0;for(let{scopeRef:n}of Fq.traverse(Fq.getTreeNode(t)))if(n&&xq(e,n.current))return!0;return!1}function Cq(e,t){let n=Fq.getTreeNode(t)?.parent;for(;n;){if(n.scopeRef===e)return!0;n=n.parent}return!1}function wq(e,t=!1){if(e!=null&&!t)try{lq(e)}catch{}else if(e!=null)try{e.focus()}catch{}}function Tq(e,t=!0){let n=e[0].previousElementSibling,r=hq(e),i=Mq(r,{tabbable:t},e);i.currentNode=n;let a=i.nextNode();return t&&!a&&(r=hq(e),i=Mq(r,{tabbable:!1},e),i.currentNode=n,a=i.nextNode()),a}function Eq(e,t=!0){wq(Tq(e,t))}function Dq(e,t){let n=d.useRef(t);(0,d.useEffect)(()=>{n.current&&(fq=e,!xq(uK(rK(e.current?e.current[0]:void 0)),fq.current)&&e.current&&Eq(e.current)),n.current=!1},[e])}function Oq(e,t,n){kK(()=>{if(t||n)return;let r=e.current,i=rK(r?r[0]:void 0),a=t=>{let n=dK(t);xq(n,e.current)?fq=e:bq(n)||(fq=null)};return i.addEventListener(`focusin`,a,!1),r?.forEach(e=>e.addEventListener(`focusin`,a,!1)),()=>{i.removeEventListener(`focusin`,a,!1),r?.forEach(e=>e.removeEventListener(`focusin`,a,!1))}},[e,t,n])}function kq(e){let t=Fq.getTreeNode(fq);for(;t&&t.scopeRef!==e;){if(t.nodeToRestore)return!1;t=t.parent}return t?.scopeRef===e}function Aq(e,t,n){let r=(0,d.useRef)(typeof document<`u`?uK(rK(e.current?e.current[0]:void 0)):null);kK(()=>{let r=e.current,i=rK(r?r[0]:void 0);if(!t||n)return;let a=()=>{(!fq||Cq(fq,e))&&xq(uK(i),e.current)&&(fq=e)};return i.addEventListener(`focusin`,a,!1),r?.forEach(e=>e.addEventListener(`focusin`,a,!1)),()=>{i.removeEventListener(`focusin`,a,!1),r?.forEach(e=>e.removeEventListener(`focusin`,a,!1))}},[e,n]),kK(()=>{let r=rK(e.current?e.current[0]:void 0);if(!t)return;let i=t=>{if(t.key!==`Tab`||t.altKey||t.ctrlKey||t.metaKey||!gq(e)||t.isComposing)return;let n=r.activeElement;if(!Sq(n,e)||!kq(e))return;let i=Fq.getTreeNode(e);if(!i)return;let a=i.nodeToRestore,o=Mq(r.body,{tabbable:!0});o.currentNode=n;let s=t.shiftKey?o.previousNode():o.nextNode();if((!a||!a.isConnected||a===r.body)&&(a=void 0,i.nodeToRestore=void 0),(!s||!Sq(s,e))&&a){o.currentNode=a;do s=t.shiftKey?o.previousNode():o.nextNode();while(Sq(s,e));t.preventDefault(),t.stopPropagation(),s?wq(s,!0):bq(a)?wq(a,!0):n.blur()}};return n||r.addEventListener(`keydown`,i,!0),()=>{n||r.removeEventListener(`keydown`,i,!0)}},[e,t,n]),kK(()=>{let n=rK(e.current?e.current[0]:void 0);if(!t)return;let i=Fq.getTreeNode(e);if(i)return i.nodeToRestore=r.current??void 0,()=>{let r=Fq.getTreeNode(e);if(!r)return;let i=r.nodeToRestore,a=uK(n);if(t&&i&&(a&&Sq(a,e)||a===n.body&&kq(e))){let t=Fq.clone();requestAnimationFrame(()=>{if(n.activeElement===n.body){let n=t.getTreeNode(e);for(;n;){if(n.nodeToRestore&&n.nodeToRestore.isConnected){jq(n.nodeToRestore);return}n=n.parent}for(n=t.getTreeNode(e);n;){if(n.scopeRef&&n.scopeRef.current&&Fq.getTreeNode(n.scopeRef)){jq(Tq(n.scopeRef.current,!0));return}n=n.parent}}})}}},[e,t])}function jq(e){e.dispatchEvent(new CustomEvent(dq,{bubbles:!0,cancelable:!0}))&&wq(e)}function Mq(e,t,n){let r=t?.tabbable?DK:EK,i=rK(e?.nodeType===Node.ELEMENT_NODE?e:null),a=pK(i,e||i,NodeFilter.SHOW_ELEMENT,{acceptNode(e){return lK(t?.from,e)||t?.tabbable&&e.tagName===`INPUT`&&e.getAttribute(`type`)===`radio`&&(!vq(e)||a.currentNode.tagName===`INPUT`&&a.currentNode.type===`radio`&&a.currentNode.name===e.name)?NodeFilter.FILTER_REJECT:r(e)&&(!n||xq(e,n))&&(!t?.accept||t.accept(e))?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});return t?.from&&(a.currentNode=t.from),a}var Nq=class e{constructor(){this.fastMap=new Map,this.root=new Pq({scopeRef:null}),this.fastMap.set(null,this.root)}get size(){return this.fastMap.size}getTreeNode(e){return this.fastMap.get(e)}addTreeNode(e,t,n){let r=this.fastMap.get(t??null);if(!r)return;let i=new Pq({scopeRef:e});r.addChild(i),i.parent=r,this.fastMap.set(e,i),n&&(i.nodeToRestore=n)}addNode(e){this.fastMap.set(e.scopeRef,e)}removeTreeNode(e){if(e===null)return;let t=this.fastMap.get(e);if(!t)return;let n=t.parent;for(let e of this.traverse())e!==t&&t.nodeToRestore&&e.nodeToRestore&&t.scopeRef&&t.scopeRef.current&&xq(e.nodeToRestore,t.scopeRef.current)&&(e.nodeToRestore=t.nodeToRestore);let r=t.children;n&&(n.removeChild(t),r.size>
4660&&r.forEach(e=>n&&n.addChild(e))),this.fastMap.delete(t.scopeRef)}*traverse(e=this.root){if(e.scopeRef!=null&&(yield e),e.children.size>0)for(let t of e.children)yield*this.traverse(t)}clone(){let t=new e;for(let e of this.traverse())t.addTreeNode(e.scopeRef,e.parent?.scopeRef??null,e.nodeToRestore);return t}},Pq=class{constructor(e){this.children=new Set,this.contain=!1,this.scopeRef=e.scopeRef}addChild(e){this.children.add(e),e.parent=this}removeChild(e){this.children.delete(e),e.parent=void 0}},Fq=new Nq,Iq=n(((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0?t.exports=r():typeof define==`function`&&define.amd?define(r):(n=typeof globalThis<`u`?globalThis:n||self).dayjs_plugin_updateLocale=r()})(e,(function(){function e(){return e=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},e.apply(this,arguments)}return function(t,n,r){r.updateLocale=function(t,n){var i=r.Ls[t];if(i)return(n?Object.keys(n):[]).forEach((function(t){i[t]&&n[t]&&typeof i[t]==`object`&&typeof n[t]==`object`&&!Array.isArray(i[t])?i[t]=e({},i[t],n[t]):i[t]=n[t]})),i}}}))})),Lq=n(((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0?t.exports=r():typeof define==`function`&&define.amd?define(r):(n=typeof globalThis<`u`?globalThis:n||self).dayjs_plugin_localeData=r()})(e,(function(){return function(e,t,n){var r=t.prototype,i=function(e){return e&&(e.indexOf?e:e.s)},a=function(e,t,n,r,a){var o=e.name?e:e.$locale(),s=i(o[t]),c=i(o[n]),l=s||c.map((function(e){return e.slice(0,r)}));if(!a)return l;var u=o.weekStart;return l.map((function(e,t){return l[(t+(u||0))%7]}))},o=function(){return n.Ls[n.locale()]},s=function(e,t){return e.formats[t]||function(e){return e.replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,(function(e,t,n){return t||n.slice(1)}))}(e.formats[t.toUpperCase()])},c=function(){var e=this;return{months:function(t){return t?t.format(`MMMM`):a(e,`months`)},monthsShort:function(t){return t?t.format(`MMM`):a(e,`monthsShort`,`months`,3)},firstDayOfWeek:function(){return e.$locale().weekStart||0},weekdays:function(t){return t?t.format(`dddd`):a(e,`weekdays`)},weekdaysMin:function(t){return t?t.format(`dd`):a(e,`weekdaysMin`,`weekdays`,2)},weekdaysShort:function(t){return t?t.format(`ddd`):a(e,`weekdaysShort`,`weekdays`,3)},longDateFormat:function(t){return s(e.$locale(),t)},meridiem:this.$locale().meridiem,ordinal:this.$locale().ordinal}};r.localeData=function(){return c.bind(this)()},n.localeData=function(){var e=o();return{firstDayOfWeek:function(){return e.weekStart||0},weekdays:function(){return n.weekdays()},weekdaysShort:function(){return n.weekdaysShort()},weekdaysMin:function(){return n.weekdaysMin()},months:function(){return n.months()},monthsShort:function(){return n.monthsShort()},longDateFormat:function(t){return s(e,t)},meridiem:e.meridiem,ordinal:e.ordinal}},n.months=function(){return a(o(),`months`)},n.monthsShort=function(){return a(o(),`monthsShort`,`months`,3)},n.weekdays=function(e){return a(o(),`weekdays`,null,null,e)},n.weekdaysShort=function(e){return a(o(),`weekdaysShort`,`weekdays`,3,e)},n.weekdaysMin=function(e){return a(o(),`weekdaysMin`,`weekdays`,2,e)}}}))})),Rq=n(((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0?t.exports=r():typeof define==`function`&&define.amd?define(r):(n=typeof globalThis<`u`?globalThis:n||self).dayjs_plugin_relativeTime=r()})(e,(function(){return function(e,t,n){e||={};var r=t.prototype,i={future:`in %s`,past:`%s ago`,s:`a few seconds`,m:`a minute`,mm:`%d minutes`,h:`an hour`,hh:`%d hours`,d:`a day`,dd:`%d days`,M:`a month`,MM:`%d months`,y:`a year`,yy:`%d years`};function a(e,t,n,i){return r.fromToBase(e,t,n,i)}n.en.relativeTime=i,r.fromToBase=function(t,r,a,o,s){for(var c,l,u,d=a.$locale().relativeTime||i,f=e.thresholds||[{l:`s`,r:44,d:`second`},{l:`m`,r:89},{l:`mm`,r:44,d:`minute`},{l:`h`,r:89},{l:`hh`,r:21,d:`hour`},{l:`d`,r:35},{l:`dd`,r:25,d:`day`},{l:`M`,r:45},{l:`MM`,r:10,d:`month`},{l:`y`,r:17},{l:`yy`,d:`year`}],p=f.length,m=0;m<p;m+=1){var h=f[m];h.d&&(c=o?n(t).diff(a,h.d,!0):a.diff(t,h.d,!0));var g=(e.rounding||Math.round)(Math.abs(c));if(u=c>0,g<=h.r||!h.r){g<=1&&m>0&&(h=f[m-1]);var _=d[h.l];s&&(g=s(``+g)),l=typeof _==`string`?_.replace(`%d`,g):_(g,r,h.l,u);break}}if(r)return l;var v=u?d.future:d.past;return typeof v==`function`?v(l):v.replace(`%s`,l)},r.to=function(e,t){return a(e,t,this,!0)},r.from=function(e,t){return a(e,t,this)};var o=function(e){return e.$u?n.utc():n()};r.toNow=function(e){return this.to(o(this),e)},r.fromNow=function(e){return this.from(o(this),e)}}}))})),zq=n(((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0?t.exports=r():typeof define==`function`&&define.amd?define(r):(n=typeof globalThis<`u`?globalThis:n||self).dayjs_plugin_duration=r()})(e,(function(){var e,t,n=1e3,r=6e4,i=36e5,a=864e5,o=31536e6,s=2628e6,c=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/,l=/\[([^\]]+)]|YYYY|YY|Y|M{1,2}|D{1,2}|H{1,2}|m{1,2}|s{1,2}|SSS/g,u={years:o,months:s,days:a,hours:i,minutes:r,seconds:n,milliseconds:1,weeks:6048e5},d=function(e){return e instanceof v},f=function(e,t,n){return new v(e,n,t.$l)},p=function(e){return t.p(e)+`s`},m=function(e){return e<0},h=function(e){return m(e)?Math.ceil(e):Math.floor(e)},g=function(e){return Math.abs(e)},_=function(e,t){return e?m(e)?{negative:!0,format:``+g(e)+t}:{negative:!1,format:``+e+t}:{negative:!1,format:``}},v=function(){function m(e,t,n){var r=this;if(this.$d={},this.$l=n,e===void 0&&(this.$ms=0,this.parseFromMilliseconds()),t)return f(e*u[p(t)],this);if(typeof e==`number`)return this.$ms=e,this.parseFromMilliseconds(),this;if(typeof e==`object`)return Object.keys(e).forEach((function(t){r.$d[p(t)]=e[t]})),this.calMilliseconds(),this;if(typeof e==`string`){var i=e.match(c);if(i){var a=i.slice(2).map((function(e){return e==null?0:Number(e)}));return this.$d.years=a[0],this.$d.months=a[1],this.$d.weeks=a[2],this.$d.days=a[3],this.$d.hours=a[4],this.$d.minutes=a[5],this.$d.seconds=a[6],this.calMilliseconds(),this}}return this}var g=m.prototype;return g.calMilliseconds=function(){var e=this;this.$ms=Object.keys(this.$d).reduce((function(t,n){return t+(e.$d[n]||0)*u[n]}),0)},g.parseFromMilliseconds=function(){var e=this.$ms;this.$d.years=h(e/o),e%=o,this.$d.months=h(e/s),e%=s,this.$d.days=h(e/a),e%=a,this.$d.hours=h(e/i),e%=i,this.$d.minutes=h(e/r),e%=r,this.$d.seconds=h(e/n),e%=n,this.$d.milliseconds=e},g.toISOString=function(){var e=_(this.$d.years,`Y`),t=_(this.$d.months,`M`),n=+this.$d.days||0;this.$d.weeks&&(n+=7*this.$d.weeks);var r=_(n,`D`),i=_(this.$d.hours,`H`),a=_(this.$d.minutes,`M`),o=this.$d.seconds||0;this.$d.milliseconds&&(o+=this.$d.milliseconds/1e3,o=Math.round(1e3*o)/1e3);var s=_(o,`S`),c=e.negative||t.negative||r.negative||i.negative||a.negative||s.negative,l=i.format||a.format||s.format?`T`:``,u=(c?`-`:``)+`P`+e.format+t.format+r.format+l+i.format+a.format
466+s.format;return u===`P`||u===`-P`?`P0D`:u},g.toJSON=function(){return this.toISOString()},g.format=function(e){var n=e||`YYYY-MM-DDTHH:mm:ss`,r={Y:this.$d.years,YY:t.s(this.$d.years,2,`0`),YYYY:t.s(this.$d.years,4,`0`),M:this.$d.months,MM:t.s(this.$d.months,2,`0`),D:this.$d.days,DD:t.s(this.$d.days,2,`0`),H:this.$d.hours,HH:t.s(this.$d.hours,2,`0`),m:this.$d.minutes,mm:t.s(this.$d.minutes,2,`0`),s:this.$d.seconds,ss:t.s(this.$d.seconds,2,`0`),SSS:t.s(this.$d.milliseconds,3,`0`)};return n.replace(l,(function(e,t){return t||String(r[e])}))},g.as=function(e){return this.$ms/u[p(e)]},g.get=function(e){var t=this.$ms,n=p(e);return n===`milliseconds`?t%=1e3:t=n===`weeks`?h(t/u[n]):this.$d[n],t||0},g.add=function(e,t,n){var r;return r=t?e*u[p(t)]:d(e)?e.$ms:f(e,this).$ms,f(this.$ms+r*(n?-1:1),this)},g.subtract=function(e,t){return this.add(e,t,!0)},g.locale=function(e){var t=this.clone();return t.$l=e,t},g.clone=function(){return f(this.$ms,this)},g.humanize=function(t){return e().add(this.$ms,`ms`).locale(this.$l).fromNow(!t)},g.valueOf=function(){return this.asMilliseconds()},g.milliseconds=function(){return this.get(`milliseconds`)},g.asMilliseconds=function(){return this.as(`milliseconds`)},g.seconds=function(){return this.get(`seconds`)},g.asSeconds=function(){return this.as(`seconds`)},g.minutes=function(){return this.get(`minutes`)},g.asMinutes=function(){return this.as(`minutes`)},g.hours=function(){return this.get(`hours`)},g.asHours=function(){return this.as(`hours`)},g.days=function(){return this.get(`days`)},g.asDays=function(){return this.as(`days`)},g.weeks=function(){return this.get(`weeks`)},g.asWeeks=function(){return this.as(`weeks`)},g.months=function(){return this.get(`months`)},g.asMonths=function(){return this.as(`months`)},g.years=function(){return this.get(`years`)},g.asYears=function(){return this.as(`years`)},m}(),y=function(e,t,n){return e.add(t.years()*n,`y`).add(t.months()*n,`M`).add(t.days()*n,`d`).add(t.hours()*n,`h`).add(t.minutes()*n,`m`).add(t.seconds()*n,`s`).add(t.milliseconds()*n,`ms`)};return function(n,r,i){e=i,t=i().$utils(),i.duration=function(e,t){return f(e,{$l:i.locale()},t)},i.isDuration=d;var a=r.prototype.add,o=r.prototype.subtract;r.prototype.add=function(e,t){return d(e)?y(this,e,1):a.bind(this)(e,t)},r.prototype.subtract=function(e,t){return d(e)?y(this,e,-1):o.bind(this)(e,t)}}}))})),Bq=n(((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0?t.exports=r():typeof define==`function`&&define.amd?define(r):(n=typeof globalThis<`u`?globalThis:n||self).dayjs_plugin_utc=r()})(e,(function(){var e=`minute`,t=/[+-]\d\d(?::?\d\d)?/g,n=/([+-]|\d\d)/g;return function(r,i,a){var o=i.prototype;a.utc=function(e){return new i({date:e,utc:!0,args:arguments})},o.utc=function(t){var n=a(this.toDate(),{locale:this.$L,utc:!0});return t?n.add(this.utcOffset(),e):n},o.local=function(){return a(this.toDate(),{locale:this.$L,utc:!1})};var s=o.parse;o.parse=function(e){e.utc&&(this.$u=!0),this.$utils().u(e.$offset)||(this.$offset=e.$offset),s.call(this,e)};var c=o.init;o.init=function(){if(this.$u){var e=this.$d;this.$y=e.getUTCFullYear(),this.$M=e.getUTCMonth(),this.$D=e.getUTCDate(),this.$W=e.getUTCDay(),this.$H=e.getUTCHours(),this.$m=e.getUTCMinutes(),this.$s=e.getUTCSeconds(),this.$ms=e.getUTCMilliseconds()}else c.call(this)};var l=o.utcOffset;o.utcOffset=function(r,i){var a=this.$utils().u;if(a(r))return this.$u?0:a(this.$offset)?l.call(this):this.$offset;if(typeof r==`string`&&(r=function(e){e===void 0&&(e=``);var r=e.match(t);if(!r)return null;var i=(``+r[0]).match(n)||[`-`,0,0],a=i[0],o=60*i[1]+ +i[2];return o===0?0:a===`+`?o:-o}(r),r===null))return this;var o=Math.abs(r)<=16?60*r:r;if(o===0)return this.utc(i);var s=this.clone();if(i)return s.$offset=o,s.$u=!1,s;var c=this.$u?this.toDate().getTimezoneOffset():-1*this.utcOffset();return(s=this.local().add(o+c,e)).$offset=o,s.$x.$localOffset=c,s};var u=o.format;o.format=function(e){var t=e||(this.$u?`YYYY-MM-DDTHH:mm:ss[Z]`:``);return u.call(this,t)},o.valueOf=function(){var e=this.$utils().u(this.$offset)?0:this.$offset+(this.$x.$localOffset||this.$d.getTimezoneOffset());return this.$d.valueOf()-6e4*e},o.isUTC=function(){return!!this.$u},o.toISOString=function(){return this.toDate().toISOString()},o.toString=function(){return this.toDate().toUTCString()};var d=o.toDate;o.toDate=function(e){return e===`s`&&this.$offset?a(this.format(`YYYY-MM-DD HH:mm:ss:SSS`)).toDate():d.call(this)};var f=o.diff;o.diff=function(e,t,n){if(e&&this.$u===e.$u)return f.call(this,e,t,n);var r=this.local(),i=a(e).local();return f.call(r,i,t,n)}}}))})),Vq=n(((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0?t.exports=r():typeof define==`function`&&define.amd?define(r):(n=typeof globalThis<`u`?globalThis:n||self).dayjs_plugin_timezone=r(
466)})(e,(function(){var e={year:0,month:1,day:2,hour:3,minute:4,second:5},t={};return function(n,r,i){var a,o=function(e,n,r){r===void 0&&(r={});var i=new Date(e);return function(e,n){n===void 0&&(n={});var r=n.timeZoneName||`short`,i=e+`|`+r,a=t[i];return a||(a=new Intl.DateTimeFormat(`en-US`,{hour12:!1,timeZone:e,year:`numeric`,month:`2-digit`,day:`2-digit`,hour:`2-digit`,minute:`2-digit`,second:`2-digit`,timeZoneName:r}),t[i]=a),a}(n,r).formatToParts(i)},s=function(t,n){for(var r=o(t,n),a=[],s=0;s<r.length;s+=1){var c=r[s],l=c.type,u=c.value,d=e[l];d>=0&&(a[d]=parseInt(u,10))}var f=a[3],p=f===24?0:f,m=a[0]+`-`+a[1]+`-`+a[2]+` `+p+`:`+a[4]+`:`+a[5]+`:000`,h=+t;return(i.utc(m).valueOf()-(h-=h%1e3))/6e4},c=r.prototype;c.tz=function(e,t){e===void 0&&(e=a);var n,r=this.utcOffset(),o=this.toDate(),s=o.toLocaleString(`en-US`,{timeZone:e}),c=Math.round((o-new Date(s))/1e3/60),l=15*-Math.round(o.getTimezoneOffset()/15)-c;if(!Number(l))n=this.utcOffset(0,t);else if(n=i(s,{locale:this.$L}).$set(`millisecond`,this.$ms).utcOffset(l,!0),t){var u=n.utcOffset();n=n.add(r-u,`minute`)}return n.$x.$timezone=e,n},c.offsetName=function(e){var t=this.$x.$timezone||i.tz.guess(),n=o(this.valueOf(),t,{timeZoneName:e}).find((function(e){return e.type.toLowerCase()===`timezonename`}));return n&&n.value};var l=c.startOf;c.startOf=function(e,t){if(!this.$x||!this.$x.$timezone)return l.call(this,e,t);var n=i(this.format(`YYYY-MM-DD HH:mm:ss:SSS`),{locale:this.$L});return l.call(n,e,t).tz(this.$x.$timezone,!0)},i.tz=function(e,t,n){var r=n&&t,o=n||t||a,c=s(+i(),o);if(typeof e!=`string`)return i(e).tz(o);var l=function(e,t,n){var r=e-60*t*1e3,i=s(r,n);if(t===i)return[r,t];var a=s(r-=60*(i-t)*1e3,n);return i===a?[r,i]:[e-60*Math.min(i,a)*1e3,Math.max(i,a)]}(i.utc(e,r).valueOf(),c,o),u=l[0],d=l[1],f=i(u).utcOffset(d);return f.$x.$timezone=o,f},i.tz.guess=function(){return Intl.DateTimeFormat().resolvedOptions().timeZone},i.tz.setDefault=function(e){a=e}}}))})),Hq=n(((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0?t.exports=r(SB()):typeof define==`function`&&define.amd?define([`dayjs`],r):(n=typeof globalThis<`u`?globalThis:n||self).dayjs_locale_de=r(n.dayjs)})(e,(function(e){function t(e){return e&&typeof e==`object`&&`default`in e?e:{default:e}}var n=t(e),r={s:`ein paar Sekunden`,m:[`eine Minute`,`einer Minute`],mm:`%d Minuten`,h:[`eine Stunde`,`einer Stunde`],hh:`%d Stunden`,d:[`ein Tag`,`einem Tag`],dd:[`%d Tage`,`%d Tagen`],M:[`ein Monat`,`einem Monat`],MM:[`%d Monate`,`%d Monaten`],y:[`ein Jahr`,`einem Jahr`],yy:[`%d Jahre`,`%d Jahren`]};function i(e,t,n){var i=r[n];return Array.isArray(i)&&(i=i[+!t]),i.replace(`%d`,e)}var a={name:`de`,weekdays:`Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag`.split(`_`),weekdaysShort:`So._Mo._Di._Mi._Do._Fr._Sa.`.split(`_`),weekdaysMin:`So_Mo_Di_Mi_Do_Fr_Sa`.split(`_`),months:`Januar_Februar_März_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember`.split(`_`),monthsShort:`Jan._Feb._März_Apr._Mai_Juni_Juli_Aug._Sept._Okt._Nov._Dez.`.split(`_`),ordinal:function(e){return e+`.`},weekStart:1,yearStart:4,formats:{LTS:`HH:mm:ss`,LT:`HH:mm`,L:`DD.MM.YYYY`,LL:`D. MMMM YYYY`,LLL:`D. MMMM YYYY HH:mm`,LLLL:`dddd, D. MMMM YYYY HH:mm`},relativeTime:{future:`in %s`,past:`vor %s`,s:i,m:i,mm:i,h:i,hh:i,d:i,dd:i,M:i,MM:i,y:i,yy:i}};return n.default.locale(a,null,!0),a}))})),Uq=n(((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0?t.exports=r(SB()):typeof define==`function`&&define.amd?define([`dayjs`],r):(n=typeof globalThis<`u`?globalThis:n||self).dayjs_locale_es=r(n.dayjs)})(e,(function(e){function t(e){return e&&typeof e==`object`&&`default`in e?e:{default:e}}var n=t(e),r={name:`es`,monthsShort:`ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic`.split(`_`),weekdays:`domingo_lunes_martes_miércoles_jueves_viernes_sábado`.split(`_`),weekdaysShort:`dom._lun._mar._mié._jue._vie._sáb.`.split(`_`),weekdaysMin:`do_lu_ma_mi_ju_vi_sá`.split(`_`),months:`enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre`.split(`_`),weekStart:1,formats:{LT:`H:mm`,LTS:`H:mm:ss`,L:`DD/MM/YYYY`,LL:`D [de] MMMM [de] YYYY`,LLL:`D [de] MMMM [de] YYYY H:mm`,
466LLLL:`dddd, D [de] MMMM [de] YYYY H:mm`},relativeTime:{future:`en %s`,past:`hace %s`,s:`unos segundos`,m:`un minuto`,mm:`%d minutos`,h:`una hora`,hh:`%d horas`,d:`un día`,dd:`%d días`,M:`un mes`,MM:`%d meses`,y:`un año`,yy:`%d años`},ordinal:function(e){return e+`º`}};return n.default.locale(r,null,!0),r}))})),Wq=n(((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0?t.exports=r(SB()):typeof define==`function`&&define.amd?define([`dayjs`],r):(n=typeof globalThis<`u`?globalThis:n||self).dayjs_locale_fr=r(n.dayjs)})(e,(function(e){function t(e){return e&&typeof e==`object`&&`default`in e?e:{default:e}}var n=t(e),r={name:`fr`,weekdays:`dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi`.split(`_`),weekdaysShort:`dim._lun._mar._mer._jeu._ven._sam.`.split(`_`),weekdaysMin:`di_lu_ma_me_je_ve_sa`.split(`_`),months:`janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre`.split(`_`),monthsShort:`janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.`.split(`_`),weekStart:1,yearStart:4,formats:{LT:`HH:mm`,LTS:`HH:mm:ss`,L:`DD/MM/YYYY`,LL:`D MMMM YYYY`,LLL:`D MMMM YYYY HH:mm`,LLLL:`dddd D MMMM YYYY HH:mm`},relativeTime:{future:`dans %s`,past:`il y a %s`,s:`quelques secondes`,m:`une minute`,mm:`%d minutes`,h:`une heure`,hh:`%d heures`,d:`un jour`,dd:`%d jours`,M:`un mois`,MM:`%d mois`,y:`un an`,yy:`%d ans`},ordinal:function(e){return``+e+(e===1?`er`:``)}};return n.default.locale(r,null,!0),r}))})),Gq=n(((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0?t.exports=r(SB()):typeof define==`function`&&define.amd?define([`dayjs`],r):(n=typeof globalThis<`u`?globalThis:n||self).dayjs_locale_hi=r(n.dayjs)})(e,(function(e){function t(e){return e&&typeof e==`object`&&`default`in e?e:{default:e}}var n=t(e),r={name:`hi`,weekdays:`रविवार_सोमवार_मंगलवार_बुधवार_गुरूवार_शुक्रवार_शनिवार`.split(`_`),months:`जनवरी_फ़रवरी_मार्च_अप्रैल_मई_जून_जुलाई_अगस्त_सितम्बर_अक्टूबर_नवम्बर_दिसम्बर`.split(`_`),weekdaysShort:`रवि_सोम_मंगल_बुध_गुरू_शुक्र_शनि`.split(`_`),monthsShort:`जन._फ़र._मार्च_अप्रै._मई_जून_जुल._अग._सित._अक्टू._नव._दिस.`.split(`_`),weekdaysMin:`र_सो_मं_बु_गु_शु_श`.split(`_`),ordinal:function(e){return e},formats:{LT:`A h:mm बजे`,LTS:`A h:mm:ss बजे`,L:`DD/MM/YYYY`,LL:`D MMMM YYYY`,LLL:`D MMMM YYYY, A h:mm बजे`,LLLL:`dddd, D MMMM YYYY, A h:mm बजे`},relativeTime:{future:`%s में`,past:`%s पहले`,s:`कुछ ही क्षण`,m:`एक मिनट`,mm:`%d मिनट`,h:`एक घंटा`,hh:`%d घंटे`,d:`एक दिन`,dd:`%d दिन`,M:`एक महीने`,MM:`%d महीने`,y:`एक वर्ष`,yy:`%d वर्ष`}};return n.default.locale(r,null,!0),r}))})),Kq=n(((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0?t.exports=r(SB()):typeof define==`function`&&define.amd?define([`dayjs`],r):(n=typeof globalThis<`u`?globalThis:n||self).dayjs_locale_it=r(n.dayjs)})(e,(function(e){function t(e){return e&&typeof e==`object`&&`default`in e?e:{default:e}}var n=t(e),r={name:`it`,weekdays:`domenica_lunedì_martedì_mercoledì_giovedì_venerdì_sabato`.split(`_`),weekdaysShort:`dom_lun_mar_mer_gio_ven_sab`.split(`_`),weekdaysMin:`do_lu_ma_me_gi_ve_sa`.split(`_`),months:`gennaio_febbraio_marzo_aprile_maggio_giugno_luglio_agosto_settembre_ottobre_novembre_dicembre`.split(`_`),weekStart:1,monthsShort:`gen_feb_mar_apr_mag_giu_lug_ago_set_ott_nov_dic`.split(`_`),formats:{LT:`HH:mm`,LTS:`HH:mm:ss`,L:`DD/MM/YYYY`,LL:`D MMMM YYYY`,LLL:`D MMMM YYYY HH:mm`,LLLL:`dddd D MMMM YYYY HH:mm`},relativeTime:{future:`tra %s`,past:`%s fa`,s:`qualche secondo`,m:`un minuto`,mm:`%d minuti`,h:`un'ora`,hh:`%d ore`,d:`un giorno`,dd:`%d giorni`,M:`un mese`,MM:`%d mesi`,y:`un anno`,yy:`%d anni`},ordinal:function(e){return e+`º`}};return n.default.locale(r,null,!0),r}))})),qq=n(((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0?t.exports=r(SB()):typeof define==`function`&&define.amd?define([`dayjs`],r):(n=typeof globalThis<`u`?globalThis:n||self).dayjs_locale_ja=r(n.dayjs)})(e,(function(e){function t(e){return e&&typeof e==`object`&&`default`in e?e:{default:e}}var n=t(e),r={name:`ja`,weekdays:`日曜日_月曜日_火曜日_水曜日_木曜日_金曜日_土曜日`.split(`_`),weekdaysShort:`日_月_火_水_木_金_土`.split(`_`),weekdaysMin:`日_月_火_水_木_金_土`.split(`_`),months:`1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月`.split(`_`),monthsShort:`1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月`.split(`_`),ordinal:function(e){return e+`日`},formats:{LT:`HH:mm`,LTS:`HH:mm:ss`,L:`YYYY/MM/DD`,LL:`YYYY年M月D日`,LLL:`YYYY年M月D日 HH:mm`,LLLL:`YYYY年M月D日 dddd HH:mm`,l:`YYYY/MM/DD`,ll:`YYYY年M月D日`,lll:`YYYY年M月D日 HH:mm`,llll:`YYYY年M月D日(ddd) HH:mm`}
466,meridiem:function(e){return e<12?`午前`:`午後`},relativeTime:{future:`%s後`,past:`%s前`,s:`数秒`,m:`1分`,mm:`%d分`,h:`1時間`,hh:`%d時間`,d:`1日`,dd:`%d日`,M:`1ヶ月`,MM:`%dヶ月`,y:`1年`,yy:`%d年`}};return n.default.locale(r,null,!0),r}))})),Jq=n(((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0?t.exports=r(SB()):typeof define==`function`&&define.amd?define([`dayjs`],r):(n=typeof globalThis<`u`?globalThis:n||self).dayjs_locale_ko=r(n.dayjs)})(e,(function(e){function t(e){return e&&typeof e==`object`&&`default`in e?e:{default:e}}var n=t(e),r={name:`ko`,weekdays:`일요일_월요일_화요일_수요일_목요일_금요일_토요일`.split(`_`),weekdaysShort:`일_월_화_수_목_금_토`.split(`_`),weekdaysMin:`일_월_화_수_목_금_토`.split(`_`),months:`1월_2월_3월_4월_5월_6월_7월_8월_9월_10월_11월_12월`.split(`_`),monthsShort:`1월_2월_3월_4월_5월_6월_7월_8월_9월_10월_11월_12월`.split(`_`),ordinal:function(e){return e+`일`},formats:{LT:`A h:mm`,LTS:`A h:mm:ss`,L:`YYYY.MM.DD.`,LL:`YYYY년 MMMM D일`,LLL:`YYYY년 MMMM D일 A h:mm`,LLLL:`YYYY년 MMMM D일 dddd A h:mm`,l:`YYYY.MM.DD.`,ll:`YYYY년 MMMM D일`,lll:`YYYY년 MMMM D일 A h:mm`,llll:`YYYY년 MMMM D일 dddd A h:mm`},meridiem:function(e){return e<12?`오전`:`오후`},relativeTime:{future:`%s 후`,past:`%s 전`,s:`몇 초`,m:`1분`,mm:`%d분`,h:`한 시간`,hh:`%d시간`,d:`하루`,dd:`%d일`,M:`한 달`,MM:`%d달`,y:`일 년`,yy:`%d년`}};return n.default.locale(r,null,!0),r}))})),Yq=n(((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0?t.exports=r(SB()):typeof define==`function`&&define.amd?define([`dayjs`],r):(n=typeof globalThis<`u`?globalThis:n||self).dayjs_locale_nl=r(n.dayjs)})(e,(function(e){function t(e){return e&&typeof e==`object`&&`default`in e?e:{default:e}}var n=t(e),r={name:`nl`,weekdays:`zondag_maandag_dinsdag_woensdag_donderdag_vrijdag_zaterdag`.split(`_`),weekdaysShort:`zo._ma._di._wo._do._vr._za.`.split(`_`),weekdaysMin:`zo_ma_di_wo_do_vr_za`.split(`_`),months:`januari_februari_maart_april_mei_juni_juli_augustus_september_oktober_november_december`.split(`_`),monthsShort:`jan_feb_mrt_apr_mei_jun_jul_aug_sep_okt_nov_dec`.split(`_`),ordinal:function(e){return`[`+e+(e===1||e===8||e>=20?`ste`:`de`)+`]`},weekStart:1,yearStart:4,formats:{LT:`HH:mm`,LTS:`HH:mm:ss`,L:`DD-MM-YYYY`,LL:`D MMMM YYYY`,LLL:`D MMMM YYYY HH:mm`,LLLL:`dddd D MMMM YYYY HH:mm`},relativeTime:{future:`over %s`,past:`%s geleden`,s:`een paar seconden`,m:`een minuut`,mm:`%d minuten`,h:`een uur`,hh:`%d uur`,d:`een dag`,dd:`%d dagen`,M:`een maand`,MM:`%d maanden`,y:`een jaar`,yy:`%d jaar`}};return n.default.locale(r,null,!0),r}))})),Xq=n(((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0?t.exports=r(SB()):typeof define==`function`&&define.amd?define([`dayjs`],r):(n=typeof globalThis<`u`?globalThis:n||self).dayjs_locale_pt=r(n.dayjs)})(e,(function(e){function t(e){return e&&typeof e==`object`&&`default`in e?e:{default:e}}var n=t(e),r={name:`pt`,weekdays:`domingo_segunda-feira_terça-feira_quarta-feira_quinta-feira_sexta-feira_sábado`.split(`_`),weekdaysShort:`dom_seg_ter_qua_qui_sex_sab`.split(`_`),weekdaysMin:`Do_2ª_3ª_4ª_5ª_6ª_Sa`.split(`_`),months:`janeiro_fevereiro_março_abril_maio_junho_julho_agosto_setembro_outubro_novembro_dezembro`.split(`_`),monthsShort:`jan_fev_mar_abr_mai_jun_jul_ago_set_out_nov_dez`.split(`_`),ordinal:function(e){return e+`º`},weekStart:1,yearStart:4,formats:{LT:`HH:mm`,LTS:`HH:mm:ss`,L:`DD/MM/YYYY`,LL:`D [de] MMMM [de] YYYY`,LLL:`D [de] MMMM [de] YYYY [às] HH:mm`,LLLL:`dddd, D [de] MMMM [de] YYYY [às] HH:mm`},relativeTime:{future:`em %s`,past:`há %s`,s:`alguns segundos`,m:`um minuto`,mm:`%d minutos`,h:`uma hora`,hh:`%d horas`,d:`um dia`,dd:`%d dias`,M:`um mês`,MM:`%d meses`,y:`um ano`,yy:`%d anos`}};return n.default.locale(r,null,!0),r}))})),Zq=n(((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0?t.exports=r(SB()):typeof define==`function`&&define.amd?define([`dayjs`],r):(n=typeof globalThis<`u`?globalThis:n||self).dayjs_locale_ru=r(n.dayjs)})(e,(function(e){function t(e){return e&&typeof e==`object`&&`default`in e?e:{default:e}}var n=t(e),r=`января_февраля_марта_апреля_мая_июня_июля_августа_сентября_октября_ноября_декабря`.split(`_`),i=`январь_февраль_март_апрель_май_июнь_июль_август_сентябрь_октябрь_ноябрь_декабрь`.split(`_`),a=`янв._февр._мар._апр._мая_июня_июля_авг._сент._окт._нояб._дек.`.split(`_`),o=`янв._февр._март_апр._май_июнь_июль_авг._сент._окт._нояб._дек.`.split(`_`),s=/
466D[oD]?(\[[^[\]]*\]|\s)+MMMM?/;function c(e,t,n){var r,i;return n===`m`?t?`минута`:`минуту`:e+` `+(r=+e,i={mm:t?`минута_минуты_минут`:`минуту_минуты_минут`,hh:`час_часа_часов`,dd:`день_дня_дней`,MM:`месяц_месяца_месяцев`,yy:`год_года_лет`}[n].split(`_`),r%10==1&&r%100!=11?i[0]:r%10>=2&&r%10<=4&&(r%100<10||r%100>=20)?i[1]:i[2])}var l=function(e,t){return s.test(t)?r[e.month()]:i[e.month()]};l.s=i,l.f=r;var u=function(e,t){return s.test(t)?a[e.month()]:o[e.month()]};u.s=o,u.f=a;var d={name:`ru`,weekdays:`воскресенье_понедельник_вторник_среда_четверг_пятница_суббота`.split(`_`),weekdaysShort:`вск_пнд_втр_срд_чтв_птн_сбт`.split(`_`),weekdaysMin:`вс_пн_вт_ср_чт_пт_сб`.split(`_`),months:l,monthsShort:u,weekStart:1,yearStart:4,formats:{LT:`H:mm`,LTS:`H:mm:ss`,L:`DD.MM.YYYY`,LL:`D MMMM YYYY г.`,LLL:`D MMMM YYYY г., H:mm`,LLLL:`dddd, D MMMM YYYY г., H:mm`},relativeTime:{future:`через %s`,past:`%s назад`,s:`несколько секунд`,m:c,mm:c,h:`час`,hh:c,d:`день`,dd:c,M:`месяц`,MM:c,y:`год`,yy:c},ordinal:function(e){return e},meridiem:function(e){return e<4?`ночи`:e<12?`утра`:e<17?`дня`:`вечера`}};return n.default.locale(d,null,!0),d}))})),Qq=n(((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0?t.exports=r(SB()):typeof define==`function`&&define.amd?define([`dayjs`],r):(n=typeof globalThis<`u`?globalThis:n||self).dayjs_locale_tr=r(n.dayjs)})(e,(function(e){function t(e){return e&&typeof e==`object`&&`default`in e?e:{default:e}}var n=t(e),r={name:`tr`,weekdays:`Pazar_Pazartesi_Salı_Çarşamba_Perşembe_Cuma_Cumartesi`.split(`_`),weekdaysShort:`Paz_Pts_Sal_Çar_Per_Cum_Cts`.split(`_`),weekdaysMin:`Pz_Pt_Sa_Ça_Pe_Cu_Ct`.split(`_`),months:`Ocak_Şubat_Mart_Nisan_Mayıs_Haziran_Temmuz_Ağustos_Eylül_Ekim_Kasım_Aralık`.split(`_`),monthsShort:`Oca_Şub_Mar_Nis_May_Haz_Tem_Ağu_Eyl_Eki_Kas_Ara`.split(`_`),weekStart:1,formats:{LT:`HH:mm`,LTS:`HH:mm:ss`,L:`DD.MM.YYYY`,LL:`D MMMM YYYY`,LLL:`D MMMM YYYY HH:mm`,LLLL:`dddd, D MMMM YYYY HH:mm`},relativeTime:{future:`%s sonra`,past:`%s önce`,s:`birkaç saniye`,m:`bir dakika`,mm:`%d dakika`,h:`bir saat`,hh:`%d saat`,d:`bir gün`,dd:`%d gün`,M:`bir ay`,MM:`%d ay`,y:`bir yıl`,yy:`%d yıl`},ordinal:function(e){return e+`.`}};return n.default.locale(r,null,!0),r}))})),$q=n(((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0?t.exports=r():typeof define==`function`&&define.amd?define(r):(n=typeof globalThis<`u`?globalThis:n||self).dayjs_locale_en=r()})(e,(function(){return{name:`en`,weekdays:`Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday`.split(`_`),months:`January_February_March_April_May_June_July_August_September_October_November_December`.split(`_`),ordinal:function(e){var t=[`th`,`st`,`nd`,`rd`],n=e%100;return`[`+e+(t[(n-20)%10]||t[n]||t[0])+`]`}}}))})),eJ=(function(e){if(e==null)return aJ;if(typeof e==`function`)return iJ(e);if(typeof e==`object`)return Array.isArray(e)?tJ(e):nJ(e);if(typeof e==`string`)return rJ(e);throw Error(`Expected function, string, or object as test`)});function tJ(e){let t=[],n=-1;for(;++n<e.length;)t[n]=eJ(e[n]);return iJ(r);function r(...e){let n=-1;for(;++n<t.length;)if(t[n].apply(this,e))return!0;return!1}}function nJ(e){let t=e;return iJ(n);function n(n){let r=n,i;for(i in e)if(r[i]!==t[i])return!1;return!0}}function rJ(e){return iJ(t);function t(t){return t&&t.type===e}}function iJ(e){return t;
vendor: 1,472 bytes, line 466
466function t(t,n,r){return!!(oJ(t)&&e.call(this,t,typeof n==`number`?n:void 0,r||void 0))}}function aJ(){return!0}function oJ(e){return typeof e==`object`&&!!e&&`type`in e}function sJ(e){return e}var cJ=[],lJ=`skip`;function uJ(e,t,n,r){let i;typeof t==`function`&&typeof n!=`function`?(r=n,n=t):i=t;let a=eJ(i),o=r?-1:1;s(e,void 0,[])();function s(e,i,c){let l=e&&typeof e==`object`?e:{};if(typeof l.type==`string`){let t=typeof l.tagName==`string`?l.tagName:typeof l.name==`string`?l.name:void 0;Object.defineProperty(u,`name`,{value:`node (`+sJ(e.type+(t?`<`+t+`>`:``))+`)`})}return u;function u(){let l=cJ,u,d,f;if((!t||a(e,i,c[c.length-1]||void 0))&&(l=dJ(n(e,c)),l[0]===!1))return l;if(`children`in e&&e.children){let t=e;if(t.children&&l[0]!==`skip`)for(d=(r?t.children.length:-1)+o,f=c.concat(t);d>-1&&d<t.children.length;){let e=t.children[d];if(u=s(e,d,f)(),u[0]===!1)return u;d=typeof u[1]==`number`?u[1]:d+o}}return l}}}function dJ(e){return Array.isArray(e)?e:typeof e==`number`?[!0,e]:e==null?cJ:[e]}var fJ=(function(e){if(e==null)return gJ;if(typeof e==`string`)return mJ(e);if(typeof e==`object`)return pJ(e);if(typeof e==`function`)return hJ(e);throw Error("Expected function, string, or array as `test`")});function pJ(e){let t=[],n=-1;for(;++n<e.length;)t[n]=fJ(e[n]);return hJ(r);function r(...e){let n=-1;for(;++n<t.length;)if(t[n].apply(this,e))return!0;return!1}}function mJ(e){return hJ(t);function t(t){return t.tagName===e}}function hJ(e){return t;
466function t(t,n,r){return!!(_J(t)&&e.call(this,t,typeof n==`number`?n:void 0,r||void 0))}}function gJ(e){return!!(e&&typeof e==`object`&&`type`in e&&e.type===`element`&&`tagName`in e&&typeof e.tagName==`string`)}function _J(e){return typeof e==`object`&&!!e&&`type`in e&&`tagName`in e}function vJ(e){if(typeof e!=`string`)throw TypeError(`Expected a string`);return e.replace(/[|\\{}()[\]^$+*?.]/g,`\\$&`).replace(/-/g,`\\x2d`)}var yJ={},bJ=[`math`,`script`,`style`,`svg`,`title`];function xJ(e,t,n){let r=fJ((n||yJ).ignore||bJ),i=SJ(t),a=-1;for(;++a<i.length;)uJ(e,`text`,o);function o(e,t){let n=-1,i;for(;++n<t.length;){let e=t[n],a=i?i.children:void 0;if(r(e,a?a.indexOf(e):void 0,i))return;i=e}if(i)return s(e,t)}function s(e,t){let n=t[t.length-1],r=i[a][0],o=i[a][1],s=0,c=n.children.indexOf(e),l=!1,u=[];r.lastIndex=0;let d=r.exec(e.value);for(;d;){let n=d.index,i={index:d.index,input:d.input,stack:[...t,e]},a=o(...d,i);if(typeof a==`string`&&(a=a.length>0?{type:`text`,value:a}:void 0),a===!1?r.lastIndex=n+1:(s!==n&&u.push({type:`text`,value:e.value.slice(s,n)}),Array.isArray(a)?u.push(...a):a&&u.push(a),s=n+d[0].length,l=!0),!r.global)break;d=r.exec(e.value)}return l?(s<e.value.length&&u.push({type:`text`,value:e.value.slice(s)}),n.children.splice(c,1,...u)):u=[e],c+u.length}}function SJ(e){let t=[];if(!Array.isArray(e))throw TypeError(`Expected find and replace tuple or list of tuples`);let n=!e[0]||Array.isArray(e[0])?e:[e],r=-1;for(;++r<n.length;){let e=n[r];t.push([CJ(e[0]),wJ(e[1])])}return t}function CJ(e){return typeof e==`string`?new RegExp(vJ(e),`g`):e}function wJ(e){return typeof e==`function`?e:function(){return e}}function TJ(e,t,n){let r={type:String(e)};return n==null&&(typeof t==`string`||Array.isArray(t))?n=t:Object.assign(r,t),Array.isArray(n)?r.children=n:n!=null&&(r.value=String(n)),r}function EJ(e,t,n,r){let i,a,o;typeof t==`function`&&typeof n!=`function`?(a=void 0,o=t,i=n):(a=t,o=n,i=r),uJ(e,a,s,i);function s(e,t){let n=t[t.length-1],r=n?n.children.indexOf(e):void 0;return o(e,r,n)}}function DJ(e,t){let n=t||{};return(e[e.length-1]===``?[...e,``]:e).join((n.padRight?` `:``)+`,`+(n.padLeft===!1?``:` `)).trim()}var OJ=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,kJ=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,AJ={};function jJ(e,t){return((t||AJ).jsx?kJ:OJ).test(e)}var MJ=/[ \t\n\f\r]/g;function NJ(e){return typeof e==`object`?e.type===`text`?PJ(e.value):!1:PJ(e)}function PJ(e){return e.replace(MJ,``)===``}var FJ=class{constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}};FJ.prototype.normal={},FJ.prototype.property={},FJ.prototype.space=void 0;function IJ(e,t){let n={},r={};for(let t of e)Object.assign(n,t.property),Object.assign(r,t.normal);return new FJ(n,r,t)}function LJ(e){return e.toLowerCase()}var RJ=class{constructor(e,t){this.attribute=t,this.property=e}};RJ.prototype.attribute=``,RJ.prototype.booleanish=!1,RJ.prototype.boolean=!1,RJ.prototype.commaOrSpaceSeparated=!1,RJ.prototype.commaSeparated=!1,RJ.prototype.defined=!1,RJ.prototype.mustUseProperty=!1,RJ.prototype.number=!1,RJ.prototype.overloadedBoolean=!1,RJ.prototype.property=``,RJ.prototype.spaceSeparated=!1,RJ.prototype.space=void 0;var zJ=e({boolean:()=>VJ,booleanish:()=>HJ,commaOrSpaceSeparated:()=>KJ,commaSeparated:()=>GJ,number:()=>Z,overloadedBoolean:()=>UJ,spaceSeparated:()=>WJ}),BJ=0,VJ=qJ(),HJ=qJ(),UJ=qJ(),Z=qJ(),WJ=qJ(),GJ=qJ(),KJ=qJ();function qJ(){return 2**++BJ}var JJ=Object.keys(zJ),YJ=class extends RJ{constructor(e,t,n,r){let i=-1;if(super(e,t),XJ(this,`space`,r),typeof n==`number`)for(;++i<JJ.length;){let e=JJ[i];XJ(this,JJ[i],(n&zJ[e])===zJ[e])}}};YJ.prototype.defined=!0;function XJ(e,t,n){n&&(e[t]=n)}function ZJ(e){let t={},n={};for(let[r,i]of Object.entries(e.properties)){let a=new YJ(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[LJ(r)]=r,n[LJ(a.attribute)]=r}return new FJ(t,n,e.space)}var QJ=ZJ({properties:{ariaActiveDescendant:null,ariaAtomic:HJ,ariaAutoComplete:null,ariaBusy:HJ,ariaChecked:HJ,ariaColCount:Z,ariaColIndex:Z,ariaColSpan:Z,ariaControl
vendor: 4,108 bytes, line 466
466s:WJ,ariaCurrent:null,ariaDescribedBy:WJ,ariaDetails:null,ariaDisabled:HJ,ariaDropEffect:WJ,ariaErrorMessage:null,ariaExpanded:HJ,ariaFlowTo:WJ,ariaGrabbed:HJ,ariaHasPopup:null,ariaHidden:HJ,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:WJ,ariaLevel:Z,ariaLive:null,ariaModal:HJ,ariaMultiLine:HJ,ariaMultiSelectable:HJ,ariaOrientation:null,ariaOwns:WJ,ariaPlaceholder:null,ariaPosInSet:Z,ariaPressed:HJ,ariaReadOnly:HJ,ariaRelevant:null,ariaRequired:HJ,ariaRoleDescription:WJ,ariaRowCount:Z,ariaRowIndex:Z,ariaRowSpan:Z,ariaSelected:HJ,ariaSetSize:Z,ariaSort:null,ariaValueMax:Z,ariaValueMin:Z,ariaValueNow:Z,ariaValueText:null,role:null},transform(e,t){return t===`role`?t:`aria-`+t.slice(4).toLowerCase()}});function $J(e,t){return t in e?e[t]:t}function eY(e,t){return $J(e,t.toLowerCase())}var tY=ZJ({attributes:{acceptcharset:`accept-charset`,classname:`class`,htmlfor:`for`,httpequiv:`http-equiv`},mustUseProperty:[`checked`,`multiple`,`muted`,`selected`],properties:{abbr:null,accept:GJ,acceptCharset:WJ,accessKey:WJ,action:null,allow:null,allowFullScreen:VJ,allowPaymentRequest:VJ,allowUserMedia:VJ,alpha:VJ,alt:null,as:null,async:VJ,autoCapitalize:null,autoComplete:WJ,autoFocus:VJ,autoPlay:VJ,blocking:WJ,capture:null,charSet:null,checked:VJ,cite:null,className:WJ,closedBy:null,colorSpace:null,cols:Z,colSpan:Z,command:null,commandFor:null,content:null,contentEditable:HJ,controls:VJ,controlsList:WJ,coords:Z|GJ,crossOrigin:null,data:null,dateTime:null,decoding:null,default:VJ,defer:VJ,dir:null,dirName:null,disabled:VJ,download:UJ,draggable:HJ,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:VJ,formTarget:null,headers:WJ,height:Z,hidden:UJ,high:Z,href:null,hrefLang:null,htmlFor:WJ,httpEquiv:WJ,id:null,imageSizes:null,imageSrcSet:null,inert:VJ,inputMode:null,integrity:null,is:null,isMap:VJ,itemId:null,itemProp:WJ,itemRef:WJ,itemScope:VJ,itemType:WJ,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:VJ,low:Z,manifest:null,max:null,maxLength:Z,media:null,method:null,min:null,minLength:Z,multiple:VJ,muted:VJ,name:null,nonce:null,noModule:VJ,noValidate:VJ,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:VJ,optimum:Z,pattern:null,ping:WJ,placeholder:null,playsInline:VJ,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:VJ,referrerPolicy:null,rel:WJ,required:VJ,reversed:VJ,rows:Z,rowSpan:Z,sandbox:WJ,scope:null,scoped:VJ,seamless:VJ,selected:VJ,shadowRootClonable:VJ,shadowRootCustomElementRegistry:VJ,shadowRootDelegatesFocus:VJ,shadowRootMode:null,shadowRootSerializable:VJ,shape:null,size:Z,sizes:null,slot:null,span:Z,spellCheck:HJ,src:null,
466srcDoc:null,srcLang:null,srcSet:null,start:Z,step:null,style:null,tabIndex:Z,target:null,title:null,translate:null,type:null,typeMustMatch:VJ,useMap:null,value:HJ,width:Z,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:WJ,axis:null,background:null,bgColor:null,border:Z,borderColor:null,bottomMargin:Z,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:VJ,declare:VJ,event:null,face:null,frame:null,frameBorder:null,hSpace:Z,leftMargin:Z,link:null,longDesc:null,lowSrc:null,marginHeight:Z,marginWidth:Z,noResize:VJ,noHref:VJ,noShade:VJ,noWrap:VJ,object:null,profile:null,prompt:null,rev:null,rightMargin:Z,rules:null,scheme:null,scrolling:HJ,standby:null,summary:null,text:null,topMargin:Z,valueType:null,version:null,vAlign:null,vLink:null,vSpace:Z,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:VJ,disablePictureInPicture:VJ,disableRemotePlayback:VJ,exportParts:GJ,part:WJ,prefix:null,property:null,results:Z,security:null,unselectable:null},space:`html`,transform:eY}),nY=ZJ({attributes:{accentHeight:`accent-height`,alignmentBaseline:`alignment-baseline`,arabicForm:`arabic-form`,baselineShift:`baseline-shift`,capHeight:`cap-height`,className:`class`,clipPath:`clip-path`,clipRule:`clip-rule`,colorInterpolation:`color-interpolation`,colorInterpolationFilters:`color-interpolation-filters`,colorProfile:`color-profile`,colorRendering:`color-rendering`,crossOrigin:`crossorigin`,dataType:`datatype`,dominantBaseline:`dominant-baseline`,enableBackground:`enable-background`,fillOpacity:`fill-opacity`,fillRule:`fill-rule`,floodColor:`flood-color`,floodOpacity:`flood-opacity`,fontFamily:`font-family`,fontSize:`font-size`,fontSizeAdjust:`font-size-adjust`,fontStretch:`font-stretch`,fontStyle:`font-style`,fontVariant:`font-variant`,fontWeight:`font-weight`,glyphName:`glyph-name`,glyphOrientationHorizontal:`glyph-orientation-horizontal`,glyphOrientationVertical:`glyph-orientation-vertical`,hrefLang:`hreflang`,horizAdvX:`horiz-adv-x`,horizOriginX:`horiz-origin-x`,horizOriginY:`horiz-origin-y`,imageRendering:`image-rendering`,letterSpacing:`letter-spacing`,lightingColor:`lighting-color`,markerEnd:`marker-end`,markerMid:`marker-mid`,markerStart:`marker-start`,maskType:`mask-type`,navDown:`nav-down`,navDownLeft:`nav-down-left`,navDownRight:`nav-down-right`,navLeft:`nav-left`,navNext:`nav-next`,navPrev:`nav-prev`,navRight:`nav-right`,navUp:`nav-up`,navUpLeft:`nav-up-left`,navUpRight:`nav-up-right`,onAbort:`onabort`,onActivate:`onactivate`,onAfterPrint:`onafterprint`,onBeforePrint:`onbeforeprint`,onBegin:`onbegin`,onCancel:`oncancel`,onCanPlay:`oncanplay`,onCanPlayThrough:`oncanplaythrough`,onChange:`onchange`,onClick:`onclick`,onClose:`onclose`,onCopy:`oncopy`,onCueChange:`oncuechange`,onCut:`oncut`,onDblClick:`ondblclick`,onDrag:`ondrag`,onDragEnd:`ondragend`,onDragEnter:`ondragenter`,onDragExit:`ondragexit`,onDragLeave:`ondragleave`,onDragOver:`ondragover`,onDragStart:`ondragstart`,onDrop:`ondrop`,onDurationChange:`ondurationchange`,onEmptied:`onemptied`,onEnd:`onend`,onEnded:`onended`,onError:`onerror`,onFocus:`onfocus`,onFocusIn:`onfocusin`,onFocusOut:`onfocusout`,onHashChange:`onhashchange`,onInput:`oninput`,onInvalid:`oninvalid`,onKeyDown:`onkeydown`,onKeyPress:`onkeypress`,onKeyUp:`onkeyup`,onLoad:`onload`,onLoadedData:`onloadeddata`,onLoadedMetadata:`onloadedmetadata`,onLoadStart:`onloadstart`,onMessage:`onmessage`,onMouseDown:`onmousedown`,onMouseEnter:`onmouseenter`,onMouseLeave:`onmouseleave`,onMouseMove:`onmousemove`,onMouseOut:`onmouseout`,onMouseOver:`onmouseover`,onMouseUp:`onmouseup`,onMouseWheel:`onmousewheel`,onOffline:`onoffline`,onOnline:`ononline`,onPageHide:`onpagehide`,onPageShow:`onpageshow`,onPaste:`onpaste`,onPause:`onpause`,onPlay:`onplay`,onPlaying:`onplaying`,onPopState:`onpopstate`,onProgress:`onprogress`,onRateChange:`onratechange`,onRepeat:`onrepeat`,onReset:`onreset`,onResize:`onresize`,onScroll:`onscroll`,onSeeked:`onseeked`,onSeeking:`onseeking`,onSelect:`onselect`,onShow:`onshow`,onStalled:`onstalled`,onStorage:`onstorage`,onSubmit:`onsubmit`,onSuspend:`onsuspend`,onTimeUpdate:`ontimeupdate`,onToggle:`ontoggle`,onUnload:`onunload`,onVolumeChange:`onvolumechange`,onWaiting:`onwaiting`,onZoom:`onzoom`,overlinePosition:`overline-position`,overlineThickness:`overline-thickness`,paintOrder:`paint-order`,panose1:`panose-1`,pointerEvents:`pointer-events`,referrerPolicy:`referrerpolicy`,renderingIntent:`rendering-intent`,shapeRendering:`shape-rendering`,stopColor:`stop-color`,stopOpacity:`stop-opacity`,strikethroughPosition:`strikethrough-position`,strikethroughThickness:`strikethrough-thickness`,strokeDashArray:`stroke-dasharray`,strokeDashOffset:`stroke-dashoffset`,strokeLineCap:`stroke-linecap`,strokeLineJoin:`stroke-linejoin`,strokeMiterLimit:`stroke-miterlimit`,strokeOpacity:`stroke-opacity`,strokeWidth:`stroke-width`,tabIndex:`tabindex`,textAnchor:`text-anchor`,textDecoration:`text-decoration`,textRendering:`text-rendering`,transformOrigin:`transform-origin`,typeOf:`typeof`,underlinePosition:`underline-position`,underlineThickness:`underline-thickness`,unicodeBidi:`unicode
466-bidi`,unicodeRange:`unicode-range`,unitsPerEm:`units-per-em`,vAlphabetic:`v-alphabetic`,vHanging:`v-hanging`,vIdeographic:`v-ideographic`,vMathematical:`v-mathematical`,vectorEffect:`vector-effect`,vertAdvY:`vert-adv-y`,vertOriginX:`vert-origin-x`,vertOriginY:`vert-origin-y`,wordSpacing:`word-spacing`,writingMode:`writing-mode`,xHeight:`x-height`,playbackOrder:`playbackorder`,timelineBegin:`timelinebegin`},properties:{about:KJ,accentHeight:Z,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:Z,amplitude:Z,arabicForm:null,ascent:Z,attributeName:null,attributeType:null,azimuth:Z,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:Z,by:null,calcMode:null,capHeight:Z,className:WJ,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:Z,diffuseConstant:Z,direction:null,display:null,dur:null,divisor:Z,dominantBaseline:null,download:VJ,dx:null,dy:null,edgeMode:null,editable:null,elevation:Z,enableBackground:null,end:null,event:null,exponent:Z,externalResourcesRequired:null,fill:null,fillOpacity:Z,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:GJ,g2:GJ,glyphName:GJ,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:Z,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:Z,horizOriginX:Z,horizOriginY:Z,id:null,ideographic:Z,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:Z,k:Z,k1:Z,k2:Z,k3:Z,k4:Z,kernelMatrix:KJ,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:Z,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskType:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:Z,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:Z,overlineThickness:Z,paintOrder:null,panose1:null,path:null,pathLength:Z,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:WJ,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Z,pointsAtY:Z,pointsAtZ:Z,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:KJ,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:KJ,rev:KJ,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:KJ,requiredFeatures:KJ,requiredFonts:KJ,requiredFormats:KJ,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,
466scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:Z,specularExponent:Z,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:Z,strikethroughThickness:Z,string:null,stroke:null,strokeDashArray:KJ,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:Z,strokeOpacity:Z,strokeWidth:null,style:null,surfaceScale:Z,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:KJ,tabIndex:Z,tableValues:null,target:null,targetX:Z,targetY:Z,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:KJ,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:Z,underlineThickness:Z,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:Z,values:null,vAlphabetic:Z,vMathematical:Z,vectorEffect:null,vHanging:Z,vIdeographic:Z,version:null,vertAdvY:Z,vertOriginX:Z,vertOriginY:Z,viewB
vendor: 16,692 bytes, lines 466-467
466ox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:Z,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:`svg`,transform:$J}),rY=ZJ({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:`xlink`,transform(e,t){return`xlink:`+t.slice(5).toLowerCase()}}),iY=ZJ({attributes:{xmlnsxlink:`xmlns:xlink`},properties:{xmlnsXLink:null,xmlns:null},space:`xmlns`,transform:eY}),aY=ZJ({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:`xml`,transform(e,t){return`xml:`+t.slice(3).toLowerCase()}}),oY={classId:`classID`,dataType:`datatype`,itemId:`itemID`,strokeDashArray:`strokeDasharray`,strokeDashOffset:`strokeDashoffset`,strokeLineCap:`strokeLinecap`,strokeLineJoin:`strokeLinejoin`,strokeMiterLimit:`strokeMiterlimit`,typeOf:`typeof`,xLinkActuate:`xlinkActuate`,xLinkArcRole:`xlinkArcrole`,xLinkHref:`xlinkHref`,xLinkRole:`xlinkRole`,xLinkShow:`xlinkShow`,xLinkTitle:`xlinkTitle`,xLinkType:`xlinkType`,xmlnsXLink:`xmlnsXlink`},sY=/[A-Z]/g,cY=/-[a-z]/g,lY=/^data[-\w.:]+$/i;function uY(e,t){let n=LJ(t),r=t,i=RJ;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)===`data`&&lY.test(t)){if(t.charAt(4)===`-`){let e=t.slice(5).replace(cY,fY);r=`data`+e.charAt(0).toUpperCase()+e.slice(1)}else{let e=t.slice(4);if(!cY.test(e)){let n=e.replace(sY,dY);n.charAt(0)!==`-`&&(n=`-`+n),t=`data`+n}}i=YJ}return new i(r,t)}function dY(e){return`-`+e.toLowerCase()}function fY(e){return e.charAt(1).toUpperCase()}var pY=IJ([QJ,tY,rY,iY,aY],`html`),mY=IJ([QJ,nY,rY,iY,aY],`svg`);function hY(e){return e.join(` `).trim()}var gY=n(((e,t)=>{var n=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,r=/\n/g,i=/^\s*/,a=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,o=/^:\s*/,s=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,c=/^[;\s]*/,l=/^\s+|\s+$/g,u=`
467`,d=`/`,f=`*`,p=``,m=`comment`,h=`declaration`;function g(e,t){if(typeof e!=`string`)throw TypeError(`First argument must be a string`);if(!e)return[];t||={};var l=1,g=1;function v(e){var t=e.match(r);t&&(l+=t.length);var n=e.lastIndexOf(u);g=~n?e.length-n:g+e.length}function y(){var e={line:l,column:g};return function(t){return t.position=new b(e),C(),t}}function b(e){this.start=e,this.end={line:l,column:g},this.source=t.source}b.prototype.content=e;function x(n){var r=Error(t.source+`:`+l+`:`+g+`: `+n);if(r.reason=n,r.filename=t.source,r.line=l,r.column=g,r.source=e,!t.silent)throw r}function S(t){var n=t.exec(e);if(n){var r=n[0];return v(r),e=e.slice(r.length),n}}function C(){S(i)}function w(e){var t;for(e||=[];t=T();)t!==!1&&e.push(t);return e}function T(){var t=y();if(!(d!=e.charAt(0)||f!=e.charAt(1))){for(var n=2;p!=e.charAt(n)&&(f!=e.charAt(n)||d!=e.charAt(n+1));)++n;if(n+=2,p===e.charAt(n-1))return x(`End of comment missing`);var r=e.slice(2,n-2);return g+=2,v(r),e=e.slice(n),g+=2,t({type:m,comment:r})}}function E(){var e=y(),t=S(a);if(t){if(T(),!S(o))return x(`property missing ':'`);var r=S(s),i=e({type:h,property:_(t[0].replace(n,p)),value:r?_(r[0].replace(n,p)):p});return S(c),i}}function D(){var e=[];w(e);for(var t;t=E();)t!==!1&&(e.push(t),w(e));return e}return C(),D()}function _(e){return e?e.replace(l,p):p}t.exports=g})),_Y=n((e=>{var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,`__esModule`,{value:!0}),e.default=r;var n=t(gY());function r(e,t){let r=null;if(!e||typeof e!=`string`)return r;let i=(0,n.default)(e),a=typeof t==`function`;return i.forEach(e=>{if(e.type!==`declaration`)return;let{property:n,value:i}=e;a?t(n,i,e):i&&(r||={},r[n]=i)}),r}})),vY=n((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.camelCase=void 0;var t=/^--[a-zA-Z0-9_-]+$/,n=/-([a-z])/g,r=/^[^-]+$/,i=/^-(webkit|moz|ms|o|khtml)-/,a=/^-(ms)-/,o=function(e){return!e||r.test(e)||t.test(e)},s=function(e,t){return t.toUpperCase()},c=function(e,t){return`${t}-`};e.camelCase=function(e,t){return t===void 0&&(t={}),o(e)?e:(e=e.toLowerCase(),e=t.reactCompat?e.replace(a,c):e.replace(i,c),e.replace(n,s))}})),yY=n(((e,t)=>{var n=(e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}})(_Y()),r=vY();function i(e,t){var i={};return!e||typeof e!=`string`||(0,n.default)(e,function(e,n){e&&n&&(i[(0,r.camelCase)(e,t)]=n)}),i}i.default=i,t.exports=i})),bY=SY(`end`),xY=SY(`start`);function SY(e){return t;function t(t){let n=t&&t.position&&t.position[e]||{};if(typeof n.line==`number`&&n.line>0&&typeof n.column==`number`&&n.column>0)return{line:n.line,column:n.column,offset:typeof n.offset==`number`&&n.offset>-1?n.offset:void 0}}}function CY(e){let t=xY(e),n=bY(e);if(t&&n)return{start:t,end:n}}function wY(e){return!e||typeof e!=`object`?``:`position`in e||`type`in e?EY(e.position):`start`in e||`end`in e?EY(e):`line`in e||`column`in e?TY(e):``}function TY(e){return DY(e&&e.line)+`:`+DY(e&&e.column)}function EY(e){return TY(e&&e.start)+`-`+TY(e&&e.end)}function DY(e){return e&&typeof e==`number`?e:1}var OY=class extends Error{constructor(e,t,n){super(),typeof t==`string`&&(n=t,t=void 0);let r=``,i={},a=!1;if(t&&(i=`line`in t&&`column`in t||`start`in t&&`end`in t?{place:t}:`type`in t?{ancestors:[t],place:t.position}:{...t}),typeof e==`string`?r=e:!i.cause&&e&&(a=!0,r=e.message,i.cause=e),!i.ruleId&&!i.source&&typeof n==`string`){let e=n.indexOf(`:`);e===-1?i.ruleId=n:(i.source=n.slice(0,e),i.ruleId=n.slice(e+1))}if(!i.place&&i.ancestors&&i.ancestors){let e=i.ancestors[i.ancestors.length-1];e&&(i.place=e.position)}let o=i.place&&`start`in i.place?i.place.start:i.place;this.ancestors=i.ancestors||void 0,this.cause=i.cause||void 0,this.column=o?o.column:void 0,this.fatal=void 0,this.file=``,this.message=r,this.line=o?o.line:void 0,this.name=wY(i.place)||`1:1`,this.place=i.place||void 0,this.reason=this.message,this.ruleId=i.ruleId||void 0,this.source=i.source||void 0,this.stack=a&&i.cause&&typeof i.cause.stack==`string`?i.cause.stack:``,this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}};OY.prototype.file=``,OY.prototype.name=``,OY.prototype.reason=``,OY.prototype.message=``,OY.prototype.stack=``,OY.prototype.column=void 0,OY.prototype.line=void 0,OY.prototype.ancestors=void 0,OY.prototype.cause=void 0,OY.prototype.fatal=void 0,OY.prototype.place=void 0,OY.prototype.ruleId=void 0,OY.prototype.source=void 0;var kY=r(yY(),1),AY={}.hasOwnProperty,jY=new Map,MY=/[A-Z]/g,NY=new Set([`table`,`tbody`,`thead`,`tfoot`,`tr`]),PY=new Set([`td`,`th`]),FY=`https://github.com/syntax-tree/hast-util-to-jsx-runtime`;function IY(e,t){if(!t||t.Fragment===void 0)throw TypeError("Expected `Fragment` in options");let n=t.filePath||void 0,r;if(t.development){if(typeof t.jsxDEV!=`function`)throw TypeError("Expected `jsxDEV` in options when `development: true`");r=qY(n,t.jsxDEV)}else{if(typeof t.jsx!=`function`)throw TypeError("Expected `jsx` in production options");if(typeof t.jsxs!=`function`)throw TypeError("Expected `jsxs` in production options");r=KY(n,t.jsx,t.jsxs)}let i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||`react`,evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space===`svg`?mY:pY,stylePropertyNameCase:t.stylePropertyNameCase||`dom`,tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},a=LY(i,e,void 0);return a&&typeof a!=`string`?a:i.create(e,i.Fragment,{children:a||void 0},void 0)}function LY(e,t,n){if(t.type===`element`)return RY(e,t,n);if(t.type===`mdxFlowExpression`||t.type===`mdxTextExpression`)return zY(e,t);if(t.type===`mdxJsxFlowElement`||t.type===`mdxJsxTextElement`)return VY(e,t,n);if(t.type===`mdxjsEsm`)return BY(e,t);if(t.type===`root`)return HY(e,t,n);if(t.type===`text`)return UY(e,t)}function RY(e,t,n){let r=e.schema,i=r;t.tagName.toLowerCase()===`svg`&&r.space===`html`&&(i=mY,e.schema=i),e.ancestors.push(t);let a=$Y(e,t.tagName,!1),o=JY(e,t),s=XY(e,t);return NY.has(t.tagName)&&(s=s.filter(function(e){return typeof e==`string`?!NJ(e):!0})),WY(e,o,a,t),GY(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function zY(e,t){if(t.data&&t.data.estree&&e.evaluater){let n=t.data.estree.body[0];return n.type,e.evaluater.evaluateExpression(n.expression)}eX(e,t.position)}function BY(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);eX(e,t.position)}function VY(e,t,n){let r=e.schema,i=r;t.name===`svg`&&r.space===`html`&&(i=mY,e.schema=i),e.ancestors.push(t);let a=t.name===null?e.Fragment:$Y(e,t.name,!0),o=YY(e,t),s=XY(e,t);return WY(e,o,a,t),GY(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function HY(e,t,n){let r={};return GY(r,XY(e,t)),e.create(t,e.Fragment,r,n)}function UY(e,t){return t.value}function WY(e,t,n,r){typeof n!=`string`&&n!==e.Fragment&&e.passNode&&(t.node=r)}function GY(e,t){if(t.length>0){let n=t.length>1?t:t[0];n&&(e.children=n)}}function KY(e,t,n){return r;function r(e,r,i,a){let o=Array.isArray(i.children)?n:t;return a?o(r,i,a):o(r,i)}}function qY(e,t){return n;function n(n,r,i,a){let o=Array.isArray(i.children),s=xY(n);return t(r,i,a,o,{columnNumber:s?s.column-1:void 0,fileName:e,lineNumber:s?s.line:void 0},void 0)}}function JY(e,t){let n={},r,i;for(i in t.properties)if(i!==`children`&&AY.call(t.properties,i)){let a=ZY(e,i,t.properties[i]);if(a){let[i,o]=a;e.tableCellAlignToStyle&&i===`align`&&typeof o==`string`&&PY.has(t.tagName)?r=o:n[i]=o}}if(r){let t=n.style||={};t[e.stylePropertyNameCase===`css`?`text-align`:`textAlign`]=r}return n}function YY(e,t){let n={};for(let r of t.attributes)if(r.type===`mdxJsxExpressionAttribute`)if(r.data&&r.data.estree&&e.evaluater){let t=r.data.estree.body[0];t.type;let i=t.expression;i.type;let a=i.properties[0];a.type,Object.assign(n,e.evaluater.evaluateExpression(a.argument))}else eX(e,t.position);else{let i=r.name,a;if(r.value&&typeof r.value==`object`)if(r.value.data&&r.value.data.estree&&e.evaluater){let t=r.value.data.estree.body[0];t.type,a=e.evaluater.evaluateExpression(t.expression)}else eX(e,t.position);else a=r.value===null?!0:r.value;n[i]=a}return n}function XY(e,t){let n=[],r=-1,i=e.passKeys?new Map:jY;for(;++r<t.children.length;){let a=t.children[r],o;if(e.passKeys){let e=a.type===`element`?a.tagName:a.type===`mdxJsxFlowElement`||a.type===`mdxJsxTextElement`?a.name:void 0;if(e){let t=i.get(e)||0;o=e+`-`+t,i.set(e,t+1)}}let s=LY(e,a,o);s!==void 0&&n.push(s)}return n}function ZY(e,t,n){let r=uY(e.schema,t);if(!(n==null||typeof n==`number`&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?DJ(n):hY(n)),r.property===`style`){let t=typeof n==`object`?n:QY(e,String(n));return e.stylePropertyNameCase===`css`&&(t=tX(t)),[`style`,t]}return[e.elementAttributeNameCase===`react`&&r.space?oY[r.property]||r.property:r.attribute,n]}}function QY(e,t){try{return(0,kY.default)(t,{reactCompat:!0})}catch(t){if(e.ignoreInvalidStyle)return{};let n=t,r=new OY("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:n,ruleId:`style`,source:`hast-util-to-jsx-runtime`});throw r.file=e.filePath||void 0,r.url=FY+`#cannot-parse-style-attribute`,r}}function $Y(e,t,n){let r;if(!n)r={type:`Literal`,value:t};else if(t.includes(`.`)){let e=t.split(`.`),n=-1,i;for(;++n<e.length;){let t=jJ(e[n])?{type:`Identifier`,name:e[n]}:{type:`Literal`,value:e[n]};i=i?{type:`MemberExpression`,object:i,property:t,computed:!!(n&&t.type===`Literal`),optional:!1}:t}r=i}else r=jJ(t)&&!/^[a-z]/.test(t)?{type:`Identifier`,name:t}:{type:`Literal`,value:t};if(r.type===`Literal`){let t=r.value;return AY.call(e.components,t)?e.components[t]:t}if(e.evaluater)return e.evaluater.evaluateExpression(r);eX(e)}function eX(e,t){let n=new OY("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:`mdx-estree`,source:`hast-util-to-jsx-runtime`});throw n.file=e.filePath||void 0,n.url=FY+`#cannot-handle-mdx-estrees-without-createevaluater`,n}function tX(e){let t={},n;for(n in e)AY.call(e,n)&&(t[nX(n)]=e[n]);return t}function nX(e){let t=e.replace(MY,rX);return t.slice(0,3)===`ms-`&&(t=`-`+t),t}function rX(e){return`-`+e.toLowerCase()}var iX={action:[`form`],cite:[`blockquote`,`del`,`ins`,`q`],data:[`object`],formAction:[`button`,`input`],href:[`a`,`area`,`base`,`link`],icon:[`menuitem`],itemId:null,manifest:[`html`],ping:[`a`,`area`],poster:[`video`],src:[`audio`,`embed`,`iframe`,`img`,`input`,`script`,`source`,`track`,`video`]},aX={};function oX(e,t){let n=t||aX;return sX(e,typeof n.includeImageAlt==`boolean`?n.includeImageAlt:!0,typeof n.includeHtml==`boolean`?n.includeHtml:!0)}function sX(e,t,n){if(lX(e)){if(`value`in e)return e.type===`html`&&!n?``:e.value;if(t&&`alt`in e&&e.alt)return e.alt;if(`children`in e)return cX(e.children,t,n)}return Array.isArray(e)?cX(e,t,n):``}function cX(e,t,n){let r=[],i=-1;for(;++i<e.length;)r[i]=sX(e[i],t,n);return r.join(``)}function lX(e){return!!(e&&typeof e==`object`)}var uX=document.createElement(`i`);function dX(e){let t=`&`+e+`;`;uX.innerHTML=t;let n=uX.textContent;return n.charCodeAt(n.length-1)===59&&e!==`semi`||n===t?!1:n}function fX(e,t,n,r){let i=e.length,a=0,o;if(t=t<0?-t>i?0:i+t:t>i?i:t,n=n>0?n:0,r.length<1e4)o=Array.from(r),o.unshift(t,n),e.splice(...o);else for(n&&e.splice(t,n);a<r.length;)o=r.slice(a,a+1e4),o.unshift(t,0),e.splice(...o),a+=1e4,t+=1e4}function pX(e,t){return e.length>0?(fX(e,e.length,0,t),e):t}var mX={}.hasOwnProperty;function hX(e){let t={},n=-1;for(;++n<e.length;)gX(t,e[n]);return t}function gX(e,t){let n;for(n in t){let r=(mX.call(e,n)?e[n]:void 0)||(e[n]={}),i=t[n],a;if(i)for(a in i){mX.call(r,a)||(r[a]=[]);let e=i[a];_X(r[a],Array.isArray(e)?e:e?[e]:[])}}}function _X(e,t){let n=-1,r=[];for(;++n<t.length;)(t[n].add===`after`?e:r).push(t[n]);fX(e,0,0,r)}function vX(e,t){let n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)==65535||(n&65535)==65534||n>1114111?`�`:String.fromCodePoint(n)}function yX(e){return e.replace(/[\t\n\r ]+/g,` `).replace(/^ | $/g,``).toLowerCase().toUpperCase()}var bX=MX(/[A-Za-z]/),xX=MX(/[\dA-Za-z]/),SX=MX(/[#-'*+\--9=?A-Z^-~]/);function CX(e){return e!==null&&(e<32||e===127)}var wX=MX(/\d/),TX=MX(/[\dA-Fa-f]/),EX=MX(/[!-/:-@[-`{-~]/);function DX(e){return e!==null&&e<-2}function OX(e){return e!==null&&(e<0||e===32)}function kX(e){return e===-2||e===-1||e===32}var AX=MX(/\p{P}|\p{S}/u),jX=MX(/\s/);function MX(e){return t;function t(t){return t!==null&&t>-1&&e.test(String.fromCharCode(t))}}function NX(e){let t=[],n=-1,r=0,i=0;for(;++n<e.length;){let a=e.charCodeAt(n),o=``;if(a===37&&xX(e.charCodeAt(n+1))&&xX(e.charCodeAt(n+2)))i=2;else if(a<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(a))||(o=String.fromCharCode(a));else if(a>55295&&a<57344){let t=e.charCodeAt(n+1);a<56320&&t>56319&&t<57344?(o=String.fromCharCode(a,t),i=1):o=`�`}else o=String.fromCharCode(a);o&&=(t.push(e.slice(r,n),encodeURIComponent(o)),r=n+i+1,``),i&&=(n+=i,0)}return t.join(``)+e.slice(r)}function PX(e,t,n,r){let i=r?r-1:1/0,a=0;return o;function o(r){return kX(r)?(e.enter(n),s(r)):t(r)}function s(r){return kX(r)&&a++<i?(e.consume(r),s):(e.exit(n),t(r))}}var FX={tokenize:IX};function IX(e){let t=e.attempt(this.parser.constructs.contentInitial,r,i),n;return t;function r(n){if(n===null){e.consume(n);return}return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),PX(e,t,`linePrefix`)}function i(t){return e.enter(`paragraph`),a(t)}function a(t){let r=e.enter(`chunkText`,{contentType:`text`,previous:n});return n&&(n.next=r),n=r,o(t)}function o(t){if(t===null){e.exit(`chunkText`),e.exit(`paragraph`),e.consume(t);return}return DX(t)?(e.consume(t),e.exit(`chunkText`),a):(e.consume(t),o)}}var LX={tokenize:zX},RX={tokenize:BX};function zX(e){let t=this,n=[],r=0,i,a,o;return s;function s(i){if(r<n.length){let a=n[r];return t.containerState=a[1],e.attempt(a[0].continuation,c,l)(i)}return l(i)}function c(e){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&v();let n=t.events.length,a=n,o;for(;a--;)if(t.events[a][0]===`exit`&&t.events[a][1].type===`chunkFlow`){o=t.events[a][1].end;break}_(r);let s=n;for(;s<t.events.length;)t.events[s][1].end={...o},s++;return fX(t.events,a+1,0,t.events.slice(n)),t.events.length=s,l(e)}return s(e)}function l(a){if(r===n.length){if(!i)return f(a);if(i.currentConstruct&&i.currentConstruct.concrete)return m(a);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(RX,u,d)(a)}function u(e){return i&&v(),_(r),f(e)}function d(e){return t.parser.lazy[t.now().line]=r!==n.length,o=t.now().offset,m
vendor: 5,099 bytes, line 467
467(e)}function f(n){return t.containerState={},e.attempt(RX,p,m)(n)}function p(e){return r++,n.push([t.currentConstruct,t.containerState]),f(e)}function m(n){if(n===null){i&&v(),_(0),e.consume(n);return}return i||=t.parser.flow(t.now()),e.enter(`chunkFlow`,{_tokenizer:i,contentType:`flow`,previous:a}),h(n)}function h(n){if(n===null){g(e.exit(`chunkFlow`),!0),_(0),e.consume(n);return}return DX(n)?(e.consume(n),g(e.exit(`chunkFlow`)),r=0,t.interrupt=void 0,s):(e.consume(n),h)}function g(e,n){let s=t.sliceStream(e);if(n&&s.push(null),e.previous=a,a&&(a.next=e),a=e,i.defineSkip(e.start),i.write(s),t.parser.lazy[e.start.line]){let e=i.events.length;for(;e--;)if(i.events[e][1].start.offset<o&&(!i.events[e][1].end||i.events[e][1].end.offset>o))return;let n=t.events.length,a=n,s,c;for(;a--;)if(t.events[a][0]===`exit`&&t.events[a][1].type===`chunkFlow`){if(s){c=t.events[a][1].end;break}s=!0}for(_(r),e=n;e<t.events.length;)t.events[e][1].end={...c},e++;fX(t.events,a+1,0,t.events.slice(n)),t.events.length=e}}function _(r){let i=n.length;for(;i-- >r;){let r=n[i];t.containerState=r[1],r[0].exit.call(t,e)}n.length=r}function v(){i.write([null]),a=void 0,i=void 0,t.containerState._closeFlow=void 0}}function BX(e,t,n){return PX(e,e.attempt(this.parser.constructs.document,t,n),`linePrefix`,this.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)}function VX(e){if(e===null||OX(e)||jX(e))return 1;if(AX(e))return 2}function HX(e,t,n){let r=[],i=-1;for(;++i<e.length;){let a=e[i].resolveAll;a&&!r.includes(a)&&(t=a(t,n),r.push(a))}return t}var UX={name:`attention`,resolveAll:WX,tokenize:GX};function WX(e,t){let n=-1,r,i,a,o,s,c,l,u;for(;++n<e.length;)if(e[n][0]===`enter`&&e[n][1].type===`attentionSequence`&&e[n][1]._close){for(r=n;r--;)if(e[r][0]===`exit`&&e[r][1].type===`attentionSequence`&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;c=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;let d={...e[r][1].end},f={...e[n][1].start};KX(d,-c),KX(f,c),o={type:c>1?`strongSequence`:`emphasisSequence`,start:d,end:{...e[r][1].end}},s={type:c>1?`strongSequence`:`emphasisSequence`,start:{...e[n][1].start},end:f},a={type:c>1?`strongText`:`emphasisText`,start:{...e[r][1].end},end:{...e[n][1].start}},i={type:c>1?`strong`:`emphasis`,start:{...o.start},end:{...s.end}},e[r][1].end={...o.start},e[n][1].start={...s.end},l=[],e[r][1].end.offset-e[r][1].start.offset&&(l=pX(l,[[`enter`,e[r][1],t],[`exit`,e[r][1],t]])),l=pX(l,[[`enter`,i,t],[`enter`,o,t],[`exit`,o,t],[`enter`,a,t]]),l=pX(l,HX(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),l=pX(l,[[`exit`,a,t],[`enter`,s,t],[`exit`,s,t],[`exit`,i,t]]),e[n][1].end.offset-e[n][1].start.offset?(u=2,l=pX(l,[[`enter`,e[n][1],t],[`exit`,e[n][1],t]])):u=0,fX(e,r-1,n-r+3,l),n=r+l.length-u-2;break}}for(n=-1;++n<e.length;)e[n][1].type===`attentionSequence`&&(e[n][1].type=`data`);return e}function GX(e,t){let n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=VX(r),a;return o;function o(t){return a=t,e.enter(`attentionSequence`),s(t)}function s(o){if(o===a)return e.consume(o),s;let c=e.exit(`attentionSequence`),l=VX(o),u=!l||l===2&&i||n.includes(o),d=!i||i===2&&l||n.includes(r);return c._open=!!(a===42?u:u&&(i||!d)),c._close=!!(a===42?d:d&&(l||!u)),t(o)}}function KX(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}var qX={name:`autolink`,tokenize:JX};function JX(e,t,n){let r=0;return i;function i(t){return e.enter(`autolink`),e.enter(`autolinkMarker`),e.consume(t),e.exit(`autolinkMarker`),e.enter(`autolinkProtocol`),a}function a(t){return bX(t)?(e.consume(t),o):t===64?n(t):l(t)}function o(e){return e===43||e===45||e===46||xX(e)?(r=1,s(e)):l(e)}function s(t){return t===58?(e.consume(t),r=0,c):(t===43||t===45||t===46||xX(t))&&r++<32?(e.consume(t),s):(r=0,l(t))}function c(r){return r===62?(e.exit(`autolinkProtocol`),e.enter(`autolinkMarker`),e.consume(r),e.exit(`autolinkMarker`),e.exit(`autolink`),t):r===null||r===32||r===60||CX(r)?n(r):(e.consume(r),c)}function l(t){return t===64?(e.consume(t),u):SX(t)?(e.consume(t),l):n(t)}function u(e){return xX(e)?d(e):n(e)}function d(n){return n===46?(e.consume(n),r=0,u):n===62?(e.exit(`autolinkProtocol`).type=`autolinkEmail`,e.enter(`autolinkMarker`),e.consume(n),e.exit(`autolinkMarker`),e.exit(`autolink`),t):f(n)}function f(t){if((t===45||xX(t))&&r++<63){let n=t===45?f:d;return e.consume(t),n}return n(t)}}var YX={partial:!0,tokenize:XX};function XX(e,t,n){return r;function r(t){return kX(t)?PX(e,i,`linePrefix`)(t):i(t)}function i(e){return e===null||DX(e)?t(e):n(e)}}var ZX={continuation:{tokenize:$X},exit:eZ,name:`blockQuote`,tokenize:QX};function QX(e,t,n){let r=this;return i;function i(t){if(t===62){let n=r.containerState;return n.open||=(e.enter(`blockQuote`,{_container:!0}),!0),e.enter(`blockQuotePrefix`),e.enter(`blockQuoteMarker`),e.consume(t),e.exit(`blockQuoteMarker`),a}
vendor: 18,939 bytes, line 467
467return n(t)}function a(n){return kX(n)?(e.enter(`blockQuotePrefixWhitespace`),e.consume(n),e.exit(`blockQuotePrefixWhitespace`),e.exit(`blockQuotePrefix`),t):(e.exit(`blockQuotePrefix`),t(n))}}function $X(e,t,n){let r=this;return i;function i(t){return kX(t)?PX(e,a,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):a(t)}function a(r){return e.attempt(ZX,t,n)(r)}}function eZ(e){e.exit(`blockQuote`)}var tZ={name:`characterEscape`,tokenize:nZ};function nZ(e,t,n){return r;function r(t){return e.enter(`characterEscape`),e.enter(`escapeMarker`),e.consume(t),e.exit(`escapeMarker`),i}function i(r){return EX(r)?(e.enter(`characterEscapeValue`),e.consume(r),e.exit(`characterEscapeValue`),e.exit(`characterEscape`),t):n(r)}}var rZ={name:`characterReference`,tokenize:iZ};function iZ(e,t,n){let r=this,i=0,a,o;return s;function s(t){return e.enter(`characterReference`),e.enter(`characterReferenceMarker`),e.consume(t),e.exit(`characterReferenceMarker`),c}function c(t){return t===35?(e.enter(`characterReferenceMarkerNumeric`),e.consume(t),e.exit(`characterReferenceMarkerNumeric`),l):(e.enter(`characterReferenceValue`),a=31,o=xX,u(t))}function l(t){return t===88||t===120?(e.enter(`characterReferenceMarkerHexadecimal`),e.consume(t),e.exit(`characterReferenceMarkerHexadecimal`),e.enter(`characterReferenceValue`),a=6,o=TX,u):(e.enter(`characterReferenceValue`),a=7,o=wX,u(t))}function u(s){if(s===59&&i){let i=e.exit(`characterReferenceValue`);return o===xX&&!dX(r.sliceSerialize(i))?n(s):(e.enter(`characterReferenceMarker`),e.consume(s),e.exit(`characterReferenceMarker`),e.exit(`characterReference`),t)}return o(s)&&i++<a?(e.consume(s),u):n(s)}}var aZ={partial:!0,tokenize:cZ},oZ={concrete:!0,name:`codeFenced`,tokenize:sZ};function sZ(e,t,n){let r=this,i={partial:!0,tokenize:x},a=0,o=0,s;return c;function c(e){return l(e)}function l(t){let n=r.events[r.events.length-1];return a=n&&n[1].type===`linePrefix`?n[2].sliceSerialize(n[1],!0).length:0,s=t,e.enter(`codeFenced`),e.enter(`codeFencedFence`),e.enter(`codeFencedFenceSequence`),u(t)}function u(t){return t===s?(o++,e.consume(t),u):o<3?n(t):(e.exit(`codeFencedFenceSequence`),kX(t)?PX(e,d,`whitespace`)(t):d(t))}function d(n){return n===null||DX(n)?(e.exit(`codeFencedFence`),r.interrupt?t(n):e.check(aZ,h,b)(n)):(e.enter(`codeFencedFenceInfo`),e.enter(`chunkString`,{contentType:`string`}),f(n))}function f(t){return t===null||DX(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),d(t)):kX(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),PX(e,p,`whitespace`)(t)):t===96&&t===s?n(t):(e.consume(t),f)}function p(t){return t===null||DX(t)?d(t):(e.enter(`codeFencedFenceMeta`),e.enter(`chunkString`,{contentType:`string`}),m(t))}function m(t){return t===null||DX(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceMeta`),d(t)):t===96&&t===s?n(t):(e.consume(t),m)}function h(t){return e.attempt(i,b,g)(t)}function g(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),_}function _(t){return a>0&&kX(t)?PX(e,v,`linePrefix`,a+1)(t):v(t)}function v(t){return t===null||DX(t)?e.check(aZ,h,b)(t):(e.enter(`codeFlowValue`),y(t))}function y(t){return t===null||DX(t)?(e.exit(`codeFlowValue`),v(t)):(e.consume(t),y)}function b(n){return e.exit(`codeFenced`),t(n)}function x(e,t,n){let i=0;return a;function a(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),c}function c(t){return e.enter(`codeFencedFence`),kX(t)?PX(e,l,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):l(t)}function l(t){return t===s?(e.enter(`codeFencedFenceSequence`),u(t)):n(t)}function u(t){return t===s?(i++,e.consume(t),u):i>=o?(e.exit(`codeFencedFenceSequence`),kX(t)?PX(e,d,`whitespace`)(t):d(t)):n(t)}function d(r){return r===null||DX(r)?(e.exit(`codeFencedFence`),t(r)):n(r)}}}function cZ(e,t,n){let r=this;return i;function i(t){return t===null?n(t):(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),a)}function a(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}var lZ={name:`codeIndented`,tokenize:dZ},uZ={partial:!0,tokenize:fZ};function dZ(e,t,n){let r=this;return i;function i(t){return e.enter(`codeIndented`),PX(e,a,`linePrefix`,5)(t)}function a(e){let t=r.events[r.events.length-1];return t&&t[1].type===`linePrefix`&&t[2].sliceSerialize(t[1],!0).length>=4?o(e):n(e)}function o(t){return t===null?c(t):DX(t)?e.attempt(uZ,o,c)(t):(e.enter(`codeFlowValue`),s(t))}function s(t){return t===null||DX(t)?(e.exit(`codeFlowValue`),o(t)):(e.consume(t),s)}function c(n){return e.exit(`codeIndented`),t(n)}}function fZ(e,t,n){let r=this;return i;function i(t){return r.parser.lazy[r.now().line]?n(t):DX(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),i):PX(e,a,`linePrefix`,5)(t)}function a(e){let a=r.events[r.events.length-1];return a&&a[1].type===`linePrefix`&&a[2].sliceSerialize(a[1],!0).length>=4?t(e):DX(e)?i(e):n(e)}}var pZ={name:`codeText`,previous:hZ,resolve:mZ,tokenize:gZ};function mZ(e){let t=e.length-4,n=3,r,i;if((e[n][1].type===`lineEnding`||e[n][1].type===`space`)&&(e[t][1].type===`lineEnding`||e[t][1].type===`space`)){for(r=n;++r<t;)if(e[r][1].type===`codeTextData`){e[n][1].type=`codeTextPadding`,e[t][1].type=`codeTextPadding`,n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)i===void 0?r!==t&&e[r][1].type!==`lineEnding`&&(i=r):(r===t||e[r][1].type===`lineEnding`)&&(e[i][1].type=`codeTextData`,r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function hZ(e){return e!==96||this.events[this.events.length-1][1].type===`characterEscape`}function gZ(e,t,n){let r=0,i,a;return o;function o(t){return e.enter(`codeText`),e.enter(`codeTextSequence`),s(t)}function s(t){return t===96?(e.consume(t),r++,s):(e.exit(`codeTextSequence`),c(t))}function c(t){return t===null?n(t):t===32?(e.enter(`space`),e.consume(t),e.exit(`space`),c):t===96?(a=e.enter(`codeTextSequence`),i=0,u(t)):DX(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),c):(e.enter(`codeTextData`),l(t))}function l(t){return t===null||t===32||t===96||DX(t)?(e.exit(`codeTextData`),c(t)):(e.consume(t),l)}function u(n){return n===96?(e.consume(n),i++,u):i===r?(e.exit(`codeTextSequence`),e.exit(`codeText`),t(n)):(a.type=`codeTextData`,l(n))}}var _Z=class{constructor(e){this.left=e?[...e]:[],this.right=[]}get(e){if(e<0||e>=this.left.length+this.right.length)throw RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return e<this.left.length?this.left[e]:this.right[this.right.length-e+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(e,t){let n=t??1/0;return n<this.left.length?this.left.slice(e,n):e>this.left.length?this.right.slice(this.right.length-n+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-n+this.left.length).reverse())}splice(e,t,n){let r=t||0;this.setCursor(Math.trunc(e));let i=this.right.splice(this.right.length-r,1/0);return n&&vZ(this.left,n),i.reverse()}pop(){return this.setCursor(1/0),this.left.pop()}push(e){this.setCursor(1/0),this.left.push(e)}pushMany(e){this.setCursor(1/0),vZ(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),vZ(this.right,e.reverse())}setCursor(e){if(!(e===this.left.length||e>this.left.length&&this.right.length===0||e<0&&this.left.length===0))if(e<this.left.length){let t=this.left.splice(e,1/0);vZ(this.right,t.reverse())}else{let t=this.right.splice(this.left.length+this.right.length-e,1/0);vZ(this.left,t.reverse())}}};function vZ(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function yZ(e){let t={},n=-1,r,i,a,o,s,c,l,u=new _Z(e);for(;++n<u.length;){for(;n in t;)n=t[n];if(r=u.get(n),n&&r[1].type===`chunkFlow`&&u.get(n-1)[1].type===`listItemPrefix`&&(c=r[1]._tokenizer.events,a=0,a<c.length&&c[a][1].type===`lineEndingBlank`&&(a+=2),a<c.length&&c[a][1].type===`content`))for(;++a<c.length&&c[a][1].type!==`content`;)c[a][1].type===`chunkText`&&(c[a][1]._isInFirstContentOfListItem=!0,a++);if(r[0]===`enter`)r[1].contentType&&(Object.assign(t,bZ(u,n)),n=t[n],l=!0);else if(r[1]._container){for(a=n,i=void 0;a--;)if(o=u.get(a),o[1].type===`lineEnding`||o[1].type===`lineEndingBlank`)o[0]===`enter`&&(i&&(u.get(i)[1].type=`lineEndingBlank`),o[1].type=`lineEnding`,i=a);else if(!(o[1].type===`linePrefix`||o[1].type===`listItemIndent`))break;i&&(r[1].end={...u.get(i)[1].start},s=u.slice(i,n),s.unshift(r),u.splice(i,n-i+1,s))}}return fX(e,0,1/0,u.slice(0)),!l}function bZ(e,t){let n=e.get(t)[1],r=e.get(t)[2],i=t-1,a=[],o=n._tokenizer;o||(o=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(o._contentTypeTextTrailing=!0));let s=o.events,c=[],l={},u,d,f=-1,p=n,m=0,h=0,g=[h];for(;p;){for(;e.get(++i)[1]!==p;);a.push(i),p._tokenizer||(u=r.sliceStream(p),p.next||u.push(null),d&&o.defineSkip(p.start),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=!0),o.write(u),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=void 0)),d=p,p=p.next}for(p=n;++f<s.length;)s[f][0]===`exit`&&s[f-1][0]===`enter`&&s[f][1].type===s[f-1][1].type&&s[f][1].start.line!==s[f][1].end.line&&(h=f+1,g.push(h),p._tokenizer=void 0,p.previous=void 0,p=p.next);for(o.events=[],p?(p._tokenizer=void 0,p.previous=void 0):g.pop(),f=g.length;f--;){let t=s.slice(g[f],g[f+1]),n=a.pop();c.push([n,n+t.length-1]),e.splice(n,2,t)}for(c.reverse(),f=-1;++f<c.length;)l[m+c[f][0]]=m+c[f][1],m+=c[f][1]-c[f][0]-1;return l}var xZ={resolve:CZ,tokenize:wZ},SZ={partial:!0,tokenize:TZ};function CZ(e){return yZ(e),e}function wZ(e,t){let n;return r;function r(t){return e.enter(`content`),n=e.enter(`chunkContent`,{contentType:`content`}),i(t)}function i(t){return t===null?a(t):DX(t)?e.check(SZ,o,a)(t):(e.consume(t),i)}function a(n){return e.exit(`chunkContent`),e.exit(`content`),t(n)}function o(t){return e.consume(t),e.exit(`chunkContent`),n.next=e.enter(`chunkContent`,{contentType:`content`,previous:n}),n=n.next,i}}function TZ(e,t,n){let r=this;return i;function i(t){return e.exit(`chunkContent`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),PX(e,a,`linePrefix`)}function a(i){if(i===null||DX(i))return n(i);let a=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes(`codeIndented`)&&a&&a[1].type===`linePrefix`&&a[2].sliceSerialize(a[1],!0).length>=4?t(i):e.interrupt(r.parser.constructs.flow,n,t)(i)}}function EZ(e,t,n,r,i,a,o,s,c){let l=c||1/0,u=0;return d;function d(t){return t===60?(e.enter(r),e.enter(i),e.enter(a),e.consume(t),e.exit(a),f):t===null||t===32||t===41||CX(t)?n(t):(e.enter(r),e.enter(o),e.enter(s),e.enter(`chunkString`,{contentType:`string`}),h(t))}function f(n){return n===62?(e.enter(a),e.consume(n),e.exit(a),e.exit(i),e.exit(r),t):(e.enter(s),e.enter(`chunkString`,{contentType:`string`}),p(n))}function p(t){return t===62?(e.exit(`chunkString`),e.exit(s),f(t)):t===null||t===60||DX(t)?n(t):(e.consume(t),t===92?m:p)}function m(t){return t===60||t===62||t===92?(e.consume(t),p):p(t)}function h(i){return!u&&(i===null||i===41||OX(i))?(e.exit(`chunkString`),e.exit(s),e.exit(o),e.exit(r),t(i)):u<l&&i===40?(e.consume(i),u++,h):i===41?(e.consume(i),u--,h):i===null||i===32||i===40||CX(i)?n(i):(e.consume(i),i===92?g:h)}function g(t){return t===40||t===41||t===92?(e.consume(t),h):h(t)}}function DZ(e,t,n,r,i,a){let o=this,s=0,c;return l;function l(t){return e.enter(r),e.enter(i),e.consume(t),e.exit(i),e.enter(a),u}function u(l){return s>999||l===null||l===91||l===93&&!c||l===94&&!s&&`_hiddenFootnoteSupport`in o.parser.constructs?n(l):l===93?(e.exit(a),e.enter(i),e.consume(l),e.exit(i),e.exit(r),t):DX(l)?(e.enter(`lineEnding`),e.consume(l),e.exit(`lineEnding`),u):(e.enter(`chunkString`,{contentType:`string`}),d(l))}function d(t){return t===null||t===91||t===93||DX(t)||s++>999?(e.exit(`chunkString`),u(t)):(e.consume(t),c||=!kX(t),t===92?f:d)}function f(t){return t===91||t===92||t===93?(e.consume(t),s++,d):d(t)}}function OZ(e,t,n,r,i,a){let o;return s;function s(t){return t===34||t===39||t===40?(e.enter(r),e.enter(i),e.consume(t),e.exit(i),o=t===40?41:t,c):n(t)}function c(n){return n===o?(e.enter(i),e.consume(n),e.exit(i),e.exit(r),t):(e.enter(a),l(n))}function l(t){return t===o?(e.exit(a),c(o)):t===null?n(t):DX(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),PX(e,l,`linePrefix`)):(e.enter(`chunkString`,{contentType:`string`}),u(t))}function u(t){return t===o||t===null||DX(t)?(e.exit(`chunkString`),l(t)):(e.consume(t),t===92?d:u)}function d(t){return t===o||t===92?(e.consume(t),u):u(t)}}function kZ(e,t){let n;return r;function r(i){return DX(i)?(e.enter(`lineEnding`),e.consume(i),e.exit(`lineEnding`),n=!0,r):kX(i)?PX(e,r,n?`linePrefix`:`lineSuffix`)(i):t(i)}}var AZ={name:`definition`,tokenize:MZ},jZ={partial:!0,tokenize:NZ};function MZ(e,t,n){let r=this,i;return a;function a(t){return e.enter(`definition`),o(t)}function o(t){return DZ.call(r,e,s,n,`definitionLabel`,`definitionLabelMarker`,`definitionLabelString`)(t)}function s(t){return i=yX(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),t===58?(e.enter(`definitionMarker`),e.consume(t),e.exit(`definitionMarker`),c):n(t)}function c(t){return OX(t)?kZ(e,l)(t):l(t)}function l(t){return EZ(e,u,n,`definitionDestination`,`definitionDestinationLiteral`,`definitionDestinationLiteralMarker`,`definitionDestinationRaw`,`definitionDestinationString`)(t)}function u(t){return e.attempt(jZ,d,d)(t)}function d(t){return kX(t)?PX(e,f,`whitespace`)(t):f(t)}function f(a){return a===null||DX(a)?(e.exit(`definition`),r.parser.defined.push(i),t(a)):n(a)}}function NZ(e,t,n){return r;function r(t){return OX(t)?kZ(e,i)(t):n(t)}function i(t){return OZ(e,a,n,`definitionTitle`,`definitionTitleMarker`,`definitionTitleString`)(t)}function a(t){return kX(t)?PX(e,o,`whitespace`)(t):o(t)}function o(e){return e===null||DX(e)?t(e):n(e)}}var PZ={name:`hardBreakEscape`,tokenize:FZ};function FZ(e,t,n){return r;function r(t){return e.enter(`hardBreakEscape`),e.consume(t),i}function i(r){return DX(r)?(e.exit(`hardBreakEscape`),t(r)):n(r)}}var IZ={name:`headingAtx`,resolve:LZ,tokenize:RZ};function LZ(e,t){let n=e.length-2,r=3,i,a;return e[r][1].type===`whitespace`&&(r+=2),n-2>r&&e[n][1].type===`whitespace`&&(n-=2),e[n][1].type===`atxHeadingSequence`&&(r===n-1||n-4>r&&e[n-2][1].type===`whitespace`)&&(n-=r+1===n?2:4),n>r&&(i={type:`atxHeadingText`,start:e[r][1].start,end:e[n][1].end},a={type:`chunkText`,start:e[r][1].start,end:e[n][1].end,contentType:`text`},fX(e,r,n-r+1,[[`enter`,i,t],[`enter`,a,t],[`exit`,a,t],[`exit`,i,t]])),e}function RZ(e,t,n){let r=0;return i;function i(t){return e.enter(`atxHeading`),a(t)}function a(t){return e.enter(`atxHeadingSequence`),o(t)}function o(t){return t===35&&r++<6?(e.consume(t),o):t===null||OX(t)?(e.exit(`atxHeadingSequence`),s(t)):n(t)}function s(n){return n===35?(e.enter(`atxHeadingSequence`),c(n)):n===null||DX(n)?(e.exit(`atxHeading`),t(n)):kX(n)?PX(e,s,`whitespace`)(n):(e.enter(`atxHeadingText`),l(n))}function c(t){return t===35?(e.consume(t),c):(e.exit(`atxHeadingSequence`),s(t))}function l(t){return t===null||t===35||OX(t)?(e.exit(`atxHeadingText`),s(t)):(e.consume(t),l)}}var zZ=`address.article.aside.base.basefont.blockquote.body.caption.center.col.colgroup.dd.details.dialog.dir.div.dl.dt.fieldset.figcaption.figure.footer.form.frame.frameset.h1.h2.h3.h4.h5.h6.head.header.hr.html.iframe.legend.li.link.main.menu.menuitem.nav.noframes.ol.optgroup.option.p.param.search.section.summary.table.tbody.td.tfoot.th.thead.title.tr.track.ul`.split(`.`),BZ=[`pre`,`script`,`style`,`textarea`],VZ={concrete:!0,name:`htmlFlow`,resolveTo:WZ,tokenize:GZ},HZ={partial:!0,tokenize:qZ},UZ={partial:!0,tokenize:KZ};function WZ(e){let t=e.length;for(;t--&&!(e[t][0]===`enter`&&e[t][1].type===`htmlFlow`););return t>1&&e[t-2][1].type===`linePrefix`&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function GZ(e,t,n){let r=this,i,a,o,s,c;return l;function l(e){return u(e)}function u(t){return e.enter(`htmlFlow`),e.enter(`htmlFlowData`),e.consume(t),d}function d(s){return s===33?(e.consume(s),f):s===47?(e.consume(s),a=!0,h):s===63?(e.consume(s),i=3,r.interrupt?t:F):bX(s)?(e.consume(s),o=String.fromCharCode(s),g):n(s)}function f(a){return a===45?(e.consume(a),i=2,p):a===91?(e.consume(a),i=5,s=0,m):bX(a)?(e.consume(a),i=4,r.interrupt?t:F):n(a)}function p(i){return i===45?(e.consume(i),r.interrupt?t:F):n(i)}function m(i){return i===`CDATA[`.charCodeAt(s++)?(e.consume(i),s===6?r.interrupt?t:O:m):n(i)}function h(t){return bX(t)?(e.consume(t),o=String.fromCharCode(t),g):n(t)}function g(s){if(s===null||s===47||s===62||OX(s)){let c=s===47,l=o.toLowerCase();return!c&&!a&&BZ.includes(l)?(i=1,r.interrupt?t(s):O(s)):zZ.includes(o.toLowerCase())?(i=6,c?(e.consume(s),_):r.interrupt?t(s):O(s)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(s):a?v(s):y(s))}return s===45||xX(s)?(e.consume(s),o+=String.fromCharCode(s),g):n(s)}function _(i){return i===62?(e.consume(i),r.interrupt?t:O):n(i)}function v(t){return kX(t)?(e.consume(t),v):E(t)}function y(t){return t===47?(e.consume(t),E):t===58||t===95||bX(t)?(e.consume(t),b):kX(t)?(e.consume(t),y):E(t)}function b(t){return t===45||t===46||t===58||t===95||xX(t)?(e.consume(t),b):x(t)}function x(t){return t===61?(e.consume(t),S):kX(t)?(e.consume(t),x):y(t)}function S(t){return t===null||t===60||t===61||t===62||t===96?n(t):t===34||t===39?(e.consume(t),c=t,C):kX(t)?(e.consume(t),S):w(t)}function C(t){return t===c?(e.consume(t),c=null,T):t===null||DX(t)?n(t):(e.consume(t),C)}function w(t){return t===null||t===34||t===39||t===47||t===60||t===61||t===62||t===96||OX(t)?x(t):(e.consume(t),w)}function T(e){return e===47||e===62||kX(e)?y(e):n(e)}function E(t){return t===62?(e.consume(t),D):n(t)}function D(t){return t===null||DX(t)?O(t):kX(t)?(e.consume(t),D):n(t)}function O(t){return t===45&&i===2?(e.consume(t),M):t===60&&i===1?(e.consume(t),N):t===62&&i===4?(e.consume(t),te):t===63&&i===3?(e.consume(t),F):t===93&&i===5?(e.consume(t),ee):DX(t)&&(i===6||i===7)?(e.exit(`htmlFlowData`),e.check(HZ,ne,k)(t)):t===null||DX(t)?(e.exit(`htmlFlowData`),k(t)):(e.consume(t),O)}function k(t){return e.check(UZ,A,ne)(t)}function A(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),j}function j(t){return t===null||DX(t)?k(t):(e.enter(`htmlFlowData`),O(t))}function M(t){return t===45?(e.consume(t),F):O(t)}function N(t){return t===47?(e.consume(t),o=``,P):O(t)}function P(t){if(t===62){let n=o.toLowerCase();return BZ.includes(n)?(e.consume(t),te):O(t)}return bX(t)&&o.length<8?(e.consume(t),o+=String.fromCharCode(t),P):O(t)}function ee(t){return t===93?(e.consume(t),F):O(t)}function F(t){return t===62?(e.consume(t),te):t===45&&i===2?(e.consume(t),F):O(t)}function te(t){return t===null||DX(t)?(e.exit(`htmlFlowData`),ne(t)):(e.consume(t),te)}function ne(n){return e.exit(`htmlFlow`),t(n)}}
vendor: 17,680 bytes, lines 467-469
467function KZ(e,t,n){let r=this;return i;function i(t){return DX(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),a):n(t)}function a(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}function qZ(e,t,n){return r;function r(r){return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),e.attempt(YX,t,n)}}var JZ={name:`htmlText`,tokenize:YZ};function YZ(e,t,n){let r=this,i,a,o;return s;function s(t){return e.enter(`htmlText`),e.enter(`htmlTextData`),e.consume(t),c}function c(t){return t===33?(e.consume(t),l):t===47?(e.consume(t),x):t===63?(e.consume(t),y):bX(t)?(e.consume(t),w):n(t)}function l(t){return t===45?(e.consume(t),u):t===91?(e.consume(t),a=0,m):bX(t)?(e.consume(t),v):n(t)}function u(t){return t===45?(e.consume(t),p):n(t)}function d(t){return t===null?n(t):t===45?(e.consume(t),f):DX(t)?(o=d,N(t)):(e.consume(t),d)}function f(t){return t===45?(e.consume(t),p):d(t)}function p(e){return e===62?M(e):e===45?f(e):d(e)}function m(t){return t===`CDATA[`.charCodeAt(a++)?(e.consume(t),a===6?h:m):n(t)}function h(t){return t===null?n(t):t===93?(e.consume(t),g):DX(t)?(o=h,N(t)):(e.consume(t),h)}function g(t){return t===93?(e.consume(t),_):h(t)}function _(t){return t===62?M(t):t===93?(e.consume(t),_):h(t)}function v(t){return t===null||t===62?M(t):DX(t)?(o=v,N(t)):(e.consume(t),v)}function y(t){return t===null?n(t):t===63?(e.consume(t),b):DX(t)?(o=y,N(t)):(e.consume(t),y)}function b(e){return e===62?M(e):y(e)}function x(t){return bX(t)?(e.consume(t),S):n(t)}function S(t){return t===45||xX(t)?(e.consume(t),S):C(t)}function C(t){return DX(t)?(o=C,N(t)):kX(t)?(e.consume(t),C):M(t)}function w(t){return t===45||xX(t)?(e.consume(t),w):t===47||t===62||OX(t)?T(t):n(t)}function T(t){return t===47?(e.consume(t),M):t===58||t===95||bX(t)?(e.consume(t),E):DX(t)?(o=T,N(t)):kX(t)?(e.consume(t),T):M(t)}function E(t){return t===45||t===46||t===58||t===95||xX(t)?(e.consume(t),E):D(t)}function D(t){return t===61?(e.consume(t),O):DX(t)?(o=D,N(t)):kX(t)?(e.consume(t),D):T(t)}function O(t){return t===null||t===60||t===61||t===62||t===96?n(t):t===34||t===39?(e.consume(t),i=t,k):DX(t)?(o=O,N(t)):kX(t)?(e.consume(t),O):(e.consume(t),A)}function k(t){return t===i?(e.consume(t),i=void 0,j):t===null?n(t):DX(t)?(o=k,N(t)):(e.consume(t),k)}function A(t){return t===null||t===34||t===39||t===60||t===61||t===96?n(t):t===47||t===62||OX(t)?T(t):(e.consume(t),A)}function j(e){return e===47||e===62||OX(e)?T(e):n(e)}function M(r){return r===62?(e.consume(r),e.exit(`htmlTextData`),e.exit(`htmlText`),t):n(r)}function N(t){return e.exit(`htmlTextData`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),P}function P(t){return kX(t)?PX(e,ee,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):ee(t)}function ee(t){return e.enter(`htmlTextData`),o(t)}}var XZ={name:`labelEnd`,resolveAll:eQ,resolveTo:tQ,tokenize:nQ},ZZ={tokenize:rQ},QZ={tokenize:iQ},$Z={tokenize:aQ};function eQ(e){let t=-1,n=[];for(;++t<e.length;){let r=e[t][1];if(n.push(e[t]),r.type===`labelImage`||r.type===`labelLink`||r.type===`labelEnd`){let e=r.type===`labelImage`?4:2;r.type=`data`,t+=e}}return e.length!==n.length&&fX(e,0,e.length,n),e}function tQ(e,t){let n=e.length,r=0,i,a,o,s;for(;n--;)if(i=e[n][1],a){if(i.type===`link`||i.type===`labelLink`&&i._inactive)break;e[n][0]===`enter`&&i.type===`labelLink`&&(i._inactive=!0)}else if(o){if(e[n][0]===`enter`&&(i.type===`labelImage`||i.type===`labelLink`)&&!i._balanced&&(a=n,i.type!==`labelLink`)){r=2;break}}else i.type===`labelEnd`&&(o=n);let c={type:e[a][1].type===`labelLink`?`link`:`image`,start:{...e[a][1].start},end:{...e[e.length-1][1].end}},l={type:`label`,start:{...e[a][1].start},end:{...e[o][1].end}},u={type:`labelText`,start:{...e[a+r+2][1].end},end:{...e[o-2][1].start}};return s=[[`enter`,c,t],[`enter`,l,t]],s=pX(s,e.slice(a+1,a+r+3)),s=pX(s,[[`enter`,u,t]]),s=pX(s,HX(t.parser.constructs.insideSpan.null,e.slice(a+r+4,o-3),t)),s=pX(s,[[`exit`,u,t],e[o-2],e[o-1],[`exit`,l,t]]),s=pX(s,e.slice(o+1)),s=pX(s,[[`exit`,c,t]]),fX(e,a,e.length,s),e}function nQ(e,t,n){let r=this,i=r.events.length,a,o;for(;i--;)if((r.events[i][1].type===`labelImage`||r.events[i][1].type===`labelLink`)&&!r.events[i][1]._balanced){a=r.events[i][1];break}return s;function s(t){return a?a._inactive?d(t):(o=r.parser.defined.includes(yX(r.sliceSerialize({start:a.end,end:r.now()}))),e.enter(`labelEnd`),e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelEnd`),c):n(t)}function c(t){return t===40?e.attempt(ZZ,u,o?u:d)(t):t===91?e.attempt(QZ,u,o?l:d)(t):o?u(t):d(t)}function l(t){return e.attempt($Z,u,d)(t)}function u(e){return t(e)}function d(e){return a._balanced=!0,n(e)}}function rQ(e,t,n){return r;function r(t){return e.enter(`resource`),e.enter(`resourceMarker`),e.consume(t),e.exit(`resourceMarker`),i}function i(t){return OX(t)?kZ(e,a)(t):a(t)}function a(t){return t===41?u(t):EZ(e,o,s,`resourceDestination`,`resourceDestinationLiteral`,`resourceDestinationLiteralMarker`,`resourceDestinationRaw`,`resourceDestinationString`,32)(t)}function o(t){return OX(t)?kZ(e,c)(t):u(t)}function s(e){return n(e)}function c(t){return t===34||t===39||t===40?OZ(e,l,n,`resourceTitle`,`resourceTitleMarker`,`resourceTitleString`)(t):u(t)}function l(t){return OX(t)?kZ(e,u)(t):u(t)}function u(r){return r===41?(e.enter(`resourceMarker`),e.consume(r),e.exit(`resourceMarker`),e.exit(`resource`),t):n(r)}}function iQ(e,t,n){let r=this;return i;function i(t){return DZ.call(r,e,a,o,`reference`,`referenceMarker`,`referenceString`)(t)}function a(e){return r.parser.defined.includes(yX(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(e):n(e)}function o(e){return n(e)}}function aQ(e,t,n){return r;function r(t){return e.enter(`reference`),e.enter(`referenceMarker`),e.consume(t),e.exit(`referenceMarker`),i}function i(r){return r===93?(e.enter(`referenceMarker`),e.consume(r),e.exit(`referenceMarker`),e.exit(`reference`),t):n(r)}}var oQ={name:`labelStartImage`,resolveAll:XZ.resolveAll,tokenize:sQ};function sQ(e,t,n){let r=this;return i;function i(t){return e.enter(`labelImage`),e.enter(`labelImageMarker`),e.consume(t),e.exit(`labelImageMarker`),a}function a(t){return t===91?(e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelImage`),o):n(t)}function o(e){return e===94&&`_hiddenFootnoteSupport`in r.parser.constructs?n(e):t(e)}}var cQ={name:`labelStartLink`,resolveAll:XZ.resolveAll,tokenize:lQ};function lQ(e,t,n){let r=this;return i;function i(t){return e.enter(`labelLink`),e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelLink`),a}function a(e){return e===94&&`_hiddenFootnoteSupport`in r.parser.constructs?n(e):t(e)}}var uQ={name:`lineEnding`,tokenize:dQ};function dQ(e,t){return n;function n(n){return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),PX(e,t,`linePrefix`)}}var fQ={name:`thematicBreak`,tokenize:pQ};function pQ(e,t,n){let r=0,i;return a;function a(t){return e.enter(`thematicBreak`),o(t)}function o(e){return i=e,s(e)}function s(a){return a===i?(e.enter(`thematicBreakSequence`),c(a)):r>=3&&(a===null||DX(a))?(e.exit(`thematicBreak`),t(a)):n(a)}function c(t){return t===i?(e.consume(t),r++,c):(e.exit(`thematicBreakSequence`),kX(t)?PX(e,s,`whitespace`)(t):s(t))}}var mQ={continuation:{tokenize:vQ},exit:bQ,name:`list`,tokenize:_Q},hQ={partial:!0,tokenize:xQ},gQ={partial:!0,tokenize:yQ};function _Q(e,t,n){let r=this,i=r.events[r.events.length-1],a=i&&i[1].type===`linePrefix`?i[2].sliceSerialize(i[1],!0).length:0,o=0;return s;function s(t){let i=r.containerState.type||(t===42||t===43||t===45?`listUnordered`:`listOrdered`);if(i===`listUnordered`?!r.containerState.marker||t===r.containerState.marker:wX(t)){if(r.containerState.type||(r.containerState.type=i,e.enter(i,{_container:!0})),i===`listUnordered`)return e.enter(`listItemPrefix`),t===42||t===45?e.check(fQ,n,l)(t):l(t);if(!r.interrupt||t===49)return e.enter(`listItemPrefix`),e.enter(`listItemValue`),c(t)}return n(t)}function c(t){return wX(t)&&++o<10?(e.consume(t),c):(!r.interrupt||o<2)&&(r.containerState.marker?t===r.containerState.marker:t===41||t===46)?(e.exit(`listItemValue`),l(t)):n(t)}function l(t){return e.enter(`listItemMarker`),e.consume(t),e.exit(`listItemMarker`),r.containerState.marker=r.containerState.marker||t,e.check(YX,r.interrupt?n:u,e.attempt(hQ,f,d))}function u(e){return r.containerState.initialBlankLine=!0,a++,f(e)}function d(t){return kX(t)?(e.enter(`listItemPrefixWhitespace`),e.consume(t),e.exit(`listItemPrefixWhitespace`),f):n(t)}function f(n){return r.containerState.size=a+r.sliceSerialize(e.exit(`listItemPrefix`),!0).length,t(n)}}function vQ(e,t,n){let r=this;return r.containerState._closeFlow=void 0,e.check(YX,i,a);function i(n){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,PX(e,t,`listItemIndent`,r.containerState.size+1)(n)}function a(n){return r.containerState.furtherBlankLines||!kX(n)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,o(n)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(gQ,t,o)(n))}function o(i){return r.containerState._closeFlow=!0,r.interrupt=void 0,PX(e,e.attempt(mQ,t,n),`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(i)}}function yQ(e,t,n){let r=this;return PX(e,i,`listItemIndent`,r.containerState.size+1);function i(e){let i=r.events[r.events.length-1];return i&&i[1].type===`listItemIndent`&&i[2].sliceSerialize(i[1],!0).length===r.containerState.size?t(e):n(e)}}function bQ(e){e.exit(this.containerState.type)}function xQ(e,t,n){let r=this;return PX(e,i,`listItemPrefixWhitespace`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:5);function i(e){let i=r.events[r.events.length-1];return!kX(e)&&i&&i[1].type===`listItemPrefixWhitespace`?t(e):n(e)}}var SQ={name:`setextUnderline`,resolveTo:CQ,tokenize:wQ};function CQ(e,t){let n=e.length,r,i,a;for(;n--;)if(e[n][0]===`enter`){if(e[n][1].type===`content`){r=n;break}e[n][1].type===`paragraph`&&(i=n)}else e[n][1].type===`content`&&e.splice(n,1),!a&&e[n][1].type===`definition`&&(a=n);let o={type:`setextHeading`,start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type=`setextHeadingText`,a?(e.splice(i,0,[`enter`,o,t]),e.splice(a+1,0,[`exit`,e[r][1],t]),e[r][1].end={...e[a][1].end}):e[r][1]=o,e.push([`exit`,o,t]),e}function wQ(e,t,n){let r=this,i;return a;function a(t){let a=r.events.length,s;for(;a--;)if(r.events[a][1].type!==`lineEnding`&&r.events[a][1].type!==`linePrefix`&&r.events[a][1].type!==`content`){s=r.events[a][1].type===`paragraph`;break}return!r.parser.lazy[r.now().line]&&(r.interrupt||s)?(e.enter(`setextHeadingLine`),i=t,o(t)):n(t)}function o(t){return e.enter(`setextHeadingLineSequence`),s(t)}function s(t){return t===i?(e.consume(t),s):(e.exit(`setextHeadingLineSequence`),kX(t)?PX(e,c,`lineSuffix`)(t):c(t))}function c(r){return r===null||DX(r)?(e.exit(`setextHeadingLine`),t(r)):n(r)}}var TQ={tokenize:EQ};function EQ(e){let t=this,n=e.attempt(YX,r,e.attempt(this.parser.constructs.flowInitial,i,PX(e,e.attempt(this.parser.constructs.flow,i,e.attempt(xZ,i)),`linePrefix`)));return n;function r(r){if(r===null){e.consume(r);return}return e.enter(`lineEndingBlank`),e.consume(r),e.exit(`lineEndingBlank`),t.currentConstruct=void 0,n}function i(r){if(r===null){e.consume(r);return}return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),t.currentConstruct=void 0,n}}var DQ={resolveAll:jQ()},OQ=AQ(`string`),kQ=AQ(`text`);function AQ(e){return{resolveAll:jQ(e===`text`?MQ:void 0),tokenize:t};function t(t){let n=this,r=this.parser.constructs[e],i=t.attempt(r,a,o);return a;function a(e){return c(e)?i(e):o(e)}function o(e){if(e===null){t.consume(e);return}return t.enter(`data`),t.consume(e),s}function s(e){return c(e)?(t.exit(`data`),i(e)):(t.consume(e),s)}function c(e){if(e===null)return!0;let t=r[e],i=-1;if(t)for(;++i<t.length;){let e=t[i];if(!e.previous||e.previous.call(n,n.previous))return!0}return!1}}}function jQ(e){return t;function t(t,n){let r=-1,i;for(;++r<=t.length;)i===void 0?t[r]&&t[r][1].type===`data`&&(i=r,r++):(!t[r]||t[r][1].type!==`data`)&&(r!==i+2&&(t[i][1].end=t[r-1][1].end,t.splice(i+2,r-i-2),r=i+2),i=void 0);return e?e(t,n):t}}function MQ(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type===`lineEnding`)&&e[n-1][1].type===`data`){let r=e[n-1][1],i=t.sliceStream(r),a=i.length,o=-1,s=0,c;for(;a--;){let e=i[a];if(typeof e==`string`){for(o=e.length;e.charCodeAt(o-1)===32;)s++,o--;if(o)break;o=-1}else if(e===-2)c=!0,s++;else if(e!==-1){a++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(s=0),s){let i={type:n===e.length||c||s<2?`lineSuffix`:`hardBreakTrailing`,start:{_bufferIndex:a?o:r.start._bufferIndex+o,_index:r.start._index+a,line:r.end.line,column:r.end.column-s,offset:r.end.offset-s},end:{...r.end}};r.end={...i.start},r.start.offset===r.end.offset?Object.assign(r,i):(e.splice(n,0,[`enter`,i,t],[`exit`,i,t]),n+=2)}n++}return e}var NQ=e({attentionMarkers:()=>VQ,contentInitial:()=>FQ,disable:()=>HQ,document:()=>PQ,flow:()=>LQ,flowInitial:()=>IQ,insideSpan:()=>BQ,string:()=>RQ,text:()=>zQ}),PQ={42:mQ,43:mQ,45:mQ,48:mQ,49:mQ,50:mQ,51:mQ,52:mQ,53:mQ,54:mQ,55:mQ,56:mQ,57:mQ,62:ZX},FQ={91:AZ},IQ={[-2]:lZ,[-1]:lZ,32:lZ},LQ={35:IZ,42:fQ,45:[SQ,fQ],60:VZ,61:SQ,95:fQ,96:oZ,126:oZ},RQ={38:rZ,92:tZ},zQ={[-5]:uQ,[-4]:uQ,[-3]:uQ,33:oQ,38:rZ,42:UX,60:[qX,JZ],91:cQ,92:[PZ,tZ],93:XZ,95:UX,96:pZ},BQ={null:[UX,DQ]},VQ={null:[42,95]},HQ={null:[]};function UQ(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0},i={},a=[],o=[],s=[],c={attempt:C(x),check:C(S),consume:v,enter:y,exit:b,interrupt:C(S,{interrupt:!0})},l={code:null,containerState:{},defineSkip:h,events:[],now:m,parser:e,previous:null,sliceSerialize:f,sliceStream:p,write:d},u=t.tokenize.call(l,c);return t.resolveAll&&a.push(t),l;function d(e){return o=pX(o,e),g(),o[o.length-1]===null?(w(t,0),l.events=HX(a,l.events,l),l.events):[]}function f(e,t){return GQ(p(e),t)}function p(e){return WQ(o,e)}function m(){let{_bufferIndex:e,_index:t,line:n,column:i,offset:a}=r;return{_bufferIndex:e,_index:t,line:n,column:i,offset:a}}function h(e){i[e.line]=e.column,E()}function g(){let e;for(;r._index<o.length;){let t=o[r._index];if(typeof t==`string`)for(e=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===e&&r._bufferIndex<t.length;)_(t.charCodeAt(r._bufferIndex));else _(t)}}function _(e){u=u(e)}function v(e){DX(e)?(r.line++,r.column=1,r.offset+=e===-3?2:1,E()):e!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===o[r._index].length&&(r._bufferIndex=-1,r._index++)),l.previous=e}function y(e,t){let n=t||{};return n.type=e,n.start=m(),l.events.push([`enter`,n,l]),s.push(n),n}function b(e){let t=s.pop();return t.end=m(),l.events.push([`exit`,t,l]),t}function x(e,t){w(e,t.from)}function S(e,t){t.restore()}function C(e,t){return n;function n(n,r,i){let a,o,s,u;return Array.isArray(n)?f(n):`tokenize`in n?f([n]):d(n);function d(e){return t;function t(t){let n=t!==null&&e[t],r=t!==null&&e.null;return f([...Array.isArray(n)?n:n?[n]:[],...Array.isArray(r)?r:r?[r]:[]])(t)}}function f(e){return a=e,o=0,e.length===0?i:p(e[o])}function p(e){return n;function n(n){return u=T(),s=e,e.partial||(l.currentConstruct=e),e.name&&l.parser.constructs.disable.null.includes(e.name)?h(n):e.tokenize.call(t?Object.assign(Object.create(l),t):l,c,m,h)(n)}}function m(t){return e(s,u),r}function h(e){return u.restore(),++o<a.length?p(a[o]):i}}}function w(e,t){e.resolveAll&&!a.includes(e)&&a.push(e),e.resolve&&fX(l.events,t,l.events.length-t,e.resolve(l.events.slice(t),l)),e.resolveTo&&(l.events=e.resolveTo(l.events,l))}function T(){let e=m(),t=l.previous,n=l.currentConstruct,i=l.events.length,a=Array.from(s);return{from:i,restore:o};function o(){r=e,l.previous=t,l.currentConstruct=n,l.events.length=i,s=a,E()}}function E(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function WQ(e,t){let n=t.start._index,r=t.start._bufferIndex,i=t.end._index,a=t.end._bufferIndex,o;if(n===i)o=[e[n].slice(r,a)];else{if(o=e.slice(n,i),r>-1){let e=o[0];typeof e==`string`?o[0]=e.slice(r):o.shift()}a>0&&o.push(e[i].slice(0,a))}return o}function GQ(e,t){let n=-1,r=[],i;for(;++n<e.length;){let a=e[n],o;if(typeof a==`string`)o=a;else switch(a){case-5:o=`\r`;break;case-4:o=`
468`;break;case-3:o=`\r
469`;break;case-2:o=t?` `:`	`;break;case-1:if(!t&&i)continue;o=` `;break;default:o=String.fromCharCode(a)}i=a===-2,r.push(o)}return r.join(``)}function KQ(e){let t={constructs:hX([NQ,...(e||{}).extensions||[]]),content:n(FX),defined:[],document:n(LX),flow:n(TQ),lazy:{},string:n(OQ),text:n(kQ)};return t;function n(e){return n;function n(n){return UQ(t,e,n)}}}function qQ(e){for(;!yZ(e););return e}var JQ=/[\0\t\n\r]/g;function YQ(){let e=1,t=``,n=!0,r;return i;function i(i,a,o){let s=[],c,l,u,d,f;for(i=t+(typeof i==`string`?i.toString():new TextDecoder(a||void 0).decode(i)),u=0,t=``,n&&=(i.charCodeAt(0)===65279&&u++,void 0);u<i.length;){if(JQ.lastIndex=u,c=JQ.exec(i),d=c&&c.index!==void 0?c.index:i.length,f=i.charCodeAt(d),!c){t=i.slice(u);break}if(f===10&&u===d&&r)s.push(-3),r=void 0;else switch(r&&=(s.push(-5),void 0),u<d&&(s.push(i.slice(u,d)),e+=d-u),f){case 0:s.push(65533),e++;break;case 9:for(l=Math.ceil(e/4)*4,s.push(-2);e++<l;)s.push(-1);break;case 10:s.push(-4),e=1;break;default:r=!0,e=1}u=d+1}return o&&(r&&s.push(-5),t&&s.push(t),s.push(null)),s}}var XQ=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function ZQ(e){return e.replace(XQ,QQ)}function QQ(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){let e=n.charCodeAt(1),t=e===120||e===88;
vendor: 11,217 bytes, lines 469-471
469return vX(n.slice(t?2:1),t?16:10)}return dX(n)||e}var $Q={}.hasOwnProperty;function e$(e,t,n){return t&&typeof t==`object`&&(n=t,t=void 0),t$(n)(qQ(KQ(n).document().write(YQ()(e,t,!0))))}function t$(e){let t={transforms:[],canContainEols:[`emphasis`,`fragment`,`heading`,`paragraph`,`strong`],enter:{autolink:a(_e),autolinkProtocol:T,autolinkEmail:T,atxHeading:a(pe),blockQuote:a(ce),characterEscape:T,characterReference:T,codeFenced:a(le),codeFencedFenceInfo:o,codeFencedFenceMeta:o,codeIndented:a(le,o),codeText:a(ue,o),codeTextData:T,data:T,codeFlowValue:T,definition:a(de),definitionDestinationString:o,definitionLabelString:o,definitionTitleString:o,emphasis:a(fe),hardBreakEscape:a(me),hardBreakTrailing:a(me),htmlFlow:a(he,o),htmlFlowData:T,htmlText:a(he,o),htmlTextData:T,image:a(ge),label:o,link:a(_e),listItem:a(ye),listItemValue:f,listOrdered:a(ve,d),listUnordered:a(ve),paragraph:a(be),reference:re,referenceString:o,resourceDestinationString:o,resourceTitleString:o,setextHeading:a(pe),strong:a(xe),thematicBreak:a(Ce)},exit:{atxHeading:c(),atxHeadingSequence:x,autolink:c(),autolinkEmail:se,autolinkProtocol:L,blockQuote:c(),characterEscapeValue:E,characterReferenceMarkerHexadecimal:ie,characterReferenceMarkerNumeric:ie,characterReferenceValue:ae,characterReference:oe,codeFenced:c(g),codeFencedFence:h,codeFencedFenceInfo:p,codeFencedFenceMeta:m,codeFlowValue:E,codeIndented:c(_),codeText:c(j),codeTextData:E,data:E,definition:c(),definitionDestinationString:b,definitionLabelString:v,definitionTitleString:y,emphasis:c(),hardBreakEscape:c(O),hardBreakTrailing:c(O),htmlFlow:c(k),htmlFlowData:E,htmlText:c(A),htmlTextData:E,image:c(N),label:ee,labelText:P,lineEnding:D,link:c(M),listItem:c(),listOrdered:c(),listUnordered:c(),paragraph:c(),referenceString:I,resourceDestinationString:F,resourceTitleString:te,resource:ne,setextHeading:c(w),setextHeadingLineSequence:C,setextHeadingText:S,strong:c(),thematicBreak:c()}};r$(t,(e||{}).mdastExtensions||[]);let n={};return r;function r(e){let r={type:`root`,children:[]},a={stack:[r],tokenStack:[],config:t,enter:s,exit:l,buffer:o,resume:u,data:n},c=[],d=-1;for(;++d<e.length;)(e[d][1].type===`listOrdered`||e[d][1].type===`listUnordered`)&&(e[d][0]===`enter`?c.push(d):d=i(e,c.pop(),d));for(d=-1;++d<e.length;){let n=t[e[d][0]];$Q.call(n,e[d][1].type)&&n[e[d][1].type].call(Object.assign({sliceSerialize:e[d][2].sliceSerialize},a),e[d][1])}if(a.tokenStack.length>0){let e=a.tokenStack[a.tokenStack.length-1];(e[1]||a$).call(a,void 0,e[0])}for(r.position={start:n$(e.length>0?e[0][1].start:{line:1,column:1,offset:0}),end:n$(e.length>0?e[e.length-2][1].end:{line:1,column:1,offset:0})},d=-1;++d<t.transforms.length;)r=t.transforms[d](r)||r;return r}function i(e,t,n){let r=t-1,i=-1,a=!1,o,s,c,l;for(;++r<=n;){let t=e[r];switch(t[1].type){case`listUnordered`:case`listOrdered`:case`blockQuote`:t[0]===`enter`?i++:i--,l=void 0;break;case`lineEndingBlank`:t[0]===`enter`&&(o&&!l&&!i&&!c&&(c=r),l=void 0);break;case`linePrefix`:case`listItemValue`:case`listItemMarker`:case`listItemPrefix`:case`listItemPrefixWhitespace`:break;default:l=void 0}if(!i&&t[0]===`enter`&&t[1].type===`listItemPrefix`||i===-1&&t[0]===`exit`&&(t[1].type===`listUnordered`||t[1].type===`listOrdered`)){if(o){let i=r;for(s=void 0;i--;){let t=e[i];if(t[1].type===`lineEnding`||t[1].type===`lineEndingBlank`){if(t[0]===`exit`)continue;s&&(e[s][1].type=`lineEndingBlank`,a=!0),t[1].type=`lineEnding`,s=i}else if(!(t[1].type===`linePrefix`||t[1].type===`blockQuotePrefix`||t[1].type===`blockQuotePrefixWhitespace`||t[1].type===`blockQuoteMarker`||t[1].type===`listItemIndent`))break}c&&(!s||c<s)&&(o._spread=!0),o.end=Object.assign({},s?e[s][1].start:t[1].end),e.splice(s||r,0,[`exit`,o,t[2]]),r++,n++}if(t[1].type===`listItemPrefix`){let i={type:`listItem`,_spread:!1,start:Object.assign({},t[1].start),end:void 0};o=i,e.splice(r,0,[`enter`,i,t[2]]),r++,n++,c=void 0,l=!0}}}return e[t][1]._spread=a,n}function a(e,t){return n;function n(n){s.call(this,e(n),n),t&&t.call(this,n)}}function o(){this.stack.push({type:`fragment`,children:[]})}function s(e,t,n){this.stack[this.stack.length-1].children.push(e),this.stack.push(e),this.tokenStack.push([t,n||void 0]),e.position={start:n$(t.start),end:void 0}}function c(e){return t;function t(t){e&&e.call(this,t),l.call(this,t)}}function l(e,t){let n=this.stack.pop(),r=this.tokenStack.pop();if(r)r[0].type!==e.type&&(t?t.call(this,e,r[0]):(r[1]||a$).call(this,e,r[0]));else throw Error("Cannot close `"+e.type+"` ("+wY({start:e.start,end:e.end})+`): it’s not open`);n.position.end=n$(e.end)}function u(){return oX(this.stack.pop())}function d(){this.data.expectingFirstListItemValue=!0}function f(e){if(this.data.expectingFirstListItemValue){let t=this.stack[this.stack.length-2];t.start=Number.parseInt(this.sliceSerialize(e),10),this.data.expectingFirstListItemValue=void 0}}function p(){let e=this.resume(),t=this.stack[this.stack.length-1];t.lang=e}function m(){let e=this.resume(),t=this.stack[this.stack.length-1];t.meta=e}function h(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function g(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,``),this.data.flowCodeInside=void 0}function _(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e.replace(/(\r?\n|\r)$/g,``)}function v(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=yX(this.sliceSerialize(e)).toLowerCase()}function y(){let e=this.resume(),t=this.stack[this.stack.length-1];t.title=e}function b(){let e=this.resume(),t=this.stack[this.stack.length-1];t.url=e}function x(e){let t=this.stack[this.stack.length-1];t.depth||=this.sliceSerialize(e).length}function S(){this.data.setextHeadingSlurpLineEnding=!0}function C(e){let t=this.stack[this.stack.length-1];t.depth=this.sliceSerialize(e).codePointAt(0)===61?1:2}function w(){this.data.setextHeadingSlurpLineEnding=void 0}function T(e){let t=this.stack[this.stack.length-1].children,n=t[t.length-1];(!n||n.type!==`text`)&&(n=Se(),n.position={start:n$(e.start),end:void 0},t.push(n)),this.stack.push(n)}function E(e){let t=this.stack.pop();t.value+=this.sliceSerialize(e),t.position.end=n$(e.end)}function D(e){let n=this.stack[this.stack.length-1];if(this.data.atHardBreak){let t=n.children[n.children.length-1];t.position.end=n$(e.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(n.type)&&(T.call(this,e),E.call(this,e))}function O(){this.data.atHardBreak=!0}function k(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function A(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function j(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function M(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||`shortcut`;e.type+=`Reference`,e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function N(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||`shortcut`;e.type+=`Reference`,e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function P(e){let t=this.sliceSerialize(e),n=this.stack[this.stack.length-2];n.label=ZQ(t),n.identifier=yX(t).toLowerCase()}function ee(){let e=this.stack[this.stack.length-1],t=this.resume(),n=this.stack[this.stack.length-1];this.data.inReference=!0,n.type===`link`?n.children=e.children:n.alt=t}function F(){let e=this.resume(),t=this.stack[this.stack.length-1];t.url=e}function te(){let e=this.resume(),t=this.stack[this.stack.length-1];t.title=e}function ne(){this.data.inReference=void 0}function re(){this.data.referenceType=`collapsed`}function I(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=yX(this.sliceSerialize(e)).toLowerCase(),this.data.referenceType=`full`}function ie(e){this.data.characterReferenceType=e.type}function ae(e){let t=this.sliceSerialize(e),n=this.data.characterReferenceType,r;n?(r=vX(t,n===`characterReferenceMarkerNumeric`?10:16),this.data.characterReferenceType=void 0):r=dX(t);let i=this.stack[this.stack.length-1];i.value+=r}function oe(e){let t=this.stack.pop();t.position.end=n$(e.end)}function L(e){E.call(this,e);let t=this.stack[this.stack.length-1];t.url=this.sliceSerialize(e)}function se(e){E.call(this,e);let t=this.stack[this.stack.length-1];t.url=`mailto:`+this.sliceSerialize(e)}function ce(){return{type:`blockquote`,children:[]}}function le(){return{type:`code`,lang:null,meta:null,value:``}}function ue(){return{type:`inlineCode`,value:``}}function de(){return{type:`definition`,identifier:``,label:null,title:null,url:``}}function fe(){return{type:`emphasis`,children:[]}}function pe(){return{type:`heading`,depth:0,children:[]}}function me(){return{type:`break`}}function he(){return{type:`html`,value:``}}function ge(){return{type:`image`,title:null,url:``,alt:null}}function _e(){return{type:`link`,title:null,url:``,children:[]}}function ve(e){return{type:`list`,ordered:e.type===`listOrdered`,start:null,spread:e._spread,children:[]}}function ye(e){return{type:`listItem`,spread:e._spread,checked:null,children:[]}}function be(){return{type:`paragraph`,children:[]}}function xe(){return{type:`strong`,children:[]}}function Se(){return{type:`text`,value:``}}function Ce(){return{type:`thematicBreak`}}}function n$(e){return{line:e.line,column:e.column,offset:e.offset}}function r$(e,t){let n=-1;for(;++n<t.length;){let r=t[n];Array.isArray(r)?r$(e,r):i$(e,r)}}function i$(e,t){let n;for(n in t)if($Q.call(t,n))switch(n){case`canContainEols`:{let r=t[n];r&&e[n].push(...r);break}case`transforms`:{let r=t[n];r&&e[n].push(...r);break}case`enter`:case`exit`:{let r=t[n];r&&Object.assign(e[n],r);break}}}function a$(e,t){throw Error(e?"Cannot close `"+e.type+"` ("+wY({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+wY({start:t.start,end:t.end})+`) is open`:"Cannot close document, a token (`"+t.type+"`, "+wY({start:t.start,end:t.end})+`) is still open`)}function o$(e){let t=this;t.parser=n;function n(n){return e$(n,{...t.data(`settings`),...e,extensions:t.data(`micromarkExtensions`)||[],mdastExtensions:t.data(`fromMarkdownExtensions`)||[]})}}function s$(e,t){let n={type:`element`,tagName:`blockquote`,properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function c$(e,t){let n={type:`element`,tagName:`br`,properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:`text`,value:`
470`}]}function l$(e,t){let n=t.value?t.value+`
471`:``,r={},i=t.lang?t.lang.split(/\s+/):[];i.length>0&&(r.className=[`language-`+i[0]]);let a={type:`element`,tagName:`code`,properties:r,children:[{type:`text`,value:n}]};return t.meta&&(a.data={meta:t.meta}),e.patch(t,a),a=e.applyData(t,a),a={type:`element`,tagName:`pre`,properties:{},children:[a]},e.patch(t,a),a}function u$(e,t){let n={type:`element`,tagName:`del`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function d$(e,t){let n={type:`element`,tagName:`em`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}
vendor: 4,652 bytes, lines 471-473
471function f$(e,t){let n=typeof e.options.clobberPrefix==`string`?e.options.clobberPrefix:`user-content-`,r=String(t.identifier).toUpperCase(),i=NX(r.toLowerCase()),a=e.footnoteOrder.indexOf(r),o,s=e.footnoteCounts.get(r);s===void 0?(s=0,e.footnoteOrder.push(r),o=e.footnoteOrder.length):o=a+1,s+=1,e.footnoteCounts.set(r,s);let c={type:`element`,tagName:`a`,properties:{href:`#`+n+`fn-`+i,id:n+`fnref-`+i+(s>1?`-`+s:``),dataFootnoteRef:!0,ariaDescribedBy:[`footnote-label`]},children:[{type:`text`,value:String(o)}]};e.patch(t,c);let l={type:`element`,tagName:`sup`,properties:{},children:[c]};return e.patch(t,l),e.applyData(t,l)}function p$(e,t){let n={type:`element`,tagName:`h`+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function m$(e,t){if(e.options.allowDangerousHtml){let n={type:`raw`,value:t.value};return e.patch(t,n),e.applyData(t,n)}}function h$(e,t){let n=t.referenceType,r=`]`;if(n===`collapsed`?r+=`[]`:n===`full`&&(r+=`[`+(t.label||t.identifier)+`]`),t.type===`imageReference`)return[{type:`text`,value:`![`+t.alt+r}];let i=e.all(t),a=i[0];a&&a.type===`text`?a.value=`[`+a.value:i.unshift({type:`text`,value:`[`});let o=i[i.length-1];return o&&o.type===`text`?o.value+=r:i.push({type:`text`,value:r}),i}function g$(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return h$(e,t);let i={src:NX(r.url||``),alt:t.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);let a={type:`element`,tagName:`img`,properties:i,children:[]};return e.patch(t,a),e.applyData(t,a)}function _$(e,t){let n={src:NX(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);let r={type:`element`,tagName:`img`,properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function v$(e,t){let n={type:`text`,value:t.value.replace(/\r?\n|\r/g,` `)};e.patch(t,n);let r={type:`element`,tagName:`code`,properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function y$(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return h$(e,t);let i={href:NX(r.url||``)};r.title!==null&&r.title!==void 0&&(i.title=r.title);let a={type:`element`,tagName:`a`,properties:i,children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function b$(e,t){let n={href:NX(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);let r={type:`element`,tagName:`a`,properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function x$(e,t,n){let r=e.all(t),i=n?S$(n):C$(t),a={},o=[];if(typeof t.checked==`boolean`){let e=r[0],n;e&&e.type===`element`&&e.tagName===`p`?n=e:(n={type:`element`,tagName:`p`,properties:{},children:[]},r.unshift(n)),n.children.length>0&&n.children.unshift({type:`text`,value:` `}),n.children.unshift({type:`element`,tagName:`input`,properties:{type:`checkbox`,checked:t.checked,disabled:!0},children:[]}),a.className=[`task-list-item`]}let s=-1;for(;++s<r.length;){let e=r[s];(i||s!==0||e.type!==`element`||e.tagName!==`p`)&&o.push({type:`text`,value:`
472`}),e.type===`element`&&e.tagName===`p`&&!i?o.push(...e.children):o.push(e)}let c=r[r.length-1];c&&(i||c.type!==`element`||c.tagName!==`p`)&&o.push({type:`text`,value:`
473`});let l={type:`element`,tagName:`li`,properties:a,children:o};return e.patch(t,l),e.applyData(t,l)}function S$(e){let t=!1;if(e.type===`list`){t=e.spread||!1;let n=e.children,r=-1;for(;!t&&++r<n.length;)t=C$(n[r])}return t}function C$(e){return e.spread??e.children.length>1}function w$(e,t){let n={},r=e.all(t),i=-1;for(typeof t.start==`number`&&t.start!==1&&(n.start=t.start);++i<r.length;){let e=r[i];if(e.type===`element`&&e.tagName===`li`&&e.properties&&Array.isArray(e.properties.className)&&e.properties.className.includes(`task-list-item`)){n.className=[`contains-task-list`];break}}let a={type:`element`,tagName:t.ordered?`ol`:`ul`,properties:n,children:e.wrap(r,!0)};return e.patch(t,a),e.applyData(t,a)}function T$(e,t){let n={type:`element`,tagName:`p`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function E$(e,t){let n={type:`root`,children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function D$(e,t){let n={type:`element`,tagName:`strong`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function O$(e,t){let n=e.all(t),r=n.shift(),i=[];if(r){let n={type:`element`,tagName:`thead`,properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],n),i.push(n)}if(n.length>0){let r={type:`element`,tagName:`tbody`,properties:{},children:e.wrap(n,!0)},a=xY(t.children[1]),o=bY(t.children[t.children.length-1]);a&&o&&(r.position={start:a,end:o}),i.push(r)}let a={type:`element`,tagName:`table`,properties:{}
vendor: 19,413 bytes, lines 473-479
473,children:e.wrap(i,!0)};return e.patch(t,a),e.applyData(t,a)}function k$(e,t,n){let r=n?n.children:void 0,i=(r?r.indexOf(t):1)===0?`th`:`td`,a=n&&n.type===`table`?n.align:void 0,o=a?a.length:t.children.length,s=-1,c=[];for(;++s<o;){let n=t.children[s],r={},o=a?a[s]:void 0;o&&(r.align=o);let l={type:`element`,tagName:i,properties:r,children:[]};n&&(l.children=e.all(n),e.patch(n,l),l=e.applyData(n,l)),c.push(l)}let l={type:`element`,tagName:`tr`,properties:{},children:e.wrap(c,!0)};return e.patch(t,l),e.applyData(t,l)}function A$(e,t){let n={type:`element`,tagName:`td`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}var j$=9,M$=32;function N$(e){let t=String(e),n=/\r?\n|\r/g,r=n.exec(t),i=0,a=[];for(;r;)a.push(P$(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return a.push(P$(t.slice(i),i>0,!1)),a.join(``)}function P$(e,t,n){let r=0,i=e.length;if(t){let t=e.codePointAt(r);for(;t===j$||t===M$;)r++,t=e.codePointAt(r)}if(n){let t=e.codePointAt(i-1);for(;t===j$||t===M$;)i--,t=e.codePointAt(i-1)}return i>r?e.slice(r,i):``}function F$(e,t){let n={type:`text`,value:N$(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function I$(e,t){let n={type:`element`,tagName:`hr`,properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}var L$={blockquote:s$,break:c$,code:l$,delete:u$,emphasis:d$,footnoteReference:f$,heading:p$,html:m$,imageReference:g$,image:_$,inlineCode:v$,linkReference:y$,link:b$,listItem:x$,list:w$,paragraph:T$,root:E$,strong:D$,table:O$,tableCell:A$,tableRow:k$,text:F$,thematicBreak:I$,toml:R$,yaml:R$,definition:R$,footnoteDefinition:R$};function R$(){}var z$=typeof self==`object`?self:globalThis,B$=(e,t)=>{switch(e){case`Function`:case`SharedWorker`:case`Worker`:case`eval`:case`setInterval`:case`setTimeout`:throw TypeError(`unable to deserialize `+e)}return new z$[e](t)},V$=(e,t)=>{let n=(t,n)=>(e.set(n,t),t),r=i=>{if(e.has(i))return e.get(i);let[a,o]=t[i];switch(a){case 0:case-1:return n(o,i);case 1:{let e=n([],i);for(let t of o)e.push(r(t));return e}case 2:{let e=n({},i);for(let[t,n]of o)e[r(t)]=r(n);return e}case 3:return n(new Date(o),i);case 4:{let{source:e,flags:t}=o;return n(new RegExp(e,t),i)}case 5:{let e=n(new Map,i);for(let[t,n]of o)e.set(r(t),r(n));return e}case 6:{let e=n(new Set,i);for(let t of o)e.add(r(t));return e}case 7:{let{name:e,message:t}=o;return n(B$(e,t),i)}case 8:return n(BigInt(o),i);case`BigInt`:return n(Object(BigInt(o)),i);case`ArrayBuffer`:return n(new Uint8Array(o).buffer,o);case`DataView`:{let{buffer:e}=new Uint8Array(o);return n(new DataView(e),o)}}return n(B$(a,o),i)};return r},H$=e=>V$(new Map,e)(0),U$=``,{toString:W$}={},{keys:G$}=Object,K$=e=>{let t=typeof e;if(t!==`object`||!e)return[0,t];let n=W$.call(e).slice(8,-1);switch(n){case`Array`:return[1,U$];case`Object`:return[2,U$];case`Date`:return[3,U$];case`RegExp`:return[4,U$];case`Map`:return[5,U$];case`Set`:return[6,U$];case`DataView`:return[1,n]}return n.includes(`Array`)?[1,n]:n.includes(`Error`)?[7,n]:[2,n]},q$=([e,t])=>e===0&&(t===`function`||t===`symbol`),J$=(e,t,n,r)=>{let i=(e,t)=>{let i=r.push(e)-1;return n.set(t,i),i},a=r=>{if(n.has(r))return n.get(r);let[o,s]=K$(r);switch(o){case 0:{let t=r;switch(s){case`bigint`:o=8,t=r.toString();break;case`function`:case`symbol`:if(e)throw TypeError(`unable to serialize `+s);t=null;break;case`undefined`:return i([-1],r)}return i([o,t],r)}case 1:{if(s){let e=r;return s===`DataView`?e=new Uint8Array(r.buffer):s===`ArrayBuffer`&&(e=new Uint8Array(r)),i([s,[...e]],r)}let e=[],t=i([o,e],r);for(let t of r)e.push(a(t));return t}case 2:{if(s)switch(s){case`BigInt`:return i([s,r.toString()],r);case`Boolean`:case`Number`:case`String`:return i([s,r.valueOf()],r)}if(t&&`toJSON`in r)return a(r.toJSON());let n=[],c=i([o,n],r);for(let t of G$(r))(e||!q$(K$(r[t])))&&n.push([a(t),a(r[t])]);return c}case 3:return i([o,r.toISOString()],r);case 4:{let{source:e,flags:t}=r;return i([o,{source:e,flags:t}],r)}case 5:{let t=[],n=i([o,t],r);for(let[n,i]of r)(e||!(q$(K$(n))||q$(K$(i))))&&t.push([a(n),a(i)]);return n}case 6:{let t=[],n=i([o,t],r);for(let n of r)(e||!q$(K$(n)))&&t.push(a(n));return n}}let{message:c}=r;return i([o,{name:s,message:c}],r)};return a},Y$=(e,{json:t,lossy:n}={})=>{let r=[];return J$(!(t||n),!!t,new Map,r)(e),r},X$=typeof structuredClone==`function`?(e,t)=>t&&(`json`in t||`lossy`in t)?H$(Y$(e,t)):structuredClone(e):(e,t)=>H$(Y$(e,t));function Z$(e,t){let n=[{type:`text`,value:`↩`}];return t>1&&n.push({type:`element`,tagName:`sup`,properties:{},children:[{type:`text`,value:String(t)}]}),n}function Q$(e,t){return`Back to reference `+(e+1)+(t>1?`-`+t:``)}function $$(e){let t=typeof e.options.clobberPrefix==`string`?e.options.clobberPrefix:`user-content-`,n=e.options.footnoteBackContent||Z$,r=e.options.footnoteBackLabel||Q$,i=e.options.footnoteLabel||`Footnotes`,a=e.options.footnoteLabelTagName||`h2`,o=e.options.footnoteLabelProperties||{className:[`sr-only`]},s=[],c=-1;for(;++c<e.footnoteOrder.length;){let i=e.footnoteById.get(e.footnoteOrder[c]);if(!i)continue;let a=e.all(i),o=String(i.identifier).toUpperCase(),l=NX(o.toLowerCase()),u=0,d=[],f=e.footnoteCounts.get(o);for(;f!==void 0&&++u<=f;){d.length>0&&d.push({type:`text`,value:` `});let e=typeof n==`string`?n:n(c,u);typeof e==`string`&&(e={type:`text`,value:e}),d.push({type:`element`,tagName:`a`,properties:{href:`#`+t+`fnref-`+l+(u>1?`-`+u:``),dataFootnoteBackref:``,ariaLabel:typeof r==`string`?r:r(c,u),className:[`data-footnote-backref`]},children:Array.isArray(e)?e:[e]})}let p=a[a.length-1];if(p&&p.type===`element`&&p.tagName===`p`){let e=p.children[p.children.length-1];e&&e.type===`text`?e.value+=` `:p.children.push({type:`text`,value:` `}),p.children.push(...d)}else a.push(...d);let m={type:`element`,tagName:`li`,properties:{id:t+`fn-`+l},children:e.wrap(a,!0)};e.patch(i,m),s.push(m)}if(s.length!==0)return{type:`element`,tagName:`section`,properties:{dataFootnotes:!0,className:[`footnotes`]},children:[{type:`element`,tagName:a,properties:{...X$(o),id:`footnote-label`},children:[{type:`text`,value:i}]},{type:`text`,value:`
474`},{type:`element`,tagName:`ol`,properties:{},children:e.wrap(s,!0)},{type:`text`,value:`
475`}]}}var e1={}.hasOwnProperty,t1={};function n1(e,t){let n=t||t1,r=new Map,i=new Map,a={all:s,applyData:i1,definitionById:r,footnoteById:i,footnoteCounts:new Map,footnoteOrder:[],handlers:{...L$,...n.handlers},one:o,options:n,patch:r1,wrap:o1};return EJ(e,function(e){if(e.type===`definition`||e.type===`footnoteDefinition`){let t=e.type===`definition`?r:i,n=String(e.identifier).toUpperCase();t.has(n)||t.set(n,e)}}),a;function o(e,t){let n=e.type,r=a.handlers[n];if(e1.call(a.handlers,n)&&r)return r(a,e,t);if(a.options.passThrough&&a.options.passThrough.includes(n)){if(`children`in e){let{children:t,...n}=e,r=X$(n);return r.children=a.all(e),r}return X$(e)}return(a.options.unknownHandler||a1)(a,e,t)}function s(e){let t=[];if(`children`in e){let n=e.children,r=-1;for(;++r<n.length;){let i=a.one(n[r],e);if(i){if(r&&n[r-1].type===`break`&&(!Array.isArray(i)&&i.type===`text`&&(i.value=s1(i.value)),!Array.isArray(i)&&i.type===`element`)){let e=i.children[0];e&&e.type===`text`&&(e.value=s1(e.value))}Array.isArray(i)?t.push(...i):t.push(i)}}}return t}}function r1(e,t){e.position&&(t.position=CY(e))}function i1(e,t){let n=t;if(e&&e.data){let t=e.data.hName,r=e.data.hChildren,i=e.data.hProperties;typeof t==`string`&&(n.type===`element`?n.tagName=t:n={type:`element`,tagName:t,properties:{},children:`children`in n?n.children:[n]}),n.type===`element`&&i&&Object.assign(n.properties,X$(i)),`children`in n&&n.children&&r!=null&&(n.children=r)}return n}function a1(e,t){let n=t.data||{},r=`value`in t&&!(e1.call(n,`hProperties`)||e1.call(n,`hChildren`))?{type:`text`,value:t.value}:{type:`element`,tagName:`div`,properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function o1(e,t){let n=[],r=-1;for(t&&n.push({type:`text`,value:`
476`});++r<e.length;)r&&n.push({type:`text`,value:`
477`}),n.push(e[r]);return t&&e.length>0&&n.push({type:`text`,value:`
478`}),n}function s1(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function c1(e,t){let n=n1(e,t),r=n.one(e,void 0),i=$$(n),a=Array.isArray(r)?{type:`root`,children:r}:r||{type:`root`,children:[]};return i&&(`children`in a,a.children.push({type:`text`,value:`
479`},i)),a}function l1(e,t){return e&&`run`in e?async function(n,r){let i=c1(n,{file:r,...t});await e.run(i,r)}:function(n,r){return c1(n,{file:r,...e||t})}}function u1(e){if(e)throw e}var d1=n(((e,t)=>{var n=Object.prototype.hasOwnProperty,r=Object.prototype.toString,i=Object.defineProperty,a=Object.getOwnPropertyDescriptor,o=function(e){return typeof Array.isArray==`function`?Array.isArray(e):r.call(e)===`[object Array]`},s=function(e){if(!e||r.call(e)!==`[object Object]`)return!1;var t=n.call(e,`constructor`),i=e.constructor&&e.constructor.prototype&&n.call(e.constructor.prototype,`isPrototypeOf`);if(e.constructor&&!t&&!i)return!1;for(var a in e);return a===void 0||n.call(e,a)},c=function(e,t){i&&t.name===`__proto__`?i(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},l=function(e,t){if(t===`__proto__`){if(!n.call(e,t))return;if(a)return a(e,t).value}return e[t]};t.exports=function e(){var t,n,r,i,a,u,d=arguments[0],f=1,p=arguments.length,m=!1;for(typeof d==`boolean`&&(m=d,d=arguments[1]||{},f=2),(d==null||typeof d!=`object`&&typeof d!=`function`)&&(d={});f<p;++f)if(t=arguments[f],t!=null)for(n in t)r=l(d,n),i=l(t,n),d!==i&&(m&&i&&(s(i)||(a=o(i)))?(a?(a=!1,u=r&&o(r)?r:[]):u=r&&s(r)?r:{},c(d,{name:n,newValue:e(m,u,i)})):i!==void 0&&c(d,{name:n,newValue:i}));return d}}));function f1(e){if(typeof e!=`object`||!e)return!1;let t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function p1(){let e=[],t={run:n,use:r};return t;function n(...t){let n=-1,r=t.pop();if(typeof r!=`function`)throw TypeError(`Expected function as last argument, not `+r);i(null,...t);function i(a,...o){let s=e[++n],c=-1;if(a){r(a);return}for(;++c<t.length;)(o[c]===null||o[c]===void 0)&&(o[c]=t[c]);t=o,s?m1(s,i)(...o):r(null,...o)}}function r(n){if(typeof n!=`function`)throw TypeError("Expected `middelware` to be a function, not "+n);return e.push(n),t}}function m1(e,t){let n;return r;function r(...t){let r=e.length>t.length,o;r&&t.push(i);try{o=e.apply(this,t)}catch(e){let t=e;if(r&&n)throw t;return i(t)}r||(o&&o.then&&typeof o.then==`function`?o.then(a,i):o instanceof Error?i(o):a(o))}function i(e,...r){n||(n=!0,t(e,...r))}function a(e){i(null,e)}}var h1={basename:g1,dirname:_1,extname:v1,join:y1,sep:`/`};function g1(e,t){if(t!==void 0&&typeof t!=`string`)throw TypeError(`"ext" argument must be a string`);S1(e);let n=0,r=-1,i=e.length,a;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else r<0&&(a=!0,r=i+1);return r<0?``:e.slice(n,r)}if(t===e)return``;let o=-1,s=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else o<0&&(a=!0,o=i+1),s>-1&&(e.codePointAt(i)===t.codePointAt(s--)?s<0&&(r=i):(s=-1,r=o));return n===r?r=o:r<0&&(r=e.length),e.slice(n,r)}function _1(e){if(S1(e),e.length===0)return`.`;let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||=!0;return t<0?e.codePointAt(0)===47?`/`:`.`:t===1&&e.codePointAt(0)===47?`//`:e.slice(0,t)}function v1(e){S1(e);let t=e.length,n=-1,r=0,i=-1,a=0,o;for(;t--;){let s=e.codePointAt(t);if(s===47){if(o){r=t+1;break}continue}n<0&&(o=!0,n=t+1),s===46?i<0?i=t:a!==1&&(a=1):i>-1&&(a=-1)}return i<0||n<0||a===0||a===1&&i===n-1&&i===r+1?``:e.slice(i,n)}function y1(...e){let t=-1,n;for(;++t<e.length;)S1(e[t]),e[t]&&(n=n===void 0?e[t]:n+`/`+e[t]);return n===void 0?`.`:b1(n)}function b1(e){S1(e);let t=e.codePointAt(0)===47,n=x1(e,!t);return n.length===0&&!t&&(n=`.`),n.length>0&&e.codePointAt(e.length-1)===47&&(n+=`/`),t?`/`+n:n}function x1(e,t){let n=``,r=0,i=-1,a=0,o=-1,s,c;for(;++o<=e.length;){if(o<e.length)s=e.codePointAt(o);else if(s===47)break;else s=47;if(s===47){if(!(i===o-1||a===1))if(i!==o-1&&a===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(c=n.lastIndexOf(`/`),c!==n.length-1){c<0?(n=``,r=0):(n=n.slice(0,c),r=n.length-1-n.lastIndexOf(`/`)),i=o,a=0;continue}}else if(n.length>0){n=``,r=0,i=o,a=0;continue}}t&&(n=n.length>0?n+`/..`:`..`,r=2)}else n.length>0?n+=`/`+e.slice(i+1,o):n=e.slice(i+1,o),r=o-i-1;i=o,a=0}else s===46&&a>-1?a++:a=-1}return n}function S1(e){if(typeof e!=`string`)throw TypeError(`Path must be a string. Received `+JSON.stringify(e))}var Ple={cwd:Fle};function Fle(){return`/`}function C1(e){return!!(typeof e==`object`&&e&&`href`in e&&e.href&&`protocol`in e&&e.protocol&&e.auth===void 0)}function Ile(e){if(typeof e==`string`)e=new URL(e);else if(!C1(e)){let t=TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code=`ERR_INVALID_ARG_TYPE`,t}if(e.protocol!==`file:`){let e=TypeError(`The URL must be of scheme file`);throw e.code=`ERR_INVALID_URL_SCHEME`,e}return Lle(e)}function Lle(e){if(e.hostname!==``){let e=TypeError(`File URL host must be "localhost" or empty on darwin`);throw e.code=`ERR_INVALID_FILE_URL_HOST`,e}let t=e.pathname,n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){let e=t.codePointAt(n+2);if(e===70||e===102){let e=TypeError(`File URL path must not include encoded / characters`);throw e.code=`ERR_INVALID_FILE_URL_PATH`,e}}return decodeURIComponent(t)}var w1=[`history`,`path`,`basename`,`stem`,`extname`,`dirname`],T1=class{constructor(e){let t;t=e?C1(e)?{path:e}:typeof e==`string`||Rle(e)?{value:e}:e:{},this.cwd=`cwd`in t?``:Ple.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let n=-1;for(;++n<w1.length;){let e=w1[n];e in t&&t[e]!==void 0&&t[e]!==null&&(this[e]=e===`history`?[...t[e]]:t[e])}let r;for(r in t)w1.includes(r)||(this[r]=t[r])}get basename(){return typeof this.path==`string`?h1.basename(this.path):void 0}set basename(e){D1(e,`basename`),E1(e,`basename`),this.path=h1.join(this.dirname||``,e)}get dirname(){return typeof this.path==`string`?h1.dirname(this.path):void 0}set dirname(e){O1(this.basename,`dirname`),this.path=h1.join(e||``,this.basename)}get extname(){return typeof this.path==`string`?h1.extname(this.path):void 0}set extname(e){if(E1(e,`extname`),O1(this.dirname,`extname`),e){if(e.codePointAt(0)!==46)throw Error("`extname` must start with `.`");if(e.includes(`.`,1))throw Error("`extname` cannot contain multiple dots")}this.path=h1.join(this.dirname,this.stem+(e||``))}get path(){return this.history[this.history.length-1]}set path(e){C1(e)&&(e=Ile(e)),D1(e,`path`),this.path!==e&&this.history.push(e)}get stem(){return typeof this.path==`string`?h1.basename(this.path,this.extname):void 0}set stem(e){D1(e,`stem`),E1(e,`stem`),this.path=h1.join(this.dirname||``,e+(this.extname||``))}fail(e,t,n){let r=this.message(e,t,n);throw r.fatal=!0,r}info(e,t,n){let r=this.message(e,t,n);return r.fatal=void 0,r}message(e,t,n){let r=new OY(e,t,n);return this.path&&(r.name=this.path+`:`+r.name,r.file=this.path),r.fatal=!1,this.messages.push(r),r}toString(e){return this.value===void 0?``:typeof this.value==`string`?this.value:new TextDecoder(e||void 0).decode(this.value)}};function E1(e,t){if(e&&e.includes(h1.sep))throw Error("`"+t+"` cannot be a path: did not expect `"+h1.sep+"`")}function D1(e,t){if(!e)throw Error("`"+t+"` cannot be empty")}function O1(e,t){if(!e)throw Error("Setting `"+t+"` requires `path` to be set too")}function Rle(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}var zle=(function(e){let t=this.constructor.prototype,n=t[e],r=function(){return n.apply(r,arguments)};return Object.setPrototypeOf(r,t),r}),k1=r(d1(),1),Ble={}.hasOwnProperty,Vle=new class e extends zle{constructor(){super(`copy`),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=p1()}copy(){let t=new e,n=-1;for(;++n<this.attachers.length;){let e=this.attachers[n];t.use(...e)}return t.data((0,k1.default)(!0,{},this.namespace)),t}data(e,t){return typeof e==`string`?arguments.length===2?(M1(`data`,this.frozen),this.namespace[e]=t,this):Ble.call(this.namespace,e)&&this.namespace[e]||void 0:e?(M1(`data`,this.frozen),this.namespace=e,this):this.namespace}freeze(){if(this.frozen)return this;let e=this;for(;++this.freezeIndex<this.attachers.length;){let[t,...n]=this.attachers[this.freezeIndex];if(n[0]===!1)continue;n[0]===!0&&(n[0]=void 0);let r=t.call(e,...n);typeof r==`function`&&this.transformers.use(r)}return this.frozen=!0,this.freezeIndex=1/0,this}parse(e){this.freeze();let t=F1(e),n=this.parser||this.Parser;return A1(`parse`,n),n(String(t),t)}process(e,t){let n=this;return this.freeze(),A1(`process`,this.parser||this.Parser),j1(`process`,this.compiler||this.Compiler),t?r(void 0,t):new Promise(r);function r(r,i){let a=F1(e),o=n.parse(a);n.run(o,a,function(e,t,r){if(e||!t||!r)return s(e);let i=t,a=n.stringify(i,r);Ule(a)?r.value=a:r.result=a,s(e,r)});function s(e,n){e||!n?i(e):r?r(n):t(void 0,n)}}}processSync(e){let t=!1,n;return this.freeze(),A1(`processSync`,this.parser||this.Parser),j1(`processSync`,this.compiler||this.Compiler),this.process(e,r),P1(`processSync`,`process`,t),n;function r(e,r){t=!0,u1(e),n=r}}run(e,t,n){N1(e),this.freeze();let r=this.transformers;return!n&&typeof t==`function`&&(n=t,t=void 0),n?i(void 0,n):new Promise(i);function i(i,a){let o=F1(t);r.run(e,o,s);function s(t,r,o){let s=r||e;t?a(t):i?i(s):n(void 0,s,o)}}}runSync(e,t){let n=!1,r;return this.run(e,t,i),P1(`runSync`,`run`,n),r;function i(e,t){u1(e),r=t,n=!0}}stringify(e,t){this.freeze();let n=F1(t),r=this.compiler||this.Compiler;return j1(`stringify`,r),N1(e),r(e,n)}use(e,...t){let n=this.attachers,r=this.namespace;if(M1(`use`,this.frozen),e!=null)if(typeof e==`function`)s(e,t);else if(typeof e==`object`)Array.isArray(e)?o(e):a(e);else throw TypeError("Expected usable value, not `"+e+"`");return this;function i(e){if(typeof e==`function`)s(e,[]);else if(typeof e==`object`)if(Array.isArray(e)){let[t,...n]=e;s(t,n)}else a(e);else throw TypeError("Expected usable value, not `"+e+"`")}function a(e){if(!(`plugins`in e)&&!(`settings`in e))throw Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");o(e.plugins),e.settings&&(r.settings=(0,k1.default)(!0,r.settings,e.settings))}function o(e){let t=-1;if(e!=null)if(Array.isArray(e))for(;++t<e.length;){let n=e[t];i(n)}else throw TypeError("Expected a list of plugins, not `"+e+"`")}function s(e,t){let r=-1,i=-1;for(;++r<n.length;)if(n[r][0]===e){i=r;break}if(i===-1)n.push([e,...t]);else if(t.length>0){let[r,...a]=t,o=n[i][1];f1(o)&&f1(r)&&(r=(0,k1.default)(!0,o,r)),n[i]=[e,r,...a]}}}}().freeze();function A1(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `parser`")}function j1(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `compiler`")}function M1(e,t){if(t)throw Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}
vendor: 9,423 bytes, lines 479-480
479function N1(e){if(!f1(e)||typeof e.type!=`string`)throw TypeError("Expected node, got `"+e+"`")}function P1(e,t,n){if(!n)throw Error("`"+e+"` finished async. Use `"+t+"` instead")}function F1(e){return Hle(e)?e:new T1(e)}function Hle(e){return!!(e&&typeof e==`object`&&`message`in e&&`messages`in e)}function Ule(e){return typeof e==`string`||Wle(e)}function Wle(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}var I1=[],L1={allowDangerousHtml:!0},Gle=/^(https?|ircs?|mailto|xmpp)$/i,Kle=[{from:`astPlugins`,id:`remove-buggy-html-in-markdown-parser`},{from:`allowDangerousHtml`,id:`remove-buggy-html-in-markdown-parser`},{from:`allowNode`,id:`replace-allownode-allowedtypes-and-disallowedtypes`,to:`allowElement`},{from:`allowedTypes`,id:`replace-allownode-allowedtypes-and-disallowedtypes`,to:`allowedElements`},{from:`disallowedTypes`,id:`replace-allownode-allowedtypes-and-disallowedtypes`,to:`disallowedElements`},{from:`escapeHtml`,id:`remove-buggy-html-in-markdown-parser`},{from:`includeElementIndex`,id:`#remove-includeelementindex`},{from:`includeNodeIndex`,id:`change-includenodeindex-to-includeelementindex`},{from:`linkTarget`,id:`remove-linktarget`},{from:`plugins`,id:`change-plugins-to-remarkplugins`,to:`remarkPlugins`},{from:`rawSourcePos`,id:`#remove-rawsourcepos`},{from:`renderers`,id:`change-renderers-to-components`,to:`components`},{from:`source`,id:`change-source-to-children`,to:`children`},{from:`sourcePos`,id:`#remove-sourcepos`},{from:`transformImageUri`,id:`#add-urltransform`,to:`urlTransform`},{from:`transformLinkUri`,id:`#add-urltransform`,to:`urlTransform`}];function R1(e){let t=qle(e),n=Jle(e);return Yle(t.runSync(t.parse(n),n),e)}function qle(e){let t=e.rehypePlugins||I1,n=e.remarkPlugins||I1,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...L1}:L1;return Vle().use(o$).use(n).use(l1,r).use(t)}function Jle(e){let t=e.children||``,n=new T1;return typeof t==`string`?n.value=t:``+t,n}function Yle(e,t){let n=t.allowedElements,r=t.allowElement,i=t.components,a=t.disallowedElements,o=t.skipHtml,s=t.unwrapDisallowed,c=t.urlTransform||z1;for(let e of Kle)Object.hasOwn(t,e.from)&&``+e.from+(e.to?"use `"+e.to+"` instead":`remove it`)+e.id;return t.className&&(e={type:`element`,tagName:`div`,properties:{className:t.className},children:e.type===`root`?e.children:[e]}),EJ(e,l),IY(e,{Fragment:R.Fragment,components:i,ignoreInvalidStyle:!0,jsx:R.jsx,jsxs:R.jsxs,passKeys:!0,passNode:!0});function l(e,t,i){if(e.type===`raw`&&i&&typeof t==`number`)return o?i.children.splice(t,1):i.children[t]={type:`text`,value:e.value},t;if(e.type===`element`){let t;for(t in iX)if(Object.hasOwn(iX,t)&&Object.hasOwn(e.properties,t)){let n=e.properties[t],r=iX[t];(r===null||r.includes(e.tagName))&&(e.properties[t]=c(String(n||``),t,e))}}if(e.type===`element`){let o=n?!n.includes(e.tagName):a?a.includes(e.tagName):!1;if(!o&&r&&typeof t==`number`&&(o=!r(e,t,i)),o&&i&&typeof t==`number`)return s&&e.children?i.children.splice(t,1,...e.children):i.children.splice(t,1),t}}}function z1(e){let t=e.indexOf(`:`),n=e.indexOf(`?`),r=e.indexOf(`#`),i=e.indexOf(`/`);return t===-1||i!==-1&&t>i||n!==-1&&t>n||r!==-1&&t>r||Gle.test(e.slice(0,t))?e:``}function B1(e,t){let n=String(e);if(typeof t!=`string`)throw TypeError(`Expected character`);let r=0,i=n.indexOf(t);for(;i!==-1;)r++,i=n.indexOf(t,i+t.length);return r}function Xle(e){if(typeof e!=`string`)throw TypeError(`Expected a string`);return e.replace(/[|\\{}()[\]^$+*?.]/g,`\\$&`).replace(/-/g,`\\x2d`)}function Zle(e,t,n){let r=eJ((n||{}).ignore||[]),i=Qle(t),a=-1;for(;++a<i.length;)uJ(e,`text`,o);function o(e,t){let n=-1,i;for(;++n<t.length;){let e=t[n],a=i?i.children:void 0;if(r(e,a?a.indexOf(e):void 0,i))return;i=e}if(i)return s(e,t)}function s(e,t){let n=t[t.length-1],r=i[a][0],o=i[a][1],s=0,c=n.children.indexOf(e),l=!1,u=[];r.lastIndex=0;let d=r.exec(e.value);for(;d;){let n=d.index,i={index:d.index,input:d.input,stack:[...t,e]},a=o(...d,i);if(typeof a==`string`&&(a=a.length>0?{type:`text`,value:a}:void 0),a===!1?r.lastIndex=n+1:(s!==n&&u.push({type:`text`,value:e.value.slice(s,n)}),Array.isArray(a)?u.push(...a):a&&u.push(a),s=n+d[0].length,l=!0),!r.global)break;d=r.exec(e.value)}return l?(s<e.value.length&&u.push({type:`text`,value:e.value.slice(s)}),n.children.splice(c,1,...u)):u=[e],c+u.length}}function Qle(e){let t=[];if(!Array.isArray(e))throw TypeError(`Expected find and replace tuple or list of tuples`);let n=!e[0]||Array.isArray(e[0])?e:[e],r=-1;for(;++r<n.length;){let e=n[r];t.push([$le(e[0]),eue(e[1])])}return t}function $le(e){return typeof e==`string`?new RegExp(Xle(e),`g`):e}function eue(e){return typeof e==`function`?e:function(){return e}}var V1=`phrasing`,H1=[`autolink`,`link`,`image`,`label`];function tue(){return{transforms:[cue],enter:{literalAutolink:rue,literalAutolinkEmail:U1,literalAutolinkHttp:U1,literalAutolinkWww:U1},exit:{literalAutolink:sue,literalAutolinkEmail:oue,literalAutolinkHttp:iue,literalAutolinkWww:aue}}}function nue(){return{unsafe:[{character:`@`,before:`[+\\-.\\w]`,after:`[\\-.\\w]`,inConstruct:V1,notInConstruct:H1},{character:`.`,before:`[Ww]`,after:`[\\-.\\w]`,inConstruct:V1,notInConstruct:H1},{character:`:`,before:`[ps]`,after:`\\/`,inConstruct:V1,notInConstruct:H1}]}}function rue(e){this.enter({type:`link`,title:null,url:``,children:[]},e)}function U1(e){this.config.enter.autolinkProtocol.call(this,e)}function iue(e){this.config.exit.autolinkProtocol.call(this,e)}function aue(e){this.config.exit.data.call(this,e);let t=this.stack[this.stack.length-1];t.type,t.url=`http://`+this.sliceSerialize(e)}function oue(e){this.config.exit.autolinkEmail.call(this,e)}function sue(e){this.exit(e)}function cue(e){Zle(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,lue],[/(?<=^|\s|\p{P}|\p{S})([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/gu,uue]],{ignore:[`link`,`linkReference`]})}function lue(e,t,n,r,i){let a=``;if(!W1(i)||(/^w/i.test(t)&&(n=t+n,t=``,a=`http://`),!due(n)))return!1;let o=fue(n+r);if(!o[0])return!1;let s={type:`link`,title:null,url:a+t+o[0],children:[{type:`text`,value:t+o[0]}]};return o[1]?[s,{type:`text`,value:o[1]}]:s}function uue(e,t,n,r){return!W1(r,!0)||/[-\d_]$/.test(n)?!1:{type:`link`,title:null,url:`mailto:`+t+`@`+n,children:[{type:`text`,value:t+`@`+n}]}}function due(e){let t=e.split(`.`);return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function fue(e){let t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(`)`),i=B1(e,`(`),a=B1(e,`)`);for(;r!==-1&&i>a;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(`)`),a++;return[e,n]}function W1(e,t){let n=e.input.charCodeAt(e.index-1);return(e.index===0||jX(n)||AX(n))&&(!t||n!==47)}G1.peek=xue;function pue(){this.buffer()}function mue(e){this.enter({type:`footnoteReference`,identifier:``,label:``},e)}function hue(){this.buffer()}function gue(e){this.enter({type:`footnoteDefinition`,identifier:``,label:``,children:[]},e)}function _ue(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=yX(this.sliceSerialize(e)).toLowerCase(),n.label=t}function vue(e){this.exit(e)}function yue(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=yX(this.sliceSerialize(e)).toLowerCase(),n.label=t}function bue(e){this.exit(e)}function xue(){return`[`}function G1(e,t,n,r){let i=n.createTracker(r),a=i.move(`[^`),o=n.enter(`footnoteReference`),s=n.enter(`reference`);return a+=i.move(n.safe(n.associationId(e),{after:`]`,before:a})),s(),o(),a+=i.move(`]`),a}function Sue(){return{enter:{gfmFootnoteCallString:pue,gfmFootnoteCall:mue,gfmFootnoteDefinitionLabelString:hue,gfmFootnoteDefinition:gue},exit:{gfmFootnoteCallString:_ue,gfmFootnoteCall:vue,gfmFootnoteDefinitionLabelString:yue,gfmFootnoteDefinition:bue}}}function Cue(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:G1},unsafe:[{character:`[`,inConstruct:[`label`,`phrasing`,`reference`]}]};function n(e,n,r,i){let a=r.createTracker(i),o=a.move(`[^`),s=r.enter(`footnoteDefinition`),c=r.enter(`label`);return o+=a.move(r.safe(r.associationId(e),{before:o,after:`]`})),c(),o+=a.move(`]:`),e.children&&e.children.length>0&&(a.shift(4),o+=a.move((t?`
480`:` `)+r.indentLines(r.containerFlow(e,a.current()),t?K1:wue))),s(),o}}function wue(e,t,n){return t===0?e:K1(e,t,n)}function K1(e,t,n){return(n?``:`    `)+e}var Tue=[`autolink`,`destinationLiteral`,`destinationRaw`,`reference`,`titleQuote`,`titleApostrophe`];q1.peek=Aue;function Eue(){return{canContainEols:[`delete`],enter:{strikethrough:Oue},exit:{strikethrough:kue}}}function Due(){return{unsafe:[{character:`~`,inConstruct:`phrasing`,notInConstruct:Tue}],handlers:{delete:q1}}}function Oue(e){this.enter({type:`delete`,children:[]},e)}function kue(e){this.exit(e)}function q1(e,t,n,r){let i=n.createTracker(r),a=n.enter(`strikethrough`),o=i.move(`~~`);return o+=n.containerPhrasing(e,{...i.current(),before:o,after:`~`}),o+=i.move(`~~`),a(),o}function Aue(){return`~`}function jue(e){return e.length}function Mue(e,t){let n=t||{},r=(n.align||[]).concat(),i=n.stringLength||jue,a=[],o=[],s=[],c=[],l=0,u=-1;for(;++u<e.length;){let t=[],r=[],a=-1;for(e[u].length>l&&(l=e[u].length);++a<e[u].length;){let o=Nue(e[u][a]);if(n.alignDelimiters!==!1){let e=i(o);r[a]=e,(c[a]===void 0||e>c[a])&&(c[a]=e)}t.push(o)}
vendor: 8,275 bytes, lines 480-492
480o[u]=t,s[u]=r}let d=-1;if(typeof r==`object`&&`length`in r)for(;++d<l;)a[d]=J1(r[d]);else{let e=J1(r);for(;++d<l;)a[d]=e}d=-1;let f=[],p=[];for(;++d<l;){let e=a[d],t=``,r=``;e===99?(t=`:`,r=`:`):e===108?t=`:`:e===114&&(r=`:`);let i=n.alignDelimiters===!1?1:Math.max(1,c[d]-t.length-r.length),o=t+`-`.repeat(i)+r;n.alignDelimiters!==!1&&(i=t.length+i+r.length,i>c[d]&&(c[d]=i),p[d]=i),f[d]=o}o.splice(1,0,f),s.splice(1,0,p),u=-1;let m=[];for(;++u<o.length;){let e=o[u],t=s[u];d=-1;let r=[];for(;++d<l;){let i=e[d]||``,o=``,s=``;if(n.alignDelimiters!==!1){let e=c[d]-(t[d]||0),n=a[d];n===114?o=` `.repeat(e):n===99?e%2?(o=` `.repeat(e/2+.5),s=` `.repeat(e/2-.5)):(o=` `.repeat(e/2),s=o):s=` `.repeat(e)}n.delimiterStart!==!1&&!d&&r.push(`|`),n.padding!==!1&&!(n.alignDelimiters===!1&&i===``)&&(n.delimiterStart!==!1||d)&&r.push(` `),n.alignDelimiters!==!1&&r.push(o),r.push(i),n.alignDelimiters!==!1&&r.push(s),n.padding!==!1&&r.push(` `),(n.delimiterEnd!==!1||d!==l-1)&&r.push(`|`)}m.push(n.delimiterEnd===!1?r.join(``).replace(/ +$/,``):r.join(``))}return m.join(`
481`)}function Nue(e){return e==null?``:String(e)}function J1(e){let t=typeof e==`string`?e.codePointAt(0):0;return t===67||t===99?99:t===76||t===108?108:t===82||t===114?114:0}function Pue(e,t,n,r){let i=n.enter(`blockquote`),a=n.createTracker(r);a.move(`> `),a.shift(2);let o=n.indentLines(n.containerFlow(e,a.current()),Fue);return i(),o}function Fue(e,t,n){return`>`+(n?``:` `)+e}function Iue(e,t){return Y1(e,t.inConstruct,!0)&&!Y1(e,t.notInConstruct,!1)}function Y1(e,t,n){if(typeof t==`string`&&(t=[t]),!t||t.length===0)return n;let r=-1;for(;++r<t.length;)if(e.includes(t[r]))return!0;return!1}function X1(e,t,n,r){let i=-1;for(;++i<n.unsafe.length;)if(n.unsafe[i].character===`
482`&&Iue(n.stack,n.unsafe[i]))return/[ \t]/.test(r.before)?``:` `;return`\\
483`}function Lue(e,t){let n=String(e),r=n.indexOf(t),i=r,a=0,o=0;if(typeof t!=`string`)throw TypeError(`Expected substring`);for(;r!==-1;)r===i?++a>o&&(o=a):a=1,i=r+t.length,r=n.indexOf(t,i);return o}function Rue(e,t){return!!(t.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function zue(e){let t=e.options.fence||"`";if(t!=="`"&&t!==`~`)throw Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function Bue(e,t,n,r){let i=zue(n),a=e.value||``,o=i==="`"?`GraveAccent`:`Tilde`;if(Rue(e,n)){let e=n.enter(`codeIndented`),t=n.indentLines(a,Vue);return e(),t}let s=n.createTracker(r),c=i.repeat(Math.max(Lue(a,i)+1,3)),l=n.enter(`codeFenced`),u=s.move(c);if(e.lang){let t=n.enter(`codeFencedLang${o}`);u+=s.move(n.safe(e.lang,{before:u,after:` `,encode:["`"],...s.current()})),t()}if(e.lang&&e.meta){let t=n.enter(`codeFencedMeta${o}`);u+=s.move(` `),u+=s.move(n.safe(e.meta,{before:u,after:`
484`,encode:["`"],...s.current()})),t()}return u+=s.move(`
485`),a&&(u+=s.move(a+`
486`)),u+=s.move(c),l(),u}function Vue(e,t,n){return(n?``:`    `)+e}function Z1(e){let t=e.options.quote||`"`;if(t!==`"`&&t!==`'`)throw Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function Hue(e,t,n,r){let i=Z1(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.enter(`definition`),s=n.enter(`label`),c=n.createTracker(r),l=c.move(`[`);return l+=c.move(n.safe(n.associationId(e),{before:l,after:`]`,...c.current()})),l+=c.move(`]: `),s(),!e.url||/[\0- \u007F]/.test(e.url)?(s=n.enter(`destinationLiteral`),l+=c.move(`<`),l+=c.move(n.safe(e.url,{before:l,after:`>`,...c.current()})),l+=c.move(`>`)):(s=n.enter(`destinationRaw`),l+=c.move(n.safe(e.url,{before:l,after:e.title?` `:`
487`,...c.current()}))),s(),e.title&&(s=n.enter(`title${a}`),l+=c.move(` `+i),l+=c.move(n.safe(e.title,{before:l,after:i,...c.current()})),l+=c.move(i),s()),o(),l}function Uue(e){let t=e.options.emphasis||`*`;if(t!==`*`&&t!==`_`)throw Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function Q1(e){return`&#x`+e.toString(16).toUpperCase()+`;`}function $1(e,t,n){let r=VX(e),i=VX(t);return r===void 0?i===void 0?n===`_`?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}e0.peek=Wue;function e0(e,t,n,r){let i=Uue(n),a=n.enter(`emphasis`),o=n.createTracker(r),s=o.move(i),c=o.move(n.containerPhrasing(e,{after:i,before:s,...o.current()})),l=c.charCodeAt(0),u=$1(r.before.charCodeAt(r.before.length-1),l,i);u.inside&&(c=Q1(l)+c.slice(1));let d=c.charCodeAt(c.length-1),f=$1(r.after.charCodeAt(0),d,i);f.inside&&(c=c.slice(0,-1)+Q1(d));let p=o.move(i);return a(),n.attentionEncodeSurroundingInfo={after:f.outside,before:u.outside},s+c+p}function Wue(e,t,n){return n.options.emphasis||`*`}function Gue(e,t){let n=!1;return EJ(e,function(e){if(`value`in e&&/\r?\n|\r/.test(e.value)||e.type===`break`)return n=!0,!1}),!!((!e.depth||e.depth<3)&&oX(e)&&(t.options.setext||n))}function Kue(e,t,n,r){let i=Math.max(Math.min(6,e.depth||1),1),a=n.createTracker(r);if(Gue(e,n)){let t=n.enter(`headingSetext`),r=n.enter(`phrasing`),o=n.containerPhrasing(e,{...a.current(),before:`
488`,after:`
489`});return r(),t(),o+`
490`+(i===1?`=`:`-`).repeat(o.length-(Math.max(o.lastIndexOf(`\r`),o.lastIndexOf(`
491`))+1))}let o=`#`.repeat(i),s=n.enter(`headingAtx`),c=n.enter(`phrasing`);a.move(o+` `);let l=n.containerPhrasing(e,{before:`# `,after:`
492`,...a.current()});return/^[\t ]/.test(l)&&(l=Q1(l.charCodeAt(0))+l.slice(1)),l=l?o+` `+l:o,n.options.closeAtx&&(l+=` `+o),c(),s(),l}t0.peek=que;function t0(e){return e.value||``}function que(){return`<`}n0.peek=Jue;function n0(e,t,n,r){let i=Z1(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.enter(`image`),s=n.enter(`label`),c=n.createTracker(r),l=c.move(`![`);return l+=c.move(n.safe(e.alt,{before:l,after:`]`,...c.current()})),l+=c.move(`](`),s(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(s=n.enter(`destinationLiteral`),l+=c.move(`<`),l+=c.move(n.safe(e.url,{before:l,after:`>`,...c.current()})),l+=c.move(`>`)):(s=n.enter(`destinationRaw`),l+=c.move(n.safe(e.url,{before:l,after:e.title?` `:`)`,...c.current()}))),s(),e.title&&(s=n.enter(`title${a}`),l+=c.move(` `+i),l+=c.move(n.safe(e.title,{before:l,after:i,...c.current()})),l+=c.move(i),s()),l+=c.move(`)`),o(),l}function Jue(){return`!`}r0.peek=Yue;function r0(e,t,n,r){let i=e.referenceType,a=n.enter(`imageReference`),o=n.enter(`label`),s=n.createTracker(r),c=s.move(`![`),l=n.safe(e.alt,{before:c,after:`]`,...s.current()});c+=s.move(l+`][`),o();let u=n.stack;n.stack=[],o=n.enter(`reference`);let d=n.safe(n.associationId(e),{before:c,after:`]`,...s.current()});return o(),n.stack=u,a(),i===`full`||!l||l!==d?c+=s.move(d+`]`):i===`shortcut`?c=c.slice(0,-1):c+=s.move(`]`),c}function Yue(){return`!`}i0.peek=Xue;function i0(e,t,n){let r=e.value||``,i="`",a=-1;for(;RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=` `+r+` `);++a<n.unsafe.length;){let e=n.unsafe[a],t=n.compilePattern(e),i;if(e.atBreak)for(;i=t.exec(r);){let e=i.index;r.charCodeAt(e)===10&&r.charCodeAt(e-1)===13&&e--,r=r.slice(0,e)+` `+r.slice(i.index+1)}}return i+r+i}function Xue(){return"`"}function a0(e,t){let n=oX(e);return!!(!t.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type===`text`&&(n===e.url||`mailto:`+n===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}o0.peek=Zue;function o0(e,t,n,r){let i=Z1(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.createTracker(r),s,c;if(a0(e,n)){let t=n.stack;n.stack=[],s=n.enter(`autolink`);let r=o.move(`<`);return r+=o.move(n.containerPhrasing(e,{before:r,after:`>`,...o.current()})),r+=o.move(`>`),s(),n.stack=t,r}s=n.enter(`link`),c=n.enter(`label`);let l=o.move(`[`);return l+=o.move(n.containerPhrasing(e,{before:l,after:`](`,...o.current()})),l+=o.move(`](`),c(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(c=n.enter(`destinationLiteral`),l+=o.move(`<`),l+=o.move(n.safe(e.url,{before:l,after:`>`,...o.current()})),l+=o.move(`>`)):(c=n.enter(`destinationRaw`),l+=o.move(n.safe(e.url,{before:l,after:e.title?` `:`)`,...o.current()}
vendor: 12,700 bytes, lines 492-494
492))),c(),e.title&&(c=n.enter(`title${a}`),l+=o.move(` `+i),l+=o.move(n.safe(e.title,{before:l,after:i,...o.current()})),l+=o.move(i),c()),l+=o.move(`)`),s(),l}function Zue(e,t,n){return a0(e,n)?`<`:`[`}s0.peek=Que;function s0(e,t,n,r){let i=e.referenceType,a=n.enter(`linkReference`),o=n.enter(`label`),s=n.createTracker(r),c=s.move(`[`),l=n.containerPhrasing(e,{before:c,after:`]`,...s.current()});c+=s.move(l+`][`),o();let u=n.stack;n.stack=[],o=n.enter(`reference`);let d=n.safe(n.associationId(e),{before:c,after:`]`,...s.current()});return o(),n.stack=u,a(),i===`full`||!l||l!==d?c+=s.move(d+`]`):i===`shortcut`?c=c.slice(0,-1):c+=s.move(`]`),c}function Que(){return`[`}function c0(e){let t=e.options.bullet||`*`;if(t!==`*`&&t!==`+`&&t!==`-`)throw Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function $ue(e){let t=c0(e),n=e.options.bulletOther;if(!n)return t===`*`?`-`:`*`;if(n!==`*`&&n!==`+`&&n!==`-`)throw Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function ede(e){let t=e.options.bulletOrdered||`.`;if(t!==`.`&&t!==`)`)throw Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function l0(e){let t=e.options.rule||`*`;if(t!==`*`&&t!==`-`&&t!==`_`)throw Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function tde(e,t,n,r){let i=n.enter(`list`),a=n.bulletCurrent,o=e.ordered?ede(n):c0(n),s=e.ordered?o===`.`?`)`:`.`:$ue(n),c=t&&n.bulletLastUsed?o===n.bulletLastUsed:!1;if(!e.ordered){let t=e.children?e.children[0]:void 0;if((o===`*`||o===`-`)&&t&&(!t.children||!t.children[0])&&n.stack[n.stack.length-1]===`list`&&n.stack[n.stack.length-2]===`listItem`&&n.stack[n.stack.length-3]===`list`&&n.stack[n.stack.length-4]===`listItem`&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(c=!0),l0(n)===o&&t){let t=-1;for(;++t<e.children.length;){let n=e.children[t];if(n&&n.type===`listItem`&&n.children&&n.children[0]&&n.children[0].type===`thematicBreak`){c=!0;break}}}}c&&(o=s),n.bulletCurrent=o;let l=n.containerFlow(e,r);return n.bulletLastUsed=o,n.bulletCurrent=a,i(),l}function nde(e){let t=e.options.listItemIndent||`one`;if(t!==`tab`&&t!==`one`&&t!==`mixed`)throw Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function rde(e,t,n,r){let i=nde(n),a=n.bulletCurrent||c0(n);t&&t.type===`list`&&t.ordered&&(a=(typeof t.start==`number`&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+a);let o=a.length+1;(i===`tab`||i===`mixed`&&(t&&t.type===`list`&&t.spread||e.spread))&&(o=Math.ceil(o/4)*4);let s=n.createTracker(r);s.move(a+` `.repeat(o-a.length)),s.shift(o);let c=n.enter(`listItem`),l=n.indentLines(n.containerFlow(e,s.current()),u);return c(),l;function u(e,t,n){return t?(n?``:` `.repeat(o))+e:(n?a:a+` `.repeat(o-a.length))+e}}function ide(e,t,n,r){let i=n.enter(`paragraph`),a=n.enter(`phrasing`),o=n.containerPhrasing(e,r);return a(),i(),o}var ade=eJ([`break`,`delete`,`emphasis`,`footnote`,`footnoteReference`,`image`,`imageReference`,`inlineCode`,`inlineMath`,`link`,`linkReference`,`mdxJsxTextElement`,`mdxTextExpression`,`strong`,`text`,`textDirective`]);function ode(e,t,n,r){return(e.children.some(function(e){return ade(e)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function sde(e){let t=e.options.strong||`*`;if(t!==`*`&&t!==`_`)throw Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}u0.peek=cde;function u0(e,t,n,r){let i=sde(n),a=n.enter(`strong`),o=n.createTracker(r),s=o.move(i+i),c=o.move(n.containerPhrasing(e,{after:i,before:s,...o.current()})),l=c.charCodeAt(0),u=$1(r.before.charCodeAt(r.before.length-1),l,i);u.inside&&(c=Q1(l)+c.slice(1));let d=c.charCodeAt(c.length-1),f=$1(r.after.charCodeAt(0),d,i);f.inside&&(c=c.slice(0,-1)+Q1(d));let p=o.move(i+i);return a(),n.attentionEncodeSurroundingInfo={after:f.outside,before:u.outside},s+c+p}function cde(e,t,n){return n.options.strong||`*`}function lde(e,t,n,r){return n.safe(e.value,r)}function ude(e){let t=e.options.ruleRepetition||3;if(t<3)throw Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function dde(e,t,n){let r=(l0(n)+(n.options.ruleSpaces?` `:``)).repeat(ude(n));return n.options.ruleSpaces?r.slice(0,-1):r}var d0={blockquote:Pue,break:X1,code:Bue,definition:Hue,emphasis:e0,hardBreak:X1,heading:Kue,html:t0,image:n0,imageReference:r0,inlineCode:i0,link:o0,linkReference:s0,list:tde,listItem:rde,paragraph:ide,root:ode,strong:u0,text:lde,thematicBreak:dde};function fde(){return{enter:{table:pde,tableData:p0,tableHeader:p0,tableRow:hde},exit:{codeText:gde,table:mde,tableData:f0,tableHeader:f0,tableRow:f0}}}function pde(e){let t=e._align;this.enter({type:`table`,align:t.map(function(e){return e===`none`?null:e}),children:[]},e),this.data.inTable=!0}function mde(e){this.exit(e),this.data.inTable=void 0}function hde(e){this.enter({type:`tableRow`,children:[]},e)}function f0(e){this.exit(e)}function p0(e){this.enter({type:`tableCell`,children:[]},e)}function gde(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,_de));let n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function _de(e,t){return t===`|`?t:e}function vde(e){let t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,a=n?` `:`|`;return{unsafe:[{character:`\r`,inConstruct:`tableCell`},{character:`
493`,inConstruct:`tableCell`},{atBreak:!0,character:`|`,after:`[	 :-]`},{character:`|`,inConstruct:`tableCell`},{atBreak:!0,character:`:`,after:`-`},{atBreak:!0,character:`-`,after:`[:|-]`}],handlers:{inlineCode:f,table:o,tableCell:c,tableRow:s}};function o(e,t,n,r){return l(u(e,n,r),e.align)}function s(e,t,n,r){let i=l([d(e,n,r)]);return i.slice(0,i.indexOf(`
494`))}function c(e,t,n,r){let i=n.enter(`tableCell`),o=n.enter(`phrasing`),s=n.containerPhrasing(e,{...r,before:a,after:a});return o(),i(),s}function l(e,t){return Mue(e,{align:t,alignDelimiters:r,padding:n,stringLength:i})}function u(e,t,n){let r=e.children,i=-1,a=[],o=t.enter(`table`);for(;++i<r.length;)a[i]=d(r[i],t,n);return o(),a}function d(e,t,n){let r=e.children,i=-1,a=[],o=t.enter(`tableRow`);for(;++i<r.length;)a[i]=c(r[i],e,t,n);return o(),a}function f(e,t,n){let r=d0.inlineCode(e,t,n);return n.stack.includes(`tableCell`)&&(r=r.replace(/\|/g,`\\$&`)),r}}function yde(){return{exit:{taskListCheckValueChecked:m0,taskListCheckValueUnchecked:m0,paragraph:xde}}}function bde(){return{unsafe:[{atBreak:!0,character:`-`,after:`[:|-]`}],handlers:{listItem:Sde}}}function m0(e){let t=this.stack[this.stack.length-2];t.type,t.checked=e.type===`taskListCheckValueChecked`}function xde(e){let t=this.stack[this.stack.length-2];if(t&&t.type===`listItem`&&typeof t.checked==`boolean`){let e=this.stack[this.stack.length-1];e.type;let n=e.children[0];if(n&&n.type===`text`){let r=t.children,i=-1,a;for(;++i<r.length;){let e=r[i];if(e.type===`paragraph`){a=e;break}}a===e&&(n.value=n.value.slice(1),n.value.length===0?e.children.shift():e.position&&n.position&&typeof n.position.start.offset==`number`&&(n.position.start.column++,n.position.start.offset++,e.position.start=Object.assign({},n.position.start)))}}this.exit(e)}function Sde(e,t,n,r){let i=e.children[0],a=typeof e.checked==`boolean`&&i&&i.type===`paragraph`,o=`[`+(e.checked?`x`:` `)+`] `,s=n.createTracker(r);a&&s.move(o);let c=d0.listItem(e,t,n,{...r,...s.current()});return a&&(c=c.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,l)),c;function l(e){return e+o}}function Cde(){return[tue(),Sue(),Eue(),fde(),yde()]}function wde(e){return{extensions:[nue(),Cue(e),Due(),vde(e),bde()]}}var Tde={tokenize:jde,partial:!0},h0={tokenize:Mde,partial:!0},g0={tokenize:Nde,partial:!0},_0={tokenize:Pde,partial:!0},Ede={tokenize:Fde,partial:!0},v0={name:`wwwAutolink`,tokenize:kde,previous:C0},y0={name:`protocolAutolink`,tokenize:Ade,previous:w0},b0={name:`emailAutolink`,tokenize:Ode,previous:T0},x0={};function Dde(){return{text:x0}}for(var S0=48;S0<123;)x0[S0]=b0,S0++,S0===58?S0=65:S0===91&&(S0=97);x0[43]=b0,x0[45]=b0,x0[46]=b0,x0[95]=b0,x0[72]=[b0,y0],x0[104]=[b0,y0],x0[87]=[b0,v0],x0[119]=[b0,v0];function Ode(e,t,n){let r=this,i,a;return o;function o(t){return!E0(t)||!T0.call(r,r.previous)||D0(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkEmail`),s(t))}function s(t){return E0(t)?(e.consume(t),s):t===64?(e.consume(t),c):n(t)}function c(t){return t===46?e.check(Ede,u,l)(t):t===45||t===95||xX(t)?(a=!0,e.consume(t),c):u(t)}function l(t){return e.consume(t),i=!0,c}function u(o){return a&&i&&bX(r.previous)?(e.exit(`literalAutolinkEmail`),e.exit(`literalAutolink`),t(o)):n(o)}}function kde(e,t,n){let r=this;return i;function i(t){return t!==87&&t!==119||!C0.call(r,r.previous)||D0(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkWww`),e.check(Tde,e.attempt(h0,e.attempt(g0,a),n),n)(t))}function a(n){return e.exit(`literalAutolinkWww`),e.exit(`literalAutolink`),t(n)}}function Ade(e,t,n){let r=this,i=``,a=!1;return o;function o(t){return(t===72||t===104)&&w0.call(r,r.previous)&&!D0(r.events)?(e.enter(`literalAutolink`),e.enter(`literalAutolinkHttp`),i+=String.fromCodePoint(t),e.consume(t),s):n(t)}function s(t){if(bX(t)&&i.length<5)return i+=String.fromCodePoint(t),e.consume(t),s;if(t===58){let n=i.toLowerCase();if(n===`http`||n===`https`)return e.consume(t),c}return n(t)}function c(t){return t===47?(e.consume(t),a?l:(a=!0,c)):n(t)}function l(t){return t===null||CX(t)||OX(t)||jX(t)||AX(t)?n(t):e.attempt(h0,e.attempt(g0,u),n)(t)}function u(n){return e.exit(`literalAutolinkHttp`),e.exit(`literalAutolink`),t(n)}}function jde(e,t,n){let r=0;return i;function i(t){return(t===87||t===119)&&r<3?(r++,e.consume(t),i):t===46&&r===3?(e.consume(t),a):n(t)}function a(e){return e===null?n(e):t(e)}}function Mde(e,t,n){let r,i,a;return o;function o(t){return t===46||t===95?e.check(_0,c,s)(t):t===null||OX(t)||jX(t)||t!==45&&AX(t)?c(t):(a=!0,e.consume(t),o)}function s(t){return t===95?r=!0:(i=r,r=void 0),e.consume(t),o}function c(e){return i||r||!a?n(e):t(e)}}function Nde(e,t){let n=0,r=0;return i;function i(o){return o===40?(n++,e.consume(o),i):o===41&&r<n?a(o):o===33||o===34||o===38||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===60||o===63||o===93||o===95||o===126?e.check(_0,t,a)(o):o===null||OX(o)||jX(o)?t(o):(e.consume(o),i)}function a(t){return t===41&&r++,e.consume(t),i}}function Pde(e,t,n){return r;function r(o){return o===33||o===34||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===63||o===95||o===126?(e.consume(o),r):o===38?(e.consume(o),a):o===93?(e.consume(o),i):o===60||o===null||OX(o)||jX(o)?t(o):n(o)}function i(e){return e===null||e===40||e===91||OX(e)||jX(e)?t(e):r(e)}function a(e){return bX(e)?o(e):n(e)}function o(t){return t===59?(e.consume(t),r):bX(t)?(e.consume(t),o):n(t)}}function Fde(e,t,n){return r;function r(t){return e.consume(t),i}function i(e){return xX(e)?n(e):t(e)}}function C0(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||OX(e)}function w0(e){return!bX(e)}function T0(e){return!(e===47||E0(e))}function E0(e){return e===43||e===45||e===46||e===95||xX(e)}function D0(e){let t=e.length,n=!1;for(;t--;){let r=e[t][1];if((r.type===`labelLink`||r.type===`labelImage`)&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}var Ide={tokenize:Wde,partial:!0};function Lde(){return{document:{91:{name:`gfmFootnoteDefinition`,tokenize:Vde,continuation:{tokenize:Hde},exit:Ude}},text:{91:{name:`gfmFootnoteCall`,tokenize:Bde},93:{name:`gfmPotentialFootnoteCall`,add:`after`,tokenize:Rde,resolveTo:zde}}}}function Rde(e,t,n){let r=this,i=r.events.length,a=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),o;for(;i--;){let e=r.events[i][1];if(e.type===`labelImage`){o=e;break}if(e.type===`gfmFootnoteCall`||e.type===`labelLink`||e.type===`label`||e.type===`image`||e.type===`link`)break}return s;function s(i){if(!o||!o._balanced)return n(i);let s=yX(r.sliceSerialize({start:o.end,end:r.now()}));return s.codePointAt(0)!==94||!a.includes(s.slice(1))?n(i):(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(i),e.exit(`gfmFootnoteCallLabelMarker`),t(i))}}function zde(e,t){let n=e.length;for(;n--;)if(e[n][1].type===`labelImage`&&e[n][0]===`enter`){e[n][1];break}e[n+1][1].type=`data`,e[n+3][1].type=`gfmFootnoteCallLabelMarker`;
vendor: 11,583 bytes, line 494
494let r={type:`gfmFootnoteCall`,start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:`gfmFootnoteCallMarker`,start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;let a={type:`gfmFootnoteCallString`,start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},o={type:`chunkString`,contentType:`string`,start:Object.assign({},a.start),end:Object.assign({},a.end)},s=[e[n+1],e[n+2],[`enter`,r,t],e[n+3],e[n+4],[`enter`,i,t],[`exit`,i,t],[`enter`,a,t],[`enter`,o,t],[`exit`,o,t],[`exit`,a,t],e[e.length-2],e[e.length-1],[`exit`,r,t]];return e.splice(n,e.length-n+1,...s),e}function Bde(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),a=0,o;return s;function s(t){return e.enter(`gfmFootnoteCall`),e.enter(`gfmFootnoteCallLabelMarker`),e.consume(t),e.exit(`gfmFootnoteCallLabelMarker`),c}function c(t){return t===94?(e.enter(`gfmFootnoteCallMarker`),e.consume(t),e.exit(`gfmFootnoteCallMarker`),e.enter(`gfmFootnoteCallString`),e.enter(`chunkString`).contentType=`string`,l):n(t)}function l(s){if(a>999||s===93&&!o||s===null||s===91||OX(s))return n(s);if(s===93){e.exit(`chunkString`);let a=e.exit(`gfmFootnoteCallString`);return i.includes(yX(r.sliceSerialize(a)))?(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(s),e.exit(`gfmFootnoteCallLabelMarker`),e.exit(`gfmFootnoteCall`),t):n(s)}return OX(s)||(o=!0),a++,e.consume(s),s===92?u:l}function u(t){return t===91||t===92||t===93?(e.consume(t),a++,l):l(t)}}function Vde(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),a,o=0,s;return c;function c(t){return e.enter(`gfmFootnoteDefinition`)._container=!0,e.enter(`gfmFootnoteDefinitionLabel`),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),l}function l(t){return t===94?(e.enter(`gfmFootnoteDefinitionMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionMarker`),e.enter(`gfmFootnoteDefinitionLabelString`),e.enter(`chunkString`).contentType=`string`,u):n(t)}function u(t){if(o>999||t===93&&!s||t===null||t===91||OX(t))return n(t);if(t===93){e.exit(`chunkString`);let n=e.exit(`gfmFootnoteDefinitionLabelString`);return a=yX(r.sliceSerialize(n)),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),e.exit(`gfmFootnoteDefinitionLabel`),f}return OX(t)||(s=!0),o++,e.consume(t),t===92?d:u}function d(t){return t===91||t===92||t===93?(e.consume(t),o++,u):u(t)}function f(t){return t===58?(e.enter(`definitionMarker`),e.consume(t),e.exit(`definitionMarker`),i.includes(a)||i.push(a),PX(e,p,`gfmFootnoteDefinitionWhitespace`)):n(t)}function p(e){return t(e)}}function Hde(e,t,n){return e.check(YX,t,e.attempt(Ide,t,n))}function Ude(e){e.exit(`gfmFootnoteDefinition`)}function Wde(e,t,n){let r=this;return PX(e,i,`gfmFootnoteDefinitionIndent`,5);function i(e){let i=r.events[r.events.length-1];return i&&i[1].type===`gfmFootnoteDefinitionIndent`&&i[2].sliceSerialize(i[1],!0).length===4?t(e):n(e)}}function Gde(e){let t=(e||{}).singleTilde,n={name:`strikethrough`,tokenize:i,resolveAll:r};return t??=!0,{text:{126:n},insideSpan:{null:[n]},attentionMarkers:{null:[126]}};function r(e,t){let n=-1;for(;++n<e.length;)if(e[n][0]===`enter`&&e[n][1].type===`strikethroughSequenceTemporary`&&e[n][1]._close){let r=n;for(;r--;)if(e[r][0]===`exit`&&e[r][1].type===`strikethroughSequenceTemporary`&&e[r][1]._open&&e[n][1].end.offset-e[n][1].start.offset===e[r][1].end.offset-e[r][1].start.offset){e[n][1].type=`strikethroughSequence`,e[r][1].type=`strikethroughSequence`;let i={type:`strikethrough`,start:Object.assign({},e[r][1].start),end:Object.assign({},e[n][1].end)},a={type:`strikethroughText`,start:Object.assign({},e[r][1].end),end:Object.assign({},e[n][1].start)},o=[[`enter`,i,t],[`enter`,e[r][1],t],[`exit`,e[r][1],t],[`enter`,a,t]],s=t.parser.constructs.insideSpan.null;s&&fX(o,o.length,0,HX(s,e.slice(r+1,n),t)),fX(o,o.length,0,[[`exit`,a,t],[`enter`,e[n][1],t],[`exit`,e[n][1],t],[`exit`,i,t]]),fX(e,r-1,n-r+3,o),n=r+o.length-2;break}}for(n=-1;++n<e.length;)e[n][1].type===`strikethroughSequenceTemporary`&&(e[n][1].type=`data`);return e}function i(e,n,r){let i=this.previous,a=this.events,o=0;return s;function s(t){return i===126&&a[a.length-1][1].type!==`characterEscape`?r(t):(e.enter(`strikethroughSequenceTemporary`),c(t))}function c(a){let s=VX(i);if(a===126)return o>1?r(a):(e.consume(a),o++,c);if(o<2&&!t)return r(a);let l=e.exit(`strikethroughSequenceTemporary`),u=VX(a);return l._open=!u||u===2&&!!s,l._close=!s||s===2&&!!u,n(a)}}}var Kde=class{constructor(){this.map=[]}add(e,t,n){qde(this,e,t,n)}consume(e){if(this.map.sort(function(e,t){return e[0]-t[0]}),this.map.length===0)return;let t=this.map.length,n=[];for(;t>0;)--t,n.push(e.slice(this.map[t][0]+this.map[t][1]),this.map[t][2]),e.length=this.map[t][0];n.push(e.slice()),e.length=0;let r=n.pop();for(;r;){for(let t of r)e.push(t);r=n.pop()}this.map.length=0}};function qde(e,t,n,r){let i=0;if(!(n===0&&r.length===0)){for(;i<e.map.length;){if(e.map[i][0]===t){e.map[i][1]+=n,e.map[i][2].push(...r);return}i+=1}e.map.push([t,n,r])}}function Jde(e,t){let n=!1,r=[];for(;t<e.length;){let i=e[t];if(n){if(i[0]===`enter`)i[1].type===`tableContent`&&r.push(e[t+1][1].type===`tableDelimiterMarker`?`left`:`none`);else if(i[1].type===`tableContent`){if(e[t-1][1].type===`tableDelimiterMarker`){let e=r.length-1;r[e]=r[e]===`left`?`center`:`right`}}else if(i[1].type===`tableDelimiterRow`)break}else i[0]===`enter`&&i[1].type===`tableDelimiterRow`&&(n=!0);t+=1}return r}function Yde(){return{flow:{null:{name:`table`,tokenize:Xde,resolveAll:Zde}}}}function Xde(e,t,n){let r=this,i=0,a=0,o;return s;function s(e){let t=r.events.length-1;for(;t>-1;){let e=r.events[t][1].type;if(e===`lineEnding`||e===`linePrefix`)t--;else break}let i=t>-1?r.events[t][1].type:null,a=i===`tableHead`||i===`tableRow`?S:c;return a===S&&r.parser.lazy[r.now().line]?n(e):a(e)}function c(t){return e.enter(`tableHead`),e.enter(`tableRow`),l(t)}function l(e){return e===124?u(e):(o=!0,a+=1,u(e))}function u(t){return t===null?n(t):DX(t)?a>1?(a=0,r.interrupt=!0,e.exit(`tableRow`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),p):n(t):kX(t)?PX(e,u,`whitespace`)(t):(a+=1,o&&(o=!1,i+=1),t===124?(e.enter(`tableCellDivider`),e.consume(t),e.exit(`tableCellDivider`),o=!0,u):(e.enter(`data`),d(t)))}function d(t){return t===null||t===124||OX(t)?(e.exit(`data`),u(t)):(e.consume(t),t===92?f:d)}function f(t){return t===92||t===124?(e.consume(t),d):d(t)}function p(t){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(t):(e.enter(`tableDelimiterRow`),o=!1,kX(t)?PX(e,m,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):m(t))}function m(t){return t===45||t===58?g(t):t===124?(o=!0,e.enter(`tableCellDivider`),e.consume(t),e.exit(`tableCellDivider`),h):x(t)}function h(t){return kX(t)?PX(e,g,`whitespace`)(t):g(t)}function g(t){return t===58?(a+=1,o=!0,e.enter(`tableDelimiterMarker`),e.consume(t),e.exit(`tableDelimiterMarker`),_):t===45?(a+=1,_(t)):t===null||DX(t)?b(t):x(t)}function _(t){return t===45?(e.enter(`tableDelimiterFiller`),v(t)):x(t)}function v(t){return t===45?(e.consume(t),v):t===58?(o=!0,e.exit(`tableDelimiterFiller`),e.enter(`tableDelimiterMarker`),e.consume(t),e.exit(`tableDelimiterMarker`),y):(e.exit(`tableDelimiterFiller`),y(t))}function y(t){return kX(t)?PX(e,b,`whitespace`)(t):b(t)}function b(n){return n===124?m(n):n===null||DX(n)?!o||i!==a?x(n):(e.exit(`tableDelimiterRow`),e.exit(`tableHead`),t(n)):x(n)}function x(e){return n(e)}function S(t){return e.enter(`tableRow`),C(t)}function C(n){return n===124?(e.enter(`tableCellDivider`),e.consume(n),e.exit(`tableCellDivider`),C):n===null||DX(n)?(e.exit(`tableRow`),t(n)):kX(n)?PX(e,C,`whitespace`)(n):(e.enter(`data`),w(n))}function w(t){return t===null||t===124||OX(t)?(e.exit(`data`),C(t)):(e.consume(t),t===92?T:w)}function T(t){return t===92||t===124?(e.consume(t),w):w(t)}}function Zde(e,t){let n=-1,r=!0,i=0,a=[0,0,0,0],o=[0,0,0,0],s=!1,c=0,l,u,d,f=new Kde;for(;++n<e.length;){let p=e[n],m=p[1];p[0]===`enter`?m.type===`tableHead`?(s=!1,c!==0&&(k0(f,t,c,l,u),u=void 0,c=0),l={type:`table`,start:Object.assign({},m.start),end:Object.assign({},m.end)},f.add(n,0,[[`enter`,l,t]])):m.type===`tableRow`||m.type===`tableDelimiterRow`?(r=!0,d=void 0,a=[0,0,0,0],o=[0,n+1,0,0],s&&(s=!1,u={type:`tableBody`,start:Object.assign({},m.start),end:Object.assign({},m.end)},f.add(n,0,[[`enter`,u,t]])),i=m.type===`tableDelimiterRow`?2:u?3:1):i&&(m.type===`data`||m.type===`tableDelimiterMarker`||m.type===`tableDelimiterFiller`)?(r=!1,o[2]===0&&(a[1]!==0&&(o[0]=o[1],d=O0(f,t,a,i,void 0,d),a=[0,0,0,0]),o[2]=n)):m.type===`tableCellDivider`&&(r?r=!1:(a[1]!==0&&(o[0]=o[1],d=O0(f,t,a,i,void 0,d)),a=o,o=[a[1],n,0,0])):m.type===`tableHead`?(s=!0,c=n):m.type===`tableRow`||m.type===`tableDelimiterRow`?(c=n,a[1]===0?o[1]!==0&&(d=O0(f,t,o,i,n,d)):(o[0]=o[1],d=O0(f,t,a,i,n,d)),i=0):i&&(m.type===`data`||m.type===`tableDelimiterMarker`||m.type===`tableDelimiterFiller`)&&(o[3]=n)}for(c!==0&&k0(f,t,c,l,u),f.consume(t.events),n=-1;++n<t.events.length;){let e=t.events[n];e[0]===`enter`&&e[1].type===`table`&&(e[1]._align=Jde(t.events,n))}return e}function O0(e,t,n,r,i,a){let o=r===1?`tableHeader`:r===2?`tableDelimiter`:`tableData`;n[0]!==0&&(a.end=Object.assign({},A0(t.events,n[0])),e.add(n[0],0,[[`exit`,a,t]]));let s=A0(t.events,n[1]);if(a={type:o,start:Object.assign({},s),end:Object.assign({},s)},e.add(n[1],0,[[`enter`,a,t]]),n[2]!==0){let i=A0(t.events,n[2]),a=A0(t.events,n[3]),o={type:`tableContent`,start:Object.assign({},i),end:Object.assign({},a)};if(e.add(n[2],0,[[`enter`,o,t]]),r!==2){let r=t.events[n[2]],i=t.events[n[3]];if(r[1].end=Object.assign({},i[1].end),r[1].type=`chunkText`,r[1].contentType=`text`,n[3]>n[2]+1){let t=n[2]+1,r=n[3]-n[2]-1;e.add(t,r,[])}}e.add(n[3]+1,0,[[`exit`,o,t]])}return i!==void 0&&(a.end=Object.assign({},A0(t.events,i)),e.add(i,0,[[`exit`,a,t]]),a=void 0),a}function k0(e,t,n,r,i){let a=[],o=A0(t.events,n);i&&(i.end=Object.assign({},o),a.push([`exit`,i,t])),r.end=Object.assign({},o),a.push([`exit`,r,t]),e.add(n+1,0,a)}function A0(e,t){let n=e[t],r=n[0]===`enter`?`start`:`end`;return n[1][r]}var Qde={name:`tasklistCheck`,tokenize:efe};function $de(){return{text:{91:Qde}}}function efe(e,t,n){let r=this;return i;function i(t){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(t):(e.enter(`taskListCheck`),e.enter(`taskListCheckMarker`),e.consume(t),e.exit(`taskListCheckMarker`),a)}function a(t){return OX(t)?(e.enter(`taskListCheckValueUnchecked`),e.consume(t),e.exit(`taskListCheckValueUnchecked`),o):t===88||t===120?(e.enter(`taskListCheckValueChecked`),e.consume(t),e.exit(`taskListCheckValueChecked`),o):n(t)}function o(t){return t===93?(e.enter(`taskListCheckMarker`),e.consume(t),e.exit(`taskListCheckMarker`),e.exit(`taskListCheck`),s):n(t)}function s(r){return DX(r)?t(r):kX(r)?e.check({tokenize:tfe},t,n)(r):n(r)}}function tfe(e,t,n){return PX(e,r,`whitespace`);function r(e){return e===null?n(e):t(e)}}function nfe(e){return hX([Dde(),Lde(),Gde(e),Yde(),$de()])}var rfe={};function j0(e){let t=this,n=e||rfe,r=t.data(),i=r.micromarkExtensions||=[],a=r.fromMarkdownExtensions||=[],o=r.toMarkdownExtensions||=[];i.push(nfe(n)),a.push(Cde()),o.push(wde(n))}var ife=n((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.BLANK_URL=e.relativeFirstCharacters=e.whitespaceEscapeCharsRegex=e.urlSchemeRegex=e.ctrlCharactersRegex=e.htmlCtrlEntityRegex=e.htmlEntitiesRegex=e.invalidProtocolRegex=void 0,e.invali
494dProtocolRegex=/^([^\w]*)(javascript|data|vbscript)/im,e.htmlEntitiesRegex=/&#(\w+)(^\w|;)?/g,e.htmlCtrlEntityRegex=/&(newline|tab);/gi,e.ctrlCharactersRegex=/[\u0000-\u001F\u007F-\u009F\u2000-\u200D\uFEFF]/gim,e.urlSchemeRegex=/^.+(:|&colon;)/gim,e.whitespaceEscapeCharsRegex=/(\\|%5[cC])((%(6[eE]|72|74))|[nrt])/g,e.relativeFirstCharacters=[`.`,`/`],e.BLANK_URL=`about:blank`})),afe=n((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.sanitizeUrl=o;var t=ife();function n(e){return t.relativeFirstCharacters.indexOf(e[0])>-1}function r(e){return e.replace(t.ctrlCharactersRegex,``).replace(t.htmlEntitiesRegex,function(e,t){return String.fromCharCode(t)})}function i(e){return URL.canParse(e)}function a(e){try{return decodeURIComponent(e)}catch{return e}}function o(e){if(!e)return t.BLANK_URL;var o,s=a(e.trim());do s=r(s).replace(t.htmlCtrlEntityRegex,``).replace(t.ctrlCharactersRegex,``).replace(t.whitespaceEscapeCharsRegex,``).trim(),s=a(s),o=s.match(t.ctrlCharactersRegex)||s.match(t.htmlEntitiesRegex)||s.match(t.htmlCtrlEntityRegex)||s.match(t.whitespaceEscapeCharsRegex);while(o&&o.length>0);var c=s;if(!c)return t.BLANK_URL;if(n(c))return c;var l=c.trimStart(),u=l.match(t.urlSchemeRegex);if(!u)return c;var d=u[0].toLowerCase().trim();if(t.invalidProtocolRegex.test(d))return t.BLANK_URL;var f=l.replace(/\\/g,`/`);if(d===`mailto:`||d.includes(`://`))return f;if(d===`http:`||d===`https:`){if(!i(f))return t.BLANK_URL;var p=new URL(f);return p.protocol=p.protocol.toLowerCase(),p.hostname=p.hostname.toLowerCase(),p.toString()}return f}})),ofe=n(((e,t)=>{(function(e,n){typeof define==`function`&&define.amd?define(n):t!==void 0&&t.exports?t.exports=n():window.ysFixWebmDuration=n()})(`fix-webm-duration`,function(){var e={172351395:{name:`EBML`,type:`Container`},646:{name:`EBMLVersion`,type:`Uint`},759:{name:`EBMLReadVersion`,type:`Uint`},754:{name:`EBMLMaxIDLength`,type:`Uint`},755:{name:`EBMLMaxSizeLength`,type:`Uint`},642:{name:`DocType`,type:`String`},647:{name:`DocTypeVersion`,type:`Uint`},645:{name:`DocTypeReadVersion`,type:`Uint`},108:{name:`Void`,type:`Binary`},63:{name:`CRC-32`,type:`Binary`},190023271:{name:`SignatureSlot`,type:`Container`},16010:{name:`SignatureAlgo`,type:`Uint`},16026:{name:`SignatureHash`,type:`Uint`},16037:{name:`SignaturePublicKey`,type:`Binary`},16053:{name:`Signature`,type:`Binary`},15963:{name:`SignatureElements`,type:`Container`},15995:{name:`SignatureElementList`,type:`Container`},9522:{name:`SignedElement`,type:`Binary`},139690087:{name:`Segment`,type:`Container`},21863284:{name:`SeekHead`,type:`Container`},3515:{name:`Seek`,type:`Container`},5035:{name:`SeekID`,type:`Binary`},5036:{name:`SeekPosition`,type:`Uint`},88713574:{name:`Info`,type:`Container`},13220:{name:`SegmentUID`,type:`Binary`},13188:{name:`SegmentFilename`,type:`String`},1882403:{name:`PrevUID`,type:`Binary`},1868715:{name:`PrevFilename`,type:`String`},2013475:{name:`NextUID`,type:`Binary`},1999803:{name:`NextFilename`,type:`String`},1092:{name:`SegmentFamily`,type:`Binary`},10532:{name:`ChapterTranslate`,type:`Container`},10748:{name:`ChapterTranslateEditionUID`,type:`Uint`},10687:{name:`ChapterTranslateCodec`,type:`Uint`},10661:{name:`ChapterTranslateID`,type:`Binary`},710577:{name:`TimecodeScale`,type:`Uint`},1161:{name:`Duration`,type:`Float`},1121:{name:`DateUTC`,type:`Date`},15273:{name:`Title`,type:`String`},3456:{name:`MuxingApp`,type:`String`},5953:{name:`WritingApp`,type:`String`},103:{name:`Timecode`,type:`Uint`},6228:{name:`SilentTracks`,type:`Container`},6359:{name:`SilentTrackNumber`,type:`Uint`},39:{name:`Position`,type:`Uint`},43:{name:`PrevSize`,type:`Uint`},35:{name:`SimpleBlock`,type:`Binary`},32:{name:`BlockGroup`,type:`Container`},33:{name:`Block`,type:`Binary`},34:{name:`BlockVirtual`,type:`Binary`},13729:{name:`BlockAdditions`,type:`Container`},38:{name:`BlockMore`,type:`Container`},110:{name:`BlockAddID`,type:`Uint`},37:{name:`BlockAdditional`,type:`Binary`},27:{name:`BlockDuration`,type:`Uint`},122:{name:`ReferencePriority`,type:`Uint`},123:{name:`ReferenceBlock`,type:`Int`},125:{name:`ReferenceVirtual`,type:`Int`},36:{name:`CodecState`,type:`Binary`},13730:{name:`DiscardPadding`,type:`Int`},14:{name:`Slices`,type:`Container`},104:{name:`TimeSlice`,type:`Container`},76:{name:`LaceNumber`,type:`Uint`},77:{name:`FrameNumber`,type:`Uint`},75:{name:`BlockAdditionID`,type:`Uint`},78:{name:`Delay`,type:`Uint`},79:{name:`SliceDuration`,type:`Uint`},72:{name:`ReferenceFrame`,type:`Container`},73:{name:`ReferenceOffset`,type:`Uint`},74:{name:`ReferenceTimeCode`,type:`Uint`},47:{name:`EncryptedBlock`,type:`Binary`},106212971:{name:`Tracks`,type:`Container`},46:{name:`TrackEntry`,type:`Container`},87:{name:`TrackNumber`,type:`Uint`},13253:{name:`TrackUID`,type:`Uint`},3:{name:`TrackType`,type:`Uint`},57:{name:`FlagEnabled`,type:`Uint`},8:{name:`FlagDefault`,type:`Uint`},5546:{name:`FlagForced`,type:`Uint`},28:{name:`FlagLacing`,type:`Uint`},11751:{name:`MinCache`,type:`Uint`},11768:{name:`MaxCache`,type:`Uint`},254851:{name:`DefaultDuration`,type:`Uint`},216698:{name:`DefaultDecodedFieldDuration`,type:`Uint`}
494,209231:{name:`TrackTimecodeScale`,type:`Float`},4991:{name:`TrackOffset`,type:`Int`},5614:{name:`MaxBlockAdditionID`,type:`Uint`},4974:{name:`Name`,type:`String`},177564:{name:`Language`,type:`String`},6:{name:`CodecID`,type:`String`},9122:{name:`CodecPrivate`,type:`Binary`},362120:{name:`CodecName`,type:`String`},13382:{name:`AttachmentLink`,type:`Uint`},1742487:{name:`CodecSettings`,type:`String`},1785920:{name:`CodecInfoURL`,type:`String`},438848:{name:`CodecDownloadURL`,type:`String`},42:{name:`CodecDecodeAll`,type:`Uint`},12203:{name:`TrackOverlay`,type:`Uint`},5802:{name:`CodecDelay`,type:`Uint`},5819:{name:`SeekPreRoll`,type:`Uint`},9764:{name:`TrackTranslate`,type:`Container`},9980:{name:`TrackTranslateEditionUID`,type:`Uint`},9919:{name:`TrackTranslateCodec`,type:`Uint`},9893:{name:`TrackTranslateTrackID`,type:`Binary`},96:{name:`Video`,type:`Container`},26:{name:`FlagInterlaced`,type:`Uint`},5048:{name:`StereoMode`,type:`Uint`},5056:{name:`AlphaMode`,type:`Uint`},5049:{name:`OldStereoMode`,type:`Uint`},48:{name:`PixelWidth`,type:`Uint`},58:{name:`PixelHeight`,type:`Uint`},5290:{name:`PixelCropBottom`,type:`Uint`},5307:{name:`PixelCropTop`,type:`Uint`},5324:{name:`PixelCropLeft`,type:`Uint`},5341:{name:`PixelCropRight`,type:`Uint`},5296:{name:`DisplayWidth`,type:`Uint`},5306:{name:`DisplayHeight`,type:`Uint`},5298:{name:`DisplayUnit`,type:`Uint`},5299:{name:`AspectRatioType`,type:`Uint`},963876:{name:`ColourSpace`,type:`Binary`},1029411:{name:`GammaValue`,type:`Float`},230371:{name:`FrameRate`,type:`Float`},97:{name:`Audio`,type:`Container`},53:{name:`SamplingFrequency`,type:`Float`},14517:{name:`OutputSamplingFrequency`,type:`Float`},31:{name:`Channels`,type:`Uint`},15739:{name:`ChannelPositions`,type:`Binary`},8804:{name:`BitDepth`,type:`Uint`},98:{name:`TrackOperation`,type:`Container`},99:{name:`TrackCombinePlanes`,type:`Container`},100:{name:`TrackPlane`,type:`Container`},101:{name:`TrackPlaneUID`,type:`Uint`},102:{name:`TrackPlaneType`,type:`Uint`},105:{name:`TrackJoinBlocks`,type:`Container`},109:{name:`TrackJoinUID`,type:`Uint`},64:{name:`TrickTrackUID`,type:`Uint`},65:{name:`TrickTrackSegmentUID`,type:`Binary`},70:{name:`TrickTrackFlag`,type:`Uint`},71:{name:`TrickMasterTrackUID`,type:`Uint`},68:{name:`TrickMasterTrackSegmentUID`,type:`Binary`},11648:{name:`ContentEncodings`,type:`Container`},8768:{name:`ContentEncoding`,type:`Container`},4145:{name:`ContentEncodingOrder`,type:`Uint`},4146:{name:`ContentEncodingScope`,type:`Uint`},4147:{name:`ContentEncodingType`,type:`Uint`},4148:{name:`ContentCompression`,type:`Container`},596:{name:`ContentCompAlgo`,type:`Uint`},597:{name:`ContentCompSettings`,type:`Binary`},4149:{name:`ContentEncryption`,type:`Container`},2017:{name:`ContentEncAlgo`,type:`Uint`},2018:{name:`ContentEncKeyID`,type:`Binary`},2019:{name:`ContentSignature`,type:`Binary`},2020:{name:`ContentSigKeyID`,type:`Binary`},2021:{name:`ContentSigAlgo`,type:`Uint`},2022:{name:`ContentSigHashAlgo`,type:`Uint`},206814059:{name:`Cues`,type:`Container`},59:{name:`CuePoint`,type:`Container`},51:{name:`CueTime`,type:`Uint`},55:{name:`CueTrackPositions`,type:`Container`},119:{name:`CueTrack`,type:`Uint`},113:{name:`CueClusterPosition`,type:`Uint`},112:{name:`CueRelativePosition`,type:`Uint`},50:{name:`CueDuration`,type:`Uint`},4984:{name:`CueBlockNumber`,type:`Uint`},106:{name:`CueCodecState`,type:`Uint`},91:{name:`CueReference`,type:`Container`},22:{name:`CueRefTime`,type:`Uint`},23:{name:`CueRefCluster`,type:`Uint`},4959:{name:`CueRefNumber`,type:`Uint`},107:{name:`CueRefCodecState`,type:`Uint`},155296873:{name:`Attachments`,type:`Container`},8615:{name:`AttachedFile`,type:`Container`},1662:{name:`FileDescription`,type:`String`},1646:{name:`FileName`,type:`String`},1632:{name:`FileMimeType`,type:`String`},1628:{name:`FileData`,type:`Binary`},1710:{name:`FileUID`,type:`Uint`},1653:{name:`FileReferral`,type:`Binary`},1633:{name:`FileUsedStartTime`,type:`Uint`},1634:{name:`FileUsedEndTime`,type:`Uint`},4433776:{name:`Chapters`,type:`Container`},1465:{name:`EditionEntry`,type:`Container`},1468:{name:`EditionUID`,type:`Uint`},1469:{name:`EditionFlagHidden`,type:`Uint`},1499:{name:`EditionFlagDefault`,type:`Uint`},1501:{name:`EditionFlagOrdered`,type:`Uint`},54:{name:`ChapterAtom`,type:`Container`},13252:{name:`ChapterUID`,type:`Uint`},5716:{name:`ChapterStringUID`,type:`String`}
494,17:{name:`ChapterTimeStart`,type:`Uint`},18:{name:`ChapterTimeEnd`,type:`Uint`},24:{name:`ChapterFlagHidden`,type:`Uint`},1432:{name:`ChapterFlagEnabled`,type:`Uint`},11879:{name:`ChapterSegmentUID`,type:`Binary`},11964:{name:`ChapterSegmentEditionUID`,type:`Uint`},9155:{name:`ChapterPhysicalEquiv`,type:`Uint`},15:{name:`ChapterTrack`,type:`Container`},9:{name:`ChapterTrackNumber`,type:`Uint`},0:{name:`ChapterDisplay`,type:`Container`},5:{name:`ChapString`,type:`String`},892:{name:`ChapLanguage`,type:`String`},894:{name:`ChapCountry`,type:`String`},10564:{name:`ChapProcess`,type:`Container`},10581:{name:`ChapProcessCodecID`,type:`Uint`},1293:{name:`ChapProcessPrivate`,type:`Binary`},10513:{name:`ChapProcessCommand`,type:`Container`},10530:{name:`ChapProcessTime`,type:`Uint`},10547:{name:`ChapProcessData`,type:`Binary`},39109479:{name:`Tags`,type:`Container`},13171:{name:`Tag`,type:`Container`},9152:{name:`Targets`,type:`Container`},10442:{name:`TargetTypeValue`,type:`Uint`},9162:{name:`TargetType`,type:`String`},9157:{name:`TagTrackUID`,type:`Uint`},9161:{name:`TagEditionUID`,type:`Uint`},9156:{name:`TagChapterUID`,type:`Uint`},9158:{name:`TagAttachmentUID`,type:`Uint`},10184:{name:`SimpleTag`,type:`Container`},1443:{name:`TagName`,type:`String`},1146:{name:`TagLanguage`,type:`String`},1156:{name:`TagDefault`,type:`Uint`},1159:{name:`TagString`,type:`String`},1157:{name:`TagBinary`,type:`Binary`}};function t(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e}function n(e,t){this.name=e||`Unknown`,this.type=t||`Unknown`}n.prototype.updateBySource=function(){},n.prototype.setSource=function(e){this.source=e,this.updateBySource()},n.prototype.updateByData=function(){},n.prototype.setData=function(e){this.data=e,this.updateByData()};function r(e,t){n.call(this,e,t||`Uint`)}t(r,n);function i(e){return e.length%2==1?`0`+e:e}r.prototype.updateBySource=function(){this.data=``;for(var e=0;e<this.source.length;e++){var t=this.source[e].toString(16);this.data+=i(t)}},r.prototype.updateByData=function(){var e=this.data.length/2;this.source=new Uint8Array(e);for(var t=0;t<e;t++){var n=this.data.substr(t*2,2);this.source[t]=parseInt(n,16)}},r.prototype.getValue=function(){return parseInt(this.data,16)},r.prototype.setValue=function(e){this.setData(i(e.toString(16)))};function a(e,t){n.call(this,e,t||`Float`)}t(a,n),a.prototype.getFloatArrayType=function(){return this.source&&this.source.length===4?Float32Array:Float64Array},a.prototype.updateBySource=function(){var e=this.source.reverse(),t=new(this.getFloatArrayType())(e.buffer);this.data=t[0]},a.prototype.updateByData=function(){var e=new(this.getFloatArrayType())([this.data]),t=new Uint8Array(e.buffer);this.source=t.reverse()},a.prototype.getValue=function(){return this.data},a.prototype.setValue=function(e){this.setData(e)};function o(e,t){n.call(this,e,t||`Container`)}t(o,n),o.prototype.readByte=function(){return this.source[this.offset++]},o.prototype.readUint=function(){for(var e=this.readByte(),t=8-e.toString(2).length,n=e-(1<<7-t),r=0;r<t;r++)n*=256,n+=this.readByte();return n},o.prototype.updateBySource=function(){for(this.data=[],this.offset=0;this.offset<this.source.length;this.offset=s){var t=this.readUint(),i=this.readUint(),s=Math.min(this.offset+i,this.source.length),c=this.source.slice(this.offset,s),l=e[t]||{name:`Unknown`,type:`Unknown`},u=n;switch(l.type){case`Container`:u=o;break;case`Uint`:u=r;break;case`Float`:u=a;break}var d=new u(l.name,l.type);d.setSource(c),this.data.push({id:t,idHex:t.toString(16),data:d})}},o.prototype.writeUint=function(e,t){for(var n=1,r=128;e>=r&&n<8;n++,r*=128);if(!t)for(var i=r+e,a=n-1;a>=0;a--){var o=i%256;this.source[this.offset+a]=o,i=(i-o)/256}this.offset+=n},o.prototype.writeSections=function(e){this.offset=0;for(var t=0;t<this.data.length;t++){var n=this.data[t],r=n.data.source,i=r.length;this.writeUint(n.id,e),this.writeUint(i,e),e||this.source.set(r,this.offset),this.offset+=i}return this.offset},o.prototype.updateByData=function(){var e=this.writeSections(`draft`);this.source=new Uint8Array(e),this.writeSections()},o.prototype.getSectionById=function(e){for(var t=0;t<this.data.length;t++){var n=this.data[t];if(n.id===e)return n.data}return null};
494function s(e){o.call(this,`File`,`File`),this.setSource(e)}t(s,o),s.prototype.fixDuration=function(e,t){var n=t&&t.logger;n===void 0?n=function(e){console.log(e)}:n||=function(){};var r=this.getSectionById(139690087);if(!r)return n(`[fix-webm-duration] Segment section is missing`),!1;var i=r.getSectionById(88713574);if(!i)return n(`[fix-webm-duration] Info section is missing`),!1;var o=i.getSectionById(710577);if(!o)return n(`[fix-webm-duration] TimecodeScale section is missing`),!1;var s=i.getSectionById(1161);if(s)if(s.getValue()<=0)n(`[fix-webm-duration] Duration section is present, but the value is ${s.getValue()}`),s.setValue(e);else return n(`[fix-webm-duration] Duration section is present, and the value is ${s.getValue()}`),!1;else n(`[fix-webm-duration] Duration section is missing`),s=new a(`Duration`,`Float`),s.setValue(e),i.data.push({id:1161,data:s});return o.setValue(1e6),i.updateByData(),r.updateByData(),this.updateByData(),!0},s.prototype.toBlob=function(e){return new Blob([this.source.buffer],{type:e||`video/webm`})};function c(e,t,n,r){if(typeof n==`object`&&(r=n,n=void 0),!n)return new Promise(function(n){c(e,t,n,r)});try{var i=new FileReader;i.onloadend=function(){try{var a=new s(new Uint8Array(i.result));a.fixDuration(t,r)&&(e=a.toBlob(e.type))}catch{}n(e)},i.readAsArrayBuffer(e)}catch{n(e)}}return c.default=c,c})})),sfe=n(((e,t)=>{var n=200,r=`__lodash_hash_undefined__`,i=800,a=16,o=9007199254740991,s=`[object Arguments]`,c=`[object Array]`,l=`[object AsyncFunction]`,u=`[object Boolean]`,d=`[object Date]`,f=`[object Error]`,p=`[object Function]`,m=`[object GeneratorFunction]`,h=`[object Map]`,g=`[object Number]`,_=`[object Null]`,v=`[object Object]`,y=`[object Proxy]`,b=`[object RegExp]`,x=`[object Set]`,S=`[object String]`,C=`[object Undefined]`,w=`[object WeakMap]`,T=`[object ArrayBuffer]`,E=`[object DataView]`,D=`[object Float32Array]`,O=`[object Float64Array]`,k=`[object Int8Array]`,A=`[object Int16Array]`,j=`[object Int32Array]`,M=`[object Uint8Array]`,N=`[object Uint8ClampedArray]`,P=`[object Uint16Array]`,ee=`[object Uint32Array]`,F=/[\\^$.*+?()[\]{}|]/g,te=/^\[object .+?Constructor\]$/,ne=/^(?:0|[1-9]\d*)$/,re={};re[D]=re[O]=re[k]=re[A]=re[j]=re[M]=re[N]=re[P]=re[ee]=!0,re[s]=re[c]=re[T]=re[u]=re[E]=re[d]=re[f]=re[p]=re[h]=re[g]=re[v]=re[b]=re[x]=re[S]=re[w]=!1;var I=typeof global==`object`&&global&&global.Object===Object&&global,ie=typeof self==`object`&&self&&self.Object===Object&&self,ae=I||ie||Function(`return this`)(),oe=typeof e==`object`&&e&&!e.nodeType&&e,L=oe&&typeof t==`object`&&t&&!t.nodeType&&t,se=L&&L.exports===oe,ce=se&&I.process,le=function(){try{return L&&L.require&&L.require(`util`).types||ce&&ce.binding&&ce.binding(`util`)}catch{}}(),ue=le&&le.isTypedArray;function de(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}function fe(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}function pe(e){return function(t){return e(t)}}function me(e,t){return e?.[t]}function he(e,t){return function(n){return e(t(n))}}var ge=Array.prototype,_e=Function.prototype,ve=Object.prototype,ye=ae[`__core-js_shared__`],be=_e.toString,xe=ve.hasOwnProperty,Se=function(){var e=/[^.]+$/.exec(ye&&ye.keys&&ye.keys.IE_PROTO||``);return e?`Symbol(src)_1.`+e:``}(),Ce=ve.toString,we=be.call(Object),Te=RegExp(`^`+be.call(xe).replace(F,`\\$&`).replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,`$1.*?`)+`$`),Ee=se?ae.Buffer:void 0,De=ae.Symbol,Oe=ae.Uint8Array,ke=Ee?Ee.allocUnsafe:void 0,Ae=he(Object.getPrototypeOf,Object),je=Object.create,Me=ve.propertyIsEnumerable,Ne=ge.splice,Pe=De?De.toStringTag:void 0,Fe=function(){try{var e=Ft(Object,`defineProperty`);return e({},``,{}),e}catch{}}(),Ie=Ee?Ee.isBuffer:void 0,Le=Math.max,Re=Date.now,ze=Ft(ae,`Map`),Be=Ft(Object,`create`),Ve=function(){function e(){}return function(t){if(!an(t))return{};if(je)return je(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();function He(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Ue(){this.__data__=Be?Be(null):{},this.size=0}function We(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=+!!t,t}function Ge(e){var t=this.__data__;if(Be){var n=t[e];return n===r?void 0:n}return xe.call(t,e)?t[e]:void 0}function Ke(e){var t=this.__data__;return Be?t[e]!==void 0:xe.call(t,e)}function qe(e,t){var n=this.__data__;return this.size+=+!this.has(e),n[e]=Be&&t===void 0?r:t,this}He.prototype.clear=Ue,He.prototype.delete=We,He.prototype.get=Ge,He.prototype.has=Ke,He.prototype.set=qe;function Je(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Ye(){this.__data__=[],this.size=0}function Xe(e){var t=this.__data__,n=ht(t,e);return n<0?!1:(n==t.length-1?t.pop():Ne.call(t,n,1),--this.size,!0)}function Ze(e){var t=this.__data__,n=ht(t,e);return n<0?void 0:t[n][1]}function Qe(e){return ht(this.__data__,e)>-1}function $e(e,t){var n=this.__data__,r=ht(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}Je.prototype.clear=Ye,Je.prototype.delete=Xe,Je.prototype.get=Ze,Je.prototype.has=Qe,Je.prototype.set=$e;function et(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function tt(){this.size=0,this.__data__={hash:new He,map:new(ze||Je),string:new He}}function nt(e){var t=Pt(this,e).delete(e);return this.size-=+!!t,t}function rt(e){return Pt(this,e).get(e)}function it(e){return Pt(this,e).has(e)}function at(e,t){var n=Pt(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this}et.prototype.clear=tt,et.prototype.delete=nt,et.prototype.get=rt,et.prototype.has=it,et.prototype.set=at;function ot(e){var t=this.__data__=new Je(e);this.size=t.size}function st(){this.__data__=new Je,this.size=0}function ct(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}function lt(e){return this.__data__.get(e)}function ut(e){return this.__data__.has(e)}function dt(e,t){var r=this.__data__;if(r instanceof Je){var i=r.__data__;if(!ze||i.length<n-1)return i.push([e,t]),this.size=++r.size,this;r=this.__data__=new et(i)}return r.set(e,t),this.size=r.size,this}ot.prototype.clear=st,ot.prototype.delete=ct,ot.prototype.get=lt,ot.prototype.has=ut,ot.prototype.set=dt;function ft(e,t){var n=Qt(e),r=!n&&Zt(e),i=!n&&!r&&tn(e),a=!n&&!r&&!i&&cn(e),o=n||r||i||a,s=o?fe(e.length,String):[],c=s.length;
vendor: 4,591 bytes, line 494
494for(var l in e)(t||xe.call(e,l))&&!(o&&(l==`length`||i&&(l==`offset`||l==`parent`)||a&&(l==`buffer`||l==`byteLength`||l==`byteOffset`)||Rt(l,c)))&&s.push(l);return s}function pt(e,t,n){(n!==void 0&&!Xt(e[t],n)||n===void 0&&!(t in e))&&gt(e,t,n)}function mt(e,t,n){var r=e[t];(!(xe.call(e,t)&&Xt(r,n))||n===void 0&&!(t in e))&&gt(e,t,n)}function ht(e,t){for(var n=e.length;n--;)if(Xt(e[n][0],t))return n;return-1}function gt(e,t,n){t==`__proto__`&&Fe?Fe(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}var _t=Nt();function vt(e){return e==null?e===void 0?C:_:Pe&&Pe in Object(e)?It(e):Wt(e)}function yt(e){return on(e)&&vt(e)==s}function bt(e){return!an(e)||Vt(e)?!1:(nn(e)?Te:te).test(Yt(e))}function xt(e){return on(e)&&rn(e.length)&&!!re[vt(e)]}function St(e){if(!an(e))return Ut(e);var t=Ht(e),n=[];for(var r in e)r==`constructor`&&(t||!xe.call(e,r))||n.push(r);return n}function Ct(e,t,n,r,i){e!==t&&_t(t,function(a,o){if(i||=new ot,an(a))wt(e,t,o,n,Ct,r,i);else{var s=r?r(Kt(e,o),a,o+``,e,t,i):void 0;s===void 0&&(s=a),pt(e,o,s)}},un)}function wt(e,t,n,r,i,a,o){var s=Kt(e,n),c=Kt(t,n),l=o.get(c);if(l){pt(e,n,l);return}var u=a?a(s,c,n+``,e,t,o):void 0,d=u===void 0;if(d){var f=Qt(c),p=!f&&tn(c),m=!f&&!p&&cn(c);u=c,f||p||m?Qt(s)?u=s:en(s)?u=At(s):p?(d=!1,u=Dt(c,!0)):m?(d=!1,u=kt(c,!0)):u=[]:sn(c)||Zt(c)?(u=s,Zt(s)?u=ln(s):(!an(s)||nn(s))&&(u=Lt(c))):d=!1}d&&(o.set(c,u),i(u,c,r,a,o),o.delete(c)),pt(e,n,u)}function Tt(e,t){return qt(Gt(e,t,pn),e+``)}var Et=Fe?function(e,t){return Fe(e,`toString`,{configurable:!0,enumerable:!1,value:fn(t),writable:!0})}:pn;function Dt(e,t){if(t)return e.slice();var n=e.length,r=ke?ke(n):new e.constructor(n);return e.copy(r),r}function Ot(e){var t=new e.constructor(e.byteLength);return new Oe(t).set(new Oe(e)),t}function kt(e,t){var n=t?Ot(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}function At(e,t){var n=-1,r=e.length;for(t||=Array(r);++n<r;)t[n]=e[n];return t}function jt(e,t,n,r){var i=!n;n||={};for(var a=-1,o=t.length;++a<o;){var s=t[a],c=r?r(n[s],e[s],s,n,e):void 0;c===void 0&&(c=e[s]),i?gt(n,s,c):mt(n,s,c)}return n}function Mt(e){return Tt(function(t,n){var r=-1,i=n.length,a=i>1?n[i-1]:void 0,o=i>2?n[2]:void 0;for(a=e.length>3&&typeof a==`function`?(i--,a):void 0,o&&zt(n[0],n[1],o)&&(a=i<3?void 0:a,i=1),t=Object(t);++r<i;){var s=n[r];s&&e(t,s,r,a)}return t})}function Nt(e){return function(t,n,r){for(var i=-1,a=Object(t),o=r(t),s=o.length;s--;){var c=o[e?s:++i];if(n(a[c],c,a)===!1)break}return t}}function Pt(e,t){var n=e.__data__;return Bt(t)?n[typeof t==`string`?`string`:`hash`]:n.map}function Ft(e,t){var n=me(e,t);return bt(n)?n:void 0}function It(e){var t=xe.call(e,Pe),n=e[Pe];try{e[Pe]=void 0;var r=!0}catch{}var i=Ce.call(e);return r&&(t?e[Pe]=n:delete e[Pe]),i}function Lt(e){return typeof e.constructor==`function`&&!Ht(e)?Ve(Ae(e)):{}}function Rt(e,t){var n=typeof e;return t??=o,!!t&&(n==`number`||n!=`symbol`&&ne.test(e))&&e>-1&&e%1==0&&e<t}function zt(e,t,n){if(!an(n))return!1;var r=typeof t;return(r==`number`?$t(n)&&Rt(t,n.length):r==`string`&&t in n)?Xt(n[t],e):!1}function Bt(e){var t=typeof e;return t==`string`||t==`number`||t==`symbol`||t==`boolean`?e!==`__proto__`:e===null}function Vt(e){return!!Se&&Se in e}function Ht(e){var t=e&&e.constructor;return e===(typeof t==`function`&&t.prototype||ve)}function Ut(e){var t=[];if(e!=null)for(var n in Object(e))t.push(n);return t}function Wt(e){return Ce.call(e)}function Gt(e,t,n){return t=Le(t===void 0?e.length-1:t,0),function(){for(var r=arguments,i=-1,a=Le(r.length-t,0),o=Array(a);++i<a;)o[i]=r[t+i];i=-1;for(var s=Array(t+1);++i<t;)s[i]=r[i];return s[t]=n(o),de(e,this,s)}}function Kt(e,t){if(!(t===`constructor`&&typeof e[t]==`function`)&&t!=`__proto__`)return e[t]}var qt=Jt(Et);function Jt(e){var t=0,n=0;return function(){var r=Re(),o=a-(r-n);if(n=r,o>0){if(++t>=i)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}function Yt(e){if(e!=null){try{return be.call(e)}catch{}try{return e+``}catch{}}return``}function Xt(e,t){return e===t||e!==e&&t!==t}var Zt=yt(function(){return arguments}())?yt:function(e){return on(e)&&xe.call(e,`callee`)&&!Me.call(e,`callee`)},Qt=Array.isArray;function $t(e){return e!=null&&rn(e.length)&&!nn(e)}function en(e){return on(e)&&$t(e)}var tn=Ie||mn;function nn(e){if(!an(e))return!1;var t=vt(e);return t==p||t==m||t==l||t==y}function rn(e){return typeof e==`number`&&e>-1&&e%1==0&&e<=o}function an(e){var t=typeof e;return e!=null&&(t==`object`||t==`function`)}function on(e){return typeof e==`object`&&!!e}function sn(e){if(!on(e)||vt(e)!=v)return!1;var t=Ae(e);
494if(t===null)return!0;var n=xe.call(t,`constructor`)&&t.constructor;return typeof n==`function`&&n instanceof n&&be.call(n)==we}var cn=ue?pe(ue):xt;function ln(e){return jt(e,un(e))}function un(e){return $t(e)?ft(e,!0):St(e)}var dn=Mt(function(e,t,n,r){Ct(e,t,n,r)});function fn(e){return function(){return e}}function pn(e){return e}function mn(){return!1}t.exports=dn})),cfe=n(((e,t)=>{var n=200,r=`Expected a function`,i=`__lodash_hash_undefined__`,a=1,o=2,s=1/0,c=9007199254740991,l=`[object Arguments]`,u=`[object Array]`,d=`[object Boolean]`,f=`[object Date]`,p=`[object Error]`,m=`[object Function]`,h=`[object GeneratorFunction]`,g=`[object Map]`,_=`[object Number]`,v=`[object Object]`,y=`[object Promise]`,b=`[object RegExp]`,x=`[object Set]`,S=`[object String]`,C=`[object Symbol]`,w=`[object WeakMap]`,T=`[object ArrayBuffer]`,E=`[object DataView]`,D=`[object Float32Array]`,O=`[object Float64Array]`,k=`[object Int8Array]`,A=`[object Int16Array]`,j=`[object Int32Array]`,M=`[object Uint8Array]`,N=`[object Uint8ClampedArray]`,P=`[object Uint16Array]`,ee=`[object Uint32Array]`,F=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,te=/^\w*$/,ne=/^\./,re=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,I=/[\\^$.*+?()[\]{}|]/g,ie=/\\(\\)?/g,ae=/^\[object .+?Constructor\]$/,oe=/^(?:0|[1-9]\d*)$/,L={};L[D]=L[O]=L[k]=L[A]=L[j]=L[M]=L[N]=L[P]=L[ee]=!0,L[l]=L[u]=L[T]=L[d]=L[E]=L[f]=L[p]=L[m]=L[g]=L[_]=L[v]=L[b]=L[x]=L[S]=L[w]=!1;var se=typeof global==`object`&&global&&global.Object===Object&&global,ce=typeof self==`object`&&self&&self.Object===Object&&self,le=se||ce||Function(`return this`)(),ue=typeof e==`object`&&e&&!e.nodeType&&e,de=ue&&typeof t==`object`&&t&&!t.nodeType&&t,fe=de&&de.exports===ue&&se.process,pe=function(){try{return fe&&fe.binding(`util`)}catch{}}(),me=pe&&pe.isTypedArray;function he(e,t){return!!(e&&e.length)&&ye(e,t,0)>-1}function ge(e,t,n){for(var r=-1,i=e?e.length:0;++r<i;)if(n(t,e[r]))return!0;return!1}function _e(e,t){for(var n=-1,r=e?e.length:0;++n<r;)if(t(e[n],n,e))return!0;return!1}function ve(e,t,n,r){for(var i=e.length,a=n+(r?1:-1);r?a--:++a<i;)if(t(e[a],a,e))return a;return-1}function ye(e,t,n){if(t!==t)return ve(e,be,n);for(var r=n-1,i=e.length;++r<i;)if(e[r]===t)return r;return-1}function be(e){return e!==e}function xe(e){return function(t){return t?.[e]}}function Se(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}function Ce(e){return function(t){return e(t)}}function we(e,t){return e.has(t)}function Te(e,t){return e?.[t]}function Ee(e){var t=!1;if(e!=null&&typeof e.toString!=`function`)try{t=!!(e+``)}catch{}return t}function De(e){var t=-1,n=Array(e.size);return e.forEach(function(e,r){n[++t]=[r,e]}),n}function Oe(e,t){return function(n){return e(t(n))}}function ke(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=e}),n}var Ae=Array.prototype,je=Function.prototype,Me=Object.prototype,Ne=le[`__core-js_shared__`],Pe=function(){var e=/[^.]+$/.exec(Ne&&Ne.keys&&Ne.keys.IE_PROTO||``);return e?`Symbol(src)_1.`+e:``}(),Fe=je.toString,Ie=Me.hasOwnProperty,Le=Me.toString,Re=RegExp(`^`+Fe.call(Ie).replace(I,`\\$&`).replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,`$1.*?`)+`$`),ze=le.Symbol,Be=le.Uint8Array,Ve=Me.propertyIsEnumerable,He=Ae.splice,Ue=Oe(Object.keys,Object),We=tn(le,`DataView`),Ge=tn(le,`Map`),Ke=tn(le,`Promise`),qe=tn(le,`Set`),Je=tn(le,`WeakMap`),Ye=tn(Object,`create`),Xe=mn(We),Ze=mn(Ge),Qe=mn(Ke),$e=mn(qe),et=mn(Je),tt=ze?ze.prototype:void 0,nt=tt?tt.valueOf:void 0,rt=tt?tt.toString:void 0;function it(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function at(){this.__data__=Ye?Ye(null):{}}function ot(e){return this.has(e)&&delete this.__data__[e]}function st(e){var t=this.__data__;if(Ye){var n=t[e];return n===i?void 0:n}return Ie.call(t,e)?t[e]:void 0}function ct(e){var t=this.__data__;return Ye?t[e]!==void 0:Ie.call(t,e)}function lt(e,t){var n=this.__data__;return n[e]=Ye&&t===void 0?i:t,this}it.prototype.clear=at,it.prototype.delete=ot,it.prototype.get=st,it.prototype.has=ct,it.prototype.set=lt;function ut(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function dt(){this.__data__=[]}function ft(e){var t=this.__data__,n=Mt(t,e);return n<0?!1:(n==t.length-1?t.pop():He.call(t,n,1),!0)}function pt(e){var t=this.__data__,n=Mt(t,e);return n<0?void 0:t[n][1]}function mt(e){return Mt(this.__data__,e)>-1}function ht(e,t){var n=this.__data__,r=Mt(n,e);return r<0?n.push([e,t]):n[r][1]=t,this}ut.prototype.clear=dt,ut.prototype.delete=ft,ut.prototype.get=pt,ut.prototype.has=mt,ut.prototype.set=ht;function gt(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function _t(){this.__data__={hash:new it,map:new(Ge||ut),string:new it}}function vt(e){return $t(this,e).delete(e)}function yt(e){return $t(this,e).get(e)}function bt(e){return $t(this,e).has(e)}function xt(e,t){return $t(this,e).set(e,t),this}gt.prototype.clear=_t,gt.prototype.delete=vt,gt.prototype.get=yt,gt.prototype.has=bt,gt.prototype.set=xt;function St(e){var t=-1,n=e?e.length:0;for(this.__data__=new gt;++t<n;)this.add(e[t])}function Ct(e){return this.__data__.set(e,i),this}function wt(e){return this.__data__.has(e)}St.prototype.add=St.prototype.push=Ct,St.prototype.has=wt;function Tt(e){this.__data__=new ut(e)}function Et(){this.__data__=new ut}function Dt(e){return this.__data__.delete(e)}function Ot(e){return this.__data__.get(e)}function kt(e){return this.__data__.has(e)}function At(e,t){var r=this.__data__;if(r instanceof ut){var i=r.__data__;if(!Ge||i.length<n-1)return i.push([e,t]),this;r=this.__data__=new gt(i)}return r.set(e,t),this}Tt.prototype.clear=Et,Tt.prototype.delete=Dt,Tt.prototype.get=Ot,Tt.prototype.has=kt,Tt.prototype.set=At;function jt(e,t){var n=yn(e)||vn(e)?Se(e.length,String):[],r=n.length,i=!!r;for(var a in e)(t||Ie.call(e,a))&&!(i&&(a==`length`||an(a,r)))&&n.push(a);return n}function Mt(e,t){for(var n=e.length;n--;)if(_n(e[n][0],t))return n;return-1}function Nt(e,t){t=on(t,e)?[t]:Jt(t);for(var n=0,r=t.length;e!=null&&n<r;)e=e[pn(t[n++])];return n&&n==r?e:void 0}function Pt(e){return Le.call(e)}function Ft(e,t){return e!=null&&t in Object(e)}function It(e,t,n,r,i){return e===t?!0:e==null||t==null||!wn(e)&&!Tn(t)?e!==e&&t!==t:Lt(e,t,It,n,r,i)}function Lt(e,t,n,r,i,a){var s=yn(e),c=yn(t),d=u,f=u;
494s||(d=nn(e),d=d==l?v:d),c||(f=nn(t),f=f==l?v:f);var p=d==v&&!Ee(e),m=f==v&&!Ee(t),h=d==f;if(h&&!p)return a||=new Tt,s||Dn(e)?Xt(e,t,n,r,i,a):Zt(e,t,d,n,r,i,a);if(!(i&o)){var g=p&&Ie.call(e,`__wrapped__`),_=m&&Ie.call(t,`__wrapped__`);if(g||_){var y=g?e.value():e,b=_?t.value():t;return a||=new Tt,n(y,b,r,i,a)}}return h?(a||=new Tt,Qt(e,t,n,r,i,a)):!1}function Rt(e,t,n,r){var i=n.length,s=i,c=!r;if(e==null)return!s;for(e=Object(e);i--;){var l=n[i];if(c&&l[2]?l[1]!==e[l[0]]:!(l[0]in e))return!1}for(;++i<s;){l=n[i];var u=l[0],d=e[u],f=l[1];if(c&&l[2]){if(d===void 0&&!(u in e))return!1}else{var p=new Tt;if(r)var m=r(d,f,u,e,t,p);if(!(m===void 0?It(f,d,r,a|o,p):m))return!1}}return!0}function zt(e){return!wn(e)||cn(e)?!1:(Sn(e)||Ee(e)?Re:ae).test(mn(e))}function Bt(e){return Tn(e)&&Cn(e.length)&&!!L[Le.call(e)]}function Vt(e){return typeof e==`function`?e:e==null?Mn:typeof e==`object`?yn(e)?Wt(e[0],e[1]):Ut(e):Pn(e)}function Ht(e){if(!ln(e))return Ue(e);var t=[];for(var n in Object(e))Ie.call(e,n)&&n!=`constructor`&&t.push(n);return t}function Ut(e){var t=en(e);return t.length==1&&t[0][2]?dn(t[0][0],t[0][1]):function(n){return n===e||Rt(n,e,t)}}function Wt(e,t){return on(e)&&un(t)?dn(pn(e),t):function(n){var r=kn(n,e);return r===void 0&&r===t?An(n,e):It(t,r,void 0,a|o)}}function Gt(e){return function(t){return Nt(t,e)}}function Kt(e){if(typeof e==`string`)return e;if(En(e))return rt?rt.call(e):``;var t=e+``;return t==`0`&&1/e==-s?`-0`:t}function qt(e,t,r){var i=-1,a=he,o=e.length,s=!0,c=[],l=c;if(r)s=!1,a=ge;else if(o>=n){var u=t?null:Yt(e);if(u)return ke(u);s=!1,a=we,l=new St}else l=t?[]:c;outer:for(;++i<o;){var d=e[i],f=t?t(d):d;if(d=r||d!==0?d:0,s&&f===f){for(var p=l.length;p--;)if(l[p]===f)continue outer;t&&l.push(f),c.push(d)}else a(l,f,r)||(l!==c&&l.push(f),c.push(d))}return c}function Jt(e){return yn(e)?e:fn(e)}var Yt=qe&&1/ke(new qe([,-0]))[1]==s?function(e){return new qe(e)}:Nn;function Xt(e,t,n,r,i,s){var c=i&o,l=e.length,u=t.length;if(l!=u&&!(c&&u>l))return!1;var d=s.get(e);if(d&&s.get(t))return d==t;var f=-1,p=!0,m=i&a?new St:void 0;for(s.set(e,t),s.set(t,e);++f<l;){var h=e[f],g=t[f];if(r)var _=c?r(g,h,f,t,e,s):r(h,g,f,e,t,s);if(_!==void 0){if(_)continue;p=!1;break}if(m){if(!_e(t,function(e,t){if(!m.has(t)&&(h===e||n(h,e,r,i,s)))return m.add(t)})){p=!1;break}}else if(!(h===g||n(h,g,r,i,s))){p=!1;break}}return s.delete(e),s.delete(t),p}function Zt(e,t,n,r,i,s,c){switch(n){case E:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case T:return!(e.byteLength!=t.byteLength||!r(new Be(e),new Be(t)));case d:case f:case _:return _n(+e,+t);case p:return e.name==t.name&&e.message==t.message;case b:case S:return e==t+``;case g:var l=De;case x:var u=s&o;if(l||=ke,e.size!=t.size&&!u)return!1;var m=c.get(e);if(m)return m==t;s|=a,c.set(e,t);var h=Xt(l(e),l(t),r,i,s,c);return c.delete(e),h;case C:if(nt)return nt.call(e)==nt.call(t)}return!1}function Qt(e,t,n,r,i,a){var s=i&o,c=jn(e),l=c.length;if(l!=jn(t).length&&!s)return!1;for(var u=l;u--;){var d=c[u];if(!(s?d in t:Ie.call(t,d)))return!1}var f=a.get(e);if(f&&a.get(t))return f==t;var p=!0;a.set(e,t),a.set(t,e);for(var m=s;++u<l;){d=c[u];var h=e[d],g=t[d];if(r)var _=s?r(g,h,d,t,e,a):r(h,g,d,e,t,a);if(!(_===void 0?h===g||n(h,g,r,i,a):_)){p=!1;break}m||=d==`constructor`}if(p&&!m){var v=e.constructor,y=t.constructor;v!=y&&`constructor`in e&&`constructor`in t&&!(typeof v==`function`&&v instanceof v&&typeof y==`function`&&y instanceof y)&&(p=!1)}return a.delete(e),a.delete(t),p}function $t(e,t){var n=e.__data__;return sn(t)?n[typeof t==`string`?`string`:`hash`]:n.map}function en(e){for(var t=jn(e),n=t.length;n--;){var r=t[n],i=e[r];t[n]=[r,i,un(i)]}return t}function tn(e,t){var n=Te(e,t);return zt(n)?n:void 0}var nn=Pt;(We&&nn(new We(new ArrayBuffer(1)))!=E||Ge&&nn(new Ge)!=g||Ke&&nn(Ke.resolve())!=y||qe&&nn(new qe)!=x||Je&&nn(new Je)!=w)&&(nn=function(e){var t=Le.call(e),n=t==v?e.constructor:void 0,r=n?mn(n):void 0;if(r)switch(r){case Xe:return E;case Ze:return g;case Qe:return y;case $e:return x;case et:return w}return t});function rn(e,t,n){t=on(t,e)?[t]:Jt(t);for(var r,i=-1,a=t.length;++i<a;){var o=pn(t[i]);if(!(r=e!=null&&n(e,o)))break;e=e[o]}if(r)return r;var a=e?e.length:0;return!!a&&Cn(a)&&an(o,a)&&(yn(e)||vn(e))}function an(e,t){return t??=c,!!t&&(typeof e==`number`||oe.test(e))&&e>-1&&e%1==0&&e<t}function on(e,t){if(yn(e))return!1;var n=typeof e;return n==`number`||n==`symbol`||n==`boolean`||e==null||En(e)?!0:te.test(e)||!F.test(e)||t!=null&&e in Object(t)}function sn(e){var t=typeof e;return t==`string`||t==`number`||t==`symbol`||t==`boolean`?e!==`__proto__`:e===null}function cn(e){return!!Pe&&Pe in e}function ln(e){var t=e&&e.constructor;return e===(typeof t==`function`&&t.prototype||Me)}function un(e){return e===e&&!wn(e)}function dn(e,t){return function(n){return n==null?!1:n[e]===t&&(t!==void 0||e in Object(n))}}var fn=gn(function(e){e=On(e);var t=[];return ne.test(e)&&t.push(``),e.replace(re,function(e,n,r,i){t.push(r?i.replace(ie,`$1`):n||e)}),t});function pn(e){if(typeof e==`string`||En(e))return e;var t=e+``;return t==`0`&&1/e==-s?`-0`:t}function mn(e){if(e!=null){try{return Fe.call(e)}catch{}try{return e+``}catch{}}return``}function hn(e,t){return e&&e.length?qt(e,Vt(t,2)):[]}function gn(e,t){if(typeof e!=`function`||t&&typeof t!=`function`)throw TypeError(r);var n=function(){var r=arguments,i=t?t.apply(this,r):r[0],a=n.cache;if(a.has(i))return a.get(i);var o=e.apply(this,r);return n.cache=a.set(i,o),o};return n.cache=new(gn.Cache||gt),n}gn.Cache=gt;function _n(e,t){return e===t||e!==e&&t!==t}function vn(e){return xn(e)&&Ie.call(e,`callee`)&&(!Ve.call(e,`callee`)||Le.call(e)==l)}var yn=Array.isArray;
494function bn(e){return e!=null&&Cn(e.length)&&!Sn(e)}function xn(e){return Tn(e)&&bn(e)}function Sn(e){var t=wn(e)?Le.call(e):``;return t==m||t==h}function Cn(e){return typeof e==`number`&&e>-1&&e%1==0&&e<=c}function wn(e){var t=typeof e;return!!e&&(t==`object`||t==`function`)}function Tn(e){return!!e&&typeof e==`object`}function En(e){return typeof e==`symbol`||Tn(e)&&Le.call(e)==C}var Dn=me?Ce(me):Bt;function On(e){return e==null?``:Kt(e)}function kn(e,t,n){var r=e==null?void 0:Nt(e,t);return r===void 0?n:r}function An(e,t){return e!=null&&rn(e,t,Ft)}function jn(e){return bn(e)?jt(e):Ht(e)}function Mn(e){return e}function Nn(){}function Pn(e){return on(e)?xe(pn(e)):Gt(e)}t.exports=hn})),lfe=r(Iq(),1),ufe=r(Lq(),1),dfe=r(Rq(),1),ffe=r(zq(),1),pfe=r(Bq(),1),mfe=r(Vq(),1);Hq(),Uq(),Wq(),Gq(),Kq(),qq(),Jq(),Yq(),Xq(),Zq(),Qq(),$q();var M0=afe(),hfe=r(ofe(),1),gfe=r(sfe(),1),N0=r(cfe(),1);function P0(){return P0=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},P0.apply(null,arguments)}function _fe(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var vfe=d.useLayoutEffect,yfe=function(e){var t=d.useRef(e);return vfe(function(){t.current=e}),t},F0=function(e,t){if(typeof e==`function`){e(t);return}e.current=t},bfe=function(e,t){var n=d.useRef();return d.useCallback(function(r){e.current=r,n.current&&F0(n.current,null),n.current=t,t&&F0(t,r)},[t])},I0={"min-height":`0`,"max-height":`none`,height:`0`,visibility:`hidden`,overflow:`hidden`,position:`absolute`,"z-index":`-1000`,top:`0`,right:`0`,display:`block`},L0=function(e){Object.keys(I0).forEach(function(t){e.style.setProperty(t,I0[t],`important`)})},R0=null,z0=function(e,t){var n=e.scrollHeight;return t.sizingStyle.boxSizing===`border-box`?n+t.borderSize:n-t.paddingSize};function xfe(e,t,n,r){n===void 0&&(n=1),r===void 0&&(r=1/0),R0||(R0=document.createElement(`textarea`),R0.setAttribute(`tabindex`,`-1`),R0.setAttribute(`aria-hidden`,`true`),L0(R0)),R0.parentNode===null&&document.body.appendChild(R0);var i=e.paddingSize,a=e.borderSize,o=e.sizingStyle,s=o.boxSizing;Object.keys(o).forEach(function(e){var t=e;R0.style[t]=o[t]}),L0(R0),R0.value=t;var c=z0(R0,e);R0.value=t,c=z0(R0,e),R0.value=`x`;var l=R0.scrollHeight-i,u=l*n;s===`border-box`&&(u=u+i+a),c=Math.max(u,c);var d=l*r;return s===`border-box`&&(d=d+i+a),c=Math.min(d,c),[c,l]}var B0=function(){},Sfe=function(e,t){return e.reduce(function(e,n){return e[n]=t[n],e},{})},Cfe=[`borderBottomWidth`,`borderLeftWidth`,`borderRightWidth`,`borderTopWidth`,`boxSizing`,`fontFamily`,`fontSize`,`fontStyle`,`fontWeight`,`letterSpacing`,`lineHeight`,`paddingBottom`,`paddingLeft`,`paddingRight`,`paddingTop`,`tabSize`,`textIndent`,`textRendering`,`textTransform`,`width`,`wordBreak`,`wordSpacing`,`scrollbarGutter`],wfe=!!document.documentElement.currentStyle,Tfe=function(e){var t=window.getComputedStyle(e);if(t===null)return null;var n=Sfe(Cfe,t),r=n.boxSizing;return r===``?null:(wfe&&r===`border-box`&&(n.width=parseFloat(n.width)+parseFloat(n.borderRightWidth)+parseFloat(n.borderLeftWidth)+parseFloat(n.paddingRight)+parseFloat(n.paddingLeft)+`px`),{sizingStyle:n,paddingSize:parseFloat(n.paddingBottom)+parseFloat(n.paddingTop),borderSize:parseFloat(n.borderBottomWidth)+parseFloat(n.borderTopWidth)})};function V0(e,t,n){var r=yfe(n);d.useLayoutEffect(function(){var n=function(e){return r.current(e)};if(e)return e.addEventListener(t,n),function(){return e.removeEventListener(t,n)}},[])}var Efe=function(e,t){V0(document.body,`reset`,function(n){e.current.form===n.target&&t(n)})},Dfe=function(e){V0(window,`resize`,e)},Ofe=function(e){V0(document.fonts,`loadingdone`,e)},kfe=[`cacheMeasurements`,`maxRows`,`minRows`,`onChange`,`onHeightChange`],Afe=d.forwardRef(function(e,t){var n=e.cacheMeasurements,r=e.maxRows,i=e.minRows,a=e.onChange,o=a===void 0?B0:a,s=e.onHeightChange,c=s===void 0?B0:s,l=_fe(e,kfe),u=l.value!==void 0,f=d.useRef(null),p=bfe(f,t),m=d.useRef(0),h=d.useRef(),g=function(){var e=f.current,t=n&&h.current?h.current:Tfe(e);
494if(t){h.current=t;var a=xfe(t,e.value||e.placeholder||`x`,i,r),o=a[0],s=a[1];m.current!==o&&(m.current=o,e.style.setProperty(`height`,o+`px`,`important`),c(o,{rowHeight:s}))}};return d.useLayoutEffect(g),Efe(f,function(){if(!u){var e=f.current.value;requestAnimationFrame(function(){var t=f.current;t&&e!==t.value&&g()})}}),Dfe(g),Ofe(g),d.createElement(`textarea`,P0({},l,{onChange:function(e){u||g(),o(e)},ref:p}))}),jfe=n(((e,t)=>{t.exports=`SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED`})),Mfe=n(((e,t)=>{var n=jfe();function r(){}function i(){}i.resetWarningCache=r,t.exports=function(){function e(e,t,r,i,a,o){if(o!==n){var s=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 s.name=`Invariant Violation`,s}}e.isRequired=e;function t(){return e}var a={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:i,resetWarningCache:r};return a.PropTypes=a,a}})),H0=n(((e,t)=>{t.exports=Mfe()()})),Nf
vendor: 41,169 bytes, line 494
494e=new Map([[`1km`,`application/vnd.1000minds.decision-model+xml`],[`3dml`,`text/vnd.in3d.3dml`],[`3ds`,`image/x-3ds`],[`3g2`,`video/3gpp2`],[`3gp`,`video/3gp`],[`3gpp`,`video/3gpp`],[`3mf`,`model/3mf`],[`7z`,`application/x-7z-compressed`],[`7zip`,`application/x-7z-compressed`],[`123`,`application/vnd.lotus-1-2-3`],[`aab`,`application/x-authorware-bin`],[`aac`,`audio/x-acc`],[`aam`,`application/x-authorware-map`],[`aas`,`application/x-authorware-seg`],[`abw`,`application/x-abiword`],[`ac`,`application/vnd.nokia.n-gage.ac+xml`],[`ac3`,`audio/ac3`],[`acc`,`application/vnd.americandynamics.acc`],[`ace`,`application/x-ace-compressed`],[`acu`,`application/vnd.acucobol`],[`acutc`,`application/vnd.acucorp`],[`adp`,`audio/adpcm`],[`aep`,`application/vnd.audiograph`],[`afm`,`application/x-font-type1`],[`afp`,`application/vnd.ibm.modcap`],[`ahead`,`application/vnd.ahead.space`],[`ai`,`application/pdf`],[`aif`,`audio/x-aiff`],[`aifc`,`audio/x-aiff`],[`aiff`,`audio/x-aiff`],[`air`,`application/vnd.adobe.air-application-installer-package+zip`],[`ait`,`application/vnd.dvb.ait`],[`ami`,`application/vnd.amiga.ami`],[`amr`,`audio/amr`],[`apk`,`application/vnd.android.package-archive`],[`apng`,`image/apng`],[`appcache`,`text/cache-manifest`],[`application`,`application/x-ms-application`],[`apr`,`application/vnd.lotus-approach`],[`arc`,`application/x-freearc`],[`arj`,`application/x-arj`],[`asc`,`application/pgp-signature`],[`asf`,`video/x-ms-asf`],[`asm`,`text/x-asm`],[`aso`,`application/vnd.accpac.simply.aso`],[`asx`,`video/x-ms-asf`],[`atc`,`application/vnd.acucorp`],[`atom`,`application/atom+xml`],[`atomcat`,`application/atomcat+xml`],[`atomdeleted`,`application/atomdeleted+xml`],[`atomsvc`,`application/atomsvc+xml`],[`atx`,`application/vnd.antix.game-component`],[`au`,`audio/x-au`],[`avi`,`video/x-msvideo`],[`avif`,`image/avif`],[`aw`,`application/applixware`],[`azf`,`application/vnd.airzip.filesecure.azf`],[`azs`,`application/vnd.airzip.filesecure.azs`],[`azv`,`image/vnd.airzip.accelerator.azv`],[`azw`,`application/vnd.amazon.ebook`],[`b16`,`image/vnd.pco.b16`],[`bat`,`application/x-msdownload`],[`bcpio`,`application/x-bcpio`],[`bdf`,`application/x-font-bdf`],[`bdm`,`application/vnd.syncml.dm+wbxml`],[`bdoc`,`application/x-bdoc`],[`bed`,`application/vnd.realvnc.bed`],[`bh2`,`application/vnd.fujitsu.oasysprs`],[`bin`,`application/octet-stream`],[`blb`,`application/x-blorb`],[`blorb`,`application/x-blorb`],[`bmi`,`application/vnd.bmi`],[`bmml`,`application/vnd.balsamiq.bmml+xml`],[`bmp`,`image/bmp`],[`book`,`application/vnd.framemaker`],[`box`,`application/vnd.previewsystems.box`],[`boz`,`application/x-bzip2`],[`bpk`,`application/octet-stream`],[`bpmn`,`application/octet-stream`],[`bsp`,`model/vnd.valve.source.compiled-map`],[`btif`,`image/prs.btif`],[`buffer`,`application/octet-stream`],[`bz`,`application/x-bzip`],[`bz2`,`application/x-bzip2`],[`c`,`text/x-c`],[`c4d`,`application/vnd.clonk.c4group`],[`c4f`,`application/vnd.clonk.c4group`],[`c4g`,`application/vnd.clonk.c4group`],[`c4p`,`application/vnd.clonk.c4group`],[`c4u`,`application/vnd.clonk.c4group`],[`c11amc`,`application/vnd.cluetrust.cartomobile-config`],[`c11amz`,`application/vnd.cluetrust.cartomobile-config-pkg`],[`cab`,`application/vnd.ms-cab-compressed`],[`caf`,`audio/x-caf`],[`cap`,`application/vnd.tcpdump.pcap`],[`car`,`application/vnd.curl.car`],[`cat`,`application/vnd.ms-pki.seccat`],[`cb7`,`application/x-cbr`],[`cba`,`application/x-cbr`],[`cbr`,`application/x-cbr`],[`cbt`,`application/x-cbr`],[`cbz`,`application/x-cbr`],[`cc`,`text/x-c`],[`cco`,`application/x-cocoa`],[`cct`,`application/x-director`],[`ccxml`,`application/ccxml+xml`],[`cdbcmsg`,`application/vnd.contact.cmsg`],[`cda`,`application/x-cdf`],[`cdf`,`application/x-netcdf`],[`cdfx`,`application/cdfx+xml`],[`cdkey`,`application/vnd.mediastation.cdkey`],[`cdmia`,`application/cdmi-capability`],[`cdmic`,`application/cdmi-container`],[`cdmid`,`application/cdmi-domain`],[`cdmio`,`application/cdmi-object`],[`cdmiq`,`application/cdmi-queue`],[`cdr`,`application/cdr`],[`cdx`,`chemical/x-cdx`],[`cdxml`,`application/vnd.chemdraw+xml`],[`cdy`,`application/vnd.cinderella`],[`cer`,`application/pkix-cert`],[`cfs`,`application/x-cfs-compressed`],[`cgm`,`image/cgm`],[`chat`,`application/x-chat`],[`chm`,`application/vnd.ms-htmlhelp`],[`chrt`,`application/vnd.kde.kchart`],[`cif`,`chemical/x-cif`],[`cii`,`application/vnd.anser-web-certificate-issue-initiation`],[`cil`,`application/vnd.ms-artgalry`],[`cjs`,`application/node`],[`cla`,`application/vnd.claymore`],[`class`,`application/octet-stream`],[`clkk`,`application/vnd.crick.clicker.keyboard`],[`clkp`,`application/vnd.crick.clicker.palette`],[`clkt`,`application/vnd.crick.clicker.template`],[`clkw`,`application/vnd.crick.clicker.wordbank`],[`clkx`,`application/vnd.crick.clicker`],[`clp`,`application/x-msclip`],[`cmc`,`application/vnd.cosmocaller`],[`cmdf`,`chemical/x-cmdf`],[`cml`,`chemical/x-cml`],[`cmp`,`application/vnd.yellowriver-custom-menu`],[`cmx`,`image/x-cmx`],[`cod`,`application/vnd.rim.cod`],[`coffee`,`text/coffeescript`],[`com`,`application/x-msdownload`],[`conf`,`text/plain`],[`cpio`,`application/x-cpio`],[`cpp`,`text/x-c`],[`cpt`,`application/mac-compactpro`],[`crd`,`application/x-mscardfile`],[`crl`,`application/pkix-crl`],[`crt`,`application/x-x509-ca-cert`],[`crx`,`application/x-chrome-extension`],[`cryptonote`,`application/vnd.rig.cryptonote`],[`csh`,`application/x-csh`],[`csl`,`application/vnd.citationstyles.style+xml`],[`csml`,`chemical/x-csml`],[`csp`,`application/vnd.commonspace`],[`csr`,`application/octet-stream`],[`css`,`text/css`],[`cst`,`application/x-director`],[`csv`,`text/csv`],[`cu`,`application/cu-seeme`],[`curl`,`text/vnd.curl`],[`cww`,`application/prs.cww`],[`cxt`,`application/x-director`],[`cxx`,`text/x-c`],[`dae`,`model/vnd.collada+xml`],[`daf`,`application/vnd.mobius.daf`],[`dart`,`application/vnd.dart`],[`dataless`,`application/vnd.fdsn.seed`],[`davmount`,`application/davmount+xml`],[`dbf`,`application/vnd.dbf`],[`dbk`,`application/docbook+xml`],[`dcr`,`application/x-director`],[`dcurl`,`text/vnd.curl.dcurl`],[`dd2`,`application/vnd.oma.dd2+xml`],[`ddd`,`application/vnd.fujixerox.ddd`],[`ddf`,`application/vnd.syncml.dmddf+xml`],[`dds`,`image/vnd.ms-dds`],[`deb`,`application/x-debian-package`],[`def`,`text/plain`],[`deploy`,`application/octet-stream`],[`der`,`application/x-x509-ca-cert`],[`dfac`,`application/vnd.dreamfactory`],[`dgc`,`application/x-dgc-compressed`],[`dic`,`text/x-c`],[`dir`,`application/x-director`],[`dis`,`application/vnd.mobius.dis`],[`disposition-notification`,`message/disposition-notification`],[`dist`,`application/octet-stream`],[`distz`,`application/octet-stream`],[`djv`,`image/vnd.djvu`],[`djvu`,`image/vnd.djvu`],[`dll`,`application/octet-stream`],[`dmg`,`application/x-apple-diskimage`],[`dmn`,`application/octet-stream`],[`dmp`,`application/vnd.tcpdump.pcap`],[`dms`,`application/octet-stream`],[`dna`,`application/vnd.dna`],[`doc`,`application/msword`],[`docm`,`application/vnd.ms-word.template.macroEnabled.12`],[`docx`,`application/vnd.openxmlformats-officedocument.wordprocessingml.document`],[`dot`,`application/msword`],[`dotm`,`application/vnd.ms-word.template.macroEnabled.12`],[`dotx`,`application/vnd.openxmlformats-officedocument.wordprocessingml.template`],[`dp`,`application/vnd.osgi.dp`],[`dpg`,`application/vnd.dpgraph`],[`dra`,`audio/vnd.dra`],[`drle`,`image/dicom-rle`],[`dsc`,`text/prs.lines.tag`],[`dssc`,`application/dssc+der`],[`dtb`,`application/x-dtbook+xml`],[`dtd`,`application/xml-dtd`],[`dts`,`audio/vnd.dts`],[`dtshd`,`audio/vnd.dts.hd`],[`dump`,`application/octet-stream`],[`dvb`,`video/vnd.dvb.file`],[`dvi`,`application/x-dvi`],[`dwd`,`application/atsc-dwd+xml`],[`dwf`,`model/vnd.dwf`],[`dwg`,`image/vnd.dwg`],[`dxf`,`image/vnd.dxf`],[`dxp`,`application/vnd.spotfire.dxp`],[`dxr`,`application/x-director`],[`ear`,`application/java-archive`],[`ecelp4800`,`audio/vnd.nuera.ecelp4800`],[`ecelp7470`,`audio/vnd.nuera.ecelp7470`],[`ecelp9600`,`audio/vnd.nuera.ecelp9600`],[`ecma`,`application/ecmascript`],[`edm`,`application/vnd.novadigm.edm`],[`edx`,`application/vnd.novadigm.edx`],[`efif`,`application/vnd.picsel`],[`ei6`,`application/vnd.pg.osasli`],[`elc`,`application/octet-stream`],[`emf`,`image/emf`],[`eml`,`message/rfc822`],[`emma`,`application/emma+xml`],[`emotionml`,`application/emotionml+xml`],[`emz`,`application/x-msmetafile`],[`eol`,`audio/vnd.digital-winds`],[`eot`,`application/vnd.ms-fontobject`],[`eps`,`application/postscript`],[`epub`,`application/epub+zip`],[`es`,`application/ecmascript`],[`es3`,`application/vnd.eszigno3+xml`],[`esa`,`application/vnd.osgi.subsystem`],[`esf`,`application/vnd.epson.esf`],[`et3`,`application/vnd.eszigno3+xml`],[`etx`,`text/x-setext`],[`eva`,`application/x-eva`],[`evy`,`application/x-envoy`],[`exe`,`application/octet-stream`],[`exi`,`application/exi`],[`exp`,`application/express`],[`exr`,`image/aces`],[`ext`,`application/vnd.novadigm.ext`],[`ez`,`application/andrew-inset`],[`ez2`,`application/vnd.ezpix-album`],[`ez3`,`application/vnd.ezpix-package`],[`f`,`text/x-fortran`],[`f4v`,`video/mp4`],[`f77`,`text/x-fortran`],[`f90`,`text/x-fortran`],[`fbs`,`image/vnd.fastbidsheet`],[`fcdt`,`application/vnd.adobe.formscentral.fcdt`],[`fcs`,`application/vnd.isac.fcs`],[`fdf`,`application/vnd.fdf`],[`fdt`,`application/fdt+xml`],[`fe_launch`,`application/vnd.denovo.fcselayout-link`],[`fg5`,`application/vnd.fujitsu.oasysgp`],[`fgd`,`application/x-director`],[`fh`,`image/x-freehand`],[`fh4`,`image/x-freehand`],[`fh5`,`image/x-freehand`],[`fh7`,`image/x-freehand`],[`fhc`,`image/x-freehand`],[`fig`,`application/x-xfig`],[`fits`,`image/fits`],[`flac`,`audio/x-flac`],[`fli`,`video/x-fli`],[`flo`,`application/vnd.micrografx.flo`],[`flv`,`video/x-flv`],[`flw`,`application/vnd.kde.kivio`],[`flx`,`text/vnd.fmi.flexstor`],[`fly`,`text/vnd.fly`],[`fm`,`application/vnd.framemaker`],[`fnc`,`application/vnd.frogans.fnc`],[`fo`,`application/vnd.software602.filler.form+xml`],[`for`,`text/x-fortran`],[`fpx`,`image/vnd.fpx`],[`frame`,`application/vnd.framemaker`],[`fsc`,`application/vnd.fsc.weblaunch`],[`fst`,`image/vnd.fst`],[`ftc`,`application/vnd.fluxtime.clip`],[`fti`,`application/vnd.anser-web-funds-transfer-initiation`],[`fvt`,`video/vnd.fvt`],[`fxp`,`application/vnd.adobe.fxp`],[`fxpl`,`application/vnd.adobe.fxp`],[`fzs`,`application/vnd.fuzzysheet`],[`g2w`,`application/vnd.geoplan`],[`g3`,`image/g3fax`],[`g3w`,`application/vnd.geospace`],[`gac`,`application/vnd.groove-account`],[`gam`,`application/x-tads`],[`gbr`,`application/rpki-ghostbusters`],[`gca`,`application/x-gca-compressed`],[`gdl`,`model/vnd.gdl`],[`gdoc`,`application/vnd.google-apps.document`],[`geo`,`application/vnd.dynageo`],[`geojson`,`application/geo+json`],[`gex`,`application/vnd.geometry-explorer`],[`ggb`,`application/vnd.geogebra.file`],[`ggt`,`application/vnd.geogebra.tool`],[`ghf`,`application/vnd.groove-help`],[`gif`,`image/gif`],[`gim`,`application/vnd.groove-identity-message`],[`glb`,`model/gltf-binary`],[`gltf`,`model/gltf+json`],[`gml`,`application/gml+xml`],[`gmx`,`application/vnd.gmx`],[`gnumeric`,`application/x-gnumeric`],[`gpg`,`application/gpg-keys`],[`gph`,`application/vnd.flographit`],[`gpx`,`application/gpx+xml`],[`gqf`,`application/vnd.grafeq`],[`gqs`,`application/vnd.grafeq`],[`gram`,`application/srgs`],[`gramps`,`application/x-gramps-xml`],[`gre`,`application/vnd.geometry-explorer`],[`grv`,`application/vnd.groove-injector`],[`grxml`,`application/srgs+xml`],[`gsf`,`application/x-font-ghostscript`],[`gsheet`,`application/vnd.google-apps.spreadsheet`],[`gslides`,`application/vnd.google-apps.presentation`],[`gtar`,`application/x-gtar`],[`gtm`,`application/vnd.groove-tool-message`],[`gtw`,`model/vnd.gtw`],[`gv`,`text/vnd.graphviz`],[`gxf`,`application/gxf`],[`gxt`,`application/vnd.geonext`],[`gz`,`application/gzip`],[`gzip`,`application/gzip`],[`h`,`text/x-c`],[`h261`,`video/h261`],[`h263`,`video/h263`],[`h264`,`video/h264`],[`hal`,`application/vnd.hal+xml`],[`hbci`,`application/vnd.hbci`],[`hbs`,`text/x-handlebars-template`],[`hdd`,`application/x-virtualbox-hdd`],[`hdf`,`application/x-hdf`],[`heic`,`image/heic`],[`heics`,`image/heic-sequence`],[`heif`,`image/heif`],[`heifs`,`image/heif-sequence`],[`hej2`,`image/hej2k`],[`held`,`application/atsc-held+xml`],[`hh`,`text/x-c`],[`hjson`,`application/hjson`],[`hlp`,`application/winhlp`],[`hpgl`,`application/vnd.hp-hpgl`],[`hpid`,`application/vnd.hp-hpid`],[`hps`,`application/vnd.hp-hps`],[`hqx`,`application/mac-binhex40`],[`hsj2`,`image/hsj2`],[`htc`,`text/x-component`],[`htke`,`application/vnd.kenameaapp`],[`htm`,`text/html`],[`html`,`text/html`],[`hvd`,`application/vnd.yamaha.hv-dic`],[`hvp`,`application/vnd.yamaha.hv-voice`],[`hvs`,`application/vnd.yamaha.hv-script`],[`i2g`,`application/vnd.intergeo`],[`icc`,`application/vnd.iccprofile`],[`ice`,`x-conference/x-cooltalk`],[`icm`,`application/vnd.iccprofile`],[`ico`,`image/x-icon`],[`ics`,`text/calendar`],[`ief`,`image/ief`],[`ifb`,`text/calendar`],[`ifm`,`application/vnd.shana.informed.formdata`],[`iges`,`model/iges`],[`igl`,`application/vnd.igloader`],[`igm`,`application/vnd.insors.igm`],[`igs`,`model/iges`],[`igx`,`application/vnd.micrografx.igx`],[`iif`,`application/vnd.shana.informed.interchange`],[`img`,`application/octet-stream`],[`imp`,`application/vnd.accpac.simply.imp`],[`ims`,`application/vnd.ms-ims`],[`in`,`text/plain`],[`ini`,`text/plain`],[`ink`,`application/inkml+xml`],[`inkml`,`application/inkml+xml`],[`install`,`application/x-install-instructions`],[`iota`,`application/vnd.astraea-software.iota`],[`ipfix`,`application/ipfix`],[`ipk`,`application/vnd.shana.informed.package`],[`irm`,`application/vnd.ibm.rights-management`],[`irp`,`application/vnd.irepository.package+xml`],[`iso`,`application/x-iso9660-image`],[`itp`,`application/vnd.shana.informed.formtemplate`],[`its`,`application/its+xml`],[`ivp`,`application/vnd.immervision-ivp`],[`ivu`,`application/vnd.immervision-ivu`],[`jad`,`text/vnd.sun.j2me.app-descriptor`],[`jade`,`text/jade`],[`jam`,`application/vnd.jam`],[`jar`,`application/java-archive`],[`jardiff`,`application/x-java-archive-diff`],[`java`,`text/x-java-source`],[`jhc`,`image/jphc`],[`jisp`,`application/vnd.jisp`],[`jls`,`image/jls`],[`jlt`,`application/vnd.hp-jlyt`],[`jng`,`image/x-jng`],[`jnlp`,`application/x-java-jnlp-file`],[`joda`,`application/vnd.joost.joda-archive`],[`jp2`,`image/jp2`],[`jpe`,`image/jpeg`],[`jpeg`,`image/jpeg`],[`jpf`,`image/jpx`],[`jpg`,`image/jpeg`],[`jpg2`,`image/jp2`],[`jpgm`,`video/jpm`],[`jpgv`,`video/jpeg`],[`jph`,`image/jph`],[`jpm`,`video/jpm`],[`jpx`,`image/jpx`],[`js`,`application/javascript`],[`json`,`application/json`],[`json5`,`application/json5`],[`jsonld`,`application/ld+json`],[`jsonl`,`application/jsonl`],[`jsonml`,`application/jsonml+json`],[`jsx`,`text/jsx`],[`jxr`,`image/jxr`],[`jxra`,`image/jxra`],[`jxrs`,`image/jxrs`],[`jxs`,`image/jxs`],[`jxsc`,`image/jxsc`],[`jxsi`,`image/jxsi`],[`jxss`,`image/jxss`],[`kar`,`audio/midi`],[`karbon`,`application/vnd.kde.karbon`],[`kdb`,`application/octet-stream`],[`kdbx`,`application/x-keepass2`],[`key`,`application/x-iwork-keynote-sffkey`],[`kfo`,`application/vnd.kde.kformula`],[`kia`,`application/vnd.kidspiration`],[`kml`,`application/vnd.google-earth.kml+xml`],[`kmz`,`application/vnd.google-earth.kmz`],[`kne`,`application/vnd.kinar`],[`knp`,`application/vnd.kinar`],[`kon`,`application/vnd.kde.kontour`],[`kpr`,`application/vnd.kde.kpresenter`],[`kpt`,`application/vnd.kde.kpresenter`],[`kpxx`,`application/vnd.ds-keypoint`],[`ksp`,`application/vnd.kde.kspread`],[`ktr`,`application/vnd.kahootz`],[`ktx`,`image/ktx`],[`ktx2`,`image/ktx2`],[`ktz`,`application/vnd.kahootz`],[`kwd`,`application/vnd.kde.kword`],[`kwt`,`application/vnd.kde.kword`],[`lasxml`,`application/vnd.las.las+xml`],[`latex`,`application/x-latex`],[`lbd`,`application/vnd.llamagraphics.life-balance.desktop`],[`lbe`,`application/vnd.llamagraphics.life-balance.exchange+xml`],[`les`,`application/vnd.hhe.lesson-player`],[`less`,`text/less`],[`lgr`,`application/lgr+xml`],[`lha`,`application/octet-stream`],[`link66`,`application/vnd.route66.link66+xml`],[`list`,`text/plain`],[`list3820`,`application/vnd.ibm.modcap`],[`listafp`,`application/vnd.ibm.modcap`],[`litcoffee`,`text/coffeescript`],[`lnk`,`application/x-ms-shortcut`],[`log`,`text/plain`],[`lostxml`,`application/lost+xml`],[`lrf`,`application/octet-stream`],[`lrm`,`application/vnd.ms-lrm`],[`ltf`,`application/vnd.frogans.ltf`],[`lua`,`text/x-lua`],[`luac`,`application/x-lua-bytecode`],[`lvp`,`audio/vnd.lucent.voice`],[`lwp`,`application/vnd.lotus-wordpro`],[`lzh`,`application/octet-stream`],[`m1v`,`video/mpeg`],[`m2a`,`audio/mpeg`],[`m2v`,`video/mpeg`],[`m3a`,`audio/mpeg`],[`m3u`,`text/plain`],[`m3u8`,`application/vnd.apple.mpegurl`],[`m4a`,`audio/x-m4a`],[`m4p`,`application/mp4`],[`m4s`,`video/iso.segment`],[`m4u`,`application/vnd.mpegurl`],[`m4v`,`video/x-m4v`],[`m13`,`application/x-msmediaview`],[`m14`,`application/x-msmediaview`],[`m21`,`application/mp21`],[`ma`,`application/mathematica`],[`mads`,`application/mads+xml`],[`maei`,`application/mmt-aei+xml`],[`mag`,`application/vnd.ecowin.chart`],[`maker`,`application/vnd.framemaker`],[`man`,`text/troff`],[`manifest`,`text/cache-manifest`],[`map`,`application/json`],[`mar`,`application/octet-stream`],[`markdown`,`text/markdown`],[`mathml`,`application/mathml+xml`],[`mb`,`application/mathematica`],[`mbk`,`application/vnd.mobius.mbk`],[`mbox`,`application/mbox`],[`mc1`,`application/vnd.medcalcdata`],[`mcd`,`application/vnd.mcd`],[`mcurl`,`text/vnd.curl.mcurl`],[`md`,`text/markdown`],[`mdb`,`application/x-msaccess`],[`mdi`,`image/vnd.ms-modi`],[`mdx`,`text/mdx`],[`me`,`text/troff`],[`mesh`,`model/mesh`],[`meta4`,`application/metalink4+xml`],[`metalink`,`application/metalink+xml`],[`mets`,`application/mets+xml`],[`mfm`,`application/vnd.mfmp`],[`mft`,`application/rpki-manifest`],[`mgp`,`application/vnd.osgeo.mapguide.package`],[`mgz`,`application/vnd.proteus.magazine`],[`mid`,`audio/midi`],[`midi`,`audio/midi`],[`mie`,`application/x-mie`],[`mif`,`application/vnd.mif`],[`mime`,`message/rfc822`],[`mj2`,`video/mj2`],[`mjp2`,`video/mj2`],[`mjs`,`application/javascript`],[`mk3d`,`video/x-matroska`],[`mka`,`audio/x-matroska`],[`mkd`,`text/x-markdown`],[`mks`,`video/x-matroska`],[`mkv`,`video/x-matroska`],[`mlp`,`application/vnd.dolby.mlp`],[`mmd`,`application/vnd.chipnuts.karaoke-mmd`],[`mmf`,`application/vnd.smaf`],[`mml`,`text/mathml`],[`mmr`,`image/vnd.fujixerox.edmics-mmr`],[`mng`,`video/x-mng`],[`mny`,`application/x-msmoney`],[`mobi`,`application/x-mobipocket-ebook`],[`mods`,`application/mods+xml`],[`mov`,`video/quicktime`],[`movie`,`video/x-sgi-movie`],[`mp2`,`audio/mpeg`],[`mp2a`,`audio/mpeg`],[`mp3`,`audio/mpeg`],[`mp4`,`video/mp4`],[`mp4a`,`audio/mp4`],[`mp4s`,`application/mp4`],[`mp4v`,`video/mp4`],[`mp21`,`application/mp21`],[`mpc`,`application/vnd.mophun.certificate`],[`mpd`,`application/dash+xml`],[`mpe`,`video/mpeg`],[`mpeg`,`video/mpeg`],[`mpg`,`video/mpeg`],[`mpg4`,`video/mp4`],[`mpga`,`audio/mpeg`],[`mpkg`,`application/vnd.apple.installer+xml`],[`mpm`,`application/vnd.blueice.multipass`],[`mpn`,`application/vnd.mophun.application`],[`mpp`,`application/vnd.ms-project`],[`mpt`,`application/vnd.ms-project`],[`mpy`,`application/vnd.ibm.minipay`],[`mqy`,`application/vnd.mobius.mqy`],[`mrc`,`application/marc`],[`mrcx`,`application/marcxml+xml`],[`ms`,`text/troff`],[`mscml`,`application/mediaservercontrol+xml`],[`mseed`,`application/vnd.fdsn.mseed`],[`mseq`,`application/vnd.mseq`],[`msf`,`application/vnd.epson.msf`],[`msg`,`application/vnd.ms-outlook`],[`msh`,`model/mesh`],[`msi`,`application/x-msdownload`],[`msl`,`application/vnd.mobius.msl`],[`msm`,`application/octet-stream`],[`msp`,`application/octet-stream`],[`msty`,`application/vnd.muvee.style`],[`mtl`,`model/mtl`],[`mts`,`model/vnd.mts`],[`mus`,`application/vnd.musician`],[`musd`,`application/mmt-usd+xml`],[`musicxml`,`application/vnd.recordare.musicxml+xml`],[`mvb`,`application/x-msmediaview`],[`mvt`,`application/vnd.mapbox-vector-tile`],[`mwf`,`application/vnd.mfer`],[`mxf`,`application/mxf`],[`mxl`,`application/vnd.recordare.musicxml`],[`mxmf`,`audio/mobile-xmf`],[`mxml`,`application/xv+xml`],[`mxs`,`application/vnd.triscape.mxs`],[`mxu`,`video/vnd.mpegurl`],[`n-gage`,`application/vnd.nokia.n-gage.symbian.install`],[`n3`,`text/n3`],[`nb`,`application/mathematica`],[`nbp`,`application/vnd.wolfram.player`],[`nc`,`application/x-netcdf`],[`ncx`,`application/x-dtbncx+xml`],[`nfo`,`text/x-nfo`],[`ngdat`,`application/vnd.nokia.n-gage.data`],[`nitf`,`application/vnd.nitf`],[`nlu`,`application/vnd.neurolanguage.nlu`],[`nml`,`application/vnd.enliven`],[`nnd`,`application/vnd.noblenet-directory`],[`nns`,`application/vnd.noblenet-sealer`],[`nnw`,`application/vnd.noblenet-web`],[`npx`,`image/vnd.net-fpx`],[`nq`,`application/n-quads`],[`nsc`,`application/x-conference`],[`nsf`,`application/vnd.lotus-notes`],[`nt`,`application/n-triples`],[`ntf`,`application/vnd.nitf`],[`numbers`,`application/x-iwork-numbers-sffnumbers`],[`nzb`,`application/x-nzb`],[`oa2`,`application/vnd.fujitsu.oasys2`],[`oa3`,`application/vnd.fujitsu.oasys3`],[`oas`,`application/vnd.fujitsu.oasys`],[`obd`,`application/x-msbinder`],[`obgx`,`application/vnd.openblox.game+xml`],[`obj`,`model/obj`],[`oda`,`application/oda`],[`odb`,`application/vnd.oasis.opendocument.database`],[`odc`,`application/vnd.oasis.opendocument.chart`],[`odf`,`application/vnd.oasis.opendocument.formula`],[`odft`,`application/vnd.oasis.opendocument.formula-template`],[`odg`,`application/vnd.oasis.opendocument.graphics`],[`odi`,`application/vnd.oasis.opendocument.image`],[`odm`,`application/vnd.oasis.opendocument.text-master`],[`odp`,`application/vnd.oasis.opendocument.presentation`],[`ods`,`application/vnd.oasis.opendocument.spreadsheet`],[`odt`,`application/vnd.oasis.opendocument.text`],[`oga`,`audio/ogg`],[`ogex`,`model/vnd.opengex`],[`ogg`,`audio/ogg`],[`ogv`,`video/ogg`],[`ogx`,`application/ogg`],[`omdoc`,`application/omdoc+xml`],[`onepkg`,`application/onenote`],[`onetmp`,`application/onenote`],[`onetoc`,`application/onenote`],[`onetoc2`,`application/onenote`],[`opf`,`application/oebps-package+xml`],[`opml`,`text/x-opml`],[`oprc`,`application/vnd.palm`],[`opus`,`audio/ogg`],[`org`,`text/x-org`],[`osf`,`application/vnd.yamaha.openscoreformat`],[`osfpvg`,`application/vnd.yamaha.openscoreformat.osfpvg+xml`],[`osm`,`application/vnd.openstreetmap.data+xml`],[`otc`,`application/vnd.oasis.opendocument.chart-template`],[`otf`,`font/otf`],[`otg`,`application/vnd.oasis.opendocument.graphics-template`],[`oth`,`application/vnd.oasis.opendocument.text-web`],[`oti`,`application/vnd.oasis.opendocument.image-template`],[`otp`,`application/vnd.oasis.opendocument.presentation-template`],[`ots`,`application/vnd.oasis.opendocument.spreadsheet-template`],[`ott`,`application/vnd.oasis.opendocument.text-template`],[`ova`,`application/x-virtualbox-ova`],[`ovf`,`application/x-virtualbox-ovf`],[`owl`,`application/rdf+xml`],[`oxps`,`application/oxps`],[`oxt`,`application/vnd.openofficeorg.extension`],[`p`,`text/x-pascal`],[`p7a`,`application/x-pkcs7-signature`],[`p7b`,`application/x-pkcs7-certificates`],[`p7c`,`application/pkcs7-mime`],[`p7m`,`application/pkcs7-mime`],[`p7r`,`application/x-pkcs7-certreqresp`],[`p7s`,`application/pkcs7-signature`],[`p8`,`application/pkcs8`],[`p10`,`application/x-pkcs10`],[`p12`,`application/x-pkcs12`],[`pac`,`application/x-ns-proxy-autoconfig`],[`pages`,`application/x-iwork-pages-sffpages`],[`pas`,`text/x-pascal`],[`paw`,`application/vnd.pawaafile`],[`pbd`,`application/vnd.powerbuilder6`],[`pbm`,`image/x-portable-bitmap`],[`pcap`,`application/vnd.tcpdump.pcap`],[`pcf`,`application/x-font-pcf`],[`pcl`,`application/vnd.hp-pcl`],[`pclxl`,`application/vnd.hp-pclxl`],[`pct`,`image/x-pict`],[`pcurl`,`application/vnd.curl.pcurl`],[`pcx`,`image/x-pcx`],[`pdb`,`application/x-pilot`],[`pde`,`text/x-processing`],[`pdf`,`application/pdf`],[`pem`,`application/x-x509-user-cert`],[`pfa`,`application/x-font-type1`],[`pfb`,`application/x-font-type1`],[`pfm`,`application/x-font-type1`],[`pfr`,`application/font-tdpfr`],[`pfx`,`application/x-pkcs12`],[`pgm`,`image/x-portable-graymap`],[`pgn`,`application/x-chess-pgn`],[`pgp`,`application/pgp`],[`php`,`application/x-httpd-php`],[`php3`,`application/x-httpd-php`],[`php4`,`application/x-httpd-php`],[`phps`,`application/x-httpd-php-source`],[`phtml`,`application/x-httpd-php`],[`pic`,`image/x-pict`],[`pkg`,`application/octet-stream`],[`pki`,`application/pkixcmp`],[`pkipath`,`application/pkix-pkipath`],[`pkpass`,`application/vnd.apple.pkpass`],[`pl`,`application/x-perl`],[`plb`,`application/vnd.3gpp.pic-bw-large`],[`plc`,`application/vnd.mobius.plc`],[`plf`,`application/vnd.pocketlearn`],[`pls`,`application/pls+xml`],[`pm`,`application/x-perl`],[`pml`,`application/vnd.ctc-posml`],[`png`,`image/png`],[`pnm`,`image/x-portable-anymap`],[`portpkg`,`application/vnd.macports.portpkg`],[`pot`,`application/vnd.ms-powerpoint`],[`potm`,`application/vnd.ms-powerpoint.presentation.macroEnabled.12`],[`potx`,`application/vnd.openxmlformats-officedocument.presentationml.template`],[`ppa`,`application/vnd.ms-powerpoint`],[`ppam`,`application/vnd.ms-powerpoint.addin.macroEnabled.12`],[`ppd`,`application/vnd.cups-ppd`],[`ppm`,`image/x-portable-pixmap`],[`pps`,`application/vnd.ms-powerpoint`],[`ppsm`,`application/vnd.ms-powerpoint.slideshow.macroEnabled.12`],[`ppsx`,`application/vnd.openxmlformats-officedocument.presentationml.slideshow`],[`ppt`,`application/powerpoint`],[`pptm`,`application/vnd.ms-powerpoint.presentation.macroEnabled.12`],[`pptx`,`application/vnd.openxmlformats-officedocument.presentationml.presentation`],[`pqa`,`application/vnd.palm`],[`prc`,`application/x-pilot`],[`pre`,`application/vnd.lotus-freelance`],[`prf`,`application/pics-rules`],[`provx`,`application/provenance+xml`],[`ps`,`application/postscript`],[`psb`,`application/vnd.3gpp.pic-bw-small`],[`psd`,`application/x-photoshop`],[`psf`,`application/x-font-linux-psf`],[`pskcxml`,`application/pskc+xml`],[`pti`,`image/prs.pti`],[`ptid`,`application/vnd.pvi.ptid1`],[`pub`,`application/x-mspublisher`],[`pvb`,`application/vnd.3gpp.pic-bw-var`],[`pwn`,`application/vnd.3m.post-it-notes`],[`pya`,`audio/vnd.ms-playready.media.pya`],[`pyv`,`video/vnd.ms-playready.media.pyv`],[`qam`,`application/vnd.epson.quickanime`],[`qbo`,`application/vnd.intu.qbo`],[`qfx`,`application/vnd.intu.qfx`],[`qps`,`application/vnd.publishare-delta-tree`],[`qt`,`video/quicktime`],[`qwd`,`application/vnd.quark.quarkxpress`],[`qwt`,`application/vnd.quark.quarkxpress`],[`qxb`,`application/vnd.quark.quarkxpress`],[`qxd`,`application/vnd.quark.quarkxpress`],[`qxl`,`application/vnd.quark.quarkxpress`],[`qxt`,`application/vnd.quark.quarkxpress`],[`ra`,`audio/x-realaudio`],[`ram`,`audio/x-pn-realaudio`],[`raml`,`application/raml+yaml`],[`rapd`,`application/route-apd+xml`],[`rar`,`application/x-rar`],[`ras`,`image/x-cmu-raster`],[`rcprofile`,`application/vnd.ipunplugged.rcprofile`],[`rdf`,`application/rdf+xml`],[`rdz`,`application/vnd.data-vision.rdz`],[`relo`,`application/p2p-overlay+xml`],[`rep`,`application/vnd.businessobjects`],[`res`,`application/x-dtbresource+xml`],[`rgb`,`image/x-rgb`],[`rif`,`application/reginfo+xml`],[`rip`,`audio/vnd.rip`],[`ris`,`application/x-research-info-systems`],[`rl`,`application/resource-lists+xml`],[`rlc`,`image/vnd.fujixerox.edmics-rlc`],[`rld`,`application/resource-lists-diff+xml`],[`rm`,`audio/x-pn-realaudio`],[`rmi`,`audio/midi`],[`rmp`,`audio/x-pn-realaudio-plugin`],[`rms`,`application/vnd.jcp.javame.midlet-rms`],[`rmvb`,`application/vnd.rn-realmedia-vbr`],[`rnc`,`application/relax-ng-compact-syntax`],[`rng`,`application/xml`],[`roa`,`application/rpki-roa`],[`roff`,`text/troff`],[`rp9`,`application/vnd.cloanto.rp9`],[`rpm`,`audio/x-pn-realaudio-plugin`],[`rpss`,`application/vnd.nokia.radio-presets`],[`rpst`,`application/vnd.nokia.radio-preset`],[`rq`,`application/sparql-query`],[`rs`,`application/rls-services+xml`],[`rsa`,`application/x-pkcs7`],[`rsat`,`application/atsc-rsat+xml`],[`rsd`,`application/rsd+xml`],[`rsheet`,`application/urc-ressheet+xml`],[`rss`,`application/rss+xml`],[`rtf`,`text/rtf`],[`rtx`,`text/richtext`],[`run`,`application/x-makeself`],[`rusd`,`application/route-usd+xml`],[`rv`,`video/vnd.rn-realvideo`],[`s`,`text/x-asm`],[`s3m`,`audio/s3m`],[`saf`,`application/vnd.yamaha.smaf-audio`],[`sass`,`text/x-sass`],[`sbml`,`application/sbml+xml`],[`sc`,`application/vnd.ibm.secure-container`],[`scd`,`application/x-msschedule`],[`scm`,`application/vnd.lotus-screencam`],[`scq`,`application/scvp-cv-request`],[`scs`,`application/scvp-cv-response`],[`scss`,`text/x-scss`],[`scurl`,`text/vnd.curl.scurl`],[`sda`,`application/vnd.stardivision.draw`],[`sdc`,`application/vnd.stardivision.calc`],[`sdd`,`application/vnd.stardivision.impress`],[`sdkd`,`application/vnd.solent.sdkm+xml`],[`sdkm`,`application/vnd.solent.sdkm+xml`],[`sdp`,`application/sdp`],[`sdw`,`application/vnd.stardivision.writer`],[`sea`,`application/octet-stream`],[`see`,`application/vnd.seemail`],[`seed`,`application/vnd.fdsn.seed`],[`sema`,`application/vnd.sema`],[`semd`,`application/vnd.semd`],[`semf`,`application/vnd.semf`],[`senmlx`,`application/senml+xml`],[`sensmlx`,`application/sensml+xml`],[`ser`,`application/java-serialized-object`],[`setpay`,`application/set-payment-initiation`],[`setreg`,`application/set-registration-initiation`],[`sfd-hdstx`,`application/vnd.hydrostatix.sof-data`],[`sfs`,`application/vnd.spotfire.sfs`],[`sfv`,`text/x-sfv`],[`sgi`,`image/sgi`],[`sgl`,`application/vnd.stardivision.writer-global`],[`sgm`,`text/sgml`],[`sgml`,`text/sgml`],[`sh`,`application/x-sh`],[`shar`,`application/x-shar`],[`shex`,`text/shex`],[`shf`,`application/shf+xml`],[`shtml`,`text/html`],[`sid`,`image/x-mrsid-image`],[`sieve`,`application/sieve`],[`sig`,`application/pgp-signature`],[`sil`,`audio/silk`],[`silo`,`model/mesh`],[`sis`,`application/vnd.symbian.install`],[`sisx`,`application/vnd.symbian.install`],[`sit`,`application/x-stuffit`],[`sitx`,`application/x-stuffitx`],[`siv`,`application/sieve`],[`skd`,`application/vnd.koan`],[`skm`,`application/vnd.koan`],[`skp`,`application/vnd.koan`],[`skt`,`application/vnd.koan`],[`sldm`,`application/vnd.ms-powerpoint.slide.macroenabled.12`],[`sldx`,`application/vnd.openxmlformats-officedocument.presentationml.slide`],[`slim`,`text/slim`],[`slm`,`text/slim`],[`sls`,`application/route-s-tsid+xml`],[`slt`,`application/vnd.epson.salt`],[`sm`,`application/vnd.stepmania.stepchart`],[`smf`,`application/vnd.stardivision.math`],[`smi`,`application/smil`],[`smil`,`application/smil`],[`smv`,`video/x-smv`],[`smzip`,`application/vnd.stepmania.package`],[`snd`,`audio/basic`],[`snf`,`application/x-font-snf`],[`so`,`application/octet-stream`],[`spc`,`application/x-pkcs7-certificates`],[`spdx`,`text/spdx`],[`spf`,`application/vnd.yamaha.smaf-phrase`],[`spl`,`application/x-futuresplash`],[`spot`,`text/vnd.in3d.spot`],[`spp`,`application/scvp-vp-response`],[`spq`,`application/scvp-vp-request`],[`spx`,`audio/ogg`],[`sql`,`application/x-sql`],[`src`,`application/x-wais-source`],[`srt`,`application/x-subrip`],[`sru`,`application/sru+xml`],[`srx`,`application/sparql-results+xml`],[`ssdl`,`application/ssdl+xml`],[`sse`,`application/vnd.kodak-descriptor`],[`ssf`,`application/vnd.epson.ssf`],[`ssml`,`application/ssml+xml`],[`sst`,`application/octet-stream`],[`st`,`application/vnd.sailingtracker.track`],[`stc`,`application/vnd.sun.xml.calc.template`],[`std`,`application/vnd.sun.xml.draw.template`],[`stf`,`application/vnd.wt.stf`],[`sti`,`application/vnd.sun.xml.impress.template`],[`stk`,`application/hyperstudio`],[`stl`,`model/stl`],[`stpx`,`model/step+xml`],[`stpxz`,`model/step-xml+zip`],[`stpz`,`model/step+zip`],[`str`,`application/vnd.pg.format`],[`stw`,`application/vnd.sun.xml.writer.template`],[`styl`,`text/stylus`],[`stylus`,`text/stylus`],[`sub`,`text/vnd.dvb.subtitle`],[`sus`,`application/vnd.sus-calendar`],[`susp`,`application/vnd.sus-calendar`],[`sv4cpio`,`application/x-sv4cpio`],[`sv4crc`,`application/x-sv4crc`],[`svc`,`application/vnd.dvb.service`],[`svd`,`application/vnd.svd`],[`svg`,`image/svg+xml`],[`svgz`,`image/svg+xml`],[`swa`,`application/x-director`],[`swf`,`application/x-shockwave-flash`],[`swi`,`application/vnd.aristanetworks.swi`],[`swidtag`,`application/swid+xml`],[`sxc`,`application/vnd.sun.xml.calc`],[`sxd`,`application/vnd.sun.xml.draw`],[`sxg`,`application/vnd.sun.xml.writer.global`],[`sxi`,`application/vnd.sun.xml.impress`],[`sxm`,`application/vnd.sun.xml.math`],[`sxw`,`application/vnd.sun.xml.writer`],[`t`,`text/troff`],[`t3`,`application/x-t3vm-image`],[`t38`,`image/t38`],[`taglet`,`application/vnd.mynfc`],[`tao`,`application/vnd.tao.intent-module-archive`],[`tap`,`image/vnd.tencent.tap`],[`tar`,`application/x-tar`],[`tcap`,`application/vnd.3gpp2.tcap`],[`tcl`,`application/x-tcl`],[`td`,`application/urc-targetdesc+xml`],[`teacher`,`application/vnd.smart.teacher`],[`tei`,`application/tei+xml`],[`teicorpus`,`application/tei+xml`],[`tex`,`application/x-tex`],[`texi`,`application/x-texinfo`],[`texinfo`,`application/x-texinfo`],[`text`,`text/plain`],[`tfi`,`application/thraud+xml`],[`tfm`,`application/x-tex-tfm`],[`tfx`,`image/tiff-fx`],[`tga`,`image/x-tga`],[`tgz`,`application/x-tar`],[`thmx`,`application/vnd.ms-officetheme`],[`tif`,`image/tiff`],[`tiff`,`image/tiff`],[`tk`,`application/x-tcl`],[`tmo`,`application/vnd.tmobile-livetv`],[`toml`,`application/toml`],[`torrent`,`application/x-bittorrent`],[`tpl`,`application/vnd.groove-tool-template`],[`tpt`,`application/vnd.trid.tpt`],[`tr`,`text/troff`],[`tra`,`application/vnd.trueapp`],[`trig`,`application/trig`],[`trm`,`application/x-msterminal`],[`ts`,`video/mp2t`],[`tsd`,`application/timestamped-data`],[`tsv`,`text/tab-separated-values`],[`ttc`,`font/collection`],[`ttf`,`font/ttf`],[`ttl`,`text/turtle`],[`ttml`,`application/ttml+xml`],[`twd`,`application/vnd.simtech-mindmapper`],[`twds`,`application/vnd.simtech-mindmapper`],[`txd`,`application/vnd.genomatix.tuxedo`],[`txf`,`application/vnd.mobius.txf`],[`txt`,`text/plain`],[`u8dsn`,`message/global-delivery-status`],[`u8hdr`,`message/global-headers`],[`u8mdn`,`message/global-disposition-notification`],[`u8msg`,`message/global`],[`u32`,`application/x-authorware-bin`],[`ubj`,`application/ubjson`],[`udeb`,`application/x-debian-package`],[`ufd`,`application/vnd.ufdl`],[`ufdl`,`application/vnd.ufdl`],[`ulx`,`application/x-glulx`],[`umj`,`application/vnd.umajin`],[`unityweb`,`application/vnd.unity`],[`uoml`,`application/vnd.uoml+xml`],[`uri`,`text/uri-list`],[`uris`,`text/uri-list`],[`urls`,`text/uri-list`],[`usdz`,`model/vnd.usdz+zip`],[`ustar`,`application/x-ustar`],[`utz`,`application/vnd.uiq.theme`],[`uu`,`text/x-uuencode`],[`uva`,`audio/vnd.dece.audio`],[`uvd`,`application/vnd.dece.data`],[`uvf`,`application/vnd.dece.data`],[`uvg`,`image/vnd.dece.graphic`],[`uvh`,`video/vnd.dece.hd`],[`uvi`,`image/vnd.dece.graphic`],[`uvm`,`video/vnd.dece.mobile`],[`uvp`,`video/vnd.dece.pd`],[`uvs`,`video/vnd.dece.sd`],[`uvt`,`application/vnd.dece.ttml+xml`],[`uvu`,`video/vnd.uvvu.mp4`],[`uvv`,`video/vnd.dece.video`],[`uvva`,`audio/vnd.dece.audio`],[`uvvd`,`application/vnd.dece.data`],[`uvvf`,`application/vnd.dece.data`],[`uvvg`,`image/vnd.dece.graphic`],[`uvvh`,`video/vnd.dece.hd`],[`uvvi`,`image/vnd.dece.graphic`],[`uvvm`,`video/vnd.dece.mobile`],[`uvvp`,`video/vnd.dece.pd`],[`uvvs`,`video/vnd.dece.sd`],[`uvvt`,`application/vnd.dece.ttml+xml`],[`uvvu`,`video/vnd.uvvu.mp4`],[`uvvv`,`video/vnd.dece.video`],[`uvvx`,`application/vnd.dece.unspecified`],[`uvvz`,`application/vnd.dece.zip`],[`uvx`,`application/vnd.dece.unspecified`],[`uvz`,`application/vnd.dece.zip`],[`vbox`,`application/x-virtualbox-vbox`],[`vbox-extpack`,`application/x-virtualbox-vbox-extpack`],[`vcard`,`text/vcard`],[`vcd`,`application/x-cdlink`],[`vcf`,`text/x-vcard`],[`vcg`,`application/vnd.groove-vcard`],[`vcs`,`text/x-vcalendar`],[`vcx`,`application/vnd.vcx`],[`vdi`,`application/x-virtualbox-vdi`],[`vds`,`model/vnd.sap.vds`],[`vhd`,`application/x-virtualbox-vhd`],[`vis`,`application/vnd.visionary`],[`viv`,`video/vnd.vivo`],[`vlc`,`application/videolan`],[`vmdk`,`application/x-virtualbox-vmdk`],[`vob`,`video/x-ms-vob`],[`vor`,`application/vnd.stardivision.writer`],[`vox`,`application/x-authorware-bin`],[`vrml`,`model/vrml`],[`vsd`,`application/vnd.visio`],[`vsf`,`application/vnd.vsf`],[`vss`,`application/vnd.visio`],[`vst`,`application/vnd.visio`],[`vsw`,`application/vnd.visio`],[`vtf`,`image/vnd.valve.source.texture`],[`vtt`,`text/vtt`],[`vtu`,`model/vnd.vtu`],[`vxml`,`application/voicexml+xml`],[`w3d`,`application/x-director`],[`wad`,`application/x-doom`],[`wadl`,`application/vnd.sun.wadl+xml`],[`war`,`application/java-archive`],[`wasm`,`application/wasm`],[`wav`,`audio/x-wav`],[`wax`,`audio/x-ms-wax`],[`wbmp`,`image/vnd.wap.wbmp`],[`wbs`,`application/vnd.criticaltools.wbs+xml`],[`wbxml`,`application/wbxml`],[`wcm`,`application/vnd.ms-works`],[`wdb`,`application/vnd.ms-works`],[`wdp`,`image/vnd.ms-photo`],[`weba`,`audio/webm`],[`webapp`,`application/x-web-app-manifest+json`],[`webm`,`video/webm`],[`webmanifest`,`application/manifest+json`],[`webp`,`image/webp`],[`wg`,`application/vnd.pmi.widget`],[`wgt`,`application/widget`],[`wks`,`application/vnd.ms-works`],[`wm`,`video/x-ms-wm`],[`wma`,`audio/x-ms-wma`],[`wmd`,`application/x-ms-wmd`],[`wmf`,`image/wmf`],[`wml`,`text/vnd.wap.wml`],[`wmlc`,`application/wmlc`],[`wmls`,`text/vnd.wap.wmlscript`],[`wmlsc`,`application/vnd.wap.wmlscriptc`],[`wmv`,`video/x-ms-wmv`],[`wmx`,`video/x-ms-wmx`],[`wmz`,`application/x-msmetafile`],[`woff`,`font/woff`],[`woff2`,`font/woff2`],[`word`,`application/msword`],[`wpd`,`application/vnd.wordperfect`],[`wpl`,`application/vnd.ms-wpl`],[`wps`,`application/vnd.ms-works`],[`wqd`,`application/vnd.wqd`],[`wri`,`application/x-mswrite`],[`wrl`,`model/vrml`],[`wsc`,`message/vnd.wfa.wsc`],[`wsdl`,`application/wsdl+xml`],[`wspolicy`,`application/wspolicy+xml`],[`wtb`,`application/vnd.webturbo`],[`wvx`,`video/x-ms-wvx`],[`x3d`,`model/x3d+xml`],[`x3db`,`model/x3d+fastinfoset`],[`x3dbz`,`model/x3d+binary`],[`x3dv`,`model/x3d-vrml`],[`x3dvz`,`model/x3d+vrml`],[`x3dz`,`model/x3d+xml`],[`x32`,`application/x-authorware-bin`],[`x_b`,`model/vnd.parasolid.transmit.binary`],[`x_t`,`model/vnd.parasolid.transmit.text`],[`xaml`,`application/xaml+xml`],[`xap`,`application/x-silverlight-app`],[`xar`,`application/vnd.xara`],[`xav`,`application/xcap-att+xml`],[`xbap`,`application/x-ms-xbap`],[`xbd`,`application/vnd.fujixerox.docuworks.binder`],[`xbm`,`image/x-xbitmap`],[`xca`,`application/xcap-caps+xml`],[`xcs`,`application/calendar+xml`],[`xdf`,`application/xcap-diff+xml`],[`xdm`,`application/vnd.syncml.dm+xml`],[`xdp`,`application/vnd.adobe.xdp+xml`],[`xdssc`,`application/dssc+xml`],[`xdw`,`application/vnd.fujixerox.docuworks`],[`xel`,`application/xcap-el+xml`],[`xenc`,`application/xenc+xml`],[`xer`,`application/patch-ops-error+xml`],[`xfdf`,`application/vnd.adobe.xfdf`],[`xfdl`,`application/vnd.xfdl`],[`xht`,`application/xhtml+xml`],[`xhtml`,`application/xhtml+xml`],[`xhvml`,`application/xv+xml`],[`xif`,`image/vnd.xiff`],[`xl`,`application/excel`],[`xla`,`application/vnd.ms-excel`],[`xlam`,`application/vnd.ms-excel.addin.macroEnabled.12`],[`xlc`,`application/vnd.ms-excel`],[`xlf`,`application/xliff+xml`],[`xlm`,`application/vnd.ms-excel`],[`xls`,`application/vnd.ms-excel`],[`xlsb`,`application/vnd.ms-excel.sheet.binary.macroEnabled.12`],[`xlsm`,`application/vnd.ms-excel.sheet.macroEnabled.12`],[`xlsx`,`application/vnd.openxmlformats-officedocument.spreadsheetml.sheet`],[`xlt`,`application/vnd.ms-excel`],[`xltm`,`application/vnd.ms-excel.template.macroEnabled.12`],[`xltx`,`application/vnd.openxmlformats-officedocument.spreadsheetml.template`],[`xlw`,`application/vnd.ms-excel`],[`xm`,`audio/xm`],[`xml`,`application/xml`],[`xns`,`application/xcap-ns+xml`],[`xo`,`application/vnd.olpc-sugar`],[`xop`,`application/xop+xml`],[`xpi`,`application/x-xpinstall`],[`xpl`,`application/xproc+xml`],[`xpm`,`image/x-xpixmap`],[`xpr`,`application/vnd.is-xpr`],[`xps`,`application/vnd.ms-xpsdocument`],[`xpw`,`application/vnd.intercon.formnet`],[`xpx`,`application/vnd.intercon.formnet`],[`xsd`,`application/xml`],[`xsl`,`application/xml`],[`xslt`,`application/xslt+xml`],[`xsm`,`application/vnd.syncml+xml`],[`xspf`,`application/xspf+xml`],[`xul`,`application/vnd.mozilla.xul+xml`],[`xvm`,`application/xv+xml`],[`xvml`,`application/xv+xml`],[`xwd`,`image/x-xwindowdump`],[`xyz`,`chemical/x-xyz`],[`xz`,`application/x-xz`],[`yaml`,`text/yaml`],[`yang`,`application/yang`],[`yin`,`application/yin+xml`],[`yml`,`text/yaml`],[`ymp`,`text/x-suse-ymp`],[`z`,`application/x-compress`],[`z1`,`application/x-zmachine`],[`z2`,`application/x-zmachine`],[`z3`,`application/x-zmachine`],[`z4`,`application/x-zmachine`],[`z5`,`application/x-zmachine`],[`z6`,`application/x-zmachine`],[`z7`,`application/x-zmachine`],[`z8`,`application/x-zmachine`],[`zaz`,`application/vnd.zzazz.deck+xml`],[`zip`,`application/zip`],[`zir`,`application/vnd.zul`],[`zirz`,`application/vnd.zul`],[`zmm`,`application/vnd.handheld-entertainment+xml`],[`zsh`,`text/x-scriptzsh`]]);function 
494U0(e,t,n){let r=Pfe(e),{webkitRelativePath:i}=e,a=typeof t==`string`?t:typeof i==`string`&&i.length>0?i:`./${e.name}`;return typeof r.path!=`string`&&W0(r,`path`,a),n!==void 0&&Object.defineProperty(r,`handle`,{value:n,writable:!1,
494configurable:!1,enumerable:!0}),W0(r,`relativePath`,a),r}function Pfe(e){let{name:t}=e;if(t&&t.lastIndexOf(`.`)!==-1&&!e.type){let n=t.split(`.`).pop().toLowerCase(),r=Nfe.get(n);r&&Object.defineProperty(e,`type`,{value:r,writable:!1,configurable:!1,enumerable:!0})}return e}function W0(e,t,n){Object.defineProperty(e,t,{value:n,writable:!1,configurable:!1,enumerable:!0})}var Ffe=[`.DS_Store`,`Thumbs.db`];function Ife(e){return ME(this,void 0,void 0,function*(){return G0(e)&&Lfe(e.dataTransfer)?Vfe(e.dataTransfer,e.type):Rfe(e)?zfe(e):Array.isArray(e)&&e.every(e=>`getFile`in e&&typeof e.getFile==`function`)?Bfe(e):[]})}function Lfe(e){return G0(e)}function Rfe(e){return G0(e)&&G0(e.target)}function G0(e){return typeof e==`object`&&!!e}function zfe(e){return q0(e.target.files).map(e=>U0(e))}function Bfe(e){return ME(this,void 0,void 0,function*(){return(yield Promise.all(e.map(e=>e.getFile()))).map(e=>U0(e))})}function Vfe(e,t){return ME(this,void 0,void 0,function*(){if(e.items){let n=q0(e.items).filter(e=>e.kind===`file`);return t===`drop`?K0(J0(yield Promise.all(n.map(Hfe)))):n}return K0(q0(e.files).map(e=>U0(e)))})}function K0(e){return e.filter(e=>Ffe.indexOf(e.name)===-1)}function q0(e){if(e===null)return[];let t=[];for(let n=0;n<e.length;n++){let r=e[n];t.push(r)}return t}function Hfe(e){if(typeof e.webkitGetAsEntry!=`function`)return Y0(e);let t=e.webkitGetAsEntry();return t&&t.isDirectory?X0(t):Y0(e,t)}function J0(e){return e.reduce((e,t)=>[...e,...Array.isArray(t)?J0(t):[t]],[])}function Y0(e,t){return ME(this,void 0,void 0,function*(){if(globalThis.isSecureContext&&typeof e.getAsFileSystemHandle==`function`){let t=yield e.getAsFileSystemHandle();if(t===null)throw Error(`${e} is not a File`);if(t!==void 0){let e=yield t.getFile();return e.handle=t,U0(e)}}let n=e.getAsFile();if(!n)throw Error(`${e} is not a File`);return U0(n,t?.fullPath??void 0)})}function Ufe(e){return ME(this,void 0,void 0,function*(){return e.isDirectory?X0(e):Wfe(e)})}function X0(e){let t=e.createReader();return new Promise((e,n)=>{let r=[];function i(){t.readEntries(t=>ME(this,void 0,void 0,function*(){if(t.length){let e=Promise.all(t.map(Ufe));r.push(e),i()}else try{e(yield Promise.all(r))}catch(e){n(e)}}),e=>{n(e)})}i()})}function Wfe(e){return ME(this,void 0,void 0,function*(){return new Promise((t,n)=>{e.file(n=>{t(U0(n,e.fullPath))},e=>{n(e)})})})}var Gfe=n((e=>{e.__esModule=!0,e.default=function(e,t){if(e&&t){var n=Array.isArray(t)?t:t.split(`,`);if(n.length===0)return!0;var r=e.name||``,i=(e.type||``).toLowerCase(),a=i.replace(/\/.*$/,``);return n.some(function(e){var t=e.trim().toLowerCase();return t.charAt(0)===`.`?r.toLowerCase().endsWith(t):t.endsWith(`/*`)?a===t.replace(/\/.*$/,``):i===t})}return!0}})),Z0=r(H0()),Q0=r(Gfe());function $0(e){return Jfe(e)||qfe(e)||i2(e)||Kfe()}function Kfe(){throw TypeError(`Invalid attempt to spread non-iterable instance.
495In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function qfe(e){if(typeof Symbol<`u`&&e[Symbol.iterator]!=null||e[`@@iterator`]!=null)return Array.from(e)}function Jfe(e){if(Array.isArray(e))return a2(e)}function e2(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function t2(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?e2(Object(n),!0).forEach(function(t){n2(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):e2(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function n2(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function r2(e,t){return Zfe(e)||Xfe(e,t)||i2(e,t)||Yfe()}function Yfe(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
496In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function i2(e,t){if(e){if(typeof e==`string`)return a2(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`)return Array.from(e);if(n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return a2(e,t)}}function a2(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Xfe(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r=[],i=!0,a=!1,o,s;try{for(n=n.call(e);!(i=(o=n.next()).done)&&(r.push(o.value),!(t&&r.length===t));i=!0);}catch(e){a=!0,s=e}finally{try{!i&&n.return!=null&&n.return()}finally{if(a)throw s}}return r}}function Zfe(e){if(Array.isArray(e))return e}var Qfe=typeof Q0.default==`function`?Q0.default:Q0.default.default,$fe=`file-invalid-type`,epe=`file-too-large`,tpe=`file-too-small`,
496npe=`too-many-files`,rpe=function(){var e=(arguments.length>0&&arguments[0]!==void 0?arguments[0]:``).split(`,`);return{code:$fe,message:`File type must be ${e.length>1?`one of ${e.join(`, `)}`:e[0]}`}},o2=function(e){return{code:epe,message:`File is larger than ${e} ${e===1?`byte`:`bytes`}`}},s2=function(e){return{code:tpe,message:`File is smaller than ${e} ${e===1?`byte`:`bytes`}`}},ipe={code:npe,message:`Too many files`};function ape(e){return e.type===``&&typeof e.getAsFile==`function`}function c2(e,t){var n=e.type===`application/x-moz-file`||Qfe(e,t)||ape(e);return[n,n?null:rpe(t)]}function l2(e,t,n){if(u2(e.size)){if(u2(t)&&u2(n)){if(e.size>n)return[!1,o2(n)];if(e.size<t)return[!1,s2(t)]}else if(u2(t)&&e.size<t)return[!1,s2(t)];else if(u2(n)&&e.size>n)return[!1,o2(n)]}return[!0,null]}function u2(e){return e!=null}function ope(e){var t=e.files,n=e.accept,r=e.minSize,i=e.maxSize,a=e.multiple,o=e.maxFiles,s=e.validator;return!a&&t.length>1||a&&o>=1&&t.length>o?!1:t.every(function(e){var t=r2(c2(e,n),1)[0],a=r2(l2(e,r,i),1)[0],o=s?s(e):null;return t&&a&&!o})}function d2(e){return typeof e.isPropagationStopped==`function`?e.isPropagationStopped():e.cancelBubble===void 0?!1:e.cancelBubble}function f2(e){return e.dataTransfer?Array.prototype.some.call(e.dataTransfer.types,function(e){return e===`Files`||e===`application/x-moz-file`}):!!e.target&&!!e.target.files}function p2(e){e.preventDefault()}function spe(e){return e.indexOf(`MSIE`)!==-1||e.indexOf(`Trident/`)!==-1}function cpe(e){return e.indexOf(`Edge/`)!==-1}function lpe(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:window.navigator.userAgent;return spe(e)||cpe(e)}function m2(){var e=[...arguments];return function(t){var n=[...arguments].slice(1);return e.some(function(e){return!d2(t)&&e&&e.apply(void 0,[t].concat(n)),d2(t)})}}function upe(){return`showOpenFilePicker`in window}function dpe(e){return u2(e)?[{description:`Files`,accept:Object.entries(e).filter(function(e){var t=r2(e,2),n=t[0],r=t[1],i=!0;return h2(n)||(console.warn(`Skipped "${n}" because it is not a valid MIME type. Check https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Common_types for a list of valid MIME types.`),i=!1),(!Array.isArray(r)||!r.every(g2))&&(console.warn(`Skipped "${n}" because an invalid file extension was provided.`),i=!1),i}).reduce(function(e,t){var n=r2(t,2),r=n[0],i=n[1];return t2(t2({},e),{},n2({},r,i))},{})}]:e}function fpe(e){if(u2(e))return Object.entries(e).reduce(function(e,t){var n=r2(t,2),r=n[0],i=n[1];return[].concat($0(e),[r],$0(i))},[]).filter(function(e){return h2(e)||g2(e)}).join(`,`)}function ppe(e){return e instanceof DOMException&&(e.name===`AbortError`||e.code===e.ABORT_ERR)}function mpe(e){return e instanceof DOMException&&(e.name===`SecurityError`||e.code===e.SECURITY_ERR)}function h2(e){return e===`audio/*`||e===`video/*`||e===`image/*`||e===`text/*`||e===`application/*`||/\w+\/[-+.\w]+/g.test(e)}function g2(e){return/^.*\.[\w]+$/.test(e)}var hpe=[`children`],gpe=[`open`],_pe=[`refKey`,`role`,`onKeyDown`,`onFocus`,`onBlur`,`onClick`,`onDragEnter`,`onDragOver`,`onDragLeave`,`onDrop`],vpe=[`refKey`,`onChange`,`onClick`];function _2(e){return xpe(e)||bpe(e)||y2(e)||ype()}function ype(){throw TypeError(`Invalid attempt to spread non-iterable instance.
497In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function bpe(e){if(typeof Symbol<`u`&&e[Symbol.iterator]!=null||e[`@@iterator`]!=null)return Array.from(e)}function xpe(e){if(Array.isArray(e))return b2(e)}function v2(e,t){return wpe(e)||Cpe(e,t)||y2(e,t)||Spe()}function Spe(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
498In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function y2(e,t){if(e){if(typeof e==`string`)return b2(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`)return Array.from(e);if(n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return b2(e,t)}}function b2(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Cpe(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r=[],i=!0,a=!1,o,s;try{for(n=n.call(e);!(i=(o=n.next()).done)&&(r.push(o.value),!(t&&r.length===t));i=!0);}catch(e){a=!0,s=e}finally{try{!i&&n.return!=null&&n.return()}finally{if(a)throw s}}return r}}function wpe(e){if(Array.isArray(e))return e}function x2(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function S2(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];
498t%2?x2(Object(n),!0).forEach(function(t){C2(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):x2(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function C2(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function w2(e,t){if(e==null)return{};var n=Tpe(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Tpe(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,a;for(a=0;a<r.length;a++)i=r[a],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}var T2=(0,d.forwardRef)(function(e,t){var n=e.children,r=O2(w2(e,hpe)),i=r.open,a=w2(r,gpe);return(0,d.useImperativeHandle)(t,function(){return{open:i}},[i]),d.createElement(d.Fragment,null,n(S2(S2({},a),{},{open:i})))});T2.displayName=`Dropzone`;var E2={disabled:!1,getFilesFromEvent:Ife,maxSize:1/0,minSize:0,multiple:!0,maxFiles:0,preventDropOnDocument:!0,noClick:!1,noKeyboard:!1,noDrag:!1,noDragEventsBubbling:!1,validator:null,useFsAccessApi:!1,autoFocus:!1};T2.defaultProps=E2,T2.propTypes={children:Z0.default.func,accept:Z0.default.objectOf(Z0.default.arrayOf(Z0.default.string)),multiple:Z0.default.bool,preventDropOnDocument:Z0.default.bool,noClick:Z0.default.bool,noKeyboard:Z0.default.bool,noDrag:Z0.default.bool,noDragEventsBubbling:Z0.default.bool,minSize:Z0.default.number,maxSize:Z0.default.number,maxFiles:Z0.default.number,disabled:Z0.default.bool,getFilesFromEvent:Z0.default.func,onFileDialogCancel:Z0.default.func,onFileDialogOpen:Z0.default.func,useFsAccessApi:Z0.default.bool,autoFocus:Z0.default.bool,onDragEnter:Z0.default.func,onDragLeave:Z0.default.func,onDragOver:Z0.default.func,onDrop:Z0.default.func,onDropAccepted:Z0.default.func,onDropRejected:Z0.default.func,onError:Z0.default.func,validator:Z0.default.func};var D2={isFocused:!1,isFileDialogActive:!1,isDragActive:!1,isDragAccept:!1,isDragReject:!1,isDragGlobal:!1,acceptedFiles:[],fileRejections:[]};function O2(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=S2(S2({},E2),e),n=t.accept,r=t.disabled,i=t.getFilesFromEvent,a=t.maxSize,o=t.minSize,s=t.multiple,c=t.maxFiles,l=t.onDragEnter,u=t.onDragLeave,f=t.onDragOver,p=t.onDrop,m=t.onDropAccepted,h=t.onDropRejected,g=t.onFileDialogCancel,_=t.onFileDialogOpen,v=t.useFsAccessApi,y=t.autoFocus,b=t.preventDropOnDocument,x=t.noClick,S=t.noKeyboard,C=t.noDrag,w=t.noDragEventsBubbling,T=t.onError,E=t.validator,D=(0,d.useMemo)(function(){return fpe(n)},[n]),O=(0,d.useMemo)(function(){return dpe(n)},[n]),k=(0,d.useMemo)(function(){return typeof _==`function`?_:k2},[_]),A=(0,d.useMemo)(function(){return typeof g==`function`?g:k2},[g]),j=(0,d.useRef)(null),M=(0,d.useRef)(null),N=v2((0,d.useReducer)(Epe,D2),2),P=N[0],ee=N[1],F=P.isFocused,te=P.isFileDialogActive,ne=(0,d.useRef)(typeof window<`u`&&window.isSecureContext&&v&&upe()),re=function(){!ne.current&&te&&setTimeout(function(){M.current&&(M.current.files.length||(ee({type:`closeDialog`}),A()))},300)};(0,d.useEffect)(function(){return window.addEventListener(`focus`,re,!1),function(){window.removeEventListener(`focus`,re,!1)}},[M,te,A,ne]);var I=(0,d.useRef)([]),ie=(0,d.useRef)([]),ae=function(e){j.current&&j.current.contains(e.target)||(e.preventDefault(),I.current=[])};(0,d.useEffect)(function(){return b&&(document.addEventListener(`dragover`,p2,!1),document.addEventListener(`drop`,ae,!1)),function(){b&&(document.removeEventListener(`dragover`,p2),document.removeEventListener(`drop`,ae))}},[j,b]),(0,d.useEffect)(function(){var e=function(e){ie.current=[].concat(_2(ie.current),[e.target]),f2(e)&&ee({isDragGlobal:!0,type:`setDragGlobal`})},t=function(e){ie.current=ie.current.filter(function(t){return t!==e.target&&t!==null}),!(ie.current.length>0)&&ee({isDragGlobal:!1,type:`setDragGlobal`})},n=function(){ie.current=[],ee({isDragGlobal:!1,type:`setDragGlobal`})},r=function(){ie.current=[],ee({isDragGlobal:!1,type:`setDragGlobal`})};return document.addEventListener(`dragenter`,e,!1),document.addEventListener(`dragleave`,t,!1),document.addEventListener(`dragend`,n,!1),document.addEventListener(`drop`,r,!1),function(){document.removeEventListener(`dragenter`,e),document.removeEventListener(`dragleave`,t),document.removeEventListener(`dragend`,n),document.removeEventListener(`drop`,r)}},[j]),(0,d.useEffect)(function(){return!r&&y&&j.current&&j.current.focus(),function(){}},[j,y,r]);var oe=(0,d.useCallback)(function(e){T?T(e):console.error(e)},[T]),L=(0,d.useCallback)(function(e){e.preventDefault(),e.persist(),ye(e),I.current=[].concat(_2(I.current),[e.target]),f2(e)&&Promise.resolve(i(e)).then(function(t){if(!(d2(e)&&!w)){var n=t.length,r=n>0&&ope({files:t,accept:D,minSize:o,maxSize:a,multiple:s,maxFiles:c,validator:E});ee({isDragAccept:r,isDragReject:n>0&&!r,isDragActive:!0,type:`setDraggedFiles`}),l&&l(e)}}).catch(function(e){return oe(e)})},[i,l,oe,w,D,o,a,s,c,E]),se=(0,d.useCallback)(function(e){e.preventDefault(),e.persist(),ye(e);var t=f2(e);if(t&&e.dataTransfer)try{e.dataTransfer.dropEffect=`copy`}catch{}return t&&f&&f(e),!1},[f,w]),ce=(0,d.useCallback)(function(e){e.preventDefault(),e.persist(),ye(e);var t=I.current.filter(function(e){return j.current&&j.current.contains(e)}),n=t.indexOf(e.target);n!==-1&&t.splice(n,1),I.current=t,!(t.length>0)&&(ee({type:`setDraggedFiles`,isDragActive:!1,isDragAccept:!1,isDragReject:!1}),f2(e)&&u&&u(e))},[j,u,w]),le=(0,d.useCallback)(function(e,t){var n=[],r=[];e.forEach(function(e){var t=v2(c2(e,D),2),i=t[0],s=t[1],c=v2(l2(e,o,a),2),l=c[0],u=c[1],d=E?E(e):null;if(i&&l&&!d)n.push(e);else{var f=[s,u];d&&(f=f.concat(d)),r.push({file:e,errors:f.filter(function(e){return e})})}}),(!s&&n.length>1||s&&c>=1&&n.length>c)&&(n.forEach(function(e){r.push({file:e,errors:[ipe]})}),n.splice(0)),ee({acceptedFiles:n,fileRejections:r,isDragReject:r.length>0,type:`setFiles`}),p&&p(n,r,t),r.length>0&&h&&h(r,t),n.length>0&&m&&m(n,t)},[ee,s,D,o,a,c,p,m,h,E]),ue=(0,d.useCallback)(function(e){e.preventDefault(),e.persist(),ye(e),I.current=[],f2(e)&&Promise.resolve(i(e)).then(function(t){d2(e)&&!w||le(t,e)}).catch(function(e){return oe(e)}),ee({type:`reset`})},[i,le,oe,w]),de=(0,d.useCallback)(function(){if(ne.current){ee({type:`openDialog`}),k();var e={multiple:s,types:O};window.showOpenFilePicker(e).then(function(e){return i(e)}).then(function(e){le(e,null),ee({type:`closeDialog`})}).catch(function(e){ppe(e)?(A(e),ee({type:`closeDialog`})):mpe(e)?(ne.current=!1,M.current?(M.current.value=null,M.current.click()):oe(Error(`Cannot open the file picker because the https://developer.mozilla.org/en-US/docs/Web/API/File_System_Access_API is not supported and no <input> was provided.`))):oe(e)});return}M.current&&(ee({type:`openDialog`}),k(),M.current.value=null,M.current.click())},[ee,k,A,v,le,oe,O,s]),fe=(0,d.useCallback)(function(e){!j.current||!j.current.isEqualNode(e.target)||(e.key===` `||e.key===`Enter`||e.keyCode===32||e.keyCode===13)&&(e.preventDefault(),de())},[j,de]),pe=(0,d.useCallback)(function(){ee({type:`focus`})},[]),me=(0,d.useCallback)(function(){ee({type:`blur`})},[]),he=(0,d.useCallback)(function(){x||(lpe()?setTimeout(de,0):de())},[x,de]),ge=function(e){return r?null:e},_e=function(e){return S?null:ge(e)},ve=function(e){return C?null:ge(e)},ye=function(e){w&&e.stopPropagation()},be=(0,d.useMemo)(function(){return function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=e.refKey,n=t===void 0?`ref`:t,i=e.role,a=e.onKeyDown,o=e.onFocus,s=e.onBlur,c=e.onClick,l=e.onDragEnter,u=e.onDragOver,d=e.onDragLeave,f=e.onDrop,p=w2(e,_pe);return S2(S2(C2({onKeyDown:_e(m2(a,fe)),onFocus:_e(m2(o,pe)),onBlur:_e(m2(s,me)),onClick:ge(m2(c,he)),onDragEnter:ve(m2(l,L)),onDragOver:ve(m2(u,se)),onDragLeave:ve(m2(d,ce)),onDrop:ve(m2(f,ue)),role:typeof i==`string`&&i!==``?i:`presentation`},n,j),!r&&!S?{tabIndex:0}:{}),p)}},[j,fe,pe,me,he,L,se,ce,ue,S,C,r]),xe=(0,d.useCallback)(function(e){e.stopPropagation()},[]),Se=(0,d.useMemo)(function(){return function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=e.refKey,n=t===void 0?`ref`:t,r=e.onChange,i=e.onClick,a=w2(e,vpe);return S2(S2({},C2({accept:D,multiple:s,type:`file`,style:{border:0,clip:`rect(0, 0, 0, 0)`,clipPath:`inset(50%)`,height:`1px`,margin:`0 -1px -1px 0`,overflow:`hidden`,padding:0,position:`absolute`,width:`1px`,whiteSpace:`nowrap`},onChange:ge(m2(r,ue)),onClick:ge(m2(i,xe)),tabIndex:-1},n,M)),a)}},[M,n,s,ue,r]);return S2(S2({},P),{}
498,{isFocused:F&&!r,getRootProps:be,getInputProps:Se,rootRef:j,inputRef:M,open:ge(de)})}function Epe(e,t){switch(t.type){case`focus`:return S2(S2({},e),{},{isFocused:!0});case`blur`:return S2(S2({},e),{},{isFocused:!1});case`openDialog`:return S2(S2({},D2),{},{isFileDialogActive:!0});case`closeDialog`:return S2(S2({},e),{},{isFileDialogActive:!1});case`setDraggedFiles`:return S2(S2({},e),{},{isDragActive:t.isDragActive,isDragAccept:t.isDragAccept,isDragReject:t.isDragReject});case`setFiles`:return S2(S2({},e),{},{acceptedFiles:t.acceptedFiles,fileRejections:t.fileRejections,isDragReject:t.isDragReject});case`setDragGlobal`:return S2(S2({},e),{},{isDragGlobal:t.isDragGlobal});case`reset`:return S2({},D2);default:return e}}function k2(){}var A2=0,j2=1,M2=2,N2=4;function P2(e,t){return function(n){return e(t(n))}}function Dpe(e,t){return t(e)}function F2(e,t){return function(n){return e(t,n)}}function I2(e,t){return function(){return e(t)}}function L2(e,t){return t(e),e}function R2(){return[...arguments]}function Ope(e){e()}function z2(e){return function(){return e}}function kpe(){var e=[...arguments];return function(){e.map(Ope)}}function B2(){}function V2(e,t){return e(j2,t)}function H2(e,t){e(A2,t)}function U2(e){e(M2)}function W2(e){return e(N2)}function G2(e,t){return V2(e,F2(t,A2))}function K2(e,t){var n=e(j2,function(e){n(),t(e)});return n}function q2(){var e=[];return function(t,n){switch(t){case M2:e.splice(0,e.length);return;case j2:return e.push(n),function(){var t=e.indexOf(n);t>-1&&e.splice(t,1)};case A2:e.slice().forEach(function(e){e(n)});return;default:throw Error(`unrecognized action `+t)}}}function Q(e){var t=e,n=q2();return function(e,r){switch(e){case j2:r(t);break;case A2:t=r;break;case N2:return t}return n(e,r)}}function Ape(e){var t,n,r=function(){return t&&t()};return function(i,a){switch(i){case j2:return a?n===a?void 0:(r(),n=a,t=V2(e,a),t):(r(),B2);case M2:r(),n=null;return;default:throw Error(`unrecognized action `+i)}}}function J2(e){return L2(q2(),function(t){return G2(e,t)})}function Y2(e,t){return L2(Q(t),function(t){return G2(e,t)})}function jpe(){var e=[...arguments];return function(t){return e.reduceRight(Dpe,t)}}function $(e){var t=[...arguments].slice(1),n=jpe.apply(void 0,t);return function(t,r){switch(t){case j2:return V2(e,n(r));case M2:U2(e);return;default:throw Error(`unrecognized action `+t)}}}function X2(e,t){return e===t}function Z2(e){e===void 0&&(e=X2);var t;return function(n){return function(r){e(t,r)||(t=r,n(r))}}}function Q2(e){return function(t){return function(n){e(n)&&t(n)}}}function $2(e){return function(t){return P2(t,e)}}function e4(e){return function(t){return function(){return t(e)}}}function t4(e,t){return function(n){return function(r){return n(t=e(t,r))}}}function n4(e){return function(t){return function(n){e>0?e--:t(n)}}}function r4(e){var t,n;return function(r){return function(i){t=i,!n&&(n=setTimeout(function(){n=void 0,r(t)},e))}}}function i4(e){var t,n;return function(r){return function(i){t=i,n&&clearTimeout(n),n=setTimeout(function(){r(t)},e)}}}function a4(){var e=[...arguments],t=Array(e.length),n=0,r=null,i=2**e.length-1;return e.forEach(function(e,a){var o=2**a;V2(e,function(e){var s=n;n|=o,t[a]=e,s!==i&&n===i&&r&&(r(),r=null)})}),function(e){return function(a){var o=function(){return e([a].concat(t))};n===i?o():r=o}}}function o4(){var e=[...arguments];return function(t,n){switch(t){case j2:return kpe.apply(void 0,e.map(function(e){return V2(e,n)}));case M2:return;default:throw Error(`unrecognized action `+t)}}}function s4(e,t){return t===void 0&&(t=X2),$(e,Z2(t))}function c4(){var e=q2(),t=[...arguments],n=Array(t.length),r=0,i=2**t.length-1;return t.forEach(function(t,a){var o=2**a;V2(t,function(t){n[a]=t,r|=o,r===i&&H2(e,n)})}),function(t,a){switch(t){case j2:return r===i&&a(n),V2(e,a);case M2:return U2(e);default:throw Error(`unrecognized action `+t)}}}function l4(e,t,n){t===void 0&&(t=[]);var r=(n===void 0?{singleton:!0}:n).singleton;return{id:Mpe(),constructor:e,dependencies:t,singleton:r}}var Mpe=function(){return Symbol()};function Npe(e){var t=new Map;return function e(n){var r=n.id,i=n.constructor,a=n.dependencies,o=n.singleton;if(o&&t.has(r))return t.get(r);var s=i(a.map(function(t){return e(t)}));return o&&t.set(r,s),s}(e)}function Ppe(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,a;for(a=0;a<r.length;a++)i=r[a],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}function Fpe(e,t){if(e){if(typeof e==`string`)return u4(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`)return Array.from(e);if(n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return u4(e,t)}}function u4(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function d4(e,t){var n=typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=Fpe(e))||t&&e&&typeof e.length==`number`){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw TypeError(`Invalid attempt to iterate non-iterable instance.
499In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var Ipe=[`children`];function Lpe(e,t){for(var n={},r={},i=0,a=e.length;i<a;)r[e[i]]=1,i+=1;
499for(var o in t)r.hasOwnProperty(o)||(n[o]=t[o]);return n}var f4=typeof document<`u`?d.useLayoutEffect:d.useEffect;function p4(e,t,n){var r=Object.keys(t.required||{}),i=Object.keys(t.optional||{}),a=Object.keys(t.methods||{}),o=Object.keys(t.events||{}),s=(0,d.createContext)({});function c(e,n){e.propsReady&&H2(e.propsReady,!1);for(var a=d4(r),o;!(o=a()).done;){var s=o.value,c=e[t.required[s]];H2(c,n[s])}for(var l=d4(i),u;!(u=l()).done;){var d=u.value;if(d in n){var f=e[t.optional[d]];H2(f,n[d])}}e.propsReady&&H2(e.propsReady,!0)}function l(e){return a.reduce(function(n,r){return n[r]=function(n){var i=e[t.methods[r]];H2(i,n)},n},{})}function u(e){return o.reduce(function(n,r){return n[r]=Ape(e[t.events[r]]),n},{})}return{Component:(0,d.forwardRef)(function(t,a){var f=t.children,p=Ppe(t,Ipe),m=(0,d.useState)(function(){return L2(Npe(e),function(e){return c(e,p)})})[0],h=(0,d.useState)(I2(u,m))[0];return f4(function(){for(var e=d4(o),t;!(t=e()).done;){var n=t.value;n in p&&V2(h[n],p[n])}return function(){Object.values(h).map(U2)}},[p,h,m]),f4(function(){c(m,p)}),(0,d.useImperativeHandle)(a,z2(l(m))),(0,d.createElement)(s.Provider,{value:m},n?(0,d.createElement)(n,Lpe([].concat(r,i,o),p),f):f)}),usePublisher:function(e){return(0,d.useCallback)(F2(H2,(0,d.useContext)(s)[e]),[e])},useEmitterValue:function(e){var t=(0,d.useContext)(s)[e],n=(0,d.useState)(I2(W2,t)),r=n[0],i=n[1];return f4(function(){return V2(t,function(e){e!==r&&i(z2(e))})},[t,r]),r},useEmitter:function(e,t){var n=(0,d.useContext)(s)[e];f4(function(){return V2(n,t)},[t,n])}}}function m4(){return m4=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},m4.apply(this,arguments)}function h4(e,t){if(e==null)return{};var n,r,i={},a=Object.keys(e);for(r=0;r<a.length;r++)t.indexOf(n=a[r])>=0||(i[n]=e[n]);return i}function g4(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function _4(e,t){var n=typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(e){if(typeof e==`string`)return g4(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?g4(e,t):void 0}}(e))||t&&e&&typeof e.length==`number`){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw TypeError(`Invalid attempt to iterate non-iterable instance.
500In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var v4,y4,Rpe=typeof document<`u`?d.useLayoutEffect:d.useEffect;(function(e){e[e.DEBUG=0]=`DEBUG`,e[e.INFO=1]=`INFO`,e[e.WARN=2]=`WARN`,e[e.ERROR=3]=`ERROR`})(y4||={});var zpe=((v4={})[y4.DEBUG]=`debug`,v4[y4.INFO]=`log`,v4[y4.WARN]=`warn`,v4[y4.ERROR]=`error`,v4),b4=l4(function(){var e=Q(y4.ERROR);return{log:Q(function(t,n,r){r===void 0&&(r=y4.INFO),r>=((typeof globalThis>`u`?window:globalThis).VIRTUOSO_LOG_LEVEL??W2(e))&&console[zpe[r]](`%creact-virtuoso: %c%s %o`,`color: #0253b3; font-weight: bold`,`color: initial`,t,n)}),logLevel:e}},[],{singleton:!0});function x4(e,t){t===void 0&&(t=!0);var n=(0,d.useRef)(null),r=function(e){};if(typeof ResizeObserver<`u`){var i=new ResizeObserver(function(t){var n=t[0].target;n.offsetParent!==null&&e(n)});r=function(e){e&&t?(i.observe(e),n.current=e):(n.current&&i.unobserve(n.current),n.current=null)}}return{ref:n,callbackRef:r}}function S4(e,t){return t===void 0&&(t=!0),x4(e,t).callbackRef}function C4(e,t,n,r,i,a,o){return x4(function(n){for(var s=function(e,t,n,r){var i=e.length;if(i===0)return null;for(var a=[],o=0;o<i;o++){var s=e.item(o);if(s&&s.dataset.index!==void 0){var c=parseInt(s.dataset.index),l=parseFloat(s.dataset.knownSize),u=t(s,`offsetHeight`);if(u===0&&r(`Zero-sized element, this should not happen`,{child:s},y4.ERROR),u!==l){var d=a[a.length-1];a.length===0||d.size!==u||d.endIndex!==c-1?a.push({startIndex:c,endIndex:c,size:u}):a[a.length-1].endIndex++}}}return a}(n.children,t,0,i),c=n.parentElement;!c.dataset.virtuosoScroller;)c=c.parentElement;var l=c.firstElementChild.dataset.viewportType===`window`,u=o?o.scrollTop:l?window.pageYOffset||document.documentElement.scrollTop:c.scrollTop,d=o?o.scrollHeight:l?document.documentElement.scrollHeight:c.scrollHeight,f=o?o.offsetHeight:l?window.innerHeight:c.offsetHeight;
500r({scrollTop:Math.max(u,0),scrollHeight:d,viewportHeight:f}),a?.(function(e,t,n){return t===`normal`||t!=null&&t.endsWith(`px`)||n(`row-gap was not resolved to pixel value correctly`,t,y4.WARN),t===`normal`?0:parseInt(t??`0`,10)}(0,getComputedStyle(n).rowGap,i)),s!==null&&e(s)},n)}function w4(e,t){return Math.round(e.getBoundingClientRect()[t])}function T4(e,t){return Math.abs(e-t)<1.01}function E4(e,t,n,r,i){r===void 0&&(r=B2);var a=(0,d.useRef)(null),o=(0,d.useRef)(null),s=(0,d.useRef)(null),c=(0,d.useRef)(!1),l=(0,d.useCallback)(function(n){var r=n.target,i=r===window||r===document,a=i?window.pageYOffset||document.documentElement.scrollTop:r.scrollTop,l=i?document.documentElement.scrollHeight:r.scrollHeight,u=i?window.innerHeight:r.offsetHeight,d=function(){e({scrollTop:Math.max(a,0),scrollHeight:l,viewportHeight:u})};c.current?(0,Dn.flushSync)(d):d(),c.current=!1,o.current!==null&&(a===o.current||a<=0||a===l-u)&&(o.current=null,t(!0),s.current&&=(clearTimeout(s.current),null))},[e,t]);return(0,d.useEffect)(function(){var e=i||a.current;return r(i||a.current),l({target:e}),e.addEventListener(`scroll`,l,{passive:!0}),function(){r(null),e.removeEventListener(`scroll`,l)}},[a,l,n,r,i]),{scrollerRef:a,scrollByCallback:function(e){c.current=!0,a.current.scrollBy(e)},scrollToCallback:function(n){var r=a.current;if(r&&(!(`offsetHeight`in r)||r.offsetHeight!==0)){var i,c,l,u=n.behavior===`smooth`;if(r===window?(c=Math.max(w4(document.documentElement,`height`),document.documentElement.scrollHeight),i=window.innerHeight,l=document.documentElement.scrollTop):(c=r.scrollHeight,i=w4(r,`height`),l=r.scrollTop),n.top=Math.ceil(Math.max(Math.min(c-i,n.top),0)),T4(i,c)||n.top===l)return e({scrollTop:l,scrollHeight:c,viewportHeight:i}),void(u&&t(!0));u?(o.current=n.top,s.current&&clearTimeout(s.current),s.current=setTimeout(function(){s.current=null,o.current=null,t(!0)},1e3)):o.current=null,r.scrollTo(n)}}}}var D4=l4(function(){var e=q2(),t=q2(),n=Q(0),r=q2(),i=Q(0),a=q2(),o=q2(),s=Q(0),c=Q(0),l=Q(0),u=Q(0),d=q2(),f=q2(),p=Q(!1),m=Q(!1);return G2($(e,$2(function(e){return e.scrollTop})),t),G2($(e,$2(function(e){return e.scrollHeight})),o),G2(t,i),{scrollContainerState:e,scrollTop:t,viewportHeight:a,headerHeight:s,fixedHeaderHeight:c,fixedFooterHeight:l,footerHeight:u,scrollHeight:o,smoothScrollTargetReached:r,react18ConcurrentRendering:m,scrollTo:d,scrollBy:f,statefulScrollTop:i,deviation:n,scrollingInProgress:p}},[],{singleton:!0}),O4={lvl:0};function k4(e,t,n,r,i){return r===void 0&&(r=O4),i===void 0&&(i=O4),{k:e,v:t,lvl:n,l:r,r:i}}function A4(e){return e===O4}function j4(){return O4}function M4(e,t){if(A4(e))return O4;var n=e.k,r=e.l,i=e.r;if(t===n){if(A4(r))return i;if(A4(i))return r;var a=L4(r);return V4(z4(e,{k:a[0],v:a[1],l:R4(r)}))}return V4(z4(e,t<n?{l:M4(r,t)}:{r:M4(i,t)}))}function N4(e,t,n){if(n===void 0&&(n=`k`),A4(e))return[-1/0,void 0];if(e[n]===t)return[e.k,e.v];if(e[n]<t){var r=N4(e.r,t,n);return r[0]===-1/0?[e.k,e.v]:r}return N4(e.l,t,n)}function P4(e,t,n){return A4(e)?k4(t,n,1):t===e.k?z4(e,{k:t,v:n}):function(e){return W4(G4(e))}(z4(e,t<e.k?{l:P4(e.l,t,n)}:{r:P4(e.r,t,n)}))}function F4(e,t,n){if(A4(e))return[];var r=e.k,i=e.v,a=e.r,o=[];return r>t&&(o=o.concat(F4(e.l,t,n))),r>=t&&r<=n&&o.push({k:r,v:i}),r<=n&&(o=o.concat(F4(a,t,n))),o}function I4(e){return A4(e)?[]:[].concat(I4(e.l),[{k:e.k,v:e.v}],I4(e.r))}function L4(e){return A4(e.r)?[e.k,e.v]:L4(e.r)}function R4(e){return A4(e.r)?e.l:V4(z4(e,{r:R4(e.r)}))}function z4(e,t){return k4(t.k===void 0?e.k:t.k,t.v===void 0?e.v:t.v,t.lvl===void 0?e.lvl:t.lvl,t.l===void 0?e.l:t.l,t.r===void 0?e.r:t.r)}function B4(e){return A4(e)||e.lvl>e.r.lvl}function V4(e){var t=e.l,n=e.r,r=e.lvl;if(n.lvl>=r-1&&t.lvl>=r-1)return e;if(r>n.lvl+1){if(B4(t))return G4(z4(e,{lvl:r-1}));if(A4(t)||A4(t.r))throw Error(`Unexpected empty nodes`);return z4(t.r,{l:z4(t,{r:t.r.l}),r:z4(e,{l:t.r.r,lvl:r-1}),lvl:r})}if(B4(e))return W4(z4(e,{lvl:r-1}));if(A4(n)||A4(n.l))throw Error(`Unexpected empty nodes`);var i=n.l,a=B4(i)?n.lvl-1:n.lvl;return z4(i,{l:z4(e,{r:i.l,lvl:r-1}),r:W4(z4(n,{l:i.r,lvl:a})),lvl:i.lvl+1})}function H4(e,t,n){return A4(e)?[]:U4(F4(e,N4(e,t)[0],n),function(e){return{index:e.k,value:e.v}})}function U4(e,t){var n=e.length;if(n===0)return[];for(var r=t(e[0]),i=r.index,a=r.value,o=[],s=1;s<n;s++){var c=t(e[s]),l=c.index,u=c.value;o.push({start:i,end:l-1,value:a}),i=l,a=u}return o.push({start:i,end:1/0,value:a}),o}function W4(e){var t=e.r,n=e.lvl;return A4(t)||A4(t.r)||t.lvl!==n||t.r.lvl!==n?e:z4(t,{l:z4(e,{r:t.l}),lvl:n+1})}function G4(e){var t=e.l;return A4(t)||t.lvl!==e.lvl?e:z4(t,{r:z4(e,{l:t.r})})}function K4(e,t,n,r){r===void 0&&(r=0);for(var i=e.length-1;r<=i;){var a=Math.floor((r+i)/2),o=n(e[a],t);if(o===0)return a;
500if(o===-1){if(i-r<2)return a-1;i=a-1}else{if(i===r)return a;r=a+1}}throw Error(`Failed binary finding record in array - `+e.join(`,`)+`, searched for `+t)}function q4(e,t,n){return e[K4(e,t,n)]}var J4=l4(function(){return{recalcInProgress:Q(!1)}},[],{singleton:!0});function Bpe(e){var t=e.size,n=e.startIndex,r=e.endIndex;return function(e){return e.start===n&&(e.end===r||e.end===1/0)&&e.value===t}}function Y4(e,t){var n=e.index;return t===n?0:t<n?-1:1}function Vpe(e,t){var n=e.offset;return t===n?0:t<n?-1:1}function Hpe(e){return{index:e.index,value:e}}function X4(e,t,n,r){var i=e,a=0,o=0,s=0,c=0;if(t!==0){s=i[c=K4(i,t-1,Y4)].offset;var l=N4(n,t-1);a=l[0],o=l[1],i.length&&i[c].size===N4(n,t)[1]&&--c,i=i.slice(0,c+1)}else i=[];for(var u,d=_4(H4(n,t,1/0));!(u=d()).done;){var f=u.value,p=f.start,m=f.value,h=p-a,g=h*o+s+h*r;i.push({offset:g,size:m,index:p}),a=p,s=g,o=m}return{offsetTree:i,lastIndex:a,lastOffset:s,lastSize:o}}function Upe(e,t){var n=t[0],r=t[1],i=t[3];n.length>0&&(0,t[2])(`received item sizes`,n,y4.DEBUG);var a=e.sizeTree,o=a,s=0;if(r.length>0&&A4(a)&&n.length===2){var c=n[0].size,l=n[1].size;o=r.reduce(function(e,t){return P4(P4(e,t,c),t+1,l)},o)}else{var u=function(e,t){for(var n,r=A4(e)?0:1/0,i=_4(t);!(n=i()).done;){var a=n.value,o=a.size,s=a.startIndex,c=a.endIndex;if(r=Math.min(r,s),A4(e))e=P4(e,0,o);else{var l=H4(e,s-1,c+1);if(!l.some(Bpe(a))){for(var u,d=!1,f=!1,p=_4(l);!(u=p()).done;){var m=u.value,h=m.start,g=m.end,_=m.value;d?(c>=h||o===_)&&(e=M4(e,h)):(f=_!==o,d=!0),g>c&&c>=h&&_!==o&&(e=P4(e,c+1,_))}f&&(e=P4(e,s,o))}}}return[e,r]}(o,n);o=u[0],s=u[1]}if(o===a)return e;var d=X4(e.offsetTree,s,o,i),f=d.offsetTree;return{sizeTree:o,offsetTree:f,lastIndex:d.lastIndex,lastOffset:d.lastOffset,lastSize:d.lastSize,groupOffsetTree:r.reduce(function(e,t){return P4(e,t,Z4(t,f,i))},j4()),groupIndices:r}}function Z4(e,t,n){if(t.length===0)return 0;var r=q4(t,e,Y4),i=e-r.index,a=r.size*i+(i-1)*n+r.offset;return a>0?a+n:a}function Q4(e,t,n){if(function(e){return e.groupIndex!==void 0}(e))return t.groupIndices[e.groupIndex]+1;var r=$4(e.index===`LAST`?n:e.index,t);return Math.max(0,r,Math.min(n,r))}function $4(e,t){if(!e3(t))return e;for(var n=0;t.groupIndices[n]<=e+n;)n++;return e+n}function e3(e){return!A4(e.groupOffsetTree)}var Wpe={offsetHeight:`height`,offsetWidth:`width`},t3=l4(function(e){var t=e[0].log,n=e[1].recalcInProgress,r=q2(),i=q2(),a=Y2(i,0),o=q2(),s=q2(),c=Q(0),l=Q([]),u=Q(void 0),d=Q(void 0),f=Q(function(e,t){return w4(e,Wpe[t])}),p=Q(void 0),m=Q(0),h={offsetTree:[],sizeTree:j4(),groupOffsetTree:j4(),lastIndex:0,lastOffset:0,lastSize:0,groupIndices:[]},g=Y2($(r,a4(l,t,m),t4(Upe,h),Z2()),h);G2($(l,Q2(function(e){return e.length>0}),a4(g,m),$2(function(e){var t=e[0],n=e[1],r=e[2],i=t.reduce(function(e,t,i){return P4(e,t,Z4(t,n.offsetTree,r)||i)},j4());return m4({},n,{groupIndices:t,groupOffsetTree:i})})),g),G2($(i,a4(g),Q2(function(e){return e[0]<e[1].lastIndex}),$2(function(e){var t=e[1];return[{startIndex:e[0],endIndex:t.lastIndex,size:t.lastSize}]})),r),G2(u,d);var _=Y2($(u,$2(function(e){return e===void 0})),!0);G2($(d,Q2(function(e){return e!==void 0&&A4(W2(g).sizeTree)}),$2(function(e){return[{startIndex:0,endIndex:0,size:e}]})),r);var v=J2($(r,a4(g),t4(function(e,t){var n=t[1];return{changed:n!==e.sizes,sizes:n}},{changed:!1,sizes:h}),$2(function(e){return e.changed})));V2($(c,t4(function(e,t){return{diff:e.prev-t,prev:t}},{diff:0,prev:0}),$2(function(e){return e.diff})),function(e){e>0?(H2(n,!0),H2(o,e)):e<0&&H2(s,e)}),V2($(c,a4(t)),function(e){e[0]<0&&(0,e[1])("`firstItemIndex` prop should not be set to less than zero. If you don't know the total count, just use a very high value",{firstItemIndex:c},y4.ERROR)});var y=J2(o);G2($(o,a4(g),$2(function(e){var t=e[0],n=e[1];if(n.groupIndices.length>0)throw Error(`Virtuoso: prepending items does not work with groups`);return I4(n.sizeTree).reduce(function(e,n){var r=n.k,i=n.v;return{ranges:[].concat(e.ranges,[{startIndex:e.prevIndex,endIndex:r+t-1,size:e.prevSize}]),prevIndex:r+t,prevSize:i}},{ranges:[],prevIndex:0,prevSize:n.lastSize}).ranges})),r);
500var b=J2($(s,a4(g,m),$2(function(e){return Z4(-e[0],e[1].offsetTree,e[2])})));return G2($(s,a4(g,m),$2(function(e){var t=e[0],n=e[1],r=e[2];if(n.groupIndices.length>0)throw Error(`Virtuoso: shifting items does not work with groups`);var i=I4(n.sizeTree).reduce(function(e,n){var r=n.v;return P4(e,Math.max(0,n.k+t),r)},j4());return m4({},n,{sizeTree:i},X4(n.offsetTree,0,i,r))})),g),{data:p,totalCount:i,sizeRanges:r,groupIndices:l,defaultItemSize:d,fixedItemSize:u,unshiftWith:o,shiftWith:s,shiftWithOffset:b,beforeUnshiftWith:y,firstItemIndex:c,gap:m,sizes:g,listRefresh:v,statefulTotalCount:a,trackItemSizes:_,itemSize:f}},R2(b4,J4),{singleton:!0}),Gpe=typeof document<`u`&&`scrollBehavior`in document.documentElement.style;function n3(e){var t=typeof e==`number`?{index:e}:e;return t.align||=`start`,t.behavior&&Gpe||(t.behavior=`auto`),t.offset||=0,t}var r3=l4(function(e){var t=e[0],n=t.sizes,r=t.totalCount,i=t.listRefresh,a=t.gap,o=e[1],s=o.scrollingInProgress,c=o.viewportHeight,l=o.scrollTo,u=o.smoothScrollTargetReached,d=o.headerHeight,f=o.footerHeight,p=o.fixedHeaderHeight,m=o.fixedFooterHeight,h=e[2].log,g=q2(),_=Q(0),v=null,y=null,b=null;function x(){v&&=(v(),null),b&&=(b(),null),y&&=(clearTimeout(y),null),H2(s,!1)}return G2($(g,a4(n,c,r,_,d,f,h),a4(a,p,m),$2(function(e){var t=e[0],n=t[0],r=t[1],a=t[2],o=t[3],c=t[4],l=t[5],d=t[6],f=t[7],p=e[1],m=e[2],h=e[3],_=n3(n),S=_.align,C=_.behavior,w=_.offset,T=o-1,E=Q4(_,r,T),D=Z4(E,r.offsetTree,p)+l;S===`end`?(D+=m+N4(r.sizeTree,E)[1]-a+h,E===T&&(D+=d)):S===`center`?D+=(m+N4(r.sizeTree,E)[1]-a+h)/2:D-=c,w&&(D+=w);var O=function(e){x(),e?(f(`retrying to scroll to`,{location:n},y4.DEBUG),H2(g,n)):f(`list did not change, scroll successful`,{},y4.DEBUG)};if(x(),C===`smooth`){var k=!1;b=V2(i,function(e){k||=e}),v=K2(u,function(){O(k)})}else v=K2($(i,function(e){var t=setTimeout(function(){e(!1)},150);return function(n){n&&(e(!0),clearTimeout(t))}}),O);return y=setTimeout(function(){x()},1200),H2(s,!0),f(`scrolling from index to`,{index:E,top:D,behavior:C},y4.DEBUG),{top:D,behavior:C}})),l),{scrollToIndex:g,topListHeight:_}},R2(t3,D4,b4),{singleton:!0}),i3=`up`,Kpe={atBottom:!1,notAtBottomBecause:`NOT_SHOWING_LAST_ITEM`,state:{offsetBottom:0,scrollTop:0,viewportHeight:0,scrollHeight:0}},a3=l4(function(e){var t=e[0],n=t.scrollContainerState,r=t.scrollTop,i=t.viewportHeight,a=t.headerHeight,o=t.footerHeight,s=t.scrollBy,c=Q(!1),l=Q(!0),u=q2(),d=q2(),f=Q(4),p=Q(0),m=Y2($(o4($(s4(r),n4(1),e4(!0)),$(s4(r),n4(1),e4(!1),i4(100))),Z2()),!1),h=Y2($(o4($(s,e4(!0)),$(s,e4(!1),i4(200))),Z2()),!1);G2($(c4(s4(r),s4(p)),$2(function(e){return e[0]<=e[1]}),Z2()),l),G2($(l,r4(50)),d);var g=J2($(c4(n,s4(i),s4(a),s4(o),s4(f)),t4(function(e,t){var n,r,i=t[0],a=i.scrollTop,o=i.scrollHeight,s=t[1],c={viewportHeight:s,scrollTop:a,scrollHeight:o};return a+s-o>-t[4]?(a>e.state.scrollTop?(n=`SCROLLED_DOWN`,r=e.state.scrollTop-a):(n=`SIZE_DECREASED`,r=e.state.scrollTop-a||e.scrollTopDelta),{atBottom:!0,state:c,atBottomBecause:n,scrollTopDelta:r}):{atBottom:!1,notAtBottomBecause:c.scrollHeight>e.state.scrollHeight?`SIZE_INCREASED`:s<e.state.viewportHeight?`VIEWPORT_HEIGHT_DECREASING`:a<e.state.scrollTop?`SCROLLING_UPWARDS`:`NOT_FULLY_SCROLLED_TO_LAST_ITEM_BOTTOM`,state:c}},Kpe),Z2(function(e,t){return e&&e.atBottom===t.atBottom}))),_=Y2($(n,t4(function(e,t){var n=t.scrollTop,r=t.scrollHeight,i=t.viewportHeight;return T4(e.scrollHeight,r)?{scrollTop:n,scrollHeight:r,jump:0,changed:!1}:e.scrollTop!==n&&r-(n+i)<1?{scrollHeight:r,scrollTop:n,jump:e.scrollTop-n,changed:!0}:{scrollHeight:r,scrollTop:n,jump:0,changed:!0}},{scrollHeight:0,jump:0,scrollTop:0,changed:!1}),Q2(function(e){return e.changed}),$2(function(e){return e.jump})),0);G2($(g,$2(function(e){return e.atBottom})),c),G2($(c,r4(50)),u);var v=Q(`down`);G2($(n,$2(function(e){return e.scrollTop}),Z2(),t4(function(e,t){return W2(h)?{direction:e.direction,prevScrollTop:t}:{direction:t<e.prevScrollTop?i3:`down`,prevScrollTop:t}},{direction:`down`,prevScrollTop:0}),$2(function(e){return e.direction})),v),G2($(n,r4(50),e4(`none`)),v);var y=Q(0);return G2($(m,Q2(function(e){return!e}),e4(0)),y),G2($(r,r4(100),a4(m),Q2(function(e){return!!e[1]}),t4(function(e,t){return[e[1],t[0]]},[0,0]),$2(function(e){return e[1]-e[0]})),y),{isScrolling:m,isAtTop:l,isAtBottom:c,atBottomState:g,atTopStateChange:d,atBottomStateChange:u,scrollDirection:v,atBottomThreshold:f,atTopThreshold:p,scrollVelocity:y,lastJumpDueToItemResize:_}},R2(D4)),o3=l4(function(e){var t=e[0].log,n=Q(!1),r=J2($(n,Q2(function(e){return e}),Z2()));return V2(n,function(e){e&&W2(t)(`props updated`,{},y4.DEBUG)}),{propsReady:n,didMount:r}},R2(b4),{singleton:!0}),s3=l4(function(e){var t=e[0],n=t.sizes,r=t.listRefresh,i=t.defaultItemSize,a=e[1].scrollTop,o=e[2].scrollToIndex,s=e[3].did
500Mount,c=Q(!0),l=Q(0);return G2($(s,a4(l),Q2(function(e){return!!e[1]}),e4(!1)),c),V2($(c4(r,s),a4(c,n,i),Q2(function(e){var t=e[1],n=e[3];return e[0][1]&&(!A4(e[2].sizeTree)||n!==void 0)&&!t}),a4(l)),function(e){var t=e[1];setTimeout(function(){K2(a,function(){H2(c,!0)}),H2(o,t)})}),{scrolledToInitialItem:c,initialTopMostItemIndex:l}},R2(t3,D4,r3,o3),{singleton:!0});function c3(e){return!!e&&(e===`smooth`?`smooth`:`auto`)}var qpe=l4(function(e){var t=e[0],n=t.totalCount,r=t.listRefresh,i=e[1],a=i.isAtBottom,o=i.atBottomState,s=e[2].scrollToIndex,c=e[3].scrolledToInitialItem,l=e[4],u=l.propsReady,d=l.didMount,f=e[5].log,p=e[6].scrollingInProgress,m=Q(!1),h=q2(),g=null;function _(e){H2(s,{index:`LAST`,align:`end`,behavior:e})}function v(e){var t=K2(o,function(t){!e||t.atBottom||t.notAtBottomBecause!==`SIZE_INCREASED`||g||(W2(f)(`scrolling to bottom due to increased size`,{},y4.DEBUG),_(`auto`))});setTimeout(t,100)}return V2($(c4($(s4(n),n4(1)),d),a4(s4(m),a,c,p),$2(function(e){var t=e[0],n=t[0],r=t[1]&&e[3],i=`auto`;return r&&(i=function(e,t){return typeof e==`function`?c3(e(t)):t&&c3(e)}(e[1],e[2]||e[4]),r&&=!!i),{totalCount:n,shouldFollow:r,followOutputBehavior:i}}),Q2(function(e){return e.shouldFollow})),function(e){var t=e.totalCount,n=e.followOutputBehavior;g&&=(g(),null),g=K2(r,function(){W2(f)(`following output to `,{totalCount:t},y4.DEBUG),_(n),g=null})}),V2($(c4(s4(m),n,u),Q2(function(e){return e[0]&&e[2]}),t4(function(e,t){var n=t[1];return{refreshed:e.value===n,value:n}},{refreshed:!1,value:0}),Q2(function(e){return e.refreshed}),a4(m,n)),function(e){v(!1!==e[1])}),V2(h,function(){v(!1!==W2(m))}),V2(c4(s4(m),o),function(e){var t=e[1];e[0]&&!t.atBottom&&t.notAtBottomBecause===`VIEWPORT_HEIGHT_DECREASING`&&_(`auto`)}),{followOutput:m,autoscrollToBottom:h}},R2(t3,a3,r3,s3,o3,b4,D4));function Jpe(e){return e.reduce(function(e,t){return e.groupIndices.push(e.totalCount),e.totalCount+=t+1,e},{totalCount:0,groupIndices:[]})}var l3=l4(function(e){var t=e[0],n=t.totalCount,r=t.groupIndices,i=t.sizes,a=e[1],o=a.scrollTop,s=a.headerHeight,c=q2(),l=q2(),u=J2($(c,$2(Jpe)));return G2($(u,$2(function(e){return e.totalCount})),n),G2($(u,$2(function(e){return e.groupIndices})),r),G2($(c4(o,i,s),Q2(function(e){return e3(e[1])}),$2(function(e){return N4(e[1].groupOffsetTree,Math.max(e[0]-e[2],0),`v`)[0]}),Z2(),$2(function(e){return[e]})),l),{groupCounts:c,topItemsIndexes:l}},R2(t3,D4));function u3(e,t){return!(!e||e[0]!==t[0]||e[1]!==t[1])}function d3(e,t){return!(!e||e.startIndex!==t.startIndex||e.endIndex!==t.endIndex)}function f3(e,t,n){return typeof e==`number`?n===i3&&t===`top`||n===`down`&&t===`bottom`?e:0:n===i3?t===`top`?e.main:e.reverse:t===`bottom`?e.main:e.reverse}function p3(e,t){return typeof e==`number`?e:e[t]||0}var m3=l4(function(e){var t=e[0],n=t.scrollTop,r=t.viewportHeight,i=t.deviation,a=t.headerHeight,o=t.fixedHeaderHeight,s=q2(),c=Q(0),l=Q(0),u=Q(0);return{listBoundary:s,overscan:u,topListHeight:c,increaseViewportBy:l,visibleRange:Y2($(c4(s4(n),s4(r),s4(a),s4(s,u3),s4(u),s4(c),s4(o),s4(i),s4(l)),$2(function(e){var t=e[0],n=e[1],r=e[2],i=e[3],a=i[0],o=i[1],s=e[4],c=e[6],l=e[7],u=e[8],d=t-l,f=e[5]+c,p=Math.max(r-d,0),m=`none`,h=p3(u,`top`),g=p3(u,`bottom`);return a-=l,o+=r+c,(a+=r+c)>t+f-h&&(m=i3),(o-=l)<t-p+n+g&&(m=`down`),m===`none`?null:[Math.max(d-r-f3(s,`top`,m)-h,0),d-p-c+n+f3(s,`bottom`,m)+g]}),Q2(function(e){return e!=null}),Z2(u3)),[0,0])}},R2(D4),{singleton:!0}),h3={items:[],topItems:[],offsetTop:0,offsetBottom:0,top:0,bottom:0,topListHeight:0,totalCount:0,firstItemIndex:0};function g3(e,t,n){if(e.length===0)return[];if(!e3(t))return e.map(function(e){return m4({},e,{index:e.index+n,originalIndex:e.index})});for(var r,i=[],a=H4(t.groupOffsetTree,e[0].index,e[e.length-1].index),o=void 0,s=0,c=_4(e);!(r=c()).done;){var l=r.value;(!o||o.end<l.index)&&(o=a.shift(),s=t.groupIndices.indexOf(o.start)),i.push(m4({},l.index===o.start?{type:`group`,index:s}:{index:l.index-(s+1)+n,groupIndex:s},{size:l.size,offset:l.offset,originalIndex:l.index,data:l.data}))}return i}function _3(e,t,n,r,i,a){var o=0,s=0;if(e.length>0){o=e[0].offset;var c=e[e.length-1];s=c.offset+c.size}var l=n-i.lastIndex,u=o,d=i.lastOffset+l*i.lastSize+(l-1)*r-s;return{items:g3(e,i,a),topItems:g3(t,i,a),topListHeight:t.reduce(function(e,t){return t.size+e},0),offsetTop:o,offsetBottom:d,top:u,bottom:s,totalCount:n,firstItemIndex:a}}var v3=l4(function(e){var t=e[0],n=t.sizes,r=t.totalCount,i=t.data,a=t.firstItemIndex,o=t.gap,s=e[1],c=e[2],l=c.visibleRange,u=c.listBoundary,d=c.topListHeight,f=e[3],p=f.scrolledToInitialItem,m=f.initialTopM
500ostItemIndex,h=e[4].topListHeight,g=e[5],_=e[6].didMount,v=e[7].recalcInProgress,y=Q([]),b=q2();G2(s.topItemsIndexes,y);var x=Y2($(c4(_,v,s4(l,u3),s4(r),s4(n),s4(m),p,s4(y),s4(a),s4(o),i),Q2(function(e){return e[0]&&!e[1]}),$2(function(e){var t=e[2],n=t[0],r=t[1],i=e[3],a=e[5],o=e[6],s=e[7],c=e[8],l=e[9],u=e[10],d=e[4],f=d.sizeTree,p=d.offsetTree;if(i===0||n===0&&r===0)return m4({},h3,{totalCount:i});if(A4(f))return _3(function(e,t,n){if(e3(t)){var r=$4(e,t);return[{index:N4(t.groupOffsetTree,r)[0],size:0,offset:0},{index:r,size:0,offset:0,data:n&&n[0]}]}return[{index:e,size:0,offset:0,data:n&&n[0]}]}(function(e,t){return typeof e==`number`?e:e.index===`LAST`?t-1:e.index}(a,i),d,u),[],i,l,d,c);var m=[];if(s.length>0)for(var h,g=s[0],_=s[s.length-1],v=0,y=_4(H4(f,g,_));!(h=y()).done;)for(var b=h.value,x=b.value,S=Math.max(b.start,g),C=Math.min(b.end,_),w=S;w<=C;w++)m.push({index:w,size:x,offset:v,data:u&&u[w]}),v+=x;if(!o)return _3([],m,i,l,d,c);var T=s.length>0?s[s.length-1]+1:0,E=function(e,t,n,r){return r===void 0&&(r=0),r>0&&(t=Math.max(t,q4(e,r,Y4).offset)),U4((a=n,s=K4(i=e,t,o=Vpe),c=K4(i,a,o,s),i.slice(s,c+1)),Hpe);var i,a,o,s,c}(p,n,r,T);if(E.length===0)return null;var D=i-1;return _3(L2([],function(e){for(var t,i=_4(E);!(t=i()).done;){var a=t.value,o=a.value,s=o.offset,c=a.start,d=o.size;if(o.offset<n){var f=(c+=Math.floor((n-o.offset+l)/(d+l)))-a.start;s+=f*d+f*l}c<T&&(s+=(T-c)*d,c=T);for(var p=Math.min(a.end,D),m=c;m<=p&&!(s>=r);m++)e.push({index:m,size:d,offset:s,data:u&&u[m]}),s+=d+l}}),m,i,l,d,c)}),Q2(function(e){return e!==null}),Z2()),h3);return G2($(i,Q2(function(e){return e!==void 0}),$2(function(e){return e.length})),r),G2($(x,$2(function(e){return e.topListHeight})),h),G2(h,d),G2($(x,$2(function(e){return[e.top,e.bottom]})),u),G2($(x,$2(function(e){return e.items})),b),m4({listState:x,topItemsIndexes:y,endReached:J2($(x,Q2(function(e){return e.items.length>0}),a4(r,i),Q2(function(e){var t=e[0].items;return t[t.length-1].originalIndex===e[1]-1}),$2(function(e){return[e[1]-1,e[2]]}),Z2(u3),$2(function(e){return e[0]}))),startReached:J2($(x,r4(200),Q2(function(e){var t=e.items;return t.length>0&&t[0].originalIndex===e.topItems.length}),$2(function(e){return e.items[0].index}),Z2())),rangeChanged:J2($(x,Q2(function(e){return e.items.length>0}),$2(function(e){for(var t=e.items,n=0,r=t.length-1;t[n].type===`group`&&n<r;)n++;for(;t[r].type===`group`&&r>n;)r--;return{startIndex:t[n].index,endIndex:t[r].index}}),Z2(d3))),itemsRendered:b},g)},R2(t3,l3,m3,s3,r3,a3,o3,J4),{singleton:!0}),Ype=l4(function(e){var t=e[0],n=t.sizes,r=t.firstItemIndex,i=t.data,a=t.gap,o=e[1].listState,s=e[2].didMount,c=Q(0);return G2($(s,a4(c),Q2(function(e){return e[1]!==0}),a4(n,r,a,i),$2(function(e){var t=e[0][1],n=e[1],r=e[2],i=e[3],a=e[4],o=a===void 0?[]:a,s=0;if(n.groupIndices.length>0)for(var c,l=_4(n.groupIndices);!((c=l()).done||c.value-s>=t);)s++;var u=t+s;return _3(Array.from({length:u}).map(function(e,t){return{index:t,size:0,offset:0,data:o[t]}}),[],u,i,n,r)})),o),{initialItemCount:c}},R2(t3,v3,o3),{singleton:!0}),y3=l4(function(e){var t=e[0].scrollVelocity,n=Q(!1),r=q2(),i=Q(!1);return G2($(t,a4(i,n,r),Q2(function(e){return!!e[1]}),$2(function(e){var t=e[0],n=e[1],r=e[2],i=e[3],a=n.enter;if(r){if((0,n.exit)(t,i))return!1}else if(a(t,i))return!0;return r}),Z2()),n),V2($(c4(n,t,r),a4(i)),function(e){var t=e[0],n=e[1];return t[0]&&n&&n.change&&n.change(t[1],t[2])}),{isSeeking:n,scrollSeekConfiguration:i,scrollVelocity:t,scrollSeekRangeChanged:r}},R2(a3),{singleton:!0}),Xpe=l4(function(e){var t=e[0].topItemsIndexes,n=Q(0);return G2($(n,Q2(function(e){return e>0}),$2(function(e){return Array.from({length:e}).map(function(e,t){return t})})),t),{topItemCount:n}},R2(v3)),b3=l4(function(e){var t=e[0],n=t.footerHeight,r=t.headerHeight,i=t.fixedHeaderHeight,a=t.fixedFooterHeight,o=e[1].listState,s=q2(),c=Y2($(c4(n,a,r,i,o),$2(function(e){var t=e[4];return e[0]+e[1]+e[2]+e[3]+t.offsetBottom+t.bottom})),0);return G2(s4(c),s),{totalListHeight:c,totalListHeightChanged:s}},R2(D4,v3),{singleton:!0});function x3(e){var t,n=!1;return function(){return n||(n=!0,t=e()),t}}var Zpe=x3(function(){return/iP(ad|hone|od).+Version\/[\d.]+.*Safari/i.test(navigator.userAgent)}),Qpe=l4(function(e){var t=e[0],n=t.scrollBy,r=t.scrollTop,i=t.deviation,a=t.scrollingInProgress,o=e[1],s=o.isScrolling,c=o.isAtBottom,l=o.scrollDirection,u=e[3],d=u.beforeUnshiftWith,f=u.shiftWithOffset,p=u.sizes,m=u.gap,h=e[4].log,g=e[5].recalcInProgress,_=J2($(e[2].listState,a4(o.lastJumpDueToItemResize),t4(function(e,t){var n=e[1],r=t[0],i=r.items,a=r.totalCount,o=r.bottom+r.offsetBottom,s=0;return e[2]===a&&n.length>0&&i.length>0&&(i[0].originalIndex===0&&n[0].originalIndex===0||(s=o-e[3])!=0&&(s+=t[1])),[s,i,a,o]},[0,[],0,0]),Q2(function(e){return e[0]!==0}),a4(r,l,a,c,h),Q2(function(e){return!e[3]&&e[1]!==0&&e[2]===i3}),$2(function(e){var t=e[0][0];return(0,e[5])(`Upward scrolling compensation`,{amount:t},y4.DEBUG),t})));function v(e){e>0?(H2(n,{top:-e,behavior:`auto`}
500),H2(i,0)):(H2(i,0),H2(n,{top:-e,behavior:`auto`}))}return V2($(_,a4(i,s)),function(e){var t=e[0],n=e[1];e[2]&&Zpe()?H2(i,n-t):v(-t)}),V2($(c4(Y2(s,!1),i,g),Q2(function(e){return!e[0]&&!e[2]&&e[1]!==0}),$2(function(e){return e[1]}),r4(1)),v),G2($(f,$2(function(e){return{top:-e}})),n),V2($(d,a4(p,m),$2(function(e){var t=e[0];return t*e[1].lastSize+t*e[2]})),function(e){H2(i,e),requestAnimationFrame(function(){H2(n,{top:e}),requestAnimationFrame(function(){H2(i,0),H2(g,!1)})})}),{deviation:i}},R2(D4,a3,v3,t3,b4,J4)),$pe=l4(function(e){var t=e[0].totalListHeight,n=e[1].didMount,r=e[2].scrollTo,i=Q(0);return V2($(n,a4(i),Q2(function(e){return e[1]!==0}),$2(function(e){return{top:e[1]}})),function(e){K2($(t,Q2(function(e){return e!==0})),function(){setTimeout(function(){H2(r,e)})})}),{initialScrollTop:i}},R2(b3,o3,D4),{singleton:!0}),eme=l4(function(e){var t=e[0].viewportHeight,n=e[1].totalListHeight,r=Q(!1);return{alignToBottom:r,paddingTopAddition:Y2($(c4(r,t,n),Q2(function(e){return e[0]}),$2(function(e){return Math.max(0,e[1]-e[2])}),Z2()),0)}},R2(D4,b3),{singleton:!0}),S3=l4(function(e){var t=e[0],n=t.scrollTo,r=t.scrollContainerState,i=q2(),a=q2(),o=q2(),s=Q(!1),c=Q(void 0);return G2($(c4(i,a),$2(function(e){var t=e[0],n=t.viewportHeight,r=t.scrollHeight;return{scrollTop:Math.max(0,t.scrollTop-e[1].offsetTop),scrollHeight:r,viewportHeight:n}})),r),G2($(n,a4(a),$2(function(e){var t=e[0];return m4({},t,{top:t.top+e[1].offsetTop})})),o),{useWindowScroll:s,customScrollParent:c,windowScrollContainerState:i,windowViewportRect:a,windowScrollTo:o}},R2(D4)),tme=[`done`,`behavior`,`align`],nme=l4(function(e){var t=e[0],n=t.sizes,r=t.totalCount,i=t.gap,a=e[1],o=a.scrollTop,s=a.viewportHeight,c=a.headerHeight,l=a.fixedHeaderHeight,u=a.fixedFooterHeight,d=a.scrollingInProgress,f=e[2].scrollToIndex,p=q2();return G2($(p,a4(n,s,r,c,l,u,o),a4(i),$2(function(e){var t=e[0],n=t[0],r=t[1],i=t[2],a=t[3],o=t[4],s=t[5],c=t[6],l=t[7],u=e[1],f=n.done,p=n.behavior,m=n.align,h=h4(n,tme),g=null,_=Q4(n,r,a-1),v=Z4(_,r.offsetTree,u)+o+s;return v<l+s?g=m4({},h,{behavior:p,align:m??`start`}):v+N4(r.sizeTree,_)[1]>l+i-c&&(g=m4({},h,{behavior:p,align:m??`end`})),g?f&&K2($(d,n4(1),Q2(function(e){return!1===e})),f):f&&f(),g}),Q2(function(e){return e!==null})),f),{scrollIntoView:p}},R2(t3,D4,r3,v3,b4),{singleton:!0}),rme=[`listState`,`topItemsIndexes`],C3=l4(function(e){var t=e[0],n=t.totalCount,r=t.sizeRanges,i=t.fixedItemSize,a=t.defaultItemSize,o=t.trackItemSizes,s=t.itemSize,c=t.data,l=t.firstItemIndex,u=t.groupIndices,d=t.statefulTotalCount,f=t.gap,p=e[1],m=p.initialTopMostItemIndex,h=p.scrolledToInitialItem,g=e[2],_=e[3],v=e[4],y=v.listState,b=v.topItemsIndexes,x=h4(v,rme),S=e[5].scrollToIndex,C=e[7].topItemCount,w=e[8].groupCounts,T=e[9],E=e[10];return G2(x.rangeChanged,T.scrollSeekRangeChanged),G2($(T.windowViewportRect,$2(function(e){return e.visibleHeight})),g.viewportHeight),m4({totalCount:n,data:c,firstItemIndex:l,sizeRanges:r,initialTopMostItemIndex:m,scrolledToInitialItem:h,topItemsIndexes:b,topItemCount:C,groupCounts:w,fixedItemHeight:i,defaultItemHeight:a,gap:f},_,{statefulTotalCount:d,listState:y,scrollToIndex:S,trackItemSizes:o,itemSize:s,groupIndices:u},x,T,g,E)},R2(t3,s3,D4,qpe,v3,r3,Qpe,Xpe,l3,l4(function(e){return m4({},e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])},R2(m3,Ype,o3,y3,b3,$pe,eme,S3,nme)),b4)),w3=x3(function(){if(typeof document>`u`)return`sticky`;var e=document.createElement(`div`);return e.style.position=`-webkit-sticky`,e.style.position===`-webkit-sticky`?`-webkit-sticky`:`sticky`});function T3(e,t){var n=(0,d.useRef)(null),r=(0,d.useCallback)(function(r){if(r!==null&&r.offsetParent){var i,a,o=r.getBoundingClientRect(),s=o.width;if(t){var c=t.getBoundingClientRect(),l=o.top-c.top;i=c.height-Math.max(0,l),a=l+t.scrollTop}else i=window.innerHeight-Math.max(0,o.top),a=o.top+window.pageYOffset;n.current={offsetTop:a,visibleHeight:i,visibleWidth:s},e(n.current)}},[e,t]),i=x4(r),a=i.callbackRef,o=i.ref,s=(0,d.useCallback)(function(){r(o.current)},[r,o]);return(0,d.useEffect)(function(){if(t){t.addEventListener(`scroll`,s);var e=new ResizeObserver(s);return e.observe(t),function(){t.removeEventListener(`scroll`,s),e.unobserve(t)}}return window.addEventListener(`scroll`,s),window.addEventListener(`resize`,s),function(){window.removeEventListener(`scroll`,s),window.removeEventListener(`resize`,s)}},[s,t]),a}var E3=d.createContext(void 0),ime=[`placeholder`],ame=[`style`,`children`],ome=[`style`,`children`];function D3(e){return e}var sme=l4(function(){var e=Q(function(e){return`Item `+e}),t=Q(null),n=Q(function(e){return`Group `+e}),r=Q({}),i=Q(D3),a=Q(`div`),o=Q(B2),s=function(e,t){return t===void 0&&(t=null),Y2($(r,$2(function(t){return t[e]}
500),Z2()),t)};return{context:t,itemContent:e,groupContent:n,components:r,computeItemKey:i,headerFooterTag:a,scrollerRef:o,FooterComponent:s(`Footer`),HeaderComponent:s(`Header`),TopItemListComponent:s(`TopItemList`),ListComponent:s(`List`,`div`),ItemComponent:s(`Item`,`div`),GroupComponent:s(`Group`,`div`),ScrollerComponent:s(`Scroller`,`div`),EmptyPlaceholder:s(`EmptyPlaceholder`),ScrollSeekPlaceholder:s(`ScrollSeekPlaceholder`)}});function O3(e,t){var n=q2();return V2(n,function(){return console.warn(`react-virtuoso: You are using a deprecated property. `+t,`color: red;`,`color: inherit;`,`color: blue;`)}),G2(n,e),n}var cme=l4(function(e){var t=e[0],n=e[1],r={item:O3(n.itemContent,`Rename the %citem%c prop to %citemContent.`),group:O3(n.groupContent,`Rename the %cgroup%c prop to %cgroupContent.`),topItems:O3(t.topItemCount,`Rename the %ctopItems%c prop to %ctopItemCount.`),itemHeight:O3(t.fixedItemHeight,`Rename the %citemHeight%c prop to %cfixedItemHeight.`),scrollingStateChange:O3(t.isScrolling,`Rename the %cscrollingStateChange%c prop to %cisScrolling.`),adjustForPrependedItems:q2(),maxHeightCacheSize:q2(),footer:q2(),header:q2(),HeaderContainer:q2(),FooterContainer:q2(),ItemContainer:q2(),ScrollContainer:q2(),GroupContainer:q2(),ListContainer:q2(),emptyComponent:q2(),scrollSeek:q2()};function i(e,t,r){G2($(e,a4(n.components),$2(function(e){var n,i=e[0],a=e[1];return console.warn(`react-virtuoso: `+r+` property is deprecated. Pass components.`+t+` instead.`),m4({},a,((n={})[t]=i,n))})),n.components)}return V2(r.adjustForPrependedItems,function(){console.warn(`react-virtuoso: adjustForPrependedItems is no longer supported. Use the firstItemIndex property instead - https://virtuoso.dev/prepend-items.`,`color: red;`,`color: inherit;`,`color: blue;`)}),V2(r.maxHeightCacheSize,function(){console.warn(`react-virtuoso: maxHeightCacheSize is no longer necessary. Setting it has no effect - remove it from your code.`)}),V2(r.HeaderContainer,function(){console.warn(`react-virtuoso: HeaderContainer is deprecated. Use headerFooterTag if you want to change the wrapper of the header component and pass components.Header to change its contents.`)}),V2(r.FooterContainer,function(){console.warn(`react-virtuoso: FooterContainer is deprecated. Use headerFooterTag if you want to change the wrapper of the footer component and pass components.Footer to change its contents.`)}),V2(r.scrollSeek,function(e){var r=e.placeholder,i=h4(e,ime);console.warn(`react-virtuoso: scrollSeek property is deprecated. Pass scrollSeekConfiguration and specify the placeholder in components.ScrollSeekPlaceholder instead.`),H2(n.components,m4({},W2(n.components),{ScrollSeekPlaceholder:r})),H2(t.scrollSeekConfiguration,i)}),i(r.footer,`Footer`,`footer`),i(r.header,`Header`,`header`),i(r.ItemContainer,`Item`,`ItemContainer`),i(r.ListContainer,`List`,`ListContainer`),i(r.ScrollContainer,`Scroller`,`ScrollContainer`),i(r.emptyComponent,`EmptyPlaceholder`,`emptyComponent`),i(r.GroupContainer,`Group`,`GroupContainer`),m4({},t,n,r)},R2(C3,sme)),lme=function(e){return d.createElement(`div`,{style:{height:e.height}})},ume={position:w3(),zIndex:1,overflowAnchor:`none`},dme={overflowAnchor:`none`},k3=d.memo(function(e){var t=e.showTopList,n=t!==void 0&&t,r=I3(`listState`),i=F3(`sizeRanges`),a=I3(`useWindowScroll`),o=I3(`customScrollParent`),s=F3(`windowScrollContainerState`),c=F3(`scrollContainerState`),l=o||a?s:c,u=I3(`itemContent`),f=I3(`context`),p=I3(`groupContent`),m=I3(`trackItemSizes`),h=I3(`itemSize`),g=I3(`log`),_=F3(`gap`),v=C4(i,h,m,n?B2:l,g,_,o).callbackRef,y=d.useState(0),b=y[0],x=y[1];L3(`deviation`,function(e){b!==e&&x(e)});var S=I3(`EmptyPlaceholder`),C=I3(`ScrollSeekPlaceholder`)||lme,w=I3(`ListComponent`),T=I3(`ItemComponent`),E=I3(`GroupComponent`),D=I3(`computeItemKey`),O=I3(`isSeeking`),k=I3(`groupIndices`).length>0,A=I3(`paddingTopAddition`),j=n?{}:{boxSizing:`border-box`,paddingTop:r.offsetTop+A,paddingBottom:r.offsetBottom,marginTop:b};return!n&&r.totalCount===0&&S?(0,d.createElement)(S,j3(S,f)):(0,d.createElement)(w,m4({},j3(w,f),{ref:v,style:j,"data-test-id":n?`virtuoso-top-item-list`:`virtuoso-item-list`}),(n?r.topItems:r.items).map(function(e){var t=e.originalIndex,n=D(t+r.firstItemIndex,e.data,f);return O?(0,d.createElement)(C,m4({},j3(C,f),{key:n,index:e.index,height:e.size,type:e.type||`item`},e.type===`group`?{}:{groupIndex:e.groupIndex})):e.type===`group`?(0,d.createElement)(E,m4({},j3(E,f),{key:n,"data-index":t,"data-known-size":e.size,"data-item-index":e.index,style:ume}),p(e.index)):(0,d.createElement)(T,m4({},j3(T,f),{key:n,"data-index":t,"data-known-size":e.size,"data-item-index":e.index,"data-item-group-index":e.groupIndex,style:dme}),k?u(e.index,e.groupIndex,e.data,f):u(e.index,e.data,f))}))}),fme={height:`100%`,outline:`none`,overflowY:`auto`,position:`relative`,WebkitOverflowScrolling:`touch`},A3={width:`100%`,height:`100%`,position:`absolute`,top:0},pme={width:`100%`,position:w3(),top:0};function j3(e,t){if(typeof e!=`string`)return{context:t}}var mme=d.memo(function(){var e=I3(`HeaderComponent`),t=F3(`headerHeight`),n=I3(`headerFooterTag`),r=S4(function(e){return t(w4(e,`height`))}),i=I3(`context`);return e?(0,d.createElement)(n,{ref:r},(0,d.createElement)(e,j3(e,i))):null}),hme=d.memo(function(){var e=I3(`FooterComponent`),t=F3(`footerHeight`),n=I3(`headerFooterTag`),r=S4(function(e){return t(w4(e,`height`))}),i=I3(`context`);return e?(0,d.createElement)(n,{ref:r},(0,d.createElement)(e,j3(e,i))):null});function M3(e){var t=e.usePublisher,n=e.useEmitter,r=e.useEmitterValue;return d.memo(function(e){var i=e.style,a=e.children,o=h4(e,ame),s=t(`scrollC
500ontainerState`),c=r(`ScrollerComponent`),l=t(`smoothScrollTargetReached`),u=r(`scrollerRef`),f=r(`context`),p=E4(s,l,c,u),m=p.scrollerRef,h=p.scrollByCallback;return n(`scrollTo`,p.scrollToCallback),n(`scrollBy`,h),(0,d.createElement)(c,m4({ref:m,style:m4({},fme,i),"data-test-id":`virtuoso-scroller`,"data-virtuoso-scroller":!0,tabIndex:0},o,j3(c,f)),a)})}function N3(e){var t=e.usePublisher,n=e.useEmitter,r=e.useEmitterValue;return d.memo(function(e){var i=e.style,a=e.children,o=h4(e,ome),s=t(`windowScrollContainerState`),c=r(`ScrollerComponent`),l=t(`smoothScrollTargetReached`),u=r(`totalListHeight`),f=r(`deviation`),p=r(`customScrollParent`),m=r(`context`),h=E4(s,l,c,B2,p),g=h.scrollerRef,_=h.scrollByCallback,v=h.scrollToCallback;return Rpe(function(){return g.current=p||window,function(){g.current=null}},[g,p]),n(`windowScrollTo`,v),n(`scrollBy`,_),(0,d.createElement)(c,m4({style:m4({position:`relative`},i,u===0?{}:{height:u+f}),"data-virtuoso-scroller":!0},o,j3(c,m)),a)})}var gme=function(e){var t=e.children,n=(0,d.useContext)(E3),r=F3(`viewportHeight`),i=F3(`fixedItemHeight`),a=S4(P2(r,function(e){return w4(e,`height`)}));return d.useEffect(function(){n&&(r(n.viewportHeight),i(n.itemHeight))},[n,r,i]),d.createElement(`div`,{style:A3,ref:a,"data-viewport-type":`element`},t)},_me=function(e){var t=e.children,n=(0,d.useContext)(E3),r=F3(`windowViewportRect`),i=F3(`fixedItemHeight`),a=T3(r,I3(`customScrollParent`));return d.useEffect(function(){n&&(i(n.itemHeight),r({offsetTop:0,visibleHeight:n.viewportHeight,visibleWidth:100}))},[n,r,i]),d.createElement(`div`,{ref:a,style:A3,"data-viewport-type":`window`},t)},vme=function(e){var t=e.children,n=I3(`TopItemListComponent`),r=I3(`headerHeight`),i=m4({},pme,{marginTop:r+`px`}),a=I3(`context`);return(0,d.createElement)(n||`div`,{style:i,context:a},t)},P3=p4(cme,{required:{},optional:{context:`context`,followOutput:`followOutput`,firstItemIndex:`firstItemIndex`,itemContent:`itemContent`,groupContent:`groupContent`,overscan:`overscan`,increaseViewportBy:`increaseViewportBy`,totalCount:`totalCount`,topItemCount:`topItemCount`,initialTopMostItemIndex:`initialTopMostItemIndex`,components:`components`,groupCounts:`groupCounts`,atBottomThreshold:`atBottomThreshold`,atTopThreshold:`atTopThreshold`,computeItemKey:`computeItemKey`,defaultItemHeight:`defaultItemHeight`,fixedItemHeight:`fixedItemHeight`,itemSize:`itemSize`,scrollSeekConfiguration:`scrollSeekConfiguration`,headerFooterTag:`headerFooterTag`,data:`data`,initialItemCount:`initialItemCount`,initialScrollTop:`initialScrollTop`,alignToBottom:`alignToBottom`,useWindowScroll:`useWindowScroll`,customScrollParent:`customScrollParent`,scrollerRef:`scrollerRef`,logLevel:`logLevel`,react18ConcurrentRendering:`react18ConcurrentRendering`,item:`item`,group:`group`,topItems:`topItems`,itemHeight:`itemHeight`,scrollingStateChange:`scrollingStateChange`,maxHeightCacheSize:`maxHeightCacheSize`,footer:`footer`,header:`header`,ItemContainer:`ItemContainer`,ScrollContainer:`ScrollContainer`,ListContainer:`ListContainer`,GroupContainer:`GroupContainer`,emptyComponent:`emptyComponent`,HeaderContainer:`HeaderContainer`,FooterContainer:`FooterContainer`,scrollSeek:`scrollSeek`},methods:{scrollToIndex:`scrollToIndex`,scrollIntoView:`scrollIntoView`,scrollTo:`scrollTo`,scrollBy:`scrollBy`,adjustForPrependedItems:`adjustForPrependedItems`,autoscrollToBottom:`autoscrollToBottom`},events:{isScrolling:`isScrolling`,endReached:`endReached`,startReached:`startReached`,rangeChanged:`rangeChanged`,atBottomStateChange:`atBottomStateChange`,atTopStateChange:`atTopStateChange`,totalListHeightChanged:`totalListHeightChanged`,itemsRendered:`itemsRendered`,groupIndices:`groupIndices`}},d.memo(function(e){var t=I3(`useWindowScroll`),n=I3(`topItemsIndexes`).length>0,r=I3(`customScrollParent`),i=r||t?_me:gme;return d.createElement(r||t?xme:bme,m4({},e),d.createElement(i,null,d.createElement(mme,null),d.createElement(k3,null),d.createElement(hme,null)),n&&d.createElement(vme,null,d.createElement(k3,{showTopList:!0})))})),yme=P3.Component,F3=P3.usePublisher,I3=P3.useEmitterValue,L3=P3.useEmitter,bme=M3({usePublisher:F3,useEmitterValue:I3,useEmitter:L3}),xme=N3({usePublisher:F3,useEmitterValue:I3,useEmitter:L3}),R3={items:[],offsetBottom:0,offsetTop:0,top:0,bottom:0,itemHeight:0,itemWidth:0},Sme={items:[{index:0}],offsetBottom:0,offsetTop:0,top:0,bottom:0,itemHeight:0,itemWidth:0},z3=Math.round,B3=Math.ceil,V3=Math.floor,H3=Math.min,U3=Math.max;function W3(e,t){return Array.from({length:t-e+1}).map(function(t,n){return{index:n+e}})}function Cme(e,t){return e&&e.column===t.column&&e.row===t.row}var wme=l4(function(e){var t=e[0],n=t.overscan,r=t.visibleRange,i=t.listBoundary,a=e[1],o=a.scrollTop,s=a.viewportHe
500ight,c=a.scrollBy,l=a.scrollTo,u=a.smoothScrollTargetReached,d=a.scrollContainerState,f=e[2],p=e[3],m=e[4],h=m.propsReady,g=m.didMount,_=e[5],v=_.windowViewportRect,y=_.windowScrollTo,b=_.useWindowScroll,x=_.customScrollParent,S=_.windowScrollContainerState,C=e[6],w=Q(0),T=Q(0),E=Q(R3),D=Q({height:0,width:0}),O=Q({height:0,width:0}),k=q2(),A=q2(),j=Q(0),M=Q({row:0,column:0});G2($(g,a4(T),Q2(function(e){return e[1]!==0}),$2(function(e){return{items:W3(0,e[1]-1),top:0,bottom:0,offsetBottom:0,offsetTop:0,itemHeight:0,itemWidth:0}})),E),G2($(c4(s4(w),r,s4(M,Cme),s4(O,function(e,t){return e&&e.width===t.width&&e.height===t.height})),a4(D),$2(function(e){var t=e[0],n=t[0],r=t[1],i=r[0],a=r[1],o=t[2],s=t[3],c=e[1],l=o.row,u=s.height,d=s.width,f=c.width;if(n===0||f===0)return R3;if(d===0)return Sme;var p=q3(f,d,o.column),m=p*V3((i+l)/(u+l)),h=p*B3((a+l)/(u+l))-1;h=U3(0,H3(n-1,h));var g=W3(m=H3(h,U3(0,m)),h),_=G3(c,o,s,g),v=_.top,y=_.bottom,b=B3(n/p);return{items:g,offsetTop:v,offsetBottom:b*u+(b-1)*l-y,top:v,bottom:y,itemHeight:u,itemWidth:d}})),E),G2($(D,$2(function(e){return e.height})),s),G2($(c4(D,O,E,M),$2(function(e){var t=G3(e[0],e[3],e[1],e[2].items);return[t.top,t.bottom]}),Z2(u3)),i);var N=J2($(s4(E),Q2(function(e){return e.items.length>0}),a4(w),Q2(function(e){var t=e[0].items;return t[t.length-1].index===e[1]-1}),$2(function(e){return e[1]-1}),Z2())),P=J2($(s4(E),Q2(function(e){var t=e.items;return t.length>0&&t[0].index===0}),e4(0),Z2())),ee=J2($(s4(E),Q2(function(e){return e.items.length>0}),$2(function(e){var t=e.items;return{startIndex:t[0].index,endIndex:t[t.length-1].index}}),Z2(d3)));G2(ee,p.scrollSeekRangeChanged),G2($(k,a4(D,O,w,M),$2(function(e){var t=e[1],n=e[2],r=e[3],i=e[4],a=n3(e[0]),o=a.align,s=a.behavior,c=a.offset,l=a.index;l===`LAST`&&(l=r-1);var u=K3(t,i,n,l=U3(0,l,H3(r-1,l)));return o===`end`?u=z3(u-t.height+n.height):o===`center`&&(u=z3(u-t.height/2+n.height/2)),c&&(u+=c),{top:u,behavior:s}})),l);var F=Y2($(E,$2(function(e){return e.offsetBottom+e.bottom})),0);return G2($(v,$2(function(e){return{width:e.visibleWidth,height:e.visibleHeight}})),D),m4({totalCount:w,viewportDimensions:D,itemDimensions:O,scrollTop:o,scrollHeight:A,overscan:n,scrollBy:c,scrollTo:l,scrollToIndex:k,smoothScrollTargetReached:u,windowViewportRect:v,windowScrollTo:y,useWindowScroll:b,customScrollParent:x,windowScrollContainerState:S,deviation:j,scrollContainerState:d,initialItemCount:T,gap:M},p,{gridState:E,totalListHeight:F},f,{startReached:P,endReached:N,rangeChanged:ee,propsReady:h},C)},R2(m3,D4,a3,y3,o3,S3,b4));function G3(e,t,n,r){var i=n.height;return i===void 0||r.length===0?{top:0,bottom:0}:{top:K3(e,t,n,r[0].index),bottom:K3(e,t,n,r[r.length-1].index)+i}}function K3(e,t,n,r){var i=V3(r/q3(e.width,n.width,t.column)),a=i*n.height+U3(0,i-1)*t.row;return a>0?a+t.row:a}function q3(e,t,n){return U3(1,V3((e+n)/(t+n)))}var Tme=[`placeholder`],Eme=l4(function(e){var t=e[0],n=e[1],r={item:O3(n.itemContent,`Rename the %citem%c prop to %citemContent.`),ItemContainer:q2(),ScrollContainer:q2(),ListContainer:q2(),emptyComponent:q2(),scrollSeek:q2()};function i(e,t,r){G2($(e,a4(n.components),$2(function(e){var n,i=e[0],a=e[1];return console.warn(`react-virtuoso: `+r+` property is deprecated. Pass components.`+t+` instead.`),m4({},a,((n={})[t]=i,n))})),n.components)}return V2(r.scrollSeek,function(e){var r=e.placeholder,i=h4(e,Tme);console.warn(`react-virtuoso: scrollSeek property is deprecated. Pass scrollSeekConfiguration and specify the placeholder in components.ScrollSeekPlaceholder instead.`),H2(n.components,m4({},W2(n.components),{ScrollSeekPlaceholder:r})),H2(t.scrollSeekConfiguration,i)}),i(r.ItemContainer,`Item`,`ItemContainer`),i(r.ListContainer,`List`,`ListContainer`),i(r.ScrollContainer,`Scroller`,`ScrollContainer`),m4({},t,n,r)},R2(wme,l4(function(){var e=Q(function(e){return`Item `+e}),t=Q({}),n=Q(null),r=Q(`virtuoso-grid-item`),i=Q(`virtuoso-grid-list`),a=Q(D3),o=Q(B2),s=function(e,n){return n===void 0&&(n=null),Y2($(t,$2(function(t){return t[e]}),Z2()),n)};return{context:n,itemContent:e,components:t,computeItemKey:a,itemClassName:r,listClassName:i,scrollerRef:o,ListComponent:s(`List`,`div`),Item
500Component:s(`Item`,`div`),ScrollerComponent:s(`Scroller`,`div`),ScrollSeekPlaceholder:s(`ScrollSeekPlaceholder`,`div`)}}))),Dme=d.memo(function(){var e=X3(`gridState`),t=X3(`listClassName`),n=X3(`itemClassName`),r=X3(`itemContent`),i=X3(`computeItemKey`),a=X3(`isSeeking`),o=Y3(`scrollHeight`),s=X3(`ItemComponent`),c=X3(`ListComponent`),l=X3(`ScrollSeekPlaceholder`),u=X3(`context`),f=Y3(`itemDimensions`),p=Y3(`gap`),m=X3(`log`),h=S4(function(e){o(e.parentElement.parentElement.scrollHeight);var t=e.firstChild;t&&f(t.getBoundingClientRect()),p({row:Q3(`row-gap`,getComputedStyle(e).rowGap,m),column:Q3(`column-gap`,getComputedStyle(e).columnGap,m)})});return(0,d.createElement)(c,m4({ref:h,className:t},j3(c,u),{style:{paddingTop:e.offsetTop,paddingBottom:e.offsetBottom}}),e.items.map(function(t){var o=i(t.index);return a?(0,d.createElement)(l,m4({key:o},j3(l,u),{index:t.index,height:e.itemHeight,width:e.itemWidth})):(0,d.createElement)(s,m4({},j3(s,u),{className:n,"data-index":t.index,key:o}),r(t.index,u))}))}),Ome=function(e){var t=e.children,n=Y3(`viewportDimensions`),r=S4(function(e){n(e.getBoundingClientRect())});return d.createElement(`div`,{style:A3,ref:r},t)},kme=function(e){var t=e.children,n=T3(Y3(`windowViewportRect`),X3(`customScrollParent`));return d.createElement(`div`,{ref:n,style:A3},t)},J3=p4(Eme,{optional:{context:`context`,totalCount:`totalCount`,overscan:`overscan`,itemContent:`itemContent`,components:`components`,computeItemKey:`computeItemKey`,initialItemCount:`initialItemCount`,scrollSeekConfiguration:`scrollSeekConfiguration`,listClassName:`listClassName`,itemClassName:`itemClassName`,useWindowScroll:`useWindowScroll`,customScrollParent:`customScrollParent`,scrollerRef:`scrollerRef`,item:`item`,ItemContainer:`ItemContainer`,ScrollContainer:`ScrollContainer`,ListContainer:`ListContainer`,scrollSeek:`scrollSeek`},methods:{scrollTo:`scrollTo`,scrollBy:`scrollBy`,scrollToIndex:`scrollToIndex`},events:{isScrolling:`isScrolling`,endReached:`endReached`,startReached:`startReached`,rangeChanged:`rangeChanged`,atBottomStateChange:`atBottomStateChange`,atTopStateChange:`atTopStateChange`}},d.memo(function(e){var t=m4({},e),n=X3(`useWindowScroll`),r=X3(`customScrollParent`),i=r||n?kme:Ome;return d.createElement(r||n?jme:Ame,m4({},t),d.createElement(i,null,d.createElement(Dme,null)))}));J3.Component;var Y3=J3.usePublisher,X3=J3.useEmitterValue,Z3=J3.useEmitter,Ame=M3({usePublisher:Y3,useEmitterValue:X3,useEmitter:Z3}),jme=N3({usePublisher:Y3,useEmitterValue:X3,useEmitter:Z3});function Q3(e,t,n){return t===`normal`||t!=null&&t.endsWith(`px`)||n(e+` was not resolved to pixel value correctly`,t,y4.WARN),t===`normal`?0:parseInt(t??`0`,10)}var Mme=l4(function(e){return m4({},e[0],e[1])},R2(C3,l4(function(){var e=Q(function(e){return d.createElement(`td`,null,`Item $`,e)}),t=Q(null),n=Q(null),r=Q(null),i=Q({}),a=Q(D3),o=Q(B2),s=function(e,t){return t===void 0&&(t=null),Y2($(i,$2(function(t){return t[e]}),Z2()),t)};return{context:t,itemContent:e,fixedHeaderContent:n,fixedFooterContent:r,components:i,computeItemKey:a,scrollerRef:o,TableComponent:s(`Table`,`table`),TableHeadComponent:s(`TableHead`,`thead`),TableFooterComponent:s(`TableFoot`,`tfoot`),TableBodyComponent:s(`TableBody`,`tbody`),TableRowComponent:s(`TableRow`,`tr`),ScrollerComponent:s(`Scroller`,`div`),EmptyPlaceholder:s(`EmptyPlaceholder`),ScrollSeekPlaceholder:s(`ScrollSeekPlaceholder`),FillerRow:s(`FillerRow`)}}))),Nme=function(e){return d.createElement(`tr`,null,d.createElement(`td`,{style:{height:e.height}}))},Pme=function(e){return d.createElement(`tr`,null,d.createElement(`td`,{style:{height:e.height,padding:0,border:0}}))},Fme=d.memo(function(){var e=t6(`listState`),t=e6(`sizeRanges`),n=t6(`useWindowScroll`),r=t6(`customScrollParent`),i=e6(`windowScrollContainerState`),a=e6(`scrollContainerState`),o=r||n?i:a,s=t6(`itemContent`),c=t6(`trackItemSizes`),l=C4(t,t6(`itemSize`),c,o,t6(`log`),void 0,r),u=l.callbackRef,f=l.ref,p=d.useState(0),m=p[0],h=p[1];n6(`deviation`,function(e){m!==e&&(f.current.style.marginTop=e+`px`,h(e))});var g=t6(`EmptyPlaceholder`),_=t6(`ScrollSeekPlaceholder`)||Nme,v=t
5006(`FillerRow`)||Pme,y=t6(`TableBodyComponent`),b=t6(`TableRowComponent`),x=t6(`computeItemKey`),S=t6(`isSeeking`),C=t6(`paddingTopAddition`),w=t6(`firstItemIndex`),T=t6(`statefulTotalCount`),E=t6(`context`);if(T===0&&g)return(0,d.createElement)(g,j3(g,E));var D=e.offsetTop+C+m,O=e.offsetBottom,k=D>0?d.createElement(v,{height:D,key:`padding-top`}):null,A=O>0?d.createElement(v,{height:O,key:`padding-bottom`}):null,j=e.items.map(function(e){var t=e.originalIndex,n=x(t+w,e.data,E);return S?(0,d.createElement)(_,m4({},j3(_,E),{key:n,index:e.index,height:e.size,type:e.type||`item`})):(0,d.createElement)(b,m4({},j3(b,E),{key:n,"data-index":t,"data-known-size":e.size,"data-item-index":e.index,style:{overflowAnchor:`none`}}),s(e.index,e.data,E))});return(0,d.createElement)(y,m4({ref:u,"data-test-id":`virtuoso-item-list`},j3(y,E)),[k].concat(j,[A]))}),Ime=function(e){var t=e.children,n=(0,d.useContext)(E3),r=e6(`viewportHeight`),i=e6(`fixedItemHeight`),a=S4(P2(r,function(e){return w4(e,`height`)}));return d.useEffect(function(){n&&(r(n.viewportHeight),i(n.itemHeight))},[n,r,i]),d.createElement(`div`,{style:A3,ref:a,"data-viewport-type":`element`},t)},Lme=function(e){var t=e.children,n=(0,d.useContext)(E3),r=e6(`windowViewportRect`),i=e6(`fixedItemHeight`),a=T3(r,t6(`customScrollParent`));return d.useEffect(function(){n&&(i(n.itemHeight),r({offsetTop:0,visibleHeight:n.viewportHeight,visibleWidth:100}))},[n,r,i]),d.createElement(`div`,{ref:a,style:A3,"data-viewport-type":`window`},t)},$3=p4(Mme,{required:{},optional:{context:`context`,followOutput:`followOutput`,firstItemIndex:`firstItemIndex`,itemContent:`itemContent`,fixedHeaderContent:`fixedHeaderContent`,fixedFooterContent:`fixedFooterContent`,overscan:`overscan`,increaseViewportBy:`increaseViewportBy`,totalCount:`totalCount`,topItemCount:`topItemCount`,initialTopMostItemIndex:`initialTopMostItemIndex`,components:`components`,groupCounts:`groupCounts`,atBottomThreshold:`atBottomThreshold`,atTopThreshold:`atTopThreshold`,computeItemKey:`computeItemKey`,defaultItemHeight:`defaultItemHeight`,fixedItemHeight:`fixedItemHeight`,itemSize:`itemSize`,scrollSeekConfiguration:`scrollSeekConfiguration`,data:`data`,initialItemCount:`initialItemCount`,initialScrollTop:`initialScrollTop`,alignToBottom:`alignToBottom`,useWindowScroll:`useWindowScroll`,customScrollParent:`customScrollParent`,scrollerRef:`scrollerRef`,logLevel:`logLevel`,react18ConcurrentRendering:`react18ConcurrentRendering`},methods:{scrollToIndex:`scrollToIndex`,scrollIntoView:`scrollIntoView`,scrollTo:`scrollTo`,scrollBy:`scrollBy`},events:{isScrolling:`isScrolling`,endReached:`endReached`,startReached:`startReached`,rangeChanged:`rangeChanged`,atBottomStateChange:`atBottomStateChange`,atTopStateChange:`atTopStateChange`,totalListHeightChanged:`totalListHeightChanged`,itemsRendered:`itemsRendered`,groupIndices:`groupIndices`}},d.memo(function(e){var t=t6(`useWindowScroll`),n=t6(`customScrollParent`),r=e6(`fixedHeaderHeight`),i=e6(`fixedFooterHeight`),a=t6(`fixedHeaderContent`),o=t6(`fixedFooterContent`),s=t6(`context`),c=S4(P2(r,function(e){return w4(e,`height`)})),l=S4(P2(i,function(e){return w4(e,`height`)})),u=n||t?zme:Rme,f=n||t?Lme:Ime,p=t6(`TableComponent`),m=t6(`TableHeadComponent`),h=t6(`TableFooterComponent`),g=a?d.createElement(m,m4({key:`TableHead`,style:{zIndex:1,position:`sticky`,top:0},ref:c},j3(m,s)),a()):null,_=o?d.createElement(h,m4({key:`TableFoot`,style:{zIndex:1,position:`sticky`,bottom:0},ref:l},j3(h,s)),o()):null;return d.createElement(u,m4({},e),d.createElement(f,null,d.createElement(p,m4({style:{borderSpacing:0}},j3(p,s)),[g,d.createElement(Fme,{key:`TableBody`}),_])))}));$3.Component;var e6=$3.usePublisher,t6=$3.useEmitterValue,n6=$3.useEmitter,Rme=M3({usePublisher:e6,useEmitterValue:t6,useEmitter:n6}),zme=N3({usePublisher:e6,useEmitterValue:t6,useEmitter:n6}),Bme=yme,r6={Error:`AI_STATE_ERROR`,ExternalSources:`AI_STATE_EXTERNAL_SOURCES`,Generating:`AI_STATE_GENERATING`,Idle:`AI_STATE_IDLE`,Stop:`AI_STATE_STOP`,Thinking:`AI_STATE_THINKING`},Vme=e=>{let[t,n]=(0,d.useState)(r6.Idle);return(0,d.useEffect)(()=>
500{if(!e)return;let t=e.on(`ai_indicator.update`,t=>{let{cid:r}=t,i=t.ai_state;e.cid===r&&n(i)}),r=e.on(`ai_indicator.clear`,t=>{let{cid:r}=t;e.cid===r&&n(r6.Idle)}),i=e.on(`ai_indicator.stop`,t=>{let{cid:r}=t;e.cid===r&&n(r6.Stop)});return()=>{t.unsubscribe(),r.unsubscribe(),i.unsubscribe()}},[e]),{aiState:t}},i6=(0,d.createContext)({fileInput:null}),Hme=({children:e,value:t})=>(0,R.jsx)(i6.Provider,{value:t,children:e}),Ume=()=>(0,d.useContext)(i6),a6=d.createContext(void 0),Wme=({children:e,value:t})=>(0,R.jsx)(a6.Provider,{value:t,children:e}),o6=e=>(0,d.useContext)(a6)||{},s6=new WeakMap,c6=e=>{if(s6.has(e))return;let t=e.state.getLatestValue(),n=e.textComposer.state.getLatestValue(),r=e.attachmentManager.state.getLatestValue(),i=e.linkPreviewsManager.state.getLatestValue(),a=e.locationComposer.state.getLatestValue(),o=e.pollComposer.state.getLatestValue(),s=e.customDataManager.state.getLatestValue();s6.set(e,()=>{e.state.next(t),e.textComposer.state.next(n),e.attachmentManager.state.next(r),e.linkPreviewsManager.state.next(i),e.locationComposer.state.next(a),e.pollComposer.state.next(o),e.customDataManager.state.next(s)})},Gme=e=>{let t=s6.get(e);s6.delete(e),t?t():e.clear()},Kme=e=>{s6.delete(e)},l6=(0,d.createContext)(void 0);function qme(e){return(0,d.useContext)(l6)||(console.warn(`The useMessageBounceContext hook was called outside of the MessageBounceContext provider. The errored call is located in the ${e} component.`),{})}function Jme({children:e}){let t=IW(),{handleRetry:n,message:r}=o6(`MessageBounceProvider`);hW(r)||console.warn(`The MessageBounceProvider was rendered for a message that is not bounced. Have you missed the "isMessageBounced" check?`);let{removeMessage:i}=zB(`MessageBounceProvider`),a=(0,d.useCallback)(()=>{i(r)},[r,i]),o=(0,d.useCallback)(e=>{e.preventDefault(),c6(t),t.initState({composition:r})},[r,t]),s=(0,d.useCallback)(()=>{n(r)},[n,r]),c=(0,d.useMemo)(()=>({handleDelete:a,handleEdit:o,handleRetry:s,message:r}),[a,o,s,r]);return(0,R.jsx)(l6.Provider,{value:c,children:e})}var Yme=(0,d.createContext)(void 0),Xme=({children:e,value:t})=>(0,R.jsx)(Yme.Provider,{value:t,children:e}),u6=({language:e,message:t})=>t?.i18n?.[`${e}_text`],d6={getTranslationView:(e,t)=>t?`translated`:`original`,setTranslationView:()=>{}},f6=(0,d.createContext)(d6),p6=({children:e})=>{let[t,n]=(0,d.useState)({}),r=(0,d.useCallback)((e,t)=>{n(n=>({...n,[e]:t}))},[]),i=(0,d.useCallback)((e,n)=>t[e]??(n?`translated`:`original`),[t]),a=d.useMemo(()=>({getTranslationView:i,setTranslationView:r}),[i,r]);return(0,R.jsx)(f6.Provider,{value:a,children:e})},Zme=()=>(0,d.useContext)(f6)??d6,m6=d.createContext(void 0),Qme=({children:e,value:t})=>(0,R.jsx)(m6.Provider,{value:t,children:e}),h6=()=>(0,d.useContext)(m6)||(console.warn(`The useModalContext hook was called outside of the ModalContext provider. Make sure this hook is called within a child of the GlobalModal.`),{close:()=>null}),g6=d.createContext(void 0),$me=({children:e,poll:t})=>t?(0,R.jsx)(g6.Provider,{value:{poll:t},children:e}):null,_6=()=>(0,d.useContext)(g6),ehe={border:0,clip:`rect(0, 0, 0, 0)`,height:`1px`,margin:`-1px`,overflow:`hidden`,padding:0,position:`absolute`,whiteSpace:`nowrap`,width:`1px`},v6=({children:e,style:t,...n})=>(0,R.jsx)(`span`,{...n,style:{...ehe,...t},children:e}),the=()=>void 0,y6=(0,d.createContext)(void 0),nhe=()=>{let e=(0,d.useContext)(y6);return e?e.announce:(console.warn(`The useAriaLiveAnnouncer hook was called outside of the AriaLiveRegion provider.`),the)},b6=({children:e})=>{let[t,n]=(0,d.useState)(``),[r,i]=(0,d.useState)(``),a=(0,d.useRef)({assertive:0,polite:0}),o=(0,d.useRef)({assertive:void 0,polite:void 0}),s=(0,d.useRef)(!1),c=(0,d.useCallback)(e=>{o.current[e]&&(clearTimeout(o.current[e]),o.current[e]=void 0)},[]),l=(0,d.useCallback)(()=>{c(`assertive`),c(`polite`)},[c]),u=(0,d.useCallback)((e,t=`polite`)=>{let r=t===`assertive`?n:i,l=a.current[t]+1;a.current[t]=l,c(t),r(``),o.current[t]=setTimeout(()=>{s.current||a.current[t]===l&&(r(e),o.current[t]=void 0)},50)},[c]);(0,d.useEffect)(()=>(s.current=!1,()=>{s.current=!0,l()}),[l]);let f=(0,d.useMemo)(()=>({announce:u}),[u]),p=(0,d.useCallback)(()=>document.body,[]);return(0,R.jsxs)(y6.Provider,{value:f,children:[e,(0,R.jsx)(cV,{getPortalDestination:p,isOpen:!0,children:(0,R.jsxs)(v6,{children:[(0,R.jsx)(`div`,{"aria-atomic":`true`,"aria-live":`polite`,"aria-relevant":`additions text`,"data-testid":`str-chat__aria-l
500ive-region--polite`,role:`status`,children:r}),(0,R.jsx)(`div`,{"aria-atomic":`true`,"aria-live":`assertive`,"aria-relevant":`additions text`,"data-testid":`str-chat__aria-live-region--assertive`,role:`alert`,children:t})]})})]})},x6=d.createContext({displayFilter:()=>!0}),rhe=({children:e,displayFilter:t})=>{let n=(0,d.useContext)(x6),r=(0,d.useMemo)(()=>({displayFilter:t??n.displayFilter}),[t,n.displayFilter]);return(0,R.jsx)(x6.Provider,{value:r,children:e})},ihe=()=>(0,d.useContext)(x6),S6=e=>{let{client:t}=K(),{displayFilter:n}=ihe(),{applyDisplayFilter:r,fallbackPanel:i,filter:a,panel:o}=e??{},s=(0,d.useCallback)(e=>({notifications:e.notifications.filter(e=>o&&!JV(e,o,{fallbackPanel:i})||r&&!n({fallbackPanel:i,filter:a,notification:e,panel:o})?!1:a?a(e):!0)}),[r,n,i,a,o]),{notifications:c}=J(t.notifications.store,s);return c},ahe=e=>e?.trim().replace(/[^A-Za-z0-9:_-]/g,`-`)??``,C6=(e,t)=>e?`${e}-${t}`:void 0,w6=e=>{let t=ahe(e);return(0,d.useMemo)(()=>({descriptionId:C6(t,`description`),titleId:C6(t,`title`)}),[t])},ohe=(0,d.forwardRef)(function({children:e,className:t,...n},r){return(0,R.jsx)(`div`,{...n,className:G(`str-chat__alert-root`,t),ref:r,children:e})}),she=(0,d.forwardRef)(function({children:e,className:t,description:n,descriptionId:r,Icon:i,title:a,titleId:o,...s},c){let{dialogId:l}=h6(),{descriptionId:u,titleId:d}=w6(l),f=o??d,p=r??u;return(0,R.jsx)(`div`,{...s,className:G(`str-chat__alert-header`,t),ref:c,children:a?(0,R.jsxs)(R.Fragment,{children:[i&&(0,R.jsx)(i,{}),(0,R.jsxs)(`div`,{className:`str-chat__alert-header__copy`,children:[(0,R.jsx)(`h2`,{className:`str-chat__alert-header__title`,id:f,children:a}),n&&(0,R.jsx)(`p`,{className:`str-chat__alert-header__description`,id:p,children:n})]})]}):e})}),T6={Actions:(0,d.forwardRef)(function({children:e,className:t,...n},r){return(0,R.jsx)(`div`,{...n,className:G(`str-chat__alert-actions`,t),ref:r,children:e})}),Header:she,Root:ohe};function E6({allowFlip:e,offset:t,open:n,placement:r,referenceElement:i,updateKey:a,updatePositionOnContentResize:o=!1}){let[s,c]=(0,d.useState)(null),[l,u]=(0,d.useState)(null),{placement:f,refs:p,strategy:m,update:h,x:g,y:_}=QV({allowFlip:e,freeze:!0,offset:t,placement:l??r});!l&&s&&r!==f?u(f):l&&!s&&u(null);let v=(0,d.useRef)(null);n&&i&&!v.current&&(v.current=i),n||(v.current=null);let y=n?v.current:i;return(0,d.useEffect)(()=>{p.setReference(y)},[y,p]),(0,d.useEffect)(()=>{p.setFloating(s)},[s,p]),(0,d.useEffect)(()=>{n&&s&&y&&h?.()},[n,r,s,h,a,y]),(0,d.useEffect)(()=>{if(!s||!o)return;let e=new ResizeObserver(h);return e.observe(s),()=>{e.disconnect()}},[s,h,o]),s&&!n&&c(null),{placement:l??f,setPopperElement:c,styles:{left:g??0,position:m,top:_??0}}}var D6=({allowFlip:e=!0,children:t,className:n,closeOnClickOutside:r,closeTransitionMs:i=0,dialogManagerId:a,focus:o=!0,id:s,offset:c,placement:l=`auto`,referenceElement:u=null,tabIndex:f,trapFocus:p,updateKey:m,updatePositionOnContentResize:h,...g})=>{let _=QB({closeOnClickOutside:r,dialogManagerId:a,id:s}),v=nV(s,a),[y,b]=(0,d.useState)(v),x=(0,d.useRef)(null),S=!v&&y;(0,d.useEffect)(()=>{if(v){b(!0),x.current&&=(clearTimeout(x.current),null);return}if(y){if(!i){b(!1);return}x.current=setTimeout(()=>{b(!1),x.current=null},i)}},[i,v,y]),(0,d.useEffect)(()=>()=>{x.current&&clearTimeout(x.current)},[]);let{placement:C,setPopperElement:w,styles:T}=E6({allowFlip:e,offset:c,open:y,placement:l,referenceElement:u,updateKey:m,updatePositionOnContentResize:h});if((0,d.useEffect)(()=>{if(!v)return;let e=e=>{e.key!==`Escape`||e.defaultPrevented||_?.close()};return document.addEventListener(`keyup`,e),()=>{document.removeEventListener(`keyup`,e)}},[_,v]),!y)return null;let{"aria-describedby":E,"aria-label":D,"aria-labelledby":O,"aria-modal":k,role:A,...j}=g,M=p?A??`dialog`:A,N=p?!0:k,P=O?void 0:D;return(0,R.jsx)(dV,{dialogId:s,dialogManagerId:a,children:(0,R.jsx)(pq,{autoFocus:o,contain:p,restoreFocus:!0,children:(0,R.jsx)(`div`,{...j,"aria-describedby":E,"aria-label":P,"aria-labelledby":O,"aria-modal":N,className:G(`str-chat__dialog-contents`,n),"data-str-chat-dialog-state":S?`closing`:`open`,"data-str-chat-placement":C,"data-testid":`str-chat__dialog-contents`,ref:w,role:M,style:T,tabIndex:f===void 0?0:f,children:t})})})},O6=({className:e,isPlaying:t,...n})=>{let{t:r}=Y();return(0,R.jsx)(nH,{appearance:`outline`,"aria-label":r(t?`aria/Pause`:`aria/Play`),circular:!0,className:G(`str-chat__button-play`,e),"data-testid":t?`pause
500-audio`:`play-audio`,size:`sm`,variant:`secondary`,...n,children:t?(0,R.jsx)(uU,{}):(0,R.jsx)(gU,{})})},che=({children:e,className:t,dialogManagerId:n,id:r,onClose:i,...a})=>{let{CalloutDialog:o=lhe}=q(),s=nV(r,n);return(0,R.jsx)(D6,{...a,dialogManagerId:n,id:r,children:s&&(0,R.jsx)(o,{className:t,onClose:i,children:e})})},lhe=({children:e,className:t,onClose:n})=>{let{t:r}=Y();return(0,R.jsxs)(`div`,{className:`str-chat__callout`,children:[e,(0,R.jsx)(nH,{appearance:`ghost`,"aria-label":r(`aria/Close callout dialog`),circular:!0,className:G(t,`str-chat__callout__close-button`),onClick:n,size:`sm`,variant:`secondary`,children:(0,R.jsx)(RH,{})})]})},uhe=e=>{let t=/(\p{L}{1})\p{L}+/gu;if(!e||e.trim().length===0)return``;let n=Array.from(e?.matchAll(t)||[]);return n.length?`${n.at(0)[1]}${n.length>1?n.at(-1)[1]:``}`:``},k6=({className:e,imageUrl:t,isOnline:n,size:r,userName:i,...a})=>{let[o,s]=(0,d.useState)(!1);(0,d.useEffect)(()=>()=>s(!1),[t]);let c=i?.toString()||``,l=c.trim(),u=(0,d.useMemo)(()=>{let e=uhe(c);return r===`sm`||r===`xs`?e.charAt(0):e},[c,r]),f=typeof t==`string`&&t&&!o;return(0,R.jsxs)(`div`,{className:G(`str-chat__avatar`,e,{"str-chat__avatar--multiple-letters":u.length>1,"str-chat__avatar--no-letters":!u.length,"str-chat__avatar--one-letter":u.length===1,[`str-chat__avatar--size-${r}`]:typeof r==`string`}),"data-testid":`avatar`,role:`button`,title:i,...a,children:[typeof n==`boolean`&&(0,R.jsx)(`div`,{className:G(`str-chat__avatar-status-badge`,{"str-chat__avatar-status-badge--offline":!n,"str-chat__avatar-status-badge--online":n})}),f?(0,R.jsx)(`img`,{alt:l,className:`str-chat__avatar-image`,"data-testid":`avatar-img`,onError:()=>s(!0),src:t}):(0,R.jsxs)(R.Fragment,{children:[!!u.length&&(0,R.jsx)(`div`,{className:`str-chat__avatar-initials`,"data-testid":`avatar-fallback`,children:u}),!u.length&&(0,R.jsx)(dU,{})]})]})},A6=({children:e,className:t,size:n=`md`,variant:r=`default`,...i})=>(0,R.jsx)(`div`,{...i,className:G(`str-chat__badge`,`str-chat__badge--variant-${r}`,{[`str-chat__badge--size-${n}`]:n},t),children:e}),dhe=({className:e,size:t=`sm`,...n})=>(0,R.jsx)(A6,{...n,className:e,size:t,variant:`error`,children:(0,R.jsx)(qH,{})});function j6({badgeSize:e,capLimit:t=3,component:n=`div`,displayInfo:r=[],size:i}){let{Avatar:a=k6}=q(j6.name),o=(0,d.useMemo)(()=>r.length>t?r.slice(0,t):r,[r,t]),s=r.length-o.length;return r.length?(0,R.jsxs)(n,{className:G(`str-chat__avatar-stack`,{[`str-chat__avatar-stack--size-${i}`]:typeof i==`string`}),"data-testid":`avatar-stack`,children:[o.map((e,t)=>(0,R.jsx)(a,{imageUrl:e.imageUrl,size:i,userName:e.userName},e.id??`${e.userName}-${e.imageUrl}-${t}`)),typeof s==`number`&&s>0&&(0,R.jsxs)(A6,{className:`str-chat__avatar-stack__count-badge`,"data-testid":`avatar-stack-count-badge`,size:e??i,variant:`counter`,children:[`+`,s]})]}):null}var fhe=({displayMembers:e,imageUrl:t,size:n,userName:r,...i})=>(0,R.jsx)(phe,{displayMembers:(0,d.useMemo)(()=>e&&e.length>0?e:[{imageUrl:t,userName:r}],[e,t,r]),size:n,...i}),phe=({badgeSize:e,className:t,displayMembers:n=[],isOnline:r,size:i,...a})=>{let o=(0,d.useMemo)(()=>n.length>4?n.slice(0,2):n,[n]),s=n.length-o.length;if(n.length<2){let e=n[0];return(0,R.jsx)(k6,{imageUrl:e?.imageUrl,isOnline:r,size:i,userName:e?.userName,...a})}let c=null;return i===`2xl`?c=`lg`:i===`xl`?c=`md`:i===`lg`&&(c=`sm`),(0,R.jsxs)(`div`,{className:G(`str-chat__avatar-group`,{"str-chat__avatar-group--offline":typeof r==`boolean`&&!r,"str-chat__avatar-group--online":typeof r==`boolean`&&r,[`str-chat__avatar-group--size-${i}`]:typeof i==`string`},t),"data-testid":`group-avatar`,role:`button`,...a,children:[o.map(({id:e,imageUrl:t,userName:n},r)=>(0,R.jsx)(k6,{imageUrl:t,size:c,userName:n},e||`${n}-${t}-${r}`)),typeof s==`number`&&s>0&&(0,R.jsxs)(A6,{className:`str-chat__avatar-group__count-badge`,"data-testid":`group-avatar-count-badge`,size:e,variant:`counter`,children:[`+`,s]})]})},mhe=[`ArrowDown`,`ArrowUp`,`End`,`Home`],hhe=e=>mhe.includes(e),ghe=({activeIndex:e,itemCount:t,key:n})=>{if(t<=0||!hhe(n))return null;let r=t-1;return n===`Home`?0:n===`End`?r:e===-1?n===`ArrowUp`?r:0:n===`ArrowUp`?e<=0?r:e-1:e>=r?0:e+1},_he=e=>{let t=document.activeElement;return t instanceof Element?e.findIndex(e=>e instanceof Element&&e===t):-1}
500,M6=({focusItem:e=e=>e.focus(),getActiveIndex:t=e=>_he(e),getItems:n})=>r=>{let i=n(r),a=ghe({activeIndex:t(i,r),itemCount:i.length,key:r.key});if(a===null)return;r.preventDefault();let o=i[a];o&&e(o,r)},N6=({children:e,className:t,details:n,hasSubMenu:r,Icon:i,label:a,role:o=`menuitem`,SubmenuIcon:s=jH,variant:c,...l})=>(0,R.jsxs)(`button`,{...l,className:G(`str-chat__context-menu__button`,{"str-chat__context-menu__button--with-submenu":r,[`str-chat__context-menu__button--${c}`]:typeof c==`string`},t),role:o,type:`button`,children:[i&&(0,R.jsx)(i,{className:`str-chat__context-menu__button__icon`}),a?(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(`div`,{className:`str-chat__context-menu__button__label`,children:a}),(0,R.jsx)(`div`,{className:`str-chat__context-menu__button__details`,children:n})]}):(0,R.jsx)(`div`,{className:`str-chat__context-menu__button__label`,children:e}),!!r&&(0,R.jsx)(s,{className:`str-chat__context-menu__button__submenu-icon`})]}),vhe=({children:e,className:t,imageUrl:n,role:r=`menuitem`,userName:i,...a})=>(0,R.jsxs)(`button`,{...a,className:G(`str-chat__context-menu__button str-chat__user-context-menu__button`,t),role:r,type:`button`,children:[(0,R.jsx)(k6,{imageUrl:n,size:`sm`,userName:i}),(0,R.jsx)(`div`,{className:`str-chat__context-menu__button__label`,children:e??i})]}),yhe=({children:e,className:t,emoji:n,label:r,role:i=`menuitem`,...a})=>(0,R.jsxs)(`button`,{...a,className:G(`str-chat__context-menu__button str-chat__emoji-context-menu__button`,t),role:i,type:`button`,children:[(0,R.jsx)(`span`,{className:`str-chat__context-menu__button__emoji str-chat__emoji-item--entity`,children:n}),(0,R.jsx)(`div`,{className:`str-chat__context-menu__button__label`,children:e??r})]}),bhe=({children:e,className:t,Submenu:n,submenuContainerProps:r,submenuPlacement:i=`right-start`,submenuRollAxis:a=`x`,...o})=>{let{className:s,...c}=r??{},{registerDialogSubmenu:l,unregisterDialogSubmenu:u}=H6(),f=(0,d.useRef)(null),[p,m]=(0,d.useState)(null),h=(0,d.useRef)(!1),g=(0,d.useRef)(null),_=(0,d.useMemo)(()=>`submenu-${Math.random().toString(36).slice(2)}`,[]),{dialog:v,dialogManager:y}=$B({id:_}),b=nV(_,y?.id);(0,d.useEffect)(()=>{if(b)return l(),()=>u()},[b,l,u]);let{placement:x,setPopperElement:S,styles:C}=E6({offset:8,open:b,placement:i,referenceElement:f.current}),w=(0,d.useCallback)(()=>{g.current&&clearTimeout(g.current),g.current=setTimeout(()=>{h.current||v.close()},100)},[v]),T=(0,d.useCallback)(()=>{h.current=!0},[]),E=(0,d.useCallback)(()=>{h.current=!1},[]),D=(0,d.useCallback)(()=>{E(),w()},[E,w]),O=(0,d.useCallback)(e=>{let t=f.current;!b||!t||(e.stopPropagation(),w(),t.focus())},[w,b,f]),k=()=>{b||(v.open(),T())};return(0,d.useEffect)(()=>{let e=f.current;if(!b||!e)return;let t=e=>{e.key===`Escape`&&(O(e),D())};return document.addEventListener(`keyup`,t,{capture:!0}),()=>{document.removeEventListener(`keyup`,t,{capture:!0})}},[b,O,D]),(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(N6,{"aria-expanded":b,"aria-haspopup":`menu`,className:G(t,`str_chat__button-with-submenu`,{"str_chat__button-with-submenu--submenu-open":b}),hasSubMenu:!0,onBlur:D,onClick:e=>{e.stopPropagation(),v.toggle()},onFocus:k,onMouseEnter:k,onMouseLeave:D,...o,ref:f,children:e}),b&&(0,R.jsx)(`div`,{className:G(`str-chat__context-menu__submenu-container`,s),"data-str-chat-placement":x,"data-str-chat-roll-axis":a,onBlur:e=>{e.relatedTarget instanceof Node&&p?.contains(e.relatedTarget)||D()},onFocus:T,onMouseEnter:T,onMouseLeave:D,ref:e=>{S(e),m(e)},style:C,tabIndex:-1,...c,children:(0,R.jsx)(n,{})})]})},P6=e=>{let{Submenu:t,submenuContainerProps:n,submenuPlacement:r,submenuRollAxis:i,...a}=e;return t?(0,R.jsx)(bhe,{...a,Submenu:t,submenuContainerProps:n,submenuPlacement:r,submenuRollAxis:i}):(0,R.jsx)(N6,{...a})},F6=({children:e,className:t,role:n=`menuitem`,...r})=>(0,R.jsx)(`button`,{...r,className:G(`str-chat__context-menu__back-button`,t),role:n,type:`button`,children:e}),I6=({children:e,className:t,...n})=>(0,R.jsx)(`div`,{...n,className:G(`str-chat__context-menu__header`,t),children:e}),L6=({children:e,className:t,...n})=>(0,R.jsx)(`div`,{...n,className:G(`str-chat__context-menu__body`,t),children:e}),R6=d.forwardRef(function({className:e,role:t=`menu`,...n},r){return(0,R.jsx)(`div`,{...n,className:G(`str-chat__context-menu`,e),ref:r,role:t})}),z6=[`[role="menuitem"]:not(:disabled)`,`[role="menuitemradio"]:not(:disabled)`,`[role="menuitemcheckbox"]:not(:disabled)`].join(`,`),xhe=e=>e.offsetParent!==null||e.offsetHeight>0?!0:!(e.hidden||e.style.display===`none`),B6=(e,t=z6)=>Array.from(e?.querySelectorAll(t)??[]).filter(xhe),She=({contextMenuRoot:e,focusReturnTarget:t})=>{let n=t??(document.activeElement instanceof HTMLElement?document.activeElement:null);return n?{index:B6(e).findIndex(e=>e===n),target:n}:{index:-1,target:null}},Che=({contextMenuRoot:e,request:t})=>t?t.target?.isConnected?t.target:t.index>=0?B6(e)[t.index]??null:null:null,V6=d.createContext(void 0),H6=()=>(0,d.useContext)(V6);function whe({anchorReferenceElement:e,backLabel:t=`Back`,children:n,className:r,enableAnimations:i=!0,Header:a,items:o,ItemsWrapper:s,keyboardNavigation:c,menuClassName:l,onClose:u,onMenuLevelChange:f,transitionDirection:p,...m}){let h=(0,d.useMemo)(()=>({Header:a,items:o,ItemsWrapper:s,menuClassName:l}),[a,o,s,l]),[g,_]=(0,d.useState)(()=>[h]),[v,y]=(0,d.useState)(0),b=(0,d.useRef)(null),x=(0,d.useRef)(null),S=g[g.length-1],C=S.ItemsWrapper??d.Fragment,w=(0,d.useCallback)(()=>{u?.()}
500,[u]),T=(0,d.useCallback)(({focusReturnTarget:e,Header:t,ItemsWrapper:n,menuClassName:r,Submenu:i})=>{let a={focusRestoreRequest:She({contextMenuRoot:b.current,focusReturnTarget:e}),Header:t,ItemsWrapper:n??s,menuClassName:r,Submenu:i};_(e=>[...e,a])},[s]),E=(0,d.useCallback)(()=>{_(e=>e.length<=1?e:(x.current=e[e.length-1]?.focusRestoreRequest??null,e.slice(0,-1)))},[]);(0,d.useEffect)(()=>{_(e=>e.length===1&&e[0]===h?e:[h])},[h]),(0,d.useEffect)(()=>{f?.(g.length)},[g.length,f]),(0,d.useEffect)(()=>{let e=x.current;e&&(x.current=null,requestAnimationFrame(()=>{Che({contextMenuRoot:b.current,request:e})?.focus()}))},[g.length]),(0,d.useEffect)(()=>{p&&y(e=>e+1)},[p,g.length]);let D=(0,d.useRef)(0),O=(0,d.useCallback)(()=>{D.current+=1},[]),k=(0,d.useCallback)(()=>{D.current=Math.max(0,D.current-1)},[]),A=(0,d.useMemo)(()=>{let e=c?.itemSelector??z6;return M6({getItems:t=>B6(t.currentTarget,e)})},[c]),j=(0,d.useRef)(!1),M=(0,d.useCallback)(e=>{if(e.key===`Escape`){if(D.current>0)return;e.preventDefault(),e.stopPropagation(),g.length>1?(j.current=!0,E()):w();return}A(e)},[w,g.length,E,A]),N=(0,d.useCallback)(e=>{e.key===`Escape`&&j.current&&(j.current=!1,e.stopPropagation())},[]);return(0,R.jsx)(V6.Provider,{value:{anchorReferenceElement:e,closeMenu:w,openSubmenu:T,registerDialogSubmenu:O,returnToParentMenu:E,unregisterDialogSubmenu:k},children:(0,R.jsxs)(R6,{className:G(r,S.menuClassName),"data-str-chat-enable-animations":i,onKeyDownCapture:M,onKeyUpCapture:N,ref:b,...m,children:[S.Header?(0,R.jsx)(S.Header,{}):g.length>1?(0,R.jsx)(I6,{children:(0,R.jsxs)(F6,{onClick:E,children:[(0,R.jsx)(AH,{}),(0,R.jsx)(`span`,{children:t})]})}):null,(0,R.jsx)(L6,{className:G({"str-chat__context-menu__body--submenu-backward":p===`backward`,"str-chat__context-menu__body--submenu-forward":p===`forward`}),children:S.Submenu?(0,R.jsx)(S.Submenu,{}):(0,R.jsx)(C,{children:n===void 0?S.items?.map((e,t)=>(0,R.jsx)(e,{},`context-menu-item-${t}`)):n})},`context-menu-body-${g.length}-${v}`)]})})}var U6=e=>{let{ContextMenuContent:t=whe}=q(),{allowFlip:n,closeOnClickOutside:r,closeTransitionMs:i=130,dialogManagerId:a,focus:o,id:s,offset:c=8,onMenuLevelChange:l,placement:u,referenceElement:f,submenuTransitionDurationMs:p,tabIndex:m,trapFocus:h,...g}=e,_=p??460,v=s!=null,[y,b]=(0,d.useState)(1),[x,S]=(0,d.useState)(void 0),[C,w]=(0,d.useState)(0),T=(0,d.useRef)(null),E=(0,d.useRef)(1),D=nV(s??``,a),O=(0,d.useRef)(D);(0,d.useEffect)(()=>{v&&(O.current&&!D&&(b(1),S(void 0),w(e=>e+1),E.current=1,T.current&&=(clearTimeout(T.current),null)),O.current=D)},[v,D]),(0,d.useEffect)(()=>()=>{T.current&&clearTimeout(T.current)},[]);let k=(0,d.useCallback)(e=>{if(v){let t=E.current;e!==t&&(S(e>t?`forward`:`backward`),T.current&&clearTimeout(T.current),T.current=setTimeout(()=>{S(void 0),T.current=null},_)),E.current=e,b(e);return}l?.(e)},[v,l,_]),A=(0,d.createElement)(t,{anchorReferenceElement:v?f:void 0,...g,key:`context-menu-content-${C}`,onMenuLevelChange:k,transitionDirection:x});if(v){let{backLabel:e,enableAnimations:t,Header:l,items:d,ItemsWrapper:p,keyboardNavigation:_,menuClassName:v,onClose:b,role:x,...S}=g;return(0,R.jsx)(D6,{allowFlip:n,closeOnClickOutside:r,closeTransitionMs:i,dialogManagerId:a,focus:o,id:s,offset:c,placement:u,referenceElement:f,tabIndex:m,trapFocus:h,updateKey:y,...S,children:A})}return A},W6={Body:({children:e,className:t})=>(0,R.jsx)(`div`,{className:G(`str-chat__prompt__body`,t),children:e}),Footer:({children:e,className:t})=>(0,R.jsx)(`div`,{className:G(`str-chat__prompt__footer`,t),children:e}),FooterControls:({children:e,className:t})=>(0,R.jsx)(`div`,{className:G(`str-chat__prompt__footer__controls`,t),children:e}),FooterControlsButtonPrimary:({className:e,...t})=>(0,R.jsx)(nH,{appearance:`solid`,className:G(`str-chat__prompt__footer__controls-button`,e),size:`md`,variant:`primary`,...t}),FooterControlsButtonSecondary:({className:e,...t})=>(0,R.jsx)(nH,{appearance:`ghost`,className:G(`str-chat__prompt__footer__controls-button`,e),size:`md`,variant:`secondary`,...t}),Header:({className:e,close:t,description:n,descriptionId:r,title:i,titleId:a})=>{let{t:o}=Y(),{dialogId:s}=h6(),{descriptionId:c,titleId:l}=w6(s),u=a??l,d=r??c;return(0,R.jsxs)(`div`,{className:G(`str-chat__prompt__header`,e),children:[(0,R.jsxs)(`div`,{className:`str-chat__prompt__header__title-group`,children:[(0,R.jsx)(`h2`,{className:`str-chat__prompt__header__title`,id:u,children:i}),n!=null&&n!==``&&(0,R.jsx)(`p`,{className:`str-chat__prompt__header__description`,id:d,children:n})]}),t&&(0,R.jsx)(nH,{appearance:`ghost`,"aria-describedby":n!=null&&n!==``?d:void 0,"aria-label":o(`Close prompt: {{ title }}`,{title:i}),circular:!0,className:`str-chat__prompt__header__close-button`,onClick:t,size:`sm`,variant:`secondary`,children:(0,R.jsx)(RH,{})})]})},Root:({children:e,className:t,...n})=>(0,R.jsx)(`div`,{...n,className:G(`str-chat__prompt`,t),children:e})},G6={Body:({children:e,className:t})=>(0,R.jsx)(`div`,{className:G(`str-chat__viewer__body`,t),children:e}),Footer:({children:e,className:t})=>(0,R.jsx)(`div`,{className:G(`str-chat__viewer__footer`,t),children:e}),FooterControls:({children:e,className:t})=>
500(0,R.jsx)(`div`,{className:G(`str-chat__viewer__footer__controls`,t),children:e}),FooterControlsButtonPrimary:({className:e,...t})=>(0,R.jsx)(nH,{appearance:`solid`,className:G(`str-chat__viewer__footer__controls-button`,e),size:`md`,variant:`primary`,...t}),FooterControlsButtonSecondary:({className:e,...t})=>(0,R.jsx)(nH,{appearance:`ghost`,className:G(`str-chat__viewer__footer__controls-button`,e),size:`md`,variant:`secondary`,...t}),Header:({className:e,close:t,description:n,descriptionId:r,goBack:i,title:a,titleId:o})=>{let{t:s}=Y(),{dialogId:c}=h6(),{descriptionId:l,titleId:u}=w6(c),d=o??u,f=r??l;return(0,R.jsxs)(`div`,{className:G(`str-chat__viewer__header`,e),children:[i&&(0,R.jsx)(nH,{appearance:`ghost`,"aria-describedby":n!=null&&n!==``?f:void 0,"aria-label":s(`Back`),circular:!0,className:`str-chat__viewer__header__go-back-button`,onClick:i,size:`sm`,variant:`secondary`,children:(0,R.jsx)(cH,{})}),(0,R.jsxs)(`div`,{className:`str-chat__viewer__header__title-group`,children:[(0,R.jsx)(`h2`,{className:`str-chat__viewer__header__title`,id:d,children:a}),n!=null&&n!==``&&(0,R.jsx)(`p`,{className:`str-chat__viewer__header__description`,id:f,children:n})]}),t&&(0,R.jsx)(nH,{appearance:`ghost`,"aria-describedby":n!=null&&n!==``?f:void 0,"aria-label":s(`Close dialog`),circular:!0,className:`str-chat__viewer__header__close-button`,onClick:t,size:`sm`,variant:`secondary`,children:(0,R.jsx)(RH,{})})]})},Root:({children:e,className:t,...n})=>(0,R.jsx)(`div`,{...n,className:G(`str-chat__viewer`,t),children:e})},The={"{{ commaSeparatedUsers }} and {{ moreCount }} more":`{{ commaSeparatedUsers }} und {{moreCount}} mehr`,"{{ commaSeparatedUsers }}, and {{ lastUser }}":`{{ commaSeparatedUsers }} und {{ lastUser }}`,"{{ count }} files_one":`{{ count }} Datei`,"{{ count }} files_other":`{{ count }} Dateien`,"{{ count }} people are typing_one":`{{ count }} Person tippt`,"{{ count }} people are typing_many":`{{ count }} Personen tippen`,"{{ count }} people are typing_other":`{{ count }} Personen tippen`,"{{ count }} photos_one":`{{ count }} Foto`,"{{ count }} photos_other":`{{ count }} Fotos`,"{{ count }} reactions_one":`{{ count }} Reaktion`,"{{ count }} reactions_other":`{{ count }} Reaktionen`,"{{ count }} videos_one":`{{ count }} Video`,"{{ count }} videos_other":`{{ count }} Videos`,"{{ firstUser }} and {{ secondUser }}":`{{ firstUser }} und {{ secondUser }}`,"{{ imageCount }} more":`{{ imageCount }} mehr`,"{{ memberCount }} members":`{{ memberCount }} Mitglieder`,"{{ typing }} are typing":`{{ typing }} tippen`,"{{ typing }} is typing":`{{ typing }} tippt`,"{{ user }} has been muted":`{{ user }} wurde stummgeschaltet`,"{{ user }} has been unmuted":`Die Stummschaltung von {{ user }} wurde aufgehoben`,"{{ user }} is typing...":`{{ user }} tippt...`,"{{ users }} and {{ user }} are typing...":`{{ users }} und {{ user }} tippen...`,"{{ users }} and more are typing...":`{{ users }} und mehr tippen...`,"{{ watcherCount }} online":`{{ watcherCount }} online`,"{{count}} new messages_one":`{{count}} neue Nachricht`,"{{count}} new messages_other":`{{count}} neue Nachrichten`,"{{count}} unread_one":`{{count}} ungelesen`,"{{count}} unread_other":`{{count}} ungelesen`,"{{count}} votes_one":`{{count}} Stimme`,"{{count}} votes_other":`{{count}} Stimmen`,"+{{ imageCount }}":`+{{ imageCount }}`,"+{{count}} more options_one":`+{{count}} weitere Option`,"+{{count}} more options_other":`+{{count}} weitere Optionen`,"🏙 Attachment...":`🏙 Anhang...`,"📊 {{createdBy}} created: {{ pollName}}":`📊 {{createdBy}} hat erstellt: {{ pollName}}`,"📊 {{votedBy}} voted: {{pollOptionText}}":`📊 {{votedBy}} hat abgestimmt: {{pollOptionText}}`,"📍Shared location":`📍Geteilter Standort`,"Add a comment":`Einen Kommentar hinzufügen`,"Add a comment to your poll answer":`Füge einen Kommentar zu deiner Umfrageantwort hinzu`,"Add an option":`Eine Option hinzufügen`,"Add reaction":`Reaktion hinzufügen`,"All results loaded":`Alle Ergebnisse geladen`,"Allow access to camera":`Zugriff auf Kamera erlauben`,"Allow access to microphone":`Zugriff auf Mikrofon erlauben`,"Allow comments":`Kommentare erlauben`,"Allow option suggestion":`Optionsvorschläge erlauben`,"Allow others to add comments":`Anderen das Hinzufügen von Kommentaren erlauben`,"Also send as a direct message":`Auch als Direktnachricht senden`,"Also send in channel":`Auch im Kanal senden`,"Also sent in channel":`Auch im Kanal gesendet`,"An error has occurred during recording":`Ein Fehler ist während der Aufnahme aufgetreten`,"An error has occurred during the recording processing":`Ein Fehler ist während der Aufnahmeverarbeitung aufgetreten`,Anonymous:`Anonym`,"Anonymous poll":`Anonyme Umfrage`,Archive:`Archiv
500ieren`,"Are you sure you want to delete this message?":`Sind Sie sicher, dass Sie diese Nachricht löschen möchten?`,"aria/Attachment":`Anhang`,"aria/Attachment Actions":`Anhangaktionen`,"aria/Audio position {{ elapsed }} of {{ duration }}":`Audioposition {{ elapsed }} von {{ duration }}`,"aria/Audio position {{ progress }} percent":`Audioposition {{ progress }} Prozent`,"aria/Block User":`Benutzer blockieren`,"aria/Bookmark Message":`Nachricht für später speichern`,"aria/Cancel recording":`Aufnahme abbrechen`,"aria/Cancel Reply":`Antwort abbrechen`,"aria/Cancel upload":`Upload abbrechen`,"aria/Channel Actions":`Kanalaktionen`,"aria/Channel list":`Kanalliste`,"aria/Channel search results":`Kanalsuchergebnisse`,"aria/Chat view tabs":`Chat-Ansicht Tabs`,"aria/Clear search":`Suche leeren`,"aria/Close callout dialog":`Hinweisdialog schließen`,"aria/Close thread":`Thread schließen`,"aria/Collapse sidebar":`Seitenleiste einklappen`,"aria/Command Suggestions":`Befehlsvorschläge`,"aria/Complete recording":`Aufnahme abschließen`,"aria/Copy Message Text":`Nachrichtentext kopieren`,"aria/Decrease value":`Wert verringern`,"aria/Delete Message":`Nachricht löschen`,"aria/Dismiss notification":`Benachrichtigung schließen`,"aria/Download attachment":`Anhang herunterladen`,"aria/Edit Message":`Nachricht bearbeiten`,"aria/Emoji picker":`Emoji-Auswahl`,"aria/Emoji Suggestions":`Emoji-Vorschläge`,"aria/Exit search":`Suche verlassen`,"aria/Expand sidebar":`Seitenleiste einblenden`,"aria/File input":`Dateieingabe`,"aria/File upload":`Datei hochladen`,"aria/Flag Message":`Nachricht melden`,"aria/Image failed to load":`Bild konnte nicht geladen werden`,"aria/Image input":`Bildeingabe`,"aria/Increase value":`Wert erhöhen`,"aria/Jump to latest message":`Zur neuesten Nachricht springen`,"aria/Jump to quoted message":`Zur zitierten Nachricht springen`,"aria/Load More Channels":`Mehr Kanäle laden`,"aria/Mark Message Unread":`Als ungelesen markieren`,"aria/Mark messages as read":`Nachrichten als gelesen markieren`,"aria/Menu":`Menü`,"aria/Message Actions":`Nachrichtenaktionen`,"aria/Message from {{ user }},":`Nachricht von {{ user }},`,"aria/Message Options":`Nachrichtenoptionen`,"aria/Message,":`Nachricht,`,"aria/Mute User":`Benutzer stummschalten`,"aria/Notifications":`Benachrichtigungen`,"aria/Open Attachment Selector":`Anhang-Auswahl öffnen`,"aria/Open Channel Actions Menu":`Kanalaktionsmenü öffnen`,"aria/Open Menu":`Menü öffnen`,"aria/Open Message Actions Menu":`Nachrichtenaktionsmenü öffnen`,"aria/Open Reaction Selector":`Reaktionsauswahl öffnen`,"aria/Open Thread":`Thread öffnen`,"aria/Pause":`Pausieren`,"aria/Pause recording":`Aufnahme pausieren`,"aria/Percent complete":`{{percent}} Prozent abgeschlossen`,"aria/Pin Message":`Nachricht anheften`,"aria/Play":`Abspielen`,"aria/Quote Message":`Nachricht zitieren`,"aria/Reaction list":`Reaktionsliste`,"aria/Remind Me Message":`Erinnern`,"aria/Remind Me Options":`Erinnerungsoptionen`,"aria/Remove attachment":`Anhang entfernen`,"aria/Remove location attachment":`Standortanhang entfernen`,"aria/Remove option":`Option entfernen`,"aria/Remove Reminder":`Erinnerung entfernen`,"aria/Remove Save For Later":`„Später ansehen“ entfernen`,"aria/Resend Message":`Nachricht erneut senden`,"aria/Resume recording":`Aufnahme fortsetzen`,"aria/Retry upload":`Upload erneut versuchen`,"aria/Review bounced message":`Zurückgewiesene Nachricht prüfen`,"aria/Search results":`Suchergebnisse`,"aria/Search results header filter button for: {{ source }}":`Filterbutton in der Kopfzeile der Suchergebnisse für: {{ source }}`,"aria/Seek audio position":`Audioposition suchen`,"aria/Select Channel: {{ channelName }}":`Kanal auswählen: {{ channelName }}`,"aria/Select Reaction: {{ reactionName }}":`Reaktion auswählen: {{ reactionName }}`,"aria/Select User Channel: {{ name }}":`Benutzerkanal auswählen: {{ name }}`,"aria/Send":`Senden`,"aria/Show preview":`Vorschau anzeigen`,"aria/Start recording audio":`Audioaufnahme starten`,"aria/Stop AI Generation":`KI-Generierung stoppen`,"aria/Suggestions":`Vorschläge`,"aria/Thread list":`Thread-Liste`,"aria/Unblock User":`Benutzer entsperren`,"aria/Unmute User":`Stummschaltung aufheben`,"aria/Unpin Message":`Anheftung aufheben`,"aria/User Suggestions":`Benutzervorschläge`,"Ask a question":`Eine Frage stellen`,Attach:`Anhängen`,"Attach files":`Dateien anhängen`,Attachment:`Anhang`,"Attachment upload blocked due to {{reason}}":`Anhang-Upload blockiert wegen {{reason}}`,"Attachment upload failed due to {{reason}}":`Anhang-Upload fehlgeschlagen wegen {{reason}}`,Back:`Back`,"ban-command-args":`[@Benutzername] [Text]`,"ban-command-description":`Einen Benutzer verbannen`,"Block User":`Benutzer blockieren`,Cancel:`Abbrechen`,"Cannot seek in the recording":`In der Aufnahme kann nicht gesucht werden`,"Channel ar
500chived":`Kanal archiviert`,"Channel Missing":`Kanal fehlt`,"Channel muted":`Kanal stummgeschaltet`,"Channel pinned":`Kanal angeheftet`,"Channel unarchived":`Kanal dearchiviert`,"Channel unmuted":`Stummschaltung des Kanals aufgehoben`,"Channel unpinned":`Kanal nicht mehr angeheftet`,Channels:`Kanäle`,Chats:`Chats`,"Choose between 2 to 10 options":`Wähle zwischen 2 und 10 Optionen`,Close:`Schließen`,"Close dialog":`Dialog schließen`,"Close emoji picker":`Emoji-Auswahl schließen`,"Close prompt: {{ title }}":`Eingabeaufforderung schließen: {{ title }}`,"Command not available while editing":`Befehl beim Bearbeiten nicht verfügbar`,"Command not available while replying":`Befehl beim Antworten nicht verfügbar`,Commands:`Befehle`,"Commands matching":`Übereinstimmende Befehle`,"Connection failure, reconnecting now...":`Verbindungsfehler, Wiederherstellung der Verbindung...`,"Copy Message":`Nachricht kopieren`,Create:`Erstellen`,"Create a question, add options, and configure poll settings":`Erstelle eine Frage, füge Optionen hinzu und konfiguriere die Umfrageeinstellungen`,"Create poll":`Umfrage erstellen`,"Current location":`Aktueller Standort`,Delete:`Löschen`,"Delete for me":`Für mich löschen`,"Delete message":`Nachricht löschen`,Delivered:`Zugestellt`,"Direct message":`Direktnachricht`,"Do you want to end this poll now? Nobody will be able to vote in this poll anymore.":`Möchten Sie diese Umfrage jetzt beenden? Niemand wird mehr in dieser Umfrage abstimmen können.`,"Download All":`Alle herunterladen`,"Download Attachment":`Anhang herunterladen`,"Download attachment {{ name }}":`Anhang {{ name }} herunterladen`,"Drag your files here":`Ziehen Sie Ihre Dateien hierher`,"Drag your files here to add to your post":`Ziehen Sie Ihre Dateien hierher, um sie Ihrem Beitrag hinzuzufügen`,"Due {{ timeLeft }}":`Fällig {{ timeLeft }}`,"Due since {{ dueSince }}":`Fällig seit {{ dueSince }}`,"duration/Message reminder":`{{ milliseconds | durationFormatter(withSuffix: true) }}`,"duration/Remind Me":`{{ milliseconds | durationFormatter(withSuffix: true) }}`,"duration/Share Location":`{{ milliseconds | durationFormatter }}`,"Edit Message":`Nachricht bearbeiten`,"Edit message request failed":`Anfrage zum Bearbeiten der Nachricht fehlgeschlagen`,Edited:`Bearbeitet`,"Emoji matching":`Passende Emojis`,"Empty message...":`Leere Nachricht...`,End:`Beenden`,"End poll":`Umfrage beenden`,"End this poll?":`Umfrage beenden?`,"End vote":`Abstimmung beenden`,"Enforce unique vote is enabled":`Eindeutige Abstimmung ist aktiviert`,Error:`Fehler`,"Error adding flag":`Fehler beim Hinzufügen des Flags`,"Error connecting to chat, refresh the page to try again.":`Verb
500indungsfehler zum Chat, aktualisieren Sie die Seite, um es erneut zu versuchen.`,"Error deleting message":`Fehler beim Löschen der Nachricht`,"Error fetching reactions":`Fehler beim Laden von Reaktionen`,"Error marking message unread. Cannot mark unread messages older than the newest 100 channel messages.":`Fehler beim Markieren der Nachricht als ungelesen. Kann keine älteren ungelesenen Nachrichten markieren als die neuesten 100 Kanalnachrichten.`,"Error muting a user ...":`Fehler beim Stummschalten eines Nutzers.`,"Error pinning message":`Fehler beim Pinnen der Nachricht`,"Error removing message pin":`Fehler beim Entfernen der gepinnten Nachricht`,"Error reproducing the recording":`Fehler bei der Wiedergabe der Aufnahme`,"Error starting recording":`Fehler beim Starten der Aufnahme`,"Error unmuting a user ...":`Fehler beim Aufheben der Stummschaltung eines Nutzers ...`,"Error uploading attachment":`Fehler beim Hochladen des Anhangs`,"Error uploading file":`Fehler beim Hochladen der Datei`,"Error uploading image":`Fehler beim Hochladen des Bildes`,"Error: {{ errorMessage }}":`Fehler: {{ errorMessage }}`,"Exit command {{ command }}":`Befehl beenden {{ command }}`,"Failed to block user":`Benutzer konnte nicht blockiert werden`,"Failed to create the poll":`Fehler beim Erstellen der Umfrage`,"Failed to create the poll due to {{reason}}":`Die Umfrage konnte aufgrund von {{reason}} nicht erstellt werden`,"Failed to delete the message":`Nachricht konnte nicht gelöscht werden`,"Failed to end the poll":`Umfrage konnte nicht beendet werden`,"Failed to end the poll due to {{reason}}":`Umfrage konnte aufgrund von {{reason}} nicht beendet werden`,"Failed to jump to the first unread message":`Fehler beim Springen zur ersten ungelesenen Nachricht`,"Failed to leave channel":`Kanal konnte nicht verlassen werden`,"Failed to load channels":`Kanäle konnten nicht geladen werden`,"Failed to load more channels":`Weitere Kanäle konnten nicht geladen werden`,"Failed to mark channel as read":`Fehler beim Markieren des Kanals als gelesen`,"Failed to play the recording":`Wiedergabe der Aufnahme fehlgeschlagen`,"Failed to retrieve location":`Standort konnte nicht abgerufen werden`,"Failed to share location":`Standort konnte nicht geteilt werden`,"Failed to update channel archive status":`Archivierungsstatus des Kanals konnte nicht aktualisiert werden`,"Failed to update channel mute status":`Stummschaltungsstatus des Kanals konnte nicht aktualisiert werden`,"Failed to update channel pinned status":`Anheftstatus des Kanals konnte nicht aktualisiert werden`,File:`Datei`,"File is required for upload attachment":`Datei ist für den Anhang-Upload erforderlich`,"File is too large: {{ size }}, maximum upload size is {{ limit }}":`Datei ist zu groß: {{ size }}, maximale Upload-Größe beträgt {{ limit }}`,"File too large":`Datei ist zu groß`,fileCount_one:`1 datei`,fileCount_other:`{{ count }} dateien`,Flag:`Melden`,"Generating...":`Generieren...`,"giphy-command-args":`[Text]`,"giphy-command-description":`Poste ein zufälliges Gif in den Kanal`,"Hide who voted":`Verbergen, wer abgestimmt hat`,Image:`Bild`,imageCount_one:`Bild`,imageCount_other:`{{ count }} bilder`,"Instant commands":`Instant commands`,"language/af":`Afrikaans`,"language/am":`Amharisch`,"language/ar":`Arabisch`,"language/az":`Aserbaidschanisch`,"language/bg":`Bulgarisch`,"language/bn":`Bengalisch`,"language/bs":`Bosnisch`,"language/cs":`Tschechisch`,"language/da":`Dänisch`,"language/de":`Deutsch`,"language/el":`Griechisch`,"language/en":`Englisch`,"language/es":`Spanisch`,"language/es-MX":`Spanisch (Mexiko)`,"language/et":`Estnisch`,"language/fa":`Persisch`,"language/fa-AF":`Dari`,"language/fi":`Finnisch`,"language/fr":`Französisch`,"language/fr-CA":`Französisch (Kanada)`,"language/ha":`Hausa`,"language/he":`Hebräisch`,"language/hi":`Hindi`,"language/hr":`Kroatisch`,"language/ht":`Haitianisches Kreolisch`,"language/hu":`Ungarisch`,"language/id":`Indonesisch`,"language/it":`Italienisch`,"language/ja":`Japanisch`,"language/ka":`Georgisch`,"language/ko":`Koreanisch`,"language/lt":`Litauisch`,"language/lv":`Lettisch`,"language/ms":`Malaiisch`,"language/nl":`Niederländisch`,"language/no":`Norwegisch`,"language/pl":`Polnisch`,"language/ps":`Paschtu`,"language/pt":`Portugiesisch`,"language/ro":`Rumänisch`,"language/ru":`Russisch`,"language/sk":`Slowakisch`,"language/sl":`Slowenisch`,"language/so":`Somali`,"language/sq":`Albanisch`,"language/sr":`Serbisch`,"language/sv":`Schwedisch`,"language/sw":`Swahili`,"language/ta":`Tamil`,"language/th":`Thailändisch`,"language/tl":`Tagalog`,"language/tr":`Türkisch`,"language/uk":`Ukrainisch`,"language/ur":`Urdu`,"language/vi":`Vietnamesisch`,"language/zh":`Chinesisch (Vereinfacht)`,"language/zh-TW":`Chinesisch (Traditionell)`,"Leave Channel":`Kanal verlassen`,"Left channel":`Kanal verlassen`,"Let others add options":`Andere Optionen hinzufügen lassen`,"Limit votes per person":`Stimmen pro Person begrenzen`,Link:`Link`,linkCount_one:`Link`,linkCount_other:`{{ count }} links`,live:`live`,"Live for {{duration}}":`Live für {{duration}}`,"Live location":`Live-Standort`,"Live until {{ timestamp }}":`Live bis {{ timestamp }}`,"Load more":`Mehr laden`,"Local upload attachment missing local id":`Lokaler Upload-Anhang hat keine lokale ID`,Location:`Standort`,"Location sharing ended":`Standortfreigabe beendet`,"Location: {{ coordinates }}":`Standort: {{ coordinates }}`,"Mark as unread":`Als ungelesen markieren`,"Maximum number of votes (from 2 to 10)":`Maximale Anzahl der Stimmen (von 2 bis 10)`,"Maximum votes per person":`Maximale Stimmen pro Person`,Menu:`Menü`,"Message deleted":`Nachricht gelöscht`,"Message failed to send":`Nachricht konnte nicht gesendet werden`,"Message has been successfully flagged":`Nachricht wurde erfolgreich gemeldet`,"Message marked as unread":`Nachricht als ungelesen markiert`,"Message pinned":`Nachricht angeheftet`,"Message unpinned":`Nachricht nicht mehr angeheftet`,"Message was blocked by moderation policies":`Nachricht wurde durch moderationsrichtlinien blockiert`,"Messages have been marked unread.":`Nachrichten wurden als ungelesen markiert.`,"Missing permissions to upload the attachment":`Fehlende Berechtigungen zum Hochladen des Anhangs`,"Multiple votes":`Mehrfachstimmen`,Mute:`Stummschalten`,"mute-command-args":`[@Benutzername]`,"mute-command-description":`Stummschalten eines Benutzers`,"network error":`Netzwerkfehler`,New:`Neu`,"New message from {{user}}":`Neue Nachricht von {{user}}
500`,"New Messages!":`Neue Nachrichten!`,"Next image":`Nächstes Bild`,"No chats here yet…":`Noch keine Chats hier...`,"No conversations yet":`Noch keine Unterhaltungen`,"No items exist":`Keine Elemente vorhanden`,"No results found":`Keine Ergebnisse gefunden`,"Nobody will be able to vote in this poll anymore.":`Niemand kann mehr in dieser Umfrage abstimmen.`,"Nothing yet...":`Noch nichts...`,Offline:`Offline`,Ok:`OK`,Online:`Online`,"Only numbers are allowed":`Nur Zahlen sind erlaubt`,"Only visible to you":`Nur für dich sichtbar`,"Open emoji picker":`Emoji-Auswahl öffnen`,"Open gallery at image {{ index }}":`Galerie bei Bild {{ index }} öffnen`,"Open image in gallery":`Bild in Galerie öffnen`,"Open location in a map":`Standort in einer Karte öffnen`,"Option already exists":`Option existiert bereits`,"Option is empty":`Option ist leer`,Options:`Optionen`,Original:`Original`,"People matching":`Passende Personen`,Photo:`Foto`,Pin:`Anheften`,"Pinned by {{ name }}":`Angeheftet von {{ name }}`,"Pinned by You":`Von Ihnen angeheftet`,"placeholder/PollComment":`Ihr Kommentar`,"placeholder/PollOptionSuggestion":`Neue Option eingeben`,"Play video":`Video abspielen`,"Playback speed {{ rate }}x":`Wiedergabegeschwindigkeit {{ rate }}x`,Poll:`Umfrage`,"Poll comments":`Umfragekommentare`,"Poll ended":`Umfrage beendet`,"Poll options":`Umfrageoptionen`,"Poll results":`Umfrageergebnisse`,"Previous image":`Vorheriges Bild`,Question:`Frage`,"Question {{ optionOrderNumber}}":`Frage {{ optionOrderNumber}}`,"Question is required":`Frage ist erforderlich`,"Quote Reply":`Zitat-Antwort`,"Reached the vote limit. Remove an existing vote first.":`Das Abstimmungslimit wurde erreicht. Entfernen Sie zuerst eine bestehende Stimme.`,"Recording format is not supported and cannot be reproduced":`Aufnahmeformat wird nicht unterstützt und kann nicht wiedergegeben werden`,"Remind me":`Erinnern`,"Remind Me":`Erinnern`,"Reminder set":`Erinnerung gesetzt`,"Remove reminder":`Erinnerung entfernen`,"Remove save for later":`„Später ansehen“ entfernen`,"Replied to a thread":`In einem Thread geantwortet`,Reply:`Antworten`,"Reply to {{ authorName }}":`Antwort an {{ authorName }}`,"Reply to a message to start a thread":`Antworte auf eine Nachricht, um einen Thread zu starten`,"Reply to Message":`Auf Nachricht antworten`,replyCount_one:`1 Antwort`,replyCount_other:`{{ count }} Antworten`,Resend:`Erneut senden`,"Retry upload":`Upload erneut versuchen`,"Review all options available in this poll":`Überprüfe alle verfügbaren Optionen in dieser Umfrage`,"Review comments submitted with poll answers":`Überprüfe Kommentare, die mit Umfrageantworten eingereicht wurden`,"Review poll results and open an option to see detailed votes":`Überprüfe die Umfrageergebnisse und öffne eine Option, um detaillierte Stimmen zu sehen`,"Review this message and choose whether to delete it, edit it, or send it anyway":`Überprüfe diese Nachricht und wähle, ob du sie löschen, bearbeiten oder trotzdem senden möchtest`,"Review who voted for this option":`Überprüfe, wer für diese Option gestimmt hat`,"Save for later":`Für später speichern`,"Saved for later":`Für später gespeichert`,Search:`Suche`,"Search GIFs":`Search GIFs`,"search-results-header-filter-source-button-label--channels":`Kanäle`,"search-results-header-filter-source-button-label--messages":`Nachrichten`,"search-results-header-filter-source-button-label--users":`Benutzer`,"Searching for {{ searchSourceType }}...":`Suche nach {{ searchSourceType }}...`,"Searching...":`Suchen...`,searchResultsCount_one:`1 Ergebnis`,searchResultsCount_other:`{{ count }} Ergebnisse`,"Select a thread to continue the conversation":`Wähle einen Thread aus, um die Unterhaltung fortzusetzen`,"Select more than one option":`Mehr als eine Option auswählen`,"Select one":`Eine auswählen`,"Select one or more":`Eine oder mehrere auswählen`,"Select up to {{count}}_one":`Bis zu {{count}} auswählen`,"Select up to {{count}}_other":`Bis zu {{count}} auswählen`,"Select your current location and optionally enable live location sharing":`Wähle deinen aktuellen Standort und aktiviere optional das Teilen des Live-Standorts`,Send:`Senden`,"Send a message":`Nachricht senden`,"Send a message to start the conversation":`Senden Sie eine Nachricht, um die Unterhaltung zu beginnen`,"Send Anyway":`Trotzdem senden`,"Send message request failed":`Senden der Nachrichtenanfrage fehlgeschlagen`,"Send poll":`Umfrage senden`,"Sending...":`Senden...`,Sent:`Gesendet`,Share:`Teilen`,"Share live location for":`Live-Standort teilen für`,"Share Location":`Standort teilen`,"Shared live location":`Geteilter Live-Standort`,"Shared location":`Geteilter Standort`,Shuffle:`Mischen`,"size limit":`Größe
500nbeschränkung`,"Slow Mode ON":`Langsamer Modus EIN`,"Slow mode, wait {{ seconds }}s...":`Langsamer Modus, warte {{ seconds }}s...`,"Some of the files will not be accepted":`Einige der Dateien werden nicht akzeptiert`,"Start typing to search":`Tippen Sie, um zu suchen`,"Stop sharing":`Teilen beenden`,Submit:`Absenden`,"Suggest a new option to add to this poll":`Schlage eine neue Option vor, die zu dieser Umfrage hinzugefügt werden soll`,"Suggest an option":`Eine Option vorschlagen`,"Tap to remove":`Tippen zum Entfernen`,"Tap to remove: {{ reactionName }}":`Tippen zum Entfernen: {{ reactionName }}`,"Thinking...":`Denken...`,"this content could not be displayed":`Dieser Inhalt konnte nicht angezeigt werden`,"This field cannot be empty or contain only spaces":`Dieses Feld darf nicht leer sein oder nur Leerzeichen enthalten`,"This message did not meet our content guidelines":`Diese Nachricht entsprach nicht unseren Inhaltsrichtlinien`,Thread:`Thread`,"Thread has not been found":`Thread wurde nicht gefunden`,"Thread reply":`Thread-Antwort`,"Thread Reply":`Thread-Antwort`,"ThreadListUnseenThreadsBanner/loading":`Laden...`,"ThreadListUnseenThreadsBanner/unreadThreads_one":`{{ count }} ungelesener Thread`,"ThreadListUnseenThreadsBanner/unreadThreads_other":`{{ count }} ungelesene Threads`,Threads:`Diskussionen`,"timestamp/ChannelPreviewTimestamp":`{{ timestamp | timestampFormatter(calendar: true; calendarFormats: { "sameDay": "LT", "lastDay": "[Gestern]", "lastWeek": "dddd", "sameElse": "L" }) }}`,"timestamp/DateSeparator":`{{ timestamp | timestampFormatter(calendar: true; calendarFormats: { "sameDay": "[Heute]", "nextDay": "[Morgen]", "lastDay": "[Gestern]", "nextWeek": "dddd", "lastWeek": "[Letzte] dddd", "sameElse": "ddd, D MMM" }) }}`,"timestamp/LiveLocation":`{{ timestamp | timestampFormatter(calendar: true) }}`,"timestamp/MessageTimestamp":`{{ timestamp | timestampFormatter(calendar: false; format: HH:mm) }}`,"timestamp/PollVote":`{{ timestamp | timestampFormatter(relativeCompact: true) }}`,"timestamp/PollVoteTooltip":`{{ timestamp | timestampFormatter(calendar: true) }}`,"timestamp/relativeDaysAgo":`{{ count }}d ago`,"timestamp/relativeToday":`Heute`,"timestamp/relativeWeeksAgo":`{{ count }}w ago`,"timestamp/relativeYesterday":`Gestern`,"timestamp/ReminderNotification":`{{ timestamp | timestampFormatter(calendar: true; calendarFormats: { "sameDay": "[Today] [at] HH:mm", "nextDay": "[Tomorrow] [at] HH:mm", "lastDay": "[Yesterday] [at] HH:mm", "nextWeek": "dddd [at] HH:mm", "lastWeek": "[Last] dddd [at] HH:mm", "sameElse": "ddd, D MMM [at] HH:mm" }) }}`,"timestamp/SystemMessage":`{{ timestamp | timestampFormatter(format: dddd L) }}`,"To start recording, allow the camera access in your browser":`Um mit der Aufnahme zu beginnen, erlauben Sie den Zugriff auf die Kamera in Ihrem Browser`,"To start recording, allow the microphone access in your browser":`Um mit der Aufnahme zu beginnen, erlauben Sie den Zugriff auf das Mikrofon in Ihrem Browser`,totalVoteCount_one:`1 Stimme insgesamt`,totalVoteCount_other:`{{ count }} Stimmen insgesamt`,Translated:`Übersetzt`,"Translated from {{ language }}":`Übersetzung aus {{ language }}`,"translationBuilderTopic/notification":`{{value, notification}}`,"Type a number from 2 to 10":`Geben Sie eine Zahl von 2 bis 10 ein`,Unarchive:`Archivierung aufheben`,"unban-command-args":`[@Benutzername]`,"unban-command-description":`Einen Benutzer entbannen`,"Unblock User":`Benutzer entsperren`,"unknown error":`Unbekannter Fehler`,Unmute:`Stummschaltung aufheben`,"unmute-command-args":`[@Benutzername]`,"unmute-command-description":`Stummschaltung eines Benutzers aufheben`,Unpin:`Anheftung aufheben`,"Unread messages":`Ungelesene Nachrichten`,"Unsupported attachment":`Nicht unterstützter Anhang`,"unsupported file type":`Nicht unterstützter Dateityp`,Update:`Aktualisieren`,"Update the comment attached to your poll answer":`Aktualisiere den Kommentar, der an deine Umfrageantwort angehängt ist`,"Update your comment":`Ihren Kommentar aktualisieren`,"Upload blocked":`Upload blockiert`,"Upload error":`Upload-Fehler`,"Upload failed":`Upload fehlgeschlagen`,'Upload type: "{{ type }}" is not allowed':`Upload-Typ: "{{ type }}" ist nicht erlaubt`,"User blocked":`Benutzer blockiert`,"User unblocked":`Blockierung des Benutzers aufgehoben`,"User uploaded content":`Vom Benutzer hochgeladener Inhalt`,Video:`Video`,videoCount_one:`Video`,videoCount_other:`{{ count }}
500 videos`,View:`Ansehen`,"View {{count}} comments_one":`{{count}} Kommentar anzeigen`,"View {{count}} comments_other":`{{count}} Kommentare anzeigen`,"View all":`Alle anzeigen`,"View original":`Original anzeigen`,"View results":`Ergebnisse anzeigen`,"View translation":`Übersetzung anzeigen`,"Voice message":`Sprachnachricht`,"Voice message {{ duration }}":`Sprachnachricht {{ duration }}`,"Voice message deleted":`Sprachnachricht gelöscht`,voiceMessageCount_one:`Sprachnachricht`,voiceMessageCount_other:`{{ count }} sprachnachrichten`,"Vote ended":`Abstimmung beendet`,Votes:`Stimmen`,"Wait until all attachments have uploaded":`Bitte warten, bis alle Anhänge hochgeladen wurden`,"Waiting for network…":`Warte auf Netzwerk…`,You:`Du`,"You've reached the maximum number of files":`Die maximale Anzahl an Dateien ist erreicht`},Ehe={"{{ commaSeparatedUsers }} and {{ moreCount }} more":`{{ commaSeparatedUsers }} and {{ moreCount }} more`,"{{ commaSeparatedUsers }}, and {{ lastUser }}":`{{ commaSeparatedUsers }}, and {{ lastUser }}`,"{{ count }} files_one":`{{ count }} file`,"{{ count }} files_other":`{{ count }} files`,"{{ count }} people are typing_one":`{{ count }} person is typing`,"{{ count }} people are typing_many":`{{ count }} people are typing`,"{{ count }} people are typing_other":`{{ count }} people are typing`,"{{ count }} photos_one":`{{ count }} photo`,"{{ count }} photos_other":`{{ count }} photos`,"{{ count }} reactions_one":`{{ count }} reaction`,"{{ count }} reactions_other":`{{ count }} reactions`,"{{ count }} videos_one":`{{ count }} video`,"{{ count }} videos_other":`{{ count }} videos`,"{{ firstUser }} and {{ secondUser }}":`{{ firstUser }} and {{ secondUser }}`,"{{ imageCount }} more":`{{ imageCount }} more`,"{{ memberCount }} members":`{{ memberCount }} members`,"{{ typing }} are typing":`{{ typing }} are typing`,"{{ typing }} is typing":`{{ typing }} is typing`,"{{ user }} has been muted":`{{ user }} has been muted`,"{{ user }} has been unmuted":`{{ user }} has been unmuted`,"{{ user }} is typing...":`{{ user }} is typing...`,"{{ users }} and {{ user }} are typing...":`{{ users }} and {{ user }} are typing...`,"{{ users }} and more are typing...":`{{ users }} and more are typing...`,"{{ watcherCount }} online":`{{ watcherCount }} online`,"{{count}} new messages_one":`{{count}} new message`,"{{count}} new messages_other":`{{count}} new messages`,"{{count}} unread_one":`{{count}} unread`,"{{count}} unread_other":`{{count}} unread`,"{{count}} votes_one":`{{count}} vote`,"{{count}} votes_other":`{{count}} votes`,"+{{ imageCount }}":`+{{ imageCount }}`,"+{{count}} more options_one":`+{{count}} more option`,"+{{count}} more options_other":`+{{count}} more options`,"🏙 Attachment...":`🏙 Attachment...`,"📊 {{createdBy}} created: {{ pollName}}":`📊 {{createdBy}} created: {{ pollName}}`,"📊 {{votedBy}} voted: {{pollOptionText}}":`📊 {{votedBy}} voted: {{pollOptionText}}`,"📍Shared location":`📍Shared location`,"Add a comment":`Add a Comment`,"Add a comment to your poll answer":`Add a comment to your poll answer`,"Add an option":`Add an Option`,"Add reaction":`Add reaction`,"All results loaded":`All results loaded`,"Allow access to camera":`Allow access to camera`,"Allow access to microphone":`Allow access to microphone`,"Allow comments":`Allow comments`,"Allow option suggestion":`Allow option suggestion`,"Allow others to add comments":`Allow Others to Add Comments`,"Also send as a direct message":`Also send as a direct message`,"Also send in channel":`Also send in channel`,"Also sent in channel":`Also sent in channel`,"An error has occurred during recording":`An error has occurred during recording`,"An error has occurred during the recording processing":`An error has occurred during the recording processing`,Anonymous:`Anonymous`,"Anonymous poll":`Anonymous Poll`,Archive:`Archive`,"Are you sure you want to delete this message?":`Are you sure you want to delete this message?`,"aria/Attachment":`Attachment`,"aria/Attachment Actions":`Attachment Actions`,"aria/Audio position {{ elapsed }} of {{ duration }}":`Audio position {{ elapsed }} of {{ duration }}`,"aria/Audio position {{ progress }} percent":`Audio position {{ progress }} percent`,"aria/Block User":`Block User`,"aria/Bookmark Message":`Bookmark Message`,"aria/Cancel recording":`Cancel recording`,"aria/Cancel Reply":`Cancel Reply`,"aria/Cancel upload":`Cancel upload`,"aria/Channel Actions":`Channel Actions`,"aria/Channel list":`Channel list`,"aria/Channel search results":`Channel search results`,"aria/Chat view tabs":`Chat view tabs`,"aria/Clear search":`Clear search`,"aria/Close callout dialog":`Close callout dialog`,"aria/Close thread":`Close thread`,"aria/Collapse sidebar":`Collapse sidebar`,"aria/Command Suggestions":`Command Suggestions`,"aria/Complete recording":`Complete recording`,"aria/Copy Message Text":`Copy Message Text`,"aria/Decrease value":`Decrease value`,"aria/Delete Message":`Delete Message`,"aria/Dismiss notification":`Dismiss notification`,"aria/Download attachment":`Download attachment`,"aria/Edit Message":`Edit Message`,"aria/Emoji picker":`Emoji picker`,"aria/Emoji Suggestions":`Emoji Suggestions`,"aria/Exit search":`Exit search`,"aria/Expand sidebar":`Expand sidebar`,"aria/File input":`File input`,"aria/File upload":`File upload`,"aria/Flag Message":`Flag Message`,"aria/Image failed to load":`Image failed to load`,"aria/Image input":`Image input`,"aria/Increase value":`Increase value`,"aria/Jump to latest message":`Jump to latest message`,"aria/Jump to quoted message":`Jump to quoted message`,"aria/Load More Channels":`L
500oad More Channels`,"aria/Mark Message Unread":`Mark Message Unread`,"aria/Mark messages as read":`Mark messages as read`,"aria/Menu":`Menu`,"aria/Message Actions":`Message Actions`,"aria/Message from {{ user }},":`Message from {{ user }},`,"aria/Message Options":`Message Options`,"aria/Message,":`Message,`,"aria/Mute User":`Mute User`,"aria/Notifications":`Notifications`,"aria/Open Attachment Selector":`Open Attachment Selector`,"aria/Open Channel Actions Menu":`Open Channel Actions Menu`,"aria/Open Menu":`Open Menu`,"aria/Open Message Actions Menu":`Open Message Actions Menu`,"aria/Open Reaction Selector":`Open Reaction Selector`,"aria/Open Thread":`Open Thread`,"aria/Pause":`Pause`,"aria/Pause recording":`Pause recording`,"aria/Percent complete":`{{percent}} percent complete`,"aria/Pin Message":`Pin Message`,"aria/Play":`Play`,"aria/Quote Message":`Quote Message`,"aria/Reaction list":`Reaction list`,"aria/Remind Me Message":`Remind Me Message`,"aria/Remind Me Options":`aria/Remind Me Options`,"aria/Remove attachment":`Remove attachment`,"aria/Remove location attachment":`Remove location attachment`,"aria/Remove option":`Remove option`,"aria/Remove Reminder":`Remove Reminder`,"aria/Remove Save For Later":`Remove Save For Later`,"aria/Resend Message":`Resend Message`,"aria/Resume recording":`Resume recording`,"aria/Retry upload":`Retry upload`,"aria/Review bounced message":`Review bounced message`,"aria/Search results":`Search results`,"aria/Search results header filter button for: {{ source }}":`Search results header filter button for: {{ source }}`,"aria/Seek audio position":`Seek audio position`,"aria/Select Channel: {{ channelName }}":`Select Channel: {{ channelName }}`,"aria/Select Reaction: {{ reactionName }}":`Select Reaction: {{ reactionName }}`,"aria/Select User Channel: {{ name }}":`Select User Channel: {{ name }}`,"aria/Send":`Send`,"aria/Show preview":`Show preview`,"aria/Start recording audio":`Start recording audio`,"aria/Stop AI Generation":`Stop AI Generation`,"aria/Suggestions":`Suggestions`,"aria/Thread list":`Thread list`,"aria/Unblock User":`Unblock User`,"aria/Unmute User":`Unmute User`,"aria/Unpin Message":`Unpin Message`,"aria/User Suggestions":`User Suggestions`,"Ask a question":`Ask a Question`,Attach:`Attach`,"Attach files":`Attach files`,Attachment:`Attachment`,"Attachment upload blocked due to {{reason}}":`Attachment upload blocked due to {{reason}}`,"Attachment upload failed due to {{reason}}":`Attachment upload failed due to {{reason}}`,Back:`Back`,"ban-command-args":`[@username] [text]`,"ban-command-description":`Ban a user`,"Block User":`Block User`,Cancel:`Cancel`,"Cannot seek in the recording":`Cannot seek in the recording`,"Channel archived":`Channel archived`,"Channel Missing":`Channel Missing`,"Channel muted":`Channel muted`,"Channel pinned":`Channel pinned`,"Channel unarchived":`Channel unarchived`,"Channel unmuted":`Channel unmuted`,"Channel unpinned":`Channel unpinned`,Channels:`Channels`,Chats:`Chats`,"Choose between 2 to 10 options":`Choose Between 2 to 10 Options`,Close:`Close`,"Close dialog":`Close dialog`,"Close emoji picker":`Close emoji picker`,"Close prompt: {{ title }}":`Close prompt: {{ title }}`,"Command not available while editing":`Command not available while editing`,"Command not available while replying":`Command not available while replying`,Commands:`Commands`,"Commands matching":`Commands matching`,"Connection failure, reconnecting now...":`Connection failure, reconnecting now...`,"Copy Message":`Copy Message`,Create:`Create`,"Create a question, add options, and configure poll settings":`Create a question, add options, and configure poll settings`,"Create poll":`Create Poll`,"Current location":`Current location`,Delete:`Delete`,"Delete for me":`Delete for me`,"Delete message":`Delete message`,Delivered:`Delivered`,"Direct message":`Direct message`,"Do you want to end this poll now? Nobody will be able to vote in this poll anymore.":`Do you want to end this poll now? Nobody will be able to vote in this poll anymore.`,"Download All":`Download All`,"Download Attachment":`Download Attachment`,"Download attachment {{ name }}":`Download attachment {{ name }}`,"Drag your files here":`Drag your files here`,"Drag your files here to add to your post":`Drag your files here to add to your post`,"Due {{ timeLeft }}":`Due {{ timeLeft }}`,"Due since {{ dueSince }}":`Due since {{ dueSince }}`,"duration/Message reminder":`{{ milliseconds | durationFormatter(withSuffix: true) }}`,"duration/Remind Me":`{{ milliseconds | durationFormatter(withSuffix: true) }}`,"duration/Share Location":`{{ milliseconds | durationFormatter }}`,"Edit Message":`Edit Message`,"Edit message request failed":`Edit message request failed`,Edited:`Edited`,"Emoji matching":`Emoji matching`,"Empty message...":`Empty message...`,End:`End`,"End poll":`End Poll`,"End this poll?":`End this Poll?`,"End vote":`End Vote`,"Enforce unique vote is enabled":`Enforce unique vote is enabled`,Error:`Error`,"Error adding flag":`Error adding flag`,"Error c
500onnecting to chat, refresh the page to try again.":`Error connecting to chat, refresh the page to try again.`,"Error deleting message":`Error deleting message`,"Error fetching reactions":`Error loading reactions`,"Error marking message unread. Cannot mark unread messages older than the newest 100 channel messages.":`Error marking message unread. Cannot mark unread messages older than the newest 100 channel messages.`,"Error muting a user ...":`Error muting a user ...`,"Error pinning message":`Error pinning message`,"Error removing message pin":`Error removing message pin`,"Error reproducing the recording":`Error reproducing the recording`,"Error starting recording":`Error starting recording`,"Error unmuting a user ...":`Error unmuting a user ...`,"Error uploading attachment":`Error uploading attachment`,"Error uploading file":`Error uploading file`,"Error uploading image":`Error uploading image`,"Error: {{ errorMessage }}":`Error: {{ errorMessage }}`,"Exit command {{ command }}":`Exit command {{ command }}`,"Failed to block user":`Failed to block user`,"Failed to create the poll":`Failed to create the poll`,"Failed to create the poll due to {{reason}}":`Failed to create the poll due to {{reason}}`,"Failed to delete the message":`Failed to delete the message`,"Failed to end the poll":`Failed to end the poll`,"Failed to end the poll due to {{reason}}":`Failed to end the poll due to {{reason}}`,"Failed to jump to the first unread message":`Failed to jump to the first unread message`,"Failed to leave channel":`Failed to leave channel`,"Failed to load channels":`Failed to load channels`,"Failed to load more channels":`Failed to load more channels`,"Failed to mark channel as read":`Failed to mark channel as read`,"Failed to play the recording":`Failed to play the recording`,"Failed to retrieve location":`Failed to retrieve location`,"Failed to share location":`Failed to share location`,"Failed to update channel archive status":`Failed to update channel archive status`,"Failed to update channel mute status":`Failed to update channel mute status`,"Failed to update channel pinned status":`Failed to update channel pinned status`,File:`File`,"File is required for upload attachment":`File is required for upload attachment`,"File is too large: {{ size }}, maximum upload size is {{ limit }}":`File is too large: {{ size }}, maximum upload size is {{ limit }}`,"File too large":`File too large`,fileCount_one:`File`,fileCount_other:`{{ count }} files`,Flag:`Flag`,"Generating...":`Generating...`,"giphy-command-args":`[text]`,"giphy-command-description":`Post a random gif to the channel`,"Hide who voted":`Hide Who Voted`,Image:`Image`,imageCount_one:`Image`,imageCount_other:`{{ count }} images`,"Instant commands":`Instant commands`,"language/af":`Afrikaans`,"language/am":`Amharic`,"language/ar":`Arabic`,"language/az":`Azerbaijani`,"language/bg":`Bulgarian`,"language/bn":`Bengali`,"language/bs":`Bosnian`,"language/cs":`Czech`,"language/da":`Danish`,"language/de":`German`,"language/el":`Greek`,"language/en":`English`,"language/es":`Spanish`,"language/es-MX":`Spanish (Mexico)`,"language/et":`Estonian`,"language/fa":`Persian`,"language/fa-AF":`Dari`,"language/fi":`Finnish`,"language/fr":`French`,"language/fr-CA":`French (Canada)`,"language/ha":`Hausa`,"language/he":`Hebrew`,"language/hi":`Hindi`,"language/hr":`Croatian`,"language/ht":`Haitian Creole`,"language/hu":`Hungarian`,"language/id":`Indonesian`,"language/it":`Italian`,"language/ja":`Japanese`,"language/ka":`Georgian`,"language/ko":`Korean`,"language/lt":`Lithuanian`,"language/lv":`Latvian`,"language/ms":`Malay`,"language/nl":`Dutch`,"language/no":`Norwegian`,"language/pl":`Polish`,"language/ps":`Pashto`,"language/pt":`Portuguese`,"language/ro":`Romanian`,"language/ru":`Russian`,"language/sk":`Slovak`,"language/sl":`Slovenian`,"language/so":`Somali`,"language/sq":`Albanian`,"language/sr":`Serbian`,"language/sv":`Swedish`,"language/sw":`Swahili`,"language/ta":`Tamil`,"language/th":`Thai`,"language/tl":`Tagalog`,"language/tr":`Turkish`,"language/uk":`Ukrainian`,"language/ur":`Urdu`,"language/vi":`Vietnamese`,"language/zh":`Chinese (Simplified)`,"language/zh-TW":`Chinese (Traditional)`,"Leave Channel":`Leave Channel`,"Left channel":`Left channel`,"Let others add options":`Let Others Add Options`,"Limit votes per person":`Limit Votes per Person`,Link:`Link`,linkCount_one:`Link`,linkCount_other:`{{ count }} links`,live:`live`,"Live for {{duration}}":`Live for {{duration}}`,"Live location":`Live location`,"Live until {{ timestamp }}":`Live until {{ timestamp }}`,"Load more":`Load more`,"Local upload attachment missing local id":`Local upload attachment missing local id`,Location:`Location`,"Location sharing ended":`Location sharing ended`,"Location: {{ coordinates }}":`Location: {{ coordinates }}`,"Mark as unread":`Mark as unread`,"Maximum number of votes (from 2 to 10)":`Maximum number of votes (from 2 to 10)`,"Maximum votes per person":`Maximum votes per person`,Menu:`Menu`,"Message deleted":`Message deleted`,"Message failed to send":`Message failed to send`,"Message has been successfully flagged":`Message has been successfully flagged`,"Message marked as unread":`Message marked as unread`,"Message pinned":`Message pinned`,"Message unpinned":`Message unpinned`,"Message was blocked by moderation policies":`Message was blocked by moderation policies`,"Messages have been marked unread.":`Messages have been marked unread.`,"Missing permissions to upload the attachment":`Missing permissions to upload the attachment`,"Multiple votes":`Multiple Votes`,Mute:`Mute`,"mute-command-args":`[@username]`,"mute-command-description":`Mute a user`,"network error":`network error`,New:`New`,"New message from {{user}}":`New message from {{user}}`,"New Messages!":`New Messages!`,"Next image":`Next image`,"No chats here yet…":`No chats here yet…`,"No conversations yet":`No conversations yet`,"No items exist":`No items exist`,"No results found":`No results found`,"Nobody will be able to vote in this poll anymore.":`Nobody will be able to vote in this poll anymore.`,"Nothing yet...":`
500Nothing yet...`,Offline:`Offline`,Ok:`Ok`,Online:`Online`,"Only numbers are allowed":`Only numbers are allowed`,"Only visible to you":`Only visible to you`,"Open emoji picker":`Open emoji picker`,"Open gallery at image {{ index }}":`Open gallery at image {{ index }}`,"Open image in gallery":`Open image in gallery`,"Open location in a map":`Open location in a map`,"Option already exists":`Option already exists`,"Option is empty":`Option is empty`,Options:`Options`,Original:`Original`,"People matching":`People matching`,Photo:`Photo`,Pin:`Pin`,"Pinned by {{ name }}":`Pinned by {{ name }}`,"Pinned by You":`Pinned by You`,"placeholder/PollComment":`Your comment`,"placeholder/PollOptionSuggestion":`Enter a new option`,"Play video":`Play video`,"Playback speed {{ rate }}x":`Playback speed {{ rate }}x`,Poll:`Poll`,"Poll comments":`Poll Comments`,"Poll ended":`Poll Ended`,"Poll options":`Poll Options`,"Poll results":`Poll Results`,"Previous image":`Previous image`,Question:`Question`,"Question {{ optionOrderNumber}}":`Question {{ optionOrderNumber}}`,"Question is required":`Question is required`,"Quote Reply":`Quote Reply`,"Reached the vote limit. Remove an existing vote first.":`Reached the vote limit. Remove an existing vote first.`,"Recording format is not supported and cannot be reproduced":`Recording format is not supported and cannot be reproduced`,"Remind me":`Remind me`,"Remind Me":`Remind Me`,"Reminder set":`Reminder set`,"Remove reminder":`Remove reminder`,"Remove save for later":`Remove save for later`,"Replied to a thread":`Replied to a thread`,Reply:`Reply`,"Reply to {{ authorName }}":`Reply to {{ authorName }}`,"Reply to a message to start a thread":`Reply to a message to start a thread`,"Reply to Message":`Reply to Message`,replyCount_one:`1 reply`,replyCount_other:`{{ count }} replies`,Resend:`Resend`,"Retry upload":`Retry upload`,"Review all options available in this poll":`Review all options available in this poll`,"Review comments submitted with poll answers":`Review comments submitted with poll answers`,"Review poll results and open an option to see detailed votes":`Review poll results and open an option to see detailed votes`,"Review this message and choose whether to delete it, edit it, or send it anyway":`Review this message and choose whether to delete it, edit it, or send it anyway`,"Review who voted for this option":`Review who voted for this option`,"Save for later":`Save for later`,"Saved for later":`Saved for later`,Search:`Search`,"Search GIFs":`Search GIFs`,"search-results-header-filter-source-button-label--channels":`channels`,"search-results-header-filter-source-button-label--messages":`messages`,"search-results-header-filter-source-button-label--users":`users`,"Searching for {{ searchSourceType }}...":`Searching for {{ searchSourceType }}...`,"Searching...":`Searching...`,searchResultsCount_one:`1 result`,searchResultsCount_other:`{{ count }} results`,"Select a thread to continue the conversation":`Select a thread to continue the conversation`,"Select more than one option":`Select More Than One Option`,"Select one":`Select one`,"Select one or more":`Select one or more`,"Select up to {{count}}_one":`Select up to {{count}}`,"Select up to {{count}}_other":`Select up to {{count}}`,"Select your current location and optionally enable live location sharing":`Select your current location and optionally enable live location sharing`,Send:`Send`,"Send a message":`Send a message`,"Send a message to start the conversation":`Send a message to start the conversation`,"Send Anyway":`Send Anyway`,"Send message request failed":`Send message request failed`,"Send poll":`Send Poll`,"Sending...":`Sending...`,Sent:`Sent`,Share:`Share`,"Share live location for":`Share live location for`,"Share Location":`Share Location`,"Shared live location":`Shared live location`,"Shared location":`Shared location`,Shuffle:`Shuffle`,"size limit":`size limit`,"Slow Mode ON":`Slow Mode ON`,"Slow mode, wait {{ seconds }}s...":`Slow mode, wait {{ seconds }}s...`,"Some of the files will not be accepted":`Some of the files will not be accepted`,"Start t
500yping to search":`Start typing to search`,"Stop sharing":`Stop sharing`,Submit:`Submit`,"Suggest a new option to add to this poll":`Suggest a new option to add to this poll`,"Suggest an option":`Suggest an Option`,"Tap to remove":`Tap to remove`,"Tap to remove: {{ reactionName }}":`Tap to remove: {{ reactionName }}`,"Thinking...":`Thinking...`,"this content could not be displayed":`this content could not be displayed`,"This field cannot be empty or contain only spaces":`This field cannot be empty or contain only spaces`,"This message did not meet our content guidelines":`This message did not meet our content guidelines`,Thread:`Thread`,"Thread has not been found":`Thread has not been found`,"Thread reply":`Thread reply`,"Thread Reply":`Thread Reply`,"ThreadListUnseenThreadsBanner/loading":`Loading...`,"ThreadListUnseenThreadsBanner/unreadThreads_one":`{{ count }} unread thread`,"ThreadListUnseenThreadsBanner/unreadThreads_other":`{{ count }} unread threads`,Threads:`Threads`,"timestamp/ChannelPreviewTimestamp":`{{ timestamp | timestampFormatter(calendar: true; calendarFormats: { "sameDay": "LT", "lastDay": "[Yesterday]", "lastWeek": "dddd", "sameElse": "L" }) }}`,"timestamp/DateSeparator":`{{ timestamp | timestampFormatter(calendar: true; calendarFormats: { "sameDay": "[Today]", "nextDay": "[Tomorrow]", "lastDay": "[Yesterday]", "nextWeek": "dddd", "lastWeek": "[Last] dddd", "sameElse": "ddd, D MMM" }) }}`,"timestamp/LiveLocation":`{{ timestamp | timestampFormatter(calendar: true) }}`,"timestamp/MessageTimestamp":`{{ timestamp | timestampFormatter(calendar: false; format: HH:mm) }}`,"timestamp/PollVote":`{{ timestamp | timestampFormatter(relativeCompact: true) }}`,"timestamp/PollVoteTooltip":`{{ timestamp | timestampFormatter(calendar: true) }}`,"timestamp/relativeDaysAgo":`{{ count }}d ago`,"timestamp/relativeToday":`Today`,"timestamp/relativeWeeksAgo":`{{ count }}w ago`,"timestamp/relativeYesterday":`Yesterday`,"timestamp/ReminderNotification":`{{ timestamp | timestampFormatter(calendar: true; calendarFormats: { "sameDay": "[Today] [at] HH:mm", "nextDay": "[Tomorrow] [at] HH:mm", "lastDay": "[Yesterday] [at] HH:mm", "nextWeek": "dddd [at] HH:mm", "lastWeek": "[Last] dddd [at] HH:mm", "sameElse": "ddd, D MMM [at] HH:mm" }) }}`,"timestamp/SystemMessage":`{{ timestamp | timestampFormatter(format: dddd L) }}`,"To start recording, allow the camera access in your browser":`To start recording, allow the camera access in your browser`,"To start recording, allow the microphone access in your browser":`To start recording, allow the microphone access in your browser`,totalVoteCount_one:`1 vote total`,totalVoteCount_other:`{{ count }} votes total`,Translated:`Translated`,"Translated from {{ language }}":`Translated from {{ language }}`,"translationBuilderTopic/notification":`{{value, notification}}`,"Type a number from 2 to 10":`Type a number from 2 to 10`,Unarchive:`Unarchive`,"unban-command-args":`[@username]`,"unban-command-description":`Unban a user`,"Unblock User":`Unblock User`,"unknown error":`unknown error`,Unmute:`Unmute`,"unmute-command-args":`[@username]`,"unmute-command-description":`Unmute a user`,Unpin:`Unpin`,"Unread messages":`Unread messages`,"Unsupported attachment":`Unsupported attachment`,"unsupported file type":`unsupported file type`,Update:`Update`,"Update the comment attached to your poll answer":`Update the comment attached to your poll answer`,"Update your comment":`Update Your Comment`,"Upload blocked":`Upload blocked`,"Upload error":`Upload error`,"Upload failed":`Upload failed`,'Upload type: "{{ type }}" is not allowed':`Upload type: "{{ type }}" is not allowed`,"User blocked":`User blocked`,"User unblocked":`User unblocked`,"User uploaded content":`User uploaded content`,Video:`Video`,videoCount_one:`Video`,videoCount_other:`{{ count }} videos`,View:`View`,"View {{count}} comments_one":`View {{count}}
500 Comment`,"View {{count}} comments_other":`View {{count}} Comments`,"View all":`View all`,"View original":`View original`,"View results":`View Results`,"View translation":`View translation`,"Voice message":`Voice message`,"Voice message {{ duration }}":`Voice message {{ duration }}`,"Voice message deleted":`Voice message deleted`,voiceMessageCount_one:`Voice message`,voiceMessageCount_other:`{{ count }} voice messages`,"Vote ended":`Vote ended`,Votes:`Votes`,"Wait until all attachments have uploaded":`Wait until all attachments have uploaded`,"Waiting for network…":`Waiting for network…`,You:`You`,"You've reached the maximum number of files":`You've reached the maximum number of files`},Dhe={"{{ commaSeparatedUsers }} and {{ moreCount }} more":`{{ commaSeparatedUsers }} y {{ moreCount }} más`,"{{ commaSeparatedUsers }}, and {{ lastUser }}":`{{ commaSeparatedUsers }} y {{ lastUser }}`,"{{ count }} files_one":`{{ count }} archivo`,"{{ count }} files_many":`{{ count }} archivos`,"{{ count }} files_other":`{{ count }} archivos`,"{{ count }} people are typing_one":`{{ count }} persona está escribiendo`,"{{ count }} people are typing_many":`{{ count }} personas están escribiendo`,"{{ count }} people are typing_other":`{{ count }} personas están escribiendo`,"{{ count }} photos_one":`{{ count }} foto`,"{{ count }} photos_many":`{{ count }} fotos`,"{{ count }} photos_other":`{{ count }} fotos`,"{{ count }} reactions_one":`{{ count }} reacción`,"{{ count }} reactions_many":`{{ count }} reacciones`,"{{ count }} reactions_other":`{{ count }} reacciones`,"{{ count }} videos_one":`{{ count }} vídeo`,"{{ count }} videos_many":`{{ count }} vídeos`,"{{ count }} videos_other":`{{ count }} vídeos`,"{{ firstUser }} and {{ secondUser }}":`{{ firstUser }} y {{ secondUser }}`,"{{ imageCount }} more":`{{ imageCount }} más`,"{{ memberCount }} members":`{{ memberCount }} miembros`,"{{ typing }} are typing":`{{ typing }} están escribiendo`,"{{ typing }} is typing":`{{ typing }} está escribiendo`,"{{ user }} has been muted":`{{ user }} ha sido silenciado`,"{{ user }} has been unmuted":`Se ha desactivado el silencio de {{ user }}`,"{{ user }} is typing...":`{{ user }} está escribiendo...`,"{{ users }} and {{ user }} are typing...":`{{ users }} y {{ user }} están escribiendo...`,"{{ users }} and more are typing...":`{{ users }} y más están escribiendo...`,"{{ watcherCount }} online":`{{ watcherCount }} en línea`,"{{count}} new messages_one":`{{count}} nuevo mensaje`,"{{count}} new messages_many":`{{count}} nuevos mensajes`,"{{count}} new messages_other":`{{count}} nuevos mensajes`,"{{count}} unread_one":`{{count}} no leído`,"{{count}} unread_many":`{{count}} no leídos`,"{{count}} unread_other":`{{count}} no leídos`,"{{count}} votes_one":`1 voto`,"{{count}} votes_many":`{{count}} votos`,"{{count}} votes_other":`{{count}} votos`,"+{{ imageCount }}":`+{{ imageCount }}`,"+{{count}} more options_one":`+{{count}} opción más`,"+{{count}} more options_many":`+{{count}} opciones más`,"+{{count}} more options_other":`+{{count}} opciones más`,"🏙 Attachment...":`🏙 Adjunto...`,"📊 {{createdBy}} created: {{ pollName}}":`📊 {{createdBy}} creó: {{ pollName}}`,"📊 {{votedBy}} voted: {{pollOptionText}}":`📊 {{votedBy}} votó: {{pollOptionText}}`,"📍Shared location":`📍Ubicación compartida`,"Add a comment":`Agregar un comentario`,"Add a comment to your poll answer":`Añade un comentario a tu respuesta de la encuesta`,"Add an option":`Agregar una opción`,"Add reaction":`Añadir reacción`,"All results loaded":`Todos los resultados cargados`,"Allow access to camera":`Permitir acceso a la cámara`,"Allow access to microphone":`Permitir acceso al micrófono`,"Allow comments":`Permitir comentarios`,"Allow option suggestion":`Permitir sugerencia de opciones`,"Allow others to add comments":`Permitir que otros añadan comentarios`,"Also send as a direct message":`También enviar como mensaje directo`,"Also send in channel":`También enviar en el canal`,"Also sent in channel":`También enviado en el canal`,"An error has occurred during recording":`Se ha producido un error durante la grabación`,"An error has occurred during the recording processing":`Se ha producido un error durante el procesamiento de la grabación`,Anonymous:`Anónimo`,"Anonymous poll":`Encuesta anónima`,Archive:`Archivo`,"Are you sure you want to delete this message?":`¿Estás seguro de que quieres eliminar este mensaje?`,"aria/Attachment":`Adjunto`,"aria/Attachment Actions":`Acciones del adjunto`,"aria/Audio position {{ elapsed }} of {{ duration }}":`Posición de audio {{ elapsed }} de {{ duration }}`,"aria/Audio position {{ progress }} percent":`Posición de audio {{ progress }} por ciento`,"aria/Block User":`Bloquear usuario`,"aria/Bookmark Message":`Guardar mensaje`,"aria/Cancel recording":`Cancelar grabación`,"aria/Cancel Reply":`Cancelar respuesta`,"aria/Cancel upload":`Cancelar carga`,"aria/Channel Actions":`Acciones del canal`,"aria/Channel list":`Lista de canales`,"aria/Channel search results":`Resultados de búsqueda de canales`,"aria/Chat view tabs":`Pestañas de vista del chat`,"aria/Clear search":`Borrar búsqueda`,"aria/Close callout dialog":`Cerrar diálogo de aviso`,"aria/Close thread":`Cerrar hilo`,"aria/Collapse sidebar":`Contraer barra lateral`,"aria/Command Suggestions":`Sugerencias de comandos`,"aria/Complete recording":`Completar grabación`,"aria/Copy Message Text":`Copiar texto del mensaje`,"aria/Decrease value":`Disminuir valor`,"aria/Delete Message":`Eliminar mensaje`,"aria/Dismiss notification":`Descartar notificación`,"aria/Download attachment":`Descargar adjunto`,"aria/Edit Message":`Editar mensaje`,"aria/Emoji picker":`Selector de emojis`,"aria/Emoji Suggestions":`Sugerencias de emojis`,"aria/Exit search":`Salir de la búsqueda`,"aria/Expand sidebar":`Expandir barra lateral`,"aria/File input":`Entrada de archivo`,"aria/File upload":`Carga de archivo`,"aria/Flag Message":`Marcar mensaje`,"aria/Image failed to load":`Error al cargar la 
500imagen`,"aria/Image input":`Entrada de imagen`,"aria/Increase value":`Aumentar valor`,"aria/Jump to latest message":`Ir al mensaje más reciente`,"aria/Jump to quoted message":`Ir al mensaje citado`,"aria/Load More Channels":`Cargar más canales`,"aria/Mark Message Unread":`Marcar como no leído`,"aria/Mark messages as read":`Marcar mensajes como leídos`,"aria/Menu":`Menú`,"aria/Message Actions":`Acciones del mensaje`,"aria/Message from {{ user }},":`Mensaje de {{ user }},`,"aria/Message Options":`Opciones de mensaje`,"aria/Message,":`Mensaje,`,"aria/Mute User":`Silenciar usuario`,"aria/Notifications":`Notificaciones`,"aria/Open Attachment Selector":`Abrir selector de adjuntos`,"aria/Open Channel Actions Menu":`Abrir menú de acciones del canal`,"aria/Open Menu":`Abrir menú`,"aria/Open Message Actions Menu":`Abrir menú de acciones de mensaje`,"aria/Open Reaction Selector":`Abrir selector de reacciones`,"aria/Open Thread":`Abrir hilo`,"aria/Pause":`Pausar`,"aria/Pause recording":`Pausar grabación`,"aria/Percent complete":`{{percent}} por ciento completado`,"aria/Pin Message":`Fijar mensaje`,"aria/Play":`Reproducir`,"aria/Quote Message":`Citar mensaje`,"aria/Reaction list":`Lista de reacciones`,"aria/Remind Me Message":`Recordarme`,"aria/Remind Me Options":`Opciones de recordatorio`,"aria/Remove attachment":`Eliminar adjunto`,"aria/Remove location attachment":`Eliminar adjunto de ubicación`,"aria/Remove option":`Eliminar opción`,"aria/Remove Reminder":`Quitar recordatorio`,"aria/Remove Save For Later":`Quitar guardar para después`,"aria/Resend Message":`Reenviar mensaje`,"aria/Resume recording":`Reanudar grabación`,"aria/Retry upload":`Reintentar carga`,"aria/Review bounced message":`Revisar mensaje rebotado`,"aria/Search results":`Resultados de búsqueda`,"aria/Search results header filter button for: {{ source }}":`Botón de filtro del encabezado de resultados de búsqueda para: {{ source }}`,"aria/Seek audio position":`Buscar posición de audio`,"aria/Select Channel: {{ channelName }}":`Seleccionar canal: {{ channelName }}`,"aria/Select Reaction: {{ reactionName }}":`Seleccionar reacción: {{ reactionName }}`,"aria/Select User Channel: {{ name }}":`Seleccionar canal de usuario: {{ name }}`,"aria/Send":`Enviar`,"aria/Show preview":`Mostrar vista previa`,"aria/Start recording audio":`Iniciar grabación de audio`,"aria/Stop AI Generation":`Detener generación de IA`,"aria/Suggestions":`Sugerencias`,"aria/Thread list":`Lista de hilos`,"aria/Unblock User":`Desbloquear usuario`,"aria/Unmute User":`Activar sonido`,"aria/Unpin Message":`Desfijar mensaje`,"aria/User Suggestions":`Sugerencias de usuarios`,"Ask a question":`Hacer una pregunta`,Attach:`Adjuntar`,"Attach files":`Adjuntar archivos`,Attachment:`Archivo adjunto`,"Attachment upload blocked due to {{reason}}":`Carga de adjunto bloqueada debido a {{reason}}`,"Attachment upload failed due to {{reason}}":`Carga de adjunto fallida debido a {{reason}}`,Back:`Atrás`,"ban-command-args":`[@usuario] [texto]`,"ban-command-description":`Prohibir a un usuario`,"Block User":`Bloquear usuario`,Cancel:`Cancelar`,"Cannot seek in the recording":`No se puede buscar en la grabación`,"Channel archived":`Canal archivado`,"Channel Missing":`Falta canal`,"Channel muted":`Canal silenciado`,"Channel pinned":`Canal fijado`,"Channel unarchived":`Canal desarchivado`,"Channel unmuted":`Silencio del canal desactivado`,"Channel unpinned":`Canal desanclado`,Channels:`Canales`,Chats:`Chats`,"Choose between 2 to 10 options":`Elige entre 2 y 10 opciones`,Close:`Cerrar`,"Close dialog":`Cerrar diálogo`,"Close emoji picker":`Cerrar el selector de emojis`,"Close prompt: {{ title }}":`Cerrar diálogo: {{ title }}`,"Command not available while editing":`Comando no disponible durante la edición`,"Command not available while replying":`Comando no disponible mientras se responde`,Commands:`Comandos`,"Commands matching":`Coincidencia de comandos`,"Connection failure, reconnecting now...":`Fallo de conexión, reconectando ahora...`,"Copy Message":`Copiar mensaje`,Create:`Crear`,"Create a question, add options, and configure poll settings":`Crea una pregunta, añade opciones y configura los ajustes de la encuesta`,"Create poll":`Crear encuesta`,"Current location":`Ubicación actual`,Delete:`Borrar`,"Delete for me":`Eliminar para mí`,"Delete message":`Eliminar mensaje`,Delivered:`Entregado`,"Direct message":`Mensaje directo`,"Do you want to end this poll now? Nobody will be able to vote in this poll anymore.":`¿Quieres terminar esta encuesta ahora? Nadie podrá votar más en esta encuesta.`,"Download All":`Descargar todo`,"Download Attachment":`Descargar ar
500chivo adjunto`,"Download attachment {{ name }}":`Descargar adjunto {{ name }}`,"Drag your files here":`Arrastra tus archivos aquí`,"Drag your files here to add to your post":`Arrastra tus archivos aquí para agregarlos a tu publicación`,"Due {{ timeLeft }}":`Vence en {{ timeLeft }}`,"Due since {{ dueSince }}":`Vencido desde {{ dueSince }}`,"duration/Message reminder":`{{ milliseconds | durationFormatter(withSuffix: true) }}`,"duration/Remind Me":`{{ milliseconds | durationFormatter(withSuffix: true) }}`,"duration/Share Location":`{{ milliseconds | durationFormatter }}`,"Edit Message":`Editar mensaje`,"Edit message request failed":`Error al editar la solicitud de mensaje`,Edited:`Editado`,"Emoji matching":`Coincidencia de emoji`,"Empty message...":`Mensaje vacío...`,End:`Final`,"End poll":`Terminar encuesta`,"End this poll?":`¿Terminar esta encuesta?`,"End vote":`Finalizar votación`,"Enforce unique vote is enabled":`El voto único está habilitado`,Error:`Error`,"Error adding flag":`Error al agregar la bandera`,"Error connecting to chat, refresh the page to try again.":`Error al conectarse al chat, actualice la página para volver a intentarlo.`,"Error deleting message":`Error al eliminar el mensaje`,"Error fetching reactions":`Error al cargar las reacciones`,"Error marking message unread. Cannot mark unread messages older than the newest 100 channel messages.":`Error al marcar el mensaje como no leído. No se pueden marcar mensajes no leídos más antiguos que los últimos 100 mensajes del canal.`,"Error muting a user ...":`Error al silenciar el usuario...`,"Error pinning message":`Error al fijar el mensaje`,"Error removing message pin":`Error al quitar el pin del mensaje`,"Error reproducing the recording":`Error al reproducir la grabación`,"Error starting recording":`Error al iniciar la grabación`,"Error unmuting a user ...":`Error al desactivar el silencio del usuario...`,"Error uploading attachment":`Error al subir el archivo adjunto`,"Error uploading file":`Error al cargar el archivo`,"Error uploading image":`Error al subir la imagen`,"Error: {{ errorMessage }}":`Error: {{ errorMessage }}`,"Exit command {{ command }}":`Salir del comando {{ command }}`,"Failed to block user":`No se pudo bloquear al usuario`,"Failed to create the poll":`Error al crear la encuesta`,"Failed to create the poll due to {{reason}}":`No se pudo crear la encuesta debido a {{reason}}`,"Failed to delete the message":`No se pudo eliminar el mensaje`,"Failed to end the poll":`No se pudo terminar la encuesta`,"Failed to end the poll due to {{reason}}":`No se pudo terminar la encuesta debido a {{reason}}`,"Failed to jump to the first unread message":`Error al saltar al primer mensaje no leído`,"Failed to leave channel":`No se pudo salir del canal`,"Failed to load channels":`No se pudieron cargar los canales`,"Failed to load more channels":`No se pudieron cargar más canales`,"Failed to mark channel as read":`Error al marcar el canal como leído`,"Failed to play the recording":`No se pudo reproducir la grabación`,"Failed to retrieve location":`No se pudo obtener la ubicación`,"Failed to share location":`No se pudo compartir la ubicación`,"Failed to update channel archive status":`No se pudo actualizar el estado de archivo del canal`,"Failed to update channel mute status":`No se pudo actualizar el estado de silencio del canal`,"Failed to update channel pinned status":`No se pudo actualizar el estado de fijación del canal`,File:`Archivo`,"File is required for upload attachment":`Se requiere un archivo para subir el adjunto`,"File is too large: {{ size }}, maximum upload size is {{ limit }}":`El archivo es demasiado grande: {{ size }}, el tamaño máximo de carga es de {{ limit }}`,"File too large":`Archivo demasiado grande`,fileCount_one:`1 archivo`,fileCount_many:`{{ count }} archivos`,fileCount_other:`{{ count }} archivos`,Flag:`Marcar`,"Generating...":`Generando...`,"giphy-command-args":`[texto]`,"giphy-command-description":`Publicar un gif aleatorio en el canal`,"Hide who voted":`Ocultar quién votó`,Image:`Imagen`,imageCount_one:`Imagen`,imageCount_many:`{{ count }} imágenes`,imageCount_other:`{{ count }} imágenes`,"Instant commands":`Comandos instantáneos`,"language/af":`Afrikáans`,"language/am":`Amárico`,"language/ar":`Árabe`,"language/az":`Azerbaiyano`,"language/bg":`Búlgaro`,"language/bn":`Bengalí`,"language/bs":`Bosnio`,"language/cs":`Checo`,"language/da":`Danés`,"language/de":`Alem
500án`,"language/el":`Griego`,"language/en":`Inglés`,"language/es":`Español`,"language/es-MX":`Español (México)`,"language/et":`Estonio`,"language/fa":`Persa`,"language/fa-AF":`Dari`,"language/fi":`Finlandés`,"language/fr":`Francés`,"language/fr-CA":`Francés (Canadá)`,"language/ha":`Hausa`,"language/he":`Hebreo`,"language/hi":`Hindi`,"language/hr":`Croata`,"language/ht":`Criollo haitiano`,"language/hu":`Húngaro`,"language/id":`Indonesio`,"language/it":`Italiano`,"language/ja":`Japonés`,"language/ka":`Georgiano`,"language/ko":`Coreano`,"language/lt":`Lituano`,"language/lv":`Letón`,"language/ms":`Malayo`,"language/nl":`Neerlandés`,"language/no":`Noruego`,"language/pl":`Polaco`,"language/ps":`Pastún`,"language/pt":`Portugués`,"language/ro":`Rumano`,"language/ru":`Ruso`,"language/sk":`Eslovaco`,"language/sl":`Esloveno`,"language/so":`Somalí`,"language/sq":`Albanés`,"language/sr":`Serbio`,"language/sv":`Sueco`,"language/sw":`Suajili`,"language/ta":`Tamil`,"language/th":`Tailandés`,"language/tl":`Tagalo`,"language/tr":`Turco`,"language/uk":`Ucraniano`,"language/ur":`Urdu`,"language/vi":`Vietnamita`,"language/zh":`Chino (simplificado)`,"language/zh-TW":`Chino (tradicional)`,"Leave Channel":`Abandonar canal`,"Left channel":`Canal abandonado`,"Let others add options":`Permitir que otros añadan opciones`,"Limit votes per person":`Limitar votos por persona`,Link:`Enlace`,linkCount_one:`Enlace`,linkCount_many:`{{ count }} enlaces`,linkCount_other:`{{ count }} enlaces`,live:`En vivo`,"Live for {{duration}}":`En vivo durante {{duration}}`,"Live location":`Ubicación en vivo`,"Live until {{ timestamp }}":`En vivo hasta {{ timestamp }}`,"Load more":`Cargar más`,"Local upload attachment missing local id":`El adjunto de subida local no tiene id local`,Location:`Ubicación`,"Location sharing ended":`Compartir ubicación terminado`,"Location: {{ coordinates }}":`Ubicación: {{ coordinates }}`,"Mark as unread":`Marcar como no leído`,"Maximum number of votes (from 2 to 10)":`Número máximo de votos (de 2 a 10)`,"Maximum votes per person":`Máximo de votos por persona`,Menu:`Menú`,"Message deleted":`Mensaje eliminado`,"Message failed to send":`No se pudo enviar el mensaje`,"Message has been successfully flagged":`El mensaje se marcó correctamente`,"Message marked as unread":`Mensaje marcado como no leído`,"Message pinned":`Mensaje fijado`,"Message unpinned":`Mensaje desanclado`,"Message was blocked by moderation policies":`El mensaje fue bloqueado por las políticas de moderación`,"Messages have been marked unread.":`Los mensajes han sido marcados como no leídos.`,"Missing permissions to upload the attachment":`Faltan permisos para subir el archivo adjunto`,"Multiple votes":`Votos múltiples`,Mute:`Silenciar`,"mute-command-args":`[@usuario]`,"mute-command-description":`Silenciar a un usuario`,"network error":`error de red`,New:`Nuevo`,"New message from {{user}}":`Nuevo mensaje de {{user}}`,"New Messages!":`¡Nuevos mensajes!`,"Next image":`Siguiente imagen`,"No chats here yet…":`Aún no hay mensajes aquí...`,"No conversations yet":`Aún no hay conversaciones`,"No items exist":`No existen elementos`,"No results found":`No se han encontrado resultados`,"Nobody will be able to vote in this poll anymore.":`Nadie podrá votar en esta encuesta.`,"Nothing yet...":`Nada aún...`,Offline:`Desconectado`,Ok:`Aceptar`,Online:`En línea`,"Only numbers are allowed":`Solo se permiten números`,"Only visible to you":`Solo visible para ti`,"Open emoji picker":`Abrir el selector de emojis`,"Open gallery at image {{ index }}":`Abrir galería en la imagen {{ index }}`,"Open image in gallery":`Abrir imagen en la galería`,"Open location in a map":`Abrir ubicación en un mapa`,"Option already exists":`La opción ya existe`,"Option is empty":`La opción está vacía`,Options:`Opciones`,Original:`Original`,"People matching":`Personas que coinciden`,Photo:`Foto`,Pin:`Fijar`,"Pinned by {{ name }}":`Fijado por {{ name }}`,"Pinned by You":`Anclado por ti`,"placeholder/PollComment":`Tu comentario`,"placeholder/PollOptionSuggestion":`Introduce una nueva opción`,"Play video":`Reproducir video`,"Playback speed {{ rate }}x":`Velocidad de reproducción {{ rate }}x`,Poll:`Encuesta`,"Poll comments":`Comentarios de la encuesta`,"Poll ended":`Encuesta finalizada`,"Poll options":`Opciones de la encuesta`,"Poll results":`Resultados de la encuesta`,"Previous image":`Imagen anterior`,Question:`Pregunta`,"Question {{ optionOrderNumber}}":`Pregunta {{ optionOrderNumber}}`,"Question is required":`La pregunta es obligatoria`,"Quote Reply":`Responder con cita`,"Reached the vote limit. Remove an existing vote first.":`Se ha alcanzado el límite de votos. Elimina un voto existente primero.`,"Recording format is not supported and cannot be reproduced":`El formato de grabación no es compatible y no se puede reproducir`,"Remind me":`Recordarme`,"Remind Me":`Recordarme`,"Reminder set":`Recordatorio establecido`,"Remove reminder":`Eliminar recordatorio`,"Remove save for later":`Quitar guardar para después`,"Replied to a thread":`Respondió en un hilo`,Reply:`Responder`,"Reply to {{ authorName }}":`Responder a {{ authorName }}`,"Reply to a message to start a thread":`Responde a un mensaje para iniciar un hilo`,"Reply to Message":`Responder al mensaje`,replyCount_one:`1 respuesta`,replyCount_many:`{{ count }} respuestas`,replyCount_other:`{{ count }} respuestas`,Resend:`Reenviar`,"Retry upload":`Reintentar la carga`,"Review all options available in this poll":`Revisa todas las opciones dis
500ponibles en esta encuesta`,"Review comments submitted with poll answers":`Revisa los comentarios enviados con las respuestas de la encuesta`,"Review poll results and open an option to see detailed votes":`Revisa los resultados de la encuesta y abre una opción para ver votos detallados`,"Review this message and choose whether to delete it, edit it, or send it anyway":`Revisa este mensaje y elige si eliminarlo, editarlo o enviarlo de todos modos`,"Review who voted for this option":`Revisa quién votó por esta opción`,"Save for later":`Guardar para más tarde`,"Saved for later":`Guardado para más tarde`,Search:`Buscar`,"Search GIFs":`Buscar GIFs`,"search-results-header-filter-source-button-label--channels":`canales`,"search-results-header-filter-source-button-label--messages":`mensajes`,"search-results-header-filter-source-button-label--users":`usuarios`,"Searching for {{ searchSourceType }}...":`Buscando {{ searchSourceType }}...`,"Searching...":`Buscando...`,searchResultsCount_one:`1 resultado`,searchResultsCount_many:`{{ count }} resultados`,searchResultsCount_other:`{{ count }} resultados`,"Select a thread to continue the conversation":`Selecciona un hilo para continuar la conversación`,"Select more than one option":`Seleccionar más de una opción`,"Select one":`Seleccionar uno`,"Select one or more":`Seleccionar uno o más`,"Select up to {{count}}_one":`Selecciona hasta {{count}}`,"Select up to {{count}}_many":`Selecciona hasta {{count}}`,"Select up to {{count}}_other":`Selecciona hasta {{count}}`,"Select your current location and optionally enable live location sharing":`Selecciona tu ubicación actual y, opcionalmente, habilita el uso compartido de ubicación en vivo`,Send:`Enviar`,"Send a message":`Envía un mensaje`,"Send a message to start the conversation":`Envía un mensaje para iniciar la conversación`,"Send Anyway":`Enviar de todos modos`,"Send message request failed":`Error al enviar la solicitud de mensaje`,"Send poll":`Enviar encuesta`,"Sending...":`Enviando...`,Sent:`Enviado`,Share:`Compartir`,"Share live location for":`Compartir ubicación en vivo durante`,"Share Location":`Compartir ubicación`,"Shared live location":`Ubicación en vivo compartida`,"Shared location":`Ubicación compartida`,Shuffle:`Mezclar`,"size limit":`límite de tamaño`,"Slow Mode ON":`Modo lento activado`,"Slow mode, wait {{ seconds }}s...":`Modo lento, espera {{ seconds }} s...`,"Some of the files will not be accepted":`Algunos archivos no serán aceptados`,"Start typing to search":`Empieza a escribir para buscar`,"Stop sharing":`Dejar de compartir`,Submit:`Enviar`,"Suggest a new option to add to this poll":`Sugiere una nueva opción para añadir a esta encuesta`,"Suggest an option":`Sugerir una opción`,"Tap to remove":`Toca para quitar`,"Tap to remove: {{ reactionName }}":`Toca para quitar: {{ reactionName }}`,"Thinking...":`Pensando...`,"this content could not be displayed":`Este contenido no se pudo mostrar`,"This field cannot be empty or contain only spaces":`Este campo no puede estar vacío o contener solo espacios`,"This message did not meet our content guidelines":`Este mensaje no cumple con nuestras directrices de contenido`,Thread:`Hilo`,"Thread has not been found":`No se ha encontrado el hilo`,"Thread reply":`Respuesta en hilo`,"Thread Reply":`Respuesta en hilo`,"ThreadListUnseenThreadsBanner/loading":`Cargando...`,"ThreadListUnseenThreadsBanner/unreadThreads_one":`{{ count }} hilo no leído`,"ThreadListUnseenThreadsBanner/unreadThreads_many":`{{ count }} hilos no leídos`,"ThreadListUnseenThreadsBanner/unreadThreads_other":`{{ count }} hilos no leídos`,Threads:`Hilos`,"timestamp/ChannelPreviewTimestamp":`{{ timestamp | timestampFormatter(calendar: true; calendarFormats: { "sameDay": "LT", "lastDay": "[Ayer]", "lastWeek": "dddd", "sameElse": "L" }) }}`,"timestamp/DateSeparator":`{{ timestamp | timestampFormatter(calendar: true; calendarFormats: { "sameDay": "[Hoy]", "nextDay": "[Mañana]", "lastDay": "[Ayer]", "nextWeek": "dddd", "lastWeek": "[Último] dddd", "sameElse": "ddd, D MMM" }) }}`,"timestamp/LiveLocation":`{{ timestamp | timestampFormatter(calendar: true) }}`,"timestamp/MessageTimestamp":`{{ timestamp | timestampFormatter(calendar: false; format: HH:mm) }}`,"timestamp/PollVote":`{{ timestamp | timestampFormatter(relativeCompact: true) }}`,"timestamp/PollVoteTooltip":`{{ timestamp | timestampFormatter(calendar: true) }}`,"timestamp/relativeDaysAgo":`{{ count }}d ago`,"timestamp/relativeToday":`Hoy`,"timestamp/relativeWeeksAgo":`{{ count }}w ago`,"timestamp/relativeYesterday":`Ayer`,"timestamp/ReminderNotification":`{{ timestamp | timestampFormatter(calendar: true; calendarFormats: { "sameDay": "[Today] [at] HH:mm", "nextDay": "[Tomorrow] [at] HH:mm", "lastDay": "[Yesterday] [at] HH:mm", "nextWeek": "dddd [at] HH:mm", "lastWeek": "[Last] dddd [at] HH:mm", "sameElse": "ddd, D MMM [at] HH:mm" }) }}`,"timestamp/SystemMessage":`{{ timestamp | timestampFormatter(format: dddd L) }}`,"To start recording, allow the camera access in your browser":`Para comenzar a grabar, permita el acceso a la cámara en su navegador`,"To start recording, allow the microphone access in your browser":`Para comenzar a grabar, permita el acceso al micrófono en su navegador`,totalVoteCount_one:`1 voto en total`,totalVoteCount_many:`{{ count }} votos en total`,totalVoteCount_other:`{{ count }} votos en total`,Translated:`Traducido`,"Translated from {{ language }}":`Traducido de {{ language }}`,"translationBuilderTopic/notification":`{{value, notification}}`,"Type a number from 2 to 10":`Escribe un número del 2 al 10`,Unarchive:`Desarchivar`,"unban-command-args":`[@usuario]`,"unban-command-description":`Quitar la prohibición a un usuario`,"Unblock User":`Desbloquear usuario`,"unknown error":`error desconocido`,Unmute:`Activar sonido`,"unmute-command-args":`[@usuario]`,"unmute-command-description":`Desactivar el silencio de un usuario`,Unpin:`Desfijar`,"Unread messages":`Mensajes no leídos`,"Unsupported attachment":`Adjunto no compatible`,"unsupported file type":`tipo de archivo no compatible`,Update:`Actualizar`,"Update the comment attached to your poll answer":`Actualiza el comentario adju
500nto a tu respuesta de la encuesta`,"Update your comment":`Actualizar tu comentario`,"Upload blocked":`Carga bloqueada`,"Upload error":`Error de carga`,"Upload failed":`Carga fallida`,'Upload type: "{{ type }}" is not allowed':`Tipo de carga: "{{ type }}" no está permitido`,"User blocked":`Usuario bloqueado`,"User unblocked":`Usuario desbloqueado`,"User uploaded content":`Contenido subido por el usuario`,Video:`Vídeo`,videoCount_one:`Video`,videoCount_many:`{{ count }} videos`,videoCount_other:`{{ count }} videos`,View:`Ver`,"View {{count}} comments_one":`Ver {{count}} comentario`,"View {{count}} comments_many":`Ver {{count}} comentarios`,"View {{count}} comments_other":`Ver {{count}} comentarios`,"View all":`Ver todo`,"View original":`Ver original`,"View results":`Ver resultados`,"View translation":`Ver traducción`,"Voice message":`Mensaje de voz`,"Voice message {{ duration }}":`Mensaje de voz {{ duration }}`,"Voice message deleted":`Mensaje de voz eliminado`,voiceMessageCount_one:`Mensaje de voz`,voiceMessageCount_many:`{{ count }} mensajes de voz`,voiceMessageCount_other:`{{ count }} mensajes de voz`,"Vote ended":`Votación finalizada`,Votes:`Votos`,"Wait until all attachments have uploaded":`Espere hasta que se hayan cargado todos los archivos adjuntos`,"Waiting for network…":`Esperando red…`,You:`Tú`,"You've reached the maximum number of files":`Has alcanzado el número máximo de archivos`},Ohe={"{{ commaSeparatedUsers }} and {{ moreCount }} more":`{{ commaSeparatedUsers }} et {{ moreCount }} autres`,"{{ commaSeparatedUsers }}, and {{ lastUser }}":`{{ commaSeparatedUsers }} et {{ lastUser }}`,"{{ count }} files_one":`{{ count }} fichier`,"{{ count }} files_many":`{{ count }} fichiers`,"{{ count }} files_other":`{{ count }} fichiers`,"{{ count }} people are typing_one":`{{ count }} personne écrit`,"{{ count }} people are typing_many":`{{ count }} personnes écrivent`,"{{ count }} people are typing_other":`{{ count }} personnes écrivent`,"{{ count }} photos_one":`{{ count }} photo`,"{{ count }} photos_many":`{{ count }} photos`,"{{ count }} photos_other":`{{ count }} photos`,"{{ count }} reactions_one":`{{ count }} réaction`,"{{ count }} reactions_many":`{{ count }} réactions`,"{{ count }} reactions_other":`{{ count }} réactions`,"{{ count }} videos_one":`{{ count }} vidéo`,"{{ count }} videos_many":`{{ count }} vidéos`,"{{ count }} videos_other":`{{ count }} vidéos`,"{{ firstUser }} and {{ secondUser }}":`{{ firstUser }} et {{ secondUser }}`,"{{ imageCount }} more":`{{ imageCount }} supplémentaires`,"{{ memberCount }} members":`{{ memberCount }} membres`,"{{ typing }} are typing":`{{ typing }} écrivent`,"{{ typing }} is typing":`{{ typing }} écrit`,"{{ user }} has been muted":`{{ user }} a été mis en sourdine`,"{{ user }} has been unmuted":`{{ user }} n'est plus en sourdine`,"{{ user }} is typing...":`{{ user }} est en train d'écrire...`,"{{ users }} and {{ user }} are typing...":`{{ users }} et {{ user }} sont en train d'écrire...`,"{{ users }} and more are typing...":`{{ users }} et plus sont en train d'écrire...`,"{{ watcherCount }} online":`{{ watcherCount }} en ligne`,"{{count}} new messages_one":`{{count}} nouveau message`,"{{count}} new messages_many":`{{count}} nouveaux messages`,"{{count}} new messages_other":`{{count}} nouveaux messages`,"{{count}} unread_one":`{{count}} non lu`,"{{count}} unread_many":`{{count}} non lus`,"{{count}} unread_other":`{{count}} non lus`,"{{count}} votes_one":`{{count}} vote`,"{{count}} votes_many":`{{count}} votes`,"{{count}} votes_other":`{{count}} votes`,"+{{ imageCount }}":`+{{ imageCount }}`,"+{{count}} more options_one":`+{{count}} option de plus`,"+{{count}} more options_many":`+{{count}} options de plus`,"+{{count}} more options_other":`+{{count}} options de plus`,"🏙 Attachment...":`🏙 Pièce jointe...`,"📊 {{createdBy}} created: {{ pollName}}":`📊 {{createdBy}} a créé : {{ pollName}}`,"📊 {{votedBy}} voted: {{pollOptionText}}":`📊 {{votedBy}} a voté : {{pollOptionText}}`,"📍Shared location":`📍Emplacement partagé`,"Add a comment":`Ajouter un commentaire`,"Add a comment to your poll answer":`Ajoutez un commentaire à votre réponse au sondage`,"Add an option":`Ajouter une option`,"Add reaction":`Ajouter une réaction`,"All results loaded":`Tous les résultats sont chargés`,"Allow access to camera":`Autoriser l'accès à la caméra`,"Allow access to microphone":`Autoriser l'accès au microphone`,"Allow comments":`Autoriser les commentaires`,"Allow option suggestion":`Autoriser la suggestion d'options`,"Allow others to add comments":`Permettre à d'autres d'ajouter des commentaires`,"Also send as a direct message":`Également envoyer en message direct`,"Also send in channel":`Également envoyer dans le canal`,"Also sent in channel":`Également envoyé dans le canal`,"An error has occurred during recording":`Une erreur s'est produite pendant l'enregistrement`,"An error has occurred during the recording processing":`Une erreur s'est produite pendant le traitement de l'enregistrement`,Anonymous:`Anonyme`,"Anonymous poll":`Sondage anonyme`,Archive:`Archiver`,"Are you sure you want to delete this message?":`Êtes-vous sûr de vouloir supprimer ce message ?`,"aria/Attachment":`Pièce jointe`,"aria/Attachment Actions":`Actions de la pièce jointe`,"aria/Audio position {{ elapsed }} of {{ duration }}":`Position audio {{ elapsed }} sur {{ duration }}`,"aria/Audio position {{ progress }} percent":`Position audio {{ progress }} pour cent`,"aria/Block User":`Bloquer l'utilisateur`,"aria/Bookmark Message":`Enregistrer le message`,"aria/Cancel recording":`Annuler l'enregistrement`,"aria/Cancel Reply":`Annuler la réponse`,"aria/Cancel upload":`Annuler le téléchargement`,"aria/Channel Actions":`Actions du canal`,"aria/Channel list":`Liste des canaux`,"aria/Channel search results":`Résultats de recherche de canaux`,"aria/Chat view tabs":`Onglets de la vue de chat`,"aria/Clear search":`Effacer la recherche`,"aria/Close callout dialog":`Fermer la boîte de dialogue d'information`,"aria/Close thread":`Fermer le fil`,"aria/Collapse sidebar":`Réduire la barre latérale`,"aria/Command Suggestions":`Suggestions de commandes`,"aria/Complete recording":`Terminer l'enregistrement`,"aria/Copy Message Text":`Copier le texte du message`,"aria/Decrease value":`Diminuer la valeur`,"aria/Delete Message":`Supprimer le message`,"aria/Dismiss notification":`Ignorer la notification`,"aria/Download attachment":`Télécharger la pièce jointe`,"aria/Edit Message":`Éditer un message`,"aria/Emoji picker":`Sélecteur d'émojis`,"aria/Emoji Suggestions":`Suggestions d'émojis`,"aria/Exit search":`Quitter la recherche`,"aria/Expand sidebar":`Développer la barre latérale`,"aria/File input":`Entrée de fic
500hier`,"aria/File upload":`Téléchargement de fichier`,"aria/Flag Message":`Signaler le message`,"aria/Image failed to load":`Échec du chargement de l'image`,"aria/Image input":`Entrée d'image`,"aria/Increase value":`Augmenter la valeur`,"aria/Jump to latest message":`Aller au dernier message`,"aria/Jump to quoted message":`Aller au message cité`,"aria/Load More Channels":`Charger plus de canaux`,"aria/Mark Message Unread":`Marquer comme non lu`,"aria/Mark messages as read":`Marquer les messages comme lus`,"aria/Menu":`Menu`,"aria/Message Actions":`Actions du message`,"aria/Message from {{ user }},":`Message de {{ user }},`,"aria/Message Options":`Options du message`,"aria/Message,":`Message,`,"aria/Mute User":`Mettre en sourdine`,"aria/Notifications":`Notifications`,"aria/Open Attachment Selector":`Ouvrir le sélecteur de pièces jointes`,"aria/Open Channel Actions Menu":`Ouvrir le menu des actions du canal`,"aria/Open Menu":`Ouvrir le menu`,"aria/Open Message Actions Menu":`Ouvrir le menu des actions du message`,"aria/Open Reaction Selector":`Ouvrir le sélecteur de réactions`,"aria/Open Thread":`Ouvrir le fil`,"aria/Pause":`Pause`,"aria/Pause recording":`Mettre en pause l'enregistrement`,"aria/Percent complete":`{{percent}} pour cent terminé`,"aria/Pin Message":`Épingler le message`,"aria/Play":`Lecture`,"aria/Quote Message":`Citer le message`,"aria/Reaction list":`Liste des réactions`,"aria/Remind Me Message":`Me rappeler`,"aria/Remind Me Options":`Options de rappel`,"aria/Remove attachment":`Supprimer la pièce jointe`,"aria/Remove location attachment":`Supprimer la pièce jointe d'emplacement`,"aria/Remove option":`Supprimer l'option`,"aria/Remove Reminder":`Supprimer le rappel`,"aria/Remove Save For Later":`Supprimer « Enregistrer pour plus tard »`,"aria/Resend Message":`Renvoyer le message`,"aria/Resume recording":`Reprendre l'enregistrement`,"aria/Retry upload":`Réessayer le téléchargement`,"aria/Review bounced message":`Examiner le message rejeté`,"aria/Search results":`Résultats de recherche`,"aria/Search results header filter button for: {{ source }}":`Bouton de filtre d'en-tête des résultats de recherche pour : {{ source }}`,"aria/Seek audio position":`Rechercher la position audio`,"aria/Select Channel: {{ channelName }}":`Sélectionner le canal : {{ channelName }}`,"aria/Select Reaction: {{ reactionName }}":`Sélectionner la réaction : {{ reactionName }}`,"aria/Select User Channel: {{ name }}":`Sélectionner le canal utilisateur : {{ name }}`,"aria/Send":`Envoyer`,"aria/Show preview":`Afficher l'aperçu`,"aria/Start recording audio":`Commencer l'enregistrement audio`,"aria/Stop AI Generation":`Arrêter la génération d'IA`,"aria/Suggestions":`Suggestions`,"aria/Thread list":`Liste des fils`,"aria/Unblock User":`Débloquer l'utilisateur`,"aria/Unmute User":`Désactiver muet`,"aria/Unpin Message":`Détacher le message`,"aria/User Suggestions":`Suggestions d'utilisateurs`,"Ask a question":`Poser une question`,Attach:`Joindre`,"Attach files":`Joindre des fichiers`,Attachment:`Pièce jointe`,"Attachment upload blocked due to {{reason}}":`Téléchargement de pièce jointe bloqué en raison de {{reason}}`,"Attachment upload failed due to {{reason}}":`Échec du téléchargement de la pièce jointe en raison de {{reason}}`,Back:`Retour`,"ban-command-args":`[@nomdutilisateur] [texte]`,"ban-command-description":`Bannir un utilisateur`,"Block User":`Bloquer l'utilisateur`,Cancel:`Annuler`,"Cannot seek in the recording":`Impossible de rechercher dans l'enregistrement`,"Channel archived":`Canal archivé`,"Channel Missing":`Canal Manquant`,"Channel muted":`Canal mis en sourdine`,"Channel pinned":`Canal épinglé`,"Channel unarchived":`Canal désarchivé`,"Channel unmuted":`Sourdine du canal désactivée`,"Channel unpinned":`Canal désépinglé`,Channels:`Canaux`,Chats:`Discussions`,"Choose between 2 to 10 options":`Choisir entre 2 et 10 options`,Close:`Fermer`,"Close dialog":`Fermer la boîte de dialogue`,"Close emoji picker":`Fermer le sélecteur d'émojis`,"Close prompt: {{ title }}":`Fermer l'invite : {{ title }}`,"Command not available while editing":`Commande non disponible pendant la modification`,"Command not available while replying":`Commande non disponible pendant la réponse`,Commands:`Commandes`,"Commands matching":`Correspondance des commandes`,"Connection failure, reconnecting now...":`Échec de la connexion, reconnexion en cours...`,"Copy Message":`Copier le message`,Create:`Créer`,"Create a question, add options, and configure poll settings":`Créez une question, ajoutez des options et configurez les paramètres du sondage`,"Create poll":`Créer un sondage`,"Current location":`Emplacement actuel`,Delete:`Supprimer`,"Delete for me":`Supprimer pour moi`,"Delete message":`Supprimer le message`,Delivered:`Publié`,"Direct message":`Message direct`,"Do you want to end this poll now? Nobody will be able to vote in this poll anymore.":`Voulez-vous terminer ce sondage maintenant ? Personne ne pourra plus voter dans ce sondage.`,"Download All":`Tout télécharger`,"Download Attachment":`Télécharger la pièce jointe`,"Download attachment {{ name }}":`Télécharger la pièce jointe {{ name }}`,"Drag your files here":`Glissez vos fichiers ici`,"Drag your files here to add to your post":`Glissez vos fichiers ici pour les ajouter à votre publication`,"Due {{ timeLeft }}":`Échéance dans {{ timeLeft }}`,"Due since {{ dueSince }}":`Échéance depuis {{ dueSince }}`,"duration/Message reminder":`{{ milliseconds | durationFormatter(withSuffix: true) }}`,"duration/Remind Me":`{{ milliseconds | durationFormatter(withSuffix: true) }}`,"duration/Share Location":`{{ milliseconds | durationFormatter }}`,"Edit Message":`Éditer un message`,"Edit message request failed":`Échec de la demande de modification du message`,Edited:`Modifié`,"Emoji matching":`Correspondance d'émojis`,"Empty message...":`Message vide...`,End:`Fin`,"End poll":`Terminer le sondage`,"End this poll?":`Terminer ce sondage ?`,"End vote":`Fin du vote`,"Enforce unique vote is enabled":`Le vote unique est activé`,Error:`Erreur`,"Error adding flag":`Erreur lors de l'ajout du signalement`,"Error c
500onnecting to chat, refresh the page to try again.":`Erreur de connexion au chat, rafraîchissez la page pour réessayer.`,"Error deleting message":`Erreur lors de la suppression du message`,"Error fetching reactions":`Erreur lors du chargement des réactions`,"Error marking message unread. Cannot mark unread messages older than the newest 100 channel messages.":`Erreur lors de la marque du message comme non lu. Impossible de marquer des messages non lus plus anciens que les 100 derniers messages du canal.`,"Error muting a user ...":`Erreur lors de la mise en sourdine d'un utilisateur...`,"Error pinning message":`Erreur lors de l'épinglage du message`,"Error removing message pin":`Erreur lors du retrait de l'épinglage du message`,"Error reproducing the recording":`Erreur lors de la reproduction de l'enregistrement`,"Error starting recording":`Erreur lors du démarrage de l'enregistrement`,"Error unmuting a user ...":`Erreur lors du démarrage de la sourdine d'un utilisateur ...`,"Error uploading attachment":`Erreur lors du téléchargement de la pièce jointe`,"Error uploading file":`Erreur lors du téléchargement du fichier`,"Error uploading image":`Erreur lors de l'envoi de l'image`,"Error: {{ errorMessage }}":`Erreur : {{ errorMessage }}`,"Exit command {{ command }}":`Quitter la commande {{ command }}`,"Failed to block user":`Impossible de bloquer l'utilisateur`,"Failed to create the poll":`Échec de la création du sondage`,"Failed to create the poll due to {{reason}}":`Échec de la création du sondage en raison de {{reason}}`,"Failed to delete the message":`Échec de la suppression du message`,"Failed to end the poll":`Impossible de terminer le sondage`,"Failed to end the poll due to {{reason}}":`Impossible de terminer le sondage en raison de {{reason}}`,"Failed to jump to the first unread message":`Échec du saut vers le premier message non lu`,"Failed to leave channel":`Impossible de quitter le canal`,"Failed to load channels":`Impossible de charger les canaux`,"Failed to load more channels":`Impossible de charger davantage de canaux`,"Failed to mark channel as read":`Échec du marquage du canal comme lu`,"Failed to play the recording":`Impossible de lire l'enregistrement`,"Failed to retrieve location":`Impossible de récupérer l'emplacement`,"Failed to share location":`Impossible de partager l'emplacement`,"Failed to update channel archive status":`Impossible de mettre à jour l'état d'archivage du canal`,"Failed to update channel mute status":`Impossible de mettre à jour l'état de la mise en sourdine du canal`,"Failed to update channel pinned status":`Impossible de mettre à jour l'état d'épinglage du canal`,File:`Fichier`,"File is required for upload attachment":`Un fichier est requis pour joindre une pièce`,"File is too large: {{ size }}, maximum upload size is {{ limit }}":`Le fichier est trop volumineux : {{ size }}, la taille maximale de téléchargement est de {{ limit }}`,"File too large":`Fichier trop volumineux`,fileCount_one:`1 fichier`,fileCount_many:`{{ count }} fichiers`,fileCount_other:`{{ count }} fichiers`,Flag:`Signaler`,"Generating...":`Génération...`,"giphy-command-args":`[texte]`,"giphy-command-description":`Poster un GIF aléatoire dans le canal`,"Hide who voted":`Masquer qui a voté`,Image:`Image`,imageCount_one:`Photo`,imageCount_many:`{{ count }} photos`,imageCount_other:`{{ count }} photos`,"Instant commands":`Commandes instantanées`,"language/af":`Afrikaans`,"language/am":`Amharique`,"language/ar":`Arabe`,"language/az":`Azéri`,"language/bg":`Bulgare`,"language/bn":`Bengali`,"language/bs":`Bosnien`,"language/cs":`Tchèque`,"language/da":`Danois`,"language/de":`Allemand`,"language/el":`Grec`,"language/en":`Anglais`,"language/es":`Espagnol`,"language/es-MX":`Espagnol (Mexique)`,"language/et":`Estonien`,"language/fa":`Persan`,"language/fa-AF":`Dari`,"language/fi":`Finnois`,"language/fr":`Français`,"language/fr-CA":`Français (Canada)`,"language/ha":`Haoussa`,"language/he":`Hébreu`,"language/hi":`Hindi`,"language/hr":`Croate`,"language/ht":`Créole haïtien`,"language/hu":`Hongrois`,"language/id":`Indonésien`,"language/it":`Italien`,"language/ja":`Japonais`,"language/ka":`Géorgien`,"language/ko":`Coréen`,"language/lt":`Lituanien`,"language/lv":`Letton`,"language/ms":`Malais`,"language/nl":`Néerlandais`,"language/no":`Norvégien`,"language/pl":`Polonais`,"language/ps":`Pachto`,"language/pt":`Portugais`,"language/ro":`Roumain`,"language/ru":`Russe`,"language/sk":`Slovaque`,"language/sl":`Slovène`,"language/so":`Somali`,"language/sq":`Albanais`,"language/sr":`Serbe`,"language/sv":`Suédois`,"language/sw":`Swahili`,"language/ta":`Tamoul`,"language/th":`Thaï`,"language/tl":`Tagalog`,"language/tr":`Turc`,"language/uk":`Ukrainien`,"language/ur":`Ourdou`,"language/vi":`Vietnamien`,"language/zh":`Chinois (simplifié)`,"language/zh-TW":`Chinois (traditionnel)`,"Leave Channel":`Quitter le c
500anal`,"Left channel":`Canal quitté`,"Let others add options":`Permettre à d'autres d'ajouter des options`,"Limit votes per person":`Limiter les votes par personne`,Link:`Lien`,linkCount_one:`Lien`,linkCount_many:`{{ count }} liens`,linkCount_other:`{{ count }} liens`,live:`en direct`,"Live for {{duration}}":`En direct pendant {{duration}}`,"Live location":`Emplacement en direct`,"Live until {{ timestamp }}":`En direct jusqu'à {{ timestamp }}`,"Load more":`Charger plus`,"Local upload attachment missing local id":`Pièce jointe locale sans identifiant local`,Location:`Emplacement`,"Location sharing ended":`Partage d'emplacement terminé`,"Location: {{ coordinates }}":`Emplacement : {{ coordinates }}`,"Mark as unread":`Marquer comme non lu`,"Maximum number of votes (from 2 to 10)":`Nombre maximum de votes (de 2 à 10)`,"Maximum votes per person":`Nombre maximal de votes par personne`,Menu:`Menu`,"Message deleted":`Message supprimé`,"Message failed to send":`Échec de l'envoi du message`,"Message has been successfully flagged":`Le message a été signalé avec succès`,"Message marked as unread":`Message marqué comme non lu`,"Message pinned":`Message épinglé`,"Message unpinned":`Message désépinglé`,"Message was blocked by moderation policies":`Le message a été bloqué par les politiques de modération`,"Messages have been marked unread.":`Les messages ont été marqués comme non lus.`,"Missing permissions to upload the attachment":`Autorisations manquantes pour télécharger la pièce jointe`,"Multiple votes":`Votes multiples`,Mute:`Muet`,"mute-command-args":`[@nomdutilisateur]`,"mute-command-description":`Muter un utilisateur`,"network error":`erreur réseau`,New:`Nouveau`,"New message from {{user}}":`Nouveau message de {{user}}`,"New Messages!":`Nouveaux Messages!`,"Next image":`Image suivante`,"No chats here yet…":`Pas encore de messages ici...`,"No conversations yet":`Aucune conversation pour le moment`,"No items exist":`Aucun élément`,"No results found":`Aucun résultat trouvé`,"Nobody will be able to vote in this poll anymore.":`Personne ne pourra plus voter dans ce sondage.`,"Nothing yet...":`Rien pour l'instant...`,Offline:`Hors ligne`,Ok:`D'accord`,Online:`En ligne`,"Only numbers are allowed":`Seuls les chiffres sont autorisés`,"Only visible to you":`Visible uniquement pour vous`,"Open emoji picker":`Ouvrir le sélecteur d'émojis`,"Open gallery at image {{ index }}":`Ouvrir la galerie à l'image {{ index }}`,"Open image in gallery":`Ouvrir l'image dans la galerie`,"Open location in a map":`Ouvrir l'emplacement dans une carte`,"Option already exists":`L'option existe déjà`,"Option is empty":`L'option est vide`,Options:`Options`,Original:`Original`,"People matching":`Correspondance de personnes`,Photo:`Photo`,Pin:`Épingler`,"Pinned by {{ name }}":`Épinglé par {{ name }}`,"Pinned by You":`Épinglé par vous`,"placeholder/PollComment":`Votre commentaire`,"placeholder/PollOptionSuggestion":`Saisir une nouvelle option`,"Play video":`Lire la vidéo`,"Playback speed {{ rate }}x":`Vitesse de lecture {{ rate }}x`,Poll:`Sondage`,"Poll comments":`Commentaires du sondage`,"Poll ended":`Sondage terminé`,"Poll options":`Options du sondage`,"Poll results":`Résultats du sondage`,"Previous image":`Image précédente`,Question:`Question`,"Question {{ optionOrderNumber}}":`Question {{ optionOrderNumber}}`,"Question is required":`La question est obligatoire`,"Quote Reply":`Répondre par citation`,"Reached the vote limit. Remove an existing vote first.":`La limite de votes a été atteinte. Supprimez d'abord un vote existant.`,"Recording format is not supported and cannot be reproduced":`Le format d'enregistrement n'est pas pris en charge et ne peut pas être reproduit`,"Remind me":`Me rappeler`,"Remind Me":`Me rappeler`,"Reminder set":`Rappel défini`,"Remove reminder":`Supprimer le rappel`,"Remove save for later":`Supprimer « Enregistrer pour plus tard »`,"Replied to a thread":`A répondu à un fil`,Reply:`Répondre`,"Reply to {{ authorName }}":`Répondre à {{ authorName }}`,"Reply to a message to start a thread":`Répondez à un message pour démarrer un fil`,"Reply to Message":`Répondre au message`,replyCount_one:`1 réponse`,replyCount_many:`{{ count }} réponses`,replyCount_other:`{{ count }} réponses`,Resend:`Renvoyer`,"Retry upload":`Réessayer le téléchargement`,"Review all options available in this poll":`Consultez toutes les options disponibles dans ce sondage`,"Review comments submitted with poll answers":`Consultez les commentaires envoyés avec les réponses au sondage`,"Review poll results and open an option to see detailed votes":`Consultez les résultats du sondage et ouvrez une option pour voir les votes détaillés`,"Review this message and choose whether to delete it, edit it, or send it anyway":`Consultez ce message et choisissez de le supprimer, le modifier ou l'envoyer quand même`,"Review who voted for this option":`Consultez qui a voté pour cette option`,"Save for later":`Enregistrer pour plus tard`,"Saved for later":`Enregistré pour plus tard`,Search:`Rechercher`,"Search GIFs":`Rechercher des GIFs`,"search-results-header-filter-source-button-label--channels":`canaux`,"search-results-header-filter-source-button-label--messages":`messages`,"search-results-header-filter-source-button-label--users":`utilisateurs`,"Searching for {{ searchSourceType }}...":`Recherche de {{ searchSourceType }}...`,"Searching...":`Recherche en cours...`,searchResultsCount_one:`1 résultat`,searchResultsCount_many:`{{ count }} résultats`,searchResultsCount_other:`{{ count }} résultats`,"Select a thread to continue the conversation":`Sélectionnez un fil pour continuer la conversation`,"Select more than one option":`Sélectionner plus d'une option`,"Select one":`Sélectionner un`,"Select one or more":`Sélectionner un ou plusieurs`,"Select up to {{count}}_one":`Sélectionner jusqu'à {{count}}`,"Select up to {{count}}_many":`Sélectionner jusqu'à {{count}}`,"Select up to {{count}}_other":`Sélectionner jusqu'à {{count}}`,"Select your current location and optionally enable live location sharing":`Sélectionnez votre position actuelle et activez éventuellement le partage de position en direct`,Send:`Envoyer`,"Send a message":`Envoyez un message`,"Send a message to start the conversation":`Envoyez un message pour commencer la conversation`,"Send Anyway":`Envoyer quand même`,"Send message request failed":`Échec de la demande d'envoi de message`,"Send poll":`Envoyer le sondage`,"Sending...":`Envoi en cours...`,Sent:`Envoyé`,Share:`Partager`,"Share live location for":`Partager l'emplacement en direct pendant`,"Share Location":`Partager l'emplacement`,"Shared live location":`Emplacement en direct partagé`,"Shared location":`Position partagée`,Shuffle:`Mélanger`,"size limit":`limite de taille`,"Slow Mode ON":`Mode lent activé`,"Slow mode, wait {{ seconds }}s...":`Mode lent, attendez {{ seconds }} s...`,"Some of the files will not be accepted":`Certains fichiers ne seront pas acceptés`,"Start t
500yping to search":`Commencez à taper pour rechercher`,"Stop sharing":`Arrêter de partager`,Submit:`Envoyer`,"Suggest a new option to add to this poll":`Suggérez une nouvelle option à ajouter à ce sondage`,"Suggest an option":`Suggérer une option`,"Tap to remove":`Appuyez pour retirer`,"Tap to remove: {{ reactionName }}":`Appuyez pour retirer: {{ reactionName }}`,"Thinking...":`Réflexion...`,"this content could not be displayed":`ce contenu n'a pas pu être affiché`,"This field cannot be empty or contain only spaces":`Ce champ ne peut pas être vide ou contenir uniquement des espaces`,"This message did not meet our content guidelines":`Ce message ne respecte pas nos directives de contenu`,Thread:`Fil de discussion`,"Thread has not been found":`Le fil de discussion n'a pas été trouvé`,"Thread reply":`Réponse dans le fil`,"Thread Reply":`Réponse dans le fil`,"ThreadListUnseenThreadsBanner/loading":`Chargement...`,"ThreadListUnseenThreadsBanner/unreadThreads_one":`{{ count }} fil non lu`,"ThreadListUnseenThreadsBanner/unreadThreads_many":`{{ count }} fils non lus`,"ThreadListUnseenThreadsBanner/unreadThreads_other":`{{ count }} fils non lus`,Threads:`Fils`,"timestamp/ChannelPreviewTimestamp":`{{ timestamp | timestampFormatter(calendar: true; calendarFormats: { "sameDay": "LT", "lastDay": "[Hier]", "lastWeek": "dddd", "sameElse": "L" }) }}`,"timestamp/DateSeparator":`{{ timestamp | timestampFormatter(calendar: true; calendarFormats: { "sameDay": "[Aujourd'hui]", "nextDay": "[Demain]", "lastDay": "[Hier]", "nextWeek": "dddd", "lastWeek": "[Dernier] dddd", "sameElse": "ddd, D MMM" }) }}`,"timestamp/LiveLocation":`{{ timestamp | timestampFormatter(calendar: true) }}`,"timestamp/MessageTimestamp":`{{ timestamp | timestampFormatter(calendar: false; format: HH:mm) }}`,"timestamp/PollVote":`{{ timestamp | timestampFormatter(relativeCompact: true) }}`,"timestamp/PollVoteTooltip":`{{ timestamp | timestampFormatter(calendar: true) }}`,"timestamp/relativeDaysAgo":`{{ count }}d ago`,"timestamp/relativeToday":`Aujourd'hui`,"timestamp/relativeWeeksAgo":`{{ count }}w ago`,"timestamp/relativeYesterday":`Hier`,"timestamp/ReminderNotification":`{{ timestamp | timestampFormatter(calendar: true; calendarFormats: { "sameDay": "[Today] [at] HH:mm", "nextDay": "[Tomorrow] [at] HH:mm", "lastDay": "[Yesterday] [at] HH:mm", "nextWeek": "dddd [at] HH:mm", "lastWeek": "[Last] dddd [at] HH:mm", "sameElse": "ddd, D MMM [at] HH:mm" }) }}`,"timestamp/SystemMessage":`{{ timestamp | timestampFormatter(format: dddd L) }}`,"To start recording, allow the camera access in your browser":`Pour commencer l'enregistrement, autorisez l'accès à la caméra dans votre navigateur`,"To start recording, allow the microphone access in your browser":`Pour commencer l'enregistrement, autorisez l'accès au microphone dans votre navigateur`,totalVoteCount_one:`1 vote au total`,totalVoteCount_many:`{{ count }} votes au total`,totalVoteCount_other:`{{ count }} votes au total`,Translated:`Traduit`,"Translated from {{ language }}":`Traduit du {{ language }}`,"translationBuilderTopic/notification":`{{value, notification}}`,"Type a number from 2 to 10":`Tapez un nombre de 2 à 10`,Unarchive:`Désarchiver`,"unban-command-args":`[@nomdutilisateur]`,"unban-command-description":`Débannir un utilisateur`,"Unblock User":`Débloquer l'utilisateur`,"unknown error":`erreur inconnue`,Unmute:`Désactiver muet`,"unmute-command-args":`[@nomdutilisateur]`,"unmute-command-description":`Démuter un utilisateur`,Unpin:`Détacher`,"Unread messages":`Messages non lus`,"Unsupported attachment":`Pièce jointe non prise en charge`,"unsupported file type":`type de fichier non pris en charge`,Update:`Mettre à jour`,"Update the comment attached to your poll answer":`Mettez à jour le commentaire joint à votre réponse au sondage`,"Update your comment":`Mettre à jour votre commentaire`,"Upload blocked":`Téléversement bloqué`,"Upload error":`Erreur de téléversement`,"Upload failed":`Échec du téléversement`,'Upload type: "{{ type }}" is not allowed':`Le type de fichier : "{{ type }}" n'est pas autorisé`,"User blocked":`Utilisateur bloqué`,"User unblocked":`Utilisateur débloqué`,"User uploaded content":`Contenu téléchargé par l'utilisateur`,Video:`Vidéo`,videoCount_one:`Vidéo`,videoCount_many:`{{ count }} vidéos`,videoCount_other:`{{ count }}
500 vidéos`,View:`Voir`,"View {{count}} comments_one":`Voir {{count}} commentaire`,"View {{count}} comments_many":`Voir {{count}} commentaires`,"View {{count}} comments_other":`Voir {{count}} commentaires`,"View all":`Tout voir`,"View original":`Voir l'original`,"View results":`Voir les résultats`,"View translation":`Voir la traduction`,"Voice message":`Message vocal`,"Voice message {{ duration }}":`Message vocal {{ duration }}`,"Voice message deleted":`Message vocal supprimé`,voiceMessageCount_one:`Mémo vocal`,voiceMessageCount_many:`{{ count }} mémos vocaux`,voiceMessageCount_other:`{{ count }} mémos vocaux`,"Vote ended":`Vote terminé`,Votes:`Votes`,"Wait until all attachments have uploaded":`Attendez que toutes les pièces jointes soient téléchargées`,"Waiting for network…":`En attente du réseau…`,You:`Vous`,"You've reached the maximum number of files":`Vous avez atteint le nombre maximal de fichiers`},khe={"{{ commaSeparatedUsers }} and {{ moreCount }} more":`{{ commaSeparatedUsers }} और {{ moreCount }} और`,"{{ commaSeparatedUsers }}, and {{ lastUser }}":`{{ commaSeparatedUsers }} और {{ lastUser }}`,"{{ count }} files_one":`{{ count }} फ़ाइल`,"{{ count }} files_other":`{{ count }} फ़ाइलें`,"{{ count }} people are typing_one":`{{ count }} व्यक्ति टाइप कर रहा है`,"{{ count }} people are typing_many":`{{ count }} लोग टाइप कर रहे हैं`,"{{ count }} people are typing_other":`{{ count }} लोग टाइप कर रहे हैं`,"{{ count }} photos_one":`{{ count }} फ़ोटो`,"{{ count }} photos_other":`{{ count }} फ़ोटो`,"{{ count }} reactions_one":`{{ count }} प्रतिक्रिया`,"{{ count }} reactions_other":`{{ count }} प्रतिक्रियाएं`,"{{ count }} videos_one":`{{ count }} वीडियो`,"{{ count }} videos_other":`{{ count }} वीडियो`,"{{ firstUser }} and {{ secondUser }}":`{{ firstUser }} और {{ secondUser }}`,"{{ imageCount }} more":`{{ imageCount }} और`,"{{ memberCount }} members":`{{ memberCount }} मेंबर्स`,"{{ typing }} are typing":`{{ typing }} टाइप कर रहे हैं`,"{{ typing }} is typing":`{{ typing }} टाइप कर रहा है`,"{{ user }} has been muted":`{{ user }} को म्यूट कर दिया गया है`,"{{ user }} has been unmuted":`{{ user }} को अनम्यूट कर दिया गया है`,"{{ user }} is typing...":`{{ user }} टाइप कर रहा है...`,"{{ users }} and {{ user }} are typing...":`{{ users }} और {{ user }} टाइप कर रहे हैं...`,"{{ users }} and more are typing...":`{{ users }} और अधिक टाइप कर रहे हैं...`,"{{ watcherCount }} online":`{{ watcherCount }} ऑनलाइन`,"{{count}} new messages_one":`{{count}} नया संदेश`,"{{count}} new messages_other":`{{count}} नए संदेश`,"{{count}} unread_one":`{{count}} अपठित`,"{{count}} unread_other":`{{count}} अपठित`,"{{count}} votes_one":`{{count}} वोट`,"{{count}} votes_other":`{{count}} वोट`,"+{{ imageCount }}":`+{{ imageCount }}`,"+{{count}} more options_one":`+{{count}} और विकल्प`,"+{{count}} more options_other":`+{{count}} और विकल्प`,"🏙 Attachment...":`🏙 अटैचमेंट`,"📊 {{createdBy}} created: {{ pollName}}":`📊 {{createdBy}} ने बनाया: {{ pollName}}`,"📊 {{votedBy}} voted: {{pollOptionText}}":`📊 {{votedBy}} ने वोट दिया: {{pollOptionText}}`,"📍Shared location":`📍साझा किया गया स्थान`,"Add a comment":`एक टिप्पणी जोड़ें`,"Add a comment to your poll answer":`अपने पोल उत्तर में एक टिप्पणी जोड़ें`,"Add an option":`एक विकल्प जोड़ें`,"Add reaction":`प्रतिक्रिया जोड़ें`,"All results loaded":`सभी परिणाà
500¤® लोड हो गए`,"Allow access to camera":`कैमरा तक पहुँच दें`,"Allow access to microphone":`माइक्रोफ़ोन तक पहुँच दें`,"Allow comments":`टिप्पणियाँ की अनुमति दें`,"Allow option suggestion":`विकल्प सुझाव की अनुमति दें`,"Allow others to add comments":`दूसरों को टिप्पणी जोड़ने दें`,"Also send as a direct message":`सीधे संदेश के रूप में भी भेजें`,"Also send in channel":`चैनल में भी भेजें`,"Also sent in channel":`चैनल में भी भेजा गया`,"An error has occurred during recording":`रेकॉर्डिंग के दौरान एक त्रुटि आ गई है`,"An error has occurred during the recording processing":`रेकॉर्डिंग प्रोसेसिंग के दौरान एक त्रुटि आ गई है`,Anonymous:`गुमनाम`,"Anonymous poll":`गुमनाम मतदान`,Archive:`आर्काइव`,"Are you sure you want to delete this message?":`क्या आप वाकई इस संदेश को हटाना चाहते हैं?`,"aria/Attachment":`अनुलग्नक`,"aria/Attachment Actions":`अटैचमेंट क्रियाएँ`,"aria/Audio position {{ elapsed }} of {{ duration }}":`ऑडियो स्थिति {{ elapsed }} / {{ duration }}`,"aria/Audio position {{ progress }} percent":`ऑडियो स्थिति {{ progress }} प्रतिशत`,"aria/Block User":`उपयोगकर्ता को ब्लॉक करें`,"aria/Bookmark Message":`संदेश बुकमार्क करें`,"aria/Cancel recording":`रिकॉर्डिंग रद्द करें`,"aria/Cancel Reply":`उत्तर रद्द करें`,"aria/Cancel upload":`अपलोड रद्द करें`,"aria/Channel Actions":`चैनल क्रियाएँ`,"aria/Channel list":`चैनल सूची`,"aria/Channel search results":`चैनल खोज परिणाम`,"aria/Chat view tabs":`चैट व्यू टैब`,"aria/Clear search":`खोज साफ़ करें`,"aria/Close callout dialog":`कॉलआउट संवाद बंद करें`,"aria/Close thread":`थ्रेड बंद करें`,"aria/Collapse sidebar":`साइडबार संक्षिप्त करें`,"aria/Command Suggestions":`कमांड सुझाव`,"aria/Complete recording":`रिकॉर्डिंग पूर्ण करें`,"aria/Copy Message Text":`संदेश की टेक्स्ट कॉपी करें`,"aria/Decrease value":`मान घटाएं`,"aria/Delete Message":`संदेश डिलीट करें`,"aria/Dismiss notification":`सूचना बंद करें`,"aria/Download attachment":`अनुलग्नक डाउनलोड करें`,"aria/Edit Message":`मैसेज में बदलाव करे`,"aria/Emoji picker":`इमोजी चुनने वाला`,"aria/Emoji Suggestions":`इमोजी सुझाव`,"aria/Exit search":`खोज से बाहर निकलें`,"aria/Expand sidebar":`साइडबार विस्तारित करें`,"aria/File input":`फ़ाइल इनपुट`,"aria/File upload":`फ़ाइल अपलोड`,"aria/Flag Message":`संदेश फ्लैग करें`,"aria/Image failed to load":`छवि लोड होने में विफल`,"aria/Image input":`छवि इनपुट`,"aria/Increase value":`मान बढ़ाएं`,"aria/Jump to latest message":`नवीनतम संदेश पर जाएं`,"aria/Jump to quoted message":`उद्धृत संदेश पर जाएं`,"aria/Load More Channels":`और चैनल लोड करें`,"aria/Mark Message Unread":`अपठित चिह्नित करें`,"aria/Mark messages as read":`संदेशों को पढ़ा हुआ चिह्नित करें`,"aria/Menu":`मेन्यू`,"aria/Message Actions":`संदेश कार्रवाइयाँ`,"aria/Message from {{ user }},":`{{ user }} का संदेश,`,"aria/Message Options":`संदेश विकल्प`,"aria/Message,"
500:`संदेश,`,"aria/Mute User":`उपयोगकर्ता म्यूट करें`,"aria/Notifications":`सूचनाएं`,"aria/Open Attachment Selector":`अटैचमेंट चयनकर्ता खोलें`,"aria/Open Channel Actions Menu":`चैनल क्रियाएँ मेनू खोलें`,"aria/Open Menu":`मेन्यू खोलें`,"aria/Open Message Actions Menu":`संदेश क्रिया मेन्यू खोलें`,"aria/Open Reaction Selector":`प्रतिक्रिया चयनकर्ता खोलें`,"aria/Open Thread":`थ्रेड खोलें`,"aria/Pause":`रोकें`,"aria/Pause recording":`रिकॉर्डिंग रोकें`,"aria/Percent complete":`{{percent}} प्रतिशत पूर्ण`,"aria/Pin Message":`संदेश पिन करें`,"aria/Play":`चलाएँ`,"aria/Quote Message":`संदेश उद्धरण`,"aria/Reaction list":`प्रतिक्रिया सूची`,"aria/Remind Me Message":`मुझे याद दिलाएं`,"aria/Remind Me Options":`रिमाइंडर विकल्प`,"aria/Remove attachment":`संलग्नक हटाएं`,"aria/Remove location attachment":`स्थान संलग्नक हटाएं`,"aria/Remove option":`विकल्प हटाएं`,"aria/Remove Reminder":`अनुस्मारक हटाएं`,"aria/Remove Save For Later":`बाद में देखें हटाएं`,"aria/Resend Message":`संदेश फिर से भेजें`,"aria/Resume recording":`रिकॉर्डिंग फिर शुरू करें`,"aria/Retry upload":`अपलोड पुनः प्रयास करें`,"aria/Review bounced message":`वापस लौटा संदेश समीक्षा करें`,"aria/Search results":`खोज परिणाम`,"aria/Search results header filter button for: {{ source }}":`{{ source }} के लिए खोज परिणाम शीर्षक फ़िल्टर बटन`,"aria/Seek audio position":`ऑडियो स्थिति खोजें`,"aria/Select Channel: {{ channelName }}":`चैनल चुनें: {{ channelName }}`,"aria/Select Reaction: {{ reactionName }}":`प्रतिक्रिया चुनें: {{ reactionName }}`,"aria/Select User Channel: {{ name }}":`उपयोगकर्ता चैनल चुनें: {{ name }}`,"aria/Send":`भेजें`,"aria/Show preview":`पूर्वावलोकन दिखाएं`,"aria/Start recording audio":`ऑडियो रिकॉर्डिंग शुरू करें`,"aria/Stop AI Generation":`एआई जनरेशन रोकें`,"aria/Suggestions":`सुझाव`,"aria/Thread list":`थ्रेड सूची`,"aria/Unblock User":`उपयोगकर्ता अनब्लॉक करें`,"aria/Unmute User":`उपयोगकर्ता अनम्यूट करें`,"aria/Unpin Message":`संदेश अनपिन करें`,"aria/User Suggestions":`उपयोगकर्ता सुझाव`,"Ask a question":`एक प्रश्न पूछें`,Attach:`संलग्न करें`,"Attach files":`फाइल्स अटैच करे`,Attachment:`अनुलग्नक`,"Attachment upload blocked due to {{reason}}":`{{reason}} के कारण अटैचमेंट अपलोड ब्लॉक किया गया`,"Attachment upload failed due to {{reason}}":`{{reason}} के कारण अटैचमेंट अपलोड विफल रहा`,Back:`वापस`,"ban-command-args":`[@उपयोगकर्तनाम] [पाठ]`,"ban-command-description":`एक उपयोगकर्ता को प्रतिषेधित करें`,"Block User":`उपयोगकर्ता को ब्लॉक करें`,Cancel:`रद्द करें`,"Cannot seek in the recording":`रेकॉर्डिंग में खोज नहीं की जा सकती`,"Channel ar
500chived":`चैनल संग्रहीत किया गया`,"Channel Missing":`चैनल उपलब्ध नहीं है`,"Channel muted":`चैनल म्यूट किया गया`,"Channel pinned":`चैनल पिन किया गया`,"Channel unarchived":`चैनल असंग्रहीत किया गया`,"Channel unmuted":`चैनल अनम्यूट किया गया`,"Channel unpinned":`चैनल अनपिन किया गया`,Channels:`चैनल`,Chats:`चैट`,"Choose between 2 to 10 options":`2 से 10 विकल्प चुनें`,Close:`बंद करे`,"Close dialog":`डायलॉग बंद करें`,"Close emoji picker":`इमोजी पिकर बंद करें`,"Close prompt: {{ title }}":`प्रॉम्प्ट बंद करें: {{ title }}`,"Command not available while editing":`संपादन के दौरान कमांड उपलब्ध नहीं है`,"Command not available while replying":`उत्तर देते समय कमांड उपलब्ध नहीं है`,Commands:`कमांड`,"Commands matching":`मेल खाती है`,"Connection failure, reconnecting now...":`कनेक्शन विफल रहा, अब पुनः कनेक्ट हो रहा है ...`,"Copy Message":`संदेश कॉपी करें`,Create:`बनाएँ`,"Create a question, add options, and configure poll settings":`एक प्रश्न बनाएं, विकल्प जोड़ें और पोल सेटिंग्स कॉन्फ़िगर करें`,"Create poll":`मतदान बनाएँ`,"Current location":`वर्तमान स्थान`,Delete:`डिलीट`,"Delete for me":`मेरे लिए डिलीट करें`,"Delete message":`संदेश हटाएं`,Delivered:`पहुंच गया`,"Direct message":`प्रत्यक्ष संदेश`,"Do you want to end this poll now? Nobody will be able to vote in this poll anymore.":`क्या आप अभी इस पोल को समाप्त करना चाहते हैं? इस पोल में अब कोई भी वोट नहीं कर पाएगा।`,"Download All":`सब डाउनलोड करें`,"Download Attachment":`अटैचमेंट डाउनलोड करें`,"Download attachment {{ name }}":`अनुलग्नक {{ name }} डाउनलोड करें`,"Drag your files here":`अपनी फ़ाइलें यहाँ खींचें`,"Drag your files here to add to your post":`अपनी फ़ाइलें यहाँ खींचें और अपने पोस्ट में जोड़ने के लिए`,"Due {{ timeLeft }}":`{{ timeLeft }} में देय`,"Due since {{ dueSince }}":`{{ dueSince }} से देय`,"duration/Message reminder":`{{ milliseconds | durationFormatter(withSuffix: true) }}`,"duration/Remind Me":`{{ milliseconds | durationFormatter(withSuffix: true) }}`,"duration/Share Location":`{{ milliseconds | durationFormatter }}`,"Edit Message":`मैसेज में बदलाव करे`,"Edit message request failed":`संदेश संपादित करने का अनुरोध विफल रहा`,Edited:`संपादित`,"Emoji matching":`इमोजी मिलान`,"Empty message...":`खाली संदेश ...`,End:`समाप्त`,"End poll":`पोल समाप्त करें`,"End this poll?":`इस पोल को समाप्त करें?`,"End vote":`मत समाप्त करें`,"Enforce unique vote is enabled":`अनोखा वोट सक्षम है`,Error:`त्रुटि`,"Error adding flag":`ध्वज जोड़ने में त्रुटि`,"Error connecting to chat, refresh the page to try again.":`चैट से कनेक्ट करने में त्रुटि, पेज को रिफ्रेश करें`,"Error deleting message":`संदेश हटाने में त्रुटि`,"Error fetching reactions":`प्रतिक्रियाएँ लोड करने में त्रुटि`,"Error marking message unread":`संदेश को अपठित चिह्नित करने में त्रुटि`,"Error marking message unread. Cannot mark unread messages older than the newest 100 channel messages.":`संदेश को अपठित मार्क करने में त्रुटि। सबसे नए 100 चैनल संदेश से पहले के सभी अपठित संदेशों को अपठित मार्क नहीं किया जा सकता है।`,"Error muting a user ...":`यूजर को म्यूट करने का प्रयास फेल हुआ`,"Error pinning message":`संदेश को पिन करने में त्रुटि`,"Error removing message pin":`संदेश पिन निकालने में त्रुटि`,"Error reproducing the recording":`रिकॉर्डिंग पुन: उत्à
500¤ªà¤¨à¥à¤¨ करने में त्रुटि`,"Error starting recording":`रेकॉर्डिंग शुरू करने में त्रुटि`,"Error unmuting a user ...":`यूजर को अनम्यूट करने का प्रयास फेल हुआ`,"Error uploading attachment":`अटैचमेंट अपलोड करते समय त्रुटि`,"Error uploading file":`फ़ाइल अपलोड करने में त्रुटि`,"Error uploading image":`छवि अपलोड करने में त्रुटि`,"Error: {{ errorMessage }}":`फेल: {{ errorMessage }}`,"Exit command {{ command }}":`कमांड से बाहर निकलें {{ command }}`,"Failed to block user":`उपयोगकर्ता को ब्लॉक करने में विफल`,"Failed to create the poll":`मतदान बनाने में विफल`,"Failed to create the poll due to {{reason}}":`मतदान {{reason}} के कारण नहीं बन सका`,"Failed to delete the message":`संदेश हटाने में विफल`,"Failed to end the poll":`पोल समाप्त करने में विफल`,"Failed to end the poll due to {{reason}}":`{{reason}} के कारण पोल समाप्त करने में विफल`,"Failed to jump to the first unread message":`पहले अपठित संदेश पर जाने में विफल`,"Failed to leave channel":`चैनल छोड़ने में विफल`,"Failed to load channels":`चैनल लोड करने में विफल`,"Failed to load more channels":`और चैनल लोड करने में विफल`,"Failed to mark channel as read":`चैनल को पढ़ा हुआ चिह्नित करने में विफल।`,"Failed to play the recording":`रेकॉर्डिंग प्ले करने में विफल`,"Failed to retrieve location":`स्थान प्राप्त करने में विफल`,"Failed to share location":`स्थान साझा करने में विफल`,"Failed to update channel archive status":`चैनल के आर्काइव स्थिति को अपडेट करने में विफल`,"Failed to update channel mute status":`चैनल की म्यूट स्थिति को अपडेट करने में विफल`,"Failed to update channel pinned status":`चैनल की पिन स्थिति को अपडेट करने में विफल`,File:`फ़ाइल`,"File is required for upload attachment":`अटैचमेंट अपलोड के लिए फ़ाइल आवश्यक है`,"File is too large: {{ size }}, maximum upload size is {{ limit }}":`फ़ाइल बहुत बड़ी है: {{ size }}, अधिकतम अपलोड साइज़ {{ limit }} है`,"File too large":`फ़ाइल बहुत बड़ी है`,fileCount_one:`1 फ़ाइल`,fileCount_other:`{{ count }} फ़ाइलें`,Flag:`फ्लैग करे`,"Generating...":`बना रहा है...`,"giphy-command-args":`[पाठ]`,"giphy-command-description":`चैनल पर एक क्रॉफिल जीआइएफ पोस्ट करें`,"Hide who voted":`किसने वोट दिया छिपाएं`,Image:`छवि`,imageCount_one:`1 छवि`,imageCount_other:`{{ count }} छवियाँ`,"Instant commands":`तत्काल कमांड`,"language/af":`अफ्रीकी`,"language/am":`अम्हारिक`,"language/ar":`अरबी`,"language/az":`अज़रबैजानी`,"language/bg":`बुल्गारियाई`,"language/bn":`बंगाली`,"language/bs":`बोस्नियाई`,"language/cs":`चेक`,"language/da":`डेनिश`,"language/de":`जर्मन`,"language/el":`यूनानी`,"language/en":`अंग्रेज़ी`,"language/es":`स्पेनिश`,"language/es-MX":`स्पेनिश (मेक्सिको)`,"language/et":`एस्तोनियाई`,"language/fa":`फ़ारसी`,"language/fa-AF":`दरी`,"language/fi":`फ़िनिश`,"language/fr":`फ़्रेंच`,"language/fr-CA":`फ़्रेंच (कनाडा)`,"language/ha":`हौसा`,"language/he":`हिब्रू`,"language/hi":`हिंदी`,"language/hr":`क्रोएशियाई`,"language/ht":`हैतियाई क्रियोल`,"language/hu":`हंगेरी`,"language/id":`इंडोनेशियाई`,"language/it":`इतालवी`,"language/ja":`जापानी`,"language/ka":`जॉर्जियाई`,"language/ko":`कोरियाई`,"language/lt":`लिथुआनियाई`,"language/lv":`लातवियाई`,"language/ms":`मलय`,"language/nl":`डच`,"language/no":`नॉर्वेजियाई`,"language/pl":`पोलिश`,"language/ps":`पश्तो`,"language/pt":`पुर्तगाली`,"language/ro":`रोमानियाई`,"language/ru":`रूसी`,"language/sk":`स्लोवाक`,"language/sl":`स्लोवेनियाई`,"language/so":`सोमाली`,"language/sq":`à
500¤…ल्बानियाई`,"language/sr":`सर्बियाई`,"language/sv":`स्वीडिश`,"language/sw":`स्वाहिली`,"language/ta":`तमिल`,"language/th":`थाई`,"language/tl":`तागालोग`,"language/tr":`तुर्की`,"language/uk":`यूक्रेनियाई`,"language/ur":`उर्दू`,"language/vi":`वियतनामी`,"language/zh":`चीनी (सरलीकृत)`,"language/zh-TW":`चीनी (पारंपरिक)`,"Leave Channel":`चैनल छोड़ें`,"Left channel":`चैनल छोड़ दिया गया`,"Let others add options":`दूसरों को विकल्प जोड़ने दें`,"Limit votes per person":`प्रति व्यक्ति वोट सीमित करें`,Link:`लिंक`,linkCount_one:`1 लिंक`,linkCount_other:`{{ count }} लिंक`,live:`लाइव`,"Live for {{duration}}":`{{duration}} के लिए लाइव`,"Live location":`लाइव स्थान`,"Live until {{ timestamp }}":`{{ timestamp }} तक लाइव`,"Load more":`और लोड करें`,"Local upload attachment missing local id":`लोकल अपलोड अटैचमेंट में लोकल आईडी नहीं है`,Location:`स्थान`,"Location sharing ended":`स्थान साझा करना समाप्त`,"Location: {{ coordinates }}":`स्थान: {{ coordinates }}`,"Mark as unread":`अपठित चिह्नित करें`,"Maximum number of votes (from 2 to 10)":`अधिकतम वोटों की संख्या (2 से 10)`,"Maximum votes per person":`प्रति व्यक्ति अधिकतम वोट`,Menu:`मेन्यू`,"Message deleted":`मैसेज हटा दिया गया`,"Message failed to send":`संदेश भेजने में विफल`,"Message has been successfully flagged":`मैसेज को फ्लैग कर दिया गया है`,"Message marked as unread":`संदेश को अपठित के रूप में चिह्नित किया गया`,"Message pinned":`संदेश पिन किया गया`,"Message unpinned":`संदेश अनपिन किया गया`,"Message was blocked by moderation policies":`संदेश को मॉडरेशन नीतियों द्वारा ब्लॉक कर दिया गया है`,"Messages have been marked unread.":`संदेशों को अपठित चिह्नित किया गया है।`,"Missing permissions to upload the attachment":`अटैचमेंट अपलोड करने के लिए अनुमतियां गायब`,"Multiple votes":`कई वोट`,Mute:`म्यूट करे`,"mute-command-args":`[@उपयोगकर्तनाम]`,"mute-command-description":`एक उपयोगकर्ता को म्यूट करें`,"network error":`नेटवर्क त्रुटि`,New:`नए`,"New message from {{user}}":`{{user}} से नया संदेश`,"New Messages!":`नए मैसेज!`,"Next image":`अगली छवि`,"No chats here yet…":`यहां अभी तक कोई चैट नहीं...`,"No conversations yet":`अभी तक कोई बातचीत नहीं है`,"No items exist":`कोई आइटम मौजूद नहीं है`,"No results found":`कोई परिणाम नहीं मिला`,"Nobody will be able to vote in this poll anymore.":`अब कोई भी इस मतदान में मतदान नहीं कर सकेगा।`,"Nothing yet...":`कोई मैसेज नहीं है`,Offline:`ऑफलाइन`,Ok:`ठीक है`,Online:`ऑनलाइन`,"Only numbers are allowed":`केवल संख्याएँ अनुमत हैं`,"Only visible to you":`केवल आपको दिखाई देता है`,"Open emoji picker":`इमोजी पिकर खोलिये`,"Open gallery at image {{ index }}":`गैलरी को छवि {{ index }} पर खोलें`,"Open image in gallery":`छवि को गैलरी में खोलें`,"Open location in a map":`मानचित्र में स्थान खोलें`,"Option already exists":`विकल्प पहले से मौजूद है`,"Option is empty":`विकल्प खाली है`,Options:`विकल्प`,Original:`मूल`,"People matching":`मेल खाते लोग`,Photo:`फ़ोटो`,Pin:`पिन`,"P
500inned by {{ name }}":`{{ name }} द्वारा पिन किया गया`,"Pinned by You":`आपके द्वारा पिन किया गया`,"placeholder/PollComment":`आपकी टिप्पणी`,"placeholder/PollOptionSuggestion":`नया विकल्प दर्ज करें`,"Play video":`वीडियो चलाएं`,"Playback speed {{ rate }}x":`प्लेबैक गति {{ rate }}x`,Poll:`मतदान`,"Poll comments":`मतदान टिप्पणियाँ`,"Poll ended":`पोल समाप्त`,"Poll options":`मतदान विकल्प`,"Poll results":`मतदान परिणाम`,"Previous image":`पिछली छवि`,Question:`प्रश्न`,"Question {{ optionOrderNumber}}":`प्रश्न {{ optionOrderNumber}}`,"Question is required":`प्रश्न आवश्यक है`,"Quote Reply":`उद्धरण जवाब`,"Reached the vote limit. Remove an existing vote first.":`मतदान सीमा तक पहुंच गया। पहले एक मौजूदा वोट हटाएं।`,"Recording format is not supported and cannot be reproduced":`रेकॉर्डिंग फ़ॉर्मेट समर्थित नहीं है और पुनः उत्पन्न नहीं किया जा सकता`,"Remind me":`मुझे याद दिलाएं`,"Remind Me":`मुझे याद दिलाएं`,"Reminder set":`अनुस्मारक सेट किया गया`,"Remove reminder":`रिमाइंडर हटाएं`,"Remove save for later":`बाद में देखें हटाएं`,"Replied to a thread":`थ्रेड में जवाब दिया`,Reply:`जवाब दे दो`,"Reply to {{ authorName }}":`{{ authorName }} को जवाब दें`,"Reply to a message to start a thread":`थ्रेड शुरू करने के लिए किसी संदेश का जवाब दें`,"Reply to Message":`संदेश का जवाब दें`,replyCount_one:`1 रिप्लाई`,replyCount_other:`{{ count }} रिप्लाई`,Resend:`फिर से भेजें`,"Retry upload":`अपलोड फिर से करें`,"Review all options available in this poll":`इस पोल में उपलब्ध सभी विकल्पों की समीक्षा करें`,"Review comments submitted with poll answers":`पोल उत्तरों के साथ भेजी गई टिप्पणियों की समीक्षा करें`,"Review poll results and open an option to see detailed votes":`पोल परिणामों की समीक्षा करें और विस्तृत वोट देखने के लिए एक विकल्प खोलें`,"Review this message and choose whether to delete it, edit it, or send it anyway":`इस संदेश की समीक्षा करें और चुनें कि इसे हटाना है, संपादित करना है या फिर भी भेजना है`,"Review who voted for this option":`समीक्षा करें कि इस विकल्प के लिए किसने वोट किया`,"Save for later":`बाद के लिए सहेजें`,"Saved for later":`बाद के लिए सहेजा गया`,Search:`खोज`,"Search GIFs":`GIF खोजें`,"search-results-header-filter-source-button-label--channels":`चैनल्स`,"search-results-header-filter-source-button-label--messages":`संदेश`,"search-results-header-filter-source-button-label--users":`उपयोगकर्ता`,"Searching for {{ searchSourceType }}...":`{{ searchSourceType }} खोज रहे हैं...`,"Searching...":`खोज कर...`,searchResultsCount_one:`1 परिणाम`,searchResultsCount_other:`{{ count }}
500 परिणाम`,"Select a thread to continue the conversation":`बातचीत जारी रखने के लिए एक थ्रेड चुनें`,"Select more than one option":`एक से अधिक विकल्प चुनें`,"Select one":`एक चुनें`,"Select one or more":`एक या अधिक चुनें`,"Select up to {{count}}_one":`अधिकतम {{count}} तक चुनें`,"Select up to {{count}}_other":`अधिकतम {{count}} तक चुनें`,"Select your current location and optionally enable live location sharing":`अपना वर्तमान स्थान चुनें और वैकल्पिक रूप से लाइव लोकेशन शेयरिंग सक्षम करें`,Send:`भेजे`,"Send a message":`संदेश भेजें`,"Send a message to start the conversation":`बातचीत शुरू करने के लिए संदेश भेजें`,"Send Anyway":`वैसे भी भेजें`,"Send message request failed":`संदेश भेजने का अनुरोध विफल रहा`,"Send poll":`पोल भेजें`,"Sending...":`भेजा जा रहा है`,Sent:`भेजा गया`,Share:`साझा करें`,"Share live location for":`लाइव स्थान साझा करें`,"Share Location":`स्थान साझा करें`,"Shared live location":`साझा किया गया लाइव स्थान`,"Shared location":`साझा स्थान`,Shuffle:`मिश्रित करें`,"size limit":`आकार सीमा`,"Slow Mode ON":`स्लो मोड ऑन`,"Slow mode, wait {{ seconds }}s...":`स्लो मोड, {{ seconds }} सेकंड प्रतीक्षा करें...`,"Some of the files will not be accepted":`कुछ फ़ाइलें स्वीकार नहीं की जाएंगी`,"Start typing to search":`खोजने के लिए टाइप करना शुरू करें`,"Stop sharing":`साझा करना बंद करें`,Submit:`जमा करें`,"Suggest a new option to add to this poll":`इस पोल में जोड़ने के लिए एक नया विकल्प सुझाएं`,"Suggest an option":`एक विकल्प सुझाव दें`,"Tap to remove":`हटाने के लिए टैप करें`,"Tap to remove: {{ reactionName }}":`हटाने के लिए टैप करें: {{ reactionName }}`,"Thinking...":`सोच रहा है...`,"this content could not be displayed":`यह कॉन्टेंट लोड नहीं हो पाया`,"This field cannot be empty or contain only spaces":`यह फ़ील्ड खाली नहीं हो सकता या केवल रिक्त स्थान नहीं रख सकता`,"This message did not meet our content guidelines":`यह संदेश हमारे सामग्री दिशानिर्देशों के अनुरूप नहीं था`,Thread:`रिप्लाई थ्रेड`,"Thread has not been found":`थ्रेड नहीं मिला`,"Thread reply":`थ्रेड में उत्तर`,"Thread Reply":`थ्रेड में उत्तर`,"ThreadListUnseenThreadsBanner/loading":`लोड हो रहा है...`,"ThreadListUnseenThreadsBanner/unreadThreads_one":`{{ count }} अपठित थ्रेड`,"ThreadListUnseenThreadsBanner/unreadThreads_other":`{{ count }} अपठित थ्रेड`,Threads:`थ्रेड्स`,"timestamp/ChannelPreviewTimestamp":`{{ timestamp | timestampFormatter(calendar: true; calendarFormats: { "sameDay": "LT", "lastDay": "[बीता कल]", "lastWeek": "dddd", "sameElse": "L" }) }}`,"timestamp/DateSeparator":`{{ timestamp | timestampFormatter(calendar: true; calendarFormats: { "sameDay": "[आज]", "nextDay": "[कल]", "lastDay": "[बीता कल]", "nextWeek": "dddd", "lastWeek": "[पिछला] dddd", "sameElse": "ddd, D MMM" }) }}`,"timestamp/LiveLocation":`{{ timestamp | timestampFormatter(calendar: true) }}`,"timestamp/MessageTimestamp":`{{ timestamp | timestampFormatter(calendar: false; format: HH:mm) }}`,"timestamp/PollVote":`{{ timestamp | timestampFormatter(relativeCompact: true) }}`,"timestamp/PollVoteTooltip":`{{ timestamp | timestampFormatter(calendar: true) }}`,"timestamp/relativeDaysAgo":`{{ count }}d ago`,"timestamp/relativeToday":`आज`,"timestamp/relativeWeeksAgo":`{{ count }}w ago`,"timestamp/relativeYesterday":`बीता कल`,"timestamp/ReminderNotification":`{{ timestamp | timestampFormatter(calendar: true; calendarFormats: { "sameDay": "[Today] [at] HH:mm", "nextDay": "[Tomorrow] [at] HH:mm", "lastDay": "[Yesterday] [at] HH:mm", "nextWeek": "dddd [at] HH:mm", "lastWeek": "[Last] dddd [at] HH:mm", "sameElse": "ddd, D MMM [at] HH:mm" }) }}`,"timestamp/SystemMessage":`{{ timestamp | timestampFormatter(format: dddd L) }}`,"To start recording, allow the camera access in your browser":`रिकॉर्डिंग शुरू करने के लिए, अपने ब्राà
500¤‰à¤œà¤¼à¤° में कैमरा तक पहुँच दें`,"To start recording, allow the microphone access in your browser":`रिकॉर्डिंग शुरू करने के लिए, अपने ब्राउज़र में माइक्रोफ़ोन तक पहुँच दें`,totalVoteCount_one:`कुल 1 वोट`,totalVoteCount_other:`कुल {{ count }} वोट`,Translated:`अनुवादित`,"Translated from {{ language }}":`{{ language }} से अनुवादित`,"translationBuilderTopic/notification":`{{value, notification}}`,"Type a number from 2 to 10":`2 से 10 तक का एक नंबर टाइप करें`,Unarchive:`अनआर्काइव`,"unban-command-args":`[@उपयोगकर्तनाम]`,"unban-command-description":`एक उपयोगकर्ता को प्रतिषेध से मुक्त करें`,"Unblock User":`उपयोगकर्ता अनब्लॉक करें`,"unknown error":`अज्ञात त्रुटि`,Unmute:`अनम्यूट`,"unmute-command-args":`[@उपयोगकर्तनाम]`,"unmute-command-description":`एक उपयोगकर्ता को अनम्यूट करें`,Unpin:`अनपिन`,"Unread messages":`अपठित संदेश`,"Unsupported attachment":`असमर्थित अटैचमेंट`,"unsupported file type":`असमर्थित फ़ाइल प्रकार`,Update:`अपडेट करें`,"Update the comment attached to your poll answer":`अपने पोल उत्तर से जुड़ी टिप्पणी अपडेट करें`,"Update your comment":`अपने टिप्पणी को अपडेट करें`,"Upload blocked":`अपलोड अवरुद्ध`,"Upload error":`अपलोड त्रुटि`,"Upload failed":`अपलोड विफल`,'Upload type: "{{ type }}" is not allowed':`अपलोड प्रकार: "{{ type }}" की अनुमति नहीं है`,"User blocked":`उपयोगकर्ता अवरुद्ध किया गया`,"User unblocked":`उपयोगकर्ता अनब्लॉक किया गया`,"User uploaded content":`उपयोगकर्ता अपलोड की गई सामग्री`,Video:`वीडियो`,videoCount_one:`1 वीडियो`,videoCount_other:`{{ count }} वीडियो`,View:`देखें`,"View {{count}} comments_one":`देखें {{count}}
500 टिप्पणी`,"View {{count}} comments_other":`देखें {{count}} टिप्पणियाँ`,"View all":`सभी देखें`,"View original":`मूल देखें`,"View results":`परिणाम देखें`,"View translation":`अनुवाद देखें`,"Voice message":`आवाज संदेश`,"Voice message {{ duration }}":`वॉइस संदेश {{ duration }}`,"Voice message deleted":`वॉइस संदेश हटा दिया गया`,voiceMessageCount_one:`1 ध्वनि संदेश`,voiceMessageCount_other:`{{ count }} ध्वनि संदेश`,"Vote ended":`मतदान समाप्त`,Votes:`वोट`,"Wait until all attachments have uploaded":`सभी अटैचमेंट अपलोड होने तक प्रतीक्षा करें`,"Waiting for network…":`नेटवर्क की प्रतीक्षा…`,You:`आप`,"You've reached the maximum number of files":`आप अधिकतम फ़ाइलों तक पहुँच गए हैं`},Ahe={"{{ commaSeparatedUsers }} and {{ moreCount }} more":`{{ commaSeparatedUsers }} e altri {{ moreCount }}`,"{{ commaSeparatedUsers }}, and {{ lastUser }}":`{{ commaSeparatedUsers }} e {{ lastUser }}`,"{{ count }} files_one":`{{ count }} file`,"{{ count }} files_many":`{{ count }} file`,"{{ count }} files_other":`{{ count }} file`,"{{ count }} people are typing_one":`{{ count }} persona sta scrivendo`,"{{ count }} people are typing_many":`{{ count }} persone stanno scrivendo`,"{{ count }} people are typing_other":`{{ count }} persone stanno scrivendo`,"{{ count }} photos_one":`{{ count }} foto`,"{{ count }} photos_many":`{{ count }} foto`,"{{ count }} photos_other":`{{ count }} foto`,"{{ count }} reactions_one":`{{ count }} reazione`,"{{ count }} reactions_many":`{{ count }} reazioni`,"{{ count }} reactions_other":`{{ count }} reazioni`,"{{ count }} videos_one":`{{ count }} video`,"{{ count }} videos_many":`{{ count }} video`,"{{ count }} videos_other":`{{ count }} video`,"{{ firstUser }} and {{ secondUser }}":`{{ firstUser }} e {{ secondUser }}`,"{{ imageCount }} more":`+ {{ imageCount }}`,"{{ memberCount }} members":`{{ memberCount }} membri`,"{{ typing }} are typing":`{{ typing }} stanno scrivendo`,"{{ typing }} is typing":`{{ typing }} sta scrivendo`,"{{ user }} has been muted":`{{ user }} è stato silenziato`,"{{ user }} has been unmuted":`Notifiche riattivate per {{ user }}`,"{{ user }} is typing...":`{{ user }} sta digitando...`,"{{ users }} and {{ user }} are typing...":`{{ users }} e {{ user }} stanno digitando...`,"{{ users }} and more are typing...":`{{ users }} e altri stanno digitando...`,"{{ watcherCount }} online":`{{ watcherCount }} online`,"{{count}} new messages_one":`{{count}} nuovo messaggio`,"{{count}} new messages_many":`{{count}} nuovi messaggi`,"{{count}} new messages_other":`{{count}} nuovi messaggi`,"{{count}} unread_one":`{{count}} non letto`,"{{count}} unread_many":`{{count}} non letti`,"{{count}} unread_other":`{{count}} non letti`,"{{count}} votes_one":`{{count}} voto`,"{{count}} votes_many":`{{count}} voti`,"{{count}} votes_other":`{{count}} voti`,"+{{ imageCount }}":`+{{ imageCount }}`,"+{{count}} more options_one":`+{{count}} altra opzione`,"+{{count}} more options_many":`+{{count}} altre opzioni`,"+{{count}} more options_other":`+{{count}} altre opzioni`,"🏙 Attachment...":`🏙 Allegato...`,"📊 {{createdBy}} created: {{ pollName}}":`📊 {{createdBy}} ha creato: {{ pollName}}`,"📊 {{votedBy}} voted: {{pollOptionText}}":`📊 {{votedBy}} ha votato: {{pollOptionText}}`,"📍Shared location":`📍Posizione condivisa`,"Add a comment":`Aggiungi un commento`,"Add a comment to your poll answer":`Aggiungi un commento alla tua risposta al sondaggio`,"Add an option":`Aggiungi un'opzione`,"Add reaction":`Aggiungi reazione`,"All results loaded":`Tutti i risultati caricati`,"Allow access to camera":`Consenti l'accesso alla fotocamera`,"Allow access to microphone":`Consenti l'accesso al microfono`,"Allow comments":`Consenti i commenti`,"Allow option suggestion":`Consenti il suggerimento di opzioni`,"Allow others to add comments":`Consenti ad altri di aggiungere commenti`,"Also send as a direct message":`Invia anche come messaggio diretto`,"Also send in channel":`Invia anche nel canale`,"Also sent in channel":`Inviato anche nel canale`,"An error has occurred during recording":`Si è verificato un errore durante la registrazione`,"An error has occurred during the recording processing":`Si è verificato un errore durante l'elaborazione della registrazione`,Anonymous:`Anonimo`,"Anonymous poll":`Sondaggio anonimo`,Archive:`Archiv
500ia`,"Are you sure you want to delete this message?":`Sei sicuro di voler eliminare questo messaggio?`,"aria/Attachment":`Allegato`,"aria/Attachment Actions":`Azioni allegato`,"aria/Audio position {{ elapsed }} of {{ duration }}":`Posizione audio {{ elapsed }} di {{ duration }}`,"aria/Audio position {{ progress }} percent":`Posizione audio {{ progress }} percento`,"aria/Block User":`Blocca utente`,"aria/Bookmark Message":`Salva messaggio`,"aria/Cancel recording":`Annulla registrazione`,"aria/Cancel Reply":`Annulla risposta`,"aria/Cancel upload":`Annulla caricamento`,"aria/Channel Actions":`Azioni canale`,"aria/Channel list":`Elenco dei canali`,"aria/Channel search results":`Risultati della ricerca dei canali`,"aria/Chat view tabs":`Schede visualizzazione chat`,"aria/Clear search":`Cancella ricerca`,"aria/Close callout dialog":`Chiudi finestra informativa`,"aria/Close thread":`Chiudi discussione`,"aria/Collapse sidebar":`Comprimi barra laterale`,"aria/Command Suggestions":`Suggerimenti comandi`,"aria/Complete recording":`Completa registrazione`,"aria/Copy Message Text":`Copia testo messaggio`,"aria/Decrease value":`Diminuisci valore`,"aria/Delete Message":`Elimina messaggio`,"aria/Dismiss notification":`Chiudi notifica`,"aria/Download attachment":`Scarica l'allegato`,"aria/Edit Message":`Modifica messaggio`,"aria/Emoji picker":`Selettore di emoji`,"aria/Emoji Suggestions":`Suggerimenti emoji`,"aria/Exit search":`Esci dalla ricerca`,"aria/Expand sidebar":`Espandi barra laterale`,"aria/File input":`Input di file`,"aria/File upload":`Caricamento di file`,"aria/Flag Message":`Segnala messaggio`,"aria/Image failed to load":`Caricamento immagine non riuscito`,"aria/Image input":`Input di immagine`,"aria/Increase value":`Aumenta valore`,"aria/Jump to latest message":`Vai all'ultimo messaggio`,"aria/Jump to quoted message":`Vai al messaggio citato`,"aria/Load More Channels":`Carica altri canali`,"aria/Mark Message Unread":`Contrassegna come non letto`,"aria/Mark messages as read":`Segna i messaggi come letti`,"aria/Menu":`Menu`,"aria/Message Actions":`Azioni del messaggio`,"aria/Message from {{ user }},":`Messaggio di {{ user }},`,"aria/Message Options":`Opzioni di messaggio`,"aria/Message,":`Messaggio,`,"aria/Mute User":`Mute utente`,"aria/Notifications":`Notifiche`,"aria/Open Attachment Selector":`Apri selettore allegati`,"aria/Open Channel Actions Menu":`Apri menu azioni canale`,"aria/Open Menu":`Apri menu`,"aria/Open Message Actions Menu":`Apri il menu delle azioni di messaggio`,"aria/Open Reaction Selector":`Apri il selettore di reazione`,"aria/Open Thread":`Apri discussione`,"aria/Pause":`Pausa`,"aria/Pause recording":`Metti in pausa registrazione`,"aria/Percent complete":`{{percent}} percento completato`,"aria/Pin Message":`Appunta messaggio`,"aria/Play":`Riproduci`,"aria/Quote Message":`Citazione messaggio`,"aria/Reaction list":`Elenco delle reazioni`,"aria/Remind Me Message":`Ricordami`,"aria/Remind Me Options":`Opzioni promemoria`,"aria/Remove attachment":`Rimuovi allegato`,"aria/Remove location attachment":`Rimuovi allegato posizione`,"aria/Remove option":`Rimuovi opzione`,"aria/Remove Reminder":`Rimuovi promemoria`,"aria/Remove Save For Later":`Rimuovi Salva per dopo`,"aria/Resend Message":`Invia di nuovo messaggio`,"aria/Resume recording":`Riprendi registrazione`,"aria/Retry upload":`Riprova caricamento`,"aria/Review bounced message":`Rivedi il messaggio respinto`,"aria/Search results":`Risultati della ricerca`,"aria/Search results header filter button for: {{ source }}":`Pulsante filtro intestazione risultati di ricerca per: {{ source }}`,"aria/Seek audio position":`Cerca posizione audio`,"aria/Select Channel: {{ channelName }}":`Seleziona canale: {{ channelName }}`,"aria/Select Reaction: {{ reactionName }}":`Seleziona reazione: {{ reactionName }}`,"aria/Select User Channel: {{ name }}":`Seleziona canale utente: {{ name }}`,"aria/Send":`Invia`,"aria/Show preview":`Mostra anteprima`,"aria/Start recording audio":`Avvia registrazione audio`,"aria/Stop AI Generation":`Interrompi generazione IA`,"aria/Suggestions":`Suggerimenti`,"aria/Thread list":`Elenco thread`,"aria/Unblock User":`Sblocca utente`,"aria/Unmute User":`Riattiva il notifiche`,"aria/Unpin Message":`Rimuovi messaggio appuntato`,"aria/User Suggestions":`Suggerimenti utenti`,"Ask a question":`Fai una domanda`,Attach:`Allega`,"Attach files":`Allega file`,Attachment:`Allegato`,"Attachment upload blocked due to {{reason}}":`Caricamento allegato bloccato a causa di {{reason}}`,"Attachment upload failed due to {{reason}}":`Caricamento allegato fallito a causa di {{reason}}`,Back:`Indietro`,"ban-command-args":`[@nomeutente] [testo]`,"ban-command-description":`Vietare un utente`,"Block User":`Blocca utente`,Cancel:`Annulla`,"Cannot seek in the recording":`Impossibile cercare nella registrazione`,"Channel ar
500chived":`Canale archiviato`,"Channel Missing":`Il canale non esiste`,"Channel muted":`Canale silenziato`,"Channel pinned":`Canale fissato`,"Channel unarchived":`Archiviazione del canale annullata`,"Channel unmuted":`Canale non più silenziato`,"Channel unpinned":`Canale rimosso dai fissati`,Channels:`Canali`,Chats:`Chat`,"Choose between 2 to 10 options":`Scegli tra 2 e 10 opzioni`,Close:`Chiudi`,"Close dialog":`Chiudi finestra di dialogo`,"Close emoji picker":`Chiudi il selettore di emoji`,"Close prompt: {{ title }}":`Chiudi prompt: {{ title }}`,"Command not available while editing":`Comando non disponibile durante la modifica`,"Command not available while replying":`Comando non disponibile durante la risposta`,Commands:`Comandi`,"Commands matching":`Comandi corrispondenti`,"Connection failure, reconnecting now...":`Errore di connessione, riconnessione in corso...`,"Copy Message":`Copia messaggio`,Create:`Crea`,"Create a question, add options, and configure poll settings":`Crea una domanda, aggiungi opzioni e configura le impostazioni del sondaggio`,"Create poll":`Crea sondaggio`,"Current location":`Posizione attuale`,Delete:`Elimina`,"Delete for me":`Elimina per me`,"Delete message":`Elimina messaggio`,Delivered:`Consegnato`,"Direct message":`Messaggio diretto`,"Do you want to end this poll now? Nobody will be able to vote in this poll anymore.":`Vuoi terminare questo sondaggio ora? Nessuno potrà più votare in questo sondaggio.`,"Download All":`Scarica tutto`,"Download Attachment":`Scarica allegato`,"Download attachment {{ name }}":`Scarica l'allegato {{ name }}`,"Drag your files here":`Trascina i tuoi file qui`,"Drag your files here to add to your post":`Trascina i tuoi file qui per aggiungerli al tuo post`,"Due {{ timeLeft }}":`Scadenza tra {{ timeLeft }}`,"Due since {{ dueSince }}":`Scaduto dal {{ dueSince }}`,"duration/Message reminder":`{{ milliseconds | durationFormatter(withSuffix: true) }}`,"duration/Remind Me":`{{ milliseconds | durationFormatter(withSuffix: true) }}`,"duration/Share Location":`{{ milliseconds | durationFormatter }}`,"Edit Message":`Modifica messaggio`,"Edit message request failed":`Richiesta di modifica del messaggio non riuscita`,Edited:`Modificato`,"Emoji matching":`Abbinamento emoji`,"Empty message...":`Messaggio vuoto...`,End:`Fine`,"End poll":`Termina sondaggio`,"End this poll?":`Terminare questo sondaggio?`,"End vote":`Termina il voto`,"Enforce unique vote is enabled":`Il voto unico è abilitato`,Error:`Errore`,"Error adding flag":`Errore durante l'aggiunta del flag`,"Error connecting to chat, refresh the page to try again.":`Errore di connessione alla chat, aggiorna la pagina per riprovare.`,"Error deleting message":`Errore durante l'eliminazione del messaggio`,"Error fetching reactions":`Errore nel caricamento delle reazioni`,"Error marking message unread. Cannot mark unread messages older than the newest 100 channel messages.":`Errore durante la marcatura del messaggio come non letto. Impossibile marcare messaggi non letti più vecchi dei più recenti 100 messaggi del canale.`,"Error muting a user ...":`Errore nel silenziare un utente ...`,"Error pinning message":`Errore durante il blocco del messaggio`,"Error removing message pin":`Errore durante la rimozione del PIN del messaggio`,"Error reproducing the recording":`Errore durante la riproduzione della registrazione`,"Error starting recording":`Errore durante l'avvio della registrazione`,"Error unmuting a user ...":`Errore nel riattivare un utente ...`,"Error uploading attachment":`Errore durante il caricamento dell'allegato`,"Error uploading file":`Errore durante il caricamento del file`,"Error uploading image":`Errore durante il caricamento dell'immagine`,"Error: {{ errorMessage }}":`Errore: {{ errorMessage }}`,"Exit command {{ command }}":`Esci dal comando {{ command }}`,"Failed to block user":`Impossibile bloccare l'utente`,"Failed to create the poll":`Impossibile creare il sondaggio`,"Failed to create the poll due to {{reason}}":`Impossibile creare il sondaggio a causa di {{reason}}`,"Failed to delete the message":`Impossibile eliminare il messaggio`,"Failed to end the poll":`Impossibile terminare il sondaggio`,"Failed to end the poll due to {{reason}}":`Impossibile terminare il sondaggio a causa di {{reason}}`,"Failed to jump to the first unread message":`Impossibile passare al primo messaggio non letto`,"Failed to leave channel":`Impossibile lasciare il canale`,"Failed to load channels":`Impossibile caricare i canali`,"Failed to load more channels":`Impossibile caricare altri canali`,"Failed to mark channel as read":`Impossibile contrassegnare il canale come letto`,"Failed to play the recording":`Impossibile riprodurre la registrazione`,"Failed to retrieve location":`Impossibile recuperare la posizione`,"Failed to share location":`Impossibile condividere la posizione`,"Failed to update channel ar
500chive status":`Impossibile aggiornare lo stato di archiviazione del canale`,"Failed to update channel mute status":`Impossibile aggiornare lo stato di silenziamento del canale`,"Failed to update channel pinned status":`Impossibile aggiornare lo stato di blocco del canale`,File:`File`,"File is required for upload attachment":`È richiesto un file per caricare l'allegato`,"File is too large: {{ size }}, maximum upload size is {{ limit }}":`Il file è troppo grande: {{ size }}, la dimensione massima di caricamento è {{ limit }}`,"File too large":`File troppo grande`,fileCount_one:`1 file`,fileCount_many:`{{ count }} file`,fileCount_other:`{{ count }} file`,Flag:`Segnala`,"Generating...":`Generando...`,"giphy-command-args":`[testo]`,"giphy-command-description":`Pubblica un gif casuale sul canale`,"Hide who voted":`Nascondi chi ha votato`,Image:`Immagine`,imageCount_one:`Immagine`,imageCount_many:`{{ count }} immagini`,imageCount_other:`{{ count }} immagini`,"Instant commands":`Comandi istantanei`,"language/af":`Afrikaans`,"language/am":`Amarico`,"language/ar":`Arabo`,"language/az":`Azero`,"language/bg":`Bulgaro`,"language/bn":`Bengalese`,"language/bs":`Bosniaco`,"language/cs":`Ceco`,"language/da":`Danese`,"language/de":`Tedesco`,"language/el":`Greco`,"language/en":`Inglese`,"language/es":`Spagnolo`,"language/es-MX":`Spagnolo (Messico)`,"language/et":`Estone`,"language/fa":`Persiano`,"language/fa-AF":`Dari`,"language/fi":`Finlandese`,"language/fr":`Francese`,"language/fr-CA":`Francese (Canada)`,"language/ha":`Hausa`,"language/he":`Ebraico`,"language/hi":`Hindi`,"language/hr":`Croato`,"language/ht":`Creolo haitiano`,"language/hu":`Ungherese`,"language/id":`Indonesiano`,"language/it":`Italiano`,"language/ja":`Giapponese`,"language/ka":`Georgiano`,"language/ko":`Coreano`,"language/lt":`Lituano`,"language/lv":`Lettone`,"language/ms":`Malese`,"language/nl":`Olandese`,"language/no":`Norvegese`,"language/pl":`Polacco`,"language/ps":`Pashto`,"language/pt":`Portoghese`,"language/ro":`Rumeno`,"language/ru":`Russo`,"language/sk":`Slovacco`,"language/sl":`Sloveno`,"language/so":`Somalo`,"language/sq":`Albanese`,"language/sr":`Serbo`,"language/sv":`Svedese`,"language/sw":`Swahili`,"language/ta":`Tamil`,"language/th":`Thai`,"language/tl":`Tagalog`,"language/tr":`Turco`,"language/uk":`Ucraino`,"language/ur":`Urdu`,"language/vi":`Vietnamita`,"language/zh":`Cinese (semplificato)`,"language/zh-TW":`Cinese (tradizionale)`,"Leave Channel":`Lascia il canale`,"Left channel":`Canale lasciato`,"Let others add options":`Lascia che altri aggiungano opzioni`,"Limit votes per person":`Limita i voti per persona`,Link:`Collegamento`,linkCount_one:`Link`,linkCount_many:`{{ count }} link`,linkCount_other:`{{ count }} link`,live:`live`,"Live for {{duration}}":`Live per {{duration}}`,"Live location":`Posizione live`,"Live until {{ timestamp }}":`Live fino a {{ timestamp }}`,"Load more":`Carica di più`,"Local upload attachment missing local id":`Allegato di caricamento locale senza id locale`,Location:`Posizione`,"Location sharing ended":`Condivisione posizione terminata`,"Location: {{ coordinates }}":`Posizione: {{ coordinates }}`,"Mark as unread":`Contrassegna come non letto`,"Maximum number of votes (from 2 to 10)":`Numero massimo di voti (da 2 a 10)`,"Maximum votes per person":`Voti massimi per persona`,Menu:`Menù`,"Message deleted":`Messaggio cancellato`,"Message failed to send":`Invio del messaggio non riuscito`,"Message has been successfully flagged":`Il messaggio è stato segnalato con successo`,"Message marked as unread":`Messaggio contrassegnato come non letto`,"Message pinned":`Messaggio bloccato`,"Message unpinned":`Messaggio rimosso dai fissati`,"Message was blocked by moderation policies":`Il messaggio è stato bloccato dalle politiche di moderazione`,"Messages have been marked unread.":`I messaggi sono stati contrassegnati come non letti.`,"Missing permissions to upload the attachment":`Autorizzazioni mancanti per caricare l'allegato`,"Multiple votes":`Voti multipli`,Mute:`Silenzia`,"mute-command-args":`[@nomeutente]`,"mute-command-description":`Silenzia un utente`,"network error":`errore di rete`,New:`Nuovo`,"New message from {{user}}":`Nuovo messaggio da {{user}}`,"New Messages!":`Nuovi messaggi!`,"Next image":`Immagine successiva`,"No chats here yet…":`Non ci sono ancora messaggi qui...`,"No conversations yet":`Ancora nessuna conversazione`,"No items exist":`Nessun elemento presente`,"No results found":`Nessun risultato trovato`,"Nobody will be able to vote in this poll anymore.":`Nessuno potrà più votare in questo sondaggio.`,"Nothing yet...":`Ancora niente...`,Offline:`Offline`,Ok:`OK`,Online:`Online`,"Only numbers are allowed":`Sono consentiti solo numeri`,"Only visible to you":`Visibile solo per te`,"Open emoji picker":`Apri il selettore di emoji`,"Open gallery at image {{ index }}":`Apri la galleria all'immagine {{ index }}`,"Open image in gallery":`Apri immagine nella galleria`,"Open location in a map":`Apri posizione in una mappa`,"Option already exists":`L'opzione esiste già`,"Option is empty":`L'opzione è vuota`,Options:`Opzioni`,Original:`Originale`,"People matching":`Persone che corrispondono`,Photo:`Foto`,Pin:`Appunta`,"Pinned by {{ name }}":`Appuntato da {{ name }}`,"Pinned by You":`Fissato da te`,"placeholder/PollComment":`Il tuo commento`,"placeholder/PollOptionSuggestion":`Inserisci una nuova opzione`,"Play video":`Riproduci video`,"Playback speed {{ rate }}x":`Velocità di riproduzione {{ rate }}x`,Poll:`Sondaggio`,"Poll comments":`Commenti del sondaggio`,"Poll ended":`Sondaggio terminato`,"Poll options":`Opzioni del sondaggio`,"Poll results":`Risultati del sondaggio`,"Previous image":`Immagine precedente`,Question:`Domanda`,"Question {{ optionOrderNumber}}":`Domanda {{ optionOrderNumber}}`,"Question is required":`La domanda è obbligatoria`,"Quote Reply":`Rispondi con citazione`,"Reached the vote limit. Remove an existing vote first.":`Raggiunto il limite di voti. Rimuovi prima un voto esistente.`,"Recording format is not supported and cannot be reproduced":`Il formato di registrazione non è supportato e non può essere riprodotto`,"Remind me":`Promemoria`,"Remind Me":`Ricordami`,"Reminder set":`Promemoria impostato`,"Remove reminder":`Rimuovi promemoria`,"Remove save for later":`Rimuovi Salva per dopo`,"Replied to a thread":`Ha risposto in un thread`,Reply:`Rispondi`,"Reply to {{ authorName }}":`Rispondi a {{ authorName }}`,"Reply to a message to start a thread":`Rispondi a un messaggio per avviare un thread`,"Reply to Message":`Rispondi al messaggio`,replyCount_one:`Una risposta`,replyCount_many:`{{ count }} risposte`,replyCount_other:`{{ count }} risposte`,Resend:`Invia di nuovo`,"Retry upload":`Riprova caricamento`,"Review all options available in this poll":`Rivedi tutte le opzioni disponibili in questo sondaggio`,"Review comments submitted with poll answers":`Rivedi i commenti inviati con le risposte al sondaggio`,"Review poll results and open an option to see detailed votes":`Rivedi i risultati del sondaggio e apri un'opzione per vedere i voti dettagliati`,"Review this message and choose whether to delete it, edit it, or send it anyway":`Rivedi questo messaggio e scegli se eliminarlo, modificarlo o inviarlo comunque`,"Review who voted for this option":`Rivedi chi ha votato per questa opzione`,"S
500ave for later":`Salva per dopo`,"Saved for later":`Salvato per dopo`,Search:`Cerca`,"Search GIFs":`Cerca GIF`,"search-results-header-filter-source-button-label--channels":`canali`,"search-results-header-filter-source-button-label--messages":`messaggi`,"search-results-header-filter-source-button-label--users":`utenti`,"Searching for {{ searchSourceType }}...":`Ricerca di {{ searchSourceType }}...`,"Searching...":`Ricerca in corso...`,searchResultsCount_one:`1 risultato`,searchResultsCount_many:`{{ count }} risultati`,searchResultsCount_other:`{{ count }} risultati`,"Select a thread to continue the conversation":`Seleziona un thread per continuare la conversazione`,"Select more than one option":`Seleziona più di un'opzione`,"Select one":`Seleziona uno`,"Select one or more":`Seleziona uno o più`,"Select up to {{count}}_one":`Seleziona fino a {{count}}`,"Select up to {{count}}_many":`Seleziona fino a {{count}}`,"Select up to {{count}}_other":`Seleziona fino a {{count}}`,"Select your current location and optionally enable live location sharing":`Seleziona la tua posizione attuale e abilita facoltativamente la condivisione della posizione in tempo reale`,Send:`Invia`,"Send a message":`Invia un messaggio`,"Send a message to start the conversation":`Invia un messaggio per iniziare la conversazione`,"Send Anyway":`Invia comunque`,"Send message request failed":`Richiesta di invio messaggio non riuscita`,"Send poll":`Invia sondaggio`,"Sending...":`Invio in corso...`,Sent:`Inviato`,Share:`Condividi`,"Share live location for":`Condividi posizione live per`,"Share Location":`Condividi posizione`,"Shared live location":`Posizione live condivisa`,"Shared location":`Posizione condivisa`,Shuffle:`Mescolare`,"size limit":`limite di dimensione`,"Slow Mode ON":`Modalità lenta attivata`,"Slow mode, wait {{ seconds }}s...":`Modalità lenta, attendi {{ seconds }} s...`,"Some of the files will not be accepted":`Alcuni dei file non saranno accettati`,"Start typing to search":`Inizia a digitare per cercare`,"Stop sharing":`Ferma condivisione`,Submit:`Invia`,"Suggest a new option to add to this poll":`Suggerisci una nuova opzione da aggiungere a questo sondaggio`,"Suggest an option":`Suggerisci un'opzione`,"Tap to remove":`Tocca per rimuovere`,"Tap to remove: {{ reactionName }}":`Tocca per rimuovere: {{ reactionName }}`,"Thinking...":`Pensando...`,"this content could not be displayed":`questo contenuto non può essere mostrato`,"This field cannot be empty or contain only spaces":`Questo campo non può essere vuoto o contenere solo spazi`,"This message did not meet our content guidelines":`Questo messaggio non soddisfa le nostre linee guida sui contenuti`,Thread:`Discussione`,"Thread has not been found":`Discussione non trovata`,"Thread reply":`Risposta nella discussione`,"Thread Reply":`Risposta nella discussione`,"ThreadListUnseenThreadsBanner/loading":`Caricamento...`,"ThreadListUnseenThreadsBanner/unreadThreads_one":`{{ count }} thread non letto`,"ThreadListUnseenThreadsBanner/unreadThreads_many":`{{ count }} thread non letti`,"ThreadListUnseenThreadsBanner/unreadThreads_other":`{{ count }} thread non letti`,Threads:`Thread`,"timestamp/ChannelPreviewTimestamp":`{{ timestamp | timestampFormatter(calendar: true; calendarFormats: { "sameDay": "LT", "lastDay": "[Ieri]", "lastWeek": "dddd", "sameElse": "L" }) }}`,"timestamp/DateSeparator":`{{ timestamp | timestampFormatter(calendar: true; calendarFormats: { "sameDay": "[Oggi]", "nextDay": "[Domani]", "lastDay": "[Ieri]", "nextWeek": "dddd", "lastWeek": "[Scorsa] dddd", "sameElse": "ddd, D MMM" }) }}`,"timestamp/LiveLocation":`{{ timestamp | timestampFormatter(calendar: true) }}`,"timestamp/MessageTimestamp":`{{ timestamp | timestampFormatter(calendar: false; format: HH:mm) }}`,"timestamp/PollVote":`{{ timestamp | timestampFormatter(relativeCompact: true) }}`,"timestamp/PollVoteTooltip":`{{ timestamp | timestampFormatter(calendar: true) }}`,"timestamp/relativeDaysAgo":`{{ count }}d ago`,"timestamp/relativeToday":`Oggi`,"timestamp/relativeWeeksAgo":`{{ count }}w ago`,"timestamp/relativeYesterday":`Ieri`,"timestamp/ReminderNotification":`{{ timestamp | timestampFormatter(calendar: true; calendarFormats: { "sameDay": "[Today] [at] HH:mm", "nextDay": "[Tomorrow] [at] HH:mm", "lastDay": "[Yesterday] [at] HH:mm", "nextWeek": "dddd [at] HH:mm", "lastWeek": "[Last] dddd [at] HH:mm", "sameElse": "ddd, D MMM [at] HH:mm" }) }}`,"timestamp/SystemMessage":`{{ timestamp | timestampFormatter(format: dddd L) }}`,"To start recording, allow the camera access in your browser":`Per iniziare a registrare, consenti l'accesso alla fotocamera nel tuo browser`,"To start recording, allow the microphone access in your browser":`Per iniziare a registrare, consenti l'accesso al microfono nel tuo browser`,totalVoteCount_one:`1 voto in totale`,totalVoteCount_many:`{{ count }} voti in totale`,totalVoteCount_other:`{{ count }} voti in totale`,Translated:`Tradotto`,"Translated from {{ language }}":`Tradotto da {{ language }}`,"translationBuilderTopic/notification":`{{value, notification}}`,"Type a number from 2 to 10":`Digita un numero da 2 a 10`,Unarchive:`Ripristina`,"unban-command-args":`[@nomeutente]`,"unban-command-description":`Togliere il divieto a un utente`,"Unblock User":`Sblocca utente`,"unknown error":`errore sconosciuto`,Unmute:`Riattiva il notifiche`,"unmute-command-args":`[@nomeutente]`,"unmute-command-description":`Togliere il silenzio a un utente`,Unpin:`Sblocca`,"Unread messages":`Messaggi non letti`,"Unsupported attachment":`Allegato non supportato`,"unsupported file type":`tipo di file non supportato`,Update:`Aggiorna`,"Update the comment attached to your poll answer":`Aggiorna il commento allegato alla tua risposta al sondaggio`,"Update your comment":`Aggiorna il tuo commento`,"Upload blocked":`Caricamento bloccato`,"Upload error":`Errore di caricamento`,"Upload failed":`Caricamento non riuscito`,'Upload type: "{{ type }}" is not allowed':`Tipo di caricamento: "{{ type }}" non è consentito`,"User blocked":`Utente bloccato`,"User unblocked":`Utente sbloccato`,"User uploaded content":`Contenuto caricato dall'utente`,Video:`Video`,videoCount_one:`Video`,videoCount_many:`{{ count }} video`,videoCount_other:`{{ count }}
500 video`,View:`Visualizza`,"View {{count}} comments_one":`Visualizza {{count}} commento`,"View {{count}} comments_many":`Visualizza {{count}} commenti`,"View {{count}} comments_other":`Visualizza {{count}} commenti`,"View all":`Visualizza tutto`,"View original":`Visualizza originale`,"View results":`Vedi risultati`,"View translation":`Visualizza traduzione`,"Voice message":`Messaggio vocale`,"Voice message {{ duration }}":`Messaggio vocale {{ duration }}`,"Voice message deleted":`Messaggio vocale eliminato`,voiceMessageCount_one:`Messaggio vocale`,voiceMessageCount_many:`{{ count }} messaggi vocali`,voiceMessageCount_other:`{{ count }} messaggi vocali`,"Vote ended":`Voto terminato`,Votes:`Voti`,"Wait until all attachments have uploaded":`Attendi il caricamento di tutti gli allegati`,"Waiting for network…":`In attesa della rete…`,You:`Tu`,"You've reached the maximum number of files":`Hai raggiunto il numero massimo di file`},jhe={"{{ commaSeparatedUsers }} and {{ moreCount }} more":`{{ commaSeparatedUsers }} と {{ moreCount }} 他人`,"{{ commaSeparatedUsers }}, and {{ lastUser }}":`{{ commaSeparatedUsers }} と {{ lastUser }}`,"{{ count }} files_one":`{{ count }} ファイル`,"{{ count }} files_other":`{{ count }} ファイル`,"{{ count }} people are typing_one":`{{ count }}人が入力中です`,"{{ count }} people are typing_many":`{{ count }}人が入力中です`,"{{ count }} people are typing_other":`{{ count }}人が入力中です`,"{{ count }} photos_one":`{{ count }} 写真`,"{{ count }} photos_other":`{{ count }} 写真`,"{{ count }} reactions_other":`{{ count }}件のリアクション`,"{{ count }} videos_one":`{{ count }} 動画`,"{{ count }} videos_other":`{{ count }} 動画`,"{{ firstUser }} and {{ secondUser }}":`{{ firstUser }} と {{ secondUser }}`,"{{ imageCount }} more":`{{ imageCount }} イメージ`,"{{ memberCount }} members":`{{ memberCount }} メンバー`,"{{ typing }} are typing":`{{ typing }}が入力中です`,"{{ typing }} is typing":`{{ typing }}が入力中です`,"{{ user }} has been muted":`{{ user }} 無音されています`,"{{ user }} has been unmuted":`{{ user }} 無音されていません`,"{{ user }} is typing...":`{{ user }} が入力中...`,"{{ users }} and {{ user }} are typing...":`{{ users }} と {{ user }} が入力中...`,"{{ users }} and more are typing...":`{{ users }} とその他が入力中...`,"{{ watcherCount }} online":`{{ watcherCount }} オンライン`,"{{count}} new messages_one":`{{count}}件の新しいメッセージ`,"{{count}} new messages_other":`{{count}}件の新しいメッセージ`,"{{count}} unread_one":`{{count}} 未読`,"{{count}} unread_other":`{{count}} 未読`,"{{count}} votes_one":`{{count}} 票`,"{{count}} votes_other":`{{count}} 票`,"+{{ imageCount }}":`+{{ imageCount }}`,"+{{count}} more options_one":`あと{{count}}件のオプション`,"+{{count}} more options_other":`あと{{count}}件のオプション`,"🏙 Attachment...":`🏙 アタッチメント...`,"📊 {{createdBy}} created: {{ pollName}}":`📊 {{createdBy}} が作成: {{ pollName}}`,"📊 {{votedBy}} voted: {{pollOptionText}}":`📊 {{votedBy}} が投票: {{pollOptionText}}`,"📍Shared location":`📍共有された位置情報`,"Add a comment":`コメントを追加`,"Add a comment to your poll answer":`投票回答にコメントを追加`,"Add an option":`オプションを追加`,"Add reaction":`リアクションを追加`,"All results loaded":`すべての結果が読み込まれました`,"Allow access to camera":`カメラへのアクセスを許可する`,"Allow access to microphone":`マイクロフォンへのアクセスを許可する`,"Allow comments":`コメントを許可`,"Allow option suggestion":`オプションの提案を許可`,"Allow others to add comments":`他の人にコメントを追加することを許可する`,"Also send as a direct message":`ダイレクトメッセージとしても送信`,"Also send in channel":`チャンネルにも送信`,"Also sent in channel":`チャンネルにも送信済み`,"An error has occurred during recording":`録音中にエラーが発生しました`,"An error has occurred during the recording processing":`録音処理中にエラーが発生しました`,Anonymous:`匿名`,"Anonymous poll":`匿名投票`,Archive:`アーカイブ`,"Are you sure you want to delete this message?":`このメッセージを削除してもよろしいですか?`,"aria/Attachment":`添付ファイル`,"aria/Attachment Actions":`添付ファイルの操作`,"aria/Audio position {{ elapsed }} of {{ duration }}":`音声位置 {{ elapsed }} / {{ duration }}`,"aria/Audio position {{ progress }} percent":`音声位置 {{ progress }} パーセント`,"aria/Block User":`ユーザーをブロック`,"aria/Bookmark Message":`メッセージをブックマーク`,"aria/Cancel recording":`録音をキャンセル`,"aria/Cancel Reply":`返信をキャンセル`,"aria/Cancel upload":`アップロードをキャンセル`,"aria/Channel Actions":`チャンネル操作`,"aria/Channel list":`チャンネル一覧`,"aria/Channel search results":`チャンネル検索結果`,"aria/Chat view tabs":`チャットビューのタブ`,"aria/Clear search":`検索をクリア`,"aria/Close callout dialog":`吹き出しダイアログを閉じる`,"aria/Close thread":`スレッドを閉じる`,"aria/Collapse sidebar":`サイドバーを折りたたむ`,"aria/Command Suggestions":`コマンド候補`,"aria/Complete recording":`録音を完了`,"aria/Copy Message Text":`メッセージテキストをコピー`,"aria/Decrease value":`値を減らす`,"aria/Delete Message":`メッセージを削除`,"aria/Dismiss notification":`通知を閉じる`,"aria/Download attachment":`添付ファイルをダウンロード`,"aria/Edit Message":`メッセージを編集`,"aria/Emoji picker":`絵文字ピッカー`,"aria/Emoji Suggestions":`絵文字候補`,"aria/Exit search":`検索を終了`,"aria/Expand sidebar":`サイドバーを展開`,"aria/File input":`ファイル入力`,"aria/File upload":`ファイルアップロード`,"aria/Flag Message":`メッセージをフラグ`,"aria/Image failed to load":`画像の読み込みに失敗しました`,"aria/Image input":`画像入力`,"aria/Increase value":`値を増やす`,"aria/Jump to latest message":`最新のメッセージに移動`,"aria/Jump to quoted message":`引用されたメッセージに移動`,"aria/Load More Channels":`さらにチャンネルを読み込む`,"aria/Mark Message Unread":`未読としてマーク`,"aria/Mark messages as read":`メッセージを既読にする`,"aria/Menu":`メニュー`,"aria/Message Actions":`メッセージ操作`,"aria/Message from {{ user }},":`{{ user }}さんからのメッセージ,`,"aria/Message Options":`メッセージオプション`,"aria/Message,"
500:`メッセージ,`,"aria/Mute User":`ユーザーをミュート`,"aria/Notifications":`通知`,"aria/Open Attachment Selector":`添付ファイル選択を開く`,"aria/Open Channel Actions Menu":`チャンネルアクションメニューを開く`,"aria/Open Menu":`メニューを開く`,"aria/Open Message Actions Menu":`メッセージアクションメニューを開く`,"aria/Open Reaction Selector":`リアクションセレクターを開く`,"aria/Open Thread":`スレッドを開く`,"aria/Pause":`一時停止`,"aria/Pause recording":`録音を一時停止`,"aria/Percent complete":`{{percent}}パーセント完了`,"aria/Pin Message":`メッセージをピン`,"aria/Play":`再生`,"aria/Quote Message":`メッセージを引用`,"aria/Reaction list":`リアクション一覧`,"aria/Remind Me Message":`リマインダー`,"aria/Remind Me Options":`リマインダーオプション`,"aria/Remove attachment":`添付ファイルを削除`,"aria/Remove location attachment":`位置情報の添付ファイルを削除`,"aria/Remove option":`オプションを削除`,"aria/Remove Reminder":`リマインダーを削除`,"aria/Remove Save For Later":`「後で見る」を削除`,"aria/Resend Message":`メッセージを再送信`,"aria/Resume recording":`録音を再開`,"aria/Retry upload":`アップロードを再試行`,"aria/Review bounced message":`バウンスされたメッセージを確認`,"aria/Search results":`検索結果`,"aria/Search results header filter button for: {{ source }}":`{{ source }} の検索結果ヘッダーのフィルターボタン`,"aria/Seek audio position":`音声位置をシーク`,"aria/Select Channel: {{ channelName }}":`チャンネルを選択: {{ channelName }}`,"aria/Select Reaction: {{ reactionName }}":`リアクションを選択: {{ reactionName }}`,"aria/Select User Channel: {{ name }}":`ユーザーチャンネルを選択: {{ name }}`,"aria/Send":`送信`,"aria/Show preview":`プレビューを表示`,"aria/Start recording audio":`音声録音を開始`,"aria/Stop AI Generation":`AI生成を停止`,"aria/Suggestions":`候補`,"aria/Thread list":`スレッド一覧`,"aria/Unblock User":`ユーザーのブロックを解除`,"aria/Unmute User":`無音を解除する`,"aria/Unpin Message":`ピンを解除`,"aria/User Suggestions":`ユーザー候補`,"Ask a question":`質問する`,Attach:`添付`,"Attach files":`ファイルを添付する`,Attachment:`添付ファイル`,"Attachment upload blocked due to {{reason}}":`{{reason}}のため添付ファイルのアップロードがブロックされました`,"Attachment upload failed due to {{reason}}":`{{reason}}のため添付ファイルのアップロードに失敗しました`,Back:`戻る`,"ban-command-args":`[@ユーザ名] [テキスト]`,"ban-command-description":`ユーザーを禁止する`,"Block User":`ユーザーをブロック`,Cancel:`キャンセル`,"Cannot seek in the recording":`録音中にシークできません`,"Channel archived":`チャンネルをアーカイブしました`,"Channel Missing":`チャネルがありません`,"Channel muted":`チャンネルをミュートしました`,"Channel pinned":`チャンネルをピン留めしました`,"Channel unarchived":`チャンネルのアーカイブを解除しました`,"Channel unmuted":`チャンネルのミュートを解除しました`,"Channel unpinned":`チャンネルのピン留めを解除しました`,Channels:`チャンネル`,Chats:`チャット`,"Choose between 2 to 10 options":`2〜10の選択肢から選ぶ`,Close:`閉める`,"Close dialog":`ダイアログを閉じる`,"Close emoji picker":`絵文字ピッカーを閉める`,"Close prompt: {{ title }}":`プロンプトを閉じる: {{ title }}`,"Command not available while editing":`編集中はコマンドを使用できません`,"Command not available while replying":`返信中はコマンドを使用できません`,Commands:`コマンド`,"Commands matching":`一致するコマンド`,"Connection failure, reconnecting now...":`接続が失敗しました。再接続中...`,"Copy Message":`メッセージをコピー`,Create:`作成`,"Create a question, add options, and configure poll settings":`質問を作成し、選択肢を追加して投票設定を構成`,"Create poll":`投票を作成`,"Current location":`現在の位置`,Delete:`消去`,"Delete for me":`自分用に削除`,"Delete message":`メッセージを削除`,Delivered:`配信しました`,"Direct message":`ダイレクトメッセージ`,"Do you want to end this poll now? Nobody will be able to vote in this poll anymore.":`このアンケートを今終了しますか?終了すると、誰も投票できなくなります。`,"Download All":`すべてダウンロード`,"Download Attachment":`添付ファイルをダウンロード`,"Download attachment {{ name }}":`添付ファイル {{ name }} をダウンロード`,"Drag your files here":`ここにファイルをドラッグ`,"Drag your files here to add to your post":`投稿に追加するためにここにファイルをドラッグ`,"Due {{ timeLeft }}":`{{ timeLeft }}に期限切れ`,"Due since {{ dueSince }}":`{{ dueSince }}から期限切れ`,"duration/Message reminder":`{{ milliseconds | durationFormatter(withSuffix: true) }}`,"duration/Remind Me":`{{ milliseconds | durationFormatter(withSuffix: true) }}`,"duration/Share Location":`{{ milliseconds | durationFormatter }}`,"Edit Message":`メッセージを編集`,"Edit message request failed":`メッセージの編集要求が失敗しました`,Edited:`編集済み`,"
500Emoji matching":`絵文字マッチング`,"Empty message...":`空のメッセージ...`,End:`終了`,"End poll":`アンケートを終了`,"End this poll?":`このアンケートを終了しますか?`,"End vote":`投票を終了`,"Enforce unique vote is enabled":`一意の投票が有効になっています`,Error:`エラー`,"Error adding flag":`フラグを追加のエラーが発生しました`,"Error connecting to chat, refresh the page to try again.":`チャットへの接続ができませんでした。ページを更新してください。`,"Error deleting message":`メッセージを削除するエラーが発生しました`,"Error fetching reactions":`反応の読み込みエラー`,"Error marking message unread. Cannot mark unread messages older than the newest 100 channel messages.":`メッセージを未読にする際にエラーが発生しました。最新の100件のチャンネルメッセージより古い未読メッセージはマークできません。`,"Error muting a user ...":`ユーザーを無音するエラーが発生しました...`,"Error pinning message":`メッセージをピンのエラーが発生しました`,"Error removing message pin":`メッセージのピンを削除のエラーが発生しました`,"Error reproducing the recording":`録音の再生中にエラーが発生しました`,"Error starting recording":`録音の開始時にエラーが発生しました`,"Error unmuting a user ...":`ユーザーの無音解除のエラーが発生しました...`,"Error uploading attachment":`添付ファイルのアップロード中にエラーが発生しました`,"Error uploading file":`ファイルをアップロードのエラーが発生しました`,"Error uploading image":`画像をアップロードのエラーが発生しました`,"Error: {{ errorMessage }}":`エラー: {{ errorMessage }}`,"Exit command {{ command }}":`コマンドを終了 {{ command }}`,"Failed to block user":`ユーザーのブロックに失敗しました`,"Failed to create the poll":`投票の作成に失敗しました`,"Failed to create the poll due to {{reason}}":`{{reason}} のため投票の作成に失敗しました`,"Failed to delete the message":`メッセージの削除に失敗しました`,"Failed to end the poll":`アンケートの終了に失敗しました`,"Failed to end the poll due to {{reason}}":`{{reason}}のためアンケートの終了に失敗しました`,"Failed to jump to the first unread message":`最初の未読メッセージにジャンプできませんでした`,"Failed to leave channel":`チャンネルの退出に失敗しました`,"Failed to load channels":`チャンネルの読み込みに失敗しました`,"Failed to load more channels":`さらにチャンネルを読み込めませんでした`,"Failed to mark channel as read":`チャンネルを既読にすることができませんでした`,"Failed to play the recording":`録音の再生に失敗しました`,"Failed to retrieve location":`位置情報の取得に失敗しました`,"Failed to share location":`位置情報の共有に失敗しました`,"Failed to update channel archive status":`チャンネルのアーカイブ状態の更新に失敗しました`,"Failed to update channel mute status":`チャンネルのミュート状態の更新に失敗しました`,"Failed to update channel pinned status":`チャンネルのピン状態の更新に失敗しました`,File:`ファイル`,"File is required for upload attachment":`添付ファイルのアップロードにはファイルが必要です`,"File is too large: {{ size }}, maximum upload size is {{ limit }}":`ファイルが大きすぎます:{{ size }}、最大アップロードサイズは{{ limit }}です`,"File too large":`ファイルが大きすぎます`,fileCount_other:`{{ count }}件のファイル`,Flag:`フラグ`,"Generating...":`生成中...`,"giphy-command-args":`[テキスト]`,"giphy-command-description":`チャンネルにランダムなGIFを投稿する`,"Hide who voted":`誰が投票したかを非表示にする`,Image:`画像`,imageCount_other:`{{ count }}件の画像`,"Instant commands":`インスタントコマンド`,"language/af":`アフリカース語`,"language/am":`アムハラ語`,"language/ar":`アラビア語`,"language/az":`アゼルバイジャン語`,"language/bg":`ブルガリア語`,"language/bn":`ベンガル語`,"language/bs":`ボスニア語`,"language/cs":`チェコ語`,"language/da":`デンマーク語`,"language/de":`ドイツ語`,"language/el":`ギリシャ語`,"language/en":`英語`,"language/es":`スペイン語`,"language/es-MX":`スペイン語(メキシコ)`,"language/et":`エストニア語`,"language/fa":`ペルシア語`,"language/fa-AF":`ダリー語`,"language/fi":`フィンランド語`,"language/fr":`フランス語`,"language/fr-CA":`フランス語(カナダ)`,"language/ha":`ハウサ語`,"language/he":`ヘブライ語`,"language/hi":`ヒンディー語`,"language/hr":`クロアチア語`,"language/ht":`ハイチ・クレオール語`,"language/hu":`ハンガリー語`,"language/id":`ã
500‚¤ãƒ³ãƒ‰ãƒã‚·ã‚¢èªž`,"language/it":`イタリア語`,"language/ja":`日本語`,"language/ka":`グルジア語`,"language/ko":`韓国語`,"language/lt":`リトアニア語`,"language/lv":`ラトビア語`,"language/ms":`マレー語`,"language/nl":`オランダ語`,"language/no":`ノルウェー語`,"language/pl":`ポーランド語`,"language/ps":`パシュトー語`,"language/pt":`ポルトガル語`,"language/ro":`ルーマニア語`,"language/ru":`ロシア語`,"language/sk":`スロバキア語`,"language/sl":`スロベニア語`,"language/so":`ソマリ語`,"language/sq":`アルバニア語`,"language/sr":`セルビア語`,"language/sv":`スウェーデン語`,"language/sw":`スワヒリ語`,"language/ta":`タミル語`,"language/th":`タイ語`,"language/tl":`タガログ語`,"language/tr":`トルコ語`,"language/uk":`ウクライナ語`,"language/ur":`ウルドゥー語`,"language/vi":`ベトナム語`,"language/zh":`中国語(簡体字)`,"language/zh-TW":`中国語(繁体字)`,"Leave Channel":`チャンネルを退出`,"Left channel":`チャンネルを退出しました`,"Let others add options":`他の人が選択肢を追加できるようにする`,"Limit votes per person":`1人あたりの投票数を制限する`,Link:`リンク`,linkCount_other:`{{ count }}件のリンク`,live:`ライブ`,"Live for {{duration}}":`{{duration}}間ライブ`,"Live location":`ライブ位置情報`,"Live until {{ timestamp }}":`{{ timestamp }}までライブ`,"Load more":`もっと読み込む`,"Local upload attachment missing local id":`ローカルアップロード添付にローカルIDがありません`,Location:`位置情報`,"Location sharing ended":`位置情報の共有が終了しました`,"Location: {{ coordinates }}":`位置: {{ coordinates }}`,"Mark as unread":`未読としてマーク`,"Maximum number of votes (from 2 to 10)":`最大投票数(2から10まで)`,"Maximum votes per person":`1人あたりの最大投票数`,Menu:`メニュー`,"Message deleted":`メッセージが削除されました`,"Message failed to send":`メッセージの送信に失敗しました`,"Message has been successfully flagged":`メッセージに正常にフラグが付けられました`,"Message marked as unread":`メッセージを未読にしました`,"Message pinned":`メッセージにピンが付けられました`,"Message unpinned":`メッセージのピン留めを解除しました`,"Message was blocked by moderation policies":`メッセージはモデレーションポリシーによってブロックされました`,"Messages have been marked unread.":`メッセージは未読としてマークされました。`,"Missing permissions to upload the attachment":`添付ファイルをアップロードするための許可がありません`,"Multiple votes":`複数投票`,Mute:`無音`,"mute-command-args":`[@ユーザ名]`,"mute-command-description":`ユーザーをミュートする`,"network error":`ネットワークエラー`,New:`新しい`,"New message from {{user}}":`{{user}}からの新しいメッセージ`,"New Messages!":`新しいメッセージ!`,"Next image":`次の画像`,"No chats here yet…":`ここにはまだチャットはありません…`,"No conversations yet":`まだ会話はありません`,"No items exist":`項目がありません`,"No results found":`結果が見つかりません`,"Nobody will be able to vote in this poll anymore.":`この投票では、誰も投票できなくなります。`,"Nothing yet...":`まだ何もありません...`,Offline:`オフライン`,Ok:`OK`,Online:`オンライン`,"Only numbers are allowed":`数字のみ許可されています`,"Only visible to you":`あなただけに表示`,"Open emoji picker":`絵文字ピッカーを開く`,"Open gallery at image {{ index }}":`画像 {{ index }} でギャラリーを開く`,"Open image in gallery":`画像をギャラリーで開く`,"Open location in a map":`地図で位置情報を開く`,"Option already exists":`オプションは既に存在します`,"Option is empty":`オプションが空です`,Options:`オプション`,Original:`原文`,"People matching":`一致する人`,Photo:`写真`,Pin:`ピン`,"Pinned by {{ name }}":`{{ name }}がピンしました`,"Pinned by You":`あなたがピン留めしました`,"placeholder/PollComment":`コメント`,"placeholder/PollOptionSuggestion":`新しい選択肢を入力`,"Play video":`動画を再生`,"Playback speed {{ rate }}x":`再生速度 {{ rate }}x`,Poll:`投票`,"Poll comments":`投票コメント`,"Poll ended":`アンケート終了`,"Poll options":`投票ã‚
500ªãƒ—ション`,"Poll results":`投票結果`,"Previous image":`前の画像`,Question:`質問`,"Question {{ optionOrderNumber}}":`質問 {{ optionOrderNumber}}`,"Question is required":`質問は必須です`,"Quote Reply":`引用返信`,"Reached the vote limit. Remove an existing vote first.":`投票制限に達しました。既存の投票を先に削除してください。`,"Recording format is not supported and cannot be reproduced":`録音形式はサポートされておらず、再生できません`,"Remind me":`リマインド`,"Remind Me":`リマインダー`,"Reminder set":`リマインダーを設定しました`,"Remove reminder":`リマインダーを削除`,"Remove save for later":`「後で見る」を削除`,"Replied to a thread":`スレッドに返信しました`,Reply:`返事`,"Reply to {{ authorName }}":`{{ authorName }} に返信`,"Reply to a message to start a thread":`メッセージに返信してスレッドを開始してください`,"Reply to Message":`メッセージに返信`,replyCount_one:`1件の返信`,replyCount_other:`{{ count }} 返信`,Resend:`再送信`,"Retry upload":`アップロードを再試行`,"Review all options available in this poll":`この投票で利用可能なすべての選択肢を確認`,"Review comments submitted with poll answers":`投票回答とともに送信されたコメントを確認`,"Review poll results and open an option to see detailed votes":`投票結果を確認し、選択肢を開いて詳細な投票を表示`,"Review this message and choose whether to delete it, edit it, or send it anyway":`このメッセージを確認し、削除・編集・そのまま送信するかを選択`,"Review who voted for this option":`この選択肢に投票した人を確認`,"Save for later":`後で保存`,"Saved for later":`後で保存済み`,Search:`探す`,"Search GIFs":`GIFを検索`,"search-results-header-filter-source-button-label--channels":`チャンネル`,"search-results-header-filter-source-button-label--messages":`メッセージ`,"search-results-header-filter-source-button-label--users":`ユーザー`,"Searching for {{ searchSourceType }}...":`{{ searchSourceType }}を検索中...`,"Searching...":`検索中...`,searchResultsCount_one:`1件の結果`,searchResultsCount_other:`{{ count }}件の結果`,"Select a thread to continue the conversation":`会話を続けるにはスレッドを選択してください`,"Select more than one option":`複数の選択肢を選ぶ`,"Select one":`1つ選択`,"Select one or more":`1つ以上選択`,"Select up to {{count}}_one":`最大{{count}}まで選択`,"Select up to {{count}}_other":`最大{{count}}まで選択`,"Select your current location and optionally enable live location sharing":`現在地を選択し、必要に応じてライブ位置情報共有を有効化`,Send:`送信`,"Send a message":`メッセージを送る`,"Send a message to start the conversation":`メッセージを送って会話を始めましょう`,"Send Anyway":`とにかく送信する`,"Send message request failed":`メッセージ送信リクエストが失敗しました`,"Send poll":`アンケートを送信`,"Sending...":`送信中...`,Sent:`送信済み`,Share:`共有`,"Share live location for":`ライブ位置情報を共有`,"Share Location":`位置情報を共有`,"Shared live location":`共有されたライブ位置情報`,"Shared location":`共有された位置情報`,Shuffle:`シャッフル`,"size limit":`サイズ制限`,"Slow Mode ON":`スローモードオン`,"Slow mode, wait {{ seconds }}s...":`スローモード、{{ seconds }}秒お待ちください...`,"Some of the files will not be accepted":`一部のファイルは受け付けられません`,"Start typing to search":`検索するには入力を開始してください`,"Stop sharing":`共有を停止`,Submit:`送信`,"Suggest a new option to add to this poll":`この投票に追加する新しい選択肢を提案`,"Suggest an option":`オプションを提案`,"Tap to remove":`タップして削除`,"Tap to remove: {{ reactionName }}":`タップして削除: {{ reactionName }}`,"Thinking...":`考え中...`,"this content could not be displayed":`このコンテンツは表示できませんでした`,"This field cannot be empty or contain only spaces":`このフィールドは空にすることはできません。また、空白文字のみを含むこともできません`,"This message did n
500ot meet our content guidelines":`このメッセージはコンテンツガイドラインに適合していません`,Thread:`スレッド`,"Thread has not been found":`スレッドが見つかりませんでした`,"Thread reply":`スレッドの返信`,"Thread Reply":`スレッドの返信`,"ThreadListUnseenThreadsBanner/loading":`読み込み中...`,"ThreadListUnseenThreadsBanner/unreadThreads_other":`{{ count }}件の未読スレッド`,Threads:`スレッド`,"timestamp/ChannelPreviewTimestamp":`{{ timestamp | timestampFormatter(calendar: true; calendarFormats: { "sameDay": "LT", "lastDay": "[昨日]", "lastWeek": "dddd", "sameElse": "L" }) }}`,"timestamp/DateSeparator":`{{ timestamp | timestampFormatter(calendar: true; calendarFormats: { "sameDay": "[今日]", "nextDay": "[明日]", "lastDay": "[昨日]", "nextWeek": "dddd", "lastWeek": "[先週の] dddd", "sameElse": "ddd, D MMM" }) }}`,"timestamp/LiveLocation":`{{ timestamp | timestampFormatter(calendar: true) }}`,"timestamp/MessageTimestamp":`{{ timestamp | timestampFormatter(calendar: false; format: HH:mm) }}`,"timestamp/PollVote":`{{ timestamp | timestampFormatter(relativeCompact: true) }}`,"timestamp/PollVoteTooltip":`{{ timestamp | timestampFormatter(calendar: true) }}`,"timestamp/relativeDaysAgo":`{{ count }}d ago`,"timestamp/relativeToday":`今日`,"timestamp/relativeWeeksAgo":`{{ count }}w ago`,"timestamp/relativeYesterday":`昨日`,"timestamp/ReminderNotification":`{{ timestamp | timestampFormatter(calendar: true; calendarFormats: { "sameDay": "[Today] [at] HH:mm", "nextDay": "[Tomorrow] [at] HH:mm", "lastDay": "[Yesterday] [at] HH:mm", "nextWeek": "dddd [at] HH:mm", "lastWeek": "[Last] dddd [at] HH:mm", "sameElse": "ddd, D MMM [at] HH:mm" }) }}`,"timestamp/SystemMessage":`{{ timestamp | timestampFormatter(format: dddd L) }}`,"To start recording, allow the camera access in your browser":`録音を開始するには、ブラウザーでカメラへのアクセスを許可してください`,"To start recording, allow the microphone access in your browser":`録音を開始するには、ブラウザーでマイクロフォンへのアクセスを許可してください`,totalVoteCount_other:`合計{{ count }}票`,Translated:`翻訳済み`,"Translated from {{ language }}":`{{ language }}から翻訳`,"translationBuilderTopic/notification":`{{value, notification}}`,"Type a number from 2 to 10":`2から10までの数字を入力してください`,Unarchive:`アーカイブ解除`,"unban-command-args":`[@ユーザ名]`,"unban-command-description":`ユーザーの禁止を解除する`,"Unblock User":`ユーザーのブロックを解除`,"unknown error":`不明なエラー`,Unmute:`無音を解除する`,"unmute-command-args":`[@ユーザ名]`,"unmute-command-description":`ユーザーのミュートを解除する`,Unpin:`ピンを解除する`,"Unread messages":`未読メッセージ`,"Unsupported attachment":`サポートされていない添付ファイル`,"unsupported file type":`サポートされていないファイル形式`,Update:`更新`,"Update the comment attached to your poll answer":`投票回答に添付されたコメントを更新`,"Update your comment":`コメントを更新`,"Upload blocked":`アップロードがブロックされました`,"Upload error":`アップロードエラー`,"Upload failed":`アップロードに失敗しました`,'Upload type: "{{ type }}" is not allowed':`アップロードタイプ:"{{ type }}"は許可されていません`,"User blocked":`ユーザーをブロックしました`,"User unblocked":`ユーザーのブロックを解除しました`,"User uploaded content":`ユーザーがアップロードしたコンテンツ`,Video:`動画`,videoCount_other:`{{ count }}件の動画`,View:`表示`,"View {{count}} comments_one":`{{count}} コメントを表示`,"View {{count}} comments_other":`{{count}} コメントを表示`,"View all":`すべて表示`,"View original":`原文を表示`,"View results":`結果を表示`,"View translation":`翻訳を表示`,"Voice message":`ボイスメッセージ`,"Voice message {{ duration }}":`ボイスメッセージ {{ duration }}`,"Voice message deleted":`ボイスメッセージが削除されました`,voiceMessageCount_other:`{{ count }}件のボイスメッセージ`,"Vote ended":`投票が終了しました`,Votes:`投票`,"Wait until all attachments have uploaded":`すべての添付ファイルがアップロードされるまでお待ちください`,"Waiting for network…":`ネットワークを待機中…`,You:`あなた`,"You've reached the maximum number of files":`ファイルの最大数に達しました`},Mhe={"{{ commaSeparatedUsers }} and {{ moreCount }} more":`{{ commaSeparatedUsers }} 그리고 {{ moreCount }}명 더`,"{{ commaSeparatedUsers }}, and {{ lastUser }}":`{{ commaSeparatedUsers }} 그리고 {{ lastUser }}`,"{{ count }}
500 files_one":`{{ count }}개 파일`,"{{ count }} files_other":`{{ count }}개 파일`,"{{ count }} people are typing_one":`{{ count }}명이 입력 중입니다`,"{{ count }} people are typing_many":`{{ count }}명이 입력 중입니다`,"{{ count }} people are typing_other":`{{ count }}명이 입력 중입니다`,"{{ count }} photos_one":`{{ count }}개 사진`,"{{ count }} photos_other":`{{ count }}개 사진`,"{{ count }} reactions_other":`{{ count }}개 반응`,"{{ count }} videos_one":`{{ count }}개 동영상`,"{{ count }} videos_other":`{{ count }}개 동영상`,"{{ firstUser }} and {{ secondUser }}":`{{ firstUser }} 그리고 {{ secondUser }}`,"{{ imageCount }} more":`{{ imageCount }}개 더`,"{{ memberCount }} members":`{{ memberCount }}명`,"{{ typing }} are typing":`{{ typing }} 입력 중입니다`,"{{ typing }} is typing":`{{ typing }} 입력 중입니다`,"{{ user }} has been muted":`{{ user }} 음소거되었습니다`,"{{ user }} has been unmuted":`{{ user }} 음소거가 해제되었습니다`,"{{ user }} is typing...":`{{ user }}이(가) 입력 중입니다...`,"{{ users }} and {{ user }} are typing...":`{{ users }}와(과) {{ user }}이(가) 입력 중입니다...`,"{{ users }} and more are typing...":`{{ users }}와(과) 더 많은 사람들이 입력 중입니다...`,"{{ watcherCount }} online":`{{ watcherCount }} 온라인`,"{{count}} new messages_one":`{{count}}개의 새 메시지`,"{{count}} new messages_other":`{{count}}개의 새 메시지`,"{{count}} unread_one":`{{count}} 읽지 않음`,"{{count}} unread_other":`{{count}} 읽지 않음`,"{{count}} votes_one":`{{count}} 투표`,"{{count}} votes_other":`{{count}} 투표`,"+{{ imageCount }}":`+{{ imageCount }}`,"+{{count}} more options_one":`옵션 {{count}}개 더`,"+{{count}} more options_other":`옵션 {{count}}개 더`,"🏙 Attachment...":`🏙 부착...`,"📊 {{createdBy}} created: {{ pollName}}":`📊 {{createdBy}}이(가) 생성함: {{ pollName}}`,"📊 {{votedBy}} voted: {{pollOptionText}}":`📊 {{votedBy}}이(가) 투표함: {{pollOptionText}}`,"📍Shared location":`📍공유된 위치`,"Add a comment":`댓글 추가`,"Add a comment to your poll answer":`투표 답변에 댓글 추가`,"Add an option":`옵션 추가`,"Add reaction":`반응 추가`,"All results loaded":`모든 결과가 로드되었습니다`,"Allow access to camera":`카메라에 대한 액세스 허용`,"Allow access to microphone":`마이크로폰에 대한 액세스 허용`,"Allow comments":`댓글 허용`,"Allow option suggestion":`옵션 제안 허용`,"Allow others to add comments":`다른 사람이 댓글을 추가할 수 있도록 허용`,"Also send as a direct message":`다이렉트 메시지로도 보내기`,"Also send in channel":`채널에도 보내기`,"Also sent in channel":`채널에도 전송됨`,"An error has occurred during recording":`녹음 중 오류가 발생했습니다`,"An error has occurred during the recording processing":`녹음 처리 중 오류가 발생했습니다`,Anonymous:`익명`,"Anonymous poll":`익명 투표`,Archive:`아카이브`,"Are you sure you want to delete this message?":`이 메시지를 삭제하시겠습니까?`,"aria/Attachment":`첨부 파일`,"aria/Attachment Actions":`첨부 파일 작업`,"aria/Audio position {{ elapsed }} of {{ duration }}":`오디오 위치 {{ elapsed }} / {{ duration }}`,"aria/Audio position {{ progress }} percent":`오디오 위치 {{ progress }}퍼센트`,"aria/Block User":`사용자 차단`,"aria/Bookmark Message":`메시지 북마크`,"aria/Cancel recording":`녹음 취소`,"aria/Cancel Reply":`답장 취소`,"aria/Cancel upload":`업로드 취소`,"aria/Channel Actions":`채널 작업`,"aria/Channel list":`채널 목록`,"aria/Channel search results":`채널 검색 결과`,"aria/Chat view tabs":`채팅 보기 탭`,"aria/Clear search":`검색 지우기`,"aria/Close callout dialog":`콜아웃 대화 상자 닫기`,"aria/Close thread":`스레드 닫기`,"aria/Collapse sidebar":`사이드바 접기`,"aria/Command Suggestions":`명령어 제안`,"aria/Complete recording":`녹음 완료`,"aria/Copy Message Text":`메시지 텍스트 복사`,"aria/Decrease value":`값 감소`,"aria/Delete Message":`메시지 삭제`,"aria/Dismiss notification":`알림 닫기`,"aria/Download attachment":`첨부 파일 다운로드`,"aria/Edit Message":`메시지 수정`,"aria/Emoji picker":`이모지 선택기`,"aria/Emoji Suggestions":`이모지 제안`,"aria/Exit search":`검색 종료`,"aria/Expand sidebar":`사이드바 확장`,"aria/File input":`파일 입력`,"aria/File upload":`파일 업로드`,"aria/Flag Message":`메시지 신고`,"aria/Image failed to load":`이미지를 불러오지 못했습니다`,"aria/Image input":`이미지 입력`,"aria/Increase value":`값 증가`,"aria/Jump to latest message":`최신 메시지로 이동`,"aria/Jump to quoted message":`인용된 메시지로 이동`,"aria/Load More Channels":`더 많은 채널 불러오기`,"aria/Mark Message Unread":`읽지 않음으로 표시`,"aria/Mark messages as read":`메시지를 읽음으로 표시`,"aria/Menu":`메뉴`,"aria/Message Actions":`메시지 작업`,"aria/Message from {{ user }},":`{{ user }}의 메시지,`,"aria/Message Options":`메시지 옵션`,"aria/Message,"
500:`메시지,`,"aria/Mute User":`사용자 음소거`,"aria/Notifications":`알림`,"aria/Open Attachment Selector":`첨부 파일 선택기 열기`,"aria/Open Channel Actions Menu":`채널 작업 메뉴 열기`,"aria/Open Menu":`메뉴 열기`,"aria/Open Message Actions Menu":`메시지 액션 메뉴 열기`,"aria/Open Reaction Selector":`반응 선택기 열기`,"aria/Open Thread":`스레드 열기`,"aria/Pause":`일시정지`,"aria/Pause recording":`녹음 일시정지`,"aria/Percent complete":`{{percent}}퍼센트 완료`,"aria/Pin Message":`메시지 고정`,"aria/Play":`재생`,"aria/Quote Message":`메시지 인용`,"aria/Reaction list":`반응 목록`,"aria/Remind Me Message":`알림 설정`,"aria/Remind Me Options":`알림 옵션`,"aria/Remove attachment":`첨부 파일 제거`,"aria/Remove location attachment":`위치 첨부 파일 제거`,"aria/Remove option":`옵션 제거`,"aria/Remove Reminder":`알림 제거`,"aria/Remove Save For Later":`나중에 보기 제거`,"aria/Resend Message":`메시지 다시 보내기`,"aria/Resume recording":`녹음 재개`,"aria/Retry upload":`업로드 다시 시도`,"aria/Review bounced message":`반송된 메시지 검토`,"aria/Search results":`검색 결과`,"aria/Search results header filter button for: {{ source }}":`{{ source }}에 대한 검색 결과 헤더 필터 버튼`,"aria/Seek audio position":`오디오 위치 탐색`,"aria/Select Channel: {{ channelName }}":`채널 선택: {{ channelName }}`,"aria/Select Reaction: {{ reactionName }}":`반응 선택: {{ reactionName }}`,"aria/Select User Channel: {{ name }}":`사용자 채널 선택: {{ name }}`,"aria/Send":`보내기`,"aria/Show preview":`미리보기 표시`,"aria/Start recording audio":`오디오 녹음 시작`,"aria/Stop AI Generation":`AI 생성 중지`,"aria/Suggestions":`제안`,"aria/Thread list":`스레드 목록`,"aria/Unblock User":`사용자 차단 해제`,"aria/Unmute User":`음소거 해제`,"aria/Unpin Message":`핀 해제`,"aria/User Suggestions":`사용자 제안`,"Ask a question":`질문하기`,Attach:`첨부`,"Attach files":`파일 첨부`,Attachment:`첨부 파일`,"Attachment upload blocked due to {{reason}}":`{{reason}}로 인해 첨부 파일 업로드가 차단되었습니다`,"Attachment upload failed due to {{reason}}":`{{reason}}로 인해 첨부 파일 업로드가 실패했습니다`,Back:`뒤로`,"ban-command-args":`[@사용자이름] [텍스트]`,"ban-command-description":`사용자를 차단`,"Block User":`사용자 차단`,Cancel:`취소`,"Cannot seek in the recording":`녹음에서 찾을 수 없습니다`,"Channel archived":`채널이 보관됨`,"Channel Missing":`채널 누락`,"Channel muted":`채널이 음소거됨`,"Channel pinned":`채널이 고정됨`,"Channel unarchived":`채널 보관이 해제됨`,"Channel unmuted":`채널 음소거가 해제됨`,"Channel unpinned":`채널 고정이 해제됨`,Channels:`채널`,Chats:`채팅`,"Choose between 2 to 10 options":`2~10개의 선택지 중에서 선택`,Close:`닫기`,"Close dialog":`대화 상자 닫기`,"Close emoji picker":`이모티콘 선택기 닫기`,"Close prompt: {{ title }}":`프롬프트 닫기: {{ title }}`,"Command not available while editing":`편집 중에는 명령을 사용할 수 없습니다`,"Command not available while replying":`답장 중에는 명령을 사용할 수 없습니다`,Commands:`명령어`,"Commands matching":`일치하는 명령`,"Connection failure, reconnecting now...":`연결 실패, 지금 다시 연결 중...`,"Copy Message":`메시지 복사`,Create:`생성`,"Create a question, add options, and configure poll settings":`질문을 만들고 옵션을 추가한 뒤 투표 설정 구성`,"Create poll":`투표 생성`,"Current location":`현재 위치`,Delete:`삭제`,"Delete for me":`나만 삭제`,"Delete message":`메시지 삭제`,Delivered:`배달됨`,"Direct message":`다이렉트 메시지`,"Do you want to end this poll now? Nobody will be able to vote in this poll anymore.":`지금 이 투표를 종료하시겠습니까? 종료 후에는 더 이상 투표할 수 없습니다.`,"Download All":`모두 다운로드`,"Download Attachment":`첨부 파일 다운로드`,"Download attachment {{ name }}":`첨부 파일 {{ name }}
500 다운로드`,"Drag your files here":`여기로 파일을 끌어다 놓으세요`,"Drag your files here to add to your post":`게시물에 추가하려면 파일을 여기로 끌어다 놓으세요`,"Due {{ timeLeft }}":`{{ timeLeft }}에 기한`,"Due since {{ dueSince }}":`{{ dueSince }}부터 기한`,"duration/Message reminder":`{{ milliseconds | durationFormatter(withSuffix: true) }}`,"duration/Remind Me":`{{ milliseconds | durationFormatter(withSuffix: true) }}`,"duration/Share Location":`{{ milliseconds | durationFormatter }}`,"Edit Message":`메시지 수정`,"Edit message request failed":`메시지 수정 요청 실패`,Edited:`편집됨`,"Emoji matching":`이모티콘 매칭`,"Empty message...":`빈 메시지...`,End:`종료`,"End poll":`투표 종료`,"End this poll?":`이 투표를 종료하시겠습니까?`,"End vote":`투표 종료`,"Enforce unique vote is enabled":`고유 투표가 활성화되었습니다`,Error:`오류`,"Error adding flag":`플래그를 추가하는 동안 오류가 발생했습니다.`,"Error connecting to chat, refresh the page to try again.":`채팅에 연결하는 동안 오류가 발생했습니다. 페이지를 새로고침하여 다시 시도하세요.`,"Error deleting message":`메시지를 삭제하는 중에 오류가 발생했습니다.`,"Error fetching reactions":`반응 로딩 오류.`,"Error marking message unread. Cannot mark unread messages older than the newest 100 channel messages.":`메시지를 읽지 않음으로 표시하는 중 오류가 발생했습니다. 가장 최근 100개의 채널 메시지보다 오래된 읽지 않은 메시지는 표시할 수 없습니다.`,"Error muting a user ...":`사용자를 음소거하는 중에 오류가 발생했습니다...`,"Error pinning message":`메시지를 핀하는 중에 오류가 발생했습니다.`,"Error removing message pin":`메시지 핀을 제거하는 중에 오류가 발생했습니다.`,"Error reproducing the recording":`녹음 재생 중 오류 발생`,"Error starting recording":`녹음 시작 중 오류가 발생했습니다`,"Error unmuting a user ...":`사용자 음소거 해제 중 오류 발생...`,"Error uploading attachment":`첨부 파일 업로드 중 오류가 발생했습니다`,"Error uploading file":`파일 업로드 오류`,"Error uploading image":`이미지를 업로드하는 동안 오류가 발생했습니다.`,"Error: {{ errorMessage }}":`오류: {{ errorMessage }}`,"Exit command {{ command }}":`명령 종료 {{ command }}`,"Failed to block user":`사용자 차단에 실패했습니다`,"Failed to create the poll":`투표 생성 실패`,"Failed to create the poll due to {{reason}}":`{{reason}} 때문에 투표를 생성하지 못했습니다`,"Failed to delete the message":`메시지 삭제에 실패했습니다`,"Failed to end the poll":`투표 종료에 실패했습니다`,"Failed to end the poll due to {{reason}}":`{{reason}}(으)로 인해 투표 종료에 실패했습니다`,"Failed to jump to the first unread message":`첫 번째 읽지 않은 메시지로 이동하지 못했습니다`,"Failed to leave channel":`채널 나가기에 실패했습니다`,"Failed to load channels":`채널을 불러오지 못했습니다`,"Failed to load more channels":`채널을 더 불러오지 못했습니다`,"Failed to mark channel as read":`채널을 읽음으로 표시하는 데 실패했습니다`,"Failed to play the recording":`녹음을 재생하지 못했습니다`,"Failed to retrieve location":`위치를 가져오지 못했습니다`,"Failed to share location":`위치를 공유하지 못했습니다`,"Failed to update channel archive status":`채널 아카이브 상태 업데이트에 실패했습니다`,"Failed to update channel mute status":`채널 음소거 상태 업데이트에 실패했습니다`,"Failed to update channel pinned status":`채널 고정 상태 업데이트에 실패했습니다`,File:`파일`,"File is required for upload attachment":`첨부 파일 업로드에 파일이 필요합니다`,"File is too large: {{ size }}, maximum upload size is {{ limit }}":`파일이 너무 큽니다: {{ size }}, 최대 업로드 크기는 {{ limit }}입니다`,"File too large":`파일이 너무 큽니다`,fileCount_other:`파일 {{ count }}개`,Flag:`플래그`,"Generating...":`생성 중...`,"giphy-command-args":`[텍스트]`,"giphy-command-description":`채널에 무작위 GIF 게시`,"Hide who voted":`누가 투표했는지 숨기기`,Image:`이미지`,imageCount_other:`이미지 {{ count }}개`,"Instant commands":`즉시 명령어`,"language/af":`아프리칸스어`,"language/am":`암하라어`,"language/ar":`아랍어`,"language/az":`아제르바이잔어`,"language/bg":`불가리아어`,"language/bn":`벵골어`,"language/bs":`보스니아어`,"language/cs":`체코어`,"language/da":`덴마크어`,"language/de":`독일어`,"language/el":`그리스어`,"language/en":`영어`,"language/es":`스페인어`,"language/es-MX":`스페인어(멕시코)`,"language/et":`에스토니아어`,"language/fa":`페르시아어`,"language/fa-AF":`다리어`,"language/fi":`핀란드어`,"language/fr":`프랑스어`,"language/fr-CA":`프랑스어(캐나다)`,"language/ha":`하우사어`,"language/he":`히브리어`,"language/hi":`힌디어`,"language/hr":`크로아티아어`,"language/ht":`아이티 크리올어`,"language/hu":`헝가리어`,"language/id":`인도네시아어`,"language/it":`이탈리아어`,"language/ja":`일본어`,"language/ka":`조지아어`,"language/ko":`한국어`,"language/lt":`리투아니아어`,"language/lv":`라트비아어`,"language/ms":`말레이어`,"language/nl":`네덜란드어`,"language/no":`노르웨이어`,"language/pl":`폴란드어`,"language/ps":`파슈토어`,"language/pt":`포르투갈어`,"language/ro":`루마니아어`,"language/ru":`러시아어`,"language/sk":`슬로바키아어`,"language/sl":`슬로베니아어`,"language/so":`소말리아어`,"language/sq":`알바니아어`,"language/sr":`세르비아어`,"language/sv":`스웨덴어`,"language/sw":`스ì
500™€ížë¦¬ì–´`,"language/ta":`타밀어`,"language/th":`태국어`,"language/tl":`타갈로그어`,"language/tr":`터키어`,"language/uk":`우크라이나어`,"language/ur":`우르두어`,"language/vi":`베트남어`,"language/zh":`중국어(간체)`,"language/zh-TW":`중국어(번체)`,"Leave Channel":`채널 나가기`,"Left channel":`채널을 나갔습니다`,"Let others add options":`다른 사람이 선택지를 추가할 수 있도록 허용`,"Limit votes per person":`1인당 투표 수 제한`,Link:`링크`,linkCount_other:`링크 {{ count }}개`,live:`라이브`,"Live for {{duration}}":`{{duration}} 동안 라이브`,"Live location":`라이브 위치`,"Live until {{ timestamp }}":`{{ timestamp }}까지 라이브`,"Load more":`더 불러오기`,"Local upload attachment missing local id":`로컬 업로드 첨부에 로컬 ID가 없습니다`,Location:`위치`,"Location sharing ended":`위치 공유가 종료되었습니다`,"Location: {{ coordinates }}":`위치: {{ coordinates }}`,"Mark as unread":`읽지 않음으로 표시`,"Maximum number of votes (from 2 to 10)":`최대 투표 수 (2에서 10까지)`,"Maximum votes per person":`1인당 최대 투표 수`,Menu:`메뉴`,"Message deleted":`메시지가 삭제되었습니다.`,"Message failed to send":`메시지 전송 실패`,"Message has been successfully flagged":`메시지에 플래그가 지정되었습니다.`,"Message marked as unread":`메시지를 읽지 않음으로 표시했습니다`,"Message pinned":`메시지 핀했습니다`,"Message unpinned":`메시지 고정이 해제됨`,"Message was blocked by moderation policies":`메시지가 관리 정책에 의해 차단되었습니다.`,"Messages have been marked unread.":`메시지가 읽지 않음으로 표시되었습니다.`,"Missing permissions to upload the attachment":`첨부 파일을 업로드하려면 권한이 필요합니다`,"Multiple votes":`복수 투표`,Mute:`무음`,"mute-command-args":`[@사용자이름]`,"mute-command-description":`사용자 음소거`,"network error":`네트워크 오류`,New:`새로운`,"New message from {{user}}":`{{user}}의 새 메시지`,"New Messages!":`새 메시지!`,"Next image":`다음 이미지`,"No chats here yet…":`아직 채팅이 없습니다...`,"No conversations yet":`아직 대화가 없습니다.`,"No items exist":`항목이 없습니다.`,"No results found":`검색 결과가 없습니다`,"Nobody will be able to vote in this poll anymore.":`이 투표에 더 이상 아무도 투표할 수 없습니다.`,"Nothing yet...":`아직 아무것도...`,Offline:`오프라인`,Ok:`확인`,Online:`온라인`,"Only numbers are allowed":`숫자만 입력 가능합니다`,"Only visible to you":`당신에게만 표시됨`,"Open emoji picker":`이모지 선택기 열기`,"Open gallery at image {{ index }}":`이미지 {{ index }}에서 갤러리 열기`,"Open image in gallery":`갤러리에서 이미지 열기`,"Open location in a map":`지도에서 위치 열기`,"Option already exists":`옵션이 이미 존재합니다`,"Option is empty":`옵션이 비어 있습니다`,Options:`옵션`,Original:`원문`,"People matching":`일치하는 사람`,Photo:`사진`,Pin:`핀`,"Pinned by {{ name }}":`{{ name }}님이 핀함`,"Pinned by You":`내가 고정함`,"placeholder/PollComment":`댓글`,"placeholder/PollOptionSuggestion":`새 옵션 입력`,"Play video":`동영상 재생`,"Playback speed {{ rate }}x":`재생 속도 {{ rate }}x`,Poll:`투표`,"Poll comments":`투표 댓글`,"Poll ended":`투표 종료됨`,"Poll options":`투표 옵션`,"Poll results":`투표 ê²°ê³¼`,"Previous image":`이전 이미지`,Question:`질문`,"Question {{ optionOrderNumber}}":`질문 {{ optionOrderNumber}}`,"Question is required":`질문이 필요합니다`,"Quote Reply":`인용 답장`,"Reached the vote limit. Remove an existing vote first.":`투표 한도에 도달했습니다. 기존 투표를 먼저 제거하세요.`,"Recording format is not supported and cannot be reproduced":`녹음 형식이 지원되지 않으므로 재생할 수 없습니다`,"Remind me":`알림`,"Remind Me":`알림 설정`,"Reminder set":`알림 설정됨`,"Remove reminder":`알림 제거`,"Remove save for later":`나중에 보기 제거`,"Replied to a thread":`스레드에 답글을 남겼습니다`,Reply:`답장`,"Reply to {{ authorName }}":`{{ authorName }}님에게 답장`,"Reply to a message to start a thread":`스레드를 시작하려면 메시지에 답장하세요`,"Reply to Message":`메시지에 답장`,replyCount_one:`답장 1개`,replyCount_other:`{{ count }} 답장`,Resend:`다시 보내기`,"Retry upload":`업로드 다시 시도`,"Review all options available in this poll":`이 투표에서 사용 가능한 모든 옵션 검토`,"Review comments submitted with poll answers":`투표 답변과 함께 제출된 댓글 검토`,"Review poll results and open an option to see detailed votes":`투표 결과를 검토하고 옵션을 열어 상세 득표 보기`,"Review this message and choose whether to delete it, edit it, or send it anyway":`이 메시지를 검토하고 삭제, 수정 또는 그대로 전송할지 선택`,"Review who voted for this option":`이 옵션에 투표한 사람 검토`,"Save for later":`나중에 저장`,"Saved for later":`나중에 저장됨`,Search:`찾다`,"Search GIFs":`GIF 검색`,"search-results-header-filter-source-button-label--channels":`채널`,"search-results-header-filter-source-button-label--messages":`메시지`,"search-results-header-filter-source-button-label--users":`사용자`,"Searching for {{ searchSourceType }}...":`{{ searchSourceType }} 검색 중...`,"Searching...":`수색...`,searchResultsCount_one:`1개의 ê²°ê³¼`,searchResultsCount_other:`{{ count }}개 ê²°ê³¼`,"Select a thread to continue the conversation":`대화를 계속하려면 스레드를 선택하세요`,"Select more than one option":`하나 이상의 선택지 선택`,"Select one":`하나 선택`,"Select one or more":`하나 이상 선택`,"Select up to {{count}}_one":`{{count}}개까지 선택`,"Select up to {{count}}_other":`{{count}}개까지 선택`,"Select your current location and optionally enable live location sharing":`현재 위치를 선택하고 필요 시 실시간 위치 공유를 활성화`,Send:`보내다`,"Send a message":`메시지 보내기`,"Send a message to start the conversation":`대화를 시작하려면 메시지를 보내세요`,"Send Anyway":`어쨌든 보내기`,"Send message request failed":`메시지 보내기 요청 실패`,"Send poll":`투표 보내기`,"Sending...":`배상중...`,Sent:`전송됨`,Share:`공유`,"Share live location for":`라이브 위치 공유`,"Share Location":`위치 공유`,"Shared live location":`공유된 라이브 위치`,"Shared location":`공유된 위치`,Shuffle:`셔플`,"size limit":`크기 제한`,"Slow Mode ON":`슬로우 모드 켜짐`,"Slow mode, wait {{ seconds }}s...":`슬로우 모드, {{ seconds }}초 기다려 주세요...`,"Some of the files will not be accepted":`일부 파일은 허용되지 않을 수 있습니다`,"Start t
500yping to search":`검색하려면 입력을 시작하세요`,"Stop sharing":`공유 중지`,Submit:`제출`,"Suggest a new option to add to this poll":`이 투표에 추가할 새 옵션 제안`,"Suggest an option":`옵션 제안`,"Tap to remove":`제거하려면 탭하세요`,"Tap to remove: {{ reactionName }}":`제거하려면 탭하세요: {{ reactionName }}`,"Thinking...":`생각 중...`,"this content could not be displayed":`이 콘텐츠를 표시할 수 없습니다`,"This field cannot be empty or contain only spaces":`이 필드는 비워둘 수 없으며 공백만 포함할 수도 없습니다`,"This message did not meet our content guidelines":`이 메시지는 콘텐츠 가이드라인을 충족하지 않습니다.`,Thread:`스레드`,"Thread has not been found":`스레드를 찾을 수 없습니다`,"Thread reply":`스레드 답장`,"Thread Reply":`스레드 답장`,"ThreadListUnseenThreadsBanner/loading":`로딩 중...`,"ThreadListUnseenThreadsBanner/unreadThreads_other":`읽지 않은 스레드 {{ count }}개`,Threads:`스레드`,"timestamp/ChannelPreviewTimestamp":`{{ timestamp | timestampFormatter(calendar: true; calendarFormats: { "sameDay": "LT", "lastDay": "[어제]", "lastWeek": "dddd", "sameElse": "L" }) }}`,"timestamp/DateSeparator":`{{ timestamp | timestampFormatter(calendar: true; calendarFormats: { "sameDay": "[오늘]", "nextDay": "[내일]", "lastDay": "[어제]", "nextWeek": "dddd", "lastWeek": "[지난] dddd", "sameElse": "ddd, D MMM" }) }}`,"timestamp/LiveLocation":`{{ timestamp | timestampFormatter(calendar: true) }}`,"timestamp/MessageTimestamp":`{{ timestamp | timestampFormatter(calendar: false; format: HH:mm) }}`,"timestamp/PollVote":`{{ timestamp | timestampFormatter(relativeCompact: true) }}`,"timestamp/PollVoteTooltip":`{{ timestamp | timestampFormatter(calendar: true) }}`,"timestamp/relativeDaysAgo":`{{ count }}d ago`,"timestamp/relativeToday":`오늘`,"timestamp/relativeWeeksAgo":`{{ count }}w ago`,"timestamp/relativeYesterday":`어제`,"timestamp/ReminderNotification":`{{ timestamp | timestampFormatter(calendar: true; calendarFormats: { "sameDay": "[Today] [at] HH:mm", "nextDay": "[Tomorrow] [at] HH:mm", "lastDay": "[Yesterday] [at] HH:mm", "nextWeek": "dddd [at] HH:mm", "lastWeek": "[Last] dddd [at] HH:mm", "sameElse": "ddd, D MMM [at] HH:mm" }) }}`,"timestamp/SystemMessage":`{{ timestamp | timestampFormatter(format: dddd L) }}`,"To start recording, allow the camera access in your browser":`브라우저에서 카메라 액세스를 허용하여 녹음을 시작합니다`,"To start recording, allow the microphone access in your browser":`브라우저에서 마이크로폰 액세스를 허용하여 녹음을 시작합니다`,totalVoteCount_other:`총 {{ count }}표`,Translated:`번역됨`,"Translated from {{ language }}":`{{ language }}(으)로 번역됨`,"translationBuilderTopic/notification":`{{value, notification}}`,"Type a number from 2 to 10":`2에서 10 사이의 숫자를 입력하세요`,Unarchive:`아카이브 해제`,"unban-command-args":`[@사용자이름]`,"unban-command-description":`사용자 차단 해제`,"Unblock User":`사용자 차단 해제`,"unknown error":`알 수 없는 오류`,Unmute:`음소거 해제`,"unmute-command-args":`[@사용자이름]`,"unmute-command-description":`사용자 음소거 해제`,Unpin:`핀 해제`,"Unread messages":`읽지 않은 메시지`,"Unsupported attachment":`지원되지 않는 첨부 파일`,"unsupported file type":`지원되지 않는 파일 형식`,Update:`업데이트`,"Update the comment attached to your poll answer":`투표 답변에 첨부된 댓글 업데이트`,"Update your comment":`댓글 업데이트`,"Upload blocked":`업로드가 차단되었습니다`,"Upload error":`업로드 오류`,"Upload failed":`업로드에 실패했습니다`,'Upload type: "{{ type }}" is not allowed':`업로드 유형: "{{ type }}"은(는) 허용되지 않습니다.`,"User blocked":`사용자가 차단됨`,"User unblocked":`사용자 차단이 해제됨`,"User uploaded content":`사용자 업로드 콘텐츠`,Video:`동영상`,videoCount_other:`동영상 {{ count }}
500개`,View:`보기`,"View {{count}} comments_one":`{{count}}개의 댓글 보기`,"View {{count}} comments_other":`{{count}}개의 댓글 보기`,"View all":`전체 보기`,"View original":`원문 보기`,"View results":`결과 보기`,"View translation":`번역 보기`,"Voice message":`음성 메시지`,"Voice message {{ duration }}":`음성 메시지 {{ duration }}`,"Voice message deleted":`음성 메시지가 삭제됨`,voiceMessageCount_other:`음성 메시지 {{ count }}개`,"Vote ended":`투표 종료`,Votes:`투표`,"Wait until all attachments have uploaded":`모든 첨부 파일이 업로드될 때까지 기다립니다.`,"Waiting for network…":`네트워크 대기 중…`,You:`당신`,"You've reached the maximum number of files":`최대 파일 수에 도달했습니다.`},Nhe={"{{ commaSeparatedUsers }} and {{ moreCount }} more":`{{ commaSeparatedUsers }} en {{ moreCount }} meer`,"{{ commaSeparatedUsers }}, and {{ lastUser }}":`{{ commaSeparatedUsers }} en {{ lastUser }}`,"{{ count }} files_one":`{{ count }} bestand`,"{{ count }} files_other":`{{ count }} bestanden`,"{{ count }} people are typing_one":`{{ count }} persoon typt`,"{{ count }} people are typing_many":`{{ count }} personen typen`,"{{ count }} people are typing_other":`{{ count }} personen typen`,"{{ count }} photos_one":`{{ count }} foto`,"{{ count }} photos_other":`{{ count }} foto's`,"{{ count }} reactions_one":`{{ count }} reactie`,"{{ count }} reactions_other":`{{ count }} reacties`,"{{ count }} videos_one":`{{ count }} video`,"{{ count }} videos_other":`{{ count }} video's`,"{{ firstUser }} and {{ secondUser }}":`{{ firstUser }} en {{ secondUser }}`,"{{ imageCount }} more":`+{{ imageCount }}`,"{{ memberCount }} members":`{{ memberCount }} deelnemers`,"{{ typing }} are typing":`{{ typing }} typen`,"{{ typing }} is typing":`{{ typing }} typt`,"{{ user }} has been muted":`{{ user }} is gedempt`,"{{ user }} has been unmuted":`{{ user }} is niet meer gedempt`,"{{ user }} is typing...":`{{ user }} is aan het typen...`,"{{ users }} and {{ user }} are typing...":`{{ users }} en {{ user }} zijn aan het typen...`,"{{ users }} and more are typing...":`{{ users }} en meer zijn aan het typen...`,"{{ watcherCount }} online":`{{ watcherCount }} online`,"{{count}} new messages_one":`{{count}} nieuw bericht`,"{{count}} new messages_other":`{{count}} nieuwe berichten`,"{{count}} unread_one":`{{count}} ongelezen`,"{{count}} unread_other":`{{count}} ongelezen`,"{{count}} votes_one":`{{count}} stem`,"{{count}} votes_other":`{{count}} stemmen`,"+{{ imageCount }}":`+{{ imageCount }}`,"+{{count}} more options_one":`+{{count}} meer optie`,"+{{count}} more options_other":`+{{count}} meer opties`,"🏙 Attachment...":`🏙 Bijlage...`,"📊 {{createdBy}} created: {{ pollName}}":`📊 {{createdBy}} heeft gemaakt: {{ pollName}}`,"📊 {{votedBy}} voted: {{pollOptionText}}":`📊 {{votedBy}} heeft gestemd: {{pollOptionText}}`,"📍Shared location":`📍Gedeelde locatie`,"Add a comment":`Voeg een opmerking toe`,"Add a comment to your poll answer":`Voeg een reactie toe aan je pollantwoord`,"Add an option":`Voeg een optie toe`,"Add reaction":`Reactie toevoegen`,"All results loaded":`Alle resultaten geladen`,"Allow access to camera":`Toegang tot camera toestaan`,"Allow access to microphone":`Toegang tot microfoon toestaan`,"Allow comments":`Sta opmerkingen toe`,"Allow option suggestion":`Sta optie-suggesties toe`,"Allow others to add comments":`Sta anderen toe om opmerkingen toe te voegen`,"Also send as a direct message":`Ook als direct bericht versturen`,"Also send in channel":`Ook in kanaal versturen`,"Also sent in channel":`Ook in kanaal verzonden`,"An error has occurred during recording":`Er is een fout opgetreden tijdens het opnemen`,"An error has occurred during the recording processing":`Er is een fout opgetreden tijdens de verwerking van de opname`,Anonymous:`Anoniem`,"Anonymous poll":`Anonieme peiling`,Archive:`Archief`,"Are you sure you want to delete this message?":`Weet je zeker dat je dit bericht wilt verwijderen?`,"aria/Attachment":`Bijlage`,"aria/Attachment Actions":`Bijlageacties`,"aria/Audio position {{ elapsed }} of {{ duration }}":`Audiopositie {{ elapsed }} van {{ duration }}`,"aria/Audio position {{ progress }} percent":`Audiopositie {{ progress }} procent`,"aria/Block User":`Gebruiker blokkeren`,"aria/Bookmark Message":`Bericht bookmarken`,"aria/Cancel recording":`Opname annuleren`,"aria/Cancel Reply":`Antwoord annuleren`,"aria/Cancel upload":`Upload annuleren`,"aria/Channel Actions":`Kanaalacties`,"aria/Channel list":`Kanaallijst`,"aria/Channel search results":`Zoekresultaten voor kanalen`,"aria/Chat view tabs":`Tabbladen chatweergave`,"aria/Clear search":`Zoekopdracht wissen`,"aria/Close callout dialog":`Calloutdialoog sluiten`,"aria/Close thread":`Draad sluiten`,"aria/Collapse sidebar":`Zijbalk samenklappen`,"aria/Command Suggestions":`Opdrachtsuggesties`,"aria/Complete recording":`Opname voltooien`,"aria/Copy Message Text":`Berichttekst kopiëren`,"aria/Decrease value":`Waarde verlagen`,"aria/Delete Message":`Bericht verwijderen`,"aria/Dismiss notification":`Melding sluiten`,"aria/Download attachment":`Bijlage downloaden`,"aria/Edit Message":`Bericht bewerken`,"aria/Emoji picker":`Emoji kiezer`,"aria/Emoji Suggestions":`Emoji-suggesties`,"aria/Exit search":`Zoeken afsluiten`,"aria/Expand sidebar":`Zijbalken uitvouwen`,"aria/File input":`Bestandsinvoer`,"aria/File upload":`Bestand uploaden`,"aria/Flag Message":`Bericht markeren`,"aria/Image failed to load":`Afbeelding laden mislukt`,"aria/Image input":`Afbeelding invoeren`,"aria/Increase value":`Waarde verhogen`,"aria/Jump to latest message":`Ga naar laatste bericht`,"aria/Jump to quoted message":`Ga naar geciteerd bericht`,"aria/Load More Channels":`Meer kanalen laden`,"aria/Mark Message Unread":`Markeren als ongelezen`,"aria/Mark messages as read":`Markeer berichten als gelezen`,"aria/Menu":`Menu`,"aria/Message Actions":`Berichtacties`,"aria/Message from {{ user }},":`Bericht van {{ user }}
500,`,"aria/Message Options":`Berichtopties`,"aria/Message,":`Bericht,`,"aria/Mute User":`Gebruiker dempen`,"aria/Notifications":`Meldingen`,"aria/Open Attachment Selector":`Open bijlage selector`,"aria/Open Channel Actions Menu":`Kanaalactiemenu openen`,"aria/Open Menu":`Menu openen`,"aria/Open Message Actions Menu":`Menu voor berichtacties openen`,"aria/Open Reaction Selector":`Reactiekiezer openen`,"aria/Open Thread":`Draad openen`,"aria/Pause":`Pauzeren`,"aria/Pause recording":`Opname pauzeren`,"aria/Percent complete":`{{percent}} procent voltooid`,"aria/Pin Message":`Bericht vastmaken`,"aria/Play":`Afspelen`,"aria/Quote Message":`Bericht citeren`,"aria/Reaction list":`Reactielijst`,"aria/Remind Me Message":`Herinner mij`,"aria/Remind Me Options":`Herinneringsopties`,"aria/Remove attachment":`Bijlage verwijderen`,"aria/Remove location attachment":`Locatie bijlage verwijderen`,"aria/Remove option":`Optie verwijderen`,"aria/Remove Reminder":`Herinnering verwijderen`,"aria/Remove Save For Later":`Verwijder 'Bewaren voor later'`,"aria/Resend Message":`Bericht opnieuw verzenden`,"aria/Resume recording":`Opname hervatten`,"aria/Retry upload":`Upload opnieuw proberen`,"aria/Review bounced message":`Controleer teruggestuurd bericht`,"aria/Search results":`Zoekresultaten`,"aria/Search results header filter button for: {{ source }}":`Filterknop koptekst zoekresultaten voor: {{ source }}`,"aria/Seek audio position":`Audiopositie zoeken`,"aria/Select Channel: {{ channelName }}":`Kanaal selecteren: {{ channelName }}`,"aria/Select Reaction: {{ reactionName }}":`Reactie selecteren: {{ reactionName }}`,"aria/Select User Channel: {{ name }}":`Gebruikerskanaal selecteren: {{ name }}`,"aria/Send":`Verzenden`,"aria/Show preview":`Voorbeeld tonen`,"aria/Start recording audio":`Audio-opname starten`,"aria/Stop AI Generation":`AI-generatie stoppen`,"aria/Suggestions":`Suggesties`,"aria/Thread list":`Threadlijst`,"aria/Unblock User":`Gebruiker deblokkeren`,"aria/Unmute User":`Dempen opheffen`,"aria/Unpin Message":`Losmaken`,"aria/User Suggestions":`Gebruikerssuggesties`,"Ask a question":`Stel een vraag`,Attach:`Bijvoegen`,"Attach files":`Bijlage toevoegen`,Attachment:`Bijlage`,"Attachment upload blocked due to {{reason}}":`Bijlage upload geblokkeerd vanwege {{reason}}`,"Attachment upload failed due to {{reason}}":`Bijlage upload mislukt vanwege {{reason}}`,Back:`Terug`,"ban-command-args":`[@gebruikersnaam] [tekst]`,"ban-command-description":`Een gebruiker verbannen`,"Block User":`Gebruiker blokkeren`,Cancel:`Annuleer`,"Cannot seek in the recording":`Kan niet zoeken in de opname`,"Channel archived":`Kanaal gearchiveerd`,"Channel Missing":`Kanaal niet gevonden`,"Channel muted":`Kanaal gedempt`,"Channel pinned":`Kanaal vastgezet`,"Channel unarchived":`Kanaal uit archief gehaald`,"Channel unmuted":`Dempen van kanaal opgeheven`,"Channel unpinned":`Kanaal losgemaakt`,Channels:`Kanalen`,Chats:`Chats`,"Choose between 2 to 10 options":`Kies tussen 2 en 10 opties`,Close:`Sluit`,"Close dialog":`Dialoog sluiten`,"Close emoji picker":`Sluit de emoji-kiezer`,"Close prompt: {{ title }}":`Prompt sluiten: {{ title }}`,"Command not available while editing":`Opdracht niet beschikbaar tijdens bewerken`,"Command not available while replying":`Opdracht niet beschikbaar tijdens beantwoorden`,Commands:`Commando's`,"Commands matching":`Bijpassende opdrachten`,"Connection failure, reconnecting now...":`Verbindingsfout, opnieuw verbinden...`,"Copy Message":`Bericht kopiëren`,Create:`Maak`,"Create a question, add options, and configure poll settings":`Maak een vraag, voeg opties toe en stel de pollinstellingen in`,"Create poll":`Maak peiling`,"Current location":`Huidige locatie`,Delete:`Verwijder`,"Delete for me":`Voor mij verwijderen`,"Delete message":`Bericht verwijderen`,Delivered:`Afgeleverd`,"Direct message":`Direct bericht`,"Do you want to end this poll now? Nobody will be able to vote in this poll anymore.":`Wil je deze peiling nu beëindigen? Niemand kan daarna meer op deze peiling stemmen.`,"Download All":`Alles downloaden`,"Download Attachment":`Bijlage downloaden`,"Download attachment {{ name }}":`Bijlage {{ name }} downloaden`,"Drag your files here":`Sleep je bestanden hier naartoe`,"Drag your files here to add to your post":`Sleep je bestanden hier naartoe om aan je bericht toe te voegen`,"Due {{ timeLeft }}":`Vervallen in {{ timeLeft }}`,"Due since {{ dueSince }}":`Vervallen sinds {{ dueSince }}`,"duration/Message reminder":`{{ milliseconds | durationFormatter(withSuffix: true) }}`,"duration/Remind Me":`{{ milliseconds | durationFormatter(withSuffix: true) }}`,"duration/Share Location":`{{ milliseconds | durationFormatter }}`,"Edit Message":`Bericht bewerken`,"Edit message request failed":`Verzoek om bericht bewerken mislukt`,Edited:`Bewerkt`,"Emoji matching":`Emoji-overeenkomsten`,"Empty message...":`Leeg bericht...`,End:`Einde`,"End poll":`Peiling beëindigen`,"End this poll?":`Peiling beëindigen?`,"End vote":`Einde stem`,"Enforce unique vote is enabled":`Unieke stem is ingeschakeld`,Error:`Fout`,"Error adding flag":`Fout bij toevoegen van vlag`,"Error c
500onnecting to chat, refresh the page to try again.":`Fout bij het verbinden, ververs de pagina om nogmaals te proberen`,"Error deleting message":`Fout bij verwijderen van bericht`,"Error fetching reactions":`Fout bij het laden van reacties`,"Error marking message unread. Cannot mark unread messages older than the newest 100 channel messages.":`Fout bij markeren van bericht als ongelezen. Kan geen oudere ongelezen berichten markeren dan de nieuwste 100 kanaalberichten.`,"Error muting a user ...":`Fout bij het muten van de gebruiker`,"Error pinning message":`Fout bij vastzetten van bericht`,"Error removing message pin":`Fout bij verwijderen van berichtpin`,"Error reproducing the recording":`Fout bij het afspelen van de opname`,"Error starting recording":`Fout bij het starten van de opname`,"Error unmuting a user ...":`Fout bij het unmuten van de gebruiker`,"Error uploading attachment":`Fout bij het uploaden van de bijlage`,"Error uploading file":`Fout bij uploaden bestand`,"Error uploading image":`Fout bij uploaden afbeelding`,"Error: {{ errorMessage }}":`Fout: {{ errorMessage }}`,"Exit command {{ command }}":`Opdracht verlaten {{ command }}`,"Failed to block user":`Gebruiker blokkeren mislukt`,"Failed to create the poll":`Fout bij het maken van de peiling`,"Failed to create the poll due to {{reason}}":`Peiling kon niet worden aangemaakt vanwege {{reason}}`,"Failed to delete the message":`Bericht verwijderen mislukt`,"Failed to end the poll":`Peiling kon niet worden beëindigd`,"Failed to end the poll due to {{reason}}":`Peiling kon niet worden beëindigd vanwege {{reason}}`,"Failed to jump to the first unread message":`Niet gelukt om naar het eerste ongelezen bericht te springen`,"Failed to leave channel":`Kanaal verlaten mislukt`,"Failed to load channels":`Kanalen konden niet worden geladen`,"Failed to load more channels":`Meer kanalen konden niet worden geladen`,"Failed to mark channel as read":`Kanaal kon niet als gelezen worden gemarkeerd`,"Failed to play the recording":`Kan de opname niet afspelen`,"Failed to retrieve location":`Locatie kon niet worden opgehaald`,"Failed to share location":`Locatie kon niet worden gedeeld`,"Failed to update channel archive status":`Archiefstatus van kanaal kon niet worden bijgewerkt`,"Failed to update channel mute status":`Muteerstatus van kanaal kon niet worden bijgewerkt`,"Failed to update channel pinned status":`Vastgezette status van kanaal kon niet worden bijgewerkt`,File:`Bestand`,"File is required for upload attachment":`Bestand is vereist voor het uploaden van een bijlage`,"File is too large: {{ size }}, maximum upload size is {{ limit }}":`Bestand is te groot: {{ size }}, maximale uploadgrootte is {{ limit }}`,"File too large":`Bestand is te groot`,fileCount_one:`1 bestand`,fileCount_other:`{{ count }} bestanden`,Flag:`Markeer`,"Generating...":`Genereren...`,"giphy-command-args":`[tekst]`,"giphy-command-description":`Plaats een willekeurige gif in het kanaal`,"Hide who voted":`Verberg wie heeft gestemd`,Image:`Afbeelding`,imageCount_one:`Afbeelding`,imageCount_other:`{{ count }} afbeeldingen`,"Instant commands":`Snelle opdrachten`,"language/af":`Afrikaans`,"language/am":`Amhaars`,"language/ar":`Arabisch`,"language/az":`Azerbeidzjaans`,"language/bg":`Bulgaars`,"language/bn":`Bengaals`,"language/bs":`Bosnisch`,"language/cs":`Tsjechisch`,"language/da":`Deens`,"language/de":`Duits`,"language/el":`Grieks`,"language/en":`Engels`,"language/es":`Spaans`,"language/es-MX":`Spaans (Mexico)`,"language/et":`Estlands`,"language/fa":`Perzisch`,"language/fa-AF":`Dari`,"language/fi":`Fins`,"language/fr":`Frans`,"language/fr-CA":`Frans (Canada)`,"language/ha":`Hausa`,"language/he":`Hebreeuws`,"language/hi":`Hindi`,"language/hr":`Kroatisch`,"language/ht":`Haïtiaans Creools`,"language/hu":`Hongaars`,"language/id":`Indonesisch`,"language/it":`Italiaans`,"language/ja":`Japans`,"language/ka":`Georgisch`,"language/ko":`Koreaans`,"language/lt":`Litouws`,"language/lv":`Letlands`,"language/ms":`Maleis`,"language/nl":`Nederlands`,"language/no":`Noors`,"language/pl":`Pools`,"language/ps":`Pasjtoe`,"language/pt":`Portugees`,"language/ro":`Roemeens`,"language/ru":`Russisch`,"language/sk":`Slowaaks`,"language/sl":`Sloveens`,"language/so":`Somali`,"language/sq":`Albanees`,"language/sr":`Servisch`,"language/sv":`Zweeds`,"language/sw":`Swahili`,"language/ta":`Tamil`,"language/th":`Thai`,"language/tl":`Tagalog`,"language/tr":`Turks`,"language/uk":`Oekraïens`,"language/ur":`Urdu`,"language/vi":`Vietnamees`,"language/zh":`Chinees (vereenvoudigd)`,"language/zh-TW":`Chinees (traditioneel)`,"Leave Channel":`Kanaal verlaten`,"Left channel":`Kanaal verlaten`,"Let others add options":`Laat anderen opties toevoegen`,"Limit votes per person":`Stemmen per persoon beperken`,Link:`Link`,linkCount_one:`Link`,linkCount_other:`{{ count }} links`,live:`live`,"Live for {{duration}}":`Live voor {{duration}}`,"Live location":`Live locatie`,"Live until {{ timestamp }}":`Live tot {{ timestamp }}`,"Load more":`Meer laden`,"Local upload attachment missing local id":`Lokale uploadbijlage mist lokale id`,Location:`Locatie`,"Location sharing ended":`Locatie delen beëindigd`,"Location: {{ coordinates }}":`Locatie: {{ coordinates }}`,"Mark as unread":`Markeren als ongelezen`,"Maximum number of votes (from 2 to 10)":`Maximaal aantal stemmen (van 2 tot 10)`,"Maximum votes per person":`Maximum aantal stemmen per persoon`,Menu:`Menu`,"Message deleted":`Bericht verwijderd`,"Message failed to send":`Bericht kon niet worden verzonden`,"Message has been successfully flagged":`Bericht is succesvol gemarkeerd`,"Message marked as unread":`Bericht gemarkeerd als ongelezen`,"Message pinned":`Bericht vastgezet`,"Message unpinned":`Bericht losgemaakt`,"Message was blocked by moderation policies":`Bericht is geblokkeerd door moderatiebeleid`,"Messages have been marked unread.":`Berichten zijn gemarkeerd als ongelezen.`,"Missing permissions to upload the attachment":`Missende toestemmingen om de bijlage te uploaden`,"Multiple votes":`Meerdere stemmen`,Mute:`Dempen`,"mute-command-args":`[@gebruikersnaam]`,"mute-command-description":`Een gebruiker dempen`,"network error":`netwerkfout`,New:`Nieuwe`,"New message from {{user}}":`Nieuw bericht van {{user}}`,"New Messages!":`Nieuwe Berichten!`,"Next image":`Volgende afbeelding`,"No chats here yet…":`Nog geen chats hier...`,"No conversations yet":`Nog geen gesprekken`,"No items exist":`Er zijn geen items`,"No results found":`Geen resultaten gevonden`,"Nobody will be able to vote in this poll anymore.":`Niemand kan meer stemmen in deze peiling.`,"Nothing yet...":`
500Nog niets ...`,Offline:`Offline`,Ok:`Oké`,Online:`Online`,"Only numbers are allowed":`Alleen nummers zijn toegestaan`,"Only visible to you":`Alleen zichtbaar voor jou`,"Open emoji picker":`Emoji-kiezer openen`,"Open gallery at image {{ index }}":`Galerij openen bij afbeelding {{ index }}`,"Open image in gallery":`Afbeelding openen in galerij`,"Open location in a map":`Locatie op een kaart openen`,"Option already exists":`Optie bestaat al`,"Option is empty":`Optie is leeg`,Options:`Opties`,Original:`Origineel`,"People matching":`Mensen die matchen`,Photo:`Foto`,Pin:`Vastmaken`,"Pinned by {{ name }}":`Vastgemaakt door {{ name }}`,"Pinned by You":`Door jou vastgezet`,"placeholder/PollComment":`Jouw reactie`,"placeholder/PollOptionSuggestion":`Voer een nieuwe optie in`,"Play video":`Video afspelen`,"Playback speed {{ rate }}x":`Afspeelsnelheid {{ rate }}x`,Poll:`Peiling`,"Poll comments":`Peiling opmerkingen`,"Poll ended":`Peiling beëindigd`,"Poll options":`Peiling opties`,"Poll results":`Peiling resultaten`,"Previous image":`Vorige afbeelding`,Question:`Vraag`,"Question {{ optionOrderNumber}}":`Vraag {{ optionOrderNumber}}`,"Question is required":`Vraag is verplicht`,"Quote Reply":`Citaatantwoord`,"Reached the vote limit. Remove an existing vote first.":`Stemlimiet bereikt. Verwijder eerst een bestaande stem.`,"Recording format is not supported and cannot be reproduced":`Opnameformaat wordt niet ondersteund en kan niet worden gereproduceerd`,"Remind me":`Herinner me`,"Remind Me":`Herinner mij`,"Reminder set":`Herinnering ingesteld`,"Remove reminder":`Herinnering verwijderen`,"Remove save for later":`Verwijder 'Bewaren voor later'`,"Replied to a thread":`Heeft gereageerd in een thread`,Reply:`Antwoord`,"Reply to {{ authorName }}":`Antwoord aan {{ authorName }}`,"Reply to a message to start a thread":`Beantwoord een bericht om een thread te starten`,"Reply to Message":`Antwoord op bericht`,replyCount_one:`1 antwoord`,replyCount_other:`{{ count }} antwoorden`,Resend:`Opnieuw verzenden`,"Retry upload":`Upload opnieuw proberen`,"Review all options available in this poll":`Bekijk alle beschikbare opties in deze poll`,"Review comments submitted with poll answers":`Bekijk reacties die met pollantwoorden zijn ingediend`,"Review poll results and open an option to see detailed votes":`Bekijk pollresultaten en open een optie om gedetailleerde stemmen te zien`,"Review this message and choose whether to delete it, edit it, or send it anyway":`Bekijk dit bericht en kies of je het verwijdert, bewerkt of toch verstuurt`,"Review who voted for this option":`Bekijk wie op deze optie heeft gestemd`,"Save for later":`Bewaren voor later`,"Saved for later":`Bewaard voor later`,Search:`Zoeken`,"Search GIFs":`GIF's zoeken`,"search-results-header-filter-source-button-label--channels":`kanalen`,"search-results-header-filter-source-button-label--messages":`berichten`,"search-results-header-filter-source-button-label--users":`gebruikers`,"Searching for {{ searchSourceType }}...":`Zoeken naar {{ searchSourceType }}...`,"Searching...":`Zoeken...`,searchResultsCount_one:`1 resultaat`,searchResultsCount_other:`{{ count }} resultaten`,"Select a thread to continue the conversation":`Selecteer een thread om het gesprek voort te zetten`,"Select more than one option":`Selecteer meer dan één optie`,"Select one":`Selecteer er een`,"Select one or more":`Selecteer een of meer`,"Select up to {{count}}_one":`Selecteer tot {{count}}`,"Select up to {{count}}_other":`Selecteer tot {{count}}`,"Select your current location and optionally enable live location sharing":`Selecteer je huidige locatie en schakel eventueel live locatiedeling in`,Send:`Verstuur`,"Send a message":`Stuur een bericht`,"Send a message to start the conversation":`Stuur een bericht om het gesprek te beginnen`,"Send Anyway":`Toch versturen`,"Send message request failed":`Verzoek om bericht te verzenden mislukt`,"Send poll":`Peiling versturen`,"Sending...":`Aan het verzenden...`,Sent:`Verzonden`,Share:`Delen`,"Share live location for":`Live locatie delen voor`,"Share Location":`Locatie delen`,"Shared live location":`Gedeelde live locatie`,"Shared location":`Gedeelde locatie`,Shuffle:`Schudden`,"size limit":`grootte limiet`,"Slow Mode ON":`Langzame modus aan`,"Slow mode, wait {{ seconds }}s...":`Langzame modus, wacht {{ seconds }}s...`,"Slow wait, wait {{ seconds }}s":`Langzame modus, wacht {{ seconds }}s`,"Slow wait, wait {{ seconds }}s...":`Langzame modus, wacht {{ seconds }}s...`,"Some of the files will not be accepted":`Sommige bestanden zullen niet worden geaccepteerd`,"Start t
500yping to search":`Begin met typen om te zoeken`,"Stop sharing":`Delen stoppen`,Submit:`Versturen`,"Suggest a new option to add to this poll":`Stel een nieuwe optie voor om aan deze poll toe te voegen`,"Suggest an option":`Stel een optie voor`,"Tap to remove":`Tik om te verwijderen`,"Tap to remove: {{ reactionName }}":`Tik om te verwijderen: {{ reactionName }}`,"Thinking...":`Denken...`,"this content could not be displayed":`Deze inhoud kan niet weergegeven worden`,"This field cannot be empty or contain only spaces":`Dit veld mag niet leeg zijn of alleen spaties bevatten`,"This message did not meet our content guidelines":`Dit bericht voldeed niet aan onze inhoudsrichtlijnen`,Thread:`Draadje`,"Thread has not been found":`Draadje niet gevonden`,"Thread reply":`Draadje antwoord`,"Thread Reply":`Draadje antwoord`,"ThreadListUnseenThreadsBanner/loading":`Laden...`,"ThreadListUnseenThreadsBanner/unreadThreads_one":`{{ count }} ongelezen thread`,"ThreadListUnseenThreadsBanner/unreadThreads_other":`{{ count }} ongelezen threads`,Threads:`Discussies`,"timestamp/ChannelPreviewTimestamp":`{{ timestamp | timestampFormatter(calendar: true; calendarFormats: { "sameDay": "LT", "lastDay": "[Gisteren]", "lastWeek": "dddd", "sameElse": "L" }) }}`,"timestamp/DateSeparator":`{{ timestamp | timestampFormatter(calendar: true; calendarFormats: { "sameDay": "[Vandaag]", "nextDay": "[Morgen]", "lastDay": "[Gisteren]", "nextWeek": "dddd", "lastWeek": "[Laatste] dddd", "sameElse": "ddd, D MMM" }) }}`,"timestamp/LiveLocation":`{{ timestamp | timestampFormatter(calendar: true) }}`,"timestamp/MessageTimestamp":`{{ timestamp | timestampFormatter(calendar: false; format: HH:mm) }}`,"timestamp/PollVote":`{{ timestamp | timestampFormatter(relativeCompact: true) }}`,"timestamp/PollVoteTooltip":`{{ timestamp | timestampFormatter(calendar: true) }}`,"timestamp/relativeDaysAgo":`{{ count }}d ago`,"timestamp/relativeToday":`Vandaag`,"timestamp/relativeWeeksAgo":`{{ count }}w ago`,"timestamp/relativeYesterday":`Gisteren`,"timestamp/ReminderNotification":`{{ timestamp | timestampFormatter(calendar: true; calendarFormats: { "sameDay": "[Today] [at] HH:mm", "nextDay": "[Tomorrow] [at] HH:mm", "lastDay": "[Yesterday] [at] HH:mm", "nextWeek": "dddd [at] HH:mm", "lastWeek": "[Last] dddd [at] HH:mm", "sameElse": "ddd, D MMM [at] HH:mm" }) }}`,"timestamp/SystemMessage":`{{ timestamp | timestampFormatter(format: dddd L) }}`,"To start recording, allow the camera access in your browser":`Om te beginnen met opnemen, sta toegang tot de camera toe in uw browser`,"To start recording, allow the microphone access in your browser":`Om te beginnen met opnemen, sta toegang tot de microfoon toe in uw browser`,totalVoteCount_one:`1 stem in totaal`,totalVoteCount_other:`{{ count }} stemmen in totaal`,Translated:`Vertaald`,"Translated from {{ language }}":`Vertaald uit {{ language }}`,"translationBuilderTopic/notification":`{{value, notification}}`,"Type a number from 2 to 10":`Typ een getal van 2 tot 10`,Unarchive:`Uit archief halen`,"unban-command-args":`[@gebruikersnaam]`,"unban-command-description":`Een gebruiker debannen`,"Unblock User":`Gebruiker deblokkeren`,"unknown error":`onbekende fout`,Unmute:`Dempen opheffen`,"unmute-command-args":`[@gebruikersnaam]`,"unmute-command-description":`Een gebruiker niet meer dempen`,Unpin:`Losmaken`,"Unread messages":`Ongelezen berichten`,"Unsupported attachment":`Niet-ondersteunde bijlage`,"unsupported file type":`niet-ondersteund bestandstype`,Update:`Bijwerken`,"Update the comment attached to your poll answer":`Werk de reactie bij die aan je pollantwoord is toegevoegd`,"Update your comment":`Werk je opmerking bij`,"Upload blocked":`Upload geblokkeerd`,"Upload error":`Uploadfout`,"Upload failed":`Upload mislukt`,'Upload type: "{{ type }}" is not allowed':`Uploadtype: "{{ type }}" is niet toegestaan`,"User blocked":`Gebruiker geblokkeerd`,"User unblocked":`Gebruiker gedeblokkeerd`,"User uploaded content":`Gebruikersgeüploade inhoud`,Video:`Video`,videoCount_one:`Video`,videoCount_other:`{{ count }} video's`,View:`Bekijken`,"View {{count}}
500 comments_one":`Bekijk {{count}} opmerkingen`,"View {{count}} comments_other":`Bekijk {{count}} opmerkingen`,"View all":`Alles bekijken`,"View original":`Origineel bekijken`,"View results":`Bekijk resultaten`,"View translation":`Vertaling bekijken`,"Voice message":`Spraakbericht`,"Voice message {{ duration }}":`Spraakbericht {{ duration }}`,"Voice message deleted":`Spraakbericht verwijderd`,voiceMessageCount_one:`Spraakbericht`,voiceMessageCount_other:`{{ count }} spraakberichten`,"Vote ended":`Stemmen beëindigd`,Votes:`Stemmen`,"Wait until all attachments have uploaded":`Wacht tot alle bijlagen zijn geüpload`,"Waiting for network…":`Wachten op netwerk…`,You:`Jij`,"You've reached the maximum number of files":`Je hebt het maximale aantal bestanden bereikt`},Phe={"{{ commaSeparatedUsers }} and {{ moreCount }} more":`{{ commaSeparatedUsers }} e mais {{ moreCount }}`,"{{ commaSeparatedUsers }}, and {{ lastUser }}":`{{ commaSeparatedUsers }} e {{ lastUser }}`,"{{ count }} files_one":`{{ count }} arquivo`,"{{ count }} files_many":`{{ count }} arquivos`,"{{ count }} files_other":`{{ count }} arquivos`,"{{ count }} people are typing_one":`{{ count }} pessoa está digitando`,"{{ count }} people are typing_many":`{{ count }} pessoas estão digitando`,"{{ count }} people are typing_other":`{{ count }} pessoas estão digitando`,"{{ count }} photos_one":`{{ count }} foto`,"{{ count }} photos_many":`{{ count }} fotos`,"{{ count }} photos_other":`{{ count }} fotos`,"{{ count }} reactions_one":`{{ count }} reação`,"{{ count }} reactions_many":`{{ count }} reações`,"{{ count }} reactions_other":`{{ count }} reações`,"{{ count }} videos_one":`{{ count }} vídeo`,"{{ count }} videos_many":`{{ count }} vídeos`,"{{ count }} videos_other":`{{ count }} vídeos`,"{{ firstUser }} and {{ secondUser }}":`{{ firstUser }} e {{ secondUser }}`,"{{ imageCount }} more":`{{ imageCount }} mais`,"{{ memberCount }} members":`{{ memberCount }} membros`,"{{ typing }} are typing":`{{ typing }} estão digitando`,"{{ typing }} is typing":`{{ typing }} está digitando`,"{{ user }} has been muted":`{{ user }} foi silenciado`,"{{ user }} has been unmuted":`{{ user }} foi reativado`,"{{ user }} is typing...":`{{ user }} está digitando...`,"{{ users }} and {{ user }} are typing...":`{{ users }} e {{ user }} estão digitando...`,"{{ users }} and more are typing...":`{{ users }} e mais estão digitando...`,"{{ watcherCount }} online":`{{ watcherCount }} online`,"{{count}} new messages_one":`{{count}} nova mensagem`,"{{count}} new messages_many":`{{count}} novas mensagens`,"{{count}} new messages_other":`{{count}} novas mensagens`,"{{count}} unread_one":`{{count}} não lido`,"{{count}} unread_many":`{{count}} não lidos`,"{{count}} unread_other":`{{count}} não lidos`,"{{count}} votes_one":`{{count}} voto`,"{{count}} votes_many":`{{count}} votos`,"{{count}} votes_other":`{{count}} votos`,"+{{ imageCount }}":`+{{ imageCount }}`,"+{{count}} more options_one":`+{{count}} opção a mais`,"+{{count}} more options_many":`+{{count}} opções a mais`,"+{{count}} more options_other":`+{{count}} opções a mais`,"🏙 Attachment...":`🏙 Anexo...`,"📊 {{createdBy}} created: {{ pollName}}":`📊 {{createdBy}} criou: {{ pollName}}`,"📊 {{votedBy}} voted: {{pollOptionText}}":`📊 {{votedBy}} votou: {{pollOptionText}}`,"📍Shared location":`📍Localização compartilhada`,"Add a comment":`Adicionar um comentário`,"Add a comment to your poll answer":`Adicione um comentário à sua resposta da enquete`,"Add an option":`Adicionar uma opção`,"Add reaction":`Adicionar reação`,"All results loaded":`Todos os resultados carregados`,"Allow access to camera":`Permitir acesso à câmera`,"Allow access to microphone":`Permitir acesso ao microfone`,"Allow comments":`Permitir comentários`,"Allow option suggestion":`Permitir sugestão de opção`,"Allow others to add comments":`Permitir que outros adicionem comentários`,"Also send as a direct message":`Também enviar como mensagem direta`,"Also send in channel":`Também enviar no canal`,"Also sent in channel":`Também enviado no canal`,"An error has occurred during recording":`Ocorreu um erro durante a gravação`,"An error has occurred during the recording processing":`Ocorreu um erro durante o processamento da gravação`,Anonymous:`Anônimo`,"Anonymous poll":`Enquete anônima`,Archive:`Arquivar`,"Are you sure you want to delete this message?":`Tem certeza de que deseja excluir esta mensagem?`,"aria/Attachment":`Anexo`,"aria/Attachment Actions":`Ações do anexo`,"aria/Audio position {{ elapsed }} of {{ duration }}":`Posição do áudio {{ elapsed }} de {{ duration }}`,"aria/Audio position {{ progress }} percent":`Posição do áudio {{ progress }} por cento`,"aria/Block User":`Bloquear usuário`,"aria/Bookmark Message":`Marcar mensagem`,"aria/Cancel recording":`Cancelar gravação`,"aria/Cancel Reply":`Cancelar resposta`,"aria/Cancel upload":`Cancelar upload`,"aria/Channel Actions":`Ações do canal`,"aria/Channel list":`Lista de canais`,"aria/Channel search results":`Resultados de pesquisa de canais`,"aria/Chat view tabs":`Abas da visualização do chat`,"aria/Clear search":`Limpar pesquisa`,"aria/Close callout dialog":`Fechar diálogo de destaque`,"aria/Close thread":`Fechar tópico`,"aria/Collapse sidebar":`Recolher barra lateral`,"aria/Command Suggestions":`Sugestões de comandos`,"aria/Complete recording":`Concluir gravação`,"aria/Copy Message Text":`Copiar texto da mensagem`,"aria/Decrease value":`Diminuir valor`,"aria/Delete Message":`Excluir mensagem`,"aria/Dismiss notification":`Dispensar notificação`,"aria/Download attachment":`Baixar anexo`,"aria/Edit Message":`Editar Mensagem`,"aria/Emoji picker":`Seletor de emojis`,"aria/Emoji Suggestions":`Sugestões de emojis`,"aria/Exit search":`Sair da pesquisa`,"aria/Expand sidebar":`Expandir barra lateral`,"aria/File input":`Entrada de arquivo`,"aria/File upload":`Carregar arquivo`,"aria/Flag Message":`Reportar mensagem`,"aria/Image failed to load":`Falha ao carregar a imagem`,"aria/Image input":`Entrada de imagem`,"aria/Increase value":`Aumentar valor`,"aria/Jump to latest message":`Ir para a mensagem mais recente`,"aria/Jump to quoted message":`Ir para a mensagem citada`,"aria/Load More Channels":`Carregar mais canais`,"aria/Mark Message Unread":`Marcar como não lida`,"aria/Mark messages as read":`Marcar mensagens como lidas`,"aria/Menu":`Menu`,"aria/Message Actions":`Ações da mensagem`,"aria/Message from {{ user }},":`Mensagem de {{ user }},`,"aria/Message Options":`Opções de mensagem`,"aria/Message,"
500:`Mensagem,`,"aria/Mute User":`Silenciar usuário`,"aria/Notifications":`Notificações`,"aria/Open Attachment Selector":`Abrir seletor de anexos`,"aria/Open Channel Actions Menu":`Abrir menu de ações do canal`,"aria/Open Menu":`Abrir menu`,"aria/Open Message Actions Menu":`Abrir menu de ações de mensagem`,"aria/Open Reaction Selector":`Abrir seletor de reações`,"aria/Open Thread":`Abrir tópico`,"aria/Pause":`Pausar`,"aria/Pause recording":`Pausar gravação`,"aria/Percent complete":`{{percent}} por cento concluído`,"aria/Pin Message":`Fixar mensagem`,"aria/Play":`Reproduzir`,"aria/Quote Message":`Citar mensagem`,"aria/Reaction list":`Lista de reações`,"aria/Remind Me Message":`Lembrar-me`,"aria/Remind Me Options":`Opções de lembrete`,"aria/Remove attachment":`Remover anexo`,"aria/Remove location attachment":`Remover anexo de localização`,"aria/Remove option":`Remover opção`,"aria/Remove Reminder":`Remover lembrete`,"aria/Remove Save For Later":`Remover Salvar para depois`,"aria/Resend Message":`Reenviar mensagem`,"aria/Resume recording":`Retomar gravação`,"aria/Retry upload":`Tentar upload novamente`,"aria/Review bounced message":`Revisar mensagem devolvida`,"aria/Search results":`Resultados da pesquisa`,"aria/Search results header filter button for: {{ source }}":`Botão de filtro do cabeçalho dos resultados da pesquisa para: {{ source }}`,"aria/Seek audio position":`Buscar posição do áudio`,"aria/Select Channel: {{ channelName }}":`Selecionar canal: {{ channelName }}`,"aria/Select Reaction: {{ reactionName }}":`Selecionar reação: {{ reactionName }}`,"aria/Select User Channel: {{ name }}":`Selecionar canal do usuário: {{ name }}`,"aria/Send":`Enviar`,"aria/Show preview":`Mostrar prévia`,"aria/Start recording audio":`Iniciar gravação de áudio`,"aria/Stop AI Generation":`Parar geração de IA`,"aria/Suggestions":`Sugestões`,"aria/Thread list":`Lista de tópicos`,"aria/Unblock User":`Desbloquear usuário`,"aria/Unmute User":`Ativar som`,"aria/Unpin Message":`Desfixar mensagem`,"aria/User Suggestions":`Sugestões de usuários`,"Ask a question":`Faça uma pergunta`,Attach:`Anexar`,"Attach files":`Anexar arquivos`,Attachment:`Anexo`,"Attachment upload blocked due to {{reason}}":`Upload de anexo bloqueado devido a {{reason}}`,"Attachment upload failed due to {{reason}}":`Upload de anexo falhou devido a {{reason}}`,Back:`Voltar`,"ban-command-args":`[@nomedeusuário] [texto]`,"ban-command-description":`Banir um usuário`,"Block User":`Bloquear usuário`,Cancel:`Cancelar`,"Cannot seek in the recording":`Não é possível buscar na gravação`,"Channel archived":`Canal arquivado`,"Channel Missing":`Canal ausente`,"Channel muted":`Canal silenciado`,"Channel pinned":`Canal fixado`,"Channel unarchived":`Canal desarquivado`,"Channel unmuted":`Silêncio do canal desativado`,"Channel unpinned":`Canal desafixado`,Channels:`Canais`,Chats:`Conversas`,"Choose between 2 to 10 options":`Escolha entre 2 a 10 opções`,Close:`Fechar`,"Close dialog":`Fechar diálogo`,"Close emoji picker":`Fechar seletor de emoji`,"Close prompt: {{ title }}":`Fechar prompt: {{ title }}`,"Command not available while editing":`Comando não disponível durante a edição`,"Command not available while replying":`Comando não disponível durante a resposta`,Commands:`Comandos`,"Commands matching":`Comandos correspondentes`,"Connection failure, reconnecting now...":`Falha de conexão, reconectando agora...`,"Copy Message":`Copiar mensagem`,Create:`Criar`,"Create a question, add options, and configure poll settings":`Crie uma pergunta, adicione opções e configure as definições da enquete`,"Create poll":`Criar enquete`,"Current location":`Localização atual`,Delete:`Excluir`,"Delete for me":`Excluir para mim`,"Delete message":`Excluir mensagem`,Delivered:`Entregue`,"Direct message":`Mensagem direta`,"Do you want to end this poll now? Nobody will be able to vote in this poll anymore.":`Deseja encerrar esta enquete agora? Ninguém poderá mais votar nesta enquete.`,"Download All":`Baixar tudo`,"Download Attachment":`Baixar anexo`,"Download attachment {{ name }}":`Baixar anexo {{ name }}`,"Drag your files here":`Arraste seus arquivos aqui`,"Drag your files here to add to your post":`Arraste seus arquivos aqui para adicionar ao seu post`,"Due {{ timeLeft }}":`Vence em {{ timeLeft }}`,"Due since {{ dueSince }}":`Vencido desde {{ dueSince }}`,"duration/Message reminder":`{{ milliseconds | durationFormatter(withSuffix: true) }}`,"duration/Remind Me":`{{ milliseconds | durationFormatter(withSuffix: true) }}`,"duration/Share Location":`{{ milliseconds | durationFormatter }}`,"Edit Message":`Editar Mensagem`,"Edit message request failed":`O pedido de edição da mensagem falhou`,Edited:`Editada`,"Emoji matching":`Emoji correspondente`,"Empty message...":`Mensagem vazia...`,End:`Fim`,"End poll":`Encerrar enquete`,"End this poll?":`Encerrar esta enquete?`,"End vote":`Encerrar votação`,"Enforce unique vote is enabled":`Voto único está habilitado`,Error:`Erro`,"Error adding flag":`Erro ao reportar`,"Error c
500onnecting to chat, refresh the page to try again.":`Erro ao conectar ao bate-papo, atualize a página para tentar novamente.`,"Error deleting message":`Erro ao deletar mensagem`,"Error fetching reactions":`Erro ao carregar reações`,"Error marking message unread. Cannot mark unread messages older than the newest 100 channel messages.":`Erro ao marcar a mensagem como não lida. Não é possível marcar mensagens não lidas mais antigas do que as 100 mensagens mais recentes do canal.`,"Error muting a user ...":`Erro ao silenciar um usuário...`,"Error pinning message":`Erro ao fixar mensagem`,"Error removing message pin":`Erro ao remover o PIN da mensagem`,"Error reproducing the recording":`Erro ao reproduzir a gravação`,"Error starting recording":`Erro ao iniciar a gravação`,"Error unmuting a user ...":`Erro ao ativar o som de um usuário...`,"Error uploading attachment":`Erro ao carregar o anexo`,"Error uploading file":`Erro ao enviar arquivo`,"Error uploading image":`Erro ao carregar a imagem`,"Error: {{ errorMessage }}":`Erro: {{ errorMessage }}`,"Exit command {{ command }}":`Sair do comando {{ command }}`,"Failed to block user":`Falha ao bloquear o usuário`,"Failed to create the poll":`Falha ao criar a pesquisa`,"Failed to create the poll due to {{reason}}":`Falha ao criar a enquete devido a {{reason}}`,"Failed to delete the message":`Falha ao excluir a mensagem`,"Failed to end the poll":`Falha ao encerrar a enquete`,"Failed to end the poll due to {{reason}}":`Falha ao encerrar a enquete devido a {{reason}}`,"Failed to jump to the first unread message":`Falha ao pular para a primeira mensagem não lida`,"Failed to leave channel":`Falha ao sair do canal`,"Failed to load channels":`Falha ao carregar os canais`,"Failed to load more channels":`Falha ao carregar mais canais`,"Failed to mark channel as read":`Falha ao marcar o canal como lido`,"Failed to play the recording":`Falha ao reproduzir a gravação`,"Failed to retrieve location":`Falha ao obter localização`,"Failed to share location":`Falha ao compartilhar localização`,"Failed to update channel archive status":`Falha ao atualizar o status de arquivamento do canal`,"Failed to update channel mute status":`Falha ao atualizar o status de mudo do canal`,"Failed to update channel pinned status":`Falha ao atualizar o status de fixação do canal`,File:`Arquivo`,"File is required for upload attachment":`Arquivo é necessário para enviar o anexo`,"File is too large: {{ size }}, maximum upload size is {{ limit }}":`O arquivo é muito grande: {{ size }}, o tamanho máximo de upload é {{ limit }}`,"File too large":`Arquivo muito grande`,fileCount_one:`1 arquivo`,fileCount_many:`{{ count }} arquivos`,fileCount_other:`{{ count }} arquivos`,Flag:`Reportar`,"Generating...":`Gerando...`,"giphy-command-args":`[texto]`,"giphy-command-description":`Postar um gif aleatório no canal`,"Hide who voted":`Ocultar quem votou`,Image:`Imagem`,imageCount_one:`Imagem`,imageCount_many:`{{ count }} imagens`,imageCount_other:`{{ count }} imagens`,"Instant commands":`Comandos instantâneos`,"language/af":`Africâner`,"language/am":`Amárico`,"language/ar":`Árabe`,"language/az":`Azerbaijano`,"language/bg":`Búlgaro`,"language/bn":`Bengali`,"language/bs":`Bósnio`,"language/cs":`Tcheco`,"language/da":`Dinamarquês`,"language/de":`Alemão`,"language/el":`Grego`,"language/en":`Inglês`,"language/es":`Espanhol`,"language/es-MX":`Espanhol (México)`,"language/et":`Estoniano`,"language/fa":`Persa`,"language/fa-AF":`Dari`,"language/fi":`Finlandês`,"language/fr":`Francês`,"language/fr-CA":`Francês (Canadá)`,"language/ha":`Hauçá`,"language/he":`Hebraico`,"language/hi":`Hindi`,"language/hr":`Croata`,"language/ht":`Crioulo haitiano`,"language/hu":`Húngaro`,"language/id":`Indonésio`,"language/it":`Italiano`,"language/ja":`Japonês`,"language/ka":`Georgiano`,"language/ko":`Coreano`,"language/lt":`Lituano`,"language/lv":`Letão`,"language/ms":`Malaio`,"language/nl":`Holandês`,"language/no":`Norueguês`,"language/pl":`Polonês`,"language/ps":`Pashto`,"language/pt":`Português`,"language/ro":`Romeno`,"language/ru":`Russo`,"language/sk":`Eslovaco`,"language/sl":`Esloveno`,"language/so":`Somali`,"language/sq":`Albanês`,"language/sr":`Sérvio`,"language/sv":`Sueco`,"language/sw":`Suaíli`,"language/ta":`Tâmil`,"language/th":`Tailandês`,"language/tl":`Tagalo`,"language/tr":`Turco`,"language/uk":`Ucraniano`,"language/ur":`Urdu`,"language/vi":`Vietnamita`,"language/zh":`Chinês (simplificado)`,"language/zh-TW":`Chinês (tradicional)`,"Leave Channel":`Sair do canal`,"Left channel":`Canal abandonado`,"Let others add options":`Permitir que outros adicionem opções`,"Limit votes per person":`Limitar votos por pessoa`,Link:`Link`,linkCount_one:`Link`,linkCount_many:`{{ count }} links`,linkCount_other:`{{ count }} links`,live:`ao vivo`,"Live for {{duration}}":`Ao vivo por {{duration}}`,"Live location":`Localização ao vivo`,"Live until {{ timestamp }}":`Ao vivo até {{ timestamp }}`,"Load more":`Carregar mais`,"Local upload attachment missing local id":`Anexo de envio local sem id local`,Location:`Localização`,"Location sharing ended":`Compartilhamento de localização encerrado`,"Location: {{ coordinates }}":`Localização: {{ coordinates }}`,"Mark as unread":`Marcar como não lida`,"Maximum number of votes (from 2 to 10)":`Número máximo de votos (de 2 a 10)`,"Maximum votes per person":`Máximo de votos por pessoa`,Menu:`Menu`,"Message deleted":`Mensagem apagada`,"Message failed to send":`Falha ao enviar a mensagem`,"Message has been successfully flagged":`A mensagem foi reportada com sucesso`,"Message marked as unread":`Mensagem marcada como não lida`,"Message pinned":`Mensagem fixada`,"Message unpinned":`Mensagem desafixada`,"Message was blocked by moderation policies":`A mensagem foi bloqueada pelas políticas de moderação`,"Messages have been marked unread.":`Mensagens foram marcadas como não lidas.`,"Missing permissions to upload the attachment":`Faltando permissões para enviar o anexo`,"Multiple votes":`Votos múltiplos`,Mute:`Silenciar`,"mute-command-args":`[@nomedeusuário]`,"mute-command-description":`Silenciar um usuário`,"network error":`erro de rede`,New:`Novo`,"New message from {{user}}":`Nova mensagem de {{user}}`,"New Messages!":`Novas Mensagens!`,"Next image":`Próxima imagem`,"No chats here yet…":`Ainda não há conversas aqui...`,"No conversations yet":`Ainda não há conversas`,"No items exist":`Não existem itens`,"No results found":`Nenhum resultado encontrado`,"Nobody will be able to vote in this poll anymore.":`Ninguém mais poderá votar nesta pesquisa.`,"Nothing yet...":`
500Nada ainda...`,Offline:`Offline`,Ok:`OK`,Online:`Online`,"Only numbers are allowed":`Apenas números são permitidos`,"Only visible to you":`Visível apenas para você`,"Open emoji picker":`Abrir seletor de emoji`,"Open gallery at image {{ index }}":`Abrir galeria na imagem {{ index }}`,"Open image in gallery":`Abrir imagem na galeria`,"Open location in a map":`Abrir localização em um mapa`,"Option already exists":`Opção já existe`,"Option is empty":`A opção está vazia`,Options:`Opções`,Original:`Original`,"People matching":`Pessoas correspondentes`,Photo:`Foto`,Pin:`Fixar`,"Pinned by {{ name }}":`Fixado por {{ name }}`,"Pinned by You":`Fixado por você`,"placeholder/PollComment":`O seu comentário`,"placeholder/PollOptionSuggestion":`Introduza uma nova opção`,"Play video":`Reproduzir vídeo`,"Playback speed {{ rate }}x":`Velocidade de reprodução {{ rate }}x`,Poll:`Enquete`,"Poll comments":`Comentários da pesquisa`,"Poll ended":`Enquete encerrada`,"Poll options":`Opções da pesquisa`,"Poll results":`Resultados da pesquisa`,"Previous image":`Imagem anterior`,Question:`Pergunta`,"Question {{ optionOrderNumber}}":`Pergunta {{ optionOrderNumber}}`,"Question is required":`A pergunta é obrigatória`,"Quote Reply":`Responder com citação`,"Reached the vote limit. Remove an existing vote first.":`Limite de votos atingido. Remova um voto existente primeiro.`,"Recording format is not supported and cannot be reproduced":`Formato de gravação não é suportado e não pode ser reproduzido`,"Remind me":`Lembrar-me`,"Remind Me":`Lembrar-me`,"Reminder set":`Lembrete definido`,"Remove reminder":`Remover lembrete`,"Remove save for later":`Remover Salvar para depois`,"Replied to a thread":`Respondeu em um tópico`,Reply:`Responder`,"Reply to {{ authorName }}":`Responder a {{ authorName }}`,"Reply to a message to start a thread":`Responda a uma mensagem para iniciar um thread`,"Reply to Message":`Responder à mensagem`,replyCount_one:`1 resposta`,replyCount_many:`{{ count }} respostas`,replyCount_other:`{{ count }} respostas`,Resend:`Reenviar`,"Retry upload":`Tentar enviar novamente`,"Review all options available in this poll":`Revise todas as opções disponíveis nesta enquete`,"Review comments submitted with poll answers":`Revise comentários enviados com respostas da enquete`,"Review poll results and open an option to see detailed votes":`Revise os resultados da enquete e abra uma opção para ver votos detalhados`,"Review this message and choose whether to delete it, edit it, or send it anyway":`Revise esta mensagem e escolha se deseja excluí-la, editá-la ou enviá-la mesmo assim`,"Review who voted for this option":`Revise quem votou nesta opção`,"Save for later":`Salvar para depois`,"Saved for later":`Salvo para depois`,Search:`Buscar`,"Search GIFs":`Pesquisar GIFs`,"search-results-header-filter-source-button-label--channels":`canais`,"search-results-header-filter-source-button-label--messages":`mensagens`,"search-results-header-filter-source-button-label--users":`usuários`,"Searching for {{ searchSourceType }}...":`Buscando {{ searchSourceType }}...`,"Searching...":`Buscando...`,searchResultsCount_one:`1 resultado`,searchResultsCount_many:`{{ count }} resultados`,searchResultsCount_other:`{{ count }} resultados`,"Select a thread to continue the conversation":`Selecione uma thread para continuar a conversa`,"Select more than one option":`Selecionar mais de uma opção`,"Select one":`Selecionar um`,"Select one or more":`Selecionar um ou mais`,"Select up to {{count}}_one":`Selecionar até {{count}}`,"Select up to {{count}}_many":`Selecionar até {{count}}`,"Select up to {{count}}_other":`Selecionar até {{count}}`,"Select your current location and optionally enable live location sharing":`Selecione sua localização atual e, opcionalmente, ative o compartilhamento de localização ao vivo`,Send:`Enviar`,"Send a message":`Envie uma mensagem`,"Send a message to start the conversation":`Envie uma mensagem para iniciar a conversa`,"Send Anyway":`Enviar de qualquer forma`,"Send message request failed":`O pedido de envio da mensagem falhou`,"Send poll":`Enviar enquete`,"Sending...":`Enviando...`,Sent:`Enviado`,Share:`Compartilhar`,"Share live location for":`Compartilhar localização ao vivo por`,"Share Location":`Compartilhar localização`,"Shared live location":`Localização ao vivo compartilhada`,"Shared location":`Localização compartilhada`,Shuffle:`Embaralhar`,"size limit":`limite de tamanho`,"Slow Mode ON":`Modo lento LIGADO`,"Slow mode, wait {{ seconds }}s...":`Modo lento, aguarde {{ seconds }} s...`,"Some of the files will not be accepted":`Alguns arquivos não serão aceitos`,"Start t
500yping to search":`Comece a digitar para pesquisar`,"Stop sharing":`Parar de compartilhar`,Submit:`Enviar`,"Suggest a new option to add to this poll":`Sugira uma nova opção para adicionar a esta enquete`,"Suggest an option":`Sugerir uma opção`,"Tap to remove":`Toque para remover`,"Tap to remove: {{ reactionName }}":`Toque para remover: {{ reactionName }}`,"Thinking...":`Pensando...`,"this content could not be displayed":`este conteúdo não pôde ser exibido`,"This field cannot be empty or contain only spaces":`Este campo não pode estar vazio ou conter apenas espaços`,"This message did not meet our content guidelines":`Esta mensagem não corresponde às nossas diretrizes de conteúdo`,Thread:`Fio`,"Thread has not been found":`Fio não encontrado`,"Thread reply":`Resposta no fio`,"Thread Reply":`Resposta no fio`,"ThreadListUnseenThreadsBanner/loading":`Carregando...`,"ThreadListUnseenThreadsBanner/unreadThreads_one":`{{ count }} tópico não lido`,"ThreadListUnseenThreadsBanner/unreadThreads_many":`{{ count }} tópicos não lidos`,"ThreadListUnseenThreadsBanner/unreadThreads_other":`{{ count }} tópicos não lidos`,Threads:`Tópicos`,"timestamp/ChannelPreviewTimestamp":`{{ timestamp | timestampFormatter(calendar: true; calendarFormats: { "sameDay": "LT", "lastDay": "[Ontem]", "lastWeek": "dddd", "sameElse": "L" }) }}`,"timestamp/DateSeparator":`{{ timestamp | timestampFormatter(calendar: true; calendarFormats: { "sameDay": "[Hoje]", "nextDay": "[Amanhã]", "lastDay": "[Ontem]", "nextWeek": "dddd", "lastWeek": "[Último] dddd", "sameElse": "ddd, D MMM" }) }}`,"timestamp/LiveLocation":`{{ timestamp | timestampFormatter(calendar: true) }}`,"timestamp/MessageTimestamp":`{{ timestamp | timestampFormatter(calendar: false; format: HH:mm) }}`,"timestamp/PollVote":`{{ timestamp | timestampFormatter(relativeCompact: true) }}`,"timestamp/PollVoteTooltip":`{{ timestamp | timestampFormatter(calendar: true) }}`,"timestamp/relativeDaysAgo":`{{ count }}d ago`,"timestamp/relativeToday":`Hoje`,"timestamp/relativeWeeksAgo":`{{ count }}w ago`,"timestamp/relativeYesterday":`Ontem`,"timestamp/ReminderNotification":`{{ timestamp | timestampFormatter(calendar: true; calendarFormats: { "sameDay": "[Today] [at] HH:mm", "nextDay": "[Tomorrow] [at] HH:mm", "lastDay": "[Yesterday] [at] HH:mm", "nextWeek": "dddd [at] HH:mm", "lastWeek": "[Last] dddd [at] HH:mm", "sameElse": "ddd, D MMM [at] HH:mm" }) }}`,"timestamp/SystemMessage":`{{ timestamp | timestampFormatter(format: dddd L) }}`,"To start recording, allow the camera access in your browser":`Para começar a gravar, permita o acesso à câmera no seu navegador`,"To start recording, allow the microphone access in your browser":`Para começar a gravar, permita o acesso ao microfone no seu navegador`,totalVoteCount_one:`1 voto no total`,totalVoteCount_many:`{{ count }} votos no total`,totalVoteCount_other:`{{ count }} votos no total`,Translated:`Traduzido`,"Translated from {{ language }}":`Traduzido de {{ language }}`,"translationBuilderTopic/notification":`{{value, notification}}`,"Type a number from 2 to 10":`Digite um número de 2 a 10`,Unarchive:`Desarquivar`,"unban-command-args":`[@nomedeusuário]`,"unban-command-description":`Desbanir um usuário`,"Unblock User":`Desbloquear usuário`,"unknown error":`erro desconhecido`,Unmute:`Ativar som`,"unmute-command-args":`[@nomedeusuário]`,"unmute-command-description":`Retirar o silenciamento de um usuário`,Unpin:`Desfixar`,"Unread messages":`Mensagens não lidas`,"Unsupported attachment":`Anexo não suportado`,"unsupported file type":`tipo de arquivo não suportado`,Update:`Atualizar`,"Update the comment attached to your poll answer":`Atualize o comentário anexado à sua resposta da enquete`,"Update your comment":`Atualizar seu comentário`,"Upload blocked":`Envio bloqueado`,"Upload error":`Erro no envio`,"Upload failed":`Falha no envio`,'Upload type: "{{ type }}" is not allowed':`Tipo de upload: "{{ type }}" não é permitido`,"User blocked":`Usuário bloqueado`,"User unblocked":`Usuário desbloqueado`,"User uploaded content":`Conteúdo enviado pelo usuário`,Video:`Vídeo`,videoCount_one:`Vídeo`,videoCount_many:`{{ count }} vídeos`,videoCount_other:`{{ count }}
500 vídeos`,View:`Ver`,"View {{count}} comments_one":`Ver {{count}} comentário`,"View {{count}} comments_many":`Ver {{count}} comentários`,"View {{count}} comments_other":`Ver {{count}} comentários`,"View all":`Ver tudo`,"View original":`Ver original`,"View results":`Ver resultados`,"View translation":`Ver tradução`,"Voice message":`Mensagem de voz`,"Voice message {{ duration }}":`Mensagem de voz {{ duration }}`,"Voice message deleted":`Mensagem de voz excluída`,voiceMessageCount_one:`Mensagem de voz`,voiceMessageCount_many:`{{ count }} mensagens de voz`,voiceMessageCount_other:`{{ count }} mensagens de voz`,"Vote ended":`Votação encerrada`,Votes:`Votos`,"Wait until all attachments have uploaded":`Espere até que todos os anexos tenham sido carregados`,"Waiting for network…":`Aguardando rede…`,You:`Você`,"You've reached the maximum number of files":`Você atingiu o número máximo de arquivos`},Fhe={"{{ commaSeparatedUsers }} and {{ moreCount }} more":`{{ commaSeparatedUsers }} и {{ moreCount }} еще`,"{{ commaSeparatedUsers }}, and {{ lastUser }}":`{{ commaSeparatedUsers }} и {{ lastUser }}`,"{{ count }} files_one":`{{ count }} файл`,"{{ count }} files_few":`{{ count }} файла`,"{{ count }} files_many":`{{ count }} файлов`,"{{ count }} files_other":`{{ count }} файла`,"{{ count }} people are typing_one":`{{ count }} человек печатает`,"{{ count }} people are typing_few":`{{ count }} человека печатают`,"{{ count }} people are typing_many":`{{ count }} человек печатают`,"{{ count }} people are typing_other":`{{ count }} человека печатают`,"{{ count }} photos_one":`{{ count }} фото`,"{{ count }} photos_few":`{{ count }} фото`,"{{ count }} photos_many":`{{ count }} фото`,"{{ count }} photos_other":`{{ count }} фото`,"{{ count }} reactions_one":`{{ count }} реакция`,"{{ count }} reactions_few":`{{ count }} реакции`,"{{ count }} reactions_many":`{{ count }} реакций`,"{{ count }} reactions_other":`{{ count }} реакций`,"{{ count }} videos_one":`{{ count }} видео`,"{{ count }} videos_few":`{{ count }} видео`,"{{ count }} videos_many":`{{ count }} видео`,"{{ count }} videos_other":`{{ count }} видео`,"{{ firstUser }} and {{ secondUser }}":`{{ firstUser }} и {{ secondUser }}`,"{{ imageCount }} more":`Ещё {{ imageCount }}`,"{{ memberCount }} members":`{{ memberCount }} участников`,"{{ typing }} are typing":`{{ typing }} печатают`,"{{ typing }} is typing":`{{ typing }} печатает`,"{{ user }} has been muted":`Вы отписались от уведомлений от {{ user }}`,"{{ user }} has been unmuted":`Уведомления от {{ user }} были включены`,"{{ user }} is typing...":`{{ user }} печатает...`,"{{ users }} and {{ user }} are typing...":`{{ users }} и {{ user }} печатают...`,"{{ users }} and more are typing...":`{{ users }} и другие печатают...`,"{{ watcherCount }} online":`{{ watcherCount }} в сети`,"{{count}} new messages_one":`{{count}} новое сообщение`,"{{count}} new messages_few":`{{count}} новых сообщения`,"{{count}} new messages_many":`{{count}} новых сообщений`,"{{count}} new messages_other":`{{count}} новых сообщений`,"{{count}} unread_one":`{{count}} непрочитанное`,"{{count}} unread_few":`{{count}} непрочитанных`,"{{count}} unread_many":`{{count}} непрочитанных`,"{{count}} unread_other":`{{count}} непрочитанных`,"{{count}} votes_one":`{{count}} голос`,"{{count}} votes_few":`{{count}} голоса`,"{{count}} votes_many":`{{count}} голосов`,"{{count}} votes_other":`{{count}} голосов`,"+{{ imageCount }}":`+{{ imageCount }}`,"+{{count}} more options_one":`+ещё {{count}} вариант`,"+{{count}} more options_few":`+ещё {{count}} варианта`,"+{{count}} more options_many":`+ещё {{count}} вариантов`,"+{{count}} more options_other":`+ещё {{count}} вариантов`,"🏙 Attachment...":`🏙 Вложение...`,"📊 {{createdBy}} created: {{ pollName}}":`📊 {{createdBy}} создал(а): {{ pollName}}`,"📊 {{votedBy}} voted: {{pollOptionText}}":`📊 {{votedBy}} проголосовал(а): {{pollOptionText}}`,"📍Shared location":`📍Общее местоположение`,"Add a comment":`Добавить комментарий`,"Add a comment to your poll answer":`Добавьте комментарий к вашему ответу в опросе`,"Add an option":`Добавить вариант`,"Add reaction":`Добавить реакцию`,"All results loaded":`Все результаты загружены`,"Allow access to camera":`Разрешить доступ к камере`,"Allow access to microphone":`Разрешить доступ к микрофону`,"Allow comments":`Разрешить комментарии`,"Allow option suggestion":`Разрешить предложение вариантов`,"Allow others to add comments":`Разрешить другим добавлять комментарии`,"Also send as a direct message":`Также отправить как личное сообщение`,"Also send in channel":`Также отправить в канал`,"Also sent in channel":`Также отправлено в канал`,"An error has occurred during recording":`Произошла ошибка во время записи`,"An error has occurred during the recording processing":`Произошла ошибка во время обработки записи`,Anonymous:`Аноним`,"Anonymous poll":`Анонимный опрос`,Archive:`Aрхивировать`,"Are you sure you want to delete this message?":`Вы уверены, что хотите удалить это сообщение?`,"aria/Attachment":`Вложение`,"aria/Attachment Actions":`Действия с вложением`,"aria/Audio position {{ elapsed }} of {{ duration }}":`Позиция аудио {{ elapsed }} из {{ duration }}`,"aria/Audio position {{ progress }} percent":`Позиция аудио {{ progress }} процентов`,"aria/Block User":`Заблокировать пользователя`,"aria/Bookmark Message":`Сохранить сообщение`,"aria/Cancel recording":`Отменить запись`,"aria/Cancel Reply":`Отменить ответ`,"aria/Cancel upload":`Отменить загрузку`,"aria/Channel Actions":`Действия канала`,"aria/Channel list":`Список каналов`,"aria/Channel search results":`Результаты поиска по каналам`,"aria/Chat view tabs":`Вкладки вида чата`,"aria/Clear search":`Очистить поиск`,"aria/Close callout dialog":`Закрыть диалог выноски`,"aria/Close thread":`Закрыть тему`,"aria/Collapse sidebar":`Свернуть боковую панель`,"aria/Command Suggestions":`Подсказки команд`,"aria/Complete recording":`Завершить запись`,"aria/Copy Message Text":`Копировать текст сообщения`,"aria/Decrease value":`Уменьшить значение`,"aria/Delete Message":`Удалить сообщение`,"aria/Dismiss notification":`Закрыть уведомление`,"aria/Download attachment":`Скачать вложение`,"aria/Edit Message":`Редактировать сообщение`,"aria/Emoji picker":`Выбор эмодзи`,"aria/Emoji Suggestions":`Подсказки эмодзи`,"aria/Exit search":`Выйти из поиска`,"aria/Expand sidebar":`Развернуть боковую панель`,"aria/File input":`Ввод файла`,"aria/File upload":`Загрузка файла`,"aria/Flag Message":`Пожаловаться на сообщение`,"aria/Image failed to load":`Не удалось загрузить изображение`,"aria/Image input":`Ввод изображения`,"aria/Increase value":`Увеличить значение`,"aria/Jump to latest message":`Перейти Ð
500º последнему сообщению`,"aria/Jump to quoted message":`Перейти к цитируемому сообщению`,"aria/Load More Channels":`Загрузить больше каналов`,"aria/Mark Message Unread":`Отметить как непрочитанное`,"aria/Mark messages as read":`Отметить сообщения как прочитанные`,"aria/Menu":`Меню`,"aria/Message Actions":`Действия с сообщением`,"aria/Message from {{ user }},":`Сообщение от {{ user }},`,"aria/Message Options":`Параметры сообщения`,"aria/Message,":`Сообщение,`,"aria/Mute User":`Отключить уведомления`,"aria/Notifications":`Уведомления`,"aria/Open Attachment Selector":`Открыть выбор вложений`,"aria/Open Channel Actions Menu":`Открыть меню действий канала`,"aria/Open Menu":`Открыть меню`,"aria/Open Message Actions Menu":`Открыть меню действий с сообщениями`,"aria/Open Reaction Selector":`Открыть селектор реакций`,"aria/Open Thread":`Открыть тему`,"aria/Pause":`Пауза`,"aria/Pause recording":`Приостановить запись`,"aria/Percent complete":`{{percent}} процентов завершено`,"aria/Pin Message":`Закрепить сообщение`,"aria/Play":`Воспроизвести`,"aria/Quote Message":`Цитировать сообщение`,"aria/Reaction list":`Список реакций`,"aria/Remind Me Message":`Напомнить мне`,"aria/Remind Me Options":`Параметры напоминания`,"aria/Remove attachment":`Удалить вложение`,"aria/Remove location attachment":`Удалить вложение местоположения`,"aria/Remove option":`Удалить вариант`,"aria/Remove Reminder":`Удалить напоминание`,"aria/Remove Save For Later":`Удалить «Сохранить на потом»`,"aria/Resend Message":`Отправить сообщение повторно`,"aria/Resume recording":`Возобновить запись`,"aria/Retry upload":`Повторить загрузку`,"aria/Review bounced message":`Проверить отклонённое сообщение`,"aria/Search results":`Результаты поиска`,"aria/Search results header filter button for: {{ source }}":`Кнопка фильтра заголовка результатов поиска для: {{ source }}`,"aria/Seek audio position":`Перемотать аудио`,"aria/Select Channel: {{ channelName }}":`Выбрать канал: {{ channelName }}`,"aria/Select Reaction: {{ reactionName }}":`Выбрать реакцию: {{ reactionName }}`,"aria/Select User Channel: {{ name }}":`Выбрать пользовательский канал: {{ name }}`,"aria/Send":`Отправить`,"aria/Show preview":`Показать предпросмотр`,"aria/Start recording audio":`Начать запись аудио`,"aria/Stop AI Generation":`Остановить генерацию ИИ`,"aria/Suggestions":`Подсказки`,"aria/Thread list":`Список тредов`,"aria/Unblock User":`Разблокировать пользователя`,"aria/Unmute User":`Включить уведомления`,"aria/Unpin Message":`Открепить сообщение`,"aria/User Suggestions":`Подсказки пользователей`,"Ask a question":`Задать вопрос`,Attach:`Прикрепить`,"Attach files":`Прикрепить файлы`,Attachment:`Вложение`,"Attachment upload blocked due to {{reason}}":`Загрузка вложения заблокирована из-за {{reason}}`,"Attachment upload failed due to {{reason}}":`Загрузка вложения не удалась из-за {{reason}}`,Back:`Назад`,"ban-command-args":`[@имяпользователя] [текст]`,"ban-command-description":`Заблокировать пользователя`,"Block User":`Заблокировать пользователя`,Cancel:`Отмена`,"Cannot seek in the recording":`Невозможно осуществить поиск в записи`,"Channel ar
500chived":`Канал в архиве`,"Channel Missing":`Канал не найден`,"Channel muted":`Канал заглушён`,"Channel pinned":`Канал закреплён`,"Channel unarchived":`Канал извлечён из архива`,"Channel unmuted":`Заглушение канала снято`,"Channel unpinned":`Канал откреплён`,Channels:`Каналы`,Chats:`Чаты`,"Choose between 2 to 10 options":`Выберите от 2 до 10 вариантов`,Close:`Закрыть`,"Close dialog":`Закрыть диалог`,"Close emoji picker":`Закрыть окно выбора смайлов`,"Close prompt: {{ title }}":`Закрыть запрос: {{ title }}`,"Command not available while editing":`Команда недоступна при редактировании`,"Command not available while replying":`Команда недоступна при ответе`,Commands:`Команды`,"Commands matching":`Соответствие команд`,"Connection failure, reconnecting now...":`Ошибка соединения, переподключение...`,"Copy Message":`Копировать сообщение`,Create:`Создать`,"Create a question, add options, and configure poll settings":`Создайте вопрос, добавьте варианты и настройте параметры опроса`,"Create poll":`Создать опрос`,"Current location":`Текущее местоположение`,Delete:`Удалить`,"Delete for me":`Удалить для меня`,"Delete message":`Удалить сообщение`,Delivered:`Отправлено`,"Direct message":`Личное сообщение`,"Do you want to end this poll now? Nobody will be able to vote in this poll anymore.":`Вы хотите завершить этот опрос сейчас? После этого никто не сможет голосовать в этом опросе.`,"Download All":`Скачать всё`,"Download Attachment":`Скачать вложение`,"Download attachment {{ name }}":`Скачать вложение {{ name }}`,"Drag your files here":`Перетащите ваши файлы сюда`,"Drag your files here to add to your post":`Перетащите ваши файлы сюда, чтобы добавить их в ваш пост`,"Due {{ timeLeft }}":`Просрочено в {{ timeLeft }}`,"Due since {{ dueSince }}":`Просрочено с {{ dueSince }}`,"duration/Message reminder":`{{ milliseconds | durationFormatter(withSuffix: true) }}`,"duration/Remind Me":`{{ milliseconds | durationFormatter(withSuffix: true) }}`,"duration/Share Location":`{{ milliseconds | durationFormatter }}`,"Edit Message":`Редактировать сообщение`,"Edit message request failed":`Не удалось изменить запрос сообщения`,Edited:`Отредактировано`,"Emoji matching":`Соответствие эмодзи`,"Empty message...":`Пустое сообщение...`,End:`Конец`,"End poll":`Завершить опрос`,"End this poll?":`Завершить этот опрос?`,"End vote":`Закончить голосование`,"Enforce unique vote is enabled":`Уникальное голосование включено`,Error:`Ошибка`,"Error adding flag":`Ошибка добавления флага`,"Error connecting to chat, refresh the page to try again.":`Ошибка подключения к чату, обновите страницу чтобы попробовать снова.`,"Error deleting message":`Ошибка при удалении сообщения`,"Error fetching reactions":`Ошибка при загрузке реакций`,"Error marking message unread. Cannot mark unread messages older than the newest 100 channel messages.":`Ошибка при отметке сообщения как непрочитанного. Невозможно отметить как непрочитанные сообщения старше последних 100 сообщений в канале.`,"Error muting a user ...":`Ошибка отключения уведомлений от пользователя...`,"Error pinning message":`Сообщение об ошибке при закреплении`,"Error removing message pin":`Ошибка при удалении булавки сообщения`,"Error reproducing the recording":`Ошибка воспроизведения записи`,"Error starting recording":`Ошибка при запуске записи`,"Error unmuting a user ...":`Ошибка включения уведомлений...`,"Error uploading attachment":`Ошибка при загрузке вложения`,"Error uploading file":`Ошибка при загрузке файла`,"Error uploading image":`Ошибка загрузки изображения`,"Error: {{ errorMessage }}":`Ошибка: {{ errorMessage }}`,"Exit command {{ command }}":`Выйти из команды {{ command }}`,"Failed to block user":`Не удалось заблокировать пользователя`,"Failed to create the poll":`Не удалось создать опрос`,"Failed to create the poll due to {{reason}}":`Не удалось создать опрос из-за {{reason}}`,"Failed to delete the message":`Не удалось удалить сообщение`,"Failed to end the poll":`Не удалось завершить опрос`,"Failed to end the poll due to {{reason}}":`Не удалось завершить опрос из-за {{reason}}`,"Failed to jump to the first unread message":`Не удалось перейти Ð
500º первому непрочитанному сообщению`,"Failed to leave channel":`Не удалось покинуть канал`,"Failed to load channels":`Не удалось загрузить каналы`,"Failed to load more channels":`Не удалось загрузить больше каналов`,"Failed to mark channel as read":`Не удалось пометить канал как прочитанный`,"Failed to play the recording":`Не удалось воспроизвести запись`,"Failed to retrieve location":`Не удалось получить местоположение`,"Failed to share location":`Не удалось поделиться местоположением`,"Failed to update channel archive status":`Не удалось обновить статус архивации канала`,"Failed to update channel mute status":`Не удалось обновить статус отключения звука канала`,"Failed to update channel pinned status":`Не удалось обновить статус закрепления канала`,File:`Файл`,"File is required for upload attachment":`Для загрузки вложения требуется файл`,"File is too large: {{ size }}, maximum upload size is {{ limit }}":`Файл слишком большой: {{ size }}, максимальный размер загрузки составляет {{ limit }}`,"File too large":`Файл слишком большой`,fileCount_four:`{{ count }} файла`,fileCount_one:`{{ count }} файл`,fileCount_few:`{{ count }} файла`,fileCount_many:`{{ count }} файлов`,fileCount_other:`{{ count }} файлов`,fileCount_three:`{{ count }} файла`,fileCount_two:`{{ count }} файла`,Flag:`Пожаловаться`,"Generating...":`Генерирую...`,"giphy-command-args":`[текст]`,"giphy-command-description":`Опубликовать случайную GIF-анимацию в канале`,"Hide who voted":`Скрыть, кто голосовал`,Image:`Изображение`,imageCount_one:`{{ count }} изображение`,imageCount_few:`{{ count }} изображения`,imageCount_many:`{{ count }} изображений`,imageCount_other:`{{ count }} изображений`,"Instant commands":`Мгновенные команды`,"language/af":`Африкаанс`,"language/am":`Амхарский`,"language/ar":`Арабский`,"language/az":`Азербайджанский`,"language/bg":`Болгарский`,"language/bn":`Бенгальский`,"language/bs":`Боснийский`,"language/cs":`Чешский`,"language/da":`Датский`,"language/de":`Немецкий`,"language/el":`Греческий`,"language/en":`Английский`,"language/es":`Испанский`,"language/es-MX":`Испанский (Мексика)`,"language/et":`Эстонский`,"language/fa":`Персидский`,"language/fa-AF":`Дари`,"language/fi":`Финский`,"language/fr":`Французский`,"language/fr-CA":`Французский (Канада)`,"language/ha":`Хауса`,"language/he":`Иврит`,"language/hi":`Хинди`,"language/hr":`Хорватский`,"language/ht":`Гаитянский креольский`,"language/hu":`Венгерский`,"language/id":`Индонезийский`,"language/it":`Итальянский`,"language/ja":`Японский`,"language/ka":`Грузинский`,"language/ko":`Корейский`,"language/lt":`Литовский`,"language/lv":`Латышский`,"language/ms":`Малайский`,"language/nl":`Нидерландский`,"language/no":`Норвежский`,"language/pl":`Польский`,"language/ps":`Пушту`,"language/pt":`Португальский`,"language/ro":`Румынский`,"language/ru":`Русский`,"language/sk":`Словацкий`,"language/sl":`Словенский`,"language/so":`Сомали`,"language/sq":`Албанский`,"language/sr":`Сербский`,"language/sv":`Шведский`,"language/sw":`Суахили`,"language/ta":`Тамильский`,"language/th":`Тайский`,"language/tl":`Тагальский`,"language/tr":`Турецкий`,"language/uk":`Украинский`,"language/ur":`Урду`,"language/vi":`Вьетнамский`,"language/zh":`Китайский (упрощённый)`,"language/zh-TW":`Китайский (традиционный)`,"Leave Channel":`Покин
500уть канал`,"Left channel":`Канал покинут`,"Let others add options":`Разрешить другим добавлять варианты`,"Limit votes per person":`Ограничить голоса на человека`,Link:`Линк`,linkCount_one:`{{ count }} линк`,linkCount_few:`{{ count }} линка`,linkCount_many:`{{ count }} линков`,linkCount_other:`{{ count }} линков`,live:`В прямом эфире`,"Live for {{duration}}":`В прямом эфире {{duration}}`,"Live location":`Местоположение в прямом эфире`,"Live until {{ timestamp }}":`В прямом эфире до {{ timestamp }}`,"Load more":`Загрузить больше`,"Local upload attachment missing local id":`У локального вложения нет локального id`,Location:`Местоположение`,"Location sharing ended":`Обмен местоположением завершен`,"Location: {{ coordinates }}":`Местоположение: {{ coordinates }}`,"Mark as unread":`Отметить как непрочитанное`,"Maximum number of votes (from 2 to 10)":`Максимальное количество голосов (от 2 до 10)`,"Maximum votes per person":`Максимум голосов на человека`,Menu:`Меню`,"Message deleted":`Сообщение удалено`,"Message failed to send":`Не удалось отправить сообщение`,"Message has been successfully flagged":`Жалоба на сообщение была принята`,"Message marked as unread":`Сообщение помечено как непрочитанное`,"Message pinned":`Сообщение закреплено`,"Message unpinned":`Сообщение откреплено`,"Message was blocked by moderation policies":`Сообщение было заблокировано модерацией`,"Messages have been marked unread.":`Сообщения были отмечены как непрочитанные.`,"Missing permissions to upload the attachment":`Отсутствуют разрешения для загрузки вложения`,"Multiple votes":`Несколько голосов`,Mute:`Отключить уведомления`,"mute-command-args":`[@имяпользователя]`,"mute-command-description":`Выключить микрофон у пользователя`,"network error":`ошибка сети`,New:`Новые`,"New message from {{user}}":`Новое сообщение от {{user}}`,"New Messages!":`Новые сообщения!`,"Next image":`Следующее изображение`,"No chats here yet…":`Здесь еще нет чатов...`,"No conversations yet":`Пока нет бесед`,"No items exist":`Элементов нет`,"No results found":`Результаты не найдены`,"Nobody will be able to vote in this poll anymore.":`Никто больше не сможет голосовать в этом опросе.`,"Nothing yet...":`Пока ничего нет...`,Offline:`Не в сети`,Ok:`Ок`,Online:`В сети`,"Only numbers are allowed":`Разрешены только цифры`,"Only visible to you":`Видно только вам`,"Open emoji picker":`Открыть выбор смайлов`,"Open gallery at image {{ index }}":`Открыть галерею на изображении {{ index }}`,"Open image in gallery":`Открыть изображение в галерее`,"Open location in a map":`Открыть местоположение на карте`,"Option already exists":`Вариант уже существует`,"Option is empty":`Вариант пуст`,Options:`Варианты`,Original:`Оригинал`,"People matching":`Совпадающие люди`,Photo:`Фото`,Pin:`Закрепить`,"Pinned by {{ name }}":`Закреплено: {{ name }}`,"Pinned by You":`Закреплено вами`,"placeholder/PollComment":`Ваш комментарий`,"placeholder/PollOptionSuggestion":`Введите новый вариант`,"Play video":`Воспроизвести видео`,"Playback speed {{ rate }}x":`Скорость воспроизведения {{ rate }}x`,Poll:`Опрос`,"Poll comments":`Комментарии к опросу`,"Poll ended":`Опрос завершён`,"Poll options":`Опции опроса`,"Poll results":`Результаты опроса`,"Previous image":`Предыдущее изображение`,Question:`Вопрос`,"Question {{ optionOrderNumber}}":`Вопрос {{ optionOrderNumber}}`,"Question is required":`Вопрос обязателен`,"Quote Reply":`Ответ со цитатой`,"Reached the vote limit. Remove an existing vote first.":`Достигнут лимит голосов. Сначала удалите существующий голос.`,"Recording format is not supported and cannot be reproduced":`Формат записи не поддерживается и не может быть воспроизведен`,"Remind me":`Напомнить мне`,"Remind Me":`Напомнить мне`,"Reminder set":`Напоминание установлено`,"Remove reminder":`Удалить напоминание`,"Remove save for later":`Удалить «Сохранить на потом»`,"Replied to a thread":`Ответил в ветке`,Reply:`Ответить`,"Reply to {{ authorName }}":`Ответить {{ authorName }}`,"Reply to a message to start a thread":`Ответьте на сообщение, чтобы начать тред`,"Reply to Message":`Ответить на сообщение`,replyCount_one:`1 ответ`,replyCount_few:`{{ count }} ответов`,replyCount_many:`{{ count }} ответов`,replyCount_other:`{{ count }} ответов`,Resend:`Отправить повторно`,"Retry upload":`Повторить загрузку`,"Review all options available in this poll":`Просмотрите все варианты, доступные в этом опросе`,"Review comments submitted with poll answers":`Просмотрите комментарии, отправленные вместе с ответами в опросе`,"Review poll results and open an option to see detailed votes":`Просмотрите результаты опроса и откройте вариант, чтобы увидеть подробные голоса`,"Review this message and choose whether to delete it, edit it, or send it anyway":`Просмотрите это сообщение и выберите, удалить его, отредактировать или отправить все равно`,"Review who voted for this option":`Просмотрите, кто проголосовал за этот вариант`,"Save for later":`Сохранить на потом`,"Saved for later":`Сохранено на потом`,Search:`Поиск`,"Search GIFs":`Поиск GIF`,"search-results-header-filter-source-button-label--channels":`каналы`,"search-results-header-filter-source-button-label--messages":`сообщения`,"search-results-header-filter-source-button-label--users":`пользователи`,"Searching for {{ searchSourceType }}...":`Поиск {{ searchSourceType }}...`,"Searching...":`Ищем...`,searchResultsCount_one:`1 результат`,searchResultsCount_few:`{{ count }} результата`,searchResultsCount_many:`{{ count }} результатов`,searchResultsCount_other:`{{ count }} результатов`,"Select a thread to continue the conversation":`Выберите тред, чтобы продолжить беседу`,"Select more than one option":`Выберите более одного варианта`,"Select one":`Выберите один`,"Select one or more":`Выберите один или несколько`,"Select up to {{count}}_one":`Выберите до {{count}}`,"Select up to {{count}}_few":`Выберите до {{count}}`,"Select up to {{count}}_many":`Выберите до {{count}}`,"Select up to {{count}}_other":`Выберите до {{count}}`,"Select your current location and optionally enable live location sharing":`Выберите ваше текущее местоположение и при необходимости включите передачу геопозиции в реальном времени`,Send:`Отправить`,"Send a message":`Отправьте сообщение`,"Send a message to start the conversation":`Отправьте сообщение, чтобы начать разговор`,"Send Anyway":`Мне всё равно, отправить`,"Send message request failed":`Не удалось отправить запрос на отправку сообщения`,"Send poll":`Отправить опрос`,"Sending...":`Отправка...`,Sent:`Отправлено`,Share:`Поделиться`,"Share live location for":`Поделиться местоположением в прямом эфире на`,"Share Location":`Поделиться местоположением`,"Shared live location":`Общее местоположение в прямом эфире`,"Shared location":`Общее местоположение`,Shuffle:`Перемешать`,"size limit":`ограничение размера`,"Slow Mode ON":`Медленный режим включен`,"Slow mode, wait {{ seconds }}s...":`Медленный режим: подождите {{ seconds }} с...`,"Some of the files will not be accepted":`Некоторые файлы не будут приняты`,"Start t
500yping to search":`Начните вводить для поиска`,"Stop sharing":`Прекратить делиться`,Submit:`Отправить`,"Suggest a new option to add to this poll":`Предложите новый вариант для добавления в этот опрос`,"Suggest an option":`Предложить вариант`,"Tap to remove":`Нажмите, чтобы удалить`,"Tap to remove: {{ reactionName }}":`Нажмите, чтобы удалить: {{ reactionName }}`,"Thinking...":`Думаю...`,"this content could not be displayed":`Этот контент не может быть отображен в данный момент`,"This field cannot be empty or contain only spaces":`Это поле не может быть пустым или содержать только пробелы`,"This message did not meet our content guidelines":`Сообщение не соответствует правилам`,Thread:`Ветка`,"Thread has not been found":`Ветка не найдена`,"Thread reply":`Ответ в ветке`,"Thread Reply":`Ответ в ветке`,"ThreadListUnseenThreadsBanner/loading":`Загрузка...`,"ThreadListUnseenThreadsBanner/unreadThreads_one":`{{ count }} непрочитанная ветка`,"ThreadListUnseenThreadsBanner/unreadThreads_few":`{{ count }} непрочитанные ветки`,"ThreadListUnseenThreadsBanner/unreadThreads_many":`{{ count }} непрочитанных веток`,"ThreadListUnseenThreadsBanner/unreadThreads_other":`{{ count }} непрочитанных веток`,Threads:`Треды`,"timestamp/ChannelPreviewTimestamp":`{{ timestamp | timestampFormatter(calendar: true; calendarFormats: { "sameDay": "LT", "lastDay": "[Вчера]", "lastWeek": "dddd", "sameElse": "L" }) }}`,"timestamp/DateSeparator":`{{ timestamp | timestampFormatter(calendar: true; calendarFormats: { "sameDay": "[Сегодня]", "nextDay": "[Завтра]", "lastDay": "[Вчера]", "nextWeek": "dddd", "lastWeek": "[В прошлый] dddd", "sameElse": "ddd, D MMM" }) }}`,"timestamp/LiveLocation":`{{ timestamp | timestampFormatter(calendar: true) }}`,"timestamp/MessageTimestamp":`{{ timestamp | timestampFormatter(calendar: false; format: HH:mm) }}`,"timestamp/PollVote":`{{ timestamp | timestampFormatter(relativeCompact: true) }}`,"timestamp/PollVoteTooltip":`{{ timestamp | timestampFormatter(calendar: true) }}`,"timestamp/relativeDaysAgo":`{{ count }}d ago`,"timestamp/relativeToday":`Сегодня`,"timestamp/relativeWeeksAgo":`{{ count }}w ago`,"timestamp/relativeYesterday":`Вчера`,"timestamp/ReminderNotification":`{{ timestamp | timestampFormatter(calendar: true; calendarFormats: { "sameDay": "[Today] [at] HH:mm", "nextDay": "[Tomorrow] [at] HH:mm", "lastDay": "[Yesterday] [at] HH:mm", "nextWeek": "dddd [at] HH:mm", "lastWeek": "[Last] dddd [at] HH:mm", "sameElse": "ddd, D MMM [at] HH:mm" }) }}`,"timestamp/SystemMessage":`{{ timestamp | timestampFormatter(format: dddd L) }}`,"To start recording, allow the camera access in your browser":`Для начала записи разрешите доступ к камере в вашем браузере`,"To start recording, allow the microphone access in your browser":`Для начала записи разрешите доступ к микрофону в вашем браузере`,totalVoteCount_one:`1 голос всего`,totalVoteCount_few:`{{ count }} голоса всего`,totalVoteCount_many:`{{ count }} голосов всего`,totalVoteCount_other:`{{ count }} голосов всего`,Translated:`Переведено`,"Translated from {{ language }}":`Переведено с {{ language }}`,"translationBuilderTopic/notification":`{{value, notification}}`,"Type a number from 2 to 10":`Введите число от 2 до 10`,Unarchive:`Удалить из архива`,"unban-command-args":`[@имяпользователя]`,"unban-command-description":`Разблокировать пользователя`,"Unblock User":`Разблокировать пользователя`,"unknown error":`неизвестная ошибка`,Unmute:`Включить уведомления`,"unmute-command-args":`[@имяÐ
500¿Ð¾Ð»ÑŒÐ·Ð¾Ð²Ð°Ñ‚еля]`,"unmute-command-description":`Включить микрофон у пользователя`,Unpin:`Открепить`,"Unread messages":`Непрочитанные сообщения`,"Unsupported attachment":`Неподдерживаемое вложение`,"unsupported file type":`неподдерживаемый тип файла`,Update:`Обновить`,"Update the comment attached to your poll answer":`Обновите комментарий, прикрепленный к вашему ответу в опросе`,"Update your comment":`Обновите ваш комментарий`,"Upload blocked":`Загрузка заблокирована`,"Upload error":`Ошибка загрузки`,"Upload failed":`Загрузка не удалась`,'Upload type: "{{ type }}" is not allowed':`Тип загрузки: "{{ type }}" не разрешен`,"User blocked":`Пользователь заблокирован`,"User unblocked":`Пользователь разблокирован`,"User uploaded content":`Пользователь загрузил контент`,Video:`Видео`,videoCount_one:`{{ count }} видео`,videoCount_few:`{{ count }} видео`,videoCount_many:`{{ count }} видео`,videoCount_other:`{{ count }} видео`,View:`Просмотр`,"View {{count}} comments_one":`Просмотреть {{count}} комментарий`,"View {{count}} comments_few":`Просмотреть {{count}} комментариев`,"View {{count}} comments_many":`Просмотреть {{count}} комментариев`,"View {{count}} comments_other":`Просмотреть {{count}} комментариев`,"View all":`Показать все`,"View original":`Показать оригинал`,"View results":`Посмотреть результаты`,"View translation":`Показать перевод`,"Voice message":`Голосовое сообщение`,"Voice message {{ duration }}":`Голосовое сообщение {{ duration }}`,"Voice message deleted":`Голосовое сообщение удалено`,voiceMessageCount_one:`{{ count }} голосовое сообщение`,voiceMessageCount_few:`{{ count }} голосовых сообщения`,voiceMessageCount_many:`{{ count }} голосовых сообщений`,voiceMessageCount_other:`{{ count }} голосовых сообщений`,"Vote ended":`Голосование завершено`,Votes:`Голоса`,"Wait until all attachments have uploaded":`Подождите, пока все вложения загрузятся`,"Waiting for network…":`Ожидание сети…`,You:`Вы`,"You've reached the maximum number of files":`Вы достигли максимального количества файлов`},Ihe={"{{ commaSeparatedUsers }} and {{ moreCount }} more":`{{ commaSeparatedUsers }} ve {{ moreCount }} daha`,"{{ commaSeparatedUsers }}, and {{ lastUser }}":`{{ commaSeparatedUsers }} ve {{ lastUser }}`,"{{ count }} files_one":`{{ count }} dosya`,"{{ count }} files_other":`{{ count }} dosya`,"{{ count }} people are typing_one":`{{ count }} kişi yazıyor`,"{{ count }} people are typing_many":`{{ count }} kişi yazıyor`,"{{ count }} people are typing_other":`{{ count }} kişi yazıyor`,"{{ count }} photos_one":`{{ count }} fotoğraf`,"{{ count }} photos_other":`{{ count }} fotoğraf`,"{{ count }} reactions_one":`{{ count }} tepki`,"{{ count }} reactions_other":`{{ count }} tepki`,"{{ count }} videos_one":`{{ count }} video`,"{{ count }} videos_other":`{{ count }} video`,"{{ firstUser }} and {{ secondUser }}":`{{ firstUser }} ve {{ secondUser }}`,"{{ imageCount }} more":`{{ imageCount }} adet daha`,"{{ memberCount }} members":`{{ memberCount }} üye`,"{{ typing }} are typing":`{{ typing }} yazıyor`,"{{ typing }} is typing":`{{ typing }} yazıyor`,"{{ user }} has been muted":`{{ user }} sessize alındı`,"{{ user }} has been unmuted":`{{ user }} sesi açıldı`,"{{ user }} is typing...":`{{ user }} yazıyor...`,"{{ users }} and {{ user }} are typing...":`{{ users }} ve {{ user }} yazıyor...`,"{{ users }} and more are typing...":`{{ users }} ve diğerleri yazıyor...`,"{{ watcherCount }} online":`{{ watcherCount }} çevrimiçi`,"{{count}} new messages_one":`{{count}} yeni mesaj`,"{{count}} new messages_other":`{{count}} yeni mesaj`,"{{count}}
500 unread_one":`{{count}} okunmamış`,"{{count}} unread_other":`{{count}} okunmamış`,"{{count}} votes_one":`{{count}} oy`,"{{count}} votes_other":`{{count}} oy`,"+{{ imageCount }}":`+{{ imageCount }}`,"+{{count}} more options_one":`+{{count}} seçenek daha`,"+{{count}} more options_other":`+{{count}} seçenek daha`,"🏙 Attachment...":`🏙 Ek...`,"📊 {{createdBy}} created: {{ pollName}}":`📊 {{createdBy}} oluşturdu: {{ pollName}}`,"📊 {{votedBy}} voted: {{pollOptionText}}":`📊 {{votedBy}} oy verdi: {{pollOptionText}}`,"📍Shared location":`📍Paylaşılan konum`,"Add a comment":`Yorum ekle`,"Add a comment to your poll answer":`Anket yanıtınıza bir yorum ekleyin`,"Add an option":`Bir seçenek ekle`,"Add reaction":`Tepki ekle`,"All results loaded":`Tüm sonuçlar yüklendi`,"Allow access to camera":`Kameraya erişime izin ver`,"Allow access to microphone":`Mikrofona erişime izin ver`,"Allow comments":`Yorumlara izin ver`,"Allow option suggestion":`Seçenek önerisine izin ver`,"Allow others to add comments":`Diğerlerinin yorum eklemesine izin ver`,"Also send as a direct message":`Ayrıca doğrudan mesaj olarak gönder`,"Also send in channel":`Ayrıca kanala gönder`,"Also sent in channel":`Kanala da gönderildi`,"An error has occurred during recording":`Kayıt sırasında bir hata oluştu`,"An error has occurred during the recording processing":`Kayıt işlemi sırasında bir hata oluştu`,Anonymous:`Anonim`,"Anonymous poll":`Anonim anket`,Archive:`Arşivle`,"Are you sure you want to delete this message?":`Bu mesajı silmek istediğinizden emin misiniz?`,"aria/Attachment":`Ek`,"aria/Attachment Actions":`Ek işlemleri`,"aria/Audio position {{ elapsed }} of {{ duration }}":`Ses konumu {{ elapsed }} / {{ duration }}`,"aria/Audio position {{ progress }} percent":`Ses konumu yüzde {{ progress }}`,"aria/Block User":`Kullanıcıyı engelle`,"aria/Bookmark Message":`Mesajı yer imi ekle`,"aria/Cancel recording":`Kaydı iptal et`,"aria/Cancel Reply":`Cevabı İptal Et`,"aria/Cancel upload":`Yüklemeyi İptal Et`,"aria/Channel Actions":`Kanal işlemleri`,"aria/Channel list":`Kanal listesi`,"aria/Channel search results":`Kanal arama sonuçları`,"aria/Chat view tabs":`Sohbet görünümü sekmeleri`,"aria/Clear search":`Aramayı temizle`,"aria/Close callout dialog":`Bilgi balonu iletişim kutusunu kapat`,"aria/Close thread":`Konuyu kapat`,"aria/Collapse sidebar":`Kenar çubuğunu daralt`,"aria/Command Suggestions":`Komut önerileri`,"aria/Complete recording":`Kaydı tamamla`,"aria/Copy Message Text":`Mesaj metnini kopyala`,"aria/Decrease value":`Değeri azalt`,"aria/Delete Message":`Mesajı sil`,"aria/Dismiss notification":`Bildirimi kapat`,"aria/Download attachment":`Ek indir`,"aria/Edit Message":`Mesajı Düzenle`,"aria/Emoji picker":`Emoji seçici`,"aria/Emoji Suggestions":`Emoji önerileri`,"aria/Exit search":`Aramadan çık`,"aria/Expand sidebar":`Kenar çubuğunu genişlet`,"aria/File input":`Dosya girişi`,"aria/File upload":`Dosya yükleme`,"aria/Flag Message":`Mesajı bayrakla`,"aria/Image failed to load":`Görsel yüklenemedi`,"aria/Image input":`Resim girişi`,"aria/Increase value":`Değeri artır`,"aria/Jump to latest message":`En son mesaja git`,"aria/Jump to quoted message":`Alıntılanan mesaja git`,"aria/Load More Channels":`Daha Fazla Kanal Yükle`,"aria/Mark Message Unread":`Okunmamış olarak işaretle`,"aria/Mark messages as read":`Mesajları okundu olarak işaretle`,"aria/Menu":`Menü`,"aria/Message Actions":`Mesaj eylemleri`,"aria/Message from {{ user }},":`{{ user }} adlı kullanıcıdan mesaj,`,"aria/Message Options":`Mesaj Seçenekleri`,"aria/Message,":`Mesaj,`,"aria/Mute User":`Kullanıcıyı sustur`,"aria/Notifications":`Bildirimler`,"aria/Open Attachment Selector":`Ek Seçiciyi Aç`,"aria/Open Channel Actions Menu":`Kanal işlemleri menüsünü aç`,"aria/Open Menu":`Menüyü Aç`,"aria/Open Message Actions Menu":`Mesaj İşlemleri Menüsünü Aç`,"aria/Open Reaction Selector":`Tepki Seçiciyi Aç`,"aria/Open Thread":`Konuyu Aç`,"aria/Pause":`Duraklat`,"aria/Pause recording":`Kaydı duraklat`,"aria/Percent complete":`Yüzde {{percent}} tamamlandı`,"aria/Pin Message":`Mesajı sabitle`,"aria/Play":`Oynat`,"aria/Quote Message":`Mesajı alıntıla`,"aria/Reaction list":`Tepki listesi`,"aria/Remind Me Message":`Hatırlat`,"aria/Remind Me Options":`Hatırlatma seçenekleri`,"aria/Remove attachment":`Eki kaldır`,"aria/Remove location attachment":`Konum ekini kaldır`,"aria/Remove option":`Seçeneği kaldır`,"aria/Remove Reminder":`Hatırlatıcıyı kaldır`,"aria/Remove Save For Later"
500:`Sonraya kaydet'i kaldır`,"aria/Resend Message":`Mesajı tekrar gönder`,"aria/Resume recording":`Kaydı devam ettir`,"aria/Retry upload":`Yüklemeyi Tekrar Dene`,"aria/Review bounced message":`Geri dönen mesajı incele`,"aria/Search results":`Arama sonuçları`,"aria/Search results header filter button for: {{ source }}":`{{ source }} için arama sonuçları başlık filtre düğmesi`,"aria/Seek audio position":`Ses konumunu ara`,"aria/Select Channel: {{ channelName }}":`Kanal seç: {{ channelName }}`,"aria/Select Reaction: {{ reactionName }}":`Tepki seç: {{ reactionName }}`,"aria/Select User Channel: {{ name }}":`Kullanıcı kanalını seç: {{ name }}`,"aria/Send":`Gönder`,"aria/Show preview":`Önizlemeyi göster`,"aria/Start recording audio":`Ses kaydını başlat`,"aria/Stop AI Generation":`Yapay Zeka Üretimini Durdur`,"aria/Suggestions":`Öneriler`,"aria/Thread list":`İleti dizisi listesi`,"aria/Unblock User":`Kullanıcının engelini kaldır`,"aria/Unmute User":`Sesini aç`,"aria/Unpin Message":`Sabitlemeyi kaldır`,"aria/User Suggestions":`Kullanıcı önerileri`,"Ask a question":`Bir soru sor`,Attach:`Ekle`,"Attach files":`Dosya ekle`,Attachment:`Ek`,"Attachment upload blocked due to {{reason}}":`{{reason}} nedeniyle ek yükleme engellendi`,"Attachment upload failed due to {{reason}}":`{{reason}} nedeniyle ek yükleme başarısız oldu`,Back:`Geri`,"ban-command-args":`[@kullanıcıadı] [metin]`,"ban-command-description":`Bir kullanıcıyı yasakla`,"Block User":`Kullanıcıyı engelle`,Cancel:`İptal`,"Cannot seek in the recording":`Kayıtta arama yapılamıyor`,"Channel archived":`Kanal arşivlendi`,"Channel Missing":`Kanal bulunamıyor`,"Channel muted":`Kanal sessize alındı`,"Channel pinned":`Kanal sabitlendi`,"Channel unarchived":`Kanal arşivden çıkarıldı`,"Channel unmuted":`Kanal sesi açıldı`,"Channel unpinned":`Kanal sabitlemesi kaldırıldı`,Channels:`Kanallar`,Chats:`Sohbetler`,"Choose between 2 to 10 options":`2 ile 10 seçenek arasından seçin`,Close:`Kapat`,"Close dialog":`İletişim kutusunu kapat`,"Close emoji picker":`Emoji seçiciyi kapat`,"Close prompt: {{ title }}":`İstemi kapat: {{ title }}`,"Command not available while editing":`Düzenleme sırasında komut kullanılamaz`,"Command not available while replying":`Yanıtlama sırasında komut kullanılamaz`,Commands:`Komutlar`,"Commands matching":`Eşleşen komutlar`,"Connection failure, reconnecting now...":`Bağlantı hatası, tekrar bağlanılıyor...`,"Copy Message":`Mesajı kopyala`,Create:`Oluştur`,"Create a question, add options, and configure poll settings":`Bir soru oluşturun, seçenekler ekleyin ve anket ayarlarını yapılandırın`,"Create poll":`Anket oluştur`,"Current location":`Mevcut konum`,Delete:`Sil`,"Delete for me":`Benim için sil`,"Delete message":`Mesajı sil`,Delivered:`İletildi`,"Direct message":`Doğrudan mesaj`,"Do you want to end this poll now? Nobody will be able to vote in this poll anymore.":`Bu anketi şimdi sonlandırmak istiyor musunuz? Sonlandırdıktan sonra bu ankette kimse oy kullanamayacak.`,"Download All":`Tümünü indir`,"Download Attachment":`Eki indir`,"Download attachment {{ name }}":`Ek {{ name }}'i indir`,"Drag your files here":`Dosyalarınızı buraya sürükleyin`,"Drag your files here to add to your post":`Gönderinize eklemek için dosyalarınızı buraya sürükleyin`,"Due {{ timeLeft }}":`{{ timeLeft }} içinde süresi dolacak`,"Due since {{ dueSince }}":`{{ dueSince }}'den beri süresi dolmuş`,"duration/Message reminder":`{{ milliseconds | durationFormatter(withSuffix: true) }}`,"duration/Remind Me":`{{ milliseconds | durationFormatter(withSuffix: true) }}`,"duration/Share Location":`{{ milliseconds | durationFormatter }}`,"Edit Message":`Mesajı Düzenle`,"Edit message request failed":`Mesaj düzenleme isteği başarısız oldu`,Edited:`Düzenlendi`,"Emoji matching":`Emoji eşleştirme`,"Empty message...":`Boş mesaj...`,End:`Son`,"End poll":`Anketi sonlandır`,"End this poll?":`Bu anketi sonlandır?`,"End vote":`Oyu bitir`,"Enforce unique vote is enabled":`Benzersiz oy etkinleştirildi`,Error:`Hata`,"Error adding flag":`Bayrak eklenirken hata oluştu`,"Error c
500onnecting to chat, refresh the page to try again.":`Bağlantı hatası, sayfayı yenileyip tekrar deneyin.`,"Error deleting message":`Mesaj silinirken hata oluştu`,"Error fetching reactions":`Reaksiyonlar alınırken hata oluştu`,"Error marking message unread. Cannot mark unread messages older than the newest 100 channel messages.":`Mesajı okunmamış olarak işaretleme hatası. En yeni 100 kanal mesajından daha eski okunmamış mesajları işaretleme yapılamaz.`,"Error muting a user ...":`Kullanıcıyı sessize alırken hata oluştu ...`,"Error pinning message":`Mesaj sabitlenirken hata oluştu`,"Error removing message pin":`Mesaj PIN'i kaldırılırken hata oluştu`,"Error reproducing the recording":`Kaydı yeniden üretme hatası`,"Error starting recording":`Kayıt başlatılırken hata oluştu`,"Error unmuting a user ...":`Kullanıcının sesini açarken hata oluştu ...`,"Error uploading attachment":`Ek yüklenirken hata oluştu`,"Error uploading file":`Dosya yüklenirken hata oluştu`,"Error uploading image":`Resmi yüklerken hata`,"Error: {{ errorMessage }}":`Hata: {{ errorMessage }}`,"Exit command {{ command }}":`Komuttan çık {{ command }}`,"Failed to block user":`Kullanıcı engellenemedi`,"Failed to create the poll":`Anket oluşturulurken hata oluştu`,"Failed to create the poll due to {{reason}}":`{{reason}} nedeniyle anket oluşturulamadı`,"Failed to delete the message":`Mesaj silinemedi`,"Failed to end the poll":`Anket sonlandırılamadı`,"Failed to end the poll due to {{reason}}":`{{reason}} nedeniyle anket sonlandırılamadı`,"Failed to jump to the first unread message":`İlk okunmamış mesaja atlamada hata oluştu`,"Failed to leave channel":`Kanaldan çıkılamadı`,"Failed to load channels":`Kanallar yüklenemedi`,"Failed to load more channels":`Daha fazla kanal yüklenemedi`,"Failed to mark channel as read":`Kanalı okundu olarak işaretleme başarısız oldu`,"Failed to play the recording":`Kayıt oynatılamadı`,"Failed to retrieve location":`Konum alınamadı`,"Failed to share location":`Konum paylaşılamadı`,"Failed to update channel archive status":`Kanalın arşiv durumu güncellenemedi`,"Failed to update channel mute status":`Kanalın sessiz durumu güncellenemedi`,"Failed to update channel pinned status":`Kanalın sabitleme durumu güncellenemedi`,File:`Dosya`,"File is required for upload attachment":`Ek yüklemek için dosya gerekli`,"File is too large: {{ size }}, maximum upload size is {{ limit }}":`Dosya çok büyük: {{ size }}, maksimum yükleme boyutu {{ limit }}`,"File too large":`Dosya çok büyük`,fileCount_one:`1 dosya`,fileCount_other:`{{ count }} dosya`,Flag:`Bayrak`,"Generating...":`Oluşturuluyor...`,"giphy-command-args":`[metin]`,"giphy-command-description":`Rastgele bir gif'i kanala gönder`,"Hide who voted":`Kimin oy verdiğini gizle`,Image:`Görsel`,imageCount_one:`Görsel`,imageCount_other:`{{ count }} görsel`,"Instant commands":`Anlık komutlar`,"language/af":`Afrikanca`,"language/am":`Amharca`,"language/ar":`Arapça`,"language/az":`Azerice`,"language/bg":`Bulgarca`,"language/bn":`Bengalce`,"language/bs":`Boşnakça`,"language/cs":`Çekçe`,"language/da":`Danca`,"language/de":`Almanca`,"language/el":`Yunanca`,"language/en":`İngilizce`,"language/es":`İspanyolca`,"language/es-MX":`İspanyolca (Meksika)`,"language/et":`Estonyaca`,"language/fa":`Farsça`,"language/fa-AF":`Darice`,"language/fi":`Fince`,"language/fr":`Fransızca`,"language/fr-CA":`Fransızca (Kanada)`,"language/ha":`Hausa`,"language/he":`İbranice`,"language/hi":`Hintçe`,"language/hr":`Hırvatça`,"language/ht":`Haiti Kreolcesi`,"language/hu":`Macarca`,"language/id":`Endonezce`,"language/it":`İtalyanca`,"language/ja":`Japonca`,"language/ka":`Gürcüce`,"language/ko":`Korece`,"language/lt":`Litvanca`,"language/lv":`Letonca`,"language/ms":`Malayca`,"language/nl":`Felemenkçe`,"language/no":`Norveççe`,"language/pl":`Lehçe`,"language/ps":`Peştuca`,"language/pt":`Portekizce`,"language/ro":`Romence`,"language/ru":`Rusça`,"language/sk":`Slovakça`,"language/sl":`Slovence`,"language/so":`Somalice`,"language/sq":`Arnavutça`,"language/sr":`Sırpça`,"language/sv":`İsveççe`,"language/sw":`Svahilice`,"language/ta":`Tamilce`,"language/th":`Tayca`,"language/tl":`Tagalogca`,"language/tr":`Türkçe`,"language/uk":`Ukraynaca`,"language/ur":`Urduca`,"language/vi":`Vietnamca`,"language/zh":`Çince (basitleştirilmiş)`,"language/zh-TW":`Çince (geleneksel)`,"Leave Channel":`Kanaldan ayrıl`,"Left channel":`Kanaldan ayrıldınız`,"Let others add options":`Başkalarının seçenek eklemesine izin ver`,"Limit votes per person":`Kişi başına oy sınırı`,Link:`Bağlantı`,linkCount_one:`Bağlantı`,linkCount_other:`{{ count }} bağlantı`,live:`canlı`,"Live for {{duration}}":`{{duration}}
500 boyunca canlı`,"Live location":`Canlı konum`,"Live until {{ timestamp }}":`{{ timestamp }}'e kadar canlı`,"Load more":`Daha fazla yükle`,"Local upload attachment missing local id":`Yerel yükleme ekinde yerel kimlik eksik`,Location:`Konum`,"Location sharing ended":`Konum paylaşımı sona erdi`,"Location: {{ coordinates }}":`Konum: {{ coordinates }}`,"Mark as unread":`Okunmamış olarak işaretle`,"Maximum number of votes (from 2 to 10)":`Maksimum oy sayısı (2 ile 10 arası)`,"Maximum votes per person":`Kişi başına maksimum oy`,Menu:`Menü`,"Message deleted":`Mesaj silindi`,"Message failed to send":`Mesaj gönderilemedi`,"Message has been successfully flagged":`Mesaj başarıyla bayraklandı`,"Message marked as unread":`Mesaj okunmadı olarak işaretlendi`,"Message pinned":`Mesaj sabitlendi`,"Message unpinned":`Mesaj sabitlemesi kaldırıldı`,"Message was blocked by moderation policies":`Mesaj moderasyon politikaları tarafından engellendi`,"Messages have been marked unread.":`Mesajlar okunmamış olarak işaretlendi.`,"Missing permissions to upload the attachment":`Ek yüklemek için izinler eksik`,"Multiple votes":`Çoklu oy`,Mute:`Sessiz`,"mute-command-args":`[@kullanıcıadı]`,"mute-command-description":`Bir kullanıcının sesini kapat`,"network error":`ağ hatası`,New:`Yeni`,"New message from {{user}}":`{{user}} adlı kullanıcıdan yeni mesaj`,"New Messages!":`Yeni Mesajlar!`,"Next image":`Sonraki görsel`,"No chats here yet…":`Henüz burada sohbet yok...`,"No conversations yet":`Henüz konuşma yok`,"No items exist":`Hiç öğe yok`,"No results found":`Sonuç bulunamadı`,"Nobody will be able to vote in this poll anymore.":`Artık bu ankette kimse oy kullanamayacak.`,"Nothing yet...":`Şimdilik hiçbir şey...`,Offline:`Çevrimdışı`,Ok:`Tamam`,Online:`Çevrimiçi`,"Only numbers are allowed":`Sadece sayılar kullanılabilir`,"Only visible to you":`Sadece sana görünür`,"Open emoji picker":`Emoji klavyesini aç`,"Open gallery at image {{ index }}":`Galeriyi {{ index }}. görselde aç`,"Open image in gallery":`Görseli galeride aç`,"Open location in a map":`Konumu haritada aç`,"Option already exists":`Seçenek zaten mevcut`,"Option is empty":`Seçenek boş`,Options:`Seçenekler`,Original:`Orijinal`,"People matching":`Eşleşen kişiler`,Photo:`Fotoğraf`,Pin:`Sabitle`,"Pinned by {{ name }}":`{{ name }} sabitledi`,"Pinned by You":`Sizin sabitlediğiniz`,"placeholder/PollComment":`Yorumunuz`,"placeholder/PollOptionSuggestion":`Yeni bir seçenek girin`,"Play video":`Videoyu oynat`,"Playback speed {{ rate }}x":`Oynatma hızı {{ rate }}x`,Poll:`Anket`,"Poll comments":`Anket yorumları`,"Poll ended":`Anket sonlandı`,"Poll options":`Anket seçenekleri`,"Poll results":`Anket sonuçları`,"Previous image":`Önceki görsel`,Question:`Soru`,"Question {{ optionOrderNumber}}":`Soru {{ optionOrderNumber}}`,"Question is required":`Soru gereklidir`,"Quote Reply":`Alıntıyla yanıtla`,"Reached the vote limit. Remove an existing vote first.":`Oylama sınırına ulaşıldı. Önce mevcut bir oyu kaldırın.`,"Recording format is not supported and cannot be reproduced":`Kayıt formatı desteklenmiyor ve çoğaltılamıyor`,"Remind me":`Bana hatırlat`,"Remind Me":`Hatırlat`,"Reminder set":`Hatırlatıcı ayarlandı`,"Remove reminder":`Hatırlatıcıyı kaldır`,"Remove save for later":`Sonraya kaydet'i kaldır`,"Replied to a thread":`Bir iş parçacığına yanıt verdi`,Reply:`Cevapla`,"Reply to {{ authorName }}":`{{ authorName }} kişisine yanıt ver`,"Reply to a message to start a thread":`Bir thread başlatmak için bir mesaja yanıt verin`,"Reply to Message":`Mesaja Cevapla`,replyCount_one:`1 cevap`,replyCount_other:`{{ count }} cevap`,Resend:`Tekrar gönder`,"Retry upload":`Yüklemeyi yeniden dene`,"Review all options available in this poll":`Bu anketteki tüm mevcut seçenekleri inceleyin`,"Review comments submitted with poll answers":`Anket yanıtlarıyla gönderilen yorumları inceleyin`,"Review poll results and open an option to see detailed votes":`Anket sonuçlarını inceleyin ve ayrıntılı oyları görmek için bir seçenek açın`,"Review this message and choose whether to delete it, edit it, or send it anyway":`Bu mesajı inceleyin ve silmeyi, düzenlemeyi veya yine de göndermeyi seçin`,"Review who voted for this option":`Bu seçenek için kimlerin oy verdiğini inceleyin`,"Save for later":`Daha sonra kaydet`,"Saved for later":`Daha sonra kaydedildi`,Search:`Arama`,"Search GIFs":`GIF ara`,"search-results-header-filter-source-button-label--channels":`kanallar`,"search-results-header-filter-source-button-label--messages":`mesajlar`,"search-results-header-filter-source-button-label--users":`kullanıcılar`,"Searching for {{ searchSourceType }}...":`{{ searchSourceType }} aranıyor...`,"Searching...":`Aranıyor...`,searchResultsCount_one:`1 sonuç`,searchResultsCount_other:`{{ count }} sonuç`,"Select a thread to continue the conversation":`Sohbeti sürdürmek için bir ileti dizisi seçin`,"Select more than one option":`Birden fazla seçenek seçin`,"Select one":`Birini seçin`,"Select one or more":`Bir veya daha fazlasını seçin`,"Select up to {{count}}_one":`En fazla {{count}}'yi seçin`,"Select up to {{count}}_other":`En fazla {{count}}'yi seçin`,"Select your current location and optionally enable live location sharing":`Mevcut konumunuzu seçin ve isteğe bağlı olarak canlı konum paylaşımını etkinleştirin`,Send:`Gönder`,"Send a message":`Bir mesaj gönderin`,"Send a message to start the conversation":`Sohbete başlamak için bir mesaj gönderin`,"Send Anyway":`Yine de gönder`,"Send message request failed":`Mesaj gönderme isteği başarısız oldu`,"Send poll":`Anketi gönder`,"Sending...":`Gönderiliyor...`,Sent:`Gönderildi`,Share:`Paylaş`,"Share live location for":`Canlı konum paylaş`,"Share Location":`Konum Paylaş`,"Shared live location":`Paylaşılan canlı konum`,"Shared location":`Paylaşılan konum`,Shuffle:`Karıştır`,"size limit":`boyut sınırı`,"Slow Mode ON":`Yavaş Mod Açık`,"Slow mode, wait {{ seconds }}s...":`Yavaş mod, {{ seconds }} sn bekleyin...`,"Some of the files will not be accepted":`Bazı dosyalar kabul edilmeyecek`,"Start t
500yping to search":`Aramak için yazmaya başlayın`,"Stop sharing":`Paylaşımı durdur`,Submit:`Gönder`,"Suggest a new option to add to this poll":`Bu ankete eklenecek yeni bir seçenek önerin`,"Suggest an option":`Bir seçenek önerin`,"Tap to remove":`Kaldırmak için dokunun`,"Tap to remove: {{ reactionName }}":`Kaldırmak için dokunun: {{ reactionName }}`,"Thinking...":`Düşünüyor...`,"this content could not be displayed":`bu içerik gösterilemiyor`,"This field cannot be empty or contain only spaces":`Bu alan boş olamaz veya sadece boşluk içeremez`,"This message did not meet our content guidelines":`Bu mesaj içerik yönergelerimize uygun değil`,Thread:`Konu`,"Thread has not been found":`Konu bulunamadı`,"Thread reply":`Konu yanıtı`,"Thread Reply":`Konu yanıtı`,"ThreadListUnseenThreadsBanner/loading":`Yükleniyor...`,"ThreadListUnseenThreadsBanner/unreadThreads_one":`{{ count }} okunmamış ileti dizisi`,"ThreadListUnseenThreadsBanner/unreadThreads_other":`{{ count }} okunmamış ileti dizisi`,Threads:`İleti dizileri`,"timestamp/ChannelPreviewTimestamp":`{{ timestamp | timestampFormatter(calendar: true; calendarFormats: { "sameDay": "LT", "lastDay": "[Dün]", "lastWeek": "dddd", "sameElse": "L" }) }}`,"timestamp/DateSeparator":`{{ timestamp | timestampFormatter(calendar: true; calendarFormats: { "sameDay": "[Bugün]", "nextDay": "[Yarın]", "lastDay": "[Dün]", "nextWeek": "dddd", "lastWeek": "[Geçen] dddd", "sameElse": "ddd, D MMM" }) }}`,"timestamp/LiveLocation":`{{ timestamp | timestampFormatter(calendar: true) }}`,"timestamp/MessageTimestamp":`{{ timestamp | timestampFormatter(calendar: false; format: HH:mm) }}`,"timestamp/PollVote":`{{ timestamp | timestampFormatter(relativeCompact: true) }}`,"timestamp/PollVoteTooltip":`{{ timestamp | timestampFormatter(calendar: true) }}`,"timestamp/relativeDaysAgo":`{{ count }}d ago`,"timestamp/relativeToday":`Bugün`,"timestamp/relativeWeeksAgo":`{{ count }}w ago`,"timestamp/relativeYesterday":`Dün`,"timestamp/ReminderNotification":`{{ timestamp | timestampFormatter(calendar: true; calendarFormats: { "sameDay": "[Today] [at] HH:mm", "nextDay": "[Tomorrow] [at] HH:mm", "lastDay": "[Yesterday] [at] HH:mm", "nextWeek": "dddd [at] HH:mm", "lastWeek": "[Last] dddd [at] HH:mm", "sameElse": "ddd, D MMM [at] HH:mm" }) }}`,"timestamp/SystemMessage":`{{ timestamp | timestampFormatter(format: dddd L) }}`,"To start recording, allow the camera access in your browser":`Kayıt yapmaya başlamak için tarayıcınızda kameraya erişime izin verin`,"To start recording, allow the microphone access in your browser":`Kayıt yapmaya başlamak için tarayıcınızda mikrofona erişime izin verin`,totalVoteCount_one:`toplam 1 oy`,totalVoteCount_other:`toplam {{ count }} oy`,Translated:`Çevrildi`,"Translated from {{ language }}":`{{ language }} dilinden çevrildi`,"translationBuilderTopic/notification":`{{value, notification}}`,"Type a number from 2 to 10":`2 ile 10 arasında bir sayı yazın`,Unarchive:`Arşivden çıkar`,"unban-command-args":`[@kullanıcıadı]`,"unban-command-description":`Bir kullanıcının yasağını kaldır`,"Unblock User":`Kullanıcının engelini kaldır`,"unknown error":`bilinmeyen hata`,Unmute:`Sesini aç`,"unmute-command-args":`[@kullanıcıadı]`,"unmute-command-description":`Bir kullanıcının sesini aç`,Unpin:`Sabitlemeyi kaldır`,"Unread messages":`Okunmamış mesajlar`,"Unsupported attachment":`Desteklenmeyen ek`,"unsupported file type":`desteklenmeyen dosya türü`,Update:`Güncelle`,"Update the comment attached to your poll answer":`Anket yanıtınıza ekli yorumu güncelleyin`,"Update your comment":`Yorumunuzu güncelleyin`,"Upload blocked":`Yükleme engellendi`,"Upload error":`Yükleme hatası`,"Upload failed":`Yükleme başarısız oldu`,'Upload type: "{{ type }}" is not allowed':`Yükleme türü: "{{ type }}" izin verilmez`,"User blocked":`Kullanıcı engellendi`,"User unblocked":`Kullanıcının engeli kaldırıldı`,"User uploaded content":`Kullanıcı tarafından yüklenen içerik`,Video:`Video`,videoCount_one:`Video`,videoCount_other:`{{ count }}
500 video`,View:`Görüntüle`,"View {{count}} comments_one":`{{count}} yorumu görüntüle`,"View {{count}} comments_other":`{{count}} yorumu görüntüle`,"View all":`Tümünü görüntüle`,"View original":`Orijinali görüntüle`,"View results":`Sonuçları görüntüle`,"View translation":`Çeviriyi görüntüle`,"Voice message":`Sesli mesaj`,"Voice message {{ duration }}":`Sesli mesaj {{ duration }}`,"Voice message deleted":`Sesli mesaj silindi`,voiceMessageCount_one:`Sesli mesaj`,voiceMessageCount_other:`{{ count }} sesli mesaj`,"Vote ended":`Oylama sona erdi`,Votes:`Oylar`,"Wait until all attachments have uploaded":`Tüm ekler yüklenene kadar bekleyin`,"Waiting for network…":`Ağ bekleniyor…`,You:`Sen`,"You've reached the maximum number of files":`Maksimum dosya sayısına ulaştınız`},Lhe=class{constructor(e){this.options=e,this.translators=new Map,this.setTranslator=(e,t)=>{this.translators.set(e,t)},this.removeTranslator=e=>{this.translators.delete(e)},this.i18next=e.i18next,e.translators&&Object.entries(e.translators).forEach(([e,t])=>{this.setTranslator(e,t)})}},Rhe=({value:e})=>e,zhe=class{constructor(e){this.i18next=e,this.topics=new Map,this.translatorRegistrationsBuffer={},this.registerTopic=(e,t)=>{let n=this.topics.get(e);n||(n=new t({i18next:this.i18next}),this.topics.set(e,n),this.i18next.use({name:e,process:(t,n,r)=>{let i=this.topics.get(e);return i?i.translate(t,n,r):t},type:`postProcessor`}));let r=this.translatorRegistrationsBuffer[e];return r&&(Object.entries(r).forEach(([e,t])=>{n.setTranslator(e,t)}),delete this.translatorRegistrationsBuffer[e]),n},this.disableTopic=e=>{this.topics.get(e)&&(this.i18next.use({name:e,process:Rhe,type:`postProcessor`}),this.topics.delete(e))},this.getTopic=e=>this.topics.get(e)}registerTranslators(e,t){let n=this.getTopic(e);if(!n){this.translatorRegistrationsBuffer[e]||(this.translatorRegistrationsBuffer[e]={}),Object.entries(t).forEach(([t,n])=>{this.translatorRegistrationsBuffer[e][t]=n});return}Object.entries(t).forEach(([e,t])=>{n.setTranslator(e,t)})}removeTranslators(e,t){let n=this.getTopic(e);this.translatorRegistrationsBuffer[e]&&t.forEach(t=>{delete this.translatorRegistrationsBuffer[e][t]}),n&&t.forEach(e=>{n.removeTranslator(e)})}},K6=e=>{let t=e?.metadata?.reason;if(!(typeof t!=`string`||!t.length))return t.toLowerCase()},q6=({fallbackTranslationKey:e,notification:t,reasonTranslationKey:n,t:r})=>{let i=K6(t);return i?r(n,{reason:i}):r(e)},Bhe={"api:attachment:upload:failed":({options:{notification:e},t})=>q6({fallbackTranslationKey:`Error uploading attachment`,notification:e,reasonTranslationKey:`Attachment upload failed due to {{reason}}`,t}),"api:location:create:failed":({t:e})=>e(`Failed to share location`),"api:location:share:failed":({t:e})=>e(`Failed to share location`),"api:poll:create:failed":({options:{notification:e},t})=>q6({fallbackTranslationKey:`Failed to create the poll`,notification:e,reasonTranslationKey:`Failed to create the poll due to {{reason}}`,t}),"api:poll:end:failed":({options:{notification:e},t})=>q6({fallbackTranslationKey:`Failed to end the poll`,notification:e,reasonTranslationKey:`Failed to end the poll due to {{reason}}`,t}),"api:poll:end:success":({t:e})=>e(`Poll ended`),"api:reply:search:failed":({t:e})=>e(`Thread has not been found`),"browser:audio:playback:error":({options:{notification:e},t})=>e?.message?t(e.message):t(`Error reproducing the recording`),"browser:location:get:failed":({t:e})=>e(`Failed to retrieve location`),"channel:jumpToFirstUnread:failed":({t:e})=>e(`Failed to jump to the first unread message`),"validation:attachment:file:missing":({t:e})=>e(`File is required for upload attachment`),"validation:attachment:id:missing":({t:e})=>e(`Local upload attachment missing local id`),"validation:attachment:upload:blocked":({options:{notification:e},t})=>{let n=e?.metadata?.reason,r=t(`unsupported file type`);return typeof n!=`string`&&(r=t(`unknown error`)),n===`size_limit`&&(r=t(`size limit`)),t(`Attachment upload blocked due to {{reason}}`,{reason:r})},"validation:attachment:upload:in-progress":({t:e})=>e(`Wait until all attachments have uploaded`),"validation:command:disabled":({options:{notification:e},t})=>{let n=K6(e);return t(n===`editing`?`Command not available while editing`:n===`quoted_message`?`Command not available while replying`:e?.message||`Command not available`)},"validation:poll:castVote:limit":({t:e})=>e(`Reached the vote limit. Remove an existing vote first.`)},Vhe={"*":({options:{notification:e},...t})=>
500{if(!e?.type)return null;let n=Bhe[e.type];return n?n({...t,options:{notification:e}}):null}},Hhe=class extends Lhe{constructor({i18next:e,translators:t}){super({i18next:e,translators:Vhe}),this.translate=(e,t,n)=>{let{notification:r}=n;if(!r)return e;let i=r.type?this.translators.get(r.type):void 0;return i?i({key:t,options:n,t:this.i18next.t,value:e})||e:(this.translators.get(`*`)?.({key:t,options:n,t:this.i18next.t,value:e})??null)||(r.message?this.i18next.t(r.message,{...r.metadata??{},value:r.message}):e)},t&&Object.entries(t).forEach(([e,t])=>{this.setTranslator(e,t)})}},J6=`translation`,Y6=`en`;AB.default.extend(lfe.default),AB.default.extend(pfe.default),AB.default.extend(mfe.default),AB.default.updateLocale(`de`,{calendar:{lastDay:`[gestern um] LT`,lastWeek:`[letzten] dddd [um] LT`,nextDay:`[morgen um] LT`,nextWeek:`dddd [um] LT`,sameDay:`[heute um] LT`,sameElse:`L`}}),AB.default.updateLocale(`es`,{calendar:{lastDay:`[ayer a las] LT`,lastWeek:`[pasado] dddd [a] LT`,nextDay:`[mañana a] LT`,nextWeek:`dddd [a] LT`,sameDay:`[hoy a las] LT`,sameElse:`L`}}),AB.default.updateLocale(`fr`,{calendar:{lastDay:`[Hier à] LT`,lastWeek:`dddd [dernier à] LT`,nextDay:`[Demain à] LT`,nextWeek:`dddd [à] LT`,sameDay:`[Aujourd'hui à] LT`,sameElse:`L`}}),AB.default.updateLocale(`hi`,{calendar:{lastDay:`[कल] LT`,lastWeek:`[पिछले] dddd, LT`,nextDay:`[कल] LT`,nextWeek:`dddd, LT`,sameDay:`[आज] LT`,sameElse:`L`},meridiem(e){return e<4?`रात`:e<10?`सुबह`:e<17?`दोपहर`:e<20?`शाम`:`रात`},meridiemHour(e,t){return e===12&&(e=0),t===`रात`?e<4?e:e+12:t===`सुबह`?e:t===`दोपहर`?e>=10?e:e+12:t===`शाम`?e+12:e},meridiemParse:/रात|सुबह|दोपहर|शाम/}),AB.default.updateLocale(`it`,{calendar:{lastDay:`[Ieri alle] LT`,lastWeek:`[lo scorso] dddd [alle] LT`,nextDay:`[Domani alle] LT`,nextWeek:`dddd [alle] LT`,sameDay:`[Oggi alle] LT`,sameElse:`L`}}),AB.default.updateLocale(`ja`,{calendar:{lastDay:`[昨日] LT`,lastWeek:`dddd LT`,nextDay:`[明日] LT`,nextWeek:`[次の] dddd LT`,sameDay:`[今日] LT`,sameElse:`L`}}),AB.default.updateLocale(`ko`,{calendar:{lastDay:`[어제] LT`,lastWeek:`[지난] dddd LT`,nextDay:`[내일] LT`,nextWeek:`dddd LT`,sameDay:`[오늘] LT`,sameElse:`L`}}),AB.default.updateLocale(`nl`,{calendar:{lastDay:`[gisteren om] LT`,lastWeek:`[afgelopen] dddd [om] LT`,nextDay:`[morgen om] LT`,nextWeek:`dddd [om] LT`,sameDay:`[vandaag om] LT`,sameElse:`L`}}),AB.default.updateLocale(`pt`,{calendar:{lastDay:`[ontem às] LT`,lastWeek:`dddd [passada às] LT`,nextDay:`[amanhã às] LT`,nextWeek:`dddd [às] LT`,sameDay:`[hoje às] LT`,sameElse:`L`}}),AB.default.updateLocale(`ru`,{calendar:{lastDay:`[Вчера, в] LT`,nextDay:`[Завтра, в] LT`,sameDay:`[Сегодня, в] LT`}}),AB.default.updateLocale(`tr`,{calendar:{lastDay:`[dün] LT`,lastWeek:`[geçen] dddd [saat] LT`,nextDay:`[yarın saat] LT`,nextWeek:`[gelecek] dddd [saat] LT`,sameDay:`[bugün saat] LT`,sameElse:`L`}});var Uhe={formats:{},months:[`January`,`February`,`March`,`April`,`May`,`June`,`July`,`August`,`September`,`October`,`November`,`December`],relativeTime:{},weekdays:[`Sunday`,`Monday`,`Tuesday`,`Wednesday`,`Thursday`,`Friday`,`Saturday`]},X6=e=>e.extend!==void 0,Z6=e=>e.tz!==void 0,Q6={DateTimeParser:AB.default,dayjsLocaleConfigForLanguage:null,debug:!1,disableDateTimeTranslations:!1,language:`en`,logger:e=>console.warn(e),translationBuilderTopics:{notification:Hhe}},Whe=class{constructor(e={}){this.i18nInstance=bF.createInstance(),this.translationBuilderTopics={},this.Dayjs=null,this.setLanguageCallback=()=>null,this.initialized=!1,this.t=FV,this.translations={de:{[J6]:The},en:{[J6]:Ehe},es:{[J6]:Dhe},fr:{[J6]:Ohe},hi:{[J6]:khe},it:{[J6]:Ahe},ja:{[J6]:jhe},ko:{[J6]:Mhe},nl:{[J6]:Nhe},pt:{[J6]:Phe},ru:{[J6]:Fhe},tr:{[J6]:Ihe}},this.dayjsLocales={},this.formatters=PV,this.localeExists=e=>this.isCustomDateTimeParser?!0:Object.keys(AB.default.Ls).indexOf(e)>-1,this.validateCurrentLanguage=()=>{Object.keys(this.translations).indexOf(this.currentLanguage)===-1&&(this.logger(`Streami18n: '${this.currentLanguage}' language is not registered. Please make sure to call streami18n.registerTranslation('${this.currentLanguage}', {...}
500) or use one the built-in supported languages - ${this.getAvailableLanguages()}`),this.currentLanguage=Y6)},this.geti18Instance=()=>this.i18nInstance,this.getAvailableLanguages=()=>Object.keys(this.translations),this.getTranslations=()=>this.translations;let t={...Q6,...e};this.logger=t.logger,this.currentLanguage=t.language,this.DateTimeParser=t.DateTimeParser,this.timezone=t.timezone,this.formatters={...PV,...e?.formatters},this.translationBuilder=new zhe(this.i18nInstance),this.translationBuilderTopics={...Q6.translationBuilderTopics,...e.translationBuilderTopics};try{this.DateTimeParser&&X6(this.DateTimeParser)&&(this.DateTimeParser.extend(MB.default),this.DateTimeParser.extend(jB.default),this.DateTimeParser.extend(ufe.default),this.DateTimeParser.extend(dfe.default),this.DateTimeParser.extend(ffe.default))}catch(e){throw Error(`Streami18n: Looks like you wanted to provide Dayjs instance, but something went wrong while adding plugins ${e}`)}this.isCustomDateTimeParser=!!e.DateTimeParser;let n=t.translationsForLanguage;n&&(this.translations[this.currentLanguage]={[J6]:this.translations[this.currentLanguage]&&this.translations[this.currentLanguage][J6]?{...this.translations[this.currentLanguage][J6],...n}:n}),this.translations[this.currentLanguage]||(this.translations[this.currentLanguage]={[J6]:{}}),this.i18nextConfig={debug:t.debug,fallbackLng:!1,interpolation:{escapeValue:!1,formatSeparator:`|`},keySeparator:!1,lng:this.currentLanguage,nsSeparator:!1};let r=Object.keys(this.translationBuilderTopics);r.length>0&&(this.i18nextConfig.postProcess=r),t.parseMissingKeyHandler&&(this.i18nextConfig.parseMissingKeyHandler=t.parseMissingKeyHandler),this.validateCurrentLanguage();let i=t.dayjsLocaleConfigForLanguage;i?this.addOrUpdateLocale(this.currentLanguage,{...i}):this.localeExists(this.currentLanguage)||this.logger(`Streami18n: Streami18n(...) - Locale config for ${this.currentLanguage} does not exist in momentjs.Please import the locale file using "import 'moment/locale/${this.currentLanguage}';" in your app or register the locale config with Streami18n using registerTranslation(language, translation, customDayjsLocale)`),this.tDateTimeParser=e=>{let n=t.disableDateTimeTranslations||!this.localeExists(this.currentLanguage)?Y6:this.currentLanguage;return X6(this.DateTimeParser)?Z6(this.DateTimeParser)?this.DateTimeParser(e).tz(this.timezone).locale(n):this.DateTimeParser(e).locale(n):Z6(this.DateTimeParser)&&this.timezone?this.DateTimeParser(e).tz(this.timezone).locale(n):this.DateTimeParser(e).locale(n)}}
500async init(){this.validateCurrentLanguage();try{this.t=await this.i18nInstance.init({...this.i18nextConfig,lng:this.currentLanguage,resources:this.translations}),this.initialized=!0,this.formatters&&Object.entries(this.formatters).forEach(([e,t])=>{t&&this.i18nInstance.services.formatter?.add(e,t(this))}),Object.entries(this.translationBuilderTopics).forEach(([e,t])=>{this.translationBuilder.registerTopic(e,t)})}catch(e){this.logger(`Something went wrong with init: ${JSON.stringify(e)}`)}return{t:this.t,tDateTimeParser:this.tDateTimeParser}}async getTranslators(){return this.initialized?{t:this.t,tDateTimeParser:this.tDateTimeParser}:(this.dayjsLocales[this.currentLanguage]&&this.addOrUpdateLocale(this.currentLanguage,this.dayjsLocales[this.currentLanguage]),await this.init())}registerTranslation(e,t,n){if(!t){this.logger(`Streami18n: registerTranslation(language, translation, customDayjsLocale) called without translation`);return}this.translations[e]?this.translations[e][J6]=t:this.translations[e]={[J6]:t},n?this.dayjsLocales[e]={...n}:this.localeExists(e)||this.logger(`Streami18n: registerTranslation(language, translation, customDayjsLocale) - Locale config for ${e} does not exist in Dayjs.Please import the locale file using "import 'dayjs/locale/${e}';" in your app or register the locale config with Streami18n using registerTranslation(language, translation, customDayjsLocale)`),this.initialized&&this.i18nInstance.addResources(e,J6,t)}addOrUpdateLocale(e,t){this.localeExists(e)?AB.default.updateLocale(e,{...t}):AB.default.locale({name:e,...Uhe,...t},void 0,!0)}async setLanguage(e){if(this.currentLanguage=e,this.initialized)try{let t=await this.i18nInstance.changeLanguage(e);return this.dayjsLocales[e]&&this.addOrUpdateLocale(this.currentLanguage,this.dayjsLocales[this.currentLanguage]),this.setLanguageCallback(t),t}catch(e){return this.logger(`Failed to set language: ${JSON.stringify(e)}`),this.t}}registerSetLanguageCallback(e){this.setLanguageCallback=e}},$6=()=>(0,R.jsx)(`div`,{className:`str-chat__channel-list-item-container`,children:(0,R.jsxs)(`div`,{"aria-hidden":`true`,className:`str-chat__channel-list-item str-chat__channel-list-item--loading`,children:[(0,R.jsx)(`div`,{className:`str-chat__loading-channels-avatar`}),(0,R.jsxs)(`div`,{className:`str-chat__channel-list-item-data str-chat__channel-list-item-data--loading`,children:[(0,R.jsx)(`div`,{className:`str-chat__loading-channels-username`}),(0,R.jsx)(`div`,{className:`str-chat__loading-channels-status`})]})]})}),Ghe=()=>(0,R.jsxs)(`div`,{className:`str-chat__loading-channels`,children:[(0,R.jsx)($6,{}),(0,R.jsx)($6,{}),(0,R.jsx)($6,{}),(0,R.jsx)($6,{}),(0,R.jsx)($6,{})]}),e8=e=>(0,R.jsx)(AU,{...e,className:`str-chat__loading-indicator`}),t8=12,n8=2*Math.PI*t8,Khe=({percent:e})=>{let{t}=Y(`CircularProgressIndicator`),n=n8*(1-e/100);return(0,R.jsx)(`div`,{className:`str-chat__circular-progress-indicator str-chat__progress-indicator`,children:(0,R.jsxs)(`svg`,{"aria-label":t(`aria/Percent complete`,{percent:e}),"aria-valuemax":100,"aria-valuemin":0,"aria-valuenow":e,"data-testid":`circular-progress-ring`,height:`100%`,role:`progressbar`,viewBox:`0 0 32 32`,width:`100%`,xmlns:`http://www.w3.org/2000/svg`,children:[(0,R.jsx)(`circle`,{cx:`16`,cy:`16`,fill:`none`,r:t8,stroke:`currentColor`,strokeOpacity:.35,strokeWidth:`2.5`}),(0,R.jsx)(`circle`,{cx:`16`,cy:`16`,fill:`none`,r:t8,stroke:`currentColor`,strokeDasharray:n8,strokeDashoffset:n,strokeLinecap:`round`,strokeWidth:`2.5`,transform:`rotate(-90 16 16)`})]})})},r8=({uploadProgress:e})=>{let{LoadingIndicator:t=e8,ProgressIndicator:n=Khe}=q();return e===void 0?(0,R.jsx)(t,{"data-testid":`loading-indicator`}):(0,R.jsx)(n,{percent:e})};function qhe(e,t=3){let n=[`B`,`kB`,`MB`,`GB`],r=e===0?0:Math.min(Math.floor(Math.log(e)/Math.log(1024)),n.length-1),i=e/1024**r;return`${t===0?Math.round(i).toString():i.toPrecision(t)} ${n[r]}`}var i8=({fileSize:e,maximumFractionDigits:t})=>{let n=typeof e==`string`?parseFloat(e):e;return n===void 0||!Number.isFinite(Number(n))?null:(0,R.jsx)(`span`,{className:`str-chat__message-attachment-file--item-size`,"data-testid":`file-size-indicator`,children:qhe(n,t)})},Jhe=({fullBytes:e,uploadedBytes:t})=>{let{FileSizeIndicator:n=i8}=q();return(0,R.jsxs)(`div`,{className:`str-chat__attachment-preview-file__upload-size-fraction`,"data-testid":`upload-size-fraction`,children:[(0,R.jsx)(n,{fileSize:t}),` `,` / `,(0,R.jsx)(n,{fileSize:e})]})},a8=e=>{let t=(0,d.useRef)(e);return t.current=e,(0,d.useCallback)((...e)=>t.current(...e),[])},Yhe=`Action handler was called, but it is missing one of its required arguments. 
501Make sure the ChannelAction and ChannelState contexts are properly set and the hook is initialized with a valid message.`;function Xhe(e){let{removeMessage:t,updateMessage:n}=zB(`useActionHandler`),{channel:r}=KB(`useActionHandler`);return a8(async(i,a,o)=>
501{if(o&&o.preventDefault(),!e||!n||!t||!r){console.warn(Yhe);return}let s=e.id,c={};if(typeof i==`string`?c[i]=a:c={...i},s){let i=await r.sendAction(s,c);i?.message?n(i.message):t(e)}})}var Zhe=e=>{let{deleteMessage:t,removeMessage:n,updateMessage:r}=zB(`useDeleteHandler`),{client:i}=K(`useDeleteHandler`);return async a=>{if(e){if(e.type===`error`||mW(e)){n?.(e);return}!e.id||!i||!r||r(await t(e,a))}}},Qhe=`useFlagHandler was called but it is missing one or more necessary parameters.`,$he=e=>{let{client:t}=K(`useFlagHandler`),{t:n}=Y(`useFlagHandler`);return async r=>{if(r.preventDefault(),!t||!n||!e?.id){console.warn(Qhe);return}await t.flagMessage(e.id)}};function o8(e,t){return n=>{typeof e!=`function`||!t?.mentioned_users?.length||e(n,t.mentioned_users)}}var ege=(e,t)=>{let{onMentionsClick:n,onMentionsHover:r}=zB(`useMentionsHandler`),i=t?.onMentionsClick||n||(()=>null),a=t?.onMentionsHover||r||(()=>null);return{onMentionsClick:o8(i,e),onMentionsHover:o8(a,e)}},tge=e=>{let{channel:t}=KB(`useMarkUnreadHandler`);return async n=>{if(n.preventDefault(),!e?.id){console.warn(`Mark unread handler does not have access to message id`);return}await t.markUnread({message_id:e.id})}},nge=`useMuteHandler was called but it is missing one or more necessary parameter.`,rge=e=>{let{mutes:t}=KB(`useMuteHandler`),{client:n}=K(`useMuteHandler`),{t:r}=Y(`useMuteHandler`);return async i=>{if(i.preventDefault(),!r||!e?.user||!n){console.warn(nge);return}XU(e,t)?await n.unmuteUser(e.user.id):await n.muteUser(e.user.id)}},ige=(e,t)=>{let{openThread:n}=zB(`useOpenThreadHandler`),r=t||n;return t=>{if(!r||!e){console.warn(`Open thread handler was called but it is missing one of its parameters`);return}r(e,t)}},age=e=>{let{updateMessage:t}=zB(`usePinHandler`),{channelCapabilities:n={}}=KB(`usePinHandler`),{client:r}=K(`usePinHandler`);return{canPin:!!n[`pin-message`],handlePin:async n=>{if(n.preventDefault(),e)if(e.pinned)try{t({...e,pin_expires:null,pinned:!1,pinned_at:null,pinned_by:null}),await r.unpinMessage(e)}catch{t(e)}else try{t({...e,pinned:!0,pinned_at:new Date,pinned_by:r.user}),await r.pinMessage(e)}catch{t(e)}}}},s8=e=>{let t=[];for(let n of e){let e=n.codePointAt(0);t.push(`U+${e.toString(16).toUpperCase().padStart(4,`0`)}`)}return t.join(`-`)},oge=e=>e.split(`-`).map(e=>String.fromCodePoint(parseInt(e.replace(`U+`,``),16))).join(``),c8={quick:{haha:{Component:()=>(0,R.jsx)(R.Fragment,{children:`😂`}),name:`Joy`,unicode:s8(`😂`)},like:{Component:()=>(0,R.jsx)(R.Fragment,{children:`👍`}),name:`Thumbs up`,unicode:s8(`👍`)},love:{Component:()=>(0,R.jsx)(R.Fragment,{children:`❤️`}),name:`Heart`,unicode:s8(`❤️`)},sad:{Component:()=>(0,R.jsx)(R.Fragment,{children:`😔`}),name:`Sad`,unicode:s8(`😔`)},wow:{Component:()=>(0,R.jsx)(R.Fragment,{children:`😮`}),name:`Astonished`,unicode:s8(`😮`)},fire:{Component:()=>(0,R.jsx)(R.Fragment,{children:`🔥`}),name:`Fire`,unicode:s8(`🔥`)}}},l8=e=>!Array.isArray(e)&&e.extended!==void 0&&Object.keys(e.extended).length>0,sge=(e,t)=>{if(Array.isArray(e))return;let n=e.quick[t]?.unicode??e.extended?.[t]?.unicode;return n?oge(n):void 0},cge=`Reaction handler was called, but it is missing one of its required arguments.
502Make sure the ChannelAction and ChannelState contexts are properly set and the hook is initialized with a valid message.`,lge=e=>{let t=yG(),{updateMessage:n}=zB(`useReactionHandler`),{channel:r,channelCapabilities:i}=KB(`useReactionHandler`),{client:a}=K(`useReactionHandler`),{reactionOptions:o=c8}=q(`useReactionHandler`),s=(0,d.useCallback)((e,t,n)=>{let r=n?.reaction_groups||{},i=t.type,a=!!r[i];if(e){let e=new Date().toISOString();r[i]=a?{...r[i],count:r[i].count+1}:{count:1,first_reaction_at:e,last_reaction_at:e,sum_scores:1}}else a&&r[i].count>1?r[i]={...r[i],count:r[i].count-1}:delete r[i];let o=e?[t,...n?.latest_reactions||[]]:n.latest_reactions?.filter(e=>!(e.type===t.type&&e.user_id===t.user_id)),s=e?[t,...n?.own_reactions||[]]:n?.own_reactions?.filter(e=>e.type!==t.type);return{...n,latest_reactions:o||n.latest_reactions,own_reactions:s,reaction_groups:r}},[a.user,a.userID]),c=(t,n)=>({message_id:e?.id,score:1,type:t,user:a.user,user_id:a.user?.id,...n&&{emoji_code:n}}),l=(0,PB.default)(async(a,l,u)=>{if(!e||!i[`send-reaction`])return;let d=sge(o,l),f=s(u,c(l,d),e);try{n(f),t?.upsertReplyLocally({message:f}),n((u?await r.sendReaction(a,{type:l,...d&&{emoji_code:d}}):await r.deleteReaction(a,l)).message)}catch{n(e),t?.upsertReplyLocally({message:e})}},1e3);return async(t,n)=>{if(n?.preventDefault&&n.preventDefault(),!e)return console.warn(cge);let r=null;
502e.own_reactions&&e.own_reactions.forEach(e=>{e.user&&a.userID===e.user.id&&e.type===t?r=e:e.user&&a.userID!==e.user.id&&console.warn(`message.own_reactions contained reactions from a different user, this indicates a bug`)});try{r?await l(e.id,r.type,!1):await l(e.id,t,!0)}catch(e){console.log({error:e})}}},uge=e=>{let{retrySendMessage:t}=zB(`useRetryHandler`),n=e||t;return async e=>{e&&await n(e)}},dge=(e,t)=>({onUserClick:n=>{typeof t?.onUserClickHandler!=`function`||!e?.user||t.onUserClickHandler(n,e.user)},onUserHover:n=>{typeof t?.onUserHoverHandler!=`function`||!e?.user||t.onUserHoverHandler(n,e.user)}}),u8=(e,t)=>{let{channel:n,channelCapabilities:r={}}=KB(`useUserRole`),{client:i}=K(`useUserRole`),a=i.user?.role===`admin`||n.state.membership.role===`admin`,o=n.state.membership.role===`owner`,s=i.user?.role===`channel_moderator`||n.state.membership.role===`channel_moderator`||n.state.membership.role===`moderator`||n.state.membership.is_moderator===!0||n.state.membership.channel_role===`channel_moderator`,c=i.userID===e.user?.id,l=!e.poll&&e.command!==`giphy`&&(r[`update-any-message`]||c&&r[`update-own-message`]),u=r[`delete-any-message`]||c&&r[`delete-own-message`],d=!c&&r[`flag-message`],f=!c&&r[`mute-channel`];return{canBlockUser:!c,canDelete:u,canEdit:l,canFlag:d,canMarkUnread:!c&&r[`read-events`],canMute:f,canQuote:!t&&r[`quote-message`],canReact:r[`send-reaction`],canReply:r[`send-reply`],
502canSendMessage:r[`send-message`],isAdmin:a,isModerator:s,isMyMessage:c,isOwner:o}};function fge(e){let{client:t}=K(`useRectionsFetcher`);return a8((n,r)=>pge(t,e.id,n,r))}async function pge(e,t,n,r){let i=[],a,o=!0;for(;o&&i.length<1e3;){let s=await e.queryReactions(t,n?{type:n}:{},r,{limit:25,next:a});i.push(...s.reactions),a=s.next,o=!!a}return i}var mge=30,hge=2,gge=({renderingLetterCount:e=hge,streamingLetterIntervalMs:t=mge,text:n})=>{let[r,i]=(0,d.useState)(n),a=(0,d.useRef)(n.length);return(0,d.useEffect)(()=>{let r=n.length,o=setInterval(()=>{if(!n||a.current>=r){clearInterval(o);return}let t=a.current+e,s=n.substring(0,t);a.current+=s.length-a.current,i(s)},t);return()=>{clearInterval(o)}},[t,e,n]),{skipAnimation:a8(()=>{a.current=n.length,i(n)}),streamedMessageText:r}},d8=e=>{let{client:t}=K(),n=(0,d.useCallback)(t=>({reminder:t.reminders.get(e)}),[e]),{reminder:r}=J(t.reminders.state,n);return r},_ge=({ariaDescribedby:e,ariaLabel:t,ariaLabelledby:n,dialogId:r})=>{let{descriptionId:i,titleId:a}=w6(r);return(0,d.useMemo)(()=>{let r=t?n:n??a;return{"aria-describedby":e??i,"aria-label":r?void 0:t,"aria-labelledby":r}},[e,t,n,i,a])},f8=({"aria-describedby":e,"aria-label":t,"aria-labelledby":n,children:r,className:i,CloseButtonOnOverlay:a,dialogId:o,onClose:s,onCloseAttempt:c,open:l,role:u=`dialog`})=>{let f=PU(),p=o??`modal-dialog-${f}`,m=tV(p),h=rV(p),g=aV(p),_=(0,d.useRef)(null),v=(0,d.useRef)(null),y=(0,d.useRef)(!1),{theme:b}=K(),{NotificationList:x=X9}=q(),S=m.id,C=_ge({ariaDescribedby:e,ariaLabel:t,ariaLabelledby:n,dialogId:S}),w=(0,d.useCallback)((e,t)=>{c?.(e,t)!==!1&&(m.close(),y.current=!0,s?.(t))},[m,s,c]),T=(0,d.useMemo)(()=>({close:()=>w(`button`,{}),dialogId:S}),[S,w]);return(0,d.useEffect)(()=>{if(!l){y.current=!1,h&&m.close();return}l&&!h&&!y.current&&m.open()},[m,h,l]),!l||!h?null:(0,R.jsx)(dV,{dialogId:p,dialogManagerId:bV,children:(0,R.jsx)(Qme,{value:T,children:(0,R.jsxs)(`div`,{className:G(`str-chat`,b,`str-chat__modal str-chat-react__modal str-chat__modal--open`,i),onClick:e=>{if(!g)return;let t=e.target;_.current===t&&w(`overlay`,e)},ref:_,children:[(0,R.jsx)(pq,{autoFocus:g,contain:g,restoreFocus:!0,children:(0,R.jsx)(`div`,{"aria-describedby":C[`aria-describedby`],"aria-label":C[`aria-label`],"aria-labelledby":C[`aria-labelledby`],"aria-modal":g?`true`:void 0,className:`str-chat__modal__dialog`,inert:g?void 0:!0,onKeyDown:e=>{e.defaultPrevented||e.key!==`Escape`||!g||w(`escape`,e)},role:u,tabIndex:g?0:-1,children:r})}),(0,R.jsx)(x,{className:`str-chat__modal__notification-list`,panel:`modal`,verticalAlignment:`top`}),a&&(0,R.jsx)(a,{onClick:e=>{g&&w(`button`,e)},ref:v})]})})})};function vge({MessageBouncePrompt:e,...t}){let{Modal:n=f8}=q();return(0,R.jsx)(n,{className:`str-chat__message-bounce-modal`,...t,children:(0,R.jsx)(Jme,{children:(0,R.jsx)(e,{})})})}function yge({children:e}){let{handleDelete:t,handleEdit:n,handleRetry:r}=qme(),{t:i}=Y(),{close:a}=h6();function o(e){return t=>{e(t),a()}}return(0,R.jsxs)(T6.Root,{className:`str-chat__message-bounce-alert`,"data-testid":`message-bounce-prompt`,children:[(0,R.jsx)(T6.Header,{className:`str-chat__message-bounce-alert-header`,description:e?void 0:i(`Review this message and choose whether to delete it, edit it, or send it anyway`),Icon:YH,title:e?void 0:i(`This message did not meet our content guidelines`),children:e}),(0,R.jsxs)(T6.Actions,{className:`str-chat__message-bounce-actions`,children:[(0,R.jsx)(nH,{appearance:`outline`,className:`str-chat__message-bounce-delete`,"data-testid":`message-bounce-delete`,onClick:o(t),size:`md`,variant:`danger`,children:i(`Delete`)}),(0,R.jsx)(nH,{appearance:`outline`,className:`str-chat__message-bounce-edit`,"data-testid":`message-bounce-edit`,onClick:o(n),size:`md`,variant:`secondary`,children:i(`Edit Message`)}),(0,R.jsx)(nH,{appearance:`outline`,className:`str-chat__message-bounce-send`,"data-testid":`message-bounce-send`,onClick:o(r),size:`md`,variant:`secondary`,children:i(`Send Anyway`)})]})]})}var p8=({className:e,...t})=>(0,R.jsx)(`div`,{...t,className:G(`str-chat__message-bubble`,e)}),bge=()=>{let{t:e}=Y();return(0,R.jsx)(p8,{"data-testid":`message-deleted-bubble`,children:(0,R.jsxs)(`div`,{className:`str-chat__message-text`,children:[(0,R.jsx)(MH,{}
502),(0,R.jsx)(`span`,{children:e(`Message deleted`)})]})})},xge=()=>{let{message:e}=o6(),{t}=Y(`MessageBlocked`),{isMyMessage:n}=u8(e);return(0,R.jsx)(`div`,{className:G(`str-chat__message str-chat__message--blocked`,e.type,{"str-chat__message--me":n,"str-chat__message--other":!n}),"data-testid":`message-blocked-component`,children:(0,R.jsx)(`div`,{className:`str-chat__message--blocked-inner`,children:t(`Message was blocked by moderation policies`)})},e.id)},Sge=(e,t=!1)=>{let{initialMessage:n,message:r}=o6(),{channelConfig:i}=KB(),a=_W(r),{canBlockUser:o,canDelete:s,canEdit:c,canFlag:l,canMarkUnread:u,canMute:f,canQuote:p,canReact:m,canReply:h,canSendMessage:g}=u8(r),_=typeof r.parent_id==`string`,v=hW(r),y=pW(r),b=mW(r);return(0,d.useMemo)(()=>t?e:v||n||!r.type||r.type===`system`||r.type===`ephemeral`||r.status===`sending`?[]:e.filter(e=>{if(e.placement===`quick-dropdown-toggle`)return!0;let t=e.type;return eW.includes(t)&&_?!1:r.error?t===`resendMessage`&&g&&(y||v)||t===`edit`&&(v&&c||b)||t===`delete`&&!a&&(v&&s||b):!(t===`resendMessage`||t===`blockUser`&&!o||t===`copyMessageText`&&!r.text||t===`download`&&!r.attachments?.some(e=>pb(e)||mb(e)||yb(e)||gb(e)||_b(e))||t===`delete`&&(!s||a)||t===`edit`&&!c||t===`flag`&&!l||t===`markUnread`&&!u||t===`mute`&&!f||t===`quote`&&!p||t===`react`&&!m||t===`reply`&&!h||t===`remindMe`&&!i?.user_message_reminders||t===`saveForLater`&&!i?.user_message_reminders)}),[y,o,s,c,l,u,f,p,m,h,g,i,v,n,a,_,r.error,r.attachments,r.status,r.text,r.type,t,b,e])},Cge=()=>{let{addNotification:e}=GG(),{t}=Y(),{channel:n}=KB(),{jumpToMessage:r,openThread:i}=zB(),{message:a,threadList:o}=o6(`MessageAlsoSentInChannelIndicator`),s=(0,d.useRef)(void 0),c=()=>n.getClient().search({cid:n.cid},{id:a.parent_id}).then(({results:e})=>{if(!e.length)throw Error(`Thread has not been found`);s.current=Ry(e[0].message)}).catch(n=>{e({context:{threadReply:a},emitter:`MessageIsThreadReplyInChannelButtonIndicator`,error:n,message:t(`Thread has not been found`),severity:`error`,type:`api:reply:search:failed`})}),l=async e=>{await r(e)};return(0,d.useEffect)(()=>{if(s.current||s.current===null||!a.parent_id)return;let e=n.state.findMessage(a.parent_id);if(e){s.current=e;return}},[n,a]),a?.show_in_channel?(0,R.jsxs)(`div`,{className:`str-chat__message-also-sent-in-channel`,role:`status`,children:[(0,R.jsx)(lH,{}),(0,R.jsx)(`span`,{children:t(o?`Also sent in channel`:`Replied to a thread`)}),(0,R.jsx)(`span`,{children:` · `}),(0,R.jsx)(`button`,{className:`str-chat__message-also-sent-in-channel__link-button`,onClick:async()=>{if(!s.current)if(o){await l(a.id);return}else await c();let e=s.current;if(!e){s.current=null;return}o?await l(a.id):i(e)},type:`button`,children:t(`View`)})]}):null};function wge(e){let{AvatarStack:t=j6}=q(m8.name),{labelPlural:n,labelSingle:r,onClick:i,reply_count:a=0,thread_participants:o=[]}=e,{channelCapabilities:s}=KB(),{t:c}=Y(`MessageRepliesCountButton`),l=(0,d.useMemo)(()=>o.slice(0,3).map(e=>({imageUrl:e.image,userName:e.name||e.id})),[o]);if(!a)return null;let u=c(`replyCount`,{count:a});return n&&a>1?u=`${a} ${n}`:r&&(u=`1 ${r}`),(0,R.jsx)(`div`,{className:`str-chat__message-replies-count-button-wrapper`,children:(0,R.jsxs)(`button`,{className:`str-chat__message-replies-count-button`,"data-testid":`replies-count-button`,disabled:!s[`send-reply`],onClick:i,children:[u,(0,R.jsx)(t,{displayInfo:l,size:`xs`})]})})}var m8=d.memo(wge),Tge=({message:e})=>{let{t}=Y(),{client:n}=K();if(!e)return null;let r=!!e.pinned_by?.id&&e.pinned_by.id===n.user?.id,i=e.pinned_by?.name??e.pinned_by?.id??``,a=r?t(`Pinned by You`):i?t(`Pinned by {{ name }}`,{name:i}):t(`Message pinned`);return(0,R.jsx)(`div`,{className:`str-chat__message-pin-indicator`,children:(0,R.jsxs)(`div`,{className:`str-chat__message-pin-indicator__content`,children:[(0,R.jsx)(`span`,{"aria-hidden":!0,className:`str-chat__message-pin-indicator__icon`,children:(0,R.jsx)(hU,{})}),(0,R.jsx)(`span`,{children:a})]})})},h8=({children:e,className:t,offset:n=[0,10],placement:r=`top`,referenceElement:i,visible:a=!1})=>{let[o,s]=(0,d.useState)(null),{placement:c,refs:l,strategy:u,x:f,y:p}=QV({offset:n,placement:r});return(0,d.useEffect)(()=>{l.setReference(i)},[i,l]),(0,d.useEffect)(()=>{l.setFloating(o)},[o,l]),a?(0,R.jsx)(`div`,{className:G(`str-chat__tooltip`,t),"data-placement":c,ref:s,style:{left:f??0,position:u,top:p??0},children:e}):null},g8=({onMouseEnter:e,onMouseLeave:t}={})=>{let[n,r]=(0,d.useState)(!1);return{handleEnter:(0,d.useCallback)(t=>{r(!0),e?.(t)},[e]),handleLeave:(0,d.useCallback)(e=>{r(!1),t?.(e)},[t]),tooltipVisible:n}},Ege=d.memo(e=>{let{MessageDeliveredStatus:t,MessageReadStatus:n,MessageSendingStatus:r,MessageSentStatus:i,messageType:a=`simple`,tooltipUserNameMapper:o=lW}=e,{handleEnter:s,handleLeave:c,tooltipVisible:l}=g8(),{client:u}=K(`MessageStatus`),{deliveredTo:f,isMyMessage:p,lastOwnMessage:m,message:h,readBy:g,returnAllReadData:_,threadList:v}=o6(`MessageStatus`),{t:y}=Y(`MessageStatus`),[b,x]=(0,d.useState)(null);if(!p()||h.type===`error`)return null;let S=g?.length===1&&g[0].id===u.user?.id,C=f?.length===1&&f[0].id===u.user?.id,w=h.status===`sending`,T=!!(g?.length&&!S&&!v),E=!!(f?.length&&!C&&!T&&!v),D=(_||m?.id===h.id)&&h.status===`re
502ceived`&&!E&&!T&&!v,O=T?g.filter(e=>e.id!==u.user?.id):[];return(0,R.jsxs)(`span`,{className:G(`str-chat__message-${a}-status str-chat__message-status`,{"str-chat__message-status-delivered":E,"str-chat__message-status-read-by":T,"str-chat__message-status-sending":w,"str-chat__message-status-sent":D}),"data-testid":G({"message-status-delivered":E,"message-status-read-by":T,"message-status-sending":w,"message-status-sent":D}),onMouseEnter:s,onMouseLeave:c,ref:x,children:[w&&(r?(0,R.jsx)(r,{}):(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(h8,{offset:[0,5],referenceElement:b,visible:l,children:y(`Sending...`)}),(0,R.jsx)(IH,{className:`str-chat__message-status-sending`})]})),D&&(i?(0,R.jsx)(i,{}):(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(h8,{offset:[0,5],referenceElement:b,visible:l,children:y(`Sent`)}),(0,R.jsx)(DH,{className:`str-chat__message-status-sent`})]})),E&&(t?(0,R.jsx)(t,{}):(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(h8,{offset:[0,5],referenceElement:b,visible:l,children:y(`Delivered`)}),(0,R.jsx)(HH,{className:`str-chat__message-status-delivered`})]})),T&&(n?(0,R.jsx)(n,{}):(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(h8,{offset:[0,5],referenceElement:b,visible:l,children:uW(g,y,u,o)}),(0,R.jsx)(HH,{className:`str-chat__message-status-read`}),O.length>1&&(0,R.jsx)(`span`,{className:`str-chat__message-${a}-status-number`,"data-testid":`message-status-read-by-many`,children:O.length})]}))]})});function Dge(e){return e.replace(/[-[\]{}()*+?.,/\\^$|#]/g,`\\$&`)}var _8=/(http(s?):\/\/)?(www\.)?/,Oge=/```[a-z]*\n[\s\S]*?\n```|`[a-z]*[\s\S]*?`/gm,kge=/\[([^[]+)\](\(.*\))/gm,Age=/\[([^[]+)\]\((.*)\)/,jge=e=>e.match(Oge)||[],Mge=e=>{let t=e.match(kge);return(t?t.map(e=>{let t=Age.exec(e);return t&&[t[1],t[2]]}):[]).flat()},Nge=()=>{let e=e=>TJ(`element`,{properties:{},tagName:`emoji`},[TJ(`text`,e)]);return t=>xJ(t,[YU,e])},Pge=e=>()=>{let t=e.map(e=>e.name||e.id).filter(Boolean).map(Dge),n=new RegExp(t.map(e=>`@${e}`).join(`|`),`g`),r=t=>{let n=t.replace(`@`,``);return TJ(`element`,{mentionedUser:e.find(({id:e,name:t})=>t===n||e===n),properties:{},tagName:`mention`},[TJ(`text`,t)])};return e=>{t.length&&(EJ(e,(e,t,n)=>{if(t===void 0||!n)return;let r=n.children.at(t+1)?.properties?.href;if(e.type===`text`&&/.?\s?@$|^@$/.test(e.value)&&r?.startsWith(`mailto:`)){let i=e.value.replace(/@$/,``),a=r.replace(`mailto:`,``);n.children[t]=TJ(`text`,i),n.children[t+1]=TJ(`text`,`@${a}`)}}),xJ(e,[n,r]))}},Fge=e=>{e.type===`html`&&(e.type=`text`)},Ige=e=>{EJ(e,Fge)},v8=()=>Ige,Lge=e=>({type:`text`,value:e});function y8({getTextLabelFrom:e=`url`}={}){return t=>{EJ(t,`image`,(t,n,r)=>{if(r==null||n==null)return;let i={children:[Lge(t[e]??t.url)],title:t.title??t.alt??t.url,type:`link`,url:t.url};return r.children.splice(n,1,i),[lJ,n+1]})}}function Rge(e){let t=e;return Array.isArray(t.children)}function zge(){return{data:{hName:`br`},type:`thematicBreak`}}var Bge=()=>e=>{EJ(e,Rge,e=>{let t=e.children;if(t.length<2)return;let n=[];for(let e=0;e<t.length;e++){let r=t[e];if(n.push(r),e===t.length-1)break;let i=t[e+1],a=r.position&&r.position.end?r.position.end.line:void 0,o=i.position&&i.position.start?i.position.start.line:void 0;if(typeof a!=`number`||typeof o!=`number`)continue;let s=Math.max(0,o-a-1);if(s>0)for(let e=0;e<s;e++)n.push(zge())}e.children=n})},b8=/\+\+(\S(?:[\s\S]*?\S)?)\+\+/g,Vge=new Set([`code`,`inlineCode`,`link`,`linkReference`,`definition`,`math`,`inlineMath`]),x8=()=>{let e=(e,t,n)=>{if(Vge.has(e.type))return lJ;if(e.type!==`text`||n==null||typeof t!=`number`)return;let r=e.value;b8.lastIndex=0;let i,a=0,o=[];for(;i=b8.exec(r);){let[e,t]=i,n=i.index;n>a&&o.push({type:`text`,value:r.slice(a,n)}),o.push({children:[{type:`text`,value:t}],data:{hName:`ins`},type:`emphasis`}),a=n+e.length}if(o.length!==0)return a<r.length&&o.push({type:`text`,value:r.slice(a)}),n.children.splice(t,1,...o),[lJ,t+o.length]};return t=>EJ(t,e)},Hge=({children:e,href:t})=>{let n=t?.startsWith(`mailto:`),r=t?.startsWith(`http`);return!t||!n&&!r?(0,R.jsx)(R.Fragment,{children:e}):(0,R.jsx)(`a`,{className:G({"str-chat__message-url-link":r}),href:t,rel:`nofollow noreferrer noopener`,target:`_blank`,children:e})},Uge=({children:e})=>(0,R.jsx)(`span`,{className:`inline-text-emoji`,"data-testid":`inline-text-emoji`,children:e}),Wge=({children:e,node:{mentionedUser:t}})=>(0,R.jsx)(`span`,{className:`str-chat__message-mention`,"data-user-id":t.id,children:e}),Gge=()=>null,Kge=class extends d.Component{constructor(e){super(e),this.state={hasError:!1}}static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(e,t){console.error(e,t)}render(){return this.state.hasError?this.props.fallback:this.props.children}},qge=`html.text.br.p.em.strong.a.ol.ul.li.code.pre.blockquote.del.table.thead.tbody.th.tr.td.tfoot.emoji.mention.h1.h2.h3.h4.h5.h6.ins`.split(`.`);function Jge(e){try{return decodeURIComponent(e).replace(_8,``)}catch{return e}}function S8(e){try{return encodeURI(decodeURIComponent(e))}catch{return e}}var Yge=e=>
502e.startsWith(`app://`)?e:z1(e),C8=e=>e,Xge={a:Hge,emoji:Uge,mention:Wge},Zge=(e,t,{allowedTagNames:n=qge,customMarkDownRenderers:r,getRehypePlugins:i=C8,getRemarkPlugins:a=C8}={})=>{if(!e)return null;if(e.trim().length===1)return(0,R.jsx)(R.Fragment,{children:e});let o=e,s=Mge(o),c=jge(o),l=[...Kv(o,`email`),...Kv(o,`url`)];for(let e=l.length-1;e>=0;e--){let{end:n,href:r,start:i,type:a,value:u}=l[e],d=c.some(e=>e?.includes(u));if(!((s&&s.filter(e=>{let t=r?.replace(_8,``),n=e?.replace(_8,``);return!t||!n?!1:t.includes(n)||n.includes(t)})).length>0||d))try{if(a===`email`&&t){if(t.find(e=>e.name===u)){let e=o.charAt(i-1)===`@`;o=o.slice(0,i)+(e?u:`[${u}](${S8(r)})`)+o.slice(n)}}else{let e=a===`email`?u:Jge(r);o=o.slice(0,i)+`[${e}](${S8(r)})`+o.slice(n)}}catch{}}let u=[v8,Bge,[j0,{singleTilde:!1}],x8,y8],d=[Nge];return t?.length&&d.push(Pge(t)),(0,R.jsx)(Kge,{fallback:(0,R.jsx)(R.Fragment,{children:e}),children:(0,R.jsx)(R1,{allowedElements:n,components:{...Xge,...r},rehypePlugins:i(d),remarkPlugins:a(u),skipHtml:!0,unwrapDisallowed:!0,urlTransform:Yge,children:o})})},w8=d.memo(e=>{let{customInnerClass:t,customWrapperClass:n=``,message:r,renderText:i}=e,{message:a,onMentionsClickMessage:o,onMentionsHoverMessage:s,renderText:c,translationView:l=`translated`,unsafeHTML:u}=o6(`MessageText`),f=i??c??Zge,{t:p,userLanguage:m}=Y(`MessageText`),h=r||a,g=oW(h),_=PU(),v=PU(),y=l===`original`?h.text:u6({language:m,message:h})||h.text,b=(0,d.useMemo)(()=>f(y,h.mentioned_users),[h.mentioned_users,y,f]),x=n||`str-chat__message-text`,S=t,C=!!h.mentioned_users?.length&&typeof o==`function`,w=h.user?.name,T=w?p(`aria/Message from {{ user }},`,{user:w}):p(`aria/Message,`),E=`${_} ${v}`;return y?(0,R.jsxs)(`div`,{"aria-labelledby":C?void 0:E,className:x,tabIndex:C?void 0:0,children:[(0,R.jsx)(v6,{id:_,children:T}),(0,R.jsx)(`div`,{"aria-labelledby":C?E:void 0,className:G(S,{" str-chat__message-text-inner--is-emoji":fW(h)&&!h.quoted_message,"str-chat__message-text-inner--has-attachment":g}),"data-testid":`message-text-inner-wrapper`,onClick:o,onKeyDown:C?e=>{!C||e.key!==`Enter`&&e.key!==` `||(e.preventDefault(),o(e))}:void 0,onMouseOver:s,tabIndex:C?0:void 0,children:u&&h.html?(0,R.jsx)(`div`,{dangerouslySetInnerHTML:{__html:h.html},id:v}):(0,R.jsx)(`div`,{id:v,children:b})})]}):null});function T8(e){let{calendar:t,calendarFormats:n,customClass:r,format:i,timestamp:a}=e,{formatDate:o}=o6(`MessageTimestamp`),{t:s,tDateTimeParser:c}=Y(`MessageTimestamp`),l=a&&kV(a)?a.toISOString():a,u=(0,d.useMemo)(()=>NV({calendar:t,calendarFormats:n,format:i,formatDate:o,messageCreatedAt:l,t:s,tDateTimeParser:c,timestampTranslationKey:`timestamp/MessageTimestamp`}),[t,n,i,o,l,s,c]);return u?(0,R.jsx)(`time`,{className:r,dateTime:l,title:l,children:u}):null}var E8=d.memo(e=>{let{message:t,...n}=e,{message:r}=o6(`MessageTimestamp`),{Timestamp:i=T8}=q(`MessageTimestamp`);return(0,R.jsx)(i,{timestamp:(t||r).created_at,...n})}),Qge=d.memo(e=>{let{customClass:t,message:n,...r}=e,{message:i}=o6(`MessageEditedIndicator`),{t:a}=Y(`MessageEditedIndicator`),{Timestamp:o=T8}=q(`MessageEditedIndicator`),s=n??i,[c,l]=(0,d.useState)(null),{handleEnter:u,handleLeave:f,tooltipVisible:p}=g8();return s?.message_text_updated_at?(0,R.jsxs)(`span`,{className:t??`str-chat__message-edited-indicator`,"data-testid":`message-edited-indicator`,onMouseEnter:u,onMouseLeave:f,ref:l,children:[a(`Edited`),(0,R.jsx)(h8,{offset:[0,5],placement:`top`,referenceElement:c,visible:p,children:(0,R.jsx)(o,{timestamp:s.message_text_updated_at,...r})})]}):null}),$ge=({message:e})=>{let{t,userLanguage:n}=Y(),{message:r,setTranslationView:i,translationView:a}=o6(`MessageTranslationIndicator`),o=e??r,s=(0,d.useMemo)(()=>u6({language:n,message:o}),[n,o]),c=(0,d.useMemo)(()=>s!=null&&o?.text!==void 0&&s!==o.text,[s,o?.text]),l=(0,d.useMemo)(()=>a===`original`||a===void 0&&!c,[a,c]),u=(0,d.useCallback)(()=>{i?.(l?`translated`:`original`)},[i,l]),f=(0,d.useMemo)(()=>{let e=o?.i18n?.language;if(!e)return``;let n=`language/`+e,r=t(n);return r&&r!==n?r:e},[o?.i18n?.language,t]);return!o?.i18n||!i||!c?null:(0,R.jsxs)(`div`,{className:`str-chat__message-translation-indicator`,children:[(0,R.jsx)(SU,{}),(0,R.jsx)(`span`,{className:`str-chat__message-translation-indicator__sign`,children:l?t(`Original`):f?t(`Translated from {{ language }}`,{language:f}):t(`Translated`)}),(0,R.jsx)(`span`,{children:` · `}),(0,R.jsx)(nH,{className:`str-chat__message-translation-indicator__translation-toggle`,onClick:u,type:`button`,children:t(l?`View translation`:`View original`)})]})},D8=({assetUrl:e,className:t,suggestedFileName:n,tooltipTitle:r})=>{let{t:i}=Y();if(!e)return null;let a=(0,M0.sanitizeUrl)(e);return a?(0,R.jsx)(`a`,{"aria-label":i(`aria/Download attachment`),className:G(`str-chat__button`,`str-chat__button--secondary`,`str-chat__button--outline`,`str-chat__button--circular`,`str-chat__button--size-sm`,`str-chat__audio-attachment-download-button`,t),download:n??``,href:a,rel:`noopener noreferrer`,target:`_blank`,title:r??i(`Download Attachment`),children:(0,R.jsx)(`div`,{className:`str-chat__button__content`,children:(0,R.jsx)(UH,{className:`str-chat__icon str-chat__audio-attachment-download-button__icon`})})}):null},O8=`str-chat__file-icon`,k8=`str-chat__file-icon__graphic`,A8={lg:{height:40,labelX:16,labelY:36,width:32}
502,md:{height:32,labelX:16,labelY:35,width:26},sm:{height:24,labelX:16,labelY:31.5,width:19},xl:{height:48,labelX:16,labelY:36,width:40}},e_e=e=>e?[`sm`,`md`,`lg`,`xl`].reduce((t,n)=>({...t,[n]:{...A8[n],...e[n]}}),{}):A8,j8={height:40,width:32},M8=`M0 4C0 1.79086 1.79086 0 4 0H22.4L32 10V36C32 38.2091 30.2091 40 28 40H4C1.79086 40 0 38.2091 0 36V4Z`,N8=`M32 10H25.4C23.7431 10 22.4 8.65685 22.4 7V0L32 10Z`,P8=32/26,F8=40/32,I8=({className:e,size:t,sizeConfig:n,...r})=>{let i=t?(n??A8)[t]:void 0,a=i?{flexShrink:0,height:`${i.height}px`,width:`${i.width}px`}:void 0;return(0,R.jsx)(`svg`,{height:i?.height,viewBox:`0 0 ${j8.width} ${j8.height}`,width:i?.width,xmlns:`http://www.w3.org/2000/svg`,...r,className:G(O8,{[`${O8}--size-${t}`]:t},e),style:{...a,...r.style}})},t_e=({label:e,size:t,sizeConfig:n})=>{let r=t?(n??A8)[t]:{labelX:16,labelY:33};return(0,R.jsx)(`text`,{className:`str-chat__file-icon__label`,x:r.labelX,y:r.labelY,children:e})},L8={withCaption:(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(`rect`,{fill:`white`,height:`1.6`,rx:`0.8`,width:`14.4`,x:`8`,y:`12.2`}),(0,R.jsx)(`rect`,{fill:`white`,height:`1.6`,rx:`0.8`,width:`14.4`,x:`8`,y:`20.2`}),(0,R.jsx)(`rect`,{fill:`white`,height:`1.6`,rx:`0.8`,width:`9.6`,x:`8`,y:`16.2`})]}),withoutCaption:(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(`rect`,{fill:`white`,height:`1.4`,rx:`0.7`,width:`12.6`,x:`6`,y:`14.8`}),(0,R.jsx)(`rect`,{fill:`white`,height:`1.4`,rx:`0.7`,width:`12.6`,x:`6`,y:`21.8`}),(0,R.jsx)(`rect`,{fill:`white`,height:`1.4`,rx:`0.7`,width:`8.4`,x:`6`,y:`18.3`})]})},n_e={withCaption:(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(`rect`,{fill:`white`,height:`1.6`,rx:`0.8`,width:`14.4`,x:`8`,y:`13.2`}),(0,R.jsx)(`rect`,{fill:`white`,height:`1.6`,rx:`0.8`,width:`14.4`,x:`8`,y:`21.2`}),(0,R.jsx)(`rect`,{fill:`white`,height:`1.6`,rx:`0.8`,width:`9.6`,x:`8`,y:`17.2`})]}),withoutCaption:L8.withoutCaption},r_e={withCaption:(0,R.jsx)(`path`,{d:`M14.5 22.5L17.5 11.5M20.1666 14.1667L21.9732 16.0862C22.4564 16.5996 22.4564 17.4004 21.9732 17.9138L20.1666 19.8333M11.8333 19.8333L10.0267 17.9138C9.54351 17.4004 9.54351 16.5996 10.0267 16.0862L11.8333 14.1667`,stroke:`white`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.2`}),withoutCaption:(0,R.jsx)(`path`,{d:`M11.6876 23.8125L14.3126 14.1875M16.646 16.5208L18.2267 18.2004C18.6495 18.6496 18.6495 19.3503 18.2267 19.7996L16.646 21.4792M9.3543 21.4792L7.77352 19.7996C7.35072 19.3503 7.35072 18.6496 7.77352 18.2004L9.3543 16.5208`,stroke:`white`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.33333`})},i_e={withCaption:(0,R.jsx)(`path`,{d:`M20.5 15.5V18.5M22.5 14.5V19.5M13.5 19.5H10.5C10.3674 19.5 10.2402 19.4473 10.1464 19.3536C10.0527 19.2598 10 19.1326 10 19V15C10 14.8674 10.0527 14.7402 10.1464 14.6464C10.2402 14.5527 10.3674 14.5 10.5 14.5H13.5L18 11V23L13.5 19.5Z`,stroke:`white`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.2`}),withoutCaption:(0,R.jsx)(`path`,{d:`M17.5 17.5V20.5M19.5 16.5V21.5M10.5 21.5H7.5C7.36739 21.5 7.24021 21.4473 7.14645 21.3536C7.05268 21.2598 7 21.1326 7 21V17C7 16.8674 7.05268 16.7402 7.14645 16.6464C7.24021 16.5527 7.36739 16.5 7.5 16.5H10.5L15 13V25L10.5 21.5Z`,stroke:`white`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.33333`})},a_e={withCaption:(0,R.jsx)(`path`,{d:`M12.5 15.5H19.5M16 17.5V22.5M14 22.5H18M9.49999 17.5C9.41472 17.5001 9.33085 17.4783 9.25635 17.4368C9.18185 17.3953 9.1192 17.3355 9.07436 17.263C9.02952 17.1904 9.00397 17.1076 9.00014 17.0224C8.99631 16.9373 9.01433 16.8525 9.05249 16.7762L11.5525 11.7763C11.5941 11.6932 11.6579 11.6233 11.737 11.5745C11.816 11.5257 11.9071 11.4999 12 11.5H20C20.0929 11.4999 20.184 11.5257 20.263 11.5745C20.342 11.6233 20.4059 11.6932 20.4475 11.7763L22.9475 16.7762C22.9857 16.8525 23.0037 16.9373 22.9998 17.0224C22.996 17.1076 22.9705 17.1904 22.9256 17.263C22.8808 17.3355 22.8181 17.3953 22.7436 17.4368C22.6691 17.4783 22.5853 17.5001 22.5 17.5H9.49999Z`,stroke:`white`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.2`}),withoutCaption:(0,R.jsx)(`path`,{d:`M9.49999 17.5H16.5M13 19.5V24.5M11 24.5H15M6.49999 19.5C6.41472 19.5001 6.33085 19.4783 6.25635 19.4368C6.
50218185 19.3953 6.11921 19.3355 6.07436 19.263C6.02952 19.1904 6.00397 19.1076 6.00014 19.0224C5.99631 18.9373 6.01433 18.8525 6.05249 18.7763L8.55249 13.7763C8.59406 13.6932 8.65795 13.6233 8.73699 13.5745C8.81603 13.5257 8.9071 13.4999 8.99999 13.5H17C17.0929 13.4999 17.184 13.5257 17.263 13.5745C17.342 13.6233 17.4059 13.6932 17.4475 13.7763L19.9475 18.7763C19.9857 18.8525 20.0037 18.9373 19.9998 19.0224C19.996 19.1076 19.9705 19.1904 19.9256 19.263C19.8808 19.3355 19.8181 19.3953 19.7436 19.4368C19.6691 19.4783 19.5853 19.5001 19.5 19.5H6.49999Z`,stroke:`white`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.33333`})},o_e={withCaption:(0,R.jsx)(`path`,{d:`M10 15.5H22M10 18.5H22M13.5 15.5V21.5M10 12.5H22V21C22 21.1326 21.9473 21.2598 21.8536 21.3536C21.7598 21.4473 21.6326 21.5 21.5 21.5H10.5C10.3674 21.5 10.2402 21.4473 10.1464 21.3536C10.0527 21.2598 10 21.1326 10 21V12.5Z`,stroke:`white`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.5`}),withoutCaption:(0,R.jsx)(`path`,{d:`M7 17.5H19M7 20.5H19M10.5 17.5V23.5M7 14.5H19V23C19 23.1326 18.9473 23.2598 18.8536 23.3536C18.7598 23.4473 18.6326 23.5 18.5 23.5H7.5C7.36739 23.5 7.24021 23.4473 7.14645 23.3536C7.05268 23.2598 7 23.1326 7 23V14.5Z`,stroke:`white`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.2`})},s_e={withCaption:(0,R.jsx)(`path`,{clipRule:`evenodd`,d:`M9.41177 0H7.52942V2H9.41177V4H7.52942V6H9.41177V8H7.52942V10H9.41177V12H7.52942V14H9.41177V12H11.2941V10H9.41177V8H11.2941V6H9.41177V4H11.2941V2H9.41177V0ZM7.52942 17C7.52942 16.4477 7.9508 16 8.4706 16H10.3529C10.8727 16 11.2941 16.4477 11.2941 17V23C11.2941 23.5523 10.8727 24 10.3529 24H8.4706C7.9508 24 7.52942 23.5523 7.52942 23V17ZM8.4706 23V20H10.3529V23H8.4706Z`,fill:`white`,fillRule:`evenodd`}),withoutCaption:(0,R.jsx)(`path`,{clipRule:`evenodd`,d:`M8.17031 0H6.11768V2.14737H8.17031V4.29474H6.11768V6.4421H8.17031V8.58947H6.11768V10.7368H8.17031V12.8842H6.11768V15.0316H8.17031V12.8842H10.2229V10.7368H8.17031V8.58947H10.2229V6.4421H8.17031V4.29474H10.2229V2.14737H8.17031V0ZM6.11768 18.2526C6.11768 17.6597 6.57717 17.1789 7.14399 17.1789H9.19662C9.76344 17.1789 10.2229 17.6597 10.2229 18.2526V24.6947C10.2229 25.2877 9.76344 25.7684 9.19662 25.7684H7.14399C6.57717 25.7684 6.11768 25.2877 6.11768 24.6947V18.2526ZM7.14399 24.6947V21.4737H9.19662V24.6947H7.14399Z`,fill:`white`,fillRule:`evenodd`})},c_e={withCaption:(0,R.jsx)(`path`,{d:`M20.5 16L23.5 14V20L20.5 18M10 13H20C20.2761 13 20.5 13.2239 20.5 13.5V20.5C20.5 20.7761 20.2761 21 20 21H10C9.72386 21 9.5 20.7761 9.5 20.5V13.5C9.5 13.2239 9.72386 13 10 13Z`,stroke:`white`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.2`}),withoutCaption:(0,R.jsx)(`path`,{d:`M17.5001 18L20.5001 16V22L17.5001 20M7.00012 15H17.0001C17.2763 15 17.5001 15.2239 17.5001 15.5V22.5C17.5001 22.7761 17.2763 23 17.0001 23H7.00012C6.72398 23 6.50012 22.7761 6.50012 22.5V15.5C6.50012 15.2239 6.72398 15 7.00012 15Z`,stroke:`white`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.33333`})},R8=({className:e,color:t,fileTypeClassName:n,label:r,size:i,sizeConfig:a,symbols:o,...s})=>{let c=!!r,l=c?r:void 0,u=c?`withCaption`:`withoutCaption`;return(0,R.jsxs)(I8,{...s,className:G(n,e),size:i,sizeConfig:a,children:[(0,R.jsxs)(`g`,{className:k8,children:[(0,R.jsx)(`path`,{d:M8,fill:t}),c?o[u]:(0,R.jsx)(`g`,{transform:`scale(${P8} ${F8})`,children:o[u]}),(0,R.jsx)(`path`,{d:N8,fill:`white`,opacity:`0.5`})]}),l&&(0,R.jsx)(t_e,{label:l,size:i,sizeConfig:a})]})},l_e=(0,R.jsx)(`path`,{d:`M20.7533 19.5337C20.28 19.037 19.3093 18.7537 17.9373 18.7537C17.204 18.7537 16.3526 18.8244 15.43 18.9897C14.8647 18.4461 14.3499 17.8523 13.892 17.2157C13.5373 16.7424 13.2293 16.2224 12.9453 15.725C13.49 14.069 13.75 12.7204 13.75 11.7504C13.75 10.6624 13.348 9.52637 12.1886 9.52637C11.834 9.52637 11.4786 9.7397 11.2893 10.047C10.7693 10.9697 11.006 12.9804 11.9046 14.9677C11.5664 15.984 11.1876 16.9863 10.7693 17.9724C10.3906 18.8717 9.96465 19.7944 9.49131 20.6457C6.88931 21.687 5.20931 22.8937 5.01998 23.839C4.94931 24.1944 5.06731 24.5257 5.32798 24.7857C5.42265 24.857 5.75398 25.141 6.32131 25.141C8.04798 25.141 9.86998 22.349 10.7926 20.6697C11.5026 20.433 12.2126 20.1964 12.922 20.007C13.6704 19.8038 14.4284 19.638 15.1933 19.5104C17.0146 21.1424 18.6233 21.403 19.428 21.403C20.4213 21.403 20.7766 21.0004 20.8946 20.6697C21.108 20.243 20.966 19.7704 20.7533 19.5337ZM19.8066 20.2204C19.7353 20.575 19.38 20.8117 18.884 20.8117C18.742 20.8117 18.624 20.7877 18.4813 20.7644C17.5826 20.551 16.7306 20.1017 15.8793 19.3917C16.5357 19.2807 17.2003 19.2254 17.866 19.2264C18.3633 19.2264 18.7893 19.2497 19.0726 19.321C19.404 19.3917 19.9246 19.605 19.806 20.2197L19.8066 20.2204ZM14.7906 19.1084C14.1305 19.2321 13.4755 19.382 12.8273 19.5577C12.262 19.7047 11.7017 19.8703 11.1473 20.0544C11.4355 19.4962 11.7039 18.9281 11.952 18.351C12.236 17.6884 12.472 17.0024 12.7093 16.3637C12.9453 16.7657 13.206 17.1684 13.466 17.523C13.8911 18.065 14.3329 18.5937 14.7906 19.1084ZM11.692 10.307C11.7338 10.2232 11.7978 10.1525 11.877 10.1025C11.9563 10.0526 12.0477 10.0253 12.1413 
50210.0237C12.638 10.0237 12.7326 10.591 12.7326 11.041C12.7326 11.7977 12.496 12.957 12.094 14.2817C11.4073 12.4364 11.3606 10.899 11.692 10.307ZM9.08931 21.3317C7.88265 23.319 6.72331 24.549 6.01398 24.549C5.88599 24.5498 5.76132 24.5083 5.65931 24.431C5.51731 24.289 5.44598 24.1237 5.49331 23.9344C5.63531 23.2244 7.00731 22.231 9.08931 21.3317Z`,fill:`white`}),u_e=(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(`path`,{d:`M23.7533 19.2C23.28 18.7033 22.3093 18.42 20.9373 18.42C20.204 18.42 19.3526 18.4906 18.43 18.656C17.8647 18.1124 17.3499 17.5186 16.892 16.882C16.5373 16.4086 16.2293 15.8886 15.9453 15.3913C16.49 13.7353 16.75 12.3866 16.75 11.4166C16.75 10.3286 16.348 9.19263 15.1886 9.19263C14.834 9.19263 14.4786 9.40596 14.2893 9.71329C13.7693 10.636 14.006 12.6466 14.9046 14.634C14.5664 15.6502 14.1877 16.6526 13.7693 17.6386C13.3906 18.538 12.9646 19.4606 12.4913 20.312C9.88931 21.3533 8.20931 22.56 8.01998 23.5053C7.94931 23.8606 8.06731 24.192 8.32798 24.452C8.42265 24.5233 8.75398 24.8073 9.32131 24.8073C11.048 24.8073 12.87 22.0153 13.7926 20.336C14.5026 20.0993 15.2126 19.8626 15.922 19.6733C16.6704 19.4701 17.4284 19.3043 18.1933 19.1766C20.0146 20.8086 21.6233 21.0693 22.428 21.0693C23.4213 21.0693 23.7766 20.6666 23.8946 20.336C24.108 19.9093 23.966 19.4366 23.7533 19.2ZM22.8066 19.8866C22.7353 20.2413 22.38 20.478 21.884 20.478C21.742 20.478 21.624 20.454 21.4813 20.4306C20.5826 20.2173 19.7306 19.768 18.8793 19.058C19.5357 18.947 20.2003 18.8917 20.866 18.8926C21.3633 18.8926 21.7893 18.916 22.0726 18.9873C22.404 19.058 22.9246 19.2713 22.806 19.886L22.8066 19.8866ZM17.7906 18.7746C17.1305 18.8983 16.4755 19.0482 15.8273 19.224C15.262 19.3709 14.7017 19.5366 14.1473 19.7206C14.4355 19.1625 14.7039 18.5944 14.952 18.0173C15.236 17.3546 15.472 16.6686 15.7093 16.03C15.9453 16.432 16.206 16.8346 16.466 17.1893C16.8911 17.7313 17.3329 18.26 17.7906 18.7746ZM14.692 9.97329C14.7338 9.88949 14.7978 9.81875 14.877 9.7688C14.9563 9.71884 15.0477 9.69157 15.1413 9.68996C15.638 9.68996 15.7326 10.2573 15.7326 10.7073C15.7326 11.464 15.496 12.6233 15.094 13.948C14.4073 12.1026 14.3606 10.5653 14.692 9.97329ZM12.0893 20.998C10.8826 22.9853 9.72331 24.2153 9.01398 24.2153C8.88599 24.2161 8.76132 24.1746 8.65931 24.0973C8.51731 23.9553 8.44598 23.79 8.49331 23.6006C8.63531 22.8906 10.0073 21.8973 12.0893 20.998Z`,fill:`white`}),(0,R.jsx)(`path`,{d:`M9.74219 34.4258V28.6992H10.8828V29.3633H10.9531C11.0286 29.2096 11.1276 29.0781 11.25 28.9688C11.375 28.8594 11.5208 28.776 11.6875 28.7188C11.8542 28.6589 12.0391 28.6289 12.2422 28.6289C12.6016 28.6289 12.9115 28.7188 13.1719 28.8984C13.4323 29.0781 13.6328 29.3333 13.7734 29.6641C13.9167 29.9922 13.9883 30.3854 13.9883 30.8438V30.8516C13.9883 31.3125 13.918 31.7083 13.7773 32.0391C13.6367 32.3698 13.4362 32.6237 13.1758 32.8008C12.9154 32.9779 12.6042 33.0664 12.2422 33.0664C12.0443 33.0664 11.8607 33.0365 11.6914 32.9766C11.5247 32.9141 11.3776 32.8268 11.25 32.7148C11.125 32.6029 11.026 32.4688 10.9531 32.3125H10.8828V34.4258H9.74219ZM11.8516 32.1211C12.0547 32.1211 12.2279 32.0703 12.3711 31.9688C12.5169 31.8672 12.6289 31.7214 12.707 31.5312C12.7878 31.3411 12.8281 31.1146 12.8281 30.8516V30.8438C12.8281 30.5807 12.7878 30.3542 12.707 30.1641C12.6289 29.974 12.5169 29.8281 12.3711 29.7266C12.2279 29.625 12.0547 29.5742 11.8516 29.5742C11.651 29.5742 11.4766 29.625 11.3281 29.7266C11.1823 29.8281 11.069 29.974 10.9883 30.1641C10.9102 30.3516 10.8711 30.5781 10.8711 30.8438V30.8516C10.8711 31.112 10.9115 31.3385 10.9922 31.5312C11.0729 31.7214 11.1862 31.8672 11.332 31.9688C11.4805 32.0703 11.6536 32.1211 11.8516 32.1211ZM16.457 33.0664C16.1003 33.0664 15.7904 32.9779 15.5273 32.8008C15.2669 32.6211 15.0651 32.3659 14.9219 32.0352C14.7812 31.7044 14.7109 31.3099 14.7109 30.8516V30.8438C14.7109 30.3828 14.7799 29.987 14.918 29.6562C15.0586 29.3255 15.2591 29.0716 15.5195 28.8945C15.7799 28.7174 16.0924 28.6289 16.457 28.6289C16.6523 28.6289 16.8333 28.6602 17 28.7227C17.1693 28.7826 17.3177 28.8685 17.4453 28.9805C17.5729 29.0924 17.6719 29.2279 17.7422 29.3867H17.8125V27.
5020547H18.9531V33H17.8125V32.332H17.7422C17.6693 32.4857 17.5703 32.6172 17.4453 32.7266C17.3229 32.8359 17.1784 32.9206 17.0117 32.9805C16.8451 33.0378 16.6602 33.0664 16.457 33.0664ZM16.8438 32.1211C17.0469 32.1211 17.2214 32.0703 17.3672 31.9688C17.513 31.8672 17.625 31.7214 17.7031 31.5312C17.7839 31.3411 17.8242 31.1159 17.8242 30.8555V30.8477C17.8242 30.582 17.7839 30.3555 17.7031 30.168C17.625 29.9779 17.5117 29.832 17.3633 29.7305C17.2174 29.6263 17.0443 29.5742 16.8438 29.5742C16.6458 29.5742 16.4727 29.6263 16.3242 29.7305C16.1784 29.832 16.0664 29.9779 15.9883 30.168C15.9102 30.3555 15.8711 30.5807 15.8711 30.8438V30.8516C15.8711 31.1146 15.9102 31.3411 15.9883 31.5312C16.0664 31.7214 16.1784 31.8672 16.3242 31.9688C16.4701 32.0703 16.6432 32.1211 16.8438 32.1211ZM20.4648 33V29.5586H19.7695V28.6992H20.4648V28.2969C20.4648 28.0104 20.5156 27.7721 20.6172 27.582C20.7188 27.3919 20.8776 27.25 21.0938 27.1562C21.3125 27.0599 21.5951 27.0117 21.9414 27.0117C22.0586 27.0117 22.1641 27.0156 22.2578 27.0234C22.3542 27.0312 22.444 27.0417 22.5273 27.0547V27.8164C22.4909 27.8086 22.4427 27.8034 22.3828 27.8008C22.3255 27.7956 22.2604 27.793 22.1875 27.793C21.9661 27.793 21.8099 27.8438 21.7188 27.9453C21.6276 28.0443 21.582 28.1875 21.582 28.375V28.6992H22.4922V29.5586H21.6055V33H20.4648Z`,fill:`white`})]}),d_e=({className:e,label:t,size:n,sizeConfig:r,...i})=>{let a=!!t;return(0,R.jsx)(I8,{...i,className:G(`str-chat__file-icon--pdf`,a&&`str-chat__file-icon--no-label`,e),size:n,sizeConfig:r,children:(0,R.jsxs)(`g`,{className:k8,children:[(0,R.jsx)(`path`,{d:M8,fill:`#E71A01`}),a?u_e:(0,R.jsx)(`g`,{transform:`scale(${P8} ${F8})`,children:l_e}),(0,R.jsx)(`path`,{d:N8,fill:`white`,opacity:`0.5`})]})})},f_e=({className:e,label:t,...n})=>(0,R.jsx)(R8,{...n,className:e,color:`#3375E2`,fileTypeClassName:`str-chat__file-icon--doc`,label:t,symbols:L8}),p_e=({className:e,label:t,...n})=>(0,R.jsx)(R8,{...n,className:e,color:`#D14423`,fileTypeClassName:`str-chat__file-icon--ppt`,label:t,symbols:a_e}),m_e=({className:e=``,label:t,...n})=>(0,R.jsx)(R8,{...n,className:e,color:`#0C864B`,fileTypeClassName:`str-chat__file-icon--xls`,label:t,symbols:o_e}),h_e=({className:e=``,label:t=``,...n})=>(0,R.jsx)(R8,{...n,className:e,color:`#E59E34`,fileTypeClassName:`str-chat__file-icon--compressed`,label:t,symbols:s_e}),g_e=({className:e=``,label:t,...n})=>(0,R.jsx)(R8,{...n,className:e,color:`#00ACA1`,fileTypeClassName:`str-chat__file-icon--code`,label:t,symbols:r_e}),__e=({className:e=``,label:t,...n})=>(0,R.jsx)(R8,{...n,className:e,color:`#2727B0`,fileTypeClassName:`str-chat__file-icon--audio`,label:t,symbols:i_e}),v_e=({className:e=``,label:t,...n})=>(0,R.jsx)(R8,{...n,className:e,color:`#A847B7`,fileTypeClassName:`str-chat__file-icon--video`,label:t,symbols:c_e}),z8=({className:e=``,label:t=``,...n})=>(0,R.jsx)(R8,{...n,className:e,color:`#888888`,fileTypeClassName:`str-chat__file-icon--other`,label:t,symbols:n_e}),y_e=[`application/msword`,`application/msword-template`,`application/vnd.openxmlformats-officedocument.wordprocessingml.document`,`application/vnd.openxmlformats-officedocument.wordprocessingml.template`,`application/vnd.ms-word.document.macroEnabled.12`,`application/vnd.ms-word.template.macroEnabled.12`,`application/vnd.oasis.opendocument.text`,`application/vnd.oasis.opendocument.text-template`,`application/vnd.oasis.opendocument.text-flat-xml`],b_e=[`text/csv`,`application/vnd.ms-excel`,`application/vnd.openxmlformats-officedocument.spreadsheetml.sheet`,`application/vnd.openxmlformats-officedocument.spreadsheetml.template`,`application/vnd.ms-excel.sheet.macroEnabled.12`,`application/vnd.ms-excel.template.macroEnabled.12`,`application/vnd.ms-excel.addin.macroEnabled.12`,`application/vnd.ms-excel.addin.macroEnabled.12`,`application/vnd.oasis.opendocument.spreadsheet`,`application/vnd.oasis.opendocument.spreadsheet-template`,`application/vnd.oasis.opendocument.spreadsheet-flat-xml`],x_e=[`application/vnd.ms-powerpoint`,`application/vnd.openxmlformats-officedocument.presentationml.presentation`,`application/vnd.openxmlformats-officedocument.presentationml.template`,`application/vnd.openxmlformats-officedocument.presentationml.slideshow`,`application/vnd.ms-powerpoint.addin.macroEnabled.12`,`application/vnd.ms-powerpoint.presentation.macroEnabled.12`,`application/vnd.ms-powerpoint.template.macroEnabled.12`,`application/vnd.ms-powerpoint.slideshow.macroEnabled.12`,`application/vnd.oasis.opendocument.presentation`,`application/vnd.oasis.opendocument.presentation-template`,`application/vnd.oasis.opendocument.presentation-flat-xml`],S_e=[`application/zip`,`application/x-7z-compressed`,`application/x-archive`,`application/x-tar`,`application/gzip`,`application/x-compress`,`application/x-bzip`,`application/x-lzip`,`application/x-lz4`,`application/x-lzma`,`application/x-lzop`,`application/x-xz`,`application/x-webarchive`,`application/vnd.rar`],C_e=[`text/html`,`text/css`,`application/x-javascript`,`text/javascript`,`application/json`,`text/x-python`,`text/x-go`,`text/x-csrc`,`text/x-c++src`,`application/x-ruby`,`text/rust`,`text/x-java`,`application/x-php`,`text/x-csharp`,`text/x-scala`,`text/x-erlang`,`application/x-shellscript`],w_e={"application/epub+zip":`epub`,"application/gzip":`gz`,"application/java-archive":`jar`,"application/json":`json`,"application/ld+json":`jsonld`,"application/msword":`doc`,"application/msword-template":`dot`,"application/octet-stream":`bin`,"application/ogg":`ogx`,"application/pdf":`pdf`,"application/postscript":`ps`,"application/rtf":`rtf`,"application/vnd.amazon.ebook":`azw`,"application/vnd.apple.installer+xml":`mpkg`,"application/vnd.mozilla.xul+xml":`xul`,"application/vnd.ms-excel":`xls`,"application/vnd.ms-excel.addin.macroEnabled.12":`xlam`,"application/vnd.ms-excel.sheet.macroEnabled.12":`xlsm`,"application/vnd.ms-excel.template.macroEnabled.12":`xltm`,"application/vnd.ms-fontobject":`eot`,"application/vnd.ms-powerpoint":`ppt`,"application/vnd.ms-powerpoint.addin.macroEnabled.12":`ppam`,"application/vnd.ms-powerpoint.presentation.macroEnabled.12":`pptm`,"application/vnd.ms-powerpoint.slideshow.macroEnabled.12":`ppsm`,"application/vnd.ms-powerpoint.template.macroEnabled.12":`potm`,"application/vnd.ms-word.document.macroEnabled.12":`docm`,"application/vnd.ms-word.template.macroEnabled.12":`dotm`,"application/vnd.oasis.opendocument.presentation":`odp`,"application/vnd.oasis.opendocument.presentation-flat-xml":`fodp`,"application/vnd.oasis.opendocument.presentation-template":`otp`,"application/vnd.oasis.opendocument.spreadsheet":`ods`,"a
502pplication/vnd.oasis.opendocument.spreadsheet-flat-xml":`fods`,"application/vnd.oasis.opendocument.spreadsheet-template":`ots`,"application/vnd.oasis.opendocument.text":`odt`,"application/vnd.oasis.opendocument.text-flat-xml":`fodt`,"application/vnd.oasis.opendocument.text-template":`ott`,"application/vnd.openxmlformats-officedocument.presentationml.presentation":`pptx`,"application/vnd.openxmlformats-officedocument.presentationml.slideshow":`ppsx`,"application/vnd.openxmlformats-officedocument.presentationml.template":`potx`,"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":`xlsx`,"application/vnd.openxmlformats-officedocument.spreadsheetml.template":`xltx`,"application/vnd.openxmlformats-officedocument.wordprocessingml.document":`docx`,"application/vnd.openxmlformats-officedocument.wordprocessingml.template":`dotx`,"application/vnd.rar":`rar`,"application/vnd.visio":`vsd`,"application/wasm":`wasm`,"application/x-7z-compressed":`7z`,"application/x-abiword":`abw`,"application/x-archive":`ar`,"application/x-bzip":`bz`,"application/x-bzip2":`bz2`,"application/x-cdf":`cda`,"application/x-compress":`Z`,"application/x-csh":`csh`,"application/x-dosexec":`exe`,"application/x-freearc":`arc`,"application/x-httpd-php":`php`,"application/x-iso9660-image":`iso`,"application/x-javascript":`js`,"application/x-lz4":`lz4`,"application/x-lzip":`lz`,"application/x-lzma":`lzma`,"application/x-lzop":`lzo`,"application/x-mobipocket-ebook":`mobi`,"application/x-msdownload":`exe`,"application/x-perl":`pl`,"application/x-php":`php`,"application/x-rar-compressed":`rar`,"application/x-ruby":`rb`,"application/x-sh":`sh`,"application/x-shellscript":`sh`,"application/x-shockwave-flash":`swf`,"application/x-sql":`sql`,"application/x-stuffit":`sit`,"application/x-tar":`tar`,"application/x-webarchive":`war`,"application/x-xz":`xz`,"application/x-yaml":`yaml`,"application/xhtml+xml":`xhtml`,"application/xml":`xml`,"application/zip":`zip`,"audio/aac":`aac`,"audio/flac":`flac`,"audio/midi":`midi`,"audio/mp4":`m4a`,"audio/mpeg":`mp3`,"audio/ogg":`oga`,"audio/opus":`opus`,"audio/wav":`wav`,"audio/webm":`weba`,"audio/x-aiff":`aiff`,"audio/x-m4a":`m4a`,"audio/x-midi":`midi`,"audio/x-ms-wma":`wma`,"audio/x-wav":`wav`,"font/otf":`otf`,"font/ttf":`ttf`,"font/woff":`woff`,"font/woff2":`woff2`,"image/apng":`apng`,"image/avif":`avif`,"image/bmp":`bmp`,"image/gif":`gif`,"image/heic":`heic`,"image/heif":`heif`,"image/jpeg":`jpg`,"image/png":`png`,"image/svg+xml":`svg`,"image/tiff":`tiff`,"image/vnd.microsoft.icon":`ico`,"image/webp":`webp`,"image/x-icon":`ico`,"text/calendar":`ics`,"text/css":`css`,"text/csv":`csv`,"text/html":`html`,"text/javascript":`js`,"text/markdown":`md`,"text/plain":`txt`,"text/rtf":`rtf`,"text/rust":`rs`,"text/tab-separated-values":`tsv`,"text/vcard":`vcf`,"text/x-c":`c`,"text/x-c++src":`cpp`,"text/x-csharp":`cs`,"text/x-csrc":`c`,"text/x-diff":`diff`,"text/x-erlang":`erl`,"text/x-go":`go`,"text/x-java":`java`,"text/x-java-source":`java`,"text/x-kotlin":`kt`,"text/x-lua":`lua`,"text/x-markdown":`md`,"text/x-objectivec":`m`,"text/x-pascal":`pas`,"text/x-perl":`pl`,"text/x-python":`py`,"text/x-ruby":`rb`,"text/x-rust":`rs`,"text/x-scala":`scala`,"text/x-sh":`sh`,"text/x-shellscript":`sh`,"text/x-sql":`sql`,"text/x-swift":`swift`,"text/x-typescript":`ts`,"text/x-yaml":`yaml`,"text/xml":`xml`,"text/yaml":`yaml`,"video/3gpp":`3gp`,"video/3gpp2":`3g2`,"video/mp2t":`ts`,"video/mp4":`mp4`,"video/mpeg":`mpeg`,"video/ogg":`ogv`,"video/quicktime":`mov`,"video/webm":`webm`,"video/x-flv":`flv`,"video/x-m4v":`m4v`,"video/x-matroska":`mkv`,"video/x-ms-wmv":`wmv`,"video/x-msvideo":`avi`};function T_e({FileArchiveIcon:e,FileCodeIcon:t,FileExcelIcon:n,FilePdfIcon:r,FilePowerPointIcon:i,FileWordIcon:a}){let o={"application/pdf":r};for(let e of y_e)o[e]=a;for(let e of b_e)o[e]=n;for(let e of x_e)o[e]=i;for(let t of S_e)o[t]=e;for(let e of C_e)o[e]=t;return o}function E_e({FileAltIcon:e,FileAudioIcon:t,FileVideoIcon:n}){return{"audio/":t,"text/":e,"video/":n}}var D_e={standard:{...T_e({FileArchiveIcon:h_e,FileCodeIcon:g_e,FileExcelIcon:m_e,FilePdfIcon:d_e,FilePowerPointIcon:p_e,FileWordIcon:f_e}),...E_e({FileAltIcon:z8,FileAudioIcon:__e,FileVideoIcon:v_e}),fallback:z8}};function O_e(e){let t=D_e.standard;return e?t[e]||(e.startsWith(`audio/`)?t[`audio/`]:e.startsWith(`video/`)?t[`video/`]:e.startsWith(`image/`)?t[`image/`]:e.startsWith(`text/`)?t[`text/`]:t.fallback):t.fallback}var k_e=({fileName:e,mimeType:t})=>{let n;return t&&(n=w_e[t]),!n&&e&&(n=e.split(`.`).slice(-1)[0]),n},B8=e=>{let{className:t,fileName:n,mimeType:r,size:i=`md`,sizeConfig:a,...o}=e,s=(0,d.useMemo)(()=>
502e_e(a),[a]),c=O_e(r),l=n?k_e({fileName:n,mimeType:r}):void 0;return(0,R.jsx)(c,{...o,className:t,label:l,size:i,sizeConfig:s})},V8=(e,t=`ceil`)=>{if(e==null||Number.isNaN(e)||e<0)return null;let n=t===`floor`?Math.floor(e):Math.ceil(e),r=Math.floor(n/3600),i=Math.floor(n%3600/60),a=n%60,o=`${String(i).padStart(2,`0`)}:${String(a).padStart(2,`0`)}`;return r?`${String(r).padStart(2,`0`)}:${o}`:o};function H8({className:e,duration:t,isPlaying:n,secondsElapsed:r,showRemaining:i=!1}){let a=t!=null&&r!=null?Math.max(0,t-r):void 0,o=V8(t),s=V8(r),c=V8(a),l=!!r&&r>0&&r<(t||0),u=i&&t!=null&&r!=null,d=i?c:s,f=(u||l)&&!!d,p=!f&&!!o;return(0,R.jsxs)(`div`,{className:G(`str-chat__duration-display`,{"str-chat__duration-display--hasProgress":!!r,"str-chat__duration-display--isPlaying":n},e),children:[f&&(0,R.jsx)(`span`,{className:`str-chat__duration-display__time-elapsed`,children:d}),p&&(0,R.jsx)(`span`,{className:`str-chat__duration-display__duration`,children:o})]})}var U8=({children:e,className:t,...n})=>(0,R.jsx)(nH,{"data-testid":`playback-rate-button`,...n,className:G(`str-chat__playback-rate-button`,t),children:e}),A_e=5,j_e=10,M_e=({key:e,largeStep:t,progress:n,step:r})=>{switch(e){case`ArrowRight`:case`ArrowUp`:return Math.min(100,n+r);case`ArrowLeft`:case`ArrowDown`:return Math.max(0,n-r);case`PageUp`:return Math.min(100,n+t);case`PageDown`:return Math.max(0,n-t);case`Home`:return 0;case`End`:return 100;default:return null}},W8=({event:e,largeStep:t=j_e,progress:n,seek:r,step:i=A_e})=>{let a=M_e({key:e.key,largeStep:t,progress:n,step:i});if(a===null)return;e.preventDefault();let o=e.currentTarget,{width:s,x:c}=o.getBoundingClientRect();r({clientX:c+s*a/100,currentTarget:o})},G8=({durationSeconds:e,progress:t,secondsElapsed:n,t:r})=>{let i=Math.max(0,Math.min(100,t));if(typeof e==`number`&&Number.isFinite(e)){let t=Math.max(0,e),a=V8(typeof n==`number`&&Number.isFinite(n)?Math.max(0,Math.min(n,t)):t*i/100,`floor`),o=V8(t,`floor`);if(a&&o)return r(`aria/Audio position {{ elapsed }} of {{ duration }}`,{duration:o,elapsed:a})}return r(`aria/Audio position {{ progress }} percent`,{progress:Math.round(i)})},K8=e=>{if(!e)return 0;let t=e.parentElement;if(!t)return e.getBoundingClientRect().width;let n=t.getBoundingClientRect().width,r=window.getComputedStyle(t),i=parseFloat(r.paddingLeft)||0,a=parseFloat(r.paddingRight)||0,o=r.columnGap||r.gap,s=parseFloat(o),c=(Number.isNaN(s)?0:s)*Math.max(0,t.children.length-1),l=Array.from(t.children).reduce((t,n)=>n===e?t:t+n.getBoundingClientRect().width,0);return Math.max(0,n-i-a-c-l)},q8=({progress:e=0,seek:t})=>{let n=(0,d.useRef)(!1),[r,i]=(0,d.useState)(0),[a,o]=(0,d.useState)(null),[s,c]=(0,d.useState)(null),l=(0,d.useRef)(0),u=e=>{e.preventDefault(),s&&(n.current=!0,s.style.cursor=`grabbing`,a?.classList.add(`str-chat__wave-progress-bar__track--dragging`))},f=e=>{n.current&&t({...e})},p=(0,d.useCallback)(()=>{s&&(n.current=!1,s.style.removeProperty(`cursor`),a?.classList.remove(`str-chat__wave-progress-bar__track--dragging`))},[s,a]);return(0,d.useEffect)(()=>(document.addEventListener(`pointerup`,p),()=>{document.removeEventListener(`pointerup`,p)}),[p]),(0,d.useEffect)(()=>{if(!a||typeof ResizeObserver>`u`)return;let e=new ResizeObserver(([e])=>{i(K8(e.target)||e.contentRect.width)});return e.observe(a),()=>{e.disconnect()}},[a]),(0,d.useLayoutEffect)(()=>{a&&i(K8(a)),s&&(l.current=s.getBoundingClientRect().width)},[s,a]),{availableTrackWidth:r,handleDrag:f,handleDragStart:u,handleDragStop:p,indicatorLeft:e===0||!s?0:Math.max(0,r-l.current)*(e/100)+1,root:a,setProgressIndicator:c,setRoot:o}},J8=({className:e,durationSeconds:t,progress:n,secondsElapsed:r,seek:i})=>{let{t:a}=Y(`ProgressBar`),{handleDrag:o,handleDragStart:s,handleDragStop:c,indicatorLeft:l,setProgressIndicator:u,setRoot:d}=q8({progress:n,seek:i}),f=Math.max(0,Math.min(100,n)),p=G8({durationSeconds:t,progress:f,secondsElapsed:r,t:a});return(0,R.jsx)(`div`,{"aria-label":a(`aria/Seek audio position`),"aria-orientation":`horizontal`,"aria-valuemax":100,"aria-valuemin":0,"aria-valuenow":Math.round(f),"aria-valuetext":p,className:G(`str-chat__message-attachment-audio-widget--progress-track`,e),"data-progress":f,"data-testid":`audio-progress`,onClick:i,onKeyDown:e=>W8({event:e,progress:f,seek:i}),onPointerDown:s,onPointerMove:o,onPointerUp:c,ref:d,role:`slider`,style:{"--str-chat__message-attachment-audio-widget-progress":f+`%`},tabIndex:0,children:(0,R.jsx)(`div`,{"aria-hidden":`true`,className:`str-chat__message-attachment-audio-widget--progress-indicator`,ref:u,style:{insetInlineStart:`${l}px`}})})},Y8=[`video/mp4`,`video/ogg`,`video/webm`,`video/quicktime`],N_e=e=>Array.isArray(e.items),P_e=e=>(e.fallback||``).toLowerCase().endsWith(`.svg`),X8=(e,t)=>[Math.floor(e/t),e%t],Z8=e=>{if(!e||e<0)return`00:00`;let[t,n]=X8(e,3600),[r,i]=X8(n,60),a=Math.ceil(i),o=String(t).padStart(2,`0`),s=`${String(r).padStart(2,`0`)}
502:${String(a).padStart(2,`0`)}`;return t?`${o}:`+s:s};function Q8(e){let t={"--original-height":1e6,"--original-width":1e6};if(qv(e,`url`)){let n=new URL(e).searchParams,r=Number(n.get(`oh`)),i=Number(n.get(`ow`)),a=r>1?r:1e6;t[`--original-width`]=i>1?i:1e6,t[`--original-height`]=a}return t}var $8=(e,t)=>e.length===t?e:e.length>t?F_e(e,t):R_e(e,t);function F_e(e,t){if(e.length<=t||t===0)return e;if(t===1)return[t5(e)];let n=[],r=(e.length-2)/(t-2),i=0;n.push(e[i]);let a,o,s;for(let c=1;c<t-1;c++){let t=e[i],l=L_e(e,c,r),u=Math.floor((c-1)*r)+1,d=Math.floor(c*r)+1,f=1+d-u;o=s=-1;for(let n=u;n<d;n++){let r=Math.abs(n-u)+1,c=f-r,d=e[n];s=I_e(e5(Math.abs(t-d),r),e5(Math.abs(d-l),c),e5(Math.abs(t-l),f)),s>o&&(o=s,a=e[n],i=n)}a!==void 0&&n.push(a)}return n.push(e[e.length-1]),n}var I_e=(e,t,n)=>{let r=(e+t+n)/2;return Math.sqrt(r*(r-e)*(r-t)*(r-n))},e5=(e,t)=>Math.sqrt(e**2+t**2),t5=e=>e.reduce((e,t)=>e+t,0)/e.length,L_e=(e,t,n)=>{let r=Math.floor(t*n)+1,i=Math.floor((t+1)*n)+1;return i=i<e.length?i:e.length,t5(e.slice(r,i))},R_e=(e,t)=>{if(!e.length)return console.warn(`Cannot extend empty array of amplitudes.`),e;if(e.length>t)return console.warn(`Requested to extend the waveformData that is longer than the target list size`),e;if(t===e.length)return e;let[n,r]=X8(t,e.length),i=[];for(let t=0;t<e.length;t++){let a=r&&r--?1:0;i.push(...Array(n+a).fill(e[t]))}return i},n5=({amplitudeBarGapWidthPx:e,durationSeconds:t,progress:n=0,relativeAmplitudeBarWidth:r=2,relativeAmplitudeGap:i=1,secondsElapsed:a,seek:o,waveformData:s})=>{let{t:c}=Y(`WaveProgressBar`),[l,u]=(0,d.useState)(),f=(0,d.useRef)(0),p=(0,d.useRef)(null),m=(0,d.useRef)(null),{availableTrackWidth:h,handleDrag:g,handleDragStart:_,handleDragStop:v,indicatorLeft:y,root:b,setProgressIndicator:x,setRoot:S}=q8({progress:n,seek:o}),C=Math.max(0,Math.min(100,n)),w=(0,d.useMemo)(()=>(0,PB.default)(e=>{let t=p.current,n=t!==m.current;if(e===f.current&&!n)return;f.current=e,m.current=t;let a=Math.floor(e/(i+r)),o=r/(r+i),s=typeof t==`number`&&t>0?Math.floor(e*o/t):a,c=Math.max(0,Math.min(a,s)),l=c&&e/c*o;u({barCount:c,barWidth:l,gap:i/r*l})},1),[r,i]),T=(0,d.useMemo)(()=>l?$8(s,l.barCount):[],[l,s]);if((0,d.useLayoutEffect)(()=>{h>0&&w(h)},[h,w]),(0,d.useLayoutEffect)(()=>{if(!b||typeof window>`u`)return;let e=b.querySelector(`.str-chat__wave-progress-bar__amplitude-bar`);if(!e)return;let t=window.getComputedStyle(e),n=parseFloat(t.minWidth);!Number.isNaN(n)&&n>0&&(p.current=n),h>0&&w(h)},[h,w,b,l?.barCount]),!s.length||l?.barCount===0)return null;let E=e??l?.gap,D=G8({durationSeconds:t,progress:C,secondsElapsed:a,t:c});return(0,R.jsxs)(`div`,{"aria-label":c(`aria/Seek audio position`),"aria-orientation":`horizontal`,"aria-valuemax":100,"aria-valuemin":0,"aria-valuenow":Math.round(C),"aria-valuetext":D,className:G(`str-chat__wave-progress-bar__track`,{"str-chat__wave-progress-bar__track--playback-initiated":C>0}),"data-testid":`wave-progress-bar-track`,onClick:o,onKeyDown:e=>W8({event:e,progress:C,seek:o}),onPointerDown:_,onPointerMove:g,onPointerUp:v,ref:S,role:`slider`,style:{"--str-chat__voice-recording-amplitude-bar-gap-width":typeof E==`number`?`${E}px`:void 0},tabIndex:0,children:[T.map((e,t)=>(0,R.jsx)(`div`,{"aria-hidden":`true`,className:G(`str-chat__wave-progress-bar__amplitude-bar`,{"str-chat__wave-progress-bar__amplitude-bar--active":C>t/T.length*100}),"data-testid":`amplitude-bar`,style:{"--str-chat__voice-recording-amplitude-bar-width":l?.barWidth+`px`,"--str-chat__wave-progress-bar__amplitude-bar-height":e?e*100+`%`:`0%`}},`amplitude-${t}`)),(0,R.jsx)(`div`,{"aria-hidden":`true`,className:`str-chat__wave-progress-bar__progress-indicator`,"data-testid":`wave-progress-bar-progress-indicator`,ref:x,style:{insetInlineStart:`${y}px`}})]})},z_e=({audioPlayer:e})=>{let{FileSizeIndicator:t=i8}=q(),{durationSeconds:n,isPlaying:r,progress:i,secondsElapsed:a}=J(e?.state,B_e)??{};return(0,R.jsxs)(`div`,{className:`str-chat__message-attachment-audio-widget`,"data-testid":`audio-widget`,children:[(0,R.jsx)(`div`,{className:`str-chat__message-attachment-audio-widget--play-controls`,children:(0,R.jsx)(O6,{isPlaying:!!r,onClick:e.togglePlay})}),(0,R.jsxs)(`div`,{className:`str-chat__message-attachment-audio-widget--data`,children:[(0,R.jsx)(`div`,{className:`str-chat__message-attachment-audio-widget--text-first-row`,children:(0,R.jsx)(`div`,{className:`str-chat__message-attachment-audio-widget--title`,children:e.title})}),(0,R.jsx)(`div`,{className:`str-chat__message-attachment-audio-widget--text-second-row`,children:n?(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(H8,{duration:n,isPlaying:!!r,secondsElapsed:a}),(0,R.jsx)(J8,{durationSeconds:n,progress:i??0,secondsElapsed:a,seek:e.seek})]}):(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(t,{fileSize:e.fileSize}),(0,R.jsx)(J8,{durationSeconds:n,progress:i??0,secondsElapsed:a,seek:e.seek})]})})]}),(0,R.jsx)(B8,{className:`str-chat__file-icon`,mimeType:e.mimeType}),(0,R.jsx)(D8,{assetUrl:e.src,suggestedFileName:e.title})]})},B_e=e=>({durationSeconds:e.durationSeconds,isPlaying:e.isPlaying,progress:e.progressPercent,secondsElapsed:e.secondsElapsed}),V_e=e=>{let{attachment:{asset_url:t,duration:n,file_size:r,mime_type:i,title:a}}=e,{message:o,threadList:s}=o6()??{},c=MW({durationSeconds:n,fileSize:r,mimeType:i,requester:o?.id&&`${s?o.parent_id??o.id:``}${o.id}`,src:t,title:a,waveformData:e.attachment.waveform_data});return c?(0,R.jsx)(z_e,{audioPlayer:c}):null},H_e={giphy:`send`},U_e=d.memo(e=>{let{actionHandler:t,actions:n,defaultFocusedActionValue:r,id:i,text:a}=e,{t:o}=Y(`UnMemoizedAttachmentActions`),s=(0,d.useRef)([]),c=(e,n,r)=>t?.(n,r,e),l=(0,d.useMemo)(()=>({Cancel:o(`Cancel`),Send:o(`Send`),Shuffle:o(`Shuffle`)}),[o]),u=(0,d.useMemo)(()=>
502{if(!r)return null;let e=n.findIndex(e=>e.value===r);return e>=0?e:null},[n,r]);return(0,d.useEffect)(()=>{if(u===null)return;let e=s.current[u];e&&document.activeElement!==e&&e.focus()},[u]),(0,R.jsx)(`div`,{className:`str-chat__message-attachment-actions`,children:(0,R.jsxs)(`div`,{className:`str-chat__message-attachment-actions-form`,children:[(0,R.jsx)(`span`,{children:a}),n.map((e,t)=>(0,R.jsx)(nH,{appearance:`ghost`,className:G(`str-chat__message-attachment-actions-button str-chat__message-attachment-actions-button--${e.style}`),"data-testid":`${e.name}`,"data-value":e.value,onClick:t=>c(t,e.name,e.value),ref:e=>{s.current[t]=e},variant:`secondary`,children:e.text?l[e.text]??o(e.text):null},`${i}-${e.value}`))]})})}),r5=`str-chat__message-attachment__voice-recording-widget`,W_e=e=>({canPlayRecord:e.canPlayRecord,durationSeconds:e.durationSeconds,isPlaying:e.isPlaying,playbackRate:e.currentPlaybackRate,progress:e.progressPercent,secondsElapsed:e.secondsElapsed}),G_e=({audioPlayer:e})=>{let{FileSizeIndicator:t=i8}=q(),{t:n}=Y(),{canPlayRecord:r,durationSeconds:i,isPlaying:a,playbackRate:o,progress:s,secondsElapsed:c}=J(e?.state,W_e)??{};return(0,R.jsxs)(`div`,{className:r5,"data-testid":`voice-recording-widget`,children:[(0,R.jsx)(`div`,{className:`str-chat__message-attachment__voice-recording-widget__play-button-container`,children:(0,R.jsx)(O6,{isPlaying:!!a,onClick:e.togglePlay})}),(0,R.jsx)(`div`,{className:`str-chat__message-attachment__voice-recording-widget__metadata`,children:(0,R.jsxs)(`div`,{className:`str-chat__message-attachment__voice-recording-widget__audio-state`,children:[(0,R.jsx)(`div`,{className:`str-chat__message-attachment__voice-recording-widget__timer`,children:i?(0,R.jsx)(H8,{duration:i,isPlaying:!!a,secondsElapsed:c,showRemaining:!0}):(0,R.jsx)(t,{fileSize:e.fileSize,maximumFractionDigits:0})}),(0,R.jsx)(n5,{durationSeconds:i,progress:s,secondsElapsed:c,seek:e.seek,waveformData:e.waveformData||[]})]})}),(0,R.jsx)(`div`,{className:`str-chat__message-attachment__voice-recording-widget__right-section`,children:(0,R.jsxs)(U8,{"aria-label":n(`Playback speed {{ rate }}x`,{rate:o?.toString()??`1`}),disabled:!r,onClick:e.increasePlaybackRate,children:[`x`,o?.toString()]})})]})},K_e=({attachment:e,playbackRates:t})=>{let{t:n}=Y(),{asset_url:r,duration:i=0,file_size:a,mime_type:o,title:s=n(`Voice message`),waveform_data:c}=e,{message:l,threadList:u}=o6()??{},d=MW({durationSeconds:i??0,fileSize:a,mimeType:o,playbackRates:t,requester:l?.id&&`${u?l.parent_id??l.id:``}${l.id}`,src:r,title:s,waveformData:c});return d?(0,R.jsx)(G_e,{audioPlayer:d}):null},q_e=({attachment:e})=>{let{FileSizeIndicator:t=i8}=q();return(0,R.jsxs)(`div`,{className:r5,"data-testid":`quoted-voice-recording-widget`,children:[(0,R.jsx)(`div`,{className:`str-chat__message-attachment__voice-recording-widget__metadata`,children:(0,R.jsx)(`div`,{className:`str-chat__message-attachment__voice-recording-widget__audio-state`,children:(0,R.jsx)(`div`,{className:`str-chat__message-attachment__voice-recording-widget__timer`,children:e.duration?(0,R.jsx)(H8,{duration:e.duration,isPlaying:!1,secondsElapsed:void 0}):(0,R.jsx)(t,{fileSize:e.file_size,maximumFractionDigits:0})})})}),(0,R.jsx)(B8,{mimeType:e.mime_type})]})},J_e=({attachment:e,isQuoted:t})=>t?(0,R.jsx)(q_e,{attachment:e}):(0,R.jsx)(K_e,{attachment:e}),Y_e=({className:e})=>{let{t}=Y();return(0,R.jsx)(`div`,{"aria-label":t(`aria/Image failed to load`),className:G(`str-chat__image-placeholder`,e),"data-testid":`str-chat__base-image-placeholder`,role:`img`,children:(0,R.jsx)(nU,{})})},i5=(0,d.forwardRef)(function({src:e,...t},n){let{alt:r,className:i,onError:a,showDownloadButtonOnError:o=!1,...s}=t,[c,l]=(0,d.useState)(null),{ImagePlaceholder:u=Y_e}=q(),f=(0,d.useMemo)(()=>(0,M0.sanitizeUrl)(e),[e]),p=c===f;return(0,d.useEffect)(()=>()=>{l(null)},[f]),p?(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(u,{className:G(i,`str-chat__base-image--load-failed`)}),o&&(0,R.jsx)(D8,{assetUrl:f})]}):(0,R.jsx)(`img`,{"data-testid":`str-chat__base-image`,...s,alt:r??``,className:G(i,`str-chat__base-image`),onError:e=>{l(f),a?.(e)},ref:n,src:f})}),a5=(e,t={})=>
502{if(Sb(e)){let n=t?.giphyVersionName&&e.giphy?e.giphy[t.giphyVersionName]:void 0;return{alt:n?.url||e.thumb_url,dimensions:n?{height:n.height,width:n.width}:void 0,imageUrl:e.thumb_url,title:e.title||e.thumb_url}}if(db(e)){let t=e.image_url||e.thumb_url;return{alt:e.title||t,imageUrl:t,title:e.title}}if(bb(e))return{title:e.title,videoThumbnailUrl:e.thumb_url??e.localMetadata.previewUri,videoUrl:e.asset_url??e.localMetadata.previewUri};if(yb(e))return{title:e.title,videoThumbnailUrl:e.thumb_url,videoUrl:e.asset_url};if(hb(e)){let t=e.image_url||e.localMetadata.previewUri;return{alt:e.title||t,imageUrl:t,title:e.title}}if(mb(e)){let t=e.image_url;return{alt:e.title||t,imageUrl:t,title:e.title}}},o5=(...e)=>a5(...e),s5=(0,d.createContext)(void 0),X_e=()=>(0,d.useContext)(s5)||(console.warn(`The useGalleryContext hook was called outside of the GalleryContext provider. Make sure this hook is called within a child of the Gallery component.`),{}),Z_e=({currentItem:e})=>{let{t}=Y(),{MessageTimestamp:n=E8}=q(`GalleryUI`),{isMyMessage:r,message:i}=o6(`GalleryUI`),a=(0,d.useContext)(m6),o=r?.()&&t(`You`)||i?.user?.name||i?.user?.id||e.title||t(`User uploaded content`),s=(0,d.useMemo)(()=>{let t=e.videoUrl??e.imageUrl;if(!t)return;let n=(0,M0.sanitizeUrl)(t);return n===`about:blank`?void 0:n},[e.imageUrl,e.videoUrl]),c=t(`aria/Download attachment`);return(0,R.jsxs)(`div`,{className:`str-chat__gallery__header`,children:[(0,R.jsx)(`div`,{"aria-hidden":`true`,className:`str-chat__gallery__header-spacer`}),(0,R.jsxs)(`div`,{className:`str-chat__gallery__header-meta`,children:[(0,R.jsx)(`div`,{className:`str-chat__gallery__title`,children:o}),i?.created_at?(0,R.jsx)(n,{customClass:`str-chat__gallery__timestamp`}):null]}),(0,R.jsxs)(`div`,{className:`str-chat__gallery__header-actions`,children:[s?(0,R.jsx)(`a`,{"aria-label":c,className:`str-chat__gallery__action-button str-chat__gallery__action-button--download`,download:!0,href:s,rel:`noreferrer`,target:`_blank`,title:c,children:(0,R.jsx)(sH,{})}):null,a?.close?(0,R.jsx)(nH,{"aria-label":t(`Close`),className:`str-chat__gallery__action-button str-chat__gallery__action-button--close`,onClick:a.close,title:t(`Close`),children:(0,R.jsx)(RH,{})}):null]})]})},Q_e=d.lazy(()=>pa(()=>import(`./ReactPlayerWrapper.d2ae5941-uzUSB_vO.js`),__vite__mapDeps([3,1]))),c5=({isPlaying:e,thumbnailUrl:t,videoUrl:n})=>{let{LoadingIndicator:r=e8,VideoPlayer:i}=q();return i?(0,R.jsx)(i,{thumbnailUrl:t,videoUrl:n}):(0,R.jsx)(d.Suspense,{fallback:(0,R.jsx)(`div`,{className:`str-chat__video-player-loading`,children:(0,R.jsx)(r,{})}),children:(0,R.jsx)(Q_e,{isPlaying:e,thumbnailUrl:t,videoUrl:n})})},l5=({className:e,onPlay:t,...n})=>{let{t:r}=Y();return(0,R.jsxs)(`div`,{className:`str-chat__message-attachment__video-thumbnail`,children:[(0,R.jsx)(i5,{className:G(`str-chat__message-attachment__video-thumbnail-image`,e),...n}),t?(0,R.jsx)(nH,{appearance:`solid`,"aria-label":r(`Play video`),circular:!0,className:G(`str-chat__message-attachment__video-thumbnail__play-indicator`),onClick:t,size:`lg`,variant:`secondary`,children:(0,R.jsx)(gU,{})}):(0,R.jsx)(`div`,{className:`str-chat__message-attachment__video-thumbnail__play-indicator`,children:(0,R.jsx)(gU,{})})]})},$_e=50,eve=300,u5=()=>{let{t:e}=Y(),{closeOnBackgroundClick:t,currentIndex:n,currentItem:r,goToNext:i,goToPrevious:a,hasNext:o,hasPrevious:s,itemCount:c,onRequestClose:l}=X_e(),u=(0,d.useContext)(m6),[f,p]=(0,d.useState)(!1),m=(0,d.useRef)(!1),[h,g]=(0,d.useState)(0),[_,v]=(0,d.useState)(!1),[y,b]=(0,d.useState)(null),x=(0,d.useRef)(!1),S=(0,d.useRef)(null),C=(0,d.useRef)(!1),w=(0,d.useRef)(null);(0,d.useEffect)(()=>{p(!1)},[n]);let T=(0,d.useRef)(n);(0,d.useEffect)(()=>{if(T.current===n)return;b(n>T.current?`forward`:`backward`),g(0),v(!1),m.current=!0;let e=setTimeout(()=>{b(null),m.current=!1},eve);return T.current=n,()=>clearTimeout(e)},[n]);let E=(0,d.useCallback)(()=>{m.current||i()},[i]),D=(0,d.useCallback)(()=>{m.current||a()},[a]),O=(0,d.useCallback)(e=>{e.key===`ArrowLeft`?(e.preventDefault(),D()):e.key===`ArrowRight`&&(e.preventDefault(),E())},[E,D]);(0,d.useEffect)(()=>
502(document.addEventListener(`keydown`,O),()=>document.removeEventListener(`keydown`,O)),[O]);let k=(0,d.useCallback)(e=>{if(m.current)return;let t=e.touches[0];x.current=!1,S.current={x:t.clientX,y:t.clientY},C.current=!1},[]),A=(0,d.useCallback)(e=>{if(!S.current||m.current)return;let t=e.touches[0],n=t.clientX-S.current.x,r=t.clientY-S.current.y;if(!_&&!C.current){if(Math.abs(r)>Math.abs(n)&&Math.abs(r)>10){x.current=!0,C.current=!0;return}Math.abs(n)>10&&(x.current=!0,v(!0))}C.current||g(!o&&n<0||!s&&n>0?n*.3:n)},[_,o,s]),j=(0,d.useCallback)(()=>{if(!S.current||C.current){C.current&&(x.current=!0),S.current=null;return}let e=h;(_||Math.abs(e)>10)&&(x.current=!0),S.current=null,Math.abs(e)>=$_e?e<0&&o?i():e>0&&s?a():g(0):g(0),v(!1)},[h,o,s,i,a,_]),M=u?.close??l,N=(0,d.useCallback)(e=>{if(e.target===e.currentTarget){if(x.current){x.current=!1;return}t&&M?.()}},[t,M]),P=_||h!==0&&y===null?{transform:`translateX(${h}px)`}:{};return(0,R.jsxs)(`div`,{className:`str-chat__gallery`,children:[(0,R.jsxs)(`div`,{className:`str-chat__gallery__main`,children:[(0,R.jsx)(Z_e,{currentItem:r}),(0,R.jsx)(d5,{"aria-label":e(`Previous image`),className:G(`str-chat__gallery__nav-button--prev`,!s&&`str-chat__gallery__nav-button--hidden`),disabled:!s,onClick:D,children:(0,R.jsx)(AH,{})}),(0,R.jsx)(`div`,{className:`str-chat__gallery__slide-container`,onClick:N,onTouchEnd:j,onTouchMove:A,onTouchStart:k,ref:w,children:(0,R.jsx)(`div`,{className:G(`str-chat__gallery__media-container`,{"str-chat__gallery__media--dragging":_,"str-chat__gallery__media--slide-backward":!_&&y===`backward`,"str-chat__gallery__media--slide-forward":!_&&y===`forward`}),style:P,children:r.videoUrl&&r.videoThumbnailUrl?(0,R.jsx)(`div`,{className:`str-chat__gallery__media str-chat__gallery__media--video`,children:f?(0,R.jsx)(c5,{isPlaying:!0,videoUrl:r.videoUrl}):(0,R.jsx)(l5,{alt:r.title??``,onPlay:()=>p(!0),src:r.videoThumbnailUrl})}):(0,R.jsx)(`div`,{className:`str-chat__gallery__media str-chat__gallery__media--image`,children:(0,R.jsx)(i5,{alt:r.alt,src:r.imageUrl})})})}),(0,R.jsx)(d5,{"aria-label":e(`Next image`),className:G(`str-chat__gallery__nav-button--next`,!o&&`str-chat__gallery__nav-button--hidden`),disabled:!o,onClick:E,children:(0,R.jsx)(jH,{})})]}),c>1&&(0,R.jsxs)(`div`,{className:`str-chat__gallery__position-indicator`,children:[n+1,` of `,c]})]})},d5=({className:e,...t})=>(0,R.jsx)(nH,{...t,className:G(`str-chat__gallery__nav-button`,e)}),f5=({closeOnBackgroundClick:e=!0,GalleryUI:t,initialIndex:n=0,items:r,onIndexChange:i,onRequestClose:a})=>{let{GalleryUI:o}=q(),s=t??o??u5,[c,l]=(0,d.useState)(n),u=r.length,f=(0,d.useCallback)(e=>{e>=0&&e<u&&l(e)},[u]),p=(0,d.useCallback)(()=>{l(e=>e<u-1?e+1:e)},[u]),m=(0,d.useCallback)(()=>{l(e=>e>0?e-1:e)},[]);(0,d.useEffect)(()=>{i?.(c)},[c,i]);let h=c<u-1,g=c>0,_=r[c],v=(0,d.useMemo)(()=>({closeOnBackgroundClick:e,currentIndex:c,currentItem:_,goToIndex:f,goToNext:p,goToPrevious:m,hasNext:h,hasPrevious:g,itemCount:u,items:r,onRequestClose:a}),[e,c,_,f,p,m,h,g,u,r,a]);return(0,R.jsx)(s5.Provider,{value:v,children:(0,R.jsx)(s,{})})},p5=4,tve=[`className`,`crossOrigin`,`decoding`,`draggable`,`fetchPriority`,`height`,`loading`,`onError`,`onLoad`,`ref`,`showDownloadButtonOnError`,`sizes`,`srcSet`,`style`,`title`,`useMap`,`width`],m5=({className:e,closeOnBackgroundClick:t=!0,items:n,modalClassName:r})=>{let{BaseImage:i=i5,Gallery:a=f5,Modal:o=f8}=q(),[s,c]=(0,d.useState)(!1),[l,u]=(0,d.useState)(0),f=i===i5,p=(0,d.useCallback)(()=>{c(!1)},[]),m=(0,d.useCallback)(e=>e!==`overlay`,[]),h=(0,d.useCallback)(e=>{u(e),c(!0)},[]),g=n.length,_=n.slice(0,p5),v=g-p5;return(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(`div`,{className:G(`str-chat__modal-gallery`,e,{"str-chat__modal-gallery--three-images":g===3,"str-chat__modal-gallery--two-images":g===2}),children:_.map((e,t)=>(0,R.jsx)(nve,{BaseImage:i,baseImageUsesDefaultBehavior:f,index:t,item:e,itemCount:g,onClick:()=>h(t),overflowCount:v,showOverlay:t===p5-1&&v>0},t))}),(0,R.jsx)(o,{className:G(`str-chat__gallery-modal`,r),onClose:p,onCloseAttempt:m,open:s,children:(0,R.jsx)(a,{closeOnBackgroun
502dClick:t,GalleryUI:u5,initialIndex:l,items:n,onRequestClose:p})})]})},nve=({BaseImage:e,baseImageUsesDefaultBehavior:t,index:n,item:r,itemCount:i,onClick:a,overflowCount:o,showOverlay:s})=>{let{t:c}=Y(),l=r.imageUrl,[u,f]=(0,d.useState)(!1),[p,m]=(0,d.useState)(!!l),[h,g]=(0,d.useState)(``),{onError:_,onLoad:v,...y}=ive(r),b=u&&!s,x=p&&!b&&!s;return(0,R.jsxs)(`button`,{"aria-label":b?c(`aria/Retry upload`):rve({imageIndex:n+1,itemCount:i,t:c}),className:G(`str-chat__modal-gallery__image`,{"str-chat__modal-gallery__image--load-failed":b,"str-chat__modal-gallery__image--loading":x}),onClick:()=>{if(b){f(!1),m(!0),g(`&retry=${Date.now()}`);return}a()},type:`button`,children:[r.videoThumbnailUrl?(0,R.jsx)(l5,{alt:c(`User uploaded content`),src:r.videoThumbnailUrl}):(0,R.jsx)(e,{...y,alt:r.alt??c(`User uploaded content`),onError:e=>{m(!1),f(!0),_?.(e)},onLoad:e=>{m(!1),f(!1),v?.(e)},src:l&&`${l}${h}`,...t?{showDownloadButtonOnError:!1}:{}}),x&&(0,R.jsx)(`div`,{"aria-hidden":`true`,className:`str-chat__modal-gallery__image-loading-overlay`,"data-testid":`str-chat__modal-gallery__image-loading-overlay`,children:(0,R.jsx)(e8,{})}),b&&(0,R.jsx)(`div`,{"aria-hidden":`true`,className:`str-chat__modal-gallery__image-load-failed-overlay`,"data-testid":`str-chat__modal-gallery__image-load-failed-overlay`,children:(0,R.jsx)(`div`,{className:`str-chat__modal-gallery__image-retry-indicator`,children:(0,R.jsx)(uH,{})})}),s&&(0,R.jsxs)(`div`,{className:`str-chat__modal-gallery__placeholder`,children:[`+`,o]})]})},rve=({imageIndex:e,itemCount:t,t:n})=>t===1?n(`Open image in gallery`):n(`Open gallery at image {{ index }}`,{index:e}),ive=e=>{let t={};for(let n of tve){let r=e[n];r!==void 0&&(t[n]=r)}return t},ave=e=>{let{ModalGallery:t=m5}=q();return(0,R.jsx)(t,{items:[e],modalClassName:`str-chat__image-modal`})},ove=d.memo(e=>{let{children:t,className:n,download:r,href:i,rel:a,target:o}=e;return i?(0,R.jsx)(`a`,{className:n,download:r,href:(0,M0.sanitizeUrl)(i),rel:a,target:o,children:t}):null}),sve=({type:e})=>{let{t}=Y(`Card`);return(0,R.jsx)(`div`,{className:G(`str-chat__message-attachment-card`,{[`str-chat__message-attachment-card--${e}`]:e}),children:(0,R.jsx)(`div`,{className:`str-chat__message-attachment-card--content`,children:(0,R.jsx)(`div`,{className:`str-chat__message-attachment-card--text`,children:t(`this content could not be displayed`)})})})},cve=({cardUrl:e,children:t,type:n})=>{let r=G(`str-chat__message-attachment-card str-chat__message-attachment-card--${n}`);return e?(0,R.jsx)(ove,{className:r,href:e,rel:`noopener noreferrer`,target:`_blank`,children:t}):(0,R.jsx)(`div`,{className:r,children:t})},lve=e=>{let{dimensions:t,image:n,image_url:r,thumb_url:i,title:a}=e;return n?(0,R.jsx)(`div`,{className:`str-chat__message-attachment-card--header str-chat__message-attachment-card-react--header`,"data-testid":`card-header`,children:(0,R.jsx)(i5,{alt:a||n,"data-testid":`image-test`,src:r??i,title:a||n,...t})}):null},uve=e=>{let{og_scrape_url:t,text:n,title:r,title_link:i}=e,a=i||t;return(0,R.jsxs)(`div`,{className:`str-chat__message-attachment-card--content`,children:[r&&(0,R.jsx)(`div`,{className:`str-chat__message-attachment-card--title`,children:r}),n&&(0,R.jsx)(`div`,{className:`str-chat__message-attachment-card--text`,children:n}),a&&(0,R.jsxs)(`div`,{className:`str-chat__message-attachment-card--source-link`,"data-testid":`card-source-link`,children:[(0,R.jsx)(TH,{}),(0,R.jsx)(`div`,{className:`str-chat__message-attachment-card--url`,children:a})]})]})},dve=d.memo(e=>{let{giphy:t,image_url:n,og_scrape_url:r,thumb_url:i,title:a,title_link:o,type:s}=e,{giphyVersion:c}=KB(``),l=o||r,u=i||n,d={};if(s===`giphy`&&t!==void 0){let e=t[c];u=e.url,d.height=e.height,d.width=e.width}return!a&&!l&&!u?(0,R.jsx)(sve,{}):(0,R.jsxs)(cve,{cardUrl:l,type:s,children:[(0,R.jsx)(lve,{...e,dimensions:d,image:u}),(0,R.jsx)(uve,{...e})]})}),fve=({attachment:e})=>{let{AttachmentFileIcon:t,FileSizeIndicator:n=i8}=q();return(0,R.jsxs)(`div`,{className:`str-chat__message-attachment-file--item`,"data-testid":`attachment-file`,children:[(0,R.jsx)(t??B8,{className:`str-chat__file-icon`,fileName:e.title,mimeType:e.mime_type}),(0,R.jsxs)(`div`,{className:`str-chat__message-attachment-file--item__info`,children:[(0,R.jsx)(`div`,{className:`str-chat__message-attachment-file--item__first-row`,children:(0,R.jsx)(`div`,{className:`str-chat__message-attachment-file--item__name`,"data-testid":`file-title`,children:e.title})}),(0,R.jsx)(`div`,{className:`str-chat__message-attachment-file--item__data`,children:(0,R.jsx)(n,{fileSize:e.file_size})})]}),(0,R.jsx)(D8,{assetUrl:e.asset_url,suggestedFileName:e.title})]})},pve=({attachment:e})=>{let{giphyVersion:t,imageAttachmentSizeHandler:n}=KB(),{BaseImage:r=i5}=q(),{t:i}=Y(),a=r===i5,o=(0,d.useRef)(null),[s,c]=(0,d.useState)(void 0),l=(0,d.useMemo)(()=>o5(e,{giphyVersionName:t}),[e,t]),u=l&&l.alt,f=l&&l.dimensions,p=l&&l.imageUrl,m=l&&l.title,h=s?.url||p,g=(0,d.useMemo)(()=>{let e=Number(f?.height),t=Number(f?.width);return{"--original-height":String(e>1?e:1e6),"--original-width":String(t>1?t:1e6)}},[f?.height,f?.width]);return(0,d.useLayoutEffect)(()=>{!o.current||!n||c(n(e,o.current))},[e,n]),p?(0,R.jsxs)(`div`,{className:G(`str-chat__message-attachment-giphy`),children:[(0,R.jsx)(r,{alt:u??m??i(`User uploaded content`),height:f?.height,ref:o,src:h,style:g,width:f?.width,...a?{showDownloadButtonOnError:!1}:{}}),(0,R.jsx)(mve,{})]}):null},mve=()=>(0,R.jsxs)(`div`,{className:`str-chat__giphy-badge`,children:[(0,R.jsx)(jU,{}),`Giphy`]}),hve=()=>(0,R.jsx)(`svg`,{fill:`currentColor`,viewBox:`0 0 16 16`,xmlns:`http://www.w3.org/2000/svg`,children:(0,R.jsx)(`path`,{d:`M12.586 2H10a1 1 0 1 1 0-2h5a1 1 0 0 1 1 1v5a1 1 0 1 1-2 0V3.414l-6.793 6.793a1 1 0 0 1-1.414-1.414L12.586 2zM6 1a1 1 0 1 1 0 2H3a1 1 0 0 0-1 1v9a1 1 0 0 0 1 1h8.967a1 1 0 0 0 1-.99L13 9.99a1 1 0 1 1 2 .02l-.033 3.023a3 3 0 0 1-3 2.967H3a3 3 0 0 1-3-3V4a3 3 0 0 1 3-3h3z`})}),gve=({GeolocationAttachmentMapPlaceholder:e=_ve,GeolocationMap:t,location:n})=>{let{channel:r,client:i}=K(),{t:a}=Y(),[o,s]=(0,d.useState)(!!n.end_at&&new Date(n.end_at).getTime()<new Date().getTime()),c=(0,d.useRef)(void 0),l=n.user_id===i.userID,u=!!n.end_at;return(0,d.useEffect)(()=>{n.end_at&&(clearTimeout(c.current),c.current=setTimeout(()=>s(!0),new Date(n.end_at).getTime()-Date.now()))},[n.end_at]),(0,R.jsxs)(`div`,{className:`str-chat__message-attachment-geolocation`,"data-testid":`attachment-geolocation`,children:[(0,R.jsx)(`div`,{className:`str-chat__message-attachment-geolocation__location-preview`,children:t?(0,R.jsx)(t,{latitude:n.latitude,longitude:n.longitude}):(0,R.jsx)(e,{location:n})}),(0,R.jsx)(`div`,{className:`str-chat__message-attachment-geolocation__status`,children:u?o?a(`Location sharing ended`):l?(0,R.jsxs)(`div`,{className:`str-chat__message-attachment-geolocation__status--active`,children:[(0,R.jsx)(nH,{appearance:`outline`,className:`str-chat__message-attachment-geolocation__stop-sharing-button`,onClick:()=>r?.stopLiveLocationSharing(n),size:`sm`,variant:`secondary`,children:a(`Stop sharing`)}),(0,R.jsx)(`div`,{className:`str-chat__message-attachment-geolocation__status--active-until`,children:a(`Live until {{ timestamp }}`,{timestamp:a(`timestamp/LiveLocation`,{timestamp:n.end_at})})})]}):(0,R.jsxs)(`div`,{className:`str-chat__message-attachment-geolocation__status--active`,children:[(0,R.jsx)(`div`,{className:`str-chat__message-attachment-geolocation__status--active-status`,children:a(`Live location`)}),(0,R.jsx)(`div`,{className:`str-chat__message-attachment-geolocation__status--active-until`,children:a(`Live until {{ timestamp }}`,{timestamp:a(`timestamp/LiveLocation`,{timestamp:n.end_at})})})]}):a(`Current location`)})]})},_ve=({location:e})=>{let{t}=Y();return(0,R.jsxs)(`div`,{className:`str-chat__message-attachment-geolocation__placeholder`,"data-testid":`geolocation-attachment-map-placeholder`,children:[(0,R.jsx)(iU,{}),(0,R.jsx)(`a`,{"aria-label":t(`Open location in a map`),className:`str-chat__message-attachment-geolocation__placeholder-link`,href:`https://maps.google.com?q=${[e.latitude,e.longitude].join()}`,rel:`noreferrer`,target:`_blank`,children:(0,R.jsx)(hve,{})})]})},vve=()=>{let{t:e}=Y(`UnsupportedAttachment`);return(0,R.jsxs)(`div`,{className:`str-chat__message-attachment-unsupported`,"data-testid":`attachment-unsupported`,children:[(0,R.jsx)(QH,{}),(0,R.jsx)(`div`,{className:`str-chat__message-attachment-unsupported__metadata`,children:(0,R.jsx)(`div`,{className:`str-chat__message-attachment-unsupported__title`,"data-testid":`unsupported-attachment-title`,children:e(`Unsupported attachment`)})})]})},yve=()=>{let{t:e}=Y();return(0,R.jsxs)(`div`,{className:`str-chat__visibility-disclaimer`,children:[(0,R.jsx)(ZH,{}),e(`Only visible to you`)]})},h5=({attachment:e,VideoPlayer:t=c5})=>{let{shouldGenerateVideoThumbnail:n,videoAttachmentSizeHandler:r}
502=KB(),i=(0,d.useRef)(null),[a,o]=(0,d.useState)(),[s,c]=d.useState(!n);(0,d.useLayoutEffect)(()=>{i.current&&r&&o(r(e,i.current,n))},[i,r,e,n]);let l=!!(e.thumb_url&&n);return(0,R.jsx)(`div`,{className:`str-chat__player-wrapper`,"data-testid":`video-wrapper`,ref:i,style:Q8(e.thumb_url||``),children:l&&!s?(0,R.jsx)(l5,{alt:e.title,"data-testid":`image-test`,onPlay:()=>c(!0),src:e.thumb_url,title:e.title}):(0,R.jsx)(t,{isPlaying:l,thumbnailUrl:a?.thumbUrl,videoUrl:a?.url})})},g5=({attachment:e,children:t,componentType:n})=>{let r=N_e(e),i=``;return!r&&!xb(e)&&(i=n===`card`&&!e?.image_url&&!e?.thumb_url?`no-image`:e?.actions?.length?`actions`:``),(0,R.jsx)(`div`,{className:G(`str-chat__message-attachment str-chat__message-attachment-dynamic-size`,{[`str-chat__message-attachment--${n}`]:n,[`str-chat__message-attachment--${e?.type}`]:e?.type,[`str-chat__message-attachment--${n}--${i}`]:n&&i,"str-chat__message-attachment--svg-image":P_e(e),"str-chat__message-attachment-with-actions":i===`actions`}),children:t})},_5=({actionHandler:e,attachment:t,AttachmentActions:n=U_e,attachmentActionsDefaultFocus:r})=>{if(!t.actions?.length)return null;let i=t.type&&r?.[t.type];return(0,R.jsx)(n,{...t,actionHandler:e,actions:t.actions,defaultFocusedActionValue:i,id:t.localMetadata?.id||``,text:t.text||``})},bve=e=>{let{attachments:t}=e;if(!t.length)return null;if(t.length>1)return(0,R.jsx)(wve,{...e,attachment:{items:t,type:`gallery`}});let n=t[0],{attachments:r,...i}=e;return yb(n,Y8)?(0,R.jsx)(kve,{attachment:n,...i}):(0,R.jsx)(Tve,{attachment:n,...i})},xve=e=>{let{attachment:t,Card:n=dve}=e,r=`card`;return t.actions&&t.actions.length?(0,R.jsx)(g5,{attachment:t,componentType:r,children:(0,R.jsxs)(`div`,{className:`str-chat__attachment`,children:[(0,R.jsx)(n,{...t}),(0,R.jsx)(_5,{...e})]})}):(0,R.jsx)(g5,{attachment:t,componentType:r,children:(0,R.jsx)(n,{...t})})},Sve=e=>{let{attachment:t,Giphy:n=pve}=e,r=`giphy`;return t.actions&&t.actions.length?(0,R.jsx)(g5,{attachment:t,componentType:r,children:(0,R.jsxs)(`div`,{className:`str-chat__attachment`,children:[(0,R.jsx)(yve,{}),(0,R.jsx)(n,{attachment:t}),(0,R.jsx)(_5,{...e})]})}):(0,R.jsx)(g5,{attachment:t,componentType:r,children:(0,R.jsx)(n,{attachment:t})})},Cve=e=>{let{attachment:t}=e;return _b(t)?(0,R.jsx)(Ove,{...e}):gb(t)?(0,R.jsx)(Dve,{...e}):!t.asset_url||!pb(t,Y8)?null:(0,R.jsx)(Eve,{...e})},wve=({attachment:e,ModalGallery:t=m5})=>(0,R.jsx)(g5,{attachment:e,componentType:`gallery`,children:(0,R.jsx)(t,{items:(0,d.useMemo)(()=>e.items.reduce((e,t)=>{let n=o5(t);return n&&e.push(n),e},[]),[e.items])},`gallery`)}),Tve=e=>{let{attachment:t,Image:n=ave}=e,r=`image`,i=(0,d.useRef)(null),{imageAttachmentSizeHandler:a}=KB(),[o,s]=(0,d.useState)(void 0);(0,d.useLayoutEffect)(()=>{i.current&&a&&s(a(t,i.current))},[i,a,t]);let c=t.image_url||t.thumb_url||``,l={...o5({...t,image_url:o?.url||c}),ref:i,style:Q8(c)};return t.actions&&t.actions.length?(0,R.jsx)(g5,{attachment:t,componentType:r,children:(0,R.jsxs)(`div`,{className:`str-chat__attachment`,children:[(0,R.jsx)(n,{...l}),(0,R.jsx)(_5,{...e})]})}):(0,R.jsx)(g5,{attachment:t,componentType:r,children:(0,R.jsx)(n,{...l})})},Eve=({attachment:e,File:t=fve})=>e.asset_url?(0,R.jsx)(g5,{attachment:e,componentType:`file`,children:(0,R.jsx)(t,{attachment:e})}):null,Dve=({attachment:e,Audio:t=V_e})=>(0,R.jsx)(g5,{attachment:e,componentType:`audio`,children:(0,R.jsx)(`div`,{className:`str-chat__attachment`,children:(0,R.jsx)(t,{attachment:e})})}),Ove=({attachment:e,isQuoted:t,VoiceRecording:n=J_e})=>(0,R.jsx)(g5,{attachment:e,componentType:`voiceRecording`,children:(0,R.jsx)(`div`,{className:`str-chat__attachment`,children:(0,R.jsx)(n,{attachment:e,isQuoted:t})})}),kve=e=>{let{attachment:t,Media:n}=e,r=`media`;return t.actions?.length?(0,R.jsx)(g5,{attachment:t,componentType:r,children:(0,R.jsxs)(`div`,{className:`str-chat__attachment`,children:[(0,R.jsx)(h5,{attachment:t,VideoPlayer:n}),(0,R.jsx)(_5,{...e})]})}):(0,R.jsx)(g5,{attachment:t,componentType:r,children:(0,R.jsx)(h5,{attachment:t,VideoPlayer:n})})},Ave=({Geolocation:e=gve,location:t})=>(0,R.jsx)(g5,{attachment:t,componentType:`geolocation`,children:(0,R.jsx)(e,{location:t})}),jve=({attachment:e,UnsupportedAttachment:t=vve})=>(0,R.jsx)(g5,{attachment:e,componentType:`unsupported`,children:(0,R.jsx)(t,{attachment:e})}),Mve=[`media`,`giphy`,`card`,`geolocation`,`file`,`unsupported`],Nve=e=>{let{attachmentActionsDefaultFocus:t=H_e,attachments:n,...r}=e,i=(0,d.useMemo)(()=>Pve({attachmentActionsDefaultFocus:t,attachments:n,...r}),[n,t]);return(0,R.jsx)(`div`,{className:`str-chat__attachment-list`,children:Mve.reduce((e,t)=>
502[...e,...i[t]],[])})},Pve=({attachments:e,...t})=>{let n=[],r=e.reduce((e,r)=>(xb(r)?e.geolocation.push((0,d.createElement)(Ave,{...t,key:`geolocation-${e.geolocation.length}`,location:r})):r.type===`giphy`?e.card.push((0,R.jsx)(Sve,{...t,attachment:r},`giphy-${e.giphy.length}`)):db(r)?e.card.push((0,R.jsx)(xve,{...t,attachment:r},`card-${e.card.length}`)):mb(r)||yb(r,Y8)?n.push(r):gb(r)||_b(r)||pb(r,Y8)?e.file.push((0,R.jsx)(Cve,{...t,attachment:r},`file-${e.file.length}`)):e.unsupported.push((0,R.jsx)(jve,{...t,attachment:r},`unsupported-${e.unsupported.length}`)),e),{card:[],file:[],geolocation:[],giphy:[],media:[],unsupported:[]});return n.length&&r.media.push((0,R.jsx)(bve,{...t,attachments:n},`media-container`)),r},Fve=e=>({attachments:e.attachments}),v5=()=>{let{attachmentManager:e}=IW(),{attachments:t}=J(e.state,Fve);return{attachments:t,availableUploadSlots:e.availableUploadSlots,blockedUploadsCount:e.blockedUploadsCount,failedUploadsCount:e.failedUploadsCount,isUploadEnabled:e.isUploadEnabled,pendingUploadsCount:e.pendingUploadsCount,successfulUploadsCount:e.successfulUploadsCount,uploadsInProgressCount:e.uploadsInProgressCount}},Ive=e=>({attachments:e.attachments}),Lve=e=>({poll:e.data}),Rve=e=>({location:e.location}),y5=()=>{let{attachmentManager:e,locationComposer:t,pollComposer:n}=IW(),{attachments:r}=J(e.state,Ive),{poll:i}=J(n.state,Lve),{location:a}=J(t.state,Rve);return{attachments:r,location:a,poll:i}},zve=()=>{let{pollComposer:e}=IW(),[t,n]=(0,d.useState)(e.canCreatePoll);return(0,d.useEffect)(()=>e.state.subscribe(()=>{n(e.canCreatePoll)}),[e]),t},Bve=e=>({cooldownRemaining:e.cooldownRemaining}),b5=()=>{let{channel:e}=KB();return J(e.cooldownTimer.state,Bve).cooldownRemaining??0},Vve=e=>{let{focus:t}=e,n=(0,d.useRef)(void 0);return(0,d.useEffect)(()=>{t&&n.current&&n.current.focus()},[t]),{textareaRef:n}},Hve=e=>{let t=e.textComposer.state.getLatestValue(),n=e.attachmentManager.state.getLatestValue(),r=e.linkPreviewsManager.state.getLatestValue(),i=e.pollComposer.state.getLatestValue(),a=e.customDataManager.state.getLatestValue(),o=e.state.getLatestValue();return()=>{e.state.next(o),e.textComposer.state.next(t),e.attachmentManager.state.next(n),e.linkPreviewsManager.state.next(r),e.pollComposer.state.next(i),e.customDataManager.state.next(a)}},Uve=e=>{let{overrideSubmitHandler:t}=e,{addNotification:n}=GG(),{editMessage:r,sendMessage:i}=zB(`useSubmitHandler`),{t:a}=Y(`useSubmitHandler`),o=IW();return{handleSubmit:(0,d.useCallback)(async e=>{e?.preventDefault();let s=await o.compose();if(!s||!s.message)return;let{localMessage:c,message:l,sendOptions:u}=s;if(o.editedMessage&&c.type!==`error`)try{await r(c,u),Kme(o),o.clear()}catch{n({emitter:`MessageComposer`,incident:{domain:`api`,entity:`message`,operation:`edit`},message:a(`Edit message request failed`),severity:`error`})}else{let e=Hve(o);try{l.poll_id?o.state.partialNext({id:jS.generateId(),pollId:null}):o.clear(),t?await t({cid:o.channel.cid,localMessage:c,message:l,sendOptions:u}):await i({localMessage:c,message:l,options:u}),o.config.text.publishTypingEvents&&await o.channel.stopTyping()}catch{e(),n({emitter:`MessageComposer`,incident:{domain:`api`,entity:`message`,operation:`send`},message:a(`Send message request failed`),severity:`error`})}}},[n,r,o,t,i,a])}},Wve=e=>({acceptedFiles:e.attachments.acceptedFiles,maxNumberOfFilesPerMessage:e.attachments.maxNumberOfFilesPerMessage}),Gve=(0,d.forwardRef)(function({onFileChange:e,resetOnChange:t=!0,...n},r){return(0,R.jsx)(`input`,{onChange:KG(t,e),ref:r,type:`file`,...n})}),x5=(0,d.forwardRef)(function({className:e,onFileChange:t,...n},r){let{t:i}=Y(`UploadFileInput`),{textareaRef:a}=EV(),o=IW(),{attachmentManager:s}=o,{isUploadEnabled:c}=v5(),{acceptedFiles:l,maxNumberOfFilesPerMessage:u}=J(o.configState,Wve),f=PW(),p=(0,d.useMemo)(()=>yB(),[]),m=(0,d.useCallback)(e=>{s.uploadFiles(e),a.current?.focus(),t?.(e)},[t,s,a]);return(0,R.jsx)(Gve,{accept:l?.join(`,`),"aria-label":i(`aria/File upload`),"data-testid":`file-input`,disabled:!c||f,id:p,multiple:u>1,...n,className:G(`str-chat__file-input`,e),onFileChange:m,ref:r})}),Kve=()=>{let{attachmentManager:e,textComposer:t}=IW();return{onPaste:(0,d.useCallback)(n=>{(async n=>{let{items:r}=n.clipboardData;n.preventDefault();let i;for(let e=0;e<r.length;e++){let t=r[e];if(t.kind===`string`&&t.type===`text/plain`){i=new Promise(e=>{t.getAsString(t=>{e(t)})});break}}let a=await qG(Array.from(r));if(i){let e=await i;t.insertText({text:e})}else e.uploadFiles(a)})(n)},[e,t])}},S5=class{constructor(e){this.closed=!1,this._unsubscribe=e}unsubscribe(){this.closed=!0,this._unsubscribe?.()}};function C5(e){return typeof e==`function`?{next:e}:e}var qve=class{constructor(e){this._closed=!1,e&&(this._producer=e)}get closed(){return this._closed}subscribe(e){let t=C5(e);return this.closed||this._producer?.(t),new S5(()=>{this._closed=!0})}},w5=class extends qve{constructor(){super(),this._observers=new Map,this._observerCounter=0}get observers(){return Array.from(this._observers.values())}next(e){if(this.closed)return;let t=this.observers;for(let n=0;n<t.length;n++)t[n].next(e)}error(e){if(this.closed)return;this.thrownError=e;let{observers:t}=this;for(let n=0;n<t.length;n++)t[n].error?.(e);this._observers.clear()}complete(){if(this.closed)return;this._closed=!0;let{observers:e}=this;for(let t=0;t<e.length;t++)e[t].complete?.();this._observers.clear()}subscribe(e){let t=C5(e);if(this.thrownError||this.closed){let e=new S5;return e.closed=!0,e}let n=this._observerCounter++;return this._observers.set(n,t),new S5(()=>{this._observers.delete(n)})}unsubscribe(){this._closed=!0,this._observers.clear()}},T5=class extends w5{constructor(e){super(),this._value=e}get value(){let{_value:e,thrownError:t}=this;if(t)throw t;return e}subscribe(e){let t=C5(e),n=super.subscribe(e);return n.closed||t.next(this._value),n}next(e){super.next(this._value=e)}},Jve=function(e){return e.CAM=`camera`,e.MIC=`microphone`,e}({}),Yve={audio:`microphone`,video:`camera`},Xve=class{constructor({mediaType:e}){this.state=new T5(void 0),this.status=new T5(void 0),this.error=new w5,this.changeSubscriptions=[],this.name=Yve[e]}get isWatching(){return this.changeSubscriptions.some(e=>!e.closed)}
502async watch(){if(!this.status.value&&(await this.check(),!this.status.value))return;let e=this.status.value,t=e=>{let{state:t}=e.target;this.state.next(t)};e.addEventListener(`change`,t),this.changeSubscriptions.push(new S5(()=>{e.removeEventListener(`change`,t)}))}unwatch(){this.changeSubscriptions.forEach(e=>e.unsubscribe())}async check(){if(!this.name){this.error.next(Error(`Unknown media recording permission`));return}let e;try{let t=await navigator.permissions.query({name:this.name});e=t.state,this.status.next(t)}catch{e=`granted`}this.state.next(e)}},Zve=(e,t)=>e??t,E5=(e,t)=>(0,gfe.default)(e,t,Zve),Qve=255,$ve=e=>e&&console.error(`[AMPLITUDE RECORDER ERROR]`,e),eye=e=>Math.sqrt(e.reduce((e,t)=>e+t**2,0)/e.length),D5={analyserConfig:{fftSize:32,maxDecibels:0,minDecibels:-100},sampleCount:100,samplingFrequencyMs:60},tye=class{constructor({config:e,stream:t}){this.amplitudes=new T5([]),this.state=new T5(void 0),this.error=new w5,this.start=()=>{if(this.state.value!==`closed`){if(!this.stream)throw Error(`Missing MediaStream instance. Cannot to start amplitude recording`);if(this.state.value===`recording`&&this.stop(),!this.analyserNode){if(!this.stream)return;this.init()}this.state.next(`recording`),this.amplitudeSamplingInterval=setInterval(()=>{if(!(this.analyserNode&&this.state.value===`recording`))return;let e=new Uint8Array(this.analyserNode.frequencyBinCount);try{this.analyserNode.getByteFrequencyData(e)}catch(e){$ve(e),this.error.next(e);return}let t=eye(e)/Qve;this.amplitudes.next([...this.amplitudes.value,t])},this.config.samplingFrequencyMs)}},this.config=E5({...e},D5),this.stream=t}init(){this.audioContext=new AudioContext,this.analyserNode=this.audioContext.createAnalyser();let{analyserConfig:e}=this.config;this.analyserNode.fftSize=e.fftSize,this.analyserNode.maxDecibels=e.maxDecibels,this.analyserNode.minDecibels=e.minDecibels,this.microphone=this.audioContext.createMediaStreamSource(this.stream),this.microphone.connect(this.analyserNode)}stop(){clearInterval(this.amplitudeSamplingInterval),this.amplitudeSamplingInterval=void 0,this.state.next(`stopped`)}close(){this.state.value!==`stopped`&&this.stop(),this.state.next(`closed`),this.amplitudes.next([]),this.microphone?.disconnect(),this.analyserNode?.disconnect(),this.audioContext?.state!==`closed`&&this.audioContext?.close()}},O5=44,k5=2,nye=4294967295,A5={AUDIO_FORMAT:{offset:20,value:1},BITS_PER_SAMPLE:{offset:34,value:k5*8},BLOCK_ALIGN:{offset:32},BYTE_RATE:{offset:28},CHANNEL_COUNT:{offset:22},CHUNK_ID:{offset:0,value:1380533830},CHUNK_SIZE:{offset:4},FILE_FORMAT:{offset:8,value:1463899717},SAMPLE_RATE:{offset:24},SUBCHUNK1_ID:{offset:12,value:1718449184},SUBCHUNK1_SIZE:{offset:16,value:16},SUBCHUNK2_ID:{offset:36,value:1684108385},SUBCHUNK2_SIZE:{offset:40}},j5=e=>e.charCodeAt(0)<<24|e.charCodeAt(1)<<16|e.charCodeAt(2)<<8|e.charCodeAt(3);j5(`data`),j5(`fmt `),j5(`RIFF`),j5(`WAVE`);var rye=({arrayBuffer:e,channelCount:t,sampleRate:n})=>{let r=n*t*k5,i=t*k5,a=new DataView(e),o=Math.min(a.byteLength-O5,nye-O5);a.setUint32(A5.CHUNK_ID.offset,A5.CHUNK_ID.value),a.setUint32(A5.CHUNK_SIZE.offset,e.byteLength-8,!0),a.setUint32(A5.FILE_FORMAT.offset,A5.FILE_FORMAT.value),a.setUint32(A5.SUBCHUNK1_ID.offset,A5.SUBCHUNK1_ID.value),a.setUint32(A5.SUBCHUNK1_SIZE.offset,A5.SUBCHUNK1_SIZE.value,!0),a.setUint16(A5.AUDIO_FORMAT.offset,A5.AUDIO_FORMAT.value,!0),a.setUint16(A5.CHANNEL_COUNT.offset,t,!0),a.setUint32(A5.SAMPLE_RATE.offset,n,!0),a.setUint32(A5.BYTE_RATE.offset,r,!0),a.setUint16(A5.BLOCK_ALIGN.offset,i,!0),a.setUint16(A5.BITS_PER_SAMPLE.offset,A5.BITS_PER_SAMPLE.value,!0),a.setUint32(A5.SUBCHUNK2_ID.offset,A5.SUBCHUNK2_ID.value),a.setUint32(A5.SUBCHUNK2_SIZE.offset,o,!0)},iye=e=>Array.from({length:e.numberOfChannels},(t,n)=>e.getChannelData(n)),aye=({arrayBuffer:e,dataByChannel:t})=>{let n=new DataView(e),r=t.length;t.forEach((e,t)=>{let i=O5+r*t;e.forEach(e=>{n.setInt16(i,e<0?Math.max(-1,e)*32768:Math.min(1,e)*32767,!0),i+=r*k5})})},oye=async(e,t)=>{let n=await nK(await tK(e),t),r=n.duration*t*n.numberOfChannels*k5+O5,i=new ArrayBuffer(r);return rye({arrayBuffer:i,channelCount:n.numberOfChannels,sampleRate:t}),aye({arrayBuffer:i,dataByChannel:iye(n)}),new Blob([i],{type:`audio/wav`})},sye=({blob:e,encoder:t=oye,sampleRate:n})=>t(ZG({blobsArray:[e],fileName:`audio_recording_${new Date().toISOString()}.${QG(e.type)}`,mimeType:e.type}),n),M5={audio:{others:`audio/webm`,safari:`audio/mp4;codecs=mp4a.40.2`}},cye={sampleRate:16e3},lye=e=>
502{e?.active&&e.getTracks().forEach(t=>{t.stop(),e.removeTrack(t)})},N5=e=>e&&console.error(`[MEDIA RECORDER ERROR]`,e),P5=function(e){return e.PAUSED=`paused`,e.RECORDING=`recording`,e.STOPPED=`stopped`,e}({}),uye=function(e){return e.VOICE_RECORDING=`voiceRecording`,e}({}),dye=class{constructor({config:e,generateRecordingTitle:t,t:n}={}){this.recordedChunkDurations=[],this.recordedData=[],this.recordingState=new T5(void 0),this.recording=new T5(void 0),this.error=new w5,this.notification=new w5,this.generateRecordingTitle=e=>this.customGenerateRecordingTitle?this.customGenerateRecordingTitle(e):`${this.mediaType}_recording_${new Date().toISOString()}.${QG(e)}`,this.makeVoiceRecording=async()=>{if(this.recordingUri&&URL.revokeObjectURL(this.recordingUri),!this.recordedData.length)return;let{mimeType:e}=this.mediaRecorderConfig,t=new Blob(this.recordedData,{type:e});if(e.match(`audio/webm`)&&(t=await(0,hfe.default)(t,this.durationMs,{logger:()=>null})),e.match(`audio/mp4`)||(t=await sye({blob:t,...this.transcoderConfig})),!t)return;this.recordingUri=URL.createObjectURL(t);let n=ZG({blobsArray:[t],fileName:this.generateRecordingTitle(t.type),mimeType:t.type});return{asset_url:this.recordingUri,duration:this.durationMs/1e3,file_size:t.size,localMetadata:{file:n,id:yB()},mime_type:t.type,title:n.name,type:`voiceRecording`,waveform_data:$8(this.amplitudeRecorder?.amplitudes.value??[],this.amplitudeRecorderConfig.sampleCount)}},this.handleErrorEvent=e=>{let{error:t}=e;N5(t),this.error.next(t),this.notification.next({text:this.t(`An error has occurred during recording`),type:`error`})},this.handleDataavailableEvent=async e=>{if(e.data.size&&this.mediaType===`audio`)try{this.recordedData.push(e.data);let t=await this.makeVoiceRecording();if(!t)return;this.signalRecordingReady?.(t),this.recording.next(t)}catch(e){N5(e),this.error.next(e),this.notification.next({text:this.t(`An error has occurred during the recording processing`),type:`error`})}},this.resetRecordingState=()=>{this.recordedData=[],this.recording.next(void 0),this.recordingState.next(void 0),this.recordedChunkDurations=[],this.startTime=void 0},this.cleanUp=()=>{this.resetRecordingState(),this.recordingUri&&URL.revokeObjectURL(this.recordingUri),this.amplitudeRecorder?.close(),this.mediaRecorder&&(lye(this.mediaRecorder.stream),this.mediaRecorder.removeEventListener(`dataavailable`,this.handleDataavailableEvent),this.mediaRecorder.removeEventListener(`error`,this.handleErrorEvent))},this.start=async()=>{if([`recording`,`paused`].includes(this.recordingState.value)){let e=Error(`Cannot start recording. Recording already in progress`);N5(e),this.error.next(e);return}if(!navigator.mediaDevices){let e=Error(`Media recording is not supported`);N5(e),this.error.next(e),this.notification.next({text:this.t(`Error starting recording`),type:`error`});return}if(this.mediaType===`video`){let e=Error(`Video recording is not supported. Provided MIME type: ${this.mediaRecorderConfig.mimeType}`);N5(e),this.error.next(e),this.notification.next({text:this.t(`Error starting recording`),type:`error`});return}if(this.permission.state.value||await this.permission.check(),this.permission.state.value===`denied`){N5(Error(`Permission denied`));return}try{let e=await navigator.mediaDevices.getUserMedia({audio:!0});this.mediaRecorder=new MediaRecorder(e,this.mediaRecorderConfig),this.mediaRecorder.addEventListener(`dataavailable`,this.handleDataavailableEvent),this.mediaRecorder.addEventListener(`error`,this.handleErrorEvent),this.startTime=new Date().getTime(),this.mediaRecorder.start(),this.mediaType===`audio`&&e&&(this.amplitudeRecorder=new tye({config:this.amplitudeRecorderConfig,stream:e}),this.amplitudeRecorder.start()),this.recordingState.next(`recording`)}catch(e){N5(e),this.cancel(),this.error.next(e),this.notification.next({text:this.t(`Error starting recording`),type:`error`})}},this.pause=()=>{this.recordingState.value===`recording`&&(this.startTime&&=(this.recordedChunkDurations.push(new Date().getTime()-this.startTime),void 0),this.mediaRecorder?.pause(),this.mediaRecorder?.requestData(),this.amplitudeRecorder?.stop(),this.recordingState.next(`paused`))},this.resume=()=>{this.recordingState.value===`paused`&&(this.startTime=new Date().getTime(),this.mediaRecorder?.resume(),this.amplitudeRecorder?.start(),this.recordingState.next(`recording`))},this.stop=()=>{let e=this.recording.value;if(e&&this.mediaRecorder?.state===`inactive`)return Promise.resolve(e);if(![`paused`,`recording`].includes(this.mediaRecorder?.state||``))return Promise.resolve(void 0);this.startTime&&=(this.recordedChunkDurations.push(new Date().getTime()-this.startTime),void 0);let t=new Promise(e=>{this.signalRecordingReady=e});return this.mediaRecorder?.stop(),this.amplitudeRecorder?.stop(),this.recordingState.next(`stopped`),t},this.cancel=()=>{this.stop(),this.cleanUp()},this.t=n||FV,this.amplitudeRecorderConfig=E5({...e?.amplitudeRecorderConfig}
502,D5),this.mediaRecorderConfig=E5({...e?.mediaRecorderConfig},{mimeType:MediaRecorder.isTypeSupported(`audio/webm`)?M5.audio.others:M5.audio.safari}),this.transcoderConfig=E5({...e?.transcoderConfig},cye);let r=$G(this.mediaRecorderConfig.mimeType);if(!r)throw Error(`Unsupported media type (supported audio or video only). Provided mimeType: ${this.mediaRecorderConfig.mimeType}`);this.mediaType=r,this.permission=new Xve({mediaType:r}),this.customGenerateRecordingTitle=t}get durationMs(){return this.recordedChunkDurations.reduce((e,t)=>e+t,0)}},fye=({asyncMessagesMultiSendEnabled:e,enabled:t,generateRecordingTitle:n,handleSubmit:r,recordingConfig:i})=>{let{t:a}=Y(`useMediaRecorder`),o=IW(),[s,c]=(0,d.useState)(),[l,u]=(0,d.useState)(),[f,p]=(0,d.useState)(),[m,h]=(0,d.useState)(!1),g=(0,d.useMemo)(()=>t?new dye({config:i??{},generateRecordingTitle:n,t:a}):void 0,[i,t,n,a]),_=(0,d.useCallback)(async()=>{if(!g)return;let t=await g.stop();t&&(await o.attachmentManager.uploadAttachment(t),e||h(!0),g.cleanUp())},[e,o,g]);return(0,d.useEffect)(()=>{m&&(r(),h(!1))},[r,m]),(0,d.useEffect)(()=>{if(!g)return;g.permission.watch();let e=g.recording.subscribe(c),t=g.recordingState.subscribe(u),n=g.permission.state.subscribe(p);return()=>{g.cancel(),g.permission.unwatch(),e.unsubscribe(),t.unsubscribe(),n.unsubscribe()}},[g]),{completeRecording:_,permissionState:f,recorder:g,recording:s,recordingState:l}},pye=e=>{let{asyncMessagesMultiSendEnabled:t,audioRecordingConfig:n,audioRecordingEnabled:r}=e,{textareaRef:i}=Vve(e),{handleSubmit:a}=Uve(e),o=fye({asyncMessagesMultiSendEnabled:t,enabled:!!r,handleSubmit:a,recordingConfig:n}),{onPaste:s}=Kve();return{handleSubmit:a,onPaste:s,recordingController:o,textareaRef:i}},mye=({editedMessage:e,quotedMessage:t})=>({editedMessage:e,quotedMessage:t}),F5=()=>{let e=IW(),t=e.channel.getConfig(),{editedMessage:n,quotedMessage:r}=J(e.state,mye);return(0,d.useMemo)(()=>(t?.commands??[]).filter(e=>!!e.name).map(t=>({command:t,enabled:!e.isCommandDisabled(t)})),[t,n,e,r])},hye=e=>e,gye=()=>{let e=IW();return J(e.editingAuditState,hye),e.hasSendableData},_ye=e=>e,vye=()=>{let e=IW();return J(e.editingAuditState,_ye),e.contentIsEmpty},I5=({className:e,uploadState:t,...n})=>{let{t:r}=Y();return(0,R.jsx)(nH,{"aria-label":r(`aria/Remove attachment`),circular:!0,className:G(`str-chat__attachment-preview__remove-button`,e),"data-testid":`preview-item-delete-button`,disabled:t===`uploading`,...n,children:(0,R.jsx)(zH,{})})},yye=({isOwnMessage:e})=>(0,R.jsx)(`div`,{className:G(`str-chat__quoted-message-indicator`,{"str-chat__quoted-message-indicator--own-message":e})}),bye=e=>({quotedMessage:e.quotedMessage}),L5=()=>null,R5=`Giphy`,xye=e=>Sb(e),Sye=e=>xye(e)?`giphy`:db(e)?`link`:yb(e,Y8)?`video`:mb(e)?`image`:gb(e)?`audio`:_b(e)?`voiceRecording`:pb(e,Y8)?`file`:`unsupported`,Cye=e=>{let t={documents:[],giphies:[],images:[],links:[],locations:[],polls:[],total:0,videos:[],voiceRecordings:[]};if(!e||!e.attachments)return t;let n=e.attachments.reduce((e,t)=>{switch(Sye(t)){case`giphy`:e.giphies.push(t),e.total+=1;break;case`link`:e.links.push(t),e.total+=1;break;case`video`:e.videos.push(t),e.total+=1;break;case`voiceRecording`:e.voiceRecordings.push(t),e.total+=1;break;case`audio`:case`file`:e.documents.push(t),e.total+=1;break;default:mb(t)&&(e.images.push(t),e.total+=1)}return e},t);return e.shared_location?(n.locations.push(e.shared_location),n.total+=1):e.poll&&(n.polls.push(e.poll),n.total+=1),n},wye=(e,t)=>{let n=Cye(e),r={groupedAttachments:n,Icon:L5,PreviewImage:null,previewType:null};if(!n.total)return r;if(n.polls.length>0)return{...r,Icon:EH,previewType:`poll`};if(n.locations.length>0)return{...r,Icon:iU,previewType:`location`};if(n.giphies.length>0&&n.giphies.length===n.total){let e=n.giphies[0],i=e.giphy?.[t]?.url||e.thumb_url||e.image_url||``;return{...r,Icon:eU,PreviewImage:(0,R.jsx)(i5,{alt:R5,className:`str-chat__attachment-preview__thumbnail`,src:i,title:R5}),previewType:`giphy`}}if(n.documents.length===n.total&&n.documents.length===1){let e=n.documents[0];return{...r,Icon:eU,PreviewImage:(0,R.jsx)(B8,{fileName:e.title,mimeType:e.mime_type}),previewType:`file`}}if(n.links.length===n.total){let e=n.links[0];return{...r,Icon:TH,PreviewImage:(0,R.jsx)(i5,{alt:e.title,className:`str-chat__attachment-preview__thumbnail`,src:e.thumb_url||e.image_url,title:e.title}),previewType:`link`}}if(n.videos.length===n.total){let e=n.videos[0];return{...r,Icon:EU,PreviewImage:(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(i5,{alt:e.asset_url,className:`str-chat__attachment-preview__thumbnail`,src:e.thumb_url,title:e.title}),(0,R.jsx)(`div`,{className:`str-chat__attachment-preview__thumbnail__play-indicator`,children:(0,R.jsx)(gU,{})})]}),previewType:`video`}}if(n.images.length===n.total){let e=n.images[0];
502return{...r,Icon:wH,PreviewImage:(0,R.jsx)(i5,{alt:e.fallback,className:`str-chat__attachment-preview__thumbnail`,src:e.image_url,title:e.title}),previewType:`image`}}return n.voiceRecordings.length===n.total?{...r,Icon:aU,previewType:`voice`}:{...r,Icon:eU,previewType:`mixed`}},Tye=({getQuotedMessageAuthor:e,renderText:t})=>{let n=IW(),{quotedMessage:r}=J(n.state,bye);return r?(0,R.jsx)(`div`,{className:`str-chat__message-composer__quoted-message-preview-slot`,children:(0,R.jsx)(z5,{getQuotedMessageAuthor:e,onRemove:()=>n.setQuotedMessage(null),quotedMessage:r,renderText:t})}):null},z5=({authorLabel:e,className:t,getQuotedMessageAuthor:n,onClick:r,onRemove:i,quotedMessage:a,renderText:o})=>{let{client:s}=K(),{t:c,userLanguage:l}=Y(),{giphyVersion:u=`fixed_height`}=KB(`QuotedMessagePreview`),f=(0,d.useMemo)(()=>a?.i18n?.[`${l}_text`]||a?.text,[a?.i18n,a?.text,l]),{AttachmentIcon:p,PreviewImage:m,renderedText:h}=(0,d.useMemo)(()=>{if(!a)return{AttachmentIcon:L5,renderedText:null};let{groupedAttachments:e,Icon:t,PreviewImage:n,previewType:r}=wye(a,u),i;if(f)i=o?o(f,a?.mentioned_users):f;else if(r===`poll`)i=a.poll.name;else if(r===`location`)i=c(`Live location`);else if(r===`voice`){let t=e.voiceRecordings[0];i=c(`Voice message {{ duration }}`,{duration:Z8(t.duration)})}else r===`giphy`?i=R5:r===`link`?i=e.links[0].title:r===`mixed`?i=c(`{{ count }} files`,{count:e.total}):r===`video`?i=e.videos.length===1?c(`Video`):c(`{{ count }} videos`,{count:e.videos.length}):r===`file`?i=e.documents[0].title:r===`image`&&(i=e.images.length===1?c(`Photo`):c(`{{ count }} photos`,{count:e.images.length}));return{AttachmentIcon:t,PreviewImage:n,renderedText:i}},[u,a,f,o,c]),g=s.user?.id===a?.user?.id,_=!!r,v=e=>{!r||e.key!==`Enter`&&e.key!==` `||(e.preventDefault(),r(e))};if(!h&&!p&&!m)return null;let y=n?.(a)??a.user?.name;return(0,R.jsxs)(`div`,{"aria-label":_?c(`aria/Jump to quoted message`):void 0,className:G(`str-chat__quoted-message-preview`,t,{"str-chat__quoted-message-preview--own":g}),"data-testid":`quoted-message-preview`,onClick:r,onKeyDown:_?v:void 0,role:_?`button`:void 0,tabIndex:_?0:void 0,children:[(0,R.jsx)(yye,{isOwnMessage:g}),(0,R.jsxs)(`div`,{className:`str-chat__quoted-message-preview__content`,children:[(0,R.jsx)(`div`,{className:`str-chat__quoted-message-preview__author`,children:e??(g?c(`You`):y?c(`Reply to {{ authorName }}`,{authorName:y}):c(`Reply`))}),(0,R.jsxs)(`div`,{className:`str-chat__quoted-message-preview__message`,"data-testid":`quoted-message-text`,children:[(0,R.jsx)(p,{}),(0,R.jsx)(`div`,{className:`str-chat__quoted-message-preview__message-text`,children:h})]})]}),m&&(0,R.jsx)(`div`,{className:`str-chat__quoted-message-preview__image`,children:m}),i&&(0,R.jsx)(I5,{"aria-label":c(`aria/Cancel Reply`),"data-testid":`quoted-message-preview-dismiss-btn`,onClick:i})]})},Eye=({renderText:e})=>{let{message:t,renderText:n}=o6(`QuotedMessage`),{jumpToMessage:r}=zB(`QuotedMessage`),i=e??n,{quoted_message:a}=t;return a?(0,R.jsx)(z5,{onClick:e=>{a&&(e.stopPropagation(),e.preventDefault(),r(a.id))},quotedMessage:a,renderText:i}):null},Dye=e=>({timeLeftMs:e.timeLeftMs});function Oye(){let{t:e}=Y();return(0,R.jsxs)(`div`,{className:`str-chat__message-saved-for-later`,children:[(0,R.jsx)(gH,{}),(0,R.jsx)(`span`,{children:e(`Saved for later`)})]})}var kye=59;function Aye({reminder:e}){let{t}=Y(),{timeLeftMs:n}=J(e?.state,Dye)??{},r=e?.timer.stopRefreshBoundaryMs,i=e?.remindAt&&r?e.remindAt.getTime()+r:void 0,a=!!i&&new Date().getTime()>i;if(n===null||!e.remindAt)return null;let o=Date.now(),s=e.remindAt.getTime()-o,c=Math.abs(s)/(60*1e3)>kye;return(0,R.jsxs)(`p`,{className:`str-chat__message-reminder`,children:[(0,R.jsx)(mH,{}),(0,R.jsx)(`span`,{children:t(`Reminder set`)}),(0,R.jsx)(`span`,{children:` · `}),(0,R.jsx)(`span`,{className:`str-chat__message-reminder__time-left`,children:a?c?t(`Due since {{ dueSince }}`,{dueSince:t(`timestamp/ReminderNotification`,{timestamp:e.remindAt})}):t(`Due since {{ dueSince }}`,{dueSince:t(`duration/Message reminder`,{milliseconds:s})}):c?t(`timestamp/ReminderNotification`,{timestamp:e.remindAt}):t(`Due {{ timeLeft }}`,{timeLeft:t(`duration/Message reminder`,{milliseconds:n})})})]})}var jye=({reminder:e})=>e?e.remindAt?(0,R.jsx)(Aye,{reminder:e}):(0,R.jsx)(Oye,{}):null,Mye=e=>{let{message:t,renderingLetterCount:n,renderText:r,streamingLetterIntervalMs:i}=e,{message:a}=o6(`StreamedMessageText`),{channel:o}=KB(),s=t||a,{text:c=``}=s,{skipAnimation:l,streamedMessageText:u}=gge({renderingLetterCount:n,streamingLetterIntervalMs:i,text:c});return(0,d.useEffect)(()=>{o?.on(`ai_indicator.stop`,()=>{l()})},[o,l]),(0,R.jsx)(w8,{message:{...s,text:u},renderText:r})},Nye=`[role="option"]:not(:disabled), [role="menuitem"]:not(:disabled), button:not(:disabled), a:not(:disabled)`,Pye=e=>e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement||e instanceof HTMLElement&&e.isContentEditable,B5=d.createContext({close:()=>null}),Fye=({children:e,...t})=>(0,R.jsx)(B5.Provider,{value:t,children:e}),Iye=()=>d.useContext(B5),Lye=({children:e,className:t,matchReferenceWidth:n=!1,onClose:r,onOpen:i,placement:a=`bottom`,referenceElement:o,TriggerComponent:s,triggerProps:c})=>{let[l,u]=(0,d.useState)(null),f=s?l:o??null,[p,m]=(0,d.useState)(!s),[h,g]=(0,d.useState)(null),{refs:_,strategy:v,update:y,x:b,y:x}=QV({placement:a});(0,d.useEffect)(()=>{s&&m(!1)},[s]);let S=(0,d.useCallback)(()=>{m(!1),r?.()},[r]),C=(0,d.useCallback)(()=>{m(!0),i?.()},[i]),w=(0,d.useCallback)(()=>
502{if(p){S();return}C()},[S,p,C]);(0,d.useEffect)(()=>{_.setReference(f)},[_,f]),(0,d.useEffect)(()=>{_.setFloating(h)},[h,_]),(0,d.useEffect)(()=>{!p||!h||!f||y?.()},[h,p,f,y]),(0,d.useEffect)(()=>{if(!p)return;let e=e=>{e.target instanceof Node&&(h?.contains(e.target)||f?.contains(e.target)||S())};return document.addEventListener(`mousedown`,e),()=>{document.removeEventListener(`mousedown`,e)}},[S,h,p,f]);let T=(0,d.useMemo)(()=>M6({getItems:e=>Array.from(e.currentTarget.querySelectorAll(Nye))}),[]),E=(0,d.useRef)(!1),D=(0,d.useCallback)(e=>{if(e.key===`Escape`){e.preventDefault(),e.stopPropagation(),E.current=!0,S();return}Pye(e.target)||T(e)},[S,T]),O=(0,d.useCallback)(e=>{e.key===`Escape`&&E.current&&(E.current=!1,e.stopPropagation())},[]),k=s;return(0,R.jsxs)(`div`,{className:`str-chat__dropdown`,children:[k?(0,R.jsx)(k,{"aria-expanded":p,onClick:w,referenceRef:u,...c}):null,p&&f?(0,R.jsx)(pq,{autoFocus:!0,restoreFocus:!0,children:(0,R.jsx)(Fye,{close:S,children:(0,R.jsx)(`div`,{className:G(`str-chat__dropdown__items`,t),onClick:S,onKeyDown:D,onKeyUpCapture:O,ref:g,role:`menu`,style:{left:b??0,minWidth:n?f.getBoundingClientRect().width:void 0,position:v,top:x??0},children:e})})}):null]})},V5=({children:e,description:t,fieldClassName:n,title:r,...i})=>{let{"aria-label":a,"aria-labelledby":o,checked:s,defaultChecked:c,disabled:l,id:u,onChange:f,onKeyDown:p,...m}=i,h=PU(),g=u??`str-chat__switch-field-${h}`,_=`${g}-label`,v=(0,d.useRef)(null),[y,b]=(0,d.useState)(!!c),x=s!==void 0,S=x?s:y,C=x&&f===void 0,w=e=>{x||b(e.target.checked),f?.(e)},T=e=>{p?.(e),!(e.defaultPrevented||e.key!==` `)&&(e.preventDefault(),e.currentTarget.click())},E=e=>{l||e.target===v.current||v.current?.click()},D=((0,d.isValidElement)(e)?e:void 0)?.props.id,O=o??(a?void 0:r?_:D);return(0,R.jsxs)(`div`,{className:G(`str-chat__form__switch-field`,n,l&&`str-chat__form__switch-field--disabled`),children:[r?(0,R.jsx)(H5,{description:t,htmlFor:g,id:_,title:r}):e,(0,R.jsx)(Rye,{...m,"aria-label":a,"aria-labelledby":O,checked:S,disabled:l,id:g,on:S,onChange:w,onKeyDown:T,onSwitchClick:E,readOnly:C,switchRef:v})]})},Rye=({className:e,on:t,onSwitchClick:n,switchRef:r,...i})=>(0,R.jsxs)(`div`,{className:G(`str-chat__form__switch-field__switch`,{"str-chat__form__switch-field__switch--on":t}),onClick:n,children:[(0,R.jsx)(`input`,{...i,className:G(`str-chat__form__switch-field__input`,e),ref:r,role:`switch`,type:`checkbox`}),(0,R.jsx)(`span`,{className:`str-chat__form__switch-field__switch-handle`})]}),H5=({asError:e,children:t,className:n,description:r,title:i,...a})=>(0,R.jsx)(`label`,{className:G(`str-chat__form__switch-field__label`,{"str-chat__form__switch-field__label--as-error":e},n),...a,children:(0,R.jsx)(`div`,{className:`str-chat__form__switch-field__label__content`,children:i?(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(zye,{children:i}),r!=null&&r!==``&&(0,R.jsx)(Bye,{children:r})]}):t})}),zye=({children:e,className:t,title:n,...r})=>(0,R.jsx)(`div`,{className:G(`str-chat__form__switch-field__label__text`,t),...r,children:e??n}),Bye=({children:e,className:t,description:n,...r})=>(0,R.jsx)(`div`,{className:G(`str-chat__form__switch-field__label__description`,t),...r,children:e??n}),Vye=60*1e3,Hye=[900*1e3,3600*1e3,480*60*1e3],Uye=()=>null,Wye=({children:e,onClick:t,referenceRef:n,...r})=>(0,R.jsx)(nH,{...r,className:`str-chat__live-location-sharing-duration-selector__button`,onClick:t,ref:n,type:`button`,children:e}),Gye=({close:e,GeolocationMap:t=Uye,shareDurations:n=Hye})=>{let{addNotification:r}=GG(),{t:i}=Y(),a=IW(),[o,s]=(0,d.useState)([]),[c,l]=(0,d.useState)(void 0),[u,f]=(0,d.useState)(null),[p,m]=(0,d.useState)(!1),[h,g]=(0,d.useState)(void 0),_=(0,d.useMemo)(()=>n.filter(e=>e>=Vye),[n]),v=(0,d.useMemo)(()=>o.length>0?i(`duration/Share Location`,{milliseconds:c??o[0]}):void 0,[o,c,i]),y=(0,d.useMemo)(()=>({children:v?(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(`span`,{children:v}),(0,R.jsx)(kH,{})]}):null}),[v]),b=(0,d.useCallback)(()=>new Promise((e,t)=>{navigator.geolocation.getCurrentPosition(t=>{e(t)},e=>{console.warn(e),t(e)},{timeout:1e3})}),[]),x=(0,d.useCallback)(()=>{m(!0);let e=navigator.geolocation.watchPosition(e=>{f(e),m(!1),g(void 0)},e=>{f(null),m(!1),g(e)},{timeout:1e3});return()=>{navigator.geolocation.clearWatch(e)}},[]);(0,d.useEffect)(()=>x(),[x]);let S=o.length>0;return(0,R.jsxs)(W6.Root,{className:`str-chat__share-location-dialog`,"data-testid":`share-location-dialog`,children:[(0,R.jsx)(W6.Header,{close:e,description:i(`Select your current location and optionally enable live location sharing`),title:i(`Share Location`)}),(0,R.jsxs)(W6.Body,{children:[(0,R.jsx)(t,{geolocationPositionError:h,latitude:u?.coords.latitude,loadingLocation:p,longitude:u?.coords.longitude,restartLocationWatching:x}),_.length>0&&(0,R.jsxs)(`div`,{className:G(`str-chat__live-location-activation`,{"str-chat__live-location-activation--expanded":S}),children:[(0,R.jsx)(V5,{checked:S,"data-testid":`share-location-dialog-live-location-switch`,disabled:!u,onChange:e=>{e.stopPropagation(),S?(s([]),l(void 0)):(s(_),l(_[0]))},title:i(`Share live location for`)}),S&&v&&(0,R.jsx)(`div`,{className:`str-chat__live-location-sharing-duration-selector`,children:(0,R.jsx)(Lye,{placement:`bottom-start`,TriggerComponent:Wye,triggerProps:y,children:(0,R.jsx)(Kye,{durations:o,selectDuration:l,selectedDuration:c})})})]})]}),(0,R.jsx)(W6.Footer,{children:(0,R.jsxs)(W6.FooterControls,{children:[(0,R.jsx)(W6.FooterControlsButtonSecondary,{className:`str-chat__prompt__footer__c
502ontrols-button--cancel`,onClick:()=>{a.locationComposer.initState(),e()},children:i(`Cancel`)}),(0,R.jsx)(W6.FooterControlsButtonSecondary,{className:`str-chat__prompt__footer__controls-button--submit`,disabled:!u,onClick:async()=>{let t=u&&{latitude:u.coords.latitude,longitude:u.coords.longitude};t||=(await b()).coords,a.locationComposer.setData({...t,durationMs:c}),e()},type:`submit`,children:i(`Attach`)}),(0,R.jsx)(W6.FooterControlsButtonPrimary,{className:`str-chat__prompt__footer__controls-button--submit`,disabled:!u,onClick:async()=>{let t=u&&{latitude:u.coords.latitude,longitude:u.coords.longitude};if(!t)try{t=(await b()).coords}catch(e){r({emitter:`ShareLocationDialog`,error:e instanceof Error?e:void 0,message:i(`Failed to retrieve location`),severity:`error`,type:`browser:location:get:failed`});return}a.locationComposer.setData({...t,durationMs:c});try{await a.sendLocation()}catch(e){r({emitter:`ShareLocationDialog`,error:e instanceof Error?e:void 0,message:i(`Failed to share location`),severity:`error`,type:`api:location:share:failed`});return}e()},type:`submit`,children:i(`Share`)})]})})]})},Kye=({durations:e,selectDuration:t,selectedDuration:n})=>{let{t:r}=Y(),{close:i}=Iye();return(0,R.jsx)(R6,{children:(0,R.jsx)(L6,{children:e.map(e=>(0,R.jsx)(P6,{"aria-checked":n===e,className:`str-chat__live-location-sharing-duration-option`,onClick:()=>{t(e),i()},role:`menuitemradio`,children:r(`duration/Share Location`,{milliseconds:e})},`duration-${e}`))})})},qye=e=>({enforce_unique_vote:e.enforce_unique_vote,is_closed:e.is_closed,max_votes_allowed:e.max_votes_allowed,name:e.name,options:e.options}),Jye=()=>{let{t:e}=Y(`PollHeader`),{poll:t}=_6(),{enforce_unique_vote:n,is_closed:r,max_votes_allowed:i,name:a,options:o}=J(t.state,qye),s=(0,d.useMemo)(()=>r?e(`Vote ended`):n||o.length===1?e(`Select one`):i?e(`Select up to {{count}}`,{count:i>o.length?o.length:i}):o.length>1?e(`Select one or more`):``,[r,n,i,o.length,e]);return a?(0,R.jsxs)(`div`,{className:`str-chat__poll-header`,children:[(0,R.jsx)(`div`,{className:`str-chat__poll-title`,children:a}),(0,R.jsx)(`div`,{className:`str-chat__poll-subtitle`,children:s})]}):null},Yye=e=>{let t=e.trim();if(t===``)return null;let n=Number(t);return Number.isFinite(n)?n:null},U5=(e,t,n)=>Math.min(Math.max(e,t),n),Xye=(0,d.forwardRef)(function({className:e,disabled:t=!1,id:n,label:r,max:i,min:a,onChange:o,step:s=1,value:c,...l},u){let f=PU(),p=n??f,{t:m}=Y(),h=Yye(c),g=a??-1/0,_=i??1/0,v=h!==null&&h<=g,y=h!==null&&h>=_,b=(0,d.useCallback)(e=>{let t=e.target.value;(t===``||/^\d+$/.test(t))&&o(e)},[o]),x=(0,d.useCallback)(e=>({currentTarget:{value:e},target:{value:e}}),[]),S=(0,d.useCallback)(()=>{if(t||v)return;let e=h===null?g:U5(h-s,g,_);o(x(String(e)))},[t,v,h,s,g,_,o,x]),C=(0,d.useCallback)(()=>{if(t||y)return;let e=h===null?g:U5(h+s,g,_);o(x(String(e)))},[t,y,h,s,g,_,o,x]),w=(0,d.useCallback)(e=>{e.key===`ArrowDown`?(e.preventDefault(),S()):e.key===`ArrowUp`&&(e.preventDefault(),C())},[S,C]);return(0,R.jsxs)(`div`,{className:G(`str-chat__form-numeric-input`,t&&`str-chat__form-numeric-input--disabled`,e),children:[!!r&&(0,R.jsx)(`label`,{className:`str-chat__form-numeric-input__label`,htmlFor:p,children:r}),(0,R.jsxs)(`div`,{className:G(`str-chat__form-numeric-input__wrapper`),children:[(0,R.jsx)(nH,{appearance:`outline`,"aria-label":m(`aria/Decrease value`),circular:!0,className:G(`str-chat__form-numeric-input__stepper str-chat__form-numeric-input__stepper--decrement`),disabled:t||v,onClick:S,size:`xs`,variant:`secondary`,children:(0,R.jsx)(PH,{className:`str-chat__form-numeric-input__stepper-icon`})}),(0,R.jsx)(`input`,{"aria-valuemax":Number.isFinite(_)?_:void 0,"aria-valuemin":Number.isFinite(g)?g:void 0,"aria-valuenow":h??void 0,className:`str-chat__form-numeric-input__input`,disabled:t,id:p,inputMode:`numeric`,onChange:b,onKeyDown:w,ref:u,role:`spinbutton`,type:`text`,value:c,...l}),(0,R.jsx)(nH,{appearance:`outline`,"aria-label":m(`aria/Increase value`),circular:!0,className:G(`str-chat__form-numeric-input__stepper str-chat__form-numeric-input__stepper--increment`),disabled:t||y,onClick:C,size:`xs`,variant:`secondary`,children:(0,R.jsx)(vU,{className:`str-chat__form-numeric-input__stepper-icon`})})]})]})}),W5=({icon:e,text:t})=>(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(`span`,{"aria-hidden":!0,
502className:`str-chat__form-text-input__message-icon`,children:e}),(0,R.jsx)(`span`,{className:`str-chat__form-text-input__message-text`,children:t})]}),G5=e=>e.kind===`neutral`?(0,R.jsx)(`div`,{className:G(`str-chat__form-text-input__message`,e.insidePlacement&&`str-chat__form-text-input__message--field-message-inside`),id:e.id,children:e.text}):e.kind===`success`?(0,R.jsx)(`div`,{className:G(`str-chat__form-text-input__message`,`str-chat__form-text-input__message--success`,e.insidePlacement&&`str-chat__form-text-input__message--field-message-inside`),id:e.id,children:(0,R.jsx)(W5,{icon:e.successMessageIcon??(0,R.jsx)(OH,{}),text:e.text})}):e.kind===`error`?(0,R.jsx)(`div`,{className:G(`str-chat__form-text-input__message`,`str-chat__form-field-error`,e.insidePlacement&&`str-chat__form-text-input__message--field-message-inside`),id:e.id,role:`alert`,children:(0,R.jsx)(W5,{icon:e.errorMessageIcon??(0,R.jsx)(YH,{}),text:e.text})}):null,K5=(0,d.forwardRef)(function({className:e,disabled:t,error:n=!1,errorMessage:r,errorMessageIcon:i,fieldMessagePlacement:a=`outside`,id:o,label:s,leading:c,message:l,successMessage:u,successMessageIcon:d,trailing:f,trailingText:p,variant:m=`outline`,...h},g){let _=PU(),v=o??_,y=n&&(r!=null||l!=null),b=!y&&u!=null,x=!y&&!b&&l!=null,S=a===`inside`&&(y||b||x),C=y?`${v}-field-error`:b||x?`${v}-message`:void 0,w=[h[`aria-describedby`],C].filter(e=>!!e).join(` `),T=y?(0,R.jsx)(G5,{errorMessageIcon:i,id:C,insidePlacement:S,kind:`error`,text:r??l}):b?(0,R.jsx)(G5,{id:C,insidePlacement:S,kind:`success`,successMessageIcon:d,text:u}):x?(0,R.jsx)(G5,{id:C,insidePlacement:S,kind:`neutral`,text:l}):null;return(0,R.jsxs)(`div`,{className:G(`str-chat__form-text-input`,n&&`str-chat__form-text-input--error`,b&&`str-chat__form-text-input--success`,t&&`str-chat__form-text-input--disabled`,S&&`str-chat__form-text-input--field-message-inside`,e),children:[s?(0,R.jsx)(`label`,{className:`str-chat__form-text-input__label`,htmlFor:v,children:s}):null,(0,R.jsxs)(`div`,{className:G(`str-chat__form-text-input__wrapper`,`str-chat__form-text-input__wrapper--${m}`,S&&`str-chat__form-text-input__wrapper--field-message-inside`),children:[(0,R.jsxs)(`div`,{className:`str-chat__form-text-input__control-row`,children:[c?(0,R.jsx)(`span`,{"aria-hidden":!0,className:`str-chat__form-text-input__leading`,children:c}):null,(0,R.jsx)(`input`,{"aria-describedby":w,"aria-invalid":n,className:`str-chat__form-text-input__input`,disabled:t,id:v,ref:g,...h}),p==null?null:(0,R.jsx)(`span`,{"aria-hidden":!0,className:`str-chat__form-text-input__suffix`,children:p}),f?(0,R.jsx)(`span`,{"aria-hidden":!0,className:`str-chat__form-text-input__trailing`,children:f}):null]}),S?T:null]}),S?null:T]})}),Zye=({children:e,className:t,draggable:n,onSetNewOrder:r})=>{let[i,a]=(0,d.useState)([]),[o,s]=(0,d.useState)(null),[c,l]=(0,d.useState)(null),[u,f]=(0,d.useState)(null),p=o===null||c===null?void 0:o<=c?`down`:`up`,m=d.Children.toArray(e);return(0,d.useEffect)(()=>{a(d.Children.map(e,(e,t)=>t)||[])},[e]),(0,d.useEffect)(()=>{if(!u)return;let e=e=>{let t=e.target.closest(`.str-chat__drag-and-drop-container__item`);if(e.dataTransfer&&(e.dataTransfer.effectAllowed=`move`),t instanceof HTMLElement){let n=Array.from(t.parentElement?.children||[]).indexOf(t);s(n),e.dataTransfer?.setData(`text/plain`,n.toString()),t.style.opacity=`0.3`}},t=e=>{e.preventDefault();let t=e.target.closest(`.str-chat__drag-and-drop-container__item`);t instanceof HTMLElement&&l(Array.from(t.parentElement?.children||[]).indexOf(t))},n=()=>{l(null)},i=e=>{e.preventDefault();let t=parseInt(e.dataTransfer?.getData(`text/plain`)||`-1`,10),n=e.target.closest(`.str-chat__drag-and-drop-container__item`);if(n instanceof HTMLElement){let e=Array.from(n.parentElement?.children||[]).indexOf(n);t!==-1&&t!==e&&a(n=>{let i=[...n],[a]=i.splice(t,1);return i.splice(e,0,a),r?.(i),i})}s(null),l(null)},o=e=>{let t=e.target;t instanceof HTMLElement&&(t.style.opacity=``),s(null),l(null)};return u.addEventListener(`dragstart`,e),u.addEventListener(`dragover`,t),u.addEventListener(`dragleave`,n),u.addEventListener(`drop`,i),u.addEventListener(`dragend`,o),()=>{u.removeEventListener(`dragstart`,e),u.removeEventListener(`dragover`,t),u.removeEventListener(`dragleave`,n),u.removeEventListener(`drop`,i),u.removeEventListener(`dragend`,o)}},[u,r]),(0,R.jsx)(`div`,{className:G(`str-chat__drag-and-drop-container`,t),ref:f,children:i.map((e,t)=>{let r=m[e];return(0,R.jsx)(`div`,{className:G(`str-chat__drag-and-drop-container__item`,{"str-chat__drag-and-drop-container__item--dragged-over-from-bottom":p===`up`&&c===t,"str-chat__drag-and-drop-container__item--dragged-over-from-top":p===`down`&&c===t}),draggable:n,children:r},d.isValidElement(r)?r.key:`draggable-item-${e}`)})})},Qye=({children:e,className:t,draggable:n,label:r,onSetNewOrder:i})=>(0,R.jsxs)(`fieldset`,{className:G(`str-chat__form__input-fieldset`,t),children:[(0,R.jsx)(`legend`,{className:`str-chat__form__input-fieldset__label`,children:r}),(0,R.jsx)(Zye,{className:`str-chat__form__input-fieldset__values`,draggable:n,onSetNewOrder:i,children:e})]});function q5(e){let{initialValue:t,onSubmit:n,validators:r={}}=e,[i,a]=(0,d.useState)(t),[o,s]=(0,d.useState)({}),c=(0,d.useCallback)((e,t)=>{a(n=>({...n,[e]:t}));let n=r[e];if(n){let r=n(t);s(t=>{let n={...t};return r?n[e]=r:delete n[e],n})}},[r]);return{fieldErrors:o,handleSubmit:(0,d.useCallback)(e=>{e?.preventDefault();let t={};for(let e of Object.keys(i)){let n=r[e];if(n){let r=n(i[e]);r&&(t[e]=r)}}if(Object.keys(t).length>0){s(t);return}s({}),n(i)},[i,r,n]),setFieldValue:c,setValue:a,value:i}}var $ye=e=>({ownAnswer:e.ownAnswer}),ebe=({messageId:e})=>{let{t}=Y(),{close:n}=h6(),{poll:r}=_6(),{ownAnswer:i}=J(r.state,$ye),[a,o]=(0,d.useState)(null),s=i?.answer_text??``,c=(0,d.useMemo)(()=>({comment:s}),[s]),l=(0,d.useMemo)(()=>({comment:e=>{if(!(typeof e==`string`&&e.trim()))return Error(t(`This field cannot be empty or contain only spaces`))}}),[t]),{fieldErrors:u,handleSubmit:f,setFieldValue:p,value:m}=q5({initialValue:c,onSubmit:(0,d.useCallback)(async t=>{await r.addAnswer(t.comment,e),n()},[r,e,n]),validators:l});(0,d.useEffect)(()=>{a?.focus()},[a]);let h=t(i?`Update your comment`:`Add a comment`),g=t(i?`Update the comment attached to your poll answer`:`Add a comment to your poll answer`),_=!m.comment?.trim()||m.comment===i?.answer_text;return(0,R.jsxs)(W6.Root,{className:`str-chat__modal__poll-add-comment`,children:[h&&(0,R.jsx)(W6.Header,{close:n,description:g,title:h}),(0,R.jsxs)(`form`,{autoComplete:`off`,onSubmit:f,children:[(0,R.jsx)(W6.Body,{children:(0,R.jsx)(K5,{"aria-label":h,error:!!u.comment,errorMessage:u.comment?.message,id:`comment`,name:`comment`,onChange:e=>p(`comment`,e.target.value),placeholder:t(`placeholder/PollComment`),ref:o,required:!0,type:`text`,value:m.comment})}),(0,R.jsx)(W6.Footer,{children:(0,R.jsxs)(W6.FooterControls,{children:[(0,R.jsx)(W6.FooterControlsButtonSecondary,{className:`str-chat__prompt__footer__c
502ontrols-button--cancel`,onClick:n,type:`button`,children:t(`Cancel`)}),(0,R.jsx)(W6.FooterControlsButtonPrimary,{className:`str-chat__prompt__footer__controls-button--submit`,disabled:Object.keys(u).length>0||_,type:`submit`,children:t(s?`Update`:`Send`)})]})})]})]})},tbe=()=>{let{addNotification:e}=GG(),{t}=Y(),{poll:n}=_6(),{close:r}=h6();return(0,R.jsxs)(T6.Root,{className:`str-chat__end-poll-alert`,children:[(0,R.jsx)(T6.Header,{description:t(`Do you want to end this poll now? Nobody will be able to vote in this poll anymore.`),title:t(`End this poll?`)}),(0,R.jsxs)(T6.Actions,{children:[(0,R.jsx)(nH,{appearance:`outline`,className:`str-chat__end-poll-alert__end-vote-button`,"data-testid":`end-poll-alert-end-vote-button`,onClick:async()=>{try{await n.close(),r(),e({emitter:`EndPollAlert`,message:t(`Poll ended`),severity:`success`,type:`api:poll:end:success`})}catch(n){e({emitter:`EndPollAlert`,error:n instanceof Error?n:void 0,message:t(`Failed to end the poll`),severity:`error`,type:`api:poll:end:failed`})}},size:`md`,variant:`danger`,children:t(`End poll`)}),(0,R.jsx)(nH,{appearance:`outline`,className:`str-chat__end-poll-alert__cancel-button`,"data-testid":`end-poll-alert-cancel-button`,onClick:r,size:`md`,variant:`secondary`,children:t(`Cancel`)})]})]})},J5=({buttonText:e,children:t,closeModal:n,isAdditionalAction:r,modalClassName:i,modalIsOpen:a,openModal:o})=>{let{Modal:s=f8}=q();return(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(nH,{appearance:`outline`,className:G(`str-chat__poll-action`,{"str-chat__poll-action--additional":r}),onClick:o,size:`md`,variant:`secondary`,children:e}),(0,R.jsx)(s,{className:i,onClose:n,open:a,children:t})]})},nbe=e=>({options:e.options}),rbe=()=>{let{client:e}=K(),{t}=Y(),{poll:n}=_6(),{close:r}=h6(),{options:i}=J(n.state,nbe),[a,o]=(0,d.useState)(null),s=(0,d.useMemo)(()=>({optionText:``}),[]),c=(0,d.useMemo)(()=>({optionText:e=>{let n=typeof e==`string`?e.trim():``;if(!n)return Error(t(`This field cannot be empty or contain only spaces`));if(i.find(e=>e.text===n))return Error(t(`Option already exists`))}}),[t,i]),{fieldErrors:l,handleSubmit:u,setFieldValue:f,value:p}=q5({initialValue:s,onSubmit:(0,d.useCallback)(async t=>{await e.createPollOption(n.id,{text:t.optionText}),r()},[e,n,r]),validators:c});(0,d.useEffect)(()=>{a?.focus()},[a]);let m=!p.optionText?.trim();return(0,R.jsxs)(W6.Root,{className:`str-chat__modal__suggest-poll-option-prompt`,children:[(0,R.jsx)(W6.Header,{close:r,description:t(`Suggest a new option to add to this poll`),title:t(`Suggest an option`)}),(0,R.jsxs)(`form`,{autoComplete:`off`,onSubmit:u,children:[(0,R.jsx)(W6.Body,{children:(0,R.jsx)(K5,{"aria-label":t(`Suggest an option`),error:!!l.optionText,errorMessage:l.optionText?.message,id:`optionText`,name:`optionText`,onChange:e=>f(`optionText`,e.target.value),placeholder:t(`placeholder/PollOptionSuggestion`),ref:o,required:!0,type:`text`,value:p.optionText})}),(0,R.jsx)(W6.Footer,{children:(0,R.jsxs)(W6.FooterControls,{children:[(0,R.jsx)(W6.FooterControlsButtonSecondary,{className:`str-chat__prompt__footer__controls-button--cancel`,onClick:r,children:t(`Cancel`)}),(0,R.jsx)(W6.FooterControlsButtonPrimary,{className:`str-chat__prompt__footer__controls-button--submit`,disabled:Object.keys(l).length>0||m,type:`submit`,children:t(`Send`)})]})})]})]})},ibe=({timestamp:e})=>{let{t}=Y(),{handleEnter:n,handleLeave:r,tooltipVisible:i}=g8(),[a,o]=(0,d.useState)(null),s=new Date(e);return(0,R.jsxs)(`div`,{className:`str-chat__poll-vote__timestamp`,onMouseEnter:n,onMouseLeave:r,ref:o,children:[t(`timestamp/PollVote`,{timestamp:s}),(0,R.jsx)(h8,{offset:[0,5],placement:`bottom`,referenceElement:a,visible:i,children:t(`timestamp/PollVoteTooltip`,{timestamp:s})})]})},abe=({vote:e})=>{let{t}=Y(),{client:n}=K(),r=n.user?.id&&n.user.id===e.user?.id?t(`You`):e.user?.name||e.user?.id||t(`Anonymous`);return(0,R.jsxs)(`div`,{className:`str-chat__poll-vote__author`,children:[e.user&&(0,R.jsx)(k6,{className:`str-chat__avatar--poll-vote-author`,imageUrl:e.user.image,size:`md`,userName:e.user.name},`poll-vote-${e.id}-avatar-${e.user.id}`),(0,R.jsx)(`div`,{className:`str-chat__poll-vote__author__name`,children:r})]})},Y5=({vote:e})=>(0,R.jsxs)(`div`,{className:`str-chat__poll-vote`,children:[(0,R.jsx)(abe,{vote:e}),(0,R.jsx)(ibe,{timestamp:e.created_at})]}),X5=({votes:e})=>(0,R.jsx)(`div`,{className:`str-chat__poll-vote-listing`,children:e.map(e=>(0,R.jsx)(Y5,{vote:e},`poll-vote-${e.id}`))});function Z5(e,t,n){let{client:r}=K(),[i,a]=(0,d.useState)(t?.getLatestValue().items??[]);return(0,d.useEffect)(()=>t?.subscribeWithSelector(e=>[e.latestPageItems],([e])=>a(t=>[...t,...e])),[t]),(0,d.useEffect)(()=>{let t=t=>{if(!t.poll_vote)return;let r=zC(t.poll_vote);e===`answer`&&!r||e===`vote`&&(r||t.poll_vote.option_id!==n)||(t.type===`poll.vote_removed`&&a(e=>t.poll_vote?e.filter(e=>e.id!==t.poll_vote.id):e),t.type===`poll.vote_changed`&&a(e=>t.poll_vote?e.filter(e=>e.id!==t.poll_vote.id):e),[`poll.vote_casted`,`poll.vote_changed`].includes(t.type)&&a(e=>t.poll_vote?[t.poll_vote,...e]:e))},i=r.on(`poll.vote_casted`,t),o=r.on(`poll.vote_removed`,t),s=r.on(`poll.vote_changed`,t);return()=>{i.unsubscribe(),o.unsubscribe(),s.unsubscribe()}},[r,n,e]),i}var Q5=(e,t)=>{let n=(0,d.useMemo)(()=>new sb({hasNextPage:!0,items:[],latestPageItems:[],loading:!1}),[]),r=(0,d.useCallback)(async()=>{let{loading:t,next:r}=n.getLatestValue();if(!(r===null||t)){n.partialNext({loading:!0});try{let{items:t,next:i}=await e(r);n.next(e=>({...e,hasNextPage:!!i,items:(0,N0.default)(e.items.concat(t),`id`),latestPageItems:t,next:i||null}))}catch(e){n.partialNext({error:e})}n.partialNext({loading:!1})}},[n,e]);return(0,d.useEffect)(()=>{let{items:e}=n.getLatestValue();!t||e.length||r()},[n,t,r]),{cursorPaginatorState:n,loadMore:r}},obe=e=>[e.error,e.hasNextPage,e.loading],sbe=({paginationParams:e}={})=>{let{poll:t}=_6(),{cursorPaginatorState:n,loadMore:r}=Q5((0,d.useCallback)(async n=>{let{next:r,votes:i}=await t.queryAnswers({filter:e?.filter,options:n?{...e?.options,next:n}:e?.options,sort:{created_at:-1,...e?.sort}});return{items:i,next:r}},[e,t]),!0),i=Z5(`answer`,n),[a,o,s]=J(n,obe);return{answers:i,error:a,hasNextPage:o,loading:s,loadMore:r}},cbe=e=>[e.error,e.hasNextPage,e.loading],lbe=({paginationParams:e})=>{let{poll:t}=_6(),{cursorPaginatorState:n,loadMore:r}=Q5((0,d.useCallback)(async n=>{let{next:r,votes:i}=await t.queryOptionVotes({filter:e.filter,options:n?{...e?.options,next:n}:e?.options,sort:{created_at:-1,...e?.sort}});return{items:i,next:r}},[e,t]),!0),i=Z5(`vote`,n,e.filter.option_id),[a,o,s]=J(n,cbe);return{error:a,hasNextPage:o,loading:s,loadMore:r,votes:i}},$5=e=>{e instanceof WheelEvent&&e.deltaY===1&&e.preventDefault()}
502,e7=e=>{let{children:t,className:n,listenToScroll:r,loadNextDebounceMs:i=500,loadNextOnScrollToBottom:a,loadNextOnScrollToTop:o,threshold:s=250,useCapture:c=!1,...l}=e,u=(0,d.useRef)(null),f=(0,d.useRef)(null),p=(0,d.useMemo)(()=>(0,NB.default)(()=>{let e=u.current,t=f.current;if(!e||e.offsetParent===null||!t)return;let n=t.scrollHeight-e.scrollTop-e.clientHeight,i=e.scrollTop;r&&r(n,i,s),i<Number(s)&&o?.(),n<Number(s)&&a?.()},i),[r,i,a,o,s]);return(0,d.useEffect)(()=>{let e=u.current;if(e)return e.addEventListener(`scroll`,p,c),()=>{e.removeEventListener(`scroll`,p,c)}},[p,c]),(0,d.useEffect)(()=>{let e=u.current;if(!e||typeof ResizeObserver>`u`||!p)return;let t=new ResizeObserver(p);return t.observe(e),()=>{t.disconnect()}},[p]),(0,d.useEffect)(()=>{let e=u.current;return e&&e.addEventListener(`wheel`,$5,{passive:!1}),()=>{e&&e.removeEventListener(`wheel`,$5,c)}},[c]),(0,R.jsx)(`div`,{...l,className:G(`str-chat__infinite-scroll-paginator`,n),ref:u,children:(0,R.jsx)(`div`,{className:`str-chat__infinite-scroll-paginator__content`,ref:f,children:t})})},ube=e=>({is_closed:e.is_closed,ownAnswer:e.ownAnswer}),dbe=({onUpdateOwnAnswerClick:e})=>{let{client:t}=K(),{t:n}=Y(),{poll:r}=_6(),{close:i}=h6(),{is_closed:a}=J(r.state,ube),{answers:o,error:s,hasNextPage:c,loading:l,loadMore:u}=sbe();return(0,R.jsxs)(G6.Root,{className:`str-chat__modal__poll-answer-list`,children:[(0,R.jsx)(G6.Header,{close:i,description:n(`Review comments submitted with poll answers`),title:n(`Poll comments`)}),(0,R.jsxs)(G6.Body,{className:`str-chat__modal__poll-answer-list__body`,children:[(0,R.jsx)(`div`,{className:`str-chat__poll-answer-list`,children:(0,R.jsxs)(e7,{loadNextOnScrollToBottom:u,threshold:40,children:[o.map(r=>(0,R.jsxs)(`div`,{className:`str-chat__poll-answer`,children:[(0,R.jsxs)(`div`,{className:`str-chat__poll-answer__data`,children:[r.answer_text&&(0,R.jsx)(`p`,{className:`str-chat__poll-answer__text`,children:r.answer_text}),(0,R.jsx)(Y5,{vote:r},`poll-vote-${r.id}`)]}),!a&&r.user?.id===t.user?.id&&(0,R.jsx)(`div`,{className:`str-chat__poll-vote__update-vote-button-container`,children:(0,R.jsx)(nH,{appearance:`ghost`,className:`str-chat__poll-vote__update-vote-button`,onClick:e,size:`md`,variant:`secondary`,children:n(`Update your comment`)})})]},`comment-${r.id}`)),c&&(0,R.jsx)(`div`,{className:`str-chat__loading-indicator-placeholder`,children:l&&(0,R.jsx)(e8,{})})]})}),s?.message&&(0,R.jsx)(`div`,{children:s?.message})]})]})},fbe=e=>({maxVotedOptionIds:e.maxVotedOptionIds,vote_counts_by_option:e.vote_counts_by_option}),pbe=({optionId:e})=>{let{t}=Y(),{poll:n}=_6(),{maxVotedOptionIds:r,vote_counts_by_option:i}=J(n.state,fbe);return(0,R.jsxs)(`div`,{className:`str-chat__poll-result-option-vote-counter`,children:[r.length===1&&r[0]===e&&(0,R.jsx)(wU,{}),(0,R.jsx)(`span`,{className:`str-chat__poll-result-option-vote-count`,children:t(`{{count}} votes`,{count:i[e]??0})})]})},t7=({option:e,optionOrderNumber:t})=>{let{t:n}=Y();return(0,R.jsxs)(`div`,{className:`str-chat__poll-option__header`,children:[(0,R.jsx)(`div`,{className:`str-chat__poll-option__header__label`,children:n(`Question {{ optionOrderNumber}}`,{optionOrderNumber:t})}),(0,R.jsxs)(`div`,{className:`str-chat__poll-option__header__title`,children:[(0,R.jsx)(`div`,{className:`str-chat__poll-option__option-text`,children:e.text}),(0,R.jsx)(pbe,{optionId:e.id})]})]})},mbe=e=>({latest_votes_by_option:e.latest_votes_by_option}),hbe=({countVotesPreview:e,option:t,orderNumber:n,showAllVotes:r})=>{let{t:i}=Y(),{channelCapabilities:a={}}=KB(`PollOptionWithVotes`),{poll:o}=_6(),{latest_votes_by_option:s}=J(o.state,mbe),c=s&&s[t.id],l=c?.length??0,u=typeof e==`number`;return(0,R.jsxs)(`div`,{className:G(`str-chat__poll-option`,{"str-chat__poll-option--has-more-votes":u&&l>e,"str-chat__poll-option--has-votes":l}),children:[(0,R.jsx)(t7,{option:t,optionOrderNumber:n}),!!c&&(0,R.jsx)(X5,{votes:c.slice(0,e)}),a[`query-poll-votes`]&&r&&u&&c?.length>e&&(0,R.jsx)(`div`,{className:`str-chat__poll-option__show-all-votes-button-container`,children:(0,R.jsx)(nH,{appearance:`ghost`,className:`str-chat__poll-option__show-all-votes-button`,onClick:r,size:`md`,variant:`secondary`,children:i(`View all`)})})]})},n7=({question:e})=>{let{t}=Y();return(0,R.jsxs)(`div`,{className:`str-chat__modal__poll-question`,children:[(0,R.jsx)(`div`,{className:`str-chat__modal__poll-question__label`,children:t(`Question`)}),(0,R.jsx)(`div`,{className:`str-chat__modal__poll-question__text`,children:e})]})},gbe=({option:e,optionOrderNumber:t})=>{let{hasNextPage:n,loading:r,loadMore:i,votes:a}=lbe({paginationParams:(0,d.useMemo)(()=>({filter:{option_id:e.id}}),[e.id])});return(0,R.jsx)(e7,{loadNextOnScrollToBottom:i,threshold:40,children:(0,R.jsx)(`div`,{className:`str-chat_poll-option-with-votes-list`,children:(0,R.jsx)(`div`,{className:`str-chat__poll-option`,children:(0,R.jsxs)(`div`,{className:`str-chat__poll-option__votes-p
502aginated-list`,children:[(0,R.jsx)(t7,{option:e,optionOrderNumber:t}),(0,R.jsx)(X5,{votes:a}),n&&(0,R.jsx)(`div`,{className:`str-chat__loading-indicator-placeholder`,children:r&&(0,R.jsx)(e8,{})})]})})})})},_be=({name:e,options:t,vote_count:n,vote_counts_by_option:r})=>({name:e,options:[...t],vote_count:n,vote_counts_by_option:r}),vbe=()=>{let{t:e}=Y(),{poll:t}=_6(),{close:n}=h6(),{name:r,options:i,vote_count:a,vote_counts_by_option:o}=J(t.state,_be),[s,c]=(0,d.useState)(null),l=(0,d.useCallback)(()=>c(null),[]);return(0,R.jsx)(G6.Root,{className:G(`str-chat__modal__poll-results`,{"str-chat__modal__poll-results--option-detail":s}),children:s?.option?(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(G6.Header,{close:n,description:e(`Review who voted for this option`),goBack:l,title:e(`Votes`)}),(0,R.jsx)(G6.Body,{className:`str-chat__modal__poll-results__body`,children:(0,R.jsx)(gbe,{option:s?.option,optionOrderNumber:s?.optionOrderNumber})})]}):(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(G6.Header,{close:n,description:e(`Review poll results and open an option to see detailed votes`),title:e(`Poll results`)}),(0,R.jsxs)(G6.Body,{className:`str-chat__modal__poll-results__body`,children:[(0,R.jsx)(n7,{question:r}),(0,R.jsxs)(`div`,{className:`str-chat__modal__poll-results__options`,children:[(0,R.jsx)(`div`,{className:`str-chat__modal__poll-results__option-list`,children:i.sort((e,t)=>(o[t.id]??0)>=(o[e.id]??0)?1:-1).map((e,t)=>{let n=t+1;return(0,R.jsx)(hbe,{countVotesPreview:5,option:e,orderNumber:n,showAllVotes:()=>c({option:e,optionOrderNumber:n})},`poll-option-${e.id}`)})}),(0,R.jsx)(`div`,{className:`str-chat__modal__poll-results__options__footer`,children:(0,R.jsx)(`div`,{className:`str-chat__modal__poll-results__options-total-count`,children:e(`totalVoteCount`,{count:a})})})]})]})]})})},r7=`str-chat__poll-action-modal`,ybe=e=>({allow_answers:e.allow_answers,allow_user_suggested_options:e.allow_user_suggested_options,answers_count:e.answers_count,created_by_id:e.created_by_id,is_closed:e.is_closed,options:e.options,ownAnswer:e.ownAnswer,voteCount:e.vote_count}),bbe=({AddCommentPrompt:e=ebe,EndPollAlert:t=tbe,PollAnswerList:n=dbe,PollResults:r=vbe,SuggestPollOptionForm:i=rbe})=>{let{client:a}=K(),{t:o}=Y(`PollActions`),{channelCapabilities:s={}}=KB(`PollActions`),{message:c}=o6(`PollActions`),{poll:l}=_6(),{allow_answers:u,allow_user_suggested_options:f,answers_count:p,created_by_id:m,is_closed:h,options:g,ownAnswer:_,voteCount:v}=J(l.state,ybe),[y,b]=(0,d.useState)(),x=s[`cast-poll-vote`]&&!h,S=(0,d.useCallback)(()=>b(void 0),[]),C=(0,d.useCallback)(()=>b(`add-comment`),[]);return!h&&m===a.user?.id||v||x&&f&&g.length<100||!h&&u||p>0&&s[`query-poll-votes`]?(0,R.jsxs)(`div`,{className:`str-chat__poll-actions`,children:[!h&&m===a.user?.id&&(0,R.jsx)(J5,{buttonText:o(`End poll`),closeModal:S,modalClassName:G(r7,`str-chat__end-poll-modal`),modalIsOpen:y===`end-vote`,openModal:()=>b(`end-vote`),children:(0,R.jsx)(t,{})}),!!v&&(0,R.jsx)(J5,{buttonText:o(`View results`),closeModal:S,modalClassName:G(r7,`str-chat__poll-results-modal`),modalIsOpen:y===`view-results`,openModal:()=>b(`view-results`),children:(0,R.jsx)(r,{})}),x&&f&&g.length<100&&(0,R.jsx)(J5,{buttonText:o(`Suggest an option`),closeModal:S,isAdditionalAction:!0,modalClassName:G(r7,`str-chat__suggest-poll-option-modal`),modalIsOpen:y===`suggest-option`,openModal:()=>b(`suggest-option`),children:(0,R.jsx)(i,{})}),!h&&u&&(0,R.jsx)(J5,{buttonText:o(_?`Update your comment`:`Add a comment`),closeModal:S,isAdditionalAction:!0,modalClassName:G(r7,`str-chat__add-poll-answer-modal`),modalIsOpen:y===`add-comment`,openModal:()=>b(`add-comment`),children:(0,R.jsx)(e,{messageId:c.id})}),p>0&&s[`query-poll-votes`]&&(0,R.jsx)(J5,{buttonText:o(`View {{count}} comments`,{count:p}),closeModal:S,isAdditionalAction:!0,modalClassName:G(r7,`str-chat__poll-answer-list-modal`),modalIsOpen:y===`view-comments`,openModal:()=>b(`view-comments`),children:(0,R.jsx)(n,{onUpdateOwnAnswerClick:C})})]}):null},xbe=({amount:e,className:t})=>(0,R.jsx)(`div`,{"aria-hidden":`true`,className:G(`str-chat__amount-bar`,t),"data-testid":`amount-bar`,style:{"--str-chat__amount-bar-fulfillment":e+`%`}}),Sbe=({checked:e})=>(0,R.jsx)(`div`,{className:G(`str-chat__checkmark`,{"str-chat__checkmark--checked":e})}),Cbe=e=>({is_closed:e.is_closed,latest_votes_by_option:e.latest_votes_by_option,maxVotedOptionIds:e.maxVotedOptionIds,ownVotesByOptionId:e.ownVotesByOptionId,vote_counts_by_option:e.vote_counts_by_option,voting_visibility:e.voting_visibility}),wbe=({displayAvatarCount:e,option:t,voteCountVerbose:n})=>{let{t:r}=Y(),{channelCapabilities:i={}}=KB(`PollOptionsShortlist`),{message:a}=o6(),{AvatarStack:o=j6}=q(),{poll:s}=_6(),{is_closed:c,latest_votes_by_option:l,maxVotedOptionIds:u,ownVotesByOptionId:f,vote_counts_by_option:p,voting_visibility:m}=J(s.state,Cbe),h=i[`cast-poll-vote`]&&!c,g=!!h,_=!!f[t.id],v=u[0]?p[u[0]]:0,y=(0,d.useMemo)(()=>(0,NB.default)(()=>
502{if(h)return f[t.id]?s.removeVote(f[t.id].id,a.id):s.castVote(t.id,a.id)},100),[h,a.id,t.id,f,s]),b=(0,d.useMemo)(()=>l?.[t.id]&&l[t.id].filter(e=>!!e.user&&!zC(e)).slice(0,e).map(({user:e})=>({id:e.id,imageUrl:e.image,userName:e.name})),[e,l,t.id]);return(0,R.jsxs)(`div`,{"aria-pressed":g?_:void 0,className:G(`str-chat__poll-option`,{"str-chat__poll-option--votable":h}),onClick:g?y:void 0,onKeyDown:g?e=>{e.key!==`Enter`&&e.key!==` `||(e.preventDefault(),y())}:void 0,role:g?`button`:void 0,tabIndex:g?0:void 0,children:[h&&(0,R.jsx)(Sbe,{checked:_}),(0,R.jsxs)(`div`,{className:`str-chat__poll-option-data`,children:[(0,R.jsx)(`p`,{className:`str-chat__poll-option-text`,children:t.text}),(0,R.jsxs)(`div`,{className:`str-chat__poll-option-votes`,children:[e&&m===`public`&&(0,R.jsx)(`div`,{className:`str-chat__poll-option-voters`,children:(0,R.jsx)(o,{displayInfo:b,size:`xs`})}),(0,R.jsx)(`div`,{className:`str-chat__poll-option-vote-count`,children:n?r(`{{count}} votes`,{count:p[t.id]??0}):p[t.id]??0})]})]}),(0,R.jsx)(xbe,{amount:(v&&(p[t.id]??0)/v)*100,className:G(`str-chat__poll-option__votes-bar`,{"str-chat__poll-option__votes-bar--winner":c&&u.length===1&&u[0]===t.id})})]},`base-poll-option-${t.id}`)},Tbe=e=>({options:e.options}),i7=({optionsDisplayCount:e,PollOptionsFullList:t=Dbe})=>{let{PollOptionSelector:n=wbe}=q(),{t:r}=Y(`PollOptionList`),{poll:i}=_6(),{options:a}=J(i.state,Tbe),[o,s]=(0,d.useState)(!1),c=(0,d.useCallback)(()=>s(!1),[]),l=(0,d.useCallback)(()=>s(!0),[]),u=typeof e==`number`&&a.length>e;return(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(`div`,{className:G(`str-chat__poll-option-list`,{"str-chat__poll-option-list--full":e===void 0}),children:a.slice(0,e??a.length).map(e=>(0,R.jsx)(n,{displayAvatarCount:3,option:e},`poll-option-${e.id}`))}),u&&(0,R.jsx)(J5,{buttonText:r(`+{{count}} more options`,{count:a.length}),closeModal:c,isAdditionalAction:!0,modalClassName:`str-chat__poll-action-modal`,modalIsOpen:o,openModal:l,children:(0,R.jsx)(t,{})})]})},Ebe=e=>({name:e.name}),Dbe=()=>{let{t:e}=Y(),{poll:t}=_6(),{close:n}=h6(),{name:r}=J(t.state,Ebe);return(0,R.jsxs)(G6.Root,{className:`str-chat__modal__poll-option-list`,children:[(0,R.jsx)(G6.Header,{close:n,description:e(`Review all options available in this poll`),title:e(`Poll options`)}),(0,R.jsxs)(G6.Body,{className:`str-chat__modal__poll-option-list__body`,children:[(0,R.jsx)(n7,{question:r}),(0,R.jsx)(i7,{})]})]})},Obe=e=>({is_closed:e.is_closed}),kbe=()=>{let{PollActions:e=bbe,PollHeader:t=Jye}=q(),{poll:n}=_6(),{is_closed:r}=J(n.state,Obe);return(0,R.jsxs)(`div`,{className:G(`str-chat__poll`,{"str-chat__poll--closed":r}),children:[(0,R.jsx)(t,{}),(0,R.jsx)(i7,{optionsDisplayCount:5}),(0,R.jsx)(e,{})]})},Abe=({poll:e})=>{let{PollContent:t=kbe}=q();return e?(0,R.jsx)($me,{poll:e,children:(0,R.jsx)(t,{})}):null},jbe=e=>({enforce_unique_vote:e.data.enforce_unique_vote,error:e.errors.max_votes_allowed,max_votes_allowed:e.data.max_votes_allowed}),Mbe=()=>{let{t:e}=Y(),{pollComposer:t}=IW(),{enforce_unique_vote:n,error:r,max_votes_allowed:i}=J(t.state,jbe),[a,o]=(0,d.useState)(!1),s=(0,d.useRef)(null),c=(0,d.useMemo)(()=>({"Enforce unique vote is enabled":e(`Enforce unique vote is enabled`),"Type a number from 2 to 10":e(`Type a number from 2 to 10`)}),[e]),l=!n,u=r&&c[r],f=`max_votes_allowed_enabled`,p=`${f}-label`;return(0,R.jsxs)(`div`,{className:G(`str-chat__form__switch-fieldset`,{}),children:[(0,R.jsx)(V5,{checked:l,description:e(`Select more than one option`),id:`enforce_unique_vote`,onChange:e=>{o(!1),t.updateFields({enforce_unique_vote:!e.target.checked})},title:e(`Multiple votes`)}),l&&(0,R.jsx)(V5,{"aria-labelledby":p,checked:a,fieldClassName:`str-chat__multiple-answers-field__votes-limit-field`,id:f,onChange:e=>{let n=e.target.checked;o(n),t.updateFields({max_votes_allowed:`2`}),n&&requestAnimationFrame(()=>{s.current?.focus()})},children:(0,R.jsxs)(`div`,{className:`str-chat__multiple-answers-field__votes-limit-field__numeric-field`,children:[(0,R.jsx)(H5,{asError:!!u,description:e(`Choose between 2 to 10 options`),htmlFor:f,id:p,title:e(`Limit votes per person`)}),a&&(0,R.jsx)(Xye,{"aria-label":e(`Maximum votes per person`),id:`max_votes_allowed`,max:10,min:2,onBlur:()=>{t.handleFieldBlur(`max_votes_allowed`)},onChange:n=>{let r=n.target.value,i=r!==``&&!/^\d+$/.test(r)?{max_votes_allowed:e(`Only numbers are allowed`)}:void 0;t.updateFields({max_votes_allowed:i?t.max_votes_allowed:r},i)},ref:s,value:i??``})]})})]})},Nbe=e=>({error:e.errors.name,name:e.data.name}),Pbe=()=>{let{t:e}=Y(),{pollComposer:t}=IW(),{dialogId:n}=h6(),{descriptionId:r}=w6(n),{error:i,name:a}=J(t.state,Nbe),o=(0,d.useMemo)(()=>({"Question is required":e(`Question is required`)}),[e]);return(0,R.jsx)(K5,{"aria-describedby":r,className:`str-chat__form__input-field__value`,error:!!i,errorMessage:i?(0,R.jsx)(`span`,{"data-testid":`poll-name-input-field-error`,children:o[i]??e(`Error`)}):void 0,id:`name`,label:e(`Question`),onBlur:()=>{t.handleFieldBlur(`name`)},onChange:e=>{t.updateFields({name:e.target.value})},placeholder:e(`Ask a question`),type:`text`,value:a})},Fbe=e=>({errors:e.errors.options,options:e.data.options}),Ibe=()=>{let{pollComposer:e}=IW(),{errors:t,options:n}=J(e.state,Fbe),{t:r}=Y(`OptionFieldSet`),i=(0,d.useMemo)(()=>({"Option already exists":r(`Option already exists`),"Option is empty":r(`Option is empty`)}),[r]),a=(0,d.useCallback)(t=>{let n=e.options;e.updateFields({options:t.map(e=>n[e])})},[e]),o=(0,d.useCallback)(t=>{e.updateFields({options:e.options.filter(e=>e.id!==t)})},[e]),s=n.length>1;return(0,R.jsx)(Qye,{draggable:s,label:r(`Options`),onSetNewOrder:a,children:n.map((a,c)=>{let l=t?.[a.id];return(0,R.jsx)(`div`,{className:G(`str-chat__form__input-field`,{"str-chat__form__input-field--draggable":s,"str-chat__form__input-field--has-error":l}),children:(0,R.jsx)(K5,{className:`str-chat__form__input-field__value`,error:!!l,fieldMessagePlacement:`inside`,id:a.id,leading:s?(0,R.jsx)(VH,{className:`str-chat__drag-handle`}):void 0,message:l?(0,R.jsx)(`span`,{"data-testid":`poll-option-input-field-error`,children:i[l]??r(`Error`)}):void 0,onBlur:()=>{e.handleFieldBlur(`options`)},onChange:t=>{e.updateFields({options:{index:c,text:t.target.value}})},onKeyUp:e=>{let t=c===n.length-1;if(e.key===`Enter`&&!t){let e=n[c+1].id;document.getElementById(e)?.focus()}},placeholder:r(`Add an option`),trailing:a.text?(0,R.jsx)(Lbe,{"aria-label":r(`aria/Remove option`),onClick:()=>o(a.id)}):void 0,type:`text`,value:a.text})},`new-poll-option-${c}`)})})},Lbe=({className:e,...t})=>(0,R.jsx)(nH,{appearance:`ghost`,circular:!0,className:G(`str-chat__form__remove-option-button`,e),size:`xs`,variant:`secondary`,...t,children:(0,R.jsx)(NH,{})}),Rbe=({close:e})=>{let{t}=Y(`PollCreationDialogControls`),{handleSubmit:n}=EV(),r=IW(),i=zve();return(0,R.jsx)(W6.Footer,{children:(0,R.jsxs)(W6.FooterControls,{children:[(0,R.jsx)(W6.FooterControlsButtonSecondary,{className:G(`str-chat__prompt__footer__c
502ontrols-button--cancel`),onClick:()=>{r.pollComposer.initState(),e()},type:`button`,children:t(`Cancel`)}),(0,R.jsxs)(W6.FooterControlsButtonPrimary,{className:G(`str-chat__prompt__footer__controls-button--submit`),disabled:!i,onClick:()=>{r.createPoll().then(()=>n()).then(()=>{r.pollComposer.initState(),e()}).catch(console.error)},type:`submit`,children:[(0,R.jsx)(cU,{}),t(`Send poll`)]})]})})},zbe=e=>({allow_answers:e.data.allow_answers,allow_user_suggested_options:e.data.allow_user_suggested_options,voting_visibility:e.data.voting_visibility}),Bbe=({close:e})=>{let{t}=Y(),{pollComposer:n}=IW(),{allow_answers:r,allow_user_suggested_options:i,voting_visibility:a}=J(n.state,zbe),o=(0,d.useCallback)(()=>{n.initState(),e()},[n,e]);return(0,R.jsxs)(W6.Root,{className:`str-chat__poll-creation-dialog`,"data-testid":`poll-creation-dialog`,children:[(0,R.jsx)(W6.Header,{close:o,description:t(`Create a question, add options, and configure poll settings`),title:t(`Create poll`)}),(0,R.jsx)(W6.Body,{children:(0,R.jsxs)(`form`,{autoComplete:`off`,children:[(0,R.jsx)(Pbe,{}),(0,R.jsx)(Ibe,{}),(0,R.jsxs)(`div`,{className:`str-chat__poll-creation-dialog__features-selectors`,children:[(0,R.jsx)(Mbe,{}),(0,R.jsx)(V5,{checked:a===`anonymous`,description:t(`Hide who voted`),id:`voting_visibility`,onChange:e=>n.updateFields({voting_visibility:e.target.checked?gS.anonymous:gS.public}),title:t(`Anonymous poll`)}),(0,R.jsx)(V5,{checked:i,description:t(`Let others add options`),id:`allow_user_suggested_options`,onChange:e=>n.updateFields({allow_user_suggested_options:e.target.checked}),title:t(`Suggest an option`)}),(0,R.jsx)(V5,{checked:r,description:t(`Allow others to add comments`),id:`allow_answers`,onChange:e=>n.updateFields({allow_answers:e.target.checked}),title:t(`Add a comment`)})]})]})}),(0,R.jsx)(Rbe,{close:e})]})},Vbe={ban:mU,flag:tU,giphy:jU,mute:sU,unban:fU,unmute:OU},a7=`str-chat__context-menu--commands`,Hbe=()=>{let{t:e}=Y(),{returnToParentMenu:t}=H6();return(0,R.jsx)(I6,{className:`str-chat__context-menu__header--commands str-chat__context-menu__header--submenu-commands`,children:(0,R.jsxs)(F6,{onClick:t,children:[(0,R.jsx)(AH,{}),(0,R.jsx)(`span`,{children:e(`Instant commands`)})]})})},Ube=()=>{let{t:e}=Y();return(0,R.jsx)(I6,{className:`str-chat__context-menu__header--commands`,children:(0,R.jsx)(`span`,{children:e(`Instant commands`)})})},Wbe=()=>{let{closeMenu:e}=H6(),t=IW(),{textareaRef:n}=EV(),r=F5();return(0,R.jsx)(R.Fragment,{children:(0,d.useMemo)(()=>[...r].sort((e,t)=>(e.command.name??``).localeCompare(t.command.name??``)),[r]).map(({command:r,enabled:i})=>(0,R.jsx)(o7,{command:r,enabled:i,onClick:()=>{!r.name||!i||(t.textComposer.setCommand(r),e(),requestAnimationFrame(()=>n.current?.focus()))}},r.name))})},Gbe=e=>{let{t}=Y(),n=(0,d.useMemo)(()=>({ban:t(`ban-command-args`),giphy:t(`giphy-command-args`),mute:t(`mute-command-args`),unban:t(`unban-command-args`),unmute:t(`unmute-command-args`)}),[t]),r=(0,d.useMemo)(()=>({ban:t(`ban-command-description`),giphy:t(`giphy-command-description`),mute:t(`mute-command-description`),unban:t(`unban-command-description`),unmute:t(`unmute-command-description`)}),[t]);return{args:e.args&&(n[e.name??``]??t(e.args)),description:e.description&&(r[e.name??``]??t(e.description))}},o7=({className:e,command:t,enabled:n=!0,...r})=>{let{args:i,description:a}=Gbe(t),o=(0,d.useMemo)(()=>i?`/${t.name} ${i}`:`/${t.name}`,[i,t.name]);return(0,d.createElement)(P6,{...r,className:G(`str-chat__context-menu__button--command`,e),details:o,disabled:!n,Icon:Vbe[t.name],key:t.name,label:t.name,title:`${a} ${t.args}`})},Kbe=({className:e})=>{let{AttachmentSelectorInitiationButtonContents:t}=q();return t?(0,R.jsx)(`span`,{className:e,children:(0,R.jsx)(t,{})}):(0,R.jsx)(_U,{className:G(`str-chat__attachment-selector__menu-button__icon`,e)})},s7=(0,d.forwardRef)(function({className:e,iconClassName:t,...n},r){return(0,R.jsx)(nH,{appearance:`outline`,circular:!0,className:G(`str-chat__attachment-selector__menu-button`,e),"data-testid":`invoke-attachment-selector-button`,size:`lg`,variant:`secondary`,...n,ref:r,children:(0,R.jsx)(Kbe,{className:t})})}),c7=()=>{let{channelCapabilities:e}=KB(),{t}=Y(),n=(0,d.useRef)(null),[r,i]=(0,d.useState)(null),a=PU(),o=PW();return(0,d.useEffect)(()=>
502{if(!r)return;let e=e=>{![` `,`Enter`].includes(e.key)||!n.current||(e.preventDefault(),n.current.click())};return r.addEventListener(`keyup`,e),()=>{r.removeEventListener(`keyup`,e)}},[r]),e[`upload-file`]?(0,R.jsxs)(`div`,{className:`str-chat__attachment-selector`,children:[(0,R.jsx)(s7,{"aria-label":t(`aria/Open Attachment Selector`),disabled:o,onClick:()=>n.current?.click(),ref:i}),(0,R.jsx)(x5,{id:a,ref:n})]}):null},l7={Command({submenuHeader:e,submenuItems:t}){let{t:n}=Y(),{openSubmenu:r}=H6(),i=F5().some(({enabled:e})=>e),a=!!t;return(0,R.jsx)(P6,{className:`str-chat__attachment-selector-actions-menu__button str-chat__attachment-selector-actions-menu__commands-button`,disabled:!i,hasSubMenu:a,Icon:yU,onClick:n=>{a&&r({focusReturnTarget:n.currentTarget,Header:e,menuClassName:a7,Submenu:t})},children:n(`Commands`)})},File(){let{t:e}=Y(),{fileInput:t}=Ume(),{closeMenu:n}=H6();return(0,R.jsx)(P6,{className:`str-chat__attachment-selector-actions-menu__button str-chat__attachment-selector-actions-menu__upload-file-button`,Icon:lU,onClick:()=>{t?.click(),n()},children:e(`File`)})},Location({openModalForAction:e}){let{t}=Y(),{closeMenu:n}=H6();return(0,R.jsx)(P6,{className:`str-chat__attachment-selector-actions-menu__button str-chat__attachment-selector-actions-menu__add-location-button`,Icon:iU,onClick:()=>{e(`addLocation`),n()},children:t(`Location`)})},Poll({openModalForAction:e}){let{t}=Y(),{closeMenu:n}=H6();return(0,R.jsx)(P6,{className:`str-chat__attachment-selector-actions-menu__button str-chat__attachment-selector-actions-menu__create-poll-button`,Icon:EH,onClick:()=>{e(`createPoll`),n()},children:t(`Poll`)})}},qbe=[{ActionButton:l7.File,type:`uploadFile`},{ActionButton:l7.Poll,type:`createPoll`},{ActionButton:l7.Location,type:`addLocation`},{ActionButton:l7.Command,Header:Hbe,Submenu:Wbe,type:`selectCommand`}],Jbe=e=>{let{PollCreationDialog:t=Bbe,ShareLocationDialog:n=Gye}=q(),{channelCapabilities:r}=KB(),{isUploadEnabled:i}=v5(),a=IW(),o=a.channel.getConfig();return(0,d.useMemo)(()=>e.filter(e=>e.type===`uploadFile`?r[`upload-file`]&&o?.uploads&&i:e.type===`createPoll`?r[`send-poll`]&&!a.threadId&&o?.polls:e.type===`addLocation`?o?.shared_locations&&!a.threadId:e.type===`selectCommand`?!!o?.commands?.some(e=>!!e.name):!0).map(e=>e.type===`createPoll`&&!e.ModalContent?{...e,ModalContent:t}:e.type===`addLocation`&&!e.ModalContent?{...e,ModalContent:n}:e),[t,n,r,o,i,a.threadId,e])},Ybe=({attachmentSelectorActionSet:e=qbe,getModalPortalDestination:t})=>{let{t:n}=Y(),{ContextMenu:r=U6,Modal:i=f8}=q(),{channelCapabilities:a}=KB(),o=IW(),s=PW(),c=Jbe(e),l=`attachment-actions-menu${o.threadId?`-thread`:``}`,{dialog:u,dialogManager:f}=$B({id:l}),p=nV(l,f?.id),[m,h]=(0,d.useState)(),g=(0,d.useRef)(!1),_=(0,d.useCallback)(e=>{let t=c.find(t=>t.type===e);t?.ModalContent&&h(t)},[c]),v=(0,d.useCallback)(()=>{g.current=!0,h(void 0)},[]),[y,b]=(0,d.useState)(null),x=(0,d.useRef)(null);(0,d.useEffect)(()=>{if(m||!g.current)return;let e=requestAnimationFrame(()=>{x.current?.focus(),g.current=!1});return()=>cancelAnimationFrame(e)},[m]);let S=(0,d.useMemo)(()=>c.map(e=>(0,R.jsx)(e.ActionButton,{openModalForAction:_,submenuHeader:e.Header,submenuItems:e.Submenu},e.type)),[c,_]),C=(0,d.useCallback)(()=>document.getElementById(JU),[]);if(c.length===0)return null;if(c.length===1&&c[0].type===`uploadFile`)return(0,R.jsx)(c7,{});let w=m?.ModalContent,T=!!w;return(0,R.jsx)(Hme,{value:{fileInput:y},children:(0,R.jsxs)(`div`,{className:`str-chat__attachment-selector`,children:[a[`upload-file`]&&(0,R.jsx)(x5,{ref:b}),(0,R.jsx)(s7,{"aria-expanded":p,"aria-haspopup":`true`,"aria-label":n(`aria/Open Attachment Selector`),disabled:s,iconClassName:G(`str-chat__prepare-rotate45`,{"str-chat__rotate45":p}),onClick:()=>u?.toggle(),ref:x}),(0,R.jsx)(r,{allowFlip:!0,"aria-label":n(`aria/Attachment Actions`),backLabel:n(`Back`),className:`str-chat__attachment-selector-actions-menu`,"data-testid":`attachment-selector-actions-menu`,dialogManagerId:f?.id,id:l,onClose:u.close,placement:`top-start`,referenceElement:x.current,tabIndex:-1,trapFocus:!0,children:S}),(0,R.jsx)(cV,{getPortalDestination:t??C,isOpen:T,children:(0,R.jsx)(i,{className:G({"str-chat__create-poll-modal":m?.type===`createPoll`,"str-chat__share-location-modal":m?.type===`addLocation`}),onClose:v,open:T,children:w&&(0,R.jsx)(w,{close:v})})})]})})},Xbe=({attachment:e,removeAttachments:t})=>{let{t:n}=Y(),{id:r}=e.localMetadata??{};return(0,R.jsxs)(`div`,{className:`str-chat__attachment-preview-unsupported`,"data-testid":`attachment-preview-unsupported`,children:[(0,R.jsx)(QH,{}),(0,R.jsx)(`div`,{className:`str-chat__attachment-preview-unsupported__metadata`,children:(0,R.jsx)(`div`,{className:`str-chat__attachment-preview-unsupported__title`,"data-testid":`unsupported-attachment-preview-title`,children:n(`Unsupported attachment`)})}),(0,R.jsx)(I5,{"data-testid":`file-preview-item-delete-button`,onClick:()=>{r&&t([r])}})]})};function Zbe(e){let t=e.localMetadata?.file?.size;if(typeof t==`number`&&Number.isFinite(t)&&t>=0)return t;let n=e.file_size;
502if(typeof n==`number`&&Number.isFinite(n)&&n>=0)return n;if(typeof n==`string`){let e=parseFloat(n);if(Number.isFinite(e)&&e>=0)return e}}var u7=({attachment:e})=>{let{FileSizeIndicator:t=i8,UploadedSizeIndicator:n=Jhe}=q(),{uploadProgress:r,uploadState:i}=e.localMetadata??{},a=Zbe(e),o=r!==void 0&&a!==void 0?Math.round(r/100*a):void 0;return i===`uploading`&&o!==void 0&&a!==void 0?(0,R.jsx)(n,{fullBytes:a,uploadedBytes:o}):i===`finished`?(0,R.jsx)(t,{fileSize:e.file_size}):null},Qbe=`button, a, input, textarea, select, [role="button"], [role="link"], [data-interactive="true"]`;function $be(e,t){if(!(e instanceof Element)||!t)return!1;let n=e;for(;n&&n!==t;){if(n.matches(Qbe))return!0;n=n.parentElement}return!1}var d7=({attachment:e,onPressed:t,openPreview:n,tabIndex:r=0,...i})=>{let{t:a}=Y(),[o,s]=(0,d.useState)(null),c=e.asset_url||e.image_url||e.localMetadata.previewUri,l=!!n&&(!!c&&mb(e)||yb(e)),u=e=>{if(!e.defaultPrevented&&!$be(e.target,o)&&!(t&&!t(e))&&l){n();return}},f=l||!1;return(0,R.jsx)(`div`,{"aria-label":f?a(l?`aria/Show preview`:`aria/Download attachment`):void 0,...i,onClick:u,onKeyDown:f?e=>{e.key!==`Enter`&&e.key!==` `||(u(e),e.preventDefault())}:void 0,ref:s,role:f?`button`:void 0,tabIndex:f?r:-1,children:i.children})},f7=({attachment:e,handleRetry:t,removeAttachments:n})=>{let{t:r}=Y(`FilePreview`),{id:i,uploadPermissionCheck:a,uploadProgress:o,uploadState:s}=e.localMetadata??{},c=a?.reason===`size_limit`,l=s===`blocked`||c,u=s===`failed`&&!!t;return(0,R.jsxs)(d7,{attachment:e,className:`str-chat__attachment-preview-file`,"data-testid":`attachment-preview-file`,children:[(0,R.jsx)(`div`,{className:`str-chat__attachment-preview-file__icon`,children:(0,R.jsx)(B8,{fileName:e.title,mimeType:e.mime_type})}),(0,R.jsxs)(`div`,{className:`str-chat__attachment-preview-file__info`,children:[(0,R.jsx)(`div`,{className:`str-chat__attachment-preview-file-name`,title:e.title,children:e.title}),(0,R.jsxs)(`div`,{className:`str-chat__attachment-preview-file__data`,children:[s===`uploading`&&(0,R.jsx)(r8,{uploadProgress:o}),(0,R.jsx)(u7,{attachment:e}),l&&(0,R.jsxs)(`div`,{className:`str-chat__attachment-preview-file__fatal-error`,children:[(0,R.jsx)(YH,{}),(0,R.jsx)(`span`,{children:r(c?`File too large`:s===`blocked`?`Upload blocked`:`Upload failed`)})]}),u&&(0,R.jsxs)(`div`,{className:`str-chat__attachment-preview-file__retriable-error`,children:[(0,R.jsx)(XH,{}),(0,R.jsx)(`span`,{children:r(`Upload error`)}),(0,R.jsx)(`button`,{"aria-label":r(`aria/Retry upload`),className:`str-chat__attachment-preview-file__retry-upload-button`,"data-testid":`file-preview-item-retry-button`,onClick:()=>{t(e)},type:`button`,children:r(`Retry upload`)})]})]})]}),(0,R.jsx)(I5,{"data-testid":`file-preview-item-delete-button`,onClick:()=>{i&&n([i])},uploadState:s})]})},exe=e=>({canPlayRecord:e.canPlayRecord,isPlaying:e.isPlaying,playbackRate:e.currentPlaybackRate,progressPercent:e.progressPercent,secondsElapsed:e.secondsElapsed}),txe=({attachment:e,handleRetry:t,removeAttachments:n})=>{let{t:r}=Y(),{id:i,previewUri:a,uploadPermissionCheck:o,uploadProgress:s,uploadState:c}=e.localMetadata??{},l=e.asset_url||a,u=MW({fileSize:e.localMetadata.file?.size??e.file_size,mimeType:e.localMetadata.file?.type??e.mime_type,requester:e.localMetadata.id,src:l,title:e.title,waveformData:e.waveform_data});(0,d.useEffect)(()=>(u?.cancelScheduledRemoval(),()=>{u?.scheduleRemoval()}),[u]);let{canPlayRecord:f,isPlaying:p,playbackRate:m,progressPercent:h,secondsElapsed:g}=J(u?.state,exe)??{},_=u?.durationSeconds??e.duration,v=!!u?.waveformData?.length,y=o?.reason===`size_limit`,b=c===`blocked`||y,x=c===`failed`&&!!t||b,S=!x||x&&p;return(0,R.jsxs)(d7,{attachment:e,className:G(`str-chat__attachment-preview-audio`),"data-testid":`attachment-preview-audio`,children:[(0,R.jsx)(O6,{isPlaying:!!p,onClick:()=>{u?.togglePlay()}}),(0,R.jsxs)(`div`,{className:`str-chat__attachment-preview-file__info`,children:[(0,R.jsx)(`div`,{className:`str-chat__attachment-preview-file-name`,title:e.title,children:_b(e)?r(`Voice message`):e.title}),(0,R.jsxs)(`div`,{className:`str-chat__attachment-preview-file__data`,children:[c===`uploading`&&(0,R.jsx)(r8,{uploadProgress:s}),S?(0,R.jsxs)(R.Fragment,{children:[!_&&!h&&!p&&(0,R.jsx)(u7,{attachment:e}),v?(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(H8,{duration:_,isPlaying:!!p,secondsElapsed:g,showRemaining:!0}),(0,R.jsx)(n5,{durationSeconds:_,progress:h,relativeAmplitudeBarWidth:1,relativeAmplitudeGap:1,secondsElapsed:g,seek:u.seek,waveformData:u.waveformData})]}):(0,R.jsx)(H8,{duration:_,isPlaying:!!p,secondsElapsed:g})]}):b?(0,R.jsxs)(`div`,{className:`str-chat__attachment-preview-file__fatal-error`,children:[(0,R.jsx)(YH,{}),(0,R.jsx)(`span`,{children:r(y?`File too large`:c===`blocked`?`Upload blocked`:`Upload failed`)})]}):(0,R.jsxs)(`div`,{className:`str-chat__attachment-preview-file__retriable-error`,children:[(0,R.jsx)(XH,{}),(0,R.jsx)(`span`,{children:r(`Upload error`)}),(0,R.jsx)(`button`,{"aria-label":r(`aria/Retry upload`),className:`str-chat__attachment-preview-file__retry-upload-button`,"data-testid":`file-preview-item-retry-button`,onClick:()=>{t(e)},type:`button`,children:r(`Retry upload`)})]})]})]}),u&&f&&(0,R.jsxs)(U8,{"aria-label":r(`Playback speed {{ rate }}x`,{rate:m?.toString()??`1`}),onClick:u.increasePlaybackRate,children:[`x`,m?.toString()]}),(0,R.jsx)(I5,{"data-testid":`audio-preview-item-delete-button`,onClick:()=>{i&&n([i])},uploadState:c})]})},nxe={video:DU,voiceRecording:oU},rxe=({attachment:e,variant:t})=>{let n=nxe[t];return(0,R.jsxs)(`div`,{className:G(`str-chat__media-badge`,{[`str-chat__media-badge--${t}`]:t}),children:[n&&(0,R.jsx)(n,{}),e.duration?(0,R.jsx)(`div`,{children:e.duration}):null]})},p7=({attachment:e,handleRetry:t,openPreview:n,removeAttachments:r})=>{let{t:i}=Y(),{BaseImage:a=i5}=q(),[o,s]=(0,d.useState)(!1),{id:c,uploadPermissionCheck:l,uploadProgress:u,uploadState:f}=e.localMetadata??{},p=f===`uploading`,m=(0,d.useCallback)(()=>s(!0),[]),h=l?.reason===`size_limit`,g=f===`blocked`||h,_=f===`failed`&&!!t,v=_||g,y=n=>(n.stopPropagation(),t(e),!1),b=(0,d.useMemo)(()=>yb(e)?{alt:e.title,title:e.title,url:e.thumb_url}:{alt:e.fallback,title:e.fallback,url:e.image_url||e.localMetadata.previewUri},[e]);return(0,R.jsxs)(d7,{attachment:e,className:G(`str-chat__attachment-preview-media`,{"str-chat__attachment-preview-media--thumbnail-preview-error":o,"str-chat__attachment-preview-media--upload-error":v,"str-chat__attachment-preview-media--uploading":p}),"data-testid":`attachment-preview-media`,onPressed:_?y:void 0,openPreview:!p&&!v?n:void 0,children:[(0,R.jsxs)(`div`,{className:`str-chat__attachment-preview-media__thumbnail-wrapper`,children:[b.url&&(0,R.jsx)(a,{alt:b.alt,className:`str-chat__attachment-preview-media__thumbnail`,onError:m,src:b.url,title:b.title}),(0,R.jsxs)(`div`,{className:G(`str-chat__attachment-preview-media__overlay`),children:[p&&(0,R.jsx)(r8,{uploadProgress:u}),yb(e)&&!v&&f!==`uploading`&&(0,R.jsx)(rxe,{attachment:e,variant:`video`}),g&&(0,R.jsx)(YH,{}),_&&(0,R.jsx)(nH,{appearance:`solid`,"aria-label":i(`aria/Retry upload`),circular:!0,className:`str-chat__attachment-preview-media__retry-upload-button`,"data-testid":`video-preview-item-retry-button`,onClick:y,size:`sm`,variant:`danger`,children:(0,R.jsx)(uH,{})})]})]}),(0,R.jsx)(I5,{"data-testid":`video-preview-item-delete-button`,onClick:()=>{c&&r([c])},uploadState:f})]})},ixe=({AudioAttachmentPreview:e=f7,FileAttachmentPreview:t=f7,ImageAttachmentPreview:n=p7,UnsupportedAttachmentPreview:r=Xbe,VideoAttachmentPreview:i=p7})=>{let a=IW(),{Modal:o=f8}=q(),[s,c]=(0,d.useState)(!1),l=(0,d.useRef)(0),u=(0,d.useCallback)(e=>e!==`overlay`,[]),{attachments:f}=y5(),p=(0,d.useMemo)(()=>f.filter(e=>!_b(e)),[f]),{galleryItems:m,previewIndexById:h}=(0,d.useMemo)(()=>{let e=[],t={};for(let n of f)if(hb(n)||bb(n)){let r=a5(n);r&&(t[n.localMetadata.id]=e.length,e.push(r))}return{galleryItems:e,previewIndexById:t}},[f]),g=(0,d.useCallback)(e=>{l.current=e,c(!0)},[]);return p.length?(0,R.jsxs)(`div`,{className:`str-chat__attachment-preview-list`,"data-testid":`attachment-preview-list`,children:[f.map(o=>db(o)||vb(o)?null:fne(o)?(0,R.jsx)(e,{attachment:o,handleRetry:a.attachmentManager.uploadAttachment,removeAttachments:a.attachmentManager.removeAttachments},o.localMetadata.id||o.asset_url):bb(o)?(0,R.jsx)(i,{attachment:o,handleRetry:a.attachmentManager.uploadAttachment,openPreview:()=>g(h[o.localMetadata.id]??0),removeAttachments:a.attachmentManager.removeAttachments},o.localMetadata.id||o.asset_url):hb(o)?(0,R.jsx)(n,{attachment:o,handleRetry:a.attachmentManager.uploadAttachment,openPreview:()=>g(h[o.localMetadata.id]??0),removeAttachments:a.attachmentManager.removeAttachments},o.localMetadata.id||o.image_url):dne(o)?(0,R.jsx)(t,{attachment:o,handleRetry:a.attachmentManager.uploadAttachment,removeAttachments:a.attachmentManager.removeAttachments},o.localMetadata.id||o.asset_url):fb(o)?(0,R.jsx)(r,{attachment:o,handleRetry:a.attachmentManager.uploadAttachment,removeAttachments:a.attachmentManager.removeAttachments},o.localMetadata.id):null),m.length>0&&(0,R.jsx)(o,{className:`str-chat__gallery-modal`,onClose:()=>c(!1),onCloseAttempt:u,open:s,children:(0,R.jsx)(f5,{initialIndex:l.current,items:m})})]}):null},axe=({VoiceRecordingPreview:e=txe})=>{let t=IW(),{attachments:n}=y5(),r=n.filter(vb)[0];return r?(0,R.jsx)(`div`,{className:`str-chat__message-composer-voice-preview-slot`,"data-testid":`voice-preview-slot`,children:(0,R.jsx)(e,{attachment:r,handleRetry:t.attachmentManager.uploadAttachment,removeAttachments:t.attachmentManager.removeAttachments})}):null},oxe=({command:e})=>{let{textComposer:t}=IW(),{textareaRef:n}=EV(),{t:r}=Y();return e?(0,R.jsxs)(`div`,{className:`str-chat__command-chip`,children:[(0,R.jsx)(xU,{}),(0,R.jsx)(`span`,{children:e.name}),(0,R.jsx)(`button`,{"aria-label":r(`Exit command {{ command }}`,{command:e.name}),className:`str-chat__command-chip__close-button`,onClick:()=>{t.setCommand(null),n.current?.focus()},children:(0,R.jsx)(RH,{})})]}):null},sxe=()=>(0,R.jsx)(`div`,{className:`str-chat__message-composer-cooldown`,"data-testid":`cooldown-timer`,children:b5()}),cxe=()=>(0,R.jsx)(`svg`,{fill:`currentColor`,viewBox:`0 0 18 14`,xmlns:`http://www.w3.org/2000/svg`,children:(0,R.jsx)(`path`,{d:`M5.79457 10.875L2.32457 7.40502C1.93457 7.01502 1.30457 7.01502 0.91457 7.40502C0.52457 7.79502 0.52457 8.42502 0.91457 8.81502L5.09457 12.995C5.48457 13.385 6.11457 13.385 6.50457 12.995L17.0846 2.41502C17.4746 2.02502 17.4746 1.39502 17.0846 1.00502
502C16.6946 0.615024 16.0646 0.615024 15.6746 1.00502L5.79457 10.875Z`})}),lxe=e=>({linkPreviews:Array.from(e.previews.values()).filter(e=>cS.previewIsLoaded(e)||cS.previewIsLoading(e))}),uxe=({displayLinkCount:e=1})=>{let{linkPreviewsManager:t}=IW(),{linkPreviews:n}=J(t.state,lxe);return n.length===0?null:(0,R.jsx)(`div`,{className:`str-chat__link-preview-list`,children:n.slice(0,e).map(e=>(0,R.jsx)(dxe,{linkPreview:e},e.og_scrape_url))})},dxe=({linkPreview:e})=>{let{linkPreviewsManager:t}=IW(),{handleEnter:n,handleLeave:r,tooltipVisible:i}=g8(),[a,o]=(0,d.useState)(null),{image_url:s,thumb_url:c,title:l,title_link:u}=e;if(!cS.previewIsLoaded(e)&&!cS.previewIsLoading(e))return null;let f=u||s||c;return(0,R.jsxs)(`div`,{className:G(`str-chat__link-preview-card`,{"str-chat__link-preview-card--loading":cS.previewIsLoading(e)}),"data-testid":`link-preview-card`,onMouseEnter:n,onMouseLeave:r,ref:o,children:[(0,R.jsx)(h8,{offset:[0,5],referenceElement:a,visible:i,children:e.og_scrape_url}),f&&(0,R.jsx)(i5,{alt:l,className:`str-chat__attachment-preview__thumbnail`,src:f,title:l}),(0,R.jsxs)(`div`,{className:`str-chat__link-preview-card__content`,children:[(0,R.jsx)(`div`,{className:`str-chat__link-preview-card__content-title`,children:e.title}),(0,R.jsx)(`div`,{className:`str-chat__link-preview-card__content-description`,children:e.text}),(0,R.jsxs)(`div`,{className:`str-chat__link-preview-card__content__url`,children:[(0,R.jsx)(TH,{}),(0,R.jsx)(`span`,{children:e.og_scrape_url})]})]}),(0,R.jsx)(I5,{className:`str-chat__link-preview-card__dismiss-button`,"data-testid":`link-preview-card-dismiss-btn`,onClick:()=>t.dismissPreview(e.og_scrape_url)})]})},fxe=({permissionName:e})=>{let{t}=Y(),n={body:{camera:t(`To start recording, allow the camera access in your browser`),microphone:t(`To start recording, allow the microphone access in your browser`)},heading:{camera:t(`Allow access to camera`),microphone:t(`Allow access to microphone`)}};return(0,R.jsxs)(`div`,{className:`str-chat__recording-permission-denied-notification`,children:[(0,R.jsx)(`div`,{className:`str-chat__recording-permission-denied-notification__heading`,children:n.heading[e]}),(0,R.jsx)(`p`,{className:`str-chat__recording-permission-denied-notification__message`,children:n.body[e]})]})},pxe=e=>({isPlaying:e.isPlaying,progress:e.progressPercent,secondsElapsed:e.secondsElapsed}),mxe=({durationSeconds:e,mimeType:t,src:n,waveformData:r})=>{let{t:i}=Y(),a=MW({durationSeconds:e,mimeType:t,src:n,waveformData:r}),{isPlaying:o,progress:s,secondsElapsed:c}=J(a?.state,pxe)??{},l=c||e;return(0,d.useEffect)(()=>(a?.cancelScheduledRemoval(),()=>{a?.scheduleRemoval()}),[a]),a?(0,R.jsxs)(`div`,{className:G(`str-chat__audio-recorder__recording-playback`,{"str-chat__audio-recorder__recording-playback--isPlaying":o}),children:[(0,R.jsx)(nH,{appearance:`ghost`,"aria-label":i(o?`aria/Pause`:`aria/Play`),circular:!0,className:`str-chat__audio_recorder__toggle-playback-button`,"data-testid":`audio-recording-preview-toggle-play-btn`,onClick:a.togglePlay,size:`sm`,variant:`secondary`,children:o?(0,R.jsx)(uU,{}):(0,R.jsx)(gU,{})}),(0,R.jsx)(H8,{className:G(`str-chat__recording-timer`,{"str-chat__recording-timer--hours":l>=3600}),duration:e,isPlaying:!!o,secondsElapsed:c}),(0,R.jsx)(`div`,{className:`str-chat__wave-progress-bar__track-container`,children:(0,R.jsx)(n5,{durationSeconds:e,progress:s,secondsElapsed:c,seek:a.seek,waveformData:r||[]})})]}):null},hxe=({initialSeconds:e=0,startOnMount:t}={})=>{let[n,r]=(0,d.useState)(e),i=(0,d.useRef)(void 0),a=(0,d.useCallback)(()=>{i.current||=setInterval(()=>{r(e=>e+1)},1e3)},[]),o=(0,d.useCallback)(()=>{clearInterval(i.current),i.current=void 0},[]);return(0,d.useEffect)(()=>{i.current||r(e)},[e]),(0,d.useEffect)(()=>{if(t)return a(),()=>{o()}},[a,t,o]),{secondsElapsed:n,startCounter:a,stopCounter:o}},gxe=({durationSeconds:e})=>(0,R.jsx)(`div`,{className:G(`str-chat__recording-timer`,{"str-chat__recording-timer--hours":e>=3600}),children:Z8(e)}),_xe=({maxDataPointsDrawn:e=200})=>{let{recordingController:{recorder:t}}=EV(),[n,r]=(0,d.useState)([]);return(0,d.useEffect)(()=>
502{if(!t?.amplitudeRecorder)return;let e=t.amplitudeRecorder.amplitudes.subscribe(r);return()=>{e.unsubscribe()}},[t]),t?(0,R.jsx)(`div`,{className:`str-chat__waveform-box-container`,children:(0,R.jsx)(`div`,{className:`str-chat__wave-progress-bar__track`,children:n.slice(-e).map((e,t)=>(0,R.jsx)(`div`,{className:`str-chat__wave-progress-bar__amplitude-bar`,style:{"--str-chat__wave-progress-bar__amplitude-bar-height":e?e*100+`%`:`0%`}},`amplitude-${t}-voice-recording`))})}):null},vxe=()=>{let{recordingController:{recorder:e}}=EV(),{secondsElapsed:t,startCounter:n,stopCounter:r}=hxe({initialSeconds:e?.durationMs?e.durationMs/1e3:0});return(0,d.useEffect)(()=>{if(!e?.mediaRecorder)return;let{mediaRecorder:t}=e;return t.state===`recording`&&n(),t.addEventListener(`start`,n),t.addEventListener(`resume`,n),t.addEventListener(`stop`,r),t.addEventListener(`pause`,r),()=>{t.removeEventListener(`start`,n),t.removeEventListener(`resume`,n),t.removeEventListener(`stop`,r),t.removeEventListener(`pause`,r)}},[e,n,r]),(0,R.jsxs)(`div`,{className:`str-chat__audio-recorder__recording-preview`,children:[(0,R.jsx)(aU,{}),(0,R.jsx)(gxe,{durationSeconds:t}),(0,R.jsx)(_xe,{})]})},yxe=e=>e===P5.STOPPED,m7=e=>e===P5.RECORDING,bxe=()=>{let{t:e}=Y(),{recordingController:{recorder:t,recordingState:n}}=EV(),r=m7(n);return(0,R.jsx)(nH,{appearance:`outline`,"aria-label":e(r?`aria/Pause recording`:`aria/Resume recording`),circular:!0,className:`str-chat__audio_recorder__toggle-recording-button`,onClick:()=>r?t?.pause():t?.resume(),size:`sm`,variant:`secondary`,children:r?(0,R.jsx)(uU,{}):(0,R.jsx)(aU,{})})},xxe=()=>{let{addNotification:e}=GG(),{t}=Y(),{recordingController:{completeRecording:n,recorder:r,recording:i,recordingState:a}}=EV(),o=i?.localMetadata?.uploadState===`uploading`,s=i?.localMetadata?.uploadProgress;return r?(0,R.jsxs)(`div`,{className:`str-chat__audio_recorder__recording-controls`,children:[!m7(a)&&(0,R.jsx)(nH,{appearance:`ghost`,"aria-label":t(`aria/Cancel recording`),circular:!0,className:`str-chat__audio_recorder__cancel-button`,"data-testid":`cancel-recording-audio-button`,disabled:o,onClick:()=>{r.cancel(),e({emitter:`AudioRecorder`,message:t(`Voice message deleted`),severity:`info`,type:`audioRecording:cancel:success`})},size:`sm`,variant:`secondary`,children:(0,R.jsx)(CU,{})}),(0,R.jsx)(bxe,{}),(0,R.jsx)(nH,{appearance:`solid`,"aria-label":t(`aria/Complete recording`),circular:!0,className:`str-chat__audio_recorder__stop-button`,"data-testid":`audio-recorder-stop-button`,onClick:n,size:`sm`,variant:`primary`,children:o?(0,R.jsx)(r8,{uploadProgress:s}):(0,R.jsx)(cxe,{})})]}):null},Sxe=()=>{let{recordingController:{recorder:e,recording:t,recordingState:n}}=EV(),r=(0,d.useMemo)(()=>({paused:n===P5.PAUSED,recording:n===P5.RECORDING,stopped:n===P5.STOPPED}),[n]);return e?(0,R.jsxs)(`div`,{className:`str-chat__audio_recorder`,"data-testid":`audio-recorder`,children:[(yxe(n)||r.paused)&&t?.asset_url?(0,R.jsx)(mxe,{durationSeconds:t.duration??0,mimeType:t.mime_type,src:t.asset_url,waveformData:t.waveform_data}):r.recording?(0,R.jsx)(vxe,{}):null,(0,R.jsx)(xxe,{})]}):null},h7=`recording-permission-denied-notification`,Cxe=()=>{let{RecordingPermissionDeniedNotification:e=fxe,StartRecordingAudioButton:t=wxe}=q(),{asyncMessagesMultiSendEnabled:n,recordingController:r}=EV(),{attachments:i}=v5(),{dialog:a,dialogManager:o}=$B({id:h7}),s=(0,d.useRef)(null);return(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(t,{disabled:!!r.recordingState||!n&&i.some(e=>e.type===uye.VOICE_RECORDING),onClick:()=>{r.recorder?.start(),r.recorder&&navigator.mediaDevices&&r.permissionState===`denied`&&a.open()},ref:s}),(0,R.jsx)(che,{className:`str-chat__recording-permission-denied-notification`,dialogManagerId:o?.id,id:h7,onClose:a.close,placement:`top-start`,referenceElement:s.current,children:(0,R.jsx)(e,{permissionName:Jve.MIC})})]})},wxe=(0,d.forwardRef)(function(e,t){let{t:n}=Y();return(0,R.jsx)(nH,{appearance:`ghost`,"aria-label":n(`aria/Start recording audio`),circular:!0,className:`str-chat__start-recording-audio-button`,"data-testid":`start-recording-audio-button`,size:`sm`,variant:`secondary`,...e,ref:t,children:(0,R.jsx)(aU,{})})}),Txe=({message:e,onCancel:t})=>{let{t:n}=Y();return(0,R.jsx)(z5,{authorLabel:n(`Edit Message`),onRemove:t,quotedMessage:e})},Exe=e=>({showReplyInChannel:e.showReplyInChannel}),Dxe=()=>{let{t:e}=Y(),t=IW(),{showReplyInChannel:n}=J(t.state,Exe);if(t.editedMessage||!t.threadId)return null;let r=Object.keys(t.channel.state.members).length===2?e(`Also send as a direct message`):e(`Also send in channel`);return(0,R.jsx)(`div`,{className:G(`str-chat__send-to-channel-checkbox__container`,{"str-chat__send-to-channel-checkbox__container--checked":n}),"data-testid":`send-to-channel-checkbox`,children:(0,R.jsxs)(`label`,{className:`str-chat__send-to-channel-checkbox__field`,htmlFor:`send-to-channel-checkbox`,children:[(0,R.jsx)(`input`,{"aria-checked":n,checked:n,className:`str-chat__send-to-channel-checkbox__input`,id:`send-to-channel-checkbox`,onCh
502ange:()=>t.toggleShowReplyInChannel(),type:`checkbox`}),(0,R.jsx)(`span`,{"aria-hidden":!0,className:`str-chat__send-to-channel-checkbox__visual`,children:(0,R.jsx)(`span`,{className:`str-chat__send-to-channel-checkbox__checkmark`,children:(0,R.jsx)(OH,{})})}),(0,R.jsx)(`span`,{className:`str-chat__send-to-channel-checkbox__label`,children:r})]})})},Oxe=({editedMessage:e,quotedMessage:t})=>({editedMessage:e,quotedMessage:t}),kxe=e=>{let{enabled:t,entity:n,focused:r,...i}=e,a=IW();if(J(a.state,Oxe),!n.name)return null;let o=t??!a.isCommandDisabled(n);return(0,R.jsx)(o7,{...i,command:n,enabled:o})},Axe=e=>{let{className:t,entity:n,focused:r,...i}=e;if(!Object.keys(n).length)return null;let{parts:a,token:o}=n.tokenizedDisplayName??{};return(0,R.jsx)(yhe,{...i,className:G(`str-chat__emoji-item`,t),emoji:n.native,children:a?.map((e,t)=>e.toLowerCase()===o?(0,R.jsx)(`span`,{className:`str-chat__emoji-item--highlight`,children:e},`part-${t}`):(0,R.jsx)(`span`,{className:`str-chat__emoji-item--part`,children:e},`part-${t}`))??null})},jxe=({className:e,component:t,focused:n,item:r,onClick:i,onKeyDown:a,onMouseEnter:o,...s})=>{let{textComposer:c}=IW(),{textareaRef:l}=EV(),u=(0,d.useRef)(null),f=(0,d.useCallback)(()=>{c.handleSelect(r),l.current?.focus()},[r,l,c]);return(0,d.useLayoutEffect)(()=>{n&&u.current?.scrollIntoView({behavior:`instant`,block:`nearest`})},[n]),(0,R.jsx)(t,{...s,className:G(`str-chat__suggestion-list-item`,e,{"str-chat__suggestion-list-item--selected":n}),entity:r,focused:n,onClick:e=>{f(),i?.(e)},onKeyDown:e=>{e.key===`Enter`&&f(),a?.(e)},onMouseEnter:o,ref:u})},Mxe=({entity:e,focused:t,...n})=>{if(!Object.keys(e).length)return null;let{parts:r,token:i}=e.tokenizedDisplayName,a=()=>r.map((e,t)=>{let n=e.toLowerCase()===i,r=e.replace(/^\s+|\s+$/g,`\xA0`);return(0,R.jsx)(`span`,{className:G({"str-chat__emoji-item-part":!n,"str-chat__suggestion-item-part--match":n}),children:r},`part-${t}`)});return(0,R.jsx)(vhe,{...n,imageUrl:e.image,title:e.name||e.id,userName:e.name||e.id,children:a()})},Nxe=`str-chat__textarea-caret-mirror`,Pxe=`str-chat__textarea-caret-marker`,Fxe=(e,t)=>{if(!e||typeof window>`u`)return null;let n=Math.max(0,t??e.selectionEnd??0),r=e.value??``,i=r.slice(0,n),a=r.slice(n),o=window.getComputedStyle(e),s=document.createElement(`div`);s.className=Nxe,s.style.position=`absolute`,s.style.visibility=`hidden`,s.style.top=`0`,s.style.left=`-9999px`,s.style.whiteSpace=`pre-wrap`,s.style.wordWrap=`break-word`;for(let e of o)s.style.setProperty(e,o.getPropertyValue(e));s.textContent=i;let c=document.createElement(`span`);c.className=Pxe,c.textContent=a.length?a:`.`,s.appendChild(c),document.body.appendChild(s),s.scrollTop=e.scrollTop,s.scrollLeft=e.scrollLeft;let l=e.getBoundingClientRect(),u=s.getBoundingClientRect(),d=c.getBoundingClientRect();document.body.removeChild(s);let f=l.left+(d.left-u.left),p=l.top+(d.top-u.top),m=d.height||parseFloat(o.lineHeight)||0;return new DOMRect(f,p,0,m)},Ixe=({selection:e,suggestions:t})=>({selection:e,suggestions:t}),Lxe=e=>({items:e.items??[]}),Rxe={"/":e=>(0,R.jsx)(kxe,{...e,entity:e.entity}),":":e=>(0,R.jsx)(Axe,{...e,entity:e.entity}),"@":e=>(0,R.jsx)(Mxe,{...e,entity:e.entity})},zxe=({className:e,closeOnClickOutside:t=!0,containerClassName:n,focusedItemIndex:r,setFocusedItemIndex:i,suggestionItemComponents:a=Rxe})=>{let{t:o}=Y(),{AutocompleteSuggestionItem:s=jxe,ContextMenu:c=U6}=q(),{textareaRef:l}=EV(),u=IW(),f=F5(),{textComposer:p}=u,{selection:m,suggestions:h}=J(p.state,Ixe),{items:g}=J(h?.searchSource.state,Lxe)??{},_=(0,d.useMemo)(()=>h?.searchSource.type!==`commands`||f.some(({enabled:e})=>e),[f,h?.searchSource.type]),[v,y]=(0,d.useState)(null),b=(0,d.useRef)(null),x=(0,d.useMemo)(()=>({getBoundingClientRect:()=>b.current??new DOMRect}),[]),{refs:S,strategy:C,update:w,x:T,y:E}=QV({allowFlip:!1,offset:8,placement:`top-start`,shiftOptions:{crossAxis:!0}}),D=h?.trigger?a[h?.trigger]:void 0,O=(0,d.useMemo)(()=>D?(h?.searchSource.type===`commands`?[...g??[]].sort((e,t)=>String(e.name??``).localeCompare(String(t.name??``))):g??[]).map((e,t)=>({...n})=>
502(0,d.createElement)(s,{...n,component:D,focused:r===t,item:e,key:e.id.toString(),onMouseEnter:()=>i?.(t)})):[],[g,D,r,i,s,h?.searchSource.type]),k=(0,d.useCallback)(({children:e})=>(0,R.jsx)(e7,{loadNextOnScrollToBottom:h?.searchSource.search,threshold:100,children:e}),[h?.searchSource.search]);if((0,d.useEffect)(()=>{if(!t||!h||!v)return;let e=e=>{v.contains(e.target)||p.closeSuggestions()};return document.addEventListener(`click`,e),()=>{document.removeEventListener(`click`,e)}},[t,h,v,p]),(0,d.useEffect)(()=>{S.setFloating(v)},[v,S]),(0,d.useLayoutEffect)(()=>{!h||!w||(()=>{let e=Fxe(l.current??null,m?.end);if(!e){b.current=null,S.setReference(null);return}b.current=e,x.contextElement=l.current??void 0,S.setReference(x),w()})()},[v,g?.length,S,m?.end,h,l,w,x]),!h||!g?.length||!D||!_)return null;let A=h.searchSource.type===`commands`?o(`aria/Command Suggestions`):h.searchSource.type===`emojis`?o(`aria/Emoji Suggestions`):h.searchSource.type===`mentions`?o(`aria/User Suggestions`):o(`aria/Suggestions`);return(0,R.jsx)(`div`,{className:G(`str-chat__suggestion-list-container`,n),ref:y,style:{left:T??0,position:C,top:E??0,visibility:T==null||E==null?`hidden`:void 0,zIndex:1e3},children:(0,R.jsx)(c,{"aria-label":A,className:G(`str-chat__suggestion-list`,e),Header:h.searchSource.type===`commands`?Ube:void 0,items:O,ItemsWrapper:k,menuClassName:h.searchSource.type===`commands`?a7:void 0})})},Bxe=({command:e})=>({command:e}),Vxe=({placeholder:e}={})=>{let{t}=Y(),{additionalTextareaProps:n}=EV(),r=b5(),{command:i}=J(IW().textComposer.state,Bxe),a=(0,d.useMemo)(()=>({ban:t(`ban-command-args`),giphy:t(`giphy-command-args`),mute:t(`mute-command-args`),unban:t(`unban-command-args`),unmute:t(`unmute-command-args`)}),[t]),o=i?.args&&(a[i.name??``]??t(i.args)),s=i?.name===`giphy`?t(`Search GIFs`):o??void 0,c=e??n?.placeholder??t(`Send a message`);return r?t(`Slow mode, wait {{ seconds }}s...`,{seconds:r}):s??c},Hxe=e=>({selection:e.selection,suggestions:e.suggestions,text:e.text}),Uxe=e=>({isLoadingItems:e.isLoading,items:e.items}),Wxe=e=>({enabled:e.text.enabled}),Gxe=e=>({quotedMessage:e.quotedMessage}),Kxe=e=>({attachments:e.attachments}),qxe=e=>e.key===`Enter`&&!e.shiftKey&&!e.nativeEvent.isComposing,Jxe=e=>e.length===0,Yxe=({className:e,closeSuggestionsOnClickOutside:t,containerClassName:n,listClassName:r,maxRows:i,minRows:a,onBlur:o,onChange:s,onKeyDown:c,onScroll:l,onSelect:u,placeholder:f,shouldSubmit:p,...m})=>{let{AutocompleteSuggestionList:h=zxe}=q(),{additionalTextareaProps:g,focus:_,handleSubmit:v,maxRows:y,minRows:b,onPaste:x,shouldSubmit:S,textareaRef:C}=EV(),w=b5(),T=Vxe({placeholder:f}),E=i??y??10,D=a??b,O=p??S??qxe,k=IW(),{textComposer:A}=k,{selection:j,suggestions:M,text:N}=J(A.state,Hxe),P=!N&&D==null?1:void 0,ee=N?void 0:{overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`},{enabled:F}=J(k.configState,Wxe),{quotedMessage:te}=J(k.state,Gxe),{attachments:ne}=J(k.attachmentManager.state,Kxe),{isLoadingItems:re}=J(M?.searchSource.state,Uxe)??{},I=(0,d.useRef)(null),[ie,ae]=(0,d.useState)(0),[oe,L]=(0,d.useState)(!1),se=(0,d.useCallback)(e=>{if(s){s(e);return}C.current&&A.handleChange({selection:{end:C.current.selectionEnd,start:C.current.selectionStart},text:e.target.value})},[s,A,C]),ce=(0,d.useCallback)(()=>{L(!1)},[]),le=(0,d.useCallback)(()=>{L(!0)},[]),ue=(0,d.useCallback)(e=>{if(c){c(e);return}let t=C.current?.value??e.currentTarget.value;if(A.suggestions&&A.suggestions.searchSource.items?.length){if(e.key===`Escape`)return A.closeSuggestions();let t=A.suggestions.searchSource.items;e.key===`Enter`&&(e.preventDefault(),A.handleSelect(t[ie])),e.key===`ArrowUp`&&(e.preventDefault(),ae(e=>{let n=e-1;return M?.searchSource.hasNext?n=e:n<0&&(n=t.length-1),n})),e.key===`ArrowDown`&&(e.preventDefault(),ae(e=>{let n=e+1;return M?.searchSource.hasNext?n=e:n>=t.length&&(n=0),n}))}else A.command&&(e.key===`Escape`||e.key===`Backspace`&&Jxe(t))?(e.preventDefault(),A.clearCommand()):O(e)&&C.current&&k.hasSendableData&&(e.key===`Enter`&&e.preventDefault(),v())},[ie,v,k,c,O,M,A,C]),de=(0,d.useCallback)(e=>{l?l(e):A.closeSuggestions()},[l,A]),fe=(0,d.useCallback)(e=>{u?.(e),A.setSelection({end:e.target.selectionEnd,start:e.target.selectionStart})},[u,A]);return(0,d.useEffect)(()=>{A.suggestions&&ae(0)},[A.suggestions]),(0,d.useEffect)(()=>{let e=C.current?.matches(`:focus`);!C.current||e||!_||C.current.focus()},[ne,_,te,C]),(0,d.useLayoutEffect)(()=>{let e=C.current;if(!e||oe)return;e.value!==N&&(e.value=N);let t=e.value.length,n=Math.max(0,Math.min(j.start,t)),r=Math.max(n,Math.min(j.end,t));e.selectionStart===n&&e.selectionEnd===r||e.setSelectionRange(n,r,`forward`)},[N,j.start,j.end,oe,C]),(0,R.jsxs)(`div`,{className:G(`rta`,`str-chat__textarea`,n,{"rta--loading":re}),ref:I,children:[(0,R.jsx)(Afe,{...g,...m,"aria-label":T,className:G(`rta__textarea`,`str-chat__textarea__textarea str-chat__message-textarea`,e),"data-testid":`message-input`,disabled:!F||!!w,maxRows:P??E,minRows:P??D,onBlur:o,onChange:se,onCompositionEnd:ce,onCompositionStart:le,onKeyDown:ue,onPaste:x,onScroll:de,onSelect:fe,placeholder:T,ref:e=>{C.current=e},style:ee}),!oe&&(0,R.jsx)(h,{className:r,closeOnClickOutside:t,focusedItemIndex:ie,setFocusedItemIndex:ae})]})},g7=d.createContext({subscribeToDrop:null}),_7=()=>(0,d.useContext)(g7),Xxe=()=>{let{subscribeToDrop:e}=_7(),t=IW();(0,d.useEffect)(()=>e?.(t.attachmentManager.uploadFiles),[e,t])},Zxe=e=>({acceptedFiles:e.attachments.acceptedFiles,multipleUploads:e.attachments.maxNumberOfFilesPerMessage>1}),Qxe=({children:e,className:t,component:n=`div`,style:r})=>{let i=(0,d.useRef)(new Set),a=EV(),o=_7(),s=IW(),{isUploadEnabled:c}=v5(),{acceptedFiles:l,multipleUploads:u}=J(s.configState,Zxe),f=PW(),p=Object.keys(a).length>0,m=(0,d.useMemo)(()=>l.reduce((e,t)=>
502(e[t]??(e[t]=[]),e),{}),[l]),h=(0,d.useCallback)(e=>(i.current.add(e),()=>{i.current.delete(e)}),[]),g=(0,d.useCallback)(e=>{i.current.forEach(t=>t(e))},[]),{getRootProps:_,isDragActive:v,isDragReject:y}=O2({accept:m,disabled:p?!c||f:!1,multiple:u,noClick:!0,noKeyboard:!0,onDrop:p?s.attachmentManager.uploadFiles:g});if(o.subscribeToDrop!==null)return(0,R.jsx)(n,{className:t,children:e});let b=G(`str-chat__dropzone-root`,t);return(0,R.jsx)(g7.Provider,{value:{subscribeToDrop:h},children:(0,R.jsxs)(n,{..._({className:b,style:r}),children:[v&&(0,R.jsx)(`div`,{className:G(`str-chat__dropzone-container`,{"str-chat__dropzone-container--not-accepted":y}),role:`presentation`,children:(0,R.jsx)($xe,{isDragRejected:y})}),e]})})},$xe=({isDragRejected:e})=>{let{t}=Y();return(0,R.jsx)(`div`,{className:`str-chat__dropzone-container__content`,children:e?(0,R.jsx)(`p`,{children:t(`Some of the files will not be accepted`)}):(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)($H,{}),(0,R.jsx)(`p`,{children:t(`Drag your files here`)})]})})},eSe=({onClick:e,...t})=>{let{t:n}=Y();return(0,R.jsx)(`button`,{"aria-label":n(`aria/Stop AI Generation`),className:`str-chat__stop-ai-generation-button`,"data-testid":`stop-ai-generation-button`,onClick:e,...t})},tSe=({children:e,sendMessage:t,...n})=>{let{t:r}=Y(),i=gye();return(0,R.jsx)(nH,{appearance:`solid`,"aria-label":r(`aria/Send`),circular:!0,className:`str-chat__send-button`,"data-testid":`send-button`,disabled:!i,onClick:t,size:`sm`,variant:`primary`,...n,children:e??(0,R.jsx)(cU,{})})},nSe=({editedMessage:e})=>({editedMessage:e}),rSe=({command:e,text:t})=>({command:e,text:t}),iSe=()=>{let{channel:e}=KB(),{hideSendButton:t}=EV(),n=IW(),{CooldownTimer:r=sxe,SendButton:i,StopAIGenerationButton:a}=q(),{editedMessage:o}=J(n.state,nSe),{command:s}=J(n.textComposer.state,rSe),c=vye(),l=a===void 0?eSe:a,{handleSubmit:u,recordingController:f}=EV(),p=PW(),{aiState:m}=Vme(e),h=(0,d.useCallback)(()=>e?.stopAIResponse(),[e]),g=[r6.Thinking,r6.Generating].includes(m)&&!!l,_=!!(f.recorder&&navigator.mediaDevices),v=i?(0,R.jsx)(i,{sendMessage:u}):(0,R.jsx)(tSe,{sendMessage:u,children:o||s?(0,R.jsx)(OH,{}):(0,R.jsx)(cU,{})});if(g)v=(0,R.jsx)(l,{onClick:h});else if(t)return null;return p?v=(0,R.jsx)(r,{}):c&&!o&&!s&&_&&(v=(0,R.jsx)(Cxe,{})),(0,R.jsx)(`div`,{className:`str-chat__message-composer__actions`,children:v})},aSe=()=>{let{EmojiPicker:e}=q();return(0,R.jsx)(`div`,{className:`str-chat__message-composer__additional-actions`,children:!PW()&&e?(0,R.jsx)(e,{}):null})},oSe=()=>(0,R.jsx)(`div`,{className:`str-chat__location-preview-image`,children:(0,R.jsx)(iU,{})}),sSe=({location:e,PreviewImage:t=oSe,remove:n})=>{let{t:r}=Y(),i=e.durationMs,a=r(i?`Live location`:`Current location`);return(0,R.jsxs)(`div`,{className:`str-chat__location-preview`,"data-testid":`location-preview`,children:[(0,R.jsx)(t,{location:e}),(0,R.jsxs)(`div`,{className:`str-chat__location-preview__data`,children:[(0,R.jsx)(`div`,{className:`str-chat__location-preview__data__title`,title:r(`Shared location`),children:a}),(0,R.jsx)(`div`,{className:`str-chat__location-preview__data__subtitle`,children:r(`Location: {{ coordinates }}`,{coordinates:`${e.latitude}, ${e.longitude}`})}),i&&(0,R.jsx)(`div`,{className:`str-chat__location-preview__data__sharing-duration`,children:r(`Live for {{duration}}`,{duration:r(`duration/Share Location`,{milliseconds:i})})})]}),n&&(0,R.jsx)(I5,{"aria-label":r(`aria/Remove location attachment`),className:`str-chat__attachment-preview__remove-button`,"data-testid":`location-preview-item-delete-button`,onClick:n})]})},cSe=({editedMessage:e,quotedMessage:t})=>({editedMessage:e,quotedMessage:t}),v7=e=>({attachments:e.attachments}),lSe=e=>({linkPreviews:Array.from(e.previews.values()).filter(e=>cS.previewIsLoaded(e)||cS.previewIsLoading(e))}),uSe=e=>({location:e.location}),dSe=({command:e})=>({command:e}),fSe=()=>{let{AttachmentPreviewList:e=ixe,EditedMessagePreview:t=Txe,LinkPreviewList:n=uxe,QuotedMessagePreview:r=Tye,VoiceRecordingPreviewSlot:i=axe}=q(),a=IW(),{editedMessage:o,quotedMessage:s}=J(a.state,cSe),{attachments:c}=J(a.attachmentManager.state,v7),{location:l}=J(a.locationComposer.state,uSe),{linkPreviewsManager:u}=a,{linkPreviews:d}=J(u.state,lSe);return!s&&c.length===0&&d.length===0&&!l&&!o?null:(0,R.jsxs)(`div`,{className:`str-chat__message-composer-previews`,children:[o?(0,R.jsx)(`div`,{className:`str-chat__message-composer-previews`,children:(0,R.jsx)(t,{message:o,onCancel:()=>{Gme(a)}})}):(0,R.jsx)(r,{}),(0,R.jsx)(i,{}),(0,R.jsx)(e,{}),(0,R.jsx)(n,{}),l&&(0,R.jsx)(sSe,{location:l,remove:a.editedMessage?void 0:a.locationComposer.initState})]})},pSe=()=>{let{message:e}=o6(),{recordingController:t}=EV(),{command:n}
502=J(IW().textComposer.state,dSe),{AdditionalMessageComposerActions:r=aSe,AttachmentSelector:i=e?c7:Ybe,AudioRecorder:a=Sxe,CommandChip:o=oxe,SendToChannelCheckbox:s=Dxe,TextareaComposer:c=Yxe}=q();return(0,R.jsx)(Qxe,{className:`str-chat__message-composer-container`,component:`div`,children:(0,R.jsx)(`div`,{className:G(`str-chat__message-composer`,{"str-chat__message-composer--command-active":!!n}),children:t.recordingState?(0,R.jsx)(a,{}):(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(i,{}),(0,R.jsxs)(`div`,{className:`str-chat__message-composer-compose-area`,children:[(0,R.jsx)(fSe,{}),(0,R.jsxs)(`div`,{className:`str-chat__message-composer-controls`,children:[(0,R.jsxs)(`div`,{className:`str-chat__message-composer-controls__text-composition-controls`,children:[(0,R.jsxs)(`div`,{className:`str-chat__message-composer-controls__text-composition-controls__text`,children:[n&&(0,R.jsx)(`div`,{className:`str-chat__message-composer-controls__text-composition-controls__command-chip-container`,children:(0,R.jsx)(o,{command:n})}),(0,R.jsx)(c,{})]}),(0,R.jsx)(s,{})]}),(0,R.jsx)(r,{}),(0,R.jsx)(iSe,{})]})]})]})})})},mSe=e=>{let{additionalTextareaProps:t,asyncMessagesMultiSendEnabled:n,audioRecordingEnabled:r,emojiSearchIndex:i,focus:a,handleSubmit:o,hideSendButton:s,maxRows:c,minRows:l,onPaste:u,parent:f,recordingController:p,shouldSubmit:m,textareaRef:h}=e,g=f?.id;return(0,d.useMemo)(()=>({additionalTextareaProps:t,asyncMessagesMultiSendEnabled:n,audioRecordingEnabled:r,emojiSearchIndex:i,focus:a,handleSubmit:o,hideSendButton:s,maxRows:c,minRows:l,onPaste:u,parent:f,recordingController:p,shouldSubmit:m,textareaRef:h}),[n,r,i,o,s,l,g,p])},hSe=e=>{let t=pye(e),{emojiSearchIndex:n}=q(`MessageComposer`),r=mSe({...t,...e,emojiSearchIndex:e.emojiSearchIndex??n}),i=IW();return(0,d.useEffect)(()=>()=>{i.createDraft().finally(()=>i.clear())},[i]),(0,d.useEffect)(()=>{let e=i.threadId;!e||!i.channel||!i.contentIsEmpty||!i.config.drafts.enabled||i.channel.getDraft({parent_id:e}).then(({draft:e})=>{e&&i.initState({composition:e})}).catch(console.error)},[i]),Xxe(),(0,R.jsx)(TV,{value:r,children:e.children})},y7=d.memo(e=>{let{MessageComposerUI:t=pSe}=q(`MessageComposer`),n=IW(),r=PU();return(0,R.jsx)(_V,{id:n.threadId?`message-input-dialog-manager-thread-${r}`:`message-input-dialog-manager-${r}`,children:(0,R.jsx)(hSe,{...e,children:(0,R.jsx)(t,{})})})}),gSe=[v8,[j0,{singleTilde:!1}],x8,y8],_Se=e=>(0,R.jsx)(R1,{remarkPlugins:gSe,skipHtml:!0,children:e}),vSe=e=>{let t;for(let n of Object.values(e))n.forEach(e=>{t&&new Date(t.updated_at)>=new Date(e.created_at)||(t=e)});return t},ySe=(e,t,n=`en`,r)=>{let i=e.state.latestMessages[e.state.latestMessages.length-1],a=u6({language:n,message:i})||i?.text,o=i?.poll;if(!i)return t(`Nothing yet...`);if(_W(i))return t(`Message deleted`);if(o)if(o.vote_count){let n=vSe(o.latest_votes_by_option),r=n&&o.options.find(e=>e.id===n.option_id);if(r&&n)return t(`📊 {{votedBy}} voted: {{pollOptionText}}`,{pollOptionText:r.text,votedBy:n?.user?.id===e.getClient().userID?t(`You`):n.user?.name??t(`Poll`)})}else return t(`📊 {{createdBy}} created: {{ pollName}}`,{createdBy:o.created_by?.id===e.getClient().userID?t(`You`):o.created_by?.name??t(`Poll`),pollName:o.name});return a?r?.(i)?a:_Se(a):i.command?`/${i.command}`:i.attachments?.length?t(`🏙 Attachment...`):i.shared_location?t(`📍Shared location`):t(`Empty message...`)},b7=(e,t)=>{let n=e.data;if(n?.image&&typeof n.image==`string`)return n.image;let r=Object.values(e.state.members);if(r.length===2){let e=r.find(e=>e.user?.id!==t)?.user?.image;if(e&&typeof e==`string`)return e}},x7=e=>{let t=Object.values(e.state.members);if(t.length<=2)return;let n=[];for(let e of t){let{user:t}=e;!t?.name&&!t?.image||n.push({imageUrl:t.image,userName:t.name})}return{members:n}};function S7(e,t,n){let r=e.data;if(r?.name&&typeof r.name==`string`)return r.name;let i=Object.values(e.state.members),a=i.filter(e=>e.user?.id!==n);if(i.length===2&&a.length===1)return a[0].user?.name||t;if(a.length>=2){let e=a.map(e=>e.user?.name).filter(Boolean).slice(0,2);if(e.length>0)return e.join(`, `)}}var bSe=e=>{let{client:t}=K(`useChannelDisplayName`),{t:n}=Y(`useChannelDisplayName`),r=n(`Direct message`),[i,a]=(0,d.useState)(()=>e?S7(e,r,t.userID??void 0):void 0);return(0,d.useEffect)(()=>
502{if(!e){a(void 0);return}let n=()=>a(S7(e,r,t.userID??void 0));return n(),t.on(`user.updated`,n),()=>{t.off(`user.updated`,n)}},[e,e?.data,t,r]),i},C7={members:[],overflowCount:void 0},w7=e=>{let{channel:t,overrideImage:n,overrideTitle:r}=e,{client:i}=K(),a=bSe(t),o=r??a,[s,c]=(0,d.useState)(()=>t?n??b7(t,i.userID??void 0):void 0),[l,u]=(0,d.useState)(()=>t?x7(t)??C7:C7);return(0,d.useEffect)(()=>{if(!t||n)return;let e=()=>{c(b7(t,i.userID??void 0)),u(x7(t)??C7)};return e(),i.on(`user.updated`,e),()=>{i.off(`user.updated`,e)}},[t,t?.data,i,n]),(0,d.useMemo)(()=>({displayImage:n??s,displayTitle:o,groupChannelDisplayInfo:l}),[s,o,l,n])},T7=()=>(0,R.jsxs)(`svg`,{"aria-hidden":!0,fill:`none`,height:`5`,viewBox:`0 0 23 5`,width:`23`,xmlns:`http://www.w3.org/2000/svg`,children:[(0,R.jsx)(`circle`,{cx:`2.5`,cy:`2.5`,r:`2.5`}),(0,R.jsx)(`circle`,{cx:`11.5`,cy:`2.5`,r:`2.5`}),(0,R.jsx)(`circle`,{cx:`20.5`,cy:`2.5`,r:`2.5`})]}),xSe=2e3,SSe=e=>(0,d.useMemo)(()=>[...e],[e.map(e=>e.user?.id??``).sort().join(`,`)]);function E7(e,t=xSe){let n=SSe(e),[r,i]=(0,d.useState)([]),a=(0,d.useRef)(null),o=(0,d.useRef)(!1);return(0,d.useEffect)(()=>{if(n.length>0){a.current&&=(clearTimeout(a.current),null),o.current=!0,i(n);return}n.length===0&&o.current&&!a.current&&(a.current=setTimeout(()=>{a.current=null,o.current=!1,i([])},t))},[n,t]),(0,d.useEffect)(()=>()=>{a.current&&clearTimeout(a.current)},[]),{displayUsers:r}}var D7=(e,t)=>{let n=e.map(({user:e})=>e?.name?.trim()||e?.id||``).filter(Boolean),r=e.length;return r===1&&n.length===1?t(`{{ typing }} is typing`,{typing:n[0]}):r===2&&n.length===2?t(`{{ typing }} are typing`,{typing:`${n[0]} and ${n[1]}`}):t(`{{ count }} people are typing`,{count:r})},CSe=e=>{let{threadList:t=!1}=e,{t:n}=Y(),{channelConfig:r,thread:i}=KB(`TypingIndicatorHeader`),a=yG()?.id??i?.id,{client:o}=K(`TypingIndicatorHeader`),{typing:s={}}=HV(`TypingIndicatorHeader`),c=t?[]:Object.values(s).filter(({parent_id:e,user:t})=>t?.id!==o.user?.id&&!e),l=t?Object.values(s).filter(({parent_id:e,user:t})=>t?.id!==o.user?.id&&e===a):[],{displayUsers:u}=E7(t?l:c),d=D7(u,n);return r?.typing_events===!1||u.length===0?null:(0,R.jsxs)(`span`,{className:G(`str-chat__typing-indicator-header`,{"str-chat__typing-indicator-header--thread":t}),"data-testid":`typing-indicator-header`,children:[(0,R.jsx)(`span`,{className:`str-chat__typing-indicator-header__text`,children:d}),(0,R.jsx)(`span`,{className:`str-chat__typing-indicator__dots str-chat__typing-indicator-header__dots`,children:(0,R.jsx)(T7,{})})]})},wSe=({replyCount:e})=>({replyCount:e}),TSe=e=>e.user?.name??void 0,ESe=({replyCount:e,threadDisplayName:t,threadList:n})=>{let{t:r}=Y(),{channelConfig:i,thread:a}=KB(`ThreadHeaderSubtitle`),o=yG()?.id??a?.id,{client:s}=K(`ThreadHeaderSubtitle`),{typing:c={}}=HV(`ThreadHeaderSubtitle`),l=Object.values(c).filter(({parent_id:e,user:t})=>t?.id!==s.user?.id&&e===o),u=i?.typing_events!==!1&&l.length>0,d=r(`replyCount`,{count:e??0}),f=t?`${t} · ${d}`:d;return(0,R.jsx)(`div`,{className:`str-chat__thread-header-subtitle`,children:(0,R.jsx)(`span`,{className:`str-chat__subtitle-content-transition`,children:u?(0,R.jsx)(CSe,{threadList:n}):(0,R.jsx)(R.Fragment,{children:f})},u?`typing`:`default`)})},DSe=e=>{let{closeThread:t,overrideTitle:n,thread:r}=e,{t:i}=Y(),{channel:a}=KB(),{HeaderStartContent:o}=q(),{activeChatView:s}=EG(),{displayTitle:c}=w7({channel:a}),l=yG(),{replyCount:u}=J(l?.state,wSe)??{},d=l?u:r?r.reply_count??0:0,f=n??c??TSe(r)??void 0;return(0,R.jsxs)(`div`,{className:`str-chat__thread-header`,children:[(0,R.jsx)(`div`,{className:`str-chat__thread-header__start`,children:s===`threads`&&o&&(0,R.jsx)(o,{})}),(0,R.jsxs)(`div`,{className:`str-chat__thread-header-details`,children:[(0,R.jsx)(`div`,{className:`str-chat__thread-header-title`,children:i(`Thread`)}),(0,R.jsx)(ESe,{replyCount:d,threadDisplayName:f,threadList:!0})]}),!l&&(0,R.jsx)(`div`,{className:`str-chat__thread-header__end`,children:(0,R.jsx)(nH,{appearance:`ghost`,"aria-label":i(`aria/Close thread`),circular:!0,className:`str-chat__close-thread-button`,"data-testid":`close-thread-button`,onClick:t,size:`md`,variant:`secondary`,children:(0,R.jsx)(RH,{})})})]})},OSe=({replyCount:e})=>({replyCount:e}),kSe=()=>{let{thread:e}=KB(`ThreadStart`),{t}=Y(`ThreadStart`),n=yG(),{replyCount:r}=J(n?.state,OSe)??{},i=n?r:e?e.reply_count??0:0;return i?(0,R.jsx)(`div`,{className:`str-chat__thread-start`,children:t(`replyCount`,{count:i})}):null},O7=d.memo(e=>{let{calendar:t,className:n,date:r,floating:i,formatDate:a,...o}=e,{t:s,tDateTimeParser:c}=Y(`DateSeparator`),l=NV({calendar:t,...o,formatDate:a,messageCreatedAt:r,t:s,tDateTimeParser:c,timestampTranslationKey:`timestamp/DateSeparator`});return(0,R.jsx)(`div`,{className:G(`str-chat__date-separator`,{"str-chat__date-separator--floating":i},n),"data-date":r.toISOString(),"data-testid":i?`floating-date-separator`:`date-separator`,children:(0,R.jsx)(`div`,{className:`str-chat__date-separator-date`,children:l})})}),ASe=e=>{let{ThreadStart:t=kSe}=q(`ThreadHead`);return(0,R.jsxs)(`div`,{className:`str-chat__parent-message-li`,children:[(0,R.jsx)(O7,{date:e.message.created_at}),(0,R.jsx)(K7,{initialMessage:!0,threadList:!0,...e}),(0,R.jsx)(t,{})]})},jSe=e=>{let{channel:t,channelConfig:n,thread:r}=KB(`Thread`),i=yG();return!r&&!i||n?.replies===!1?null:(0,d.createElement)(NSe,{...e,key:`thread-${(r??i)?.id}-${t?.cid}`})},MSe=e=>({isLoadingNext:e.pagination.isLoadingNext,isLoadingPrev:e.pagination.isLoadingPrev,parentMessage:e.parentMessage,replies:e.replies}),NSe=e=>
502{let{additionalMessageComposerProps:t,additionalMessageListProps:n,additionalParentMessageProps:r,additionalVirtualizedMessageListProps:i,autoFocus:a=!0,enableDateSeparator:o=!1,Message:s,messageActions:c=Object.keys(QU),virtualized:l}=e,u=yG(),{thread:f,threadHasMore:p,threadLoadingMore:m,threadMessages:h=[],threadSuppressAutoscroll:g}=KB(`Thread`),{closeThread:_,loadMoreThread:v}=zB(`Thread`),{customClasses:y}=K(`Thread`),{Message:b,ThreadHead:x=ASe,ThreadHeader:S=DSe,VirtualMessage:C}=q(`Thread`),{isLoadingNext:w,isLoadingPrev:T,parentMessage:E,replies:D}=J(u?.state,MSe)??{},O=s||n?.Message||(l&&C?C:b),k=l?GCe:d9;(0,d.useEffect)(()=>{u||(f?.reply_count??0)>0&&v()},[f,v,u]);let A=u?{loadingMore:T,loadingMoreNewer:w,loadMore:u.loadPrevPage,loadMoreNewer:u.loadNextPage,messages:D}:{hasMore:p,loadingMore:m,loadMore:v,messages:h},j=f??E;if(!j)return null;let M=y?.thread||G(`str-chat__thread-container str-chat__thread`,{"str-chat__thread--virtualized":l}),N=(0,R.jsx)(x,{message:j,Message:O,...r},j.id);return(0,R.jsx)(yW.Provider,{value:{legacyThread:f??void 0},children:(0,R.jsxs)(`div`,{className:M,children:[(0,R.jsx)(S,{closeThread:_,thread:j}
502),(0,R.jsx)(k,{disableDateSeparator:!o,head:N,Message:O,messageActions:c,suppressAutoscroll:g,threadList:!0,...A,...l?i:n}),(0,R.jsx)(y7,{focus:a,parent:f??E,...t})]})})},k7=[],A7=e=>{let{dialogId:t,handleReaction:n,own_reactions:r}=e,[i,a]=(0,d.useState)(!1),{reactionOptions:o=c8,ReactionSelectorExtendedList:s=A7.ExtendedList}=q(`ReactionSelector`),{closeReactionSelectorOnClick:c,handleReaction:l,message:u,threadList:f}=o6(`ReactionSelector`),{t:p}=Y(`ReactionSelector`),m=t??A7.getDialogId({messageId:u.id,threadList:f}),{dialog:h}=$B({id:m}),g=n??l,_=r??u?.own_reactions??k7,v=(0,d.useMemo)(()=>{let e={};for(let n of _){var t;e[t=n.type]??(e[t]=n)}return e},[_]),y=(0,d.useMemo)(()=>Array.isArray(o)?o:Object.entries(o.quick).map(([e,{Component:t,name:n,unicode:r}])=>({Component:t,name:n,type:e,unicode:r})),[o]),b=l8(o);return(0,R.jsx)(`div`,{"aria-label":p(`aria/Reaction list`),className:`str-chat__reaction-selector`,"data-testid":`reaction-selector`,role:`group`,children:i?(0,R.jsx)(s,{...e,dialogId:m,handleReaction:async(e,t)=>{await g(e,t),c&&h.close()}}):(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(`ul`,{className:`str-chat__reaction-selector-list`,"data-testid":`reaction-selector-list`,children:y.map(({Component:e,name:t,type:n})=>(0,R.jsx)(`li`,{className:`str-chat__reaction-list-selector__item`,children:(0,R.jsx)(`button`,{"aria-label":p(`aria/Select Reaction: {{ reactionName }}`,{reactionName:t||n}),"aria-pressed":v[n]!==void 0,className:G(`str-chat__reaction-selector-list__item-button`),"data-testid":`select-reaction-button`,"data-text":n,onClick:e=>{g(n,e),c&&h.close()},type:`button`,children:(0,R.jsx)(`span`,{className:`str-chat__reaction-icon`,children:(0,R.jsx)(e,{})})})},n))}),b&&(0,R.jsx)(nH,{appearance:`outline`,"aria-label":p(`aria/Open Reaction Selector`),circular:!0,className:`str-chat__reaction-selector__add-button`,"data-testid":`reaction-selector-add-button`,onClick:()=>{a(!0)},size:`sm`,variant:`secondary`,children:(0,R.jsx)(_U,{})})]})})};A7.getDialogId=({messageId:e,threadList:t})=>`reaction-selector${t?`-thread`:``}-${e}`,A7.displayName=`ReactionSelector`,A7.ExtendedList=function({dialogId:e,handleReaction:t,own_reactions:n}){let{reactionOptions:r=c8}=q(`ReactionSelector.ExtendedList`),{closeReactionSelectorOnClick:i,handleReaction:a,message:o}=o6(`ReactionSelector`),{t:s}=Y(`ReactionSelector`),c=t??a,l=n??o?.own_reactions??k7,{dialog:u}=$B({id:e||``}),f=(0,d.useMemo)(()=>{let e={};for(let n of l){var t;e[t=n.type]??(e[t]=n)}return e},[l]);return Array.isArray(r)||!r.extended?null:(0,R.jsx)(`div`,{"aria-label":s(`aria/Reaction list`),className:`str-chat__reaction-selector-extended-list`,"data-testid":`reaction-selector-extended-list`,role:`group`,children:Object.entries(r.extended).map(([e,{Component:t,name:n}])=>(0,R.jsx)(`button`,{"aria-label":s(`aria/Select Reaction: {{ reactionName }}`,{reactionName:n||e}),"aria-pressed":f[e]!==void 0,className:`str-chat__reaction-selector-extended-list__button str-chat__button str-chat__button--ghost str-chat__button--size-sm str-chat__button--circular`,"data-testid":`select-reaction-button`,"data-text":e,onClick:t=>{c(e,t),i&&u.close()},type:`button`,children:(0,R.jsx)(`span`,{className:`str-chat__reaction-icon`,children:(0,R.jsx)(t,{})})},e))})};function PSe(e){let{addNotification:t}=GG(),{handleFetchReactions:n}=o6(`useFetchReactions`),{t:r}=Y(`useFetchReactions`),[i,a]=(0,d.useState)([]),{handleFetchReactions:o,reactionType:s,shouldFetch:c,sort:l}=e,[u,f]=(0,d.useState)(c),p=o??n,[m,h]=(0,d.useState)(null);return(0,d.useEffect)(()=>{if(!c)return;let e=!1;return(async()=>{try{f(!0);let t=await p(s??void 0,l);e||a(t)}catch(n){e||(a([]),t({emitter:`Reactions`,error:n instanceof Error?n:void 0,message:r(`Error fetching reactions`),severity:`error`,type:`api:message:reactions:fetch:failed`}))}finally{e||f(!1)}})(),()=>{e=!0}},[t,p,s,m,c,l,r]),{isLoading:u,reactions:i,refetch:(0,d.useCallback)(()=>{h(Math.random())},[])}}var FSe={created_at:-1},ISe=()=>(0,R.jsx)(R.Fragment,{children:(0,d.useMemo)(()=>Array.from({length:3},(e,t)=>(0,R.jsxs)(`div`,{className:`str-chat__message-reactions-detail__skeleton-item`,children:[(0,R.jsx)(`div`,{className:`str-chat__message-reactions-detail__skeleton-avatar`}),(0,R.jsx)(`div`,{className:`str-chat__message-reactions-detail__skeleton-line`})]},t)),[])}),j7=({handleFetchReactions:e,handleReaction:t,onSelectedReactionTypeChange:n,own_reactions:r,reactionDetail
502sSort:i,reactionGroups:a,reactions:o,selectedReactionType:s,totalReactionCount:c})=>{let[l,u]=(0,d.useState)(!1),{client:f}=K(),{Avatar:p=k6,LoadingIndicator:m=ISe,reactionOptions:h=c8,ReactionSelectorExtendedList:g=A7.ExtendedList}=q(j7.name),{t:_}=Y(),{handleReaction:v,message:y,reactionDetailsSort:b}=o6(j7.name),x=i??b??FSe,S=l8(h),{isLoading:C,reactions:w,refetch:T}=PSe({handleFetchReactions:e,reactionType:s,shouldFetch:!0,sort:x}),E=e=>Array.isArray(h)?h.find(t=>t.type===e)?.name??e:h.quick[e]?.name??h.extended?.[e]?.name??e;return l?(0,R.jsx)(`div`,{className:`str-chat__message-reactions-detail`,"data-testid":`message-reactions-detail`,children:(0,R.jsx)(g,{dialogId:j7.getDialogId({messageId:y.id}),handleReaction:t,own_reactions:r})}):(0,R.jsxs)(`div`,{className:`str-chat__message-reactions-detail`,"data-testid":`message-reactions-detail`,children:[typeof c==`number`&&(0,R.jsx)(`div`,{className:`str-chat__message-reactions-detail__total-count`,children:_(`{{ count }} reactions`,{count:c})}),(0,R.jsx)(`div`,{className:`str-chat__message-reactions-detail__reaction-type-list-container`,children:(0,R.jsxs)(`ul`,{className:`str-chat__message-reactions-detail__reaction-type-list`,"data-testid":`reaction-type-list`,children:[S&&(0,R.jsx)(`li`,{className:`str-chat__message-reactions-detail__reaction-type-list-item`,children:(0,R.jsx)(`button`,{"aria-label":_(`Add reaction`),className:`str-chat__message-reactions-detail__reaction-type-list-item-button`,"data-testid":`add-reaction-button`,onClick:()=>u(!0),type:`button`,children:(0,R.jsx)(`span`,{className:`str-chat__message-reactions-detail__reaction-type-list-item-icon`,children:(0,R.jsx)(KH,{})})})}),o.map(({EmojiComponent:e,reactionCount:t,reactionType:r})=>e&&(0,R.jsx)(`li`,{className:`str-chat__message-reactions-detail__reaction-type-list-item`,children:(0,R.jsxs)(`button`,{"aria-label":_(`aria/Select Reaction: {{ reactionName }}`,{reactionName:r}),"aria-pressed":r===s,className:`str-chat__message-reactions-detail__reaction-type-list-item-button`,onClick:()=>n?.(s===r?null:r),type:`button`,children:[(0,R.jsx)(`span`,{className:`str-chat__message-reactions-detail__reaction-type-list-item-icon`,children:(0,R.jsx)(e,{})}),(0,R.jsx)(`span`,{className:`str-chat__message-reactions-detail__reaction-type-list-item-count`,"data-testid":`reaction-type-count`,children:t})]})},r))]})}),(0,R.jsx)(`div`,{className:`str-chat__message-reactions-detail__user-list-container`,children:(0,R.jsxs)(`div`,{className:`str-chat__message-reactions-detail__user-list`,"data-testid":`all-reacting-users`,children:[C&&(0,R.jsx)(m,{}),!C&&(0,R.jsx)(R.Fragment,{children:w.map(({type:e,user:t})=>{let r=f.user?.id===t?.id,i=E(e),o=Array.isArray(h)?void 0:h.quick[e]?.Component??h.extended?.[e]?.Component;return(0,R.jsxs)(`div`,{className:`str-chat__message-reactions-detail__user-list-item`,children:[(0,R.jsx)(p,{className:`str-chat__avatar--with-border`,"data-testid":`avatar`,imageUrl:t?.image,size:`md`,userName:t?.name||t?.id}),(0,R.jsxs)(`div`,{className:`str-chat__message-reactions-detail__user-list-item-info`,children:[(0,R.jsx)(`span`,{className:`str-chat__message-reactions-detail__user-list-item-username`,"data-testid":`reaction-user-username`,children:r?_(`You`):t?.name||t?.id}),r&&(0,R.jsx)(`button`,{"aria-label":_(`Tap to remove: {{ reactionName }}`,{reactionName:i}),className:`str-chat__message-reactions-detail__user-list-item-button`,"data-testid":`remove-reaction-button`,onClick:async t=>{let r=a?.[e]?.count??0;await v(e,t),s!==null&&r<=1?n?.(null):T()},type:`button`,children:_(`Tap to remove`)})]}),(0,R.jsx)(`span`,{className:`str-chat__message-reactions-detail__user-list-item-icon`,children:!s&&o&&(0,R.jsx)(o,{})})]},`${t?.id}-${e}`)})})]})})]})};j7.displayName=`MessageReactionsDetail`,j7.getDialogId=({messageId:e})=>`message-reactions-detail-${e}`;var LSe=(e,t)=>e.firstReactionAt&&t.firstReactionAt?e.firstReactionAt-+t.firstReactionAt:e.reactionType.localeCompare(t.reactionType,`en`),RSe=e=>{let{own_reactions:t,reaction_groups:n,reactions:r,sortReactions:i}=e,{message:a,sortReactions:o}=o6(`useProcessReactions`),{reactionOptions:s=c8}=q(`useProcessReactions`),c=i??o??LSe,l=r??a.latest_reactions,u=t??a?.own_reactions,f=n??a?.reaction_groups??void 0,p=(0,d.useCallback)(e=>u?.some(t=>t.type===e)??!1,[u]),m=(0,d.useCallback)(e=>Array.isArray(s)?s.find(({type:t})=>t===e)?.Component??null:s.quick[e]?.Component??s.extended?.[e]?.Component??null,[s]),h=(0,d.useCallback)(e=>Array.isArray(s)?s.some(t=>t.type===e):s.quick[e]!==void 0||s.extended?.[e]!==void 0,[s]),g=(0,d.useMemo)(()=>f?Object.keys(f).filter(e=>h(e)).length:0,[h,f]),_=(0,d.useMemo)(()=>{let e=new Map;if(!l)return e;for(let t of l){if(!t.type)continue;let n=t.user?.name||t.user?.id;if(!n)continue;let r=e.get(t.type);r?r.push(n):e.set(t.type,[n])}return e},[l]),v=(0,d.useMemo)(()=>f?Object.entries(f).flatMap(([e,{count:t,first_reaction_at:n,last_reaction_at:r}])=>{if(t===0||!h(e))return[];let i=_.get(e)??[];return[{EmojiComponent:m(e),firstReactionAt:n?new Date(n):null,isOwnReaction:p(e),lastReactionAt:r?new Date(r):null,latestReactedUserNames:i,reactionCount:t,reactionType:e,unlistedReactedUserCount:t-i.length}]}).sort(c):[],[m,_,p,h,f,c]);return{existingReactions:v,hasReactions:v.length>0,reactionGroups:f,totalReactionCount:(0,d.useMemo)(()=>Object.values(f??{}).reduce((e,{count:t})=>e+t,0),[f]),uniqueReactionTypeCount:g}},M7=({buttonIf:e=!1,children:t,type:n=`button`,...r})=>e?(0,R.jsx)(`button`,{...r,type:n,children:t}):(0,R.jsx)(R.Fragment,{children:t}),zSe=d.memo(e=>{let{capLimit:{clustered:t=5,segmented:n=4}={},flipHorizontalPosition:r=!1,handleFetchReactions:i,reactionDetail
502sSort:a,verticalPosition:o=`top`,visualStyle:s=`clustered`,...c}=e,{existingReactions:l,hasReactions:u,reactionGroups:f,totalReactionCount:p,uniqueReactionTypeCount:m}=RSe(c),[h,g]=(0,d.useState)(null),{t:_}=Y(`MessageReactions`),{MessageReactionsDetail:v=j7}=q(),{isMyMessage:y,message:b}=o6(`MessageReactions`),x=(0,d.useRef)(null),S=j7.getDialogId({messageId:b.id}),{dialog:C,dialogManager:w}=$B({id:S}),T=nV(S,w?.id),E=e=>{p>1e3||(g(e),C.open())},D=(0,d.useMemo)(()=>{if(s===`segmented`&&o!==`top`)return null;let e=s===`segmented`?n:t,r=l.slice(0,e);return{reactionCountToDisplay:r.reduce((e,{reactionCount:t})=>e+t,0),reactionsToDisplay:r}},[t,n,l,o,s]);return u?(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(`div`,{"aria-label":_(`aria/Reaction list`),className:G(`str-chat__message-reactions`,{"str-chat__message-reactions--flipped-horizontally":r,[`str-chat__message-reactions--${o}`]:typeof o==`string`,[`str-chat__message-reactions--${s}`]:typeof s==`string`}),ref:x,role:`figure`,children:(0,R.jsxs)(M7,{"aria-expanded":T,"aria-label":_(`aria/Reaction list`),"aria-pressed":T,buttonIf:s===`clustered`,className:`str-chat__message-reactions__list-button`,"data-testid":`message-reactions-list-button`,onClick:()=>E(null),children:[(0,R.jsxs)(`ul`,{className:`str-chat__message-reactions__list`,children:[(D?.reactionsToDisplay??l).map(({EmojiComponent:e,reactionCount:t,reactionType:n})=>e&&(0,R.jsx)(`li`,{className:`str-chat__message-reactions__list-item`,"data-testid":`message-reactions-list-item`,children:(0,R.jsxs)(M7,{"aria-label":_(`aria/Select Reaction: {{ reactionName }}`,{reactionName:n}),buttonIf:s===`segmented`,className:`str-chat__message-reactions__list-item-button`,onClick:()=>E(n),children:[(0,R.jsx)(`span`,{className:`str-chat__message-reactions__list-item-icon`,"data-testid":`message-reactions-list-item-icon`,children:(0,R.jsx)(e,{})}),s===`segmented`&&t>1&&(0,R.jsx)(`span`,{className:`str-chat__message-reactions__list-item-count`,"data-testclass":`message-reactions-item-count`,children:t})]})},n)),m>4&&D&&s===`segmented`&&(0,R.jsx)(`li`,{className:`str-chat__message-reactions__list-item str-chat__message-reactions__list-item--more`,children:(0,R.jsx)(`button`,{"aria-label":_(`aria/Reaction list`),className:`str-chat__message-reactions__list-item-button`,onClick:()=>E(null),type:`button`,children:(0,R.jsxs)(`span`,{className:`str-chat__message-reactions__overflow-count`,children:[`+`,p-D.reactionCountToDisplay]})})})]}),s===`clustered`&&(0,R.jsx)(`span`,{className:`str-chat__message-reactions__total-count`,"data-testid":`message-reactions-total-count`,children:p})]})}),(0,R.jsx)(D6,{dialogManagerId:w?.id,id:S,offset:8,placement:y()?`bottom-end`:`bottom-start`,referenceElement:x.current,trapFocus:!0,updatePositionOnContentResize:!0,children:(0,R.jsx)(v,{handleFetchReactions:i,onSelectedReactionTypeChange:g,reactionDetailsSort:a,reactionGroups:f,reactions:l,selectedReactionType:h,totalReactionCount:p})})]}):null}),BSe=({ReactionIcon:e})=>{let{t}=Y(`ReactionSelectorWithButton`),{isMyMessage:n,message:r,threadList:i}=o6(`MessageOptions`),{ReactionSelector:a=A7}=q(`MessageOptions`),o=(0,d.useRef)(null),s=A7.getDialogId({messageId:r.id,threadList:i}),{dialog:c,dialogManager:l}=$B({id:s}),u=nV(s,l?.id);return(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(D6,{dialogManagerId:l?.id,id:s,offset:8,placement:n()?`top-end`:`top-start`,referenceElement:o.current,trapFocus:!0,updatePositionOnContentResize:!0,children:(0,R.jsx)(a,{})}),(0,R.jsx)(L7,{"aria-expanded":u,"aria-label":t(`aria/Open Reaction Selector`),className:`str-chat__message-reactions-button`,"data-testid":`message-reaction-action`,onClick:()=>
502c?.toggle(),ref:o,children:(0,R.jsx)(e,{className:`str-chat__message-action-icon`})})]})},VSe=(e,t)=>e instanceof Error&&e.message?e.message:t,HSe=e=>{if(e instanceof Error)return e;if(typeof e==`string`)return Error(e);if(e&&typeof e==`object`&&`message`in e){let t=e.message;if(typeof t==`string`)return Error(t)}},USe=()=>{let{t:e}=Y(),{returnToParentMenu:t}=H6();return(0,R.jsx)(I6,{children:(0,R.jsxs)(F6,{onClick:t,children:[(0,R.jsx)(AH,{}),(0,R.jsx)(`span`,{children:e(`Remind Me`)})]})})},WSe=()=>{let{t:e}=Y(),{client:t}=K(),{message:n}=o6(),{closeMenu:r}=H6(),{addNotification:i}=GG();return(0,R.jsx)(`div`,{"aria-label":e(`aria/Remind Me Options`),className:`str-chat__message-actions-box__submenu`,role:`menu`,children:t.reminders.scheduledOffsetsMs.map(a=>(0,R.jsx)(P6,{className:`str-chat__message-actions-list-item-button`,onClick:async()=>{try{await t.reminders.upsertReminder({messageId:n.id,remind_at:new Date(new Date().getTime()+a).toISOString()}),i({context:{message:n},emitter:`MessageActions`,message:e(`Reminder set`),severity:`success`,type:`api:message:reminder:set:success`})}catch(e){i({context:{message:n},emitter:`MessageActions`,error:HSe(e),message:VSe(e,`Error setting reminder`),severity:`error`,type:`api:message:reminder:set:failed`})}finally{r()}},children:e(`duration/Remind Me`,{milliseconds:a})},`reminder-offset-option--${a}`))})},N7=e=>{if(!e||typeof e!=`object`)return!1;let t=e;return pb(t)||mb(t)||yb(t)||gb(t)||_b(t)},P7=({filename:e,openInNewTab:t,revokeObjectUrl:n,url:r})=>{let i=document.createElement(`a`);i.download=e,i.href=r,i.rel=`noopener noreferrer`,t&&!r.startsWith(`blob:`)&&(i.target=`_blank`),document.body.append(i),i.click(),i.remove(),(n??r.startsWith(`blob:`))&&r.startsWith(`blob:`)&&setTimeout(()=>URL.revokeObjectURL(r),0)},GSe=async e=>{if(typeof fetch!=`function`)return null;let t=await fetch(e);if(!t.ok)throw Error(`Failed to fetch attachment, status ${t.status}`);let n=await t.blob();return URL.createObjectURL(n)},F7=async(e,t={})=>{let{openRemoteInNewTab:n=!0,preferRemoteFetch:r=!0}=t,i=e.title??`downloaded-attachment`,a=e.localMetadata?.file;if(a instanceof Blob){P7({filename:a instanceof File&&a.name?a.name:i,url:URL.createObjectURL(a)});return}let o=a&&typeof a==`object`&&`name`in a&&typeof a.name==`string`?a.name:i,s=e.asset_url??e.image_url;if(s){if(r)try{let e=await GSe(s);if(e){P7({filename:o,url:e});return}}catch{}P7({filename:o,openInNewTab:n,url:s})}},KSe=async e=>{for(let t of e)await F7(t,{openRemoteInNewTab:!0,preferRemoteFetch:!0})},I7=`str-chat__message-actions-list-item-button`,qSe=()=>{let{returnToParentMenu:e}=H6(),{t}=Y();return(0,R.jsx)(I6,{children:(0,R.jsxs)(F6,{onClick:e,children:[(0,R.jsx)(AH,{}),(0,R.jsx)(`span`,{children:t(`Download Attachment`)})]})})},JSe=()=>{let{closeMenu:e}=H6(),{message:t}=o6(),{t:n}=Y(),r=(t.attachments??[]).filter(N7);return(0,R.jsxs)(`div`,{"aria-label":n(`aria/Download attachment`),className:`str-chat__message-actions-box__submenu str-chat__message-actions-box__submenu--download-attachments`,role:`menu`,children:[r.map((t,r)=>{let i=t.localMetadata?.file?.name??t.title??n(`Download Attachment`);return(0,R.jsx)(P6,{className:I7,Icon:UH,onClick:()=>{F7(t),e()},children:`Download ${i}`},t.localMetadata?.id??t.asset_url??t.image_url??`${i}-${r}`)}),(0,R.jsx)(P6,{className:I7,Icon:UH,onClick:()=>{KSe(r),e()},children:n(`Download All`)})]})},L7=(0,d.forwardRef)(function({className:e,...t},n){return(0,R.jsx)(nH,{appearance:`ghost`,circular:!0,className:G(`str-chat__message-actions-box-button`,e),ref:n,size:`sm`,variant:`secondary`,...t})}),YSe=({onCancel:e,onDelete:t})=>{let{t:n}=Y(),{close:r}=h6();return(0,R.jsxs)(T6.Root,{className:`str-chat__delete-message-alert`,"data-testid":`message-delete-alert`,children:[(0,R.jsx)(T6.Header,{description:n(`Are you sure you want to delete this message?`),title:n(`Delete message`)}),(0,R.jsxs)(T6.Actions,{children:[(0,R.jsx)(nH,{appearance:`outline`,className:`str-chat__delete-message-alert__delete-button`,"data-testid":`delete-message-alert-delete-button`,onClick:t,size:`md`,variant:`danger`,children:n(`Delete message`)}
502),(0,R.jsx)(nH,{appearance:`outline`,autoFocus:!0,className:`str-chat__delete-message-alert__cancel-button`,"data-testid":`delete-message-alert-cancel-button`,onClick:()=>{e(),r()},size:`md`,variant:`secondary`,children:n(`Cancel`)})]})]})},R7=`str-chat__message-actions-list-item-button`,z7=e=>(0,R.jsx)(P6,{...e}),B7=(e,t)=>e instanceof Error&&e.message?e.message:t,V7=e=>{if(e instanceof Error)return e;if(typeof e==`string`)return Error(e);if(e&&typeof e==`object`&&`message`in e){let t=e.message;if(typeof t==`string`)return Error(t)}},H7={dropdown:{React(){let{ReactionSelector:e=A7}=q(),{anchorReferenceElement:t}=H6(),{isMyMessage:n,message:r,threadList:i}=o6(),{t:a}=Y(),[o,s]=(0,d.useState)(null),c=`${A7.getDialogId({messageId:r.id,threadList:i})}-dropdown`,{dialog:l,dialogManager:u}=$B({id:c}),f=nV(c,u?.id);return(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(D6,{dialogManagerId:u?.id,id:c,offset:8,placement:n()?`top-end`:`top-start`,referenceElement:o,trapFocus:!0,updatePositionOnContentResize:!0,children:(0,R.jsx)(e,{dialogId:c})}),(0,R.jsx)(z7,{"aria-expanded":f,"aria-label":a(`aria/Open Reaction Selector`),className:G(R7,`str-chat__message-actions-list-item-button--react`),"data-testid":`dropdown-react-action`,Icon:GH,onClick:e=>{if(f){l.close();return}s(t instanceof HTMLElement?t:e.currentTarget),l.open()},children:a(`Add reaction`)})]})},ThreadReply(){let{closeMenu:e}=H6(),{handleOpenThread:t}=o6(),{t:n}=Y();return(0,R.jsx)(z7,{"aria-label":n(`aria/Open Thread`),className:R7,"data-testid":`thread-action`,Icon:xH,onClick:n=>{t(n),e()},children:n(`Thread Reply`)})},Quote(){let{closeMenu:e}=H6(),{message:t}=o6(),{t:n}=Y(),r=IW(),i=()=>{r.setQuotedMessage(t);let e=(t.parent_id?document.querySelectorAll(`.str-chat__thread .str-chat__textarea__textarea`):document.getElementsByClassName(`str-chat__textarea__textarea`)).item(0);e instanceof HTMLTextAreaElement&&e.focus()};return(0,R.jsx)(z7,{"aria-label":n(`aria/Quote Message`),className:R7,Icon:LH,onClick:()=>{i(),e()},children:n(`Quote Reply`)})},Download(){let{closeMenu:e,openSubmenu:t}=H6(),{message:n}=o6(),{t:r}=Y(),i=(n.attachments??[]).filter(N7);return i.length?(0,R.jsx)(z7,{"aria-label":r(`aria/Download attachment`),className:R7,hasSubMenu:i.length>1,Icon:UH,onClick:n=>{if(i.length>1){t({focusReturnTarget:n.currentTarget,Header:qSe,Submenu:JSe});return}F7(i[0]),e()},children:r(`Download Attachment`)}):null},Pin(){let{closeMenu:e}=H6(),{handlePin:t,message:n}=o6(),{addNotification:r}=GG(),{t:i}=Y(),a=!!n.pinned;return(0,R.jsx)(z7,{"aria-label":i(a?`aria/Unpin Message`:`aria/Pin Message`),className:R7,Icon:a?TU:hU,onClick:async o=>{try{await t(o),r({context:{message:n},emitter:`MessageActions`,message:i(a?`Message unpinned`:`Message pinned`),severity:`success`,type:a?`api:message:unpin:success`:`api:message:pin:success`})}catch(e){r({context:{message:n},emitter:`MessageActions`,error:V7(e),message:B7(e,i(a?`Error removing message pin`:`Error pinning message`)),severity:`error`,type:a?`api:message:unpin:failed`:`api:message:pin:failed`})}e()},children:i(a?`Unpin`:`Pin`)})},CopyMessageText(){let{closeMenu:e}=H6(),{message:t}=o6(),{t:n}=Y();return(0,R.jsx)(z7,{"aria-label":n(`aria/Copy Message Text`),className:R7,Icon:bU,onClick:()=>{t.text&&navigator.clipboard.writeText(t.text),e()},children:n(`Copy Message`)})},Resend(){let{closeMenu:e}=H6(),{handleRetry:t,message:n}=o6(),{t:r}=Y();return(0,R.jsx)(z7,{"aria-label":r(`aria/Resend Message`),className:R7,Icon:uH,onClick:()=>{t(n),e()},children:r(`Resend`)})},Edit(){let e=IW(),{message:t}=o6(),{t:n}=Y(),{closeMenu:r}=H6();return(0,R.jsx)(z7,{"aria-label":n(`aria/Edit Message`),className:R7,Icon:WH,onClick:()=>{c6(e),e.initState({composition:t}),r()},children:n(`Edit Message`)})},MarkUnread(){let{closeMenu:e}=H6(),{handleMarkUnread:t,message:n}=o6(),{addNotification:r}=GG(),{t:i}=Y();return(0,R.jsx)(z7,{"aria-label":i(`aria/Mark Message Unread`),className:R7,Icon:CH,onClick:async a=>{try{await t(a),r({context:{message:n},emitter:`MessageActions`,message:i(`Message marked as unread`),severity:`success`,type:`api:message:markUnread:success`})}catch(e){r({context:{message:n},emitter:`MessageActions`,error:V7(e),message:B7(e,i(`Error marking message unread. Cannot mark unread messages older than the newest 100 channel messages.`)),severity:`error`,type:`api:message:markUnread:failed`})}e()},children:i(`Mark as unread`)})},RemindMe(){let{closeMenu:e,openSubmenu:t}=H6(),{client:n}=K(),{addNotification:r}=GG(),{t:i}=Y(),{message:a}=o6(),o=d8(a.id);return o&&!o?.remindAt?null:(0,R.jsx)(z7,{"aria-label":i(o?`aria/Remind Me Message`:`aria/Remove Reminder`),className:R7,hasSubMenu:!o,Icon:o?hH:mH,onClick:async s=>{if(o)try{await n.reminders.deleteReminder(o.id),r({context:{message:a},emitter:`MessageActions`,message:i(`Remove reminder`),severity:`success`,type:`api:message:reminder:delete:success`})}catch(e){r({context:{message:a},emitter:`MessageActions`,error:V7(e),message:B7(e,`Error removing reminder`),severity:`error`,type:`api:message:reminder:delete:failed`})}finally{e()}else t({focusReturnTarget:s.currentTarget,Header:USe,Submenu:WSe})},children:i(o?`Remove reminder`:`Remind me`)})},SaveForLater(){let{closeMenu:e}=H6(),{client:t}=K(),{addNotification:n}=GG(),{message:r}=o6(),{t:i}=Y(),a=d8(r.id);return a&&a?.remindAt?null:(0,R.jsx)(z7,{"aria-label":i(a?`aria/Remove Save For Later`:`aria/Bookmark Message`),className:R7,Icon:a?_H:gH,onClick:async()=>{try{a?(await t.reminders.deleteReminder(a.id),n({context:{message:r},emitter:`MessageActions`,message:i(`Remove save for later`),severity:`success`,type:`api:message:saveForLater:delete:success`})):(await t.reminders.createReminder({messageId:r.id}),n({context:{message:r},emitter:`MessageActions`,message:i(`Saved for later`),severity:`success`,type:`api:message:saveForLater:create:success`}))}catch(e){n({context:{message:r},emitter:`MessageActions`,error:V7(e),message:B7(e,a?`Error removing message from saved for later`:`Error saving message for later`),severity:`error`,type:a?`api:message:saveForLater:delete:failed`:`api:message:saveForLater:create:failed`})}finally{e()}},children:i(a?`Remove save for later`:`Save for later`)})},Flag(){let{closeMenu:e}=H6(),{handleFlag:t,message:n}=o6(),{addNotification:r}=GG(),{t:i}=Y();return(0,R.jsx)(z7,{"aria-label":i(`aria/Flag Message`),className:R7,Icon:tU,onClick:async a=>{try{await t(a),r({context:{message:n},emitter:`MessageActions`,message:i(`Message has been successfully flagged`),severity:`success`,type:`api:message:flag:success`})}catch(e){r({context:{message:n},emitter:`MessageActions`,error:V7(e),message:B7(e,i(`Error adding flag`)),severity:`error`,type:`api:message:flag:failed`})}e()},children:i(`Flag`)})},Mute(){let{closeMenu:e}=H6(),{handleMute:t,message:n}=o6(),{addNotification:r}=GG(),{mutes:i}=K(),{t:a}=Y(),o=XU(n,i);return(0,R.jsx)(z7,{"aria-label":a(o?`aria/Unmute User`:`aria/Mute User`),className:R7,Icon:o?OU:sU,onClick:async i=>{try{await t(i),r({context:{message:n},emitter:`MessageActions`,message:a(o?`{{ user }} has been unmuted`:`{{ user }} has been muted`,{user:n.user?.name||n.user?.id}),severity:`success`,type:o?`api:user:unmute:success`:`api:user:mute:success`})}catch(e){r({context:{message:n},emitter:`MessageActions`,error:V7(e),message:B7(e,a(o?`Error unmuting a user ...`:`Error muting a user ...`)),severity:`error`,type:o?`api:user:unmute:failed`:`api:user:mute:failed`})}e()},children:a(o?`Unmute`:`Mute`)})},Delete(){let{closeMenu:e}=H6(),{addNotification:t}=GG(),{Modal:n=f8}=q(),{handleDelete:r,message:i}=o6(),{t:a}=Y(),[o,s]=(0,d.useState)(!1);return _W(i)?null:(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(z7,{"aria-label":a(`aria/Delete Message`),className:R7,Icon:CU,onClick:()=>{s(!0)},variant:`destructive`,children:a(`Delete message`)}),(0,R.jsx)(n,{open:o,role:`alertdialog`,children:(0,R.jsx)(YSe,{onCancel:()=>{s(!1),e()},onDelete:async()=>{try{await r(),t({context:{message:i},emitter:`MessageActions`,message:a(`Message deleted`),severity:`success`,type:`api:message:delete:success`})}catch(e){t({context:{message:i},emitter:`MessageActions`,error:V7(e),message:B7(e,a(`Error deleting message`)),severity:`error`,type:`api:message:delete:failed`})}finally{s(!1),e()}}})})]})},BlockUser(){let{closeMenu:e}=H6(),{client:t}=K(),{message:n}=o6(),{t:r}=Y(),i=!n.user?.id||new Set(t.blockedUsers.getLatestValue().userIds).has(n.user?.id);return(0,R.jsx)(z7,{"aria-label":r(i?`aria/Unblock User`:`aria/Block User`),className:G(R7),Icon:i?pU:MH,onClick:()=>{let r=n.user?.id;r&&(i?t.unBlockUser(r):t.blockUser(r)),e()},children:r(i?`Unblock User`:`Block User`)})}},quick:{DropdownToggle:(0,d.forwardRef)((e,t)=>{let{t:n}=Y(),{message:r,threadList:i}=o6(),a=nV(W7.getDialogId({messageId:r.id})),{dialog:o}=$B({id:W7.getDialogId({messageId:r.id})}),{dialog:s}=$B({id:`${A7.getDialogId({messageId:r.id,threadList:i})}-dropdown`});return(0,R.jsx)(L7,{"aria-expanded":a,"aria-haspopup":`true`,"aria-label":n(`aria/Open Message Actions Menu`),className:`str-chat__message-actions-box-button`,"data-testid":`message-actions-toggle-button`,onClick:()=>
502{s?.close(),o?.toggle()},ref:t,children:(0,R.jsx)(BH,{className:`str-chat__message-action-icon`})})}),React(){return(0,R.jsx)(BSe,{ReactionIcon:GH})},Reply(){let{handleOpenThread:e}=o6(),{t}=Y();return(0,R.jsx)(L7,{"aria-label":t(`aria/Open Thread`),className:`str-chat__message-reply-in-thread-button`,"data-testid":`thread-action`,onClick:e,children:(0,R.jsx)(fH,{className:`str-chat__message-action-icon`})})}}},XSe=[{Component:H7.quick.DropdownToggle,placement:`quick-dropdown-toggle`},{Component:H7.quick.Reply,placement:`quick`,type:`reply`},{Component:H7.quick.React,placement:`quick`,type:`react`},{Component:H7.dropdown.React,placement:`dropdown`,type:`react`},{Component:H7.dropdown.ThreadReply,placement:`dropdown`,type:`reply`},{Component:H7.dropdown.Quote,placement:`dropdown`,type:`quote`},{Component:H7.dropdown.Download,placement:`dropdown`,type:`download`},{Component:H7.dropdown.Pin,placement:`dropdown`,type:`pin`},{Component:H7.dropdown.CopyMessageText,placement:`dropdown`,type:`copyMessageText`},{Component:H7.dropdown.Resend,placement:`dropdown`,type:`resendMessage`},{Component:H7.dropdown.Edit,placement:`dropdown`,type:`edit`},{Component:H7.dropdown.MarkUnread,placement:`dropdown`,type:`markUnread`},{Component:H7.dropdown.RemindMe,placement:`dropdown`,type:`remindMe`},{Component:H7.dropdown.SaveForLater,placement:`dropdown`,type:`saveForLater`},{Component:H7.dropdown.Flag,placement:`dropdown`,type:`flag`},{Component:H7.dropdown.Mute,placement:`dropdown`,type:`mute`},{Component:H7.dropdown.Delete,placement:`dropdown`,type:`delete`},{Component:H7.dropdown.BlockUser,placement:`dropdown`,type:`blockUser`}],U7=e=>(0,d.useMemo)(()=>{let t=[],n=[],r;for(let i of e)i.placement===`quick`&&t.push(i),i.placement===`dropdown`&&n.push(i),i.placement===`quick-dropdown-toggle`&&(r??=i);return{dropdownActionSet:n,quickActionSet:t,quickDropdownToggleAction:r}},[e]),W7=({disableBaseMessageActionSetFilter:e=!1,messageActionSet:t=XSe})=>{let{isMyMessage:n,message:r,threadList:i}=o6(),{ContextMenu:a=U6}=q(),{t:o}=Y(),[s,c]=(0,d.useState)(null),{dropdownActionSet:l,quickActionSet:u,quickDropdownToggleAction:f}=U7(Sge(t,e)),p=W7.getDialogId({messageId:r.id}),m=A7.getDialogId({messageId:r.id,threadList:i}),h=`${m}-dropdown`,{dialog:g,dialogManager:_}=$B({id:p}),v=nV(p,_?.id),y=nV(m,_?.id),b=nV(h,_?.id);return l.length+u.length===0?null:(0,R.jsxs)(`div`,{className:G(`str-chat__message-options`,{"str-chat__message-options--active":v||y||b}),children:[f&&l.length>0&&(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(f.Component,{ref:c}),(0,R.jsx)(a,{"aria-label":o(`aria/Message Actions`),backLabel:o(`Back`),className:G(`str-chat__message-actions-box`,{"str-chat__message-actions-box--hidden":b,"str-chat__message-actions-box--open":v}),dialogManagerId:_?.id,id:p,onClose:g?.close,placement:n()?`top-end`:`top-start`,referenceElement:s,tabIndex:-1,trapFocus:!0,children:l.map(({Component:e,type:t})=>(0,R.jsx)(e,{},t))})]}),u.map(({Component:e,type:t})=>(0,R.jsx)(e,{},t))]})};W7.getDialogId=({messageId:e})=>`message-actions-${e}`,W7.displayName=`MessageActions`;var ZSe=d.memo(({endOfGroup:e,firstOfGroup:t,groupedByUser:n,handleAction:r,handleOpenThread:i,highlighted:a,isMessageAIGenerated:o,isMyMessage:s,message:c,onUserClick:l,onUserHover:u,renderText:f,showAvatar:p=`incoming`,threadList:m})=>{let{channel:h}=KB(),{client:g}=K(),{t:_}=Y(`MessageUI`),[v,y]=(0,d.useState)(!1),b=d8(c.id),{Attachment:x=Nve,Avatar:S=k6,MessageActions:C=W7,MessageAlsoSentInChannelIndicator:w=Cge,MessageBlocked:T=xge,MessageBouncePrompt:E=yge,MessageDeleted:D,MessageDeletedBubble:O=bge,MessageEditedIndicator:k=Qge,MessageReactions:A=zSe,MessageRepliesCountButton:j=m8,MessageStatus:M=Ege,MessageTimestamp:N=E8,MessageTranslationIndicator:P=$ge,PinIndicator:ee=Tge,QuotedMessage:F=Eye,ReminderNotification:te=jye,StreamedMessageText:ne=Mye}=q(`MessageUI`),re=(0,d.useMemo)(()=>o?.(c),[o,c]),I=_W(c),ie=(0,d.useMemo)(()=>!c.shared_location&&!c.attachments?[]:c.shared_location?[c.shared_location,...c.attachments??[]]:c.attachments,[c]);if(qW(c))return null;if(D&&I)return(0,R.jsx)(D,{message:c});if(gW(c))return(0,R.jsx)(T,{});let ae=c.poll_id&&g.polls.fromState(c.poll_id),oe=Object.keys(h?.state?.members??{}).length,L=!I&&oW(c),se=!I&&sW(c),ce=!I&&cW(c),le=!I&&iW(c),ue=!I&&aW(c),de=!I&&fW(c),fe=pW(c),pe=hW(c),me=vW(c)&&!re,he=!n||e,ge=!m&&!!c.reply_count,_e=G(`str-chat__message`,`str-chat__message--${c.type}`,`str-chat__message--${c.status}`,{"str-chat__message--has-attachment":L,"str-chat__message--has-giphy-attachment":ce,"str-chat__message--has-no-text":!c.text,"str-chat__message--has-quoted-message":ue,"str-chat__message--has-single-attachment":se,"str-chat__message--has-text":!!c.text,"str-chat__message--highlighted":a,"str-chat__message--is-emoji-only":de,[`str-chat__message--is-emoji-only-count-${dW(c.text)}`]:de,"str-chat__message--me":s(),"str-chat__message--other":!s(),"str-chat__message--pinned":c.pinned,"str-chat__message--with-avatar":c.user?p===`incoming`?!s():p===`outgoing`?s():p:!1,"str-chat__message--with-reactions":le,"str-chat__message-send-can-be-retried":c?.status===`failed`&&c?.error?.status!==403,"str-chat__message-with-thread-link":ge,"str-chat__virtual-message__wrapper--end":e,"str-chat__virtual-message__wrapper--first":t,"str-chat__virtual-message__wrapper--group":n}),ve;pe&&(ve=()=>y(!0));let ye=!!ve,be=ye?_(`aria/Review bounced message`):void 0;return(0,R.jsxs)(R.Fragment,{children:[v&&(0,R.jsx)(vge,{MessageBouncePrompt:E,onClose:()=>y(!1),open:v}),(0,R.jsxs)(`div`,{className:_e,children:[c.pinned&&(0,R.jsx)(ee,{message:c}),c.show_in_channel&&(0,R.jsx)(w,{}),!!b&&(0,R.jsx)(te,{reminder:b}),(0,R.jsx)(P,{message:c}),c.user&&(0,R.jsx)(S,{className:`str-chat__avatar--with-border`,imageUrl:c.user.image,onClick:l,onMouseOver:u,size:`md`,userName:c.user.n
502ame||c.user.id}),(0,R.jsxs)(`div`,{"aria-label":be,className:G(`str-chat__message-inner`,{"str-chat__message-inner--error":fe||pe}),"data-testid":`message-inner`,onClick:ve,onKeyDown:ye?e=>{!ve||e.key!==`Enter`&&e.key!==` `||(e.preventDefault(),ve())}:void 0,role:ye?`button`:void 0,tabIndex:ye?0:void 0,children:[!I&&(0,R.jsx)(C,{}),ge&&(0,R.jsx)(j,{onClick:i,reply_count:c.reply_count,thread_participants:c.thread_participants}),I?(0,R.jsx)(O,{}):(0,R.jsxs)(R.Fragment,{children:[(0,R.jsxs)(p8,{children:[ae&&(0,R.jsx)(Abe,{poll:ae}),c.quoted_message&&(0,R.jsx)(F,{}),ie?.length?(0,R.jsx)(x,{actionHandler:r,attachments:ie}):null,re?(0,R.jsx)(ne,{message:c,renderText:f}):(0,R.jsx)(w8,{message:c,renderText:f})]}),(0,R.jsx)(`div`,{className:`str-chat__message-reactions-host`,children:le&&(0,R.jsx)(A,{reverse:!0})}),(0,R.jsx)(`div`,{className:`str-chat__message-error-indicator`,children:(0,R.jsx)(dhe,{})})]})]}),he&&(0,R.jsxs)(`div`,{className:`str-chat__message-metadata`,children:[(0,R.jsx)(M,{}),!s()&&!!c.user&&oe>2&&(0,R.jsx)(`span`,{className:`str-chat__message-metadata__name`,children:c.user.name||c.user.id}),(0,R.jsx)(N,{customClass:`str-chat__message-metadata__timestamp`}),!I&&me&&(0,R.jsx)(k,{})]})]},c.id)]})},rW),G7=e=>(0,R.jsx)(ZSe,{...o6(`MessageUI`),...e}),QSe=d.memo(e=>{let{canPin:t,Message:n,message:r,messageActions:i=Object.keys(QU),onUserClick:a,onUserHover:o,userRoles:s}=e,{client:c,isMessageAIGenerated:l}=K(`Message`),{channelConfig:u,read:f}=KB(`Message`),{Message:p=G7,MessageUI:m=p}=q(`Message`),{getTranslationView:h,setTranslationView:g}=Zme(),_=h(r.id,!!r.i18n),v=(0,d.useCallback)(e=>g(r.id,e),[r.id,g]),y=r.type===`regular`&&r.status===`received`,b=n??m,{onUserClick:x,onUserHover:S}=dge(r,{onUserClickHandler:a,onUserHoverHandler:o}),{canDelete:C,canEdit:w,canFlag:T,canMarkUnread:E,canMute:D,canQuote:O,canReact:k,canReply:A,isMyMessage:j}=s,M=(0,d.useMemo)(()=>!!(!j&&c.user?.id&&f&&(!f[c.user.id]||r?.created_at&&new Date(r.created_at).getTime()>f[c.user.id].last_read.getTime())),[c,j,r.created_at,f]),N=(0,d.useCallback)(()=>$U(i,{canDelete:C,canEdit:w,canFlag:T,canMarkUnread:E,canMute:D,canPin:t,canQuote:O,canReact:k,canReply:A},u),[i,C,w,T,E,D,t,O,k,A,u]),{canPin:P,messageActions:ee,onUserClick:F,onUserHover:te,userRoles:ne,...re}=e;return(0,R.jsx)(Wme,{value:{...re,actionsEnabled:y,getMessageActions:N,isMessageAIGenerated:l,isMyMessage:()=>j,messageIsUnread:M,onUserClick:x,onUserHover:S,setTranslationView:v,translationView:_},children:(0,R.jsx)(b,{})})},nW),K7=e=>{let{closeReactionSelectorOnClick:t,disableQuotedMessages:n,message:r,onMentionsClick:i,onMentionsHover:a,openThread:o,reactionDetailsSort:s,retrySendMessage:c,sortReactions:l}=e,{highlightedMessageId:u,mutes:d}=KB(`Message`),f=Xhe(r),p=ige(r,o),m=lge(r),h=uge(c),g=u8(r,n),_=fge(r),v=Zhe(r),y=$he(r),b=tge(r),x=rge(r),{onMentionsClick:S,onMentionsHover:C}=ege(r,{onMentionsClick:i,onMentionsHover:a}),{canPin:w,handlePin:T}=age(r),E=u===r.id;return(0,R.jsx)(QSe,{additionalMessageComposerProps:e.additionalMessageComposerProps,autoscrollToBottom:e.autoscrollToBottom,canPin:w,closeReactionSelectorOnClick:t,deliveredTo:e.deliveredTo,disableQuotedMessages:e.disableQuotedMessages,formatDate:e.formatDate,groupStyles:e.groupStyles,handleAction:f,handleDelete:v,handleFetchReactions:_,handleFlag:y,handleMarkUnread:b,handleMute:x,handleOpenThread:p,handlePin:T,handleReaction:m,handleRetry:h,highlighted:E,initialMessage:e.initialMessage,lastOwnMessage:e.lastOwnMessage,lastReceivedId:e.lastReceivedId,message:r,Message:e.Message,messageActions:e.messageActions,messageListRect:e.messageListRect,mutes:d,onMentionsClickMessage:S,onMentionsHoverMessage:C,onUserClick:e.onUserClick,onUserHover:e.onUserHover,reactionDetailsSort:s,readBy:e.readBy,renderText:e.renderText,returnAllReadData:e.returnAllReadData,sortReactions:l,threadList:e.threadList,unsafeHTML:e.unsafeHTML,userRoles:g})},$Se=e=>{let{message:t}=e;return(0,R.jsx)(`div`,{className:`giphy-preview-message`,children:(0,R.jsx)(K7,{message:t})})},eCe=e=>{let{channel:t,disableDateSeparator:n,groupStyles:r,headerPosition:i,hideDeletedMessages:a,hideNewMessageSeparator:o,maxTimeBetweenGroupedMessages:s,messages:c,noGroupByUser:l,reviewProcessedMessage:u}=e,{client:f}=K(`useEnrichedMessages`),{HeaderComponent:p}=q(`useEnrichedMessages`),m=(0,d.useMemo)(()=>t.lastRead?.(),[t]),h=!n,g=!h&&!a&&o?c:RW({enableDateSeparator:h,hideDeletedMessages:a,hideNewMessageSeparator:o,lastRead:m,messages:c,reviewProcessedMessage:u,userId:f.userID||``});
502p&&(g=HW(g,i));let _=r||WW;return{messageGroupStyles:(0,d.useMemo)(()=>g.reduce((e,t,n)=>{let r=_(t,g[n-1],g[n+1],l,s);return r&&(e[t.id]=r),e},{}),[s,g,l]),messages:g}},tCe=`.str-chat__date-separator:not(.str-chat__date-separator--floating)`,nCe=100,rCe=({disableDateSeparator:e,listElement:t,processedMessages:n})=>{let[r,i]=(0,d.useState)({date:null,visible:!1}),a=(0,d.useCallback)(()=>{if(e||!t||n.length===0){i({date:null,visible:!1});return}let r=t.querySelectorAll(tCe);if(r.length===0){i({date:null,visible:!1});return}let a=t.getBoundingClientRect(),o=null,s=-1/0;for(let e of r){let t=e.getBoundingClientRect(),n=e.getAttribute(`data-date`);if(n&&t.top<=a.top&&t.top>s){s=t.top;let e=new Date(n);isNaN(e.getTime())||(o=e)}}i({date:o,visible:o!==null})},[e,t,n]);return(0,d.useEffect)(()=>{if(!t)return;let e=(0,PB.default)(a,nCe);if(e(),t.addEventListener(`scroll`,e),typeof ResizeObserver>`u`)return()=>{t.removeEventListener(`scroll`,e),e.cancel()};let n=new ResizeObserver(e);return n.observe(t),()=>{t.removeEventListener(`scroll`,e),n.disconnect(),e.cancel()}},[t,a]),{floatingDate:r.date,showFloatingDate:r.visible}},q7=e=>{let{channel:t,lastOwnMessage:n,messages:r,returnAllReadData:i}=e;return(0,d.useMemo)(()=>i?r.reduce((e,n)=>(e[n.id]=t.messageReceiptsTracker.readersForMessage({msgId:n.id,timestampMs:n.created_at.getTime()}),e),{}):n?{[n.id]:t.messageReceiptsTracker.readersForMessage({msgId:n.id,timestampMs:n.created_at.getTime()})}:{},[t,n,r,i])},J7=e=>{let{channel:t,lastOwnMessage:n,messages:r,returnAllReadData:i}=e,a=(0,d.useCallback)(()=>r.reduce((e,n)=>(e[n.id]=t.messageReceiptsTracker.deliveredForMessage({msgId:n.id,timestampMs:n.created_at.getTime()}),e),{}),[t,r]),o=(0,d.useCallback)(()=>n?{[n.id]:t.messageReceiptsTracker.deliveredForMessage({msgId:n.id,timestampMs:n.created_at.getTime()})}:{},[t,n]),[s,c]=(0,d.useState)(i?a:o);return(0,d.useEffect)(()=>{if(i)return c(a),t.on(`message.delivered`,()=>c(a)).unsubscribe},[t,a,i]),(0,d.useEffect)(()=>{if(!i)return c(o),t.on(`message.delivered`,()=>c(o)).unsubscribe},[t,o,i]),s},iCe=e=>{let{channelUnreadUiState:t,enrichedMessages:n,internalMessageProps:r,lastOwnMessage:i,messageGroupStyles:a,messages:o,renderMessages:s,returnAllReadData:c,threadList:l}=e,{customClasses:u}=K(`useMessageListElements`),{channel:f}=KB(),p=q(`useMessageListElements`),m=q7({channel:f,lastOwnMessage:i,messages:o,returnAllReadData:c}),h=J7({channel:f,lastOwnMessage:i,messages:o,returnAllReadData:c}),g=(0,d.useMemo)(()=>VW(n),[n]);return(0,d.useMemo)(()=>s({channelUnreadUiState:t,components:p,customClasses:u,lastOwnMessage:i,lastReceivedMessageId:g,messageGroupStyles:a,messages:n,ownMessagesDeliveredToOthers:h,readData:m,sharedMessageProps:{...r,returnAllReadData:c,threadList:l}}),[n,r,i,g,a,t,m,s,c,l])},aCe=(e,t)=>e.every((e,n)=>e.id===t[n]?.id),oCe=(e,t)=>e.every((n,r)=>n.id===t[t.length-e.length+r]?.id);function sCe(e){let{captureAnchor:t,disableScrollManagement:n=!1,justReachedLatestMessageSet:r=!1,loadingMore:i=!1,loadMoreScrollThreshold:a,onScrollBy:o,onScrollToTop:s,restoreAnchor:c,scrollContainerMeasures:l,scrolledUpThreshold:u,scrollToBottom:f,showNewMessages:p}=e,{client:m}=K(`useMessageListScrollManager`),h=(0,d.useRef)({offsetHeight:0,scrollHeight:0,scrollTop:0}),g=(0,d.useRef)(void 0),_=(0,d.useRef)({anchor:null,mode:`idle`}),v=(0,d.useRef)(i),y=(0,d.useRef)(0);return(0,d.useLayoutEffect)(()=>{if(n){g.current=e.messages,h.current=l(),v.current=i;return}let d=h.current,b=g.current,x=e.messages,S=x[x.length-1]||{},C=b?.[b.length-1],w=l(),T=i&&!v.current,E=!i&&v.current;if(T){let e=l(),n=e.scrollHeight>e.offsetHeight,r=e.scrollTop;if(!n)_.current={anchor:null,mode:`idle`};else if(r<=1)_.current={anchor:null,mode:`stick-to-top`};else if(r<a){let e=t();e?_.current={anchor:e,mode:`preserve-anchor`}:_.current={anchor:null,mode:`idle`}}else _.current={anchor:null,mode:`idle`}}let D=d.scrollHeight-d.offsetHeight-y.current<u;if(b!==void 0)if(b.length<x.length){let e=oCe(b,x),t=aCe(b,x);if(e){let e=_.current.mode===`preserve-anchor`&&_.current.anchor&&(E||i)?_.current.anchor:null;_.current.mode===`stick-to-top`?s():e?c(e):y.current<a&&o(w.scrollHeight-d.scrollHeight),_.current={anchor:null,mode:`idle`}}else if(t){if(r){g.current=x,h.current=w,v.current=i;return}S.user?.id===m.userID||D?f():p()}else _.current={anchor:null,mode:`idle`}}else{let e=C?.latest_reactions?.length!==S.latest_reactions?.length,t=C?.reply_count!==S.reply_count;(e||t)&&D&&f(),E&&(_.current={anchor:null,mode:`idle`})}g.current=x,h.current=w,v.current=i},[t,n,r,i,h,g,e.messages,c,l]),(e,t=null)=>{if(y.current=e,i&&t&&_.current.mode===`preserve-anchor`){let e=t();if(!e)return;_.current={anchor:e,mode:`preserve-anchor`}}}}var cCe=e=>{let{disableAutoScrollToBottom:t=!1,disableScrollManagement:n=!1,hasMoreNewer:r,listElement:i,loadingMore:a=!1,loadMoreScrollThreshold:o,messages:s=[],scrolledUpThreshold:c=200,suppressAutoscroll:l}=e,[u,f]=(0,d.useState)(!1),[p,m]=(0,d.useState)(),h=(0,d.useRef)(r),g=h.current&&!r,_=(0,d.useRef)(!1),v=(0,d.useRef)(!1),[y,b]=(0,d.useState)(!0),x=(0,d.useRef)(!1),S=(0,d.useRef)(!1),C=(0,d.useRef)(0),w=(0,d.useRef)(s.length),T=(0,d.useRef)(t),E=(0,d.useRef)(t),D=(0,d.useRef)(null),O=(0,d.useCallback)(()=>
502{if(!i)return null;let e=i.getBoundingClientRect(),t=e.top,n=e.bottom,r=t+e.height/2,s=a||i.scrollTop<o,c=Array.from(i.querySelectorAll(`[data-message-id]`)).map(e=>{let n=e.getBoundingClientRect();return{center:n.top+n.height/2,element:e,offsetTop:n.top-t,rect:n}}),l=c.filter(({rect:e})=>e.bottom>t&&e.top<n),u=l.reduce((e,t)=>!e||t.rect.top<e.rect.top?t:e,null),d=l.find(({rect:e})=>e.top<=r&&e.bottom>=r)??l.reduce((e,t)=>e?Math.abs(t.center-r)<Math.abs(e.center-r)?t:e:t,null),f=(s?u:d)??c[0];return f?.element.dataset.messageId?{id:f.element.dataset.messageId,offsetTop:f.offsetTop}:null},[i,o,a]),k=(0,d.useCallback)(e=>{if(!i)return;D.current?.();let t=!1,n=0,r=!1,a,o,s;v.current=!0;let c=()=>{if(t)return!0;let n=i.querySelector(`[data-message-id='${e.id}']`);if(!n)return!0;let r=i.getBoundingClientRect().top,a=n.getBoundingClientRect().top-r-e.offsetTop;return Math.abs(a)>1?(i.scrollBy({top:a}),!1):!0},l=()=>{t=!0,r=!1,v.current=!1,s!==void 0&&window.cancelAnimationFrame(s),o&&clearTimeout(o),a?.disconnect()},u=()=>{t||r||(r=!0,s=window.requestAnimationFrame(()=>{if(r=!1,n=c()?n+1:0,n>=2){l();return}u()}))};n=+!!c(),u(),typeof ResizeObserver<`u`&&(a=new ResizeObserver(()=>{n=0,u()}),a.observe(i)),o=setTimeout(()=>{l()},1200),D.current=l},[i]);(0,d.useLayoutEffect)(()=>()=>{D.current?.()},[]);let A=(0,d.useCallback)(e=>{!i?.scrollTo||r||v.current||g||l||(i.scrollTo({behavior:e?.behavior,top:i.scrollHeight}),f(!1))},[r,g,i,l]);(0,d.useLayoutEffect)(()=>{let e=T.current&&!t;if(T.current=t,!e){if(i&&m(i.getBoundingClientRect()),i&&g){i.scrollTop=C.current,_.current=!0;return}if(_.current){_.current=!1;return}i&&!t&&!v.current&&A()}},[t,g,i,r]),(0,d.useLayoutEffect)(()=>{let e=E.current&&!t;if(E.current=t,e||!i||t||r||l||g||v.current)return;let n=i.scrollHeight-(i.scrollTop+i.clientHeight),a=w.current===0&&s.length>0;if(n>c&&!a)return;let o=!0,u=()=>{o&&A()};u();let d=[80,a?260:420,900,1700].map(e=>setTimeout(u,e)),f=()=>{o=!1};i.addEventListener(`pointerdown`,f,{passive:!0}),i.addEventListener(`touchstart`,f,{passive:!0}),i.addEventListener(`wheel`,f,{passive:!0}),i.addEventListener(`keydown`,f);let p=setTimeout(()=>{f()},2200);return()=>{d.forEach(clearTimeout),clearTimeout(p),i.removeEventListener(`pointerdown`,f),i.removeEventListener(`touchstart`,f),i.removeEventListener(`wheel`,f),i.removeEventListener(`keydown`,f)}},[t,r,g,i,s.length,A,c,l]);let j=sCe({captureAnchor:O,disableScrollManagement:n||v.current,justReachedLatestMessageSet:g,loadingMore:a,loadMoreScrollThreshold:o,messages:s,onScrollBy:e=>{i?.scrollBy({top:e})},onScrollToTop:()=>{i&&(i.scrollTop=0)},restoreAnchor:k,scrollContainerMeasures:()=>({offsetHeight:i?.offsetHeight||0,scrollHeight:i?.scrollHeight||0,scrollTop:i?.scrollTop||0}),scrolledUpThreshold:c,scrollToBottom:A,showNewMessages:()=>f(!0)});return(0,d.useLayoutEffect)(()=>{h.current=r},[r]),(0,d.useLayoutEffect)(()=>{w.current=s.length},[s.length]),{hasNewMessages:u,isMessageListScrolledToBottom:y,onScroll:(0,d.useCallback)(e=>{let t=e.target,n=t.scrollTop;C.current=n,j(n,O);let r=t.offsetHeight,i=t.scrollHeight-(n+r),a=Math.max(Math.floor(c*.6),24),o=x.current;x.current=o?i<c:i<a,S.current=n<c,x.current&&f(!1),o&&!x.current?b(!1):!o&&x.current&&b(!0)},[O,j,S,x,c]),scrollToBottom:A,wrapperRect:p}},Y7=`str-chat__main-panel-inner str-chat__message-list-main-panel`,X7=({children:e})=>(0,R.jsx)(`div`,{className:Y7,children:e}),Z7=`str-chat__unread-messages-separator`,Q7=({showCount:e=!0,unreadCount:t})=>{let{t:n}=Y(`UnreadMessagesSeparator`),{markRead:r}=zB();return(0,R.jsxs)(`div`,{className:Z7,"data-testid":`unread-messages-separator`,children:[(0,R.jsx)(`div`,{className:`str-chat__unread-messages-separator__text`,children:t&&e?n(`{{count}} unread`,{count:t}):n(`Unread messages`)}),(0,R.jsx)(nH,{appearance:`ghost`,"aria-label":n(`aria/Mark messages as read`),circular:!0,onClick:()=>r(),size:`sm`,variant:`secondary`,children:(0,R.jsx)(RH,{})})]})},lCe=(e,t)=>{let{bottom:n}=e.getBoundingClientRect();return n<(t?.getBoundingClientRect().top??0)},uCe=(e,t)=>{let{top:n}=e.getBoundingClientRect(),{bottom:r}=t.getBoundingClientRect();return n>r},dCe=({isMessageListScrolledToBottom:e,listElement:t,showAlways:n,unreadCount:r})=>{let{messages:i}=KB(`UnreadMessagesNotification`),[a,o]=(0,d.useState)(!1),s=(0,d.useRef)(!1),c=typeof IntersectionObserver<`u`;return(0,d.useEffect)(()=>
502{if(!(r&&c)){o(!1);return}let e=t??null;if(!e){let[e]=document.getElementsByClassName(Y7);if(!e)return;let[t]=document.getElementsByClassName(Z7);t||o(!0);return}let[i]=document.getElementsByClassName(Z7);if(!i){o(!0);return}let a=lCe(i,e),l=uCe(i,e);o(n?a||l:a);let u=new IntersectionObserver(e=>{if(!e.length)return;let{boundingClientRect:t,isIntersecting:r,rootBounds:i}=e[0];if(r){o(!1);return}let a=i?.top??0,c=t.bottom<a;o(n||c),s.current=c},{root:e});return u.observe(i),()=>{u.disconnect()}},[c,t,e,i,n,r]),(0,d.useEffect)(()=>{r&&e&&s.current&&(o(!0),s.current=!1)},[e,r]),{show:a&&c}},fCe=(e,t)=>e.state.latestMessages.slice(-1)[0]?.id===e.state.read[t]?.last_read_message_id,$7=({isMessageListScrolledToBottom:e,messageListIsThread:t,wasMarkedUnread:n})=>{let{client:r}=K(`useMarkRead`),{markRead:i,setChannelUnreadUiState:a}=zB(`useMarkRead`),{channel:o}=KB(`useMarkRead`);(0,d.useEffect)(()=>{if(!o.getConfig()?.read_events)return;let s=()=>!document.hidden&&!n&&!t&&e&&r.user?.id&&!fCe(o,r.user.id),c=()=>{s()&&i()},l=t=>{let r=!t.message?.parent_id||t.message?.show_in_channel;!e||n||document.hidden?a(e=>{let n=e?.unread_messages??0,r=pCe(o.state.messages,t.message);return{...e||{},last_read:e?.last_read??(n===0&&r?.created_at?new Date(r.created_at):new Date(0)),unread_messages:n+1}}):r&&s()&&i()};return o.on(`message.new`,l),document.addEventListener(`visibilitychange`,c),s()&&i(),()=>{o.off(`message.new`,l),document.removeEventListener(`visibilitychange`,c)}},[o,r,e,i,t,a,n])};function pCe(e,t){if(!t)return;let n;for(let r=e.length-1;r>=0;r--){let i=e[r];if(!i?.id)break;if(i.id!==t.id){n=i;break}}return n}var e9=d.memo(e=>{let{newMessageCount:t=0,showNotification:n}=e,{t:r}=Y(),{NewMessageNotification:i}=q();if(!n)return null;let a=t>0?r(`{{count}} new messages`,{count:t}):r(`New Messages!`);return i?(0,R.jsx)(i,{...e,label:a}):(0,R.jsx)(`div`,{className:`str-chat__new-message-notification`,children:(0,R.jsx)(`div`,{"aria-atomic":`true`,"aria-live":`polite`,className:`str-chat__message-notification__label`,"data-testid":`message-notification`,role:`status`,children:a})})}),t9=({queryMessageLimit:e,showCount:t=!0,unreadCount:n})=>{let{jumpToFirstUnreadMessage:r,markRead:i}=zB(),{t:a}=Y(`UnreadMessagesNotification`);return(0,R.jsxs)(`div`,{className:G(`str-chat__unread-messages-notification`,{"str-chat__unread-messages-notification--with-count":n&&t}),"data-testid":`unread-messages-notification`,children:[(0,R.jsxs)(nH,{appearance:`outline`,onClick:()=>r(e),variant:`secondary`,children:[(0,R.jsx)(pH,{}),n&&t?a(`{{count}} unread`,{count:n}):a(`Unread messages`)]}),(0,R.jsx)(nH,{appearance:`outline`,"aria-label":a(`aria/Mark messages as read`),onClick:()=>i(),variant:`secondary`,children:(0,R.jsx)(RH,{})})]})}
502,n9=e=>{e instanceof WheelEvent&&e.deltaY===1&&e.preventDefault()},mCe=e=>{let{children:t,element:n=`div`,hasNextPage:r,hasPreviousPage:i,head:a,initialLoad:o=!0,isLoading:s,listenToScroll:c,loader:l,loadNextPage:u,loadPreviousPage:f,threshold:p=250,useCapture:m=!1,...h}=e,[g,_]=(0,d.useState)(null),v=(0,d.useRef)(void 0),y=(0,d.useRef)(void 0),b=(0,d.useRef)(void 0);return b.current=()=>{let e=g;if(!e||e.offsetParent===null)return;let t=e.parentElement,n=e.scrollHeight-t.scrollTop-t.clientHeight,a=t.scrollTop;c&&c(n,a,p),!s&&(v.current===n&&y.current===a||(v.current=n,y.current=a,a<Number(p)&&typeof f==`function`&&i&&f(),n<Number(p)&&typeof u==`function`&&r&&u()))},(0,d.useEffect)(()=>{let e=g?.parentNode;if(!e)return;let t=()=>b.current?.();e.addEventListener(`scroll`,t,m),e.addEventListener(`resize`,t,m);let n=requestAnimationFrame(()=>{t()});return()=>{cancelAnimationFrame(n),e.removeEventListener(`scroll`,t,m),e.removeEventListener(`resize`,t,m)}},[o,g,m]),(0,d.useEffect)(()=>{let e=g?.parentNode;if(e)return e.addEventListener(`wheel`,n9,{passive:!1}),()=>{e.removeEventListener(`wheel`,n9,m)}},[g,m]),(0,R.jsxs)(n,{...h,ref:_,children:[a,l,t]})},hCe=d.memo(e=>{let{isMessageListScrolledToBottom:t=!0,scrollToBottom:n,threadList:r}=e,{channelConfig:i,thread:a}=KB(`TypingIndicator`),o=yG()?.id??a?.id,{client:s}=K(`TypingIndicator`),{t:c}=Y(),{typing:l={}}=HV(`TypingIndicator`),u=r?[]:Object.values(l).filter(({parent_id:e,user:t})=>t?.id!==s.user?.id&&!e),f=r?Object.values(l).filter(({parent_id:e,user:t})=>t?.id!==s.user?.id&&e===o):[],{displayUsers:p}=E7(r?f:u),m=p.length>0,h=(0,d.useMemo)(()=>D7(p,c),[p,c]),g=(0,d.useMemo)(()=>p.map(({user:e})=>({id:e?.id,imageUrl:e?.image,userName:e?.name})),[p]);return(0,d.useEffect)(()=>{m&&t&&n()},[n,t,m]),i?.typing_events===!1||!m||!t?null:(0,R.jsxs)(`div`,{className:G(`str-chat__typing-indicator`,`str-chat__typing-indicator--with-transition`,{"str-chat__typing-indicator--typing":m}),"data-testid":`typing-indicator`,children:[g.length>0&&(0,R.jsx)(`div`,{"aria-hidden":`true`,children:(0,R.jsx)(j6,{badgeSize:`md`,displayInfo:g,size:`md`})}),(0,R.jsx)(`div`,{"aria-hidden":`true`,className:`str-chat__typing-indicator__bubble`,children:(0,R.jsx)(`div`,{className:`str-chat__typing-indicator__dots`,children:(0,R.jsx)(T7,{})})}),(0,R.jsx)(v6,{children:(0,R.jsx)(`span`,{"aria-atomic":`true`,"aria-live":`polite`,"data-testid":`typing-indicator-status`,role:`status`,children:h})})]})});function gCe(e,t,n){if(KW(e))return null;for(let e=n-1;e>=0;--e){let n=t[e];if(qW(n))return n.date}let r=e.created_at;if(r){let e=new Date(r);return isNaN(e.getTime())?null:e}return null}function _Ce(e,t,n){return qW(e)?e.date:gCe(e,t,n)}var r9={date:null,visible:!1},vCe=({disableDateSeparator:e,processedMessages:t})=>{let[n,r]=(0,d.useState)(r9),i=(0,d.useCallback)(n=>{if(e||t.length===0){r(r9);return}let i=n.filter(e=>e!=null);if(i.length===0){r(r9);return}let a=i[0],o=t.findIndex(e=>e.id===a.id),s=o>=0?_Ce(a,t,o):null,c=s!==null;r(e=>{let t=e.date?.getTime()??null,n=s?.getTime()??null;return e.visible===c&&t===n?e:{date:s,visible:c}})},[e,t]);return{floatingDate:n.date,onItemsRendered:i,showFloatingDate:!!n.date&&n.visible}},yCe=e=>{let[t,n]=(0,d.useState)(),{client:r}=K(`useGiphyPreview`);return(0,d.useEffect)(()=>{if(!e)return;let t=e=>{let{message:t,user:i}=e;t?.command===`giphy`&&i?.id===r.userID&&n(void 0)};return r.on(`message.new`,t),()=>r.off(`message.new`,t)},[r,e]),{giphyPreviewMessage:t,setGiphyPreviewMessage:e?n:void 0}},bCe=({messages:e})=>{let[t,n]=(0,d.useState)(+new Date),r=(0,d.useRef)(void 0);return(0,d.useEffect)(()=>{e?.find(e=>e.id===r.current)||n(+new Date),r.current=e?.[0]?.id},[e]),{messageSetKey:t}};function xCe(e,t,n){let[r,i]=(0,d.useState)(!1),[a,o]=(0,d.useState)(!0),s=(0,d.useRef)(!1),c=(0,d.useRef)(``),l=(0,d.useRef)(!1);return(0,d.useEffect)(()=>{if(n){i(!0);return}if(!e?.length)return;let r=e[e.length-1],a=c.current;c.current=r.id||``,r.id!==a&&(l.current||(r.user?.id!==t&&s.current&&i(!0),s.current=!0))},[t,e,n]),{atBottom:l,isMessageListScrolledToBottom:a,newMessagesNotification:r,setIsMessageListScrolledToBottom:o,setNewMessagesNotification:i}}var SCe={failed:!0,sending:!0};function CCe(e,t){let n=+!!t,r=(0,d.useRef)(void 0),i=(0,d.useRef)(void 0),a=(0,d.useRef)(0);return(0,d.useMemo)(()=>
502{if(!e||!e.length)return a.current=0,0;let t=e?.[n],o=t?.id===i.current?.id,s=JW(t)?t.status:void 0,c=!!(s&&SCe[s]);if(o||c)return a.current;r.current||=t,i.current=t;for(let t=a.current;t<e.length;t+=1)if(e[t].id===r.current?.id)return a.current=t-n,a.current;return r.current=t,a.current=0,0},[n,e,e?.length])}var wCe=({messages:e,scrollToBottom:t,scrollToLatestMessageOnFocus:n})=>{let[r,i]=(0,d.useState)(!1),a=(0,d.useRef)(void 0);a.current=e=>{!n||!r||e.target!==window||setTimeout(t,100)},(0,d.useEffect)(()=>{i(!0)},[e]),(0,d.useEffect)(()=>{let e=e=>{a.current?.(e)},t=()=>{i(!1)};return typeof window<`u`&&(window.addEventListener(`focus`,e),window.addEventListener(`blur`,t)),()=>{window.removeEventListener(`focus`,e),window.removeEventListener(`blur`,t)}},[])};function TCe(e,t){let n=(0,d.useRef)(``),r=(0,d.useRef)(!1);function i(){if(e&&e.length>0){let r=e[e.length-1];if(r.user?.id===t&&n.current!==r.id)return n.current=r.id,!0}return!1}return(0,d.useEffect)(()=>{e&&e.length&&!r.current&&(r.current=!0,i())},[e,e?.length]),i}var ECe=({lastRead:e,showAlways:t,unreadCount:n})=>{let[r,i]=(0,d.useState)(!1),a=(0,d.useCallback)(r=>{if(!n)return;let a=r[0],o=r.slice(-1)[0];if(!(a&&o))return;let s=new Date(a.created_at??0).getTime(),c=new Date(o.created_at??0).getTime(),l=new Date(e??0).getTime(),u=!!l&&s>l;i(t?u||!!l&&c<l:u)},[e,t,n]);return(0,d.useEffect)(()=>{n||i(!1)},[n]),{show:r,toggleShowUnreadMessagesNotification:a}},i9=e=>{let{DateSeparator:t=O7}=q(`FloatingDateSeparator`),{disableDateSeparator:n,processedMessages:r}=e,i=`listElement`in e?e.listElement:null,a=i!=null,o=vCe({disableDateSeparator:n,processedMessages:r}),s=rCe({disableDateSeparator:n,listElement:i,processedMessages:r}),c=a?s.floatingDate:o.floatingDate,l=a?s.showFloatingDate:o.showFloatingDate,u=`itemsRenderedRef`in e?e.itemsRenderedRef:null;return(0,d.useLayoutEffect)(()=>{if(u)return u.current=o.onItemsRendered,()=>{u.current=null}},[u,o.onItemsRendered]),!l||!c||!t?null:(0,R.jsx)(t,{date:c,floating:!0})},a9=d.memo(e=>{let{message:t,unsafeHTML:n=!1}=e,{type:r}=t;return r===`system`?(0,R.jsx)(`div`,{className:`str-chat__message--system`,"data-testid":`message-system`,children:(0,R.jsx)(`div`,{className:`str-chat__message--system__text`,children:n?(0,R.jsx)(`div`,{dangerouslySetInnerHTML:{__html:t.html||``},"data-unsafe-inner-html":!0}):(0,R.jsx)(`span`,{children:t.text})})}):null});function DCe({channelUnreadUiState:e,components:t,customClasses:n,lastOwnMessage:r,lastReceivedMessageId:i,messageGroupStyles:a,messages:o,ownMessagesDeliveredToOthers:s,readData:c,sharedMessageProps:l}){let{DateSeparator:u=O7,HeaderComponent:f,MessageListItem:p=`li`,MessageSystem:m=a9,UnreadMessagesSeparator:h=Q7}=t,g=[],_,v;for(let t=0;t<o.length;t++){let y=o[t];if(qW(y))g.push((0,R.jsx)(p,{"data-index":t,children:(0,R.jsx)(u,{date:y.date,formatDate:l.formatDate,unread:y.unread})},`${y.date.toISOString()}-i`));else if(KW(y))f&&g.push((0,R.jsx)(p,{"data-index":t,children:(0,R.jsx)(f,{})},`intro`));else if(y.type===`system`)g.push((0,R.jsx)(p,{"data-index":t,"data-message-id":y.id,children:(0,R.jsx)(m,{message:y,unsafeHTML:l.unsafeHTML})},y.id||y.created_at.toISOString()));else{_||=y;let o=a[y.id]||``,u=n?.message||`str-chat__li str-chat__li--${o}`,f=YW({firstUnreadMessageId:e?.first_unread_message_id,isFirstMessage:!!_?.id&&_.id===y.id,lastReadDate:e?.last_read,lastReadMessageId:e?.last_read_message_id,message:y,previousMessage:v,unreadMessageCount:e?.unread_messages});g.push((0,R.jsxs)(d.Fragment,{children:[f&&h&&(0,R.jsx)(p,{className:`str-chat__li str-chat__unread-messages-separator-wrapper`,children:(0,R.jsx)(h,{unreadCount:e?.unread_messages})}),(0,R.jsx)(p,{className:u,"data-index":t,"data-message-id":y.id,"data-testid":u,children:(0,R.jsx)(K7,{deliveredTo:s[y.id]||[],groupStyles:[o],lastOwnMessage:r,lastReceivedId:i,message:y,readBy:c[y.id]||[],...l})})]},y.id||y.created_at.toISOString())),v=y}}return g}var OCe=(e,t)=>{for(let n=e.length-1;n>=0;--n)if(t(e[n]))return e[n]},o9=({messages:e,ownUserId:t})=>(0,d.useMemo)(()=>e&&OCe(e,e=>(e.user&&e.user.id)===t),[e,t]),s9=`(prefers-reduced-motion: reduce)`,kCe=()=>typeof window>`u`||typeof window.matchMedia!=`function`?!1:window.matchMedia(s9).matches,ACe=e=>{if(typeof window>`u`||typeof window.matchMedia!=`function`)return()=>void 0;let t=window.matchMedia(s9),n=()=>e();return typeof t.addEventListener==`function`?(t.addEventListener(`change`,n),()=>t.removeEventListener(`change`,n)):(t.addListener(n),()=>t.removeListener(n))},c9=()=>(0,kB.useSyncExternalStore)(ACe,kCe,()=>!1),l9=d.memo(e=>{let{isMessageListScrolledToBottom:t,isNotAtLatestMessageSet:n=!1,onClick:r,threadList:i}=e,{channel:a,client:o}=K(),{thread:s}=KB(),{t:c}=Y(),[l,u]=(0,d.useState)(a?.countUnread()||0),[f,p]=(0,d.useState)(s?.reply_count||0),m=i?`message.updated`:`message.new`;return(0,d.useEffect)(()=>{let e=e=>{let n=e.cid!==a?.cid,r=e.user?.id===o.user?.id,c=!!s,l=!!e.message?.parent_id;if(!(t||n||r||c&&!i&&l)){if(e.type===`message.new`)u(e=>e+1);else if(e.message?.id===s?.id){let t=e.message?.reply_count||0;u(()=>t-f)}}};return o.on(m,e),()=>{o.off(m,e)}},[a,o,t,m,f,s,i]),(0,d.useEffect)(()=>{t&&(u(0),p(s?.reply_count||0))},[t,s]),t&&!n?null:(0,R.jsxs)(`div`,{className:`str-chat__jump-to-latest-message`,children:[(0,R.jsx)(nH,{appearance:`ghost`,"aria-label":c(`aria/Jump to latest message`),"aria-live":`polite`,circular:!0,className:`str-chat__jump-to-latest-message__button`,"data-testid":`scroll-to-latest-message-button`,onClick:r,size:`md`,variant:`secondary`,children:(0,R.jsx)(oH,{})}),l>0&&(0,R.jsx)(A6,{className:`str-chat__jump-to-latest__unread-count`,"data-testid":`unread-message-notification-counter`,size:`md`,variant:`primary`,children:l})]})}),jCe=e=>`${e.length}:${e[0]?.id||``}:${e[e.length-1]?.id||``}`,u9=e=>e?.created_at?.getTime?.()??null,MCe=e=>{let{channel:t,channelUnreadUiState:n,disableDateSeparator:r=!1,groupStyles:i,hasMoreNewer:a=!1,headerPosition:o,hideDeletedMessages:s=!1,hideNewMessageSeparator:c=!1,highlightedMessageId:l,internalInfiniteScrollProps:{threshold:u=250,...f}={},jumpToLatestMessage:p=()=>Promise.resolve(),loadMore:m,loadMoreNewer:h,maxTimeBetweenGroupedMessages:g,messageActions:_=Object.keys(QU),messageLimit:v=25,messages:y=[],noGroupByUser:b=!1,reactionDetail
502sSort:x,renderMessages:S=DCe,returnAllReadData:C=!1,reviewProcessedMessage:w,showUnreadNotificationAlways:T,sortReactions:E,suppressAutoscroll:D,thread:O,threadList:k=!1,unsafeHTML:A=!1}=e,[j,M]=d.useState(null),[N,P]=d.useState(`idle`),[ee,F]=d.useState(`idle`),[te,ne]=d.useState(null),re=d.useRef(a),I=d.useRef(``),ie=d.useRef({firstTimestamp:null,lastTimestamp:null}),{customClasses:ae}=K(`MessageList`),oe=c9()?`auto`:`smooth`,{EmptyStateIndicator:L=FU,LoadingIndicator:se=e8,MessageListMainPanel:ce=X7,MessageListWrapper:le=`ul`,NewMessageNotification:ue=e9,NotificationList:de=X9,ScrollToLatestMessageButton:fe=l9,TypingIndicator:pe=hCe,UnreadMessagesNotification:me=t9}=q(),he=zG(),ge=d.useMemo(()=>jCe(y),[y]),_e=d.useMemo(()=>({firstTimestamp:u9(y[0]),lastTimestamp:u9(y[y.length-1])}),[y]),ve=N!==`idle`,ye=!!l,be=ee!==`idle`,xe=re.current&&!a,{hasNewMessages:Se,isMessageListScrolledToBottom:Ce,onScroll:we,scrollToBottom:Te,wrapperRect:Ee}=cCe({disableAutoScrollToBottom:ve||ye||xe,disableScrollManagement:ve||be,hasMoreNewer:a,listElement:j,loadingMore:e.loadingMore,loadMoreScrollThreshold:u,messages:y,scrolledUpThreshold:e.scrolledUpThreshold,suppressAutoscroll:D}),De=Ce&&!ve&&!be&&!xe,{show:Oe}=dCe({isMessageListScrolledToBottom:Ce,listElement:j,showAlways:!!T,unreadCount:n?.unread_messages});$7({isMessageListScrolledToBottom:De,messageListIsThread:k,wasMarkedUnread:!!n?.first_unread_message_id});let{messageGroupStyles:ke,messages:Ae}=eCe({channel:t,disableDateSeparator:r,groupStyles:i,headerPosition:o,hideDeletedMessages:s,hideNewMessageSeparator:c,maxTimeBetweenGroupedMessages:g,messages:y,noGroupByUser:b,reviewProcessedMessage:w}),je=o9({messages:y,ownUserId:t.getClient().user?.id}),Me=iCe({channelUnreadUiState:n,enrichedMessages:Ae,internalMessageProps:{additionalMessageComposerProps:e.additionalMessageComposerProps,closeReactionSelectorOnClick:e.closeReactionSelectorOnClick,disableQuotedMessages:e.disableQuotedMessages,formatDate:e.formatDate,Message:e.Message,messageActions:_,messageListRect:Ee,onMentionsClick:e.onMentionsClick,onMentionsHover:e.onMentionsHover,onUserClick:e.onUserClick,onUserHover:e.onUserHover,openThread:e.openThread,reactionDetailsSort:x,renderText:e.renderText,retrySendMessage:e.retrySendMessage,showAvatar:e.showAvatar,sortReactions:E,unsafeHTML:A},lastOwnMessage:je,messageGroupStyles:ke,messages:y,renderMessages:S,returnAllReadData:C,threadList:k});Q9({activeThreadId:O?.id,channel:t,ownUserId:t.getClient().user?.id,threadList:k});let Ne=ae?.messageList||`str-chat__message-list`,Pe=d.useCallback(()=>{m&&m(v)},[m,v]),Fe=d.useCallback(()=>{h&&h(v)},[h,v]),Ie=d.useCallback(async()=>{if(a){ne(ge),P(`waiting-for-render`);try{await p()}catch(e){throw ne(null),P(`idle`),e}return}Te({behavior:oe})},[oe,a,p,ge,Te]);d.useLayoutEffect(()=>{if(N!==`waiting-for-render`||a||!j?.scrollTo||ge===te)return;j.scrollTo({top:0});let e=requestAnimationFrame(()=>{P(`animating`),j.scrollTo({behavior:oe,top:j.scrollHeight})});return()=>cancelAnimationFrame(e)},[oe,a,te,N,j,ge]),d.useLayoutEffect(()=>{if(N!==`animating`||!j?.scrollTo)return;let e=setTimeout(()=>{j.scrollTo({top:j.scrollHeight}),ne(null),P(`idle`)},500);return()=>{clearTimeout(e)}},[N,j]),d.useLayoutEffect(()=>{if(!l){F(`idle`);return}let e=j?.querySelector(`[data-message-id='${l}']`);if(!e){F(`waiting-for-render`);return}let t=I.current!==ge;F(t?`animating`:`idle`);let n,r=requestAnimationFrame(()=>{if(e.scrollIntoView({behavior:oe,block:`center`}),!t||!j?.scrollTo){F(`idle`);return}n=setTimeout(()=>{let t=e.getBoundingClientRect(),n=j.getBoundingClientRect(),r=j.scrollTop+(t.top-n.top)-(j.clientHeight-t.height)/2;j.scrollTo({top:Math.max(r,0)}),F(`idle`)},500)});return()=>{cancelAnimationFrame(r),n&&clearTimeout(n)}},[oe,l,ge]),d.useEffect(()=>{re.current=a},[a]),d.useEffect(()=>{I.current=ge,ie.current=_e},[_e,ge]);let Le=PU(),Re=Me.length===0&&!k,ze=k?`message-list-dialog-manager-thread-${Le}`:`message-list-dialog-manager-${Le}`;return(0,R.jsx)(Xme,{value:{listElement:j,processedMessages:Ae,scrollToBottom:Te},children:(0,R.jsx)(p6,{children:(0,R.jsxs)(ce,{children:[(0,R.jsxs)(_V,{id:ze,children:[!k&&Oe&&(0,R.jsx)(me,{unreadCount:n?.unread_messages}),(0,R.jsx)(i9,{disableDateSeparator:r,listElement:j,processedMessages:Ae}),(0,R.jsx)(`div`,{className:G(Ne,ae?.threadList),onScroll:we,ref:M,tabIndex:0,children:Re?(0,R.jsx)(L,{listType:k?`thread`:`message`}):(0,R.jsxs)(mCe,{className:`str-chat__message-list-scroll`,"data-testid":`reverse-infinite-scroll`,hasNextPage:e.hasMoreNewer,hasPreviousPage:be?!1:e.hasMore,head:e.head,isLoading:!!(e.loadingMore||e.loadingMoreForJumpToChannelMessage),loader:(0,R.jsx)(`div`,{className:`str-chat__list__loading`,children:(e.loadingMore||e.loadingMoreForJumpToChannelMessage)&&(0,R.jsx)(se,{})},`loading-indicator`),loadNextPage:Fe,loadPreviousPage:be?()=>void 0:Pe,threshold:u,...f,children:[(0,R.jsx)(le,{className:`str-chat__ul`,children:Me}),(0,R.jsx)(pe,{isMessageListScrolledToBottom:De,scrollToBottom:Te,threadList:k}),(0,R.jsx)(`div`,{},`bottom`)]})}),(0,R.jsx)(ue,{newMessageCount:n?.unread_messages,showNotification:Se||a}),(0,R.jsx)(fe,{isMessageListScrolledToBottom:Ce,isNotAtLatestMessageSet:a,onClick:Ie,threadList:k})]}),(0,R.jsx)(de,{panel:he})]})})})},d9=e=>{let{jumpToLatestMessage:t,loadMore:n,loadMoreNewer:r}=zB(`MessageList`),{members:i,mutes:a,watchers:o,...s}=KB(`MessageList`);return(0,R.jsx)(b6,{children:(0,R.jsx)(MCe,{jumpToLatestMessage:t,loadMore:n,loadMoreNewer:r,...s,...e})})},f9=10**7;function p9(e,t){return e+t-f9}function NCe(e){return f9-e}var PCe=(e,t)=>(0,PB.default)(n=>{let r=n.map(e=>{if(e.originalIndex)return t[p9(e.originalIndex,f9)]}).filter(e=>!!e);
502e.forEach(e=>e(r))},200),FCe=({context:e,...t})=>{if(!e)return(0,R.jsx)(R.Fragment,{});let n=e.processedMessages[p9(t[`data-item-index`],e.numItemsPrepended)],r=e.messageGroupStyles[n.id];return(0,R.jsx)(`div`,{...t,className:e?.customClasses?.virtualMessage||G(`str-chat__virtual-list-message-wrapper str-chat__li`,{[`str-chat__li--${r}`]:r})})},ICe=({context:e})=>{let{LoadingIndicator:t=e8}=q(`VirtualizedMessageListHeader`);return(0,R.jsxs)(R.Fragment,{children:[e?.head,e?.loadingMore&&t&&(0,R.jsx)(`div`,{className:`str-chat__virtual-list__loading`,children:(0,R.jsx)(t,{})})]})},LCe=({context:e})=>{let{EmptyStateIndicator:t=FU}=q(`VirtualizedMessageList`);return e?.processedMessages!==void 0&&e.processedMessages.length>0?null:(0,R.jsx)(R.Fragment,{children:t&&(0,R.jsx)(t,{listType:e?.threadList?`thread`:`message`})})},RCe=(e,t,n)=>{let{additionalMessageComposerProps:r,closeReactionSelectorOnClick:i,customMessageRenderer:a,DateSeparator:o,firstUnreadMessageId:s,formatDate:c,lastOwnMessage:l,lastReadDate:u,lastReadMessageId:d,lastReceivedMessageId:f,Message:p,messageActions:m,messageGroupStyles:h,MessageSystem:g,numItemsPrepended:_,openThread:v,ownMessagesDeliveredToOthers:y,ownMessagesReadByOthers:b,processedMessages:x,reactionDetailsSort:S,renderText:C,returnAllReadData:w,showAvatar:T,sortReactions:E,threadList:D,unreadMessageCount:O=0,UnreadMessagesSeparator:k,virtuosoRef:A}=n,j=p9(e,_);if(a)return a(x,j);let M=x[j];return!M||KW(M)?(0,R.jsx)(`div`,{style:{height:`1px`}}):qW(M)?o?(0,R.jsx)(o,{date:M.date,unread:M.unread}):null:M.type===`system`?g?(0,R.jsx)(g,{message:M}):null:(0,R.jsxs)(R.Fragment,{children:[YW({firstUnreadMessageId:s,isFirstMessage:j===0,lastReadDate:u,lastReadMessageId:d,message:M,previousMessage:j?x[j-1]:void 0,unreadMessageCount:O})&&(0,R.jsx)(`div`,{className:`str-chat__unread-messages-separator-wrapper`,children:(0,R.jsx)(k,{unreadCount:O})}),(0,R.jsx)(K7,{additionalMessageComposerProps:r,autoscrollToBottom:A.current?.autoscrollToBottom,closeReactionSelectorOnClick:i,deliveredTo:y[M.id]||[],formatDate:c,groupStyles:[h[M.id]??``],lastOwnMessage:l,lastReceivedId:f,message:M,Message:p,messageActions:m,openThread:v,reactionDetailsSort:S,readBy:b[M.id]||[],renderText:C,returnAllReadData:w,showAvatar:T,sortReactions:E,threadList:D})]})},zCe=(0,d.createContext)(void 0),BCe=({children:e,value:t})=>(0,R.jsx)(zCe.Provider,{value:t,children:e});function m9(e){(e.message===`ResizeObserver loop completed with undelivered notifications.`||e.message===`ResizeObserver loop limit exceeded`)&&e.stopImmediatePropagation()}function VCe(){(0,d.useEffect)(()=>(window.addEventListener(`error`,m9),()=>{window.removeEventListener(`error`,m9)}),[])}function HCe(e){return e.getBoundingClientRect().height}function h9(e,t){return e.findIndex(e=>e.id===t)}function UCe(e,t){if(t){let n=h9(e,t);if(n!==-1)return{align:`center`,index:n}}return e.length-1}var WCe=e=>{let{additionalMessageComposerProps:t,additionalVirtuosoProps:n={},channel:r,channelUnreadUiState:i,closeReactionSelectorOnClick:a,customMessageRenderer:o,defaultItemHeight:s,disableDateSeparator:c=!0,formatDate:l,groupStyles:u,hasMoreNewer:f,head:p,hideDeletedMessages:m=!1,hideNewMessageSeparator:h=!1,highlightedMessageId:g,jumpToLatestMessage:_,loadingMore:v,loadMore:y,loadMoreNewer:b,maxTimeBetweenGroupedMessages:x,Message:S,messageActions:C,messageLimit:w=25,messages:T,openThread:E,overscan:D=0,reactionDetailsSort:O,renderText:k,returnAllReadData:A=!1,reviewProcessedMessage:j,scrollSeekPlaceHolder:M,scrollToLatestMessageOnFocus:N=!1,separateGiphyPreview:P=!1,shouldGroupByUser:ee=!1,showAvatar:F,showUnreadNotificationAlways:te,sortReactions:ne,stickToBottomScrollBehavior:re=`smooth`,suppressAutoscroll:I,thread:ie,threadList:ae}=e,{components:oe,...L}=n;VCe();let{DateSeparator:se=O7,GiphyPreviewMessage:ce=$Se,MessageListMainPanel:le=X7,MessageSystem:ue=a9,NewMessageNotification:de=e9,NotificationList:fe=X9,ScrollToLatestMessageButton:pe=l9,TypingIndicator:me,UnreadMessagesNotification:he=t9,UnreadMessagesSeparator:ge=Q7,VirtualMessage:_e=G7}=q(`VirtualizedMessageList`),ve=S||_e,{client:ye,customClasses:be}=K(`VirtualizedMessageList`),xe=c9()?`auto`:re,Se=zG(),Ce=(0,d.useRef)(null),we=(0,d.useMemo)(()=>r.lastRead?.(),[r]),{show:Te,toggleShowUnreadMessagesNotification:Ee}=ECe({lastRead:i?.last_read,showAlways:!!te,unreadCount:i?.unread_messages??0}),{giphyPreviewMessage:De,setGiphyPreviewMessage:Oe}=yCe(P),ke=(0,d.useMemo)(()=>T===void 0?[]:c&&!m&&h&&!P?T:RW({enableDateSeparator:!c,hideDeletedMessages:m,hideNewMessageSeparator:h,lastRead:we,messages:T,reviewProcessedMessage:j,setGiphyPreviewMessage:Oe,userId:ye.userID||``}),[c,m,h,we,T,T?.length,ye.userID]),Ae=(0,d.useRef)(null),je=o9({messages:T,ownUserId:ye.user?.id}),Me=q7({channel:r,lastOwnMessage:je,messages:T||[],returnAllReadData:A}),Ne=J7({channel:r,lastOwnMessage:je,messages:T||[],returnAllReadData:A}),Pe=(0,d.useMemo)(()=>VW(ke),[ke]),Fe=u||WW,Ie=(0,d.useMemo)(()=>
502ke.reduce((e,t,n)=>{let r=Fe(t,ke[n-1],ke[n+1],!ee,x);return r&&t.id&&(e[t.id]=r),e},{}),[x,ke.length,ee,Fe]),{atBottom:Le,isMessageListScrolledToBottom:Re,newMessagesNotification:ze,setIsMessageListScrolledToBottom:Be,setNewMessagesNotification:Ve}=xCe(ke,ye.userID,f);$7({isMessageListScrolledToBottom:Re,messageListIsThread:!!ae,wasMarkedUnread:!!i?.first_unread_message_id});let He=(0,d.useCallback)(async()=>{if(f){await _();return}Ce.current&&Ce.current.scrollToIndex(ke.length-1),Ve(!1)},[Ce,ke,Ve,ke.length,f,_]);wCe({messages:T,scrollToBottom:He,scrollToLatestMessageOnFocus:N});let Ue=CCe(ke,!c),{messageSetKey:We}=bCe({messages:T}),Ge=TCe(ke,ye.userID);Q9({activeThreadId:ie?.id,channel:r,ownUserId:ye.userID,threadList:ae});let Ke=(0,d.useMemo)(()=>PCe([Ee,e=>Ae.current?.(e)],ke),[ke,Ee]),qe=e=>f||I?!1:Ge()?e?xe:`auto`:e?xe:!1,Je=(0,d.useCallback)((e,t,{numItemsPrepended:n,processedMessages:r})=>r[p9(e,n)].id,[]),Ye=e=>{Le.current=e,Be(e),e&&(b?.(w),Ve?.(!1))},Xe=e=>{e&&y?.(w)};(0,d.useEffect)(()=>{let e;if(g){let t=h9(ke,g);t!==-1&&(e=setTimeout(()=>{Ce.current?.scrollToIndex({align:`center`,index:t})},0))}return()=>{clearTimeout(e)}},[g,ke]);let Ze=PU();if(!ke)return null;let Qe=ae?`virtualized-message-list-dialog-manager-thread-${Ze}`:`virtualized-message-list-dialog-manager-${Ze}`;return(0,R.jsx)(BCe,{value:{scrollToBottom:He},children:(0,R.jsxs)(p6,{children:[(0,R.jsxs)(le,{children:[(0,R.jsxs)(_V,{id:Qe,children:[!ae&&Te&&(0,R.jsx)(he,{unreadCount:i?.unread_messages}),(0,R.jsxs)(`div`,{className:be?.virtualizedMessageList||`str-chat__virtual-list`,children:[(0,R.jsx)(i9,{disableDateSeparator:c,itemsRenderedRef:Ae,processedMessages:ke}),(0,R.jsx)(Bme,{atBottomStateChange:Ye,atBottomThreshold:100,atTopStateChange:Xe,atTopThreshold:100,className:`str-chat__message-list-scroll`,components:{EmptyPlaceholder:LCe,Header:ICe,Item:FCe,...me&&{Footer:()=>Re?(0,R.jsx)(me,{isMessageListScrolledToBottom:Re,scrollToBottom:He,threadList:ae}):null},...oe},computeItemKey:Je,context:{additionalMessageComposerProps:t,closeReactionSelectorOnClick:a,customClasses:be,customMessageRenderer:o,DateSeparator:se,firstUnreadMessageId:i?.first_unread_message_id,formatDate:l,head:p,lastOwnMessage:je,lastReadDate:i?.last_read,lastReadMessageId:i?.last_read_message_id,lastReceivedMessageId:Pe,loadingMore:v,Message:ve,messageActions:C,messageGroupStyles:Ie,MessageSystem:ue,numItemsPrepended:Ue,openThread:E,ownMessagesDeliveredToOthers:Ne,ownMessagesReadByOthers:Me,processedMessages:ke,reactionDetailsSort:O,renderText:k,returnAllReadData:A,shouldGroupByUser:ee,showAvatar:F,sortReactions:ne,threadList:ae,unreadMessageCount:i?.unread_messages,UnreadMessagesSeparator:ge,virtuosoRef:Ce},firstItemIndex:NCe(Ue),followOutput:qe,increaseViewportBy:{bottom:200,top:0},initialTopMostItemIndex:UCe(ke,g),itemContent:RCe,itemSize:HCe,itemsRendered:Ke,overscan:D,ref:Ce,style:{overflowX:`hidden`},totalCount:ke.length,...L,...M?{scrollSeek:M}:{},...s?{defaultItemHeight:s}:{}},We),(0,R.jsx)(de,{newMessageCount:i?.unread_messages,showNotification:ze||f}),(0,R.jsx)(pe,{isMessageListScrolledToBottom:Re,isNotAtLatestMessageSet:f,onClick:He,threadList:ae})]})]}),(0,R.jsx)(fe,{panel:Se})]}),De&&(0,R.jsx)(ce,{message:De})]})})};function GCe(e){let{jumpToLatestMessage:t,loadMore:n,loadMoreNewer:r}=zB(`VirtualizedMessageList`),{channel:i,channelUnreadUiState:a,hasMore:o,hasMoreNewer:s,highlightedMessageId:c,loadingMore:l,loadingMoreNewer:u,messages:d,notifications:f,read:p,suppressAutoscroll:m,thread:h}=KB(`VirtualizedMessageList`),g=e.messages||d;return(0,R.jsx)(b6,{children:(0,R.jsx)(WCe,{channel:i,channelUnreadUiState:e.channelUnreadUiState??a,hasMore:!!o,hasMoreNewer:!!s,highlightedMessageId:c,jumpToLatestMessage:t,loadingMore:!!l,loadingMoreNewer:!!u,loadMore:n,loadMoreNewer:r,messages:g,notifications:f,read:p,suppressAutoscroll:m,thread:h,...e})})}var KCe=e=>({sources:e.sources}),qCe=e=>{let[t,n]=(0,d.useState)([]),{sources:r}=J(e.state,KCe);return(0,d.useEffect)(()=>{let e=r.map(e=>e.state.subscribeWithSelector(e=>({isLoading:e.isLoading}),({isLoading:t})=>{n(n=>t?n.concat(e.type):n.filter(t=>t!==e.type))}));return()=>
502{e.forEach(e=>e())}},[r]),t},JCe=e=>{let{client:t}=K(`useConnectionRecoveredListener`);(0,d.useEffect)(()=>{let n=()=>{e&&e()};return t.on(`connection.recovered`,n),()=>{t.off(`connection.recovered`,n)}},[t,e])},g9=5e3,_9=2e3,YCe=e=>e.map(({direction:e=1,field:t})=>({[t]:e})),XCe=(e,t,n,r,i,a=g9,o)=>{let{addNotification:s}=GG(),{channelsQueryState:{error:c,setError:l,setQueryInProgress:u}}=K(`usePaginatedChannels`),{t:f}=Y(),[p,m]=(0,d.useState)([]),[h,g]=(0,d.useState)(!0),[_,v]=(0,d.useState)(void 0),[y,b]=(0,d.useState)(void 0),x=(0,d.useRef)(void 0),S=a<_9?_9:a??g9,C=(0,d.useMemo)(()=>JSON.stringify(t),[t]),w=(0,d.useMemo)(()=>JSON.stringify(n),[n]),T=async(a=`load-more`)=>{l(null);let c=a===`reload`?0:p.length,d=c===0;a===`reload`&&m([]),u(a);try{if(o)await o({currentChannels:p,queryType:a,setChannels:m,setHasNextPage:g}),v(void 0),b(void 0);else{let o={offset:c,...r},s=await e.queryChannels(t,n||{},o,{withResponse:!0}),l=a===`reload`?s.channels:(0,N0.default)([...p,...s.channels],`cid`);m(l),g(s.channels.length>=(o.limit??1));let u=s.predefined_filter,d=u?u.filter:void 0,f=u?.sort?YCe(u.sort):void 0;v(d),b(f),!c&&i&&i(l,m,{filters:d??t,sort:f??n})}}catch(e){console.warn(e),s({emitter:`ChannelList`,error:e instanceof Error?e:void 0,message:f(d?`Failed to load channels`:`Failed to load more channels`),severity:`error`,targetPanels:[`channel-list`],type:d?`api:channel-list:load:failed`:`api:channel-list:load-more:failed`}),d&&l(e)}u(null)},E=(0,d.useCallback)(()=>{let e=Date.now(),t=!x.current,n=x.current?e-x.current:0;!t&&n<S&&!c||(x.current=e,T(`reload`))},[c,T,S]);return(0,d.useEffect)(()=>{if(e.recoverStateOnReconnect)return;let{unsubscribe:t}=e.on(`connection.recovered`,E);return()=>{t()}},[e,E]),(0,d.useEffect)(()=>{T(`reload`)},[C,w]),{channels:p,effectiveFilters:_??t,effectiveSort:y??n,hasNextPage:h,loadNextPage:()=>T(),setChannels:m}};function v9({channels:e}){let t=null;for(let n of e){if(!C9(n))break;typeof t==`number`?t++:t=0}return t}var y9=({channels:e,channelToMove:t,channelToMoveIndexWithinChannels:n,sort:r})=>{let i=n??e.findIndex(e=>e.cid===t.cid),a=i>=0,o=i===0,s=b9(r),c=C9(t);if(o||s&&c)return e;let l=[...e];a&&l.splice(i,1);let u=null;return s&&(u=v9({channels:l})),l.splice(typeof u==`number`?u+1:0,0,t),l},b9=e=>{let t=x9({atIndex:0,sort:e,targetKey:`pinned_at`});return typeof t==`number`?Math.abs(t)===1:!1},x9=({atIndex:e,sort:t,targetKey:n})=>{if(!t)return null;let r=null;if(Array.isArray(t))r=t[e]??null;else{let i=0;for(let a in t){if(i!==e){i++;continue}if(a!==n)return null;r=t;break}}return r?.[n]??null},S9=e=>e?typeof e.archived==`boolean`:!1,C9=e=>e?typeof e.state.membership.pinned_at==`string`:!1,w9=e=>e?typeof e.state.membership.archived_at==`string`:!1,T9=({customHandler:e,event:t,setChannels:n})=>{if(typeof e==`function`)return e(n,t);n(e=>{let n=e.findIndex(e=>e.cid===t.cid);return n<0?e:(e.splice(n,1),[...e])})},ZCe=()=>{let{client:e}=K(),t=(0,d.useCallback)(({allowNewMessagesFromUnfilteredChannels:t,customHandler:n,event:r,filters:i,lockChannelOrder:a,setChannels:o,sort:s})=>{if(typeof n==`function`)return n(o,r);let c=r.channel_type,l=r.channel_id;!c||!l||o(n=>{let r=e.channel(c,l),o=n.indexOf(r),u=o>=0,d=C9(r),f=w9(r),p=S9(i),m=b9(s);return p&&f&&!i.archived||p&&!f&&i.archived||m&&d||a||!u&&!t?n:y9({channels:n,channelToMove:r,channelToMoveIndexWithinChannels:o,sort:s})})},[e]),n=(0,d.useCallback)(async({allowNewMessagesFromUnfilteredChannels:t,customHandler:n,event:r,filters:i,setChannels:a,sort:o})=>{if(typeof n==`function`)return n(a,r);if(!r.channel)return;let s=await rG({client:e,id:r.channel.id,type:r.channel.type}),c=S9(i);w9(s)&&c&&!i.archived||t&&a(e=>y9({channels:e,channelToMove:s,sort:o}))},[e]),r=(0,d.useCallback)(async({allowNewMessagesFromUnfilteredChannels:t,customHandler:n,event:r,setChannels:i,sort:a})=>{if(typeof n==`function`)return n(i,r);if(!r.channel||!t)return;let o=await rG({client:e,id:r.channel.id,members:r.channel.members?.reduce((e,{user:t,user_id:n})=>{let r=n||t?.id;return r&&e.push(r),e},[]),type:r.channel.type});i(e=>y9({channels:e,channelToMove:o,sort:a}))},[e]),i=(0,d.useCallback)(({customHandler:e,event:t,setChannels:n})=>{if(typeof e==`function`)return e(n,t);n(e=>e.filter(e=>e.cid!==t.channel?.cid))},[]),a=(0,d.useCallback)(({event:t,filters:n,lockChannelOrder:r,setChannels:i,sort:a})=>{if(!t.member?.user||t.member.user.id!==e.userID||!t.channel_type)return;let o=t.channel_type,s=t.channel_id,c=b9(a),l=S9(n);if(!c&&!l||r)return;
502let u=x9({atIndex:0,sort:a,targetKey:`pinned_at`});i(t=>{let r=e.channel(o,s),i=t.indexOf(r),a=i>=0,c=w9(r),d=C9(r),f=[...t];if(a&&f.splice(i,1),l&&c&&!n.archived||l&&!c&&n.archived)return f;let p=null;(u===1||u===-1&&!d)&&(p=v9({channels:f}));let m=typeof p==`number`?p+1:0;return f.splice(m,0,r),f})},[e]),o=(0,d.useCallback)(e=>T9(e),[]),s=(0,d.useCallback)(e=>T9(e),[]),c=(0,d.useCallback)(async({customHandler:t,event:n,filters:r,setChannels:i,sort:a})=>{if(typeof t==`function`)return t(i,n);if(!n.channel_id&&!n.channel_type)return;let o=await rG({client:e,id:n.channel_id,type:n.channel_type}),s=S9(r);w9(o)&&s&&!r.archived||i(e=>y9({channels:e,channelToMove:o,sort:a}))},[e]),l=(0,d.useCallback)(({customHandler:e,event:t,setChannels:n})=>{if(typeof e==`function`)return e(n,t);n(e=>[...e])},[]),u=(0,d.useCallback)(({customHandler:e,event:t,setChannels:n})=>{if(typeof e==`function`)return e(n,t);n(e=>{let n=e.findIndex(e=>e.cid===t.channel?.cid);if(n>-1&&t.channel){let r=e;return r[n].data={...t.channel,hidden:t.channel?.hidden??r[n].data?.hidden,own_capabilities:t.channel?.own_capabilities??r[n].data?.own_capabilities},[...r]}return e})},[]),f=(0,d.useCallback)(({event:e,setChannels:t})=>{t(t=>t.map(t=>{if(!e.user?.id||!t.state.members[e.user.id])return t;let n=t;return n.state.members[e.user.id].user=e.user,n}))},[]);return(0,d.useMemo)(()=>({handleChannelDeleted:o,handleChannelHidden:s,handleChannelTruncated:l,handleChannelUpdated:u,handleChannelVisible:c,handleMemberUpdated:a,handleMessageNew:t,handleNotificationAddedToChannel:r,handleNotificationMessageNew:n,handleNotificationRemovedFromChannel:i,handleUserPresenceChanged:f}),[o,s,l,u,c,a,t,r,n,i,f])},QCe=({allowNewMessagesFromUnfilteredChannels:e,customHandleChannelListShape:t,filters:n,lockChannelOrder:r,onAddedToChannel:i,onChannelDeleted:a,onChannelHidden:o,onChannelTruncated:s,onChannelUpdated:c,onChannelVisible:l,onMessageNew:u,onMessageNewHandler:f,onRemovedFromChannel:p,setChannels:m,sort:h})=>{let g=ZCe(),_=(0,d.useRef)(void 0),v=(0,d.useRef)(void 0);v.current=e=>{t?.({defaults:g,event:e,setChannels:m})},_.current=t=>{switch(t.type){case`message.new`:g.handleMessageNew({allowNewMessagesFromUnfilteredChannels:e,customHandler:f,event:t,filters:n,lockChannelOrder:r,setChannels:m,sort:h});break;case`notification.message_new`:g.handleNotificationMessageNew({allowNewMessagesFromUnfilteredChannels:e,customHandler:u,event:t,filters:n,lockChannelOrder:r,setChannels:m,sort:h});break;case`notification.added_to_channel`:g.handleNotificationAddedToChannel({allowNewMessagesFromUnfilteredChannels:e,customHandler:i,event:t,lockChannelOrder:r,setChannels:m,sort:h});break;case`notification.removed_from_channel`:g.handleNotificationRemovedFromChannel({customHandler:p,event:t,setChannels:m});break;case`channel.deleted`:g.handleChannelDeleted({customHandler:a,event:t,setChannels:m});break;case`channel.hidden`:g.handleChannelHidden({customHandler:o,event:t,setChannels:m});break;case`channel.visible`:g.handleChannelVisible({customHandler:l,event:t,filters:n,setChannels:m,sort:h});break;case`channel.truncated`:g.handleChannelTruncated({customHandler:s,event:t,setChannels:m});break;case`channel.updated`:g.handleChannelUpdated({customHandler:c,event:t,setChannels:m});break;case`user.presence.changed`:g.handleUserPresenceChanged({event:t,setChannels:m});break;case`member.updated`:g.handleMemberUpdated({event:t,filters:n,lockChannelOrder:r,setChannels:m,sort:h});break;default:break}};let y=(0,d.useCallback)(e=>{_.current?.(e)},[]);return{customHandler:(0,d.useMemo)(()=>t?e=>{v.current?.(e)}:null,[t]),defaultHandler:y}},$Ce=e=>{let{client:t}=K();(0,d.useEffect)(()=>t.on(`all`,e).unsubscribe,[t,e])},ewe=e=>{let{children:t,error:n=null,loading:r=!1}=e,{LoadingErrorIndicator:i=Gge,LoadingIndicator:a=Ghe}=q(`ChannelListUI`),{t:o}=Y(`ChannelListUI`);return n?(0,R.jsx)(i,{error:n}):(0,R.jsx)(`div`,{className:`str-chat__channel-list-inner`,children:(0,R.jsx)(`div`,{"aria-label":o(`aria/Channel list`),className:`str-chat__channel-list-inner__main`,role:`listbox`,children:r?(0,R.jsx)(a,{}):t})})},E9=(0,d.createContext)(void 0),twe=({children:e,value:t})=>(0,R.jsx)(E9.Provider,{value:t,children:e}),D9=()=>(0,d.useContext)(E9),nwe=e=>({isActive:e.isActive,searchQuery:e.searchQuery}),rwe=()=>{let{t:e}=Y(),{disabled:t,exitSearchOnInputBlur:n,filterButtonsContainerRef:r,placeholder:i,searchController:a}=D9(),o=qCe(a),s=d.useRef(null),c=PU(),[l,u]=(0,d.useState)(null),{isActive:f,searchQuery:p}=J(a.state,nwe);return(0,d.useEffect)(()=>
502{if(!l)return;let e=e=>{e.key===`Escape`&&(l.blur(),a.exit())};return document.addEventListener(`keydown`,e),()=>{document.removeEventListener(`keydown`,e)}},[a,l]),(0,R.jsxs)(`div`,{className:`str-chat__search-bar`,"data-testid":`search-bar`,role:`search`,children:[(0,R.jsxs)(`div`,{className:G(`str-chat__search-bar__input-wrapper`,{"str-chat__search-bar__input-wrapper--active":f}),children:[(0,R.jsx)(`label`,{htmlFor:c,children:(0,R.jsx)(v6,{children:e(`Search`)})}),(0,R.jsx)(rU,{}),(0,R.jsx)(`input`,{className:`str-chat__search-bar__input`,"data-testid":`search-input`,disabled:t,id:c,onBlur:({currentTarget:e,relatedTarget:t})=>{n&&!e.value&&!r.current?.contains(t)&&(!s.current||t!==s.current)&&a.exit()},onChange:e=>{e.target.value?a.search(e.target.value):e.target.value||a.clear()},onFocus:a.activate,placeholder:i??e(`Search`),ref:u,type:`text`,value:p}),p&&(0,R.jsx)(nH,{appearance:`ghost`,"aria-label":e(`aria/Clear search`),circular:!0,className:`str-chat__search-bar__clear-button`,"data-testid":`clear-input-button`,disabled:o.length>0,onClick:()=>{a.clear(),l?.focus()},ref:s,size:`xs`,variant:`secondary`,children:(0,R.jsx)(FH,{})})]}),f&&(0,R.jsx)(nH,{appearance:`ghost`,"aria-label":e(`aria/Exit search`),className:`str-chat__search-bar__exit-search-button`,"data-testid":`search-bar-button`,onClick:()=>{l?.blur(),a.exit()},size:`sm`,variant:`secondary`,children:e(`Cancel`)})]})},iwe={channels:({item:e})=>{let{setActiveChannel:t}=K(),{setChannels:n}=HB();return(0,R.jsx)(H9,{channel:e,className:`str-chat__search-result`,onSelect:(0,d.useCallback)(()=>{t(e),n?.(t=>(0,N0.default)([e,...t],`cid`))},[e,t,n])})},messages:({item:e})=>{let{channel:t,client:n,searchController:r,setActiveChannel:i}=K(),{setChannels:a}=HB(),o=(0,d.useMemo)(()=>{let{channel:t}=e,r=t?.type??`unknown`,i=t?.id??`unknown`;return n.channel(r,i)},[n,e]),s=(0,d.useCallback)(async()=>{o&&(await o.state.loadMessageIntoState(e.id,void 0,25),r._internalState.partialNext({focusedMessage:e}),i(o),a?.(e=>(0,N0.default)([o,...e],`cid`)))},[o,e,r,i,a]),c=(0,d.useCallback)(()=>e.text,[e]);return o?(0,R.jsx)(H9,{active:o.cid===t?.cid&&e.id===r._internalState.getLatestValue().focusedMessage?.id,channel:o,className:`str-chat__search-result`,getLatestMessagePreview:c,onSelect:s}):null},users:({item:e})=>{let{client:t,setActiveChannel:n}=K(),{setChannels:r}=HB(),{directMessagingChannelType:i}=D9(),{t:a}=Y(),o=(0,d.useCallback)(()=>{let a=t.channel(i,{members:[t.userID,e.id]});a.watch(),n(a),r?.(e=>(0,N0.default)([a,...e],`cid`))},[t,e,n,r,i]);return(0,R.jsx)(`div`,{className:`str-chat__search-result-container`,children:(0,R.jsxs)(`button`,{"aria-label":a(`aria/Select User Channel: {{ name }}`,{name:e.name||``}),className:`str-chat__search-result str-chat__search-result--user`,"data-testid":`search-result-user`,onClick:o,role:`option`,children:[(0,R.jsx)(k6,{imageUrl:e.image,isOnline:e.online,size:`xl`,userName:e.name||e.id}),(0,R.jsxs)(`div`,{className:`str-chat__search-result-data`,children:[(0,R.jsx)(`div`,{className:`str-chat__search-result__display-name`,children:e.name||e.username||e.id}),(0,R.jsx)(T8,{customClass:`str-chat__search-result__last-active-timestamp`,timestamp:e.last_active})]})]})})}},O9=(0,d.createContext)(void 0),awe=({children:e,value:t})=>(0,R.jsx)(O9.Provider,{value:t,children:e}),k9=()=>(0,d.useContext)(O9),owe=()=>{let{t:e}=Y(),{searchSource:t}=k9();return(0,R.jsx)(`div`,{className:`str-chat__search-source-results__loading-indicator`,"data-testid":`search-loading-indicator`,children:e(`Searching for {{ searchSourceType }}...`,{searchSourceType:t.type})})},swe=e=>({hasNext:e.hasNext,isLoading:e.isLoading}),cwe=()=>{let{t:e}=Y(),{SearchSourceResultsLoadingIndicator:t=owe}=q(),{searchSource:n}=k9(),{hasNext:r,isLoading:i}=J(n.state,swe);return(0,R.jsx)(`div`,{className:`str-chat__search-source-result-list__footer`,"data-testid":`search-footer`,children:i?(0,R.jsx)(t,{}):r?null:(0,R.jsx)(`div`,{className:`str-chat__search-source-results---empty`,children:e(`All results loaded`)})})},lwe=e=>({items:e.items}),uwe=({loadMoreDebounceMs:e=100,loadMoreThresholdPx:t=80,SearchResultItems:n=iwe})=>{let{SearchSourceResultListFooter:r=cwe}=q(),{searchSource:i}=k9(),{items:a}=J(i.state,lwe),o=n[i.type];return o?(0,R.jsx)(`div`,{className:`str-chat__search-source-result-list`,"data-testid":`search-source-result-list`,children:(0,R.jsxs)(e7,{loadNextDebounceMs:e,loadNextOnScrollToBottom:i.search,threshold:t,children:[a?.map((e,t)=>(0,R.jsx)(o,{item:e},`source-search-result-${i.type}-${t}`)),(0,R.jsx)(r,{})]})}):null},dwe=()=>{let{t:e}=Y();return(0,R.jsx)(`div`,{className:`str-chat__search-source-results-empty`,children:e(`No results found`)})},fwe=()=>null,pwe=e=>({isLoading:e.isLoading,items:e.items}),mwe=({searchSource:e})=>{let{SearchSourceResultList:t=uwe,SearchSourceResultsEmpty:n=dwe,SearchSourceResultsHeader:r=fwe}=q(),{isLoading:i,items:a}=J(e.state,pwe);return!a&&!i?null:(0,R.jsx)(awe,{value:{searchSource:e},children:(0,R.jsxs)(`div`,{className:`str-chat__search-source-results`,"data-testid":`search-source-results`,children:[(0,R.jsx)(r,{}),a?.length||i?(0,R.jsx)(t,{}):(0,R.jsx)(n,{})]})})},hwe=e=>({isActive:e.isActive}),gwe=({source:e})=>{let{t}=Y(),{searchController:n}=D9(),{isActive:r}=J(e.state,hwe),i=`search-results-header-filter-source-button-label--${e.type}`,a=(0,d.useMemo)(()=>({"search-results-header-filter-source-button-label--channels":t(`search-results-header-filter-source-button-label--channels`),"search-results-header-filter-source-button-label--messages":t(`search-results-header-filter-source-button-label--messages`),"search-results-header-filter-source-button-label--users":t(`search-results-header-filter-source-button-label--users`)}),[t])[i]??t(i);return(0,R.jsx)(nH,{appearance:`outline`,"aria-label":t(`aria/Search results header filter button for: {{ source }}`,{source:a}),"aria-pressed":r,className:G(`str-chat__search-results-header__filter-source-button`,{"str-chat__search-results-header__filter-source-button--active":r}),onClick:()=>{e.isActive?n.deactivateSource(e.type):(n.activateSource(e.type),n.searchQuery&&!e.items?.length&&e.search(n.searchQuery))},size:`xs`,variant:`secondary`,children:a},i)},_we=()=>{let{filterButtonsContainerRef:e,searchController:t}=D9();return t.sources.length<2?null:(0,R.jsx)(`div`,{className:`str-chat__search-results-header`,"data-testid":`search-results-header`,children:(0,R.jsx)(`div`,{className:`str-chat__search-results-header__filter-source-buttons`,"data-testid":`filter-source-buttons`,ref:e,children:t.sources.map(e=>(0,R.jsx)(gwe,{source:e},e.type))})})},vwe=()=>{let{t:e}=Y();return(0,R.jsx)(`div`,{className:`str-chat__search-results-presearch`,children:e(`Start t
502yping to search`)})},ywe=e=>({activeSources:e.sources.filter(e=>e.isActive),isActive:e.isActive,searchQuery:e.searchQuery}),bwe=()=>{let{t:e}=Y(`ResultsContainer`),{SearchResultsHeader:t=_we,SearchResultsPresearch:n=vwe,SearchSourceResults:r=mwe}=q(),{searchController:i}=D9(),{activeSources:a,isActive:o,searchQuery:s}=J(i.state,ywe);return o?(0,R.jsxs)(`div`,{"aria-label":e(`aria/Search results`),className:`str-chat__search-results`,children:[(0,R.jsx)(t,{}),s?a.map(e=>(0,R.jsx)(r,{searchSource:e},e.type)):(0,R.jsx)(n,{activeSources:a})]}):null},xwe=e=>({isActive:e.isActive}),Swe=({directMessagingChannelType:e=`messaging`,disabled:t,exitSearchOnInputBlur:n=!1,placeholder:r})=>{let{SearchBar:i=rwe,SearchResults:a=bwe}=q(),o=(0,d.useRef)(null),s=(0,d.useRef)(null),{searchController:c}=K(),{isActive:l}=J(c.state,xwe);return(0,R.jsx)(twe,{value:{containerRef:o,directMessagingChannelType:e,disabled:t,exitSearchOnInputBlur:n,filterButtonsContainerRef:s,placeholder:r,searchController:c},children:(0,R.jsxs)(`div`,{className:G(`str-chat__search`,{"str-chat__search--active":l}),"data-testid":`search`,ref:o,children:[(0,R.jsx)(i,{}),(0,R.jsx)(a,{})]})})},Cwe=d.memo(({children:e,isLoading:t,onClick:n})=>{let{t:r}=Y(`UnMemoizedLoadMoreButton`),i=e??r(`Load more`);return(0,R.jsx)(`div`,{className:`str-chat__load-more-button`,children:(0,R.jsx)(nH,{appearance:`ghost`,"aria-label":r(`Load more`),"data-testid":`load-more-button`,disabled:t,onClick:n,size:`sm`,variant:`secondary`,children:t?(0,R.jsx)(e8,{}):i})})}),wwe=d.memo(e=>{let{children:t,hasNextPage:n,isLoading:r,LoadMoreButton:i=Cwe,loadNextPage:a,reverse:o}=e;return(0,R.jsxs)(R.Fragment,{children:[!o&&t,n&&(0,R.jsx)(i,{isLoading:r,onClick:a}),o&&t]})}),Twe=()=>{let{t:e}=Y(),{channel:t}=K(),{HeaderEndContent:n}=q();return(0,R.jsxs)(`div`,{className:`str-chat__channel-list__header`,children:[(0,R.jsx)(`div`,{className:`str-chat__channel-list__header__title`,children:e(`Chats`)}),t&&n&&(0,R.jsx)(n,{})]})},Ewe={},Dwe={},A9={},Owe=e=>({searchIsActive:e.isActive});d.memo(e=>{let{allowNewMessagesFromUnfilteredChannels:t=!0,channelRenderFilterFn:n,customActiveChannel:r,customQueryChannels:i,EmptyStateIndicator:a=FU,filters:o={},getLatestMessagePreview:s,lockChannelOrder:c=!1,onAddedToChannel:l,onChannelDeleted:u,onChannelHidden:f,onChannelTruncated:p,onChannelUpdated:m,onChannelVisible:h,onMessageNew:g,onMessageNewHandler:_,onRemovedFromChannel:v,options:y,Paginator:b=wwe,recoveryThrottleIntervalMs:x,renderChannels:S,sendChannelsToList:C=!1,setActiveChannelOnMount:w=!0,showChannelSearch:T=!1,sort:E=A9,watchers:D={}}=e,O=PU(),{channel:k,channelsQueryState:A,client:j,customClasses:M,searchController:N,setActiveChannel:P,theme:ee,useImageFlagEmojisOnWindows:F}=K(`ChannelList`),{ChannelListUI:te=ewe,NotificationList:ne=X9,Search:re=Swe}=q(),I=(0,d.useRef)(null),[ie,ae]=(0,d.useState)(0),{searchIsActive:oe}=J(N.state,Owe),L=async(e,t,n)=>{if(e.length){if(r){let i=e.find(e=>e.id===r);if(i||([i]=await j.queryChannels({id:r})),i){P(i,D),t(y9({channels:e,channelToMove:i,sort:n.sort}));return}}w&&P(e[0],D)}},se=(0,d.useCallback)(()=>ae(e=>e+1),[]),{channels:ce,effectiveFilters:le,effectiveSort:ue,hasNextPage:de,loadNextPage:fe,setChannels:pe}=XCe(j,o||Ewe,E||A9,y||Dwe,L,x,i),me=n?n(ce):ce,{customHandler:he,defaultHandler:ge}=QCe({allowNewMessagesFromUnfilteredChannels:t,filters:le,lockChannelOrder:c,onAddedToChannel:l,onChannelDeleted:u,onChannelHidden:f,onChannelTruncated:p,onChannelUpdated:m,onChannelVisible:h,onMessageNew:g,onMessageNewHandler:_,onRemovedFromChannel:v,setChannels:pe,sort:ue});$Ce(he??ge),JCe(se),(0,d.useEffect)(()=>{let e=e=>{e.cid===k?.cid&&P()};return j.on(`channel.deleted`,e),j.on(`channel.hidden`,e),()=>{j.off(`channel.deleted`,e),j.off(`channel.hidden`,e)}},[k?.cid]);let _e=e=>(0,R.jsx)(H9,{activeChannel:k,channel:e,channelUpdateCount:ie,getLatestMessagePreview:s,setActiveChannel:P,watchers:D},e.cid),ve=G(M?.chat??`str-chat`,ee,M?.channelList??`str-chat__channel-list`,{"str-chat--windows-flags":F&&navigator.userAgent.match(/Win/)}),ye=!oe;return(0,R.jsx)(VB,{value:{channels:ce,hasNextPage:de,loadNextPage:fe,setChannels:pe},children:(0,R.jsx)(`div`,{className:ve,ref:I,children:(0,R.jsxs)(_V,{id:`channel-list-dialog-manager-${O}`,children:[(0,R.jsx)(Twe,{}),T&&(0,R.jsx)(re,{}),ye&&(0,R.jsx)(te,{error:A.error,loadedChannels:C?me:void 0,loading:!!A.queryInProgress&&[`reload`,`uninitialized`].includes(A.queryInProgress),setChannels:pe,children:me?.length?(0,R.jsx)(b,{hasNextPage:de,isLoading:A.queryInProgress===`load-more`,loadNextPage:fe,children:S?S(me,_e):me.map(e=>_e(e))}):(0,R.jsx)(a,{listType:`channel`})}),(0,R.jsx)(ne,{panel:`channel-list`})]})})})});var kwe=()=>{};function j9({channel:e,selector:t,stateChangeEventKeys:n=[`all`]}){return(0,kB.useSyncExternalStore)((0,d.useCallback)(r=>{if(!e)return kwe;let i=n.map(n=>e.on(n,()=>{r(t(e))}));return()=>
502i.forEach(e=>e.unsubscribe())},[e,t,n]),(0,d.useCallback)(()=>{if(e)return t(e)},[e,t]))}var Awe=e=>e.state.membership,jwe=[`member.updated`];function M9(e){return j9({channel:e,selector:Awe,stateChangeEventKeys:jwe})}var Mwe=e=>e.state.members,Nwe=[`member.updated`,`member.added`,`member.removed`,`user.banned`,`user.unbanned`,`user.deleted`,`user.presence.changed`];function Pwe(e){return j9({channel:e,selector:Mwe,stateChangeEventKeys:Nwe})}var N9=e=>{let{client:t}=K(`useIsChannelMuted`),[n,r]=(0,d.useState)(e.muteStatus());return(0,d.useEffect)(()=>{let n=()=>r(e.muteStatus());return t.on(`notification.channel_mutes_updated`,n),()=>t.off(`notification.channel_mutes_updated`,n)},[n]),n},P9=()=>{let{addNotification:e}=GG(),{channel:t}=V9(),{t:n}=Y(),{muted:r}=N9(t),[i,a]=(0,d.useState)(!1);return{"aria-pressed":r,disabled:i,onClick:async i=>{i.stopPropagation();try{a(!0),r?(await t.unmute(),e({context:{channel:t},emitter:L9.name,message:n(`Channel unmuted`),severity:`success`,type:`api:channel:unmute:success`})):(await t.mute(),e({context:{channel:t},emitter:L9.name,message:n(`Channel muted`),severity:`success`,type:`api:channel:mute:success`}))}catch(r){e({context:{channel:t},emitter:L9.name,error:r instanceof Error?r:Error(`An unknown error occurred`),message:n(`Failed to update channel mute status`),severity:`error`,type:`api:channel:mute:failed`})}finally{a(!1)}},title:n(r?`Unmute`:`Mute`)}},F9=()=>{let{channel:e}=V9(),{addNotification:t}=GG(),n=M9(e),{t:r}=Y(),[i,a]=(0,d.useState)(!1);return{"aria-pressed":typeof n.archived_at==`string`,disabled:i,onClick:async i=>{i.stopPropagation();try{a(!0),n.archived_at?(await e.unarchive(),t({context:{channel:e},emitter:L9.name,message:r(`Channel unarchived`),severity:`success`,type:`api:channel:unarchive:success`})):(await e.archive(),t({context:{channel:e},emitter:L9.name,message:r(`Channel archived`),severity:`success`,type:`api:channel:archive:success`}))}catch(n){t({context:{channel:e},emitter:L9.name,error:n instanceof Error?n:Error(`An unknown error occurred`),message:r(`Failed to update channel archive status`),severity:`error`,type:`api:channel:archive:failed`})}finally{a(!1)}},title:n.archived_at?r(`Unarchive`):r(`Archive`)}},I9={dropdown:{Archive(){let e=F9();return(0,R.jsx)(P6,{"aria-label":e.title,"data-testid":`dropdown-action-archive`,Icon:kU,...e,children:e.title})},Ban(){let{client:e}=K(),{addNotification:t}=GG(),{t:n}=Y(),{channel:r}=V9(),[i,a]=(0,d.useState)(!1),o=Pwe(r),s=Object.values(o||{}).some(t=>t.user?.id!==e.userID&&t.banned),c=n(s?`Unblock User`:`Block User`);return(0,R.jsx)(P6,{"aria-label":c,"data-testid":`dropdown-action-ban`,disabled:i,Icon:MH,onClick:async()=>{try{a(!0);let i=Object.keys(r.state.members).find(t=>t!==e.userID);if(!i)return;s?(await r.unbanUser(i),t({context:{channel:r},emitter:L9.name,message:n(`User unblocked`),severity:`success`,type:`api:user:unban:success`})):(await r.banUser(i,{}),t({context:{channel:r},emitter:L9.name,message:n(`User blocked`),severity:`success`,type:`api:user:ban:success`}))}catch(e){t({context:{channel:r},emitter:L9.name,error:e instanceof Error?e:Error(`An unknown error occurred`),message:n(`Failed to block user`),severity:`error`,type:`api:user:ban:failed`})}finally{a(!1)}},children:c})},Leave(){let{t:e}=Y(),{channel:t}=V9(),{client:n}=K(),{addNotification:r}=GG(),[i,a]=(0,d.useState)(!1),o=e(`Leave Channel`);return(0,R.jsx)(P6,{"aria-label":o,"data-testid":`dropdown-action-leave`,disabled:i,Icon:aH,onClick:async i=>{i.stopPropagation();try{a(!0),await t.removeMembers([n.userID]),r({context:{channel:t},emitter:L9.name,message:e(`Left channel`),severity:`success`,type:`api:channel:leave:success`})}catch(n){r({context:{channel:t},emitter:L9.name,error:n instanceof Error?n:Error(`An unknown error occurred`),message:e(`Failed to leave channel`),severity:`error`,type:`api:channel:leave:failed`})}finally{a(!1)}},title:o,variant:`destructive`,children:o})},Mute(){let e=P9();return(0,R.jsx)(P6,{"aria-label":e.title,"data-testid":`dropdown-action-mute`,Icon:sU,...e,children:e.title})},Pin(){let{t:e}=Y(),{addNotification:t}=GG(),{channel:n}
502=V9(),r=M9(n),{dialog:i}=$B({id:L9.getDialogId({channelId:n.id})}),[a,o]=(0,d.useState)(!1),s=r.pinned_at?e(`Unpin`):e(`Pin`);return(0,R.jsx)(P6,{"aria-label":s,"data-testid":`dropdown-action-pin`,disabled:a,Icon:hU,onClick:async a=>{a.stopPropagation();let s=null;try{o(!0),r.pinned_at?(await n.unpin(),t({context:{channel:n},emitter:L9.name,message:e(`Channel unpinned`),severity:`success`,type:`api:channel:unpin:success`})):(await n.pin(),t({context:{channel:n},emitter:L9.name,message:e(`Channel pinned`),severity:`success`,type:`api:channel:pin:success`}))}catch(r){s=r instanceof Error?r:Error(`An unknown error occurred`),t({context:{channel:n},emitter:L9.name,error:s,message:e(`Failed to update channel pinned status`),severity:`error`,type:`api:channel:pin:failed`})}finally{s||i?.close(),o(!1)}},title:s,children:s})}},quick:{Archive(){let e=F9();return(0,R.jsx)(nH,{appearance:`ghost`,"aria-label":e.title,circular:!0,"data-testid":`quick-action-archive`,size:`sm`,variant:`secondary`,...e,children:(0,R.jsx)(kU,{})})},Mute(){let e=P9();return(0,R.jsx)(nH,{appearance:`ghost`,"aria-label":e.title,circular:!0,"data-testid":`quick-action-mute`,size:`sm`,variant:`secondary`,...e,children:(0,R.jsx)(sU,{})})}},QuickDropdownToggle:(0,d.forwardRef)((e,t)=>{let{channel:n}=V9(),{t:r}=Y(),i=L9.getDialogId({channelId:n.id}),{dialog:a,dialogManager:o}=$B({id:i}),s=nV(i,o?.id);return(0,R.jsx)(nH,{appearance:`ghost`,"aria-expanded":s,"aria-label":r(`aria/Open Channel Actions Menu`),"aria-pressed":s,circular:!0,"data-testid":`channel-list-item-dropdown-toggle`,onClick:e=>{e.stopPropagation(),a.toggle()},ref:t,size:`sm`,variant:`secondary`,children:(0,R.jsx)(BH,{})})})};I9.QuickDropdownToggle.displayName=`QuickDropdownToggle`;var Fwe=[{Component:I9.QuickDropdownToggle,placement:`quick-dropdown-toggle`},{Component:I9.quick.Mute,placement:`quick`,type:`mute`},{Component:I9.dropdown.Archive,placement:`dropdown`,type:`archive`},{Component:I9.dropdown.Ban,placement:`dropdown`,type:`ban`},{Component:I9.dropdown.Pin,placement:`dropdown`,type:`pin`},{Component:I9.dropdown.Leave,placement:`dropdown`,type:`leave`}],Iwe=e=>{let{channel:t}=V9(),n=M9(t),r=t.data?.member_count??0,i=n.user!==void 0,a=i&&r===2,o=t.data?.own_capabilities;return(0,d.useMemo)(()=>e.filter(e=>{if(e.placement===`quick-dropdown-toggle`)return!0;switch(e.type){case`archive`:return i;case`mute`:return o?.includes(`mute-channel`);case`ban`:return a&&o?.includes(`ban-channel-members`);case`leave`:return o?.includes(`leave-channel`);case`pin`:return i;default:return!0}}),[e,i,o,a])},L9=()=>{let{ContextMenu:e=U6}=q(),{t}=Y(),{channel:n}=V9(),[r,i]=d.useState(null),[a,o]=d.useState(!1),s=L9.getDialogId({channelId:n.id}),{dialog:c,dialogManager:l}=$B({id:s}),u=nV(s,l?.id),f=d.useCallback(()=>{o(!0),c?.close(),requestAnimationFrame(()=>{if(!r?.isConnected){o(!1);return}r.focus(),requestAnimationFrame(()=>{document.activeElement!==r&&o(!1)})})},[c,r]),{dropdownActionSet:p,quickActionSet:m,quickDropdownToggleAction:h}=U7(Iwe(Fwe));return m.length+p.length===0?null:(0,R.jsxs)(`div`,{className:G(`str-chat__channel-list-item__action-buttons`,{"str-chat__channel-list-item__action-buttons--active":u||a}),"data-testid":`channel-list-item-action-buttons`,onFocusCapture:()=>{o(!1)},children:[h&&p.length>0&&(0,R.jsx)(h.Component,{ref:i}),m.map(({Component:e,type:t})=>(0,R.jsx)(e,{},t)),(0,R.jsx)(e,{"aria-label":t(`aria/Channel Actions`),className:`str-chat__channel-list-item__action-buttons-context-menu`,"data-testid":`channel-list-item-context-menu`,dialogManagerId:l?.id,id:c.id,onClose:f,placement:`bottom-start`,referenceElement:r,tabIndex:-1,trapFocus:!0,children:p.map(({Component:e,type:t})=>(0,R.jsx)(e,{},t))})]})};L9.getDialogId=({channelId:e})=>`channel-action-buttons-${e}`,L9.displayName=`ChannelListItemActionButtons`;function Lwe({lastMessage:e}){let{t,tDateTimeParser:n}=Y(`ChannelListItemTimestamp`),r=e?.created_at,i=r&&kV(r)?r.toISOString():void 0,a=(0,d.useMemo)(()=>NV({messageCreatedAt:i,t,tDateTimeParser:n,timestampTranslationKey:`timestamp/ChannelPreviewTimestamp`}),[i,t,n]);return a?(0,R.jsx)(`time`,{className:`str-chat__channel-list-item-timestamp`,dateTime:i,children:a}):null}var R9=[`video/mp4`,`video/ogg`,`video/webm`,`video/quicktime`];function z9(e){return e?e.type===`giphy`?`giphy`:db(e)?`link`:mb(e)?`image`:yb(e,R9)?`video`:_b(e)?`voice`:gb(e)||pb(e,R9)?`file`:`unsupported`:`text`}function Rwe(e,t,n){switch(e){case`image`:return n(`imageCount`,{count:t});case`video`:return n(`videoCount`,{count:t});case`voice`:return n(`voiceMessageCount`,{count:t});case`link`:return n(`linkCount`,{count:t});case`file`:return n(`fileCount`,{count:t});case`unsupported`:return n(`Unsupported attachment`);default:return n(`fileCount`,{count:t})}}var zwe=({latestMessage:e,messageDeliveryStatus:t,participantCount:n})=>{let{client:r}=K(`useLatestMessagePreview`),{t:i,userLanguage:a}=Y(`useLatestMessagePreview`);return(0,d.useMemo)(()=>
502{if(!e)return{text:i(`Nothing yet...`),type:`empty`};if(e.status===`failed`||e.type===`error`)return{text:i(`Message failed to send`),type:`error`};let o=e.user?.id===r.user?.id,s;o&&(s=t??e.status);let c;if(o?c=i(`You`):!o&&n!==void 0&&n>2&&(c=e.user?.name||e.user?.id),_W(e))return{deliveryStatus:s,senderName:c,text:i(`Message deleted`),type:`deleted`};if(e.poll)return{deliveryStatus:s,senderName:c,text:i(`Poll`),type:`poll`};let l=u6({language:a,message:e})||e.text;if(e.shared_location)return{deliveryStatus:s,senderName:c,text:l||i(`Location`),type:`location`};if(e.attachments&&e.attachments.length){let t=e.attachments,n,[r]=t,a=z9(r);n=t.every(e=>z9(e)===a)?a:`file`;let o=n===`giphy`?`GIPHY ${r.title??``}`.trim():l||(t.length===1&&n!==`voice`&&n!==`unsupported`?r.fallback||r.title:``)||Rwe(n,t.length,i);if(t.length===1&&typeof r.duration==`number`){let e=`${Math.floor(r.duration/60)}:${(Math.ceil(r.duration)%60).toString().padStart(2,`0`)}`;o+=` (${e})`}return{deliveryStatus:s,senderName:c,text:o,type:n}}return l?{deliveryStatus:s,senderName:c,text:l,type:`text`}:{text:i(`Empty message...`),type:`empty`}},[r.user?.id,e,t,n,i,a])},Bwe={delivered:HH,read:HH,sending:IH,sent:DH},Vwe={deleted:MH,error:JH,file:eU,giphy:jU,image:wH,link:TH,location:iU,unsupported:QH,video:EU,voice:aU},Hwe=({latestMessage:e,messageDeliveryStatus:t,participantCount:n})=>{let{deliveryStatus:r,senderName:i,text:a,type:o}=zwe({latestMessage:e,messageDeliveryStatus:t,participantCount:n}),s=r?Bwe[r]:void 0,c=Vwe[o];return(0,R.jsxs)(`div`,{className:G(`str-chat__summarized-message-preview`,{[`str-chat__summarized-message-preview--${o}`]:o}),children:[o!==`error`&&(0,R.jsxs)(R.Fragment,{children:[s&&(0,R.jsx)(`span`,{className:G(`str-chat__summarized-message-preview__delivery-status`,{[`str-chat__summarized-message-preview__delivery-status--${r}`]:r}),children:(0,R.jsx)(s,{})}),i&&(0,R.jsxs)(`span`,{className:`str-chat__summarized-message-preview__sender`,children:[i,`:`]})]}),c&&(0,R.jsx)(c,{}),(0,R.jsx)(`span`,{className:`str-chat__summarized-message-preview__text`,children:a})]})},Uwe=d.memo(e=>{let{active:t,channel:n,className:r=``,displayImage:i,displayTitle:a,groupChannelDisplayInfo:o,lastMessage:s,messageDeliveryStatus:c,muted:l,onSelect:u,pinned:f,setActiveChannel:p,unread:m,watchers:h}=e,{Avatar:g=fhe,ChannelListItemActionButtons:_=L9}=q(),{t:v}=Y(),y=(0,d.useRef)(null),b=a||n.state.messages[n.state.messages.length-1]?.user?.id;return(0,R.jsxs)(`div`,{className:`str-chat__channel-list-item-container`,children:[(0,R.jsxs)(`button`,{"aria-label":v(`aria/Select Channel: {{ channelName }}`,{channelName:a||``}),"aria-selected":t,className:G(`str-chat__channel-list-item`,{"str-chat__channel-list-item--muted":l,"str-chat__channel-list-item--pinned":f,"str-chat__channel-list-item--unread":typeof m==`number`&&m>0},r),"data-testid":`channel-list-item-button`,onClick:e=>{u?u(e):p&&p(n,h),y?.current&&y.current.blur()},ref:y,role:`option`,children:[(0,R.jsx)(g,{displayMembers:o?.members,imageUrl:i,size:`xl`,userName:b}),(0,R.jsxs)(`div`,{className:`str-chat__channel-list-item-data`,children:[(0,R.jsxs)(`div`,{className:`str-chat__channel-list-item-data__first-row`,children:[(0,R.jsxs)(`div`,{className:`str-chat__channel-list-item-data__title`,children:[(0,R.jsx)(`span`,{children:a||`N/A`}),f&&(0,R.jsx)(hU,{}),l&&(0,R.jsx)(sU,{})]}),(0,R.jsxs)(`div`,{className:`str-chat__channel-list-item-data__timestamp-and-badge`,children:[(0,R.jsx)(Lwe,{lastMessage:s}),typeof m==`number`&&m>0&&(0,R.jsx)(A6,{"data-testid":`unread-badge`,size:`md`,variant:`primary`,children:m})]})]}),(0,R.jsx)(Hwe,{latestMessage:s,messageDeliveryStatus:c,participantCount:n.data?.member_count})]})]}),(0,R.jsx)(_,{})]})}),Wwe=({channel:e,lastMessage:t})=>{let{client:n}=K(),[r,i]=(0,d.useState)(),a=(0,d.useCallback)(e=>n.user&&e&&e.user?.id===n.user.id,[n]);return(0,d.useEffect)(()=>{t||i(void 0);let r=a(t);if(!t?.created_at||!r)return;let o={msgId:t.id,timestampMs:t.created_at.getTime()},s=e.messageReceiptsTracker.readersForMessage(o),c=e.messageReceiptsTracker.deliveredForMessage(o);i(s.length>1||s.length===1&&s[0].id!==n.user?.id?`read`:c.length>1||c.length===1&&c[0].id!==n.user?.id?`delivered`:`sent`)},[e,n,a,t]),(0,d.useEffect)(()=>{let t=e=>a(e.message)?i(`sent`):i(void 0);return e.on(`message.new`,t),()=>{e.off(`message.new`,t)}},[e,a]),(0,d.useEffect)(()=>
502{if(!a(t))return;let r=e=>{e.user?.id!==n.user?.id&&t&&t.id===e.last_delivered_message_id&&i(`delivered`)},o=e=>{e.user?.id!==n.user?.id&&i(`read`)};return e.on(`message.delivered`,r),e.on(`message.read`,o),()=>{e.off(`message.delivered`,r),e.off(`message.read`,o)}},[e,n,a,t]),{messageDeliveryStatus:r}},B9=d.createContext({channel:null}),V9=()=>(0,d.useContext)(B9),H9=e=>{let{active:t,channel:n,channelUpdateCount:r,getLatestMessagePreview:i=ySe}=e,{ChannelListItemUI:a=Uwe}=q(),{channel:o,client:s,isMessageAIGenerated:c,setActiveChannel:l}=K(`ChannelPreview`),{t:u,userLanguage:f}=Y(`ChannelPreview`),{displayImage:p,displayTitle:m,groupChannelDisplayInfo:h}=w7({channel:n}),g=M9(n),[_,v]=(0,d.useState)(n.state.messages[n.state.messages.length-1]),[y,b]=(0,d.useState)(()=>i(n,u,f,c)),[x,S]=(0,d.useState)(0),{messageDeliveryStatus:C}=Wwe({channel:n,lastMessage:_}),w=t===void 0?o?.cid===n.cid:t,{muted:T}=N9(n);(0,d.useEffect)(()=>{let e=e=>{if(!e.cid)return S(0);n.cid===e.cid&&S(0)};return s.on(`notification.mark_read`,e),()=>s.off(`notification.mark_read`,e)},[n,s]),(0,d.useEffect)(()=>{let e=e=>{n.cid===e.cid&&e.user?.id===s.user?.id&&S(n.countUnread())};return n.on(`notification.mark_unread`,e),()=>{n.off(`notification.mark_unread`,e)}},[n,s]);let E=(0,d.useMemo)(()=>(0,PB.default)(()=>{S(T?0:n.countUnread())},400),[n,T]);(0,d.useEffect)(()=>{E(),b(i(n,u,f,c));let e=e=>{e.type===`user.messages.deleted`&&e.cid&&e.cid!==n.cid||(v(n.state.latestMessages[n.state.latestMessages.length-1]),b(i(n,u,f,c)),E())};return n.on(`message.new`,e),n.on(`message.updated`,e),n.on(`message.deleted`,e),s.on(`user.messages.deleted`,e),n.on(`message.undeleted`,e),n.on(`channel.truncated`,e),()=>{n.off(`message.new`,e),n.off(`message.updated`,e),n.off(`message.deleted`,e),s.off(`user.messages.deleted`,e),n.off(`message.undeleted`,e),n.off(`channel.truncated`,e)}},[n,s,E,r,i,u,f,c]);let D=(0,d.useMemo)(()=>({channel:n}),[n]);return a?(0,R.jsx)(B9.Provider,{value:D,children:(0,R.jsx)(a,{...e,active:w,displayImage:p,displayTitle:m,groupChannelDisplayInfo:h,lastMessage:_,latestMessagePreview:y,messageDeliveryStatus:C,muted:T,pinned:!!g.pinned_at,setActiveChannel:l,unread:x})}):null};(0,d.createContext)(void 0);var Gwe={error:YH,info:null,loading:dH,success:OH,warning:XH},Kwe=({notification:e})=>{if(!e.severity)return null;let t=Gwe[e.severity]??null;return t&&(0,R.jsx)(`div`,{className:`str-chat__notification-icon`,children:(0,R.jsx)(t,{})})},U9=(0,d.forwardRef)(({className:e,entryDirection:t,Icon:n=Kwe,notification:r,onDismiss:i,showClose:a=!1,transitionState:o},s)=>{let{removeNotification:c}=GG(),{t:l}=Y(),u=l(`translationBuilderTopic/notification`,{notification:r,value:r.message}),d=()=>{if(i){i();return}c(r.id)},f=!r.duration,p=r.severity,m=p===`error`?`assertive`:`polite`;return(0,R.jsxs)(`div`,{className:G(`str-chat__notification`,t&&`str-chat__notification--enter-from-${t}`,o===`enter`&&`str-chat__notification--is-entering`,o===`exit`&&`str-chat__notification--is-exiting`,p&&`str-chat__notification--${p}`,p===`loading`&&`str-chat__notification--loading`,e),"data-testid":`notification`,ref:s,children:[(0,R.jsxs)(`div`,{className:`str-chat__notification-content`,children:[n&&(0,R.jsx)(n,{notification:r}),(0,R.jsx)(`div`,{"aria-atomic":`true`,"aria-live":m,className:`str-chat__notification-message`,role:m===`assertive`?`alert`:`status`,children:u})]}),r.actions&&r.actions.length>0&&(0,R.jsx)(`div`,{className:`str-chat__notification-actions`,children:r.actions.map((e,t)=>(0,R.jsx)(nH,{appearance:`outline`,className:`str-chat__notification-action`,inverseTheme:!0,onClick:()=>{e.handler()},size:`sm`,variant:`secondary`,children:e.label},t))}),(a||f)&&(0,R.jsx)(nH,{appearance:`ghost`,"aria-label":l(`aria/Dismiss notification`),circular:!0,className:`str-chat__notification-close-button`,inverseTheme:!0,onClick:d,size:`sm`,variant:`secondary`,children:(0,R.jsx)(RH,{})})]})});U9.displayName=`Notification`;var W9={bottom:{x:`0%`,y:`100%`},left:{x:`-100%`,y:`0%`},right:{x:`100%`,y:`0%`},top:{x:`0%`,y:`-100%`}},G9=340,qwe=1e3,K9=e=>e===`bottom`||e===`left`||e===`right`||e===`top`,Jwe=(e,t)=>{if(!e)return t;let n=e.metadata?.entryDirection;if(K9(n))return n;let r=e.origin.context?.entryDirection;return K9(r)?r:t},q9=e=>!e.duration,Ywe=(e,t)=>!!e?.type&&!!t?.type&&e.type===t.type,J9=(e,t)=>
502{let n=t?.id??null,r=null;for(let t of e)t.id!==n&&(!r||t.createdAt<r.createdAt)&&(r=t);return r},Y9=(e,t)=>{let n=null;for(let r of e)r.id!==t&&q9(r)&&(!n||r.createdAt>n.createdAt)&&(n=r);return n},Xwe=(e,t,n)=>{if(!t)return null;let r=null;for(let i of e)i.id!==n&&i.type===t&&(!r||i.createdAt>r.createdAt)&&(r=i);return r},Zwe=((e=J9)=>(t,n)=>{if(t.length===0)return null;let r=Y9(t,null);if(!n||!t.some(({id:e})=>e===n.id))return r??e(t,null);if(q9(n)){let e=r&&r.id!==n.id?r:Y9(t,n.id);return e&&e.createdAt>n.createdAt?e:n}return Xwe(t,n.type,n.id)||r||(e(t,n)??n)})(J9),X9=({className:e,enterFrom:t=`bottom`,fallbackPanel:n,filter:r,minDisplayMs:i=qwe,panel:a,pickNext:o=Zwe,verticalAlignment:s=`bottom`})=>{let{Notification:c=U9}=q(),{t:l}=Y(),{removeNotification:u,startNotificationTimeout:f}=GG(),p=(0,d.useRef)(null),m=(0,d.useRef)(null),h=(0,d.useRef)(null),g=(0,d.useRef)(null),_=(0,d.useRef)(null),v=(0,d.useRef)(null),y=(0,d.useRef)(null);y.current||=new Set;let[b,x]=(0,d.useState)(null),[S,C]=(0,d.useState)(`enter`),w=S6({applyDisplayFilter:!0,fallbackPanel:n,filter:(0,d.useCallback)(e=>HG(e)?!1:r?r(e):!0,[r]),panel:a}),T=(0,d.useCallback)(e=>{y.current?.delete(e),u(e)},[u]);(0,d.useEffect)(()=>{let e=new Set(w.map(({id:e})=>e));y.current?.forEach(t=>{e.has(t)||y.current?.delete(t)})},[w]);let E=(0,d.useCallback)(()=>{m.current!==null&&(window.clearTimeout(m.current),m.current=null)},[]);(0,d.useEffect)(()=>()=>{E(),p.current!==null&&(window.clearTimeout(p.current),p.current=null)},[E]),(0,d.useEffect)(()=>{h.current=o(w,b)},[b,w,o]),(0,d.useEffect)(()=>{if(S===`exit`)return;if(!b){let e=o(w,null);e&&(g.current=Date.now(),x(e),C(`enter`));return}let e=o(w,b);if(!e){E(),C(`exit`),p.current=window.setTimeout(()=>{p.current=null,g.current=null,x(null),C(`enter`)},G9);return}if(e.id===b.id){E();return}let t=w.some(({id:e})=>e===b.id),n=()=>{m.current=null,C(`exit`);let e=b.id,n=t;p.current=window.setTimeout(()=>{p.current=null,n&&(y.current?.delete(e),u(e));let t=h.current;t&&t.id!==e?(g.current=Date.now(),x(t),C(`enter`)):(g.current=null,x(null),C(`enter`))},G9)};if(!t){E(),n();return}if(Ywe(b,e)){E(),n();return}let r=g.current?Date.now()-g.current:0,a=Math.max(0,i-r);a===0?(E(),n()):m.current===null&&(m.current=window.setTimeout(n,a))},[E,b,i,w,o,u,S]);let D=b,O=Jwe(D,t);return(0,d.useEffect)(()=>{let e=v.current;if(!e||!D||S===`exit`)return;let t=()=>{!y.current||y.current.has(D.id)||(y.current.add(D.id),f(D.id))};if(typeof IntersectionObserver>`u`){t();return}let n=new IntersectionObserver(e=>{let[r]=e;r?.isIntersecting&&(t(),n.disconnect())},{root:_.current,threshold:.5});return n.observe(e),()=>{n.disconnect()}},[D,f,S]),D?(0,R.jsxs)(`div`,{"aria-label":l(`aria/Notifications`),className:G(`str-chat__notification-list`,`str-chat__notification-list--enter-from-${O}`,`str-chat__notification-list--position-${s}`,a&&`str-chat__notification-list--${a}`,e),"data-testid":`notification-list`,ref:_,role:`region`,style:{"--str-chat__notification-list-enter-x":W9[O].x,"--str-chat__notification-list-enter-y":W9[O].y},children:[(0,R.jsx)(`div`,{"aria-hidden":!0,className:`str-chat__notification-list__edge str-chat__notification-list__edge--top`}),(0,R.jsx)(c,{entryDirection:O,notification:D,onDismiss:()=>T(D.id),ref:e=>{v.current=e},showClose:!D.duration,transitionState:S},D.id),(0,R.jsx)(`div`,{"aria-hidden":!0,className:`str-chat__notification-list__edge str-chat__notification-list__edge--bottom`})]}):null},Qwe=50,$we=120,eTe=e=>e.severity===`error`?`assertive`:`polite`,tTe=e=>e.severity?`${e.severity[0].toUpperCase()}${e.severity.slice(1)}`:null,nTe=(e,t)=>{let n=tTe(e);return n?`${n} notification: ${t}`:`Notification: ${t}`},rTe=({defaultMessage:e})=>e,iTe=()=>!0,aTe=({buildNotificationAnnouncement:e=rTe,notificationFilter:t=iTe})=>{let{t:n}=Y(),r=S6(),[i,a]=(0,d.useState)([]),[o,s]=(0,d.useState)(!1),[c,l]=(0,d.useState)(``),[u,f]=(0,d.useState)(``),p=(0,d.useRef)(!1),m=(0,d.useRef)(new Set),h=(0,d.useRef)(null),g=(0,d.useRef)(null),_=(0,d.useCallback)(()=>{h.current&&=(clearTimeout(h.current),null),g.current&&=(clearTimeout(g.current),null)},[]);return(0,d.useEffect)(()=>()=>{_()},[_]),(0,d.useEffect)(()=>{let i=new Set(r.map(({id:e})=>e));
502if(m.current.forEach(e=>{i.has(e)||m.current.delete(e)}),!p.current){r.forEach(({id:e})=>{m.current.add(e)}),p.current=!0;return}let o=[];r.forEach(r=>{if(m.current.has(r.id)||(m.current.add(r.id),!t(r)))return;let i=n(`translationBuilderTopic/notification`,{notification:r,value:r.message});if(!i)return;let a=e({defaultMessage:nTe(r,i),notification:r,translatedMessage:i});a&&o.push({id:r.id,message:a,priority:eTe(r)})}),o.length&&a(e=>[...e,...o])},[e,t,r,n]),(0,d.useEffect)(()=>{if(o)return;let e=i[0];e&&(s(!0),_(),l(``),f(``),h.current=setTimeout(()=>{e.priority===`assertive`?f(e.message):l(e.message),g.current=setTimeout(()=>{a(t=>t.filter(({id:t})=>t!==e.id)),s(!1),g.current=null},$we),h.current=null},Qwe))},[i,_,o]),(0,R.jsxs)(v6,{"data-testid":`notification-announcer`,children:[(0,R.jsx)(`div`,{"aria-atomic":`true`,"aria-live":`polite`,role:`status`,children:c}),(0,R.jsx)(`div`,{"aria-atomic":`true`,"aria-live":`assertive`,role:`alert`,children:u})]})},Z9=1e3,oTe=(e,t)=>{let n=e.user?.id;return!e.id||!n||n===t?!1:e.type!==`deleted`&&e.type!==`ephemeral`&&e.type!==`error`&&e.type!==`system`&&e.status!==`failed`&&e.status!==`sending`},sTe=(e,t)=>e.user?.name?.trim()||e.user?.id||t(`Anonymous`),Q9=({activeThreadId:e,channel:t,ownUserId:n,threadList:r=!1})=>{let i=nhe(),{t:a}=Y(`useIncomingMessageAnnouncements`),o=(0,d.useRef)(0),s=(0,d.useRef)(void 0),c=(0,d.useRef)(new Set),l=(0,d.useRef)({count:0,firstSender:null}),u=(0,d.useCallback)(()=>{let e=l.current;e.count<=0||(e.count===1?i(a(`New message from {{user}}`,{user:e.firstSender||a(`Anonymous`)})):i(a(`{{count}} new messages`,{count:e.count})),e.count=0,e.firstSender=null,o.current=Date.now())},[i,a]),f=(0,d.useCallback)(()=>{if(s.current)return;let e=Date.now()-o.current;if(e>=Z9){u();return}s.current=setTimeout(()=>{s.current=void 0,u()},Z9-e)},[u]);(0,d.useEffect)(()=>()=>{s.current&&clearTimeout(s.current)},[]),(0,d.useEffect)(()=>{if(!t)return;let i=t.on(`message.new`,i=>{let o=i.message;if(!o||i.cid&&i.cid!==t.cid||!oTe(o,n))return;let s=!!o.parent_id,u=!!e&&o.parent_id===e;!(r&&u)&&!(!r&&!s)||c.current.has(o.id||``)||(o.id&&(c.current.size>500&&c.current.clear(),c.current.add(o.id)),l.current.count+=1,l.current.firstSender||(l.current.firstSender=sTe(o,a)),f())});return()=>{i.unsubscribe(),s.current&&=(clearTimeout(s.current),void 0)}},[e,t,n,f,a,r])},cTe=({client:e,defaultLanguage:t=`en`,i18nInstance:n})=>{let[r,i]=(0,d.useState)({t:FV,tDateTimeParser:IV,userLanguage:`en`}),[a,o]=(0,d.useState)(),[s,c]=(0,d.useState)([]),[l,u]=(0,d.useState)({}),f=e.user?.mutes??[],p=(0,d.useRef)(null),m=()=>(p.current||=e.getAppSettings(),p.current);(0,d.useEffect)(()=>{if(!e)return;let t=e.getUserAgent();return t.includes(`stream-chat-react`)||e.setUserAgent(`stream-chat-react-14.4.1-${t}`),e.threads.registerSubscriptions(),e.polls.registerSubscriptions(),e.reminders.registerSubscriptions(),e.reminders.initTimers(),()=>{e.threads.unregisterSubscriptions(),e.polls.unregisterSubscriptions(),e.reminders.unregisterSubscriptions(),e.reminders.clearTimers()}},[e]),(0,d.useEffect)(()=>{c(f);let t=e=>{c(e.me?.mutes||[])};return e.on(`notification.mutes_updated`,t),()=>e.off(`notification.mutes_updated`,t)},[f?.length]),(0,d.useEffect)(()=>{let r=e.user?.language;if(!r){let e=window.navigator.language.slice(0,2);r=LV(e)?e:t}let a=n||new Whe({language:r});a.registerSetLanguageCallback(e=>i(t=>({...t,t:e}))),a.getTranslators().then(e=>{i({...e,userLanguage:r||t})})},[n]);let h=(0,d.useCallback)(async(e,t={},n)=>{n&&n.preventDefault&&n.preventDefault(),e&&Object.keys(t).length&&await e.query({watch:!0,watchers:t}),o(e)},[]);return(0,d.useEffect)(()=>{u({})},[e.user?.id]),{channel:a,getAppSettings:m,latestMessageDatesByChannels:l,mutes:s,setActiveChannel:h,translators:r}},lTe=()=>{let{t:e}=Y(),{client:t}=K(),{addSystemNotification:n,removeNotification:r}=GG(),i=(0,d.useRef)(null);(0,d.useEffect)(()=>{if(!e||!t)return;let a=()=>{i.current&&=(r(i.current),null)},o=({online:t})=>{if(!t){if(i.current)return;i.current=n({duration:0,emitter:`Chat`,message:e(`Waiting for network…`),severity:`loading`,type:`system:network:connection:lost`});return}a()};return t.on(`connection.changed`,o),()=>{t.off(`connection.changed`,o),a()}},[n,t,r,e])},uTe=e=>{let{channel:t,channelsQueryState:n,client:r,customClasses:i,getAppSettings:a,isMessageAIGenerated:o,latestMessageDatesByChannels:s,mutes:c,searchController:l,setActiveChannel:u,theme:f,useImageFlagEmojisOnWindows:p}=e,m=t?.cid,h=n.error,g=n.queryInProgress,_=`${r.clientID}${Object.keys(r.activeChannels).length}${Object.keys(r.listeners).length}${r.mutedChannels.length}
503  ${r.user?.id}`,v=c.length;return(0,d.useMemo)(()=>({channel:t,channelsQueryState:n,client:r,customClasses:i,getAppSettings:a,isMessageAIGenerated:o,latestMessageDatesByChannels:s,mutes:c,searchController:l,setActiveChannel:u,theme:f,useImageFlagEmojisOnWindows:p}),[m,h,g,_,a,l,v,o])},dTe=()=>{let[e,t]=(0,d.useState)(null),[n,r]=(0,d.useState)(`uninitialized`);return{error:e,queryInProgress:n,setError:t,setQueryInProgress:r}},fTe=()=>(lTe(),null),pTe=e=>({notification:t,panel:n})=>GV(t).includes(`modal`)||e?n===`modal`:!0,mTe=({children:e,notificationDisplayFilter:t})=>{let n=rV();return(0,R.jsx)(rhe,{displayFilter:(0,d.useMemo)(()=>t??pTe(n),[n,t]),children:e})},hTe=e=>{let{children:t,client:n,customClasses:r,defaultLanguage:i,i18nInstance:a,isMessageAIGenerated:o,notificationDisplayFilter:s,searchController:c,theme:l=`messaging light`,useImageFlagEmojisOnWindows:u=!1}=e,{channel:f,getAppSettings:p,latestMessageDatesByChannels:m,mutes:h,setActiveChannel:g,translators:_}=cTe({client:n,defaultLanguage:i,i18nInstance:a}),v=uTe({channel:f,channelsQueryState:dTe(),client:n,customClasses:r,getAppSettings:p,isMessageAIGenerated:o,latestMessageDatesByChannels:m,mutes:h,searchController:(0,d.useMemo)(()=>c??new qne({sources:[new Yne(n),new Jne(n),new Xne(n)]}),[n,c]),setActiveChannel:g,theme:l,useImageFlagEmojisOnWindows:u}),{NotificationAnnouncer:y=aTe}=q();return _.t?(0,R.jsx)(JB,{value:v,children:(0,R.jsx)(zV,{value:_,children:(0,R.jsx)(xV,{children:(0,R.jsxs)(mTe,{notificationDisplayFilter:s,children:[(0,R.jsx)(fTe,{}),(0,R.jsx)(y,{}),t]})})})}):null},gTe=d.memo(e=>{let{children:t,thread:n}=e,{thread:r}=KB(`Window`);return(0,R.jsx)(`div`,{className:G(`str-chat__main-panel`,{"str-chat__main-panel--thread-open":r||n}),children:t})});function _Te({chatClient:e,channel:t,onChatToggle:n}){let r=Fo(),{useCallCallingState:i,useParticipantCount:a}=NF(),o=i(),s=a(),[c,l]=(0,d.useState)(!1),u=e=>{l(e),n?.(e)};return o===W.JOINING?(0,R.jsx)(`div`,{className:`h-full flex items-center justify-center`,children:(0,R.jsxs)(`div`,{className:`text-center`,children:[(0,R.jsx)(Mp,{className:`w-12 h-12 mx-auto animate-spin text-primary mb-4`}),(0,R.jsx)(`p`,{className:`text-lg`,children:`Joining call...`})]})}):(0,R.jsxs)(`div`,{className:`h-full flex gap-3 relative str-video`,children:[(0,R.jsxs)(`div`,{className:`flex-1 flex flex-col gap-3`,children:[(0,R.jsxs)(`div`,{className:`flex items-center justify-between gap-2 bg-base-100 p-3 rounded-lg shadow`,children:[(0,R.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,R.jsx)(Up,{className:`w-5 h-5 text-primary`}),(0,R.jsxs)(`span`,{className:`font-semibold`,children:[s,` `,s===1?`participant`:`participants`]})]}),e&&t&&(0,R.jsxs)(`button`,{onClick:()=>u(!c),className:`btn btn-sm gap-2 ${c?`btn-primary`:`btn-ghost`}`,title:c?`Hide chat`:`Show chat`,children:[(0,R.jsx)(Fp,{className:`size-4`}),`Chat`]})]}),(0,R.jsxs)(`div`,{className:`flex-1 bg-base-300 rounded-lg overflow-hidden relative`,children:[(0,R.jsx)(`style`,{children:`
504            .str-video__participant-details__name {
505              color: #ffffff !important;
506              font-weight: 600 !important;
507            }
508          `}),(0,R.jsx)(iB,{})]}),(0,R.jsx)(`div`,{className:`bg-base-100 p-3 rounded-lg shadow flex justify-center`,children:(0,R.jsx)(wz,{onLeave:()=>r(`/dashboard`)})})]}),e&&t&&(0,R.jsx)(`div`,{className:`flex flex-col rounded-lg shadow overflow-hidden bg-[#272a30] transition-all duration-300 ease-in-out ${c?`w-[500px] opacity-100`:`w-0 opacity-0`}`,children:c&&(0,R.jsxs)(R.Fragment,{children:[(0,R.jsxs)(`div`,{className:`bg-[#1c1e22] p-3 border-b border-[#3a3d44] flex items-center justify-between`,children:[(0,R.jsx)(`h3`,{className:`font-semibold text-white`,children:`Session Chat`}),(0,R.jsx)(`button`,{onClick:()=>u(!1),className:`text-gray-400 hover:text-white transition-colors`,title:`Close chat`,children:(0,R.jsx)(Kp,{className:`size-5`})})]}),(0,R.jsx)(`div`,{className:`flex-1 overflow-hidden stream-chat-dark`,children:(0,R.jsx)(hTe,{client:e,theme:`str-chat__theme-dark`,children:(0,R.jsxs)(_G,{channel:t,children:[(0,R.jsxs)(gTe,{children:[(0,R.jsx)(d9,{}),(0,R.jsx)(y7,{})]}),(0,R.jsx)(jSe,{})]})})})]})})]})}function vTe(){let[e,t]=(0,d.useState)(0);return(0,d.useEffect)(()=>{let e=setInterval(()=>t(e=>e+1),1e3);return()=>clearInterval(e)},[]),`${String(Math.floor(e/60)).padStart(2,`0`)}
508:${String(e%60).padStart(2,`0`)}`}var $9={easy:`bg-success/10 text-success border border-success/30`,medium:`bg-warning/10 text-warning border border-warning/30`,hard:`bg-error/10 text-error border border-error/30`};function yTe(){let e=Fo(),{id:t}=Lo(),{user:n}=Ut(),[r,i]=(0,d.useState)(null),[a,o]=(0,d.useState)(!1),[s,c]=(0,d.useState)(`problem`),[l,u]=(0,d.useState)(`testcase`),[f,p]=(0,d.useState)(!1),m=vTe(),{data:h,isLoading:g,refetch:_}=sp(t),v=cp(),y=lp(),b=h?.session,x=b?.host?.clerkId===n?.id,S=b?.participants?.some(e=>e.clerkId===n?.id),{call:C,channel:w,chatClient:T,isInitializingCall:E,streamClient:D}=vB(b,g,x,S),O=b?.problem?Object.values(_m).find(e=>e.title===b.problem):null,[k,A]=(0,d.useState)(`javascript`),[j,M]=(0,d.useState)(O?.starterCode?.[k]||``);(0,d.useEffect)(()=>{!b||!n||g||x||S||v.mutate(t,{onSuccess:_})},[b,n,g,x,S,t]),(0,d.useEffect)(()=>{!b||g||b.status===`completed`&&e(`/dashboard`)},[b,g,e]),(0,d.useEffect)(()=>{O?.starterCode?.[k]&&M(O.starterCode[k])},[O,k]),(0,d.useEffect)(()=>{if(!b)return;let e=setInterval(async()=>{try{await rp.heartbeat(b._id),console.log(`Heartbeat sent successfully`)}catch(e){console.log(e)}},120*1e3);return()=>clearInterval(e)},[b?.callId,g,x,S]);let N=e=>{let t=e.target.value;A(t),M(O?.starterCode?.[t]||``),i(null)},P=async()=>{o(!0),i(null),i(await Yg(k,j)),o(!1),u(`console`)},ee=()=>{confirm(`Are you sure you want to end this session? All participants will be notified.`)&&y.mutate(t,{onSuccess:()=>e(`/dashboard`)})},F=$9[b?.difficulty?.toLowerCase()]||$9.easy;return(0,R.jsxs)(`div`,{className:`h-screen flex flex-col overflow-hidden font-sans`,style:{backgroundColor:`#f5f0e8`},children:[(0,R.jsxs)(`header`,{className:`h-12 flex items-center justify-between px-5 shrink-0`,style:{backgroundColor:`#f5f0e8`},children:[(0,R.jsx)(`div`,{className:`flex items-center gap-2`,children:(0,R.jsxs)(`span`,{className:`font-bold text-sm flex items-center gap-1.5`,style:{color:`#1a1a1a`},children:[(0,R.jsx)(`span`,{style:{color:`#F5A623`},children:`</>`}),` InterviewPro`]})}),(0,R.jsxs)(`nav`,{className:`flex items-center gap-1 bg-white rounded-full px-1.5 py-1 shadow-sm border border-black/5`,children:[(0,R.jsxs)(`button`,{onClick:()=>e(`/dashboard`),className:`flex items-center gap-1.5 px-4 py-1.5 rounded-full text-xs font-semibold transition-all`,style:{backgroundColor:`#1a1a1a`,color:`white`},children:[(0,R.jsx)(Ap,{className:`w-3.5 h-3.5`}),`Dashboard`]}),(0,R.jsxs)(`button`,{onClick:()=>e(`/problems`),className:`flex items-center gap-1.5 px-4 py-1.5 rounded-full text-xs font-semibold transition-all`,style:{color:`#6b7280`},children:[(0,R.jsx)(xp,{className:`w-3.5 h-3.5`}),`Problems`]})]}),(0,R.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,R.jsxs)(`div`,{className:`flex items-center gap-1.5 text-xs font-mono font-semibold px-3 py-1.5 rounded-full border border-black/10 bg-white`,style:{color:`#1a1a1a`},children:[(0,R.jsx)(Dp,{className:`w-3.5 h-3.5`}),m]}),x&&b?.status===`active`&&(0,R.jsxs)(`button`,{onClick:ee,disabled:y.isPending,className:`flex items-center gap-1.5 px-3 py-1.5 rounded-full text-xs font-semibold transition-all`,style:{backgroundColor:`#ef4444`,color:`white`},children:[y.isPending?(0,R.jsx)(Mp,{className:`w-3 h-3 animate-spin`}):(0,R.jsx)(Pp,{className:`w-3 h-3`}),`End Session`]}),!x&&b?.status===`active`&&(0,R.jsxs)(`button`,{onClick:()=>e(`/dashboard`),className:`flex items-center gap-1.5 px-3 py-1.5 rounded-full text-xs font-semibold border transition-all`,style:{borderColor:`#ef4444`,color:`#ef4444`},children:[(0,R.jsx)(Pp,{className:`w-3 h-3`}),`End Session`]}),b?.status===`completed`&&(0,R.jsx)(`span`,{className:`text-xs px-3 py-1 rounded-full bg-white border border-black/10 text-gray-500`,children:`Completed`})]})]}),(0,R.jsxs)(`div`,{className:`flex-1 flex min-h-0 gap-2 px-2 pb-2`,children:[(0,R.jsxs)(`aside`,{className:`w-[400px] shrink-0 flex flex-col rounded-xl overflow-hidden`,style:{backgroundColor:`white`},children:[(0,R.jsxs)(`div`,{className:`px-5 pt-4 pb-3 border-b border-gray-100`,children:[(0,R.jsxs)(`div`,{className:`flex items-start justify-between mb-1`,children:[(0,R.jsx)(`h1`,{className:`text-lg font-bold text-gray-900 leading-tight`,children:b?.problem||`Loading...`}),(0,R.jsx)(Sp,{className:`w-4 h-4 text-gray-300 mt-1 shrink-0 ml-2`})]}),O?.category&&(0,R.jsx)(`p`,{className:`text-xs text-gray-400 mt-0.5`,children:O.category}),(0,R.jsxs)(`p`,{className:`text-xs text-gray-400 mt-1`,children:[`Host: `,b?.host?.name||`—`,` · `,b?.participant?2:1,`/2 participants`]}),b?.difficulty&&(0,R.jsx)(`span`,{className:`inline-block mt-2 text-xs font-semibold px-2.5 py-0.5 rounded-full ${F}`,children:b.difficulty.charAt(0).toUpperCase()+b.difficulty.slice(1)})]}),(0,R.jsx)(`div`,{className:`flex border-b border-gray-100 bg-white`,children:[`Problem`,`Editorial`,`Hints`].map(e=>(0,R.jsx)(`button`,{onClick:()=>c(e.toLowerCase()),className:`flex-1 text-xs font-semibold py-2.5 transition-colors border-b-2 ${s===e.toLowerCase()?`border-[#F5A623] text-[#F5A623]`:`border-transparent text-gray-400 hover:text-gray-900`}`,children:e},e))}),(0,R.jsxs)(`div`,{className:`flex-1 overflow-y-auto px-5 py-4 space-y-6 text-sm`,children:[s===`problem`&&(0,R.jsxs)(R.Fragment,{children:[O?.description&&(0,R.jsxs)(`section`,{children:[(0,R.jsxs)(`div`,{className:`flex items-center gap-2 mb-2`,children:[(0,R.jsx)(`span`,{className:`text-gray-400 text-xs`,children:`⊞`}),(0,R.jsx)(`h2`,{className:`font-bold text-gray-900 text-xs uppercase tracking-widest`,children:`Description`})]}),(0,R.jsx)(`p`,{className:`text-gray-700 leading-relaxed font-normal`,children:O.description.text}),O.description.notes?.map((e,t)=>(0,R.jsx)(`p`,{className:`text-gray-500 mt-2 leading-relaxed italic`,children:e},t))]}),O?.examples?.length>0&&(0,R.jsxs)(`section`,{children:[(0,R.jsxs)(`div`,{className:`flex items-center gap-2 mb-3`,children:[(0,R.jsx)(`span`,{className:`text-gray-300 text-xs`,children:`⊟`}),(0,R.jsx)(`h2`,{className:`font-semibold text-gray-900 text-xs uppercase tracking-widest`,children:`Examples`})]}),(0,R.jsx)(`div`,{className:`space-y-3`,children:O.examples.map((e,t)=>(0,R.jsxs)(`div`,{className:`rounded-xl border border-gray-200 overflow-hidden`,children:[(0,R.jsx)(`div`,{className:`bg-gray-100 px-3 py-1.5 border-b border-gray-200`,children:(0,R.jsxs)(`span`,{className:`text-xs font-bold text-gray-500 tracking-wide`,children:[`Example `,t+1]})}),(0,R.jsxs)(`div`,{className:`bg-[#1e1e2e] p-3 font-mono text-xs space-y-1.5`,children:[(0,R.jsxs)(`div`,{className:`flex gap-2`,children:[(0,R.jsx)(`span`,{className:`text-[#F5A623] font-bold w-14 shrink-0`,children:`Input:`}),(0,R.jsx)(`span`,{className:`text-gray-300`,children:e.input})]}),(0,R.jsxs)(`div`,{className:`flex gap-2`,children:[(0,R.jsx)(`span`,{className:`text-[#a78bfa] font-bold w-14 shrink-0`,children:`Output:`}),(0,R.jsx)(`span`,{className:`text-gray-300`,children:e.output})]}),e.explanation&&(0,R.jsxs)(`p`,{className:`text-gray-500 pt-1.5 border-t border-gray-700 text-xs leading-relaxed`,children:[(0,R.jsx)(`span`,{className:`font-semibold text-gray-400`,children:`Explanation:`}),` `,e.explanation]})]})]},t))})]}),O?.constraints?.length>0&&(0,R.jsxs)(`section`,{children:[(0,R.jsxs)(`div`,{className:`flex items-center gap-2 mb-2`,children:[(0,R.jsx)(`span`,{className:`text-gray-400 text-xs`,children:`⊞`}),(0,R.jsx)(`h2`,{className:`font-bold text-gray-900 text-xs uppercase tracking-widest`,children:`Constraints`})]}),(0,R.jsx)(`ul`,{className:`space-y-2`,children:O.constraints.map((e,t)=>(0,R.jsxs)(`li`,{className:`flex gap-2 text-gray-600`,children:[(0,R.jsx)(`span`,{className:`text-[#F5A623] shrink-0 font-bold`,children:`•`}),(0,R.jsx)(`code`,{className:`text-xs px-1.5 py-0.5 bg-gray-100 rounded text-gray-800 font-medium`,children:e})]},t))})]})]}),s===`editorial`&&(0,R.jsx)(`div`,{className:`text-gray-400 text-sm py-8 text-center`,children:`Editorial coming soon.`}),s===`hints`&&(0,R.jsx)(`div`,{className:`text-gray-400 text-sm py-8 text-center`,children:`No hints available.`})]})]}),(0,R.jsxs)(`main`,{className:`flex-1 flex flex-col min-w-0 overflow-hidden rounded-xl`,style:{backgroundColor:`white`},children:[(0,R.jsx)(`div`,{className:`flex-1 min-h-0 overflow-hidden`,children:(0,R.jsx)(Jg,{selectedLanguage:k,code:j,isRunning:a,onLanguageChange:N,onCodeChange:e=>M(e),onRunCode:P})}),(0,R.jsxs)(`div`,{className:`h-[300px] shrink-0 border-t border-gray-100 bg-white flex flex-col`,children:[(0,R.jsxs)(`div`,{className:`flex items-center border-b border-gray-100 px-1`,children:[[`Testcase`,`Custom Testcase`,`Console`].map(e=>{let t=e.toLowerCase().replace(/ /g,``);return(0,R.jsx)(`button`,{onClick:()=>u(t),className:`text-xs font-semibold px-4 py-2.5 border-b-2 transition-colors ${l===t?`border-[#F5A623] text-[#F5A623]`:`border-transparent text-gray-400 hover:text-gray-900`}`,children:e},t)}),r&&(0,R.jsx)(`div`,{className:`ml-auto flex items-center gap-3 pr-4 text-xs`,children:r.run?.stderr?(0,R.jsx)(`span`,{className:`text-error font-semibold`,children:`Error`}):(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(`span`,{className:`text-success font-semibold flex items-center gap-1`,children:`🎉 All testcases passed!`}),(0,R.jsxs)(`span`,{className:`text-gray-400`,children:[`Runtime: `,r.run?.time?`${(r.run.time*1e3).toFixed(2)} ms`:`—`]})]})})]}),(0,R.jsx)(`div`,{className:`flex-1 overflow-auto px-4 py-3`,children:(0,R.jsx)(Wh,{output:r,activeTab:l})})]})]}),(0,R.jsx)(`aside`,{className:`shrink-0 flex flex-col overflow-hidden rounded-xl transition-all duration-300`,style:{width:f?`960px`:`440px`,backgroundColor:`#f5f0e8`},children:E?(0,R.jsx)(`div`,{className:`flex-1 flex items-center justify-center`,style:{width:`440px`},children:(0,R.jsxs)(`div`,{className:`text-center`,children:[(0,R.jsx)(Mp,{className:`w-10 h-10 mx-auto animate-spin text-[#F5A623] mb-3`}),(0,R.jsx)(`p`,{className:`text-sm text-gray-400`,children:`Connecting to video call...`})]})}
508):!D||!C?(0,R.jsx)(`div`,{className:`flex-1 flex items-center justify-center p-6`,style:{width:`440px`},children:(0,R.jsxs)(`div`,{className:`text-center`,children:[(0,R.jsx)(`div`,{className:`w-16 h-16 rounded-full flex items-center justify-center mx-auto mb-3`,style:{backgroundColor:`#ef444420`},children:(0,R.jsx)(Ip,{className:`w-8 h-8 text-red-500`})}),(0,R.jsx)(`h3`,{className:`font-semibold text-white mb-1`,children:`Connection Failed`}),(0,R.jsx)(`p`,{className:`text-sm text-gray-400`,children:`Unable to connect to the video call`})]})}):(0,R.jsx)(Iz,{client:D,children:(0,R.jsx)(Pz,{call:C,children:(0,R.jsx)(_Te,{chatClient:T,channel:w,onChatToggle:p})})})})]})]})}function bTe(){let{isSignedIn:e,isLoaded:t}=Ut();return t?(0,R.jsxs)(R.Fragment,{children:[(0,R.jsxs)(us,{children:[(0,R.jsx)(cs,{path:`/`,element:e?(0,R.jsx)(ss,{to:`/dashboard`}):(0,R.jsx)(See,{})}),(0,R.jsx)(cs,{path:`dashboard`,element:e?(0,R.jsx)(xee,{}):(0,R.jsx)(ss,{to:`/`})}),(0,R.jsx)(cs,{path:`/problems`,element:e?(0,R.jsx)(wte,{}):(0,R.jsx)(ss,{to:`/`})}),(0,R.jsx)(cs,{path:`/problem/:id`,element:e?(0,R.jsx)(Ste,{}):(0,R.jsx)(ss,{to:`/`})}),(0,R.jsx)(cs,{path:`/session/:id`,element:e?(0,R.jsx)(yTe,{}):(0,R.jsx)(ss,{to:`/`})})]}),(0,R.jsx)(Kl,{position:`down-right`,toastOptions:{duration:2e3}})]}):null}var xTe=`pk_test_ZW1lcmdpbmctY295b3RlLTU0LmNsZXJrLmFjY291bnRzLmRldiQ`,STe=new rt;(0,f.createRoot)(document.getElementById(`root`)).render((0,R.jsx)(d.StrictMode,{children:(0,R.jsx)(Zs,{children:(0,R.jsx)(bc,{client:STe,children:(0,R.jsx)(oa,{publishableKey:xTe,children:(0,R.jsx)(bTe,{})})})})}));export{NF as a,pa as c,SF as i,c as l,DB as n,$N as o,G as r,_O as s,H0 as t};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.