@cloudflare/realtimekit-ui 1.0.1 → 1.0.2-staging.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/browser.js DELETED
@@ -1 +0,0 @@
1
- var RtkUiKit=function(t){"use strict";const e="hydrated",i=!0,r=!0,a=!0;var s=Object.defineProperty,n=t=>{if(t.__stencil__getHostRef)return t.__stencil__getHostRef()},o=(t,e)=>{t.__stencil__getHostRef=()=>e,e.$lazyInstance$=t},c=(t,e)=>e in t,l=(t,e)=>(0,console.error)(t,e),d=new Map,h=new Map,p="slot-fb{display:contents}slot-fb[hidden]{display:none}",g="http://www.w3.org/1999/xlink",u="undefined"!=typeof window?window:{},f={$flags$:0,$resourcesUrl$:"",jmp:t=>t(),raf:t=>requestAnimationFrame(t),ael:(t,e,i,r)=>t.addEventListener(e,i,r),rel:(t,e,i,r)=>t.removeEventListener(e,i,r),ce:(t,e)=>new CustomEvent(t,e)},m=(()=>{var t;let e=!1;try{null==(t=u.document)||t.addEventListener("e",null,Object.defineProperty({},"passive",{get(){e=!0}}))}catch(t){}return e})(),v=(()=>{try{return new CSSStyleSheet,"function"==typeof(new CSSStyleSheet).replaceSync}catch(t){}return!1})(),b=!1,k=[],y=[],w=(t,e)=>e=>{t.push(e),b||(b=!0,4&f.$flags$?P(S):f.raf(S))},x=t=>{for(let e=0;e<t.length;e++)try{t[e](performance.now())}catch(t){l(t)}t.length=0},S=()=>{x(k),x(y),(b=k.length>0)&&f.raf(S)},P=t=>{return Promise.resolve(e).then(t);var e},C=w(y),E=t=>"object"===(t=typeof t)||"function"===t;function T(t){var e,i,r;return null!=(r=null==(i=null==(e=t.head)?void 0:e.querySelector('meta[name="csp-nonce"]'))?void 0:i.getAttribute("content"))?r:void 0}((t,e)=>{for(var i in e)s(t,i,{get:e[i],enumerable:!0})})({},{err:()=>_,map:()=>R,ok:()=>L,unwrap:()=>A,unwrapErr:()=>D});var L=t=>({isOk:!0,isErr:!1,value:t}),_=t=>({isOk:!1,isErr:!0,value:t});function R(t,e){if(t.isOk){const i=e(t.value);return i instanceof Promise?i.then((t=>L(t))):L(i)}if(t.isErr){const e=t.value;return _(e)}throw"should never get here"}var A=t=>{if(t.isOk)return t.value;throw t.value},D=t=>{if(t.isErr)return t.value;throw t.value},M=t=>{const e=F(t,"childNodes");t.tagName&&t.tagName.includes("-")&&t["s-cr"]&&"SLOT-FB"!==t.tagName&&I(e,t.tagName).forEach((t=>{1===t.nodeType&&"SLOT-FB"===t.tagName&&(O(t,$(t),!1).length?t.hidden=!0:t.hidden=!1)}));let i=0;for(i=0;i<e.length;i++){const t=e[i];1===t.nodeType&&F(t,"childNodes").length&&M(t)}};function I(t,e,i){let r,a=0,s=[];for(;a<t.length;a++)r=t[a],!r["s-sr"]||e&&r["s-hn"]!==e||void 0!==i||s.push(r),s=[...s,...I(r.childNodes,e,i)];return s}var O=(t,e,i=!0)=>{const r=[];(i&&t["s-sr"]||!t["s-sr"])&&r.push(t);let a=t;for(;a=a.nextSibling;)$(a)!==e||!i&&a["s-sr"]||r.push(a);return r},U=(t,e)=>1===t.nodeType?null===t.getAttribute("slot")&&""===e||t.getAttribute("slot")===e:t["s-sn"]===e||""===e,$=t=>"string"==typeof t["s-sn"]?t["s-sn"]:1===t.nodeType&&t.getAttribute("slot")||void 0;function F(t,e){if("__"+e in t){const i=t["__"+e];return"function"!=typeof i?i:i.bind(t)}return"function"!=typeof t[e]?t[e]:t[e].bind(t)}var j,z,N=(t,e,...i)=>{let r=null,a=null,s=null,n=!1,o=!1;const c=[],l=e=>{for(let i=0;i<e.length;i++)r=e[i],Array.isArray(r)?l(r):null!=r&&"boolean"!=typeof r&&((n="function"!=typeof t&&!E(r))&&(r=String(r)),n&&o?c[c.length-1].$text$+=r:c.push(n?B(null,r):r),o=n)};if(l(i),e){e.key&&(a=e.key),e.name&&(s=e.name);{const t=e.className||e.class;t&&(e.class="object"!=typeof t?t:Object.keys(t).filter((e=>t[e])).join(" "))}}if("function"==typeof t)return t(null===e?{}:e,c,G);const d=B(t,null);return d.$attrs$=e,c.length>0&&(d.$children$=c),d.$key$=a,d.$name$=s,d},B=(t,e)=>{const i={$flags$:0,$tag$:t,$text$:e,$elm$:null,$children$:null,$attrs$:null,$key$:null,$name$:null};return i},H={},G={forEach:(t,e)=>t.map(V).forEach(e),map:(t,e)=>t.map(V).map(e).map(q)},V=t=>({vattrs:t.$attrs$,vchildren:t.$children$,vkey:t.$key$,vname:t.$name$,vtag:t.$tag$,vtext:t.$text$}),q=t=>{if("function"==typeof t.vtag){const e={...t.vattrs};return t.vkey&&(e.key=t.vkey),t.vname&&(e.name=t.vname),N(t.vtag,e,...t.vchildren||[])}const e=B(t.vtag,t.vtext);return e.$attrs$=t.vattrs,e.$children$=t.vchildren,e.$key$=t.vkey,e.$name$=t.vname,e},K=(t,e)=>null==t||E(t)?t:4&e?"false"!==t&&(""===t||!!t):2&e?parseFloat(t):1&e?String(t):t,W=t=>n(t).$hostElement$,Y=(t,e,i)=>{const r=W(t);return{emit:t=>Z(r,e,{bubbles:!!(4&i),composed:!!(2&i),cancelable:!!(1&i),detail:t})}},Z=(t,e,i)=>{const r=f.ce(e,i);return t.dispatchEvent(r),r},Q=new WeakMap,J=t=>{const e=t.$cmpMeta$,i=t.$hostElement$,r=e.$flags$,a=(e.$tagName$,()=>{}),s=((t,e)=>{var i;const r=X(e),a=h.get(r);if(!u.document)return r;if(t=11===t.nodeType?t:u.document,a)if("string"==typeof a){t=t.head||t;let s,n=Q.get(t);if(n||Q.set(t,n=new Set),!n.has(r)){{s=document.querySelector(`[sty-id="${r}"]`)||u.document.createElement("style"),s.innerHTML=a;const n=null!=(i=f.$nonce$)?i:T(u.document);if(null!=n&&s.setAttribute("nonce",n),!(1&e.$flags$))if("HEAD"===t.nodeName){const e=t.querySelectorAll("link[rel=preconnect]"),i=e.length>0?e[e.length-1].nextSibling:t.querySelector("style");t.insertBefore(s,(null==i?void 0:i.parentNode)===t?i:null)}else if("host"in t)if(v){const e=new CSSStyleSheet;e.replaceSync(a),t.adoptedStyleSheets=[e,...t.adoptedStyleSheets]}else{const e=t.querySelector("style");e?e.innerHTML=a+e.innerHTML:t.prepend(s)}else t.append(s);1&e.$flags$&&t.insertBefore(s,null)}4&e.$flags$&&(s.innerHTML+=p),n&&n.add(r)}}else t.adoptedStyleSheets.includes(a)||(t.adoptedStyleSheets=[...t.adoptedStyleSheets,a]);return r})(i.shadowRoot?i.shadowRoot:i.getRootNode(),e);(10&r&&2&r||128&r)&&(i["s-sc"]=s,i.classList.add(s+"-h")),a()},X=(t,e)=>"sc-"+t.$tagName$,tt=(t,e,i,r,a,s,n)=>{if(i===r)return;let o=c(t,e),l=e.toLowerCase();if("class"===e){const e=t.classList,a=it(i);let s=it(r);e.remove(...a.filter((t=>t&&!s.includes(t)))),e.add(...s.filter((t=>t&&!a.includes(t))))}else if("style"===e){for(const e in i)r&&null!=r[e]||(e.includes("-")?t.style.removeProperty(e):t.style[e]="");for(const e in r)i&&r[e]===i[e]||(e.includes("-")?t.style.setProperty(e,r[e]):t.style[e]=r[e])}else if("key"===e);else if("ref"===e)r&&r(t);else if(o||"o"!==e[0]||"n"!==e[1]){const n=E(r);if(o||n&&null!==r)try{if(t.tagName.includes("-"))t[e]!==r&&(t[e]=r);else{const a=null==r?"":r;"list"===e?o=!1:null!=i&&t[e]==a||("function"==typeof t.__lookupSetter__(e)?t[e]=a:t.setAttribute(e,a))}}catch(t){}let c=!1;l!==(l=l.replace(/^xlink\:?/,""))&&(e=l,c=!0),null==r||!1===r?!1===r&&""!==t.getAttribute(e)||(c?t.removeAttributeNS(g,e):t.removeAttribute(e)):(!o||4&s||a)&&!n&&1===t.nodeType&&(r=!0===r?"":r,c?t.setAttributeNS(g,e,r):t.setAttribute(e,r))}else if(e="-"===e[2]?e.slice(3):c(u,l)?l.slice(2):l[2]+e.slice(3),i||r){const a=e.endsWith(rt);e=e.replace(at,""),i&&f.rel(t,e,i,a),r&&f.ael(t,e,r,a)}},et=/\s/,it=t=>("object"==typeof t&&t&&"baseVal"in t&&(t=t.baseVal),t&&"string"==typeof t?t.split(et):[]),rt="Capture",at=new RegExp(rt+"$"),st=(t,e,i,r)=>{const a=11===e.$elm$.nodeType&&e.$elm$.host?e.$elm$.host:e.$elm$,s=t&&t.$attrs$||{},n=e.$attrs$||{};for(const t of nt(Object.keys(s)))t in n||tt(a,t,s[t],void 0,i,e.$flags$);for(const t of nt(Object.keys(n)))tt(a,t,s[t],n[t],i,e.$flags$)};function nt(t){return t.includes("ref")?[...t.filter((t=>"ref"!==t)),"ref"]:t}var ot=!1,ct=!1,lt=!1,dt=!1,ht=(t,e,i)=>{var a;const s=e.$children$[i];let n,o,c,l=0;if(ot||(lt=!0,"slot"===s.$tag$&&(s.$flags$|=s.$children$?2:1)),null!==s.$text$)n=s.$elm$=u.document.createTextNode(s.$text$);else if(1&s.$flags$)n=s.$elm$=u.document.createTextNode(""),st(null,s,dt);else{if(!u.document)throw new Error("You are trying to render a Stencil component in an environment that doesn't support the DOM. Make sure to populate the [`window`](https://developer.mozilla.org/en-US/docs/Web/API/Window/window) object before rendering a component.");if(n=s.$elm$=u.document.createElement(!ot&&r&&2&s.$flags$?"slot-fb":s.$tag$),st(null,s,dt),s.$children$)for(l=0;l<s.$children$.length;++l)o=ht(t,s,l),o&&n.appendChild(o)}return n["s-hn"]=z,3&s.$flags$&&(n["s-sr"]=!0,n["s-cr"]=j,n["s-sn"]=s.$name$||"",n["s-rf"]=null==(a=s.$attrs$)?void 0:a.ref,function(t){if(t.assignedElements||t.assignedNodes||!t["s-sr"])return;const e=e=>function(t){const i=[],r=this["s-sn"];(null==t?void 0:t.flatten)&&console.error("\n Flattening is not supported for Stencil non-shadow slots. \n You can use `.childNodes` to nested slot fallback content.\n If you have a particular use case, please open an issue on the Stencil repo.\n ");const a=this["s-cr"].parentElement;return(a.__childNodes?a.childNodes:(t=>{const e=[];for(let i=0;i<t.length;i++){const r=t[i]["s-nr"]||void 0;r&&r.isConnected&&e.push(r)}return e})(a.childNodes)).forEach((t=>{r===$(t)&&i.push(t)})),e?i.filter((t=>1===t.nodeType)):i}.bind(t);t.assignedElements=e(!0),t.assignedNodes=e(!1)}(n),c=t&&t.$children$&&t.$children$[i],c&&c.$tag$===s.$tag$&&t.$elm$&&pt(t.$elm$,!1)),n},pt=(t,e)=>{f.$flags$|=1;const i=Array.from(t.__childNodes||t.childNodes);t["s-sr"];for(let t=i.length-1;t>=0;t--){const r=i[t];r["s-hn"]!==z&&r["s-ol"]&&(wt(mt(r).parentNode,r,mt(r)),r["s-ol"].remove(),r["s-ol"]=void 0,r["s-sh"]=void 0,lt=!0),e&&pt(r,e)}f.$flags$&=-2},gt=(t,e,i,r,a,s)=>{let n,o=t["s-cr"]&&t["s-cr"].parentNode||t;for(o.shadowRoot&&o.tagName===z&&(o=o.shadowRoot);a<=s;++a)r[a]&&(n=ht(null,i,a),n&&(r[a].$elm$=n,wt(o,n,mt(e))))},ut=(t,e,i)=>{for(let r=e;r<=i;++r){const e=t[r];if(e){const t=e.$elm$;yt(e),t&&(ct=!0,t["s-ol"]?t["s-ol"].remove():pt(t,!0),t.remove())}}},ft=(t,e,i=!1)=>t.$tag$===e.$tag$&&("slot"===t.$tag$?t.$name$===e.$name$:i?(i&&!t.$key$&&e.$key$&&(t.$key$=e.$key$),!0):t.$key$===e.$key$),mt=t=>t&&t["s-ol"]||t,vt=(t,e,i=!1)=>{const r=e.$elm$=t.$elm$,s=t.$children$,n=e.$children$,o=e.$text$;let c;null===o?(st(t,e,dt),null!==s&&null!==n?((t,e,i,r,a=!1)=>{let s,n,o=0,c=0,l=0,d=0,h=e.length-1,p=e[0],g=e[h],u=r.length-1,f=r[0],m=r[u];for(;o<=h&&c<=u;)if(null==p)p=e[++o];else if(null==g)g=e[--h];else if(null==f)f=r[++c];else if(null==m)m=r[--u];else if(ft(p,f,a))vt(p,f,a),p=e[++o],f=r[++c];else if(ft(g,m,a))vt(g,m,a),g=e[--h],m=r[--u];else if(ft(p,m,a))"slot"!==p.$tag$&&"slot"!==m.$tag$||pt(p.$elm$.parentNode,!1),vt(p,m,a),wt(t,p.$elm$,g.$elm$.nextSibling),p=e[++o],m=r[--u];else if(ft(g,f,a))"slot"!==p.$tag$&&"slot"!==m.$tag$||pt(g.$elm$.parentNode,!1),vt(g,f,a),wt(t,g.$elm$,p.$elm$),g=e[--h],f=r[++c];else{for(l=-1,d=o;d<=h;++d)if(e[d]&&null!==e[d].$key$&&e[d].$key$===f.$key$){l=d;break}l>=0?(n=e[l],n.$tag$!==f.$tag$?s=ht(e&&e[c],i,l):(vt(n,f,a),e[l]=void 0,s=n.$elm$),f=r[++c]):(s=ht(e&&e[c],i,c),f=r[++c]),s&&wt(mt(p.$elm$).parentNode,s,mt(p.$elm$))}o>h?gt(t,null==r[u+1]?null:r[u+1].$elm$,i,r,c,u):c>u&&ut(e,o,h)})(r,s,e,n,i):null!==n?(null!==t.$text$&&(r.textContent=""),gt(r,null,e,n,0,n.length-1)):!i&&a&&null!==s&&ut(s,0,s.length-1)):(c=r["s-cr"])?c.parentNode.textContent=o:t.$text$!==o&&(r.data=o)},bt=[],kt=t=>{let e,i,r;const a=t.__childNodes||t.childNodes;for(const t of a){if(t["s-sr"]&&(e=t["s-cr"])&&e.parentNode){i=e.parentNode.__childNodes||e.parentNode.childNodes;const a=t["s-sn"];for(r=i.length-1;r>=0;r--)if(e=i[r],!e["s-cn"]&&!e["s-nr"]&&e["s-hn"]!==t["s-hn"])if(U(e,a)){let i=bt.find((t=>t.$nodeToRelocate$===e));ct=!0,e["s-sn"]=e["s-sn"]||a,i?(i.$nodeToRelocate$["s-sh"]=t["s-hn"],i.$slotRefNode$=t):(e["s-sh"]=t["s-hn"],bt.push({$slotRefNode$:t,$nodeToRelocate$:e})),e["s-sr"]&&bt.map((t=>{U(t.$nodeToRelocate$,e["s-sn"])&&(i=bt.find((t=>t.$nodeToRelocate$===e)),i&&!t.$slotRefNode$&&(t.$slotRefNode$=i.$slotRefNode$))}))}else bt.some((t=>t.$nodeToRelocate$===e))||bt.push({$nodeToRelocate$:e})}1===t.nodeType&&kt(t)}},yt=t=>{t.$attrs$&&t.$attrs$.ref&&t.$attrs$.ref(null),t.$children$&&t.$children$.map(yt)},wt=(t,e,i)=>null==t?void 0:t.insertBefore(e,i),xt=(t,e,i=!1)=>{var r,a,s,n;const o=t.$hostElement$,c=t.$cmpMeta$,l=t.$vnode$||B(null,null),d=(h=e)&&h.$tag$===H?e:N(null,null,e);var h;if(z=o.tagName,c.$attrsToReflect$&&(d.$attrs$=d.$attrs$||{},c.$attrsToReflect$.map((([t,e])=>d.$attrs$[e]=o[t]))),i&&d.$attrs$)for(const t of Object.keys(d.$attrs$))o.hasAttribute(t)&&!["key","ref","style","class"].includes(t)&&(d.$attrs$[t]=o[t]);if(d.$tag$=null,d.$flags$|=4,t.$vnode$=d,d.$elm$=l.$elm$=o.shadowRoot||o,ot=!(!(1&c.$flags$)||128&c.$flags$),j=o["s-cr"],ct=!1,vt(l,d,i),f.$flags$|=1,lt){kt(d.$elm$);for(const t of bt){const e=t.$nodeToRelocate$;if(!e["s-ol"]&&u.document){const t=u.document.createTextNode("");t["s-nr"]=e,wt(e.parentNode,e["s-ol"]=t,e)}}for(const t of bt){const e=t.$nodeToRelocate$,o=t.$slotRefNode$;if(o){const t=o.parentNode;let i=o.nextSibling;{let s=null==(r=e["s-ol"])?void 0:r.previousSibling;for(;s;){let r=null!=(a=s["s-nr"])?a:null;if(r&&r["s-sn"]===e["s-sn"]&&t===(r.__parentNode||r.parentNode)){for(r=r.nextSibling;r===e||(null==r?void 0:r["s-sr"]);)r=null==r?void 0:r.nextSibling;if(!r||!r["s-nr"]){i=r;break}}s=s.previousSibling}}const n=e.__parentNode||e.parentNode,c=e.__nextSibling||e.nextSibling;(!i&&t!==n||c!==i)&&e!==i&&(!e["s-hn"]&&e["s-ol"]&&(e["s-hn"]=e["s-ol"].parentNode.nodeName),wt(t,e,i),1===e.nodeType&&"SLOT-FB"!==e.tagName&&(e.hidden=null!=(s=e["s-ih"])&&s)),e&&"function"==typeof o["s-rf"]&&o["s-rf"](o)}else 1===e.nodeType&&(i&&(e["s-ih"]=null!=(n=e.hidden)&&n),e.hidden=!0)}}ct&&M(d.$elm$),f.$flags$&=-2,bt.length=0,j=void 0},St=(t,e)=>{if(e&&!t.$onRenderResolve$&&e["s-p"]){const i=e["s-p"].push(new Promise((r=>t.$onRenderResolve$=()=>{e["s-p"].splice(i-1,1),r()})))}},Pt=(t,e)=>{if(t.$flags$|=16,4&t.$flags$)return void(t.$flags$|=512);St(t,t.$ancestorComponent$);return C((()=>Ct(t,e)))},Ct=(t,e)=>{const i=t.$hostElement$,r=(t.$cmpMeta$.$tagName$,()=>{}),a=t.$lazyInstance$;if(!a)throw new Error(`Can't render component <${i.tagName.toLowerCase()} /> with invalid Stencil runtime! Make sure this imported component is compiled with a \`externalRuntime: true\` flag. For more information, please refer to https://stenciljs.com/docs/custom-elements#externalruntime`);let s;return e?(t.$flags$|=256,t.$queuedListeners$&&(t.$queuedListeners$.map((([t,e])=>Ot(a,t,e,i))),t.$queuedListeners$=void 0),s=Ot(a,"componentWillLoad",void 0,i)):s=Ot(a,"componentWillUpdate",void 0,i),s=Et(s,(()=>Ot(a,"componentWillRender",void 0,i))),r(),Et(s,(()=>Lt(t,a,e)))},Et=(t,e)=>Tt(t)?t.then(e).catch((t=>{console.error(t),e()})):e(),Tt=t=>t instanceof Promise||t&&t.then&&"function"==typeof t.then,Lt=async(t,e,i)=>{var r;const a=t.$hostElement$,s=(t.$cmpMeta$.$tagName$,()=>{}),n=a["s-rc"];i&&J(t);const o=(t.$cmpMeta$.$tagName$,()=>{});Rt(t,e,a,i),n&&(n.map((t=>t())),a["s-rc"]=void 0),o(),s();{const e=null!=(r=a["s-p"])?r:[],i=()=>Dt(t);0===e.length?i():(Promise.all(e).then(i),t.$flags$|=4,e.length=0)}},_t=null,Rt=(t,e,i,r)=>{try{_t=e,e=e.render(),t.$flags$&=-17,t.$flags$|=2,xt(t,e,r)}catch(e){l(e,t.$hostElement$)}return _t=null,null},At=()=>_t,Dt=t=>{t.$cmpMeta$.$tagName$;const e=t.$hostElement$,i=()=>{},r=t.$lazyInstance$,a=t.$ancestorComponent$;Ot(r,"componentDidRender",void 0,e),64&t.$flags$?(Ot(r,"componentDidUpdate",void 0,e),i()):(t.$flags$|=64,Ut(e),Ot(r,"componentDidLoad",void 0,e),i(),t.$onReadyResolve$(e),a||It()),t.$onInstanceResolve$(e),t.$onRenderResolve$&&(t.$onRenderResolve$(),t.$onRenderResolve$=void 0),512&t.$flags$&&P((()=>Pt(t,!1))),t.$flags$&=-517},Mt=t=>{{const e=n(t),i=e.$hostElement$.isConnected;return i&&2==(18&e.$flags$)&&Pt(e,!1),i}},It=t=>{P((()=>Z(u,"appload",{detail:{namespace:"realtimekit-ui"}})))},Ot=(t,e,i,r)=>{if(t&&t[e])try{return t[e](i)}catch(t){l(t,r)}},Ut=t=>{var i;return t.classList.add(null!=(i=e)?i:"hydrated")},$t=(t,e,i,r)=>{const a=n(t);if(!a)throw new Error(`Couldn't find host element for "${r.$tagName$}" as it is unknown to this Stencil runtime. This usually happens when integrating a 3rd party Stencil component with another Stencil component or application. Please reach out to the maintainers of the 3rd party Stencil component or report this on the Stencil Discord server (https://chat.stenciljs.com) or comment on this similar [GitHub issue](https://github.com/stenciljs/core/issues/5457).`);const s=a.$hostElement$,o=a.$instanceValues$.get(e),c=a.$flags$,d=a.$lazyInstance$;i=K(i,r.$members$[e][0]);const h=Number.isNaN(o)&&Number.isNaN(i);if((!(8&c)||void 0===o)&&(i!==o&&!h)&&(a.$instanceValues$.set(e,i),d)){if(r.$watchers$&&128&c){const t=r.$watchers$[e];t&&t.map((t=>{try{d[t](i,o,e)}catch(t){l(t,s)}}))}if(2==(18&c)){if(d.componentShouldUpdate&&!1===d.componentShouldUpdate(i,o,e))return;Pt(a,!1)}}},Ft=(t,e,r)=>{var a,s;const o=t.prototype;if(e.$members$||e.$watchers$||t.watchers){t.watchers&&!e.$watchers$&&(e.$watchers$=t.watchers);const c=Object.entries(null!=(a=e.$members$)?a:{});if(c.map((([t,[i]])=>{if(31&i||2&r&&32&i){const{get:a,set:s}=Object.getOwnPropertyDescriptor(o,t)||{};a&&(e.$members$[t][0]|=2048),s&&(e.$members$[t][0]|=4096),(1&r||!a)&&Object.defineProperty(o,t,{get(){{if(!(2048&e.$members$[t][0]))return((t,e)=>n(t).$instanceValues$.get(e))(this,t);const i=n(this),r=i?i.$lazyInstance$:o;if(!r)return;return r[t]}},configurable:!0,enumerable:!0}),Object.defineProperty(o,t,{set(a){const o=n(this);if(s){const r=32&i?this[t]:o.$hostElement$[t];return void 0===r&&o.$instanceValues$.get(t)?a=o.$instanceValues$.get(t):!o.$instanceValues$.get(t)&&r&&o.$instanceValues$.set(t,r),s.apply(this,[K(a,i)]),a=32&i?this[t]:o.$hostElement$[t],void $t(this,t,a,e)}{if(!(1&r&&4096&e.$members$[t][0]))return $t(this,t,a,e),void(1&r&&!o.$lazyInstance$&&o.$onReadyPromise$.then((()=>{4096&e.$members$[t][0]&&o.$lazyInstance$[t]!==o.$instanceValues$.get(t)&&(o.$lazyInstance$[t]=a)})));const s=()=>{const r=o.$lazyInstance$[t];!o.$instanceValues$.get(t)&&r&&o.$instanceValues$.set(t,r),o.$lazyInstance$[t]=K(a,i),$t(this,t,o.$lazyInstance$[t],e)};o.$lazyInstance$?s():o.$onReadyPromise$.then((()=>s()))}}})}else 1&r&&64&i&&Object.defineProperty(o,t,{value(...e){var i;const r=n(this);return null==(i=null==r?void 0:r.$onInstancePromise$)?void 0:i.then((()=>{var i;return null==(i=r.$lazyInstance$)?void 0:i[t](...e)}))}})})),1&r){const r=new Map;o.attributeChangedCallback=function(t,a,s){f.jmp((()=>{var c;const l=r.get(t);if(this.hasOwnProperty(l)&&i)s=this[l],delete this[l];else{if(o.hasOwnProperty(l)&&"number"==typeof this[l]&&this[l]==s)return;if(null==l){const i=n(this),r=null==i?void 0:i.$flags$;if(r&&!(8&r)&&128&r&&s!==a){const r=i.$lazyInstance$,n=null==(c=e.$watchers$)?void 0:c[t];null==n||n.forEach((e=>{null!=r[e]&&r[e].call(r,s,a,t)}))}return}}const d=Object.getOwnPropertyDescriptor(o,l);(s=(null!==s||"boolean"!=typeof this[l])&&s)===this[l]||d.get&&!d.set||(this[l]=s)}))},t.observedAttributes=Array.from(new Set([...Object.keys(null!=(s=e.$watchers$)?s:{}),...c.filter((([t,e])=>15&e[0])).map((([t,i])=>{var a;const s=i[1]||t;return r.set(s,t),512&i[0]&&(null==(a=e.$attrsToReflect$)||a.push([t,s])),s}))]))}}return t},jt=async(t,e,i,r)=>{let a;if(!(32&e.$flags$)){e.$flags$|=32;if(i.$lazyBundleId$){const r=((t,e)=>{const i=t.$tagName$.replace(/-/g,"_"),r=t.$lazyBundleId$;if(!r)return;const a=d.get(r);if(a)return a[i];{const t=t=>(d.set(r,t),t[i]);switch(r){case"rtk-avatar_54":return Promise.resolve().then((function(){return ol})).then(t,l);case"rtk-ai":return Promise.resolve().then((function(){return dl})).then(t,l);case"rtk-ai-toggle":return Promise.resolve().then((function(){return gl})).then(t,l);case"rtk-audio-grid":return Promise.resolve().then((function(){return ml})).then(t,l);case"rtk-audio-tile":return Promise.resolve().then((function(){return Cl})).then(t,l);case"rtk-breakout-rooms-toggle":return Promise.resolve().then((function(){return Ll})).then(t,l);case"rtk-camera-toggle":return Promise.resolve().then((function(){return Al})).then(t,l);case"rtk-caption-toggle":return Promise.resolve().then((function(){return Il})).then(t,l);case"rtk-channel-selector-ui":return Promise.resolve().then((function(){return $l})).then(t,l);case"rtk-chat-composer-ui":return Promise.resolve().then((function(){return Nl})).then(t,l);case"rtk-chat-selector-ui":return Promise.resolve().then((function(){return Gl})).then(t,l);case"rtk-chat-toggle":return Promise.resolve().then((function(){return Ql})).then(t,l);case"rtk-clock":return Promise.resolve().then((function(){return ed})).then(t,l);case"rtk-controlbar":return Promise.resolve().then((function(){return ad})).then(t,l);case"rtk-debugger-toggle":return Promise.resolve().then((function(){return od})).then(t,l);case"rtk-ended-screen":return Promise.resolve().then((function(){return dd})).then(t,l);case"rtk-file-dropzone":return Promise.resolve().then((function(){return gd})).then(t,l);case"rtk-grid":return Promise.resolve().then((function(){return ah})).then(t,l);case"rtk-grid-pagination":return Promise.resolve().then((function(){return oh})).then(t,l);case"rtk-header":return Promise.resolve().then((function(){return dh})).then(t,l);case"rtk-idle-screen":return Promise.resolve().then((function(){return gh})).then(t,l);case"rtk-image-viewer":return Promise.resolve().then((function(){return mh})).then(t,l);case"rtk-information-tooltip":return Promise.resolve().then((function(){return bh})).then(t,l);case"rtk-leave-button":return Promise.resolve().then((function(){return wh})).then(t,l);case"rtk-livestream-toggle":return Promise.resolve().then((function(){return Ph})).then(t,l);case"rtk-meeting-title":return Promise.resolve().then((function(){return Th})).then(t,l);case"rtk-message-list-view":return Promise.resolve().then((function(){return _h})).then(t,l);case"rtk-mic-toggle":return Promise.resolve().then((function(){return Dh})).then(t,l);case"rtk-mixed-grid":return Promise.resolve().then((function(){return Oh})).then(t,l);case"rtk-more-toggle":return Promise.resolve().then((function(){return Fh})).then(t,l);case"rtk-mute-all-button":return Promise.resolve().then((function(){return Nh})).then(t,l);case"rtk-network-indicator":return Promise.resolve().then((function(){return Gh})).then(t,l);case"rtk-participant-count":return Promise.resolve().then((function(){return Kh})).then(t,l);case"rtk-participant-setup":return Promise.resolve().then((function(){return Zh})).then(t,l);case"rtk-participants":return Promise.resolve().then((function(){return Xh})).then(t,l);case"rtk-participants-audio":return Promise.resolve().then((function(){return rp})).then(t,l);case"rtk-participants-toggle":return Promise.resolve().then((function(){return np})).then(t,l);case"rtk-pip-toggle":return Promise.resolve().then((function(){return lp})).then(t,l);case"rtk-plugins-toggle":return Promise.resolve().then((function(){return pp})).then(t,l);case"rtk-polls-toggle":return Promise.resolve().then((function(){return fp})).then(t,l);case"rtk-recording-indicator":return Promise.resolve().then((function(){return bp})).then(t,l);case"rtk-recording-toggle":return Promise.resolve().then((function(){return wp})).then(t,l);case"rtk-screen-share-toggle":return Promise.resolve().then((function(){return Cp})).then(t,l);case"rtk-screenshare-view":return Promise.resolve().then((function(){return Dp})).then(t,l);case"rtk-settings":return Promise.resolve().then((function(){return Op})).then(t,l);case"rtk-settings-toggle":return Promise.resolve().then((function(){return Fp})).then(t,l);case"rtk-setup-screen":return Promise.resolve().then((function(){return Np})).then(t,l);case"rtk-sidebar":return Promise.resolve().then((function(){return Gp})).then(t,l);case"rtk-simple-grid":return Promise.resolve().then((function(){return Kp})).then(t,l);case"rtk-spotlight-grid":return Promise.resolve().then((function(){return Zp})).then(t,l);case"rtk-stage":return Promise.resolve().then((function(){return Xp})).then(t,l);case"rtk-stage-toggle":return Promise.resolve().then((function(){return ig})).then(t,l);case"rtk-transcripts":return Promise.resolve().then((function(){return Gg})).then(t,l);case"rtk-ui-provider":return Promise.resolve().then((function(){return qg})).then(t,l);case"rtk-waiting-screen":return Promise.resolve().then((function(){return Yg})).then(t,l);case"rtk-ai-transcriptions":return Promise.resolve().then((function(){return Jg})).then(t,l);case"rtk-livestream-indicator_3":return Promise.resolve().then((function(){return Uw})).then(t,l);case"rtk-name-tag":return Promise.resolve().then((function(){return jw})).then(t,l);case"rtk-participants-stage-list_4":return Promise.resolve().then((function(){return Ww})).then(t,l);case"rtk-plugin-main_2":return Promise.resolve().then((function(){return Xw})).then(t,l);case"rtk-plugins_2":return Promise.resolve().then((function(){return ax})).then(t,l);case"rtk-settings-audio_2":return Promise.resolve().then((function(){return lx})).then(t,l);case"rtk-transcript":return Promise.resolve().then((function(){return hx})).then(t,l);case"rtk-audio-visualizer_4":return Promise.resolve().then((function(){return wx})).then(t,l);case"rtk-fullscreen-toggle":return Promise.resolve().then((function(){return Px})).then(t,l);case"rtk-participant_2":return Promise.resolve().then((function(){return Lx})).then(t,l);case"rtk-camera-selector_2":return Promise.resolve().then((function(){return Mx})).then(t,l);case"rtk-poll_2":return Promise.resolve().then((function(){return Fx})).then(t,l);case"rtk-sidebar-ui":return Promise.resolve().then((function(){return zx})).then(t,l);case"rtk-spotlight-indicator":return Promise.resolve().then((function(){return Hx})).then(t,l);case"rtk-controlbar-button":return Promise.resolve().then((function(){return qx})).then(t,l)}}return import(`./${r}.entry.js`).then((t=>(d.set(r,t),t[i])),(t=>{l(t,e.$hostElement$)}))})(i,e);if(r&&"then"in r){const t=()=>{};a=await r,t()}else a=r;if(!a)throw new Error(`Constructor for "${i.$tagName$}#${e.$modeName$}" was not found`);a.isProxied||(i.$watchers$=a.watchers,Ft(a,i,2),a.isProxied=!0);const s=(i.$tagName$,()=>{});e.$flags$|=8;try{new a(e)}catch(e){l(e,t)}e.$flags$&=-9,e.$flags$|=128,s(),zt(e.$lazyInstance$,t)}else{a=t.constructor;const i=t.localName;customElements.whenDefined(i).then((()=>e.$flags$|=128))}if(a&&a.style){let t;"string"==typeof a.style&&(t=a.style);const e=X(i);if(!h.has(e)){const r=(i.$tagName$,()=>{});((t,e,i)=>{let r=h.get(t);v&&i?(r=r||new CSSStyleSheet,"string"==typeof r?r=e:r.replaceSync(e)):r=e,h.set(t,r)})(e,t,!!(1&i.$flags$)),r()}}}const s=e.$ancestorComponent$,n=()=>Pt(e,!0);s&&s["s-rc"]?s["s-rc"].push(n):n()},zt=(t,e)=>{Ot(t,"connectedCallback",void 0,e)},Nt=t=>{if(!u.document)return;const e=t["s-cr"]=u.document.createComment("");e["s-cn"]=!0,wt(t,e,t.firstChild)},Bt=(t,e)=>{Ot(t,"disconnectedCallback",void 0,e||t)},Ht=(t,e={})=>{var i;if(!u.document)return void console.warn("Stencil: No document found. Skipping bootstrapping lazy components.");const r=()=>{},a=[],s=e.exclude||[],o=u.customElements,c=u.document.head,l=c.querySelector("meta[charset]"),d=u.document.createElement("style"),h=[];let g,m=!0;Object.assign(f,e),f.$resourcesUrl$=new URL(e.resourcesUrl||"./",u.document.baseURI).href;let v=!1;if(t.map((t=>{t[1].map((e=>{var i;const r={$flags$:e[0],$tagName$:e[1],$members$:e[2],$listeners$:e[3]};4&r.$flags$&&(v=!0),r.$members$=e[2],r.$listeners$=e[3],r.$attrsToReflect$=[],r.$watchers$=null!=(i=e[4])?i:{};const c=r.$tagName$,l=class extends HTMLElement{constructor(t){if(super(t),this.hasRegisteredEventListeners=!1,((t,e)=>{const i={$flags$:0,$hostElement$:t,$cmpMeta$:e,$instanceValues$:new Map};i.$onInstancePromise$=new Promise((t=>i.$onInstanceResolve$=t)),i.$onReadyPromise$=new Promise((t=>i.$onReadyResolve$=t)),t["s-p"]=[],t["s-rc"]=[];const r=i;t.__stencil__getHostRef=()=>r})(t=this,r),1&r.$flags$)if(t.shadowRoot){if("open"!==t.shadowRoot.mode)throw new Error(`Unable to re-use existing shadow root for ${r.$tagName$}! Mode is set to ${t.shadowRoot.mode} but Stencil only supports open shadow roots.`)}else t.attachShadow({mode:"open",delegatesFocus:!!(16&r.$flags$)})}connectedCallback(){const t=n(this);this.hasRegisteredEventListeners||(this.hasRegisteredEventListeners=!0,Vt(this,t,r.$listeners$)),g&&(clearTimeout(g),g=null),m?h.push(this):f.jmp((()=>(t=>{if(!(1&f.$flags$)){const e=n(t),i=e.$cmpMeta$,r=(i.$tagName$,()=>{});if(1&e.$flags$)Vt(t,e,i.$listeners$),(null==e?void 0:e.$lazyInstance$)?zt(e.$lazyInstance$,t):(null==e?void 0:e.$onReadyPromise$)&&e.$onReadyPromise$.then((()=>zt(e.$lazyInstance$,t)));else{e.$flags$|=1,12&i.$flags$&&Nt(t);{let i=t;for(;i=i.parentNode||i.host;)if(i["s-p"]){St(e,e.$ancestorComponent$=i);break}}i.$members$&&Object.entries(i.$members$).map((([e,[i]])=>{if(31&i&&t.hasOwnProperty(e)){const i=t[e];delete t[e],t[e]=i}})),jt(t,e,i)}r()}})(this)))}disconnectedCallback(){f.jmp((()=>(async t=>{if(!(1&f.$flags$)){const e=n(t);e.$rmListeners$&&(e.$rmListeners$.map((t=>t())),e.$rmListeners$=void 0),(null==e?void 0:e.$lazyInstance$)?Bt(e.$lazyInstance$,t):(null==e?void 0:e.$onReadyPromise$)&&e.$onReadyPromise$.then((()=>Bt(e.$lazyInstance$,t)))}Q.has(t)&&Q.delete(t),t.shadowRoot&&Q.has(t.shadowRoot)&&Q.delete(t.shadowRoot)})(this))),f.raf((()=>{var t;const e=n(this),i=h.findIndex((t=>t===this));i>-1&&h.splice(i,1),(null==(t=null==e?void 0:e.$vnode$)?void 0:t.$elm$)instanceof Node&&!e.$vnode$.$elm$.isConnected&&delete e.$vnode$.$elm$}))}componentOnReady(){return n(this).$onReadyPromise$}};r.$lazyBundleId$=t[0],s.includes(c)||o.get(c)||(a.push(c),o.define(c,Ft(l,r,1)))}))})),a.length>0&&(v&&(d.textContent+=p),d.textContent+=a.sort()+"{visibility:hidden}.hydrated{visibility:inherit}",d.innerHTML.length)){d.setAttribute("data-styles","");const t=null!=(i=f.$nonce$)?i:T(u.document);null!=t&&d.setAttribute("nonce",t),c.insertBefore(d,l?l.nextSibling:c.firstChild)}m=!1,h.length?h.map((t=>t.connectedCallback())):f.jmp((()=>g=setTimeout(It,30))),r()},Gt=(t,e)=>e,Vt=(t,e,i,r)=>{i&&u.document&&i.map((([i,r,a])=>{const s=Kt(u.document,t,i),n=qt(e,a),o=Wt(i);f.ael(s,r,n,o),(e.$rmListeners$=e.$rmListeners$||[]).push((()=>f.rel(s,r,n,o)))}))},qt=(t,e)=>i=>{var r;try{256&t.$flags$?null==(r=t.$lazyInstance$)||r[e](i):(t.$queuedListeners$=t.$queuedListeners$||[]).push([e,i])}catch(e){l(e,t.$hostElement$)}},Kt=(t,e,i)=>8&i?u:e,Wt=t=>m?{passive:!!(1&t),capture:!!(2&t)}:!!(2&t);const Yt=t=>!!Qt(t)&&("LIVESTREAM"===t.meta.viewType&&"ON_STAGE"!==t.stage.status),Zt=t=>{var e;return!!Qt(t)&&("LIVESTREAM"===t.meta.viewType&&(null===(e=null==t?void 0:t.self)||void 0===e?void 0:e.permissions.canLivestream))},Qt=t=>null==t?void 0:t.livestream;var Jt,Xt;!function(t){t.BUFFERING="Buffering",t.ENDED="Ended",t.IDLE="Idle",t.PAUSED="Paused",t.PLAYING="Playing",t.READY="Ready"}(Jt||(Jt={})),function(t){t.INITIALIZED="PlayerInitialized",t.QUALITY_CHANGED="PlayerQualityChanged",t.DURATION_CHANGED="PlayerDurationChanged",t.VOLUME_CHANGED="PlayerVolumeChanged",t.MUTED_CHANGED="PlayerMutedChanged",t.PLAYBACK_RATE_CHANGED="PlayerPlaybackRateChanged",t.REBUFFERING="PlayerRebuffering",t.AUDIO_BLOCKED="PlayerAudioBlocked",t.PLAYBACK_BLOCKED="PlayerPlaybackBlocked",t.ERROR="PlayerError",t.RECOVERABLE_ERROR="PlayerRecoverableError",t.ANALYTICS_EVENT="PlayerAnalyticsEvent",t.TIME_UPDATE="PlayerTimeUpdate",t.BUFFER_UPDATE="PlayerBufferUpdate",t.SEEK_COMPLETED="PlayerSeekCompleted",t.SESSION_DATA="PlayerSessionData",t.STATE_CHANGED="PlayerStateChanged",t.WORKER_ERROR="PlayerWorkerError",t.METADATA="PlayerMetadata",t.TEXT_CUE="PlayerTextCue",t.TEXT_METADATA_CUE="PlayerTextMetadataCue",t.AD_CUE="PlayerAdCue",t.STREAM_SOURCE_CUE="PlayerStreamSourceCue",t.NETWORK_UNAVAILABLE="PlayerNetworkUnavailable",t.SEGMENT_DISCONTINUITY="PlayerSegmentDiscontinuity",t.SEGMENT_METADATA="PlayerSegmentMetadata",t.PLAYER_METADATA="PlayerMetadata"}(Xt||(Xt={}));const te="play_participant_tile_video_on_pause",ee="disable_emoji_picker",ie="disable_kicking",re="admin_cantremove_admin",ae="cantinvite_viewer",se="pinned_msgs",ne=t=>{var e;return"CHAT"===(null==t?void 0:t.meta.viewType)||Qt(t)||(null===(e=null==t?void 0:t.__internals__)||void 0===e?void 0:e.features.hasFeature("feat_paginated_chat"))},oe=t=>{var e,i;return(null===(e=null==t?void 0:t.__internals__)||void 0===e?void 0:e.browserSpecs.isFirefox())&&(null===(i=null==t?void 0:t.__internals__)||void 0===i?void 0:i.features.hasFeature("disable_firefox_setting_sink_id"))};let ce=0;const le="temp-";function de(t){return t.includes(le)}function he(t){var e;return null!==(e=t.customParticipantId)&&void 0!==e?e:t.clientSpecificId}function pe(t){const e=new Map;return[t.self,...t.participants.joined.toArray()].map((t=>{e.set(he(t),t.picture)})),[t.connectedMeetings.parentMeeting,...t.connectedMeetings.meetings].flatMap((t=>t.participants)).map((t=>({id:t.id,customParticipantId:he(t),displayName:t.displayName,displayPictureUrl:""!==t.displayPictureUrl?t.displayPictureUrl:e.get(he(t))})))}const ge=t=>{if(!(t=>t.connectedMeetings.supportsConnectedMeetings)(t))return!1;const e=t.self.permissions.connectedMeetings;return!!e.canAlterConnectedMeetings||!(!e.canSwitchConnectedMeetings&&!e.canSwitchToParentMeeting)&&t.connectedMeetings.isActive};var ue,fe,me,ve,be,ke,ye,we,xe,Se,Pe,Ce,Ee,Te,Le,_e=function(t,e,i,r,a){if("m"===r)throw new TypeError("Private method is not writable");if("a"===r&&!a)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!a:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===r?a.call(t,i):a?a.value=i:e.set(t,i),i},Re=function(t,e,i,r){if("a"===i&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!r:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===i?r:"a"===i?r.call(t):r?r.value:e.get(t)};class Ae{constructor(){ue.add(this),fe.set(this,!1),me.set(this,void 0),ve.set(this,void 0),be.set(this,void 0),ke.set(this,void 0),ye.set(this,void 0),we.set(this,void 0),xe.set(this,void 0),Se.set(this,void 0)}get hasLocalChanges(){return Re(this,fe,"f")}get currentState(){let t,e=[];return Array.from(Re(this,ke,"f").keys()).forEach((i=>{const r=Re(this,we,"f").get(i);r.isParent?t=Object.assign(Object.assign({},r),{participants:Re(this,ue,"m",Le).call(this,i)}):e.push(Object.assign(Object.assign({},r),{participants:Re(this,ue,"m",Le).call(this,i)}))})),{parentMeeting:t,meetings:e}}get allConnectedMeetings(){return this.currentState.meetings.sort(((t,e)=>t.title.localeCompare(e.title)))}get allParticipants(){return Array.from(Re(this,ye,"f").values())}get unassignedParticipants(){return Re(this,ue,"m",Le).call(this,Re(this,me,"f").parentMeeting.id)}getParticipantsForMeeting(t){return Re(this,ue,"m",Le).call(this,t)}addNewMeeting(){_e(this,fe,!0,"f");const t=function(t,e){var i={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(i[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var a=0;for(r=Object.getOwnPropertySymbols(t);a<r.length;a++)e.indexOf(r[a])<0&&Object.prototype.propertyIsEnumerable.call(t,r[a])&&(i[r[a]]=t[r[a]])}return i}({id:`${le}${Math.random().toString(36)}`,title:"Room "+ ++ce,participants:[]},["participants"]);return Re(this,ue,"m",Ce).call(this,Object.assign(Object.assign({},t),{isParent:!1})),t}addNewMeetings(t){return Array.from({length:t}).map((()=>this.addNewMeeting()))}updateMeetingTitle(t,e){Re(this,we,"f").get(t).title=e,de(t)||Re(this,xe,"f").add(t)}deleteMeeting(t){_e(this,fe,!0,"f");const e=Re(this,we,"f").get(t),i=Re(this,ue,"m",Le).call(this,e.id).map(he);this.assignParticipantsToMeeting(i,Re(this,me,"f").parentMeeting.id),Re(this,we,"f").delete(e.id),Re(this,ke,"f").delete(e.id),de(e.id)||Re(this,Se,"f").add(e.id)}assignParticipantsToMeeting(t,e){return _e(this,fe,!0,"f"),t.forEach((t=>{const i=Re(this,ve,"f").get(t);Re(this,ke,"f").get(i).delete(t),Re(this,ke,"f").get(e).add(t),Re(this,ve,"f").set(t,e)})),this.currentState}assignParticipantsRandomly(){const t=function(t,e){const i=t.length,r=Math.ceil(i/e),a=new Array(e);let s=0;for(let i=0;i<e;i++)a[i]=t.slice(s,s+r),s+=r;return a.filter((t=>t.length))}(this.unassignedParticipants,this.allConnectedMeetings.length);return this.allConnectedMeetings.forEach(((e,i)=>{const r=t[i];r&&0!==r.length&&this.assignParticipantsToMeeting(r.map((t=>t.customParticipantId)),e.id)})),this.currentState}unassignParticipants(t){const e=Re(this,me,"f").parentMeeting.id;return this.assignParticipantsToMeeting(t,e)}unassignAllParticipants(){const t=Re(this,me,"f").parentMeeting.id,e=this.allParticipants.map(he);return this.assignParticipantsToMeeting(e,t)}updateCurrentState(t){Re(this,fe,"f")||Re(this,ue,"m",Pe).call(this,t),[t.parentMeeting,...t.meetings].forEach(((t,e)=>{const i=Object.assign(Object.assign({},t),{isParent:0===e});Re(this,ue,"m",Ce).call(this,i),t.participants.forEach((t=>{Re(this,ue,"m",Ee).call(this,t,i)}))}))}get meetingsToCreate(){return this.allConnectedMeetings.filter((t=>de(t.id))).map((({id:t,title:e})=>({id:t,title:e})))}get meetingsToUpdate(){return this.allConnectedMeetings.filter((t=>Re(this,xe,"f").has(t.id))).map((({id:t,title:e})=>({id:t,title:e})))}get meetingsToDelete(){return Array.from(Re(this,Se,"f"))}get participantsToMove(){const t=new Map;return Array.from(Re(this,ve,"f").keys()).forEach((e=>{const i=Re(this,be,"f").get(e),r=Re(this,ve,"f").get(e);if(i===r)return;const a=`${i}__${r}`;t.has(a)||t.set(a,[]);const s=Re(this,ye,"f").get(e);t.get(a).push(s.id)})),Array.from(t.keys()).map((e=>{const[i,r]=e.split("__");return{sourceMeetingId:i,destinationMeetingId:r,participantIds:t.get(e)}}))}async applyChanges(t){const e=0!==this.meetingsToCreate.length?t.connectedMeetings.createMeetings(this.meetingsToCreate):Promise.resolve([]),i=0!==this.meetingsToUpdate.length?t.connectedMeetings.updateMeetings(this.meetingsToUpdate):Promise.resolve(),[r]=await Promise.all([e,i]);r&&r.forEach((t=>{this.meetingsToCreate.forEach((e=>{e.title===t.title&&Re(this,ue,"m",Te).call(this,Re(this,we,"f").get(e.id),t.id)}))})),0!==this.participantsToMove.length&&this.participantsToMove.forEach((({sourceMeetingId:e,destinationMeetingId:i,participantIds:r})=>{t.connectedMeetings.moveParticipants(e,i,r)})),0!==this.meetingsToDelete.length&&t.connectedMeetings.deleteMeetings(this.meetingsToDelete)}discardChanges(){return _e(this,fe,!1,"f"),this.updateCurrentState(Re(this,me,"f")),this.currentState}}fe=new WeakMap,me=new WeakMap,ve=new WeakMap,be=new WeakMap,ke=new WeakMap,ye=new WeakMap,we=new WeakMap,xe=new WeakMap,Se=new WeakMap,ue=new WeakSet,Pe=function(t){_e(this,me,t,"f"),_e(this,we,new Map,"f"),_e(this,ye,new Map,"f"),_e(this,xe,new Set,"f"),_e(this,Se,new Set,"f"),_e(this,ke,new Map,"f"),_e(this,ve,new Map,"f"),_e(this,be,new Map,"f"),_e(this,be,new Map,"f"),Re(this,me,"f").parentMeeting.participants.forEach((t=>{Re(this,be,"f").set(he(t),Re(this,me,"f").parentMeeting.id)})),Re(this,me,"f").meetings.forEach((t=>{t.participants.forEach((e=>{Re(this,be,"f").set(he(e),t.id)}))}))},Ce=function(t){Re(this,we,"f").has(t.id)||(Re(this,we,"f").set(t.id,t),Re(this,ke,"f").set(t.id,new Set))},Ee=function(t,e){Re(this,ye,"f").has(he(t))||(Re(this,ye,"f").set(he(t),t),Re(this,ve,"f").set(he(t),e.id),Re(this,ke,"f").get(e.id).add(he(t)))},Te=function(t,e){const i=t.id;Re(this,ue,"m",Ce).call(this,Object.assign(Object.assign({},t),{id:e})),Re(this,we,"f").delete(i);const r=Re(this,ke,"f").get(i);Re(this,ke,"f").set(e,r),Re(this,ke,"f").delete(i),Array.from(Re(this,ve,"f").keys()).forEach((t=>{Re(this,ve,"f").get(t)===i&&Re(this,ve,"f").set(t,e)}))},Le=function(t){return Array.from(Re(this,ke,"f").get(t)).map((t=>Re(this,ye,"f").get(t)))};const De={designTokens:{spacingBase:4,googleFont:"Inter"},styles:{"rtk-header":{display:"grid",height:"48px",gridTemplateColumns:"repeat(3, 1fr)",gridTemplateRows:"1fr",alignItems:"center","--header-section-gap":"var(--rtk-space-2, 8px)"},"rtk-header.sm":{display:"grid",gridArea:"header",gridTemplateColumns:"repeat(2, 1fr)",gridTemplateRows:"1fr",alignItems:"center","--header-section-gap":"var(--rtk-space-1, 4px)"},"div#header-left":{display:"flex",alignItems:"center",height:"48px",wordBreak:"break-all",gap:"var(--header-section-gap)"},"rtk-logo":{height:"26px"},"div#header-center":{display:"flex",alignItems:"center",justifyContent:"center",wordBreak:"break-all",gap:"var(--header-section-gap)",paddingInline:"var(--rtk-space-3, 12px)"},"div#header-right":{display:"flex",alignItems:"center",justifyContent:"flex-end",gap:"var(--header-section-gap)"},"rtk-stage":{display:"flex",flex:"1"},"rtk-grid":{flex:"1",height:"auto"},"rtk-controlbar":{display:"grid",gridTemplateColumns:"repeat(3,1fr)",gridTemplateRows:"1fr",alignItems:"center",padding:"8px"},"rtk-controlbar.sm":{display:"flex",position:"relative",backgroundColor:"rgb(var(--rtk-colors-background-1000, 0 0 0))"},"rtk-controlbar.md":{display:"flex",position:"relative",backgroundColor:"rgb(var(--rtk-colors-background-1000, 0 0 0))"},"div#controlbar-left":{display:"flex",alignItems:"center",gap:"var(--rtk-space-1, 4px)"},"div#controlbar-center":{display:"flex",alignItems:"center",gap:"var(--rtk-space-1, 4px)",position:"relative",overflow:"visible",justifyContent:"center"},"div#controlbar-mobile":{display:"flex",flex:"1",alignItems:"center",gap:"var(--rtk-space-1, 4px)",justifyContent:"center"},"div#controlbar-right":{display:"flex",alignItems:"center",gap:"var(--rtk-space-1, 4px)",justifyContent:"flex-end"},"rtk-settings":{width:"720px",height:"480px"},"rtk-debugger":{width:"720px",height:"480px"},"rtk-breakout-rooms-manager":{minHeight:"400px",minWidth:"500px",maxWidth:"80%",maxHeight:"480px"},"div#setupcontrols-media":{position:"absolute",bottom:"8px",right:"8px",display:"flex",gap:"4px"},"div#setupcontrols-settings":{position:"absolute",top:"8px",right:"8px",display:"flex",flexDirection:"column",gap:"6px"},"rtk-meeting-title.sm":{marginLeft:"0"},"rtk-clock":{marginRight:"0"}},root:{"rtk-meeting":{state:"meeting",states:["activeSidebar","activeAI"]},"rtk-meeting[meeting=waiting]":["rtk-waiting-screen"],"rtk-meeting[meeting=idle]":["rtk-idle-screen"],"rtk-meeting[meeting=setup]":["rtk-setup-screen","rtk-dialog-manager"],"rtk-meeting[meeting=joined]":["rtk-header","rtk-stage","rtk-controlbar","rtk-participants-audio","rtk-dialog-manager"],"rtk-meeting[meeting=joined].activeSidebar.sm":{add:[["rtk-sidebar",{view:"full-screen"}]]},"rtk-meeting[meeting=joined].activeSidebar.md":{add:[["rtk-sidebar",{view:"full-screen"}]]},"rtk-meeting[meeting=joined].activeAI.sm":{add:[["rtk-ai",{view:"full-screen"}]]},"rtk-meeting[meeting=joined].activeAI.md":{add:[["rtk-ai",{view:"full-screen"}]]},"rtk-meeting[meeting=ended]":["rtk-ended-screen"],"rtk-header":["div#header-left","div#header-center","div#header-right"],"rtk-header.sm":{remove:["div#header-center"]},"div#header-left":["rtk-logo","rtk-recording-indicator","rtk-livestream-indicator"],"div#header-center":["rtk-meeting-title"],"div#header-right":["rtk-grid-pagination","rtk-clock","rtk-participant-count","rtk-viewer-count"],"div#header-left.sm":["rtk-meeting-title","rtk-recording-indicator","rtk-livestream-indicator"],"rtk-stage":{states:["activeSidebar","activeAI"],children:["rtk-grid","rtk-notifications","rtk-transcripts"]},"rtk-stage.activeSidebar":{add:[["rtk-sidebar",{view:"sidebar"}]]},"rtk-stage.activeSidebar.sm":{remove:["rtk-sidebar"]},"rtk-stage.activeAI":{add:[["rtk-ai",{view:"sidebar"}]]},"rtk-stage.activeAI.sm":{remove:["rtk-ai"]},"rtk-grid":{states:["activeScreenShare","activePlugin","activeSpotlight"],children:["rtk-simple-grid"]},"rtk-grid.activeSpotlight":["rtk-spotlight-grid"],"rtk-grid.activeScreenShare":["rtk-mixed-grid"],"rtk-grid.activePlugin":["rtk-mixed-grid"],"rtk-grid.activeScreenShare.activeSpotlight":["rtk-mixed-grid"],"rtk-grid.activePlugin.activeSpotlight":["rtk-mixed-grid"],"rtk-grid.activePlugin.activeScreenShare.activeSpotlight":["rtk-mixed-grid"],"rtk-mixed-grid":{states:["activeSpotlight"],children:["rtk-simple-grid"]},"rtk-mixed-grid.activeSpotlight":["rtk-spotlight-grid"],"rtk-participant-tile":{state:"meeting",children:["rtk-name-tag","rtk-avatar","rtk-network-indicator"]},"rtk-participant-setup":["rtk-avatar","div#setupcontrols-media"],"rtk-participant-tile[meeting=setup]":["rtk-avatar","div#setupcontrols-settings","div#setupcontrols-media"],"div#setupcontrols-media":[["rtk-mic-toggle",{size:"sm"}],["rtk-camera-toggle",{size:"sm"}]],"div#setupcontrols-settings":[["rtk-settings-toggle",{size:"sm"}]],"rtk-screenshare-view":{children:["rtk-name-tag","rtk-network-indicator"]},"rtk-name-tag":[["rtk-audio-visualizer",{slot:"start"}]],"rtk-controlbar":{states:["activeMoreMenu"],props:{variant:"solid"},children:["div#controlbar-left","div#controlbar-center","div#controlbar-right"]},"rtk-more-toggle":{states:["activeMoreMenu"],children:[]},"rtk-controlbar.sm":["div#controlbar-mobile"],"rtk-controlbar.md":["div#controlbar-mobile"],"rtk-more-toggle.activeMoreMenu":[["rtk-fullscreen-toggle",{variant:"horizontal",slot:"more-elements"}],["rtk-pip-toggle",{variant:"horizontal",slot:"more-elements"}],["rtk-caption-toggle",{variant:"horizontal",slot:"more-elements"}],["rtk-mute-all-button",{variant:"horizontal",slot:"more-elements"}],["rtk-breakout-rooms-toggle",{variant:"horizontal",slot:"more-elements"}],["rtk-recording-toggle",{variant:"horizontal",slot:"more-elements"}],["rtk-debugger-toggle",{variant:"horizontal"}]],"rtk-more-toggle.activeMoreMenu.sm":[["rtk-chat-toggle",{variant:"horizontal",slot:"more-elements"}],["rtk-participants-toggle",{variant:"horizontal",slot:"more-elements"}],["rtk-polls-toggle",{variant:"horizontal",slot:"more-elements"}],["rtk-plugins-toggle",{variant:"horizontal",slot:"more-elements"}],["rtk-fullscreen-toggle",{variant:"horizontal",slot:"more-elements"}],["rtk-screen-share-toggle",{variant:"horizontal",slot:"more-elements"}],["rtk-pip-toggle",{variant:"horizontal",slot:"more-elements"}],["rtk-caption-toggle",{variant:"horizontal",slot:"more-elements"}],["rtk-mute-all-button",{variant:"horizontal",slot:"more-elements"}],["rtk-breakout-rooms-toggle",{variant:"horizontal",slot:"more-elements"}],["rtk-settings-toggle",{variant:"horizontal",slot:"more-elements"}],["rtk-ai-toggle",{variant:"horizontal"}],["rtk-debugger-toggle",{variant:"horizontal"}]],"rtk-more-toggle.activeMoreMenu.md":[["rtk-chat-toggle",{variant:"horizontal",slot:"more-elements"}],["rtk-participants-toggle",{variant:"horizontal",slot:"more-elements"}],["rtk-polls-toggle",{variant:"horizontal",slot:"more-elements"}],["rtk-plugins-toggle",{variant:"horizontal",slot:"more-elements"}],["rtk-fullscreen-toggle",{variant:"horizontal",slot:"more-elements"}],["rtk-screen-share-toggle",{variant:"horizontal",slot:"more-elements"}],["rtk-pip-toggle",{variant:"horizontal",slot:"more-elements"}],["rtk-caption-toggle",{variant:"horizontal",slot:"more-elements"}],["rtk-mute-all-button",{variant:"horizontal",slot:"more-elements"}],["rtk-breakout-rooms-toggle",{variant:"horizontal",slot:"more-elements"}],["rtk-settings-toggle",{variant:"horizontal",slot:"more-elements"}],["rtk-ai-toggle",{variant:"horizontal"}],["rtk-debugger-toggle",{variant:"horizontal"}]],"div#controlbar-mobile":["rtk-mic-toggle","rtk-camera-toggle","rtk-webinar-stage-toggle","rtk-stage-toggle","rtk-leave-button","rtk-more-toggle"],"div#controlbar-left":["rtk-settings-toggle","rtk-screen-share-toggle","rtk-livestream-toggle"],"div#controlbar-center":["rtk-mic-toggle","rtk-camera-toggle","rtk-webinar-stage-toggle","rtk-stage-toggle","rtk-more-toggle","rtk-leave-button"],"div#controlbar-right":["rtk-chat-toggle","rtk-polls-toggle","rtk-participants-toggle","rtk-plugins-toggle","rtk-ai-toggle"]},config:{notification_sounds:{participant_left:!1},participant_joined_sound_notification_limit:10,participant_chat_message_sound_notification_limit:10,videoFit:"cover"}},Me=t=>!("isConnected"in t)||t.isConnected,Ie=((t,e)=>{let i;return(...r)=>{i&&clearTimeout(i),i=setTimeout((()=>{i=0,t(...r)}),e)}})((t=>{for(let e of t.keys())t.set(e,t.get(e).filter(Me))}),2e3),Oe=t=>"function"==typeof t?t():t,Ue=(t,e)=>{const i=t.indexOf(e);i>=0&&(t[i]=t[t.length-1],t.length--)},$e={about_call:"About Call",screen:"Screen",camera:"Camera",leave:"Leave",dismiss:"Dismiss",logo:"Logo",page:"Page",more:"More","page.prev":"Previous Page","page.next":"Next Page",layout:"Layout","layout.auto":"Auto Layout",settings:"Settings",file:"File",image:"Image",connection:"Connection",leave_confirmation:"Are you sure you want to leave the call?",cancel:"Cancel",yes:"Yes","(you)":"(you)",you:"You",everyone:"Everyone",to:"To",mute:"Mute",kick:"Kick",pin:"Pin",pinned:"Pinned",accept:"Accept",unpin:"Unpin",pip_on:"Show PiP",pip_off:"Hide PiP",viewers:"Viewers",join:"Join",joined:"Joined",create:"Create",close:"Close",ask:"Ask",type:"Type",activate:"Activate",requests:"Requests",mic_off:"Mic Off",disable_mic:"Disable Mic",mic_on:"Mic On",enable_mic:"Enable Mic",audio:"Audio",test:"Test",minimize:"Hide Tile",maximize:"Show Tile",mute_all:"Mute all","mute_all.description":"Everyone else in the meeting will be muted.","mute_all.header":"Are you sure?","mute_all.allow_unmute":"Allow others to unmute",video_off:"Video Off",disable_video:"Disable Video",video_on:"Video On",enable_video:"Enable Video",video:"Video",offline:"You're offline","offline.description":"Please ensure that you are connected to the internet.",disconnected:"You haven't joined the meeting.",failed:"You've been disconnected","failed.description":"We could not connect you back to the meeting room. Please try rejoining the meeting.","disconnected.description":"Please join the meeting in order to see and interact with other participants.",participants:"Participants","participants.errors.empty_results":"Couldn't find a participant with the specified name or ID.","participants.empty_list":"It looks like nobody is here.","participants.no_pending_requests":"There are no pending requests.","participants.turn_off_video":"Turn off video",polls:"Polls","polls.by":"Poll by","polls.question":"Poll Question","polls.question.placeholder":"What is your poll for?","polls.answers":"Answers","polls.option":"Add an option.","polls.option.placeholder":"Enter an option","polls.results.anon":"Anonymous","polls.results.hide":"Hide results before voting","polls.create":"Create Poll","polls.cancel":"Cancel Poll Creation","polls.empty":"No polls available","polls.errors.question_required":"Question is required.","polls.errors.empty_option":"Empty options not allowed.",screenshare:"Screen Share","screenshare.min_preview":"Minimize Preview","screenshare.max_preview":"Expand Preview","screenshare.shared":"Your screen is being shared.","screenshare.start":"Share Screen","screenshare.stop":"Stop Sharing","screenshare.error.unknown":"An error occured while starting screenshare.","screenshare.error.max_count":"Maximum screen share limit reached.",plugins:"Plugins",perm_denied:"Permission denied by browser.","perm_denied.audio":"Mic Permission denied by browser","perm_denied.video":"Camera Permission denied by browser","perm_denied.screenshare":"Screenshare Permission denied by browser","perm_denied.audio.chrome.message":"In the top navigation bar, click on the icon left to the URL and ensure 'Microphone' permission is checked","perm_denied.video.chrome.message":"In the top navigation bar, click on the icon left to the URL and ensure 'Camera' permission is checked","perm_denied.screenshare.chrome.message":"Under Chrome settings, navigate to 'Privacy and Security > Site Settings > Permissions'. Select 'Screenshare', provide permission and reload this application.","perm_denied.audio.safari.message":"Under Safari settings, navigate to 'Websites > Microphone', provide permission and reload this application.","perm_denied.video.safari.message":"Under Safari settings, navigate to 'Websites > Camera', provide permission and reload this application.","perm_denied.screenshare.safari.message":"Under Safari settings, navigate to 'Websites > Screenshare', provide permission and reload this application.","perm_denied.audio.edge.message":"Under Edge settings, navigate to 'Site Permissions > Microphone', provide permission and reload this application.","perm_denied.video.edge.message":"Under Edge settings, navigate to 'Site Permissions > Camera', provide permission and reload this application.","perm_denied.screenshare.edge.message":"Under Edge settings, navigate to 'Site Permissions > Screenshare', provide permission and reload this application.","perm_denied.audio.microsoft edge.message":"Under Edge settings, navigate to 'Site Permissions > Microphone', provide permission and reload this application.","perm_denied.video.microsoft edge.message":"Under Edge settings, navigate to 'Site Permissions > Camera', provide permission and reload this application.","perm_denied.screenshare.microsoft edge.message":"Under Edge settings, navigate to 'Site Permissions > Screenshare', provide permission and reload this application.","perm_denied.audio.firefox.message":"Under Firefox settings, navigate to 'Privacy and Security > Permissions > Microphone', provide permission and reload this application.","perm_denied.video.firefox.message":"Under Firefox settings, navigate to 'Privacy and Security > Permissions > Camera', provide permission and reload this application.","perm_denied.screenshare.firefox.message":"Under Firefox settings, navigate to 'Privacy and Security > Permissions > Screenshare', provide permission and reload this application.","perm_denied.audio.others.message":"From your browser settings, enable 'Microphone' permissions and reload this application.","perm_denied.video.others.message":"From your browser settings, enable 'Camera' permissions and reload this application.","perm_denied.screenshare.others.message":"From your browser settings, enable 'Screenshare' permissions and reload this application.",perm_sys_denied:"Permission denied by system","perm_sys_denied.audio":"Mic permission denied by system","perm_sys_denied.video":"Camera permission denied by system","perm_sys_denied.screenshare":"Screenshare permission denied by system","perm_sys_denied.audio.macos.message":"Open Apple Menu, Navigate to 'System Settings > Privacy & Security > Microphone'. Allow access to your browser and reload this application.","perm_sys_denied.video.macos.message":"Open Apple Menu, Navigate to 'System Settings > Privacy & Security > Camera'. Allow access to your browser and reload this application.","perm_sys_denied.screenshare.macos.message":"Open Apple Menu, Navigate to 'System Settings > Privacy & Security > Screenshare'. Allow access to your browser and reload this application.","perm_sys_denied.audio.ios.message":"On your iPhone, navigate to 'Settings > Privacy > Microphone', allow access to your browser and reload this application.","perm_sys_denied.video.ios.message":"On your iPhone, navigate to 'Settings > Privacy > Camera', allow access to your browser and reload this application.","perm_sys_denied.screenshare.ios.message":"On your iPhone, navigate to 'Settings > Privacy > Screenshare', allow access to your browser and reload this application.","perm_sys_denied.audio.windows.message":"Go to windows settings, select 'Settings > Privacy > Microphone'. Allow permissions to your browser and reload this application.","perm_sys_denied.video.windows.message":"Go to windows settings, select 'Settings > Privacy > Camera'. Allow permissions to your browser and reload this application.","perm_sys_denied.screenshare.windows.message":"Go to windows settings, select 'Settings > Privacy > Screenshare'. Allow permissions to your browser and reload this application.","perm_sys_denied.audio.android.message":"On you device, navigate to 'Settings > Apps'. Select your browser, allow Microphone permissions and reload this application.","perm_sys_denied.video.android.message":"On you device, navigate to 'Settings > Apps'. Select your browser, allow Camera permissions and reload this application.","perm_sys_denied.screenshare.android.message":"On you device, navigate to 'Settings > Apps'. Select your browser, allow Screenshare permissions and reload this application.","perm_sys_denied.audio.others.message":"Navigate to your system settings. Allow 'Microphone' permissions for your browser and reload this application.","perm_sys_denied.video.others.message":"Navigate to your system settings. Allow 'Camera' permissions for your browser and reload this application.","perm_sys_denied.screenshare.others.message":"Navigate to your system settings. Allow 'Screenshare' permissions for your browser and reload this application.",perm_could_not_start:"Could not capture device.","perm_could_not_start.audio":"Unable to start your Microphone","perm_could_not_start.video":"Unable to start your Camera","perm_could_not_start.screenshare":"Unable to start your Screenshare","perm_could_not_start.audio.message":"Looks like the system could not capture your microphone. Please restart your device or upgrade your browser to fix this.","perm_could_not_start.video.message":"Looks like the system could not capture your camera. Please restart your device or upgrade your browser to fix this.","perm_could_not_start.screenshare.message":"Looks like the system could not capture your screenshare. Please restart your device or upgrade your browser to fix this.",full_screen:"Full Screen","full_screen.exit":"Exit Full Screen","waitlist.header_title":"Waiting","waitlist.body_text":"You are in the waiting room, the host will let you in soon.","waitlist.deny_request":"Deny request","waitlist.accept_request":"Accept request","waitlist.accept_all":"Accept all","stage_request.header_title":"Join Stage Requests","stage_request.deny_request":"Deny request","stage_request.accept_request":"Accept request","stage_request.accept_all":"Accept all","stage_request.deny_all":"Deny all","stage_request.approval_pending":"Pending","stage_request.denied":"Denied","stage_request.request":"Join stage","stage_request.requested":"Requested","stage_request.cancel_request":"Cancel request","stage_request.leave_stage":"Leave stage","stage_request.request_tip":"Request to join the discussion","stage_request.leave_tip":"Leave the stage","stage_request.pending_tip":"Request pending","stage_request.denied_tip":"Rejected request","stage.empty_host":"The stage is empty","stage.empty_host_summary":"You are off stage. You can manage stage request from the participants tab.","stage.empty_viewer":"There is no one on stage","stage.remove_from_stage":"Remove from stage","stage.invited_notification":"has been invited to join stage.","stage.add_to_stage":"Invite to stage","stage.join_title":"Join Stage","stage.join_summary":"You are about to join the stage, your video & audio as shown above will be visible to all participants.","stage.join_cancel":"Cancel","stage.join_confirm":"Join","setup_screen.join_in_as":"Joining as","setup_screen.your_name":"Your name","stage.reconnecting":"Reconnecting...","recording.label":"REC","recording.indicator":"This meeting is being recorded.","recording.started":"This meeting is being recorded.","recording.stopped":"Recording for this meeting has been stopped.","recording.paused":"Recording for this meeting has been paused.","recording.error.start":"Error while starting recording.","recording.error.stop":"Error while stopping recording","recording.error.resume":"Error while resuming recording","recording.start":"Start Recording","recording.stop":"Stop Recording","recording.resume":"Resume Recording","recording.starting":"Starting","recording.stopping":"Stopping","recording.loading":"Loading","recording.idle":"Record",audio_playback:"Play Audio","audio_playback.title":"Allow Audio Playback","audio_playback.description":"In order to play audio properly on your device, click the button below.",breakout_rooms:"Breakout Rooms","breakout_rooms.room_config_header":"Create Breakout","breakout_rooms.join_breakout_header":"Join Breakout","breakout_rooms.empty":"Nobody here yet.","breakout_rooms.delete":"Delete Room","breakout_rooms.switch":"Switch","breakout_rooms.main_room":"Main Room","breakout_rooms.shuffle_participants":"Shuffle Participants","breakout_rooms.deselect":"Deselect","breakout_rooms.selected":"selected","breakout_rooms.num_of_rooms":"No. of Rooms","breakout_rooms.approx":"Approx.","breakout_rooms.participants_per_room":"participants/room","breakout_rooms.division_text":"when equally divided.","breakout_rooms.start_breakout":"Start Breakout","breakout_rooms.close_breakout":"Close Breakout","breakout_rooms.update_breakout":"Update Breakout","breakout_rooms.discard_changes":"Discard Changes","breakout_rooms.room":"Room","breakout_rooms.rooms":"Rooms","breakout_rooms.room_name":"Room Name","breakout_rooms.edit_room_name":"Edit Room Name","breakout_rooms.save_room_name":"Save Room Name","breakout_rooms.add_room":"Add","breakout_rooms.add_room_brief":"Add Room","breakout_rooms.select_all":"Select all","breakout_rooms.unassign_all":"Unassign all","breakout_rooms.assign":"Assign","breakout_rooms.assign_participants":"Assign Participants","breakout_rooms.none_assigned":"No participants assigned yet","breakout_rooms.drag_drop_participants":"Drag and drop participants","breakout_rooms.click_drop_participants":"Click here to assign","breakout_rooms.status.assign_multiple":"Assign multiple participants at once by clicking and selecting them","breakout_rooms.status.select_room":"Select a room to assign","breakout_rooms.ephemeral_status.participants_assigned":"Participants assigned","breakout_rooms.ephemeral_status.participants_assigned_randomly":"Participants assigned randomly","breakout_rooms.ephemeral_status.changes_discarded":"Changes discarded","breakout_rooms.confirm_modal.start_breakout.header":"Start breakout rooms?","breakout_rooms.confirm_modal.start_breakout.content":"Once started, all participants will be moved to their assigned rooms.","breakout_rooms.confirm_modal.start_breakout.cancelText":"No, go back","breakout_rooms.confirm_modal.start_breakout.ctaText":"Yes, start","breakout_rooms.confirm_modal.close_breakout.header":"Close breakout rooms?","breakout_rooms.confirm_modal.close_breakout.content":"All breakout rooms will be closed & participants will be moved back to the main room.","breakout_rooms.confirm_modal.close_breakout.ctaText":"Yes, close breakout","breakout_rooms.move_reason.started_msg":"Starting breakout rooms...","breakout_rooms.move_reason.started_desc":"You are being moved to your assigned room","breakout_rooms.move_reason.closed_msg":"Closing Breakout rooms...","breakout_rooms.move_reason.closed_desc":"You are being moved back to the main room","breakout_rooms.move_reason.switch_room":"Joining Breakout Room...","breakout_rooms.move_reason.switch_main_room":"Joining Main Room...","breakout_rooms.all_assigned":"All participants have been assigned","breakout_rooms.empty_main_room":"No more participants in the main room.","breakout_rooms.leave_confirmation":"Are you sure you want to leave the call? You are in a breakout room, you can join the main room too.","breakout_rooms.leave_confirmation.main_room_btn":"Go back to main room",ai:"AI","ai.meeting_ai":"MeetingAI","ai.home":"Home","ai.transcriptions":"Transcriptions","ai.personal":"Personal","ai.caption_view":"Caption View","ai.chat.tooltip":"This conversation will just be visible to you and not to others in the call.","ai.chat.summerise":"Hey AI, summarise this call","ai.chat.agenda":"Hey AI, what is today's agenda?",search:"Search","search.could_not_find":"Couldn't find a participant with the specified name or ID.","search.empty":"It looks like nobody is here.",end:"End Meeting","end.all":"End meeting for all",ended:"The meeting ended.","ended.rejected":"Your request to join the meeting was denied.","ended.left":"You left the meeting.","ended.kicked":"You were removed from the meeting.","ended.disconnected":"The call ended because the connection was lost.","ended.network":"Please check your internet connection and try again.","ended.unauthorized":"You are not authorized to join this meeting.",network:"Network","network.reconnecting":"Connection lost. Trying to reconnect.","network.delay_extended":"Taking too long to reconnect. Please check your network connection.","network.disconnected":"Could not reconnect. Please leave the meeting and try refreshing the window.","network.leaving":"Automatically leaving the meeting in 10 seconds.","network.restored":"Connection restored","network.delay":"Taking too long to reconnect.","network.lost":"Connection lost","network.lost_extended":"Connection lost. Please check your network connection.",livestream:"Livestream","livestream.indicator":"This meeting is being livestreamed.","livestream.skip":"Skip to Live","livestream.idle":"Waiting to go live.","livestream.starting":"Livestream is starting...","livestream.stopping":"Livestream is stopping...","livestream.waiting_on_manual_ingestion":"Please ingest livestream media.","livestream.error.not_supported":"Player not supported.","livestream.error.not_found":"Playback URL not found.","livestream.error.unknown":"An unknown error occured.","livestream.error.sync":"Could not sync livestream please try again later.","livestream.error.start":"Error while starting livestream.","livestream.error.stop":"Error while stopping livestream.","livestream.go_live":"Go Live","livestream.end_live":"End Live","livestream.error":"Error","cta.help":"Need help on how to do this?","cta.continue":"Ignore","cta.reload":"Reload","cta.confirmation":"Are you sure?","cta.system_settings":"Open Settings","remote_access.empty":"There are no remote requests, yet.","remote_access.requests":"The following people have requested remote control to your screen share.","remote_access.allow":"Please select whom you want to give access to.","remote_access.grant":"Grant acess","remote_access.indicator":"Any plugin or screenshare you switch to will sync the change across the meeting",chat:"Chat","chat.new":"New","chat.max_limit_warning":"Max Character Limit","chat.rate_limit_error":"Please wait before you can send another message","chat.new_channel":"Create new channel","chat.channel_name":"Enter channel name","chat.member_name":"Enter member name","chat.add_members":"Add members","chat.delete_msg":"Delete","chat.edit_msg":"Edit","chat.send_msg":"Send message","chat.send_attachment":"Drop files/images to send","chat.send_img":"Send an image","chat.send_file":"Send a file","chat.send_emoji":"Send an emoji","chat.update_msg":"Update message","chat.channel_members":"Channel Members","chat.img.loading":"Loading image","chat.error.img_not_found":"Image not found","chat.error.empty_results":"Couldn't find a member with the specified name.","chat.img.shared_by":"Shared by","chat.reply":"Reply","chat.message_placeholder":"Message..","chat.click_to_send":"Click to send as message","chat.search_msgs":"Search messages","chat.search_conversations":"Search conversations","chat.start_conversation":"Start a conversation..","chat.empty_search":"No messages found","chat.empty_channel":"Send a message to get started","chat.cancel_upload":"Cancel upload","chat.view_chats":"View chats","chat.everyone":"everyone","chat.pinned_msgs":"Pinned messages","chat.toggle_pinned_msgs":"Toggle pinned messages","date.today":"Today","date.yesteday":"Yesterday","date.sunday":"Sunday","date.monday":"Monday","date.tuesday":"Tuesday","date.wednesday":"Wednesday","date.thursday":"Thursday","date.friday":"Friday","date.saturday":"Saturday","list.empty":"No items found","grid.listening":"Listening","transcript.off":"Turn off Transcripts","transcript.on":"Turn on Transcripts","settings.notification_sound":"Notification sound","settings.microphone_input":"Microphone","settings.speaker_output":"Speaker","settings.mirror_video":"Mirror my Video","settings.camera_off":"Camera is off","dialog.close":"Close dialog","notifications.joined":"just joined","notifications.left":"left","notifications.requesting_to_join_meeting":"is requesting to join the meeting","notifications.requested_to_join_stage":"has requested to join stage","notifications.joined_stage":"has joined stage","notifications.request_to_join_accepted":"Request to join accepted","notifications.request_to_join_rejected":"Request to join rejected","notifications.accept":"Accept","notifications.new_poll_created_by":"New poll created by","notifications.connected_to":"Connected to","notifications.plugin_switched_to":"Plugin switched to","notifications.remote_control_requested":"has requested for remote control","notifications.remote_control_request_sent":"Sent remote control request to","notifications.remote_control_request_accepted":"has granted remote control","notifications.remote_control_granted":"Granted remote control to","notifications.remote_control_terminated":"Existing remote control has been terminated","debugger.troubleshooting.label":"Troubleshooting","debugger.quality.good":"Good","debugger.quality.average":"Average","debugger.quality.poor":"Poor","debugger.stats.bitrate.label":"Bitrate","debugger.stats.bitrate.description":"Data transmitted per second, affects quality and file size.","debugger.stats.packet_loss.label":"Packet Loss","debugger.stats.packet_loss.description":"Amount of data lost during transfer","debugger.stats.jitter.label":"Jitter","debugger.stats.jitter.description":"Variance or fluctuation in latency","debugger.stats.cpu_limitations.label":"CPU Limitations","debugger.stats.cpu_limitations.description":"CPU limitations can impact WebRTC call quality and performance.","debugger.stats.bandwidth_limitations.label":"Bandwidth Limitations","debugger.stats.bandwidth_limitations.description":"Slow internet speeds can degrade video quality.","debugger.audio.label":"Audio","debugger.audio.troubleshooting.label":"Audio Troubleshooting","debugger.audio.messages.generating_report":"Generating report. Please wait for a few seconds.","debugger.audio.messages.enable_media":"Please enable mic to see the report.","debugger.audio.sections.network_media":"Network & Media","debugger.video.label":"Video","debugger.video.troubleshooting.label":"Video Troubleshooting","debugger.video.messages.generating_report":"Generating report. Please wait for a few seconds.","debugger.video.messages.enable_media":"Please enable camera to see the report.","debugger.video.sections.network_media":"Network & Media","debugger.screenshare.label":"Screenshare","debugger.screenshare.troubleshooting.label":"Screenshare Troubleshooting","debugger.screenshare.sections.network_media":"Network & Media","debugger.screenshare.messages.generating_report":"Generating report. Please wait for a few seconds.","debugger.screenshare.messages.enable_media":"Please share screen to see the report.","debugger.system.label":"System","debugger.system.troubleshooting.label":"System Troubleshooting","debugger.system.sections.battery":"Battery","debugger.system.battery.level.label":"Battery Level","debugger.system.battery.level.description":"A low battery charge may result in reduced performance.","debugger.system.battery.charging.label":"Battery Charging Status","debugger.system.battery.charging.description":"A device running on power performs optimally.","debugger.system.battery.charging.is_charging":"Charging","debugger.system.battery.charging.is_not_charging":"Not charging"},Fe=(t=$e)=>{let e=$e;return(t!==$e||Object.keys(t).length>0)&&(e=Object.assign({},$e,t)),t=>{var i;return null!==(i=e[t])&&void 0!==i?i:t}},je={people:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M4 13.999 13 14a2 2 0 0 1 1.995 1.85L15 16v1.5C14.999 21 11.284 22 8.5 22c-2.722 0-6.335-.956-6.495-4.27L2 17.5v-1.501c0-1.054.816-1.918 1.85-1.995L4 14ZM15.22 14H20c1.054 0 1.918.816 1.994 1.85L22 16v1c-.001 3.062-2.858 4-5 4a7.16 7.16 0 0 1-2.14-.322c.336-.386.607-.827.802-1.327A6.19 6.19 0 0 0 17 19.5l.267-.006c.985-.043 3.086-.363 3.226-2.289L20.5 17v-1a.501.501 0 0 0-.41-.492L20 15.5h-4.051a2.957 2.957 0 0 0-.595-1.34L15.22 14H20h-4.78ZM4 15.499l-.1.01a.51.51 0 0 0-.254.136.506.506 0 0 0-.136.253l-.01.101V17.5c0 1.009.45 1.722 1.417 2.242.826.445 2.003.714 3.266.753l.317.005.317-.005c1.263-.039 2.439-.308 3.266-.753.906-.488 1.359-1.145 1.412-2.057l.005-.186V16a.501.501 0 0 0-.41-.492L13 15.5l-9-.001ZM8.5 3a4.5 4.5 0 1 1 0 9 4.5 4.5 0 0 1 0-9Zm9 2a3.5 3.5 0 1 1 0 7 3.5 3.5 0 0 1 0-7Zm-9-.5c-1.654 0-3 1.346-3 3s1.346 3 3 3 3-1.346 3-3-1.346-3-3-3Zm9 2c-1.103 0-2 .897-2 2s.897 2 2 2 2-.897 2-2-.897-2-2-2Z" fill="currentColor"/></svg>',people_checked:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 29 29"><path fill="currentColor" d="M14.58 15.333H2.833a2.667 2.667 0 0 0-2.666 2.666v2l.006.307c.214 4.419 5.031 5.693 8.66 5.693 1.374 0 2.92-.182 4.32-.649a8.53 8.53 0 0 1-.717-1.87c-.93.298-2.027.478-3.18.513l-.423.006-.422-.006c-1.684-.052-3.254-.411-4.355-1.004-1.29-.694-1.89-1.644-1.89-2.99v-2.001l.014-.135a.675.675 0 0 1 .181-.337.68.68 0 0 1 .338-.181l.134-.014h10.31a8.71 8.71 0 0 1 1.436-1.998h.001Zm.253-8.667a6 6 0 1 0-12 0 6 6 0 0 0 12 0Zm-10 0c0-2.205 1.795-4 4-4 2.206 0 4 1.795 4 4s-1.794 4-4 4c-2.205 0-4-1.795-4-4ZM25.5 7.999a4.667 4.667 0 1 0-9.333 0A4.667 4.667 0 0 0 25.5 8Zm-7.333 0a2.67 2.67 0 0 1 2.666-2.666A2.67 2.67 0 0 1 23.5 7.999a2.67 2.67 0 0 1-2.667 2.667 2.67 2.67 0 0 1-2.666-2.667Zm10 13.334a7.333 7.333 0 1 1-14.667 0 7.333 7.333 0 0 1 14.667 0Zm-2.862-3.139a.666.666 0 0 0-.944 0l-4.86 4.863-2.196-2.196a.667.667 0 1 0-.944.944l2.667 2.666a.666.666 0 0 0 .944 0l5.333-5.333a.666.666 0 0 0 0-.944Z"/></svg>',chat:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 2c5.523 0 10 4.477 10 10s-4.477 10-10 10a9.96 9.96 0 0 1-4.587-1.112l-3.826 1.067a1.25 1.25 0 0 1-1.54-1.54l1.068-3.823A9.96 9.96 0 0 1 2 12C2 6.477 6.477 2 12 2Zm0 1.5A8.5 8.5 0 0 0 3.5 12c0 1.47.373 2.883 1.073 4.137l.15.27-1.112 3.984 3.987-1.112.27.15A8.5 8.5 0 1 0 12 3.5ZM8.75 13h4.498a.75.75 0 0 1 .102 1.493l-.102.007H8.75a.75.75 0 0 1-.102-1.493L8.75 13h4.498H8.75Zm0-3.5h6.505a.75.75 0 0 1 .101 1.493l-.101.007H8.75a.75.75 0 0 1-.102-1.493L8.75 9.5h6.505H8.75Z" fill="currentColor"/></svg>',poll:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M11.752 2a2.752 2.752 0 0 1 2.752 2.751V19.25a2.752 2.752 0 1 1-5.504 0V4.75A2.752 2.752 0 0 1 11.752 2Zm7 5a2.752 2.752 0 0 1 2.752 2.751v9.499a2.752 2.752 0 1 1-5.504 0V9.75A2.752 2.752 0 0 1 18.752 7Zm-14 5a2.752 2.752 0 0 1 2.752 2.751v4.499a2.752 2.752 0 0 1-5.504 0V14.75A2.752 2.752 0 0 1 4.752 12Zm7-8.5c-.692 0-1.252.56-1.252 1.251V19.25a1.252 1.252 0 0 0 2.504 0V4.75c0-.691-.56-1.251-1.252-1.251Zm7 5c-.691 0-1.252.56-1.252 1.251v9.499a1.252 1.252 0 0 0 2.504 0V9.75c0-.691-.56-1.251-1.252-1.251Zm-14 5c-.692 0-1.252.56-1.252 1.251v4.499a1.252 1.252 0 1 0 2.504 0V14.75c0-.691-.56-1.252-1.252-1.252Z" fill="currentColor"/></svg>',participants:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M14.754 10c.966 0 1.75.784 1.75 1.75v4.749a4.501 4.501 0 0 1-9.002 0V11.75c0-.966.783-1.75 1.75-1.75h5.502Zm0 1.5H9.252a.25.25 0 0 0-.25.25v4.749a3.001 3.001 0 0 0 6.002 0V11.75a.25.25 0 0 0-.25-.25ZM3.75 10h3.381a2.738 2.738 0 0 0-.618 1.5H3.75a.25.25 0 0 0-.25.25v3.249a2.501 2.501 0 0 0 3.082 2.433c.085.504.24.985.453 1.432A4.001 4.001 0 0 1 2 14.999V11.75c0-.966.784-1.75 1.75-1.75Zm13.125 0h3.375c.966 0 1.75.784 1.75 1.75V15a4 4 0 0 1-5.03 3.866c.214-.448.369-.929.455-1.433A2.5 2.5 0 0 0 20.5 15v-3.25a.25.25 0 0 0-.25-.25h-2.757a2.738 2.738 0 0 0-.618-1.5ZM12 3a3 3 0 1 1 0 6 3 3 0 0 1 0-6Zm6.5 1a2.5 2.5 0 1 1 0 5 2.5 2.5 0 0 1 0-5Zm-13 0a2.5 2.5 0 1 1 0 5 2.5 2.5 0 0 1 0-5Zm6.5.5a1.5 1.5 0 1 0 0 3 1.5 1.5 0 0 0 0-3Zm6.5 1a1 1 0 1 0 0 2 1 1 0 0 0 0-2Zm-13 0a1 1 0 1 0 0 2 1 1 0 0 0 0-2Z" fill="currentColor"/></svg>',rocket:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 48 48"><path d="M9.35 20.45 14.65 22.7Q15.55 20.9 16.575 19.15Q17.6 17.4 18.75 15.8L14.8 15Q14.8 15 14.8 15Q14.8 15 14.8 15ZM17.05 24.5 23.7 31.15Q26.55 29.85 29.05 28.2Q31.55 26.55 33.1 25Q37.15 20.95 39.05 16.7Q40.95 12.45 41.1 7.1Q35.75 7.25 31.5 9.15Q27.25 11.05 23.2 15.1Q21.65 16.65 20 19.15Q18.35 21.65 17.05 24.5ZM28.5 19.7Q27.5 18.7 27.5 17.225Q27.5 15.75 28.5 14.75Q29.5 13.75 30.975 13.75Q32.45 13.75 33.45 14.75Q34.45 15.75 34.45 17.225Q34.45 18.7 33.45 19.7Q32.45 20.7 30.975 20.7Q29.5 20.7 28.5 19.7ZM27.75 38.85 33.2 33.4Q33.2 33.4 33.2 33.4Q33.2 33.4 33.2 33.4L32.4 29.45Q30.8 30.6 29.05 31.625Q27.3 32.65 25.5 33.55ZM44.05 4.15Q44.5 10.95 42.35 16.55Q40.2 22.15 35.25 27.1Q35.2 27.15 35.15 27.2Q35.1 27.25 35.05 27.3L36.15 32.8Q36.3 33.55 36.075 34.25Q35.85 34.95 35.3 35.5L26.75 44.1L22.5 34.2L14 25.7L4.1 21.45L12.7 12.9Q13.25 12.35 13.95 12.125Q14.65 11.9 15.4 12.05L20.9 13.15Q20.95 13.1 21 13.075Q21.05 13.05 21.1 13Q26.05 8.05 31.65 5.875Q37.25 3.7 44.05 4.15ZM7.45 31.75Q9.2 30 11.725 29.975Q14.25 29.95 16 31.7Q17.75 33.45 17.725 35.975Q17.7 38.5 15.95 40.25Q14.65 41.55 11.925 42.4Q9.2 43.25 3.75 44Q4.5 38.55 5.325 35.8Q6.15 33.05 7.45 31.75ZM9.55 33.9Q8.85 34.65 8.3 36.25Q7.75 37.85 7.35 40.35Q9.85 39.95 11.45 39.4Q13.05 38.85 13.8 38.15Q14.75 37.3 14.775 36.025Q14.8 34.75 13.9 33.8Q12.95 32.9 11.675 32.925Q10.4 32.95 9.55 33.9Z" fill="currentColor" /></svg>',call_end:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="m21.903 13.202-.191.816a2.75 2.75 0 0 1-2.955 2.107l-1.755-.178A2.75 2.75 0 0 1 14.6 13.83l-.389-1.686a.25.25 0 0 0-.113-.157c-.321-.197-1.034-.32-2.098-.32-.786 0-1.386.067-1.786.189-.14.043-.238.085-.301.116l-.09.048-.015.04-.409 1.77A2.75 2.75 0 0 1 7 15.948l-1.746.177A2.75 2.75 0 0 1 2.3 14.03l-.196-.817a3.75 3.75 0 0 1 1.13-3.651C5.134 7.839 8.064 7 12 7c3.943 0 6.875.842 8.776 2.57a3.75 3.75 0 0 1 1.172 3.41l-.045.222Zm-1.426-.514a2.25 2.25 0 0 0-.71-2.009C18.184 9.241 15.602 8.5 12 8.5c-3.598 0-6.177.739-7.76 2.172a2.25 2.25 0 0 0-.677 2.19l.196.818a1.25 1.25 0 0 0 1.342.953l1.746-.178a1.25 1.25 0 0 0 1.09-.962l.423-1.82.043-.136c.376-.998 1.591-1.37 3.597-1.37 1.318 0 2.265.164 2.88.54.401.245.687.642.793 1.1l.389 1.685c.12.522.56.909 1.092.963l1.754.178a1.25 1.25 0 0 0 1.343-.958l.192-.816.034-.171Z" fill="currentColor"/></svg>',share:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M17 2.498a3.502 3.502 0 1 1-2.597 5.851l-4.558 2.604a3.5 3.5 0 0 1 0 2.093l4.557 2.606a3.502 3.502 0 1 1-.745 1.302L9.1 14.347a3.502 3.502 0 1 1 0-4.698l4.557-2.604A3.502 3.502 0 0 1 17 2.498Zm0 13.5a2.002 2.002 0 1 0 0 4.004 2.002 2.002 0 0 0 0-4.004Zm-10.498-6a2.002 2.002 0 1 0 0 4.004 2.002 2.002 0 0 0 0-4.004Zm10.498-6a2.002 2.002 0 1 0 0 4.004 2.002 2.002 0 0 0 0-4.004Z" fill="currentColor"/></svg>',mic_on:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M18.25 11a.75.75 0 0 1 .743.648l.007.102v.5a6.75 6.75 0 0 1-6.249 6.732l-.001 2.268a.75.75 0 0 1-1.493.102l-.007-.102v-2.268a6.75 6.75 0 0 1-6.246-6.496L5 12.25v-.5a.75.75 0 0 1 1.493-.102l.007.102v.5a5.25 5.25 0 0 0 5.034 5.246l.216.004h.5a5.25 5.25 0 0 0 5.246-5.034l.004-.216v-.5a.75.75 0 0 1 .75-.75ZM12 2a4 4 0 0 1 4 4v6a4 4 0 0 1-8 0V6a4 4 0 0 1 4-4Zm0 1.5A2.5 2.5 0 0 0 9.5 6v6a2.5 2.5 0 0 0 5 0V6A2.5 2.5 0 0 0 12 3.5Z" fill="currentColor"/></svg>',mic_off:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M3.28 2.22a.75.75 0 1 0-1.06 1.06L8 9.06V12a4 4 0 0 0 6.248 3.309l1.146 1.146A5.227 5.227 0 0 1 12.25 17.5h-.5l-.216-.004A5.25 5.25 0 0 1 6.5 12.25v-.5l-.007-.102A.75.75 0 0 0 5 11.75v.5l.004.236a6.75 6.75 0 0 0 6.246 6.496v2.268l.007.102a.75.75 0 0 0 1.493-.102l.001-2.268a6.718 6.718 0 0 0 3.712-1.458l4.256 4.256a.75.75 0 0 0 1.061-1.06L3.28 2.22Zm9.876 11.997A2.5 2.5 0 0 1 9.5 12v-1.44l3.656 3.657ZM14.5 6v5.318l1.43 1.43c.046-.242.07-.492.07-.748V6a4 4 0 0 0-7.862-1.044L9.5 6.318V6a2.5 2.5 0 0 1 5 0ZM17.196 14.014l1.146 1.146A6.725 6.725 0 0 0 19 12.25v-.5l-.007-.102a.75.75 0 0 0-1.493.102v.5l-.004.216a5.233 5.233 0 0 1-.3 1.548Z" fill="currentColor"/></svg>',video_on:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M13.75 4.5A3.25 3.25 0 0 1 17 7.75v.173l3.864-2.318A.75.75 0 0 1 22 6.248V17.75a.75.75 0 0 1-1.136.643L17 16.075v.175a3.25 3.25 0 0 1-3.25 3.25h-8.5A3.25 3.25 0 0 1 2 16.25v-8.5A3.25 3.25 0 0 1 5.25 4.5h8.5Zm0 1.5h-8.5A1.75 1.75 0 0 0 3.5 7.75v8.5c0 .966.784 1.75 1.75 1.75h8.5a1.75 1.75 0 0 0 1.75-1.75v-8.5A1.75 1.75 0 0 0 13.75 6Zm6.75 1.573L17 9.674v4.651l3.5 2.1V7.573Z" fill="currentColor"/></svg>',video_off:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M3.28 2.22a.75.75 0 1 0-1.06 1.06l1.567 1.567A3.25 3.25 0 0 0 2 7.75v8.5a3.25 3.25 0 0 0 3.25 3.25h8.5a3.25 3.25 0 0 0 2.903-1.786l4.066 4.067a.75.75 0 0 0 1.061-1.061L3.28 2.22Zm12.196 14.317A1.75 1.75 0 0 1 13.75 18h-8.5a1.75 1.75 0 0 1-1.75-1.75v-8.5c0-.869.633-1.59 1.463-1.727l10.514 10.514ZM15.5 12.318V7.75A1.75 1.75 0 0 0 13.75 6H9.182l-1.5-1.5h6.068A3.25 3.25 0 0 1 17 7.75v.173l3.864-2.318A.75.75 0 0 1 22 6.248V17.75c0 .301-.17.543-.403.665L20.5 17.318V7.573L17 9.674v4.144l-1.5-1.5Z" fill="currentColor"/></svg>',share_screen_start:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M2 6.25A2.25 2.25 0 0 1 4.25 4h15.5A2.25 2.25 0 0 1 22 6.25v11.5A2.25 2.25 0 0 1 19.75 20H4.25A2.25 2.25 0 0 1 2 17.75V6.25Zm2.25-.75a.75.75 0 0 0-.75.75v11.5c0 .414.336.75.75.75h15.5a.75.75 0 0 0 .75-.75V6.25a.75.75 0 0 0-.75-.75H4.25Z"/><path d="M12 7.245a.75.75 0 0 1 .53.22l3.255 3.255a.75.75 0 1 1-1.06 1.06L12.75 9.806v6.447a.75.75 0 0 1-1.5 0V9.808L9.28 11.78a.75.75 0 1 1-1.06-1.06l3.25-3.254a.75.75 0 0 1 .53-.22Z"/></svg>',share_screen_stop:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M2 6.25A2.25 2.25 0 0 1 4.25 4h15.5A2.25 2.25 0 0 1 22 6.25v11.5A2.25 2.25 0 0 1 19.75 20H4.25A2.25 2.25 0 0 1 2 17.75V6.25Zm2.25-.75a.75.75 0 0 0-.75.75v11.5c0 .414.336.75.75.75h15.5a.75.75 0 0 0 .75-.75V6.25a.75.75 0 0 0-.75-.75H4.25Z"/><path d="M8.22 8.215a.75.75 0 0 1 1.06 0l2.72 2.72 2.725-2.716a.75.75 0 0 1 1.06 1.062l-2.724 2.715 2.724 2.724a.75.75 0 1 1-1.06 1.06L12 13.057 9.28 15.78a.75.75 0 0 1-1.06-1.06l2.72-2.724-2.72-2.72a.75.75 0 0 1 0-1.06Z"/></svg>',share_screen_person:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M2 7.25A3.25 3.25 0 0 1 5.25 4h13.5A3.25 3.25 0 0 1 22 7.25V13h-.258a3.74 3.74 0 0 0-1.242-2.545V7.25a1.75 1.75 0 0 0-1.75-1.75H5.25A1.75 1.75 0 0 0 3.5 7.25v9.5c0 .966.784 1.75 1.75 1.75H12v.5c0 .34.04.674.118 1H5.25A3.25 3.25 0 0 1 2 16.75v-9.5ZM21.5 17a1.5 1.5 0 0 1 1.5 1.5v.5c0 1.971-1.86 4-5 4-3.14 0-5-2.029-5-4v-.5a1.5 1.5 0 0 1 1.5-1.5h7ZM18 10.5a2.75 2.75 0 1 1 0 5.5 2.75 2.75 0 0 1 0-5.5Z" fill="currentColor"/></svg>',clock:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 2c5.523 0 10 4.478 10 10s-4.477 10-10 10S2 17.522 2 12 6.477 2 12 2Zm0 1.667c-4.595 0-8.333 3.738-8.333 8.333 0 4.595 3.738 8.333 8.333 8.333 4.595 0 8.333-3.738 8.333-8.333 0-4.595-3.738-8.333-8.333-8.333ZM11.25 6a.75.75 0 0 1 .743.648L12 6.75V12h3.25a.75.75 0 0 1 .102 1.493l-.102.007h-4a.75.75 0 0 1-.743-.648l-.007-.102v-6a.75.75 0 0 1 .75-.75Z" fill="currentColor"/></svg>',dismiss:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="m4.397 4.554.073-.084a.75.75 0 0 1 .976-.073l.084.073L12 10.939l6.47-6.47a.75.75 0 1 1 1.06 1.061L13.061 12l6.47 6.47a.75.75 0 0 1 .072.976l-.073.084a.75.75 0 0 1-.976.073l-.084-.073L12 13.061l-6.47 6.47a.75.75 0 0 1-1.06-1.061L10.939 12l-6.47-6.47a.75.75 0 0 1-.072-.976l.073-.084-.073.084Z" fill="currentColor"/></svg>',send:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M5.694 12 2.299 3.272c-.236-.607.356-1.188.942-.982l.093.04 18 9a.75.75 0 0 1 .097 1.283l-.097.058-18 9a.75.75 0 0 1-1.065-.847l.03-.096L5.694 12 2.299 3.272 5.694 12ZM4.402 4.54l2.61 6.71h6.627a.75.75 0 0 1 .743.648l.007.102a.75.75 0 0 1-.649.743l-.101.007H7.01l-2.609 6.71L19.322 12 4.401 4.54Z" fill="currentColor"/></svg>',search:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M10 2.75a7.25 7.25 0 0 1 5.63 11.819l4.9 4.9a.75.75 0 0 1-.976 1.134l-.084-.073-4.901-4.9A7.25 7.25 0 1 1 10 2.75Zm0 1.5a5.75 5.75 0 1 0 0 11.5 5.75 5.75 0 0 0 0-11.5Z" fill="currentColor"/</svg>',more_vertical:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 7.75a1.75 1.75 0 1 1 0-3.5 1.75 1.75 0 0 1 0 3.5ZM12 13.75a1.75 1.75 0 1 1 0-3.5 1.75 1.75 0 0 1 0 3.5ZM10.25 18a1.75 1.75 0 1 0 3.5 0 1.75 1.75 0 0 0-3.5 0Z" fill="currentColor"/></svg>',chevron_down:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M4.22 8.47a.75.75 0 0 1 1.06 0L12 15.19l6.72-6.72a.75.75 0 1 1 1.06 1.06l-7.25 7.25a.75.75 0 0 1-1.06 0L4.22 9.53a.75.75 0 0 1 0-1.06Z" fill="currentColor"/></svg>',chevron_up:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M4.22 15.53a.75.75 0 0 0 1.06 0L12 8.81l6.72 6.72a.75.75 0 1 0 1.06-1.06l-7.25-7.25a.75.75 0 0 0-1.06 0l-7.25 7.25a.75.75 0 0 0 0 1.06Z" fill="currentColor"/></svg>',chevron_left:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M15.53 4.22a.75.75 0 0 1 0 1.06L8.81 12l6.72 6.72a.75.75 0 1 1-1.06 1.06l-7.25-7.25a.75.75 0 0 1 0-1.06l7.25-7.25a.75.75 0 0 1 1.06 0Z" fill="currentColor"/></svg>',chevron_right:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M8.47 4.22a.75.75 0 0 0 0 1.06L15.19 12l-6.72 6.72a.75.75 0 1 0 1.06 1.06l7.25-7.25a.75.75 0 0 0 0-1.06L9.53 4.22a.75.75 0 0 0-1.06 0Z" fill="currentColor"/></svg>',settings:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12.012 2.25c.734.008 1.465.093 2.182.253a.75.75 0 0 1 .582.649l.17 1.527a1.384 1.384 0 0 0 1.927 1.116l1.401-.615a.75.75 0 0 1 .85.174 9.792 9.792 0 0 1 2.204 3.792.75.75 0 0 1-.271.825l-1.242.916a1.381 1.381 0 0 0 0 2.226l1.243.915a.75.75 0 0 1 .272.826 9.797 9.797 0 0 1-2.204 3.792.75.75 0 0 1-.848.175l-1.407-.617a1.38 1.38 0 0 0-1.926 1.114l-.169 1.526a.75.75 0 0 1-.572.647 9.518 9.518 0 0 1-4.406 0 .75.75 0 0 1-.572-.647l-.168-1.524a1.382 1.382 0 0 0-1.926-1.11l-1.406.616a.75.75 0 0 1-.849-.175 9.798 9.798 0 0 1-2.204-3.796.75.75 0 0 1 .272-.826l1.243-.916a1.38 1.38 0 0 0 0-2.226l-1.243-.914a.75.75 0 0 1-.271-.826 9.793 9.793 0 0 1 2.204-3.792.75.75 0 0 1 .85-.174l1.4.615a1.387 1.387 0 0 0 1.93-1.118l.17-1.526a.75.75 0 0 1 .583-.65c.717-.159 1.45-.243 2.201-.252Zm0 1.5a9.135 9.135 0 0 0-1.354.117l-.109.977A2.886 2.886 0 0 1 6.525 7.17l-.898-.394a8.293 8.293 0 0 0-1.348 2.317l.798.587a2.881 2.881 0 0 1 0 4.643l-.799.588c.32.842.776 1.626 1.348 2.322l.905-.397a2.882 2.882 0 0 1 4.017 2.318l.11.984c.889.15 1.798.15 2.687 0l.11-.984a2.881 2.881 0 0 1 4.018-2.322l.905.396a8.296 8.296 0 0 0 1.347-2.318l-.798-.588a2.881 2.881 0 0 1 0-4.643l.796-.587a8.293 8.293 0 0 0-1.348-2.317l-.896.393a2.884 2.884 0 0 1-4.023-2.324l-.11-.976a8.988 8.988 0 0 0-1.333-.117ZM12 8.25a3.75 3.75 0 1 1 0 7.5 3.75 3.75 0 0 1 0-7.5Zm0 1.5a2.25 2.25 0 1 0 0 4.5 2.25 2.25 0 0 0 0-4.5Z" fill="currentColor"/></svg>',wifi:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M17.745 10.75a8.291 8.291 0 0 1 1.492 2.07.75.75 0 1 1-1.335.683 6.798 6.798 0 0 0-1.218-1.692 6.562 6.562 0 0 0-10.493 1.673.75.75 0 1 1-1.339-.677 8.062 8.062 0 0 1 12.893-2.057Zm-2.102 3.07c.448.447.816.997 1.072 1.582a.75.75 0 1 1-1.373.602 3.72 3.72 0 0 0-.76-1.124 3.592 3.592 0 0 0-5.08 0c-.31.31-.562.689-.746 1.11a.75.75 0 1 1-1.375-.6 5.11 5.11 0 0 1 1.061-1.57 5.092 5.092 0 0 1 7.201 0Zm4.805-5.541c.51.509.99 1.09 1.409 1.697a.75.75 0 0 1-1.235.852 10.822 10.822 0 0 0-1.234-1.489c-4.08-4.08-10.695-4.08-14.776 0-.421.422-.84.934-1.222 1.484a.75.75 0 0 1-1.232-.855c.43-.62.905-1.2 1.394-1.69 4.666-4.665 12.23-4.665 16.896 0Zm-7.387 8.16a1.5 1.5 0 1 1-2.122 2.122 1.5 1.5 0 0 1 2.122-2.122Z" fill="currentColor"/></svg>',speaker:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M15 4.25c0-1.079-1.274-1.65-2.08-.934L8.427 7.309a.75.75 0 0 1-.498.19H4.25A2.25 2.25 0 0 0 2 9.749v4.497a2.25 2.25 0 0 0 2.25 2.25h3.68a.75.75 0 0 1 .498.19l4.491 3.994c.806.716 2.081.144 2.081-.934V4.25ZM9.425 8.43 13.5 4.807v14.382l-4.075-3.624a2.25 2.25 0 0 0-1.495-.569H4.25a.75.75 0 0 1-.75-.75V9.75a.75.75 0 0 1 .75-.75h3.68a2.25 2.25 0 0 0 1.495-.569ZM18.992 5.897a.75.75 0 0 1 1.049.157A9.959 9.959 0 0 1 22 12a9.96 9.96 0 0 1-1.96 5.946.75.75 0 0 1-1.205-.892A8.459 8.459 0 0 0 20.5 12a8.459 8.459 0 0 0-1.665-5.054.75.75 0 0 1 .157-1.049Z" /><path d="M17.143 8.37a.75.75 0 0 1 1.017.302c.536.99.84 2.125.84 3.328a6.973 6.973 0 0 1-.84 3.328.75.75 0 0 1-1.32-.714c.42-.777.66-1.666.66-2.614s-.24-1.837-.66-2.614a.75.75 0 0 1 .303-1.017Z"/></svg>',speaker_off:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" fill="currentColor"><path d="M3.28 2.22a.75.75 0 1 0-1.06 1.06L6.438 7.5H4.25A2.25 2.25 0 0 0 2 9.749v4.497a2.25 2.25 0 0 0 2.25 2.25h3.68a.75.75 0 0 1 .498.19l4.491 3.994c.806.716 2.081.144 2.081-.934V16.06l5.72 5.72a.75.75 0 0 0 1.06-1.061L3.28 2.22ZM13.5 14.56v4.629l-4.075-3.624a2.25 2.25 0 0 0-1.495-.569H4.25a.75.75 0 0 1-.75-.75V9.75a.75.75 0 0 1 .75-.75h3.688L13.5 14.56ZM13.5 4.807v5.511l1.5 1.5V4.25c0-1.079-1.274-1.65-2.08-.934l-3.4 3.022 1.063 1.063L13.5 4.807ZM17.141 13.96l1.138 1.137A6.974 6.974 0 0 0 19 12a6.973 6.973 0 0 0-.84-3.328.75.75 0 0 0-1.32.714c.42.777.66 1.666.66 2.614 0 .691-.127 1.351-.359 1.96ZM19.388 16.206l1.093 1.094A9.955 9.955 0 0 0 22 12a9.959 9.959 0 0 0-1.96-5.946.75.75 0 0 0-1.205.892A8.46 8.46 0 0 1 20.5 12a8.458 8.458 0 0 1-1.112 4.206Z"/></svg>',download:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M18.25 20.5a.75.75 0 1 1 0 1.5l-13 .004a.75.75 0 1 1 0-1.5l13-.004ZM11.648 2.012l.102-.007a.75.75 0 0 1 .743.648l.007.102-.001 13.685 3.722-3.72a.75.75 0 0 1 .976-.073l.085.073a.75.75 0 0 1 .072.976l-.073.084-4.997 4.997a.75.75 0 0 1-.976.073l-.085-.073-5.003-4.996a.75.75 0 0 1 .976-1.134l.084.072 3.719 3.714L11 2.755a.75.75 0 0 1 .648-.743l.102-.007-.102.007Z" fill="currentColor"/></svg>',full_screen_maximize:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M4.5 5.75c0-.69.56-1.25 1.25-1.25h2a.75.75 0 0 0 0-1.5h-2A2.75 2.75 0 0 0 3 5.75v2a.75.75 0 0 0 1.5 0v-2ZM4.5 18.25c0 .69.56 1.25 1.25 1.25h2a.75.75 0 0 1 0 1.5h-2A2.75 2.75 0 0 1 3 18.25v-2a.75.75 0 0 1 1.5 0v2ZM18.25 4.5c.69 0 1.25.56 1.25 1.25v2a.75.75 0 0 0 1.5 0v-2A2.75 2.75 0 0 0 18.25 3h-2a.75.75 0 0 0 0 1.5h2ZM19.5 18.25c0 .69-.56 1.25-1.25 1.25h-2a.75.75 0 0 0 0 1.5h2A2.75 2.75 0 0 0 21 18.25v-2a.75.75 0 0 0-1.5 0v2Z" fill="currentColor"/></svg>',full_screen_minimize:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M8.5 3.75a.75.75 0 0 0-1.5 0v2.5a.75.75 0 0 1-.75.75h-2.5a.75.75 0 0 0 0 1.5h2.5A2.25 2.25 0 0 0 8.5 6.25v-2.5ZM8.5 20.25a.75.75 0 0 1-1.5 0v-2.5a.75.75 0 0 0-.75-.75h-2.5a.75.75 0 0 1 0-1.5h2.5a2.25 2.25 0 0 1 2.25 2.25v2.5ZM16.25 3a.75.75 0 0 0-.75.75v2.5a2.25 2.25 0 0 0 2.25 2.25h2.5a.75.75 0 0 0 0-1.5h-2.5a.75.75 0 0 1-.75-.75v-2.5a.75.75 0 0 0-.75-.75ZM15.5 20.25a.75.75 0 0 0 1.5 0v-2.5a.75.75 0 0 1 .75-.75h2.5a.75.75 0 0 0 0-1.5h-2.5a2.25 2.25 0 0 0-2.25 2.25v2.5Z" fill="currentColor"/></svg>',copy:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M5.503 4.627 5.5 6.75v10.504a3.25 3.25 0 0 0 3.25 3.25h8.616a2.251 2.251 0 0 1-2.122 1.5H8.75A4.75 4.75 0 0 1 4 17.254V6.75c0-.98.627-1.815 1.503-2.123ZM17.75 2A2.25 2.25 0 0 1 20 4.25v13a2.25 2.25 0 0 1-2.25 2.25h-9a2.25 2.25 0 0 1-2.25-2.25v-13A2.25 2.25 0 0 1 8.75 2h9Zm0 1.5h-9a.75.75 0 0 0-.75.75v13c0 .414.336.75.75.75h9a.75.75 0 0 0 .75-.75v-13a.75.75 0 0 0-.75-.75Z" fill="currentColor"/></svg>',attach:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M11.772 3.743a6 6 0 0 1 8.66 8.302l-.19.197-8.8 8.798-.036.03a3.723 3.723 0 0 1-5.489-4.973.764.764 0 0 1 .085-.13l.054-.06.086-.088.142-.148.002.003 7.436-7.454a.75.75 0 0 1 .977-.074l.084.073a.75.75 0 0 1 .074.976l-.073.084-7.594 7.613a2.23 2.23 0 0 0 3.174 3.106l8.832-8.83A4.502 4.502 0 0 0 13 4.644l-.168.16-.013.014-9.536 9.536a.75.75 0 0 1-1.133-.977l.072-.084 9.549-9.55h.002Z" fill="currentColor"/></svg>',image:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M17.75 3A3.25 3.25 0 0 1 21 6.25v11.5A3.25 3.25 0 0 1 17.75 21H6.25A3.25 3.25 0 0 1 3 17.75V6.25A3.25 3.25 0 0 1 6.25 3h11.5Zm.58 16.401-5.805-5.686a.75.75 0 0 0-.966-.071l-.084.07-5.807 5.687c.182.064.378.099.582.099h11.5c.203 0 .399-.035.58-.099l-5.805-5.686L18.33 19.4ZM17.75 4.5H6.25A1.75 1.75 0 0 0 4.5 6.25v11.5c0 .208.036.408.103.594l5.823-5.701a2.25 2.25 0 0 1 3.02-.116l.128.116 5.822 5.702c.067-.186.104-.386.104-.595V6.25a1.75 1.75 0 0 0-1.75-1.75Zm-2.498 2a2.252 2.252 0 1 1 0 4.504 2.252 2.252 0 0 1 0-4.504Zm0 1.5a.752.752 0 1 0 0 1.504.752.752 0 0 0 0-1.504Z" fill="currentColor"/></svg>',emoji_multiple:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M8.5 2a6.503 6.503 0 0 1 6.312 4.943c-.515.01-1.02.068-1.506.171a5 5 0 1 0-6.191 6.191 8.053 8.053 0 0 0-.172 1.507A6.5 6.5 0 0 1 8.5 2Zm.16 8.006c.355-.451.759-.864 1.202-1.23a3.5 3.5 0 0 0-4.022.95.75.75 0 1 0 1.14.974 2 2 0 0 1 1.68-.694ZM7.5 6.5a1 1 0 1 1-2 0 1 1 0 0 1 2 0Zm4 0a1 1 0 1 1-2 0 1 1 0 0 1 2 0Zm1 8a1 1 0 1 0 0-2 1 1 0 0 0 0 2Zm5.458 2.042a.75.75 0 0 1 .082 1.058 4 4 0 0 1-6.075.005.75.75 0 0 1 1.138-.977 2.499 2.499 0 0 0 3.797-.003.75.75 0 0 1 1.058-.083ZM17.5 14.5a1 1 0 1 0 0-2 1 1 0 0 0 0 2ZM15 22a7 7 0 1 0 0-14 7 7 0 0 0 0 14Zm0-1.5a5.5 5.5 0 1 1 0-11 5.5 5.5 0 0 1 0 11Z" fill="currentColor"/></svg>',image_off:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M3.28 2.22a.75.75 0 1 0-1.06 1.06l1.263 1.264A3.235 3.235 0 0 0 3 6.25v11.5A3.25 3.25 0 0 0 6.25 21h11.5c.626 0 1.21-.177 1.706-.483l1.263 1.264a.75.75 0 0 0 1.061-1.061L3.28 2.22Zm8.788 10.909 6.206 6.206.056.066a1.746 1.746 0 0 1-.58.099H6.25c-.204 0-.4-.035-.582-.099l5.807-5.686.593-.586Zm-.95-.95a2.245 2.245 0 0 0-.692.464l-5.823 5.7a1.747 1.747 0 0 1-.103-.593V6.25c0-.206.036-.404.101-.588l6.518 6.518ZM19.5 16.318V6.25a1.75 1.75 0 0 0-1.75-1.75H7.682L6.182 3H17.75A3.25 3.25 0 0 1 21 6.25v11.568l-1.5-1.5Z" fill="currentColor"/><path d="M15.252 6.5a2.252 2.252 0 1 1 0 4.504 2.252 2.252 0 0 1 0-4.504Zm0 1.5a.752.752 0 1 0 0 1.504.752.752 0 0 0 0-1.504Z" fill="currentColor"/></svg>',disconnected:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M3.28 2.22a.75.75 0 0 0-1.06 1.06l3.364 3.365a11.99 11.99 0 0 0-2.033 1.634c-.49.489-.964 1.069-1.394 1.689a.75.75 0 1 0 1.233.855c.381-.55.8-1.062 1.222-1.484a10.468 10.468 0 0 1 2.063-1.604l1.591 1.592a8.062 8.062 0 0 0-1.923 1.424c-.61.61-1.109 1.3-1.491 2.056a.75.75 0 1 0 1.338.677 6.51 6.51 0 0 1 1.214-1.673 6.546 6.546 0 0 1 1.984-1.362l1.93 1.93a5.07 5.07 0 0 0-2.876 1.44 5.11 5.11 0 0 0-1.061 1.57.75.75 0 0 0 1.374.602c.185-.422.437-.8.747-1.111a3.59 3.59 0 0 1 3.36-.958l7.858 7.858a.75.75 0 0 0 1.06-1.06L3.28 2.22Zm8.304 6.182 1.584 1.584a6.532 6.532 0 0 1 3.516 1.825 6.798 6.798 0 0 1 1.217 1.692.75.75 0 1 0 1.336-.683 8.292 8.292 0 0 0-1.492-2.07 8.042 8.042 0 0 0-6.16-2.348ZM8.487 5.305 9.713 6.53a10.44 10.44 0 0 1 10.908 4.297.75.75 0 1 0 1.235-.852 11.946 11.946 0 0 0-13.369-4.67Zm4.573 11.134a1.5 1.5 0 1 1-2.121 2.122 1.5 1.5 0 0 1 2.121-2.122Z" fill="currentColor"/></svg>',wand:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="m13.314 7.565-.136.126-10.48 10.488a2.27 2.27 0 0 0 3.211 3.208L16.388 10.9a2.251 2.251 0 0 0-.001-3.182l-.157-.146a2.25 2.25 0 0 0-2.916-.007Zm-.848 2.961 1.088 1.088-8.706 8.713a.77.77 0 1 1-1.089-1.088l8.707-8.713Zm4.386 4.48L16.75 15a.75.75 0 0 0-.743.648L16 15.75v.75h-.75a.75.75 0 0 0-.743.648l-.007.102c0 .38.282.694.648.743l.102.007H16v.75c0 .38.282.694.648.743l.102.007a.75.75 0 0 0 .743-.648l.007-.102V18h.75a.75.75 0 0 0 .743-.648L19 17.25a.75.75 0 0 0-.648-.743l-.102-.007h-.75v-.75a.75.75 0 0 0-.648-.743L16.75 15l.102.007Zm-1.553-6.254.027.027a.751.751 0 0 1 0 1.061l-.711.713-1.089-1.089.73-.73a.75.75 0 0 1 1.043.018ZM6.852 5.007 6.75 5a.75.75 0 0 0-.743.648L6 5.75v.75h-.75a.75.75 0 0 0-.743.648L4.5 7.25c0 .38.282.693.648.743L5.25 8H6v.75c0 .38.282.693.648.743l.102.007a.75.75 0 0 0 .743-.648L7.5 8.75V8h.75a.75.75 0 0 0 .743-.648L9 7.25a.75.75 0 0 0-.648-.743L8.25 6.5H7.5v-.75a.75.75 0 0 0-.648-.743L6.75 5l.102.007Zm12-2L18.75 3a.75.75 0 0 0-.743.648L18 3.75v.75h-.75a.75.75 0 0 0-.743.648l-.007.102c0 .38.282.693.648.743L17.25 6H18v.75c0 .38.282.693.648.743l.102.007a.75.75 0 0 0 .743-.648l.007-.102V6h.75a.75.75 0 0 0 .743-.648L21 5.25a.75.75 0 0 0-.648-.743L20.25 4.5h-.75v-.75a.75.75 0 0 0-.648-.743L18.75 3l.102.007Z" fill="currentColor"/></svg>',recording:'<svg xmlns="http://www.w3.org/2000/svg" fill="currentColor" viewBox="0 0 24 24"><path d="M12 18a6 6 0 1 0 0-12 6 6 0 0 0 0 12Z"/><path d="M12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2ZM3.5 12a8.5 8.5 0 1 1 17 0 8.5 8.5 0 0 1-17 0Z"/></svg>',subtract:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M3.755 12.5h16.492a.75.75 0 0 0 0-1.5H3.755a.75.75 0 0 0 0 1.5Z" fill="currentColor"/></svg>',stop_recording:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 3.5C9.74566 3.5 7.58365 4.39553 5.98959 5.98959C4.39553 7.58365 3.5 9.74566 3.5 12C3.5 14.2543 4.39553 16.4163 5.98959 18.0104C7.58365 19.6045 9.74566 20.5 12 20.5C14.2543 20.5 16.4163 19.6045 18.0104 18.0104C19.6045 16.4163 20.5 14.2543 20.5 12C20.5 9.74566 19.6045 7.58365 18.0104 5.98959C16.4163 4.39553 14.2543 3.5 12 3.5ZM2 12C2 6.477 6.477 2 12 2C17.523 2 22 6.477 22 12C22 17.523 17.523 22 12 22C6.477 22 2 17.523 2 12ZM8 9.5C8 9.10218 8.15804 8.72064 8.43934 8.43934C8.72064 8.15804 9.10218 8 9.5 8H14.5C14.8978 8 15.2794 8.15804 15.5607 8.43934C15.842 8.72064 16 9.10218 16 9.5V14.5C16 14.8978 15.842 15.2794 15.5607 15.5607C15.2794 15.842 14.8978 16 14.5 16H9.5C9.10218 16 8.72064 15.842 8.43934 15.5607C8.15804 15.2794 8 14.8978 8 14.5V9.5Z" fill="currentColor"/></svg>',warning:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M10.91 2.782a2.25 2.25 0 0 1 2.975.74l.083.138 7.759 14.009a2.25 2.25 0 0 1-1.814 3.334l-.154.006H4.243a2.25 2.25 0 0 1-2.041-3.197l.072-.143L10.031 3.66a2.25 2.25 0 0 1 .878-.878Zm9.505 15.613-7.76-14.008a.75.75 0 0 0-1.254-.088l-.057.088-7.757 14.008a.75.75 0 0 0 .561 1.108l.095.006h15.516a.75.75 0 0 0 .696-1.028l-.04-.086-7.76-14.008 7.76 14.008ZM12 16.002a.999.999 0 1 1 0 1.997.999.999 0 0 1 0-1.997ZM11.995 8.5a.75.75 0 0 1 .744.647l.007.102.004 4.502a.75.75 0 0 1-1.494.103l-.006-.102-.004-4.502a.75.75 0 0 1 .75-.75Z" fill="currentColor"/></svg>',pin:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="m16.242 2.932 4.826 4.826a2.75 2.75 0 0 1-.715 4.404l-4.87 2.435a.75.75 0 0 0-.374.426l-1.44 4.166a1.25 1.25 0 0 1-2.065.476L8.5 16.561 4.06 21H3v-1.06l4.44-4.44-3.105-3.104a1.25 1.25 0 0 1 .476-2.066l4.166-1.44a.75.75 0 0 0 .426-.373l2.435-4.87a2.75 2.75 0 0 1 4.405-.715Zm3.766 5.886-4.826-4.826a1.25 1.25 0 0 0-2.002.325l-2.435 4.871a2.25 2.25 0 0 1-1.278 1.12l-3.789 1.31 6.705 6.704 1.308-3.789a2.25 2.25 0 0 1 1.12-1.277l4.872-2.436a1.25 1.25 0 0 0 .325-2.002Z" fill="currentColor"/></svg>',pin_off:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M3.28 2.22a.75.75 0 0 0-1.06 1.06l5.905 5.905L4.81 10.33a1.25 1.25 0 0 0-.476 2.065L7.439 15.5 3 19.94V21h1.06l4.44-4.44 3.105 3.105a1.25 1.25 0 0 0 2.065-.476l1.145-3.313 5.905 5.904a.75.75 0 0 0 1.06-1.06L3.28 2.22Zm10.355 12.476-1.252 3.626-6.705-6.705 3.626-1.252 4.331 4.331Zm6.048-3.876-3.787 1.894 1.118 1.118 3.34-1.67a2.75 2.75 0 0 0 .714-4.404l-4.825-4.826a2.75 2.75 0 0 0-4.405.715l-1.67 3.34 1.118 1.117 1.894-3.787a1.25 1.25 0 0 1 2.002-.325l4.826 4.826a1.25 1.25 0 0 1-.325 2.002Z" fill="currentColor"/></svg>',spinner:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none"><circle cx="12" cy="12" r="10" stroke-width="2" stroke="currentColor" stroke-opacity="0.2" vector-effect="non-scaling-stroke"/><path d="M22 12C22 10.6868 21.7413 9.38642 21.2388 8.17317C20.7362 6.95991 19.9997 5.85752 19.0711 4.92893C18.1425 4.00035 17.0401 3.26375 15.8268 2.7612C14.6136 2.25866 13.3132 2 12 2" stroke="currentColor" stroke-width="2" stroke-linecap="round" vector-effect="non-scaling-stroke"/></svg>',breakout_rooms:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M10.5 3a2.25 2.25 0 0 1 2.25 2.25v6h6A2.25 2.25 0 0 1 21 13.5v5.25A2.25 2.25 0 0 1 18.75 21H5.25A2.25 2.25 0 0 1 3 18.75V5.25A2.25 2.25 0 0 1 5.25 3h5.25Zm.75 9.75H4.5v6c0 .414.336.75.75.75h5.999l.001-6.75Zm7.5 0h-6.001v6.75h6.001a.75.75 0 0 0 .75-.75V13.5a.75.75 0 0 0-.75-.75ZM10.5 4.5H5.25a.75.75 0 0 0-.75.75v6h6.75v-6a.75.75 0 0 0-.75-.75Zm7.398-2.493L18 2a.75.75 0 0 1 .743.648l.007.102v2.5h2.5a.75.75 0 0 1 .743.648L22 6a.75.75 0 0 1-.648.743l-.102.007h-2.5v2.5a.75.75 0 0 1-.648.743L18 10a.75.75 0 0 1-.743-.648l-.007-.102v-2.5h-2.5a.75.75 0 0 1-.743-.648L14 6a.75.75 0 0 1 .648-.743l.102-.007h2.5v-2.5a.75.75 0 0 1 .648-.743Z" fill="currentColor"/></svg>',add:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M11.75 3a.75.75 0 0 1 .743.648l.007.102.001 7.25h7.253a.75.75 0 0 1 .102 1.493l-.102.007h-7.253l.002 7.25a.75.75 0 0 1-1.493.101l-.007-.102-.002-7.249H3.752a.75.75 0 0 1-.102-1.493L3.752 11h7.25L11 3.75a.75.75 0 0 1 .75-.75Z" fill="currentColor"/></svg>',shuffle:'<svg viewBox="0 0 24 24" fill="currentColor" xmlns="http://www.w3.org/2000/svg"><path d="M14.0058 8.11111H18.7947L16.9613 9.94444C16.9095 9.99587 16.8684 10.057 16.8402 10.1243C16.812 10.1917 16.7974 10.2639 16.7971 10.3369C16.7966 10.4843 16.8547 10.6259 16.9586 10.7306C17.01 10.7823 17.0711 10.8235 17.1385 10.8517C17.2058 10.8799 17.278 10.8945 17.351 10.8947C17.4985 10.8953 17.64 10.8372 17.7447 10.7333L20.8891 7.59999L20.4947 7.20555L17.7447 4.46111C17.64 4.35723 17.4985 4.29917 17.351 4.29969C17.2036 4.30021 17.0624 4.35927 16.9586 4.46388C16.8547 4.5685 16.7966 4.71009 16.7971 4.85751C16.7977 5.00494 16.8567 5.14612 16.9613 5.24999L18.728 6.99999H13.6669C13.5699 7.00058 13.4748 7.02653 13.391 7.07526C13.3072 7.12399 13.2376 7.19381 13.1891 7.27777L11.7224 9.82777L12.3669 10.9389L14.0058 8.11111Z" fill="currentColor"/><path d="M8.15022 15.9278H3.66688C3.51954 15.9278 3.37823 15.9863 3.27405 16.0905C3.16986 16.1947 3.11133 16.336 3.11133 16.4833C3.11133 16.6307 3.16986 16.772 3.27405 16.8762C3.37823 16.9804 3.51954 17.0389 3.66688 17.0389H8.47244C8.56939 17.0383 8.6645 17.0124 8.74832 16.9636C8.83214 16.9149 8.90174 16.8451 8.95022 16.7611L10.4335 14.2222L9.77799 13.1111L8.15022 15.9278Z"/><path d="M17.7447 13.2056C17.64 13.1017 17.4985 13.0436 17.351 13.0441C17.2036 13.0447 17.0624 13.1037 16.9586 13.2083C16.8547 13.3129 16.7966 13.4545 16.7971 13.602C16.7977 13.7494 16.8567 13.8906 16.9613 13.9944L18.9058 15.9389H14.0058L8.95022 7.29444C8.90174 7.21047 8.83214 7.14066 8.74832 7.09193C8.6645 7.04319 8.56939 7.01725 8.47244 7.01666H3.66688C3.51954 7.01666 3.37823 7.07519 3.27405 7.17938C3.16986 7.28357 3.11133 7.42487 3.11133 7.57222C3.11133 7.71956 3.16986 7.86087 3.27405 7.96505C3.37823 8.06924 3.51954 8.12777 3.66688 8.12777H8.15022L13.2058 16.7667C13.2542 16.8506 13.3239 16.9204 13.4077 16.9692C13.4915 17.0179 13.5866 17.0439 13.6836 17.0444H18.6113L16.9447 18.7111C16.8929 18.7625 16.8517 18.8237 16.8235 18.891C16.7954 18.9584 16.7807 19.0306 16.7805 19.1036C16.7802 19.1766 16.7943 19.2489 16.822 19.3165C16.8497 19.384 16.8905 19.4454 16.9419 19.4972C16.9933 19.549 17.0545 19.5902 17.1218 19.6184C17.1891 19.6465 17.2614 19.6612 17.3344 19.6614C17.4074 19.6617 17.4797 19.6476 17.5472 19.6199C17.6148 19.5922 17.6762 19.5514 17.728 19.5L20.478 16.7556L20.8724 16.3611L17.7447 13.2056Z"/></svg>',edit:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M21.03 2.97a3.578 3.578 0 0 1 0 5.06L9.062 20a2.25 2.25 0 0 1-.999.58l-5.116 1.395a.75.75 0 0 1-.92-.921l1.395-5.116a2.25 2.25 0 0 1 .58-.999L15.97 2.97a3.578 3.578 0 0 1 5.06 0ZM15 6.06 5.062 16a.75.75 0 0 0-.193.333l-1.05 3.85 3.85-1.05A.75.75 0 0 0 8 18.938L17.94 9 15 6.06Zm2.03-2.03-.97.97L19 7.94l.97-.97a2.079 2.079 0 0 0-2.94-2.94Z" fill="currentColor"/></svg>',delete:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 1.75a3.25 3.25 0 0 1 3.245 3.066L15.25 5h5.25a.75.75 0 0 1 .102 1.493L20.5 6.5h-.796l-1.28 13.02a2.75 2.75 0 0 1-2.561 2.474l-.176.006H8.313a2.75 2.75 0 0 1-2.714-2.307l-.023-.174L4.295 6.5H3.5a.75.75 0 0 1-.743-.648L2.75 5.75a.75.75 0 0 1 .648-.743L3.5 5h5.25A3.25 3.25 0 0 1 12 1.75Zm6.197 4.75H5.802l1.267 12.872a1.25 1.25 0 0 0 1.117 1.122l.127.006h7.374c.6 0 1.109-.425 1.225-1.002l.02-.126L18.196 6.5ZM13.75 9.25a.75.75 0 0 1 .743.648L14.5 10v7a.75.75 0 0 1-1.493.102L13 17v-7a.75.75 0 0 1 .75-.75Zm-3.5 0a.75.75 0 0 1 .743.648L11 10v7a.75.75 0 0 1-1.493.102L9.5 17v-7a.75.75 0 0 1 .75-.75Zm1.75-6a1.75 1.75 0 0 0-1.744 1.606L10.25 5h3.5A1.75 1.75 0 0 0 12 3.25Z" fill="currentColor"/></svg>',back:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M4.75 2a.75.75 0 0 1 .743.648l.007.102v5.69l4.574-4.56a6.41 6.41 0 0 1 8.879-.179l.186.18a6.41 6.41 0 0 1 0 9.063l-8.846 8.84a.75.75 0 0 1-1.06-1.062l8.845-8.838a4.91 4.91 0 0 0-6.766-7.112l-.178.17L6.562 9.5h5.688a.75.75 0 0 1 .743.648l.007.102a.75.75 0 0 1-.648.743L12.25 11h-7.5a.75.75 0 0 1-.743-.648L4 10.25v-7.5A.75.75 0 0 1 4.75 2Z" fill="currentColor"/></svg>',save:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M3 5.75A2.75 2.75 0 0 1 5.75 3h9.964a3.25 3.25 0 0 1 2.299.952l2.035 2.035c.61.61.952 1.437.952 2.299v9.964A2.75 2.75 0 0 1 18.25 21H5.75A2.75 2.75 0 0 1 3 18.25V5.75ZM5.75 4.5c-.69 0-1.25.56-1.25 1.25v12.5c0 .69.56 1.25 1.25 1.25H6v-5.25A2.25 2.25 0 0 1 8.25 12h7.5A2.25 2.25 0 0 1 18 14.25v5.25h.25c.69 0 1.25-.56 1.25-1.25V8.286c0-.465-.184-.91-.513-1.238l-2.035-2.035a1.75 1.75 0 0 0-.952-.49V7.25a2.25 2.25 0 0 1-2.25 2.25h-4.5A2.25 2.25 0 0 1 7 7.25V4.5H5.75Zm10.75 15v-5.25a.75.75 0 0 0-.75-.75h-7.5a.75.75 0 0 0-.75.75v5.25h9Zm-8-15v2.75c0 .414.336.75.75.75h4.5a.75.75 0 0 0 .75-.75V4.5h-6Z" fill="currentColor"/></svg>',web:'<svg fill="none" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 1.999c5.524 0 10.002 4.478 10.002 10.002 0 5.523-4.478 10.001-10.002 10.001-5.524 0-10.002-4.478-10.002-10.001C1.998 6.477 6.476 1.999 12 1.999ZM14.939 16.5H9.06c.652 2.414 1.786 4.002 2.939 4.002s2.287-1.588 2.939-4.002Zm-7.43 0H4.785a8.532 8.532 0 0 0 4.094 3.411c-.522-.82-.953-1.846-1.27-3.015l-.102-.395Zm11.705 0h-2.722c-.324 1.335-.792 2.5-1.373 3.411a8.528 8.528 0 0 0 3.91-3.127l.185-.283ZM7.094 10H3.735l-.005.017a8.525 8.525 0 0 0-.233 1.984c0 1.056.193 2.067.545 3h3.173a20.847 20.847 0 0 1-.123-5Zm8.303 0H8.603a18.966 18.966 0 0 0 .135 5h6.524a18.974 18.974 0 0 0 .135-5Zm4.868 0h-3.358c.062.647.095 1.317.095 2a20.3 20.3 0 0 1-.218 3h3.173a8.482 8.482 0 0 0 .544-3c0-.689-.082-1.36-.236-2ZM8.88 4.09l-.023.008A8.531 8.531 0 0 0 4.25 8.5h3.048c.314-1.752.86-3.278 1.583-4.41ZM12 3.499l-.116.005C10.62 3.62 9.396 5.622 8.83 8.5h6.342c-.566-2.87-1.783-4.869-3.045-4.995L12 3.5Zm3.12.59.107.175c.669 1.112 1.177 2.572 1.475 4.237h3.048a8.533 8.533 0 0 0-4.339-4.29l-.291-.121Z" fill="currentColor"/></svg>',checkmark:'<svg xmlns="http://www.w3.org/2000/svg" fill="currentColor" viewBox="0 0 24 24"><path fill="none" d="M0 0h24v24H0V0z"/><path d="m18 6.7-8.48 8.48-3.54-3.54a.996.996 0 1 0-1.41 1.41l4.24 4.24c.39.39 1.02.39 1.41 0l9.18-9.18a.999.999 0 0 0-.01-1.42c-.37-.38-1-.38-1.39.01z"/></svg>',spotlight:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M19.745 4C20.3417 4 20.914 4.23705 21.336 4.65901C21.7579 5.08097 21.995 5.65326 21.995 6.25V12.805C21.5485 12.3774 21.0434 12.0154 20.495 11.73V6.25C20.495 6.05109 20.416 5.86032 20.2753 5.71967C20.1347 5.57902 19.9439 5.5 19.745 5.5H4.25C4.05109 5.5 3.86032 5.57902 3.71967 5.71967C3.57902 5.86032 3.5 6.05109 3.5 6.25V17.755C3.5 18.169 3.836 18.505 4.25 18.505L6.999 18.504L7 15.75C7.00002 15.3108 7.16517 14.8877 7.46268 14.5646C7.76019 14.2415 8.1683 14.0421 8.606 14.006L8.75 14H12.022C11.7223 14.4675 11.484 14.9716 11.313 15.5H8.75C8.69368 15.5001 8.63904 15.5192 8.59493 15.5542C8.55083 15.5893 8.51984 15.6382 8.507 15.693L8.5 15.75L8.499 18.504H11.077C11.1569 19.0193 11.2989 19.5229 11.5 20.004H4.25C3.65344 20.004 3.08129 19.7671 2.65936 19.3453C2.23744 18.9236 2.00027 18.3516 2 17.755V6.25C2 5.65326 2.23705 5.08097 2.65901 4.65901C3.08097 4.23705 3.65326 4 4.25 4H19.745Z"/><path d="M12 7C12.7956 7 13.5587 7.31607 14.1213 7.87868C14.6839 8.44129 15 9.20435 15 10C15 10.7956 14.6839 11.5587 14.1213 12.1213C13.5587 12.6839 12.7956 13 12 13C11.2044 13 10.4413 12.6839 9.87868 12.1213C9.31607 11.5587 9 10.7956 9 10C9 9.20435 9.31607 8.44129 9.87868 7.87868C10.4413 7.31607 11.2044 7 12 7ZM12 8.5C11.6022 8.5 11.2206 8.65804 10.9393 8.93934C10.658 9.22064 10.5 9.60218 10.5 10C10.5 10.3978 10.658 10.7794 10.9393 11.0607C11.2206 11.342 11.6022 11.5 12 11.5C12.3978 11.5 12.7794 11.342 13.0607 11.0607C13.342 10.7794 13.5 10.3978 13.5 10C13.5 9.60218 13.342 9.22064 13.0607 8.93934C12.7794 8.65804 12.3978 8.5 12 8.5Z"/><path d="M23 17.5C23 18.9587 22.4205 20.3576 21.3891 21.3891C20.3576 22.4205 18.9587 23 17.5 23C16.0413 23 14.6424 22.4205 13.6109 21.3891C12.5795 20.3576 12 18.9587 12 17.5C12 16.0413 12.5795 14.6424 13.6109 13.6109C14.6424 12.5795 16.0413 12 17.5 12C18.9587 12 20.3576 12.5795 21.3891 13.6109C22.4205 14.6424 23 16.0413 23 17.5ZM18.055 14.42C18.0207 14.2993 17.9479 14.193 17.8478 14.1174C17.7476 14.0417 17.6255 14.0008 17.5 14.0008C17.3745 14.0008 17.2524 14.0417 17.1522 14.1174C17.0521 14.193 16.9793 14.2993 16.945 14.42L16.388 16.208H14.585C14.019 16.208 13.785 16.962 14.242 17.308L15.7 18.413L15.143 20.2C14.968 20.761 15.584 21.228 16.042 20.881L17.5 19.777L18.958 20.881C19.416 21.228 20.032 20.761 19.857 20.201L19.3 18.413L20.758 17.309C21.216 16.962 20.981 16.208 20.415 16.208H18.612L18.055 14.421V14.42Z"/></svg>',join_stage:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" fill="currentColor"><path d="M17.5 22C14.4618 22 12 19.5376 12 16.5C12 13.4623 14.4618 11 17.5 11C20.5371 11 23 13.4624 23 16.5C23 19.5376 20.5371 22 17.5 22ZM17.0704 18.992L17.1167 19.0322C17.1868 19.0841 17.2716 19.1125 17.3588 19.1132C17.4461 19.1139 17.5314 19.0869 17.6023 19.036L17.654 18.992L17.6936 18.9458C17.7455 18.8757 17.7739 18.7909 17.7746 18.7037C17.7753 18.6164 17.7483 18.5311 17.6975 18.4602L17.6535 18.4085L16.158 16.9125H19.8375L19.8936 16.9092C19.9829 16.8969 20.0657 16.8558 20.1293 16.792C20.193 16.7282 20.234 16.6454 20.2462 16.5561L20.25 16.5005L20.2462 16.4444C20.2339 16.3553 20.1928 16.2725 20.1292 16.2089C20.0655 16.1452 19.9828 16.1041 19.8936 16.0919L19.8375 16.088H16.158L17.654 14.592L17.6941 14.5453C17.7537 14.4659 17.7827 14.3676 17.7756 14.2686C17.7686 14.1695 17.726 14.0763 17.6558 14.0061C17.5856 13.9359 17.4924 13.8934 17.3934 13.8863C17.2943 13.8793 17.1961 13.9082 17.1167 13.9678L17.071 14.0079L14.8699 16.2079L14.8303 16.2547C14.7784 16.3247 14.75 16.4094 14.7493 16.4965C14.7485 16.5837 14.7753 16.6688 14.8259 16.7398L14.8699 16.7915L17.0704 18.992Z"/><path d="M2.80546 3.80546C2.28973 4.32118 2 5.02065 2 5.75V16.25C2 16.6111 2.07113 16.9687 2.20933 17.3024C2.34753 17.636 2.5501 17.9392 2.80546 18.1945C3.06082 18.4499 3.36398 18.6525 3.69762 18.7907C4.03127 18.9289 4.38886 19 4.75 19H11.498C11.3 18.526 11.157 18.023 11.076 17.5H9.002V14.75C9.002 14.6837 9.02834 14.6201 9.07522 14.5732C9.12211 14.5263 9.1857 14.5 9.252 14.5H11.3135C11.4858 13.9665 11.7253 13.4632 12.0218 13H9.252C8.285 13 7.502 13.784 7.502 14.75V16H7.5V17.5H4.75C4.06 17.5 3.5 16.94 3.5 16.25V5.75C3.5 5.06 4.06 4.5 4.75 4.5H19.25C19.94 4.5 20.5 5.06 20.5 5.75V10.732C20.6457 10.808 20.7884 10.8895 20.9277 10.9762C20.9687 11.0017 21.0093 11.0276 21.0497 11.054C21.3899 11.2762 21.708 11.5294 22 11.8096V5.75C22 5.02065 21.7103 4.32118 21.1945 3.80546C20.6788 3.28973 19.9793 3 19.25 3H4.75C4.02065 3 3.32118 3.28973 2.80546 3.80546Z"/><path fill-rule="evenodd" clip-rule="evenodd" d="M14.4181 10.7757C14.7938 10.264 15 9.64262 15 9C15 8.20435 14.6839 7.44129 14.1213 6.87868C13.5587 6.31607 12.7956 6 12 6C11.2044 6 10.4413 6.31607 9.87868 6.87868C9.31607 7.44129 9 8.20435 9 9C9 9.79565 9.31607 10.5587 9.87868 11.1213C10.4413 11.6839 11.2044 12 12 12C12.333 12 12.6602 11.9446 12.9695 11.839C13.3992 11.4213 13.8864 11.0625 14.4181 10.7757ZM10.9393 7.93934C11.2206 7.65804 11.6022 7.5 12 7.5C12.3978 7.5 12.7794 7.65804 13.0607 7.93934C13.342 8.22064 13.5 8.60218 13.5 9C13.5 9.39782 13.342 9.77936 13.0607 10.0607C12.7794 10.342 12.3978 10.5 12 10.5C11.6022 10.5 11.2206 10.342 10.9393 10.0607C10.658 9.77936 10.5 9.39782 10.5 9C10.5 8.60218 10.658 8.22064 10.9393 7.93934Z"></svg>',leave_stage:'<svg viewBox="0 0 24 24" fill="currentColor" xmlns="http://www.w3.org/2000/svg"><path d="M2.80546 3.80546C2.28973 4.32118 2 5.02065 2 5.75V16.25C2 16.6111 2.07113 16.9687 2.20933 17.3024C2.34753 17.636 2.5501 17.9392 2.80546 18.1945C3.06082 18.4499 3.36398 18.6525 3.69762 18.7907C4.03127 18.9289 4.38886 19 4.75 19H11.498C11.3 18.526 11.157 18.023 11.076 17.5H9.002V14.75C9.002 14.6837 9.02834 14.6201 9.07522 14.5732C9.12211 14.5263 9.1857 14.5 9.252 14.5H11.3135C11.4858 13.9665 11.7253 13.4632 12.0218 13H9.252C8.285 13 7.502 13.784 7.502 14.75V16H7.5V17.5H4.75C4.06 17.5 3.5 16.94 3.5 16.25V5.75C3.5 5.06 4.06 4.5 4.75 4.5H19.25C19.94 4.5 20.5 5.06 20.5 5.75V10.732C20.6457 10.808 20.7884 10.8895 20.9277 10.9762C20.9687 11.0017 21.0093 11.0276 21.0497 11.054C21.3899 11.2762 21.708 11.5294 22 11.8096V5.75C22 5.02065 21.7103 4.32118 21.1945 3.80546C20.6788 3.28973 19.9793 3 19.25 3H4.75C4.02065 3 3.32118 3.28973 2.80546 3.80546Z"/><path fill-rule="evenodd" clip-rule="evenodd" d="M14.4181 10.7757C14.7938 10.264 15 9.64262 15 9C15 8.20435 14.6839 7.44129 14.1213 6.87868C13.5587 6.31607 12.7956 6 12 6C11.2044 6 10.4413 6.31607 9.87868 6.87868C9.31607 7.44129 9 8.20435 9 9C9 9.79565 9.31607 10.5587 9.87868 11.1213C10.4413 11.6839 11.2044 12 12 12C12.333 12 12.6602 11.9446 12.9695 11.839C13.3992 11.4213 13.8864 11.0625 14.4181 10.7757ZM10.9393 7.93934C11.2206 7.65804 11.6022 7.5 12 7.5C12.3978 7.5 12.7794 7.65804 13.0607 7.93934C13.342 8.22064 13.5 8.60218 13.5 9C13.5 9.39782 13.342 9.77936 13.0607 10.0607C12.7794 10.342 12.3978 10.5 12 10.5C11.6022 10.5 11.2206 10.342 10.9393 10.0607C10.658 9.77936 10.5 9.39782 10.5 9C10.5 8.60218 10.658 8.22064 10.9393 7.93934Z"/><path d="M17.5 11C20.5382 11 23 13.4624 23 16.5C23 19.5377 20.5382 22 17.5 22C14.4629 22 12 19.5377 12 16.5C12 13.4624 14.4629 11 17.5 11V11ZM17.9296 14.0079L17.8833 13.9678C17.8132 13.9159 17.7284 13.8875 17.6412 13.8868C17.5539 13.8861 17.4686 13.9131 17.3977 13.964L17.346 14.0079L17.3064 14.0542C17.2545 14.1243 17.2261 14.2091 17.2254 14.2963C17.2247 14.3836 17.2517 14.4689 17.3026 14.5398L17.3465 14.5915L18.842 16.0875H15.1625L15.1064 16.0908C15.0171 16.1031 14.9343 16.1442 14.8707 16.208C14.807 16.2718 14.766 16.3546 14.7539 16.4439L14.75 16.4995L14.7539 16.5556C14.7661 16.6447 14.8072 16.7275 14.8708 16.7911C14.9345 16.8548 15.0172 16.8959 15.1064 16.9081L15.1625 16.912H18.842L17.346 18.408L17.3059 18.4547C17.2463 18.5341 17.2173 18.6324 17.2244 18.7314C17.2314 18.8305 17.274 18.9237 17.3442 18.9939C17.4144 19.0641 17.5076 19.1066 17.6066 19.1137C17.7057 19.1207 17.8039 19.0918 17.8833 19.0322L17.929 18.9921L20.1301 16.7921L20.1697 16.7453C20.2216 16.6753 20.25 16.5906 20.2507 16.5035C20.2515 16.4163 20.2247 16.3312 20.1741 16.2602L20.1301 16.2085L17.9301 14.0079L17.8833 13.9678L17.9296 14.0079V14.0079Z"/></svg>',pip_off:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" fill="currentColor"><path fill-rule="evenodd" clip-rule="evenodd" d="M10.8666 12.3058C11.0731 12.3058 11.2404 12.1385 11.2404 11.932V8.56753C11.2404 8.36107 11.0731 8.1937 10.8666 8.1937C10.6601 8.1937 10.4928 8.36107 10.4928 8.56753V11.0295L6.45393 6.99066C6.30794 6.84467 6.07124 6.84467 5.92525 6.99066C5.77926 7.13665 5.77926 7.37335 5.92525 7.51934L9.9641 11.5582L7.50212 11.5582C7.29566 11.5582 7.12829 11.7256 7.12829 11.932C7.12829 12.1385 7.29566 12.3058 7.50212 12.3058L10.8666 12.3058ZM5.73832 19.8879C3.6737 19.8879 2 18.2141 2 16.1495V7.73832C2 5.6737 3.6737 4 5.73832 4H18.2617C20.3263 4 22 5.6737 22 7.73832L22 13.0269C22 12.2687 21.6002 11.6038 21 11.2316C20.8468 11.1366 20.6806 11.0607 20.5047 11.0071V7.73832C20.5047 6.49955 19.5005 5.49533 18.2617 5.49533H5.73832C4.49955 5.49533 3.49533 6.49955 3.49533 7.73832V16.1495C3.49533 17.3883 4.49955 18.3925 5.73832 18.3925H10.7971C10.8506 18.5685 10.9266 18.7347 11.0216 18.8879C11.3938 19.4881 12.0587 19.8879 12.8169 19.8879H5.73832Z"/><path fill-rule="evenodd" clip-rule="evenodd" d="M19.7265 12.5H13.3911C12.899 12.5 12.5 12.899 12.5 13.3911V17.6462C12.5 18.1384 12.899 18.5374 13.3911 18.5374H19.7265C20.2187 18.5374 20.6176 18.1384 20.6176 17.6462V13.3911C20.6176 12.899 20.2187 12.5 19.7265 12.5ZM13.3911 11.5C12.3467 11.5 11.5 12.3467 11.5 13.3911V17.6462C11.5 18.6907 12.3467 19.5374 13.3911 19.5374H19.7265C20.771 19.5374 21.6176 18.6907 21.6176 17.6462V13.3911C21.6176 12.3467 20.771 11.5 19.7265 11.5H13.3911Z"/></svg>',pip_on:'<svg viewBox="0 0 24 24" fill="currentColor" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M5.73832 19.8879C3.6737 19.8879 2 18.2141 2 16.1495V7.73832C2 5.6737 3.6737 4 5.73832 4H18.2617C20.3263 4 22 5.6737 22 7.73832L22 13.0269C22 12.2687 21.6002 11.6038 21 11.2316C20.8468 11.1366 20.6806 11.0607 20.5047 11.0071V7.73832C20.5047 6.49955 19.5005 5.49533 18.2617 5.49533H5.73832C4.49955 5.49533 3.49533 6.49955 3.49533 7.73832V16.1495C3.49533 17.3883 4.49955 18.3925 5.73832 18.3925H10.7971C10.8506 18.5685 10.9266 18.7347 11.0216 18.8879C11.3938 19.4881 12.0587 19.8879 12.8169 19.8879H5.73832Z"/><path fill-rule="evenodd" clip-rule="evenodd" d="M19.7265 12.5H13.3911C12.899 12.5 12.5 12.899 12.5 13.3911V17.6462C12.5 18.1384 12.899 18.5374 13.3911 18.5374H19.7265C20.2187 18.5374 20.6176 18.1384 20.6176 17.6462V13.3911C20.6176 12.899 20.2187 12.5 19.7265 12.5ZM13.3911 11.5C12.3467 11.5 11.5 12.3467 11.5 13.3911V17.6462C11.5 18.6907 12.3467 19.5374 13.3911 19.5374H19.7265C20.771 19.5374 21.6176 18.6907 21.6176 17.6462V13.3911C21.6176 12.3467 20.771 11.5 19.7265 11.5H13.3911Z"/><path d="M6.18951 6.88123C5.98304 6.88123 5.81567 7.0486 5.81567 7.25506V10.6195C5.81567 10.826 5.98304 10.9934 6.18951 10.9934C6.39597 10.9934 6.56334 10.826 6.56334 10.6195V8.15757L10.6022 12.1964C10.7482 12.3424 10.9849 12.3424 11.1309 12.1964C11.2769 12.0504 11.2769 11.8137 11.1309 11.6677L7.09202 7.62889L9.55399 7.62889C9.76045 7.62889 9.92782 7.46152 9.92782 7.25506C9.92782 7.0486 9.76045 6.88123 9.55399 6.88123L6.18951 6.88123Z"/></svg>',signal_1:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M3 16h2v5H3z"></path></svg>',signal_2:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M3 16h2v5H3zm4-3h2v8H7z"></path></svg>',signal_3:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M3 16h2v5H3zm4-3h2v8H7zm4-3h2v11h-2z"></path></svg>',signal_4:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M3 16h2v5H3zm4-3h2v8H7zm4-3h2v11h-2zm4-3h2v14h-2z"></path></svg>',signal_5:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M3 16h2v5H3zm4-3h2v8H7zm4-3h2v11h-2zm4-3h2v14h-2zm4-3h2v17h-2z"></path></svg>',start_livestream:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="currentColor" d="M6.343 4.938a1 1 0 0 1 0 1.415a8.003 8.003 0 0 0 0 11.317a1 1 0 1 1-1.415 1.414c-3.906-3.906-3.906-10.24 0-14.146a1 1 0 0 1 1.415 0Zm12.731 0c3.906 3.907 3.906 10.24 0 14.146a1 1 0 0 1-1.414-1.414a8.003 8.003 0 0 0 0-11.317a1 1 0 0 1 1.414-1.415ZM9.31 7.812a1 1 0 0 1 0 1.414a3.92 3.92 0 0 0 0 5.544a1 1 0 1 1-1.414 1.414a5.92 5.92 0 0 1 0-8.372a1 1 0 0 1 1.414 0Zm6.959 0a5.92 5.92 0 0 1 0 8.372a1 1 0 0 1-1.415-1.414a3.92 3.92 0 0 0 0-5.544a1 1 0 0 1 1.415-1.414Zm-4.187 2.77a1.5 1.5 0 1 1 0 3a1.5 1.5 0 0 1 0-3Z"/></svg>',stop_livestream:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path fill="currentColor" d="M2.854 2.146a.5.5 0 1 0-.708.708l1.811 1.81A8.218 8.218 0 0 0 2 10a8.228 8.228 0 0 0 2.604 6.015a.725.725 0 0 0 1.01-.025c.316-.316.277-.819-.027-1.11A6.73 6.73 0 0 1 3.5 10c0-1.62.57-3.107 1.522-4.27l.712.71A5.726 5.726 0 0 0 4.5 10c0 1.691.73 3.213 1.893 4.264a.713.713 0 0 0 .983-.037c.328-.328.267-.844-.041-1.134A4.238 4.238 0 0 1 6 10c0-.93.298-1.789.804-2.489l1.842 1.842a1.5 1.5 0 0 0 2 2l6.5 6.5a.5.5 0 0 0 .708-.707l-1.811-1.81l-1.065-1.066l-.712-.71l-1.07-1.072l-1.842-1.841l-2-2L7.4 6.693l-.942-.942l-.82-.82l-.944-.944l-1.841-1.842Zm13.794 12.38A8.212 8.212 0 0 0 18 10c0-2.283-.928-4.35-2.426-5.843a.726.726 0 0 0-1.027.01c-.31.31-.28.8.01 1.095A6.727 6.727 0 0 1 16.5 10a6.718 6.718 0 0 1-.94 3.438l1.088 1.089Zm-1.822-1.822A5.73 5.73 0 0 0 15.5 10a5.733 5.733 0 0 0-1.706-4.087a.714.714 0 0 0-1.008.016c-.319.318-.272.816.014 1.111A4.235 4.235 0 0 1 14 10c0 .557-.107 1.09-.302 1.577l1.128 1.127Z"/></svg>',viewers:'<svg fill="none" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 9.005a4 4 0 1 1 0 8 4 4 0 0 1 0-8Zm0 1.5a2.5 2.5 0 1 0 0 5 2.5 2.5 0 0 0 0-5ZM12 5.5c4.613 0 8.596 3.15 9.701 7.564a.75.75 0 1 1-1.455.365 8.503 8.503 0 0 0-16.493.004.75.75 0 0 1-1.455-.363A10.003 10.003 0 0 1 12 5.5Z" fill="currentColor"/></svg>',debug:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="m10.05 15.42 6.256-8.476a.694.694 0 0 1 1.235.57l-.03.098-3.87 9.8a2.07 2.07 0 1 1-3.737-1.766l.069-.115.076-.11 6.257-8.477-6.257 8.476Zm2.05-4.549-1.226 1.66a3.32 3.32 0 0 0-2.29 3.024.75.75 0 0 1-1.5-.063A4.819 4.819 0 0 1 9.14 11.74c.9-.631 1.942-.911 2.961-.87Zm4.167 2.752c.28.586.436 1.22.463 1.866a.75.75 0 0 1-1.376.444l.913-2.31Zm-2.233-5.37-.969 1.311a6.22 6.22 0 0 0-4.736 1.02 6.208 6.208 0 0 0-2.419 3.39.75.75 0 0 1-1.442-.412 7.708 7.708 0 0 1 3-4.207 7.724 7.724 0 0 1 6.566-1.102Zm3.51 2.138c.25.267.486.556.702.865a7.727 7.727 0 0 1 1.097 2.288.75.75 0 0 1-1.44.417 6.23 6.23 0 0 0-.885-1.845l-.102-.138.627-1.587ZM15.98 5.852l-.088.054c-.123.082-.236.18-.337.295l-.096.12-.54.732a9.138 9.138 0 0 0-8.261 1.146A9.103 9.103 0 0 0 3.38 12.37a.75.75 0 1 1-1.398-.543A10.603 10.603 0 0 1 5.799 6.97 10.642 10.642 0 0 1 15.98 5.852Zm2.629 1.562a10.646 10.646 0 0 1 2.022 2.171c.49.702.892 1.451 1.199 2.235a.75.75 0 1 1-1.397.547 9.188 9.188 0 0 0-2.327-3.405l.381-.964c.076-.19.115-.388.122-.584Z" fill="currentColor"/></svg>',info:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 1.999c5.524 0 10.002 4.478 10.002 10.002 0 5.523-4.478 10.001-10.002 10.001-5.524 0-10.002-4.478-10.002-10.001C1.998 6.477 6.476 1.999 12 1.999Zm0 1.5a8.502 8.502 0 1 0 0 17.003A8.502 8.502 0 0 0 12 3.5Zm-.004 7a.75.75 0 0 1 .744.648l.007.102.003 5.502a.75.75 0 0 1-1.493.102l-.007-.101-.003-5.502a.75.75 0 0 1 .75-.75ZM12 7.003a.999.999 0 1 1 0 1.997.999.999 0 0 1 0-1.997Z" fill="currentColor"/></svg>',devices:'<svg fill="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 18.5a.75.75 0 1 0 0 1.5.75.75 0 0 0 0-1.5Zm5.5-8.5V9a5.5 5.5 0 1 0-11 0v1H9a1 1 0 0 1 1 1v4a1 1 0 0 1-1 1H6.5v.25a2.25 2.25 0 0 0 2.096 2.245l.154.005h1.128a2.251 2.251 0 1 1 0 1.5H8.75a3.75 3.75 0 0 1-3.745-3.55L5 16.25V9a7 7 0 0 1 14 0v5a2 2 0 0 1-1.85 1.995L17 16h-2a1 1 0 0 1-.993-.883L14 15v-4a1 1 0 0 1 .883-.993L15 10h2.5Zm-9 1.5h-2v3h2v-3Zm9 0h-2v3H17a.5.5 0 0 0 .492-.41L17.5 14v-2.5Z" fill="currentColor"/></svg>',horizontal_dots:'<svg fill="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M8 12a2 2 0 1 1-4 0 2 2 0 0 1 4 0ZM14 12a2 2 0 1 1-4 0 2 2 0 0 1 4 0ZM18 14a2 2 0 1 0 0-4 2 2 0 0 0 0 4Z" fill="currentColor"/></svg>',ai_sparkle:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 49 48" fill="none"><path fill="#F13E1B" d="m30.023 15.96.07.016a1.362 1.362 0 0 1 .657 2.068c-.163.23-.392.403-.658.497l-3.444 1.118a7.095 7.095 0 0 0-4.495 4.492l-1.12 3.442a1.357 1.357 0 0 1-1.267.907h-.016a1.361 1.361 0 0 1-1.283-.907l-1.12-3.442a7.091 7.091 0 0 0-4.495-4.509l-3.444-1.119a1.36 1.36 0 0 1 0-2.564l3.444-1.118a7.097 7.097 0 0 0 4.427-4.492l1.119-3.442a1.36 1.36 0 0 1 2.566 0l1.12 3.442a7.09 7.09 0 0 0 4.495 4.492l3.444 1.118Zm9.195 16.007-2.755-.894a5.678 5.678 0 0 1-3.596-3.594l-.896-2.753a1.087 1.087 0 0 0-2.053 0l-.895 2.753a5.672 5.672 0 0 1-3.541 3.594l-2.756.894a1.088 1.088 0 0 0 0 2.052l2.756.895a5.675 5.675 0 0 1 3.596 3.607l.896 2.753a1.088 1.088 0 0 0 2.052 0l.896-2.753a5.672 5.672 0 0 1 3.596-3.594l2.756-.894a1.088 1.088 0 0 0 0-2.052l-.056-.014Z"/><path fill="#2160FD" d="m39.218 31.967-2.755-.894a5.677 5.677 0 0 1-3.596-3.594l-.896-2.753a1.087 1.087 0 0 0-2.053 0l-.895 2.753a5.672 5.672 0 0 1-3.541 3.594l-2.756.894a1.088 1.088 0 0 0 0 2.052l2.756.895a5.675 5.675 0 0 1 3.596 3.607l.896 2.753a1.088 1.088 0 0 0 2.052 0l.896-2.753a5.672 5.672 0 0 1 3.596-3.594l2.756-.894a1.088 1.088 0 0 0 0-2.052l-.056-.014Z"/></svg>',meeting_ai:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28" fill="none"><path fill="#F13E1B" d="M9.111 12.888a4.98 4.98 0 0 0-1.075-.8l-.04.048a4.651 4.651 0 0 0-.903-.424l-2.446-.8a.963.963 0 0 1-.467-.356.953.953 0 0 1 0-1.116.955.955 0 0 1 .467-.352l2.446-.8A5.088 5.088 0 0 0 9.04 7.06a5.048 5.048 0 0 0 1.2-1.904l.02-.064.799-2.444A.97.97 0 0 1 11.969 2a.97.97 0 0 1 .91.648l.8 2.444a5.147 5.147 0 0 0 1.219 1.976 5.042 5.042 0 0 0 1.974 1.2l2.45.8h.048c.188.067.351.19.468.352.115.164.176.36.175.56.001.2-.06.396-.175.56a1 1 0 0 1-.468.352l-2.446.8a5.067 5.067 0 0 0-1.978 1.2 5.096 5.096 0 0 0-1.199 1.976l-.8 2.448-.023.06a1.02 1.02 0 0 1-.184.284.967.967 0 0 1-.703.3 1 1 0 0 1-.927-.644l-.8-2.448a5.11 5.11 0 0 0-.799-1.508 5.16 5.16 0 0 0-.4-.472Zm10.434 5.396a.492.492 0 0 1 .176-.236.473.473 0 0 1 .1-.048.466.466 0 0 1 .168-.04c.1 0 .197.031.28.088l.091.072a.456.456 0 0 1 .096.164l.4 1.224c.124.372.332.71.607.988.278.276.616.484.987.608l1.223.4h.028l.084.04a.536.536 0 0 1 .148.136c.056.082.087.18.088.28a.484.484 0 0 1-.32.456l-1.227.4a2.528 2.528 0 0 0-1.595 1.6l-.399 1.224a.46.46 0 0 1-.176.232.464.464 0 0 1-.28.088.475.475 0 0 1-.455-.32l-.4-1.224a2.507 2.507 0 0 0-.611-.992 2.487 2.487 0 0 0-.987-.612l-1.223-.4a.48.48 0 0 1 0-.908l1.223-.4c.367-.128.7-.337.975-.612.137-.142.257-.3.36-.468.1-.162.18-.335.24-.516l.399-1.224Z"/><path fill="currentColor" d="M19.545 18.284a.492.492 0 0 1 .176-.236.469.469 0 0 1 .1-.048.466.466 0 0 1 .168-.04c.1 0 .197.031.28.088l.091.072a.456.456 0 0 1 .096.164l.4 1.224c.124.372.332.71.607.988.279.276.616.484.988.608l1.222.4h.028l.084.04a.534.534 0 0 1 .148.136c.057.082.087.18.088.28a.484.484 0 0 1-.32.456l-1.227.4a2.528 2.528 0 0 0-1.595 1.6l-.399 1.224a.46.46 0 0 1-.175.232.464.464 0 0 1-.28.088.475.475 0 0 1-.456-.32l-.4-1.224a2.509 2.509 0 0 0-.61-.992 2.487 2.487 0 0 0-.988-.612l-1.223-.4a.48.48 0 0 1 0-.908l1.223-.4c.367-.128.7-.337.975-.612a2.7 2.7 0 0 0 .36-.468c.1-.162.18-.335.24-.516l.4-1.224Z"/></svg>',create_channel:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none"><path fill="currentColor" d="M2 14.75A3.25 3.25 0 0 0 5.25 18H6v2.75a1.25 1.25 0 0 0 1.999 1l2.125-1.59.396-1.583c.071-.286.177-.56.312-.82L7.5 20.252 7.499 16.5H5.25a1.75 1.75 0 0 1-1.75-1.75v-8.5c0-.966.784-1.75 1.75-1.75h13.5c.966 0 1.75.784 1.75 1.75v3.845a3.27 3.27 0 0 1 1.5.83V6.25A3.25 3.25 0 0 0 18.75 3H5.25A3.25 3.25 0 0 0 2 6.25v8.5Z"/><path fill="currentColor" d="m18.098 11.67-5.902 5.902a2.684 2.684 0 0 0-.707 1.247l-.458 1.831a1.087 1.087 0 0 0 1.319 1.318l1.83-.457a2.685 2.685 0 0 0 1.248-.707l5.902-5.902a2.285 2.285 0 1 0-3.232-3.232Z"/></svg>',create_channel_illustration:'<svg width="503" height="362" viewBox="0 0 503 362" fill="none" xmlns="http://www.w3.org/2000/svg"> <path d="M93.3477 192.893C93.3477 190.684 95.1385 188.893 97.3477 188.893H476C478.209 188.893 480 190.684 480 192.893V311.824C480 314.033 478.209 315.824 476 315.824H469.354C467.145 315.824 465.354 317.615 465.354 319.824V339.364C465.354 342.928 461.045 344.712 458.525 342.193L433.328 316.996C432.578 316.245 431.561 315.824 430.5 315.824H97.3477C95.1385 315.824 93.3477 314.033 93.3477 311.824V192.893Z" fill="#282828"/> <path d="M306.606 230.9H136.121C134.648 230.9 133.453 232.095 133.453 233.568C133.453 235.041 134.648 236.236 136.121 236.236H306.606C308.079 236.236 309.274 235.041 309.274 233.568C309.274 232.095 308.079 230.9 306.606 230.9Z" fill="#2160FD"/> <path d="M437.226 249.358H136.121C134.648 249.358 133.453 250.553 133.453 252.026C133.453 253.499 134.648 254.694 136.121 254.694H437.226C438.7 254.694 439.894 253.499 439.894 252.026C439.894 250.553 438.7 249.358 437.226 249.358Z" fill="#5C5C5C"/> <path d="M436.926 267.816H136.121C134.648 267.816 133.453 269.011 133.453 270.484C133.453 271.957 134.648 273.152 136.121 273.152H436.926C438.4 273.152 439.594 271.957 439.594 270.484C439.594 269.011 438.399 267.816 436.926 267.816Z" fill="#5C5C5C"/> <path d="M411.652 23C411.652 20.7909 409.861 19 407.652 19H29C26.7909 19 25 20.7909 25 23V141.931C25 144.14 26.7909 145.931 29 145.931H35.646C37.8551 145.931 39.646 147.722 39.646 149.931V169.472C39.646 173.036 43.9546 174.82 46.4745 172.3L71.6714 147.103C72.4216 146.352 73.439 145.931 74.4999 145.931H407.652C409.861 145.931 411.652 144.14 411.652 141.931V23Z" fill="#282828"/> <path d="M241.188 61.9839H70.703C69.2296 61.9839 68.0352 63.1783 68.0352 64.6517C68.0352 66.1252 69.2296 67.3196 70.703 67.3196H241.188C242.662 67.3196 243.856 66.1252 243.856 64.6517C243.856 63.1783 242.662 61.9839 241.188 61.9839Z" fill="#2160FD"/> <path d="M371.808 80.4419H70.703C69.2296 80.4419 68.0352 81.6363 68.0352 83.1098C68.0352 84.5832 69.2296 85.7776 70.703 85.7776H371.808C373.282 85.7776 374.476 84.5832 374.476 83.1098C374.476 81.6363 373.282 80.4419 371.808 80.4419Z" fill="#5C5C5C"/> <path d="M371.508 98.8999H70.703C69.2296 98.8999 68.0352 100.094 68.0352 101.568C68.0352 103.041 69.2296 104.236 70.703 104.236H371.508C372.982 104.236 374.176 103.041 374.176 101.568C374.176 100.094 372.982 98.8999 371.508 98.8999Z" fill="#5C5C5C"/> </svg>',captionsOn:'<svg width="24" height="24" fill="none" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M18.75 4A3.25 3.25 0 0 1 22 7.25v9.505a3.25 3.25 0 0 1-3.25 3.25H5.25A3.25 3.25 0 0 1 2 16.755V7.25a3.25 3.25 0 0 1 3.066-3.245L5.25 4h13.5Zm0 1.5H5.25l-.144.006A1.75 1.75 0 0 0 3.5 7.25v9.505c0 .966.784 1.75 1.75 1.75h13.5a1.75 1.75 0 0 0 1.75-1.75V7.25a1.75 1.75 0 0 0-1.75-1.75ZM5.5 12c0-3.146 2.713-4.775 5.122-3.401A.75.75 0 0 1 9.878 9.9C8.481 9.104 7 9.994 7 12c0 2.005 1.484 2.896 2.88 2.103a.75.75 0 0 1 .74 1.304C8.216 16.775 5.5 15.143 5.5 12Zm7.5 0c0-3.146 2.713-4.775 5.122-3.401a.75.75 0 0 1-.744 1.302C15.981 9.104 14.5 9.994 14.5 12c0 2.005 1.484 2.896 2.88 2.103a.75.75 0 0 1 .74 1.304C15.716 16.775 13 15.143 13 12Z" fill="currentColor"/></svg>',captionsOff:'<svg width="24" height="24" fill="none" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M3.28 2.22a.75.75 0 0 0-1.06 1.06l1.25 1.25A3.247 3.247 0 0 0 2 7.25v9.505a3.25 3.25 0 0 0 3.25 3.25h13.5c.063 0 .126-.002.188-.006l1.781 1.781a.75.75 0 0 0 1.061-1.06L3.28 2.22Zm14.164 16.284H5.25a1.75 1.75 0 0 1-1.75-1.75V7.25c0-.727.443-1.35 1.074-1.615l2.828 2.828C6.292 9.043 5.5 10.3 5.5 12c0 3.143 2.715 4.775 5.12 3.406a.75.75 0 0 0-.74-1.303C8.483 14.896 7 14.005 7 12c0-1.37.69-2.22 1.573-2.366l8.87 8.87Zm2.986-1.256c.045-.157.07-.322.07-.494V7.25a1.75 1.75 0 0 0-1.75-1.75H8.682L7.182 4H18.75A3.25 3.25 0 0 1 22 7.25v9.505c0 .593-.159 1.148-.436 1.627l-1.134-1.134Zm-5.877-5.877-1.197-1.197c.813-1.888 2.882-2.65 4.766-1.575a.75.75 0 0 1-.744 1.302c-1.241-.708-2.549-.085-2.825 1.47Z" fill="currentColor"/></svg>',play:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" fill="currentColor"><path d="M8 5v14l11-7z" /></svg>',pause:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" fill="currentColor"><path d="M6 4 H9 V20 H6 Z" /><path d="M15 4 H18 V20 H15 Z" /></svg>',fastForward:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30 24" fill="currentColor"><path d="M4 5v14l11-7-11-7zm13 0v14l11-7-11-7z"/></svg>',minimize:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M21.778 2.223a.75.75 0 0 1 .072.976l-.072.084-6.223 6.224h5.693a.75.75 0 0 1 .743.65l.007.1a.75.75 0 0 1-.649.744l-.101.007-7.55-.002-.016-.002a.727.727 0 0 1-.195-.042l-.098-.046a.747.747 0 0 1-.386-.553l-.007-.105V2.754a.75.75 0 0 1 1.493-.102l.007.102v5.69l6.222-6.221a.749.749 0 0 1 1.06 0ZM11.003 13.755v7.504a.75.75 0 0 1-1.494.102l-.007-.102v-5.695L3.28 21.78a.75.75 0 0 1-1.133-.977l.073-.084 6.22-6.214H2.751a.75.75 0 0 1-.743-.648L2 13.755a.75.75 0 0 1 .75-.75l7.554.002.074.009.097.023.053.019.086.04.089.058a.761.761 0 0 1 .148.148l.066.106.041.094.022.07.01.055.007.058v-.008l.005.076Z" fill="currentColor"/></svg>',maximize:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12.748 3.001h7.554l.1.014.099.028.061.026a.72.72 0 0 1 .218.15l.04.044.061.082.037.065.039.09.02.064.013.064.009.093v7.534a.75.75 0 0 1-1.493.102l-.006-.102-.001-5.696-13.94 13.945h5.69a.75.75 0 0 1 .744.65l.007.1a.75.75 0 0 1-.649.744l-.101.007H3.714L3.684 21a.705.705 0 0 1-.187-.04l-.09-.038-.018-.01a.746.746 0 0 1-.384-.553l-.007-.105V12.75a.75.75 0 0 1 1.493-.102l.007.102v5.692L18.438 4.5l-5.69.001a.75.75 0 0 1-.743-.648l-.007-.102a.75.75 0 0 1 .648-.743L12.748 3Z" fill="currentColor"/></svg>'},ze={get:(t,e,i)=>(...r)=>{try{return Reflect.get(t,e,i).apply(t,r)}catch(t){return null}}};let Ne;try{Ne=new Proxy(localStorage,ze)}catch(t){Ne=new Proxy({},ze)}const Be=Ne,He="rtk-prefs",Ge=(t,e)=>{const i=JSON.parse(Be.getItem(He)||"{}");i[t]=JSON.stringify(e),Be.setItem("rtk-prefs",JSON.stringify(i))},Ve=t=>JSON.parse(Be.getItem(He)||"{}")[t],qe=()=>{const t=JSON.parse(Be.getItem(He)||"{}");return{mirrorVideo:!t["mirror-video"]||"true"===t["mirror-video"],muteNotificationSounds:!!t["mute-notification-sounds"]&&"true"===t["mute-notification-sounds"]}},Ke={},We=((t,e)=>{const i=((t,e=(t,e)=>t!==e)=>{const i=Oe(t);let r=new Map(Object.entries(i??{}));const a={dispose:[],get:[],set:[],reset:[]},s=()=>{r=new Map(Object.entries(Oe(t)??{})),a.reset.forEach((t=>t()))},n=t=>(a.get.forEach((e=>e(t))),r.get(t)),o=(t,i)=>{const s=r.get(t);e(i,s,t)&&(r.set(t,i),a.set.forEach((e=>e(t,i,s))))},c="undefined"==typeof Proxy?{}:new Proxy(i,{get:(t,e)=>n(e),ownKeys:t=>Array.from(r.keys()),getOwnPropertyDescriptor:()=>({enumerable:!0,configurable:!0}),has:(t,e)=>r.has(e),set:(t,e,i)=>(o(e,i),!0)}),l=(t,e)=>(a[t].push(e),()=>{Ue(a[t],e)});return{state:c,get:n,set:o,on:l,onChange:(e,i)=>{const r=l("set",((t,r)=>{t===e&&i(r)})),a=l("reset",(()=>i(Oe(t)[e])));return()=>{r(),a()}},use:(...t)=>{const e=t.reduce(((t,e)=>(e.set&&t.push(l("set",e.set)),e.get&&t.push(l("get",e.get)),e.reset&&t.push(l("reset",e.reset)),e.dispose&&t.push(l("dispose",e.dispose)),t)),[]);return()=>e.forEach((t=>t()))},dispose:()=>{a.dispose.forEach((t=>t())),s()},reset:s,forceUpdate:t=>{const e=r.get(t);a.set.forEach((i=>i(t,e,e)))}}})(t,e);return i.use((()=>{const t=new Map;return{dispose:()=>t.clear(),get:e=>{const i=At();i&&((t,e,i)=>{const r=t.get(e);r?r.includes(i)||r.push(i):t.set(e,[i])})(t,e,i)},set:e=>{const i=t.get(e);i&&t.set(e,i.filter(Mt)),Ie(t)},reset:()=>{t.forEach((t=>t.forEach(Mt))),Ie(t)}}})()),i})({meeting:void 0,t:Fe(),iconPack:je,states:{meeting:"idle",prefs:qe()},config:De,size:void 0}),Ye=new Map;We.use({set:(t,e,i)=>{const r=Ye.get(t);r&&Ye.set(t,r.filter((r=>r[t]===i&&(r[t]=e,!0))))}});const Ze=We.state,Qe=(t,e=20)=>null==t?"":t.length>e?`${t.substring(0,e)}...`:t,Je=t=>/^\p{Emoji}+$/u.test(t)&&!/^\d+$/.test(t),Xe=t=>(null==t?void 0:t.trim().toLowerCase().startsWith("javascript:"))?"https://dyte.io":t,ti=t=>""===(t=null==t?void 0:t.trim())?"Participant":t,ei=new RegExp(/[^\u00BF-\u1FFF\u2C00-\uD7FF\w\s]/,"g"),ii=new RegExp(/\s+/);function ri(t,e=2){return t.replace(ei,"").trim().split(ii).slice(0,e).map((t=>t.charAt(0))).join("").toUpperCase()}function ai(){return function(t,e){const{connectedCallback:i,disconnectedCallback:r}=t;t.connectedCallback=function(){const t=W(this);if(!t[e]){const i=We.state[e];t[e]=i,function(t,e){const i=Ye.get(t);i?i.push(e):Ye.set(t,[e])}(e,t)}return null==i?void 0:i.call(this)},t.disconnectedCallback=function(){return function(t,e){const i=Ye.get(t);if(i&&i.length>0){const r=i.indexOf(e);-1!==r&&(i.splice(r,1),Ye.set(t,i))}}(e,W(this)),null==r?void 0:r.call(this)}}}const si="object"==typeof global&&global&&global.Object===Object&&global;var ni="object"==typeof self&&self&&self.Object===Object&&self;const oi=si||ni||Function("return this")();const ci=oi.Symbol;var li=Object.prototype,di=li.hasOwnProperty,hi=li.toString,pi=ci?ci.toStringTag:void 0;var gi=Object.prototype.toString;var ui=ci?ci.toStringTag:void 0;function fi(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":ui&&ui in Object(t)?function(t){var e=di.call(t,pi),i=t[pi];try{t[pi]=void 0;var r=!0}catch(t){}var a=hi.call(t);return r&&(e?t[pi]=i:delete t[pi]),a}(t):function(t){return gi.call(t)}(t)}function mi(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function vi(t){return null!=t&&"object"==typeof t}var bi=/\s/;var ki=/^\s+/;function yi(t){return t?t.slice(0,function(t){for(var e=t.length;e--&&bi.test(t.charAt(e)););return e}(t)+1).replace(ki,""):t}var wi=/^[-+]0x[0-9a-f]+$/i,xi=/^0b[01]+$/i,Si=/^0o[0-7]+$/i,Pi=parseInt;function Ci(t){if("number"==typeof t)return t;if(function(t){return"symbol"==typeof t||vi(t)&&"[object Symbol]"==fi(t)}(t))return NaN;if(mi(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=mi(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=yi(t);var i=xi.test(t);return i||Si.test(t)?Pi(t.slice(2),i?2:8):wi.test(t)?NaN:+t}const Ei=function(){return oi.Date.now()};var Ti=Math.max,Li=Math.min;function _i(t,e,i){var r,a,s,n,o,c,l=0,d=!1,h=!1,p=!0;if("function"!=typeof t)throw new TypeError("Expected a function");function g(e){var i=r,s=a;return r=a=void 0,l=e,n=t.apply(s,i)}function u(t){var i=t-c;return void 0===c||i>=e||i<0||h&&t-l>=s}function f(){var t=Ei();if(u(t))return m(t);o=setTimeout(f,function(t){var i=e-(t-c);return h?Li(i,s-(t-l)):i}(t))}function m(t){return o=void 0,p&&r?g(t):(r=a=void 0,n)}function v(){var t=Ei(),i=u(t);if(r=arguments,a=this,c=t,i){if(void 0===o)return function(t){return l=t,o=setTimeout(f,e),d?g(t):n}(c);if(h)return clearTimeout(o),o=setTimeout(f,e),g(c)}return void 0===o&&(o=setTimeout(f,e)),n}return e=Ci(e)||0,mi(i)&&(d=!!i.leading,s=(h="maxWait"in i)?Ti(Ci(i.maxWait)||0,e):s,p="trailing"in i?!!i.trailing:p),v.cancel=function(){void 0!==o&&clearTimeout(o),l=0,r=c=a=o=void 0},v.flush=function(){return void 0===o?n:m(Ei())},v}const Ri=t=>{let e=null;try{const i=JSON.parse(t.message),{target:r,message:a}=i;e=void 0===r||void 0===a?t:Object.assign(Object.assign({},t),{targetUserIds:r,message:a})}catch(i){e=t}return e};function Ai(t,e){return t.localeCompare(e)}function Di(t){return t.sort(((t,e)=>t.localeCompare(e))).join("_")}function Mi(t,e){if(null==t)return!0;for(const i of t)if("file"===i.kind){const t=i.getAsFile();i.type.startsWith("image/")?e("image",t):e("file",t)}}const Ii="dm__";function Oi(t){return t.isDirectMessage}function Ui(t){return[...new Set(t)].sort(Ai).join("<>")}function $i(t){return t.split("").reverse().join("")}const Fi=/^\*([^*\s]+)\*/,ji=/^_([^_\s]+)_/,zi=/^~([^~\s]+)~/,Ni=/https?:\/\/(www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_\+.,~#?&//=]*)/,Bi=/<blockquote>[.\s\S]*<\/blockquote>\n\n/m;function Hi(t,e=!1){if(!Bi.test(t))return"";let i=0,r=13;return e&&(i=12,r=0),t.substring(t.indexOf("<blockquote>")+i,t.indexOf("</blockquote>")+r)}function Gi(t){return t.replace(Bi,"")}const Vi=2e3,qi=["<a>","<b>","<i>","<q>","<s>"];function Ki(t){t=(t=t.split(" ").map((t=>{if(Ni.test(t)){const e=Ni.exec(t);t=t.replace(e[0],`<a>${e[0]}</a>`)}else{if(Fi.test(t)){const e=Fi.exec(t);t=t.replace(e[0],`<b>${e[1]}</b>`)}if(ji.test(t)){const e=ji.exec(t);t=t.replace(e[0],`<i>${e[1]}</i>`)}if(zi.test(t)){const e=zi.exec(t);t=t.replace(e[0],`<s>${e[1]}</s>`)}}return t})).join(" ")).split(" ").map(((t,e)=>">"!==t||0!==e&&">"!==t[e-1]?t:"<q></q>")).join(" ");const[e]=Wi(t);return e}function Wi(t,e=""){const i=[];if(0===t.length)return[i,0];let r=0;for(;r<t.length;){if(e.length&&e===t.substring(r,r+e.length))return[i,r+e.length];if(qi.includes(t.substring(r,r+3))){const[e,a]=Wi(t.substring(r+3),`</${t[r+1]}>`);i.push({type:t[r+1],content:1===e.length&&"plain_text"===e[0].type?e[0].content:e}),r+=a+3}else{let e=i[i.length-1];e&&"plain_text"===e.type||(i.push({type:"plain_text",content:""}),e=i[i.length-1]),e.content+=t[r],r++}}return[i,r]}const Yi=(t,e)=>{const i=e.getTime()-t.getTime();return Math.round(Math.abs(i/1e3/60))},Zi=(t,e)=>{const i=Yi(t,e);if(i<2)return"just now";if(i<60)return`${i}m ago`;const r=Math.round(i/60);if(i<90)return`about ${r}h ago`;if(r<24)return`${r}h ago`;const a=Math.round(r/24);if(a<7)return`${a}d ago`;return`${Math.round(a/7)}w ago`},Qi=t=>t.toDateString()+" "+t.toLocaleTimeString(),Ji=({name:t,time:e,now:i})=>N("div",{class:"head"},N("div",{class:"name"},Qe(ti(t),20)),N("div",{class:"time",title:Qi(e)},Zi(e,i))),Xi=(t,e=!0)=>{null!=t&&t.scrollTo({top:t.scrollHeight,behavior:e?"smooth":"auto"})},tr=({element:t,size:e,states:i={},config:r={}})=>{let a=[];const s=null==r?void 0:r.root[t],n=t=>{a.push(t),"string"==typeof e&&a.push(`${t}.${e}`)};if(n(t),"object"==typeof s&&!Array.isArray(s)&&null!==s){const{state:e,states:r}=s;let a=t,o=[];if(Array.isArray(r)){o=r.filter((t=>i[t])),o.sort();for(const t of o)n(`${a}.${t}`);if(o.length>1){n([a,...o].join("."))}}if("string"==typeof e){const r=`${t}[${e}=${i[e]}]`;n(r);for(const t of o)n(`${r}.${t}`);if(o.length>1){n([r,...o].join("."))}}}return a},er=({selectors:t,root:e})=>{if(!e||!Array.isArray(t))return[];let i=[];for(const r of t){const t=e[r];if(Array.isArray(t))i=[...t];else if(t){if(t.children&&(i=[...t.children]),Array.isArray(t.remove))for(const e of t.remove)i=i.filter((t=>"string"==typeof t?t!==e:!Array.isArray(t)||t[0]!==e));if(t.addBefore)for(const[e,r]of Object.entries(t.addBefore)){const t=i.findIndex((t=>"string"==typeof t?t===e:!!Array.isArray(t)&&t[0]===e));t>=0&&i.splice(t,0,...r)}Array.isArray(t.add)&&(i=i.concat(t.add)),Array.isArray(t.prepend)&&(i=t.prepend.concat(i))}}return i},ir=({elements:t,defaults:e,props:i={},deepProps:r=!1,elementProps:a={}})=>Array.isArray(t)&&0!==t.length?t.map((t=>N(rr,{element:t,defaults:e,props:i,childProps:r&&i,elementProps:a}))):null,rr=({element:t,defaults:e,childProps:i={},props:r={},onlyChildren:a=!1,asHost:s=!1,deepProps:n=!1,elementProps:o={}},c)=>{var l;const{config:d,size:h,states:p}=e;let g,u={},f=[];Array.isArray(t)?[g,u,...f]=t:g=t;const m=null===(l=null==d?void 0:d.root)||void 0===l?void 0:l[g];null!=m&&"props"in m&&(r=Object.assign(Object.assign({},m.props),r)),r=Object.assign(Object.assign({},r),u),g in o&&(r=Object.assign(Object.assign({},r),o[g]));const v=tr({element:g,size:h,states:p,config:d}),b=er({selectors:v,root:d.root});if(a)return N(ir,{elements:b,defaults:e,props:i,deepProps:n,elementProps:o});const k=(({selectors:t,styles:e})=>{if(!Array.isArray(t)||null==e)return{};const i={};for(const r of t){const t=e[r];null!=t&&Object.assign(i,t)}return i})({selectors:v,styles:d.styles});if(s)return N(H,Object.assign({},e,{style:k},r),N(ir,{elements:b,defaults:e,props:i,deepProps:n,elementProps:o}),c,f.map((t=>{if(Array.isArray(t)){const[i,r]=t;return N(i,Object.assign({},e,r))}return t})));if(["rtk-header","rtk-controlbar"].includes(g)&&(r.disableRender=!0),g.startsWith("rtk-"))return N(g,Object.assign({},e,{style:k},r),N(ir,{elements:b,defaults:e,props:i,deepProps:n,elementProps:o}),c,f.map((t=>{if(Array.isArray(t)){const[i,r]=t;return N(i,Object.assign({},e,r))}return t})));{const[t,a]=g.split("#");return N(t,Object.assign({id:a,style:k},r),N(ir,{elements:b,defaults:e,props:i,deepProps:n,elementProps:o}),c,f.map((t=>{if(Array.isArray(t)){const[i,r]=t;return N(i,Object.assign({},e,r))}return t})))}},ar=t=>t.split(/[#?]/)[0].split(".").pop().trim(),sr=t=>{if(!t)return"0 B";const e=Math.floor(Math.log(t)/Math.log(1024));return`${(t/1024**e).toFixed(2)} ${["B","kB","MB","GB","TB"][e]}`},nr=async(t,e)=>{t=Xe(t);let i=null==e?void 0:e.name;const r=await fetch(t);if(!r.ok)return void window.open(t,"_blank");const a=URL.createObjectURL(await r.blob()),s=document.createElement("a");s.href=a,s.download=null!=i?i:((t,e="file")=>{try{const i=new URL(t).pathname.split("/").pop();return"/"!==i?i:e}catch(t){return e}})(t,null==e?void 0:e.fallbackName),s.click()};function or(t,e){return t===e||t!=t&&e!=e}function cr(t,e){for(var i=t.length;i--;)if(or(t[i][0],e))return i;return-1}var lr=Array.prototype.splice;function dr(t){var e=-1,i=null==t?0:t.length;for(this.clear();++e<i;){var r=t[e];this.set(r[0],r[1])}}dr.prototype.clear=function(){this.__data__=[],this.size=0},dr.prototype.delete=function(t){var e=this.__data__,i=cr(e,t);return!(i<0)&&(i==e.length-1?e.pop():lr.call(e,i,1),--this.size,!0)},dr.prototype.get=function(t){var e=this.__data__,i=cr(e,t);return i<0?void 0:e[i][1]},dr.prototype.has=function(t){return cr(this.__data__,t)>-1},dr.prototype.set=function(t,e){var i=this.__data__,r=cr(i,t);return r<0?(++this.size,i.push([t,e])):i[r][1]=e,this};function hr(t){if(!mi(t))return!1;var e=fi(t);return"[object Function]"==e||"[object GeneratorFunction]"==e||"[object AsyncFunction]"==e||"[object Proxy]"==e}const pr=oi["__core-js_shared__"];var gr,ur=(gr=/[^.]+$/.exec(pr&&pr.keys&&pr.keys.IE_PROTO||""))?"Symbol(src)_1."+gr:"";var fr=Function.prototype.toString;function mr(t){if(null!=t){try{return fr.call(t)}catch(t){}try{return t+""}catch(t){}}return""}var vr=/^\[object .+?Constructor\]$/,br=Function.prototype,kr=Object.prototype,yr=br.toString,wr=kr.hasOwnProperty,xr=RegExp("^"+yr.call(wr).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Sr(t){return!(!mi(t)||(e=t,ur&&ur in e))&&(hr(t)?xr:vr).test(mr(t));var e}function Pr(t,e){var i=function(t,e){return null==t?void 0:t[e]}(t,e);return Sr(i)?i:void 0}const Cr=Pr(oi,"Map");const Er=Pr(Object,"create");var Tr=Object.prototype.hasOwnProperty;var Lr=Object.prototype.hasOwnProperty;function _r(t){var e=-1,i=null==t?0:t.length;for(this.clear();++e<i;){var r=t[e];this.set(r[0],r[1])}}function Rr(t,e){var i,r,a=t.__data__;return("string"==(r=typeof(i=e))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==i:null===i)?a["string"==typeof e?"string":"hash"]:a.map}function Ar(t){var e=-1,i=null==t?0:t.length;for(this.clear();++e<i;){var r=t[e];this.set(r[0],r[1])}}_r.prototype.clear=function(){this.__data__=Er?Er(null):{},this.size=0},_r.prototype.delete=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e},_r.prototype.get=function(t){var e=this.__data__;if(Er){var i=e[t];return"__lodash_hash_undefined__"===i?void 0:i}return Tr.call(e,t)?e[t]:void 0},_r.prototype.has=function(t){var e=this.__data__;return Er?void 0!==e[t]:Lr.call(e,t)},_r.prototype.set=function(t,e){var i=this.__data__;return this.size+=this.has(t)?0:1,i[t]=Er&&void 0===e?"__lodash_hash_undefined__":e,this},Ar.prototype.clear=function(){this.size=0,this.__data__={hash:new _r,map:new(Cr||dr),string:new _r}},Ar.prototype.delete=function(t){var e=Rr(this,t).delete(t);return this.size-=e?1:0,e},Ar.prototype.get=function(t){return Rr(this,t).get(t)},Ar.prototype.has=function(t){return Rr(this,t).has(t)},Ar.prototype.set=function(t,e){var i=Rr(this,t),r=i.size;return i.set(t,e),this.size+=i.size==r?0:1,this};function Dr(t){var e=this.__data__=new dr(t);this.size=e.size}Dr.prototype.clear=function(){this.__data__=new dr,this.size=0},Dr.prototype.delete=function(t){var e=this.__data__,i=e.delete(t);return this.size=e.size,i},Dr.prototype.get=function(t){return this.__data__.get(t)},Dr.prototype.has=function(t){return this.__data__.has(t)},Dr.prototype.set=function(t,e){var i=this.__data__;if(i instanceof dr){var r=i.__data__;if(!Cr||r.length<199)return r.push([t,e]),this.size=++i.size,this;i=this.__data__=new Ar(r)}return i.set(t,e),this.size=i.size,this};var Mr=function(){try{var t=Pr(Object,"defineProperty");return t({},"",{}),t}catch(t){}}();const Ir=Mr;function Or(t,e,i){"__proto__"==e&&Ir?Ir(t,e,{configurable:!0,enumerable:!0,value:i,writable:!0}):t[e]=i}var Ur="object"==typeof t&&t&&!t.nodeType&&t,$r=Ur&&"object"==typeof module&&module&&!module.nodeType&&module,Fr=$r&&$r.exports===Ur?oi.Buffer:void 0,jr=Fr?Fr.allocUnsafe:void 0;function zr(t,e){if(e)return t.slice();var i=t.length,r=jr?jr(i):new t.constructor(i);return t.copy(r),r}const Nr=oi.Uint8Array;function Br(t){var e=new t.constructor(t.byteLength);return new Nr(e).set(new Nr(t)),e}function Hr(t,e){var i=e?Br(t.buffer):t.buffer;return new t.constructor(i,t.byteOffset,t.length)}var Gr=Object.create;const Vr=function(){function t(){}return function(e){if(!mi(e))return{};if(Gr)return Gr(e);t.prototype=e;var i=new t;return t.prototype=void 0,i}}();function qr(t,e){return function(i){return t(e(i))}}const Kr=qr(Object.getPrototypeOf,Object);var Wr=Object.prototype;function Yr(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||Wr)}function Zr(t){return"function"!=typeof t.constructor||Yr(t)?{}:Vr(Kr(t))}function Qr(t){return vi(t)&&"[object Arguments]"==fi(t)}var Jr=Object.prototype,Xr=Jr.hasOwnProperty,ta=Jr.propertyIsEnumerable,ea=Qr(function(){return arguments}())?Qr:function(t){return vi(t)&&Xr.call(t,"callee")&&!ta.call(t,"callee")};const ia=ea;const ra=Array.isArray;function aa(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=9007199254740991}function sa(t){return null!=t&&aa(t.length)&&!hr(t)}var na="object"==typeof t&&t&&!t.nodeType&&t,oa=na&&"object"==typeof module&&module&&!module.nodeType&&module,ca=oa&&oa.exports===na?oi.Buffer:void 0;const la=(ca?ca.isBuffer:void 0)||function(){return!1};var da={};function ha(t){return function(e){return t(e)}}da["[object Float32Array]"]=da["[object Float64Array]"]=da["[object Int8Array]"]=da["[object Int16Array]"]=da["[object Int32Array]"]=da["[object Uint8Array]"]=da["[object Uint8ClampedArray]"]=da["[object Uint16Array]"]=da["[object Uint32Array]"]=!0,da["[object Arguments]"]=da["[object Array]"]=da["[object ArrayBuffer]"]=da["[object Boolean]"]=da["[object DataView]"]=da["[object Date]"]=da["[object Error]"]=da["[object Function]"]=da["[object Map]"]=da["[object Number]"]=da["[object Object]"]=da["[object RegExp]"]=da["[object Set]"]=da["[object String]"]=da["[object WeakMap]"]=!1;var pa="object"==typeof t&&t&&!t.nodeType&&t,ga=pa&&"object"==typeof module&&module&&!module.nodeType&&module,ua=ga&&ga.exports===pa&&si.process;const fa=function(){try{var t=ga&&ga.require&&ga.require("util").types;return t||ua&&ua.binding&&ua.binding("util")}catch(t){}}();var ma=fa&&fa.isTypedArray;const va=ma?ha(ma):function(t){return vi(t)&&aa(t.length)&&!!da[fi(t)]};var ba=Object.prototype.hasOwnProperty;function ka(t,e,i){var r=t[e];ba.call(t,e)&&or(r,i)&&(void 0!==i||e in t)||Or(t,e,i)}var ya=/^(?:0|[1-9]\d*)$/;function wa(t,e){var i=typeof t;return!!(e=null==e?9007199254740991:e)&&("number"==i||"symbol"!=i&&ya.test(t))&&t>-1&&t%1==0&&t<e}var xa=Object.prototype.hasOwnProperty;function Sa(t,e){var i=ra(t),r=!i&&ia(t),a=!i&&!r&&la(t),s=!i&&!r&&!a&&va(t),n=i||r||a||s,o=n?function(t,e){for(var i=-1,r=Array(t);++i<t;)r[i]=e(i);return r}(t.length,String):[],c=o.length;for(var l in t)!e&&!xa.call(t,l)||n&&("length"==l||a&&("offset"==l||"parent"==l)||s&&("buffer"==l||"byteLength"==l||"byteOffset"==l)||wa(l,c))||o.push(l);return o}var Pa=Object.prototype.hasOwnProperty;function Ca(t){if(!mi(t))return function(t){var e=[];if(null!=t)for(var i in Object(t))e.push(i);return e}(t);var e=Yr(t),i=[];for(var r in t)("constructor"!=r||!e&&Pa.call(t,r))&&i.push(r);return i}function Ea(t){return sa(t)?Sa(t,!0):Ca(t)}const Ta=[0,.5,1,1.5,2,3,4,5,6,7,8,9,10,12,14,16,20,24,28,32,36,40,44,48,52,56,60,64,72,80,96],La={darkest:{background:{1e3:"#080808",900:"#1A1A1A",800:"#1E1E1E",700:"#2C2C2C",600:"#393939"},text:"#FFFFFF"},dark:{background:{1e3:"#252525",900:"#2F2F2F",800:"#323232",700:"#3E3E3E",600:"#4A4A4A"},text:"#F5F5F5","video-bg":"#1C1C1C"},light:{background:{1e3:"#FFFFFF",900:"#F5F5F5",800:"#EBEBEB",700:"#E0E0E0",600:"#D6D6D6"},text:"#111111","text-on-brand":"#ffffff","video-bg":"#DADADA"}},_a={none:{none:0,sm:0,md:0,lg:0},thin:{none:0,sm:1,md:2,lg:4},fat:{none:0,sm:2,md:4,lg:8}},Ra={sharp:{none:0,sm:0,md:0,lg:0},rounded:{none:0,sm:4,md:8,lg:12},"extra-rounded":{none:0,sm:8,md:16,lg:24},circular:{none:9999,sm:9999,md:9999,lg:9999}};function Aa(t){let e="0",i="0",r="0";return 4==(t=t.trim()).length?(e="0x"+t[1]+t[1],i="0x"+t[2]+t[2],r="0x"+t[3]+t[3]):t.length>6&&(e="0x"+t[1]+t[2],i="0x"+t[3]+t[4],r="0x"+t[5]+t[6]),[+e,+i,+r]}const Da=t=>"string"==typeof t&&7===t.length&&t.startsWith("#"),Ma="--rtk-";function Ia(t,e=Ma){return e+t}const Oa=(t,e,i=Ma)=>{Object.keys(e).forEach((r=>{const a=e[r];if("string"==typeof a)if("text"===r||"text-on-brand"===r){const e=Aa(a).join(" ");t.style.setProperty(Ia(`colors-${r}-1000`,i),`${e}`),t.style.setProperty(Ia(`colors-${r}-900`,i),`${e} / 0.88`),t.style.setProperty(Ia(`colors-${r}-800`,i),`${e} / 0.76`),t.style.setProperty(Ia(`colors-${r}-700`,i),`${e} / 0.64`),t.style.setProperty(Ia(`colors-${r}-600`,i),`${e} / 0.52`)}else{const e=Aa(a).join(" ");t.style.setProperty(Ia(`colors-${r}`,i),e)}else"object"==typeof a&&Object.keys(a).forEach((e=>{const s=Aa(a[e]).join(" ");t.style.setProperty(Ia(`colors-${r}-${e}`,i),s)}))}))},Ua=(t,{spacingBase:e,borderRadius:i,borderWidth:r,colors:a,fontFamily:s,googleFont:n,theme:o,tokenPrefix:c=Ma})=>{if("object"!=typeof t)throw new Error("[rtk-ui-kit] (provideRtkDesignSystem): Passed element is not a valid HTML Element");if("string"==typeof n&&((t=>{const e=[];if(null==document.querySelector("link[data-rtk-font]")){const t=document.createElement("link");t.rel="preconnect",t.setAttribute("data-rtk-font","true"),t.href="https://fonts.googleapis.com";const i=t.cloneNode(!0);i.href="https://fonts.gstatic.com",i.crossOrigin="",e.push(t,i)}const i=document.createElement("link");i.rel="stylesheet",i.setAttribute("data-rtk-font",t),i.href=encodeURI(`https://fonts.googleapis.com/css2?family=${t}:wght@${[400,500,700].join(";")}&display=swap`),e.push(i),document.head.append(...e)})(n),t.style.setProperty(Ia("font-family",c),n)),"string"==typeof s&&t.style.setProperty(Ia("font-family",c),s),"number"==typeof e&&((t,e,i=Ma)=>{Ta.forEach((r=>{t.style.setProperty(Ia(`space-${r}`,i),r*e+"px")}))})(t,e,c),"string"==typeof r&&((t,e,i=Ma)=>{if(e in _a){const r=_a[e];Object.keys(r).forEach((e=>{t.style.setProperty(Ia(`border-width-${e}`,i),`${r[e]}px`)}))}})(t,r,c),"string"==typeof i&&((t,e,i=Ma)=>{if(e in Ra){const r=Ra[e];Object.keys(r).forEach((e=>{t.style.setProperty(Ia(`border-radius-${e}`,i),`${r[e]}px`)}))}})(t,i,c),"string"==typeof o){const e=La[o];null!=e&&Oa(t,e,c)}"object"==typeof a&&Oa(t,a,c)};function $a(t,e,i){(void 0!==i&&!or(t[e],i)||void 0===i&&!(e in t))&&Or(t,e,i)}var Fa=function(t,e,i){for(var r=-1,a=Object(t),s=i(t),n=s.length;n--;){var o=s[++r];if(!1===e(a[o],o,a))break}return t};const ja=Fa;var za=Function.prototype,Na=Object.prototype,Ba=za.toString,Ha=Na.hasOwnProperty,Ga=Ba.call(Object);function Va(t,e){if(("constructor"!==e||"function"!=typeof t[e])&&"__proto__"!=e)return t[e]}function qa(t){return function(t,e,i){var r=!i;i||(i={});for(var a=-1,s=e.length;++a<s;){var n=e[a],o=void 0;void 0===o&&(o=t[n]),r?Or(i,n,o):ka(i,n,o)}return i}(t,Ea(t))}function Ka(t,e,i,r,a,s,n){var o=Va(t,i),c=Va(e,i),l=n.get(c);if(l)$a(t,i,l);else{var d,h=s?s(o,c,i+"",t,e,n):void 0,p=void 0===h;if(p){var g=ra(c),u=!g&&la(c),f=!g&&!u&&va(c);h=c,g||u||f?ra(o)?h=o:vi(d=o)&&sa(d)?h=function(t,e){var i=-1,r=t.length;for(e||(e=Array(r));++i<r;)e[i]=t[i];return e}(o):u?(p=!1,h=zr(c,!0)):f?(p=!1,h=Hr(c,!0)):h=[]:function(t){if(!vi(t)||"[object Object]"!=fi(t))return!1;var e=Kr(t);if(null===e)return!0;var i=Ha.call(e,"constructor")&&e.constructor;return"function"==typeof i&&i instanceof i&&Ba.call(i)==Ga}(c)||ia(c)?(h=o,ia(o)?h=qa(o):mi(o)&&!hr(o)||(h=Zr(c))):p=!1}p&&(n.set(c,h),a(h,c,r,s,n),n.delete(c)),$a(t,i,h)}}function Wa(t,e,i,r,a){t!==e&&ja(e,(function(s,n){if(a||(a=new Dr),mi(s))Ka(t,e,n,i,Wa,r,a);else{var o=r?r(Va(t,n),s,n+"",t,e,a):void 0;void 0===o&&(o=s),$a(t,n,o)}}),Ea)}function Ya(t){return t}var Za=Math.max;var Qa=Ir?function(t,e){return Ir(t,"toString",{configurable:!0,enumerable:!1,value:(i=e,function(){return i}),writable:!0});var i}:Ya;const Ja=Qa;var Xa=Date.now;var ts,es,is,rs=(ts=Ja,es=0,is=0,function(){var t=Xa(),e=16-(t-is);if(is=t,e>0){if(++es>=800)return arguments[0]}else es=0;return ts.apply(void 0,arguments)});const as=rs;function ss(t,e){return as(function(t,e,i){return e=Za(void 0===e?t.length-1:e,0),function(){for(var r=arguments,a=-1,s=Za(r.length-e,0),n=Array(s);++a<s;)n[a]=r[e+a];a=-1;for(var o=Array(e+1);++a<e;)o[a]=r[a];return o[e]=i(n),function(t,e,i){switch(i.length){case 0:return t.call(e);case 1:return t.call(e,i[0]);case 2:return t.call(e,i[0],i[1]);case 3:return t.call(e,i[0],i[1],i[2])}return t.apply(e,i)}(t,this,o)}}(t,e,Ya),t+"")}var ns,os=(ns=function(t,e,i){Wa(t,e,i)},ss((function(t,e){var i=-1,r=e.length,a=r>1?e[r-1]:void 0,s=r>2?e[2]:void 0;for(a=ns.length>3&&"function"==typeof a?(r--,a):void 0,s&&function(t,e,i){if(!mi(i))return!1;var r=typeof e;return!!("number"==r?sa(i)&&wa(e,i.length):"string"==r&&e in i)&&or(i[e],t)}(e[0],e[1],s)&&(a=r<3?void 0:a,r=1),t=Object(t);++i<r;){var n=e[i];n&&ns(t,n,i,a)}return t})));const cs=os,ls=(t,e,i={},r={grid_pagination:!0,settings_toggle:!0})=>{var a,s,n,o,c,l,d,h,p,g,u,f,m,v,b,k,y,w;const x={showSetupScreen:!0};let S,P=["rtk-stage"],C={},E={};const T=!1!==(null==r?void 0:r.settings_toggle),L=!1!==(null==r?void 0:r.grid_pagination);if(null===(a=t.controlBar)||void 0===a?void 0:a.isEnabled){P.push("rtk-controlbar");const{elements:i}=t.controlBar,r=[...i.fullscreen?["rtk-fullscreen-toggle"]:[],...T?["rtk-settings-toggle"]:[]],a=[],h=[];(null===(s=e.participants.pip)||void 0===s?void 0:s.isSupported())&&(null===(o=null===(n=e.self)||void 0===n?void 0:n.config)||void 0===o?void 0:o.pipMode)&&"LIVESTREAM"!==(null===(c=e.self.config)||void 0===c?void 0:c.viewType)&&h.push("rtk-pip-toggle"),(null==e?void 0:e.self.permissions.canDisableParticipantAudio)&&h.push("rtk-mute-all-button"),h.push("rtk-breakout-rooms-toggle"),(null===(l=e.self)||void 0===l?void 0:l.permissions.canRecord)&&h.push("rtk-recording-toggle"),null!==(d=e.self.permissions.transcriptionEnabled)&&void 0!==d&&d&&h.push("rtk-caption-toggle"),"ReactNative"!==navigator.product&&h.push("rtk-debugger-toggle"),Zt(e)&&r.push("rtk-livestream-toggle"),i.screenshare&&r.push("rtk-screen-share-toggle"),i.chat&&a.push("rtk-chat-toggle"),i.polls&&a.push("rtk-polls-toggle"),i.participants&&a.push("rtk-participants-toggle"),i.plugins&&a.push("rtk-plugins-toggle"),a.push("rtk-ai-toggle");const p=["rtk-mic-toggle","rtk-camera-toggle","rtk-stage-toggle","rtk-leave-button"];h.length>0&&p.push("rtk-more-toggle");const g=r.concat(a).concat(h);let u=!1;g.length>0&&(u=!0),E={"rtk-controlbar":{states:["activeMoreMenu"],children:["div#controlbar-left","div#controlbar-center","div#controlbar-right"]},"div#controlbar-left":r,"div#controlbar-center":p,"div#controlbar-right":a,"rtk-more-toggle":{states:["activeMoreMenu"],children:[]},"rtk-more-toggle.activeMoreMenu":h.map((t=>[t,{variant:"horizontal",slot:"more-elements"}])),"rtk-controlbar.sm":["div#controlbar-mobile"],"rtk-controlbar.md":["div#controlbar-mobile"],"rtk-more-toggle.activeMoreMenu.md":g.map((t=>[t,{variant:"horizontal",slot:"more-elements"}])),"rtk-more-toggle.activeMoreMenu.sm":g.map((t=>[t,{variant:"horizontal",slot:"more-elements"}])),"div#controlbar-mobile":["rtk-mic-toggle","rtk-camera-toggle","rtk-stage-toggle",u&&"rtk-more-toggle","rtk-leave-button"]}}if(null===(h=t.header)||void 0===h?void 0:h.isEnabled){P.unshift("rtk-header");const{elements:e}=t.header;let i=["rtk-recording-indicator","rtk-livestream-indicator"],r=[],a=[];L&&a.push("rtk-grid-pagination"),e.title&&r.push("rtk-meeting-title"),"string"==typeof e.logo&&e.logo.length>0&&(S=e.logo,i.unshift("rtk-logo")),e.participantCount&&a.push("rtk-participant-count","rtk-viewer-count"),e.timer&&a.push("rtk-clock"),C={"rtk-header":["div#header-left","div#header-center","div#header-right"],"rtk-header.sm":{remove:["div#header-center"]},"div#header-left":i,"div#header-center":r,"div#header-right":a,"div#header-left.sm":{remove:["rtk-logo"],prepend:["rtk-meeting-title"]}}}P.push("rtk-participants-audio","rtk-dialog-manager");let _={logo:S};_=t.designTokens,Da(null===(g=null===(p=null==t?void 0:t.designTokens)||void 0===p?void 0:p.colors)||void 0===g?void 0:g.textOnBrand)&&(_.colors["text-on-brand"]=null===(f=null===(u=null==t?void 0:t.designTokens)||void 0===u?void 0:u.colors)||void 0===f?void 0:f.textOnBrand),Da(null===(v=null===(m=null==t?void 0:t.designTokens)||void 0===m?void 0:m.colors)||void 0===v?void 0:v.videoBg)&&(_.colors["video-bg"]=null===(k=null===(b=null==t?void 0:t.designTokens)||void 0===b?void 0:b.colors)||void 0===k?void 0:k.videoBg);let R={designTokens:_,styles:{"rtk-header":{display:"grid",height:"48px",gridTemplateColumns:"repeat(3, 1fr)",gridTemplateRows:"1fr",alignItems:"center","--header-section-gap":"var(--rtk-space-2, 8px)"},"rtk-header.sm":{display:"grid",gridArea:"header",gridTemplateColumns:"repeat(2, 1fr)",gridTemplateRows:"1fr",alignItems:"center","--header-section-gap":"var(--rtk-space-1, 4px)"},"div#header-left":{display:"flex",alignItems:"center",height:"48px",wordBreak:"break-all",gap:"var(--header-section-gap)"},"rtk-logo":{height:"26px"},"div#header-center":{display:"flex",alignItems:"center",justifyContent:"center",wordBreak:"break-all",gap:"var(--header-section-gap)",paddingInline:"var(--rtk-space-3, 12px)"},"div#header-right":{display:"flex",alignItems:"center",justifyContent:"flex-end",gap:"var(--header-section-gap)"},"rtk-stage":{display:"flex",flex:"1"},"rtk-grid":{flex:"1",height:"auto"},"rtk-controlbar":{display:"grid",gridTemplateColumns:"repeat(3,1fr)",gridTemplateRows:"1fr",alignItems:"center",padding:"8px"},"rtk-controlbar.sm":{display:"flex",position:"relative",backgroundColor:"var(--rtk-colors-background-1000, #000)"},"rtk-controlbar.md":{display:"flex",position:"relative",backgroundColor:"var(--rtk-colors-background-1000, #000)"},"div#controlbar-left":{display:"flex",alignItems:"center",gap:"var(--rtk-space-1, 4px)"},"div#controlbar-center":{display:"flex",alignItems:"center",position:"relative",overflow:"visible",justifyContent:"center",gap:"var(--rtk-space-1, 4px)"},"div#controlbar-mobile":{display:"flex",flex:"1",alignItems:"center",justifyContent:"center",zIndex:"10000",gap:"var(--rtk-space-1, 4px)"},"div#controlbar-right":{display:"flex",alignItems:"center",justifyContent:"flex-end",gap:"var(--rtk-space-1, 4px)"},"rtk-settings":{width:"720px",height:"480px"},"rtk-debugger":{width:"720px",height:"480px"},"div#setupcontrols-indicator":{position:"absolute",bottom:"12px",left:"12px",display:"flex",gap:"6px",background:"rgb(var(--rtk-colors-background-800, 0 0 0))",borderRadius:"100%"},"div#setupcontrols-media":{position:"absolute",bottom:"8px",right:"8px",display:"flex",gap:"6px"},"div#setupcontrols-settings":{position:"absolute",top:"8px",right:"8px",display:"flex",flexDirection:"column",gap:"6px"},"rtk-meeting-title.sm":{marginLeft:"0"},"rtk-clock":{marginRight:"0"}},root:Object.assign(Object.assign(Object.assign({"rtk-meeting":{state:"meeting",states:["activeSidebar","activeAI"]},"rtk-meeting[meeting=idle]":["rtk-idle-screen"],"rtk-meeting[meeting=waiting]":["rtk-waiting-screen"],"rtk-meeting[meeting=setup]":["rtk-setup-screen","rtk-dialog-manager"],"rtk-meeting[meeting=joined]":P,"rtk-meeting[meeting=joined].activeSidebar.sm":{add:[["rtk-sidebar",{view:"full-screen"}]]},"rtk-meeting[meeting=joined].activeSidebar.md":{add:[["rtk-sidebar",{view:"full-screen"}]]},"rtk-meeting[meeting=joined].activeAI.sm":{add:[["rtk-ai",{view:"full-screen"}]]},"rtk-meeting[meeting=joined].activeAI.md":{add:[["rtk-ai",{view:"full-screen"}]]},"rtk-meeting[meeting=ended]":["rtk-ended-screen"]},C),E),{"rtk-stage":{states:["activeSidebar","activeAI"],children:["rtk-grid","rtk-notifications","rtk-transcripts"]},"rtk-stage.activeSidebar":{add:[["rtk-sidebar",{view:"sidebar"}]]},"rtk-stage.activeSidebar.sm":{remove:["rtk-sidebar"]},"rtk-stage.activeAI":{add:[["rtk-ai",{view:"sidebar"}]]},"rtk-stage.activeAI.sm":{remove:["rtk-ai"]},"rtk-grid":{states:["activeScreenShare","activePlugin","activeSpotlight"],state:"viewType",children:["rtk-simple-grid"]},"rtk-grid[viewType=AUDIO_ROOM]":["rtk-audio-grid"],"rtk-grid[viewType=AUDIO_ROOM].activePlugin":["rtk-mixed-grid"],"rtk-grid[viewType=AUDIO_ROOM].activeScreenshare":["rtk-mixed-grid"],"rtk-grid[viewType=AUDIO_ROOM].activeScreenShare.activeSpotlight":["rtk-mixed-grid"],"rtk-grid[viewType=AUDIO_ROOM].activePlugin.activeSpotlight":["rtk-mixed-grid"],"rtk-grid[viewType=AUDIO_ROOM].activePlugin.activeScreenShare.activeSpotlight":["rtk-mixed-grid"],"rtk-grid.activeSpotlight":["rtk-spotlight-grid"],"rtk-grid.activeScreenShare":["rtk-mixed-grid"],"rtk-grid.activePlugin":["rtk-mixed-grid"],"rtk-grid.activeScreenShare.activeSpotlight":["rtk-mixed-grid"],"rtk-grid.activePlugin.activeSpotlight":["rtk-mixed-grid"],"rtk-grid.activePlugin.activeScreenShare.activeSpotlight":["rtk-mixed-grid"],"rtk-mixed-grid":{states:["activeSpotlight"],state:"viewType",children:["rtk-simple-grid"]},"rtk-mixed-grid[viewType=AUDIO_ROOM]":["rtk-audio-grid"],"rtk-mixed-grid.activeSpotlight":["rtk-spotlight-grid"],"rtk-participant-tile":{state:"meeting",children:["rtk-name-tag","rtk-avatar","rtk-network-indicator"]},"rtk-participant-setup":["rtk-avatar","div#setupcontrols-media"],"rtk-participant-tile[meeting=setup]":["rtk-avatar","div#setupcontrols-indicator","div#setupcontrols-media",...T?["div#setupcontrols-settings"]:[]],"div#setupcontrols-indicator":[["rtk-audio-visualizer",{slot:"start",hideMuted:!0}]],"div#setupcontrols-media":[["rtk-mic-toggle",{size:"sm"}],["rtk-camera-toggle",{size:"sm"}]],"div#setupcontrols-settings":[["rtk-settings-toggle",{size:"sm"}]],"rtk-screenshare-view":["rtk-name-tag","rtk-network-indicator"],"rtk-name-tag":[["rtk-audio-visualizer",{slot:"start"}]]}),config:{notification_sounds:{participant_left:!1},participant_joined_sound_notification_limit:3,participant_chat_message_sound_notification_limit:10,videoFit:"cover"}};return R=((t,e=De)=>{let i=Object.assign({},e);return cs(i,t),i})(i,R),x.showSetupScreen=null===(w=null===(y=t.setupScreen)||void 0===y?void 0:y.isEnabled)||void 0===w||w,{config:R,data:x}},ds=768,hs=1080,ps=t=>t>=hs?"lg":t>=ds?"md":"sm";var gs=function(){if("undefined"!=typeof Map)return Map;function t(t,e){var i=-1;return t.some((function(t,r){return t[0]===e&&(i=r,!0)})),i}return function(){function e(){this.__entries__=[]}return Object.defineProperty(e.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),e.prototype.get=function(e){var i=t(this.__entries__,e),r=this.__entries__[i];return r&&r[1]},e.prototype.set=function(e,i){var r=t(this.__entries__,e);~r?this.__entries__[r][1]=i:this.__entries__.push([e,i])},e.prototype.delete=function(e){var i=this.__entries__,r=t(i,e);~r&&i.splice(r,1)},e.prototype.has=function(e){return!!~t(this.__entries__,e)},e.prototype.clear=function(){this.__entries__.splice(0)},e.prototype.forEach=function(t,e){void 0===e&&(e=null);for(var i=0,r=this.__entries__;i<r.length;i++){var a=r[i];t.call(e,a[1],a[0])}},e}()}(),us="undefined"!=typeof window&&"undefined"!=typeof document&&window.document===document,fs="undefined"!=typeof global&&global.Math===Math?global:"undefined"!=typeof self&&self.Math===Math?self:"undefined"!=typeof window&&window.Math===Math?window:Function("return this")(),ms="function"==typeof requestAnimationFrame?requestAnimationFrame.bind(fs):function(t){return setTimeout((function(){return t(Date.now())}),1e3/60)};var vs=["top","right","bottom","left","width","height","size","weight"],bs="undefined"!=typeof MutationObserver,ks=function(){function t(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=function(t,e){var i=!1,r=!1,a=0;function s(){i&&(i=!1,t()),r&&o()}function n(){ms(s)}function o(){var t=Date.now();if(i){if(t-a<2)return;r=!0}else i=!0,r=!1,setTimeout(n,e);a=t}return o}(this.refresh.bind(this),20)}return t.prototype.addObserver=function(t){~this.observers_.indexOf(t)||this.observers_.push(t),this.connected_||this.connect_()},t.prototype.removeObserver=function(t){var e=this.observers_,i=e.indexOf(t);~i&&e.splice(i,1),!e.length&&this.connected_&&this.disconnect_()},t.prototype.refresh=function(){this.updateObservers_()&&this.refresh()},t.prototype.updateObservers_=function(){var t=this.observers_.filter((function(t){return t.gatherActive(),t.hasActive()}));return t.forEach((function(t){return t.broadcastActive()})),t.length>0},t.prototype.connect_=function(){us&&!this.connected_&&(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),bs?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},t.prototype.disconnect_=function(){us&&this.connected_&&(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},t.prototype.onTransitionEnd_=function(t){var e=t.propertyName,i=void 0===e?"":e;vs.some((function(t){return!!~i.indexOf(t)}))&&this.refresh()},t.getInstance=function(){return this.instance_||(this.instance_=new t),this.instance_},t.instance_=null,t}(),ys=function(t,e){for(var i=0,r=Object.keys(e);i<r.length;i++){var a=r[i];Object.defineProperty(t,a,{value:e[a],enumerable:!1,writable:!1,configurable:!0})}return t},ws=function(t){return t&&t.ownerDocument&&t.ownerDocument.defaultView||fs},xs=Ls(0,0,0,0);function Ss(t){return parseFloat(t)||0}function Ps(t){for(var e=[],i=1;i<arguments.length;i++)e[i-1]=arguments[i];return e.reduce((function(e,i){return e+Ss(t["border-"+i+"-width"])}),0)}function Cs(t){var e=t.clientWidth,i=t.clientHeight;if(!e&&!i)return xs;var r=ws(t).getComputedStyle(t),a=function(t){for(var e={},i=0,r=["top","right","bottom","left"];i<r.length;i++){var a=r[i],s=t["padding-"+a];e[a]=Ss(s)}return e}(r),s=a.left+a.right,n=a.top+a.bottom,o=Ss(r.width),c=Ss(r.height);if("border-box"===r.boxSizing&&(Math.round(o+s)!==e&&(o-=Ps(r,"left","right")+s),Math.round(c+n)!==i&&(c-=Ps(r,"top","bottom")+n)),!function(t){return t===ws(t).document.documentElement}(t)){var l=Math.round(o+s)-e,d=Math.round(c+n)-i;1!==Math.abs(l)&&(o-=l),1!==Math.abs(d)&&(c-=d)}return Ls(a.left,a.top,o,c)}var Es="undefined"!=typeof SVGGraphicsElement?function(t){return t instanceof ws(t).SVGGraphicsElement}:function(t){return t instanceof ws(t).SVGElement&&"function"==typeof t.getBBox};function Ts(t){return us?Es(t)?function(t){var e=t.getBBox();return Ls(0,0,e.width,e.height)}(t):Cs(t):xs}function Ls(t,e,i,r){return{x:t,y:e,width:i,height:r}}var _s=function(){function t(t){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=Ls(0,0,0,0),this.target=t}return t.prototype.isActive=function(){var t=Ts(this.target);return this.contentRect_=t,t.width!==this.broadcastWidth||t.height!==this.broadcastHeight},t.prototype.broadcastRect=function(){var t=this.contentRect_;return this.broadcastWidth=t.width,this.broadcastHeight=t.height,t},t}(),Rs=function(t,e){var i,r,a,s,n,o,c,l=(r=(i=e).x,a=i.y,s=i.width,n=i.height,o="undefined"!=typeof DOMRectReadOnly?DOMRectReadOnly:Object,c=Object.create(o.prototype),ys(c,{x:r,y:a,width:s,height:n,top:a,right:r+s,bottom:n+a,left:r}),c);ys(this,{target:t,contentRect:l})},As=function(){function t(t,e,i){if(this.activeObservations_=[],this.observations_=new gs,"function"!=typeof t)throw new TypeError("The callback provided as parameter 1 is not a function.");this.callback_=t,this.controller_=e,this.callbackCtx_=i}return t.prototype.observe=function(t){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if("undefined"!=typeof Element&&Element instanceof Object){if(!(t instanceof ws(t).Element))throw new TypeError('parameter 1 is not of type "Element".');var e=this.observations_;e.has(t)||(e.set(t,new _s(t)),this.controller_.addObserver(this),this.controller_.refresh())}},t.prototype.unobserve=function(t){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if("undefined"!=typeof Element&&Element instanceof Object){if(!(t instanceof ws(t).Element))throw new TypeError('parameter 1 is not of type "Element".');var e=this.observations_;e.has(t)&&(e.delete(t),e.size||this.controller_.removeObserver(this))}},t.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},t.prototype.gatherActive=function(){var t=this;this.clearActive(),this.observations_.forEach((function(e){e.isActive()&&t.activeObservations_.push(e)}))},t.prototype.broadcastActive=function(){if(this.hasActive()){var t=this.callbackCtx_,e=this.activeObservations_.map((function(t){return new Rs(t.target,t.broadcastRect())}));this.callback_.call(t,e,t),this.clearActive()}},t.prototype.clearActive=function(){this.activeObservations_.splice(0)},t.prototype.hasActive=function(){return this.activeObservations_.length>0},t}(),Ds="undefined"!=typeof WeakMap?new WeakMap:new gs,Ms=function t(e){if(!(this instanceof t))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var i=ks.getInstance(),r=new As(e,i,this);Ds.set(this,r)};["observe","unobserve","disconnect"].forEach((function(t){Ms.prototype[t]=function(){var e;return(e=Ds.get(this))[t].apply(e,arguments)}}));var Is=void 0!==fs.ResizeObserver?fs.ResizeObserver:Ms;const Os=["top","right","bottom","left"],Us=["start","end"],$s=Os.reduce(((t,e)=>t.concat(e,e+"-"+Us[0],e+"-"+Us[1])),[]),Fs=Math.min,js=Math.max,zs=Math.round,Ns=t=>({x:t,y:t}),Bs={left:"right",right:"left",bottom:"top",top:"bottom"},Hs={start:"end",end:"start"};function Gs(t,e,i){return js(t,Fs(e,i))}function Vs(t,e){return"function"==typeof t?t(e):t}function qs(t){return t.split("-")[0]}function Ks(t){return t.split("-")[1]}function Ws(t){return"x"===t?"y":"x"}function Ys(t){return"y"===t?"height":"width"}function Zs(t){return["top","bottom"].includes(qs(t))?"y":"x"}function Qs(t){return Ws(Zs(t))}function Js(t,e,i){void 0===i&&(i=!1);const r=Ks(t),a=Qs(t),s=Ys(a);let n="x"===a?r===(i?"end":"start")?"right":"left":"start"===r?"bottom":"top";return e.reference[s]>e.floating[s]&&(n=tn(n)),[n,tn(n)]}function Xs(t){return t.replace(/start|end/g,(t=>Hs[t]))}function tn(t){return t.replace(/left|right|bottom|top/g,(t=>Bs[t]))}function en(t){return"number"!=typeof t?function(t){return{top:0,right:0,bottom:0,left:0,...t}}(t):{top:t,right:t,bottom:t,left:t}}function rn(t){const{x:e,y:i,width:r,height:a}=t;return{width:r,height:a,top:i,left:e,right:e+r,bottom:i+a,x:e,y:i}}function an(t,e,i){let{reference:r,floating:a}=t;const s=Zs(e),n=Qs(e),o=Ys(n),c=qs(e),l="y"===s,d=r.x+r.width/2-a.width/2,h=r.y+r.height/2-a.height/2,p=r[o]/2-a[o]/2;let g;switch(c){case"top":g={x:d,y:r.y-a.height};break;case"bottom":g={x:d,y:r.y+r.height};break;case"right":g={x:r.x+r.width,y:h};break;case"left":g={x:r.x-a.width,y:h};break;default:g={x:r.x,y:r.y}}switch(Ks(e)){case"start":g[n]-=p*(i&&l?-1:1);break;case"end":g[n]+=p*(i&&l?-1:1)}return g}async function sn(t,e){var i;void 0===e&&(e={});const{x:r,y:a,platform:s,rects:n,elements:o,strategy:c}=t,{boundary:l="clippingAncestors",rootBoundary:d="viewport",elementContext:h="floating",altBoundary:p=!1,padding:g=0}=Vs(e,t),u=en(g),f=o[p?"floating"===h?"reference":"floating":h],m=rn(await s.getClippingRect({element:null==(i=await(null==s.isElement?void 0:s.isElement(f)))||i?f:f.contextElement||await(null==s.getDocumentElement?void 0:s.getDocumentElement(o.floating)),boundary:l,rootBoundary:d,strategy:c})),v="floating"===h?{x:r,y:a,width:n.floating.width,height:n.floating.height}:n.reference,b=await(null==s.getOffsetParent?void 0:s.getOffsetParent(o.floating)),k=await(null==s.isElement?void 0:s.isElement(b))&&await(null==s.getScale?void 0:s.getScale(b))||{x:1,y:1},y=rn(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:v,offsetParent:b,strategy:c}):v);return{top:(m.top-y.top+u.top)/k.y,bottom:(y.bottom-m.bottom+u.bottom)/k.y,left:(m.left-y.left+u.left)/k.x,right:(y.right-m.right+u.right)/k.x}}function nn(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function on(t){return Os.some((e=>t[e]>=0))}function cn(){return"undefined"!=typeof window}function ln(t){return pn(t)?(t.nodeName||"").toLowerCase():"#document"}function dn(t){var e;return(null==t||null==(e=t.ownerDocument)?void 0:e.defaultView)||window}function hn(t){var e;return null==(e=(pn(t)?t.ownerDocument:t.document)||window.document)?void 0:e.documentElement}function pn(t){return!!cn()&&(t instanceof Node||t instanceof dn(t).Node)}function gn(t){return!!cn()&&(t instanceof Element||t instanceof dn(t).Element)}function un(t){return!!cn()&&(t instanceof HTMLElement||t instanceof dn(t).HTMLElement)}function fn(t){return!(!cn()||"undefined"==typeof ShadowRoot)&&(t instanceof ShadowRoot||t instanceof dn(t).ShadowRoot)}function mn(t){const{overflow:e,overflowX:i,overflowY:r,display:a}=xn(t);return/auto|scroll|overlay|hidden|clip/.test(e+r+i)&&!["inline","contents"].includes(a)}function vn(t){return["table","td","th"].includes(ln(t))}function bn(t){return[":popover-open",":modal"].some((e=>{try{return t.matches(e)}catch(t){return!1}}))}function kn(t){const e=yn(),i=gn(t)?xn(t):t;return["transform","translate","scale","rotate","perspective"].some((t=>!!i[t]&&"none"!==i[t]))||!!i.containerType&&"normal"!==i.containerType||!e&&!!i.backdropFilter&&"none"!==i.backdropFilter||!e&&!!i.filter&&"none"!==i.filter||["transform","translate","scale","rotate","perspective","filter"].some((t=>(i.willChange||"").includes(t)))||["paint","layout","strict","content"].some((t=>(i.contain||"").includes(t)))}function yn(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}function wn(t){return["html","body","#document"].includes(ln(t))}function xn(t){return dn(t).getComputedStyle(t)}function Sn(t){return gn(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function Pn(t){if("html"===ln(t))return t;const e=t.assignedSlot||t.parentNode||fn(t)&&t.host||hn(t);return fn(e)?e.host:e}function Cn(t){const e=Pn(t);return wn(e)?t.ownerDocument?t.ownerDocument.body:t.body:un(e)&&mn(e)?e:Cn(e)}function En(t,e,i){var r;void 0===e&&(e=[]);const a=Cn(t),s=a===(null==(r=t.ownerDocument)?void 0:r.body),n=dn(a);return s?(Tn(n),e.concat(n,n.visualViewport||[],mn(a)?a:[],[])):e.concat(a,En(a,[]))}function Tn(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function Ln(t){const e=xn(t);let i=parseFloat(e.width)||0,r=parseFloat(e.height)||0;const a=un(t),s=a?t.offsetWidth:i,n=a?t.offsetHeight:r,o=zs(i)!==s||zs(r)!==n;return o&&(i=s,r=n),{width:i,height:r,$:o}}function _n(t){return gn(t)?t:t.contextElement}function Rn(t){const e=_n(t);if(!un(e))return Ns(1);const i=e.getBoundingClientRect(),{width:r,height:a,$:s}=Ln(e);let n=(s?zs(i.width):i.width)/r,o=(s?zs(i.height):i.height)/a;return n&&Number.isFinite(n)||(n=1),o&&Number.isFinite(o)||(o=1),{x:n,y:o}}const An=Ns(0);function Dn(t){const e=dn(t);return yn()&&e.visualViewport?{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}:An}function Mn(t,e,i,r){void 0===e&&(e=!1),void 0===i&&(i=!1);const a=t.getBoundingClientRect(),s=_n(t);let n=Ns(1);e&&(r?gn(r)&&(n=Rn(r)):n=Rn(t));const o=function(t,e,i){return void 0===e&&(e=!1),!(!i||e&&i!==dn(t))&&e}(s,i,r)?Dn(s):Ns(0);let c=(a.left+o.x)/n.x,l=(a.top+o.y)/n.y,d=a.width/n.x,h=a.height/n.y;if(s){const t=dn(s),e=r&&gn(r)?dn(r):r;let i=t,a=Tn(i);for(;a&&r&&e!==i;){const t=Rn(a),e=a.getBoundingClientRect(),r=xn(a),s=e.left+(a.clientLeft+parseFloat(r.paddingLeft))*t.x,n=e.top+(a.clientTop+parseFloat(r.paddingTop))*t.y;c*=t.x,l*=t.y,d*=t.x,h*=t.y,c+=s,l+=n,i=dn(a),a=Tn(i)}}return rn({width:d,height:h,x:c,y:l})}function In(t,e){const i=Sn(t).scrollLeft;return e?e.left+i:Mn(hn(t)).left+i}function On(t,e,i){void 0===i&&(i=!1);const r=t.getBoundingClientRect();return{x:r.left+e.scrollLeft-(i?0:In(t,r)),y:r.top+e.scrollTop}}function Un(t,e,i){let r;if("viewport"===e)r=function(t,e){const i=dn(t),r=hn(t),a=i.visualViewport;let s=r.clientWidth,n=r.clientHeight,o=0,c=0;if(a){s=a.width,n=a.height;const t=yn();(!t||t&&"fixed"===e)&&(o=a.offsetLeft,c=a.offsetTop)}return{width:s,height:n,x:o,y:c}}(t,i);else if("document"===e)r=function(t){const e=hn(t),i=Sn(t),r=t.ownerDocument.body,a=js(e.scrollWidth,e.clientWidth,r.scrollWidth,r.clientWidth),s=js(e.scrollHeight,e.clientHeight,r.scrollHeight,r.clientHeight);let n=-i.scrollLeft+In(t);const o=-i.scrollTop;return"rtl"===xn(r).direction&&(n+=js(e.clientWidth,r.clientWidth)-a),{width:a,height:s,x:n,y:o}}(hn(t));else if(gn(e))r=function(t,e){const i=Mn(t,!0,"fixed"===e),r=i.top+t.clientTop,a=i.left+t.clientLeft,s=un(t)?Rn(t):Ns(1);return{width:t.clientWidth*s.x,height:t.clientHeight*s.y,x:a*s.x,y:r*s.y}}(e,i);else{const i=Dn(t);r={x:e.x-i.x,y:e.y-i.y,width:e.width,height:e.height}}return rn(r)}function $n(t,e){const i=Pn(t);return!(i===e||!gn(i)||wn(i))&&("fixed"===xn(i).position||$n(i,e))}function Fn(t,e,i){const r=un(e),a=hn(e),s="fixed"===i,n=Mn(t,!0,s,e);let o={scrollLeft:0,scrollTop:0};const c=Ns(0);if(r||!r&&!s)if(("body"!==ln(e)||mn(a))&&(o=Sn(e)),r){const t=Mn(e,!0,s,e);c.x=t.x+e.clientLeft,c.y=t.y+e.clientTop}else a&&(c.x=In(a));const l=!a||r||s?Ns(0):On(a,o);return{x:n.left+o.scrollLeft-c.x-l.x,y:n.top+o.scrollTop-c.y-l.y,width:n.width,height:n.height}}function jn(t){return"static"===xn(t).position}function zn(t,e){if(!un(t)||"fixed"===xn(t).position)return null;if(e)return e(t);let i=t.offsetParent;return hn(t)===i&&(i=i.ownerDocument.body),i}function Nn(t,e){const i=dn(t);if(bn(t))return i;if(!un(t)){let e=Pn(t);for(;e&&!wn(e);){if(gn(e)&&!jn(e))return e;e=Pn(e)}return i}let r=zn(t,e);for(;r&&vn(r)&&jn(r);)r=zn(r,e);return r&&wn(r)&&jn(r)&&!kn(r)?i:r||function(t){let e=Pn(t);for(;un(e)&&!wn(e);){if(kn(e))return e;if(bn(e))return null;e=Pn(e)}return null}(t)||i}const Bn={convertOffsetParentRelativeRectToViewportRelativeRect:function(t){let{elements:e,rect:i,offsetParent:r,strategy:a}=t;const s="fixed"===a,n=hn(r),o=!!e&&bn(e.floating);if(r===n||o&&s)return i;let c={scrollLeft:0,scrollTop:0},l=Ns(1);const d=Ns(0),h=un(r);if((h||!h&&!s)&&(("body"!==ln(r)||mn(n))&&(c=Sn(r)),un(r))){const t=Mn(r);l=Rn(r),d.x=t.x+r.clientLeft,d.y=t.y+r.clientTop}const p=!n||h||s?Ns(0):On(n,c,!0);return{width:i.width*l.x,height:i.height*l.y,x:i.x*l.x-c.scrollLeft*l.x+d.x+p.x,y:i.y*l.y-c.scrollTop*l.y+d.y+p.y}},getDocumentElement:hn,getClippingRect:function(t){let{element:e,boundary:i,rootBoundary:r,strategy:a}=t;const s=[..."clippingAncestors"===i?bn(e)?[]:function(t,e){const i=e.get(t);if(i)return i;let r=En(t,[]).filter((t=>gn(t)&&"body"!==ln(t))),a=null;const s="fixed"===xn(t).position;let n=s?Pn(t):t;for(;gn(n)&&!wn(n);){const e=xn(n),i=kn(n);i||"fixed"!==e.position||(a=null),(s?!i&&!a:!i&&"static"===e.position&&a&&["absolute","fixed"].includes(a.position)||mn(n)&&!i&&$n(t,n))?r=r.filter((t=>t!==n)):a=e,n=Pn(n)}return e.set(t,r),r}(e,this._c):[].concat(i),r],n=s[0],o=s.reduce(((t,i)=>{const r=Un(e,i,a);return t.top=js(r.top,t.top),t.right=Fs(r.right,t.right),t.bottom=Fs(r.bottom,t.bottom),t.left=js(r.left,t.left),t}),Un(e,n,a));return{width:o.right-o.left,height:o.bottom-o.top,x:o.left,y:o.top}},getOffsetParent:Nn,getElementRects:async function(t){const e=this.getOffsetParent||Nn,i=this.getDimensions,r=await i(t.floating);return{reference:Fn(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}},getClientRects:function(t){return Array.from(t.getClientRects())},getDimensions:function(t){const{width:e,height:i}=Ln(t);return{width:e,height:i}},getScale:Rn,isElement:gn,isRTL:function(t){return"rtl"===xn(t).direction}},Hn=function(t){return void 0===t&&(t=0),{name:"offset",options:t,async fn(e){var i,r;const{x:a,y:s,placement:n,middlewareData:o}=e,c=await async function(t,e){const{placement:i,platform:r,elements:a}=t,s=await(null==r.isRTL?void 0:r.isRTL(a.floating)),n=qs(i),o=Ks(i),c="y"===Zs(i),l=["left","top"].includes(n)?-1:1,d=s&&c?-1:1,h=Vs(e,t);let{mainAxis:p,crossAxis:g,alignmentAxis:u}="number"==typeof h?{mainAxis:h,crossAxis:0,alignmentAxis:null}:{mainAxis:h.mainAxis||0,crossAxis:h.crossAxis||0,alignmentAxis:h.alignmentAxis};return o&&"number"==typeof u&&(g="end"===o?-1*u:u),c?{x:g*d,y:p*l}:{x:p*l,y:g*d}}(e,t);return n===(null==(i=o.offset)?void 0:i.placement)&&null!=(r=o.arrow)&&r.alignmentOffset?{}:{x:a+c.x,y:s+c.y,data:{...c,placement:n}}}}},Gn=function(t){return void 0===t&&(t={}),{name:"autoPlacement",options:t,async fn(e){var i,r,a;const{rects:s,middlewareData:n,placement:o,platform:c,elements:l}=e,{crossAxis:d=!1,alignment:h,allowedPlacements:p=$s,autoAlignment:g=!0,...u}=Vs(t,e),f=void 0!==h||p===$s?function(t,e,i){return(t?[...i.filter((e=>Ks(e)===t)),...i.filter((e=>Ks(e)!==t))]:i.filter((t=>qs(t)===t))).filter((i=>!t||Ks(i)===t||!!e&&Xs(i)!==i))}(h||null,g,p):p,m=await sn(e,u),v=(null==(i=n.autoPlacement)?void 0:i.index)||0,b=f[v];if(null==b)return{};const k=Js(b,s,await(null==c.isRTL?void 0:c.isRTL(l.floating)));if(o!==b)return{reset:{placement:f[0]}};const y=[m[qs(b)],m[k[0]],m[k[1]]],w=[...(null==(r=n.autoPlacement)?void 0:r.overflows)||[],{placement:b,overflows:y}],x=f[v+1];if(x)return{data:{index:v+1,overflows:w},reset:{placement:x}};const S=w.map((t=>{const e=Ks(t.placement);return[t.placement,e&&d?t.overflows.slice(0,2).reduce(((t,e)=>t+e),0):t.overflows[0],t.overflows]})).sort(((t,e)=>t[1]-e[1])),P=(null==(a=S.filter((t=>t[2].slice(0,Ks(t[0])?2:3).every((t=>t<=0))))[0])?void 0:a[0])||S[0][0];return P!==o?{data:{index:v+1,overflows:w},reset:{placement:P}}:{}}}},Vn=function(t){return void 0===t&&(t={}),{name:"shift",options:t,async fn(e){const{x:i,y:r,placement:a}=e,{mainAxis:s=!0,crossAxis:n=!1,limiter:o={fn:t=>{let{x:e,y:i}=t;return{x:e,y:i}}},...c}=Vs(t,e),l={x:i,y:r},d=await sn(e,c),h=Zs(qs(a)),p=Ws(h);let g=l[p],u=l[h];if(s){const t="y"===p?"bottom":"right";g=Gs(g+d["y"===p?"top":"left"],g,g-d[t])}if(n){const t="y"===h?"bottom":"right";u=Gs(u+d["y"===h?"top":"left"],u,u-d[t])}const f=o.fn({...e,[p]:g,[h]:u});return{...f,data:{x:f.x-i,y:f.y-r,enabled:{[p]:s,[h]:n}}}}}},qn=function(t){return void 0===t&&(t={}),{name:"flip",options:t,async fn(e){var i,r;const{placement:a,middlewareData:s,rects:n,initialPlacement:o,platform:c,elements:l}=e,{mainAxis:d=!0,crossAxis:h=!0,fallbackPlacements:p,fallbackStrategy:g="bestFit",fallbackAxisSideDirection:u="none",flipAlignment:f=!0,...m}=Vs(t,e);if(null!=(i=s.arrow)&&i.alignmentOffset)return{};const v=qs(a),b=Zs(o),k=qs(o)===o,y=await(null==c.isRTL?void 0:c.isRTL(l.floating)),w=p||(k||!f?[tn(o)]:function(t){const e=tn(t);return[Xs(t),e,Xs(e)]}(o)),x="none"!==u;!p&&x&&w.push(...function(t,e,i,r){const a=Ks(t);let s=function(t,e,i){const r=["left","right"],a=["right","left"],s=["top","bottom"],n=["bottom","top"];switch(t){case"top":case"bottom":return i?e?a:r:e?r:a;case"left":case"right":return e?s:n;default:return[]}}(qs(t),"start"===i,r);return a&&(s=s.map((t=>t+"-"+a)),e&&(s=s.concat(s.map(Xs)))),s}(o,f,u,y));const S=[o,...w],P=await sn(e,m),C=[];let E=(null==(r=s.flip)?void 0:r.overflows)||[];if(d&&C.push(P[v]),h){const t=Js(a,n,y);C.push(P[t[0]],P[t[1]])}if(E=[...E,{placement:a,overflows:C}],!C.every((t=>t<=0))){var T,L;const t=((null==(T=s.flip)?void 0:T.index)||0)+1,e=S[t];if(e)return{data:{index:t,overflows:E},reset:{placement:e}};let i=null==(L=E.filter((t=>t.overflows[0]<=0)).sort(((t,e)=>t.overflows[1]-e.overflows[1]))[0])?void 0:L.placement;if(!i)switch(g){case"bestFit":{var _;const t=null==(_=E.filter((t=>{if(x){const e=Zs(t.placement);return e===b||"y"===e}return!0})).map((t=>[t.placement,t.overflows.filter((t=>t>0)).reduce(((t,e)=>t+e),0)])).sort(((t,e)=>t[1]-e[1]))[0])?void 0:_[0];t&&(i=t);break}case"initialPlacement":i=o}if(a!==i)return{reset:{placement:i}}}return{}}}},Kn=function(t){return void 0===t&&(t={}),{name:"hide",options:t,async fn(e){const{rects:i}=e,{strategy:r="referenceHidden",...a}=Vs(t,e);switch(r){case"referenceHidden":{const t=nn(await sn(e,{...a,elementContext:"reference"}),i.reference);return{data:{referenceHiddenOffsets:t,referenceHidden:on(t)}}}case"escaped":{const t=nn(await sn(e,{...a,altBoundary:!0}),i.floating);return{data:{escapedOffsets:t,escaped:on(t)}}}default:return{}}}}},Wn=t=>({name:"arrow",options:t,async fn(e){const{x:i,y:r,placement:a,rects:s,platform:n,elements:o,middlewareData:c}=e,{element:l,padding:d=0}=Vs(t,e)||{};if(null==l)return{};const h=en(d),p={x:i,y:r},g=Qs(a),u=Ys(g),f=await n.getDimensions(l),m="y"===g,v=m?"top":"left",b=m?"bottom":"right",k=m?"clientHeight":"clientWidth",y=s.reference[u]+s.reference[g]-p[g]-s.floating[u],w=p[g]-s.reference[g],x=await(null==n.getOffsetParent?void 0:n.getOffsetParent(l));let S=x?x[k]:0;S&&await(null==n.isElement?void 0:n.isElement(x))||(S=o.floating[k]||s.floating[u]);const P=y/2-w/2,C=S/2-f[u]/2-1,E=Fs(h[v],C),T=Fs(h[b],C),L=E,_=S-f[u]-T,R=S/2-f[u]/2+P,A=Gs(L,R,_),D=!c.arrow&&null!=Ks(a)&&R!==A&&s.reference[u]/2-(R<L?E:T)-f[u]/2<0,M=D?R<L?R-L:R-_:0;return{[g]:p[g]+M,data:{[g]:A,centerOffset:R-A-M,...D&&{alignmentOffset:M}},reset:D}}}),Yn=(t,e,i)=>{const r=new Map,a={platform:Bn,...i},s={...a.platform,_c:r};return(async(t,e,i)=>{const{placement:r="bottom",strategy:a="absolute",middleware:s=[],platform:n}=i,o=s.filter(Boolean),c=await(null==n.isRTL?void 0:n.isRTL(e));let l=await n.getElementRects({reference:t,floating:e,strategy:a}),{x:d,y:h}=an(l,r,c),p=r,g={},u=0;for(let i=0;i<o.length;i++){const{name:s,fn:f}=o[i],{x:m,y:v,data:b,reset:k}=await f({x:d,y:h,initialPlacement:r,placement:p,strategy:a,middlewareData:g,rects:l,platform:n,elements:{reference:t,floating:e}});d=null!=m?m:d,h=null!=v?v:h,g={...g,[s]:{...g[s],...b}},k&&u<=50&&(u++,"object"==typeof k&&(k.placement&&(p=k.placement),k.rects&&(l=!0===k.rects?await n.getElementRects({reference:t,floating:e,strategy:a}):k.rects),({x:d,y:h}=an(l,p,c))),i=-1)}return{x:d,y:h,placement:p,strategy:a,middlewareData:g}})(t,e,{...a,platform:s})},Zn=t=>t.map((t=>{switch(t.type){case"a":if("string"==typeof t.content)return e=t.content,N("a",{class:"link",href:e,target:"_blank",rel:"noopener noreferrer"},e);case"b":return(t=>N("b",null,"string"==typeof t?t:Zn(t)))(t.content);case"i":return(t=>N("i",null,"string"==typeof t?t:Zn(t)))(t.content);case"s":return(t=>"string"==typeof t?N("s",null,t):N("b",null,Zn(t)))(t.content);case"q":return N("span",{class:"block-quote"});default:return(t=>"string"==typeof t?t:N("p",null,Zn(t)))(t.content)}var e})),Qn=({message:t})=>{const e=t.slice(0,Vi),i=Hi(e,!0),r=Gi(e);return N("p",null,0!==i.length&&N("blockquote",null,i.split("\n").map((t=>{const e=Ki(t);return N("p",null,Zn(e))}))),r.split("\n").map((t=>{const e=Ki(t);return N("p",null,Zn(e))})))},Jn={joined:"https://dyte-uploads.s3.ap-south-1.amazonaws.com/notification_join.mp3",left:"https://dyte-uploads.s3.ap-south-1.amazonaws.com/notification_join.mp3",message:"https://dyte-uploads.s3.ap-south-1.amazonaws.com/notification_message.mp3"};class Xn{constructor(t){this.meeting=t,this.audio=document.createElement("audio"),this.audio.volume=.3}play(t,e=3e3){var i;this.playing||(this.playing=!0,this.audio.src=Jn[t],this.audio.volume=.3,null===(i=this.audio.play())||void 0===i||i.catch((t=>{})),setTimeout((()=>{this.playing=!1}),e))}async setDevice(t){var e,i,r;oe(this.meeting)||await(null===(r=null===(i=null===(e=this.audio)||void 0===e?void 0:e.setSinkId)||void 0===i?void 0:i.call(e,t))||void 0===r?void 0:r.catch((t=>{})))}}var to=function(t,e,i,r){var a,s=arguments.length,n=s<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,i,r);else for(var o=t.length-1;o>=0;o--)(a=t[o])&&(n=(s<3?a(n):s>3?a(e,i,n):a(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};const eo=class{constructor(t){o(this,t),this.variant="circular",this.iconPack=je,this.t=Fe(),this.imageState="loading",this.getAvatar=()=>{var t;const e=ti((null===(t=this.participant)||void 0===t?void 0:t.name)||"");let i;if(null!=this.participant&&"picture"in this.participant&&(i=this.participant.picture),i&&i.length>0&&"errored"!==this.imageState)return N("div",{class:"image-ctr"},"loading"===this.imageState&&N("rtk-spinner",{iconPack:this.iconPack}),N("img",{src:i,class:{loaded:"loaded"===this.imageState},loading:"lazy",title:e,onLoad:()=>this.imageState="loaded",onError:()=>this.imageState="errored",part:"image"}));const r=ri(e);return N("div",{class:"initials",title:e,part:"initials"},r)}}render(){return N(H,{key:"62ab06b7a747442ff9fb2b65d886dba0177dcc1c"},this.getAvatar(),N("slot",{key:"c076f0ccf24ffa9d1e42287a60c0afd9e27be439"}))}};to([ai()],eo.prototype,"size",void 0),to([ai()],eo.prototype,"iconPack",void 0),to([ai()],eo.prototype,"t",void 0),eo.style=":host{line-height:initial;font-family:var(--rtk-font-family, sans-serif);font-feature-settings:normal;font-variation-settings:normal}p{margin:var(--rtk-space-0, 0px);padding:var(--rtk-space-0, 0px)}:host{display:flex;height:var(--rtk-space-32, 128px);width:var(--rtk-space-32, 128px);align-items:center;justify-content:center;font-size:28px;--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-brand-500, 33 96 253) / var(--tw-bg-opacity));color:rgb(var(--rtk-colors-text-on-brand-1000, var(--rtk-colors-text-1000, 255 255 255)));overflow:clip;border-radius:9999px;-webkit-user-select:none;-moz-user-select:none;user-select:none}rtk-icon{height:50%;width:50%}.image-ctr{display:flex;height:100%;width:100%;align-items:center;justify-content:center;--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-background-700, 44 44 44) / var(--tw-bg-opacity));color:rgb(var(--rtk-colors-text-600, 255 255 255 / 0.52))}img{height:var(--rtk-space-0, 0px);width:var(--rtk-space-0, 0px);-o-object-fit:cover;object-fit:cover}img.loaded{height:100%;width:100%}.initials{display:flex;height:100%;width:100%;align-items:center;justify-content:center;text-transform:uppercase}.image{display:flex;height:100%;width:100%;align-items:center;justify-content:center}.image img{display:none;height:100%;width:100%;-o-object-fit:cover;object-fit:cover}.image img.loaded{display:block}:host([variant='hexagon']){border-radius:var(--rtk-border-radius-none, 0);clip-path:polygon(50% 0, 95% 25%, 95% 75%, 50% 100%, 5% 75%, 5% 25%)}:host([variant='square']){border-radius:var(--rtk-border-radius-none, 0);clip-path:polygon(0% 0%, 100% 0%, 100% 100%, 0% 100%)}:host([size='sm']){height:var(--rtk-space-14, 56px);width:var(--rtk-space-14, 56px);font-size:12px}:host([size='md']){height:var(--rtk-space-28, 112px);width:var(--rtk-space-28, 112px)}:host([size='lg']){height:var(--rtk-space-32, 128px);width:var(--rtk-space-32, 128px)}";var io=function(t,e,i,r){var a,s=arguments.length,n=s<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,i,r);else for(var o=t.length-1;o>=0;o--)(a=t[o])&&(n=(s<3?a(n):s>3?a(e,i,n):a(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};const ro=class{constructor(t){o(this,t),this.onParticipantsAdd=Y(this,"participantsAdd",7),this.onParticipantDelete=Y(this,"participantDelete",7),this.onRoomJoin=Y(this,"roomJoin",7),this.deleteRoom=Y(this,"delete",7),this.updateRoom=Y(this,"update",7),this.allowDelete=!0,this.iconPack=je,this.t=Fe(),this.isDragMode=!1,this.defaultExpanded=!1,this.editingTitleRoomId=null,this.newTitle=null,this.showExpandedCard=!1,this.glowingCard=!1,this.permissionsUpdateListener=()=>{this.permissions=this.meeting.self.permissions.connectedMeetings},this.reset=()=>{this.editingTitleRoomId=null,this.newTitle=null},this.onEditClick=()=>{if(this.editingTitleRoomId){if(this.newTitle.length<3)return;this.roomTitle=this.newTitle,this.updateRoom.emit({title:this.newTitle,id:this.editingTitleRoomId}),this.glowCard(),this.reset()}else this.editingTitleRoomId=this.room.id,C((()=>{this.inputTextEl.focus(),this.inputTextEl.select()}))},this.onDrop=t=>{t.currentTarget instanceof HTMLParagraphElement&&(t.currentTarget.classList.remove("drop-zone-active"),this.onAssign())},this.onDragOver=t=>{t.currentTarget instanceof HTMLParagraphElement&&(t.currentTarget.classList.add("drop-zone-active"),t.preventDefault())}}connectedCallback(){var t;this.allParticipants=pe(this.meeting),this.permissionsUpdateListener(),this.showExpandedCard=this.defaultExpanded,this.roomTitle=this.room.isParent?this.t("breakout_rooms.main_room"):null===(t=this.room)||void 0===t?void 0:t.title,this.canEditMeetingTitle=this.permissions.canAlterConnectedMeetings&&!this.room.isParent&&!this.meeting.connectedMeetings.isActive,this.meeting.self.permissions.on("permissionsUpdate",this.permissionsUpdateListener)}disconnectedCallback(){this.meeting.self.permissions.off("permissionsUpdate",this.permissionsUpdateListener)}onDragLeave(t){t.currentTarget instanceof HTMLParagraphElement&&t.currentTarget.classList.remove("drop-zone-active")}getAssignmentHint(){return this.assigningParticipants&&this.isDragMode?this.t("breakout_rooms.drag_drop_participants"):this.assigningParticipants?this.t("breakout_rooms.click_drop_participants"):0===this.room.participants.length?this.t("breakout_rooms.none_assigned"):void 0}toggleCardDisplay(){this.showExpandedCard=!this.showExpandedCard}glowCard(){this.glowingCard=!0,setTimeout((()=>{this.glowingCard=!1}),2e3)}onAssign(){this.onParticipantsAdd.emit(),this.glowCard()}onJoin(){this.onRoomJoin.emit()}onTitleChanged(t){"Enter"===t.key&&(this.newTitle=t.target.value,this.onEditClick())}renderPeer(t){const{displayPictureUrl:e}=this.allParticipants.find((e=>he(e)===he(t))),i=ti(t.displayName||"");return N("div",{class:"peer-ui-container"},N("rtk-avatar",{participant:{name:i,picture:e},size:"sm"}),N("p",{class:"name",title:i},Qe(i,16),this.meeting.self.userId===t.id&&` (${this.t("you")})`))}renderExpandedCardMaybe(){if(this.showExpandedCard&&!this.room.isParent&&this.getAssignmentHint()&&this.permissions.canAlterConnectedMeetings)return N("div",{class:"message-container"},N("p",{class:{"compact-height":0!==this.room.participants.length},onClick:()=>this.onAssign(),onDragOver:this.onDragOver,onDragLeave:this.onDragLeave,onDrop:this.onDrop},this.getAssignmentHint()))}renderParticipantsMaybe(){if(this.showExpandedCard&&!this.room.isParent&&0!==this.room.participants.length)return N("div",{class:"participant-list",onClick:()=>{this.onAssign()}},this.room.participants.map((t=>N("div",{class:"participant-item",role:"listitem",key:t.id},this.renderPeer(t),this.permissions.canAlterConnectedMeetings&&N("rtk-icon",{class:"show-on-hover",icon:this.iconPack.dismiss,onClick:()=>{this.onParticipantDelete.emit(t)}})))))}render(){var t,e,i;return N(H,{key:"947ca9b82a497a0ce4274204dd7bcf9949d4e3c8"},N("div",{key:"cfd0a32bf1ad9db09edcf479e743292a064ff6e0",class:{"assign-mode":this.assigningParticipants,"selector-mode":!this.assigningParticipants,"glowing-card":this.glowingCard}},N("div",{key:"f96ef6dae36d6368d9651b1b7521b5281390a1c5",class:"header"},N("input",{key:"ec5862c36b2a8a23b1a7bd9530418af16d044102",ref:t=>this.inputTextEl=t,placeholder:this.t("breakout_rooms.room_name"),disabled:!(this.editingTitleRoomId===this.room.id),value:this.roomTitle,minlength:3,onChange:t=>{this.newTitle=t.target.value},onKeyPress:t=>this.onTitleChanged(t),class:{"editing-enabled":this.editingTitleRoomId===this.room.id},style:{width:`${this.roomTitle.length+1}ch`}}),this.editingTitleRoomId!==this.room.id&&N("span",{key:"b2abbce8a8b9dd49e2b72fbddd13b09763092aa4",class:"participant-count"},"(",N("rtk-icon",{key:"f2075dfaa059be92d5462a614e179449cf4bdf81",icon:this.iconPack.people}),null!==(i=null===(e=null===(t=this.room)||void 0===t?void 0:t.participants)||void 0===e?void 0:e.length)&&void 0!==i?i:"0",")"),this.canEditMeetingTitle&&N("rtk-tooltip",{key:"2a47492d1c1f24077ad1a861a19bec8a201cea74",label:this.editingTitleRoomId===this.room.id?this.t("breakout_rooms.save_room_name"):this.t("breakout_rooms.edit_room_name")},N("rtk-icon",{key:"1211a94dd351b33443fe430f69801cff8bf15765",icon:this.editingTitleRoomId===this.room.id?this.iconPack.checkmark:this.iconPack.edit,class:"show-on-hover",onClick:this.onEditClick})),N("div",{key:"5430f371fad9022f4a9a4de2747914958ff1d846",class:"rooms-container"},this.permissions.canAlterConnectedMeetings&&!this.room.isParent&&this.allowDelete&&N("rtk-tooltip",{key:"f807c8b6fabc2e85a9e9f023e7ac00ecd555861b",label:this.t("breakout_rooms.delete"),class:"danger"},N("rtk-icon",{key:"171ba25bd6d0b4b418d719f2eb4555ddc301ee2e",icon:this.iconPack.delete,class:"show-on-hover",onClick:()=>{this.deleteRoom.emit()}})),this.assigningParticipants&&this.permissions.canAlterConnectedMeetings&&!this.room.isParent&&N("rtk-button",{key:"24c2023d3edeb75fdec77a145040741bbe6a90f8",kind:"button",variant:"ghost",class:"assign-button",size:"md",onClick:()=>this.onAssign()},this.t("breakout_rooms.assign")),"edit"===this.mode&&!this.assigningParticipants&&this.permissions.canSwitchConnectedMeetings&&N("rtk-button",{key:"d93e97a19162498f797e9e237105728907eb3b75",kind:"button",variant:"ghost",class:"assign-button",size:"md",disabled:this.room.id===this.meeting.meta.meetingId,onClick:()=>this.onJoin()},this.room.id===this.meeting.meta.meetingId?this.t("joined"):this.t("join")),!this.room.isParent&&N("rtk-icon",{key:"c020a1e894c959580104255ab81c3772af16c862",icon:this.showExpandedCard?this.iconPack.chevron_up:this.iconPack.chevron_down,onClick:()=>this.toggleCardDisplay()}))),this.renderExpandedCardMaybe(),this.renderParticipantsMaybe()))}};io([ai()],ro.prototype,"meeting",void 0),io([ai()],ro.prototype,"states",void 0),io([ai()],ro.prototype,"iconPack",void 0),io([ai()],ro.prototype,"t",void 0),ro.style=":host{line-height:initial;font-family:var(--rtk-font-family, sans-serif);font-feature-settings:normal;font-variation-settings:normal}p{margin:var(--rtk-space-0, 0px);padding:var(--rtk-space-0, 0px)}:host{--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-background-800, 30 30 30) / var(--tw-bg-opacity));border-radius:var(--rtk-border-radius-sm, 4px)}@keyframes bg-glow{25%{background-color:rgba(var(--rtk-colors-brand-500, 33 96 253) / 0.2)}50%{--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-background-800, 30 30 30) / var(--tw-bg-opacity))}75%{background-color:rgba(var(--rtk-colors-brand-500, 33 96 253) / 0.2)}}.glowing-card{animation:bg-glow 0.8s}.selector-mode,.assign-mode{display:flex;flex-direction:column;align-items:center;padding:var(--rtk-space-2, 8px);cursor:pointer}.selector:hover{--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-background-600, 60 60 60) / var(--tw-bg-opacity))}.show-on-hover{display:none}.header{width:100%;display:flex;align-items:center}.header rtk-icon{margin-left:var(--rtk-space-2, 8px);height:var(--rtk-space-5, 20px);cursor:pointer}.header .danger{--tw-text-opacity:1;color:rgba(var(--rtk-colors-danger, 255 45 45) / var(--tw-text-opacity))}.header .hide{display:none}.header .rooms-container{display:flex;flex-grow:1;flex-direction:row;align-items:center;justify-content:flex-end}.header input{--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-background-800, 30 30 30) / var(--tw-bg-opacity));padding:var(--rtk-space-1, 4px);color:rgb(var(--rtk-colors-text-900, 255 255 255 / 0.88));max-width:var(--rtk-space-36, 144px);font-size:14px;font-weight:500;border-radius:var(--rtk-border-radius-sm, 4px);border-width:var(--rtk-border-width-none, 0);border-style:none;outline:2px solid transparent;outline-offset:2px;border-bottom-width:var(--rtk-border-width-sm, 1px);border-style:solid;--tw-border-opacity:1;border-bottom-color:rgba(var(--rtk-colors-background-800, 30 30 30) / var(--tw-border-opacity))}.header input:disabled{overflow-x:visible;border-radius:var(--rtk-border-radius-none, 0);border-width:var(--rtk-border-width-none, 0);border-style:none;background-color:transparent}.header input:invalid{border-bottom-width:var(--rtk-border-width-sm, 1px);border-style:dashed;--tw-border-opacity:1;border-bottom-color:rgba(var(--rtk-colors-danger, 255 45 45) / var(--tw-border-opacity))}.header input.editing-enabled{--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-background-900, 26 26 26) / var(--tw-bg-opacity))}.header .participant-count{display:flex;align-items:center;font-size:14px;color:rgb(var(--rtk-colors-text-900, 255 255 255 / 0.88))}.header .participant-count rtk-icon{margin:var(--rtk-space-0, 0px);margin-right:var(--rtk-space-0\\.5, 2px);width:var(--rtk-space-3, 12px)}.header .assign-button{height:var(--rtk-space-6, 24px);--tw-text-opacity:1;color:rgba(var(--rtk-colors-brand-500, 33 96 253) / var(--tw-text-opacity));text-decoration-line:underline}.header .assign-button:hover{--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-background-800, 30 30 30) / var(--tw-bg-opacity))}.participant-list{display:grid;flex-grow:1;grid-template-columns:repeat(2, minmax(0, 1fr));gap:var(--rtk-space-2, 8px);margin-top:var(--rtk-space-2, 8px);margin-bottom:var(--rtk-space-2, 8px);width:100%;border-radius:var(--rtk-border-radius-sm, 4px)}.participant-list::-webkit-scrollbar{width:var(--rtk-space-1\\.5, 6px)}.participant-list::-webkit-scrollbar-thumb{border-radius:var(--rtk-border-radius-sm, 4px);--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-background-600, 60 60 60) / var(--tw-bg-opacity))}.participant-list::-webkit-scrollbar-track{border-radius:var(--rtk-border-radius-sm, 4px);--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-background-800, 30 30 30) / var(--tw-bg-opacity))}.participant-item{display:flex;align-items:center;justify-content:space-between;margin-right:var(--rtk-space-2, 8px);height:-moz-fit-content;height:fit-content;padding-left:var(--rtk-space-2, 8px);padding-right:var(--rtk-space-2, 8px)}.participant-item:hover{border-radius:var(--rtk-border-radius-sm, 4px);--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-background-600, 60 60 60) / var(--tw-bg-opacity))}.selector-mode:hover .show-on-hover{display:flex}.message-container{margin:var(--rtk-space-0, 0px);display:flex;width:100%;padding-top:var(--rtk-space-2, 8px);padding-bottom:var(--rtk-space-2, 8px)}.message-container p{margin-top:var(--rtk-space-0, 0px);margin-bottom:var(--rtk-space-0, 0px);height:var(--rtk-space-20, 80px);display:flex;width:100%;align-items:center;justify-content:center;border-radius:var(--rtk-border-radius-sm, 4px);font-size:12px;color:rgb(var(--rtk-colors-text-700, 255 255 255 / 0.64));border-style:dashed;--tw-border-opacity:1;border-color:rgba(var(--rtk-colors-background-600, 60 60 60) / var(--tw-border-opacity))}.message-container p:hover{--tw-border-opacity:1;border-color:rgba(var(--rtk-colors-brand-300, 73 124 253) / var(--tw-border-opacity));background-color:rgba(var(--rtk-colors-brand-500, 33 96 253) / 0.25)}.message-container .drop-zone-active{--tw-border-opacity:1;border-color:rgba(var(--rtk-colors-brand-300, 73 124 253) / var(--tw-border-opacity));background-color:rgba(var(--rtk-colors-brand-500, 33 96 253) / 0.25)}rtk-icon{height:var(--rtk-space-6, 24px);width:var(--rtk-space-6, 24px)}.show-on-hover{margin-left:var(--rtk-space-4, 16px);height:var(--rtk-space-4, 16px);width:var(--rtk-space-4, 16px);display:none}:host(:hover) .show-on-hover{display:flex}.peer-ui-container{position:relative;display:flex;align-items:center;gap:var(--rtk-space-2, 8px);height:var(--rtk-space-10, 40px);cursor:pointer;border-radius:var(--rtk-border-radius-sm, 4px);color:rgb(var(--rtk-colors-text-900, 255 255 255 / 0.88))}.peer-ui-container rtk-avatar{height:var(--rtk-space-7, 28px);width:var(--rtk-space-7, 28px);font-size:14px;color:rgb(var(--rtk-colors-text-1000, 255 255 255))}.peer-ui-container .name{font-size:14px;overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:1}";var ao=function(t,e,i,r){var a,s=arguments.length,n=s<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,i,r);else for(var o=t.length-1;o>=0;o--)(a=t[o])&&(n=(s<3?a(n):s>3?a(e,i,n):a(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};const so=class{constructor(t){o(this,t),this.onSelectedParticipantsUpdate=Y(this,"selectedParticipantsUpdate",7),this.onAllToggled=Y(this,"allParticipantsToggleUpdate",7),this.onParticipantsDragging=Y(this,"participantsDragging",7),this.participantIds=[],this.iconPack=je,this.t=Fe(),this.search="",this.participantsToShow=[],this.selectedParticipantIds=[],this.isDragging=!1,this.onSearchInput=t=>{this.search=t.target.value},this.onDragStart=t=>{this.isDragging=!0,this.onParticipantsDragging.emit(!0),this.updateSelectedParticipants(t,!0)},this.onDragEnd=t=>{this.isDragging=!1,this.onParticipantsDragging.emit(!1),this.updateSelectedParticipants(t,!1)},this.onClick=t=>{const e=this.selectedParticipantIds.includes(he(t));this.updateSelectedParticipants(t,!e)},this.onToggleAll=t=>{const e=t?this.participantsToShow.map(he):[];this.onAllToggled.emit(e)}}connectedCallback(){this.meetingChanged(this.meeting),this.searchChanged(this.search)}disconnectedCallback(){this.meeting}updateSelectedParticipants(t,e){const i=he(t);let r=[];r=e&&!this.selectedParticipantIds.includes(i)?[...this.selectedParticipantIds,i]:[...this.selectedParticipantIds.filter((t=>t!==i))],this.onSelectedParticipantsUpdate.emit(r)}meetingChanged(t){null!=t&&this.getParticipants(this.search)}participantsChanged(){this.getParticipants(this.search)}searchChanged(t){this.getParticipants(t)}getParticipants(t){const e=pe(this.meeting);this.participantsToShow=e.filter((e=>{var i;return this.participantIds.includes(he(e))&&(null!==(i=e.displayName)&&void 0!==i?i:"").toLowerCase().includes(t.toLowerCase())}))}renderPeer(t){const e=ti(t.displayName||"");return N("div",{class:"peer-ui-container"},N("rtk-avatar",{participant:{name:t.displayName,picture:t.displayPictureUrl},size:"sm"}),N("p",{class:"name",title:e},Qe(e,16),this.meeting.self.userId===t.id&&` (${this.t("you")})`))}render(){return N(H,{key:"f52879701d8a87899b877c28d53254b3bc56b299"},N("div",{key:"91d45e76f9f147c8ca30584bbb6c7816c189e0ce",class:"search-wrapper"},N("div",{key:"b4ae06fd6ce269008cdb4512590e5df8a39f5c9a",class:"search",part:"search"},N("rtk-icon",{key:"0018db4e3febb44ccef2b7891d13fb76e18573b6",icon:this.iconPack.search,part:"search-icon",class:"search-icon"}),N("input",{key:"61fddb7cde11b23976e7485c17f23d34d2f14379",type:"search",autocomplete:"off",placeholder:this.t("search"),onInput:this.onSearchInput,part:"search-input"})),N("slot",{key:"8b2bb46621a8f148e22e6ce34b4d2a47a3b3c707",name:"shuffle-button"})),N("div",{key:"9803b94e75d829ac1f95527b16ba7381807b630b",class:"header"},N("div",{key:"c1b21d875ec8cc2e0625f7e21191b78ffce9e4e3",class:"title-wrapper"},N("span",{key:"3f87be86358d89b288294cb09846a09f2182df11"},this.t("breakout_rooms.main_room")),N("span",{key:"f5a0d206f12479e064d20dc414532d88a24bd62e",class:"participant-count"},"(",N("rtk-icon",{key:"8c8302bd28b84dc72c98086905ae2416d5044216",icon:this.iconPack.people}),this.participantsToShow.length,")")),0!==this.selectedParticipantIds.length&&N("rtk-tooltip",{key:"a40167a7356b4c9d52cd795d5a2c8985a896a473",label:this.t("breakout_rooms.select_all")},N("input",{key:"754d9265dc605ecb460eddaa91f6673690a372c1",type:"checkbox",checked:this.selectedParticipantIds.length===this.participantsToShow.length,onChange:t=>this.onToggleAll(!!t.target.checked)}))),N("div",{key:"94373ef76a5ebd0fcf6d34fe34c0aa7ee1c38159",class:"ctr scrollbar",part:"container"},this.participantsToShow.length>0&&N("ul",{key:"5293af5ca10e9ccd031cfd4b43494a6b7d112084",class:"participants",part:"participants"},this.participantsToShow.map((t=>N("li",{class:{"participant-item":!0,dragging:this.isDragging},onClick:()=>this.onClick(t),onDragStart:()=>this.onDragStart(t),onDragEnd:()=>this.onDragEnd(t),draggable:0===this.selectedParticipantIds.length,role:"listitem",key:t.id},this.renderPeer(t),!this.isDragging&&N("input",{type:"checkbox",class:{"hide-checkbox":0===this.selectedParticipantIds.length},checked:this.selectedParticipantIds.includes(he(t))}))))),0===this.participantsToShow.length&&this.search.length>0&&N("div",{key:"2940a7bb997d27028dbafb8796dd9db3a55869d3",class:"empty-message"},this.t("participants.errors.empty_results")),0===this.participantsToShow.length&&0===this.search.length&&N("div",{key:"e3a7539e969f0f5369079bac5c01d6ad4a4fdb50",class:"empty-room"},N("rtk-icon",{key:"92b2b7022d9e2961e6ccfc9b721b8369d09bdbb9",icon:this.iconPack.people_checked,part:"search-icon",class:"search-icon"}),N("p",{key:"629b7fb160ec79432d5f7e1b3fd50972589cda7a"},this.t("breakout_rooms.all_assigned")),N("span",{key:"54c84669c543b7a12ee33e6aba25b30c271727b9"},this.t("breakout_rooms.empty_main_room")))))}static get watchers(){return{meeting:["meetingChanged"],participantIds:["participantsChanged"],search:["searchChanged"]}}};ao([ai()],so.prototype,"meeting",void 0),ao([ai()],so.prototype,"iconPack",void 0),ao([ai()],so.prototype,"t",void 0),so.style=":host{line-height:initial;font-family:var(--rtk-font-family, sans-serif);font-feature-settings:normal;font-variation-settings:normal}p{margin:var(--rtk-space-0, 0px);padding:var(--rtk-space-0, 0px)}.scrollbar{scrollbar-width:thin;scrollbar-color:var(--rtk-scrollbar-color, rgb(var(--rtk-colors-background-600, 60 60 60)))\n var(--rtk-scrollbar-background, transparent)}.scrollbar::-webkit-scrollbar{height:var(--rtk-space-1\\.5, 6px);width:var(--rtk-space-1\\.5, 6px);border-radius:9999px;background-color:var(--rtk-scrollbar-background, transparent)}.scrollbar::-webkit-scrollbar-thumb{border-radius:9999px;background-color:var(--rtk-scrollbar-color, rgb(var(--rtk-colors-background-600, 60 60 60)))}:host{display:flex;height:100%;flex-direction:column;font-size:14px}:host input[type='checkbox']{margin:var(--rtk-space-0, 0px);cursor:pointer;-webkit-appearance:none;-moz-appearance:none;appearance:none;border-radius:var(--rtk-border-radius-sm, 4px);position:relative;height:var(--rtk-space-4, 16px);width:var(--rtk-space-4, 16px);border-width:var(--rtk-border-width-sm, 1px);border-style:solid;border-color:rgb(var(--rtk-colors-text-600, 255 255 255 / 0.52))}:host input[type='checkbox']:checked{--tw-border-opacity:1;border-color:rgba(var(--rtk-colors-brand-500, 33 96 253) / var(--tw-border-opacity));--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-brand-500, 33 96 253) / var(--tw-bg-opacity))}:host input[type='checkbox']:checked::before{position:absolute;top:1px;left:1px;height:var(--rtk-space-3, 12px);width:var(--rtk-space-3, 12px);background-color:rgb(var(--rtk-colors-text-1000, 255 255 255));content:'';clip-path:polygon(5% 60%, 35% 93%, 100% 19%, 86% 4%, 36% 62%, 19% 44%)}*{box-sizing:border-box}.participants{margin-top:var(--rtk-space-2, 8px);padding:var(--rtk-space-0, 0px)}.ctr{box-sizing:border-box;padding-top:var(--rtk-space-0, 0px);padding-bottom:var(--rtk-space-0, 0px);overflow-y:auto;flex-grow:1;flex-basis:0}.empty-message{margin-top:var(--rtk-space-10, 40px);margin-bottom:var(--rtk-space-10, 40px);text-align:center;font-size:14px;color:rgb(var(--rtk-colors-text-700, 255 255 255 / 0.64))}.empty-room{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:var(--rtk-space-2, 8px);height:100%;text-align:center;color:rgb(var(--rtk-colors-text-700, 255 255 255 / 0.64))}.empty-room rtk-icon{height:var(--rtk-space-7, 28px);width:var(--rtk-space-7, 28px)}.empty-room p{font-size:16px;font-weight:500;margin:var(--rtk-space-0, 0px)}.empty-room span{font-size:12px;color:rgb(var(--rtk-colors-text-600, 255 255 255 / 0.52))}.search-wrapper{margin-bottom:var(--rtk-space-1, 4px);display:flex;align-items:center;gap:var(--rtk-space-2, 8px)}.search{position:sticky;box-sizing:border-box;display:flex;align-items:center;border-radius:var(--rtk-border-radius-sm, 4px);--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-background-800, 30 30 30) / var(--tw-bg-opacity));margin-top:var(--rtk-space-0, 0px);margin-bottom:var(--rtk-space-0, 0px);height:var(--rtk-space-8, 32px)}.search .search-icon{margin-left:var(--rtk-space-2, 8px);margin-right:var(--rtk-space-2, 8px);height:var(--rtk-space-5, 20px);width:var(--rtk-space-5, 20px);color:rgb(var(--rtk-colors-text-600, 255 255 255 / 0.52))}.search input{box-sizing:border-box;width:100%;padding-right:var(--rtk-space-2, 8px);border-width:var(--rtk-border-width-none, 0);border-style:none;background-color:inherit;color:rgb(var(--rtk-colors-text-1000, 255 255 255));outline:2px solid transparent;outline-offset:2px;border-radius:var(--rtk-border-radius-sm, 4px);font-size:14px}.search input::-moz-placeholder{color:rgb(var(--rtk-colors-text-800, 255 255 255 / 0.76))}.search input::placeholder{color:rgb(var(--rtk-colors-text-800, 255 255 255 / 0.76))}.header{margin-left:var(--rtk-space-2, 8px);margin-right:var(--rtk-space-1\\.5, 6px);height:var(--rtk-space-9, 36px);padding-top:var(--rtk-space-3, 12px);padding-bottom:var(--rtk-space-3, 12px);padding-right:var(--rtk-space-0\\.5, 2px);border-bottom-width:var(--rtk-border-width-sm, 1px);border-top-width:var(--rtk-border-width-none, 0);border-right-width:var(--rtk-border-width-none, 0);border-left-width:var(--rtk-border-width-none, 0);border-style:solid;--tw-border-opacity:1;border-bottom-color:rgba(var(--rtk-colors-background-600, 60 60 60) / var(--tw-border-opacity));font-size:12px;color:rgb(var(--rtk-colors-text-900, 255 255 255 / 0.88));display:flex;align-items:center;justify-content:space-between}.title-wrapper{display:flex;align-items:center;gap:var(--rtk-space-2, 8px)}.participant-count{display:flex;align-items:center;font-size:14px}.participant-count rtk-icon{margin-right:var(--rtk-space-0\\.5, 2px);width:var(--rtk-space-3, 12px)}.participant-item{display:flex;align-items:center;justify-content:space-between;margin-top:var(--rtk-space-1, 4px);margin-bottom:var(--rtk-space-1, 4px);border-radius:var(--rtk-border-radius-sm, 4px);padding-left:var(--rtk-space-2, 8px);padding-right:var(--rtk-space-2, 8px);cursor:pointer}.participant-item input.hide-checkbox{display:none}.participant-item input:checked{display:inline-block}.dragging input{display:none}.participant-item:hover{--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-background-600, 60 60 60) / var(--tw-bg-opacity))}.participant-item:hover input{display:inline-block}.peer-ui-container{position:relative;display:flex;align-items:center;gap:var(--rtk-space-2, 8px);height:var(--rtk-space-10, 40px);cursor:pointer;border-radius:var(--rtk-border-radius-sm, 4px);color:rgb(var(--rtk-colors-text-700, 255 255 255 / 0.64))}.peer-ui-container rtk-avatar{height:var(--rtk-space-7, 28px);width:var(--rtk-space-7, 28px);font-size:14px;color:rgb(var(--rtk-colors-text-1000, 255 255 255))}.peer-ui-container .name{font-size:14px;overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:1}";var no=function(t,e,i,r){var a,s=arguments.length,n=s<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,i,r);else for(var o=t.length-1;o>=0;o--)(a=t[o])&&(n=(s<3?a(n):s>3?a(e,i,n):a(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};const oo=class{constructor(t){o(this,t),this.stateUpdate=Y(this,"rtkStateUpdate",7),this.loading=!1,this.roomConfig={rooms:2,step:"room-config",mode:"create",applyingChanges:!1},this.assigningParticipants=!1,this.selectedParticipants=[],this.ephemeralStatusText="",this.isDragMode=!1,this.iconPack=je,this.t=Fe(),this.permissionsUpdateListener=()=>{this.permissions=this.meeting.self.permissions.connectedMeetings},this.updateLocalState=t=>{this.stateManager.updateCurrentState(t),this.draftState=this.stateManager.currentState,this.meeting.connectedMeetings.isActive&&(this.roomConfig=Object.assign(Object.assign({},this.roomConfig),{mode:"edit"})),"create"!==this.roomConfig.mode||this.meeting.connectedMeetings.isActive||(ce=0),["edit","view"].includes(this.roomConfig.mode)&&(this.roomConfig=Object.assign(Object.assign({},this.roomConfig),{rooms:t.meetings.length,step:"participants-config"}),this.selectedParticipants=[])},this.onAddNewRoom=()=>{this.stateManager.addNewMeeting(),this.draftState=this.stateManager.currentState,this.selectorRef.scrollTo({top:this.selectorRef.scrollHeight,behavior:"smooth"})},this.onRoomUpdate=t=>{const{detail:e}=t;this.stateManager.updateMeetingTitle(e.id,e.title),this.draftState=this.stateManager.currentState},this.onRoomDelete=t=>{this.stateManager.allConnectedMeetings.find((e=>e.id===t))&&(this.stateManager.deleteMeeting(t),this.draftState=this.stateManager.currentState)},this.unassignParticipant=t=>{this.stateManager.unassignParticipants([t]),this.draftState=this.stateManager.currentState},this.onUnassignAll=()=>{this.stateManager.unassignAllParticipants(),this.draftState=this.stateManager.currentState},this.assignParticipantsToRoom=t=>{0!==this.selectedParticipants.length&&0!=this.assigningParticipants&&(this.stateManager.assignParticipantsToMeeting(this.selectedParticipants,t),this.draftState=this.stateManager.currentState,this.selectedParticipants=[],this.assigningParticipants=!1,this.setEphemeralStatus(this.t("breakout_rooms.ephemeral_status.participants_assigned")))},this.handleClose=(t,e)=>{t.emit({activeBreakoutRoomsManager:{active:!0}}),e.activeBreakoutRoomsManager={active:!0}},this.enableConfirmationModal=(t="start-breakout")=>{let e={active:!0,header:"breakout_rooms.confirm_modal.start_breakout.header",content:"breakout_rooms.confirm_modal.start_breakout.content",variant:"primary",cancelText:"breakout_rooms.confirm_modal.start_breakout.cancelText",ctaText:"breakout_rooms.confirm_modal.start_breakout.ctaText",onClick:()=>this.applyChanges(),onClose:this.handleClose};"close-breakout"===t&&(e={active:!0,header:"breakout_rooms.confirm_modal.close_breakout.header",content:"breakout_rooms.confirm_modal.close_breakout.content",variant:"danger",cancelText:"cancel",ctaText:"breakout_rooms.confirm_modal.close_breakout.ctaText",onClick:()=>this.closeBreakout(),onClose:this.handleClose}),this.stateUpdate.emit({activeBreakoutRoomsManager:{active:!1},activeConfirmationModal:e})},this.close=()=>{this.stateManager.discardChanges(),this.stateUpdate.emit({activeBreakoutRoomsManager:{active:!1}})},this.applyChanges=async()=>{this.roomConfig=Object.assign(Object.assign({},this.roomConfig),{applyingChanges:!0}),await this.stateManager.applyChanges(this.meeting),this.close(),this.roomConfig=Object.assign(Object.assign({},this.roomConfig),{applyingChanges:!1})}}onSelectedParticipantsChanged(t){t.length>0?this.assigningParticipants=!0:this.assigningParticipants=!1}connectedCallback(){this.permissionsUpdateListener(),this.meeting.connectedMeetings.on("stateUpdate",this.updateLocalState),this.meeting.connectedMeetings.on("changingMeeting",this.close),this.meeting.self.permissions.on("permissionsUpdate",this.permissionsUpdateListener),this.stateManager=new Ae,this.fetchRoomState()}disconnectedCallback(){this.meeting.connectedMeetings.off("stateUpdate",this.updateLocalState),this.meeting.connectedMeetings.off("changingMeeting",this.close),this.meeting.self.permissions.off("permissionsUpdate",this.permissionsUpdateListener)}async fetchRoomState(){this.loading=!0,await this.meeting.connectedMeetings.getConnectedMeetings(),this.loading=!1}setEphemeralStatus(t){this.ephemeralStatusText=t,setTimeout((()=>{this.ephemeralStatusText=""}),3e3)}onCreateRooms(){this.selectedParticipants=[],this.stateManager.addNewMeetings(this.roomConfig.rooms),this.draftState=this.stateManager.currentState,this.roomConfig=Object.assign(Object.assign({},this.roomConfig),{step:"participants-config"})}onParticipantDelete(t){const{detail:e}=t,i=he(e);null!=i&&this.unassignParticipant(i)}toggleDragMode(t){this.isDragMode=t.detail}assignParticipantsRandomly(){0!==this.stateManager.unassignedParticipants.length&&(this.stateManager.assignParticipantsRandomly(),this.draftState=this.stateManager.currentState,this.setEphemeralStatus(this.t("breakout_rooms.ephemeral_status.participants_assigned_randomly")))}async joinRoom(t){const e=he(this.meeting.self);this.stateManager.assignParticipantsToMeeting([e],t),await this.applyChanges()}async closeBreakout(){this.stateManager.allConnectedMeetings.forEach((t=>this.stateManager.deleteMeeting(t.id))),await this.applyChanges()}updateSelectedParticipants(t){this.selectedParticipants=t.detail}updateAllParticipants(t){this.selectedParticipants=t.detail}getStatusText(){if(""!==this.ephemeralStatusText)return this.ephemeralStatusText;let t="";return"create"===this.roomConfig.mode&&(t=this.t("breakout_rooms.status.assign_multiple"),0!==this.selectedParticipants.length&&(t=this.t("breakout_rooms.status.select_room"))),t}getApproxDistribution(){const t=this.stateManager.unassignedParticipants.length/(this.roomConfig.rooms||1);return Math.max(1,Math.round(t))}deselectAll(){this.selectedParticipants=[]}async discardChanges(){this.stateManager.discardChanges(),await this.fetchRoomState(),this.setEphemeralStatus(this.t("breakout_rooms.ephemeral_status.changes_discarded"))}shouldShowOnlyRoomSwitcher(){return!1===this.permissions.canAlterConnectedMeetings}getPermittedRooms(){return this.permissions.canAlterConnectedMeetings||this.permissions.canSwitchConnectedMeetings?this.stateManager.allConnectedMeetings:this.stateManager.allConnectedMeetings.filter((t=>t.id===this.meeting.meta.meetingId))}renderMainRoomMaybe(){return this.meeting.connectedMeetings.isActive&&this.permissions.canSwitchToParentMeeting?N("rtk-breakout-room-manager",{key:this.stateManager.currentState.parentMeeting.id,assigningParticipants:this.assigningParticipants,isDragMode:this.isDragMode,meeting:this.meeting,mode:this.roomConfig.mode,onParticipantsAdd:()=>this.assignParticipantsToRoom(this.stateManager.currentState.parentMeeting.id),onRoomJoin:()=>this.joinRoom(this.stateManager.currentState.parentMeeting.id),onUpdate:this.onRoomUpdate,states:this.states,room:Object.assign({},this.stateManager.currentState.parentMeeting),iconPack:this.iconPack,t:this.t}):null}renderRoomSwitcher(){return N(H,null,N("div",{class:"room-switcher-container"},N("header",null,N("rtk-icon",{icon:this.iconPack.breakout_rooms}),N("span",null,this.t("breakout_rooms.join_breakout_header"))),N("div",{class:"rooms",ref:t=>this.selectorRef=t},this.renderMainRoomMaybe(),this.getPermittedRooms().map(((t,e)=>N("rtk-breakout-room-manager",{key:t.id,assigningParticipants:this.assigningParticipants,isDragMode:this.isDragMode,defaultExpanded:0===e,meeting:this.meeting,mode:this.roomConfig.mode,onDelete:()=>this.onRoomDelete(t.id),onParticipantsAdd:()=>this.assignParticipantsToRoom(t.id),onRoomJoin:()=>this.joinRoom(t.id),states:this.states,room:Object.assign({},t),iconPack:this.iconPack,t:this.t,allowDelete:!1}))))))}renderLoading(){return N(H,null,N("div",{class:"loading-content"},N("rtk-spinner",{size:"xl"})))}renderRoomConfig(){return N(H,null,N("div",{class:"room-config"},N("header",null,N("rtk-icon",{icon:this.iconPack.breakout_rooms}),N("span",null,this.t("breakout_rooms.room_config_header"))),N("div",{class:"create-room"},N("p",null,this.t("breakout_rooms.num_of_rooms")),N("rtk-counter",{value:this.roomConfig.rooms,minValue:1,iconPack:this.iconPack,t:this.t,onValueChange:t=>{this.roomConfig=Object.assign(Object.assign({},this.roomConfig),{rooms:Math.max(+t.detail,1)})}})),N("span",{class:"distribution-hint"},`${this.t("breakout_rooms.approx")} `," ",N("em",null,this.getApproxDistribution()," ",this.t("breakout_rooms.participants_per_room"))," ",this.t("breakout_rooms.division_text")),N("footer",null,N("rtk-button",{kind:"button",size:"lg",title:this.t("create"),disabled:0===this.roomConfig.rooms,onClick:()=>this.onCreateRooms()},this.t("create")))))}render(){return this.loading?this.renderLoading():this.shouldShowOnlyRoomSwitcher()?this.renderRoomSwitcher():"room-config"===this.roomConfig.step?this.renderRoomConfig():N(H,null,N("div",{class:"participant-config-wrapper"},N("div",{class:"participant-config"},N("aside",{part:"menu"},N("header",null,this.t("breakout_rooms.assign_participants")),N("rtk-breakout-room-participants",{meeting:this.meeting,iconPack:this.iconPack,t:this.t,participantIds:this.stateManager.unassignedParticipants.map(he),selectedParticipantIds:this.selectedParticipants},N("rtk-tooltip",{label:this.t("breakout_rooms.shuffle_participants"),slot:"shuffle-button"},N("rtk-button",{disabled:"edit"===this.roomConfig.mode||0===this.stateManager.unassignedParticipants.length,kind:"button",variant:"secondary",size:"md",onClick:()=>this.assignParticipantsRandomly(),class:"shuffle-button br-primary-btn"},N("rtk-icon",{icon:this.iconPack.shuffle})))),0!==this.selectedParticipants.length&&N("div",{class:"participants-assign-actions"},N("span",null,`${this.selectedParticipants.length} ${this.t("breakout_rooms.selected")}`),N("rtk-button",{disabled:"edit"===this.roomConfig.mode,kind:"button",variant:"ghost",size:"md",onClick:()=>this.deselectAll(),class:"deselect-button color-danger"},this.t("breakout_rooms.deselect")))),N("div",{class:"assign-rooms"},N("div",{class:"row"},N("p",{class:"row-header"},this.t("breakout_rooms.rooms")," (",this.stateManager.allConnectedMeetings.length,")"),!this.assigningParticipants&&N("div",{class:"cta-buttons"},N("rtk-button",{kind:"button",variant:"secondary",class:"br-primary-btn"},N("div",{onClick:this.onAddNewRoom},N("rtk-icon",{icon:this.iconPack.add}),this.t("breakout_rooms.add_room"))),0!==this.stateManager.allConnectedMeetings.flatMap((t=>t.participants)).length&&N("rtk-button",{kind:"button",variant:"ghost",onClick:this.onUnassignAll},this.t("breakout_rooms.unassign_all")))),N("div",{class:"rooms",ref:t=>this.selectorRef=t},this.renderMainRoomMaybe(),this.getPermittedRooms().map(((t,e)=>N("rtk-breakout-room-manager",{key:t.id,assigningParticipants:this.assigningParticipants,isDragMode:this.isDragMode,defaultExpanded:0===e,meeting:this.meeting,mode:this.roomConfig.mode,onDelete:()=>this.onRoomDelete(t.id),onParticipantsAdd:()=>this.assignParticipantsToRoom(t.id),onRoomJoin:()=>this.joinRoom(t.id),onUpdate:this.onRoomUpdate,states:this.states,room:Object.assign({},t),iconPack:this.iconPack,t:this.t,allowDelete:this.stateManager.allConnectedMeetings.length>1}))),N("rtk-button",{kind:"button",variant:"secondary",onClick:this.onAddNewRoom,class:"add-room-jumbo-btn br-secondary-btn"},N("div",null,N("rtk-icon",{icon:this.iconPack.add}),N("span",null,this.t("breakout_rooms.add_room_brief"))))))),N("div",{class:"participant-config-actions"},N("div",{class:{"status-bar":!0,"ephemeral-status":""!==this.ephemeralStatusText}},""!==this.ephemeralStatusText&&N("rtk-icon",{icon:this.iconPack.checkmark}),this.getStatusText()),N("div",{class:"breakout-actions"},"create"===this.roomConfig.mode&&this.permissions.canAlterConnectedMeetings&&N("rtk-button",{size:"md",class:"start-breakout-button",onClick:()=>this.enableConfirmationModal("start-breakout")},this.t("breakout_rooms.start_breakout")),"edit"===this.roomConfig.mode&&this.stateManager.hasLocalChanges&&this.permissions.canAlterConnectedMeetings&&N("rtk-button",{size:"md",class:"color-danger",variant:"ghost",onClick:()=>this.discardChanges()},this.t("breakout_rooms.discard_changes")),"edit"===this.roomConfig.mode&&this.stateManager.hasLocalChanges&&this.permissions.canAlterConnectedMeetings&&N("rtk-button",{size:"md",class:"update-breakout-button",onClick:this.applyChanges},this.t("breakout_rooms.update_breakout")),"edit"===this.roomConfig.mode&&!this.stateManager.hasLocalChanges&&this.permissions.canAlterConnectedMeetings&&N("rtk-button",{size:"md",class:"close-breakout-button",onClick:()=>this.enableConfirmationModal("close-breakout")},this.t("breakout_rooms.close_breakout"))))))}static get watchers(){return{selectedParticipants:["onSelectedParticipantsChanged"]}}};no([ai()],oo.prototype,"meeting",void 0),no([ai()],oo.prototype,"states",void 0),no([ai()],oo.prototype,"iconPack",void 0),no([ai()],oo.prototype,"t",void 0),oo.style=":host{line-height:initial;font-family:var(--rtk-font-family, sans-serif);font-feature-settings:normal;font-variation-settings:normal}p{margin:var(--rtk-space-0, 0px);padding:var(--rtk-space-0, 0px)}.color-brand{--tw-text-opacity:1;color:rgba(var(--rtk-colors-brand-300, 73 124 253) / var(--tw-text-opacity))}.color-danger{--tw-text-opacity:1;color:rgba(var(--rtk-colors-danger, 255 45 45) / var(--tw-text-opacity))}.loading-content{height:var(--rtk-space-60, 240px);width:var(--rtk-space-96, 384px);padding:var(--rtk-space-9, 36px);--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-background-1000, 8 8 8) / var(--tw-bg-opacity));display:flex;align-items:center;justify-content:center}.room-config{overflow:hidden;border-radius:var(--rtk-border-radius-md, 8px);--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-background-1000, 8 8 8) / var(--tw-bg-opacity));display:flex;flex-direction:column;width:var(--rtk-space-96, 384px);padding-left:var(--rtk-space-9, 36px);padding-right:var(--rtk-space-9, 36px);padding-top:var(--rtk-space-10, 40px);padding-bottom:var(--rtk-space-10, 40px)}header{margin-bottom:var(--rtk-space-8, 32px);display:flex;align-items:center;gap:var(--rtk-space-2, 8px);font-size:24px;font-weight:600}header rtk-icon{height:var(--rtk-space-7, 28px);width:var(--rtk-space-7, 28px)}.create-room{margin-bottom:var(--rtk-space-4, 16px);display:flex;align-items:center;gap:var(--rtk-space-3, 12px);width:100%}.create-room p{margin:var(--rtk-space-0, 0px);margin-bottom:var(--rtk-space-1, 4px);font-size:16px}.distribution-hint{margin-bottom:var(--rtk-space-8, 32px);font-size:14px;font-weight:400;color:rgb(var(--rtk-colors-text-600, 255 255 255 / 0.52))}.distribution-hint em{font-style:normal;color:rgb(var(--rtk-colors-text-800, 255 255 255 / 0.76))}footer{display:flex;flex-direction:row;vertical-align:middle;justify-content:center}footer rtk-button{width:100%;color:rgb(var(--rtk-colors-text-1000, 255 255 255))}label{margin-bottom:var(--rtk-space-3, 12px);font-weight:400;color:rgb(var(--rtk-colors-text-1000, 255 255 255));opacity:0.4}.participant-config-wrapper{width:850px;height:595px;max-width:100%;max-height:100%;border-radius:var(--rtk-border-radius-md, 8px);--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-background-900, 26 26 26) / var(--tw-bg-opacity));display:flex;flex-direction:column}.participant-config-actions{display:flex;justify-content:space-between;padding-left:var(--rtk-space-8, 32px);padding-right:var(--rtk-space-8, 32px);padding-top:var(--rtk-space-5, 20px);padding-bottom:var(--rtk-space-5, 20px);border-bottom-right-radius:var(--rtk-border-radius-md, 8px);border-bottom-left-radius:var(--rtk-border-radius-md, 8px);--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-background-1000, 8 8 8) / var(--tw-bg-opacity))}.participant-config{display:flex;flex-grow:1;flex-direction:row;overflow:hidden}aside{box-sizing:border-box;display:flex;width:var(--rtk-space-96, 384px);flex-grow:1;flex-direction:column;padding-left:var(--rtk-space-8, 32px);padding-right:var(--rtk-space-4, 16px);border-right-width:var(--rtk-border-width-sm, 1px);border-top-width:var(--rtk-border-width-none, 0);border-bottom-width:var(--rtk-border-width-none, 0);border-left-width:var(--rtk-border-width-none, 0);border-style:solid;--tw-border-opacity:1;border-right-color:rgba(var(--rtk-colors-background-600, 60 60 60) / var(--tw-border-opacity))}aside header{margin-bottom:var(--rtk-space-4, 16px);width:100%;padding-left:var(--rtk-space-0, 0px);padding-right:var(--rtk-space-0, 0px);padding-top:var(--rtk-space-8, 32px);font-size:20px;font-weight:500;line-height:2rem}.shuffle-button{display:flex;flex-direction:row;align-items:center}.shuffle-button rtk-icon{height:var(--rtk-space-8, 32px)}.participants-assign-actions{display:flex;flex-direction:row;align-items:center;justify-content:space-between;font-size:14px;padding-left:var(--rtk-space-8, 32px);padding-right:var(--rtk-space-2, 8px);margin-left:calc(var(--rtk-space-8, 32px) * -1);margin-right:calc(var(--rtk-space-4, 16px) * -1);padding-top:var(--rtk-space-0\\.5, 2px);padding-bottom:var(--rtk-space-0\\.5, 2px);--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-background-700, 44 44 44) / var(--tw-bg-opacity))}.participants-assign-actions .deselect-button{height:var(--rtk-space-6, 24px)}.participants-assign-actions .deselect-button:hover{--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-background-700, 44 44 44) / var(--tw-bg-opacity))}.assign-rooms{padding:var(--rtk-space-8, 32px);display:flex;width:100%;flex-direction:column}.assign-rooms .disabled{opacity:0.2}.assign-rooms .back{display:flex;cursor:pointer;flex-direction:row;align-items:center;justify-content:flex-start;padding:var(--rtk-space-4, 16px);padding-bottom:var(--rtk-space-0, 0px);font-size:14px;color:rgb(var(--rtk-colors-text-800, 255 255 255 / 0.76))}.assign-rooms .back rtk-icon{height:var(--rtk-space-5, 20px)}.assign-rooms .row{display:flex;flex-direction:row;align-items:center;justify-content:flex-start;gap:var(--rtk-space-3, 12px);margin-bottom:var(--rtk-space-4, 16px);font-size:14px}.assign-rooms .row-header{margin:var(--rtk-space-0, 0px);font-size:16px;line-height:2rem}.assign-rooms .cta-buttons{display:flex;align-items:center;justify-content:flex-start;gap:var(--rtk-space-2, 8px)}.assign-rooms .cta-buttons rtk-button div{display:flex;flex-direction:row;align-items:center}.assign-rooms .cta-buttons rtk-button div rtk-icon{height:var(--rtk-space-4, 16px);width:var(--rtk-space-4, 16px)}.rooms{margin-bottom:var(--rtk-space-2, 8px);padding-right:var(--rtk-space-1, 4px);display:flex;flex-grow:1;flex-direction:column;gap:var(--rtk-space-2, 8px);overflow-y:auto;max-height:500px}.rooms::-webkit-scrollbar{width:var(--rtk-space-1\\.5, 6px);border-radius:var(--rtk-border-radius-sm, 4px)}.rooms::-webkit-scrollbar-thumb{border-radius:var(--rtk-border-radius-sm, 4px);--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-background-600, 60 60 60) / var(--tw-bg-opacity))}.rooms::-webkit-scrollbar-track{border-radius:var(--rtk-border-radius-sm, 4px);--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-background-800, 30 30 30) / var(--tw-bg-opacity))}.breakout-actions{display:flex;flex-direction:row;align-items:center;justify-content:flex-end;gap:var(--rtk-space-2, 8px)}.breakout-actions .start-breakout-button{color:rgb(var(--rtk-colors-text-1000, 255 255 255))}.breakout-actions .close-breakout-button{color:rgb(var(--rtk-colors-text-1000, 255 255 255));--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-danger, 255 45 45) / var(--tw-bg-opacity))}.breakout-actions .update-breakout-button{background-color:transparent;--tw-text-opacity:1;color:rgba(var(--rtk-colors-brand-500, 33 96 253) / var(--tw-text-opacity));border-width:var(--rtk-border-width-sm, 1px);border-style:solid;--tw-border-opacity:1;border-color:rgba(var(--rtk-colors-brand-500, 33 96 253) / var(--tw-border-opacity))}.status-bar{display:flex;align-items:center;font-size:14px;color:rgb(var(--rtk-colors-text-700, 255 255 255 / 0.64));width:var(--rtk-space-80, 320px)}.ephemeral-status{--tw-text-opacity:1;color:rgba(var(--rtk-colors-success, 98 165 4) / var(--tw-text-opacity))}.ephemeral-status rtk-icon{height:var(--rtk-space-4, 16px);width:var(--rtk-space-4, 16px)}.room-switcher-container{border-radius:var(--rtk-border-radius-md, 8px);--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-background-1000, 8 8 8) / var(--tw-bg-opacity));width:468px;padding:var(--rtk-space-8, 32px)}.add-room-jumbo-btn div{display:flex;align-items:center;gap:var(--rtk-space-1, 4px);font-size:14px;--tw-text-opacity:1;color:rgba(var(--rtk-colors-brand-300, 73 124 253) / var(--tw-text-opacity))}.add-room-jumbo-btn div rtk-icon{height:var(--rtk-space-4, 16px);width:var(--rtk-space-4, 16px)}.br-primary-btn:not([disabled]){--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-background-800, 30 30 30) / var(--tw-bg-opacity))}.br-primary-btn:not([disabled]):hover{--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-brand-600, 13 81 253) / var(--tw-bg-opacity))}.br-secondary-btn:not([disabled]){--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-background-800, 30 30 30) / var(--tw-bg-opacity))}.br-secondary-btn:not([disabled]):hover{--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-background-600, 60 60 60) / var(--tw-bg-opacity))}";var co=function(t,e,i,r){var a,s=arguments.length,n=s<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,i,r);else for(var o=t.length-1;o>=0;o--)(a=t[o])&&(n=(s<3?a(n):s>3?a(e,i,n):a(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};const lo=class{constructor(t){o(this,t),this.stateUpdate=Y(this,"rtkStateUpdate",7),this.iconPack=je,this.t=Fe(),this.messagePayload={to:"Everyone",message:""},this.successMessage=!1}close(){var t;null===(t=this.stateUpdate)||void 0===t||t.emit({activeBroadcastMessageModal:!1})}sendMessage(){this.successMessage=!0,setTimeout((()=>{this.close()}),2e3)}render(){return N(H,{key:"ebc1bb7e9831ccecba8474cfc7af14dc5cb4d916"},N("div",{key:"f29fc0d8cd70f0d25b58073dedc56dbfece82f6e",class:"content-col"},N("h2",{key:"6e872c41a1735e396fec8c01286a6e551307d054"},"Broadcast message to"),N("select",{key:"de6fa3415f3b4fab48477ba68925981adac9d7da",onChange:t=>{this.messagePayload=Object.assign(Object.assign({},this.messagePayload),{to:t.target.value})}},N("option",{key:"85c21decd587ecbff9623d140c7e69e335d86e4e"},"Everyone"),N("option",{key:"e70c43b9bedd7a66519757842524af7fdd62b3d3"},"List of rooms")),N("textarea",{key:"c988e01cb69f54aa447f1d643acb0f046b95d3fd",placeholder:"Type message here...",onInput:t=>{this.messagePayload=Object.assign(Object.assign({},this.messagePayload),{message:t.target.value})}}),this.successMessage?N("p",null,"Message sent to ",this.messagePayload.to,N("rtk-icon",{icon:this.iconPack.checkmark})):N("div",{class:"content-row"},N("rtk-button",{onClick:()=>this.close(),variant:"secondary"},"Cancel")," ",N("rtk-button",{variant:"primary",onClick:()=>this.sendMessage()},"Send"))))}};co([ai()],lo.prototype,"meeting",void 0),co([ai()],lo.prototype,"states",void 0),co([ai()],lo.prototype,"iconPack",void 0),co([ai()],lo.prototype,"t",void 0),lo.style=":host{line-height:initial;font-family:var(--rtk-font-family, sans-serif);font-feature-settings:normal;font-variation-settings:normal}p{margin:var(--rtk-space-0, 0px);padding:var(--rtk-space-0, 0px)}:host{position:relative;display:flex;flex-direction:column;overflow:hidden;border-radius:var(--rtk-border-radius-md, 8px);padding:var(--rtk-space-4, 16px);width:100%;--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-background-800, 30 30 30) / var(--tw-bg-opacity));color:rgb(var(--rtk-colors-text-1000, 255 255 255));width:400px;max-width:80%}.content-col{display:flex;width:100%;flex-direction:column}h2{margin:var(--rtk-space-0, 0px);margin-bottom:var(--rtk-space-2, 8px)}.content-row{display:flex;width:100%;flex-direction:row}.content-row rtk-button{margin-top:var(--rtk-space-4, 16px);width:100%}textarea{margin-top:var(--rtk-space-3, 12px);resize:none;border-radius:var(--rtk-border-radius-sm, 4px);border-width:var(--rtk-border-width-none, 0);border-style:none;font-family:var(--rtk-font-family, sans-serif);outline:2px solid transparent;outline-offset:2px;height:var(--rtk-space-16, 64px);--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-background-700, 44 44 44) / var(--tw-bg-opacity));padding:var(--rtk-space-2, 8px);color:rgb(var(--rtk-colors-text-800, 255 255 255 / 0.76))}textarea::-moz-placeholder{color:rgb(var(--rtk-colors-text-600, 255 255 255 / 0.52))}textarea::placeholder{color:rgb(var(--rtk-colors-text-600, 255 255 255 / 0.52))}select{border-radius:var(--rtk-border-radius-sm, 4px);border-width:var(--rtk-border-width-none, 0);border-style:none;padding-top:var(--rtk-space-3, 12px);padding-bottom:var(--rtk-space-3, 12px);padding-left:var(--rtk-space-2, 8px);padding-right:var(--rtk-space-2, 8px);outline:2px solid transparent;outline-offset:2px;border-right-width:var(--rtk-border-width-md, 2px);border-style:solid;border-color:transparent;--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-background-700, 44 44 44) / var(--tw-bg-opacity));color:rgb(var(--rtk-colors-text-1000, 255 255 255))}p{margin:var(--rtk-space-0, 0px);margin-top:var(--rtk-space-2, 8px);width:100%;text-align:center;font-size:14px;--tw-text-opacity:1;color:rgba(var(--rtk-colors-brand-300, 73 124 253) / var(--tw-text-opacity));display:flex;flex-direction:row;align-items:center;justify-content:center}p rtk-icon{margin-left:var(--rtk-space-1, 4px);height:var(--rtk-space-5, 20px)}";const ho=class{constructor(t){o(this,t),this.variant="primary",this.kind="button",this.reverse=!1,this.disabled=!1,this.type="button"}render(){return N(H,{key:"c6135911cab1cd37d5ebd46269f76fd175c41d25"},N("button",{key:"f1872eb9efc1c00b36ab8729ac27c303cd4d775e",part:"button",type:this.type,disabled:this.disabled},N("span",{key:"5a56e98710749503987b045bbe9d833e5708a26c",class:"start"},N("slot",{key:"0963cce1a1788c816503176c05346839fd302fdc",name:"start"})),N("span",{key:"c19dab69abffcea5926e04799aa29dc946ccedf9",class:"content",part:"content"},N("slot",{key:"c89ef75f65e53e26ba85922c2191d411ea445df4"})),N("span",{key:"0eed62f1fcdc33939f41c10e4cf9ddb47dbc379d",class:"end"},N("slot",{key:"3376b8976558c0265837b4f86fa07300f84f2469",name:"end"}))))}static get delegatesFocus(){return!0}};!function(t,e,i,r){var a,s=arguments.length,n=s<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,i,r);else for(var o=t.length-1;o>=0;o--)(a=t[o])&&(n=(s<3?a(n):s>3?a(e,i,n):a(e,i))||n);s>3&&n&&Object.defineProperty(e,i,n)}([ai()],ho.prototype,"size",void 0),ho.style=":host{line-height:initial;font-family:var(--rtk-font-family, sans-serif);font-feature-settings:normal;font-variation-settings:normal}p{margin:var(--rtk-space-0, 0px);padding:var(--rtk-space-0, 0px)}:host{--icon-size:var(--rtk-button-icon-size, var(--rtk-space-5, 20px));--transition-property:var(--rtk-transition-property, all);--transition-duration:100ms;display:inline-flex;height:var(--rtk-space-8, 32px);cursor:pointer;--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-brand-500, 33 96 253) / var(--tw-bg-opacity));color:rgb(var(--rtk-colors-text-1000, 255 255 255));font-size:14px;-webkit-user-select:none;-moz-user-select:none;user-select:none;border-radius:var(--rtk-border-radius-sm, 4px);transition-property:var(--transition-property);transition-duration:var(--transition-duration)}button{box-sizing:border-box;background-color:transparent;color:inherit;border:var(--rtk-border-width-sm, 1px) solid transparent;padding-left:var(--rtk-space-2, 8px);padding-right:var(--rtk-space-2, 8px);display:inline-flex;flex-grow:1;justify-content:center;vertical-align:baseline;gap:var(--rtk-space-1, 4px);transition-property:var(--transition-property);transition-duration:var(--transition-duration);outline:none;height:inherit;border-radius:inherit;fill:inherit;cursor:inherit;font-weight:inherit;font-family:inherit;font-size:inherit;line-height:inherit}.start,.content,.end{align-self:center}::slotted(rtk-icon),::slotted(rtk-spinner){height:var(--icon-size);width:var(--icon-size)}:host([variant='primary']){color:rgb(var(--rtk-colors-text-on-brand-1000, var(--rtk-colors-text-1000, 255 255 255)))}:host(:hover){--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-brand-600, 13 81 253) / var(--tw-bg-opacity))}button:focus-visible{border-color:rgb(var(--rtk-colors-text-1000, 255 255 255))}:host(:active){--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-brand-700, 2 70 253) / var(--tw-bg-opacity))}:host([disabled]:not([disabled='false'])){cursor:not-allowed;opacity:0.6}:host([variant='secondary']){--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-background-600, 60 60 60) / var(--tw-bg-opacity))}:host([variant='secondary']:hover){--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-background-800, 30 30 30) / var(--tw-bg-opacity))}:host([variant='secondary']:active){--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-background-900, 26 26 26) / var(--tw-bg-opacity))}:host([variant='danger']){--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-danger, 255 45 45) / var(--tw-bg-opacity))}:host([variant='danger']:hover){background-color:rgba(var(--rtk-colors-danger, 255 45 45) / 0.7)}:host([variant='danger']:active){--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-danger, 255 45 45) / var(--tw-bg-opacity))}:host([variant='ghost']){background-color:transparent;color:inherit}:host([variant='ghost'].active){--tw-text-opacity:1;color:rgba(var(--rtk-colors-brand-300, 73 124 253) / var(--tw-text-opacity))}:host([variant='ghost']:hover){--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-background-600, 60 60 60) / var(--tw-bg-opacity))}:host([variant='ghost']:active){--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-background-700, 44 44 44) / var(--tw-bg-opacity))}:host([kind='icon']){--icon-size:var(--rtk-space-5, 20px);width:var(--rtk-space-8, 32px)}:host([kind='icon']) button{padding-left:var(--rtk-space-0, 0px);padding-right:var(--rtk-space-0, 0px)}:host([kind='wide']){width:100%}:host([size='lg']){--icon-size:var(--rtk-space-5, 20px);height:var(--rtk-space-10, 40px);font-size:16px}:host([size='lg'][kind='icon']){--icon-size:var(--rtk-space-6, 24px);height:var(--rtk-space-10, 40px);width:var(--rtk-space-10, 40px)}:host([size='sm']){--icon-size:var(--rtk-space-4, 16px);height:var(--rtk-space-6, 24px);font-size:12px}:host([size='sm'][kind='icon']){height:var(--rtk-space-6, 24px);width:var(--rtk-space-6, 24px)}";var po=function(t,e,i,r){var a,s=arguments.length,n=s<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,i,r);else for(var o=t.length-1;o>=0;o--)(a=t[o])&&(n=(s<3?a(n):s>3?a(e,i,n):a(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};const go=class{constructor(t){o(this,t),this.stateUpdate=Y(this,"rtkStateUpdate",7),this.switchChannel=Y(this,"switchChannel",7),this.t=Fe(),this.iconPack=je,this.channelName="",this.searchQuery="",this.step=1,this.loading=!1,this.selectedMemberIds=new Set,this.focusedMemberIndex=-1,this.showAllMembersList=!1,this.allMembers=new Map,this.inputTextRef=null,this.searchInputTextRef=null,this.focusOnSearch=(t=!1)=>{this.focusedMemberIndex=-1,C((()=>{var e,i;null===(e=this.searchInputTextRef)||void 0===e||e.focus(),t&&(null===(i=this.searchInputTextRef)||void 0===i||i.select())}))},this.onClickHandler=async()=>{if(0!==this.channelName.length){if(1===this.step){const t=this.meeting.participants.all.toArray(),e=this.meeting.self.userId;return t.filter((t=>t.userId!==e)).forEach((t=>this.allMembers.set(t.userId,t))),this.step=2,void this.focusOnSearch()}await this.createChannel()}},this.createChannel=async()=>{const t=Array.from(this.selectedMemberIds),e=await this.meeting.chat.createChannel(this.channelName,t,{displayPictureUrl:"",visibility:"public",isDirectMessage:!1});this.switchChannel.emit(e.id),this.stateUpdate.emit({activeChannelCreator:!1})},this.onMemberAdd=t=>{this.showAllMembersList=!1,this.selectedMemberIds.add(t),this.searchQuery="",this.focusOnSearch()},this.keyDownHandler=(t,e)=>{if("ArrowDown"===t.key)this.focusedMemberIndex=Math.min(this.focusedMemberIndex+1,e.length-1);else if("ArrowUp"===t.key){if(-1===this.focusedMemberIndex)return;if(0===this.focusedMemberIndex)return void this.focusOnSearch(!0);this.focusedMemberIndex=Math.max(this.focusedMemberIndex-1,0)}else if("Enter"===t.key)this.onMemberAdd(e[this.focusedMemberIndex].userId);else if("Backspace"===t.key){if(0!==this.searchQuery.length)return;if(0===this.selectedMemberIds.size)return;const t=Array.from(this.selectedMemberIds.values()).at(-1);this.selectedMemberIds.delete(t),Mt(this.$el)}},this.renderMemberSelector=()=>{const t=Array.from(this.allMembers.values()).filter((t=>!this.selectedMemberIds.has(t.userId)&&t.name.toLowerCase().includes(this.searchQuery.toLowerCase()))),e=Array.from(this.selectedMemberIds.values()).map((t=>this.allMembers.get(t))),i=this.selectedMemberIds.size===this.allMembers.size;return N("div",{class:"input-container"},N("ul",{class:"members scrollbar",onClick:()=>{var t;null===(t=this.searchInputTextRef)||void 0===t||t.focus()}},e.map((t=>N("li",{class:"pill"},N("rtk-avatar",{participant:{name:t.name,picture:t.picture},size:"sm"}),N("span",null,t.name),N("rtk-icon",{icon:this.iconPack.dismiss,onClick:()=>{this.selectedMemberIds.delete(t.userId),Mt(this.$el),this.focusOnSearch()}})))),!i&&N("input",{type:"text",ref:t=>this.searchInputTextRef=t,value:this.searchQuery,placeholder:0===this.selectedMemberIds.size?this.t("chat.member_name"):"",class:{"wide-input":0===this.selectedMemberIds.size},onInput:t=>{this.searchQuery=t.target.value.trim()},onClick:()=>{this.showAllMembersList=!this.showAllMembersList},onKeyDown:e=>this.keyDownHandler(e,t)})),(0!==this.searchQuery.length||this.showAllMembersList)&&N("ul",{class:"search-results"},t.map(((t,e)=>N("li",{class:{member:!0,selected:e===this.focusedMemberIndex},onClick:()=>this.onMemberAdd(t.userId),ref:t=>{e===this.focusedMemberIndex&&C((()=>{t&&t.scrollIntoView({behavior:"smooth",block:"end",inline:"nearest"})}))}},N("rtk-avatar",{participant:{name:t.name,picture:t.picture},size:"sm"}),N("span",null,t.name)))),0===t.length&&N("li",{class:"member"},N("span",null,this.t("chat.error.empty_results")))))}}componentDidLoad(){var t;null===(t=this.inputTextRef)||void 0===t||t.focus()}render(){return N(H,{key:"343bc1c61f83850b45010bb05ecb17d365345b51"},N("header",{key:"231b89e21003207dfc890cf2210b6c230fab9390"},1===this.step?this.t("chat.new_channel"):this.t("chat.add_members")),1===this.step&&N("input",{key:"7a822d7fbb6946f866f12039f09159ae2b37f3e2",class:"channel-name-input",type:"text",placeholder:this.t("chat.channel_name"),ref:t=>this.inputTextRef=t,onInput:t=>{this.channelName=t.target.value.trim()}}),2===this.step&&this.renderMemberSelector(),N("footer",{key:"3de7edf3f52b99ce04e2f977bddaaf85a1243c43"},N("rtk-button",{key:"601c2634e7e917246987a51e395fd870494727c1",kind:"button",size:"lg",disabled:0===this.channelName.length,onClick:this.onClickHandler},1===this.step?this.t("chat.add_members"):this.t("create"))))}get $el(){return W(this)}};po([ai()],go.prototype,"meeting",void 0),po([ai()],go.prototype,"t",void 0),po([ai()],go.prototype,"iconPack",void 0),go.style=":host{line-height:initial;font-family:var(--rtk-font-family, sans-serif);font-feature-settings:normal;font-variation-settings:normal}p{margin:var(--rtk-space-0, 0px);padding:var(--rtk-space-0, 0px)}.scrollbar{scrollbar-width:thin;scrollbar-color:var(--rtk-scrollbar-color, rgb(var(--rtk-colors-background-600, 60 60 60)))\n var(--rtk-scrollbar-background, transparent)}.scrollbar::-webkit-scrollbar{height:var(--rtk-space-1\\.5, 6px);width:var(--rtk-space-1\\.5, 6px);border-radius:9999px;background-color:var(--rtk-scrollbar-background, transparent)}.scrollbar::-webkit-scrollbar-thumb{border-radius:9999px;background-color:var(--rtk-scrollbar-color, rgb(var(--rtk-colors-background-600, 60 60 60)))}:host{border-radius:var(--rtk-border-radius-md, 8px);--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-background-1000, 8 8 8) / var(--tw-bg-opacity));display:flex;flex-direction:column;width:var(--rtk-space-96, 384px);padding-left:var(--rtk-space-9, 36px);padding-right:var(--rtk-space-9, 36px);padding-top:var(--rtk-space-10, 40px);padding-bottom:var(--rtk-space-10, 40px)}header{margin-bottom:var(--rtk-space-8, 32px);display:flex;align-items:center;gap:var(--rtk-space-2, 8px);font-size:24px;font-weight:600}.channel-name-input{--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-background-900, 26 26 26) / var(--tw-bg-opacity));color:rgb(var(--rtk-colors-text-1000, 255 255 255));border-radius:var(--rtk-border-radius-sm, 4px);border-width:var(--rtk-border-width-none, 0);border-style:none;padding:var(--rtk-space-3, 12px);font-size:16px;-webkit-appearance:none;-moz-appearance:none;appearance:none;line-height:1.25;outline:2px solid transparent;outline-offset:2px}.channel-name-input:focus{outline-width:2px;outline-color:rgba(var(--rtk-colors-brand-300, 73 124 253) / 0.5)}footer{margin-top:var(--rtk-space-5, 20px);display:flex;justify-content:flex-end}.member{display:flex;align-items:center;gap:var(--rtk-space-1, 4px);padding:var(--rtk-space-2, 8px)}.member rtk-avatar{height:var(--rtk-space-5, 20px);width:var(--rtk-space-5, 20px);font-size:14px;color:rgb(var(--rtk-colors-text-1000, 255 255 255))}.input-container{position:relative;-webkit-appearance:none;-moz-appearance:none;appearance:none;line-height:1.25;outline:2px solid transparent;outline-offset:2px;outline-width:2px;outline-color:rgba(var(--rtk-colors-brand-300, 73 124 253) / 0.5);border-radius:var(--rtk-border-radius-sm, 4px)}.input-container .members{margin:var(--rtk-space-0, 0px);max-height:var(--rtk-space-28, 112px);border-radius:var(--rtk-border-radius-sm, 4px);padding:var(--rtk-space-2, 8px);list-style-type:none;display:flex;flex-wrap:wrap;gap:var(--rtk-space-1, 4px);cursor:text;font-size:16px;--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-background-900, 26 26 26) / var(--tw-bg-opacity));overflow-y:auto;min-height:var(--rtk-space-7, 28px)}.input-container .pill{display:flex;align-items:center;gap:var(--rtk-space-1, 4px);border-radius:var(--rtk-border-radius-sm, 4px);padding:var(--rtk-space-2, 8px);--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-background-800, 30 30 30) / var(--tw-bg-opacity))}.input-container .pill rtk-avatar{height:var(--rtk-space-5, 20px);width:var(--rtk-space-5, 20px);font-size:14px;color:rgb(var(--rtk-colors-text-on-brand-1000, var(--rtk-colors-text-1000, 255 255 255)))}.input-container .pill span{max-width:var(--rtk-space-32, 128px);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.input-container .pill rtk-icon{height:var(--rtk-space-4, 16px);width:var(--rtk-space-4, 16px);cursor:pointer}.input-container input{width:var(--rtk-space-24, 96px);border-radius:var(--rtk-border-radius-sm, 4px);border-width:var(--rtk-border-width-none, 0);border-style:none;padding:var(--rtk-space-1, 4px);--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-background-900, 26 26 26) / var(--tw-bg-opacity));color:rgb(var(--rtk-colors-text-1000, 255 255 255));outline:2px solid transparent;outline-offset:2px;font-size:16px;line-height:1.25rem}.input-container input.wide-input{width:100%}.search-results{margin:var(--rtk-space-0, 0px);margin-top:var(--rtk-space-1, 4px);max-height:var(--rtk-space-28, 112px);width:100%;padding:var(--rtk-space-0, 0px);position:absolute;list-style-type:none;overflow-y:auto;--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-background-900, 26 26 26) / var(--tw-bg-opacity));border-radius:var(--rtk-border-radius-md, 8px);--tw-border-spacing-x:var(--rtk-space-2, 8px);--tw-border-spacing-y:var(--rtk-space-2, 8px);border-spacing:var(--tw-border-spacing-x) var(--tw-border-spacing-y);border-style:solid;border-color:rgba(var(--rtk-colors-brand-300, 73 124 253) / 0.5)}.search-results .member{cursor:pointer}.search-results .member rtk-avatar{color:rgb(var(--rtk-colors-text-on-brand-1000, var(--rtk-colors-text-1000, 255 255 255)))}.search-results .member:hover,.search-results .member.selected{--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-brand-700, 2 70 253) / var(--tw-bg-opacity));color:rgb(var(--rtk-colors-text-on-brand-1000, var(--rtk-colors-text-1000, 255 255 255)))}";var uo=function(t,e,i,r){var a,s=arguments.length,n=s<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,i,r);else for(var o=t.length-1;o>=0;o--)(a=t[o])&&(n=(s<3?a(n):s>3?a(e,i,n):a(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};const fo=class{constructor(t){o(this,t),this.t=Fe(),this.iconPack=je,this.members=[]}renderMembers(){return N("ul",{class:"scrollbar"},this.members.map((t=>N("li",null,N("rtk-avatar",{participant:{name:t.name,picture:t.picture},size:"sm"}),N("span",null,t.name)))))}render(){return N(H,{key:"debf2dde0cfce1649181c7bfdca29d25c774bb2c"},N("header",{key:"5a7ed6c10130518158a939e9868d5ad68aeb9486"},this.t("chat.channel_members")),this.renderMembers())}};uo([ai()],fo.prototype,"t",void 0),uo([ai()],fo.prototype,"iconPack",void 0),fo.style=":host{line-height:initial;font-family:var(--rtk-font-family, sans-serif);font-feature-settings:normal;font-variation-settings:normal}p{margin:var(--rtk-space-0, 0px);padding:var(--rtk-space-0, 0px)}.scrollbar{scrollbar-width:thin;scrollbar-color:var(--rtk-scrollbar-color, rgb(var(--rtk-colors-background-600, 60 60 60)))\n var(--rtk-scrollbar-background, transparent)}.scrollbar::-webkit-scrollbar{height:var(--rtk-space-1\\.5, 6px);width:var(--rtk-space-1\\.5, 6px);border-radius:9999px;background-color:var(--rtk-scrollbar-background, transparent)}.scrollbar::-webkit-scrollbar-thumb{border-radius:9999px;background-color:var(--rtk-scrollbar-color, rgb(var(--rtk-colors-background-600, 60 60 60)))}:host{border-radius:var(--rtk-border-radius-md, 8px);--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-background-1000, 8 8 8) / var(--tw-bg-opacity));display:flex;flex-direction:column;width:var(--rtk-space-72, 288px);padding-top:var(--rtk-space-5, 20px);padding-bottom:var(--rtk-space-5, 20px);padding-left:var(--rtk-space-8, 32px);padding-right:var(--rtk-space-8, 32px)}header{font-size:20px}rtk-spinner{margin-top:var(--rtk-space-10, 40px);margin-bottom:var(--rtk-space-10, 40px);margin-left:auto;margin-right:auto}ul{margin-left:var(--rtk-space-0, 0px);margin-right:var(--rtk-space-0, 0px);margin-top:var(--rtk-space-6, 24px);margin-bottom:var(--rtk-space-4, 16px);height:var(--rtk-space-48, 192px);padding:var(--rtk-space-0, 0px);overflow-y:auto;list-style-type:none;display:flex;flex-direction:column;gap:var(--rtk-space-2, 8px)}ul li{margin-right:var(--rtk-space-2, 8px);display:flex;align-items:center;gap:var(--rtk-space-2, 8px);padding:var(--rtk-space-2, 8px);cursor:pointer;border-radius:var(--rtk-border-radius-sm, 4px)}ul li:hover{--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-background-600, 60 60 60) / var(--tw-bg-opacity))}ul li rtk-avatar{height:var(--rtk-space-7, 28px);width:var(--rtk-space-7, 28px);font-size:14px;color:rgb(var(--rtk-colors-text-1000, 255 255 255))}";var mo=function(t,e,i,r){var a,s=arguments.length,n=s<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,i,r);else for(var o=t.length-1;o>=0;o--)(a=t[o])&&(n=(s<3?a(n):s>3?a(e,i,n):a(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};const vo=class{constructor(t){o(this,t),this.search=Y(this,"search",7),this.searchDismissed=Y(this,"searchDismissed",7),this.back=Y(this,"back",7),this.iconPack=je,this.t=Fe(),this.showChannelDetailsDialog=!1,this.showSearchBar=!1,this.members=[],this.showBackButton=!1}onChannelChanged(){this.$searchInput&&(this.$searchInput.value=""),this.showSearchBar=!1,this.channel.isDirectMessage||this.meeting.chat.getChannelMembers(this.channel.id).then((t=>{this.members=t}))}connectedCallback(){this.onChannelChanged()}renderChannelDetails(){return N("rtk-dialog",{open:!0,onRtkDialogClose:()=>{this.showChannelDetailsDialog=!1},iconPack:this.iconPack,t:this.t},N("rtk-channel-details",{members:this.members,channel:this.channel}))}render(){return this.channel?N(H,null,this.showChannelDetailsDialog&&this.renderChannelDetails(),N("header",{class:{searching:this.showSearchBar}},this.showBackButton&&N("rtk-button",{kind:"icon",variant:"secondary",class:"back-btn",onClick:()=>{this.back.emit()}},N("rtk-icon",{icon:this.iconPack.chevron_left})),N("div",{class:"channel-details"},N("span",{class:"name"},this.channel.displayName),!this.channel.isDirectMessage&&N("span",{class:"members"},this.members.map((t=>t.name)).join(", "))),N("div",{class:"channel-tools"},!this.channel.isDirectMessage&&N("rtk-tooltip",{label:this.t("chat.channel_members"),variant:"primary"},N("rtk-button",{kind:"button",variant:"secondary",size:"md",onClick:()=>{this.showChannelDetailsDialog=!this.showChannelDetailsDialog},class:"br-primary-btn"},N("rtk-icon",{icon:this.iconPack.people})))))):null}static get watchers(){return{channel:["onChannelChanged"]}}};mo([ai()],vo.prototype,"meeting",void 0),mo([ai()],vo.prototype,"iconPack",void 0),mo([ai()],vo.prototype,"t",void 0),vo.style="header{box-sizing:border-box;height:var(--rtk-space-16, 64px);width:100%;padding:var(--rtk-space-4, 16px);display:flex;justify-content:space-between;--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-background-1000, 8 8 8) / var(--tw-bg-opacity));border-left-width:var(--rtk-border-width-none, 0);border-right-width:var(--rtk-border-width-none, 0);border-bottom-width:var(--rtk-border-width-sm, 1px);border-top-width:var(--rtk-border-width-none, 0);border-style:solid;--tw-border-opacity:1;border-bottom-color:rgba(var(--rtk-colors-background-800, 30 30 30) / var(--tw-border-opacity))}header.searching{justify-content:flex-end}header.searching .channel-details{display:none}header .channel-details{display:flex;flex-grow:1;flex-direction:column;justify-content:center;height:var(--rtk-space-9, 36px);width:var(--rtk-space-1, 4px)}header .channel-details .name{font-weight:500}header .channel-details .members{margin-top:var(--rtk-space-0\\.5, 2px);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:12px;color:rgb(var(--rtk-colors-text-600, 255 255 255 / 0.52))}header .channel-tools{display:flex;flex-shrink:0;justify-content:flex-end;gap:var(--rtk-space-1, 4px);min-width:var(--rtk-space-24, 96px)}header .channel-tools rtk-tooltip{height:var(--rtk-space-8, 32px);width:var(--rtk-space-10, 40px);display:flex}header .search-input{height:var(--rtk-space-8, 32px);width:var(--rtk-space-48, 192px);padding-left:var(--rtk-space-2, 8px);padding-right:var(--rtk-space-2, 8px);border-width:var(--rtk-border-width-none, 0);border-style:none;outline:2px solid transparent;outline-offset:2px;border-radius:var(--rtk-border-radius-sm, 4px);--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-background-800, 30 30 30) / var(--tw-bg-opacity));color:rgb(var(--rtk-colors-text-1000, 255 255 255))}header .name{font-size:16px}header .br-primary-btn{background-color:transparent}header .br-primary-btn:hover{--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-background-800, 30 30 30) / var(--tw-bg-opacity))}@media (orientation: landscape) and (min-width: 400px){header.searching .channel-details{display:flex}}.back-btn{margin-right:var(--rtk-space-3, 12px)}";var bo=function(t,e,i,r){var a,s=arguments.length,n=s<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,i,r);else for(var o=t.length-1;o>=0;o--)(a=t[o])&&(n=(s<3?a(n):s>3?a(e,i,n):a(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};const ko=class{constructor(t){o(this,t),this.channelChange=Y(this,"channelChange",7),this.disableSearch=!1,this.hideAvatar=!1,this.iconPack=je,this.t=Fe(),this.viewAs="list",this.searchQuery="",this.showDropdown=!1,this.calculateListHeight=_i((()=>{if("list"===this.viewAs&&this.$listEl){let t=0;const e=this.$el.shadowRoot.querySelector('slot[name="header"]');e&&e.assignedElements().forEach((e=>t+=e.offsetHeight)),this.$searchEl&&(t+=this.$searchEl.offsetHeight),this.$listEl.style.height=window.innerHeight-t-16+"px"}}),60),this.getFilteredChannels=()=>""===this.searchQuery.trim()?this.channels:this.channels.filter((t=>t.name.toLowerCase().includes(this.searchQuery.toLowerCase()))),this.toggleDropdown=()=>{this.showDropdown=!this.showDropdown},this.getChannelById=t=>this.channels.find((e=>e.id===t)),this.getTotalUnreads=()=>this.channels.reduce(((t,e)=>t+e.unreadCount),0),this.onChannelClickHandler=t=>{this.channelChange.emit(t),"dropdown"===this.viewAs&&(this.showDropdown=!1)}}connectedCallback(){this.resizeObserver=new ResizeObserver(this.calculateListHeight)}componentDidLoad(){this.resizeObserver.observe(this.$el),this.calculateListHeight()}disconnectedCallback(){var t;null===(t=this.resizeObserver)||void 0===t||t.disconnect(),this.calculateListHeight.cancel()}getTimeLabel(t){const e=new Date,i=new Date(e);i.setDate(e.getDate()-1);const r=new Date(e);if(r.setDate(e.getDate()-e.getDay()-1),t.toDateString()===e.toDateString())return t.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"});if(t.toDateString()===i.toDateString())return this.t("date.yesteday");if(t>r){const e=["date.sunday","date.monday","date.tuesday","date.wednesday","date.thursday","date.friday","date.saturday"];return this.t(e[t.getDay()])}return Intl.DateTimeFormat([],{day:"2-digit",month:"2-digit",year:"2-digit"}).format(t)}render(){const t=this.getFilteredChannels(),e="list"===this.viewAs||"dropdown"===this.viewAs&&this.showDropdown;return N(H,{key:"2f9a7d72ebeadda388681aa4e08530f4bb75150b"},"list"===this.viewAs&&N("slot",{key:"2e0f2354e6a5e92c0c82158bc7a2d068fe0c42ca",name:"header"}),e&&N("div",{key:"0cfa739b959782b495b3ae45865cbe91de35237e",class:{dropdown:"dropdown"===this.viewAs,scrollbar:"dropdown"===this.viewAs,list:"list"===this.viewAs}},!this.disableSearch&&N("div",{key:"4b000515de7ebdb64accbe455d749b23955bdebf",class:"search-container",ref:t=>this.$searchEl=t},N("input",{key:"0efd92a23ed1b6fc041c317d2b6e00ec38fcd95a",type:"text",placeholder:this.t("chat.search_conversations"),value:this.searchQuery,onInput:t=>this.searchQuery=t.target.value}),N("rtk-icon",{key:"f62316f91ea71fa7cf561bfcb0e5eb0567df7350",icon:this.iconPack.search})),N("div",{key:"df19cc12b15ccb81380f6f7af41aae6637daafdb",class:"channels-container scrollbar",ref:t=>this.$listEl=t},t.map((t=>N("button",{class:{channel:!0,active:this.selectedChannelId===t.id},onClick:()=>this.onChannelClickHandler(t)},!this.hideAvatar&&N("div",null,t.icon?N("rtk-icon",{class:"avatar-icon",icon:this.iconPack[t.icon]}):N("rtk-avatar",{participant:{name:t.name,picture:t.avatarUrl}})),N("div",{class:"channel-data"},N("div",{class:"col"},N("div",{class:"name"},t.name),t.latestMessage&&N("div",{class:{"last-message":!0,"no-message":!t.latestMessage}},N("rtk-text-message-view",{isMarkdown:!0,text:t.latestMessage}))),N("div",{class:"col channel-meta"},t.latestMessageTime&&N("time",{class:"time"},this.getTimeLabel(t.latestMessageTime)),t.unreadCount>0&&N("div",{class:"unread-count"},t.unreadCount)))))))),"dropdown"===this.viewAs&&N("button",{key:"4dc6626d43cca729c7129cf44e5b1e90287e9a0a",class:"dropdown-trigger",onClick:this.toggleDropdown},N("span",{key:"58266d829571400e41be859c60d510324fa933a5"},this.selectedChannelId&&`${this.t("to")} ${this.getChannelById(this.selectedChannelId).name}`,this.getTotalUnreads()>0&&N("div",{key:"fd79330bdf7763baa3374e2ad5fcf79861a422dc",class:"unread-count"},this.getTotalUnreads())),N("rtk-icon",{key:"f168f3d51d356098dd2ec489bd34c2b1920333b4",icon:this.showDropdown?this.iconPack.chevron_up:this.iconPack.chevron_down})))}get $el(){return W(this)}};bo([ai()],ko.prototype,"iconPack",void 0),bo([ai()],ko.prototype,"t",void 0),ko.style=".scrollbar {\n /* For Firefox */\n scrollbar-width: thin;\n scrollbar-color: var(--rtk-scrollbar-color, rgb(var(--rtk-colors-background-600, 60 60 60)))\n var(--rtk-scrollbar-background, transparent);\n}\n\n/* For WebKit */\n.scrollbar::-webkit-scrollbar {\n height: var(--rtk-space-1\\.5, 6px);\n width: var(--rtk-space-1\\.5, 6px);\n border-radius: 9999px;\n background-color: var(--rtk-scrollbar-background, transparent);\n}\n\n.scrollbar::-webkit-scrollbar-thumb {\n border-radius: 9999px;\n background-color: var(--rtk-scrollbar-color, rgb(var(--rtk-colors-background-600, 60 60 60)));\n}\n\n\n:host {\n display: flex;\n flex-direction: column;\n width: 100%;\n --tw-bg-opacity: 1;\n background-color: rgba(var(--rtk-colors-background-900, 26 26 26) / var(--tw-bg-opacity));\n position: relative;\n z-index: 10;\n height: var(--rtk-space-12, 48px);\n min-height: 48px;\n}\n\n.dropdown-trigger {\n height: 100%;\n width: 100%;\n border-width: var(--rtk-border-width-none, 0);\n border-style: none;\n padding: var(--rtk-space-4, 16px);\n display: flex;\n align-items: center;\n justify-content: space-between;\n --tw-bg-opacity: 1;\n background-color: rgba(var(--rtk-colors-background-700, 44 44 44) / var(--tw-bg-opacity));\n font-size: 14px;\n color: rgb(var(--rtk-colors-text-1000, 255 255 255));\n cursor: pointer;\n position: absolute;\n z-index: 20;\n}\n\n.dropdown-trigger span {\n display: flex;\n flex: 1 1 0%;\n align-items: center;\n justify-content: space-between;\n}\n\n.dropdown-trigger rtk-icon {\n margin-left: var(--rtk-space-1, 4px);\n height: var(--rtk-space-5, 20px);\n width: var(--rtk-space-5, 20px);\n flex-shrink: 0;\n}\n\n@container chatcontainer (height < 360px) {\n .dropdown-trigger {\n padding: var(--rtk-space-2, 8px);\n }\n .dropdown {\n top: var(--rtk-space-8, 32px) !important;\n }\n .search-container {\n padding-left: var(--rtk-space-0, 0px) !important;\n padding-right: var(--rtk-space-0, 0px) !important;\n padding-top: var(--rtk-space-0, 0px) !important;\n padding-bottom: var(--rtk-space-0, 0px) !important;\n }\n input {\n height: var(--rtk-space-8, 32px) !important;\n border-radius: var(--rtk-border-radius-none, 0) !important;\n }\n .channel {\n height: var(--rtk-space-8, 32px) !important;\n border-radius: var(--rtk-border-radius-sm, 4px) !important;\n }\n .avatar-icon {\n height: var(--rtk-space-3, 12px) !important;\n width: var(--rtk-space-3, 12px) !important;\n padding: var(--rtk-space-1, 4px) !important;\n }\n\n rtk-avatar {\n height: var(--rtk-space-5, 20px) !important;\n width: var(--rtk-space-5, 20px) !important;\n }\n}\n\n.dropdown {\n position: absolute;\n width: 100%;\n --tw-bg-opacity: 1;\n background-color: rgba(var(--rtk-colors-background-900, 26 26 26) / var(--tw-bg-opacity));\n top: var(--rtk-space-12, 48px);\n z-index: 10;\n animation: 0.3s slide-down ease;\n}\n\n.dropdown .channels-container {\n max-height: var(--rtk-space-80, 320px);\n}\n\n.list {\n display: flex;\n flex-direction: column;\n}\n\n.list .channel .channel-data {\n align-items: flex-start;\n}\n\n.unread-count {\n display: flex;\n justify-content: center;\n height: var(--rtk-space-5, 20px);\n min-width: var(--rtk-space-3, 12px);\n border-radius: 9999px;\n padding-left: var(--rtk-space-1, 4px);\n padding-right: var(--rtk-space-1, 4px);\n font-size: 12px;\n line-height: 1.25rem;\n --tw-bg-opacity: 1;\n background-color: rgba(var(--rtk-colors-brand-500, 33 96 253) / var(--tw-bg-opacity));\n color: rgb(var(--rtk-colors-text-on-brand-1000, var(--rtk-colors-text-1000, 255 255 255)));\n}\n\ninput {\n height: var(--rtk-space-9, 36px);\n width: 100%;\n padding-left: var(--rtk-space-3, 12px);\n padding-right: var(--rtk-space-3, 12px);\n box-sizing: border-box;\n border-width: var(--rtk-border-width-none, 0);\n border-style: none;\n outline: 2px solid transparent;\n outline-offset: 2px;\n border-radius: var(--rtk-border-radius-sm, 4px);\n --tw-bg-opacity: 1;\n background-color: rgba(var(--rtk-colors-background-600, 60 60 60) / var(--tw-bg-opacity));\n color: rgb(var(--rtk-colors-text-1000, 255 255 255));\n}\n\n.search-container {\n display: flex;\n flex-shrink: 0;\n flex-grow: 0;\n flex-basis: auto;\n align-items: center;\n padding-top: var(--rtk-space-3, 12px);\n padding-bottom: var(--rtk-space-3, 12px);\n padding-left: var(--rtk-space-2, 8px);\n padding-right: var(--rtk-space-2, 8px);\n border-bottom: var(--rtk-border-width-sm, 1px) solid rgb(var(--rtk-colors-background-700, 44 44 44));\n}\n\n.search-container rtk-icon {\n margin-left: calc(var(--rtk-space-8, 32px) * -1);\n height: var(--rtk-space-5, 20px);\n width: var(--rtk-space-5, 20px);\n color: rgb(var(--rtk-colors-text-800, 255 255 255 / 0.76));\n}\n\n.channels-container {\n display: flex;\n flex-direction: column;\n gap: var(--rtk-space-1, 4px);\n padding: var(--rtk-space-2, 8px);\n flex: 1 1 auto;\n overflow-y: auto;\n}\n\n.channel {\n flex-shrink: 0;\n box-sizing: border-box;\n border-width: var(--rtk-border-width-none, 0);\n border-style: none;\n background-color: transparent;\n outline: 2px solid transparent;\n outline-offset: 2px;\n cursor: pointer;\n border-radius: var(--rtk-border-radius-md, 8px);\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: var(--rtk-space-2, 8px);\n height: var(--rtk-space-16, 64px);\n width: 100%;\n padding-left: var(--rtk-space-2, 8px);\n padding-right: var(--rtk-space-3, 12px);\n color: rgb(var(--rtk-colors-text-1000, 255 255 255));\n transition-property: color, background-color, border-color, text-decoration-color, fill, stroke;\n transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);\n transition-duration: 150ms;\n}\n\n.channel:hover {\n --tw-bg-opacity: 1;\n background-color: rgba(var(--rtk-colors-background-600, 60 60 60) / var(--tw-bg-opacity));\n}\n\n.channel .channel-data {\n flex: 1 1 0%;\n align-items: center;\n justify-content: space-between;\n display: flex;\n gap: var(--rtk-space-2, 8px);\n}\n\n.channel .name {\n font-size: 16px;\n}\n\n.channel .name, \n .channel .last-message {\n max-width: var(--rtk-space-40, 160px);\n text-align: left;\n overflow: hidden;\n display: -webkit-box;\n -webkit-box-orient: vertical;\n -webkit-line-clamp: 1;\n}\n\n.channel .no-message {\n font-style: italic;\n}\n\n.channel rtk-avatar {\n height: var(--rtk-space-12, 48px);\n width: var(--rtk-space-12, 48px);\n overflow: clip;\n border-radius: 9999px;\n font-size: 14px;\n}\n\n.channel .avatar-icon {\n height: var(--rtk-space-6, 24px);\n width: var(--rtk-space-6, 24px);\n padding: var(--rtk-space-3, 12px);\n color: rgb(var(--rtk-colors-text-on-brand-1000, var(--rtk-colors-text-1000, 255 255 255)));\n overflow: clip;\n border-radius: 9999px;\n --tw-bg-opacity: 1;\n background-color: rgba(var(--rtk-colors-brand-500, 33 96 253) / var(--tw-bg-opacity));\n}\n\n.channel time, \n .channel .last-message {\n font-size: 12px;\n color: rgb(var(--rtk-colors-text-800, 255 255 255 / 0.76));\n}\n\n.channel.active {\n --tw-bg-opacity: 1;\n background-color: rgba(var(--rtk-colors-brand-300, 73 124 253) / var(--tw-bg-opacity));\n color: rgb(var(--rtk-colors-text-on-brand-1000, var(--rtk-colors-text-1000, 255 255 255)));\n}\n\n.channel.active .unread-count {\n background-color: rgb(var(--rtk-colors-text-on-brand-800, var(--rtk-colors-text-800, 255 255 255 / 0.76)));\n --tw-text-opacity: 1;\n color: rgba(var(--rtk-colors-brand-500, 33 96 253) / var(--tw-text-opacity));\n}\n\n.channel.active time {\n color: rgb(var(--rtk-colors-text-on-brand-800, var(--rtk-colors-text-800, 255 255 255 / 0.76)));\n}\n\n.channel.active .last-message {\n color: rgb(var(--rtk-colors-text-on-brand-700, var(--rtk-colors-text-700, 255 255 255 / 0.64)));\n}\n\n.channel.active rtk-avatar {\n --tw-bg-opacity: 1;\n background-color: rgba(var(--rtk-colors-brand-500, 33 96 253) / var(--tw-bg-opacity));\n color: rgb(var(--rtk-colors-text-on-brand-1000, var(--rtk-colors-text-1000, 255 255 255)));\n}\n\n.col {\n gap: var(--rtk-space-1, 4px);\n display: flex;\n flex-direction: column;\n}\n\n.channel-meta {\n flex-shrink: 0;\n align-items: flex-end;\n}\n\n@keyframes slide-down {\n from {\n transform: translateY(-50px);\n }\n to {\n transform: translateY(0%);\n }\n}\n";var yo=function(t,e,i,r){var a,s=arguments.length,n=s<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,i,r);else for(var o=t.length-1;o>=0;o--)(a=t[o])&&(n=(s<3?a(n):s>3?a(e,i,n):a(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};const wo=class{constructor(t){o(this,t),this.stateUpdate=Y(this,"rtkStateUpdate",7),this.chatUpdateListener=({message:t})=>{t.channelId||this.displayFilter&&!this.displayFilter(t)||(this.addToChatGroup(t),this.chatGroups=Object.assign({},this.chatGroups))},this.chatPermissionUpdateListener=()=>{this.canSend=this.meeting.self.permissions.chatPublic.canSend,this.canSendTextMessage=this.meeting.self.permissions.chatPublic.text,this.canSendFiles=this.meeting.self.permissions.chatPublic.files},this.config=De,this.iconPack=je,this.t=Fe(),this.disablePrivateChat=!1,this.canPinMessages=!1,this.privatePresetFilter=[],this.displayFilter=void 0,this.unreadCountGroups={},this.chatGroups={everyone:[]},this.selectedGroup="everyone",this.now=new Date,this.dropzoneActivated=!1,this.showLatestMessageButton=!1,this.canSend=!1,this.canSendTextMessage=!1,this.canSendFiles=!1,this.canPrivateMessage=!1,this.canSendPrivateTexts=!1,this.canSendPrivateFiles=!1,this.emojiPickerEnabled=!1,this.chatRecipientId="everyone",this.participants=[],this.channels=[],this.editingMessage=null,this.replyMessage=null,this.searchQuery="",this.selectorState="hide",this.creatingChannel=!1,this.showPinnedMessages=!1,this.channelMap=new Map,this.onDragOver=t=>{t.preventDefault(),this.dropzoneActivated=!0},this.onDragLeave=()=>{this.dropzoneActivated=!1},this.onDrop=t=>{t.preventDefault(),this.dropzoneActivated=!1,Mi(t.dataTransfer.items,((t,e)=>{var i,r,a,s;switch(t){case"image":this.isFileMessagingAllowed()&&(null===(r=null===(i=this.meeting)||void 0===i?void 0:i.chat)||void 0===r||r.sendImageMessage(e,this.getRecipientPeerIds()));break;case"file":this.isFileMessagingAllowed()&&(null===(s=null===(a=this.meeting)||void 0===a?void 0:a.chat)||void 0===s||s.sendFileMessage(e,this.getRecipientPeerIds()))}}))},this.disconnectMeeting=t=>{var e,i,r,a,s,n;this.isPrivateChatSupported()&&(null==t||t.participants.joined.removeListener("participantJoined",this.onParticipantUpdate),null==t||t.participants.joined.removeListener("participantLeft",this.onParticipantUpdate)),null===(e=null==t?void 0:t.chat)||void 0===e||e.removeListener("chatUpdate",this.chatUpdateListener),null===(i=null==t?void 0:t.chat)||void 0===i||i.removeListener("channelCreate",this.onChannelCreateOrUpdate),null===(r=null==t?void 0:t.chat)||void 0===r||r.removeListener("channelUpdate",this.onChannelCreateOrUpdate),null===(a=null==t?void 0:t.chat)||void 0===a||a.removeListener("channelMessageUpdate",this.onChannelCreateOrUpdate),null===(n=null===(s=null==t?void 0:t.participants)||void 0===s?void 0:s.all)||void 0===n||n.removeListener("participantsUpdate",this.onChannelCreateOrUpdate),t.self.permissions.removeListener("*",this.chatPermissionUpdateListener)},this.getFilteredParticipants=()=>0===this.privatePresetFilter.length?this.participants:this.participants.filter((t=>this.privatePresetFilter.includes(t.presetName))),this.onParticipantUpdate=()=>{this.participants=this.meeting.participants.joined.toArray().filter((t=>0===this.privatePresetFilter.length||this.privatePresetFilter.includes(t.presetName))),this.selectedParticipant&&!this.participants.includes(this.selectedParticipant)&&(this.selectedParticipant=null,this.chatRecipientId=this.selectedGroup="everyone")},this.usePaginatedChat=()=>(!this.isGroupCall||!this.showPinnedMessages)&&("everyone"===this.selectedGroup&&ne(this.meeting)),this.updateUnreadCountGroups=t=>{this.unreadCountGroups=Object.assign(Object.assign({},this.unreadCountGroups),t)},this.isPrivateChatSupported=()=>this.canPrivateMessage&&!this.disablePrivateChat,this.updateRecipients=t=>{const{id:e}=t.detail;if(this.chatRecipientId=e,this.selectedParticipant=this.participants.find((t=>t.userId===e)),"everyone"!==this.chatRecipientId){const t=Di([this.chatRecipientId,this.meeting.self.userId]);this.selectedGroup=t}else this.selectedGroup="everyone";this.updateUnreadCountGroups({[this.selectedGroup]:0})},this.isTextMessagingAllowed=()=>"everyone"===this.chatRecipientId?this.canSend&&this.canSendTextMessage:this.canPrivateMessage&&this.canSendPrivateTexts,this.isFileMessagingAllowed=()=>"everyone"===this.chatRecipientId?this.canSend&&this.canSendFiles:this.canPrivateMessage&&this.canSendPrivateFiles,this.onChannelChanged=t=>{const e=t.detail;e.id.includes(Ii)?this.createDMChannel(e.id.replace(Ii,"")):this.selectedChannelId=e.id,this.cleanup(),"desktop"!==this.selectorState&&(this.selectorState="hide")},this.createDMChannel=async t=>{this.creatingChannel=!0;const e=await this.meeting.chat.createChannel("Direct Message",[t],{visibility:"private",isDirectMessage:!0});this.creatingChannel=!1,this.selectedChannelId=e.id},this.cleanup=()=>{this.editingMessage=null,this.replyMessage=null,this.searchQuery=""},this.onQuotedMessageDismiss=()=>{this.replyMessage=null},this.onChannelCreateOrUpdate=t=>{t?this.channelMap.set(t.id,t):this.meeting.chat.channels.forEach((t=>this.channelMap.set(t.id,t)));const e=Array.from(this.channelMap.values()),i=e.filter((t=>!Oi(t))).sort(((t,e)=>Ai(t.displayName,e.displayName))),r=e.filter(Oi).map((t=>Object.assign(Object.assign({},t),{displayName:this.getMemberDisplayName(t)}))),a=this.meeting.participants.all.toArray().filter((t=>{if(t.userId===this.meeting.self.userId)return!1;const e=Ui([this.meeting.self.userId,t.userId]);return r.every((t=>Ui(t.memberIds)!==e))})).map((t=>({id:`${Ii}${t.userId}`,displayName:t.name,displayPictureUrl:t.picture,isDirectMessage:!0,unreadCount:0}))),s=[...r,...a].sort(((t,e)=>Ai(t.displayName,e.displayName)));this.channels=[...i,...s];const n=[...i,...r];this.selectedChannelId||0===n.length||(this.selectedChannelId=n[0].id)},this.getMemberDisplayName=t=>{var e;let i;i=1===t.memberIds.length?t.memberIds[0]:t.memberIds[0]===this.meeting.self.userId?t.memberIds[1]:t.memberIds[0];const r=this.meeting.participants.all.toArray().find((t=>t.userId===i));return null!==(e=null==r?void 0:r.name)&&void 0!==e?e:i},this.onNewMessageHandler=async t=>{const e=t.detail;this.isChatViewType?(await this.meeting.chat.sendMessageToChannel(e,this.selectedChannelId,this.replyMessage?{replyTo:this.replyMessage}:{}),this.replyMessage=null):this.meeting.chat.sendMessage(e,this.getRecipientPeerIds())},this.onEditMessageHandler=async t=>{var e,i;await(null===(i=null===(e=this.meeting)||void 0===e?void 0:e.chat)||void 0===i?void 0:i.editTextMessage(this.editingMessage.id,t.detail,this.editingMessage.channelId)),this.editingMessage=null},this.onEditCancel=()=>{this.editingMessage=null},this.onSearchHandler=async t=>{this.searchQuery=t.detail},this.onSearchDismissed=()=>{this.searchQuery=""},this.onChannelCreateClicked=()=>{this.stateUpdate.emit({activeChannelCreator:!0})},this.onPinMessage=t=>{const e=t.detail;e.pinned?this.meeting.chat.unpin(e.id):this.meeting.chat.pin(e.id)},this.onDeleteMessage=t=>{const e=t.detail;this.meeting.chat.deleteMessage(e.id)},this.getChannelItems=()=>this.channels.map((t=>{const e={id:t.id,name:t.displayName,avatarUrl:t.displayPictureUrl};return t.latestMessage&&(e.latestMessage="text"===t.latestMessage.type?Gi(t.latestMessage.message):"",e.latestMessageTime=t.latestMessage.time),e})),this.getPrivateChatRecipients=()=>{const t=this.getFilteredParticipants().map((t=>{const e=Di([t.userId,this.meeting.self.userId]);return{id:t.userId,name:t.name,avatarUrl:t.picture,unreadCount:this.unreadCountGroups[e]}}));return[{id:"everyone",name:this.t("chat.everyone"),icon:"participants",unreadCount:this.unreadCountGroups.everyone},...t]},this.onTogglePinnedMessages=()=>{this.showPinnedMessages=!this.showPinnedMessages},this.renderPinnedMessagesHeader=()=>0===this.meeting.chat.pinned.length?null:N("rtk-tooltip",{label:this.t("chat.toggle_pinned_msgs")},N("div",{class:{"pinned-messages-header":!0,active:this.showPinnedMessages},onClick:this.onTogglePinnedMessages},N("rtk-icon",{icon:this.iconPack.pin}),this.t("chat.pinned_msgs"),` (${this.meeting.chat.pinned.length})`))}connectedCallback(){this.meeting&&(this.meetingChanged(this.meeting),this.meeting&&!this.meeting.chat||this.isFileMessagingAllowed()&&(this.host.addEventListener("dragover",this.onDragOver),this.host.addEventListener("dragleave",this.onDragLeave),this.host.addEventListener("drop",this.onDrop)))}onEditMessageInit(t){t.detail.flags.isReply?this.replyMessage=t.detail.payload:t.detail.flags.isEdit&&(this.editingMessage=t.detail.payload)}disconnectedCallback(){var t;null===(t=this.resizeObserver)||void 0===t||t.disconnect(),this.disconnectMeeting(this.meeting),this.host.removeEventListener("dragover",this.onDragOver),this.host.removeEventListener("dragleave",this.onDragLeave),this.host.removeEventListener("drop",this.onDrop)}meetingChanged(t,e){var i,r,a,s,n,o;if(null!=e&&this.disconnectMeeting(e),(!t||t.chat)&&null!=t){if(this.canSend=t.self.permissions.chatPublic.canSend,this.canSendTextMessage=t.self.permissions.chatPublic.text,this.canSendFiles=t.self.permissions.chatPublic.files,this.canPrivateMessage=!(!(null===(i=t.self.permissions.chatPrivate)||void 0===i?void 0:i.canSend)&&!(null===(r=t.self.permissions.chatPrivate)||void 0===r?void 0:r.canReceive)),this.canSendPrivateTexts=!!(null===(a=t.self.permissions.chatPrivate)||void 0===a?void 0:a.text),this.canSendPrivateFiles=!!(null===(s=t.self.permissions.chatPrivate)||void 0===s?void 0:s.files),this.canPinMessages=(null===(n=null==t?void 0:t.__internals__)||void 0===n?void 0:n.features.hasFeature(se))&&t.self.permissions.pinParticipant,this.isGroupCall="GROUP_CALL"===t.meta.viewType,this.isChatViewType="CHAT"===t.meta.viewType,this.isChatViewType){this.onChannelCreateOrUpdate();this.channels.filter((t=>!t.id.includes(Ii))).length&&(this.selectedChannelId=this.channels[0].id),this.resizeObserver&&this.resizeObserver.disconnect(),this.resizeObserver=new ResizeObserver((t=>{for(const e of t)e.contentBoxSize[0].inlineSize<758?this.selectorState="hide":this.selectorState="desktop"})),this.isChatViewType&&this.resizeObserver.observe(this.host)}this.initializeChatGroups(),this.chatGroups=Object.assign({},this.chatGroups),t.self.permissions.on("*",this.chatPermissionUpdateListener),this.onParticipantUpdate(),null===(o=t.chat)||void 0===o||o.addListener("chatUpdate",this.chatUpdateListener),this.isPrivateChatSupported()&&(t.participants.joined.addListener("participantJoined",this.onParticipantUpdate),t.participants.joined.addListener("participantLeft",this.onParticipantUpdate)),this.isChatViewType&&(t.chat.addListener("channelCreate",this.onChannelCreateOrUpdate),t.chat.addListener("channelUpdate",this.onChannelCreateOrUpdate),t.chat.addListener("channelMessageUpdate",this.onChannelCreateOrUpdate),t.participants.all.addListener("participantsUpdate",this.onChannelCreateOrUpdate))}}chatGroupsChanged(t){var e,i;if(!this.isPrivateChatSupported())return;const r={};for(const a in t){const s=null!==(e=Ke[a])&&void 0!==e?e:0;r[a]=t[a].filter((t=>"chat"==t.type&&t.message.time>s&&t.message.userId!==this.meeting.self.userId)).length,(a===Di([this.meeting.self.userId,null===(i=this.selectedParticipant)||void 0===i?void 0:i.userId])||"everyone"===a&&null===this.selectedParticipant)&&(r[a]=0,Ke[a]=new Date)}this.updateUnreadCountGroups(r)}initializeChatGroups(){var t;null===(t=this.meeting.chat)||void 0===t||t.messages.forEach((t=>{this.displayFilter&&!this.displayFilter(t)||this.addToChatGroup(t)}))}onDisplayFilterChanged(t,e){t!==e&&(this.chatGroups={},this.initializeChatGroups())}addToChatGroup(t){var e;const i=Ri(t);let r="everyone";if((null===(e=i.targetUserIds)||void 0===e?void 0:e.length)>0){const t=new Set([i.userId,...i.targetUserIds]);r=Di(Array.from(t))}void 0===this.chatGroups[r]&&(this.chatGroups[r]=[]);let a=!1,s=[];this.chatGroups[r].forEach((e=>{"chat"===e.type&&e.message.id===t.id?(a=!0,s.push({type:"chat",message:i})):s.push(e)})),a||s.push({type:"chat",message:i}),this.chatGroups[r]=s}getRecipientPeerIds(){let t=[];return"everyone"!==this.chatRecipientId&&(t=[this.selectedParticipant.id]),t}channelSwitchListener(t){this.onChannelChanged(t)}renderHeadlessComponents(){return N(Gt,null,N("rtk-dialog-manager",{meeting:this.meeting}),N("rtk-notifications",{meeting:this.meeting}))}renderComposerUI(){var t,e,i;if(this.isChatViewType&&0===this.channels.length)return null;if(this.isChatViewType&&""!==this.searchQuery)return null;if(this.isChatViewType&&!this.selectedChannelId)return null;if("everyone"===this.chatRecipientId){if(!this.canSendTextMessage&&!this.canSendFiles)return null}else if(!this.canSendPrivateTexts&&!this.canSendPrivateFiles)return null;const r={iconPack:this.iconPack,t:this.t,size:this.size},a=this.editingMessage?this.editingMessage.message:"",s=this.replyMessage?this.replyMessage.message:"";return N("rtk-chat-composer-view",Object.assign({message:a,storageKey:null!==(t=this.selectedChannelId)&&void 0!==t?t:`draft-${this.selectedChannelId}`,quotedMessage:s,isEditing:!!this.editingMessage,canSendTextMessage:this.isTextMessagingAllowed(),canSendFiles:this.isFileMessagingAllowed(),disableEmojiPicker:!!(null===(i=null===(e=this.meeting)||void 0===e?void 0:e.__internals__)||void 0===i?void 0:i.features.hasFeature(ee)),maxLength:this.meeting.chat.maxTextLimit,rateLimits:this.meeting.chat.rateLimits,inputTextPlaceholder:this.t("chat.message_placeholder"),onNewMessage:this.onNewMessageHandler,onEditMessage:this.onEditMessageHandler,onEditCancel:this.onEditCancel,onQuotedMessageDismiss:this.onQuotedMessageDismiss},r),N("slot",{name:"chat-addon",slot:"chat-addon"}))}renderFullChat(){if(this.creatingChannel)return N("div",{class:"banner"},N("rtk-spinner",{size:"lg"}));if(0===this.channels.length||!this.selectedChannelId)return N("div",{class:"banner"},N("rtk-icon",{icon:this.iconPack.create_channel_illustration,slot:"start",class:"create-channel-illustration"}),N("rtk-button",{kind:"wide",variant:"primary",size:"md",onClick:this.onChannelCreateClicked,class:"welcome-new-channel"},N("rtk-icon",{icon:this.iconPack.add,slot:"start"}),N("span",null,this.t("chat.new_channel"))),("mobile"===this.selectorState||"hide"===this.selectorState)&&N("rtk-button",{kind:"button",variant:"secondary",size:"md",class:"view-chats-btn",onClick:()=>{this.selectorState="mobile"}},N("rtk-icon",{icon:this.iconPack.chat,slot:"start"}),N("span",null,this.t("chat.view_chats"))));const t=this.channels.find((t=>t.id===this.selectedChannelId));return N("div",{class:"chat"},N("rtk-channel-header",{slot:"header",meeting:this.meeting,channel:t,onSearch:this.onSearchHandler,onSearchDismissed:this.onSearchDismissed,showBackButton:"mobile"===this.selectorState||"hide"===this.selectorState,onBack:()=>{this.selectorState="mobile"}}),""!==this.searchQuery&&N("rtk-chat-search-results",{meeting:this.meeting,query:this.searchQuery,channelId:this.selectedChannelId}),""===this.searchQuery&&N("rtk-chat-messages-ui-paginated",{meeting:this.meeting,size:this.size,iconPack:this.iconPack,t:this.t,selectedChannelId:this.selectedChannelId,selectedChannel:t}))}render(){var t,e;if(!this.meeting)return null;const i={iconPack:this.iconPack,t:this.t,size:this.size},r=null===(t=this.meeting)||void 0===t?void 0:t.self.userId;let a=this.chatGroups[this.selectedGroup]||[];return this.showPinnedMessages&&0!==this.meeting.chat.pinned.length&&(a=a.filter((t=>"chat"===t.type&&t.message.pinned))),N(H,null,this.isChatViewType&&this.renderHeadlessComponents(),N("div",{class:"chat-container"},this.isChatViewType&&N("div",{class:{"selector-container":!0,[this.selectorState]:!0}},N("rtk-channel-selector-view",{channels:this.getChannelItems(),selectedChannelId:this.selectedChannelId,onChannelChange:this.onChannelChanged,t:this.t},N("div",{class:"channel-selector-header",slot:"header"},N("rtk-logo",{meeting:this.meeting,config:this.config,t:this.t}),N("rtk-tooltip",{label:this.t("chat.new_channel")},N("rtk-button",{kind:"button",variant:"ghost",size:"md",onClick:this.onChannelCreateClicked,class:"channel-create-btn"},N("rtk-icon",{icon:this.iconPack.add}))))),N("rtk-button",{kind:"icon",variant:"ghost",class:"mobile-close-btn",onClick:()=>this.selectorState="hide"},N("rtk-icon",{icon:this.iconPack.dismiss}))),N("div",{class:"chat"},this.isFileMessagingAllowed()&&N("div",{id:"dropzone",class:{active:this.dropzoneActivated},part:"dropzone"},N("rtk-icon",{icon:this.iconPack.attach}),N("p",null,this.t("chat.send_attachment"))),this.renderPinnedMessagesHeader(),this.isPrivateChatSupported()&&N("rtk-channel-selector-view",{channels:this.getPrivateChatRecipients(),selectedChannelId:(null===(e=this.selectedParticipant)||void 0===e?void 0:e.userId)||"everyone",onChannelChange:this.updateRecipients,t:this.t,viewAs:"dropdown"}),this.isChatViewType?this.renderFullChat():this.usePaginatedChat()?N("rtk-chat-messages-ui-paginated",{meeting:this.meeting,onPinMessage:this.onPinMessage,onDeleteMessage:this.onDeleteMessage,size:this.size,iconPack:this.iconPack,t:this.t}):N("rtk-chat-messages-ui",Object.assign({messages:a,selfUserId:r,selectedGroup:this.selectedGroup,onPinMessage:this.onPinMessage,canPinMessages:this.canPinMessages},i)),this.renderComposerUI())))}get host(){return W(this)}static get watchers(){return{meeting:["meetingChanged"],chatGroups:["chatGroupsChanged"],displayFilter:["onDisplayFilterChanged"]}}};yo([ai()],wo.prototype,"meeting",void 0),yo([ai()],wo.prototype,"size",void 0),yo([ai()],wo.prototype,"iconPack",void 0),yo([ai()],wo.prototype,"t",void 0),wo.style=":host {\n line-height: initial;\n font-family: var(--rtk-font-family, sans-serif);\n\n font-feature-settings: normal;\n font-variation-settings: normal;\n}\n\np {\n margin: var(--rtk-space-0, 0px);\n padding: var(--rtk-space-0, 0px);\n}\n\n.scrollbar {\n /* For Firefox */\n scrollbar-width: thin;\n scrollbar-color: var(--rtk-scrollbar-color, rgb(var(--rtk-colors-background-600, 60 60 60)))\n var(--rtk-scrollbar-background, transparent);\n}\n\n/* For WebKit */\n.scrollbar::-webkit-scrollbar {\n height: var(--rtk-space-1\\.5, 6px);\n width: var(--rtk-space-1\\.5, 6px);\n border-radius: 9999px;\n background-color: var(--rtk-scrollbar-background, transparent);\n}\n\n.scrollbar::-webkit-scrollbar-thumb {\n border-radius: 9999px;\n background-color: var(--rtk-scrollbar-color, rgb(var(--rtk-colors-background-600, 60 60 60)));\n}\n\n\n:host {\n display: flex;\n height: 100%;\n width: 100%;\n flex-direction: column;\n font-size: 14px;\n position: relative;\n color: rgb(var(--rtk-colors-text-1000, 255 255 255));\n}\n\nh3 {\n margin: var(--rtk-space-0, 0px);\n display: flex;\n height: var(--rtk-space-12, 48px);\n align-items: center;\n justify-content: center;\n font-size: 16px;\n font-weight: 400;\n color: rgb(var(--rtk-colors-text-900, 255 255 255 / 0.88));\n text-align: center;\n}\n\n#dropzone {\n position: absolute;\n top: var(--rtk-space-0, 0px);\n right: var(--rtk-space-0, 0px);\n bottom: var(--rtk-space-0, 0px);\n left: var(--rtk-space-0, 0px);\n z-index: 10;\n display: none;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n --tw-bg-opacity: 1;\n background-color: rgba(var(--rtk-colors-background-800, 30 30 30) / var(--tw-bg-opacity));\n color: rgb(var(--rtk-colors-text-700, 255 255 255 / 0.64));\n}\n\n#dropzone.active {\n display: flex;\n animation: 0.2s slide-up ease-in;\n}\n\nrtk-chat-messages-ui,\nrtk-chat-messages-ui-paginated {\n flex: 1 0 0;\n}\n\nrtk-chat-composer-view {\n margin: var(--rtk-space-2, 8px);\n}\n\n.chat-container {\n display: flex;\n height: 100%;\n width: 100%;\n flex-direction: row;\n container-type: size;\n container-name: chatcontainer;\n}\n\n@container chatcontainer (height < 360px) {\n rtk-channel-selector-view {\n height: var(--rtk-space-8, 32px);\n min-height: 24px;\n }\n}\n\n.chat {\n display: flex;\n flex: 1 1 0%;\n flex-direction: column;\n}\n\n.banner {\n height: 100%;\n width: 100%;\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n}\n\n.banner .welcome-new-channel {\n width: var(--rtk-space-48, 192px);\n}\n\n.banner .create-channel-illustration {\n height: var(--rtk-space-40, 160px);\n width: var(--rtk-space-40, 160px);\n}\n\n.channel-selector-header {\n box-sizing: border-box;\n height: var(--rtk-space-16, 64px);\n padding: var(--rtk-space-4, 16px);\n display: flex;\n justify-content: space-between;\n border-bottom: var(--rtk-border-width-sm, 1px) solid rgb(var(--rtk-colors-background-700, 44 44 44));\n}\n\n.channel-selector-header .channel-create-btn {\n width: var(--rtk-space-8, 32px);\n justify-content: center;\n}\n\n.channel-selector-header .channel-create-btn:hover {\n --tw-text-opacity: 1;\n color: rgba(var(--rtk-colors-brand-300, 73 124 253) / var(--tw-text-opacity));\n}\n\n.view-chats-btn {\n margin-top: var(--rtk-space-4, 16px);\n}\n\n.selector-container {\n z-index: 50;\n width: 100%;\n max-width: var(--rtk-space-80, 320px);\n border-right: var(--rtk-border-width-sm, 1px) solid rgb(var(--rtk-colors-background-600, 60 60 60));\n}\n\n.selector-container.hide {\n display: none;\n}\n\n.mobile-close-btn {\n display: none;\n}\n\n.selector-container.mobile {\n height: 100%;\n width: 100%;\n max-width: 100%;\n position: absolute;\n top: var(--rtk-space-0, 0px);\n right: var(--rtk-space-0, 0px);\n bottom: var(--rtk-space-0, 0px);\n left: var(--rtk-space-0, 0px);\n background-color: rgba(var(--rtk-colors-background-1000, 8 8 8) / 0.6);\n display: flex;\n}\n\n.selector-container.mobile rtk-channel-selector-view {\n max-width: var(--rtk-space-96, 384px);\n animation: 0.3s swipe-in;\n}\n\n.selector-container.mobile .mobile-close-btn {\n margin-top: var(--rtk-space-4, 16px);\n margin-bottom: var(--rtk-space-4, 16px);\n margin-left: var(--rtk-space-6, 24px);\n margin-right: var(--rtk-space-6, 24px);\n display: block;\n}\n\n.pinned-messages-header {\n display: flex;\n align-items: center;\n gap: var(--rtk-space-2, 8px);\n padding: var(--rtk-space-2, 8px);\n --tw-bg-opacity: 1;\n background-color: rgba(var(--rtk-colors-background-600, 60 60 60) / var(--tw-bg-opacity));\n font-size: 12px;\n cursor: pointer;\n}\n\n.pinned-messages-header rtk-icon {\n height: var(--rtk-space-3, 12px);\n width: var(--rtk-space-3, 12px);\n}\n\n.pinned-messages-header:hover {\n --tw-bg-opacity: 1;\n background-color: rgba(var(--rtk-colors-brand-500, 33 96 253) / var(--tw-bg-opacity));\n}\n\n.pinned-messages-header.active {\n --tw-bg-opacity: 1;\n background-color: rgba(var(--rtk-colors-brand-500, 33 96 253) / var(--tw-bg-opacity));\n}\n\n@keyframes swipe-in {\n from {\n transform: translateX(-100%);\n }\n to {\n transform: translateX(0);\n }\n}\n";var xo=function(t,e,i,r){var a,s=arguments.length,n=s<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,i,r);else for(var o=t.length-1;o>=0;o--)(a=t[o])&&(n=(s<3?a(n):s>3?a(e,i,n):a(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};const So={messagesSent:0,startTime:0},Po=class{constructor(t){o(this,t),this.onNewMessage=Y(this,"newMessage",7),this.onEditMessage=Y(this,"editMessage",7),this.onEditCancel=Y(this,"editCancel",7),this.onQuotedMessageDismiss=Y(this,"quotedMessageDismiss",7),this.canSendTextMessage=!0,this.canSendFiles=!0,this.message="",this.quotedMessage="",this.storageKey="rtk-text-message",this.inputTextPlaceholder="Enter your message",this.isEditing=!1,this.iconPack=je,this.t=Fe(),this.disableEmojiPicker=!1,this.rateLimits={period:60,maxInvocations:60},this.fileToUpload=null,this.isEmojiPickerOpen=!1,this.disableSendButton=!1,this.rateLimitsBreached=!1,this.textMessage="",this.sendFile=()=>{this.canSendFiles&&("image"===this.fileToUpload.type?this.onNewMessage.emit({type:"image",image:this.fileToUpload.file}):this.onNewMessage.emit({type:"file",file:this.fileToUpload.file}),this.fileToUpload=null)},this.handleSendMessage=()=>{if(!this.canSendTextMessage||this.rateLimitsBreached)return;if(null!==this.fileToUpload)return void this.sendFile();const t=this.textMessage,e=Date.now();e-So.startTime>1e3*this.rateLimits.period&&(So.startTime=e,So.messagesSent=0),So.messagesSent+=1,this.checkRateLimitBreached(e),t.length>0&&(this.quotedMessage.length,this.onNewMessage.emit({type:"text",message:t}),this.cleanup())},this.handleEditMessage=()=>{this.onEditMessage.emit(this.textMessage),this.cleanup()},this.handleEditCancel=()=>{this.onEditCancel.emit(),this.cleanup()},this.onTextChangeHandler=t=>{var e;this.textMessage=t.detail,this.textMessage.length>=(null!==(e=this.maxLength)&&void 0!==e?e:Vi)?this.disableSendButton=!0:this.disableSendButton&&(this.disableSendButton=!1),Be.setItem(this.storageKey,t.detail)},this.onKeyDownHandler=t=>{"Enter"===t.key&&t.shiftKey||this.disableSendButton||"Enter"===t.key&&(t.preventDefault(),this.isEditing?this.handleEditMessage():this.handleSendMessage())},this.onFileUploadHandler=(t,e)=>{this.fileToUpload={type:t,file:e}},this.onQuotedMessageDismissHandler=()=>{this.onQuotedMessageDismiss.emit()},this.cleanup=()=>{this.textMessage="",this.fileToUpload=null,Be.setItem(this.storageKey,""),this.$textComposer.setText("",!0),this.isEmojiPickerOpen=!1},this.onKeyDownHandler=this.onKeyDownHandler.bind(this)}connectedCallback(){this.textMessage=this.message||Be.getItem(this.storageKey)||"",this.checkRateLimitBreached(Date.now())}componentWillUpdate(){this.textMessage=this.message||Be.getItem(this.storageKey)||""}componentDidLoad(){this.message&&C((()=>this.$textComposer.setText(this.message,!0)))}checkRateLimitBreached(t){if(So.messagesSent>=this.rateLimits.maxInvocations){this.disableSendButton=!0,this.rateLimitsBreached=!0;const e=t-So.startTime+1e3*this.rateLimits.period;setTimeout((()=>{So.messagesSent=0,So.startTime=Date.now(),this.disableSendButton=!1,this.rateLimitsBreached=!1}),e)}}render(){var t;const e={iconPack:this.iconPack,t:this.t};return N(H,{key:"a672e9492db4fc74dabda1c294883706903d0e86"},this.canSendTextMessage&&this.isEmojiPickerOpen&&N("rtk-emoji-picker",Object.assign({key:"a75c42c1d308425ee58c91dc765eb7e785646049",part:"emoji-picker",onPickerClose:()=>{this.isEmojiPickerOpen=!1},onRtkEmojiClicked:t=>{this.textMessage+=t.detail,this.$textComposer.setText(this.textMessage,!0)}},e)),N("slot",{key:"a0edb07fc7c7dea7b994c4b335f6c2c9f4e1fb09",name:"chat-addon"}),this.quotedMessage&&0!==this.quotedMessage.length&&N("div",{key:"53c3efb018ee3a06d35d01e4c6b18d528a5fc271",class:"quoted-message-container",part:"quoted-message-container"},N("div",{key:"101e62eb4a7a03ce5eefbcc5f67c5fce34eb292f",class:"quoted-message scrollbar"},N("rtk-text-message-view",{key:"9e3ae5e8d1d46ffcdd03ae2d3487734257ae4425",text:this.quotedMessage,isMarkdown:!0})),N("div",{key:"089bde9c6be382e1b04bce8af318b776f492718e"},N("rtk-icon",{key:"b04ec3f54c1886690ba70f3eb21eb8372db3ef3c","aria-label":this.t("dismiss"),class:"dismiss",icon:this.iconPack.dismiss,onClick:this.onQuotedMessageDismissHandler}))),N("div",{key:"f531b78b2895fbb2f37bf937c60603f35c802cb4",class:"composer-container"},N("div",{key:"2c9389a3c823f4efabe4712b2166b477103a8667",class:"composers"},this.fileToUpload&&N("rtk-draft-attachment-view",Object.assign({key:"38b0366c7d131695b331ba7efe595bf10120f9bb"},e,{attachment:this.fileToUpload,onDeleteAttachment:()=>this.fileToUpload=null})),!this.fileToUpload&&N("rtk-text-composer-view",{key:"ef82106370bb9e64c3275004a27aa38dcdca6480",value:this.textMessage,placeholder:this.inputTextPlaceholder,onTextChange:this.onTextChangeHandler,keyDownHandler:this.onKeyDownHandler,maxLength:null!==(t=this.maxLength)&&void 0!==t?t:Vi,rateLimitBreached:this.rateLimitsBreached,t:this.t,iconPack:this.iconPack,ref:t=>this.$textComposer=t})),N("div",{key:"c6a524f4b9c130c429e6e87add59e85439adca2d",class:"chat-buttons",part:"chat-buttons"},N("div",{key:"0280b7dad1c85d51bd196c2bfade66979a362bd6",class:"left",part:"chat-buttons-left"},!this.fileToUpload&&!this.isEditing&&N("div",{key:"9caff064ea2a5e78f84a7c8072e99f4f944345fa"},this.canSendFiles&&[N("rtk-file-picker-button",Object.assign({key:"581b6351c4d9b2d7e376b95d494e2e3116c2cf61"},e,{onFileChange:t=>this.onFileUploadHandler("file",t.detail)})),N("rtk-file-picker-button",Object.assign({key:"08c3c03637d516c0c7557872f408a040ade455c4",filter:"image/*",label:this.t("chat.send_img"),icon:"image",onFileChange:t=>this.onFileUploadHandler("image",t.detail)},e))],this.canSendTextMessage&&!this.disableEmojiPicker&&N("rtk-emoji-picker-button",Object.assign({key:"10f628d5aee40f80f2f6e10717a69f0a420ea60e",isActive:this.isEmojiPickerOpen,onClick:()=>{this.isEmojiPickerOpen=!this.isEmojiPickerOpen}},e)),N("slot",{key:"782450debcfcb1ae7effe6cc3fabc176b1a17e12",name:"chat-buttons"}))),N("div",{key:"39d9e3b86a6d6e9788d71a6e6f7928cb694e5c54",class:"right",part:"chat-buttons-right"},!this.isEditing&&N("rtk-tooltip",{key:"e5a182cc2ce7ca563de2e7438679119bbc0ea4e3",variant:"primary",label:this.t("chat.send_msg"),delay:2e3},N("rtk-button",{key:"da1d029ad519b2bdb4c43b610372ee5cbcdb3ffd",kind:"icon",disabled:this.disableSendButton,onClick:()=>this.handleSendMessage(),title:this.t("chat.send_msg")},N("rtk-icon",{key:"608f9769aaf2689a50ae9ba616218aba4ce10370",icon:this.iconPack.send}))),this.isEditing&&N("div",{key:"7bc9c5c60f9dca00a3fabd2bb9c9ff64ba32eb66",class:"edit-buttons"},N("rtk-tooltip",{key:"f203cb3b1f6097c84ebe9bdce87913383d561f35",variant:"secondary",label:this.t("cancel"),delay:2e3},N("rtk-button",{key:"36720b4a31fa853a3e7de18442acf00bd32406c9",kind:"icon",variant:"secondary",onClick:()=>this.handleEditCancel(),title:this.t("cancel")},N("rtk-icon",{key:"f4ed9e89f3633db7a3850539517f86ffb48fde96",icon:this.iconPack.dismiss}))),N("rtk-tooltip",{key:"e66251c4572d124359edaffb551b3aaf3e9d52ee",variant:"primary",label:this.t("chat.update_msg"),delay:2e3},N("rtk-button",{key:"7f3be6fd93e61d0735ec0c5d36cec9bd65d0a164",kind:"icon",onClick:()=>this.handleEditMessage(),title:this.t("chat.send_msg")},N("rtk-icon",{key:"7b092e18376c32ac441fa57fbb758c8a452bec2f",icon:this.iconPack.checkmark}))))))))}};xo([ai()],Po.prototype,"iconPack",void 0),xo([ai()],Po.prototype,"t",void 0),Po.style=":host {\n display: flex;\n flex-direction: column;\n font-family: var(--rtk-font-family, sans-serif);\n font-size: 14px;\n position: relative;\n}\n\n.quoted-message-container {\n margin-bottom: var(--rtk-space-2, 8px);\n display: flex;\n justify-content: space-between;\n --tw-bg-opacity: 1;\n background-color: rgba(var(--rtk-colors-background-800, 30 30 30) / var(--tw-bg-opacity));\n color: rgb(var(--rtk-colors-text-1000, 255 255 255));\n border-radius: var(--rtk-border-radius-md, 8px);\n border: var(--rtk-border-width-sm, 1px) solid rgb(var(--rtk-colors-background-600, 60 60 60));\n}\n\n.quoted-message-container .quoted-message {\n flex: 1 1 0%;\n padding: var(--rtk-space-2, 8px);\n border-radius: var(--rtk-border-radius-md, 8px);\n max-height: var(--rtk-space-24, 96px);\n overflow-y: auto;\n word-break: break-all;\n}\n\n.quoted-message-container .quoted-message blockquote {\n display: none;\n}\n\n.quoted-message-container rtk-icon.dismiss {\n margin-left: auto;\n height: var(--rtk-space-5, 20px);\n width: var(--rtk-space-5, 20px);\n padding: var(--rtk-space-2, 8px);\n border-radius: var(--rtk-border-radius-md, 8px);\n color: rgb(var(--rtk-colors-text-600, 255 255 255 / 0.52));\n}\n\n.quoted-message-container rtk-icon.dismiss:hover {\n cursor: pointer;\n color: rgb(var(--rtk-colors-text-1000, 255 255 255));\n}\n\n.quoted-message-container rtk-icon.dismiss {\n transition-property: color, background-color, border-color, text-decoration-color, fill, stroke;\n transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);\n transition-duration: 150ms;\n}\n\n.composer-container {\n position: relative;\n --tw-bg-opacity: 1;\n background-color: rgba(var(--rtk-colors-background-800, 30 30 30) / var(--tw-bg-opacity));\n border-radius: var(--rtk-border-radius-md, 8px);\n overflow: hidden;\n border: var(--rtk-border-width-sm, 1px) solid rgb(var(--rtk-colors-background-600, 60 60 60));\n}\n\n.composer-container > .composers {\n min-height: 60px;\n }\n\n@container chatcontainer (height < 360px) {\n .composer-container > .composers {\n min-height: 30px;\n }\n}\n\n.chat-buttons {\n padding: var(--rtk-space-3, 12px);\n display: flex;\n align-items: center;\n justify-content: space-between;\n --tw-bg-opacity: 1;\n background-color: rgba(var(--rtk-colors-background-800, 30 30 30) / var(--tw-bg-opacity));\n color: rgb(var(--rtk-colors-text-1000, 255 255 255));\n}\n\n.chat-buttons .right {\n z-index: 10;\n}\n\n.chat-buttons .right .edit-buttons {\n display: flex;\n gap: var(--rtk-space-2, 8px);\n}\n\n.chat-buttons > div {\n display: flex;\n align-items: center;\n}\n\nrtk-emoji-picker {\n z-index: 20;\n position: absolute;\n top: calc(var(--rtk-space-72, 288px) * -1);\n border-top: var(--rtk-border-width-sm, 1px) solid rgb(var(--rtk-colors-background-600, 60 60 60));\n animation: 0.3s slide-up ease;\n}\n\n@keyframes slide-up {\n from {\n transform: translateY(100%);\n }\n to {\n transform: translateY(0%);\n }\n}\n";var Co=function(t,e,i,r){var a,s=arguments.length,n=s<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,i,r);else for(var o=t.length-1;o>=0;o--)(a=t[o])&&(n=(s<3?a(n):s>3?a(e,i,n):a(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};const Eo=class{constructor(t){o(this,t),this.edit=Y(this,"edit",7),this.reply=Y(this,"reply",7),this.pin=Y(this,"pin",7),this.delete=Y(this,"delete",7),this.iconPack=je,this.t=Fe(),this.isSelf=!1,this.canEdit=!1,this.canDelete=!1,this.canReply=!1,this.canPin=!1,this.disableControls=!1,this.alignRight=!1,this.hideAvatar=!1,this.now=new Date,this.leftAlign=!1,this.renderMessage=()=>{switch(this.message.type){case"text":return N("div",{"is-continued":this.isContinued,key:this.message.id},this.isUnread&&N("div",{class:"new-chat-marker",part:"new-chat-marker"},this.t("chat.new")),N("rtk-text-message",{message:this.message,now:this.now,isContinued:this.isContinued,"data-timestamp":this.message.time.getTime(),iconPack:this.iconPack,t:this.t,showBubble:!0}));case"image":return N("div",{"is-continued":this.isContinued,key:this.message.id},this.isUnread&&N("div",{class:"new-chat-marker",part:"new-chat-marker"},this.t("chat.new")),N("rtk-image-message",{message:this.message,now:this.now,isContinued:this.isContinued,iconPack:this.iconPack,"data-timestamp":this.message.time.getTime(),t:this.t,showBubble:!0}));case"file":return N("div",{"is-continued":this.isContinued,key:this.message.id},this.isUnread&&N("div",{class:"new-chat-marker",part:"new-chat-marker"},this.t("chat.new")),N("rtk-file-message",{message:this.message,now:this.now,isContinued:this.isContinued,iconPack:this.iconPack,t:this.t,"data-timestamp":this.message.time.getTime(),showBubble:!0}));case"custom":this.child.setAttribute("message",JSON.stringify(this.message));const t=this.child.cloneNode(!0);return N("div",{"is-continued":this.isContinued,key:this.message.id,ref:e=>e.appendChild(t)})}},this.onReply=()=>{this.reply.emit(this.message)},this.onPinned=()=>{this.pin.emit(this.message)},this.onDelete=()=>{this.delete.emit(this.message)},this.onEdit=async()=>{this.edit.emit(this.message)},this.isTouchDevice=()=>"ontouchstart"in window||navigator.maxTouchPoints>0}renderControls(){if(!this.disableControls)return N("rtk-menu",{placement:this.alignRight?"bottom-end":"bottom-start"},N("button",{slot:"trigger",class:"actions"},N("rtk-icon",{icon:this.iconPack.chevron_down})),N("rtk-menu-list",null,this.canReply&&N("rtk-menu-item",{onClick:this.onReply},N("rtk-icon",{icon:this.iconPack.back,slot:"start"}),this.t("chat.reply")),this.canPin&&N("rtk-menu-item",{onClick:this.onPinned},N("rtk-icon",{icon:this.iconPack.pin,slot:"start"}),this.t("pin")),this.canEdit&&N("rtk-menu-item",{onClick:this.onEdit},N("rtk-icon",{icon:this.iconPack.edit,slot:"start"}),this.t("chat.edit_msg")),this.canDelete&&N("rtk-menu-item",{onClick:this.onDelete},N("rtk-icon",{icon:this.iconPack.delete,slot:"start"}),this.t("chat.delete_msg"))))}renderAvatar(){if(!this.hideAvatar)return this.isContinued?N("div",{class:"avatar"}):N("div",{class:"avatar"},N("rtk-avatar",{size:"sm",participant:{name:this.message.displayName,picture:this.senderDisplayPicture}}))}render(){return N(H,{key:"46d26d49f2f11697a5656d93278a0dfb157b13fd"},N("div",{key:"3e3555c8d3ea45256eaf8d46dbbbe56f02e54275",class:{"message-wrapper":!0,"align-right":this.alignRight,"left-align":this.leftAlign},"is-continued":this.isContinued},this.renderAvatar(),N("div",{key:"ceb96b104b12e2497d26ddf8c7d60aa928798107",class:{message:!0,"show-on-hover":!this.isTouchDevice()},"is-continued":this.isContinued},this.renderMessage(),this.renderControls())))}get $el(){return W(this)}};Co([ai()],Eo.prototype,"size",void 0),Co([ai()],Eo.prototype,"iconPack",void 0),Co([ai()],Eo.prototype,"t",void 0),Eo.style=".message-wrapper{display:flex;gap:var(--rtk-space-2, 8px);margin-left:var(--rtk-space-4, 16px);margin-right:var(--rtk-space-4, 16px);margin-top:var(--rtk-space-4, 16px)}[is-continued] .message-wrapper{margin-top:var(--rtk-space-0, 0px)}.message-wrapper.align-right{flex-direction:row-reverse}.file-picker{display:none}.message{position:relative;display:flex}.show-on-hover rtk-menu{visibility:hidden}.show-on-hover:hover rtk-menu{visibility:visible}.align-right .message{justify-content:flex-end;margin-left:auto}.align-right .message .head{margin-right:var(--rtk-space-1, 4px);margin-left:var(--rtk-space-0, 0px);flex-direction:row-reverse;gap:var(--rtk-space-4, 16px)}.align-right .message rtk-text-message .bubble,.align-right .message rtk-image-message .bubble,.align-right .message rtk-file-message .bubble{padding-right:var(--rtk-space-5, 20px);--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-brand-300, 73 124 253) / var(--tw-bg-opacity));color:rgb(var(--rtk-colors-text-on-brand-1000, var(--rtk-colors-text-1000, 255 255 255)))}.align-right .message .actions rtk-icon{color:rgb(var(--rtk-colors-text-on-brand-1000, var(--rtk-colors-text-1000, 255 255 255)))}.align-right rtk-menu{left:auto;right:var(--rtk-space-0, 0px)}.head{margin-bottom:var(--rtk-space-2, 8px);margin-left:var(--rtk-space-1, 4px);display:flex;align-items:center;gap:var(--rtk-space-2, 8px)}.head .name{font-size:14px;font-weight:600}.head .time{font-size:12px;color:rgb(var(--rtk-colors-text-800, 255 255 255 / 0.76))}rtk-menu{position:absolute;left:var(--rtk-space-0, 0px);top:var(--rtk-space-6, 24px);border-radius:var(--rtk-border-radius-lg, 12px)}rtk-menu rtk-icon{height:var(--rtk-space-4, 16px);width:var(--rtk-space-4, 16px);cursor:pointer}[is-continued] rtk-menu{top:var(--rtk-space-2, 8px)}.actions{display:flex;align-items:center;justify-content:center;padding:var(--rtk-space-0\\.5, 2px);border-width:var(--rtk-border-width-none, 0);border-style:none;background-color:transparent}.actions rtk-icon{height:var(--rtk-space-4, 16px);width:var(--rtk-space-4, 16px);color:rgb(var(--rtk-colors-text-1000, 255 255 255))}.body{margin-top:var(--rtk-space-1, 4px);margin-bottom:var(--rtk-space-1, 4px);overflow-wrap:break-word;font-size:14px;line-height:1.375}.body .emoji{font-size:24px}.body.bubble{margin-top:var(--rtk-space-0, 0px);margin-bottom:var(--rtk-space-1, 4px);max-width:var(--rtk-space-96, 384px);padding-top:var(--rtk-space-3, 12px);padding-bottom:var(--rtk-space-3, 12px);padding-left:var(--rtk-space-5, 20px);padding-right:var(--rtk-space-5, 20px);overflow-wrap:break-word;font-size:14px;line-height:1.375;border-radius:var(--rtk-border-radius-md, 8px);--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-background-800, 30 30 30) / var(--tw-bg-opacity))}.body.bubble p{margin:var(--rtk-space-0, 0px);word-break:break-word}p{margin-top:var(--rtk-space-0, 0px);margin-bottom:var(--rtk-space-3, 12px)}rtk-text-message,rtk-image-message,rtk-file-message{display:block;font-family:var(--rtk-font-family, sans-serif);color:rgb(var(--rtk-colors-text-900, 255 255 255 / 0.88));box-sizing:border-box}*[is-continued]{margin-top:var(--rtk-space-0, 0px)}.image{position:relative;height:var(--rtk-space-40, 160px);max-width:var(--rtk-space-64, 256px);cursor:pointer}.image img{display:none;height:100%;width:100%;border-radius:var(--rtk-border-radius-sm, 4px);-o-object-fit:cover;object-fit:cover}.image .image-spinner{display:flex;height:100%;width:100%;flex-direction:column;align-items:center;justify-content:center;border-radius:var(--rtk-border-radius-sm, 4px);--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-background-800, 30 30 30) / var(--tw-bg-opacity))}.image .image-spinner rtk-spinner{--tw-text-opacity:1;color:rgba(var(--rtk-colors-brand-500, 33 96 253) / var(--tw-text-opacity))}.image .image-errored{display:flex;height:100%;width:100%;flex-direction:column;align-items:center;justify-content:center;border-radius:var(--rtk-border-radius-sm, 4px);background-color:rgba(var(--rtk-colors-danger, 255 45 45) / 0.1);--tw-text-opacity:1;color:rgba(var(--rtk-colors-danger, 255 45 45) / var(--tw-text-opacity))}.image .actions{display:none;height:var(--rtk-space-8, 32px);align-items:center;position:absolute;top:var(--rtk-space-2, 8px);right:var(--rtk-space-2, 8px);border-radius:var(--rtk-border-radius-sm, 4px);--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-background-900, 26 26 26) / var(--tw-bg-opacity));color:rgb(var(--rtk-colors-text-1000, 255 255 255));overflow:hidden;--tw-shadow:0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);--tw-shadow-colored:0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)}.image .actions .action{height:var(--rtk-space-8, 32px);width:var(--rtk-space-8, 32px);border-radius:var(--rtk-border-radius-none, 0);border-width:var(--rtk-border-width-none, 0);border-style:none;background-color:transparent;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)}.image .actions .action:hover{--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-background-600, 60 60 60) / var(--tw-bg-opacity))}.image.loaded img{display:block}.image.loaded .image-spinner{display:none}.image:hover .actions,.image:focus .actions{display:flex}.file{display:flex;align-items:center;gap:var(--rtk-space-1, 4px);padding-left:var(--rtk-space-2, 8px);padding-right:var(--rtk-space-2, 8px);padding-top:var(--rtk-space-1\\.5, 6px);padding-bottom:var(--rtk-space-1\\.5, 6px);border-radius:var(--rtk-border-radius-sm, 4px);--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-background-700, 44 44 44) / var(--tw-bg-opacity));color:rgb(var(--rtk-colors-text-700, 255 255 255 / 0.64))}.file .file-data{flex:1 1 0%}.file .file-data .name{word-break:break-all;color:rgb(var(--rtk-colors-text-1000, 255 255 255));overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:1}.file .file-data .file-data-split{margin-top:var(--rtk-space-0\\.5, 2px);display:flex;align-items:center;font-size:12px}.file .file-data .file-data-split .ext{margin-right:var(--rtk-space-2, 8px);text-transform:uppercase;overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:1}.file .file-data .file-data-split .divider{height:var(--rtk-space-4, 16px);width:var(--rtk-space-0\\.5, 2px);--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-background-600, 60 60 60) / var(--tw-bg-opacity))}.file .file-data .file-data-split .size{margin-left:var(--rtk-space-2, 8px)}a{--tw-text-opacity:1;color:rgba(var(--rtk-colors-brand-300, 73 124 253) / var(--tw-text-opacity));text-decoration-line:none}a:hover{text-decoration-line:underline}.new-chat-marker{display:flex;width:100%;align-items:center;gap:var(--rtk-space-2, 8px);--tw-text-opacity:1;color:rgba(var(--rtk-colors-brand-300, 73 124 253) / var(--tw-text-opacity))}.new-chat-marker::before{content:'';height:1px;flex:1 1 0%;background-color:rgba(var(--rtk-colors-brand-300, 73 124 253) / 0.5)}.show-new-messages-ctr{pointer-events:none;display:flex;justify-content:flex-end;padding:var(--rtk-space-3, 12px);z-index:0;margin-top:calc(var(--rtk-space-14, 56px) * -1)}.show-new-messages{pointer-events:auto;--tw-translate-y:calc(var(--rtk-space-6, 24px) * -1);transform:translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));opacity:0;transition-property:color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, -webkit-backdrop-filter;transition-property:color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter;transition-property:color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter, -webkit-backdrop-filter;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:150ms}.show-new-messages.active{--tw-translate-y:var(--rtk-space-0, 0px);transform:translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));opacity:1}blockquote{margin:var(--rtk-space-0, 0px);margin-bottom:var(--rtk-space-3, 12px);background-color:transparent}.block-quote,blockquote{--tw-border-spacing-x:1px;--tw-border-spacing-y:1px;border-spacing:var(--tw-border-spacing-x) var(--tw-border-spacing-y);border-top-width:var(--rtk-border-width-none, 0);border-bottom-width:var(--rtk-border-width-none, 0);border-left-width:var(--rtk-border-width-md, 2px);border-right-width:var(--rtk-border-width-none, 0);border-style:solid;border-left-color:rgb(var(--rtk-colors-text-900, 255 255 255 / 0.88));padding:var(--rtk-space-0\\.5, 2px);padding-left:var(--rtk-space-2, 8px);margin-bottom:var(--rtk-space-2, 8px) !important;border-radius:var(--rtk-border-radius-sm, 4px);border-top-left-radius:var(--rtk-border-radius-none, 0);border-bottom-left-radius:var(--rtk-border-radius-none, 0)}.link{color:rgb(var(--rtk-colors-text-900, 255 255 255 / 0.88))}.align-right .block-quote{border-color:rgb(var(--rtk-colors-text-on-brand-600, var(--rtk-colors-text-600, 255 255 255 / 0.52)));--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-brand-300, 73 124 253) / var(--tw-bg-opacity))}.align-right .link{color:rgb(var(--rtk-colors-text-on-brand-1000, var(--rtk-colors-text-1000, 255 255 255)))}.align-right .image .actions rtk-icon{--tw-text-opacity:1;color:rgba(var(--rtk-colors-brand-300, 73 124 253) / var(--tw-text-opacity))}.avatar{display:flex;width:var(--rtk-space-6, 24px)}.avatar rtk-avatar{height:var(--rtk-space-6, 24px);width:var(--rtk-space-6, 24px);font-size:10px}.message{width:75%}.left-align .body{margin-top:var(--rtk-space-4, 16px)}.left-align [is-continued] .body{margin-top:var(--rtk-space-0, 0px)}.left-align .body{--tw-translate-x:calc(var(--rtk-space-8, 32px) * -1);transform:translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}";var To=function(t,e,i,r){var a,s=arguments.length,n=s<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,i,r);else for(var o=t.length-1;o>=0;o--)(a=t[o])&&(n=(s<3?a(n):s>3?a(e,i,n):a(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};const Lo=class{constructor(t){o(this,t),this.onPinMessage=Y(this,"pinMessage",7),this.stateUpdate=Y(this,"rtkStateUpdate",7),this.observingEl=[],this.autoScrollEnabled=!0,this.messages=[],this.canPinMessages=!1,this.iconPack=je,this.t=Fe(),this.now=new Date,this.showLatestMessageButton=!1,this.onScroll=t=>{const e=t.target;C((()=>{const{scrollTop:t,clientHeight:i,scrollHeight:r}=e;t+i+10>=r?(this.autoScrollEnabled=!0,this.showLatestMessageButton=!1):this.autoScrollEnabled=!1}))},this.scrollToBottom=()=>{Xi(this.$chat)},this.observeMessage=t=>{t&&this.observingEl.push(t);try{this.intersectionObserver.observe(t)}catch(t){}},this.getMessageActions=t=>{const e=[];return!t.pinned&&this.canPinMessages&&e.push({id:"pin_message",label:this.t("pin"),icon:this.iconPack.pin}),e},this.onMessageActionHandler=(t,e)=>{if("pin_message"===t)this.onPinMessage.emit(e)}}connectedCallback(){var t;this.lastReadTimestamp=null!==(t=Ke.everyone)&&void 0!==t?t:new Date("0001-01-01T00:00:00Z"),this.intersectionObserver=new IntersectionObserver((t=>{document.hasFocus()&&C((()=>{for(const e of t)if(e.isIntersecting){parseInt(e.target.getAttribute("data-timestamp"))>this.lastReadTimestamp.getTime()&&(Ke[this.selectedGroup]=new Date)}}))}));const e=()=>{this.now=new Date,this.timeout=setTimeout((()=>{null!=this.request&&(this.request=requestAnimationFrame(e))}),6e4)};this.request=requestAnimationFrame(e),this.chatChanged(this.messages)}componentDidLoad(){this.$chat.addEventListener("scroll",this.onScroll),this.$chat.scrollTop=this.$chat.scrollHeight}componentDidRender(){this.autoScrollEnabled?Xi(this.$chat):null==this.autoScrollEnabled&&Xi(this.$chat,!1)}chatChanged(t){if(null!=this.$chat&&!this.autoScrollEnabled&&this.$chat.clientHeight!==this.$chat.scrollHeight)for(let e=t.length-1;e>=0;e--)if(t[e].message.time>this.lastReadTimestamp&&t[e].message.userId!==this.selfUserId){this.showLatestMessageButton=!0;break}}selectedBucketChanged(){this.autoScrollEnabled=void 0,this.observingEl.forEach((t=>{this.intersectionObserver.unobserve(t)})),this.observingEl=[]}disconnectedCallback(){this.$chat.removeEventListener("scroll",this.onScroll),this.intersectionObserver.disconnect(),clearTimeout(this.timeout),cancelAnimationFrame(this.request)}render(){var t;let e=null,i=!1;return N(H,{key:"01c61fd2a60ca11df413406967eb80af92d07de0"},N("div",{key:"b1a6ad7904236a7fdb50034f33de979faa080ef6",class:"chat-container scrollbar",ref:t=>this.$chat=t,part:"container"},N("div",{key:"95664e4f9b8faae0c31c128abc6f54cf5bcd6acf",class:"spacer",part:"spacer"}),N("div",{key:"e0c40200e05026bb748e608ba6abb6f02b5a701c",class:"chat",part:"chat"},null===(t=this.messages)||void 0===t?void 0:t.map((t=>{if("chat"===t.type){const{message:r}=t,a=!(r.userId===this.selfUserId)&&!this.autoScrollEnabled&&!i&&r.time>this.lastReadTimestamp;a&&(i=a);const s=!a&&r.userId===(null==e?void 0:e.userId)&&Yi(r.time,null==e?void 0:e.time)<2;return e=r,N("div",{"is-continued":s,key:t.message.id,ref:this.observeMessage,"data-timestamp":r.time.getTime(),class:r.pinned?"pinned":""},a&&N("div",{class:"new-chat-marker",part:"new-chat-marker"},this.t("chat.new")),N("div",{class:"message-wrapper"},N("rtk-message-view",{time:r.time,actions:this.getMessageActions(r),authorName:r.displayName,hideAuthorName:!0,hideAvatar:!0,hideMetadata:!0,viewType:"incoming",variant:"bubble",onAction:t=>this.onMessageActionHandler(t.detail,r)},N("div",null,!s&&N("div",{class:"head"},N("div",{class:"name"},r.displayName),!!r.time&&N("div",{class:"time",title:Qi(r.time)},Zi(r.time,new Date(Date.now())))),N("div",{class:"body"},"text"===r.type&&N("rtk-text-message-view",{text:r.message,isMarkdown:!0}),"file"===r.type&&N("rtk-file-message-view",{name:r.name,url:r.link,size:r.size}),"image"===r.type&&N("rtk-image-message-view",{url:r.link,onPreview:()=>{this.stateUpdate.emit({image:r})}})))),r.pinned&&N("div",{class:"pin-button",part:"pin-button"},N("rtk-tooltip",{label:this.t("unpin")},N("rtk-button",{kind:"icon",variant:"ghost",onClick:()=>this.onMessageActionHandler("pin_message",r),disabled:!this.canPinMessages},N("rtk-icon",{icon:this.iconPack.pin,size:"sm"}))))))}return null})))),N("div",{key:"84333af1150e9e30982b3bc27431296181c58c18",class:"show-new-messages-ctr"},N("rtk-button",{key:"21b5c13d59fc4ef0b18870a916f155b4660ad706",class:{"show-new-messages":!0,active:this.showLatestMessageButton},kind:"icon",part:"show-new-messages",onClick:this.scrollToBottom},N("rtk-icon",{key:"beb6880a734bdc3feeb6b630af54d6b1d89273e3",icon:this.iconPack.chevron_down}))))}static get watchers(){return{messages:["chatChanged"],selectedGroup:["selectedBucketChanged"]}}};To([ai()],Lo.prototype,"size",void 0),To([ai()],Lo.prototype,"iconPack",void 0),To([ai()],Lo.prototype,"t",void 0),Lo.style=":host{line-height:initial;font-family:var(--rtk-font-family, sans-serif);font-feature-settings:normal;font-variation-settings:normal}p{margin:var(--rtk-space-0, 0px);padding:var(--rtk-space-0, 0px)}.scrollbar{scrollbar-width:thin;scrollbar-color:var(--rtk-scrollbar-color, rgb(var(--rtk-colors-background-600, 60 60 60)))\n var(--rtk-scrollbar-background, transparent)}.scrollbar::-webkit-scrollbar{height:var(--rtk-space-1\\.5, 6px);width:var(--rtk-space-1\\.5, 6px);border-radius:9999px;background-color:var(--rtk-scrollbar-background, transparent)}.scrollbar::-webkit-scrollbar-thumb{border-radius:9999px;background-color:var(--rtk-scrollbar-color, rgb(var(--rtk-colors-background-600, 60 60 60)))}:host{position:relative;display:flex;flex-direction:column;--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-background-900, 26 26 26) / var(--tw-bg-opacity));word-break:break-word}.chat-container{box-sizing:border-box;display:flex;flex-direction:column;padding-top:var(--rtk-space-4, 16px);padding-bottom:var(--rtk-space-4, 16px);flex:1 0 0px;overflow-y:scroll}.chat-container .spacer{flex:1 1 auto}.chat-container .chat{flex:0 0 auto}.file-picker{display:none}.chat .head{display:flex;align-items:center}.chat .head .name{margin-right:var(--rtk-space-4, 16px);font-size:12px;font-weight:700}.chat .head .time{font-size:12px;color:rgb(var(--rtk-colors-text-800, 255 255 255 / 0.76))}.chat .body{margin-top:var(--rtk-space-2, 8px);overflow-wrap:break-word;line-height:1.375}.chat .body .emoji{font-size:24px}p{margin-top:var(--rtk-space-0, 0px);margin-bottom:var(--rtk-space-3, 12px)}rtk-message-view{margin-top:var(--rtk-space-4, 16px);display:block;padding-left:var(--rtk-space-2, 8px);padding-right:var(--rtk-space-2, 8px);color:rgb(var(--rtk-colors-text-900, 255 255 255 / 0.88));box-sizing:border-box}rtk-message-view::part(message){flex-grow:1}*[is-continued] rtk-message-view{margin-top:var(--rtk-space-1, 4px)}.pinned .message-wrapper{position:relative}.pinned .pin-button{position:absolute;right:var(--rtk-space-4, 16px);top:calc(var(--rtk-space-4, 16px) * -1);display:flex;border-radius:var(--rtk-border-radius-sm, 4px);--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-background-600, 60 60 60) / var(--tw-bg-opacity))}.pinned .pin-button:hover rtk-button{--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-brand-600, 13 81 253) / var(--tw-bg-opacity))}.pinned rtk-message-view{--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-background-700, 44 44 44) / var(--tw-bg-opacity));padding-top:var(--rtk-space-1, 4px);padding-bottom:var(--rtk-space-1, 4px)}a{--tw-text-opacity:1;color:rgba(var(--rtk-colors-brand-300, 73 124 253) / var(--tw-text-opacity));text-decoration-line:none}a:hover{text-decoration-line:underline}.new-chat-marker{display:flex;width:100%;align-items:center;gap:var(--rtk-space-2, 8px);--tw-text-opacity:1;color:rgba(var(--rtk-colors-brand-300, 73 124 253) / var(--tw-text-opacity))}.new-chat-marker::before{content:'';height:1px;flex:1 1 0%;background-color:rgba(var(--rtk-colors-brand-300, 73 124 253) / 0.5)}.show-new-messages-ctr{pointer-events:none;display:flex;justify-content:flex-end;padding:var(--rtk-space-3, 12px);z-index:0;margin-top:calc(var(--rtk-space-14, 56px) * -1)}.show-new-messages{pointer-events:auto;--tw-translate-y:var(--rtk-space-16, 64px);transform:translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));opacity:0;transition-property:color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, -webkit-backdrop-filter;transition-property:color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter;transition-property:color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter, -webkit-backdrop-filter;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:150ms}.show-new-messages.active{--tw-translate-y:var(--rtk-space-0, 0px);transform:translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));opacity:1}";var _o=function(t,e,i,r){var a,s=arguments.length,n=s<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,i,r);else for(var o=t.length-1;o>=0;o--)(a=t[o])&&(n=(s<3?a(n):s>3?a(e,i,n):a(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};const Ro=class{constructor(t){o(this,t),this.editMessageInit=Y(this,"editMessageInit",7),this.onPinMessage=Y(this,"pinMessage",7),this.onDeleteMessage=Y(this,"deleteMessage",7),this.stateUpdate=Y(this,"rtkStateUpdate",7),this.iconPack=je,this.t=Fe(),this.leftAlign=!1,this.permissionsChanged=!1,this.pageSize=25,this.lastReadMessageIndex=-1,this.permissionsUpdateListener=()=>{this.permissionsChanged=!this.permissionsChanged},this.maybeMarkChannelAsRead=t=>{if(!this.selectedChannelId)return;if(0===t.length)return;if(-1!==this.lastReadMessageIndex)return;const e=t.at(0).time>t.at(-1).time?t.at(0):t.at(-1);e.channelIndex&&(this.lastReadMessageIndex=parseInt(e.channelIndex,10),this.meeting.chat.markLastReadMessage(this.selectedChannelId,e))},this.getChatMessages=async(t,e,i)=>{const{messages:r}=await this.meeting.chat.getMessages(t,e,i,void 0,this.selectedChannelId);return this.maybeMarkChannelAsRead(r),r},this.createChatNodes=t=>t.map(((e,i)=>{var r;const a=e.userId===(null===(r=t[i-1])||void 0===r?void 0:r.userId);return this.createChatNode(e,a)})),this.disconnectMeeting=t=>{var e,i;null===(e=null==t?void 0:t.chat)||void 0===e||e.removeListener("chatUpdate",this.chatUpdateListener),null===(i=this.meeting)||void 0===i||i.self.permissions.removeListener("permissionsUpdate",this.permissionsUpdateListener)},this.getMessageActions=t=>{const e=[];return this.meeting.self.permissions.pinParticipant&&e.push({id:"pin_message",label:t.pinned?this.t("unpin"):this.t("pin"),icon:this.iconPack.pin}),e},this.onMessageActionHandler=(t,e)=>{switch(t){case"pin_message":this.onPinMessage.emit(e);break;case"delete_message":this.onDeleteMessage.emit(e)}},this.createChatNode=(t,e)=>{var i,r,a,s;if(0!==t.targetUserIds.length)return null;let n;return n="CHAT"===this.meeting.meta.viewType?null===(i=this.meeting.participants.all.toArray().find((e=>e.userId===t.userId)))||void 0===i?void 0:i.picture:this.meeting.self.userId===t.userId?this.meeting.self.picture:null!==(a=null===(r=this.meeting.participants.joined.toArray().find((e=>e.userId===t.userId)))||void 0===r?void 0:r.picture)&&void 0!==a?a:null===(s=this.meeting.participants.waitlisted.toArray().find((e=>e.userId===t.userId)))||void 0===s?void 0:s.picture,N("div",{class:{pinned:t.pinned}},N("div",{class:"message-wrapper"},N("rtk-message-view",{time:t.time,actions:this.getMessageActions(t),authorName:t.displayName,avatarUrl:n,hideAuthorName:e,viewType:"incoming",variant:"bubble",onAction:e=>this.onMessageActionHandler(e.detail,t)},N("div",null,N("div",{class:"body"},"text"===t.type&&N("rtk-text-message-view",{text:t.message,isMarkdown:!0}),"file"===t.type&&N("rtk-file-message-view",{name:t.name,url:t.link,size:t.size}),"image"===t.type&&N("rtk-image-message-view",{url:t.link,onPreview:()=>{this.stateUpdate.emit({image:t})}})),t.pinned&&N("div",{class:"pin-icon",part:"pin-icon"},N("rtk-icon",{icon:this.iconPack.pin,size:"sm"}))))))},this.chatUpdateListener=t=>{this.selectedChannelId&&t.message.channelId!==this.selectedChannelId||("add"===t.action?(this.$paginatedListRef.onNewNode(t.message),this.lastReadMessageIndex=-1,this.maybeMarkChannelAsRead([t.message])):"delete"===t.action?this.$paginatedListRef.onNodeDelete(t.message.id):"edit"===t.action&&this.$paginatedListRef.onNodeUpdate(t.message.id,t.message))}}componentDidLoad(){const t=this.host.shadowRoot.querySelector("slot");t&&(this.children=t.assignedElements()[0])}connectedCallback(){this.meetingChanged(this.meeting)}disconnectedCallback(){this.disconnectMeeting(this.meeting)}meetingChanged(t,e){var i;null!=e&&this.disconnectMeeting(e),t&&!t.chat||(null!=t&&(null===(i=t.chat)||void 0===i||i.addListener("chatUpdate",this.chatUpdateListener),t.self.permissions.addListener("permissionsUpdate",this.permissionsUpdateListener)),this.permissionsUpdateListener())}channelChanged(){this.lastReadMessageIndex=-1}render(){return N(H,{key:"088b35f5fe196ed2b3271a0b36eef02df47f28e0"},N("rtk-paginated-list",{key:"a856bde7e481f78b081dcd20351d872a6dd687fa",ref:t=>this.$paginatedListRef=t,pageSize:this.pageSize,pagesAllowed:3,fetchData:this.getChatMessages,createNodes:this.createChatNodes,selectedItemId:this.selectedChannelId,emptyListLabel:this.t("chat.empty_channel")},N("slot",{key:"a4c15d852264ca50ae784a8b26b052585b0acac8"})))}get host(){return W(this)}static get watchers(){return{meeting:["meetingChanged"],selectedChannelId:["channelChanged"]}}};_o([ai()],Ro.prototype,"meeting",void 0),_o([ai()],Ro.prototype,"size",void 0),_o([ai()],Ro.prototype,"iconPack",void 0),_o([ai()],Ro.prototype,"t",void 0),Ro.style=":host{display:flex;flex-direction:column;--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-background-900, 26 26 26) / var(--tw-bg-opacity));flex:1 0 0px}";var Ao=function(t,e,i,r){var a,s=arguments.length,n=s<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,i,r);else for(var o=t.length-1;o>=0;o--)(a=t[o])&&(n=(s<3?a(n):s>3?a(e,i,n):a(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};const Do=class{constructor(t){o(this,t),this.iconPack=je,this.t=Fe(),this.pageSize=50,this.searchMessages=async(t,e,i)=>this.meeting.chat.searchMessages(this.query,{channelId:this.channelId,timestamp:t,size:e,reversed:i}),this.nodeRenderer=t=>t.map((t=>N("rtk-chat-message",{key:t.id,message:t,disableControls:!0})))}render(){return N(H,{key:"f94f965504c412fd2a33fd9f50a8baaedd05f3ab"},N("rtk-paginated-list",{key:"6e21d19a60937f67733162a2f2fcdae290c5991f",pageSize:this.pageSize,pagesAllowed:3,fetchData:this.searchMessages,createNodes:this.nodeRenderer,selectedItemId:this.query}))}};Ao([ai()],Do.prototype,"meeting",void 0),Ao([ai()],Do.prototype,"iconPack",void 0),Ao([ai()],Do.prototype,"t",void 0),Do.style=":host{line-height:initial;font-family:var(--rtk-font-family, sans-serif);font-feature-settings:normal;font-variation-settings:normal}p{margin:var(--rtk-space-0, 0px);padding:var(--rtk-space-0, 0px)}:host{display:flex;height:100%;flex-direction:column;position:relative;--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-background-900, 26 26 26) / var(--tw-bg-opacity))}";var Mo=function(t,e,i,r){var a,s=arguments.length,n=s<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,i,r);else for(var o=t.length-1;o>=0;o--)(a=t[o])&&(n=(s<3?a(n):s>3?a(e,i,n):a(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};const Io=class{constructor(t){o(this,t),this.stateUpdate=Y(this,"rtkStateUpdate",7),this.keyPressListener=t=>{"Escape"===t.key&&this.close()},this.iconPack=je,this.t=Fe(),this.close=()=>{this.states.activeConfirmationModal.onClose(this.stateUpdate,this.states,this.meeting),this.stateUpdate.emit({activeConfirmationModal:{active:!1}}),this.states.activeConfirmationModal={active:!1}},this.onConfirmation=async()=>{this.states.activeConfirmationModal.onClick(this.stateUpdate,this.states,this.meeting),this.stateUpdate.emit({activeConfirmationModal:{active:!1}}),this.states.activeConfirmationModal={active:!1}}}connectedCallback(){document.addEventListener("keydown",this.keyPressListener)}componentDidLoad(){}disconnectedCallback(){document.removeEventListener("keydown",this.keyPressListener)}render(){var t,e;const i=this.states.activeConfirmationModal;return N(H,{key:"e9a8a58afa42b97d8dba92f3619b3b0b67160d04"},N("div",{key:"5ad16431e2157600116bbdbf47c194d8a4980621",class:"leave-modal"},N("div",{key:"9285137f1130bcc7f67183e476e5464688ccff90",class:"header"},N("h2",{key:"ef2144a5de17b8f1dd41f4bf765e3da17ae058e5",class:"title"},i.header?this.t(i.header):this.t("cta.confirmation"))),i.content&&N("p",{key:"2227d4079e7df0e02b805aef57c2187c3a55e785",class:"message"},this.t(i.content)),N("div",{key:"d6f587b79bbf99d0e8a00f7bb65975b2eafa80ad",class:"content"},N("div",{key:"cdd81faaf9fa4192a2ed57f9d4d3f36e45400250",class:"leave-meeting"},N("rtk-button",{key:"ff9ddfccf098ea4cc956f95c22e94816e3b0561a",variant:"secondary",title:i.cancelText?this.t(i.cancelText):this.t("cancel"),onClick:this.close,class:"br-secondary-btn"},i.cancelText?this.t(i.cancelText):this.t("cancel")),N("rtk-button",{key:"bc680bd1d2995998e759cbb520f4b146bf6e359e",onClick:()=>this.onConfirmation(),variant:null!==(e=null===(t=this.states.activeConfirmationModal)||void 0===t?void 0:t.variant)&&void 0!==e?e:"danger",title:i.ctaText?this.t(i.ctaText):this.t("yes")},i.ctaText?this.t(i.ctaText):this.t("yes"))))))}};Mo([ai()],Io.prototype,"meeting",void 0),Mo([ai()],Io.prototype,"states",void 0),Mo([ai()],Io.prototype,"iconPack",void 0),Mo([ai()],Io.prototype,"t",void 0),Io.style=":host{line-height:initial;font-family:var(--rtk-font-family, sans-serif);font-feature-settings:normal;font-variation-settings:normal}p{margin:var(--rtk-space-0, 0px);padding:var(--rtk-space-0, 0px)}:host{position:relative;display:flex;flex-direction:column;overflow:hidden;border-radius:var(--rtk-border-radius-md, 8px);padding:var(--rtk-space-8, 32px);width:100%;--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-background-1000, 8 8 8) / var(--tw-bg-opacity));color:rgb(var(--rtk-colors-text-1000, 255 255 255));width:400px;max-width:80%}.leave-modal{width:100%;color:rgb(var(--rtk-colors-text-1000, 255 255 255))}.leave-modal .header h2{margin:var(--rtk-space-0, 0px)}.leave-modal .content{font-size:14px}.leave-modal p{margin-top:var(--rtk-space-3, 12px);margin-bottom:var(--rtk-space-3, 12px)}.leave-meeting{display:flex;flex-direction:row;justify-content:space-between;gap:var(--rtk-space-4, 16px)}.leave-meeting rtk-button{color:rgb(var(--rtk-colors-text-1000, 255 255 255));flex:1 1 0%}.br-secondary-btn{--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-background-800, 30 30 30) / var(--tw-bg-opacity))}.br-secondary-btn:hover{--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-background-600, 60 60 60) / var(--tw-bg-opacity))}";var Oo=function(t,e,i,r){var a,s=arguments.length,n=s<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,i,r);else for(var o=t.length-1;o>=0;o--)(a=t[o])&&(n=(s<3?a(n):s>3?a(e,i,n):a(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};const Uo=class{constructor(t){o(this,t),this.onChange=Y(this,"valueChange",7),this.input="1",this.minValue=0,this.iconPack=je,this.t=Fe()}connectedCallback(){this.watchStateHandler(this.input),this.input=this.value.toString()}watchStateHandler(t){this.onChange.emit(t)}increment(){this.input=Math.max(parseInt(this.input)+1,this.minValue).toString()}decrement(){this.input=Math.max(this.minValue,parseInt(this.input)-1).toString()}render(){return N(H,{key:"69da144af824d130db538c62561020197f7b93fa"},N("rtk-button",{key:"c31072304b50d8f4eb75379ad9cf924762107425",kind:"icon",variant:"ghost",onClick:()=>this.decrement()},N("rtk-icon",{key:"ff4247e38e693b1a642cebb6c7dc4efc675945de",icon:this.iconPack.subtract})),N("input",{key:"ffe5abe4110565707ec1fcd26e74fae44cf9f7a9",type:"number",value:this.input,min:this.minValue,onInput:t=>{const e=parseInt(t.target.value,10);isNaN(e)||e<this.minValue?this.input=this.minValue.toString():this.input=e.toString()}}),N("rtk-button",{key:"5b063c1a3698c7f8ccbd6e7fb406efe0905a260b",kind:"icon",variant:"ghost",onClick:()=>this.increment()},N("rtk-icon",{key:"dbc1a35da59b9973eceab21fdf6fcb395942ac45",icon:this.iconPack.add})))}static get watchers(){return{input:["watchStateHandler"]}}};Oo([ai()],Uo.prototype,"size",void 0),Oo([ai()],Uo.prototype,"iconPack",void 0),Oo([ai()],Uo.prototype,"t",void 0),Uo.style=":host{line-height:initial;font-family:var(--rtk-font-family, sans-serif);font-feature-settings:normal;font-variation-settings:normal}p{margin:var(--rtk-space-0, 0px);padding:var(--rtk-space-0, 0px)}:host{display:flex;flex-direction:row;align-items:center;justify-content:center;--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-background-800, 30 30 30) / var(--tw-bg-opacity));width:-moz-fit-content;width:fit-content;border-radius:var(--rtk-border-radius-sm, 4px);padding:var(--rtk-space-1, 4px)}p{margin:var(--rtk-space-0, 0px);padding-left:var(--rtk-space-2, 8px);padding-right:var(--rtk-space-2, 8px)}input{margin:var(--rtk-space-0, 0px);width:var(--rtk-space-6, 24px);padding:var(--rtk-space-2, 8px);border-width:var(--rtk-border-width-sm, 1px);border-style:solid;border-color:rgb(var(--rtk-colors-text-600, 255 255 255 / 0.52));--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-background-1000, 8 8 8) / var(--tw-bg-opacity));text-align:center;color:rgb(var(--rtk-colors-text-900, 255 255 255 / 0.88));border-radius:var(--rtk-border-radius-sm, 4px);font-size:16px;outline:2px solid transparent;outline-offset:2px;transition-property:color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, -webkit-backdrop-filter;transition-property:color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter;transition-property:color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter, -webkit-backdrop-filter;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:150ms}input::-webkit-outer-spin-button,input::-webkit-inner-spin-button{margin:var(--rtk-space-0, 0px);appearance:none;-webkit-appearance:none}input[type='number']{-moz-appearance:textfield}";var $o=function(t,e,i,r){var a,s=arguments.length,n=s<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,i,r);else for(var o=t.length-1;o>=0;o--)(a=t[o])&&(n=(s<3?a(n):s>3?a(e,i,n):a(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};const Fo=class{constructor(t){o(this,t),this.stateUpdate=Y(this,"rtkStateUpdate",7),this.keyPressListener=t=>{"Escape"===t.key&&this.close()},this.iconPack=je,this.t=Fe(),this.activeTab="audio",this.isMobileMainVisible=!1,this.progress=0}connectedCallback(){document.addEventListener("keydown",this.keyPressListener)}disconnectedCallback(){this.keyPressListener&&document.removeEventListener("keydown",this.keyPressListener)}progressUpdate(t){this.progress=t.detail}changeTab(t){this.activeTab=t,"sm"===this.size&&(this.isMobileMainVisible||(this.isMobileMainVisible=!0))}close(){this.stateUpdate.emit({activeDebugger:!1})}getActiveTab(){switch(this.activeTab){case"audio":return this.t("debugger.audio.troubleshooting.label");case"screenshare":return this.t("debugger.screenshare.troubleshooting.label");case"video":return this.t("debugger.video.troubleshooting.label");case"system":return this.t("debugger.system.troubleshooting.label");default:return this.t("debugger.troubleshooting.label")}}render(){if(null==this.meeting)return null;const t={meeting:this.meeting,states:this.states,iconPack:this.iconPack,t:this.t,size:this.size},e=this.getActiveTab(),i=void 0!==navigator.getBattery;return N(H,null,N("aside",{class:{hide:this.isMobileMainVisible},part:"menu"},N("header",null,N("h3",null,this.t("debugger.troubleshooting.label"))),N("button",{type:"button",class:{active:"audio"===this.activeTab},onClick:()=>this.changeTab("audio")},this.t("debugger.audio.label"),N("div",{class:"right"},N("rtk-icon",{icon:this.iconPack.mic_on}),"sm"===this.size&&N("rtk-icon",{icon:this.iconPack.chevron_right}))),N("button",{type:"button",class:{active:"video"===this.activeTab},onClick:()=>this.changeTab("video")},this.t("debugger.video.label"),N("div",{class:"right"},N("rtk-icon",{icon:this.iconPack.video_on}),"sm"===this.size&&N("rtk-icon",{icon:this.iconPack.chevron_right}))),N("button",{type:"button",class:{active:"screenshare"===this.activeTab},onClick:()=>this.changeTab("screenshare")},this.t("debugger.screenshare.label"),N("div",{class:"right"},N("rtk-icon",{icon:this.iconPack.share_screen_start}),"sm"===this.size&&N("rtk-icon",{icon:this.iconPack.chevron_right}))),N("button",{type:"button",class:{active:"system"===this.activeTab,hidden:!i},onClick:()=>this.changeTab("system")},this.t("debugger.system.label"),N("div",{class:"right"},N("rtk-icon",{icon:this.iconPack.settings}),"sm"===this.size&&N("rtk-icon",{icon:this.iconPack.chevron_right})))),N("main",{class:{active:this.isMobileMainVisible},part:"main-content"},"sm"===this.size&&N("header",null,N("rtk-button",{kind:"icon",class:"back-btn",onClick:()=>this.isMobileMainVisible=!1},N("rtk-icon",{icon:this.iconPack.chevron_left})),N("h4",null,e)),"audio"===this.activeTab&&N("rtk-debugger-audio",Object.assign({},t)),"video"===this.activeTab&&N("rtk-debugger-video",Object.assign({},t)),"screenshare"===this.activeTab&&N("rtk-debugger-screenshare",Object.assign({},t)),"system"===this.activeTab&&i&&N("rtk-debugger-system",Object.assign({},t))))}};function jo({stats:t}){if(!t||!t.length)return null;let e="Good";const i=t.map((t=>t.verdict));return i.includes("Poor")?e="Poor":i.includes("Average")&&(e="Average"),e}function zo({packetLossPercentage:t}){let e="Good";return t>4?e="Poor":t>=1&&t<=4&&(e="Average"),e}function No({jitterInMS:t}){let e="Good";return t>100?e="Poor":t>=50&&t<=100&&(e="Average"),e}function Bo({bitrate:t}){let e="Good";return 0===Math.round(t/1024)&&(e="Poor"),e}function Ho({batteryLevelPercentage:t}){let e="Good";return t<20?e="Poor":t<50&&(e="Average"),e}function Go({charging:t,dischargingTimeInSeconds:e,batteryLevelPercentage:i}){return i<20?"Poor":t?"Good":e<1800?"Poor":"Average"}$o([ai()],Fo.prototype,"meeting",void 0),$o([ai()],Fo.prototype,"states",void 0),$o([ai()],Fo.prototype,"size",void 0),$o([ai()],Fo.prototype,"iconPack",void 0),$o([ai()],Fo.prototype,"t",void 0),Fo.style=":host{line-height:initial;font-family:var(--rtk-font-family, sans-serif);font-feature-settings:normal;font-variation-settings:normal}p{margin:var(--rtk-space-0, 0px);padding:var(--rtk-space-0, 0px)}.scrollbar{scrollbar-width:thin;scrollbar-color:var(--rtk-scrollbar-color, rgb(var(--rtk-colors-background-600, 60 60 60)))\n var(--rtk-scrollbar-background, transparent)}.scrollbar::-webkit-scrollbar{height:var(--rtk-space-1\\.5, 6px);width:var(--rtk-space-1\\.5, 6px);border-radius:9999px;background-color:var(--rtk-scrollbar-background, transparent)}.scrollbar::-webkit-scrollbar-thumb{border-radius:9999px;background-color:var(--rtk-scrollbar-color, rgb(var(--rtk-colors-background-600, 60 60 60)))}:host{position:relative;display:flex;overflow:hidden;border-radius:var(--rtk-border-radius-md, 8px);width:100%;--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-background-900, 26 26 26) / var(--tw-bg-opacity));color:rgb(var(--rtk-colors-text-1000, 255 255 255))}header{margin-right:var(--rtk-space-2, 8px);display:flex;align-items:center;justify-content:space-between;padding-top:var(--rtk-space-0, 0px);padding-bottom:var(--rtk-space-0, 0px);padding-left:var(--rtk-space-2, 8px);padding-right:var(--rtk-space-2, 8px)}header h3{margin-top:var(--rtk-space-4, 16px);margin-bottom:var(--rtk-space-4, 16px)}.back-btn{border-radius:var(--rtk-border-radius-sm, 4px);background-color:transparent;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)}.back-btn:hover{--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-background-700, 44 44 44) / var(--tw-bg-opacity))}aside{box-sizing:border-box;display:flex;max-width:var(--rtk-space-56, 224px) !important;flex-direction:column;--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-background-1000, 8 8 8) / var(--tw-bg-opacity));padding-left:var(--rtk-space-2, 8px)}aside button{margin-top:var(--rtk-space-4, 16px);box-sizing:border-box;display:flex;width:100%;align-items:center;justify-content:space-between;border-top-left-radius:var(--rtk-border-radius-sm, 4px);border-bottom-left-radius:var(--rtk-border-radius-sm, 4px);padding-left:var(--rtk-space-4, 16px);padding-right:var(--rtk-space-4, 16px);padding-top:var(--rtk-space-3, 12px);padding-bottom:var(--rtk-space-3, 12px);background-color:transparent;color:rgb(var(--rtk-colors-text-900, 255 255 255 / 0.88));cursor:default;font-size:14px;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);border-width:var(--rtk-border-width-none, 0);border-style:none;outline:2px solid transparent;outline-offset:2px}aside button .right{display:flex;align-items:center}aside button .right rtk-icon{height:var(--rtk-space-5, 20px);width:var(--rtk-space-5, 20px)}aside button .right rtk-icon:last-child{margin-left:var(--rtk-space-4, 16px)}aside button[type='button']{cursor:pointer;transition-property:color, background-color, border-color, text-decoration-color, fill, stroke;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:150ms}aside button[type='button']:hover{--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-background-700, 44 44 44) / var(--tw-bg-opacity))}aside button[type='button']{border-right:var(--rtk-border-width-md, 2px) solid transparent}aside button.active{--tw-border-opacity:1;border-color:rgba(var(--rtk-colors-brand-500, 33 96 253) / var(--tw-border-opacity));background-color:rgba(var(--rtk-colors-brand-500, 33 96 253) / 0.2)}aside button.active:hover{background-color:rgba(var(--rtk-colors-brand-500, 33 96 253) / 0.2)}aside button.hidden{display:none}main{position:relative;box-sizing:border-box;display:flex;height:100%;width:100%;flex-direction:column}:host([size='sm']) aside{--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-background-900, 26 26 26) / var(--tw-bg-opacity));width:100% !important;max-width:100% !important;padding-left:var(--rtk-space-0, 0px)}:host([size='sm']) aside button{border-radius:var(--rtk-border-radius-none, 0)}:host([size='sm']) aside button.active{border-width:var(--rtk-border-width-none, 0);border-style:none;background-color:transparent}:host([size='sm']) aside button.active:hover{--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-background-700, 44 44 44) / var(--tw-bg-opacity))}:host([size='sm']) aside button.hidden{display:none}:host([size='sm']) aside.hide{display:none}aside button:host([size='sm']) aside.hide{display:none}:host([size='sm']) aside button:host([size='sm']) aside.hide{display:none}:host([size='sm']) main{display:none;height:100%;width:100%;padding:var(--rtk-space-0, 0px)}aside button:host([size='sm']) main{display:none}:host([size='sm']) aside button:host([size='sm']) main{display:none}:host([size='sm']) main.active{display:block}:host([size='sm']) header{margin:var(--rtk-space-0, 0px);justify-content:center}:host([size='sm']) header rtk-button{position:absolute;left:var(--rtk-space-4, 16px)}::-webkit-scrollbar{width:8px}::-webkit-scrollbar-track{border-radius:var(--rtk-border-radius-lg, 12px);--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-background-800, 30 30 30) / var(--tw-bg-opacity))}::-webkit-scrollbar-thumb{border-radius:var(--rtk-border-radius-lg, 12px);--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-background-1000, 8 8 8) / var(--tw-bg-opacity))}::-webkit-scrollbar-thumb:hover{border-radius:var(--rtk-border-radius-lg, 12px);--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-background-1000, 8 8 8) / var(--tw-bg-opacity))}.progress-bar{height:var(--rtk-space-1, 4px);width:100%;overflow:hidden;--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-background-600, 60 60 60) / var(--tw-bg-opacity))}.progress-indicator{height:100%;--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-brand-500, 33 96 253) / var(--tw-bg-opacity))}";var Vo=function(t,e,i,r){var a,s=arguments.length,n=s<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,i,r);else for(var o=t.length-1;o>=0;o--)(a=t[o])&&(n=(s<3?a(n):s>3?a(e,i,n):a(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};const qo=class{constructor(t){o(this,t),this.iconPack=je,this.t=Fe(),this.isNetworkOpen=!0,this.isDevicesOpen=!1,this.audioProducerFormattedStats=[],this.audioProducerScoreStats=null,this.networkBasedMediaHealth=null,this.devicesHealth=null,this.mediaScoreUpdateListener=({kind:t,isScreenshare:e,scoreStats:i})=>{"audio"!==t||e||(this.audioProducerScoreStats=i)},this.deviceListUpdateListener=async()=>{const t=await this.meeting.self.getAudioDevices();this.devicesHealth=(null==t?void 0:t.length)>0?"Good":"Poor"},this.audioUpdateListener=()=>{this.meeting.self.audioEnabled||(this.audioProducerScoreStats=null)}}async audioProducerScoreStatsChanged(t){if(!t)return void(this.audioProducerFormattedStats=[]);const e=t,i=[];i.push({name:this.t("debugger.stats.bitrate.label"),value:`${Math.round(e.bitrate/1024)} kbps`,description:this.t("debugger.stats.bitrate.description"),verdict:Bo({bitrate:e.bitrate})}),i.push({name:this.t("debugger.stats.packet_loss.label"),value:`${e.packetsLostPercentage}%`,description:this.t("debugger.stats.packet_loss.description"),verdict:zo({packetLossPercentage:e.packetsLostPercentage})}),i.push({name:this.t("debugger.stats.jitter.label"),value:`${Math.round(1e3*e.jitter)} ms`,description:this.t("debugger.stats.jitter.description"),verdict:No({jitterInMS:1e3*e.jitter})}),this.audioProducerFormattedStats=i,this.networkBasedMediaHealth=jo({stats:i})}connectedCallback(){this.meetingChanged(this.meeting)}disconnectedCallback(){this.meeting&&(this.meeting.self.off("mediaScoreUpdate",this.mediaScoreUpdateListener),this.meeting.self.off("audioUpdate",this.audioUpdateListener),this.meeting.self.off("deviceListUpdate",this.deviceListUpdateListener))}async meetingChanged(t){t&&(t.self.on("mediaScoreUpdate",this.mediaScoreUpdateListener),t.self.on("audioUpdate",this.audioUpdateListener),t.self.on("deviceListUpdate",this.deviceListUpdateListener),await this.deviceListUpdateListener())}render(){var t,e;if(this.meeting)return N(H,null,N("div",{id:"header"}),N("div",{class:"tab-body"},N("div",{class:"status-container"},N("div",{class:"status-section"},N("div",{class:"section-header "+(this.networkBasedMediaHealth?"":"only-child")},N("span",null,this.t("debugger.audio.sections.network_media")),this.networkBasedMediaHealth&&N("span",{class:`status ${null===(t=this.networkBasedMediaHealth)||void 0===t?void 0:t.toLowerCase()}`},this.t(`debugger.quality.${null===(e=this.networkBasedMediaHealth)||void 0===e?void 0:e.toLowerCase()}`))),this.isNetworkOpen&&!this.audioProducerFormattedStats.length&&N("div",{class:"section-body missing-stats"},this.meeting.self.audioEnabled?N("span",null,this.t("debugger.audio.messages.generating_report")):N("span",null,this.t("debugger.audio.messages.enable_media"))),this.isNetworkOpen&&!!this.audioProducerFormattedStats.length&&N("div",{class:"section-body network-table"},this.audioProducerFormattedStats.map((t=>{var e,i;return N("div",{class:"network-row"},N("div",{class:"network-cell label"},N("strong",null,t.name),N("span",{class:"description"},t.description)),N("div",{class:"network-cell value"},N("span",{class:`status ${null===(e=t.verdict)||void 0===e?void 0:e.toLowerCase()}`},this.t(`debugger.quality.${null===(i=t.verdict)||void 0===i?void 0:i.toLowerCase()}`)),N("span",{class:"value"},t.value)))})))))))}static get watchers(){return{audioProducerScoreStats:["audioProducerScoreStatsChanged"],meeting:["meetingChanged"]}}};Vo([ai()],qo.prototype,"meeting",void 0),Vo([ai()],qo.prototype,"states",void 0),Vo([ai()],qo.prototype,"size",void 0),Vo([ai()],qo.prototype,"iconPack",void 0),Vo([ai()],qo.prototype,"t",void 0),qo.style=":host{line-height:initial;font-family:var(--rtk-font-family, sans-serif);font-feature-settings:normal;font-variation-settings:normal}p{margin:var(--rtk-space-0, 0px);padding:var(--rtk-space-0, 0px)}.scrollbar{scrollbar-width:thin;scrollbar-color:var(--rtk-scrollbar-color, rgb(var(--rtk-colors-background-600, 60 60 60)))\n var(--rtk-scrollbar-background, transparent)}.scrollbar::-webkit-scrollbar{height:var(--rtk-space-1\\.5, 6px);width:var(--rtk-space-1\\.5, 6px);border-radius:9999px;background-color:var(--rtk-scrollbar-background, transparent)}.scrollbar::-webkit-scrollbar-thumb{border-radius:9999px;background-color:var(--rtk-scrollbar-color, rgb(var(--rtk-colors-background-600, 60 60 60)))}:host{position:relative;display:flex;flex-direction:column;overflow:hidden;height:100%;width:100%;color:rgb(var(--rtk-colors-text-1000, 255 255 255));--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-background-600, 60 60 60) / var(--tw-bg-opacity))}.tab-body::-webkit-scrollbar{width:var(--rtk-space-1\\.5, 6px);border-radius:var(--rtk-border-radius-md, 8px);--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-background-1000, 8 8 8) / var(--tw-bg-opacity))}.tab-body::-webkit-scrollbar-thumb{border-radius:var(--rtk-border-radius-md, 8px);--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-background-700, 44 44 44) / var(--tw-bg-opacity))}h3{margin:var(--rtk-space-0, 0px);padding:var(--rtk-space-0, 0px);font-size:16px;font-weight:600}#header{margin-top:var(--rtk-space-2, 8px);margin-bottom:var(--rtk-space-5, 20px);display:flex;align-items:center;justify-content:space-evenly}.tab-body{margin:var(--rtk-space-4, 16px);display:flex;height:100%;flex-direction:column;justify-content:space-between;overflow-y:auto}.status-container{border:var(--rtk-border-width-sm, 1px) solid rgb(var(--rtk-colors-background-600, 60 60 60));border-radius:8px;padding:16px}.status-section{margin-bottom:12px}.section-header{display:flex;justify-content:space-between;align-items:center;font-weight:bold;padding:8px 0}.section-header.only-child{justify-content:center}.section-body.missing-stats{display:flex;text-align:center;justify-content:center}.section-header .status{color:rgba(var(--rtk-colors-success));font-weight:bold}.section-header .arrow{font-size:14px}.network-table{border:var(--rtk-border-width-sm, 1px) solid rgb(var(--rtk-colors-background-600, 60 60 60));border-radius:8px;margin-top:8px;overflow:hidden}.network-row{display:flex;justify-content:space-between;padding:12px;border-bottom:var(--rtk-border-width-sm, 1px) solid rgb(var(--rtk-colors-background-600, 60 60 60))}.network-row:last-child{border-bottom:none}.network-cell{display:flex;flex-direction:column}.network-cell.label strong{font-size:14px}.network-cell.label .description{font-size:12px;color:rgb(var(--rtk-colors-text-700, 255 255 255 / 0.64));margin-top:4px}.network-cell.value{text-align:right}.status.good{color:rgba(var(--rtk-colors-success))}.status.average{color:rgba(var(--rtk-colors-warning))}.status.poor{color:rgba(var(--rtk-colors-danger))}.value{font-size:14px;color:rgb(var(--rtk-colors-text-700, 255 255 255 / 0.64));margin-top:4px}rtk-settings-audio{display:flex;flex-direction:column}";var Ko=function(t,e,i,r){var a,s=arguments.length,n=s<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,i,r);else for(var o=t.length-1;o>=0;o--)(a=t[o])&&(n=(s<3?a(n):s>3?a(e,i,n):a(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};const Wo=class{constructor(t){o(this,t),this.iconPack=je,this.t=Fe(),this.isNetworkOpen=!0,this.isDevicesOpen=!1,this.videoProducerFormattedStats=[],this.videoProducerScoreStats=null,this.audioProducerFormattedStats=[],this.audioProducerScoreStats=null,this.networkBasedMediaHealth=null,this.mediaScoreUpdateListener=({kind:t,isScreenshare:e,scoreStats:i})=>{"video"===t&&e&&(this.videoProducerScoreStats=i),"audio"===t&&e&&(this.audioProducerScoreStats=i)},this.screenShareUpdateListener=()=>{this.meeting.self.screenShareEnabled||(this.videoProducerScoreStats=null,this.audioProducerScoreStats=null)}}async videoProducerScoreStatsChanged(t){if(!t)return void(this.videoProducerFormattedStats=[]);const e=t,i=[];i.push({name:this.t("debugger.stats.cpu_limitations.label"),value:e.cpuLimitations?"Yes":"No",description:this.t("debugger.stats.cpu_limitations.description"),verdict:e.cpuLimitations?"Poor":"Good"}),i.push({name:this.t("debugger.stats.bandwidth_limitations.label"),value:e.bandwidthLimitations?"Yes":"No",description:this.t("debugger.stats.bandwidth_limitations.description"),verdict:e.bandwidthLimitations?"Poor":"Good"}),i.push({name:this.t("debugger.stats.bitrate.label"),value:`${Math.round(e.bitrate/1024)} kbps`,description:this.t("debugger.stats.bitrate.description"),verdict:Bo({bitrate:e.bitrate})}),i.push({name:this.t("debugger.stats.packet_loss.label"),value:`${e.packetsLostPercentage}%`,description:this.t("debugger.stats.packet_loss.description"),verdict:zo({packetLossPercentage:e.packetsLostPercentage})}),i.push({name:this.t("debugger.stats.jitter.label"),value:`${Math.round(1e3*e.jitter)} ms`,description:this.t("debugger.stats.jitter.description"),verdict:No({jitterInMS:1e3*e.jitter})}),this.videoProducerFormattedStats=i,this.networkBasedMediaHealth=jo({stats:i})}async audioProducerScoreStatsChanged(t){if(!t)return void(this.audioProducerFormattedStats=[]);const e=t,i=[];i.push({name:this.t("debugger.stats.bitrate.label"),value:`${Math.round(e.bitrate/1024)} kbps`,description:this.t("debugger.stats.bitrate.description"),verdict:Bo({bitrate:e.bitrate})}),i.push({name:this.t("debugger.stats.packet_loss.label"),value:`${e.packetsLostPercentage}%`,description:this.t("debugger.stats.packet_loss.description"),verdict:zo({packetLossPercentage:e.packetsLostPercentage})}),i.push({name:this.t("debugger.stats.jitter.label"),value:`${Math.round(1e3*e.jitter)} ms`,description:this.t("debugger.stats.jitter.description"),verdict:No({jitterInMS:1e3*e.jitter})}),this.audioProducerFormattedStats=i}connectedCallback(){this.meetingChanged(this.meeting)}disconnectedCallback(){this.meeting&&(this.meeting.self.off("mediaScoreUpdate",this.mediaScoreUpdateListener),this.meeting.self.off("screenShareUpdate",this.screenShareUpdateListener))}async meetingChanged(t){t&&(t.self.on("mediaScoreUpdate",this.mediaScoreUpdateListener),t.self.on("screenShareUpdate",this.screenShareUpdateListener))}render(){var t,e;if(this.meeting)return N(H,null,N("div",{id:"header"}),N("div",{class:"tab-body"},N("div",{class:"status-container"},N("div",{class:"status-section"},N("div",{class:"section-header "+(this.networkBasedMediaHealth?"":"only-child")},N("span",null,this.t("debugger.screenshare.sections.network_media")),this.networkBasedMediaHealth&&N("span",{class:`status ${null===(t=this.networkBasedMediaHealth)||void 0===t?void 0:t.toLowerCase()}`},this.t(`debugger.quality.${null===(e=this.networkBasedMediaHealth)||void 0===e?void 0:e.toLowerCase()}`))),this.isNetworkOpen&&!this.videoProducerFormattedStats.length&&N("div",{class:"section-body missing-stats"},this.meeting.self.screenShareEnabled?N("span",null,this.t("debugger.screenshare.messages.generating_report")):N("span",null,this.t("debugger.screenshare.messages.enable_media"))),this.isNetworkOpen&&!!this.videoProducerFormattedStats.length&&N("div",{class:"section-body network-table"},this.videoProducerFormattedStats.map((t=>{var e,i;return N("div",{class:"network-row"},N("div",{class:"network-cell label"},N("strong",null,t.name),N("span",{class:"description"},t.description)),N("div",{class:"network-cell value"},N("span",{class:`status ${null===(e=t.verdict)||void 0===e?void 0:e.toLowerCase()}`},this.t(`debugger.quality.${null===(i=t.verdict)||void 0===i?void 0:i.toLowerCase()}`)),N("span",{class:"value"},t.value)))})))))))}static get watchers(){return{videoProducerScoreStats:["videoProducerScoreStatsChanged"],audioProducerScoreStats:["audioProducerScoreStatsChanged"],meeting:["meetingChanged"]}}};Ko([ai()],Wo.prototype,"meeting",void 0),Ko([ai()],Wo.prototype,"states",void 0),Ko([ai()],Wo.prototype,"size",void 0),Ko([ai()],Wo.prototype,"iconPack",void 0),Ko([ai()],Wo.prototype,"t",void 0),Wo.style=":host{line-height:initial;font-family:var(--rtk-font-family, sans-serif);font-feature-settings:normal;font-variation-settings:normal}p{margin:var(--rtk-space-0, 0px);padding:var(--rtk-space-0, 0px)}.scrollbar{scrollbar-width:thin;scrollbar-color:var(--rtk-scrollbar-color, rgb(var(--rtk-colors-background-600, 60 60 60)))\n var(--rtk-scrollbar-background, transparent)}.scrollbar::-webkit-scrollbar{height:var(--rtk-space-1\\.5, 6px);width:var(--rtk-space-1\\.5, 6px);border-radius:9999px;background-color:var(--rtk-scrollbar-background, transparent)}.scrollbar::-webkit-scrollbar-thumb{border-radius:9999px;background-color:var(--rtk-scrollbar-color, rgb(var(--rtk-colors-background-600, 60 60 60)))}:host{position:relative;display:flex;flex-direction:column;overflow:hidden;height:100%;width:100%;color:rgb(var(--rtk-colors-text-1000, 255 255 255));--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-background-600, 60 60 60) / var(--tw-bg-opacity))}.tab-body::-webkit-scrollbar{width:var(--rtk-space-1\\.5, 6px);border-radius:var(--rtk-border-radius-md, 8px);--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-background-1000, 8 8 8) / var(--tw-bg-opacity))}.tab-body::-webkit-scrollbar-thumb{border-radius:var(--rtk-border-radius-md, 8px);--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-background-700, 44 44 44) / var(--tw-bg-opacity))}h3{margin:var(--rtk-space-0, 0px);padding:var(--rtk-space-0, 0px);font-size:16px;font-weight:600}#header{margin-top:var(--rtk-space-2, 8px);margin-bottom:var(--rtk-space-5, 20px);display:flex;align-items:center;justify-content:space-evenly}.tab-body{margin:var(--rtk-space-4, 16px);display:flex;height:100%;flex-direction:column;justify-content:space-between;overflow-y:auto}.status-container{border:var(--rtk-border-width-sm, 1px) solid rgb(var(--rtk-colors-background-600, 60 60 60));border-radius:8px;padding:16px}.status-section{margin-bottom:12px}.section-header{display:flex;justify-content:space-between;align-items:center;font-weight:bold;padding:8px 0}.section-header.only-child{justify-content:center}.section-body.missing-stats{display:flex;text-align:center;justify-content:center}.section-header .status{color:rgba(var(--rtk-colors-success));font-weight:bold}.section-header .arrow{font-size:14px}.network-table{border:var(--rtk-border-width-sm, 1px) solid rgb(var(--rtk-colors-background-600, 60 60 60));border-radius:8px;margin-top:8px;overflow:hidden}.network-row{display:flex;justify-content:space-between;padding:12px;border-bottom:var(--rtk-border-width-sm, 1px) solid rgb(var(--rtk-colors-background-600, 60 60 60))}.network-row:last-child{border-bottom:none}.network-cell{display:flex;flex-direction:column}.network-cell.label strong{font-size:14px}.network-cell.label .description{font-size:12px;color:rgb(var(--rtk-colors-text-700, 255 255 255 / 0.64));margin-top:4px}.network-cell.value{text-align:right}.status.good{color:rgba(var(--rtk-colors-success))}.status.average{color:rgba(var(--rtk-colors-warning))}.status.poor{color:rgba(var(--rtk-colors-danger))}.value{font-size:14px;color:rgb(var(--rtk-colors-text-700, 255 255 255 / 0.64));margin-top:4px}";var Yo=function(t,e,i,r){var a,s=arguments.length,n=s<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,i,r);else for(var o=t.length-1;o>=0;o--)(a=t[o])&&(n=(s<3?a(n):s>3?a(e,i,n):a(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};const Zo=class{constructor(t){o(this,t),this.iconPack=je,this.t=Fe(),this.isBatterySectionOpen=!0,this.batterySectionHealth=null,this.battery=null,this.batteryFormattedStats=[],this.batteryUpdateListener=()=>{const t=Math.round(100*this.battery.level),e=[];e.push({name:this.t("debugger.system.battery.level.label"),value:`${t}%`,description:this.t("debugger.system.battery.level.description"),verdict:Ho({batteryLevelPercentage:t})}),e.push({name:this.t("debugger.system.battery.charging.label"),value:`${this.battery.charging?this.t("debugger.system.battery.charging.is_charging"):this.t("debugger.system.battery.charging.is_not_charging")}`,description:this.t("debugger.system.battery.charging.description"),verdict:Go({batteryLevelPercentage:t,chargingTimeInSeconds:this.battery.chargingTime,dischargingTimeInSeconds:this.battery.dischargingTime,charging:this.battery.charging})}),this.batterySectionHealth=function({stats:t}){if(!t||!t.length)return null;let e="Good";const i=t.map((t=>t.verdict));return i.includes("Poor")?e="Poor":i.includes("Average")&&(e="Average"),e}({stats:e}),this.batteryFormattedStats=e}}toggleSection(t){"battery"===t&&(this.isBatterySectionOpen=!this.isBatterySectionOpen)}connectedCallback(){this.meetingChanged(this.meeting)}disconnectedCallback(){this.meeting&&this.battery&&(this.battery.removeEventListener("levelchange",this.batteryUpdateListener),this.battery.removeEventListener("chargingchange",this.batteryUpdateListener))}async meetingChanged(t){t&&void 0!==navigator.getBattery&&(this.battery=await navigator.getBattery(),this.battery.addEventListener("levelchange",this.batteryUpdateListener),this.battery.addEventListener("chargingchange",this.batteryUpdateListener),this.batteryUpdateListener())}render(){var t,e;if(this.meeting)return N(H,null,N("div",{id:"header"}),N("div",{class:"tab-body"},N("div",{class:"status-container"},N("div",{class:"status-section"},N("div",{class:"section-header",onClick:()=>this.toggleSection("battery")},N("span",null,this.t("debugger.system.sections.battery")),this.batterySectionHealth&&N("span",{class:`status ${null===(t=this.batterySectionHealth)||void 0===t?void 0:t.toLowerCase()}`},this.t(`debugger.quality.${null===(e=this.batterySectionHealth)||void 0===e?void 0:e.toLowerCase()}`))),this.isBatterySectionOpen&&!!this.batteryFormattedStats.length&&N("div",{class:"section-body battery-table"},this.batteryFormattedStats.map((t=>{var e,i;return N("div",{class:"battery-row"},N("div",{class:"battery-cell label"},N("strong",null,t.name),N("span",{class:"description"},t.description)),N("div",{class:"battery-cell value"},N("span",{class:`status ${null===(e=t.verdict)||void 0===e?void 0:e.toLowerCase()}`},this.t(`debugger.quality.${null===(i=t.verdict)||void 0===i?void 0:i.toLowerCase()}`)),N("span",{class:"value"},t.value)))})))))))}static get watchers(){return{meeting:["meetingChanged"]}}};Yo([ai()],Zo.prototype,"meeting",void 0),Yo([ai()],Zo.prototype,"states",void 0),Yo([ai()],Zo.prototype,"size",void 0),Yo([ai()],Zo.prototype,"iconPack",void 0),Yo([ai()],Zo.prototype,"t",void 0),Zo.style=":host{line-height:initial;font-family:var(--rtk-font-family, sans-serif);font-feature-settings:normal;font-variation-settings:normal}p{margin:var(--rtk-space-0, 0px);padding:var(--rtk-space-0, 0px)}.scrollbar{scrollbar-width:thin;scrollbar-color:var(--rtk-scrollbar-color, rgb(var(--rtk-colors-background-600, 60 60 60)))\n var(--rtk-scrollbar-background, transparent)}.scrollbar::-webkit-scrollbar{height:var(--rtk-space-1\\.5, 6px);width:var(--rtk-space-1\\.5, 6px);border-radius:9999px;background-color:var(--rtk-scrollbar-background, transparent)}.scrollbar::-webkit-scrollbar-thumb{border-radius:9999px;background-color:var(--rtk-scrollbar-color, rgb(var(--rtk-colors-background-600, 60 60 60)))}:host{position:relative;display:flex;flex-direction:column;overflow:hidden;height:100%;width:100%;color:rgb(var(--rtk-colors-text-1000, 255 255 255));--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-background-600, 60 60 60) / var(--tw-bg-opacity))}.tab-body::-webkit-scrollbar{width:var(--rtk-space-1\\.5, 6px);border-radius:var(--rtk-border-radius-md, 8px);--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-background-1000, 8 8 8) / var(--tw-bg-opacity))}.tab-body::-webkit-scrollbar-thumb{border-radius:var(--rtk-border-radius-md, 8px);--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-background-700, 44 44 44) / var(--tw-bg-opacity))}h3{margin:var(--rtk-space-0, 0px);padding:var(--rtk-space-0, 0px);font-size:16px;font-weight:600}#header{margin-top:var(--rtk-space-2, 8px);margin-bottom:var(--rtk-space-5, 20px);display:flex;align-items:center;justify-content:space-evenly}.tab-body{margin:var(--rtk-space-4, 16px);display:flex;height:100%;flex-direction:column;justify-content:space-between;overflow-y:auto}.status-container{border:var(--rtk-border-width-sm, 1px) solid rgb(var(--rtk-colors-background-600, 60 60 60));border-radius:8px;padding:16px}.status-section{margin-bottom:12px}.section-header{display:flex;justify-content:space-between;align-items:center;font-weight:bold;padding:8px 0}.section-body.missing-stats{display:flex;text-align:center;justify-content:center}.section-header .status{color:rgba(var(--rtk-colors-success));font-weight:bold}.section-header .arrow{font-size:14px}.battery-table{border:var(--rtk-border-width-sm, 1px) solid rgb(var(--rtk-colors-background-600, 60 60 60));border-radius:8px;margin-top:8px;overflow:hidden}.battery-row{display:flex;justify-content:space-between;padding:12px;border-bottom:var(--rtk-border-width-sm, 1px) solid rgb(var(--rtk-colors-background-600, 60 60 60))}.battery-row:last-child{border-bottom:none}.battery-cell{display:flex;flex-direction:column}.battery-cell.label strong{font-size:14px}.battery-cell.label .description{font-size:12px;color:rgb(var(--rtk-colors-text-700, 255 255 255 / 0.64));margin-top:4px}.battery-cell.value{text-align:right}.status.good{color:rgba(var(--rtk-colors-success))}.status.average{color:rgba(var(--rtk-colors-warning))}.status.poor{color:rgba(var(--rtk-colors-danger))}.value{font-size:14px;color:rgb(var(--rtk-colors-text-700, 255 255 255 / 0.64));margin-top:4px}rtk-settings-video{display:flex;flex-direction:column}";var Qo=function(t,e,i,r){var a,s=arguments.length,n=s<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,i,r);else for(var o=t.length-1;o>=0;o--)(a=t[o])&&(n=(s<3?a(n):s>3?a(e,i,n):a(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};const Jo=class{constructor(t){o(this,t),this.iconPack=je,this.t=Fe(),this.isNetworkOpen=!0,this.isDevicesOpen=!1,this.videoProducerFormattedStats=[],this.videoProducerScoreStats=null,this.networkBasedMediaHealth=null,this.devicesHealth=null,this.mediaScoreUpdateListener=({kind:t,isScreenshare:e,scoreStats:i})=>{"video"!==t||e||(this.videoProducerScoreStats=i)},this.deviceListUpdateListener=async()=>{const t=await this.meeting.self.getVideoDevices();this.devicesHealth=(null==t?void 0:t.length)>0?"Good":"Poor"},this.videoUpdateListener=()=>{this.meeting.self.videoEnabled||(this.videoProducerScoreStats=null)}}async videoProducerScoreStatsChanged(t){if(!t)return void(this.videoProducerFormattedStats=[]);const e=t,i=[];i.push({name:this.t("debugger.stats.cpu_limitations.label"),value:e.cpuLimitations?"Yes":"No",description:this.t("debugger.stats.cpu_limitations.description"),verdict:e.cpuLimitations?"Poor":"Good"}),i.push({name:this.t("debugger.stats.bandwidth_limitations.label"),value:e.bandwidthLimitations?"Yes":"No",description:this.t("debugger.stats.bandwidth_limitations.description"),verdict:e.bandwidthLimitations?"Poor":"Good"}),i.push({name:this.t("debugger.stats.bitrate.label"),value:`${Math.round(e.bitrate/1024)} kbps`,description:this.t("debugger.stats.bitrate.description"),verdict:Bo({bitrate:e.bitrate})}),i.push({name:this.t("debugger.stats.packet_loss.label"),value:`${e.packetsLostPercentage}%`,description:this.t("debugger.stats.packet_loss.description"),verdict:zo({packetLossPercentage:e.packetsLostPercentage})}),i.push({name:this.t("debugger.stats.jitter.label"),value:`${Math.round(1e3*e.jitter)} ms`,description:this.t("debugger.stats.jitter.description"),verdict:No({jitterInMS:1e3*e.jitter})}),this.videoProducerFormattedStats=i,this.networkBasedMediaHealth=jo({stats:i})}connectedCallback(){this.meetingChanged(this.meeting)}disconnectedCallback(){this.meeting&&(this.meeting.self.off("mediaScoreUpdate",this.mediaScoreUpdateListener),this.meeting.self.off("videoUpdate",this.videoUpdateListener),this.meeting.self.off("deviceListUpdate",this.deviceListUpdateListener))}async meetingChanged(t){t&&(t.self.on("mediaScoreUpdate",this.mediaScoreUpdateListener),t.self.on("videoUpdate",this.videoUpdateListener),t.self.on("deviceListUpdate",this.deviceListUpdateListener),await this.deviceListUpdateListener())}render(){var t,e;if(this.meeting)return N(H,null,N("div",{id:"header"}),N("div",{class:"tab-body"},N("div",{class:"status-container"},N("div",{class:"status-section"},N("div",{class:"section-header "+(this.networkBasedMediaHealth?"":"only-child")},N("span",null,this.t("debugger.video.sections.network_media")),this.networkBasedMediaHealth&&N("span",{class:`status ${null===(t=this.networkBasedMediaHealth)||void 0===t?void 0:t.toLowerCase()}`},this.t(`debugger.quality.${null===(e=this.networkBasedMediaHealth)||void 0===e?void 0:e.toLowerCase()}`))),this.isNetworkOpen&&!this.videoProducerFormattedStats.length&&N("div",{class:"section-body missing-stats"},this.meeting.self.videoEnabled?N("span",null,this.t("debugger.video.messages.generating_report")):N("span",null,this.t("debugger.video.messages.enable_media"))),this.isNetworkOpen&&!!this.videoProducerFormattedStats.length&&N("div",{class:"section-body network-table"},this.videoProducerFormattedStats.map((t=>{var e,i;return N("div",{class:"network-row"},N("div",{class:"network-cell label"},N("strong",null,t.name),N("span",{class:"description"},t.description)),N("div",{class:"network-cell value"},N("span",{class:`status ${null===(e=t.verdict)||void 0===e?void 0:e.toLowerCase()}`},this.t(`debugger.quality.${null===(i=t.verdict)||void 0===i?void 0:i.toLowerCase()}`)),N("span",{class:"value"},t.value)))})))))))}static get watchers(){return{videoProducerScoreStats:["videoProducerScoreStatsChanged"],meeting:["meetingChanged"]}}};Qo([ai()],Jo.prototype,"meeting",void 0),Qo([ai()],Jo.prototype,"states",void 0),Qo([ai()],Jo.prototype,"size",void 0),Qo([ai()],Jo.prototype,"iconPack",void 0),Qo([ai()],Jo.prototype,"t",void 0),Jo.style=":host{line-height:initial;font-family:var(--rtk-font-family, sans-serif);font-feature-settings:normal;font-variation-settings:normal}p{margin:var(--rtk-space-0, 0px);padding:var(--rtk-space-0, 0px)}.scrollbar{scrollbar-width:thin;scrollbar-color:var(--rtk-scrollbar-color, rgb(var(--rtk-colors-background-600, 60 60 60)))\n var(--rtk-scrollbar-background, transparent)}.scrollbar::-webkit-scrollbar{height:var(--rtk-space-1\\.5, 6px);width:var(--rtk-space-1\\.5, 6px);border-radius:9999px;background-color:var(--rtk-scrollbar-background, transparent)}.scrollbar::-webkit-scrollbar-thumb{border-radius:9999px;background-color:var(--rtk-scrollbar-color, rgb(var(--rtk-colors-background-600, 60 60 60)))}:host{position:relative;display:flex;flex-direction:column;overflow:hidden;height:100%;width:100%;color:rgb(var(--rtk-colors-text-1000, 255 255 255));--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-background-600, 60 60 60) / var(--tw-bg-opacity))}.tab-body::-webkit-scrollbar{width:var(--rtk-space-1\\.5, 6px);border-radius:var(--rtk-border-radius-md, 8px);--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-background-1000, 8 8 8) / var(--tw-bg-opacity))}.tab-body::-webkit-scrollbar-thumb{border-radius:var(--rtk-border-radius-md, 8px);--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-background-700, 44 44 44) / var(--tw-bg-opacity))}h3{margin:var(--rtk-space-0, 0px);padding:var(--rtk-space-0, 0px);font-size:16px;font-weight:600}#header{margin-top:var(--rtk-space-2, 8px);margin-bottom:var(--rtk-space-5, 20px);display:flex;align-items:center;justify-content:space-evenly}.tab-body{margin:var(--rtk-space-4, 16px);display:flex;height:100%;flex-direction:column;justify-content:space-between;overflow-y:auto}.status-container{border:var(--rtk-border-width-sm, 1px) solid rgb(var(--rtk-colors-background-600, 60 60 60));border-radius:8px;padding:16px}.status-section{margin-bottom:12px}.section-header{display:flex;justify-content:space-between;align-items:center;font-weight:bold;padding:8px 0}.section-header.only-child{justify-content:center}.section-body.missing-stats{display:flex;text-align:center;justify-content:center}.section-header .status{color:rgba(var(--rtk-colors-success));font-weight:bold}.section-header .arrow{font-size:14px}.network-table{border:var(--rtk-border-width-sm, 1px) solid rgb(var(--rtk-colors-background-600, 60 60 60));border-radius:8px;margin-top:8px;overflow:hidden}.network-row{display:flex;justify-content:space-between;padding:12px;border-bottom:var(--rtk-border-width-sm, 1px) solid rgb(var(--rtk-colors-background-600, 60 60 60))}.network-row:last-child{border-bottom:none}.network-cell{display:flex;flex-direction:column}.network-cell.label strong{font-size:14px}.network-cell.label .description{font-size:12px;color:rgb(var(--rtk-colors-text-700, 255 255 255 / 0.64));margin-top:4px}.network-cell.value{text-align:right}.status.good{color:rgba(var(--rtk-colors-success))}.status.average{color:rgba(var(--rtk-colors-warning))}.status.poor{color:rgba(var(--rtk-colors-danger))}.value{font-size:14px;color:rgb(var(--rtk-colors-text-700, 255 255 255 / 0.64));margin-top:4px}rtk-settings-video{display:flex;flex-direction:column}";var Xo=function(t,e,i,r){var a,s=arguments.length,n=s<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,i,r);else for(var o=t.length-1;o>=0;o--)(a=t[o])&&(n=(s<3?a(n):s>3?a(e,i,n):a(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};const tc=class{constructor(t){o(this,t),this.onClose=Y(this,"rtkDialogClose",7),this.hideCloseButton=!1,this.disableEscapeKey=!1,this.config=De,this.iconPack=je,this.t=Fe(),this.open=!0,this.close=()=>{this.open=!1,this.onClose.emit()},this.keydownListener=t=>{!this.disableEscapeKey&&"Escape"===t.key&&this.open&&this.close()}}connectedCallback(){document.addEventListener("keydown",this.keydownListener)}disconnectedCallback(){document.removeEventListener("keydown",this.keydownListener)}componentDidRender(){this.open&&!this.dialogEl.open&&this.dialogEl.showModal()}render(){return this.open?N(H,null,N("dialog",{ref:t=>this.dialogEl=t,id:"dialog",part:"container",onClose:this.close,onClick:t=>{this.disableEscapeKey||t.target!==this.dialogEl||this.close()},onKeyDown:t=>{this.disableEscapeKey&&"Escape"===t.key&&t.preventDefault()}},N("slot",null),!this.hideCloseButton&&N("rtk-button",{part:"close-button",id:"dismiss-btn",kind:"icon",variant:"ghost",onClick:()=>this.close(),type:"button","aria-label":this.t("dialog.close"),role:"button"},N("rtk-icon",{icon:this.iconPack.dismiss})))):null}};Xo([ai()],tc.prototype,"meeting",void 0),Xo([ai()],tc.prototype,"states",void 0),Xo([ai()],tc.prototype,"size",void 0),Xo([ai()],tc.prototype,"iconPack",void 0),Xo([ai()],tc.prototype,"t",void 0),tc.style=":host{line-height:initial;font-family:var(--rtk-font-family, sans-serif);font-feature-settings:normal;font-variation-settings:normal}p{margin:var(--rtk-space-0, 0px);padding:var(--rtk-space-0, 0px)}:host{word-wrap:break-word;overflow-wrap:break-word}#dialog{position:relative;max-height:100%;max-width:100%;padding:var(--rtk-space-0, 0px);border-width:var(--rtk-border-width-none, 0);border-style:none;background-color:transparent;color:rgb(var(--rtk-colors-text-1000, 255 255 255))}#dialog::backdrop{background-color:rgba(var(--rtk-colors-background-600, 60 60 60) / 0.5);-webkit-backdrop-filter:blur(12px) saturate(180%);backdrop-filter:blur(12px) saturate(180%)}#dismiss-btn{position:absolute;top:var(--rtk-space-3, 12px);right:var(--rtk-space-3, 12px);z-index:50}::slotted(*){max-height:100%;max-width:100%}";var ec=function(t,e,i,r){var a,s=arguments.length,n=s<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,i,r);else for(var o=t.length-1;o>=0;o--)(a=t[o])&&(n=(s<3?a(n):s>3?a(e,i,n):a(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};const ic=class{constructor(t){o(this,t),this.stateUpdate=Y(this,"rtkStateUpdate",7),this.config=De,this.iconPack=je,this.t=Fe(),this.updateStoreState=(t,e)=>{this.stateUpdate.emit({[t]:e})},this.cancelJoinStage=async()=>{var t,e,i;"ACCEPTED_TO_JOIN_STAGE"===(null===(t=this.meeting.stage)||void 0===t?void 0:t.status)&&await(null===(i=null===(e=this.meeting)||void 0===e?void 0:e.stage)||void 0===i?void 0:i.leave()),this.updateStoreState("activeJoinStage",!1)},this.joinStage=async()=>{await this.meeting.stage.join()},this.stageStatusUpdateListener=t=>{var e;(null===(e=this.states)||void 0===e?void 0:e.activeJoinStage)&&"ON_STAGE"===t&&this.updateStoreState("activeJoinStage",!1)}}connectedCallback(){this.meetingChanged(this.meeting)}disconnectedCallback(){var t;null===(t=this.meeting.stage)||void 0===t||t.removeListener("stageStatusUpdate",this.stageStatusUpdateListener)}meetingChanged(t){if(null==t)return;const{stage:e}=t;null==e||e.addListener("stageStatusUpdate",this.stageStatusUpdateListener)}render(){var t,e,i,r;const a={meeting:this.meeting,states:this.states,config:this.config,size:this.size,iconPack:this.iconPack,t:this.t},s=this.states;if(null!=(null==s?void 0:s.image)){const t=s.image,e=()=>{this.stateUpdate.emit({image:null})};return N(H,null,N("rtk-dialog",{open:!0,onRtkDialogClose:e,hideCloseButton:!0,iconPack:this.iconPack,t:this.t},N(rr,{element:"rtk-image-viewer",defaults:a,props:{image:t,onClose:e}})))}if(!0===(null==s?void 0:s.activeSettings))return N(H,null,N("rtk-dialog",{open:!0,onRtkDialogClose:()=>this.updateStoreState("activeSettings",!1),iconPack:this.iconPack,t:this.t},N(rr,{element:"rtk-settings",defaults:a})));if(!0===(null==s?void 0:s.activeDebugger))return N(H,null,N("rtk-dialog",{open:!0,onRtkDialogClose:()=>this.updateStoreState("activeDebugger",!1),iconPack:this.iconPack,t:this.t},N("rtk-debugger",Object.assign({},a))));if(!0===(null==s?void 0:s.activeLeaveConfirmation))return N(H,null,N("rtk-dialog",{open:!0,onRtkDialogClose:()=>this.updateStoreState("activeLeaveConfirmation",!1),iconPack:this.iconPack,t:this.t},N("rtk-leave-meeting",Object.assign({},a))));if(!0===(null===(t=null==s?void 0:s.activePermissionsMessage)||void 0===t?void 0:t.enabled))return N(H,null,N("rtk-dialog",{open:!0,hideCloseButton:!0,iconPack:this.iconPack,t:this.t},N("rtk-permissions-message",Object.assign({},a))));if(!0===(null===(e=null==s?void 0:s.activeBreakoutRoomsManager)||void 0===e?void 0:e.active))return N(H,null,N("rtk-dialog",{open:!0,onRtkDialogClose:()=>this.updateStoreState("activeBreakoutRoomsManager",{active:!1,data:void 0}),iconPack:this.iconPack,t:this.t},N("rtk-breakout-rooms-manager",Object.assign({},a))));if(!0===(null===(i=null==s?void 0:s.activeConfirmationModal)||void 0===i?void 0:i.active))return N(H,null,N("rtk-dialog",{open:!0,onRtkDialogClose:()=>this.updateStoreState("activeConfirmationModal",!1),iconPack:this.iconPack,t:this.t},N("rtk-confirmation-modal",Object.assign({},a))));if(!0===(null===(r=null==s?void 0:s.activeOverlayModal)||void 0===r?void 0:r.active))return N(H,null,N("rtk-overlay-modal",{meeting:this.meeting,states:this.states,iconPack:this.iconPack,t:this.t}));if(null==s?void 0:s.activeBroadcastMessageModal)return N(H,null,N("rtk-dialog",{open:!0,onRtkDialogClose:()=>this.updateStoreState("activeBroadcastMessageModal",!1),iconPack:this.iconPack,t:this.t},N("rtk-broadcast-message-modal",Object.assign({},a))));if(!0===(null==s?void 0:s.activeJoinStage)){const t={title:this.t("stage.join_title"),label:{accept:this.t("stage.join_confirm"),reject:this.t("stage.join_cancel")},description:this.t("stage.join_summary")};return N(H,null,N("rtk-dialog",{open:!0,onRtkDialogClose:this.cancelJoinStage,iconPack:this.iconPack,t:this.t},N("rtk-join-stage",Object.assign({dataConfig:t,onRtkJoinStage:this.joinStage,onRtkLeaveStage:this.cancelJoinStage},a))))}return!0===(null==s?void 0:s.activeMuteAllConfirmation)?N(H,null,N("rtk-dialog",{open:!0,onRtkDialogClose:()=>{this.updateStoreState("activeMuteAllConfirmation",!1)},iconPack:this.iconPack,t:this.t},N("rtk-mute-all-confirmation",Object.assign({},a)))):(null==s?void 0:s.activeChannelCreator)?N(H,null,N("rtk-dialog",{open:!0,onRtkDialogClose:()=>{this.updateStoreState("activeChannelCreator",!1)},iconPack:this.iconPack,t:this.t},N("rtk-channel-creator",Object.assign({},a)))):null}static get watchers(){return{meeting:["meetingChanged"]}}};ec([ai()],ic.prototype,"meeting",void 0),ec([ai()],ic.prototype,"states",void 0),ec([ai()],ic.prototype,"size",void 0),ec([ai()],ic.prototype,"iconPack",void 0),ec([ai()],ic.prototype,"t",void 0),ic.style=":host{line-height:initial;font-family:var(--rtk-font-family, sans-serif);font-feature-settings:normal;font-variation-settings:normal}p{margin:var(--rtk-space-0, 0px);padding:var(--rtk-space-0, 0px)}:host{display:block}";var rc=function(t,e,i,r){var a,s=arguments.length,n=s<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,i,r);else for(var o=t.length-1;o>=0;o--)(a=t[o])&&(n=(s<3?a(n):s>3?a(e,i,n):a(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};const ac=class{constructor(t){o(this,t),this.onDeleteAttachment=Y(this,"deleteAttachment",7),this.iconPack=je,this.t=Fe(),this.attachment=null,this.filePreview=null,this.fileReader=new FileReader,this.generatePreview=()=>{"image"===this.attachment.type?this.fileReader.readAsDataURL(this.attachment.file):"file"===this.attachment.type&&(this.filePreview=this.attachment.file.name)},this.onDeleteClickHandler=()=>{this.filePreview=null,this.onDeleteAttachment.emit()}}onAttachmentChange(){this.generatePreview()}connectedCallback(){this.fileReader.onload=t=>{"string"==typeof t.target.result&&(this.filePreview=t.target.result)}}componentWillLoad(){this.onAttachmentChange()}render(){return N(H,{key:"bf052df6f3c49b6a52b3002a8ed92bae6cbd7b06"},N("div",{key:"786126525fd361e17ec716615da402f11b5f5d1d",class:"preview-overlay"},N("div",{key:"1d89de4184961ebc4c8822aa016394706d37b2ba",class:"preview"},N("rtk-tooltip",{key:"87177c3ff98e59097c02bfcc397c13b68952199c",label:this.t("chat.cancel_upload")},N("rtk-button",{key:"f2a2ce338be78a7572c6a819ee5a75a9521f73b0",variant:"secondary",kind:"icon",onClick:this.onDeleteClickHandler},N("rtk-icon",{key:"12b0d383efb984307eba05ccdb783a8bd9c2d636",icon:this.iconPack.dismiss}))),"image"===this.attachment.type?N("img",{class:"preview-image",src:this.filePreview}):N("div",{class:"preview-file"},N("span",null,this.filePreview)))))}static get watchers(){return{attachment:["onAttachmentChange"]}}};rc([ai()],ac.prototype,"iconPack",void 0),rc([ai()],ac.prototype,"t",void 0),ac.style=":host{display:flex;--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-background-800, 30 30 30) / var(--tw-bg-opacity));border-top-left-radius:var(--rtk-border-radius-md, 8px);border-top-right-radius:var(--rtk-border-radius-md, 8px)}.preview-overlay{position:absolute;top:var(--rtk-space-0, 0px);right:var(--rtk-space-0, 0px);bottom:var(--rtk-space-0, 0px);left:var(--rtk-space-0, 0px);background-color:inherit}.preview{position:absolute;top:var(--rtk-space-4, 16px);left:var(--rtk-space-4, 16px);max-width:-moz-fit-content;max-width:fit-content;max-height:var(--rtk-space-20, 80px)}.preview:hover rtk-tooltip{display:block}.preview rtk-tooltip{position:absolute;top:calc(var(--rtk-space-1, 4px) * -1);left:calc(var(--rtk-space-1, 4px) * -1);display:none;margin-left:calc(var(--rtk-space-1, 4px) * -1);margin-top:calc(var(--rtk-space-1, 4px) * -1)}.preview rtk-button{display:flex;height:var(--rtk-space-4, 16px);width:var(--rtk-space-4, 16px);align-items:center;justify-content:center;border-radius:9999px;--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-background-600, 60 60 60) / var(--tw-bg-opacity));border:1px solid rgb(var(--rtk-colors-text-1000, 255 255 255))}.preview rtk-icon{height:var(--rtk-space-3, 12px);width:var(--rtk-space-3, 12px);color:rgb(var(--rtk-colors-text-1000, 255 255 255))}.preview-image{height:var(--rtk-space-16, 64px);width:var(--rtk-space-16, 64px);-o-object-fit:cover;object-fit:cover;max-height:100%;max-width:100%;overflow:clip;border-radius:var(--rtk-border-radius-md, 8px)}.preview-file{padding-left:var(--rtk-space-3, 12px);padding-right:var(--rtk-space-3, 12px);padding-top:var(--rtk-space-2, 8px);padding-bottom:var(--rtk-space-2, 8px);--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-background-600, 60 60 60) / var(--tw-bg-opacity));color:rgb(var(--rtk-colors-text-900, 255 255 255 / 0.88));overflow:hidden;text-overflow:ellipsis;white-space:nowrap;border-radius:var(--rtk-border-radius-md, 8px);max-width:200px}";let sc;var nc=function(t,e,i,r){var a,s=arguments.length,n=s<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,i,r);else for(var o=t.length-1;o>=0;o--)(a=t[o])&&(n=(s<3?a(n):s>3?a(e,i,n):a(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};const oc=class{constructor(t){o(this,t),this.pickerClose=Y(this,"pickerClose",7),this.emojiClicked=Y(this,"rtkEmojiClicked",7),this.iconPack=je,this.t=Fe(),this.focusWhenOpened=!0,this.filterVal="",this.filteredEmojis=[]}componentWillLoad(){(async()=>{if(!sc){const t=await fetch("https://cdn.dyte.in/assets/emojis-data.json");sc=t.json()}return sc})().then((t=>{this.emojiList=t,this.handleInputChange(this.inputElement)}))}componentDidLoad(){this.focusWhenOpened&&this.inputElement.focus()}handleInputChange(t){this.filterVal=t.value;const e=new RegExp(`([^,]*?${this.filterVal}[^,]*):(\\d+)`,"g");this.filteredEmojis=Array.from(this.emojiList.search.matchAll(e)).map((t=>({name:t[1],emoji:this.emojiList.emojis[t[2]]})))}handleEmojiClick(t){this.emojiClicked.emit(t)}mapEmojiList(){var t;return(null===(t=this.emojiList)||void 0===t?void 0:t.length)>0?N("div",{id:"loader"},N("rtk-spinner",{iconPack:this.iconPack})):N("div",{id:"emoji-grid",class:"scrollbar max-w-40"},this.filteredEmojis.map((t=>N("rtk-button",{key:`emoji-button-${t.name}`,class:"emoji",variant:"ghost",kind:"icon",title:t.name,onClick:()=>this.handleEmojiClick(t.emoji)},t.emoji))))}render(){return N(H,{key:"989c0508bb88941926f29091895707e7b4a3e139"},N("div",{key:"83a90c6b73ca11fb6e864a59362d15bf83391d20",class:"close-parent"},N("rtk-button",{key:"446a4c1a343eb11032b9ea2bf5b4cd5bef6f7f1b",variant:"ghost",kind:"icon",class:"close",onClick:()=>{var t;return null===(t=this.pickerClose)||void 0===t?void 0:t.emit()},"aria-label":this.t("close")},N("rtk-icon",{key:"cacfe97be0590e840d332fc9197bb473fef22d9f",icon:this.iconPack.dismiss}))),N("div",{key:"461a263d19a60547aff16689d3c6f4f31aea8a3a",class:"emoji-parent"},N("input",{key:"c9a111769b48d5ff12ac48d8c172a8d3f371df2c",value:this.filterVal,onInput:t=>this.handleInputChange(t.target),placeholder:this.t("search"),ref:t=>this.inputElement=t}),this.mapEmojiList()))}};nc([ai()],oc.prototype,"iconPack",void 0),nc([ai()],oc.prototype,"t",void 0),oc.style=":host{line-height:initial;font-family:var(--rtk-font-family, sans-serif);font-feature-settings:normal;font-variation-settings:normal}p{margin:var(--rtk-space-0, 0px);padding:var(--rtk-space-0, 0px)}.scrollbar{scrollbar-width:thin;scrollbar-color:var(--rtk-scrollbar-color, rgb(var(--rtk-colors-background-600, 60 60 60)))\n var(--rtk-scrollbar-background, transparent)}.scrollbar::-webkit-scrollbar{height:var(--rtk-space-1\\.5, 6px);width:var(--rtk-space-1\\.5, 6px);border-radius:9999px;background-color:var(--rtk-scrollbar-background, transparent)}.scrollbar::-webkit-scrollbar-thumb{border-radius:9999px;background-color:var(--rtk-scrollbar-color, rgb(var(--rtk-colors-background-600, 60 60 60)))}:host{width:100%}.emoji-parent{box-sizing:border-box;display:inline-flex;height:var(--rtk-space-64, 256px);width:100%;max-width:640px;flex-direction:column;padding:var(--rtk-space-2, 8px);padding-bottom:var(--rtk-space-0, 0px);-webkit-user-select:none;-moz-user-select:none;user-select:none;transition-property:color, background-color, border-color, text-decoration-color, fill, stroke;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:150ms;--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-background-800, 30 30 30) / var(--tw-bg-opacity));color:rgb(var(--rtk-colors-text-1000, 255 255 255))}.close-parent{display:flex;flex:1 1 0%;justify-content:flex-end;padding:var(--rtk-space-0, 0px);--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-background-800, 30 30 30) / var(--tw-bg-opacity));color:rgb(var(--rtk-colors-text-1000, 255 255 255))}#emoji-grid{margin-top:var(--rtk-space-2, 8px);box-sizing:border-box;display:flex;flex-direction:row;flex-wrap:wrap;align-content:flex-start;overflow-x:hidden;overflow-y:scroll;height:100%;grid-auto-rows:minmax(min-content, max-content)}#loader{display:flex;height:100%;width:100%;align-items:center;justify-content:center}input{display:block;height:var(--rtk-space-8, 32px);padding-left:var(--rtk-space-2, 8px);padding-right:var(--rtk-space-2, 8px);font-size:14px;border-width:var(--rtk-border-width-none, 0);border-style:solid;border-style:none;border-color:rgb(var(--rtk-colors-text-700, 255 255 255 / 0.64));--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-background-800, 30 30 30) / var(--tw-bg-opacity));color:rgb(var(--rtk-colors-text-900, 255 255 255 / 0.88))}input::-moz-placeholder{color:rgb(var(--rtk-colors-text-700, 255 255 255 / 0.64))}input::placeholder{color:rgb(var(--rtk-colors-text-700, 255 255 255 / 0.64))}input{border-radius:var(--rtk-border-radius-sm, 4px);outline:2px solid transparent;outline-offset:2px;transition-property:color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, -webkit-backdrop-filter;transition-property:color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter;transition-property:color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter, -webkit-backdrop-filter;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:150ms;border:var(--rtk-border-width-sm, 1px) solid rgb(var(--rtk-colors-background-600, 60 60 60))}input:focus{--tw-border-opacity:1;border-color:rgba(var(--rtk-colors-brand-300, 73 124 253) / var(--tw-border-opacity));--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(4px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 #0000);--tw-ring-color:rgba(var(--rtk-colors-brand-300, 73 124 253) / var(--tw-ring-opacity));--tw-ring-opacity:0.3}.emoji{height:var(--rtk-space-10, 40px);width:var(--rtk-space-10, 40px);font-size:20px;color:rgb(var(--rtk-colors-text-1000, 255 255 255))}";var cc=function(t,e,i,r){var a,s=arguments.length,n=s<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,i,r);else for(var o=t.length-1;o>=0;o--)(a=t[o])&&(n=(s<3?a(n):s>3?a(e,i,n):a(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};const lc=class{constructor(t){o(this,t),this.iconPack=je,this.t=Fe()}render(){return N("rtk-tooltip",{key:"5edf35e2100be583f2be4feadaa3b3149f9c8962",label:this.t("chat.send_emoji")},N("rtk-button",{key:"00bfc269a700ab10955a627095aac31b64d8a28e",variant:"ghost",kind:"icon",class:{active:this.isActive},title:this.t("chat.send_emoji")},N("rtk-icon",{key:"47bd54c1593f7f5ea04eb96ccbca07ea3c22e511",icon:this.iconPack.emoji_multiple})))}};cc([ai()],lc.prototype,"iconPack",void 0),cc([ai()],lc.prototype,"t",void 0),lc.style=":host{}";var dc=function(t,e,i,r){var a,s=arguments.length,n=s<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,i,r);else for(var o=t.length-1;o>=0;o--)(a=t[o])&&(n=(s<3?a(n):s>3?a(e,i,n):a(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};const hc=class{constructor(t){o(this,t),this.now=new Date,this.isContinued=!1,this.iconPack=je,this.t=Fe(),this.showBubble=!1}render(){const t=Xe(this.message.link);return N(H,{key:"25ff2cd29b951ffee9fb266ec4937258db527ef4"},!this.isContinued&&N(Ji,{key:"50dc45f56ac2837215619c597f557c0e71e5fd85",name:this.message.displayName,time:this.message.time,now:this.now}),N("div",{key:"5b300ea679f835b6d7421568dde80aa38cbbc821",class:{body:!0,bubble:this.showBubble},part:"body"},N("div",{key:"895f033df99c8d9dfc1241bbaf5f20137b905395",class:"file"},N("div",{key:"345bd0370a81c50c1ef46fa7119fa321213ad741",class:"file-data"},N("div",{key:"fb30c6c130af584d2f4294029c4304e213ddd339",class:"name"},this.message.name),N("div",{key:"d0de234e1697b196fe248bbfbad18109b59c20df",class:"file-data-split"},N("div",{key:"635343bd7dbcbfeea1a7534c943be355decf20c4",class:"ext"},ar(this.message.name)),N("span",{key:"bd7772e273ae55297c99d8564cfa44e6dd1b43d0",class:"divider"}),N("div",{key:"d6df3a4fca8932d3bcdeb805ef7b3bed1c3e8c15",class:"size"},sr(this.message.size)))),N("rtk-button",{key:"4b4d9be6f228e5deda5590f2aa6038b3501623d7",variant:"secondary",kind:"icon",onClick:()=>nr(t,{name:this.message.name,fallbackName:"file"}),part:"button"},N("rtk-icon",{key:"187e0b8f903bd7cd8b5f9e25ef2d6841299fe87f",icon:this.iconPack.download})))))}};dc([ai()],hc.prototype,"iconPack",void 0),dc([ai()],hc.prototype,"t",void 0);const pc=class{constructor(t){o(this,t),this.iconPack=je}render(){return N("div",{key:"7bc636599452b840ae0a5467fcf579a883a98727",class:"file"},N("rtk-button",{key:"98bfff6ca8aa598d296ff1f3b39994f8b839572c",variant:"secondary",kind:"icon",onClick:()=>nr(Xe(this.url),{name:this.name,fallbackName:"file"}),part:"button"},N("rtk-icon",{key:"26b9fe1b7e884ffa993e988eb94e18351eec8c25",icon:this.iconPack.download})),N("div",{key:"c3d045925ef1a13039c44624930b96cd326d769f",class:"file-data"},N("div",{key:"619e9cd8f72f342e31c334586e44813e2d3216ba",class:"name"},this.name),N("div",{key:"71b788c2a10c8a7290da1f77d82c6b6e66746223",class:"file-data-split"},N("div",{key:"550720228247cdaf766a84938df720bf95249bf5",class:"ext"},ar(this.name)),N("span",{key:"2bb1940a95e5e06ec8a064a775ea2257ff80fcc7",class:"divider"}),N("div",{key:"e5451bcd50b3e05d90b149a98b7c328711025827",class:"size"},sr(this.size)))))}};!function(t,e,i,r){var a,s=arguments.length,n=s<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,i,r);else for(var o=t.length-1;o>=0;o--)(a=t[o])&&(n=(s<3?a(n):s>3?a(e,i,n):a(e,i))||n);s>3&&n&&Object.defineProperty(e,i,n)}([ai()],pc.prototype,"iconPack",void 0),pc.style=":host{line-height:initial;font-family:var(--rtk-font-family, sans-serif);font-feature-settings:normal;font-variation-settings:normal}p{margin:var(--rtk-space-0, 0px);padding:var(--rtk-space-0, 0px)}.file{display:flex;align-items:center;gap:var(--rtk-space-1, 4px);padding-left:var(--rtk-space-2, 8px);padding-right:var(--rtk-space-2, 8px);padding-top:var(--rtk-space-1, 4px);padding-bottom:var(--rtk-space-1, 4px);min-width:var(--rtk-space-40, 160px);max-width:var(--rtk-space-64, 256px);border-radius:var(--rtk-border-radius-sm, 4px);--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-background-700, 44 44 44) / var(--tw-bg-opacity));color:rgb(var(--rtk-colors-text-700, 255 255 255 / 0.64))}.file .file-data{margin-left:var(--rtk-space-1, 4px);flex:1 1 0%}.file .file-data .name{word-break:break-all;color:rgb(var(--rtk-colors-text-1000, 255 255 255));overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:1}.file .file-data .file-data-split{margin-top:var(--rtk-space-0\\.5, 2px);display:flex;align-items:center;font-size:12px}.file .file-data .file-data-split .ext{margin-right:var(--rtk-space-2, 8px);text-transform:uppercase;overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:1}.file .file-data .file-data-split .divider{height:var(--rtk-space-4, 16px);width:var(--rtk-space-0\\.5, 2px);--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-background-600, 60 60 60) / var(--tw-bg-opacity))}.file .file-data .file-data-split .size{margin-left:var(--rtk-space-2, 8px)}";var gc=function(t,e,i,r){var a,s=arguments.length,n=s<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,i,r);else for(var o=t.length-1;o>=0;o--)(a=t[o])&&(n=(s<3?a(n):s>3?a(e,i,n):a(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};const uc=class{constructor(t){o(this,t),this.onFileChange=Y(this,"fileChange",7),this.icon="attach",this.iconPack=je,this.t=Fe(),this.uploadFile=()=>{const t=this.fileInputField;t.type="file",this.filter&&(t.accept=this.filter),t.onchange=t=>{const{validity:e,files:[i]}=t.target;e.valid&&this.onFileChange.emit(i)},t.click()}}connectedCallback(){this.fileInputField=document.createElement("input")}disconnectedCallback(){this.fileInputField=void 0}render(){const t=this.label||this.t("chat.send_file"),e=this.iconPack[this.icon];return N("rtk-tooltip",{key:"ea570679bd495c1230a563d08496211e57645797",label:t},N("rtk-button",{key:"894429d9abc652daf0d897fe3757b3a81dc06da2",variant:"ghost",kind:"icon",onClick:()=>this.uploadFile(),title:t},N("rtk-icon",{key:"12f9e9a114accb42178da6663f85cac8a3cf70e2",icon:e})))}};gc([ai()],uc.prototype,"iconPack",void 0),gc([ai()],uc.prototype,"t",void 0),uc.style=":host{}";const fc=t=>{try{return JSON.parse(t)}catch(e){return t}},mc=class{constructor(t){o(this,t),this.variant="primary",this.size="lg"}render(){return N(H,{key:"cc3de7d3c31d52bdc3c38891920f0f8b08c6fd2f"},N("div",{key:"e5a1487a5eb1e37272190a61300db415f12e8189",class:"icon-wrapper",innerHTML:fc(this.icon),part:"wrapper"}))}};!function(t,e,i,r){var a,s=arguments.length,n=s<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,i,r);else for(var o=t.length-1;o>=0;o--)(a=t[o])&&(n=(s<3?a(n):s>3?a(e,i,n):a(e,i))||n);s>3&&n&&Object.defineProperty(e,i,n)}([ai()],mc.prototype,"size",void 0),mc.style=":host{line-height:initial;font-family:var(--rtk-font-family, sans-serif);font-feature-settings:normal;font-variation-settings:normal}p{margin:var(--rtk-space-0, 0px);padding:var(--rtk-space-0, 0px)}:host{display:block;height:var(--rtk-space-10, 40px);outline:2px solid transparent;outline-offset:2px}:host .icon-wrapper{display:flex;height:100%;width:100%;flex-direction:column;align-items:center}:host svg{height:100%;width:100%;outline:2px solid transparent;outline-offset:2px}:host([size='xl']){box-sizing:border-box;display:block;height:var(--rtk-space-16, 64px) !important;width:var(--rtk-space-16, 64px) !important;--rtk-spinner-color:currentColor}:host([size='md']){box-sizing:border-box;display:block;height:var(--rtk-space-6, 24px) !important;width:var(--rtk-space-6, 24px) !important;--rtk-spinner-color:currentColor}:host([size='sm']){box-sizing:border-box;display:block;height:var(--rtk-space-4, 16px) !important;width:var(--rtk-space-4, 16px) !important;--rtk-spinner-color:currentColor}:host([variant='secondary']) .icon-wrapper{--tw-text-opacity:1;color:rgba(var(--rtk-colors-background-600, 60 60 60) / var(--tw-text-opacity))}:host([variant='danger']) .icon-wrapper{--tw-text-opacity:1;color:rgba(var(--rtk-colors-danger, 255 45 45) / var(--tw-text-opacity))}";var vc=function(t,e,i,r){var a,s=arguments.length,n=s<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,i,r);else for(var o=t.length-1;o>=0;o--)(a=t[o])&&(n=(s<3?a(n):s>3?a(e,i,n):a(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};const bc=class{constructor(t){o(this,t),this.stateUpdate=Y(this,"rtkStateUpdate",7),this.now=new Date,this.isContinued=!1,this.iconPack=je,this.t=Fe(),this.showBubble=!1,this.status="loading"}render(){return N(H,{key:"60b7d1f3569a3bd335b7db047ef5f5a7b8fa518c"},!this.isContinued&&N(Ji,{key:"e897d7239be3ba0a2594f5c6285cc5a5fd553375",name:this.message.displayName,time:this.message.time,now:this.now}),N("div",{key:"f99332c642a51af6d4ab20eff1654826479b420b",class:{body:!0,bubble:this.showBubble},part:"body"},N("div",{key:"667e081aff8edd5792cc2b0fac09d83d6520d6a7",class:{image:!0,loaded:"loaded"===this.status}},N("img",{key:"f079a0f75038bdf6a83e450bfdb68ab84d6f1663",src:Xe(this.message.link),onLoad:()=>{this.status="loaded"},onError:()=>{this.status="errored"},onClick:()=>{"loaded"===this.status&&this.stateUpdate.emit({image:this.message})}}),"loading"===this.status&&N("div",{key:"00968152adade14971180db8df90553a17aaaaa8",class:"image-spinner",title:this.t("chat.img.loading"),"aria-label":this.t("chat.img.loading")},N("rtk-spinner",{key:"0e236fd24f70e5dfbd5528d1198c9ecf7f2f4888",iconPack:this.iconPack})),"errored"===this.status&&N("div",{key:"8cd94804cb58c23c9c4636e7d8e14e3121b3e169",class:"image-errored",title:this.t("chat.error.img_not_found"),"aria-label":this.t("chat.error.img_not_found")},N("rtk-icon",{key:"625d50f65dfbd6af0f2061d96b5332452b060a12",icon:this.iconPack.image_off})),"loaded"===this.status&&N("div",{key:"4a5105c9deef32a5526d5adf8f6075230a09a90f",class:"actions"},N("rtk-button",{key:"f8519c23a87d30909451ceaf9c874b6b5258f4cb",class:"action",variant:"secondary",kind:"icon",onClick:()=>{this.stateUpdate.emit({image:this.message})}},N("rtk-icon",{key:"3b8e52922b59e9f75f8a25bc9605f4d044b7981c",icon:this.iconPack.full_screen_maximize})),N("rtk-button",{key:"dc2703a02f091383498eaddfdcdf148e93471a88",class:"action",variant:"secondary",kind:"icon",onClick:()=>nr(this.message.link,{fallbackName:"image"})},N("rtk-icon",{key:"1d9c9406e7937c64c93d77d685e86c3d1def4ec1",icon:this.iconPack.download}))))))}};vc([ai()],bc.prototype,"iconPack",void 0),vc([ai()],bc.prototype,"t",void 0),bc.style=":host{line-height:initial;font-family:var(--rtk-font-family, sans-serif);font-feature-settings:normal;font-variation-settings:normal}p{margin:var(--rtk-space-0, 0px);padding:var(--rtk-space-0, 0px)}.image-spinner{cursor:wait}.image-errored{cursor:not-allowed}";var kc=function(t,e,i,r){var a,s=arguments.length,n=s<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,i,r);else for(var o=t.length-1;o>=0;o--)(a=t[o])&&(n=(s<3?a(n):s>3?a(e,i,n):a(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};const yc=class{constructor(t){o(this,t),this.onPreview=Y(this,"preview",7),this.iconPack=je,this.t=Fe(),this.status="loading"}render(){return N("div",{key:"9d7c32348bb52dc60533d9d99cfbd4099d89fad0",class:{image:!0,loaded:"loaded"===this.status}},N("img",{key:"1c66e60f69842cc1c372545759201ae8e70cbfe8",src:Xe(this.url),onLoad:()=>{this.status="loaded"},onError:()=>{this.status="errored"},onClick:()=>{"loaded"===this.status&&this.onPreview.emit(this.url)}}),"loading"===this.status&&N("div",{key:"ee5cce91357ec2974c691ea95faacc78db9fa796",class:"image-spinner",title:this.t("chat.img.loading"),"aria-label":this.t("chat.img.loading")},N("rtk-spinner",{key:"3c9236319042a7b9c5ff45dd196b4e14c38a7b0a",iconPack:this.iconPack})),"errored"===this.status&&N("div",{key:"a176782a3ea63795ed154d8bf4cc3342cb20cd32",class:"image-errored",title:this.t("chat.error.img_not_found"),"aria-label":this.t("chat.error.img_not_found")},N("rtk-icon",{key:"4d4275e21b280a3b981634a8da7b2d752a620be1",icon:this.iconPack.image_off})),"loaded"===this.status&&N("div",{key:"ca5468642912ad5407e3b828083b6e3f232b42e5",class:"actions"},N("rtk-button",{key:"3b8a485a435023cb9819d98541cd9b1f40a96911",class:"action",variant:"secondary",kind:"icon",onClick:()=>{this.onPreview.emit(this.url)}},N("rtk-icon",{key:"31e7ff096ca3e1db148f2808ad79aa79f56fa91e",icon:this.iconPack.full_screen_maximize})),N("rtk-button",{key:"a1de648d80f8ac6d4d2197f0148e9708123434f3",class:"action",variant:"secondary",kind:"icon",onClick:()=>nr(this.url,{fallbackName:"image"})},N("rtk-icon",{key:"4a06af4520a81fce102397907b66202a18f0c191",icon:this.iconPack.download}))))}};kc([ai()],yc.prototype,"iconPack",void 0),kc([ai()],yc.prototype,"t",void 0),yc.style=":host{line-height:initial;font-family:var(--rtk-font-family, sans-serif);font-feature-settings:normal;font-variation-settings:normal}p{margin:var(--rtk-space-0, 0px);padding:var(--rtk-space-0, 0px)}.image-spinner{cursor:wait}.image-errored{cursor:not-allowed}.image{display:block;font-family:var(--rtk-font-family, sans-serif);color:rgb(var(--rtk-colors-text-900, 255 255 255 / 0.88));position:relative;height:var(--rtk-space-40, 160px);max-width:var(--rtk-space-64, 256px);cursor:pointer}.image img{display:none;height:100%;width:100%;border-radius:var(--rtk-border-radius-sm, 4px);-o-object-fit:cover;object-fit:cover}.image .image-spinner{display:flex;height:100%;width:100%;flex-direction:column;align-items:center;justify-content:center;border-radius:var(--rtk-border-radius-sm, 4px);--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-background-800, 30 30 30) / var(--tw-bg-opacity))}.image .image-spinner rtk-spinner{--tw-text-opacity:1;color:rgba(var(--rtk-colors-brand-500, 33 96 253) / var(--tw-text-opacity))}.image .image-errored{display:flex;height:100%;width:100%;flex-direction:column;align-items:center;justify-content:center;border-radius:var(--rtk-border-radius-sm, 4px);background-color:rgba(var(--rtk-colors-danger, 255 45 45) / 0.1);--tw-text-opacity:1;color:rgba(var(--rtk-colors-danger, 255 45 45) / var(--tw-text-opacity))}.image .actions{display:none;height:var(--rtk-space-8, 32px);align-items:center;position:absolute;top:var(--rtk-space-2, 8px);right:var(--rtk-space-2, 8px);border-radius:var(--rtk-border-radius-sm, 4px);--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-background-900, 26 26 26) / var(--tw-bg-opacity));color:rgb(var(--rtk-colors-text-1000, 255 255 255));overflow:hidden;--tw-shadow:0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);--tw-shadow-colored:0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)}.image .actions .action{height:var(--rtk-space-8, 32px);width:var(--rtk-space-8, 32px);border-radius:var(--rtk-border-radius-none, 0);border-width:var(--rtk-border-width-none, 0);border-style:none;background-color:transparent;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)}.image .actions .action:hover{--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-background-600, 60 60 60) / var(--tw-bg-opacity))}.image.loaded img{display:block}.image.loaded .image-spinner{display:none}.image:hover .actions,.image:focus .actions{display:flex}";var wc=function(t,e,i,r){var a,s=arguments.length,n=s<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,i,r);else for(var o=t.length-1;o>=0;o--)(a=t[o])&&(n=(s<3?a(n):s>3?a(e,i,n):a(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};const xc=class{constructor(t){o(this,t),this.stateUpdate=Y(this,"rtkStateUpdate",7),this.joinStage=Y(this,"rtkJoinStage",7),this.leaveStage=Y(this,"rtkLeaveStage",7),this.config=De,this.iconPack=je,this.t=Fe(),this.dataConfig={title:this.t("stage.join_title"),label:{accept:this.t("stage.join_confirm"),reject:this.t("stage.join_cancel")},description:this.t("stage.join_summary")},this.isLoading=!1}render(){var t,e;const i={meeting:this.meeting,size:this.size,states:this.states,config:this.config,iconPack:this.iconPack,t:this.t};return N(H,{key:"5adc039e20d21d089d3b34bb67d046387c46db06",class:{stage:!0}},N("header",{key:"43d3a4d1f004ae347fa8297b808ee9318b6a6a91"},N("h2",{key:"bdd9070ea15b136717ae060f86b46a32adbfcc99"},this.dataConfig.title)),N(rr,{key:"7def3aec36f8616d88f41be6e503b033c98623ad",element:"rtk-participant-setup",defaults:i,props:{participant:null===(t=this.meeting)||void 0===t?void 0:t.self,size:"md"},childProps:{participant:null===(e=this.meeting)||void 0===e?void 0:e.self,size:"md"},deepProps:!0}),N("div",{key:"b464fd360e42c6201f6e2cbed7107c4410648a7e",class:"summary"},this.dataConfig.description),N("div",{key:"760a61c9d4b8284408a56818bd0d715d05bee9e6",class:"container"},N("rtk-button",{key:"4b23c3a442fed701f66f600a1bbd1633c4036ae2",variant:"secondary",onClick:()=>this.leaveStage.emit(),title:this.dataConfig.label.reject},this.dataConfig.label.reject),N("rtk-button",{key:"8f7745aba52c737a57c2158ae23eb17f32d7b56e",onClick:()=>{this.isLoading||(this.isLoading=!0,this.joinStage.emit())},title:this.dataConfig.label.accept},this.isLoading?N("rtk-icon",{icon:this.iconPack.spinner}):this.dataConfig.label.accept)))}};wc([ai()],xc.prototype,"meeting",void 0),wc([ai()],xc.prototype,"states",void 0),wc([ai()],xc.prototype,"size",void 0),wc([ai()],xc.prototype,"iconPack",void 0),wc([ai()],xc.prototype,"t",void 0),xc.style=":host{line-height:initial;font-family:var(--rtk-font-family, sans-serif);font-feature-settings:normal;font-variation-settings:normal}p{margin:var(--rtk-space-0, 0px);padding:var(--rtk-space-0, 0px)}.scrollbar{scrollbar-width:thin;scrollbar-color:var(--rtk-scrollbar-color, rgb(var(--rtk-colors-background-600, 60 60 60)))\n var(--rtk-scrollbar-background, transparent)}.scrollbar::-webkit-scrollbar{height:var(--rtk-space-1\\.5, 6px);width:var(--rtk-space-1\\.5, 6px);border-radius:9999px;background-color:var(--rtk-scrollbar-background, transparent)}.scrollbar::-webkit-scrollbar-thumb{border-radius:9999px;background-color:var(--rtk-scrollbar-color, rgb(var(--rtk-colors-background-600, 60 60 60)))}:host::-webkit-scrollbar{width:var(--rtk-space-1\\.5, 6px);border-radius:var(--rtk-border-radius-md, 8px);--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-background-1000, 8 8 8) / var(--tw-bg-opacity))}:host::-webkit-scrollbar-thumb{border-radius:var(--rtk-border-radius-md, 8px);--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-background-700, 44 44 44) / var(--tw-bg-opacity))}:host(.stage){box-sizing:border-box;display:block;width:512px;--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-background-800, 30 30 30) / var(--tw-bg-opacity));padding:var(--rtk-space-6, 24px);-webkit-user-select:none;-moz-user-select:none;user-select:none;overflow:auto;border-radius:var(--rtk-border-radius-md, 8px);line-height:1.25}:host(.stage) rtk-participant-setup{display:flex;flex:1 1 0%;align-items:center;justify-content:space-around;margin-left:auto;margin-right:auto}:host(.stage) .container rtk-button{flex-grow:1;padding:var(--rtk-space-1, 4px);width:50%}:host(.stage) .container rtk-button:nth-child(1){margin-right:var(--rtk-space-1\\.5, 6px)}:host(.stage) .container rtk-button:nth-child(2){margin-left:var(--rtk-space-1\\.5, 6px)}:host(.stage) h2{font-size:24px;font-weight:500;color:rgb(var(--rtk-colors-text-1000, 255 255 255))}:host(.stage) header{padding-left:var(--rtk-space-4, 16px);padding-right:var(--rtk-space-4, 16px)}:host(.stage) .summary{padding:var(--rtk-space-4, 16px)}.deny-access{--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-background-700, 44 44 44) / var(--tw-bg-opacity))}.container{width:100%;max-width:1080px;display:flex;flex:1 1 0%;align-items:center;justify-content:space-around}header{display:flex;align-items:center;justify-content:space-between}";var Sc=function(t,e,i,r){var a,s=arguments.length,n=s<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,i,r);else for(var o=t.length-1;o>=0;o--)(a=t[o])&&(n=(s<3?a(n):s>3?a(e,i,n):a(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};const Pc=class{constructor(t){o(this,t),this.stateUpdate=Y(this,"rtkStateUpdate",7),this.keyPressListener=t=>{"Escape"===t.key&&this.close()},this.iconPack=je,this.t=Fe(),this.canEndMeeting=!1,this.isBreakoutRoomsActive=!1,this.isChildMeeting=!1,this.canJoinMainRoom=!1,this.permissionsUpdateListener=()=>{this.canEndMeeting=this.meeting.self.permissions.kickParticipant,this.canJoinMainRoom=this.meeting.self.permissions.connectedMeetings.canSwitchToParentMeeting},this.close=()=>{this.stateUpdate.emit({activeLeaveConfirmation:!1})},this.handleLeave=()=>{var t;null===(t=this.meeting)||void 0===t||t.leaveRoom(),this.close()},this.handleJoinMainRoom=()=>{this.meeting.connectedMeetings.moveParticipants(this.meeting.meta.meetingId,this.meeting.connectedMeetings.parentMeeting.id,[this.meeting.self.userId]),this.close()},this.handleEndMeeting=()=>{var t;null===(t=this.meeting)||void 0===t||t.participants.kickAll(),this.close()}}connectedCallback(){this.meetingChanged(this.meeting),document.addEventListener("keydown",this.keyPressListener)}disconnectedCallback(){var t;document.removeEventListener("keydown",this.keyPressListener),null===(t=this.meeting)||void 0===t||t.self.permissions.removeListener("permissionsUpdate",this.permissionsUpdateListener)}meetingChanged(t){null!=t&&(this.isBreakoutRoomsActive=this.meeting.connectedMeetings.supportsConnectedMeetings&&this.meeting.connectedMeetings.isActive,this.isChildMeeting=this.meeting.connectedMeetings.supportsConnectedMeetings&&this.meeting.connectedMeetings.meetings.some((e=>e.id===t.meta.meetingId)),this.meeting.self.permissions.addListener("permissionsUpdate",this.permissionsUpdateListener),this.permissionsUpdateListener())}render(){return N(H,{key:"d6e7a2eba47854f5f3da4008137081383769d159"},N("div",{key:"afffb6ce1dd2b38dd3cf2731723dbd0c8e68e046",class:"leave-modal"},N("div",{key:"f60a1660e94307fdf36e5e52a513648adc741aa5",class:"header"},N("h2",{key:"5e80bd3031ed95929d6560e79e5edfcca607b169",class:"title"},this.t("leave"))),N("p",{key:"adfd75ca8e0408f90687f39de5de3b237378deb0",class:"message"},this.isBreakoutRoomsActive&&this.isChildMeeting?this.t("breakout_rooms.leave_confirmation"):this.t("leave_confirmation")),N("div",{key:"395b4f29350512c4c9d512984482bb934aadf983",class:"content"},N("rtk-button",{key:"85adbf49f8ae02e05e16a349c99152b525ff6520",variant:"secondary",onClick:this.close,class:"secondary-btn"},this.t("cancel")),this.isBreakoutRoomsActive&&this.isChildMeeting&&this.canJoinMainRoom&&N("rtk-button",{key:"6a965a9e4cad6f07624c7ac5255207b7b021b47c",variant:"secondary",onClick:this.handleJoinMainRoom,class:"secondary-btn"},this.t("breakout_rooms.leave_confirmation.main_room_btn")),N("rtk-button",{key:"41050c3895eeab4edc56742799505790d881cad9",variant:"danger",title:this.t("leave"),onClick:this.handleLeave},this.t("leave")),this.canEndMeeting&&N("rtk-button",{key:"15fafd5ba16a9b545ba170ca1c0b113294d65ce9",variant:"danger",class:"secondary-btn secondary-danger-btn",onClick:this.handleEndMeeting},this.t("end.all")))))}static get watchers(){return{meeting:["meetingChanged"]}}};Sc([ai()],Pc.prototype,"meeting",void 0),Sc([ai()],Pc.prototype,"states",void 0),Sc([ai()],Pc.prototype,"iconPack",void 0),Sc([ai()],Pc.prototype,"t",void 0),Pc.style=":host{line-height:initial;font-family:var(--rtk-font-family, sans-serif);font-feature-settings:normal;font-variation-settings:normal}p{margin:var(--rtk-space-0, 0px);padding:var(--rtk-space-0, 0px)}.leave-modal{width:var(--rtk-space-72, 288px)}@media (min-width: 768px){.leave-modal{width:var(--rtk-space-96, 384px)}}.leave-modal{position:relative;display:flex;flex-direction:column;border-radius:var(--rtk-border-radius-md, 8px);--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-background-1000, 8 8 8) / var(--tw-bg-opacity));padding:var(--rtk-space-8, 32px);color:rgb(var(--rtk-colors-text-1000, 255 255 255))}.leave-modal .header h2{margin:var(--rtk-space-0, 0px);margin-bottom:var(--rtk-space-3, 12px)}.leave-modal .message{color:rgb(var(--rtk-colors-text-600, 255 255 255 / 0.52))}.leave-modal .content{margin-top:var(--rtk-space-4, 16px);font-size:14px;display:flex;flex-wrap:wrap;gap:var(--rtk-space-4, 16px)}.leave-modal .content rtk-button{height:var(--rtk-space-9, 36px);min-width:var(--rtk-space-44, 176px);flex-grow:1}.leave-modal .content .secondary-btn{--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-background-800, 30 30 30) / var(--tw-bg-opacity))}.leave-modal .content .secondary-btn:hover{--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-background-600, 60 60 60) / var(--tw-bg-opacity))}.leave-modal .content .secondary-danger-btn{--tw-text-opacity:1;color:rgba(var(--rtk-colors-danger, 255 45 45) / var(--tw-text-opacity))}";var Cc=function(t,e,i,r){var a,s=arguments.length,n=s<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,i,r);else for(var o=t.length-1;o>=0;o--)(a=t[o])&&(n=(s<3?a(n):s>3?a(e,i,n):a(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};const Ec=class{constructor(t){o(this,t),this.config=De,this.t=Fe()}connectedCallback(){this.configChanged(this.config),this.meetingChanged(this.meeting)}configChanged(t){var e;if(null!=t){const i=null===(e=null==t?void 0:t.designTokens)||void 0===e?void 0:e.logo;null!=i&&null==this.logoUrl&&(this.logoUrl=i)}}meetingChanged(t){var e,i,r,a;if(null!=t){const s=null===(a=null===(r=null===(i=null===(e=t.self)||void 0===e?void 0:e.config)||void 0===i?void 0:i.header)||void 0===r?void 0:r.elements)||void 0===a?void 0:a.logo;null!=s&&null==this.logoUrl&&(this.logoUrl=s)}}render(){if(!this.logoUrl||""===this.logoUrl)return null;const t=this.logoUrl,e=this.t("logo");return N(H,{class:"loaded"},N("img",{src:t,alt:e}))}static get watchers(){return{config:["configChanged"],meeting:["meetingChanged"]}}};Cc([ai()],Ec.prototype,"meeting",void 0),Cc([ai()],Ec.prototype,"t",void 0),Ec.style=":host{line-height:initial;font-family:var(--rtk-font-family, sans-serif);font-feature-settings:normal;font-variation-settings:normal}p{margin:var(--rtk-space-0, 0px);padding:var(--rtk-space-0, 0px)}:host{display:flex;flex-direction:column;align-items:center;justify-content:center;color:rgb(var(--rtk-colors-text-1000, 255 255 255));height:100%;width:auto}svg,img{height:100%;width:auto}.brand-color{--tw-text-opacity:1;color:rgba(var(--rtk-colors-brand-500, 33 96 253) / var(--tw-text-opacity))}";const Tc=class{constructor(t){o(this,t),this.maxLength=Vi,this.restoreEmpty=(t,e,i)=>0===t.trim().length?`${e}${t}${e}`:i(t),this.renderLink=t=>N("a",{class:"link",href:t,target:"_blank",rel:"noopener noreferrer"},t),this.renderBold=t=>"string"==typeof t?this.restoreEmpty(t,"*",(t=>N("b",null,t))):N("b",null,this.renderTokens(t)),this.renderItalic=t=>"string"==typeof t?this.restoreEmpty(t,"_",(t=>N("i",null,t))):N("i",null,this.renderTokens(t)),this.renderStrikethrough=t=>"string"==typeof t?this.restoreEmpty(t,"~",(t=>N("s",null,t))):N("b",null,this.renderTokens(t)),this.renderPlainText=t=>"string"==typeof t?t:N("p",null,this.renderTokens(t)),this.renderTokens=t=>t.map((t=>{switch(t.type){case"a":if("string"==typeof t.content)return this.renderLink(t.content);case"b":return this.renderBold(t.content);case"i":return this.renderItalic(t.content);case"s":return this.renderStrikethrough(t.content);case"q":return N("span",{class:"block-quote"});default:return this.renderPlainText(t.content)}}))}renderMessage(t){let e=t.split("\n"),i=!1;"```"===e[0]&&"```"===e[e.length-1]&&(i=!0,e=e.slice(1,-1));const r=e.map((t=>{const e=Ki(t);return N("p",null,this.renderTokens(e))}));return i?N("pre",{style:{whiteSpace:"pre",overflow:"scroll"}},e.join("\n")):r}render(){const t=this.text.slice(0,this.maxLength),e=Hi(t,!0),i=Gi(t);return N("p",{key:"0edda34be90038b70316ff2732939a7ea42f2b30"},0!==e.length&&N("blockquote",{key:"c58ade9478aee1080c922c29245509dc94672fc4"},this.renderMessage(e)),0!==i.length&&this.renderMessage(i))}};Tc.style=":host{line-height:initial;font-family:var(--rtk-font-family, sans-serif);font-feature-settings:normal;font-variation-settings:normal}p{margin:var(--rtk-space-0, 0px);padding:var(--rtk-space-0, 0px)}:host{overflow-wrap:break-word}a{color:currentColor}.block-quote,blockquote{margin:var(--rtk-space-0, 0px);margin-bottom:var(--rtk-space-3, 12px);--tw-border-spacing-x:1px;--tw-border-spacing-y:1px;border-spacing:var(--tw-border-spacing-x) var(--tw-border-spacing-y);border-top-width:var(--rtk-border-width-none, 0);border-bottom-width:var(--rtk-border-width-none, 0);border-left-width:var(--rtk-border-width-md, 2px);border-right-width:var(--rtk-border-width-none, 0);border-style:solid;padding:var(--rtk-space-0\\.5, 2px);padding-left:var(--rtk-space-2, 8px);border-radius:var(--rtk-border-radius-sm, 4px);border-top-left-radius:var(--rtk-border-radius-none, 0);border-bottom-left-radius:var(--rtk-border-radius-none, 0)}pre{white-space:pre-wrap}";var Lc=function(t,e,i,r){var a,s=arguments.length,n=s<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,i,r);else for(var o=t.length-1;o>=0;o--)(a=t[o])&&(n=(s<3?a(n):s>3?a(e,i,n):a(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};const _c=class{constructor(t){o(this,t),this.statesUpdate=Y(this,"rtkStatesUpdate",7),this.roomJoinedListener=()=>{this.updateStates({meeting:"joined"})},this.waitlistedListener=()=>{this.updateStates({meeting:"waiting"})},this.roomLeftListener=({state:t})=>{"disconnected"!==t&&"failed"!==t&&this.updateStates({meeting:"ended",roomLeftState:t})},this.mediaPermissionUpdateListener=({kind:t,message:e})=>{if(["audio","video"].includes(t)&&("DENIED"===e||"SYSTEM_DENIED"===e)&&!0!==Ze.states.activeDebugger){const e={enabled:!0,kind:t};this.updateStates({activePermissionsMessage:e})}},this.socketConnectionUpdateListener=({state:t})=>{"failed"===t&&setTimeout((()=>{this.meeting.leave("disconnected")}),this.leaveRoomTimer)},this.loadConfigFromPreset=!1,this.applyDesignSystem=!1,this.mode="fixed",this.leaveOnUnmount=!1,this.t=Fe(),this.config=De,this.gridLayout="row",this.iconPack=je,this.handleChangingMeeting=t=>{this.updateStates({activeBreakoutRoomsManager:Object.assign(Object.assign({},Ze.states.activeBreakoutRoomsManager),{destinationMeetingId:t})})}}connectedCallback(){var t;"undefined"!=typeof window&&(this.authErrorListener=t=>{t.detail.message.includes("401")&&this.updateStates({meeting:"ended",roomLeftState:"unauthorized"})},window.addEventListener("rtkError",this.authErrorListener)),this.leaveRoomTimer=1e4,this.loadConfigFromPreset=!0,this.applyDesignSystem=!0,this.resizeObserver=new Is((()=>this.handleResize())),this.resizeObserver.observe(this.host),this.applyDesignSystem&&null!=(null===(t=this.config)||void 0===t?void 0:t.designTokens)&&"undefined"!=typeof document&&Ua(document.documentElement,this.config.designTokens),this.meetingChanged(this.meeting)}clearListeners(t){t&&(t.self.removeListener("roomLeft",this.roomLeftListener),t.self.removeListener("roomJoined",this.roomJoinedListener),t.self.removeListener("waitlisted",this.waitlistedListener),t.self.removeListener("mediaPermissionUpdate",this.mediaPermissionUpdateListener),t.meta.removeListener("socketConnectionUpdate",this.socketConnectionUpdateListener))}disconnectedCallback(){var t;this.leaveOnUnmount&&(null===(t=this.meeting)||void 0===t||t.leaveRoom()),this.resizeObserver.disconnect(),this.clearListeners(this.meeting),window.removeEventListener("rtkError",this.authErrorListener)}meetingChanged(t){var e,i;if(t){if(this.updateStates({viewType:t.meta.viewType}),this.loadConfigFromPreset&&null!=t.self.config){const i=t.self.config,{config:r,data:a}=ls(i,t);this.config===De&&(this.config=r),null==this.showSetupScreen&&(this.showSetupScreen=a.showSetupScreen),t.connectedMeetings.supportsConnectedMeetings&&(null===(e=Ze.states.activeBreakoutRoomsManager)||void 0===e?void 0:e.destinationMeetingId)&&(this.showSetupScreen=!1)}this.applyDesignSystem&&null!=(null===(i=this.config)||void 0===i?void 0:i.designTokens)&&"undefined"!=typeof document&&Ua(document.documentElement,this.config.designTokens),t.self.addListener("roomJoined",this.roomJoinedListener),t.self.addListener("waitlisted",this.waitlistedListener),t.self.addListener("roomLeft",this.roomLeftListener),t.self.addListener("mediaPermissionUpdate",this.mediaPermissionUpdateListener),t.meta.addListener("socketConnectionUpdate",this.socketConnectionUpdateListener),t.connectedMeetings.supportsConnectedMeetings&&t.connectedMeetings.once("changingMeeting",this.handleChangingMeeting),t.self.roomJoined?this.updateStates({meeting:"joined"}):this.showSetupScreen?this.updateStates({meeting:"setup"}):t.joinRoom(),window.removeEventListener("rtkError",this.authErrorListener)}}listenState(t){this.updateStates(t.detail)}handleResize(){this.size=ps(this.host.clientWidth)}updateStates(t){const e=Object.assign({},Ze.states);Ze.states=cs(e,t),this.statesUpdate.emit(Ze.states)}render(){const t={meeting:this.meeting,size:this.size,states:Ze.states,config:this.config,iconPack:this.iconPack,t:this.t};if("CHAT"===Ze.states.viewType)return N("rtk-chat",Object.assign({},t));const e={"rtk-grid":{layout:this.gridLayout}};return N(rr,{element:"rtk-meeting",defaults:t,asHost:!0,elementProps:e})}get host(){return W(this)}static get watchers(){return{meeting:["meetingChanged"]}}};Lc([ai()],_c.prototype,"meeting",void 0),Lc([ai()],_c.prototype,"t",void 0),Lc([ai()],_c.prototype,"iconPack",void 0),_c.style=":host{line-height:initial;font-family:var(--rtk-font-family, sans-serif);font-feature-settings:normal;font-variation-settings:normal}p{margin:var(--rtk-space-0, 0px);padding:var(--rtk-space-0, 0px)}:host{box-sizing:border-box;display:flex;flex-direction:column;--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-background-1000, 8 8 8) / var(--tw-bg-opacity));color:rgb(var(--rtk-colors-text-900, 255 255 255 / 0.88));overflow:hidden;position:fixed;top:var(--rtk-space-0, 0px);right:var(--rtk-space-0, 0px);bottom:var(--rtk-space-0, 0px);left:var(--rtk-space-0, 0px);height:100%;width:100%}:host([mode='fill']){position:relative}";var Rc=function(t,e,i,r){var a,s=arguments.length,n=s<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,i,r);else for(var o=t.length-1;o>=0;o--)(a=t[o])&&(n=(s<3?a(n):s>3?a(e,i,n):a(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};const Ac=class{constructor(t){o(this,t),this.clickedThis=!1,this.placement="bottom-end",this.offset=10,this.iconPack=je,this.t=Fe(),this.handleOutsideClick=()=>{this.clickedThis||(this.menuListEl.style.display="none"),this.clickedThis=!1}}componentDidLoad(){document.addEventListener("click",this.handleOutsideClick),this.update()}disconnectedCallback(){document.removeEventListener("click",this.handleOutsideClick)}update(){Yn(this.triggerEl,this.menuListEl,{placement:this.placement,middleware:[Hn(this.offset),qn(),Vn({padding:5})]}).then((({x:t,y:e})=>{Object.assign(this.menuListEl.style,{left:`${t}px`,top:`${e}px`})}))}render(){return N(H,{key:"b276110eb5171b15f815bfe7a96663e01f899e96"},N("span",{key:"8bfa076de490cee6929b3a5da3d90f7741795dd5",id:"trigger",ref:t=>this.triggerEl=t,onClick:()=>{this.clickedThis=!0,"block"!==this.menuListEl.style.display?(this.menuListEl.style.display="block",this.update()):this.menuListEl.style.display="none"}},N("slot",{key:"e287328ba8515ddd37a21645aef25e83e6484e6b",name:"trigger"})),N("span",{key:"cc7025445296778b3dd0ad3eceb24b03eb0c2924",part:"menu-list",id:"menu-list",ref:t=>this.menuListEl=t},N("slot",{key:"0d26db850bffc2cdf9b4142fdfa2f4113d180078"})))}};Rc([ai()],Ac.prototype,"size",void 0),Rc([ai()],Ac.prototype,"iconPack",void 0),Rc([ai()],Ac.prototype,"t",void 0),Ac.style=":host{line-height:initial;font-family:var(--rtk-font-family, sans-serif);font-feature-settings:normal;font-variation-settings:normal}p{margin:var(--rtk-space-0, 0px);padding:var(--rtk-space-0, 0px)}:host{position:relative;display:inline-block;color:rgb(var(--rtk-colors-text-1000, 255 255 255))}#menu-list{position:absolute;z-index:20;display:none}";var Dc=function(t,e,i,r){var a,s=arguments.length,n=s<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,i,r);else for(var o=t.length-1;o>=0;o--)(a=t[o])&&(n=(s<3?a(n):s>3?a(e,i,n):a(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};const Mc=class{constructor(t){o(this,t),this.iconPack=je,this.t=Fe()}render(){return N(H,{key:"16f2f9a4030f6d6b48345af4cfdb3f55c1eee39e"},N("slot",{key:"82c4020f63a6cbf773ecee8493f3fcc6a61c3c61",name:"start"}),N("slot",{key:"55f0449e84f1833a7ef6ddb2c9d995408f0ddef3"}),N("slot",{key:"e826a0992e53227fd3fd517bbb2684f34fed3e8c",name:"end"}))}};Dc([ai()],Mc.prototype,"size",void 0),Dc([ai()],Mc.prototype,"iconPack",void 0),Dc([ai()],Mc.prototype,"t",void 0),Mc.style=":host{line-height:initial;font-family:var(--rtk-font-family, sans-serif);font-feature-settings:normal;font-variation-settings:normal}p{margin:var(--rtk-space-0, 0px);padding:var(--rtk-space-0, 0px)}:host{display:flex;align-items:center;padding-left:var(--rtk-space-3, 12px);padding-right:var(--rtk-space-3, 12px);padding-top:var(--rtk-space-2, 8px);padding-bottom:var(--rtk-space-2, 8px);cursor:pointer;transition-property:color, background-color, border-color, text-decoration-color, fill, stroke;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:150ms;color:rgb(var(--rtk-colors-text-1000, 255 255 255));font-size:14px}::slotted([slot='start']){margin-right:var(--rtk-space-2, 8px)}::slotted([slot='end']){margin-left:var(--rtk-space-2, 8px)}:host(:hover){--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-background-600, 60 60 60) / var(--tw-bg-opacity))}:host(.red){--tw-text-opacity:1;color:rgba(var(--rtk-colors-danger, 255 45 45) / var(--tw-text-opacity))}";var Ic=function(t,e,i,r){var a,s=arguments.length,n=s<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,i,r);else for(var o=t.length-1;o>=0;o--)(a=t[o])&&(n=(s<3?a(n):s>3?a(e,i,n):a(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};const Oc=class{constructor(t){o(this,t),this.iconPack=je,this.t=Fe()}render(){return N(H,{key:"53cfa1381ea1c0bdfe99362f56cc505bff492774"},N("slot",{key:"fffe3a71f857c152d6619514d875893b5899b956"}))}};Ic([ai()],Oc.prototype,"iconPack",void 0),Ic([ai()],Oc.prototype,"t",void 0),Oc.style=":host{line-height:initial;font-family:var(--rtk-font-family, sans-serif);font-feature-settings:normal;font-variation-settings:normal}p{margin:var(--rtk-space-0, 0px);padding:var(--rtk-space-0, 0px)}:host{display:flex;width:-moz-max-content;width:max-content;flex-direction:column;padding-top:var(--rtk-space-2, 8px);padding-bottom:var(--rtk-space-2, 8px);--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-background-800, 30 30 30) / var(--tw-bg-opacity));color:rgb(var(--rtk-colors-text-1000, 255 255 255));overflow:hidden;border-radius:var(--rtk-border-radius-sm, 4px);--tw-shadow:0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);--tw-shadow-colored:0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)}";const Uc=class{constructor(t){o(this,t),this.onAction=Y(this,"action",7),this.actions=[],this.variant="bubble",this.viewType="outgoing",this.hideAvatar=!1,this.hideAuthorName=!1,this.hideMetadata=!1,this.iconPack=je}renderActions(){return N("rtk-menu",{placement:"top-end",offset:1},N("button",{slot:"trigger",class:"actions"},N("rtk-icon",{icon:this.iconPack.chevron_down})),N("rtk-menu-list",null,this.actions.map((t=>N("rtk-menu-item",{onClick:()=>this.onAction.emit(t.id)},t.icon&&N("rtk-icon",{icon:t.icon,slot:"start"}),t.label)))))}render(){return N(H,{key:"fb4680e38de79ad40507a542c09d0b02c4691ded"},N("div",{key:"f6768fd2ea535e35ad86fc92d7f4595a503fdcca",class:{"message-wrapper":!0,[this.viewType]:!0}},!this.hideAvatar&&N("aside",{key:"a524e142b020ea1d528ca57f984bb6e725b59893",class:"avatar",part:"avatar"},N("rtk-avatar",{key:"ee56623f64d2bb3f74ebea3357eb1af9d67cd3a3",participant:{name:this.authorName,picture:this.avatarUrl},size:"sm"})),N("div",{key:"d6f5bb18ee7aa2ad174cd03c3aee4b9a94c3e63e",class:"message",part:"message"},!this.hideAuthorName&&N("div",{key:"338d4801d1ac9ce6a4dd3676148cac3c70f3b39f",class:"header"},this.authorName),N("div",{key:"86d147a38d6582979a94536df63213730becc572",class:{body:!0,bubble:"bubble"===this.variant}},N("slot",{key:"23a3984240643508ef10d3f2c0af5276e4cb5687"}),!this.hideMetadata&&!!this.time&&N("div",{key:"35a4884867e5bdd835532f85e3a9575976aa9703",class:"metadata",title:Qi(this.time)},Zi(this.time,new Date(Date.now()))),0!==this.actions.length&&this.renderActions()))))}};!function(t,e,i,r){var a,s=arguments.length,n=s<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,i,r);else for(var o=t.length-1;o>=0;o--)(a=t[o])&&(n=(s<3?a(n):s>3?a(e,i,n):a(e,i))||n);s>3&&n&&Object.defineProperty(e,i,n)}([ai()],Uc.prototype,"iconPack",void 0),Uc.style=":host{line-height:initial;font-family:var(--rtk-font-family, sans-serif);font-feature-settings:normal;font-variation-settings:normal}p{margin:var(--rtk-space-0, 0px);padding:var(--rtk-space-0, 0px)}.scrollbar{scrollbar-width:thin;scrollbar-color:var(--rtk-scrollbar-color, rgb(var(--rtk-colors-background-600, 60 60 60)))\n var(--rtk-scrollbar-background, transparent)}.scrollbar::-webkit-scrollbar{height:var(--rtk-space-1\\.5, 6px);width:var(--rtk-space-1\\.5, 6px);border-radius:9999px;background-color:var(--rtk-scrollbar-background, transparent)}.scrollbar::-webkit-scrollbar-thumb{border-radius:9999px;background-color:var(--rtk-scrollbar-color, rgb(var(--rtk-colors-background-600, 60 60 60)))}.message-wrapper{display:flex;flex-direction:row-reverse;gap:var(--rtk-space-2, 8px)}.message-wrapper.incoming{flex-direction:row}.message{display:flex;flex-direction:column}.header{margin-bottom:var(--rtk-space-1, 4px);align-self:flex-end;color:rgb(var(--rtk-colors-text-900, 255 255 255 / 0.88));font-size:14px;font-weight:600}.incoming .header{align-self:flex-start}.body{display:flex;flex-direction:column;min-width:var(--rtk-space-24, 96px);font-family:var(--rtk-font-family, sans-serif);color:rgb(var(--rtk-colors-text-900, 255 255 255 / 0.88));font-size:14px;line-height:1.375;position:relative}.body .metadata{margin-top:var(--rtk-space-2, 8px);align-self:flex-end;font-size:10px}.bubble{max-width:var(--rtk-space-96, 384px);padding:var(--rtk-space-2, 8px);--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-brand-300, 73 124 253) / var(--tw-bg-opacity));color:rgb(var(--rtk-colors-text-on-brand-1000, var(--rtk-colors-text-1000, 255 255 255)));border-radius:var(--rtk-border-radius-md, 8px)}.incoming .bubble{--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-background-800, 30 30 30) / var(--tw-bg-opacity));color:rgb(var(--rtk-colors-text-900, 255 255 255 / 0.88))}.avatar{display:none}rtk-menu{position:absolute;right:var(--rtk-space-0, 0px);top:var(--rtk-space-0, 0px);border-radius:var(--rtk-border-radius-lg, 12px)}rtk-menu rtk-icon{height:var(--rtk-space-4, 16px);width:var(--rtk-space-4, 16px);cursor:pointer}.actions{display:flex;align-items:center;justify-content:center;padding-left:var(--rtk-space-2, 8px);padding-bottom:var(--rtk-space-2, 8px);padding-top:var(--rtk-space-1, 4px);padding-right:var(--rtk-space-1, 4px);border-radius:var(--rtk-border-radius-md, 8px);border-width:var(--rtk-border-width-none, 0);border-style:none;background:radial-gradient(\n at top right,\n rgb(var(--rtk-colors-brand-300, 73 124 253)) 60%,\n rgba(255, 255, 255, 0) 80%\n )}.actions rtk-icon{height:var(--rtk-space-4, 16px);width:var(--rtk-space-4, 16px);color:rgb(var(--rtk-colors-text-on-brand-1000, var(--rtk-colors-text-1000, 255 255 255)))}.incoming .actions{background:radial-gradient(\n at top right,\n rgb(var(--rtk-colors-background-800, 30 30 30)) 60%,\n rgba(255, 255, 255, 0) 80%\n )}.incoming .actions rtk-icon{color:rgb(var(--rtk-colors-text-900, 255 255 255 / 0.88))}.incoming rtk-avatar{--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-background-600, 60 60 60) / var(--tw-bg-opacity));color:rgb(var(--rtk-colors-text-900, 255 255 255 / 0.88))}@media (min-width: 400px){.avatar{display:flex;width:var(--rtk-space-6, 24px)}.avatar rtk-avatar{height:var(--rtk-space-6, 24px);width:var(--rtk-space-6, 24px);font-size:10px;overflow:clip;border-radius:9999px}}@media (hover: hover){rtk-menu{visibility:hidden}.body:hover rtk-menu{visibility:visible}}";var $c=function(t,e,i,r){var a,s=arguments.length,n=s<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,i,r);else for(var o=t.length-1;o>=0;o--)(a=t[o])&&(n=(s<3?a(n):s>3?a(e,i,n):a(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};const Fc=class{constructor(t){o(this,t),this.stateUpdate=Y(this,"rtkStateUpdate",7),this.iconPack=je,this.t=Fe(),this.allowUnmute=!0,this.onClose=()=>{this.stateUpdate.emit({activeMuteAllConfirmation:!1})},this.onMuteAll=()=>{var t;null===(t=this.meeting)||void 0===t||t.participants.disableAllAudio(this.allowUnmute),this.onClose()}}render(){return N(H,{key:"199f56583843ca5b4e68f6a087471983c231983b"},N("div",{key:"86b15ff17b5a9526df77d2bc9f1d1e2d938c71c4",class:"leave-modal"},N("div",{key:"7f19f8d34586e3f8ee4661556e5f4c744facb4e8",class:"header"},N("h2",{key:"93adfa1d849b0aa3e483c280d1078d99ac1ef73c",class:"title"},this.t("mute_all.header"))),N("p",{key:"7532426538ef8de6280cf0246126061bff639209",class:"message"},this.t("mute_all.description")),N("div",{key:"14f577e917ecbf867afe2e6a4f94b86122d95496",class:"content"},N("div",{key:"2cbe2cea5befa86328d786aa3420af04bda0097e",class:"leave-meeting"},N("rtk-button",{key:"27b26964264a4c569ef7388357623ed97dff7bdb",variant:"secondary",title:this.t("close"),onClick:this.onClose},this.t("cancel")),N("rtk-button",{key:"dba570b9e72a21c0b76957cac4809f61878645d3",variant:"danger",title:this.t("mute_all"),onClick:this.onMuteAll},this.t("mute_all"))))))}};$c([ai()],Fc.prototype,"meeting",void 0),$c([ai()],Fc.prototype,"states",void 0),$c([ai()],Fc.prototype,"iconPack",void 0),$c([ai()],Fc.prototype,"t",void 0),Fc.style=":host{line-height:initial;font-family:var(--rtk-font-family, sans-serif);font-feature-settings:normal;font-variation-settings:normal}p{margin:var(--rtk-space-0, 0px);padding:var(--rtk-space-0, 0px)}:host{display:block;-webkit-user-select:none;-moz-user-select:none;user-select:none}.leave-modal{position:relative;display:flex;flex-direction:column;border-radius:var(--rtk-border-radius-md, 8px);--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-background-900, 26 26 26) / var(--tw-bg-opacity));padding:var(--rtk-space-4, 16px);color:rgb(var(--rtk-colors-text-1000, 255 255 255))}.leave-modal .header h2{margin:var(--rtk-space-0, 0px);margin-bottom:var(--rtk-space-3, 12px)}.leave-modal .content{font-size:14px}.leave-message p{margin-top:var(--rtk-space-3, 12px);margin-bottom:var(--rtk-space-3, 12px)}.leave-meeting{display:flex;flex-direction:row;justify-content:space-between;gap:var(--rtk-space-2, 8px)}.leave-meeting rtk-button{flex:1 1 0%}.end-meeting{margin-top:var(--rtk-space-2, 8px)}.message{margin-bottom:var(--rtk-space-4, 16px)}label{display:flex;align-items:center}input[type='checkbox']{margin-right:var(--rtk-space-2, 8px);accent-color:rgb(var(--rtk-colors-brand-500, 33 96 253))}";var jc=function(t,e,i,r){var a,s=arguments.length,n=s<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,i,r);else for(var o=t.length-1;o>=0;o--)(a=t[o])&&(n=(s<3?a(n):s>3?a(e,i,n):a(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};const zc=class{constructor(t){o(this,t),this.dismiss=Y(this,"rtkNotificationDismiss",7),this.iconPack=je,this.t=Fe(),this.imageState="loading"}connectedCallback(){this.notificationChanged(this.notification)}pausedChanged(t){t?clearTimeout(this.timeout):this.notificationChanged(this.notification)}notificationChanged(t){null==t||"number"!=typeof t.duration||this.paused||(this.timeout=window.setTimeout((()=>{this.dismiss.emit(t.id)}),t.duration))}render(){var t;return N(H,{key:"b6a7ede34064bcc25040589cd09b00a5e5a5cf8a"},N("div",{key:"42608dc49ec59c0c54be513e59b81627f0ecb11c",class:"ctr"},null!=this.notification.icon&&N("rtk-icon",{key:"263c38129622549c8df1900d8905f52ee29cff8a",class:"icon",icon:this.notification.icon,variant:null!==(t=this.notification.iconVariant)&&void 0!==t?t:"primary"}),null!=this.notification.image&&null==this.notification.icon&&"errored"!==this.imageState&&N("img",{key:"0e8d7812bd8b58ce0efe3edff6ae7346cbcd0fd4",src:this.notification.image,class:{loaded:"loaded"===this.imageState},onLoad:()=>this.imageState="loaded",onError:()=>this.imageState="errored"}),N("p",{key:"f28ec5ff1a3902817d5501ea2324371defc8995a",class:"message"},N(Qn,{key:"7f7b179a67d125585ed70112fcb2a1925c3bae52",message:this.notification.message})),N("div",{key:"2ba60b2b60ddbc43d207adc86e0a975f3c432f70",class:"right"},null!=this.notification.button&&N("rtk-button",{key:"2f4871b0ee2871cbccb016e4451e28c424fe14ce",size:"sm",variant:this.notification.button.variant,onClick:()=>this.notification.button.onClick()},this.notification.button.text),N("button",{key:"1786dac10dbc2ca9aabad707354ce16fe1af9bc8",onClick:()=>this.dismiss.emit(this.notification.id),class:"dismiss"},N("rtk-icon",{key:"b11c47705af86c38bd6488ecb6998aad62099396","aria-label":this.t("dismiss"),icon:this.iconPack.dismiss})))))}static get watchers(){return{paused:["pausedChanged"],notification:["notificationChanged"]}}};jc([ai()],zc.prototype,"size",void 0),jc([ai()],zc.prototype,"iconPack",void 0),jc([ai()],zc.prototype,"t",void 0),zc.style=":host{line-height:initial;font-family:var(--rtk-font-family, sans-serif);font-feature-settings:normal;font-variation-settings:normal}p{margin:var(--rtk-space-0, 0px);padding:var(--rtk-space-0, 0px)}:host{pointer-events:none;display:block;height:var(--rtk-space-10, 40px);color:rgb(var(--rtk-colors-text-1000, 255 255 255));animation:show 0.4s ease;transition:0.4s;z-index:100}.ctr{box-sizing:border-box;display:inline-flex;height:100%;min-width:var(--rtk-space-40, 160px);align-items:center;padding-left:var(--rtk-space-3, 12px);padding-right:var(--rtk-space-2, 8px);-webkit-user-select:none;-moz-user-select:none;user-select:none;border-radius:var(--rtk-border-radius-md, 8px);--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-background-600, 60 60 60) / var(--tw-bg-opacity));--tw-shadow:0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);--tw-shadow-colored:0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);--tw-shadow-color:rgb(var(--rtk-colors-background-1000, 8 8 8));--tw-shadow:var(--tw-shadow-colored);pointer-events:auto}img{margin-right:var(--rtk-space-2, 8px);height:var(--rtk-space-0, 0px);width:var(--rtk-space-0, 0px);border-radius:9999px}img.loaded{height:var(--rtk-space-6, 24px);width:var(--rtk-space-6, 24px)}.message{margin-right:var(--rtk-space-3, 12px);max-width:var(--rtk-space-72, 288px);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.message p{margin:var(--rtk-space-0, 0px);margin-right:var(--rtk-space-1, 4px);display:inline-block}.message blockquote{display:none}rtk-icon.icon{margin-right:var(--rtk-space-2, 8px);height:var(--rtk-space-6, 24px);width:var(--rtk-space-6, 24px);color:rgb(var(--rtk-colors-text-900, 255 255 255 / 0.88))}button.dismiss{display:flex;height:var(--rtk-space-6, 24px);width:var(--rtk-space-6, 24px);align-items:center;justify-content:center;border-width:var(--rtk-border-width-none, 0);border-style:none;padding:var(--rtk-space-0, 0px);border-radius:var(--rtk-border-radius-sm, 4px);background-color:transparent;color:rgb(var(--rtk-colors-text-600, 255 255 255 / 0.52));outline-width:1px;outline-color:rgb(var(--rtk-colors-text-1000, 255 255 255))}button.dismiss:hover{cursor:pointer;color:rgb(var(--rtk-colors-text-1000, 255 255 255))}button.dismiss:focus-visible{outline-style:solid}button.dismiss{transition-property:color, background-color, border-color, text-decoration-color, fill, stroke;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:150ms}.dismiss rtk-icon{height:var(--rtk-space-5, 20px);width:var(--rtk-space-5, 20px)}rtk-button{border-radius:var(--rtk-border-radius-sm, 4px)}.right{margin-left:auto;display:flex;align-items:center;gap:var(--rtk-space-2, 8px)}:host(.exit){animation:exit 0.4s ease}@keyframes show{0%{opacity:0;transform:translateX(-120px)}100%{opacity:1;transform:translateX(0px)}}@keyframes exit{0%{opacity:1;transform:translateX(0)}100%{opacity:0;transform:translateX(-120px)}}:host([size='sm']){font-size:14px}";const Nc=2e3,Bc=Object.freeze({notifications:{participant_joined:!0,participant_left:!0,participant_joined_waitlist:!0,chat:!0,polls:!0,webinar:!0,tab_sync:!0,recording_started:!0,recording_stopped:!0},notification_sounds:{participant_joined:!0,participant_left:!0,chat:!0,polls:!0,webinar:!0,participant_joined_waitlist:!0},notification_duration:{participant_joined:2100,participant_left:2100,participant_joined_waitlist:4e3,chat:Nc,polls:Nc,webinar:Nc,tab_sync:Nc,recording_started:Nc,recording_stopped:Nc},participant_joined_sound_notification_limit:10,participant_chat_message_sound_notification_limit:10});var Hc=function(t,e,i,r){var a,s=arguments.length,n=s<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,i,r);else for(var o=t.length-1;o>=0;o--)(a=t[o])&&(n=(s<3?a(n):s>3?a(e,i,n):a(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};function Gc(t){return Object.keys(t).filter((e=>t[e]))}const Vc=class{constructor(t){o(this,t),this.permissions=Bc,this.enabledSounds=Gc(Bc.notification_sounds),this.config=De,this.t=Fe(),this.iconPack=je,this.notifications=[],this.addStagePeersListeners=t=>{t.participants.joined.addListener("participantJoined",this.participantJoinedListener),t.participants.joined.addListener("participantLeft",this.participantLeftListener)},this.removeStagePeersListeners=t=>{t.participants.joined.removeListener("participantJoined",this.participantJoinedListener),t.participants.joined.removeListener("participantLeft",this.participantLeftListener)},this.onNotification=t=>{this.add(t.detail);const e=t.detail.playSound;null!=e&&this.audio.play(e)},this.onRecordingUpdate=t=>{var e,i;"RECORDING"===t&&!1!==this.permissions.notifications.recording_started?this.add({id:"recording-started",icon:this.iconPack.recording,message:this.t("recording.started"),duration:null!==(e=this.permissions.notification_duration.recording_started)&&void 0!==e?e:Nc}):"STOPPING"===t&&!1!==this.permissions.notifications.recording_stopped&&this.add({id:"recording-stopped",icon:this.iconPack.stop_recording,message:this.t("recording.stopped"),duration:null!==(i=this.permissions.notification_duration.recording_stopped)&&void 0!==i?i:Nc})},this.paused=!1}connectedCallback(){"undefined"!=typeof document&&(null===document||void 0===document||document.addEventListener("rtkNotification",this.onNotification)),this.meetingChanged(this.meeting),this.configChanged(this.config),this.statesChanged(this.states)}clearListeners(t){var e,i,r,a,s,n,o,c;const l="LIVESTREAM"===t.meta.viewType;(l&&"ON_STAGE"===(null===(e=t.stage)||void 0===e?void 0:e.status)||!l)&&this.removeStagePeersListeners(t),this.chatUpdateListener&&(null===(i=t.chat)||void 0===i||i.removeListener("chatUpdate",this.chatUpdateListener)),this.pollUpdateListener&&(null===(r=t.polls)||void 0===r||r.removeListener("pollsUpdate",this.pollUpdateListener)),t.meta.removeListener("socketConnectionUpdate",this.socketConnectionUpdateListener),this.stageRequestAccepted&&(null===(a=t.stage)||void 0===a||a.removeListener("stageRequestApproved",this.stageRequestAccepted)),this.stageRequestRejected&&(null===(s=t.stage)||void 0===s||s.removeListener("stageRequestRejected",this.stageRequestRejected)),this.newStageRequests&&(null===(n=t.stage)||void 0===n||n.removeListener("newStageRequest",this.newStageRequests)),this.stageStatusUpdateListener&&(null===(o=t.stage)||void 0===o||o.removeListener("stageStatusUpdate",this.stageStatusUpdateListener)),null===(c=t.recording)||void 0===c||c.removeListener("recordingUpdate",this.onRecordingUpdate),clearTimeout(this.disconnectTimeout),t.self.removeListener("deviceUpdate",this.deviceUpdateListener)}disconnectedCallback(){var t;"undefined"!=typeof document&&(null===document||void 0===document||document.removeEventListener("rtkNotification",this.onNotification)),null!=this.meeting&&(this.clearListeners(this.meeting),this.waitlistedParticipantJoinedListener&&this.meeting.participants.waitlisted.removeListener("participantJoined",this.waitlistedParticipantJoinedListener),this.waitlistedParticipantLeftListener&&this.meeting.participants.waitlisted.removeListener("participantLeft",this.waitlistedParticipantLeftListener),this.activeTabUpdateListener&&(null===(t=this.meeting.meta)||void 0===t||t.removeListener("activeTabUpdate",this.activeTabUpdateListener)),this.peerStageStatusListener&&this.meeting.participants.joined.removeListener("stageStatusUpdate",this.peerStageStatusListener))}meetingChanged(t,e){var i,r,a,s,n,o,c,l,d;if(clearTimeout(this.disconnectTimeout),void 0!==e&&this.clearListeners(e),null==t)return;const h="LIVESTREAM"===t.meta.viewType;this.audio=new Xn(t);const{notifications:p,notification_duration:g,notification_sounds:u}=this.permissions;if(this.participantJoinedListener=t=>{p.participant_joined&&this.add({id:`${t.id}-joined`,message:`${ti(t.name)} ${this.t("notifications.joined")}`,image:t.picture,duration:g.participant_joined}),u.participant_joined&&this.canPlayParticipantJoinedSound()&&this.audio.play("joined")},this.participantLeftListener=t=>{const{socketState:{state:e}}=this.meeting.meta;p.participant_left&&"connected"!==e&&this.add({id:`${t.id}-left`,message:`${ti(t.name)} ${this.t("notifications.left")}`,image:t.picture,duration:g.participant_left}),u.participant_left&&this.canPlayParticipantJoinedSound()&&this.audio.play("left")},this.waitlistedParticipantJoinedListener=t=>{if(!this.canAcceptWaitingRequests())return;const e=`${t.id}-joined-waitlist`;this.add({id:e,message:`${ti(t.name)} ${this.t("notifications.requesting_to_join_meeting")}`,image:t.picture,duration:g.participant_joined_waitlist,button:{text:this.t("notifications.accept"),variant:"primary",onClick:async()=>{await this.meeting.participants.acceptWaitingRoomRequest(t.id),this.remove(e)}}}),u.participant_joined_waitlist&&this.canPlayParticipantJoinedSound()&&this.audio.play("message")},this.waitlistedParticipantLeftListener=t=>{this.remove(`${t.id}-joined-waitlist`)},this.chatUpdateListener=({message:e})=>{const i=Ri(e);if(null!=i){if(i.userId===t.self.userId)return;"text"===i.type&&(p.chat&&this.add({id:`message-${Math.random().toString(36)}`,icon:this.iconPack.chat,message:`${i.displayName}: ${i.message}`,duration:g.chat}),u.chat&&this.canPlayChatSound()&&this.audio.play("message"))}},this.pollUpdateListener=({polls:t,newPoll:e})=>{!1!==e&&(p.polls&&this.meeting.self.userId!==t[t.length-1].createdByUserId&&this.add({id:`poll-${Math.random().toString(36)}`,icon:this.iconPack.poll,message:`${this.t("notifications.new_poll_created_by")} ${t[t.length-1].createdBy}`,duration:g.polls}),u.polls&&this.meeting.self.userId!==t[t.length-1].createdByUserId&&this.canPlayChatSound()&&this.audio.play("message"))},this.deviceUpdateListener=({device:t,preview:e})=>{e||("audiooutput"===t.kind&&(this.audio.setDevice(t.deviceId),this.remove("speaker-switched"),this.add({id:"speaker-switched",message:`${this.t("notifications.connected_to")} ${t.label}`,icon:this.iconPack.speaker,duration:5e3})),"videoinput"===t.kind&&(this.remove("camera-switched"),this.add({id:"camera-switched",message:`${this.t("notifications.connected_to")} ${t.label}`,icon:this.meeting.self.videoEnabled?this.iconPack.video_on:this.iconPack.video_off,iconVariant:this.meeting.self.videoEnabled?"primary":"danger",duration:5e3})),"audioinput"===t.kind&&(this.remove("mic-switched"),this.add({id:"mic-switched",message:`${this.t("notifications.connected_to")} ${t.label}`,icon:this.meeting.self.audioEnabled?this.iconPack.mic_on:this.iconPack.mic_off,iconVariant:this.meeting.self.audioEnabled?"primary":"danger",duration:5e3})))},this.socketConnectionUpdateListener=({state:t,reconnectionAttempt:e,reconnected:i})=>{switch(t){case"connected":this.remove("socket"),i&&this.add({id:"socket",icon:this.iconPack.wifi,message:this.t("network.restored"),duration:3e3});break;case"disconnected":this.remove("socket"),this.add({id:"socket",icon:this.iconPack.disconnected,message:this.t("network.reconnecting")});break;case"reconnecting":e>=6?(this.remove("socket"),this.add({id:"socket",icon:this.iconPack.disconnected,message:this.t("network.disconnected"),button:{text:this.t("end"),variant:"danger",onClick:()=>{var t;return null===(t=this.meeting)||void 0===t?void 0:t.leaveRoom()}}})):e>=4&&(this.remove("socket"),this.add({id:"socket",icon:this.iconPack.disconnected,message:this.t("network.delay_extended")}));break;case"failed":this.remove("socket"),this.add({id:"socket",icon:this.iconPack.disconnected,message:this.t("network.leaving"),button:{text:this.t("end"),variant:"danger",onClick:()=>{var t;return null===(t=this.meeting)||void 0===t?void 0:t.leaveRoom()}}})}},this.activeTabUpdateListener=e=>{if(p.tab_sync)switch(e.type){case"plugin":const i=t.plugins.active.toArray().find((t=>t.id==e.id));null!=i&&this.add({id:"activeTab",message:`${this.t("notifications.plugin_switched_to")} ${i.name}`,duration:g.participant_joined});break;case"screenshare":const r=t.participants.joined.toArray().filter((t=>t.screenShareEnabled)).find((t=>t.id==e.id));null!=r&&this.add({id:"spotlight",message:`Now watching ${r.name}'s screen`,duration:g.webinar})}},this.peerStageStatusListener=t=>{"REQUESTED_TO_JOIN_STAGE"===t.stageStatus&&(this.add({id:`stage-request-${t.id}`,message:`${t.name} ${this.t("notifications.requested_to_join_stage")}`,duration:g.webinar,button:{text:this.t("notifications.accept"),variant:"primary",onClick:async()=>{await this.meeting.stage.grantAccess([t.userId]),this.remove(`stage-request-${t.id}`)}}}),u.webinar&&this.audio.play("joined")),"ON_STAGE"===t.stageStatus&&(this.add({id:`stage-joined-${t.id}`,message:`${t.name} ${this.t("notifications.joined_stage")}`,duration:g.webinar}),u.webinar&&this.audio.play("joined"))},this.stageRequestAccepted=()=>{this.add({id:"stage-request-accepted",message:this.t("notifications.request_to_join_accepted"),duration:3e3})},this.stageRequestRejected=()=>{this.add({id:"stage-request-rejected",message:this.t("notifications.request_to_join_rejected"),duration:3e3})},this.newStageRequests=({count:t})=>{this.add({id:"new-stage-request",message:`You have ${t<0?"new stage":`${t} pending`} request${1===t?"":"s"}`,duration:3e3})},this.stageStatusUpdateListener=e=>{"ON_STAGE"===e?this.addStagePeersListeners(t):this.removeStagePeersListeners(t)},!Qt(t)&&(null===(i=t.chat)||void 0===i||i.addListener("chatUpdate",this.chatUpdateListener)),"CHAT"===(null===(r=t.self.config.viewType)||void 0===r?void 0:r.toString()))return;const f=t.self.getCurrentDevices();null!=f.speaker&&this.audio.setDevice(f.speaker.deviceId),h?null===(a=t.stage)||void 0===a||a.on("stageStatusUpdate",this.stageStatusUpdateListener):this.addStagePeersListeners(t),this.canAcceptWaitingRequests()&&(t.participants.waitlisted.addListener("participantJoined",this.waitlistedParticipantJoinedListener),t.participants.waitlisted.addListener("participantLeft",this.waitlistedParticipantLeftListener)),null===(s=t.polls)||void 0===s||s.addListener("pollsUpdate",this.pollUpdateListener),t.self.addListener("deviceUpdate",this.deviceUpdateListener),t.meta.addListener("socketConnectionUpdate",this.socketConnectionUpdateListener),null===(n=t.meta)||void 0===n||n.addListener("activeTabUpdate",this.activeTabUpdateListener),null===(o=t.recording)||void 0===o||o.addListener("recordingUpdate",this.onRecordingUpdate),null===(c=t.stage)||void 0===c||c.addListener("stageRequestApproved",this.stageRequestAccepted),null===(l=t.stage)||void 0===l||l.addListener("stageRequestRejected",this.stageRequestRejected),t.self.permissions.stageEnabled&&t.self.permissions.acceptStageRequests&&(null===(d=t.stage)||void 0===d||d.addListener("newStageRequest",this.newStageRequests))}configChanged(t){null!=t&&null!=(null==t?void 0:t.config)&&(this.permissions=function(t){const e=Object.assign({},Bc);return null==t||(Object.assign(e.notification_sounds,t.notification_sounds),Object.assign(e.notifications,t.notifications),Object.assign(e.notification_duration,t.notification_duration),e.participant_chat_message_sound_notification_limit=t.participant_chat_message_sound_notification_limit,e.participant_joined_sound_notification_limit=t.participant_joined_sound_notification_limit),e}(t.config),this.enabledSounds=Gc(this.permissions.notification_sounds))}statesChanged(t){var e;if(null!=t){const i=!(null===(e=null==t?void 0:t.prefs)||void 0===e?void 0:e.muteNotificationSounds);for(const t of this.enabledSounds)t in this.permissions.notification_sounds&&(this.permissions.notification_sounds[t]=i)}}apiErrorListener({detail:t}){const{trace:e,message:i}=t;this.add({id:e,message:i,duration:Nc,icon:this.iconPack.warning})}sendNotificationListener({detail:t}){const{trace:e,message:i}=t;this.add({id:e,message:i,duration:Nc})}add(t){"visible"===document.visibilityState&&this.notifications.length<5&&(this.notifications=[...this.notifications,t])}remove(t){this.notifications=this.notifications.filter((e=>e.id!==t))}handleDismiss(t){t.stopPropagation();const e=t.detail,i=this.host.shadowRoot.querySelector(`[data-id="${e}"]`);null==i||i.classList.add("exit"),setTimeout((()=>{C((()=>{this.remove(e)}))}),400)}canPlayParticipantJoinedSound(){return null==this.permissions.participant_joined_sound_notification_limit||this.permissions.participant_joined_sound_notification_limit<=0||this.meeting.participants.count<=this.permissions.participant_joined_sound_notification_limit}canPlayChatSound(){return null==this.permissions.participant_chat_message_sound_notification_limit||this.permissions.participant_chat_message_sound_notification_limit<=0||this.meeting.participants.count<=this.permissions.participant_chat_message_sound_notification_limit}canAcceptWaitingRequests(){return this.permissions.notifications.participant_joined_waitlist&&this.meeting.self.permissions.acceptWaitingRequests}render(){return N(H,{key:"906188de5f85fcdb91e7bbd9fc44c60f722ec231"},N("div",{key:"971924ad071ffa9525984eac3f11e929d10ec8a2",onMouseEnter:()=>this.paused=!0,onFocusin:()=>this.paused=!0,onMouseLeave:()=>this.paused=!1,onFocusout:()=>this.paused=!1},this.notifications.map((t=>N("rtk-notification",{size:this.size,key:t.id,"data-id":t.id,notification:t,onRtkNotificationDismiss:t=>this.handleDismiss(t),iconPack:this.iconPack,paused:this.paused,t:this.t})))))}get host(){return W(this)}static get watchers(){return{meeting:["meetingChanged"],config:["configChanged"],states:["statesChanged"]}}};Hc([ai()],Vc.prototype,"meeting",void 0),Hc([ai()],Vc.prototype,"states",void 0),Hc([ai()],Vc.prototype,"t",void 0),Hc([ai()],Vc.prototype,"size",void 0),Hc([ai()],Vc.prototype,"iconPack",void 0),Vc.style=":host{line-height:initial;font-family:var(--rtk-font-family, sans-serif);font-feature-settings:normal;font-variation-settings:normal}p{margin:var(--rtk-space-0, 0px);padding:var(--rtk-space-0, 0px)}:host{position:absolute;top:var(--rtk-space-4, 16px);right:var(--rtk-space-4, 16px);bottom:var(--rtk-space-4, 16px);left:var(--rtk-space-4, 16px);top:auto;display:flex;flex-direction:column;pointer-events:none;z-index:100}rtk-notification{margin-top:var(--rtk-space-2, 8px)}";var qc=function(t,e,i,r){var a,s=arguments.length,n=s<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,i,r);else for(var o=t.length-1;o>=0;o--)(a=t[o])&&(n=(s<3?a(n):s>3?a(e,i,n):a(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};const Kc=class{constructor(t){o(this,t),this.stateUpdate=Y(this,"rtkStateUpdate",7),this.iconPack=je,this.t=Fe()}connectedCallback(){this.states.activeOverlayModal.timeout&&setTimeout((()=>{this.stateUpdate.emit({activeOverlayModal:{active:!1}})}),this.states.activeOverlayModal.timeout)}render(){return N(H,{key:"e5bdb94d07093b7b6950c5d389b3cca3c5f0bc22"},N("rtk-icon",{key:"04dcace07d18e31644bb11215c069eb63ea8dfe6",icon:this.states.activeOverlayModal.icon}),N("h2",{key:"5ca79bee28c169a489a83e53e0911e6187c731f2"},this.states.activeOverlayModal.title),N("p",{key:"d4d7e34a08e991709b1931ce22c899dcc624c692"},this.states.activeOverlayModal.description))}};qc([ai()],Kc.prototype,"meeting",void 0),qc([ai()],Kc.prototype,"states",void 0),qc([ai()],Kc.prototype,"iconPack",void 0),qc([ai()],Kc.prototype,"t",void 0),Kc.style=":host{line-height:initial;font-family:var(--rtk-font-family, sans-serif);font-feature-settings:normal;font-variation-settings:normal}p{margin:var(--rtk-space-0, 0px);padding:var(--rtk-space-0, 0px)}:host{display:flex;height:100%;width:100%;flex-direction:column;align-items:center;justify-content:center;background-color:rgba(var(--rtk-colors-background-1000, 8 8 8) / 0.6);position:fixed;top:var(--rtk-space-0, 0px);right:var(--rtk-space-0, 0px);z-index:50}rtk-icon{height:var(--rtk-space-20, 80px)}h2{margin:var(--rtk-space-2, 8px);font-weight:500}p{margin:var(--rtk-space-0, 0px);font-size:16px}";var Wc=function(t,e,i,r){var a,s=arguments.length,n=s<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,i,r);else for(var o=t.length-1;o>=0;o--)(a=t[o])&&(n=(s<3?a(n):s>3?a(e,i,n):a(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};const Yc=class{constructor(t){o(this,t),this.autoScroll=!0,this.iconPack=je,this.t=Fe(),this.emptyListLabel=null,this.isLoading=!1,this.rerenderBoolean=!1,this.shouldRenderNewNodes=!0,this.hasNewNodesToRender=!1,this.showEmptyListLabel=!1,this.pagesToRender=[[]],this.currentTime=()=>(new Date).getTime(),this.observe=t=>{t&&this.intersectionObserver.observe(t)}}async onNewNode(t){this.shouldRenderNewNodes?(this.addNodeToRender(t,!1),this.rerender()):this.hasNewNodesToRender=!0}async onNodeDelete(t){const e=this.pagesToRender.flat().length;this.pagesToRender=this.pagesToRender.map((e=>e.filter((e=>e.id!==t)))),e!==this.pagesToRender.flat().length&&this.rerender()}async onNodeUpdate(t,e){let i=!1;this.pagesToRender=this.pagesToRender.map((r=>r.map((r=>r.id===t?(i=!0,e):r)))),i&&this.rerender()}onItemChanged(t,e){t!==e&&(this.pagesToRender=[[]],this.loadFirstPage().then((()=>this.rerender())))}connectedCallback(){this.rerender=_i(this.rerender.bind(this),50,{maxWait:200}),this.intersectionObserver=new IntersectionObserver((t=>{C((()=>{for(const e of t)"bottom-scroll"===e.target.id&&(e.isIntersecting?this.loadBottom():this.shouldRenderNewNodes=!1),"top-scroll"===e.target.id&&e.isIntersecting&&this.loadTop()}))}))}disconnectedCallback(){this.intersectionObserver.disconnect()}componentDidLoad(){this.loadFirstPage(),this.observe(this.$topRef),this.observe(this.$bottomRef)}componentDidRender(){this.shouldRenderNewNodes&&this.autoScroll&&Xi(this.$paginatedList)}loadFirstPage(){return this.loadPage(this.currentTime(),this.pageSize,!0,(t=>{0===t.length&&(this.showEmptyListLabel=!0)}))}loadTop(){if(0===this.pagesToRender.length)return;if(1===this.pagesToRender.length&&this.pagesToRender[0].length<this.pageSize)return;const t=this.pagesToRender[0][0].timeMs;this.loadPage(t-1,this.pageSize,!0,(()=>{}))}loadBottom(){if(0===this.pagesToRender.length)return void(this.shouldRenderNewNodes=!0);if(1===this.pagesToRender.length&&this.pagesToRender[0].length<this.pageSize)return void(this.shouldRenderNewNodes=!0);const t=this.pagesToRender.at(-1).at(-1).timeMs;this.loadPage(t+1,this.pageSize,!1,(()=>Xi(this.$paginatedList)))}addNodeToRender(t,e){if(e){const e=this.pagesToRender[0];if(e&&(null==e?void 0:e.length)<this.pageSize)e.unshift(t);else{const e=[t];this.pagesToRender.unshift(e),this.removeLastPageIfNeeded(!1)}}else{const[e]=this.pagesToRender.slice(-1);if(e&&(null==e?void 0:e.length)<this.pageSize)e.push(t);else{const e=[t];this.pagesToRender.push(e),this.removeLastPageIfNeeded(!0)}}}async loadPage(t,e,i,r=()=>{}){this.isLoading=!0;const a=await this.fetchData(t,e,i);if(this.isLoading=!1,!(null==a?void 0:a.length))return i||(this.hasNewNodesToRender=!1,this.shouldRenderNewNodes=!0),void r([]);a.forEach((t=>this.addNodeToRender(t,i))),this.rerender(),r(a)}rerender(){this.rerenderBoolean=!this.rerenderBoolean}removeLastPageIfNeeded(t){this.pagesToRender.length>this.pagesAllowed&&(t?this.pagesToRender.shift():this.pagesToRender.pop())}onDownArrowClicked(){this.loadBottom()}render(){var t;return N(H,{key:"6fd10c2fdc24eeab3d52c10643ed92321e04d9fe"},N("div",{key:"675f184549482b76fc07ea5641b9c3297ab6a79b",class:"scrollbar container",part:"container",ref:t=>this.$paginatedList=t},N("div",{key:"37618a8856bd0f1a8ecc57b38cd700bc302191e6",class:{"show-new-messages-ctr":!0,active:!this.shouldRenderNewNodes}},N("rtk-button",{key:"b7ebb2a7b309c47af1987159726f1399452995c2",class:"show-new-messages",kind:"icon",variant:"secondary",part:"show-new-messages",onClick:()=>this.onDownArrowClicked()},N("rtk-icon",{key:"99532567bf299b314a8e0a6d5485ad3fa219e600",icon:this.iconPack.chevron_down}))),N("div",{key:"512f096db4e0fdbd969c3cb7cfacc00a38b2f2b6",class:"smallest-dom-element",id:"bottom-scroll",ref:t=>this.$bottomRef=t}),this.isLoading&&0===this.pagesToRender.flat().length&&N("rtk-spinner",{key:"bf2bcfdc9e4eecbc120ad38a0cc2c8323781532c",size:"lg"}),0===this.pagesToRender.flat().length&&this.showEmptyListLabel?N("div",{class:"empty-list"},null!==(t=this.emptyListLabel)&&void 0!==t?t:this.t("list.empty")):N("div",{class:"page-wrapper"},this.pagesToRender.map((t=>this.createNodes(t)))),N("div",{key:"2c29f14bcac1c725c619349f1e30627cfdbc26f9",class:"smallest-dom-element",id:"top-scroll",ref:t=>this.$topRef=t})))}static get watchers(){return{selectedItemId:["onItemChanged"]}}};Wc([ai()],Yc.prototype,"iconPack",void 0),Wc([ai()],Yc.prototype,"t",void 0),Yc.style=".scrollbar{scrollbar-width:thin;scrollbar-color:var(--rtk-scrollbar-color, rgb(var(--rtk-colors-background-600, 60 60 60)))\n var(--rtk-scrollbar-background, transparent)}.scrollbar::-webkit-scrollbar{height:var(--rtk-space-1\\.5, 6px);width:var(--rtk-space-1\\.5, 6px);border-radius:9999px;background-color:var(--rtk-scrollbar-background, transparent)}.scrollbar::-webkit-scrollbar-thumb{border-radius:9999px;background-color:var(--rtk-scrollbar-color, rgb(var(--rtk-colors-background-600, 60 60 60)))}:host{position:relative;display:flex;flex-direction:column;flex:1}.container{box-sizing:border-box;display:flex;flex-direction:column-reverse;padding-top:var(--rtk-space-4, 16px);padding-bottom:var(--rtk-space-4, 16px);flex:1 0 0px;overflow-y:scroll;}.file-picker{display:none}.chat *:first-child{margin-top:var(--rtk-space-0, 0px)}.chat .head{display:flex;align-items:center}.chat .head .name{margin-right:var(--rtk-space-4, 16px);font-size:12px;font-weight:700}.chat .head .time{font-size:12px;color:rgb(var(--rtk-colors-text-800, 255 255 255 / 0.76))}.chat .body{margin-top:var(--rtk-space-2, 8px);margin-bottom:var(--rtk-space-2, 8px);overflow-wrap:break-word;font-size:14px;line-height:1.375}.chat .body .emoji{font-size:24px}p{margin-top:var(--rtk-space-0, 0px);margin-bottom:var(--rtk-space-3, 12px)}rtk-text-message,rtk-image-message,rtk-file-message{margin-top:var(--rtk-space-4, 16px);display:block;padding-left:var(--rtk-space-3, 12px);padding-right:var(--rtk-space-3, 12px);font-family:var(--rtk-font-family, sans-serif);color:rgb(var(--rtk-colors-text-900, 255 255 255 / 0.88));box-sizing:border-box}*[is-continued]{margin-top:var(--rtk-space-3, 12px)}rtk-text-message[is-continued]{margin-top:var(--rtk-space-2, 8px)}.chat .image{position:relative;height:var(--rtk-space-40, 160px);max-width:var(--rtk-space-64, 256px);cursor:pointer}.chat .image img{display:none;height:100%;width:100%;border-radius:var(--rtk-border-radius-sm, 4px);-o-object-fit:cover;object-fit:cover}.chat .image .image-spinner{display:flex;height:100%;width:100%;flex-direction:column;align-items:center;justify-content:center;border-radius:var(--rtk-border-radius-sm, 4px);--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-background-800, 30 30 30) / var(--tw-bg-opacity))}.chat .image .image-spinner rtk-spinner{--tw-text-opacity:1;color:rgba(var(--rtk-colors-brand-500, 33 96 253) / var(--tw-text-opacity))}.chat .image .image-errored{display:flex;height:100%;width:100%;flex-direction:column;align-items:center;justify-content:center;border-radius:var(--rtk-border-radius-sm, 4px);background-color:rgba(var(--rtk-colors-danger, 255 45 45) / 0.1);--tw-text-opacity:1;color:rgba(var(--rtk-colors-danger, 255 45 45) / var(--tw-text-opacity))}.chat .image .actions{display:none;height:var(--rtk-space-8, 32px);align-items:center;position:absolute;top:var(--rtk-space-2, 8px);right:var(--rtk-space-2, 8px);border-radius:var(--rtk-border-radius-sm, 4px);--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-background-900, 26 26 26) / var(--tw-bg-opacity));color:rgb(var(--rtk-colors-text-1000, 255 255 255));overflow:hidden;--tw-shadow:0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);--tw-shadow-colored:0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)}.chat .image .actions .action{height:var(--rtk-space-8, 32px);width:var(--rtk-space-8, 32px);border-radius:var(--rtk-border-radius-none, 0);border-width:var(--rtk-border-width-none, 0);border-style:none;background-color:transparent;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)}.chat .image .actions .action:hover{--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-background-600, 60 60 60) / var(--tw-bg-opacity))}.image.loaded img{display:block}.image.loaded .image-spinner{display:none}.image:hover .actions,.image:focus .actions{display:flex}.chat .file{display:flex;align-items:center;gap:var(--rtk-space-1, 4px);padding-left:var(--rtk-space-2, 8px);padding-right:var(--rtk-space-2, 8px);padding-top:var(--rtk-space-1\\.5, 6px);padding-bottom:var(--rtk-space-1\\.5, 6px);border-radius:var(--rtk-border-radius-sm, 4px);--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-background-700, 44 44 44) / var(--tw-bg-opacity));color:rgb(var(--rtk-colors-text-700, 255 255 255 / 0.64))}.chat .file .file-data{flex:1 1 0%}.chat .file .file-data .name{word-break:break-all;color:rgb(var(--rtk-colors-text-1000, 255 255 255));overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:1}.chat .file .file-data .file-data-split{margin-top:var(--rtk-space-0\\.5, 2px);display:flex;align-items:center;font-size:12px}.chat .file .file-data .file-data-split .ext{margin-right:var(--rtk-space-2, 8px);text-transform:uppercase;overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:1}.chat .file .file-data .file-data-split .divider{height:var(--rtk-space-4, 16px);width:var(--rtk-space-0\\.5, 2px);--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-background-600, 60 60 60) / var(--tw-bg-opacity))}.chat .file .file-data .file-data-split .size{margin-left:var(--rtk-space-2, 8px)}.smallest-dom-element{width:1px}#top-scroll{transform:translateY(20vh)}#bottom-scroll{transform:translateY(-20vh)}a{--tw-text-opacity:1;color:rgba(var(--rtk-colors-brand-300, 73 124 253) / var(--tw-text-opacity));text-decoration-line:none}a:hover{text-decoration-line:underline}.show-new-messages-ctr{pointer-events:none;position:absolute;bottom:var(--rtk-space-2, 8px);right:var(--rtk-space-4, 16px);z-index:10;margin-top:calc(var(--rtk-space-14, 56px) * -1);--tw-translate-y:var(--rtk-space-28, 112px);transform:translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));opacity:0;transition-property:color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, -webkit-backdrop-filter;transition-property:color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter;transition-property:color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter, -webkit-backdrop-filter;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:150ms}.show-new-messages-ctr.active{--tw-translate-y:var(--rtk-space-0, 0px);transform:translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));opacity:1}.show-new-messages{pointer-events:auto;border-radius:9999px}.show-new-messages:hover{border-radius:9999px;--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 #0000);--tw-ring-opacity:1;--tw-ring-color:rgba(var(--rtk-colors-background-600, 60 60 60) / var(--tw-ring-opacity));--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-background-600, 60 60 60) / var(--tw-bg-opacity))}rtk-spinner,.empty-list{margin:auto}.page-wrapper{margin-left:var(--rtk-space-1, 4px);margin-right:var(--rtk-space-1, 4px)}.message-wrapper{margin-bottom:var(--rtk-space-2, 8px)}.pinned .message-wrapper{position:relative}.pinned .pin-icon{position:absolute;right:calc(var(--rtk-space-1, 4px) * -1);top:calc(var(--rtk-space-1, 4px) * -1);display:flex;border-radius:var(--rtk-border-radius-sm, 4px)}.pinned rtk-message-view{--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-background-700, 44 44 44) / var(--tw-bg-opacity));padding-top:var(--rtk-space-1, 4px);padding-bottom:var(--rtk-space-1, 4px)}";var Zc=function(t,e,i,r){var a,s=arguments.length,n=s<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,i,r);else for(var o=t.length-1;o>=0;o--)(a=t[o])&&(n=(s<3?a(n):s>3?a(e,i,n):a(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};const Qc={"Chrome.Desktop.audio":["Chrome1.svg","Chrome2.svg","Chrome3.svg"],"Chrome.Desktop.video":["Chrome1.svg","Chrome2.svg","Chrome3.svg"]},Jc=class{constructor(t){o(this,t),this.stateUpdate=Y(this,"rtkStateUpdate",7),this.t=Fe(),this.iconPack=je,this.currentStep=0,this.svgSteps=[],this.continue=()=>{this.stateUpdate.emit({activePermissionsMessage:{enabled:!1}})},this.reload=()=>{"undefined"!=typeof window&&window.location.reload()},this.getImage=async t=>{function e(t,e,i){return t.split(e).join(i)}const i=await fetch(`https://assets.dyte.io/ui-kit/permissions/${t}`);let r=await i.text();return r=e(r,"yoursite.com",location.host),r=e(r,"Yoursite",document.title.length>14?`${document.title.slice(0,14)}...`:document.title),r},this.nextStep=()=>{this.currentStep=(this.currentStep+1)%this.svgSteps.length},this.openMacSystemSettings=()=>{const t=document.createElement("a");switch(this.mediaType){case"audio":t.href="x-apple.systempreferences:com.apple.preference.security?Privacy_Microphone";break;case"screenshare":t.href="x-apple.systempreferences:com.apple.preference.security?Privacy_ScreenCapture";break;case"video":t.href="x-apple.systempreferences:com.apple.preference.security?Privacy_Camera"}t.click()}}connectedCallback(){this.meetingChanged(this.meeting)}disconnectedCallback(){this.stepsTimer&&clearTimeout(this.stepsTimer)}meetingChanged(t){var e,i,r;if(null!=t){this.device=t.self.device;const a=(null===(e=this.device)||void 0===e?void 0:e.isMobile)?"Mobile":"Desktop",s=null!==(r=Qc[`${null===(i=this.device)||void 0===i?void 0:i.browserName}.${a}.${this.mediaType}`])&&void 0!==r?r:[];Promise.all(s.map(this.getImage)).then((t=>{this.svgSteps=t}))}}getLink(t){let e;switch(t){case"audio":e="microphone";break;case"video":e="camera";break;default:e="screenshare"}let i=`Allow+${e}+access`;if(null!=this.device){const{browserName:t,isMobile:e}=this.device;i+="+"+t,e&&(i+="+mobile")}return"https://www.google.com/search?q="+i}isDeniedBySystem(){var t;const e=null===(t=this.meeting)||void 0===t?void 0:t.self.mediaPermissions;return null!=e&&"SYSTEM_DENIED"===e[this.mediaType]}getTitle(){return this.isDeniedBySystem()?this.t(`perm_sys_denied.${this.mediaType}`):this.t(`perm_denied.${this.mediaType}`)}get mediaType(){var t,e,i;return null!==(i=null===(e=null===(t=this.states)||void 0===t?void 0:t.activePermissionsMessage)||void 0===e?void 0:e.kind)&&void 0!==i?i:"audio"}getMessage(){var t;const{browserName:e,osName:i}=this.meeting.self.device,r=this.isDeniedBySystem(),a=null!==(t=e.toLowerCase())&&void 0!==t?t:"others",s=null!=i?i:"others";if(r){const t=`perm_sys_denied.${this.mediaType}.${s.toLowerCase()}.message`;return this.t(t)===t?this.t(`perm_sys_denied.${this.mediaType}.others.message`):this.t(t)}const n=`perm_denied.${this.mediaType}.${a}.message`;return this.t(n)===n?this.t(`perm_denied.${this.mediaType}.others.message`):this.t(n)}render(){var t,e,i;const r=this.isDeniedBySystem();this.svgSteps.length>0&&(this.stepsTimer&&clearTimeout(this.stepsTimer),this.stepsTimer=setTimeout(this.nextStep,2500));const a=r&&"macOS"==this.meeting.self.device.osName;return N(H,{key:"37bc20fd76370a473d701b99f141057e3ef7b9ea"},N("h2",{key:"5177028bd1d1f909cc5dacffaf7a63e9a90a6119"},N("rtk-icon",{key:"eef420ebb45cedbd63f6f4532954a5175535c07e",class:"text-icon",icon:this.iconPack.warning}),this.getTitle()),this.svgSteps.length>0&&N("div",{key:"1f35d79d6e3b83341a26081fc72540863d395108",class:"svg-container"},this.svgSteps.map(((t,e)=>N("p",{innerHTML:t,class:"svg-ins",key:this.currentStep,hidden:e!==this.currentStep})))),N("div",{key:"855ceb1e53e3006b85d32e0edd9eb0088f94ad75"},this.getMessage()),!r&&N("a",{key:"c02d929f912ed50e47edaf853650e9569c700524",class:"need-help-link",href:this.getLink(null!==(i=null===(e=null===(t=this.states)||void 0===t?void 0:t.activePermissionsMessage)||void 0===e?void 0:e.kind)&&void 0!==i?i:"audio"),target:"_blank",rel:"noreferrer external noreferrer noopener"},N("rtk-icon",{key:"775423666928defb61670cd9a4c2e158fe6386e6",class:"text-icon",icon:this.iconPack.attach}),this.t("cta.help")),N("div",{key:"023b8da610c0afea0abb203ae9d09286b3368ccf",class:"actions"},N("rtk-button",{key:"a2b29cb77e0f32076dc8bf0a72e6b2f512684201",size:"lg",kind:"wide",variant:"secondary",onClick:this.continue},this.t("cta.continue")),a?N("rtk-button",{size:"lg",kind:"wide",onClick:this.openMacSystemSettings},this.t("cta.system_settings")):N("rtk-button",{size:"lg",kind:"wide",onClick:this.reload},this.t("cta.reload"))),N("slot",{key:"2e7d6bcdb64f65de6e73742946a3a173905227a5"}))}static get watchers(){return{meeting:["meetingChanged"]}}};Zc([ai()],Jc.prototype,"meeting",void 0),Zc([ai()],Jc.prototype,"t",void 0),Zc([ai()],Jc.prototype,"iconPack",void 0),Zc([ai()],Jc.prototype,"states",void 0),Jc.style=":host{line-height:initial;font-family:var(--rtk-font-family, sans-serif);font-feature-settings:normal;font-variation-settings:normal}p{margin:var(--rtk-space-0, 0px);padding:var(--rtk-space-0, 0px)}:host{box-sizing:border-box;display:block;max-height:100%;width:600px;overflow-y:auto;padding:var(--rtk-space-6, 24px);border-radius:var(--rtk-border-radius-md, 8px);--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-background-1000, 8 8 8) / var(--tw-bg-opacity));overflow-wrap:break-word;color:rgb(var(--rtk-colors-text-1000, 255 255 255));word-wrap:break-word}.actions{display:flex;align-items:center;gap:var(--rtk-space-2, 8px)}.text-icon{display:inline-block;vertical-align:middle}h2{margin-top:var(--rtk-space-0, 0px);margin-bottom:var(--rtk-space-4, 16px)}h2 .text-icon{margin-right:var(--rtk-space-2, 8px);height:var(--rtk-space-8, 32px);width:var(--rtk-space-8, 32px);--tw-text-opacity:1;color:rgba(var(--rtk-colors-danger, 255 45 45) / var(--tw-text-opacity))}p{margin-top:var(--rtk-space-0, 0px);margin-bottom:var(--rtk-space-0, 0px);margin-bottom:var(--rtk-space-4, 16px)}.need-help-link{margin-top:var(--rtk-space-2, 8px);display:inline-block;text-underline-offset:2px;--tw-text-opacity:1;color:rgba(var(--rtk-colors-brand-400, 53 110 253) / var(--tw-text-opacity))}.need-help-link:hover{--tw-text-opacity:1;color:rgba(var(--rtk-colors-brand-600, 13 81 253) / var(--tw-text-opacity))}a rtk-icon{margin-right:var(--rtk-space-2, 8px);height:var(--rtk-space-5, 20px);width:var(--rtk-space-5, 20px)}:host([size='sm']) .actions{flex-direction:column;align-items:flex-start;justify-content:center}:host([size='sm']) .action{width:100%;padding-top:var(--rtk-space-2, 8px);padding-bottom:var(--rtk-space-2, 8px)}.actions{margin-top:var(--rtk-space-6, 24px)}.actions rtk-button{flex:1 1 0%}.svg-container{display:flex;width:100%;justify-content:center !important}.svg-ins{width:80%;border-radius:var(--rtk-border-radius-md, 8px);--tw-bg-opacity:1;background-color:rgb(255 255 255 / var(--tw-bg-opacity))}";var Xc=function(t,e,i,r){var a,s=arguments.length,n=s<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,i,r);else for(var o=t.length-1;o>=0;o--)(a=t[o])&&(n=(s<3?a(n):s>3?a(e,i,n):a(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};const tl=class{constructor(t){o(this,t),this.iconPack=je,this.size="md"}render(){return N(H,{key:"00275245b6516861bd7cf7788fb81855d6e1ddf7"},N("rtk-icon",{key:"9c77cfa660794fe97c24dbf6e165b4d9b58635de",class:"spinner",icon:this.iconPack.spinner}))}};Xc([ai()],tl.prototype,"iconPack",void 0),Xc([ai()],tl.prototype,"size",void 0),tl.style=":host{line-height:initial;font-family:var(--rtk-font-family, sans-serif);font-feature-settings:normal;font-variation-settings:normal}p{margin:var(--rtk-space-0, 0px);padding:var(--rtk-space-0, 0px)}:host{box-sizing:border-box;display:block;height:var(--rtk-space-10, 40px);width:var(--rtk-space-10, 40px);--rtk-spinner-color:currentColor}.spinner{height:100%;width:100%}@keyframes spin{to{transform:rotate(360deg)}}.spinner{animation:spin 1s linear infinite;border-radius:9999px;background-color:transparent;animation-duration:1.3s}:host([size='md']){height:var(--rtk-space-6, 24px);width:var(--rtk-space-6, 24px)}:host([size='sm']){height:var(--rtk-space-4, 16px);width:var(--rtk-space-4, 16px)}";var el=function(t,e,i,r){var a,s=arguments.length,n=s<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,i,r);else for(var o=t.length-1;o>=0;o--)(a=t[o])&&(n=(s<3?a(n):s>3?a(e,i,n):a(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};const il=class{constructor(t){o(this,t),this.onTextChange=Y(this,"textChange",7),this.disabled=!1,this.rateLimitBreached=!1,this.keyDownHandler=()=>{},this.iconPack=je,this.t=Fe(),this.maxLengthBreached=0,this.onInputHandler=()=>{const t=this.$textArea.value.trim();this.maybeResize(t),this.checkLength(t),this.onTextChange.emit(t)},this.maybeResize=t=>{const e=[...t.matchAll(/\n/g)].length;this.$textArea.style.height=`${Math.min(200,60+20*e)}px`}}componentDidLoad(){this.maxLength&&(this.$textArea.maxLength=this.maxLength);const t=this.$textArea.value.trim();""!==t&&this.maybeResize(t),this.$textArea.focus()}async setText(t,e=!1){this.$textArea.value=t,this.maybeResize(t),e&&this.$textArea.focus(),this.checkLength(t),this.onTextChange.emit(t)}checkLength(t){const e=t.length;e+10>=this.maxLength?this.maxLengthBreached=t.length:e+10<this.maxLength&&this.maxLengthBreached>0&&(this.maxLengthBreached=0)}render(){return N("div",{key:"373afd284088ce6b38267ff5ce7dc1990ffb5020",class:"chat-input",part:"chat-input-container"},this.maxLengthBreached>0&&N("div",{key:"0cedd8f2344b4a1a08a0a106e00f61d1a3c4040d",class:"text-error "+(this.maxLengthBreached===this.maxLength?"breached":"")},N("rtk-icon",{key:"9599a89d22388faa10bb1459867a278cd35f9b8f",id:"warning-indicator",icon:this.iconPack.warning,part:"warning-indicator"})," ",this.maxLengthBreached," / ",this.maxLength," ",this.t("chat.max_limit_warning")),this.rateLimitBreached&&N("div",{key:"7bdb90a61a4040a4ad215ecb69abb589276fcb4e",class:"text-error breached"},N("rtk-icon",{key:"7eaa93a35a6c6ba8128d170199b9f85fd945a25c",id:"warning-indicator",icon:this.iconPack.warning,part:"warning-indicator"})," ",this.t("chat.rate_limit_error")),N("textarea",{key:"1e73b93e138af069315431896e85a4cf11ab53a0",ref:t=>this.$textArea=t,placeholder:this.placeholder,disabled:this.disabled,onInput:this.onInputHandler,onKeyDown:this.keyDownHandler,part:"chat-input",value:this.value}))}};el([ai()],il.prototype,"iconPack",void 0),el([ai()],il.prototype,"t",void 0),il.style=".chat-input {\n position: relative;\n z-index: 10;\n box-sizing: border-box;\n display: flex;\n flex-direction: column;\n border-top-left-radius: var(--rtk-border-radius-md, 8px);\n border-top-right-radius: var(--rtk-border-radius-md, 8px)\n}\n\n .chat-input textarea {\n --tw-bg-opacity: 1;\n background-color: rgba(var(--rtk-colors-background-800, 30 30 30) / var(--tw-bg-opacity));\n box-sizing: border-box;\n padding: var(--rtk-space-3, 12px);\n color: rgb(var(--rtk-colors-text-1000, 255 255 255))\n}\n\n .chat-input textarea::-moz-placeholder {\n color: rgb(var(--rtk-colors-text-1000, 255 255 255))\n}\n\n .chat-input textarea::placeholder {\n color: rgb(var(--rtk-colors-text-1000, 255 255 255))\n}\n\n .chat-input textarea {\n font-family: var(--rtk-font-family, sans-serif);\n outline: 2px solid transparent;\n outline-offset: 2px;\n resize: none;\n overflow-y: auto;\n border-width: var(--rtk-border-width-none, 0);\n border-style: none;\n min-height: 60px;\n font-size: 14px\n}\n\n@container chatcontainer (height < 360px) {\n textarea {\n height: 30px !important;\n min-height: 30px !important\n }\n}\n\n.text-error {\n left: var(--rtk-space-0, 0px);\n z-index: 10;\n margin-top: var(--rtk-space-1, 4px);\n margin-left: var(--rtk-space-1, 4px);\n display: flex;\n width: -moz-fit-content;\n width: fit-content;\n align-items: center;\n justify-content: flex-start;\n border-radius: var(--rtk-border-radius-sm, 4px);\n --tw-border-opacity: 1;\n border-color: rgba(var(--rtk-colors-warning, 255 205 7) / var(--tw-border-opacity));\n --tw-bg-opacity: 1;\n background-color: rgba(var(--rtk-colors-background-600, 60 60 60) / var(--tw-bg-opacity));\n padding-left: var(--rtk-space-2, 8px);\n padding-right: var(--rtk-space-2, 8px);\n font-size: 12px;\n font-weight: 600;\n --tw-text-opacity: 1;\n color: rgba(var(--rtk-colors-warning, 255 205 7) / var(--tw-text-opacity));\n border: 1px solid\n}\n\n#warning-indicator {\n margin-right: var(--rtk-space-1, 4px);\n height: var(--rtk-space-3, 12px);\n width: var(--rtk-space-3, 12px)\n}\n\n.text-error.breached {\n --tw-border-opacity: 1;\n border-color: rgba(var(--rtk-colors-danger, 255 45 45) / var(--tw-border-opacity));\n --tw-text-opacity: 1;\n color: rgba(var(--rtk-colors-danger, 255 45 45) / var(--tw-text-opacity))\n}";var rl=function(t,e,i,r){var a,s=arguments.length,n=s<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,i,r);else for(var o=t.length-1;o>=0;o--)(a=t[o])&&(n=(s<3?a(n):s>3?a(e,i,n):a(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};const al=class{constructor(t){o(this,t),this.now=new Date,this.isContinued=!1,this.iconPack=je,this.t=Fe(),this.showBubble=!1}render(){return N(H,{key:"128a6e757cf71a11aef8c93749b6388cee1a65d3"},!this.isContinued&&N(Ji,{key:"35fd68c340c5133b3940bc5a200aaed48f366a0e",name:this.message.displayName,time:this.message.time,now:this.now}),N("div",{key:"189244910e2511399a9dcb57647d7c63ed918712",class:{body:!0,bubble:this.showBubble},part:"body"},N("div",{key:"2b949b44c13aae1295c01aaa3915bcd45381447a",class:{text:!0,emoji:Je(this.message.message)}},N(Qn,{key:"3659ef1412e9731352a3270cf2815a9fa78018fb",message:this.message.message}))))}};rl([ai()],al.prototype,"iconPack",void 0),rl([ai()],al.prototype,"t",void 0);const sl=class{constructor(t){o(this,t),this.isMarkdown=!1}render(){return N("p",{key:"d14082ad02e2d2aaf5e325a95c1bc36595e9e33d",class:{text:!0,emoji:Je(this.text)}},this.isMarkdown?N("rtk-markdown-view",{text:this.text}):this.text)}};sl.style=":host{line-height:initial;font-family:var(--rtk-font-family, sans-serif);font-feature-settings:normal;font-variation-settings:normal}p{margin:var(--rtk-space-0, 0px);padding:var(--rtk-space-0, 0px)}.text{word-break:break-word;display:block;overflow-wrap:break-word;line-height:1.375}.text.emoji{font-size:24px}";const nl=class{constructor(t){o(this,t),this.openChange=Y(this,"rtkOpenChange",7),this.label="",this.variant="secondary",this.disabled=!1,this.open=!1,this.kind="inline",this.placement="top",this.delay=0,this.isInFocus=!1,this.showMenu=()=>{this.disabled||(this.isInFocus=!0,setTimeout((()=>{this.isInFocus&&(this.tooltipEl.style.display="block",this.update(),this.openChange.emit(!0),"sm"===this.size&&setTimeout((()=>{this.isInFocus&&this.hideMenu()}),1e3))}),this.delay))},this.hideMenu=()=>{this.open||this.disabled||(this.isInFocus=!1,this.tooltipEl.style.display="none",this.openChange.emit(!1))}}componentDidLoad(){this.triggerEl.addEventListener("focusin",this.showMenu),this.triggerEl.addEventListener("mouseenter",this.showMenu),this.triggerEl.addEventListener("focusout",this.hideMenu),this.triggerEl.addEventListener("mouseleave",this.hideMenu),C((()=>{this.openChanged(this.open)}))}disconnectedCallback(){this.triggerEl&&(this.triggerEl.removeEventListener("focusin",this.showMenu),this.triggerEl.removeEventListener("mouseenter",this.showMenu),this.triggerEl.removeEventListener("focusout",this.hideMenu),this.triggerEl.removeEventListener("mouseleave",this.hideMenu),this.triggerEl=void 0)}openChanged(t){t?this.showMenu():this.hideMenu()}update(){Yn(this.triggerEl,this.tooltipEl,{placement:this.placement,middleware:[Hn(8),qn(),Vn({padding:5}),Wn({element:this.arrowEl})]}).then((({x:t,y:e,placement:i,middlewareData:r})=>{Object.assign(this.tooltipEl.style,{left:`${t}px`,top:`${e}px`});const{x:a,y:s}=r.arrow,n={top:"bottom",right:"left",bottom:"top",left:"right"}[i.split("-")[0]];Object.assign(this.arrowEl.style,{left:null!=a?`${a}px`:"",top:null!=s?`${s}px`:"",right:"",bottom:"",[n]:"-4px"})}))}render(){return N(H,{key:"b43646b89b257321a382838a8c5f2ea0d3e5e122"},N("span",{key:"aa18e85265cc75e7d08a06d469a8bb10ccecdb56",part:"trigger",id:"trigger",ref:t=>this.triggerEl=t},N("slot",{key:"a422fbefd999ff26a30a7e03f6e14d84397cff88"})),N("div",{key:"593b5ec328f127c349ae0a92d36c6261e5abcb7a",part:"tooltip",class:"tooltip",id:"tooltip",role:"tooltip",ref:t=>this.tooltipEl=t},N("div",{key:"c25e6a54940097ebd880c9b9e8fc2b4d48677989",id:"arrow",ref:t=>this.arrowEl=t,part:"arrow"}),this.label,N("slot",{key:"cd8415e9fa2c1eaeffa8c7ec4ffcc6dd34fc04fa",name:"tooltip"})))}static get watchers(){return{open:["openChanged"]}}};!function(t,e,i,r){var a,s=arguments.length,n=s<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,i,r);else for(var o=t.length-1;o>=0;o--)(a=t[o])&&(n=(s<3?a(n):s>3?a(e,i,n):a(e,i))||n);s>3&&n&&Object.defineProperty(e,i,n)}([ai()],nl.prototype,"size",void 0),nl.style=":host{line-height:initial;font-family:var(--rtk-font-family, sans-serif);font-feature-settings:normal;font-variation-settings:normal}p{margin:var(--rtk-space-0, 0px);padding:var(--rtk-space-0, 0px)}:host{--background-color:var(--rtk-tooltip-background-color, rgb(var(--rtk-colors-background-600, 60 60 60)));--color:var(--rtk-tooltip-color, rgb(var(--rtk-colors-text-1000, 255 255 255)));display:inline-flex}#trigger{display:block;width:100%;flex:1 1 0%}.tooltip{max-width:var(--rtk-space-64, 256px);position:fixed;z-index:20;display:none;width:-moz-max-content;width:max-content;padding-left:var(--rtk-space-2, 8px);padding-right:var(--rtk-space-2, 8px);padding-top:var(--rtk-space-1, 4px);padding-bottom:var(--rtk-space-1, 4px);border-radius:var(--rtk-border-radius-sm, 4px);--tw-shadow:0 1px 2px 0 rgb(0 0 0 / 0.05);--tw-shadow-colored:0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);font-size:12px}.tooltip,#arrow{position:absolute;background-color:var(--background-color);color:var(--color)}#arrow{position:absolute;height:var(--rtk-space-2, 8px);width:var(--rtk-space-2, 8px);transform:rotate(45deg)}:host([variant='primary']){--background-color:rgb(var(--rtk-colors-brand-500, 33 96 253));--color:rgb(var(--rtk-colors-text-on-brand-1000, var(--rtk-colors-text-1000, 255 255 255)))}:host([kind='block']){display:block}";var ol=Object.freeze({__proto__:null,rtk_avatar:eo,rtk_breakout_room_manager:ro,rtk_breakout_room_participants:so,rtk_breakout_rooms_manager:oo,rtk_broadcast_message_modal:lo,rtk_button:ho,rtk_channel_creator:go,rtk_channel_details:fo,rtk_channel_header:vo,rtk_channel_selector_view:ko,rtk_chat:wo,rtk_chat_composer_view:Po,rtk_chat_message:Eo,rtk_chat_messages_ui:Lo,rtk_chat_messages_ui_paginated:Ro,rtk_chat_search_results:Do,rtk_confirmation_modal:Io,rtk_counter:Uo,rtk_debugger:Fo,rtk_debugger_audio:qo,rtk_debugger_screenshare:Wo,rtk_debugger_system:Zo,rtk_debugger_video:Jo,rtk_dialog:tc,rtk_dialog_manager:ic,rtk_draft_attachment_view:ac,rtk_emoji_picker:oc,rtk_emoji_picker_button:lc,rtk_file_message:hc,rtk_file_message_view:pc,rtk_file_picker_button:uc,rtk_icon:mc,rtk_image_message:bc,rtk_image_message_view:yc,rtk_join_stage:xc,rtk_leave_meeting:Pc,rtk_logo:Ec,rtk_markdown_view:Tc,rtk_meeting:_c,rtk_menu:Ac,rtk_menu_item:Mc,rtk_menu_list:Oc,rtk_message_view:Uc,rtk_mute_all_confirmation:Fc,rtk_notification:zc,rtk_notifications:Vc,rtk_overlay_modal:Kc,rtk_paginated_list:Yc,rtk_permissions_message:Jc,rtk_spinner:tl,rtk_text_composer_view:il,rtk_text_message:al,rtk_text_message_view:sl,rtk_tooltip:nl});var cl=function(t,e,i,r){var a,s=arguments.length,n=s<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,i,r);else for(var o=t.length-1;o>=0;o--)(a=t[o])&&(n=(s<3?a(n):s>3?a(e,i,n):a(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};const ll=class{constructor(t){o(this,t),this.stateUpdate=Y(this,"rtkStateUpdate",7),this.config=De,this.iconPack=je,this.t=Fe(),this.view="sidebar",this.close=()=>{this.stateUpdate.emit({activeAI:!1})}}connectedCallback(){this.viewChanged(this.view)}disconnectedCallback(){this.keydownListener&&document.removeEventListener("keydown",this.keydownListener)}viewChanged(t){"full-screen"===t&&(this.keydownListener=t=>{"Escape"===t.key&&this.close()},document.addEventListener("keydown",this.keydownListener))}render(){var t,e,i;if(!(null===(e=null===(t=this.meeting)||void 0===t?void 0:t.self)||void 0===e?void 0:e.permissions).transcriptionEnabled||!(null===(i=this.states)||void 0===i?void 0:i.activeAI))return null;const r={meeting:this.meeting,config:this.config,states:this.states,size:this.size,t:this.t,iconPack:this.iconPack};return N(H,null,N("h3",{class:"title"},this.t("ai.transcriptions")),N("rtk-button",{variant:"ghost",kind:"icon",class:"close",onClick:this.close,"aria-label":this.t("close")},N("rtk-icon",{icon:this.iconPack.dismiss})),N("rtk-ai-transcriptions",Object.assign({},r)))}static get watchers(){return{view:["viewChanged"]}}};cl([ai()],ll.prototype,"meeting",void 0),cl([ai()],ll.prototype,"states",void 0),cl([ai()],ll.prototype,"iconPack",void 0),cl([ai()],ll.prototype,"t",void 0),cl([ai()],ll.prototype,"size",void 0),ll.style=":host{line-height:initial;font-family:var(--rtk-font-family, sans-serif);font-feature-settings:normal;font-variation-settings:normal}p{margin:var(--rtk-space-0, 0px);padding:var(--rtk-space-0, 0px)}:host{position:relative;box-sizing:border-box;display:flex;width:100%;max-width:var(--rtk-space-80, 320px);flex-direction:column;--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-background-1000, 8 8 8) / var(--tw-bg-opacity));color:rgb(var(--rtk-colors-text-1000, 255 255 255));overflow:hidden}.close{position:absolute;top:var(--rtk-space-3, 12px);left:var(--rtk-space-3, 12px)}.title{margin-left:var(--rtk-space-0, 0px);margin-right:var(--rtk-space-0, 0px);margin-top:var(--rtk-space-4, 16px);margin-bottom:var(--rtk-space-2, 8px);-webkit-user-select:none;-moz-user-select:none;user-select:none;padding:var(--rtk-space-0, 0px);text-align:center;font-size:14px;font-weight:400}rtk-ai-transcriptions{flex:1}:host([view='sidebar']){margin-left:var(--rtk-space-2, 8px);margin-right:var(--rtk-space-2, 8px);border-radius:var(--rtk-border-radius-lg, 12px);--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-background-900, 26 26 26) / var(--tw-bg-opacity))}:host([view='full-screen']){position:absolute;top:var(--rtk-space-0, 0px);right:var(--rtk-space-0, 0px);bottom:var(--rtk-space-0, 0px);left:var(--rtk-space-0, 0px);z-index:50;max-width:100%;border:none}";var dl=Object.freeze({__proto__:null,rtk_ai:ll});var hl=function(t,e,i,r){var a,s=arguments.length,n=s<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,i,r);else for(var o=t.length-1;o>=0;o--)(a=t[o])&&(n=(s<3?a(n):s>3?a(e,i,n):a(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};const pl=class{constructor(t){o(this,t),this.stateUpdate=Y(this,"rtkStateUpdate",7),this.variant="button",this.iconPack=je,this.t=Fe(),this.aiActive=!1}statesChanged(t){const e=t;this.aiActive=e.activeAI}toggleAI(){var t;this.aiActive=!(null===(t=this.states)||void 0===t?void 0:t.activeAI),this.stateUpdate.emit({activeAI:this.aiActive,activeMoreMenu:!1,activeSidebar:!1})}render(){var t,e;const i=this.t("ai.meeting_ai");return(null===(e=null===(t=this.meeting)||void 0===t?void 0:t.self)||void 0===e?void 0:e.permissions).transcriptionEnabled?N(H,{title:i},N("rtk-controlbar-button",{part:"controlbar-button",size:this.size,iconPack:this.iconPack,class:{active:this.aiActive},onClick:()=>this.toggleAI(),icon:this.iconPack.meeting_ai,label:i,variant:this.variant,brandIcon:!0})):N(H,{"data-hidden":!0})}static get watchers(){return{states:["statesChanged"]}}};hl([ai()],pl.prototype,"states",void 0),hl([ai()],pl.prototype,"meeting",void 0),hl([ai()],pl.prototype,"size",void 0),hl([ai()],pl.prototype,"iconPack",void 0),hl([ai()],pl.prototype,"t",void 0),pl.style=":host{display:block}:host([data-hidden]){display:none}";var gl=Object.freeze({__proto__:null,rtk_ai_toggle:pl});var ul=function(t,e,i,r){var a,s=arguments.length,n=s<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,i,r);else for(var o=t.length-1;o>=0;o--)(a=t[o])&&(n=(s<3?a(n):s>3?a(e,i,n):a(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};const fl=class{constructor(t){o(this,t),this.iconPack=je,this.t=Fe(),this.hideSelf=!1,this.activeParticipants=[],this.onStageParticipants=[],this.offStageParticipants=[],this.onParticipantListUpdate=()=>{if(!this.meeting)return;let t=this.meeting.participants.active.toArray();this.hideSelf||(t=[...t,this.meeting.self]);let e=this.meeting.participants.joined.toArray().filter((e=>!t.some((t=>t.id===e.id))));this.activeParticipants=t,this.onStageParticipants=e}}connectedCallback(){this.meetingChanged(this.meeting)}meetingChanged(t){t&&"AUDIO_ROOM"===t.self.config.viewType&&(this.onParticipantListUpdate(),t.participants.active.addListener("participantJoined",this.onParticipantListUpdate),t.participants.active.addListener("participantLeft",this.onParticipantListUpdate),t.participants.joined.addListener("participantJoined",this.onParticipantListUpdate),t.participants.joined.addListener("participantLeft",this.onParticipantListUpdate))}disconnectedCallback(){this.resizeObserver.disconnect(),this.resizeObserver=void 0,this.meeting.participants.active.removeListener("participantJoined",this.onParticipantListUpdate),this.meeting.participants.active.removeListener("participantLeft",this.onParticipantListUpdate),this.meeting.participants.joined.removeListener("participantJoined",this.onParticipantListUpdate),this.meeting.participants.joined.removeListener("participantLeft",this.onParticipantListUpdate)}renderGrid(t=[]){const e={meeting:this.meeting,size:this.size,config:this.config,t:this.t,iconPack:this.iconPack,states:this.states};return t.map((t=>N(rr,{element:"rtk-audio-tile",defaults:e,props:{key:t.id,participant:t},childProps:{participant:t},deepProps:!0})))}render(){const t=this.activeParticipants.concat(this.onStageParticipants);return N(H,{key:"0547c2c61b1c1b1fc4fcc5353b9094f8c118bd83"},N("div",{key:"46dd0248db3437461bd56bd507a2f42ce05af03a",class:"content scrollbar"},N("div",{key:"98a3dc4928c3062f3e5058b50d415f147c273c26",class:"stage grid"},this.renderGrid(t)),this.offStageParticipants.length>0&&N("div",{key:"18015fe551647048c990f107ba313c5e13ba7d47",class:"waitlist-area"},N("div",{key:"50a65d4f48d94426860d808ff6151d3e0d519f4e",class:"listening-title"},this.offStageParticipants.length," ",this.t("grid.listening")),N("div",{key:"173e4ebc97425b7298236673122f76ebfae59609",class:"waitlist-grid grid"},this.renderGrid(this.offStageParticipants)))),N("slot",{key:"c92a12329a9c4c456f3506cee2aa2d73dceaa0e0"}))}get host(){return W(this)}static get watchers(){return{meeting:["meetingChanged"]}}};ul([ai()],fl.prototype,"meeting",void 0),ul([ai()],fl.prototype,"states",void 0),ul([ai()],fl.prototype,"iconPack",void 0),ul([ai()],fl.prototype,"size",void 0),ul([ai()],fl.prototype,"t",void 0),fl.style=":host{line-height:initial;font-family:var(--rtk-font-family, sans-serif);font-feature-settings:normal;font-variation-settings:normal}p{margin:var(--rtk-space-0, 0px);padding:var(--rtk-space-0, 0px)}.scrollbar{scrollbar-width:thin;scrollbar-color:var(--rtk-scrollbar-color, rgb(var(--rtk-colors-background-600, 60 60 60)))\n var(--rtk-scrollbar-background, transparent)}.scrollbar::-webkit-scrollbar{height:var(--rtk-space-1\\.5, 6px);width:var(--rtk-space-1\\.5, 6px);border-radius:9999px;background-color:var(--rtk-scrollbar-background, transparent)}.scrollbar::-webkit-scrollbar-thumb{border-radius:9999px;background-color:var(--rtk-scrollbar-color, rgb(var(--rtk-colors-background-600, 60 60 60)))}:host{position:relative;height:100%;width:100%;box-sizing:border-box}.content{position:relative;display:flex;height:100%;width:100%;flex-direction:column;overflow-y:auto}.waitlist-area{display:flex;flex-direction:column;--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-background-800, 30 30 30) / var(--tw-bg-opacity))}.listening-title{text-align:center;margin-top:var(--rtk-space-5, 20px);margin-bottom:var(--rtk-space-4, 16px)}.waitlist-grid{flex:1 1 0%}.grid{box-sizing:border-box;flex:1 1 0%;gap:var(--rtk-space-6, 24px);display:flex;align-content:center;justify-content:center;flex-wrap:wrap}:host([size='md']) .grid{gap:var(--rtk-space-4, 16px)}:host([size='sm']) .grid{gap:var(--rtk-space-3, 12px)}rtk-audio-tile{aspect-ratio:1 / 1;flex:none;width:calc(20%);max-width:var(--rtk-space-48, 192px);transition:all 0.3s}rtk-audio-tile[size='md']{width:100%;max-width:var(--rtk-space-36, 144px)}rtk-audio-tile[size='sm']{width:100%;max-width:var(--rtk-space-24, 96px)}";var ml=Object.freeze({__proto__:null,rtk_audio_grid:fl}),vl=bl;function bl(){}bl.mixin=function(t){var e=t.prototype||t;e.isWildEmitter=!0,e.on=function(t,e,i){this.callbacks=this.callbacks||{};var r=3===arguments.length,a=r?arguments[1]:void 0,s=r?arguments[2]:arguments[1];return s._groupName=a,(this.callbacks[t]=this.callbacks[t]||[]).push(s),this},e.once=function(t,e,i){var r=this,a=3===arguments.length,s=a?arguments[1]:void 0,n=a?arguments[2]:arguments[1];return this.on(t,s,(function e(){r.off(t,e),n.apply(this,arguments)})),this},e.releaseGroup=function(t){var e,i,r,a;for(e in this.callbacks=this.callbacks||{},this.callbacks)for(i=0,r=(a=this.callbacks[e]).length;i<r;i++)a[i]._groupName===t&&(a.splice(i,1),i--,r--);return this},e.off=function(t,e){this.callbacks=this.callbacks||{};var i,r=this.callbacks[t];return r?1===arguments.length?(delete this.callbacks[t],this):(-1!==(i=r.indexOf(e))&&(r.splice(i,1),0===r.length&&delete this.callbacks[t]),this):this},e.emit=function(t){this.callbacks=this.callbacks||{};var e,i,r,a=[].slice.call(arguments,1),s=this.callbacks[t],n=this.getWildcardCallbacks(t);if(s)for(e=0,i=(r=s.slice()).length;e<i&&r[e];++e)r[e].apply(this,a);if(n)for(i=n.length,e=0,i=(r=n.slice()).length;e<i&&r[e];++e)r[e].apply(this,[t].concat(a));return this},e.getWildcardCallbacks=function(t){this.callbacks=this.callbacks||{};var e,i,r=[];for(e in this.callbacks)i=e.split("*"),("*"===e||2===i.length&&t.slice(0,i[0].length)===i[0])&&(r=r.concat(this.callbacks[e]));return r}},bl.mixin(bl);var kl,yl=vl;"undefined"!=typeof window&&(kl=window.AudioContext||window.webkitAudioContext);var wl=null,xl=function(t,e){var i=new yl;if(!kl)return i;var r,a,s,n=(e=e||{}).smoothing||.1,o=e.interval||50,c=e.threshold,l=e.play,d=e.history||10,h=!0;wl=e.audioContext||wl||new kl,(s=wl.createAnalyser()).fftSize=512,s.smoothingTimeConstant=n,a=new Float32Array(s.frequencyBinCount),t.jquery&&(t=t[0]),t instanceof HTMLAudioElement||t instanceof HTMLVideoElement?(r=wl.createMediaElementSource(t),void 0===l&&(l=!0),c=c||-50):(r=wl.createMediaStreamSource(t),c=c||-50),r.connect(s),l&&s.connect(wl.destination),i.speaking=!1,i.suspend=function(){return wl.suspend()},i.resume=function(){return wl.resume()},Object.defineProperty(i,"state",{get:function(){return wl.state}}),wl.onstatechange=function(){i.emit("state_change",wl.state)},i.setThreshold=function(t){c=t},i.setInterval=function(t){o=t},i.stop=function(){h=!1,i.emit("volume_change",-100,c),i.speaking&&(i.speaking=!1,i.emit("stopped_speaking")),s.disconnect(),r.disconnect()},i.speakingHistory=[];for(var p=0;p<d;p++)i.speakingHistory.push(0);var g=function(){setTimeout((function(){if(h){var t=function(t,e){var i=-1/0;t.getFloatFrequencyData(e);for(var r=4,a=e.length;r<a;r++)e[r]>i&&e[r]<0&&(i=e[r]);return i}(s,a);i.emit("volume_change",t,c);var e=0;if(t>c&&!i.speaking){for(var r=i.speakingHistory.length-3;r<i.speakingHistory.length;r++)e+=i.speakingHistory[r];e>=2&&(i.speaking=!0,i.emit("speaking"))}else if(t<c&&i.speaking){for(r=0;r<i.speakingHistory.length;r++)e+=i.speakingHistory[r];0==e&&(i.speaking=!1,i.emit("stopped_speaking"))}i.speakingHistory.shift(),i.speakingHistory.push(0+(t>c)),g()}}),o)};return g(),i};var Sl=function(t,e,i,r){var a,s=arguments.length,n=s<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,i,r);else for(var o=t.length-1;o>=0;o--)(a=t[o])&&(n=(s<3?a(n):s>3?a(e,i,n):a(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};const Pl=class{constructor(t){o(this,t),this.iconPack=je,this.t=Fe(),this.audioEnabled=!1,this.volume=0,this.onAudioUpdate=({audioEnabled:t,audioTrack:e})=>{if(this.participant)if(t&&e){const t=new MediaStream;t.addTrack(e),this.calcVolume(t),this.audioEnabled=!0}else this.volume=0,this.audioEnabled=!1}}connectedCallback(){this.participantChanged(this.participant)}disconnectedCallback(){var t,e;null===(t=this.hark)||void 0===t||t.stop(),null===(e=this.participant)||void 0===e||e.removeListener("audioUpdate",this.onAudioUpdate)}participantChanged(t){t&&(this.audioEnabled=t.audioEnabled,t.addListener("audioUpdate",this.onAudioUpdate))}calcVolume(t){this.hark=xl(t,{play:!1,interval:100}),this.hark.on("volume_change",(t=>{const e=this.volume;let i=Math.round(10**(t/115)*10);i<3&&(i=0);let r=Math.round((2*e+i)/3);e!==r&&(this.volume=r)}))}render(){const t={meeting:this.meeting,size:this.size,config:this.config,states:this.states,iconPack:this.iconPack,t:this.t};let e="bar-0";return e=this.volume>5?"bar-5":this.volume<0?"bar-0":"bar-"+this.volume,N(H,{key:"cff0c840f6dcd8ae6514ee4b8b0c6680d4ebf8ff"},N("div",{key:"c43dbfcc26c20d0d7487a234624709ad9bf14f6f",class:{"avatar-ctr":!0,speaking:this.audioEnabled,[e]:!0}},N("rtk-avatar",{key:"5a638ea3a636f645eaab2638353fb49697a431c0",participant:this.participant,size:this.size},!this.audioEnabled&&N("div",{key:"f8a6bc0a24906df10870c827faeca7f8f343306a",class:"mic-icon"},N("rtk-icon",{key:"a7777ba5bb5b78329556b6af19495425827915ec",icon:je.mic_off})))),N("rtk-name-tag",Object.assign({key:"a7d4bea44bfde23323e52917ee197c5558cef8ba",variant:"text",participant:this.participant},t)),N("slot",{key:"370b16462a7be42a663a58288105ad46c0e6f3d3"}))}static get watchers(){return{participant:["participantChanged"]}}};Sl([ai()],Pl.prototype,"meeting",void 0),Sl([ai()],Pl.prototype,"size",void 0),Sl([ai()],Pl.prototype,"states",void 0),Sl([ai()],Pl.prototype,"iconPack",void 0),Sl([ai()],Pl.prototype,"t",void 0),Pl.style=":host{line-height:initial;font-family:var(--rtk-font-family, sans-serif);font-feature-settings:normal;font-variation-settings:normal}p{margin:var(--rtk-space-0, 0px);padding:var(--rtk-space-0, 0px)}:host{box-sizing:border-box;display:flex;flex-direction:column}.avatar-ctr{box-sizing:border-box;width:100%;flex:1 1 0%;padding:var(--rtk-space-1\\.5, 6px);border:2px solid transparent;border-radius:calc(var(--rtk-border-radius-xl, 40px) + var(--rtk-space-1\\.5, 6px))}.avatar-ctr.speaking{--tw-border-opacity:1;border-color:rgba(var(--rtk-colors-brand-500, 33 96 253) / var(--tw-border-opacity));transition-property:box-shadow;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:150ms}.bar-0{box-shadow:none}.bar-1{box-shadow:0 0 4px rgb(var(--rtk-colors-brand-500, 33 96 253))}.bar-2{box-shadow:0 0 8px rgb(var(--rtk-colors-brand-500, 33 96 253))}.bar-3{box-shadow:0 0 16px 1px rgb(var(--rtk-colors-brand-500, 33 96 253))}.bar-4{box-shadow:0 0 20px 3px rgb(var(--rtk-colors-brand-500, 33 96 253))}.bar-5{box-shadow:0 0 24px 6px rgb(var(--rtk-colors-brand-500, 33 96 253))}rtk-avatar{aspect-ratio:1 / 1;height:100%;width:100%;position:relative;border-radius:var(--rtk-border-radius-xl, 40px)}rtk-name-tag{display:block;height:var(--rtk-space-10, 40px);width:100%;text-align:center;line-height:2.5rem}:host([size='sm']) .avatar-ctr{border-radius:calc(var(--rtk-border-radius-lg, 12px) + var(--rtk-space-1\\.5, 6px))}:host([size='sm']) rtk-name-tag{height:var(--rtk-space-7, 28px);line-height:1.75rem}:host([size='sm']) rtk-avatar{border-radius:var(--rtk-border-radius-lg, 12px)}.mic-icon{position:absolute;bottom:calc(var(--rtk-space-1, 4px) * -1);right:calc(var(--rtk-space-1, 4px) * -1);border-radius:9999px;--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-background-600, 60 60 60) / var(--tw-bg-opacity));padding:var(--rtk-space-2, 8px);color:rgb(var(--rtk-colors-text-1000, 255 255 255));--tw-shadow:0 1px 2px 0 rgb(0 0 0 / 0.05);--tw-shadow-colored:0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)}.mic-icon rtk-icon{height:var(--rtk-space-7, 28px);width:var(--rtk-space-7, 28px)}:host([size='sm']) .mic-icon rtk-icon{height:var(--rtk-space-4, 16px);width:var(--rtk-space-4, 16px)}:host([size='md']) .mic-icon rtk-icon{height:var(--rtk-space-5, 20px);width:var(--rtk-space-5, 20px)}";var Cl=Object.freeze({__proto__:null,rtk_audio_tile:Pl});var El=function(t,e,i,r){var a,s=arguments.length,n=s<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,i,r);else for(var o=t.length-1;o>=0;o--)(a=t[o])&&(n=(s<3?a(n):s>3?a(e,i,n):a(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};const Tl=class{constructor(t){o(this,t),this.stateUpdate=Y(this,"rtkStateUpdate",7),this.variant="button",this.iconPack=je,this.t=Fe(),this.canToggle=!1,this.permissionsUpdateListener=()=>{this.canToggle=ge(this.meeting)},this.breakoutRoomToggle=()=>{var t,e;const i=this.meeting.connectedMeetings.isActive?"view":"create";this.stateUpdate.emit({activeBreakoutRoomsManager:{active:!(null===(e=null===(t=this.states)||void 0===t?void 0:t.activeBreakoutRoomsManager)||void 0===e?void 0:e.active),mode:i}})}}connectedCallback(){this.meetingChanged(this.meeting)}disconnectedCallback(){var t,e,i;null===(i=null===(e=null===(t=this.meeting)||void 0===t?void 0:t.self)||void 0===e?void 0:e.permissions)||void 0===i||i.off("permissionsUpdate",this.permissionsUpdateListener)}meetingChanged(t){t&&(this.canToggle=ge(t),t.self.permissions.on("permissionsUpdate",this.permissionsUpdateListener))}render(){if(this.canToggle)return N(H,{title:this.t("breakout_rooms")},N("rtk-controlbar-button",{part:"controlbar-button",size:this.size,iconPack:this.iconPack,onClick:this.breakoutRoomToggle,icon:this.iconPack.breakout_rooms,label:this.t("breakout_rooms"),variant:this.variant}))}static get watchers(){return{meeting:["meetingChanged"]}}};El([ai()],Tl.prototype,"meeting",void 0),El([ai()],Tl.prototype,"states",void 0),El([ai()],Tl.prototype,"size",void 0),El([ai()],Tl.prototype,"iconPack",void 0),El([ai()],Tl.prototype,"t",void 0),Tl.style=":host{line-height:initial;font-family:var(--rtk-font-family, sans-serif);font-feature-settings:normal;font-variation-settings:normal}p{margin:var(--rtk-space-0, 0px);padding:var(--rtk-space-0, 0px)}:host{display:block}";var Ll=Object.freeze({__proto__:null,rtk_breakout_rooms_toggle:Tl});var _l=function(t,e,i,r){var a,s=arguments.length,n=s<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,i,r);else for(var o=t.length-1;o>=0;o--)(a=t[o])&&(n=(s<3?a(n):s>3?a(e,i,n):a(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};const Rl=class{constructor(t){o(this,t),this.stateUpdate=Y(this,"rtkStateUpdate",7),this.videoUpdateListener=({videoEnabled:t})=>{this.videoEnabled=t},this.stageStatusListener=()=>{this.stageStatus=this.meeting.stage.status,this.canProduceVideo="ALLOWED"===this.meeting.self.permissions.canProduceVideo},this.mediaPermissionUpdateListener=({kind:t,message:e})=>{"video"===t&&(this.cameraPermission=e)},this.meetingPermissionsUpdateListener=t=>{var e;(null===(e=null==t?void 0:t.media)||void 0===e?void 0:e.video)&&(this.canProduceVideo="ALLOWED"===this.meeting.self.permissions.canProduceVideo)},this.variant="button",this.iconPack=je,this.t=Fe(),this.videoEnabled=!1,this.canProduceVideo=!1,this.cameraPermission="NOT_REQUESTED",this.stageStatus="OFF_STAGE",this.toggleCamera=()=>{var t,e,i,r,a,s,n,o,c,l,d;if(null===(t=this.meeting)||void 0===t||t.__internals__.logger.info("rtkCameraToggle::toggleCamera",{media:{video:{enabled:Boolean(null===(i=null===(e=this.meeting)||void 0===e?void 0:e.self)||void 0===i?void 0:i.videoEnabled),permission:this.cameraPermission,canProduce:null===(s=null===(a=null===(r=this.meeting)||void 0===r?void 0:r.self)||void 0===a?void 0:a.permissions)||void 0===s?void 0:s.canProduceVideo}},webinar:{stageStatus:null===(n=this.meeting)||void 0===n?void 0:n.stage.status},livestream:{stageStatus:null===(c=null===(o=this.meeting)||void 0===o?void 0:o.stage)||void 0===c?void 0:c.status},moduleExists:{self:Boolean(null===(l=this.meeting)||void 0===l?void 0:l.self)}}),this.hasPermissionError()){const t={enabled:!0,kind:"video"};return this.stateUpdate.emit({activePermissionsMessage:t}),!1}const h=null===(d=this.meeting)||void 0===d?void 0:d.self;null!=h&&this.canProduceVideo&&(h.videoEnabled?h.disableVideo():h.enableVideo())}}connectedCallback(){this.meetingChanged(this.meeting)}disconnectedCallback(){var t,e,i,r,a,s,n;null===(t=this.meeting)||void 0===t||t.self.removeListener("videoUpdate",this.videoUpdateListener),null===(e=this.meeting)||void 0===e||e.self.removeListener("mediaPermissionUpdate",this.mediaPermissionUpdateListener),null===(r=null===(i=this.meeting)||void 0===i?void 0:i.stage)||void 0===r||r.removeListener("stageStatusUpdate",this.stageStatusListener),null===(n=null===(s=null===(a=this.meeting)||void 0===a?void 0:a.self)||void 0===s?void 0:s.permissions)||void 0===n||n.removeListener("permissionsUpdate",this.meetingPermissionsUpdateListener)}meetingChanged(t){var e,i;if(null!=t){const{self:r,stage:a}=t;this.canProduceVideo="ALLOWED"===this.meeting.self.permissions.canProduceVideo,this.cameraPermission=r.mediaPermissions.video||"NOT_REQUESTED",this.videoEnabled=r.videoEnabled,this.stageStatus=t.stage.status,r.addListener("videoUpdate",this.videoUpdateListener),r.addListener("mediaPermissionUpdate",this.mediaPermissionUpdateListener),null==a||a.addListener("stageStatusUpdate",this.stageStatusListener),null===(i=null===(e=null==t?void 0:t.self)||void 0===e?void 0:e.permissions)||void 0===i||i.addListener("permissionsUpdate",this.meetingPermissionsUpdateListener)}}hasPermissionError(){return"DENIED"===this.cameraPermission||"SYSTEM_DENIED"===this.cameraPermission}getState(){let t="",e="",i="",r={},a=this.hasPermissionError(),s="COULD_NOT_START"===this.cameraPermission;return this.videoEnabled&&!a?(e=this.t("video_on"),i=this.iconPack.video_on):(e=this.t("video_off"),i=this.iconPack.video_off,r["red-icon"]=!0),t=s?this.t("perm_could_not_start.video"):"SYSTEM_DENIED"===this.cameraPermission?this.t("perm_sys_denied.video"):"DENIED"===this.cameraPermission?this.t("perm_denied.video"):this.videoEnabled?this.t("disable_video"):this.t("enable_video"),{tooltipLabel:t,label:e,icon:i,classList:r,showWarning:a||s,disable:a}}render(){var t;if(!this.canProduceVideo||"AUDIO_ROOM"===(null===(t=this.meeting)||void 0===t?void 0:t.meta.viewType)||["OFF_STAGE","REQUESTED_TO_JOIN_STAGE"].includes(this.stageStatus))return N(H,{"data-hidden":!0});const{tooltipLabel:e,label:i,icon:r,classList:a,showWarning:s,disable:n}=this.getState();return N(H,{title:i},N("rtk-tooltip",{kind:"block",label:e,part:"tooltip"},N("rtk-controlbar-button",{part:"controlbar-button",size:this.size,iconPack:this.iconPack,class:a,variant:this.variant,label:i,icon:r,onClick:this.toggleCamera,showWarning:s,disabled:n})))}static get watchers(){return{meeting:["meetingChanged"]}}};_l([ai()],Rl.prototype,"meeting",void 0),_l([ai()],Rl.prototype,"size",void 0),_l([ai()],Rl.prototype,"iconPack",void 0),_l([ai()],Rl.prototype,"t",void 0),Rl.style=":host{line-height:initial;font-family:var(--rtk-font-family, sans-serif);font-feature-settings:normal;font-variation-settings:normal}p{margin:var(--rtk-space-0, 0px);padding:var(--rtk-space-0, 0px)}:host{display:block}:host([data-hidden]){display:none}";var Al=Object.freeze({__proto__:null,rtk_camera_toggle:Rl});var Dl=function(t,e,i,r){var a,s=arguments.length,n=s<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,i,r);else for(var o=t.length-1;o>=0;o--)(a=t[o])&&(n=(s<3?a(n):s>3?a(e,i,n):a(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};const Ml=class{constructor(t){o(this,t),this.stateUpdate=Y(this,"rtkStateUpdate",7),this.variant="button",this.config=De,this.iconPack=je,this.t=Fe(),this.captionEnabled=!1,this.permissionsUpdateListener=()=>{var t;this.captionEnabled=null!==(t=this.meeting.self.permissions.transcriptionEnabled)&&void 0!==t&&t}}connectedCallback(){this.meetingChanged(this.meeting)}meetingChanged(t){null!==t&&(this.permissionsUpdateListener(),this.meeting.self.permissions.addListener("permissionsUpdate",this.permissionsUpdateListener))}disconnectedCallback(){var t;null===(t=this.meeting)||void 0===t||t.self.permissions.removeListener("permissionsUpdate",this.permissionsUpdateListener)}toggleCaptions(){this.stateUpdate.emit({activeCaptions:!this.states.activeCaptions,activeMoreMenu:!1})}render(){if(!this.captionEnabled)return null;const t=this.states.activeCaptions;return N(H,{tabIndex:0,role:"log","aria-label":"Picture-in-Picture mode"},N("rtk-controlbar-button",{part:"controlbar-button",size:this.size,iconPack:this.iconPack,onClick:()=>this.toggleCaptions(),icon:t?this.iconPack.captionsOff:this.iconPack.captionsOn,label:t?this.t("transcript.off"):this.t("transcript.on"),variant:this.variant}))}static get watchers(){return{meeting:["meetingChanged"]}}};Dl([ai()],Ml.prototype,"meeting",void 0),Dl([ai()],Ml.prototype,"states",void 0),Dl([ai()],Ml.prototype,"iconPack",void 0),Dl([ai()],Ml.prototype,"size",void 0),Dl([ai()],Ml.prototype,"t",void 0),Ml.style=":host{line-height:initial;font-family:var(--rtk-font-family, sans-serif);font-feature-settings:normal;font-variation-settings:normal}p{margin:var(--rtk-space-0, 0px);padding:var(--rtk-space-0, 0px)}:host{display:block}";var Il=Object.freeze({__proto__:null,rtk_caption_toggle:Ml});var Ol=function(t,e,i,r){var a,s=arguments.length,n=s<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,i,r);else for(var o=t.length-1;o>=0;o--)(a=t[o])&&(n=(s<3?a(n):s>3?a(e,i,n):a(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};const Ul=class{constructor(t){o(this,t),this.channelChanged=Y(this,"channelChanged",7),this.iconPack=je,this.t=Fe(),this.showRecentMessage=!1,this.isHidden=!1,this.searchQuery="",this.handleResize=t=>{this.isHidden=!t.matches},this.channelSelected=t=>{this.channelChanged.emit(t),this.onRevealClicked()},this.onSearchInput=t=>{this.searchQuery=t.target.value},this.onRevealClicked=()=>{this.matchMedia.matches||(this.isHidden=!this.isHidden)},this.renderChannelDisplayPic=t=>{const e=t.displayPictureUrl&&0!==t.displayPictureUrl.length;return t.isDirectMessage||e?N("div",{class:"channel-display"},N("rtk-avatar",{participant:{name:t.displayName,picture:t.displayPictureUrl}})):N("div",{class:"channel-display"},N("rtk-icon",{icon:this.iconPack.people,slot:"start"}))},this.renderRecentMessage=t=>{if(!t.latestMessage)return N("p",{class:"latest-msg new"},this.t("chat.start_conversation"));let e=t.isDirectMessage?"":`${t.latestMessage.displayName}: `;if("text"===t.latestMessage.type)return N("p",{class:"latest-msg"},e,N(Qn,{message:t.latestMessage.message}));let i="";return"image"===t.latestMessage.type?i=this.t("image"):"file"===t.latestMessage.type&&(i=this.t("file")),N("p",{class:"latest-msg"},`${e}${i}`)}}connectedCallback(){this.matchMedia=window.matchMedia("(orientation: landscape) and (min-width: 400px)"),this.matchMedia.addEventListener("change",this.handleResize),this.isHidden=!this.matchMedia.matches}disconnectedCallback(){this.matchMedia.removeEventListener("change",this.handleResize)}componentDidRender(){this.$el.style.transform=this.isHidden?"translateX(-380px)":"translateX(0)"}getTimeLabel(t){const e=t.time,i=new Date,r=new Date(i);r.setDate(i.getDate()-1);const a=new Date(i);if(a.setDate(i.getDate()-i.getDay()-1),e.toDateString()===i.toDateString())return e.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"});if(e.toDateString()===r.toDateString())return this.t("date.yesteday");if(e>a){const t=["date.sunday","date.monday","date.tuesday","date.wednesday","date.thursday","date.friday","date.saturday"];return this.t(t[e.getDay()])}return Intl.DateTimeFormat([],{day:"2-digit",month:"2-digit",year:"2-digit"}).format(e)}render(){return N(H,{key:"b6684ad536955380fd011a8db8ed74508ce5c4e2"},N("div",{key:"0b9bd04166de85df7043026fe6f80d8980d09fd8",class:"container",ref:t=>this.$el=t},this.isHidden&&N("rtk-button",{key:"5b2af8c992ae39a097db0c6bcb79f73720c0baf6",kind:"icon",variant:"ghost",size:"md",onClick:this.onRevealClicked,class:"sidebar-btn"},N("rtk-icon",{key:"0713628a2ab34e4c7dbc8bf15a760331e0a4501b",icon:this.isHidden?this.iconPack.chevron_left:this.iconPack.dismiss})),N("slot",{key:"cba2cb4ec34adb4c852362af9aa6feef0c4f11b7",name:"header"}),N("div",{key:"ca23085817b6b0ca7bcd7cbe87d5788bc3b091d6",class:"search-wrapper"},N("div",{key:"ac28f333fb7625024441c06039c86a651bf31a51",class:"search"},N("input",{key:"34f1a069108d1610209bdc902afd40f168fd24a0",type:"search",autocomplete:"off",placeholder:this.t("chat.search_conversations"),onInput:this.onSearchInput}),N("rtk-icon",{key:"479b07ba42bbd7825e33f59efb4da26301553616",icon:this.iconPack.search,class:"search-icon"}))),N("div",{key:"4f97ff09587ab50ad957e6748ee31673f9097564",class:"channel-container scrollbar",role:"list"},this.channels.filter((t=>""===this.searchQuery||t.displayName.includes(this.searchQuery))).map((t=>N("div",{class:{channel:!0,selected:t.id===this.selectedChannelId,highlight:!!t.unreadCount},role:"listitem",onClick:()=>{this.channelSelected(t.id)}},this.renderChannelDisplayPic(t),N("div",{class:"channel-card","is-direct-message":t.isDirectMessage},N("div",{class:"recent-message-row"},N("span",{class:"channel-name"},t.displayName),t.latestMessage&&N("span",{class:"latest-msg-time"},this.getTimeLabel(t.latestMessage))),N("div",{class:"recent-message-row"},this.renderRecentMessage(t),t.unreadCount>0&&t.id!==this.selectedChannelId?N("span",{class:"new-msgs-count"},t.unreadCount<99?t.unreadCount:"99+"):null))))))),!this.isHidden&&N("div",{key:"dbf1235ca2393f7978906cbbcd2530ea38801157",class:"overlay-container"},N("rtk-button",{key:"d2a37c163f32a251597ee8dd1332c48bacad1883",kind:"icon",variant:"ghost",size:"md",onClick:this.onRevealClicked,class:"sidebar-btn"},N("rtk-icon",{key:"a13daad18a52bd8846dba2bbeab753d0a060463e",icon:this.isHidden?this.iconPack.chevron_left:this.iconPack.dismiss}))))}};Ol([ai()],Ul.prototype,"iconPack",void 0),Ol([ai()],Ul.prototype,"t",void 0),Ul.style=".scrollbar{scrollbar-width:thin;scrollbar-color:var(--rtk-scrollbar-color, rgb(var(--rtk-colors-background-600, 60 60 60)))\n var(--rtk-scrollbar-background, transparent)}.scrollbar::-webkit-scrollbar{height:var(--rtk-space-1\\.5, 6px);width:var(--rtk-space-1\\.5, 6px);border-radius:9999px;background-color:var(--rtk-scrollbar-background, transparent)}.scrollbar::-webkit-scrollbar-thumb{border-radius:9999px;background-color:var(--rtk-scrollbar-color, rgb(var(--rtk-colors-background-600, 60 60 60)))}:host{display:flex}.container{display:flex;height:100%;width:var(--rtk-space-96, 384px);flex-direction:column;position:absolute;--tw-translate-x:calc(var(--rtk-space-96, 384px) * -1);transform:translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-background-900, 26 26 26) / var(--tw-bg-opacity));border-top-width:var(--rtk-border-width-none, 0);border-bottom-width:var(--rtk-border-width-none, 0);border-right-width:var(--rtk-border-width-sm, 1px);border-left-width:var(--rtk-border-width-none, 0);border-style:solid;--tw-border-opacity:1;border-right-color:rgba(var(--rtk-colors-background-800, 30 30 30) / var(--tw-border-opacity));transition-property:color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, -webkit-backdrop-filter;transition-property:color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter;transition-property:color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter, -webkit-backdrop-filter;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:150ms}@keyframes fade{0%{opacity:0}100%{opacity:1}}.overlay-container{width:100vw;--tw-translate-x:var(--rtk-space-96, 384px);transform:translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-background-600, 60 60 60) / var(--tw-bg-opacity));transition-property:color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, -webkit-backdrop-filter;transition-property:color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter;transition-property:color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter, -webkit-backdrop-filter;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:150ms;animation:fade 0.8s}.overlay-container .sidebar-btn{position:static;padding:var(--rtk-space-4, 16px);--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-background-600, 60 60 60) / var(--tw-bg-opacity))}.sidebar-btn{position:absolute;right:calc(var(--rtk-space-9, 36px) * -1);top:var(--rtk-space-4, 16px);height:var(--rtk-space-8, 32px);width:var(--rtk-space-7, 28px);--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-background-900, 26 26 26) / var(--tw-bg-opacity));border-radius:var(--rtk-border-radius-sm, 4px)}@media (orientation: landscape) and (min-width: 400px){.container{position:static;--tw-translate-x:var(--rtk-space-0, 0px);transform:translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.sidebar-btn,.overlay-container{display:none}}.search-wrapper{display:flex;align-items:center;gap:var(--rtk-space-2, 8px);padding:var(--rtk-space-2, 8px);border-left-width:var(--rtk-border-width-none, 0);border-right-width:var(--rtk-border-width-none, 0);border-bottom-width:var(--rtk-border-width-sm, 1px);border-top-width:var(--rtk-border-width-none, 0);border-style:solid;--tw-border-opacity:1;border-bottom-color:rgba(var(--rtk-colors-background-800, 30 30 30) / var(--tw-border-opacity))}.search{position:sticky;box-sizing:border-box;display:flex;align-items:center;border-radius:var(--rtk-border-radius-sm, 4px);margin-top:var(--rtk-space-0, 0px);margin-bottom:var(--rtk-space-0, 0px);height:var(--rtk-space-8, 32px);width:100%}.search .search-icon{height:var(--rtk-space-5, 20px);width:var(--rtk-space-5, 20px);padding:var(--rtk-space-2, 8px);--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-background-700, 44 44 44) / var(--tw-bg-opacity));color:rgb(var(--rtk-colors-text-600, 255 255 255 / 0.52));border-top-right-radius:var(--rtk-border-radius-sm, 4px);border-bottom-right-radius:var(--rtk-border-radius-sm, 4px)}.search input{box-sizing:border-box;width:100%;padding-top:var(--rtk-space-2, 8px);padding-bottom:var(--rtk-space-2, 8px);padding-left:var(--rtk-space-2, 8px);--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-background-700, 44 44 44) / var(--tw-bg-opacity));color:rgb(var(--rtk-colors-text-1000, 255 255 255));border-width:var(--rtk-border-width-none, 0);border-style:none;outline:2px solid transparent;outline-offset:2px;font-size:14px;line-height:1.25rem}.search input::-moz-placeholder{color:rgb(var(--rtk-colors-text-800, 255 255 255 / 0.76))}.search input::placeholder{color:rgb(var(--rtk-colors-text-800, 255 255 255 / 0.76))}.search input{border-top-left-radius:var(--rtk-border-radius-sm, 4px);border-bottom-left-radius:var(--rtk-border-radius-sm, 4px)}.channel-container{box-sizing:border-box;display:flex;flex-direction:column;padding-top:var(--rtk-space-2, 8px);padding-bottom:var(--rtk-space-2, 8px);overflow-y:scroll}.channel-container .channel{display:flex;align-items:center;justify-content:space-between;gap:var(--rtk-space-2, 8px);padding:var(--rtk-space-0, 0px);border-left-width:var(--rtk-border-width-none, 0);border-right-width:var(--rtk-border-width-none, 0);border-bottom-width:var(--rtk-border-width-sm, 1px);border-top-width:var(--rtk-border-width-none, 0);border-style:solid;--tw-border-opacity:1;border-color:rgba(var(--rtk-colors-background-700, 44 44 44) / var(--tw-border-opacity))}.channel-container .channel:hover{cursor:pointer;--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-brand-300, 73 124 253) / var(--tw-bg-opacity));color:rgb(var(--rtk-colors-text-on-brand-900, var(--rtk-colors-text-900, 255 255 255 / 0.88)))}.channel-container .channel:hover .latest-msg-time,.channel-container .channel:hover .latest-msg,.channel-container .channel:hover .latest-msg.new{color:rgb(var(--rtk-colors-text-on-brand-700, var(--rtk-colors-text-700, 255 255 255 / 0.64)))}.channel-container .channel-display{display:flex;gap:var(--rtk-space-2, 8px);align-self:center;padding-left:var(--rtk-space-2, 8px);padding-right:var(--rtk-space-0, 0px)}.channel-container .channel-display rtk-avatar{height:var(--rtk-space-9, 36px);width:var(--rtk-space-9, 36px);flex-shrink:0;font-size:12px}.channel-container .channel-display rtk-icon{height:var(--rtk-space-5, 20px);width:var(--rtk-space-5, 20px);flex-shrink:0;padding:var(--rtk-space-2, 8px);border-radius:9999px;--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-brand-500, 33 96 253) / var(--tw-bg-opacity));color:rgb(var(--rtk-colors-text-on-brand-1000, var(--rtk-colors-text-1000, 255 255 255)))}.channel-container .channel-card{width:100%;padding-top:var(--rtk-space-2, 8px);padding-bottom:var(--rtk-space-2, 8px);padding-right:var(--rtk-space-2, 8px);padding-left:var(--rtk-space-1, 4px)}.channel-container .channel-card .channel-name{max-width:var(--rtk-space-60, 240px);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:14px;font-weight:500}.channel-container .channel-card .latest-msg{margin:var(--rtk-space-0, 0px);max-width:var(--rtk-space-56, 224px);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:14px}.channel-container .channel-card .latest-msg.new{font-weight:200;font-style:italic;color:rgb(var(--rtk-colors-text-700, 255 255 255 / 0.64))}.channel-container .channel-card .latest-msg-time{font-size:12px;color:rgb(var(--rtk-colors-text-900, 255 255 255 / 0.88))}.channel-container .channel-meta{width:var(--rtk-space-12, 48px);display:flex;flex-direction:column;align-items:flex-end;justify-content:space-between;gap:var(--rtk-space-1\\.5, 6px);font-size:12px;font-weight:600}.channel-container .new-msgs-count{height:var(--rtk-space-4, 16px);min-width:var(--rtk-space-4, 16px);padding-top:1px;padding-bottom:1px;padding-left:2px;padding-right:2px;--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-success, 98 165 4) / var(--tw-bg-opacity));color:rgb(var(--rtk-colors-text-on-brand-1000, var(--rtk-colors-text-1000, 255 255 255)));border-radius:var(--rtk-border-radius-sm, 4px);text-align:center;font-size:12px}.channel-container .selected{--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-brand-300, 73 124 253) / var(--tw-bg-opacity));color:rgb(var(--rtk-colors-text-on-brand-900, var(--rtk-colors-text-900, 255 255 255 / 0.88)))}.channel-container .selected .latest-msg-time,.channel-container .selected .latest-msg,.channel-container .selected .latest-msg.new{color:rgb(var(--rtk-colors-text-on-brand-700, var(--rtk-colors-text-700, 255 255 255 / 0.64)))}.channel-container .highlight .channel-title span{font-weight:700}.latest-msg p{margin:var(--rtk-space-0, 0px);margin-right:var(--rtk-space-1, 4px);display:inline-block}.latest-msg blockquote{display:none}.recent-message-row{margin-bottom:var(--rtk-space-2, 8px);display:flex;width:100%;flex-direction:row;justify-content:space-between}";var $l=Object.freeze({__proto__:null,rtk_channel_selector_ui:Ul});var Fl=function(t,e,i,r){var a,s=arguments.length,n=s<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,i,r);else for(var o=t.length-1;o>=0;o--)(a=t[o])&&(n=(s<3?a(n):s>3?a(e,i,n):a(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};const jl="@",zl=class{constructor(t){o(this,t),this.onNewMessage=Y(this,"rtkNewMessage",7),this.onEditMessage=Y(this,"rtkEditMessage",7),this.onEditCancelled=Y(this,"rtkEditCancelled",7),this.canSendTextMessage=!1,this.canSendFiles=!1,this.iconPack=je,this.t=Fe(),this.disableEmojiPicker=!1,this.prefill={},this.members=[],this.emojiPickerActive=!1,this.mentionQuery="",this.focusedMemberIndex=0,this.filePreview=null,this.fileReader=new FileReader,this.fileToUpload=null,this.handleKeyDown=t=>{if(t.key===jl&&[void 0," "].includes(this.$textArea.value.at(-1))&&(this.mentionQuery=jl),"ArrowDown"===t.key&&(this.focusedMemberIndex=Math.min(this.focusedMemberIndex+1,this.getFilteredMembers().length-1)),"ArrowUp"===t.key&&(this.focusedMemberIndex=Math.max(0,this.focusedMemberIndex-1)),("Escape"===t.key||"Backspace"===t.key&&this.mentionQuery===jl)&&(this.mentionQuery=""),["Enter","Tab"," "].includes(t.key)&&""!==this.mentionQuery){const e=this.getFilteredMembers()[this.focusedMemberIndex];return this.onMemberSelect(e),void t.preventDefault()}if("Enter"===t.key&&t.shiftKey){this.$textArea.clientHeight<200&&(this.$textArea.style.height=this.$textArea.clientHeight+20+"px")}else"Enter"===t.key?(t.preventDefault(),this.prefill.editMessage?this.handleEditMessage():this.handleSendMessage()):"Backspace"===t.key&&(this.$textArea.value.endsWith("\n")?this.$textArea.style.height=this.$textArea.clientHeight-20+"px":""===this.$textArea.value&&(this.$textArea.style.height="auto"))},this.handleKeyUp=t=>{if(""!==this.mentionQuery){const t=$i(this.$textArea.value.trim()),e=t.substring(0,t.indexOf(jl));this.mentionQuery=`${jl}${$i(e)}`}},this.onPaste=t=>{const e=t.clipboardData||t.originalEvent.clipboardData;C((()=>{e&&e.items&&e.items.length>0&&(Mi(e.items,this.generateFilePreview),this.$textArea.value="")}))},this.generateFilePreview=(t,e)=>{this.fileToUpload={type:t,image:e,file:e},"image"===t?this.fileReader.readAsDataURL(e):"file"===t&&(this.filePreview=e.name)},this.sendFile=()=>{this.canSendFiles&&("image"===this.fileToUpload.type?this.onNewMessage.emit({type:"image",file:this.fileToUpload.image,image:this.fileToUpload.image}):this.onNewMessage.emit({type:"file",file:this.fileToUpload.file}),this.cleanUpFileUpload())},this.handleSendMessage=()=>{if(!this.canSendTextMessage)return;if(null!==this.fileToUpload)return void this.sendFile();const t=this.$textArea.value.trim();t.length>0&&(this.prefill.replyMessage?this.onNewMessage.emit({type:"text",message:t,replyTo:this.prefill.replyMessage}):this.onNewMessage.emit({type:"text",message:t}),this.cleanup())},this.cleanup=()=>{this.mentionQuery="",this.focusedMemberIndex=0,this.$textArea.value="",this.$textArea.style.height="auto",Be.setItem(this.storageKey,"")},this.handleEditMessage=()=>{var t;let e=this.$textArea.value.trim();if((null===(t=this.prefill.editMessage)||void 0===t?void 0:t.message)&&Bi.test(this.prefill.editMessage.message)){e=`${Hi(this.prefill.editMessage.message)}\n\n${e}`}this.onEditMessage.emit({id:this.prefill.editMessage.id,message:e,channelId:this.prefill.editMessage.channelId}),this.cleanup()},this.handleEditCancel=()=>{this.onEditCancelled.emit(),this.cleanup()},this.initializeTextField=t=>{this.$textArea=t;const e=Be.getItem(this.storageKey)||"";this.$textArea.value=e},this.onMemberSelect=t=>{const e=$i(this.mentionQuery),i=$i(this.$textArea.value.trim()).replace(e,"");this.$textArea.value=$i(i)+`${jl}${t.name} `,this.mentionQuery="",this.focusedMemberIndex=0,C((()=>this.$textArea.focus()))},this.getFilteredMembers=()=>{const t=this.mentionQuery.replace(jl,"");return this.members.filter((e=>e.name.toLowerCase().includes(t.toLowerCase())))},this.cleanUpFileUpload=()=>{this.filePreview=null,this.fileToUpload=null},this.renderSuggestedReplies=()=>{if(this.prefill.suggestedReplies&&0!==this.prefill.suggestedReplies.length)return N("ul",{class:"suggested-replies scrollbar"},this.prefill.suggestedReplies.map((t=>N("rtk-tooltip",{label:this.t("chat.click_to_send")},N("li",{onClick:()=>this.onNewMessage.emit({type:"text",message:t})},t)))))},this.renderMenu=()=>{if(0===this.mentionQuery.length)return;const t=this.getFilteredMembers();return 0!==t.length?N("ul",{class:"member-list scrollbar"},t.map(((t,e)=>N("li",{class:{member:!0,selected:e===this.focusedMemberIndex},onClick:()=>this.onMemberSelect(t),ref:t=>{e===this.focusedMemberIndex&&C((()=>{t&&t.scrollIntoView({behavior:"smooth",block:"end",inline:"nearest"})}))}},N("rtk-avatar",{participant:{name:t.name,picture:t.picture},size:"sm"}),N("span",null,t.name))))):void 0}}connectedCallback(){this.fileReader.onload=t=>{"string"==typeof t.target.result&&(this.filePreview=t.target.result)}}onChannelChanged(){this.mentionQuery="",this.focusedMemberIndex=0;const t=Be.getItem(this.storageKey)||"";this.$textArea.value=t,this.emojiPickerActive=!1}componentDidRender(){(this.prefill.editMessage||this.prefill.replyMessage)&&C((()=>this.$textArea.focus()))}get storageKey(){return this.channelId?`rtk-text-message-${this.channelId}`:"rtk-text-message"}uploadFile(t){const e=document.createElement("input");e.type="file","image"===t&&(e.accept="image/*"),e.onchange=e=>{const{validity:i,files:[r]}=e.target;i.valid&&this.generateFilePreview(t,r)},e.click()}renderFilePreview(){if("string"==typeof this.filePreview)return N("div",{class:"preview-overlay"},N("div",{class:"file-preview"},N("rtk-tooltip",{label:this.t("chat.cancel_upload")},N("rtk-button",{variant:"secondary",kind:"icon",onClick:this.cleanUpFileUpload},N("rtk-icon",{icon:this.iconPack.dismiss}))),"image"===this.fileToUpload.type?N("img",{class:"preview-image",src:this.filePreview}):N("div",{class:"preview-file"},N("span",null,this.filePreview))))}render(){var t;let e="";return(null===(t=this.prefill.editMessage)||void 0===t?void 0:t.message)&&(e=Gi(this.prefill.editMessage.message)),N(H,{key:"8f0ee810fac56aa1c62254d3d8a997941475bb3a"},this.canSendTextMessage&&this.emojiPickerActive&&N("rtk-emoji-picker",{key:"368bdbbe0e995aafd13e70d12f62b59979a5691b",part:"emoji-picker",onPickerClose:()=>{this.emojiPickerActive=!1},onRtkEmojiClicked:t=>{this.$textArea.value+=t.detail,this.$textArea.focus()},t:this.t}),this.renderSuggestedReplies(),N("slot",{key:"166872db8c0b07d2ec2e407de0fddfce7f3d4969",name:"chat-addon"}),N("slot",{key:"b383df2de3320e69fe2cb35a22296d1ee53b08df",name:"quote-block"}),N("div",{key:"89d5fdf625bf212acda92276e9ec10b60b55a179",class:"chat-input",part:"chat-input"},this.renderMenu(),this.canSendTextMessage&&N("textarea",{key:"55192f10820a161189d42b6150819be6a346d1e9",class:"scrollbar",part:"textarea",ref:this.initializeTextField,autoFocus:!0,placeholder:this.fileToUpload?"":this.t("chat.message_placeholder"),value:e,onPaste:this.onPaste,maxLength:Vi,onKeyDown:this.handleKeyDown,onKeyUp:this.handleKeyUp,onInput:t=>{Be.setItem(this.storageKey,t.target.value)},disabled:!!this.filePreview}),N("div",{key:"6c3a94c43257041fdeed496c7bd8b57ce4be6510",class:"chat-buttons",part:"chat-buttons"},N("div",{key:"76e6f7923484ee6a58359b6554e5e51009bc317f",class:"left",part:"chat-buttons-left"},!this.prefill.editMessage&&this.canSendFiles&&[N("rtk-tooltip",{key:"dbc04471a85d1fe2987c7d18dd0781e61f85fa35",label:this.t("chat.send_file")},N("rtk-button",{key:"cb54c65b81559d4a00a316aacf2f4bb368f30799",variant:"ghost",kind:"icon",onClick:()=>this.uploadFile("file"),title:this.t("chat.send_file")},N("rtk-icon",{key:"d3c542b0b1260ac305de3cfd5fbf5396f18d1f0e",icon:this.iconPack.attach}))),N("rtk-tooltip",{key:"6aac421a0d9149fd6c188bcce25bf4152cb8c0dd",label:this.t("chat.send_img")},N("rtk-button",{key:"5460407db51e83ab379bb8ade5af7d87bd04b64d",variant:"ghost",kind:"icon",onClick:()=>this.uploadFile("image"),title:this.t("chat.send_img")},N("rtk-icon",{key:"3f8732882dc03b5ddf23c59bdbe96329e551b070",icon:this.iconPack.image})))],!this.prefill.editMessage&&this.canSendTextMessage&&!this.disableEmojiPicker&&N("rtk-tooltip",{key:"8d032069a031d6a3b3e4847953a8e027eb5b3400",label:this.t("chat.send_emoji")},N("rtk-button",{key:"b96b0791ac68f142408f269354bde5385c08a4da",variant:"ghost",kind:"icon",class:{active:this.emojiPickerActive},title:this.t("chat.send_emoji"),onClick:()=>{this.emojiPickerActive=!this.emojiPickerActive}},N("rtk-icon",{key:"cd9ac09500ed1151dad94ed285db35bea6260ed8",icon:this.iconPack.emoji_multiple})))),!!this.filePreview&&this.renderFilePreview(),this.canSendTextMessage&&N("div",{key:"43b9f9232a7476b5600519fb3517d6342143d76f",class:"right",part:"chat-buttons-right"},!this.prefill.editMessage&&N("rtk-tooltip",{key:"ec757e58571a0ff2e4ab9b1006ab388b334a77d3",variant:"primary",label:this.t("chat.send_msg"),delay:2e3},N("rtk-button",{key:"054e7b52bfcfe852ca53ce96c6b498585924e616",kind:"icon",onClick:()=>this.handleSendMessage(),title:this.t("chat.send_msg")},N("rtk-icon",{key:"d085d0aae594a8e08f29d200e4cb0818c0eabdfd",icon:this.iconPack.send}))),this.prefill.editMessage&&N("div",{key:"7926d7cf394a7989d2fbae97c1ab5a974834b431",class:"edit-buttons"},N("rtk-tooltip",{key:"66029024ca595880cc72fdb28999f8380a8a37fc",variant:"secondary",label:this.t("cancel"),delay:2e3},N("rtk-button",{key:"cba0e1460d33a0b20593009acc588ba4e385d782",kind:"icon",variant:"secondary",onClick:()=>this.handleEditCancel(),title:this.t("cancel")},N("rtk-icon",{key:"2155257dea8a5660b6b2d9d9510da153192be16e",icon:this.iconPack.dismiss}))),N("rtk-tooltip",{key:"b296276e6f08c128ec3ba3cc292f6637e3550a34",variant:"primary",label:this.t("chat.update_msg"),delay:2e3},N("rtk-button",{key:"e3c50822510811d254f3e8d65ed967b70be97037",kind:"icon",onClick:()=>this.handleEditMessage(),title:this.t("chat.send_msg")},N("rtk-icon",{key:"016e23547285b95c2545784d627a37fb8c6359d5",icon:this.iconPack.checkmark}))))))))}static get watchers(){return{channelId:["onChannelChanged"]}}};Fl([ai()],zl.prototype,"size",void 0),Fl([ai()],zl.prototype,"iconPack",void 0),Fl([ai()],zl.prototype,"t",void 0),zl.style=":host{line-height:initial;font-family:var(--rtk-font-family, sans-serif);font-feature-settings:normal;font-variation-settings:normal}p{margin:var(--rtk-space-0, 0px);padding:var(--rtk-space-0, 0px)}.scrollbar{scrollbar-width:thin;scrollbar-color:var(--rtk-scrollbar-color, rgb(var(--rtk-colors-background-600, 60 60 60)))\n var(--rtk-scrollbar-background, transparent)}.scrollbar::-webkit-scrollbar{height:var(--rtk-space-1\\.5, 6px);width:var(--rtk-space-1\\.5, 6px);border-radius:9999px;background-color:var(--rtk-scrollbar-background, transparent)}.scrollbar::-webkit-scrollbar-thumb{border-radius:9999px;background-color:var(--rtk-scrollbar-color, rgb(var(--rtk-colors-background-600, 60 60 60)))}:host{display:flex;flex-direction:column;--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-background-1000, 8 8 8) / var(--tw-bg-opacity))}.chat-input{position:relative;margin:var(--rtk-space-2, 8px);z-index:10;box-sizing:border-box;display:flex;flex-direction:column;border-radius:var(--rtk-border-radius-md, 8px);border:var(--rtk-border-width-sm, 1px) solid rgb(var(--rtk-colors-background-600, 60 60 60))}textarea{--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-background-900, 26 26 26) / var(--tw-bg-opacity));box-sizing:border-box;padding:var(--rtk-space-3, 12px);color:rgb(var(--rtk-colors-text-1000, 255 255 255))}textarea::-moz-placeholder{color:rgb(var(--rtk-colors-text-1000, 255 255 255))}textarea::placeholder{color:rgb(var(--rtk-colors-text-1000, 255 255 255))}textarea{border-top-left-radius:var(--rtk-border-radius-md, 8px);border-top-right-radius:var(--rtk-border-radius-md, 8px);font-family:var(--rtk-font-family, sans-serif);outline:2px solid transparent;outline-offset:2px;resize:none;overflow-y:auto;border-width:var(--rtk-border-width-none, 0);border-style:none;min-height:60px;font-size:14px}.chat-buttons{border-bottom-right-radius:var(--rtk-border-radius-md, 8px);border-bottom-left-radius:var(--rtk-border-radius-md, 8px);--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-background-900, 26 26 26) / var(--tw-bg-opacity));display:flex;height:var(--rtk-space-8, 32px);align-items:center;justify-content:space-between;padding-left:var(--rtk-space-3, 12px);padding-right:var(--rtk-space-3, 12px);padding-top:var(--rtk-space-2, 8px);padding-bottom:var(--rtk-space-2, 8px)}.chat-buttons .left rtk-button{margin-right:var(--rtk-space-1, 4px)}.chat-buttons .left rtk-button rtk-icon{height:var(--rtk-space-5, 20px);width:var(--rtk-space-5, 20px)}.chat-buttons .right{z-index:10}.chat-buttons .right .edit-buttons{display:flex;gap:var(--rtk-space-2, 8px)}.chat-buttons>div{display:flex;align-items:center}rtk-emoji-picker{z-index:0;position:absolute;bottom:var(--rtk-space-32, 128px);border-top:var(--rtk-border-width-sm, 1px) solid rgb(var(--rtk-colors-background-600, 60 60 60));animation:0.3s slide-up ease}@keyframes slide-up{from{transform:translateY(100%)}to{transform:translateY(0%)}}.member-list{margin:var(--rtk-space-0, 0px);margin-top:var(--rtk-space-1, 4px);max-height:var(--rtk-space-28, 112px);min-width:var(--rtk-space-40, 160px);max-width:var(--rtk-space-64, 256px);padding:var(--rtk-space-0, 0px);position:absolute;bottom:var(--rtk-space-28, 112px);list-style-type:none;overflow-y:auto;--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-background-900, 26 26 26) / var(--tw-bg-opacity));border-radius:var(--rtk-border-radius-sm, 4px);--tw-border-spacing-x:var(--rtk-space-2, 8px);--tw-border-spacing-y:var(--rtk-space-2, 8px);border-spacing:var(--tw-border-spacing-x) var(--tw-border-spacing-y);border-style:solid;border-color:rgba(var(--rtk-colors-brand-300, 73 124 253) / 0.5)}.member-list .member{display:flex;align-items:center;gap:var(--rtk-space-1, 4px);padding:var(--rtk-space-2, 8px);padding-right:var(--rtk-space-4, 16px);cursor:pointer}.member-list .member rtk-avatar{flex-shrink:0;height:var(--rtk-space-5, 20px);width:var(--rtk-space-5, 20px);font-size:14px;color:rgb(var(--rtk-colors-text-on-brand-1000, var(--rtk-colors-text-1000, 255 255 255)))}.member-list .member span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.member-list .member:hover,.member-list .member.selected{--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-brand-700, 2 70 253) / var(--tw-bg-opacity));color:rgb(var(--rtk-colors-text-on-brand-1000, var(--rtk-colors-text-1000, 255 255 255)))}.suggested-replies{margin:var(--rtk-space-0, 0px);padding:var(--rtk-space-3, 12px);display:flex;flex-wrap:nowrap;gap:var(--rtk-space-2, 8px);list-style-type:none;overflow-x:auto}.suggested-replies rtk-tooltip{flex-shrink:0}.suggested-replies li{padding:var(--rtk-space-2, 8px);border-radius:var(--rtk-border-radius-md, 8px);background-color:rgba(var(--rtk-colors-brand-300, 73 124 253) / 0.75);color:rgb(var(--rtk-colors-text-on-brand-1000, var(--rtk-colors-text-1000, 255 255 255)));cursor:pointer}.suggested-replies li:hover{--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-brand-300, 73 124 253) / var(--tw-bg-opacity))}.preview-overlay{position:absolute;top:var(--rtk-space-0, 0px);right:var(--rtk-space-0, 0px);bottom:var(--rtk-space-0, 0px);left:var(--rtk-space-0, 0px);--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-background-800, 30 30 30) / var(--tw-bg-opacity));border-radius:var(--rtk-border-radius-md, 8px)}.file-preview{position:absolute;top:var(--rtk-space-4, 16px);left:var(--rtk-space-4, 16px);max-width:-moz-fit-content;max-width:fit-content;max-height:var(--rtk-space-20, 80px)}.file-preview:hover rtk-tooltip{display:block}.file-preview rtk-tooltip{position:absolute;top:calc(var(--rtk-space-1, 4px) * -1);left:calc(var(--rtk-space-1, 4px) * -1);display:none;margin-left:calc(var(--rtk-space-1, 4px) * -1);margin-top:calc(var(--rtk-space-1, 4px) * -1)}.file-preview rtk-button{display:flex;height:var(--rtk-space-4, 16px);width:var(--rtk-space-4, 16px);align-items:center;justify-content:center;border-radius:9999px;--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-background-600, 60 60 60) / var(--tw-bg-opacity));border:1px solid rgb(var(--rtk-colors-text-1000, 255 255 255))}.file-preview rtk-icon{height:var(--rtk-space-3, 12px);width:var(--rtk-space-3, 12px);color:rgb(var(--rtk-colors-text-1000, 255 255 255))}.preview-image{height:var(--rtk-space-16, 64px);width:var(--rtk-space-16, 64px);-o-object-fit:cover;object-fit:cover;max-height:100%;max-width:100%;overflow:clip;border-radius:var(--rtk-border-radius-md, 8px)}.preview-file{padding-left:var(--rtk-space-3, 12px);padding-right:var(--rtk-space-3, 12px);padding-top:var(--rtk-space-2, 8px);padding-bottom:var(--rtk-space-2, 8px);--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-background-700, 44 44 44) / var(--tw-bg-opacity));overflow:hidden;text-overflow:ellipsis;white-space:nowrap;border-radius:var(--rtk-border-radius-md, 8px);max-width:200px}@keyframes scroll-text{0%{transform:translateX(0%)}70%{transform:translateX(-100%)}80%{transform:translateX(0%)}100%{transform:translateX(0%)}}";var Nl=Object.freeze({__proto__:null,rtk_chat_composer_ui:zl});var Bl=function(t,e,i,r){var a,s=arguments.length,n=s<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,i,r);else for(var o=t.length-1;o>=0;o--)(a=t[o])&&(n=(s<3?a(n):s>3?a(e,i,n):a(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};const Hl=class{constructor(t){o(this,t),this.groupChanged=Y(this,"rtkChatGroupChanged",7),this.unreadCounts={},this.groups=[],this.iconPack=je,this.t=Fe(),this.showParticipantsPanel=!1,this.query="",this.onScopeClick=t=>{this.showParticipantsPanel=!1,this.groupChanged.emit(t)}}toggleParticipants(){this.showParticipantsPanel=!this.showParticipantsPanel}getGroups(){return this.groups.filter((t=>t.name.toLowerCase().includes(this.query.toLowerCase())))}getName(){if(!this.selectedGroupId||"everyone"===this.selectedGroupId)return this.t("everyone");const t=this.groups.find((t=>t.userId===this.selectedGroupId));return t?t.name:this.t("everyone")}render(){const t=Object.keys(this.unreadCounts).reduce(((t,e)=>t+this.unreadCounts[e]),0);return N(H,null,N("div",{class:"chat-scope-selector"},this.showParticipantsPanel&&N("div",{class:"participants-container"},N("div",{class:"search",part:"search"},N("rtk-icon",{icon:this.iconPack.search,part:"search-icon"}),N("input",{type:"search",autocomplete:"off",placeholder:this.t("search"),value:this.query,onInput:t=>{this.query=t.target.value},part:"search-input"})),N("ul",{class:"scope-list scrollbar"},""===this.query&&N("li",{class:"scope scope-special",onClick:()=>this.onScopeClick("everyone")},N("div",{class:"everyone-icon"},N("rtk-icon",{icon:this.iconPack.participants})),this.t("everyone"),this.unreadCounts.everyone>0&&N("div",{class:"unread-count",part:"unread-count"},N("span",null,this.unreadCounts.everyone))),this.getGroups().map((t=>{const e=this.unreadCounts[Di([this.selfUserId,t.userId])];return N("li",{class:"scope",onClick:()=>this.onScopeClick(t),key:t.userId},t.name,e>0&&N("div",{class:"unread-count",part:"unread-count"},N("span",null,e)))})))),N("button",{onClick:()=>this.toggleParticipants()},N("span",null,`${this.t("to")} ${this.getName()}`," ",t>0&&N("div",{class:"unread-count selector"},N("span",null,t))),N("rtk-icon",{icon:this.showParticipantsPanel?this.iconPack.chevron_up:this.iconPack.chevron_down}))))}};Bl([ai()],Hl.prototype,"iconPack",void 0),Bl([ai()],Hl.prototype,"t",void 0),Hl.style=":host{line-height:initial;font-family:var(--rtk-font-family, sans-serif);font-feature-settings:normal;font-variation-settings:normal}p{margin:var(--rtk-space-0, 0px);padding:var(--rtk-space-0, 0px)}.scrollbar{scrollbar-width:thin;scrollbar-color:var(--rtk-scrollbar-color, rgb(var(--rtk-colors-background-600, 60 60 60)))\n var(--rtk-scrollbar-background, transparent)}.scrollbar::-webkit-scrollbar{height:var(--rtk-space-1\\.5, 6px);width:var(--rtk-space-1\\.5, 6px);border-radius:9999px;background-color:var(--rtk-scrollbar-background, transparent)}.scrollbar::-webkit-scrollbar-thumb{border-radius:9999px;background-color:var(--rtk-scrollbar-color, rgb(var(--rtk-colors-background-600, 60 60 60)))}:host{display:flex;flex-direction:column}.chat-scope-selector{position:relative;--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-background-600, 60 60 60) / var(--tw-bg-opacity));z-index:10}.chat-scope-selector button{width:100%;border-width:var(--rtk-border-width-none, 0);border-style:none;padding:var(--rtk-space-4, 16px);display:flex;align-items:center;justify-content:space-between;--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-background-800, 30 30 30) / var(--tw-bg-opacity));color:rgb(var(--rtk-colors-text-1000, 255 255 255));font-size:14px;cursor:pointer;height:var(--rtk-space-12, 48px)}.chat-scope-selector button span{display:flex;align-items:center;justify-content:flex-start}.chat-scope-selector button rtk-icon{height:var(--rtk-space-5, 20px);width:var(--rtk-space-5, 20px)}.chat-scope-selector .search{position:sticky;box-sizing:border-box;display:flex;align-items:center;border-radius:var(--rtk-border-radius-sm, 4px);--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-background-700, 44 44 44) / var(--tw-bg-opacity));margin-left:var(--rtk-space-3, 12px);margin-right:var(--rtk-space-3, 12px);margin-top:var(--rtk-space-3, 12px);margin-bottom:var(--rtk-space-0, 0px)}.chat-scope-selector .search rtk-icon{margin-left:var(--rtk-space-2, 8px);margin-right:var(--rtk-space-2, 8px);height:var(--rtk-space-5, 20px);width:var(--rtk-space-5, 20px);color:rgb(var(--rtk-colors-text-600, 255 255 255 / 0.52))}.chat-scope-selector .search input{box-sizing:border-box;height:var(--rtk-space-9, 36px);width:100%;padding-right:var(--rtk-space-2, 8px);border-width:var(--rtk-border-width-none, 0);border-style:none;--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-background-700, 44 44 44) / var(--tw-bg-opacity));color:rgb(var(--rtk-colors-text-1000, 255 255 255));outline:2px solid transparent;outline-offset:2px;border-radius:var(--rtk-border-radius-sm, 4px);font-size:14px}.chat-scope-selector .search input::-moz-placeholder{color:rgb(var(--rtk-colors-text-800, 255 255 255 / 0.76))}.chat-scope-selector .search input::placeholder{color:rgb(var(--rtk-colors-text-800, 255 255 255 / 0.76))}.chat-scope-selector .participants-container{position:absolute;width:100%;--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-background-800, 30 30 30) / var(--tw-bg-opacity));top:var(--rtk-space-12, 48px);animation:0.3s slide-down ease}@keyframes slide-down{from{transform:translateY(-50px)}to{transform:translateY(0%)}}.chat-scope-selector .scope-list{margin-top:var(--rtk-space-0, 0px);margin-bottom:var(--rtk-space-0, 0px);list-style-type:none;padding-left:var(--rtk-space-0, 0px);padding-right:var(--rtk-space-0, 0px);overflow:auto;max-height:375px}.chat-scope-selector .scope-list .scope{position:relative;display:flex;flex-direction:row;align-items:center;padding-left:var(--rtk-space-3, 12px);padding-right:var(--rtk-space-3, 12px);padding-top:var(--rtk-space-4, 16px);padding-bottom:var(--rtk-space-4, 16px)}.chat-scope-selector .scope-list .scope:hover{cursor:pointer;--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-background-900, 26 26 26) / var(--tw-bg-opacity))}.chat-scope-selector .scope-list .scope-special{margin-top:var(--rtk-space-4, 16px);--tw-text-opacity:1;color:rgba(var(--rtk-colors-brand-500, 33 96 253) / var(--tw-text-opacity))}.chat-scope-selector .scope-list .everyone-icon>rtk-icon{height:var(--rtk-space-6, 24px);width:var(--rtk-space-6, 24px);color:rgb(var(--rtk-colors-text-on-brand-1000, var(--rtk-colors-text-1000, 255 255 255)))}.chat-scope-selector .scope-list .everyone-icon{display:flex;height:100%;width:100%;align-items:center;justify-content:center;margin-right:var(--rtk-space-2, 8px);height:var(--rtk-space-8, 32px);width:var(--rtk-space-8, 32px);border-radius:9999px;--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-brand-500, 33 96 253) / var(--tw-bg-opacity));font-size:12px}.unread-count.selector{position:unset;margin-left:var(--rtk-space-2, 8px)}.unread-count{position:absolute;right:var(--rtk-space-3, 12px);box-sizing:border-box;padding:var(--rtk-space-0\\.5, 2px);-webkit-user-select:none;-moz-user-select:none;user-select:none;--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-brand-500, 33 96 253) / var(--tw-bg-opacity));font-size:12px;color:rgb(var(--rtk-colors-text-on-brand-1000, var(--rtk-colors-text-1000, 255 255 255)));display:flex;height:var(--rtk-space-5, 20px);min-width:var(--rtk-space-5, 20px);align-items:center;justify-content:center;border-radius:9999px;z-index:1}rtk-avatar{height:var(--rtk-space-8, 32px);width:var(--rtk-space-8, 32px)}";var Gl=Object.freeze({__proto__:null,rtk_chat_selector_ui:Hl});const Vl=t=>{if(t&&!t.chat)return!1;const{chatPublic:e,chatPrivate:i}=t.self.permissions;return e.canSend||e.canReceive||e.text||e.files||i.canSend||i.canReceive||i.files||i.text},ql=t=>{if(t&&!t.polls)return!1;const{polls:e}=t.self.permissions;return e.canCreate||e.canView||e.canVote},Kl=t=>{var e;if(!(null===(e=t.self.permissions)||void 0===e?void 0:e.showParticipantList))return!1;if(t&&!t.participants)return!1;const i=null==t?void 0:t.self.config;return!(i&&!i.controlBar.elements.participants)},Wl=t=>{if(Yt(t))return!1;if(t&&!t.plugins)return!1;if("LIVESTREAM"===t.meta.viewType)return"ON_STAGE"===t.stage.status;const{plugins:e}=t.self.permissions;return e.canClose||e.canStart};var Yl=function(t,e,i,r){var a,s=arguments.length,n=s<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,i,r);else for(var o=t.length-1;o>=0;o--)(a=t[o])&&(n=(s<3?a(n):s>3?a(e,i,n):a(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};const Zl=class{constructor(t){o(this,t),this.stateUpdate=Y(this,"rtkStateUpdate",7),this.unreadMessageCount=0,this.variant="button",this.iconPack=je,this.t=Fe(),this.chatActive=!1,this.canViewChat=!1,this.hasNewMessages=!1,this.onChatUpdate=({action:t,message:e})=>{var i;this.chatActive||"add"===t&&e.userId!==(null===(i=this.meeting)||void 0===i?void 0:i.self.userId)&&(this.hasNewMessages=!0,this.unreadMessageCount+=1)},this.toggleChat=()=>{const t=this.states;this.chatActive=!((null==t?void 0:t.activeSidebar)&&"chat"===(null==t?void 0:t.sidebar)),this.chatActive&&(this.unreadMessageCount=0,this.hasNewMessages=!1),this.stateUpdate.emit({activeSidebar:this.chatActive,sidebar:this.chatActive?"chat":void 0,activeMoreMenu:!1,activeAI:!1})},this.updateCanView=()=>{this.canViewChat=Vl(this.meeting)}}connectedCallback(){this.meetingChanged(this.meeting),this.statesChanged(this.states)}disconnectedCallback(){var t,e,i,r,a,s;null===(e=null===(t=this.meeting)||void 0===t?void 0:t.chat)||void 0===e||e.removeListener("chatUpdate",this.onChatUpdate),null===(r=null===(i=this.meeting)||void 0===i?void 0:i.stage)||void 0===r||r.removeListener("stageStatusUpdate",this.updateCanView),null===(s=null===(a=this.meeting)||void 0===a?void 0:a.self)||void 0===s||s.permissions.removeListener("chatUpdate",this.updateCanView)}meetingChanged(t){var e,i,r,a,s,n,o;if(null==t)return;ne(t)&&(null===(e=t.chat)||void 0===e||e.getMessages((new Date).getTime(),1,!0).then((t=>{var e;(null===(e=null==t?void 0:t.messages)||void 0===e?void 0:e.length)&&(this.hasNewMessages=!0)})));const c=null!==(r=null===(i=t.meta)||void 0===i?void 0:i.meetingStartedTimestamp.getTime())&&void 0!==r?r:0,l=null===(a=t.chat)||void 0===a?void 0:a.messages.filter((t=>t.timeMs>c));this.unreadMessageCount=l.length||0,null===(s=t.chat)||void 0===s||s.addListener("chatUpdate",this.onChatUpdate),this.canViewChat=Vl(t),null===(n=null==t?void 0:t.stage)||void 0===n||n.on("stageStatusUpdate",this.updateCanView),null===(o=null==t?void 0:t.self)||void 0===o||o.permissions.on("chatUpdate",this.updateCanView)}statesChanged(t){null!=t&&(this.chatActive=!0===t.activeSidebar&&"chat"===t.sidebar)}handleChatActiveChange(){this.chatActive||this.states.activeSidebar||this.buttonEl.focus()}render(){return this.canViewChat?N(H,{title:this.t("chat")},ne(this.meeting)?this.hasNewMessages&&N("div",{class:"unread-count-dot",part:"unread-count-dot"}):0!==this.unreadMessageCount&&!this.chatActive&&N("div",{class:"unread-count",part:"unread-count"},N("span",null,this.unreadMessageCount<=100?this.unreadMessageCount:"99+")),N("rtk-controlbar-button",{ref:t=>this.buttonEl=t,part:"controlbar-button",size:this.size,iconPack:this.iconPack,class:{active:this.chatActive},onClick:this.toggleChat,icon:this.iconPack.chat,label:this.t("chat"),variant:this.variant})):N(H,{"data-hidden":!0})}static get watchers(){return{meeting:["meetingChanged"],states:["statesChanged"],chatActive:["handleChatActiveChange"]}}};Yl([ai()],Zl.prototype,"meeting",void 0),Yl([ai()],Zl.prototype,"states",void 0),Yl([ai()],Zl.prototype,"size",void 0),Yl([ai()],Zl.prototype,"iconPack",void 0),Yl([ai()],Zl.prototype,"t",void 0),Zl.style=":host{line-height:initial;font-family:var(--rtk-font-family, sans-serif);font-feature-settings:normal;font-variation-settings:normal}p{margin:var(--rtk-space-0, 0px);padding:var(--rtk-space-0, 0px)}:host{position:relative;display:block}:host([data-hidden]){display:none}.unread-count{position:absolute;right:var(--rtk-space-3, 12px);box-sizing:border-box;padding:var(--rtk-space-0\\.5, 2px);-webkit-user-select:none;-moz-user-select:none;user-select:none;--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-brand-500, 33 96 253) / var(--tw-bg-opacity));font-size:12px;color:rgb(var(--rtk-colors-text-on-brand-1000, var(--rtk-colors-text-1000, 255 255 255)));display:flex;height:var(--rtk-space-5, 20px);min-width:var(--rtk-space-5, 20px);align-items:center;justify-content:center;border-radius:9999px;z-index:1}.unread-count-dot{position:absolute;right:var(--rtk-space-3, 12px);z-index:10;--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-brand-500, 33 96 253) / var(--tw-bg-opacity));border-radius:50%;display:flex;height:var(--rtk-space-4, 16px);width:var(--rtk-space-4, 16px);align-items:center;justify-content:center}:host([variant='horizontal']) .unread-count{right:var(--rtk-space-4, 16px);top:50%;--tw-translate-y:-50%;transform:translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}";var Ql=Object.freeze({__proto__:null,rtk_chat_toggle:Zl});var Jl=function(t,e,i,r){var a,s=arguments.length,n=s<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,i,r);else for(var o=t.length-1;o>=0;o--)(a=t[o])&&(n=(s<3?a(n):s>3?a(e,i,n):a(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};const Xl=t=>Math.trunc(t).toString().padStart(2,"0"),td=class{constructor(t){o(this,t),this.iconPack=je,this.disconnectMeeting=()=>{var t,e;this.timeout&&clearTimeout(this.timeout),"number"==typeof this.request&&cancelAnimationFrame(this.request),null===(e=null===(t=this.meeting)||void 0===t?void 0:t.meta)||void 0===e||e.removeListener("meetingStartTimeUpdate",this.startedTimeUpdateListener)},this.startedTimeUpdateListener=()=>{var t,e,i;this.startedTime=null===(i=null===(e=null===(t=this.meeting)||void 0===t?void 0:t.meta)||void 0===e?void 0:e.meetingStartedTimestamp)||void 0===i?void 0:i.toISOString()}}connectedCallback(){this.meetingChanged(this.meeting)}disconnectedCallback(){this.disconnectMeeting()}meetingChanged(t){var e,i,r;this.disconnectMeeting(),null!=t&&(this.startedTime=null===(i=null===(e=t.meta)||void 0===e?void 0:e.meetingStartedTimestamp)||void 0===i?void 0:i.toISOString(),null===(r=t.meta)||void 0===r||r.addListener("meetingStartTimeUpdate",this.startedTimeUpdateListener))}startedTimeChanged(t){if(void 0!==t){const t=()=>{this.timeDiff=(Date.now()-new Date(this.startedTime).getTime())/1e3,this.timeout=setTimeout((()=>{null!=this.request&&(this.request=requestAnimationFrame(t))}),500)};this.request=requestAnimationFrame(t)}}getFormattedTime(){if(null==this.timeDiff)return null;const t=this.timeDiff;let e="";return t>=3600&&(e=`${Xl(t/3600)}:`),e+=`${Xl(t%3600/60)}:${Xl(t%60)}`,e}render(){const t=void 0!==this.startedTime;return N(H,{key:"2775471382c6d07aae0ba8e18677d6850fd9cb34","data-hidden":!t,tabIndex:0,role:"timer","aria-live":"off"},void 0!==this.startedTime&&[N("rtk-icon",{key:"48b8bdfeef973d7f3eb4cdd526e386226a4b999a",icon:this.iconPack.clock,"aria-hidden":!0,tabIndex:-1,part:"icon"}),N("span",{key:"9f2bb7aa7adc6ecb65c5fef57e406801e6592e59",part:"text"},this.getFormattedTime())])}static get watchers(){return{meeting:["meetingChanged"],startedTime:["startedTimeChanged"]}}};Jl([ai()],td.prototype,"meeting",void 0),Jl([ai()],td.prototype,"iconPack",void 0),td.style=":host{line-height:initial;font-family:var(--rtk-font-family, sans-serif);font-feature-settings:normal;font-variation-settings:normal}p{margin:var(--rtk-space-0, 0px);padding:var(--rtk-space-0, 0px)}:host{display:inline-flex;align-items:center;-webkit-user-select:none;-moz-user-select:none;user-select:none;font-size:14px;color:rgb(var(--rtk-colors-text-1000, 255 255 255));font-variant-numeric:tabular-nums}:host([data-hidden]){display:none}:host([size='sm']){font-size:12px}rtk-icon{margin-right:var(--rtk-space-1, 4px);height:var(--rtk-space-5, 20px);width:var(--rtk-space-5, 20px)}:host([size='sm']) rtk-icon{height:var(--rtk-space-4, 16px);width:var(--rtk-space-4, 16px)}";var ed=Object.freeze({__proto__:null,rtk_clock:td});var id=function(t,e,i,r){var a,s=arguments.length,n=s<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,i,r);else for(var o=t.length-1;o>=0;o--)(a=t[o])&&(n=(s<3?a(n):s>3?a(e,i,n):a(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};const rd=class{constructor(t){o(this,t),this.variant="solid",this.disableRender=!1,this.config=De,this.iconPack=je,this.t=Fe()}render(){const t={meeting:this.meeting,config:this.config,states:this.states,t:this.t,iconPack:this.iconPack,size:this.size};return N(H,{key:"03a753b729584aee302a0e76f7961ae057dc0746"},!this.disableRender&&N(rr,{key:"488995338fff693e38de3f98f72a656cd71a5882",element:"rtk-controlbar",defaults:t,onlyChildren:!0}),N("slot",{key:"6fb547f8c56b9a610c532d66aa3582d16b3b40ef"}))}};id([ai()],rd.prototype,"meeting",void 0),id([ai()],rd.prototype,"states",void 0),id([ai()],rd.prototype,"iconPack",void 0),id([ai()],rd.prototype,"t",void 0),id([ai()],rd.prototype,"size",void 0),rd.style=":host{line-height:initial;font-family:var(--rtk-font-family, sans-serif);font-feature-settings:normal;font-variation-settings:normal}p{margin:var(--rtk-space-0, 0px);padding:var(--rtk-space-0, 0px)}:host{box-sizing:border-box;display:flex;align-items:center;gap:var(--rtk-space-0\\.5, 2px);--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-background-1000, 8 8 8) / var(--tw-bg-opacity));padding-left:var(--rtk-space-4, 16px);padding-right:var(--rtk-space-4, 16px);position:relative;z-index:10}@media only screen and (max-device-height: 480px) and (orientation: landscape){:host{padding-top:var(--rtk-space-0, 0px) !important}}";var ad=Object.freeze({__proto__:null,rtk_controlbar:rd});var sd=function(t,e,i,r){var a,s=arguments.length,n=s<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,i,r);else for(var o=t.length-1;o>=0;o--)(a=t[o])&&(n=(s<3?a(n):s>3?a(e,i,n):a(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};const nd=class{constructor(t){o(this,t),this.stateUpdate=Y(this,"rtkStateUpdate",7),this.variant="button",this.t=Fe(),this.iconPack=je}toggleDebugger(){var t;this.stateUpdate.emit({activeDebugger:!(null===(t=this.states)||void 0===t?void 0:t.activeDebugger),activeMoreMenu:!1})}render(){return N(H,{key:"e46722c024802f6c96cebb487c9049e8834c48f8",title:this.t("Troubleshooting")},N("rtk-controlbar-button",{key:"ee3d60dd6993d2757f763a0ae8ba173887c9ceba",size:this.size,iconPack:this.iconPack,onClick:()=>this.toggleDebugger(),icon:this.iconPack.debug,label:this.t("Troubleshooting"),variant:this.variant}))}};sd([ai()],nd.prototype,"meeting",void 0),sd([ai()],nd.prototype,"states",void 0),sd([ai()],nd.prototype,"t",void 0),sd([ai()],nd.prototype,"iconPack",void 0),sd([ai()],nd.prototype,"size",void 0),nd.style=":host{line-height:initial;font-family:var(--rtk-font-family, sans-serif);font-feature-settings:normal;font-variation-settings:normal}p{margin:var(--rtk-space-0, 0px);padding:var(--rtk-space-0, 0px)}:host{display:block}";var od=Object.freeze({__proto__:null,rtk_debugger_toggle:nd});var cd=function(t,e,i,r){var a,s=arguments.length,n=s<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,i,r);else for(var o=t.length-1;o>=0;o--)(a=t[o])&&(n=(s<3?a(n):s>3?a(e,i,n):a(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};const ld=class{constructor(t){o(this,t),this.config=De,this.icon=je,this.t=Fe(),this.iconPack=je,this.message=""}connectedCallback(){this.statesChanged(this.states)}getBreakoutRoomsMessage(t){var e;let i;return"connected-meeting"===(null==t?void 0:t.roomLeftState)&&(i=(null===(e=this.states.activeBreakoutRoomsManager)||void 0===e?void 0:e.destinationMeetingId)===this.meeting.connectedMeetings.parentMeeting.id?"breakout_rooms.move_reason.switch_main_room":"breakout_rooms.move_reason.switch_room"),i}statesChanged(t){if(null!=t)switch(null==t?void 0:t.roomLeftState){case"left":this.message="ended.left";break;case"kicked":this.message="ended.kicked";break;case"disconnected":this.message="ended.disconnected";break;case"rejected":this.message="ended.rejected";break;case"connected-meeting":this.message=this.getBreakoutRoomsMessage(t);break;case"unauthorized":this.message="ended.unauthorized";break;default:this.message="ended"}}renderBreakoutRoomScreen(){return N(H,null,N("div",{class:"ctr",part:"container"},N("rtk-icon",{icon:this.iconPack.breakout_rooms}),N("p",{part:"message",class:"breakout"},this.t(this.message))))}render(){const t=this.states;return"connected-meeting"===t.roomLeftState?this.renderBreakoutRoomScreen():N(H,null,N("div",{class:"ctr",part:"container"},N("rtk-logo",{meeting:this.meeting,config:this.config,part:"logo",t:this.t}),N("p",{part:"message"},this.t(this.message)),"disconnected"===(null==t?void 0:t.roomLeftState)&&N("span",{part:"description"},this.t("ended.network"))))}static get watchers(){return{states:["statesChanged"]}}};cd([ai()],ld.prototype,"size",void 0),cd([ai()],ld.prototype,"states",void 0),cd([ai()],ld.prototype,"t",void 0),cd([ai()],ld.prototype,"iconPack",void 0),cd([ai()],ld.prototype,"meeting",void 0),ld.style=":host{line-height:initial;font-family:var(--rtk-font-family, sans-serif);font-feature-settings:normal;font-variation-settings:normal}p{margin:var(--rtk-space-0, 0px);padding:var(--rtk-space-0, 0px)}:host{height:100%;width:100%;-webkit-user-select:none;-moz-user-select:none;user-select:none;display:flex;flex-direction:column;align-items:center;justify-content:center}.ctr{display:flex;flex-direction:column;align-items:center;gap:var(--rtk-space-8, 32px)}rtk-logo.loaded{height:var(--rtk-space-12, 48px)}.rejoin-button{margin-top:var(--rtk-space-4, 16px);margin-bottom:var(--rtk-space-4, 16px);padding-top:var(--rtk-space-6, 24px);padding-bottom:var(--rtk-space-6, 24px);padding-left:var(--rtk-space-16, 64px);padding-right:var(--rtk-space-16, 64px)}.rejoin-icon{margin-right:var(--rtk-space-2, 8px)}p{font-size:16px;border-radius:var(--rtk-border-radius-lg, 12px);--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-background-800, 30 30 30) / var(--tw-bg-opacity));padding-left:var(--rtk-space-8, 32px);padding-right:var(--rtk-space-8, 32px);padding-top:var(--rtk-space-4, 16px);padding-bottom:var(--rtk-space-4, 16px);color:rgb(var(--rtk-colors-text-1000, 255 255 255))}p.breakout{font-size:20px;display:flex;flex-direction:column;align-items:center}p.breakout span{margin-top:var(--rtk-space-1, 4px);margin-bottom:var(--rtk-space-0, 0px);color:rgb(var(--rtk-colors-text-600, 255 255 255 / 0.52))}span{margin-top:var(--rtk-space-4, 16px);margin-bottom:var(--rtk-space-4, 16px);font-size:14px}";var dd=Object.freeze({__proto__:null,rtk_ended_screen:ld});var hd=function(t,e,i,r){var a,s=arguments.length,n=s<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,i,r);else for(var o=t.length-1;o>=0;o--)(a=t[o])&&(n=(s<3?a(n):s>3?a(e,i,n):a(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};const pd=class{constructor(t){o(this,t),this.onDropCallback=Y(this,"dropCallback",7),this.iconPack=je,this.t=Fe(),this.dropzoneActivated=!1}connectedCallback(){if(!this.hostEl)throw new Error("hostEl prop is required");this.hostEl.addEventListener("dragover",(t=>{t.preventDefault(),this.dropzoneActivated=!0})),this.hostEl.addEventListener("dragleave",(()=>{this.dropzoneActivated=!1})),this.hostEl.addEventListener("drop",(t=>{t.preventDefault(),this.dropzoneActivated=!1,this.onDropCallback.emit(t)}))}render(){return N(H,{key:"197cf2a1b1deff5e45125b4e489d020d474a02dd"},N("div",{key:"84e88151d3080dc0bd9f44f22b401d605f7f286f",id:"dropzone",class:{active:this.dropzoneActivated},part:"dropzone"},N("rtk-icon",{key:"debea53f3376bb54bca692aed0450cf218f576d3",icon:this.iconPack.attach}),N("p",{key:"19b161b26bd4acc13447c47f5ee17b9645f91cc3"},this.t("chat.send_attachment"))))}};hd([ai()],pd.prototype,"iconPack",void 0),hd([ai()],pd.prototype,"t",void 0),pd.style="#dropzone{position:absolute;top:var(--rtk-space-0, 0px);right:var(--rtk-space-0, 0px);bottom:var(--rtk-space-0, 0px);left:var(--rtk-space-0, 0px);z-index:10;display:none;flex-direction:column;align-items:center;justify-content:center;--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-background-800, 30 30 30) / var(--tw-bg-opacity));color:rgb(var(--rtk-colors-text-700, 255 255 255 / 0.64))}#dropzone.active{display:flex;animation:0.2s slide-up ease-in}";var gd=Object.freeze({__proto__:null,rtk_file_dropzone:pd}),ud="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};var fd=function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)},md="object"==typeof ud&&ud&&ud.Object===Object&&ud,vd="object"==typeof self&&self&&self.Object===Object&&self,bd=md||vd||Function("return this")(),kd=bd,yd=function(){return kd.Date.now()},wd=/\s/;var xd=function(t){for(var e=t.length;e--&&wd.test(t.charAt(e)););return e},Sd=xd,Pd=/^\s+/;var Cd=function(t){return t?t.slice(0,Sd(t)+1).replace(Pd,""):t},Ed=bd.Symbol,Td=Ed,Ld=Object.prototype,_d=Ld.hasOwnProperty,Rd=Ld.toString,Ad=Td?Td.toStringTag:void 0;var Dd=function(t){var e=_d.call(t,Ad),i=t[Ad];try{t[Ad]=void 0;var r=!0}catch(t){}var a=Rd.call(t);return r&&(e?t[Ad]=i:delete t[Ad]),a},Md=Object.prototype.toString;var Id=Dd,Od=function(t){return Md.call(t)},Ud=Ed?Ed.toStringTag:void 0;var $d=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":Ud&&Ud in Object(t)?Id(t):Od(t)},Fd=function(t){return null!=t&&"object"==typeof t};var jd=Cd,zd=fd,Nd=function(t){return"symbol"==typeof t||Fd(t)&&"[object Symbol]"==$d(t)},Bd=/^[-+]0x[0-9a-f]+$/i,Hd=/^0b[01]+$/i,Gd=/^0o[0-7]+$/i,Vd=parseInt;var qd=fd,Kd=yd,Wd=function(t){if("number"==typeof t)return t;if(Nd(t))return NaN;if(zd(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=zd(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=jd(t);var i=Hd.test(t);return i||Gd.test(t)?Vd(t.slice(2),i?2:8):Bd.test(t)?NaN:+t},Yd=Math.max,Zd=Math.min;var Qd=function(t,e,i){var r,a,s,n,o,c,l=0,d=!1,h=!1,p=!0;if("function"!=typeof t)throw new TypeError("Expected a function");function g(e){var i=r,s=a;return r=a=void 0,l=e,n=t.apply(s,i)}function u(t){var i=t-c;return void 0===c||i>=e||i<0||h&&t-l>=s}function f(){var t=Kd();if(u(t))return m(t);o=setTimeout(f,function(t){var i=e-(t-c);return h?Zd(i,s-(t-l)):i}(t))}function m(t){return o=void 0,p&&r?g(t):(r=a=void 0,n)}function v(){var t=Kd(),i=u(t);if(r=arguments,a=this,c=t,i){if(void 0===o)return function(t){return l=t,o=setTimeout(f,e),d?g(t):n}(c);if(h)return clearTimeout(o),o=setTimeout(f,e),g(c)}return void 0===o&&(o=setTimeout(f,e)),n}return e=Wd(e)||0,qd(i)&&(d=!!i.leading,s=(h="maxWait"in i)?Yd(Wd(i.maxWait)||0,e):s,p="trailing"in i?!!i.trailing:p),v.cancel=function(){void 0!==o&&clearTimeout(o),l=0,r=c=a=o=void 0},v.flush=function(){return void 0===o?n:m(Kd())},v};function Jd(t,e){const i=Math.pow(10,e);return Math.floor(t*i)/i}function Xd({dimensions:t,count:e,aspectRatio:i,gap:r}){const{width:a,height:s,rows:n,cols:o}=function({count:t,dimensions:e,aspectRatio:i,gap:r}){let{width:a,height:s}=e;if(0===a||0===s)return{width:0,height:0,rows:1,cols:1};a-=2*r,s-=2*r;const n=r,o=t,c=th(i);let l=0,d=0,h=1,p=1;const g=[];for(let t=1;t<=o;t++)g.push((a-n*(t-1))/t),g.push((s-n*(t-1))/(t*c));g.sort(((t,e)=>e-t));for(const t of g)if(l=Jd(t,4),d=Jd(l*c,4),h=Math.floor((a+n)/(l+n)),p=Math.floor((s+n)/(d+n)),h*p>=o){p=Math.ceil(o/h);break}return{width:l,height:d,rows:p,cols:h}}({dimensions:t,count:e,aspectRatio:i,gap:r}),c=function({parentDimensions:t,dimensions:e,rows:i,cols:r,count:a,gap:s}){const{width:n,height:o}=t,{width:c,height:l}=e,d=(o-(l*i+(i-1)*s))/2;let h=(n-(c*r+(r-1)*s))/2;const p=l+s,g=c+s;let u=0,f=0;const m=a%r;function v(t){const e=a-t;e===m&&(h=(n-(c*e+(e-1)*s))/2);const i=d+f*p,o=h+u*g;return u++,(t+1)%r==0&&(f++,u=0),{top:i,left:o}}return v}({parentDimensions:t,dimensions:{width:a,height:s},rows:n,cols:o,count:e,gap:r});return{width:a,height:s,getPosition:c}}const th=t=>{const[e,i]=t.split(":");return Number.parseInt(i)/Number.parseInt(e)},eh={spotlight:"sm",mixed:"sm"};var ih=function(t,e,i,r){var a,s=arguments.length,n=s<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,i,r);else for(var o=t.length-1;o>=0;o--)(a=t[o])&&(n=(s<3?a(n):s>3?a(e,i,n):a(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};const rh=class{constructor(t){o(this,t),this.stateUpdate=Y(this,"rtkStateUpdate",7),this.hideSelf=!1,this.participants=[],this.pinnedParticipants=[],this.screenShareParticipants=[],this.plugins=[],this.emptyStage=!1,this.showLiveStreamPlayer=!1,this.canCurrentPeerHost=!1,this.pipSupported=!1,this.pipEnabled=!1,this.hidden=!1,this.layout="row",this.aspectRatio="16:9",this.gap=8,this.config=De,this.iconPack=je,this.t=Fe(),this.gridSize=eh,this.overrides={},this.invalidRoomStates=["init","waitlisted","ended","kicked","rejected"],this.filterParticipants=t=>{var e;if(this.overrides&&(null===(e=this.overrides)||void 0===e?void 0:e.videoUnsubscribed)){const e=this.overrides.videoUnsubscribed.preset;e.length>0&&(t=t.filter((t=>!e.some((e=>void 0!==t.presetName&&t.presetName.match(e))))))}return t},this.onViewModeChanged=()=>{null!=this.meeting&&this.updateActiveParticipants()},this.onParticipantJoined=Qd((()=>{this.updateActiveParticipants()}),50),this.onParticipantLeft=Qd((()=>{this.updateActiveParticipants()}),50),this.stageStatusListener=()=>{this.updateActiveParticipants(),this.showLiveStreamPlayer=Yt(this.meeting),"ON_STAGE"!==this.meeting.stage.status&&this.removeScreenShare(this.meeting.self)},this.peerStageStatusListener=t=>{this.updateActiveParticipants(),"ON_STAGE"!==this.meeting.stage.status&&(this.removePinned(t),this.removeScreenShare(t))},this.onScreenShareUpdate=t=>{t.screenShareEnabled?this.addScreenShare(t):this.removeScreenShare(t)},this.onSelfScreenShareUpdate=({screenShareEnabled:t})=>{t?this.addScreenShare(this.meeting.self):this.removeScreenShare(this.meeting.self)},this.toggleTileListener=({hidden:t})=>{this.hidden=t,this.updateActiveParticipants()},this.onPluginStateUpdate=(t,{active:e})=>{e?this.plugins.some((e=>e.id===t.id))||(this.plugins=[...this.plugins,t]):this.plugins=this.plugins.filter((e=>e.id!==t.id))},this.onParticipantPinned=()=>{this.updateActiveParticipants()},this.onParticipantUnpinned=()=>{this.updateActiveParticipants()},this.updateRoomStateListener=()=>{this.roomState=this.meeting.self.roomState}}connectedCallback(){this.meetingChanged(this.meeting)}disconnectedCallback(){this.disconnectMeeting(this.meeting)}disconnectMeeting(t){var e;if(null==t)return;this.participants=[],this.plugins=[];const{self:i,participants:r,plugins:a}=t;i.removeListener("pinned",this.onParticipantPinned),i.removeListener("unpinned",this.onParticipantUnpinned),i.removeListener("roomLeft",this.updateRoomStateListener),i.removeListener("roomJoined",this.updateRoomStateListener),i.removeListener("screenShareUpdate",this.onSelfScreenShareUpdate),i.removeListener("toggleTile",this.toggleTileListener),null==a||a.all.removeListener("stateUpdate",this.onPluginStateUpdate),null===(e=t.stage)||void 0===e||e.removeListener("stageStatusUpdate",this.stageStatusListener),r.removeListener("viewModeChanged",this.onViewModeChanged),r.active.removeListener("participantLeft",this.onParticipantLeft),r.active.removeListener("participantJoined",this.onParticipantJoined),r.pinned.removeListener("participantJoined",this.onParticipantPinned),r.pinned.removeListener("participantLeft",this.onParticipantUnpinned),r.joined.removeListener("screenShareUpdate",this.onScreenShareUpdate),r.joined.removeListener("stageStatusUpdate",this.peerStageStatusListener)}meetingChanged(t,e){var i,r,a,s;if(null!==e&&this.disconnectMeeting(e),null!=t){const{self:e,participants:n,plugins:o,stage:c}=t;this.pipSupported=(null===(i=this.meeting.participants.pip)||void 0===i?void 0:i.isSupported())&&(null===(r=t.self.config)||void 0===r?void 0:r.pipMode),this.pipSupported&&this.meeting.participants.pip.init();const{permissions:l}=e;this.roomState=e.roomState;const d="ON_STAGE"!==this.meeting.stage.status,h=null==l?void 0:l.isRecorder;this.hideSelf=d||h||l.hiddenParticipant,this.participants=this.filterParticipants([...n.active.toArray(),...e.isPinned||this.hideSelf?[]:[e]]),this.pinnedParticipants=[...n.pinned.toArray(),...e.isPinned&&!this.hideSelf?[e]:[]],this.screenShareParticipants=n.joined.toArray().filter((t=>t.screenShareEnabled)),this.plugins=(null==o?void 0:o.active.toArray())||[],(null==l?void 0:l.stageEnabled)&&(this.canCurrentPeerHost=l.acceptStageRequests||l.canPresent,this.updateStage()),this.hidden=t.self.hidden,e.addListener("roomLeft",this.updateRoomStateListener),e.addListener("roomJoined",this.updateRoomStateListener),e.addListener("screenShareUpdate",this.onSelfScreenShareUpdate),e.addListener("pinned",this.onParticipantPinned),e.addListener("unpinned",this.onParticipantUnpinned),e.addListener("toggleTile",this.toggleTileListener),null==c||c.addListener("stageStatusUpdate",this.stageStatusListener),null==o||o.all.addListener("stateUpdate",this.onPluginStateUpdate),n.addListener("viewModeChanged",this.onViewModeChanged),n.active.addListener("participantLeft",this.onParticipantLeft),null===(a=null==n?void 0:n.joined)||void 0===a||a.on("stageStatusUpdate",this.peerStageStatusListener),n.joined.addListener("screenShareUpdate",this.onScreenShareUpdate),n.active.addListener("participantJoined",this.onParticipantJoined),n.pinned.addListener("participantJoined",this.onParticipantPinned),n.pinned.addListener("participantLeft",this.onParticipantUnpinned),(null===(s=t.stage)||void 0===s?void 0:s.status)&&this.stageStatusListener()}}overridesChanged(t){this.updateActiveParticipants()}screenShareParticipantsChanged(t){const e=t.length>0;!!Ze.states.activeScreenShare!==e&&(this.stateUpdate.emit({activeScreenShare:e}),Ze.states.activeScreenShare=e)}pluginsChanged(t){const e=t.length>0;!!Ze.states.activePlugin!==e&&(this.stateUpdate.emit({activePlugin:e}),Ze.states.activePlugin=e)}pinnedParticipantsChanged(t){const e=t.length>0;!!Ze.states.activeSpotlight!==e&&(this.stateUpdate.emit({activeSpotlight:e}),Ze.states.activeSpotlight=e)}updateActiveParticipants(){var t;const{self:e,participants:i,stage:r}=this.meeting;this.hideSelf=this.hidden||"ON_STAGE"!==r.status||(null===(t=e.permissions)||void 0===t?void 0:t.isRecorder)||e.permissions.hiddenParticipant,this.participants=this.filterParticipants([...i.active.toArray().filter((t=>t.id!==e.id)),..."ACTIVE_GRID"!==i.viewMode||e.isPinned||this.hideSelf?[]:[e]]),this.pinnedParticipants=[...i.pinned.toArray().filter((t=>t.id!==e.id)),...e.isPinned&&!this.hideSelf?[e]:[]],this.screenShareParticipants=i.joined.toArray().filter((t=>t.screenShareEnabled)),e.screenShareEnabled&&(this.screenShareParticipants=this.screenShareParticipants.concat([e])),this.updateStage()}updateStage(){var t;const{self:e}=this.meeting;this.meeting&&((null===(t=null==e?void 0:e.permissions)||void 0===t?void 0:t.stageEnabled)?this.emptyStage=0===this.participants.length&&0===this.pinnedParticipants.length:this.emptyStage=!1)}addScreenShare(t){this.screenShareParticipants.some((e=>e.id===t.id))||(this.screenShareParticipants=[...this.screenShareParticipants,t])}removeScreenShare(t){this.screenShareParticipants=this.screenShareParticipants.filter((e=>e.id!==t.id))}removePinned(t){this.pinnedParticipants=this.pinnedParticipants.filter((e=>e.id!==t.id))}render(){const t={meeting:this.meeting,size:this.size,states:this.states,config:this.config,iconPack:this.iconPack,t:this.t};return this.invalidRoomStates.includes(this.roomState)?N(H,null,N("div",{class:"offline-grid"},N("rtk-icon",{icon:this.iconPack.join_stage,size:"xl"}),N("h3",null,this.t("disconnected")),N("p",null,this.t("disconnected.description")))):"disconnected"===this.roomState?N(H,null,N("div",{class:"offline-grid"},N("rtk-icon",{icon:this.iconPack.disconnected,size:"xl"}),N("h3",null,this.t("offline")),N("p",null,this.t("offline.description")))):"failed"===this.roomState?N(H,null,N("div",{class:"offline-grid"},N("rtk-icon",{icon:this.iconPack.disconnected,size:"xl"}),N("h3",null,this.t("failed")),N("p",null,this.t("failed.description")))):this.showLiveStreamPlayer?N(H,null,N("rtk-livestream-player",{meeting:this.meeting,size:this.size}),N("rtk-livestream-indicator",{meeting:this.meeting,size:"sm",t:this.t}),N("rtk-viewer-count",{meeting:this.meeting,variant:"embedded",t:this.t})):this.emptyStage?N(H,null,N("div",{class:"webinar-stage"},N("div",{class:"center"},this.canCurrentPeerHost&&N("div",{class:"ctr",part:"container"},N("p",{class:"message",part:"message"},this.t("stage.empty_host")),N("span",{class:"description",part:"description"},this.t("stage.empty_host_summary"))),!this.canCurrentPeerHost&&N("div",{class:"ctr",part:"container"},N("p",{class:"message",part:"message"},this.t("stage.empty_viewer")))))):N(H,null,N(rr,{element:"rtk-grid",defaults:t,childProps:{participants:this.participants,screenShareParticipants:this.screenShareParticipants,plugins:this.plugins,pinnedParticipants:this.pinnedParticipants,aspectRatio:this.aspectRatio,gap:this.gap,layout:this.layout,gridSize:this.gridSize},onlyChildren:!0}),N("rtk-livestream-indicator",{meeting:this.meeting,size:"sm",t:this.t}),N("rtk-viewer-count",{meeting:this.meeting,variant:"embedded"}))}static get watchers(){return{meeting:["meetingChanged"],overrides:["overridesChanged"],screenShareParticipants:["screenShareParticipantsChanged"],plugins:["pluginsChanged"],pinnedParticipants:["pinnedParticipantsChanged"]}}};ih([ai()],rh.prototype,"meeting",void 0),ih([ai()],rh.prototype,"size",void 0),ih([ai()],rh.prototype,"states",void 0),ih([ai()],rh.prototype,"iconPack",void 0),ih([ai()],rh.prototype,"t",void 0),rh.style=":host{line-height:initial;font-family:var(--rtk-font-family, sans-serif);font-feature-settings:normal;font-variation-settings:normal}p{margin:var(--rtk-space-0, 0px);padding:var(--rtk-space-0, 0px)}:host{display:block;height:100%;width:100%}.offline-grid{display:flex;height:100%;width:100%;flex-direction:column;align-items:center;justify-content:center}.offline-grid h3{margin-top:var(--rtk-space-2, 8px);margin-bottom:var(--rtk-space-2, 8px);margin-left:var(--rtk-space-0, 0px);margin-right:var(--rtk-space-0, 0px);font-size:20px;font-weight:500;color:rgb(var(--rtk-colors-text-900, 255 255 255 / 0.88))}.offline-grid p{margin-top:var(--rtk-space-1, 4px);margin-bottom:var(--rtk-space-1, 4px);margin-left:var(--rtk-space-0, 0px);margin-right:var(--rtk-space-0, 0px);text-align:center;font-size:16px;font-weight:400;color:rgb(var(--rtk-colors-text-700, 255 255 255 / 0.64))}.offline-grid rtk-icon{margin-bottom:var(--rtk-space-2, 8px)}.webinar-stage{box-sizing:border-box;height:100%;display:flex;align-content:center;align-items:center;justify-content:center;text-align:center}.webinar-stage h2{margin:var(--rtk-space-0, 0px);font-weight:normal}rtk-viewer-count{display:none}.ctr{display:flex;flex-direction:column;align-items:center}.message{font-size:16px;border-radius:var(--rtk-border-radius-lg, 12px);--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-background-800, 30 30 30) / var(--tw-bg-opacity));padding-left:var(--rtk-space-8, 32px);padding-right:var(--rtk-space-8, 32px);padding-top:var(--rtk-space-4, 16px);padding-bottom:var(--rtk-space-4, 16px);color:rgb(var(--rtk-colors-text-1000, 255 255 255))}.description{margin-top:var(--rtk-space-4, 16px);margin-bottom:var(--rtk-space-4, 16px);font-size:14px}rtk-livestream-indicator{display:none}@media only screen and (max-device-height: 480px) and (orientation: landscape){rtk-viewer-count[variant='embedded']{position:absolute;top:var(--rtk-space-0, 0px);right:var(--rtk-space-2, 8px);z-index:20;margin-top:var(--rtk-space-0, 0px);margin-left:var(--rtk-space-0, 0px);display:flex}rtk-livestream-indicator{position:absolute;top:var(--rtk-space-0, 0px);left:var(--rtk-space-2, 8px);z-index:20;margin-top:var(--rtk-space-0, 0px);margin-left:var(--rtk-space-0, 0px);display:flex}}";var ah=Object.freeze({__proto__:null,rtk_grid:rh});var sh=function(t,e,i,r){var a,s=arguments.length,n=s<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,i,r);else for(var o=t.length-1;o>=0;o--)(a=t[o])&&(n=(s<3?a(n):s>3?a(e,i,n):a(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};const nh=class{constructor(t){o(this,t),this.variant="rounded",this.iconPack=je,this.t=Fe(),this.page=1,this.pageCount=0,this.activeCount=0,this.activeComputedCount=0,this.showPagination=!1,this.onPageChanged=({currentPage:t,pageCount:e})=>{this.pageCount=e,this.page=t},this.toggleGridPagination=Qd((()=>{var t;const{self:e,participants:i}=this.meeting,{mobile:r,desktop:a}=null===(t=e.config)||void 0===t?void 0:t.maxVideoStreams,s="sm"===this.size?r:a,n=i.joined.toArray().filter((t=>"ON_STAGE"===t.stageStatus)).length;this.showPagination=!(n<s)}),50),this.onParticipantJoin=Qd((()=>{this.pageCount=this.meeting.participants.pageCount,this.toggleGridPagination()}),50),this.onParticipantLeave=Qd((()=>{this.pageCount=this.meeting.participants.pageCount,this.toggleGridPagination()}),50),this.onStateStatusUpdate=Qd((()=>{this.pageCount=this.meeting.participants.pageCount,this.toggleGridPagination()}),50),this.prevPage=()=>{if(null==this.meeting)return;const{participants:t}=this.meeting;this.page>1?t.setPage(this.page-=1):"PAGINATED"===t.viewMode&&t.setViewMode("ACTIVE_GRID")},this.nextPage=()=>{if(null==this.meeting)return;const{participants:t}=this.meeting;this.page>0&&this.page<this.pageCount?t.setPage(this.page+=1):t.count>0&&0===this.pageCount&&t.setViewMode("PAGINATED")}}connectedCallback(){this.meetingChanged(this.meeting),this.sizeChanged()}disconnectedCallback(){if(null==this.meeting)return;const{participants:t,stage:e}=this.meeting;t.removeListener("pageChanged",this.onPageChanged),t.removeListener("viewModeChanged",this.onPageChanged),t.joined.removeListener("participantJoined",this.onParticipantJoin),t.joined.removeListener("participantLeft",this.onParticipantLeave),t.joined.removeListener("stageStatusUpdate",this.onStateStatusUpdate),e.removeListener("stageStatusUpdate",this.onStateStatusUpdate)}meetingChanged(t){if(null!=t){const{stage:e,participants:i}=t;this.page=i.currentPage,this.pageCount=i.pageCount,i.addListener("viewModeChanged",this.onPageChanged),i.addListener("pageChanged",this.onPageChanged),i.joined.addListener("participantJoined",this.onParticipantJoin),i.joined.addListener("participantLeft",this.onParticipantLeave),i.joined.addListener("stageStatusUpdate",this.onStateStatusUpdate),e.addListener("stageStatusUpdate",this.onStateStatusUpdate),this.activeCount=this.meeting.participants.joined.size,this.activeComputedCount=this.meeting.participants.joined.size,this.toggleGridPagination()}}sizeChanged(){this.toggleGridPagination()}render(){const{meta:t}=this.meeting;return"AUDIO_ROOM"===(null==t?void 0:t.viewType)||!this.showPagination?N(H,{"data-hidden":!0}):N(H,null,N("rtk-button",{class:"prev",variant:"secondary",kind:"icon",disabled:0===this.pageCount,onClick:this.prevPage,"aria-label":this.t("page.prev")},N("rtk-icon",{icon:this.iconPack.chevron_left})),"grid"!==this.variant&&N("div",{class:"center"},N("span",{class:"page"},0===this.pageCount?N("rtk-tooltip",{label:this.t("layout.auto")},N("rtk-button",{kind:"icon",class:"auto"},N("rtk-icon",{icon:this.iconPack.wand}))):this.page),0!==this.pageCount&&[N("span",{class:"slash"},"/"),N("span",{class:"pages"},this.pageCount)]),"grid"===this.variant&&this.pageCount>0&&N("div",{class:"dots"},[...Array(this.pageCount)].map(((t,e)=>N("div",{key:`dot-${e}`,class:{dot:!0,active:e+1===this.page}})))),N("rtk-button",{class:"next",variant:"secondary",kind:"icon",disabled:0!==this.page&&this.page===this.pageCount,onClick:this.nextPage,"aria-label":this.t("page.next")},N("rtk-icon",{icon:this.iconPack.chevron_right,tabIndex:-1,"aria-hidden":!0})))}static get watchers(){return{meeting:["meetingChanged"],size:["sizeChanged"]}}};sh([ai()],nh.prototype,"meeting",void 0),sh([ai()],nh.prototype,"states",void 0),sh([ai()],nh.prototype,"size",void 0),sh([ai()],nh.prototype,"iconPack",void 0),sh([ai()],nh.prototype,"t",void 0),nh.style=":host{line-height:initial;font-family:var(--rtk-font-family, sans-serif);font-feature-settings:normal;font-variation-settings:normal}p{margin:var(--rtk-space-0, 0px);padding:var(--rtk-space-0, 0px)}:host{display:flex;-webkit-user-select:none;-moz-user-select:none;user-select:none;align-items:center;font-size:16px}:host([data-hidden]){display:none}:host([size='sm']){font-size:12px}:host([size='sm']) .center{margin-left:var(--rtk-space-0, 0px);margin-right:var(--rtk-space-0, 0px)}:host([size='sm']) rtk-button{height:var(--rtk-space-7, 28px);width:var(--rtk-space-7, 28px)}:host([size='sm']) rtk-button rtk-icon{height:var(--rtk-space-4, 16px);width:var(--rtk-space-4, 16px)}rtk-button{--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)}.center{margin-left:var(--rtk-space-2, 8px);margin-right:var(--rtk-space-2, 8px);color:rgb(var(--rtk-colors-text-700, 255 255 255 / 0.64))}.center .page{color:rgb(var(--rtk-colors-text-900, 255 255 255 / 0.88))}.center .slash{margin-left:var(--rtk-space-0\\.5, 2px);margin-right:var(--rtk-space-0\\.5, 2px)}.center .pages{align-self:flex-end;font-size:12px}:host([variant='rounded']){overflow:hidden;border-radius:9999px;--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-background-800, 30 30 30) / var(--tw-bg-opacity))}:host([variant='rounded']) rtk-button{border-radius:9999px;border-width:var(--rtk-border-width-none, 0);border-style:none;background-color:transparent;color:rgb(var(--rtk-colors-text-700, 255 255 255 / 0.64));transition-property:color, background-color, border-color, text-decoration-color, fill, stroke;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:150ms}:host([variant='rounded']) rtk-button:not([disabled]):hover{--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-background-600, 60 60 60) / var(--tw-bg-opacity))}:host([variant='rounded']) rtk-button:not([disabled]):focus{--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-background-600, 60 60 60) / var(--tw-bg-opacity))}:host([variant='grid']) rtk-button{position:absolute;top:50%;height:var(--rtk-space-20, 80px);width:var(--rtk-space-20, 80px);opacity:0.2;transition-property:color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, -webkit-backdrop-filter;transition-property:color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter;transition-property:color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter, -webkit-backdrop-filter;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:150ms}:host([variant='grid']) rtk-button:hover{opacity:1}:host([variant='grid']) rtk-button{transform:translateY(-50%)}:host([variant='grid']) rtk-button.prev{left:var(--rtk-space-0, 0px);border-top-right-radius:9999px;border-bottom-right-radius:9999px}:host([variant='grid']) rtk-button.next{right:var(--rtk-space-0, 0px);border-top-left-radius:9999px;border-bottom-left-radius:9999px}:host([variant='grid']) rtk-button.auto{left:var(--rtk-space-0, 0px);right:var(--rtk-space-0, 0px);border-top-right-radius:9999px;border-bottom-right-radius:9999px}:host([variant='grid']) .dots{position:absolute;left:50%;bottom:var(--rtk-space-3, 12px);display:flex;align-items:center;transform:translateX(-50%)}:host([variant='grid']) .dots .dot{margin-right:var(--rtk-space-2, 8px);height:var(--rtk-space-2, 8px);width:var(--rtk-space-2, 8px);cursor:pointer;border-radius:9999px;--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-background-700, 44 44 44) / var(--tw-bg-opacity))}:host([variant='grid']) .dots .dot:last-child{margin-right:var(--rtk-space-0, 0px)}:host([variant='grid']) .dots .dot.active{--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-brand-500, 33 96 253) / var(--tw-bg-opacity))}:host([variant='grid'][size='sm']) rtk-button{height:var(--rtk-space-14, 56px);width:var(--rtk-space-14, 56px);opacity:0.1}";var oh=Object.freeze({__proto__:null,rtk_grid_pagination:nh});var ch=function(t,e,i,r){var a,s=arguments.length,n=s<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,i,r);else for(var o=t.length-1;o>=0;o--)(a=t[o])&&(n=(s<3?a(n):s>3?a(e,i,n):a(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};const lh=class{constructor(t){o(this,t),this.variant="solid",this.disableRender=!1,this.config=De,this.iconPack=je,this.t=Fe()}render(){const t={meeting:this.meeting,config:this.config,states:this.states,t:this.t,iconPack:this.iconPack,size:this.size};return N(H,{key:"0b3c18e3927465e198c26f79d810dadc31ebb74b"},!this.disableRender&&N(rr,{key:"480d2f17a6d831dabb3d39abceb33fbc1aa6d78d",element:"rtk-header",defaults:t,onlyChildren:!0}),N("slot",{key:"67f89c4a3574ba22976d3aa57268aabe4ce78d2a"}))}};ch([ai()],lh.prototype,"meeting",void 0),ch([ai()],lh.prototype,"states",void 0),ch([ai()],lh.prototype,"iconPack",void 0),ch([ai()],lh.prototype,"t",void 0),ch([ai()],lh.prototype,"size",void 0),lh.style=":host{line-height:initial;font-family:var(--rtk-font-family, sans-serif);font-feature-settings:normal;font-variation-settings:normal}p{margin:var(--rtk-space-0, 0px);padding:var(--rtk-space-0, 0px)}:host{display:flex;height:var(--rtk-space-12, 48px);align-items:center;--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-background-1000, 8 8 8) / var(--tw-bg-opacity));padding-left:var(--rtk-space-4, 16px);padding-right:var(--rtk-space-4, 16px)}@media only screen and (max-device-height: 480px) and (orientation: landscape){:host{display:none !important}}@media only screen and (max-height: 480px) and (orientation: landscape){:host{display:none !important}}";var dh=Object.freeze({__proto__:null,rtk_header:lh});var hh=function(t,e,i,r){var a,s=arguments.length,n=s<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,i,r);else for(var o=t.length-1;o>=0;o--)(a=t[o])&&(n=(s<3?a(n):s>3?a(e,i,n):a(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};const ph=class{constructor(t){o(this,t),this.config=De,this.iconPack=je,this.t=Fe()}render(){return N(H,{key:"9f9d0064dfc52af63ae90921929b25c822cb4d8c"},N("slot",{key:"c1c5744d86e89b22fa5f5c1b623ea97c0a1d2731"},N("div",{key:"25e311957c411c61940fa1d51e350d466b0b2c92",class:"ctr",part:"container"},N("rtk-logo",{key:"daac0467ba4c3f5f9c7e23667c928e4ed40d6f96",meeting:this.meeting,config:this.config,t:this.t,part:"logo"}),N("rtk-spinner",{key:"c36f58219362cb8d6c31eb975004428439592d3f","aria-label":"Idle, waiting for meeting data",part:"spinner",iconPack:this.iconPack}))))}};hh([ai()],ph.prototype,"meeting",void 0),hh([ai()],ph.prototype,"iconPack",void 0),hh([ai()],ph.prototype,"t",void 0),ph.style=":host{line-height:initial;font-family:var(--rtk-font-family, sans-serif);font-feature-settings:normal;font-variation-settings:normal}p{margin:var(--rtk-space-0, 0px);padding:var(--rtk-space-0, 0px)}:host{height:100%;width:100%;display:flex;flex-direction:column;align-items:center;justify-content:center}.ctr{display:flex;flex-direction:column;align-items:center;gap:var(--rtk-space-8, 32px)}rtk-logo.loaded{height:var(--rtk-space-12, 48px)}rtk-spinner{height:var(--rtk-space-12, 48px);width:var(--rtk-space-12, 48px);--tw-text-opacity:1;color:rgba(var(--rtk-colors-brand-500, 33 96 253) / var(--tw-text-opacity))}";var gh=Object.freeze({__proto__:null,rtk_idle_screen:ph});var uh=function(t,e,i,r){var a,s=arguments.length,n=s<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,i,r);else for(var o=t.length-1;o>=0;o--)(a=t[o])&&(n=(s<3?a(n):s>3?a(e,i,n):a(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};const fh=class{constructor(t){o(this,t),this.close=Y(this,"close",7),this.t=Fe(),this.iconPack=je,this.keypressListener=t=>{"Escape"===t.key&&this.close.emit()},this.handleOutsideClick=()=>this.close.emit()}connectedCallback(){document.addEventListener("keydown",this.keypressListener),document.addEventListener("click",this.handleOutsideClick)}disconnectedCallback(){document.removeEventListener("keydown",this.keypressListener),document.removeEventListener("click",this.handleOutsideClick)}render(){return N(H,{key:"2bb235425497f7932f5cfd73ab7faa2c15d3691d",class:"scrollbar",onClick:t=>t.stopPropagation()},N("div",{key:"04dd5a250967f61e20b7b8fe559ca4ea1012f949",class:"header"},N("div",{key:"9f533863c5d32c7333c872333d7c6c14c02f5827",class:"shared-by-user"},this.t("chat.img.shared_by")," ",N("span",{key:"6e24710128bef29114ba0fa4f7c06561a7293a96",class:"displayName"},ti(Qe(this.image.displayName)))),N("div",{key:"1d7e518f2b61c74634885518450a0364691205cb",class:"actions"},N("rtk-button",{key:"b9ca96cf9eef4dfe347412daeec77f6b5183e5c5",onClick:()=>nr(this.image.link,{fallbackName:"image"})},N("rtk-icon",{key:"ee1326105412e04d113b35a8b1815f22c0699b87",icon:this.iconPack.download,slot:"start"}),"Download"),N("rtk-button",{key:"240d7f9f00f19031402bfca7c54d65a1f3bbef6d",kind:"icon",variant:"secondary",onClick:()=>this.close.emit()},N("rtk-icon",{key:"91e47a9b52baf9f28efda7b1d98f12d90724da1f",icon:this.iconPack.dismiss})))),N("div",{key:"e50deb0d992a18b49641ccfde023f256083d05c7",class:"image-ctr"},N("img",{key:"febe53b5401100dd4a7e9c46693302e4c8dd711c",src:this.image.link})))}};uh([ai()],fh.prototype,"size",void 0),uh([ai()],fh.prototype,"t",void 0),uh([ai()],fh.prototype,"iconPack",void 0),fh.style=":host{line-height:initial;font-family:var(--rtk-font-family, sans-serif);font-feature-settings:normal;font-variation-settings:normal}p{margin:var(--rtk-space-0, 0px);padding:var(--rtk-space-0, 0px)}.scrollbar{scrollbar-width:thin;scrollbar-color:var(--rtk-scrollbar-color, rgb(var(--rtk-colors-background-600, 60 60 60)))\n var(--rtk-scrollbar-background, transparent)}.scrollbar::-webkit-scrollbar{height:var(--rtk-space-1\\.5, 6px);width:var(--rtk-space-1\\.5, 6px);border-radius:9999px;background-color:var(--rtk-scrollbar-background, transparent)}.scrollbar::-webkit-scrollbar-thumb{border-radius:9999px;background-color:var(--rtk-scrollbar-color, rgb(var(--rtk-colors-background-600, 60 60 60)))}:host{width:1140px;max-width:100%;box-sizing:border-box;display:flex;flex-direction:column;padding:var(--rtk-space-6, 24px);padding-top:var(--rtk-space-5, 20px);overflow-y:auto;color:rgb(var(--rtk-colors-text-1000, 255 255 255));z-index:40;border-radius:var(--rtk-border-radius-md, 8px);--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-background-900, 26 26 26) / var(--tw-bg-opacity))}.displayName{font-weight:700}.image-ctr{margin-top:var(--rtk-space-2, 8px);box-sizing:border-box;display:flex;justify-content:center;overflow:hidden}.actions{display:flex;align-items:center;justify-content:flex-end;gap:var(--rtk-space-2, 8px)}img{box-sizing:border-box;display:block;max-height:100%;max-width:100%;-o-object-fit:contain;object-fit:contain}.header{display:flex;align-items:center;justify-content:space-between;padding-bottom:var(--rtk-space-4, 16px)}.shared-by-user{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:1}:host([size='sm']) .header{flex-direction:column}:host([size='sm']) .header .actions{margin-top:var(--rtk-space-4, 16px)}";var mh=Object.freeze({__proto__:null,rtk_image_viewer:fh});const vh=class{constructor(t){o(this,t),this.iconPack=je}render(){return N(H,{key:"3dc48c8a69876a68b038340a948057dd04a5e9ef"},N("div",{key:"1f5a9c5379f882b249dee77376959d9b4de09d0b",class:"tooltip-container"},N("rtk-icon",{key:"cb0232b6e72f565895d3027747f957cba0e4910f",icon:this.iconPack.info,size:"sm"}),N("div",{key:"35a1b7abbb2026badb606444b330fcb239865d9f",class:"tooltip"},N("slot",{key:"3295df905bcd5c10f31d211e74bf7a0e4413dd87",name:"tootlip-text"}))))}};!function(t,e,i,r){var a,s=arguments.length,n=s<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,i,r);else for(var o=t.length-1;o>=0;o--)(a=t[o])&&(n=(s<3?a(n):s>3?a(e,i,n):a(e,i))||n);s>3&&n&&Object.defineProperty(e,i,n)}([ai()],vh.prototype,"iconPack",void 0),vh.style=":host{margin-left:var(--rtk-space-2, 8px);margin-right:var(--rtk-space-2, 8px);cursor:pointer}.tooltip-container{position:relative;display:flex;flex-direction:row;align-items:center}.tooltip-container rtk-icon{cursor:pointer;color:rgb(var(--rtk-colors-text-600, 255 255 255 / 0.52))}.tooltip-container rtk-icon:hover+.tooltip{display:flex !important}.tooltip{position:absolute;margin-left:var(--rtk-space-2, 8px);display:none !important;border-radius:var(--rtk-border-radius-md, 8px);--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-background-700, 44 44 44) / var(--tw-bg-opacity));padding:var(--rtk-space-2, 8px);font-weight:400;color:rgb(var(--rtk-colors-text-600, 255 255 255 / 0.52));z-index:50;display:flex;min-width:var(--rtk-space-60, 240px);flex-direction:column;--tw-shadow:0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);--tw-shadow-colored:0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);left:14px}";var bh=Object.freeze({__proto__:null,rtk_information_tooltip:vh});var kh=function(t,e,i,r){var a,s=arguments.length,n=s<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,i,r);else for(var o=t.length-1;o>=0;o--)(a=t[o])&&(n=(s<3?a(n):s>3?a(e,i,n):a(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};const yh=class{constructor(t){o(this,t),this.stateUpdate=Y(this,"rtkStateUpdate",7),this.variant="button",this.iconPack=je,this.t=Fe(),this.leave=()=>{this.stateUpdate.emit({activeLeaveConfirmation:!0})}}render(){const t=this.t("leave");return N(H,{key:"2ce38b68e83d44e924766230f74b18111db72771",label:t},N("rtk-controlbar-button",{key:"5bdc59145416c548a980178df00225781bbbadcc",size:this.size,iconPack:this.iconPack,class:"leave red-icon",onClick:this.leave,icon:this.iconPack.call_end,label:t,variant:this.variant,part:"controlbar-button"}))}};kh([ai()],yh.prototype,"size",void 0),kh([ai()],yh.prototype,"iconPack",void 0),kh([ai()],yh.prototype,"t",void 0),yh.style=":host{line-height:initial;font-family:var(--rtk-font-family, sans-serif);font-feature-settings:normal;font-variation-settings:normal}p{margin:var(--rtk-space-0, 0px);padding:var(--rtk-space-0, 0px)}:host{display:block}";var wh=Object.freeze({__proto__:null,rtk_leave_button:yh});var xh=function(t,e,i,r){var a,s=arguments.length,n=s<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,i,r);else for(var o=t.length-1;o>=0;o--)(a=t[o])&&(n=(s<3?a(n):s>3?a(e,i,n):a(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};const Sh=class{constructor(t){o(this,t),this.stateUpdate=Y(this,"rtkStateUpdate",7),this.apiError=Y(this,"rtkApiError",7),this.variant="button",this.iconPack=je,this.t=Fe(),this.livestreamState="IDLE",this.livestreamStateListener=t=>{this.livestreamState=t,"LIVESTREAMING"!==t&&"IDLE"!==t||this.stateUpdate.emit({activeMoreMenu:!1})},this.isLoading=()=>null==this.meeting||"STARTING"===this.livestreamState||"STOPPING"===this.livestreamState}connectedCallback(){this.meetingChanged(this.meeting)}disconnectedCallback(){this.clearListeners()}meetingChanged(t){var e,i;null!=t&&(this.livestreamState=null===(e=this.meeting.livestream)||void 0===e?void 0:e.state,null===(i=this.meeting.livestream)||void 0===i||i.on("livestreamUpdate",this.livestreamStateListener))}async toggleLivestream(){var t,e;if("LIVESTREAMING"===this.livestreamState)try{await(null===(t=this.meeting.livestream)||void 0===t?void 0:t.stop())}catch(t){this.apiError.emit({trace:this.t("livestream.stop"),message:this.t("livestream.error.stop")})}else try{await(null===(e=this.meeting.livestream)||void 0===e?void 0:e.start())}catch(t){this.apiError.emit({trace:this.t("livestream.start"),message:this.t("livestream.error.start")})}}clearListeners(){var t;null===(t=this.meeting.livestream)||void 0===t||t.removeListener("livestreamUpdate",this.livestreamStateListener)}getLivestreamLabel(){switch(this.livestreamState){case"IDLE":return this.t("livestream.go_live");case"LIVESTREAMING":return this.t("livestream.end_live");case"WAITING_ON_MANUAL_INGESTION":return this.t("livestream.waiting_on_manual_ingestion");case"STARTING":return this.t("livestream.starting");case"STOPPING":return this.t("livestream.stopping");default:return this.t("livestream.error")}}getLivestreamIcon(){switch(this.livestreamState){case"IDLE":case"WAITING_ON_MANUAL_INGESTION":return this.iconPack.start_livestream;default:return this.iconPack.stop_livestream}}render(){return Zt(this.meeting)?N(H,null,N("rtk-controlbar-button",{part:"controlbar-button",size:this.size,iconPack:this.iconPack,isLoading:this.isLoading(),class:{"active-livestream":"LIVESTREAMING"===this.livestreamState},onClick:()=>this.toggleLivestream(),icon:this.getLivestreamIcon(),disabled:this.isLoading(),label:this.t(this.getLivestreamLabel()),variant:this.variant})):N(H,{"data-hidden":!0})}static get watchers(){return{meeting:["meetingChanged"]}}};xh([ai()],Sh.prototype,"meeting",void 0),xh([ai()],Sh.prototype,"size",void 0),xh([ai()],Sh.prototype,"iconPack",void 0),xh([ai()],Sh.prototype,"t",void 0),Sh.style=":host{line-height:initial;font-family:var(--rtk-font-family, sans-serif);font-feature-settings:normal;font-variation-settings:normal}p{margin:var(--rtk-space-0, 0px);padding:var(--rtk-space-0, 0px)}:host{display:block}:host([data-hidden]){display:none}";var Ph=Object.freeze({__proto__:null,rtk_livestream_toggle:Sh});var Ch=function(t,e,i,r){var a,s=arguments.length,n=s<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,i,r);else for(var o=t.length-1;o>=0;o--)(a=t[o])&&(n=(s<3?a(n):s>3?a(e,i,n):a(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};const Eh=class{constructor(t){o(this,t),this.iconPack=je,this.t=Fe()}render(){var t;const e=null===(t=this.meeting)||void 0===t?void 0:t.meta.meetingTitle;return null==e?N(H,{"data-hidden":!0}):N(H,{role:"banner","aria-label":e},N("rtk-tooltip",{label:e,part:"tooltip"},N("div",{class:"title",part:"title"},e)))}};Ch([ai()],Eh.prototype,"meeting",void 0),Ch([ai()],Eh.prototype,"iconPack",void 0),Ch([ai()],Eh.prototype,"t",void 0),Eh.style=":host{line-height:initial;font-family:var(--rtk-font-family, sans-serif);font-feature-settings:normal;font-variation-settings:normal}p{margin:var(--rtk-space-0, 0px);padding:var(--rtk-space-0, 0px)}:host{-webkit-user-select:none;-moz-user-select:none;user-select:none;font-size:16px;color:rgb(var(--rtk-colors-text-1000, 255 255 255))}:host([data-hidden]){display:none}.title{text-align:center;overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:1}:host([size='sm']){font-size:12px}";var Th=Object.freeze({__proto__:null,rtk_meeting_title:Eh});const Lh=class{constructor(t){o(this,t),this.visibleItemsCount=20,this.estimateItemSize=100,this.iconPack=je,this.isFetching=!1,this.autoScroll=!0,this.totalHeight=0,this.sizes=new Map,this.lastScrollTop=0,this.scrollToBottomRetries=0,this.elementObserver=(()=>{let t=null;const e=()=>t||("undefined"!=typeof ResizeObserver?t=new ResizeObserver((t=>{t.forEach((t=>{this.measureElement(t.target,t)}))})):null);return{disconnect:()=>{var t;return null===(t=e())||void 0===t?void 0:t.disconnect()},observe:t=>{var i;return null===(i=e())||void 0===i?void 0:i.observe(t,{box:"border-box"})},unobserve:t=>{var i;return null===(i=e())||void 0===i?void 0:i.unobserve(t)}}})(),this.measureElement=(t,e)=>{if(!t)return;const i=t.dataset.id;if(this.sizes.has(i))return void this.elementObserver.unobserve(t);if(e){const r=e.borderBoxSize[0];if(r&&r.blockSize>0)return this.saveItemSize(i,r.blockSize),void this.elementObserver.unobserve(t)}const r=t.getBoundingClientRect();r.height>0&&this.saveItemSize(i,r.height)},this.getVisibleItems=()=>this.messages.slice(this.range.start,this.range.end+1),this.updateVisibleItems=(t,e)=>{const i=this.messages.length;let r=t,a=e;i<=this.visibleItemsCount?(r=0,a=i-1):e-t<this.visibleItemsCount-1&&(r=this.range.end-this.visibleItemsCount+1),this.range.start!==r&&(this.range={start:r,end:a},this.totalHeight=this.getRangeSize(0,i))},this.getEstimatedItemSize=()=>this.estimateItemSize,this.getRangeSize=(t,e)=>{let i=0,r=0;for(let a=t;a<e;a++)r=this.sizes.get(this.messages[a].id),i+=r||this.getEstimatedItemSize();return i},this.getScrollTop=()=>this.$listRef?Math.ceil(this.$listRef.scrollTop):0,this.getClientHeight=()=>this.$listRef?Math.ceil(this.$listRef.clientHeight):0,this.getScrollHeight=()=>this.$listRef?Math.ceil(this.$listRef.scrollHeight):0,this.getItemsScrolled=()=>{const t=this.lastScrollTop;if(t<=0)return 0;let e=0,i=0,r=0,a=this.messages.length;for(;e<=a;){if(i=e+a>>>1,r=this.getRangeSize(0,i),r===t)return i;r<t?e=i+1:r>t&&(a=i-1)}return e>0?--e:0},this.getEndByStart=t=>Math.min(t+this.visibleItemsCount,this.messages.length-1),this.scrollToOffset=t=>{this.$listRef&&(this.$listRef.scrollTop=t)},this.scrollToIndex=t=>{if(t>=this.messages.length-1)this.scrollToBottom();else{const e=t<1?0:this.getRangeSize(0,t);this.scrollToOffset(e)}},this.scrollToBottom=()=>{this.$listEndRef&&C((()=>{this.$listEndRef.scrollIntoView(),this.getScrollHeight()-(this.getScrollTop()+this.getClientHeight())>0&&this.scrollToBottomRetries<10?setTimeout((()=>{this.scrollToBottom()}),1e3/60):(this.scrollToBottomRetries=0,this.autoScroll=!0)}))},this.handleScroll=async()=>{if(this.isFetching)return;const t=this.getScrollTop(),e=t<this.lastScrollTop||0===t?"UP":"DOWN";if(this.lastScrollTop=t,this.loadMore&&0===t&&"UP"===e&&!1===this.isFetching){this.isFetching=!0;const t=await this.loadMore(this.messages[0]);t&&t.length&&(this.messages=[...t,...this.messages]),this.isFetching=!1}"UP"===e?this.handleTop():"DOWN"===e&&this.handleBottom()},this.handleTop=()=>{const t=this.getItemsScrolled();if(t<=this.range.end-5&&(this.autoScroll=!1),t>this.range.start+5)return;const e=Math.max(this.range.start-5,0);this.updateVisibleItems(e,this.getEndByStart(e))},this.handleBottom=()=>{if(this.getItemsScrolled()<this.range.start+5)return;const t=this.range.start+5,e=this.getEndByStart(t);e===this.messages.length-1?this.updateVisibleItems(e-this.visibleItemsCount,e):this.updateVisibleItems(t,e)},this.updateTotalHeight=_i((()=>{this.totalHeight=this.getRangeSize(0,this.messages.length)}),1e3/30,{leading:!0}),this.rendererInternal=(t,e,i)=>{if(!t)return;if(t.dataset.id===e.id)return;const r=this.renderer(e,i);t.hasChildNodes&&(t.innerHTML=""),this.elementObserver.observe(t),t.dataset.id=e.id,t.appendChild(r)}}connectedCallback(){const t=this.messages.length-1;this.range={start:t-this.visibleItemsCount,end:t},this.updateVisibleItems(this.range.start,this.range.end),this.totalHeight=this.getRangeSize(0,t)}componentDidLoad(){this.autoScroll&&this.scrollToBottom()}messagesUpdated(t,e){if(t.length>e.length){const i=t.length-e.length;this.updateVisibleItems(i,this.getEndByStart(i)),this.scrollToIndex(this.range.start)}}saveItemSize(t,e){this.sizes.set(t,Math.round(e)),this.updateTotalHeight()}render(){return N("div",{key:"0bd9791d55b2c7b17e0f2165815d592e400612b6",class:"scrollbar content-wrapper",ref:t=>this.$listRef=t,onScroll:this.handleScroll},N("div",{key:"b255bce421935f065862a6a3a34e9ae588c936cd",class:"scroller"},N("div",{key:"3eab5b317790b234f1a5c1935d7b8bf4d48620eb",style:{height:`${this.totalHeight}px`}}),N("div",{key:"47d070acc6cdd5e5cdd146594dbcb53906e5fc37",class:"smallest-dom-element",id:"list-end",ref:t=>this.$listEndRef=t})),N("div",{key:"348ec8b65c0f76146f6ab65cbda80057dde6d93d",class:"content",style:{transform:`translateY(${this.getRangeSize(0,this.range.start)}px)`}},this.isFetching&&N("div",{key:"100d528dae04469574a6c908ba4e0159d61a928f",class:"loader"},N("rtk-spinner",{key:"a3a7cc932bd40b71bf67d9bb95cb7cdd8e36696f",size:"md"})),this.getVisibleItems().map(((t,e)=>N("div",{key:t.id,ref:i=>this.rendererInternal(i,t,e)})))))}static get watchers(){return{messages:["messagesUpdated"]}}};!function(t,e,i,r){var a,s=arguments.length,n=s<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,i,r);else for(var o=t.length-1;o>=0;o--)(a=t[o])&&(n=(s<3?a(n):s>3?a(e,i,n):a(e,i))||n);s>3&&n&&Object.defineProperty(e,i,n)}([ai()],Lh.prototype,"iconPack",void 0),Lh.style=":host{line-height:initial;font-family:var(--rtk-font-family, sans-serif);font-feature-settings:normal;font-variation-settings:normal}p{margin:var(--rtk-space-0, 0px);padding:var(--rtk-space-0, 0px)}.scrollbar{scrollbar-width:thin;scrollbar-color:var(--rtk-scrollbar-color, rgb(var(--rtk-colors-background-600, 60 60 60)))\n var(--rtk-scrollbar-background, transparent)}.scrollbar::-webkit-scrollbar{height:var(--rtk-space-1\\.5, 6px);width:var(--rtk-space-1\\.5, 6px);border-radius:9999px;background-color:var(--rtk-scrollbar-background, transparent)}.scrollbar::-webkit-scrollbar-thumb{border-radius:9999px;background-color:var(--rtk-scrollbar-color, rgb(var(--rtk-colors-background-600, 60 60 60)))}.loading{cursor:wait}.content-wrapper{height:100%;overflow-y:auto;position:relative;contain:strict}.scroller{width:1px;opacity:0}.content{position:absolute;top:0;width:100%}.smallest-dom-element{width:100%;height:2px;background:red}.loader{margin-top:var(--rtk-space-2, 8px);margin-bottom:var(--rtk-space-2, 8px);display:flex;justify-content:center}";var _h=Object.freeze({__proto__:null,rtk_message_list_view:Lh});var Rh=function(t,e,i,r){var a,s=arguments.length,n=s<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,i,r);else for(var o=t.length-1;o>=0;o--)(a=t[o])&&(n=(s<3?a(n):s>3?a(e,i,n):a(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};const Ah=class{constructor(t){o(this,t),this.stateUpdate=Y(this,"rtkStateUpdate",7),this.audioUpdateListener=({audioEnabled:t})=>{this.audioEnabled=t},this.stageStatusListener=()=>{this.stageStatus=this.meeting.stage.status,this.canProduceAudio="ALLOWED"===this.meeting.self.permissions.canProduceAudio},this.mediaPermissionUpdateListener=({kind:t,message:e})=>{"audio"===t&&(this.micPermission=e)},this.meetingPermissionsUpdateListener=t=>{var e;(null===(e=null==t?void 0:t.media)||void 0===e?void 0:e.audio)&&(this.canProduceAudio="ALLOWED"===this.meeting.self.permissions.canProduceAudio)},this.variant="button",this.iconPack=je,this.t=Fe(),this.audioEnabled=!1,this.canProduceAudio=!1,this.micPermission="NOT_REQUESTED",this.stageStatus="OFF_STAGE",this.toggleMic=()=>{var t,e,i,r,a,s,n,o,c,l,d,h;if(null===(t=this.meeting)||void 0===t||t.__internals__.logger.info("rtkMicToggle::toggleMic",{media:{audio:{enabled:Boolean(null===(i=null===(e=this.meeting)||void 0===e?void 0:e.self)||void 0===i?void 0:i.audioEnabled),permission:this.micPermission,canProduce:null===(s=null===(a=null===(r=this.meeting)||void 0===r?void 0:r.self)||void 0===a?void 0:a.permissions)||void 0===s?void 0:s.canProduceAudio}},webinar:{stageStatus:null===(o=null===(n=this.meeting)||void 0===n?void 0:n.stage)||void 0===o?void 0:o.status},livestream:{stageStatus:null===(l=null===(c=this.meeting)||void 0===c?void 0:c.stage)||void 0===l?void 0:l.status},moduleExists:{self:Boolean(null===(d=this.meeting)||void 0===d?void 0:d.self)}}),this.hasPermissionError()){const t={enabled:!0,kind:"audio"};return this.stateUpdate.emit({activePermissionsMessage:t}),!1}const p=null===(h=this.meeting)||void 0===h?void 0:h.self;null!=p&&this.canProduceAudio&&(p.audioEnabled?p.disableAudio():p.enableAudio())}}connectedCallback(){this.meetingChanged(this.meeting)}disconnectedCallback(){var t,e,i,r,a,s,n;null===(t=this.meeting)||void 0===t||t.self.removeListener("audioUpdate",this.audioUpdateListener),null===(e=this.meeting)||void 0===e||e.self.removeListener("mediaPermissionUpdate",this.mediaPermissionUpdateListener),null===(r=null===(i=this.meeting)||void 0===i?void 0:i.stage)||void 0===r||r.removeListener("stageStatusUpdate",this.stageStatusListener),null===(n=null===(s=null===(a=this.meeting)||void 0===a?void 0:a.self)||void 0===s?void 0:s.permissions)||void 0===n||n.removeListener("permissionsUpdate",this.meetingPermissionsUpdateListener)}meetingChanged(t){var e,i;if(null!=t){const{self:r,stage:a}=t;this.canProduceAudio="ALLOWED"===this.meeting.self.permissions.canProduceAudio,this.micPermission=t.self.mediaPermissions.audio||"NOT_REQUESTED",this.audioEnabled=r.audioEnabled,this.stageStatus=t.stage.status,r.addListener("audioUpdate",this.audioUpdateListener),r.addListener("mediaPermissionUpdate",this.mediaPermissionUpdateListener),null==a||a.addListener("stageStatusUpdate",this.stageStatusListener),null===(i=null===(e=t.self)||void 0===e?void 0:e.permissions)||void 0===i||i.addListener("permissionsUpdate",this.meetingPermissionsUpdateListener)}}hasPermissionError(){return"DENIED"===this.micPermission||"SYSTEM_DENIED"===this.micPermission}getState(){let t="",e="",i="",r={},a=this.hasPermissionError(),s="COULD_NOT_START"===this.micPermission;return this.audioEnabled&&!a?(e=this.t("mic_on"),i=this.iconPack.mic_on):(e=this.t("mic_off"),i=this.iconPack.mic_off,r["red-icon"]=!0),t=s?this.t("perm_could_not_start.audio"):"SYSTEM_DENIED"===this.micPermission?this.t("perm_sys_denied.audio"):"DENIED"===this.micPermission?this.t("perm_denied.audio"):this.audioEnabled?this.t("disable_mic"):this.t("enable_mic"),{tooltipLabel:t,label:e,icon:i,classList:r,showWarning:a||s,disable:a}}render(){if(!this.canProduceAudio||["OFF_STAGE","REQUESTED_TO_JOIN_STAGE"].includes(this.stageStatus))return N(H,{"data-hidden":!0});const{tooltipLabel:t,label:e,icon:i,classList:r,showWarning:a,disable:s}=this.getState();return N(H,{title:e},N("rtk-tooltip",{kind:"block",label:t,part:"tooltip"},N("rtk-controlbar-button",{part:"controlbar-button",icon:i,label:e,size:this.size,iconPack:this.iconPack,variant:this.variant,class:r,onClick:this.toggleMic,showWarning:a,disabled:s})))}static get watchers(){return{meeting:["meetingChanged"]}}};Rh([ai()],Ah.prototype,"meeting",void 0),Rh([ai()],Ah.prototype,"size",void 0),Rh([ai()],Ah.prototype,"iconPack",void 0),Rh([ai()],Ah.prototype,"t",void 0),Ah.style=":host{line-height:initial;font-family:var(--rtk-font-family, sans-serif);font-feature-settings:normal;font-variation-settings:normal}p{margin:var(--rtk-space-0, 0px);padding:var(--rtk-space-0, 0px)}:host{display:block}:host([data-hidden]){display:none}:host(.audioDisabled) :slotted(rtk-icon){--tw-text-opacity:1;color:rgba(var(--rtk-colors-danger, 255 45 45) / var(--tw-text-opacity))}";var Dh=Object.freeze({__proto__:null,rtk_mic_toggle:Ah});var Mh=function(t,e,i,r){var a,s=arguments.length,n=s<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,i,r);else for(var o=t.length-1;o>=0;o--)(a=t[o])&&(n=(s<3?a(n):s>3?a(e,i,n):a(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};const Ih=class{constructor(t){o(this,t),this.layout="row",this.participants=[],this.pinnedParticipants=[],this.screenShareParticipants=[],this.plugins=[],this.aspectRatio="16:9",this.gap=8,this.config=De,this.iconPack=je,this.t=Fe(),this.gridSize=eh}componentWillLoad(){this.initialised=!1,this.screenShareParticipantsChanged(this.screenShareParticipants),this.pluginsChanged(this.plugins),this.initialised=!0}connectedCallback(){this.meetingChanged(this.meeting)}disconnectedCallback(){var t;null===(t=this.meeting.meta)||void 0===t||t.removeListener("activeTabUpdate",this.activeTabUpdateListener)}meetingChanged(t){var e,i,r,a;null!=t&&(null!=(null===(e=t.meta)||void 0===e?void 0:e.selfActiveTab)&&this.onActiveTabUpdate(null===(i=t.meta.selfActiveTab)||void 0===i?void 0:i.type,null===(r=t.meta.selfActiveTab)||void 0===r?void 0:r.id),this.activeTabUpdateListener=t=>{this.onActiveTabUpdate(null==t?void 0:t.type,null==t?void 0:t.id)},null===(a=t.meta)||void 0===a||a.addListener("activeTabUpdate",this.activeTabUpdateListener))}screenShareParticipantsChanged(t=[]){(this.initialised||null==this.activeTab)&&(null==this.activeTab&&t.length>0?this.setActiveTab({type:"screenshare",participant:t[0]}):this.revalidateActiveTab())}pluginsChanged(t){if(this.initialised||null==this.activeTab)if(t.length>0){const e=t.length-1;this.setActiveTab({type:"plugin",plugin:t[e]})}else this.revalidateActiveTab()}revalidateActiveTab(){if(null!=this.activeTab)if("screenshare"===this.activeTab.type){const{participant:t}=this.activeTab;this.screenShareParticipants.some((e=>e.id===t.id))||this.reassignActiveTab()}else{const{plugin:t}=this.activeTab;this.plugins.some((e=>e.id===t.id))||this.reassignActiveTab()}}setActiveTab(t,e=!0){var i;this.activeTab=t;const r="screenshare"===t.type?t.participant.id:t.plugin.id;e&&(null===(i=this.meeting.meta)||void 0===i||i.setSelfActiveTab({type:t.type,id:r},0))}reassignActiveTab(){if(this.screenShareParticipants.length>0)this.setActiveTab({type:"screenshare",participant:this.screenShareParticipants[0]});else if(this.plugins.length>0){const t=this.plugins.length-1;this.setActiveTab({type:"plugin",plugin:this.plugins[t]})}}onActiveTabUpdate(t,e){if(null!=t&&null!=e)switch(t){case"plugin":const t=this.plugins.find((t=>t.id===e));null!=t&&this.setActiveTab({type:"plugin",plugin:t},!1);break;case"screenshare":const i=this.screenShareParticipants.find((t=>t.id===e));null!=i&&this.setActiveTab({type:"screenshare",participant:i},!1)}}getTabs(){const t=this.screenShareParticipants.map((t=>({type:"screenshare",participant:t}))),e=this.plugins.map((t=>({type:"plugin",plugin:t})));return t.concat(e)}render(){var t,e;const i={meeting:this.meeting,config:this.config,states:this.states,size:this.size,iconPack:this.iconPack,t:this.t};return N(H,{key:"52e26a16c20eee51ac0f3d01d932df88d58acb05"},N("main",{key:"1838e7498d579bf70346bf921c9f3966721a1eea",id:"main-view",part:"main-view"},(null===(t=this.getTabs())||void 0===t?void 0:t.length)>1&&N("rtk-tab-bar",Object.assign({key:"b3f5f77e4b0bd36d12014881f0507c9de6e613af",activeTab:this.activeTab,tabs:this.getTabs(),onTabChange:t=>this.setActiveTab(t.detail)},i)),N("div",{id:"tabs",key:"tabs"},this.screenShareParticipants.map((t=>{var e,r;return N(rr,{element:"rtk-screenshare-view",defaults:i,props:{participant:t,key:t.id,style:{display:"screenshare"===(null===(e=this.activeTab)||void 0===e?void 0:e.type)&&(null===(r=this.activeTab)||void 0===r?void 0:r.participant.id)===t.id?"flex":"none"}},childProps:{participant:t,isScreenShare:!0},deepProps:!0})})),this.plugins.map((t=>{var e,r;return N("rtk-plugin-main",Object.assign({},i,{plugin:t,key:t.id,style:{display:"plugin"===(null===(e=this.activeTab)||void 0===e?void 0:e.type)&&(null===(r=this.activeTab)||void 0===r?void 0:r.plugin.id)===t.id?"flex":"none"}}))})))),N(rr,{key:"c3a9ce4706096e385fc522a37e3de7d9d30d1b70",element:"rtk-mixed-grid",defaults:i,childProps:{part:"participants-grid",class:this.gridSize.mixed?`grid-width-${this.gridSize.mixed}`:"grid-width-lg",participants:this.participants,pinnedParticipants:this.pinnedParticipants,screenShareParticipants:this.screenShareParticipants,plugins:this.plugins,aspectRatio:this.aspectRatio,gap:this.gap,size:"AUDIO_ROOM"===(null===(e=this.meeting.meta)||void 0===e?void 0:e.viewType)?"md":"sm",layout:"row"},onlyChildren:!0}))}get host(){return W(this)}static get watchers(){return{meeting:["meetingChanged"],screenShareParticipants:["screenShareParticipantsChanged"],plugins:["pluginsChanged"]}}};Mh([ai()],Ih.prototype,"size",void 0),Mh([ai()],Ih.prototype,"meeting",void 0),Mh([ai()],Ih.prototype,"states",void 0),Mh([ai()],Ih.prototype,"iconPack",void 0),Mh([ai()],Ih.prototype,"t",void 0),Ih.style=":host{line-height:initial;font-family:var(--rtk-font-family, sans-serif);font-feature-settings:normal;font-variation-settings:normal}p{margin:var(--rtk-space-0, 0px);padding:var(--rtk-space-0, 0px)}:host{display:block;height:100%;width:100%;display:flex}main{display:flex;flex:1 1 0%;padding-left:var(--rtk-space-4, 16px)}:host([layout='column']) main{padding-left:var(--rtk-space-4, 16px);padding-right:var(--rtk-space-4, 16px)}main rtk-tab-bar{margin-right:var(--rtk-space-4, 16px);box-sizing:border-box;display:flex;height:100%;width:var(--rtk-space-16, 64px);flex-direction:column}main #tabs{height:100%;flex:1 1 0%}rtk-button{z-index:10}.grid-width-sm{width:25%}.grid-width-md{width:50%}.grid-width-lg{width:66.666667%}.col{display:flex;flex-direction:column;align-items:center}.tab{display:flex;height:var(--rtk-space-16, 64px);width:var(--rtk-space-16, 64px);align-items:center;justify-content:center;margin-bottom:var(--rtk-space-2, 8px);font-size:12px;--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-background-700, 44 44 44) / var(--tw-bg-opacity))}.tab.active{--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-brand-500, 33 96 253) / var(--tw-bg-opacity))}.tab img{height:var(--rtk-space-7, 28px);width:var(--rtk-space-7, 28px);border-radius:var(--rtk-border-radius-sm, 4px)}:host([size='sm']){flex-direction:column}:host([size='sm']) .grid-width-lg,:host([size='sm']) .grid-width-md{height:50%;width:100%;max-width:100%}:host([size='sm']) .grid-width-sm{height:33.333333%;width:100%;max-width:100%}:host([size='sm']) main{display:flex;flex:1 1 0%;flex-direction:column;padding-left:var(--rtk-space-4, 16px);padding-right:var(--rtk-space-4, 16px)}:host([size='sm']) rtk-tab-bar{height:var(--rtk-space-12, 48px);width:100%;flex-direction:row}:host([size='sm']) #tabs{flex:1 1 0%}:host([size='sm']) .tab{margin:var(--rtk-space-0, 0px);margin-right:var(--rtk-space-2, 8px)}:host([layout='column']){flex-direction:column}:host([layout='column']) main{display:flex;flex:1 1 0%}:host([layout='column']) .grid-width-lg,:host([layout='column']) .grid-width-md{height:50%;max-width:100%;width:100%}:host([layout='column']) .grid-width-sm{height:33.333333%;max-width:100%;width:100%}@media (orientation: portrait){:host{flex-direction:column}:host .grid-width-lg{height:50%;width:100%;max-width:100%}:host .grid-width-md{height:33.333333%;width:100%;max-width:100%}:host .grid-width-sm{height:25%;width:100%;max-width:100%}:host main{flex:1 1 0%;flex-direction:column;padding-left:var(--rtk-space-4, 16px);padding-right:var(--rtk-space-4, 16px)}:host([size='md']) main{flex:1 1 0%;flex-direction:column;padding-left:var(--rtk-space-4, 16px);padding-right:var(--rtk-space-4, 16px)}:host rtk-tab-bar{height:var(--rtk-space-16, 64px);width:100%;flex-direction:row}:host #tabs{flex:1 1 0%}:host .tab{margin:var(--rtk-space-0, 0px);margin-right:var(--rtk-space-2, 8px)}}@media (orientation: landscape){:host{flex-direction:row}:host([size='sm']){flex-direction:row}:host .grid-width-lg{height:50%;width:100%;max-width:100%}:host([size='sm']) .grid-width-sm{height:100%;max-height:100%;width:16.666667%}:host([size='sm']) main{flex:1 1 0%;flex-direction:row;padding-left:var(--rtk-space-2, 8px);padding-right:var(--rtk-space-2, 8px)}:host([size='md']) main{flex:1 1 0%;flex-direction:row;padding-left:var(--rtk-space-4, 16px);padding-right:var(--rtk-space-4, 16px)}:host([size='sm']) rtk-tab-bar{margin-right:var(--rtk-space-2, 8px);height:100%;width:var(--rtk-space-12, 48px);flex-direction:column}:host #tabs{flex:1 1 0%}:host .tab{margin:var(--rtk-space-0, 0px);margin-right:var(--rtk-space-2, 8px)}}";var Oh=Object.freeze({__proto__:null,rtk_mixed_grid:Ih});var Uh=function(t,e,i,r){var a,s=arguments.length,n=s<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,i,r);else for(var o=t.length-1;o>=0;o--)(a=t[o])&&(n=(s<3?a(n):s>3?a(e,i,n):a(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};const $h=class{constructor(t){o(this,t),this.stateUpdate=Y(this,"rtkStateUpdate",7),this.iconPack=je,this.t=Fe(),this.handleKeyDown=({key:t})=>{"Escape"===t&&this.stateUpdate.emit({activeMoreMenu:!1})},this.handleOnClick=t=>{!t.composedPath().includes(this.host)&&this.states.activeMoreMenu&&this.stateUpdate.emit({activeMoreMenu:!1})},this.toggleMoreMenu=()=>{this.stateUpdate.emit({activeMoreMenu:!this.states.activeMoreMenu})}}connectedCallback(){window.addEventListener("keydown",this.handleKeyDown),window.addEventListener("click",this.handleOnClick)}disconnectedCallback(){window.removeEventListener("keydown",this.handleKeyDown),window.removeEventListener("click",this.handleOnClick)}render(){const t=this.t("more");return N(H,{key:"cc4c42c7e70920678ccd5504299cc2ea132ba082",title:t},this.states.activeMoreMenu&&N("div",{key:"4e15d624377561cc3bfac660822041079387d15c",class:"more-menu"},N("slot",{key:"83c8c81d94edbed4d30143fe4a0a9fc77f7c3883",name:"more-elements"})),N("rtk-controlbar-button",{key:"1b88da49b3bd62fc05f43e83743935cbe1848bdf",size:this.size,iconPack:this.iconPack,onClick:t=>{t.stopPropagation(),this.toggleMoreMenu()},icon:this.iconPack.horizontal_dots,label:t,part:"controlbar-button"}),N("slot",{key:"06155b80eabc3aa0c8495c5bc447af457acdd038",name:"expanded"}))}get host(){return W(this)}};Uh([ai()],$h.prototype,"states",void 0),Uh([ai()],$h.prototype,"size",void 0),Uh([ai()],$h.prototype,"iconPack",void 0),Uh([ai()],$h.prototype,"t",void 0),$h.style=":host{line-height:initial;font-family:var(--rtk-font-family, sans-serif);font-feature-settings:normal;font-variation-settings:normal}p{margin:var(--rtk-space-0, 0px);padding:var(--rtk-space-0, 0px)}:host{position:relative;display:flex;flex-direction:column;overflow:visible}.more-menu{position:absolute;right:calc(var(--rtk-space-24, 96px) * -1);bottom:var(--rtk-space-16, 64px);z-index:50;margin-bottom:var(--rtk-space-3, 12px);box-sizing:border-box;max-height:60vh;width:var(--rtk-space-64, 256px);overflow:auto;border-radius:var(--rtk-border-radius-md, 8px);border-width:var(--rtk-border-width-sm, 1px);border-style:solid;--tw-border-opacity:1;border-color:rgba(var(--rtk-colors-background-600, 60 60 60) / var(--tw-border-opacity));--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-background-1000, 8 8 8) / var(--tw-bg-opacity));outline:2px solid transparent;outline-offset:2px;display:flex;flex-direction:column;align-items:stretch}:host([size='sm']) .more-menu{bottom:var(--rtk-space-10, 40px)}.more-menu::-webkit-scrollbar{height:var(--rtk-space-0, 0px);width:var(--rtk-space-1\\.5, 6px);--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-background-900, 26 26 26) / var(--tw-bg-opacity))}.more-menu::-webkit-scrollbar-thumb{border-radius:var(--rtk-border-radius-sm, 4px);--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-background-600, 60 60 60) / var(--tw-bg-opacity))}";var Fh=Object.freeze({__proto__:null,rtk_more_toggle:$h});var jh=function(t,e,i,r){var a,s=arguments.length,n=s<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,i,r);else for(var o=t.length-1;o>=0;o--)(a=t[o])&&(n=(s<3?a(n):s>3?a(e,i,n):a(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};const zh=class{constructor(t){o(this,t),this.stateUpdate=Y(this,"rtkStateUpdate",7),this.variant="button",this.iconPack=je,this.t=Fe(),this.canDisable=!1,this.permissionsUpdateListener=()=>{var t;this.canDisable=!!(null===(t=this.meeting)||void 0===t?void 0:t.self.permissions.canDisableParticipantAudio)},this.onMuteAll=()=>{this.stateUpdate.emit({activeMuteAllConfirmation:!0})}}connectedCallback(){this.meetingChanged(this.meeting)}disconnectedCallback(){var t,e,i;null===(i=null===(e=null===(t=this.meeting)||void 0===t?void 0:t.self)||void 0===e?void 0:e.permissions)||void 0===i||i.removeListener("permissionsUpdate",this.permissionsUpdateListener)}meetingChanged(t){t&&(this.canDisable=!!(null==t?void 0:t.self.permissions.canDisableParticipantAudio),t.self.permissions.addListener("permissionsUpdate",this.permissionsUpdateListener))}render(){if(!this.canDisable)return null;const t=this.t("mute_all");return N(H,{title:t},N("rtk-tooltip",{kind:"block",label:t,part:"tooltip"},N("rtk-controlbar-button",{part:"controlbar-button",icon:this.iconPack.speaker_off,label:t,size:this.size,iconPack:this.iconPack,variant:this.variant,onClick:this.onMuteAll})))}static get watchers(){return{meeting:["meetingChanged"]}}};jh([ai()],zh.prototype,"meeting",void 0),jh([ai()],zh.prototype,"size",void 0),jh([ai()],zh.prototype,"iconPack",void 0),jh([ai()],zh.prototype,"t",void 0),zh.style=":host{line-height:initial;font-family:var(--rtk-font-family, sans-serif);font-feature-settings:normal;font-variation-settings:normal}p{margin:var(--rtk-space-0, 0px);padding:var(--rtk-space-0, 0px)}:host{display:block}";var Nh=Object.freeze({__proto__:null,rtk_mute_all_button:zh});var Bh=function(t,e,i,r){var a,s=arguments.length,n=s<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,i,r);else for(var o=t.length-1;o>=0;o--)(a=t[o])&&(n=(s<3?a(n):s>3?a(e,i,n):a(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};const Hh=class{constructor(t){o(this,t),this.iconPack=je,this.t=Fe(),this.isScreenShare=!1,this.score=10,this.onMediaScoreUpdate=({kind:t,isScreenshare:e,score:i})=>{("video"===t||this.isScreenShare&&e)&&(this.score=i)}}connectedCallback(){this.participantChanged(this.participant)}participantChanged(t){t&&t.addListener("mediaScoreUpdate",this.onMediaScoreUpdate)}disconnectedCallback(){var t;null===(t=this.participant)||void 0===t||t.removeListener("mediaScoreUpdate",this.onMediaScoreUpdate)}render(){let t=Math.round(this.score/2),e="good";if(t>3)return null;switch(t<1&&(t=1),t){case 3:case 2:e="poor";break;case 1:e="poorest"}return N(H,null,N("rtk-icon",{icon:this.iconPack[`signal_${t}`],class:e}),N("rtk-icon",{icon:this.iconPack.signal_5,class:"bg-signal"}))}static get watchers(){return{participant:["participantChanged"]}}};Bh([ai()],Hh.prototype,"meeting",void 0),Bh([ai()],Hh.prototype,"iconPack",void 0),Bh([ai()],Hh.prototype,"t",void 0),Hh.style=":host{line-height:initial;font-family:var(--rtk-font-family, sans-serif);font-feature-settings:normal;font-variation-settings:normal}p{margin:var(--rtk-space-0, 0px);padding:var(--rtk-space-0, 0px)}:host{position:relative;display:block;height:var(--rtk-space-7, 28px);width:var(--rtk-space-7, 28px)}rtk-icon{position:absolute;top:var(--rtk-space-0, 0px);right:var(--rtk-space-0, 0px);bottom:var(--rtk-space-0, 0px);left:var(--rtk-space-0, 0px);z-index:10;height:100%;width:100%;--tw-text-opacity:1;color:rgba(var(--rtk-colors-success, 98 165 4) / var(--tw-text-opacity))}rtk-icon.good{--tw-text-opacity:1;color:rgba(var(--rtk-colors-success, 98 165 4) / var(--tw-text-opacity))}rtk-icon.poor{--tw-text-opacity:1;color:rgba(var(--rtk-colors-warning, 255 205 7) / var(--tw-text-opacity))}rtk-icon.poorest{--tw-text-opacity:1;color:rgba(var(--rtk-colors-danger, 255 45 45) / var(--tw-text-opacity))}:host([size='md']){height:var(--rtk-space-6, 24px);width:var(--rtk-space-6, 24px)}:host([size='sm']){height:var(--rtk-space-5, 20px);width:var(--rtk-space-5, 20px)}.bg-signal{position:absolute;top:var(--rtk-space-0, 0px);right:var(--rtk-space-0, 0px);bottom:var(--rtk-space-0, 0px);left:var(--rtk-space-0, 0px);z-index:0;color:rgb(var(--rtk-colors-text-600, 255 255 255 / 0.52))}";var Gh=Object.freeze({__proto__:null,rtk_network_indicator:Hh});var Vh=function(t,e,i,r){var a,s=arguments.length,n=s<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,i,r);else for(var o=t.length-1;o>=0;o--)(a=t[o])&&(n=(s<3?a(n):s>3?a(e,i,n):a(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};const qh=class{constructor(t){o(this,t),this.iconPack=je,this.t=Fe(),this.participantCount=0,this.isViewer=!1,this.disconnectMeeting=t=>{null!=t&&null!=this.countListener&&(t.participants.joined.removeListener("participantJoined",this.countListener),t.participants.joined.removeListener("participantLeft",this.countListener),(null==t?void 0:t.stage)&&this.stageUpdateListener&&t.stage.removeListener("stageStatusUpdate",this.stageUpdateListener),t.self.removeListener("roomJoined",this.countListener))}}connectedCallback(){this.meetingChanged(this.meeting)}disconnectedCallback(){this.disconnectMeeting(this.meeting)}meetingChanged(t,e){this.disconnectMeeting(e),null!=t&&(this.countListener=()=>{this.participantCount=t.participants.joined.size+(t.self.roomJoined?1:0)},this.countListener(),this.isViewer=Yt(this.meeting),t.participants.joined.addListener("participantJoined",this.countListener),t.participants.joined.addListener("participantLeft",this.countListener),(null==t?void 0:t.stage)&&(this.stageUpdateListener=()=>{this.isViewer=Yt(this.meeting)},null==t||t.stage.addListener("stageStatusUpdate",this.stageUpdateListener)),t.self.addListener("roomJoined",this.countListener))}render(){return this.isViewer?N(H,{"data-hidden":!0}):N(H,{tabIndex:0,role:"log","aria-label":`${this.participantCount} ${this.t("participants")}`},N("rtk-icon",{icon:this.iconPack.people,tabIndex:-1,"aria-hidden":!0,part:"icon"}),this.participantCount)}static get watchers(){return{meeting:["meetingChanged"]}}};Vh([ai()],qh.prototype,"meeting",void 0),Vh([ai()],qh.prototype,"iconPack",void 0),Vh([ai()],qh.prototype,"t",void 0),Vh([ai()],qh.prototype,"size",void 0),qh.style=":host{line-height:initial;font-family:var(--rtk-font-family, sans-serif);font-feature-settings:normal;font-variation-settings:normal}p{margin:var(--rtk-space-0, 0px);padding:var(--rtk-space-0, 0px)}:host{display:inline-flex;height:var(--rtk-space-10, 40px);-webkit-user-select:none;-moz-user-select:none;user-select:none;align-items:center}:host([data-hidden]){display:none}:host([size='sm']){font-size:12px}rtk-icon{margin-right:var(--rtk-space-1, 4px);height:var(--rtk-space-5, 20px);width:var(--rtk-space-5, 20px)}:host([size='sm']) rtk-icon{height:var(--rtk-space-4, 16px);width:var(--rtk-space-4, 16px)}";var Kh=Object.freeze({__proto__:null,rtk_participant_count:qh});var Wh=function(t,e,i,r){var a,s=arguments.length,n=s<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,i,r);else for(var o=t.length-1;o>=0;o--)(a=t[o])&&(n=(s<3?a(n):s>3?a(e,i,n):a(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};const Yh=class{constructor(t){o(this,t),this.isPinned=!1,this.nameTagPosition="bottom-left",this.isPreview=!1,this.config=De,this.variant="solid",this.iconPack=je,this.t=Fe(),this.onVideoUpdate=t=>{this.videoState=t}}connectedCallback(){this.participantsChanged(this.participant)}componentDidLoad(){this.videoStateChanged(this.videoState)}disconnectedCallback(){null!=this.participant&&this.participant.removeListener("videoUpdate",this.onVideoUpdate)}async participantsChanged(t){null!=t&&(this.videoState={videoEnabled:t.videoEnabled,videoTrack:t.videoTrack},this.isPinned=t.isPinned,t.addListener("videoUpdate",this.onVideoUpdate))}videoStateChanged(t){if(null!=t&&null!=this.videoEl)if(t.videoEnabled){const e=new MediaStream;e.addTrack(t.videoTrack),this.videoEl.srcObject=e}else this.videoEl.srcObject=void 0}isMirrored(){var t;if(null!=this.participant){if("preview"in this.participant||this.isPreview){const e=this.states,i=null===(t=null==e?void 0:e.prefs)||void 0===t?void 0:t.mirrorVideo;if("boolean"==typeof i)return i}}return!1}render(){var t,e,i,r;return N(H,{key:"69573519e7127835dd9304dcfb507ebbb94e0de8"},N("video",{key:"75c047e3029721e655016da9a40e2b94770a5234",ref:t=>this.videoEl=t,class:{visible:null===(t=this.videoState)||void 0===t?void 0:t.videoEnabled,mirror:this.isMirrored(),[null!==(r=null===(i=null===(e=this.config)||void 0===e?void 0:e.config)||void 0===i?void 0:i.videoFit)&&void 0!==r?r:"cover"]:!0},autoPlay:!0,playsInline:!0,muted:!0}),N("slot",{key:"3bdccee7fb4e001425249fe832b4bdcb01751306"}))}static get watchers(){return{participant:["participantsChanged"],videoState:["videoStateChanged"]}}};Wh([ai()],Yh.prototype,"states",void 0),Wh([ai()],Yh.prototype,"size",void 0),Wh([ai()],Yh.prototype,"iconPack",void 0),Wh([ai()],Yh.prototype,"t",void 0),Yh.style=":host{line-height:initial;font-family:var(--rtk-font-family, sans-serif);font-feature-settings:normal;font-variation-settings:normal}p{margin:var(--rtk-space-0, 0px);padding:var(--rtk-space-0, 0px)}:host{position:relative;display:flex;align-items:center;justify-content:center;aspect-ratio:16 / 9;height:var(--rtk-space-56, 224px);overflow:hidden;border-radius:var(--rtk-border-radius-lg, 12px);-webkit-user-select:none;-moz-user-select:none;user-select:none;--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-video-bg, 24 24 24) / var(--tw-bg-opacity));transition-property:var(--rtk-transition-property, all);transition-duration:150ms}@media (prefers-reduced-motion){:host{--rtk-transition-property:none}}:host([size='sm'][variant='solid']) ::slotted(rtk-name-tag){left:var(--rtk-space-2, 8px);bottom:var(--rtk-space-2, 8px);height:var(--rtk-space-4, 16px)}video{display:none;position:absolute;height:100%;width:100%;border-radius:var(--rtk-border-radius-lg, 12px)}video.contain{-o-object-fit:contain;object-fit:contain}video.cover{-o-object-fit:cover;object-fit:cover}video.visible{display:block}video::-webkit-media-controls{display:none !important}:host([variant='gradient']) ::slotted(rtk-audio-visualizer){position:absolute;top:var(--rtk-space-2, 8px);right:var(--rtk-space-2, 8px);border-radius:9999px;--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-brand-500, 33 96 253) / var(--tw-bg-opacity));padding:var(--rtk-space-2, 8px)}:host([variant='gradient']) ::slotted(rtk-name-tag){bottom:var(--rtk-space-0, 0px);left:var(--rtk-space-0, 0px);display:flex;width:100%;align-items:center;justify-content:center;text-align:center;background-color:transparent;background-image:linear-gradient(to top, var(--tw-gradient-stops));--tw-gradient-from:rgb(var(--rtk-colors-background-1000, 8 8 8));--tw-gradient-to:rgba(var(--rtk-colors-background-1000, 8 8 8) / 0);--tw-gradient-stops:var(--tw-gradient-from), var(--tw-gradient-to);--tw-gradient-to:transparent}video.mirror{transform:scaleX(-1)}@media (orientation: portrait){:host{height:var(--rtk-space-44, 176px)}}";var Zh=Object.freeze({__proto__:null,rtk_participant_setup:Yh});var Qh=function(t,e,i,r){var a,s=arguments.length,n=s<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,i,r);else for(var o=t.length-1;o>=0;o--)(a=t[o])&&(n=(s<3?a(n):s>3?a(e,i,n):a(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};const Jh=class{constructor(t){o(this,t),this.stateUpdate=Y(this,"rtkStateUpdate",7),this.config=De,this.iconPack=je,this.defaultParticipantsTabId="stage-list",this.t=Fe(),this.currentParticipantsTabId=this.defaultParticipantsTabId,this.tabs=[],this.hasRequests=!1,this.search="",this.updateParticipantCountsInTabs=_i((()=>{var t;let e=(null===(t=this.meeting.participants.waitlisted)||void 0===t?void 0:t.size)||0,i=0,r=0;this.meeting.participants.joined.toArray().forEach((t=>{"ON_STAGE"===t.stageStatus&&i++,"OFF_STAGE"===t.stageStatus&&r++,"REQUESTED_TO_JOIN_STAGE"===t.stageStatus&&(e++,r++),"ACCEPTED_TO_JOIN_STAGE"===t.stageStatus&&r++})),"ON_STAGE"===this.meeting.self.stageStatus&&i++,"OFF_STAGE"===this.meeting.self.stageStatus&&r++,"REQUESTED_TO_JOIN_STAGE"===this.meeting.self.stageStatus&&(e++,r++),"ACCEPTED_TO_JOIN_STAGE"===this.meeting.self.stageStatus&&r++;const a=[];this.shouldShowRequestsTab()&&a.push({id:"requests",name:N("span",null,this.t("requests")," ",N("span",{class:`tab-participant-count-badge ${e>0?"requests-pending":""} ${"requests"===this.currentParticipantsTabId?"selected-tab":""}`},e))}),a.push({id:"stage-list",name:N("span",null,this.t("participants")," ",N("span",{class:"tab-participant-count-badge "+("stage-list"===this.currentParticipantsTabId?"selected-tab":"")},i))}),this.shouldShowViewersTab()&&a.push({id:"viewer-list",name:N("span",null,this.t("viewers")," ",N("span",{class:"tab-participant-count-badge "+("viewer-list"===this.currentParticipantsTabId?"selected-tab":"")},r))}),this.tabs=a,this.hasRequests=e>0})),this.onSearchInput=t=>{this.search=t.target.value},this.shouldShowViewersTab=()=>{var t,e,i;return null===(i=null===(e=null===(t=this.meeting)||void 0===t?void 0:t.self)||void 0===e?void 0:e.permissions)||void 0===i?void 0:i.stageEnabled},this.shouldShowRequestsTab=()=>{var t;let e=!1;return e="LIVESTREAM"!==this.meeting.meta.viewType&&((null===(t=this.meeting.self.config.waitingRoom)||void 0===t?void 0:t.isEnabled)&&this.meeting.self.permissions.acceptWaitingRequests),this.meeting.self.permissions.stageEnabled&&this.meeting.self.permissions.acceptStageRequests||e},this.viewSection=t=>{this.currentParticipantsTabId=t}}connectedCallback(){this.meetingChanged(this.meeting)}disconnectedCallback(){null!=this.meeting&&(this.meeting.participants.joined.off("participantJoined",this.updateParticipantCountsInTabs),this.meeting.participants.joined.off("participantsUpdate",this.updateParticipantCountsInTabs),this.meeting.participants.joined.off("participantLeft",this.updateParticipantCountsInTabs),this.meeting.participants.joined.off("stageStatusUpdate",this.updateParticipantCountsInTabs),this.meeting.stage.off("stageStatusUpdate",this.updateParticipantCountsInTabs),this.meeting.participants.waitlisted.off("participantJoined",this.updateParticipantCountsInTabs),this.meeting.participants.waitlisted.off("participantLeft",this.updateParticipantCountsInTabs),this.meeting.participants.waitlisted.off("stageStatusUpdate",this.updateParticipantCountsInTabs))}meetingChanged(t){null!=t&&(t.participants.joined.on("participantJoined",this.updateParticipantCountsInTabs),t.participants.joined.on("participantsUpdate",this.updateParticipantCountsInTabs),t.participants.joined.on("participantLeft",this.updateParticipantCountsInTabs),t.participants.joined.on("stageStatusUpdate",this.updateParticipantCountsInTabs),t.stage.on("stageStatusUpdate",this.updateParticipantCountsInTabs),t.participants.waitlisted.on("participantJoined",this.updateParticipantCountsInTabs),t.participants.waitlisted.on("participantLeft",this.updateParticipantCountsInTabs),t.participants.waitlisted.on("stageStatusUpdate",this.updateParticipantCountsInTabs),this.updateParticipantCountsInTabs())}currentParticipantsTabIdChanged(){this.stateUpdate.emit({participantsTabId:this.currentParticipantsTabId}),this.updateParticipantCountsInTabs()}render(){const t={meeting:this.meeting,states:this.states,config:this.config,size:this.size,iconPack:this.iconPack,t:this.t};return N(H,{key:"9957561cf7ae9a0a28d62bce7102dbb6145aaeda"},N("div",{key:"5960602654c8d993afc99ce22582514d1438182b",class:"search",part:"search"},N("rtk-icon",{key:"cc94e5fd1e5540b893f2bdb5b4ad4e3563d37424",icon:this.iconPack.search,part:"search-icon"}),N("input",{key:"c0a723db1be4d4a8c91907f24078678561a9bfb9",type:"search",autocomplete:"off",placeholder:this.t("search"),onInput:this.onSearchInput,part:"search-input"})),N("slot",{key:"7f145408b13056ad7e95b3469dc009ae46e73978",name:"start"}),N("div",{key:"465b74c71cd0239832ef60a0973537c71b394007",class:"ctr scrollbar "+("requests"!==this.currentParticipantsTabId?"virtualised":""),part:"container"},N("rtk-sidebar-ui",{key:"c6395b16482d114f82af07df85faeb1dc2584c4a",tabs:this.tabs,currentTab:this.currentParticipantsTabId,view:"full-screen",hideHeader:!0,hideCloseAction:!0,style:{position:"relative"},onTabChange:t=>{this.viewSection(t.detail),t.stopPropagation()}},(!this.currentParticipantsTabId||"stage-list"===this.currentParticipantsTabId)&&N("div",{key:"20d7a91bed3ea3047614d52ba30c5e832db6fce1",slot:"stage-list",style:{marginTop:"10px",height:"100%"}},N("rtk-participants-stage-list",Object.assign({key:"160ddba969e95e270e1443f11d48d989b4ee8561"},t,{search:this.search,hideHeader:!0}))),"requests"===this.currentParticipantsTabId&&N("div",{key:"52d4eae9480d00972b61c0e2964fcb8fc5498c89",slot:"requests",style:{marginTop:"10px",height:"100%"}},!this.hasRequests&&N("div",{key:"5690208be803224c202d81563be0fae45396dbeb",class:"no-pending-requests"},this.t("participants.no_pending_requests")),N("rtk-participants-stage-queue",Object.assign({key:"db4763d312a191c48279fa25168a1f363f574edc"},t)),N("rtk-participants-waiting-list",Object.assign({key:"f2b4ad3ad303b1c8a5314b5dd55de16c9c168c19"},t))),"viewer-list"===this.currentParticipantsTabId&&N("div",{key:"a262369c69afd77e101ec10934a9d4065590e748",slot:"viewer-list",style:{marginTop:"10px",height:"100%"}},N("rtk-participants-viewer-list",Object.assign({key:"0142b3855f357213ba24260091e5e7d48acb268d"},t,{search:this.search,hideHeader:!0}))))),N("slot",{key:"eae12c410cbe1282da2107420b4d44f66af5dd35",name:"end"}))}static get watchers(){return{meeting:["meetingChanged"],currentParticipantsTabId:["currentParticipantsTabIdChanged"]}}};Qh([ai()],Jh.prototype,"meeting",void 0),Qh([ai()],Jh.prototype,"states",void 0),Qh([ai()],Jh.prototype,"size",void 0),Qh([ai()],Jh.prototype,"iconPack",void 0),Qh([ai()],Jh.prototype,"t",void 0),Jh.style=":host{line-height:initial;font-family:var(--rtk-font-family, sans-serif);font-feature-settings:normal;font-variation-settings:normal}p{margin:var(--rtk-space-0, 0px);padding:var(--rtk-space-0, 0px)}.scrollbar{scrollbar-width:thin;scrollbar-color:var(--rtk-scrollbar-color, rgb(var(--rtk-colors-background-600, 60 60 60)))\n var(--rtk-scrollbar-background, transparent)}.scrollbar::-webkit-scrollbar{height:var(--rtk-space-1\\.5, 6px);width:var(--rtk-space-1\\.5, 6px);border-radius:9999px;background-color:var(--rtk-scrollbar-background, transparent)}.scrollbar::-webkit-scrollbar-thumb{border-radius:9999px;background-color:var(--rtk-scrollbar-color, rgb(var(--rtk-colors-background-600, 60 60 60)))}:host{display:flex;height:100%;width:100%;flex-direction:column;font-size:14px}*{box-sizing:border-box}.ctr{margin-top:var(--rtk-space-2, 8px);margin-bottom:var(--rtk-space-2, 8px);box-sizing:border-box;padding-left:var(--rtk-space-3, 12px);padding-right:var(--rtk-space-3, 12px);padding-top:var(--rtk-space-0, 0px);padding-bottom:var(--rtk-space-0, 0px);overflow-y:auto;flex-grow:1;flex-basis:0}.ctr.virtualised{overflow-y:hidden}.search{position:sticky;box-sizing:border-box;display:flex;align-items:center;border-radius:var(--rtk-border-radius-sm, 4px);--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-background-700, 44 44 44) / var(--tw-bg-opacity));margin-left:var(--rtk-space-3, 12px);margin-right:var(--rtk-space-3, 12px);margin-top:var(--rtk-space-0, 0px);margin-bottom:var(--rtk-space-0, 0px)}.search rtk-icon{margin-left:var(--rtk-space-2, 8px);margin-right:var(--rtk-space-2, 8px);height:var(--rtk-space-5, 20px);width:var(--rtk-space-5, 20px);color:rgb(var(--rtk-colors-text-600, 255 255 255 / 0.52))}.search input{box-sizing:border-box;height:var(--rtk-space-9, 36px);width:100%;padding-right:var(--rtk-space-2, 8px);border-width:var(--rtk-border-width-none, 0);border-style:none;--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-background-700, 44 44 44) / var(--tw-bg-opacity));color:rgb(var(--rtk-colors-text-1000, 255 255 255));outline:2px solid transparent;outline-offset:2px;border-radius:var(--rtk-border-radius-sm, 4px);font-size:14px}.search input::-moz-placeholder{color:rgb(var(--rtk-colors-text-800, 255 255 255 / 0.76))}.search input::placeholder{color:rgb(var(--rtk-colors-text-800, 255 255 255 / 0.76))}:host([size='md']) .search{margin-top:var(--rtk-space-4, 16px) !important;margin-bottom:var(--rtk-space-4, 16px) !important}:host([size='sm']) .search{margin-top:var(--rtk-space-4, 16px) !important;margin-bottom:var(--rtk-space-4, 16px) !important}.no-pending-requests{margin-top:var(--rtk-space-4, 16px);margin-bottom:var(--rtk-space-4, 16px);text-align:center;font-size:12px;color:rgb(var(--rtk-colors-text-700, 255 255 255 / 0.64))}";var Xh=Object.freeze({__proto__:null,rtk_participants:Jh});class tp{constructor(t,e){this.meeting=t,this.audio=null!=e?e:document.createElement("audio"),this.audio.autoplay=!0,this.logger=t.__internals__.logger,this.audioStream=new MediaStream,this.audio.srcObject=this.audioStream,this.audioTracks=[]}addTrack(t,e){this.audioTracks.some((e=>e.id===t))||(this.audioTracks.push({id:t,track:e}),this.audioStream.addTrack(e),this.play())}removeTrack(t){const e=this.audioTracks.find((e=>e.id===t));null!=e&&(this.audioStream.removeTrack(e.track),this.audioTracks=this.audioTracks.filter((e=>e.id!==t)))}async play(){var t;this.audio.srcObject=this.audioStream,await(null===(t=this.audio.play())||void 0===t?void 0:t.catch((t=>{"NotAllowedError"===t.name?null!=this._onError&&this._onError():"AbortError"!==t.name&&this.logger.error("[rtk-audio] play() error\n",t)})))}async setDevice(t){var e,i,r;oe(this.meeting)||await(null===(r=null===(i=(e=this.audio).setSinkId)||void 0===i?void 0:i.call(e,t))||void 0===r?void 0:r.catch((t=>{this.logger.error("[rtk-audio] setSinkId() error\n",t)})))}onError(t){this._onError=t}}var ep=function(t,e,i,r){var a,s=arguments.length,n=s<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,i,r);else for(var o=t.length-1;o>=0;o--)(a=t[o])&&(n=(s<3?a(n):s>3?a(e,i,n):a(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};const ip=class{constructor(t){o(this,t),this.dialogClose=Y(this,"dialogClose",7),this.iconPack=je,this.t=Fe(),this.preloadedAudioElem=void 0,this.showPlayDialog=!1,this.onRtkDialogClose=()=>{this.showPlayDialog=!1,this.dialogClose.emit()}}componentDidLoad(){this.meetingChanged(this.meeting)}disconnectedCallback(){var t;null!=this.meeting&&(this.audioUpdateListener&&this.meeting.participants.joined.removeListener("audioUpdate",this.audioUpdateListener),this.screenShareUpdateListener&&this.meeting.participants.joined.removeListener("screenShareUpdate",this.screenShareUpdateListener),this.participantLeftListener&&this.meeting.participants.joined.removeListener("participantLeft",this.participantLeftListener),this.deviceUpdateListener&&this.meeting.self.removeListener("deviceUpdate",this.deviceUpdateListener),this.stageStatusUpdateListener&&(null===(t=this.meeting.stage)||void 0===t||t.removeListener("stageStatusUpdate",this.stageStatusUpdateListener)))}async setupAudio(){this.audio=new tp(this.meeting,this.preloadedAudioElem);const t=this.meeting.self.getCurrentDevices();null!=t.speaker&&await this.audio.setDevice(t.speaker.deviceId)}async handleAutoPlayError(){this.audio||await this.setupAudio(),this.audio.onError((()=>{this.showPlayDialog=!0})),this.audio.play()}async handleEvents(t){this.audioUpdateListener=({id:t,audioEnabled:e,audioTrack:i})=>{const r=`audio-${t}`;e&&null!=i?this.audio.addTrack(r,i):this.audio.removeTrack(r)};const e=t.participants.joined.toArray();for(const t of e)this.audioUpdateListener(t);this.participantLeftListener=({id:t})=>{this.audio.removeTrack(`audio-${t}`),this.audio.removeTrack(`screenshare-${t}`)},this.screenShareUpdateListener=({id:t,screenShareEnabled:e,screenShareTracks:i})=>{const r=`screenshare-${t}`;e&&null!=i.audio?this.audio.addTrack(r,i.audio):this.audio.removeTrack(r)},this.deviceUpdateListener=({device:t,preview:e})=>{e||"audiooutput"===t.kind&&this.audio.setDevice(t.deviceId)},t.participants.joined.addListener("audioUpdate",this.audioUpdateListener),t.participants.joined.addListener("screenShareUpdate",this.screenShareUpdateListener),t.participants.joined.addListener("participantLeft",this.participantLeftListener),t.self.addListener("deviceUpdate",this.deviceUpdateListener)}async meetingChanged(t){var e;null!=t&&(this.setupAudio(),Yt(t)?(this.stageStatusUpdateListener=async t=>{"ON_STAGE"===t&&await this.handleAutoPlayError()},null===(e=t.stage)||void 0===e||e.on("stageStatusUpdate",this.stageStatusUpdateListener)):await this.handleAutoPlayError(),await this.handleEvents(t))}render(){return N(H,{key:"8f6ac797ceb5f3fa6c8633e72174e9ae91e7979a"},this.showPlayDialog&&N("rtk-dialog",{key:"d1f5723dec7d7e9e66625deb9cebce63e26520e1",open:!0,onRtkDialogClose:this.onRtkDialogClose,hideCloseButton:!0,disableEscapeKey:!0,iconPack:this.iconPack,t:this.t},N("div",{key:"cd0de80766e3f1c665666f463bf405f44ed8323d",class:"modal"},N("h3",{key:"098d978b8c3aeba86328e23104fa7e73f12f2296"},this.t("audio_playback.title")),N("p",{key:"74d242093687ab9734392a8d5357c7a2c5cce8b9"},this.t("audio_playback.description")),N("rtk-button",{key:"6382f33f9b3907989c5559c49091f2173be708e3",kind:"wide",onClick:()=>{this.audio.play(),this.onRtkDialogClose()},title:this.t("audio_playback")},this.t("audio_playback")))))}static get watchers(){return{meeting:["meetingChanged"]}}};ep([ai()],ip.prototype,"meeting",void 0),ep([ai()],ip.prototype,"iconPack",void 0),ep([ai()],ip.prototype,"t",void 0),ip.style=":host{line-height:initial;font-family:var(--rtk-font-family, sans-serif);font-feature-settings:normal;font-variation-settings:normal}p{margin:var(--rtk-space-0, 0px);padding:var(--rtk-space-0, 0px)}:host{display:block;overflow-wrap:break-word;color:rgb(var(--rtk-colors-text-1000, 255 255 255));word-wrap:break-word}.modal{box-sizing:border-box;width:100%;max-width:var(--rtk-space-96, 384px);padding:var(--rtk-space-4, 16px);border-radius:var(--rtk-border-radius-md, 8px);--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-background-1000, 8 8 8) / var(--tw-bg-opacity))}.modal h3{margin:var(--rtk-space-0, 0px);padding:var(--rtk-space-0, 0px);font-size:24px;font-weight:500}.modal p{margin-top:var(--rtk-space-4, 16px);margin-bottom:var(--rtk-space-6, 24px)}.modal rtk-button{width:100%}";var rp=Object.freeze({__proto__:null,rtk_participants_audio:ip});var ap=function(t,e,i,r){var a,s=arguments.length,n=s<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,i,r);else for(var o=t.length-1;o>=0;o--)(a=t[o])&&(n=(s<3?a(n):s>3?a(e,i,n):a(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};const sp=class{constructor(t){o(this,t),this.stateUpdate=Y(this,"rtkStateUpdate",7),this.variant="button",this.iconPack=je,this.t=Fe(),this.participantsActive=!1,this.waitlistedParticipants=[],this.stageRequestedParticipants=[],this.badgeCount=0,this.canViewParticipants=!1,this.updateStageRequests=async t=>{var e,i,r;t||(t=null!==(r=null===(i=null===(e=this.meeting.stage)||void 0===e?void 0:e.getAccessRequests())||void 0===i?void 0:i.stageRequests)&&void 0!==r?r:[]),this.stageRequestedParticipants=t,this.stageRequestedParticipants="REQUESTED_TO_JOIN_STAGE"===this.meeting.stage.status?[this.meeting.self,...t]:t,this.updateBadgeCount()},this.updateBadgeCount=()=>{this.badgeCount=this.waitlistedParticipants.length+this.stageRequestedParticipants.length},this.updateCanView=()=>{this.canViewParticipants=Kl(this.meeting)}}connectedCallback(){this.meetingChanged(this.meeting),this.statesChanged(this.states)}disconnectedCallback(){var t,e,i;null!=this.meeting&&(null===(e=null===(t=this.meeting)||void 0===t?void 0:t.stage)||void 0===e||e.removeListener("stageStatusUpdate",this.updateCanView),this.waitlistedParticipantJoinedListener&&this.meeting.participants.waitlisted.removeListener("participantJoined",this.waitlistedParticipantJoinedListener),this.waitlistedParticipantLeftListener&&this.meeting.participants.waitlisted.removeListener("participantLeft",this.waitlistedParticipantLeftListener),null===(i=this.meeting.stage)||void 0===i||i.removeListener("stageAccessRequestUpdate",this.updateStageRequests))}meetingChanged(t){var e;null!=t&&(this.canViewParticipants=Kl(t),null===(e=null==t?void 0:t.stage)||void 0===e||e.on("stageStatusUpdate",this.updateCanView),t.self.permissions.acceptWaitingRequests&&(this.waitlistedParticipants=t.participants.waitlisted.toArray(),this.waitlistedParticipantJoinedListener=t=>{this.waitlistedParticipants.some((e=>e.id===t.id))||(this.waitlistedParticipants=[...this.waitlistedParticipants,t],this.updateBadgeCount())},this.waitlistedParticipantLeftListener=t=>{this.waitlistedParticipants=this.waitlistedParticipants.filter((e=>e.id!==t.id)),this.updateBadgeCount()},t.participants.waitlisted.addListener("participantJoined",this.waitlistedParticipantJoinedListener),t.participants.waitlisted.addListener("participantLeft",this.waitlistedParticipantLeftListener)),this.meeting.self.permissions.stageEnabled&&this.meeting.self.permissions.acceptStageRequests&&(this.updateStageRequests(),null==t||t.stage.on("stageAccessRequestUpdate",this.updateStageRequests)),this.updateBadgeCount())}statesChanged(t){null!=t&&(this.participantsActive=!0===t.activeSidebar&&"participants"===t.sidebar)}toggleParticipantsTab(){const t=this.states;this.participantsActive=!((null==t?void 0:t.activeSidebar)&&"participants"===(null==t?void 0:t.sidebar)),this.stateUpdate.emit({activeSidebar:this.participantsActive,sidebar:this.participantsActive?"participants":void 0,activeMoreMenu:!1,activeAI:!1})}handleParticipantsActiveChange(){this.participantsActive||this.states.activeSidebar||this.buttonEl.focus()}render(){if(!this.canViewParticipants)return N(H,{"data-hidden":!0});const t=this.t("participants");return N(H,{title:t},0!==this.badgeCount&&!this.participantsActive&&N("div",{class:"waiting-participants-count",part:"waiting-participants-count"},N("span",null,this.badgeCount<=100?this.badgeCount:"99+")),N("rtk-controlbar-button",{ref:t=>this.buttonEl=t,part:"controlbar-button",size:this.size,iconPack:this.iconPack,class:{active:this.participantsActive},onClick:()=>this.toggleParticipantsTab(),icon:this.iconPack.participants,label:t,variant:this.variant}))}static get watchers(){return{meeting:["meetingChanged"],states:["statesChanged"],participantsActive:["handleParticipantsActiveChange"]}}};ap([ai()],sp.prototype,"meeting",void 0),ap([ai()],sp.prototype,"states",void 0),ap([ai()],sp.prototype,"size",void 0),ap([ai()],sp.prototype,"iconPack",void 0),ap([ai()],sp.prototype,"t",void 0),sp.style=":host{line-height:initial;font-family:var(--rtk-font-family, sans-serif);font-feature-settings:normal;font-variation-settings:normal}p{margin:var(--rtk-space-0, 0px);padding:var(--rtk-space-0, 0px)}:host{position:relative;display:block}:host([data-hidden]){display:none}.waiting-participants-count{position:absolute;right:var(--rtk-space-3, 12px);box-sizing:border-box;padding:var(--rtk-space-0\\.5, 2px);-webkit-user-select:none;-moz-user-select:none;user-select:none;--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-brand-500, 33 96 253) / var(--tw-bg-opacity));font-size:12px;display:flex;height:var(--rtk-space-5, 20px);min-width:var(--rtk-space-5, 20px);align-items:center;justify-content:center;border-radius:9999px;z-index:1}:host([variant='horizontal']) .waiting-participants-count{right:var(--rtk-space-4, 16px);top:50%;--tw-translate-y:-50%;transform:translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}";var np=Object.freeze({__proto__:null,rtk_participants_toggle:sp});var op=function(t,e,i,r){var a,s=arguments.length,n=s<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,i,r);else for(var o=t.length-1;o>=0;o--)(a=t[o])&&(n=(s<3?a(n):s>3?a(e,i,n):a(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};const cp=class{constructor(t){o(this,t),this.stateUpdate=Y(this,"rtkStateUpdate",7),this.variant="button",this.config=De,this.iconPack=je,this.t=Fe(),this.pipSupported=!1}connectedCallback(){this.meetingChanged(this.meeting)}meetingChanged(t){var e,i,r;t&&(this.pipSupported=(null===(e=t.participants.pip)||void 0===e?void 0:e.isSupported())&&(null===(i=t.self.config)||void 0===i?void 0:i.pipMode)&&"LIVESTREAM"!==(null===(r=t.self.config)||void 0===r?void 0:r.viewType))}togglePip(){this.meeting.participants.pip&&(this.meeting.participants.pip.isActive?this.meeting.participants.pip.disable():this.meeting.participants.pip.enable(),this.stateUpdate.emit({activeMoreMenu:!1}))}render(){if(!this.pipSupported)return N(H,{"data-hidden":!0});const t=this.meeting.participants.pip.isActive;return N(H,{role:"log","aria-label":"Picture-in-Picture mode"},N("rtk-controlbar-button",{part:"controlbar-button",size:this.size,iconPack:this.iconPack,onClick:()=>this.togglePip(),icon:t?this.iconPack.pip_on:this.iconPack.pip_off,label:t?this.t("pip_off"):this.t("pip_on"),variant:this.variant}))}static get watchers(){return{meeting:["meetingChanged"]}}};op([ai()],cp.prototype,"meeting",void 0),op([ai()],cp.prototype,"states",void 0),op([ai()],cp.prototype,"iconPack",void 0),op([ai()],cp.prototype,"size",void 0),op([ai()],cp.prototype,"t",void 0),cp.style=":host{line-height:initial;font-family:var(--rtk-font-family, sans-serif);font-feature-settings:normal;font-variation-settings:normal}p{margin:var(--rtk-space-0, 0px);padding:var(--rtk-space-0, 0px)}:host{display:block}:host([data-hidden]){display:none}";var lp=Object.freeze({__proto__:null,rtk_pip_toggle:cp});var dp=function(t,e,i,r){var a,s=arguments.length,n=s<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,i,r);else for(var o=t.length-1;o>=0;o--)(a=t[o])&&(n=(s<3?a(n):s>3?a(e,i,n):a(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};const hp=class{constructor(t){o(this,t),this.stateUpdate=Y(this,"rtkStateUpdate",7),this.variant="button",this.iconPack=je,this.t=Fe(),this.pluginsActive=!1,this.canViewPlugins=!1,this.updateCanView=()=>{this.canViewPlugins=Wl(this.meeting)}}disconnectedCallback(){var t,e,i,r;null===(e=null===(t=this.meeting)||void 0===t?void 0:t.stage)||void 0===e||e.removeListener("stageStatusUpdate",this.updateCanView),null===(r=null===(i=this.meeting)||void 0===i?void 0:i.self)||void 0===r||r.permissions.removeListener("pluginsUpdate",this.updateCanView)}connectedCallback(){this.statesChanged(this.states),this.meetingChanged(this.meeting)}meetingChanged(t){var e,i;null!=t&&(this.canViewPlugins=Wl(t),null===(e=null==t?void 0:t.stage)||void 0===e||e.on("stageStatusUpdate",this.updateCanView),null===(i=null==t?void 0:t.self)||void 0===i||i.permissions.addListener("pluginsUpdate",this.updateCanView))}statesChanged(t){null!=t&&(this.pluginsActive=!0===t.activeSidebar&&"plugins"===t.sidebar)}togglePlugins(){const t=this.states;this.pluginsActive=!((null==t?void 0:t.activeSidebar)&&"plugins"===(null==t?void 0:t.sidebar)),this.stateUpdate.emit({activeSidebar:this.pluginsActive,sidebar:this.pluginsActive?"plugins":void 0,activeMoreMenu:!1,activeAI:!1})}handlePluginsActiveChange(){this.pluginsActive||this.states.activeSidebar||this.buttonEl.focus()}render(){if(!this.canViewPlugins)return N(H,{"data-hidden":!0});const t=this.t("plugins");return N(H,{title:t},N("rtk-controlbar-button",{ref:t=>this.buttonEl=t,part:"controlbar-button",size:this.size,iconPack:this.iconPack,class:{active:this.pluginsActive},onClick:()=>this.togglePlugins(),icon:this.iconPack.rocket,label:t,variant:this.variant}))}static get watchers(){return{meeting:["meetingChanged"],states:["statesChanged"],pluginsActive:["handlePluginsActiveChange"]}}};dp([ai()],hp.prototype,"meeting",void 0),dp([ai()],hp.prototype,"states",void 0),dp([ai()],hp.prototype,"size",void 0),dp([ai()],hp.prototype,"iconPack",void 0),dp([ai()],hp.prototype,"t",void 0),hp.style=":host{line-height:initial;font-family:var(--rtk-font-family, sans-serif);font-feature-settings:normal;font-variation-settings:normal}p{margin:var(--rtk-space-0, 0px);padding:var(--rtk-space-0, 0px)}:host{display:block}:host([data-hidden]){display:none}";var pp=Object.freeze({__proto__:null,rtk_plugins_toggle:hp});var gp=function(t,e,i,r){var a,s=arguments.length,n=s<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,i,r);else for(var o=t.length-1;o>=0;o--)(a=t[o])&&(n=(s<3?a(n):s>3?a(e,i,n):a(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};const up=class{constructor(t){o(this,t),this.stateUpdate=Y(this,"rtkStateUpdate",7),this.variant="button",this.iconPack=je,this.t=Fe(),this.pollsActive=!1,this.unreadPollsCount=0,this.canViewPolls=!1,this.onPollsUpdate=({newPoll:t})=>{!0===t&&(this.unreadPollsCount+=1)},this.updateCanView=()=>{this.canViewPolls=ql(this.meeting)}}connectedCallback(){this.meetingChanged(this.meeting),this.statesChanged(this.states)}disconnectedCallback(){var t,e,i,r,a,s;null===(e=null===(t=this.meeting)||void 0===t?void 0:t.polls)||void 0===e||e.removeListener("pollsUpdate",this.onPollsUpdate),null===(r=null===(i=this.meeting)||void 0===i?void 0:i.self)||void 0===r||r.permissions.removeListener("pollsUpdate",this.updateCanView),null===(s=null===(a=this.meeting)||void 0===a?void 0:a.stage)||void 0===s||s.removeListener("stageStatusUpdate",this.updateCanView)}meetingChanged(t){var e,i;t&&t.polls&&(this.unreadPollsCount=t.polls.items.length,this.meeting.polls.addListener("pollsUpdate",this.onPollsUpdate),null===(e=null==t?void 0:t.self)||void 0===e||e.permissions.addListener("pollsUpdate",this.updateCanView),this.canViewPolls=ql(t),null===(i=null==t?void 0:t.stage)||void 0===i||i.on("stageStatusUpdate",this.updateCanView))}statesChanged(t){null!=t&&(this.pollsActive=!0===t.activeSidebar&&"polls"===t.sidebar)}togglePollsTab(){const t=this.states;this.unreadPollsCount=0,this.pollsActive=!((null==t?void 0:t.activeSidebar)&&"polls"===(null==t?void 0:t.sidebar)),this.stateUpdate.emit({activeSidebar:this.pollsActive,sidebar:this.pollsActive?"polls":void 0,activeMoreMenu:!1,activeAI:!1})}handlePollsActiveChange(){this.pollsActive||this.states.activeSidebar||this.buttonEl.focus()}render(){if(!this.canViewPolls)return N(H,{"data-hidden":!0});const t=this.t("polls");return N(H,{title:t},0!==this.unreadPollsCount&&!this.pollsActive&&N("div",{class:"unread-count",part:"unread-count"},N("span",null,this.unreadPollsCount<=100?this.unreadPollsCount:"99+")),N("rtk-controlbar-button",{ref:t=>this.buttonEl=t,part:"controlbar-button",size:this.size,iconPack:this.iconPack,class:{active:this.pollsActive},onClick:()=>this.togglePollsTab(),icon:this.iconPack.poll,label:t,variant:this.variant}))}static get watchers(){return{meeting:["meetingChanged"],states:["statesChanged"],pollsActive:["handlePollsActiveChange"]}}};gp([ai()],up.prototype,"meeting",void 0),gp([ai()],up.prototype,"states",void 0),gp([ai()],up.prototype,"size",void 0),gp([ai()],up.prototype,"iconPack",void 0),gp([ai()],up.prototype,"t",void 0),up.style=":host{line-height:initial;font-family:var(--rtk-font-family, sans-serif);font-feature-settings:normal;font-variation-settings:normal}p{margin:var(--rtk-space-0, 0px);padding:var(--rtk-space-0, 0px)}:host{position:relative;display:block}:host([data-hidden]){display:none}.unread-count{position:absolute;right:var(--rtk-space-3, 12px);box-sizing:border-box;padding:var(--rtk-space-0\\.5, 2px);-webkit-user-select:none;-moz-user-select:none;user-select:none;--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-brand-500, 33 96 253) / var(--tw-bg-opacity));font-size:12px;color:rgb(var(--rtk-colors-text-on-brand-1000, var(--rtk-colors-text-1000, 255 255 255)));display:flex;height:var(--rtk-space-5, 20px);min-width:var(--rtk-space-5, 20px);align-items:center;justify-content:center;border-radius:9999px;z-index:1}:host([variant='horizontal']) .unread-count{right:var(--rtk-space-4, 16px);top:50%;--tw-translate-y:-50%;transform:translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}";var fp=Object.freeze({__proto__:null,rtk_polls_toggle:up});var mp=function(t,e,i,r){var a,s=arguments.length,n=s<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,i,r);else for(var o=t.length-1;o>=0;o--)(a=t[o])&&(n=(s<3?a(n):s>3?a(e,i,n):a(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};const vp=class{constructor(t){o(this,t),this.t=Fe(),this.iconPack=je,this.setIsRecording=t=>{this.isRecording="RECORDING"===t}}connectedCallback(){this.meetingChanged(this.meeting)}disconnectedCallback(){var t;null===(t=this.meeting)||void 0===t||t.recording.removeListener("recordingUpdate",this.updateRecordingStatus)}meetingChanged(t){null!=t&&(this.setIsRecording(t.recording.recordingState),this.updateRecordingStatus=t=>{this.setIsRecording(t)},t.recording.addListener("recordingUpdate",this.updateRecordingStatus))}render(){return N(H,{key:"3919ce20c5524d477536f62b9dd5abe8c1d49c37","data-hidden":!this.isRecording},this.isRecording&&N("div",{key:"c482fdc00ff90f8ae2841f8d469f3b54704b6615",class:"indicator","aria-label":this.t("recording.indicator"),part:"indicator"},N("rtk-icon",{key:"75663e533fe47c5ad2e5d55db5d8a027fc12220c",icon:this.iconPack.recording,"aria-hidden":!0,tabIndex:-1,part:"icon"}),N("span",{key:"99d4cc0c9ce7388808b643b0bcce27883d2b4643"},this.t("recording.label"))))}static get watchers(){return{meeting:["meetingChanged"]}}};mp([ai()],vp.prototype,"meeting",void 0),mp([ai()],vp.prototype,"size",void 0),mp([ai()],vp.prototype,"t",void 0),mp([ai()],vp.prototype,"iconPack",void 0),vp.style=":host{line-height:initial;font-family:var(--rtk-font-family, sans-serif);font-feature-settings:normal;font-variation-settings:normal}p{margin:var(--rtk-space-0, 0px);padding:var(--rtk-space-0, 0px)}:host{display:block}:host([data-hidden]){display:none}:host[size='sm']{margin-left:var(--rtk-space-1, 4px);margin-right:var(--rtk-space-1, 4px)}.indicator{display:flex;flex-direction:row;align-items:center;font-size:14px;--tw-text-opacity:1;color:rgba(var(--rtk-colors-danger, 255 45 45) / var(--tw-text-opacity))}rtk-icon{margin-right:var(--rtk-space-1, 4px);height:var(--rtk-space-5, 20px);width:var(--rtk-space-5, 20px);animation:blink 4s linear infinite}:host([size='sm']) rtk-icon{height:var(--rtk-space-4, 16px);width:var(--rtk-space-4, 16px)}:host([size='sm']) .indicator span{display:none}@keyframes blink{0%,10%{opacity:0}11%,100%{opacity:1}}";var bp=Object.freeze({__proto__:null,rtk_recording_indicator:vp});var kp=function(t,e,i,r){var a,s=arguments.length,n=s<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,i,r);else for(var o=t.length-1;o>=0;o--)(a=t[o])&&(n=(s<3?a(n):s>3?a(e,i,n):a(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};const yp=class{constructor(t){o(this,t),this.apiError=Y(this,"rtkApiError",7),this.variant="button",this.t=Fe(),this.iconPack=je,this.disabled=!1,this.canRecord=!1,this.permissionsUpdateListener=()=>{this.canRecord=!0===this.meeting.self.permissions.canRecord},this.toggleRecording=async()=>{var t,e,i;if(!this.isLoading()&&!this.disabled)switch(this.recordingState){case"IDLE":try{return void await(null===(t=this.meeting)||void 0===t?void 0:t.recording.start())}catch(t){this.apiError.emit({trace:this.t("recording.start"),message:this.t("recording.error.start")})}return;case"RECORDING":try{return void await(null===(e=this.meeting)||void 0===e?void 0:e.recording.stop())}catch(t){this.apiError.emit({trace:this.t("recording.stop"),message:this.t("recording.error.stop")})}return;case"PAUSED":try{return void await(null===(i=this.meeting)||void 0===i?void 0:i.recording.resume())}catch(t){this.apiError.emit({trace:this.t("recording.resume"),message:this.t("recording.error.resume")})}return;default:return}},this.isLoading=()=>null==this.meeting||"STARTING"===this.recordingState||"STOPPING"===this.recordingState}connectedCallback(){this.meetingChanged(this.meeting)}disconnectedCallback(){var t,e;this.recordingStateUpdateListener&&(null===(t=this.meeting)||void 0===t||t.recording.removeListener("recordingUpdate",this.recordingStateUpdateListener)),null===(e=this.meeting)||void 0===e||e.self.permissions.removeListener("permissionsUpdate",this.permissionsUpdateListener)}meetingChanged(t){null!=t&&(this.recordingState=t.recording.recordingState,this.permissionsUpdateListener(),this.recordingStateUpdateListener=t=>{this.recordingState=t},t.recording.addListener("recordingUpdate",this.recordingStateUpdateListener),t.self.permissions.addListener("permissionsUpdate",this.permissionsUpdateListener))}getLabel(){switch(this.recordingState){case"IDLE":return"recording.idle";case"RECORDING":return"recording.stop";case"STARTING":return"recording.starting";case"STOPPING":return"recording.stopping";case"PAUSED":return"recording.resume";default:return"recording.loading"}}getIcon(){switch(this.recordingState){case"IDLE":case"STARTING":case"STOPPING":default:return this.iconPack.recording;case"RECORDING":return this.iconPack.stop_recording}}render(){if(this.canRecord)return N(H,{title:this.t("RECORDING"===this.recordingState?"recording.stop":"recording.idle")},N("rtk-controlbar-button",{part:"controlbar-button",size:this.size,iconPack:this.iconPack,onClick:this.toggleRecording,icon:this.getIcon(),isLoading:this.isLoading(),label:this.t(this.getLabel()),variant:this.variant,disabled:this.disabled}))}static get watchers(){return{meeting:["meetingChanged"]}}};kp([ai()],yp.prototype,"meeting",void 0),kp([ai()],yp.prototype,"t",void 0),kp([ai()],yp.prototype,"iconPack",void 0),kp([ai()],yp.prototype,"size",void 0),yp.style=":host{line-height:initial;font-family:var(--rtk-font-family, sans-serif);font-feature-settings:normal;font-variation-settings:normal}p{margin:var(--rtk-space-0, 0px);padding:var(--rtk-space-0, 0px)}:host{display:block}";var wp=Object.freeze({__proto__:null,rtk_recording_toggle:yp});var xp=function(t,e,i,r){var a,s=arguments.length,n=s<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,i,r);else for(var o=t.length-1;o>=0;o--)(a=t[o])&&(n=(s<3?a(n):s>3?a(e,i,n):a(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};const Sp=()=>"undefined"!=typeof navigator&&void 0!==navigator.mediaDevices&&"getDisplayMedia"in navigator.mediaDevices,Pp=class{constructor(t){o(this,t),this.stateUpdate=Y(this,"rtkStateUpdate",7),this.apiError=Y(this,"rtkApiError",7),this.variant="button",this.iconPack=je,this.t=Fe(),this.maxScreenShareCount=-1,this.screenShareCount=0,this.screenShareEnabled=!1,this.canScreenShare=!1,this.shareScreenPermission="NOT_REQUESTED",this.screenShareState={tooltipLabel:this.t("screenshare.start"),label:this.t("screenshare.start"),icon:this.iconPack.share_screen_start,classList:{},showWarning:!1,disable:!1},this.stageStatus="OFF_STAGE",this.screenShareListener=()=>{const t=this.meeting.participants.active.toArray().filter((t=>t.screenShareEnabled)).length,e=this.meeting.self.screenShareEnabled?1:0;this.screenShareCount=t+e,this.screenShareEnabled=this.meeting.self.screenShareEnabled,this.getState(),this.meeting.__internals__.logger.info("rtkScreenShare::screenShareUpdate",{media:{screenshare:{enabled:this.screenShareEnabled,count:this.screenShareCount}}})},this.participantLeftListener=({screenShareEnabled:t})=>{t&&(this.screenShareCount=Math.max(this.screenShareCount-1,0),this.getState(),this.meeting.__internals__.logger.info("rtkScreenShare::screenShareUpdate",{media:{screenshare:{enabled:this.screenShareEnabled,count:this.screenShareCount}}}))},this.stageStatusListener=()=>{this.stageStatus=this.meeting.stage.status,this.canScreenShare="ALLOWED"===this.meeting.self.permissions.canProduceScreenshare},this.mediaPermissionUpdateListener=({kind:t,message:e})=>{if("screenshare"===t&&(this.shareScreenPermission=e,this.getState(),"COULD_NOT_START"===e&&this.apiError.emit({trace:this.t("screenshare.permissions"),message:this.t("screenshare.error.unknown")}),this.hasPermissionError())){const t={enabled:!0,kind:"screenshare"};this.stateUpdate.emit({activePermissionsMessage:t})}},this.reachedMaxScreenShares=()=>this.maxScreenShareCount>0&&this.screenShareCount>=this.maxScreenShareCount,this.toggleScreenShare=async()=>{var t;if(this.screenShareState.disable)return;if(this.hasPermissionError()){const t={enabled:!0,kind:"screenshare"};return this.stateUpdate.emit({activePermissionsMessage:t}),!1}const e=null===(t=this.meeting)||void 0===t?void 0:t.self;this.screenShareEnabled?e.disableScreenShare():null==e||!this.canScreenShare||this.reachedMaxScreenShares()||this.hasPermissionError()||(this.screenShareState=Object.assign(Object.assign({},this.screenShareState),{disable:!0}),await e.enableScreenShare(),this.screenShareState=Object.assign(Object.assign({},this.screenShareState),{disable:!1}),this.stateUpdate.emit({activeMoreMenu:!1}))}}connectedCallback(){Sp()?this.meetingChanged(this.meeting):this.meeting.__internals__.logger.error("[rtk-screenshare-toggle] Device does not support screensharing.")}disconnectedCallback(){var t,e,i,r,a,s;null===(t=this.meeting)||void 0===t||t.participants.joined.removeListener("screenShareUpdate",this.screenShareListener),null===(e=this.meeting)||void 0===e||e.participants.joined.removeListener("participantLeft",this.participantLeftListener),null===(i=this.meeting)||void 0===i||i.self.removeListener("screenShareUpdate",this.screenShareListener),null===(r=this.meeting)||void 0===r||r.self.removeListener("mediaPermissionUpdate",this.mediaPermissionUpdateListener),null===(s=null===(a=this.meeting)||void 0===a?void 0:a.stage)||void 0===s||s.removeListener("stageStatusUpdate",this.stageStatusListener)}meetingChanged(t){if(null!=t){const{self:e,stage:i}=t;this.canScreenShare="ALLOWED"===this.meeting.self.permissions.canProduceScreenshare,this.maxScreenShareCount=e.config.maxScreenShareCount,this.screenShareEnabled=e.screenShareEnabled;let r=0;for(const e of t.participants.joined.toArray())e.screenShareEnabled&&r++;this.screenShareCount=r,this.getState(),t.__internals__.logger.info("rtkScreenShare::initialise",{media:{screenshare:{enabled:this.screenShareEnabled,count:this.screenShareCount,maxAllowedCount:this.maxScreenShareCount}}}),this.stageStatus=t.stage.status,t.participants.joined.addListener("screenShareUpdate",this.screenShareListener),t.participants.joined.addListener("participantLeft",this.participantLeftListener),e.addListener("screenShareUpdate",this.screenShareListener),e.addListener("mediaPermissionUpdate",this.mediaPermissionUpdateListener),null==i||i.addListener("stageStatusUpdate",this.stageStatusListener)}}hasPermissionError(){return"SYSTEM_DENIED"===this.shareScreenPermission||"DENIED"===this.shareScreenPermission}getState(){let t="",e="",i="",r={};const a=this.hasPermissionError()&&!this.screenShareEnabled,s=this.reachedMaxScreenShares()&&!this.screenShareEnabled,n="COULD_NOT_START"===this.shareScreenPermission;this.screenShareEnabled&&!a?(e=this.t("screenshare.stop"),i=this.iconPack.share_screen_stop,r["red-icon"]=!0):(e=this.t("screenshare.start"),i=this.iconPack.share_screen_start),"SYSTEM_DENIED"===this.shareScreenPermission?(t=this.t("perm_sys_denied.screenshare"),r["red-icon"]=!0):"DENIED"===this.shareScreenPermission?(t=this.t("perm_denied.screenshare"),r["red-icon"]=!0):t=e,s&&(t=this.t("screenshare.error.max_count")),n&&(t=this.t("screenshare.error.unknown")),this.screenShareState={tooltipLabel:t,label:e,icon:i,classList:r,disable:a||s,showWarning:a||s||n}}render(){return Sp()&&this.canScreenShare&&!["OFF_STAGE","REQUESTED_TO_JOIN_STAGE"].includes(this.stageStatus)?N(H,{title:this.screenShareState.label},N("rtk-tooltip",{placement:"top",kind:"block",label:this.screenShareState.tooltipLabel,delay:600,part:"tooltip"},N("rtk-controlbar-button",{part:"controlbar-button",size:this.size,iconPack:this.iconPack,variant:this.variant,label:this.screenShareState.label,icon:this.screenShareState.icon,class:this.screenShareState.classList,onClick:this.toggleScreenShare,disabled:this.screenShareState.disable,showWarning:this.screenShareState.showWarning}))):N(H,{"data-hidden":!0})}static get watchers(){return{meeting:["meetingChanged"]}}};xp([ai()],Pp.prototype,"states",void 0),xp([ai()],Pp.prototype,"meeting",void 0),xp([ai()],Pp.prototype,"size",void 0),xp([ai()],Pp.prototype,"iconPack",void 0),xp([ai()],Pp.prototype,"t",void 0),Pp.style=":host{line-height:initial;font-family:var(--rtk-font-family, sans-serif);font-feature-settings:normal;font-variation-settings:normal}p{margin:var(--rtk-space-0, 0px);padding:var(--rtk-space-0, 0px)}:host{display:block}:host([data-hidden]){display:none}";var Cp=Object.freeze({__proto__:null,rtk_screen_share_toggle:Pp});const Ep=t=>{null!=t&&(null!=t.requestFullscreen?t.requestFullscreen():null!=t.mozRequestFullScreen?t.mozRequestFullScreen():null!=t.webkitRequestFullscreen?t.webkitRequestFullscreen():null!=t.msRequestFullscreen&&t.msRequestFullscreen())},Tp=()=>{null!=document.exitFullscreen?document.exitFullscreen():null!=document.mozExitFullScreen?document.mozExitFullScreen():null!=document.webkitExitFullscreen?document.webkitExitFullscreen():null!=document.msExitFullscreen&&document.msExitFullscreen()},Lp=()=>null!=document.fullscreenElement||null!=document.webkitCurrentFullScreenElement,_p=()=>"undefined"!=typeof document&&(document.fullscreenEnabled||document.mozFullscreenEnabled||document.webkitFullscreenEnabled||document.msFullscreenEnabled);var Rp=function(t,e,i,r){var a,s=arguments.length,n=s<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,i,r);else for(var o=t.length-1;o>=0;o--)(a=t[o])&&(n=(s<3?a(n):s>3?a(e,i,n):a(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};const Ap=class{constructor(t){o(this,t),this.stateUpdate=Y(this,"rtkStateUpdate",7),this.play=Y(this,"screensharePlay",7),this.fullScreenListener=()=>{this.isFullScreen=Lp()},this.participantScreenshareUpdate=t=>{t.id===this.participant.id&&this.screenShareListener(t)},this.hideFullScreenButton=!1,this.nameTagPosition="bottom-left",this.variant="solid",this.iconPack=je,this.t=Fe(),this.videoExpanded=!1,this.screenShareEnabled=!1,this.isFullScreen=!1,this.toggleFullScreen=()=>{this.isFullScreen?(Tp(),this.isFullScreen=!1):(Ep(this.host),this.isFullScreen=!0)}}connectedCallback(){null===window||void 0===window||window.addEventListener("fullscreenchange",this.fullScreenListener),null===window||void 0===window||window.addEventListener("webkitfullscreenchange",this.fullScreenListener)}componentDidLoad(){this.participantChanged(this.participant)}disconnectedCallback(){if(!this.meeting)return;const{self:t}=this.meeting;this.participant.id===t.id&&this.screenShareListener?this.participant.removeListener("screenShareUpdate",this.screenShareListener):this.meeting.participants.joined.removeListener("screenShareUpdate",this.participantScreenshareUpdate),null===window||void 0===window||window.removeEventListener("fullscreenchange",this.fullScreenListener),null===window||void 0===window||window.removeEventListener("webkitfullscreenchange",this.fullScreenListener)}participantChanged(t){if(null!=t&&this.meeting){const{self:e}=this.meeting;this.screenShareListener=({screenShareEnabled:t,screenShareTracks:e})=>{const i=t&&null!=e.video;if(C((()=>{this.screenShareEnabled=i})),i){const t=new MediaStream;t.addTrack(e.video),null!=this.videoEl&&(this.videoEl.srcObject=t,this.videoEl.play())}else null!=this.videoEl&&(this.videoEl.srcObject=void 0)},this.screenShareListener(t),t.id===e.id?t.addListener("screenShareUpdate",this.screenShareListener):this.meeting.participants.joined.addListener("screenShareUpdate",this.participantScreenshareUpdate)}}render(){var t,e;const i=(null===(t=this.participant)||void 0===t?void 0:t.id)===(null===(e=this.meeting)||void 0===e?void 0:e.self.id),r=this.isFullScreen?this.t("full_screen.exit"):this.t("full_screen"),a=this.isFullScreen?this.iconPack.full_screen_minimize:this.iconPack.full_screen_maximize;return N(H,{key:"c5fe06d9c1bfd2856b2eb93bb55b7c636256052f",class:{isSelf:i}},N("div",{key:"video-container",id:"video-container",class:{expand:this.videoExpanded}},N("video",{key:"5bdd1b7bd0e28ecb4b551b30f6e623c7a1ece49a",ref:t=>this.videoEl=t,class:{visible:this.screenShareEnabled,"fit-in-container":this.participant.supportsRemoteControl},playsInline:!0,onPlay:()=>{this.play.emit({screenshareParticipant:this.participant,participant:this.meeting.self})},autoPlay:!0,muted:!0,id:`screen-share-video-${this.participant.id}`})),N("div",{id:"controls",key:"controls"},!this.hideFullScreenButton&&!i&&_p()&&N("rtk-tooltip",{key:"fdfd7c6b5468ef96bdb06d4f942a3e10cbee08cb",label:r},N("rtk-button",{key:"99e0138257f6e0ec55ceee7f20318d78887f812b",id:"full-screen-btn",kind:"icon",onClick:this.toggleFullScreen,title:r},N("rtk-icon",{key:"06e747a6af4a5b79445ffb63598afd2ac515d3a2",icon:a,"aria-hidden":!0,tabIndex:-1})))),i&&N("div",{id:"self-message",key:"self-message"},N("h3",{key:"1ad96435977e90e6f0eff64a54507d106a4091be"},this.t("screenshare.shared")),N("div",{key:"02f1e2a734d3f56157ab76c1de55517995d8f98d",class:"actions"},null!=this.meeting&&N("rtk-button",{key:"4bc8344f8a829ff1a12552d9002d83032ec7277f",variant:"danger",onClick:()=>{this.meeting.self.disableScreenShare()}},N("rtk-icon",{key:"c2412bb995c605f980859481200033a447147b91",icon:this.iconPack.share_screen_stop,slot:"start"}),this.t("screenshare.stop")),N("rtk-button",{key:"0d513e8b6efa96b542d6bd163db81a179073ed45",variant:"secondary",id:"expand-btn",onClick:()=>{this.videoExpanded=!this.videoExpanded}},N("rtk-icon",{key:"bec9074447f55461239fc4c7c20b811dfe7db8bb",icon:this.videoExpanded?this.iconPack.full_screen_minimize:this.iconPack.full_screen_maximize,slot:"start"}),this.videoExpanded?this.t("screenshare.min_preview"):this.t("screenshare.max_preview")))),N("slot",{key:"2858a3123887f964d6e8ea77fb871abddc4c6295"}))}get host(){return W(this)}static get watchers(){return{participant:["participantChanged"]}}};Rp([ai()],Ap.prototype,"meeting",void 0),Rp([ai()],Ap.prototype,"size",void 0),Rp([ai()],Ap.prototype,"iconPack",void 0),Rp([ai()],Ap.prototype,"t",void 0),Ap.style=":host {\n line-height: initial;\n font-family: var(--rtk-font-family, sans-serif);\n\n font-feature-settings: normal;\n font-variation-settings: normal;\n}\n\np {\n margin: var(--rtk-space-0, 0px);\n padding: var(--rtk-space-0, 0px);\n}\n\n\n:host {\n height: 100%;\n width: 100%;\n position: relative;\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n overflow: hidden;\n border-radius: var(--rtk-border-radius-lg, 12px);\n --tw-bg-opacity: 1;\n background-color: rgba(var(--rtk-colors-video-bg, 24 24 24) / var(--tw-bg-opacity));\n container-type: inline-size;\n container-name: screentile;\n}\n\n::slotted(rtk-name-tag) {\n position: absolute;\n left: var(--rtk-space-3, 12px);\n bottom: var(--rtk-space-3, 12px);\n opacity: 0.8;\n}\n\n#video-container {\n position: absolute;\n display: block;\n height: 100%;\n width: 100%;\n}\n\n#video-container .fit-in-container {\n -o-object-fit: fill;\n object-fit: fill;\n}\n\nvideo {\n height: 100%;\n width: 100%;\n -o-object-fit: contain;\n object-fit: contain;\n}\n\n:host([variant='gradient']) ::slotted(rtk-audio-visualizer) {\n position: absolute;\n top: var(--rtk-space-2, 8px);\n right: var(--rtk-space-2, 8px);\n border-radius: 9999px;\n --tw-bg-opacity: 1;\n background-color: rgba(var(--rtk-colors-brand-500, 33 96 253) / var(--tw-bg-opacity));\n padding: var(--rtk-space-2, 8px);\n}\n\n:host([variant='gradient']) ::slotted(rtk-name-tag) {\n bottom: var(--rtk-space-0, 0px);\n left: var(--rtk-space-0, 0px);\n display: flex;\n width: 100%;\n align-items: center;\n justify-content: center;\n text-align: center;\n background-color: transparent;\n background-image: linear-gradient(to top, var(--tw-gradient-stops));\n --tw-gradient-from: rgb(var(--rtk-colors-background-1000, 8 8 8));\n --tw-gradient-to: rgba(var(--rtk-colors-background-1000, 8 8 8) / 0);\n --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to);\n --tw-gradient-to: transparent;\n}\n\n:host([size='sm'][variant='gradient']) ::slotted(rtk-audio-visualizer) {\n height: var(--rtk-space-5, 20px);\n width: var(--rtk-space-5, 20px);\n}\n\nvideo.visible {\n animation: video-fadein 0.4s ease;\n}\n\n#controls {\n display: none;\n position: absolute;\n top: var(--rtk-space-3, 12px);\n right: var(--rtk-space-3, 12px);\n align-items: center;\n justify-content: flex-end;\n gap: var(--rtk-space-2, 8px);\n}\n\n:host(:hover) #controls, \n:host(:active) #controls, \n:host(:focus-visible) #controls {\n display: flex;\n}\n\n#full-screen-btn {\n --tw-bg-opacity: 1;\n background-color: rgba(var(--rtk-colors-background-700, 44 44 44) / var(--tw-bg-opacity));\n}\n\n/** For self view */\n\nh3 {\n margin-top: var(--rtk-space-10, 40px);\n margin-bottom: var(--rtk-space-6, 24px);\n text-align: center;\n font-size: 20px;\n font-weight: 500;\n}\n\n:host([size='sm']) h3 {\n font-size: 16px;\n}\n\n#self-message {\n padding-left: var(--rtk-space-4, 16px);\n padding-right: var(--rtk-space-4, 16px);\n}\n\n:host(.isSelf) #self-view {\n flex: 1 1 0%;\n}\n\n:host(.isSelf) #video-container {\n position: static;\n aspect-ratio: auto;\n height: auto;\n width: 50%;\n max-width: var(--rtk-space-96, 384px);\n border-radius: var(--rtk-border-radius-md, 8px);\n transition: 0.6s ease;\n}\n\n:host(.isSelf) #video-container.expand {\n width: 60%;\n max-width: 100%;\n}\n\n.actions {\n display: flex;\n align-items: center;\n justify-content: center;\n gap: var(--rtk-space-2, 8px);\n}\n\n:host([size='sm'].isSelf) #video-container,\n:host([size='md'].isSelf) #video-container,\n:host([size='sm'].isSelf) #expand-btn,\n:host([size='md'].isSelf) #expand-btn {\n /** Hide video, fullscreen buttons in sm and md breakpoints */\n display: none;\n}\n\n/** Remote control */\n\np {\n margin: var(--rtk-space-0, 0px);\n padding: var(--rtk-space-0, 0px);\n}\n\n.remote-control {\n z-index: 10;\n height: 100%;\n max-height: 100%;\n flex: 0 1 auto;\n}\n\n#remote-control-self {\n position: absolute;\n top: var(--rtk-space-0, 0px);\n left: 50%;\n z-index: 10;\n width: -moz-max-content;\n width: max-content;\n max-width: 100%;\n box-sizing: border-box;\n display: flex;\n height: var(--rtk-space-8, 32px);\n align-items: center;\n overflow: hidden;\n border-radius: var(--rtk-border-radius-sm, 4px);\n --tw-bg-opacity: 1;\n background-color: rgba(var(--rtk-colors-warning, 255 205 7) / var(--tw-bg-opacity));\n font-size: 12px;\n color: rgb(var(--rtk-colors-text-1000, 255 255 255));\n transform: translateX(-50%);\n}\n\n#remote-control-self p {\n padding-left: var(--rtk-space-3, 12px);\n padding-right: var(--rtk-space-3, 12px);\n padding-top: var(--rtk-space-2, 8px);\n padding-bottom: var(--rtk-space-2, 8px);\n}\n\n#remote-control-self rtk-button {\n height: 100%;\n border-radius: var(--rtk-border-radius-none, 0);\n --tw-bg-opacity: 1;\n background-color: rgba(var(--rtk-colors-danger, 255 45 45) / var(--tw-bg-opacity));\n font-size: 12px;\n}\n\n:host([size='sm']) #remote-control-self {\n height: auto;\n flex-direction: column;\n}\n\n:host([size='sm']) #remote-control-self rtk-button {\n width: 100%;\n padding-top: var(--rtk-space-1, 4px);\n padding-bottom: var(--rtk-space-1, 4px);\n}\n\n/** Name tag positions */\n\n:host([name-tag-position='bottom-right']) ::slotted(rtk-name-tag) {\n left: auto;\n right: var(--rtk-space-3, 12px);\n}\n\n:host([name-tag-position='bottom-center']) ::slotted(rtk-name-tag) {\n left: auto;\n right: auto;\n}\n\n:host([name-tag-position='top-left']) ::slotted(rtk-name-tag) {\n top: var(--rtk-space-3, 12px);\n bottom: auto;\n}\n\n:host([name-tag-position='top-right']) ::slotted(rtk-name-tag) {\n top: var(--rtk-space-3, 12px);\n right: var(--rtk-space-3, 12px);\n left: auto;\n bottom: auto;\n}\n\n:host([name-tag-position='top-center']) ::slotted(rtk-name-tag) {\n left: auto;\n right: auto;\n bottom: auto;\n top: var(--rtk-space-3, 12px);\n}\n\n/** Keyframes */\n\n@keyframes video-fadein {\n 0% {\n opacity: 0;\n transform: scale(1.4) translateY(20px);\n }\n\n 100% {\n opacity: 1;\n transform: scale(1) translateY(0);\n }\n}\n\n::slotted(rtk-network-indicator) {\n position: absolute;\n right: var(--rtk-space-3, 12px);\n bottom: var(--rtk-space-3, 12px);\n}\n\n@media only screen and (max-height: 480px) and (orientation: landscape) {\n :host([size='sm'][variant='solid']) ::slotted(rtk-name-tag), \n :host([size='sm'][variant='solid']) rtk-name-tag {\n left: var(--rtk-space-0, 0px);\n bottom: var(--rtk-space-0, 0px);\n border-radius: var(--rtk-border-radius-none, 0);\n transform-origin: 0% 110%;\n transform: scale(0.6);\n }\n}\n\n@container screentile (max-width: 400px) {\n ::slotted(rtk-name-tag) {\n transform-origin: 0 130%;\n transform: scale(0.7);\n }\n}\n";var Dp=Object.freeze({__proto__:null,rtk_screenshare_view:Ap});var Mp=function(t,e,i,r){var a,s=arguments.length,n=s<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,i,r);else for(var o=t.length-1;o>=0;o--)(a=t[o])&&(n=(s<3?a(n):s>3?a(e,i,n):a(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};const Ip=class{constructor(t){o(this,t),this.stateUpdate=Y(this,"rtkStateUpdate",7),this.keyPressListener=t=>{"Escape"===t.key&&this.close()},this.stageStatusListener=()=>{this.canProduceVideo="ALLOWED"===this.meeting.self.permissions.canProduceVideo},this.iconPack=je,this.t=Fe(),this.activeTab="connection",this.isMobileMainVisible=!1,this.networkStatus="good",this.canProduceVideo=!1}connectedCallback(){document.addEventListener("keydown",this.keyPressListener),this.meetingChanged(this.meeting)}disconnectedCallback(){var t;this.keyPressListener&&document.removeEventListener("keydown",this.keyPressListener),this.poorConnectionListener&&(null===(t=this.meeting)||void 0===t||t.meta.removeListener("poorConnection",this.poorConnectionListener)),this.meeting.stage.removeListener("stageStatusUpdate",this.stageStatusListener)}meetingChanged(t){null!=t&&(this.canProduceVideo="ALLOWED"===this.meeting.self.permissions.canProduceVideo,this.canProduceVideo?this.activeTab="video":this.activeTab="audio",this.poorConnectionListener=({score:t})=>{t<7?this.networkStatus="poor":t<4&&(this.networkStatus="poorest"),setTimeout((()=>{this.networkStatus="good"}),5e3)},t.meta.addListener("poorConnection",this.poorConnectionListener),t.stage.addListener("stageStatusUpdate",this.stageStatusListener))}changeTab(t){this.activeTab=t,"sm"===this.size&&(this.isMobileMainVisible||(this.isMobileMainVisible=!0))}close(){this.stateUpdate.emit({activeSettings:!1})}render(){if(null==this.meeting)return null;const t={meeting:this.meeting,states:this.states,iconPack:this.iconPack,t:this.t};return N(H,null,N("aside",{class:{hide:this.isMobileMainVisible},part:"menu"},N("header",null,N("h2",null,this.t("settings"))),N("button",{type:"button",class:{active:"audio"===this.activeTab},onClick:()=>this.changeTab("audio")},this.t("audio"),N("div",{class:"right"},N("rtk-icon",{icon:this.iconPack.mic_on}),"sm"===this.size&&N("rtk-icon",{icon:this.iconPack.chevron_right}))),this.canProduceVideo&&N("button",{type:"button",class:{active:"video"===this.activeTab},onClick:()=>this.changeTab("video")},this.t("video"),N("div",{class:"right"},N("rtk-icon",{icon:this.iconPack.video_on}),"sm"===this.size&&N("rtk-icon",{icon:this.iconPack.chevron_right}))),N("button",{type:"none",title:`Your network condition is ${this.networkStatus}`},this.t("connection"),N("div",{class:"right"},N("rtk-icon",{icon:this.iconPack.wifi,class:this.networkStatus})))),N("main",{class:{active:this.isMobileMainVisible,scrollbar:!0},part:"main-content"},"sm"===this.size&&N("header",null,N("rtk-button",{kind:"icon",class:"back-btn",onClick:()=>this.isMobileMainVisible=!1},N("rtk-icon",{icon:this.iconPack.chevron_left})),N("h2",null,this.t("audio"===this.activeTab?"audio":"video"))),"audio"===this.activeTab&&N("rtk-settings-audio",Object.assign({},t)),"video"===this.activeTab&&N("rtk-settings-video",Object.assign({},t))))}static get watchers(){return{meeting:["meetingChanged"]}}};Mp([ai()],Ip.prototype,"meeting",void 0),Mp([ai()],Ip.prototype,"states",void 0),Mp([ai()],Ip.prototype,"size",void 0),Mp([ai()],Ip.prototype,"iconPack",void 0),Mp([ai()],Ip.prototype,"t",void 0),Ip.style=":host{line-height:initial;font-family:var(--rtk-font-family, sans-serif);font-feature-settings:normal;font-variation-settings:normal}p{margin:var(--rtk-space-0, 0px);padding:var(--rtk-space-0, 0px)}.scrollbar{scrollbar-width:thin;scrollbar-color:var(--rtk-scrollbar-color, rgb(var(--rtk-colors-background-600, 60 60 60)))\n var(--rtk-scrollbar-background, transparent)}.scrollbar::-webkit-scrollbar{height:var(--rtk-space-1\\.5, 6px);width:var(--rtk-space-1\\.5, 6px);border-radius:9999px;background-color:var(--rtk-scrollbar-background, transparent)}.scrollbar::-webkit-scrollbar-thumb{border-radius:9999px;background-color:var(--rtk-scrollbar-color, rgb(var(--rtk-colors-background-600, 60 60 60)))}:host{position:relative;display:flex;overflow:hidden;border-radius:var(--rtk-border-radius-md, 8px);width:100%;--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-background-800, 30 30 30) / var(--tw-bg-opacity));color:rgb(var(--rtk-colors-text-1000, 255 255 255))}header{display:flex;align-items:center;justify-content:space-between;padding-left:var(--rtk-space-4, 16px);padding-right:var(--rtk-space-4, 16px)}.title{font-size:20px;line-height:1}.back-btn,.dismiss-btn{border-radius:var(--rtk-border-radius-sm, 4px);background-color:transparent;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)}.back-btn:hover,.dismiss-btn:hover{--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-background-700, 44 44 44) / var(--tw-bg-opacity))}aside{box-sizing:border-box;display:flex;min-width:var(--rtk-space-56, 224px);flex-direction:column;--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-background-900, 26 26 26) / var(--tw-bg-opacity));padding-left:var(--rtk-space-2, 8px)}aside button{margin-top:var(--rtk-space-4, 16px);box-sizing:border-box;display:flex;width:100%;align-items:center;justify-content:space-between;border-top-left-radius:var(--rtk-border-radius-sm, 4px);border-bottom-left-radius:var(--rtk-border-radius-sm, 4px);padding-left:var(--rtk-space-4, 16px);padding-right:var(--rtk-space-4, 16px);padding-top:var(--rtk-space-3, 12px);padding-bottom:var(--rtk-space-3, 12px);background-color:transparent;color:rgb(var(--rtk-colors-text-900, 255 255 255 / 0.88));cursor:default;font-size:16px;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);border-width:var(--rtk-border-width-none, 0);border-style:none;outline:2px solid transparent;outline-offset:2px}aside button .right{display:flex;align-items:center}aside button .right rtk-icon{height:var(--rtk-space-6, 24px);width:var(--rtk-space-6, 24px)}aside button .right rtk-icon:last-child{margin-left:var(--rtk-space-4, 16px)}aside button[type='button']{cursor:pointer;transition-property:color, background-color, border-color, text-decoration-color, fill, stroke;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:150ms}aside button[type='button']:hover{--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-background-700, 44 44 44) / var(--tw-bg-opacity))}aside button[type='button']{border-right:var(--rtk-border-width-md, 2px) solid transparent}aside button.active{--tw-border-opacity:1;border-color:rgba(var(--rtk-colors-brand-500, 33 96 253) / var(--tw-border-opacity));background-color:rgba(var(--rtk-colors-brand-500, 33 96 253) / 0.2)}aside button.active:hover{background-color:rgba(var(--rtk-colors-brand-500, 33 96 253) / 0.2)}rtk-icon.poor{--tw-text-opacity:1;color:rgba(var(--rtk-colors-warning, 255 205 7) / var(--tw-text-opacity))}rtk-icon.poorest{--tw-text-opacity:1;color:rgba(var(--rtk-colors-danger, 255 45 45) / var(--tw-text-opacity))}rtk-icon.good{--tw-text-opacity:1;color:rgba(var(--rtk-colors-success, 98 165 4) / var(--tw-text-opacity))}main{display:flex;flex:1 1 0%;align-items:center;justify-content:center;padding-left:var(--rtk-space-6, 24px);padding-right:var(--rtk-space-6, 24px);box-sizing:border-box;width:100%;max-width:calc(100% - var(--rtk-space-56, 224px))}.dismiss-btn{position:absolute;top:var(--rtk-space-3, 12px);right:var(--rtk-space-3, 12px);height:var(--rtk-space-6, 24px);width:var(--rtk-space-6, 24px)}:host([size='sm']) aside{--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-background-800, 30 30 30) / var(--tw-bg-opacity))}:host([size='sm']) .dismiss-btn{top:var(--rtk-space-5, 20px);right:var(--rtk-space-4, 16px)}:host([size='sm']) aside{width:100%;padding-left:var(--rtk-space-0, 0px)}:host([size='sm']) aside button{border-radius:var(--rtk-border-radius-none, 0)}:host([size='sm']) aside button.active{border-width:var(--rtk-border-width-none, 0);border-style:none;background-color:transparent}:host([size='sm']) aside button.active:hover{--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-background-700, 44 44 44) / var(--tw-bg-opacity))}:host([size='sm']) aside.hide{display:none}:host([size='sm']) main{display:none;max-width:100%;overflow-y:auto;padding-left:var(--rtk-space-4, 16px);padding-right:var(--rtk-space-4, 16px)}:host([size='sm']) main header{justify-content:center}:host([size='sm']) main header rtk-button{position:absolute;left:var(--rtk-space-4, 16px)}:host([size='sm']) main.active{display:block}";var Op=Object.freeze({__proto__:null,rtk_settings:Ip});var Up=function(t,e,i,r){var a,s=arguments.length,n=s<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,i,r);else for(var o=t.length-1;o>=0;o--)(a=t[o])&&(n=(s<3?a(n):s>3?a(e,i,n):a(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};const $p=class{constructor(t){o(this,t),this.stateUpdate=Y(this,"rtkStateUpdate",7),this.variant="button",this.iconPack=je,this.t=Fe()}toggleSettings(){const t={activeSettings:!0,activeMoreMenu:!1};this.states=Object.assign(Object.assign({},this.states),t),this.stateUpdate.emit(t)}render(){const t=this.t("settings");return N(H,{key:"11653f887305c7ba74c0e62197b0b8502f64bb22",title:t},N("rtk-controlbar-button",{key:"4e4985182d0c63d2f9f8f2fc8173f2cd10edf91d",part:"controlbar-button",size:this.size,iconPack:this.iconPack,onClick:()=>this.toggleSettings(),icon:this.iconPack.settings,label:t,variant:this.variant}))}};Up([ai()],$p.prototype,"states",void 0),Up([ai()],$p.prototype,"size",void 0),Up([ai()],$p.prototype,"iconPack",void 0),Up([ai()],$p.prototype,"t",void 0),$p.style=":host{line-height:initial;font-family:var(--rtk-font-family, sans-serif);font-feature-settings:normal;font-variation-settings:normal}p{margin:var(--rtk-space-0, 0px);padding:var(--rtk-space-0, 0px)}:host{display:block}";var Fp=Object.freeze({__proto__:null,rtk_settings_toggle:$p});var jp=function(t,e,i,r){var a,s=arguments.length,n=s<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,i,r);else for(var o=t.length-1;o>=0;o--)(a=t[o])&&(n=(s<3?a(n):s>3?a(e,i,n):a(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};const zp=class{constructor(t){o(this,t),this.stateUpdate=Y(this,"rtkStateUpdate",7),this.config=De,this.iconPack=je,this.t=Fe(),this.isJoining=!1,this.canEditName=!0,this.canProduceAudio=!0,this.socketStateUpdate=({state:t})=>{this.connectionState=t,"failed"===t&&(this.isJoining=!1)},this.join=async()=>{var t,e,i;if(""!==(null===(t=this.displayName)||void 0===t?void 0:t.trim())&&!this.isJoining){this.isJoining=!0,null===(e=this.meeting)||void 0===e||e.self.setName(this.displayName),Be.setItem("rtk-display-name",this.displayName);try{await(null===(i=this.meeting)||void 0===i?void 0:i.joinRoom())}catch(t){this.isJoining=!1}}}}connectedCallback(){this.meetingChanged(this.meeting)}disconnectedCallback(){this.meeting.meta.removeListener("socketConnectionUpdate",this.socketStateUpdate)}componentDidLoad(){var t;null===(t=this.inputEl)||void 0===t||t.focus()}meetingChanged(t){var e,i,r;t&&(this.connectionState=null===(e=t.meta.socketState)||void 0===e?void 0:e.state,this.canEditName=null===(i=t.self.permissions.canEditDisplayName)||void 0===i||i,this.displayName=(null===(r=t.self.name)||void 0===r?void 0:r.trim())||(this.canEditName?"":"Participant"),t.meta.addListener("socketConnectionUpdate",this.socketStateUpdate))}render(){var t,e,i,r;const a=""===(null===(t=this.displayName)||void 0===t?void 0:t.trim())||"connected"!==this.connectionState||this.isJoining,s={meeting:this.meeting,config:this.config,states:this.states,size:this.size,iconPack:this.iconPack,t:this.t},n=null===(e=this.meeting)||void 0===e?void 0:e.meta.meetingTitle.trim();return N(H,{key:"ea88610290c5f721a9fe638928855cc31bcb975f"},N("div",{key:"321f2a690e22c14c627e603b4f7d590800f19911",class:"container"},N("div",{key:"c4501f3c49417145e34024c05e8df52174289138",class:"container-tile"},N(rr,{key:"66514020274bb3a6df00c94e75e14785079853c1",element:"rtk-participant-tile",defaults:s,props:{participant:null===(i=this.meeting)||void 0===i?void 0:i.self,size:"md",isPreview:!0},childProps:{participant:null===(r=this.meeting)||void 0===r?void 0:r.self,size:"md"},deepProps:!0}),N("div",{key:"e3f6ec148cc113d3efef3955d9bb96c68c36e9a7",class:"media-selectors"},N("rtk-microphone-selector",Object.assign({key:"450cc901acd253dec2c40c1d2c1ff27441fcbb6c"},s,{variant:"inline"})),N("rtk-camera-selector",Object.assign({key:"cf38bfe66aac01a51845d619521c747727f926ac"},s,{variant:"inline"})),N("rtk-speaker-selector",Object.assign({key:"33357804c4d4ba359f7348f853cd25ef1ee0f442"},s,{variant:"inline"})))),N("div",{key:"bff07c087cb1c5f6db822b38fe9485c4e69d4ecd",class:"metadata"},n&&""!==n&&N("div",{key:"e9d6882f1d79b1687883a9de7a23b9ca89142c0a",class:"meeting-title"},n),this.canEditName?N(Gt,null,N("div",{class:"join-as"},this.t("setup_screen.join_in_as")),N("input",{placeholder:this.t("setup_screen.your_name"),value:this.displayName,spellcheck:!1,autoFocus:!0,ref:t=>{this.inputEl=t},onInput:t=>{this.displayName=t.target.value},onKeyDown:t=>{"Enter"===t.key&&this.join()}})):N("div",{class:"uneditable-name"},N("span",{class:"text"},this.t("setup_screen.join_in_as")," ")," ",N("div",{class:"name"},Qe(this.displayName,20))),N("rtk-button",{key:"d6d629f03ccabca7823c6b78e3b4dc42c2db9ecc",size:"lg",kind:"wide",onClick:this.join,disabled:a},this.isJoining?N("rtk-spinner",{iconPack:this.iconPack}):this.t("join")),"connected"!==this.connectionState&&N("div",{key:"92c30fa7cdef877ff80cbc74806e6824c725d284",class:"no-network-badge"},N("rtk-icon",{key:"615e5873958f0e7502e6fbcefdca8b34892d4d2b",size:"md",variant:"danger",icon:this.iconPack.disconnected}),"failed"===this.connectionState?this.t("network.lost_extended"):this.t("network.lost")))))}static get watchers(){return{meeting:["meetingChanged"]}}};jp([ai()],zp.prototype,"meeting",void 0),jp([ai()],zp.prototype,"states",void 0),jp([ai()],zp.prototype,"size",void 0),jp([ai()],zp.prototype,"iconPack",void 0),jp([ai()],zp.prototype,"t",void 0),zp.style=":host{line-height:initial;font-family:var(--rtk-font-family, sans-serif);font-feature-settings:normal;font-variation-settings:normal}p{margin:var(--rtk-space-0, 0px);padding:var(--rtk-space-0, 0px)}:host{box-sizing:border-box;padding:var(--rtk-space-4, 16px);height:100%;min-height:100%;width:100%;display:flex;place-items:center;justify-content:center;--rtk-controlbar-button-background-color:rgb(var(--rtk-colors-background-700, 44 44 44))}.container{width:100%;max-width:1080px;display:flex;align-items:center;justify-content:space-evenly;gap:var(--rtk-space-4, 16px)}.container-tile{display:flex;height:100%;width:100%;max-width:584px;flex-direction:column;gap:var(--rtk-space-2, 8px)}.metadata{display:flex;width:100%;max-width:var(--rtk-space-80, 320px);flex-direction:column;align-items:center;text-align:center}.meeting-title{margin-bottom:var(--rtk-space-4, 16px);text-align:center;font-size:24px;font-weight:500}.join-as{margin:var(--rtk-space-0, 0px);margin-bottom:var(--rtk-space-4, 16px);text-align:center;font-size:16px;letter-spacing:-0.025em;color:rgb(var(--rtk-colors-text-600, 255 255 255 / 0.52));overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:1}.uneditable-name{margin-bottom:var(--rtk-space-6, 24px)}.uneditable-name .text,.uneditable-name .name{display:inline-block}.uneditable-name .name{font-size:16px;font-weight:500}input{margin-bottom:var(--rtk-space-6, 24px);display:block;height:var(--rtk-space-10, 40px);width:100%;max-width:var(--rtk-space-80, 320px);border-radius:var(--rtk-border-radius-sm, 4px);--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-background-1000, 8 8 8) / var(--tw-bg-opacity));padding-left:var(--rtk-space-3, 12px);padding-right:var(--rtk-space-3, 12px);color:rgb(var(--rtk-colors-text-1000, 255 255 255));box-sizing:border-box;font-size:16px;outline:2px solid transparent;outline-offset:2px;transition-property:color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, -webkit-backdrop-filter;transition-property:color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter;transition-property:color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter, -webkit-backdrop-filter;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:150ms}input::-moz-placeholder{color:rgb(var(--rtk-colors-text-600, 255 255 255 / 0.52))}input::placeholder{color:rgb(var(--rtk-colors-text-600, 255 255 255 / 0.52))}input{border:var(--rtk-border-width-sm, 1px) solid rgb(var(--rtk-colors-background-600, 60 60 60))}input:focus{--tw-border-opacity:1;border-color:rgba(var(--rtk-colors-brand-500, 33 96 253) / var(--tw-border-opacity))}rtk-spinner{color:rgb(var(--rtk-colors-text-1000, 255 255 255));--icon-size:var(--rtk-space-8, 32px)}:host([size='sm']) .container,:host([size='md']) .container{height:100%;flex-direction:column;justify-content:space-evenly}:host([size='sm']) .container-tile,:host([size='md']) .container-tile{height:-moz-min-content;height:min-content;flex-direction:column;justify-content:center}rtk-participant-tile{height:auto;width:100%;max-width:584px}.media-selectors{display:flex;flex-direction:column;justify-content:space-between}.media-selectors .row{display:grid;grid-template-columns:repeat(2, minmax(0, 1fr))}.no-network-badge{margin-top:var(--rtk-space-2, 8px);display:flex;width:100%;flex-direction:row;align-items:center;justify-content:flex-start;border-radius:var(--rtk-border-radius-sm, 4px);--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-brand-500, 33 96 253) / var(--tw-bg-opacity));background-color:rgba(var(--rtk-colors-danger, 255 45 45) / 0.1);padding-top:var(--rtk-space-1, 4px);padding-bottom:var(--rtk-space-1, 4px);font-size:12px;color:rgba(var(--rtk-colors-danger, 255 45 45) / 0.75)}.no-network-badge rtk-icon{margin-left:var(--rtk-space-2, 8px);margin-right:var(--rtk-space-2, 8px)}";var Np=Object.freeze({__proto__:null,rtk_setup_screen:zp});var Bp=function(t,e,i,r){var a,s=arguments.length,n=s<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,i,r);else for(var o=t.length-1;o>=0;o--)(a=t[o])&&(n=(s<3?a(n):s>3?a(e,i,n):a(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};const Hp=class{constructor(t){o(this,t),this.stateUpdate=Y(this,"rtkStateUpdate",7),this.enabledSections=[],this.defaultSection="chat",this.config=De,this.iconPack=je,this.t=Fe(),this.view="sidebar",this.currentTab=this.defaultSection,this.isFloating=!1,this.enablePinning=!0,this.getTabs=()=>this.meeting.self.config?this.enabledSections.filter((t=>this.meeting.self.config.controlBar.elements[t.id])):this.enabledSections,this.close=()=>{this.stateUpdate.emit({activeSidebar:!1,sidebar:this.defaultSection})},this.toggleFloating=()=>{this.isFloating=!this.isFloating}}connectedCallback(){var t;this.viewChanged(this.view),this.statesChanged(this.states),this.meetingChanged(this.meeting),this.isFloating=(null===(t=this.states)||void 0===t?void 0:t.sidebarFloating)||!1}disconnectedCallback(){var t,e;null===(e=null===(t=this.meeting)||void 0===t?void 0:t.stage)||void 0===e||e.removeListener("stageStatusUpdate",this.onStageStatusUpdate),this.onStageStatusUpdate=null}meetingChanged(t){var e,i;this.updateEnabledSections(t),this.onStageStatusUpdate=t=>{this.updateEnabledSections(this.meeting)},null===(i=null===(e=this.meeting)||void 0===e?void 0:e.stage)||void 0===i||i.on("stageStatusUpdate",this.onStageStatusUpdate)}statesChanged(t){const e=t;(null==e?void 0:e.sidebar)&&(this.currentTab=e.sidebar)}viewChanged(t){this.enablePinning="full-screen"!==t}viewSection(t){this.currentTab=t,this.stateUpdate.emit({activeSidebar:!0,sidebar:this.currentTab})}updateEnabledSections(t=this.meeting){const e=[];Vl(t)&&e.push({id:"chat",name:this.t("chat")}),ql(t)&&e.push({id:"polls",name:this.t("polls")}),Kl(t)&&e.push({id:"participants",name:this.t("participants")}),Wl(t)&&e.push({id:"plugins",name:this.t("plugins")}),this.enabledSections=e}render(){var t;const e={meeting:this.meeting,config:this.config,states:this.states,size:this.size,t:this.t,iconPack:this.iconPack};return!1!==(null===(t=e.states)||void 0===t?void 0:t.activeSidebar)&&this.currentTab?N(H,{class:this.enablePinning?this.isFloating?"floating":"":"floating"},N("rtk-sidebar-ui",{tabs:this.getTabs(),currentTab:this.currentTab,view:this.view,onTabChange:t=>{this.viewSection(t.detail)},onSidebarClose:this.close},this.enablePinning&&N("div",{class:"pinned-state",slot:"pinned-state"},N("rtk-button",{variant:"ghost",kind:"icon",onClick:this.toggleFloating,"aria-label":this.isFloating?this.t("pin"):this.t("unpin")},N("rtk-icon",{icon:this.isFloating?this.iconPack.pin:this.iconPack.pin_off}))),"chat"===e.states.sidebar&&N(rr,{element:"rtk-chat",defaults:e,props:{slot:"chat"}}),"polls"===e.states.sidebar&&N("rtk-polls",Object.assign({},e,{slot:"polls"})),"participants"===e.states.sidebar&&N(rr,{element:"rtk-participants",defaults:e,props:{slot:"participants"}}),"plugins"===e.states.sidebar&&N("rtk-plugins",Object.assign({},e,{slot:"plugins"})))):null}static get watchers(){return{meeting:["meetingChanged"],states:["statesChanged"],view:["viewChanged"]}}};Bp([ai()],Hp.prototype,"meeting",void 0),Bp([ai()],Hp.prototype,"states",void 0),Bp([ai()],Hp.prototype,"iconPack",void 0),Bp([ai()],Hp.prototype,"t",void 0),Bp([ai()],Hp.prototype,"size",void 0),Hp.style=":host{line-height:initial;font-family:var(--rtk-font-family, sans-serif);font-feature-settings:normal;font-variation-settings:normal}p{margin:var(--rtk-space-0, 0px);padding:var(--rtk-space-0, 0px)}:host{height:100%;width:100%;max-width:var(--rtk-space-96, 384px);box-sizing:border-box;display:flex;flex-direction:column;--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-background-1000, 8 8 8) / var(--tw-bg-opacity));border-width:var(--rtk-border-width-sm, 1px);border-style:solid;--tw-border-opacity:1;border-color:rgba(var(--rtk-colors-background-700, 44 44 44) / var(--tw-border-opacity))}:host([view='sidebar']){right:var(--rtk-space-2, 8px);overflow:clip;border-radius:var(--rtk-border-radius-lg, 12px);--tw-shadow:0 25px 50px -12px rgb(0 0 0 / 0.25);--tw-shadow-colored:0 25px 50px -12px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);--tw-shadow-color:rgb(var(--rtk-colors-background-900, 26 26 26));--tw-shadow:var(--tw-shadow-colored)}:host([view='full-screen']){top:var(--rtk-space-0, 0px);right:var(--rtk-space-0, 0px);bottom:var(--rtk-space-0, 0px);left:var(--rtk-space-0, 0px);max-width:100%}:host(.floating){position:absolute !important;top:var(--rtk-space-0, 0px);right:var(--rtk-space-0, 0px);bottom:var(--rtk-space-0, 0px);left:var(--rtk-space-0, 0px);left:auto;z-index:50}.pinned-state{position:absolute;right:var(--rtk-space-1, 4px);display:inline-flex;width:var(--rtk-space-2, 8px);justify-content:flex-end}";var Gp=Object.freeze({__proto__:null,rtk_sidebar:Hp});var Vp=function(t,e,i,r){var a,s=arguments.length,n=s<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,i,r);else for(var o=t.length-1;o>=0;o--)(a=t[o])&&(n=(s<3?a(n):s>3?a(e,i,n):a(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};const qp=class{constructor(t){o(this,t),this.participants=[],this.aspectRatio="16:9",this.gap=8,this.config=De,this.iconPack=je,this.t=Fe(),this.dimensions={width:0,height:0},this.setHostDimensions=()=>{const{clientWidth:t,clientHeight:e}=this.host;this.dimensions={width:t,height:e}}}connectedCallback(){this.resizeObserver=new Is(this.setHostDimensions),this.resizeObserver.observe(this.host),this.meetingChanged(this.meeting)}meetingChanged(t){const e=null==t?void 0:t.meta;e&&(this.mediaConnection=Object.assign({},e.mediaState))}disconnectedCallback(){var t;null===(t=this.resizeObserver)||void 0===t||t.disconnect()}render(){const t={meeting:this.meeting,config:this.config,states:this.states,size:this.size,iconPack:this.iconPack,t:this.t},{width:e,height:i,getPosition:r}=Xd({dimensions:this.dimensions,count:this.participants.length,aspectRatio:this.aspectRatio,gap:this.gap});return N(H,{key:"2e49045f4417f3dbd9b59ba877c0b9e47685f7f1"},N("slot",{key:"381a5deca04344b21c70a05656a01790edb572bd"},this.participants.map(((a,s)=>{const{top:n,left:o}=r(s);return N(rr,{element:"rtk-participant-tile",defaults:t,props:{participant:a,style:{position:"absolute",top:`${n}px`,left:`${o}px`,width:`${e}px`,height:`${i}px`},key:a.id,"data-participant":a.id,mediaConnection:this.mediaConnection},childProps:{participant:a},deepProps:!0})}))))}get host(){return W(this)}static get watchers(){return{meeting:["meetingChanged"]}}};Vp([ai()],qp.prototype,"size",void 0),Vp([ai()],qp.prototype,"meeting",void 0),Vp([ai()],qp.prototype,"states",void 0),Vp([ai()],qp.prototype,"iconPack",void 0),Vp([ai()],qp.prototype,"t",void 0),qp.style=":host{line-height:initial;font-family:var(--rtk-font-family, sans-serif);font-feature-settings:normal;font-variation-settings:normal}p{margin:var(--rtk-space-0, 0px);padding:var(--rtk-space-0, 0px)}:host{position:relative;display:block;height:100%;width:100%}";var Kp=Object.freeze({__proto__:null,rtk_simple_grid:qp});var Wp=function(t,e,i,r){var a,s=arguments.length,n=s<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,i,r);else for(var o=t.length-1;o>=0;o--)(a=t[o])&&(n=(s<3?a(n):s>3?a(e,i,n):a(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};const Yp=class{constructor(t){o(this,t),this.layout="row",this.participants=[],this.pinnedParticipants=[],this.aspectRatio="16:9",this.gap=8,this.config=De,this.iconPack=je,this.t=Fe(),this.gridSize=eh,this.getAdaptiveSize=t=>"sm"===this.size||t>3||"md"===this.size?"sm":"md"}render(){const t={meeting:this.meeting,config:this.config,states:this.states,size:this.size,iconPack:this.iconPack,t:this.t},e=this.participants.filter((t=>this.pinnedParticipants.some((e=>e.id!=t.id))));return N(H,{key:"84e2ba9e414e03e433ace1a49b6b382755448646"},N("main",{key:"cc9324d3d21c8660085276edd5cba1541fd786d9",part:"main"},N(rr,{key:"50779559a7f22d60f6191eef4a15ce21bb4a4723",element:"rtk-simple-grid",defaults:t,props:{part:"main-grid",participants:this.pinnedParticipants,aspectRatio:this.aspectRatio,gap:this.gap,size:this.getAdaptiveSize(this.pinnedParticipants.length)}})),e.length>0&&N("aside",{key:"0d5e6b89cf403050bcbaa6b3129883e5facff0d7",part:"aside",class:this.gridSize.spotlight?`grid-width-${this.gridSize.spotlight}`:"grid-width-md"},N(rr,{key:"b1dbb1c84169e6cee5b6d62f669458fbd36446ff",element:"rtk-simple-grid",defaults:t,props:{part:"aside-grid",participants:e,aspectRatio:this.aspectRatio,gap:this.gap,size:this.getAdaptiveSize(e.length)}})))}get host(){return W(this)}};Wp([ai()],Yp.prototype,"size",void 0),Wp([ai()],Yp.prototype,"meeting",void 0),Wp([ai()],Yp.prototype,"states",void 0),Wp([ai()],Yp.prototype,"iconPack",void 0),Wp([ai()],Yp.prototype,"t",void 0),Yp.style=":host{line-height:initial;font-family:var(--rtk-font-family, sans-serif);font-feature-settings:normal;font-variation-settings:normal}p{margin:var(--rtk-space-0, 0px);padding:var(--rtk-space-0, 0px)}:host{display:flex;height:100%;width:100%}main{flex:1 1 0%}.grid-width-sm{width:25%}.grid-width-md{width:50%}.grid-width-lg{width:66.666667%}:host([size='sm']),:host([size='md']){flex-direction:column}:host([size='md']) aside{max-height:var(--rtk-space-96, 384px);width:100%;max-width:100%}:host([size='md']) .grid-width-sm{height:25%}:host([size='md']) .grid-width-md{height:50%}:host([size='md']) .grid-width-lg{height:66.666667%}:host([size='sm']) aside{max-height:var(--rtk-space-96, 384px);width:100%;max-width:100%}:host([size='sm']) .grid-width-sm,:host([size='sm']) .grid-width-md,:host([size='sm']) .grid-width-lg{height:50%}:host([size='xl']) .grid-width-sm,:host([size='xl']) .grid-width-md,:host([size='xl']) .grid-width-lg{width:400px}:host([layout='column']){flex-direction:column}:host([layout='column']) main{flex:4}:host([layout='column']) aside{flex:2;max-width:100%;width:100%}";var Zp=Object.freeze({__proto__:null,rtk_spotlight_grid:Yp});var Qp=function(t,e,i,r){var a,s=arguments.length,n=s<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,i,r);else for(var o=t.length-1;o>=0;o--)(a=t[o])&&(n=(s<3?a(n):s>3?a(e,i,n):a(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};const Jp=class{constructor(t){o(this,t),this.stateUpdate=Y(this,"rtkStateUpdate",7),this.iconPack=je,this.t=Fe()}render(){return N(H,{key:"6f350737bc0425eb6112badf128310e9f6a489a0"},N("slot",{key:"d8d99aaeb1277e13be9052a3136d5677113a2bc1"}))}};Qp([ai()],Jp.prototype,"iconPack",void 0),Qp([ai()],Jp.prototype,"t",void 0),Jp.style=":host{line-height:initial;font-family:var(--rtk-font-family, sans-serif);font-feature-settings:normal;font-variation-settings:normal}p{margin:var(--rtk-space-0, 0px);padding:var(--rtk-space-0, 0px)}:host{display:block;position:relative;overflow:hidden}";var Xp=Object.freeze({__proto__:null,rtk_stage:Jp});var tg=function(t,e,i,r){var a,s=arguments.length,n=s<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,i,r);else for(var o=t.length-1;o>=0;o--)(a=t[o])&&(n=(s<3?a(n):s>3?a(e,i,n):a(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};const eg=class{constructor(t){o(this,t),this.stateUpdate=Y(this,"rtkStateUpdate",7),this.variant="button",this.iconPack=je,this.t=Fe(),this.stageStatus="OFF_STAGE",this.state={label:"",disabled:!1,icon:""},this.stageCallback=async()=>{var t,e,i,r,a,s,n;const o=null===(t=this.meeting.stage)||void 0===t?void 0:t.status;"ON_STAGE"===o&&await(null===(i=null===(e=null==this?void 0:this.meeting)||void 0===e?void 0:e.stage)||void 0===i?void 0:i.leave()),"OFF_STAGE"===o&&(null===(a=null===(r=null==this?void 0:this.meeting)||void 0===r?void 0:r.stage)||void 0===a||a.requestAccess(),(t=>{var e,i;return(null===(e=null==t?void 0:t.self)||void 0===e?void 0:e.permissions.stageEnabled)&&"ALLOWED"===(null===(i=null==t?void 0:t.self)||void 0===i?void 0:i.permissions.stageAccess)})(this.meeting)&&(Ze.states.activeJoinStage=!0,this.stateUpdate.emit({activeJoinStage:!0}))),"REQUESTED_TO_JOIN_STAGE"===o&&(null===(n=null===(s=null==this?void 0:this.meeting)||void 0===s?void 0:s.stage)||void 0===n||n.cancelRequestAccess())}}connectedCallback(){this.meetingChanged(this.meeting)}stageStatusHandler(t,e){this.stageStatus=e,"ACCEPTED_TO_JOIN_STAGE"===e&&(t.self.setupTracks({audio:!1,video:!1}),this.stateUpdate.emit({activeJoinStage:!0})),this.state=this.getState()}disconnectedCallback(){var t,e;null===(e=null===(t=this.meeting)||void 0===t?void 0:t.stage)||void 0===e||e.removeListener("stageStatusUpdate",(t=>this.stageStatusHandler(this.meeting,t)))}meetingChanged(t){var e,i,r,a;null!=t&&(this.stageStatus=null===(e=t.stage)||void 0===e?void 0:e.status,this.stageStatusHandler(t,null===(i=t.stage)||void 0===i?void 0:i.status),null===(a=null===(r=this.meeting)||void 0===r?void 0:r.stage)||void 0===a||a.on("stageStatusUpdate",(e=>this.stageStatusHandler(t,e))))}getState(){let t="",e="",i=!1;switch(this.stageStatus){case"ON_STAGE":e=this.iconPack.leave_stage,t=this.t("stage_request.leave_stage"),i=!1;break;case"ACCEPTED_TO_JOIN_STAGE":e=this.iconPack.join_stage,t=this.t("stage_request.request"),i=!0;break;case"REQUESTED_TO_JOIN_STAGE":e=this.iconPack.join_stage,t=this.t("stage_request.requested"),i=!1;break;default:e=this.iconPack.join_stage,t=this.t("stage_request.request"),i=!1}return{label:t,disabled:i,icon:e}}render(){return t=this.meeting,(null===(e=null==t?void 0:t.self)||void 0===e?void 0:e.permissions.stageEnabled)&&"NOT_ALLOWED"!==(null===(i=null==t?void 0:t.self)||void 0===i?void 0:i.permissions.stageAccess)?N(H,{title:this.state.label},N("rtk-tooltip",{placement:"top",kind:"block",label:this.state.label,delay:600,part:"tooltip"},N("rtk-controlbar-button",{part:"controlbar-button",size:this.size,iconPack:this.iconPack,variant:this.variant,label:this.state.label,icon:this.state.icon,onClick:this.stageCallback,disabled:this.state.disabled,showWarning:!1}))):N(H,{"data-hidden":!0});var t,e,i}static get watchers(){return{meeting:["meetingChanged"]}}};tg([ai()],eg.prototype,"meeting",void 0),tg([ai()],eg.prototype,"size",void 0),tg([ai()],eg.prototype,"iconPack",void 0),tg([ai()],eg.prototype,"states",void 0),tg([ai()],eg.prototype,"t",void 0),eg.style=":host{line-height:initial;font-family:var(--rtk-font-family, sans-serif);font-feature-settings:normal;font-variation-settings:normal}p{margin:var(--rtk-space-0, 0px);padding:var(--rtk-space-0, 0px)}:host{display:block}:host([data-hidden]){display:none}";var ig=Object.freeze({__proto__:null,rtk_stage_toggle:eg});const rg=Pr(oi,"WeakMap");const ag=qr(Object.keys,Object);var sg=Object.prototype.hasOwnProperty;function ng(t){return sa(t)?Sa(t):function(t){if(!Yr(t))return ag(t);var e=[];for(var i in Object(t))sg.call(t,i)&&"constructor"!=i&&e.push(i);return e}(t)}var og=Object.prototype.propertyIsEnumerable,cg=Object.getOwnPropertySymbols,lg=cg?function(t){return null==t?[]:(t=Object(t),function(t,e){for(var i=-1,r=null==t?0:t.length,a=0,s=[];++i<r;){var n=t[i];e(n,i,t)&&(s[a++]=n)}return s}(cg(t),(function(e){return og.call(t,e)})))}:function(){return[]};const dg=lg;function hg(t){return function(t,e,i){var r=e(t);return ra(t)?r:function(t,e){for(var i=-1,r=e.length,a=t.length;++i<r;)t[a+i]=e[i];return t}(r,i(t))}(t,ng,dg)}const pg=Pr(oi,"DataView");const gg=Pr(oi,"Promise");const ug=Pr(oi,"Set");var fg="[object Map]",mg="[object Promise]",vg="[object Set]",bg="[object WeakMap]",kg="[object DataView]",yg=mr(pg),wg=mr(Cr),xg=mr(gg),Sg=mr(ug),Pg=mr(rg),Cg=fi;(pg&&Cg(new pg(new ArrayBuffer(1)))!=kg||Cr&&Cg(new Cr)!=fg||gg&&Cg(gg.resolve())!=mg||ug&&Cg(new ug)!=vg||rg&&Cg(new rg)!=bg)&&(Cg=function(t){var e=fi(t),i="[object Object]"==e?t.constructor:void 0,r=i?mr(i):"";if(r)switch(r){case yg:return kg;case wg:return fg;case xg:return mg;case Sg:return vg;case Pg:return bg}return e});const Eg=Cg;var Tg=Object.prototype.hasOwnProperty;var Lg=/\w*$/;var _g=ci?ci.prototype:void 0,Rg=_g?_g.valueOf:void 0;function Ag(t,e,i){var r,a,s,n,o,c=t.constructor;switch(e){case"[object ArrayBuffer]":return Br(t);case"[object Boolean]":case"[object Date]":return new c(+t);case"[object DataView]":return o=Br((n=t).buffer),new n.constructor(o,n.byteOffset,n.byteLength);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return Hr(t,i);case"[object Map]":case"[object Set]":return new c;case"[object Number]":case"[object String]":return new c(t);case"[object RegExp]":return(s=new(a=t).constructor(a.source,Lg.exec(a))).lastIndex=a.lastIndex,s;case"[object Symbol]":return r=t,Rg?Object(Rg.call(r)):{}}}var Dg=fa&&fa.isMap;const Mg=Dg?ha(Dg):function(t){return vi(t)&&"[object Map]"==Eg(t)};var Ig=fa&&fa.isSet;const Og=Ig?ha(Ig):function(t){return vi(t)&&"[object Set]"==Eg(t)};var Ug="[object Arguments]",$g="[object Function]",Fg="[object Object]",jg={};function zg(t,e,i,r,a,s){var n,o=1&e;if(void 0!==n)return n;if(!mi(t))return t;var c=ra(t);if(c)n=function(t){var e=t.length,i=new t.constructor(e);return e&&"string"==typeof t[0]&&Tg.call(t,"index")&&(i.index=t.index,i.input=t.input),i}(t);else{var l=Eg(t),d=l==$g||"[object GeneratorFunction]"==l;if(la(t))return zr(t,o);if(l==Fg||l==Ug||d&&!a)n=d?{}:Zr(t);else{if(!jg[l])return a?t:{};n=Ag(t,l,o)}}s||(s=new Dr);var h=s.get(t);if(h)return h;s.set(t,n),Og(t)?t.forEach((function(r){n.add(zg(r,e,i,r,t,s))})):Mg(t)&&t.forEach((function(r,a){n.set(a,zg(r,e,i,a,t,s))}));var p=c?void 0:hg(t);return function(t,e){for(var i=-1,r=null==t?0:t.length;++i<r&&!1!==e(t[i],i,t););}(p||t,(function(r,a){p&&(r=t[a=r]),ka(n,a,zg(r,e,i,a,t,s))})),n}jg[Ug]=jg["[object Array]"]=jg["[object ArrayBuffer]"]=jg["[object DataView]"]=jg["[object Boolean]"]=jg["[object Date]"]=jg["[object Float32Array]"]=jg["[object Float64Array]"]=jg["[object Int8Array]"]=jg["[object Int16Array]"]=jg["[object Int32Array]"]=jg["[object Map]"]=jg["[object Number]"]=jg[Fg]=jg["[object RegExp]"]=jg["[object Set]"]=jg["[object String]"]=jg["[object Symbol]"]=jg["[object Uint8Array]"]=jg["[object Uint8ClampedArray]"]=jg["[object Uint16Array]"]=jg["[object Uint32Array]"]=!0,jg["[object Error]"]=jg[$g]=jg["[object WeakMap]"]=!1;function Ng(t){return structuredClone?structuredClone(t):zg(t,5)}var Bg=function(t,e,i,r){var a,s=arguments.length,n=s<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,i,r);else for(var o=t.length-1;o>=0;o--)(a=t[o])&&(n=(s<3?a(n):s>3?a(e,i,n):a(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};const Hg=class{constructor(t){o(this,t),this.config=De,this.t=Fe(),this.transcripts=[],this.listenerAttached=!1,this.onTranscript=t=>{t.transcript&&this.add(t)}}connectedCallback(){this.meetingChanged(this.meeting)}addListener(t){var e;null===(e=null==t?void 0:t.ai)||void 0===e||e.addListener("transcript",this.onTranscript),this.listenerAttached=!0}clearListeners(t){var e;this.onTranscript&&(null===(e=null==t?void 0:t.ai)||void 0===e||e.removeListener("transcript",this.onTranscript)),this.listenerAttached=!1,clearTimeout(this.disconnectTimeout),this.transcripts=[]}disconnectedCallback(){null!=this.meeting&&this.clearListeners(this.meeting)}meetingChanged(t,e){clearTimeout(this.disconnectTimeout),void 0!==e&&this.clearListeners(e),null!=t&&this.states.activeCaptions&&this.addListener(t)}statesChanged(t){t&&(t.activeCaptions&&!this.listenerAttached&&this.addListener(this.meeting),!t.activeCaptions&&this.listenerAttached&&this.clearListeners(this.meeting))}transcriptionsReducer(t,e){if(!t.length)return[e];let i=t[t.length-1];return i.peerId!==e.peerId?t.concat(e):i.id===e.id?(i.transcript=e.transcript,t.pop(),t.concat(Ng(i))):t.concat(e)}add(t){this.transcripts=this.transcriptionsReducer(this.transcripts,t)}remove(t){this.transcripts=this.transcripts.filter((e=>e.renderedId!==t))}handleDismiss(t){t.stopPropagation();const{id:e,renderedId:i}=t.detail,r=this.host.shadowRoot.querySelector(`[data-id="${e}"]`);null==r||r.classList.add("exit"),setTimeout((()=>{C((()=>{this.remove(i)}))}),400)}renderTranscripts(){const t=[];return this.transcripts.forEach((e=>{const i={name:e.name,date:e.date,peerId:e.peerId,transcript:e.transcript,id:e.id,renderedId:e.id};if(!t.length)return e.renderedId=i.renderedId,void t.push(i);const r=t[t.length-1];if(r.transcript.length+i.transcript.length>400||r.peerId!==e.peerId)return e.renderedId=i.renderedId,void t.push(i);r.transcript+=" "+e.transcript,e.renderedId=r.renderedId})),t.splice(0,t.length-2),null==t?void 0:t.map((t=>N("rtk-transcript",{key:t.id,"data-id":t.id,transcript:t,onRtkTranscriptDismiss:t=>this.handleDismiss(t),t:this.t})))}render(){if(this.states.activeCaptions)return N(H,null,this.renderTranscripts())}get host(){return W(this)}static get watchers(){return{meeting:["meetingChanged"],states:["statesChanged"]}}};Bg([ai()],Hg.prototype,"meeting",void 0),Bg([ai()],Hg.prototype,"states",void 0),Bg([ai()],Hg.prototype,"t",void 0),Hg.style=":host{line-height:initial;font-family:var(--rtk-font-family, sans-serif);font-feature-settings:normal;font-variation-settings:normal}p{margin:var(--rtk-space-0, 0px);padding:var(--rtk-space-0, 0px)}:host{position:absolute;top:var(--rtk-space-4, 16px);right:var(--rtk-space-4, 16px);bottom:var(--rtk-space-4, 16px);left:var(--rtk-space-4, 16px);top:auto;display:flex;flex-direction:column;pointer-events:none;justify-content:center;width:100%;z-index:5}rtk-transcript{margin-top:var(--rtk-space-2, 8px)}";var Gg=Object.freeze({__proto__:null,rtk_transcripts:Hg});const Vg=class{constructor(t){o(this,t),this.statesUpdate=Y(this,"rtkStatesUpdate",7),this.config=De,this.showSetupScreen=!1,this.noRenderUntilMeeting=!1,this.handleResize=()=>{this.size=ps(this.host.clientWidth)},this.loadTheme=()=>{var t;if(this.config===De){const{config:t}=ls(this.meeting.self.config,this.meeting);this.config=t}(null===(t=this.config)||void 0===t?void 0:t.designTokens)&&Ua(document.documentElement,this.config.designTokens)},this.roomJoinedListener=()=>{this.updateStates({meeting:"joined"})},this.waitlistedListener=()=>{this.updateStates({meeting:"waiting"})},this.roomLeftListener=({state:t})=>{"disconnected"!==t&&"failed"!==t&&this.updateStates({meeting:"ended",roomLeftState:t})},this.mediaPermissionUpdateListener=({kind:t,message:e})=>{if(["audio","video"].includes(t)&&("DENIED"===e||"SYSTEM_DENIED"===e)&&!0!==Ze.states.activeDebugger){const e={enabled:!0,kind:t};this.updateStates({activePermissionsMessage:e})}},this.socketConnectionUpdateListener=({state:t})=>{"failed"===t&&setTimeout((()=>{this.meeting.leave("disconnected")}),1e4)},this.handleChangingMeeting=t=>{this.updateStates({activeBreakoutRoomsManager:Object.assign(Object.assign({},Ze.states.activeBreakoutRoomsManager),{destinationMeetingId:t})})}}listenState(t){this.updateStates(t.detail)}updateStates(t){const e=Object.assign({},Ze.states);Ze.states=cs(e,t),this.statesUpdate.emit(Ze.states)}connectedCallback(){"undefined"!=typeof window&&(this.authErrorListener=t=>{t.detail.message.includes("401")&&this.updateStates({meeting:"ended",roomLeftState:"unauthorized"})},window.addEventListener("rtkError",this.authErrorListener)),this.onMeetingChange(this.meeting),this.onIconPackChange(this.iconPack),this.onTChange(this.t),this.onConfigChange(this.config),this.onSizeChange(this.size),this.resizeObserver=new ResizeObserver((()=>this.handleResize())),this.resizeObserver.observe(this.host)}disconnectedCallback(){this.resizeObserver.disconnect(),window.removeEventListener("rtkError",this.authErrorListener),this.meeting&&(this.meeting.self.removeListener("roomLeft",this.roomLeftListener),this.meeting.self.removeListener("roomJoined",this.roomJoinedListener),this.meeting.self.removeListener("waitlisted",this.waitlistedListener),this.meeting.self.removeListener("mediaPermissionUpdate",this.mediaPermissionUpdateListener),this.meeting.meta.removeListener("socketConnectionUpdate",this.socketConnectionUpdateListener))}onMeetingChange(t){We.state.meeting=t,t&&(this.updateStates({viewType:t.meta.viewType}),this.loadTheme(),t.self.addListener("roomJoined",this.roomJoinedListener),t.self.addListener("waitlisted",this.waitlistedListener),t.self.addListener("roomLeft",this.roomLeftListener),t.self.addListener("mediaPermissionUpdate",this.mediaPermissionUpdateListener),t.meta.addListener("socketConnectionUpdate",this.socketConnectionUpdateListener),t.connectedMeetings.supportsConnectedMeetings&&t.connectedMeetings.once("changingMeeting",this.handleChangingMeeting),t.self.roomJoined?this.updateStates({meeting:"joined"}):this.showSetupScreen?this.updateStates({meeting:"setup"}):t.joinRoom(),window.removeEventListener("rtkError",this.authErrorListener))}onIconPackChange(t){We.state.iconPack=t}onTChange(t){We.state.t=t}onConfigChange(t){We.state.config=t}onSizeChange(t){We.state.size=t}render(){return N(H,{key:"255d40656744b2906c20a139a1af87c66acc310a"},this.noRenderUntilMeeting&&!this.meeting?null:N("slot",null))}get host(){return W(this)}static get watchers(){return{meeting:["onMeetingChange"],iconPack:["onIconPackChange"],t:["onTChange"],config:["onConfigChange"],size:["onSizeChange"]}}};Vg.style="rtk-ui-provider{display:block;width:100%;height:100%}";var qg=Object.freeze({__proto__:null,rtk_ui_provider:Vg});var Kg=function(t,e,i,r){var a,s=arguments.length,n=s<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,i,r);else for(var o=t.length-1;o>=0;o--)(a=t[o])&&(n=(s<3?a(n):s>3?a(e,i,n):a(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};const Wg=class{constructor(t){o(this,t),this.config=De,this.iconPack=je,this.t=Fe()}render(){return N(H,{key:"06c3f95f6b37b0b6dac40c39f0006dfd8e2f1527"},N("slot",{key:"76e9f7369a1aa9c2b5a6bbb602ff1f26289c5d80"},N("div",{key:"8214ae3640c401b4d1ba1333aaa996ef49b7ec1c",class:"centered",part:"content"},N("rtk-logo",{key:"ec1f1f220f39f674510e1c95699f92d53a9fbf00",meeting:this.meeting,config:this.config,part:"logo",t:this.t}),N("p",{key:"9123734c61b424b323701f99ac8da6ee0b2885e4"},this.t("waitlist.body_text")))))}};Kg([ai()],Wg.prototype,"meeting",void 0),Kg([ai()],Wg.prototype,"iconPack",void 0),Kg([ai()],Wg.prototype,"t",void 0),Wg.style=":host{line-height:initial;font-family:var(--rtk-font-family, sans-serif);font-feature-settings:normal;font-variation-settings:normal}p{margin:var(--rtk-space-0, 0px);padding:var(--rtk-space-0, 0px)}:host{height:100%;width:100%;display:flex;flex-direction:column;align-items:center;justify-content:center}.centered{display:flex;flex-direction:column;align-items:center}rtk-logo{margin-bottom:var(--rtk-space-8, 32px);height:var(--rtk-space-12, 48px)}p{font-size:16px;border-radius:var(--rtk-border-radius-lg, 12px);--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-background-800, 30 30 30) / var(--tw-bg-opacity));padding-left:var(--rtk-space-8, 32px);padding-right:var(--rtk-space-8, 32px);padding-top:var(--rtk-space-4, 16px);padding-bottom:var(--rtk-space-4, 16px);color:rgb(var(--rtk-colors-text-1000, 255 255 255))}";var Yg=Object.freeze({__proto__:null,rtk_waiting_screen:Wg});var Zg=function(t,e,i,r){var a,s=arguments.length,n=s<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,i,r);else for(var o=t.length-1;o>=0;o--)(a=t[o])&&(n=(s<3?a(n):s>3?a(e,i,n):a(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};const Qg=class{constructor(t){o(this,t),this.participantQuery="",this.isProcessing=!1,this.t=Fe(),this.transcriptions=[],this.autoScrollEnabled=!0,this.onScroll=t=>{const{scrollTop:e,clientHeight:i,scrollHeight:r}=t.target,a=e+i;this.autoScrollEnabled=a+10>=r},this.onTranscriptHandler=t=>{this.transcriptions=this.transcriptionsReducer(this.transcriptions,t)}}transcriptionsReducer(t,e){if(!t.length||t[t.length-1].peerId!==e.peerId)return t.concat(e);const i=t[t.length-1];return i.id===e.id?(i.transcript=e.transcript,t.pop(),t.concat(i)):t.concat(e)}connectedCallback(){this.meeting&&this.meetingChanged(this.meeting)}componentDidLoad(){var t;null===(t=this.contentContainer)||void 0===t||t.addEventListener("scroll",this.onScroll)}disconnectedCallback(){var t,e,i;null===(e=null===(t=this.meeting)||void 0===t?void 0:t.ai)||void 0===e||e.off("transcript",this.onTranscriptHandler),null===(i=this.contentContainer)||void 0===i||i.removeEventListener("scroll",this.onScroll)}meetingChanged(t){var e,i;this.transcriptions=Ng(null===(e=null==t?void 0:t.ai)||void 0===e?void 0:e.transcripts),this.transcriptions=this.transcriptions.reduce(this.transcriptionsReducer,[]),null===(i=null==t?void 0:t.ai)||void 0===i||i.on("transcript",this.onTranscriptHandler)}transcriptionsChanged(){this.autoScrollEnabled&&setTimeout((()=>{Xi(this.contentContainer,!1)}),100)}renderTranscripts(){const t=this.transcriptions.filter((t=>!this.participantQuery||t.name.toLowerCase().includes(this.participantQuery.toLowerCase()))),e=[];return t.forEach((t=>{const i={name:t.name,date:t.date,peerId:t.peerId,transcript:t.transcript};if(!e.length)return void e.push(i);const r=e[e.length-1];t.peerId===r.peerId?r.transcript+=" "+t.transcript:e.push(i)})),e.map((t=>N("div",{class:"message"},N(Ji,{name:t.name,time:new Date(t.date),now:new Date}),N("div",{class:"body"},t.transcript))))}render(){return N(H,{key:"12573001a05a586495a63ecd420f99ad04ce780f"},N("div",{key:"2a51f65ba7cd339aee33291c77cdf9f5d69b8f07",class:"search-bar"},N("input",{key:"6cb5505e84ddff6e39c29012752a7309f715505c",type:"text",placeholder:"Search Participant",value:this.participantQuery,onInput:t=>this.participantQuery=t.target.value})),this.isProcessing&&N("div",{key:"b7f1c33aae0d2613e28dc328e5ccfd92ad067576",class:"processing"},N("p",{key:"ae8dc349ff7017a92b9c15e8c8ab051313c07e67"},"Processing audio....")),!this.isProcessing&&N("div",{key:"f5d9e637661b2b10dd323c6b9d6fa7381fd7768c",class:"content scrollbar",ref:t=>this.contentContainer=t},N("div",{key:"a029f8903f82deab573e2372f1c645de98fbc417",class:"started-message"},"Transcription started"),this.renderTranscripts()))}static get watchers(){return{meeting:["meetingChanged"],transcriptions:["transcriptionsChanged"]}}};Zg([ai()],Qg.prototype,"t",void 0),Zg([ai()],Qg.prototype,"meeting",void 0),Qg.style=":host{line-height:initial;font-family:var(--rtk-font-family, sans-serif);font-feature-settings:normal;font-variation-settings:normal}p{margin:var(--rtk-space-0, 0px);padding:var(--rtk-space-0, 0px)}.head{display:flex;align-items:center}.head .name{margin-right:var(--rtk-space-4, 16px);font-size:12px;font-weight:700}.head .time{font-size:12px;color:rgb(var(--rtk-colors-text-800, 255 255 255 / 0.76))}.scrollbar{scrollbar-width:thin;scrollbar-color:var(--rtk-scrollbar-color, rgb(var(--rtk-colors-background-600, 60 60 60)))\n var(--rtk-scrollbar-background, transparent)}.scrollbar::-webkit-scrollbar{height:var(--rtk-space-1\\.5, 6px);width:var(--rtk-space-1\\.5, 6px);border-radius:9999px;background-color:var(--rtk-scrollbar-background, transparent)}.scrollbar::-webkit-scrollbar-thumb{border-radius:9999px;background-color:var(--rtk-scrollbar-color, rgb(var(--rtk-colors-background-600, 60 60 60)))}*{box-sizing:border-box;border-width:0;border-style:solid}:host{width:100%;display:flex;flex-direction:column}.processing{display:flex;flex:1 1 0%;flex-direction:column;align-items:center;justify-content:center}.content{box-sizing:border-box;display:flex;flex-direction:column;padding:var(--rtk-space-3, 12px);flex:1 0 0px;overflow-y:scroll}.started-message{margin-top:var(--rtk-space-5, 20px);margin-bottom:var(--rtk-space-5, 20px);text-align:center;font-size:12px;color:rgb(var(--rtk-colors-text-700, 255 255 255 / 0.64))}.search-bar{height:var(--rtk-space-14, 56px);width:100%;border-bottom-width:var(--rtk-border-width-sm, 1px);--tw-border-opacity:1;border-color:rgba(var(--rtk-colors-background-600, 60 60 60) / var(--tw-border-opacity));padding:var(--rtk-space-3, 12px)}input{height:100%;width:100%;--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-background-600, 60 60 60) / var(--tw-bg-opacity));padding-left:var(--rtk-space-3, 12px);padding-right:var(--rtk-space-3, 12px);font-size:14px;border-radius:var(--rtk-border-radius-sm, 4px);color:rgb(var(--rtk-colors-text-1000, 255 255 255))}.caption-view{height:var(--rtk-space-12, 48px);width:100%;padding-left:var(--rtk-space-3, 12px);padding-right:var(--rtk-space-3, 12px);padding-top:var(--rtk-space-3, 12px);padding-bottom:var(--rtk-space-3, 12px);border-bottom-width:var(--rtk-border-width-sm, 1px);border-style:solid;--tw-border-opacity:1;border-color:rgba(var(--rtk-colors-background-600, 60 60 60) / var(--tw-border-opacity));display:flex;align-items:center;justify-content:space-between;font-size:14px}.message .body{margin-top:var(--rtk-space-2, 8px);margin-bottom:var(--rtk-space-2, 8px);font-size:14px;word-break:break-word}.message{margin-bottom:var(--rtk-space-3, 12px)}.message:last-child{margin-bottom:var(--rtk-space-0, 0px)}";var Jg=Object.freeze({__proto__:null,rtk_ai_transcriptions:Qg});var Xg=function(t,e,i,r){var a,s=arguments.length,n=s<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,i,r);else for(var o=t.length-1;o>=0;o--)(a=t[o])&&(n=(s<3?a(n):s>3?a(e,i,n):a(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};const tu=class{constructor(t){o(this,t),this.t=Fe(),this.iconPack=je,this.setIsLivestreaming=t=>{this.isLivestreaming="LIVESTREAMING"===t}}connectedCallback(){this.meetingChanged(this.meeting)}disconnectedCallback(){var t,e;null===(e=null===(t=this.meeting)||void 0===t?void 0:t.livestream)||void 0===e||e.removeListener("livestreamUpdate",this.setIsLivestreaming)}meetingChanged(t){var e,i;null!=t&&(this.setIsLivestreaming(null===(e=this.meeting.livestream)||void 0===e?void 0:e.state),null===(i=this.meeting.livestream)||void 0===i||i.on("livestreamUpdate",this.setIsLivestreaming))}render(){return Qt(this.meeting)&&this.isLivestreaming?N(H,null,N("div",{class:"indicator","aria-label":this.t("livestream.indicator"),part:"indicator"},N("rtk-icon",{icon:this.iconPack.start_livestream,size:this.size}),N("span",null,this.t("LIVE")))):N(H,{"data-hidden":!0})}static get watchers(){return{meeting:["meetingChanged"]}}};function eu(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}Xg([ai()],tu.prototype,"meeting",void 0),Xg([ai()],tu.prototype,"size",void 0),Xg([ai()],tu.prototype,"t",void 0),Xg([ai()],tu.prototype,"iconPack",void 0),tu.style=":host{line-height:initial;font-family:var(--rtk-font-family, sans-serif);font-feature-settings:normal;font-variation-settings:normal}p{margin:var(--rtk-space-0, 0px);padding:var(--rtk-space-0, 0px)}:host{margin-left:var(--rtk-space-2, 8px);margin-right:var(--rtk-space-2, 8px);display:flex}:host([data-hidden]){display:none}:host[size='sm']{margin-left:var(--rtk-space-1, 4px);margin-right:var(--rtk-space-1, 4px)}.indicator{display:flex;flex-direction:row;align-items:center;font-size:14px;--tw-text-opacity:1;color:rgba(var(--rtk-colors-danger, 255 45 45) / var(--tw-text-opacity))}rtk-icon{margin-right:var(--rtk-space-1, 4px);height:var(--rtk-space-5, 20px);width:var(--rtk-space-5, 20px);animation:blink 4s linear infinite}:host([size='sm']) rtk-icon{height:var(--rtk-space-4, 16px);width:var(--rtk-space-4, 16px)}:host([size='sm']) .indicator span{display:none}@keyframes blink{0%,10%{opacity:0}11%,100%{opacity:1}}";var iu={exports:{}};!function(t){var e,i,r,a,s;e=/^(?=((?:[a-zA-Z0-9+\-.]+:)?))\1(?=((?:\/\/[^\/?#]*)?))\2(?=((?:(?:[^?#\/]*\/)*[^;?#\/]*)?))\3((?:;[^?#]*)?)(\?[^#]*)?(#[^]*)?$/,i=/^(?=([^\/?#]*))\1([^]*)$/,r=/(?:\/|^)\.(?=\/)/g,a=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g,s={buildAbsoluteURL:function(t,e,r){if(r=r||{},t=t.trim(),!(e=e.trim())){if(!r.alwaysNormalize)return t;var a=s.parseURL(t);if(!a)throw new Error("Error trying to parse base URL.");return a.path=s.normalizePath(a.path),s.buildURLFromParts(a)}var n=s.parseURL(e);if(!n)throw new Error("Error trying to parse relative URL.");if(n.scheme)return r.alwaysNormalize?(n.path=s.normalizePath(n.path),s.buildURLFromParts(n)):e;var o=s.parseURL(t);if(!o)throw new Error("Error trying to parse base URL.");if(!o.netLoc&&o.path&&"/"!==o.path[0]){var c=i.exec(o.path);o.netLoc=c[1],o.path=c[2]}o.netLoc&&!o.path&&(o.path="/");var l={scheme:o.scheme,netLoc:n.netLoc,path:null,params:n.params,query:n.query,fragment:n.fragment};if(!n.netLoc&&(l.netLoc=o.netLoc,"/"!==n.path[0]))if(n.path){var d=o.path,h=d.substring(0,d.lastIndexOf("/")+1)+n.path;l.path=s.normalizePath(h)}else l.path=o.path,n.params||(l.params=o.params,n.query||(l.query=o.query));return null===l.path&&(l.path=r.alwaysNormalize?s.normalizePath(n.path):n.path),s.buildURLFromParts(l)},parseURL:function(t){var i=e.exec(t);return i?{scheme:i[1]||"",netLoc:i[2]||"",path:i[3]||"",params:i[4]||"",query:i[5]||"",fragment:i[6]||""}:null},normalizePath:function(t){for(t=t.split("").reverse().join("").replace(r,"");t.length!==(t=t.replace(a,"")).length;);return t.split("").reverse().join("")},buildURLFromParts:function(t){return t.scheme+t.netLoc+t.path+t.params+t.query+t.fragment}},t.exports=s}(iu);var ru=iu.exports;function au(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,r)}return i}function su(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?au(Object(i),!0).forEach((function(e){ou(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):au(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}function nu(t){var e=function(t,e){if("object"!=typeof t||!t)return t;var i=t[Symbol.toPrimitive];if(void 0!==i){var r=i.call(t,e);if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==typeof e?e:String(e)}function ou(t,e,i){return(e=nu(e))in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}function cu(){return cu=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var r in i)Object.prototype.hasOwnProperty.call(i,r)&&(t[r]=i[r])}return t},cu.apply(this,arguments)}const lu=Number.isFinite||function(t){return"number"==typeof t&&isFinite(t)},du=Number.isSafeInteger||function(t){return"number"==typeof t&&Math.abs(t)<=hu},hu=Number.MAX_SAFE_INTEGER||9007199254740991;let pu=function(t){return t.MEDIA_ATTACHING="hlsMediaAttaching",t.MEDIA_ATTACHED="hlsMediaAttached",t.MEDIA_DETACHING="hlsMediaDetaching",t.MEDIA_DETACHED="hlsMediaDetached",t.BUFFER_RESET="hlsBufferReset",t.BUFFER_CODECS="hlsBufferCodecs",t.BUFFER_CREATED="hlsBufferCreated",t.BUFFER_APPENDING="hlsBufferAppending",t.BUFFER_APPENDED="hlsBufferAppended",t.BUFFER_EOS="hlsBufferEos",t.BUFFER_FLUSHING="hlsBufferFlushing",t.BUFFER_FLUSHED="hlsBufferFlushed",t.MANIFEST_LOADING="hlsManifestLoading",t.MANIFEST_LOADED="hlsManifestLoaded",t.MANIFEST_PARSED="hlsManifestParsed",t.LEVEL_SWITCHING="hlsLevelSwitching",t.LEVEL_SWITCHED="hlsLevelSwitched",t.LEVEL_LOADING="hlsLevelLoading",t.LEVEL_LOADED="hlsLevelLoaded",t.LEVEL_UPDATED="hlsLevelUpdated",t.LEVEL_PTS_UPDATED="hlsLevelPtsUpdated",t.LEVELS_UPDATED="hlsLevelsUpdated",t.AUDIO_TRACKS_UPDATED="hlsAudioTracksUpdated",t.AUDIO_TRACK_SWITCHING="hlsAudioTrackSwitching",t.AUDIO_TRACK_SWITCHED="hlsAudioTrackSwitched",t.AUDIO_TRACK_LOADING="hlsAudioTrackLoading",t.AUDIO_TRACK_LOADED="hlsAudioTrackLoaded",t.SUBTITLE_TRACKS_UPDATED="hlsSubtitleTracksUpdated",t.SUBTITLE_TRACKS_CLEARED="hlsSubtitleTracksCleared",t.SUBTITLE_TRACK_SWITCH="hlsSubtitleTrackSwitch",t.SUBTITLE_TRACK_LOADING="hlsSubtitleTrackLoading",t.SUBTITLE_TRACK_LOADED="hlsSubtitleTrackLoaded",t.SUBTITLE_FRAG_PROCESSED="hlsSubtitleFragProcessed",t.CUES_PARSED="hlsCuesParsed",t.NON_NATIVE_TEXT_TRACKS_FOUND="hlsNonNativeTextTracksFound",t.INIT_PTS_FOUND="hlsInitPtsFound",t.FRAG_LOADING="hlsFragLoading",t.FRAG_LOAD_EMERGENCY_ABORTED="hlsFragLoadEmergencyAborted",t.FRAG_LOADED="hlsFragLoaded",t.FRAG_DECRYPTED="hlsFragDecrypted",t.FRAG_PARSING_INIT_SEGMENT="hlsFragParsingInitSegment",t.FRAG_PARSING_USERDATA="hlsFragParsingUserdata",t.FRAG_PARSING_METADATA="hlsFragParsingMetadata",t.FRAG_PARSED="hlsFragParsed",t.FRAG_BUFFERED="hlsFragBuffered",t.FRAG_CHANGED="hlsFragChanged",t.FPS_DROP="hlsFpsDrop",t.FPS_DROP_LEVEL_CAPPING="hlsFpsDropLevelCapping",t.MAX_AUTO_LEVEL_UPDATED="hlsMaxAutoLevelUpdated",t.ERROR="hlsError",t.DESTROYING="hlsDestroying",t.KEY_LOADING="hlsKeyLoading",t.KEY_LOADED="hlsKeyLoaded",t.LIVE_BACK_BUFFER_REACHED="hlsLiveBackBufferReached",t.BACK_BUFFER_REACHED="hlsBackBufferReached",t.STEERING_MANIFEST_LOADED="hlsSteeringManifestLoaded",t}({}),gu=function(t){return t.NETWORK_ERROR="networkError",t.MEDIA_ERROR="mediaError",t.KEY_SYSTEM_ERROR="keySystemError",t.MUX_ERROR="muxError",t.OTHER_ERROR="otherError",t}({}),uu=function(t){return t.KEY_SYSTEM_NO_KEYS="keySystemNoKeys",t.KEY_SYSTEM_NO_ACCESS="keySystemNoAccess",t.KEY_SYSTEM_NO_SESSION="keySystemNoSession",t.KEY_SYSTEM_NO_CONFIGURED_LICENSE="keySystemNoConfiguredLicense",t.KEY_SYSTEM_LICENSE_REQUEST_FAILED="keySystemLicenseRequestFailed",t.KEY_SYSTEM_SERVER_CERTIFICATE_REQUEST_FAILED="keySystemServerCertificateRequestFailed",t.KEY_SYSTEM_SERVER_CERTIFICATE_UPDATE_FAILED="keySystemServerCertificateUpdateFailed",t.KEY_SYSTEM_SESSION_UPDATE_FAILED="keySystemSessionUpdateFailed",t.KEY_SYSTEM_STATUS_OUTPUT_RESTRICTED="keySystemStatusOutputRestricted",t.KEY_SYSTEM_STATUS_INTERNAL_ERROR="keySystemStatusInternalError",t.MANIFEST_LOAD_ERROR="manifestLoadError",t.MANIFEST_LOAD_TIMEOUT="manifestLoadTimeOut",t.MANIFEST_PARSING_ERROR="manifestParsingError",t.MANIFEST_INCOMPATIBLE_CODECS_ERROR="manifestIncompatibleCodecsError",t.LEVEL_EMPTY_ERROR="levelEmptyError",t.LEVEL_LOAD_ERROR="levelLoadError",t.LEVEL_LOAD_TIMEOUT="levelLoadTimeOut",t.LEVEL_PARSING_ERROR="levelParsingError",t.LEVEL_SWITCH_ERROR="levelSwitchError",t.AUDIO_TRACK_LOAD_ERROR="audioTrackLoadError",t.AUDIO_TRACK_LOAD_TIMEOUT="audioTrackLoadTimeOut",t.SUBTITLE_LOAD_ERROR="subtitleTrackLoadError",t.SUBTITLE_TRACK_LOAD_TIMEOUT="subtitleTrackLoadTimeOut",t.FRAG_LOAD_ERROR="fragLoadError",t.FRAG_LOAD_TIMEOUT="fragLoadTimeOut",t.FRAG_DECRYPT_ERROR="fragDecryptError",t.FRAG_PARSING_ERROR="fragParsingError",t.FRAG_GAP="fragGap",t.REMUX_ALLOC_ERROR="remuxAllocError",t.KEY_LOAD_ERROR="keyLoadError",t.KEY_LOAD_TIMEOUT="keyLoadTimeOut",t.BUFFER_ADD_CODEC_ERROR="bufferAddCodecError",t.BUFFER_INCOMPATIBLE_CODECS_ERROR="bufferIncompatibleCodecsError",t.BUFFER_APPEND_ERROR="bufferAppendError",t.BUFFER_APPENDING_ERROR="bufferAppendingError",t.BUFFER_STALLED_ERROR="bufferStalledError",t.BUFFER_FULL_ERROR="bufferFullError",t.BUFFER_SEEK_OVER_HOLE="bufferSeekOverHole",t.BUFFER_NUDGE_ON_STALL="bufferNudgeOnStall",t.INTERNAL_EXCEPTION="internalException",t.INTERNAL_ABORTED="aborted",t.UNKNOWN="unknown",t}({});const fu=function(){},mu={trace:fu,debug:fu,log:fu,warn:fu,info:fu,error:fu};let vu=mu;function bu(t,...e){e.forEach((function(e){vu[e]=t[e]?t[e].bind(t):function(t){const e=self.console[t];return e?e.bind(self.console,`[${t}] >`):fu}(e)}))}const ku=vu,yu=/^(\d+)x(\d+)$/,wu=/(.+?)=(".*?"|.*?)(?:,|$)/g;class xu{constructor(t){"string"==typeof t&&(t=xu.parseAttrList(t)),cu(this,t)}get clientAttrs(){return Object.keys(this).filter((t=>"X-"===t.substring(0,2)))}decimalInteger(t){const e=parseInt(this[t],10);return e>Number.MAX_SAFE_INTEGER?1/0:e}hexadecimalInteger(t){if(this[t]){let e=(this[t]||"0x").slice(2);e=(1&e.length?"0":"")+e;const i=new Uint8Array(e.length/2);for(let t=0;t<e.length/2;t++)i[t]=parseInt(e.slice(2*t,2*t+2),16);return i}return null}hexadecimalIntegerAsNumber(t){const e=parseInt(this[t],16);return e>Number.MAX_SAFE_INTEGER?1/0:e}decimalFloatingPoint(t){return parseFloat(this[t])}optionalFloat(t,e){const i=this[t];return i?parseFloat(i):e}enumeratedString(t){return this[t]}bool(t){return"YES"===this[t]}decimalResolution(t){const e=yu.exec(this[t]);if(null!==e)return{width:parseInt(e[1],10),height:parseInt(e[2],10)}}static parseAttrList(t){let e;const i={};for(wu.lastIndex=0;null!==(e=wu.exec(t));){let t=e[2];0===t.indexOf('"')&&t.lastIndexOf('"')===t.length-1&&(t=t.slice(1,-1));i[e[1].trim()]=t}return i}}function Su(t){return"SCTE35-OUT"===t||"SCTE35-IN"===t}class Pu{constructor(t,e){if(this.attr=void 0,this._startDate=void 0,this._endDate=void 0,this._badValueForSameId=void 0,e){const i=e.attr;for(const e in i)if(Object.prototype.hasOwnProperty.call(t,e)&&t[e]!==i[e]){ku.warn(`DATERANGE tag attribute: "${e}" does not match for tags with ID: "${t.ID}"`),this._badValueForSameId=e;break}t=cu(new xu({}),i,t)}if(this.attr=t,this._startDate=new Date(t["START-DATE"]),"END-DATE"in this.attr){const t=new Date(this.attr["END-DATE"]);lu(t.getTime())&&(this._endDate=t)}}get id(){return this.attr.ID}get class(){return this.attr.CLASS}get startDate(){return this._startDate}get endDate(){if(this._endDate)return this._endDate;const t=this.duration;return null!==t?new Date(this._startDate.getTime()+1e3*t):null}get duration(){if("DURATION"in this.attr){const t=this.attr.decimalFloatingPoint("DURATION");if(lu(t))return t}else if(this._endDate)return(this._endDate.getTime()-this._startDate.getTime())/1e3;return null}get plannedDuration(){return"PLANNED-DURATION"in this.attr?this.attr.decimalFloatingPoint("PLANNED-DURATION"):null}get endOnNext(){return this.attr.bool("END-ON-NEXT")}get isValid(){return!!this.id&&!this._badValueForSameId&&lu(this.startDate.getTime())&&(null===this.duration||this.duration>=0)&&(!this.endOnNext||!!this.class)}}class Cu{constructor(){this.aborted=!1,this.loaded=0,this.retry=0,this.total=0,this.chunkCount=0,this.bwEstimate=0,this.loading={start:0,first:0,end:0},this.parsing={start:0,end:0},this.buffering={start:0,first:0,end:0}}}var Eu="audio",Tu="video",Lu="audiovideo";class _u{constructor(t){this._byteRange=null,this._url=null,this.baseurl=void 0,this.relurl=void 0,this.elementaryStreams={[Eu]:null,[Tu]:null,[Lu]:null},this.baseurl=t}setByteRange(t,e){const i=t.split("@",2);let r;r=1===i.length?(null==e?void 0:e.byteRangeEndOffset)||0:parseInt(i[1]),this._byteRange=[r,parseInt(i[0])+r]}get byteRange(){return this._byteRange?this._byteRange:[]}get byteRangeStartOffset(){return this.byteRange[0]}get byteRangeEndOffset(){return this.byteRange[1]}get url(){return!this._url&&this.baseurl&&this.relurl&&(this._url=ru.buildAbsoluteURL(this.baseurl,this.relurl,{alwaysNormalize:!0})),this._url||""}set url(t){this._url=t}}class Ru extends _u{constructor(t,e){super(e),this._decryptdata=null,this.rawProgramDateTime=null,this.programDateTime=null,this.tagList=[],this.duration=0,this.sn=0,this.levelkeys=void 0,this.type=void 0,this.loader=null,this.keyLoader=null,this.level=-1,this.cc=0,this.startPTS=void 0,this.endPTS=void 0,this.startDTS=void 0,this.endDTS=void 0,this.start=0,this.deltaPTS=void 0,this.maxStartPTS=void 0,this.minEndPTS=void 0,this.stats=new Cu,this.data=void 0,this.bitrateTest=!1,this.title=null,this.initSegment=null,this.endList=void 0,this.gap=void 0,this.urlId=0,this.type=t}get decryptdata(){const{levelkeys:t}=this;if(!t&&!this._decryptdata)return null;if(!this._decryptdata&&this.levelkeys&&!this.levelkeys.NONE){const t=this.levelkeys.identity;if(t)this._decryptdata=t.getDecryptData(this.sn);else{const t=Object.keys(this.levelkeys);if(1===t.length)return this._decryptdata=this.levelkeys[t[0]].getDecryptData(this.sn)}}return this._decryptdata}get end(){return this.start+this.duration}get endProgramDateTime(){if(null===this.programDateTime)return null;if(!lu(this.programDateTime))return null;const t=lu(this.duration)?this.duration:0;return this.programDateTime+1e3*t}get encrypted(){var t;if(null!=(t=this._decryptdata)&&t.encrypted)return!0;if(this.levelkeys){const t=Object.keys(this.levelkeys),e=t.length;if(e>1||1===e&&this.levelkeys[t[0]].encrypted)return!0}return!1}setKeyFormat(t){if(this.levelkeys){const e=this.levelkeys[t];e&&!this._decryptdata&&(this._decryptdata=e.getDecryptData(this.sn))}}abortRequests(){var t,e;null==(t=this.loader)||t.abort(),null==(e=this.keyLoader)||e.abort()}setElementaryStreamInfo(t,e,i,r,a,s=!1){const{elementaryStreams:n}=this,o=n[t];o?(o.startPTS=Math.min(o.startPTS,e),o.endPTS=Math.max(o.endPTS,i),o.startDTS=Math.min(o.startDTS,r),o.endDTS=Math.max(o.endDTS,a)):n[t]={startPTS:e,endPTS:i,startDTS:r,endDTS:a,partial:s}}clearElementaryStreamInfo(){const{elementaryStreams:t}=this;t[Eu]=null,t[Tu]=null,t[Lu]=null}}class Au extends _u{constructor(t,e,i,r,a){super(i),this.fragOffset=0,this.duration=0,this.gap=!1,this.independent=!1,this.relurl=void 0,this.fragment=void 0,this.index=void 0,this.stats=new Cu,this.duration=t.decimalFloatingPoint("DURATION"),this.gap=t.bool("GAP"),this.independent=t.bool("INDEPENDENT"),this.relurl=t.enumeratedString("URI"),this.fragment=e,this.index=r;const s=t.enumeratedString("BYTERANGE");s&&this.setByteRange(s,a),a&&(this.fragOffset=a.fragOffset+a.duration)}get start(){return this.fragment.start+this.fragOffset}get end(){return this.start+this.duration}get loaded(){const{elementaryStreams:t}=this;return!!(t.audio||t.video||t.audiovideo)}}class Du{constructor(t){this.PTSKnown=!1,this.alignedSliding=!1,this.averagetargetduration=void 0,this.endCC=0,this.endSN=0,this.fragments=void 0,this.fragmentHint=void 0,this.partList=null,this.dateRanges=void 0,this.live=!0,this.ageHeader=0,this.advancedDateTime=void 0,this.updated=!0,this.advanced=!0,this.availabilityDelay=void 0,this.misses=0,this.startCC=0,this.startSN=0,this.startTimeOffset=null,this.targetduration=0,this.totalduration=0,this.type=null,this.url=void 0,this.m3u8="",this.version=null,this.canBlockReload=!1,this.canSkipUntil=0,this.canSkipDateRanges=!1,this.skippedSegments=0,this.recentlyRemovedDateranges=void 0,this.partHoldBack=0,this.holdBack=0,this.partTarget=0,this.preloadHint=void 0,this.renditionReports=void 0,this.tuneInGoal=0,this.deltaUpdateFailed=void 0,this.driftStartTime=0,this.driftEndTime=0,this.driftStart=0,this.driftEnd=0,this.encryptedFragments=void 0,this.playlistParsingError=null,this.variableList=null,this.hasVariableRefs=!1,this.fragments=[],this.encryptedFragments=[],this.dateRanges={},this.url=t}reloaded(t){if(!t)return this.advanced=!0,void(this.updated=!0);const e=this.lastPartSn-t.lastPartSn,i=this.lastPartIndex-t.lastPartIndex;this.updated=this.endSN!==t.endSN||!!i||!!e||!this.live,this.advanced=this.endSN>t.endSN||e>0||0===e&&i>0,this.updated||this.advanced?this.misses=Math.floor(.6*t.misses):this.misses=t.misses+1,this.availabilityDelay=t.availabilityDelay}get hasProgramDateTime(){return!!this.fragments.length&&lu(this.fragments[this.fragments.length-1].programDateTime)}get levelTargetDuration(){return this.averagetargetduration||this.targetduration||10}get drift(){const t=this.driftEndTime-this.driftStartTime;if(t>0){return 1e3*(this.driftEnd-this.driftStart)/t}return 1}get edge(){return this.partEnd||this.fragmentEnd}get partEnd(){var t;return null!=(t=this.partList)&&t.length?this.partList[this.partList.length-1].end:this.fragmentEnd}get fragmentEnd(){var t;return null!=(t=this.fragments)&&t.length?this.fragments[this.fragments.length-1].end:0}get age(){return this.advancedDateTime?Math.max(Date.now()-this.advancedDateTime,0)/1e3:0}get lastPartIndex(){var t;return null!=(t=this.partList)&&t.length?this.partList[this.partList.length-1].index:-1}get lastPartSn(){var t;return null!=(t=this.partList)&&t.length?this.partList[this.partList.length-1].fragment.sn:this.endSN}}function Mu(t){return Uint8Array.from(atob(t),(t=>t.charCodeAt(0)))}function Iu(t){const e=t.split(":");let i=null;if("data"===e[0]&&2===e.length){const t=e[1].split(";"),r=t[t.length-1].split(",");if(2===r.length){const e="base64"===r[0],a=r[1];e?(t.splice(-1,1),i=Mu(a)):i=function(t){const e=Ou(t).subarray(0,16),i=new Uint8Array(16);return i.set(e,16-e.length),i}(a)}}return i}function Ou(t){return Uint8Array.from(unescape(encodeURIComponent(t)),(t=>t.charCodeAt(0)))}const Uu="undefined"!=typeof self?self:void 0;var $u={CLEARKEY:"org.w3.clearkey",FAIRPLAY:"com.apple.fps",PLAYREADY:"com.microsoft.playready",WIDEVINE:"com.widevine.alpha"},Fu="org.w3.clearkey",ju="com.apple.streamingkeydelivery",zu="com.microsoft.playready",Nu="urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed";function Bu(t){switch(t){case ju:return $u.FAIRPLAY;case zu:return $u.PLAYREADY;case Nu:return $u.WIDEVINE;case Fu:return $u.CLEARKEY}}var Hu="1077efecc0b24d02ace33c1e52e2fb4b",Gu="e2719d58a985b3c9781ab030af78d30e",Vu="9a04f07998404286ab92e65be0885f95",qu="edef8ba979d64acea3c827dcd51d21ed";function Ku(t){return t===qu?$u.WIDEVINE:t===Vu?$u.PLAYREADY:t===Hu||t===Gu?$u.CLEARKEY:void 0}function Wu(t){switch(t){case $u.FAIRPLAY:return ju;case $u.PLAYREADY:return zu;case $u.WIDEVINE:return Nu;case $u.CLEARKEY:return Fu}}function Yu(t){const{drmSystems:e,widevineLicenseUrl:i}=t,r=e?[$u.FAIRPLAY,$u.WIDEVINE,$u.PLAYREADY,$u.CLEARKEY].filter((t=>!!e[t])):[];return!r[$u.WIDEVINE]&&i&&r.push($u.WIDEVINE),r}const Zu=null!=Uu&&null!=(Qu=Uu.navigator)&&Qu.requestMediaKeySystemAccess?self.navigator.requestMediaKeySystemAccess.bind(self.navigator):null;var Qu;function Ju(t){const e=new Uint16Array(t.buffer,t.byteOffset,t.byteLength/2),i=String.fromCharCode.apply(null,Array.from(e)),r=i.substring(i.indexOf("<"),i.length),a=(new DOMParser).parseFromString(r,"text/xml").getElementsByTagName("KID")[0];if(a){const t=a.childNodes[0]?a.childNodes[0].nodeValue:a.getAttribute("VALUE");if(t){const e=Mu(t).subarray(0,16);return function(t){const e=function(t,e,i){const r=t[e];t[e]=t[i],t[i]=r};e(t,0,3),e(t,1,2),e(t,4,5),e(t,6,7)}(e),e}}return null}function Xu(t,e,i){return Uint8Array.prototype.slice?t.slice(e,i):new Uint8Array(Array.prototype.slice.call(t,e,i))}const tf=(t,e)=>e+10<=t.length&&73===t[e]&&68===t[e+1]&&51===t[e+2]&&t[e+3]<255&&t[e+4]<255&&t[e+6]<128&&t[e+7]<128&&t[e+8]<128&&t[e+9]<128,ef=(t,e)=>e+10<=t.length&&51===t[e]&&68===t[e+1]&&73===t[e+2]&&t[e+3]<255&&t[e+4]<255&&t[e+6]<128&&t[e+7]<128&&t[e+8]<128&&t[e+9]<128,rf=(t,e)=>{const i=e;let r=0;for(;tf(t,e);){r+=10;r+=af(t,e+6),ef(t,e+10)&&(r+=10),e+=r}if(r>0)return t.subarray(i,i+r)},af=(t,e)=>{let i=0;return i=(127&t[e])<<21,i|=(127&t[e+1])<<14,i|=(127&t[e+2])<<7,i|=127&t[e+3],i},sf=(t,e)=>tf(t,e)&&af(t,e+6)+10<=t.length-e,nf=t=>{const e=lf(t);for(let t=0;t<e.length;t++){const i=e[t];if(of(i))return uf(i)}},of=t=>t&&"PRIV"===t.key&&"com.apple.streaming.transportStreamTimestamp"===t.info,cf=t=>{const e=String.fromCharCode(t[0],t[1],t[2],t[3]),i=af(t,4);return{type:e,size:i,data:t.subarray(10,10+i)}},lf=t=>{let e=0;const i=[];for(;tf(t,e);){const r=af(t,e+6);e+=10;const a=e+r;for(;e+8<a;){const r=cf(t.subarray(e)),a=df(r);a&&i.push(a),e+=r.size+10}ef(t,e)&&(e+=10)}return i},df=t=>"PRIV"===t.type?hf(t):"W"===t.type[0]?gf(t):pf(t),hf=t=>{if(t.size<2)return;const e=ff(t.data,!0),i=new Uint8Array(t.data.subarray(e.length+1));return{key:t.type,info:e,data:i.buffer}},pf=t=>{if(t.size<2)return;if("TXXX"===t.type){let e=1;const i=ff(t.data.subarray(e),!0);e+=i.length+1;const r=ff(t.data.subarray(e));return{key:t.type,info:i,data:r}}const e=ff(t.data.subarray(1));return{key:t.type,data:e}},gf=t=>{if("WXXX"===t.type){if(t.size<2)return;let e=1;const i=ff(t.data.subarray(e),!0);e+=i.length+1;const r=ff(t.data.subarray(e));return{key:t.type,info:i,data:r}}const e=ff(t.data);return{key:t.type,data:e}},uf=t=>{if(8===t.data.byteLength){const e=new Uint8Array(t.data),i=1&e[3];let r=(e[4]<<23)+(e[5]<<15)+(e[6]<<7)+e[7];return r/=45,i&&(r+=47721858.84),Math.round(r)}},ff=(t,e=!1)=>{const i=vf();if(i){const r=i.decode(t);if(e){const t=r.indexOf("\0");return-1!==t?r.substring(0,t):r}return r.replace(/\0/g,"")}const r=t.length;let a,s,n,o="",c=0;for(;c<r;){if(a=t[c++],0===a&&e)return o;if(0!==a&&3!==a)switch(a>>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:o+=String.fromCharCode(a);break;case 12:case 13:s=t[c++],o+=String.fromCharCode((31&a)<<6|63&s);break;case 14:s=t[c++],n=t[c++],o+=String.fromCharCode((15&a)<<12|(63&s)<<6|63&n)}}return o};let mf;function vf(){if(!navigator.userAgent.includes("PlayStation 4"))return mf||void 0===self.TextDecoder||(mf=new self.TextDecoder("utf-8")),mf}const bf=function(t){let e="";for(let i=0;i<t.length;i++){let r=t[i].toString(16);r.length<2&&(r="0"+r),e+=r}return e},kf=Math.pow(2,32)-1,yf=[].push,wf={video:1,audio:2,id3:3,text:4};function xf(t){return String.fromCharCode.apply(null,t)}function Sf(t,e){const i=t[e]<<8|t[e+1];return i<0?65536+i:i}function Pf(t,e){const i=Ef(t,e);return i<0?4294967296+i:i}function Cf(t,e){let i=Pf(t,e);return i*=Math.pow(2,32),i+=Pf(t,e+4),i}function Ef(t,e){return t[e]<<24|t[e+1]<<16|t[e+2]<<8|t[e+3]}function Tf(t,e,i){t[e]=i>>24,t[e+1]=i>>16&255,t[e+2]=i>>8&255,t[e+3]=255&i}function Lf(t,e){const i=[];if(!e.length)return i;const r=t.byteLength;for(let a=0;a<r;){const s=Pf(t,a),n=s>1?a+s:r;if(xf(t.subarray(a+4,a+8))===e[0])if(1===e.length)i.push(t.subarray(a+8,n));else{const r=Lf(t.subarray(a+8,n),e.slice(1));r.length&&yf.apply(i,r)}a=n}return i}function _f(t){const e=[],i=t[0];let r=8;const a=Pf(t,r);r+=4;let s=0,n=0;0===i?(s=Pf(t,r),n=Pf(t,r+4),r+=8):(s=Cf(t,r),n=Cf(t,r+8),r+=16),r+=2;let o=t.length+n;const c=Sf(t,r);r+=2;for(let i=0;i<c;i++){let i=r;const s=Pf(t,i);i+=4;const n=2147483647&s;if(1===(2147483648&s)>>>31)return ku.warn("SIDX has hierarchical references (not supported)"),null;const c=Pf(t,i);i+=4,e.push({referenceSize:n,subsegmentDuration:c,info:{duration:c/a,start:o,end:o+n-1}}),o+=n,i+=4,r=i}return{earliestPresentationTime:s,timescale:a,version:i,referencesCount:c,references:e}}function Rf(t){const e=[],i=Lf(t,["moov","trak"]);for(let t=0;t<i.length;t++){const r=i[t],a=Lf(r,["tkhd"])[0];if(a){let t=a[0];const i=Pf(a,0===t?12:20),s=Lf(r,["mdia","mdhd"])[0];if(s){t=s[0];const a=Pf(s,0===t?12:20),n=Lf(r,["mdia","hdlr"])[0];if(n){const t=xf(n.subarray(8,12)),s={soun:Eu,vide:Tu}[t];if(s){const t=Af(Lf(r,["mdia","minf","stbl","stsd"])[0]);e[i]={timescale:a,type:s},e[s]=su({timescale:a,id:i},t)}}}}}return Lf(t,["moov","mvex","trex"]).forEach((t=>{const i=Pf(t,4),r=e[i];r&&(r.default={duration:Pf(t,12),flags:Pf(t,20)})})),e}function Af(t){const e=t.subarray(8),i=e.subarray(86),r=xf(e.subarray(4,8));let a=r;const s="enca"===r||"encv"===r;if(s){const t=Lf(e,[r])[0];Lf(t.subarray("enca"===r?28:78),["sinf"]).forEach((t=>{const e=Lf(t,["schm"])[0];if(e){const i=xf(e.subarray(4,8));if("cbcs"===i||"cenc"===i){const e=Lf(t,["frma"])[0];e&&(a=xf(e))}}}))}switch(a){case"avc1":case"avc2":case"avc3":case"avc4":{const t=Lf(i,["avcC"])[0];a+="."+Mf(t[1])+Mf(t[2])+Mf(t[3]);break}case"mp4a":{const t=Lf(e,[r])[0],i=Lf(t.subarray(28),["esds"])[0];if(i&&i.length>12){let t=4;if(3!==i[t++])break;t=Df(i,t),t+=2;const e=i[t++];if(128&e&&(t+=2),64&e&&(t+=i[t++]),4!==i[t++])break;t=Df(i,t);const r=i[t++];if(64!==r)break;if(a+="."+Mf(r),t+=12,5!==i[t++])break;t=Df(i,t);const s=i[t++];let n=(248&s)>>3;31===n&&(n+=1+((7&s)<<3)+((224&i[t])>>5)),a+="."+n}break}case"hvc1":case"hev1":{const t=Lf(i,["hvcC"])[0],e=t[1],r=["","A","B","C"][e>>6],s=31&e,n=Pf(t,2),o=(32&e)>>5?"H":"L",c=t[12],l=t.subarray(6,12);a+="."+r+s,a+="."+n.toString(16).toUpperCase(),a+="."+o+c;let d="";for(let t=l.length;t--;){const e=l[t];if(e||d){d="."+e.toString(16).toUpperCase()+d}}a+=d;break}case"dvh1":case"dvhe":{const t=Lf(i,["dvcC"])[0],e=t[2]>>1&127,r=t[2]<<5&32|t[3]>>3&31;a+="."+If(e)+"."+If(r);break}case"vp09":{const t=Lf(i,["vpcC"])[0],e=t[4],r=t[5],s=t[6]>>4&15;a+="."+If(e)+"."+If(r)+"."+If(s);break}case"av01":{const t=Lf(i,["av1C"])[0],e=t[1]>>>5,r=31&t[1],s=t[2]>>>7?"H":"M",n=(64&t[2])>>6,o=(32&t[2])>>5,c=2===e&&n?o?12:10:n?10:8,l=(16&t[2])>>4,d=(8&t[2])>>3,h=(4&t[2])>>2,p=3&t[2],g=1,u=1,f=1,m=0;a+="."+e+"."+If(r)+s+"."+If(c)+"."+l+"."+d+h+p+"."+If(g)+"."+If(u)+"."+If(f)+"."+m;break}}return{codec:a,encrypted:s}}function Df(t,e){const i=e+5;for(;128&t[e++]&&e<i;);return e}function Mf(t){return("0"+t.toString(16).toUpperCase()).slice(-2)}function If(t){return(t<10?"0":"")+t}function Of(t){const e=Lf(t,["schm"])[0];if(e){const i=xf(e.subarray(4,8));if("cbcs"===i||"cenc"===i)return Lf(t,["schi","tenc"])[0]}return null}function Uf(t){const e=Pf(t,0);let i=8;1&e&&(i+=4),4&e&&(i+=4);let r=0;const a=Pf(t,4);for(let s=0;s<a;s++){if(256&e){r+=Pf(t,i),i+=4}512&e&&(i+=4),1024&e&&(i+=4),2048&e&&(i+=4)}return r}function $f(t,e){const i=new Uint8Array(t.length+e.length);return i.set(t),i.set(e,t.length),i}function Ff(t,e){const i=[],r=e.samples,a=e.timescale,s=e.id;let n=!1;return Lf(r,["moof"]).map((o=>{const c=o.byteOffset-8;Lf(o,["traf"]).map((o=>{const l=Lf(o,["tfdt"]).map((t=>{const e=t[0];let i=Pf(t,4);return 1===e&&(i*=Math.pow(2,32),i+=Pf(t,8)),i/a}))[0];return void 0!==l&&(t=l),Lf(o,["tfhd"]).map((l=>{const d=Pf(l,4),h=16777215&Pf(l,0);let p=0;const g=!!(16&h);let u=0;const f=!!(32&h);let m=8;d===s&&(!!(1&h)&&(m+=8),!!(2&h)&&(m+=4),!!(8&h)&&(p=Pf(l,m),m+=4),g&&(u=Pf(l,m),m+=4),f&&(m+=4),"video"===e.type&&(n=function(t){if(!t)return!1;const e=t.indexOf("."),i=e<0?t:t.substring(0,e);return"hvc1"===i||"hev1"===i||"dvh1"===i||"dvhe"===i}(e.codec)),Lf(o,["trun"]).map((s=>{const o=s[0],l=16777215&Pf(s,0),d=!!(1&l);let h=0;const g=!!(4&l),f=!!(256&l);let m=0;const v=!!(512&l);let b=0;const k=!!(1024&l),y=!!(2048&l);let w=0;const x=Pf(s,4);let S=8;d&&(h=Pf(s,S),S+=4),g&&(S+=4);let P=h+c;for(let c=0;c<x;c++){if(f?(m=Pf(s,S),S+=4):m=p,v?(b=Pf(s,S),S+=4):b=u,k&&(S+=4),y&&(w=0===o?Pf(s,S):Ef(s,S),S+=4),e.type===Tu){let e=0;for(;e<b;){const s=Pf(r,P);if(P+=4,jf(n,r[P])){zf(r.subarray(P,P+s),n?2:1,t+w/a,i)}P+=s,e+=s+4}}t+=m/a}})))}))}))})),i}function jf(t,e){if(t){const t=e>>1&63;return 39===t||40===t}return 6===(31&e)}function zf(t,e,i,r){const a=Nf(t);let s=0;s+=e;let n=0,o=0,c=0;for(;s<a.length;){n=0;do{if(s>=a.length)break;c=a[s++],n+=c}while(255===c);o=0;do{if(s>=a.length)break;c=a[s++],o+=c}while(255===c);const t=a.length-s;let e=s;if(o<t)s+=o;else if(o>t){ku.error(`Malformed SEI payload. ${o} is too small, only ${t} bytes left to parse.`);break}if(4===n){if(181===a[e++]){const t=Sf(a,e);if(e+=2,49===t){const t=Pf(a,e);if(e+=4,1195456820===t){const t=a[e++];if(3===t){const s=a[e++],o=64&s,c=o?2+3*(31&s):0,l=new Uint8Array(c);if(o){l[0]=s;for(let t=1;t<c;t++)l[t]=a[e++]}r.push({type:t,payloadType:n,pts:i,bytes:l})}}}}}else if(5===n&&o>16){const t=[];for(let i=0;i<16;i++){const r=a[e++].toString(16);t.push(1==r.length?"0"+r:r),3!==i&&5!==i&&7!==i&&9!==i||t.push("-")}const s=o-16,c=new Uint8Array(s);for(let t=0;t<s;t++)c[t]=a[e++];r.push({payloadType:n,pts:i,uuid:t.join(""),userData:ff(c),userDataBytes:c})}}}function Nf(t){const e=t.byteLength,i=[];let r=1;for(;r<e-2;)0===t[r]&&0===t[r+1]&&3===t[r+2]?(i.push(r+2),r+=2):r++;if(0===i.length)return t;const a=e-i.length,s=new Uint8Array(a);let n=0;for(r=0;r<a;n++,r++)n===i[0]&&(n++,i.shift()),s[r]=t[n];return s}function Bf(t,e,i){if(16!==t.byteLength)throw new RangeError("Invalid system id");let r,a,s;r=0,a=new Uint8Array,s=new Uint8Array;const n=new Uint8Array(4);return i&&i.byteLength>0&&new DataView(n.buffer).setUint32(0,i.byteLength,!1),function(t,...e){const i=e.length;let r=8,a=i;for(;a--;)r+=e[a].byteLength;const s=new Uint8Array(r);for(s[0]=r>>24&255,s[1]=r>>16&255,s[2]=r>>8&255,s[3]=255&r,s.set(t,4),a=0,r=8;a<i;a++)s.set(e[a],r),r+=e[a].byteLength;return s}([112,115,115,104],new Uint8Array([0,0,0,0]),t,s,a,n,i||new Uint8Array)}function Hf(t){const e=t.getUint32(0),i=t.byteOffset,r=t.byteLength;if(r<e)return{offset:i,size:r};if(1886614376!==t.getUint32(4))return{offset:i,size:e};const a=t.getUint32(8)>>>24;if(0!==a&&1!==a)return{offset:i,size:e};const s=t.buffer,n=bf(new Uint8Array(s,i+12,16)),o=t.getUint32(28);let c=null,l=null;if(0===a){if(e-32<o||o<22)return{offset:i,size:e};l=new Uint8Array(s,i+32,o)}else if(1===a){if(!o||r<i+32+16*o+16)return{offset:i,size:e};c=[];for(let t=0;t<o;t++)c.push(new Uint8Array(s,i+32+16*t,16))}return{version:a,systemId:n,kids:c,data:l,offset:i,size:e}}let Gf={};class Vf{static clearKeyUriToKeyIdMap(){Gf={}}constructor(t,e,i,r=[1],a=null){this.uri=void 0,this.method=void 0,this.keyFormat=void 0,this.keyFormatVersions=void 0,this.encrypted=void 0,this.isCommonEncryption=void 0,this.iv=null,this.key=null,this.keyId=null,this.pssh=null,this.method=t,this.uri=e,this.keyFormat=i,this.keyFormatVersions=r,this.iv=a,this.encrypted=!!t&&"NONE"!==t,this.isCommonEncryption=this.encrypted&&"AES-128"!==t}isSupported(){if(this.method){if("AES-128"===this.method||"NONE"===this.method)return!0;if("identity"===this.keyFormat)return"SAMPLE-AES"===this.method;switch(this.keyFormat){case ju:case Nu:case zu:case Fu:return-1!==["ISO-23001-7","SAMPLE-AES","SAMPLE-AES-CENC","SAMPLE-AES-CTR"].indexOf(this.method)}}return!1}getDecryptData(t){if(!this.encrypted||!this.uri)return null;if("AES-128"===this.method&&this.uri&&!this.iv){"number"!=typeof t&&("AES-128"!==this.method||this.iv||ku.warn(`missing IV for initialization segment with method="${this.method}" - compliance issue`),t=0);const e=function(t){const e=new Uint8Array(16);for(let i=12;i<16;i++)e[i]=t>>8*(15-i)&255;return e}(t);return new Vf(this.method,this.uri,"identity",this.keyFormatVersions,e)}const e=Iu(this.uri);if(e)switch(this.keyFormat){case Nu:this.pssh=e,e.length>=22&&(this.keyId=e.subarray(e.length-22,e.length-6));break;case zu:{const t=new Uint8Array([154,4,240,121,152,64,66,134,171,146,230,91,224,136,95,149]);this.pssh=Bf(t,0,e),this.keyId=Ju(e);break}default:{let t=e.subarray(0,16);if(16!==t.length){const e=new Uint8Array(16);e.set(t,16-t.length),t=e}this.keyId=t;break}}if(!this.keyId||16!==this.keyId.byteLength){let t=Gf[this.uri];if(!t){const e=Object.keys(Gf).length%Number.MAX_SAFE_INTEGER;t=new Uint8Array(16);new DataView(t.buffer,12,4).setUint32(0,e),Gf[this.uri]=t}this.keyId=t}return this}}const qf=/\{\$([a-zA-Z0-9-_]+)\}/g;function Kf(t){return qf.test(t)}function Wf(t,e,i){if(null!==t.variableList||t.hasVariableRefs)for(let r=i.length;r--;){const a=i[r],s=e[a];s&&(e[a]=Yf(t,s))}}function Yf(t,e){if(null!==t.variableList||t.hasVariableRefs){const i=t.variableList;return e.replace(qf,(e=>{const r=e.substring(2,e.length-1),a=null==i?void 0:i[r];return void 0===a?(t.playlistParsingError||(t.playlistParsingError=new Error(`Missing preceding EXT-X-DEFINE tag for Variable Reference: "${r}"`)),e):a}))}return e}function Zf(t,e,i){let r,a,s=t.variableList;if(s||(t.variableList=s={}),"QUERYPARAM"in e){r=e.QUERYPARAM;try{const t=new self.URL(i).searchParams;if(!t.has(r))throw new Error(`"${r}" does not match any query parameter in URI: "${i}"`);a=t.get(r)}catch(e){t.playlistParsingError||(t.playlistParsingError=new Error(`EXT-X-DEFINE QUERYPARAM: ${e.message}`))}}else r=e.NAME,a=e.VALUE;r in s?t.playlistParsingError||(t.playlistParsingError=new Error(`EXT-X-DEFINE duplicate Variable Name declarations: "${r}"`)):s[r]=a||""}function Qf(t,e,i){const r=e.IMPORT;if(i&&r in i){let e=t.variableList;e||(t.variableList=e={}),e[r]=i[r]}else t.playlistParsingError||(t.playlistParsingError=new Error(`EXT-X-DEFINE IMPORT attribute not found in Multivariant Playlist: "${r}"`))}function Jf(t=!0){if("undefined"==typeof self)return;return(t||!self.MediaSource)&&self.ManagedMediaSource||self.MediaSource||self.WebKitMediaSource}const Xf={audio:{a3ds:1,"ac-3":.95,"ac-4":1,alac:.9,alaw:1,dra1:1,"dts+":1,"dts-":1,dtsc:1,dtse:1,dtsh:1,"ec-3":.9,enca:1,fLaC:.9,flac:.9,FLAC:.9,g719:1,g726:1,m4ae:1,mha1:1,mha2:1,mhm1:1,mhm2:1,mlpa:1,mp4a:1,"raw ":1,Opus:1,opus:1,samr:1,sawb:1,sawp:1,sevc:1,sqcp:1,ssmv:1,twos:1,ulaw:1},video:{avc1:1,avc2:1,avc3:1,avc4:1,avcp:1,av01:.8,drac:1,dva1:1,dvav:1,dvh1:.7,dvhe:.7,encv:1,hev1:.75,hvc1:.75,mjp2:1,mp4v:1,mvc1:1,mvc2:1,mvc3:1,mvc4:1,resv:1,rv60:1,s263:1,svc1:1,svc2:1,"vc-1":1,vp08:1,vp09:.9},text:{stpp:1,wvtt:1}};function tm(t,e,i=!0){return!t.split(",").some((t=>!em(t,e,i)))}function em(t,e,i=!0){var r;const a=Jf(i);return null!=(r=null==a?void 0:a.isTypeSupported(im(t,e)))&&r}function im(t,e){return`${e}/mp4;codecs="${t}"`}function rm(t){if(t){const e=t.substring(0,4);return Xf.video[e]}return 2}function am(t){return t.split(",").reduce(((t,e)=>{const i=Xf.video[e];return i?(2*i+t)/(t?3:2):(Xf.audio[e]+t)/(t?2:1)}),0)}const sm={};const nm=/flac|opus/i;function om(t,e=!0){return t.replace(nm,(t=>function(t,e=!0){if(sm[t])return sm[t];const i={flac:["flac","fLaC","FLAC"],opus:["opus","Opus"]}[t];for(let r=0;r<i.length;r++)if(em(i[r],"audio",e))return sm[t]=i[r],i[r];return t}(t.toLowerCase(),e)))}function cm(t,e){return t&&"mp4a"!==t?t:e?e.split(",")[0]:e}const lm=/#EXT-X-STREAM-INF:([^\r\n]*)(?:[\r\n](?:#[^\r\n]*)?)*([^\r\n]+)|#EXT-X-(SESSION-DATA|SESSION-KEY|DEFINE|CONTENT-STEERING|START):([^\r\n]*)[\r\n]+/g,dm=/#EXT-X-MEDIA:(.*)/g,hm=/^#EXT(?:INF|-X-TARGETDURATION):/m,pm=new RegExp([/#EXTINF:\s*(\d*(?:\.\d+)?)(?:,(.*)\s+)?/.source,/(?!#) *(\S[^\r\n]*)/.source,/#EXT-X-BYTERANGE:*(.+)/.source,/#EXT-X-PROGRAM-DATE-TIME:(.+)/.source,/#.*/.source].join("|"),"g"),gm=new RegExp([/#(EXTM3U)/.source,/#EXT-X-(DATERANGE|DEFINE|KEY|MAP|PART|PART-INF|PLAYLIST-TYPE|PRELOAD-HINT|RENDITION-REPORT|SERVER-CONTROL|SKIP|START):(.+)/.source,/#EXT-X-(BITRATE|DISCONTINUITY-SEQUENCE|MEDIA-SEQUENCE|TARGETDURATION|VERSION): *(\d+)/.source,/#EXT-X-(DISCONTINUITY|ENDLIST|GAP|INDEPENDENT-SEGMENTS)/.source,/(#)([^:]*):(.*)/.source,/(#)(.*)(?:.*)\r?\n?/.source].join("|"));class um{static findGroup(t,e){for(let i=0;i<t.length;i++){const r=t[i];if(r.id===e)return r}}static resolve(t,e){return ru.buildAbsoluteURL(e,t,{alwaysNormalize:!0})}static isMediaPlaylist(t){return hm.test(t)}static parseMasterPlaylist(t,e){const i={contentSteering:null,levels:[],playlistParsingError:null,sessionData:null,sessionKeys:null,startTimeOffset:null,variableList:null,hasVariableRefs:Kf(t)},r=[];let a;for(lm.lastIndex=0;null!=(a=lm.exec(t));)if(a[1]){var s;const t=new xu(a[1]);Wf(i,t,["CODECS","SUPPLEMENTAL-CODECS","ALLOWED-CPC","PATHWAY-ID","STABLE-VARIANT-ID","AUDIO","VIDEO","SUBTITLES","CLOSED-CAPTIONS","NAME"]);const n=Yf(i,a[2]),o={attrs:t,bitrate:t.decimalInteger("BANDWIDTH")||t.decimalInteger("AVERAGE-BANDWIDTH"),name:t.NAME,url:um.resolve(n,e)},c=t.decimalResolution("RESOLUTION");c&&(o.width=c.width,o.height=c.height),vm(t.CODECS,o),null!=(s=o.unknownCodecs)&&s.length||r.push(o),i.levels.push(o)}else if(a[3]){const t=a[3],r=a[4];switch(t){case"SESSION-DATA":{const t=new xu(r);Wf(i,t,["DATA-ID","LANGUAGE","VALUE","URI"]);const e=t["DATA-ID"];e&&(null===i.sessionData&&(i.sessionData={}),i.sessionData[e]=t);break}case"SESSION-KEY":{const t=fm(r,e,i);t.encrypted&&t.isSupported()?(null===i.sessionKeys&&(i.sessionKeys=[]),i.sessionKeys.push(t)):ku.warn(`[Keys] Ignoring invalid EXT-X-SESSION-KEY tag: "${r}"`);break}case"DEFINE":{const t=new xu(r);Wf(i,t,["NAME","VALUE","QUERYPARAM"]),Zf(i,t,e)}break;case"CONTENT-STEERING":{const t=new xu(r);Wf(i,t,["SERVER-URI","PATHWAY-ID"]),i.contentSteering={uri:um.resolve(t["SERVER-URI"],e),pathwayId:t["PATHWAY-ID"]||"."};break}case"START":i.startTimeOffset=mm(r)}}const n=r.length>0&&r.length<i.levels.length;return i.levels=n?r:i.levels,0===i.levels.length&&(i.playlistParsingError=new Error("no levels found in manifest")),i}static parseMasterPlaylistMedia(t,e,i){let r;const a={},s=i.levels,n={AUDIO:s.map((t=>({id:t.attrs.AUDIO,audioCodec:t.audioCodec}))),SUBTITLES:s.map((t=>({id:t.attrs.SUBTITLES,textCodec:t.textCodec}))),"CLOSED-CAPTIONS":[]};let o=0;for(dm.lastIndex=0;null!==(r=dm.exec(t));){const t=new xu(r[1]),s=t.TYPE;if(s){const r=n[s],c=a[s]||[];a[s]=c,Wf(i,t,["URI","GROUP-ID","LANGUAGE","ASSOC-LANGUAGE","STABLE-RENDITION-ID","NAME","INSTREAM-ID","CHARACTERISTICS","CHANNELS"]);const l=t.LANGUAGE,d=t["ASSOC-LANGUAGE"],h=t.CHANNELS,p=t.CHARACTERISTICS,g=t["INSTREAM-ID"],u={attrs:t,bitrate:0,id:o++,groupId:t["GROUP-ID"]||"",name:t.NAME||l||"",type:s,default:t.bool("DEFAULT"),autoselect:t.bool("AUTOSELECT"),forced:t.bool("FORCED"),lang:l,url:t.URI?um.resolve(t.URI,e):""};if(d&&(u.assocLang=d),h&&(u.channels=h),p&&(u.characteristics=p),g&&(u.instreamId=g),null!=r&&r.length){const t=um.findGroup(r,u.groupId)||r[0];bm(u,t,"audioCodec"),bm(u,t,"textCodec")}c.push(u)}}return a}static parseLevelPlaylist(t,e,i,r,a,s){const n=new Du(e),o=n.fragments;let c,l,d,h=null,p=0,g=0,u=0,f=0,m=null,v=new Ru(r,e),b=-1,k=!1,y=null;for(pm.lastIndex=0,n.m3u8=t,n.hasVariableRefs=Kf(t);null!==(c=pm.exec(t));){k&&(k=!1,v=new Ru(r,e),v.start=u,v.sn=p,v.cc=f,v.level=i,h&&(v.initSegment=h,v.rawProgramDateTime=h.rawProgramDateTime,h.rawProgramDateTime=null,y&&(v.setByteRange(y),y=null)));const t=c[1];if(t){v.duration=parseFloat(t);const e=(" "+c[2]).slice(1);v.title=e||null,v.tagList.push(e?["INF",t,e]:["INF",t])}else if(c[3]){if(lu(v.duration)){v.start=u,d&&wm(v,d,n),v.sn=p,v.level=i,v.cc=f,o.push(v);const t=(" "+c[3]).slice(1);v.relurl=Yf(n,t),km(v,m),m=v,u+=v.duration,p++,g=0,k=!0}}else if(c[4]){const t=(" "+c[4]).slice(1);m?v.setByteRange(t,m):v.setByteRange(t)}else if(c[5])v.rawProgramDateTime=(" "+c[5]).slice(1),v.tagList.push(["PROGRAM-DATE-TIME",v.rawProgramDateTime]),-1===b&&(b=o.length);else{if(c=c[0].match(gm),!c){ku.warn("No matches on slow regex match for level playlist!");continue}for(l=1;l<c.length&&void 0===c[l];l++);const t=(" "+c[l]).slice(1),a=(" "+c[l+1]).slice(1),u=c[l+2]?(" "+c[l+2]).slice(1):"";switch(t){case"PLAYLIST-TYPE":n.type=a.toUpperCase();break;case"MEDIA-SEQUENCE":p=n.startSN=parseInt(a);break;case"SKIP":{const t=new xu(a);Wf(n,t,["RECENTLY-REMOVED-DATERANGES"]);const e=t.decimalInteger("SKIPPED-SEGMENTS");if(lu(e)){n.skippedSegments=e;for(let t=e;t--;)o.unshift(null);p+=e}const i=t.enumeratedString("RECENTLY-REMOVED-DATERANGES");i&&(n.recentlyRemovedDateranges=i.split("\t"));break}case"TARGETDURATION":n.targetduration=Math.max(parseInt(a),1);break;case"VERSION":n.version=parseInt(a);break;case"INDEPENDENT-SEGMENTS":case"EXTM3U":break;case"ENDLIST":n.live=!1;break;case"#":(a||u)&&v.tagList.push(u?[a,u]:[a]);break;case"DISCONTINUITY":f++,v.tagList.push(["DIS"]);break;case"GAP":v.gap=!0,v.tagList.push([t]);break;case"BITRATE":v.tagList.push([t,a]);break;case"DATERANGE":{const t=new xu(a);Wf(n,t,["ID","CLASS","START-DATE","END-DATE","SCTE35-CMD","SCTE35-OUT","SCTE35-IN"]),Wf(n,t,t.clientAttrs);const e=new Pu(t,n.dateRanges[t.ID]);e.isValid||n.skippedSegments?n.dateRanges[e.id]=e:ku.warn(`Ignoring invalid DATERANGE tag: "${a}"`),v.tagList.push(["EXT-X-DATERANGE",a]);break}case"DEFINE":{const t=new xu(a);Wf(n,t,["NAME","VALUE","IMPORT","QUERYPARAM"]),"IMPORT"in t?Qf(n,t,s):Zf(n,t,e)}break;case"DISCONTINUITY-SEQUENCE":f=parseInt(a);break;case"KEY":{const t=fm(a,e,n);if(t.isSupported()){if("NONE"===t.method){d=void 0;break}d||(d={}),d[t.keyFormat]&&(d=cu({},d)),d[t.keyFormat]=t}else ku.warn(`[Keys] Ignoring invalid EXT-X-KEY tag: "${a}"`);break}case"START":n.startTimeOffset=mm(a);break;case"MAP":{const t=new xu(a);if(Wf(n,t,["BYTERANGE","URI"]),v.duration){const a=new Ru(r,e);ym(a,t,i,d),h=a,v.initSegment=h,h.rawProgramDateTime&&!v.rawProgramDateTime&&(v.rawProgramDateTime=h.rawProgramDateTime)}else{const e=v.byteRangeEndOffset;if(e){const t=v.byteRangeStartOffset;y=`${e-t}@${t}`}else y=null;ym(v,t,i,d),h=v,k=!0}break}case"SERVER-CONTROL":{const t=new xu(a);n.canBlockReload=t.bool("CAN-BLOCK-RELOAD"),n.canSkipUntil=t.optionalFloat("CAN-SKIP-UNTIL",0),n.canSkipDateRanges=n.canSkipUntil>0&&t.bool("CAN-SKIP-DATERANGES"),n.partHoldBack=t.optionalFloat("PART-HOLD-BACK",0),n.holdBack=t.optionalFloat("HOLD-BACK",0);break}case"PART-INF":{const t=new xu(a);n.partTarget=t.decimalFloatingPoint("PART-TARGET");break}case"PART":{let t=n.partList;t||(t=n.partList=[]);const i=g>0?t[t.length-1]:void 0,r=g++,s=new xu(a);Wf(n,s,["BYTERANGE","URI"]);const o=new Au(s,v,e,r,i);t.push(o),v.duration+=o.duration;break}case"PRELOAD-HINT":{const t=new xu(a);Wf(n,t,["URI"]),n.preloadHint=t;break}case"RENDITION-REPORT":{const t=new xu(a);Wf(n,t,["URI"]),n.renditionReports=n.renditionReports||[],n.renditionReports.push(t);break}default:ku.warn(`line parsed but not handled: ${c}`)}}}m&&!m.relurl?(o.pop(),u-=m.duration,n.partList&&(n.fragmentHint=m)):n.partList&&(km(v,m),v.cc=f,n.fragmentHint=v,d&&wm(v,d,n));const w=o.length,x=o[0],S=o[w-1];if(u+=n.skippedSegments*n.targetduration,u>0&&w&&S){n.averagetargetduration=u/w;const t=S.sn;n.endSN="initSegment"!==t?t:0,n.live||(S.endList=!0),x&&(n.startCC=x.cc)}else n.endSN=0,n.startCC=0;return n.fragmentHint&&(u+=n.fragmentHint.duration),n.totalduration=u,n.endCC=f,b>0&&function(t,e){let i=t[e];for(let r=e;r--;){const e=t[r];if(!e)return;e.programDateTime=i.programDateTime-1e3*e.duration,i=e}}(o,b),n}}function fm(t,e,i){var r,a;const s=new xu(t);Wf(i,s,["KEYFORMAT","KEYFORMATVERSIONS","URI","IV","URI"]);const n=null!=(r=s.METHOD)?r:"",o=s.URI,c=s.hexadecimalInteger("IV"),l=s.KEYFORMATVERSIONS,d=null!=(a=s.KEYFORMAT)?a:"identity";o&&s.IV&&!c&&ku.error(`Invalid IV: ${s.IV}`);const h=o?um.resolve(o,e):"",p=(l||"1").split("/").map(Number).filter(Number.isFinite);return new Vf(n,h,d,p,c)}function mm(t){const e=new xu(t).decimalFloatingPoint("TIME-OFFSET");return lu(e)?e:null}function vm(t,e){let i=(t||"").split(/[ ,]+/).filter((t=>t));["video","audio","text"].forEach((t=>{const r=i.filter((e=>function(t,e){const i=Xf[e];return!!i&&!!i[t.slice(0,4)]}(e,t)));r.length&&(e[`${t}Codec`]=r.join(","),i=i.filter((t=>-1===r.indexOf(t))))})),e.unknownCodecs=i}function bm(t,e,i){const r=e[i];r&&(t[i]=r)}function km(t,e){t.rawProgramDateTime?t.programDateTime=Date.parse(t.rawProgramDateTime):null!=e&&e.programDateTime&&(t.programDateTime=e.endProgramDateTime),lu(t.programDateTime)||(t.programDateTime=null,t.rawProgramDateTime=null)}function ym(t,e,i,r){t.relurl=e.URI,e.BYTERANGE&&t.setByteRange(e.BYTERANGE),t.level=i,t.sn="initSegment",r&&(t.levelkeys=r),t.initSegment=null}function wm(t,e,i){t.levelkeys=e;const{encryptedFragments:r}=i;r.length&&r[r.length-1].levelkeys===e||!Object.keys(e).some((t=>e[t].isCommonEncryption))||r.push(t)}var xm="manifest",Sm="level",Pm="audioTrack",Cm="subtitleTrack",Em="main",Tm="audio",Lm="subtitle";function _m(t){const{type:e}=t;switch(e){case Pm:return Tm;case Cm:return Lm;default:return Em}}function Rm(t,e){let i=t.url;return void 0!==i&&0!==i.indexOf("data:")||(i=e.url),i}class Am{constructor(t){this.hls=void 0,this.loaders=Object.create(null),this.variableList=null,this.hls=t,this.registerListeners()}startLoad(t){}stopLoad(){this.destroyInternalLoaders()}registerListeners(){const{hls:t}=this;t.on(pu.MANIFEST_LOADING,this.onManifestLoading,this),t.on(pu.LEVEL_LOADING,this.onLevelLoading,this),t.on(pu.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),t.on(pu.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)}unregisterListeners(){const{hls:t}=this;t.off(pu.MANIFEST_LOADING,this.onManifestLoading,this),t.off(pu.LEVEL_LOADING,this.onLevelLoading,this),t.off(pu.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),t.off(pu.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)}createInternalLoader(t){const e=this.hls.config,i=e.pLoader,r=e.loader,a=new(i||r)(e);return this.loaders[t.type]=a,a}getInternalLoader(t){return this.loaders[t.type]}resetInternalLoader(t){this.loaders[t]&&delete this.loaders[t]}destroyInternalLoaders(){for(const t in this.loaders){const e=this.loaders[t];e&&e.destroy(),this.resetInternalLoader(t)}}destroy(){this.variableList=null,this.unregisterListeners(),this.destroyInternalLoaders()}onManifestLoading(t,e){const{url:i}=e;this.variableList=null,this.load({id:null,level:0,responseType:"text",type:xm,url:i,deliveryDirectives:null})}onLevelLoading(t,e){const{id:i,level:r,pathwayId:a,url:s,deliveryDirectives:n}=e;this.load({id:i,level:r,pathwayId:a,responseType:"text",type:Sm,url:s,deliveryDirectives:n})}onAudioTrackLoading(t,e){const{id:i,groupId:r,url:a,deliveryDirectives:s}=e;this.load({id:i,groupId:r,level:null,responseType:"text",type:Pm,url:a,deliveryDirectives:s})}onSubtitleTrackLoading(t,e){const{id:i,groupId:r,url:a,deliveryDirectives:s}=e;this.load({id:i,groupId:r,level:null,responseType:"text",type:Cm,url:a,deliveryDirectives:s})}load(t){var e;const i=this.hls.config;let r,a=this.getInternalLoader(t);if(a){const e=a.context;if(e&&e.url===t.url&&e.level===t.level)return void ku.trace("[playlist-loader]: playlist request ongoing");ku.log(`[playlist-loader]: aborting previous loader for type: ${t.type}`),a.abort()}if(r=t.type===xm?i.manifestLoadPolicy.default:cu({},i.playlistLoadPolicy.default,{timeoutRetry:null,errorRetry:null}),a=this.createInternalLoader(t),lu(null==(e=t.deliveryDirectives)?void 0:e.part)){let e;if(t.type===Sm&&null!==t.level?e=this.hls.levels[t.level].details:t.type===Pm&&null!==t.id?e=this.hls.audioTracks[t.id].details:t.type===Cm&&null!==t.id&&(e=this.hls.subtitleTracks[t.id].details),e){const t=e.partTarget,i=e.targetduration;if(t&&i){const e=1e3*Math.max(3*t,.8*i);r=cu({},r,{maxTimeToFirstByteMs:Math.min(e,r.maxTimeToFirstByteMs),maxLoadTimeMs:Math.min(e,r.maxTimeToFirstByteMs)})}}}const s=r.errorRetry||r.timeoutRetry||{},n={loadPolicy:r,timeout:r.maxLoadTimeMs,maxRetry:s.maxNumRetry||0,retryDelay:s.retryDelayMs||0,maxRetryDelay:s.maxRetryDelayMs||0},o={onSuccess:(t,e,i,r)=>{const a=this.getInternalLoader(i);this.resetInternalLoader(i.type);const s=t.data;0===s.indexOf("#EXTM3U")?(e.parsing.start=performance.now(),um.isMediaPlaylist(s)?this.handleTrackOrLevelPlaylist(t,e,i,r||null,a):this.handleMasterPlaylist(t,e,i,r)):this.handleManifestParsingError(t,i,new Error("no EXTM3U delimiter"),r||null,e)},onError:(t,e,i,r)=>{this.handleNetworkError(e,i,!1,t,r)},onTimeout:(t,e,i)=>{this.handleNetworkError(e,i,!0,void 0,t)}};a.load(t,n,o)}handleMasterPlaylist(t,e,i,r){const a=this.hls,s=t.data,n=Rm(t,i),o=um.parseMasterPlaylist(s,n);if(o.playlistParsingError)return void this.handleManifestParsingError(t,i,o.playlistParsingError,r,e);const{contentSteering:c,levels:l,sessionData:d,sessionKeys:h,startTimeOffset:p,variableList:g}=o;this.variableList=g;const{AUDIO:u=[],SUBTITLES:f,"CLOSED-CAPTIONS":m}=um.parseMasterPlaylistMedia(s,n,o);if(u.length){u.some((t=>!t.url))||!l[0].audioCodec||l[0].attrs.AUDIO||(ku.log("[playlist-loader]: audio codec signaled in quality level, but no embedded audio track signaled, create one"),u.unshift({type:"main",name:"main",groupId:"main",default:!1,autoselect:!1,forced:!1,id:-1,attrs:new xu({}),bitrate:0,url:""}))}a.trigger(pu.MANIFEST_LOADED,{levels:l,audioTracks:u,subtitles:f,captions:m,contentSteering:c,url:n,stats:e,networkDetails:r,sessionData:d,sessionKeys:h,startTimeOffset:p,variableList:g})}handleTrackOrLevelPlaylist(t,e,i,r,a){const s=this.hls,{id:n,level:o,type:c}=i,l=Rm(t,i),d=lu(o)?o:lu(n)?n:0,h=_m(i),p=um.parseLevelPlaylist(t.data,l,d,h,0,this.variableList);if(c===xm){const t={attrs:new xu({}),bitrate:0,details:p,name:"",url:l};s.trigger(pu.MANIFEST_LOADED,{levels:[t],audioTracks:[],url:l,stats:e,networkDetails:r,sessionData:null,sessionKeys:null,contentSteering:null,startTimeOffset:null,variableList:null})}e.parsing.end=performance.now(),i.levelDetails=p,this.handlePlaylistLoaded(p,t,e,i,r,a)}handleManifestParsingError(t,e,i,r,a){this.hls.trigger(pu.ERROR,{type:gu.NETWORK_ERROR,details:uu.MANIFEST_PARSING_ERROR,fatal:e.type===xm,url:t.url,err:i,error:i,reason:i.message,response:t,context:e,networkDetails:r,stats:a})}handleNetworkError(t,e,i=!1,r,a){let s=`A network ${i?"timeout":"error"+(r?" (status "+r.code+")":"")} occurred while loading ${t.type}`;t.type===Sm?s+=`: ${t.level} id: ${t.id}`:t.type!==Pm&&t.type!==Cm||(s+=` id: ${t.id} group-id: "${t.groupId}"`);const n=new Error(s);ku.warn(`[playlist-loader]: ${s}`);let o=uu.UNKNOWN,c=!1;const l=this.getInternalLoader(t);switch(t.type){case xm:o=i?uu.MANIFEST_LOAD_TIMEOUT:uu.MANIFEST_LOAD_ERROR,c=!0;break;case Sm:o=i?uu.LEVEL_LOAD_TIMEOUT:uu.LEVEL_LOAD_ERROR,c=!1;break;case Pm:o=i?uu.AUDIO_TRACK_LOAD_TIMEOUT:uu.AUDIO_TRACK_LOAD_ERROR,c=!1;break;case Cm:o=i?uu.SUBTITLE_TRACK_LOAD_TIMEOUT:uu.SUBTITLE_LOAD_ERROR,c=!1}l&&this.resetInternalLoader(t.type);const d={type:gu.NETWORK_ERROR,details:o,fatal:c,url:t.url,loader:l,context:t,error:n,networkDetails:e,stats:a};if(r){const i=(null==e?void 0:e.url)||t.url;d.response=su({url:i,data:void 0},r)}this.hls.trigger(pu.ERROR,d)}handlePlaylistLoaded(t,e,i,r,a,s){const n=this.hls,{type:o,level:c,id:l,groupId:d,deliveryDirectives:h}=r,p=Rm(e,r),g=_m(r),u="number"==typeof r.level&&g===Em?c:void 0;if(!t.fragments.length){const t=new Error("No Segments found in Playlist");return void n.trigger(pu.ERROR,{type:gu.NETWORK_ERROR,details:uu.LEVEL_EMPTY_ERROR,fatal:!1,url:p,error:t,reason:t.message,response:e,context:r,level:u,parent:g,networkDetails:a,stats:i})}t.targetduration||(t.playlistParsingError=new Error("Missing Target Duration"));const f=t.playlistParsingError;if(f)n.trigger(pu.ERROR,{type:gu.NETWORK_ERROR,details:uu.LEVEL_PARSING_ERROR,fatal:!1,url:p,error:f,reason:f.message,response:e,context:r,level:u,parent:g,networkDetails:a,stats:i});else switch(t.live&&s&&(s.getCacheAge&&(t.ageHeader=s.getCacheAge()||0),s.getCacheAge&&!isNaN(t.ageHeader)||(t.ageHeader=0)),o){case xm:case Sm:n.trigger(pu.LEVEL_LOADED,{details:t,level:u||0,id:l||0,stats:i,networkDetails:a,deliveryDirectives:h});break;case Pm:n.trigger(pu.AUDIO_TRACK_LOADED,{details:t,id:l||0,groupId:d||"",stats:i,networkDetails:a,deliveryDirectives:h});break;case Cm:n.trigger(pu.SUBTITLE_TRACK_LOADED,{details:t,id:l||0,groupId:d||"",stats:i,networkDetails:a,deliveryDirectives:h})}}}function Dm(t,e){let i;try{i=new Event("addtrack")}catch(t){i=document.createEvent("Event"),i.initEvent("addtrack",!1,!1)}i.track=t,e.dispatchEvent(i)}function Mm(t,e){const i=t.mode;if("disabled"===i&&(t.mode="hidden"),t.cues&&!t.cues.getCueById(e.id))try{if(t.addCue(e),!t.cues.getCueById(e.id))throw new Error(`addCue is failed for: ${e}`)}catch(i){ku.debug(`[texttrack-utils]: ${i}`);try{const i=new self.TextTrackCue(e.startTime,e.endTime,e.text);i.id=e.id,t.addCue(i)}catch(t){ku.debug(`[texttrack-utils]: Legacy TextTrackCue fallback failed: ${t}`)}}"disabled"===i&&(t.mode=i)}function Im(t){const e=t.mode;if("disabled"===e&&(t.mode="hidden"),t.cues)for(let e=t.cues.length;e--;)t.removeCue(t.cues[e]);"disabled"===e&&(t.mode=e)}function Om(t,e,i,r){const a=t.mode;if("disabled"===a&&(t.mode="hidden"),t.cues&&t.cues.length>0){const a=function(t,e,i){const r=[],a=function(t,e){if(e<t[0].startTime)return 0;const i=t.length-1;if(e>t[i].endTime)return-1;let r=0,a=i;for(;r<=a;){const s=Math.floor((a+r)/2);if(e<t[s].startTime)a=s-1;else{if(!(e>t[s].startTime&&r<i))return s;r=s+1}}return t[r].startTime-e<e-t[a].startTime?r:a}(t,e);if(a>-1)for(let s=a,n=t.length;s<n;s++){const a=t[s];if(a.startTime>=e&&a.endTime<=i)r.push(a);else if(a.startTime>i)return r}return r}(t.cues,e,i);for(let e=0;e<a.length;e++)r&&!r(a[e])||t.removeCue(a[e])}"disabled"===a&&(t.mode=a)}function Um(t){const e=[];for(let i=0;i<t.length;i++){const r=t[i];"subtitles"!==r.kind&&"captions"!==r.kind||!r.label||e.push(t[i])}return e}var $m="org.id3",Fm="com.apple.quicktime.HLS",jm="https://aomedia.org/emsg/ID3";function zm(){if("undefined"!=typeof self)return self.VTTCue||self.TextTrackCue}function Nm(t,e,i,r,a){let s=new t(e,i,"");try{s.value=r,a&&(s.type=a)}catch(n){s=new t(e,i,JSON.stringify(a?su({type:a},r):r))}return s}const Bm=(()=>{const t=zm();try{t&&new t(0,Number.POSITIVE_INFINITY,"")}catch(t){return Number.MAX_VALUE}return Number.POSITIVE_INFINITY})();function Hm(t,e){return t.getTime()/1e3-e}class Gm{constructor(t){this.hls=void 0,this.id3Track=null,this.media=null,this.dateRangeCuesAppended={},this.hls=t,this._registerListeners()}destroy(){this._unregisterListeners(),this.id3Track=null,this.media=null,this.dateRangeCuesAppended={},this.hls=null}_registerListeners(){const{hls:t}=this;t.on(pu.MEDIA_ATTACHED,this.onMediaAttached,this),t.on(pu.MEDIA_DETACHING,this.onMediaDetaching,this),t.on(pu.MANIFEST_LOADING,this.onManifestLoading,this),t.on(pu.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),t.on(pu.BUFFER_FLUSHING,this.onBufferFlushing,this),t.on(pu.LEVEL_UPDATED,this.onLevelUpdated,this)}_unregisterListeners(){const{hls:t}=this;t.off(pu.MEDIA_ATTACHED,this.onMediaAttached,this),t.off(pu.MEDIA_DETACHING,this.onMediaDetaching,this),t.off(pu.MANIFEST_LOADING,this.onManifestLoading,this),t.off(pu.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),t.off(pu.BUFFER_FLUSHING,this.onBufferFlushing,this),t.off(pu.LEVEL_UPDATED,this.onLevelUpdated,this)}onMediaAttached(t,e){this.media=e.media}onMediaDetaching(){this.id3Track&&(Im(this.id3Track),this.id3Track=null,this.media=null,this.dateRangeCuesAppended={})}onManifestLoading(){this.dateRangeCuesAppended={}}createTrack(t){const e=this.getID3Track(t.textTracks);return e.mode="hidden",e}getID3Track(t){if(this.media){for(let e=0;e<t.length;e++){const i=t[e];if("metadata"===i.kind&&"id3"===i.label)return Dm(i,this.media),i}return this.media.addTextTrack("metadata","id3")}}onFragParsingMetadata(t,e){if(!this.media)return;const{hls:{config:{enableEmsgMetadataCues:i,enableID3MetadataCues:r}}}=this;if(!i&&!r)return;const{samples:a}=e;this.id3Track||(this.id3Track=this.createTrack(this.media));const s=zm();if(s)for(let t=0;t<a.length;t++){const e=a[t].type;if(e===jm&&!i||!r)continue;const n=lf(a[t].data);if(n){const i=a[t].pts;let r=i+a[t].duration;r>Bm&&(r=Bm);r-i<=0&&(r=i+.25);for(let t=0;t<n.length;t++){const a=n[t];if(!of(a)){this.updateId3CueEnds(i,e);const t=Nm(s,i,r,a,e);t&&this.id3Track.addCue(t)}}}}}updateId3CueEnds(t,e){var i;const r=null==(i=this.id3Track)?void 0:i.cues;if(r)for(let i=r.length;i--;){const a=r[i];a.type===e&&a.startTime<t&&a.endTime===Bm&&(a.endTime=t)}}onBufferFlushing(t,{startOffset:e,endOffset:i,type:r}){const{id3Track:a,hls:s}=this;if(!s)return;const{config:{enableEmsgMetadataCues:n,enableID3MetadataCues:o}}=s;if(a&&(n||o)){let t;t="audio"===r?t=>t.type===$m&&o:"video"===r?t=>t.type===jm&&n:t=>t.type===$m&&o||t.type===jm&&n,Om(a,e,i,t)}}onLevelUpdated(t,{details:e}){if(!this.media||!e.hasProgramDateTime||!this.hls.config.enableDateRangeMetadataCues)return;const{dateRangeCuesAppended:i,id3Track:r}=this,{dateRanges:a}=e,s=Object.keys(a);if(r){const t=Object.keys(i).filter((t=>!s.includes(t)));for(let e=t.length;e--;){const a=t[e];Object.keys(i[a].cues).forEach((t=>{r.removeCue(i[a].cues[t])})),delete i[a]}}const n=e.fragments[e.fragments.length-1];if(0===s.length||!lu(null==n?void 0:n.programDateTime))return;this.id3Track||(this.id3Track=this.createTrack(this.media));const o=n.programDateTime/1e3-n.start,c=zm();for(let t=0;t<s.length;t++){const e=s[t],r=a[e],n=Hm(r.startDate,o),h=i[e],p=(null==h?void 0:h.cues)||{};let g=(null==h?void 0:h.durationKnown)||!1,u=Bm;const f=r.endDate;if(f)u=Hm(f,o),g=!0;else if(r.endOnNext&&!g){const t=s.reduce(((t,e)=>{if(e!==r.id){const i=a[e];if(i.class===r.class&&i.startDate>r.startDate&&(!t||r.startDate<t.startDate))return i}return t}),null);t&&(u=Hm(t.startDate,o),g=!0)}const m=Object.keys(r.attr);for(let t=0;t<m.length;t++){const i=m[t];if("ID"===(d=i)||"CLASS"===d||"START-DATE"===d||"DURATION"===d||"END-DATE"===d||"END-ON-NEXT"===d)continue;const a=p[i];if(a)g&&!h.durationKnown&&(a.endTime=u);else if(c){let t=r.attr[i];Su(i)&&(l=t,t=Uint8Array.from(l.replace(/^0x/,"").replace(/([\da-fA-F]{2}) ?/g,"0x$1 ").replace(/ +$/,"").split(" ")).buffer);const a=Nm(c,n,u,{key:i,data:t},Fm);a&&(a.id=e,this.id3Track.addCue(a),p[i]=a)}}i[e]={cues:p,dateRange:r,durationKnown:g}}var l,d}}class Vm{constructor(t){this.hls=void 0,this.config=void 0,this.media=null,this.levelDetails=null,this.currentTime=0,this.stallCount=0,this._latency=null,this.timeupdateHandler=()=>this.timeupdate(),this.hls=t,this.config=t.config,this.registerListeners()}get latency(){return this._latency||0}get maxLatency(){const{config:t,levelDetails:e}=this;return void 0!==t.liveMaxLatencyDuration?t.liveMaxLatencyDuration:e?t.liveMaxLatencyDurationCount*e.targetduration:0}get targetLatency(){const{levelDetails:t}=this;if(null===t)return null;const{holdBack:e,partHoldBack:i,targetduration:r}=t,{liveSyncDuration:a,liveSyncDurationCount:s,lowLatencyMode:n}=this.config,o=this.hls.userConfig;let c=n&&i||e;(o.liveSyncDuration||o.liveSyncDurationCount||0===c)&&(c=void 0!==a?a:s*r);const l=r;return c+Math.min(1*this.stallCount,l)}get liveSyncPosition(){const t=this.estimateLiveEdge(),e=this.targetLatency,i=this.levelDetails;if(null===t||null===e||null===i)return null;const r=i.edge,a=t-e-this.edgeStalled,s=r-i.totalduration,n=r-(this.config.lowLatencyMode&&i.partTarget||i.targetduration);return Math.min(Math.max(s,a),n)}get drift(){const{levelDetails:t}=this;return null===t?1:t.drift}get edgeStalled(){const{levelDetails:t}=this;if(null===t)return 0;const e=3*(this.config.lowLatencyMode&&t.partTarget||t.targetduration);return Math.max(t.age-e,0)}get forwardBufferLength(){const{media:t,levelDetails:e}=this;if(!t||!e)return 0;const i=t.buffered.length;return(i?t.buffered.end(i-1):e.edge)-this.currentTime}destroy(){this.unregisterListeners(),this.onMediaDetaching(),this.levelDetails=null,this.hls=this.timeupdateHandler=null}registerListeners(){this.hls.on(pu.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(pu.MEDIA_DETACHING,this.onMediaDetaching,this),this.hls.on(pu.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.on(pu.LEVEL_UPDATED,this.onLevelUpdated,this),this.hls.on(pu.ERROR,this.onError,this)}unregisterListeners(){this.hls.off(pu.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.off(pu.MEDIA_DETACHING,this.onMediaDetaching,this),this.hls.off(pu.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.off(pu.LEVEL_UPDATED,this.onLevelUpdated,this),this.hls.off(pu.ERROR,this.onError,this)}onMediaAttached(t,e){this.media=e.media,this.media.addEventListener("timeupdate",this.timeupdateHandler)}onMediaDetaching(){this.media&&(this.media.removeEventListener("timeupdate",this.timeupdateHandler),this.media=null)}onManifestLoading(){this.levelDetails=null,this._latency=null,this.stallCount=0}onLevelUpdated(t,{details:e}){this.levelDetails=e,e.advanced&&this.timeupdate(),!e.live&&this.media&&this.media.removeEventListener("timeupdate",this.timeupdateHandler)}onError(t,e){var i;e.details===uu.BUFFER_STALLED_ERROR&&(this.stallCount++,null!=(i=this.levelDetails)&&i.live&&ku.warn("[playback-rate-controller]: Stall detected, adjusting target latency"))}timeupdate(){const{media:t,levelDetails:e}=this;if(!t||!e)return;this.currentTime=t.currentTime;const i=this.computeLatency();if(null===i)return;this._latency=i;const{lowLatencyMode:r,maxLiveSyncPlaybackRate:a}=this.config;if(!r||1===a||!e.live)return;const s=this.targetLatency;if(null===s)return;const n=i-s;if(n<Math.min(this.maxLatency,s+e.targetduration)&&n>.05&&this.forwardBufferLength>1){const e=Math.min(2,Math.max(1,a)),i=Math.round(2/(1+Math.exp(-.75*n-this.edgeStalled))*20)/20;t.playbackRate=Math.min(e,Math.max(1,i))}else 1!==t.playbackRate&&0!==t.playbackRate&&(t.playbackRate=1)}estimateLiveEdge(){const{levelDetails:t}=this;return null===t?null:t.edge+t.age}computeLatency(){const t=this.estimateLiveEdge();return null===t?null:t-this.currentTime}}const qm=["NONE","TYPE-0","TYPE-1",null];const Km=["SDR","PQ","HLG"];var Wm="",Ym="YES",Zm="v2";function Qm(t){const{canSkipUntil:e,canSkipDateRanges:i,age:r}=t;return e&&r<e/2?i?Zm:Ym:Wm}class Jm{constructor(t,e,i){this.msn=void 0,this.part=void 0,this.skip=void 0,this.msn=t,this.part=e,this.skip=i}addDirectives(t){const e=new self.URL(t);return void 0!==this.msn&&e.searchParams.set("_HLS_msn",this.msn.toString()),void 0!==this.part&&e.searchParams.set("_HLS_part",this.part.toString()),this.skip&&e.searchParams.set("_HLS_skip",this.skip),e.href}}class Xm{constructor(t){this._attrs=void 0,this.audioCodec=void 0,this.bitrate=void 0,this.codecSet=void 0,this.url=void 0,this.frameRate=void 0,this.height=void 0,this.id=void 0,this.name=void 0,this.videoCodec=void 0,this.width=void 0,this.details=void 0,this.fragmentError=0,this.loadError=0,this.loaded=void 0,this.realBitrate=0,this.supportedPromise=void 0,this.supportedResult=void 0,this._avgBitrate=0,this._audioGroups=void 0,this._subtitleGroups=void 0,this._urlId=0,this.url=[t.url],this._attrs=[t.attrs],this.bitrate=t.bitrate,t.details&&(this.details=t.details),this.id=t.id||0,this.name=t.name,this.width=t.width||0,this.height=t.height||0,this.frameRate=t.attrs.optionalFloat("FRAME-RATE",0),this._avgBitrate=t.attrs.decimalInteger("AVERAGE-BANDWIDTH"),this.audioCodec=t.audioCodec,this.videoCodec=t.videoCodec,this.codecSet=[t.videoCodec,t.audioCodec].filter((t=>!!t)).map((t=>t.substring(0,4))).join(","),this.addGroupId("audio",t.attrs.AUDIO),this.addGroupId("text",t.attrs.SUBTITLES)}get maxBitrate(){return Math.max(this.realBitrate,this.bitrate)}get averageBitrate(){return this._avgBitrate||this.realBitrate||this.bitrate}get attrs(){return this._attrs[0]}get codecs(){return this.attrs.CODECS||""}get pathwayId(){return this.attrs["PATHWAY-ID"]||"."}get videoRange(){return this.attrs["VIDEO-RANGE"]||"SDR"}get score(){return this.attrs.optionalFloat("SCORE",0)}get uri(){return this.url[0]||""}hasAudioGroup(t){return tv(this._audioGroups,t)}hasSubtitleGroup(t){return tv(this._subtitleGroups,t)}get audioGroups(){return this._audioGroups}get subtitleGroups(){return this._subtitleGroups}addGroupId(t,e){if(e)if("audio"===t){let t=this._audioGroups;t||(t=this._audioGroups=[]),-1===t.indexOf(e)&&t.push(e)}else if("text"===t){let t=this._subtitleGroups;t||(t=this._subtitleGroups=[]),-1===t.indexOf(e)&&t.push(e)}}get urlId(){return 0}set urlId(t){}get audioGroupIds(){return this.audioGroups?[this.audioGroupId]:void 0}get textGroupIds(){return this.subtitleGroups?[this.textGroupId]:void 0}get audioGroupId(){var t;return null==(t=this.audioGroups)?void 0:t[0]}get textGroupId(){var t;return null==(t=this.subtitleGroups)?void 0:t[0]}addFallback(){}}function tv(t,e){return!(!e||!t)&&-1!==t.indexOf(e)}function ev(t,e){const i=e.startPTS;if(lu(i)){let r,a=0;e.sn>t.sn?(a=i-t.start,r=t):(a=t.start-i,r=e),r.duration!==a&&(r.duration=a)}else if(e.sn>t.sn){t.cc===e.cc&&t.minEndPTS?e.start=t.start+(t.minEndPTS-t.start):e.start=t.start+t.duration}else e.start=Math.max(t.start-e.duration,0)}function iv(t,e,i,r,a,s){r-i<=0&&(ku.warn("Fragment should have a positive duration",e),r=i+e.duration,s=a+e.duration);let n=i,o=r;const c=e.startPTS,l=e.endPTS;if(lu(c)){const t=Math.abs(c-i);lu(e.deltaPTS)?e.deltaPTS=Math.max(t,e.deltaPTS):e.deltaPTS=t,n=Math.max(i,c),i=Math.min(i,c),a=Math.min(a,e.startDTS),o=Math.min(r,l),r=Math.max(r,l),s=Math.max(s,e.endDTS)}const d=i-e.start;0!==e.start&&(e.start=i),e.duration=r-e.start,e.startPTS=i,e.maxStartPTS=n,e.startDTS=a,e.endPTS=r,e.minEndPTS=o,e.endDTS=s;const h=e.sn;if(!t||h<t.startSN||h>t.endSN)return 0;let p;const g=h-t.startSN,u=t.fragments;for(u[g]=e,p=g;p>0;p--)ev(u[p],u[p-1]);for(p=g;p<u.length-1;p++)ev(u[p],u[p+1]);return t.fragmentHint&&ev(u[u.length-1],t.fragmentHint),t.PTSKnown=t.alignedSliding=!0,d}function rv(t,e){let i=null;const r=t.fragments;for(let t=r.length-1;t>=0;t--){const e=r[t].initSegment;if(e){i=e;break}}let a;t.fragmentHint&&delete t.fragmentHint.endPTS,function(t,e,i){const r=e.skippedSegments,a=Math.max(t.startSN,e.startSN)-e.startSN,s=(t.fragmentHint?1:0)+(r?e.endSN:Math.min(t.endSN,e.endSN))-e.startSN,n=e.startSN-t.startSN,o=e.fragmentHint?e.fragments.concat(e.fragmentHint):e.fragments,c=t.fragmentHint?t.fragments.concat(t.fragmentHint):t.fragments;for(let t=a;t<=s;t++){const a=c[n+t];let s=o[t];r&&!s&&t<r&&(s=e.fragments[t]=a),a&&s&&i(a,s,t,o)}}(t,e,((t,r,s,n)=>{if(e.skippedSegments&&r.cc!==t.cc){const e=t.cc-r.cc;for(let t=s;t<n.length;t++)n[t].cc+=e}lu(t.startPTS)&&lu(t.endPTS)&&(r.start=r.startPTS=t.startPTS,r.startDTS=t.startDTS,r.maxStartPTS=t.maxStartPTS,r.endPTS=t.endPTS,r.endDTS=t.endDTS,r.minEndPTS=t.minEndPTS,r.duration=t.endPTS-t.startPTS,r.duration&&(a=r),e.PTSKnown=e.alignedSliding=!0),r.elementaryStreams=t.elementaryStreams,r.loader=t.loader,r.stats=t.stats,t.initSegment&&(r.initSegment=t.initSegment,i=t.initSegment)}));const s=e.fragments;if(i){(e.fragmentHint?s.concat(e.fragmentHint):s).forEach((t=>{var e;!t||t.initSegment&&t.initSegment.relurl!==(null==(e=i)?void 0:e.relurl)||(t.initSegment=i)}))}if(e.skippedSegments){if(e.deltaUpdateFailed=s.some((t=>!t)),e.deltaUpdateFailed){ku.warn("[level-helper] Previous playlist missing segments skipped in delta playlist");for(let t=e.skippedSegments;t--;)s.shift();e.startSN=s[0].sn}else e.canSkipDateRanges&&(e.dateRanges=function(t,e,i){const r=cu({},t);i&&i.forEach((t=>{delete r[t]}));return Object.keys(e).forEach((t=>{const i=new Pu(e[t].attr,r[t]);i.isValid?r[t]=i:ku.warn(`Ignoring invalid Playlist Delta Update DATERANGE tag: "${JSON.stringify(e[t].attr)}"`)})),r}(t.dateRanges,e.dateRanges,e.recentlyRemovedDateranges));e.startCC=e.fragments[0].cc,e.endCC=s[s.length-1].cc}!function(t,e,i){if(t&&e){let r=0;for(let a=0,s=t.length;a<=s;a++){const s=t[a],n=e[a+r];s&&n&&s.index===n.index&&s.fragment.sn===n.fragment.sn?i(s,n):r--}}}(t.partList,e.partList,((t,e)=>{e.elementaryStreams=t.elementaryStreams,e.stats=t.stats})),a?iv(e,a,a.startPTS,a.endPTS,a.startDTS,a.endDTS):av(t,e),s.length&&(e.totalduration=e.edge-s[0].start),e.driftStartTime=t.driftStartTime,e.driftStart=t.driftStart;const n=e.advancedDateTime;if(e.advanced&&n){const t=e.edge;e.driftStart||(e.driftStartTime=n,e.driftStart=t),e.driftEndTime=n,e.driftEnd=t}else e.driftEndTime=t.driftEndTime,e.driftEnd=t.driftEnd,e.advancedDateTime=t.advancedDateTime}function av(t,e){const i=e.startSN+e.skippedSegments-t.startSN,r=t.fragments;i<0||i>=r.length||sv(e,r[i].start)}function sv(t,e){if(e){const i=t.fragments;for(let r=t.skippedSegments;r<i.length;r++)i[r].start+=e;t.fragmentHint&&(t.fragmentHint.start+=e)}}function nv(t,e,i){var r;return null!=t&&t.details?ov(null==(r=t.details)?void 0:r.partList,e,i):null}function ov(t,e,i){if(t)for(let r=t.length;r--;){const a=t[r];if(a.index===i&&a.fragment.sn===e)return a}return null}function cv(t){t.forEach(((t,e)=>{const{details:i}=t;null!=i&&i.fragments&&i.fragments.forEach((t=>{t.level=e}))}))}function lv(t){switch(t.details){case uu.FRAG_LOAD_TIMEOUT:case uu.KEY_LOAD_TIMEOUT:case uu.LEVEL_LOAD_TIMEOUT:case uu.MANIFEST_LOAD_TIMEOUT:return!0}return!1}function dv(t,e){const i=lv(e);return t.default[(i?"timeout":"error")+"Retry"]}function hv(t,e){const i="linear"===t.backoff?1:Math.pow(2,e);return Math.min(i*t.retryDelayMs,t.maxRetryDelayMs)}function pv(t){return su(su({},t),{errorRetry:null,timeoutRetry:null})}function gv(t,e,i,r){if(!t)return!1;const a=null==r?void 0:r.code,s=e<t.maxNumRetry&&(function(t){return 0===t&&!1===navigator.onLine||!!t&&(t<400||t>499)}(a)||!!i);return t.shouldRetry?t.shouldRetry(t,e,i,r,s):s}const uv=function(t,e){let i=0,r=t.length-1,a=null,s=null;for(;i<=r;){a=(i+r)/2|0,s=t[a];const n=e(s);if(n>0)i=a+1;else{if(!(n<0))return s;r=a-1}}return null};function fv(t,e,i=0,r=0,a=.005){let s=null;if(t){s=e[t.sn-e[0].sn+1]||null;const r=t.endDTS-i;r>0&&r<15e-7&&(i+=15e-7)}else 0===i&&0===e[0].start&&(s=e[0]);if(s&&((!t||t.level===s.level)&&0===mv(i,r,s)||function(t,e,i){if(e&&0===e.start&&e.level<t.level&&(e.endPTS||0)>0){const r=e.tagList.reduce(((t,e)=>("INF"===e[0]&&(t+=parseFloat(e[1])),t)),i);return t.start<=r}return!1}(s,t,Math.min(a,r))))return s;const n=uv(e,mv.bind(null,i,r));return!n||n===t&&s?s:n}function mv(t=0,e=0,i){if(i.start<=t&&i.start+i.duration>t)return 0;const r=Math.min(e,i.duration+(i.deltaPTS?i.deltaPTS:0));return i.start+i.duration-r<=t?1:i.start-r>t&&i.start?-1:0}function vv(t,e,i){const r=1e3*Math.min(e,i.duration+(i.deltaPTS?i.deltaPTS:0));return(i.endProgramDateTime||0)-r>t}var bv=0,kv=2,yv=3,wv=5,xv=0,Sv=1,Pv=2;class Cv{constructor(t,e){this.hls=void 0,this.timer=-1,this.requestScheduled=-1,this.canLoad=!1,this.log=void 0,this.warn=void 0,this.log=ku.log.bind(ku,`${e}:`),this.warn=ku.warn.bind(ku,`${e}:`),this.hls=t}destroy(){this.clearTimer(),this.hls=this.log=this.warn=null}clearTimer(){-1!==this.timer&&(self.clearTimeout(this.timer),this.timer=-1)}startLoad(){this.canLoad=!0,this.requestScheduled=-1,this.loadPlaylist()}stopLoad(){this.canLoad=!1,this.clearTimer()}switchParams(t,e,i){const r=null==e?void 0:e.renditionReports;if(r){let a=-1;for(let i=0;i<r.length;i++){const s=r[i];let n;try{n=new self.URL(s.URI,e.url).href}catch(t){ku.warn(`Could not construct new URL for Rendition Report: ${t}`),n=s.URI||""}if(n===t){a=i;break}n===t.substring(0,n.length)&&(a=i)}if(-1!==a){const t=r[a],s=parseInt(t["LAST-MSN"])||(null==e?void 0:e.lastPartSn);let n=parseInt(t["LAST-PART"])||(null==e?void 0:e.lastPartIndex);if(this.hls.config.lowLatencyMode){const t=Math.min(e.age-e.partTarget,e.targetduration);n>=0&&t>e.partTarget&&(n+=1)}const o=i&&Qm(i);return new Jm(s,n>=0?n:void 0,o)}}}loadPlaylist(t){-1===this.requestScheduled&&(this.requestScheduled=self.performance.now())}shouldLoadPlaylist(t){return this.canLoad&&!!t&&!!t.url&&(!t.details||t.details.live)}shouldReloadPlaylist(t){return-1===this.timer&&-1===this.requestScheduled&&this.shouldLoadPlaylist(t)}playlistLoaded(t,e,i){const{details:r,stats:a}=e,s=self.performance.now(),n=a.loading.first?Math.max(0,s-a.loading.first):0;if(r.advancedDateTime=Date.now()-n,r.live||null!=i&&i.live){if(r.reloaded(i),i&&this.log(`live playlist ${t} ${r.advanced?"REFRESHED "+r.lastPartSn+"-"+r.lastPartIndex:r.updated?"UPDATED":"MISSED"}`),i&&r.fragments.length>0&&rv(i,r),!this.canLoad||!r.live)return;let n,o,c;if(r.canBlockReload&&r.endSN&&r.advanced){const t=this.hls.config.lowLatencyMode,a=r.lastPartSn,s=r.endSN,l=r.lastPartIndex,d=a===s;-1!==l?(o=d?s+1:a,c=d?t?0:l:l+1):o=s+1;const h=r.age,p=h+r.ageHeader;let g=Math.min(p-r.partTarget,1.5*r.targetduration);if(g>0){if(i&&g>i.tuneInGoal)this.warn(`CDN Tune-in goal increased from: ${i.tuneInGoal} to: ${g} with playlist age: ${r.age}`),g=0;else{const t=Math.floor(g/r.targetduration);if(o+=t,void 0!==c){c+=Math.round(g%r.targetduration/r.partTarget)}this.log(`CDN Tune-in age: ${r.ageHeader}s last advanced ${h.toFixed(2)}s goal: ${g} skip sn ${t} to part ${c}`)}r.tuneInGoal=g}if(n=this.getDeliveryDirectives(r,e.deliveryDirectives,o,c),t||!d)return void this.loadPlaylist(n)}else(r.canBlockReload||r.canSkipUntil)&&(n=this.getDeliveryDirectives(r,e.deliveryDirectives,o,c));const l=this.hls.mainForwardBufferInfo,d=l?l.end-l.len:0,h=function(t,e=1/0){let i=1e3*t.targetduration;if(t.updated){const r=t.fragments,a=4;if(r.length&&i*a>e){const t=1e3*r[r.length-1].duration;t<i&&(i=t)}}else i/=2;return Math.round(i)}(r,1e3*(r.edge-d));r.updated&&s>this.requestScheduled+h&&(this.requestScheduled=a.loading.start),void 0!==o&&r.canBlockReload?this.requestScheduled=a.loading.first+h-(1e3*r.partTarget||1e3):-1===this.requestScheduled||this.requestScheduled+h<s?this.requestScheduled=s:this.requestScheduled-s<=0&&(this.requestScheduled+=h);let p=this.requestScheduled-s;p=Math.max(0,p),this.log(`reload live playlist ${t} in ${Math.round(p)} ms`),this.timer=self.setTimeout((()=>this.loadPlaylist(n)),p)}else this.clearTimer()}getDeliveryDirectives(t,e,i,r){let a=Qm(t);return null!=e&&e.skip&&t.deltaUpdateFailed&&(i=e.msn,r=e.part,a=Wm),new Jm(i,r,a)}checkRetry(t){const e=t.details,i=lv(t),r=t.errorAction,{action:a,retryCount:s=0,retryConfig:n}=r||{},o=!!r&&!!n&&(a===wv||!r.resolved&&a===kv);if(o){var c;if(this.requestScheduled=-1,s>=n.maxNumRetry)return!1;if(i&&null!=(c=t.context)&&c.deliveryDirectives)this.warn(`Retrying playlist loading ${s+1}/${n.maxNumRetry} after "${e}" without delivery-directives`),this.loadPlaylist();else{const t=hv(n,s);this.timer=self.setTimeout((()=>this.loadPlaylist()),t),this.warn(`Retrying playlist loading ${s+1}/${n.maxNumRetry} after "${e}" in ${t}ms`)}t.levelRetry=!0,r.resolved=!0}return o}}class Ev{constructor(t,e=0,i=0){this.halfLife=void 0,this.alpha_=void 0,this.estimate_=void 0,this.totalWeight_=void 0,this.halfLife=t,this.alpha_=t?Math.exp(Math.log(.5)/t):0,this.estimate_=e,this.totalWeight_=i}sample(t,e){const i=Math.pow(this.alpha_,t);this.estimate_=e*(1-i)+i*this.estimate_,this.totalWeight_+=t}getTotalWeight(){return this.totalWeight_}getEstimate(){if(this.alpha_){const t=1-Math.pow(this.alpha_,this.totalWeight_);if(t)return this.estimate_/t}return this.estimate_}}class Tv{constructor(t,e,i,r=100){this.defaultEstimate_=void 0,this.minWeight_=void 0,this.minDelayMs_=void 0,this.slow_=void 0,this.fast_=void 0,this.defaultTTFB_=void 0,this.ttfb_=void 0,this.defaultEstimate_=i,this.minWeight_=.001,this.minDelayMs_=50,this.slow_=new Ev(t),this.fast_=new Ev(e),this.defaultTTFB_=r,this.ttfb_=new Ev(t)}update(t,e){const{slow_:i,fast_:r,ttfb_:a}=this;i.halfLife!==t&&(this.slow_=new Ev(t,i.getEstimate(),i.getTotalWeight())),r.halfLife!==e&&(this.fast_=new Ev(e,r.getEstimate(),r.getTotalWeight())),a.halfLife!==t&&(this.ttfb_=new Ev(t,a.getEstimate(),a.getTotalWeight()))}sample(t,e){const i=(t=Math.max(t,this.minDelayMs_))/1e3,r=8*e/i;this.fast_.sample(i,r),this.slow_.sample(i,r)}sampleTTFB(t){const e=t/1e3,i=Math.sqrt(2)*Math.exp(-Math.pow(e,2)/2);this.ttfb_.sample(i,Math.max(t,5))}canEstimate(){return this.fast_.getTotalWeight()>=this.minWeight_}getEstimate(){return this.canEstimate()?Math.min(this.fast_.getEstimate(),this.slow_.getEstimate()):this.defaultEstimate_}getEstimateTTFB(){return this.ttfb_.getTotalWeight()>=this.minWeight_?this.ttfb_.getEstimate():this.defaultTTFB_}destroy(){}}const Lv={supported:!0,configurations:[],decodingInfoResults:[{supported:!0,powerEfficient:!0,smooth:!0}]},_v={};function Rv(t,e,i,r,a,s){const n=t.audioCodec?t.audioGroups:null,o=null==s?void 0:s.audioCodec,c=null==s?void 0:s.channels,l=c?parseInt(c):o?1/0:2;let d=null;if(null!=n&&n.length)try{d=1===n.length&&n[0]?e.groups[n[0]].channels:n.reduce(((t,i)=>{if(i){const r=e.groups[i];if(!r)throw new Error(`Audio track group ${i} not found`);Object.keys(r.channels).forEach((e=>{t[e]=(t[e]||0)+r.channels[e]}))}return t}),{2:0})}catch(t){return!0}return void 0!==t.videoCodec&&(t.width>1920&&t.height>1088||t.height>1920&&t.width>1088||t.frameRate>Math.max(r,30)||"SDR"!==t.videoRange&&t.videoRange!==i||t.bitrate>Math.max(a,8e6))||!!d&&lu(l)&&Object.keys(d).some((t=>parseInt(t)>l))}function Av(t,e,i){const r=t.videoCodec,a=t.audioCodec;if(!r||!a||!i)return Promise.resolve(Lv);const s={width:t.width,height:t.height,bitrate:Math.ceil(Math.max(.9*t.bitrate,t.averageBitrate)),framerate:t.frameRate||30},n=t.videoRange;"SDR"!==n&&(s.transferFunction=n.toLowerCase());const o=r.split(",").map((t=>({type:"media-source",video:su(su({},s),{},{contentType:im(t,"video")})})));return a&&t.audioGroups&&t.audioGroups.forEach((t=>{var i;t&&(null==(i=e.groups[t])||i.tracks.forEach((e=>{if(e.groupId===t){const t=e.channels||"",i=parseFloat(t);lu(i)&&i>2&&o.push.apply(o,a.split(",").map((t=>({type:"media-source",audio:{contentType:im(t,"audio"),channels:""+i}}))))}})))})),Promise.all(o.map((t=>{const e=function(t){const{audio:e,video:i}=t,r=i||e;if(r){const t=r.contentType.split('"')[1];if(i)return`r${i.height}x${i.width}f${Math.ceil(i.framerate)}${i.transferFunction||"sd"}_${t}_${Math.ceil(i.bitrate/1e5)}`;if(e)return`c${e.channels}${e.spatialRendering?"s":"n"}_${t}`}return""}(t);return _v[e]||(_v[e]=i.decodingInfo(t))}))).then((t=>({supported:!t.some((t=>!t.supported)),configurations:o,decodingInfoResults:t}))).catch((t=>({supported:!1,configurations:o,decodingInfoResults:[],error:t})))}function Dv(t,e){let i=!1,r=[];return t&&(i="SDR"!==t,r=[t]),e&&(r=e.allowedVideoRanges||Km.slice(0),i=void 0!==e.preferHDR?e.preferHDR:function(){if("function"==typeof matchMedia){const t=matchMedia("(dynamic-range: high)"),e=matchMedia("bad query");if(t.media!==e.media)return!0===t.matches}return!1}(),r=i?r.filter((t=>"SDR"!==t)):["SDR"]),{preferHDR:i,allowedVideoRanges:r}}function Mv(t,e){ku.log(`[abr] start candidates with "${t}" ignored because ${e}`)}function Iv(t,e,i){if("attrs"in t){const i=e.indexOf(t);if(-1!==i)return i}for(let r=0;r<e.length;r++){if(Ov(t,e[r],i))return r}return-1}function Ov(t,e,i){const{groupId:r,name:a,lang:s,assocLang:n,default:o}=t,c=t.forced;return(void 0===r||e.groupId===r)&&(void 0===a||e.name===a)&&(void 0===s||e.lang===s)&&(void 0===s||e.assocLang===n)&&(void 0===o||e.default===o)&&(void 0===c||e.forced===c)&&(!("characteristics"in t)||function(t,e=""){const i=t.split(","),r=e.split(",");return i.length===r.length&&!i.some((t=>-1===r.indexOf(t)))}(t.characteristics||"",e.characteristics))&&(void 0===i||i(t,e))}function Uv(t,e){const{audioCodec:i,channels:r}=t;return!(void 0!==i&&(e.audioCodec||"").substring(0,4)!==i.substring(0,4)||void 0!==r&&r!==(e.channels||"2"))}function $v(t,e,i){for(let r=e;r>-1;r--)if(i(t[r]))return r;for(let r=e+1;r<t.length;r++)if(i(t[r]))return r;return-1}class Fv{constructor(){this._boundTick=void 0,this._tickTimer=null,this._tickInterval=null,this._tickCallCount=0,this._boundTick=this.tick.bind(this)}destroy(){this.onHandlerDestroying(),this.onHandlerDestroyed()}onHandlerDestroying(){this.clearNextTick(),this.clearInterval()}onHandlerDestroyed(){}hasInterval(){return!!this._tickInterval}hasNextTick(){return!!this._tickTimer}setInterval(t){return!this._tickInterval&&(this._tickCallCount=0,this._tickInterval=self.setInterval(this._boundTick,t),!0)}clearInterval(){return!!this._tickInterval&&(self.clearInterval(this._tickInterval),this._tickInterval=null,!0)}clearNextTick(){return!!this._tickTimer&&(self.clearTimeout(this._tickTimer),this._tickTimer=null,!0)}tick(){this._tickCallCount++,1===this._tickCallCount&&(this.doTick(),this._tickCallCount>1&&this.tickImmediate(),this._tickCallCount=0)}tickImmediate(){this.clearNextTick(),this._tickTimer=self.setTimeout(this._boundTick,0)}doTick(){}}var jv="NOT_LOADED",zv="APPENDING",Nv="PARTIAL",Bv="OK";class Hv{constructor(t){this.activePartLists=Object.create(null),this.endListFragments=Object.create(null),this.fragments=Object.create(null),this.timeRanges=Object.create(null),this.bufferPadding=.2,this.hls=void 0,this.hasGaps=!1,this.hls=t,this._registerListeners()}_registerListeners(){const{hls:t}=this;t.on(pu.BUFFER_APPENDED,this.onBufferAppended,this),t.on(pu.FRAG_BUFFERED,this.onFragBuffered,this),t.on(pu.FRAG_LOADED,this.onFragLoaded,this)}_unregisterListeners(){const{hls:t}=this;t.off(pu.BUFFER_APPENDED,this.onBufferAppended,this),t.off(pu.FRAG_BUFFERED,this.onFragBuffered,this),t.off(pu.FRAG_LOADED,this.onFragLoaded,this)}destroy(){this._unregisterListeners(),this.fragments=this.activePartLists=this.endListFragments=this.timeRanges=null}getAppendedFrag(t,e){const i=this.activePartLists[e];if(i)for(let e=i.length;e--;){const r=i[e];if(!r)break;const a=r.end;if(r.start<=t&&null!==a&&t<=a)return r}return this.getBufferedFrag(t,e)}getBufferedFrag(t,e){const{fragments:i}=this,r=Object.keys(i);for(let a=r.length;a--;){const s=i[r[a]];if((null==s?void 0:s.body.type)===e&&s.buffered){const e=s.body;if(e.start<=t&&t<=e.end)return e}}return null}detectEvictedFragments(t,e,i,r){this.timeRanges&&(this.timeRanges[t]=e);const a=(null==r?void 0:r.fragment.sn)||-1;Object.keys(this.fragments).forEach((r=>{const s=this.fragments[r];if(!s)return;if(a>=s.body.sn)return;if(!s.buffered&&!s.loaded)return void(s.body.type===i&&this.removeFragment(s.body));const n=s.range[t];n&&n.time.some((t=>{const i=!this.isTimeBuffered(t.startPTS,t.endPTS,e);return i&&this.removeFragment(s.body),i}))}))}detectPartialFragments(t){const e=this.timeRanges,{frag:i,part:r}=t;if(!e||"initSegment"===i.sn)return;const a=Vv(i),s=this.fragments[a];if(!s||s.buffered&&i.gap)return;const n=!i.relurl;if(Object.keys(e).forEach((t=>{const a=i.elementaryStreams[t];if(!a)return;const o=e[t],c=n||!0===a.partial;s.range[t]=this.getBufferedTimes(i,r,c,o)})),s.loaded=null,Object.keys(s.range).length){s.buffered=!0;(s.body.endList=i.endList||s.body.endList)&&(this.endListFragments[s.body.type]=s),Gv(s)||this.removeParts(i.sn-1,i.type)}else this.removeFragment(s.body)}removeParts(t,e){const i=this.activePartLists[e];i&&(this.activePartLists[e]=i.filter((e=>e.fragment.sn>=t)))}fragBuffered(t,e){const i=Vv(t);let r=this.fragments[i];!r&&e&&(r=this.fragments[i]={body:t,appendedPTS:null,loaded:null,buffered:!1,range:Object.create(null)},t.gap&&(this.hasGaps=!0)),r&&(r.loaded=null,r.buffered=!0)}getBufferedTimes(t,e,i,r){const a={time:[],partial:i},s=t.start,n=t.end,o=t.minEndPTS||n,c=t.maxStartPTS||s;for(let t=0;t<r.length;t++){const e=r.start(t)-this.bufferPadding,i=r.end(t)+this.bufferPadding;if(c>=e&&o<=i){a.time.push({startPTS:Math.max(s,r.start(t)),endPTS:Math.min(n,r.end(t))});break}if(s<i&&n>e){const e=Math.max(s,r.start(t)),i=Math.min(n,r.end(t));i>e&&(a.partial=!0,a.time.push({startPTS:e,endPTS:i}))}else if(n<=e)break}return a}getPartialFragment(t){let e,i,r,a=null,s=0;const{bufferPadding:n,fragments:o}=this;return Object.keys(o).forEach((c=>{const l=o[c];l&&Gv(l)&&(i=l.body.start-n,r=l.body.end+n,t>=i&&t<=r&&(e=Math.min(t-i,r-t),s<=e&&(a=l.body,s=e)))})),a}isEndListAppended(t){const e=this.endListFragments[t];return void 0!==e&&(e.buffered||Gv(e))}getState(t){const e=Vv(t),i=this.fragments[e];return i?i.buffered?Gv(i)?Nv:Bv:zv:jv}isTimeBuffered(t,e,i){let r,a;for(let s=0;s<i.length;s++){if(r=i.start(s)-this.bufferPadding,a=i.end(s)+this.bufferPadding,t>=r&&e<=a)return!0;if(e<=r)return!1}return!1}onFragLoaded(t,e){const{frag:i,part:r}=e;if("initSegment"===i.sn||i.bitrateTest)return;const a=r?null:e,s=Vv(i);this.fragments[s]={body:i,appendedPTS:null,loaded:a,buffered:!1,range:Object.create(null)}}onBufferAppended(t,e){const{frag:i,part:r,timeRanges:a}=e;if("initSegment"===i.sn)return;const s=i.type;if(r){let t=this.activePartLists[s];t||(this.activePartLists[s]=t=[]),t.push(r)}this.timeRanges=a,Object.keys(a).forEach((t=>{const e=a[t];this.detectEvictedFragments(t,e,s,r)}))}onFragBuffered(t,e){this.detectPartialFragments(e)}hasFragment(t){const e=Vv(t);return!!this.fragments[e]}hasParts(t){var e;return!(null==(e=this.activePartLists[t])||!e.length)}removeFragmentsInRange(t,e,i,r,a){r&&!this.hasGaps||Object.keys(this.fragments).forEach((s=>{const n=this.fragments[s];if(!n)return;const o=n.body;o.type!==i||r&&!o.gap||o.start<e&&o.end>t&&(n.buffered||a)&&this.removeFragment(o)}))}removeFragment(t){const e=Vv(t);t.stats.loaded=0,t.clearElementaryStreamInfo();const i=this.activePartLists[t.type];if(i){const e=t.sn;this.activePartLists[t.type]=i.filter((t=>t.fragment.sn!==e))}delete this.fragments[e],t.endList&&delete this.endListFragments[t.type]}removeAllFragments(){this.fragments=Object.create(null),this.endListFragments=Object.create(null),this.activePartLists=Object.create(null),this.hasGaps=!1}}function Gv(t){var e,i,r;return t.buffered&&(t.body.gap||(null==(e=t.range.video)?void 0:e.partial)||(null==(i=t.range.audio)?void 0:i.partial)||(null==(r=t.range.audiovideo)?void 0:r.partial))}function Vv(t){return`${t.type}_${t.level}_${t.sn}`}const qv={length:0,start:()=>0,end:()=>0};class Kv{static isBuffered(t,e){try{if(t){const i=Kv.getBuffered(t);for(let t=0;t<i.length;t++)if(e>=i.start(t)&&e<=i.end(t))return!0}}catch(t){}return!1}static bufferInfo(t,e,i){try{if(t){const r=Kv.getBuffered(t),a=[];let s;for(s=0;s<r.length;s++)a.push({start:r.start(s),end:r.end(s)});return this.bufferedInfo(a,e,i)}}catch(t){}return{len:0,start:e,end:e,nextStart:void 0}}static bufferedInfo(t,e,i){e=Math.max(0,e),t.sort((function(t,e){const i=t.start-e.start;return i||e.end-t.end}));let r=[];if(i)for(let e=0;e<t.length;e++){const a=r.length;if(a){const s=r[a-1].end;t[e].start-s<i?t[e].end>s&&(r[a-1].end=t[e].end):r.push(t[e])}else r.push(t[e])}else r=t;let a,s=0,n=e,o=e;for(let t=0;t<r.length;t++){const c=r[t].start,l=r[t].end;if(e+i>=c&&e<l)n=c,o=l,s=o-e;else if(e+i<c){a=c;break}}return{len:s,start:n||0,end:o||0,nextStart:a}}static getBuffered(t){try{return t.buffered}catch(t){return ku.log("failed to get media.buffered",t),qv}}}class Wv{constructor(t,e,i,r=0,a=-1,s=!1){this.level=void 0,this.sn=void 0,this.part=void 0,this.id=void 0,this.size=void 0,this.partial=void 0,this.transmuxing={start:0,executeStart:0,executeEnd:0,end:0},this.buffering={audio:{start:0,executeStart:0,executeEnd:0,end:0},video:{start:0,executeStart:0,executeEnd:0,end:0},audiovideo:{start:0,executeStart:0,executeEnd:0,end:0}},this.level=t,this.sn=e,this.id=i,this.size=r,this.part=a,this.partial=s}}function Yv(t,e){for(let r=0,a=t.length;r<a;r++){var i;if((null==(i=t[r])?void 0:i.cc)===e)return t[r]}return null}function Zv(t,e){if(t){const i=t.start+e;t.start=t.startPTS=i,t.endPTS=i+t.duration}}function Qv(t,e){const i=e.fragments;for(let e=0,r=i.length;e<r;e++)Zv(i[e],t);e.fragmentHint&&Zv(e.fragmentHint,t),e.alignedSliding=!0}function Jv(t,e,i){e&&(!function(t,e,i){if(function(t,e,i){return!(!e||!(i.endCC>i.startCC||t&&t.cc<i.startCC))}(t,i,e)){const t=function(t,e){const i=t.fragments,r=e.fragments;if(!r.length||!i.length)return void ku.log("No fragments to align");const a=Yv(i,r[0].cc);if(a&&(!a||a.startPTS))return a;ku.log("No frag in previous level to align on")}(i,e);t&&lu(t.start)&&(ku.log(`Adjusting PTS using last level due to CC increase within current level ${e.url}`),Qv(t.start,e))}}(t,i,e),!i.alignedSliding&&e&&Xv(i,e),i.alignedSliding||!e||i.skippedSegments||av(e,i))}function Xv(t,e){if(!t.hasProgramDateTime||!e.hasProgramDateTime)return;const i=t.fragments,r=e.fragments;if(!i.length||!r.length)return;let a,s;const n=Math.min(e.endCC,t.endCC);e.startCC<n&&t.startCC<n&&(a=Yv(r,n),s=Yv(i,n)),a&&s||(a=r[Math.floor(r.length/2)],s=Yv(i,a.cc)||i[Math.floor(i.length/2)]);const o=a.programDateTime,c=s.programDateTime;if(!o||!c)return;Qv((c-o)/1e3-(s.start-a.start),t)}const tb=Math.pow(2,17);class eb{constructor(t){this.config=void 0,this.loader=null,this.partLoadTimeout=-1,this.config=t}destroy(){this.loader&&(this.loader.destroy(),this.loader=null)}abort(){this.loader&&this.loader.abort()}load(t,e){const i=t.url;if(!i)return Promise.reject(new ab({type:gu.NETWORK_ERROR,details:uu.FRAG_LOAD_ERROR,fatal:!1,frag:t,error:new Error("Fragment does not have a "+(i?"part list":"url")),networkDetails:null}));this.abort();const r=this.config,a=r.fLoader,s=r.loader;return new Promise(((n,o)=>{if(this.loader&&this.loader.destroy(),t.gap){if(t.tagList.some((t=>"GAP"===t[0])))return void o(rb(t));t.gap=!1}const c=this.loader=t.loader=a?new a(r):new s(r),l=ib(t),d=pv(r.fragLoadPolicy.default),h={loadPolicy:d,timeout:d.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0,highWaterMark:"initSegment"===t.sn?1/0:tb};t.stats=c.stats,c.load(l,h,{onSuccess:(e,i,r,a)=>{this.resetLoader(t,c);let s=e.data;r.resetIV&&t.decryptdata&&(t.decryptdata.iv=new Uint8Array(s.slice(0,16)),s=s.slice(16)),n({frag:t,part:null,payload:s,networkDetails:a})},onError:(e,r,a,s)=>{this.resetLoader(t,c),o(new ab({type:gu.NETWORK_ERROR,details:uu.FRAG_LOAD_ERROR,fatal:!1,frag:t,response:su({url:i,data:void 0},e),error:new Error(`HTTP Error ${e.code} ${e.text}`),networkDetails:a,stats:s}))},onAbort:(e,i,r)=>{this.resetLoader(t,c),o(new ab({type:gu.NETWORK_ERROR,details:uu.INTERNAL_ABORTED,fatal:!1,frag:t,error:new Error("Aborted"),networkDetails:r,stats:e}))},onTimeout:(e,i,r)=>{this.resetLoader(t,c),o(new ab({type:gu.NETWORK_ERROR,details:uu.FRAG_LOAD_TIMEOUT,fatal:!1,frag:t,error:new Error(`Timeout after ${h.timeout}ms`),networkDetails:r,stats:e}))},onProgress:(i,r,a,s)=>{e&&e({frag:t,part:null,payload:a,networkDetails:s})}})}))}loadPart(t,e,i){this.abort();const r=this.config,a=r.fLoader,s=r.loader;return new Promise(((n,o)=>{if(this.loader&&this.loader.destroy(),t.gap||e.gap)return void o(rb(t,e));const c=this.loader=t.loader=a?new a(r):new s(r),l=ib(t,e),d=pv(r.fragLoadPolicy.default),h={loadPolicy:d,timeout:d.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0,highWaterMark:tb};e.stats=c.stats,c.load(l,h,{onSuccess:(r,a,s,o)=>{this.resetLoader(t,c),this.updateStatsFromPart(t,e);const l={frag:t,part:e,payload:r.data,networkDetails:o};i(l),n(l)},onError:(i,r,a,s)=>{this.resetLoader(t,c),o(new ab({type:gu.NETWORK_ERROR,details:uu.FRAG_LOAD_ERROR,fatal:!1,frag:t,part:e,response:su({url:l.url,data:void 0},i),error:new Error(`HTTP Error ${i.code} ${i.text}`),networkDetails:a,stats:s}))},onAbort:(i,r,a)=>{t.stats.aborted=e.stats.aborted,this.resetLoader(t,c),o(new ab({type:gu.NETWORK_ERROR,details:uu.INTERNAL_ABORTED,fatal:!1,frag:t,part:e,error:new Error("Aborted"),networkDetails:a,stats:i}))},onTimeout:(i,r,a)=>{this.resetLoader(t,c),o(new ab({type:gu.NETWORK_ERROR,details:uu.FRAG_LOAD_TIMEOUT,fatal:!1,frag:t,part:e,error:new Error(`Timeout after ${h.timeout}ms`),networkDetails:a,stats:i}))}})}))}updateStatsFromPart(t,e){const i=t.stats,r=e.stats,a=r.total;if(i.loaded+=r.loaded,a){const r=Math.round(t.duration/e.duration),s=Math.min(Math.round(i.loaded/a),r),n=(r-s)*Math.round(i.loaded/s);i.total=i.loaded+n}else i.total=Math.max(i.loaded,i.total);const s=i.loading,n=r.loading;s.start?s.first+=n.first-n.start:(s.start=n.start,s.first=n.first),s.end=n.end}resetLoader(t,e){t.loader=null,this.loader===e&&(self.clearTimeout(this.partLoadTimeout),this.loader=null),e.destroy()}}function ib(t,e=null){const i=e||t,r={frag:t,part:e,responseType:"arraybuffer",url:i.url,headers:{},rangeStart:0,rangeEnd:0},a=i.byteRangeStartOffset,s=i.byteRangeEndOffset;if(lu(a)&&lu(s)){var n;let e=a,i=s;if("initSegment"===t.sn&&"AES-128"===(null==(n=t.decryptdata)?void 0:n.method)){const t=s-a;t%16&&(i=s+(16-t%16)),0!==a&&(r.resetIV=!0,e=a-16)}r.rangeStart=e,r.rangeEnd=i}return r}function rb(t,e){const i=new Error(`GAP ${t.gap?"tag":"attribute"} found`),r={type:gu.MEDIA_ERROR,details:uu.FRAG_GAP,fatal:!1,frag:t,error:i,networkDetails:null};return e&&(r.part=e),(e||t).stats.aborted=!0,new ab(r)}class ab extends Error{constructor(t){super(t.error.message),this.data=void 0,this.data=t}}class sb{constructor(t,e){this.subtle=void 0,this.aesIV=void 0,this.subtle=t,this.aesIV=e}decrypt(t,e){return this.subtle.decrypt({name:"AES-CBC",iv:this.aesIV},e,t)}}class nb{constructor(t,e){this.subtle=void 0,this.key=void 0,this.subtle=t,this.key=e}expandKey(){return this.subtle.importKey("raw",this.key,{name:"AES-CBC"},!1,["encrypt","decrypt"])}}class ob{constructor(){this.rcon=[0,1,2,4,8,16,32,64,128,27,54],this.subMix=[new Uint32Array(256),new Uint32Array(256),new Uint32Array(256),new Uint32Array(256)],this.invSubMix=[new Uint32Array(256),new Uint32Array(256),new Uint32Array(256),new Uint32Array(256)],this.sBox=new Uint32Array(256),this.invSBox=new Uint32Array(256),this.key=new Uint32Array(0),this.ksRows=0,this.keySize=0,this.keySchedule=void 0,this.invKeySchedule=void 0,this.initTable()}uint8ArrayToUint32Array_(t){const e=new DataView(t),i=new Uint32Array(4);for(let t=0;t<4;t++)i[t]=e.getUint32(4*t);return i}initTable(){const t=this.sBox,e=this.invSBox,i=this.subMix,r=i[0],a=i[1],s=i[2],n=i[3],o=this.invSubMix,c=o[0],l=o[1],d=o[2],h=o[3],p=new Uint32Array(256);let g=0,u=0,f=0;for(f=0;f<256;f++)p[f]=f<128?f<<1:f<<1^283;for(f=0;f<256;f++){let i=u^u<<1^u<<2^u<<3^u<<4;i=i>>>8^255&i^99,t[g]=i,e[i]=g;const o=p[g],f=p[o],m=p[f];let v=257*p[i]^16843008*i;r[g]=v<<24|v>>>8,a[g]=v<<16|v>>>16,s[g]=v<<8|v>>>24,n[g]=v,v=16843009*m^65537*f^257*o^16843008*g,c[i]=v<<24|v>>>8,l[i]=v<<16|v>>>16,d[i]=v<<8|v>>>24,h[i]=v,g?(g=o^p[p[p[m^o]]],u^=p[p[u]]):g=u=1}}expandKey(t){const e=this.uint8ArrayToUint32Array_(t);let i=!0,r=0;for(;r<e.length&&i;)i=e[r]===this.key[r],r++;if(i)return;this.key=e;const a=this.keySize=e.length;if(4!==a&&6!==a&&8!==a)throw new Error("Invalid aes key size="+a);const s=this.ksRows=4*(a+6+1);let n,o;const c=this.keySchedule=new Uint32Array(s),l=this.invKeySchedule=new Uint32Array(s),d=this.sBox,h=this.rcon,p=this.invSubMix,g=p[0],u=p[1],f=p[2],m=p[3];let v,b;for(n=0;n<s;n++)n<a?v=c[n]=e[n]:(b=v,n%a==0?(b=b<<8|b>>>24,b=d[b>>>24]<<24|d[b>>>16&255]<<16|d[b>>>8&255]<<8|d[255&b],b^=h[n/a|0]<<24):a>6&&n%a==4&&(b=d[b>>>24]<<24|d[b>>>16&255]<<16|d[b>>>8&255]<<8|d[255&b]),c[n]=v=(c[n-a]^b)>>>0);for(o=0;o<s;o++)n=s-o,b=3&o?c[n]:c[n-4],l[o]=o<4||n<=4?b:g[d[b>>>24]]^u[d[b>>>16&255]]^f[d[b>>>8&255]]^m[d[255&b]],l[o]=l[o]>>>0}networkToHostOrderSwap(t){return t<<24|(65280&t)<<8|(16711680&t)>>8|t>>>24}decrypt(t,e,i){const r=this.keySize+6,a=this.invKeySchedule,s=this.invSBox,n=this.invSubMix,o=n[0],c=n[1],l=n[2],d=n[3],h=this.uint8ArrayToUint32Array_(i);let p=h[0],g=h[1],u=h[2],f=h[3];const m=new Int32Array(t),v=new Int32Array(m.length);let b,k,y,w,x,S,P,C,E,T,L,_,R,A;const D=this.networkToHostOrderSwap;for(;e<m.length;){for(E=D(m[e]),T=D(m[e+1]),L=D(m[e+2]),_=D(m[e+3]),x=E^a[0],S=_^a[1],P=L^a[2],C=T^a[3],R=4,A=1;A<r;A++)b=o[x>>>24]^c[S>>16&255]^l[P>>8&255]^d[255&C]^a[R],k=o[S>>>24]^c[P>>16&255]^l[C>>8&255]^d[255&x]^a[R+1],y=o[P>>>24]^c[C>>16&255]^l[x>>8&255]^d[255&S]^a[R+2],w=o[C>>>24]^c[x>>16&255]^l[S>>8&255]^d[255&P]^a[R+3],x=b,S=k,P=y,C=w,R+=4;b=s[x>>>24]<<24^s[S>>16&255]<<16^s[P>>8&255]<<8^s[255&C]^a[R],k=s[S>>>24]<<24^s[P>>16&255]<<16^s[C>>8&255]<<8^s[255&x]^a[R+1],y=s[P>>>24]<<24^s[C>>16&255]<<16^s[x>>8&255]<<8^s[255&S]^a[R+2],w=s[C>>>24]<<24^s[x>>16&255]<<16^s[S>>8&255]<<8^s[255&P]^a[R+3],v[e]=D(b^p),v[e+1]=D(w^g),v[e+2]=D(y^u),v[e+3]=D(k^f),p=E,g=T,u=L,f=_,e+=4}return v.buffer}}class cb{constructor(t,{removePKCS7Padding:e=!0}={}){if(this.logEnabled=!0,this.removePKCS7Padding=void 0,this.subtle=null,this.softwareDecrypter=null,this.key=null,this.fastAesKey=null,this.remainderData=null,this.currentIV=null,this.currentResult=null,this.useSoftware=void 0,this.useSoftware=t.enableSoftwareAES,this.removePKCS7Padding=e,e)try{const t=self.crypto;t&&(this.subtle=t.subtle||t.webkitSubtle)}catch(t){}this.useSoftware=!this.subtle}destroy(){this.subtle=null,this.softwareDecrypter=null,this.key=null,this.fastAesKey=null,this.remainderData=null,this.currentIV=null,this.currentResult=null}isSync(){return this.useSoftware}flush(){const{currentResult:t,remainderData:e}=this;if(!t||e)return this.reset(),null;const i=new Uint8Array(t);return this.reset(),this.removePKCS7Padding?function(t){const e=t.byteLength,i=e&&new DataView(t.buffer).getUint8(e-1);return i?Xu(t,0,e-i):t}(i):i}reset(){this.currentResult=null,this.currentIV=null,this.remainderData=null,this.softwareDecrypter&&(this.softwareDecrypter=null)}decrypt(t,e,i){return this.useSoftware?new Promise(((r,a)=>{this.softwareDecrypt(new Uint8Array(t),e,i);const s=this.flush();s?r(s.buffer):a(new Error("[softwareDecrypt] Failed to decrypt data"))})):this.webCryptoDecrypt(new Uint8Array(t),e,i)}softwareDecrypt(t,e,i){const{currentIV:r,currentResult:a,remainderData:s}=this;this.logOnce("JS AES decrypt"),s&&(t=$f(s,t),this.remainderData=null);const n=this.getValidChunk(t);if(!n.length)return null;r&&(i=r);let o=this.softwareDecrypter;o||(o=this.softwareDecrypter=new ob),o.expandKey(e);const c=a;return this.currentResult=o.decrypt(n.buffer,0,i),this.currentIV=Xu(n,-16).buffer,c||null}webCryptoDecrypt(t,e,i){if(this.key!==e||!this.fastAesKey){if(!this.subtle)return Promise.resolve(this.onWebCryptoError(t,e,i));this.key=e,this.fastAesKey=new nb(this.subtle,e)}return this.fastAesKey.expandKey().then((e=>{if(!this.subtle)return Promise.reject(new Error("web crypto not initialized"));this.logOnce("WebCrypto AES decrypt");return new sb(this.subtle,new Uint8Array(i)).decrypt(t.buffer,e)})).catch((r=>(ku.warn(`[decrypter]: WebCrypto Error, disable WebCrypto API, ${r.name}: ${r.message}`),this.onWebCryptoError(t,e,i))))}onWebCryptoError(t,e,i){this.useSoftware=!0,this.logEnabled=!0,this.softwareDecrypt(t,e,i);const r=this.flush();if(r)return r.buffer;throw new Error("WebCrypto and softwareDecrypt: failed to decrypt data")}getValidChunk(t){let e=t;const i=t.length-t.length%16;return i!==t.length&&(e=Xu(t,0,i),this.remainderData=Xu(t,i)),e}logOnce(t){this.logEnabled&&(ku.log(`[decrypter]: ${t}`),this.logEnabled=!1)}}const lb=function(t){let e="";const i=t.length;for(let r=0;r<i;r++)e+=`[${t.start(r).toFixed(3)}-${t.end(r).toFixed(3)}]`;return e},db="STOPPED",hb="IDLE",pb="KEY_LOADING",gb="FRAG_LOADING",ub="FRAG_LOADING_WAITING_RETRY",fb="WAITING_TRACK",mb="PARSING",vb="PARSED",bb="ENDED",kb="ERROR",yb="WAITING_INIT_PTS",wb="WAITING_LEVEL";class xb extends Fv{constructor(t,e,i,r,a){super(),this.hls=void 0,this.fragPrevious=null,this.fragCurrent=null,this.fragmentTracker=void 0,this.transmuxer=null,this._state=db,this.playlistType=void 0,this.media=null,this.mediaBuffer=null,this.config=void 0,this.bitrateTest=!1,this.lastCurrentTime=0,this.nextLoadPosition=0,this.startPosition=0,this.startTimeOffset=null,this.loadedmetadata=!1,this.retryDate=0,this.levels=null,this.fragmentLoader=void 0,this.keyLoader=void 0,this.levelLastLoaded=null,this.startFragRequested=!1,this.decrypter=void 0,this.initPTS=[],this.buffering=!0,this.onvseeking=null,this.onvended=null,this.logPrefix="",this.log=void 0,this.warn=void 0,this.playlistType=a,this.logPrefix=r,this.log=ku.log.bind(ku,`${r}:`),this.warn=ku.warn.bind(ku,`${r}:`),this.hls=t,this.fragmentLoader=new eb(t.config),this.keyLoader=i,this.fragmentTracker=e,this.config=t.config,this.decrypter=new cb(t.config),t.on(pu.MANIFEST_LOADED,this.onManifestLoaded,this)}doTick(){this.onTickEnd()}onTickEnd(){}startLoad(t){}stopLoad(){this.fragmentLoader.abort(),this.keyLoader.abort(this.playlistType);const t=this.fragCurrent;null!=t&&t.loader&&(t.abortRequests(),this.fragmentTracker.removeFragment(t)),this.resetTransmuxer(),this.fragCurrent=null,this.fragPrevious=null,this.clearInterval(),this.clearNextTick(),this.state=db}pauseBuffering(){this.buffering=!1}resumeBuffering(){this.buffering=!0}_streamEnded(t,e){if(e.live||t.nextStart||!t.end||!this.media)return!1;const i=e.partList;if(null!=i&&i.length){const t=i[i.length-1];return Kv.isBuffered(this.media,t.start+t.duration/2)}const r=e.fragments[e.fragments.length-1].type;return this.fragmentTracker.isEndListAppended(r)}getLevelDetails(){var t;if(this.levels&&null!==this.levelLastLoaded)return null==(t=this.levelLastLoaded)?void 0:t.details}onMediaAttached(t,e){const i=this.media=this.mediaBuffer=e.media;this.onvseeking=this.onMediaSeeking.bind(this),this.onvended=this.onMediaEnded.bind(this),i.addEventListener("seeking",this.onvseeking),i.addEventListener("ended",this.onvended);const r=this.config;this.levels&&r.autoStartLoad&&this.state===db&&this.startLoad(r.startPosition)}onMediaDetaching(){const t=this.media;null!=t&&t.ended&&(this.log("MSE detaching and video ended, reset startPosition"),this.startPosition=this.lastCurrentTime=0),t&&this.onvseeking&&this.onvended&&(t.removeEventListener("seeking",this.onvseeking),t.removeEventListener("ended",this.onvended),this.onvseeking=this.onvended=null),this.keyLoader&&this.keyLoader.detach(),this.media=this.mediaBuffer=null,this.loadedmetadata=!1,this.fragmentTracker.removeAllFragments(),this.stopLoad()}onMediaSeeking(){const{config:t,fragCurrent:e,media:i,mediaBuffer:r,state:a}=this,s=i?i.currentTime:0,n=Kv.bufferInfo(r||i,s,t.maxBufferHole);if(this.log(`media seeking to ${lu(s)?s.toFixed(3):s}, state: ${a}`),this.state===bb)this.resetLoadingState();else if(e){const i=t.maxFragLookUpTolerance,r=e.start-i,a=e.start+e.duration+i;if(!n.len||a<n.start||r>n.end){const t=s>a;(s<r||t)&&(t&&e.loader&&(this.log("seeking outside of buffer while fragment load in progress, cancel fragment load"),e.abortRequests(),this.resetLoadingState()),this.fragPrevious=null)}}i&&(this.fragmentTracker.removeFragmentsInRange(s,1/0,this.playlistType,!0),this.lastCurrentTime=s),this.loadedmetadata||n.len||(this.nextLoadPosition=this.startPosition=s),this.tickImmediate()}onMediaEnded(){this.startPosition=this.lastCurrentTime=0}onManifestLoaded(t,e){this.startTimeOffset=e.startTimeOffset,this.initPTS=[]}onHandlerDestroying(){this.hls.off(pu.MANIFEST_LOADED,this.onManifestLoaded,this),this.stopLoad(),super.onHandlerDestroying(),this.hls=null}onHandlerDestroyed(){this.state=db,this.fragmentLoader&&this.fragmentLoader.destroy(),this.keyLoader&&this.keyLoader.destroy(),this.decrypter&&this.decrypter.destroy(),this.hls=this.log=this.warn=this.decrypter=this.keyLoader=this.fragmentLoader=this.fragmentTracker=null,super.onHandlerDestroyed()}loadFragment(t,e,i){this._loadFragForPlayback(t,e,i)}_loadFragForPlayback(t,e,i){this._doFragLoad(t,e,i,(e=>{if(this.fragContextChanged(t))return this.warn(`Fragment ${t.sn}${e.part?" p: "+e.part.index:""} of level ${t.level} was dropped during download.`),void this.fragmentTracker.removeFragment(t);t.stats.chunkCount++,this._handleFragmentLoadProgress(e)})).then((e=>{if(!e)return;const i=this.state;this.fragContextChanged(t)?(i===gb||!this.fragCurrent&&i===mb)&&(this.fragmentTracker.removeFragment(t),this.state=hb):("payload"in e&&(this.log(`Loaded fragment ${t.sn} of level ${t.level}`),this.hls.trigger(pu.FRAG_LOADED,e)),this._handleFragmentLoadComplete(e))})).catch((e=>{this.state!==db&&this.state!==kb&&(this.warn(`Frag error: ${(null==e?void 0:e.message)||e}`),this.resetFragmentLoading(t))}))}clearTrackerIfNeeded(t){var e;const{fragmentTracker:i}=this;if(i.getState(t)===zv){const e=t.type,r=this.getFwdBufferInfo(this.mediaBuffer,e),a=Math.max(t.duration,r?r.len:this.config.maxBufferLength),s=this.backtrackFragment;(1===(s?t.sn-s.sn:0)||this.reduceMaxBufferLength(a,t.duration))&&i.removeFragment(t)}else 0===(null==(e=this.mediaBuffer)?void 0:e.buffered.length)?i.removeAllFragments():i.hasParts(t.type)&&(i.detectPartialFragments({frag:t,part:null,stats:t.stats,id:t.type}),i.getState(t)===Nv&&i.removeFragment(t))}checkLiveUpdate(t){if(t.updated&&!t.live){const e=t.fragments[t.fragments.length-1];this.fragmentTracker.detectPartialFragments({frag:e,part:null,stats:e.stats,id:e.type})}t.fragments[0]||(t.deltaUpdateFailed=!0)}flushMainBuffer(t,e,i=null){if(!(t-e))return;const r={startOffset:t,endOffset:e,type:i};this.hls.trigger(pu.BUFFER_FLUSHING,r)}_loadInitSegment(t,e){this._doFragLoad(t,e).then((e=>{if(!e||this.fragContextChanged(t)||!this.levels)throw new Error("init load aborted");return e})).then((e=>{const{hls:i}=this,{payload:r}=e,a=t.decryptdata;if(r&&r.byteLength>0&&null!=a&&a.key&&a.iv&&"AES-128"===a.method){const s=self.performance.now();return this.decrypter.decrypt(new Uint8Array(r),a.key.buffer,a.iv.buffer).catch((e=>{throw i.trigger(pu.ERROR,{type:gu.MEDIA_ERROR,details:uu.FRAG_DECRYPT_ERROR,fatal:!1,error:e,reason:e.message,frag:t}),e})).then((r=>{const a=self.performance.now();return i.trigger(pu.FRAG_DECRYPTED,{frag:t,payload:r,stats:{tstart:s,tdecrypt:a}}),e.payload=r,this.completeInitSegmentLoad(e)}))}return this.completeInitSegmentLoad(e)})).catch((e=>{this.state!==db&&this.state!==kb&&(this.warn(e),this.resetFragmentLoading(t))}))}completeInitSegmentLoad(t){const{levels:e}=this;if(!e)throw new Error("init load aborted, missing levels");const i=t.frag.stats;this.state=hb,t.frag.data=new Uint8Array(t.payload),i.parsing.start=i.buffering.start=self.performance.now(),i.parsing.end=i.buffering.end=self.performance.now(),this.tick()}fragContextChanged(t){const{fragCurrent:e}=this;return!t||!e||t.sn!==e.sn||t.level!==e.level}fragBufferedComplete(t,e){var i,r,a,s;const n=this.mediaBuffer?this.mediaBuffer:this.media;if(this.log(`Buffered ${t.type} sn: ${t.sn}${e?" part: "+e.index:""} of ${this.playlistType===Em?"level":"track"} ${t.level} (frag:[${(null!=(i=t.startPTS)?i:NaN).toFixed(3)}-${(null!=(r=t.endPTS)?r:NaN).toFixed(3)}] > buffer:${n?lb(Kv.getBuffered(n)):"(detached)"})`),"initSegment"!==t.sn){var o;if(t.type!==Lm){const e=t.elementaryStreams;if(!Object.keys(e).some((t=>!!e[t])))return void(this.state=hb)}const e=null==(o=this.levels)?void 0:o[t.level];null!=e&&e.fragmentError&&(this.log(`Resetting level fragment error count of ${e.fragmentError} on frag buffered`),e.fragmentError=0)}this.state=hb,n&&(!this.loadedmetadata&&t.type==Em&&n.buffered.length&&(null==(a=this.fragCurrent)?void 0:a.sn)===(null==(s=this.fragPrevious)?void 0:s.sn)&&(this.loadedmetadata=!0,this.seekToStartPos()),this.tick())}seekToStartPos(){}_handleFragmentLoadComplete(t){const{transmuxer:e}=this;if(!e)return;const{frag:i,part:r,partsLoaded:a}=t,s=!a||0===a.length||a.some((t=>!t)),n=new Wv(i.level,i.sn,i.stats.chunkCount+1,0,r?r.index:-1,!s);e.flush(n)}_handleFragmentLoadProgress(t){}_doFragLoad(t,e,i=null,r){var a;const s=null==e?void 0:e.details;if(!this.levels||!s)throw new Error(`frag load aborted, missing level${s?"":" detail"}s`);let n=null;if(!t.encrypted||null!=(a=t.decryptdata)&&a.key?!t.encrypted&&s.encryptedFragments.length&&this.keyLoader.loadClear(t,s.encryptedFragments):(this.log(`Loading key for ${t.sn} of [${s.startSN}-${s.endSN}], ${"[stream-controller]"===this.logPrefix?"level":"track"} ${t.level}`),this.state=pb,this.fragCurrent=t,n=this.keyLoader.load(t).then((t=>{if(!this.fragContextChanged(t.frag))return this.hls.trigger(pu.KEY_LOADED,t),this.state===pb&&(this.state=hb),t})),this.hls.trigger(pu.KEY_LOADING,{frag:t}),null===this.fragCurrent&&(n=Promise.reject(new Error("frag load aborted, context changed in KEY_LOADING")))),i=Math.max(t.start,i||0),this.config.lowLatencyMode&&"initSegment"!==t.sn){const a=s.partList;if(a&&r){i>t.end&&s.fragmentHint&&(t=s.fragmentHint);const o=this.getNextPart(a,t,i);if(o>-1){const c=a[o];let l;return this.log(`Loading part sn: ${t.sn} p: ${c.index} cc: ${t.cc} of playlist [${s.startSN}-${s.endSN}] parts [0-${o}-${a.length-1}] ${"[stream-controller]"===this.logPrefix?"level":"track"}: ${t.level}, target: ${parseFloat(i.toFixed(3))}`),this.nextLoadPosition=c.start+c.duration,this.state=gb,l=n?n.then((i=>!i||this.fragContextChanged(i.frag)?null:this.doFragPartsLoad(t,c,e,r))).catch((t=>this.handleFragLoadError(t))):this.doFragPartsLoad(t,c,e,r).catch((t=>this.handleFragLoadError(t))),this.hls.trigger(pu.FRAG_LOADING,{frag:t,part:c,targetBufferTime:i}),null===this.fragCurrent?Promise.reject(new Error("frag load aborted, context changed in FRAG_LOADING parts")):l}if(!t.url||this.loadedEndOfParts(a,i))return Promise.resolve(null)}}this.log(`Loading fragment ${t.sn} cc: ${t.cc} ${s?"of ["+s.startSN+"-"+s.endSN+"] ":""}${"[stream-controller]"===this.logPrefix?"level":"track"}: ${t.level}, target: ${parseFloat(i.toFixed(3))}`),lu(t.sn)&&!this.bitrateTest&&(this.nextLoadPosition=t.start+t.duration),this.state=gb;const o=this.config.progressive;let c;return c=o&&n?n.then((e=>!e||this.fragContextChanged(null==e?void 0:e.frag)?null:this.fragmentLoader.load(t,r))).catch((t=>this.handleFragLoadError(t))):Promise.all([this.fragmentLoader.load(t,o?r:void 0),n]).then((([t])=>(!o&&t&&r&&r(t),t))).catch((t=>this.handleFragLoadError(t))),this.hls.trigger(pu.FRAG_LOADING,{frag:t,targetBufferTime:i}),null===this.fragCurrent?Promise.reject(new Error("frag load aborted, context changed in FRAG_LOADING")):c}doFragPartsLoad(t,e,i,r){return new Promise(((a,s)=>{var n;const o=[],c=null==(n=i.details)?void 0:n.partList,l=e=>{this.fragmentLoader.loadPart(t,e,r).then((r=>{o[e.index]=r;const s=r.part;this.hls.trigger(pu.FRAG_LOADED,r);const n=nv(i,t.sn,e.index+1)||ov(c,t.sn,e.index+1);if(!n)return a({frag:t,part:s,partsLoaded:o});l(n)})).catch(s)};l(e)}))}handleFragLoadError(t){if("data"in t){const e=t.data;t.data&&e.details===uu.INTERNAL_ABORTED?this.handleFragLoadAborted(e.frag,e.part):this.hls.trigger(pu.ERROR,e)}else this.hls.trigger(pu.ERROR,{type:gu.OTHER_ERROR,details:uu.INTERNAL_EXCEPTION,err:t,error:t,fatal:!0});return null}_handleTransmuxerFlush(t){const e=this.getCurrentContext(t);if(!e||this.state!==mb)return void(this.fragCurrent||this.state===db||this.state===kb||(this.state=hb));const{frag:i,part:r,level:a}=e,s=self.performance.now();i.stats.parsing.end=s,r&&(r.stats.parsing.end=s),this.updateLevelTiming(i,r,a,t.partial)}getCurrentContext(t){const{levels:e,fragCurrent:i}=this,{level:r,sn:a,part:s}=t;if(null==e||!e[r])return this.warn(`Levels object was unset while buffering fragment ${a} of level ${r}. The current chunk will not be buffered.`),null;const n=e[r],o=s>-1?nv(n,a,s):null,c=o?o.fragment:function(t,e,i){if(null==t||!t.details)return null;const r=t.details;let a=r.fragments[e-r.startSN];return a||(a=r.fragmentHint,a&&a.sn===e?a:e<r.startSN&&i&&i.sn===e?i:null)}(n,a,i);return c?(i&&i!==c&&(c.stats=i.stats),{frag:c,part:o,level:n}):null}bufferFragmentData(t,e,i,r,a){var s;if(!t||this.state!==mb)return;const{data1:n,data2:o}=t;let c=n;if(n&&o&&(c=$f(n,o)),null==(s=c)||!s.length)return;const l={type:t.type,frag:e,part:i,chunkMeta:r,parent:e.type,data:c};if(this.hls.trigger(pu.BUFFER_APPENDING,l),t.dropped&&t.independent&&!i){if(a)return;this.flushBufferGap(e)}}flushBufferGap(t){const e=this.media;if(!e)return;if(!Kv.isBuffered(e,e.currentTime))return void this.flushMainBuffer(0,t.start);const i=e.currentTime,r=Kv.bufferInfo(e,i,0),a=t.duration,s=Math.min(2*this.config.maxFragLookUpTolerance,.25*a),n=Math.max(Math.min(t.start-s,r.end-s),i+s);t.start-n>s&&this.flushMainBuffer(n,t.start)}getFwdBufferInfo(t,e){const i=this.getLoadPosition();return lu(i)?this.getFwdBufferInfoAtPos(t,i,e):null}getFwdBufferInfoAtPos(t,e,i){const{config:{maxBufferHole:r}}=this,a=Kv.bufferInfo(t,e,r);if(0===a.len&&void 0!==a.nextStart){const s=this.fragmentTracker.getBufferedFrag(e,i);if(s&&a.nextStart<s.end)return Kv.bufferInfo(t,e,Math.max(a.nextStart,r))}return a}getMaxBufferLength(t){const{config:e}=this;let i;return i=t?Math.max(8*e.maxBufferSize/t,e.maxBufferLength):e.maxBufferLength,Math.min(i,e.maxMaxBufferLength)}reduceMaxBufferLength(t,e){const i=this.config,r=Math.max(Math.min(t-e,i.maxBufferLength),e),a=Math.max(t-3*e,i.maxMaxBufferLength/2,r);return a>=r&&(i.maxMaxBufferLength=a,this.warn(`Reduce max buffer length to ${a}s`),!0)}getAppendedFrag(t,e=Em){const i=this.fragmentTracker.getAppendedFrag(t,Em);return i&&"fragment"in i?i.fragment:i}getNextFragment(t,e){const i=e.fragments,r=i.length;if(!r)return null;const{config:a}=this,s=i[0].start;let n;if(e.live){const o=a.initialLiveManifestSize;if(r<o)return this.warn(`Not enough fragments to start playback (have: ${r}, need: ${o})`),null;(!e.PTSKnown&&!this.startFragRequested&&-1===this.startPosition||t<s)&&(n=this.getInitialLiveFragment(e,i),this.startPosition=this.nextLoadPosition=n?this.hls.liveSyncPosition||n.start:t)}else t<=s&&(n=i[0]);if(!n){const i=a.lowLatencyMode?e.partEnd:e.fragmentEnd;n=this.getFragmentAtPosition(t,i,e)}return this.mapToInitFragWhenRequired(n)}isLoopLoading(t,e){const i=this.fragmentTracker.getState(t);return(i===Bv||i===Nv&&!!t.gap)&&this.nextLoadPosition>e}getNextFragmentLoopLoading(t,e,i,r,a){const s=t.gap,n=this.getNextFragment(this.nextLoadPosition,e);if(null===n)return n;if(t=n,s&&t&&!t.gap&&i.nextStart){const e=this.getFwdBufferInfoAtPos(this.mediaBuffer?this.mediaBuffer:this.media,i.nextStart,r);if(null!==e&&i.len+e.len>=a)return this.log(`buffer full after gaps in "${r}" playlist starting at sn: ${t.sn}`),null}return t}mapToInitFragWhenRequired(t){return null==t||!t.initSegment||null!=t&&t.initSegment.data||this.bitrateTest?t:t.initSegment}getNextPart(t,e,i){let r=-1,a=!1,s=!0;for(let n=0,o=t.length;n<o;n++){const o=t[n];if(s=s&&!o.independent,r>-1&&i<o.start)break;const c=o.loaded;c?r=-1:(a||o.independent||s)&&o.fragment===e&&(r=n),a=c}return r}loadedEndOfParts(t,e){const i=t[t.length-1];return i&&e>i.start&&i.loaded}getInitialLiveFragment(t,e){const i=this.fragPrevious;let r=null;if(i){if(t.hasProgramDateTime&&(this.log(`Live playlist, switching playlist, load frag with same PDT: ${i.programDateTime}`),r=function(t,e,i){if(null===e||!Array.isArray(t)||!t.length||!lu(e))return null;if(e<(t[0].programDateTime||0))return null;if(e>=(t[t.length-1].endProgramDateTime||0))return null;i=i||0;for(let r=0;r<t.length;++r){const a=t[r];if(vv(e,i,a))return a}return null}(e,i.endProgramDateTime,this.config.maxFragLookUpTolerance)),!r){const a=i.sn+1;if(a>=t.startSN&&a<=t.endSN){const s=e[a-t.startSN];i.cc===s.cc&&(r=s,this.log(`Live playlist, switching playlist, load frag with next SN: ${r.sn}`))}r||(r=function(t,e){return uv(t,(t=>t.cc<e?1:t.cc>e?-1:0))}(e,i.cc),r&&this.log(`Live playlist, switching playlist, load frag with same CC: ${r.sn}`))}}else{const e=this.hls.liveSyncPosition;null!==e&&(r=this.getFragmentAtPosition(e,this.bitrateTest?t.fragmentEnd:t.edge,t))}return r}getFragmentAtPosition(t,e,i){const{config:r}=this;let{fragPrevious:a}=this,{fragments:s,endSN:n}=i;const{fragmentHint:o}=i,{maxFragLookUpTolerance:c}=r,l=i.partList,d=!!(r.lowLatencyMode&&null!=l&&l.length&&o);let h;if(d&&o&&!this.bitrateTest&&(s=s.concat(o),n=o.sn),t<e){h=fv(a,s,t,t>e-c?0:c)}else h=s[s.length-1];if(h){const t=h.sn-i.startSN,e=this.fragmentTracker.getState(h);if((e===Bv||e===Nv&&h.gap)&&(a=h),a&&h.sn===a.sn&&(!d||l[0].fragment.sn>h.sn)){if(a&&h.level===a.level){const e=s[t+1];h=h.sn<n&&this.fragmentTracker.getState(e)!==Bv?e:null}}}return h}synchronizeToLiveEdge(t){const{config:e,media:i}=this;if(!i)return;const r=this.hls.liveSyncPosition,a=i.currentTime,s=t.fragments[0].start,n=t.edge,o=a>=s-e.maxFragLookUpTolerance&&a<=n;if(null!==r&&i.duration>r&&(a<r||!o)){const s=void 0!==e.liveMaxLatencyDuration?e.liveMaxLatencyDuration:e.liveMaxLatencyDurationCount*t.targetduration;(!o&&i.readyState<4||a<n-s)&&(this.loadedmetadata||(this.nextLoadPosition=r),i.readyState&&(this.warn(`Playback: ${a.toFixed(3)} is located too far from the end of live sliding playlist: ${n}, reset currentTime to : ${r.toFixed(3)}`),i.currentTime=r))}}alignPlaylists(t,e,i){const r=t.fragments.length;if(!r)return this.warn("No fragments in live playlist"),0;const a=t.fragments[0].start,s=!e,n=t.alignedSliding&&lu(a);if(s||!n&&!a){const{fragPrevious:a}=this;Jv(a,i,t);const s=t.fragments[0].start;return this.log(`Live playlist sliding: ${s.toFixed(2)} start-sn: ${e?e.startSN:"na"}->${t.startSN} prev-sn: ${a?a.sn:"na"} fragments: ${r}`),s}return a}waitForCdnTuneIn(t){return t.live&&t.canBlockReload&&t.partTarget&&t.tuneInGoal>Math.max(t.partHoldBack,3*t.partTarget)}setStartPosition(t,e){let i=this.startPosition;if(i<e&&(i=-1),-1===i||-1===this.lastCurrentTime){const r=null!==this.startTimeOffset,a=r?this.startTimeOffset:t.startTimeOffset;null!==a&&lu(a)?(i=e+a,a<0&&(i+=t.totalduration),i=Math.min(Math.max(e,i),e+t.totalduration),this.log(`Start time offset ${a} found in ${r?"multivariant":"media"} playlist, adjust startPosition to ${i}`),this.startPosition=i):t.live?i=this.hls.liveSyncPosition||e:this.startPosition=i=0,this.lastCurrentTime=i}this.nextLoadPosition=i}getLoadPosition(){const{media:t}=this;let e=0;return this.loadedmetadata&&t?e=t.currentTime:this.nextLoadPosition&&(e=this.nextLoadPosition),e}handleFragLoadAborted(t,e){this.transmuxer&&"initSegment"!==t.sn&&t.stats.aborted&&(this.warn(`Fragment ${t.sn}${e?" part "+e.index:""} of level ${t.level} was aborted`),this.resetFragmentLoading(t))}resetFragmentLoading(t){this.fragCurrent&&(this.fragContextChanged(t)||this.state===ub)||(this.state=hb)}onFragmentOrKeyLoadError(t,e){if(e.chunkMeta&&!e.frag){const t=this.getCurrentContext(e.chunkMeta);t&&(e.frag=t.frag)}const i=e.frag;if(!i||i.type!==t||!this.levels)return;var r;if(this.fragContextChanged(i))return void this.warn(`Frag load error must match current frag to retry ${i.url} > ${null==(r=this.fragCurrent)?void 0:r.url}`);const a=e.details===uu.FRAG_GAP;a&&this.fragmentTracker.fragBuffered(i,!0);const s=e.errorAction,{action:n,retryCount:o=0,retryConfig:c}=s||{};if(s&&n===wv&&c){this.resetStartWhenNotLoaded(this.levelLastLoaded);const r=hv(c,o);this.warn(`Fragment ${i.sn} of ${t} ${i.level} errored with ${e.details}, retrying loading ${o+1}/${c.maxNumRetry} in ${r}ms`),s.resolved=!0,this.retryDate=self.performance.now()+r,this.state=ub}else if(c&&s){if(this.resetFragmentErrors(t),!(o<c.maxNumRetry))return void ku.warn(`${e.details} reached or exceeded max retry (${o})`);a||n===yv||(s.resolved=!0)}else(null==s?void 0:s.action)===kv?this.state=wb:this.state=kb;this.tickImmediate()}reduceLengthAndFlushBuffer(t){if(this.state===mb||this.state===vb){const e=t.frag,i=t.parent,r=this.getFwdBufferInfo(this.mediaBuffer,i),a=r&&r.len>.5;a&&this.reduceMaxBufferLength(r.len,(null==e?void 0:e.duration)||10);const s=!a;return s&&this.warn(`Buffer full error while media.currentTime is not buffered, flush ${i} buffer`),e&&(this.fragmentTracker.removeFragment(e),this.nextLoadPosition=e.start),this.resetLoadingState(),s}return!1}resetFragmentErrors(t){t===Tm&&(this.fragCurrent=null),this.loadedmetadata||(this.startFragRequested=!1),this.state!==db&&(this.state=hb)}afterBufferFlushed(t,e,i){if(!t)return;const r=Kv.getBuffered(t);this.fragmentTracker.detectEvictedFragments(e,r,i),this.state===bb&&this.resetLoadingState()}resetLoadingState(){this.log("Reset loading state"),this.fragCurrent=null,this.fragPrevious=null,this.state=hb}resetStartWhenNotLoaded(t){if(!this.loadedmetadata){this.startFragRequested=!1;const e=t?t.details:null;null!=e&&e.live?(this.startPosition=-1,this.setStartPosition(e,0),this.resetLoadingState()):this.nextLoadPosition=this.startPosition}}resetWhenMissingContext(t){this.warn(`The loading context changed while buffering fragment ${t.sn} of level ${t.level}. This chunk will not be buffered.`),this.removeUnbufferedFrags(),this.resetStartWhenNotLoaded(this.levelLastLoaded),this.resetLoadingState()}removeUnbufferedFrags(t=0){this.fragmentTracker.removeFragmentsInRange(t,1/0,this.playlistType,!1,!0)}updateLevelTiming(t,e,i,r){var a;const s=i.details;if(!s)return void this.warn("level.details undefined");if(!Object.keys(t.elementaryStreams).reduce(((e,a)=>{const n=t.elementaryStreams[a];if(n){const o=n.endPTS-n.startPTS;if(o<=0)return this.warn(`Could not parse fragment ${t.sn} ${a} duration reliably (${o})`),e||!1;const c=r?0:iv(s,t,n.startPTS,n.endPTS,n.startDTS,n.endDTS);return this.hls.trigger(pu.LEVEL_PTS_UPDATED,{details:s,level:i,drift:c,type:a,frag:t,start:n.startPTS,end:n.endPTS}),!0}return e}),!1)&&null===(null==(a=this.transmuxer)?void 0:a.error)){const e=new Error(`Found no media in fragment ${t.sn} of level ${t.level} resetting transmuxer to fallback to playlist timing`);if(0===i.fragmentError&&(i.fragmentError++,t.gap=!0,this.fragmentTracker.removeFragment(t),this.fragmentTracker.fragBuffered(t,!0)),this.warn(e.message),this.hls.trigger(pu.ERROR,{type:gu.MEDIA_ERROR,details:uu.FRAG_PARSING_ERROR,fatal:!1,error:e,frag:t,reason:`Found no media in msn ${t.sn} of level "${i.url}"`}),!this.hls)return;this.resetTransmuxer()}this.state=vb,this.hls.trigger(pu.FRAG_PARSED,{frag:t,part:e})}resetTransmuxer(){this.transmuxer&&(this.transmuxer.destroy(),this.transmuxer=null)}recoverWorkerError(t){"demuxerWorker"===t.event&&(this.fragmentTracker.removeAllFragments(),this.resetTransmuxer(),this.resetStartWhenNotLoaded(this.levelLastLoaded),this.resetLoadingState())}set state(t){const e=this._state;e!==t&&(this._state=t,this.log(`${e}->${t}`))}get state(){return this._state}}class Sb{constructor(){this.chunks=[],this.dataLength=0}push(t){this.chunks.push(t),this.dataLength+=t.length}flush(){const{chunks:t,dataLength:e}=this;let i;return t.length?(i=1===t.length?t[0]:function(t,e){const i=new Uint8Array(e);let r=0;for(let e=0;e<t.length;e++){const a=t[e];i.set(a,r),r+=a.length}return i}(t,e),this.reset(),i):new Uint8Array(0)}reset(){this.chunks.length=0,this.dataLength=0}}function Pb(t="",e=9e4){return{type:t,id:-1,pid:-1,inputTimeScale:e,sequenceNumber:-1,samples:[],dropped:0}}class Cb{constructor(){this._audioTrack=void 0,this._id3Track=void 0,this.frameIndex=0,this.cachedData=null,this.basePTS=null,this.initPTS=null,this.lastPTS=null}resetInitSegment(t,e,i,r){this._id3Track={type:"id3",id:3,pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0}}resetTimeStamp(t){this.initPTS=t,this.resetContiguity()}resetContiguity(){this.basePTS=null,this.lastPTS=null,this.frameIndex=0}canParse(t,e){return!1}appendFrame(t,e,i){}demux(t,e){this.cachedData&&(t=$f(this.cachedData,t),this.cachedData=null);let i,r=rf(t,0),a=r?r.length:0;const s=this._audioTrack,n=this._id3Track,o=r?nf(r):void 0,c=t.length;for((null===this.basePTS||0===this.frameIndex&&lu(o))&&(this.basePTS=Eb(o,e,this.initPTS),this.lastPTS=this.basePTS),null===this.lastPTS&&(this.lastPTS=this.basePTS),r&&r.length>0&&n.samples.push({pts:this.lastPTS,dts:this.lastPTS,data:r,type:$m,duration:Number.POSITIVE_INFINITY});a<c;){if(this.canParse(t,a)){const e=this.appendFrame(s,t,a);e?(this.frameIndex++,this.lastPTS=e.sample.pts,a+=e.length,i=a):a=c}else sf(t,a)?(r=rf(t,a),n.samples.push({pts:this.lastPTS,dts:this.lastPTS,data:r,type:$m,duration:Number.POSITIVE_INFINITY}),a+=r.length,i=a):a++;if(a===c&&i!==c){const e=Xu(t,i);this.cachedData?this.cachedData=$f(this.cachedData,e):this.cachedData=e}}return{audioTrack:s,videoTrack:Pb(),id3Track:n,textTrack:Pb()}}demuxSampleAes(t,e,i){return Promise.reject(new Error(`[${this}] This demuxer does not support Sample-AES decryption`))}flush(t){const e=this.cachedData;return e&&(this.cachedData=null,this.demux(e,0)),{audioTrack:this._audioTrack,videoTrack:Pb(),id3Track:this._id3Track,textTrack:Pb()}}destroy(){}}const Eb=(t,e,i)=>{if(lu(t))return 90*t;return 9e4*e+(i?9e4*i.baseTime/i.timescale:0)};function Tb(t,e){return 255===t[e]&&240==(246&t[e+1])}function Lb(t,e){return 1&t[e+1]?7:9}function _b(t,e){return(3&t[e+3])<<11|t[e+4]<<3|(224&t[e+5])>>>5}function Rb(t,e){return e+1<t.length&&Tb(t,e)}function Ab(t,e){if(Rb(t,e)){const i=Lb(t,e);if(e+i>=t.length)return!1;const r=_b(t,e);if(r<=i)return!1;const a=e+r;return a===t.length||Rb(t,a)}return!1}function Db(t,e,i,r,a){if(!t.samplerate){const s=function(t,e,i,r){let a,s,n,o;const c=navigator.userAgent.toLowerCase(),l=r,d=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];a=1+((192&e[i+2])>>>6);const h=(60&e[i+2])>>>2;if(!(h>d.length-1))return n=(1&e[i+2])<<2,n|=(192&e[i+3])>>>6,ku.log(`manifest codec:${r}, ADTS type:${a}, samplingIndex:${h}`),/firefox/i.test(c)?h>=6?(a=5,o=new Array(4),s=h-3):(a=2,o=new Array(2),s=h):-1!==c.indexOf("android")?(a=2,o=new Array(2),s=h):(a=5,o=new Array(4),r&&(-1!==r.indexOf("mp4a.40.29")||-1!==r.indexOf("mp4a.40.5"))||!r&&h>=6?s=h-3:((r&&-1!==r.indexOf("mp4a.40.2")&&(h>=6&&1===n||/vivaldi/i.test(c))||!r&&1===n)&&(a=2,o=new Array(2)),s=h)),o[0]=a<<3,o[0]|=(14&h)>>1,o[1]|=(1&h)<<7,o[1]|=n<<3,5===a&&(o[1]|=(14&s)>>1,o[2]=(1&s)<<7,o[2]|=8,o[3]=0),{config:o,samplerate:d[h],channelCount:n,codec:"mp4a.40."+a,manifestCodec:l};{const e=new Error(`invalid ADTS sampling index:${h}`);t.emit(pu.ERROR,pu.ERROR,{type:gu.MEDIA_ERROR,details:uu.FRAG_PARSING_ERROR,fatal:!0,error:e,reason:e.message})}}(e,i,r,a);if(!s)return;t.config=s.config,t.samplerate=s.samplerate,t.channelCount=s.channelCount,t.codec=s.codec,t.manifestCodec=s.manifestCodec,ku.log(`parsed codec:${t.codec}, rate:${s.samplerate}, channels:${s.channelCount}`)}}function Mb(t){return 9216e4/t}function Ib(t,e,i,r,a){const s=r+a*Mb(t.samplerate),n=function(t,e){const i=Lb(t,e);if(e+i<=t.length){const r=_b(t,e)-i;if(r>0)return{headerLength:i,frameLength:r}}}(e,i);let o;if(n){const{frameLength:r,headerLength:a}=n,c=a+r,l=Math.max(0,i+c-e.length);l?(o=new Uint8Array(c-a),o.set(e.subarray(i+a,e.length),0)):o=e.subarray(i+a,i+c);const d={unit:o,pts:s};return l||t.samples.push(d),{sample:d,length:c,missing:l}}const c=e.length-i;o=new Uint8Array(c),o.set(e.subarray(i,e.length),0);return{sample:{unit:o,pts:s},length:c,missing:-1}}let Ob=null;const Ub=[32,64,96,128,160,192,224,256,288,320,352,384,416,448,32,48,56,64,80,96,112,128,160,192,224,256,320,384,32,40,48,56,64,80,96,112,128,160,192,224,256,320,32,48,56,64,80,96,112,128,144,160,176,192,224,256,8,16,24,32,40,48,56,64,80,96,112,128,144,160],$b=[44100,48e3,32e3,22050,24e3,16e3,11025,12e3,8e3],Fb=[[0,72,144,12],[0,0,0,0],[0,72,144,12],[0,144,144,12]],jb=[0,1,1,4];function zb(t,e,i,r,a){if(i+24>e.length)return;const s=Nb(e,i);if(s&&i+s.frameLength<=e.length){const n=r+a*(9e4*s.samplesPerFrame/s.sampleRate),o={unit:e.subarray(i,i+s.frameLength),pts:n,dts:n};return t.config=[],t.channelCount=s.channelCount,t.samplerate=s.sampleRate,t.samples.push(o),{sample:o,length:s.frameLength,missing:0}}}function Nb(t,e){const i=t[e+1]>>3&3,r=t[e+1]>>1&3,a=t[e+2]>>4&15,s=t[e+2]>>2&3;if(1!==i&&0!==a&&15!==a&&3!==s){const n=t[e+2]>>1&1,o=t[e+3]>>6,c=1e3*Ub[14*(3===i?3-r:3===r?3:4)+a-1],l=$b[3*(3===i?0:2===i?1:2)+s],d=3===o?1:2,h=Fb[i][r],p=jb[r],g=8*h*p,u=Math.floor(h*c/l+n)*p;if(null===Ob){const t=(navigator.userAgent||"").match(/Chrome\/(\d+)/i);Ob=t?parseInt(t[1]):0}return!!Ob&&Ob<=87&&2===r&&c>=224e3&&0===o&&(t[e+3]=128|t[e+3]),{sampleRate:l,channelCount:d,frameLength:u,samplesPerFrame:g}}}function Bb(t,e){return!(255!==t[e]||224&~t[e+1]||!(6&t[e+1]))}function Hb(t,e){return e+1<t.length&&Bb(t,e)}function Gb(t,e){if(e+1<t.length&&Bb(t,e)){const i=4,r=Nb(t,e);let a=i;null!=r&&r.frameLength&&(a=r.frameLength);const s=e+a;return s===t.length||Hb(t,s)}return!1}const Vb=/\/emsg[-/]ID3/i;const qb=(t,e)=>{let i=0,r=5;e+=r;const a=new Uint32Array(1),s=new Uint32Array(1),n=new Uint8Array(1);for(;r>0;){n[0]=t[e];const o=Math.min(r,8),c=8-o;s[0]=4278190080>>>24+c<<c,a[0]=(n[0]&s[0])>>c,i=i?i<<o|a[0]:a[0],e+=1,r-=o}return i};class Kb extends Cb{constructor(t){super(),this.observer=void 0,this.observer=t}resetInitSegment(t,e,i,r){super.resetInitSegment(t,e,i,r),this._audioTrack={container:"audio/ac-3",type:"audio",id:2,pid:-1,sequenceNumber:0,segmentCodec:"ac3",samples:[],manifestCodec:e,duration:r,inputTimeScale:9e4,dropped:0}}canParse(t,e){return e+64<t.length}appendFrame(t,e,i){const r=Wb(t,e,i,this.basePTS,this.frameIndex);if(-1!==r){return{sample:t.samples[t.samples.length-1],length:r,missing:0}}}static probe(t){if(!t)return!1;const e=rf(t,0);if(!e)return!1;const i=e.length;return 11===t[i]&&119===t[i+1]&&void 0!==nf(e)&&qb(t,i)<16}}function Wb(t,e,i,r,a){if(i+8>e.length)return-1;if(11!==e[i]||119!==e[i+1])return-1;const s=e[i+4]>>6;if(s>=3)return-1;const n=[48e3,44100,32e3][s],o=63&e[i+4],c=2*[64,69,96,64,70,96,80,87,120,80,88,120,96,104,144,96,105,144,112,121,168,112,122,168,128,139,192,128,140,192,160,174,240,160,175,240,192,208,288,192,209,288,224,243,336,224,244,336,256,278,384,256,279,384,320,348,480,320,349,480,384,417,576,384,418,576,448,487,672,448,488,672,512,557,768,512,558,768,640,696,960,640,697,960,768,835,1152,768,836,1152,896,975,1344,896,976,1344,1024,1114,1536,1024,1115,1536,1152,1253,1728,1152,1254,1728,1280,1393,1920,1280,1394,1920][3*o+s];if(i+c>e.length)return-1;const l=e[i+6]>>5;let d=0;2===l?d+=2:(1&l&&1!==l&&(d+=2),4&l&&(d+=2));const h=(e[i+6]<<8|e[i+7])>>12-d&1,p=[2,1,2,3,3,4,4,5][l]+h,g=e[i+5]>>3,u=7&e[i+5],f=new Uint8Array([s<<6|g<<1|u>>2,(3&u)<<6|l<<3|h<<2|o>>4,o<<4&224]),m=r+a*(1536/n*9e4),v=e.subarray(i,i+c);return t.config=f,t.channelCount=p,t.samplerate=n,t.samples.push({unit:v,pts:m}),c}class Yb{constructor(){this.VideoSample=null}createVideoSample(t,e,i,r){return{key:t,frame:!1,pts:e,dts:i,units:[],debug:r,length:0}}getLastNalUnit(t){var e;let i,r=this.VideoSample;if(r&&0!==r.units.length||(r=t[t.length-1]),null!=(e=r)&&e.units){const t=r.units;i=t[t.length-1]}return i}pushAccessUnit(t,e){if(t.units.length&&t.frame){if(void 0===t.pts){const i=e.samples,r=i.length;if(!r)return void e.dropped++;{const e=i[r-1];t.pts=e.pts,t.dts=e.dts}}e.samples.push(t)}t.debug.length&&ku.log(t.pts+"/"+t.dts+":"+t.debug)}}class Zb{constructor(t){this.data=void 0,this.bytesAvailable=void 0,this.word=void 0,this.bitsAvailable=void 0,this.data=t,this.bytesAvailable=t.byteLength,this.word=0,this.bitsAvailable=0}loadWord(){const t=this.data,e=this.bytesAvailable,i=t.byteLength-e,r=new Uint8Array(4),a=Math.min(4,e);if(0===a)throw new Error("no bytes available");r.set(t.subarray(i,i+a)),this.word=new DataView(r.buffer).getUint32(0),this.bitsAvailable=8*a,this.bytesAvailable-=a}skipBits(t){let e;t=Math.min(t,8*this.bytesAvailable+this.bitsAvailable),this.bitsAvailable>t?(this.word<<=t,this.bitsAvailable-=t):(e=(t-=this.bitsAvailable)>>3,t-=e<<3,this.bytesAvailable-=e,this.loadWord(),this.word<<=t,this.bitsAvailable-=t)}readBits(t){let e=Math.min(this.bitsAvailable,t);const i=this.word>>>32-e;if(t>32&&ku.error("Cannot read more than 32 bits at a time"),this.bitsAvailable-=e,this.bitsAvailable>0)this.word<<=e;else{if(!(this.bytesAvailable>0))throw new Error("no bits available");this.loadWord()}return e=t-e,e>0&&this.bitsAvailable?i<<e|this.readBits(e):i}skipLZ(){let t;for(t=0;t<this.bitsAvailable;++t)if(this.word&2147483648>>>t)return this.word<<=t,this.bitsAvailable-=t,t;return this.loadWord(),t+this.skipLZ()}skipUEG(){this.skipBits(1+this.skipLZ())}skipEG(){this.skipBits(1+this.skipLZ())}readUEG(){const t=this.skipLZ();return this.readBits(t+1)-1}readEG(){const t=this.readUEG();return 1&t?1+t>>>1:-1*(t>>>1)}readBoolean(){return 1===this.readBits(1)}readUByte(){return this.readBits(8)}readUShort(){return this.readBits(16)}readUInt(){return this.readBits(32)}skipScalingList(t){let e,i=8,r=8;for(let a=0;a<t;a++)0!==r&&(e=this.readEG(),r=(i+e+256)%256),i=0===r?i:r}readSPS(){let t,e,i,r=0,a=0,s=0,n=0;const o=this.readUByte.bind(this),c=this.readBits.bind(this),l=this.readUEG.bind(this),d=this.readBoolean.bind(this),h=this.skipBits.bind(this),p=this.skipEG.bind(this),g=this.skipUEG.bind(this),u=this.skipScalingList.bind(this);o();const f=o();if(c(5),h(3),o(),g(),100===f||110===f||122===f||244===f||44===f||83===f||86===f||118===f||128===f){const t=l();if(3===t&&h(1),g(),g(),h(1),d())for(e=3!==t?8:12,i=0;i<e;i++)d()&&u(i<6?16:64)}g();const m=l();if(0===m)l();else if(1===m)for(h(1),p(),p(),t=l(),i=0;i<t;i++)p();g(),h(1);const v=l(),b=l(),k=c(1);0===k&&h(1),h(1),d()&&(r=l(),a=l(),s=l(),n=l());let y=[1,1];if(d()&&d()){switch(o()){case 1:y=[1,1];break;case 2:y=[12,11];break;case 3:y=[10,11];break;case 4:y=[16,11];break;case 5:y=[40,33];break;case 6:y=[24,11];break;case 7:y=[20,11];break;case 8:y=[32,11];break;case 9:y=[80,33];break;case 10:y=[18,11];break;case 11:y=[15,11];break;case 12:y=[64,33];break;case 13:y=[160,99];break;case 14:y=[4,3];break;case 15:y=[3,2];break;case 16:y=[2,1];break;case 255:y=[o()<<8|o(),o()<<8|o()]}}return{width:Math.ceil(16*(v+1)-2*r-2*a),height:(2-k)*(b+1)*16-(k?2:4)*(s+n),pixelRatio:y}}readSliceType(){return this.readUByte(),this.readUEG(),this.readUEG()}}class Qb extends Yb{parseAVCPES(t,e,i,r,a){const s=this.parseAVCNALu(t,i.data);let n,o=this.VideoSample,c=!1;i.data=null,o&&s.length&&!t.audFound&&(this.pushAccessUnit(o,t),o=this.VideoSample=this.createVideoSample(!1,i.pts,i.dts,"")),s.forEach((r=>{var s;switch(r.type){case 1:{let e=!1;n=!0;const a=r.data;if(c&&a.length>4){const t=new Zb(a).readSliceType();2!==t&&4!==t&&7!==t&&9!==t||(e=!0)}var l;if(e)null!=(l=o)&&l.frame&&!o.key&&(this.pushAccessUnit(o,t),o=this.VideoSample=null);o||(o=this.VideoSample=this.createVideoSample(!0,i.pts,i.dts,"")),o.frame=!0,o.key=e;break}case 5:n=!0,null!=(s=o)&&s.frame&&!o.key&&(this.pushAccessUnit(o,t),o=this.VideoSample=null),o||(o=this.VideoSample=this.createVideoSample(!0,i.pts,i.dts,"")),o.key=!0,o.frame=!0;break;case 6:n=!0,zf(r.data,1,i.pts,e.samples);break;case 7:{var d,h;n=!0,c=!0;const e=r.data,i=new Zb(e).readSPS();if(!t.sps||t.width!==i.width||t.height!==i.height||(null==(d=t.pixelRatio)?void 0:d[0])!==i.pixelRatio[0]||(null==(h=t.pixelRatio)?void 0:h[1])!==i.pixelRatio[1]){t.width=i.width,t.height=i.height,t.pixelRatio=i.pixelRatio,t.sps=[e],t.duration=a;const r=e.subarray(1,4);let s="avc1.";for(let t=0;t<3;t++){let e=r[t].toString(16);e.length<2&&(e="0"+e),s+=e}t.codec=s}break}case 8:n=!0,t.pps=[r.data];break;case 9:n=!0,t.audFound=!0,o&&this.pushAccessUnit(o,t),o=this.VideoSample=this.createVideoSample(!1,i.pts,i.dts,"");break;case 12:n=!0;break;default:n=!1,o&&(o.debug+="unknown NAL "+r.type+" ")}if(o&&n){o.units.push(r)}})),r&&o&&(this.pushAccessUnit(o,t),this.VideoSample=null)}parseAVCNALu(t,e){const i=e.byteLength;let r=t.naluState||0;const a=r,s=[];let n,o,c,l=0,d=-1,h=0;for(-1===r&&(d=0,h=31&e[0],r=0,l=1);l<i;)if(n=e[l++],r)if(1!==r)if(n)if(1===n){if(o=l-r-1,d>=0){const t={data:e.subarray(d,o),type:h};s.push(t)}else{const i=this.getLastNalUnit(t.samples);i&&(a&&l<=4-a&&i.state&&(i.data=i.data.subarray(0,i.data.byteLength-a)),o>0&&(i.data=$f(i.data,e.subarray(0,o)),i.state=0))}l<i?(c=31&e[l],d=l,h=c,r=0):r=-1}else r=0;else r=3;else r=n?0:2;else r=n?0:1;if(d>=0&&r>=0){const t={data:e.subarray(d,i),type:h,state:r};s.push(t)}if(0===s.length){const i=this.getLastNalUnit(t.samples);i&&(i.data=$f(i.data,e))}return t.naluState=r,s}}class Jb{constructor(t,e,i){this.keyData=void 0,this.decrypter=void 0,this.keyData=i,this.decrypter=new cb(e,{removePKCS7Padding:!1})}decryptBuffer(t){return this.decrypter.decrypt(t,this.keyData.key.buffer,this.keyData.iv.buffer)}decryptAacSample(t,e,i){const r=t[e].unit;if(r.length<=16)return;const a=r.subarray(16,r.length-r.length%16),s=a.buffer.slice(a.byteOffset,a.byteOffset+a.length);this.decryptBuffer(s).then((a=>{const s=new Uint8Array(a);r.set(s,16),this.decrypter.isSync()||this.decryptAacSamples(t,e+1,i)}))}decryptAacSamples(t,e,i){for(;;e++){if(e>=t.length)return void i();if(!(t[e].unit.length<32)&&(this.decryptAacSample(t,e,i),!this.decrypter.isSync()))return}}getAvcEncryptedData(t){const e=16*Math.floor((t.length-48)/160)+16,i=new Int8Array(e);let r=0;for(let e=32;e<t.length-16;e+=160,r+=16)i.set(t.subarray(e,e+16),r);return i}getAvcDecryptedUnit(t,e){const i=new Uint8Array(e);let r=0;for(let e=32;e<t.length-16;e+=160,r+=16)t.set(i.subarray(r,r+16),e);return t}decryptAvcSample(t,e,i,r,a){const s=Nf(a.data),n=this.getAvcEncryptedData(s);this.decryptBuffer(n.buffer).then((n=>{a.data=this.getAvcDecryptedUnit(s,n),this.decrypter.isSync()||this.decryptAvcSamples(t,e,i+1,r)}))}decryptAvcSamples(t,e,i,r){if(t instanceof Uint8Array)throw new Error("Cannot decrypt samples of type Uint8Array");for(;;e++,i=0){if(e>=t.length)return void r();const a=t[e].units;for(;!(i>=a.length);i++){const s=a[i];if(!(s.data.length<=48||1!==s.type&&5!==s.type||(this.decryptAvcSample(t,e,i,r,s),this.decrypter.isSync())))return}}}}const Xb=188;class tk{constructor(t,e,i){this.observer=void 0,this.config=void 0,this.typeSupported=void 0,this.sampleAes=null,this.pmtParsed=!1,this.audioCodec=void 0,this.videoCodec=void 0,this._duration=0,this._pmtId=-1,this._videoTrack=void 0,this._audioTrack=void 0,this._id3Track=void 0,this._txtTrack=void 0,this.aacOverFlow=null,this.remainderData=null,this.videoParser=void 0,this.observer=t,this.config=e,this.typeSupported=i,this.videoParser=new Qb}static probe(t){const e=tk.syncOffset(t);return e>0&&ku.warn(`MPEG2-TS detected but first sync word found @ offset ${e}`),-1!==e}static syncOffset(t){const e=t.length;let i=Math.min(940,e-Xb)+1,r=0;for(;r<i;){let a=!1,s=-1,n=0;for(let o=r;o<e;o+=Xb){if(71!==t[o]||e-o!==Xb&&71!==t[o+Xb]){if(n)return-1;break}if(n++,-1===s&&(s=o,0!==s&&(i=Math.min(s+18612,t.length-Xb)+1)),a||(a=0===ek(t,o)),a&&n>1&&(0===s&&n>2||o+Xb>i))return s}r++}return-1}static createTrack(t,e){return{container:"video"===t||"audio"===t?"video/mp2t":void 0,type:t,id:wf[t],pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0,duration:"audio"===t?e:void 0}}resetInitSegment(t,e,i,r){this.pmtParsed=!1,this._pmtId=-1,this._videoTrack=tk.createTrack("video"),this._audioTrack=tk.createTrack("audio",r),this._id3Track=tk.createTrack("id3"),this._txtTrack=tk.createTrack("text"),this._audioTrack.segmentCodec="aac",this.aacOverFlow=null,this.remainderData=null,this.audioCodec=e,this.videoCodec=i,this._duration=r}resetTimeStamp(){}resetContiguity(){const{_audioTrack:t,_videoTrack:e,_id3Track:i}=this;t&&(t.pesData=null),e&&(e.pesData=null),i&&(i.pesData=null),this.aacOverFlow=null,this.remainderData=null}demux(t,e,i=!1,r=!1){let a;i||(this.sampleAes=null);const s=this._videoTrack,n=this._audioTrack,o=this._id3Track,c=this._txtTrack;let l=s.pid,d=s.pesData,h=n.pid,p=o.pid,g=n.pesData,u=o.pesData,f=null,m=this.pmtParsed,v=this._pmtId,b=t.length;if(this.remainderData&&(b=(t=$f(this.remainderData,t)).length,this.remainderData=null),b<Xb&&!r)return this.remainderData=t,{audioTrack:n,videoTrack:s,id3Track:o,textTrack:c};const k=Math.max(0,tk.syncOffset(t));b-=(b-k)%Xb,b<t.byteLength&&!r&&(this.remainderData=new Uint8Array(t.buffer,b,t.buffer.byteLength-b));let y=0;for(let e=k;e<b;e+=Xb)if(71===t[e]){const r=!!(64&t[e+1]),b=ek(t,e);let y;if((48&t[e+3])>>4>1){if(y=e+5+t[e+4],y===e+Xb)continue}else y=e+4;switch(b){case l:r&&(d&&(a=nk(d))&&this.videoParser.parseAVCPES(s,c,a,!1,this._duration),d={data:[],size:0}),d&&(d.data.push(t.subarray(y,e+Xb)),d.size+=e+Xb-y);break;case h:if(r){if(g&&(a=nk(g)))switch(n.segmentCodec){case"aac":this.parseAACPES(n,a);break;case"mp3":this.parseMPEGPES(n,a);break;case"ac3":this.parseAC3PES(n,a)}g={data:[],size:0}}g&&(g.data.push(t.subarray(y,e+Xb)),g.size+=e+Xb-y);break;case p:r&&(u&&(a=nk(u))&&this.parseID3PES(o,a),u={data:[],size:0}),u&&(u.data.push(t.subarray(y,e+Xb)),u.size+=e+Xb-y);break;case 0:r&&(y+=t[y]+1),v=this._pmtId=ik(t,y);break;case v:{r&&(y+=t[y]+1);const a=rk(t,y,this.typeSupported,i,this.observer);l=a.videoPid,l>0&&(s.pid=l,s.segmentCodec=a.segmentVideoCodec),h=a.audioPid,h>0&&(n.pid=h,n.segmentCodec=a.segmentAudioCodec),p=a.id3Pid,p>0&&(o.pid=p),null===f||m||(ku.warn(`MPEG-TS PMT found at ${e} after unknown PID '${f}'. Backtracking to sync byte @${k} to parse all TS packets.`),f=null,e=k-188),m=this.pmtParsed=!0;break}case 17:case 8191:break;default:f=b}}else y++;y>0&&ak(this.observer,new Error(`Found ${y} TS packet/s that do not start with 0x47`)),s.pesData=d,n.pesData=g,o.pesData=u;const w={audioTrack:n,videoTrack:s,id3Track:o,textTrack:c};return r&&this.extractRemainingSamples(w),w}flush(){const{remainderData:t}=this;let e;return this.remainderData=null,e=t?this.demux(t,-1,!1,!0):{videoTrack:this._videoTrack,audioTrack:this._audioTrack,id3Track:this._id3Track,textTrack:this._txtTrack},this.extractRemainingSamples(e),this.sampleAes?this.decrypt(e,this.sampleAes):e}extractRemainingSamples(t){const{audioTrack:e,videoTrack:i,id3Track:r,textTrack:a}=t,s=i.pesData,n=e.pesData,o=r.pesData;let c;if(s&&(c=nk(s))?(this.videoParser.parseAVCPES(i,a,c,!0,this._duration),i.pesData=null):i.pesData=s,n&&(c=nk(n))){switch(e.segmentCodec){case"aac":this.parseAACPES(e,c);break;case"mp3":this.parseMPEGPES(e,c);break;case"ac3":this.parseAC3PES(e,c)}e.pesData=null}else null!=n&&n.size&&ku.log("last AAC PES packet truncated,might overlap between fragments"),e.pesData=n;o&&(c=nk(o))?(this.parseID3PES(r,c),r.pesData=null):r.pesData=o}demuxSampleAes(t,e,i){const r=this.demux(t,i,!0,!this.config.progressive),a=this.sampleAes=new Jb(this.observer,this.config,e);return this.decrypt(r,a)}decrypt(t,e){return new Promise((i=>{const{audioTrack:r,videoTrack:a}=t;r.samples&&"aac"===r.segmentCodec?e.decryptAacSamples(r.samples,0,(()=>{a.samples?e.decryptAvcSamples(a.samples,0,0,(()=>{i(t)})):i(t)})):a.samples&&e.decryptAvcSamples(a.samples,0,0,(()=>{i(t)}))}))}destroy(){this._duration=0}parseAACPES(t,e){let i=0;const r=this.aacOverFlow;let a,s,n,o=e.data;if(r){this.aacOverFlow=null;const e=r.missing,a=r.sample.unit.byteLength;if(-1===e)o=$f(r.sample.unit,o);else{const s=a-e;r.sample.unit.set(o.subarray(0,e),s),t.samples.push(r.sample),i=r.missing}}for(a=i,s=o.length;a<s-1&&!Rb(o,a);a++);if(a!==i){let t;const e=a<s-1;if(t=e?`AAC PES did not start with ADTS header,offset:${a}`:"No ADTS header found in AAC PES",ak(this.observer,new Error(t),e),!e)return}if(Db(t,this.observer,o,a,this.audioCodec),void 0!==e.pts)n=e.pts;else{if(!r)return void ku.warn("[tsdemuxer]: AAC PES unknown PTS");{const e=Mb(t.samplerate);n=r.sample.pts+e}}let c,l=0;for(;a<s;){if(c=Ib(t,o,a,n,l),a+=c.length,c.missing){this.aacOverFlow=c;break}for(l++;a<s-1&&!Rb(o,a);a++);}}parseMPEGPES(t,e){const i=e.data,r=i.length;let a=0,s=0;const n=e.pts;if(void 0!==n)for(;s<r;)if(Hb(i,s)){const e=zb(t,i,s,n,a);if(!e)break;s+=e.length,a++}else s++;else ku.warn("[tsdemuxer]: MPEG PES unknown PTS")}parseAC3PES(t,e){{const i=e.data,r=e.pts;if(void 0===r)return void ku.warn("[tsdemuxer]: AC3 PES unknown PTS");const a=i.length;let s,n=0,o=0;for(;o<a&&(s=Wb(t,i,o,r,n++))>0;)o+=s}}parseID3PES(t,e){if(void 0===e.pts)return void ku.warn("[tsdemuxer]: ID3 PES unknown PTS");const i=cu({},e,{type:this._videoTrack?jm:$m,duration:Number.POSITIVE_INFINITY});t.samples.push(i)}}function ek(t,e){return((31&t[e+1])<<8)+t[e+2]}function ik(t,e){return(31&t[e+10])<<8|t[e+11]}function rk(t,e,i,r,a){const s={audioPid:-1,videoPid:-1,id3Pid:-1,segmentVideoCodec:"avc",segmentAudioCodec:"aac"},n=e+3+((15&t[e+1])<<8|t[e+2])-4;for(e+=12+((15&t[e+10])<<8|t[e+11]);e<n;){const n=ek(t,e),o=(15&t[e+3])<<8|t[e+4];switch(t[e]){case 207:if(!r){sk("ADTS AAC");break}case 15:-1===s.audioPid&&(s.audioPid=n);break;case 21:-1===s.id3Pid&&(s.id3Pid=n);break;case 219:if(!r){sk("H.264");break}case 27:-1===s.videoPid&&(s.videoPid=n,s.segmentVideoCodec="avc");break;case 3:case 4:i.mpeg||i.mp3?-1===s.audioPid&&(s.audioPid=n,s.segmentAudioCodec="mp3"):ku.log("MPEG audio found, not supported in this browser");break;case 193:if(!r){sk("AC-3");break}case 129:i.ac3?-1===s.audioPid&&(s.audioPid=n,s.segmentAudioCodec="ac3"):ku.log("AC-3 audio found, not supported in this browser");break;case 6:if(-1===s.audioPid&&o>0){let r=e+5,a=o;for(;a>2;){if(106===t[r])!0!==i.ac3?ku.log("AC-3 audio found, not supported in this browser for now"):(s.audioPid=n,s.segmentAudioCodec="ac3");const e=t[r+1]+2;r+=e,a-=e}}break;case 194:case 135:return ak(a,new Error("Unsupported EC-3 in M2TS found")),s;case 36:return ak(a,new Error("Unsupported HEVC in M2TS found")),s}e+=o+5}return s}function ak(t,e,i){ku.warn(`parsing error: ${e.message}`),t.emit(pu.ERROR,pu.ERROR,{type:gu.MEDIA_ERROR,details:uu.FRAG_PARSING_ERROR,fatal:!1,levelRetry:i,error:e,reason:e.message})}function sk(t){ku.log(`${t} with AES-128-CBC encryption found in unencrypted stream`)}function nk(t){let e,i,r,a,s,n=0;const o=t.data;if(!t||0===t.size)return null;for(;o[0].length<19&&o.length>1;)o[0]=$f(o[0],o[1]),o.splice(1,1);e=o[0];if(1===(e[0]<<16)+(e[1]<<8)+e[2]){if(i=(e[4]<<8)+e[5],i&&i>t.size-6)return null;const c=e[7];192&c&&(a=536870912*(14&e[9])+4194304*(255&e[10])+16384*(254&e[11])+128*(255&e[12])+(254&e[13])/2,64&c?(s=536870912*(14&e[14])+4194304*(255&e[15])+16384*(254&e[16])+128*(255&e[17])+(254&e[18])/2,a-s>54e5&&(ku.warn(`${Math.round((a-s)/9e4)}s delta between PTS and DTS, align them`),a=s)):s=a),r=e[8];let l=r+9;if(t.size<=l)return null;t.size-=l;const d=new Uint8Array(t.size);for(let t=0,i=o.length;t<i;t++){e=o[t];let i=e.byteLength;if(l){if(l>i){l-=i;continue}e=e.subarray(l),i-=l,l=0}d.set(e,n),n+=i}return i&&(i-=r+3),{data:d,pts:a,dts:s,len:i}}return null}class ok{static getSilentFrame(t,e){if("mp4a.40.2"===t){if(1===e)return new Uint8Array([0,200,0,128,35,128]);if(2===e)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(3===e)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if(4===e)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(5===e)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,130,48,4,153,0,33,144,2,56]);if(6===e)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,130,48,4,153,0,33,144,2,0,178,0,32,8,224])}else{if(1===e)return new Uint8Array([1,64,34,128,163,78,230,128,186,8,0,0,0,28,6,241,193,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);if(2===e)return new Uint8Array([1,64,34,128,163,94,230,128,186,8,0,0,0,0,149,0,6,241,161,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);if(3===e)return new Uint8Array([1,64,34,128,163,94,230,128,186,8,0,0,0,0,149,0,6,241,161,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94])}}}const ck=Math.pow(2,32)-1;class lk{static init(){let t;for(t in lk.types={avc1:[],avcC:[],btrt:[],dinf:[],dref:[],esds:[],ftyp:[],hdlr:[],mdat:[],mdhd:[],mdia:[],mfhd:[],minf:[],moof:[],moov:[],mp4a:[],".mp3":[],dac3:[],"ac-3":[],mvex:[],mvhd:[],pasp:[],sdtp:[],stbl:[],stco:[],stsc:[],stsd:[],stsz:[],stts:[],tfdt:[],tfhd:[],traf:[],trak:[],trun:[],trex:[],tkhd:[],vmhd:[],smhd:[]},lk.types)lk.types.hasOwnProperty(t)&&(lk.types[t]=[t.charCodeAt(0),t.charCodeAt(1),t.charCodeAt(2),t.charCodeAt(3)]);const e=new Uint8Array([0,0,0,0,0,0,0,0,118,105,100,101,0,0,0,0,0,0,0,0,0,0,0,0,86,105,100,101,111,72,97,110,100,108,101,114,0]),i=new Uint8Array([0,0,0,0,0,0,0,0,115,111,117,110,0,0,0,0,0,0,0,0,0,0,0,0,83,111,117,110,100,72,97,110,100,108,101,114,0]);lk.HDLR_TYPES={video:e,audio:i};const r=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),a=new Uint8Array([0,0,0,0,0,0,0,0]);lk.STTS=lk.STSC=lk.STCO=a,lk.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),lk.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0]),lk.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),lk.STSD=new Uint8Array([0,0,0,0,0,0,0,1]);const s=new Uint8Array([105,115,111,109]),n=new Uint8Array([97,118,99,49]),o=new Uint8Array([0,0,0,1]);lk.FTYP=lk.box(lk.types.ftyp,s,o,s,n),lk.DINF=lk.box(lk.types.dinf,lk.box(lk.types.dref,r))}static box(t,...e){let i=8,r=e.length;const a=r;for(;r--;)i+=e[r].byteLength;const s=new Uint8Array(i);for(s[0]=i>>24&255,s[1]=i>>16&255,s[2]=i>>8&255,s[3]=255&i,s.set(t,4),r=0,i=8;r<a;r++)s.set(e[r],i),i+=e[r].byteLength;return s}static hdlr(t){return lk.box(lk.types.hdlr,lk.HDLR_TYPES[t])}static mdat(t){return lk.box(lk.types.mdat,t)}static mdhd(t,e){e*=t;const i=Math.floor(e/(ck+1)),r=Math.floor(e%(ck+1));return lk.box(lk.types.mdhd,new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,t>>24&255,t>>16&255,t>>8&255,255&t,i>>24,i>>16&255,i>>8&255,255&i,r>>24,r>>16&255,r>>8&255,255&r,85,196,0,0]))}static mdia(t){return lk.box(lk.types.mdia,lk.mdhd(t.timescale,t.duration),lk.hdlr(t.type),lk.minf(t))}static mfhd(t){return lk.box(lk.types.mfhd,new Uint8Array([0,0,0,0,t>>24,t>>16&255,t>>8&255,255&t]))}static minf(t){return"audio"===t.type?lk.box(lk.types.minf,lk.box(lk.types.smhd,lk.SMHD),lk.DINF,lk.stbl(t)):lk.box(lk.types.minf,lk.box(lk.types.vmhd,lk.VMHD),lk.DINF,lk.stbl(t))}static moof(t,e,i){return lk.box(lk.types.moof,lk.mfhd(t),lk.traf(i,e))}static moov(t){let e=t.length;const i=[];for(;e--;)i[e]=lk.trak(t[e]);return lk.box.apply(null,[lk.types.moov,lk.mvhd(t[0].timescale,t[0].duration)].concat(i).concat(lk.mvex(t)))}static mvex(t){let e=t.length;const i=[];for(;e--;)i[e]=lk.trex(t[e]);return lk.box.apply(null,[lk.types.mvex,...i])}static mvhd(t,e){e*=t;const i=Math.floor(e/(ck+1)),r=Math.floor(e%(ck+1)),a=new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,t>>24&255,t>>16&255,t>>8&255,255&t,i>>24,i>>16&255,i>>8&255,255&i,r>>24,r>>16&255,r>>8&255,255&r,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255]);return lk.box(lk.types.mvhd,a)}static sdtp(t){const e=t.samples||[],i=new Uint8Array(4+e.length);let r,a;for(r=0;r<e.length;r++)a=e[r].flags,i[r+4]=a.dependsOn<<4|a.isDependedOn<<2|a.hasRedundancy;return lk.box(lk.types.sdtp,i)}static stbl(t){return lk.box(lk.types.stbl,lk.stsd(t),lk.box(lk.types.stts,lk.STTS),lk.box(lk.types.stsc,lk.STSC),lk.box(lk.types.stsz,lk.STSZ),lk.box(lk.types.stco,lk.STCO))}static avc1(t){let e,i,r,a=[],s=[];for(e=0;e<t.sps.length;e++)i=t.sps[e],r=i.byteLength,a.push(r>>>8&255),a.push(255&r),a=a.concat(Array.prototype.slice.call(i));for(e=0;e<t.pps.length;e++)i=t.pps[e],r=i.byteLength,s.push(r>>>8&255),s.push(255&r),s=s.concat(Array.prototype.slice.call(i));const n=lk.box(lk.types.avcC,new Uint8Array([1,a[3],a[4],a[5],255,224|t.sps.length].concat(a).concat([t.pps.length]).concat(s))),o=t.width,c=t.height,l=t.pixelRatio[0],d=t.pixelRatio[1];return lk.box(lk.types.avc1,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,o>>8&255,255&o,c>>8&255,255&c,0,72,0,0,0,72,0,0,0,0,0,0,0,1,18,100,97,105,108,121,109,111,116,105,111,110,47,104,108,115,46,106,115,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,17,17]),n,lk.box(lk.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),lk.box(lk.types.pasp,new Uint8Array([l>>24,l>>16&255,l>>8&255,255&l,d>>24,d>>16&255,d>>8&255,255&d])))}static esds(t){const e=t.config.length;return new Uint8Array([0,0,0,0,3,23+e,0,1,0,4,15+e,64,21,0,0,0,0,0,0,0,0,0,0,0,5].concat([e]).concat(t.config).concat([6,1,2]))}static audioStsd(t){const e=t.samplerate;return new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,t.channelCount,0,16,0,0,0,0,e>>8&255,255&e,0,0])}static mp4a(t){return lk.box(lk.types.mp4a,lk.audioStsd(t),lk.box(lk.types.esds,lk.esds(t)))}static mp3(t){return lk.box(lk.types[".mp3"],lk.audioStsd(t))}static ac3(t){return lk.box(lk.types["ac-3"],lk.audioStsd(t),lk.box(lk.types.dac3,t.config))}static stsd(t){return"audio"===t.type?"mp3"===t.segmentCodec&&"mp3"===t.codec?lk.box(lk.types.stsd,lk.STSD,lk.mp3(t)):"ac3"===t.segmentCodec?lk.box(lk.types.stsd,lk.STSD,lk.ac3(t)):lk.box(lk.types.stsd,lk.STSD,lk.mp4a(t)):lk.box(lk.types.stsd,lk.STSD,lk.avc1(t))}static tkhd(t){const e=t.id,i=t.duration*t.timescale,r=t.width,a=t.height,s=Math.floor(i/(ck+1)),n=Math.floor(i%(ck+1));return lk.box(lk.types.tkhd,new Uint8Array([1,0,0,7,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,e>>24&255,e>>16&255,e>>8&255,255&e,0,0,0,0,s>>24,s>>16&255,s>>8&255,255&s,n>>24,n>>16&255,n>>8&255,255&n,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,r>>8&255,255&r,0,0,a>>8&255,255&a,0,0]))}static traf(t,e){const i=lk.sdtp(t),r=t.id,a=Math.floor(e/(ck+1)),s=Math.floor(e%(ck+1));return lk.box(lk.types.traf,lk.box(lk.types.tfhd,new Uint8Array([0,0,0,0,r>>24,r>>16&255,r>>8&255,255&r])),lk.box(lk.types.tfdt,new Uint8Array([1,0,0,0,a>>24,a>>16&255,a>>8&255,255&a,s>>24,s>>16&255,s>>8&255,255&s])),lk.trun(t,i.length+16+20+8+16+8+8),i)}static trak(t){return t.duration=t.duration||4294967295,lk.box(lk.types.trak,lk.tkhd(t),lk.mdia(t))}static trex(t){const e=t.id;return lk.box(lk.types.trex,new Uint8Array([0,0,0,0,e>>24,e>>16&255,e>>8&255,255&e,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]))}static trun(t,e){const i=t.samples||[],r=i.length,a=12+16*r,s=new Uint8Array(a);let n,o,c,l,d,h;for(e+=8+a,s.set(["video"===t.type?1:0,0,15,1,r>>>24&255,r>>>16&255,r>>>8&255,255&r,e>>>24&255,e>>>16&255,e>>>8&255,255&e],0),n=0;n<r;n++)o=i[n],c=o.duration,l=o.size,d=o.flags,h=o.cts,s.set([c>>>24&255,c>>>16&255,c>>>8&255,255&c,l>>>24&255,l>>>16&255,l>>>8&255,255&l,d.isLeading<<2|d.dependsOn,d.isDependedOn<<6|d.hasRedundancy<<4|d.paddingValue<<1|d.isNonSync,61440&d.degradPrio,15&d.degradPrio,h>>>24&255,h>>>16&255,h>>>8&255,255&h],12+16*n);return lk.box(lk.types.trun,s)}static initSegment(t){lk.types||lk.init();const e=lk.moov(t);return $f(lk.FTYP,e)}}lk.types=void 0,lk.HDLR_TYPES=void 0,lk.STTS=void 0,lk.STSC=void 0,lk.STCO=void 0,lk.STSZ=void 0,lk.VMHD=void 0,lk.SMHD=void 0,lk.STSD=void 0,lk.FTYP=void 0,lk.DINF=void 0;function dk(t,e,i=1,r=!1){const a=t*e*i;return r?Math.round(a):a}function hk(t,e=!1){return dk(t,1e3,1/9e4,e)}let pk,gk=null,uk=null;class fk{constructor(t,e,i,r=""){if(this.observer=void 0,this.config=void 0,this.typeSupported=void 0,this.ISGenerated=!1,this._initPTS=null,this._initDTS=null,this.nextAvcDts=null,this.nextAudioPts=null,this.videoSampleDuration=null,this.isAudioContiguous=!1,this.isVideoContiguous=!1,this.videoTrackConfig=void 0,this.observer=t,this.config=e,this.typeSupported=i,this.ISGenerated=!1,null===gk){const t=(navigator.userAgent||"").match(/Chrome\/(\d+)/i);gk=t?parseInt(t[1]):0}if(null===uk){const t=navigator.userAgent.match(/Safari\/(\d+)/i);uk=t?parseInt(t[1]):0}}destroy(){this.config=this.videoTrackConfig=this._initPTS=this._initDTS=null}resetTimeStamp(t){ku.log("[mp4-remuxer]: initPTS & initDTS reset"),this._initPTS=this._initDTS=t}resetNextTimestamp(){ku.log("[mp4-remuxer]: reset next timestamp"),this.isVideoContiguous=!1,this.isAudioContiguous=!1}resetInitSegment(){ku.log("[mp4-remuxer]: ISGenerated flag reset"),this.ISGenerated=!1,this.videoTrackConfig=void 0}getVideoStartPts(t){let e=!1;const i=t[0].pts,r=t.reduce(((t,r)=>{let a=r.pts,s=a-t;return s<-4294967296&&(e=!0,a=mk(a,i),s=a-t),s>0?t:a}),i);return e&&ku.debug("PTS rollover detected"),r}remux(t,e,i,r,a,s,n,o){let c,l,d,h,p,g,u=a,f=a;const m=t.pid>-1,v=e.pid>-1,b=e.samples.length,k=t.samples.length>0,y=n&&b>0||b>1;if((!m||k)&&(!v||y)||this.ISGenerated||n){if(this.ISGenerated){var w,x,S,P;const t=this.videoTrackConfig;!t||e.width===t.width&&e.height===t.height&&(null==(w=e.pixelRatio)?void 0:w[0])===(null==(x=t.pixelRatio)?void 0:x[0])&&(null==(S=e.pixelRatio)?void 0:S[1])===(null==(P=t.pixelRatio)?void 0:P[1])||this.resetInitSegment()}else d=this.generateIS(t,e,a,s);const i=this.isVideoContiguous;let r,n=-1;if(y&&(n=function(t){for(let e=0;e<t.length;e++)if(t[e].key)return e;return-1}(e.samples),!i&&this.config.forceKeyFrameOnDiscontinuity))if(g=!0,n>0){ku.warn(`[mp4-remuxer]: Dropped ${n} out of ${b} video samples due to a missing keyframe`);const t=this.getVideoStartPts(e.samples);e.samples=e.samples.slice(n),e.dropped+=n,f+=(e.samples[0].pts-t)/e.inputTimeScale,r=f}else-1===n&&(ku.warn(`[mp4-remuxer]: No keyframe found out of ${b} video samples`),g=!1);if(this.ISGenerated){if(k&&y){const i=this.getVideoStartPts(e.samples),r=(mk(t.samples[0].pts,i)-i)/e.inputTimeScale;u+=Math.max(0,r),f+=Math.max(0,-r)}if(k){if(t.samplerate||(ku.warn("[mp4-remuxer]: regenerate InitSegment as audio detected"),d=this.generateIS(t,e,a,s)),l=this.remuxAudio(t,u,this.isAudioContiguous,s,v||y||o===Tm?f:void 0),y){const r=l?l.endPTS-l.startPTS:0;e.inputTimeScale||(ku.warn("[mp4-remuxer]: regenerate InitSegment as video detected"),d=this.generateIS(t,e,a,s)),c=this.remuxVideo(e,f,i,r)}}else y&&(c=this.remuxVideo(e,f,i,0));c&&(c.firstKeyFrame=n,c.independent=-1!==n,c.firstKeyFramePTS=r)}}return this.ISGenerated&&this._initPTS&&this._initDTS&&(i.samples.length&&(p=vk(i,a,this._initPTS,this._initDTS)),r.samples.length&&(h=bk(r,a,this._initPTS))),{audio:l,video:c,initSegment:d,independent:g,text:h,id3:p}}generateIS(t,e,i,r){const a=t.samples,s=e.samples,n=this.typeSupported,o={},c=this._initPTS;let l,d,h,p=!c||r,g="audio/mp4";if(p&&(l=d=1/0),t.config&&a.length){switch(t.timescale=t.samplerate,t.segmentCodec){case"mp3":n.mpeg?(g="audio/mpeg",t.codec=""):n.mp3&&(t.codec="mp3");break;case"ac3":t.codec="ac-3"}o.audio={id:"audio",container:g,codec:t.codec,initSegment:"mp3"===t.segmentCodec&&n.mpeg?new Uint8Array(0):lk.initSegment([t]),metadata:{channelCount:t.channelCount}},p&&(h=t.inputTimeScale,c&&h===c.timescale?p=!1:l=d=a[0].pts-Math.round(h*i))}if(e.sps&&e.pps&&s.length){if(e.timescale=e.inputTimeScale,o.video={id:"main",container:"video/mp4",codec:e.codec,initSegment:lk.initSegment([e]),metadata:{width:e.width,height:e.height}},p)if(h=e.inputTimeScale,c&&h===c.timescale)p=!1;else{const t=this.getVideoStartPts(s),e=Math.round(h*i);d=Math.min(d,mk(s[0].dts,t)-e),l=Math.min(l,t-e)}this.videoTrackConfig={width:e.width,height:e.height,pixelRatio:e.pixelRatio}}if(Object.keys(o).length)return this.ISGenerated=!0,p?(this._initPTS={baseTime:l,timescale:h},this._initDTS={baseTime:d,timescale:h}):l=h=void 0,{tracks:o,initPTS:l,timescale:h}}remuxVideo(t,e,i,r){const a=t.inputTimeScale,s=t.samples,n=[],o=s.length,c=this._initPTS;let l,d,h=this.nextAvcDts,p=8,g=this.videoSampleDuration,u=Number.POSITIVE_INFINITY,f=Number.NEGATIVE_INFINITY,m=!1;if(!i||null===h){const t=e*a,r=s[0].pts-mk(s[0].dts,s[0].pts);gk&&null!==h&&Math.abs(t-r-h)<15e3?i=!0:h=t-r}const v=c.baseTime*a/c.timescale;for(let t=0;t<o;t++){const e=s[t];e.pts=mk(e.pts-v,h),e.dts=mk(e.dts-v,h),e.dts<s[t>0?t-1:t].dts&&(m=!0)}m&&s.sort((function(t,e){const i=t.dts-e.dts,r=t.pts-e.pts;return i||r})),l=s[0].dts,d=s[s.length-1].dts;const b=d-l,k=b?Math.round(b/(o-1)):g||t.inputTimeScale/30;if(i){const t=l-h,i=t>k,r=t<-1;if((i||r)&&(i?ku.warn(`AVC: ${hk(t,!0)} ms (${t}dts) hole between fragments detected at ${e.toFixed(3)}`):ku.warn(`AVC: ${hk(-t,!0)} ms (${t}dts) overlapping between fragments detected at ${e.toFixed(3)}`),!r||h>=s[0].pts||gk)){l=h;const e=s[0].pts-t;if(i)s[0].dts=l,s[0].pts=e;else for(let i=0;i<s.length&&!(s[i].dts>e);i++)s[i].dts-=t,s[i].pts-=t;ku.log(`Video: Initial PTS/DTS adjusted: ${hk(e,!0)}/${hk(l,!0)}, delta: ${hk(t,!0)} ms`)}}l=Math.max(0,l);let y=0,w=0,x=l;for(let t=0;t<o;t++){const e=s[t],i=e.units,r=i.length;let a=0;for(let t=0;t<r;t++)a+=i[t].data.length;w+=a,y+=r,e.length=a,e.dts<x?(e.dts=x,x+=k/4|0||1):x=e.dts,u=Math.min(e.pts,u),f=Math.max(e.pts,f)}d=s[o-1].dts;const S=w+4*y+8;let P;try{P=new Uint8Array(S)}catch(t){return void this.observer.emit(pu.ERROR,pu.ERROR,{type:gu.MUX_ERROR,details:uu.REMUX_ALLOC_ERROR,fatal:!1,error:t,bytes:S,reason:`fail allocating video mdat ${S}`})}const C=new DataView(P.buffer);C.setUint32(0,S),P.set(lk.types.mdat,4);let E=!1,T=Number.POSITIVE_INFINITY,L=Number.POSITIVE_INFINITY,_=Number.NEGATIVE_INFINITY,R=Number.NEGATIVE_INFINITY;for(let t=0;t<o;t++){const e=s[t],i=e.units;let c,l=0;for(let t=0,e=i.length;t<e;t++){const e=i[t],r=e.data,a=e.data.byteLength;C.setUint32(p,a),p+=4,P.set(r,p),p+=a,l+=4+a}if(t<o-1)g=s[t+1].dts-e.dts,c=s[t+1].pts-e.pts;else{const i=this.config,n=t>0?e.dts-s[t-1].dts:k;if(c=t>0?e.pts-s[t-1].pts:k,i.stretchShortVideoTrack&&null!==this.nextAudioPts){const t=Math.floor(i.maxBufferHole*a),s=(r?u+r*a:this.nextAudioPts)-e.pts;s>t?(g=s-n,g<0?g=n:E=!0,ku.log(`[mp4-remuxer]: It is approximately ${s/90} ms to the next segment; using duration ${g/90} ms for the last video frame.`)):g=n}else g=n}const d=Math.round(e.pts-e.dts);T=Math.min(T,g),_=Math.max(_,g),L=Math.min(L,c),R=Math.max(R,c),n.push(new kk(e.key,g,l,d))}if(n.length)if(gk){if(gk<70){const t=n[0].flags;t.dependsOn=2,t.isNonSync=0}}else if(uk&&R-L<_-T&&k/_<.025&&0===n[0].cts){ku.warn("Found irregular gaps in sample duration. Using PTS instead of DTS to determine MP4 sample duration.");let t=l;for(let e=0,i=n.length;e<i;e++){const r=t+n[e].duration,a=t+n[e].cts;if(e<i-1){const t=r+n[e+1].cts;n[e].duration=t-a}else n[e].duration=e?n[e-1].duration:k;n[e].cts=0,t=r}}g=E||!g?k:g,this.nextAvcDts=h=d+g,this.videoSampleDuration=g,this.isVideoContiguous=!0;const A={data1:lk.moof(t.sequenceNumber++,l,cu({},t,{samples:n})),data2:P,startPTS:u/a,endPTS:(f+g)/a,startDTS:l/a,endDTS:h/a,type:"video",hasAudio:!1,hasVideo:!0,nb:n.length,dropped:t.dropped};return t.samples=[],t.dropped=0,A}getSamplesPerFrame(t){switch(t.segmentCodec){case"mp3":return 1152;case"ac3":return 1536;default:return 1024}}remuxAudio(t,e,i,r,a){const s=t.inputTimeScale,n=s/(t.samplerate?t.samplerate:s),o=this.getSamplesPerFrame(t),c=o*n,l=this._initPTS,d="mp3"===t.segmentCodec&&this.typeSupported.mpeg,h=[],p=void 0!==a;let g=t.samples,u=d?0:8,f=this.nextAudioPts||-1;const m=e*s,v=l.baseTime*s/l.timescale;if(this.isAudioContiguous=i=i||g.length&&f>0&&(r&&Math.abs(m-f)<9e3||Math.abs(mk(g[0].pts-v,m)-f)<20*c),g.forEach((function(t){t.pts=mk(t.pts-v,m)})),!i||f<0){if(g=g.filter((t=>t.pts>=0)),!g.length)return;f=0===a?0:r&&!p?Math.max(0,m):g[0].pts}if("aac"===t.segmentCodec){const e=this.config.maxAudioFramesDrift;for(let i=0,r=f;i<g.length;i++){const a=g[i],n=a.pts,o=n-r,l=Math.abs(1e3*o/s);if(o<=-e*c&&p)0===i&&(ku.warn(`Audio frame @ ${(n/s).toFixed(3)}s overlaps nextAudioPts by ${Math.round(1e3*o/s)} ms.`),this.nextAudioPts=f=r=n);else if(o>=e*c&&l<1e4&&p){let e=Math.round(o/c);r=n-e*c,r<0&&(e--,r+=c),0===i&&(this.nextAudioPts=f=r),ku.warn(`[mp4-remuxer]: Injecting ${e} audio frame @ ${(r/s).toFixed(3)}s due to ${Math.round(1e3*o/s)} ms gap.`);for(let s=0;s<e;s++){const e=Math.max(r,0);let s=ok.getSilentFrame(t.manifestCodec||t.codec,t.channelCount);s||(ku.log("[mp4-remuxer]: Unable to get silent frame for given audio codec; duplicating last frame instead."),s=a.unit.subarray()),g.splice(i,0,{unit:s,pts:e}),r+=c,i++}}a.pts=r,r+=c}}let b,k=null,y=null,w=0,x=g.length;for(;x--;)w+=g[x].unit.byteLength;for(let e=0,r=g.length;e<r;e++){const r=g[e],a=r.unit;let s=r.pts;if(null!==y){h[e-1].duration=Math.round((s-y)/n)}else{if(i&&"aac"===t.segmentCodec&&(s=f),k=s,!(w>0))return;w+=u;try{b=new Uint8Array(w)}catch(t){return void this.observer.emit(pu.ERROR,pu.ERROR,{type:gu.MUX_ERROR,details:uu.REMUX_ALLOC_ERROR,fatal:!1,error:t,bytes:w,reason:`fail allocating audio mdat ${w}`})}if(!d){new DataView(b.buffer).setUint32(0,w),b.set(lk.types.mdat,4)}}b.set(a,u);const c=a.byteLength;u+=c,h.push(new kk(!0,o,c,0)),y=s}const S=h.length;if(!S)return;const P=h[h.length-1];this.nextAudioPts=f=y+n*P.duration;const C=d?new Uint8Array(0):lk.moof(t.sequenceNumber++,k/n,cu({},t,{samples:h}));t.samples=[];const E=k/s,T=f/s,L={data1:C,data2:b,startPTS:E,endPTS:T,startDTS:E,endDTS:T,type:"audio",hasAudio:!0,hasVideo:!1,nb:S};return this.isAudioContiguous=!0,L}remuxEmptyAudio(t,e,i,r){const a=t.inputTimeScale,s=a/(t.samplerate?t.samplerate:a),n=this.nextAudioPts,o=this._initDTS,c=9e4*o.baseTime/o.timescale,l=(null!==n?n:r.startDTS*a)+c,d=r.endDTS*a+c,h=1024*s,p=Math.ceil((d-l)/h),g=ok.getSilentFrame(t.manifestCodec||t.codec,t.channelCount);if(ku.warn("[mp4-remuxer]: remux empty Audio"),!g)return void ku.trace("[mp4-remuxer]: Unable to remuxEmptyAudio since we were unable to get a silent frame for given audio codec");const u=[];for(let t=0;t<p;t++){const e=l+t*h;u.push({unit:g,pts:e,dts:e})}return t.samples=u,this.remuxAudio(t,e,i,!1)}}function mk(t,e){let i;if(null===e)return t;for(i=e<t?-8589934592:8589934592;Math.abs(t-e)>4294967296;)t+=i;return t}function vk(t,e,i,r){const a=t.samples.length;if(!a)return;const s=t.inputTimeScale;for(let n=0;n<a;n++){const a=t.samples[n];a.pts=mk(a.pts-i.baseTime*s/i.timescale,e*s)/s,a.dts=mk(a.dts-r.baseTime*s/r.timescale,e*s)/s}const n=t.samples;return t.samples=[],{samples:n}}function bk(t,e,i){const r=t.samples.length;if(!r)return;const a=t.inputTimeScale;for(let s=0;s<r;s++){const r=t.samples[s];r.pts=mk(r.pts-i.baseTime*a/i.timescale,e*a)/a}t.samples.sort(((t,e)=>t.pts-e.pts));const s=t.samples;return t.samples=[],{samples:s}}class kk{constructor(t,e,i,r){this.size=void 0,this.duration=void 0,this.cts=void 0,this.flags=void 0,this.duration=e,this.size=i,this.cts=r,this.flags={isLeading:0,isDependedOn:0,hasRedundancy:0,degradPrio:0,dependsOn:t?2:1,isNonSync:t?0:1}}}function yk(t,e){const i=null==t?void 0:t.codec;if(i&&i.length>4)return i;if(e===Eu){if("ec-3"===i||"ac-3"===i||"alac"===i)return i;if("fLaC"===i||"Opus"===i){return om(i,!1)}const t="mp4a.40.5";return ku.info(`Parsed audio codec "${i}" or audio object type not handled. Using "${t}"`),t}return ku.warn(`Unhandled video codec "${i}"`),"hvc1"===i||"hev1"===i?"hvc1.1.6.L120.90":"av01"===i?"av01.0.04M.08":"avc1.42e01e"}try{pk=self.performance.now.bind(self.performance)}catch(_){ku.debug("Unable to use Performance API on this environment"),pk=null==Uu?void 0:Uu.Date.now}const wk=[{demux:class{constructor(t,e){this.remainderData=null,this.timeOffset=0,this.config=void 0,this.videoTrack=void 0,this.audioTrack=void 0,this.id3Track=void 0,this.txtTrack=void 0,this.config=e}resetTimeStamp(){}resetInitSegment(t,e,i,r){const a=this.videoTrack=Pb("video",1),s=this.audioTrack=Pb("audio",1),n=this.txtTrack=Pb("text",1);if(this.id3Track=Pb("id3",1),this.timeOffset=0,null==t||!t.byteLength)return;const o=Rf(t);if(o.video){const{id:t,timescale:e,codec:i}=o.video;a.id=t,a.timescale=n.timescale=e,a.codec=i}if(o.audio){const{id:t,timescale:e,codec:i}=o.audio;s.id=t,s.timescale=e,s.codec=i}n.id=wf.text,a.sampleDuration=0,a.duration=s.duration=r}resetContiguity(){this.remainderData=null}static probe(t){return function(t){const e=t.byteLength;for(let i=0;i<e;){const r=Pf(t,i);if(r>8&&109===t[i+4]&&111===t[i+5]&&111===t[i+6]&&102===t[i+7])return!0;i=r>1?i+r:e}return!1}(t)}demux(t,e){this.timeOffset=e;let i=t;const r=this.videoTrack,a=this.txtTrack;if(this.config.progressive){this.remainderData&&(i=$f(this.remainderData,t));const e=function(t){const e={valid:null,remainder:null},i=Lf(t,["moof"]);if(i.length<2)return e.remainder=t,e;const r=i[i.length-1];return e.valid=Xu(t,0,r.byteOffset-8),e.remainder=Xu(t,r.byteOffset-8),e}(i);this.remainderData=e.remainder,r.samples=e.valid||new Uint8Array}else r.samples=i;const s=this.extractID3Track(r,e);return a.samples=Ff(e,r),{videoTrack:r,audioTrack:this.audioTrack,id3Track:s,textTrack:this.txtTrack}}flush(){const t=this.timeOffset,e=this.videoTrack,i=this.txtTrack;e.samples=this.remainderData||new Uint8Array,this.remainderData=null;const r=this.extractID3Track(e,this.timeOffset);return i.samples=Ff(t,e),{videoTrack:e,audioTrack:Pb(),id3Track:r,textTrack:Pb()}}extractID3Track(t,e){const i=this.id3Track;if(t.samples.length){const r=Lf(t.samples,["emsg"]);r&&r.forEach((t=>{const r=function(t){const e=t[0];let i="",r="",a=0,s=0,n=0,o=0,c=0,l=0;if(0===e){for(;"\0"!==xf(t.subarray(l,l+1));)i+=xf(t.subarray(l,l+1)),l+=1;for(i+=xf(t.subarray(l,l+1)),l+=1;"\0"!==xf(t.subarray(l,l+1));)r+=xf(t.subarray(l,l+1)),l+=1;r+=xf(t.subarray(l,l+1)),l+=1,a=Pf(t,12),s=Pf(t,16),o=Pf(t,20),c=Pf(t,24),l=28}else if(1===e){l+=4,a=Pf(t,l),l+=4;const e=Pf(t,l);l+=4;const s=Pf(t,l);for(l+=4,n=2**32*e+s,du(n)||(n=Number.MAX_SAFE_INTEGER,ku.warn("Presentation time exceeds safe integer limit and wrapped to max safe integer in parsing emsg box")),o=Pf(t,l),l+=4,c=Pf(t,l),l+=4;"\0"!==xf(t.subarray(l,l+1));)i+=xf(t.subarray(l,l+1)),l+=1;for(i+=xf(t.subarray(l,l+1)),l+=1;"\0"!==xf(t.subarray(l,l+1));)r+=xf(t.subarray(l,l+1)),l+=1;r+=xf(t.subarray(l,l+1)),l+=1}return{schemeIdUri:i,value:r,timeScale:a,presentationTime:n,presentationTimeDelta:s,eventDuration:o,id:c,payload:t.subarray(l,t.byteLength)}}(t);if(Vb.test(r.schemeIdUri)){const t=lu(r.presentationTime)?r.presentationTime/r.timeScale:e+r.presentationTimeDelta/r.timeScale;let a=4294967295===r.eventDuration?Number.POSITIVE_INFINITY:r.eventDuration/r.timeScale;a<=.001&&(a=Number.POSITIVE_INFINITY);const s=r.payload;i.samples.push({data:s,len:s.byteLength,dts:t,pts:t,type:jm,duration:a})}}))}return i}demuxSampleAes(t,e,i){return Promise.reject(new Error("The MP4 demuxer does not support SAMPLE-AES decryption"))}destroy(){}},remux:class{constructor(){this.emitInitSegment=!1,this.audioCodec=void 0,this.videoCodec=void 0,this.initData=void 0,this.initPTS=null,this.initTracks=void 0,this.lastEndTime=null}destroy(){}resetTimeStamp(t){this.initPTS=t,this.lastEndTime=null}resetNextTimestamp(){this.lastEndTime=null}resetInitSegment(t,e,i,r){this.audioCodec=e,this.videoCodec=i,this.generateInitSegment(function(t,e){if(!t||!e)return t;const i=e.keyId;i&&e.isCommonEncryption&&Lf(t,["moov","trak"]).forEach((t=>{const e=Lf(t,["mdia","minf","stbl","stsd"])[0].subarray(8);let r=Lf(e,["enca"]);const a=r.length>0;a||(r=Lf(e,["encv"])),r.forEach((t=>{Lf(a?t.subarray(28):t.subarray(78),["sinf"]).forEach((t=>{const e=Of(t);if(e){const t=e.subarray(8,24);t.some((t=>0!==t))||(ku.log(`[eme] Patching keyId in 'enc${a?"a":"v"}>sinf>>tenc' box: ${bf(t)} -> ${bf(i)}`),e.set(i,8))}}))}))}));return t}(t,r)),this.emitInitSegment=!0}generateInitSegment(t){let{audioCodec:e,videoCodec:i}=this;if(null==t||!t.byteLength)return this.initTracks=void 0,void(this.initData=void 0);const r=this.initData=Rf(t);r.audio&&(e=yk(r.audio,Eu)),r.video&&(i=yk(r.video,Tu));const a={};r.audio&&r.video?a.audiovideo={container:"video/mp4",codec:e+","+i,initSegment:t,id:"main"}:r.audio?a.audio={container:"audio/mp4",codec:e,initSegment:t,id:"audio"}:r.video?a.video={container:"video/mp4",codec:i,initSegment:t,id:"main"}:ku.warn("[passthrough-remuxer.ts]: initSegment does not contain moov or trak boxes."),this.initTracks=a}remux(t,e,i,r,a,s){var n,o;let{initPTS:c,lastEndTime:l}=this;const d={audio:void 0,video:void 0,text:r,id3:i,initSegment:void 0};lu(l)||(l=this.lastEndTime=a||0);const h=e.samples;if(null==h||!h.length)return d;const p={initPTS:void 0,timescale:1};let g=this.initData;if(null!=(n=g)&&n.length||(this.generateInitSegment(h),g=this.initData),null==(o=g)||!o.length)return ku.warn("[passthrough-remuxer.ts]: Failed to generate initSegment."),d;this.emitInitSegment&&(p.tracks=this.initTracks,this.emitInitSegment=!1);const u=function(t,e){let i=0,r=0,a=0;const s=Lf(t,["moof","traf"]);for(let t=0;t<s.length;t++){const n=s[t],o=Lf(n,["tfhd"])[0],c=e[Pf(o,4)];if(!c)continue;const l=c.default,d=Pf(o,0)|(null==l?void 0:l.flags);let h=null==l?void 0:l.duration;8&d&&(h=Pf(o,2&d?12:8));const p=c.timescale||9e4,g=Lf(n,["trun"]);for(let t=0;t<g.length;t++)i=Uf(g[t]),!i&&h&&(i=h*Pf(g[t],4)),c.type===Tu?r+=i/p:c.type===Eu&&(a+=i/p)}if(0===r&&0===a){let e=1/0,i=0,r=0;const a=Lf(t,["sidx"]);for(let t=0;t<a.length;t++){const s=_f(a[t]);if(null!=s&&s.references){e=Math.min(e,s.earliestPresentationTime/s.timescale);const t=s.references.reduce(((t,e)=>t+e.info.duration||0),0);i=Math.max(i,t+s.earliestPresentationTime/s.timescale),r=i-e}}if(r&&lu(r))return r}return r||a}(h,g),f=function(t,e){return Lf(e,["moof","traf"]).reduce(((e,i)=>{const r=Lf(i,["tfdt"])[0],a=r[0],s=Lf(i,["tfhd"]).reduce(((e,i)=>{const s=Pf(i,4),n=t[s];if(n){let t=Pf(r,4);if(1===a){if(t===kf)return ku.warn("[mp4-demuxer]: Ignoring assumed invalid signed 64-bit track fragment decode time"),e;t*=kf+1,t+=Pf(r,8)}const i=t/(n.timescale||9e4);if(lu(i)&&(null===e||i<e))return i}return e}),null);return null!==s&&lu(s)&&(null===e||s<e)?s:e}),null)}(g,h),m=null===f?a:f;(function(t,e,i,r){if(null===t)return!0;const a=Math.max(r,1),s=e-t.baseTime/t.timescale;return Math.abs(s-i)>a}(c,m,a,u)||p.timescale!==c.timescale&&s)&&(p.initPTS=m-a,c&&1===c.timescale&&ku.warn("Adjusting initPTS by "+(p.initPTS-c.baseTime)),this.initPTS=c={baseTime:p.initPTS,timescale:1});const v=t?m-c.baseTime/c.timescale:l,b=v+u;!function(t,e,i){Lf(e,["moof","traf"]).forEach((e=>{Lf(e,["tfhd"]).forEach((r=>{const a=Pf(r,4),s=t[a];if(!s)return;const n=s.timescale||9e4;Lf(e,["tfdt"]).forEach((t=>{const e=t[0],r=i*n;if(r){let i=Pf(t,4);if(0===e)i-=r,i=Math.max(i,0),Tf(t,4,i);else{i*=Math.pow(2,32),i+=Pf(t,8),i-=r,i=Math.max(i,0);const e=Math.floor(i/(kf+1)),a=Math.floor(i%(kf+1));Tf(t,4,e),Tf(t,8,a)}}}))}))}))}(g,h,c.baseTime/c.timescale),u>0?this.lastEndTime=b:(ku.warn("Duration parsed from mp4 should be greater than zero"),this.resetNextTimestamp());const k=!!g.audio,y=!!g.video;let w="";k&&(w+="audio"),y&&(w+="video");const x={data1:h,startPTS:v,startDTS:v,endPTS:b,endDTS:b,type:w,hasAudio:k,hasVideo:y,nb:1,dropped:0};return d.audio="audio"===x.type?x:void 0,d.video="audio"!==x.type?x:void 0,d.initSegment=p,d.id3=vk(i,a,c,c),r.samples.length&&(d.text=bk(r,a,c)),d}}},{demux:tk,remux:fk},{demux:class extends Cb{constructor(t,e){super(),this.observer=void 0,this.config=void 0,this.observer=t,this.config=e}resetInitSegment(t,e,i,r){super.resetInitSegment(t,e,i,r),this._audioTrack={container:"audio/adts",type:"audio",id:2,pid:-1,sequenceNumber:0,segmentCodec:"aac",samples:[],manifestCodec:e,duration:r,inputTimeScale:9e4,dropped:0}}static probe(t){if(!t)return!1;const e=rf(t,0);let i=(null==e?void 0:e.length)||0;if(Gb(t,i))return!1;for(let e=t.length;i<e;i++)if(Ab(t,i))return ku.log("ADTS sync word found !"),!0;return!1}canParse(t,e){return function(t,e){return function(t,e){return e+5<t.length}(t,e)&&Tb(t,e)&&_b(t,e)<=t.length-e}(t,e)}appendFrame(t,e,i){Db(t,this.observer,e,i,t.manifestCodec);const r=Ib(t,e,i,this.basePTS,this.frameIndex);if(r&&0===r.missing)return r}},remux:fk},{demux:class extends Cb{resetInitSegment(t,e,i,r){super.resetInitSegment(t,e,i,r),this._audioTrack={container:"audio/mpeg",type:"audio",id:2,pid:-1,sequenceNumber:0,segmentCodec:"mp3",samples:[],manifestCodec:e,duration:r,inputTimeScale:9e4,dropped:0}}static probe(t){if(!t)return!1;const e=rf(t,0);let i=(null==e?void 0:e.length)||0;if(e&&11===t[i]&&119===t[i+1]&&void 0!==nf(e)&&qb(t,i)<=16)return!1;for(let e=t.length;i<e;i++)if(Gb(t,i))return ku.log("MPEG Audio sync word found !"),!0;return!1}canParse(t,e){return function(t,e){return Bb(t,e)&&4<=t.length-e}(t,e)}appendFrame(t,e,i){if(null!==this.basePTS)return zb(t,e,i,this.basePTS,this.frameIndex)}},remux:fk}];wk.splice(2,0,{demux:Kb,remux:fk});class xk{constructor(t,e,i,r,a){this.async=!1,this.observer=void 0,this.typeSupported=void 0,this.config=void 0,this.vendor=void 0,this.id=void 0,this.demuxer=void 0,this.remuxer=void 0,this.decrypter=void 0,this.probe=void 0,this.decryptionPromise=null,this.transmuxConfig=void 0,this.currentTransmuxState=void 0,this.observer=t,this.typeSupported=e,this.config=i,this.vendor=r,this.id=a}configure(t){this.transmuxConfig=t,this.decrypter&&this.decrypter.reset()}push(t,e,i,r){const a=i.transmuxing;a.executeStart=pk();let s=new Uint8Array(t);const{currentTransmuxState:n,transmuxConfig:o}=this;r&&(this.currentTransmuxState=r);const{contiguous:c,discontinuity:l,trackSwitch:d,accurateTimeOffset:h,timeOffset:p,initSegmentChange:g}=r||n,{audioCodec:u,videoCodec:f,defaultInitPts:m,duration:v,initSegmentData:b}=o,k=function(t,e){let i=null;t.byteLength>0&&null!=(null==e?void 0:e.key)&&null!==e.iv&&null!=e.method&&(i=e);return i}(s,e);if(k&&"AES-128"===k.method){const t=this.getDecrypter();if(!t.isSync())return this.decryptionPromise=t.webCryptoDecrypt(s,k.key.buffer,k.iv.buffer).then((t=>{const e=this.push(t,null,i);return this.decryptionPromise=null,e})),this.decryptionPromise;{let e=t.softwareDecrypt(s,k.key.buffer,k.iv.buffer);if(i.part>-1&&(e=t.flush()),!e)return a.executeEnd=pk(),Sk(i);s=new Uint8Array(e)}}const y=this.needsProbing(l,d);if(y){const t=this.configureTransmuxer(s);if(t)return ku.warn(`[transmuxer] ${t.message}`),this.observer.emit(pu.ERROR,pu.ERROR,{type:gu.MEDIA_ERROR,details:uu.FRAG_PARSING_ERROR,fatal:!1,error:t,reason:t.message}),a.executeEnd=pk(),Sk(i)}(l||d||g||y)&&this.resetInitSegment(b,u,f,v,e),(l||g||y)&&this.resetInitialTimestamp(m),c||this.resetContiguity();const w=this.transmux(s,k,p,h,i),x=this.currentTransmuxState;return x.contiguous=!0,x.discontinuity=!1,x.trackSwitch=!1,a.executeEnd=pk(),w}flush(t){const e=t.transmuxing;e.executeStart=pk();const{decrypter:i,currentTransmuxState:r,decryptionPromise:a}=this;if(a)return a.then((()=>this.flush(t)));const s=[],{timeOffset:n}=r;if(i){const e=i.flush();e&&s.push(this.push(e,null,t))}const{demuxer:o,remuxer:c}=this;if(!o||!c)return e.executeEnd=pk(),[Sk(t)];const l=o.flush(n);return Pk(l)?l.then((e=>(this.flushRemux(s,e,t),s))):(this.flushRemux(s,l,t),s)}flushRemux(t,e,i){const{audioTrack:r,videoTrack:a,id3Track:s,textTrack:n}=e,{accurateTimeOffset:o,timeOffset:c}=this.currentTransmuxState;ku.log(`[transmuxer.ts]: Flushed fragment ${i.sn}${i.part>-1?" p: "+i.part:""} of level ${i.level}`);const l=this.remuxer.remux(r,a,s,n,c,o,!0,this.id);t.push({remuxResult:l,chunkMeta:i}),i.transmuxing.executeEnd=pk()}resetInitialTimestamp(t){const{demuxer:e,remuxer:i}=this;e&&i&&(e.resetTimeStamp(t),i.resetTimeStamp(t))}resetContiguity(){const{demuxer:t,remuxer:e}=this;t&&e&&(t.resetContiguity(),e.resetNextTimestamp())}resetInitSegment(t,e,i,r,a){const{demuxer:s,remuxer:n}=this;s&&n&&(s.resetInitSegment(t,e,i,r),n.resetInitSegment(t,e,i,a))}destroy(){this.demuxer&&(this.demuxer.destroy(),this.demuxer=void 0),this.remuxer&&(this.remuxer.destroy(),this.remuxer=void 0)}transmux(t,e,i,r,a){let s;return s=e&&"SAMPLE-AES"===e.method?this.transmuxSampleAes(t,e,i,r,a):this.transmuxUnencrypted(t,i,r,a),s}transmuxUnencrypted(t,e,i,r){const{audioTrack:a,videoTrack:s,id3Track:n,textTrack:o}=this.demuxer.demux(t,e,!1,!this.config.progressive);return{remuxResult:this.remuxer.remux(a,s,n,o,e,i,!1,this.id),chunkMeta:r}}transmuxSampleAes(t,e,i,r,a){return this.demuxer.demuxSampleAes(t,e,i).then((t=>({remuxResult:this.remuxer.remux(t.audioTrack,t.videoTrack,t.id3Track,t.textTrack,i,r,!1,this.id),chunkMeta:a})))}configureTransmuxer(t){const{config:e,observer:i,typeSupported:r,vendor:a}=this;let s;for(let e=0,i=wk.length;e<i;e++){var n;if(null!=(n=wk[e].demux)&&n.probe(t)){s=wk[e];break}}if(!s)return new Error("Failed to find demuxer by probing fragment data");const o=this.demuxer,c=this.remuxer,l=s.remux,d=s.demux;c&&c instanceof l||(this.remuxer=new l(i,e,r,a)),o&&o instanceof d||(this.demuxer=new d(i,e,r),this.probe=d.probe)}needsProbing(t,e){return!this.demuxer||!this.remuxer||t||e}getDecrypter(){let t=this.decrypter;return t||(t=this.decrypter=new cb(this.config)),t}}const Sk=t=>({remuxResult:{},chunkMeta:t});function Pk(t){return"then"in t&&t.then instanceof Function}class Ck{constructor(t,e,i,r,a){this.audioCodec=void 0,this.videoCodec=void 0,this.initSegmentData=void 0,this.duration=void 0,this.defaultInitPts=void 0,this.audioCodec=t,this.videoCodec=e,this.initSegmentData=i,this.duration=r,this.defaultInitPts=a||null}}class Ek{constructor(t,e,i,r,a,s){this.discontinuity=void 0,this.contiguous=void 0,this.accurateTimeOffset=void 0,this.trackSwitch=void 0,this.timeOffset=void 0,this.initSegmentChange=void 0,this.discontinuity=t,this.contiguous=e,this.accurateTimeOffset=i,this.trackSwitch=r,this.timeOffset=a,this.initSegmentChange=s}}var Tk={exports:{}};!function(t){var e=Object.prototype.hasOwnProperty,i="~";function r(){}function a(t,e,i){this.fn=t,this.context=e,this.once=i||!1}function s(t,e,r,s,n){if("function"!=typeof r)throw new TypeError("The listener must be a function");var o=new a(r,s||t,n),c=i?i+e:e;return t._events[c]?t._events[c].fn?t._events[c]=[t._events[c],o]:t._events[c].push(o):(t._events[c]=o,t._eventsCount++),t}function n(t,e){0==--t._eventsCount?t._events=new r:delete t._events[e]}function o(){this._events=new r,this._eventsCount=0}Object.create&&(r.prototype=Object.create(null),(new r).__proto__||(i=!1)),o.prototype.eventNames=function(){var t,r,a=[];if(0===this._eventsCount)return a;for(r in t=this._events)e.call(t,r)&&a.push(i?r.slice(1):r);return Object.getOwnPropertySymbols?a.concat(Object.getOwnPropertySymbols(t)):a},o.prototype.listeners=function(t){var e=i?i+t:t,r=this._events[e];if(!r)return[];if(r.fn)return[r.fn];for(var a=0,s=r.length,n=new Array(s);a<s;a++)n[a]=r[a].fn;return n},o.prototype.listenerCount=function(t){var e=i?i+t:t,r=this._events[e];return r?r.fn?1:r.length:0},o.prototype.emit=function(t,e,r,a,s,n){var o=i?i+t:t;if(!this._events[o])return!1;var c,l,d=this._events[o],h=arguments.length;if(d.fn){switch(d.once&&this.removeListener(t,d.fn,void 0,!0),h){case 1:return d.fn.call(d.context),!0;case 2:return d.fn.call(d.context,e),!0;case 3:return d.fn.call(d.context,e,r),!0;case 4:return d.fn.call(d.context,e,r,a),!0;case 5:return d.fn.call(d.context,e,r,a,s),!0;case 6:return d.fn.call(d.context,e,r,a,s,n),!0}for(l=1,c=new Array(h-1);l<h;l++)c[l-1]=arguments[l];d.fn.apply(d.context,c)}else{var p,g=d.length;for(l=0;l<g;l++)switch(d[l].once&&this.removeListener(t,d[l].fn,void 0,!0),h){case 1:d[l].fn.call(d[l].context);break;case 2:d[l].fn.call(d[l].context,e);break;case 3:d[l].fn.call(d[l].context,e,r);break;case 4:d[l].fn.call(d[l].context,e,r,a);break;default:if(!c)for(p=1,c=new Array(h-1);p<h;p++)c[p-1]=arguments[p];d[l].fn.apply(d[l].context,c)}}return!0},o.prototype.on=function(t,e,i){return s(this,t,e,i,!1)},o.prototype.once=function(t,e,i){return s(this,t,e,i,!0)},o.prototype.removeListener=function(t,e,r,a){var s=i?i+t:t;if(!this._events[s])return this;if(!e)return n(this,s),this;var o=this._events[s];if(o.fn)o.fn!==e||a&&!o.once||r&&o.context!==r||n(this,s);else{for(var c=0,l=[],d=o.length;c<d;c++)(o[c].fn!==e||a&&!o[c].once||r&&o[c].context!==r)&&l.push(o[c]);l.length?this._events[s]=1===l.length?l[0]:l:n(this,s)}return this},o.prototype.removeAllListeners=function(t){var e;return t?(e=i?i+t:t,this._events[e]&&n(this,e)):(this._events=new r,this._eventsCount=0),this},o.prototype.off=o.prototype.removeListener,o.prototype.addListener=o.prototype.on,o.prefixed=i,o.EventEmitter=o,t.exports=o}(Tk);var Lk=eu(Tk.exports);class _k{constructor(t,e,i,r){this.error=null,this.hls=void 0,this.id=void 0,this.observer=void 0,this.frag=null,this.part=null,this.useWorker=void 0,this.workerContext=null,this.onwmsg=void 0,this.transmuxer=null,this.onTransmuxComplete=void 0,this.onFlush=void 0;const a=t.config;this.hls=t,this.id=e,this.useWorker=!!a.enableWorker,this.onTransmuxComplete=i,this.onFlush=r;const s=(t,e)=>{(e=e||{}).frag=this.frag,e.id=this.id,t===pu.ERROR&&(this.error=e.error),this.hls.trigger(t,e)};this.observer=new Lk,this.observer.on(pu.FRAG_DECRYPTED,s),this.observer.on(pu.ERROR,s);const n=Jf(a.preferManagedMediaSource)||{isTypeSupported:()=>!1},o={mpeg:n.isTypeSupported("audio/mpeg"),mp3:n.isTypeSupported('audio/mp4; codecs="mp3"'),ac3:n.isTypeSupported('audio/mp4; codecs="ac-3"')};if(this.useWorker&&"undefined"!=typeof Worker){if(a.workerPath||"function"==typeof __HLS_WORKER_BUNDLE__){try{a.workerPath?(ku.log(`loading Web Worker ${a.workerPath} for "${e}"`),this.workerContext=function(t){const e=new self.URL(t,self.location.href).href;return{worker:new self.Worker(e),scriptURL:e}}(a.workerPath)):(ku.log(`injecting Web Worker for "${e}"`),this.workerContext=function(){const t=new self.Blob([`var exports={};var module={exports:exports};function define(f){f()};define.amd=true;(${__HLS_WORKER_BUNDLE__.toString()})(true);`],{type:"text/javascript"}),e=self.URL.createObjectURL(t);return{worker:new self.Worker(e),objectURL:e}}()),this.onwmsg=t=>this.onWorkerMessage(t);const{worker:t}=this.workerContext;t.addEventListener("message",this.onwmsg),t.onerror=t=>{const i=new Error(`${t.message} (${t.filename}:${t.lineno})`);a.enableWorker=!1,ku.warn(`Error in "${e}" Web Worker, fallback to inline`),this.hls.trigger(pu.ERROR,{type:gu.OTHER_ERROR,details:uu.INTERNAL_EXCEPTION,fatal:!1,event:"demuxerWorker",error:i})},t.postMessage({cmd:"init",typeSupported:o,vendor:"",id:e,config:JSON.stringify(a)})}catch(t){ku.warn(`Error setting up "${e}" Web Worker, fallback to inline`,t),this.resetWorker(),this.error=null,this.transmuxer=new xk(this.observer,o,a,"",e)}return}}this.transmuxer=new xk(this.observer,o,a,"",e)}resetWorker(){if(this.workerContext){const{worker:t,objectURL:e}=this.workerContext;e&&self.URL.revokeObjectURL(e),t.removeEventListener("message",this.onwmsg),t.onerror=null,t.terminate(),this.workerContext=null}}destroy(){if(this.workerContext)this.resetWorker(),this.onwmsg=void 0;else{const t=this.transmuxer;t&&(t.destroy(),this.transmuxer=null)}const t=this.observer;t&&t.removeAllListeners(),this.frag=null,this.observer=null,this.hls=null}push(t,e,i,r,a,s,n,o,c,l){var d,h;c.transmuxing.start=self.performance.now();const{transmuxer:p}=this,g=s?s.start:a.start,u=a.decryptdata,f=this.frag,m=!(f&&a.cc===f.cc),v=!(f&&c.level===f.level),b=f?c.sn-f.sn:-1,k=this.part?c.part-this.part.index:-1,y=0===b&&c.id>1&&c.id===(null==f?void 0:f.stats.chunkCount),w=!v&&(1===b||0===b&&(1===k||y&&k<=0)),x=self.performance.now();(v||b||0===a.stats.parsing.start)&&(a.stats.parsing.start=x),!s||!k&&w||(s.stats.parsing.start=x);const S=!(f&&(null==(d=a.initSegment)?void 0:d.url)===(null==(h=f.initSegment)?void 0:h.url)),P=new Ek(m,w,o,v,g,S);if(!w||m||S){ku.log(`[transmuxer-interface, ${a.type}]: Starting new transmux session for sn: ${c.sn} p: ${c.part} level: ${c.level} id: ${c.id}\n discontinuity: ${m}\n trackSwitch: ${v}\n contiguous: ${w}\n accurateTimeOffset: ${o}\n timeOffset: ${g}\n initSegmentChange: ${S}`);const t=new Ck(i,r,e,n,l);this.configureTransmuxer(t)}if(this.frag=a,this.part=s,this.workerContext)this.workerContext.worker.postMessage({cmd:"demux",data:t,decryptdata:u,chunkMeta:c,state:P},t instanceof ArrayBuffer?[t]:[]);else if(p){const e=p.push(t,u,c,P);Pk(e)?(p.async=!0,e.then((t=>{this.handleTransmuxComplete(t)})).catch((t=>{this.transmuxerError(t,c,"transmuxer-interface push error")}))):(p.async=!1,this.handleTransmuxComplete(e))}}flush(t){t.transmuxing.start=self.performance.now();const{transmuxer:e}=this;if(this.workerContext)this.workerContext.worker.postMessage({cmd:"flush",chunkMeta:t});else if(e){let i=e.flush(t);Pk(i)||e.async?(Pk(i)||(i=Promise.resolve(i)),i.then((e=>{this.handleFlushResult(e,t)})).catch((e=>{this.transmuxerError(e,t,"transmuxer-interface flush error")}))):this.handleFlushResult(i,t)}}transmuxerError(t,e,i){this.hls&&(this.error=t,this.hls.trigger(pu.ERROR,{type:gu.MEDIA_ERROR,details:uu.FRAG_PARSING_ERROR,chunkMeta:e,frag:this.frag||void 0,fatal:!1,error:t,err:t,reason:i}))}handleFlushResult(t,e){t.forEach((t=>{this.handleTransmuxComplete(t)})),this.onFlush(e)}onWorkerMessage(t){const e=t.data;if(null==e||!e.event)return void ku.warn("worker message received with no "+(e?"event name":"data"));const i=this.hls;if(this.hls)switch(e.event){case"init":{var r;const t=null==(r=this.workerContext)?void 0:r.objectURL;t&&self.URL.revokeObjectURL(t);break}case"transmuxComplete":this.handleTransmuxComplete(e.data);break;case"flush":this.onFlush(e.data);break;case"workerLog":ku[e.data.logType]&&ku[e.data.logType](e.data.message);break;default:e.data=e.data||{},e.data.frag=this.frag,e.data.id=this.id,i.trigger(e.event,e.data)}}configureTransmuxer(t){const{transmuxer:e}=this;this.workerContext?this.workerContext.worker.postMessage({cmd:"configure",config:t}):e&&e.configure(t)}handleTransmuxComplete(t){t.chunkMeta.transmuxing.end=self.performance.now(),this.onTransmuxComplete(t)}}function Rk(t,e){if(t.length!==e.length)return!1;for(let i=0;i<t.length;i++)if(!Ak(t[i].attrs,e[i].attrs))return!1;return!0}function Ak(t,e,i){const r=t["STABLE-RENDITION-ID"];return r&&!i?r===e["STABLE-RENDITION-ID"]:!(i||["LANGUAGE","NAME","CHARACTERISTICS","AUTOSELECT","DEFAULT","FORCED","ASSOC-LANGUAGE"]).some((i=>t[i]!==e[i]))}function Dk(t,e){return e.label.toLowerCase()===t.name.toLowerCase()&&(!e.language||e.language.toLowerCase()===(t.lang||"").toLowerCase())}class Mk{constructor(t){this.buffered=void 0;const e=(e,i,r)=>{if((i>>>=0)>r-1)throw new DOMException(`Failed to execute '${e}' on 'TimeRanges': The index provided (${i}) is greater than the maximum bound (${r})`);return t[i][e]};this.buffered={get length(){return t.length},end:i=>e("end",i,t.length),start:i=>e("start",i,t.length)}}}class Ik{constructor(t){this.buffers=void 0,this.queues={video:[],audio:[],audiovideo:[]},this.buffers=t}append(t,e,i){const r=this.queues[e];r.push(t),1!==r.length||i||this.executeNext(e)}insertAbort(t,e){this.queues[e].unshift(t),this.executeNext(e)}appendBlocker(t){let e;const i=new Promise((t=>{e=t})),r={execute:e,onStart:()=>{},onComplete:()=>{},onError:()=>{}};return this.append(r,t),i}executeNext(t){const e=this.queues[t];if(e.length){const i=e[0];try{i.execute()}catch(e){ku.warn(`[buffer-operation-queue]: Exception executing "${t}" SourceBuffer operation: ${e}`),i.onError(e);const r=this.buffers[t];null!=r&&r.updating||this.shiftAndExecuteNext(t)}}}shiftAndExecuteNext(t){this.queues[t].shift(),this.executeNext(t)}current(t){return this.queues[t][0]}}const Ok=/(avc[1234]|hvc1|hev1|dvh[1e]|vp09|av01)(?:\.[^.,]+)+/;function Uk(t){const e=t.querySelectorAll("source");[].slice.call(e).forEach((e=>{t.removeChild(e)}))}const $k={42:225,92:233,94:237,95:243,96:250,123:231,124:247,125:209,126:241,127:9608,128:174,129:176,130:189,131:191,132:8482,133:162,134:163,135:9834,136:224,137:32,138:232,139:226,140:234,141:238,142:244,143:251,144:193,145:201,146:211,147:218,148:220,149:252,150:8216,151:161,152:42,153:8217,154:9473,155:169,156:8480,157:8226,158:8220,159:8221,160:192,161:194,162:199,163:200,164:202,165:203,166:235,167:206,168:207,169:239,170:212,171:217,172:249,173:219,174:171,175:187,176:195,177:227,178:205,179:204,180:236,181:210,182:242,183:213,184:245,185:123,186:125,187:92,188:94,189:95,190:124,191:8764,192:196,193:228,194:214,195:246,196:223,197:165,198:164,199:9475,200:197,201:229,202:216,203:248,204:9487,205:9491,206:9495,207:9499},Fk=t=>String.fromCharCode($k[t]||t),jk=15,zk=100,Nk={17:1,18:3,21:5,22:7,23:9,16:11,19:12,20:14},Bk={17:2,18:4,21:6,22:8,23:10,19:13,20:15},Hk={25:1,26:3,29:5,30:7,31:9,24:11,27:12,28:14},Gk={25:2,26:4,29:6,30:8,31:10,27:13,28:15},Vk=["white","green","blue","cyan","red","yellow","magenta","black","transparent"];class qk{constructor(){this.time=null,this.verboseLevel=0}log(t,e){if(this.verboseLevel>=t){const i="function"==typeof e?e():e;ku.log(`${this.time} [${t}] ${i}`)}}}const Kk=function(t){const e=[];for(let i=0;i<t.length;i++)e.push(t[i].toString(16));return e};class Wk{constructor(){this.foreground="white",this.underline=!1,this.italics=!1,this.background="black",this.flash=!1}reset(){this.foreground="white",this.underline=!1,this.italics=!1,this.background="black",this.flash=!1}setStyles(t){const e=["foreground","underline","italics","background","flash"];for(let i=0;i<e.length;i++){const r=e[i];t.hasOwnProperty(r)&&(this[r]=t[r])}}isDefault(){return"white"===this.foreground&&!this.underline&&!this.italics&&"black"===this.background&&!this.flash}equals(t){return this.foreground===t.foreground&&this.underline===t.underline&&this.italics===t.italics&&this.background===t.background&&this.flash===t.flash}copy(t){this.foreground=t.foreground,this.underline=t.underline,this.italics=t.italics,this.background=t.background,this.flash=t.flash}toString(){return"color="+this.foreground+", underline="+this.underline+", italics="+this.italics+", background="+this.background+", flash="+this.flash}}class Yk{constructor(){this.uchar=" ",this.penState=new Wk}reset(){this.uchar=" ",this.penState.reset()}setChar(t,e){this.uchar=t,this.penState.copy(e)}setPenState(t){this.penState.copy(t)}equals(t){return this.uchar===t.uchar&&this.penState.equals(t.penState)}copy(t){this.uchar=t.uchar,this.penState.copy(t.penState)}isEmpty(){return" "===this.uchar&&this.penState.isDefault()}}class Zk{constructor(t){this.chars=[],this.pos=0,this.currPenState=new Wk,this.cueStartTime=null,this.logger=void 0;for(let t=0;t<zk;t++)this.chars.push(new Yk);this.logger=t}equals(t){for(let e=0;e<zk;e++)if(!this.chars[e].equals(t.chars[e]))return!1;return!0}copy(t){for(let e=0;e<zk;e++)this.chars[e].copy(t.chars[e])}isEmpty(){let t=!0;for(let e=0;e<zk;e++)if(!this.chars[e].isEmpty()){t=!1;break}return t}setCursor(t){this.pos!==t&&(this.pos=t),this.pos<0?(this.logger.log(3,"Negative cursor position "+this.pos),this.pos=0):this.pos>zk&&(this.logger.log(3,"Too large cursor position "+this.pos),this.pos=zk)}moveCursor(t){const e=this.pos+t;if(t>1)for(let t=this.pos+1;t<e+1;t++)this.chars[t].setPenState(this.currPenState);this.setCursor(e)}backSpace(){this.moveCursor(-1),this.chars[this.pos].setChar(" ",this.currPenState)}insertChar(t){t>=144&&this.backSpace();const e=Fk(t);this.pos>=zk?this.logger.log(0,(()=>"Cannot insert "+t.toString(16)+" ("+e+") at position "+this.pos+". Skipping it!")):(this.chars[this.pos].setChar(e,this.currPenState),this.moveCursor(1))}clearFromPos(t){let e;for(e=t;e<zk;e++)this.chars[e].reset()}clear(){this.clearFromPos(0),this.pos=0,this.currPenState.reset()}clearToEndOfRow(){this.clearFromPos(this.pos)}getTextString(){const t=[];let e=!0;for(let i=0;i<zk;i++){const r=this.chars[i].uchar;" "!==r&&(e=!1),t.push(r)}return e?"":t.join("")}setPenStyles(t){this.currPenState.setStyles(t);this.chars[this.pos].setPenState(this.currPenState)}}class Qk{constructor(t){this.rows=[],this.currRow=14,this.nrRollUpRows=null,this.lastOutputScreen=null,this.logger=void 0;for(let e=0;e<jk;e++)this.rows.push(new Zk(t));this.logger=t}reset(){for(let t=0;t<jk;t++)this.rows[t].clear();this.currRow=14}equals(t){let e=!0;for(let i=0;i<jk;i++)if(!this.rows[i].equals(t.rows[i])){e=!1;break}return e}copy(t){for(let e=0;e<jk;e++)this.rows[e].copy(t.rows[e])}isEmpty(){let t=!0;for(let e=0;e<jk;e++)if(!this.rows[e].isEmpty()){t=!1;break}return t}backSpace(){this.rows[this.currRow].backSpace()}clearToEndOfRow(){this.rows[this.currRow].clearToEndOfRow()}insertChar(t){this.rows[this.currRow].insertChar(t)}setPen(t){this.rows[this.currRow].setPenStyles(t)}moveCursor(t){this.rows[this.currRow].moveCursor(t)}setCursor(t){this.logger.log(2,"setCursor: "+t);this.rows[this.currRow].setCursor(t)}setPAC(t){this.logger.log(2,(()=>"pacData = "+JSON.stringify(t)));let e=t.row-1;if(this.nrRollUpRows&&e<this.nrRollUpRows-1&&(e=this.nrRollUpRows-1),this.nrRollUpRows&&this.currRow!==e){for(let t=0;t<jk;t++)this.rows[t].clear();const t=this.currRow+1-this.nrRollUpRows,i=this.lastOutputScreen;if(i){const r=i.rows[t].cueStartTime,a=this.logger.time;if(null!==r&&null!==a&&r<a)for(let r=0;r<this.nrRollUpRows;r++)this.rows[e-this.nrRollUpRows+r+1].copy(i.rows[t+r])}}this.currRow=e;const i=this.rows[this.currRow];if(null!==t.indent){const e=t.indent,r=Math.max(e-1,0);i.setCursor(t.indent),t.color=i.chars[r].penState.foreground}const r={foreground:t.color,underline:t.underline,italics:t.italics,background:"black",flash:!1};this.setPen(r)}setBkgData(t){this.logger.log(2,(()=>"bkgData = "+JSON.stringify(t))),this.backSpace(),this.setPen(t),this.insertChar(32)}setRollUpRows(t){this.nrRollUpRows=t}rollUp(){if(null===this.nrRollUpRows)return void this.logger.log(3,"roll_up but nrRollUpRows not set yet");this.logger.log(1,(()=>this.getDisplayText()));const t=this.currRow+1-this.nrRollUpRows,e=this.rows.splice(t,1)[0];e.clear(),this.rows.splice(this.currRow,0,e),this.logger.log(2,"Rolling up")}getDisplayText(t){t=t||!1;const e=[];let i="",r=-1;for(let i=0;i<jk;i++){const a=this.rows[i].getTextString();a&&(r=i+1,t?e.push("Row "+r+": '"+a+"'"):e.push(a.trim()))}return e.length>0&&(i=t?"["+e.join(" | ")+"]":e.join("\n")),i}getTextAndFormat(){return this.rows}}class Jk{constructor(t,e,i){this.chNr=void 0,this.outputFilter=void 0,this.mode=void 0,this.verbose=void 0,this.displayedMemory=void 0,this.nonDisplayedMemory=void 0,this.lastOutputScreen=void 0,this.currRollUpRow=void 0,this.writeScreen=void 0,this.cueStartTime=void 0,this.logger=void 0,this.chNr=t,this.outputFilter=e,this.mode=null,this.verbose=0,this.displayedMemory=new Qk(i),this.nonDisplayedMemory=new Qk(i),this.lastOutputScreen=new Qk(i),this.currRollUpRow=this.displayedMemory.rows[14],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null,this.logger=i}reset(){this.mode=null,this.displayedMemory.reset(),this.nonDisplayedMemory.reset(),this.lastOutputScreen.reset(),this.outputFilter.reset(),this.currRollUpRow=this.displayedMemory.rows[14],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null}getHandler(){return this.outputFilter}setHandler(t){this.outputFilter=t}setPAC(t){this.writeScreen.setPAC(t)}setBkgData(t){this.writeScreen.setBkgData(t)}setMode(t){t!==this.mode&&(this.mode=t,this.logger.log(2,(()=>"MODE="+t)),"MODE_POP-ON"===this.mode?this.writeScreen=this.nonDisplayedMemory:(this.writeScreen=this.displayedMemory,this.writeScreen.reset()),"MODE_ROLL-UP"!==this.mode&&(this.displayedMemory.nrRollUpRows=null,this.nonDisplayedMemory.nrRollUpRows=null),this.mode=t)}insertChars(t){for(let e=0;e<t.length;e++)this.writeScreen.insertChar(t[e]);const e=this.writeScreen===this.displayedMemory?"DISP":"NON_DISP";this.logger.log(2,(()=>e+": "+this.writeScreen.getDisplayText(!0))),"MODE_PAINT-ON"!==this.mode&&"MODE_ROLL-UP"!==this.mode||(this.logger.log(1,(()=>"DISPLAYED: "+this.displayedMemory.getDisplayText(!0))),this.outputDataUpdate())}ccRCL(){this.logger.log(2,"RCL - Resume Caption Loading"),this.setMode("MODE_POP-ON")}ccBS(){this.logger.log(2,"BS - BackSpace"),"MODE_TEXT"!==this.mode&&(this.writeScreen.backSpace(),this.writeScreen===this.displayedMemory&&this.outputDataUpdate())}ccAOF(){}ccAON(){}ccDER(){this.logger.log(2,"DER- Delete to End of Row"),this.writeScreen.clearToEndOfRow(),this.outputDataUpdate()}ccRU(t){this.logger.log(2,"RU("+t+") - Roll Up"),this.writeScreen=this.displayedMemory,this.setMode("MODE_ROLL-UP"),this.writeScreen.setRollUpRows(t)}ccFON(){this.logger.log(2,"FON - Flash On"),this.writeScreen.setPen({flash:!0})}ccRDC(){this.logger.log(2,"RDC - Resume Direct Captioning"),this.setMode("MODE_PAINT-ON")}ccTR(){this.logger.log(2,"TR"),this.setMode("MODE_TEXT")}ccRTD(){this.logger.log(2,"RTD"),this.setMode("MODE_TEXT")}ccEDM(){this.logger.log(2,"EDM - Erase Displayed Memory"),this.displayedMemory.reset(),this.outputDataUpdate(!0)}ccCR(){this.logger.log(2,"CR - Carriage Return"),this.writeScreen.rollUp(),this.outputDataUpdate(!0)}ccENM(){this.logger.log(2,"ENM - Erase Non-displayed Memory"),this.nonDisplayedMemory.reset()}ccEOC(){if(this.logger.log(2,"EOC - End Of Caption"),"MODE_POP-ON"===this.mode){const t=this.displayedMemory;this.displayedMemory=this.nonDisplayedMemory,this.nonDisplayedMemory=t,this.writeScreen=this.nonDisplayedMemory,this.logger.log(1,(()=>"DISP: "+this.displayedMemory.getDisplayText()))}this.outputDataUpdate(!0)}ccTO(t){this.logger.log(2,"TO("+t+") - Tab Offset"),this.writeScreen.moveCursor(t)}ccMIDROW(t){const e={flash:!1};if(e.underline=t%2==1,e.italics=t>=46,e.italics)e.foreground="white";else{const i=Math.floor(t/2)-16,r=["white","green","blue","cyan","red","yellow","magenta"];e.foreground=r[i]}this.logger.log(2,"MIDROW: "+JSON.stringify(e)),this.writeScreen.setPen(e)}outputDataUpdate(t=!1){const e=this.logger.time;null!==e&&this.outputFilter&&(null!==this.cueStartTime||this.displayedMemory.isEmpty()?this.displayedMemory.equals(this.lastOutputScreen)||(this.outputFilter.newCue(this.cueStartTime,e,this.lastOutputScreen),t&&this.outputFilter.dispatchCue&&this.outputFilter.dispatchCue(),this.cueStartTime=this.displayedMemory.isEmpty()?null:e):this.cueStartTime=e,this.lastOutputScreen.copy(this.displayedMemory))}cueSplitAtTime(t){this.outputFilter&&(this.displayedMemory.isEmpty()||(this.outputFilter.newCue&&this.outputFilter.newCue(this.cueStartTime,t,this.displayedMemory),this.cueStartTime=t))}}class Xk{constructor(t,e,i){this.channels=void 0,this.currentChannel=0,this.cmdHistory={a:null,b:null},this.logger=void 0;const r=this.logger=new qk;this.channels=[null,new Jk(t,e,r),new Jk(t+1,i,r)]}getHandler(t){return this.channels[t].getHandler()}setHandler(t,e){this.channels[t].setHandler(e)}addData(t,e){this.logger.time=t;for(let t=0;t<e.length;t+=2){const i=127&e[t],r=127&e[t+1];let a=!1,s=null;if(0===i&&0===r)continue;this.logger.log(3,(()=>"["+Kk([e[t],e[t+1]])+"] -> ("+Kk([i,r])+")"));const n=this.cmdHistory;if(i>=16&&i<=31){if(ey(i,r,n)){ty(null,null,n),this.logger.log(3,(()=>"Repeated command ("+Kk([i,r])+") is dropped"));continue}ty(i,r,this.cmdHistory),a=this.parseCmd(i,r),a||(a=this.parseMidrow(i,r)),a||(a=this.parsePAC(i,r)),a||(a=this.parseBackgroundAttributes(i,r))}else ty(null,null,n);if(!a&&(s=this.parseChars(i,r),s)){const t=this.currentChannel;if(t&&t>0){this.channels[t].insertChars(s)}else this.logger.log(2,"No channel found yet. TEXT-MODE?")}a||s||this.logger.log(2,(()=>"Couldn't parse cleaned data "+Kk([i,r])+" orig: "+Kk([e[t],e[t+1]])))}}parseCmd(t,e){if(!((20===t||28===t||21===t||29===t)&&e>=32&&e<=47)&&!((23===t||31===t)&&e>=33&&e<=35))return!1;const i=20===t||21===t||23===t?1:2,r=this.channels[i];return 20===t||21===t||28===t||29===t?32===e?r.ccRCL():33===e?r.ccBS():34===e?r.ccAOF():35===e?r.ccAON():36===e?r.ccDER():37===e?r.ccRU(2):38===e?r.ccRU(3):39===e?r.ccRU(4):40===e?r.ccFON():41===e?r.ccRDC():42===e?r.ccTR():43===e?r.ccRTD():44===e?r.ccEDM():45===e?r.ccCR():46===e?r.ccENM():47===e&&r.ccEOC():r.ccTO(e-32),this.currentChannel=i,!0}parseMidrow(t,e){let i=0;if((17===t||25===t)&&e>=32&&e<=47){if(i=17===t?1:2,i!==this.currentChannel)return this.logger.log(0,"Mismatch channel in midrow parsing"),!1;const r=this.channels[i];return!!r&&(r.ccMIDROW(e),this.logger.log(3,(()=>"MIDROW ("+Kk([t,e])+")")),!0)}return!1}parsePAC(t,e){let i;if(!((t>=17&&t<=23||t>=25&&t<=31)&&e>=64&&e<=127)&&!((16===t||24===t)&&e>=64&&e<=95))return!1;const r=t<=23?1:2;i=e>=64&&e<=95?1===r?Nk[t]:Hk[t]:1===r?Bk[t]:Gk[t];const a=this.channels[r];return!!a&&(a.setPAC(this.interpretPAC(i,e)),this.currentChannel=r,!0)}interpretPAC(t,e){let i;const r={color:null,italics:!1,indent:null,underline:!1,row:t};return i=e>95?e-96:e-64,r.underline=!(1&~i),i<=13?r.color=["white","green","blue","cyan","red","yellow","magenta","white"][Math.floor(i/2)]:i<=15?(r.italics=!0,r.color="white"):r.indent=4*Math.floor((i-16)/2),r}parseChars(t,e){let i,r=null,a=null;if(t>=25?(i=2,a=t-8):(i=1,a=t),a>=17&&a<=19){let t;t=17===a?e+80:18===a?e+112:e+144,this.logger.log(2,(()=>"Special char '"+Fk(t)+"' in channel "+i)),r=[t]}else t>=32&&t<=127&&(r=0===e?[t]:[t,e]);return r&&this.logger.log(3,(()=>"Char codes = "+Kk(r).join(","))),r}parseBackgroundAttributes(t,e){if(!((16===t||24===t)&&e>=32&&e<=47)&&!((23===t||31===t)&&e>=45&&e<=47))return!1;let i;const r={};16===t||24===t?(i=Math.floor((e-32)/2),r.background=Vk[i],e%2==1&&(r.background=r.background+"_semi")):45===e?r.background="transparent":(r.foreground="black",47===e&&(r.underline=!0));const a=t<=23?1:2;return this.channels[a].setBkgData(r),!0}reset(){for(let t=0;t<Object.keys(this.channels).length;t++){const e=this.channels[t];e&&e.reset()}ty(null,null,this.cmdHistory)}cueSplitAtTime(t){for(let e=0;e<this.channels.length;e++){const i=this.channels[e];i&&i.cueSplitAtTime(t)}}}function ty(t,e,i){i.a=t,i.b=e}function ey(t,e,i){return i.a===t&&i.b===e}class iy{constructor(t,e){this.timelineController=void 0,this.cueRanges=[],this.trackName=void 0,this.startTime=null,this.endTime=null,this.screen=null,this.timelineController=t,this.trackName=e}dispatchCue(){null!==this.startTime&&(this.timelineController.addCues(this.trackName,this.startTime,this.endTime,this.screen,this.cueRanges),this.startTime=null)}newCue(t,e,i){(null===this.startTime||this.startTime>t)&&(this.startTime=t),this.endTime=e,this.screen=i,this.timelineController.createCaptionsTrack(this.trackName)}reset(){this.cueRanges=[],this.startTime=null}}var ry=function(){if(null!=Uu&&Uu.VTTCue)return self.VTTCue;const t=["","lr","rl"],e=["start","middle","end","left","right"];function i(t,e){if("string"!=typeof e)return!1;if(!Array.isArray(t))return!1;const i=e.toLowerCase();return!!~t.indexOf(i)&&i}function r(t){return i(e,t)}function a(t,...e){let i=1;for(;i<arguments.length;i++){const e=arguments[i];for(const i in e)t[i]=e[i]}return t}function s(e,s,n){const o=this,c={enumerable:!0};o.hasBeenReset=!1;let l="",d=!1,h=e,p=s,g=n,u=null,f="",m=!0,v="auto",b="start",k=50,y="middle",w=50,x="middle";Object.defineProperty(o,"id",a({},c,{get:function(){return l},set:function(t){l=""+t}})),Object.defineProperty(o,"pauseOnExit",a({},c,{get:function(){return d},set:function(t){d=!!t}})),Object.defineProperty(o,"startTime",a({},c,{get:function(){return h},set:function(t){if("number"!=typeof t)throw new TypeError("Start time must be set to a number.");h=t,this.hasBeenReset=!0}})),Object.defineProperty(o,"endTime",a({},c,{get:function(){return p},set:function(t){if("number"!=typeof t)throw new TypeError("End time must be set to a number.");p=t,this.hasBeenReset=!0}})),Object.defineProperty(o,"text",a({},c,{get:function(){return g},set:function(t){g=""+t,this.hasBeenReset=!0}})),Object.defineProperty(o,"region",a({},c,{get:function(){return u},set:function(t){u=t,this.hasBeenReset=!0}})),Object.defineProperty(o,"vertical",a({},c,{get:function(){return f},set:function(e){const r=function(e){return i(t,e)}(e);if(!1===r)throw new SyntaxError("An invalid or illegal string was specified.");f=r,this.hasBeenReset=!0}})),Object.defineProperty(o,"snapToLines",a({},c,{get:function(){return m},set:function(t){m=!!t,this.hasBeenReset=!0}})),Object.defineProperty(o,"line",a({},c,{get:function(){return v},set:function(t){if("number"!=typeof t&&"auto"!==t)throw new SyntaxError("An invalid number or illegal string was specified.");v=t,this.hasBeenReset=!0}})),Object.defineProperty(o,"lineAlign",a({},c,{get:function(){return b},set:function(t){const e=r(t);if(!e)throw new SyntaxError("An invalid or illegal string was specified.");b=e,this.hasBeenReset=!0}})),Object.defineProperty(o,"position",a({},c,{get:function(){return k},set:function(t){if(t<0||t>100)throw new Error("Position must be between 0 and 100.");k=t,this.hasBeenReset=!0}})),Object.defineProperty(o,"positionAlign",a({},c,{get:function(){return y},set:function(t){const e=r(t);if(!e)throw new SyntaxError("An invalid or illegal string was specified.");y=e,this.hasBeenReset=!0}})),Object.defineProperty(o,"size",a({},c,{get:function(){return w},set:function(t){if(t<0||t>100)throw new Error("Size must be between 0 and 100.");w=t,this.hasBeenReset=!0}})),Object.defineProperty(o,"align",a({},c,{get:function(){return x},set:function(t){const e=r(t);if(!e)throw new SyntaxError("An invalid or illegal string was specified.");x=e,this.hasBeenReset=!0}})),o.displayState=void 0}return s.prototype.getCueAsHTML=function(){return self.WebVTT.convertCueToDOMTree(self,this.text)},s}();class ay{decode(t,e){if(!t)return"";if("string"!=typeof t)throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(t))}}function sy(t){function e(t,e,i,r){return 3600*(0|t)+60*(0|e)+(0|i)+parseFloat(r||0)}const i=t.match(/^(?:(\d+):)?(\d{2}):(\d{2})(\.\d+)?/);return i?parseFloat(i[2])>59?e(i[2],i[3],0,i[4]):e(i[1],i[2],i[3],i[4]):null}class ny{constructor(){this.values=Object.create(null)}set(t,e){this.get(t)||""===e||(this.values[t]=e)}get(t,e,i){return i?this.has(t)?this.values[t]:e[i]:this.has(t)?this.values[t]:e}has(t){return t in this.values}alt(t,e,i){for(let r=0;r<i.length;++r)if(e===i[r]){this.set(t,e);break}}integer(t,e){/^-?\d+$/.test(e)&&this.set(t,parseInt(e,10))}percent(t,e){if(/^([\d]{1,3})(\.[\d]*)?%$/.test(e)){const i=parseFloat(e);if(i>=0&&i<=100)return this.set(t,i),!0}return!1}}function oy(t,e,i,r){const a=r?t.split(r):[t];for(const t in a){if("string"!=typeof a[t])continue;const r=a[t].split(i);if(2!==r.length)continue;e(r[0],r[1])}}const cy=new ry(0,0,""),ly="middle"===cy.align?"middle":"center";function dy(t,e,i){const r=t;function a(){const e=sy(t);if(null===e)throw new Error("Malformed timestamp: "+r);return t=t.replace(/^[^\sa-zA-Z-]+/,""),e}function s(){t=t.replace(/^\s+/,"")}if(s(),e.startTime=a(),s(),"--\x3e"!==t.slice(0,3))throw new Error("Malformed time stamp (time stamps must be separated by '--\x3e'): "+r);t=t.slice(3),s(),e.endTime=a(),s(),function(t,e){const r=new ny;oy(t,(function(t,e){let a;switch(t){case"region":for(let a=i.length-1;a>=0;a--)if(i[a].id===e){r.set(t,i[a].region);break}break;case"vertical":r.alt(t,e,["rl","lr"]);break;case"line":a=e.split(","),r.integer(t,a[0]),r.percent(t,a[0])&&r.set("snapToLines",!1),r.alt(t,a[0],["auto"]),2===a.length&&r.alt("lineAlign",a[1],["start",ly,"end"]);break;case"position":a=e.split(","),r.percent(t,a[0]),2===a.length&&r.alt("positionAlign",a[1],["start",ly,"end","line-left","line-right","auto"]);break;case"size":r.percent(t,e);break;case"align":r.alt(t,e,["start",ly,"end","left","right"])}}),/:/,/\s/),e.region=r.get("region",null),e.vertical=r.get("vertical","");let a=r.get("line","auto");"auto"===a&&-1===cy.line&&(a=-1),e.line=a,e.lineAlign=r.get("lineAlign","start"),e.snapToLines=r.get("snapToLines",!0),e.size=r.get("size",100),e.align=r.get("align",ly);let s=r.get("position","auto");"auto"===s&&50===cy.position&&(s="start"===e.align||"left"===e.align?0:"end"===e.align||"right"===e.align?100:50),e.position=s}(t,e)}function hy(t){return t.replace(/<br(?: \/)?>/gi,"\n")}class py{constructor(){this.state="INITIAL",this.buffer="",this.decoder=new ay,this.regionList=[],this.cue=null,this.oncue=void 0,this.onparsingerror=void 0,this.onflush=void 0}parse(t){const e=this;function i(){let t=e.buffer,i=0;for(t=hy(t);i<t.length&&"\r"!==t[i]&&"\n"!==t[i];)++i;const r=t.slice(0,i);return"\r"===t[i]&&++i,"\n"===t[i]&&++i,e.buffer=t.slice(i),r}t&&(e.buffer+=e.decoder.decode(t,{stream:!0}));try{let t="";if("INITIAL"===e.state){if(!/\r\n|\n/.test(e.buffer))return this;t=i();const r=t.match(/^()?WEBVTT([ \t].*)?$/);if(null==r||!r[0])throw new Error("Malformed WebVTT signature.");e.state="HEADER"}let r=!1;for(;e.buffer;){if(!/\r\n|\n/.test(e.buffer))return this;switch(r?r=!1:t=i(),e.state){case"HEADER":/:/.test(t)?oy(t,(function(t,e){}),/:/):t||(e.state="ID");continue;case"NOTE":t||(e.state="ID");continue;case"ID":if(/^NOTE($|[ \t])/.test(t)){e.state="NOTE";break}if(!t)continue;if(e.cue=new ry(0,0,""),e.state="CUE",-1===t.indexOf("--\x3e")){e.cue.id=t;continue}case"CUE":if(!e.cue){e.state="BADCUE";continue}try{dy(t,e.cue,e.regionList)}catch(t){e.cue=null,e.state="BADCUE";continue}e.state="CUETEXT";continue;case"CUETEXT":{const i=-1!==t.indexOf("--\x3e");if(!t||i&&(r=!0)){e.oncue&&e.cue&&e.oncue(e.cue),e.cue=null,e.state="ID";continue}if(null===e.cue)continue;e.cue.text&&(e.cue.text+="\n"),e.cue.text+=t}continue;case"BADCUE":t||(e.state="ID")}}}catch(t){"CUETEXT"===e.state&&e.cue&&e.oncue&&e.oncue(e.cue),e.cue=null,e.state="INITIAL"===e.state?"BADWEBVTT":"BADCUE"}return this}flush(){const t=this;try{if((t.cue||"HEADER"===t.state)&&(t.buffer+="\n\n",t.parse()),"INITIAL"===t.state||"BADWEBVTT"===t.state)throw new Error("Malformed WebVTT signature.")}catch(e){t.onparsingerror&&t.onparsingerror(e)}return t.onflush&&t.onflush(),this}}const gy=/\r\n|\n\r|\n|\r/g,uy=function(t,e,i=0){return t.slice(i,i+e.length)===e},fy=function(t){let e=5381,i=t.length;for(;i;)e=33*e^t.charCodeAt(--i);return(e>>>0).toString()};function my(t,e,i){return fy(t.toString())+fy(e.toString())+fy(i)}function vy(t,e,i,r,a,s,n){const o=new py,c=ff(new Uint8Array(t)).trim().replace(gy,"\n").split("\n"),l=[],d=e?function(t,e=1){return dk(t,9e4,1/e)}(e.baseTime,e.timescale):0;let h,p="00:00.000",g=0,u=0,f=!0;o.oncue=function(t){const s=i[r];let n=i.ccOffset;const o=(g-d)/9e4;if(null!=s&&s.new&&(void 0!==u?n=i.ccOffset=s.start:function(t,e,i){let r=t[e],a=t[r.prevCC];if(!a||!a.new&&r.new)return t.ccOffset=t.presentationOffset=r.start,void(r.new=!1);for(;null!=(s=a)&&s.new;){var s;t.ccOffset+=r.start-a.start,r.new=!1,r=a,a=t[r.prevCC]}t.presentationOffset=i}(i,r,o)),o){if(!e)return void(h=new Error("Missing initPTS for VTT MPEGTS"));n=o-i.presentationOffset}const c=t.endTime-t.startTime,p=mk(9e4*(t.startTime+n-u),9e4*a)/9e4;t.startTime=Math.max(p,0),t.endTime=Math.max(p+c,0);const f=t.text.trim();t.text=decodeURIComponent(encodeURIComponent(f)),t.id||(t.id=my(t.startTime,t.endTime,f)),t.endTime>0&&l.push(t)},o.onparsingerror=function(t){h=t},o.onflush=function(){h?n(h):s(l)},c.forEach((t=>{if(f){if(uy(t,"X-TIMESTAMP-MAP=")){f=!1,t.slice(16).split(",").forEach((t=>{uy(t,"LOCAL:")?p=t.slice(6):uy(t,"MPEGTS:")&&(g=parseInt(t.slice(7)))}));try{u=function(t){let e=parseInt(t.slice(-3));const i=parseInt(t.slice(-6,-4)),r=parseInt(t.slice(-9,-7)),a=t.length>9?parseInt(t.substring(0,t.indexOf(":"))):0;if(!(lu(e)&&lu(i)&&lu(r)&&lu(a)))throw Error(`Malformed X-TIMESTAMP-MAP: Local:${t}`);return e+=1e3*i,e+=6e4*r,e+=36e5*a,e}(p)/1e3}catch(t){h=t}return}""===t&&(f=!1)}o.parse(t+"\n")})),o.flush()}const by="stpp.ttml.im1t",ky=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,yy=/^(\d*(?:\.\d*)?)(h|m|s|ms|f|t)$/,wy={left:"start",center:"center",right:"end",start:"start",end:"end"};function xy(t,e,i,r){const a=Lf(new Uint8Array(t),["mdat"]);if(0===a.length)return void r(new Error("Could not parse IMSC1 mdat"));const s=a.map((t=>ff(t))),n=function(t,e,i=1,r=!1){return dk(t,e,1/i,r)}(e.baseTime,1,e.timescale);try{s.forEach((t=>i(function(t,e){const i=(new DOMParser).parseFromString(t,"text/xml"),r=i.getElementsByTagName("tt")[0];if(!r)throw new Error("Invalid ttml");const a={frameRate:30,subFrameRate:1,frameRateMultiplier:0,tickRate:0},s=Object.keys(a).reduce(((t,e)=>(t[e]=r.getAttribute(`ttp:${e}`)||a[e],t)),{}),n="preserve"!==r.getAttribute("xml:space"),o=Py(Sy(r,"styling","style")),c=Py(Sy(r,"layout","region")),l=Sy(r,"body","[begin]");return[].map.call(l,(t=>{const i=Cy(t,n);if(!i||!t.hasAttribute("begin"))return null;const r=Ly(t.getAttribute("begin"),s),a=Ly(t.getAttribute("dur"),s);let l=Ly(t.getAttribute("end"),s);if(null===r)throw Ty(t);if(null===l){if(null===a)throw Ty(t);l=r+a}const d=new ry(r-e,l-e,i);d.id=my(d.startTime,d.endTime,d.text);const h=function(t,e,i){const r="http://www.w3.org/ns/ttml#styling";let a=null;const s=["displayAlign","textAlign","color","backgroundColor","fontSize","fontFamily"],n=null!=t&&t.hasAttribute("style")?t.getAttribute("style"):null;n&&i.hasOwnProperty(n)&&(a=i[n]);return s.reduce(((i,s)=>{const n=Ey(e,r,s)||Ey(t,r,s)||Ey(a,r,s);return n&&(i[s]=n),i}),{})}(c[t.getAttribute("region")],o[t.getAttribute("style")],o),{textAlign:p}=h;if(p){const t=wy[p];t&&(d.lineAlign=t),d.align=p}return cu(d,h),d})).filter((t=>null!==t))}(t,n))))}catch(t){r(t)}}function Sy(t,e,i){const r=t.getElementsByTagName(e)[0];return r?[].slice.call(r.querySelectorAll(i)):[]}function Py(t){return t.reduce(((t,e)=>{const i=e.getAttribute("xml:id");return i&&(t[i]=e),t}),{})}function Cy(t,e){return[].slice.call(t.childNodes).reduce(((t,i,r)=>{var a;return"br"===i.nodeName&&r?t+"\n":null!=(a=i.childNodes)&&a.length?Cy(i,e):e?t+i.textContent.trim().replace(/\s+/g," "):t+i.textContent}),"")}function Ey(t,e,i){return t&&t.hasAttributeNS(e,i)?t.getAttributeNS(e,i):null}function Ty(t){return new Error(`Could not parse ttml timestamp ${t}`)}function Ly(t,e){if(!t)return null;let i=sy(t);return null===i&&(ky.test(t)?i=function(t,e){const i=ky.exec(t),r=(0|i[4])+(0|i[5])/e.subFrameRate;return 3600*(0|i[1])+60*(0|i[2])+(0|i[3])+r/e.frameRate}(t,e):yy.test(t)&&(i=function(t,e){const i=yy.exec(t),r=Number(i[1]);switch(i[2]){case"h":return 3600*r;case"m":return 60*r;case"ms":return 1e3*r;case"f":return r/e.frameRate;case"t":return r/e.tickRate}return r}(t,e))),i}function _y(t){return t.characteristics&&/transcribes-spoken-dialog/gi.test(t.characteristics)&&/describes-music-and-sound/gi.test(t.characteristics)?"captions":"subtitles"}function Ry(t,e){return!!t&&t.kind===_y(e)&&Dk(e,t)}class Ay{constructor(t){this.hls=void 0,this.autoLevelCapping=void 0,this.firstLevel=void 0,this.media=void 0,this.restrictedLevels=void 0,this.timer=void 0,this.clientRect=void 0,this.streamController=void 0,this.hls=t,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.firstLevel=-1,this.media=null,this.restrictedLevels=[],this.timer=void 0,this.clientRect=null,this.registerListeners()}setStreamController(t){this.streamController=t}destroy(){this.hls&&this.unregisterListener(),this.timer&&this.stopCapping(),this.media=null,this.clientRect=null,this.hls=this.streamController=null}registerListeners(){const{hls:t}=this;t.on(pu.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),t.on(pu.MEDIA_ATTACHING,this.onMediaAttaching,this),t.on(pu.MANIFEST_PARSED,this.onManifestParsed,this),t.on(pu.LEVELS_UPDATED,this.onLevelsUpdated,this),t.on(pu.BUFFER_CODECS,this.onBufferCodecs,this),t.on(pu.MEDIA_DETACHING,this.onMediaDetaching,this)}unregisterListener(){const{hls:t}=this;t.off(pu.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),t.off(pu.MEDIA_ATTACHING,this.onMediaAttaching,this),t.off(pu.MANIFEST_PARSED,this.onManifestParsed,this),t.off(pu.LEVELS_UPDATED,this.onLevelsUpdated,this),t.off(pu.BUFFER_CODECS,this.onBufferCodecs,this),t.off(pu.MEDIA_DETACHING,this.onMediaDetaching,this)}onFpsDropLevelCapping(t,e){const i=this.hls.levels[e.droppedLevel];this.isLevelAllowed(i)&&this.restrictedLevels.push({bitrate:i.bitrate,height:i.height,width:i.width})}onMediaAttaching(t,e){this.media=e.media instanceof HTMLVideoElement?e.media:null,this.clientRect=null,this.timer&&this.hls.levels.length&&this.detectPlayerSize()}onManifestParsed(t,e){const i=this.hls;this.restrictedLevels=[],this.firstLevel=e.firstLevel,i.config.capLevelToPlayerSize&&e.video&&this.startCapping()}onLevelsUpdated(t,e){this.timer&&lu(this.autoLevelCapping)&&this.detectPlayerSize()}onBufferCodecs(t,e){this.hls.config.capLevelToPlayerSize&&e.video&&this.startCapping()}onMediaDetaching(){this.stopCapping()}detectPlayerSize(){if(this.media){if(this.mediaHeight<=0||this.mediaWidth<=0)return void(this.clientRect=null);const t=this.hls.levels;if(t.length){const e=this.hls,i=this.getMaxLevel(t.length-1);i!==this.autoLevelCapping&&ku.log(`Setting autoLevelCapping to ${i}: ${t[i].height}p@${t[i].bitrate} for media ${this.mediaWidth}x${this.mediaHeight}`),e.autoLevelCapping=i,e.autoLevelCapping>this.autoLevelCapping&&this.streamController&&this.streamController.nextLevelSwitch(),this.autoLevelCapping=e.autoLevelCapping}}}getMaxLevel(t){const e=this.hls.levels;if(!e.length)return-1;const i=e.filter(((e,i)=>this.isLevelAllowed(e)&&i<=t));return this.clientRect=null,Ay.getMaxLevelByMediaSize(i,this.mediaWidth,this.mediaHeight)}startCapping(){this.timer||(this.autoLevelCapping=Number.POSITIVE_INFINITY,self.clearInterval(this.timer),this.timer=self.setInterval(this.detectPlayerSize.bind(this),1e3),this.detectPlayerSize())}stopCapping(){this.restrictedLevels=[],this.firstLevel=-1,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.timer&&(self.clearInterval(this.timer),this.timer=void 0)}getDimensions(){if(this.clientRect)return this.clientRect;const t=this.media,e={width:0,height:0};if(t){const i=t.getBoundingClientRect();e.width=i.width,e.height=i.height,e.width||e.height||(e.width=i.right-i.left||t.width||0,e.height=i.bottom-i.top||t.height||0)}return this.clientRect=e,e}get mediaWidth(){return this.getDimensions().width*this.contentScaleFactor}get mediaHeight(){return this.getDimensions().height*this.contentScaleFactor}get contentScaleFactor(){let t=1;if(!this.hls.config.ignoreDevicePixelRatio)try{t=self.devicePixelRatio}catch(t){}return t}isLevelAllowed(t){return!this.restrictedLevels.some((e=>t.bitrate===e.bitrate&&t.width===e.width&&t.height===e.height))}static getMaxLevelByMediaSize(t,e,i){if(null==t||!t.length)return-1;let r=t.length-1;const a=Math.max(e,i);for(let e=0;e<t.length;e+=1){const i=t[e];if((i.width>=a||i.height>=a)&&(s=i,!(n=t[e+1])||s.width!==n.width||s.height!==n.height)){r=e;break}}var s,n;return r}}const Dy="[eme]";class My{constructor(t){this.hls=void 0,this.config=void 0,this.media=null,this.keyFormatPromise=null,this.keySystemAccessPromises={},this._requestLicenseFailureCount=0,this.mediaKeySessions=[],this.keyIdToKeySessionPromise={},this.setMediaKeysQueue=My.CDMCleanupPromise?[My.CDMCleanupPromise]:[],this.debug=ku.debug.bind(ku,Dy),this.log=ku.log.bind(ku,Dy),this.warn=ku.warn.bind(ku,Dy),this.error=ku.error.bind(ku,Dy),this.onMediaEncrypted=t=>{const{initDataType:e,initData:i}=t,r=`"${t.type}" event: init data type: "${e}"`;if(this.debug(r),null!==i){if(!this.keyFormatPromise){let t=Object.keys(this.keySystemAccessPromises);t.length||(t=Yu(this.config));const e=t.map(Wu).filter((t=>!!t));this.keyFormatPromise=this.getKeyFormatPromise(e)}this.keyFormatPromise.then((a=>{const s=Bu(a);let n,o;if("sinf"===e){if(s!==$u.FAIRPLAY)return void this.warn(`Ignoring unexpected "${t.type}" event with init data type: "${e}" for selected key-system ${s}`);const a=xf(new Uint8Array(i));try{const t=Of(Mu(JSON.parse(a).sinf));if(!t)throw new Error("'schm' box missing or not cbcs/cenc with schi > tenc");n=t.subarray(8,24),o=$u.FAIRPLAY}catch(t){return void this.warn(`${r} Failed to parse sinf: ${t}`)}}else{if(s!==$u.WIDEVINE&&s!==$u.PLAYREADY)return void this.warn(`Ignoring unexpected "${t.type}" event with init data type: "${e}" for selected key-system ${s}`);const a=function(t){const e=[];if(t instanceof ArrayBuffer){const i=t.byteLength;let r=0;for(;r+32<i;){const i=Hf(new DataView(t,r));e.push(i),r+=i.size}}return e}(i),c=a.filter((t=>!!t.systemId&&Ku(t.systemId)===s));c.length>1&&this.warn(`${r} Using first of ${c.length} pssh found for selected key-system ${s}`);const l=c[0];if(!l)return void(0===a.length||a.some((t=>!t.systemId))?this.warn(`${r} contains incomplete or invalid pssh data`):this.log(`ignoring ${r} for ${a.map((t=>Ku(t.systemId))).join(",")} pssh data in favor of playlist keys`));if(o=Ku(l.systemId),0===l.version&&l.data)if(o===$u.WIDEVINE){const t=l.data.length-22;n=l.data.subarray(t,t+16)}else o===$u.PLAYREADY&&(n=Ju(l.data))}if(!o||!n)return void this.log(`Unable to handle ${r} with key-system ${s}`);const c=bf(n),{keyIdToKeySessionPromise:l,mediaKeySessions:d}=this;let h=l[c];for(let t=0;t<d.length;t++){const r=d[t],a=r.decryptdata;if(!a.keyId)continue;const s=bf(a.keyId);if(c===s||-1!==a.uri.replace(/-/g,"").indexOf(c)){if(h=l[s],a.pssh)break;delete l[s],a.pssh=new Uint8Array(i),a.keyId=n,h=l[c]=h.then((()=>this.generateRequestWithPreferredKeySession(r,e,i,"encrypted-event-key-match"))),h.catch((t=>this.handleError(t)));break}}if(!h){if(o!==s)return void this.log(`Ignoring "${r}" with ${o} init data for selected key-system ${s}`);h=l[c]=this.getKeySystemSelectionPromise([o]).then((({keySystem:t,mediaKeys:r})=>{var a;this.throwIfDestroyed();const s=new Vf("ISO-23001-7",c,null!=(a=Wu(t))?a:"");return s.pssh=new Uint8Array(i),s.keyId=n,this.attemptSetMediaKeys(t,r).then((()=>{this.throwIfDestroyed();const a=this.createMediaKeySessionContext({decryptdata:s,keySystem:t,mediaKeys:r});return this.generateRequestWithPreferredKeySession(a,e,i,"encrypted-event-no-match")}))})),h.catch((t=>this.handleError(t)))}}))}},this.onWaitingForKey=t=>{this.log(`"${t.type}" event`)},this.hls=t,this.config=t.config,this.registerListeners()}destroy(){this.unregisterListeners(),this.onMediaDetached();const t=this.config;t.requestMediaKeySystemAccessFunc=null,t.licenseXhrSetup=t.licenseResponseCallback=void 0,t.drmSystems=t.drmSystemOptions={},this.hls=this.config=this.keyIdToKeySessionPromise=null,this.onMediaEncrypted=this.onWaitingForKey=null}registerListeners(){this.hls.on(pu.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(pu.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.on(pu.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.on(pu.MANIFEST_LOADED,this.onManifestLoaded,this)}unregisterListeners(){this.hls.off(pu.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.off(pu.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.off(pu.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.off(pu.MANIFEST_LOADED,this.onManifestLoaded,this)}getLicenseServerUrl(t){const{drmSystems:e,widevineLicenseUrl:i}=this.config,r=e[t];return r?r.licenseUrl:t===$u.WIDEVINE&&i?i:void 0}getLicenseServerUrlOrThrow(t){const e=this.getLicenseServerUrl(t);if(void 0===e)throw new Error(`no license server URL configured for key-system "${t}"`);return e}getServerCertificateUrl(t){const{drmSystems:e}=this.config,i=e[t];if(i)return i.serverCertificateUrl;this.log(`No Server Certificate in config.drmSystems["${t}"]`)}attemptKeySystemAccess(t){const e=this.hls.levels,i=(t,e,i)=>!!t&&i.indexOf(t)===e,r=e.map((t=>t.audioCodec)).filter(i),a=e.map((t=>t.videoCodec)).filter(i);return r.length+a.length===0&&a.push("avc1.42e01e"),new Promise(((e,i)=>{const s=t=>{const n=t.shift();this.getMediaKeysPromise(n,r,a).then((t=>e({keySystem:n,mediaKeys:t}))).catch((e=>{t.length?s(t):i(e instanceof Iy?e:new Iy({type:gu.KEY_SYSTEM_ERROR,details:uu.KEY_SYSTEM_NO_ACCESS,error:e,fatal:!0},e.message))}))};s(t)}))}requestMediaKeySystemAccess(t,e){const{requestMediaKeySystemAccessFunc:i}=this.config;if("function"!=typeof i){let t=`Configured requestMediaKeySystemAccess is not a function ${i}`;return null===Zu&&"http:"===self.location.protocol&&(t=`navigator.requestMediaKeySystemAccess is not available over insecure protocol ${location.protocol}`),Promise.reject(new Error(t))}return i(t,e)}getMediaKeysPromise(t,e,i){const r=function(t,e,i,r){let a;switch(t){case $u.FAIRPLAY:a=["cenc","sinf"];break;case $u.WIDEVINE:case $u.PLAYREADY:a=["cenc"];break;case $u.CLEARKEY:a=["cenc","keyids"];break;default:throw new Error(`Unknown key-system: ${t}`)}return function(t,e,i,r){return[{initDataTypes:t,persistentState:r.persistentState||"optional",distinctiveIdentifier:r.distinctiveIdentifier||"optional",sessionTypes:r.sessionTypes||[r.sessionType||"temporary"],audioCapabilities:e.map((t=>({contentType:`audio/mp4; codecs="${t}"`,robustness:r.audioRobustness||"",encryptionScheme:r.audioEncryptionScheme||null}))),videoCapabilities:i.map((t=>({contentType:`video/mp4; codecs="${t}"`,robustness:r.videoRobustness||"",encryptionScheme:r.videoEncryptionScheme||null})))}]}(a,e,i,r)}(t,e,i,this.config.drmSystemOptions),a=this.keySystemAccessPromises[t];let s=null==a?void 0:a.keySystemAccess;if(!s){this.log(`Requesting encrypted media "${t}" key-system access with config: ${JSON.stringify(r)}`),s=this.requestMediaKeySystemAccess(t,r);const e=this.keySystemAccessPromises[t]={keySystemAccess:s};return s.catch((e=>{this.log(`Failed to obtain access to key-system "${t}": ${e}`)})),s.then((i=>{this.log(`Access for key-system "${i.keySystem}" obtained`);const r=this.fetchServerCertificate(t);return this.log(`Create media-keys for "${t}"`),e.mediaKeys=i.createMediaKeys().then((e=>(this.log(`Media-keys created for "${t}"`),r.then((i=>i?this.setMediaKeysServerCertificate(e,t,i):e))))),e.mediaKeys.catch((e=>{this.error(`Failed to create media-keys for "${t}"}: ${e}`)})),e.mediaKeys}))}return s.then((()=>a.mediaKeys))}createMediaKeySessionContext({decryptdata:t,keySystem:e,mediaKeys:i}){this.log(`Creating key-system session "${e}" keyId: ${bf(t.keyId||[])}`);const r=i.createSession(),a={decryptdata:t,keySystem:e,mediaKeys:i,mediaKeysSession:r,keyStatus:"status-pending"};return this.mediaKeySessions.push(a),a}renewKeySession(t){const e=t.decryptdata;if(e.pssh){const i=this.createMediaKeySessionContext(t),r=this.getKeyIdString(e),a="cenc";this.keyIdToKeySessionPromise[r]=this.generateRequestWithPreferredKeySession(i,a,e.pssh,"expired")}else this.warn("Could not renew expired session. Missing pssh initData.");this.removeSession(t)}getKeyIdString(t){if(!t)throw new Error("Could not read keyId of undefined decryptdata");if(null===t.keyId)throw new Error("keyId is null");return bf(t.keyId)}updateKeySession(t,e){var i;const r=t.mediaKeysSession;return this.log(`Updating key-session "${r.sessionId}" for keyID ${bf((null==(i=t.decryptdata)?void 0:i.keyId)||[])}\n } (data length: ${e?e.byteLength:e})`),r.update(e)}selectKeySystemFormat(t){const e=Object.keys(t.levelkeys||{});return this.keyFormatPromise||(this.log(`Selecting key-system from fragment (sn: ${t.sn} ${t.type}: ${t.level}) key formats ${e.join(", ")}`),this.keyFormatPromise=this.getKeyFormatPromise(e)),this.keyFormatPromise}getKeyFormatPromise(t){return new Promise(((e,i)=>{const r=Yu(this.config),a=t.map(Bu).filter((t=>!!t&&-1!==r.indexOf(t)));return this.getKeySystemSelectionPromise(a).then((({keySystem:t})=>{const r=Wu(t);r?e(r):i(new Error(`Unable to find format for key-system "${t}"`))})).catch(i)}))}loadKey(t){const e=t.keyInfo.decryptdata,i=this.getKeyIdString(e),r=`(keyId: ${i} format: "${e.keyFormat}" method: ${e.method} uri: ${e.uri})`;this.log(`Starting session for key ${r}`);let a=this.keyIdToKeySessionPromise[i];return a||(a=this.keyIdToKeySessionPromise[i]=this.getKeySystemForKeyPromise(e).then((({keySystem:i,mediaKeys:a})=>(this.throwIfDestroyed(),this.log(`Handle encrypted media sn: ${t.frag.sn} ${t.frag.type}: ${t.frag.level} using key ${r}`),this.attemptSetMediaKeys(i,a).then((()=>{this.throwIfDestroyed();const t=this.createMediaKeySessionContext({keySystem:i,mediaKeys:a,decryptdata:e});return this.generateRequestWithPreferredKeySession(t,"cenc",e.pssh,"playlist-key")}))))),a.catch((t=>this.handleError(t)))),a}throwIfDestroyed(t="Invalid state"){if(!this.hls)throw new Error("invalid state")}handleError(t){this.hls&&(this.error(t.message),t instanceof Iy?this.hls.trigger(pu.ERROR,t.data):this.hls.trigger(pu.ERROR,{type:gu.KEY_SYSTEM_ERROR,details:uu.KEY_SYSTEM_NO_KEYS,error:t,fatal:!0}))}getKeySystemForKeyPromise(t){const e=this.getKeyIdString(t),i=this.keyIdToKeySessionPromise[e];if(!i){const e=Bu(t.keyFormat),i=e?[e]:Yu(this.config);return this.attemptKeySystemAccess(i)}return i}getKeySystemSelectionPromise(t){if(t.length||(t=Yu(this.config)),0===t.length)throw new Iy({type:gu.KEY_SYSTEM_ERROR,details:uu.KEY_SYSTEM_NO_CONFIGURED_LICENSE,fatal:!0},`Missing key-system license configuration options ${JSON.stringify({drmSystems:this.config.drmSystems})}`);return this.attemptKeySystemAccess(t)}attemptSetMediaKeys(t,e){const i=this.setMediaKeysQueue.slice();this.log(`Setting media-keys for "${t}"`);const r=Promise.all(i).then((()=>{if(!this.media)throw new Error("Attempted to set mediaKeys without media element attached");return this.media.setMediaKeys(e)}));return this.setMediaKeysQueue.push(r),r.then((()=>{this.log(`Media-keys set for "${t}"`),i.push(r),this.setMediaKeysQueue=this.setMediaKeysQueue.filter((t=>-1===i.indexOf(t)))}))}generateRequestWithPreferredKeySession(t,e,i,r){var a,s;const n=null==(a=this.config.drmSystems)||null==(s=a[t.keySystem])?void 0:s.generateRequest;if(n)try{const r=n.call(this.hls,e,i,t);if(!r)throw new Error("Invalid response from configured generateRequest filter");e=r.initDataType,i=t.decryptdata.pssh=r.initData?new Uint8Array(r.initData):null}catch(t){var o;if(this.warn(t.message),null!=(o=this.hls)&&o.config.debug)throw t}if(null===i)return this.log(`Skipping key-session request for "${r}" (no initData)`),Promise.resolve(t);const c=this.getKeyIdString(t.decryptdata);this.log(`Generating key-session request for "${r}": ${c} (init data type: ${e} length: ${i?i.byteLength:null})`);const l=new Lk,d=t._onmessage=e=>{const i=t.mediaKeysSession;if(!i)return void l.emit("error",new Error("invalid state"));const{messageType:r,message:a}=e;this.log(`"${r}" message event for session "${i.sessionId}" message size: ${a.byteLength}`),"license-request"===r||"license-renewal"===r?this.renewLicense(t,a).catch((t=>{this.handleError(t),l.emit("error",t)})):"license-release"===r?t.keySystem===$u.FAIRPLAY&&(this.updateKeySession(t,Ou("acknowledged")),this.removeSession(t)):this.warn(`unhandled media key message type "${r}"`)},h=t._onkeystatuseschange=e=>{if(!t.mediaKeysSession)return void l.emit("error",new Error("invalid state"));this.onKeyStatusChange(t);const i=t.keyStatus;l.emit("keyStatus",i),"expired"===i&&(this.warn(`${t.keySystem} expired for key ${c}`),this.renewKeySession(t))};t.mediaKeysSession.addEventListener("message",d),t.mediaKeysSession.addEventListener("keystatuseschange",h);const p=new Promise(((t,e)=>{l.on("error",e),l.on("keyStatus",(i=>{i.startsWith("usable")?t():"output-restricted"===i?e(new Iy({type:gu.KEY_SYSTEM_ERROR,details:uu.KEY_SYSTEM_STATUS_OUTPUT_RESTRICTED,fatal:!1},"HDCP level output restricted")):"internal-error"===i?e(new Iy({type:gu.KEY_SYSTEM_ERROR,details:uu.KEY_SYSTEM_STATUS_INTERNAL_ERROR,fatal:!0},`key status changed to "${i}"`)):"expired"===i?e(new Error("key expired while generating request")):this.warn(`unhandled key status change "${i}"`)}))}));return t.mediaKeysSession.generateRequest(e,i).then((()=>{var e;this.log(`Request generated for key-session "${null==(e=t.mediaKeysSession)?void 0:e.sessionId}" keyId: ${c}`)})).catch((t=>{throw new Iy({type:gu.KEY_SYSTEM_ERROR,details:uu.KEY_SYSTEM_NO_SESSION,error:t,fatal:!1},`Error generating key-session request: ${t}`)})).then((()=>p)).catch((e=>{throw l.removeAllListeners(),this.removeSession(t),e})).then((()=>(l.removeAllListeners(),t)))}onKeyStatusChange(t){t.mediaKeysSession.keyStatuses.forEach(((e,i)=>{this.log(`key status change "${e}" for keyStatuses keyId: ${bf("buffer"in i?new Uint8Array(i.buffer,i.byteOffset,i.byteLength):new Uint8Array(i))} session keyId: ${bf(new Uint8Array(t.decryptdata.keyId||[]))} uri: ${t.decryptdata.uri}`),t.keyStatus=e}))}fetchServerCertificate(t){const e=this.config,i=new(0,e.loader)(e),r=this.getServerCertificateUrl(t);return r?(this.log(`Fetching server certificate for "${t}"`),new Promise(((a,s)=>{const n={responseType:"arraybuffer",url:r},o=e.certLoadPolicy.default,c={loadPolicy:o,timeout:o.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0},l={onSuccess:(t,e,i,r)=>{a(t.data)},onError:(e,i,a,o)=>{s(new Iy({type:gu.KEY_SYSTEM_ERROR,details:uu.KEY_SYSTEM_SERVER_CERTIFICATE_REQUEST_FAILED,fatal:!0,networkDetails:a,response:su({url:n.url,data:void 0},e)},`"${t}" certificate request failed (${r}). Status: ${e.code} (${e.text})`))},onTimeout:(e,i,a)=>{s(new Iy({type:gu.KEY_SYSTEM_ERROR,details:uu.KEY_SYSTEM_SERVER_CERTIFICATE_REQUEST_FAILED,fatal:!0,networkDetails:a,response:{url:n.url,data:void 0}},`"${t}" certificate request timed out (${r})`))},onAbort:(t,e,i)=>{s(new Error("aborted"))}};i.load(n,c,l)}))):Promise.resolve()}setMediaKeysServerCertificate(t,e,i){return new Promise(((r,a)=>{t.setServerCertificate(i).then((a=>{this.log(`setServerCertificate ${a?"success":"not supported by CDM"} (${null==i?void 0:i.byteLength}) on "${e}"`),r(t)})).catch((t=>{a(new Iy({type:gu.KEY_SYSTEM_ERROR,details:uu.KEY_SYSTEM_SERVER_CERTIFICATE_UPDATE_FAILED,error:t,fatal:!0},t.message))}))}))}renewLicense(t,e){return this.requestLicense(t,new Uint8Array(e)).then((e=>this.updateKeySession(t,new Uint8Array(e)).catch((t=>{throw new Iy({type:gu.KEY_SYSTEM_ERROR,details:uu.KEY_SYSTEM_SESSION_UPDATE_FAILED,error:t,fatal:!0},t.message)}))))}unpackPlayReadyKeyMessage(t,e){const i=String.fromCharCode.apply(null,new Uint16Array(e.buffer));if(!i.includes("PlayReadyKeyMessage"))return t.setRequestHeader("Content-Type","text/xml; charset=utf-8"),e;const r=(new DOMParser).parseFromString(i,"application/xml"),a=r.querySelectorAll("HttpHeader");if(a.length>0){let e;for(let i=0,r=a.length;i<r;i++){var s,n;e=a[i];const r=null==(s=e.querySelector("name"))?void 0:s.textContent,o=null==(n=e.querySelector("value"))?void 0:n.textContent;r&&o&&t.setRequestHeader(r,o)}}const o=r.querySelector("Challenge"),c=null==o?void 0:o.textContent;if(!c)throw new Error("Cannot find <Challenge> in key message");return Ou(atob(c))}setupLicenseXHR(t,e,i,r){const a=this.config.licenseXhrSetup;return a?Promise.resolve().then((()=>{if(!i.decryptdata)throw new Error("Key removed");return a.call(this.hls,t,e,i,r)})).catch((s=>{if(!i.decryptdata)throw s;return t.open("POST",e,!0),a.call(this.hls,t,e,i,r)})).then((i=>{t.readyState||t.open("POST",e,!0);return{xhr:t,licenseChallenge:i||r}})):(t.open("POST",e,!0),Promise.resolve({xhr:t,licenseChallenge:r}))}requestLicense(t,e){const i=this.config.keyLoadPolicy.default;return new Promise(((r,a)=>{const s=this.getLicenseServerUrlOrThrow(t.keySystem);this.log(`Sending license request to URL: ${s}`);const n=new XMLHttpRequest;n.responseType="arraybuffer",n.onreadystatechange=()=>{if(!this.hls||!t.mediaKeysSession)return a(new Error("invalid state"));if(4===n.readyState)if(200===n.status){this._requestLicenseFailureCount=0;let e=n.response;this.log(`License received ${e instanceof ArrayBuffer?e.byteLength:e}`);const i=this.config.licenseResponseCallback;if(i)try{e=i.call(this.hls,n,s,t)}catch(t){this.error(t)}r(e)}else{const o=i.errorRetry,c=o?o.maxNumRetry:0;if(this._requestLicenseFailureCount++,this._requestLicenseFailureCount>c||n.status>=400&&n.status<500)a(new Iy({type:gu.KEY_SYSTEM_ERROR,details:uu.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0,networkDetails:n,response:{url:s,data:void 0,code:n.status,text:n.statusText}},`License Request XHR failed (${s}). Status: ${n.status} (${n.statusText})`));else{const i=c-this._requestLicenseFailureCount+1;this.warn(`Retrying license request, ${i} attempts left`),this.requestLicense(t,e).then(r,a)}}},t.licenseXhr&&t.licenseXhr.readyState!==XMLHttpRequest.DONE&&t.licenseXhr.abort(),t.licenseXhr=n,this.setupLicenseXHR(n,s,t,e).then((({xhr:e,licenseChallenge:i})=>{t.keySystem==$u.PLAYREADY&&(i=this.unpackPlayReadyKeyMessage(e,i)),e.send(i)}))}))}onMediaAttached(t,e){if(!this.config.emeEnabled)return;const i=e.media;this.media=i,i.removeEventListener("encrypted",this.onMediaEncrypted),i.removeEventListener("waitingforkey",this.onWaitingForKey),i.addEventListener("encrypted",this.onMediaEncrypted),i.addEventListener("waitingforkey",this.onWaitingForKey)}onMediaDetached(){const t=this.media,e=this.mediaKeySessions;t&&(t.removeEventListener("encrypted",this.onMediaEncrypted),t.removeEventListener("waitingforkey",this.onWaitingForKey),this.media=null),this._requestLicenseFailureCount=0,this.setMediaKeysQueue=[],this.mediaKeySessions=[],this.keyIdToKeySessionPromise={},Vf.clearKeyUriToKeyIdMap();const i=e.length;My.CDMCleanupPromise=Promise.all(e.map((t=>this.removeSession(t))).concat(null==t?void 0:t.setMediaKeys(null).catch((t=>{this.log(`Could not clear media keys: ${t}`)})))).then((()=>{i&&(this.log("finished closing key sessions and clearing media keys"),e.length=0)})).catch((t=>{this.log(`Could not close sessions and clear media keys: ${t}`)}))}onManifestLoading(){this.keyFormatPromise=null}onManifestLoaded(t,{sessionKeys:e}){if(e&&this.config.emeEnabled&&!this.keyFormatPromise){const t=e.reduce(((t,e)=>(-1===t.indexOf(e.keyFormat)&&t.push(e.keyFormat),t)),[]);this.log(`Selecting key-system from session-keys ${t.join(", ")}`),this.keyFormatPromise=this.getKeyFormatPromise(t)}}removeSession(t){const{mediaKeysSession:e,licenseXhr:i}=t;if(e){this.log(`Remove licenses and keys and close session ${e.sessionId}`),t._onmessage&&(e.removeEventListener("message",t._onmessage),t._onmessage=void 0),t._onkeystatuseschange&&(e.removeEventListener("keystatuseschange",t._onkeystatuseschange),t._onkeystatuseschange=void 0),i&&i.readyState!==XMLHttpRequest.DONE&&i.abort(),t.mediaKeysSession=t.decryptdata=t.licenseXhr=void 0;const r=this.mediaKeySessions.indexOf(t);return r>-1&&this.mediaKeySessions.splice(r,1),e.remove().catch((t=>{this.log(`Could not remove session: ${t}`)})).then((()=>e.close())).catch((t=>{this.log(`Could not close session: ${t}`)}))}}}My.CDMCleanupPromise=void 0;class Iy extends Error{constructor(t,e){super(e),this.data=void 0,t.error||(t.error=new Error(e)),this.data=t,t.err=t.error}}var Oy,Uy,$y;!function(t){t.MANIFEST="m",t.AUDIO="a",t.VIDEO="v",t.MUXED="av",t.INIT="i",t.CAPTION="c",t.TIMED_TEXT="tt",t.KEY="k",t.OTHER="o"}(Oy||(Oy={})),function(t){t.DASH="d",t.HLS="h",t.SMOOTH="s",t.OTHER="o"}(Uy||(Uy={})),function(t){t.OBJECT="CMCD-Object",t.REQUEST="CMCD-Request",t.SESSION="CMCD-Session",t.STATUS="CMCD-Status"}($y||($y={}));const Fy={[$y.OBJECT]:["br","d","ot","tb"],[$y.REQUEST]:["bl","dl","mtp","nor","nrr","su"],[$y.SESSION]:["cid","pr","sf","sid","st","v"],[$y.STATUS]:["bs","rtp"]};class jy{constructor(t,e){this.value=void 0,this.params=void 0,Array.isArray(t)&&(t=t.map((t=>t instanceof jy?t:new jy(t)))),this.value=t,this.params=e}}class zy{constructor(t){this.description=void 0,this.description=t}}function Ny(t,e,i,r){return new Error(`failed to ${t} "${a=e,Array.isArray(a)?JSON.stringify(a):a instanceof Map?"Map{}":a instanceof Set?"Set{}":"object"==typeof a?JSON.stringify(a):String(a)}" as ${i}`,{cause:r});var a}const By="Bare Item";const Hy=/[\x00-\x1f\x7f]+/;function Gy(t,e,i){return Ny("serialize",t,e,i)}function Vy(t){if(!1===ArrayBuffer.isView(t))throw Gy(t,"Byte Sequence");return`:${e=t,btoa(String.fromCharCode(...e))}:`;var e}function qy(t){if(function(t){return t<-999999999999999||999999999999999<t}(t))throw Gy(t,"Integer");return t.toString()}function Ky(t,e){if(t<0)return-Ky(-t,e);const i=Math.pow(10,e);if(Math.abs(t*i%1-.5)<Number.EPSILON){const e=Math.floor(t*i);return(e%2==0?e:e+1)/i}return Math.round(t*i)/i}function Wy(t){const e=Ky(t,3);if(Math.floor(Math.abs(e)).toString().length>12)throw Gy(t,"Decimal");const i=e.toString();return i.includes(".")?i:`${i}.0`}function Yy(t){const e=(i=t).description||i.toString().slice(7,-1);var i;if(!1===/^([a-zA-Z*])([!#$%&'*+\-.^_`|~\w:/]*)$/.test(e))throw Gy(e,"Token");return e}function Zy(t){switch(typeof t){case"number":if(!lu(t))throw Gy(t,By);return Number.isInteger(t)?qy(t):Wy(t);case"string":return function(t){if(Hy.test(t))throw Gy(t,"String");return`"${t.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}"`}(t);case"symbol":return Yy(t);case"boolean":return function(t){if("boolean"!=typeof t)throw Gy(t,"Boolean");return t?"?1":"?0"}(t);case"object":if(t instanceof Date)return function(t){return`@${qy(t.getTime()/1e3)}`}(t);if(t instanceof Uint8Array)return Vy(t);if(t instanceof zy)return Yy(t);default:throw Gy(t,By)}}function Qy(t){if(!1===/^[a-z*][a-z0-9\-_.*]*$/.test(t))throw Gy(t,"Key");return t}function Jy(t){return null==t?"":Object.entries(t).map((([t,e])=>!0===e?`;${Qy(t)}`:`;${Qy(t)}=${Zy(e)}`)).join("")}function Xy(t){return t instanceof jy?`${Zy(t.value)}${Jy(t.params)}`:Zy(t)}function tw(t,e={whitespace:!0}){if("object"!=typeof t)throw Gy(t,"Dict");const i=t instanceof Map?t.entries():Object.entries(t),r=null!=e&&e.whitespace?" ":"";return Array.from(i).map((([t,e])=>{e instanceof jy==!1&&(e=new jy(e));let i=Qy(t);var r;return!0===e.value?i+=Jy(e.params):(i+="=",Array.isArray(e.value)?i+=`(${(r=e).value.map(Xy).join(" ")})${Jy(r.params)}`:i+=Xy(e)),i})).join(`,${r}`)}const ew=t=>Math.round(t),iw=t=>100*ew(t/100),rw={br:ew,d:ew,bl:iw,dl:iw,mtp:iw,nor:(t,e)=>(null!=e&&e.baseUrl&&(t=function(t,e){const i=new URL(t),r=new URL(e);if(i.origin!==r.origin)return t;const a=i.pathname.split("/").slice(1),s=r.pathname.split("/").slice(1,-1);for(;a[0]===s[0];)a.shift(),s.shift();for(;s.length;)s.shift(),a.unshift("..");return a.join("/")}(t,e.baseUrl)),encodeURIComponent(t)),rtp:iw,tb:ew};function aw(t,e){const i={};if(null==t||"object"!=typeof t)return i;const r=Object.keys(t).sort(),a=cu({},rw,null==e?void 0:e.formatters),s=null==e?void 0:e.filter;return r.forEach((r=>{if(null!=s&&s(r))return;let n=t[r];const o=a[r];o&&(n=o(n,e)),"v"===r&&1===n||"pr"==r&&1===n||(t=>"number"==typeof t?lu(t):null!=t&&""!==t&&!1!==t)(n)&&((t=>"ot"===t||"sf"===t||"st"===t)(r)&&"string"==typeof n&&(n=new zy(n)),i[r]=n)})),i}function sw(t,e={}){return t?function(t,e){return tw(t,e)}(aw(t,e),cu({whitespace:!1},e)):""}function nw(t,e,i){return cu(t,function(t,e={}){if(!t)return{};const i=Object.entries(t),r=Object.entries(Fy).concat(Object.entries((null==e?void 0:e.customHeaderMap)||{})),a=i.reduce(((t,e)=>{var i;const[a,s]=e,n=(null==(i=r.find((t=>t[1].includes(a))))?void 0:i[0])||$y.REQUEST;return null!=t[n]||(t[n]={}),t[n][a]=s,t}),{});return Object.entries(a).reduce(((t,[i,r])=>(t[i]=sw(r,e),t)),{})}(e,i))}const ow=/CMCD=[^&#]+/;function cw(t,e,i){const r=function(t,e={}){if(!t)return"";const i=sw(t,e);return`CMCD=${encodeURIComponent(i)}`}(e,i);if(!r)return t;if(ow.test(t))return t.replace(ow,r);const a=t.includes("?")?"&":"?";return`${t}${a}${r}`}function lw(t,e,i,r){t&&Object.keys(e).forEach((a=>{const s=t.filter((t=>t.groupId===a)).map((t=>{const s=cu({},t);return s.details=void 0,s.attrs=new xu(s.attrs),s.url=s.attrs.URI=dw(t.url,t.attrs["STABLE-RENDITION-ID"],"PER-RENDITION-URIS",i),s.groupId=s.attrs["GROUP-ID"]=e[a],s.attrs["PATHWAY-ID"]=r,s}));t.push(...s)}))}function dw(t,e,i,r){const{HOST:a,PARAMS:s,[i]:n}=r;let o;e&&(o=null==n?void 0:n[e],o&&(t=o));const c=new self.URL(t);return a&&!o&&(c.host=a),s&&Object.keys(s).sort().forEach((t=>{t&&c.searchParams.set(t,s[t])})),c.href}const hw=/^age:\s*[\d.]+\s*$/im;class pw{constructor(t){this.xhrSetup=void 0,this.requestTimeout=void 0,this.retryTimeout=void 0,this.retryDelay=void 0,this.config=null,this.callbacks=null,this.context=null,this.loader=null,this.stats=void 0,this.xhrSetup=t&&t.xhrSetup||null,this.stats=new Cu,this.retryDelay=0}destroy(){this.callbacks=null,this.abortInternal(),this.loader=null,this.config=null,this.context=null,this.xhrSetup=null}abortInternal(){const t=this.loader;self.clearTimeout(this.requestTimeout),self.clearTimeout(this.retryTimeout),t&&(t.onreadystatechange=null,t.onprogress=null,4!==t.readyState&&(this.stats.aborted=!0,t.abort()))}abort(){var t;this.abortInternal(),null!=(t=this.callbacks)&&t.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.loader)}load(t,e,i){if(this.stats.loading.start)throw new Error("Loader can only be used once.");this.stats.loading.start=self.performance.now(),this.context=t,this.config=e,this.callbacks=i,this.loadInternal()}loadInternal(){const{config:t,context:e}=this;if(!t||!e)return;const i=this.loader=new self.XMLHttpRequest,r=this.stats;r.loading.first=0,r.loaded=0,r.aborted=!1;const a=this.xhrSetup;a?Promise.resolve().then((()=>{if(this.loader===i&&!this.stats.aborted)return a(i,e.url)})).catch((t=>{if(this.loader===i&&!this.stats.aborted)return i.open("GET",e.url,!0),a(i,e.url)})).then((()=>{this.loader!==i||this.stats.aborted||this.openAndSendXhr(i,e,t)})).catch((t=>{this.callbacks.onError({code:i.status,text:t.message},e,i,r)})):this.openAndSendXhr(i,e,t)}openAndSendXhr(t,e,i){t.readyState||t.open("GET",e.url,!0);const r=e.headers,{maxTimeToFirstByteMs:a,maxLoadTimeMs:s}=i.loadPolicy;if(r)for(const e in r)t.setRequestHeader(e,r[e]);e.rangeEnd&&t.setRequestHeader("Range","bytes="+e.rangeStart+"-"+(e.rangeEnd-1)),t.onreadystatechange=this.readystatechange.bind(this),t.onprogress=this.loadprogress.bind(this),t.responseType=e.responseType,self.clearTimeout(this.requestTimeout),i.timeout=a&&lu(a)?a:s,this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),i.timeout),t.send()}readystatechange(){const{context:t,loader:e,stats:i}=this;if(!t||!e)return;const r=e.readyState,a=this.config;if(!i.aborted&&r>=2&&(0===i.loading.first&&(i.loading.first=Math.max(self.performance.now(),i.loading.start),a.timeout!==a.loadPolicy.maxLoadTimeMs&&(self.clearTimeout(this.requestTimeout),a.timeout=a.loadPolicy.maxLoadTimeMs,this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),a.loadPolicy.maxLoadTimeMs-(i.loading.first-i.loading.start)))),4===r)){self.clearTimeout(this.requestTimeout),e.onreadystatechange=null,e.onprogress=null;const r=e.status,s="text"===e.responseType?e.responseText:null;if(r>=200&&r<300){const a=null!=s?s:e.response;if(null!=a){i.loading.end=Math.max(self.performance.now(),i.loading.first);const s="arraybuffer"===e.responseType?a.byteLength:a.length;if(i.loaded=i.total=s,i.bwEstimate=8e3*i.total/(i.loading.end-i.loading.first),!this.callbacks)return;const n=this.callbacks.onProgress;if(n&&n(i,t,a,e),!this.callbacks)return;const o={url:e.responseURL,data:a,code:r};return void this.callbacks.onSuccess(o,i,t,e)}}const n=a.loadPolicy.errorRetry;gv(n,i.retry,!1,{url:t.url,data:void 0,code:r})?this.retry(n):(ku.error(`${r} while loading ${t.url}`),this.callbacks.onError({code:r,text:e.statusText},t,e,i))}}loadtimeout(){if(!this.config)return;const t=this.config.loadPolicy.timeoutRetry;if(gv(t,this.stats.retry,!0))this.retry(t);else{var e;ku.warn(`timeout while loading ${null==(e=this.context)?void 0:e.url}`);const t=this.callbacks;t&&(this.abortInternal(),t.onTimeout(this.stats,this.context,this.loader))}}retry(t){const{context:e,stats:i}=this;this.retryDelay=hv(t,i.retry),i.retry++,ku.warn(`${status?"HTTP Status "+status:"Timeout"} while loading ${null==e?void 0:e.url}, retrying ${i.retry}/${t.maxNumRetry} in ${this.retryDelay}ms`),this.abortInternal(),this.loader=null,self.clearTimeout(this.retryTimeout),this.retryTimeout=self.setTimeout(this.loadInternal.bind(this),this.retryDelay)}loadprogress(t){const e=this.stats;e.loaded=t.loaded,t.lengthComputable&&(e.total=t.total)}getCacheAge(){let t=null;if(this.loader&&hw.test(this.loader.getAllResponseHeaders())){const e=this.loader.getResponseHeader("age");t=e?parseFloat(e):null}return t}getResponseHeader(t){return this.loader&&new RegExp(`^${t}:\\s*[\\d.]+\\s*$`,"im").test(this.loader.getAllResponseHeaders())?this.loader.getResponseHeader(t):null}}const gw=/(\d+)-(\d+)\/(\d+)/;class uw{constructor(t){this.fetchSetup=void 0,this.requestTimeout=void 0,this.request=null,this.response=null,this.controller=void 0,this.context=null,this.config=null,this.callbacks=null,this.stats=void 0,this.loader=null,this.fetchSetup=t.fetchSetup||fw,this.controller=new self.AbortController,this.stats=new Cu}destroy(){this.loader=this.callbacks=this.context=this.config=this.request=null,this.abortInternal(),this.response=null,this.fetchSetup=this.controller=this.stats=null}abortInternal(){this.controller&&!this.stats.loading.end&&(this.stats.aborted=!0,this.controller.abort())}abort(){var t;this.abortInternal(),null!=(t=this.callbacks)&&t.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.response)}load(t,e,i){const r=this.stats;if(r.loading.start)throw new Error("Loader can only be used once.");r.loading.start=self.performance.now();const a=function(t,e){const i={method:"GET",mode:"cors",credentials:"same-origin",signal:e,headers:new self.Headers(cu({},t.headers))};t.rangeEnd&&i.headers.set("Range","bytes="+t.rangeStart+"-"+String(t.rangeEnd-1));return i}(t,this.controller.signal),s=i.onProgress,n="arraybuffer"===t.responseType,o=n?"byteLength":"length",{maxTimeToFirstByteMs:c,maxLoadTimeMs:l}=e.loadPolicy;this.context=t,this.config=e,this.callbacks=i,this.request=this.fetchSetup(t,a),self.clearTimeout(this.requestTimeout),e.timeout=c&&lu(c)?c:l,this.requestTimeout=self.setTimeout((()=>{this.abortInternal(),i.onTimeout(r,t,this.response)}),e.timeout),self.fetch(this.request).then((a=>{this.response=this.loader=a;const o=Math.max(self.performance.now(),r.loading.start);if(self.clearTimeout(this.requestTimeout),e.timeout=l,this.requestTimeout=self.setTimeout((()=>{this.abortInternal(),i.onTimeout(r,t,this.response)}),l-(o-r.loading.start)),!a.ok){const{status:t,statusText:e}=a;throw new mw(e||"fetch, bad network response",t,a)}return r.loading.first=o,r.total=function(t){const e=t.get("Content-Range");if(e){const t=function(t){const e=gw.exec(t);if(e)return parseInt(e[2])-parseInt(e[1])+1}(e);if(lu(t))return t}const i=t.get("Content-Length");if(i)return parseInt(i)}(a.headers)||r.total,s&&lu(e.highWaterMark)?this.loadProgressively(a,r,t,e.highWaterMark,s):n?a.arrayBuffer():"json"===t.responseType?a.json():a.text()})).then((a=>{const n=this.response;if(!n)throw new Error("loader destroyed");self.clearTimeout(this.requestTimeout),r.loading.end=Math.max(self.performance.now(),r.loading.first);const c=a[o];c&&(r.loaded=r.total=c);const l={url:n.url,data:a,code:n.status};s&&!lu(e.highWaterMark)&&s(r,t,a,n),i.onSuccess(l,r,t,n)})).catch((e=>{if(self.clearTimeout(this.requestTimeout),r.aborted)return;const a=e&&e.code||0,s=e?e.message:null;i.onError({code:a,text:s},t,e?e.details:null,r)}))}getCacheAge(){let t=null;if(this.response){const e=this.response.headers.get("age");t=e?parseFloat(e):null}return t}getResponseHeader(t){return this.response?this.response.headers.get(t):null}loadProgressively(t,e,i,r=0,a){const s=new Sb,n=t.body.getReader(),o=()=>n.read().then((n=>{if(n.done)return s.dataLength&&a(e,i,s.flush(),t),Promise.resolve(new ArrayBuffer(0));const c=n.value,l=c.length;return e.loaded+=l,l<r||s.dataLength?(s.push(c),s.dataLength>=r&&a(e,i,s.flush(),t)):a(e,i,c,t),o()})).catch((()=>Promise.reject()));return o()}}function fw(t,e){return new self.Request(t.url,e)}class mw extends Error{constructor(t,e,i){super(t),this.code=void 0,this.details=void 0,this.code=e,this.details=i}}const vw=/\s/,bw={newCue(t,e,i,r){const a=[];let s,n,o,c,l;const d=self.VTTCue||self.TextTrackCue;for(let p=0;p<r.rows.length;p++)if(s=r.rows[p],o=!0,c=0,l="",!s.isEmpty()){var h;for(let t=0;t<s.chars.length;t++)vw.test(s.chars[t].uchar)&&o?c++:(l+=s.chars[t].uchar,o=!1);s.cueStartTime=e,e===i&&(i+=1e-4),c>=16?c--:c++;const r=hy(l.trim()),g=my(e,i,r);null!=t&&null!=(h=t.cues)&&h.getCueById(g)||(n=new d(e,i,r),n.id=g,n.line=p+1,n.align="left",n.position=10+Math.min(80,10*Math.floor(8*c/32)),a.push(n))}return t&&a.length&&(a.sort(((t,e)=>"auto"===t.line||"auto"===e.line?0:t.line>8&&e.line>8?e.line-t.line:t.line-e.line)),a.forEach((e=>Mm(t,e)))),a}},kw=su(su({autoStartLoad:!0,startPosition:-1,defaultAudioCodec:void 0,debug:!1,capLevelOnFPSDrop:!1,capLevelToPlayerSize:!1,ignoreDevicePixelRatio:!1,preferManagedMediaSource:!0,initialLiveManifestSize:1,maxBufferLength:30,backBufferLength:1/0,frontBufferFlushThreshold:1/0,maxBufferSize:6e7,maxBufferHole:.1,highBufferWatchdogPeriod:2,nudgeOffset:.1,nudgeMaxRetry:3,maxFragLookUpTolerance:.25,liveSyncDurationCount:3,liveMaxLatencyDurationCount:1/0,liveSyncDuration:void 0,liveMaxLatencyDuration:void 0,maxLiveSyncPlaybackRate:1,liveDurationInfinity:!1,liveBackBufferLength:null,maxMaxBufferLength:600,enableWorker:!0,workerPath:null,enableSoftwareAES:!0,startLevel:void 0,startFragPrefetch:!1,fpsDroppedMonitoringPeriod:5e3,fpsDroppedMonitoringThreshold:.2,appendErrorMaxRetry:3,loader:pw,fLoader:void 0,pLoader:void 0,xhrSetup:void 0,licenseXhrSetup:void 0,licenseResponseCallback:void 0,abrController:class{constructor(t){this.hls=void 0,this.lastLevelLoadSec=0,this.lastLoadedFragLevel=-1,this.firstSelection=-1,this._nextAutoLevel=-1,this.nextAutoLevelKey="",this.audioTracksByGroup=null,this.codecTiers=null,this.timer=-1,this.fragCurrent=null,this.partCurrent=null,this.bitrateTestDelay=0,this.bwEstimator=void 0,this._abandonRulesCheck=()=>{const{fragCurrent:t,partCurrent:e,hls:i}=this,{autoLevelEnabled:r,media:a}=i;if(!t||!a)return;const s=performance.now(),n=e?e.stats:t.stats,o=e?e.duration:t.duration,c=s-n.loading.start,l=i.minAutoLevel;if(n.aborted||n.loaded&&n.loaded===n.total||t.level<=l)return this.clearTimer(),void(this._nextAutoLevel=-1);if(!r||a.paused||!a.playbackRate||!a.readyState)return;const d=i.mainForwardBufferInfo;if(null===d)return;const h=this.bwEstimator.getEstimateTTFB(),p=Math.abs(a.playbackRate);if(c<=Math.max(h,o/(2*p)*1e3))return;const g=d.len/p,u=n.loading.first?n.loading.first-n.loading.start:-1,f=n.loaded&&u>-1,m=this.getBwEstimate(),v=i.levels,b=v[t.level],k=n.total||Math.max(n.loaded,Math.round(o*b.averageBitrate/8));let y=f?c-u:c;y<1&&f&&(y=Math.min(c,8*n.loaded/m));const w=f?1e3*n.loaded/y:0,x=w?(k-n.loaded)/w:8*k/m+h/1e3;if(x<=g)return;const S=w?8*w:m;let P,C=Number.POSITIVE_INFINITY;for(P=t.level-1;P>l;P--){const t=v[P].maxBitrate;if(C=this.getTimeToLoadFrag(h/1e3,S,o*t,!v[P].details),C<g)break}if(C>=x)return;if(C>10*o)return;i.nextLoadLevel=i.nextAutoLevel=P,f?this.bwEstimator.sample(c-Math.min(h,u),n.loaded):this.bwEstimator.sampleTTFB(c);const E=v[P].maxBitrate;this.getBwEstimate()*this.hls.config.abrBandWidthUpFactor>E&&this.resetEstimator(E),this.clearTimer(),ku.warn(`[abr] Fragment ${t.sn}${e?" part "+e.index:""} of level ${t.level} is loading too slowly;\n Time to underbuffer: ${g.toFixed(3)} s\n Estimated load time for current fragment: ${x.toFixed(3)} s\n Estimated load time for down switch fragment: ${C.toFixed(3)} s\n TTFB estimate: ${0|u} ms\n Current BW estimate: ${lu(m)?0|m:"Unknown"} bps\n New BW estimate: ${0|this.getBwEstimate()} bps\n Switching to level ${P} @ ${0|E} bps`),i.trigger(pu.FRAG_LOAD_EMERGENCY_ABORTED,{frag:t,part:e,stats:n})},this.hls=t,this.bwEstimator=this.initEstimator(),this.registerListeners()}resetEstimator(t){t&&(ku.log(`setting initial bwe to ${t}`),this.hls.config.abrEwmaDefaultEstimate=t),this.firstSelection=-1,this.bwEstimator=this.initEstimator()}initEstimator(){const t=this.hls.config;return new Tv(t.abrEwmaSlowVoD,t.abrEwmaFastVoD,t.abrEwmaDefaultEstimate)}registerListeners(){const{hls:t}=this;t.on(pu.MANIFEST_LOADING,this.onManifestLoading,this),t.on(pu.FRAG_LOADING,this.onFragLoading,this),t.on(pu.FRAG_LOADED,this.onFragLoaded,this),t.on(pu.FRAG_BUFFERED,this.onFragBuffered,this),t.on(pu.LEVEL_SWITCHING,this.onLevelSwitching,this),t.on(pu.LEVEL_LOADED,this.onLevelLoaded,this),t.on(pu.LEVELS_UPDATED,this.onLevelsUpdated,this),t.on(pu.MAX_AUTO_LEVEL_UPDATED,this.onMaxAutoLevelUpdated,this),t.on(pu.ERROR,this.onError,this)}unregisterListeners(){const{hls:t}=this;t&&(t.off(pu.MANIFEST_LOADING,this.onManifestLoading,this),t.off(pu.FRAG_LOADING,this.onFragLoading,this),t.off(pu.FRAG_LOADED,this.onFragLoaded,this),t.off(pu.FRAG_BUFFERED,this.onFragBuffered,this),t.off(pu.LEVEL_SWITCHING,this.onLevelSwitching,this),t.off(pu.LEVEL_LOADED,this.onLevelLoaded,this),t.off(pu.LEVELS_UPDATED,this.onLevelsUpdated,this),t.off(pu.MAX_AUTO_LEVEL_UPDATED,this.onMaxAutoLevelUpdated,this),t.off(pu.ERROR,this.onError,this))}destroy(){this.unregisterListeners(),this.clearTimer(),this.hls=this._abandonRulesCheck=null,this.fragCurrent=this.partCurrent=null}onManifestLoading(t,e){this.lastLoadedFragLevel=-1,this.firstSelection=-1,this.lastLevelLoadSec=0,this.fragCurrent=this.partCurrent=null,this.onLevelsUpdated(),this.clearTimer()}onLevelsUpdated(){this.lastLoadedFragLevel>-1&&this.fragCurrent&&(this.lastLoadedFragLevel=this.fragCurrent.level),this._nextAutoLevel=-1,this.onMaxAutoLevelUpdated(),this.codecTiers=null,this.audioTracksByGroup=null}onMaxAutoLevelUpdated(){this.firstSelection=-1,this.nextAutoLevelKey=""}onFragLoading(t,e){const i=e.frag;if(!this.ignoreFragment(i)){var r;if(!i.bitrateTest)this.fragCurrent=i,this.partCurrent=null!=(r=e.part)?r:null;this.clearTimer(),this.timer=self.setInterval(this._abandonRulesCheck,100)}}onLevelSwitching(t,e){this.clearTimer()}onError(t,e){if(!e.fatal)switch(e.details){case uu.BUFFER_ADD_CODEC_ERROR:case uu.BUFFER_APPEND_ERROR:this.lastLoadedFragLevel=-1,this.firstSelection=-1;break;case uu.FRAG_LOAD_TIMEOUT:{const t=e.frag,{fragCurrent:i,partCurrent:r}=this;if(t&&i&&t.sn===i.sn&&t.level===i.level){const e=performance.now(),i=r?r.stats:t.stats,a=e-i.loading.start,s=i.loading.first?i.loading.first-i.loading.start:-1;if(i.loaded&&s>-1){const t=this.bwEstimator.getEstimateTTFB();this.bwEstimator.sample(a-Math.min(t,s),i.loaded)}else this.bwEstimator.sampleTTFB(a)}break}}}getTimeToLoadFrag(t,e,i,r){return t+i/e+(r?this.lastLevelLoadSec:0)}onLevelLoaded(t,e){const i=this.hls.config,{loading:r}=e.stats,a=r.end-r.start;lu(a)&&(this.lastLevelLoadSec=a/1e3),e.details.live?this.bwEstimator.update(i.abrEwmaSlowLive,i.abrEwmaFastLive):this.bwEstimator.update(i.abrEwmaSlowVoD,i.abrEwmaFastVoD)}onFragLoaded(t,{frag:e,part:i}){const r=i?i.stats:e.stats;if(e.type===Em&&this.bwEstimator.sampleTTFB(r.loading.first-r.loading.start),!this.ignoreFragment(e)){if(this.clearTimer(),e.level===this._nextAutoLevel&&(this._nextAutoLevel=-1),this.firstSelection=-1,this.hls.config.abrMaxWithRealBitrate){const t=i?i.duration:e.duration,a=this.hls.levels[e.level],s=(a.loaded?a.loaded.bytes:0)+r.loaded,n=(a.loaded?a.loaded.duration:0)+t;a.loaded={bytes:s,duration:n},a.realBitrate=Math.round(8*s/n)}if(e.bitrateTest){const t={stats:r,frag:e,part:i,id:e.type};this.onFragBuffered(pu.FRAG_BUFFERED,t),e.bitrateTest=!1}else this.lastLoadedFragLevel=e.level}}onFragBuffered(t,e){const{frag:i,part:r}=e,a=null!=r&&r.stats.loaded?r.stats:i.stats;if(a.aborted)return;if(this.ignoreFragment(i))return;const s=a.parsing.end-a.loading.start-Math.min(a.loading.first-a.loading.start,this.bwEstimator.getEstimateTTFB());this.bwEstimator.sample(s,a.loaded),a.bwEstimate=this.getBwEstimate(),i.bitrateTest?this.bitrateTestDelay=s/1e3:this.bitrateTestDelay=0}ignoreFragment(t){return t.type!==Em||"initSegment"===t.sn}clearTimer(){this.timer>-1&&(self.clearInterval(this.timer),this.timer=-1)}get firstAutoLevel(){const{maxAutoLevel:t,minAutoLevel:e}=this.hls,i=this.getBwEstimate(),r=this.hls.config.maxStarvationDelay,a=this.findBestLevel(i,e,t,0,r,1,1);if(a>-1)return a;const s=this.hls.firstLevel,n=Math.min(Math.max(s,e),t);return ku.warn(`[abr] Could not find best starting auto level. Defaulting to first in playlist ${s} clamped to ${n}`),n}get forcedAutoLevel(){return this.nextAutoLevelKey?-1:this._nextAutoLevel}get nextAutoLevel(){const t=this.forcedAutoLevel,e=this.bwEstimator.canEstimate(),i=this.lastLoadedFragLevel>-1;if(!(-1===t||e&&i&&this.nextAutoLevelKey!==this.getAutoLevelKey()))return t;const r=e&&i?this.getNextABRAutoLevel():this.firstAutoLevel;if(-1!==t){const e=this.hls.levels;if(e.length>Math.max(t,r)&&e[t].loadError<=e[r].loadError)return t}return this._nextAutoLevel=r,this.nextAutoLevelKey=this.getAutoLevelKey(),r}getAutoLevelKey(){return`${this.getBwEstimate()}_${this.getStarvationDelay().toFixed(2)}`}getNextABRAutoLevel(){const{fragCurrent:t,partCurrent:e,hls:i}=this,{maxAutoLevel:r,config:a,minAutoLevel:s}=i,n=e?e.duration:t?t.duration:0,o=this.getBwEstimate(),c=this.getStarvationDelay();let l=a.abrBandWidthFactor,d=a.abrBandWidthUpFactor;if(c){const t=this.findBestLevel(o,s,r,c,0,l,d);if(t>=0)return t}let h=n?Math.min(n,a.maxStarvationDelay):a.maxStarvationDelay;if(!c){const t=this.bitrateTestDelay;if(t){h=(n?Math.min(n,a.maxLoadingDelay):a.maxLoadingDelay)-t,ku.info(`[abr] bitrate test took ${Math.round(1e3*t)}ms, set first fragment max fetchDuration to ${Math.round(1e3*h)} ms`),l=d=1}}const p=this.findBestLevel(o,s,r,c,h,l,d);if(ku.info(`[abr] ${c?"rebuffering expected":"buffer is empty"}, optimal quality level ${p}`),p>-1)return p;const g=i.levels[s],u=i.levels[i.loadLevel];return(null==g?void 0:g.bitrate)<(null==u?void 0:u.bitrate)?s:i.loadLevel}getStarvationDelay(){const t=this.hls,e=t.media;if(!e)return 1/0;const i=e&&0!==e.playbackRate?Math.abs(e.playbackRate):1,r=t.mainForwardBufferInfo;return(r?r.len:0)/i}getBwEstimate(){return this.bwEstimator.canEstimate()?this.bwEstimator.getEstimate():this.hls.config.abrEwmaDefaultEstimate}findBestLevel(t,e,i,r,a,s,n){var o;const c=r+a,l=this.lastLoadedFragLevel,d=-1===l?this.hls.firstLevel:l,{fragCurrent:h,partCurrent:p}=this,{levels:g,allAudioTracks:u,loadLevel:f,config:m}=this.hls;if(1===g.length)return 0;const v=g[d],b=!(null==v||null==(o=v.details)||!o.live),k=-1===f||-1===l;let y,w="SDR",x=(null==v?void 0:v.frameRate)||0;const{audioPreference:S,videoPreference:P}=m,C=this.audioTracksByGroup||(this.audioTracksByGroup=function(t){return t.reduce(((t,e)=>{let i=t.groups[e.groupId];i||(i=t.groups[e.groupId]={tracks:[],channels:{2:0},hasDefault:!1,hasAutoSelect:!1}),i.tracks.push(e);const r=e.channels||"2";return i.channels[r]=(i.channels[r]||0)+1,i.hasDefault=i.hasDefault||e.default,i.hasAutoSelect=i.hasAutoSelect||e.autoselect,i.hasDefault&&(t.hasDefaultAudio=!0),i.hasAutoSelect&&(t.hasAutoSelectAudio=!0),t}),{hasDefaultAudio:!1,hasAutoSelectAudio:!1,groups:{}})}(u));if(k){if(-1!==this.firstSelection)return this.firstSelection;const r=this.codecTiers||(this.codecTiers=function(t,e,i,r){return t.slice(i,r+1).reduce(((t,i)=>{if(!i.codecSet)return t;const r=i.audioGroups;let a=t[i.codecSet];a||(t[i.codecSet]=a={minBitrate:1/0,minHeight:1/0,minFramerate:1/0,maxScore:0,videoRanges:{SDR:0},channels:{2:0},hasDefaultAudio:!r,fragmentError:0}),a.minBitrate=Math.min(a.minBitrate,i.bitrate);const s=Math.min(i.height,i.width);return a.minHeight=Math.min(a.minHeight,s),a.minFramerate=Math.min(a.minFramerate,i.frameRate),a.maxScore=Math.max(a.maxScore,i.score),a.fragmentError+=i.fragmentError,a.videoRanges[i.videoRange]=(a.videoRanges[i.videoRange]||0)+1,r&&r.forEach((t=>{if(!t)return;const i=e.groups[t];i&&(a.hasDefaultAudio=a.hasDefaultAudio||e.hasDefaultAudio?i.hasDefault:i.hasAutoSelect||!e.hasDefaultAudio&&!e.hasAutoSelectAudio,Object.keys(i.channels).forEach((t=>{a.channels[t]=(a.channels[t]||0)+i.channels[t]})))})),t}),{})}(g,C,e,i)),a=function(t,e,i,r,a){const s=Object.keys(t),n=null==r?void 0:r.channels,o=null==r?void 0:r.audioCodec,c=n&&2===parseInt(n);let l=!0,d=!1,h=1/0,p=1/0,g=1/0,u=0,f=[];const{preferHDR:m,allowedVideoRanges:v}=Dv(e,a);for(let e=s.length;e--;){const i=t[s[e]];l=i.channels[2]>0,h=Math.min(h,i.minHeight),p=Math.min(p,i.minFramerate),g=Math.min(g,i.minBitrate);const r=v.filter((t=>i.videoRanges[t]>0));r.length>0&&(d=!0,f=r)}h=lu(h)?h:0,p=lu(p)?p:0;const b=Math.max(1080,h),k=Math.max(30,p);return g=lu(g)?g:i,i=Math.max(g,i),d||(e=void 0,f=[]),{codecSet:s.reduce(((e,r)=>{const a=t[r];if(r===e)return e;if(a.minBitrate>i)return Mv(r,`min bitrate of ${a.minBitrate} > current estimate of ${i}`),e;if(!a.hasDefaultAudio)return Mv(r,"no renditions with default or auto-select sound found"),e;if(o&&r.indexOf(o.substring(0,4))%5!=0)return Mv(r,`audio codec preference "${o}" not found`),e;if(n&&!c){if(!a.channels[n])return Mv(r,`no renditions with ${n} channel sound found (channels options: ${Object.keys(a.channels)})`),e}else if((!o||c)&&l&&0===a.channels[2])return Mv(r,"no renditions with stereo sound found"),e;return a.minHeight>b?(Mv(r,`min resolution of ${a.minHeight} > maximum of ${b}`),e):a.minFramerate>k?(Mv(r,`min framerate of ${a.minFramerate} > maximum of ${k}`),e):f.some((t=>a.videoRanges[t]>0))?a.maxScore<u?(Mv(r,`max score of ${a.maxScore} < selected max of ${u}`),e):e&&(am(r)>=am(e)||a.fragmentError>t[e].fragmentError)?e:(u=a.maxScore,r):(Mv(r,`no variants with VIDEO-RANGE of ${JSON.stringify(f)} found`),e)}),void 0),videoRanges:f,preferHDR:m,minFramerate:p,minBitrate:g}}(r,w,t,S,P),{codecSet:s,videoRanges:n,minFramerate:o,minBitrate:c,preferHDR:l}=a;y=s,w=l?n[n.length-1]:n[0],x=o,t=Math.max(t,c),ku.log(`[abr] picked start tier ${JSON.stringify(a)}`)}else y=null==v?void 0:v.codecSet,w=null==v?void 0:v.videoRange;const E=p?p.duration:h?h.duration:0,T=this.bwEstimator.getEstimateTTFB()/1e3,L=[];for(let o=i;o>=e;o--){var _;const e=g[o],h=o>d;if(!e)continue;if(m.useMediaCapabilities&&!e.supportedResult&&!e.supportedPromise){const i=navigator.mediaCapabilities;"function"==typeof(null==i?void 0:i.decodingInfo)&&Rv(e,C,w,x,t,S)?(e.supportedPromise=Av(e,C,i),e.supportedPromise.then((t=>{if(!this.hls)return;e.supportedResult=t;const i=this.hls.levels,r=i.indexOf(e);t.error?ku.warn(`[abr] MediaCapabilities decodingInfo error: "${t.error}" for level ${r} ${JSON.stringify(t)}`):t.supported||(ku.warn(`[abr] Unsupported MediaCapabilities decodingInfo result for level ${r} ${JSON.stringify(t)}`),r>-1&&i.length>1&&(ku.log(`[abr] Removing unsupported level ${r}`),this.hls.removeLevel(r)))}))):e.supportedResult=Lv}if(y&&e.codecSet!==y||w&&e.videoRange!==w||h&&x>e.frameRate||!h&&x>0&&x<e.frameRate||e.supportedResult&&(null==(_=e.supportedResult.decodingInfoResults)||!_[0].smooth)){L.push(o);continue}const u=e.details,P=(p?null==u?void 0:u.partTarget:null==u?void 0:u.averagetargetduration)||E;let R;R=h?n*t:s*t;const A=E&&r>=2*E&&0===a?g[o].averageBitrate:g[o].maxBitrate,D=this.getTimeToLoadFrag(T,R,A*P,void 0===u);if(R>=A&&(o===l||0===e.loadError&&0===e.fragmentError)&&(D<=T||!lu(D)||b&&!this.bitrateTestDelay||D<c)){const t=this.forcedAutoLevel;return o===f||-1!==t&&t===f||(L.length&&ku.trace(`[abr] Skipped level(s) ${L.join(",")} of ${i} max with CODECS and VIDEO-RANGE:"${g[L[0]].codecs}" ${g[L[0]].videoRange}; not compatible with "${v.codecs}" ${w}`),ku.info(`[abr] switch candidate:${d}->${o} adjustedbw(${Math.round(R)})-bitrate=${Math.round(R-A)} ttfb:${T.toFixed(1)} avgDuration:${P.toFixed(1)} maxFetchDuration:${c.toFixed(1)} fetchDuration:${D.toFixed(1)} firstSelection:${k} codecSet:${y} videoRange:${w} hls.loadLevel:${f}`)),k&&(this.firstSelection=o),o}}return-1}set nextAutoLevel(t){const{maxAutoLevel:e,minAutoLevel:i}=this.hls,r=Math.min(Math.max(t,i),e);this._nextAutoLevel!==r&&(this.nextAutoLevelKey="",this._nextAutoLevel=r)}},bufferController:class{constructor(t){this.details=null,this._objectUrl=null,this.operationQueue=void 0,this.listeners=void 0,this.hls=void 0,this.bufferCodecEventsExpected=0,this._bufferCodecEventsTotal=0,this.media=null,this.mediaSource=null,this.lastMpegAudioChunk=null,this.appendSource=void 0,this.appendErrors={audio:0,video:0,audiovideo:0},this.tracks={},this.pendingTracks={},this.sourceBuffer=void 0,this.log=void 0,this.warn=void 0,this.error=void 0,this._onEndStreaming=t=>{this.hls&&this.hls.pauseBuffering()},this._onStartStreaming=t=>{this.hls&&this.hls.resumeBuffering()},this._onMediaSourceOpen=()=>{const{media:t,mediaSource:e}=this;this.log("Media source opened"),t&&(t.removeEventListener("emptied",this._onMediaEmptied),this.updateMediaElementDuration(),this.hls.trigger(pu.MEDIA_ATTACHED,{media:t,mediaSource:e})),e&&e.removeEventListener("sourceopen",this._onMediaSourceOpen),this.checkPendingTracks()},this._onMediaSourceClose=()=>{this.log("Media source closed")},this._onMediaSourceEnded=()=>{this.log("Media source ended")},this._onMediaEmptied=()=>{const{mediaSrc:t,_objectUrl:e}=this;t!==e&&ku.error(`Media element src was set while attaching MediaSource (${e} > ${t})`)},this.hls=t;const e="[buffer-controller]";var i;this.appendSource=(i=Jf(t.config.preferManagedMediaSource),"undefined"!=typeof self&&i===self.ManagedMediaSource),this.log=ku.log.bind(ku,e),this.warn=ku.warn.bind(ku,e),this.error=ku.error.bind(ku,e),this._initSourceBuffer(),this.registerListeners()}hasSourceTypes(){return this.getSourceBufferTypes().length>0||Object.keys(this.pendingTracks).length>0}destroy(){this.unregisterListeners(),this.details=null,this.lastMpegAudioChunk=null,this.hls=null}registerListeners(){const{hls:t}=this;t.on(pu.MEDIA_ATTACHING,this.onMediaAttaching,this),t.on(pu.MEDIA_DETACHING,this.onMediaDetaching,this),t.on(pu.MANIFEST_LOADING,this.onManifestLoading,this),t.on(pu.MANIFEST_PARSED,this.onManifestParsed,this),t.on(pu.BUFFER_RESET,this.onBufferReset,this),t.on(pu.BUFFER_APPENDING,this.onBufferAppending,this),t.on(pu.BUFFER_CODECS,this.onBufferCodecs,this),t.on(pu.BUFFER_EOS,this.onBufferEos,this),t.on(pu.BUFFER_FLUSHING,this.onBufferFlushing,this),t.on(pu.LEVEL_UPDATED,this.onLevelUpdated,this),t.on(pu.FRAG_PARSED,this.onFragParsed,this),t.on(pu.FRAG_CHANGED,this.onFragChanged,this)}unregisterListeners(){const{hls:t}=this;t.off(pu.MEDIA_ATTACHING,this.onMediaAttaching,this),t.off(pu.MEDIA_DETACHING,this.onMediaDetaching,this),t.off(pu.MANIFEST_LOADING,this.onManifestLoading,this),t.off(pu.MANIFEST_PARSED,this.onManifestParsed,this),t.off(pu.BUFFER_RESET,this.onBufferReset,this),t.off(pu.BUFFER_APPENDING,this.onBufferAppending,this),t.off(pu.BUFFER_CODECS,this.onBufferCodecs,this),t.off(pu.BUFFER_EOS,this.onBufferEos,this),t.off(pu.BUFFER_FLUSHING,this.onBufferFlushing,this),t.off(pu.LEVEL_UPDATED,this.onLevelUpdated,this),t.off(pu.FRAG_PARSED,this.onFragParsed,this),t.off(pu.FRAG_CHANGED,this.onFragChanged,this)}_initSourceBuffer(){this.sourceBuffer={},this.operationQueue=new Ik(this.sourceBuffer),this.listeners={audio:[],video:[],audiovideo:[]},this.appendErrors={audio:0,video:0,audiovideo:0},this.lastMpegAudioChunk=null}onManifestLoading(){this.bufferCodecEventsExpected=this._bufferCodecEventsTotal=0,this.details=null}onManifestParsed(t,e){let i=2;(e.audio&&!e.video||!e.altAudio)&&(i=1),this.bufferCodecEventsExpected=this._bufferCodecEventsTotal=i,this.log(`${this.bufferCodecEventsExpected} bufferCodec event(s) expected`)}onMediaAttaching(t,e){const i=this.media=e.media,r=Jf(this.appendSource);if(i&&r){var a;const t=this.mediaSource=new r;this.log(`created media source: ${null==(a=t.constructor)?void 0:a.name}`),t.addEventListener("sourceopen",this._onMediaSourceOpen),t.addEventListener("sourceended",this._onMediaSourceEnded),t.addEventListener("sourceclose",this._onMediaSourceClose),this.appendSource&&(t.addEventListener("startstreaming",this._onStartStreaming),t.addEventListener("endstreaming",this._onEndStreaming));const e=this._objectUrl=self.URL.createObjectURL(t);if(this.appendSource)try{i.removeAttribute("src");const r=self.ManagedMediaSource;i.disableRemotePlayback=i.disableRemotePlayback||r&&t instanceof r,Uk(i),function(t,e){const i=self.document.createElement("source");i.type="video/mp4",i.src=e,t.appendChild(i)}(i,e),i.load()}catch(t){i.src=e}else i.src=e;i.addEventListener("emptied",this._onMediaEmptied)}}onMediaDetaching(){const{media:t,mediaSource:e,_objectUrl:i}=this;if(e){if(this.log("media source detaching"),"open"===e.readyState)try{e.endOfStream()}catch(t){this.warn(`onMediaDetaching: ${t.message} while calling endOfStream`)}this.onBufferReset(),e.removeEventListener("sourceopen",this._onMediaSourceOpen),e.removeEventListener("sourceended",this._onMediaSourceEnded),e.removeEventListener("sourceclose",this._onMediaSourceClose),this.appendSource&&(e.removeEventListener("startstreaming",this._onStartStreaming),e.removeEventListener("endstreaming",this._onEndStreaming)),t&&(t.removeEventListener("emptied",this._onMediaEmptied),i&&self.URL.revokeObjectURL(i),this.mediaSrc===i?(t.removeAttribute("src"),this.appendSource&&Uk(t),t.load()):this.warn("media|source.src was changed by a third party - skip cleanup")),this.mediaSource=null,this.media=null,this._objectUrl=null,this.bufferCodecEventsExpected=this._bufferCodecEventsTotal,this.pendingTracks={},this.tracks={}}this.hls.trigger(pu.MEDIA_DETACHED,void 0)}onBufferReset(){this.getSourceBufferTypes().forEach((t=>{this.resetBuffer(t)})),this._initSourceBuffer(),this.hls.resumeBuffering()}resetBuffer(t){const e=this.sourceBuffer[t];try{var i;if(e)this.removeBufferListeners(t),this.sourceBuffer[t]=void 0,null!=(i=this.mediaSource)&&i.sourceBuffers.length&&this.mediaSource.removeSourceBuffer(e)}catch(e){this.warn(`onBufferReset ${t}`,e)}}onBufferCodecs(t,e){const i=this.getSourceBufferTypes().length,r=Object.keys(e);if(r.forEach((t=>{if(i){const i=this.tracks[t];if(i&&"function"==typeof i.buffer.changeType){var r;const{id:a,codec:s,levelCodec:n,container:o,metadata:c}=e[t],l=cm(i.codec,i.levelCodec),d=null==l?void 0:l.replace(Ok,"$1");let h=cm(s,n);const p=null==(r=h)?void 0:r.replace(Ok,"$1");if(h&&d!==p){"audio"===t.slice(0,5)&&(h=om(h,this.appendSource));const e=`${o};codecs=${h}`;this.appendChangeType(t,e),this.log(`switching codec ${l} to ${h}`),this.tracks[t]={buffer:i.buffer,codec:s,container:o,levelCodec:n,metadata:c,id:a}}}}else this.pendingTracks[t]=e[t]})),i)return;const a=Math.max(this.bufferCodecEventsExpected-1,0);this.bufferCodecEventsExpected!==a&&(this.log(`${a} bufferCodec event(s) expected ${r.join(",")}`),this.bufferCodecEventsExpected=a),this.mediaSource&&"open"===this.mediaSource.readyState&&this.checkPendingTracks()}appendChangeType(t,e){const{operationQueue:i}=this,r={execute:()=>{const r=this.sourceBuffer[t];r&&(this.log(`changing ${t} sourceBuffer type to ${e}`),r.changeType(e)),i.shiftAndExecuteNext(t)},onStart:()=>{},onComplete:()=>{},onError:e=>{this.warn(`Failed to change ${t} SourceBuffer type`,e)}};i.append(r,t,!!this.pendingTracks[t])}onBufferAppending(t,e){const{hls:i,operationQueue:r,tracks:a}=this,{data:s,type:n,frag:o,part:c,chunkMeta:l}=e,d=l.buffering[n],h=self.performance.now();d.start=h;const p=o.stats.buffering,g=c?c.stats.buffering:null;0===p.start&&(p.start=h),g&&0===g.start&&(g.start=h);const u=a.audio;let f=!1;"audio"===n&&"audio/mpeg"===(null==u?void 0:u.container)&&(f=!this.lastMpegAudioChunk||1===l.id||this.lastMpegAudioChunk.sn!==l.sn,this.lastMpegAudioChunk=l);const m=o.start,v={execute:()=>{if(d.executeStart=self.performance.now(),f){const t=this.sourceBuffer[n];if(t){const e=m-t.timestampOffset;Math.abs(e)>=.1&&(this.log(`Updating audio SourceBuffer timestampOffset to ${m} (delta: ${e}) sn: ${o.sn})`),t.timestampOffset=m)}}this.appendExecutor(s,n)},onStart:()=>{},onComplete:()=>{const t=self.performance.now();d.executeEnd=d.end=t,0===p.first&&(p.first=t),g&&0===g.first&&(g.first=t);const{sourceBuffer:e}=this,i={};for(const t in e)i[t]=Kv.getBuffered(e[t]);this.appendErrors[n]=0,"audio"===n||"video"===n?this.appendErrors.audiovideo=0:(this.appendErrors.audio=0,this.appendErrors.video=0),this.hls.trigger(pu.BUFFER_APPENDED,{type:n,frag:o,part:c,chunkMeta:l,parent:o.type,timeRanges:i})},onError:t=>{const e={type:gu.MEDIA_ERROR,parent:o.type,details:uu.BUFFER_APPEND_ERROR,sourceBufferName:n,frag:o,part:c,chunkMeta:l,error:t,err:t,fatal:!1};if(t.code===DOMException.QUOTA_EXCEEDED_ERR)e.details=uu.BUFFER_FULL_ERROR;else{const t=++this.appendErrors[n];e.details=uu.BUFFER_APPEND_ERROR,this.warn(`Failed ${t}/${i.config.appendErrorMaxRetry} times to append segment in "${n}" sourceBuffer`),t>=i.config.appendErrorMaxRetry&&(e.fatal=!0)}i.trigger(pu.ERROR,e)}};r.append(v,n,!!this.pendingTracks[n])}onBufferFlushing(t,e){const{operationQueue:i}=this,r=t=>({execute:this.removeExecutor.bind(this,t,e.startOffset,e.endOffset),onStart:()=>{},onComplete:()=>{this.hls.trigger(pu.BUFFER_FLUSHED,{type:t})},onError:e=>{this.warn(`Failed to remove from ${t} SourceBuffer`,e)}});e.type?i.append(r(e.type),e.type):this.getSourceBufferTypes().forEach((t=>{i.append(r(t),t)}))}onFragParsed(t,e){const{frag:i,part:r}=e,a=[],s=r?r.elementaryStreams:i.elementaryStreams;s[Lu]?a.push("audiovideo"):(s[Eu]&&a.push("audio"),s[Tu]&&a.push("video"));0===a.length&&this.warn(`Fragments must have at least one ElementaryStreamType set. type: ${i.type} level: ${i.level} sn: ${i.sn}`),this.blockBuffers((()=>{const t=self.performance.now();i.stats.buffering.end=t,r&&(r.stats.buffering.end=t);const e=r?r.stats:i.stats;this.hls.trigger(pu.FRAG_BUFFERED,{frag:i,part:r,stats:e,id:i.type})}),a)}onFragChanged(t,e){this.trimBuffers()}onBufferEos(t,e){this.getSourceBufferTypes().reduce(((t,i)=>{const r=this.sourceBuffer[i];return!r||e.type&&e.type!==i||(r.ending=!0,r.ended||(r.ended=!0,this.log(`${i} sourceBuffer now EOS`))),t&&!(r&&!r.ended)}),!0)&&(this.log("Queueing mediaSource.endOfStream()"),this.blockBuffers((()=>{this.getSourceBufferTypes().forEach((t=>{const e=this.sourceBuffer[t];e&&(e.ending=!1)}));const{mediaSource:t}=this;t&&"open"===t.readyState?(this.log("Calling mediaSource.endOfStream()"),t.endOfStream()):t&&this.log(`Could not call mediaSource.endOfStream(). mediaSource.readyState: ${t.readyState}`)})))}onLevelUpdated(t,{details:e}){e.fragments.length&&(this.details=e,this.getSourceBufferTypes().length?this.blockBuffers(this.updateMediaElementDuration.bind(this)):this.updateMediaElementDuration())}trimBuffers(){const{hls:t,details:e,media:i}=this;if(!i||null===e)return;if(!this.getSourceBufferTypes().length)return;const r=t.config,a=i.currentTime,s=e.levelTargetDuration,n=e.live&&null!==r.liveBackBufferLength?r.liveBackBufferLength:r.backBufferLength;if(lu(n)&&n>0){const t=Math.max(n,s),e=Math.floor(a/s)*s-t;this.flushBackBuffer(a,s,e)}if(lu(r.frontBufferFlushThreshold)&&r.frontBufferFlushThreshold>0){const t=Math.max(r.maxBufferLength,r.frontBufferFlushThreshold),e=Math.max(t,s),i=Math.floor(a/s)*s+e;this.flushFrontBuffer(a,s,i)}}flushBackBuffer(t,e,i){const{details:r,sourceBuffer:a}=this;this.getSourceBufferTypes().forEach((s=>{const n=a[s];if(n){const a=Kv.getBuffered(n);if(a.length>0&&i>a.start(0)){if(this.hls.trigger(pu.BACK_BUFFER_REACHED,{bufferEnd:i}),null!=r&&r.live)this.hls.trigger(pu.LIVE_BACK_BUFFER_REACHED,{bufferEnd:i});else if(n.ended&&a.end(a.length-1)-t<2*e)return void this.log(`Cannot flush ${s} back buffer while SourceBuffer is in ended state`);this.hls.trigger(pu.BUFFER_FLUSHING,{startOffset:0,endOffset:i,type:s})}}}))}flushFrontBuffer(t,e,i){const{sourceBuffer:r}=this;this.getSourceBufferTypes().forEach((a=>{const s=r[a];if(s){const r=Kv.getBuffered(s),n=r.length;if(n<2)return;const o=r.start(n-1),c=r.end(n-1);if(i>o||t>=o&&t<=c)return;if(s.ended&&t-c<2*e)return void this.log(`Cannot flush ${a} front buffer while SourceBuffer is in ended state`);this.hls.trigger(pu.BUFFER_FLUSHING,{startOffset:o,endOffset:1/0,type:a})}}))}updateMediaElementDuration(){if(!this.details||!this.media||!this.mediaSource||"open"!==this.mediaSource.readyState)return;const{details:t,hls:e,media:i,mediaSource:r}=this,a=t.fragments[0].start+t.totalduration,s=i.duration,n=lu(r.duration)?r.duration:0;t.live&&e.config.liveDurationInfinity?(r.duration=1/0,this.updateSeekableRange(t)):(a>n&&a>s||!lu(s))&&(this.log(`Updating Media Source duration to ${a.toFixed(3)}`),r.duration=a)}updateSeekableRange(t){const e=this.mediaSource,i=t.fragments;if(i.length&&t.live&&null!=e&&e.setLiveSeekableRange){const r=Math.max(0,i[0].start),a=Math.max(r,r+t.totalduration);this.log(`Media Source duration is set to ${e.duration}. Setting seekable range to ${r}-${a}.`),e.setLiveSeekableRange(r,a)}}checkPendingTracks(){const{bufferCodecEventsExpected:t,operationQueue:e,pendingTracks:i}=this,r=Object.keys(i).length;if(r&&(!t||2===r||"audiovideo"in i)){this.createSourceBuffers(i),this.pendingTracks={};const t=this.getSourceBufferTypes();if(t.length)this.hls.trigger(pu.BUFFER_CREATED,{tracks:this.tracks}),t.forEach((t=>{e.executeNext(t)}));else{const t=new Error("could not create source buffer for media codec(s)");this.hls.trigger(pu.ERROR,{type:gu.MEDIA_ERROR,details:uu.BUFFER_INCOMPATIBLE_CODECS_ERROR,fatal:!0,error:t,reason:t.message})}}}createSourceBuffers(t){const{sourceBuffer:e,mediaSource:i}=this;if(!i)throw Error("createSourceBuffers called when mediaSource was null");for(const a in t)if(!e[a]){var r;const s=t[a];if(!s)throw Error(`source buffer exists for track ${a}, however track does not`);let n=-1===(null==(r=s.levelCodec)?void 0:r.indexOf(","))?s.levelCodec:s.codec;n&&"audio"===a.slice(0,5)&&(n=om(n,this.appendSource));const o=`${s.container};codecs=${n}`;this.log(`creating sourceBuffer(${o})`);try{const t=e[a]=i.addSourceBuffer(o),r=a;this.addBufferListener(r,"updatestart",this._onSBUpdateStart),this.addBufferListener(r,"updateend",this._onSBUpdateEnd),this.addBufferListener(r,"error",this._onSBUpdateError),this.appendSource&&this.addBufferListener(r,"bufferedchange",((t,e)=>{const i=e.removedRanges;null!=i&&i.length&&this.hls.trigger(pu.BUFFER_FLUSHED,{type:a})})),this.tracks[a]={buffer:t,codec:n,container:s.container,levelCodec:s.levelCodec,metadata:s.metadata,id:s.id}}catch(t){this.error(`error while trying to add sourceBuffer: ${t.message}`),this.hls.trigger(pu.ERROR,{type:gu.MEDIA_ERROR,details:uu.BUFFER_ADD_CODEC_ERROR,fatal:!1,error:t,sourceBufferName:a,mimeType:o})}}}get mediaSrc(){var t,e;const i=(null==(t=this.media)||null==(e=t.querySelector)?void 0:e.call(t,"source"))||this.media;return null==i?void 0:i.src}_onSBUpdateStart(t){const{operationQueue:e}=this;e.current(t).onStart()}_onSBUpdateEnd(t){var e;if("closed"===(null==(e=this.mediaSource)?void 0:e.readyState))return void this.resetBuffer(t);const{operationQueue:i}=this;i.current(t).onComplete(),i.shiftAndExecuteNext(t)}_onSBUpdateError(t,e){var i;const r=new Error(`${t} SourceBuffer error. MediaSource readyState: ${null==(i=this.mediaSource)?void 0:i.readyState}`);this.error(`${r}`,e),this.hls.trigger(pu.ERROR,{type:gu.MEDIA_ERROR,details:uu.BUFFER_APPENDING_ERROR,sourceBufferName:t,error:r,fatal:!1});const a=this.operationQueue.current(t);a&&a.onError(r)}removeExecutor(t,e,i){const{media:r,mediaSource:a,operationQueue:s,sourceBuffer:n}=this,o=n[t];if(!r||!a||!o)return this.warn(`Attempting to remove from the ${t} SourceBuffer, but it does not exist`),void s.shiftAndExecuteNext(t);const c=lu(r.duration)?r.duration:1/0,l=lu(a.duration)?a.duration:1/0,d=Math.max(0,e),h=Math.min(i,c,l);h>d&&(!o.ending||o.ended)?(o.ended=!1,this.log(`Removing [${d},${h}] from the ${t} SourceBuffer`),o.remove(d,h)):s.shiftAndExecuteNext(t)}appendExecutor(t,e){const i=this.sourceBuffer[e];if(i)i.ended=!1,i.appendBuffer(t);else if(!this.pendingTracks[e])throw new Error(`Attempting to append to the ${e} SourceBuffer, but it does not exist`)}blockBuffers(t,e=this.getSourceBufferTypes()){if(!e.length)return this.log("Blocking operation requested, but no SourceBuffers exist"),void Promise.resolve().then(t);const{operationQueue:i}=this,r=e.map((t=>i.appendBlocker(t)));Promise.all(r).then((()=>{t(),e.forEach((t=>{const e=this.sourceBuffer[t];null!=e&&e.updating||i.shiftAndExecuteNext(t)}))}))}getSourceBufferTypes(){return Object.keys(this.sourceBuffer)}addBufferListener(t,e,i){const r=this.sourceBuffer[t];if(!r)return;const a=i.bind(this,t);this.listeners[t].push({event:e,listener:a}),r.addEventListener(e,a)}removeBufferListeners(t){const e=this.sourceBuffer[t];e&&this.listeners[t].forEach((t=>{e.removeEventListener(t.event,t.listener)}))}},capLevelController:Ay,errorController:class{constructor(t){this.hls=void 0,this.playlistError=0,this.penalizedRenditions={},this.log=void 0,this.warn=void 0,this.error=void 0,this.hls=t,this.log=ku.log.bind(ku,"[info]:"),this.warn=ku.warn.bind(ku,"[warning]:"),this.error=ku.error.bind(ku,"[error]:"),this.registerListeners()}registerListeners(){const t=this.hls;t.on(pu.ERROR,this.onError,this),t.on(pu.MANIFEST_LOADING,this.onManifestLoading,this),t.on(pu.LEVEL_UPDATED,this.onLevelUpdated,this)}unregisterListeners(){const t=this.hls;t&&(t.off(pu.ERROR,this.onError,this),t.off(pu.ERROR,this.onErrorOut,this),t.off(pu.MANIFEST_LOADING,this.onManifestLoading,this),t.off(pu.LEVEL_UPDATED,this.onLevelUpdated,this))}destroy(){this.unregisterListeners(),this.hls=null,this.penalizedRenditions={}}startLoad(t){}stopLoad(){this.playlistError=0}getVariantLevelIndex(t){return(null==t?void 0:t.type)===Em?t.level:this.hls.loadLevel}onManifestLoading(){this.playlistError=0,this.penalizedRenditions={}}onLevelUpdated(){this.playlistError=0}onError(t,e){var i,r;if(e.fatal)return;const a=this.hls,s=e.context;switch(e.details){case uu.FRAG_LOAD_ERROR:case uu.FRAG_LOAD_TIMEOUT:case uu.KEY_LOAD_ERROR:case uu.KEY_LOAD_TIMEOUT:return void(e.errorAction=this.getFragRetryOrSwitchAction(e));case uu.FRAG_PARSING_ERROR:if(null!=(i=e.frag)&&i.gap)return void(e.errorAction={action:bv,flags:xv});case uu.FRAG_GAP:case uu.FRAG_DECRYPT_ERROR:return e.errorAction=this.getFragRetryOrSwitchAction(e),void(e.errorAction.action=kv);case uu.LEVEL_EMPTY_ERROR:case uu.LEVEL_PARSING_ERROR:{var n,o;const t=e.parent===Em?e.level:a.loadLevel;e.details===uu.LEVEL_EMPTY_ERROR&&null!=(n=e.context)&&null!=(o=n.levelDetails)&&o.live?e.errorAction=this.getPlaylistRetryOrSwitchAction(e,t):(e.levelRetry=!1,e.errorAction=this.getLevelSwitchAction(e,t))}return;case uu.LEVEL_LOAD_ERROR:case uu.LEVEL_LOAD_TIMEOUT:return void("number"==typeof(null==s?void 0:s.level)&&(e.errorAction=this.getPlaylistRetryOrSwitchAction(e,s.level)));case uu.AUDIO_TRACK_LOAD_ERROR:case uu.AUDIO_TRACK_LOAD_TIMEOUT:case uu.SUBTITLE_LOAD_ERROR:case uu.SUBTITLE_TRACK_LOAD_TIMEOUT:if(s){const t=a.levels[a.loadLevel];if(t&&(s.type===Pm&&t.hasAudioGroup(s.groupId)||s.type===Cm&&t.hasSubtitleGroup(s.groupId)))return e.errorAction=this.getPlaylistRetryOrSwitchAction(e,a.loadLevel),e.errorAction.action=kv,void(e.errorAction.flags=Sv)}return;case uu.KEY_SYSTEM_STATUS_OUTPUT_RESTRICTED:{const t=a.levels[a.loadLevel],i=null==t?void 0:t.attrs["HDCP-LEVEL"];i?e.errorAction={action:kv,flags:Pv,hdcpLevel:i}:this.keySystemError(e)}return;case uu.BUFFER_ADD_CODEC_ERROR:case uu.REMUX_ALLOC_ERROR:case uu.BUFFER_APPEND_ERROR:return void(e.errorAction=this.getLevelSwitchAction(e,null!=(r=e.level)?r:a.loadLevel));case uu.INTERNAL_EXCEPTION:case uu.BUFFER_APPENDING_ERROR:case uu.BUFFER_FULL_ERROR:case uu.LEVEL_SWITCH_ERROR:case uu.BUFFER_STALLED_ERROR:case uu.BUFFER_SEEK_OVER_HOLE:case uu.BUFFER_NUDGE_ON_STALL:return void(e.errorAction={action:bv,flags:xv})}e.type===gu.KEY_SYSTEM_ERROR&&this.keySystemError(e)}keySystemError(t){const e=this.getVariantLevelIndex(t.frag);t.levelRetry=!1,t.errorAction=this.getLevelSwitchAction(t,e)}getPlaylistRetryOrSwitchAction(t,e){const i=dv(this.hls.config.playlistLoadPolicy,t),r=this.playlistError++;if(gv(i,r,lv(t),t.response))return{action:wv,flags:xv,retryConfig:i,retryCount:r};const a=this.getLevelSwitchAction(t,e);return i&&(a.retryConfig=i,a.retryCount=r),a}getFragRetryOrSwitchAction(t){const e=this.hls,i=this.getVariantLevelIndex(t.frag),r=e.levels[i],{fragLoadPolicy:a,keyLoadPolicy:s}=e.config,n=dv(t.details.startsWith("key")?s:a,t),o=e.levels.reduce(((t,e)=>t+e.fragmentError),0);if(r){t.details!==uu.FRAG_GAP&&r.fragmentError++;if(gv(n,o,lv(t),t.response))return{action:wv,flags:xv,retryConfig:n,retryCount:o}}const c=this.getLevelSwitchAction(t,i);return n&&(c.retryConfig=n,c.retryCount=o),c}getLevelSwitchAction(t,e){const i=this.hls;null==e&&(e=i.loadLevel);const r=this.hls.levels[e];if(r){var a,s;const e=t.details;r.loadError++,e===uu.BUFFER_APPEND_ERROR&&r.fragmentError++;let c=-1;const{levels:l,loadLevel:d,minAutoLevel:h,maxAutoLevel:p}=i;i.autoLevelEnabled||(i.loadLevel=-1);const g=null==(a=t.frag)?void 0:a.type,u=(g===Tm&&e===uu.FRAG_PARSING_ERROR||"audio"===t.sourceBufferName&&(e===uu.BUFFER_ADD_CODEC_ERROR||e===uu.BUFFER_APPEND_ERROR))&&l.some((({audioCodec:t})=>r.audioCodec!==t)),f="video"===t.sourceBufferName&&(e===uu.BUFFER_ADD_CODEC_ERROR||e===uu.BUFFER_APPEND_ERROR)&&l.some((({codecSet:t,audioCodec:e})=>r.codecSet!==t&&r.audioCodec===e)),{type:m,groupId:v}=null!=(s=t.context)?s:{};for(let i=l.length;i--;){const a=(i+d)%l.length;if(a!==d&&a>=h&&a<=p&&0===l[a].loadError){var n,o;const i=l[a];if(e===uu.FRAG_GAP&&g===Em&&t.frag){const e=l[a].details;if(e){const i=fv(t.frag,e.fragments,t.frag.start);if(null!=i&&i.gap)continue}}else{if(m===Pm&&i.hasAudioGroup(v)||m===Cm&&i.hasSubtitleGroup(v))continue;if(g===Tm&&null!=(n=r.audioGroups)&&n.some((t=>i.hasAudioGroup(t)))||g===Lm&&null!=(o=r.subtitleGroups)&&o.some((t=>i.hasSubtitleGroup(t)))||u&&r.audioCodec===i.audioCodec||!u&&r.audioCodec!==i.audioCodec||f&&r.codecSet===i.codecSet)continue}c=a;break}}if(c>-1&&i.loadLevel!==c)return t.levelRetry=!0,this.playlistError=0,{action:kv,flags:xv,nextAutoLevel:c}}return{action:kv,flags:Sv}}onErrorOut(t,e){var i;switch(null==(i=e.errorAction)?void 0:i.action){case bv:break;case kv:this.sendAlternateToPenaltyBox(e),e.errorAction.resolved||e.details===uu.FRAG_GAP?/MediaSource readyState: ended/.test(e.error.message)&&(this.warn(`MediaSource ended after "${e.sourceBufferName}" sourceBuffer append error. Attempting to recover from media error.`),this.hls.recoverMediaError()):e.fatal=!0}e.fatal&&this.hls.stopLoad()}sendAlternateToPenaltyBox(t){const e=this.hls,i=t.errorAction;if(!i)return;const{flags:r,hdcpLevel:a,nextAutoLevel:s}=i;switch(r){case xv:this.switchLevel(t,s);break;case Pv:a&&(e.maxHdcpLevel=qm[qm.indexOf(a)-1],i.resolved=!0),this.warn(`Restricting playback to HDCP-LEVEL of "${e.maxHdcpLevel}" or lower`)}i.resolved||this.switchLevel(t,s)}switchLevel(t,e){void 0!==e&&t.errorAction&&(this.warn(`switching to level ${e} after ${t.details}`),this.hls.nextAutoLevel=e,t.errorAction.resolved=!0,this.hls.nextLoadLevel=this.hls.nextAutoLevel)}},fpsController:class{constructor(t){this.hls=void 0,this.isVideoPlaybackQualityAvailable=!1,this.timer=void 0,this.media=null,this.lastTime=void 0,this.lastDroppedFrames=0,this.lastDecodedFrames=0,this.streamController=void 0,this.hls=t,this.registerListeners()}setStreamController(t){this.streamController=t}registerListeners(){this.hls.on(pu.MEDIA_ATTACHING,this.onMediaAttaching,this)}unregisterListeners(){this.hls.off(pu.MEDIA_ATTACHING,this.onMediaAttaching,this)}destroy(){this.timer&&clearInterval(this.timer),this.unregisterListeners(),this.isVideoPlaybackQualityAvailable=!1,this.media=null}onMediaAttaching(t,e){const i=this.hls.config;if(i.capLevelOnFPSDrop){const t=e.media instanceof self.HTMLVideoElement?e.media:null;this.media=t,t&&"function"==typeof t.getVideoPlaybackQuality&&(this.isVideoPlaybackQualityAvailable=!0),self.clearInterval(this.timer),this.timer=self.setInterval(this.checkFPSInterval.bind(this),i.fpsDroppedMonitoringPeriod)}}checkFPS(t,e,i){const r=performance.now();if(e){if(this.lastTime){const t=r-this.lastTime,a=i-this.lastDroppedFrames,s=e-this.lastDecodedFrames,n=1e3*a/t,o=this.hls;if(o.trigger(pu.FPS_DROP,{currentDropped:a,currentDecoded:s,totalDroppedFrames:i}),n>0&&a>o.config.fpsDroppedMonitoringThreshold*s){let t=o.currentLevel;ku.warn("drop FPS ratio greater than max allowed value for currentLevel: "+t),t>0&&(-1===o.autoLevelCapping||o.autoLevelCapping>=t)&&(t-=1,o.trigger(pu.FPS_DROP_LEVEL_CAPPING,{level:t,droppedLevel:o.currentLevel}),o.autoLevelCapping=t,this.streamController.nextLevelSwitch())}}this.lastTime=r,this.lastDroppedFrames=i,this.lastDecodedFrames=e}}checkFPSInterval(){const t=this.media;if(t)if(this.isVideoPlaybackQualityAvailable){const e=t.getVideoPlaybackQuality();this.checkFPS(t,e.totalVideoFrames,e.droppedVideoFrames)}else this.checkFPS(t,t.webkitDecodedFrameCount,t.webkitDroppedFrameCount)}},stretchShortVideoTrack:!1,maxAudioFramesDrift:1,forceKeyFrameOnDiscontinuity:!0,abrEwmaFastLive:3,abrEwmaSlowLive:9,abrEwmaFastVoD:3,abrEwmaSlowVoD:9,abrEwmaDefaultEstimate:5e5,abrEwmaDefaultEstimateMax:5e6,abrBandWidthFactor:.95,abrBandWidthUpFactor:.7,abrMaxWithRealBitrate:!1,maxStarvationDelay:4,maxLoadingDelay:4,minAutoBitrate:0,emeEnabled:!1,widevineLicenseUrl:void 0,drmSystems:{},drmSystemOptions:{},requestMediaKeySystemAccessFunc:Zu,testBandwidth:!0,progressive:!1,lowLatencyMode:!0,cmcd:void 0,enableDateRangeMetadataCues:!0,enableEmsgMetadataCues:!0,enableID3MetadataCues:!0,useMediaCapabilities:!0,certLoadPolicy:{default:{maxTimeToFirstByteMs:8e3,maxLoadTimeMs:2e4,timeoutRetry:null,errorRetry:null}},keyLoadPolicy:{default:{maxTimeToFirstByteMs:8e3,maxLoadTimeMs:2e4,timeoutRetry:{maxNumRetry:1,retryDelayMs:1e3,maxRetryDelayMs:2e4,backoff:"linear"},errorRetry:{maxNumRetry:8,retryDelayMs:1e3,maxRetryDelayMs:2e4,backoff:"linear"}}},manifestLoadPolicy:{default:{maxTimeToFirstByteMs:1/0,maxLoadTimeMs:2e4,timeoutRetry:{maxNumRetry:2,retryDelayMs:0,maxRetryDelayMs:0},errorRetry:{maxNumRetry:1,retryDelayMs:1e3,maxRetryDelayMs:8e3}}},playlistLoadPolicy:{default:{maxTimeToFirstByteMs:1e4,maxLoadTimeMs:2e4,timeoutRetry:{maxNumRetry:2,retryDelayMs:0,maxRetryDelayMs:0},errorRetry:{maxNumRetry:2,retryDelayMs:1e3,maxRetryDelayMs:8e3}}},fragLoadPolicy:{default:{maxTimeToFirstByteMs:1e4,maxLoadTimeMs:12e4,timeoutRetry:{maxNumRetry:4,retryDelayMs:0,maxRetryDelayMs:0},errorRetry:{maxNumRetry:6,retryDelayMs:1e3,maxRetryDelayMs:8e3}}},steeringManifestLoadPolicy:{default:{maxTimeToFirstByteMs:1e4,maxLoadTimeMs:2e4,timeoutRetry:{maxNumRetry:2,retryDelayMs:0,maxRetryDelayMs:0},errorRetry:{maxNumRetry:1,retryDelayMs:1e3,maxRetryDelayMs:8e3}}},manifestLoadingTimeOut:1e4,manifestLoadingMaxRetry:1,manifestLoadingRetryDelay:1e3,manifestLoadingMaxRetryTimeout:64e3,levelLoadingTimeOut:1e4,levelLoadingMaxRetry:4,levelLoadingRetryDelay:1e3,levelLoadingMaxRetryTimeout:64e3,fragLoadingTimeOut:2e4,fragLoadingMaxRetry:6,fragLoadingRetryDelay:1e3,fragLoadingMaxRetryTimeout:64e3},{cueHandler:bw,enableWebVTT:!0,enableIMSC1:!0,enableCEA708Captions:!0,captionsTextTrack1Label:"English",captionsTextTrack1LanguageCode:"en",captionsTextTrack2Label:"Spanish",captionsTextTrack2LanguageCode:"es",captionsTextTrack3Label:"Unknown CC",captionsTextTrack3LanguageCode:"",captionsTextTrack4Label:"Unknown CC",captionsTextTrack4LanguageCode:"",renderTextTracksNatively:!0}),{},{subtitleStreamController:class extends xb{constructor(t,e,i){super(t,e,i,"[subtitle-stream-controller]",Lm),this.currentTrackId=-1,this.tracksBuffered=[],this.mainDetails=null,this._registerListeners()}onHandlerDestroying(){this._unregisterListeners(),super.onHandlerDestroying(),this.mainDetails=null}_registerListeners(){const{hls:t}=this;t.on(pu.MEDIA_ATTACHED,this.onMediaAttached,this),t.on(pu.MEDIA_DETACHING,this.onMediaDetaching,this),t.on(pu.MANIFEST_LOADING,this.onManifestLoading,this),t.on(pu.LEVEL_LOADED,this.onLevelLoaded,this),t.on(pu.ERROR,this.onError,this),t.on(pu.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),t.on(pu.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),t.on(pu.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),t.on(pu.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),t.on(pu.BUFFER_FLUSHING,this.onBufferFlushing,this),t.on(pu.FRAG_BUFFERED,this.onFragBuffered,this)}_unregisterListeners(){const{hls:t}=this;t.off(pu.MEDIA_ATTACHED,this.onMediaAttached,this),t.off(pu.MEDIA_DETACHING,this.onMediaDetaching,this),t.off(pu.MANIFEST_LOADING,this.onManifestLoading,this),t.off(pu.LEVEL_LOADED,this.onLevelLoaded,this),t.off(pu.ERROR,this.onError,this),t.off(pu.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),t.off(pu.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),t.off(pu.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),t.off(pu.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),t.off(pu.BUFFER_FLUSHING,this.onBufferFlushing,this),t.off(pu.FRAG_BUFFERED,this.onFragBuffered,this)}startLoad(t){this.stopLoad(),this.state=hb,this.setInterval(500),this.nextLoadPosition=this.startPosition=this.lastCurrentTime=t,this.tick()}onManifestLoading(){this.mainDetails=null,this.fragmentTracker.removeAllFragments()}onMediaDetaching(){this.tracksBuffered=[],super.onMediaDetaching()}onLevelLoaded(t,e){this.mainDetails=e.details}onSubtitleFragProcessed(t,e){const{frag:i,success:r}=e;if(this.fragPrevious=i,this.state=hb,!r)return;const a=this.tracksBuffered[this.currentTrackId];if(!a)return;let s;const n=i.start;for(let t=0;t<a.length;t++)if(n>=a[t].start&&n<=a[t].end){s=a[t];break}const o=i.start+i.duration;s?s.end=o:(s={start:n,end:o},a.push(s)),this.fragmentTracker.fragBuffered(i),this.fragBufferedComplete(i,null)}onBufferFlushing(t,e){const{startOffset:i,endOffset:r}=e;if(0===i&&r!==Number.POSITIVE_INFINITY){const t=r-1;if(t<=0)return;e.endOffsetSubtitles=Math.max(0,t),this.tracksBuffered.forEach((e=>{for(let i=0;i<e.length;)if(e[i].end<=t)e.shift();else{if(!(e[i].start<t))break;e[i].start=t,i++}})),this.fragmentTracker.removeFragmentsInRange(i,t,Lm)}}onFragBuffered(t,e){var i;this.loadedmetadata||e.frag.type!==Em||null!=(i=this.media)&&i.buffered.length&&(this.loadedmetadata=!0)}onError(t,e){const i=e.frag;(null==i?void 0:i.type)===Lm&&(e.details===uu.FRAG_GAP&&this.fragmentTracker.fragBuffered(i,!0),this.fragCurrent&&this.fragCurrent.abortRequests(),this.state!==db&&(this.state=hb))}onSubtitleTracksUpdated(t,{subtitleTracks:e}){this.levels&&Rk(this.levels,e)?this.levels=e.map((t=>new Xm(t))):(this.tracksBuffered=[],this.levels=e.map((t=>{const e=new Xm(t);return this.tracksBuffered[e.id]=[],e})),this.fragmentTracker.removeFragmentsInRange(0,Number.POSITIVE_INFINITY,Lm),this.fragPrevious=null,this.mediaBuffer=null)}onSubtitleTrackSwitch(t,e){var i;if(this.currentTrackId=e.id,null==(i=this.levels)||!i.length||-1===this.currentTrackId)return void this.clearInterval();const r=this.levels[this.currentTrackId];null!=r&&r.details?this.mediaBuffer=this.mediaBufferTimeRanges:this.mediaBuffer=null,r&&this.setInterval(500)}onSubtitleTrackLoaded(t,e){var i;const{currentTrackId:r,levels:a}=this,{details:s,id:n}=e;if(!a)return void this.warn(`Subtitle tracks were reset while loading level ${n}`);const o=a[n];if(n>=a.length||!o)return;this.log(`Subtitle track ${n} loaded [${s.startSN},${s.endSN}]${s.lastPartSn?`[part-${s.lastPartSn}-${s.lastPartIndex}]`:""},duration:${s.totalduration}`),this.mediaBuffer=this.mediaBufferTimeRanges;let c=0;if(s.live||null!=(i=o.details)&&i.live){const t=this.mainDetails;if(s.deltaUpdateFailed||!t)return;const e=t.fragments[0];var l;if(o.details)c=this.alignPlaylists(s,o.details,null==(l=this.levelLastLoaded)?void 0:l.details),0===c&&e&&(c=e.start,sv(s,c));else s.hasProgramDateTime&&t.hasProgramDateTime?(Xv(s,t),c=s.fragments[0].start):e&&(c=e.start,sv(s,c))}if(o.details=s,this.levelLastLoaded=o,n===r&&(this.startFragRequested||!this.mainDetails&&s.live||this.setStartPosition(this.mainDetails||s,c),this.tick(),s.live&&!this.fragCurrent&&this.media&&this.state===hb)){fv(null,s.fragments,this.media.currentTime,0)||(this.warn("Subtitle playlist not aligned with playback"),o.details=void 0)}}_handleFragmentLoadComplete(t){const{frag:e,payload:i}=t,r=e.decryptdata,a=this.hls;if(!this.fragContextChanged(e)&&i&&i.byteLength>0&&null!=r&&r.key&&r.iv&&"AES-128"===r.method){const t=performance.now();this.decrypter.decrypt(new Uint8Array(i),r.key.buffer,r.iv.buffer).catch((t=>{throw a.trigger(pu.ERROR,{type:gu.MEDIA_ERROR,details:uu.FRAG_DECRYPT_ERROR,fatal:!1,error:t,reason:t.message,frag:e}),t})).then((i=>{const r=performance.now();a.trigger(pu.FRAG_DECRYPTED,{frag:e,payload:i,stats:{tstart:t,tdecrypt:r}})})).catch((t=>{this.warn(`${t.name}: ${t.message}`),this.state=hb}))}}doTick(){if(this.media){if(this.state===hb){const{currentTrackId:t,levels:e}=this,i=null==e?void 0:e[t];if(!i||!e.length||!i.details)return;const{config:r}=this,a=this.getLoadPosition(),s=Kv.bufferedInfo(this.tracksBuffered[this.currentTrackId]||[],a,r.maxBufferHole),{end:n,len:o}=s,c=this.getFwdBufferInfo(this.media,Em),l=i.details;if(o>this.getMaxBufferLength(null==c?void 0:c.len)+l.levelTargetDuration)return;const d=l.fragments,h=d.length,p=l.edge;let g=null;const u=this.fragPrevious;if(n<p){const t=r.maxFragLookUpTolerance,e=n>p-t?0:t;g=fv(u,d,Math.max(d[0].start,n),e),!g&&u&&u.start<d[0].start&&(g=d[0])}else g=d[h-1];if(!g)return;if(g=this.mapToInitFragWhenRequired(g),"initSegment"!==g.sn){const t=d[g.sn-l.startSN-1];t&&t.cc===g.cc&&this.fragmentTracker.getState(t)===jv&&(g=t)}this.fragmentTracker.getState(g)===jv&&this.loadFragment(g,i,n)}}else this.state=hb}getMaxBufferLength(t){const e=super.getMaxBufferLength();return t?Math.max(e,t):e}loadFragment(t,e,i){this.fragCurrent=t,"initSegment"===t.sn?this._loadInitSegment(t,e):(this.startFragRequested=!0,super.loadFragment(t,e,i))}get mediaBufferTimeRanges(){return new Mk(this.tracksBuffered[this.currentTrackId]||[])}},subtitleTrackController:class extends Cv{constructor(t){super(t,"[subtitle-track-controller]"),this.media=null,this.tracks=[],this.groupIds=null,this.tracksInGroup=[],this.trackId=-1,this.currentTrack=null,this.selectDefaultTrack=!0,this.queuedDefaultTrack=-1,this.asyncPollTrackChange=()=>this.pollTrackChange(0),this.useTextTrackPolling=!1,this.subtitlePollingInterval=-1,this._subtitleDisplay=!0,this.onTextTracksChanged=()=>{if(this.useTextTrackPolling||self.clearInterval(this.subtitlePollingInterval),!this.media||!this.hls.config.renderTextTracksNatively)return;let t=null;const e=Um(this.media.textTracks);for(let i=0;i<e.length;i++)if("hidden"===e[i].mode)t=e[i];else if("showing"===e[i].mode){t=e[i];break}const i=this.findTrackForTextTrack(t);this.subtitleTrack!==i&&this.setSubtitleTrack(i)},this.registerListeners()}destroy(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,this.currentTrack=null,this.onTextTracksChanged=this.asyncPollTrackChange=null,super.destroy()}get subtitleDisplay(){return this._subtitleDisplay}set subtitleDisplay(t){this._subtitleDisplay=t,this.trackId>-1&&this.toggleTrackModes()}registerListeners(){const{hls:t}=this;t.on(pu.MEDIA_ATTACHED,this.onMediaAttached,this),t.on(pu.MEDIA_DETACHING,this.onMediaDetaching,this),t.on(pu.MANIFEST_LOADING,this.onManifestLoading,this),t.on(pu.MANIFEST_PARSED,this.onManifestParsed,this),t.on(pu.LEVEL_LOADING,this.onLevelLoading,this),t.on(pu.LEVEL_SWITCHING,this.onLevelSwitching,this),t.on(pu.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),t.on(pu.ERROR,this.onError,this)}unregisterListeners(){const{hls:t}=this;t.off(pu.MEDIA_ATTACHED,this.onMediaAttached,this),t.off(pu.MEDIA_DETACHING,this.onMediaDetaching,this),t.off(pu.MANIFEST_LOADING,this.onManifestLoading,this),t.off(pu.MANIFEST_PARSED,this.onManifestParsed,this),t.off(pu.LEVEL_LOADING,this.onLevelLoading,this),t.off(pu.LEVEL_SWITCHING,this.onLevelSwitching,this),t.off(pu.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),t.off(pu.ERROR,this.onError,this)}onMediaAttached(t,e){this.media=e.media,this.media&&(this.queuedDefaultTrack>-1&&(this.subtitleTrack=this.queuedDefaultTrack,this.queuedDefaultTrack=-1),this.useTextTrackPolling=!(this.media.textTracks&&"onchange"in this.media.textTracks),this.useTextTrackPolling?this.pollTrackChange(500):this.media.textTracks.addEventListener("change",this.asyncPollTrackChange))}pollTrackChange(t){self.clearInterval(this.subtitlePollingInterval),this.subtitlePollingInterval=self.setInterval(this.onTextTracksChanged,t)}onMediaDetaching(){if(!this.media)return;self.clearInterval(this.subtitlePollingInterval),this.useTextTrackPolling||this.media.textTracks.removeEventListener("change",this.asyncPollTrackChange),this.trackId>-1&&(this.queuedDefaultTrack=this.trackId);Um(this.media.textTracks).forEach((t=>{Im(t)})),this.subtitleTrack=-1,this.media=null}onManifestLoading(){this.tracks=[],this.groupIds=null,this.tracksInGroup=[],this.trackId=-1,this.currentTrack=null,this.selectDefaultTrack=!0}onManifestParsed(t,e){this.tracks=e.subtitleTracks}onSubtitleTrackLoaded(t,e){const{id:i,groupId:r,details:a}=e,s=this.tracksInGroup[i];if(!s||s.groupId!==r)return void this.warn(`Subtitle track with id:${i} and group:${r} not found in active group ${null==s?void 0:s.groupId}`);const n=s.details;s.details=e.details,this.log(`Subtitle track ${i} "${s.name}" lang:${s.lang} group:${r} loaded [${a.startSN}-${a.endSN}]`),i===this.trackId&&this.playlistLoaded(i,e,n)}onLevelLoading(t,e){this.switchLevel(e.level)}onLevelSwitching(t,e){this.switchLevel(e.level)}switchLevel(t){const e=this.hls.levels[t];if(!e)return;const i=e.subtitleGroups||null,r=this.groupIds;let a=this.currentTrack;if(!i||(null==r?void 0:r.length)!==(null==i?void 0:i.length)||null!=i&&i.some((t=>-1===(null==r?void 0:r.indexOf(t))))){this.groupIds=i,this.trackId=-1,this.currentTrack=null;const t=this.tracks.filter((t=>!i||-1!==i.indexOf(t.groupId)));if(t.length)this.selectDefaultTrack&&!t.some((t=>t.default))&&(this.selectDefaultTrack=!1),t.forEach(((t,e)=>{t.id=e}));else if(!a&&!this.tracksInGroup.length)return;this.tracksInGroup=t;const e=this.hls.config.subtitlePreference;if(!a&&e){this.selectDefaultTrack=!1;const i=Iv(e,t);if(i>-1)a=t[i];else{const t=Iv(e,this.tracks);a=this.tracks[t]}}let r=this.findTrackId(a);-1===r&&a&&(r=this.findTrackId(null));const s={subtitleTracks:t};this.log(`Updating subtitle tracks, ${t.length} track(s) found in "${null==i?void 0:i.join(",")}" group-id`),this.hls.trigger(pu.SUBTITLE_TRACKS_UPDATED,s),-1!==r&&-1===this.trackId&&this.setSubtitleTrack(r)}else this.shouldReloadPlaylist(a)&&this.setSubtitleTrack(this.trackId)}findTrackId(t){const e=this.tracksInGroup,i=this.selectDefaultTrack;for(let r=0;r<e.length;r++){const a=e[r];if((!i||a.default)&&(i||t)&&(!t||Ov(a,t)))return r}if(t){for(let i=0;i<e.length;i++){const r=e[i];if(Ak(t.attrs,r.attrs,["LANGUAGE","ASSOC-LANGUAGE","CHARACTERISTICS"]))return i}for(let i=0;i<e.length;i++){const r=e[i];if(Ak(t.attrs,r.attrs,["LANGUAGE"]))return i}}return-1}findTrackForTextTrack(t){if(t){const e=this.tracksInGroup;for(let i=0;i<e.length;i++){if(Dk(e[i],t))return i}}return-1}onError(t,e){!e.fatal&&e.context&&(e.context.type!==Cm||e.context.id!==this.trackId||this.groupIds&&-1===this.groupIds.indexOf(e.context.groupId)||this.checkRetry(e))}get allSubtitleTracks(){return this.tracks}get subtitleTracks(){return this.tracksInGroup}get subtitleTrack(){return this.trackId}set subtitleTrack(t){this.selectDefaultTrack=!1,this.setSubtitleTrack(t)}setSubtitleOption(t){if(this.hls.config.subtitlePreference=t,t){const e=this.allSubtitleTracks;if(this.selectDefaultTrack=!1,e.length){const i=this.currentTrack;if(i&&Ov(t,i))return i;const r=Iv(t,this.tracksInGroup);if(r>-1){const t=this.tracksInGroup[r];return this.setSubtitleTrack(r),t}if(i)return null;{const i=Iv(t,e);if(i>-1)return e[i]}}}return null}loadPlaylist(t){super.loadPlaylist();const e=this.currentTrack;if(this.shouldLoadPlaylist(e)&&e){const i=e.id,r=e.groupId;let a=e.url;if(t)try{a=t.addDirectives(a)}catch(t){this.warn(`Could not construct new URL with HLS Delivery Directives: ${t}`)}this.log(`Loading subtitle playlist for id ${i}`),this.hls.trigger(pu.SUBTITLE_TRACK_LOADING,{url:a,id:i,groupId:r,deliveryDirectives:t||null})}}toggleTrackModes(){const{media:t}=this;if(!t)return;const e=Um(t.textTracks),i=this.currentTrack;let r;if(i&&(r=e.filter((t=>Dk(i,t)))[0],r||this.warn(`Unable to find subtitle TextTrack with name "${i.name}" and language "${i.lang}"`)),[].slice.call(e).forEach((t=>{"disabled"!==t.mode&&t!==r&&(t.mode="disabled")})),r){const t=this.subtitleDisplay?"showing":"hidden";r.mode!==t&&(r.mode=t)}}setSubtitleTrack(t){const e=this.tracksInGroup;if(!this.media)return void(this.queuedDefaultTrack=t);if(t<-1||t>=e.length||!lu(t))return void this.warn(`Invalid subtitle track id: ${t}`);this.clearTimer(),this.selectDefaultTrack=!1;const i=this.currentTrack,r=e[t]||null;if(this.trackId=t,this.currentTrack=r,this.toggleTrackModes(),!r)return void this.hls.trigger(pu.SUBTITLE_TRACK_SWITCH,{id:t});const a=!!r.details&&!r.details.live;if(t===this.trackId&&r===i&&a)return;this.log(`Switching to subtitle-track ${t}`+(r?` "${r.name}" lang:${r.lang} group:${r.groupId}`:""));const{id:s,groupId:n="",name:o,type:c,url:l}=r;this.hls.trigger(pu.SUBTITLE_TRACK_SWITCH,{id:s,groupId:n,name:o,type:c,url:l});const d=this.switchParams(r.url,null==i?void 0:i.details,r.details);this.loadPlaylist(d)}},timelineController:class{constructor(t){this.hls=void 0,this.media=null,this.config=void 0,this.enabled=!0,this.Cues=void 0,this.textTracks=[],this.tracks=[],this.initPTS=[],this.unparsedVttFrags=[],this.captionsTracks={},this.nonNativeCaptionsTracks={},this.cea608Parser1=void 0,this.cea608Parser2=void 0,this.lastCc=-1,this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs={ccOffset:0,presentationOffset:0,0:{start:0,prevCC:-1,new:!0}},this.captionsProperties=void 0,this.hls=t,this.config=t.config,this.Cues=t.config.cueHandler,this.captionsProperties={textTrack1:{label:this.config.captionsTextTrack1Label,languageCode:this.config.captionsTextTrack1LanguageCode},textTrack2:{label:this.config.captionsTextTrack2Label,languageCode:this.config.captionsTextTrack2LanguageCode},textTrack3:{label:this.config.captionsTextTrack3Label,languageCode:this.config.captionsTextTrack3LanguageCode},textTrack4:{label:this.config.captionsTextTrack4Label,languageCode:this.config.captionsTextTrack4LanguageCode}},t.on(pu.MEDIA_ATTACHING,this.onMediaAttaching,this),t.on(pu.MEDIA_DETACHING,this.onMediaDetaching,this),t.on(pu.MANIFEST_LOADING,this.onManifestLoading,this),t.on(pu.MANIFEST_LOADED,this.onManifestLoaded,this),t.on(pu.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),t.on(pu.FRAG_LOADING,this.onFragLoading,this),t.on(pu.FRAG_LOADED,this.onFragLoaded,this),t.on(pu.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),t.on(pu.FRAG_DECRYPTED,this.onFragDecrypted,this),t.on(pu.INIT_PTS_FOUND,this.onInitPtsFound,this),t.on(pu.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),t.on(pu.BUFFER_FLUSHING,this.onBufferFlushing,this)}destroy(){const{hls:t}=this;t.off(pu.MEDIA_ATTACHING,this.onMediaAttaching,this),t.off(pu.MEDIA_DETACHING,this.onMediaDetaching,this),t.off(pu.MANIFEST_LOADING,this.onManifestLoading,this),t.off(pu.MANIFEST_LOADED,this.onManifestLoaded,this),t.off(pu.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),t.off(pu.FRAG_LOADING,this.onFragLoading,this),t.off(pu.FRAG_LOADED,this.onFragLoaded,this),t.off(pu.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),t.off(pu.FRAG_DECRYPTED,this.onFragDecrypted,this),t.off(pu.INIT_PTS_FOUND,this.onInitPtsFound,this),t.off(pu.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),t.off(pu.BUFFER_FLUSHING,this.onBufferFlushing,this),this.hls=this.config=null,this.cea608Parser1=this.cea608Parser2=void 0}initCea608Parsers(){if(this.config.enableCEA708Captions&&(!this.cea608Parser1||!this.cea608Parser2)){const t=new iy(this,"textTrack1"),e=new iy(this,"textTrack2"),i=new iy(this,"textTrack3"),r=new iy(this,"textTrack4");this.cea608Parser1=new Xk(1,t,e),this.cea608Parser2=new Xk(3,i,r)}}addCues(t,e,i,r,a){let s=!1;for(let t=a.length;t--;){const r=a[t],d=(n=r[0],o=r[1],c=e,l=i,Math.min(o,l)-Math.max(n,c));if(d>=0&&(r[0]=Math.min(r[0],e),r[1]=Math.max(r[1],i),s=!0,d/(i-e)>.5))return}var n,o,c,l;if(s||a.push([e,i]),this.config.renderTextTracksNatively){const a=this.captionsTracks[t];this.Cues.newCue(a,e,i,r)}else{const a=this.Cues.newCue(null,e,i,r);this.hls.trigger(pu.CUES_PARSED,{type:"captions",cues:a,track:t})}}onInitPtsFound(t,{frag:e,id:i,initPTS:r,timescale:a}){const{unparsedVttFrags:s}=this;"main"===i&&(this.initPTS[e.cc]={baseTime:r,timescale:a}),s.length&&(this.unparsedVttFrags=[],s.forEach((t=>{this.onFragLoaded(pu.FRAG_LOADED,t)})))}getExistingTrack(t,e){const{media:i}=this;if(i)for(let r=0;r<i.textTracks.length;r++){const a=i.textTracks[r];if(Ry(a,{name:t,lang:e}))return a}return null}createCaptionsTrack(t){this.config.renderTextTracksNatively?this.createNativeTrack(t):this.createNonNativeTrack(t)}createNativeTrack(t){if(this.captionsTracks[t])return;const{captionsProperties:e,captionsTracks:i,media:r}=this,{label:a,languageCode:s}=e[t],n=this.getExistingTrack(a,s);if(n)i[t]=n,Im(i[t]),Dm(i[t],r);else{const e=this.createTextTrack("captions",a,s);e&&(e[t]=!0,i[t]=e)}}createNonNativeTrack(t){if(this.nonNativeCaptionsTracks[t])return;const e=this.captionsProperties[t];if(!e)return;const i={_id:t,label:e.label,kind:"captions",default:!!e.media&&!!e.media.default,closedCaptions:e.media};this.nonNativeCaptionsTracks[t]=i,this.hls.trigger(pu.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:[i]})}createTextTrack(t,e,i){const r=this.media;if(r)return r.addTextTrack(t,e,i)}onMediaAttaching(t,e){this.media=e.media,this._cleanTracks()}onMediaDetaching(){const{captionsTracks:t}=this;Object.keys(t).forEach((e=>{Im(t[e]),delete t[e]})),this.nonNativeCaptionsTracks={}}onManifestLoading(){this.lastCc=-1,this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs={ccOffset:0,presentationOffset:0,0:{start:0,prevCC:-1,new:!0}},this._cleanTracks(),this.tracks=[],this.captionsTracks={},this.nonNativeCaptionsTracks={},this.textTracks=[],this.unparsedVttFrags=[],this.initPTS=[],this.cea608Parser1&&this.cea608Parser2&&(this.cea608Parser1.reset(),this.cea608Parser2.reset())}_cleanTracks(){const{media:t}=this;if(!t)return;const e=t.textTracks;if(e)for(let t=0;t<e.length;t++)Im(e[t])}onSubtitleTracksUpdated(t,e){const i=e.subtitleTracks||[],r=i.some((t=>t.textCodec===by));if(this.config.enableWebVTT||r&&this.config.enableIMSC1){if(Rk(this.tracks,i))return void(this.tracks=i);if(this.textTracks=[],this.tracks=i,this.config.renderTextTracksNatively){const t=this.media,e=t?Um(t.textTracks):null;if(this.tracks.forEach(((t,i)=>{let r;if(e){let i=null;for(let r=0;r<e.length;r++)if(e[r]&&Ry(e[r],t)){i=e[r],e[r]=null;break}i&&(r=i)}if(r)Im(r);else{const e=_y(t);r=this.createTextTrack(e,t.name,t.lang),r&&(r.mode="disabled")}r&&this.textTracks.push(r)})),null!=e&&e.length){const t=e.filter((t=>null!==t)).map((t=>t.label));t.length&&ku.warn(`Media element contains unused subtitle tracks: ${t.join(", ")}. Replace media element for each source to clear TextTracks and captions menu.`)}}else if(this.tracks.length){const t=this.tracks.map((t=>({label:t.name,kind:t.type.toLowerCase(),default:t.default,subtitleTrack:t})));this.hls.trigger(pu.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:t})}}}onManifestLoaded(t,e){this.config.enableCEA708Captions&&e.captions&&e.captions.forEach((t=>{const e=/(?:CC|SERVICE)([1-4])/.exec(t.instreamId);if(!e)return;const i=`textTrack${e[1]}`,r=this.captionsProperties[i];r&&(r.label=t.name,t.lang&&(r.languageCode=t.lang),r.media=t)}))}closedCaptionsForLevel(t){const e=this.hls.levels[t.level];return null==e?void 0:e.attrs["CLOSED-CAPTIONS"]}onFragLoading(t,e){if(this.enabled&&e.frag.type===Em){var i,r;const{cea608Parser1:t,cea608Parser2:a,lastSn:s}=this,{cc:n,sn:o}=e.frag,c=null!=(i=null==(r=e.part)?void 0:r.index)?i:-1;t&&a&&(o!==s+1||o===s&&c!==this.lastPartIndex+1||n!==this.lastCc)&&(t.reset(),a.reset()),this.lastCc=n,this.lastSn=o,this.lastPartIndex=c}}onFragLoaded(t,e){const{frag:i,payload:r}=e;if(i.type===Lm)if(r.byteLength){const t=i.decryptdata,a="stats"in e;if(null==t||!t.encrypted||a){const t=this.tracks[i.level],a=this.vttCCs;a[i.cc]||(a[i.cc]={start:i.start,prevCC:this.prevCC,new:!0},this.prevCC=i.cc),t&&t.textCodec===by?this._parseIMSC1(i,r):this._parseVTTs(e)}}else this.hls.trigger(pu.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:i,error:new Error("Empty subtitle payload")})}_parseIMSC1(t,e){const i=this.hls;xy(e,this.initPTS[t.cc],(e=>{this._appendCues(e,t.level),i.trigger(pu.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:t})}),(e=>{ku.log(`Failed to parse IMSC1: ${e}`),i.trigger(pu.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:t,error:e})}))}_parseVTTs(t){var e;const{frag:i,payload:r}=t,{initPTS:a,unparsedVttFrags:s}=this,n=a.length-1;if(!a[i.cc]&&-1===n)return void s.push(t);const o=this.hls;vy(null!=(e=i.initSegment)&&e.data?$f(i.initSegment.data,new Uint8Array(r)):r,this.initPTS[i.cc],this.vttCCs,i.cc,i.start,(t=>{this._appendCues(t,i.level),o.trigger(pu.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:i})}),(e=>{const a="Missing initPTS for VTT MPEGTS"===e.message;a?s.push(t):this._fallbackToIMSC1(i,r),ku.log(`Failed to parse VTT cue: ${e}`),a&&n>i.cc||o.trigger(pu.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:i,error:e})}))}_fallbackToIMSC1(t,e){const i=this.tracks[t.level];i.textCodec||xy(e,this.initPTS[t.cc],(()=>{i.textCodec=by,this._parseIMSC1(t,e)}),(()=>{i.textCodec="wvtt"}))}_appendCues(t,e){const i=this.hls;if(this.config.renderTextTracksNatively){const i=this.textTracks[e];if(!i||"disabled"===i.mode)return;t.forEach((t=>Mm(i,t)))}else{const r=this.tracks[e];if(!r)return;const a=r.default?"default":"subtitles"+e;i.trigger(pu.CUES_PARSED,{type:"subtitles",cues:t,track:a})}}onFragDecrypted(t,e){const{frag:i}=e;i.type===Lm&&this.onFragLoaded(pu.FRAG_LOADED,e)}onSubtitleTracksCleared(){this.tracks=[],this.captionsTracks={}}onFragParsingUserdata(t,e){this.initCea608Parsers();const{cea608Parser1:i,cea608Parser2:r}=this;if(!this.enabled||!i||!r)return;const{frag:a,samples:s}=e;if(a.type!==Em||"NONE"!==this.closedCaptionsForLevel(a))for(let t=0;t<s.length;t++){const e=s[t].bytes;if(e){const a=this.extractCea608Data(e);i.addData(s[t].pts,a[0]),r.addData(s[t].pts,a[1])}}}onBufferFlushing(t,{startOffset:e,endOffset:i,endOffsetSubtitles:r,type:a}){const{media:s}=this;if(s&&!(s.currentTime<i)){if(!a||"video"===a){const{captionsTracks:t}=this;Object.keys(t).forEach((r=>Om(t[r],e,i)))}if(this.config.renderTextTracksNatively&&0===e&&void 0!==r){const{textTracks:t}=this;Object.keys(t).forEach((i=>Om(t[i],e,r)))}}}extractCea608Data(t){const e=[[],[]],i=31&t[0];let r=2;for(let a=0;a<i;a++){const i=t[r++],a=127&t[r++],s=127&t[r++];if(0===a&&0===s)continue;if(!!(4&i)){const t=3&i;0!==t&&1!==t||(e[t].push(a),e[t].push(s))}}return e}},audioStreamController:class extends xb{constructor(t,e,i){super(t,e,i,"[audio-stream-controller]",Tm),this.videoBuffer=null,this.videoTrackCC=-1,this.waitingVideoCC=-1,this.bufferedTrack=null,this.switchingTrack=null,this.trackId=-1,this.waitingData=null,this.mainDetails=null,this.flushing=!1,this.bufferFlushed=!1,this.cachedTrackLoadedData=null,this._registerListeners()}onHandlerDestroying(){this._unregisterListeners(),super.onHandlerDestroying(),this.mainDetails=null,this.bufferedTrack=null,this.switchingTrack=null}_registerListeners(){const{hls:t}=this;t.on(pu.MEDIA_ATTACHED,this.onMediaAttached,this),t.on(pu.MEDIA_DETACHING,this.onMediaDetaching,this),t.on(pu.MANIFEST_LOADING,this.onManifestLoading,this),t.on(pu.LEVEL_LOADED,this.onLevelLoaded,this),t.on(pu.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),t.on(pu.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),t.on(pu.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),t.on(pu.ERROR,this.onError,this),t.on(pu.BUFFER_RESET,this.onBufferReset,this),t.on(pu.BUFFER_CREATED,this.onBufferCreated,this),t.on(pu.BUFFER_FLUSHING,this.onBufferFlushing,this),t.on(pu.BUFFER_FLUSHED,this.onBufferFlushed,this),t.on(pu.INIT_PTS_FOUND,this.onInitPtsFound,this),t.on(pu.FRAG_BUFFERED,this.onFragBuffered,this)}_unregisterListeners(){const{hls:t}=this;t.off(pu.MEDIA_ATTACHED,this.onMediaAttached,this),t.off(pu.MEDIA_DETACHING,this.onMediaDetaching,this),t.off(pu.MANIFEST_LOADING,this.onManifestLoading,this),t.off(pu.LEVEL_LOADED,this.onLevelLoaded,this),t.off(pu.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),t.off(pu.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),t.off(pu.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),t.off(pu.ERROR,this.onError,this),t.off(pu.BUFFER_RESET,this.onBufferReset,this),t.off(pu.BUFFER_CREATED,this.onBufferCreated,this),t.off(pu.BUFFER_FLUSHING,this.onBufferFlushing,this),t.off(pu.BUFFER_FLUSHED,this.onBufferFlushed,this),t.off(pu.INIT_PTS_FOUND,this.onInitPtsFound,this),t.off(pu.FRAG_BUFFERED,this.onFragBuffered,this)}onInitPtsFound(t,{frag:e,id:i,initPTS:r,timescale:a}){if("main"===i){const t=e.cc;this.initPTS[e.cc]={baseTime:r,timescale:a},this.log(`InitPTS for cc: ${t} found from main: ${r}`),this.videoTrackCC=t,this.state===yb&&this.tick()}}startLoad(t){if(!this.levels)return this.startPosition=t,void(this.state=db);const e=this.lastCurrentTime;this.stopLoad(),this.setInterval(100),e>0&&-1===t?(this.log(`Override startPosition with lastCurrentTime @${e.toFixed(3)}`),t=e,this.state=hb):(this.loadedmetadata=!1,this.state=fb),this.nextLoadPosition=this.startPosition=this.lastCurrentTime=t,this.tick()}doTick(){switch(this.state){case hb:this.doTickIdle();break;case fb:{var t;const{levels:e,trackId:i}=this,r=null==e||null==(t=e[i])?void 0:t.details;if(r){if(this.waitForCdnTuneIn(r))break;this.state=yb}break}case ub:{var e;const t=performance.now(),i=this.retryDate;if(!i||t>=i||null!=(e=this.media)&&e.seeking){const{levels:t,trackId:e}=this;this.log("RetryDate reached, switch back to IDLE state"),this.resetStartWhenNotLoaded((null==t?void 0:t[e])||null),this.state=hb}break}case yb:{const t=this.waitingData;if(t){const{frag:e,part:i,cache:r,complete:a}=t;if(void 0!==this.initPTS[e.cc]){this.waitingData=null,this.waitingVideoCC=-1,this.state=gb;const t={frag:e,part:i,payload:r.flush(),networkDetails:null};this._handleFragmentLoadProgress(t),a&&super._handleFragmentLoadComplete(t)}else if(this.videoTrackCC!==this.waitingVideoCC)this.log(`Waiting fragment cc (${e.cc}) cancelled because video is at cc ${this.videoTrackCC}`),this.clearWaitingFragment();else{const t=this.getLoadPosition(),i=Kv.bufferInfo(this.mediaBuffer,t,this.config.maxBufferHole);mv(i.end,this.config.maxFragLookUpTolerance,e)<0&&(this.log(`Waiting fragment cc (${e.cc}) @ ${e.start} cancelled because another fragment at ${i.end} is needed`),this.clearWaitingFragment())}}else this.state=hb}}this.onTickEnd()}clearWaitingFragment(){const t=this.waitingData;t&&(this.fragmentTracker.removeFragment(t.frag),this.waitingData=null,this.waitingVideoCC=-1,this.state=hb)}resetLoadingState(){this.clearWaitingFragment(),super.resetLoadingState()}onTickEnd(){const{media:t}=this;null!=t&&t.readyState&&(this.lastCurrentTime=t.currentTime)}doTickIdle(){const{hls:t,levels:e,media:i,trackId:r}=this,a=t.config;if(!this.buffering||!i&&(this.startFragRequested||!a.startFragPrefetch)||null==e||!e[r])return;const s=e[r],n=s.details;if(!n||n.live&&this.levelLastLoaded!==s||this.waitForCdnTuneIn(n))return void(this.state=fb);const o=this.mediaBuffer?this.mediaBuffer:this.media;this.bufferFlushed&&o&&(this.bufferFlushed=!1,this.afterBufferFlushed(o,Eu,Tm));const c=this.getFwdBufferInfo(o,Tm);if(null===c)return;if(!this.switchingTrack&&this._streamEnded(c,n))return t.trigger(pu.BUFFER_EOS,{type:"audio"}),void(this.state=bb);const l=this.getFwdBufferInfo(this.videoBuffer?this.videoBuffer:this.media,Em),d=c.len,h=this.getMaxBufferLength(null==l?void 0:l.len),p=n.fragments,g=p[0].start,u=this.getLoadPosition(),f=this.flushing?u:c.end;if(this.switchingTrack&&i){const t=u;n.PTSKnown&&t<g&&(c.end>g||c.nextStart)&&(this.log("Alt audio track ahead of main track, seek to start of alt audio track"),i.currentTime=g+.05)}if(d>=h&&!this.switchingTrack&&f<p[p.length-1].start)return;let m=this.getNextFragment(f,n),v=!1;if(m&&this.isLoopLoading(m,f)&&(v=!!m.gap,m=this.getNextFragmentLoopLoading(m,n,c,Em,h)),!m)return void(this.bufferFlushed=!0);const b=l&&m.start>l.end+n.targetduration;if(b||(null==l||!l.len)&&c.len){const t=this.getAppendedFrag(m.start,Em);if(null===t)return;if(v||(v=!!t.gap||!!b&&0===l.len),b&&!v||v&&c.nextStart&&c.nextStart<t.end)return}this.loadFragment(m,s,f)}getMaxBufferLength(t){const e=super.getMaxBufferLength();return t?Math.min(Math.max(e,t),this.config.maxMaxBufferLength):e}onMediaDetaching(){this.videoBuffer=null,this.bufferFlushed=this.flushing=!1,super.onMediaDetaching()}onAudioTracksUpdated(t,{audioTracks:e}){this.resetTransmuxer(),this.levels=e.map((t=>new Xm(t)))}onAudioTrackSwitching(t,e){const i=!!e.url;this.trackId=e.id;const{fragCurrent:r}=this;r&&(r.abortRequests(),this.removeUnbufferedFrags(r.start)),this.resetLoadingState(),i?this.setInterval(100):this.resetTransmuxer(),i?(this.switchingTrack=e,this.state=hb,this.flushAudioIfNeeded(e)):(this.switchingTrack=null,this.bufferedTrack=e,this.state=db),this.tick()}onManifestLoading(){this.fragmentTracker.removeAllFragments(),this.startPosition=this.lastCurrentTime=0,this.bufferFlushed=this.flushing=!1,this.levels=this.mainDetails=this.waitingData=this.bufferedTrack=this.cachedTrackLoadedData=this.switchingTrack=null,this.startFragRequested=!1,this.trackId=this.videoTrackCC=this.waitingVideoCC=-1}onLevelLoaded(t,e){this.mainDetails=e.details,null!==this.cachedTrackLoadedData&&(this.hls.trigger(pu.AUDIO_TRACK_LOADED,this.cachedTrackLoadedData),this.cachedTrackLoadedData=null)}onAudioTrackLoaded(t,e){var i;if(null==this.mainDetails)return void(this.cachedTrackLoadedData=e);const{levels:r}=this,{details:a,id:s}=e;if(!r)return void this.warn(`Audio tracks were reset while loading level ${s}`);this.log(`Audio track ${s} loaded [${a.startSN},${a.endSN}]${a.lastPartSn?`[part-${a.lastPartSn}-${a.lastPartIndex}]`:""},duration:${a.totalduration}`);const n=r[s];let o=0;if(a.live||null!=(i=n.details)&&i.live){this.checkLiveUpdate(a);const t=this.mainDetails;if(a.deltaUpdateFailed||!t)return;var c;if(!n.details&&a.hasProgramDateTime&&t.hasProgramDateTime)Xv(a,t),o=a.fragments[0].start;else o=this.alignPlaylists(a,n.details,null==(c=this.levelLastLoaded)?void 0:c.details)}n.details=a,this.levelLastLoaded=n,this.startFragRequested||!this.mainDetails&&a.live||this.setStartPosition(this.mainDetails||a,o),this.state!==fb||this.waitForCdnTuneIn(a)||(this.state=hb),this.tick()}_handleFragmentLoadProgress(t){var e;const{frag:i,part:r,payload:a}=t,{config:s,trackId:n,levels:o}=this;if(!o)return void this.warn(`Audio tracks were reset while fragment load was in progress. Fragment ${i.sn} of level ${i.level} will not be buffered`);const c=o[n];if(!c)return void this.warn("Audio track is undefined on fragment load progress");const l=c.details;if(!l)return this.warn("Audio track details undefined on fragment load progress"),void this.removeUnbufferedFrags(i.start);const d=s.defaultAudioCodec||c.audioCodec||"mp4a.40.2";let h=this.transmuxer;h||(h=this.transmuxer=new _k(this.hls,Tm,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)));const p=this.initPTS[i.cc],g=null==(e=i.initSegment)?void 0:e.data;if(void 0!==p){const t=!1,e=r?r.index:-1,s=-1!==e,n=new Wv(i.level,i.sn,i.stats.chunkCount,a.byteLength,e,s);h.push(a,g,d,"",i,r,l.totalduration,t,n,p)}else{this.log(`Unknown video PTS for cc ${i.cc}, waiting for video PTS before demuxing audio frag ${i.sn} of [${l.startSN} ,${l.endSN}],track ${n}`);const{cache:t}=this.waitingData=this.waitingData||{frag:i,part:r,cache:new Sb,complete:!1};t.push(new Uint8Array(a)),this.waitingVideoCC=this.videoTrackCC,this.state=yb}}_handleFragmentLoadComplete(t){this.waitingData?this.waitingData.complete=!0:super._handleFragmentLoadComplete(t)}onBufferReset(){this.mediaBuffer=this.videoBuffer=null,this.loadedmetadata=!1}onBufferCreated(t,e){const i=e.tracks.audio;i&&(this.mediaBuffer=i.buffer||null),e.tracks.video&&(this.videoBuffer=e.tracks.video.buffer||null)}onFragBuffered(t,e){const{frag:i,part:r}=e;if(i.type===Tm)if(this.fragContextChanged(i))this.warn(`Fragment ${i.sn}${r?" p: "+r.index:""} of level ${i.level} finished buffering, but was aborted. state: ${this.state}, audioSwitch: ${this.switchingTrack?this.switchingTrack.name:"false"}`);else{if("initSegment"!==i.sn){this.fragPrevious=i;const t=this.switchingTrack;t&&(this.bufferedTrack=t,this.switchingTrack=null,this.hls.trigger(pu.AUDIO_TRACK_SWITCHED,su({},t)))}this.fragBufferedComplete(i,r)}else if(!this.loadedmetadata&&i.type===Em){const t=this.videoBuffer||this.media;if(t){Kv.getBuffered(t).length&&(this.loadedmetadata=!0)}}}onError(t,e){var i;if(e.fatal)this.state=kb;else switch(e.details){case uu.FRAG_GAP:case uu.FRAG_PARSING_ERROR:case uu.FRAG_DECRYPT_ERROR:case uu.FRAG_LOAD_ERROR:case uu.FRAG_LOAD_TIMEOUT:case uu.KEY_LOAD_ERROR:case uu.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(Tm,e);break;case uu.AUDIO_TRACK_LOAD_ERROR:case uu.AUDIO_TRACK_LOAD_TIMEOUT:case uu.LEVEL_PARSING_ERROR:e.levelRetry||this.state!==fb||(null==(i=e.context)?void 0:i.type)!==Pm||(this.state=hb);break;case uu.BUFFER_APPEND_ERROR:case uu.BUFFER_FULL_ERROR:if(!e.parent||"audio"!==e.parent)return;if(e.details===uu.BUFFER_APPEND_ERROR)return void this.resetLoadingState();this.reduceLengthAndFlushBuffer(e)&&(this.bufferedTrack=null,super.flushMainBuffer(0,Number.POSITIVE_INFINITY,"audio"));break;case uu.INTERNAL_EXCEPTION:this.recoverWorkerError(e)}}onBufferFlushing(t,{type:e}){e!==Tu&&(this.flushing=!0)}onBufferFlushed(t,{type:e}){if(e!==Tu){this.flushing=!1,this.bufferFlushed=!0,this.state===bb&&(this.state=hb);const t=this.mediaBuffer||this.media;t&&(this.afterBufferFlushed(t,e,Tm),this.tick())}}_handleTransmuxComplete(t){var e;const i="audio",{hls:r}=this,{remuxResult:a,chunkMeta:s}=t,n=this.getCurrentContext(s);if(!n)return void this.resetWhenMissingContext(s);const{frag:o,part:c,level:l}=n,{details:d}=l,{audio:h,text:p,id3:g,initSegment:u}=a;if(!this.fragContextChanged(o)&&d){if(this.state=mb,this.switchingTrack&&h&&this.completeAudioSwitch(this.switchingTrack),null!=u&&u.tracks){const t=o.initSegment||o;this._bufferInitSegment(l,u.tracks,t,s),r.trigger(pu.FRAG_PARSING_INIT_SEGMENT,{frag:t,id:i,tracks:u.tracks})}if(h){const{startPTS:t,endPTS:e,startDTS:i,endDTS:r}=h;c&&(c.elementaryStreams[Eu]={startPTS:t,endPTS:e,startDTS:i,endDTS:r}),o.setElementaryStreamInfo(Eu,t,e,i,r),this.bufferFragmentData(h,o,c,s)}if(null!=g&&null!=(e=g.samples)&&e.length){const t=cu({id:i,frag:o,details:d},g);r.trigger(pu.FRAG_PARSING_METADATA,t)}if(p){const t=cu({id:i,frag:o,details:d},p);r.trigger(pu.FRAG_PARSING_USERDATA,t)}}else this.fragmentTracker.removeFragment(o)}_bufferInitSegment(t,e,i,r){if(this.state!==mb)return;e.video&&delete e.video;const a=e.audio;if(!a)return;a.id="audio";const s=t.audioCodec;this.log(`Init audio buffer, container:${a.container}, codecs[level/parsed]=[${s}/${a.codec}]`),s&&1===s.split(",").length&&(a.levelCodec=s),this.hls.trigger(pu.BUFFER_CODECS,e);const n=a.initSegment;if(null!=n&&n.byteLength){const t={type:"audio",frag:i,part:null,chunkMeta:r,parent:i.type,data:n};this.hls.trigger(pu.BUFFER_APPENDING,t)}this.tickImmediate()}loadFragment(t,e,i){const r=this.fragmentTracker.getState(t);var a;if(this.fragCurrent=t,this.switchingTrack||r===jv||r===Nv)if("initSegment"===t.sn)this._loadInitSegment(t,e);else if(null!=(a=e.details)&&a.live&&!this.initPTS[t.cc]){this.log(`Waiting for video PTS in continuity counter ${t.cc} of live stream before loading audio fragment ${t.sn} of level ${this.trackId}`),this.state=yb;const i=this.mainDetails;i&&i.fragments[0].start!==e.details.fragments[0].start&&Xv(e.details,i)}else this.startFragRequested=!0,super.loadFragment(t,e,i);else this.clearTrackerIfNeeded(t)}flushAudioIfNeeded(t){if(this.media&&this.bufferedTrack){const{name:e,lang:i,assocLang:r,characteristics:a,audioCodec:s,channels:n}=this.bufferedTrack;Ov({name:e,lang:i,assocLang:r,characteristics:a,audioCodec:s,channels:n},t,Uv)||(this.log("Switching audio track : flushing all audio"),super.flushMainBuffer(0,Number.POSITIVE_INFINITY,"audio"),this.bufferedTrack=null)}}completeAudioSwitch(t){const{hls:e}=this;this.flushAudioIfNeeded(t),this.bufferedTrack=t,this.switchingTrack=null,e.trigger(pu.AUDIO_TRACK_SWITCHED,su({},t))}},audioTrackController:class extends Cv{constructor(t){super(t,"[audio-track-controller]"),this.tracks=[],this.groupIds=null,this.tracksInGroup=[],this.trackId=-1,this.currentTrack=null,this.selectDefaultTrack=!0,this.registerListeners()}registerListeners(){const{hls:t}=this;t.on(pu.MANIFEST_LOADING,this.onManifestLoading,this),t.on(pu.MANIFEST_PARSED,this.onManifestParsed,this),t.on(pu.LEVEL_LOADING,this.onLevelLoading,this),t.on(pu.LEVEL_SWITCHING,this.onLevelSwitching,this),t.on(pu.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),t.on(pu.ERROR,this.onError,this)}unregisterListeners(){const{hls:t}=this;t.off(pu.MANIFEST_LOADING,this.onManifestLoading,this),t.off(pu.MANIFEST_PARSED,this.onManifestParsed,this),t.off(pu.LEVEL_LOADING,this.onLevelLoading,this),t.off(pu.LEVEL_SWITCHING,this.onLevelSwitching,this),t.off(pu.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),t.off(pu.ERROR,this.onError,this)}destroy(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,this.currentTrack=null,super.destroy()}onManifestLoading(){this.tracks=[],this.tracksInGroup=[],this.groupIds=null,this.currentTrack=null,this.trackId=-1,this.selectDefaultTrack=!0}onManifestParsed(t,e){this.tracks=e.audioTracks||[]}onAudioTrackLoaded(t,e){const{id:i,groupId:r,details:a}=e,s=this.tracksInGroup[i];if(!s||s.groupId!==r)return void this.warn(`Audio track with id:${i} and group:${r} not found in active group ${null==s?void 0:s.groupId}`);const n=s.details;s.details=e.details,this.log(`Audio track ${i} "${s.name}" lang:${s.lang} group:${r} loaded [${a.startSN}-${a.endSN}]`),i===this.trackId&&this.playlistLoaded(i,e,n)}onLevelLoading(t,e){this.switchLevel(e.level)}onLevelSwitching(t,e){this.switchLevel(e.level)}switchLevel(t){const e=this.hls.levels[t];if(!e)return;const i=e.audioGroups||null,r=this.groupIds;let a=this.currentTrack;if(!i||(null==r?void 0:r.length)!==(null==i?void 0:i.length)||null!=i&&i.some((t=>-1===(null==r?void 0:r.indexOf(t))))){this.groupIds=i,this.trackId=-1,this.currentTrack=null;const t=this.tracks.filter((t=>!i||-1!==i.indexOf(t.groupId)));if(t.length)this.selectDefaultTrack&&!t.some((t=>t.default))&&(this.selectDefaultTrack=!1),t.forEach(((t,e)=>{t.id=e}));else if(!a&&!this.tracksInGroup.length)return;this.tracksInGroup=t;const e=this.hls.config.audioPreference;if(!a&&e){const i=Iv(e,t,Uv);if(i>-1)a=t[i];else{const t=Iv(e,this.tracks);a=this.tracks[t]}}let r=this.findTrackId(a);-1===r&&a&&(r=this.findTrackId(null));const n={audioTracks:t};this.log(`Updating audio tracks, ${t.length} track(s) found in group(s): ${null==i?void 0:i.join(",")}`),this.hls.trigger(pu.AUDIO_TRACKS_UPDATED,n);const o=this.trackId;if(-1!==r&&-1===o)this.setAudioTrack(r);else if(t.length&&-1===o){var s;const e=new Error(`No audio track selected for current audio group-ID(s): ${null==(s=this.groupIds)?void 0:s.join(",")} track count: ${t.length}`);this.warn(e.message),this.hls.trigger(pu.ERROR,{type:gu.MEDIA_ERROR,details:uu.AUDIO_TRACK_LOAD_ERROR,fatal:!0,error:e})}}else this.shouldReloadPlaylist(a)&&this.setAudioTrack(this.trackId)}onError(t,e){!e.fatal&&e.context&&(e.context.type!==Pm||e.context.id!==this.trackId||this.groupIds&&-1===this.groupIds.indexOf(e.context.groupId)||(this.requestScheduled=-1,this.checkRetry(e)))}get allAudioTracks(){return this.tracks}get audioTracks(){return this.tracksInGroup}get audioTrack(){return this.trackId}set audioTrack(t){this.selectDefaultTrack=!1,this.setAudioTrack(t)}setAudioOption(t){const e=this.hls;if(e.config.audioPreference=t,t){const i=this.allAudioTracks;if(this.selectDefaultTrack=!1,i.length){const r=this.currentTrack;if(r&&Ov(t,r,Uv))return r;const a=Iv(t,this.tracksInGroup,Uv);if(a>-1){const t=this.tracksInGroup[a];return this.setAudioTrack(a),t}if(r){let r=e.loadLevel;-1===r&&(r=e.firstAutoLevel);const a=function(t,e,i,r,a){const s=e[r],n=e.reduce(((t,e,i)=>{const r=e.uri;return(t[r]||(t[r]=[])).push(i),t}),{}),o=n[s.uri];o.length>1&&(r=Math.max.apply(Math,o));const c=s.videoRange,l=s.frameRate,d=s.codecSet.substring(0,4),h=$v(e,r,(e=>{if(e.videoRange!==c||e.frameRate!==l||e.codecSet.substring(0,4)!==d)return!1;const r=e.audioGroups,s=i.filter((t=>!r||-1!==r.indexOf(t.groupId)));return Iv(t,s,a)>-1}));return h>-1?h:$v(e,r,(e=>{const r=e.audioGroups,s=i.filter((t=>!r||-1!==r.indexOf(t.groupId)));return Iv(t,s,a)>-1}))}(t,e.levels,i,r,Uv);if(-1===a)return null;e.nextLoadLevel=a}if(t.channels||t.audioCodec){const e=Iv(t,i);if(e>-1)return i[e]}}}return null}setAudioTrack(t){const e=this.tracksInGroup;if(t<0||t>=e.length)return void this.warn(`Invalid audio track id: ${t}`);this.clearTimer(),this.selectDefaultTrack=!1;const i=this.currentTrack,r=e[t],a=r.details&&!r.details.live;if(t===this.trackId&&r===i&&a)return;if(this.log(`Switching to audio-track ${t} "${r.name}" lang:${r.lang} group:${r.groupId} channels:${r.channels}`),this.trackId=t,this.currentTrack=r,this.hls.trigger(pu.AUDIO_TRACK_SWITCHING,su({},r)),a)return;const s=this.switchParams(r.url,null==i?void 0:i.details,r.details);this.loadPlaylist(s)}findTrackId(t){const e=this.tracksInGroup;for(let i=0;i<e.length;i++){const r=e[i];if((!this.selectDefaultTrack||r.default)&&(!t||Ov(t,r,Uv)))return i}if(t){const{name:i,lang:r,assocLang:a,characteristics:s,audioCodec:n,channels:o}=t;for(let t=0;t<e.length;t++){if(Ov({name:i,lang:r,assocLang:a,characteristics:s,audioCodec:n,channels:o},e[t],Uv))return t}for(let i=0;i<e.length;i++){const r=e[i];if(Ak(t.attrs,r.attrs,["LANGUAGE","ASSOC-LANGUAGE","CHARACTERISTICS"]))return i}for(let i=0;i<e.length;i++){const r=e[i];if(Ak(t.attrs,r.attrs,["LANGUAGE"]))return i}}return-1}loadPlaylist(t){const e=this.currentTrack;if(this.shouldLoadPlaylist(e)&&e){super.loadPlaylist();const i=e.id,r=e.groupId;let a=e.url;if(t)try{a=t.addDirectives(a)}catch(t){this.warn(`Could not construct new URL with HLS Delivery Directives: ${t}`)}this.log(`loading audio-track playlist ${i} "${e.name}" lang:${e.lang} group:${r}`),this.clearTimer(),this.hls.trigger(pu.AUDIO_TRACK_LOADING,{url:a,id:i,groupId:r,deliveryDirectives:t||null})}}},emeController:My,cmcdController:class{constructor(t){this.hls=void 0,this.config=void 0,this.media=void 0,this.sid=void 0,this.cid=void 0,this.useHeaders=!1,this.includeKeys=void 0,this.initialized=!1,this.starved=!1,this.buffering=!0,this.audioBuffer=void 0,this.videoBuffer=void 0,this.onWaiting=()=>{this.initialized&&(this.starved=!0),this.buffering=!0},this.onPlaying=()=>{this.initialized||(this.initialized=!0),this.buffering=!1},this.applyPlaylistData=t=>{try{this.apply(t,{ot:Oy.MANIFEST,su:!this.initialized})}catch(t){ku.warn("Could not generate manifest CMCD data.",t)}},this.applyFragmentData=t=>{try{const e=t.frag,i=this.hls.levels[e.level],r=this.getObjectType(e),a={d:1e3*e.duration,ot:r};r!==Oy.VIDEO&&r!==Oy.AUDIO&&r!=Oy.MUXED||(a.br=i.bitrate/1e3,a.tb=this.getTopBandwidth(r)/1e3,a.bl=this.getBufferLength(r)),this.apply(t,a)}catch(t){ku.warn("Could not generate segment CMCD data.",t)}},this.hls=t;const e=this.config=t.config,{cmcd:i}=e;null!=i&&(e.pLoader=this.createPlaylistLoader(),e.fLoader=this.createFragmentLoader(),this.sid=i.sessionId||function(){try{return crypto.randomUUID()}catch(t){try{const t=URL.createObjectURL(new Blob),e=t.toString();return URL.revokeObjectURL(t),e.slice(e.lastIndexOf("/")+1)}catch(t){let e=(new Date).getTime();return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(t=>{const i=(e+16*Math.random())%16|0;return e=Math.floor(e/16),("x"==t?i:3&i|8).toString(16)}))}}}(),this.cid=i.contentId,this.useHeaders=!0===i.useHeaders,this.includeKeys=i.includeKeys,this.registerListeners())}registerListeners(){const t=this.hls;t.on(pu.MEDIA_ATTACHED,this.onMediaAttached,this),t.on(pu.MEDIA_DETACHED,this.onMediaDetached,this),t.on(pu.BUFFER_CREATED,this.onBufferCreated,this)}unregisterListeners(){const t=this.hls;t.off(pu.MEDIA_ATTACHED,this.onMediaAttached,this),t.off(pu.MEDIA_DETACHED,this.onMediaDetached,this),t.off(pu.BUFFER_CREATED,this.onBufferCreated,this)}destroy(){this.unregisterListeners(),this.onMediaDetached(),this.hls=this.config=this.audioBuffer=this.videoBuffer=null,this.onWaiting=this.onPlaying=null}onMediaAttached(t,e){this.media=e.media,this.media.addEventListener("waiting",this.onWaiting),this.media.addEventListener("playing",this.onPlaying)}onMediaDetached(){this.media&&(this.media.removeEventListener("waiting",this.onWaiting),this.media.removeEventListener("playing",this.onPlaying),this.media=null)}onBufferCreated(t,e){var i,r;this.audioBuffer=null==(i=e.tracks.audio)?void 0:i.buffer,this.videoBuffer=null==(r=e.tracks.video)?void 0:r.buffer}createData(){var t;return{v:1,sf:Uy.HLS,sid:this.sid,cid:this.cid,pr:null==(t=this.media)?void 0:t.playbackRate,mtp:this.hls.bandwidthEstimate/1e3}}apply(t,e={}){cu(e,this.createData());const i=e.ot===Oy.INIT||e.ot===Oy.VIDEO||e.ot===Oy.MUXED;this.starved&&i&&(e.bs=!0,e.su=!0,this.starved=!1),null==e.su&&(e.su=this.buffering);const{includeKeys:r}=this;r&&(e=Object.keys(e).reduce(((t,i)=>(r.includes(i)&&(t[i]=e[i]),t)),{})),this.useHeaders?(t.headers||(t.headers={}),nw(t.headers,e)):t.url=cw(t.url,e)}getObjectType(t){const{type:e}=t;return"subtitle"===e?Oy.TIMED_TEXT:"initSegment"===t.sn?Oy.INIT:"audio"===e?Oy.AUDIO:"main"===e?this.hls.audioTracks.length?Oy.VIDEO:Oy.MUXED:void 0}getTopBandwidth(t){let e,i=0;const r=this.hls;if(t===Oy.AUDIO)e=r.audioTracks;else{const t=r.maxAutoLevel,i=t>-1?t+1:r.levels.length;e=r.levels.slice(0,i)}for(const t of e)t.bitrate>i&&(i=t.bitrate);return i>0?i:NaN}getBufferLength(t){const e=this.hls.media,i=t===Oy.AUDIO?this.audioBuffer:this.videoBuffer;if(!i||!e)return NaN;return 1e3*Kv.bufferInfo(i,e.currentTime,this.config.maxBufferHole).len}createPlaylistLoader(){const{pLoader:t}=this.config,e=this.applyPlaylistData,i=t||this.config.loader;return class{constructor(t){this.loader=void 0,this.loader=new i(t)}get stats(){return this.loader.stats}get context(){return this.loader.context}destroy(){this.loader.destroy()}abort(){this.loader.abort()}load(t,i,r){e(t),this.loader.load(t,i,r)}}}createFragmentLoader(){const{fLoader:t}=this.config,e=this.applyFragmentData,i=t||this.config.loader;return class{constructor(t){this.loader=void 0,this.loader=new i(t)}get stats(){return this.loader.stats}get context(){return this.loader.context}destroy(){this.loader.destroy()}abort(){this.loader.abort()}load(t,i,r){e(t),this.loader.load(t,i,r)}}}},contentSteeringController:class{constructor(t){this.hls=void 0,this.log=void 0,this.loader=null,this.uri=null,this.pathwayId=".",this.pathwayPriority=null,this.timeToLoad=300,this.reloadTimer=-1,this.updated=0,this.started=!1,this.enabled=!0,this.levels=null,this.audioTracks=null,this.subtitleTracks=null,this.penalizedPathways={},this.hls=t,this.log=ku.log.bind(ku,"[content-steering]:"),this.registerListeners()}registerListeners(){const t=this.hls;t.on(pu.MANIFEST_LOADING,this.onManifestLoading,this),t.on(pu.MANIFEST_LOADED,this.onManifestLoaded,this),t.on(pu.MANIFEST_PARSED,this.onManifestParsed,this),t.on(pu.ERROR,this.onError,this)}unregisterListeners(){const t=this.hls;t&&(t.off(pu.MANIFEST_LOADING,this.onManifestLoading,this),t.off(pu.MANIFEST_LOADED,this.onManifestLoaded,this),t.off(pu.MANIFEST_PARSED,this.onManifestParsed,this),t.off(pu.ERROR,this.onError,this))}startLoad(){if(this.started=!0,this.clearTimeout(),this.enabled&&this.uri){if(this.updated){const t=1e3*this.timeToLoad-(performance.now()-this.updated);if(t>0)return void this.scheduleRefresh(this.uri,t)}this.loadSteeringManifest(this.uri)}}stopLoad(){this.started=!1,this.loader&&(this.loader.destroy(),this.loader=null),this.clearTimeout()}clearTimeout(){-1!==this.reloadTimer&&(self.clearTimeout(this.reloadTimer),this.reloadTimer=-1)}destroy(){this.unregisterListeners(),this.stopLoad(),this.hls=null,this.levels=this.audioTracks=this.subtitleTracks=null}removeLevel(t){const e=this.levels;e&&(this.levels=e.filter((e=>e!==t)))}onManifestLoading(){this.stopLoad(),this.enabled=!0,this.timeToLoad=300,this.updated=0,this.uri=null,this.pathwayId=".",this.levels=this.audioTracks=this.subtitleTracks=null}onManifestLoaded(t,e){const{contentSteering:i}=e;null!==i&&(this.pathwayId=i.pathwayId,this.uri=i.uri,this.started&&this.startLoad())}onManifestParsed(t,e){this.audioTracks=e.audioTracks,this.subtitleTracks=e.subtitleTracks}onError(t,e){const{errorAction:i}=e;if((null==i?void 0:i.action)===kv&&i.flags===Sv){const t=this.levels;let r=this.pathwayPriority,a=this.pathwayId;if(e.context){const{groupId:i,pathwayId:r,type:s}=e.context;i&&t?a=this.getPathwayForGroupId(i,s,a):r&&(a=r)}a in this.penalizedPathways||(this.penalizedPathways[a]=performance.now()),!r&&t&&(r=t.reduce(((t,e)=>(-1===t.indexOf(e.pathwayId)&&t.push(e.pathwayId),t)),[])),r&&r.length>1&&(this.updatePathwayPriority(r),i.resolved=this.pathwayId!==a),i.resolved||ku.warn(`Could not resolve ${e.details} ("${e.error.message}") with content-steering for Pathway: ${a} levels: ${t?t.length:t} priorities: ${JSON.stringify(r)} penalized: ${JSON.stringify(this.penalizedPathways)}`)}}filterParsedLevels(t){this.levels=t;let e=this.getLevelsForPathway(this.pathwayId);if(0===e.length){const i=t[0].pathwayId;this.log(`No levels found in Pathway ${this.pathwayId}. Setting initial Pathway to "${i}"`),e=this.getLevelsForPathway(i),this.pathwayId=i}return e.length!==t.length&&this.log(`Found ${e.length}/${t.length} levels in Pathway "${this.pathwayId}"`),e}getLevelsForPathway(t){return null===this.levels?[]:this.levels.filter((e=>t===e.pathwayId))}updatePathwayPriority(t){let e;this.pathwayPriority=t;const i=this.penalizedPathways,r=performance.now();Object.keys(i).forEach((t=>{r-i[t]>3e5&&delete i[t]}));for(let r=0;r<t.length;r++){const a=t[r];if(a in i)continue;if(a===this.pathwayId)return;const s=this.hls.nextLoadLevel,n=this.hls.levels[s];if(e=this.getLevelsForPathway(a),e.length>0){this.log(`Setting Pathway to "${a}"`),this.pathwayId=a,cv(e),this.hls.trigger(pu.LEVELS_UPDATED,{levels:e});const t=this.hls.levels[s];n&&t&&this.levels&&(t.attrs["STABLE-VARIANT-ID"]!==n.attrs["STABLE-VARIANT-ID"]&&t.bitrate!==n.bitrate&&this.log(`Unstable Pathways change from bitrate ${n.bitrate} to ${t.bitrate}`),this.hls.nextLoadLevel=s);break}}}getPathwayForGroupId(t,e,i){const r=this.getLevelsForPathway(i).concat(this.levels||[]);for(let i=0;i<r.length;i++)if(e===Pm&&r[i].hasAudioGroup(t)||e===Cm&&r[i].hasSubtitleGroup(t))return r[i].pathwayId;return i}clonePathways(t){const e=this.levels;if(!e)return;const i={},r={};t.forEach((t=>{const{ID:a,"BASE-ID":s,"URI-REPLACEMENT":n}=t;if(e.some((t=>t.pathwayId===a)))return;const o=this.getLevelsForPathway(s).map((t=>{const e=new xu(t.attrs);e["PATHWAY-ID"]=a;const s=e.AUDIO&&`${e.AUDIO}_clone_${a}`,o=e.SUBTITLES&&`${e.SUBTITLES}_clone_${a}`;s&&(i[e.AUDIO]=s,e.AUDIO=s),o&&(r[e.SUBTITLES]=o,e.SUBTITLES=o);const c=dw(t.uri,e["STABLE-VARIANT-ID"],"PER-VARIANT-URIS",n),l=new Xm({attrs:e,audioCodec:t.audioCodec,bitrate:t.bitrate,height:t.height,name:t.name,url:c,videoCodec:t.videoCodec,width:t.width});if(t.audioGroups)for(let e=1;e<t.audioGroups.length;e++)l.addGroupId("audio",`${t.audioGroups[e]}_clone_${a}`);if(t.subtitleGroups)for(let e=1;e<t.subtitleGroups.length;e++)l.addGroupId("text",`${t.subtitleGroups[e]}_clone_${a}`);return l}));e.push(...o),lw(this.audioTracks,i,n,a),lw(this.subtitleTracks,r,n,a)}))}loadSteeringManifest(t){const e=this.hls.config,i=e.loader;let r;this.loader&&this.loader.destroy(),this.loader=new i(e);try{r=new self.URL(t)}catch(e){return this.enabled=!1,void this.log(`Failed to parse Steering Manifest URI: ${t}`)}if("data:"!==r.protocol){const t=0|(this.hls.bandwidthEstimate||e.abrEwmaDefaultEstimate);r.searchParams.set("_HLS_pathway",this.pathwayId),r.searchParams.set("_HLS_throughput",""+t)}const a={responseType:"json",url:r.href},s=e.steeringManifestLoadPolicy.default,n=s.errorRetry||s.timeoutRetry||{},o={loadPolicy:s,timeout:s.maxLoadTimeMs,maxRetry:n.maxNumRetry||0,retryDelay:n.retryDelayMs||0,maxRetryDelay:n.maxRetryDelayMs||0},c={onSuccess:(t,e,i,a)=>{this.log(`Loaded steering manifest: "${r}"`);const s=t.data;if(1!==s.VERSION)return void this.log(`Steering VERSION ${s.VERSION} not supported!`);this.updated=performance.now(),this.timeToLoad=s.TTL;const{"RELOAD-URI":n,"PATHWAY-CLONES":o,"PATHWAY-PRIORITY":c}=s;if(n)try{this.uri=new self.URL(n,r).href}catch(t){return this.enabled=!1,void this.log(`Failed to parse Steering Manifest RELOAD-URI: ${n}`)}this.scheduleRefresh(this.uri||i.url),o&&this.clonePathways(o);const l={steeringManifest:s,url:r.toString()};this.hls.trigger(pu.STEERING_MANIFEST_LOADED,l),c&&this.updatePathwayPriority(c)},onError:(t,e,i,r)=>{if(this.log(`Error loading steering manifest: ${t.code} ${t.text} (${e.url})`),this.stopLoad(),410===t.code)return this.enabled=!1,void this.log(`Steering manifest ${e.url} no longer available`);let a=1e3*this.timeToLoad;if(429!==t.code)this.scheduleRefresh(this.uri||e.url,a);else{const t=this.loader;if("function"==typeof(null==t?void 0:t.getResponseHeader)){const e=t.getResponseHeader("Retry-After");e&&(a=1e3*parseFloat(e))}this.log(`Steering manifest ${e.url} rate limited`)}},onTimeout:(t,e,i)=>{this.log(`Timeout loading steering manifest (${e.url})`),this.scheduleRefresh(this.uri||e.url)}};this.log(`Requesting steering manifest: ${r}`),this.loader.load(a,o,c)}scheduleRefresh(t,e=1e3*this.timeToLoad){this.clearTimeout(),this.reloadTimer=self.setTimeout((()=>{var e;const i=null==(e=this.hls)?void 0:e.media;!i||i.ended?this.scheduleRefresh(t,1e3*this.timeToLoad):this.loadSteeringManifest(t)}),e)}}});function yw(t){return t&&"object"==typeof t?Array.isArray(t)?t.map(yw):Object.keys(t).reduce(((e,i)=>(e[i]=yw(t[i]),e)),{}):t}function ww(t){const e=t.loader;if(e!==uw&&e!==pw)ku.log("[config]: Custom loader detected, cannot enable progressive streaming"),t.progressive=!1;else{(function(){if(self.fetch&&self.AbortController&&self.ReadableStream&&self.Request)try{return new self.ReadableStream({}),!0}catch(t){}return!1})()&&(t.loader=uw,t.progressive=!0,t.enableSoftwareAES=!0,ku.log("[config]: Progressive streaming enabled, using FetchLoader"))}}let xw;class Sw extends Cv{constructor(t,e){super(t,"[level-controller]"),this._levels=[],this._firstLevel=-1,this._maxAutoLevel=-1,this._startLevel=void 0,this.currentLevel=null,this.currentLevelIndex=-1,this.manualLevelIndex=-1,this.steering=void 0,this.onParsedComplete=void 0,this.steering=e,this._registerListeners()}_registerListeners(){const{hls:t}=this;t.on(pu.MANIFEST_LOADING,this.onManifestLoading,this),t.on(pu.MANIFEST_LOADED,this.onManifestLoaded,this),t.on(pu.LEVEL_LOADED,this.onLevelLoaded,this),t.on(pu.LEVELS_UPDATED,this.onLevelsUpdated,this),t.on(pu.FRAG_BUFFERED,this.onFragBuffered,this),t.on(pu.ERROR,this.onError,this)}_unregisterListeners(){const{hls:t}=this;t.off(pu.MANIFEST_LOADING,this.onManifestLoading,this),t.off(pu.MANIFEST_LOADED,this.onManifestLoaded,this),t.off(pu.LEVEL_LOADED,this.onLevelLoaded,this),t.off(pu.LEVELS_UPDATED,this.onLevelsUpdated,this),t.off(pu.FRAG_BUFFERED,this.onFragBuffered,this),t.off(pu.ERROR,this.onError,this)}destroy(){this._unregisterListeners(),this.steering=null,this.resetLevels(),super.destroy()}stopLoad(){this._levels.forEach((t=>{t.loadError=0,t.fragmentError=0})),super.stopLoad()}resetLevels(){this._startLevel=void 0,this.manualLevelIndex=-1,this.currentLevelIndex=-1,this.currentLevel=null,this._levels=[],this._maxAutoLevel=-1}onManifestLoading(t,e){this.resetLevels()}onManifestLoaded(t,e){const i=this.hls.config.preferManagedMediaSource,r=[],a={},s={};let n=!1,o=!1,c=!1;e.levels.forEach((t=>{var e,l;const d=t.attrs;let{audioCodec:h,videoCodec:p}=t;-1!==(null==(e=h)?void 0:e.indexOf("mp4a.40.34"))&&(xw||(xw=/chrome|firefox/i.test(navigator.userAgent)),xw&&(t.audioCodec=h=void 0)),h&&(t.audioCodec=h=om(h,i)),0===(null==(l=p)?void 0:l.indexOf("avc1"))&&(p=t.videoCodec=function(t){const e=t.split(",");for(let t=0;t<e.length;t++){const i=e[t].split(".");if(i.length>2){let r=i.shift()+".";r+=parseInt(i.shift()).toString(16),r+=("000"+parseInt(i.shift()).toString(16)).slice(-4),e[t]=r}}return e.join(",")}(p));const{width:g,height:u,unknownCodecs:f}=t;if(n||(n=!(!g||!u)),o||(o=!!p),c||(c=!!h),null!=f&&f.length||h&&!tm(h,"audio",i)||p&&!tm(p,"video",i))return;const{CODECS:m,"FRAME-RATE":v,"HDCP-LEVEL":b,"PATHWAY-ID":k,RESOLUTION:y,"VIDEO-RANGE":w}=d,x=`${`${k||"."}-`}${t.bitrate}-${y}-${v}-${m}-${w}-${b}`;if(a[x])if(a[x].uri===t.url||t.attrs["PATHWAY-ID"])a[x].addGroupId("audio",d.AUDIO),a[x].addGroupId("text",d.SUBTITLES);else{const e=s[x]+=1;t.attrs["PATHWAY-ID"]=new Array(e+1).join(".");const i=new Xm(t);a[x]=i,r.push(i)}else{const e=new Xm(t);a[x]=e,s[x]=1,r.push(e)}})),this.filterAndSortMediaOptions(r,e,n,o,c)}filterAndSortMediaOptions(t,e,i,r,a){let s=[],n=[],o=t;if((i||r)&&a&&(o=o.filter((({videoCodec:t,videoRange:e,width:i,height:r})=>{return(!!t||!(!i||!r))&&(!!(a=e)&&Km.indexOf(a)>-1);var a}))),0===o.length)return void Promise.resolve().then((()=>{if(this.hls){e.levels.length&&this.warn(`One or more CODECS in variant not supported: ${JSON.stringify(e.levels[0].attrs)}`);const t=new Error("no level with compatible codecs found in manifest");this.hls.trigger(pu.ERROR,{type:gu.MEDIA_ERROR,details:uu.MANIFEST_INCOMPATIBLE_CODECS_ERROR,fatal:!0,url:e.url,error:t,reason:t.message})}}));if(e.audioTracks){const{preferManagedMediaSource:t}=this.hls.config;s=e.audioTracks.filter((e=>!e.audioCodec||tm(e.audioCodec,"audio",t))),Pw(s)}e.subtitles&&(n=e.subtitles,Pw(n));const c=o.slice(0);o.sort(((t,e)=>{if(t.attrs["HDCP-LEVEL"]!==e.attrs["HDCP-LEVEL"])return(t.attrs["HDCP-LEVEL"]||"")>(e.attrs["HDCP-LEVEL"]||"")?1:-1;if(i&&t.height!==e.height)return t.height-e.height;if(t.frameRate!==e.frameRate)return t.frameRate-e.frameRate;if(t.videoRange!==e.videoRange)return Km.indexOf(t.videoRange)-Km.indexOf(e.videoRange);if(t.videoCodec!==e.videoCodec){const i=rm(t.videoCodec),r=rm(e.videoCodec);if(i!==r)return r-i}if(t.uri===e.uri&&t.codecSet!==e.codecSet){const i=am(t.codecSet),r=am(e.codecSet);if(i!==r)return r-i}return t.averageBitrate!==e.averageBitrate?t.averageBitrate-e.averageBitrate:0}));let l=c[0];if(this.steering&&(o=this.steering.filterParsedLevels(o),o.length!==c.length))for(let t=0;t<c.length;t++)if(c[t].pathwayId===o[0].pathwayId){l=c[t];break}this._levels=o;for(let t=0;t<o.length;t++)if(o[t]===l){var d;this._firstLevel=t;const e=l.bitrate,i=this.hls.bandwidthEstimate;if(this.log(`manifest loaded, ${o.length} level(s) found, first bitrate: ${e}`),void 0===(null==(d=this.hls.userConfig)?void 0:d.abrEwmaDefaultEstimate)){const t=Math.min(e,this.hls.config.abrEwmaDefaultEstimateMax);t>i&&i===kw.abrEwmaDefaultEstimate&&(this.hls.bandwidthEstimate=t)}break}const h=a&&!r,p={levels:o,audioTracks:s,subtitleTracks:n,sessionData:e.sessionData,sessionKeys:e.sessionKeys,firstLevel:this._firstLevel,stats:e.stats,audio:a,video:r,altAudio:!h&&s.some((t=>!!t.url))};this.hls.trigger(pu.MANIFEST_PARSED,p),(this.hls.config.autoStartLoad||this.hls.forceStartLoad)&&this.hls.startLoad(this.hls.config.startPosition)}get levels(){return 0===this._levels.length?null:this._levels}get level(){return this.currentLevelIndex}set level(t){const e=this._levels;if(0===e.length)return;if(t<0||t>=e.length){const i=new Error("invalid level idx"),r=t<0;if(this.hls.trigger(pu.ERROR,{type:gu.OTHER_ERROR,details:uu.LEVEL_SWITCH_ERROR,level:t,fatal:r,error:i,reason:i.message}),r)return;t=Math.min(t,e.length-1)}const i=this.currentLevelIndex,r=this.currentLevel,a=r?r.attrs["PATHWAY-ID"]:void 0,s=e[t],n=s.attrs["PATHWAY-ID"];if(this.currentLevelIndex=t,this.currentLevel=s,i===t&&s.details&&r&&a===n)return;this.log(`Switching to level ${t} (${s.height?s.height+"p ":""}${s.videoRange?s.videoRange+" ":""}${s.codecSet?s.codecSet+" ":""}@${s.bitrate})${n?" with Pathway "+n:""} from level ${i}${a?" with Pathway "+a:""}`);const o={level:t,attrs:s.attrs,details:s.details,bitrate:s.bitrate,averageBitrate:s.averageBitrate,maxBitrate:s.maxBitrate,realBitrate:s.realBitrate,width:s.width,height:s.height,codecSet:s.codecSet,audioCodec:s.audioCodec,videoCodec:s.videoCodec,audioGroups:s.audioGroups,subtitleGroups:s.subtitleGroups,loaded:s.loaded,loadError:s.loadError,fragmentError:s.fragmentError,name:s.name,id:s.id,uri:s.uri,url:s.url,urlId:0,audioGroupIds:s.audioGroupIds,textGroupIds:s.textGroupIds};this.hls.trigger(pu.LEVEL_SWITCHING,o);const c=s.details;if(!c||c.live){const t=this.switchParams(s.uri,null==r?void 0:r.details,c);this.loadPlaylist(t)}}get manualLevel(){return this.manualLevelIndex}set manualLevel(t){this.manualLevelIndex=t,void 0===this._startLevel&&(this._startLevel=t),-1!==t&&(this.level=t)}get firstLevel(){return this._firstLevel}set firstLevel(t){this._firstLevel=t}get startLevel(){if(void 0===this._startLevel){const t=this.hls.config.startLevel;return void 0!==t?t:this.hls.firstAutoLevel}return this._startLevel}set startLevel(t){this._startLevel=t}onError(t,e){!e.fatal&&e.context&&e.context.type===Sm&&e.context.level===this.level&&this.checkRetry(e)}onFragBuffered(t,{frag:e}){if(void 0!==e&&e.type===Em){const t=e.elementaryStreams;if(!Object.keys(t).some((e=>!!t[e])))return;const i=this._levels[e.level];null!=i&&i.loadError&&(this.log(`Resetting level error count of ${i.loadError} on frag buffered`),i.loadError=0)}}onLevelLoaded(t,e){var i;const{level:r,details:a}=e,s=this._levels[r];var n;if(!s)return this.warn(`Invalid level index ${r}`),void(null!=(n=e.deliveryDirectives)&&n.skip&&(a.deltaUpdateFailed=!0));r===this.currentLevelIndex?(0===s.fragmentError&&(s.loadError=0),this.playlistLoaded(r,e,s.details)):null!=(i=e.deliveryDirectives)&&i.skip&&(a.deltaUpdateFailed=!0)}loadPlaylist(t){super.loadPlaylist();const e=this.currentLevelIndex,i=this.currentLevel;if(i&&this.shouldLoadPlaylist(i)){let r=i.uri;if(t)try{r=t.addDirectives(r)}catch(t){this.warn(`Could not construct new URL with HLS Delivery Directives: ${t}`)}const a=i.attrs["PATHWAY-ID"];this.log(`Loading level index ${e}${void 0!==(null==t?void 0:t.msn)?" at sn "+t.msn+" part "+t.part:""} with${a?" Pathway "+a:""} ${r}`),this.clearTimer(),this.hls.trigger(pu.LEVEL_LOADING,{url:r,level:e,pathwayId:i.attrs["PATHWAY-ID"],id:0,deliveryDirectives:t||null})}}get nextLoadLevel(){return-1!==this.manualLevelIndex?this.manualLevelIndex:this.hls.nextAutoLevel}set nextLoadLevel(t){this.level=t,-1===this.manualLevelIndex&&(this.hls.nextAutoLevel=t)}removeLevel(t){var e;const i=this._levels.filter(((e,i)=>i!==t||(this.steering&&this.steering.removeLevel(e),e===this.currentLevel&&(this.currentLevel=null,this.currentLevelIndex=-1,e.details&&e.details.fragments.forEach((t=>t.level=-1))),!1)));cv(i),this._levels=i,this.currentLevelIndex>-1&&null!=(e=this.currentLevel)&&e.details&&(this.currentLevelIndex=this.currentLevel.details.fragments[0].level),this.hls.trigger(pu.LEVELS_UPDATED,{levels:i})}onLevelsUpdated(t,{levels:e}){this._levels=e}checkMaxAutoUpdated(){const{autoLevelCapping:t,maxAutoLevel:e,maxHdcpLevel:i}=this.hls;this._maxAutoLevel!==e&&(this._maxAutoLevel=e,this.hls.trigger(pu.MAX_AUTO_LEVEL_UPDATED,{autoLevelCapping:t,levels:this.levels,maxAutoLevel:e,minAutoLevel:this.hls.minAutoLevel,maxHdcpLevel:i}))}}function Pw(t){const e={};t.forEach((t=>{const i=t.groupId||"";t.id=e[i]=e[i]||0,e[i]++}))}class Cw{constructor(t){this.config=void 0,this.keyUriToKeyInfo={},this.emeController=null,this.config=t}abort(t){for(const i in this.keyUriToKeyInfo){const r=this.keyUriToKeyInfo[i].loader;if(r){var e;if(t&&t!==(null==(e=r.context)?void 0:e.frag.type))return;r.abort()}}}detach(){for(const t in this.keyUriToKeyInfo){const e=this.keyUriToKeyInfo[t];(e.mediaKeySessionContext||e.decryptdata.isCommonEncryption)&&delete this.keyUriToKeyInfo[t]}}destroy(){this.detach();for(const t in this.keyUriToKeyInfo){const e=this.keyUriToKeyInfo[t].loader;e&&e.destroy()}this.keyUriToKeyInfo={}}createKeyLoadError(t,e=uu.KEY_LOAD_ERROR,i,r,a){return new ab({type:gu.NETWORK_ERROR,details:e,fatal:!1,frag:t,response:a,error:i,networkDetails:r})}loadClear(t,e){if(this.emeController&&this.config.emeEnabled){const{sn:i,cc:r}=t;for(let t=0;t<e.length;t++){const a=e[t];if(r<=a.cc&&("initSegment"===i||"initSegment"===a.sn||i<a.sn)){this.emeController.selectKeySystemFormat(a).then((t=>{a.setKeyFormat(t)}));break}}}}load(t){return!t.decryptdata&&t.encrypted&&this.emeController&&this.config.emeEnabled?this.emeController.selectKeySystemFormat(t).then((e=>this.loadInternal(t,e))):this.loadInternal(t)}loadInternal(t,e){var i,r;e&&t.setKeyFormat(e);const a=t.decryptdata;if(!a){const i=new Error(e?`Expected frag.decryptdata to be defined after setting format ${e}`:"Missing decryption data on fragment in onKeyLoading");return Promise.reject(this.createKeyLoadError(t,uu.KEY_LOAD_ERROR,i))}const s=a.uri;if(!s)return Promise.reject(this.createKeyLoadError(t,uu.KEY_LOAD_ERROR,new Error(`Invalid key URI: "${s}"`)));let n=this.keyUriToKeyInfo[s];if(null!=(i=n)&&i.decryptdata.key)return a.key=n.decryptdata.key,Promise.resolve({frag:t,keyInfo:n});var o;if(null!=(r=n)&&r.keyLoadPromise)switch(null==(o=n.mediaKeySessionContext)?void 0:o.keyStatus){case void 0:case"status-pending":case"usable":case"usable-in-future":return n.keyLoadPromise.then((e=>(a.key=e.keyInfo.decryptdata.key,{frag:t,keyInfo:n})))}switch(n=this.keyUriToKeyInfo[s]={decryptdata:a,keyLoadPromise:null,loader:null,mediaKeySessionContext:null},a.method){case"ISO-23001-7":case"SAMPLE-AES":case"SAMPLE-AES-CENC":case"SAMPLE-AES-CTR":return"identity"===a.keyFormat?this.loadKeyHTTP(n,t):this.loadKeyEME(n,t);case"AES-128":return this.loadKeyHTTP(n,t);default:return Promise.reject(this.createKeyLoadError(t,uu.KEY_LOAD_ERROR,new Error(`Key supplied with unsupported METHOD: "${a.method}"`)))}}loadKeyEME(t,e){const i={frag:e,keyInfo:t};if(this.emeController&&this.config.emeEnabled){const e=this.emeController.loadKey(i);if(e)return(t.keyLoadPromise=e.then((e=>(t.mediaKeySessionContext=e,i)))).catch((e=>{throw t.keyLoadPromise=null,e}))}return Promise.resolve(i)}loadKeyHTTP(t,e){const i=this.config,r=new(0,i.loader)(i);return e.keyLoader=t.loader=r,t.keyLoadPromise=new Promise(((a,s)=>{const n={keyInfo:t,frag:e,responseType:"arraybuffer",url:t.decryptdata.uri},o=i.keyLoadPolicy.default,c={loadPolicy:o,timeout:o.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0},l={onSuccess:(t,e,i,r)=>{const{frag:n,keyInfo:o,url:c}=i;if(!n.decryptdata||o!==this.keyUriToKeyInfo[c])return s(this.createKeyLoadError(n,uu.KEY_LOAD_ERROR,new Error("after key load, decryptdata unset or changed"),r));o.decryptdata.key=n.decryptdata.key=new Uint8Array(t.data),n.keyLoader=null,o.loader=null,a({frag:n,keyInfo:o})},onError:(t,i,r,a)=>{this.resetLoader(i),s(this.createKeyLoadError(e,uu.KEY_LOAD_ERROR,new Error(`HTTP Error ${t.code} loading key ${t.text}`),r,su({url:n.url,data:void 0},t)))},onTimeout:(t,i,r)=>{this.resetLoader(i),s(this.createKeyLoadError(e,uu.KEY_LOAD_TIMEOUT,new Error("key loading timed out"),r))},onAbort:(t,i,r)=>{this.resetLoader(i),s(this.createKeyLoadError(e,uu.INTERNAL_ABORTED,new Error("key loading aborted"),r))}};r.load(n,c,l)}))}resetLoader(t){const{frag:e,keyInfo:i,url:r}=t,a=i.loader;e.keyLoader===a&&(e.keyLoader=null,i.loader=null),delete this.keyUriToKeyInfo[r],a&&a.destroy()}}function Ew(){return self.SourceBuffer||self.WebKitSourceBuffer}function Tw(){if(!Jf())return!1;const t=Ew();return!t||t.prototype&&"function"==typeof t.prototype.appendBuffer&&"function"==typeof t.prototype.remove}class Lw{constructor(t,e,i,r){this.config=void 0,this.media=null,this.fragmentTracker=void 0,this.hls=void 0,this.nudgeRetry=0,this.stallReported=!1,this.stalled=null,this.moved=!1,this.seeking=!1,this.config=t,this.media=e,this.fragmentTracker=i,this.hls=r}destroy(){this.media=null,this.hls=this.fragmentTracker=null}poll(t,e){const{config:i,media:r,stalled:a}=this;if(null===r)return;const{currentTime:s,seeking:n}=r,o=this.seeking&&!n,c=!this.seeking&&n;if(this.seeking=n,s!==t){if(this.moved=!0,n||(this.nudgeRetry=0),null!==a){if(this.stallReported){const t=self.performance.now()-a;ku.warn(`playback not stuck anymore @${s}, after ${Math.round(t)}ms`),this.stallReported=!1}this.stalled=null}return}if(c||o)return void(this.stalled=null);if(r.paused&&!n||r.ended||0===r.playbackRate||!Kv.getBuffered(r).length)return void(this.nudgeRetry=0);const l=Kv.bufferInfo(r,s,0),d=l.nextStart||0;if(n){const t=l.len>2,i=!d||e&&e.start<=s||d-s>2&&!this.fragmentTracker.getPartialFragment(s);if(t||i)return;this.moved=!1}if(!this.moved&&null!==this.stalled){var h;if(!(l.len>0)&&!d)return;const t=Math.max(d,l.start||0)-s,e=this.hls.levels?this.hls.levels[this.hls.currentLevel]:null,i=(null==e||null==(h=e.details)?void 0:h.live)?2*e.details.targetduration:2,a=this.fragmentTracker.getPartialFragment(s);if(t>0&&(t<=i||a))return void(r.paused||this._trySkipBufferHole(a))}const p=self.performance.now();if(null===a)return void(this.stalled=p);const g=p-a;if(!n&&g>=250&&(this._reportStall(l),!this.media))return;const u=Kv.bufferInfo(r,s,i.maxBufferHole);this._tryFixBufferStall(u,g)}_tryFixBufferStall(t,e){const{config:i,fragmentTracker:r,media:a}=this;if(null===a)return;const s=a.currentTime,n=r.getPartialFragment(s);if(n){if(this._trySkipBufferHole(n)||!this.media)return}(t.len>i.maxBufferHole||t.nextStart&&t.nextStart-s<i.maxBufferHole)&&e>1e3*i.highBufferWatchdogPeriod&&(ku.warn("Trying to nudge playhead over buffer-hole"),this.stalled=null,this._tryNudgeBuffer())}_reportStall(t){const{hls:e,media:i,stallReported:r}=this;if(!r&&i){this.stallReported=!0;const r=new Error(`Playback stalling at @${i.currentTime} due to low buffer (${JSON.stringify(t)})`);ku.warn(r.message),e.trigger(pu.ERROR,{type:gu.MEDIA_ERROR,details:uu.BUFFER_STALLED_ERROR,fatal:!1,error:r,buffer:t.len})}}_trySkipBufferHole(t){const{config:e,hls:i,media:r}=this;if(null===r)return 0;const a=r.currentTime,s=Kv.bufferInfo(r,a,0),n=a<s.start?s.start:s.nextStart;if(n){const o=s.len<=e.maxBufferHole,c=s.len>0&&s.len<1&&r.readyState<3,l=n-a;if(l>0&&(o||c)){if(l>e.maxBufferHole){const{fragmentTracker:e}=this;let i=!1;if(0===a){const t=e.getAppendedFrag(0,Em);t&&n<t.end&&(i=!0)}if(!i){const i=t||e.getAppendedFrag(a,Em);if(i){let t=!1,r=i.end;for(;r<n;){const i=e.getPartialFragment(r);if(!i){t=!0;break}r+=i.duration}if(t)return 0}}}const s=Math.max(n+.05,a+.1);if(ku.warn(`skipping hole, adjusting currentTime from ${a} to ${s}`),this.moved=!0,this.stalled=null,r.currentTime=s,t&&!t.gap){const e=new Error(`fragment loaded with buffer holes, seeking from ${a} to ${s}`);i.trigger(pu.ERROR,{type:gu.MEDIA_ERROR,details:uu.BUFFER_SEEK_OVER_HOLE,fatal:!1,error:e,reason:e.message,frag:t})}return s}}return 0}_tryNudgeBuffer(){const{config:t,hls:e,media:i,nudgeRetry:r}=this;if(null===i)return;const a=i.currentTime;if(this.nudgeRetry++,r<t.nudgeMaxRetry){const s=a+(r+1)*t.nudgeOffset,n=new Error(`Nudging 'currentTime' from ${a} to ${s}`);ku.warn(n.message),i.currentTime=s,e.trigger(pu.ERROR,{type:gu.MEDIA_ERROR,details:uu.BUFFER_NUDGE_ON_STALL,error:n,fatal:!1})}else{const i=new Error(`Playhead still not moving while enough data buffered @${a} after ${t.nudgeMaxRetry} nudges`);ku.error(i.message),e.trigger(pu.ERROR,{type:gu.MEDIA_ERROR,details:uu.BUFFER_STALLED_ERROR,error:i,fatal:!0})}}}class _w extends xb{constructor(t,e,i){super(t,e,i,"[stream-controller]",Em),this.audioCodecSwap=!1,this.gapController=null,this.level=-1,this._forceStartLoad=!1,this.altAudio=!1,this.audioOnly=!1,this.fragPlaying=null,this.onvplaying=null,this.onvseeked=null,this.fragLastKbps=0,this.couldBacktrack=!1,this.backtrackFragment=null,this.audioCodecSwitch=!1,this.videoBuffer=null,this._registerListeners()}_registerListeners(){const{hls:t}=this;t.on(pu.MEDIA_ATTACHED,this.onMediaAttached,this),t.on(pu.MEDIA_DETACHING,this.onMediaDetaching,this),t.on(pu.MANIFEST_LOADING,this.onManifestLoading,this),t.on(pu.MANIFEST_PARSED,this.onManifestParsed,this),t.on(pu.LEVEL_LOADING,this.onLevelLoading,this),t.on(pu.LEVEL_LOADED,this.onLevelLoaded,this),t.on(pu.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),t.on(pu.ERROR,this.onError,this),t.on(pu.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),t.on(pu.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),t.on(pu.BUFFER_CREATED,this.onBufferCreated,this),t.on(pu.BUFFER_FLUSHED,this.onBufferFlushed,this),t.on(pu.LEVELS_UPDATED,this.onLevelsUpdated,this),t.on(pu.FRAG_BUFFERED,this.onFragBuffered,this)}_unregisterListeners(){const{hls:t}=this;t.off(pu.MEDIA_ATTACHED,this.onMediaAttached,this),t.off(pu.MEDIA_DETACHING,this.onMediaDetaching,this),t.off(pu.MANIFEST_LOADING,this.onManifestLoading,this),t.off(pu.MANIFEST_PARSED,this.onManifestParsed,this),t.off(pu.LEVEL_LOADED,this.onLevelLoaded,this),t.off(pu.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),t.off(pu.ERROR,this.onError,this),t.off(pu.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),t.off(pu.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),t.off(pu.BUFFER_CREATED,this.onBufferCreated,this),t.off(pu.BUFFER_FLUSHED,this.onBufferFlushed,this),t.off(pu.LEVELS_UPDATED,this.onLevelsUpdated,this),t.off(pu.FRAG_BUFFERED,this.onFragBuffered,this)}onHandlerDestroying(){this._unregisterListeners(),super.onHandlerDestroying()}startLoad(t){if(this.levels){const{lastCurrentTime:e,hls:i}=this;if(this.stopLoad(),this.setInterval(100),this.level=-1,!this.startFragRequested){let t=i.startLevel;-1===t&&(i.config.testBandwidth&&this.levels.length>1?(t=0,this.bitrateTest=!0):t=i.firstAutoLevel),i.nextLoadLevel=t,this.level=i.loadLevel,this.loadedmetadata=!1}e>0&&-1===t&&(this.log(`Override startPosition with lastCurrentTime @${e.toFixed(3)}`),t=e),this.state=hb,this.nextLoadPosition=this.startPosition=this.lastCurrentTime=t,this.tick()}else this._forceStartLoad=!0,this.state=db}stopLoad(){this._forceStartLoad=!1,super.stopLoad()}doTick(){switch(this.state){case wb:{const{levels:t,level:e}=this,i=null==t?void 0:t[e],r=null==i?void 0:i.details;if(r&&(!r.live||this.levelLastLoaded===i)){if(this.waitForCdnTuneIn(r))break;this.state=hb;break}if(this.hls.nextLoadLevel!==this.level){this.state=hb;break}break}case ub:{var t;const e=self.performance.now(),i=this.retryDate;if(!i||e>=i||null!=(t=this.media)&&t.seeking){const{levels:t,level:e}=this,i=null==t?void 0:t[e];this.resetStartWhenNotLoaded(i||null),this.state=hb}}}this.state===hb&&this.doTickIdle(),this.onTickEnd()}onTickEnd(){super.onTickEnd(),this.checkBuffer(),this.checkFragmentChanged()}doTickIdle(){const{hls:t,levelLastLoaded:e,levels:i,media:r}=this;if(null===e||!r&&(this.startFragRequested||!t.config.startFragPrefetch))return;if(this.altAudio&&this.audioOnly)return;const a=this.buffering?t.nextLoadLevel:t.loadLevel;if(null==i||!i[a])return;const s=i[a],n=this.getMainFwdBufferInfo();if(null===n)return;const o=this.getLevelDetails();if(o&&this._streamEnded(n,o)){const t={};return this.altAudio&&(t.type="video"),this.hls.trigger(pu.BUFFER_EOS,t),void(this.state=bb)}if(!this.buffering)return;t.loadLevel!==a&&-1===t.manualLevel&&this.log(`Adapting to level ${a} from level ${this.level}`),this.level=t.nextLoadLevel=a;const c=s.details;if(!c||this.state===wb||c.live&&this.levelLastLoaded!==s)return this.level=a,void(this.state=wb);const l=n.len,d=this.getMaxBufferLength(s.maxBitrate);if(l>=d)return;this.backtrackFragment&&this.backtrackFragment.start>n.end&&(this.backtrackFragment=null);const h=this.backtrackFragment?this.backtrackFragment.start:n.end;let p=this.getNextFragment(h,c);if(this.couldBacktrack&&!this.fragPrevious&&p&&"initSegment"!==p.sn&&this.fragmentTracker.getState(p)!==Bv){var g;const t=(null!=(g=this.backtrackFragment)?g:p).sn-c.startSN,e=c.fragments[t-1];e&&p.cc===e.cc&&(p=e,this.fragmentTracker.removeFragment(e))}else this.backtrackFragment&&n.len&&(this.backtrackFragment=null);if(p&&this.isLoopLoading(p,h)){if(!p.gap){const t=this.audioOnly&&!this.altAudio?Eu:Tu,e=(t===Tu?this.videoBuffer:this.mediaBuffer)||this.media;e&&this.afterBufferFlushed(e,t,Em)}p=this.getNextFragmentLoopLoading(p,c,n,Em,d)}p&&(!p.initSegment||p.initSegment.data||this.bitrateTest||(p=p.initSegment),this.loadFragment(p,s,h))}loadFragment(t,e,i){const r=this.fragmentTracker.getState(t);this.fragCurrent=t,r===jv||r===Nv?"initSegment"===t.sn?this._loadInitSegment(t,e):this.bitrateTest?(this.log(`Fragment ${t.sn} of level ${t.level} is being downloaded to test bitrate and will not be buffered`),this._loadBitrateTestFrag(t,e)):(this.startFragRequested=!0,super.loadFragment(t,e,i)):this.clearTrackerIfNeeded(t)}getBufferedFrag(t){return this.fragmentTracker.getBufferedFrag(t,Em)}followingBufferedFrag(t){return t?this.getBufferedFrag(t.end+.5):null}immediateLevelSwitch(){this.abortCurrentFrag(),this.flushMainBuffer(0,Number.POSITIVE_INFINITY)}nextLevelSwitch(){const{levels:t,media:e}=this;if(null!=e&&e.readyState){let i;const r=this.getAppendedFrag(e.currentTime);r&&r.start>1&&this.flushMainBuffer(0,r.start-1);const a=this.getLevelDetails();if(null!=a&&a.live){const t=this.getMainFwdBufferInfo();if(!t||t.len<2*a.targetduration)return}if(!e.paused&&t){const e=t[this.hls.nextLoadLevel],r=this.fragLastKbps;i=r&&this.fragCurrent?this.fragCurrent.duration*e.maxBitrate/(1e3*r)+1:0}else i=0;const s=this.getBufferedFrag(e.currentTime+i);if(s){const t=this.followingBufferedFrag(s);if(t){this.abortCurrentFrag();const e=t.maxStartPTS?t.maxStartPTS:t.start,i=t.duration,r=Math.max(s.end,e+Math.min(Math.max(i-this.config.maxFragLookUpTolerance,i*(this.couldBacktrack?.5:.125)),i*(this.couldBacktrack?.75:.25)));this.flushMainBuffer(r,Number.POSITIVE_INFINITY)}}}}abortCurrentFrag(){const t=this.fragCurrent;switch(this.fragCurrent=null,this.backtrackFragment=null,t&&(t.abortRequests(),this.fragmentTracker.removeFragment(t)),this.state){case pb:case gb:case ub:case mb:case vb:this.state=hb}this.nextLoadPosition=this.getLoadPosition()}flushMainBuffer(t,e){super.flushMainBuffer(t,e,this.altAudio?"video":null)}onMediaAttached(t,e){super.onMediaAttached(t,e);const i=e.media;this.onvplaying=this.onMediaPlaying.bind(this),this.onvseeked=this.onMediaSeeked.bind(this),i.addEventListener("playing",this.onvplaying),i.addEventListener("seeked",this.onvseeked),this.gapController=new Lw(this.config,i,this.fragmentTracker,this.hls)}onMediaDetaching(){const{media:t}=this;t&&this.onvplaying&&this.onvseeked&&(t.removeEventListener("playing",this.onvplaying),t.removeEventListener("seeked",this.onvseeked),this.onvplaying=this.onvseeked=null,this.videoBuffer=null),this.fragPlaying=null,this.gapController&&(this.gapController.destroy(),this.gapController=null),super.onMediaDetaching()}onMediaPlaying(){this.tick()}onMediaSeeked(){const t=this.media,e=t?t.currentTime:null;lu(e)&&this.log(`Media seeked to ${e.toFixed(3)}`);const i=this.getMainFwdBufferInfo();null!==i&&0!==i.len?this.tick():this.warn(`Main forward buffer length on "seeked" event ${i?i.len:"empty"})`)}onManifestLoading(){this.log("Trigger BUFFER_RESET"),this.hls.trigger(pu.BUFFER_RESET,void 0),this.fragmentTracker.removeAllFragments(),this.couldBacktrack=!1,this.startPosition=this.lastCurrentTime=this.fragLastKbps=0,this.levels=this.fragPlaying=this.backtrackFragment=this.levelLastLoaded=null,this.altAudio=this.audioOnly=this.startFragRequested=!1}onManifestParsed(t,e){let i=!1,r=!1;e.levels.forEach((t=>{const e=t.audioCodec;e&&(i=i||-1!==e.indexOf("mp4a.40.2"),r=r||-1!==e.indexOf("mp4a.40.5"))})),this.audioCodecSwitch=i&&r&&!function(){var t;const e=Ew();return"function"==typeof(null==e||null==(t=e.prototype)?void 0:t.changeType)}(),this.audioCodecSwitch&&this.log("Both AAC/HE-AAC audio found in levels; declaring level codec as HE-AAC"),this.levels=e.levels,this.startFragRequested=!1}onLevelLoading(t,e){const{levels:i}=this;if(!i||this.state!==hb)return;const r=i[e.level];(!r.details||r.details.live&&this.levelLastLoaded!==r||this.waitForCdnTuneIn(r.details))&&(this.state=wb)}onLevelLoaded(t,e){var i;const{levels:r}=this,a=e.level,s=e.details,n=s.totalduration;if(!r)return void this.warn(`Levels were reset while loading level ${a}`);this.log(`Level ${a} loaded [${s.startSN},${s.endSN}]${s.lastPartSn?`[part-${s.lastPartSn}-${s.lastPartIndex}]`:""}, cc [${s.startCC}, ${s.endCC}] duration:${n}`);const o=r[a],c=this.fragCurrent;!c||this.state!==gb&&this.state!==ub||c.level!==e.level&&c.loader&&this.abortCurrentFrag();let l=0;if(s.live||null!=(i=o.details)&&i.live){var d;if(this.checkLiveUpdate(s),s.deltaUpdateFailed)return;l=this.alignPlaylists(s,o.details,null==(d=this.levelLastLoaded)?void 0:d.details)}if(o.details=s,this.levelLastLoaded=o,this.hls.trigger(pu.LEVEL_UPDATED,{details:s,level:a}),this.state===wb){if(this.waitForCdnTuneIn(s))return;this.state=hb}this.startFragRequested?s.live&&this.synchronizeToLiveEdge(s):this.setStartPosition(s,l),this.tick()}_handleFragmentLoadProgress(t){var e;const{frag:i,part:r,payload:a}=t,{levels:s}=this;if(!s)return void this.warn(`Levels were reset while fragment load was in progress. Fragment ${i.sn} of level ${i.level} will not be buffered`);const n=s[i.level],o=n.details;if(!o)return this.warn(`Dropping fragment ${i.sn} of level ${i.level} after level details were reset`),void this.fragmentTracker.removeFragment(i);const c=n.videoCodec,l=o.PTSKnown||!o.live,d=null==(e=i.initSegment)?void 0:e.data,h=this._getAudioCodec(n),p=this.transmuxer=this.transmuxer||new _k(this.hls,Em,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)),g=r?r.index:-1,u=-1!==g,f=new Wv(i.level,i.sn,i.stats.chunkCount,a.byteLength,g,u),m=this.initPTS[i.cc];p.push(a,d,h,c,i,r,o.totalduration,l,f,m)}onAudioTrackSwitching(t,e){const i=this.altAudio;if(!!!e.url){if(this.mediaBuffer!==this.media){this.log("Switching on main audio, use media.buffered to schedule main fragment loading"),this.mediaBuffer=this.media;const t=this.fragCurrent;t&&(this.log("Switching to main audio track, cancel main fragment load"),t.abortRequests(),this.fragmentTracker.removeFragment(t)),this.resetTransmuxer(),this.resetLoadingState()}else this.audioOnly&&this.resetTransmuxer();const t=this.hls;i&&(t.trigger(pu.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:null}),this.fragmentTracker.removeAllFragments()),t.trigger(pu.AUDIO_TRACK_SWITCHED,e)}}onAudioTrackSwitched(t,e){const i=e.id,r=!!this.hls.audioTracks[i].url;if(r){const t=this.videoBuffer;t&&this.mediaBuffer!==t&&(this.log("Switching on alternate audio, use video.buffered to schedule main fragment loading"),this.mediaBuffer=t)}this.altAudio=r,this.tick()}onBufferCreated(t,e){const i=e.tracks;let r,a,s=!1;for(const t in i){const e=i[t];if("main"===e.id){if(a=t,r=e,"video"===t){const e=i[t];e&&(this.videoBuffer=e.buffer)}}else s=!0}s&&r?(this.log(`Alternate track found, use ${a}.buffered to schedule main fragment loading`),this.mediaBuffer=r.buffer):this.mediaBuffer=this.media}onFragBuffered(t,e){const{frag:i,part:r}=e;if(i&&i.type!==Em)return;if(this.fragContextChanged(i))return this.warn(`Fragment ${i.sn}${r?" p: "+r.index:""} of level ${i.level} finished buffering, but was aborted. state: ${this.state}`),void(this.state===vb&&(this.state=hb));const a=r?r.stats:i.stats;this.fragLastKbps=Math.round(8*a.total/(a.buffering.end-a.loading.first)),"initSegment"!==i.sn&&(this.fragPrevious=i),this.fragBufferedComplete(i,r)}onError(t,e){var i;if(e.fatal)this.state=kb;else switch(e.details){case uu.FRAG_GAP:case uu.FRAG_PARSING_ERROR:case uu.FRAG_DECRYPT_ERROR:case uu.FRAG_LOAD_ERROR:case uu.FRAG_LOAD_TIMEOUT:case uu.KEY_LOAD_ERROR:case uu.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(Em,e);break;case uu.LEVEL_LOAD_ERROR:case uu.LEVEL_LOAD_TIMEOUT:case uu.LEVEL_PARSING_ERROR:e.levelRetry||this.state!==wb||(null==(i=e.context)?void 0:i.type)!==Sm||(this.state=hb);break;case uu.BUFFER_APPEND_ERROR:case uu.BUFFER_FULL_ERROR:if(!e.parent||"main"!==e.parent)return;if(e.details===uu.BUFFER_APPEND_ERROR)return void this.resetLoadingState();this.reduceLengthAndFlushBuffer(e)&&this.flushMainBuffer(0,Number.POSITIVE_INFINITY);break;case uu.INTERNAL_EXCEPTION:this.recoverWorkerError(e)}}checkBuffer(){const{media:t,gapController:e}=this;if(t&&e&&t.readyState){if(this.loadedmetadata||!Kv.getBuffered(t).length){const t=this.state!==hb?this.fragCurrent:null;e.poll(this.lastCurrentTime,t)}this.lastCurrentTime=t.currentTime}}onFragLoadEmergencyAborted(){this.state=hb,this.loadedmetadata||(this.startFragRequested=!1,this.nextLoadPosition=this.startPosition),this.tickImmediate()}onBufferFlushed(t,{type:e}){if(e!==Eu||this.audioOnly&&!this.altAudio){const t=(e===Tu?this.videoBuffer:this.mediaBuffer)||this.media;this.afterBufferFlushed(t,e,Em),this.tick()}}onLevelsUpdated(t,e){this.level>-1&&this.fragCurrent&&(this.level=this.fragCurrent.level),this.levels=e.levels}swapAudioCodec(){this.audioCodecSwap=!this.audioCodecSwap}seekToStartPos(){const{media:t}=this;if(!t)return;const e=t.currentTime;let i=this.startPosition;if(i>=0&&e<i){if(t.seeking)return void this.log(`could not seek to ${i}, already seeking at ${e}`);const r=Kv.getBuffered(t),a=(r.length?r.start(0):0)-i;a>0&&(a<this.config.maxBufferHole||a<this.config.maxFragLookUpTolerance)&&(this.log(`adjusting start position by ${a} to match buffer start`),i+=a,this.startPosition=i),this.log(`seek to target start position ${i} from current time ${e}`),t.currentTime=i}}_getAudioCodec(t){let e=this.config.defaultAudioCodec||t.audioCodec;return this.audioCodecSwap&&e&&(this.log("Swapping audio codec"),e=-1!==e.indexOf("mp4a.40.5")?"mp4a.40.2":"mp4a.40.5"),e}_loadBitrateTestFrag(t,e){t.bitrateTest=!0,this._doFragLoad(t,e).then((i=>{const{hls:r}=this;if(!i||this.fragContextChanged(t))return;e.fragmentError=0,this.state=hb,this.startFragRequested=!1,this.bitrateTest=!1;const a=t.stats;a.parsing.start=a.parsing.end=a.buffering.start=a.buffering.end=self.performance.now(),r.trigger(pu.FRAG_LOADED,i),t.bitrateTest=!1}))}_handleTransmuxComplete(t){var e;const i="main",{hls:r}=this,{remuxResult:a,chunkMeta:s}=t,n=this.getCurrentContext(s);if(!n)return void this.resetWhenMissingContext(s);const{frag:o,part:c,level:l}=n,{video:d,text:h,id3:p,initSegment:g}=a,{details:u}=l,f=this.altAudio?void 0:a.audio;if(this.fragContextChanged(o))this.fragmentTracker.removeFragment(o);else{if(this.state=mb,g){if(null!=g&&g.tracks){const t=o.initSegment||o;this._bufferInitSegment(l,g.tracks,t,s),r.trigger(pu.FRAG_PARSING_INIT_SEGMENT,{frag:t,id:i,tracks:g.tracks})}const t=g.initPTS,e=g.timescale;lu(t)&&(this.initPTS[o.cc]={baseTime:t,timescale:e},r.trigger(pu.INIT_PTS_FOUND,{frag:o,id:i,initPTS:t,timescale:e}))}if(d&&u&&"initSegment"!==o.sn){const t=u.fragments[o.sn-1-u.startSN],e=o.sn===u.startSN,i=!t||o.cc>t.cc;if(!1!==a.independent){const{startPTS:t,endPTS:r,startDTS:a,endDTS:n}=d;if(c)c.elementaryStreams[d.type]={startPTS:t,endPTS:r,startDTS:a,endDTS:n};else if(d.firstKeyFrame&&d.independent&&1===s.id&&!i&&(this.couldBacktrack=!0),d.dropped&&d.independent){const a=this.getMainFwdBufferInfo(),s=(a?a.end:this.getLoadPosition())+this.config.maxBufferHole,c=d.firstKeyFramePTS?d.firstKeyFramePTS:t;if(!e&&s<c-this.config.maxBufferHole&&!i)return void this.backtrack(o);i&&(o.gap=!0),o.setElementaryStreamInfo(d.type,o.start,r,o.start,n,!0)}else e&&t>2&&(o.gap=!0);o.setElementaryStreamInfo(d.type,t,r,a,n),this.backtrackFragment&&(this.backtrackFragment=o),this.bufferFragmentData(d,o,c,s,e||i)}else{if(!e&&!i)return void this.backtrack(o);o.gap=!0}}if(f){const{startPTS:t,endPTS:e,startDTS:i,endDTS:r}=f;c&&(c.elementaryStreams[Eu]={startPTS:t,endPTS:e,startDTS:i,endDTS:r}),o.setElementaryStreamInfo(Eu,t,e,i,r),this.bufferFragmentData(f,o,c,s)}if(u&&null!=p&&null!=(e=p.samples)&&e.length){const t={id:i,frag:o,details:u,samples:p.samples};r.trigger(pu.FRAG_PARSING_METADATA,t)}if(u&&h){const t={id:i,frag:o,details:u,samples:h.samples};r.trigger(pu.FRAG_PARSING_USERDATA,t)}}}_bufferInitSegment(t,e,i,r){if(this.state!==mb)return;this.audioOnly=!!e.audio&&!e.video,this.altAudio&&!this.audioOnly&&delete e.audio;const{audio:a,video:s,audiovideo:n}=e;if(a){let e=t.audioCodec;const i=navigator.userAgent.toLowerCase();if(this.audioCodecSwitch){e&&(e=-1!==e.indexOf("mp4a.40.5")?"mp4a.40.2":"mp4a.40.5");const t=a.metadata;t&&"channelCount"in t&&1!==(t.channelCount||1)&&-1===i.indexOf("firefox")&&(e="mp4a.40.5")}e&&-1!==e.indexOf("mp4a.40.5")&&-1!==i.indexOf("android")&&"audio/mpeg"!==a.container&&(e="mp4a.40.2",this.log(`Android: force audio codec to ${e}`)),t.audioCodec&&t.audioCodec!==e&&this.log(`Swapping manifest audio codec "${t.audioCodec}" for "${e}"`),a.levelCodec=e,a.id="main",this.log(`Init audio buffer, container:${a.container}, codecs[selected/level/parsed]=[${e||""}/${t.audioCodec||""}/${a.codec}]`)}s&&(s.levelCodec=t.videoCodec,s.id="main",this.log(`Init video buffer, container:${s.container}, codecs[level/parsed]=[${t.videoCodec||""}/${s.codec}]`)),n&&this.log(`Init audiovideo buffer, container:${n.container}, codecs[level/parsed]=[${t.codecs}/${n.codec}]`),this.hls.trigger(pu.BUFFER_CODECS,e),Object.keys(e).forEach((t=>{const a=e[t].initSegment;null!=a&&a.byteLength&&this.hls.trigger(pu.BUFFER_APPENDING,{type:t,data:a,frag:i,part:null,chunkMeta:r,parent:i.type})})),this.tickImmediate()}getMainFwdBufferInfo(){return this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:this.media,Em)}backtrack(t){this.couldBacktrack=!0,this.backtrackFragment=t,this.resetTransmuxer(),this.flushBufferGap(t),this.fragmentTracker.removeFragment(t),this.fragPrevious=null,this.nextLoadPosition=t.start,this.state=hb}checkFragmentChanged(){const t=this.media;let e=null;if(t&&t.readyState>1&&!1===t.seeking){const i=t.currentTime;if(Kv.isBuffered(t,i)?e=this.getAppendedFrag(i):Kv.isBuffered(t,i+.1)&&(e=this.getAppendedFrag(i+.1)),e){this.backtrackFragment=null;const t=this.fragPlaying,i=e.level;t&&e.sn===t.sn&&t.level===i||(this.fragPlaying=e,this.hls.trigger(pu.FRAG_CHANGED,{frag:e}),t&&t.level===i||this.hls.trigger(pu.LEVEL_SWITCHED,{level:i}))}}}get nextLevel(){const t=this.nextBufferedFrag;return t?t.level:-1}get currentFrag(){const t=this.media;return t?this.fragPlaying||this.getAppendedFrag(t.currentTime):null}get currentProgramDateTime(){const t=this.media;if(t){const e=t.currentTime,i=this.currentFrag;if(i&&lu(e)&&lu(i.programDateTime)){const t=i.programDateTime+1e3*(e-i.start);return new Date(t)}}return null}get currentLevel(){const t=this.currentFrag;return t?t.level:-1}get nextBufferedFrag(){const t=this.currentFrag;return t?this.followingBufferedFrag(t):null}get forceStartLoad(){return this._forceStartLoad}}class Rw{static get version(){return"1.5.20"}static isMSESupported(){return Tw()}static isSupported(){return function(){if(!Tw())return!1;const t=Jf();return"function"==typeof(null==t?void 0:t.isTypeSupported)&&(["avc1.42E01E,mp4a.40.2","av01.0.01M.08","vp09.00.50.08"].some((e=>t.isTypeSupported(im(e,"video"))))||["mp4a.40.2","fLaC"].some((e=>t.isTypeSupported(im(e,"audio")))))}()}static getMediaSource(){return Jf()}static get Events(){return pu}static get ErrorTypes(){return gu}static get ErrorDetails(){return uu}static get DefaultConfig(){return Rw.defaultConfig?Rw.defaultConfig:kw}static set DefaultConfig(t){Rw.defaultConfig=t}constructor(t={}){this.config=void 0,this.userConfig=void 0,this.coreComponents=void 0,this.networkControllers=void 0,this.started=!1,this._emitter=new Lk,this._autoLevelCapping=-1,this._maxHdcpLevel=null,this.abrController=void 0,this.bufferController=void 0,this.capLevelController=void 0,this.latencyController=void 0,this.levelController=void 0,this.streamController=void 0,this.audioTrackController=void 0,this.subtitleTrackController=void 0,this.emeController=void 0,this.cmcdController=void 0,this._media=null,this.url=null,this.triggeringException=void 0,function(t,e){if("object"==typeof console&&!0===t||"object"==typeof t){bu(t,"debug","log","info","warn","error");try{vu.log(`Debug logs enabled for "${e}" in hls.js version 1.5.20`)}catch(t){vu=mu}}else vu=mu}(t.debug||!1,"Hls instance");const e=this.config=function(t,e){if((e.liveSyncDurationCount||e.liveMaxLatencyDurationCount)&&(e.liveSyncDuration||e.liveMaxLatencyDuration))throw new Error("Illegal hls.js config: don't mix up liveSyncDurationCount/liveMaxLatencyDurationCount and liveSyncDuration/liveMaxLatencyDuration");if(void 0!==e.liveMaxLatencyDurationCount&&(void 0===e.liveSyncDurationCount||e.liveMaxLatencyDurationCount<=e.liveSyncDurationCount))throw new Error('Illegal hls.js config: "liveMaxLatencyDurationCount" must be greater than "liveSyncDurationCount"');if(void 0!==e.liveMaxLatencyDuration&&(void 0===e.liveSyncDuration||e.liveMaxLatencyDuration<=e.liveSyncDuration))throw new Error('Illegal hls.js config: "liveMaxLatencyDuration" must be greater than "liveSyncDuration"');const i=yw(t),r=["TimeOut","MaxRetry","RetryDelay","MaxRetryTimeout"];return["manifest","level","frag"].forEach((t=>{const a=`${"level"===t?"playlist":t}LoadPolicy`,s=void 0===e[a],n=[];r.forEach((r=>{const o=`${t}Loading${r}`,c=e[o];if(void 0!==c&&s){n.push(o);const t=i[a].default;switch(e[a]={default:t},r){case"TimeOut":t.maxLoadTimeMs=c,t.maxTimeToFirstByteMs=c;break;case"MaxRetry":t.errorRetry.maxNumRetry=c,t.timeoutRetry.maxNumRetry=c;break;case"RetryDelay":t.errorRetry.retryDelayMs=c,t.timeoutRetry.retryDelayMs=c;break;case"MaxRetryTimeout":t.errorRetry.maxRetryDelayMs=c,t.timeoutRetry.maxRetryDelayMs=c}}})),n.length&&ku.warn(`hls.js config: "${n.join('", "')}" setting(s) are deprecated, use "${a}": ${JSON.stringify(e[a])}`)})),su(su({},i),e)}(Rw.DefaultConfig,t);this.userConfig=t,e.progressive&&ww(e);const{abrController:i,bufferController:r,capLevelController:a,errorController:s,fpsController:n}=e,o=new s(this),c=this.abrController=new i(this),l=this.bufferController=new r(this),d=this.capLevelController=new a(this),h=new n(this),p=new Am(this),g=new Gm(this),u=e.contentSteeringController,f=u?new u(this):null,m=this.levelController=new Sw(this,f),v=new Hv(this),b=new Cw(this.config),k=this.streamController=new _w(this,v,b);d.setStreamController(k),h.setStreamController(k);const y=[p,m,k];f&&y.splice(1,0,f),this.networkControllers=y;const w=[c,l,d,h,g,v];this.audioTrackController=this.createController(e.audioTrackController,y);const x=e.audioStreamController;x&&y.push(new x(this,v,b)),this.subtitleTrackController=this.createController(e.subtitleTrackController,y);const S=e.subtitleStreamController;S&&y.push(new S(this,v,b)),this.createController(e.timelineController,w),b.emeController=this.emeController=this.createController(e.emeController,w),this.cmcdController=this.createController(e.cmcdController,w),this.latencyController=this.createController(Vm,w),this.coreComponents=w,y.push(o);const P=o.onErrorOut;"function"==typeof P&&this.on(pu.ERROR,P,o)}createController(t,e){if(t){const i=new t(this);return e&&e.push(i),i}return null}on(t,e,i=this){this._emitter.on(t,e,i)}once(t,e,i=this){this._emitter.once(t,e,i)}removeAllListeners(t){this._emitter.removeAllListeners(t)}off(t,e,i=this,r){this._emitter.off(t,e,i,r)}listeners(t){return this._emitter.listeners(t)}emit(t,e,i){return this._emitter.emit(t,e,i)}trigger(t,e){if(this.config.debug)return this.emit(t,t,e);try{return this.emit(t,t,e)}catch(e){if(ku.error("An internal error happened while handling event "+t+'. Error message: "'+e.message+'". Here is a stacktrace:',e),!this.triggeringException){this.triggeringException=!0;const i=t===pu.ERROR;this.trigger(pu.ERROR,{type:gu.OTHER_ERROR,details:uu.INTERNAL_EXCEPTION,fatal:i,event:t,error:e}),this.triggeringException=!1}}return!1}listenerCount(t){return this._emitter.listenerCount(t)}destroy(){ku.log("destroy"),this.trigger(pu.DESTROYING,void 0),this.detachMedia(),this.removeAllListeners(),this._autoLevelCapping=-1,this.url=null,this.networkControllers.forEach((t=>t.destroy())),this.networkControllers.length=0,this.coreComponents.forEach((t=>t.destroy())),this.coreComponents.length=0;const t=this.config;t.xhrSetup=t.fetchSetup=void 0,this.userConfig=null}attachMedia(t){ku.log("attachMedia"),this._media=t,this.trigger(pu.MEDIA_ATTACHING,{media:t})}detachMedia(){ku.log("detachMedia"),this.trigger(pu.MEDIA_DETACHING,void 0),this._media=null}loadSource(t){this.stopLoad();const e=this.media,i=this.url,r=this.url=ru.buildAbsoluteURL(self.location.href,t,{alwaysNormalize:!0});this._autoLevelCapping=-1,this._maxHdcpLevel=null,ku.log(`loadSource:${r}`),e&&i&&(i!==r||this.bufferController.hasSourceTypes())&&(this.detachMedia(),this.attachMedia(e)),this.trigger(pu.MANIFEST_LOADING,{url:t})}startLoad(t=-1){ku.log(`startLoad(${t})`),this.started=!0,this.resumeBuffering();for(let e=0;e<this.networkControllers.length&&(this.networkControllers[e].startLoad(t),this.started&&this.networkControllers);e++);}stopLoad(){ku.log("stopLoad"),this.started=!1;for(let t=0;t<this.networkControllers.length&&(this.networkControllers[t].stopLoad(),!this.started&&this.networkControllers);t++);}resumeBuffering(){ku.log("resume buffering"),this.networkControllers.forEach((t=>{t.resumeBuffering&&t.resumeBuffering()}))}pauseBuffering(){ku.log("pause buffering"),this.networkControllers.forEach((t=>{t.pauseBuffering&&t.pauseBuffering()}))}swapAudioCodec(){ku.log("swapAudioCodec"),this.streamController.swapAudioCodec()}recoverMediaError(){ku.log("recoverMediaError");const t=this._media;this.detachMedia(),t&&this.attachMedia(t)}removeLevel(t){this.levelController.removeLevel(t)}get levels(){const t=this.levelController.levels;return t||[]}get currentLevel(){return this.streamController.currentLevel}set currentLevel(t){ku.log(`set currentLevel:${t}`),this.levelController.manualLevel=t,this.streamController.immediateLevelSwitch()}get nextLevel(){return this.streamController.nextLevel}set nextLevel(t){ku.log(`set nextLevel:${t}`),this.levelController.manualLevel=t,this.streamController.nextLevelSwitch()}get loadLevel(){return this.levelController.level}set loadLevel(t){ku.log(`set loadLevel:${t}`),this.levelController.manualLevel=t}get nextLoadLevel(){return this.levelController.nextLoadLevel}set nextLoadLevel(t){this.levelController.nextLoadLevel=t}get firstLevel(){return Math.max(this.levelController.firstLevel,this.minAutoLevel)}set firstLevel(t){ku.log(`set firstLevel:${t}`),this.levelController.firstLevel=t}get startLevel(){const t=this.levelController.startLevel;return-1===t&&this.abrController.forcedAutoLevel>-1?this.abrController.forcedAutoLevel:t}set startLevel(t){ku.log(`set startLevel:${t}`),-1!==t&&(t=Math.max(t,this.minAutoLevel)),this.levelController.startLevel=t}get capLevelToPlayerSize(){return this.config.capLevelToPlayerSize}set capLevelToPlayerSize(t){const e=!!t;e!==this.config.capLevelToPlayerSize&&(e?this.capLevelController.startCapping():(this.capLevelController.stopCapping(),this.autoLevelCapping=-1,this.streamController.nextLevelSwitch()),this.config.capLevelToPlayerSize=e)}get autoLevelCapping(){return this._autoLevelCapping}get bandwidthEstimate(){const{bwEstimator:t}=this.abrController;return t?t.getEstimate():NaN}set bandwidthEstimate(t){this.abrController.resetEstimator(t)}get ttfbEstimate(){const{bwEstimator:t}=this.abrController;return t?t.getEstimateTTFB():NaN}set autoLevelCapping(t){this._autoLevelCapping!==t&&(ku.log(`set autoLevelCapping:${t}`),this._autoLevelCapping=t,this.levelController.checkMaxAutoUpdated())}get maxHdcpLevel(){return this._maxHdcpLevel}set maxHdcpLevel(t){(function(t){return qm.indexOf(t)>-1})(t)&&this._maxHdcpLevel!==t&&(this._maxHdcpLevel=t,this.levelController.checkMaxAutoUpdated())}get autoLevelEnabled(){return-1===this.levelController.manualLevel}get manualLevel(){return this.levelController.manualLevel}get minAutoLevel(){const{levels:t,config:{minAutoBitrate:e}}=this;if(!t)return 0;const i=t.length;for(let r=0;r<i;r++)if(t[r].maxBitrate>=e)return r;return 0}get maxAutoLevel(){const{levels:t,autoLevelCapping:e,maxHdcpLevel:i}=this;let r;if(r=-1===e&&null!=t&&t.length?t.length-1:e,i)for(let e=r;e--;){const r=t[e].attrs["HDCP-LEVEL"];if(r&&r<=i)return e}return r}get firstAutoLevel(){return this.abrController.firstAutoLevel}get nextAutoLevel(){return this.abrController.nextAutoLevel}set nextAutoLevel(t){this.abrController.nextAutoLevel=t}get playingDate(){return this.streamController.currentProgramDateTime}get mainForwardBufferInfo(){return this.streamController.getMainFwdBufferInfo()}setAudioOption(t){var e;return null==(e=this.audioTrackController)?void 0:e.setAudioOption(t)}setSubtitleOption(t){var e;return null==(e=this.subtitleTrackController)||e.setSubtitleOption(t),null}get allAudioTracks(){const t=this.audioTrackController;return t?t.allAudioTracks:[]}get audioTracks(){const t=this.audioTrackController;return t?t.audioTracks:[]}get audioTrack(){const t=this.audioTrackController;return t?t.audioTrack:-1}set audioTrack(t){const e=this.audioTrackController;e&&(e.audioTrack=t)}get allSubtitleTracks(){const t=this.subtitleTrackController;return t?t.allSubtitleTracks:[]}get subtitleTracks(){const t=this.subtitleTrackController;return t?t.subtitleTracks:[]}get subtitleTrack(){const t=this.subtitleTrackController;return t?t.subtitleTrack:-1}get media(){return this._media}set subtitleTrack(t){const e=this.subtitleTrackController;e&&(e.subtitleTrack=t)}get subtitleDisplay(){const t=this.subtitleTrackController;return!!t&&t.subtitleDisplay}set subtitleDisplay(t){const e=this.subtitleTrackController;e&&(e.subtitleDisplay=t)}get lowLatencyMode(){return this.config.lowLatencyMode}set lowLatencyMode(t){this.config.lowLatencyMode=t}get liveSyncPosition(){return this.latencyController.liveSyncPosition}get latency(){return this.latencyController.latency}get maxLatency(){return this.latencyController.maxLatency}get targetLatency(){return this.latencyController.targetLatency}get drift(){return this.latencyController.drift}get forceStartLoad(){return this.streamController.forceStartLoad}}function Aw(t){const e=Math.floor(t/3600),i=Math.floor(t%3600/60),r=Math.floor(t%60);return e>0?`${e}:${i.toString().padStart(2,"0")}:${r.toString().padStart(2,"0")}`:`${i}:${r.toString().padStart(2,"0")}`}Rw.defaultConfig=void 0;var Dw=function(t,e,i,r){var a,s=arguments.length,n=s<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,i,r);else for(var o=t.length-1;o>=0;o--)(a=t[o])&&(n=(s<3?a(n):s>3?a(e,i,n):a(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};const Mw=class{constructor(t){o(this,t),this.apiError=Y(this,"rtkApiError",7),this.statsIntervalTimer=null,this.t=Fe(),this.iconPack=je,this.isSupported=!0,this.playerState=Jt.IDLE,this.livestreamState="IDLE",this.livestreamId=null,this.audioPlaybackError=!1,this.qualityLevels=[],this.selectedQuality=-1,this.currentTime=0,this.duration=0,this.hideControls=!0,this.hideControlsTimeout=null,this.livestreamUpdateListener=t=>{this.playbackUrl=this.meeting.livestream.playbackUrl,this.livestreamState=t},this.updateProgress=()=>{this.currentTime=this.videoRef.currentTime},this.updateHlsStatsPeriodically=()=>{var t,e;this.duration=((null===(t=this.videoRef)||void 0===t?void 0:t.currentTime)||0)+((null===(e=this.hls)||void 0===e?void 0:e.latency)||0)},this.fastForwardToLatest=()=>{this.videoRef.currentTime=this.duration-1},this.togglePlay=()=>{this.videoRef.paused?(this.videoRef.play(),this.playerState=Jt.PLAYING):(this.videoRef.pause(),this.playerState=Jt.IDLE)},this.changeQuality=t=>{this.selectedQuality=t,this.hls&&(this.hls.currentLevel=t)},this.cleanupPlayer=()=>{var t;this.playerState=Jt.IDLE,this.videoRef&&(null===(t=this.hls)||void 0===t||t.destroy(),this.hls=null)},this.onMouseMovePlayer=()=>{this.hideControls=!1,clearTimeout(this.hideControlsTimeout),this.hideControlsTimeout=setTimeout((()=>{this.hideControls=!0}),5e3)},this.getLoadingState=()=>{let t="",e=!1,i=!1;switch(this.livestreamState){case"IDLE":t=this.t("livestream.idle"),e=!0,i=!1;break;case"STARTING":t=this.t("livestream.starting"),e=!0,i=!0;break;case"STOPPING":t=this.t("livestream.stopping"),e=!0,i=!0;break;case"LIVESTREAMING":this.playerState!==Jt.PLAYING&&this.playerState!==Jt.PAUSED&&(t=this.t("livestream.starting"),i=!0,e=!0);break;default:e=!1,t=this.t(""),i=!0}return{isLoading:e,loadingMessage:t,showIcon:i}},this.getErrorState=()=>{var t,e;let i=!1,r="";return"LIVESTREAMING"!==this.livestreamState?(i=!1,r=this.t(""),{isError:i,errorMessage:r}):(this.isSupported||(i=!0,r=this.t("livestream.error.not_supported")),this.playbackUrl||(i=!0,r=this.t("livestream.error.not_found")),this.playerError&&(i=!0,r=this.t(null!==(e=null===(t=this.playerError)||void 0===t?void 0:t.message)&&void 0!==e?e:"livestream.error.unknown")),{isError:i,errorMessage:r})},this.initialiseAndPlayStream=async()=>{try{this.meeting.__internals__.logger.info(`rtk-livestream-player:: About to initialise HLS. VideoRef? ${!!this.videoRef} playbackUrl: ${this.playbackUrl}`),Rw.isSupported()?(this.meeting.__internals__.logger.info("rtk-livestream-player:: Initialising HLS. HLS is Supported"),this.hls=new Rw({lowLatencyMode:!1}),window.rtk_hls=this.hls,this.meeting.__internals__.logger.info("rtk-livestream-player:: Loading source"),this.hls.loadSource(this.playbackUrl),this.meeting.__internals__.logger.info("rtk-livestream-player:: Attaching video element to HLS"),this.hls.attachMedia(this.videoRef),this.meeting.__internals__.logger.info("rtk-livestream-player:: Waiting async for HLS manifest parsing"),this.hls.on(Rw.Events.ERROR,((t,e)=>{if(e.fatal){if(this.meeting.__internals__.logger.error(`rtk-livestream-player:: fatal error: ${e.details}`,{error:e.error}),this.playbackUrl&&"LIVESTREAMING"===this.livestreamState)return void setTimeout((()=>{this.playbackUrl&&"LIVESTREAMING"===this.livestreamState&&(this.meeting.__internals__.logger.info("rtk-livestream-player:: Retrying playbackUrl"),this.hls.loadSource(this.playbackUrl))}),5e3)}else this.meeting.__internals__.logger.warn(`rtk-livestream-player:: non-fatal error: ${e.details}`,{error:e.error})})),this.hls.on(Rw.Events.MEDIA_ATTACHED,(()=>{this.meeting.__internals__.logger.info("rtk-livestream-player:: media attached")})),this.hls.on(Rw.Events.MEDIA_DETACHED,(()=>{this.meeting.__internals__.logger.info("rtk-livestream-player:: media detached")})),this.hls.on(Rw.Events.DESTROYING,(()=>{this.meeting.__internals__.logger.info("rtk-livestream-player:: hls is getting destroyed")})),this.hls.on(Rw.Events.MANIFEST_PARSED,(async(t,e)=>{this.meeting.__internals__.logger.info("rtk-livestream-player:: HLS manifest parsed");const{levels:i,autoLevelChangeAllowed:r}=function({meeting:t,hlsLevels:e}){let i=t.self.config.livestreamViewerQualities||[];if(!i.length)return{autoLevelChangeAllowed:!0,levels:e};const r=e.filter((t=>i.includes(t.height)));return r.length?{autoLevelChangeAllowed:!1,levels:r}:{autoLevelChangeAllowed:!0,levels:e}}({meeting:this.meeting,hlsLevels:e.levels});this.qualityLevels=i.map(((t,e)=>({level:e,resolution:t.height?`${t.height}p`:"auto"}))),r&&(this.qualityLevels=[{level:-1,resolution:"Auto"},...this.qualityLevels]),this.hls.currentLevel=this.qualityLevels[0].level;try{this.meeting.__internals__.logger.info("rtk-livestream-player:: About to start video."),await this.videoRef.play(),this.meeting.__internals__.logger.info("rtk-livestream-player:: Video has started playing."),this.playerState=Jt.PLAYING}catch(t){this.audioPlaybackError=!0,this.meeting.__internals__.logger.error("rtk-livestream-player:: Video couldn't start. Trying with user gesture again.",{error:t})}})),this.videoRef.addEventListener("timeupdate",this.updateProgress),this.statsIntervalTimer=setInterval(this.updateHlsStatsPeriodically,1e3)):this.isSupported=!1}catch(t){this.meeting.__internals__.logger.error("rtk-livestream-player:: HLS couldn't initialise.",{error:t})}}}async updateLivestreamId(){const t=this.meeting.livestream.playbackUrl;if(!t||"LIVESTREAMING"!==this.livestreamState)return this.playbackUrl=null,this.livestreamId=null,void this.cleanupPlayer();const e=t.split("/"),i=e.findIndex((t=>"manifest"===t)),r=e[i-1];this.livestreamId=r,await this.conditionallyStartLivestreamViewer()}async conditionallyStartLivestreamViewer(){this.videoRef&&this.playbackUrl&&!this.hls&&await this.initialiseAndPlayStream()}async connectedCallback(){this.meetingChanged(this.meeting)}disconnectedCallback(){this.meeting.livestream.removeListener("livestreamUpdate",this.livestreamUpdateListener),this.videoRef.removeEventListener("timeupdate",this.updateProgress),clearInterval(this.statsIntervalTimer),this.videoRef=null,this.hls&&this.hls.destroy(),window.rtk_hls=null}meetingChanged(t){null!=t&&(this.playbackUrl=this.meeting.livestream.playbackUrl,this.livestreamState=this.meeting.livestream.state,this.meeting.livestream.on("livestreamUpdate",this.livestreamUpdateListener))}render(){var t,e;if(!Qt(this.meeting))return;const{isError:i,errorMessage:r}=this.getErrorState(),{isLoading:a,loadingMessage:s,showIcon:n}=this.getLoadingState();return N(H,null,N("div",{class:"player-container h-full max-h-full min-h-full w-full min-w-full max-w-full"},N("div",{ref:async t=>{this.videoContainerRef=t},class:"video-container relative flex h-full w-full flex-col items-center justify-center pb-20"},N("video",{onMouseMove:this.onMouseMovePlayer,ref:async t=>{this.videoRef=t,await this.conditionallyStartLivestreamViewer()},id:"livestream-video",style:{height:`${null===(t=this.el)||void 0===t?void 0:t.clientHeight}px`},controls:!1,onPlay:()=>{this.playerState===Jt.PAUSED&&(this.playerState=Jt.PLAYING)},onPause:()=>this.playerState=Jt.PAUSED}),this.playerState!==Jt.IDLE&&!this.hideControls&&N("div",{class:"control-bar",style:{width:`${null===(e=this.videoRef)||void 0===e?void 0:e.clientWidth}px`}},N("div",{class:"control-groups"},N("rtk-icon",{id:"playPause",onClick:this.togglePlay,size:"lg",class:"control-btn",icon:this.playerState===Jt.PLAYING?this.iconPack.pause:this.iconPack.play}),N("rtk-icon",{size:"lg",class:"control-btn",icon:this.iconPack.fastForward,onClick:this.fastForwardToLatest}),N("span",{class:"timings"},Aw(this.currentTime)," /"," ",Aw(this.duration))),N("div",{class:"control-groups"},N("select",{class:"level-select",onChange:t=>this.changeQuality(parseInt(t.target.value))},this.qualityLevels.map((t=>N("option",{value:t.level,selected:this.selectedQuality===t.level},t.resolution)))),N("rtk-fullscreen-toggle",{id:"fullscreen",class:"control-btn fullscreen-btn",targetElement:this.videoContainerRef,size:"sm",iconPack:this.iconPack,t:this.t,ref:t=>{var e;const i=document.createElement("style");i.textContent="\n rtk-controlbar-button {\n display: contents;\n background-color: var(--bg-brand-500);\n color: var(--text-text-on-brand);\n }\n ",null===(e=null==t?void 0:t.shadowRoot)||void 0===e||e.appendChild(i)}})))),this.audioPlaybackError&&N("div",{class:"unmute-popup"},N("h3",null,this.t("audio_playback.title")),N("p",null,this.t("audio_playback.description")),N("rtk-button",{kind:"wide",onClick:()=>{this.audioPlaybackError=!1,this.videoRef&&(this.videoRef.muted=!1,this.videoRef.play(),this.playerState=Jt.PLAYING)},title:this.t("audio_playback")},this.t("audio_playback"))),i&&N("div",{class:"loader"},N("rtk-icon",{icon:this.iconPack.warning}),N("p",null,r)),!i&&a&&N("div",{class:"loader"},n&&N("rtk-spinner",{id:"icon",part:"spinner",iconPack:this.iconPack,size:"md"}),N("p",null,s))))}get el(){return W(this)}static get watchers(){return{livestreamState:["updateLivestreamId"],meeting:["meetingChanged"]}}};Dw([ai()],Mw.prototype,"meeting",void 0),Dw([ai()],Mw.prototype,"size",void 0),Dw([ai()],Mw.prototype,"t",void 0),Dw([ai()],Mw.prototype,"iconPack",void 0),Mw.style=":host{line-height:initial;font-family:var(--rtk-font-family, sans-serif);font-feature-settings:normal;font-variation-settings:normal}p{margin:var(--rtk-space-0, 0px);padding:var(--rtk-space-0, 0px)}:host{display:flex;height:100%;max-height:100%;min-height:100%;width:100%;min-width:100%;max-width:100%;border-radius:var(--rtk-border-radius-md, 8px);--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-background-900, 26 26 26) / var(--tw-bg-opacity))}.player-container{position:relative;margin:var(--rtk-space-4, 16px);display:flex;flex-grow:1;align-items:center;justify-content:center;border-radius:var(--rtk-border-radius-md, 8px)}.loader{position:absolute;z-index:10;height:100%;width:100%;--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-background-900, 26 26 26) / var(--tw-bg-opacity));display:flex;flex-direction:column;align-items:center;justify-content:center}p{margin-top:var(--rtk-space-1, 4px);margin-bottom:var(--rtk-space-1, 4px);font-size:16px;color:rgb(var(--rtk-colors-text-700, 255 255 255 / 0.64))}.unmute-popup{position:absolute;z-index:30 !important;display:flex;width:var(--rtk-space-72, 288px);flex-direction:column;border-radius:var(--rtk-border-radius-md, 8px);--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-background-800, 30 30 30) / var(--tw-bg-opacity));padding:var(--rtk-space-4, 16px);text-align:center;max-width:70%}.unmute-popup h3{margin:var(--rtk-space-0, 0px);font-size:16px;font-weight:500}.unmute-popup p{margin-top:var(--rtk-space-3, 12px);margin-bottom:var(--rtk-space-3, 12px);font-size:14px}.control-bar{position:absolute;bottom:0;display:flex;height:auto;justify-content:space-between;align-items:center;padding:10px 10px 0px 10px;z-index:10;}.timings{color:rgb(var(--rtk-colors-text-on-brand-1000, var(--rtk-colors-text-1000, 255 255 255)))}.control-btn{border:none;margin-right:var(--rtk-space-2, 8px);border-radius:var(--rtk-border-radius-sm, 4px);--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-brand-500, 33 96 253) / var(--tw-bg-opacity));color:rgb(var(--rtk-colors-text-on-brand-1000, var(--rtk-colors-text-1000, 255 255 255)));cursor:pointer;font-size:24px;height:30px;width:30px}.fullscreen-btn{margin-right:20px;height:30px}.control-btn:hover{opacity:0.8}.control-btn:focus{outline:none}.control-groups{display:flex;align-items:center;justify-content:space-around}#livestream-video{aspect-ratio:16/9;max-width:100%;min-width:100%;left:var(--rtk-space-0, 0px);z-index:20;aspect-ratio:16 / 9;width:auto;border-radius:var(--rtk-border-radius-md, 8px);border-width:0px}.level-select{border-radius:var(--rtk-border-radius-sm, 4px);--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-brand-500, 33 96 253) / var(--tw-bg-opacity));color:rgb(var(--rtk-colors-text-on-brand-1000, var(--rtk-colors-text-1000, 255 255 255)));border:none;padding:5px 10px;font-size:14px;height:30px;cursor:pointer;border-radius:5px;margin-right:10px}.level-select:focus{outline:none}.level-select option{border-radius:var(--rtk-border-radius-sm, 4px);--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-brand-500, 33 96 253) / var(--tw-bg-opacity));color:rgb(var(--rtk-colors-text-on-brand-1000, var(--rtk-colors-text-1000, 255 255 255)))}.volume-control-holder{display:flex;justify-content:center;align-items:center}";var Iw=function(t,e,i,r){var a,s=arguments.length,n=s<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,i,r);else for(var o=t.length-1;o>=0;o--)(a=t[o])&&(n=(s<3?a(n):s>3?a(e,i,n):a(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};const Ow=class{constructor(t){o(this,t),this.variant="primary",this.iconPack=je,this.t=Fe(),this.viewerCount=0,this.disconnectMeeting=t=>{var e;null!=t&&null!=this.countListener&&(null===(e=t.livestream)||void 0===e||e.removeListener("viewerCountUpdate",this.countListener))}}connectedCallback(){this.meetingChanged(this.meeting)}disconnectedCallback(){this.disconnectMeeting(this.meeting)}meetingChanged(t,e){var i;this.disconnectMeeting(e),null!=t&&(this.countListener=()=>{var e;this.viewerCount=null===(e=t.livestream)||void 0===e?void 0:e.viewerCount},this.countListener(),null===(i=t.livestream)||void 0===i||i.addListener("viewerCountUpdate",this.countListener))}render(){return Qt(this.meeting)?N(H,{tabIndex:0,role:"log","aria-label":`${this.viewerCount} ${this.t("viewers")}`},N("rtk-icon",{icon:this.iconPack.viewers,tabIndex:-1,"aria-hidden":!0,part:"icon"}),this.viewerCount," ",this.t("viewers")):N(H,{"data-hidden":!0})}static get watchers(){return{meeting:["meetingChanged"]}}};Iw([ai()],Ow.prototype,"meeting",void 0),Iw([ai()],Ow.prototype,"iconPack",void 0),Iw([ai()],Ow.prototype,"t",void 0),Ow.style=":host{line-height:initial;font-family:var(--rtk-font-family, sans-serif);font-feature-settings:normal;font-variation-settings:normal}p{margin:var(--rtk-space-0, 0px);padding:var(--rtk-space-0, 0px)}:host{display:inline-flex;height:var(--rtk-space-10, 40px);-webkit-user-select:none;-moz-user-select:none;user-select:none;align-items:center;font-size:14px}:host([data-hidden]){display:none}:host([size='sm']){font-size:12px}rtk-icon{margin-right:var(--rtk-space-1, 4px);height:var(--rtk-space-5, 20px);width:var(--rtk-space-5, 20px)}:host([size='sm']) rtk-icon{height:var(--rtk-space-4, 16px);width:var(--rtk-space-4, 16px)}:host([variant='embedded']){--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-background-1000, 8 8 8) / var(--tw-bg-opacity));opacity:0.5;margin-top:var(--rtk-space-1, 4px);margin-left:var(--rtk-space-1, 4px);height:var(--rtk-space-5, 20px);border-radius:var(--rtk-border-radius-sm, 4px);padding-left:var(--rtk-space-2, 8px);padding-right:var(--rtk-space-2, 8px);font-size:12px}:host([variant='embedded']) rtk-icon{height:var(--rtk-space-4, 16px);width:var(--rtk-space-4, 16px)}";var Uw=Object.freeze({__proto__:null,rtk_livestream_indicator:tu,rtk_livestream_player:Mw,rtk_viewer_count:Ow});var $w=function(t,e,i,r){var a,s=arguments.length,n=s<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,i,r);else for(var o=t.length-1;o>=0;o--)(a=t[o])&&(n=(s<3?a(n):s>3?a(e,i,n):a(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};const Fw=class{constructor(t){o(this,t),this.isScreenShare=!1,this.variant="default",this.iconPack=je,this.t=Fe(),this.length=13}sizeChanged(t){this.length="sm"===t?8:13}formatNameTag(t,e){return this.isScreenShare?e?`${this.t("screen")} - ${Qe(t,this.length-3)} (${this.t("you")})`:`${this.t("screen")} - ${Qe(t,this.length)}`:e?`${Qe(t,this.length-3)} (${this.t("you")})`:Qe(t,this.length)}render(){var t,e,i;const r=ti((null===(t=this.participant)||void 0===t?void 0:t.name)||""),a=(null===(e=this.participant)||void 0===e?void 0:e.id)===(null===(i=this.meeting)||void 0===i?void 0:i.self.id);return N(H,{key:"52aa7e44f5a12d953eb5637346fff58cd40ed0bb",title:r},N("slot",{key:"24d7325456abe1ec7051c44eaf6067446e459f2d",name:"start"}),N("span",{key:"c2e7c6d2ca6ab1f5e097ccccad09b52fcc9c846a",class:"name"},this.formatNameTag(r,a)),N("slot",{key:"586b6e09b16c88cc219f45843ac8dfd746c0482a",name:"end"}))}static get watchers(){return{size:["sizeChanged"]}}};$w([ai()],Fw.prototype,"meeting",void 0),$w([ai()],Fw.prototype,"size",void 0),$w([ai()],Fw.prototype,"iconPack",void 0),$w([ai()],Fw.prototype,"t",void 0),Fw.style=":host{line-height:initial;font-family:var(--rtk-font-family, sans-serif);font-feature-settings:normal;font-variation-settings:normal}p{margin:var(--rtk-space-0, 0px);padding:var(--rtk-space-0, 0px)}:host{display:inline-flex;-webkit-user-select:none;-moz-user-select:none;user-select:none;align-items:center;padding-top:var(--rtk-space-1, 4px);padding-bottom:var(--rtk-space-1, 4px);padding-left:var(--rtk-space-1\\.5, 6px);padding-right:var(--rtk-space-1\\.5, 6px);font-size:14px;border-radius:var(--rtk-border-radius-sm, 4px);--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-background-700, 44 44 44) / var(--tw-bg-opacity));color:rgb(var(--rtk-colors-text-900, 255 255 255 / 0.88))}span.name{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:1}::slotted(rtk-audio-visualizer[slot='start']){margin-right:var(--rtk-space-1\\.5, 6px)}::slotted(rtk-audio-visualizer[slot='end']){margin-left:var(--rtk-space-1\\.5, 6px)}:host([size='sm']){font-size:12px;--tw-bg-opacity:0.6}:host([variant='text']){background-color:transparent;padding:var(--rtk-space-0, 0px)}";var jw=Object.freeze({__proto__:null,rtk_name_tag:Fw});var zw=function(t,e,i,r){var a,s=arguments.length,n=s<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,i,r);else for(var o=t.length-1;o>=0;o--)(a=t[o])&&(n=(s<3?a(n):s>3?a(e,i,n):a(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};const Nw=class{constructor(t){o(this,t),this.config=De,this.hideHeader=!1,this.iconPack=je,this.view="sidebar",this.t=Fe(),this.search="",this.participants=[],this.createParticipantNode=t=>{const e={meeting:this.meeting,view:this.view,t:this.t,config:this.config,states:this.states,size:this.size,iconPack:this.iconPack};return N("div",null,N(rr,{element:"rtk-participant",defaults:e,props:{role:"listitem",participant:t,key:t.id},childProps:Object.assign(Object.assign({},e),{participant:t,size:this.size}),deepProps:!0}))},this.updateStageList=()=>{this.getParticipants(this.search)}}connectedCallback(){this.meetingChanged(this.meeting),this.searchChanged(this.search)}disconnectedCallback(){const{participants:t,stage:e}=this.meeting;null!=this.meeting&&(this.participantJoinedListener&&this.meeting.participants.joined.removeListener("participantJoined",this.participantJoinedListener),this.participantLeftListener&&this.meeting.participants.joined.removeListener("participantLeft",this.participantLeftListener),t.joined.removeListener("stageStatusUpdate",this.updateStageList),null==e||e.removeListener("stageStatusUpdate",this.updateStageList))}meetingChanged(t){null!=t&&(this.participantJoinedListener=t=>{if("ON_STAGE"!==t.stageStatus)return;const e=this.search.toLowerCase();t.name.toLowerCase().includes(e)&&t.id.toLowerCase().includes(e)&&(this.participants=[...this.participants.filter((e=>e.id!==t.id)),t])},this.participantLeftListener=t=>{this.participants=this.participants.filter((e=>e.id!==t.id))},t.participants.joined.addListener("participantJoined",this.participantJoinedListener),t.participants.joined.addListener("participantLeft",this.participantLeftListener),this.updateStageList(),null==t||t.participants.joined.on("stageStatusUpdate",this.updateStageList),null==t||t.stage.on("stageStatusUpdate",this.updateStageList))}searchChanged(t){this.getParticipants(t)}getParticipants(t=this.search){let e="ON_STAGE"===this.meeting.stage.status?[this.meeting.self]:[];e=[...e,...this.meeting.participants.joined.toArray().filter((t=>"ON_STAGE"===t.stageStatus))],this.participants=""===t?e:e.filter((e=>{var i;return(null!==(i=e.name)&&void 0!==i?i:e.id).toLowerCase().includes(t.toLowerCase())}))}render(){return N(H,{key:"54501f9cebd4dee4398cb0161341c72008a1bf22"},N("div",{key:"9157670e4ed76beb38ad5c6e3405a1707ff8d262",class:"participants-container"},!this.hideHeader&&N("div",{key:"71d44cb3842d749a19526068700f788727ff5c28",class:"heading-count",part:"heading-count"},this.t("participants")," (",this.participants.length,")"),N("rtk-virtualized-participant-list",{key:"8239db7509da6cc5334b8d860e9954527febacf2",items:this.participants,renderItem:this.createParticipantNode,part:"participants",class:"participants",emptyListElement:N("div",{class:"empty-stage-list"},this.search.length>0?this.t("search.could_not_find"):this.t("search.empty"))})))}static get watchers(){return{meeting:["meetingChanged"],search:["searchChanged"]}}};zw([ai()],Nw.prototype,"meeting",void 0),zw([ai()],Nw.prototype,"states",void 0),zw([ai()],Nw.prototype,"size",void 0),zw([ai()],Nw.prototype,"iconPack",void 0),zw([ai()],Nw.prototype,"t",void 0),Nw.style=":host{line-height:initial;font-family:var(--rtk-font-family, sans-serif);font-feature-settings:normal;font-variation-settings:normal}p{margin:var(--rtk-space-0, 0px);padding:var(--rtk-space-0, 0px)}:host{display:flex;width:100%;flex-direction:column;font-size:14px}.participants-container{margin-bottom:var(--rtk-space-4, 16px);height:100%;width:100%}h3,.heading-count{margin:var(--rtk-space-0, 0px);display:flex;align-items:center;justify-content:center;padding:var(--rtk-space-0, 0px);font-size:16px;font-weight:400;color:rgb(var(--rtk-colors-text-900, 255 255 255 / 0.88));text-align:center}.heading-count{font-size:14px}.participants{margin-top:var(--rtk-space-2, 8px);margin-bottom:var(--rtk-space-0, 0px);padding:var(--rtk-space-0, 0px)}.empty-stage-list{margin-top:var(--rtk-space-4, 16px);margin-bottom:var(--rtk-space-4, 16px);text-align:center;font-size:12px;color:rgb(var(--rtk-colors-text-700, 255 255 255 / 0.64))}rtk-participant{width:100%}";var Bw=function(t,e,i,r){var a,s=arguments.length,n=s<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,i,r);else for(var o=t.length-1;o>=0;o--)(a=t[o])&&(n=(s<3?a(n):s>3?a(e,i,n):a(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};const Hw=class{constructor(t){o(this,t),this.config=De,this.iconPack=je,this.view="sidebar",this.t=Fe(),this.stageRequestedParticipants=[],this.updateStageRequestedParticipants=()=>{this.stageRequestedParticipants=this.meeting.participants.joined.toArray().filter((t=>"REQUESTED_TO_JOIN_STAGE"===t.stageStatus))},this.acceptStageRequest=async t=>{const{userId:e}=t;await this.meeting.stage.grantAccess([e])},this.rejectStageRequest=async t=>{const{userId:e}=t;await this.meeting.stage.denyAccess([e])},this.acceptAllStageRequest=async()=>{await this.meeting.stage.grantAccess(this.stageRequestedParticipants.map((t=>t.userId)))},this.denyAllStageRequest=async()=>{var t;await(null===(t=this.meeting.stage)||void 0===t?void 0:t.denyAccess(this.stageRequestedParticipants.map((t=>t.userId))))},this.shouldShowStageRequests=()=>this.meeting.self.permissions.stageEnabled&&this.meeting.self.permissions.acceptStageRequests&&this.stageRequestedParticipants.length>0,this.updateRequestList=async t=>{var e,i,r,a,s,n,o;this.meeting.self.permissions.acceptStageRequests&&this.meeting.self.permissions.stageEnabled?"LIVESTREAM"===this.meeting.meta.viewType||"HIVE"===(null===(r=null===(i=null===(e=this.meeting)||void 0===e?void 0:e.self)||void 0===i?void 0:i.permissions)||void 0===r?void 0:r.mediaRoomType)?(t||(t=null!==(n=null===(s=await(null===(a=this.meeting.stage)||void 0===a?void 0:a.getAccessRequests()))||void 0===s?void 0:s.stageRequests)&&void 0!==n?n:[]),this.stageRequestedParticipants=t.map((t=>Object.assign(Object.assign({},t),{name:t.displayName})))):this.stageRequestedParticipants=null===(o=[this.meeting.self,...this.meeting.participants.joined.toArray()])||void 0===o?void 0:o.filter((t=>"REQUESTED_TO_JOIN_STAGE"===t.stageStatus)):this.stageRequestedParticipants=[]}}connectedCallback(){this.meetingChanged(this.meeting)}disconnectedCallback(){var t;const{stage:e}=this.meeting;null==e||e.removeListener("stageAccessRequestUpdate",this.updateRequestList),null===(t=this.meeting.participants.joined)||void 0===t||t.removeListener("stageStatusUpdate",this.updateStageRequestedParticipants)}meetingChanged(t){var e;null!=t&&(this.updateRequestList(),t.participants.joined.on("stageStatusUpdate",this.updateStageRequestedParticipants),null===(e=t.stage)||void 0===e||e.on("stageAccessRequestUpdate",this.updateRequestList))}render(){if("sidebar"===this.view&&this.shouldShowStageRequests())return N("div",{class:"stage-requested-participants"},N("div",{class:"heading-count",part:"staged-heading-count"},this.t("stage_request.header_title")," (",this.stageRequestedParticipants.length,")"),N("ul",{class:"participants",part:"staged-participants"},this.stageRequestedParticipants.map((t=>N("li",{class:"waiting-participant",key:t.id},N("div",{class:"participant-details"},N("rtk-avatar",{participant:t,size:"sm",iconPack:this.iconPack,t:this.t}),N("p",{class:"name",title:t.name},t.name)),N("div",{class:"waitlist-controls"},N("rtk-tooltip",{label:this.t("stage_request.deny_request"),variant:"secondary"},N("rtk-button",{variant:"secondary",kind:"icon",onClick:()=>this.rejectStageRequest(t)},N("rtk-icon",{class:"deny",icon:this.iconPack.dismiss}))),N("rtk-tooltip",{label:this.t("stage_request.accept_request"),variant:"secondary"},N("rtk-button",{variant:"secondary",kind:"icon",onClick:()=>this.acceptStageRequest(t)},N("rtk-icon",{class:"accept",icon:this.iconPack.checkmark})))))))),N("div",{class:"bulk-actions"},N("rtk-button",{class:"accept-all-button",variant:"secondary",onClick:this.acceptAllStageRequest},this.t("stage_request.accept_all")),N("rtk-button",{class:"deny-all-button",variant:"danger",onClick:this.denyAllStageRequest},this.t("stage_request.deny_all"))))}static get watchers(){return{meeting:["meetingChanged"]}}};Bw([ai()],Hw.prototype,"meeting",void 0),Bw([ai()],Hw.prototype,"size",void 0),Bw([ai()],Hw.prototype,"iconPack",void 0),Bw([ai()],Hw.prototype,"t",void 0),Hw.style=":host{line-height:initial;font-family:var(--rtk-font-family, sans-serif);font-feature-settings:normal;font-variation-settings:normal}p{margin:var(--rtk-space-0, 0px);padding:var(--rtk-space-0, 0px)}:host{margin-top:var(--rtk-space-2, 8px);display:flex;width:100%;flex-direction:column;font-size:14px}.stage-requested-participants{margin-bottom:var(--rtk-space-8, 32px)}.stage-requested-participants .bulk-actions{display:flex;gap:var(--rtk-space-2, 8px)}.stage-requested-participants .bulk-actions .accept-all-button{--tw-text-opacity:1;color:rgba(var(--rtk-colors-success, 98 165 4) / var(--tw-text-opacity))}.stage-requested-participants .bulk-actions rtk-button{flex:1 1 0%}h3,.heading-count{margin:var(--rtk-space-0, 0px);display:flex;align-items:center;justify-content:center;padding:var(--rtk-space-0, 0px);font-size:16px;font-weight:400;color:rgb(var(--rtk-colors-text-900, 255 255 255 / 0.88));text-align:center}.heading-count{font-size:14px}.participants{margin-top:var(--rtk-space-2, 8px);padding:var(--rtk-space-0, 0px)}.waiting-participant{margin-top:var(--rtk-space-2, 8px);margin-bottom:var(--rtk-space-2, 8px);display:flex;align-items:center}.waiting-participant .participant-details{margin-right:auto;display:flex;align-items:center}.waiting-participant .participant-details rtk-avatar{margin-right:var(--rtk-space-2, 8px);height:var(--rtk-space-8, 32px);width:var(--rtk-space-8, 32px);flex-shrink:0;font-size:14px}.waiting-participant .participant-details .name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:rgb(var(--rtk-colors-text-900, 255 255 255 / 0.88))}@media (min-width: 1080px){.waiting-participant .participant-details .name{max-width:var(--rtk-space-40, 160px)}}.waiting-participant .waitlist-controls{display:flex}.waiting-participant .waitlist-controls rtk-button{margin-left:var(--rtk-space-2, 8px);cursor:pointer;border-radius:var(--rtk-border-radius-sm, 4px)}.waiting-participant .waitlist-controls rtk-icon.accept{--tw-text-opacity:1;color:rgba(var(--rtk-colors-success, 98 165 4) / var(--tw-text-opacity))}.waiting-participant .waitlist-controls rtk-icon.deny{--tw-text-opacity:1;color:rgba(var(--rtk-colors-danger, 255 45 45) / var(--tw-text-opacity))}";var Gw=function(t,e,i,r){var a,s=arguments.length,n=s<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,i,r);else for(var o=t.length-1;o>=0;o--)(a=t[o])&&(n=(s<3?a(n):s>3?a(e,i,n):a(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};const Vw=class{constructor(t){o(this,t),this.updateStageViewers=()=>{this.getViewers(this.search)},this.config=De,this.hideHeader=!1,this.iconPack=je,this.view="sidebar",this.search="",this.t=Fe(),this.stageViewers=[],this.createParticipantNode=t=>N("rtk-participant",{role:"listitem",key:t.id,meeting:this.meeting,participant:t,view:this.view,iconPack:this.iconPack,config:this.config,t:this.t}),this.shouldShowViewers=()=>{var t,e,i;return null===(i=null===(e=null===(t=this.meeting)||void 0===t?void 0:t.self)||void 0===e?void 0:e.permissions)||void 0===i?void 0:i.stageEnabled}}connectedCallback(){this.meetingChanged(this.meeting),this.searchChanged(this.search)}meetingChanged(t){null!=t&&(this.participantJoinedListener=t=>{if("ON_STAGE"===t.stageStatus)return;const e=this.search.toLowerCase();e.length>0&&!t.name.toLowerCase().includes(e)||(this.stageViewers=[...this.stageViewers.filter((e=>e.id!==t.id)),t])},this.participantLeftListener=t=>{this.stageViewers=this.stageViewers.filter((e=>e.id!==t.id))},t.participants.joined.addListener("participantJoined",this.participantJoinedListener),t.participants.joined.addListener("participantLeft",this.participantLeftListener),t.participants.joined.on("stageStatusUpdate",this.updateStageViewers),t.stage.on("stageStatusUpdate",this.updateStageViewers))}searchChanged(t){this.getViewers(t)}disconnectedCallback(){const{participants:t,stage:e}=this.meeting;this.participantJoinedListener&&this.meeting.participants.joined.removeListener("participantJoined",this.participantJoinedListener),this.participantLeftListener&&this.meeting.participants.joined.removeListener("participantLeft",this.participantLeftListener),t.joined.removeListener("stageStatusUpdate",this.updateStageViewers),e.removeListener("stageStatusUpdate",this.updateStageViewers)}getViewers(t){let e="ON_STAGE"===this.meeting.stage.status?[]:[this.meeting.self];e=[...e,...this.meeting.participants.joined.toArray()].filter((t=>"ON_STAGE"!==t.stageStatus)),this.stageViewers=""===t?e:e.filter((e=>{var i;return(null!==(i=e.name)&&void 0!==i?i:e.id).toLowerCase().includes(t.toLowerCase())}))}render(){if("sidebar"===this.view&&this.shouldShowViewers())return N("div",{class:"list"},!this.hideHeader&&N("div",{class:"heading-count",part:"heading-count"},this.t("viewers")," (",this.stageViewers.length,")"),N("rtk-virtualized-participant-list",{items:this.stageViewers,renderItem:this.createParticipantNode,class:"participants",part:"participants",style:{height:"100%"},emptyListElement:N("div",{class:"empty-viewers-list"},this.search.length>0?this.t("participants.errors.empty_results"):this.t("participants.empty_list"))}))}static get watchers(){return{meeting:["meetingChanged"],search:["searchChanged"]}}};Gw([ai()],Vw.prototype,"meeting",void 0),Gw([ai()],Vw.prototype,"size",void 0),Gw([ai()],Vw.prototype,"iconPack",void 0),Gw([ai()],Vw.prototype,"t",void 0),Vw.style=":host{line-height:initial;font-family:var(--rtk-font-family, sans-serif);font-feature-settings:normal;font-variation-settings:normal}p{margin:var(--rtk-space-0, 0px);padding:var(--rtk-space-0, 0px)}:host{display:flex;height:100%;width:100%;flex-direction:column;font-size:14px}.list{margin-bottom:var(--rtk-space-4, 16px);display:flex;height:100%;flex-direction:column}h3,.heading-count{margin:var(--rtk-space-0, 0px);align-items:center;justify-content:center;padding:var(--rtk-space-0, 0px);font-size:16px;font-weight:400;color:rgb(var(--rtk-colors-text-900, 255 255 255 / 0.88));text-align:center}.heading-count{font-size:14px}.participants{margin-top:var(--rtk-space-2, 8px);margin-bottom:var(--rtk-space-0, 0px);padding:var(--rtk-space-0, 0px)}.empty-viewers-list{margin-top:var(--rtk-space-2, 8px);margin-bottom:var(--rtk-space-2, 8px);text-align:center;font-size:12px;color:rgb(var(--rtk-colors-text-700, 255 255 255 / 0.64))}";var qw=function(t,e,i,r){var a,s=arguments.length,n=s<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,i,r);else for(var o=t.length-1;o>=0;o--)(a=t[o])&&(n=(s<3?a(n):s>3?a(e,i,n):a(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};const Kw=class{constructor(t){o(this,t),this.config=De,this.iconPack=je,this.view="sidebar",this.t=Fe(),this.acceptWaitingRoomRequest=async t=>{await this.meeting.participants.acceptWaitingRoomRequest(t)},this.waitlistedParticipants=[],this.acceptAllWaitingRoomRequests=async()=>{await this.meeting.participants.acceptAllWaitingRoomRequest(this.waitlistedParticipants.map((t=>t.id)))},this.rejectWaitingRoomRequest=async t=>{await this.meeting.participants.rejectWaitingRoomRequest(t)},this.shouldShowWaitlist=()=>"LIVESTREAM"!==this.meeting.meta.viewType&&(this.meeting.self.permissions.acceptWaitingRequests&&0!==this.waitlistedParticipants.length)}disconnectedCallback(){const{participants:t}=this.meeting;this.waitlistedParticipantJoinedListener&&t.waitlisted.removeListener("participantJoined",this.waitlistedParticipantJoinedListener),this.waitlistedParticipantLeftListener&&t.waitlisted.removeListener("participantLeft",this.waitlistedParticipantLeftListener),this.waitlistedParticipantsClearedListener&&t.waitlisted.removeListener("participantsCleared",this.waitlistedParticipantsClearedListener)}connectedCallback(){this.meetingChanged(this.meeting)}meetingChanged(t){null!=t&&(this.waitlistedParticipants=t.participants.waitlisted.toArray(),this.waitlistedParticipantJoinedListener=t=>{this.waitlistedParticipants.some((e=>e.id===t.id))||(this.waitlistedParticipants=[...this.waitlistedParticipants,t])},this.waitlistedParticipantLeftListener=t=>{this.waitlistedParticipants=this.waitlistedParticipants.filter((e=>e.id!==t.id))},this.waitlistedParticipantsClearedListener=()=>{this.waitlistedParticipants=[]},t.participants.waitlisted.addListener("participantJoined",this.waitlistedParticipantJoinedListener),t.participants.waitlisted.addListener("participantLeft",this.waitlistedParticipantLeftListener),t.participants.waitlisted.addListener("participantsCleared",this.waitlistedParticipantsClearedListener))}render(){if("sidebar"===this.view&&this.shouldShowWaitlist())return N("div",{class:"waiting-participants"},N("div",{class:"heading-count",part:"waitlisted-heading-count"},this.t("waitlist.header_title")," (",this.waitlistedParticipants.length,")"),N("ul",{class:"participants",part:"waitlisted-participants"},this.waitlistedParticipants.map((t=>N("li",{class:"waiting-participant",key:t.id},N("div",{class:"participant-details"},N("rtk-avatar",{participant:t,size:"sm",iconPack:this.iconPack,t:this.t}),N("p",{class:"name",title:t.name},t.name)),N("div",{class:"waitlist-controls"},N("rtk-tooltip",{label:this.t("waitlist.deny_request"),variant:"secondary"},N("rtk-button",{variant:"secondary",kind:"icon",onClick:()=>this.rejectWaitingRoomRequest(t.id)},N("rtk-icon",{class:"deny",icon:this.iconPack.dismiss}))),N("rtk-tooltip",{label:this.t("waitlist.accept_request"),variant:"secondary"},N("rtk-button",{variant:"secondary",kind:"icon",onClick:()=>this.acceptWaitingRoomRequest(t.id)},N("rtk-icon",{class:"accept",icon:this.iconPack.checkmark})))))))),N("rtk-button",{class:"accept-all-button",variant:"secondary",kind:"wide",onClick:this.acceptAllWaitingRoomRequests},this.t("waitlist.accept_all")))}static get watchers(){return{meeting:["meetingChanged"]}}};qw([ai()],Kw.prototype,"meeting",void 0),qw([ai()],Kw.prototype,"size",void 0),qw([ai()],Kw.prototype,"iconPack",void 0),qw([ai()],Kw.prototype,"t",void 0),Kw.style=":host{line-height:initial;font-family:var(--rtk-font-family, sans-serif);font-feature-settings:normal;font-variation-settings:normal}p{margin:var(--rtk-space-0, 0px);padding:var(--rtk-space-0, 0px)}:host{margin-top:var(--rtk-space-4, 16px);margin-bottom:calc(var(--rtk-space-2, 8px) * -1);display:flex;width:100%;flex-direction:column;font-size:14px}.waiting-participants{margin-bottom:var(--rtk-space-8, 32px)}.waiting-participants .accept-all-button{--tw-text-opacity:1;color:rgba(var(--rtk-colors-success, 98 165 4) / var(--tw-text-opacity))}h3,.heading-count{margin:var(--rtk-space-0, 0px);display:flex;align-items:center;justify-content:center;padding:var(--rtk-space-0, 0px);font-size:16px;font-weight:400;color:rgb(var(--rtk-colors-text-900, 255 255 255 / 0.88));text-align:center}.heading-count{font-size:14px}.participants{margin-top:var(--rtk-space-2, 8px);padding:var(--rtk-space-0, 0px)}.waiting-participant{margin-top:var(--rtk-space-2, 8px);margin-bottom:var(--rtk-space-2, 8px);display:flex;align-items:center}.waiting-participant .participant-details{margin-right:auto;display:flex;align-items:center}.waiting-participant .participant-details rtk-avatar{margin-right:var(--rtk-space-2, 8px);height:var(--rtk-space-8, 32px);width:var(--rtk-space-8, 32px);flex-shrink:0;font-size:14px}.waiting-participant .participant-details .name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}@media (min-width: 1080px){.waiting-participant .participant-details .name{max-width:var(--rtk-space-40, 160px)}}.waiting-participant .waitlist-controls{display:flex}.waiting-participant .waitlist-controls rtk-button{margin-left:var(--rtk-space-2, 8px);cursor:pointer;border-radius:var(--rtk-border-radius-sm, 4px)}.waiting-participant .waitlist-controls rtk-icon.accept{--tw-text-opacity:1;color:rgba(var(--rtk-colors-success, 98 165 4) / var(--tw-text-opacity))}.waiting-participant .waitlist-controls rtk-icon.deny{--tw-text-opacity:1;color:rgba(var(--rtk-colors-danger, 255 45 45) / var(--tw-text-opacity))}";var Ww=Object.freeze({__proto__:null,rtk_participants_stage_list:Nw,rtk_participants_stage_queue:Hw,rtk_participants_viewer_list:Vw,rtk_participants_waiting_list:Kw});var Yw=function(t,e,i,r){var a,s=arguments.length,n=s<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,i,r);else for(var o=t.length-1;o>=0;o--)(a=t[o])&&(n=(s<3?a(n):s>3?a(e,i,n):a(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};const Zw=class{constructor(t){o(this,t),this.iconPack=je,this.t=Fe(),this.canClosePlugin=!1,this.viewModeEnabled=!1,this.onIframeRef=t=>{var e;t!==this.iframeEl&&(this.iframeEl=t,null===(e=this.plugin)||void 0===e||e.addPluginView(t,"plugin-main"))},this.canInteractWithPlugin=()=>{const t=this.plugin.id;if(!t)return!0;const e=this.meeting.self.permissions.plugins.config[t];return!e||(!e.accessControl||"FULL_ACCESS"===e.accessControl)}}componentDidLoad(){this.meetingChanged(this.meeting),this.pluginChanged(this.plugin)}meetingChanged(t){if(null==t)return;const e=this.canInteractWithPlugin();this.viewModeEnabled=!e,C((()=>{this.canClosePlugin=t.self.permissions.plugins.canClose||this.plugin.enabledBy===t.self.id}))}pluginChanged(t){this.toggleViewModeListener=t=>{this.canInteractWithPlugin()||(this.viewModeEnabled=t)},null!=t&&(this.iframeEl&&t.addPluginView(this.iframeEl,"plugin-main"),t.addListener("toggleViewMode",this.toggleViewModeListener))}disconnectedCallback(){var t,e;null===(t=this.plugin)||void 0===t||t.removePluginView("plugin-main"),null===(e=this.plugin)||void 0===e||e.removeListener("toggleViewMode",this.toggleViewModeListener)}render(){return null==this.plugin?null:N(H,null,N("header",{part:"header"},N("div",null,this.plugin.name),this.canClosePlugin&&N("div",null,N("rtk-button",{kind:"icon",onClick:()=>this.plugin.deactivate(),part:"button"},N("rtk-icon",{icon:this.iconPack.dismiss})))),N("div",{class:"iframe-container"},!this.canInteractWithPlugin()&&this.viewModeEnabled?N("div",{class:"block-inputs"}):null,N("iframe",{ref:t=>this.onIframeRef(t),part:"iframe"})))}static get watchers(){return{meeting:["meetingChanged"],plugin:["pluginChanged"]}}};Yw([ai()],Zw.prototype,"meeting",void 0),Yw([ai()],Zw.prototype,"iconPack",void 0),Yw([ai()],Zw.prototype,"t",void 0),Zw.style=":host{line-height:initial;font-family:var(--rtk-font-family, sans-serif);font-feature-settings:normal;font-variation-settings:normal}p{margin:var(--rtk-space-0, 0px);padding:var(--rtk-space-0, 0px)}:host{display:flex;height:100%;width:100%;flex-direction:column;overflow:hidden;border-radius:var(--rtk-border-radius-lg, 12px);color:rgb(var(--rtk-colors-text-1000, 255 255 255))}header{display:flex;height:var(--rtk-space-8, 32px);align-items:center;justify-content:space-between;padding-left:var(--rtk-space-3, 12px);padding-right:var(--rtk-space-3, 12px);--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-background-900, 26 26 26) / var(--tw-bg-opacity))}header>div{display:flex;align-items:center}rtk-button{display:flex;height:var(--rtk-space-5, 20px);width:var(--rtk-space-5, 20px);flex-direction:column;align-items:center;border-radius:9999px}rtk-button rtk-icon{height:var(--rtk-space-3, 12px);width:var(--rtk-space-3, 12px)}iframe{display:block;flex:1 1 0%;margin:var(--rtk-space-0, 0px);border-width:var(--rtk-border-width-none, 0);border-style:none;padding:var(--rtk-space-0, 0px);outline:2px solid transparent;outline-offset:2px;--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-video-bg, 24 24 24) / var(--tw-bg-opacity))}.iframe-container{position:relative;height:100%;width:100%}.block-inputs{position:absolute;z-index:10;height:100%;width:100%;border-left-width:var(--rtk-border-width-none, 0);border-top-width:var(--rtk-border-width-lg, 4px);border-style:solid;--tw-border-opacity:1;border-color:rgba(var(--rtk-colors-danger, 255 45 45) / var(--tw-border-opacity))}iframe{height:100%;width:100%}";var Qw=function(t,e,i,r){var a,s=arguments.length,n=s<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,i,r);else for(var o=t.length-1;o>=0;o--)(a=t[o])&&(n=(s<3?a(n):s>3?a(e,i,n):a(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};const Jw=class{constructor(t){o(this,t),this.tabChange=Y(this,"tabChange",7),this.config=De,this.layout="row",this.iconPack=je,this.t=Fe(),this.tabs=[]}render(){return N(H,{key:"d80fd5c45bdae491e9bfe398f7ba9d7ede356e02"},N("rtk-spotlight-indicator",{key:"17d7a10e6d34c0b89fe5b7b5270eb24116e1c237",meeting:this.meeting,iconPack:this.iconPack,t:this.t,size:this.size}),this.tabs.map((t=>{var e,i,r,a,s;let n=!1;if(("plugin"===(null===(e=this.activeTab)||void 0===e?void 0:e.type)&&t.plugin&&(null===(i=this.activeTab)||void 0===i?void 0:i.plugin.id)===t.plugin.id||"screenshare"===(null===(r=this.activeTab)||void 0===r?void 0:r.type)&&t.participant&&(null===(a=this.activeTab)||void 0===a?void 0:a.participant.id)===t.participant.id)&&(n=!0),"screenshare"===t.type){const e=t.participant,i=ti(e.name);return N("rtk-button",{title:`${i}'s Screen Share`,key:t.participant.id,kind:"icon",variant:n?"primary":"secondary",class:{tab:!0,active:n},onClick:()=>this.tabChange.emit(t)},N("div",{class:"center col"},N("rtk-icon",{icon:this.iconPack.share_screen_person}),N("span",{class:"name"},e.id===(null===(s=this.meeting)||void 0===s?void 0:s.self.id)?this.t("you"):Qe(i,6))))}if("plugin"===t.type){const e=t.plugin;return N("rtk-button",{title:e.name,key:e.id,kind:"icon",variant:n?"primary":"secondary",class:{tab:!0,active:n},onClick:()=>this.tabChange.emit(t)},N("div",{class:"center col"},N("img",{src:e.picture}),N("span",{class:"name"},Qe(e.name,6))))}})))}};Qw([ai()],Jw.prototype,"size",void 0),Qw([ai()],Jw.prototype,"meeting",void 0),Qw([ai()],Jw.prototype,"states",void 0),Qw([ai()],Jw.prototype,"iconPack",void 0),Qw([ai()],Jw.prototype,"t",void 0),Jw.style=".scrollbar{scrollbar-width:thin;scrollbar-color:var(--rtk-scrollbar-color, rgb(var(--rtk-colors-background-600, 60 60 60)))\n var(--rtk-scrollbar-background, transparent)}.scrollbar::-webkit-scrollbar{height:var(--rtk-space-1\\.5, 6px);width:var(--rtk-space-1\\.5, 6px);border-radius:9999px;background-color:var(--rtk-scrollbar-background, transparent)}.scrollbar::-webkit-scrollbar-thumb{border-radius:9999px;background-color:var(--rtk-scrollbar-color, rgb(var(--rtk-colors-background-600, 60 60 60)))}:host{box-sizing:border-box;display:flex;height:100%;width:var(--rtk-space-16, 64px);flex-direction:column;gap:var(--rtk-space-2, 8px);overflow-y:auto;font-family:var(--rtk-font-family, sans-serif)}rtk-button{z-index:10}.col{display:flex;flex-direction:column;align-items:center}.tab{display:flex;height:var(--rtk-space-16, 64px);width:var(--rtk-space-16, 64px);align-items:center;justify-content:center;margin-bottom:var(--rtk-space-2, 8px);font-size:12px;--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-background-700, 44 44 44) / var(--tw-bg-opacity))}.tab.active{--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-brand-500, 33 96 253) / var(--tw-bg-opacity))}.tab img{height:var(--rtk-space-7, 28px);width:var(--rtk-space-7, 28px);border-radius:var(--rtk-border-radius-sm, 4px)}.tab .name{margin-top:var(--rtk-space-0\\.5, 2px)}:host([size='sm']){flex-direction:column;margin-top:var(--rtk-space-4, 16px);height:var(--rtk-space-16, 64px);width:100%;flex-direction:row;gap:var(--rtk-space-2, 8px);overflow-x:auto}:host([size='sm']) .tab{margin:var(--rtk-space-0, 0px);text-overflow:clip;min-width:100px;height:40px}:host([size='sm']) .tab .col{display:flex;flex-direction:row;align-items:center;gap:var(--rtk-space-2, 8px)}:host([size='sm']) .tab .col img,:host([size='sm']) .tab .col rtk-icon{height:var(--rtk-space-6, 24px);width:var(--rtk-space-6, 24px)}:host([size='sm']) .tab .col .name{gap:var(--rtk-space-1, 4px)}:host([layout='column']){flex-direction:column}:host([layout='column']) .aside{flex:2;max-width:100%;width:100%}@media (orientation: portrait){:host([size='sm']){margin-top:var(--rtk-space-2, 8px);height:var(--rtk-space-16, 64px);width:100%;flex-direction:row;transition:all 0.3s linear}:host([size='md']){height:var(--rtk-space-24, 96px);width:100%;flex-direction:row;transition:all 0.3s linear}:host .tab{margin:var(--rtk-space-0, 0px)}}@media (orientation: landscape){:host([size='sm']){margin-right:var(--rtk-space-4, 16px);height:100%;width:var(--rtk-space-14, 56px);flex-direction:row;gap:var(--rtk-space-2, 8px);overflow-y:auto;overflow-x:hidden;transition:all 0.3s linear}:host([size='md']){margin-right:var(--rtk-space-4, 16px);height:100%;width:var(--rtk-space-14, 56px);flex-direction:row;gap:var(--rtk-space-2, 8px);overflow-y:auto;overflow-x:hidden;transition:all 0.3s linear}:host .tab{margin:var(--rtk-space-0, 0px)}:host([size='sm']) .tab{margin:var(--rtk-space-0, 0px);width:100%;text-overflow:clip;min-width:0px;min-height:40px}:host([size='sm']) .tab .col{display:flex;flex-direction:column;align-items:center;gap:var(--rtk-space-2, 8px);font-size:10px}:host([size='sm']) .tab .col img,:host([size='sm']) .tab .col rtk-icon{height:var(--rtk-space-3, 12px);width:var(--rtk-space-3, 12px)}:host([size='sm']) .tab .col .name{gap:var(--rtk-space-1, 4px)}}";var Xw=Object.freeze({__proto__:null,rtk_plugin_main:Zw,rtk_tab_bar:Jw});var tx=function(t,e,i,r){var a,s=arguments.length,n=s<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,i,r);else for(var o=t.length-1;o>=0;o--)(a=t[o])&&(n=(s<3?a(n):s>3?a(e,i,n):a(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};const ex=class{constructor(t){o(this,t),this.stateUpdate=Y(this,"rtkStateUpdate",7),this.config=De,this.iconPack=je,this.t=Fe(),this.plugins=[],this.canStartPlugins=!1,this.canClosePlugins=!1,this.activatedPluginsId=[],this.close=()=>{this.stateUpdate.emit({activeSidebar:!1,sidebar:void 0})}}connectedCallback(){this.meetingChanged(this.meeting)}disconnectedCallback(){var t;null===(t=this.meeting)||void 0===t||t.plugins.all.removeListener("stateUpdate",this.updateActivePlugins)}meetingChanged(t){null!=t&&(this.canStartPlugins=t.self.permissions.plugins.canStart,this.canClosePlugins=t.self.permissions.plugins.canClose,this.plugins=t.plugins.all.toArray().filter((e=>{var i;return!(null===(i=t.self.config.disabledPlugins)||void 0===i?void 0:i.includes(e.id))})),this.updateActivePlugins=()=>{this.activatedPluginsId=t.plugins.active.toArray().map((t=>t.id))},this.updateActivePlugins(),t.plugins.all.addListener("stateUpdate",this.updateActivePlugins))}render(){return N(H,{key:"74f2d9af55a0670b4ae5406f73b333187e8c3d92"},N("ul",{key:"955e4e2a9d101b5027ef725175996c8e72a94b30",class:"scrollbar"},this.plugins.map((t=>N("li",{key:t.name,class:"plugin"},N("div",{class:"metadata"},N("img",{src:t.picture}),N("div",{class:"name"},t.name)),!this.activatedPluginsId.includes(t.id)&&this.canStartPlugins&&N("div",{class:"buttons"},N("rtk-button",{kind:"icon",size:"lg",onClick:()=>{t.activate(),this.close()},"aria-label":`${this.t("activate")} ${t.name}`},N("rtk-icon",{icon:this.iconPack.rocket,tabIndex:-1,"aria-hidden":!0}))),this.activatedPluginsId.includes(t.id)&&this.canClosePlugins&&N("div",{class:"buttons"},N("rtk-button",{kind:"icon",size:"lg",onClick:()=>{t.deactivate()},"aria-label":`${this.t("close")} ${t.name}`},N("rtk-icon",{icon:this.iconPack.dismiss,tabIndex:-1,"aria-hidden":!0}))))))))}static get watchers(){return{meeting:["meetingChanged"]}}};tx([ai()],ex.prototype,"meeting",void 0),tx([ai()],ex.prototype,"size",void 0),tx([ai()],ex.prototype,"iconPack",void 0),tx([ai()],ex.prototype,"t",void 0),ex.style=":host{line-height:initial;font-family:var(--rtk-font-family, sans-serif);font-feature-settings:normal;font-variation-settings:normal}p{margin:var(--rtk-space-0, 0px);padding:var(--rtk-space-0, 0px)}.scrollbar{scrollbar-width:thin;scrollbar-color:var(--rtk-scrollbar-color, rgb(var(--rtk-colors-background-600, 60 60 60)))\n var(--rtk-scrollbar-background, transparent)}.scrollbar::-webkit-scrollbar{height:var(--rtk-space-1\\.5, 6px);width:var(--rtk-space-1\\.5, 6px);border-radius:9999px;background-color:var(--rtk-scrollbar-background, transparent)}.scrollbar::-webkit-scrollbar-thumb{border-radius:9999px;background-color:var(--rtk-scrollbar-color, rgb(var(--rtk-colors-background-600, 60 60 60)))}:host{margin-top:var(--rtk-space-2, 8px);margin-bottom:var(--rtk-space-2, 8px);display:flex;height:100%;width:100%;flex-direction:column;font-size:14px;color:rgb(var(--rtk-colors-text-1000, 255 255 255))}h3{margin-left:var(--rtk-space-0, 0px);margin-right:var(--rtk-space-0, 0px);margin-top:var(--rtk-space-4, 16px);margin-bottom:var(--rtk-space-4, 16px);display:block;padding:var(--rtk-space-0, 0px);font-size:16px;font-weight:400;color:rgb(var(--rtk-colors-text-900, 255 255 255 / 0.88));text-align:center}ul{overflow-y:auto;padding:var(--rtk-space-0, 0px);flex-grow:1;flex-basis:0}.metadata{display:flex;align-items:center}.metadata img{height:var(--rtk-space-8, 32px);width:var(--rtk-space-8, 32px);border-radius:var(--rtk-border-radius-sm, 4px)}.metadata .name{margin-left:var(--rtk-space-2, 8px);font-weight:500}.plugin{display:flex;align-items:center;justify-content:space-between;padding-left:var(--rtk-space-4, 16px);padding-right:var(--rtk-space-4, 16px);padding-top:var(--rtk-space-2, 8px);padding-bottom:var(--rtk-space-2, 8px)}.plugin .buttons{display:flex;align-items:center}rtk-button:hover{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 #0000);--tw-ring-opacity:1;--tw-ring-color:rgba(var(--rtk-colors-brand-500, 33 96 253) / var(--tw-ring-opacity));--tw-ring-offset-width:2px;--tw-ring-offset-color:rgb(var(--rtk-colors-background-1000, 8 8 8))}";var ix=function(t,e,i,r){var a,s=arguments.length,n=s<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,i,r);else for(var o=t.length-1;o>=0;o--)(a=t[o])&&(n=(s<3?a(n):s>3?a(e,i,n):a(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};const rx=class{constructor(t){o(this,t),this.config=De,this.iconPack=je,this.t=Fe(),this.create=!1,this.onPollsUpdate=t=>{this.polls=[...t.polls]},this.onUpdatePermissions=()=>{this.permissions=this.meeting.self.permissions}}connectedCallback(){this.meetingChanged(this.meeting)}disconnectedCallback(){var t;null!=this.meeting&&(null===(t=this.meeting.polls)||void 0===t||t.removeListener("pollsUpdate",this.onPollsUpdate),this.meeting.self.permissions.removeListener("pollsUpdate",this.onUpdatePermissions))}meetingChanged(t){null!=t&&(t&&!t.polls||(this.permissions=this.meeting.self.permissions,this.polls=[...t.polls.items],t.polls.addListener("pollsUpdate",this.onPollsUpdate),this.meeting.self.permissions.addListener("pollsUpdate",this.onUpdatePermissions),this.onCreate=async e=>{this.create=!1,await t.polls.create(e.question,e.options,e.anonymous,e.hideVotes)},this.onVote=async(e,i)=>{await t.polls.vote(e,i)}))}toggleCreateState(){this.create=!this.create}componentDidRender(){Xi(this.pollEl)}render(){return N(H,{key:"aac0c84486146fa17436746fb6def9cc4e539a2c"},N("div",{key:"179c4496372623a2ea2f7c0b555b84ea1cae12ee",class:"ctr",part:"container"},N("div",{key:"07b09fc28d75b1d40dec83eecae3661dfca1dbd2",class:"polls-view scrollbar",ref:t=>this.pollEl=t,part:"polls"},0==this.polls.length&&!0!==this.create&&N("div",{key:"841f91b0da755e48498c520a8234cf6b926b058c",class:"empty-polls"},this.t("polls.empty")),this.polls.map((t=>{var e;return N("rtk-poll",{key:t.id,poll:t,onRtkVotePoll:t=>{this.onVote(t.detail.id,t.detail.index)},self:null===(e=this.meeting)||void 0===e?void 0:e.self.userId,iconPack:this.iconPack,t:this.t,permissions:this.permissions})})),this.create&&N("rtk-poll-form",{key:"c6545dffc24f5409417666404ab73bf546834a8b",part:"poll-form",onRtkCreatePoll:t=>{this.onCreate(t.detail)},iconPack:this.iconPack,t:this.t})),this.permissions.polls.canCreate&&N("rtk-button",{key:"69651546ee9a00f9b9c467e0f2307f5ce2dc1383",kind:"wide",onClick:()=>this.toggleCreateState(),variant:this.create?"secondary":"primary",part:"button"},this.create?this.t("polls.cancel"):this.t("polls.create"))))}static get watchers(){return{meeting:["meetingChanged"]}}};ix([ai()],rx.prototype,"meeting",void 0),ix([ai()],rx.prototype,"size",void 0),ix([ai()],rx.prototype,"iconPack",void 0),ix([ai()],rx.prototype,"t",void 0),rx.style=":host{line-height:initial;font-family:var(--rtk-font-family, sans-serif);font-feature-settings:normal;font-variation-settings:normal}p{margin:var(--rtk-space-0, 0px);padding:var(--rtk-space-0, 0px)}.scrollbar{scrollbar-width:thin;scrollbar-color:var(--rtk-scrollbar-color, rgb(var(--rtk-colors-background-600, 60 60 60)))\n var(--rtk-scrollbar-background, transparent)}.scrollbar::-webkit-scrollbar{height:var(--rtk-space-1\\.5, 6px);width:var(--rtk-space-1\\.5, 6px);border-radius:9999px;background-color:var(--rtk-scrollbar-background, transparent)}.scrollbar::-webkit-scrollbar-thumb{border-radius:9999px;background-color:var(--rtk-scrollbar-color, rgb(var(--rtk-colors-background-600, 60 60 60)))}:host{margin-top:var(--rtk-space-2, 8px);display:flex;height:100%;width:100%;flex-direction:column;font-size:14px}*{box-sizing:border-box}.ctr{box-sizing:border-box;padding:var(--rtk-space-3, 12px);padding-top:var(--rtk-space-0, 0px);display:flex;flex:1 1 0%;flex-direction:column}.polls-view{overflow-y:auto;flex:1 1 0%;flex-basis:0}.empty-polls{display:flex;height:100%;width:100%;align-items:center;justify-content:center}";var ax=Object.freeze({__proto__:null,rtk_plugins:ex,rtk_polls:rx});var sx=function(t,e,i,r){var a,s=arguments.length,n=s<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,i,r);else for(var o=t.length-1;o>=0;o--)(a=t[o])&&(n=(s<3?a(n):s>3?a(e,i,n):a(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};const nx=class{constructor(t){o(this,t),this.stateUpdate=Y(this,"rtkStateUpdate",7),this.iconPack=je,this.t=Fe()}render(){var t,e;if(null==this.meeting)return null;const i={meeting:this.meeting,states:this.states,size:this.size,iconPack:this.iconPack,t:this.t},r=this.states,a=!0===(null===(t=null==r?void 0:r.prefs)||void 0===t?void 0:t.muteNotificationSounds)||"true"===Ve("mute-notification-sounds");return N(H,null,N("rtk-microphone-selector",Object.assign({},i),N("rtk-audio-visualizer",{participant:null===(e=this.meeting)||void 0===e?void 0:e.self,iconPack:this.iconPack,t:this.t,slot:"indicator"})),N("rtk-speaker-selector",Object.assign({},i)),N("div",{class:"group",part:"notification-toggle"},N("div",{class:"row"},N("label",{htmlFor:"notification-toggle"},this.t("settings.notification_sound")),N("rtk-switch",{id:"notification-toggle",checked:!a,onRtkChange:t=>{const{checked:e}=t.target,i=!e;this.stateUpdate.emit({prefs:{muteNotificationSounds:i}}),Ge("mute-notification-sounds",i)},iconPack:this.iconPack,t:this.t}))))}};sx([ai()],nx.prototype,"meeting",void 0),sx([ai()],nx.prototype,"states",void 0),sx([ai()],nx.prototype,"size",void 0),sx([ai()],nx.prototype,"iconPack",void 0),sx([ai()],nx.prototype,"t",void 0),nx.style=":host{line-height:initial;font-family:var(--rtk-font-family, sans-serif);font-feature-settings:normal;font-variation-settings:normal}p{margin:var(--rtk-space-0, 0px);padding:var(--rtk-space-0, 0px)}:host{display:flex;width:100%;flex-direction:column}audio{visibility:hidden}.group{margin-top:var(--rtk-space-2, 8px);margin-bottom:var(--rtk-space-2, 8px)}.group>*{margin-bottom:var(--rtk-space-2, 8px)}.group>*:last-child{margin-bottom:var(--rtk-space-0, 0px)}.group select{flex:1 1 0%}rtk-audio-visualizer{flex-shrink:0}rtk-button{border-radius:var(--rtk-border-radius-sm, 4px);--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-background-700, 44 44 44) / var(--tw-bg-opacity));--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)}rtk-button rtk-icon{margin-right:var(--rtk-space-2, 8px)}";var ox=function(t,e,i,r){var a,s=arguments.length,n=s<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,i,r);else for(var o=t.length-1;o>=0;o--)(a=t[o])&&(n=(s<3?a(n):s>3?a(e,i,n):a(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};const cx=class{constructor(t){o(this,t),this.stateUpdate=Y(this,"rtkStateUpdate",7),this.iconPack=je,this.t=Fe(),this.onVideoUpdate=t=>{this.videoEnabled=t.videoEnabled}}componentDidLoad(){this.meetingChanged(this.meeting)}meetingChanged(t){var e;null!=t&&(this.videoEnabled=t.self.videoEnabled,null===(e=t.self)||void 0===e||e.addListener("videoUpdate",this.onVideoUpdate))}disconnectedCallback(){var t;null===(t=this.meeting.self)||void 0===t||t.removeListener("videoUpdate",this.onVideoUpdate)}render(){var t,e,i;if(null==this.meeting)return null;const r={meeting:this.meeting,states:this.states,size:this.size,iconPack:this.iconPack,t:this.t},a=this.states,s=!0===(null===(t=null==a?void 0:a.prefs)||void 0===t?void 0:t.mirrorVideo)||"true"===Ve("mirror-video");return N(H,null,N("div",{class:"section",part:"tile-preview"},N("div",{class:"group",part:"tile-preview"},!0===this.videoEnabled?N("rtk-participant-tile",{meeting:this.meeting,participant:null===(e=this.meeting)||void 0===e?void 0:e.self,iconPack:this.iconPack,t:this.t,states:a,size:this.size,isPreview:!0}):N("div",{class:"camera-off-helper"},N("rtk-participant-tile",{meeting:this.meeting,participant:null===(i=this.meeting)||void 0===i?void 0:i.self,size:this.size},N("div",null,N("rtk-icon",{id:"icon",icon:this.iconPack.video_off,tabIndex:-1,"aria-hidden":!0}),N("div",null,this.t("settings.camera_off"))))))),N("rtk-camera-selector",Object.assign({},r)),N("div",{class:"group",part:"mirror-toggle"},N("div",{class:"row"},N("label",{htmlFor:"mirror-toggle"},this.t("settings.mirror_video")),N("rtk-switch",{checked:s,iconPack:this.iconPack,t:this.t,onRtkChange:t=>{const{checked:e}=t.target;this.stateUpdate.emit({prefs:{mirrorVideo:e}}),Ge("mirror-video",e)}}))))}static get watchers(){return{meeting:["meetingChanged"]}}};ox([ai()],cx.prototype,"meeting",void 0),ox([ai()],cx.prototype,"states",void 0),ox([ai()],cx.prototype,"size",void 0),ox([ai()],cx.prototype,"iconPack",void 0),ox([ai()],cx.prototype,"t",void 0),cx.style=":host{line-height:initial;font-family:var(--rtk-font-family, sans-serif);font-feature-settings:normal;font-variation-settings:normal}p{margin:var(--rtk-space-0, 0px);padding:var(--rtk-space-0, 0px)}.rtk-select{--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-background-700, 44 44 44) / var(--tw-bg-opacity));color:rgb(var(--rtk-colors-text-1000, 255 255 255))}.rtk-select:focus{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(0px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 #0000)}.rtk-select{display:block;border-radius:var(--rtk-border-radius-sm, 4px);border-width:var(--rtk-border-width-none, 0);border-style:none;-webkit-appearance:none;-moz-appearance:none;appearance:none;padding:var(--rtk-space-3, 12px);font-size:16px;--icon-size:var(--rtk-select-chevron-size, var(--rtk-space-6, 24px));--icon-right-position:var(--rtk-select-chevron-right-position, var(--rtk-space-2, 8px));background-image:url(\"data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e\");background-position:right var(--icon-right-position) center;background-repeat:no-repeat;background-size:var(--icon-size) var(--icon-size);padding-right:calc(var(--icon-right-position) * 5)}:host{display:flex;width:100%;flex-direction:column}.rtk-select{width:100%;text-overflow:ellipsis}rtk-participant-tile{margin-left:auto;margin-right:auto;margin-bottom:var(--rtk-space-4, 16px);max-width:100%}#icon{padding-bottom:var(--rtk-space-1, 4px)}.apply-button{height:var(--rtk-space-10, 40px)}label{-webkit-user-select:none;-moz-user-select:none;user-select:none;font-size:14px}.group{margin-top:var(--rtk-space-2, 8px);margin-bottom:var(--rtk-space-2, 8px)}.group>*{margin-bottom:var(--rtk-space-2, 8px)}.group>*:last-child{margin-bottom:var(--rtk-space-0, 0px)}.group select{flex:1 1 0%}.row{display:flex;align-items:center;justify-content:space-between;gap:var(--rtk-space-3, 12px)}.section{display:flex;flex-direction:column}@media only screen and (max-height: 480px) and (orientation: landscape){:host{flex-direction:row}:host([size='sm']){flex-direction:row}.section[part='tile-preview']{margin-left:var(--rtk-space-2, 8px);margin-right:var(--rtk-space-2, 8px);max-height:90%;max-width:40%;flex-shrink:1}.section[part='video-settings']{margin-left:var(--rtk-space-2, 8px);margin-right:var(--rtk-space-2, 8px);flex-grow:1}}";var lx=Object.freeze({__proto__:null,rtk_settings_audio:nx,rtk_settings_video:cx});const dx=class{constructor(t){o(this,t),this.dismiss=Y(this,"rtkTranscriptDismiss",7),this.t=Fe()}connectedCallback(){this.transcriptChanged(this.transcript)}transcriptChanged(t,e){if((null==e?void 0:e.renderedId)===t.renderedId&&(null==e?void 0:e.transcript)===t.transcript)return;if(clearTimeout(this.timeout),!(null==t?void 0:t.name)||!(null==t?void 0:t.transcript))return;const{id:i,renderedId:r}=t;this.timeout=setTimeout((()=>{this.dismiss.emit({id:i,renderedId:r})}),1e4)}render(){return N(H,{key:"d3efdcb1d165c36ffcb706dea742420f8c6c003d"},N("div",{key:"3b00a1827697ff4d13b62edfa46889b71226f004",class:"ctr"},N("p",{key:"908819abb385a61cf06de6f43f57274e5f494b93",class:"message"},N("span",{key:"7f951cddb567daed904a6ecbabb766794e659438",class:"name"},this.transcript.name),": ",this.transcript.transcript)))}static get watchers(){return{transcript:["transcriptChanged"]}}};!function(t,e,i,r){var a,s=arguments.length,n=s<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,i,r);else for(var o=t.length-1;o>=0;o--)(a=t[o])&&(n=(s<3?a(n):s>3?a(e,i,n):a(e,i))||n);s>3&&n&&Object.defineProperty(e,i,n)}([ai()],dx.prototype,"t",void 0),dx.style=":host{line-height:initial;font-family:var(--rtk-font-family, sans-serif);font-feature-settings:normal;font-variation-settings:normal}p{margin:var(--rtk-space-0, 0px);padding:var(--rtk-space-0, 0px)}:host{pointer-events:none;display:block;color:rgb(var(--rtk-colors-text-1000, 255 255 255));display:flex;justify-content:center;vertical-align:middle;animation:show 0.4s ease;transition:0.4s;z-index:5;width:100%}.ctr{box-sizing:border-box;display:inline-flex;height:100%;align-items:center;padding-left:var(--rtk-space-3, 12px);padding-right:var(--rtk-space-3, 12px);-webkit-user-select:none;-moz-user-select:none;user-select:none;border-radius:var(--rtk-border-radius-md, 8px);--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-background-600, 60 60 60) / var(--tw-bg-opacity));--tw-shadow:0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);--tw-shadow-colored:0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);--tw-shadow-color:rgb(var(--rtk-colors-background-1000, 8 8 8));--tw-shadow:var(--tw-shadow-colored);pointer-events:auto;padding:var(--rtk-space-3, 12px);overflow:auto;max-width:50%}.message{margin:var(--rtk-space-0, 0px);display:inline-block;justify-content:center;max-width:100%;text-wrap:wrap;line-height:1.5rem}.message .name{font-weight:bold}:host(.exit){animation:exit 0.4s ease}@keyframes show{0%{opacity:0;transform:translateY(120px)}100%{opacity:1;transform:translateY(0px)}}@keyframes exit{0%{opacity:1;transform:translateY(0)}100%{opacity:0;transform:translateY(-120px)}}:host([size='sm']){font-size:14px}";var hx=Object.freeze({__proto__:null,rtk_transcript:dx});const px=(t,e)=>{if(null==t)return;const i=Math.round(1.5),r=[...Array(3)].map(((t,r)=>{let a=r;return a>i-1&&(a=3-a-1),Math.round((a+1)/(i+1)*e)})),{width:a,height:s}=t,n=t.getContext("2d");let o=2;const c=1*a/r.length,l=c-4;n.clearRect(0,0,a,s),n.fillStyle="rgb(0,0,0,0.0)",n.fillRect(0,0,a,s);const d=getComputedStyle(t).getPropertyValue("color");n.fillStyle=d,n.strokeStyle=d,n.lineCap="round",n.lineWidth=4,n.beginPath();for(const t of r){const e=Math.min(-Math.abs(1.2*t/10*s)+s/2,s/2-2.5),i=Math.max(2*(s/2-e),5);n.moveTo(o+l/2,e),n.lineTo(o+l/2,e+i),o+=c}n.stroke()};var gx=function(t,e,i,r){var a,s=arguments.length,n=s<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,i,r);else for(var o=t.length-1;o>=0;o--)(a=t[o])&&(n=(s<3?a(n):s>3?a(e,i,n):a(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};const ux=class{constructor(t){o(this,t),this.variant="bars",this.iconPack=je,this.t=Fe(),this.hideMuted=!1,this.isScreenShare=!1,this.volume=0}connectedCallback(){this.participantChanged(this.participant)}componentDidLoad(){px(this.visualizer,0)}disconnectedCallback(){var t,e,i;null===(t=this.hark)||void 0===t||t.stop(),this.audioUpdateListener&&(null===(e=this.participant)||void 0===e||e.removeListener("audioUpdate",this.audioUpdateListener)),this.screenShareUpdateListener&&(null===(i=this.participant)||void 0===i||i.removeListener("screenShareUpdate",this.screenShareUpdateListener))}participantChanged(t){null!=t&&(this.audioUpdateListener=({audioEnabled:t,audioTrack:e})=>{var i;if(null===(i=this.hark)||void 0===i||i.stop(),t&&null!=e){this.audioEnabled=!0;const t=new MediaStream;t.addTrack(e),this.calcVolume(t),px(this.visualizer,0)}else this.volume=0,this.audioEnabled=!1},this.isScreenShare?(this.screenShareUpdateListener=({screenShareEnabled:t,screenShareTracks:e})=>{this.audioUpdateListener({audioEnabled:t&&null!=e.audio,audioTrack:e.audio})},this.screenShareUpdateListener({screenShareEnabled:t.screenShareEnabled,screenShareTracks:{audio:t.screenShareTracks.audio,video:t.screenShareTracks.video}}),t.addListener("screenShareUpdate",this.screenShareUpdateListener)):(this.audioUpdateListener(t),t.addListener("audioUpdate",this.audioUpdateListener)))}calcVolume(t){this.hark=xl(t,{play:!1,interval:100}),this.hark.on("volume_change",(t=>{const e=this.volume;let i=Math.round(10**(t/115)*10);i<3&&(i=0);let r=Math.round((2*e+i)/3);e!==r&&(this.volume=r,px(this.visualizer,this.volume))}))}render(){return N(H,{key:"349422ab6a49e3c2dd84f0f41b51828dfd571d20"},N("div",{key:"7564acaefc95a3610db3020a8e0de44f9d8bff48",class:{hideMuted:this.hideMuted}},N("canvas",{key:"870ff1f131c8727ac52b6126fbb3c0080756c82d",width:"24",height:"24",class:{bars:!0,visible:this.audioEnabled},ref:t=>this.visualizer=t,part:"canvas"}),!this.isScreenShare&&!this.audioEnabled&&!0!==this.hideMuted&&N("rtk-icon",{key:"868d229037f6029ec95ab38b1345783a95fe5c6d",icon:this.iconPack.mic_off,part:"mic-off-icon"})))}static get watchers(){return{participant:["participantChanged"]}}};gx([ai()],ux.prototype,"size",void 0),gx([ai()],ux.prototype,"iconPack",void 0),gx([ai()],ux.prototype,"t",void 0),ux.style=":host{line-height:initial;font-family:var(--rtk-font-family, sans-serif);font-feature-settings:normal;font-variation-settings:normal}p{margin:var(--rtk-space-0, 0px);padding:var(--rtk-space-0, 0px)}:host{display:block;width:-moz-fit-content;width:fit-content}.hideMuted{padding:var(--rtk-space-1, 4px)}canvas,rtk-icon{height:var(--rtk-space-6, 24px);width:var(--rtk-space-6, 24px)}:host([size='sm']){transform:scale(0.9)}canvas{display:none}canvas.visible{display:block}canvas.bars{--tw-text-opacity:1;color:rgba(var(--rtk-colors-brand-500, 33 96 253) / var(--tw-text-opacity))}";var fx=function(t,e,i,r){var a,s=arguments.length,n=s<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,i,r);else for(var o=t.length-1;o>=0;o--)(a=t[o])&&(n=(s<3?a(n):s>3?a(e,i,n):a(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};const mx=class{constructor(t){o(this,t),this.iconPack=je,this.variant="full",this.t=Fe(),this.audioinputDevices=[],this.canProduceAudio=!0,this.currentDevices={audio:void 0},this.stageStateListener=()=>{this.canProduceAudio="ALLOWED"===this.meeting.self.permissions.canProduceAudio},this.deviceListUpdateListener=async()=>{const t=await this.meeting.self.getAudioDevices();this.audioinputDevices=t},this.deviceUpdateListener=({device:t})=>{"audioinput"===t.kind&&(this.currentDevices={audio:t})},this.mediaPermissionUpdateListener=async({kind:t,message:e})=>{this.meeting&&"audio"===t&&"ACCEPTED"===e&&(this.audioinputDevices=await this.meeting.self.getAudioDevices())}}connectedCallback(){this.meetingChanged(this.meeting)}disconnectedCallback(){var t,e,i,r,a;null===(e=null===(t=this.meeting)||void 0===t?void 0:t.stage)||void 0===e||e.removeListener("stageStatusUpdate",this.stageStateListener),null===(i=this.meeting)||void 0===i||i.self.removeListener("deviceListUpdate",this.deviceListUpdateListener),null===(r=this.meeting)||void 0===r||r.self.removeListener("deviceUpdate",this.deviceUpdateListener),null===(a=this.meeting)||void 0===a||a.self.removeListener("mediaPermissionUpdate",this.mediaPermissionUpdateListener)}meetingChanged(t){null!=t&&C((async()=>{var e,i;const{self:r,stage:a}=t,s=await t.self.getAudioDevices(),n=null===(e=t.self.getCurrentDevices())||void 0===e?void 0:e.audio;this.currentDevices={audio:n},this.canProduceAudio="ALLOWED"===this.meeting.self.permissions.canProduceAudio,null==a||a.addListener("stageStatusUpdate",this.stageStateListener),r.addListener("deviceListUpdate",this.deviceListUpdateListener),r.addListener("deviceUpdate",this.deviceUpdateListener),r.addListener("mediaPermissionUpdate",this.mediaPermissionUpdateListener),this.audioinputDevices=null!=n?[null!==(i=s.find((t=>t.deviceId===n.deviceId)))&&void 0!==i?i:n,...s.filter((t=>t.deviceId!==n.deviceId))]:s}))}setDevice(t){var e;if(oe(this.meeting))return;const i=this.audioinputDevices.find((e=>e.deviceId===t));null!=i&&(this.currentDevices={audio:i},null===(e=this.meeting)||void 0===e||e.self.setDevice(i))}render(){if(null==this.meeting)return null;let t=0;return N(H,null,this.canProduceAudio&&N("div",{part:"microphone-selection",class:"group container "+this.variant},N("label",{slot:"label"},"inline"!==this.variant&&this.t("settings.microphone_input"),N("rtk-icon",{icon:this.iconPack.mic_on,size:"sm"})),N("div",{class:"row"},N("select",{class:"rtk-select",onChange:t=>this.setDevice(t.target.value)},this.audioinputDevices.map((({deviceId:e,label:i})=>{var r;return N("option",{value:e,selected:(null===(r=this.currentDevices.audio)||void 0===r?void 0:r.deviceId)===e},i||"Microphone "+ ++t)}))),N("slot",{name:"indicator"}))))}static get watchers(){return{meeting:["meetingChanged"]}}};fx([ai()],mx.prototype,"meeting",void 0),fx([ai()],mx.prototype,"size",void 0),fx([ai()],mx.prototype,"iconPack",void 0),fx([ai()],mx.prototype,"t",void 0),mx.style=".rtk-select{--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-background-700, 44 44 44) / var(--tw-bg-opacity));color:rgb(var(--rtk-colors-text-1000, 255 255 255))}.rtk-select:focus{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(0px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 #0000)}.rtk-select{display:block;border-radius:var(--rtk-border-radius-sm, 4px);border-width:var(--rtk-border-width-none, 0);border-style:none;-webkit-appearance:none;-moz-appearance:none;appearance:none;padding:var(--rtk-space-3, 12px);font-size:16px;--icon-size:var(--rtk-select-chevron-size, var(--rtk-space-6, 24px));--icon-right-position:var(--rtk-select-chevron-right-position, var(--rtk-space-2, 8px));background-image:url(\"data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e\");background-position:right var(--icon-right-position) center;background-repeat:no-repeat;background-size:var(--icon-size) var(--icon-size);padding-right:calc(var(--icon-right-position) * 5);width:100%;max-width:100%;text-overflow:ellipsis}.inline .rtk-select{margin-top:var(--rtk-space-1, 4px);width:100%;padding-top:var(--rtk-space-1, 4px);padding-bottom:var(--rtk-space-1, 4px);padding-left:var(--rtk-space-1\\.5, 6px);padding-right:var(--rtk-space-1\\.5, 6px);padding-right:var(--rtk-space-8, 32px);font-size:14px}.row{margin-bottom:var(--rtk-space-2, 8px);display:flex;width:100%;align-items:center;justify-content:space-between;gap:var(--rtk-space-3, 12px)}.group{margin-top:var(--rtk-space-2, 8px);margin-bottom:var(--rtk-space-2, 8px)}.group>*{margin-bottom:var(--rtk-space-2, 8px)}.group>*:last-child{margin-bottom:var(--rtk-space-0, 0px)}.group select{flex:1 1 0%}.inline.group{margin-top:var(--rtk-space-0, 0px);margin-bottom:var(--rtk-space-0\\.5, 2px)}.inline.group>*{margin-bottom:var(--rtk-space-0, 0px)}label{display:flex;-webkit-user-select:none;-moz-user-select:none;user-select:none;align-items:center;gap:var(--rtk-space-1, 4px);font-size:14px}.inline.container{display:flex;align-items:center;justify-content:flex-start;gap:var(--rtk-space-2, 8px);padding-left:var(--rtk-space-2, 8px);padding-right:var(--rtk-space-2, 8px)}";var vx=function(t,e,i,r){var a,s=arguments.length,n=s<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,i,r);else for(var o=t.length-1;o>=0;o--)(a=t[o])&&(n=(s<3?a(n):s>3?a(e,i,n):a(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};const bx=class{constructor(t){o(this,t),this.variant="full",this.iconPack=je,this.t=Fe(),this.speakerDevices=[],this.currentDevices={speaker:void 0},this.deviceListUpdateListener=async()=>{const t=await this.meeting.self.getSpeakerDevices();this.speakerDevices=t},this.deviceUpdateListener=({device:t})=>{"audiooutput"===t.kind&&(this.currentDevices={speaker:t})},this.mediaPermissionUpdate=async({kind:t,message:e})=>{this.meeting&&"audio"===t&&"ACCEPTED"===e&&(this.speakerDevices=await this.meeting.self.getSpeakerDevices())}}connectedCallback(){this.meetingChanged(this.meeting)}disconnectedCallback(){var t,e,i;null===(t=this.meeting)||void 0===t||t.self.removeListener("deviceListUpdate",this.deviceListUpdateListener),null===(e=this.meeting)||void 0===e||e.self.removeListener("deviceUpdate",this.deviceUpdateListener),null===(i=this.meeting)||void 0===i||i.self.addListener("mediaPermissionUpdate",this.mediaPermissionUpdate)}meetingChanged(t){null!=t&&C((async()=>{var e,i;const{self:r}=t,a=await t.self.getSpeakerDevices(),s=null===(e=t.self.getCurrentDevices())||void 0===e?void 0:e.speaker;this.currentDevices={speaker:s},r.addListener("deviceListUpdate",this.deviceListUpdateListener),r.addListener("deviceUpdate",this.deviceUpdateListener),r.addListener("mediaPermissionUpdate",this.mediaPermissionUpdate),this.speakerDevices=null!=s?[null!==(i=a.find((t=>t.deviceId===s.deviceId)))&&void 0!==i?i:s,...a.filter((t=>t.deviceId!==s.deviceId))]:a}))}testAudio(){var t;null===(t=this.testAudioEl)||void 0===t||t.play()}setDevice(t){var e,i;if(oe(this.meeting))return;const r=this.speakerDevices.find((e=>e.deviceId===t));this.currentDevices={speaker:r},null!=r&&(null===(e=this.meeting)||void 0===e||e.self.setDevice(r),null===(i=this.testAudioEl)||void 0===i||i.setSinkId(r.deviceId))}render(){if(null==this.meeting)return null;let t=0;return N(H,null,N("audio",{preload:"auto",src:"https://assets.dyte.io/ui-kit/speaker-test.mp3",ref:t=>this.testAudioEl=t}),N("div",{class:"group "+this.variant,part:"speaker-selection"},this.speakerDevices.length>0&&!oe(this.meeting)&&N("div",{class:"container"},N("label",null,"inline"!==this.variant&&this.t("settings.speaker_output"),N("rtk-icon",{icon:this.iconPack.speaker,size:"sm"})),N("div",{class:"row"},N("select",{class:"rtk-select",onChange:t=>this.setDevice(t.target.value)},this.speakerDevices.map((({deviceId:e,label:i})=>{var r;return N("option",{value:e,selected:(null===(r=this.currentDevices.speaker)||void 0===r?void 0:r.deviceId)===e},i||"Speaker "+ ++t)}))))),"full"===this.variant&&N("rtk-button",{variant:"secondary",onClick:()=>this.testAudio()},N("rtk-icon",{icon:this.iconPack.speaker,slot:"start"}),this.t("test"))))}static get watchers(){return{meeting:["meetingChanged"]}}};vx([ai()],bx.prototype,"meeting",void 0),vx([ai()],bx.prototype,"states",void 0),vx([ai()],bx.prototype,"size",void 0),vx([ai()],bx.prototype,"iconPack",void 0),vx([ai()],bx.prototype,"t",void 0),bx.style=".rtk-select{--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-background-700, 44 44 44) / var(--tw-bg-opacity));color:rgb(var(--rtk-colors-text-1000, 255 255 255))}.rtk-select:focus{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(0px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 #0000)}.rtk-select{display:block;border-radius:var(--rtk-border-radius-sm, 4px);border-width:var(--rtk-border-width-none, 0);border-style:none;-webkit-appearance:none;-moz-appearance:none;appearance:none;padding:var(--rtk-space-3, 12px);font-size:16px;--icon-size:var(--rtk-select-chevron-size, var(--rtk-space-6, 24px));--icon-right-position:var(--rtk-select-chevron-right-position, var(--rtk-space-2, 8px));background-image:url(\"data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e\");background-position:right var(--icon-right-position) center;background-repeat:no-repeat;background-size:var(--icon-size) var(--icon-size);padding-right:calc(var(--icon-right-position) * 5);width:100%;max-width:100%;text-overflow:ellipsis}.inline .rtk-select{margin-top:var(--rtk-space-1, 4px);width:100%;padding-top:var(--rtk-space-1, 4px);padding-bottom:var(--rtk-space-1, 4px);padding-left:var(--rtk-space-1\\.5, 6px);padding-right:var(--rtk-space-1\\.5, 6px);padding-right:var(--rtk-space-8, 32px);font-size:14px}.row{display:flex;width:100%;align-items:center;justify-content:space-between;gap:var(--rtk-space-3, 12px)}.group{margin-top:var(--rtk-space-2, 8px);margin-bottom:var(--rtk-space-2, 8px)}.group>*{margin-bottom:var(--rtk-space-2, 8px)}.group>*:last-child{margin-bottom:var(--rtk-space-0, 0px)}.group select{flex:1 1 0%}.inline.group{margin-top:var(--rtk-space-0, 0px);margin-bottom:var(--rtk-space-0\\.5, 2px)}.inline.group>*{margin-bottom:var(--rtk-space-0, 0px)}label{display:flex;-webkit-user-select:none;-moz-user-select:none;user-select:none;align-items:center;gap:var(--rtk-space-1, 4px);font-size:14px}.inline .container{display:flex;align-items:center;justify-content:flex-start;gap:var(--rtk-space-2, 8px);padding-left:var(--rtk-space-2, 8px);padding-right:var(--rtk-space-2, 8px)}";var kx=function(t,e,i,r){var a,s=arguments.length,n=s<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,i,r);else for(var o=t.length-1;o>=0;o--)(a=t[o])&&(n=(s<3?a(n):s>3?a(e,i,n):a(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};const yx=class{constructor(t){o(this,t),this.onChange=Y(this,"rtkChange",4),this.checked=!1,this.readonly=!1,this.disabled=!1,this.iconPack=je,this.t=Fe(),this.onClick=()=>{this.readonly||this.disabled||(this.checked=!this.checked)},this.onKeyPress=t=>{if(!this.readonly)switch(t.key){case"Enter":case" ":this.checked=!this.checked}}}connectedCallback(){this.checkedChange(this.checked)}checkedChange(t){this.checked=t,this.onChange.emit(t)}render(){return N(H,{key:"81e9d824ee0dff9a77250a93ef822c1a46fa80a8",role:"switch",tabIndex:this.disabled&&0,"aria-readonly":this.readonly,"aria-checked":this.checked,"aria-disabled":this.disabled,class:{checked:this.checked},onClick:this.onClick,onKeyPress:this.onKeyPress},N("div",{key:"32d41bcd264ad0b9484eb994c8880935d499ebcf",class:"switch",part:"switch"}))}static get watchers(){return{checked:["checkedChange"]}}};kx([ai()],yx.prototype,"iconPack",void 0),kx([ai()],yx.prototype,"t",void 0),yx.style=":host{line-height:initial;font-family:var(--rtk-font-family, sans-serif);font-feature-settings:normal;font-variation-settings:normal}p{margin:var(--rtk-space-0, 0px);padding:var(--rtk-space-0, 0px)}:host{box-sizing:border-box;display:inline-flex;height:var(--rtk-space-6, 24px);width:var(--rtk-space-10, 40px);align-items:center;padding:var(--rtk-space-1, 4px);border-radius:9999px;background-color:rgb(var(--rtk-colors-text-600, 255 255 255 / 0.52));cursor:pointer}.switch{box-sizing:border-box;height:var(--rtk-space-4, 16px);width:var(--rtk-space-4, 16px);background-color:rgb(var(--rtk-colors-text-on-brand-1000, var(--rtk-colors-text-1000, 255 255 255)));border-radius:9999px;transition-property:var(--rtk-transition-property, all);transition-duration:200ms}:host(.checked){--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-brand-500, 33 96 253) / var(--tw-bg-opacity))}:host(.checked) .switch{transform:translateX(100%)}:host([readonly]),:host([disabled]){cursor:not-allowed;opacity:0.6}";var wx=Object.freeze({__proto__:null,rtk_audio_visualizer:ux,rtk_microphone_selector:mx,rtk_speaker_selector:bx,rtk_switch:yx});var xx=function(t,e,i,r){var a,s=arguments.length,n=s<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,i,r);else for(var o=t.length-1;o>=0;o--)(a=t[o])&&(n=(s<3?a(n):s>3?a(e,i,n):a(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};const Sx=class{constructor(t){o(this,t),this.stateUpdate=Y(this,"rtkStateUpdate",7),this.variant="button",this.iconPack=je,this.t=Fe(),this.fullScreenActive=!1,this.isFullScreenSupported=!0,this.onFullScreenchange=()=>{this.fullScreenActive=Lp()},this.toggleFullScreen=()=>{let t=this.targetElement||document.querySelector("rtk-meeting");t&&(this.fullScreenActive?(Tp(),this.fullScreenActive=!1):(Ep(t),this.fullScreenActive=!0),this.stateUpdate.emit({activeMoreMenu:!1}))}}connectedCallback(){this.isFullScreenSupported=_p(),this.onFullScreenchange(),window.addEventListener("webkitfullscreenchange",this.onFullScreenchange),window.addEventListener("fullscreenchange",this.onFullScreenchange)}disconnectedCallback(){window.removeEventListener("webkitfullscreenchange",this.onFullScreenchange),window.removeEventListener("fullscreenchange",this.onFullScreenchange)}render(){return this.isFullScreenSupported?N(H,{title:this.t("full_screen")},N("rtk-controlbar-button",{size:this.size,iconPack:this.iconPack,onClick:this.toggleFullScreen,icon:this.fullScreenActive?this.iconPack.full_screen_minimize:this.iconPack.full_screen_maximize,label:this.fullScreenActive?this.t("full_screen.exit"):this.t("full_screen"),variant:this.variant})):N(H,{"data-hidden":!0})}};xx([ai()],Sx.prototype,"states",void 0),xx([ai()],Sx.prototype,"size",void 0),xx([ai()],Sx.prototype,"iconPack",void 0),xx([ai()],Sx.prototype,"t",void 0),Sx.style=":host{line-height:initial;font-family:var(--rtk-font-family, sans-serif);font-feature-settings:normal;font-variation-settings:normal}p{margin:var(--rtk-space-0, 0px);padding:var(--rtk-space-0, 0px)}:host{display:block}:host([data-hidden]){display:none}";var Px=Object.freeze({__proto__:null,rtk_fullscreen_toggle:Sx});var Cx=function(t,e,i,r){var a,s=arguments.length,n=s<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,i,r);else for(var o=t.length-1;o>=0;o--)(a=t[o])&&(n=(s<3?a(n):s>3?a(e,i,n):a(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};const Ex=class{constructor(t){o(this,t),this.rtkSendNotification=Y(this,"rtkSendNotification",7),this.pinnedListener=({isPinned:t})=>{this.isPinned=t},this.toggleTileListener=({hidden:t})=>{this.isHidden=t},this.stageListener=({stageStatus:t})=>{this.isOnStage="ON_STAGE"===t},this.view="sidebar",this.iconPack=je,this.t=Fe(),this.config=De,this.audioEnabled=!1,this.videoEnabled=!1,this.isPinned=!1,this.isHidden=!1,this.isOnStage=!1,this.canDisableParticipantAudio=!1,this.canDisableParticipantVideo=!1,this.canKickParticipant=!1,this.canPinParticipant=!1,this.canAllowParticipantOnStage=!1,this.menuOpen=!1,this.permissionsUpdateListener=()=>{this.meetingChanged(this.meeting)},this.inviteToStageToggle=async()=>{const t=this.participant,{stage:e}=this.meeting;"ACCEPTED_TO_JOIN_STAGE"!==t.stageStatus?(this.isOnStage?(t.isPinned&&t.unpin(),await e.kick([t.userId])):(await e.grantAccess([t.userId]),this.rtkSendNotification.emit({message:`${t.name} ${this.t("stage.invited_notification")}`,trace:`join-stage-invite-${t.id}`})),this.isOnStage="ON_STAGE"===t.stageStatus):this.rtkSendNotification.emit({message:`${t.name} ${this.t("stage.invited_notification")}`,trace:`join-stage-${t.id}`})},this.handleOutsideClick=t=>{!t.composedPath().includes(this.host)&&this.menuOpen&&(this.menuOpen=!1)},this.update=()=>{const t=this.host.shadowRoot.getElementById("trigger"),e=this.host.shadowRoot.getElementById("menu-list");Yn(t,e,{placement:"bottom-end",middleware:[Gn({allowedPlacements:["bottom-end","top-end"],alignment:"end"}),Hn(4),Vn({padding:8}),Kn()]}).then((({x:t,y:i,placement:r})=>{let a=null;a="bottom-end"===r?{right:`${t}px`,top:`${i}px`}:{right:`${t}px`,bottom:`${i}px`},Object.assign(e.style,a)}))},this.onMenuToggle=()=>{this.menuOpen=!this.menuOpen,this.menuOpen&&this.update()}}connectedCallback(){this.meetingChanged(this.meeting),this.participantChanged(this.participant),document.addEventListener("click",this.handleOutsideClick)}disconnectedCallback(){var t;document.removeEventListener("click",this.handleOutsideClick),null===(t=this.meeting)||void 0===t||t.self.permissions.removeListener("permissionsUpdate",this.permissionsUpdateListener),null!=this.participant&&null!=this.participant.removeListener&&(this.audioUpdateListener&&this.participant.removeListener("audioUpdate",this.audioUpdateListener),this.videoUpdateListener&&this.participant.removeListener("videoUpdate",this.videoUpdateListener),this.participant.removeListener("pinned",this.pinnedListener),this.participant.removeListener("unpinned",this.pinnedListener),this.participant.removeListener("stageStatusUpdate",this.stageListener),this.participant.removeListener("toggleTile",this.toggleTileListener))}meetingChanged(t){var e,i,r,a,s,n,o;if(null!=t){const{self:c}=t;this.canDisableParticipantAudio=c.permissions.canAllowParticipantAudio||c.permissions.canDisableParticipantAudio,this.canDisableParticipantVideo=c.permissions.canAllowParticipantVideo||c.permissions.canDisableParticipantVideo,this.canKickParticipant=c.permissions.kickParticipant&&!0!==(null===(e=this.meeting)||void 0===e?void 0:e.__internals__.features.hasFeature(ie))&&(!0!==(null===(i=this.meeting)||void 0===i?void 0:i.__internals__.features.hasFeature(re))||"webinar_admin"!==(null===(r=this.participant)||void 0===r?void 0:r.presetName)),this.canPinParticipant=c.permissions.pinParticipant,this.canAllowParticipantOnStage=c.permissions.acceptStageRequests&&c.permissions.stageEnabled&&(!0!==(null===(a=this.meeting)||void 0===a?void 0:a.__internals__.features.hasFeature(re))||"webinar_admin"!==(null===(s=this.participant)||void 0===s?void 0:s.presetName))&&(!0!==(null===(n=this.meeting)||void 0===n?void 0:n.__internals__.features.hasFeature(ae))||"webinar_viewer"!==(null===(o=this.participant)||void 0===o?void 0:o.presetName)),t.self.permissions.addListener("permissionsUpdate",this.permissionsUpdateListener)}}participantChanged(t){var e;if(null!=t){if(this.audioEnabled=t.audioEnabled,this.videoEnabled=t.videoEnabled,this.isPinned=t.isPinned,this.isHidden=null!==(e=t.hidden)&&void 0!==e&&e,this.isOnStage="ON_STAGE"===t.stageStatus,this.audioUpdateListener=({audioEnabled:t})=>{this.audioEnabled=t},this.videoUpdateListener=({videoEnabled:t})=>{this.videoEnabled=t},null==t.addListener)return;t.addListener("audioUpdate",this.audioUpdateListener),t.addListener("videoUpdate",this.videoUpdateListener),t.addListener("pinned",this.pinnedListener),t.addListener("unpinned",this.pinnedListener),t.addListener("stageStatusUpdate",this.stageListener),this.participant.addListener("toggleTile",this.toggleTileListener)}}render(){var t,e,i,r,a,s,n,o,c;const l="AUDIO_ROOM"===(null===(t=this.meeting)||void 0===t?void 0:t.meta.viewType),d=(null===(e=this.meeting)||void 0===e?void 0:e.self.id)===this.participant.id,h=this.canDisableParticipantAudio&&this.audioEnabled||this.canDisableParticipantVideo&&this.videoEnabled&&!l||this.canKickParticipant||this.canPinParticipant&&this.isOnStage||this.canAllowParticipantOnStage,p=ti((null===(i=this.participant)||void 0===i?void 0:i.name)||""),g=this.isOnStage||["GROUP_CALL","AUDIO_ROOM"].includes(null===(r=this.meeting)||void 0===r?void 0:r.meta.viewType),u={meeting:this.meeting,size:"sm",states:this.states,config:this.config,iconPack:this.iconPack,t:this.t};return N(H,{key:"9a717049edf15cfec3e497a30a37f873dcb37fd8"},N("div",{class:"left",key:null===(a=this.participant)||void 0===a?void 0:a.id},N("rtk-avatar",{key:"4e161f74ce11be1050c95556065867289ab618b2",participant:this.participant,size:"sm",iconPack:this.iconPack,t:this.t}),N("p",{key:"c1e71db1ba1ed2e8defbbb9802c22df8b64670fc",class:"name",title:p},Qe(p,16)," ",(null===(s=this.meeting)||void 0===s?void 0:s.self.id)===(null===(n=this.participant)||void 0===n?void 0:n.id)&&this.t("(you)"))),"sidebar"===this.view&&N("div",{key:"165e14ba9f5e063820c6f440dc9eb03344e7bcdf",class:"right"},g&&N("rtk-icon",{key:"d6651dc9e7eb12ed56742f08096ef239bd4429c1",class:{red:!this.audioEnabled},icon:this.audioEnabled?this.iconPack.mic_on:this.iconPack.mic_off}),g&&!l&&N("rtk-icon",{key:"89506d158acdb3e2629a7a2ab51aef475f9f3b75",class:{red:!this.videoEnabled},icon:this.videoEnabled?this.iconPack.video_on:this.iconPack.video_off}),(h||(({element:t,defaults:e,props:i={},elementProps:r={}})=>{var a;const{config:s,size:n,states:o}=e;let c,l={},d=[];Array.isArray(t)?[c,l,...d]=t:c=t;const h=null===(a=null==s?void 0:s.root)||void 0===a?void 0:a[c];null!=h&&"props"in h&&(i=Object.assign(Object.assign({},h.props),i)),i=Object.assign(Object.assign({},i),l),c in r&&(i=Object.assign(Object.assign({},i),r[c]));const p=tr({element:c,size:n,states:o,config:s});return er({selectors:p,root:s.root}).length})({element:"rtk-participant",defaults:u,childProps:{participant:this.participant}})>0)&&N("div",{key:"202a957dfe004c8c1f2195bf93c9ce9ce167a96f",class:"menu"},N("span",{key:"a01163f9da5fab4a1d7922f8abfe5a2e4a4dcf2c",id:"trigger",onClick:this.onMenuToggle},N("rtk-button",{key:"144e0c418b6a038d560f8087825471b649229ecb",variant:"ghost",kind:"icon",slot:"trigger"},N("rtk-icon",{key:"18abb20a0969e0332d8fe2b5dcfe41bfc66955f7",class:"more",icon:this.iconPack.more_vertical}))),N("span",{key:"3a22ebe5a21228b6ea6e15933d961b24085dce44",id:"menu-list"},this.menuOpen&&N("rtk-menu-list",{key:"86688ad10d1440c5b534fe2f002225e0368ae24a",iconPack:this.iconPack,t:this.t},this.canPinParticipant&&g&&!l&&N("rtk-menu-item",{key:"c22833b86d8583bdaec723a269afa7298cb0ca0d",onClick:()=>{this.isPinned?this.participant.unpin():this.participant.pin()},iconPack:this.iconPack,t:this.t},N("rtk-icon",{key:"9cdde53aaffca1f0042a69048b77f31fc10c69d6",icon:this.isPinned?this.iconPack.pin_off:this.iconPack.pin,slot:"start"}),this.isPinned?this.t("unpin"):this.t("pin")),d&&N("rtk-menu-item",{key:"b651953a9b02065ca223c46dd7dbadedc8401031",iconPack:this.iconPack,t:this.t,onClick:()=>{this.isHidden?this.participant.show():this.participant.hide()}},N("rtk-icon",{key:"e63383cca42314f8ac0a9a03d13948b4eb5ced8c",icon:this.isHidden?this.iconPack.minimize:this.iconPack.maximize,slot:"start"}),this.meeting.self.hidden?this.t("maximize"):this.t("minimize")),this.canDisableParticipantAudio&&g&&this.audioEnabled&&N("rtk-menu-item",{key:"86f670083fa1000cc99c5a57d4da2cb789c88aee",iconPack:this.iconPack,t:this.t,onClick:()=>{this.participant.disableAudio()}},N("rtk-icon",{key:"d75504ef4431c83efea2d281baad6a10c8a2e3b3",icon:this.iconPack.mic_off,slot:"start"}),this.t("mute")),this.canDisableParticipantVideo&&g&&this.videoEnabled&&N("rtk-menu-item",{key:"2634fae26bc72fec773f3a7f85fad7ebc1cfca11",iconPack:this.iconPack,t:this.t,onClick:()=>{this.participant.disableVideo()}},N("rtk-icon",{key:"57d51380b52a20a8f9dfc51931401712f4d67f26",icon:this.iconPack.video_off,slot:"start"}),this.t("participants.turn_off_video")),this.canAllowParticipantOnStage&&(null===(o=this.participant)||void 0===o?void 0:o.id)!==(null===(c=this.meeting)||void 0===c?void 0:c.self.id)&&N("rtk-menu-item",{key:"64ab2f51f494b8d3d445ae9aece430e8c0fca673",iconPack:this.iconPack,t:this.t,class:this.isOnStage?"red":"",onClick:this.inviteToStageToggle},N("rtk-icon",{key:"5633f66f3679bfc3b6e87a55cfb884e63260767c",icon:this.isOnStage?this.iconPack.leave_stage:this.iconPack.join_stage,slot:"start"}),this.isOnStage?this.t("stage.remove_from_stage"):this.t("stage.add_to_stage")),!d&&this.canKickParticipant&&N("rtk-menu-item",{key:"664e9b1c843aa0cc7a47062b4f353a8e1105a368",iconPack:this.iconPack,t:this.t,class:"red",onClick:()=>{var t,e;null===(t=this.meeting)||void 0===t||t.participants.kick(null===(e=this.participant)||void 0===e?void 0:e.id)}},N("rtk-icon",{key:"10cb3a42b4c861241d983d9cb1ebfe594500fbc3",icon:this.iconPack.dismiss,slot:"start"}),this.t("kick")),N("slot",{key:"ed681666f5bb8bf06a6fac4b929853d9b6bc704c"},N(rr,{key:"8177a2248bf03ffbe26a7f0f560eb81439a00fb3",element:"rtk-participant",defaults:u,childProps:{participant:this.participant},deepProps:!0,onlyChildren:!0})))))))}get host(){return W(this)}static get watchers(){return{meeting:["meetingChanged"],participant:["participantChanged"]}}};Cx([ai()],Ex.prototype,"meeting",void 0),Cx([ai()],Ex.prototype,"states",void 0),Cx([ai()],Ex.prototype,"iconPack",void 0),Cx([ai()],Ex.prototype,"t",void 0),Ex.style=":host{line-height:initial;font-family:var(--rtk-font-family, sans-serif);font-feature-settings:normal;font-variation-settings:normal}p{margin:var(--rtk-space-0, 0px);padding:var(--rtk-space-0, 0px)}:host{position:relative;display:flex;height:var(--rtk-space-14, 56px);align-items:center;justify-content:space-between;cursor:pointer;color:rgb(var(--rtk-colors-text-1000, 255 255 255))}:host rtk-avatar{height:var(--rtk-space-8, 32px);width:var(--rtk-space-8, 32px);font-size:14px}.left{display:flex;align-items:center}.left>*{margin-right:var(--rtk-space-2, 8px)}.left>*:last-child{margin-right:var(--rtk-space-0, 0px)}.right{display:flex;align-items:center;justify-content:flex-end}.right>*{margin-left:var(--rtk-space-2, 8px)}.right>*:first-child{margin-left:var(--rtk-space-0, 0px)}.name{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:1}rtk-icon{height:var(--rtk-space-6, 24px);width:var(--rtk-space-6, 24px)}rtk-icon.red{--tw-text-opacity:1;color:rgba(var(--rtk-colors-danger, 255 45 45) / var(--tw-text-opacity))}rtk-icon.more{cursor:pointer}.menu{position:relative;display:inline-block;color:rgb(var(--rtk-colors-text-1000, 255 255 255))}#menu-list{position:absolute;top:var(--rtk-space-8, 32px) !important;right:var(--rtk-space-4, 16px) !important;z-index:20}";const Tx=class{constructor(t){o(this,t),this.items=[],this.itemHeight=55,this.bufferedItemsCount=5,this.emptyListElement=null,this.visibleStart=0,this.visibleEnd=0,this.containerHeight=0,this.lastScrollTop=0,this.recalculatePositioning=()=>{this.updateContainerHeight(),requestAnimationFrame((()=>{this.updateItemHeight()}))},this.updateContainerHeight=()=>{this.el.querySelector(".virtual-list-container").clientHeight&&(requestAnimationFrame((()=>{this.updateItemHeight()})),this.containerHeight=this.el.querySelector(".virtual-list-container").clientHeight,this.updateVisibleRange())},this.onScroll=_i((()=>{const t=this.el.querySelector(".virtual-list-container").scrollTop;t>this.lastScrollTop&&this.visibleEnd===this.items.length||(this.lastScrollTop=t,this.updateVisibleRange())}))}itemsChanged(){this.recalculatePositioning()}componentDidLoad(){this.recalculatePositioning(),this.el.querySelector(".virtual-list-container").addEventListener("scroll",this.onScroll),window.addEventListener("resize",this.recalculatePositioning)}componentDidUpdate(){this.updateItemHeight()}disconnectedCallback(){this.el.querySelector(".virtual-list-container").removeEventListener("scroll",this.onScroll),window.removeEventListener("resize",this.recalculatePositioning)}updateVisibleRange(){const t=this.el.querySelector(".virtual-list-container").scrollTop,e=Math.floor(t/this.itemHeight),i=Math.ceil(this.containerHeight/this.itemHeight),r=Math.min(this.items.length,e+i+this.bufferedItemsCount);this.visibleStart=e,this.visibleEnd=r,this.el.querySelector(".virtual-list-container").scrollTop=this.lastScrollTop}updateItemHeight(){const t=this.el.querySelector(".virtual-list-item");if(t){const e=t.style.height;t.style.height="auto";const i=t.getBoundingClientRect().height;e&&(t.style.height=e),i&&Math.floor(i)!==Math.floor(this.itemHeight)&&(this.itemHeight=i)}}renderItems(){return this.items.slice(this.visibleStart,this.visibleEnd).map(((t,e)=>{const i=this.visibleStart+e;return N("div",{class:"virtual-list-item",key:t.id,style:{position:"absolute",top:i*this.itemHeight+"px",height:`${this.itemHeight}px`,width:"100%"}},this.renderItem(t,i))}))}render(){var t;const e=this.items.length*this.itemHeight;return N("div",{key:"02cd1150b5e7b65f25178c0ce673ee823feec9d8",class:"virtual-list-container",style:{position:"relative",height:"100%",overflowX:"hidden",overflowY:"auto"}},N("div",{key:"0f886b79c861b3010d60df73a7b343955e97a8f2",style:{height:`${e}px`,position:"relative"}},(null===(t=this.items)||void 0===t?void 0:t.length)?this.renderItems():this.emptyListElement),N("div",{key:"d290097b0d363d9a580e71da1260e87456248dc4",style:{height:`${this.itemHeight}px`}}))}get el(){return W(this)}static get watchers(){return{items:["itemsChanged"]}}};Tx.style=":host{height:100%;width:100%}";var Lx=Object.freeze({__proto__:null,rtk_participant:Ex,rtk_virtualized_participant_list:Tx});var _x=function(t,e,i,r){var a,s=arguments.length,n=s<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,i,r);else for(var o=t.length-1;o>=0;o--)(a=t[o])&&(n=(s<3?a(n):s>3?a(e,i,n):a(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};const Rx=class{constructor(t){o(this,t),this.iconPack=je,this.variant="full",this.t=Fe(),this.videoDevices=[],this.canProduceVideo=!0,this.stageStateListener=()=>{this.canProduceVideo="ALLOWED"===this.meeting.self.permissions.canProduceVideo},this.deviceListUpdateListener=({devices:t})=>{this.videoDevices=t.filter((t=>"videoinput"===t.kind))},this.deviceUpdateListener=({device:t})=>{"videoinput"===t.kind&&(this.currentDevice=t)},this.mediaPermissionUpdateListener=async({kind:t,message:e})=>{this.meeting&&"video"===t&&"ACCEPTED"===e&&(this.videoDevices=await this.meeting.self.getVideoDevices())}}meetingChanged(t){var e,i,r;null!=t&&(null===(e=t.self)||void 0===e||e.addListener("deviceListUpdate",this.deviceListUpdateListener),null===(i=t.self)||void 0===i||i.addListener("deviceUpdate",this.deviceUpdateListener),null===(r=t.self)||void 0===r||r.addListener("mediaPermissionUpdate",this.mediaPermissionUpdateListener),C((async()=>{var e,i;const r=await t.self.getVideoDevices(),a=null===(e=t.self.getCurrentDevices())||void 0===e?void 0:e.video;this.videoDevices=null!=a?[null!==(i=r.find((t=>t.deviceId===a.deviceId)))&&void 0!==i?i:a,...r.filter((t=>t.deviceId!==a.deviceId))]:r})))}connectedCallback(){this.meetingChanged(this.meeting)}disconnectedCallback(){var t,e,i,r,a;null===(e=null===(t=this.meeting)||void 0===t?void 0:t.stage)||void 0===e||e.removeListener("stageStatusUpdate",this.stageStateListener),null===(i=this.meeting)||void 0===i||i.self.removeListener("deviceListUpdate",this.deviceListUpdateListener),null===(r=this.meeting)||void 0===r||r.self.removeListener("deviceUpdate",this.deviceUpdateListener),null===(a=this.meeting)||void 0===a||a.self.removeListener("mediaPermissionUpdate",this.mediaPermissionUpdateListener)}async setDevice(t){var e;const i=this.videoDevices.find((e=>e.deviceId===t));this.currentDevice=i,null!=i&&await(null===(e=this.meeting)||void 0===e?void 0:e.self.setDevice(i))}render(){if(null==this.meeting)return null;let t=0;return N(H,null,this.canProduceVideo&&N("div",{class:"group container "+this.variant,part:"camera-selection"},N("label",null,"inline"!==this.variant&&this.t("camera"),N("rtk-icon",{icon:this.iconPack.video_on,size:"sm"})),N("div",{class:"row"},N("select",{class:"rtk-select",onChange:t=>this.setDevice(t.target.value)},this.videoDevices.map((({deviceId:e,label:i})=>{var r;return N("option",{selected:(null===(r=this.currentDevice)||void 0===r?void 0:r.deviceId)===e,value:e},i||"Camera "+ ++t)}))))))}static get watchers(){return{meeting:["meetingChanged"]}}};_x([ai()],Rx.prototype,"meeting",void 0),_x([ai()],Rx.prototype,"size",void 0),_x([ai()],Rx.prototype,"iconPack",void 0),_x([ai()],Rx.prototype,"t",void 0),Rx.style=".rtk-select{--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-background-700, 44 44 44) / var(--tw-bg-opacity));color:rgb(var(--rtk-colors-text-1000, 255 255 255))}.rtk-select:focus{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(0px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 #0000)}.rtk-select{display:block;border-radius:var(--rtk-border-radius-sm, 4px);border-width:var(--rtk-border-width-none, 0);border-style:none;-webkit-appearance:none;-moz-appearance:none;appearance:none;padding:var(--rtk-space-3, 12px);font-size:16px;--icon-size:var(--rtk-select-chevron-size, var(--rtk-space-6, 24px));--icon-right-position:var(--rtk-select-chevron-right-position, var(--rtk-space-2, 8px));background-image:url(\"data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e\");background-position:right var(--icon-right-position) center;background-repeat:no-repeat;background-size:var(--icon-size) var(--icon-size);padding-right:calc(var(--icon-right-position) * 5);width:100%;max-width:100%;text-overflow:ellipsis}.inline .rtk-select{margin-top:var(--rtk-space-1, 4px);width:100%;padding-top:var(--rtk-space-1, 4px);padding-bottom:var(--rtk-space-1, 4px);padding-left:var(--rtk-space-1\\.5, 6px);padding-right:var(--rtk-space-1\\.5, 6px);padding-right:var(--rtk-space-8, 32px);font-size:14px}.row{margin-bottom:var(--rtk-space-2, 8px);display:flex;width:100%;align-items:center;justify-content:space-between;gap:var(--rtk-space-3, 12px)}.group{margin-top:var(--rtk-space-2, 8px);margin-bottom:var(--rtk-space-2, 8px)}.group>*{margin-bottom:var(--rtk-space-2, 8px)}.group>*:last-child{margin-bottom:var(--rtk-space-0, 0px)}.group select{flex:1 1 0%}.group{margin-top:var(--rtk-space-0, 0px);margin-bottom:var(--rtk-space-0, 0px)}.group>*{margin-bottom:var(--rtk-space-0, 0px)}label{display:flex;-webkit-user-select:none;-moz-user-select:none;user-select:none;align-items:center;gap:var(--rtk-space-1, 4px);font-size:14px}.inline.container{display:flex;align-items:center;justify-content:flex-start;gap:var(--rtk-space-2, 8px);padding-left:var(--rtk-space-2, 8px);padding-right:var(--rtk-space-2, 8px)}";var Ax=function(t,e,i,r){var a,s=arguments.length,n=s<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,i,r);else for(var o=t.length-1;o>=0;o--)(a=t[o])&&(n=(s<3?a(n):s>3?a(e,i,n):a(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};const Dx=class{constructor(t){o(this,t),this.tileLoad=Y(this,"tileLoad",7),this.tileUnload=Y(this,"tileUnload",7),this.isPinned=!1,this.mediaConnectionError=!1,this.nameTagPosition="bottom-left",this.isPreview=!1,this.config=De,this.variant="solid",this.iconPack=je,this.t=Fe(),this.onPinned=({isPinned:t})=>{this.isPinned=t},this.isSelf=()=>{var t;return this.isPreview||this.participant.id===(null===(t=this.meeting)||void 0===t?void 0:t.self.id)},this.onPause=t=>{var e,i;this.isSelf()&&(null===(e=this.meeting)||void 0===e?void 0:e.__internals__.features.hasFeature(te))&&(this.meeting.__internals__.logger.warn(`Video player paused for ${this.participant.id} isSelf: ${this.isSelf()}`),null===(i=null==t?void 0:t.target)||void 0===i||i.play())},this.onPlaying=()=>{this.playTimeout&&clearTimeout(this.playTimeout)}}onVideoRef(t){this.participant&&this.meeting&&t!==this.videoEl&&(this.videoEl=t,this.participant.registerVideoElement(this.videoEl,this.isPreview),this.tileLoad.emit({participant:this.participant,videoElement:this.videoEl}))}connectedCallback(){this.meeting?this.meetingChanged(this.meeting):this.participantsChanged(this.participant)}disconnectedCallback(){this.playTimeout&&clearTimeout(this.playTimeout),null!=this.participant&&(this.participant.deregisterVideoElement(this.videoEl,this.isPreview),this.participant.removeListener("pinned",this.onPinned),this.participant.removeListener("unpinned",this.onPinned),this.meeting.meta.off("mediaConnectionUpdate",this.mediaConnectionUpdateListener),this.tileUnload.emit(this.participant))}meetingChanged(t){null!=t&&this.participantsChanged(this.participant)}participantsChanged(t){null!=t&&(void 0!==this.meeting?(this.isPinned=t.isPinned,this.videoEl&&this.participant.registerVideoElement(this.videoEl,this.isPreview),t.addListener("pinned",this.onPinned),t.addListener("unpinned",this.onPinned),this.meeting.meta.on("mediaConnectionUpdate",this.mediaConnectionUpdateListener.bind(this))):this.isPreview&&this.videoEl&&this.participant.registerVideoElement(this.videoEl,this.isPreview))}mediaConnectionUpdateListener(){var t,e,i;const{recv:r,send:a}=null!==(i=null===(e=null===(t=this.meeting)||void 0===t?void 0:t.meta)||void 0===e?void 0:e.mediaState)&&void 0!==i?i:{};"connected"===(null==r?void 0:r.state)||this.isSelf()?"connected"!==(null==a?void 0:a.state)&&this.isSelf()?this.mediaConnectionError=!0:this.mediaConnectionError=!1:this.mediaConnectionError=!0}isMirrored(){var t;if(null!=this.participant&&this.isSelf()){const e=this.states,i=null===(t=null==e?void 0:e.prefs)||void 0===t?void 0:t.mirrorVideo;if("boolean"==typeof i)return i}return!1}render(){var t,e,i;const r={meeting:this.meeting,size:this.size,states:this.states,config:this.config,iconPack:this.iconPack,t:this.t};return N(H,{key:"3e979a21a98a39b061612531ef9bd644d39a983e"},N("video",{key:"3ba45f4944aafeb8673afc8daa1e15db82ec42b5",ref:t=>this.onVideoRef(t),class:{mirror:this.isMirrored(),[null!==(i=null===(e=null===(t=this.config)||void 0===t?void 0:t.config)||void 0===e?void 0:e.videoFit)&&void 0!==i?i:"cover"]:!0},onPlaying:this.onPlaying,onPause:this.onPause,autoPlay:!0,playsInline:!0,muted:!0,part:"video"}),this.isPinned&&N("rtk-icon",{key:"02ca6b139670e6ac3ac16a24248329a4dc09976d",class:"pinned-icon",icon:this.iconPack.pin,"aria-label":this.t("pinned"),part:"pinned-icon"}),this.mediaConnectionError&&N("div",{key:"5bf2f0b14e7d077b3ebd9bec74291bf746fcf6c9",class:"network-container",part:"network-indicator"},N("rtk-icon",{key:"32ee83f5d08430273ae0bce3424e2e1a3206419a",class:"network-icon",icon:this.iconPack.disconnected,"aria-label":this.t("pinned"),part:"pinned-icon"})),N("slot",{key:"781a75e98ff649fb94672cb7ce4f176ef0c1c090"},N(rr,{key:"b756c2269429153fbab8dd3c79978d0a2d3a153d",element:"rtk-participant-tile",defaults:r,childProps:{participant:this.participant},deepProps:!0,onlyChildren:!0})))}static get watchers(){return{meeting:["meetingChanged"],participant:["participantsChanged"]}}};Ax([ai()],Dx.prototype,"meeting",void 0),Ax([ai()],Dx.prototype,"states",void 0),Ax([ai()],Dx.prototype,"size",void 0),Ax([ai()],Dx.prototype,"iconPack",void 0),Ax([ai()],Dx.prototype,"t",void 0),Dx.style=":host {\n line-height: initial;\n font-family: var(--rtk-font-family, sans-serif);\n\n font-feature-settings: normal;\n font-variation-settings: normal;\n}\n\np {\n margin: var(--rtk-space-0, 0px);\n padding: var(--rtk-space-0, 0px);\n}\n\n\n:host {\n position: relative;\n display: flex;\n align-items: center;\n justify-content: center;\n aspect-ratio: 16 / 9;\n height: var(--rtk-space-56, 224px);\n overflow: hidden;\n border-radius: var(--rtk-border-radius-lg, 12px);\n -webkit-user-select: none;\n -moz-user-select: none;\n user-select: none;\n --tw-bg-opacity: 1;\n background-color: rgba(var(--rtk-colors-video-bg, 24 24 24) / var(--tw-bg-opacity));\n\n transition-property: var(--rtk-transition-property, all);\n transition-duration: 150ms;\n container-type: inline-size;\n container-name: participanttile;\n}\n\n@media (prefers-reduced-motion) {\n /* No transitions when disabled */\n :host {\n --rtk-transition-property: none;\n }\n}\n\nrtk-avatar {\n z-index: -1;\n}\n\n/**\n NOTE: provided :slotted(rtk-name-tag) & rtk-name-tag separately\n because ::slotted isn't applied on default slots.\n*/\n\n::slotted(rtk-name-tag), \nrtk-name-tag {\n position: absolute;\n left: var(--rtk-space-3, 12px);\n bottom: var(--rtk-space-3, 12px);\n}\n\n:host([size='sm'][variant='solid']) ::slotted(rtk-name-tag), \n :host([size='sm'][variant='solid']) rtk-name-tag {\n left: var(--rtk-space-2, 8px);\n bottom: var(--rtk-space-2, 8px);\n height: var(--rtk-space-4, 16px);\n}\n\n::slotted(rtk-network-indicator), \nrtk-network-indicator {\n position: absolute;\n right: var(--rtk-space-3, 12px);\n bottom: var(--rtk-space-3, 12px);\n}\n\n:host([size='sm']) ::slotted(rtk-network-indicator), \n :host([size='sm']) rtk-network-indicator {\n right: var(--rtk-space-2, 8px);\n bottom: var(--rtk-space-2, 8px);\n}\n\nvideo {\n position: absolute;\n height: 100%;\n width: 100%;\n border-radius: var(--rtk-border-radius-lg, 12px);\n}\n\nvideo.contain {\n -o-object-fit: contain;\n object-fit: contain;\n}\n\nvideo.cover {\n -o-object-fit: cover;\n object-fit: cover;\n}\n\nvideo::-webkit-media-controls {\n display: none !important;\n}\n\n.pinned-icon {\n position: absolute;\n left: var(--rtk-space-3, 12px);\n top: var(--rtk-space-3, 12px);\n height: var(--rtk-space-5, 20px);\n width: var(--rtk-space-5, 20px);\n padding: var(--rtk-space-1, 4px);\n border-radius: var(--rtk-border-radius-md, 8px);\n --tw-bg-opacity: 1;\n background-color: rgba(var(--rtk-colors-background-700, 44 44 44) / var(--tw-bg-opacity));\n}\n\n.network-container {\n position: absolute;\n right: var(--rtk-space-3, 12px);\n bottom: var(--rtk-space-3, 12px);\n display: flex;\n flex-direction: row;\n align-items: center;\n padding: var(--rtk-space-2, 8px);\n font-size: 12px;\n border-radius: var(--rtk-border-radius-md, 8px);\n --tw-bg-opacity: 1;\n background-color: rgba(var(--rtk-colors-background-700, 44 44 44) / var(--tw-bg-opacity));\n}\n.network-icon {\n height: var(--rtk-space-5, 20px);\n width: var(--rtk-space-5, 20px);\n --tw-text-opacity: 1;\n color: rgba(var(--rtk-colors-danger, 255 45 45) / var(--tw-text-opacity));\n}\n\n:host([size='sm']) .pinned-icon {\n top: var(--rtk-space-2, 8px);\n left: var(--rtk-space-2, 8px);\n}\n\n:host([variant='gradient']) ::slotted(rtk-audio-visualizer), \n :host([variant='gradient']) rtk-audio-visualizer {\n position: absolute;\n top: var(--rtk-space-2, 8px);\n right: var(--rtk-space-2, 8px);\n border-radius: 9999px;\n --tw-bg-opacity: 1;\n background-color: rgba(var(--rtk-colors-brand-500, 33 96 253) / var(--tw-bg-opacity));\n padding: var(--rtk-space-2, 8px);\n}\n\n:host([variant='gradient']) ::slotted(rtk-name-tag), \n :host([variant='gradient']) rtk-name-tag {\n bottom: var(--rtk-space-0, 0px);\n left: var(--rtk-space-0, 0px);\n display: flex;\n width: 100%;\n align-items: center;\n justify-content: center;\n text-align: center;\n background-color: transparent;\n background-image: linear-gradient(to top, var(--tw-gradient-stops));\n --tw-gradient-from: rgb(var(--rtk-colors-background-1000, 8 8 8));\n --tw-gradient-to: rgba(var(--rtk-colors-background-1000, 8 8 8) / 0);\n --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to);\n --tw-gradient-to: transparent;\n}\n\nvideo.mirror {\n transform: scaleX(-1);\n}\n\n/** Name tag positions */\n\n:host([name-tag-position='bottom-right']) ::slotted(rtk-name-tag), \n :host([name-tag-position='bottom-right']) rtk-name-tag {\n left: auto;\n right: var(--rtk-space-3, 12px);\n}\n\n:host([name-tag-position='bottom-center']) ::slotted(rtk-name-tag), \n :host([name-tag-position='bottom-center']) rtk-name-tag {\n left: auto;\n right: auto;\n}\n\n:host([name-tag-position='top-left']) ::slotted(rtk-name-tag), \n :host([name-tag-position='top-left']) rtk-name-tag {\n top: var(--rtk-space-3, 12px);\n bottom: auto;\n}\n\n:host([name-tag-position='top-right']) ::slotted(rtk-name-tag), \n :host([name-tag-position='top-right']) rtk-name-tag {\n top: var(--rtk-space-3, 12px);\n right: var(--rtk-space-3, 12px);\n left: auto;\n bottom: auto;\n}\n\n:host([name-tag-position='top-center']) ::slotted(rtk-name-tag), \n :host([name-tag-position='top-center']) rtk-name-tag {\n left: auto;\n right: auto;\n bottom: auto;\n top: var(--rtk-space-3, 12px);\n}\n\n@media only screen and (max-height: 480px) and (orientation: landscape) {\n :host([size='sm']) {\n border-radius: var(--rtk-border-radius-sm, 4px);\n }\n\n :host([size='sm']) > video {\n border-radius: var(--rtk-border-radius-sm, 4px);\n }\n\n ::slotted(rtk-avatar), \n rtk-avatar {\n height: var(--rtk-space-12, 48px);\n width: var(--rtk-space-12, 48px);\n }\n :host([size='sm'][variant='solid']) ::slotted(rtk-name-tag),\n :host([size='sm'][variant='solid']) rtk-name-tag {\n transform-origin: -2% 100%;\n transform: scale(0.6);\n z-index: 10;\n left: var(--rtk-space-0, 0px);\n bottom: var(--rtk-space-0, 0px);\n border-radius: var(--rtk-border-radius-none, 0);\n }\n}\n\n@media only screen and (max-width: 480px) and (orientation: portrait) {\n :host([size='sm']) {\n border-radius: var(--rtk-border-radius-sm, 4px);\n }\n\n :host([size='sm']) > video {\n border-radius: var(--rtk-border-radius-sm, 4px);\n }\n\n ::slotted(rtk-avatar), \n rtk-avatar {\n height: var(--rtk-space-12, 48px);\n width: var(--rtk-space-12, 48px);\n }\n :host([size='sm'][variant='solid']) ::slotted(rtk-name-tag),\n :host([size='sm'][variant='solid']) rtk-name-tag {\n transform-origin: -5% 110%;\n transform: scale(0.6);\n z-index: 10;\n left: var(--rtk-space-0, 0px);\n bottom: var(--rtk-space-0, 0px);\n border-radius: var(--rtk-border-radius-none, 0);\n }\n}\n\n@container participanttile (max-width: 300px) {\n ::slotted(rtk-name-tag),\n rtk-name-tag {\n transform-origin: 0 100%;\n transform: scale(0.8);\n }\n\n ::slotted(rtk-avatar), \n rtk-avatar {\n height: var(--rtk-space-8, 32px) !important;\n width: var(--rtk-space-8, 32px) !important;\n }\n}\n\n@container participanttile (max-width: 150px) {\n ::slotted(rtk-name-tag),\n rtk-name-tag[variant='solid'] {\n transform-origin: -10% 130%;\n transform: scale(0.6);\n z-index: 10;\n border-radius: 9999px;\n }\n\n ::slotted(rtk-avatar), \n rtk-avatar {\n height: 6 !important;\n width: 6 !important;\n }\n}\n";var Mx=Object.freeze({__proto__:null,rtk_camera_selector:Rx,rtk_participant_tile:Dx});var Ix=function(t,e,i,r){var a,s=arguments.length,n=s<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,i,r);else for(var o=t.length-1;o>=0;o--)(a=t[o])&&(n=(s<3?a(n):s>3?a(e,i,n):a(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};const Ox=class{constructor(t){o(this,t),this.onVote=Y(this,"rtkVotePoll",7),this.iconPack=je,this.t=Fe(),this.MAX_VOTES_RENDER=10}vote(t,e){this.poll.voted.includes(this.self)?t.preventDefault():this.onVote.emit({id:this.poll.id,index:e})}render(){const t=this.poll.voted.includes(this.self);return N(H,{key:"3436a978185495090fcf81a59f40e3d0f9bac969"},N("div",{key:"1349450369add7268b290b2b75ca07aa28820683",class:"ctr"},N("p",{key:"f36ddcb1f30368e5b311fe7f11cca87785c9570c",class:"poll-title"},this.t("polls.by")," ",Qe(ti(this.poll.createdBy),20)),N("div",{key:"6c5ac869b1c182d09d9e1490a312797c913d24b1",class:"poll"},N("p",{key:"1c3ca8f47cf9a08f3ac7ef47e144330b922534fc",class:"poll-question"},this.poll.question),N("div",{key:"e5e60be4359714828d1d25bb24f5f143a1c6428f",class:"poll-answers"},N("span",{key:"60eeb63b59d1f3d8c44a1cbd53c42e82877f22d1"},this.t("polls.answers")),N("span",{key:"6c6a42a4e6b84ec18ad94bcd4015ed4047b7b0aa"},this.poll.voted.length)),this.poll.options.map(((e,i)=>N("div",{class:{active:e.votes.some((t=>t.id===this.self)),"open-vote":this.permissions.polls.canVote&&!t,"poll-option":!0}},N("div",{class:"poll-option-header","data-disabled":!this.permissions.polls.canVote},N("label",null,!t&&N("input",{disabled:!this.permissions.polls.canVote,readOnly:t,type:"radio",checked:e.votes.some((t=>t.id===this.self)),onClick:t=>this.vote(t,i)}),N("p",null,e.text)),N("span",{class:"counter"},e.count)),N("div",{class:"votes"},e.votes.slice(0,this.MAX_VOTES_RENDER).map((t=>{if(!this.poll.anonymous||this.self===this.poll.createdByUserId)return N("rtk-tooltip",{label:t.name},N("div",{class:"vote"},ri(t.name)))})),e.votes.length>this.MAX_VOTES_RENDER&&N("rtk-tooltip",{label:`+${e.votes.length-this.MAX_VOTES_RENDER} more `},N("div",{class:"vote"},"+",e.votes.length-this.MAX_VOTES_RENDER)))))))))}};Ix([ai()],Ox.prototype,"iconPack",void 0),Ix([ai()],Ox.prototype,"t",void 0),Ox.style=":host{line-height:initial;font-family:var(--rtk-font-family, sans-serif);font-feature-settings:normal;font-variation-settings:normal}p{margin:var(--rtk-space-0, 0px);padding:var(--rtk-space-0, 0px)}.scrollbar{scrollbar-width:thin;scrollbar-color:var(--rtk-scrollbar-color, rgb(var(--rtk-colors-background-600, 60 60 60)))\n var(--rtk-scrollbar-background, transparent)}.scrollbar::-webkit-scrollbar{height:var(--rtk-space-1\\.5, 6px);width:var(--rtk-space-1\\.5, 6px);border-radius:9999px;background-color:var(--rtk-scrollbar-background, transparent)}.scrollbar::-webkit-scrollbar-thumb{border-radius:9999px;background-color:var(--rtk-scrollbar-color, rgb(var(--rtk-colors-background-600, 60 60 60)))}.ctr{margin-bottom:var(--rtk-space-3, 12px);display:flex;width:100%;flex-direction:column;color:rgb(var(--rtk-colors-text-1000, 255 255 255))}.poll-title{margin-top:var(--rtk-space-3, 12px);margin-bottom:var(--rtk-space-3, 12px);margin-right:var(--rtk-space-4, 16px);font-size:12px}.poll{border-radius:var(--rtk-border-radius-md, 8px);--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-background-800, 30 30 30) / var(--tw-bg-opacity));display:flex;flex-direction:column;padding:var(--rtk-space-4, 16px)}.poll-question{padding-left:var(--rtk-space-2, 8px);padding-right:var(--rtk-space-2, 8px);font-size:14px;overflow-wrap:break-word}.poll-answers{display:flex;flex-direction:row;justify-content:space-between;font-size:12px;margin-top:var(--rtk-space-4, 16px);margin-bottom:var(--rtk-space-1, 4px);padding-left:var(--rtk-space-1, 4px);padding-right:var(--rtk-space-3, 12px)}.poll-option{display:flex;flex-direction:column;margin-top:var(--rtk-space-2, 8px);border-radius:var(--rtk-border-radius-md, 8px);--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-background-700, 44 44 44) / var(--tw-bg-opacity));padding:var(--rtk-space-2, 8px);word-break:break-word}.poll-option.open-vote:hover{cursor:pointer}.poll-option label{display:flex;flex-direction:row;cursor:inherit}.poll-option-header{display:flex;flex-direction:row;justify-content:space-between;padding:var(--rtk-space-1, 4px)}.poll-option-header[data-disabled='true']:hover{cursor:default}.poll-option-header input{margin-top:var(--rtk-space-0, 0px);margin-bottom:var(--rtk-space-0, 0px);margin-left:var(--rtk-space-0\\.5, 2px);margin-right:var(--rtk-space-2, 8px);cursor:inherit}.poll-option-header .counter{color:rgb(var(--rtk-colors-text-1000, 255 255 255));font-size:12px}.votes{margin-top:var(--rtk-space-1, 4px);display:flex;flex-direction:row;flex-wrap:wrap}.vote{margin-right:var(--rtk-space-1, 4px);height:var(--rtk-space-8, 32px);width:var(--rtk-space-8, 32px);display:flex;align-items:center;justify-content:center;border-radius:var(--rtk-border-radius-md, 8px);--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-video-bg, 24 24 24) / var(--tw-bg-opacity));color:rgb(var(--rtk-colors-text-1000, 255 255 255));border-radius:var(--rtk-border-radius-none, 0);clip-path:circle()}.active{--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-brand-500, 33 96 253) / var(--tw-bg-opacity));color:rgb(var(--rtk-colors-text-on-brand-900, var(--rtk-colors-text-900, 255 255 255 / 0.88)))}.active .counter{color:rgb(var(--rtk-colors-text-on-brand-900, var(--rtk-colors-text-900, 255 255 255 / 0.88)))}";var Ux=function(t,e,i,r){var a,s=arguments.length,n=s<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,i,r);else for(var o=t.length-1;o>=0;o--)(a=t[o])&&(n=(s<3?a(n):s>3?a(e,i,n):a(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};const $x=class{constructor(t){o(this,t),this.onCreate=Y(this,"rtkCreatePoll",7),this.iconPack=je,this.t=Fe(),this.options=["",""],this.anonymous=!1,this.hideVotes=!0}removeOption(t){var e;this.options=this.options.filter(((e,i)=>i!==t)),1===(null===(e=this.error)||void 0===e?void 0:e.code)&&(this.error=void 0)}addOption(){this.options=[...this.options,""]}updateOption(t,e){var i;this.options[e]=t.target.value,1===(null===(i=this.error)||void 0===i?void 0:i.code)&&(this.error=void 0)}handleSubmit(){const t={question:this.question.value,options:this.options,anonymous:this.anonymous,hideVotes:!!this.anonymous||this.hideVotes};t.question?this.options.filter((t=>""===t.trim())).length>0?this.error={code:1,message:this.t("polls.errors.empty_option")}:this.onCreate.emit(t):this.error={code:0,message:this.t("polls.errors.question_required")}}render(){return N(H,{key:"a5d66ad4586b3e3bf360fc7f3330cbebfcc27d29"},N("div",{key:"ab293118b0a4e4f0839da8b1f28e8bb4c3075e00",class:"create-poll"},N("p",{key:"dd851c73436db148c85fa4ae605841acc4047114"},this.t("polls.question")),N("textarea",{key:"f2fc86324169b0eb23eccbf6f9a9425b2fa43cef",onInput:()=>{this.error&&0===this.error.code&&(this.error=void 0)},ref:t=>this.question=t,placeholder:this.t("polls.question.placeholder")}),this.options.map(((t,e)=>N("div",{class:"option"},N("input",{placeholder:this.t("polls.option.placeholder"),value:t,onInput:t=>this.updateOption(t,e)}),e>1&&N("rtk-button",{kind:"icon",class:"auto remove-option",variant:"secondary",onClick:()=>this.removeOption(e)},N("rtk-icon",{icon:this.iconPack.subtract}))))),N("rtk-button",{key:"d33f567bcd74edf4ace17cd3a0ca36daf69eeb8c",class:"add-option",variant:"secondary",onClick:()=>this.addOption()},this.t("polls.option")),N("label",{key:"1ded9b5aeec6b5b5fec3cc2ec43c488b48a0568b"},N("input",{key:"37047cb8a6ccb8c37fc56261fb2f32fa0ff19d92",id:"anonymous",type:"checkbox",onChange:t=>this.anonymous=t.target.checked}),this.t("polls.results.anon")),N("label",{key:"50ac11b8af600d337cc2a1d8ec934e1abac7eaf6"},N("input",{key:"6d3df46887a4285d923cc2f8b82abf396a2df8fa",id:"hideVotes",type:"checkbox",disabled:this.anonymous,checked:!!this.anonymous||this.hideVotes,onChange:t=>this.hideVotes=t.target.checked}),this.t("polls.results.hide")),N("rtk-button",{key:"36f2228ca82a29f9d72f768fa65028690230a26f",kind:"wide",onClick:()=>this.handleSubmit()},this.t("polls.create")),this.error&&N("span",{key:"fe7a37df641bcf672e8c85a87251df19d8d1fc91",class:"error-text"},this.error.message)))}};Ux([ai()],$x.prototype,"iconPack",void 0),Ux([ai()],$x.prototype,"t",void 0),$x.style=":host{line-height:initial;font-family:var(--rtk-font-family, sans-serif);font-feature-settings:normal;font-variation-settings:normal}p{margin:var(--rtk-space-0, 0px);padding:var(--rtk-space-0, 0px)}.scrollbar{scrollbar-width:thin;scrollbar-color:var(--rtk-scrollbar-color, rgb(var(--rtk-colors-background-600, 60 60 60)))\n var(--rtk-scrollbar-background, transparent)}.scrollbar::-webkit-scrollbar{height:var(--rtk-space-1\\.5, 6px);width:var(--rtk-space-1\\.5, 6px);border-radius:9999px;background-color:var(--rtk-scrollbar-background, transparent)}.scrollbar::-webkit-scrollbar-thumb{border-radius:9999px;background-color:var(--rtk-scrollbar-color, rgb(var(--rtk-colors-background-600, 60 60 60)))}.create-poll{margin-top:var(--rtk-space-3, 12px);margin-bottom:var(--rtk-space-3, 12px);display:flex;flex:1 1 0%;flex-direction:column;padding:var(--rtk-space-3, 12px);border-radius:var(--rtk-border-radius-md, 8px);--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-background-700, 44 44 44) / var(--tw-bg-opacity))}.create-poll p{margin:var(--rtk-space-0, 0px);padding:var(--rtk-space-0, 0px);text-align:center}.create-poll textarea{display:flex;border-radius:var(--rtk-border-radius-sm, 4px);padding:var(--rtk-space-2, 8px);font-family:var(--rtk-font-family, sans-serif);border-width:var(--rtk-border-width-none, 0);border-style:none;font-weight:500;outline:2px solid transparent;outline-offset:2px;margin-top:var(--rtk-space-3, 12px);margin-bottom:var(--rtk-space-3, 12px);resize:vertical;--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-background-900, 26 26 26) / var(--tw-bg-opacity));color:rgb(var(--rtk-colors-text-700, 255 255 255 / 0.64))}.create-poll textarea:focus{outline-style:solid;outline-offset:2px;outline-color:rgb(var(--rtk-colors-background-600, 60 60 60))}.option{display:flex;flex-direction:row;align-items:center;margin-bottom:var(--rtk-space-3, 12px);width:100%}.option input{width:100%;border-radius:var(--rtk-border-radius-sm, 4px);padding:var(--rtk-space-2, 8px);border-width:var(--rtk-border-width-none, 0);border-style:none;outline:2px solid transparent;outline-offset:2px;--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-background-900, 26 26 26) / var(--tw-bg-opacity));color:rgb(var(--rtk-colors-text-700, 255 255 255 / 0.64))}.remove-option{margin-left:var(--rtk-space-2, 8px);width:var(--rtk-space-10, 40px);border-radius:var(--rtk-border-radius-sm, 4px)}.add-option{margin-bottom:var(--rtk-space-3, 12px)}label{margin-bottom:var(--rtk-space-3, 12px)}.error-text{margin-top:var(--rtk-space-3, 12px);text-align:center;font-size:12px;--tw-text-opacity:1;color:rgba(var(--rtk-colors-danger, 255 45 45) / var(--tw-text-opacity))}";var Fx=Object.freeze({__proto__:null,rtk_poll:Ox,rtk_poll_form:$x});const jx=class{constructor(t){o(this,t),this.tabChange=Y(this,"tabChange",7),this.sidebarClose=Y(this,"sidebarClose",7),this.view="sidebar",this.tabs=[],this.hideHeader=!1,this.hideCloseAction=!1,this.iconPack=je,this.focusCloseButton=!0,this.t=Fe(),this.onClose=()=>{this.sidebarClose.emit()}}componentDidLoad(){this.keydownListener=t=>{"Escape"===t.key&&this.onClose()},this.hostEl.addEventListener("keydown",this.keydownListener),this.handleFocusCloseButton()}handleFocusCloseButton(){"chat"===this.currentTab||this.hideCloseAction||this.closeButton.focus()}disconnectedCallback(){this.hostEl.removeEventListener("keydown",this.keydownListener)}render(){const t="full-screen"===this.view,e=this.tabs.find((t=>t.id===this.currentTab));return N(H,{key:"4afc881e8aeb5f51014817e1287aed7700bb56fb",ref:t=>this.hostEl=t,class:this.view},!this.hideCloseAction&&N("rtk-button",{key:"e95b2c25d32535630e0ccf30b46f067395c41a7f",ref:t=>this.closeButton=t,variant:"ghost",kind:"icon",class:"close",onClick:this.onClose,"aria-label":this.t("close")},N("rtk-icon",{key:"0d6398171fbebd8d9b0895fc2e9f0b08e7980ab2",icon:this.iconPack.dismiss})),e&&!this.hideHeader&&N("header",{key:"e92a6c60fa280a36b4643873d48adca3210e3c51",class:"main-header"},N("h3",{key:"8097b3e815c3005c7750c7076eb54242406034a9"},e.name),N("slot",{key:"f91814a6fb62726790ae5c91111be0f6d1ea121c",name:"pinned-state"})),t&&N("header",{key:"5ec434bbc22ffa7acf8a76361e02718080c7a99d",class:"mobile-tabs"},this.tabs.map((t=>N("button",{onClick:()=>{this.tabChange.emit(t.id)},class:{active:this.currentTab===t.id}},t.name)))),N("slot",{key:"77ee9da399e6991cc7bf3e0d979ffeec47e4b769",name:this.currentTab}))}static get watchers(){return{currentTab:["handleFocusCloseButton"]}}};!function(t,e,i,r){var a,s=arguments.length,n=s<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,i,r);else for(var o=t.length-1;o>=0;o--)(a=t[o])&&(n=(s<3?a(n):s>3?a(e,i,n):a(e,i))||n);s>3&&n&&Object.defineProperty(e,i,n)}([ai()],jx.prototype,"t",void 0),jx.style=":host {\n line-height: initial;\n font-family: var(--rtk-font-family, sans-serif);\n\n font-feature-settings: normal;\n font-variation-settings: normal;\n}\n\np {\n margin: var(--rtk-space-0, 0px);\n padding: var(--rtk-space-0, 0px);\n}\n\n\n:host {\n position: relative;\n height: 100%;\n width: 100%;\n font-family: var(--rtk-font-family, sans-serif);\n z-index: 50;\n display: flex;\n flex-direction: column;\n\n container-type: size;\n container-name: sidebarui;\n}\n\n@container sidebarui (height < 370px) {\n .main-header {\n height: var(--rtk-space-8, 32px) !important;\n }\n .close {\n top: var(--rtk-space-0\\.5, 2px) !important;\n left: var(--rtk-space-0, 0px) !important;\n color: rgba(var(--rtk-colors-danger, 255 45 45) / 0.6);\n }\n}\n\n:host([view='sidebar']) {\n --tw-bg-opacity: 1;\n background-color: rgba(var(--rtk-colors-background-900, 26 26 26) / var(--tw-bg-opacity));\n}\n\n:host([view='full-screen']) {\n position: absolute;\n top: var(--rtk-space-0, 0px);\n right: var(--rtk-space-0, 0px);\n bottom: var(--rtk-space-0, 0px);\n left: var(--rtk-space-0, 0px);\n max-width: 100%;\n border: none;\n}\n\n::slotted(*) {\n flex-grow: 1;\n}\n\n.close {\n position: absolute;\n top: var(--rtk-space-2, 8px);\n left: var(--rtk-space-2, 8px);\n z-index: 10;\n}\n\n.main-header {\n position: relative;\n display: flex;\n height: var(--rtk-space-12, 48px);\n place-items: center;\n justify-content: center;\n}\n\n.main-header, \n.mobile-tabs {\n flex-shrink: 0;\n}\n\n.mobile-tabs {\n display: flex;\n place-items: center;\n justify-content: space-evenly;\n border-bottom: 1px solid rgb(var(--rtk-colors-background-700, 44 44 44));\n}\n\n.mobile-tabs button {\n margin: var(--rtk-space-0, 0px);\n border-width: var(--rtk-border-width-none, 0);\n border-style: none;\n background-color: transparent;\n padding: var(--rtk-space-0, 0px);\n color: rgb(var(--rtk-colors-text-600, 255 255 255 / 0.52));\n height: var(--rtk-space-10, 40px);\n cursor: pointer;\n padding-left: var(--rtk-space-4, 16px);\n padding-right: var(--rtk-space-4, 16px);\n font-weight: 500;\n border-bottom: 1px solid transparent;\n}\n\n.mobile-tabs button.active {\n --tw-border-opacity: 1;\n border-color: rgba(var(--rtk-colors-brand-300, 73 124 253) / var(--tw-border-opacity));\n --tw-text-opacity: 1;\n color: rgba(var(--rtk-colors-brand-300, 73 124 253) / var(--tw-text-opacity));\n}\n\nheader h3 {\n font-size: 14px;\n font-weight: 500;\n}\n\n@media only screen and (max-device-height: 480px) and (orientation: landscape) {\n .main-header {\n display: none !important;\n }\n}\n\n.tab-participant-count-badge {\n display: inline-block;\n padding: 2px 5px;\n border-radius: 9999px;\n --tw-bg-opacity: 1;\n background-color: rgba(var(--rtk-colors-brand-500, 33 96 253) / var(--tw-bg-opacity));\n font-size: 12px;\n color: rgb(var(--rtk-colors-text-700, 255 255 255 / 0.64));\n}\n\n.tab-participant-count-badge:not(.selected-tab) {\n --tw-bg-opacity: 1;\n background-color: rgba(var(--rtk-colors-background-600, 60 60 60) / var(--tw-bg-opacity));\n}\n\n.tab-participant-count-badge.requests-pending{\n background-color: rgba(var(--rtk-colors-danger));\n}\n";var zx=Object.freeze({__proto__:null,rtk_sidebar_ui:jx});var Nx=function(t,e,i,r){var a,s=arguments.length,n=s<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,i,r);else for(var o=t.length-1;o>=0;o--)(a=t[o])&&(n=(s<3?a(n):s>3?a(e,i,n):a(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};const Bx=class{constructor(t){o(this,t),this.iconPack=je,this.t=Fe(),this.permissionsUpdateListener=()=>{this.canSpotlight=this.meeting.self.permissions.canSpotlight}}connectedCallback(){this.meetingChanged(this.meeting)}disconnectedCallback(){var t;null===(t=this.meeting)||void 0===t||t.self.permissions.removeListener("permissionsUpdate",this.permissionsUpdateListener)}meetingChanged(t){var e,i;null!=t&&(this.canSpotlight=t.self.permissions.canSpotlight,this.isSpotlighted=null!==(i=null===(e=t.meta)||void 0===e?void 0:e.broadcastTabChanges)&&void 0!==i&&i,t.self.permissions.addListener("permissionsUpdate",this.permissionsUpdateListener))}updateSpotlightState(t){var e;try{null===(e=this.meeting.meta)||void 0===e||e.setBroadcastTabChanges(t),this.isSpotlighted=t}catch(t){console.error(t)}}render(){if(this.canSpotlight)return N(H,null,N("rtk-tooltip",{size:"md",label:this.t("remote_access.indicator")},N("div",{id:"sync-button",class:{tab:!0,active:this.isSpotlighted},onClick:()=>this.updateSpotlightState(!this.isSpotlighted)},N("span",{class:"name"},"Sync"),N("rtk-icon",{id:"icon",icon:this.isSpotlighted?this.iconPack.checkmark:this.iconPack.warning,tabIndex:-1,"aria-hidden":!0}))))}static get watchers(){return{meeting:["meetingChanged"]}}};Nx([ai()],Bx.prototype,"meeting",void 0),Nx([ai()],Bx.prototype,"iconPack",void 0),Nx([ai()],Bx.prototype,"t",void 0),Nx([ai()],Bx.prototype,"size",void 0),Bx.style=":host{line-height:initial;font-family:var(--rtk-font-family, sans-serif);font-feature-settings:normal;font-variation-settings:normal}p{margin:var(--rtk-space-0, 0px);padding:var(--rtk-space-0, 0px)}:host{font-size:12px}#sync-button{flex-direction:row;border-radius:var(--rtk-border-radius-sm, 4px);padding-left:var(--rtk-space-1, 4px);display:flex;align-items:center;justify-content:center;margin-bottom:var(--rtk-space-1, 4px);font-size:12px;--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-background-700, 44 44 44) / var(--tw-bg-opacity))}:host([size='sm']) rtk-tooltip,:host([size='md']) rtk-tooltip{width:100%}:host([size='sm'])>#sync-button{height:var(--rtk-space-8, 32px);width:var(--rtk-space-16, 64px);padding-left:var(--rtk-space-0, 0px)}:host([size='md'])>#sync-button{height:var(--rtk-space-8, 32px);width:var(--rtk-space-16, 64px)}:host([size='lg'])>#sync-button{flex-direction:row;height:var(--rtk-space-8, 32px);width:var(--rtk-space-16, 64px)}@media (orientation: portrait){:host([size='lg']) #sync-button{flex-direction:column-reverse;height:var(--rtk-space-16, 64px);width:var(--rtk-space-16, 64px)}:host([size='md']) #sync-button{height:var(--rtk-space-16, 64px);width:var(--rtk-space-16, 64px)}:host([size='sm']) #sync-button{height:var(--rtk-space-10, 40px);width:var(--rtk-space-16, 64px);flex-direction:row}}#sync-button>rtk-icon{max-height:14px}#sync-button rtk-icon{--tw-text-opacity:1;color:rgba(var(--rtk-colors-danger, 255 45 45) / var(--tw-text-opacity))}:host([size='sm']) #sync-button>rtk-icon{width:auto}#sync-button.active rtk-icon{color:rgb(var(--rtk-colors-text-1000, 255 255 255))}div{align-content:center;line-height:2rem}rtk-icon{height:var(--rtk-space-6, 24px);width:var(--rtk-space-8, 32px)}#sync-button.active{--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-success, 98 165 4) / var(--tw-bg-opacity))}";var Hx=Object.freeze({__proto__:null,rtk_spotlight_indicator:Bx});var Gx=function(t,e,i,r){var a,s=arguments.length,n=s<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,i,r);else for(var o=t.length-1;o>=0;o--)(a=t[o])&&(n=(s<3?a(n):s>3?a(e,i,n):a(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};const Vx=class{constructor(t){o(this,t),this.variant="button",this.showWarning=!1,this.disabled=!1,this.iconPack=je,this.brandIcon=!1}render(){return N(H,{key:"9a1150fd8a0fbd0022f33f325e7413d0670d0820"},N("button",{key:"0fabd8a63a8013e1630dd3838f0c2f1378f423f7","aria-label":this.label,part:"button"},this.isLoading?N("rtk-spinner",{id:"icon",part:"spinner",iconPack:this.iconPack}):N("rtk-icon",{id:"icon",icon:this.icon,tabIndex:-1,"aria-hidden":!0,part:"icon"}),N("span",{key:"117f1bff41fb719a832ef89d000b2abef6f1388a",class:"label",part:"label"},this.label),this.showWarning&&N("rtk-icon",{key:"4d8b9170c833a930e013613089755ec768df0695",id:"warning-indicator",icon:this.iconPack.warning,part:"warning-indicator"})))}static get delegatesFocus(){return!0}};Gx([ai()],Vx.prototype,"size",void 0),Gx([ai()],Vx.prototype,"iconPack",void 0),Vx.style=":host{line-height:initial;font-family:var(--rtk-font-family, sans-serif);font-feature-settings:normal;font-variation-settings:normal}p{margin:var(--rtk-space-0, 0px);padding:var(--rtk-space-0, 0px)}:host{--background-color:var(\n --rtk-controlbar-button-background-color,\n rgb(var(--rtk-colors-background-1000, 8 8 8))\n );--icon-size:var(--rtk-controlbar-button-icon-size, var(--rtk-space-7, 28px));position:relative;box-sizing:border-box;display:inline-flex;height:100%;width:auto;min-width:var(--rtk-space-20, 80px);-webkit-user-select:none;-moz-user-select:none;user-select:none;border-radius:var(--rtk-border-radius-md, 8px);transition-property:color, background-color, border-color, text-decoration-color, fill, stroke;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:150ms;color:rgb(var(--rtk-colors-text-1000, 255 255 255));background-color:var(--background-color)}button{padding:var(--rtk-space-1, 4px)}:host(.red-icon) #icon{--tw-text-opacity:1;color:rgba(var(--rtk-colors-danger, 255 45 45) / var(--tw-text-opacity))}:host([disabled]){color:rgb(var(--rtk-colors-text-600, 255 255 255 / 0.52))}button{box-sizing:border-box;display:inline-flex;height:100%;width:100%;flex:1 1 0%;flex-direction:column;gap:var(--rtk-space-1, 4px);padding-left:var(--rtk-space-1, 4px);padding-right:var(--rtk-space-1, 4px);align-items:center;justify-content:center;cursor:pointer;border-radius:var(--rtk-border-radius-md, 8px);border-width:var(--rtk-border-width-none, 0);border-style:none;background-color:transparent;color:inherit;outline-offset:-2px;border:var(--rtk-border-width-md, 2px) solid transparent}.label{text-align:center;font-size:12px;overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:1}#warning-indicator{position:absolute;top:var(--rtk-space-1, 4px);right:var(--rtk-space-2, 8px);height:var(--rtk-space-4, 16px);width:var(--rtk-space-4, 16px);--tw-text-opacity:1;color:rgba(var(--rtk-colors-warning, 255 205 7) / var(--tw-text-opacity))}:host([size='sm']) #warning-indicator{right:var(--rtk-space-0, 0px);top:var(--rtk-space-0, 0px);height:var(--rtk-space-3, 12px);width:var(--rtk-space-3, 12px)}:host(:hover) button{--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-background-800, 30 30 30) / var(--tw-bg-opacity))}#icon{width:var(--icon-size);height:var(--icon-size)}:host(.leave:hover) button{--tw-bg-opacity:1;background-color:rgba(var(--rtk-colors-background-1000, 8 8 8) / var(--tw-bg-opacity));--tw-text-opacity:1;color:rgba(var(--rtk-colors-danger, 255 45 45) / var(--tw-text-opacity));border:var(--rtk-border-width-md, 2px) solid rgb(var(--rtk-colors-danger, 255 45 45))}:host(.active) button{--tw-text-opacity:1;color:rgba(var(--rtk-colors-brand-400, 53 110 253) / var(--tw-text-opacity));border:var(--rtk-border-width-md, 2px) solid rgb(var(--rtk-colors-brand-400, 53 110 253))}button:focus-visible{outline:2px solid rgb(var(--rtk-colors-brand-400, 53 110 253))}:host(.active-livestream){--tw-text-opacity:1;color:rgba(var(--rtk-colors-danger, 255 45 45) / var(--tw-text-opacity))}:host([size='sm']){min-width:var(--rtk-space-14, 56px)}:host([size='sm']) .label{display:none}:host([variant='horizontal']){width:100%}:host([variant='horizontal']) button{border-radius:7px;height:var(--rtk-space-12, 48px);width:100%;padding-left:var(--rtk-space-5, 20px);padding-right:var(--rtk-space-5, 20px);padding-top:var(--rtk-space-3, 12px);padding-bottom:var(--rtk-space-3, 12px);flex-direction:row;justify-content:flex-start;gap:var(--rtk-space-3, 12px)}:host([variant='horizontal']) #icon{width:var(--rtk-space-6, 24px)}:host([variant='horizontal']) .label{display:block;font-size:14px;line-height:1.25rem}:host([variant='horizontal']) #warning-indicator{right:auto;left:var(--rtk-space-4, 16px)}:host([brand-icon]) rtk-icon#icon{--tw-text-opacity:1;color:rgba(var(--rtk-colors-brand-500, 33 96 253) / var(--tw-text-opacity))}@media only screen and (max-device-height: 480px) and (orientation: landscape){:host .label{display:none}:slotted(rtk-icon){height:var(--rtk-space-4, 16px);width:var(--rtk-space-4, 16px)}}";var qx=Object.freeze({__proto__:null,rtk_controlbar_button:Vx});return t.defineCustomElements=async(t,e)=>{if("undefined"!=typeof window)return await void 0,Ht(JSON.parse('[["rtk-avatar_54",[[1,"rtk-meeting",{"loadConfigFromPreset":[1028,"load-config-from-preset"],"applyDesignSystem":[1028,"apply-design-system"],"mode":[513],"leaveOnUnmount":[4,"leave-on-unmount"],"meeting":[16],"showSetupScreen":[1028,"show-setup-screen"],"t":[16],"config":[1040],"size":[1537],"gridLayout":[1,"grid-layout"],"iconPack":[16]},[[0,"rtkStateUpdate","listenState"]],{"meeting":["meetingChanged"]}],[1,"rtk-chat",{"meeting":[16],"config":[16],"size":[513],"iconPack":[16],"t":[16],"disablePrivateChat":[4,"disable-private-chat"],"privatePresetFilter":[16],"displayFilter":[16],"canPinMessages":[32],"unreadCountGroups":[32],"chatGroups":[32],"selectedGroup":[32],"now":[32],"dropzoneActivated":[32],"showLatestMessageButton":[32],"canSend":[32],"canSendTextMessage":[32],"canSendFiles":[32],"canPrivateMessage":[32],"canSendPrivateTexts":[32],"canSendPrivateFiles":[32],"emojiPickerEnabled":[32],"chatRecipientId":[32],"participants":[32],"selectedParticipant":[32],"channels":[32],"selectedChannelId":[32],"editingMessage":[32],"replyMessage":[32],"searchQuery":[32],"selectorState":[32],"creatingChannel":[32],"showPinnedMessages":[32]},[[8,"editMessageInit","onEditMessageInit"],[0,"switchChannel","channelSwitchListener"]],{"meeting":["meetingChanged"],"chatGroups":["chatGroupsChanged"],"displayFilter":["onDisplayFilterChanged"]}],[1,"rtk-dialog-manager",{"meeting":[16],"config":[16],"states":[16],"size":[513],"iconPack":[16],"t":[16]},null,{"meeting":["meetingChanged"]}],[1,"rtk-chat-messages-ui",{"selectedGroup":[1,"selected-group"],"messages":[16],"selfUserId":[1,"self-user-id"],"canPinMessages":[4,"can-pin-messages"],"size":[513],"iconPack":[16],"t":[16],"now":[32],"showLatestMessageButton":[32]},null,{"messages":["chatChanged"],"selectedGroup":["selectedBucketChanged"]}],[1,"rtk-chat-messages-ui-paginated",{"meeting":[16],"selectedChannel":[16],"selectedChannelId":[1,"selected-channel-id"],"size":[513],"iconPack":[16],"t":[16],"leftAlign":[4,"left-align"],"children":[32],"permissionsChanged":[32]},null,{"meeting":["meetingChanged"],"selectedChannelId":["channelChanged"]}],[1,"rtk-chat-search-results",{"meeting":[16],"query":[1],"channelId":[1,"channel-id"],"iconPack":[16],"t":[16]}],[1,"rtk-chat-composer-view",{"canSendTextMessage":[4,"can-send-text-message"],"canSendFiles":[4,"can-send-files"],"message":[1],"quotedMessage":[1,"quoted-message"],"storageKey":[1,"storage-key"],"inputTextPlaceholder":[1,"input-text-placeholder"],"isEditing":[4,"is-editing"],"iconPack":[16],"t":[16],"maxLength":[2,"max-length"],"disableEmojiPicker":[4,"disable-emoji-picker"],"rateLimits":[16],"fileToUpload":[32],"isEmojiPickerOpen":[32],"disableSendButton":[32],"rateLimitsBreached":[32]}],[0,"rtk-channel-header",{"meeting":[16],"channel":[16],"iconPack":[16],"t":[16],"showBackButton":[4,"show-back-button"],"showChannelDetailsDialog":[32],"showSearchBar":[32],"members":[32]},null,{"channel":["onChannelChanged"]}],[1,"rtk-channel-selector-view",{"channels":[16],"selectedChannelId":[1,"selected-channel-id"],"disableSearch":[4,"disable-search"],"hideAvatar":[4,"hide-avatar"],"iconPack":[16],"t":[16],"viewAs":[1,"view-as"],"searchQuery":[32],"showDropdown":[32]}],[1,"rtk-notifications",{"meeting":[16],"states":[16],"config":[16],"t":[16],"size":[513],"iconPack":[16],"notifications":[32],"paused":[32]},[[8,"rtkApiError","apiErrorListener"],[8,"rtkSendNotification","sendNotificationListener"]],{"meeting":["meetingChanged"],"config":["configChanged"],"states":["statesChanged"]}],[1,"rtk-chat-message",{"message":[16],"isContinued":[4,"is-continued"],"child":[16],"isUnread":[4,"is-unread"],"size":[513],"iconPack":[16],"t":[16],"isSelf":[4,"is-self"],"canEdit":[4,"can-edit"],"canDelete":[4,"can-delete"],"canReply":[4,"can-reply"],"canPin":[4,"can-pin"],"disableControls":[4,"disable-controls"],"alignRight":[4,"align-right"],"senderDisplayPicture":[1,"sender-display-picture"],"hideAvatar":[4,"hide-avatar"],"leftAlign":[4,"left-align"],"now":[32]}],[1,"rtk-breakout-rooms-manager",{"meeting":[16],"states":[16],"iconPack":[16],"t":[16],"loading":[32],"roomConfig":[32],"draftState":[32],"assigningParticipants":[32],"selectedParticipants":[32],"ephemeralStatusText":[32],"isDragMode":[32]},[[0,"participantDelete","onParticipantDelete"],[0,"participantsDragging","toggleDragMode"],[0,"selectedParticipantsUpdate","updateSelectedParticipants"],[0,"allParticipantsToggleUpdate","updateAllParticipants"]],{"selectedParticipants":["onSelectedParticipantsChanged"]}],[1,"rtk-debugger",{"meeting":[16],"states":[16],"size":[513],"iconPack":[16],"t":[16],"activeTab":[32],"isMobileMainVisible":[32],"progress":[32]},[[0,"testProgress","progressUpdate"]]],[1,"rtk-channel-creator",{"meeting":[16],"t":[16],"iconPack":[16],"channelName":[32],"searchQuery":[32],"step":[32],"loading":[32],"selectedMemberIds":[32],"focusedMemberIndex":[32],"showAllMembersList":[32]}],[1,"rtk-channel-details",{"channel":[16],"t":[16],"iconPack":[16],"members":[16]}],[1,"rtk-draft-attachment-view",{"iconPack":[16],"t":[16],"attachment":[16],"filePreview":[32]},null,{"attachment":["onAttachmentChange"]}],[1,"rtk-emoji-picker-button",{"iconPack":[16],"t":[16],"isActive":[4,"is-active"]}],[1,"rtk-file-picker-button",{"filter":[1],"label":[1],"icon":[1],"iconPack":[16],"t":[16]}],[1,"rtk-broadcast-message-modal",{"meeting":[16],"states":[16],"iconPack":[16],"t":[16],"messagePayload":[32],"successMessage":[32]}],[1,"rtk-join-stage",{"meeting":[16],"config":[16],"states":[16],"size":[513],"iconPack":[16],"t":[16],"dataConfig":[16],"isLoading":[32]}],[1,"rtk-notification",{"notification":[16],"paused":[4],"size":[513],"iconPack":[16],"t":[16],"imageState":[32]},null,{"paused":["pausedChanged"],"notification":["notificationChanged"]}],[1,"rtk-permissions-message",{"meeting":[16],"t":[16],"iconPack":[16],"states":[16],"device":[32],"currentStep":[32],"svgSteps":[32]},null,{"meeting":["meetingChanged"]}],[1,"rtk-confirmation-modal",{"meeting":[16],"states":[16],"iconPack":[16],"t":[16]}],[1,"rtk-leave-meeting",{"meeting":[16],"states":[16],"iconPack":[16],"t":[16],"canEndMeeting":[32]},null,{"meeting":["meetingChanged"]}],[1,"rtk-mute-all-confirmation",{"meeting":[16],"states":[16],"iconPack":[16],"t":[16],"allowUnmute":[32]}],[1,"rtk-overlay-modal",{"meeting":[16],"states":[16],"iconPack":[16],"t":[16]}],[1,"rtk-text-composer-view",{"disabled":[4],"placeholder":[1],"value":[1],"maxLength":[2,"max-length"],"rateLimitBreached":[4,"rate-limit-breached"],"keyDownHandler":[16],"iconPack":[16],"t":[16],"maxLengthBreached":[32],"setText":[64]}],[1,"rtk-message-view",{"actions":[16],"variant":[1],"viewType":[1,"view-type"],"avatarUrl":[1,"avatar-url"],"hideAvatar":[4,"hide-avatar"],"authorName":[1,"author-name"],"hideAuthorName":[4,"hide-author-name"],"hideMetadata":[4,"hide-metadata"],"time":[16],"iconPack":[16]}],[1,"rtk-breakout-room-manager",{"meeting":[16],"assigningParticipants":[4,"assigning-participants"],"mode":[1],"states":[16],"allowDelete":[4,"allow-delete"],"iconPack":[16],"t":[16],"isDragMode":[4,"is-drag-mode"],"room":[16],"defaultExpanded":[4,"default-expanded"],"editingTitleRoomId":[32],"newTitle":[32],"showExpandedCard":[32],"glowingCard":[32]}],[1,"rtk-breakout-room-participants",{"meeting":[16],"participantIds":[16],"iconPack":[16],"t":[16],"selectedParticipantIds":[16],"search":[32],"participantsToShow":[32],"isDragging":[32]},null,{"meeting":["meetingChanged"],"participantIds":["participantsChanged"],"search":["searchChanged"]}],[1,"rtk-emoji-picker",{"iconPack":[16],"t":[16],"focusWhenOpened":[4,"focus-when-opened"],"emojiList":[32],"filterVal":[32],"filteredEmojis":[32]}],[0,"rtk-image-message",{"message":[16],"now":[16],"isContinued":[516,"is-continued"],"iconPack":[16],"t":[16],"showBubble":[4,"show-bubble"],"status":[32]}],[1,"rtk-image-message-view",{"url":[1],"iconPack":[16],"t":[16],"status":[32]}],[1,"rtk-paginated-list",{"pageSize":[2,"page-size"],"pagesAllowed":[2,"pages-allowed"],"fetchData":[16],"createNodes":[16],"selectedItemId":[1,"selected-item-id"],"autoScroll":[4,"auto-scroll"],"iconPack":[16],"t":[16],"emptyListLabel":[1,"empty-list-label"],"isLoading":[32],"rerenderBoolean":[32],"shouldRenderNewNodes":[32],"hasNewNodesToRender":[32],"showEmptyListLabel":[32],"onNewNode":[64],"onNodeDelete":[64],"onNodeUpdate":[64]},null,{"selectedItemId":["onItemChanged"]}],[1,"rtk-counter",{"size":[513],"value":[2],"minValue":[2,"min-value"],"iconPack":[16],"t":[16],"input":[32]},null,{"input":["watchStateHandler"]}],[0,"rtk-file-message",{"message":[16],"now":[16],"isContinued":[516,"is-continued"],"iconPack":[16],"t":[16],"showBubble":[4,"show-bubble"]}],[1,"rtk-file-message-view",{"name":[1],"size":[2],"url":[1],"iconPack":[16]}],[1,"rtk-debugger-audio",{"meeting":[16],"states":[16],"size":[513],"iconPack":[16],"t":[16],"isNetworkOpen":[32],"isDevicesOpen":[32],"audioProducerFormattedStats":[32],"audioProducerScoreStats":[32],"networkBasedMediaHealth":[32],"devicesHealth":[32]},null,{"audioProducerScoreStats":["audioProducerScoreStatsChanged"],"meeting":["meetingChanged"]}],[1,"rtk-debugger-screenshare",{"meeting":[16],"states":[16],"size":[513],"iconPack":[16],"t":[16],"isNetworkOpen":[32],"isDevicesOpen":[32],"videoProducerFormattedStats":[32],"videoProducerScoreStats":[32],"audioProducerFormattedStats":[32],"audioProducerScoreStats":[32],"networkBasedMediaHealth":[32]},null,{"videoProducerScoreStats":["videoProducerScoreStatsChanged"],"audioProducerScoreStats":["audioProducerScoreStatsChanged"],"meeting":["meetingChanged"]}],[1,"rtk-debugger-system",{"meeting":[16],"states":[16],"size":[513],"iconPack":[16],"t":[16],"isBatterySectionOpen":[32],"batterySectionHealth":[32],"battery":[32],"batteryFormattedStats":[32]},null,{"meeting":["meetingChanged"]}],[1,"rtk-debugger-video",{"meeting":[16],"states":[16],"size":[513],"iconPack":[16],"t":[16],"isNetworkOpen":[32],"isDevicesOpen":[32],"videoProducerFormattedStats":[32],"videoProducerScoreStats":[32],"networkBasedMediaHealth":[32],"devicesHealth":[32]},null,{"videoProducerScoreStats":["videoProducerScoreStatsChanged"],"meeting":["meetingChanged"]}],[0,"rtk-text-message",{"message":[16],"now":[16],"isContinued":[516,"is-continued"],"iconPack":[16],"t":[16],"showBubble":[4,"show-bubble"]}],[1,"rtk-dialog",{"hideCloseButton":[4,"hide-close-button"],"disableEscapeKey":[4,"disable-escape-key"],"meeting":[16],"config":[16],"states":[16],"size":[513],"iconPack":[16],"t":[16],"open":[1540]}],[1,"rtk-logo",{"logoUrl":[1025,"logo-url"],"config":[16],"meeting":[16],"t":[16]},null,{"config":["configChanged"],"meeting":["meetingChanged"]}],[0,"rtk-text-message-view",{"text":[1],"isMarkdown":[4,"is-markdown"]}],[1,"rtk-markdown-view",{"text":[1],"maxLength":[2,"max-length"]}],[1,"rtk-menu",{"size":[513],"placement":[1],"offset":[2],"iconPack":[16],"t":[16]}],[1,"rtk-menu-item",{"size":[513],"iconPack":[16],"t":[16]}],[1,"rtk-menu-list",{"iconPack":[16],"t":[16]}],[1,"rtk-avatar",{"participant":[16],"variant":[513],"size":[513],"iconPack":[16],"t":[16],"imageState":[32]}],[1,"rtk-tooltip",{"label":[1],"variant":[513],"disabled":[516],"open":[516],"kind":[513],"size":[513],"placement":[1],"delay":[2],"isInFocus":[32]},null,{"open":["openChanged"]}],[1,"rtk-spinner",{"iconPack":[16],"size":[513]}],[17,"rtk-button",{"size":[513],"variant":[513],"kind":[513],"reverse":[516],"disabled":[516],"type":[513]}],[1,"rtk-icon",{"icon":[1],"variant":[513],"size":[513]}]]],["rtk-participants",[[1,"rtk-participants",{"meeting":[16],"states":[16],"config":[16],"size":[513],"iconPack":[16],"defaultParticipantsTabId":[1,"default-participants-tab-id"],"t":[16],"currentParticipantsTabId":[32],"tabs":[32],"hasRequests":[32],"search":[32]},null,{"meeting":["meetingChanged"],"currentParticipantsTabId":["currentParticipantsTabIdChanged"]}]]],["rtk-settings",[[1,"rtk-settings",{"meeting":[16],"states":[16],"size":[513],"iconPack":[16],"t":[16],"activeTab":[32],"isMobileMainVisible":[32],"networkStatus":[32],"canProduceVideo":[32]},null,{"meeting":["meetingChanged"]}]]],["rtk-grid",[[1,"rtk-grid",{"layout":[513],"aspectRatio":[513,"aspect-ratio"],"meeting":[16],"gap":[514],"size":[513],"states":[16],"config":[16],"iconPack":[16],"t":[16],"gridSize":[16],"overrides":[8],"participants":[32],"pinnedParticipants":[32],"screenShareParticipants":[32],"plugins":[32],"emptyStage":[32],"showLiveStreamPlayer":[32],"canCurrentPeerHost":[32],"pipSupported":[32],"pipEnabled":[32],"hidden":[32],"roomState":[32]},null,{"meeting":["meetingChanged"],"overrides":["overridesChanged"],"screenShareParticipants":["screenShareParticipantsChanged"],"plugins":["pluginsChanged"],"pinnedParticipants":["pinnedParticipantsChanged"]}]]],["rtk-sidebar",[[1,"rtk-sidebar",{"enabledSections":[1040],"defaultSection":[1,"default-section"],"meeting":[16],"states":[16],"config":[16],"iconPack":[16],"t":[16],"size":[513],"view":[513],"currentTab":[32],"isFloating":[32],"enablePinning":[32]},null,{"meeting":["meetingChanged"],"states":["statesChanged"],"view":["viewChanged"]}]]],["rtk-chat-composer-ui",[[1,"rtk-chat-composer-ui",{"canSendTextMessage":[4,"can-send-text-message"],"canSendFiles":[4,"can-send-files"],"size":[513],"iconPack":[16],"t":[16],"disableEmojiPicker":[4,"disable-emoji-picker"],"prefill":[16],"members":[16],"channelId":[1,"channel-id"],"emojiPickerActive":[32],"mentionQuery":[32],"focusedMemberIndex":[32],"filePreview":[32]},null,{"channelId":["onChannelChanged"]}]]],["rtk-mixed-grid",[[1,"rtk-mixed-grid",{"layout":[513],"participants":[16],"pinnedParticipants":[16],"screenShareParticipants":[16],"plugins":[16],"aspectRatio":[1,"aspect-ratio"],"gap":[2],"size":[513],"meeting":[16],"states":[16],"config":[16],"iconPack":[16],"t":[16],"gridSize":[16],"activeTab":[32],"initialised":[32]},null,{"meeting":["meetingChanged"],"screenShareParticipants":["screenShareParticipantsChanged"],"plugins":["pluginsChanged"]}]]],["rtk-setup-screen",[[1,"rtk-setup-screen",{"meeting":[16],"states":[16],"size":[513],"config":[16],"iconPack":[16],"t":[16],"displayName":[32],"isJoining":[32],"canEditName":[32],"canProduceAudio":[32],"connectionState":[32]},null,{"meeting":["meetingChanged"]}]]],["rtk-audio-tile",[[1,"rtk-audio-tile",{"meeting":[16],"config":[16],"size":[513],"states":[16],"iconPack":[16],"t":[16],"participant":[16],"audioEnabled":[32],"volume":[32]},null,{"participant":["participantChanged"]}]]],["rtk-camera-toggle",[[1,"rtk-camera-toggle",{"variant":[513],"meeting":[16],"size":[513],"iconPack":[16],"t":[16],"videoEnabled":[32],"canProduceVideo":[32],"cameraPermission":[32],"stageStatus":[32]},null,{"meeting":["meetingChanged"]}]]],["rtk-channel-selector-ui",[[1,"rtk-channel-selector-ui",{"channels":[16],"selectedChannelId":[1,"selected-channel-id"],"iconPack":[16],"t":[16],"showRecentMessage":[4,"show-recent-message"],"isHidden":[32],"searchQuery":[32]}]]],["rtk-mic-toggle",[[1,"rtk-mic-toggle",{"variant":[513],"meeting":[16],"size":[513],"iconPack":[16],"t":[16],"audioEnabled":[32],"canProduceAudio":[32],"micPermission":[32],"stageStatus":[32]},null,{"meeting":["meetingChanged"]}]]],["rtk-mute-all-button",[[1,"rtk-mute-all-button",{"variant":[513],"meeting":[16],"size":[513],"iconPack":[16],"t":[16],"canDisable":[32]},null,{"meeting":["meetingChanged"]}]]],["rtk-screen-share-toggle",[[1,"rtk-screen-share-toggle",{"states":[16],"variant":[513],"meeting":[16],"size":[513],"iconPack":[16],"t":[16],"maxScreenShareCount":[32],"screenShareCount":[32],"screenShareEnabled":[32],"canScreenShare":[32],"shareScreenPermission":[32],"screenShareState":[32],"stageStatus":[32]},null,{"meeting":["meetingChanged"]}]]],["rtk-stage-toggle",[[1,"rtk-stage-toggle",{"variant":[513],"meeting":[16],"size":[513],"iconPack":[16],"states":[16],"t":[16],"stageStatus":[32],"state":[32]},null,{"meeting":["meetingChanged"]}]]],["rtk-ai",[[1,"rtk-ai",{"meeting":[16],"states":[16],"config":[16],"iconPack":[16],"t":[16],"size":[513],"view":[513]},null,{"view":["viewChanged"]}]]],["rtk-ai-toggle",[[1,"rtk-ai-toggle",{"variant":[513],"states":[16],"meeting":[16],"size":[513],"iconPack":[16],"t":[16],"aiActive":[32]},null,{"states":["statesChanged"]}]]],["rtk-breakout-rooms-toggle",[[1,"rtk-breakout-rooms-toggle",{"variant":[513],"meeting":[16],"states":[16],"size":[513],"iconPack":[16],"t":[16],"canToggle":[32]},null,{"meeting":["meetingChanged"]}]]],["rtk-caption-toggle",[[1,"rtk-caption-toggle",{"variant":[513],"meeting":[16],"states":[16],"config":[16],"iconPack":[16],"size":[513],"t":[16],"captionEnabled":[32]},null,{"meeting":["meetingChanged"]}]]],["rtk-chat-toggle",[[1,"rtk-chat-toggle",{"variant":[513],"meeting":[16],"states":[16],"size":[513],"iconPack":[16],"t":[16],"unreadMessageCount":[32],"chatActive":[32],"canViewChat":[32],"hasNewMessages":[32]},null,{"meeting":["meetingChanged"],"states":["statesChanged"],"chatActive":["handleChatActiveChange"]}]]],["rtk-debugger-toggle",[[1,"rtk-debugger-toggle",{"variant":[513],"meeting":[16],"states":[16],"t":[16],"iconPack":[16],"size":[513]}]]],["rtk-grid-pagination",[[1,"rtk-grid-pagination",{"meeting":[16],"states":[16],"size":[513],"variant":[513],"iconPack":[16],"t":[16],"page":[32],"pageCount":[32],"activeCount":[32],"activeComputedCount":[32],"showPagination":[32]},null,{"meeting":["meetingChanged"],"size":["sizeChanged"]}]]],["rtk-idle-screen",[[1,"rtk-idle-screen",{"meeting":[16],"config":[16],"iconPack":[16],"t":[16]}]]],["rtk-leave-button",[[1,"rtk-leave-button",{"variant":[513],"size":[513],"iconPack":[16],"t":[16]}]]],["rtk-livestream-toggle",[[1,"rtk-livestream-toggle",{"variant":[513],"meeting":[16],"size":[513],"iconPack":[16],"t":[16],"livestreamState":[32]},null,{"meeting":["meetingChanged"]}]]],["rtk-more-toggle",[[1,"rtk-more-toggle",{"states":[16],"size":[513],"iconPack":[16],"t":[16]}]]],["rtk-participants-audio",[[1,"rtk-participants-audio",{"meeting":[16],"iconPack":[16],"t":[16],"preloadedAudioElem":[16],"showPlayDialog":[32]},null,{"meeting":["meetingChanged"]}]]],["rtk-participants-toggle",[[1,"rtk-participants-toggle",{"variant":[513],"meeting":[16],"states":[16],"size":[513],"iconPack":[16],"t":[16],"participantsActive":[32],"waitlistedParticipants":[32],"stageRequestedParticipants":[32],"badgeCount":[32],"canViewParticipants":[32]},null,{"meeting":["meetingChanged"],"states":["statesChanged"],"participantsActive":["handleParticipantsActiveChange"]}]]],["rtk-pip-toggle",[[1,"rtk-pip-toggle",{"variant":[513],"meeting":[16],"states":[16],"config":[16],"iconPack":[16],"size":[513],"t":[16],"pipSupported":[32]},null,{"meeting":["meetingChanged"]}]]],["rtk-plugins-toggle",[[1,"rtk-plugins-toggle",{"variant":[513],"meeting":[16],"states":[16],"size":[513],"iconPack":[16],"t":[16],"pluginsActive":[32],"canViewPlugins":[32]},null,{"meeting":["meetingChanged"],"states":["statesChanged"],"pluginsActive":["handlePluginsActiveChange"]}]]],["rtk-polls-toggle",[[1,"rtk-polls-toggle",{"variant":[513],"meeting":[16],"states":[16],"size":[513],"iconPack":[16],"t":[16],"pollsActive":[32],"unreadPollsCount":[32],"canViewPolls":[32]},null,{"meeting":["meetingChanged"],"states":["statesChanged"],"pollsActive":["handlePollsActiveChange"]}]]],["rtk-recording-toggle",[[1,"rtk-recording-toggle",{"variant":[513],"meeting":[16],"t":[16],"iconPack":[16],"size":[513],"disabled":[4],"recordingState":[32],"canRecord":[32]},null,{"meeting":["meetingChanged"]}]]],["rtk-screenshare-view",[[1,"rtk-screenshare-view",{"hideFullScreenButton":[4,"hide-full-screen-button"],"nameTagPosition":[513,"name-tag-position"],"participant":[16],"meeting":[16],"variant":[513],"size":[513],"iconPack":[16],"t":[16],"videoExpanded":[32],"screenShareEnabled":[32],"isFullScreen":[32],"remoteControlInfo":[32]},null,{"participant":["participantChanged"]}]]],["rtk-settings-toggle",[[1,"rtk-settings-toggle",{"variant":[513],"states":[16],"size":[513],"iconPack":[16],"t":[16]}]]],["rtk-ended-screen",[[1,"rtk-ended-screen",{"config":[16],"size":[513],"states":[16],"t":[16],"iconPack":[16],"meeting":[16],"icon":[32],"message":[32]},null,{"states":["statesChanged"]}]]],["rtk-image-viewer",[[1,"rtk-image-viewer",{"image":[16],"size":[513],"t":[16],"iconPack":[16]}]]],["rtk-message-list-view",[[0,"rtk-message-list-view",{"messages":[16],"renderer":[16],"loadMore":[16],"visibleItemsCount":[2,"visible-items-count"],"estimateItemSize":[2,"estimate-item-size"],"iconPack":[16],"range":[32],"isFetching":[32],"autoScroll":[32],"totalHeight":[32]},null,{"messages":["messagesUpdated"]}]]],["rtk-chat-selector-ui",[[1,"rtk-chat-selector-ui",{"selfUserId":[1,"self-user-id"],"selectedGroupId":[1,"selected-group-id"],"unreadCounts":[16],"groups":[16],"iconPack":[16],"t":[16],"showParticipantsPanel":[32],"query":[32]}]]],["rtk-clock",[[1,"rtk-clock",{"meeting":[16],"iconPack":[16],"startedTime":[32],"timeDiff":[32]},null,{"meeting":["meetingChanged"],"startedTime":["startedTimeChanged"]}]]],["rtk-file-dropzone",[[1,"rtk-file-dropzone",{"hostEl":[16],"iconPack":[16],"t":[16],"dropzoneActivated":[32]}]]],["rtk-information-tooltip",[[1,"rtk-information-tooltip",{"iconPack":[16]}]]],["rtk-meeting-title",[[1,"rtk-meeting-title",{"meeting":[16],"iconPack":[16],"t":[16]}]]],["rtk-network-indicator",[[1,"rtk-network-indicator",{"participant":[16],"meeting":[16],"iconPack":[16],"t":[16],"isScreenShare":[4,"is-screen-share"],"score":[32]},null,{"participant":["participantChanged"]}]]],["rtk-participant-count",[[1,"rtk-participant-count",{"meeting":[16],"iconPack":[16],"t":[16],"size":[513],"participantCount":[32],"isViewer":[32]},null,{"meeting":["meetingChanged"]}]]],["rtk-recording-indicator",[[1,"rtk-recording-indicator",{"meeting":[16],"size":[513],"t":[16],"iconPack":[16],"isRecording":[32]},null,{"meeting":["meetingChanged"]}]]],["rtk-transcript",[[1,"rtk-transcript",{"transcript":[16],"t":[16],"timeout":[32]},null,{"transcript":["transcriptChanged"]}]]],["rtk-transcripts",[[1,"rtk-transcripts",{"meeting":[16],"states":[16],"config":[16],"t":[16],"transcripts":[32],"listenerAttached":[32]},null,{"meeting":["meetingChanged"],"states":["statesChanged"]}]]],["rtk-waiting-screen",[[1,"rtk-waiting-screen",{"meeting":[16],"config":[16],"iconPack":[16],"t":[16]}]]],["rtk-audio-grid",[[1,"rtk-audio-grid",{"meeting":[16],"config":[16],"states":[16],"iconPack":[16],"size":[513],"t":[16],"hideSelf":[4,"hide-self"],"activeParticipants":[32],"onStageParticipants":[32],"offStageParticipants":[32]},null,{"meeting":["meetingChanged"]}]]],["rtk-controlbar",[[1,"rtk-controlbar",{"variant":[513],"disableRender":[4,"disable-render"],"meeting":[16],"config":[16],"states":[16],"iconPack":[16],"t":[16],"size":[513]}]]],["rtk-header",[[1,"rtk-header",{"variant":[513],"disableRender":[4,"disable-render"],"meeting":[16],"config":[16],"states":[16],"iconPack":[16],"t":[16],"size":[513]}]]],["rtk-participant-setup",[[1,"rtk-participant-setup",{"nameTagPosition":[513,"name-tag-position"],"isPreview":[4,"is-preview"],"participant":[16],"states":[16],"config":[16],"variant":[513],"size":[513],"iconPack":[16],"t":[16],"videoState":[32],"isPinned":[32]},null,{"participant":["participantsChanged"],"videoState":["videoStateChanged"]}]]],["rtk-simple-grid",[[1,"rtk-simple-grid",{"participants":[16],"aspectRatio":[1,"aspect-ratio"],"gap":[2],"size":[513],"meeting":[16],"states":[16],"config":[16],"iconPack":[16],"t":[16],"dimensions":[32],"mediaConnection":[32]},null,{"meeting":["meetingChanged"]}]]],["rtk-spotlight-grid",[[1,"rtk-spotlight-grid",{"layout":[513],"participants":[16],"pinnedParticipants":[16],"aspectRatio":[1,"aspect-ratio"],"gap":[2],"size":[513],"meeting":[16],"states":[16],"config":[16],"iconPack":[16],"t":[16],"gridSize":[16]}]]],["rtk-stage",[[1,"rtk-stage",{"iconPack":[16],"t":[16]}]]],["rtk-ui-provider",[[4,"rtk-ui-provider",{"meeting":[16],"iconPack":[16],"t":[16],"config":[16],"size":[1537],"showSetupScreen":[4,"show-setup-screen"],"noRenderUntilMeeting":[4,"no-render-until-meeting"]},[[0,"rtkStateUpdate","listenState"]],{"meeting":["onMeetingChange"],"iconPack":["onIconPackChange"],"t":["onTChange"],"config":["onConfigChange"],"size":["onSizeChange"]}]]],["rtk-ai-transcriptions",[[1,"rtk-ai-transcriptions",{"t":[16],"meeting":[16],"initialTranscriptions":[16],"participantQuery":[32],"isProcessing":[32],"transcriptions":[32]},null,{"meeting":["meetingChanged"],"transcriptions":["transcriptionsChanged"]}]]],["rtk-name-tag",[[1,"rtk-name-tag",{"participant":[16],"meeting":[16],"size":[513],"isScreenShare":[4,"is-screen-share"],"variant":[513],"iconPack":[16],"t":[16],"length":[32]},null,{"size":["sizeChanged"]}]]],["rtk-settings-audio_2",[[1,"rtk-settings-audio",{"meeting":[16],"states":[16],"size":[513],"iconPack":[16],"t":[16]}],[1,"rtk-settings-video",{"meeting":[16],"states":[16],"size":[513],"iconPack":[16],"t":[16],"videoEnabled":[32]},null,{"meeting":["meetingChanged"]}]]],["rtk-spotlight-indicator",[[1,"rtk-spotlight-indicator",{"meeting":[16],"iconPack":[16],"t":[16],"size":[513],"canSpotlight":[32],"isSpotlighted":[32]},null,{"meeting":["meetingChanged"]}]]],["rtk-poll_2",[[1,"rtk-poll-form",{"iconPack":[16],"t":[16],"options":[32],"anonymous":[32],"hideVotes":[32],"error":[32]}],[1,"rtk-poll",{"poll":[16],"self":[1],"permissions":[16],"iconPack":[16],"t":[16]}]]],["rtk-plugins_2",[[1,"rtk-polls",{"meeting":[16],"config":[16],"size":[513],"iconPack":[16],"t":[16],"create":[32],"polls":[32],"permissions":[32]},null,{"meeting":["meetingChanged"]}],[1,"rtk-plugins",{"meeting":[16],"config":[16],"size":[513],"iconPack":[16],"t":[16],"plugins":[32],"canStartPlugins":[32],"canClosePlugins":[32],"activatedPluginsId":[32]},null,{"meeting":["meetingChanged"]}]]],["rtk-plugin-main_2",[[1,"rtk-tab-bar",{"size":[513],"meeting":[16],"states":[16],"config":[16],"layout":[513],"iconPack":[16],"t":[16],"activeTab":[16],"tabs":[16]}],[1,"rtk-plugin-main",{"meeting":[16],"plugin":[16],"iconPack":[16],"t":[16],"canClosePlugin":[32],"viewModeEnabled":[32]},null,{"meeting":["meetingChanged"],"plugin":["pluginChanged"]}]]],["rtk-fullscreen-toggle",[[1,"rtk-fullscreen-toggle",{"states":[16],"targetElement":[16],"variant":[513],"size":[513],"iconPack":[16],"t":[16],"fullScreenActive":[32],"isFullScreenSupported":[32]}]]],["rtk-sidebar-ui",[[1,"rtk-sidebar-ui",{"view":[513],"tabs":[16],"hideHeader":[4,"hide-header"],"hideCloseAction":[4,"hide-close-action"],"currentTab":[1,"current-tab"],"iconPack":[16],"focusCloseButton":[4,"focus-close-button"],"t":[16]},null,{"currentTab":["handleFocusCloseButton"]}]]],["rtk-livestream-indicator_3",[[1,"rtk-livestream-player",{"meeting":[16],"size":[513],"t":[16],"iconPack":[16],"playbackUrl":[32],"isSupported":[32],"playerState":[32],"livestreamState":[32],"playerError":[32],"livestreamId":[32],"audioPlaybackError":[32],"qualityLevels":[32],"selectedQuality":[32],"currentTime":[32],"duration":[32],"hideControls":[32]},null,{"livestreamState":["updateLivestreamId"],"meeting":["meetingChanged"]}],[1,"rtk-livestream-indicator",{"meeting":[16],"size":[513],"t":[16],"iconPack":[16],"isLivestreaming":[32]},null,{"meeting":["meetingChanged"]}],[1,"rtk-viewer-count",{"meeting":[16],"variant":[513],"iconPack":[16],"t":[16],"viewerCount":[32]},null,{"meeting":["meetingChanged"]}]]],["rtk-participant_2",[[1,"rtk-participant",{"meeting":[16],"states":[16],"view":[1],"participant":[16],"iconPack":[16],"t":[16],"config":[16],"audioEnabled":[32],"videoEnabled":[32],"isPinned":[32],"isHidden":[32],"isOnStage":[32],"canDisableParticipantAudio":[32],"canDisableParticipantVideo":[32],"canKickParticipant":[32],"canPinParticipant":[32],"canAllowParticipantOnStage":[32],"menuOpen":[32]},null,{"meeting":["meetingChanged"],"participant":["participantChanged"]}],[0,"rtk-virtualized-participant-list",{"items":[16],"renderItem":[16],"itemHeight":[1026,"item-height"],"bufferedItemsCount":[2,"buffered-items-count"],"emptyListElement":[16],"visibleStart":[32],"visibleEnd":[32]},null,{"items":["itemsChanged"]}]]],["rtk-participants-stage-list_4",[[1,"rtk-participants-viewer-list",{"meeting":[16],"config":[16],"size":[513],"hideHeader":[4,"hide-header"],"iconPack":[16],"view":[1],"search":[1],"t":[16],"stageViewers":[32]},null,{"meeting":["meetingChanged"],"search":["searchChanged"]}],[1,"rtk-participants-stage-queue",{"meeting":[16],"config":[16],"size":[513],"iconPack":[16],"view":[1],"t":[16],"stageRequestedParticipants":[32]},null,{"meeting":["meetingChanged"]}],[1,"rtk-participants-waiting-list",{"meeting":[16],"config":[16],"size":[513],"iconPack":[16],"view":[1],"t":[16],"waitlistedParticipants":[32]},null,{"meeting":["meetingChanged"]}],[1,"rtk-participants-stage-list",{"meeting":[16],"states":[16],"config":[16],"size":[513],"hideHeader":[4,"hide-header"],"iconPack":[16],"view":[1],"t":[16],"search":[1],"participants":[32]},null,{"meeting":["meetingChanged"],"search":["searchChanged"]}]]],["rtk-camera-selector_2",[[1,"rtk-participant-tile",{"nameTagPosition":[513,"name-tag-position"],"isPreview":[4,"is-preview"],"participant":[16],"meeting":[16],"states":[16],"config":[16],"variant":[513],"size":[513],"iconPack":[16],"t":[16],"isPinned":[32],"mediaConnectionError":[32]},null,{"meeting":["meetingChanged"],"participant":["participantsChanged"]}],[1,"rtk-camera-selector",{"meeting":[16],"size":[513],"iconPack":[16],"variant":[1],"t":[16],"videoDevices":[32],"currentDevice":[32],"canProduceVideo":[32]},null,{"meeting":["meetingChanged"]}]]],["rtk-audio-visualizer_4",[[1,"rtk-audio-visualizer",{"variant":[513],"participant":[16],"size":[513],"iconPack":[16],"t":[16],"hideMuted":[4,"hide-muted"],"isScreenShare":[4,"is-screen-share"],"audioEnabled":[32],"volume":[32]},null,{"participant":["participantChanged"]}],[1,"rtk-speaker-selector",{"meeting":[16],"states":[16],"variant":[1],"size":[513],"iconPack":[16],"t":[16],"speakerDevices":[32],"currentDevices":[32]},null,{"meeting":["meetingChanged"]}],[1,"rtk-microphone-selector",{"meeting":[16],"size":[513],"iconPack":[16],"variant":[1],"t":[16],"audioinputDevices":[32],"canProduceAudio":[32],"currentDevices":[32]},null,{"meeting":["meetingChanged"]}],[1,"rtk-switch",{"checked":[1028],"readonly":[4],"disabled":[516],"iconPack":[16],"t":[16]},null,{"checked":["checkedChange"]}]]],["rtk-controlbar-button",[[17,"rtk-controlbar-button",{"variant":[513],"showWarning":[4,"show-warning"],"size":[513],"label":[1],"icon":[1],"isLoading":[4,"is-loading"],"disabled":[516],"iconPack":[16],"brandIcon":[516,"brand-icon"]}]]]]'),e)},t.setNonce=t=>f.$nonce$=t,t}({});