@cloudflare/realtimekit-ui 1.0.2 → 1.0.3-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 +1 -0
- package/dist/cjs/{floating-ui.dom.esm-c3c35b98.js → floating-ui.dom.esm-90c5a220.js} +54 -30
- package/dist/cjs/rtk-avatar_54.cjs.entry.js +2 -2
- package/dist/cjs/rtk-livestream-indicator_3.cjs.entry.js +30892 -23958
- package/dist/cjs/rtk-participant_2.cjs.entry.js +1 -1
- package/dist/cjs/rtk-setup-screen.cjs.entry.js +4 -4
- package/dist/collection/components/rtk-audio-tile/rtk-audio-tile.js +1 -1
- package/dist/collection/components/rtk-audio-visualizer/rtk-audio-visualizer.js +1 -1
- package/dist/collection/components/rtk-avatar/rtk-avatar.js +1 -1
- package/dist/collection/components/rtk-breakout-room-toggle/rtk-breakout-rooms-toggle.js +1 -1
- package/dist/collection/components/rtk-breakout-rooms-manager/rtk-breakout-rooms-manager.js +1 -1
- package/dist/collection/components/rtk-channel-selector-view/rtk-channel-selector-view.js +2 -2
- package/dist/collection/components/rtk-file-picker-button/rtk-file-picker-button.js +1 -1
- package/dist/collection/components/rtk-name-tag/rtk-name-tag.js +1 -1
- package/dist/collection/components/rtk-network-indicator/rtk-network-indicator.js +1 -1
- package/dist/collection/components/rtk-notification/rtk-notification.css +6 -3
- package/dist/collection/components/rtk-participant/rtk-participant.js +1 -1
- package/dist/collection/components/rtk-participant-setup/rtk-participant-setup.js +1 -1
- package/dist/collection/components/rtk-participant-tile/rtk-participant-tile.js +2 -2
- package/dist/collection/components/rtk-plugin-main/rtk-plugin-main.js +1 -1
- package/dist/collection/components/rtk-poll/rtk-poll.js +1 -1
- package/dist/collection/components/rtk-screenshare-view/rtk-screenshare-view.js +1 -1
- package/dist/collection/components/rtk-setup-screen/rtk-setup-screen.js +4 -4
- package/dist/components/{p-5e5c9b53.js → p-01b76741.js} +1 -1
- package/dist/components/{p-c6a4041a.js → p-07c5a2da.js} +1 -1
- package/dist/components/{p-94e8d526.js → p-11048ea8.js} +1 -1
- package/dist/components/{p-778197ec.js → p-11b00854.js} +1 -1
- package/dist/components/{p-70053efe.js → p-1a6ad05c.js} +30892 -23958
- package/dist/components/{p-828a11f4.js → p-1c22a3a0.js} +3 -3
- package/dist/components/{p-519e8701.js → p-1f0c5462.js} +1 -1
- package/dist/components/{p-98d49c8e.js → p-22f2908e.js} +1 -1
- package/dist/components/{p-1174d3f4.js → p-2c41819d.js} +2 -2
- package/dist/components/{p-ff13d28d.js → p-2e9c3dd2.js} +1 -1
- package/dist/components/{p-abdd2a8a.js → p-4b89a5d6.js} +1 -1
- package/dist/components/{p-2cc196a8.js → p-6d3c8a73.js} +1 -1
- package/dist/components/{p-e2006e05.js → p-8faf31ba.js} +18 -18
- package/dist/components/{p-31964573.js → p-94cc1b33.js} +54 -30
- package/dist/components/{p-1633eae1.js → p-97ce630d.js} +2 -2
- package/dist/components/{p-1d7f3c99.js → p-98cc289f.js} +3 -3
- package/dist/components/{p-83a87193.js → p-9b675f4f.js} +1 -1
- package/dist/components/{p-8750e2de.js → p-a0000935.js} +2 -2
- package/dist/components/{p-9140d5c1.js → p-b29a58cd.js} +1 -1
- package/dist/components/{p-de2175ca.js → p-b2b2e917.js} +1 -1
- package/dist/components/{p-be584d57.js → p-be45dbd1.js} +2 -2
- package/dist/components/{p-af7aea98.js → p-c1f57f6b.js} +1 -1
- package/dist/components/{p-c173a513.js → p-cc6ff913.js} +1 -1
- package/dist/components/{p-278e6cc0.js → p-d5ce79e0.js} +1 -1
- package/dist/components/{p-c226934a.js → p-d8be719c.js} +4 -4
- package/dist/components/{p-25738f7b.js → p-db6f9f73.js} +1 -1
- package/dist/components/{p-fb31f34b.js → p-e83a6293.js} +1 -1
- package/dist/components/{p-a5d2ac22.js → p-eba76ab4.js} +4 -4
- package/dist/components/{p-1f6e5501.js → p-ed0df5b1.js} +1 -1
- package/dist/components/rtk-breakout-room-manager.js +1 -1
- package/dist/components/rtk-breakout-room-participants.js +1 -1
- package/dist/components/rtk-breakout-rooms-manager.js +1 -1
- package/dist/components/rtk-camera-toggle.js +1 -1
- package/dist/components/rtk-channel-header.js +1 -1
- package/dist/components/rtk-chat-composer-ui.js +1 -1
- package/dist/components/rtk-chat-composer-view.js +1 -1
- package/dist/components/rtk-chat-message.js +1 -1
- package/dist/components/rtk-chat-messages-ui-paginated.js +1 -1
- package/dist/components/rtk-chat-messages-ui.js +1 -1
- package/dist/components/rtk-chat-search-results.js +1 -1
- package/dist/components/rtk-chat.js +1 -1
- package/dist/components/rtk-dialog-manager.js +1 -1
- package/dist/components/rtk-draft-attachment-view.js +1 -1
- package/dist/components/rtk-emoji-picker-button.js +1 -1
- package/dist/components/rtk-file-picker-button.js +1 -1
- package/dist/components/rtk-grid-pagination.js +1 -1
- package/dist/components/rtk-grid.js +1 -1
- package/dist/components/rtk-livestream-player.js +1 -1
- package/dist/components/rtk-meeting-title.js +1 -1
- package/dist/components/rtk-meeting.js +19 -19
- package/dist/components/rtk-menu.js +1 -1
- package/dist/components/rtk-message-view.js +1 -1
- package/dist/components/rtk-mic-toggle.js +1 -1
- package/dist/components/rtk-mixed-grid.js +3 -3
- package/dist/components/rtk-mute-all-button.js +1 -1
- package/dist/components/rtk-notification.js +1 -1
- package/dist/components/rtk-notifications.js +1 -1
- package/dist/components/rtk-participant.js +1 -1
- package/dist/components/rtk-participants-stage-queue.js +1 -1
- package/dist/components/rtk-participants-viewer-list.js +1 -1
- package/dist/components/rtk-participants-waiting-list.js +1 -1
- package/dist/components/rtk-participants.js +5 -5
- package/dist/components/rtk-poll.js +1 -1
- package/dist/components/rtk-polls.js +1 -1
- package/dist/components/rtk-screen-share-toggle.js +1 -1
- package/dist/components/rtk-screenshare-view.js +1 -1
- package/dist/components/rtk-setup-screen.js +4 -4
- package/dist/components/rtk-sidebar.js +3 -3
- package/dist/components/rtk-spotlight-indicator.js +1 -1
- package/dist/components/rtk-stage-toggle.js +1 -1
- package/dist/components/rtk-tab-bar.js +1 -1
- package/dist/components/rtk-tooltip.js +1 -1
- package/dist/docs/docs-components.json +118 -118
- package/dist/docs/docs-vscode.json +12 -12
- package/dist/esm/{floating-ui.dom.esm-cf1488a2.js → floating-ui.dom.esm-a2dc8eef.js} +54 -30
- package/dist/esm/loader.js +63224 -4
- package/dist/esm/rtk-avatar_54.entry.js +2 -2
- package/dist/esm/rtk-livestream-indicator_3.entry.js +30892 -23958
- package/dist/esm/rtk-participant_2.entry.js +1 -1
- package/dist/esm/rtk-setup-screen.entry.js +4 -4
- package/dist/realtimekit-ui/{p-c39a8005.entry.js → p-14350b0d.entry.js} +1 -1
- package/dist/realtimekit-ui/p-1abb4841.entry.js +1 -0
- package/dist/realtimekit-ui/p-94cc1b33.js +1 -0
- package/dist/realtimekit-ui/{p-2db001cf.entry.js → p-dd9ea778.entry.js} +1 -1
- package/dist/realtimekit-ui/p-f4105345.entry.js +1 -0
- package/dist/realtimekit-ui/realtimekit-ui.esm.js +1 -1
- package/package.json +2 -3
- package/dist/realtimekit-ui/p-0b8b849b.entry.js +0 -1
- package/dist/realtimekit-ui/p-31964573.js +0 -1
- package/dist/realtimekit-ui/p-b60b229e.entry.js +0 -1
package/dist/browser.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var RtkUiKit=function(t){"use strict";const e="hydrated",i=!0,r=!0,s=!0;var a=Object.defineProperty,n=t=>{if(t.__stencil__getHostRef)return t.__stencil__getHostRef()},o=(t,e)=>{t.__stencil__getHostRef=()=>e,e.$lazyInstance$=t},l=(t,e)=>e in t,c=(t,e)=>(0,console.error)(t,e),d=new Map,h=new Map,p="slot-fb{display:contents}slot-fb[hidden]{display:none}",u="http://www.w3.org/1999/xlink",g="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=g.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$?E(S):f.raf(S))},x=t=>{for(let e=0;e<t.length;e++)try{t[e](performance.now())}catch(t){c(t)}t.length=0},S=()=>{x(k),x(y),(b=k.length>0)&&f.raf(S)},E=t=>{return Promise.resolve(e).then(t);var e},P=w(y),T=t=>"object"===(t=typeof t)||"function"===t;function L(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)a(t,i,{get:e[i],enumerable:!0})})({},{err:()=>_,map:()=>A,ok:()=>C,unwrap:()=>R,unwrapErr:()=>I});var C=t=>({isOk:!0,isErr:!1,value:t}),_=t=>({isOk:!1,isErr:!0,value:t});function A(t,e){if(t.isOk){const i=e(t.value);return i instanceof Promise?i.then(t=>C(t)):C(i)}if(t.isErr){const e=t.value;return _(e)}throw"should never get here"}var R=t=>{if(t.isOk)return t.value;throw t.value},I=t=>{if(t.isErr)return t.value;throw t.value},D=t=>{const e=F(t,"childNodes");t.tagName&&t.tagName.includes("-")&&t["s-cr"]&&"SLOT-FB"!==t.tagName&&M(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&&D(t)}};function M(t,e,i){let r,s=0,a=[];for(;s<t.length;s++)r=t[s],!r["s-sr"]||e&&r["s-hn"]!==e||void 0!==i||a.push(r),a=[...a,...M(r.childNodes,e,i)];return a}var O=(t,e,i=!0)=>{const r=[];(i&&t["s-sr"]||!t["s-sr"])&&r.push(t);let s=t;for(;s=s.nextSibling;)$(s)!==e||!i&&s["s-sr"]||r.push(s);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 N,j,z=(t,e,...i)=>{let r=null,s=null,a=null,n=!1,o=!1;const l=[],c=e=>{for(let i=0;i<e.length;i++)r=e[i],Array.isArray(r)?c(r):null!=r&&"boolean"!=typeof r&&((n="function"!=typeof t&&!T(r))&&(r=String(r)),n&&o?l[l.length-1].$text$+=r:l.push(n?B(null,r):r),o=n)};if(c(i),e){e.key&&(s=e.key),e.name&&(a=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,l,H);const d=B(t,null);return d.$attrs$=e,l.length>0&&(d.$children$=l),d.$key$=s,d.$name$=a,d},B=(t,e)=>{const i={$flags$:0,$tag$:t,$text$:e,$elm$:null,$children$:null,$attrs$:null,$key$:null,$name$:null};return i},G={},H={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),z(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||T(t)?t:4&e?"false"!==t&&(""===t||!!t):2&e?parseFloat(t):1&e?String(t):t,Y=t=>n(t).$hostElement$,W=(t,e,i)=>{const r=Y(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,X=t=>{const e=t.$cmpMeta$,i=t.$hostElement$,r=e.$flags$,s=(e.$tagName$,()=>{}),a=((t,e)=>{var i;const r=J(e),s=h.get(r);if(!g.document)return r;if(t=11===t.nodeType?t:g.document,s)if("string"==typeof s){t=t.head||t;let a,n=Q.get(t);if(n||Q.set(t,n=new Set),!n.has(r)){{a=document.querySelector(`[sty-id="${r}"]`)||g.document.createElement("style"),a.innerHTML=s;const n=null!=(i=f.$nonce$)?i:L(g.document);if(null!=n&&a.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(a,(null==i?void 0:i.parentNode)===t?i:null)}else if("host"in t)if(v){const e=new CSSStyleSheet;e.replaceSync(s),t.adoptedStyleSheets=[e,...t.adoptedStyleSheets]}else{const e=t.querySelector("style");e?e.innerHTML=s+e.innerHTML:t.prepend(a)}else t.append(a);1&e.$flags$&&t.insertBefore(a,null)}4&e.$flags$&&(a.innerHTML+=p),n&&n.add(r)}}else t.adoptedStyleSheets.includes(s)||(t.adoptedStyleSheets=[...t.adoptedStyleSheets,s]);return r})(i.shadowRoot?i.shadowRoot:i.getRootNode(),e);(10&r&&2&r||128&r)&&(i["s-sc"]=a,i.classList.add(a+"-h")),s()},J=(t,e)=>"sc-"+t.$tagName$,tt=(t,e,i,r,s,a,n)=>{if(i===r)return;let o=l(t,e),c=e.toLowerCase();if("class"===e){const e=t.classList,s=it(i);let a=it(r);e.remove(...s.filter(t=>t&&!a.includes(t))),e.add(...a.filter(t=>t&&!s.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=T(r);if((o||n&&null!==r)&&!s)try{if(t.tagName.includes("-"))t[e]!==r&&(t[e]=r);else{const s=null==r?"":r;"list"===e?o=!1:null!=i&&t[e]==s||("function"==typeof t.__lookupSetter__(e)?t[e]=s:t.setAttribute(e,s))}}catch(t){}let l=!1;c!==(c=c.replace(/^xlink\:?/,""))&&(e=c,l=!0),null==r||!1===r?!1===r&&""!==t.getAttribute(e)||(l?t.removeAttributeNS(u,e):t.removeAttribute(e)):(!o||4&a||s)&&!n&&1===t.nodeType&&(r=!0===r?"":r,l?t.setAttributeNS(u,e,r):t.setAttribute(e,r))}else if(e="-"===e[2]?e.slice(3):l(g,c)?c.slice(2):c[2]+e.slice(3),i||r){const s=e.endsWith(rt);e=e.replace(st,""),i&&f.rel(t,e,i,s),r&&f.ael(t,e,r,s)}},et=/\s/,it=t=>("object"==typeof t&&t&&"baseVal"in t&&(t=t.baseVal),t&&"string"==typeof t?t.split(et):[]),rt="Capture",st=new RegExp(rt+"$"),at=(t,e,i,r)=>{const s=11===e.$elm$.nodeType&&e.$elm$.host?e.$elm$.host:e.$elm$,a=t&&t.$attrs$||{},n=e.$attrs$||{};for(const t of nt(Object.keys(a)))t in n||tt(s,t,a[t],void 0,i,e.$flags$);for(const t of nt(Object.keys(n)))tt(s,t,a[t],n[t],i,e.$flags$)};function nt(t){return t.includes("ref")?[...t.filter(t=>"ref"!==t),"ref"]:t}var ot=!1,lt=!1,ct=!1,dt=!1,ht=(t,e,i)=>{var s;const a=e.$children$[i];let n,o,l,c=0;if(ot||(ct=!0,"slot"===a.$tag$&&(a.$flags$|=a.$children$?2:1)),null!==a.$text$)n=a.$elm$=g.document.createTextNode(a.$text$);else if(1&a.$flags$)n=a.$elm$=g.document.createTextNode(""),at(null,a,dt);else{if(!g.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=a.$elm$=g.document.createElement(!ot&&r&&2&a.$flags$?"slot-fb":a.$tag$),at(null,a,dt),a.$children$)for(c=0;c<a.$children$.length;++c)o=ht(t,a,c),o&&n.appendChild(o)}return n["s-hn"]=j,3&a.$flags$&&(n["s-sr"]=!0,n["s-cr"]=N,n["s-sn"]=a.$name$||"",n["s-rf"]=null==(s=a.$attrs$)?void 0:s.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 s=this["s-cr"].parentElement;return(s.__childNodes?s.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})(s.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),l=t&&t.$children$&&t.$children$[i],l&&l.$tag$===a.$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"]!==j&&r["s-ol"]&&(wt(mt(r).parentNode,r,mt(r)),r["s-ol"].remove(),r["s-ol"]=void 0,r["s-sh"]=void 0,ct=!0),e&&pt(r,e)}f.$flags$&=-2},ut=(t,e,i,r,s,a)=>{let n,o=t["s-cr"]&&t["s-cr"].parentNode||t;for(o.shadowRoot&&o.tagName===j&&(o=o.shadowRoot);s<=a;++s)r[s]&&(n=ht(null,i,s),n&&(r[s].$elm$=n,wt(o,n,mt(e))))},gt=(t,e,i)=>{for(let r=e;r<=i;++r){const e=t[r];if(e){const t=e.$elm$;yt(e),t&&(lt=!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$,a=t.$children$,n=e.$children$,o=e.$text$;let l;null===o?(at(t,e,dt),null!==a&&null!==n?((t,e,i,r,s=!1)=>{let a,n,o=0,l=0,c=0,d=0,h=e.length-1,p=e[0],u=e[h],g=r.length-1,f=r[0],m=r[g];for(;o<=h&&l<=g;)if(null==p)p=e[++o];else if(null==u)u=e[--h];else if(null==f)f=r[++l];else if(null==m)m=r[--g];else if(ft(p,f,s))vt(p,f,s),p=e[++o],f=r[++l];else if(ft(u,m,s))vt(u,m,s),u=e[--h],m=r[--g];else if(ft(p,m,s))"slot"!==p.$tag$&&"slot"!==m.$tag$||pt(p.$elm$.parentNode,!1),vt(p,m,s),wt(t,p.$elm$,u.$elm$.nextSibling),p=e[++o],m=r[--g];else if(ft(u,f,s))"slot"!==p.$tag$&&"slot"!==m.$tag$||pt(u.$elm$.parentNode,!1),vt(u,f,s),wt(t,u.$elm$,p.$elm$),u=e[--h],f=r[++l];else{for(c=-1,d=o;d<=h;++d)if(e[d]&&null!==e[d].$key$&&e[d].$key$===f.$key$){c=d;break}c>=0?(n=e[c],n.$tag$!==f.$tag$?a=ht(e&&e[l],i,c):(vt(n,f,s),e[c]=void 0,a=n.$elm$),f=r[++l]):(a=ht(e&&e[l],i,l),f=r[++l]),a&&wt(mt(p.$elm$).parentNode,a,mt(p.$elm$))}o>h?ut(t,null==r[g+1]?null:r[g+1].$elm$,i,r,l,g):l>g&>(e,o,h)})(r,a,e,n,i):null!==n?(null!==t.$text$&&(r.textContent=""),ut(r,null,e,n,0,n.length-1)):!i&&s&&null!==a&>(a,0,a.length-1)):(l=r["s-cr"])?l.parentNode.textContent=o:t.$text$!==o&&(r.data=o)},bt=[],kt=t=>{let e,i,r;const s=t.__childNodes||t.childNodes;for(const t of s){if(t["s-sr"]&&(e=t["s-cr"])&&e.parentNode){i=e.parentNode.__childNodes||e.parentNode.childNodes;const s=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,s)){let i=bt.find(t=>t.$nodeToRelocate$===e);lt=!0,e["s-sn"]=e["s-sn"]||s,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,s,a,n;const o=t.$hostElement$,l=t.$cmpMeta$,c=t.$vnode$||B(null,null),d=(h=e)&&h.$tag$===G?e:z(null,null,e);var h;if(j=o.tagName,l.$attrsToReflect$&&(d.$attrs$=d.$attrs$||{},l.$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$=c.$elm$=o.shadowRoot||o,ot=!(!(1&l.$flags$)||128&l.$flags$),N=o["s-cr"],lt=!1,vt(c,d,i),f.$flags$|=1,ct){kt(d.$elm$);for(const t of bt){const e=t.$nodeToRelocate$;if(!e["s-ol"]&&g.document){const t=g.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 a=null==(r=e["s-ol"])?void 0:r.previousSibling;for(;a;){let r=null!=(s=a["s-nr"])?s: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}}a=a.previousSibling}}const n=e.__parentNode||e.parentNode,l=e.__nextSibling||e.nextSibling;(!i&&t!==n||l!==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!=(a=e["s-ih"])&&a)),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)}}lt&&D(d.$elm$),f.$flags$&=-2,bt.length=0,N=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()}))}},Et=(t,e)=>{if(t.$flags$|=16,4&t.$flags$)return void(t.$flags$|=512);St(t,t.$ancestorComponent$);return P(()=>Pt(t,e))},Pt=(t,e)=>{const i=t.$hostElement$,r=(t.$cmpMeta$.$tagName$,()=>{}),s=t.$lazyInstance$;if(!s)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 a;return e?(t.$flags$|=256,t.$queuedListeners$&&(t.$queuedListeners$.map(([t,e])=>Ot(s,t,e,i)),t.$queuedListeners$=void 0),a=Ot(s,"componentWillLoad",void 0,i)):a=Ot(s,"componentWillUpdate",void 0,i),a=Tt(a,()=>Ot(s,"componentWillRender",void 0,i)),r(),Tt(a,()=>Ct(t,s,e))},Tt=(t,e)=>Lt(t)?t.then(e).catch(t=>{console.error(t),e()}):e(),Lt=t=>t instanceof Promise||t&&t.then&&"function"==typeof t.then,Ct=async(t,e,i)=>{var r;const s=t.$hostElement$,a=(t.$cmpMeta$.$tagName$,()=>{}),n=s["s-rc"];i&&X(t);const o=(t.$cmpMeta$.$tagName$,()=>{});At(t,e,s,i),n&&(n.map(t=>t()),s["s-rc"]=void 0),o(),a();{const e=null!=(r=s["s-p"])?r:[],i=()=>It(t);0===e.length?i():(Promise.all(e).then(i),t.$flags$|=4,e.length=0)}},_t=null,At=(t,e,i,r)=>{try{_t=e,e=e.render(),t.$flags$&=-17,t.$flags$|=2,xt(t,e,r)}catch(e){c(e,t.$hostElement$)}return _t=null,null},Rt=()=>_t,It=t=>{t.$cmpMeta$.$tagName$;const e=t.$hostElement$,i=()=>{},r=t.$lazyInstance$,s=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),s||Mt()),t.$onInstanceResolve$(e),t.$onRenderResolve$&&(t.$onRenderResolve$(),t.$onRenderResolve$=void 0),512&t.$flags$&&E(()=>Et(t,!1)),t.$flags$&=-517},Dt=t=>{{const e=n(t),i=e.$hostElement$.isConnected;return i&&2==(18&e.$flags$)&&Et(e,!1),i}},Mt=t=>{E(()=>Z(g,"appload",{detail:{namespace:"realtimekit-ui"}}))},Ot=(t,e,i,r)=>{if(t&&t[e])try{return t[e](i)}catch(t){c(t,r)}},Ut=t=>{var i;return t.classList.add(null!=(i=e)?i:"hydrated")},$t=(t,e,i,r)=>{const s=n(t);if(!s)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 a=s.$hostElement$,o=s.$instanceValues$.get(e),l=s.$flags$,d=s.$lazyInstance$;i=K(i,r.$members$[e][0]);const h=Number.isNaN(o)&&Number.isNaN(i);if((!(8&l)||void 0===o)&&(i!==o&&!h)&&(s.$instanceValues$.set(e,i),d)){if(r.$watchers$&&128&l){const t=r.$watchers$[e];t&&t.map(t=>{try{d[t](i,o,e)}catch(t){c(t,a)}})}if(2==(18&l)){if(d.componentShouldUpdate&&!1===d.componentShouldUpdate(i,o,e))return;Et(s,!1)}}},Ft=(t,e,r)=>{var s,a;const o=t.prototype;if(e.$members$||e.$watchers$||t.watchers){t.watchers&&!e.$watchers$&&(e.$watchers$=t.watchers);const l=Object.entries(null!=(s=e.$members$)?s:{});if(l.map(([t,[i]])=>{if(31&i||2&r&&32&i){const{get:s,set:a}=Object.getOwnPropertyDescriptor(o,t)||{};s&&(e.$members$[t][0]|=2048),a&&(e.$members$[t][0]|=4096),(1&r||!s)&&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(s){const o=n(this);if(a){const r=32&i?this[t]:o.$hostElement$[t];return void 0===r&&o.$instanceValues$.get(t)?s=o.$instanceValues$.get(t):!o.$instanceValues$.get(t)&&r&&o.$instanceValues$.set(t,r),a.apply(this,[K(s,i)]),s=32&i?this[t]:o.$hostElement$[t],void $t(this,t,s,e)}{if(!(1&r&&4096&e.$members$[t][0]))return $t(this,t,s,e),void(1&r&&!o.$lazyInstance$&&o.$onReadyPromise$.then(()=>{4096&e.$members$[t][0]&&o.$lazyInstance$[t]!==o.$instanceValues$.get(t)&&(o.$lazyInstance$[t]=s)}));const a=()=>{const r=o.$lazyInstance$[t];!o.$instanceValues$.get(t)&&r&&o.$instanceValues$.set(t,r),o.$lazyInstance$[t]=K(s,i),$t(this,t,o.$lazyInstance$[t],e)};o.$lazyInstance$?a():o.$onReadyPromise$.then(()=>a())}}})}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,s,a){f.jmp(()=>{var l;const c=r.get(t);if(this.hasOwnProperty(c)&&i)a=this[c],delete this[c];else{if(o.hasOwnProperty(c)&&"number"==typeof this[c]&&this[c]==a)return;if(null==c){const i=n(this),r=null==i?void 0:i.$flags$;if(r&&!(8&r)&&128&r&&a!==s){const r=i.$lazyInstance$,n=null==(l=e.$watchers$)?void 0:l[t];null==n||n.forEach(e=>{null!=r[e]&&r[e].call(r,a,s,t)})}return}}const d=Object.getOwnPropertyDescriptor(o,c);(a=(null!==a||"boolean"!=typeof this[c])&&a)===this[c]||d.get&&!d.set||(this[c]=a)})},t.observedAttributes=Array.from(new Set([...Object.keys(null!=(a=e.$watchers$)?a:{}),...l.filter(([t,e])=>15&e[0]).map(([t,i])=>{var s;const a=i[1]||t;return r.set(a,t),512&i[0]&&(null==(s=e.$attrsToReflect$)||s.push([t,a])),a})]))}}return t},Nt=async(t,e,i,r)=>{let s;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 s=d.get(r);if(s)return s[i];{const t=t=>(d.set(r,t),t[i]);switch(r){case"rtk-avatar_54":return Promise.resolve().then(function(){return xc}).then(t,c);case"rtk-ai":return Promise.resolve().then(function(){return Pc}).then(t,c);case"rtk-ai-toggle":return Promise.resolve().then(function(){return Cc}).then(t,c);case"rtk-audio-grid":return Promise.resolve().then(function(){return Rc}).then(t,c);case"rtk-audio-tile":return Promise.resolve().then(function(){return jc}).then(t,c);case"rtk-breakout-rooms-toggle":return Promise.resolve().then(function(){return Gc}).then(t,c);case"rtk-camera-toggle":return Promise.resolve().then(function(){return qc}).then(t,c);case"rtk-caption-toggle":return Promise.resolve().then(function(){return Wc}).then(t,c);case"rtk-channel-selector-ui":return Promise.resolve().then(function(){return Xc}).then(t,c);case"rtk-chat-composer-ui":return Promise.resolve().then(function(){return id}).then(t,c);case"rtk-chat-selector-ui":return Promise.resolve().then(function(){return ad}).then(t,c);case"rtk-chat-toggle":return Promise.resolve().then(function(){return pd}).then(t,c);case"rtk-clock":return Promise.resolve().then(function(){return md}).then(t,c);case"rtk-controlbar":return Promise.resolve().then(function(){return kd}).then(t,c);case"rtk-debugger-toggle":return Promise.resolve().then(function(){return xd}).then(t,c);case"rtk-ended-screen":return Promise.resolve().then(function(){return Pd}).then(t,c);case"rtk-file-dropzone":return Promise.resolve().then(function(){return Cd}).then(t,c);case"rtk-grid":return Promise.resolve().then(function(){return kh}).then(t,c);case"rtk-grid-pagination":return Promise.resolve().then(function(){return xh}).then(t,c);case"rtk-header":return Promise.resolve().then(function(){return Ph}).then(t,c);case"rtk-idle-screen":return Promise.resolve().then(function(){return Ch}).then(t,c);case"rtk-image-viewer":return Promise.resolve().then(function(){return Rh}).then(t,c);case"rtk-information-tooltip":return Promise.resolve().then(function(){return Dh}).then(t,c);case"rtk-leave-button":return Promise.resolve().then(function(){return Uh}).then(t,c);case"rtk-livestream-toggle":return Promise.resolve().then(function(){return Nh}).then(t,c);case"rtk-meeting-title":return Promise.resolve().then(function(){return Bh}).then(t,c);case"rtk-message-list-view":return Promise.resolve().then(function(){return Hh}).then(t,c);case"rtk-mic-toggle":return Promise.resolve().then(function(){return Kh}).then(t,c);case"rtk-mixed-grid":return Promise.resolve().then(function(){return Zh}).then(t,c);case"rtk-more-toggle":return Promise.resolve().then(function(){return Jh}).then(t,c);case"rtk-mute-all-button":return Promise.resolve().then(function(){return ip}).then(t,c);case"rtk-network-indicator":return Promise.resolve().then(function(){return ap}).then(t,c);case"rtk-participant-count":return Promise.resolve().then(function(){return lp}).then(t,c);case"rtk-participant-setup":return Promise.resolve().then(function(){return hp}).then(t,c);case"rtk-participants":return Promise.resolve().then(function(){return gp}).then(t,c);case"rtk-participants-audio":return Promise.resolve().then(function(){return bp}).then(t,c);case"rtk-participants-toggle":return Promise.resolve().then(function(){return wp}).then(t,c);case"rtk-pip-toggle":return Promise.resolve().then(function(){return Ep}).then(t,c);case"rtk-plugins-toggle":return Promise.resolve().then(function(){return Lp}).then(t,c);case"rtk-polls-toggle":return Promise.resolve().then(function(){return Ap}).then(t,c);case"rtk-recording-indicator":return Promise.resolve().then(function(){return Dp}).then(t,c);case"rtk-recording-toggle":return Promise.resolve().then(function(){return Up}).then(t,c);case"rtk-screen-share-toggle":return Promise.resolve().then(function(){return jp}).then(t,c);case"rtk-screenshare-view":return Promise.resolve().then(function(){return Kp}).then(t,c);case"rtk-settings":return Promise.resolve().then(function(){return Zp}).then(t,c);case"rtk-settings-toggle":return Promise.resolve().then(function(){return Jp}).then(t,c);case"rtk-setup-screen":return Promise.resolve().then(function(){return iu}).then(t,c);case"rtk-sidebar":return Promise.resolve().then(function(){return au}).then(t,c);case"rtk-simple-grid":return Promise.resolve().then(function(){return lu}).then(t,c);case"rtk-spotlight-grid":return Promise.resolve().then(function(){return hu}).then(t,c);case"rtk-stage":return Promise.resolve().then(function(){return gu}).then(t,c);case"rtk-stage-toggle":return Promise.resolve().then(function(){return vu}).then(t,c);case"rtk-transcripts":return Promise.resolve().then(function(){return ag}).then(t,c);case"rtk-ui-provider":return Promise.resolve().then(function(){return og}).then(t,c);case"rtk-waiting-screen":return Promise.resolve().then(function(){return dg}).then(t,c);case"rtk-ai-transcriptions":return Promise.resolve().then(function(){return ug}).then(t,c);case"rtk-livestream-indicator_3":return Promise.resolve().then(function(){return Jx}).then(t,c);case"rtk-name-tag":return Promise.resolve().then(function(){return iS}).then(t,c);case"rtk-participants-stage-list_4":return Promise.resolve().then(function(){return hS}).then(t,c);case"rtk-plugin-main_2":return Promise.resolve().then(function(){return mS}).then(t,c);case"rtk-plugins_2":return Promise.resolve().then(function(){return wS}).then(t,c);case"rtk-settings-audio_2":return Promise.resolve().then(function(){return TS}).then(t,c);case"rtk-transcript":return Promise.resolve().then(function(){return CS}).then(t,c);case"rtk-audio-visualizer_4":return Promise.resolve().then(function(){return FS}).then(t,c);case"rtk-fullscreen-toggle":return Promise.resolve().then(function(){return zS}).then(t,c);case"rtk-participant_2":return Promise.resolve().then(function(){return VS}).then(t,c);case"rtk-camera-selector_2":return Promise.resolve().then(function(){return ZS}).then(t,c);case"rtk-poll_2":return Promise.resolve().then(function(){return eE}).then(t,c);case"rtk-sidebar-ui":return Promise.resolve().then(function(){return rE}).then(t,c);case"rtk-spotlight-indicator":return Promise.resolve().then(function(){return nE}).then(t,c);case"rtk-controlbar-button":return Promise.resolve().then(function(){return cE}).then(t,c)}}return import(`./${r}.entry.js`).then(t=>(d.set(r,t),t[i]),t=>{c(t,e.$hostElement$)})})(i,e);if(r&&"then"in r){const t=()=>{};s=await r,t()}else s=r;if(!s)throw new Error(`Constructor for "${i.$tagName$}#${e.$modeName$}" was not found`);s.isProxied||(i.$watchers$=s.watchers,Ft(s,i,2),s.isProxied=!0);const a=(i.$tagName$,()=>{});e.$flags$|=8;try{new s(e)}catch(e){c(e,t)}e.$flags$&=-9,e.$flags$|=128,a(),jt(e.$lazyInstance$,t)}else{s=t.constructor;const i=t.localName;customElements.whenDefined(i).then(()=>e.$flags$|=128)}if(s&&s.style){let t;"string"==typeof s.style&&(t=s.style);const e=J(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 a=e.$ancestorComponent$,n=()=>Et(e,!0);a&&a["s-rc"]?a["s-rc"].push(n):n()},jt=(t,e)=>{Ot(t,"connectedCallback",void 0,e)},zt=t=>{if(!g.document)return;const e=t["s-cr"]=g.document.createComment("");e["s-cn"]=!0,wt(t,e,t.firstChild)},Bt=(t,e)=>{Ot(t,"disconnectedCallback",void 0,e||t)},Gt=(t,e={})=>{var i;if(!g.document)return void console.warn("Stencil: No document found. Skipping bootstrapping lazy components.");const r=()=>{},s=[],a=e.exclude||[],o=g.customElements,l=g.document.head,c=l.querySelector("meta[charset]"),d=g.document.createElement("style"),h=[];let u,m=!0;Object.assign(f,e),f.$resourcesUrl$=new URL(e.resourcesUrl||"./",g.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 l=r.$tagName$,c=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$)),u&&(clearTimeout(u),u=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$)?jt(e.$lazyInstance$,t):(null==e?void 0:e.$onReadyPromise$)&&e.$onReadyPromise$.then(()=>jt(e.$lazyInstance$,t));else{e.$flags$|=1,12&i.$flags$&&zt(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}}),Nt(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],a.includes(l)||o.get(l)||(s.push(l),o.define(l,Ft(c,r,1)))})}),s.length>0&&(v&&(d.textContent+=p),d.textContent+=s.sort()+"{visibility:hidden}.hydrated{visibility:inherit}",d.innerHTML.length)){d.setAttribute("data-styles","");const t=null!=(i=f.$nonce$)?i:L(g.document);null!=t&&d.setAttribute("nonce",t),l.insertBefore(d,c?c.nextSibling:l.firstChild)}m=!1,h.length?h.map(t=>t.connectedCallback()):f.jmp(()=>u=setTimeout(Mt,30)),r()},Ht=(t,e)=>e,Vt=(t,e,i,r)=>{i&&g.document&&i.map(([i,r,s])=>{const a=Kt(g.document,t,i),n=qt(e,s),o=Yt(i);f.ael(a,r,n,o),(e.$rmListeners$=e.$rmListeners$||[]).push(()=>f.rel(a,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){c(e,t.$hostElement$)}},Kt=(t,e,i)=>8&i?g:e,Yt=t=>m?{passive:!!(1&t),capture:!!(2&t)}:!!(2&t);const Wt=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 Xt,Jt;!function(t){t.BUFFERING="Buffering",t.ENDED="Ended",t.IDLE="Idle",t.PAUSED="Paused",t.PLAYING="Playing",t.READY="Ready"}(Xt||(Xt={})),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"}(Jt||(Jt={}));const te="play_participant_tile_video_on_pause",ee="disable_emoji_picker",ie="disable_kicking",re="admin_cantremove_admin",se="cantinvite_viewer",ae="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 le=0;const ce="temp-";function de(t){return t.includes(ce)}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 ue=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 ge,fe,me,ve,be,ke,ye,we,xe,Se,Ee,Pe,Te,Le,Ce,_e=function(t,e,i,r,s){if("m"===r)throw new TypeError("Private method is not writable");if("a"===r&&!s)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!s:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===r?s.call(t,i):s?s.value=i:e.set(t,i),i},Ae=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 Re{constructor(){ge.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 Ae(this,fe,"f")}get currentState(){let t,e=[];return Array.from(Ae(this,ke,"f").keys()).forEach(i=>{const r=Ae(this,we,"f").get(i);r.isParent?t=Object.assign(Object.assign({},r),{participants:Ae(this,ge,"m",Ce).call(this,i)}):e.push(Object.assign(Object.assign({},r),{participants:Ae(this,ge,"m",Ce).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(Ae(this,ye,"f").values())}get unassignedParticipants(){return Ae(this,ge,"m",Ce).call(this,Ae(this,me,"f").parentMeeting.id)}getParticipantsForMeeting(t){return Ae(this,ge,"m",Ce).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 s=0;for(r=Object.getOwnPropertySymbols(t);s<r.length;s++)e.indexOf(r[s])<0&&Object.prototype.propertyIsEnumerable.call(t,r[s])&&(i[r[s]]=t[r[s]])}return i}({id:`${ce}${Math.random().toString(36)}`,title:"Room "+ ++le,participants:[]},["participants"]);return Ae(this,ge,"m",Pe).call(this,Object.assign(Object.assign({},t),{isParent:!1})),t}addNewMeetings(t){return Array.from({length:t}).map(()=>this.addNewMeeting())}updateMeetingTitle(t,e){Ae(this,we,"f").get(t).title=e,de(t)||Ae(this,xe,"f").add(t)}deleteMeeting(t){_e(this,fe,!0,"f");const e=Ae(this,we,"f").get(t),i=Ae(this,ge,"m",Ce).call(this,e.id).map(he);this.assignParticipantsToMeeting(i,Ae(this,me,"f").parentMeeting.id),Ae(this,we,"f").delete(e.id),Ae(this,ke,"f").delete(e.id),de(e.id)||Ae(this,Se,"f").add(e.id)}assignParticipantsToMeeting(t,e){return _e(this,fe,!0,"f"),t.forEach(t=>{const i=Ae(this,ve,"f").get(t);Ae(this,ke,"f").get(i).delete(t),Ae(this,ke,"f").get(e).add(t),Ae(this,ve,"f").set(t,e)}),this.currentState}assignParticipantsRandomly(){const t=function(t,e){const i=t.length,r=Math.ceil(i/e),s=new Array(e);let a=0;for(let i=0;i<e;i++)s[i]=t.slice(a,a+r),a+=r;return s.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=Ae(this,me,"f").parentMeeting.id;return this.assignParticipantsToMeeting(t,e)}unassignAllParticipants(){const t=Ae(this,me,"f").parentMeeting.id,e=this.allParticipants.map(he);return this.assignParticipantsToMeeting(e,t)}updateCurrentState(t){Ae(this,fe,"f")||Ae(this,ge,"m",Ee).call(this,t),[t.parentMeeting,...t.meetings].forEach((t,e)=>{const i=Object.assign(Object.assign({},t),{isParent:0===e});Ae(this,ge,"m",Pe).call(this,i),t.participants.forEach(t=>{Ae(this,ge,"m",Te).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=>Ae(this,xe,"f").has(t.id)).map(({id:t,title:e})=>({id:t,title:e}))}get meetingsToDelete(){return Array.from(Ae(this,Se,"f"))}get participantsToMove(){const t=new Map;return Array.from(Ae(this,ve,"f").keys()).forEach(e=>{const i=Ae(this,be,"f").get(e),r=Ae(this,ve,"f").get(e);if(i===r)return;const s=`${i}__${r}`;t.has(s)||t.set(s,[]);const a=Ae(this,ye,"f").get(e);t.get(s).push(a.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&&Ae(this,ge,"m",Le).call(this,Ae(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(Ae(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,ge=new WeakSet,Ee=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"),Ae(this,me,"f").parentMeeting.participants.forEach(t=>{Ae(this,be,"f").set(he(t),Ae(this,me,"f").parentMeeting.id)}),Ae(this,me,"f").meetings.forEach(t=>{t.participants.forEach(e=>{Ae(this,be,"f").set(he(e),t.id)})})},Pe=function(t){Ae(this,we,"f").has(t.id)||(Ae(this,we,"f").set(t.id,t),Ae(this,ke,"f").set(t.id,new Set))},Te=function(t,e){Ae(this,ye,"f").has(he(t))||(Ae(this,ye,"f").set(he(t),t),Ae(this,ve,"f").set(he(t),e.id),Ae(this,ke,"f").get(e.id).add(he(t)))},Le=function(t,e){const i=t.id;Ae(this,ge,"m",Pe).call(this,Object.assign(Object.assign({},t),{id:e})),Ae(this,we,"f").delete(i);const r=Ae(this,ke,"f").get(i);Ae(this,ke,"f").set(e,r),Ae(this,ke,"f").delete(i),Array.from(Ae(this,ve,"f").keys()).forEach(t=>{Ae(this,ve,"f").get(t)===i&&Ae(this,ve,"f").set(t,e)})},Ce=function(t){return Array.from(Ae(this,ke,"f").get(t)).map(t=>Ae(this,ye,"f").get(t))};const Ie={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"}},De=t=>!("isConnected"in t)||t.isConnected,Me=((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(De))},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}},Ne={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>'},je={get:(t,e,i)=>(...r)=>{try{return Reflect.get(t,e,i).apply(t,r)}catch(t){return null}}};let ze;try{ze=new Proxy(localStorage,je)}catch(t){ze=new Proxy({},je)}const Be=ze,Ge="rtk-prefs",He=(t,e)=>{const i=JSON.parse(Be.getItem(Ge)||"{}");i[t]=JSON.stringify(e),Be.setItem("rtk-prefs",JSON.stringify(i))},Ve=t=>JSON.parse(Be.getItem(Ge)||"{}")[t],qe=()=>{const t=JSON.parse(Be.getItem(Ge)||"{}");return{mirrorVideo:!t["mirror-video"]||"true"===t["mirror-video"],muteNotificationSounds:!!t["mute-notification-sounds"]&&"true"===t["mute-notification-sounds"]}},Ke={},Ye=((t,e)=>{const i=((t,e=(t,e)=>t!==e)=>{const i=Oe(t);let r=new Map(Object.entries(i??{}));const s={dispose:[],get:[],set:[],reset:[]},a=()=>{r=new Map(Object.entries(Oe(t)??{})),s.reset.forEach(t=>t())},n=t=>(s.get.forEach(e=>e(t)),r.get(t)),o=(t,i)=>{const a=r.get(t);e(i,a,t)&&(r.set(t,i),s.set.forEach(e=>e(t,i,a)))},l="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)}),c=(t,e)=>(s[t].push(e),()=>{Ue(s[t],e)});return{state:l,get:n,set:o,on:c,onChange:(e,i)=>{const r=c("set",(t,r)=>{t===e&&i(r)}),s=c("reset",()=>i(Oe(t)[e]));return()=>{r(),s()}},use:(...t)=>{const e=t.reduce((t,e)=>(e.set&&t.push(c("set",e.set)),e.get&&t.push(c("get",e.get)),e.reset&&t.push(c("reset",e.reset)),e.dispose&&t.push(c("dispose",e.dispose)),t),[]);return()=>e.forEach(t=>t())},dispose:()=>{s.dispose.forEach(t=>t()),a()},reset:a,forceUpdate:t=>{const e=r.get(t);s.set.forEach(i=>i(t,e,e))}}})(t,e);return i.use((()=>{const t=new Map;return{dispose:()=>t.clear(),get:e=>{const i=Rt();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(Dt)),Me(t)},reset:()=>{t.forEach(t=>t.forEach(Dt)),Me(t)}}})()),i})({meeting:void 0,t:Fe(),iconPack:Ne,states:{meeting:"idle",prefs:qe()},config:Ie,size:void 0}),We=new Map;Ye.use({set:(t,e,i)=>{const r=We.get(t);r&&We.set(t,r.filter(r=>r[t]===i&&(r[t]=e,!0)))}});const Ze=Ye.state,Qe=(t,e=20)=>null==t?"":t.length>e?`${t.substring(0,e)}...`:t,Xe=t=>/^\p{Emoji}+$/u.test(t)&&!/^\d+$/.test(t),Je=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 si(){return function(t,e){const{connectedCallback:i,disconnectedCallback:r}=t;t.connectedCallback=function(){const t=Y(this);if(!t[e]){const i=Ye.state[e];t[e]=i,function(t,e){const i=We.get(t);i?i.push(e):We.set(t,[e])}(e,t)}return null==i?void 0:i.call(this)},t.disconnectedCallback=function(){return function(t,e){const i=We.get(t);if(i&&i.length>0){const r=i.indexOf(e);-1!==r&&(i.splice(r,1),We.set(t,i))}}(e,Y(this)),null==r?void 0:r.call(this)}}}const ai="object"==typeof global&&global&&global.Object===Object&&global;var ni="object"==typeof self&&self&&self.Object===Object&&self;const oi=ai||ni||Function("return this")();const li=oi.Symbol;var ci=Object.prototype,di=ci.hasOwnProperty,hi=ci.toString,pi=li?li.toStringTag:void 0;var ui=Object.prototype.toString;var gi=li?li.toStringTag:void 0;function fi(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":gi&&gi 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 s=hi.call(t);return r&&(e?t[pi]=i:delete t[pi]),s}(t):function(t){return ui.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,Ei=parseInt;function Pi(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)?Ei(t.slice(2),i?2:8):wi.test(t)?NaN:+t}const Ti=function(){return oi.Date.now()};var Li=Math.max,Ci=Math.min;function _i(t,e,i){var r,s,a,n,o,l,c=0,d=!1,h=!1,p=!0;if("function"!=typeof t)throw new TypeError("Expected a function");function u(e){var i=r,a=s;return r=s=void 0,c=e,n=t.apply(a,i)}function g(t){var i=t-l;return void 0===l||i>=e||i<0||h&&t-c>=a}function f(){var t=Ti();if(g(t))return m(t);o=setTimeout(f,function(t){var i=e-(t-l);return h?Ci(i,a-(t-c)):i}(t))}function m(t){return o=void 0,p&&r?u(t):(r=s=void 0,n)}function v(){var t=Ti(),i=g(t);if(r=arguments,s=this,l=t,i){if(void 0===o)return function(t){return c=t,o=setTimeout(f,e),d?u(t):n}(l);if(h)return clearTimeout(o),o=setTimeout(f,e),u(l)}return void 0===o&&(o=setTimeout(f,e)),n}return e=Pi(e)||0,mi(i)&&(d=!!i.leading,a=(h="maxWait"in i)?Li(Pi(i.maxWait)||0,e):a,p="trailing"in i?!!i.trailing:p),v.cancel=function(){void 0!==o&&clearTimeout(o),c=0,r=l=s=o=void 0},v.flush=function(){return void 0===o?n:m(Ti())},v}const Ai=t=>{let e=null;try{const i=JSON.parse(t.message),{target:r,message:s}=i;e=void 0===r||void 0===s?t:Object.assign(Object.assign({},t),{targetUserIds:r,message:s})}catch(i){e=t}return e};function Ri(t,e){return t.localeCompare(e)}function Ii(t){return t.sort((t,e)=>t.localeCompare(e)).join("_")}function Di(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 Mi="dm__";function Oi(t){return t.isDirectMessage}function Ui(t){return[...new Set(t)].sort(Ri).join("<>")}function $i(t){return t.split("").reverse().join("")}const Fi=/^\*([^*\s]+)\*/,Ni=/^_([^_\s]+)_/,ji=/^~([^~\s]+)~/,zi=/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 Gi(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 Hi(t){return t.replace(Bi,"")}const Vi=2e3,qi=["<a>","<b>","<i>","<q>","<s>"];function Ki(t){t=(t=t.split(" ").map(t=>{if(zi.test(t)){const e=zi.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(Ni.test(t)){const e=Ni.exec(t);t=t.replace(e[0],`<i>${e[1]}</i>`)}if(ji.test(t)){const e=ji.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]=Yi(t);return e}function Yi(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,s]=Yi(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+=s+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 Wi=(t,e)=>{const i=e.getTime()-t.getTime();return Math.round(Math.abs(i/1e3/60))},Zi=(t,e)=>{const i=Wi(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 s=Math.round(r/24);if(s<7)return`${s}d ago`;return`${Math.round(s/7)}w ago`},Qi=t=>t.toDateString()+" "+t.toLocaleTimeString(),Xi=({name:t,time:e,now:i})=>z("div",{class:"head"},z("div",{class:"name"},Qe(ti(t),20)),z("div",{class:"time",title:Qi(e)},Zi(e,i))),Ji=(t,e=!0)=>{null!=t&&t.scrollTo({top:t.scrollHeight,behavior:e?"smooth":"auto"})},tr=({element:t,size:e,states:i={},config:r={}})=>{let s=[];const a=null==r?void 0:r.root[t],n=t=>{s.push(t),"string"==typeof e&&s.push(`${t}.${e}`)};if(n(t),"object"==typeof a&&!Array.isArray(a)&&null!==a){const{state:e,states:r}=a;let s=t,o=[];if(Array.isArray(r)){o=r.filter(t=>i[t]),o.sort();for(const t of o)n(`${s}.${t}`);if(o.length>1){n([s,...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 s},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:s={}})=>Array.isArray(t)&&0!==t.length?t.map(t=>z(rr,{element:t,defaults:e,props:i,childProps:r&&i,elementProps:s})):null,rr=({element:t,defaults:e,childProps:i={},props:r={},onlyChildren:s=!1,asHost:a=!1,deepProps:n=!1,elementProps:o={}},l)=>{var c;const{config:d,size:h,states:p}=e;let u,g={},f=[];Array.isArray(t)?[u,g,...f]=t:u=t;const m=null===(c=null==d?void 0:d.root)||void 0===c?void 0:c[u];null!=m&&"props"in m&&(r=Object.assign(Object.assign({},m.props),r)),r=Object.assign(Object.assign({},r),g),u in o&&(r=Object.assign(Object.assign({},r),o[u]));const v=tr({element:u,size:h,states:p,config:d}),b=er({selectors:v,root:d.root});if(s)return z(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(a)return z(G,Object.assign({},e,{style:k},r),z(ir,{elements:b,defaults:e,props:i,deepProps:n,elementProps:o}),l,f.map(t=>{if(Array.isArray(t)){const[i,r]=t;return z(i,Object.assign({},e,r))}return t}));if(["rtk-header","rtk-controlbar"].includes(u)&&(r.disableRender=!0),u.startsWith("rtk-"))return z(u,Object.assign({},e,{style:k},r),z(ir,{elements:b,defaults:e,props:i,deepProps:n,elementProps:o}),l,f.map(t=>{if(Array.isArray(t)){const[i,r]=t;return z(i,Object.assign({},e,r))}return t}));{const[t,s]=u.split("#");return z(t,Object.assign({id:s,style:k},r),z(ir,{elements:b,defaults:e,props:i,deepProps:n,elementProps:o}),l,f.map(t=>{if(Array.isArray(t)){const[i,r]=t;return z(i,Object.assign({},e,r))}return t}))}},sr=t=>t.split(/[#?]/)[0].split(".").pop().trim(),ar=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=Je(t);let i=null==e?void 0:e.name;const r=await fetch(t);if(!r.ok)return void window.open(t,"_blank");const s=URL.createObjectURL(await r.blob()),a=document.createElement("a");a.href=s,a.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),a.click()};function or(t,e){return t===e||t!=t&&e!=e}function lr(t,e){for(var i=t.length;i--;)if(or(t[i][0],e))return i;return-1}var cr=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=lr(e,t);return!(i<0)&&(i==e.length-1?e.pop():cr.call(e,i,1),--this.size,!0)},dr.prototype.get=function(t){var e=this.__data__,i=lr(e,t);return i<0?void 0:e[i][1]},dr.prototype.has=function(t){return lr(this.__data__,t)>-1},dr.prototype.set=function(t,e){var i=this.__data__,r=lr(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 ur,gr=(ur=/[^.]+$/.exec(pr&&pr.keys&&pr.keys.IE_PROTO||""))?"Symbol(src)_1."+ur:"";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,gr&&gr in e))&&(hr(t)?xr:vr).test(mr(t));var e}function Er(t,e){var i=function(t,e){return null==t?void 0:t[e]}(t,e);return Sr(i)?i:void 0}const Pr=Er(oi,"Map");const Tr=Er(Object,"create");var Lr=Object.prototype.hasOwnProperty;var Cr=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 Ar(t,e){var i,r,s=t.__data__;return("string"==(r=typeof(i=e))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==i:null===i)?s["string"==typeof e?"string":"hash"]:s.map}function Rr(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__=Tr?Tr(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(Tr){var i=e[t];return"__lodash_hash_undefined__"===i?void 0:i}return Lr.call(e,t)?e[t]:void 0},_r.prototype.has=function(t){var e=this.__data__;return Tr?void 0!==e[t]:Cr.call(e,t)},_r.prototype.set=function(t,e){var i=this.__data__;return this.size+=this.has(t)?0:1,i[t]=Tr&&void 0===e?"__lodash_hash_undefined__":e,this},Rr.prototype.clear=function(){this.size=0,this.__data__={hash:new _r,map:new(Pr||dr),string:new _r}},Rr.prototype.delete=function(t){var e=Ar(this,t).delete(t);return this.size-=e?1:0,e},Rr.prototype.get=function(t){return Ar(this,t).get(t)},Rr.prototype.has=function(t){return Ar(this,t).has(t)},Rr.prototype.set=function(t,e){var i=Ar(this,t),r=i.size;return i.set(t,e),this.size+=i.size==r?0:1,this};function Ir(t){var e=this.__data__=new dr(t);this.size=e.size}Ir.prototype.clear=function(){this.__data__=new dr,this.size=0},Ir.prototype.delete=function(t){var e=this.__data__,i=e.delete(t);return this.size=e.size,i},Ir.prototype.get=function(t){return this.__data__.get(t)},Ir.prototype.has=function(t){return this.__data__.has(t)},Ir.prototype.set=function(t,e){var i=this.__data__;if(i instanceof dr){var r=i.__data__;if(!Pr||r.length<199)return r.push([t,e]),this.size=++i.size,this;i=this.__data__=new Rr(r)}return i.set(t,e),this.size=i.size,this};var Dr=function(){try{var t=Er(Object,"defineProperty");return t({},"",{}),t}catch(t){}}();const Mr=Dr;function Or(t,e,i){"__proto__"==e&&Mr?Mr(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,Nr=Fr?Fr.allocUnsafe:void 0;function jr(t,e){if(e)return t.slice();var i=t.length,r=Nr?Nr(i):new t.constructor(i);return t.copy(r),r}const zr=oi.Uint8Array;function Br(t){var e=new t.constructor(t.byteLength);return new zr(e).set(new zr(t)),e}function Gr(t,e){var i=e?Br(t.buffer):t.buffer;return new t.constructor(i,t.byteOffset,t.length)}var Hr=Object.create;const Vr=function(){function t(){}return function(e){if(!mi(e))return{};if(Hr)return Hr(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 Yr=Object.prototype;function Wr(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||Yr)}function Zr(t){return"function"!=typeof t.constructor||Wr(t)?{}:Vr(Kr(t))}function Qr(t){return vi(t)&&"[object Arguments]"==fi(t)}var Xr=Object.prototype,Jr=Xr.hasOwnProperty,ts=Xr.propertyIsEnumerable,es=Qr(function(){return arguments}())?Qr:function(t){return vi(t)&&Jr.call(t,"callee")&&!ts.call(t,"callee")};const is=es;const rs=Array.isArray;function ss(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=9007199254740991}function as(t){return null!=t&&ss(t.length)&&!hr(t)}var ns="object"==typeof t&&t&&!t.nodeType&&t,os=ns&&"object"==typeof module&&module&&!module.nodeType&&module,ls=os&&os.exports===ns?oi.Buffer:void 0;const cs=(ls?ls.isBuffer:void 0)||function(){return!1};var ds={};function hs(t){return function(e){return t(e)}}ds["[object Float32Array]"]=ds["[object Float64Array]"]=ds["[object Int8Array]"]=ds["[object Int16Array]"]=ds["[object Int32Array]"]=ds["[object Uint8Array]"]=ds["[object Uint8ClampedArray]"]=ds["[object Uint16Array]"]=ds["[object Uint32Array]"]=!0,ds["[object Arguments]"]=ds["[object Array]"]=ds["[object ArrayBuffer]"]=ds["[object Boolean]"]=ds["[object DataView]"]=ds["[object Date]"]=ds["[object Error]"]=ds["[object Function]"]=ds["[object Map]"]=ds["[object Number]"]=ds["[object Object]"]=ds["[object RegExp]"]=ds["[object Set]"]=ds["[object String]"]=ds["[object WeakMap]"]=!1;var ps="object"==typeof t&&t&&!t.nodeType&&t,us=ps&&"object"==typeof module&&module&&!module.nodeType&&module,gs=us&&us.exports===ps&&ai.process;const fs=function(){try{var t=us&&us.require&&us.require("util").types;return t||gs&&gs.binding&&gs.binding("util")}catch(t){}}();var ms=fs&&fs.isTypedArray;const vs=ms?hs(ms):function(t){return vi(t)&&ss(t.length)&&!!ds[fi(t)]};var bs=Object.prototype.hasOwnProperty;function ks(t,e,i){var r=t[e];bs.call(t,e)&&or(r,i)&&(void 0!==i||e in t)||Or(t,e,i)}var ys=/^(?:0|[1-9]\d*)$/;function ws(t,e){var i=typeof t;return!!(e=null==e?9007199254740991:e)&&("number"==i||"symbol"!=i&&ys.test(t))&&t>-1&&t%1==0&&t<e}var xs=Object.prototype.hasOwnProperty;function Ss(t,e){var i=rs(t),r=!i&&is(t),s=!i&&!r&&cs(t),a=!i&&!r&&!s&&vs(t),n=i||r||s||a,o=n?function(t,e){for(var i=-1,r=Array(t);++i<t;)r[i]=e(i);return r}(t.length,String):[],l=o.length;for(var c in t)!e&&!xs.call(t,c)||n&&("length"==c||s&&("offset"==c||"parent"==c)||a&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||ws(c,l))||o.push(c);return o}var Es=Object.prototype.hasOwnProperty;function Ps(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=Wr(t),i=[];for(var r in t)("constructor"!=r||!e&&Es.call(t,r))&&i.push(r);return i}function Ts(t){return as(t)?Ss(t,!0):Ps(t)}const Ls=[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],Cs={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"}},_s={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}},As={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 Rs(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 Is=t=>"string"==typeof t&&7===t.length&&t.startsWith("#"),Ds="--rtk-";function Ms(t,e=Ds){return e+t}const Os=(t,e,i=Ds)=>{Object.keys(e).forEach(r=>{const s=e[r];if("string"==typeof s)if("text"===r||"text-on-brand"===r){const e=Rs(s).join(" ");t.style.setProperty(Ms(`colors-${r}-1000`,i),`${e}`),t.style.setProperty(Ms(`colors-${r}-900`,i),`${e} / 0.88`),t.style.setProperty(Ms(`colors-${r}-800`,i),`${e} / 0.76`),t.style.setProperty(Ms(`colors-${r}-700`,i),`${e} / 0.64`),t.style.setProperty(Ms(`colors-${r}-600`,i),`${e} / 0.52`)}else{const e=Rs(s).join(" ");t.style.setProperty(Ms(`colors-${r}`,i),e)}else"object"==typeof s&&Object.keys(s).forEach(e=>{const a=Rs(s[e]).join(" ");t.style.setProperty(Ms(`colors-${r}-${e}`,i),a)})})},Us=(t,{spacingBase:e,borderRadius:i,borderWidth:r,colors:s,fontFamily:a,googleFont:n,theme:o,tokenPrefix:l=Ds})=>{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(Ms("font-family",l),n)),"string"==typeof a&&t.style.setProperty(Ms("font-family",l),a),"number"==typeof e&&((t,e,i=Ds)=>{Ls.forEach(r=>{t.style.setProperty(Ms(`space-${r}`,i),r*e+"px")})})(t,e,l),"string"==typeof r&&((t,e,i=Ds)=>{if(e in _s){const r=_s[e];Object.keys(r).forEach(e=>{t.style.setProperty(Ms(`border-width-${e}`,i),`${r[e]}px`)})}})(t,r,l),"string"==typeof i&&((t,e,i=Ds)=>{if(e in As){const r=As[e];Object.keys(r).forEach(e=>{t.style.setProperty(Ms(`border-radius-${e}`,i),`${r[e]}px`)})}})(t,i,l),"string"==typeof o){const e=Cs[o];null!=e&&Os(t,e,l)}"object"==typeof s&&Os(t,s,l)};function $s(t,e,i){(void 0!==i&&!or(t[e],i)||void 0===i&&!(e in t))&&Or(t,e,i)}var Fs=function(t,e,i){for(var r=-1,s=Object(t),a=i(t),n=a.length;n--;){var o=a[++r];if(!1===e(s[o],o,s))break}return t};const Ns=Fs;var js=Function.prototype,zs=Object.prototype,Bs=js.toString,Gs=zs.hasOwnProperty,Hs=Bs.call(Object);function Vs(t,e){if(("constructor"!==e||"function"!=typeof t[e])&&"__proto__"!=e)return t[e]}function qs(t){return function(t,e,i){var r=!i;i||(i={});for(var s=-1,a=e.length;++s<a;){var n=e[s],o=void 0;void 0===o&&(o=t[n]),r?Or(i,n,o):ks(i,n,o)}return i}(t,Ts(t))}function Ks(t,e,i,r,s,a,n){var o=Vs(t,i),l=Vs(e,i),c=n.get(l);if(c)$s(t,i,c);else{var d,h=a?a(o,l,i+"",t,e,n):void 0,p=void 0===h;if(p){var u=rs(l),g=!u&&cs(l),f=!u&&!g&&vs(l);h=l,u||g||f?rs(o)?h=o:vi(d=o)&&as(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):g?(p=!1,h=jr(l,!0)):f?(p=!1,h=Gr(l,!0)):h=[]:function(t){if(!vi(t)||"[object Object]"!=fi(t))return!1;var e=Kr(t);if(null===e)return!0;var i=Gs.call(e,"constructor")&&e.constructor;return"function"==typeof i&&i instanceof i&&Bs.call(i)==Hs}(l)||is(l)?(h=o,is(o)?h=qs(o):mi(o)&&!hr(o)||(h=Zr(l))):p=!1}p&&(n.set(l,h),s(h,l,r,a,n),n.delete(l)),$s(t,i,h)}}function Ys(t,e,i,r,s){t!==e&&Ns(e,function(a,n){if(s||(s=new Ir),mi(a))Ks(t,e,n,i,Ys,r,s);else{var o=r?r(Vs(t,n),a,n+"",t,e,s):void 0;void 0===o&&(o=a),$s(t,n,o)}},Ts)}function Ws(t){return t}var Zs=Math.max;var Qs=Mr?function(t,e){return Mr(t,"toString",{configurable:!0,enumerable:!1,value:(i=e,function(){return i}),writable:!0});var i}:Ws;const Xs=Qs;var Js=Date.now;var ta,ea,ia,ra=(ta=Xs,ea=0,ia=0,function(){var t=Js(),e=16-(t-ia);if(ia=t,e>0){if(++ea>=800)return arguments[0]}else ea=0;return ta.apply(void 0,arguments)});const sa=ra;function aa(t,e){return sa(function(t,e,i){return e=Zs(void 0===e?t.length-1:e,0),function(){for(var r=arguments,s=-1,a=Zs(r.length-e,0),n=Array(a);++s<a;)n[s]=r[e+s];s=-1;for(var o=Array(e+1);++s<e;)o[s]=r[s];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,Ws),t+"")}var na,oa=(na=function(t,e,i){Ys(t,e,i)},aa(function(t,e){var i=-1,r=e.length,s=r>1?e[r-1]:void 0,a=r>2?e[2]:void 0;for(s=na.length>3&&"function"==typeof s?(r--,s):void 0,a&&function(t,e,i){if(!mi(i))return!1;var r=typeof e;return!!("number"==r?as(i)&&ws(e,i.length):"string"==r&&e in i)&&or(i[e],t)}(e[0],e[1],a)&&(s=r<3?void 0:s,r=1),t=Object(t);++i<r;){var n=e[i];n&&na(t,n,i,s)}return t}));const la=oa,ca=(t,e,i={},r={grid_pagination:!0,settings_toggle:!0})=>{var s,a,n,o,l,c,d,h,p,u,g,f,m,v,b,k,y,w;const x={showSetupScreen:!0};let S,E=["rtk-stage"],P={},T={};const L=!1!==(null==r?void 0:r.settings_toggle),C=!1!==(null==r?void 0:r.grid_pagination);if(null===(s=t.controlBar)||void 0===s?void 0:s.isEnabled){E.push("rtk-controlbar");const{elements:i}=t.controlBar,r=[...i.fullscreen?["rtk-fullscreen-toggle"]:[],...L?["rtk-settings-toggle"]:[]],s=[],h=[];(null===(a=e.participants.pip)||void 0===a?void 0:a.isSupported())&&(null===(o=null===(n=e.self)||void 0===n?void 0:n.config)||void 0===o?void 0:o.pipMode)&&"LIVESTREAM"!==(null===(l=e.self.config)||void 0===l?void 0:l.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===(c=e.self)||void 0===c?void 0:c.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&&s.push("rtk-chat-toggle"),i.polls&&s.push("rtk-polls-toggle"),i.participants&&s.push("rtk-participants-toggle"),i.plugins&&s.push("rtk-plugins-toggle"),s.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 u=r.concat(s).concat(h);let g=!1;u.length>0&&(g=!0),T={"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":s,"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":u.map(t=>[t,{variant:"horizontal",slot:"more-elements"}]),"rtk-more-toggle.activeMoreMenu.sm":u.map(t=>[t,{variant:"horizontal",slot:"more-elements"}]),"div#controlbar-mobile":["rtk-mic-toggle","rtk-camera-toggle","rtk-stage-toggle",g&&"rtk-more-toggle","rtk-leave-button"]}}if(null===(h=t.header)||void 0===h?void 0:h.isEnabled){E.unshift("rtk-header");const{elements:e}=t.header;let i=["rtk-recording-indicator","rtk-livestream-indicator"],r=[],s=[];C&&s.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&&s.push("rtk-participant-count","rtk-viewer-count"),e.timer&&s.push("rtk-clock"),P={"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":s,"div#header-left.sm":{remove:["rtk-logo"],prepend:["rtk-meeting-title"]}}}E.push("rtk-participants-audio","rtk-dialog-manager");let _={logo:S};_=t.designTokens,Is(null===(u=null===(p=null==t?void 0:t.designTokens)||void 0===p?void 0:p.colors)||void 0===u?void 0:u.textOnBrand)&&(_.colors["text-on-brand"]=null===(f=null===(g=null==t?void 0:t.designTokens)||void 0===g?void 0:g.colors)||void 0===f?void 0:f.textOnBrand),Is(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 A={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]":E,"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"]},P),T),{"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",...L?["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 A=((t,e=Ie)=>{let i=Object.assign({},e);return la(i,t),i})(i,A),x.showSetupScreen=null===(w=null===(y=t.setupScreen)||void 0===y?void 0:y.isEnabled)||void 0===w||w,{config:A,data:x}},da=768,ha=1080,pa=t=>t>=ha?"lg":t>=da?"md":"sm";var ua=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 s=r[i];t.call(e,s[1],s[0])}},e}()}(),ga="undefined"!=typeof window&&"undefined"!=typeof document&&window.document===document,fa="undefined"!=typeof global&&global.Math===Math?global:"undefined"!=typeof self&&self.Math===Math?self:"undefined"!=typeof window&&window.Math===Math?window:Function("return this")(),ma="function"==typeof requestAnimationFrame?requestAnimationFrame.bind(fa):function(t){return setTimeout(function(){return t(Date.now())},1e3/60)};var va=["top","right","bottom","left","width","height","size","weight"],ba="undefined"!=typeof MutationObserver,ka=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,s=0;function a(){i&&(i=!1,t()),r&&o()}function n(){ma(a)}function o(){var t=Date.now();if(i){if(t-s<2)return;r=!0}else i=!0,r=!1,setTimeout(n,e);s=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(){ga&&!this.connected_&&(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),ba?(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(){ga&&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;va.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}(),ya=function(t,e){for(var i=0,r=Object.keys(e);i<r.length;i++){var s=r[i];Object.defineProperty(t,s,{value:e[s],enumerable:!1,writable:!1,configurable:!0})}return t},wa=function(t){return t&&t.ownerDocument&&t.ownerDocument.defaultView||fa},xa=Ca(0,0,0,0);function Sa(t){return parseFloat(t)||0}function Ea(t){for(var e=[],i=1;i<arguments.length;i++)e[i-1]=arguments[i];return e.reduce(function(e,i){return e+Sa(t["border-"+i+"-width"])},0)}function Pa(t){var e=t.clientWidth,i=t.clientHeight;if(!e&&!i)return xa;var r=wa(t).getComputedStyle(t),s=function(t){for(var e={},i=0,r=["top","right","bottom","left"];i<r.length;i++){var s=r[i],a=t["padding-"+s];e[s]=Sa(a)}return e}(r),a=s.left+s.right,n=s.top+s.bottom,o=Sa(r.width),l=Sa(r.height);if("border-box"===r.boxSizing&&(Math.round(o+a)!==e&&(o-=Ea(r,"left","right")+a),Math.round(l+n)!==i&&(l-=Ea(r,"top","bottom")+n)),!function(t){return t===wa(t).document.documentElement}(t)){var c=Math.round(o+a)-e,d=Math.round(l+n)-i;1!==Math.abs(c)&&(o-=c),1!==Math.abs(d)&&(l-=d)}return Ca(s.left,s.top,o,l)}var Ta="undefined"!=typeof SVGGraphicsElement?function(t){return t instanceof wa(t).SVGGraphicsElement}:function(t){return t instanceof wa(t).SVGElement&&"function"==typeof t.getBBox};function La(t){return ga?Ta(t)?function(t){var e=t.getBBox();return Ca(0,0,e.width,e.height)}(t):Pa(t):xa}function Ca(t,e,i,r){return{x:t,y:e,width:i,height:r}}var _a=function(){function t(t){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=Ca(0,0,0,0),this.target=t}return t.prototype.isActive=function(){var t=La(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}(),Aa=function(t,e){var i,r,s,a,n,o,l,c=(r=(i=e).x,s=i.y,a=i.width,n=i.height,o="undefined"!=typeof DOMRectReadOnly?DOMRectReadOnly:Object,l=Object.create(o.prototype),ya(l,{x:r,y:s,width:a,height:n,top:s,right:r+a,bottom:n+s,left:r}),l);ya(this,{target:t,contentRect:c})},Ra=function(){function t(t,e,i){if(this.activeObservations_=[],this.observations_=new ua,"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 wa(t).Element))throw new TypeError('parameter 1 is not of type "Element".');var e=this.observations_;e.has(t)||(e.set(t,new _a(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 wa(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 Aa(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}(),Ia="undefined"!=typeof WeakMap?new WeakMap:new ua,Da=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=ka.getInstance(),r=new Ra(e,i,this);Ia.set(this,r)};["observe","unobserve","disconnect"].forEach(function(t){Da.prototype[t]=function(){var e;return(e=Ia.get(this))[t].apply(e,arguments)}});var Ma=void 0!==fa.ResizeObserver?fa.ResizeObserver:Da;const Oa=["top","right","bottom","left"],Ua=["start","end"],$a=Oa.reduce((t,e)=>t.concat(e,e+"-"+Ua[0],e+"-"+Ua[1]),[]),Fa=Math.min,Na=Math.max,ja=Math.round,za=t=>({x:t,y:t}),Ba={left:"right",right:"left",bottom:"top",top:"bottom"},Ga={start:"end",end:"start"};function Ha(t,e,i){return Na(t,Fa(e,i))}function Va(t,e){return"function"==typeof t?t(e):t}function qa(t){return t.split("-")[0]}function Ka(t){return t.split("-")[1]}function Ya(t){return"x"===t?"y":"x"}function Wa(t){return"y"===t?"height":"width"}const Za=new Set(["top","bottom"]);function Qa(t){return Za.has(qa(t))?"y":"x"}function Xa(t){return Ya(Qa(t))}function Ja(t,e,i){void 0===i&&(i=!1);const r=Ka(t),s=Xa(t),a=Wa(s);let n="x"===s?r===(i?"end":"start")?"right":"left":"start"===r?"bottom":"top";return e.reference[a]>e.floating[a]&&(n=on(n)),[n,on(n)]}function tn(t){return t.replace(/start|end/g,t=>Ga[t])}const en=["left","right"],rn=["right","left"],sn=["top","bottom"],an=["bottom","top"];function nn(t,e,i,r){const s=Ka(t);let a=function(t,e,i){switch(t){case"top":case"bottom":return i?e?rn:en:e?en:rn;case"left":case"right":return e?sn:an;default:return[]}}(qa(t),"start"===i,r);return s&&(a=a.map(t=>t+"-"+s),e&&(a=a.concat(a.map(tn)))),a}function on(t){return t.replace(/left|right|bottom|top/g,t=>Ba[t])}function ln(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 cn(t){const{x:e,y:i,width:r,height:s}=t;return{width:r,height:s,top:i,left:e,right:e+r,bottom:i+s,x:e,y:i}}function dn(t,e,i){let{reference:r,floating:s}=t;const a=Qa(e),n=Xa(e),o=Wa(n),l=qa(e),c="y"===a,d=r.x+r.width/2-s.width/2,h=r.y+r.height/2-s.height/2,p=r[o]/2-s[o]/2;let u;switch(l){case"top":u={x:d,y:r.y-s.height};break;case"bottom":u={x:d,y:r.y+r.height};break;case"right":u={x:r.x+r.width,y:h};break;case"left":u={x:r.x-s.width,y:h};break;default:u={x:r.x,y:r.y}}switch(Ka(e)){case"start":u[n]-=p*(i&&c?-1:1);break;case"end":u[n]+=p*(i&&c?-1:1)}return u}async function hn(t,e){var i;void 0===e&&(e={});const{x:r,y:s,platform:a,rects:n,elements:o,strategy:l}=t,{boundary:c="clippingAncestors",rootBoundary:d="viewport",elementContext:h="floating",altBoundary:p=!1,padding:u=0}=Va(e,t),g=ln(u),f=o[p?"floating"===h?"reference":"floating":h],m=cn(await a.getClippingRect({element:null==(i=await(null==a.isElement?void 0:a.isElement(f)))||i?f:f.contextElement||await(null==a.getDocumentElement?void 0:a.getDocumentElement(o.floating)),boundary:c,rootBoundary:d,strategy:l})),v="floating"===h?{x:r,y:s,width:n.floating.width,height:n.floating.height}:n.reference,b=await(null==a.getOffsetParent?void 0:a.getOffsetParent(o.floating)),k=await(null==a.isElement?void 0:a.isElement(b))&&await(null==a.getScale?void 0:a.getScale(b))||{x:1,y:1},y=cn(a.convertOffsetParentRelativeRectToViewportRelativeRect?await a.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:v,offsetParent:b,strategy:l}):v);return{top:(m.top-y.top+g.top)/k.y,bottom:(y.bottom-m.bottom+g.bottom)/k.y,left:(m.left-y.left+g.left)/k.x,right:(y.right-m.right+g.right)/k.x}}function pn(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function un(t){return Oa.some(e=>t[e]>=0)}const gn=new Set(["left","top"]);function fn(){return"undefined"!=typeof window}function mn(t){return kn(t)?(t.nodeName||"").toLowerCase():"#document"}function vn(t){var e;return(null==t||null==(e=t.ownerDocument)?void 0:e.defaultView)||window}function bn(t){var e;return null==(e=(kn(t)?t.ownerDocument:t.document)||window.document)?void 0:e.documentElement}function kn(t){return!!fn()&&(t instanceof Node||t instanceof vn(t).Node)}function yn(t){return!!fn()&&(t instanceof Element||t instanceof vn(t).Element)}function wn(t){return!!fn()&&(t instanceof HTMLElement||t instanceof vn(t).HTMLElement)}function xn(t){return!(!fn()||"undefined"==typeof ShadowRoot)&&(t instanceof ShadowRoot||t instanceof vn(t).ShadowRoot)}const Sn=new Set(["inline","contents"]);function En(t){const{overflow:e,overflowX:i,overflowY:r,display:s}=Un(t);return/auto|scroll|overlay|hidden|clip/.test(e+r+i)&&!Sn.has(s)}const Pn=new Set(["table","td","th"]);function Tn(t){return Pn.has(mn(t))}const Ln=[":popover-open",":modal"];function Cn(t){return Ln.some(e=>{try{return t.matches(e)}catch(t){return!1}})}const _n=["transform","translate","scale","rotate","perspective"],An=["transform","translate","scale","rotate","perspective","filter"],Rn=["paint","layout","strict","content"];function In(t){const e=Dn(),i=yn(t)?Un(t):t;return _n.some(t=>!!i[t]&&"none"!==i[t])||!!i.containerType&&"normal"!==i.containerType||!e&&!!i.backdropFilter&&"none"!==i.backdropFilter||!e&&!!i.filter&&"none"!==i.filter||An.some(t=>(i.willChange||"").includes(t))||Rn.some(t=>(i.contain||"").includes(t))}function Dn(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}const Mn=new Set(["html","body","#document"]);function On(t){return Mn.has(mn(t))}function Un(t){return vn(t).getComputedStyle(t)}function $n(t){return yn(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function Fn(t){if("html"===mn(t))return t;const e=t.assignedSlot||t.parentNode||xn(t)&&t.host||bn(t);return xn(e)?e.host:e}function Nn(t){const e=Fn(t);return On(e)?t.ownerDocument?t.ownerDocument.body:t.body:wn(e)&&En(e)?e:Nn(e)}function jn(t,e,i){var r;void 0===e&&(e=[]);const s=Nn(t),a=s===(null==(r=t.ownerDocument)?void 0:r.body),n=vn(s);return a?(zn(n),e.concat(n,n.visualViewport||[],En(s)?s:[],[])):e.concat(s,jn(s,[]))}function zn(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function Bn(t){const e=Un(t);let i=parseFloat(e.width)||0,r=parseFloat(e.height)||0;const s=wn(t),a=s?t.offsetWidth:i,n=s?t.offsetHeight:r,o=ja(i)!==a||ja(r)!==n;return o&&(i=a,r=n),{width:i,height:r,$:o}}function Gn(t){return yn(t)?t:t.contextElement}function Hn(t){const e=Gn(t);if(!wn(e))return za(1);const i=e.getBoundingClientRect(),{width:r,height:s,$:a}=Bn(e);let n=(a?ja(i.width):i.width)/r,o=(a?ja(i.height):i.height)/s;return n&&Number.isFinite(n)||(n=1),o&&Number.isFinite(o)||(o=1),{x:n,y:o}}const Vn=za(0);function qn(t){const e=vn(t);return Dn()&&e.visualViewport?{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}:Vn}function Kn(t,e,i,r){void 0===e&&(e=!1),void 0===i&&(i=!1);const s=t.getBoundingClientRect(),a=Gn(t);let n=za(1);e&&(r?yn(r)&&(n=Hn(r)):n=Hn(t));const o=function(t,e,i){return void 0===e&&(e=!1),!(!i||e&&i!==vn(t))&&e}(a,i,r)?qn(a):za(0);let l=(s.left+o.x)/n.x,c=(s.top+o.y)/n.y,d=s.width/n.x,h=s.height/n.y;if(a){const t=vn(a),e=r&&yn(r)?vn(r):r;let i=t,s=zn(i);for(;s&&r&&e!==i;){const t=Hn(s),e=s.getBoundingClientRect(),r=Un(s),a=e.left+(s.clientLeft+parseFloat(r.paddingLeft))*t.x,n=e.top+(s.clientTop+parseFloat(r.paddingTop))*t.y;l*=t.x,c*=t.y,d*=t.x,h*=t.y,l+=a,c+=n,i=vn(s),s=zn(i)}}return cn({width:d,height:h,x:l,y:c})}function Yn(t,e){const i=$n(t).scrollLeft;return e?e.left+i:Kn(bn(t)).left+i}function Wn(t,e,i){void 0===i&&(i=!1);const r=t.getBoundingClientRect();return{x:r.left+e.scrollLeft-(i?0:Yn(t,r)),y:r.top+e.scrollTop}}const Zn=new Set(["absolute","fixed"]);function Qn(t,e,i){let r;if("viewport"===e)r=function(t,e){const i=vn(t),r=bn(t),s=i.visualViewport;let a=r.clientWidth,n=r.clientHeight,o=0,l=0;if(s){a=s.width,n=s.height;const t=Dn();(!t||t&&"fixed"===e)&&(o=s.offsetLeft,l=s.offsetTop)}return{width:a,height:n,x:o,y:l}}(t,i);else if("document"===e)r=function(t){const e=bn(t),i=$n(t),r=t.ownerDocument.body,s=Na(e.scrollWidth,e.clientWidth,r.scrollWidth,r.clientWidth),a=Na(e.scrollHeight,e.clientHeight,r.scrollHeight,r.clientHeight);let n=-i.scrollLeft+Yn(t);const o=-i.scrollTop;return"rtl"===Un(r).direction&&(n+=Na(e.clientWidth,r.clientWidth)-s),{width:s,height:a,x:n,y:o}}(bn(t));else if(yn(e))r=function(t,e){const i=Kn(t,!0,"fixed"===e),r=i.top+t.clientTop,s=i.left+t.clientLeft,a=wn(t)?Hn(t):za(1);return{width:t.clientWidth*a.x,height:t.clientHeight*a.y,x:s*a.x,y:r*a.y}}(e,i);else{const i=qn(t);r={x:e.x-i.x,y:e.y-i.y,width:e.width,height:e.height}}return cn(r)}function Xn(t,e){const i=Fn(t);return!(i===e||!yn(i)||On(i))&&("fixed"===Un(i).position||Xn(i,e))}function Jn(t,e,i){const r=wn(e),s=bn(e),a="fixed"===i,n=Kn(t,!0,a,e);let o={scrollLeft:0,scrollTop:0};const l=za(0);function c(){l.x=Yn(s)}if(r||!r&&!a)if(("body"!==mn(e)||En(s))&&(o=$n(e)),r){const t=Kn(e,!0,a,e);l.x=t.x+e.clientLeft,l.y=t.y+e.clientTop}else s&&c();a&&!r&&s&&c();const d=!s||r||a?za(0):Wn(s,o);return{x:n.left+o.scrollLeft-l.x-d.x,y:n.top+o.scrollTop-l.y-d.y,width:n.width,height:n.height}}function to(t){return"static"===Un(t).position}function eo(t,e){if(!wn(t)||"fixed"===Un(t).position)return null;if(e)return e(t);let i=t.offsetParent;return bn(t)===i&&(i=i.ownerDocument.body),i}function io(t,e){const i=vn(t);if(Cn(t))return i;if(!wn(t)){let e=Fn(t);for(;e&&!On(e);){if(yn(e)&&!to(e))return e;e=Fn(e)}return i}let r=eo(t,e);for(;r&&Tn(r)&&to(r);)r=eo(r,e);return r&&On(r)&&to(r)&&!In(r)?i:r||function(t){let e=Fn(t);for(;wn(e)&&!On(e);){if(In(e))return e;if(Cn(e))return null;e=Fn(e)}return null}(t)||i}const ro={convertOffsetParentRelativeRectToViewportRelativeRect:function(t){let{elements:e,rect:i,offsetParent:r,strategy:s}=t;const a="fixed"===s,n=bn(r),o=!!e&&Cn(e.floating);if(r===n||o&&a)return i;let l={scrollLeft:0,scrollTop:0},c=za(1);const d=za(0),h=wn(r);if((h||!h&&!a)&&(("body"!==mn(r)||En(n))&&(l=$n(r)),wn(r))){const t=Kn(r);c=Hn(r),d.x=t.x+r.clientLeft,d.y=t.y+r.clientTop}const p=!n||h||a?za(0):Wn(n,l,!0);return{width:i.width*c.x,height:i.height*c.y,x:i.x*c.x-l.scrollLeft*c.x+d.x+p.x,y:i.y*c.y-l.scrollTop*c.y+d.y+p.y}},getDocumentElement:bn,getClippingRect:function(t){let{element:e,boundary:i,rootBoundary:r,strategy:s}=t;const a=[..."clippingAncestors"===i?Cn(e)?[]:function(t,e){const i=e.get(t);if(i)return i;let r=jn(t,[]).filter(t=>yn(t)&&"body"!==mn(t)),s=null;const a="fixed"===Un(t).position;let n=a?Fn(t):t;for(;yn(n)&&!On(n);){const e=Un(n),i=In(n);i||"fixed"!==e.position||(s=null),(a?!i&&!s:!i&&"static"===e.position&&s&&Zn.has(s.position)||En(n)&&!i&&Xn(t,n))?r=r.filter(t=>t!==n):s=e,n=Fn(n)}return e.set(t,r),r}(e,this._c):[].concat(i),r],n=a[0],o=a.reduce((t,i)=>{const r=Qn(e,i,s);return t.top=Na(r.top,t.top),t.right=Fa(r.right,t.right),t.bottom=Fa(r.bottom,t.bottom),t.left=Na(r.left,t.left),t},Qn(e,n,s));return{width:o.right-o.left,height:o.bottom-o.top,x:o.left,y:o.top}},getOffsetParent:io,getElementRects:async function(t){const e=this.getOffsetParent||io,i=this.getDimensions,r=await i(t.floating);return{reference:Jn(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}=Bn(t);return{width:e,height:i}},getScale:Hn,isElement:yn,isRTL:function(t){return"rtl"===Un(t).direction}},so=function(t){return void 0===t&&(t=0),{name:"offset",options:t,async fn(e){var i,r;const{x:s,y:a,placement:n,middlewareData:o}=e,l=await async function(t,e){const{placement:i,platform:r,elements:s}=t,a=await(null==r.isRTL?void 0:r.isRTL(s.floating)),n=qa(i),o=Ka(i),l="y"===Qa(i),c=gn.has(n)?-1:1,d=a&&l?-1:1,h=Va(e,t);let{mainAxis:p,crossAxis:u,alignmentAxis:g}="number"==typeof h?{mainAxis:h,crossAxis:0,alignmentAxis:null}:{mainAxis:h.mainAxis||0,crossAxis:h.crossAxis||0,alignmentAxis:h.alignmentAxis};return o&&"number"==typeof g&&(u="end"===o?-1*g:g),l?{x:u*d,y:p*c}:{x:p*c,y:u*d}}(e,t);return n===(null==(i=o.offset)?void 0:i.placement)&&null!=(r=o.arrow)&&r.alignmentOffset?{}:{x:s+l.x,y:a+l.y,data:{...l,placement:n}}}}},ao=function(t){return void 0===t&&(t={}),{name:"autoPlacement",options:t,async fn(e){var i,r,s;const{rects:a,middlewareData:n,placement:o,platform:l,elements:c}=e,{crossAxis:d=!1,alignment:h,allowedPlacements:p=$a,autoAlignment:u=!0,...g}=Va(t,e),f=void 0!==h||p===$a?function(t,e,i){return(t?[...i.filter(e=>Ka(e)===t),...i.filter(e=>Ka(e)!==t)]:i.filter(t=>qa(t)===t)).filter(i=>!t||Ka(i)===t||!!e&&tn(i)!==i)}(h||null,u,p):p,m=await hn(e,g),v=(null==(i=n.autoPlacement)?void 0:i.index)||0,b=f[v];if(null==b)return{};const k=Ja(b,a,await(null==l.isRTL?void 0:l.isRTL(c.floating)));if(o!==b)return{reset:{placement:f[0]}};const y=[m[qa(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=Ka(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]),E=(null==(s=S.filter(t=>t[2].slice(0,Ka(t[0])?2:3).every(t=>t<=0))[0])?void 0:s[0])||S[0][0];return E!==o?{data:{index:v+1,overflows:w},reset:{placement:E}}:{}}}},no=function(t){return void 0===t&&(t={}),{name:"shift",options:t,async fn(e){const{x:i,y:r,placement:s}=e,{mainAxis:a=!0,crossAxis:n=!1,limiter:o={fn:t=>{let{x:e,y:i}=t;return{x:e,y:i}}},...l}=Va(t,e),c={x:i,y:r},d=await hn(e,l),h=Qa(qa(s)),p=Ya(h);let u=c[p],g=c[h];if(a){const t="y"===p?"bottom":"right";u=Ha(u+d["y"===p?"top":"left"],u,u-d[t])}if(n){const t="y"===h?"bottom":"right";g=Ha(g+d["y"===h?"top":"left"],g,g-d[t])}const f=o.fn({...e,[p]:u,[h]:g});return{...f,data:{x:f.x-i,y:f.y-r,enabled:{[p]:a,[h]:n}}}}}},oo=function(t){return void 0===t&&(t={}),{name:"flip",options:t,async fn(e){var i,r;const{placement:s,middlewareData:a,rects:n,initialPlacement:o,platform:l,elements:c}=e,{mainAxis:d=!0,crossAxis:h=!0,fallbackPlacements:p,fallbackStrategy:u="bestFit",fallbackAxisSideDirection:g="none",flipAlignment:f=!0,...m}=Va(t,e);if(null!=(i=a.arrow)&&i.alignmentOffset)return{};const v=qa(s),b=Qa(o),k=qa(o)===o,y=await(null==l.isRTL?void 0:l.isRTL(c.floating)),w=p||(k||!f?[on(o)]:function(t){const e=on(t);return[tn(t),e,tn(e)]}(o)),x="none"!==g;!p&&x&&w.push(...nn(o,f,g,y));const S=[o,...w],E=await hn(e,m),P=[];let T=(null==(r=a.flip)?void 0:r.overflows)||[];if(d&&P.push(E[v]),h){const t=Ja(s,n,y);P.push(E[t[0]],E[t[1]])}if(T=[...T,{placement:s,overflows:P}],!P.every(t=>t<=0)){var L,C;const t=((null==(L=a.flip)?void 0:L.index)||0)+1,e=S[t];if(e){if(!("alignment"===h&&b!==Qa(e))||T.every(t=>t.overflows[0]>0&&Qa(t.placement)===b))return{data:{index:t,overflows:T},reset:{placement:e}}}let i=null==(C=T.filter(t=>t.overflows[0]<=0).sort((t,e)=>t.overflows[1]-e.overflows[1])[0])?void 0:C.placement;if(!i)switch(u){case"bestFit":{var _;const t=null==(_=T.filter(t=>{if(x){const e=Qa(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(s!==i)return{reset:{placement:i}}}return{}}}},lo=function(t){return void 0===t&&(t={}),{name:"hide",options:t,async fn(e){const{rects:i}=e,{strategy:r="referenceHidden",...s}=Va(t,e);switch(r){case"referenceHidden":{const t=pn(await hn(e,{...s,elementContext:"reference"}),i.reference);return{data:{referenceHiddenOffsets:t,referenceHidden:un(t)}}}case"escaped":{const t=pn(await hn(e,{...s,altBoundary:!0}),i.floating);return{data:{escapedOffsets:t,escaped:un(t)}}}default:return{}}}}},co=t=>({name:"arrow",options:t,async fn(e){const{x:i,y:r,placement:s,rects:a,platform:n,elements:o,middlewareData:l}=e,{element:c,padding:d=0}=Va(t,e)||{};if(null==c)return{};const h=ln(d),p={x:i,y:r},u=Xa(s),g=Wa(u),f=await n.getDimensions(c),m="y"===u,v=m?"top":"left",b=m?"bottom":"right",k=m?"clientHeight":"clientWidth",y=a.reference[g]+a.reference[u]-p[u]-a.floating[g],w=p[u]-a.reference[u],x=await(null==n.getOffsetParent?void 0:n.getOffsetParent(c));let S=x?x[k]:0;S&&await(null==n.isElement?void 0:n.isElement(x))||(S=o.floating[k]||a.floating[g]);const E=y/2-w/2,P=S/2-f[g]/2-1,T=Fa(h[v],P),L=Fa(h[b],P),C=T,_=S-f[g]-L,A=S/2-f[g]/2+E,R=Ha(C,A,_),I=!l.arrow&&null!=Ka(s)&&A!==R&&a.reference[g]/2-(A<C?T:L)-f[g]/2<0,D=I?A<C?A-C:A-_:0;return{[u]:p[u]+D,data:{[u]:R,centerOffset:A-R-D,...I&&{alignmentOffset:D}},reset:I}}}),ho=(t,e,i)=>{const r=new Map,s={platform:ro,...i},a={...s.platform,_c:r};return(async(t,e,i)=>{const{placement:r="bottom",strategy:s="absolute",middleware:a=[],platform:n}=i,o=a.filter(Boolean),l=await(null==n.isRTL?void 0:n.isRTL(e));let c=await n.getElementRects({reference:t,floating:e,strategy:s}),{x:d,y:h}=dn(c,r,l),p=r,u={},g=0;for(let i=0;i<o.length;i++){const{name:a,fn:f}=o[i],{x:m,y:v,data:b,reset:k}=await f({x:d,y:h,initialPlacement:r,placement:p,strategy:s,middlewareData:u,rects:c,platform:n,elements:{reference:t,floating:e}});d=null!=m?m:d,h=null!=v?v:h,u={...u,[a]:{...u[a],...b}},k&&g<=50&&(g++,"object"==typeof k&&(k.placement&&(p=k.placement),k.rects&&(c=!0===k.rects?await n.getElementRects({reference:t,floating:e,strategy:s}):k.rects),({x:d,y:h}=dn(c,p,l))),i=-1)}return{x:d,y:h,placement:p,strategy:s,middlewareData:u}})(t,e,{...s,platform:a})},po=t=>t.map(t=>{switch(t.type){case"a":if("string"==typeof t.content)return e=t.content,z("a",{class:"link",href:e,target:"_blank",rel:"noopener noreferrer"},e);case"b":return(t=>z("b",null,"string"==typeof t?t:po(t)))(t.content);case"i":return(t=>z("i",null,"string"==typeof t?t:po(t)))(t.content);case"s":return(t=>"string"==typeof t?z("s",null,t):z("b",null,po(t)))(t.content);case"q":return z("span",{class:"block-quote"});default:return(t=>"string"==typeof t?t:z("p",null,po(t)))(t.content)}var e}),uo=({message:t})=>{const e=t.slice(0,Vi),i=Gi(e,!0),r=Hi(e);return z("p",null,0!==i.length&&z("blockquote",null,i.split("\n").map(t=>{const e=Ki(t);return z("p",null,po(e))})),r.split("\n").map(t=>{const e=Ki(t);return z("p",null,po(e))}))},go={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 fo{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=go[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 mo=function(t,e,i,r){var s,a=arguments.length,n=a<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--)(s=t[o])&&(n=(a<3?s(n):a>3?s(e,i,n):s(e,i))||n);return a>3&&n&&Object.defineProperty(e,i,n),n};const vo=class{constructor(t){o(this,t),this.variant="circular",this.iconPack=Ne,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 z("div",{class:"image-ctr"},"loading"===this.imageState&&z("rtk-spinner",{iconPack:this.iconPack}),z("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 z("div",{class:"initials",title:e,part:"initials"},r)}}render(){return z(G,{key:"62ab06b7a747442ff9fb2b65d886dba0177dcc1c"},this.getAvatar(),z("slot",{key:"c076f0ccf24ffa9d1e42287a60c0afd9e27be439"}))}};mo([si()],vo.prototype,"size",void 0),mo([si()],vo.prototype,"iconPack",void 0),mo([si()],vo.prototype,"t",void 0),vo.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 bo=function(t,e,i,r){var s,a=arguments.length,n=a<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--)(s=t[o])&&(n=(a<3?s(n):a>3?s(e,i,n):s(e,i))||n);return a>3&&n&&Object.defineProperty(e,i,n),n};const ko=class{constructor(t){o(this,t),this.onParticipantsAdd=W(this,"participantsAdd",7),this.onParticipantDelete=W(this,"participantDelete",7),this.onRoomJoin=W(this,"roomJoin",7),this.deleteRoom=W(this,"delete",7),this.updateRoom=W(this,"update",7),this.allowDelete=!0,this.iconPack=Ne,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,P(()=>{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 z("div",{class:"peer-ui-container"},z("rtk-avatar",{participant:{name:i,picture:e},size:"sm"}),z("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 z("div",{class:"message-container"},z("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 z("div",{class:"participant-list",onClick:()=>{this.onAssign()}},this.room.participants.map(t=>z("div",{class:"participant-item",role:"listitem",key:t.id},this.renderPeer(t),this.permissions.canAlterConnectedMeetings&&z("rtk-icon",{class:"show-on-hover",icon:this.iconPack.dismiss,onClick:()=>{this.onParticipantDelete.emit(t)}}))))}render(){var t,e,i;return z(G,{key:"947ca9b82a497a0ce4274204dd7bcf9949d4e3c8"},z("div",{key:"cfd0a32bf1ad9db09edcf479e743292a064ff6e0",class:{"assign-mode":this.assigningParticipants,"selector-mode":!this.assigningParticipants,"glowing-card":this.glowingCard}},z("div",{key:"f96ef6dae36d6368d9651b1b7521b5281390a1c5",class:"header"},z("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&&z("span",{key:"b2abbce8a8b9dd49e2b72fbddd13b09763092aa4",class:"participant-count"},"(",z("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&&z("rtk-tooltip",{key:"2a47492d1c1f24077ad1a861a19bec8a201cea74",label:this.editingTitleRoomId===this.room.id?this.t("breakout_rooms.save_room_name"):this.t("breakout_rooms.edit_room_name")},z("rtk-icon",{key:"1211a94dd351b33443fe430f69801cff8bf15765",icon:this.editingTitleRoomId===this.room.id?this.iconPack.checkmark:this.iconPack.edit,class:"show-on-hover",onClick:this.onEditClick})),z("div",{key:"5430f371fad9022f4a9a4de2747914958ff1d846",class:"rooms-container"},this.permissions.canAlterConnectedMeetings&&!this.room.isParent&&this.allowDelete&&z("rtk-tooltip",{key:"f807c8b6fabc2e85a9e9f023e7ac00ecd555861b",label:this.t("breakout_rooms.delete"),class:"danger"},z("rtk-icon",{key:"171ba25bd6d0b4b418d719f2eb4555ddc301ee2e",icon:this.iconPack.delete,class:"show-on-hover",onClick:()=>{this.deleteRoom.emit()}})),this.assigningParticipants&&this.permissions.canAlterConnectedMeetings&&!this.room.isParent&&z("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&&z("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&&z("rtk-icon",{key:"c020a1e894c959580104255ab81c3772af16c862",icon:this.showExpandedCard?this.iconPack.chevron_up:this.iconPack.chevron_down,onClick:()=>this.toggleCardDisplay()}))),this.renderExpandedCardMaybe(),this.renderParticipantsMaybe()))}};bo([si()],ko.prototype,"meeting",void 0),bo([si()],ko.prototype,"states",void 0),bo([si()],ko.prototype,"iconPack",void 0),bo([si()],ko.prototype,"t",void 0),ko.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 yo=function(t,e,i,r){var s,a=arguments.length,n=a<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--)(s=t[o])&&(n=(a<3?s(n):a>3?s(e,i,n):s(e,i))||n);return a>3&&n&&Object.defineProperty(e,i,n),n};const wo=class{constructor(t){o(this,t),this.onSelectedParticipantsUpdate=W(this,"selectedParticipantsUpdate",7),this.onAllToggled=W(this,"allParticipantsToggleUpdate",7),this.onParticipantsDragging=W(this,"participantsDragging",7),this.participantIds=[],this.iconPack=Ne,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 z("div",{class:"peer-ui-container"},z("rtk-avatar",{participant:{name:t.displayName,picture:t.displayPictureUrl},size:"sm"}),z("p",{class:"name",title:e},Qe(e,16),this.meeting.self.userId===t.id&&` (${this.t("you")})`))}render(){return z(G,{key:"f52879701d8a87899b877c28d53254b3bc56b299"},z("div",{key:"91d45e76f9f147c8ca30584bbb6c7816c189e0ce",class:"search-wrapper"},z("div",{key:"b4ae06fd6ce269008cdb4512590e5df8a39f5c9a",class:"search",part:"search"},z("rtk-icon",{key:"0018db4e3febb44ccef2b7891d13fb76e18573b6",icon:this.iconPack.search,part:"search-icon",class:"search-icon"}),z("input",{key:"61fddb7cde11b23976e7485c17f23d34d2f14379",type:"search",autocomplete:"off",placeholder:this.t("search"),onInput:this.onSearchInput,part:"search-input"})),z("slot",{key:"8b2bb46621a8f148e22e6ce34b4d2a47a3b3c707",name:"shuffle-button"})),z("div",{key:"9803b94e75d829ac1f95527b16ba7381807b630b",class:"header"},z("div",{key:"c1b21d875ec8cc2e0625f7e21191b78ffce9e4e3",class:"title-wrapper"},z("span",{key:"3f87be86358d89b288294cb09846a09f2182df11"},this.t("breakout_rooms.main_room")),z("span",{key:"f5a0d206f12479e064d20dc414532d88a24bd62e",class:"participant-count"},"(",z("rtk-icon",{key:"8c8302bd28b84dc72c98086905ae2416d5044216",icon:this.iconPack.people}),this.participantsToShow.length,")")),0!==this.selectedParticipantIds.length&&z("rtk-tooltip",{key:"a40167a7356b4c9d52cd795d5a2c8985a896a473",label:this.t("breakout_rooms.select_all")},z("input",{key:"754d9265dc605ecb460eddaa91f6673690a372c1",type:"checkbox",checked:this.selectedParticipantIds.length===this.participantsToShow.length,onChange:t=>this.onToggleAll(!!t.target.checked)}))),z("div",{key:"94373ef76a5ebd0fcf6d34fe34c0aa7ee1c38159",class:"ctr scrollbar",part:"container"},this.participantsToShow.length>0&&z("ul",{key:"5293af5ca10e9ccd031cfd4b43494a6b7d112084",class:"participants",part:"participants"},this.participantsToShow.map(t=>z("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&&z("input",{type:"checkbox",class:{"hide-checkbox":0===this.selectedParticipantIds.length},checked:this.selectedParticipantIds.includes(he(t))})))),0===this.participantsToShow.length&&this.search.length>0&&z("div",{key:"2940a7bb997d27028dbafb8796dd9db3a55869d3",class:"empty-message"},this.t("participants.errors.empty_results")),0===this.participantsToShow.length&&0===this.search.length&&z("div",{key:"e3a7539e969f0f5369079bac5c01d6ad4a4fdb50",class:"empty-room"},z("rtk-icon",{key:"92b2b7022d9e2961e6ccfc9b721b8369d09bdbb9",icon:this.iconPack.people_checked,part:"search-icon",class:"search-icon"}),z("p",{key:"629b7fb160ec79432d5f7e1b3fd50972589cda7a"},this.t("breakout_rooms.all_assigned")),z("span",{key:"54c84669c543b7a12ee33e6aba25b30c271727b9"},this.t("breakout_rooms.empty_main_room")))))}static get watchers(){return{meeting:["meetingChanged"],participantIds:["participantsChanged"],search:["searchChanged"]}}};yo([si()],wo.prototype,"meeting",void 0),yo([si()],wo.prototype,"iconPack",void 0),yo([si()],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{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 xo=function(t,e,i,r){var s,a=arguments.length,n=a<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--)(s=t[o])&&(n=(a<3?s(n):a>3?s(e,i,n):s(e,i))||n);return a>3&&n&&Object.defineProperty(e,i,n),n};const So=class{constructor(t){o(this,t),this.stateUpdate=W(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=Ne,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||(le=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 Re,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?z("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 z(G,null,z("div",{class:"room-switcher-container"},z("header",null,z("rtk-icon",{icon:this.iconPack.breakout_rooms}),z("span",null,this.t("breakout_rooms.join_breakout_header"))),z("div",{class:"rooms",ref:t=>this.selectorRef=t},this.renderMainRoomMaybe(),this.getPermittedRooms().map((t,e)=>z("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 z(G,null,z("div",{class:"loading-content"},z("rtk-spinner",{size:"xl"})))}renderRoomConfig(){return z(G,null,z("div",{class:"room-config"},z("header",null,z("rtk-icon",{icon:this.iconPack.breakout_rooms}),z("span",null,this.t("breakout_rooms.room_config_header"))),z("div",{class:"create-room"},z("p",null,this.t("breakout_rooms.num_of_rooms")),z("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)})}})),z("span",{class:"distribution-hint"},`${this.t("breakout_rooms.approx")} `," ",z("em",null,this.getApproxDistribution()," ",this.t("breakout_rooms.participants_per_room"))," ",this.t("breakout_rooms.division_text")),z("footer",null,z("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():z(G,null,z("div",{class:"participant-config-wrapper"},z("div",{class:"participant-config"},z("aside",{part:"menu"},z("header",null,this.t("breakout_rooms.assign_participants")),z("rtk-breakout-room-participants",{meeting:this.meeting,iconPack:this.iconPack,t:this.t,participantIds:this.stateManager.unassignedParticipants.map(he),selectedParticipantIds:this.selectedParticipants},z("rtk-tooltip",{label:this.t("breakout_rooms.shuffle_participants"),slot:"shuffle-button"},z("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"},z("rtk-icon",{icon:this.iconPack.shuffle})))),0!==this.selectedParticipants.length&&z("div",{class:"participants-assign-actions"},z("span",null,`${this.selectedParticipants.length} ${this.t("breakout_rooms.selected")}`),z("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")))),z("div",{class:"assign-rooms"},z("div",{class:"row"},z("p",{class:"row-header"},this.t("breakout_rooms.rooms")," (",this.stateManager.allConnectedMeetings.length,")"),!this.assigningParticipants&&z("div",{class:"cta-buttons"},z("rtk-button",{kind:"button",variant:"secondary",class:"br-primary-btn"},z("div",{onClick:this.onAddNewRoom},z("rtk-icon",{icon:this.iconPack.add}),this.t("breakout_rooms.add_room"))),0!==this.stateManager.allConnectedMeetings.flatMap(t=>t.participants).length&&z("rtk-button",{kind:"button",variant:"ghost",onClick:this.onUnassignAll},this.t("breakout_rooms.unassign_all")))),z("div",{class:"rooms",ref:t=>this.selectorRef=t},this.renderMainRoomMaybe(),this.getPermittedRooms().map((t,e)=>z("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})),z("rtk-button",{kind:"button",variant:"secondary",onClick:this.onAddNewRoom,class:"add-room-jumbo-btn br-secondary-btn"},z("div",null,z("rtk-icon",{icon:this.iconPack.add}),z("span",null,this.t("breakout_rooms.add_room_brief"))))))),z("div",{class:"participant-config-actions"},z("div",{class:{"status-bar":!0,"ephemeral-status":""!==this.ephemeralStatusText}},""!==this.ephemeralStatusText&&z("rtk-icon",{icon:this.iconPack.checkmark}),this.getStatusText()),z("div",{class:"breakout-actions"},"create"===this.roomConfig.mode&&this.permissions.canAlterConnectedMeetings&&z("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&&z("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&&z("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&&z("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"]}}};xo([si()],So.prototype,"meeting",void 0),xo([si()],So.prototype,"states",void 0),xo([si()],So.prototype,"iconPack",void 0),xo([si()],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)}.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 Eo=function(t,e,i,r){var s,a=arguments.length,n=a<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--)(s=t[o])&&(n=(a<3?s(n):a>3?s(e,i,n):s(e,i))||n);return a>3&&n&&Object.defineProperty(e,i,n),n};const Po=class{constructor(t){o(this,t),this.stateUpdate=W(this,"rtkStateUpdate",7),this.iconPack=Ne,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 z(G,{key:"ebc1bb7e9831ccecba8474cfc7af14dc5cb4d916"},z("div",{key:"f29fc0d8cd70f0d25b58073dedc56dbfece82f6e",class:"content-col"},z("h2",{key:"6e872c41a1735e396fec8c01286a6e551307d054"},"Broadcast message to"),z("select",{key:"de6fa3415f3b4fab48477ba68925981adac9d7da",onChange:t=>{this.messagePayload=Object.assign(Object.assign({},this.messagePayload),{to:t.target.value})}},z("option",{key:"85c21decd587ecbff9623d140c7e69e335d86e4e"},"Everyone"),z("option",{key:"e70c43b9bedd7a66519757842524af7fdd62b3d3"},"List of rooms")),z("textarea",{key:"c988e01cb69f54aa447f1d643acb0f046b95d3fd",placeholder:"Type message here...",onInput:t=>{this.messagePayload=Object.assign(Object.assign({},this.messagePayload),{message:t.target.value})}}),this.successMessage?z("p",null,"Message sent to ",this.messagePayload.to,z("rtk-icon",{icon:this.iconPack.checkmark})):z("div",{class:"content-row"},z("rtk-button",{onClick:()=>this.close(),variant:"secondary"},"Cancel")," ",z("rtk-button",{variant:"primary",onClick:()=>this.sendMessage()},"Send"))))}};Eo([si()],Po.prototype,"meeting",void 0),Eo([si()],Po.prototype,"states",void 0),Eo([si()],Po.prototype,"iconPack",void 0),Eo([si()],Po.prototype,"t",void 0),Po.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 To=class{constructor(t){o(this,t),this.variant="primary",this.kind="button",this.reverse=!1,this.disabled=!1,this.type="button"}render(){return z(G,{key:"c6135911cab1cd37d5ebd46269f76fd175c41d25"},z("button",{key:"f1872eb9efc1c00b36ab8729ac27c303cd4d775e",part:"button",type:this.type,disabled:this.disabled},z("span",{key:"5a56e98710749503987b045bbe9d833e5708a26c",class:"start"},z("slot",{key:"0963cce1a1788c816503176c05346839fd302fdc",name:"start"})),z("span",{key:"c19dab69abffcea5926e04799aa29dc946ccedf9",class:"content",part:"content"},z("slot",{key:"c89ef75f65e53e26ba85922c2191d411ea445df4"})),z("span",{key:"0eed62f1fcdc33939f41c10e4cf9ddb47dbc379d",class:"end"},z("slot",{key:"3376b8976558c0265837b4f86fa07300f84f2469",name:"end"}))))}static get delegatesFocus(){return!0}};!function(t,e,i,r){var s,a=arguments.length,n=a<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--)(s=t[o])&&(n=(a<3?s(n):a>3?s(e,i,n):s(e,i))||n);a>3&&n&&Object.defineProperty(e,i,n)}([si()],To.prototype,"size",void 0),To.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 Lo=function(t,e,i,r){var s,a=arguments.length,n=a<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--)(s=t[o])&&(n=(a<3?s(n):a>3?s(e,i,n):s(e,i))||n);return a>3&&n&&Object.defineProperty(e,i,n),n};const Co=class{constructor(t){o(this,t),this.stateUpdate=W(this,"rtkStateUpdate",7),this.switchChannel=W(this,"switchChannel",7),this.t=Fe(),this.iconPack=Ne,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,P(()=>{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),Dt(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 z("div",{class:"input-container"},z("ul",{class:"members scrollbar",onClick:()=>{var t;null===(t=this.searchInputTextRef)||void 0===t||t.focus()}},e.map(t=>z("li",{class:"pill"},z("rtk-avatar",{participant:{name:t.name,picture:t.picture},size:"sm"}),z("span",null,t.name),z("rtk-icon",{icon:this.iconPack.dismiss,onClick:()=>{this.selectedMemberIds.delete(t.userId),Dt(this.$el),this.focusOnSearch()}}))),!i&&z("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)&&z("ul",{class:"search-results"},t.map((t,e)=>z("li",{class:{member:!0,selected:e===this.focusedMemberIndex},onClick:()=>this.onMemberAdd(t.userId),ref:t=>{e===this.focusedMemberIndex&&P(()=>{t&&t.scrollIntoView({behavior:"smooth",block:"end",inline:"nearest"})})}},z("rtk-avatar",{participant:{name:t.name,picture:t.picture},size:"sm"}),z("span",null,t.name))),0===t.length&&z("li",{class:"member"},z("span",null,this.t("chat.error.empty_results")))))}}componentDidLoad(){var t;null===(t=this.inputTextRef)||void 0===t||t.focus()}render(){return z(G,{key:"343bc1c61f83850b45010bb05ecb17d365345b51"},z("header",{key:"231b89e21003207dfc890cf2210b6c230fab9390"},1===this.step?this.t("chat.new_channel"):this.t("chat.add_members")),1===this.step&&z("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(),z("footer",{key:"3de7edf3f52b99ce04e2f977bddaaf85a1243c43"},z("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 Y(this)}};Lo([si()],Co.prototype,"meeting",void 0),Lo([si()],Co.prototype,"t",void 0),Lo([si()],Co.prototype,"iconPack",void 0),Co.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 _o=function(t,e,i,r){var s,a=arguments.length,n=a<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--)(s=t[o])&&(n=(a<3?s(n):a>3?s(e,i,n):s(e,i))||n);return a>3&&n&&Object.defineProperty(e,i,n),n};const Ao=class{constructor(t){o(this,t),this.t=Fe(),this.iconPack=Ne,this.members=[]}renderMembers(){return z("ul",{class:"scrollbar"},this.members.map(t=>z("li",null,z("rtk-avatar",{participant:{name:t.name,picture:t.picture},size:"sm"}),z("span",null,t.name))))}render(){return z(G,{key:"debf2dde0cfce1649181c7bfdca29d25c774bb2c"},z("header",{key:"5a7ed6c10130518158a939e9868d5ad68aeb9486"},this.t("chat.channel_members")),this.renderMembers())}};_o([si()],Ao.prototype,"t",void 0),_o([si()],Ao.prototype,"iconPack",void 0),Ao.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 Ro=function(t,e,i,r){var s,a=arguments.length,n=a<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--)(s=t[o])&&(n=(a<3?s(n):a>3?s(e,i,n):s(e,i))||n);return a>3&&n&&Object.defineProperty(e,i,n),n};const Io=class{constructor(t){o(this,t),this.search=W(this,"search",7),this.searchDismissed=W(this,"searchDismissed",7),this.back=W(this,"back",7),this.iconPack=Ne,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 z("rtk-dialog",{open:!0,onRtkDialogClose:()=>{this.showChannelDetailsDialog=!1},iconPack:this.iconPack,t:this.t},z("rtk-channel-details",{members:this.members,channel:this.channel}))}render(){return this.channel?z(G,null,this.showChannelDetailsDialog&&this.renderChannelDetails(),z("header",{class:{searching:this.showSearchBar}},this.showBackButton&&z("rtk-button",{kind:"icon",variant:"secondary",class:"back-btn",onClick:()=>{this.back.emit()}},z("rtk-icon",{icon:this.iconPack.chevron_left})),z("div",{class:"channel-details"},z("span",{class:"name"},this.channel.displayName),!this.channel.isDirectMessage&&z("span",{class:"members"},this.members.map(t=>t.name).join(", "))),z("div",{class:"channel-tools"},!this.channel.isDirectMessage&&z("rtk-tooltip",{label:this.t("chat.channel_members"),variant:"primary"},z("rtk-button",{kind:"button",variant:"secondary",size:"md",onClick:()=>{this.showChannelDetailsDialog=!this.showChannelDetailsDialog},class:"br-primary-btn"},z("rtk-icon",{icon:this.iconPack.people})))))):null}static get watchers(){return{channel:["onChannelChanged"]}}};Ro([si()],Io.prototype,"meeting",void 0),Ro([si()],Io.prototype,"iconPack",void 0),Ro([si()],Io.prototype,"t",void 0),Io.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 Do=function(t,e,i,r){var s,a=arguments.length,n=a<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--)(s=t[o])&&(n=(a<3?s(n):a>3?s(e,i,n):s(e,i))||n);return a>3&&n&&Object.defineProperty(e,i,n),n};const Mo=class{constructor(t){o(this,t),this.channelChange=W(this,"channelChange",7),this.disableSearch=!1,this.hideAvatar=!1,this.iconPack=Ne,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 z(G,{key:"2f9a7d72ebeadda388681aa4e08530f4bb75150b"},"list"===this.viewAs&&z("slot",{key:"2e0f2354e6a5e92c0c82158bc7a2d068fe0c42ca",name:"header"}),e&&z("div",{key:"0cfa739b959782b495b3ae45865cbe91de35237e",class:{dropdown:"dropdown"===this.viewAs,scrollbar:"dropdown"===this.viewAs,list:"list"===this.viewAs}},!this.disableSearch&&z("div",{key:"4b000515de7ebdb64accbe455d749b23955bdebf",class:"search-container",ref:t=>this.$searchEl=t},z("input",{key:"0efd92a23ed1b6fc041c317d2b6e00ec38fcd95a",type:"text",placeholder:this.t("chat.search_conversations"),value:this.searchQuery,onInput:t=>this.searchQuery=t.target.value}),z("rtk-icon",{key:"f62316f91ea71fa7cf561bfcb0e5eb0567df7350",icon:this.iconPack.search})),z("div",{key:"df19cc12b15ccb81380f6f7af41aae6637daafdb",class:"channels-container scrollbar",ref:t=>this.$listEl=t},t.map(t=>z("button",{class:{channel:!0,active:this.selectedChannelId===t.id},onClick:()=>this.onChannelClickHandler(t)},!this.hideAvatar&&z("div",null,t.icon?z("rtk-icon",{class:"avatar-icon",icon:this.iconPack[t.icon]}):z("rtk-avatar",{participant:{name:t.name,picture:t.avatarUrl}})),z("div",{class:"channel-data"},z("div",{class:"col"},z("div",{class:"name"},t.name),t.latestMessage&&z("div",{class:{"last-message":!0,"no-message":!t.latestMessage}},z("rtk-text-message-view",{isMarkdown:!0,text:t.latestMessage}))),z("div",{class:"col channel-meta"},t.latestMessageTime&&z("time",{class:"time"},this.getTimeLabel(t.latestMessageTime)),t.unreadCount>0&&z("div",{class:"unread-count"},t.unreadCount))))))),"dropdown"===this.viewAs&&z("button",{key:"4dc6626d43cca729c7129cf44e5b1e90287e9a0a",class:"dropdown-trigger",onClick:this.toggleDropdown},z("span",{key:"58266d829571400e41be859c60d510324fa933a5"},this.selectedChannelId&&`${this.t("to")} ${this.getChannelById(this.selectedChannelId).name}`,this.getTotalUnreads()>0&&z("div",{key:"fd79330bdf7763baa3374e2ad5fcf79861a422dc",class:"unread-count"},this.getTotalUnreads())),z("rtk-icon",{key:"f168f3d51d356098dd2ec489bd34c2b1920333b4",icon:this.showDropdown?this.iconPack.chevron_up:this.iconPack.chevron_down})))}get $el(){return Y(this)}};Do([si()],Mo.prototype,"iconPack",void 0),Do([si()],Mo.prototype,"t",void 0),Mo.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 Oo=function(t,e,i,r){var s,a=arguments.length,n=a<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--)(s=t[o])&&(n=(a<3?s(n):a>3?s(e,i,n):s(e,i))||n);return a>3&&n&&Object.defineProperty(e,i,n),n};const Uo=class{constructor(t){o(this,t),this.stateUpdate=W(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=Ie,this.iconPack=Ne,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,Di(t.dataTransfer.items,(t,e)=>{var i,r,s,a;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===(a=null===(s=this.meeting)||void 0===s?void 0:s.chat)||void 0===a||a.sendFileMessage(e,this.getRecipientPeerIds()))}})},this.disconnectMeeting=t=>{var e,i,r,s,a,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===(s=null==t?void 0:t.chat)||void 0===s||s.removeListener("channelMessageUpdate",this.onChannelCreateOrUpdate),null===(n=null===(a=null==t?void 0:t.participants)||void 0===a?void 0:a.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=Ii([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(Mi)?this.createDMChannel(e.id.replace(Mi,"")):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)=>Ri(t.displayName,e.displayName)),r=e.filter(Oi).map(t=>Object.assign(Object.assign({},t),{displayName:this.getMemberDisplayName(t)})),s=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:`${Mi}${t.userId}`,displayName:t.name,displayPictureUrl:t.picture,isDirectMessage:!0,unreadCount:0})),a=[...r,...s].sort((t,e)=>Ri(t.displayName,e.displayName));this.channels=[...i,...a];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?Hi(t.latestMessage.message):"",e.latestMessageTime=t.latestMessage.time),e}),this.getPrivateChatRecipients=()=>{const t=this.getFilteredParticipants().map(t=>{const e=Ii([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:z("rtk-tooltip",{label:this.t("chat.toggle_pinned_msgs")},z("div",{class:{"pinned-messages-header":!0,active:this.showPinnedMessages},onClick:this.onTogglePinnedMessages},z("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,s,a,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===(s=t.self.permissions.chatPrivate)||void 0===s?void 0:s.text),this.canSendPrivateFiles=!!(null===(a=t.self.permissions.chatPrivate)||void 0===a?void 0:a.files),this.canPinMessages=(null===(n=null==t?void 0:t.__internals__)||void 0===n?void 0:n.features.hasFeature(ae))&&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(Mi)).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 s in t){const a=null!==(e=Ke[s])&&void 0!==e?e:0;r[s]=t[s].filter(t=>"chat"==t.type&&t.message.time>a&&t.message.userId!==this.meeting.self.userId).length,(s===Ii([this.meeting.self.userId,null===(i=this.selectedParticipant)||void 0===i?void 0:i.userId])||"everyone"===s&&null===this.selectedParticipant)&&(r[s]=0,Ke[s]=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=Ai(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=Ii(Array.from(t))}void 0===this.chatGroups[r]&&(this.chatGroups[r]=[]);let s=!1,a=[];this.chatGroups[r].forEach(e=>{"chat"===e.type&&e.message.id===t.id?(s=!0,a.push({type:"chat",message:i})):a.push(e)}),s||a.push({type:"chat",message:i}),this.chatGroups[r]=a}getRecipientPeerIds(){let t=[];return"everyone"!==this.chatRecipientId&&(t=[this.selectedParticipant.id]),t}channelSwitchListener(t){this.onChannelChanged(t)}renderHeadlessComponents(){return z(Ht,null,z("rtk-dialog-manager",{meeting:this.meeting}),z("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},s=this.editingMessage?this.editingMessage.message:"",a=this.replyMessage?this.replyMessage.message:"";return z("rtk-chat-composer-view",Object.assign({message:s,storageKey:null!==(t=this.selectedChannelId)&&void 0!==t?t:`draft-${this.selectedChannelId}`,quotedMessage:a,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),z("slot",{name:"chat-addon",slot:"chat-addon"}))}renderFullChat(){if(this.creatingChannel)return z("div",{class:"banner"},z("rtk-spinner",{size:"lg"}));if(0===this.channels.length||!this.selectedChannelId)return z("div",{class:"banner"},z("rtk-icon",{icon:this.iconPack.create_channel_illustration,slot:"start",class:"create-channel-illustration"}),z("rtk-button",{kind:"wide",variant:"primary",size:"md",onClick:this.onChannelCreateClicked,class:"welcome-new-channel"},z("rtk-icon",{icon:this.iconPack.add,slot:"start"}),z("span",null,this.t("chat.new_channel"))),("mobile"===this.selectorState||"hide"===this.selectorState)&&z("rtk-button",{kind:"button",variant:"secondary",size:"md",class:"view-chats-btn",onClick:()=>{this.selectorState="mobile"}},z("rtk-icon",{icon:this.iconPack.chat,slot:"start"}),z("span",null,this.t("chat.view_chats"))));const t=this.channels.find(t=>t.id===this.selectedChannelId);return z("div",{class:"chat"},z("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&&z("rtk-chat-search-results",{meeting:this.meeting,query:this.searchQuery,channelId:this.selectedChannelId}),""===this.searchQuery&&z("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 s=this.chatGroups[this.selectedGroup]||[];return this.showPinnedMessages&&0!==this.meeting.chat.pinned.length&&(s=s.filter(t=>"chat"===t.type&&t.message.pinned)),z(G,null,this.isChatViewType&&this.renderHeadlessComponents(),z("div",{class:"chat-container"},this.isChatViewType&&z("div",{class:{"selector-container":!0,[this.selectorState]:!0}},z("rtk-channel-selector-view",{channels:this.getChannelItems(),selectedChannelId:this.selectedChannelId,onChannelChange:this.onChannelChanged,t:this.t},z("div",{class:"channel-selector-header",slot:"header"},z("rtk-logo",{meeting:this.meeting,config:this.config,t:this.t}),z("rtk-tooltip",{label:this.t("chat.new_channel")},z("rtk-button",{kind:"button",variant:"ghost",size:"md",onClick:this.onChannelCreateClicked,class:"channel-create-btn"},z("rtk-icon",{icon:this.iconPack.add}))))),z("rtk-button",{kind:"icon",variant:"ghost",class:"mobile-close-btn",onClick:()=>this.selectorState="hide"},z("rtk-icon",{icon:this.iconPack.dismiss}))),z("div",{class:"chat"},this.isFileMessagingAllowed()&&z("div",{id:"dropzone",class:{active:this.dropzoneActivated},part:"dropzone"},z("rtk-icon",{icon:this.iconPack.attach}),z("p",null,this.t("chat.send_attachment"))),this.renderPinnedMessagesHeader(),this.isPrivateChatSupported()&&z("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()?z("rtk-chat-messages-ui-paginated",{meeting:this.meeting,onPinMessage:this.onPinMessage,onDeleteMessage:this.onDeleteMessage,size:this.size,iconPack:this.iconPack,t:this.t}):z("rtk-chat-messages-ui",Object.assign({messages:s,selfUserId:r,selectedGroup:this.selectedGroup,onPinMessage:this.onPinMessage,canPinMessages:this.canPinMessages},i)),this.renderComposerUI())))}get host(){return Y(this)}static get watchers(){return{meeting:["meetingChanged"],chatGroups:["chatGroupsChanged"],displayFilter:["onDisplayFilterChanged"]}}};Oo([si()],Uo.prototype,"meeting",void 0),Oo([si()],Uo.prototype,"size",void 0),Oo([si()],Uo.prototype,"iconPack",void 0),Oo([si()],Uo.prototype,"t",void 0),Uo.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 $o=function(t,e,i,r){var s,a=arguments.length,n=a<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--)(s=t[o])&&(n=(a<3?s(n):a>3?s(e,i,n):s(e,i))||n);return a>3&&n&&Object.defineProperty(e,i,n),n};const Fo={messagesSent:0,startTime:0},No=class{constructor(t){o(this,t),this.onNewMessage=W(this,"newMessage",7),this.onEditMessage=W(this,"editMessage",7),this.onEditCancel=W(this,"editCancel",7),this.onQuotedMessageDismiss=W(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=Ne,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-Fo.startTime>1e3*this.rateLimits.period&&(Fo.startTime=e,Fo.messagesSent=0),Fo.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&&P(()=>this.$textComposer.setText(this.message,!0))}checkRateLimitBreached(t){if(Fo.messagesSent>=this.rateLimits.maxInvocations){this.disableSendButton=!0,this.rateLimitsBreached=!0;const e=t-Fo.startTime+1e3*this.rateLimits.period;setTimeout(()=>{Fo.messagesSent=0,Fo.startTime=Date.now(),this.disableSendButton=!1,this.rateLimitsBreached=!1},e)}}render(){var t;const e={iconPack:this.iconPack,t:this.t};return z(G,{key:"a672e9492db4fc74dabda1c294883706903d0e86"},this.canSendTextMessage&&this.isEmojiPickerOpen&&z("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)),z("slot",{key:"a0edb07fc7c7dea7b994c4b335f6c2c9f4e1fb09",name:"chat-addon"}),this.quotedMessage&&0!==this.quotedMessage.length&&z("div",{key:"53c3efb018ee3a06d35d01e4c6b18d528a5fc271",class:"quoted-message-container",part:"quoted-message-container"},z("div",{key:"101e62eb4a7a03ce5eefbcc5f67c5fce34eb292f",class:"quoted-message scrollbar"},z("rtk-text-message-view",{key:"9e3ae5e8d1d46ffcdd03ae2d3487734257ae4425",text:this.quotedMessage,isMarkdown:!0})),z("div",{key:"089bde9c6be382e1b04bce8af318b776f492718e"},z("rtk-icon",{key:"b04ec3f54c1886690ba70f3eb21eb8372db3ef3c","aria-label":this.t("dismiss"),class:"dismiss",icon:this.iconPack.dismiss,onClick:this.onQuotedMessageDismissHandler}))),z("div",{key:"f531b78b2895fbb2f37bf937c60603f35c802cb4",class:"composer-container"},z("div",{key:"2c9389a3c823f4efabe4712b2166b477103a8667",class:"composers"},this.fileToUpload&&z("rtk-draft-attachment-view",Object.assign({key:"38b0366c7d131695b331ba7efe595bf10120f9bb"},e,{attachment:this.fileToUpload,onDeleteAttachment:()=>this.fileToUpload=null})),!this.fileToUpload&&z("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})),z("div",{key:"c6a524f4b9c130c429e6e87add59e85439adca2d",class:"chat-buttons",part:"chat-buttons"},z("div",{key:"0280b7dad1c85d51bd196c2bfade66979a362bd6",class:"left",part:"chat-buttons-left"},!this.fileToUpload&&!this.isEditing&&z("div",{key:"9caff064ea2a5e78f84a7c8072e99f4f944345fa"},this.canSendFiles&&[z("rtk-file-picker-button",Object.assign({key:"581b6351c4d9b2d7e376b95d494e2e3116c2cf61"},e,{onFileChange:t=>this.onFileUploadHandler("file",t.detail)})),z("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&&z("rtk-emoji-picker-button",Object.assign({key:"10f628d5aee40f80f2f6e10717a69f0a420ea60e",isActive:this.isEmojiPickerOpen,onClick:()=>{this.isEmojiPickerOpen=!this.isEmojiPickerOpen}},e)),z("slot",{key:"782450debcfcb1ae7effe6cc3fabc176b1a17e12",name:"chat-buttons"}))),z("div",{key:"39d9e3b86a6d6e9788d71a6e6f7928cb694e5c54",class:"right",part:"chat-buttons-right"},!this.isEditing&&z("rtk-tooltip",{key:"e5a182cc2ce7ca563de2e7438679119bbc0ea4e3",variant:"primary",label:this.t("chat.send_msg"),delay:2e3},z("rtk-button",{key:"da1d029ad519b2bdb4c43b610372ee5cbcdb3ffd",kind:"icon",disabled:this.disableSendButton,onClick:()=>this.handleSendMessage(),title:this.t("chat.send_msg")},z("rtk-icon",{key:"608f9769aaf2689a50ae9ba616218aba4ce10370",icon:this.iconPack.send}))),this.isEditing&&z("div",{key:"7bc9c5c60f9dca00a3fabd2bb9c9ff64ba32eb66",class:"edit-buttons"},z("rtk-tooltip",{key:"f203cb3b1f6097c84ebe9bdce87913383d561f35",variant:"secondary",label:this.t("cancel"),delay:2e3},z("rtk-button",{key:"36720b4a31fa853a3e7de18442acf00bd32406c9",kind:"icon",variant:"secondary",onClick:()=>this.handleEditCancel(),title:this.t("cancel")},z("rtk-icon",{key:"f4ed9e89f3633db7a3850539517f86ffb48fde96",icon:this.iconPack.dismiss}))),z("rtk-tooltip",{key:"e66251c4572d124359edaffb551b3aaf3e9d52ee",variant:"primary",label:this.t("chat.update_msg"),delay:2e3},z("rtk-button",{key:"7f3be6fd93e61d0735ec0c5d36cec9bd65d0a164",kind:"icon",onClick:()=>this.handleEditMessage(),title:this.t("chat.send_msg")},z("rtk-icon",{key:"7b092e18376c32ac441fa57fbb758c8a452bec2f",icon:this.iconPack.checkmark}))))))))}};$o([si()],No.prototype,"iconPack",void 0),$o([si()],No.prototype,"t",void 0),No.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 jo=function(t,e,i,r){var s,a=arguments.length,n=a<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--)(s=t[o])&&(n=(a<3?s(n):a>3?s(e,i,n):s(e,i))||n);return a>3&&n&&Object.defineProperty(e,i,n),n};const zo=class{constructor(t){o(this,t),this.edit=W(this,"edit",7),this.reply=W(this,"reply",7),this.pin=W(this,"pin",7),this.delete=W(this,"delete",7),this.iconPack=Ne,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 z("div",{"is-continued":this.isContinued,key:this.message.id},this.isUnread&&z("div",{class:"new-chat-marker",part:"new-chat-marker"},this.t("chat.new")),z("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 z("div",{"is-continued":this.isContinued,key:this.message.id},this.isUnread&&z("div",{class:"new-chat-marker",part:"new-chat-marker"},this.t("chat.new")),z("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 z("div",{"is-continued":this.isContinued,key:this.message.id},this.isUnread&&z("div",{class:"new-chat-marker",part:"new-chat-marker"},this.t("chat.new")),z("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 z("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 z("rtk-menu",{placement:this.alignRight?"bottom-end":"bottom-start"},z("button",{slot:"trigger",class:"actions"},z("rtk-icon",{icon:this.iconPack.chevron_down})),z("rtk-menu-list",null,this.canReply&&z("rtk-menu-item",{onClick:this.onReply},z("rtk-icon",{icon:this.iconPack.back,slot:"start"}),this.t("chat.reply")),this.canPin&&z("rtk-menu-item",{onClick:this.onPinned},z("rtk-icon",{icon:this.iconPack.pin,slot:"start"}),this.t("pin")),this.canEdit&&z("rtk-menu-item",{onClick:this.onEdit},z("rtk-icon",{icon:this.iconPack.edit,slot:"start"}),this.t("chat.edit_msg")),this.canDelete&&z("rtk-menu-item",{onClick:this.onDelete},z("rtk-icon",{icon:this.iconPack.delete,slot:"start"}),this.t("chat.delete_msg"))))}renderAvatar(){if(!this.hideAvatar)return this.isContinued?z("div",{class:"avatar"}):z("div",{class:"avatar"},z("rtk-avatar",{size:"sm",participant:{name:this.message.displayName,picture:this.senderDisplayPicture}}))}render(){return z(G,{key:"46d26d49f2f11697a5656d93278a0dfb157b13fd"},z("div",{key:"3e3555c8d3ea45256eaf8d46dbbbe56f02e54275",class:{"message-wrapper":!0,"align-right":this.alignRight,"left-align":this.leftAlign},"is-continued":this.isContinued},this.renderAvatar(),z("div",{key:"ceb96b104b12e2497d26ddf8c7d60aa928798107",class:{message:!0,"show-on-hover":!this.isTouchDevice()},"is-continued":this.isContinued},this.renderMessage(),this.renderControls())))}get $el(){return Y(this)}};jo([si()],zo.prototype,"size",void 0),jo([si()],zo.prototype,"iconPack",void 0),jo([si()],zo.prototype,"t",void 0),zo.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 Bo=function(t,e,i,r){var s,a=arguments.length,n=a<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--)(s=t[o])&&(n=(a<3?s(n):a>3?s(e,i,n):s(e,i))||n);return a>3&&n&&Object.defineProperty(e,i,n),n};const Go=class{constructor(t){o(this,t),this.onPinMessage=W(this,"pinMessage",7),this.stateUpdate=W(this,"rtkStateUpdate",7),this.observingEl=[],this.autoScrollEnabled=!0,this.messages=[],this.canPinMessages=!1,this.iconPack=Ne,this.t=Fe(),this.now=new Date,this.showLatestMessageButton=!1,this.onScroll=t=>{const e=t.target;P(()=>{const{scrollTop:t,clientHeight:i,scrollHeight:r}=e;t+i+10>=r?(this.autoScrollEnabled=!0,this.showLatestMessageButton=!1):this.autoScrollEnabled=!1})},this.scrollToBottom=()=>{Ji(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()&&P(()=>{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?Ji(this.$chat):null==this.autoScrollEnabled&&Ji(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 z(G,{key:"01c61fd2a60ca11df413406967eb80af92d07de0"},z("div",{key:"b1a6ad7904236a7fdb50034f33de979faa080ef6",class:"chat-container scrollbar",ref:t=>this.$chat=t,part:"container"},z("div",{key:"95664e4f9b8faae0c31c128abc6f54cf5bcd6acf",class:"spacer",part:"spacer"}),z("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,s=!(r.userId===this.selfUserId)&&!this.autoScrollEnabled&&!i&&r.time>this.lastReadTimestamp;s&&(i=s);const a=!s&&r.userId===(null==e?void 0:e.userId)&&Wi(r.time,null==e?void 0:e.time)<2;return e=r,z("div",{"is-continued":a,key:t.message.id,ref:this.observeMessage,"data-timestamp":r.time.getTime(),class:r.pinned?"pinned":""},s&&z("div",{class:"new-chat-marker",part:"new-chat-marker"},this.t("chat.new")),z("div",{class:"message-wrapper"},z("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)},z("div",null,!a&&z("div",{class:"head"},z("div",{class:"name"},r.displayName),!!r.time&&z("div",{class:"time",title:Qi(r.time)},Zi(r.time,new Date(Date.now())))),z("div",{class:"body"},"text"===r.type&&z("rtk-text-message-view",{text:r.message,isMarkdown:!0}),"file"===r.type&&z("rtk-file-message-view",{name:r.name,url:r.link,size:r.size}),"image"===r.type&&z("rtk-image-message-view",{url:r.link,onPreview:()=>{this.stateUpdate.emit({image:r})}})))),r.pinned&&z("div",{class:"pin-button",part:"pin-button"},z("rtk-tooltip",{label:this.t("unpin")},z("rtk-button",{kind:"icon",variant:"ghost",onClick:()=>this.onMessageActionHandler("pin_message",r),disabled:!this.canPinMessages},z("rtk-icon",{icon:this.iconPack.pin,size:"sm"}))))))}return null}))),z("div",{key:"84333af1150e9e30982b3bc27431296181c58c18",class:"show-new-messages-ctr"},z("rtk-button",{key:"21b5c13d59fc4ef0b18870a916f155b4660ad706",class:{"show-new-messages":!0,active:this.showLatestMessageButton},kind:"icon",part:"show-new-messages",onClick:this.scrollToBottom},z("rtk-icon",{key:"beb6880a734bdc3feeb6b630af54d6b1d89273e3",icon:this.iconPack.chevron_down}))))}static get watchers(){return{messages:["chatChanged"],selectedGroup:["selectedBucketChanged"]}}};Bo([si()],Go.prototype,"size",void 0),Bo([si()],Go.prototype,"iconPack",void 0),Bo([si()],Go.prototype,"t",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{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 Ho=function(t,e,i,r){var s,a=arguments.length,n=a<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--)(s=t[o])&&(n=(a<3?s(n):a>3?s(e,i,n):s(e,i))||n);return a>3&&n&&Object.defineProperty(e,i,n),n};const Vo=class{constructor(t){o(this,t),this.editMessageInit=W(this,"editMessageInit",7),this.onPinMessage=W(this,"pinMessage",7),this.onDeleteMessage=W(this,"deleteMessage",7),this.stateUpdate=W(this,"rtkStateUpdate",7),this.iconPack=Ne,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 s=e.userId===(null===(r=t[i-1])||void 0===r?void 0:r.userId);return this.createChatNode(e,s)}),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,s,a;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!==(s=null===(r=this.meeting.participants.joined.toArray().find(e=>e.userId===t.userId))||void 0===r?void 0:r.picture)&&void 0!==s?s:null===(a=this.meeting.participants.waitlisted.toArray().find(e=>e.userId===t.userId))||void 0===a?void 0:a.picture,z("div",{class:{pinned:t.pinned}},z("div",{class:"message-wrapper"},z("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)},z("div",null,z("div",{class:"body"},"text"===t.type&&z("rtk-text-message-view",{text:t.message,isMarkdown:!0}),"file"===t.type&&z("rtk-file-message-view",{name:t.name,url:t.link,size:t.size}),"image"===t.type&&z("rtk-image-message-view",{url:t.link,onPreview:()=>{this.stateUpdate.emit({image:t})}})),t.pinned&&z("div",{class:"pin-icon",part:"pin-icon"},z("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 z(G,{key:"088b35f5fe196ed2b3271a0b36eef02df47f28e0"},z("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")},z("slot",{key:"a4c15d852264ca50ae784a8b26b052585b0acac8"})))}get host(){return Y(this)}static get watchers(){return{meeting:["meetingChanged"],selectedChannelId:["channelChanged"]}}};Ho([si()],Vo.prototype,"meeting",void 0),Ho([si()],Vo.prototype,"size",void 0),Ho([si()],Vo.prototype,"iconPack",void 0),Ho([si()],Vo.prototype,"t",void 0),Vo.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 qo=function(t,e,i,r){var s,a=arguments.length,n=a<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--)(s=t[o])&&(n=(a<3?s(n):a>3?s(e,i,n):s(e,i))||n);return a>3&&n&&Object.defineProperty(e,i,n),n};const Ko=class{constructor(t){o(this,t),this.iconPack=Ne,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=>z("rtk-chat-message",{key:t.id,message:t,disableControls:!0}))}render(){return z(G,{key:"f94f965504c412fd2a33fd9f50a8baaedd05f3ab"},z("rtk-paginated-list",{key:"6e21d19a60937f67733162a2f2fcdae290c5991f",pageSize:this.pageSize,pagesAllowed:3,fetchData:this.searchMessages,createNodes:this.nodeRenderer,selectedItemId:this.query}))}};qo([si()],Ko.prototype,"meeting",void 0),qo([si()],Ko.prototype,"iconPack",void 0),qo([si()],Ko.prototype,"t",void 0),Ko.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 Yo=function(t,e,i,r){var s,a=arguments.length,n=a<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--)(s=t[o])&&(n=(a<3?s(n):a>3?s(e,i,n):s(e,i))||n);return a>3&&n&&Object.defineProperty(e,i,n),n};const Wo=class{constructor(t){o(this,t),this.stateUpdate=W(this,"rtkStateUpdate",7),this.keyPressListener=t=>{"Escape"===t.key&&this.close()},this.iconPack=Ne,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 z(G,{key:"e9a8a58afa42b97d8dba92f3619b3b0b67160d04"},z("div",{key:"5ad16431e2157600116bbdbf47c194d8a4980621",class:"leave-modal"},z("div",{key:"9285137f1130bcc7f67183e476e5464688ccff90",class:"header"},z("h2",{key:"ef2144a5de17b8f1dd41f4bf765e3da17ae058e5",class:"title"},i.header?this.t(i.header):this.t("cta.confirmation"))),i.content&&z("p",{key:"2227d4079e7df0e02b805aef57c2187c3a55e785",class:"message"},this.t(i.content)),z("div",{key:"d6f587b79bbf99d0e8a00f7bb65975b2eafa80ad",class:"content"},z("div",{key:"cdd81faaf9fa4192a2ed57f9d4d3f36e45400250",class:"leave-meeting"},z("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")),z("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"))))))}};Yo([si()],Wo.prototype,"meeting",void 0),Yo([si()],Wo.prototype,"states",void 0),Yo([si()],Wo.prototype,"iconPack",void 0),Yo([si()],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)}: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 Zo=function(t,e,i,r){var s,a=arguments.length,n=a<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--)(s=t[o])&&(n=(a<3?s(n):a>3?s(e,i,n):s(e,i))||n);return a>3&&n&&Object.defineProperty(e,i,n),n};const Qo=class{constructor(t){o(this,t),this.onChange=W(this,"valueChange",7),this.input="1",this.minValue=0,this.iconPack=Ne,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 z(G,{key:"69da144af824d130db538c62561020197f7b93fa"},z("rtk-button",{key:"c31072304b50d8f4eb75379ad9cf924762107425",kind:"icon",variant:"ghost",onClick:()=>this.decrement()},z("rtk-icon",{key:"ff4247e38e693b1a642cebb6c7dc4efc675945de",icon:this.iconPack.subtract})),z("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()}}),z("rtk-button",{key:"5b063c1a3698c7f8ccbd6e7fb406efe0905a260b",kind:"icon",variant:"ghost",onClick:()=>this.increment()},z("rtk-icon",{key:"dbc1a35da59b9973eceab21fdf6fcb395942ac45",icon:this.iconPack.add})))}static get watchers(){return{input:["watchStateHandler"]}}};Zo([si()],Qo.prototype,"size",void 0),Zo([si()],Qo.prototype,"iconPack",void 0),Zo([si()],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)}: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 Xo=function(t,e,i,r){var s,a=arguments.length,n=a<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--)(s=t[o])&&(n=(a<3?s(n):a>3?s(e,i,n):s(e,i))||n);return a>3&&n&&Object.defineProperty(e,i,n),n};const Jo=class{constructor(t){o(this,t),this.stateUpdate=W(this,"rtkStateUpdate",7),this.keyPressListener=t=>{"Escape"===t.key&&this.close()},this.iconPack=Ne,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 z(G,null,z("aside",{class:{hide:this.isMobileMainVisible},part:"menu"},z("header",null,z("h3",null,this.t("debugger.troubleshooting.label"))),z("button",{type:"button",class:{active:"audio"===this.activeTab},onClick:()=>this.changeTab("audio")},this.t("debugger.audio.label"),z("div",{class:"right"},z("rtk-icon",{icon:this.iconPack.mic_on}),"sm"===this.size&&z("rtk-icon",{icon:this.iconPack.chevron_right}))),z("button",{type:"button",class:{active:"video"===this.activeTab},onClick:()=>this.changeTab("video")},this.t("debugger.video.label"),z("div",{class:"right"},z("rtk-icon",{icon:this.iconPack.video_on}),"sm"===this.size&&z("rtk-icon",{icon:this.iconPack.chevron_right}))),z("button",{type:"button",class:{active:"screenshare"===this.activeTab},onClick:()=>this.changeTab("screenshare")},this.t("debugger.screenshare.label"),z("div",{class:"right"},z("rtk-icon",{icon:this.iconPack.share_screen_start}),"sm"===this.size&&z("rtk-icon",{icon:this.iconPack.chevron_right}))),z("button",{type:"button",class:{active:"system"===this.activeTab,hidden:!i},onClick:()=>this.changeTab("system")},this.t("debugger.system.label"),z("div",{class:"right"},z("rtk-icon",{icon:this.iconPack.settings}),"sm"===this.size&&z("rtk-icon",{icon:this.iconPack.chevron_right})))),z("main",{class:{active:this.isMobileMainVisible},part:"main-content"},"sm"===this.size&&z("header",null,z("rtk-button",{kind:"icon",class:"back-btn",onClick:()=>this.isMobileMainVisible=!1},z("rtk-icon",{icon:this.iconPack.chevron_left})),z("h4",null,e)),"audio"===this.activeTab&&z("rtk-debugger-audio",Object.assign({},t)),"video"===this.activeTab&&z("rtk-debugger-video",Object.assign({},t)),"screenshare"===this.activeTab&&z("rtk-debugger-screenshare",Object.assign({},t)),"system"===this.activeTab&&i&&z("rtk-debugger-system",Object.assign({},t))))}};function tl({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 el({packetLossPercentage:t}){let e="Good";return t>4?e="Poor":t>=1&&t<=4&&(e="Average"),e}function il({jitterInMS:t}){let e="Good";return t>100?e="Poor":t>=50&&t<=100&&(e="Average"),e}function rl({bitrate:t}){let e="Good";return 0===Math.round(t/1024)&&(e="Poor"),e}function sl({batteryLevelPercentage:t}){let e="Good";return t<20?e="Poor":t<50&&(e="Average"),e}function al({charging:t,dischargingTimeInSeconds:e,batteryLevelPercentage:i}){return i<20?"Poor":t?"Good":e<1800?"Poor":"Average"}Xo([si()],Jo.prototype,"meeting",void 0),Xo([si()],Jo.prototype,"states",void 0),Xo([si()],Jo.prototype,"size",void 0),Xo([si()],Jo.prototype,"iconPack",void 0),Xo([si()],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;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 nl=function(t,e,i,r){var s,a=arguments.length,n=a<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--)(s=t[o])&&(n=(a<3?s(n):a>3?s(e,i,n):s(e,i))||n);return a>3&&n&&Object.defineProperty(e,i,n),n};const ol=class{constructor(t){o(this,t),this.iconPack=Ne,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:rl({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:el({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:il({jitterInMS:1e3*e.jitter})}),this.audioProducerFormattedStats=i,this.networkBasedMediaHealth=tl({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 z(G,null,z("div",{id:"header"}),z("div",{class:"tab-body"},z("div",{class:"status-container"},z("div",{class:"status-section"},z("div",{class:"section-header "+(this.networkBasedMediaHealth?"":"only-child")},z("span",null,this.t("debugger.audio.sections.network_media")),this.networkBasedMediaHealth&&z("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&&z("div",{class:"section-body missing-stats"},this.meeting.self.audioEnabled?z("span",null,this.t("debugger.audio.messages.generating_report")):z("span",null,this.t("debugger.audio.messages.enable_media"))),this.isNetworkOpen&&!!this.audioProducerFormattedStats.length&&z("div",{class:"section-body network-table"},this.audioProducerFormattedStats.map(t=>{var e,i;return z("div",{class:"network-row"},z("div",{class:"network-cell label"},z("strong",null,t.name),z("span",{class:"description"},t.description)),z("div",{class:"network-cell value"},z("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()}`)),z("span",{class:"value"},t.value)))}))))))}static get watchers(){return{audioProducerScoreStats:["audioProducerScoreStatsChanged"],meeting:["meetingChanged"]}}};nl([si()],ol.prototype,"meeting",void 0),nl([si()],ol.prototype,"states",void 0),nl([si()],ol.prototype,"size",void 0),nl([si()],ol.prototype,"iconPack",void 0),nl([si()],ol.prototype,"t",void 0),ol.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 ll=function(t,e,i,r){var s,a=arguments.length,n=a<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--)(s=t[o])&&(n=(a<3?s(n):a>3?s(e,i,n):s(e,i))||n);return a>3&&n&&Object.defineProperty(e,i,n),n};const cl=class{constructor(t){o(this,t),this.iconPack=Ne,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:rl({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:el({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:il({jitterInMS:1e3*e.jitter})}),this.videoProducerFormattedStats=i,this.networkBasedMediaHealth=tl({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:rl({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:el({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:il({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 z(G,null,z("div",{id:"header"}),z("div",{class:"tab-body"},z("div",{class:"status-container"},z("div",{class:"status-section"},z("div",{class:"section-header "+(this.networkBasedMediaHealth?"":"only-child")},z("span",null,this.t("debugger.screenshare.sections.network_media")),this.networkBasedMediaHealth&&z("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&&z("div",{class:"section-body missing-stats"},this.meeting.self.screenShareEnabled?z("span",null,this.t("debugger.screenshare.messages.generating_report")):z("span",null,this.t("debugger.screenshare.messages.enable_media"))),this.isNetworkOpen&&!!this.videoProducerFormattedStats.length&&z("div",{class:"section-body network-table"},this.videoProducerFormattedStats.map(t=>{var e,i;return z("div",{class:"network-row"},z("div",{class:"network-cell label"},z("strong",null,t.name),z("span",{class:"description"},t.description)),z("div",{class:"network-cell value"},z("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()}`)),z("span",{class:"value"},t.value)))}))))))}static get watchers(){return{videoProducerScoreStats:["videoProducerScoreStatsChanged"],audioProducerScoreStats:["audioProducerScoreStatsChanged"],meeting:["meetingChanged"]}}};ll([si()],cl.prototype,"meeting",void 0),ll([si()],cl.prototype,"states",void 0),ll([si()],cl.prototype,"size",void 0),ll([si()],cl.prototype,"iconPack",void 0),ll([si()],cl.prototype,"t",void 0),cl.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 dl=function(t,e,i,r){var s,a=arguments.length,n=a<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--)(s=t[o])&&(n=(a<3?s(n):a>3?s(e,i,n):s(e,i))||n);return a>3&&n&&Object.defineProperty(e,i,n),n};const hl=class{constructor(t){o(this,t),this.iconPack=Ne,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:sl({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:al({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 z(G,null,z("div",{id:"header"}),z("div",{class:"tab-body"},z("div",{class:"status-container"},z("div",{class:"status-section"},z("div",{class:"section-header",onClick:()=>this.toggleSection("battery")},z("span",null,this.t("debugger.system.sections.battery")),this.batterySectionHealth&&z("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&&z("div",{class:"section-body battery-table"},this.batteryFormattedStats.map(t=>{var e,i;return z("div",{class:"battery-row"},z("div",{class:"battery-cell label"},z("strong",null,t.name),z("span",{class:"description"},t.description)),z("div",{class:"battery-cell value"},z("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()}`)),z("span",{class:"value"},t.value)))}))))))}static get watchers(){return{meeting:["meetingChanged"]}}};dl([si()],hl.prototype,"meeting",void 0),dl([si()],hl.prototype,"states",void 0),dl([si()],hl.prototype,"size",void 0),dl([si()],hl.prototype,"iconPack",void 0),dl([si()],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{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 pl=function(t,e,i,r){var s,a=arguments.length,n=a<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--)(s=t[o])&&(n=(a<3?s(n):a>3?s(e,i,n):s(e,i))||n);return a>3&&n&&Object.defineProperty(e,i,n),n};const ul=class{constructor(t){o(this,t),this.iconPack=Ne,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:rl({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:el({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:il({jitterInMS:1e3*e.jitter})}),this.videoProducerFormattedStats=i,this.networkBasedMediaHealth=tl({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 z(G,null,z("div",{id:"header"}),z("div",{class:"tab-body"},z("div",{class:"status-container"},z("div",{class:"status-section"},z("div",{class:"section-header "+(this.networkBasedMediaHealth?"":"only-child")},z("span",null,this.t("debugger.video.sections.network_media")),this.networkBasedMediaHealth&&z("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&&z("div",{class:"section-body missing-stats"},this.meeting.self.videoEnabled?z("span",null,this.t("debugger.video.messages.generating_report")):z("span",null,this.t("debugger.video.messages.enable_media"))),this.isNetworkOpen&&!!this.videoProducerFormattedStats.length&&z("div",{class:"section-body network-table"},this.videoProducerFormattedStats.map(t=>{var e,i;return z("div",{class:"network-row"},z("div",{class:"network-cell label"},z("strong",null,t.name),z("span",{class:"description"},t.description)),z("div",{class:"network-cell value"},z("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()}`)),z("span",{class:"value"},t.value)))}))))))}static get watchers(){return{videoProducerScoreStats:["videoProducerScoreStatsChanged"],meeting:["meetingChanged"]}}};pl([si()],ul.prototype,"meeting",void 0),pl([si()],ul.prototype,"states",void 0),pl([si()],ul.prototype,"size",void 0),pl([si()],ul.prototype,"iconPack",void 0),pl([si()],ul.prototype,"t",void 0),ul.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 gl=function(t,e,i,r){var s,a=arguments.length,n=a<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--)(s=t[o])&&(n=(a<3?s(n):a>3?s(e,i,n):s(e,i))||n);return a>3&&n&&Object.defineProperty(e,i,n),n};const fl=class{constructor(t){o(this,t),this.onClose=W(this,"rtkDialogClose",7),this.hideCloseButton=!1,this.disableEscapeKey=!1,this.config=Ie,this.iconPack=Ne,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?z(G,null,z("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()}},z("slot",null),!this.hideCloseButton&&z("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"},z("rtk-icon",{icon:this.iconPack.dismiss})))):null}};gl([si()],fl.prototype,"meeting",void 0),gl([si()],fl.prototype,"states",void 0),gl([si()],fl.prototype,"size",void 0),gl([si()],fl.prototype,"iconPack",void 0),gl([si()],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)}: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 ml=function(t,e,i,r){var s,a=arguments.length,n=a<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--)(s=t[o])&&(n=(a<3?s(n):a>3?s(e,i,n):s(e,i))||n);return a>3&&n&&Object.defineProperty(e,i,n),n};const vl=class{constructor(t){o(this,t),this.stateUpdate=W(this,"rtkStateUpdate",7),this.config=Ie,this.iconPack=Ne,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 s={meeting:this.meeting,states:this.states,config:this.config,size:this.size,iconPack:this.iconPack,t:this.t},a=this.states;if(null!=(null==a?void 0:a.image)){const t=a.image,e=()=>{this.stateUpdate.emit({image:null})};return z(G,null,z("rtk-dialog",{open:!0,onRtkDialogClose:e,hideCloseButton:!0,iconPack:this.iconPack,t:this.t},z(rr,{element:"rtk-image-viewer",defaults:s,props:{image:t,onClose:e}})))}if(!0===(null==a?void 0:a.activeSettings))return z(G,null,z("rtk-dialog",{open:!0,onRtkDialogClose:()=>this.updateStoreState("activeSettings",!1),iconPack:this.iconPack,t:this.t},z(rr,{element:"rtk-settings",defaults:s})));if(!0===(null==a?void 0:a.activeDebugger))return z(G,null,z("rtk-dialog",{open:!0,onRtkDialogClose:()=>this.updateStoreState("activeDebugger",!1),iconPack:this.iconPack,t:this.t},z("rtk-debugger",Object.assign({},s))));if(!0===(null==a?void 0:a.activeLeaveConfirmation))return z(G,null,z("rtk-dialog",{open:!0,onRtkDialogClose:()=>this.updateStoreState("activeLeaveConfirmation",!1),iconPack:this.iconPack,t:this.t},z("rtk-leave-meeting",Object.assign({},s))));if(!0===(null===(t=null==a?void 0:a.activePermissionsMessage)||void 0===t?void 0:t.enabled))return z(G,null,z("rtk-dialog",{open:!0,hideCloseButton:!0,iconPack:this.iconPack,t:this.t},z("rtk-permissions-message",Object.assign({},s))));if(!0===(null===(e=null==a?void 0:a.activeBreakoutRoomsManager)||void 0===e?void 0:e.active))return z(G,null,z("rtk-dialog",{open:!0,onRtkDialogClose:()=>this.updateStoreState("activeBreakoutRoomsManager",{active:!1,data:void 0}),iconPack:this.iconPack,t:this.t},z("rtk-breakout-rooms-manager",Object.assign({},s))));if(!0===(null===(i=null==a?void 0:a.activeConfirmationModal)||void 0===i?void 0:i.active))return z(G,null,z("rtk-dialog",{open:!0,onRtkDialogClose:()=>this.updateStoreState("activeConfirmationModal",!1),iconPack:this.iconPack,t:this.t},z("rtk-confirmation-modal",Object.assign({},s))));if(!0===(null===(r=null==a?void 0:a.activeOverlayModal)||void 0===r?void 0:r.active))return z(G,null,z("rtk-overlay-modal",{meeting:this.meeting,states:this.states,iconPack:this.iconPack,t:this.t}));if(null==a?void 0:a.activeBroadcastMessageModal)return z(G,null,z("rtk-dialog",{open:!0,onRtkDialogClose:()=>this.updateStoreState("activeBroadcastMessageModal",!1),iconPack:this.iconPack,t:this.t},z("rtk-broadcast-message-modal",Object.assign({},s))));if(!0===(null==a?void 0:a.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 z(G,null,z("rtk-dialog",{open:!0,onRtkDialogClose:this.cancelJoinStage,iconPack:this.iconPack,t:this.t},z("rtk-join-stage",Object.assign({dataConfig:t,onRtkJoinStage:this.joinStage,onRtkLeaveStage:this.cancelJoinStage},s))))}return!0===(null==a?void 0:a.activeMuteAllConfirmation)?z(G,null,z("rtk-dialog",{open:!0,onRtkDialogClose:()=>{this.updateStoreState("activeMuteAllConfirmation",!1)},iconPack:this.iconPack,t:this.t},z("rtk-mute-all-confirmation",Object.assign({},s)))):(null==a?void 0:a.activeChannelCreator)?z(G,null,z("rtk-dialog",{open:!0,onRtkDialogClose:()=>{this.updateStoreState("activeChannelCreator",!1)},iconPack:this.iconPack,t:this.t},z("rtk-channel-creator",Object.assign({},s)))):null}static get watchers(){return{meeting:["meetingChanged"]}}};ml([si()],vl.prototype,"meeting",void 0),ml([si()],vl.prototype,"states",void 0),ml([si()],vl.prototype,"size",void 0),ml([si()],vl.prototype,"iconPack",void 0),ml([si()],vl.prototype,"t",void 0),vl.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 bl=function(t,e,i,r){var s,a=arguments.length,n=a<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--)(s=t[o])&&(n=(a<3?s(n):a>3?s(e,i,n):s(e,i))||n);return a>3&&n&&Object.defineProperty(e,i,n),n};const kl=class{constructor(t){o(this,t),this.onDeleteAttachment=W(this,"deleteAttachment",7),this.iconPack=Ne,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 z(G,{key:"bf052df6f3c49b6a52b3002a8ed92bae6cbd7b06"},z("div",{key:"786126525fd361e17ec716615da402f11b5f5d1d",class:"preview-overlay"},z("div",{key:"1d89de4184961ebc4c8822aa016394706d37b2ba",class:"preview"},z("rtk-tooltip",{key:"87177c3ff98e59097c02bfcc397c13b68952199c",label:this.t("chat.cancel_upload")},z("rtk-button",{key:"f2a2ce338be78a7572c6a819ee5a75a9521f73b0",variant:"secondary",kind:"icon",onClick:this.onDeleteClickHandler},z("rtk-icon",{key:"12b0d383efb984307eba05ccdb783a8bd9c2d636",icon:this.iconPack.dismiss}))),"image"===this.attachment.type?z("img",{class:"preview-image",src:this.filePreview}):z("div",{class:"preview-file"},z("span",null,this.filePreview)))))}static get watchers(){return{attachment:["onAttachmentChange"]}}};bl([si()],kl.prototype,"iconPack",void 0),bl([si()],kl.prototype,"t",void 0),kl.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 yl;var wl=function(t,e,i,r){var s,a=arguments.length,n=a<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--)(s=t[o])&&(n=(a<3?s(n):a>3?s(e,i,n):s(e,i))||n);return a>3&&n&&Object.defineProperty(e,i,n),n};const xl=class{constructor(t){o(this,t),this.pickerClose=W(this,"pickerClose",7),this.emojiClicked=W(this,"rtkEmojiClicked",7),this.iconPack=Ne,this.t=Fe(),this.focusWhenOpened=!0,this.filterVal="",this.filteredEmojis=[]}componentWillLoad(){(async()=>{if(!yl){const t=await fetch("https://cdn.dyte.in/assets/emojis-data.json");yl=t.json()}return yl})().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?z("div",{id:"loader"},z("rtk-spinner",{iconPack:this.iconPack})):z("div",{id:"emoji-grid",class:"scrollbar max-w-40"},this.filteredEmojis.map(t=>z("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 z(G,{key:"989c0508bb88941926f29091895707e7b4a3e139"},z("div",{key:"83a90c6b73ca11fb6e864a59362d15bf83391d20",class:"close-parent"},z("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")},z("rtk-icon",{key:"cacfe97be0590e840d332fc9197bb473fef22d9f",icon:this.iconPack.dismiss}))),z("div",{key:"461a263d19a60547aff16689d3c6f4f31aea8a3a",class:"emoji-parent"},z("input",{key:"c9a111769b48d5ff12ac48d8c172a8d3f371df2c",value:this.filterVal,onInput:t=>this.handleInputChange(t.target),placeholder:this.t("search"),ref:t=>this.inputElement=t}),this.mapEmojiList()))}};wl([si()],xl.prototype,"iconPack",void 0),wl([si()],xl.prototype,"t",void 0),xl.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 Sl=function(t,e,i,r){var s,a=arguments.length,n=a<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--)(s=t[o])&&(n=(a<3?s(n):a>3?s(e,i,n):s(e,i))||n);return a>3&&n&&Object.defineProperty(e,i,n),n};const El=class{constructor(t){o(this,t),this.iconPack=Ne,this.t=Fe()}render(){return z("rtk-tooltip",{key:"5edf35e2100be583f2be4feadaa3b3149f9c8962",label:this.t("chat.send_emoji")},z("rtk-button",{key:"00bfc269a700ab10955a627095aac31b64d8a28e",variant:"ghost",kind:"icon",class:{active:this.isActive},title:this.t("chat.send_emoji")},z("rtk-icon",{key:"47bd54c1593f7f5ea04eb96ccbca07ea3c22e511",icon:this.iconPack.emoji_multiple})))}};Sl([si()],El.prototype,"iconPack",void 0),Sl([si()],El.prototype,"t",void 0),El.style=":host{}";var Pl=function(t,e,i,r){var s,a=arguments.length,n=a<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--)(s=t[o])&&(n=(a<3?s(n):a>3?s(e,i,n):s(e,i))||n);return a>3&&n&&Object.defineProperty(e,i,n),n};const Tl=class{constructor(t){o(this,t),this.now=new Date,this.isContinued=!1,this.iconPack=Ne,this.t=Fe(),this.showBubble=!1}render(){const t=Je(this.message.link);return z(G,{key:"25ff2cd29b951ffee9fb266ec4937258db527ef4"},!this.isContinued&&z(Xi,{key:"50dc45f56ac2837215619c597f557c0e71e5fd85",name:this.message.displayName,time:this.message.time,now:this.now}),z("div",{key:"5b300ea679f835b6d7421568dde80aa38cbbc821",class:{body:!0,bubble:this.showBubble},part:"body"},z("div",{key:"895f033df99c8d9dfc1241bbaf5f20137b905395",class:"file"},z("div",{key:"345bd0370a81c50c1ef46fa7119fa321213ad741",class:"file-data"},z("div",{key:"fb30c6c130af584d2f4294029c4304e213ddd339",class:"name"},this.message.name),z("div",{key:"d0de234e1697b196fe248bbfbad18109b59c20df",class:"file-data-split"},z("div",{key:"635343bd7dbcbfeea1a7534c943be355decf20c4",class:"ext"},sr(this.message.name)),z("span",{key:"bd7772e273ae55297c99d8564cfa44e6dd1b43d0",class:"divider"}),z("div",{key:"d6df3a4fca8932d3bcdeb805ef7b3bed1c3e8c15",class:"size"},ar(this.message.size)))),z("rtk-button",{key:"4b4d9be6f228e5deda5590f2aa6038b3501623d7",variant:"secondary",kind:"icon",onClick:()=>nr(t,{name:this.message.name,fallbackName:"file"}),part:"button"},z("rtk-icon",{key:"187e0b8f903bd7cd8b5f9e25ef2d6841299fe87f",icon:this.iconPack.download})))))}};Pl([si()],Tl.prototype,"iconPack",void 0),Pl([si()],Tl.prototype,"t",void 0);const Ll=class{constructor(t){o(this,t),this.iconPack=Ne}render(){return z("div",{key:"7bc636599452b840ae0a5467fcf579a883a98727",class:"file"},z("rtk-button",{key:"98bfff6ca8aa598d296ff1f3b39994f8b839572c",variant:"secondary",kind:"icon",onClick:()=>nr(Je(this.url),{name:this.name,fallbackName:"file"}),part:"button"},z("rtk-icon",{key:"26b9fe1b7e884ffa993e988eb94e18351eec8c25",icon:this.iconPack.download})),z("div",{key:"c3d045925ef1a13039c44624930b96cd326d769f",class:"file-data"},z("div",{key:"619e9cd8f72f342e31c334586e44813e2d3216ba",class:"name"},this.name),z("div",{key:"71b788c2a10c8a7290da1f77d82c6b6e66746223",class:"file-data-split"},z("div",{key:"550720228247cdaf766a84938df720bf95249bf5",class:"ext"},sr(this.name)),z("span",{key:"2bb1940a95e5e06ec8a064a775ea2257ff80fcc7",class:"divider"}),z("div",{key:"e5451bcd50b3e05d90b149a98b7c328711025827",class:"size"},ar(this.size)))))}};!function(t,e,i,r){var s,a=arguments.length,n=a<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--)(s=t[o])&&(n=(a<3?s(n):a>3?s(e,i,n):s(e,i))||n);a>3&&n&&Object.defineProperty(e,i,n)}([si()],Ll.prototype,"iconPack",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)}.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 Cl=function(t,e,i,r){var s,a=arguments.length,n=a<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--)(s=t[o])&&(n=(a<3?s(n):a>3?s(e,i,n):s(e,i))||n);return a>3&&n&&Object.defineProperty(e,i,n),n};const _l=class{constructor(t){o(this,t),this.onFileChange=W(this,"fileChange",7),this.icon="attach",this.iconPack=Ne,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 z("rtk-tooltip",{key:"ea570679bd495c1230a563d08496211e57645797",label:t},z("rtk-button",{key:"894429d9abc652daf0d897fe3757b3a81dc06da2",variant:"ghost",kind:"icon",onClick:()=>this.uploadFile(),title:t},z("rtk-icon",{key:"12f9e9a114accb42178da6663f85cac8a3cf70e2",icon:e})))}};Cl([si()],_l.prototype,"iconPack",void 0),Cl([si()],_l.prototype,"t",void 0),_l.style=":host{}";const Al=t=>{try{return JSON.parse(t)}catch(e){return t}},Rl=class{constructor(t){o(this,t),this.variant="primary",this.size="lg"}render(){return z(G,{key:"cc3de7d3c31d52bdc3c38891920f0f8b08c6fd2f"},z("div",{key:"e5a1487a5eb1e37272190a61300db415f12e8189",class:"icon-wrapper",innerHTML:Al(this.icon),part:"wrapper"}))}};!function(t,e,i,r){var s,a=arguments.length,n=a<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--)(s=t[o])&&(n=(a<3?s(n):a>3?s(e,i,n):s(e,i))||n);a>3&&n&&Object.defineProperty(e,i,n)}([si()],Rl.prototype,"size",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;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 Il=function(t,e,i,r){var s,a=arguments.length,n=a<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--)(s=t[o])&&(n=(a<3?s(n):a>3?s(e,i,n):s(e,i))||n);return a>3&&n&&Object.defineProperty(e,i,n),n};const Dl=class{constructor(t){o(this,t),this.stateUpdate=W(this,"rtkStateUpdate",7),this.now=new Date,this.isContinued=!1,this.iconPack=Ne,this.t=Fe(),this.showBubble=!1,this.status="loading"}render(){return z(G,{key:"60b7d1f3569a3bd335b7db047ef5f5a7b8fa518c"},!this.isContinued&&z(Xi,{key:"e897d7239be3ba0a2594f5c6285cc5a5fd553375",name:this.message.displayName,time:this.message.time,now:this.now}),z("div",{key:"f99332c642a51af6d4ab20eff1654826479b420b",class:{body:!0,bubble:this.showBubble},part:"body"},z("div",{key:"667e081aff8edd5792cc2b0fac09d83d6520d6a7",class:{image:!0,loaded:"loaded"===this.status}},z("img",{key:"f079a0f75038bdf6a83e450bfdb68ab84d6f1663",src:Je(this.message.link),onLoad:()=>{this.status="loaded"},onError:()=>{this.status="errored"},onClick:()=>{"loaded"===this.status&&this.stateUpdate.emit({image:this.message})}}),"loading"===this.status&&z("div",{key:"00968152adade14971180db8df90553a17aaaaa8",class:"image-spinner",title:this.t("chat.img.loading"),"aria-label":this.t("chat.img.loading")},z("rtk-spinner",{key:"0e236fd24f70e5dfbd5528d1198c9ecf7f2f4888",iconPack:this.iconPack})),"errored"===this.status&&z("div",{key:"8cd94804cb58c23c9c4636e7d8e14e3121b3e169",class:"image-errored",title:this.t("chat.error.img_not_found"),"aria-label":this.t("chat.error.img_not_found")},z("rtk-icon",{key:"625d50f65dfbd6af0f2061d96b5332452b060a12",icon:this.iconPack.image_off})),"loaded"===this.status&&z("div",{key:"4a5105c9deef32a5526d5adf8f6075230a09a90f",class:"actions"},z("rtk-button",{key:"f8519c23a87d30909451ceaf9c874b6b5258f4cb",class:"action",variant:"secondary",kind:"icon",onClick:()=>{this.stateUpdate.emit({image:this.message})}},z("rtk-icon",{key:"3b8e52922b59e9f75f8a25bc9605f4d044b7981c",icon:this.iconPack.full_screen_maximize})),z("rtk-button",{key:"dc2703a02f091383498eaddfdcdf148e93471a88",class:"action",variant:"secondary",kind:"icon",onClick:()=>nr(this.message.link,{fallbackName:"image"})},z("rtk-icon",{key:"1d9c9406e7937c64c93d77d685e86c3d1def4ec1",icon:this.iconPack.download}))))))}};Il([si()],Dl.prototype,"iconPack",void 0),Il([si()],Dl.prototype,"t",void 0),Dl.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 Ml=function(t,e,i,r){var s,a=arguments.length,n=a<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--)(s=t[o])&&(n=(a<3?s(n):a>3?s(e,i,n):s(e,i))||n);return a>3&&n&&Object.defineProperty(e,i,n),n};const Ol=class{constructor(t){o(this,t),this.onPreview=W(this,"preview",7),this.iconPack=Ne,this.t=Fe(),this.status="loading"}render(){return z("div",{key:"9d7c32348bb52dc60533d9d99cfbd4099d89fad0",class:{image:!0,loaded:"loaded"===this.status}},z("img",{key:"1c66e60f69842cc1c372545759201ae8e70cbfe8",src:Je(this.url),onLoad:()=>{this.status="loaded"},onError:()=>{this.status="errored"},onClick:()=>{"loaded"===this.status&&this.onPreview.emit(this.url)}}),"loading"===this.status&&z("div",{key:"ee5cce91357ec2974c691ea95faacc78db9fa796",class:"image-spinner",title:this.t("chat.img.loading"),"aria-label":this.t("chat.img.loading")},z("rtk-spinner",{key:"3c9236319042a7b9c5ff45dd196b4e14c38a7b0a",iconPack:this.iconPack})),"errored"===this.status&&z("div",{key:"a176782a3ea63795ed154d8bf4cc3342cb20cd32",class:"image-errored",title:this.t("chat.error.img_not_found"),"aria-label":this.t("chat.error.img_not_found")},z("rtk-icon",{key:"4d4275e21b280a3b981634a8da7b2d752a620be1",icon:this.iconPack.image_off})),"loaded"===this.status&&z("div",{key:"ca5468642912ad5407e3b828083b6e3f232b42e5",class:"actions"},z("rtk-button",{key:"3b8a485a435023cb9819d98541cd9b1f40a96911",class:"action",variant:"secondary",kind:"icon",onClick:()=>{this.onPreview.emit(this.url)}},z("rtk-icon",{key:"31e7ff096ca3e1db148f2808ad79aa79f56fa91e",icon:this.iconPack.full_screen_maximize})),z("rtk-button",{key:"a1de648d80f8ac6d4d2197f0148e9708123434f3",class:"action",variant:"secondary",kind:"icon",onClick:()=>nr(this.url,{fallbackName:"image"})},z("rtk-icon",{key:"4a06af4520a81fce102397907b66202a18f0c191",icon:this.iconPack.download}))))}};Ml([si()],Ol.prototype,"iconPack",void 0),Ml([si()],Ol.prototype,"t",void 0),Ol.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 Ul=function(t,e,i,r){var s,a=arguments.length,n=a<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--)(s=t[o])&&(n=(a<3?s(n):a>3?s(e,i,n):s(e,i))||n);return a>3&&n&&Object.defineProperty(e,i,n),n};const $l=class{constructor(t){o(this,t),this.stateUpdate=W(this,"rtkStateUpdate",7),this.joinStage=W(this,"rtkJoinStage",7),this.leaveStage=W(this,"rtkLeaveStage",7),this.config=Ie,this.iconPack=Ne,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 z(G,{key:"5adc039e20d21d089d3b34bb67d046387c46db06",class:{stage:!0}},z("header",{key:"43d3a4d1f004ae347fa8297b808ee9318b6a6a91"},z("h2",{key:"bdd9070ea15b136717ae060f86b46a32adbfcc99"},this.dataConfig.title)),z(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}),z("div",{key:"b464fd360e42c6201f6e2cbed7107c4410648a7e",class:"summary"},this.dataConfig.description),z("div",{key:"760a61c9d4b8284408a56818bd0d715d05bee9e6",class:"container"},z("rtk-button",{key:"4b23c3a442fed701f66f600a1bbd1633c4036ae2",variant:"secondary",onClick:()=>this.leaveStage.emit(),title:this.dataConfig.label.reject},this.dataConfig.label.reject),z("rtk-button",{key:"8f7745aba52c737a57c2158ae23eb17f32d7b56e",onClick:()=>{this.isLoading||(this.isLoading=!0,this.joinStage.emit())},title:this.dataConfig.label.accept},this.isLoading?z("rtk-icon",{icon:this.iconPack.spinner}):this.dataConfig.label.accept)))}};Ul([si()],$l.prototype,"meeting",void 0),Ul([si()],$l.prototype,"states",void 0),Ul([si()],$l.prototype,"size",void 0),Ul([si()],$l.prototype,"iconPack",void 0),Ul([si()],$l.prototype,"t",void 0),$l.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 Fl=function(t,e,i,r){var s,a=arguments.length,n=a<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--)(s=t[o])&&(n=(a<3?s(n):a>3?s(e,i,n):s(e,i))||n);return a>3&&n&&Object.defineProperty(e,i,n),n};const Nl=class{constructor(t){o(this,t),this.stateUpdate=W(this,"rtkStateUpdate",7),this.keyPressListener=t=>{"Escape"===t.key&&this.close()},this.iconPack=Ne,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 z(G,{key:"d6e7a2eba47854f5f3da4008137081383769d159"},z("div",{key:"afffb6ce1dd2b38dd3cf2731723dbd0c8e68e046",class:"leave-modal"},z("div",{key:"f60a1660e94307fdf36e5e52a513648adc741aa5",class:"header"},z("h2",{key:"5e80bd3031ed95929d6560e79e5edfcca607b169",class:"title"},this.t("leave"))),z("p",{key:"adfd75ca8e0408f90687f39de5de3b237378deb0",class:"message"},this.isBreakoutRoomsActive&&this.isChildMeeting?this.t("breakout_rooms.leave_confirmation"):this.t("leave_confirmation")),z("div",{key:"395b4f29350512c4c9d512984482bb934aadf983",class:"content"},z("rtk-button",{key:"85adbf49f8ae02e05e16a349c99152b525ff6520",variant:"secondary",onClick:this.close,class:"secondary-btn"},this.t("cancel")),this.isBreakoutRoomsActive&&this.isChildMeeting&&this.canJoinMainRoom&&z("rtk-button",{key:"6a965a9e4cad6f07624c7ac5255207b7b021b47c",variant:"secondary",onClick:this.handleJoinMainRoom,class:"secondary-btn"},this.t("breakout_rooms.leave_confirmation.main_room_btn")),z("rtk-button",{key:"41050c3895eeab4edc56742799505790d881cad9",variant:"danger",title:this.t("leave"),onClick:this.handleLeave},this.t("leave")),this.canEndMeeting&&z("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"]}}};Fl([si()],Nl.prototype,"meeting",void 0),Fl([si()],Nl.prototype,"states",void 0),Fl([si()],Nl.prototype,"iconPack",void 0),Fl([si()],Nl.prototype,"t",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)}.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 jl=function(t,e,i,r){var s,a=arguments.length,n=a<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--)(s=t[o])&&(n=(a<3?s(n):a>3?s(e,i,n):s(e,i))||n);return a>3&&n&&Object.defineProperty(e,i,n),n};const zl=class{constructor(t){o(this,t),this.config=Ie,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,s;if(null!=t){const a=null===(s=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===s?void 0:s.logo;null!=a&&null==this.logoUrl&&(this.logoUrl=a)}}render(){if(!this.logoUrl||""===this.logoUrl)return null;const t=this.logoUrl,e=this.t("logo");return z(G,{class:"loaded"},z("img",{src:t,alt:e}))}static get watchers(){return{config:["configChanged"],meeting:["meetingChanged"]}}};jl([si()],zl.prototype,"meeting",void 0),jl([si()],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{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 Bl=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=>z("a",{class:"link",href:t,target:"_blank",rel:"noopener noreferrer"},t),this.renderBold=t=>"string"==typeof t?this.restoreEmpty(t,"*",t=>z("b",null,t)):z("b",null,this.renderTokens(t)),this.renderItalic=t=>"string"==typeof t?this.restoreEmpty(t,"_",t=>z("i",null,t)):z("i",null,this.renderTokens(t)),this.renderStrikethrough=t=>"string"==typeof t?this.restoreEmpty(t,"~",t=>z("s",null,t)):z("b",null,this.renderTokens(t)),this.renderPlainText=t=>"string"==typeof t?t:z("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 z("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 z("p",null,this.renderTokens(e))});return i?z("pre",{style:{whiteSpace:"pre",overflow:"scroll"}},e.join("\n")):r}render(){const t=this.text.slice(0,this.maxLength),e=Gi(t,!0),i=Hi(t);return z("p",{key:"0edda34be90038b70316ff2732939a7ea42f2b30"},0!==e.length&&z("blockquote",{key:"c58ade9478aee1080c922c29245509dc94672fc4"},this.renderMessage(e)),0!==i.length&&this.renderMessage(i))}};Bl.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 Gl=function(t,e,i,r){var s,a=arguments.length,n=a<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--)(s=t[o])&&(n=(a<3?s(n):a>3?s(e,i,n):s(e,i))||n);return a>3&&n&&Object.defineProperty(e,i,n),n};const Hl=class{constructor(t){o(this,t),this.statesUpdate=W(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=Ie,this.gridLayout="row",this.iconPack=Ne,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 Ma(()=>this.handleResize()),this.resizeObserver.observe(this.host),this.applyDesignSystem&&null!=(null===(t=this.config)||void 0===t?void 0:t.designTokens)&&"undefined"!=typeof document&&Us(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:s}=ca(i,t);this.config===Ie&&(this.config=r),null==this.showSetupScreen&&(this.showSetupScreen=s.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&&Us(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=pa(this.host.clientWidth)}updateStates(t){const e=Object.assign({},Ze.states);Ze.states=la(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 z("rtk-chat",Object.assign({},t));const e={"rtk-grid":{layout:this.gridLayout}};return z(rr,{element:"rtk-meeting",defaults:t,asHost:!0,elementProps:e})}get host(){return Y(this)}static get watchers(){return{meeting:["meetingChanged"]}}};Gl([si()],Hl.prototype,"meeting",void 0),Gl([si()],Hl.prototype,"t",void 0),Gl([si()],Hl.prototype,"iconPack",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)}: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 Vl=function(t,e,i,r){var s,a=arguments.length,n=a<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--)(s=t[o])&&(n=(a<3?s(n):a>3?s(e,i,n):s(e,i))||n);return a>3&&n&&Object.defineProperty(e,i,n),n};const ql=class{constructor(t){o(this,t),this.clickedThis=!1,this.placement="bottom-end",this.offset=10,this.iconPack=Ne,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(){ho(this.triggerEl,this.menuListEl,{placement:this.placement,middleware:[so(this.offset),oo(),no({padding:5})]}).then(({x:t,y:e})=>{Object.assign(this.menuListEl.style,{left:`${t}px`,top:`${e}px`})})}render(){return z(G,{key:"b276110eb5171b15f815bfe7a96663e01f899e96"},z("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"}},z("slot",{key:"e287328ba8515ddd37a21645aef25e83e6484e6b",name:"trigger"})),z("span",{key:"cc7025445296778b3dd0ad3eceb24b03eb0c2924",part:"menu-list",id:"menu-list",ref:t=>this.menuListEl=t},z("slot",{key:"0d26db850bffc2cdf9b4142fdfa2f4113d180078"})))}};Vl([si()],ql.prototype,"size",void 0),Vl([si()],ql.prototype,"iconPack",void 0),Vl([si()],ql.prototype,"t",void 0),ql.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 Kl=function(t,e,i,r){var s,a=arguments.length,n=a<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--)(s=t[o])&&(n=(a<3?s(n):a>3?s(e,i,n):s(e,i))||n);return a>3&&n&&Object.defineProperty(e,i,n),n};const Yl=class{constructor(t){o(this,t),this.iconPack=Ne,this.t=Fe()}render(){return z(G,{key:"16f2f9a4030f6d6b48345af4cfdb3f55c1eee39e"},z("slot",{key:"82c4020f63a6cbf773ecee8493f3fcc6a61c3c61",name:"start"}),z("slot",{key:"55f0449e84f1833a7ef6ddb2c9d995408f0ddef3"}),z("slot",{key:"e826a0992e53227fd3fd517bbb2684f34fed3e8c",name:"end"}))}};Kl([si()],Yl.prototype,"size",void 0),Kl([si()],Yl.prototype,"iconPack",void 0),Kl([si()],Yl.prototype,"t",void 0),Yl.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 Wl=function(t,e,i,r){var s,a=arguments.length,n=a<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--)(s=t[o])&&(n=(a<3?s(n):a>3?s(e,i,n):s(e,i))||n);return a>3&&n&&Object.defineProperty(e,i,n),n};const Zl=class{constructor(t){o(this,t),this.iconPack=Ne,this.t=Fe()}render(){return z(G,{key:"53cfa1381ea1c0bdfe99362f56cc505bff492774"},z("slot",{key:"fffe3a71f857c152d6619514d875893b5899b956"}))}};Wl([si()],Zl.prototype,"iconPack",void 0),Wl([si()],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{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 Ql=class{constructor(t){o(this,t),this.onAction=W(this,"action",7),this.actions=[],this.variant="bubble",this.viewType="outgoing",this.hideAvatar=!1,this.hideAuthorName=!1,this.hideMetadata=!1,this.iconPack=Ne}renderActions(){return z("rtk-menu",{placement:"top-end",offset:1},z("button",{slot:"trigger",class:"actions"},z("rtk-icon",{icon:this.iconPack.chevron_down})),z("rtk-menu-list",null,this.actions.map(t=>z("rtk-menu-item",{onClick:()=>this.onAction.emit(t.id)},t.icon&&z("rtk-icon",{icon:t.icon,slot:"start"}),t.label))))}render(){return z(G,{key:"fb4680e38de79ad40507a542c09d0b02c4691ded"},z("div",{key:"f6768fd2ea535e35ad86fc92d7f4595a503fdcca",class:{"message-wrapper":!0,[this.viewType]:!0}},!this.hideAvatar&&z("aside",{key:"a524e142b020ea1d528ca57f984bb6e725b59893",class:"avatar",part:"avatar"},z("rtk-avatar",{key:"ee56623f64d2bb3f74ebea3357eb1af9d67cd3a3",participant:{name:this.authorName,picture:this.avatarUrl},size:"sm"})),z("div",{key:"d6f5bb18ee7aa2ad174cd03c3aee4b9a94c3e63e",class:"message",part:"message"},!this.hideAuthorName&&z("div",{key:"338d4801d1ac9ce6a4dd3676148cac3c70f3b39f",class:"header"},this.authorName),z("div",{key:"86d147a38d6582979a94536df63213730becc572",class:{body:!0,bubble:"bubble"===this.variant}},z("slot",{key:"23a3984240643508ef10d3f2c0af5276e4cb5687"}),!this.hideMetadata&&!!this.time&&z("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 s,a=arguments.length,n=a<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--)(s=t[o])&&(n=(a<3?s(n):a>3?s(e,i,n):s(e,i))||n);a>3&&n&&Object.defineProperty(e,i,n)}([si()],Ql.prototype,"iconPack",void 0),Ql.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 Xl=function(t,e,i,r){var s,a=arguments.length,n=a<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--)(s=t[o])&&(n=(a<3?s(n):a>3?s(e,i,n):s(e,i))||n);return a>3&&n&&Object.defineProperty(e,i,n),n};const Jl=class{constructor(t){o(this,t),this.stateUpdate=W(this,"rtkStateUpdate",7),this.iconPack=Ne,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 z(G,{key:"199f56583843ca5b4e68f6a087471983c231983b"},z("div",{key:"86b15ff17b5a9526df77d2bc9f1d1e2d938c71c4",class:"leave-modal"},z("div",{key:"7f19f8d34586e3f8ee4661556e5f4c744facb4e8",class:"header"},z("h2",{key:"93adfa1d849b0aa3e483c280d1078d99ac1ef73c",class:"title"},this.t("mute_all.header"))),z("p",{key:"7532426538ef8de6280cf0246126061bff639209",class:"message"},this.t("mute_all.description")),z("div",{key:"14f577e917ecbf867afe2e6a4f94b86122d95496",class:"content"},z("div",{key:"2cbe2cea5befa86328d786aa3420af04bda0097e",class:"leave-meeting"},z("rtk-button",{key:"27b26964264a4c569ef7388357623ed97dff7bdb",variant:"secondary",title:this.t("close"),onClick:this.onClose},this.t("cancel")),z("rtk-button",{key:"dba570b9e72a21c0b76957cac4809f61878645d3",variant:"danger",title:this.t("mute_all"),onClick:this.onMuteAll},this.t("mute_all"))))))}};Xl([si()],Jl.prototype,"meeting",void 0),Xl([si()],Jl.prototype,"states",void 0),Xl([si()],Jl.prototype,"iconPack",void 0),Xl([si()],Jl.prototype,"t",void 0),Jl.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 tc=function(t,e,i,r){var s,a=arguments.length,n=a<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--)(s=t[o])&&(n=(a<3?s(n):a>3?s(e,i,n):s(e,i))||n);return a>3&&n&&Object.defineProperty(e,i,n),n};const ec=class{constructor(t){o(this,t),this.dismiss=W(this,"rtkNotificationDismiss",7),this.iconPack=Ne,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 z(G,{key:"b6a7ede34064bcc25040589cd09b00a5e5a5cf8a"},z("div",{key:"42608dc49ec59c0c54be513e59b81627f0ecb11c",class:"ctr"},null!=this.notification.icon&&z("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&&z("img",{key:"0e8d7812bd8b58ce0efe3edff6ae7346cbcd0fd4",src:this.notification.image,class:{loaded:"loaded"===this.imageState},onLoad:()=>this.imageState="loaded",onError:()=>this.imageState="errored"}),z("p",{key:"f28ec5ff1a3902817d5501ea2324371defc8995a",class:"message"},z(uo,{key:"7f7b179a67d125585ed70112fcb2a1925c3bae52",message:this.notification.message})),z("div",{key:"2ba60b2b60ddbc43d207adc86e0a975f3c432f70",class:"right"},null!=this.notification.button&&z("rtk-button",{key:"2f4871b0ee2871cbccb016e4451e28c424fe14ce",size:"sm",variant:this.notification.button.variant,onClick:()=>this.notification.button.onClick()},this.notification.button.text),z("button",{key:"1786dac10dbc2ca9aabad707354ce16fe1af9bc8",onClick:()=>this.dismiss.emit(this.notification.id),class:"dismiss"},z("rtk-icon",{key:"b11c47705af86c38bd6488ecb6998aad62099396","aria-label":this.t("dismiss"),icon:this.iconPack.dismiss})))))}static get watchers(){return{paused:["pausedChanged"],notification:["notificationChanged"]}}};tc([si()],ec.prototype,"size",void 0),tc([si()],ec.prototype,"iconPack",void 0),tc([si()],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{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-2, 8px);max-width:var(--rtk-space-72, 288px) !important;font-size:14px !important;overflow:hidden !important;display:-webkit-box !important;-webkit-box-orient:vertical !important;-webkit-line-clamp:2 !important}.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 ic=2e3,rc=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:ic,polls:ic,webinar:ic,tab_sync:ic,recording_started:ic,recording_stopped:ic},participant_joined_sound_notification_limit:10,participant_chat_message_sound_notification_limit:10});var sc=function(t,e,i,r){var s,a=arguments.length,n=a<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--)(s=t[o])&&(n=(a<3?s(n):a>3?s(e,i,n):s(e,i))||n);return a>3&&n&&Object.defineProperty(e,i,n),n};function ac(t){return Object.keys(t).filter(e=>t[e])}const nc=class{constructor(t){o(this,t),this.permissions=rc,this.enabledSounds=ac(rc.notification_sounds),this.config=Ie,this.t=Fe(),this.iconPack=Ne,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:ic}):"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:ic})},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,s,a,n,o,l;const c="LIVESTREAM"===t.meta.viewType;(c&&"ON_STAGE"===(null===(e=t.stage)||void 0===e?void 0:e.status)||!c)&&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===(s=t.stage)||void 0===s||s.removeListener("stageRequestApproved",this.stageRequestAccepted)),this.stageRequestRejected&&(null===(a=t.stage)||void 0===a||a.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===(l=t.recording)||void 0===l||l.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,s,a,n,o,l,c,d;if(clearTimeout(this.disconnectTimeout),void 0!==e&&this.clearListeners(e),null==t)return;const h="LIVESTREAM"===t.meta.viewType;this.audio=new fo(t);const{notifications:p,notification_duration:u,notification_sounds:g}=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:u.participant_joined}),g.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:u.participant_left}),g.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:u.participant_joined_waitlist,button:{text:this.t("notifications.accept"),variant:"primary",onClick:async()=>{await this.meeting.participants.acceptWaitingRoomRequest(t.id),this.remove(e)}}}),g.participant_joined_waitlist&&this.canPlayParticipantJoinedSound()&&this.audio.play("message")},this.waitlistedParticipantLeftListener=t=>{this.remove(`${t.id}-joined-waitlist`)},this.chatUpdateListener=({message:e})=>{const i=Ai(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:u.chat}),g.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:u.polls}),g.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:u.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:u.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:u.webinar,button:{text:this.t("notifications.accept"),variant:"primary",onClick:async()=>{await this.meeting.stage.grantAccess([t.userId]),this.remove(`stage-request-${t.id}`)}}}),g.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:u.webinar}),g.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===(s=t.stage)||void 0===s||s.on("stageStatusUpdate",this.stageStatusUpdateListener):this.addStagePeersListeners(t),this.canAcceptWaitingRequests()&&(t.participants.waitlisted.addListener("participantJoined",this.waitlistedParticipantJoinedListener),t.participants.waitlisted.addListener("participantLeft",this.waitlistedParticipantLeftListener)),null===(a=t.polls)||void 0===a||a.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===(l=t.stage)||void 0===l||l.addListener("stageRequestApproved",this.stageRequestAccepted),null===(c=t.stage)||void 0===c||c.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({},rc);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=ac(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:ic,icon:this.iconPack.warning})}sendNotificationListener({detail:t}){const{trace:e,message:i}=t;this.add({id:e,message:i,duration:ic})}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(()=>{P(()=>{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 z(G,{key:"906188de5f85fcdb91e7bbd9fc44c60f722ec231"},z("div",{key:"971924ad071ffa9525984eac3f11e929d10ec8a2",onMouseEnter:()=>this.paused=!0,onFocusin:()=>this.paused=!0,onMouseLeave:()=>this.paused=!1,onFocusout:()=>this.paused=!1},this.notifications.map(t=>z("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 Y(this)}static get watchers(){return{meeting:["meetingChanged"],config:["configChanged"],states:["statesChanged"]}}};sc([si()],nc.prototype,"meeting",void 0),sc([si()],nc.prototype,"states",void 0),sc([si()],nc.prototype,"t",void 0),sc([si()],nc.prototype,"size",void 0),sc([si()],nc.prototype,"iconPack",void 0),nc.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 oc=function(t,e,i,r){var s,a=arguments.length,n=a<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--)(s=t[o])&&(n=(a<3?s(n):a>3?s(e,i,n):s(e,i))||n);return a>3&&n&&Object.defineProperty(e,i,n),n};const lc=class{constructor(t){o(this,t),this.stateUpdate=W(this,"rtkStateUpdate",7),this.iconPack=Ne,this.t=Fe()}connectedCallback(){this.states.activeOverlayModal.timeout&&setTimeout(()=>{this.stateUpdate.emit({activeOverlayModal:{active:!1}})},this.states.activeOverlayModal.timeout)}render(){return z(G,{key:"e5bdb94d07093b7b6950c5d389b3cca3c5f0bc22"},z("rtk-icon",{key:"04dcace07d18e31644bb11215c069eb63ea8dfe6",icon:this.states.activeOverlayModal.icon}),z("h2",{key:"5ca79bee28c169a489a83e53e0911e6187c731f2"},this.states.activeOverlayModal.title),z("p",{key:"d4d7e34a08e991709b1931ce22c899dcc624c692"},this.states.activeOverlayModal.description))}};oc([si()],lc.prototype,"meeting",void 0),oc([si()],lc.prototype,"states",void 0),oc([si()],lc.prototype,"iconPack",void 0),oc([si()],lc.prototype,"t",void 0),lc.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 cc=function(t,e,i,r){var s,a=arguments.length,n=a<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--)(s=t[o])&&(n=(a<3?s(n):a>3?s(e,i,n):s(e,i))||n);return a>3&&n&&Object.defineProperty(e,i,n),n};const dc=class{constructor(t){o(this,t),this.autoScroll=!0,this.iconPack=Ne,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=>{P(()=>{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&&Ji(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,()=>Ji(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 s=await this.fetchData(t,e,i);if(this.isLoading=!1,!(null==s?void 0:s.length))return i||(this.hasNewNodesToRender=!1,this.shouldRenderNewNodes=!0),void r([]);s.forEach(t=>this.addNodeToRender(t,i)),this.rerender(),r(s)}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 z(G,{key:"6fd10c2fdc24eeab3d52c10643ed92321e04d9fe"},z("div",{key:"675f184549482b76fc07ea5641b9c3297ab6a79b",class:"scrollbar container",part:"container",ref:t=>this.$paginatedList=t},z("div",{key:"37618a8856bd0f1a8ecc57b38cd700bc302191e6",class:{"show-new-messages-ctr":!0,active:!this.shouldRenderNewNodes}},z("rtk-button",{key:"b7ebb2a7b309c47af1987159726f1399452995c2",class:"show-new-messages",kind:"icon",variant:"secondary",part:"show-new-messages",onClick:()=>this.onDownArrowClicked()},z("rtk-icon",{key:"99532567bf299b314a8e0a6d5485ad3fa219e600",icon:this.iconPack.chevron_down}))),z("div",{key:"512f096db4e0fdbd969c3cb7cfacc00a38b2f2b6",class:"smallest-dom-element",id:"bottom-scroll",ref:t=>this.$bottomRef=t}),this.isLoading&&0===this.pagesToRender.flat().length&&z("rtk-spinner",{key:"bf2bcfdc9e4eecbc120ad38a0cc2c8323781532c",size:"lg"}),0===this.pagesToRender.flat().length&&this.showEmptyListLabel?z("div",{class:"empty-list"},null!==(t=this.emptyListLabel)&&void 0!==t?t:this.t("list.empty")):z("div",{class:"page-wrapper"},this.pagesToRender.map(t=>this.createNodes(t))),z("div",{key:"2c29f14bcac1c725c619349f1e30627cfdbc26f9",class:"smallest-dom-element",id:"top-scroll",ref:t=>this.$topRef=t})))}static get watchers(){return{selectedItemId:["onItemChanged"]}}};cc([si()],dc.prototype,"iconPack",void 0),cc([si()],dc.prototype,"t",void 0),dc.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 hc=function(t,e,i,r){var s,a=arguments.length,n=a<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--)(s=t[o])&&(n=(a<3?s(n):a>3?s(e,i,n):s(e,i))||n);return a>3&&n&&Object.defineProperty(e,i,n),n};const pc={"Chrome.Desktop.audio":["Chrome1.svg","Chrome2.svg","Chrome3.svg"],"Chrome.Desktop.video":["Chrome1.svg","Chrome2.svg","Chrome3.svg"]},uc=class{constructor(t){o(this,t),this.stateUpdate=W(this,"rtkStateUpdate",7),this.t=Fe(),this.iconPack=Ne,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 s=(null===(e=this.device)||void 0===e?void 0:e.isMobile)?"Mobile":"Desktop",a=null!==(r=pc[`${null===(i=this.device)||void 0===i?void 0:i.browserName}.${s}.${this.mediaType}`])&&void 0!==r?r:[];Promise.all(a.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(),s=null!==(t=e.toLowerCase())&&void 0!==t?t:"others",a=null!=i?i:"others";if(r){const t=`perm_sys_denied.${this.mediaType}.${a.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}.${s}.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 s=r&&"macOS"==this.meeting.self.device.osName;return z(G,{key:"37bc20fd76370a473d701b99f141057e3ef7b9ea"},z("h2",{key:"5177028bd1d1f909cc5dacffaf7a63e9a90a6119"},z("rtk-icon",{key:"eef420ebb45cedbd63f6f4532954a5175535c07e",class:"text-icon",icon:this.iconPack.warning}),this.getTitle()),this.svgSteps.length>0&&z("div",{key:"1f35d79d6e3b83341a26081fc72540863d395108",class:"svg-container"},this.svgSteps.map((t,e)=>z("p",{innerHTML:t,class:"svg-ins",key:this.currentStep,hidden:e!==this.currentStep}))),z("div",{key:"855ceb1e53e3006b85d32e0edd9eb0088f94ad75"},this.getMessage()),!r&&z("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"},z("rtk-icon",{key:"775423666928defb61670cd9a4c2e158fe6386e6",class:"text-icon",icon:this.iconPack.attach}),this.t("cta.help")),z("div",{key:"023b8da610c0afea0abb203ae9d09286b3368ccf",class:"actions"},z("rtk-button",{key:"a2b29cb77e0f32076dc8bf0a72e6b2f512684201",size:"lg",kind:"wide",variant:"secondary",onClick:this.continue},this.t("cta.continue")),s?z("rtk-button",{size:"lg",kind:"wide",onClick:this.openMacSystemSettings},this.t("cta.system_settings")):z("rtk-button",{size:"lg",kind:"wide",onClick:this.reload},this.t("cta.reload"))),z("slot",{key:"2e7d6bcdb64f65de6e73742946a3a173905227a5"}))}static get watchers(){return{meeting:["meetingChanged"]}}};hc([si()],uc.prototype,"meeting",void 0),hc([si()],uc.prototype,"t",void 0),hc([si()],uc.prototype,"iconPack",void 0),hc([si()],uc.prototype,"states",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)}: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 gc=function(t,e,i,r){var s,a=arguments.length,n=a<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--)(s=t[o])&&(n=(a<3?s(n):a>3?s(e,i,n):s(e,i))||n);return a>3&&n&&Object.defineProperty(e,i,n),n};const fc=class{constructor(t){o(this,t),this.iconPack=Ne,this.size="md"}render(){return z(G,{key:"00275245b6516861bd7cf7788fb81855d6e1ddf7"},z("rtk-icon",{key:"9c77cfa660794fe97c24dbf6e165b4d9b58635de",class:"spinner",icon:this.iconPack.spinner}))}};gc([si()],fc.prototype,"iconPack",void 0),gc([si()],fc.prototype,"size",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{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 mc=function(t,e,i,r){var s,a=arguments.length,n=a<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--)(s=t[o])&&(n=(a<3?s(n):a>3?s(e,i,n):s(e,i))||n);return a>3&&n&&Object.defineProperty(e,i,n),n};const vc=class{constructor(t){o(this,t),this.onTextChange=W(this,"textChange",7),this.disabled=!1,this.rateLimitBreached=!1,this.keyDownHandler=()=>{},this.iconPack=Ne,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 z("div",{key:"373afd284088ce6b38267ff5ce7dc1990ffb5020",class:"chat-input",part:"chat-input-container"},this.maxLengthBreached>0&&z("div",{key:"0cedd8f2344b4a1a08a0a106e00f61d1a3c4040d",class:"text-error "+(this.maxLengthBreached===this.maxLength?"breached":"")},z("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&&z("div",{key:"7bdb90a61a4040a4ad215ecb69abb589276fcb4e",class:"text-error breached"},z("rtk-icon",{key:"7eaa93a35a6c6ba8128d170199b9f85fd945a25c",id:"warning-indicator",icon:this.iconPack.warning,part:"warning-indicator"})," ",this.t("chat.rate_limit_error")),z("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}))}};mc([si()],vc.prototype,"iconPack",void 0),mc([si()],vc.prototype,"t",void 0),vc.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 bc=function(t,e,i,r){var s,a=arguments.length,n=a<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--)(s=t[o])&&(n=(a<3?s(n):a>3?s(e,i,n):s(e,i))||n);return a>3&&n&&Object.defineProperty(e,i,n),n};const kc=class{constructor(t){o(this,t),this.now=new Date,this.isContinued=!1,this.iconPack=Ne,this.t=Fe(),this.showBubble=!1}render(){return z(G,{key:"128a6e757cf71a11aef8c93749b6388cee1a65d3"},!this.isContinued&&z(Xi,{key:"35fd68c340c5133b3940bc5a200aaed48f366a0e",name:this.message.displayName,time:this.message.time,now:this.now}),z("div",{key:"189244910e2511399a9dcb57647d7c63ed918712",class:{body:!0,bubble:this.showBubble},part:"body"},z("div",{key:"2b949b44c13aae1295c01aaa3915bcd45381447a",class:{text:!0,emoji:Xe(this.message.message)}},z(uo,{key:"3659ef1412e9731352a3270cf2815a9fa78018fb",message:this.message.message}))))}};bc([si()],kc.prototype,"iconPack",void 0),bc([si()],kc.prototype,"t",void 0);const yc=class{constructor(t){o(this,t),this.isMarkdown=!1}render(){return z("p",{key:"d14082ad02e2d2aaf5e325a95c1bc36595e9e33d",class:{text:!0,emoji:Xe(this.text)}},this.isMarkdown?z("rtk-markdown-view",{text:this.text}):this.text)}};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)}.text{word-break:break-word;display:block;overflow-wrap:break-word;line-height:1.375}.text.emoji{font-size:24px}";const wc=class{constructor(t){o(this,t),this.openChange=W(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),P(()=>{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(){ho(this.triggerEl,this.tooltipEl,{placement:this.placement,middleware:[so(8),oo(),no({padding:5}),co({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:s,y:a}=r.arrow,n={top:"bottom",right:"left",bottom:"top",left:"right"}[i.split("-")[0]];Object.assign(this.arrowEl.style,{left:null!=s?`${s}px`:"",top:null!=a?`${a}px`:"",right:"",bottom:"",[n]:"-4px"})})}render(){return z(G,{key:"b43646b89b257321a382838a8c5f2ea0d3e5e122"},z("span",{key:"aa18e85265cc75e7d08a06d469a8bb10ccecdb56",part:"trigger",id:"trigger",ref:t=>this.triggerEl=t},z("slot",{key:"a422fbefd999ff26a30a7e03f6e14d84397cff88"})),z("div",{key:"593b5ec328f127c349ae0a92d36c6261e5abcb7a",part:"tooltip",class:"tooltip",id:"tooltip",role:"tooltip",ref:t=>this.tooltipEl=t},z("div",{key:"c25e6a54940097ebd880c9b9e8fc2b4d48677989",id:"arrow",ref:t=>this.arrowEl=t,part:"arrow"}),this.label,z("slot",{key:"cd8415e9fa2c1eaeffa8c7ec4ffcc6dd34fc04fa",name:"tooltip"})))}static get watchers(){return{open:["openChanged"]}}};!function(t,e,i,r){var s,a=arguments.length,n=a<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--)(s=t[o])&&(n=(a<3?s(n):a>3?s(e,i,n):s(e,i))||n);a>3&&n&&Object.defineProperty(e,i,n)}([si()],wc.prototype,"size",void 0),wc.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 xc=Object.freeze({__proto__:null,rtk_avatar:vo,rtk_breakout_room_manager:ko,rtk_breakout_room_participants:wo,rtk_breakout_rooms_manager:So,rtk_broadcast_message_modal:Po,rtk_button:To,rtk_channel_creator:Co,rtk_channel_details:Ao,rtk_channel_header:Io,rtk_channel_selector_view:Mo,rtk_chat:Uo,rtk_chat_composer_view:No,rtk_chat_message:zo,rtk_chat_messages_ui:Go,rtk_chat_messages_ui_paginated:Vo,rtk_chat_search_results:Ko,rtk_confirmation_modal:Wo,rtk_counter:Qo,rtk_debugger:Jo,rtk_debugger_audio:ol,rtk_debugger_screenshare:cl,rtk_debugger_system:hl,rtk_debugger_video:ul,rtk_dialog:fl,rtk_dialog_manager:vl,rtk_draft_attachment_view:kl,rtk_emoji_picker:xl,rtk_emoji_picker_button:El,rtk_file_message:Tl,rtk_file_message_view:Ll,rtk_file_picker_button:_l,rtk_icon:Rl,rtk_image_message:Dl,rtk_image_message_view:Ol,rtk_join_stage:$l,rtk_leave_meeting:Nl,rtk_logo:zl,rtk_markdown_view:Bl,rtk_meeting:Hl,rtk_menu:ql,rtk_menu_item:Yl,rtk_menu_list:Zl,rtk_message_view:Ql,rtk_mute_all_confirmation:Jl,rtk_notification:ec,rtk_notifications:nc,rtk_overlay_modal:lc,rtk_paginated_list:dc,rtk_permissions_message:uc,rtk_spinner:fc,rtk_text_composer_view:vc,rtk_text_message:kc,rtk_text_message_view:yc,rtk_tooltip:wc});var Sc=function(t,e,i,r){var s,a=arguments.length,n=a<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--)(s=t[o])&&(n=(a<3?s(n):a>3?s(e,i,n):s(e,i))||n);return a>3&&n&&Object.defineProperty(e,i,n),n};const Ec=class{constructor(t){o(this,t),this.stateUpdate=W(this,"rtkStateUpdate",7),this.config=Ie,this.iconPack=Ne,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 z(G,null,z("h3",{class:"title"},this.t("ai.transcriptions")),z("rtk-button",{variant:"ghost",kind:"icon",class:"close",onClick:this.close,"aria-label":this.t("close")},z("rtk-icon",{icon:this.iconPack.dismiss})),z("rtk-ai-transcriptions",Object.assign({},r)))}static get watchers(){return{view:["viewChanged"]}}};Sc([si()],Ec.prototype,"meeting",void 0),Sc([si()],Ec.prototype,"states",void 0),Sc([si()],Ec.prototype,"iconPack",void 0),Sc([si()],Ec.prototype,"t",void 0),Sc([si()],Ec.prototype,"size",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{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 Pc=Object.freeze({__proto__:null,rtk_ai:Ec});var Tc=function(t,e,i,r){var s,a=arguments.length,n=a<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--)(s=t[o])&&(n=(a<3?s(n):a>3?s(e,i,n):s(e,i))||n);return a>3&&n&&Object.defineProperty(e,i,n),n};const Lc=class{constructor(t){o(this,t),this.stateUpdate=W(this,"rtkStateUpdate",7),this.variant="button",this.iconPack=Ne,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?z(G,{title:i},z("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})):z(G,{"data-hidden":!0})}static get watchers(){return{states:["statesChanged"]}}};Tc([si()],Lc.prototype,"states",void 0),Tc([si()],Lc.prototype,"meeting",void 0),Tc([si()],Lc.prototype,"size",void 0),Tc([si()],Lc.prototype,"iconPack",void 0),Tc([si()],Lc.prototype,"t",void 0),Lc.style=":host{display:block}:host([data-hidden]){display:none}";var Cc=Object.freeze({__proto__:null,rtk_ai_toggle:Lc});var _c=function(t,e,i,r){var s,a=arguments.length,n=a<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--)(s=t[o])&&(n=(a<3?s(n):a>3?s(e,i,n):s(e,i))||n);return a>3&&n&&Object.defineProperty(e,i,n),n};const Ac=class{constructor(t){o(this,t),this.iconPack=Ne,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=>z(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 z(G,{key:"0547c2c61b1c1b1fc4fcc5353b9094f8c118bd83"},z("div",{key:"46dd0248db3437461bd56bd507a2f42ce05af03a",class:"content scrollbar"},z("div",{key:"98a3dc4928c3062f3e5058b50d415f147c273c26",class:"stage grid"},this.renderGrid(t)),this.offStageParticipants.length>0&&z("div",{key:"18015fe551647048c990f107ba313c5e13ba7d47",class:"waitlist-area"},z("div",{key:"50a65d4f48d94426860d808ff6151d3e0d519f4e",class:"listening-title"},this.offStageParticipants.length," ",this.t("grid.listening")),z("div",{key:"173e4ebc97425b7298236673122f76ebfae59609",class:"waitlist-grid grid"},this.renderGrid(this.offStageParticipants)))),z("slot",{key:"c92a12329a9c4c456f3506cee2aa2d73dceaa0e0"}))}get host(){return Y(this)}static get watchers(){return{meeting:["meetingChanged"]}}};_c([si()],Ac.prototype,"meeting",void 0),_c([si()],Ac.prototype,"states",void 0),_c([si()],Ac.prototype,"iconPack",void 0),_c([si()],Ac.prototype,"size",void 0),_c([si()],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)}.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 Rc=Object.freeze({__proto__:null,rtk_audio_grid:Ac}),Ic=Dc;function Dc(){}Dc.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,s=r?arguments[1]:void 0,a=r?arguments[2]:arguments[1];return a._groupName=s,(this.callbacks[t]=this.callbacks[t]||[]).push(a),this},e.once=function(t,e,i){var r=this,s=3===arguments.length,a=s?arguments[1]:void 0,n=s?arguments[2]:arguments[1];return this.on(t,a,function e(){r.off(t,e),n.apply(this,arguments)}),this},e.releaseGroup=function(t){var e,i,r,s;for(e in this.callbacks=this.callbacks||{},this.callbacks)for(i=0,r=(s=this.callbacks[e]).length;i<r;i++)s[i]._groupName===t&&(s.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,s=[].slice.call(arguments,1),a=this.callbacks[t],n=this.getWildcardCallbacks(t);if(a)for(e=0,i=(r=a.slice()).length;e<i&&r[e];++e)r[e].apply(this,s);if(n)for(i=n.length,e=0,i=(r=n.slice()).length;e<i&&r[e];++e)r[e].apply(this,[t].concat(s));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}},Dc.mixin(Dc);var Mc,Oc=Ic;"undefined"!=typeof window&&(Mc=window.AudioContext||window.webkitAudioContext);var Uc=null,$c=function(t,e){var i=new Oc;if(!Mc)return i;var r,s,a,n=(e=e||{}).smoothing||.1,o=e.interval||50,l=e.threshold,c=e.play,d=e.history||10,h=!0;Uc=e.audioContext||Uc||new Mc,(a=Uc.createAnalyser()).fftSize=512,a.smoothingTimeConstant=n,s=new Float32Array(a.frequencyBinCount),t.jquery&&(t=t[0]),t instanceof HTMLAudioElement||t instanceof HTMLVideoElement?(r=Uc.createMediaElementSource(t),void 0===c&&(c=!0),l=l||-50):(r=Uc.createMediaStreamSource(t),l=l||-50),r.connect(a),c&&a.connect(Uc.destination),i.speaking=!1,i.suspend=function(){return Uc.suspend()},i.resume=function(){return Uc.resume()},Object.defineProperty(i,"state",{get:function(){return Uc.state}}),Uc.onstatechange=function(){i.emit("state_change",Uc.state)},i.setThreshold=function(t){l=t},i.setInterval=function(t){o=t},i.stop=function(){h=!1,i.emit("volume_change",-100,l),i.speaking&&(i.speaking=!1,i.emit("stopped_speaking")),a.disconnect(),r.disconnect()},i.speakingHistory=[];for(var p=0;p<d;p++)i.speakingHistory.push(0);var u=function(){setTimeout(function(){if(h){var t=function(t,e){var i=-1/0;t.getFloatFrequencyData(e);for(var r=4,s=e.length;r<s;r++)e[r]>i&&e[r]<0&&(i=e[r]);return i}(a,s);i.emit("volume_change",t,l);var e=0;if(t>l&&!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<l&&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>l)),u()}},o)};return u(),i};var Fc=function(t,e,i,r){var s,a=arguments.length,n=a<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--)(s=t[o])&&(n=(a<3?s(n):a>3?s(e,i,n):s(e,i))||n);return a>3&&n&&Object.defineProperty(e,i,n),n};const Nc=class{constructor(t){o(this,t),this.iconPack=Ne,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=$c(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,z(G,{key:"cff0c840f6dcd8ae6514ee4b8b0c6680d4ebf8ff"},z("div",{key:"c43dbfcc26c20d0d7487a234624709ad9bf14f6f",class:{"avatar-ctr":!0,speaking:this.audioEnabled,[e]:!0}},z("rtk-avatar",{key:"5a638ea3a636f645eaab2638353fb49697a431c0",participant:this.participant,size:this.size},!this.audioEnabled&&z("div",{key:"f8a6bc0a24906df10870c827faeca7f8f343306a",class:"mic-icon"},z("rtk-icon",{key:"a7777ba5bb5b78329556b6af19495425827915ec",icon:Ne.mic_off})))),z("rtk-name-tag",Object.assign({key:"a7d4bea44bfde23323e52917ee197c5558cef8ba",variant:"text",participant:this.participant},t)),z("slot",{key:"370b16462a7be42a663a58288105ad46c0e6f3d3"}))}static get watchers(){return{participant:["participantChanged"]}}};Fc([si()],Nc.prototype,"meeting",void 0),Fc([si()],Nc.prototype,"size",void 0),Fc([si()],Nc.prototype,"states",void 0),Fc([si()],Nc.prototype,"iconPack",void 0),Fc([si()],Nc.prototype,"t",void 0),Nc.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 jc=Object.freeze({__proto__:null,rtk_audio_tile:Nc});var zc=function(t,e,i,r){var s,a=arguments.length,n=a<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--)(s=t[o])&&(n=(a<3?s(n):a>3?s(e,i,n):s(e,i))||n);return a>3&&n&&Object.defineProperty(e,i,n),n};const Bc=class{constructor(t){o(this,t),this.stateUpdate=W(this,"rtkStateUpdate",7),this.variant="button",this.iconPack=Ne,this.t=Fe(),this.canToggle=!1,this.permissionsUpdateListener=()=>{this.canToggle=ue(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=ue(t),t.self.permissions.on("permissionsUpdate",this.permissionsUpdateListener))}render(){if(this.canToggle)return z(G,{title:this.t("breakout_rooms")},z("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"]}}};zc([si()],Bc.prototype,"meeting",void 0),zc([si()],Bc.prototype,"states",void 0),zc([si()],Bc.prototype,"size",void 0),zc([si()],Bc.prototype,"iconPack",void 0),zc([si()],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)}:host{display:block}";var Gc=Object.freeze({__proto__:null,rtk_breakout_rooms_toggle:Bc});var Hc=function(t,e,i,r){var s,a=arguments.length,n=a<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--)(s=t[o])&&(n=(a<3?s(n):a>3?s(e,i,n):s(e,i))||n);return a>3&&n&&Object.defineProperty(e,i,n),n};const Vc=class{constructor(t){o(this,t),this.stateUpdate=W(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=Ne,this.t=Fe(),this.videoEnabled=!1,this.canProduceVideo=!1,this.cameraPermission="NOT_REQUESTED",this.stageStatus="OFF_STAGE",this.toggleCamera=()=>{var t,e,i,r,s,a,n,o,l,c,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===(a=null===(s=null===(r=this.meeting)||void 0===r?void 0:r.self)||void 0===s?void 0:s.permissions)||void 0===a?void 0:a.canProduceVideo}},webinar:{stageStatus:null===(n=this.meeting)||void 0===n?void 0:n.stage.status},livestream:{stageStatus:null===(l=null===(o=this.meeting)||void 0===o?void 0:o.stage)||void 0===l?void 0:l.status},moduleExists:{self:Boolean(null===(c=this.meeting)||void 0===c?void 0:c.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,s,a,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===(a=null===(s=this.meeting)||void 0===s?void 0:s.self)||void 0===a?void 0:a.permissions)||void 0===n||n.removeListener("permissionsUpdate",this.meetingPermissionsUpdateListener)}meetingChanged(t){var e,i;if(null!=t){const{self:r,stage:s}=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==s||s.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={},s=this.hasPermissionError(),a="COULD_NOT_START"===this.cameraPermission;return this.videoEnabled&&!s?(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=a?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:s||a,disable:s}}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 z(G,{"data-hidden":!0});const{tooltipLabel:e,label:i,icon:r,classList:s,showWarning:a,disable:n}=this.getState();return z(G,{title:i},z("rtk-tooltip",{kind:"block",label:e,part:"tooltip"},z("rtk-controlbar-button",{part:"controlbar-button",size:this.size,iconPack:this.iconPack,class:s,variant:this.variant,label:i,icon:r,onClick:this.toggleCamera,showWarning:a,disabled:n})))}static get watchers(){return{meeting:["meetingChanged"]}}};Hc([si()],Vc.prototype,"meeting",void 0),Hc([si()],Vc.prototype,"size",void 0),Hc([si()],Vc.prototype,"iconPack",void 0),Hc([si()],Vc.prototype,"t",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{display:block}:host([data-hidden]){display:none}";var qc=Object.freeze({__proto__:null,rtk_camera_toggle:Vc});var Kc=function(t,e,i,r){var s,a=arguments.length,n=a<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--)(s=t[o])&&(n=(a<3?s(n):a>3?s(e,i,n):s(e,i))||n);return a>3&&n&&Object.defineProperty(e,i,n),n};const Yc=class{constructor(t){o(this,t),this.stateUpdate=W(this,"rtkStateUpdate",7),this.variant="button",this.config=Ie,this.iconPack=Ne,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 z(G,{tabIndex:0,role:"log","aria-label":"Picture-in-Picture mode"},z("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"]}}};Kc([si()],Yc.prototype,"meeting",void 0),Kc([si()],Yc.prototype,"states",void 0),Kc([si()],Yc.prototype,"iconPack",void 0),Kc([si()],Yc.prototype,"size",void 0),Kc([si()],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)}:host{display:block}";var Wc=Object.freeze({__proto__:null,rtk_caption_toggle:Yc});var Zc=function(t,e,i,r){var s,a=arguments.length,n=a<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--)(s=t[o])&&(n=(a<3?s(n):a>3?s(e,i,n):s(e,i))||n);return a>3&&n&&Object.defineProperty(e,i,n),n};const Qc=class{constructor(t){o(this,t),this.channelChanged=W(this,"channelChanged",7),this.iconPack=Ne,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?z("div",{class:"channel-display"},z("rtk-avatar",{participant:{name:t.displayName,picture:t.displayPictureUrl}})):z("div",{class:"channel-display"},z("rtk-icon",{icon:this.iconPack.people,slot:"start"}))},this.renderRecentMessage=t=>{if(!t.latestMessage)return z("p",{class:"latest-msg new"},this.t("chat.start_conversation"));let e=t.isDirectMessage?"":`${t.latestMessage.displayName}: `;if("text"===t.latestMessage.type)return z("p",{class:"latest-msg"},e,z(uo,{message:t.latestMessage.message}));let i="";return"image"===t.latestMessage.type?i=this.t("image"):"file"===t.latestMessage.type&&(i=this.t("file")),z("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 s=new Date(i);if(s.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>s){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 z(G,{key:"b6684ad536955380fd011a8db8ed74508ce5c4e2"},z("div",{key:"0b9bd04166de85df7043026fe6f80d8980d09fd8",class:"container",ref:t=>this.$el=t},this.isHidden&&z("rtk-button",{key:"5b2af8c992ae39a097db0c6bcb79f73720c0baf6",kind:"icon",variant:"ghost",size:"md",onClick:this.onRevealClicked,class:"sidebar-btn"},z("rtk-icon",{key:"0713628a2ab34e4c7dbc8bf15a760331e0a4501b",icon:this.isHidden?this.iconPack.chevron_left:this.iconPack.dismiss})),z("slot",{key:"cba2cb4ec34adb4c852362af9aa6feef0c4f11b7",name:"header"}),z("div",{key:"ca23085817b6b0ca7bcd7cbe87d5788bc3b091d6",class:"search-wrapper"},z("div",{key:"ac28f333fb7625024441c06039c86a651bf31a51",class:"search"},z("input",{key:"34f1a069108d1610209bdc902afd40f168fd24a0",type:"search",autocomplete:"off",placeholder:this.t("chat.search_conversations"),onInput:this.onSearchInput}),z("rtk-icon",{key:"479b07ba42bbd7825e33f59efb4da26301553616",icon:this.iconPack.search,class:"search-icon"}))),z("div",{key:"4f97ff09587ab50ad957e6748ee31673f9097564",class:"channel-container scrollbar",role:"list"},this.channels.filter(t=>""===this.searchQuery||t.displayName.includes(this.searchQuery)).map(t=>z("div",{class:{channel:!0,selected:t.id===this.selectedChannelId,highlight:!!t.unreadCount},role:"listitem",onClick:()=>{this.channelSelected(t.id)}},this.renderChannelDisplayPic(t),z("div",{class:"channel-card","is-direct-message":t.isDirectMessage},z("div",{class:"recent-message-row"},z("span",{class:"channel-name"},t.displayName),t.latestMessage&&z("span",{class:"latest-msg-time"},this.getTimeLabel(t.latestMessage))),z("div",{class:"recent-message-row"},this.renderRecentMessage(t),t.unreadCount>0&&t.id!==this.selectedChannelId?z("span",{class:"new-msgs-count"},t.unreadCount<99?t.unreadCount:"99+"):null)))))),!this.isHidden&&z("div",{key:"dbf1235ca2393f7978906cbbcd2530ea38801157",class:"overlay-container"},z("rtk-button",{key:"d2a37c163f32a251597ee8dd1332c48bacad1883",kind:"icon",variant:"ghost",size:"md",onClick:this.onRevealClicked,class:"sidebar-btn"},z("rtk-icon",{key:"a13daad18a52bd8846dba2bbeab753d0a060463e",icon:this.isHidden?this.iconPack.chevron_left:this.iconPack.dismiss}))))}};Zc([si()],Qc.prototype,"iconPack",void 0),Zc([si()],Qc.prototype,"t",void 0),Qc.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 Xc=Object.freeze({__proto__:null,rtk_channel_selector_ui:Qc});var Jc=function(t,e,i,r){var s,a=arguments.length,n=a<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--)(s=t[o])&&(n=(a<3?s(n):a>3?s(e,i,n):s(e,i))||n);return a>3&&n&&Object.defineProperty(e,i,n),n};const td="@",ed=class{constructor(t){o(this,t),this.onNewMessage=W(this,"rtkNewMessage",7),this.onEditMessage=W(this,"rtkEditMessage",7),this.onEditCancelled=W(this,"rtkEditCancelled",7),this.canSendTextMessage=!1,this.canSendFiles=!1,this.iconPack=Ne,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===td&&[void 0," "].includes(this.$textArea.value.at(-1))&&(this.mentionQuery=td),"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===td)&&(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(td));this.mentionQuery=`${td}${$i(e)}`}},this.onPaste=t=>{const e=t.clipboardData||t.originalEvent.clipboardData;P(()=>{e&&e.items&&e.items.length>0&&(Di(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=`${Gi(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)+`${td}${t.name} `,this.mentionQuery="",this.focusedMemberIndex=0,P(()=>this.$textArea.focus())},this.getFilteredMembers=()=>{const t=this.mentionQuery.replace(td,"");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 z("ul",{class:"suggested-replies scrollbar"},this.prefill.suggestedReplies.map(t=>z("rtk-tooltip",{label:this.t("chat.click_to_send")},z("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?z("ul",{class:"member-list scrollbar"},t.map((t,e)=>z("li",{class:{member:!0,selected:e===this.focusedMemberIndex},onClick:()=>this.onMemberSelect(t),ref:t=>{e===this.focusedMemberIndex&&P(()=>{t&&t.scrollIntoView({behavior:"smooth",block:"end",inline:"nearest"})})}},z("rtk-avatar",{participant:{name:t.name,picture:t.picture},size:"sm"}),z("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)&&P(()=>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 z("div",{class:"preview-overlay"},z("div",{class:"file-preview"},z("rtk-tooltip",{label:this.t("chat.cancel_upload")},z("rtk-button",{variant:"secondary",kind:"icon",onClick:this.cleanUpFileUpload},z("rtk-icon",{icon:this.iconPack.dismiss}))),"image"===this.fileToUpload.type?z("img",{class:"preview-image",src:this.filePreview}):z("div",{class:"preview-file"},z("span",null,this.filePreview))))}render(){var t;let e="";return(null===(t=this.prefill.editMessage)||void 0===t?void 0:t.message)&&(e=Hi(this.prefill.editMessage.message)),z(G,{key:"8f0ee810fac56aa1c62254d3d8a997941475bb3a"},this.canSendTextMessage&&this.emojiPickerActive&&z("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(),z("slot",{key:"166872db8c0b07d2ec2e407de0fddfce7f3d4969",name:"chat-addon"}),z("slot",{key:"b383df2de3320e69fe2cb35a22296d1ee53b08df",name:"quote-block"}),z("div",{key:"89d5fdf625bf212acda92276e9ec10b60b55a179",class:"chat-input",part:"chat-input"},this.renderMenu(),this.canSendTextMessage&&z("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}),z("div",{key:"6c3a94c43257041fdeed496c7bd8b57ce4be6510",class:"chat-buttons",part:"chat-buttons"},z("div",{key:"76e6f7923484ee6a58359b6554e5e51009bc317f",class:"left",part:"chat-buttons-left"},!this.prefill.editMessage&&this.canSendFiles&&[z("rtk-tooltip",{key:"dbc04471a85d1fe2987c7d18dd0781e61f85fa35",label:this.t("chat.send_file")},z("rtk-button",{key:"cb54c65b81559d4a00a316aacf2f4bb368f30799",variant:"ghost",kind:"icon",onClick:()=>this.uploadFile("file"),title:this.t("chat.send_file")},z("rtk-icon",{key:"d3c542b0b1260ac305de3cfd5fbf5396f18d1f0e",icon:this.iconPack.attach}))),z("rtk-tooltip",{key:"6aac421a0d9149fd6c188bcce25bf4152cb8c0dd",label:this.t("chat.send_img")},z("rtk-button",{key:"5460407db51e83ab379bb8ade5af7d87bd04b64d",variant:"ghost",kind:"icon",onClick:()=>this.uploadFile("image"),title:this.t("chat.send_img")},z("rtk-icon",{key:"3f8732882dc03b5ddf23c59bdbe96329e551b070",icon:this.iconPack.image})))],!this.prefill.editMessage&&this.canSendTextMessage&&!this.disableEmojiPicker&&z("rtk-tooltip",{key:"8d032069a031d6a3b3e4847953a8e027eb5b3400",label:this.t("chat.send_emoji")},z("rtk-button",{key:"b96b0791ac68f142408f269354bde5385c08a4da",variant:"ghost",kind:"icon",class:{active:this.emojiPickerActive},title:this.t("chat.send_emoji"),onClick:()=>{this.emojiPickerActive=!this.emojiPickerActive}},z("rtk-icon",{key:"cd9ac09500ed1151dad94ed285db35bea6260ed8",icon:this.iconPack.emoji_multiple})))),!!this.filePreview&&this.renderFilePreview(),this.canSendTextMessage&&z("div",{key:"43b9f9232a7476b5600519fb3517d6342143d76f",class:"right",part:"chat-buttons-right"},!this.prefill.editMessage&&z("rtk-tooltip",{key:"ec757e58571a0ff2e4ab9b1006ab388b334a77d3",variant:"primary",label:this.t("chat.send_msg"),delay:2e3},z("rtk-button",{key:"054e7b52bfcfe852ca53ce96c6b498585924e616",kind:"icon",onClick:()=>this.handleSendMessage(),title:this.t("chat.send_msg")},z("rtk-icon",{key:"d085d0aae594a8e08f29d200e4cb0818c0eabdfd",icon:this.iconPack.send}))),this.prefill.editMessage&&z("div",{key:"7926d7cf394a7989d2fbae97c1ab5a974834b431",class:"edit-buttons"},z("rtk-tooltip",{key:"66029024ca595880cc72fdb28999f8380a8a37fc",variant:"secondary",label:this.t("cancel"),delay:2e3},z("rtk-button",{key:"cba0e1460d33a0b20593009acc588ba4e385d782",kind:"icon",variant:"secondary",onClick:()=>this.handleEditCancel(),title:this.t("cancel")},z("rtk-icon",{key:"2155257dea8a5660b6b2d9d9510da153192be16e",icon:this.iconPack.dismiss}))),z("rtk-tooltip",{key:"b296276e6f08c128ec3ba3cc292f6637e3550a34",variant:"primary",label:this.t("chat.update_msg"),delay:2e3},z("rtk-button",{key:"e3c50822510811d254f3e8d65ed967b70be97037",kind:"icon",onClick:()=>this.handleEditMessage(),title:this.t("chat.send_msg")},z("rtk-icon",{key:"016e23547285b95c2545784d627a37fb8c6359d5",icon:this.iconPack.checkmark}))))))))}static get watchers(){return{channelId:["onChannelChanged"]}}};Jc([si()],ed.prototype,"size",void 0),Jc([si()],ed.prototype,"iconPack",void 0),Jc([si()],ed.prototype,"t",void 0),ed.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 id=Object.freeze({__proto__:null,rtk_chat_composer_ui:ed});var rd=function(t,e,i,r){var s,a=arguments.length,n=a<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--)(s=t[o])&&(n=(a<3?s(n):a>3?s(e,i,n):s(e,i))||n);return a>3&&n&&Object.defineProperty(e,i,n),n};const sd=class{constructor(t){o(this,t),this.groupChanged=W(this,"rtkChatGroupChanged",7),this.unreadCounts={},this.groups=[],this.iconPack=Ne,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 z(G,null,z("div",{class:"chat-scope-selector"},this.showParticipantsPanel&&z("div",{class:"participants-container"},z("div",{class:"search",part:"search"},z("rtk-icon",{icon:this.iconPack.search,part:"search-icon"}),z("input",{type:"search",autocomplete:"off",placeholder:this.t("search"),value:this.query,onInput:t=>{this.query=t.target.value},part:"search-input"})),z("ul",{class:"scope-list scrollbar"},""===this.query&&z("li",{class:"scope scope-special",onClick:()=>this.onScopeClick("everyone")},z("div",{class:"everyone-icon"},z("rtk-icon",{icon:this.iconPack.participants})),this.t("everyone"),this.unreadCounts.everyone>0&&z("div",{class:"unread-count",part:"unread-count"},z("span",null,this.unreadCounts.everyone))),this.getGroups().map(t=>{const e=this.unreadCounts[Ii([this.selfUserId,t.userId])];return z("li",{class:"scope",onClick:()=>this.onScopeClick(t),key:t.userId},t.name,e>0&&z("div",{class:"unread-count",part:"unread-count"},z("span",null,e)))}))),z("button",{onClick:()=>this.toggleParticipants()},z("span",null,`${this.t("to")} ${this.getName()}`," ",t>0&&z("div",{class:"unread-count selector"},z("span",null,t))),z("rtk-icon",{icon:this.showParticipantsPanel?this.iconPack.chevron_up:this.iconPack.chevron_down}))))}};rd([si()],sd.prototype,"iconPack",void 0),rd([si()],sd.prototype,"t",void 0),sd.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 ad=Object.freeze({__proto__:null,rtk_chat_selector_ui:sd});const nd=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},od=t=>{if(t&&!t.polls)return!1;const{polls:e}=t.self.permissions;return e.canCreate||e.canView||e.canVote},ld=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)},cd=t=>{if(Wt(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 dd=function(t,e,i,r){var s,a=arguments.length,n=a<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--)(s=t[o])&&(n=(a<3?s(n):a>3?s(e,i,n):s(e,i))||n);return a>3&&n&&Object.defineProperty(e,i,n),n};const hd=class{constructor(t){o(this,t),this.stateUpdate=W(this,"rtkStateUpdate",7),this.unreadMessageCount=0,this.variant="button",this.iconPack=Ne,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=nd(this.meeting)}}connectedCallback(){this.meetingChanged(this.meeting),this.statesChanged(this.states)}disconnectedCallback(){var t,e,i,r,s,a;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===(a=null===(s=this.meeting)||void 0===s?void 0:s.self)||void 0===a||a.permissions.removeListener("chatUpdate",this.updateCanView)}meetingChanged(t){var e,i,r,s,a,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 l=null!==(r=null===(i=t.meta)||void 0===i?void 0:i.meetingStartedTimestamp.getTime())&&void 0!==r?r:0,c=null===(s=t.chat)||void 0===s?void 0:s.messages.filter(t=>t.timeMs>l);this.unreadMessageCount=c.length||0,null===(a=t.chat)||void 0===a||a.addListener("chatUpdate",this.onChatUpdate),this.canViewChat=nd(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?z(G,{title:this.t("chat")},ne(this.meeting)?this.hasNewMessages&&z("div",{class:"unread-count-dot",part:"unread-count-dot"}):0!==this.unreadMessageCount&&!this.chatActive&&z("div",{class:"unread-count",part:"unread-count"},z("span",null,this.unreadMessageCount<=100?this.unreadMessageCount:"99+")),z("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})):z(G,{"data-hidden":!0})}static get watchers(){return{meeting:["meetingChanged"],states:["statesChanged"],chatActive:["handleChatActiveChange"]}}};dd([si()],hd.prototype,"meeting",void 0),dd([si()],hd.prototype,"states",void 0),dd([si()],hd.prototype,"size",void 0),dd([si()],hd.prototype,"iconPack",void 0),dd([si()],hd.prototype,"t",void 0),hd.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 pd=Object.freeze({__proto__:null,rtk_chat_toggle:hd});var ud=function(t,e,i,r){var s,a=arguments.length,n=a<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--)(s=t[o])&&(n=(a<3?s(n):a>3?s(e,i,n):s(e,i))||n);return a>3&&n&&Object.defineProperty(e,i,n),n};const gd=t=>Math.trunc(t).toString().padStart(2,"0"),fd=class{constructor(t){o(this,t),this.iconPack=Ne,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=`${gd(t/3600)}:`),e+=`${gd(t%3600/60)}:${gd(t%60)}`,e}render(){const t=void 0!==this.startedTime;return z(G,{key:"2775471382c6d07aae0ba8e18677d6850fd9cb34","data-hidden":!t,tabIndex:0,role:"timer","aria-live":"off"},void 0!==this.startedTime&&[z("rtk-icon",{key:"48b8bdfeef973d7f3eb4cdd526e386226a4b999a",icon:this.iconPack.clock,"aria-hidden":!0,tabIndex:-1,part:"icon"}),z("span",{key:"9f2bb7aa7adc6ecb65c5fef57e406801e6592e59",part:"text"},this.getFormattedTime())])}static get watchers(){return{meeting:["meetingChanged"],startedTime:["startedTimeChanged"]}}};ud([si()],fd.prototype,"meeting",void 0),ud([si()],fd.prototype,"iconPack",void 0),fd.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 md=Object.freeze({__proto__:null,rtk_clock:fd});var vd=function(t,e,i,r){var s,a=arguments.length,n=a<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--)(s=t[o])&&(n=(a<3?s(n):a>3?s(e,i,n):s(e,i))||n);return a>3&&n&&Object.defineProperty(e,i,n),n};const bd=class{constructor(t){o(this,t),this.variant="solid",this.disableRender=!1,this.config=Ie,this.iconPack=Ne,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 z(G,{key:"03a753b729584aee302a0e76f7961ae057dc0746"},!this.disableRender&&z(rr,{key:"488995338fff693e38de3f98f72a656cd71a5882",element:"rtk-controlbar",defaults:t,onlyChildren:!0}),z("slot",{key:"6fb547f8c56b9a610c532d66aa3582d16b3b40ef"}))}};vd([si()],bd.prototype,"meeting",void 0),vd([si()],bd.prototype,"states",void 0),vd([si()],bd.prototype,"iconPack",void 0),vd([si()],bd.prototype,"t",void 0),vd([si()],bd.prototype,"size",void 0),bd.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 kd=Object.freeze({__proto__:null,rtk_controlbar:bd});var yd=function(t,e,i,r){var s,a=arguments.length,n=a<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--)(s=t[o])&&(n=(a<3?s(n):a>3?s(e,i,n):s(e,i))||n);return a>3&&n&&Object.defineProperty(e,i,n),n};const wd=class{constructor(t){o(this,t),this.stateUpdate=W(this,"rtkStateUpdate",7),this.variant="button",this.t=Fe(),this.iconPack=Ne}toggleDebugger(){var t;this.stateUpdate.emit({activeDebugger:!(null===(t=this.states)||void 0===t?void 0:t.activeDebugger),activeMoreMenu:!1})}render(){return z(G,{key:"e46722c024802f6c96cebb487c9049e8834c48f8",title:this.t("Troubleshooting")},z("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}))}};yd([si()],wd.prototype,"meeting",void 0),yd([si()],wd.prototype,"states",void 0),yd([si()],wd.prototype,"t",void 0),yd([si()],wd.prototype,"iconPack",void 0),yd([si()],wd.prototype,"size",void 0),wd.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 xd=Object.freeze({__proto__:null,rtk_debugger_toggle:wd});var Sd=function(t,e,i,r){var s,a=arguments.length,n=a<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--)(s=t[o])&&(n=(a<3?s(n):a>3?s(e,i,n):s(e,i))||n);return a>3&&n&&Object.defineProperty(e,i,n),n};const Ed=class{constructor(t){o(this,t),this.config=Ie,this.icon=Ne,this.t=Fe(),this.iconPack=Ne,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 z(G,null,z("div",{class:"ctr",part:"container"},z("rtk-icon",{icon:this.iconPack.breakout_rooms}),z("p",{part:"message",class:"breakout"},this.t(this.message))))}render(){const t=this.states;return"connected-meeting"===t.roomLeftState?this.renderBreakoutRoomScreen():z(G,null,z("div",{class:"ctr",part:"container"},z("rtk-logo",{meeting:this.meeting,config:this.config,part:"logo",t:this.t}),z("p",{part:"message"},this.t(this.message)),"disconnected"===(null==t?void 0:t.roomLeftState)&&z("span",{part:"description"},this.t("ended.network"))))}static get watchers(){return{states:["statesChanged"]}}};Sd([si()],Ed.prototype,"size",void 0),Sd([si()],Ed.prototype,"states",void 0),Sd([si()],Ed.prototype,"t",void 0),Sd([si()],Ed.prototype,"iconPack",void 0),Sd([si()],Ed.prototype,"meeting",void 0),Ed.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 Pd=Object.freeze({__proto__:null,rtk_ended_screen:Ed});var Td=function(t,e,i,r){var s,a=arguments.length,n=a<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--)(s=t[o])&&(n=(a<3?s(n):a>3?s(e,i,n):s(e,i))||n);return a>3&&n&&Object.defineProperty(e,i,n),n};const Ld=class{constructor(t){o(this,t),this.onDropCallback=W(this,"dropCallback",7),this.iconPack=Ne,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 z(G,{key:"197cf2a1b1deff5e45125b4e489d020d474a02dd"},z("div",{key:"84e88151d3080dc0bd9f44f22b401d605f7f286f",id:"dropzone",class:{active:this.dropzoneActivated},part:"dropzone"},z("rtk-icon",{key:"debea53f3376bb54bca692aed0450cf218f576d3",icon:this.iconPack.attach}),z("p",{key:"19b161b26bd4acc13447c47f5ee17b9645f91cc3"},this.t("chat.send_attachment"))))}};Td([si()],Ld.prototype,"iconPack",void 0),Td([si()],Ld.prototype,"t",void 0),Ld.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 Cd=Object.freeze({__proto__:null,rtk_file_dropzone:Ld}),_d="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};var Ad=function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)},Rd="object"==typeof _d&&_d&&_d.Object===Object&&_d,Id="object"==typeof self&&self&&self.Object===Object&&self,Dd=Rd||Id||Function("return this")(),Md=Dd,Od=function(){return Md.Date.now()},Ud=/\s/;var $d=function(t){for(var e=t.length;e--&&Ud.test(t.charAt(e)););return e},Fd=$d,Nd=/^\s+/;var jd=function(t){return t?t.slice(0,Fd(t)+1).replace(Nd,""):t},zd=Dd.Symbol,Bd=zd,Gd=Object.prototype,Hd=Gd.hasOwnProperty,Vd=Gd.toString,qd=Bd?Bd.toStringTag:void 0;var Kd=function(t){var e=Hd.call(t,qd),i=t[qd];try{t[qd]=void 0;var r=!0}catch(t){}var s=Vd.call(t);return r&&(e?t[qd]=i:delete t[qd]),s},Yd=Object.prototype.toString;var Wd=Kd,Zd=function(t){return Yd.call(t)},Qd=zd?zd.toStringTag:void 0;var Xd=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":Qd&&Qd in Object(t)?Wd(t):Zd(t)},Jd=function(t){return null!=t&&"object"==typeof t};var th=jd,eh=Ad,ih=function(t){return"symbol"==typeof t||Jd(t)&&"[object Symbol]"==Xd(t)},rh=/^[-+]0x[0-9a-f]+$/i,sh=/^0b[01]+$/i,ah=/^0o[0-7]+$/i,nh=parseInt;var oh=Ad,lh=Od,ch=function(t){if("number"==typeof t)return t;if(ih(t))return NaN;if(eh(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=eh(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=th(t);var i=sh.test(t);return i||ah.test(t)?nh(t.slice(2),i?2:8):rh.test(t)?NaN:+t},dh=Math.max,hh=Math.min;var ph=function(t,e,i){var r,s,a,n,o,l,c=0,d=!1,h=!1,p=!0;if("function"!=typeof t)throw new TypeError("Expected a function");function u(e){var i=r,a=s;return r=s=void 0,c=e,n=t.apply(a,i)}function g(t){var i=t-l;return void 0===l||i>=e||i<0||h&&t-c>=a}function f(){var t=lh();if(g(t))return m(t);o=setTimeout(f,function(t){var i=e-(t-l);return h?hh(i,a-(t-c)):i}(t))}function m(t){return o=void 0,p&&r?u(t):(r=s=void 0,n)}function v(){var t=lh(),i=g(t);if(r=arguments,s=this,l=t,i){if(void 0===o)return function(t){return c=t,o=setTimeout(f,e),d?u(t):n}(l);if(h)return clearTimeout(o),o=setTimeout(f,e),u(l)}return void 0===o&&(o=setTimeout(f,e)),n}return e=ch(e)||0,oh(i)&&(d=!!i.leading,a=(h="maxWait"in i)?dh(ch(i.maxWait)||0,e):a,p="trailing"in i?!!i.trailing:p),v.cancel=function(){void 0!==o&&clearTimeout(o),c=0,r=l=s=o=void 0},v.flush=function(){return void 0===o?n:m(lh())},v};function uh(t,e){const i=Math.pow(10,e);return Math.floor(t*i)/i}function gh({dimensions:t,count:e,aspectRatio:i,gap:r}){const{width:s,height:a,rows:n,cols:o}=function({count:t,dimensions:e,aspectRatio:i,gap:r}){let{width:s,height:a}=e;if(0===s||0===a)return{width:0,height:0,rows:1,cols:1};s-=2*r,a-=2*r;const n=r,o=t,l=fh(i);let c=0,d=0,h=1,p=1;const u=[];for(let t=1;t<=o;t++)u.push((s-n*(t-1))/t),u.push((a-n*(t-1))/(t*l));u.sort((t,e)=>e-t);for(const t of u)if(c=uh(t,4),d=uh(c*l,4),h=Math.floor((s+n)/(c+n)),p=Math.floor((a+n)/(d+n)),h*p>=o){p=Math.ceil(o/h);break}return{width:c,height:d,rows:p,cols:h}}({dimensions:t,count:e,aspectRatio:i,gap:r}),l=function({parentDimensions:t,dimensions:e,rows:i,cols:r,count:s,gap:a}){const{width:n,height:o}=t,{width:l,height:c}=e,d=(o-(c*i+(i-1)*a))/2;let h=(n-(l*r+(r-1)*a))/2;const p=c+a,u=l+a;let g=0,f=0;const m=s%r;function v(t){const e=s-t;e===m&&(h=(n-(l*e+(e-1)*a))/2);const i=d+f*p,o=h+g*u;return g++,(t+1)%r===0&&(f++,g=0),{top:i,left:o}}return v}({parentDimensions:t,dimensions:{width:s,height:a},rows:n,cols:o,count:e,gap:r});return{width:s,height:a,getPosition:l}}const fh=t=>{const[e,i]=t.split(":");return Number.parseInt(i)/Number.parseInt(e)},mh={spotlight:"sm",mixed:"sm"};var vh=function(t,e,i,r){var s,a=arguments.length,n=a<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--)(s=t[o])&&(n=(a<3?s(n):a>3?s(e,i,n):s(e,i))||n);return a>3&&n&&Object.defineProperty(e,i,n),n};const bh=class{constructor(t){o(this,t),this.stateUpdate=W(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=Ie,this.iconPack=Ne,this.t=Fe(),this.gridSize=mh,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=ph(()=>{this.updateActiveParticipants()},50),this.onParticipantLeft=ph(()=>{this.updateActiveParticipants()},50),this.stageStatusListener=()=>{this.updateActiveParticipants(),this.showLiveStreamPlayer=Wt(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:s}=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==s||s.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,s,a;if(null!==e&&this.disconnectMeeting(e),null!=t){const{self:e,participants:n,plugins:o,stage:l}=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:c}=e;this.roomState=e.roomState;const d="ON_STAGE"!==this.meeting.stage.status,h=null==c?void 0:c.isRecorder;this.hideSelf=d||h||c.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==c?void 0:c.stageEnabled)&&(this.canCurrentPeerHost=c.acceptStageRequests||c.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==l||l.addListener("stageStatusUpdate",this.stageStatusListener),null==o||o.all.addListener("stateUpdate",this.onPluginStateUpdate),n.addListener("viewModeChanged",this.onViewModeChanged),n.active.addListener("participantLeft",this.onParticipantLeft),null===(s=null==n?void 0:n.joined)||void 0===s||s.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===(a=t.stage)||void 0===a?void 0:a.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)?z(G,null,z("div",{class:"offline-grid"},z("rtk-icon",{icon:this.iconPack.join_stage,size:"xl"}),z("h3",null,this.t("disconnected")),z("p",null,this.t("disconnected.description")))):"disconnected"===this.roomState?z(G,null,z("div",{class:"offline-grid"},z("rtk-icon",{icon:this.iconPack.disconnected,size:"xl"}),z("h3",null,this.t("offline")),z("p",null,this.t("offline.description")))):"failed"===this.roomState?z(G,null,z("div",{class:"offline-grid"},z("rtk-icon",{icon:this.iconPack.disconnected,size:"xl"}),z("h3",null,this.t("failed")),z("p",null,this.t("failed.description")))):this.showLiveStreamPlayer?z(G,null,z("rtk-livestream-player",{meeting:this.meeting,size:this.size}),z("rtk-livestream-indicator",{meeting:this.meeting,size:"sm",t:this.t}),z("rtk-viewer-count",{meeting:this.meeting,variant:"embedded",t:this.t})):this.emptyStage?z(G,null,z("div",{class:"webinar-stage"},z("div",{class:"center"},this.canCurrentPeerHost&&z("div",{class:"ctr",part:"container"},z("p",{class:"message",part:"message"},this.t("stage.empty_host")),z("span",{class:"description",part:"description"},this.t("stage.empty_host_summary"))),!this.canCurrentPeerHost&&z("div",{class:"ctr",part:"container"},z("p",{class:"message",part:"message"},this.t("stage.empty_viewer")))))):z(G,null,z(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}),z("rtk-livestream-indicator",{meeting:this.meeting,size:"sm",t:this.t}),z("rtk-viewer-count",{meeting:this.meeting,variant:"embedded"}))}static get watchers(){return{meeting:["meetingChanged"],overrides:["overridesChanged"],screenShareParticipants:["screenShareParticipantsChanged"],plugins:["pluginsChanged"],pinnedParticipants:["pinnedParticipantsChanged"]}}};vh([si()],bh.prototype,"meeting",void 0),vh([si()],bh.prototype,"size",void 0),vh([si()],bh.prototype,"states",void 0),vh([si()],bh.prototype,"iconPack",void 0),vh([si()],bh.prototype,"t",void 0),bh.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 kh=Object.freeze({__proto__:null,rtk_grid:bh});var yh=function(t,e,i,r){var s,a=arguments.length,n=a<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--)(s=t[o])&&(n=(a<3?s(n):a>3?s(e,i,n):s(e,i))||n);return a>3&&n&&Object.defineProperty(e,i,n),n};const wh=class{constructor(t){o(this,t),this.variant="rounded",this.iconPack=Ne,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=ph(()=>{var t;const{self:e,participants:i}=this.meeting,{mobile:r,desktop:s}=null===(t=e.config)||void 0===t?void 0:t.maxVideoStreams,a="sm"===this.size?r:s,n=i.joined.toArray().filter(t=>"ON_STAGE"===t.stageStatus).length;this.showPagination=!(n<a)},50),this.onParticipantJoin=ph(()=>{this.pageCount=this.meeting.participants.pageCount,this.toggleGridPagination()},50),this.onParticipantLeave=ph(()=>{this.pageCount=this.meeting.participants.pageCount,this.toggleGridPagination()},50),this.onStateStatusUpdate=ph(()=>{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?z(G,{"data-hidden":!0}):z(G,null,z("rtk-button",{class:"prev",variant:"secondary",kind:"icon",disabled:0===this.pageCount,onClick:this.prevPage,"aria-label":this.t("page.prev")},z("rtk-icon",{icon:this.iconPack.chevron_left})),"grid"!==this.variant&&z("div",{class:"center"},z("span",{class:"page"},0===this.pageCount?z("rtk-tooltip",{label:this.t("layout.auto")},z("rtk-button",{kind:"icon",class:"auto"},z("rtk-icon",{icon:this.iconPack.wand}))):this.page),0!==this.pageCount&&[z("span",{class:"slash"},"/"),z("span",{class:"pages"},this.pageCount)]),"grid"===this.variant&&this.pageCount>0&&z("div",{class:"dots"},[...Array(this.pageCount)].map((t,e)=>z("div",{key:`dot-${e}`,class:{dot:!0,active:e+1===this.page}}))),z("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")},z("rtk-icon",{icon:this.iconPack.chevron_right,tabIndex:-1,"aria-hidden":!0})))}static get watchers(){return{meeting:["meetingChanged"],size:["sizeChanged"]}}};yh([si()],wh.prototype,"meeting",void 0),yh([si()],wh.prototype,"states",void 0),yh([si()],wh.prototype,"size",void 0),yh([si()],wh.prototype,"iconPack",void 0),yh([si()],wh.prototype,"t",void 0),wh.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 xh=Object.freeze({__proto__:null,rtk_grid_pagination:wh});var Sh=function(t,e,i,r){var s,a=arguments.length,n=a<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--)(s=t[o])&&(n=(a<3?s(n):a>3?s(e,i,n):s(e,i))||n);return a>3&&n&&Object.defineProperty(e,i,n),n};const Eh=class{constructor(t){o(this,t),this.variant="solid",this.disableRender=!1,this.config=Ie,this.iconPack=Ne,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 z(G,{key:"0b3c18e3927465e198c26f79d810dadc31ebb74b"},!this.disableRender&&z(rr,{key:"480d2f17a6d831dabb3d39abceb33fbc1aa6d78d",element:"rtk-header",defaults:t,onlyChildren:!0}),z("slot",{key:"67f89c4a3574ba22976d3aa57268aabe4ce78d2a"}))}};Sh([si()],Eh.prototype,"meeting",void 0),Sh([si()],Eh.prototype,"states",void 0),Sh([si()],Eh.prototype,"iconPack",void 0),Sh([si()],Eh.prototype,"t",void 0),Sh([si()],Eh.prototype,"size",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{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 Ph=Object.freeze({__proto__:null,rtk_header:Eh});var Th=function(t,e,i,r){var s,a=arguments.length,n=a<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--)(s=t[o])&&(n=(a<3?s(n):a>3?s(e,i,n):s(e,i))||n);return a>3&&n&&Object.defineProperty(e,i,n),n};const Lh=class{constructor(t){o(this,t),this.config=Ie,this.iconPack=Ne,this.t=Fe()}render(){return z(G,{key:"9f9d0064dfc52af63ae90921929b25c822cb4d8c"},z("slot",{key:"c1c5744d86e89b22fa5f5c1b623ea97c0a1d2731"},z("div",{key:"25e311957c411c61940fa1d51e350d466b0b2c92",class:"ctr",part:"container"},z("rtk-logo",{key:"daac0467ba4c3f5f9c7e23667c928e4ed40d6f96",meeting:this.meeting,config:this.config,t:this.t,part:"logo"}),z("rtk-spinner",{key:"c36f58219362cb8d6c31eb975004428439592d3f","aria-label":"Idle, waiting for meeting data",part:"spinner",iconPack:this.iconPack}))))}};Th([si()],Lh.prototype,"meeting",void 0),Th([si()],Lh.prototype,"iconPack",void 0),Th([si()],Lh.prototype,"t",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{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 Ch=Object.freeze({__proto__:null,rtk_idle_screen:Lh});var _h=function(t,e,i,r){var s,a=arguments.length,n=a<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--)(s=t[o])&&(n=(a<3?s(n):a>3?s(e,i,n):s(e,i))||n);return a>3&&n&&Object.defineProperty(e,i,n),n};const Ah=class{constructor(t){o(this,t),this.close=W(this,"close",7),this.t=Fe(),this.iconPack=Ne,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 z(G,{key:"2bb235425497f7932f5cfd73ab7faa2c15d3691d",class:"scrollbar",onClick:t=>t.stopPropagation()},z("div",{key:"04dd5a250967f61e20b7b8fe559ca4ea1012f949",class:"header"},z("div",{key:"9f533863c5d32c7333c872333d7c6c14c02f5827",class:"shared-by-user"},this.t("chat.img.shared_by")," ",z("span",{key:"6e24710128bef29114ba0fa4f7c06561a7293a96",class:"displayName"},ti(Qe(this.image.displayName)))),z("div",{key:"1d7e518f2b61c74634885518450a0364691205cb",class:"actions"},z("rtk-button",{key:"b9ca96cf9eef4dfe347412daeec77f6b5183e5c5",onClick:()=>nr(this.image.link,{fallbackName:"image"})},z("rtk-icon",{key:"ee1326105412e04d113b35a8b1815f22c0699b87",icon:this.iconPack.download,slot:"start"}),"Download"),z("rtk-button",{key:"240d7f9f00f19031402bfca7c54d65a1f3bbef6d",kind:"icon",variant:"secondary",onClick:()=>this.close.emit()},z("rtk-icon",{key:"91e47a9b52baf9f28efda7b1d98f12d90724da1f",icon:this.iconPack.dismiss})))),z("div",{key:"e50deb0d992a18b49641ccfde023f256083d05c7",class:"image-ctr"},z("img",{key:"febe53b5401100dd4a7e9c46693302e4c8dd711c",src:this.image.link})))}};_h([si()],Ah.prototype,"size",void 0),_h([si()],Ah.prototype,"t",void 0),_h([si()],Ah.prototype,"iconPack",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)}.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 Rh=Object.freeze({__proto__:null,rtk_image_viewer:Ah});const Ih=class{constructor(t){o(this,t),this.iconPack=Ne}render(){return z(G,{key:"3dc48c8a69876a68b038340a948057dd04a5e9ef"},z("div",{key:"1f5a9c5379f882b249dee77376959d9b4de09d0b",class:"tooltip-container"},z("rtk-icon",{key:"cb0232b6e72f565895d3027747f957cba0e4910f",icon:this.iconPack.info,size:"sm"}),z("div",{key:"35a1b7abbb2026badb606444b330fcb239865d9f",class:"tooltip"},z("slot",{key:"3295df905bcd5c10f31d211e74bf7a0e4413dd87",name:"tootlip-text"}))))}};!function(t,e,i,r){var s,a=arguments.length,n=a<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--)(s=t[o])&&(n=(a<3?s(n):a>3?s(e,i,n):s(e,i))||n);a>3&&n&&Object.defineProperty(e,i,n)}([si()],Ih.prototype,"iconPack",void 0),Ih.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 Dh=Object.freeze({__proto__:null,rtk_information_tooltip:Ih});var Mh=function(t,e,i,r){var s,a=arguments.length,n=a<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--)(s=t[o])&&(n=(a<3?s(n):a>3?s(e,i,n):s(e,i))||n);return a>3&&n&&Object.defineProperty(e,i,n),n};const Oh=class{constructor(t){o(this,t),this.stateUpdate=W(this,"rtkStateUpdate",7),this.variant="button",this.iconPack=Ne,this.t=Fe(),this.leave=()=>{this.stateUpdate.emit({activeLeaveConfirmation:!0})}}render(){const t=this.t("leave");return z(G,{key:"2ce38b68e83d44e924766230f74b18111db72771",label:t},z("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"}))}};Mh([si()],Oh.prototype,"size",void 0),Mh([si()],Oh.prototype,"iconPack",void 0),Mh([si()],Oh.prototype,"t",void 0),Oh.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 Uh=Object.freeze({__proto__:null,rtk_leave_button:Oh});var $h=function(t,e,i,r){var s,a=arguments.length,n=a<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--)(s=t[o])&&(n=(a<3?s(n):a>3?s(e,i,n):s(e,i))||n);return a>3&&n&&Object.defineProperty(e,i,n),n};const Fh=class{constructor(t){o(this,t),this.stateUpdate=W(this,"rtkStateUpdate",7),this.apiError=W(this,"rtkApiError",7),this.variant="button",this.iconPack=Ne,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)?z(G,null,z("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})):z(G,{"data-hidden":!0})}static get watchers(){return{meeting:["meetingChanged"]}}};$h([si()],Fh.prototype,"meeting",void 0),$h([si()],Fh.prototype,"size",void 0),$h([si()],Fh.prototype,"iconPack",void 0),$h([si()],Fh.prototype,"t",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)}:host{display:block}:host([data-hidden]){display:none}";var Nh=Object.freeze({__proto__:null,rtk_livestream_toggle:Fh});var jh=function(t,e,i,r){var s,a=arguments.length,n=a<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--)(s=t[o])&&(n=(a<3?s(n):a>3?s(e,i,n):s(e,i))||n);return a>3&&n&&Object.defineProperty(e,i,n),n};const zh=class{constructor(t){o(this,t),this.iconPack=Ne,this.t=Fe()}render(){var t;const e=null===(t=this.meeting)||void 0===t?void 0:t.meta.meetingTitle;return null==e?z(G,{"data-hidden":!0}):z(G,{role:"banner","aria-label":e},z("rtk-tooltip",{label:e,part:"tooltip"},z("div",{class:"title",part:"title"},e)))}};jh([si()],zh.prototype,"meeting",void 0),jh([si()],zh.prototype,"iconPack",void 0),jh([si()],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{-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 Bh=Object.freeze({__proto__:null,rtk_meeting_title:zh});const Gh=class{constructor(t){o(this,t),this.visibleItemsCount=20,this.estimateItemSize=100,this.iconPack=Ne,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,s=e;i<=this.visibleItemsCount?(r=0,s=i-1):e-t<this.visibleItemsCount-1&&(r=this.range.end-this.visibleItemsCount+1),this.range.start!==r&&(this.range={start:r,end:s},this.totalHeight=this.getRangeSize(0,i))},this.getEstimatedItemSize=()=>this.estimateItemSize,this.getRangeSize=(t,e)=>{let i=0,r=0;for(let s=t;s<e;s++)r=this.sizes.get(this.messages[s].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,s=this.messages.length;for(;e<=s;){if(i=e+s>>>1,r=this.getRangeSize(0,i),r===t)return i;r<t?e=i+1:r>t&&(s=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&&P(()=>{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 z("div",{key:"0bd9791d55b2c7b17e0f2165815d592e400612b6",class:"scrollbar content-wrapper",ref:t=>this.$listRef=t,onScroll:this.handleScroll},z("div",{key:"b255bce421935f065862a6a3a34e9ae588c936cd",class:"scroller"},z("div",{key:"3eab5b317790b234f1a5c1935d7b8bf4d48620eb",style:{height:`${this.totalHeight}px`}}),z("div",{key:"47d070acc6cdd5e5cdd146594dbcb53906e5fc37",class:"smallest-dom-element",id:"list-end",ref:t=>this.$listEndRef=t})),z("div",{key:"348ec8b65c0f76146f6ab65cbda80057dde6d93d",class:"content",style:{transform:`translateY(${this.getRangeSize(0,this.range.start)}px)`}},this.isFetching&&z("div",{key:"100d528dae04469574a6c908ba4e0159d61a928f",class:"loader"},z("rtk-spinner",{key:"a3a7cc932bd40b71bf67d9bb95cb7cdd8e36696f",size:"md"})),this.getVisibleItems().map((t,e)=>z("div",{key:t.id,ref:i=>this.rendererInternal(i,t,e)}))))}static get watchers(){return{messages:["messagesUpdated"]}}};!function(t,e,i,r){var s,a=arguments.length,n=a<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--)(s=t[o])&&(n=(a<3?s(n):a>3?s(e,i,n):s(e,i))||n);a>3&&n&&Object.defineProperty(e,i,n)}([si()],Gh.prototype,"iconPack",void 0),Gh.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 Hh=Object.freeze({__proto__:null,rtk_message_list_view:Gh});var Vh=function(t,e,i,r){var s,a=arguments.length,n=a<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--)(s=t[o])&&(n=(a<3?s(n):a>3?s(e,i,n):s(e,i))||n);return a>3&&n&&Object.defineProperty(e,i,n),n};const qh=class{constructor(t){o(this,t),this.stateUpdate=W(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=Ne,this.t=Fe(),this.audioEnabled=!1,this.canProduceAudio=!1,this.micPermission="NOT_REQUESTED",this.stageStatus="OFF_STAGE",this.toggleMic=()=>{var t,e,i,r,s,a,n,o,l,c,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===(a=null===(s=null===(r=this.meeting)||void 0===r?void 0:r.self)||void 0===s?void 0:s.permissions)||void 0===a?void 0:a.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===(c=null===(l=this.meeting)||void 0===l?void 0:l.stage)||void 0===c?void 0:c.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,s,a,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===(a=null===(s=this.meeting)||void 0===s?void 0:s.self)||void 0===a?void 0:a.permissions)||void 0===n||n.removeListener("permissionsUpdate",this.meetingPermissionsUpdateListener)}meetingChanged(t){var e,i;if(null!=t){const{self:r,stage:s}=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==s||s.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={},s=this.hasPermissionError(),a="COULD_NOT_START"===this.micPermission;return this.audioEnabled&&!s?(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=a?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:s||a,disable:s}}render(){if(!this.canProduceAudio||["OFF_STAGE","REQUESTED_TO_JOIN_STAGE"].includes(this.stageStatus))return z(G,{"data-hidden":!0});const{tooltipLabel:t,label:e,icon:i,classList:r,showWarning:s,disable:a}=this.getState();return z(G,{title:e},z("rtk-tooltip",{kind:"block",label:t,part:"tooltip"},z("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:s,disabled:a})))}static get watchers(){return{meeting:["meetingChanged"]}}};Vh([si()],qh.prototype,"meeting",void 0),Vh([si()],qh.prototype,"size",void 0),Vh([si()],qh.prototype,"iconPack",void 0),Vh([si()],qh.prototype,"t",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: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 Kh=Object.freeze({__proto__:null,rtk_mic_toggle:qh});var Yh=function(t,e,i,r){var s,a=arguments.length,n=a<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--)(s=t[o])&&(n=(a<3?s(n):a>3?s(e,i,n):s(e,i))||n);return a>3&&n&&Object.defineProperty(e,i,n),n};const Wh=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=Ie,this.iconPack=Ne,this.t=Fe(),this.gridSize=mh}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,s;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===(s=t.meta)||void 0===s||s.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 z(G,{key:"52e26a16c20eee51ac0f3d01d932df88d58acb05"},z("main",{key:"1838e7498d579bf70346bf921c9f3966721a1eea",id:"main-view",part:"main-view"},(null===(t=this.getTabs())||void 0===t?void 0:t.length)>1&&z("rtk-tab-bar",Object.assign({key:"b3f5f77e4b0bd36d12014881f0507c9de6e613af",activeTab:this.activeTab,tabs:this.getTabs(),onTabChange:t=>this.setActiveTab(t.detail)},i)),z("div",{id:"tabs",key:"tabs"},this.screenShareParticipants.map(t=>{var e,r;return z(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 z("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"}}))}))),z(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 Y(this)}static get watchers(){return{meeting:["meetingChanged"],screenShareParticipants:["screenShareParticipantsChanged"],plugins:["pluginsChanged"]}}};Yh([si()],Wh.prototype,"size",void 0),Yh([si()],Wh.prototype,"meeting",void 0),Yh([si()],Wh.prototype,"states",void 0),Yh([si()],Wh.prototype,"iconPack",void 0),Yh([si()],Wh.prototype,"t",void 0),Wh.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 Zh=Object.freeze({__proto__:null,rtk_mixed_grid:Wh});var Qh=function(t,e,i,r){var s,a=arguments.length,n=a<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--)(s=t[o])&&(n=(a<3?s(n):a>3?s(e,i,n):s(e,i))||n);return a>3&&n&&Object.defineProperty(e,i,n),n};const Xh=class{constructor(t){o(this,t),this.stateUpdate=W(this,"rtkStateUpdate",7),this.iconPack=Ne,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 z(G,{key:"cc4c42c7e70920678ccd5504299cc2ea132ba082",title:t},this.states.activeMoreMenu&&z("div",{key:"4e15d624377561cc3bfac660822041079387d15c",class:"more-menu"},z("slot",{key:"83c8c81d94edbed4d30143fe4a0a9fc77f7c3883",name:"more-elements"})),z("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"}),z("slot",{key:"06155b80eabc3aa0c8495c5bc447af457acdd038",name:"expanded"}))}get host(){return Y(this)}};Qh([si()],Xh.prototype,"states",void 0),Qh([si()],Xh.prototype,"size",void 0),Qh([si()],Xh.prototype,"iconPack",void 0),Qh([si()],Xh.prototype,"t",void 0),Xh.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 Jh=Object.freeze({__proto__:null,rtk_more_toggle:Xh});var tp=function(t,e,i,r){var s,a=arguments.length,n=a<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--)(s=t[o])&&(n=(a<3?s(n):a>3?s(e,i,n):s(e,i))||n);return a>3&&n&&Object.defineProperty(e,i,n),n};const ep=class{constructor(t){o(this,t),this.stateUpdate=W(this,"rtkStateUpdate",7),this.variant="button",this.iconPack=Ne,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 z(G,{title:t},z("rtk-tooltip",{kind:"block",label:t,part:"tooltip"},z("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"]}}};tp([si()],ep.prototype,"meeting",void 0),tp([si()],ep.prototype,"size",void 0),tp([si()],ep.prototype,"iconPack",void 0),tp([si()],ep.prototype,"t",void 0),ep.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 ip=Object.freeze({__proto__:null,rtk_mute_all_button:ep});var rp=function(t,e,i,r){var s,a=arguments.length,n=a<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--)(s=t[o])&&(n=(a<3?s(n):a>3?s(e,i,n):s(e,i))||n);return a>3&&n&&Object.defineProperty(e,i,n),n};const sp=class{constructor(t){o(this,t),this.iconPack=Ne,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 z(G,null,z("rtk-icon",{icon:this.iconPack[`signal_${t}`],class:e}),z("rtk-icon",{icon:this.iconPack.signal_5,class:"bg-signal"}))}static get watchers(){return{participant:["participantChanged"]}}};rp([si()],sp.prototype,"meeting",void 0),rp([si()],sp.prototype,"iconPack",void 0),rp([si()],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;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 ap=Object.freeze({__proto__:null,rtk_network_indicator:sp});var np=function(t,e,i,r){var s,a=arguments.length,n=a<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--)(s=t[o])&&(n=(a<3?s(n):a>3?s(e,i,n):s(e,i))||n);return a>3&&n&&Object.defineProperty(e,i,n),n};const op=class{constructor(t){o(this,t),this.iconPack=Ne,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=Wt(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=Wt(this.meeting)},null==t||t.stage.addListener("stageStatusUpdate",this.stageUpdateListener)),t.self.addListener("roomJoined",this.countListener))}render(){return this.isViewer?z(G,{"data-hidden":!0}):z(G,{tabIndex:0,role:"log","aria-label":`${this.participantCount} ${this.t("participants")}`},z("rtk-icon",{icon:this.iconPack.people,tabIndex:-1,"aria-hidden":!0,part:"icon"}),this.participantCount)}static get watchers(){return{meeting:["meetingChanged"]}}};np([si()],op.prototype,"meeting",void 0),np([si()],op.prototype,"iconPack",void 0),np([si()],op.prototype,"t",void 0),np([si()],op.prototype,"size",void 0),op.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 lp=Object.freeze({__proto__:null,rtk_participant_count:op});var cp=function(t,e,i,r){var s,a=arguments.length,n=a<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--)(s=t[o])&&(n=(a<3?s(n):a>3?s(e,i,n):s(e,i))||n);return a>3&&n&&Object.defineProperty(e,i,n),n};const dp=class{constructor(t){o(this,t),this.isPinned=!1,this.nameTagPosition="bottom-left",this.isPreview=!1,this.config=Ie,this.variant="solid",this.iconPack=Ne,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 z(G,{key:"69573519e7127835dd9304dcfb507ebbb94e0de8"},z("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}),z("slot",{key:"3bdccee7fb4e001425249fe832b4bdcb01751306"}))}static get watchers(){return{participant:["participantsChanged"],videoState:["videoStateChanged"]}}};cp([si()],dp.prototype,"states",void 0),cp([si()],dp.prototype,"size",void 0),cp([si()],dp.prototype,"iconPack",void 0),cp([si()],dp.prototype,"t",void 0),dp.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 hp=Object.freeze({__proto__:null,rtk_participant_setup:dp});var pp=function(t,e,i,r){var s,a=arguments.length,n=a<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--)(s=t[o])&&(n=(a<3?s(n):a>3?s(e,i,n):s(e,i))||n);return a>3&&n&&Object.defineProperty(e,i,n),n};const up=class{constructor(t){o(this,t),this.stateUpdate=W(this,"rtkStateUpdate",7),this.config=Ie,this.iconPack=Ne,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 s=[];this.shouldShowRequestsTab()&&s.push({id:"requests",name:z("span",null,this.t("requests")," ",z("span",{class:`tab-participant-count-badge ${e>0?"requests-pending":""} ${"requests"===this.currentParticipantsTabId?"selected-tab":""}`},e))}),s.push({id:"stage-list",name:z("span",null,this.t("participants")," ",z("span",{class:"tab-participant-count-badge "+("stage-list"===this.currentParticipantsTabId?"selected-tab":"")},i))}),this.shouldShowViewersTab()&&s.push({id:"viewer-list",name:z("span",null,this.t("viewers")," ",z("span",{class:"tab-participant-count-badge "+("viewer-list"===this.currentParticipantsTabId?"selected-tab":"")},r))}),this.tabs=s,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 z(G,{key:"9957561cf7ae9a0a28d62bce7102dbb6145aaeda"},z("div",{key:"5960602654c8d993afc99ce22582514d1438182b",class:"search",part:"search"},z("rtk-icon",{key:"cc94e5fd1e5540b893f2bdb5b4ad4e3563d37424",icon:this.iconPack.search,part:"search-icon"}),z("input",{key:"c0a723db1be4d4a8c91907f24078678561a9bfb9",type:"search",autocomplete:"off",placeholder:this.t("search"),onInput:this.onSearchInput,part:"search-input"})),z("slot",{key:"7f145408b13056ad7e95b3469dc009ae46e73978",name:"start"}),z("div",{key:"465b74c71cd0239832ef60a0973537c71b394007",class:"ctr scrollbar "+("requests"!==this.currentParticipantsTabId?"virtualised":""),part:"container"},z("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)&&z("div",{key:"20d7a91bed3ea3047614d52ba30c5e832db6fce1",slot:"stage-list",style:{marginTop:"10px",height:"100%"}},z("rtk-participants-stage-list",Object.assign({key:"160ddba969e95e270e1443f11d48d989b4ee8561"},t,{search:this.search,hideHeader:!0}))),"requests"===this.currentParticipantsTabId&&z("div",{key:"52d4eae9480d00972b61c0e2964fcb8fc5498c89",slot:"requests",style:{marginTop:"10px",height:"100%"}},!this.hasRequests&&z("div",{key:"5690208be803224c202d81563be0fae45396dbeb",class:"no-pending-requests"},this.t("participants.no_pending_requests")),z("rtk-participants-stage-queue",Object.assign({key:"db4763d312a191c48279fa25168a1f363f574edc"},t)),z("rtk-participants-waiting-list",Object.assign({key:"f2b4ad3ad303b1c8a5314b5dd55de16c9c168c19"},t))),"viewer-list"===this.currentParticipantsTabId&&z("div",{key:"a262369c69afd77e101ec10934a9d4065590e748",slot:"viewer-list",style:{marginTop:"10px",height:"100%"}},z("rtk-participants-viewer-list",Object.assign({key:"0142b3855f357213ba24260091e5e7d48acb268d"},t,{search:this.search,hideHeader:!0}))))),z("slot",{key:"eae12c410cbe1282da2107420b4d44f66af5dd35",name:"end"}))}static get watchers(){return{meeting:["meetingChanged"],currentParticipantsTabId:["currentParticipantsTabIdChanged"]}}};pp([si()],up.prototype,"meeting",void 0),pp([si()],up.prototype,"states",void 0),pp([si()],up.prototype,"size",void 0),pp([si()],up.prototype,"iconPack",void 0),pp([si()],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)}.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 gp=Object.freeze({__proto__:null,rtk_participants:up});class fp{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 mp=function(t,e,i,r){var s,a=arguments.length,n=a<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--)(s=t[o])&&(n=(a<3?s(n):a>3?s(e,i,n):s(e,i))||n);return a>3&&n&&Object.defineProperty(e,i,n),n};const vp=class{constructor(t){o(this,t),this.dialogClose=W(this,"dialogClose",7),this.iconPack=Ne,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 fp(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(),Wt(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 z(G,{key:"8f6ac797ceb5f3fa6c8633e72174e9ae91e7979a"},this.showPlayDialog&&z("rtk-dialog",{key:"d1f5723dec7d7e9e66625deb9cebce63e26520e1",open:!0,onRtkDialogClose:this.onRtkDialogClose,hideCloseButton:!0,disableEscapeKey:!0,iconPack:this.iconPack,t:this.t},z("div",{key:"cd0de80766e3f1c665666f463bf405f44ed8323d",class:"modal"},z("h3",{key:"098d978b8c3aeba86328e23104fa7e73f12f2296"},this.t("audio_playback.title")),z("p",{key:"74d242093687ab9734392a8d5357c7a2c5cce8b9"},this.t("audio_playback.description")),z("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"]}}};mp([si()],vp.prototype,"meeting",void 0),mp([si()],vp.prototype,"iconPack",void 0),mp([si()],vp.prototype,"t",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;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 bp=Object.freeze({__proto__:null,rtk_participants_audio:vp});var kp=function(t,e,i,r){var s,a=arguments.length,n=a<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--)(s=t[o])&&(n=(a<3?s(n):a>3?s(e,i,n):s(e,i))||n);return a>3&&n&&Object.defineProperty(e,i,n),n};const yp=class{constructor(t){o(this,t),this.stateUpdate=W(this,"rtkStateUpdate",7),this.variant="button",this.iconPack=Ne,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=ld(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=ld(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 z(G,{"data-hidden":!0});const t=this.t("participants");return z(G,{title:t},0!==this.badgeCount&&!this.participantsActive&&z("div",{class:"waiting-participants-count",part:"waiting-participants-count"},z("span",null,this.badgeCount<=100?this.badgeCount:"99+")),z("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"]}}};kp([si()],yp.prototype,"meeting",void 0),kp([si()],yp.prototype,"states",void 0),kp([si()],yp.prototype,"size",void 0),kp([si()],yp.prototype,"iconPack",void 0),kp([si()],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{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 wp=Object.freeze({__proto__:null,rtk_participants_toggle:yp});var xp=function(t,e,i,r){var s,a=arguments.length,n=a<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--)(s=t[o])&&(n=(a<3?s(n):a>3?s(e,i,n):s(e,i))||n);return a>3&&n&&Object.defineProperty(e,i,n),n};const Sp=class{constructor(t){o(this,t),this.stateUpdate=W(this,"rtkStateUpdate",7),this.variant="button",this.config=Ie,this.iconPack=Ne,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 z(G,{"data-hidden":!0});const t=this.meeting.participants.pip.isActive;return z(G,{role:"log","aria-label":"Picture-in-Picture mode"},z("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"]}}};xp([si()],Sp.prototype,"meeting",void 0),xp([si()],Sp.prototype,"states",void 0),xp([si()],Sp.prototype,"iconPack",void 0),xp([si()],Sp.prototype,"size",void 0),xp([si()],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{display:block}:host([data-hidden]){display:none}";var Ep=Object.freeze({__proto__:null,rtk_pip_toggle:Sp});var Pp=function(t,e,i,r){var s,a=arguments.length,n=a<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--)(s=t[o])&&(n=(a<3?s(n):a>3?s(e,i,n):s(e,i))||n);return a>3&&n&&Object.defineProperty(e,i,n),n};const Tp=class{constructor(t){o(this,t),this.stateUpdate=W(this,"rtkStateUpdate",7),this.variant="button",this.iconPack=Ne,this.t=Fe(),this.pluginsActive=!1,this.canViewPlugins=!1,this.updateCanView=()=>{this.canViewPlugins=cd(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=cd(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 z(G,{"data-hidden":!0});const t=this.t("plugins");return z(G,{title:t},z("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"]}}};Pp([si()],Tp.prototype,"meeting",void 0),Pp([si()],Tp.prototype,"states",void 0),Pp([si()],Tp.prototype,"size",void 0),Pp([si()],Tp.prototype,"iconPack",void 0),Pp([si()],Tp.prototype,"t",void 0),Tp.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_plugins_toggle:Tp});var Cp=function(t,e,i,r){var s,a=arguments.length,n=a<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--)(s=t[o])&&(n=(a<3?s(n):a>3?s(e,i,n):s(e,i))||n);return a>3&&n&&Object.defineProperty(e,i,n),n};const _p=class{constructor(t){o(this,t),this.stateUpdate=W(this,"rtkStateUpdate",7),this.variant="button",this.iconPack=Ne,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=od(this.meeting)}}connectedCallback(){this.meetingChanged(this.meeting),this.statesChanged(this.states)}disconnectedCallback(){var t,e,i,r,s,a;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===(a=null===(s=this.meeting)||void 0===s?void 0:s.stage)||void 0===a||a.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=od(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 z(G,{"data-hidden":!0});const t=this.t("polls");return z(G,{title:t},0!==this.unreadPollsCount&&!this.pollsActive&&z("div",{class:"unread-count",part:"unread-count"},z("span",null,this.unreadPollsCount<=100?this.unreadPollsCount:"99+")),z("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"]}}};Cp([si()],_p.prototype,"meeting",void 0),Cp([si()],_p.prototype,"states",void 0),Cp([si()],_p.prototype,"size",void 0),Cp([si()],_p.prototype,"iconPack",void 0),Cp([si()],_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{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 Ap=Object.freeze({__proto__:null,rtk_polls_toggle:_p});var Rp=function(t,e,i,r){var s,a=arguments.length,n=a<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--)(s=t[o])&&(n=(a<3?s(n):a>3?s(e,i,n):s(e,i))||n);return a>3&&n&&Object.defineProperty(e,i,n),n};const Ip=class{constructor(t){o(this,t),this.t=Fe(),this.iconPack=Ne,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 z(G,{key:"3919ce20c5524d477536f62b9dd5abe8c1d49c37","data-hidden":!this.isRecording},this.isRecording&&z("div",{key:"c482fdc00ff90f8ae2841f8d469f3b54704b6615",class:"indicator","aria-label":this.t("recording.indicator"),part:"indicator"},z("rtk-icon",{key:"75663e533fe47c5ad2e5d55db5d8a027fc12220c",icon:this.iconPack.recording,"aria-hidden":!0,tabIndex:-1,part:"icon"}),z("span",{key:"99d4cc0c9ce7388808b643b0bcce27883d2b4643"},this.t("recording.label"))))}static get watchers(){return{meeting:["meetingChanged"]}}};Rp([si()],Ip.prototype,"meeting",void 0),Rp([si()],Ip.prototype,"size",void 0),Rp([si()],Ip.prototype,"t",void 0),Rp([si()],Ip.prototype,"iconPack",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}: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 Dp=Object.freeze({__proto__:null,rtk_recording_indicator:Ip});var Mp=function(t,e,i,r){var s,a=arguments.length,n=a<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--)(s=t[o])&&(n=(a<3?s(n):a>3?s(e,i,n):s(e,i))||n);return a>3&&n&&Object.defineProperty(e,i,n),n};const Op=class{constructor(t){o(this,t),this.apiError=W(this,"rtkApiError",7),this.variant="button",this.t=Fe(),this.iconPack=Ne,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 z(G,{title:this.t("RECORDING"===this.recordingState?"recording.stop":"recording.idle")},z("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"]}}};Mp([si()],Op.prototype,"meeting",void 0),Mp([si()],Op.prototype,"t",void 0),Mp([si()],Op.prototype,"iconPack",void 0),Mp([si()],Op.prototype,"size",void 0),Op.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 Up=Object.freeze({__proto__:null,rtk_recording_toggle:Op});var $p=function(t,e,i,r){var s,a=arguments.length,n=a<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--)(s=t[o])&&(n=(a<3?s(n):a>3?s(e,i,n):s(e,i))||n);return a>3&&n&&Object.defineProperty(e,i,n),n};const Fp=()=>"undefined"!=typeof navigator&&void 0!==navigator.mediaDevices&&"getDisplayMedia"in navigator.mediaDevices,Np=class{constructor(t){o(this,t),this.stateUpdate=W(this,"rtkStateUpdate",7),this.apiError=W(this,"rtkApiError",7),this.variant="button",this.iconPack=Ne,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(){Fp()?this.meetingChanged(this.meeting):this.meeting.__internals__.logger.error("[rtk-screenshare-toggle] Device does not support screensharing.")}disconnectedCallback(){var t,e,i,r,s,a;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===(a=null===(s=this.meeting)||void 0===s?void 0:s.stage)||void 0===a||a.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 s=this.hasPermissionError()&&!this.screenShareEnabled,a=this.reachedMaxScreenShares()&&!this.screenShareEnabled,n="COULD_NOT_START"===this.shareScreenPermission;this.screenShareEnabled&&!s?(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,a&&(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:s||a,showWarning:s||a||n}}render(){return Fp()&&this.canScreenShare&&!["OFF_STAGE","REQUESTED_TO_JOIN_STAGE"].includes(this.stageStatus)?z(G,{title:this.screenShareState.label},z("rtk-tooltip",{placement:"top",kind:"block",label:this.screenShareState.tooltipLabel,delay:600,part:"tooltip"},z("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}))):z(G,{"data-hidden":!0})}static get watchers(){return{meeting:["meetingChanged"]}}};$p([si()],Np.prototype,"states",void 0),$p([si()],Np.prototype,"meeting",void 0),$p([si()],Np.prototype,"size",void 0),$p([si()],Np.prototype,"iconPack",void 0),$p([si()],Np.prototype,"t",void 0),Np.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 jp=Object.freeze({__proto__:null,rtk_screen_share_toggle:Np});const zp=t=>{null!=t&&(null!=t.requestFullscreen?t.requestFullscreen():null!=t.mozRequestFullScreen?t.mozRequestFullScreen():null!=t.webkitRequestFullscreen?t.webkitRequestFullscreen():null!=t.msRequestFullscreen&&t.msRequestFullscreen())},Bp=()=>{null!=document.exitFullscreen?document.exitFullscreen():null!=document.mozExitFullScreen?document.mozExitFullScreen():null!=document.webkitExitFullscreen?document.webkitExitFullscreen():null!=document.msExitFullscreen&&document.msExitFullscreen()},Gp=()=>null!=document.fullscreenElement||null!=document.webkitCurrentFullScreenElement,Hp=()=>"undefined"!=typeof document&&(document.fullscreenEnabled||document.mozFullscreenEnabled||document.webkitFullscreenEnabled||document.msFullscreenEnabled);var Vp=function(t,e,i,r){var s,a=arguments.length,n=a<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--)(s=t[o])&&(n=(a<3?s(n):a>3?s(e,i,n):s(e,i))||n);return a>3&&n&&Object.defineProperty(e,i,n),n};const qp=class{constructor(t){o(this,t),this.stateUpdate=W(this,"rtkStateUpdate",7),this.play=W(this,"screensharePlay",7),this.fullScreenListener=()=>{this.isFullScreen=Gp()},this.participantScreenshareUpdate=t=>{t.id===this.participant.id&&this.screenShareListener(t)},this.hideFullScreenButton=!1,this.nameTagPosition="bottom-left",this.variant="solid",this.iconPack=Ne,this.t=Fe(),this.videoExpanded=!1,this.screenShareEnabled=!1,this.isFullScreen=!1,this.toggleFullScreen=()=>{this.isFullScreen?(Bp(),this.isFullScreen=!1):(zp(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(P(()=>{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"),s=this.isFullScreen?this.iconPack.full_screen_minimize:this.iconPack.full_screen_maximize;return z(G,{key:"c5fe06d9c1bfd2856b2eb93bb55b7c636256052f",class:{isSelf:i}},z("div",{key:"video-container",id:"video-container",class:{expand:this.videoExpanded}},z("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}`})),z("div",{id:"controls",key:"controls"},!this.hideFullScreenButton&&!i&&Hp()&&z("rtk-tooltip",{key:"fdfd7c6b5468ef96bdb06d4f942a3e10cbee08cb",label:r},z("rtk-button",{key:"99e0138257f6e0ec55ceee7f20318d78887f812b",id:"full-screen-btn",kind:"icon",onClick:this.toggleFullScreen,title:r},z("rtk-icon",{key:"06e747a6af4a5b79445ffb63598afd2ac515d3a2",icon:s,"aria-hidden":!0,tabIndex:-1})))),i&&z("div",{id:"self-message",key:"self-message"},z("h3",{key:"1ad96435977e90e6f0eff64a54507d106a4091be"},this.t("screenshare.shared")),z("div",{key:"02f1e2a734d3f56157ab76c1de55517995d8f98d",class:"actions"},null!=this.meeting&&z("rtk-button",{key:"4bc8344f8a829ff1a12552d9002d83032ec7277f",variant:"danger",onClick:()=>{this.meeting.self.disableScreenShare()}},z("rtk-icon",{key:"c2412bb995c605f980859481200033a447147b91",icon:this.iconPack.share_screen_stop,slot:"start"}),this.t("screenshare.stop")),z("rtk-button",{key:"0d513e8b6efa96b542d6bd163db81a179073ed45",variant:"secondary",id:"expand-btn",onClick:()=>{this.videoExpanded=!this.videoExpanded}},z("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")))),z("slot",{key:"2858a3123887f964d6e8ea77fb871abddc4c6295"}))}get host(){return Y(this)}static get watchers(){return{participant:["participantChanged"]}}};Vp([si()],qp.prototype,"meeting",void 0),Vp([si()],qp.prototype,"size",void 0),Vp([si()],qp.prototype,"iconPack",void 0),Vp([si()],qp.prototype,"t",void 0),qp.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 Kp=Object.freeze({__proto__:null,rtk_screenshare_view:qp});var Yp=function(t,e,i,r){var s,a=arguments.length,n=a<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--)(s=t[o])&&(n=(a<3?s(n):a>3?s(e,i,n):s(e,i))||n);return a>3&&n&&Object.defineProperty(e,i,n),n};const Wp=class{constructor(t){o(this,t),this.stateUpdate=W(this,"rtkStateUpdate",7),this.keyPressListener=t=>{"Escape"===t.key&&this.close()},this.stageStatusListener=()=>{this.canProduceVideo="ALLOWED"===this.meeting.self.permissions.canProduceVideo},this.iconPack=Ne,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 z(G,null,z("aside",{class:{hide:this.isMobileMainVisible},part:"menu"},z("header",null,z("h2",null,this.t("settings"))),z("button",{type:"button",class:{active:"audio"===this.activeTab},onClick:()=>this.changeTab("audio")},this.t("audio"),z("div",{class:"right"},z("rtk-icon",{icon:this.iconPack.mic_on}),"sm"===this.size&&z("rtk-icon",{icon:this.iconPack.chevron_right}))),this.canProduceVideo&&z("button",{type:"button",class:{active:"video"===this.activeTab},onClick:()=>this.changeTab("video")},this.t("video"),z("div",{class:"right"},z("rtk-icon",{icon:this.iconPack.video_on}),"sm"===this.size&&z("rtk-icon",{icon:this.iconPack.chevron_right}))),z("button",{type:"none",title:`Your network condition is ${this.networkStatus}`},this.t("connection"),z("div",{class:"right"},z("rtk-icon",{icon:this.iconPack.wifi,class:this.networkStatus})))),z("main",{class:{active:this.isMobileMainVisible,scrollbar:!0},part:"main-content"},"sm"===this.size&&z("header",null,z("rtk-button",{kind:"icon",class:"back-btn",onClick:()=>this.isMobileMainVisible=!1},z("rtk-icon",{icon:this.iconPack.chevron_left})),z("h2",null,this.t("audio"===this.activeTab?"audio":"video"))),"audio"===this.activeTab&&z("rtk-settings-audio",Object.assign({},t)),"video"===this.activeTab&&z("rtk-settings-video",Object.assign({},t))))}static get watchers(){return{meeting:["meetingChanged"]}}};Yp([si()],Wp.prototype,"meeting",void 0),Yp([si()],Wp.prototype,"states",void 0),Yp([si()],Wp.prototype,"size",void 0),Yp([si()],Wp.prototype,"iconPack",void 0),Yp([si()],Wp.prototype,"t",void 0),Wp.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 Zp=Object.freeze({__proto__:null,rtk_settings:Wp});var Qp=function(t,e,i,r){var s,a=arguments.length,n=a<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--)(s=t[o])&&(n=(a<3?s(n):a>3?s(e,i,n):s(e,i))||n);return a>3&&n&&Object.defineProperty(e,i,n),n};const Xp=class{constructor(t){o(this,t),this.stateUpdate=W(this,"rtkStateUpdate",7),this.variant="button",this.iconPack=Ne,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 z(G,{key:"11653f887305c7ba74c0e62197b0b8502f64bb22",title:t},z("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}))}};Qp([si()],Xp.prototype,"states",void 0),Qp([si()],Xp.prototype,"size",void 0),Qp([si()],Xp.prototype,"iconPack",void 0),Qp([si()],Xp.prototype,"t",void 0),Xp.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 Jp=Object.freeze({__proto__:null,rtk_settings_toggle:Xp});var tu=function(t,e,i,r){var s,a=arguments.length,n=a<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--)(s=t[o])&&(n=(a<3?s(n):a>3?s(e,i,n):s(e,i))||n);return a>3&&n&&Object.defineProperty(e,i,n),n};const eu=class{constructor(t){o(this,t),this.stateUpdate=W(this,"rtkStateUpdate",7),this.config=Ie,this.iconPack=Ne,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,s,a;const n=""===(null===(t=this.displayName)||void 0===t?void 0:t.trim())||"connected"!==this.connectionState||this.isJoining,o={meeting:this.meeting,config:this.config,states:this.states,size:this.size,iconPack:this.iconPack,t:this.t},l=null===(r=null===(i=null===(e=this.meeting)||void 0===e?void 0:e.meta)||void 0===i?void 0:i.meetingTitle)||void 0===r?void 0:r.trim();return z(G,{key:"81fce073b274287e6a4cd3a8d6fb28d2db0ec1db"},z("div",{key:"a4b0426c067ff9d5d380759ad535157bd1aa8210",class:"container"},z("div",{key:"1a65db35ffed6f8dd2e68e20b45e5bc6bc0bb99e",class:"container-tile"},z(rr,{key:"7f78f7a68292c27a5531b6aea9c100b3c0d2ab86",element:"rtk-participant-tile",defaults:o,props:{participant:null===(s=this.meeting)||void 0===s?void 0:s.self,size:"md",isPreview:!0},childProps:{participant:null===(a=this.meeting)||void 0===a?void 0:a.self,size:"md"},deepProps:!0}),z("div",{key:"bbd220ce356d23388f1c45db5ea9b1934e4df7a3",class:"media-selectors"},z("rtk-microphone-selector",Object.assign({key:"986377b85493dfd45ec10c7bc3a7c06f743d94ee"},o,{variant:"inline"})),z("rtk-camera-selector",Object.assign({key:"020ad2c9a5a4e6a710c15b0d834baae0e3fd46df"},o,{variant:"inline"})),z("rtk-speaker-selector",Object.assign({key:"82db6a6a721da0187e2b14926cb794bf5c83bbfe"},o,{variant:"inline"})))),z("div",{key:"8c9139f72ed1da7b9f316970ee17dcc56e83f259",class:"metadata"},l&&""!==l&&z("div",{key:"b5f7164a51aabed7a4355d9a5dcaa7148a7eee0c",class:"meeting-title"},l),this.canEditName?z(Ht,null,z("div",{class:"join-as"},this.t("setup_screen.join_in_as")),z("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()}})):z("div",{class:"uneditable-name"},z("span",{class:"text"},this.t("setup_screen.join_in_as")," ")," ",z("div",{class:"name"},Qe(this.displayName,20))),z("rtk-button",{key:"df8528e0fa5e31775a0f70a24b5dd00cf913a00e",size:"lg",kind:"wide",onClick:this.join,disabled:n},this.isJoining?z("rtk-spinner",{iconPack:this.iconPack}):this.t("join")),"connected"!==this.connectionState&&z("div",{key:"e60c7bb5d1a8ae53251fae2099c403752c330a08",class:"no-network-badge"},z("rtk-icon",{key:"f494e5882c9f6488ac7237784fb79983fe560093",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"]}}};tu([si()],eu.prototype,"meeting",void 0),tu([si()],eu.prototype,"states",void 0),tu([si()],eu.prototype,"size",void 0),tu([si()],eu.prototype,"iconPack",void 0),tu([si()],eu.prototype,"t",void 0),eu.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 iu=Object.freeze({__proto__:null,rtk_setup_screen:eu});var ru=function(t,e,i,r){var s,a=arguments.length,n=a<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--)(s=t[o])&&(n=(a<3?s(n):a>3?s(e,i,n):s(e,i))||n);return a>3&&n&&Object.defineProperty(e,i,n),n};const su=class{constructor(t){o(this,t),this.stateUpdate=W(this,"rtkStateUpdate",7),this.enabledSections=[],this.defaultSection="chat",this.config=Ie,this.iconPack=Ne,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=[];nd(t)&&e.push({id:"chat",name:this.t("chat")}),od(t)&&e.push({id:"polls",name:this.t("polls")}),ld(t)&&e.push({id:"participants",name:this.t("participants")}),cd(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?z(G,{class:this.enablePinning?this.isFloating?"floating":"":"floating"},z("rtk-sidebar-ui",{tabs:this.getTabs(),currentTab:this.currentTab,view:this.view,onTabChange:t=>{this.viewSection(t.detail)},onSidebarClose:this.close},this.enablePinning&&z("div",{class:"pinned-state",slot:"pinned-state"},z("rtk-button",{variant:"ghost",kind:"icon",onClick:this.toggleFloating,"aria-label":this.isFloating?this.t("pin"):this.t("unpin")},z("rtk-icon",{icon:this.isFloating?this.iconPack.pin:this.iconPack.pin_off}))),"chat"===e.states.sidebar&&z(rr,{element:"rtk-chat",defaults:e,props:{slot:"chat"}}),"polls"===e.states.sidebar&&z("rtk-polls",Object.assign({},e,{slot:"polls"})),"participants"===e.states.sidebar&&z(rr,{element:"rtk-participants",defaults:e,props:{slot:"participants"}}),"plugins"===e.states.sidebar&&z("rtk-plugins",Object.assign({},e,{slot:"plugins"})))):null}static get watchers(){return{meeting:["meetingChanged"],states:["statesChanged"],view:["viewChanged"]}}};ru([si()],su.prototype,"meeting",void 0),ru([si()],su.prototype,"states",void 0),ru([si()],su.prototype,"iconPack",void 0),ru([si()],su.prototype,"t",void 0),ru([si()],su.prototype,"size",void 0),su.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 au=Object.freeze({__proto__:null,rtk_sidebar:su});var nu=function(t,e,i,r){var s,a=arguments.length,n=a<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--)(s=t[o])&&(n=(a<3?s(n):a>3?s(e,i,n):s(e,i))||n);return a>3&&n&&Object.defineProperty(e,i,n),n};const ou=class{constructor(t){o(this,t),this.participants=[],this.aspectRatio="16:9",this.gap=8,this.config=Ie,this.iconPack=Ne,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 Ma(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}=gh({dimensions:this.dimensions,count:this.participants.length,aspectRatio:this.aspectRatio,gap:this.gap});return z(G,{key:"2e49045f4417f3dbd9b59ba877c0b9e47685f7f1"},z("slot",{key:"381a5deca04344b21c70a05656a01790edb572bd"},this.participants.map((s,a)=>{const{top:n,left:o}=r(a);return z(rr,{element:"rtk-participant-tile",defaults:t,props:{participant:s,style:{position:"absolute",top:`${n}px`,left:`${o}px`,width:`${e}px`,height:`${i}px`},key:s.id,"data-participant":s.id,mediaConnection:this.mediaConnection},childProps:{participant:s},deepProps:!0})})))}get host(){return Y(this)}static get watchers(){return{meeting:["meetingChanged"]}}};nu([si()],ou.prototype,"size",void 0),nu([si()],ou.prototype,"meeting",void 0),nu([si()],ou.prototype,"states",void 0),nu([si()],ou.prototype,"iconPack",void 0),nu([si()],ou.prototype,"t",void 0),ou.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 lu=Object.freeze({__proto__:null,rtk_simple_grid:ou});var cu=function(t,e,i,r){var s,a=arguments.length,n=a<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--)(s=t[o])&&(n=(a<3?s(n):a>3?s(e,i,n):s(e,i))||n);return a>3&&n&&Object.defineProperty(e,i,n),n};const du=class{constructor(t){o(this,t),this.layout="row",this.participants=[],this.pinnedParticipants=[],this.aspectRatio="16:9",this.gap=8,this.config=Ie,this.iconPack=Ne,this.t=Fe(),this.gridSize=mh,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 z(G,{key:"84e2ba9e414e03e433ace1a49b6b382755448646"},z("main",{key:"cc9324d3d21c8660085276edd5cba1541fd786d9",part:"main"},z(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&&z("aside",{key:"0d5e6b89cf403050bcbaa6b3129883e5facff0d7",part:"aside",class:this.gridSize.spotlight?`grid-width-${this.gridSize.spotlight}`:"grid-width-md"},z(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 Y(this)}};cu([si()],du.prototype,"size",void 0),cu([si()],du.prototype,"meeting",void 0),cu([si()],du.prototype,"states",void 0),cu([si()],du.prototype,"iconPack",void 0),cu([si()],du.prototype,"t",void 0),du.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 hu=Object.freeze({__proto__:null,rtk_spotlight_grid:du});var pu=function(t,e,i,r){var s,a=arguments.length,n=a<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--)(s=t[o])&&(n=(a<3?s(n):a>3?s(e,i,n):s(e,i))||n);return a>3&&n&&Object.defineProperty(e,i,n),n};const uu=class{constructor(t){o(this,t),this.stateUpdate=W(this,"rtkStateUpdate",7),this.iconPack=Ne,this.t=Fe()}render(){return z(G,{key:"6f350737bc0425eb6112badf128310e9f6a489a0"},z("slot",{key:"d8d99aaeb1277e13be9052a3136d5677113a2bc1"}))}};pu([si()],uu.prototype,"iconPack",void 0),pu([si()],uu.prototype,"t",void 0),uu.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 gu=Object.freeze({__proto__:null,rtk_stage:uu});var fu=function(t,e,i,r){var s,a=arguments.length,n=a<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--)(s=t[o])&&(n=(a<3?s(n):a>3?s(e,i,n):s(e,i))||n);return a>3&&n&&Object.defineProperty(e,i,n),n};const mu=class{constructor(t){o(this,t),this.stateUpdate=W(this,"rtkStateUpdate",7),this.variant="button",this.iconPack=Ne,this.t=Fe(),this.stageStatus="OFF_STAGE",this.state={label:"",disabled:!1,icon:""},this.stageCallback=async()=>{var t,e,i,r,s,a,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===(s=null===(r=null==this?void 0:this.meeting)||void 0===r?void 0:r.stage)||void 0===s||s.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===(a=null==this?void 0:this.meeting)||void 0===a?void 0:a.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,s;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===(s=null===(r=this.meeting)||void 0===r?void 0:r.stage)||void 0===s||s.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)?z(G,{title:this.state.label},z("rtk-tooltip",{placement:"top",kind:"block",label:this.state.label,delay:600,part:"tooltip"},z("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}))):z(G,{"data-hidden":!0});var t,e,i}static get watchers(){return{meeting:["meetingChanged"]}}};fu([si()],mu.prototype,"meeting",void 0),fu([si()],mu.prototype,"size",void 0),fu([si()],mu.prototype,"iconPack",void 0),fu([si()],mu.prototype,"states",void 0),fu([si()],mu.prototype,"t",void 0),mu.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 vu=Object.freeze({__proto__:null,rtk_stage_toggle:mu});const bu=Er(oi,"WeakMap");const ku=qr(Object.keys,Object);var yu=Object.prototype.hasOwnProperty;function wu(t){return as(t)?Ss(t):function(t){if(!Wr(t))return ku(t);var e=[];for(var i in Object(t))yu.call(t,i)&&"constructor"!=i&&e.push(i);return e}(t)}var xu=Object.prototype.propertyIsEnumerable,Su=Object.getOwnPropertySymbols,Eu=Su?function(t){return null==t?[]:(t=Object(t),function(t,e){for(var i=-1,r=null==t?0:t.length,s=0,a=[];++i<r;){var n=t[i];e(n,i,t)&&(a[s++]=n)}return a}(Su(t),function(e){return xu.call(t,e)}))}:function(){return[]};const Pu=Eu;function Tu(t){return function(t,e,i){var r=e(t);return rs(t)?r:function(t,e){for(var i=-1,r=e.length,s=t.length;++i<r;)t[s+i]=e[i];return t}(r,i(t))}(t,wu,Pu)}const Lu=Er(oi,"DataView");const Cu=Er(oi,"Promise");const _u=Er(oi,"Set");var Au="[object Map]",Ru="[object Promise]",Iu="[object Set]",Du="[object WeakMap]",Mu="[object DataView]",Ou=mr(Lu),Uu=mr(Pr),$u=mr(Cu),Fu=mr(_u),Nu=mr(bu),ju=fi;(Lu&&ju(new Lu(new ArrayBuffer(1)))!=Mu||Pr&&ju(new Pr)!=Au||Cu&&ju(Cu.resolve())!=Ru||_u&&ju(new _u)!=Iu||bu&&ju(new bu)!=Du)&&(ju=function(t){var e=fi(t),i="[object Object]"==e?t.constructor:void 0,r=i?mr(i):"";if(r)switch(r){case Ou:return Mu;case Uu:return Au;case $u:return Ru;case Fu:return Iu;case Nu:return Du}return e});const zu=ju;var Bu=Object.prototype.hasOwnProperty;var Gu=/\w*$/;var Hu=li?li.prototype:void 0,Vu=Hu?Hu.valueOf:void 0;function qu(t,e,i){var r,s,a,n,o,l=t.constructor;switch(e){case"[object ArrayBuffer]":return Br(t);case"[object Boolean]":case"[object Date]":return new l(+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 Gr(t,i);case"[object Map]":case"[object Set]":return new l;case"[object Number]":case"[object String]":return new l(t);case"[object RegExp]":return(a=new(s=t).constructor(s.source,Gu.exec(s))).lastIndex=s.lastIndex,a;case"[object Symbol]":return r=t,Vu?Object(Vu.call(r)):{}}}var Ku=fs&&fs.isMap;const Yu=Ku?hs(Ku):function(t){return vi(t)&&"[object Map]"==zu(t)};var Wu=fs&&fs.isSet;const Zu=Wu?hs(Wu):function(t){return vi(t)&&"[object Set]"==zu(t)};var Qu="[object Arguments]",Xu="[object Function]",Ju="[object Object]",tg={};function eg(t,e,i,r,s,a){var n,o=1&e;if(void 0!==n)return n;if(!mi(t))return t;var l=rs(t);if(l)n=function(t){var e=t.length,i=new t.constructor(e);return e&&"string"==typeof t[0]&&Bu.call(t,"index")&&(i.index=t.index,i.input=t.input),i}(t);else{var c=zu(t),d=c==Xu||"[object GeneratorFunction]"==c;if(cs(t))return jr(t,o);if(c==Ju||c==Qu||d&&!s)n=d?{}:Zr(t);else{if(!tg[c])return s?t:{};n=qu(t,c,o)}}a||(a=new Ir);var h=a.get(t);if(h)return h;a.set(t,n),Zu(t)?t.forEach(function(r){n.add(eg(r,e,i,r,t,a))}):Yu(t)&&t.forEach(function(r,s){n.set(s,eg(r,e,i,s,t,a))});var p=l?void 0:Tu(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,s){p&&(r=t[s=r]),ks(n,s,eg(r,e,i,s,t,a))}),n}tg[Qu]=tg["[object Array]"]=tg["[object ArrayBuffer]"]=tg["[object DataView]"]=tg["[object Boolean]"]=tg["[object Date]"]=tg["[object Float32Array]"]=tg["[object Float64Array]"]=tg["[object Int8Array]"]=tg["[object Int16Array]"]=tg["[object Int32Array]"]=tg["[object Map]"]=tg["[object Number]"]=tg[Ju]=tg["[object RegExp]"]=tg["[object Set]"]=tg["[object String]"]=tg["[object Symbol]"]=tg["[object Uint8Array]"]=tg["[object Uint8ClampedArray]"]=tg["[object Uint16Array]"]=tg["[object Uint32Array]"]=!0,tg["[object Error]"]=tg[Xu]=tg["[object WeakMap]"]=!1;function ig(t){return structuredClone?structuredClone(t):eg(t,5)}var rg=function(t,e,i,r){var s,a=arguments.length,n=a<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--)(s=t[o])&&(n=(a<3?s(n):a>3?s(e,i,n):s(e,i))||n);return a>3&&n&&Object.defineProperty(e,i,n),n};const sg=class{constructor(t){o(this,t),this.config=Ie,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(ig(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(()=>{P(()=>{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=>z("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 z(G,null,this.renderTranscripts())}get host(){return Y(this)}static get watchers(){return{meeting:["meetingChanged"],states:["statesChanged"]}}};rg([si()],sg.prototype,"meeting",void 0),rg([si()],sg.prototype,"states",void 0),rg([si()],sg.prototype,"t",void 0),sg.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 ag=Object.freeze({__proto__:null,rtk_transcripts:sg});const ng=class{constructor(t){o(this,t),this.statesUpdate=W(this,"rtkStatesUpdate",7),this.config=Ie,this.showSetupScreen=!1,this.noRenderUntilMeeting=!1,this.handleResize=()=>{this.size=pa(this.host.clientWidth)},this.loadTheme=()=>{var t;if(this.config===Ie){const{config:t}=ca(this.meeting.self.config,this.meeting);this.config=t}(null===(t=this.config)||void 0===t?void 0:t.designTokens)&&Us(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=la(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){Ye.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){Ye.state.iconPack=t}onTChange(t){Ye.state.t=t}onConfigChange(t){Ye.state.config=t}onSizeChange(t){Ye.state.size=t}render(){return z(G,{key:"255d40656744b2906c20a139a1af87c66acc310a"},this.noRenderUntilMeeting&&!this.meeting?null:z("slot",null))}get host(){return Y(this)}static get watchers(){return{meeting:["onMeetingChange"],iconPack:["onIconPackChange"],t:["onTChange"],config:["onConfigChange"],size:["onSizeChange"]}}};ng.style="rtk-ui-provider{display:block;width:100%;height:100%}";var og=Object.freeze({__proto__:null,rtk_ui_provider:ng});var lg=function(t,e,i,r){var s,a=arguments.length,n=a<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--)(s=t[o])&&(n=(a<3?s(n):a>3?s(e,i,n):s(e,i))||n);return a>3&&n&&Object.defineProperty(e,i,n),n};const cg=class{constructor(t){o(this,t),this.config=Ie,this.iconPack=Ne,this.t=Fe()}render(){return z(G,{key:"06c3f95f6b37b0b6dac40c39f0006dfd8e2f1527"},z("slot",{key:"76e9f7369a1aa9c2b5a6bbb602ff1f26289c5d80"},z("div",{key:"8214ae3640c401b4d1ba1333aaa996ef49b7ec1c",class:"centered",part:"content"},z("rtk-logo",{key:"ec1f1f220f39f674510e1c95699f92d53a9fbf00",meeting:this.meeting,config:this.config,part:"logo",t:this.t}),z("p",{key:"9123734c61b424b323701f99ac8da6ee0b2885e4"},this.t("waitlist.body_text")))))}};lg([si()],cg.prototype,"meeting",void 0),lg([si()],cg.prototype,"iconPack",void 0),lg([si()],cg.prototype,"t",void 0),cg.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 dg=Object.freeze({__proto__:null,rtk_waiting_screen:cg});var hg=function(t,e,i,r){var s,a=arguments.length,n=a<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--)(s=t[o])&&(n=(a<3?s(n):a>3?s(e,i,n):s(e,i))||n);return a>3&&n&&Object.defineProperty(e,i,n),n};const pg=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,s=e+i;this.autoScrollEnabled=s+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=ig(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(()=>{Ji(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=>z("div",{class:"message"},z(Xi,{name:t.name,time:new Date(t.date),now:new Date}),z("div",{class:"body"},t.transcript)))}render(){return z(G,{key:"12573001a05a586495a63ecd420f99ad04ce780f"},z("div",{key:"2a51f65ba7cd339aee33291c77cdf9f5d69b8f07",class:"search-bar"},z("input",{key:"6cb5505e84ddff6e39c29012752a7309f715505c",type:"text",placeholder:"Search Participant",value:this.participantQuery,onInput:t=>this.participantQuery=t.target.value})),this.isProcessing&&z("div",{key:"b7f1c33aae0d2613e28dc328e5ccfd92ad067576",class:"processing"},z("p",{key:"ae8dc349ff7017a92b9c15e8c8ab051313c07e67"},"Processing audio....")),!this.isProcessing&&z("div",{key:"f5d9e637661b2b10dd323c6b9d6fa7381fd7768c",class:"content scrollbar",ref:t=>this.contentContainer=t},z("div",{key:"a029f8903f82deab573e2372f1c645de98fbc417",class:"started-message"},"Transcription started"),this.renderTranscripts()))}static get watchers(){return{meeting:["meetingChanged"],transcriptions:["transcriptionsChanged"]}}};hg([si()],pg.prototype,"t",void 0),hg([si()],pg.prototype,"meeting",void 0),pg.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 ug=Object.freeze({__proto__:null,rtk_ai_transcriptions:pg});var gg=function(t,e,i,r){var s,a=arguments.length,n=a<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--)(s=t[o])&&(n=(a<3?s(n):a>3?s(e,i,n):s(e,i))||n);return a>3&&n&&Object.defineProperty(e,i,n),n};const fg=class{constructor(t){o(this,t),this.t=Fe(),this.iconPack=Ne,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?z(G,null,z("div",{class:"indicator","aria-label":this.t("livestream.indicator"),part:"indicator"},z("rtk-icon",{icon:this.iconPack.start_livestream,size:this.size}),z("span",null,this.t("LIVE")))):z(G,{"data-hidden":!0})}static get watchers(){return{meeting:["meetingChanged"]}}};gg([si()],fg.prototype,"meeting",void 0),gg([si()],fg.prototype,"size",void 0),gg([si()],fg.prototype,"t",void 0),gg([si()],fg.prototype,"iconPack",void 0),fg.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}}";const mg=Number.isFinite||function(t){return"number"==typeof t&&isFinite(t)},vg=Number.isSafeInteger||function(t){return"number"==typeof t&&Math.abs(t)<=bg},bg=Number.MAX_SAFE_INTEGER||9007199254740991;let kg=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}({}),yg=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.KEY_SYSTEM_DESTROY_MEDIA_KEYS_ERROR="keySystemDestroyMediaKeysError",t.KEY_SYSTEM_DESTROY_CLOSE_SESSION_ERROR="keySystemDestroyCloseSessionError",t.KEY_SYSTEM_DESTROY_REMOVE_SESSION_ERROR="keySystemDestroyRemoveSessionError",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.ASSET_LIST_LOAD_ERROR="assetListLoadError",t.ASSET_LIST_LOAD_TIMEOUT="assetListLoadTimeout",t.ASSET_LIST_PARSING_ERROR="assetListParsingError",t.INTERSTITIAL_ASSET_ITEM_ERROR="interstitialAssetItemError",t.INTERNAL_EXCEPTION="internalException",t.INTERNAL_ABORTED="aborted",t.ATTACH_MEDIA_ERROR="attachMediaError",t.UNKNOWN="unknown",t}({}),wg=function(t){return t.MEDIA_ATTACHING="hlsMediaAttaching",t.MEDIA_ATTACHED="hlsMediaAttached",t.MEDIA_DETACHING="hlsMediaDetaching",t.MEDIA_DETACHED="hlsMediaDetached",t.MEDIA_ENDED="hlsMediaEnded",t.STALL_RESOLVED="hlsStallResolved",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.BUFFERED_TO_END="hlsBufferedToEnd",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.AUDIO_TRACK_UPDATED="hlsAudioTrackUpdated",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_TRACK_UPDATED="hlsSubtitleTrackUpdated",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.ASSET_LIST_LOADING="hlsAssetListLoading",t.ASSET_LIST_LOADED="hlsAssetListLoaded",t.INTERSTITIALS_UPDATED="hlsInterstitialsUpdated",t.INTERSTITIALS_BUFFERED_TO_BOUNDARY="hlsInterstitialsBufferedToBoundary",t.INTERSTITIAL_ASSET_PLAYER_CREATED="hlsInterstitialAssetPlayerCreated",t.INTERSTITIAL_STARTED="hlsInterstitialStarted",t.INTERSTITIAL_ASSET_STARTED="hlsInterstitialAssetStarted",t.INTERSTITIAL_ASSET_ENDED="hlsInterstitialAssetEnded",t.INTERSTITIAL_ASSET_ERROR="hlsInterstitialAssetError",t.INTERSTITIAL_ENDED="hlsInterstitialEnded",t.INTERSTITIALS_PRIMARY_RESUMED="hlsInterstitialsPrimaryResumed",t.PLAYOUT_LIMIT_REACHED="hlsPlayoutLimitReached",t.EVENT_CUE_ENTER="hlsEventCueEnter",t}({});var xg="manifest",Sg="level",Eg="audioTrack",Pg="subtitleTrack",Tg="main",Lg="audio",Cg="subtitle";class _g{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 Ag{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 _g(t),this.fast_=new _g(e),this.defaultTTFB_=r,this.ttfb_=new _g(t)}update(t,e){const{slow_:i,fast_:r,ttfb_:s}=this;i.halfLife!==t&&(this.slow_=new _g(t,i.getEstimate(),i.getTotalWeight())),r.halfLife!==e&&(this.fast_=new _g(e,r.getEstimate(),r.getTotalWeight())),s.halfLife!==t&&(this.ttfb_=new _g(t,s.getEstimate(),s.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_}get defaultEstimate(){return this.defaultEstimate_}destroy(){}}function Rg(t,e,i){return(e=function(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:e+""}(e))in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}function Ig(){return Ig=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var r in i)({}).hasOwnProperty.call(i,r)&&(t[r]=i[r])}return t},Ig.apply(null,arguments)}function Dg(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 Mg(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?Dg(Object(i),!0).forEach(function(e){Rg(t,e,i[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):Dg(Object(i)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))})}return t}class Og{constructor(t,e){this.trace=void 0,this.debug=void 0,this.log=void 0,this.warn=void 0,this.info=void 0,this.error=void 0;const i=`[${t}]:`;this.trace=Ug,this.debug=e.debug.bind(null,i),this.log=e.log.bind(null,i),this.warn=e.warn.bind(null,i),this.info=e.info.bind(null,i),this.error=e.error.bind(null,i)}}const Ug=function(){},$g={trace:Ug,debug:Ug,log:Ug,warn:Ug,info:Ug,error:Ug};function Fg(){return Ig({},$g)}function Ng(t,e,i){return e[t]?e[t].bind(e):function(t,e){const i=self.console[t];return i?i.bind(self.console,`${e?"["+e+"] ":""}[${t}] >`):Ug}(t,i)}const jg=Fg();const zg=jg;function Bg(t=!0){if("undefined"==typeof self)return;return(t||!self.MediaSource)&&self.ManagedMediaSource||self.MediaSource||self.WebKitMediaSource}function Gg(t,e){const i=Object.keys(t),r=Object.keys(e),s=i.length,a=r.length;return!s||!a||s===a&&!i.some(t=>-1===r.indexOf(t))}function Hg(t,e=!1){if("undefined"!=typeof TextDecoder){const i=new TextDecoder("utf-8").decode(t);if(e){const t=i.indexOf("\0");return-1!==t?i.substring(0,t):i}return i.replace(/\0/g,"")}const i=t.length;let r,s,a,n="",o=0;for(;o<i;){if(r=t[o++],0===r&&e)return n;if(0!==r&&3!==r)switch(r>>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:n+=String.fromCharCode(r);break;case 12:case 13:s=t[o++],n+=String.fromCharCode((31&r)<<6|63&s);break;case 14:s=t[o++],a=t[o++],n+=String.fromCharCode((15&r)<<12|(63&s)<<6|63&a)}}return n}const Vg=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};function qg(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Kg,Yg={exports:{}};var Wg=(Kg||(Kg=1,function(t){var e,i,r,s,a;e=/^(?=((?:[a-zA-Z0-9+\-.]+:)?))\1(?=((?:\/\/[^\/?#]*)?))\2(?=((?:(?:[^?#\/]*\/)*[^;?#\/]*)?))\3((?:;[^?#]*)?)(\?[^#]*)?(#[^]*)?$/,i=/^(?=([^\/?#]*))\1([^]*)$/,r=/(?:\/|^)\.(?=\/)/g,s=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g,a={buildAbsoluteURL:function(t,e,r){if(r=r||{},t=t.trim(),!(e=e.trim())){if(!r.alwaysNormalize)return t;var s=a.parseURL(t);if(!s)throw new Error("Error trying to parse base URL.");return s.path=a.normalizePath(s.path),a.buildURLFromParts(s)}var n=a.parseURL(e);if(!n)throw new Error("Error trying to parse relative URL.");if(n.scheme)return r.alwaysNormalize?(n.path=a.normalizePath(n.path),a.buildURLFromParts(n)):e;var o=a.parseURL(t);if(!o)throw new Error("Error trying to parse base URL.");if(!o.netLoc&&o.path&&"/"!==o.path[0]){var l=i.exec(o.path);o.netLoc=l[1],o.path=l[2]}o.netLoc&&!o.path&&(o.path="/");var c={scheme:o.scheme,netLoc:n.netLoc,path:null,params:n.params,query:n.query,fragment:n.fragment};if(!n.netLoc&&(c.netLoc=o.netLoc,"/"!==n.path[0]))if(n.path){var d=o.path,h=d.substring(0,d.lastIndexOf("/")+1)+n.path;c.path=a.normalizePath(h)}else c.path=o.path,n.params||(c.params=o.params,n.query||(c.query=o.query));return null===c.path&&(c.path=r.alwaysNormalize?a.normalizePath(n.path):n.path),a.buildURLFromParts(c)},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(s,"")).length;);return t.split("").reverse().join("")},buildURLFromParts:function(t){return t.scheme+t.netLoc+t.path+t.params+t.query+t.fragment}},t.exports=a}(Yg)),Yg.exports);class Zg{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 Qg="audio",Xg="video",Jg="audiovideo";class tf{constructor(t){this._byteRange=null,this._url=null,this._stats=null,this._streams=null,this.base=void 0,this.relurl=void 0,"string"==typeof t&&(t={url:t}),this.base=t,function(t,e){const i=af(t,e);i&&(i.enumerable=!0,Object.defineProperty(t,e,i))}(this,"stats")}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 baseurl(){return this.base.url}get byteRange(){return null===this._byteRange?[]:this._byteRange}get byteRangeStartOffset(){return this.byteRange[0]}get byteRangeEndOffset(){return this.byteRange[1]}get elementaryStreams(){return null===this._streams&&(this._streams={[Qg]:null,[Xg]:null,[Jg]:null}),this._streams}set elementaryStreams(t){this._streams=t}get hasStats(){return null!==this._stats}get hasStreams(){return null!==this._streams}get stats(){return null===this._stats&&(this._stats=new Zg),this._stats}set stats(t){this._stats=t}get url(){return!this._url&&this.baseurl&&this.relurl&&(this._url=Wg.buildAbsoluteURL(this.baseurl,this.relurl,{alwaysNormalize:!0})),this._url||""}set url(t){this._url=t}clearElementaryStreamInfo(){const{elementaryStreams:t}=this;t[Qg]=null,t[Xg]=null,t[Jg]=null}}function ef(t){return"initSegment"!==t.sn}class rf extends tf{constructor(t,e){super(e),this._decryptdata=null,this._programDateTime=null,this._ref=null,this._bitrate=void 0,this.rawProgramDateTime=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.playlistOffset=0,this.deltaPTS=void 0,this.maxStartPTS=void 0,this.minEndPTS=void 0,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 byteLength(){if(this.hasStats){const t=this.stats.total;if(t)return t}if(this.byteRange){const t=this.byteRange[0],e=this.byteRange[1];if(mg(t)&&mg(e))return e-t}return null}get bitrate(){return this.byteLength?8*this.byteLength/this.duration:this._bitrate?this._bitrate:null}set bitrate(t){this._bitrate=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;const t=mg(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}get programDateTime(){return null===this._programDateTime&&this.rawProgramDateTime&&(this.programDateTime=Date.parse(this.rawProgramDateTime)),this._programDateTime}set programDateTime(t){mg(t)?this._programDateTime=t:this._programDateTime=this.rawProgramDateTime=null}get ref(){return ef(this)?(this._ref||(this._ref={base:this.base,start:this.start,duration:this.duration,sn:this.sn,programDateTime:this.programDateTime}),this._ref):null}addStart(t){this.setStart(this.start+t)}setStart(t){this.start=t,this._ref&&(this._ref.start=t)}setDuration(t){this.duration=t,this._ref&&(this._ref.duration=t)}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,s,a=!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,s)):n[t]={startPTS:e,endPTS:i,startDTS:r,endDTS:s,partial:a}}}class sf extends tf{constructor(t,e,i,r,s){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.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 a=t.enumeratedString("BYTERANGE");a&&this.setByteRange(a,s),s&&(this.fragOffset=s.fragOffset+s.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)}}function af(t,e){const i=Object.getPrototypeOf(t);if(i){const t=Object.getOwnPropertyDescriptor(i,e);return t||af(i,e)}}const nf=Math.pow(2,32)-1,of=[].push,lf={video:1,audio:2,id3:3,text:4};function cf(t){return String.fromCharCode.apply(null,t)}function df(t,e){const i=t[e]<<8|t[e+1];return i<0?65536+i:i}function hf(t,e){const i=uf(t,e);return i<0?4294967296+i:i}function pf(t,e){let i=hf(t,e);return i*=Math.pow(2,32),i+=hf(t,e+4),i}function uf(t,e){return t[e]<<24|t[e+1]<<16|t[e+2]<<8|t[e+3]}function gf(t,e){const i=[];if(!e.length)return i;const r=t.byteLength;for(let s=0;s<r;){const a=hf(t,s),n=a>1?s+a:r;if(cf(t.subarray(s+4,s+8))===e[0])if(1===e.length)i.push(t.subarray(s+8,n));else{const r=gf(t.subarray(s+8,n),e.slice(1));r.length&&of.apply(i,r)}s=n}return i}function ff(t){const e=[],i=t[0];let r=8;const s=hf(t,r);r+=4;let a=0,n=0;0===i?(a=hf(t,r),n=hf(t,r+4),r+=8):(a=pf(t,r),n=pf(t,r+8),r+=16),r+=2;let o=t.length+n;const l=df(t,r);r+=2;for(let i=0;i<l;i++){let i=r;const a=hf(t,i);i+=4;const n=2147483647&a;if(1===(2147483648&a)>>>31)return zg.warn("SIDX has hierarchical references (not supported)"),null;const l=hf(t,i);i+=4,e.push({referenceSize:n,subsegmentDuration:l,info:{duration:l/s,start:o,end:o+n-1}}),o+=n,i+=4,r=i}return{earliestPresentationTime:a,timescale:s,version:i,referencesCount:l,references:e}}function mf(t){const e=[],i=gf(t,["moov","trak"]);for(let t=0;t<i.length;t++){const r=i[t],s=gf(r,["tkhd"])[0];if(s){let t=s[0];const i=hf(s,0===t?12:20),a=gf(r,["mdia","mdhd"])[0];if(a){t=a[0];const s=hf(a,0===t?12:20),n=gf(r,["mdia","hdlr"])[0];if(n){const t=cf(n.subarray(8,12)),a={soun:Qg,vide:Xg}[t],o=vf(gf(r,["mdia","minf","stbl","stsd"])[0]);a?(e[i]={timescale:s,type:a,stsd:o},e[a]=Mg({timescale:s,id:i},o)):e[i]={timescale:s,type:t,stsd:o}}}}}return gf(t,["moov","mvex","trex"]).forEach(t=>{const i=hf(t,4),r=e[i];r&&(r.default={duration:hf(t,12),flags:hf(t,20)})}),e}function vf(t){const e=t.subarray(8),i=e.subarray(86),r=cf(e.subarray(4,8));let s,a=r;const n="enca"===r||"encv"===r;if(n){const t=gf(e,[r])[0];gf(t.subarray("enca"===r?28:78),["sinf"]).forEach(t=>{const e=gf(t,["schm"])[0];if(e){const i=cf(e.subarray(4,8));if("cbcs"===i||"cenc"===i){const e=gf(t,["frma"])[0];e&&(a=cf(e))}}})}const o=a;switch(a){case"avc1":case"avc2":case"avc3":case"avc4":{const t=gf(i,["avcC"])[0];t&&t.length>3&&(a+="."+yf(t[1])+yf(t[2])+yf(t[3]),s=bf("avc1"===o?"dva1":"dvav",i));break}case"mp4a":{const t=gf(e,[r])[0],i=gf(t.subarray(28),["esds"])[0];if(i&&i.length>7){let t=4;if(3!==i[t++])break;t=kf(i,t),t+=2;const e=i[t++];if(128&e&&(t+=2),64&e&&(t+=i[t++]),4!==i[t++])break;t=kf(i,t);const r=i[t++];if(64!==r)break;if(a+="."+yf(r),t+=12,5!==i[t++])break;t=kf(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=gf(i,["hvcC"])[0];if(t&&t.length>12){const e=t[1],i=["","A","B","C"][e>>6],r=31&e,s=hf(t,2),n=(32&e)>>5?"H":"L",o=t[12],l=t.subarray(6,12);a+="."+i+r,a+="."+function(t){let e=0;for(let i=0;i<32;i++)e|=(t>>i&1)<<31-i;return e>>>0}(s).toString(16).toUpperCase(),a+="."+n+o;let c="";for(let t=l.length;t--;){const e=l[t];if(e||c){c="."+e.toString(16).toUpperCase()+c}}a+=c}s=bf("hev1"==o?"dvhe":"dvh1",i);break}case"dvh1":case"dvhe":case"dvav":case"dva1":case"dav1":a=bf(a,i)||a;break;case"vp09":{const t=gf(i,["vpcC"])[0];if(t&&t.length>6){const e=t[4],i=t[5],r=t[6]>>4&15;a+="."+wf(e)+"."+wf(i)+"."+wf(r)}break}case"av01":{const t=gf(i,["av1C"])[0];if(t&&t.length>2){const e=t[1]>>>5,r=31&t[1],n=t[2]>>>7?"H":"M",o=(64&t[2])>>6,l=(32&t[2])>>5,c=2===e&&o?l?12:10:o?10:8,d=(16&t[2])>>4,h=(8&t[2])>>3,p=(4&t[2])>>2,u=3&t[2],g=1,f=1,m=1,v=0;a+="."+e+"."+wf(r)+n+"."+wf(c)+"."+d+"."+h+p+u+"."+wf(g)+"."+wf(f)+"."+wf(m)+"."+v,s=bf("dav1",i)}break}}return{codec:a,encrypted:n,supplemental:s}}function bf(t,e){const i=gf(e,["dvvC"]),r=i.length?i[0]:gf(e,["dvcC"])[0];if(r){const e=r[2]>>1&127,i=r[2]<<5&32|r[3]>>3&31;return t+"."+wf(e)+"."+wf(i)}}function kf(t,e){const i=e+5;for(;128&t[e++]&&e<i;);return e}function yf(t){return("0"+t.toString(16).toUpperCase()).slice(-2)}function wf(t){return(t<10?"0":"")+t}function xf(t){const e=gf(t,["schm"])[0];if(e){const i=cf(e.subarray(4,8));if("cbcs"===i||"cenc"===i)return gf(t,["schi","tenc"])[0]}return null}function Sf(t,e){const i=new Uint8Array(t.length+e.length);return i.set(t),i.set(e,t.length),i}function Ef(t,e){const i=[],r=e.samples,s=e.timescale,a=e.id;let n=!1;return gf(r,["moof"]).map(o=>{const l=o.byteOffset-8;gf(o,["traf"]).map(o=>{const c=gf(o,["tfdt"]).map(t=>{const e=t[0];let i=hf(t,4);return 1===e&&(i*=Math.pow(2,32),i+=hf(t,8)),i/s})[0];return void 0!==c&&(t=c),gf(o,["tfhd"]).map(c=>{const d=hf(c,4),h=16777215&hf(c,0);let p=0;const u=!!(16&h);let g=0;const f=!!(32&h);let m=8;d===a&&(!!(1&h)&&(m+=8),!!(2&h)&&(m+=4),!!(8&h)&&(p=hf(c,m),m+=4),u&&(g=hf(c,m),m+=4),f&&(m+=4),"video"===e.type&&(n=Pf(e.codec)),gf(o,["trun"]).map(a=>{const o=a[0],c=16777215&hf(a,0),d=!!(1&c);let h=0;const u=!!(4&c),f=!!(256&c);let m=0;const v=!!(512&c);let b=0;const k=!!(1024&c),y=!!(2048&c);let w=0;const x=hf(a,4);let S=8;d&&(h=hf(a,S),S+=4),u&&(S+=4);let E=h+l;for(let l=0;l<x;l++){if(f?(m=hf(a,S),S+=4):m=p,v?(b=hf(a,S),S+=4):b=g,k&&(S+=4),y&&(w=0===o?hf(a,S):uf(a,S),S+=4),e.type===Xg){let e=0;for(;e<b;){const a=hf(r,E);if(E+=4,Tf(n,r[E])){Lf(r.subarray(E,E+a),n?2:1,t+w/s,i)}E+=a,e+=a+4}}t+=m/s}}))})})}),i}function Pf(t){if(!t)return!1;const e=t.substring(0,4);return"hvc1"===e||"hev1"===e||"dvh1"===e||"dvhe"===e}function Tf(t,e){if(t){const t=e>>1&63;return 39===t||40===t}return 6===(31&e)}function Lf(t,e,i,r){const s=Cf(t);let a=0;a+=e;let n=0,o=0,l=0;for(;a<s.length;){n=0;do{if(a>=s.length)break;l=s[a++],n+=l}while(255===l);o=0;do{if(a>=s.length)break;l=s[a++],o+=l}while(255===l);const t=s.length-a;let e=a;if(o<t)a+=o;else if(o>t){zg.error(`Malformed SEI payload. ${o} is too small, only ${t} bytes left to parse.`);break}if(4===n){if(181===s[e++]){const t=df(s,e);if(e+=2,49===t){const t=hf(s,e);if(e+=4,1195456820===t){const t=s[e++];if(3===t){const a=s[e++],o=64&a,l=o?2+3*(31&a):0,c=new Uint8Array(l);if(o){c[0]=a;for(let t=1;t<l;t++)c[t]=s[e++]}r.push({type:t,payloadType:n,pts:i,bytes:c})}}}}}else if(5===n&&o>16){const t=[];for(let i=0;i<16;i++){const r=s[e++].toString(16);t.push(1==r.length?"0"+r:r),3!==i&&5!==i&&7!==i&&9!==i||t.push("-")}const a=o-16,l=new Uint8Array(a);for(let t=0;t<a;t++)l[t]=s[e++];r.push({payloadType:n,pts:i,uuid:t.join(""),userData:Hg(l),userDataBytes:l})}}}function Cf(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 s=e-i.length,a=new Uint8Array(s);let n=0;for(r=0;r<s;n++,r++)n===i[0]&&(n++,i.shift()),a[r]=t[n];return a}function _f(t,e,i){if(16!==t.byteLength)throw new RangeError("Invalid system id");let r,s,a;r=0,s=new Uint8Array,a=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,s=i;for(;s--;)r+=e[s].byteLength;const a=new Uint8Array(r);for(a[0]=r>>24&255,a[1]=r>>16&255,a[2]=r>>8&255,a[3]=255&r,a.set(t,4),s=0,r=8;s<i;s++)a.set(e[s],r),r+=e[s].byteLength;return a}([112,115,115,104],new Uint8Array([0,0,0,0]),t,a,s,n,i||new Uint8Array)}function Af(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 s=t.getUint32(8)>>>24;if(0!==s&&1!==s)return{offset:i,size:e};const a=t.buffer,n=Vg(new Uint8Array(a,i+12,16));let o=null,l=null,c=0;if(0===s)c=28;else if(1===s){const s=t.getUint32(28);if(!s||r<32+16*s)return{offset:i,size:e};o=[];for(let t=0;t<s;t++)o.push(new Uint8Array(a,i+32+16*t,16));c=32+16*s}if(!c)return{offset:i,size:e};const d=t.getUint32(c);return e-32<d?{offset:i,size:e}:(l=new Uint8Array(a,i+c+4,d),{version:s,systemId:n,kids:o,data:l,offset:i,size:e})}const Rf=()=>/\(Windows.+Firefox\//i.test(navigator.userAgent),If={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,dav1:.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 Df(t,e){const i=If[e];return!!i&&!!i[t.slice(0,4)]}function Mf(t,e,i=!0){return!t.split(",").some(t=>!Of(t,e,i))}function Of(t,e,i=!0){var r;const s=Bg(i);return null!=(r=null==s?void 0:s.isTypeSupported(Uf(t,e)))&&r}function Uf(t,e){return`${e}/mp4;codecs=${t}`}function $f(t){if(t){const e=t.substring(0,4);return If.video[e]}return 2}function Ff(t){const e=Rf();return t.split(",").reduce((t,i)=>{const r=e&&Pf(i)?9:If.video[i];return r?(2*r+t)/(t?3:2):(If.audio[i]+t)/(t?2:1)},0)}const Nf={};const jf=/flac|opus|mp4a\.40\.34/i;function zf(t,e=!0){return t.replace(jf,t=>function(t,e=!0){if(Nf[t])return Nf[t];const i={flac:["flac","fLaC","FLAC"],opus:["opus","Opus"],"mp4a.40.34":["mp3"]}[t];for(let s=0;s<i.length;s++){var r;if(Of(i[s],"audio",e))return Nf[t]=i[s],i[s];if("mp3"===i[s]&&null!=(r=Bg(e))&&r.isTypeSupported("audio/mpeg"))return""}return t}(t.toLowerCase(),e))}function Bf(t,e){if(t&&(t.length>4||-1!==["ac-3","ec-3","alac","fLaC","Opus"].indexOf(t))&&(Gf(t,"audio")||Gf(t,"video")))return t;if(e){const i=e.split(",");if(i.length>1){if(t)for(let e=i.length;e--;)if(i[e].substring(0,4)===t.substring(0,4))return i[e];return i[0]}}return e||t}function Gf(t,e){return Df(t,e)&&Of(t,e)}function Hf(t){if(t.startsWith("av01.")){const e=t.split("."),i=["0","111","01","01","01","0"];for(let t=e.length;t>4&&t<10;t++)e[t]=i[t-4];return e.join(".")}return t}function Vf(t){const e=Bg(t)||{isTypeSupported:()=>!1};return{mpeg:e.isTypeSupported("audio/mpeg"),mp3:e.isTypeSupported('audio/mp4; codecs="mp3"'),ac3:e.isTypeSupported('audio/mp4; codecs="ac-3"')}}function qf(t){return t.replace(/^.+codecs=["']?([^"']+).*$/,"$1")}const Kf={supported:!0,configurations:[],decodingInfoResults:[{supported:!0,powerEfficient:!0,smooth:!0}]};function Yf(t,e){return{supported:!1,configurations:e,decodingInfoResults:[{supported:!1,smooth:!1,powerEfficient:!1}],error:t}}function Wf(t,e,i,r,s,a){const n=t.videoCodec,o=t.audioCodec?t.audioGroups:null,l=null==a?void 0:a.audioCodec,c=null==a?void 0:a.channels,d=c?parseInt(c):l?1/0:2;let h=null;if(null!=o&&o.length)try{h=1===o.length&&o[0]?e.groups[o[0]].channels:o.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!==n&&(n.split(",").some(t=>Pf(t))||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(s,8e6))||!!h&&mg(d)&&Object.keys(h).some(t=>parseInt(t)>d)}function Zf(t,e,i,r={}){const s=t.videoCodec;if(!s&&!t.audioCodec||!i)return Promise.resolve(Kf);const a=[],n=function(t){var e;const i=null==(e=t.videoCodec)?void 0:e.split(","),r=Xf(t),s=t.width||640,a=t.height||480,n=t.frameRate||30,o=t.videoRange.toLowerCase();return i?i.map(t=>{const e={contentType:Uf(Hf(t),"video"),width:s,height:a,bitrate:r,framerate:n};return"sdr"!==o&&(e.transferFunction=o),e}):[]}(t),o=n.length,l=function(t,e,i){var r;const s=null==(r=t.audioCodec)?void 0:r.split(","),a=Xf(t);if(s&&t.audioGroups)return t.audioGroups.reduce((t,r)=>{var n;const o=r?null==(n=e.groups[r])?void 0:n.tracks:null;return o?o.reduce((t,e)=>{if(e.groupId===r){const r=parseFloat(e.channels||"");s.forEach(e=>{const s={contentType:Uf(e,"audio"),bitrate:i?Qf(e,a):a};r&&(s.channels=""+r),t.push(s)})}return t},t):t},[]);return[]}(t,e,o>0),c=l.length;for(let t=o||1*c||1;t--;){const e={type:"media-source"};if(o&&(e.video=n[t%o]),c){e.audio=l[t%c];const i=e.audio.bitrate;e.video&&i&&(e.video.bitrate-=i)}a.push(e)}if(s){const t=navigator.userAgent;if(s.split(",").some(t=>Pf(t))&&Rf())return Promise.resolve(Yf(new Error(`Overriding Windows Firefox HEVC MediaCapabilities result based on user-agent string: (${t})`),a))}return Promise.all(a.map(t=>{const e=function(t){let e="";const{audio:i,video:r}=t;if(r){e+=`${qf(r.contentType)}_r${r.height}x${r.width}f${Math.ceil(r.framerate)}${r.transferFunction||"sd"}_${Math.ceil(r.bitrate/1e5)}`}if(i){e+=`${r?"_":""}${qf(i.contentType)}_c${i.channels}`}return e}(t);return r[e]||(r[e]=i.decodingInfo(t))})).then(t=>({supported:!t.some(t=>!t.supported),configurations:a,decodingInfoResults:t})).catch(t=>({supported:!1,configurations:a,decodingInfoResults:[],error:t}))}function Qf(t,e){if(e<=1)return 1;let i=128e3;return"ec-3"===t?i=768e3:"ac-3"===t&&(i=64e4),Math.min(e/2,i)}function Xf(t){return 1e3*Math.ceil(Math.max(.9*t.bitrate,t.averageBitrate)/1e3)||1}const Jf=["NONE","TYPE-0","TYPE-1",null];const tm=["SDR","PQ","HLG"];var em="",im="YES",rm="v2";function sm(t){const{canSkipUntil:e,canSkipDateRanges:i,age:r}=t;return e&&r<e/2?i?rm:im:em}class am{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 nm{constructor(t){if(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.supplemental=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(","),"supplemental"in t){var e;this.supplemental=t.supplemental;const i=null==(e=t.supplemental)?void 0:e.videoCodec;i&&i!==t.videoCodec&&(this.codecSet+=`,${i.substring(0,4)}`)}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 om(this._audioGroups,t)}hasSubtitleGroup(t){return om(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 om(t,e){return!(!e||!t)&&-1!==t.indexOf(e)}function lm(t,e){let i=!1,r=[];if(t&&(i="SDR"!==t,r=[t]),e){r=e.allowedVideoRanges||tm.slice(0);const t="SDR"!==r.join("")&&!e.videoCodec;i=void 0!==e.preferHDR?e.preferHDR:t&&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}(),i||(r=["SDR"])}return{preferHDR:i,allowedVideoRanges:r}}const cm=(t,e)=>JSON.stringify(t,(t=>{const e=new WeakSet;return(i,r)=>{if(t&&(r=t(i,r)),"object"==typeof r&&null!==r){if(e.has(r))return;e.add(r)}return r}})(e));function dm(t,e){zg.log(`[abr] start candidates with "${t}" ignored because ${e}`)}function hm(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:{}})}function pm(t){if(!t)return t;const{lang:e,assocLang:i,characteristics:r,channels:s,audioCodec:a}=t;return{lang:e,assocLang:i,characteristics:r,channels:s,audioCodec:a}}function um(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(gm(t,e[r],i))return r}return-1}function gm(t,e,i){const{groupId:r,name:s,lang:a,assocLang:n,default:o}=t,l=t.forced;return(void 0===r||e.groupId===r)&&(void 0===s||e.name===s)&&(void 0===a||function(t,e="--"){if(t.length===e.length)return t===e;return t.startsWith(e)||e.startsWith(t)}(a,e.lang))&&(void 0===a||e.assocLang===n)&&(void 0===o||e.default===o)&&(void 0===l||e.forced===l)&&(!("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 fm(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 mm(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}function vm(t,e){var i;return!!t&&t!==(null==(i=e.loadLevelObj)?void 0:i.uri)}const bm=function(t,e){let i=0,r=t.length-1,s=null,a=null;for(;i<=r;){s=(i+r)/2|0,a=t[s];const n=e(a);if(n>0)i=s+1;else{if(!(n<0))return a;r=s-1}}return null};function km(t,e,i=0,r=0,s=.005){let a=null;if(t){a=e[1+t.sn-e[0].sn]||null;const r=t.endDTS-i;r>0&&r<15e-7&&(i+=15e-7),a&&t.level!==a.level&&a.end<=t.end&&(a=e[2+t.sn-e[0].sn]||null)}else 0===i&&0===e[0].start&&(a=e[0]);if(a&&((!t||t.level===a.level)&&0===ym(i,r,a)||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}(a,t,Math.min(s,r))))return a;const n=bm(e,ym.bind(null,i,r));return!n||n===t&&a?a:n}function ym(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 wm(t,e,i){const r=1e3*Math.min(e,i.duration+(i.deltaPTS?i.deltaPTS:0));return(i.endProgramDateTime||0)-r>t}function xm(t,e,i){if(t&&t.startCC<=e&&t.endCC>=e){let r=t.fragments;const{fragmentHint:s}=t;let a;return s&&(r=r.concat(s)),bm(r,t=>t.cc<e?1:t.cc>e?-1:(a=t,t.end<=i?1:t.start>i?-1:0)),a||null}return null}function Sm(t){switch(t.details){case yg.FRAG_LOAD_TIMEOUT:case yg.KEY_LOAD_TIMEOUT:case yg.LEVEL_LOAD_TIMEOUT:case yg.MANIFEST_LOAD_TIMEOUT:return!0}return!1}function Em(t,e){const i=Sm(e);return t.default[(i?"timeout":"error")+"Retry"]}function Pm(t,e){const i="linear"===t.backoff?1:Math.pow(2,e);return Math.min(i*t.retryDelayMs,t.maxRetryDelayMs)}function Tm(t){return Mg(Mg({},t),{errorRetry:null,timeoutRetry:null})}function Lm(t,e,i,r){if(!t)return!1;const s=null==r?void 0:r.code,a=e<t.maxNumRetry&&(function(t){return 0===t&&!1===navigator.onLine||!!t&&(t<400||t>499)}(s)||!!i);return t.shouldRetry?t.shouldRetry(t,e,i,r,a):a}var Cm=0,_m=2,Am=3,Rm=5,Im=0,Dm=1,Mm=2;function Om(t){const e={action:Cm,flags:Im};return t&&(e.resolved=!0),e}var Um="NOT_LOADED",$m="APPENDING",Fm="PARTIAL",Nm="OK";class jm{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(wg.MANIFEST_LOADING,this.onManifestLoading,this),t.on(wg.BUFFER_APPENDED,this.onBufferAppended,this),t.on(wg.FRAG_BUFFERED,this.onFragBuffered,this),t.on(wg.FRAG_LOADED,this.onFragLoaded,this)}_unregisterListeners(){const{hls:t}=this;t.off(wg.MANIFEST_LOADING,this.onManifestLoading,this),t.off(wg.BUFFER_APPENDED,this.onBufferAppended,this),t.off(wg.FRAG_BUFFERED,this.onFragBuffered,this),t.off(wg.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 s=r.end;if(r.start<=t&&null!==s&&t<=s)return r}return this.getBufferedFrag(t,e)}getBufferedFrag(t,e){return this.getFragAtPos(t,e,!0)}getFragAtPos(t,e,i){const{fragments:r}=this,s=Object.keys(r);for(let a=s.length;a--;){const n=r[s[a]];if((null==n?void 0:n.body.type)===e&&(!i||n.buffered)){const e=n.body;if(e.start<=t&&t<=e.end)return e}}return null}detectEvictedFragments(t,e,i,r,s){this.timeRanges&&(this.timeRanges[t]=e);const a=(null==r?void 0:r.fragment.sn)||-1;Object.keys(this.fragments).forEach(r=>{const n=this.fragments[r];if(!n)return;if(a>=n.body.sn)return;if(!n.buffered&&(!n.loaded||s))return void(n.body.type===i&&this.removeFragment(n.body));const o=n.range[t];o&&(0!==o.time.length?o.time.some(t=>{const i=!this.isTimeBuffered(t.startPTS,t.endPTS,e);return i&&this.removeFragment(n.body),i}):this.removeFragment(n.body))})}detectPartialFragments(t){const e=this.timeRanges;if(!e||"initSegment"===t.frag.sn)return;const i=t.frag,r=Bm(i),s=this.fragments[r];if(!s||s.buffered&&i.gap)return;const a=!i.relurl;if(Object.keys(e).forEach(r=>{const n=i.elementaryStreams[r];if(!n)return;const o=e[r],l=a||!0===n.partial;s.range[r]=this.getBufferedTimes(i,t.part,l,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),zm(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]=Gm(i,e=>e.fragment.sn>=t))}fragBuffered(t,e){const i=Bm(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 s={time:[],partial:i},a=t.start,n=t.end,o=t.minEndPTS||n,l=t.maxStartPTS||a;for(let t=0;t<r.length;t++){const e=r.start(t)-this.bufferPadding,i=r.end(t)+this.bufferPadding;if(l>=e&&o<=i){s.time.push({startPTS:Math.max(a,r.start(t)),endPTS:Math.min(n,r.end(t))});break}if(a<i&&n>e){const e=Math.max(a,r.start(t)),i=Math.min(n,r.end(t));i>e&&(s.partial=!0,s.time.push({startPTS:e,endPTS:i}))}else if(n<=e)break}return s}getPartialFragment(t){let e,i,r,s=null,a=0;const{bufferPadding:n,fragments:o}=this;return Object.keys(o).forEach(l=>{const c=o[l];c&&zm(c)&&(i=c.body.start-n,r=c.body.end+n,t>=i&&t<=r&&(e=Math.min(t-i,r-t),a<=e&&(s=c.body,a=e)))}),s}isEndListAppended(t){const e=this.endListFragments[t];return void 0!==e&&(e.buffered||zm(e))}getState(t){const e=Bm(t),i=this.fragments[e];return i?i.buffered?zm(i)?Fm:Nm:$m:Um}isTimeBuffered(t,e,i){let r,s;for(let a=0;a<i.length;a++){if(r=i.start(a)-this.bufferPadding,s=i.end(a)+this.bufferPadding,t>=r&&e<=s)return!0;if(e<=r)return!1}return!1}onManifestLoading(){this.removeAllFragments()}onFragLoaded(t,e){if("initSegment"===e.frag.sn||e.frag.bitrateTest)return;const i=e.frag,r=e.part?null:e,s=Bm(i);this.fragments[s]={body:i,appendedPTS:null,loaded:r,buffered:!1,range:Object.create(null)}}onBufferAppended(t,e){const{frag:i,part:r,timeRanges:s,type:a}=e;if("initSegment"===i.sn)return;const n=i.type;if(r){let t=this.activePartLists[n];t||(this.activePartLists[n]=t=[]),t.push(r)}this.timeRanges=s;const o=s[a];this.detectEvictedFragments(a,o,n,r)}onFragBuffered(t,e){this.detectPartialFragments(e)}hasFragment(t){const e=Bm(t);return!!this.fragments[e]}hasFragments(t){const{fragments:e}=this,i=Object.keys(e);if(!t)return i.length>0;for(let r=i.length;r--;){const s=e[i[r]];if((null==s?void 0:s.body.type)===t)return!0}return!1}hasParts(t){var e;return!(null==(e=this.activePartLists[t])||!e.length)}removeFragmentsInRange(t,e,i,r,s){r&&!this.hasGaps||Object.keys(this.fragments).forEach(a=>{const n=this.fragments[a];if(!n)return;const o=n.body;o.type!==i||r&&!o.gap||o.start<e&&o.end>t&&(n.buffered||s)&&this.removeFragment(o)})}removeFragment(t){const e=Bm(t);t.clearElementaryStreamInfo();const i=this.activePartLists[t.type];if(i){const e=t.sn;this.activePartLists[t.type]=Gm(i,t=>t.fragment.sn!==e)}delete this.fragments[e],t.endList&&delete this.endListFragments[t.type]}removeAllFragments(){var t,e;this.fragments=Object.create(null),this.endListFragments=Object.create(null),this.activePartLists=Object.create(null),this.hasGaps=!1;const i=null==(t=this.hls)||null==(e=t.latestLevelDetails)?void 0:e.partList;i&&i.forEach(t=>t.clearElementaryStreamInfo())}}function zm(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 Bm(t){return`${t.type}_${t.level}_${t.sn}`}function Gm(t,e){return t.filter(t=>{const i=e(t);return i||t.clearElementaryStreamInfo(),i})}var Hm=0,Vm=1;class qm{constructor(t,e,i){this.subtle=void 0,this.aesIV=void 0,this.aesMode=void 0,this.subtle=t,this.aesIV=e,this.aesMode=i}decrypt(t,e){switch(this.aesMode){case Hm:return this.subtle.decrypt({name:"AES-CBC",iv:this.aesIV},e,t);case Vm:return this.subtle.decrypt({name:"AES-CTR",counter:this.aesIV,length:64},e,t);default:throw new Error(`[AESCrypto] invalid aes mode ${this.aesMode}`)}}}class Km{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],s=i[1],a=i[2],n=i[3],o=this.invSubMix,l=o[0],c=o[1],d=o[2],h=o[3],p=new Uint32Array(256);let u=0,g=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=g^g<<1^g<<2^g<<3^g<<4;i=i>>>8^255&i^99,t[u]=i,e[i]=u;const o=p[u],f=p[o],m=p[f];let v=257*p[i]^16843008*i;r[u]=v<<24|v>>>8,s[u]=v<<16|v>>>16,a[u]=v<<8|v>>>24,n[u]=v,v=16843009*m^65537*f^257*o^16843008*u,l[i]=v<<24|v>>>8,c[i]=v<<16|v>>>16,d[i]=v<<8|v>>>24,h[i]=v,u?(u=o^p[p[p[m^o]]],g^=p[p[g]]):u=g=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 s=this.keySize=e.length;if(4!==s&&6!==s&&8!==s)throw new Error("Invalid aes key size="+s);const a=this.ksRows=4*(s+6+1);let n,o;const l=this.keySchedule=new Uint32Array(a),c=this.invKeySchedule=new Uint32Array(a),d=this.sBox,h=this.rcon,p=this.invSubMix,u=p[0],g=p[1],f=p[2],m=p[3];let v,b;for(n=0;n<a;n++)n<s?v=l[n]=e[n]:(b=v,n%s===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/s|0]<<24):s>6&&n%s===4&&(b=d[b>>>24]<<24|d[b>>>16&255]<<16|d[b>>>8&255]<<8|d[255&b]),l[n]=v=(l[n-s]^b)>>>0);for(o=0;o<a;o++)n=a-o,b=3&o?l[n]:l[n-4],c[o]=o<4||n<=4?b:u[d[b>>>24]]^g[d[b>>>16&255]]^f[d[b>>>8&255]]^m[d[255&b]],c[o]=c[o]>>>0}networkToHostOrderSwap(t){return t<<24|(65280&t)<<8|(16711680&t)>>8|t>>>24}decrypt(t,e,i){const r=this.keySize+6,s=this.invKeySchedule,a=this.invSBox,n=this.invSubMix,o=n[0],l=n[1],c=n[2],d=n[3],h=this.uint8ArrayToUint32Array_(i);let p=h[0],u=h[1],g=h[2],f=h[3];const m=new Int32Array(t),v=new Int32Array(m.length);let b,k,y,w,x,S,E,P,T,L,C,_,A,R;const I=this.networkToHostOrderSwap;for(;e<m.length;){for(T=I(m[e]),L=I(m[e+1]),C=I(m[e+2]),_=I(m[e+3]),x=T^s[0],S=_^s[1],E=C^s[2],P=L^s[3],A=4,R=1;R<r;R++)b=o[x>>>24]^l[S>>16&255]^c[E>>8&255]^d[255&P]^s[A],k=o[S>>>24]^l[E>>16&255]^c[P>>8&255]^d[255&x]^s[A+1],y=o[E>>>24]^l[P>>16&255]^c[x>>8&255]^d[255&S]^s[A+2],w=o[P>>>24]^l[x>>16&255]^c[S>>8&255]^d[255&E]^s[A+3],x=b,S=k,E=y,P=w,A+=4;b=a[x>>>24]<<24^a[S>>16&255]<<16^a[E>>8&255]<<8^a[255&P]^s[A],k=a[S>>>24]<<24^a[E>>16&255]<<16^a[P>>8&255]<<8^a[255&x]^s[A+1],y=a[E>>>24]<<24^a[P>>16&255]<<16^a[x>>8&255]<<8^a[255&S]^s[A+2],w=a[P>>>24]<<24^a[x>>16&255]<<16^a[S>>8&255]<<8^a[255&E]^s[A+3],v[e]=I(b^p),v[e+1]=I(w^u),v[e+2]=I(y^g),v[e+3]=I(k^f),p=T,u=L,g=C,f=_,e+=4}return v.buffer}}class Ym{constructor(t,e,i){this.subtle=void 0,this.key=void 0,this.aesMode=void 0,this.subtle=t,this.key=e,this.aesMode=i}expandKey(){const t=function(t){switch(t){case Hm:return"AES-CBC";case Vm:return"AES-CTR";default:throw new Error(`[FastAESKey] invalid aes mode ${t}`)}}(this.aesMode);return this.subtle.importKey("raw",this.key,{name:t},!1,["encrypt","decrypt"])}}class Wm{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.enableSoftwareAES=void 0,this.enableSoftwareAES=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?t.slice(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,r){return this.useSoftware?new Promise((s,a)=>{const n=ArrayBuffer.isView(t)?t:new Uint8Array(t);this.softwareDecrypt(n,e,i,r);const o=this.flush();o?s(o.buffer):a(new Error("[softwareDecrypt] Failed to decrypt data"))}):this.webCryptoDecrypt(new Uint8Array(t),e,i,r)}softwareDecrypt(t,e,i,r){const{currentIV:s,currentResult:a,remainderData:n}=this;if(r!==Hm||16!==e.byteLength)return zg.warn("SoftwareDecrypt: can only handle AES-128-CBC"),null;this.logOnce("JS AES decrypt"),n&&(t=Sf(n,t),this.remainderData=null);const o=this.getValidChunk(t);if(!o.length)return null;s&&(i=s);let l=this.softwareDecrypter;l||(l=this.softwareDecrypter=new Km),l.expandKey(e);const c=a;return this.currentResult=l.decrypt(o.buffer,0,i),this.currentIV=o.slice(-16).buffer,c||null}webCryptoDecrypt(t,e,i,r){if(this.key!==e||!this.fastAesKey){if(!this.subtle)return Promise.resolve(this.onWebCryptoError(t,e,i,r));this.key=e,this.fastAesKey=new Ym(this.subtle,e,r)}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 qm(this.subtle,new Uint8Array(i),r).decrypt(t.buffer,e)}).catch(s=>(zg.warn(`[decrypter]: WebCrypto Error, disable WebCrypto API, ${s.name}: ${s.message}`),this.onWebCryptoError(t,e,i,r)))}onWebCryptoError(t,e,i,r){const s=this.enableSoftwareAES;if(s){this.useSoftware=!0,this.logEnabled=!0,this.softwareDecrypt(t,e,i,r);const s=this.flush();if(s)return s.buffer}throw new Error("WebCrypto"+(s?" and softwareDecrypt":"")+": failed to decrypt data")}getValidChunk(t){let e=t;const i=t.length-t.length%16;return i!==t.length&&(e=t.slice(0,i),this.remainderData=t.slice(i)),e}logOnce(t){this.logEnabled&&(zg.log(`[decrypter]: ${t}`),this.logEnabled=!1)}}const Zm=Math.pow(2,17);class Qm{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 tv({type:kg.NETWORK_ERROR,details:yg.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,s=r.fLoader,a=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(Jm(t));t.gap=!1}const l=this.loader=s?new s(r):new a(r),c=Xm(t);t.loader=l;const d=Tm(r.fragLoadPolicy.default),h={loadPolicy:d,timeout:d.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0,highWaterMark:"initSegment"===t.sn?1/0:Zm};t.stats=l.stats;const p={onSuccess:(e,i,r,s)=>{this.resetLoader(t,l);let a=e.data;r.resetIV&&t.decryptdata&&(t.decryptdata.iv=new Uint8Array(a.slice(0,16)),a=a.slice(16)),n({frag:t,part:null,payload:a,networkDetails:s})},onError:(e,r,s,a)=>{this.resetLoader(t,l),o(new tv({type:kg.NETWORK_ERROR,details:yg.FRAG_LOAD_ERROR,fatal:!1,frag:t,response:Mg({url:i,data:void 0},e),error:new Error(`HTTP Error ${e.code} ${e.text}`),networkDetails:s,stats:a}))},onAbort:(e,i,r)=>{this.resetLoader(t,l),o(new tv({type:kg.NETWORK_ERROR,details:yg.INTERNAL_ABORTED,fatal:!1,frag:t,error:new Error("Aborted"),networkDetails:r,stats:e}))},onTimeout:(e,i,r)=>{this.resetLoader(t,l),o(new tv({type:kg.NETWORK_ERROR,details:yg.FRAG_LOAD_TIMEOUT,fatal:!1,frag:t,error:new Error(`Timeout after ${h.timeout}ms`),networkDetails:r,stats:e}))}};e&&(p.onProgress=(i,r,s,a)=>e({frag:t,part:null,payload:s,networkDetails:a})),l.load(c,h,p)})}loadPart(t,e,i){this.abort();const r=this.config,s=r.fLoader,a=r.loader;return new Promise((n,o)=>{if(this.loader&&this.loader.destroy(),t.gap||e.gap)return void o(Jm(t,e));const l=this.loader=s?new s(r):new a(r),c=Xm(t,e);t.loader=l;const d=Tm(r.fragLoadPolicy.default),h={loadPolicy:d,timeout:d.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0,highWaterMark:Zm};e.stats=l.stats,l.load(c,h,{onSuccess:(r,s,a,o)=>{this.resetLoader(t,l),this.updateStatsFromPart(t,e);const c={frag:t,part:e,payload:r.data,networkDetails:o};i(c),n(c)},onError:(i,r,s,a)=>{this.resetLoader(t,l),o(new tv({type:kg.NETWORK_ERROR,details:yg.FRAG_LOAD_ERROR,fatal:!1,frag:t,part:e,response:Mg({url:c.url,data:void 0},i),error:new Error(`HTTP Error ${i.code} ${i.text}`),networkDetails:s,stats:a}))},onAbort:(i,r,s)=>{t.stats.aborted=e.stats.aborted,this.resetLoader(t,l),o(new tv({type:kg.NETWORK_ERROR,details:yg.INTERNAL_ABORTED,fatal:!1,frag:t,part:e,error:new Error("Aborted"),networkDetails:s,stats:i}))},onTimeout:(i,r,s)=>{this.resetLoader(t,l),o(new tv({type:kg.NETWORK_ERROR,details:yg.FRAG_LOAD_TIMEOUT,fatal:!1,frag:t,part:e,error:new Error(`Timeout after ${h.timeout}ms`),networkDetails:s,stats:i}))}})})}updateStatsFromPart(t,e){const i=t.stats,r=e.stats,s=r.total;if(i.loaded+=r.loaded,s){const r=Math.round(t.duration/e.duration),a=Math.min(Math.round(i.loaded/s),r),n=(r-a)*Math.round(i.loaded/a);i.total=i.loaded+n}else i.total=Math.max(i.loaded,i.total);const a=i.loading,n=r.loading;a.start?a.first+=n.first-n.start:(a.start=n.start,a.first=n.first),a.end=n.end}resetLoader(t,e){t.loader=null,this.loader===e&&(self.clearTimeout(this.partLoadTimeout),this.loader=null),e.destroy()}}function Xm(t,e=null){const i=e||t,r={frag:t,part:e,responseType:"arraybuffer",url:i.url,headers:{},rangeStart:0,rangeEnd:0},s=i.byteRangeStartOffset,a=i.byteRangeEndOffset;if(mg(s)&&mg(a)){var n;let e=s,i=a;if("initSegment"===t.sn&&("AES-128"===(o=null==(n=t.decryptdata)?void 0:n.method)||"AES-256"===o)){const t=a-s;t%16&&(i=a+(16-t%16)),0!==s&&(r.resetIV=!0,e=s-16)}r.rangeStart=e,r.rangeEnd=i}var o;return r}function Jm(t,e){const i=new Error(`GAP ${t.gap?"tag":"attribute"} found`),r={type:kg.MEDIA_ERROR,details:yg.FRAG_GAP,fatal:!1,frag:t,error:i,networkDetails:null};return e&&(r.part=e),(e||t).stats.aborted=!0,new tv(r)}class tv extends Error{constructor(t){super(t.error.message),this.data=void 0,this.data=t}}class ev extends Og{constructor(t,e){super(t,e),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(){}}class iv{constructor(t,e,i,r=0,s=-1,a=!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=s,this.partial=a}}const rv={length:0,start:()=>0,end:()=>0};class sv{static isBuffered(t,e){if(t){const i=sv.getBuffered(t);for(let t=i.length;t--;)if(e>=i.start(t)&&e<=i.end(t))return!0}return!1}static bufferedRanges(t){if(t){const e=sv.getBuffered(t);return sv.timeRangesToArray(e)}return[]}static timeRangesToArray(t){const e=[];for(let i=0;i<t.length;i++)e.push({start:t.start(i),end:t.end(i)});return e}static bufferInfo(t,e,i){if(t){const r=sv.bufferedRanges(t);if(r.length)return sv.bufferedInfo(r,e,i)}return{len:0,start:e,end:e,bufferedIndex:-1}}static bufferedInfo(t,e,i){e=Math.max(0,e),t.length>1&&t.sort((t,e)=>t.start-e.start||e.end-t.end);let r=-1,s=[];if(i)for(let a=0;a<t.length;a++){e>=t[a].start&&e<=t[a].end&&(r=a);const n=s.length;if(n){const e=s[n-1].end;t[a].start-e<i?t[a].end>e&&(s[n-1].end=t[a].end):s.push(t[a])}else s.push(t[a])}else s=t;let a,n=0,o=e,l=e;for(let t=0;t<s.length;t++){const c=s[t].start,d=s[t].end;if(-1===r&&e>=c&&e<=d&&(r=t),e+i>=c&&e<d)o=c,l=d,n=l-e;else if(e+i<c){a=c;break}}return{len:n,start:o||0,end:l||0,nextStart:a,buffered:t,bufferedIndex:r}}static getBuffered(t){try{return t.buffered||rv}catch(t){return zg.log("failed to get media.buffered",t),rv}}}const av=/\{\$([a-zA-Z0-9-_]+)\}/g;function nv(t){return av.test(t)}function ov(t,e){if(null!==t.variableList||t.hasVariableRefs){const i=t.variableList;return e.replace(av,e=>{const r=e.substring(2,e.length-1),s=null==i?void 0:i[r];return void 0===s?(t.playlistParsingError||(t.playlistParsingError=new Error(`Missing preceding EXT-X-DEFINE tag for Variable Reference: "${r}"`)),e):s})}return e}function lv(t,e,i){let r,s,a=t.variableList;if(a||(t.variableList=a={}),"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}"`);s=t.get(r)}catch(e){t.playlistParsingError||(t.playlistParsingError=new Error(`EXT-X-DEFINE QUERYPARAM: ${e.message}`))}}else r=e.NAME,s=e.VALUE;r in a?t.playlistParsingError||(t.playlistParsingError=new Error(`EXT-X-DEFINE duplicate Variable Name declarations: "${r}"`)):a[r]=s||""}function cv(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}"`))}const dv=/^(\d+)x(\d+)$/,hv=/(.+?)=(".*?"|.*?)(?:,|$)/g;class pv{constructor(t,e){"string"==typeof t&&(t=pv.parseAttrList(t,e)),Ig(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]}enumeratedStringList(t,e){const i=this[t];return(i?i.split(/[ ,]+/):[]).reduce((t,e)=>(t[e.toLowerCase()]=!0,t),e)}bool(t){return"YES"===this[t]}decimalResolution(t){const e=dv.exec(this[t]);if(null!==e)return{width:parseInt(e[1],10),height:parseInt(e[2],10)}}static parseAttrList(t,e){let i;const r={};for(hv.lastIndex=0;null!==(i=hv.exec(t));){const s=i[1].trim();let a=i[2];const n=0===a.indexOf('"')&&a.lastIndexOf('"')===a.length-1;let o=!1;if(n)a=a.slice(1,-1);else switch(s){case"IV":case"SCTE35-CMD":case"SCTE35-IN":case"SCTE35-OUT":o=!0}if(e&&(n||o))a=ov(e,a);else if(!o&&!n)switch(s){case"CLOSED-CAPTIONS":if("NONE"===a)break;case"ALLOWED-CPC":case"CLASS":case"ASSOC-LANGUAGE":case"AUDIO":case"BYTERANGE":case"CHANNELS":case"CHARACTERISTICS":case"CODECS":case"DATA-ID":case"END-DATE":case"GROUP-ID":case"ID":case"IMPORT":case"INSTREAM-ID":case"KEYFORMAT":case"KEYFORMATVERSIONS":case"LANGUAGE":case"NAME":case"PATHWAY-ID":case"QUERYPARAM":case"RECENTLY-REMOVED-DATERANGES":case"SERVER-URI":case"STABLE-RENDITION-ID":case"STABLE-VARIANT-ID":case"START-DATE":case"SUBTITLES":case"SUPPLEMENTAL-CODECS":case"URI":case"VALUE":case"VIDEO":case"X-ASSET-LIST":case"X-ASSET-URI":zg.warn(`${t}: attribute ${s} is missing quotes`)}r[s]=a}return r}}function uv(t){return"ID"!==t&&"CLASS"!==t&&"CUE"!==t&&"START-DATE"!==t&&"DURATION"!==t&&"END-DATE"!==t&&"END-ON-NEXT"!==t}function gv(t){return"SCTE35-OUT"===t||"SCTE35-IN"===t||"SCTE35-CMD"===t}class fv{constructor(t,e,i=0){var r;if(this.attr=void 0,this.tagAnchor=void 0,this.tagOrder=void 0,this._startDate=void 0,this._endDate=void 0,this._dateAtEnd=void 0,this._cue=void 0,this._badValueForSameId=void 0,this.tagAnchor=(null==e?void 0:e.tagAnchor)||null,this.tagOrder=null!=(r=null==e?void 0:e.tagOrder)?r:i,e){const i=e.attr;for(const e in i)if(Object.prototype.hasOwnProperty.call(t,e)&&t[e]!==i[e]){zg.warn(`DATERANGE tag attribute: "${e}" does not match for tags with ID: "${t.ID}"`),this._badValueForSameId=e;break}t=Ig(new pv({}),i,t)}if(this.attr=t,e?(this._startDate=e._startDate,this._cue=e._cue,this._endDate=e._endDate,this._dateAtEnd=e._dateAtEnd):this._startDate=new Date(t["START-DATE"]),"END-DATE"in this.attr){const t=(null==e?void 0:e.endDate)||new Date(this.attr["END-DATE"]);mg(t.getTime())&&(this._endDate=t)}}get id(){return this.attr.ID}get class(){return this.attr.CLASS}get cue(){const t=this._cue;return void 0===t?this._cue=this.attr.enumeratedStringList(this.attr.CUE?"CUE":"X-CUE",{pre:!1,post:!1,once:!1}):t}get startTime(){const{tagAnchor:t}=this;return null===t||null===t.programDateTime?(zg.warn(`Expected tagAnchor Fragment with PDT set for DateRange "${this.id}": ${t}`),NaN):t.start+(this.startDate.getTime()-t.programDateTime)/1e3}get startDate(){return this._startDate}get endDate(){const t=this._endDate||this._dateAtEnd;if(t)return t;const e=this.duration;return null!==e?this._dateAtEnd=new Date(this._startDate.getTime()+1e3*e):null}get duration(){if("DURATION"in this.attr){const t=this.attr.decimalFloatingPoint("DURATION");if(mg(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 isInterstitial(){return"com.apple.hls.interstitial"===this.class}get isValid(){return!!this.id&&!this._badValueForSameId&&mg(this.startDate.getTime())&&(null===this.duration||this.duration>=0)&&(!this.endOnNext||!!this.class)&&(!this.attr.CUE||!this.cue.pre&&!this.cue.post||this.cue.pre!==this.cue.post)&&(!this.isInterstitial||"X-ASSET-URI"in this.attr||"X-ASSET-LIST"in this.attr)}}class mv{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.dateRangeTagCount=0,this.live=!0,this.requestScheduled=-1,this.ageHeader=0,this.advancedDateTime=void 0,this.updated=!0,this.advanced=!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.appliedTimelineOffset=void 0,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}get hasProgramDateTime(){return!!this.fragments.length&&mg(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 fragmentStart(){var t;return null!=(t=this.fragments)&&t.length?this.fragments[0].start: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 maxPartIndex(){const t=this.partList;if(t){const e=this.lastPartIndex;if(-1!==e){for(let i=t.length;i--;)if(t[i].index>e)return t[i].index;return e}}return 0}get lastPartSn(){var t;return null!=(t=this.partList)&&t.length?this.partList[this.partList.length-1].fragment.sn:this.endSN}get expired(){if(this.live&&this.age&&this.misses<3){const t=this.partEnd-this.fragmentStart;return this.age>Math.max(t,this.totalduration)+this.levelTargetDuration}return!1}}function vv(t){return"AES-128"===t||"AES-256"===t||"AES-256-CTR"===t}function bv(t){switch(t){case"AES-128":case"AES-256":return Hm;case"AES-256-CTR":return Vm;default:throw new Error(`invalid full segment method ${t}`)}}function kv(t){return Uint8Array.from(atob(t),t=>t.charCodeAt(0))}function yv(t){return Uint8Array.from(unescape(encodeURIComponent(t)),t=>t.charCodeAt(0))}function wv(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],s=r[1];e?(t.splice(-1,1),i=kv(s)):i=function(t){const e=yv(t).subarray(0,16),i=new Uint8Array(16);return i.set(e,16-e.length),i}(s)}}return i}const xv="undefined"!=typeof self?self:void 0;var Sv={CLEARKEY:"org.w3.clearkey",FAIRPLAY:"com.apple.fps",PLAYREADY:"com.microsoft.playready",WIDEVINE:"com.widevine.alpha"},Ev="org.w3.clearkey",Pv="com.apple.streamingkeydelivery",Tv="com.microsoft.playready",Lv="urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed";function Cv(t){switch(t){case Pv:return Sv.FAIRPLAY;case Tv:return Sv.PLAYREADY;case Lv:return Sv.WIDEVINE;case Ev:return Sv.CLEARKEY}}var _v="1077efecc0b24d02ace33c1e52e2fb4b",Av="e2719d58a985b3c9781ab030af78d30e",Rv="9a04f07998404286ab92e65be0885f95",Iv="edef8ba979d64acea3c827dcd51d21ed";function Dv(t){return t===Iv?Sv.WIDEVINE:t===Rv?Sv.PLAYREADY:t===_v||t===Av?Sv.CLEARKEY:void 0}function Mv(t){switch(t){case Sv.FAIRPLAY:return Pv;case Sv.PLAYREADY:return Tv;case Sv.WIDEVINE:return Lv;case Sv.CLEARKEY:return Ev}}function Ov(t){const{drmSystems:e,widevineLicenseUrl:i}=t,r=e?[Sv.FAIRPLAY,Sv.WIDEVINE,Sv.PLAYREADY,Sv.CLEARKEY].filter(t=>!!e[t]):[];return!r[Sv.WIDEVINE]&&i&&r.push(Sv.WIDEVINE),r}const Uv=null!=xv&&null!=($v=xv.navigator)&&$v.requestMediaKeySystemAccess?self.navigator.requestMediaKeySystemAccess.bind(self.navigator):null;var $v;function Fv(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),s=(new DOMParser).parseFromString(r,"text/xml").getElementsByTagName("KID")[0];if(s){const t=s.childNodes[0]?s.childNodes[0].nodeValue:s.getAttribute("VALUE");if(t){const e=kv(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}let Nv={};class jv{static clearKeyUriToKeyIdMap(){Nv={}}constructor(t,e,i,r=[1],s=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=s,this.encrypted=!!t&&"NONE"!==t,this.isCommonEncryption=this.encrypted&&!vv(t)}isSupported(){if(this.method){if(vv(this.method)||"NONE"===this.method)return!0;if("identity"===this.keyFormat)return"SAMPLE-AES"===this.method;switch(this.keyFormat){case Pv:case Lv:case Tv:case Ev: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(vv(this.method)&&this.uri&&!this.iv){"number"!=typeof t&&(zg.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 jv(this.method,this.uri,"identity",this.keyFormatVersions,e)}const e=wv(this.uri);if(e)switch(this.keyFormat){case Lv:this.pssh=e,e.length>=22&&(this.keyId=e.subarray(e.length-22,e.length-6));break;case Tv:{const t=new Uint8Array([154,4,240,121,152,64,66,134,171,146,230,91,224,136,95,149]);this.pssh=_f(t,0,e),this.keyId=Fv(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=Nv[this.uri];if(!t){const e=Object.keys(Nv).length%Number.MAX_SAFE_INTEGER;t=new Uint8Array(16);new DataView(t.buffer,12,4).setUint32(0,e),Nv[this.uri]=t}this.keyId=t}return this}}const zv=/#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,Bv=/#EXT-X-MEDIA:(.*)/g,Gv=/^#EXT(?:INF|-X-TARGETDURATION):/m,Hv=new RegExp([/#EXTINF:\s*(\d*(?:\.\d+)?)(?:,(.*)\s+)?/.source,/(?!#) *(\S[^\r\n]*)/.source,/#.*/.source].join("|"),"g"),Vv=new RegExp([/#EXT-X-(PROGRAM-DATE-TIME|BYTERANGE|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 qv{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 Wg.buildAbsoluteURL(e,t,{alwaysNormalize:!0})}static isMediaPlaylist(t){return Gv.test(t)}static parseMasterPlaylist(t,e){const i={contentSteering:null,levels:[],playlistParsingError:null,sessionData:null,sessionKeys:null,startTimeOffset:null,variableList:null,hasVariableRefs:nv(t)},r=[];let s;for(zv.lastIndex=0;null!=(s=zv.exec(t));)if(s[1]){var a;const t=new pv(s[1],i),n=ov(i,s[2]),o={attrs:t,bitrate:t.decimalInteger("BANDWIDTH")||t.decimalInteger("AVERAGE-BANDWIDTH"),name:t.NAME,url:qv.resolve(n,e)},l=t.decimalResolution("RESOLUTION");l&&(o.width=l.width,o.height=l.height),Qv(t.CODECS,o);const c=t["SUPPLEMENTAL-CODECS"];c&&(o.supplemental={},Qv(c,o.supplemental)),null!=(a=o.unknownCodecs)&&a.length||r.push(o),i.levels.push(o)}else if(s[3]){const t=s[3],r=s[4];switch(t){case"SESSION-DATA":{const t=new pv(r,i),e=t["DATA-ID"];e&&(null===i.sessionData&&(i.sessionData={}),i.sessionData[e]=t);break}case"SESSION-KEY":{const t=Wv(r,e,i);t.encrypted&&t.isSupported()?(null===i.sessionKeys&&(i.sessionKeys=[]),i.sessionKeys.push(t)):zg.warn(`[Keys] Ignoring invalid EXT-X-SESSION-KEY tag: "${r}"`);break}case"DEFINE":lv(i,new pv(r,i),e);break;case"CONTENT-STEERING":{const t=new pv(r,i);i.contentSteering={uri:qv.resolve(t["SERVER-URI"],e),pathwayId:t["PATHWAY-ID"]||"."};break}case"START":i.startTimeOffset=Zv(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 s={},a=i.levels,n={AUDIO:a.map(t=>({id:t.attrs.AUDIO,audioCodec:t.audioCodec})),SUBTITLES:a.map(t=>({id:t.attrs.SUBTITLES,textCodec:t.textCodec})),"CLOSED-CAPTIONS":[]};let o=0;for(Bv.lastIndex=0;null!==(r=Bv.exec(t));){const t=new pv(r[1],i),a=t.TYPE;if(a){const i=n[a],r=s[a]||[];s[a]=r;const l=t.LANGUAGE,c=t["ASSOC-LANGUAGE"],d=t.CHANNELS,h=t.CHARACTERISTICS,p=t["INSTREAM-ID"],u={attrs:t,bitrate:0,id:o++,groupId:t["GROUP-ID"]||"",name:t.NAME||l||"",type:a,default:t.bool("DEFAULT"),autoselect:t.bool("AUTOSELECT"),forced:t.bool("FORCED"),lang:l,url:t.URI?qv.resolve(t.URI,e):""};if(c&&(u.assocLang=c),d&&(u.channels=d),h&&(u.characteristics=h),p&&(u.instreamId=p),null!=i&&i.length){const t=qv.findGroup(i,u.groupId)||i[0];Xv(u,t,"audioCodec"),Xv(u,t,"textCodec")}r.push(u)}}return s}static parseLevelPlaylist(t,e,i,r,s,a){var n;const o={url:e},l=new mv(e),c=l.fragments,d=[];let h,p,u,g,f=null,m=0,v=0,b=0,k=0,y=0,w=null,x=new rf(r,o),S=-1,E=!1,P=null;if(Hv.lastIndex=0,l.m3u8=t,l.hasVariableRefs=nv(t),"#EXTM3U"!==(null==(n=Hv.exec(t))?void 0:n[0]))return l.playlistParsingError=new Error("Missing format identifier #EXTM3U"),l;for(;null!==(h=Hv.exec(t));){E&&(E=!1,x=new rf(r,o),x.playlistOffset=b,x.start=b,x.sn=m,x.cc=k,y&&(x.bitrate=y),x.level=i,f&&(x.initSegment=f,f.rawProgramDateTime&&(x.rawProgramDateTime=f.rawProgramDateTime,f.rawProgramDateTime=null),P&&(x.setByteRange(P),P=null)));const t=h[1];if(t){x.duration=parseFloat(t);const e=(" "+h[2]).slice(1);x.title=e||null,x.tagList.push(e?["INF",t,e]:["INF",t])}else if(h[3]){if(mg(x.duration)){x.playlistOffset=b,x.start=b,u&&eb(x,u,l),x.sn=m,x.level=i,x.cc=k,c.push(x);const t=(" "+h[3]).slice(1);x.relurl=ov(l,t),Jv(x,w,d),w=x,b+=x.duration,m++,v=0,E=!0}}else{if(h=h[0].match(Vv),!h){zg.warn("No matches on slow regex match for level playlist!");continue}for(p=1;p<h.length&&void 0===h[p];p++);const t=(" "+h[p]).slice(1),s=(" "+h[p+1]).slice(1),n=h[p+2]?(" "+h[p+2]).slice(1):null;switch(t){case"BYTERANGE":w?x.setByteRange(s,w):x.setByteRange(s);break;case"PROGRAM-DATE-TIME":x.rawProgramDateTime=s,x.tagList.push(["PROGRAM-DATE-TIME",s]),-1===S&&(S=c.length);break;case"PLAYLIST-TYPE":l.type&&ib(l,t,h),l.type=s.toUpperCase();break;case"MEDIA-SEQUENCE":0!==l.startSN?ib(l,t,h):c.length>0&&rb(l,t,h),m=l.startSN=parseInt(s);break;case"SKIP":{l.skippedSegments&&ib(l,t,h);const e=new pv(s,l),i=e.decimalInteger("SKIPPED-SEGMENTS");if(mg(i)){l.skippedSegments+=i;for(let t=i;t--;)c.push(null);m+=i}const r=e.enumeratedString("RECENTLY-REMOVED-DATERANGES");r&&(l.recentlyRemovedDateranges=(l.recentlyRemovedDateranges||[]).concat(r.split("\t")));break}case"TARGETDURATION":0!==l.targetduration&&ib(l,t,h),l.targetduration=Math.max(parseInt(s),1);break;case"VERSION":null!==l.version&&ib(l,t,h),l.version=parseInt(s);break;case"INDEPENDENT-SEGMENTS":break;case"ENDLIST":l.live||ib(l,t,h),l.live=!1;break;case"#":(s||n)&&x.tagList.push(n?[s,n]:[s]);break;case"DISCONTINUITY":k++,x.tagList.push(["DIS"]);break;case"GAP":x.gap=!0,x.tagList.push([t]);break;case"BITRATE":x.tagList.push([t,s]),y=1e3*parseInt(s),mg(y)?x.bitrate=y:y=0;break;case"DATERANGE":{const t=new pv(s,l),e=new fv(t,l.dateRanges[t.ID],l.dateRangeTagCount);l.dateRangeTagCount++,e.isValid||l.skippedSegments?l.dateRanges[e.id]=e:zg.warn(`Ignoring invalid DATERANGE tag: "${s}"`),x.tagList.push(["EXT-X-DATERANGE",s]);break}case"DEFINE":{const t=new pv(s,l);"IMPORT"in t?cv(l,t,a):lv(l,t,e)}break;case"DISCONTINUITY-SEQUENCE":0!==l.startCC?ib(l,t,h):c.length>0&&rb(l,t,h),l.startCC=k=parseInt(s);break;case"KEY":{const t=Wv(s,e,l);if(t.isSupported()){if("NONE"===t.method){u=void 0;break}u||(u={}),u[t.keyFormat]&&(u=Ig({},u)),u[t.keyFormat]=t}else zg.warn(`[Keys] Ignoring invalid EXT-X-KEY tag: "${s}"`);break}case"START":l.startTimeOffset=Zv(s);break;case"MAP":{const t=new pv(s,l);if(x.duration){const e=new rf(r,o);tb(e,t,i,u),f=e,x.initSegment=f,f.rawProgramDateTime&&!x.rawProgramDateTime&&(x.rawProgramDateTime=f.rawProgramDateTime)}else{const e=x.byteRangeEndOffset;if(e){const t=x.byteRangeStartOffset;P=`${e-t}@${t}`}else P=null;tb(x,t,i,u),f=x,E=!0}f.cc=k;break}case"SERVER-CONTROL":g&&ib(l,t,h),g=new pv(s),l.canBlockReload=g.bool("CAN-BLOCK-RELOAD"),l.canSkipUntil=g.optionalFloat("CAN-SKIP-UNTIL",0),l.canSkipDateRanges=l.canSkipUntil>0&&g.bool("CAN-SKIP-DATERANGES"),l.partHoldBack=g.optionalFloat("PART-HOLD-BACK",0),l.holdBack=g.optionalFloat("HOLD-BACK",0);break;case"PART-INF":{l.partTarget&&ib(l,t,h);const e=new pv(s);l.partTarget=e.decimalFloatingPoint("PART-TARGET");break}case"PART":{let t=l.partList;t||(t=l.partList=[]);const e=v>0?t[t.length-1]:void 0,i=v++,r=new pv(s,l),a=new sf(r,x,o,i,e);t.push(a),x.duration+=a.duration;break}case"PRELOAD-HINT":{const t=new pv(s,l);l.preloadHint=t;break}case"RENDITION-REPORT":{const t=new pv(s,l);l.renditionReports=l.renditionReports||[],l.renditionReports.push(t);break}default:zg.warn(`line parsed but not handled: ${h}`)}}}w&&!w.relurl?(c.pop(),b-=w.duration,l.partList&&(l.fragmentHint=w)):l.partList&&(Jv(x,w,d),x.cc=k,l.fragmentHint=x,u&&eb(x,u,l)),l.targetduration||(l.playlistParsingError=new Error("#EXT-X-TARGETDURATION is required"));const T=c.length,L=c[0],C=c[T-1];if(b+=l.skippedSegments*l.targetduration,b>0&&T&&C){l.averagetargetduration=b/T;const t=C.sn;l.endSN="initSegment"!==t?t:0,l.live||(C.endList=!0),L&&void 0===l.startCC&&(l.startCC=L.cc),S>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}}(c,S),L&&d.unshift(L))}else l.endSN=0,l.startCC=0;return l.fragmentHint&&(b+=l.fragmentHint.duration),l.totalduration=b,d.length&&l.dateRangeTagCount&&L&&Kv(d,l),l.endCC=k,l}}function Kv(t,e){const i=t.length;if(!i)return;const r=t[i-1],s=e.live?1/0:e.totalduration,a=Object.keys(e.dateRanges);for(let n=a.length;n--;){const o=e.dateRanges[a[n]],l=o.startDate.getTime();o.tagAnchor=r.ref;for(let r=i;r--;){const i=Yv(e,l,t,r,s);if(-1!==i){o.tagAnchor=e.fragments[i].ref;break}}}}function Yv(t,e,i,r,s){const a=i[r];if(a){const o=a.programDateTime;if(e>=o||0===r){var n;if(e<=o+1e3*(((null==(n=i[r+1])?void 0:n.start)||s)-a.start)){const s=i[r].sn-t.startSN,a=t.fragments;if(a.length>i.length){for(let n=(i[r+1]||a[a.length-1]).sn-t.startSN;n>s;n--){const t=a[n].programDateTime;if(e>=t&&e<t+1e3*a[n].duration)return n}}return s}}}return-1}function Wv(t,e,i){var r,s;const a=new pv(t,i),n=null!=(r=a.METHOD)?r:"",o=a.URI,l=a.hexadecimalInteger("IV"),c=a.KEYFORMATVERSIONS,d=null!=(s=a.KEYFORMAT)?s:"identity";o&&a.IV&&!l&&zg.error(`Invalid IV: ${a.IV}`);const h=o?qv.resolve(o,e):"",p=(c||"1").split("/").map(Number).filter(Number.isFinite);return new jv(n,h,d,p,l)}function Zv(t){const e=new pv(t).decimalFloatingPoint("TIME-OFFSET");return mg(e)?e:null}function Qv(t,e){let i=(t||"").split(/[ ,]+/).filter(t=>t);["video","audio","text"].forEach(t=>{const r=i.filter(e=>Df(e,t));r.length&&(e[`${t}Codec`]=r.map(t=>t.split("/")[0]).join(","),i=i.filter(t=>-1===r.indexOf(t)))}),e.unknownCodecs=i}function Xv(t,e,i){const r=e[i];r&&(t[i]=r)}function Jv(t,e,i){t.rawProgramDateTime?i.push(t):null!=e&&e.programDateTime&&(t.programDateTime=e.endProgramDateTime)}function tb(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 eb(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)}function ib(t,e,i){t.playlistParsingError=new Error(`#EXT-X-${e} must not appear more than once (${i[0]})`)}function rb(t,e,i){t.playlistParsingError=new Error(`#EXT-X-${e} must appear before the first Media Segment (${i[0]})`)}function sb(t,e){const i=e.startPTS;if(mg(i)){let r,s=0;e.sn>t.sn?(s=i-t.start,r=t):(s=t.start-i,r=e),r.duration!==s&&r.setDuration(s)}else if(e.sn>t.sn){t.cc===e.cc&&t.minEndPTS?e.setStart(t.start+(t.minEndPTS-t.start)):e.setStart(t.start+t.duration)}else e.setStart(Math.max(t.start-e.duration,0))}function ab(t,e,i,r,s,a){r-i<=0&&(zg.warn("Fragment should have a positive duration",e),r=i+e.duration,a=s+e.duration);let n=i,o=r;const l=e.startPTS,c=e.endPTS;if(mg(l)){const t=Math.abs(l-i);mg(e.deltaPTS)?e.deltaPTS=Math.max(t,e.deltaPTS):e.deltaPTS=t,n=Math.max(i,l),i=Math.min(i,l),s=Math.min(s,e.startDTS),o=Math.min(r,c),r=Math.max(r,c),a=Math.max(a,e.endDTS)}const d=i-e.start;0!==e.start&&e.setStart(i),e.setDuration(r-e.start),e.startPTS=i,e.maxStartPTS=n,e.startDTS=s,e.endPTS=r,e.minEndPTS=o,e.endDTS=a;const h=e.sn;if(!t||h<t.startSN||h>t.endSN)return 0;let p;const u=h-t.startSN,g=t.fragments;for(g[u]=e,p=u;p>0;p--)sb(g[p],g[p-1]);for(p=u;p<g.length-1;p++)sb(g[p],g[p+1]);return t.fragmentHint&&sb(g[g.length-1],t.fragmentHint),t.PTSKnown=t.alignedSliding=!0,d}function nb(t,e){if(t===e)return;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 s;t.fragmentHint&&delete t.fragmentHint.endPTS,function(t,e,i){const r=e.skippedSegments,s=Math.max(t.startSN,e.startSN)-e.startSN,a=(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,l=t.fragmentHint?t.fragments.concat(t.fragmentHint):t.fragments;for(let c=s;c<=a;c++){const s=l[n+c];let a=o[c];if(r&&!a&&s&&(a=e.fragments[c]=s),s&&a){if(i(s,a,c,o),s.url&&s.url!==a.url)return void(e.playlistParsingError=ob(`media sequence mismatch ${a.sn}:`,t,e,s,a));if(s.cc!==a.cc)return void(e.playlistParsingError=ob(`discontinuity sequence mismatch (${s.cc}!=${a.cc})`,t,e,s,a))}}}(t,e,(t,r,a,n)=>{if((!e.startCC||e.skippedSegments)&&r.cc!==t.cc){const i=t.cc-r.cc;for(let t=a;t<n.length;t++)n[t].cc+=i;e.endCC=n[n.length-1].cc}mg(t.startPTS)&&mg(t.endPTS)&&(r.setStart(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.setDuration(t.endPTS-t.startPTS),r.duration&&(s=r),e.PTSKnown=e.alignedSliding=!0),t.hasStreams&&(r.elementaryStreams=t.elementaryStreams),r.loader=t.loader,t.hasStats&&(r.stats=t.stats),t.initSegment&&(r.initSegment=t.initSegment,i=t.initSegment)});const a=e.fragments,n=e.fragmentHint?a.concat(e.fragmentHint):a;if(i&&n.forEach(t=>{var e;!t||t.initSegment&&t.initSegment.relurl!==(null==(e=i)?void 0:e.relurl)||(t.initSegment=i)}),e.skippedSegments){if(e.deltaUpdateFailed=a.some(t=>!t),e.deltaUpdateFailed){zg.warn("[level-helper] Previous playlist missing segments skipped in delta playlist");for(let t=e.skippedSegments;t--;)a.shift();e.startSN=a[0].sn}else{e.canSkipDateRanges&&(e.dateRanges=function(t,e){const{dateRanges:i,recentlyRemovedDateranges:r}=e,s=Ig({},t);r&&r.forEach(t=>{delete s[t]});const a=Object.keys(s).length;a&&Object.keys(i).forEach(t=>{const e=s[t],r=new fv(i[t].attr,e);r.isValid?(s[t]=r,e||(r.tagOrder+=a)):zg.warn(`Ignoring invalid Playlist Delta Update DATERANGE tag: "${cm(i[t].attr)}"`)});return s}(t.dateRanges,e));const i=t.fragments.filter(t=>t.rawProgramDateTime);if(t.hasProgramDateTime&&!e.hasProgramDateTime)for(let t=1;t<n.length;t++)null===n[t].programDateTime&&Jv(n[t],n[t-1],i);Kv(i,e)}e.endCC=a[a.length-1].cc}if(!e.startCC){var o;const i=hb(t,e.startSN-1);e.startCC=null!=(o=null==i?void 0:i.cc)?o:a[0].cc}!function(t,e,i){if(t&&e){let r=0;for(let s=0,a=t.length;s<=a;s++){const a=t[s],n=e[s+r];a&&n&&a.index===n.index&&a.fragment.sn===n.fragment.sn?i(a,n):r--}}}(t.partList,e.partList,(t,e)=>{e.elementaryStreams=t.elementaryStreams,e.stats=t.stats}),s?ab(e,s,s.startPTS,s.endPTS,s.startDTS,s.endDTS):lb(t,e),a.length&&(e.totalduration=e.edge-a[0].start),e.driftStartTime=t.driftStartTime,e.driftStart=t.driftStart;const l=e.advancedDateTime;if(e.advanced&&l){const t=e.edge;e.driftStart||(e.driftStartTime=l,e.driftStart=t),e.driftEndTime=l,e.driftEnd=t}else e.driftEndTime=t.driftEndTime,e.driftEnd=t.driftEnd,e.advancedDateTime=t.advancedDateTime;-1===e.requestScheduled&&(e.requestScheduled=t.requestScheduled)}function ob(t,e,i,r,s){return new Error(`${t} ${s.url}\nPlaylist starting @${e.startSN}\n${e.m3u8}\n\nPlaylist starting @${i.startSN}\n${i.m3u8}`)}function lb(t,e,i=!0){const r=e.startSN+e.skippedSegments-t.startSN,s=t.fragments,a=r>=0;let n=0;if(a&&r<s.length)n=s[r].start;else if(a&&e.startSN===t.endSN+1)n=t.fragmentEnd;else if(a&&i)n=t.fragmentStart+r*e.levelTargetDuration;else{if(e.skippedSegments||0!==e.fragmentStart)return;n=t.fragmentStart}cb(e,n)}function cb(t,e){if(e){const i=t.fragments;for(let r=t.skippedSegments;r<i.length;r++)i[r].addStart(e);t.fragmentHint&&t.fragmentHint.addStart(e)}}function db(t,e=1/0){let i=1e3*t.targetduration;if(t.updated){const r=t.fragments,s=4;if(r.length&&i*s>e){const t=1e3*r[r.length-1].duration;t<i&&(i=t)}}else i/=2;return Math.round(i)}function hb(t,e,i){if(!t)return null;let r=t.fragments[e-t.startSN];return r||(r=t.fragmentHint,r&&r.sn===e?r:e<t.startSN&&i&&i.sn===e?i:null)}function pb(t,e,i){return t?ub(t.partList,e,i):null}function ub(t,e,i){if(t)for(let r=t.length;r--;){const s=t[r];if(s.index===i&&s.fragment.sn===e)return s}return null}function gb(t){t.forEach((t,e)=>{var i;null==(i=t.details)||i.fragments.forEach(t=>{t.level=e,t.initSegment&&(t.initSegment.level=e)})})}function fb(t,e){for(let r=0,s=t.length;r<s;r++){var i;if((null==(i=t[r])?void 0:i.cc)===e)return t[r]}return null}function mb(t,e){if(t){const i=t.start+e;t.start=t.startPTS=i,t.endPTS=i+t.duration}}function vb(t,e){const i=e.fragments;for(let e=0,r=i.length;e<r;e++)mb(i[e],t);e.fragmentHint&&mb(e.fragmentHint,t),e.alignedSliding=!0}function bb(t,e){if(!function(t,e){return!!(t&&e.startCC<t.endCC&&e.endCC>t.startCC)}(e,t))return;const i=Math.min(e.endCC,t.endCC),r=fb(e.fragments,i),s=fb(t.fragments,i);if(!r||!s)return;zg.log(`Aligning playlist at start of dicontinuity sequence ${i}`);vb(r.start-s.start,t)}function kb(t,e){if(!t.hasProgramDateTime||!e.hasProgramDateTime)return;const i=t.fragments,r=e.fragments;if(!i.length||!r.length)return;let s,a;const n=Math.min(e.endCC,t.endCC);e.startCC<n&&t.startCC<n&&(s=fb(r,n),a=fb(i,n)),s&&a||(s=r[Math.floor(r.length/2)],a=fb(i,s.cc)||i[Math.floor(i.length/2)]);const o=s.programDateTime,l=a.programDateTime;if(!o||!l)return;vb((l-o)/1e3-(a.start-s.start),t)}const yb=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},wb="STOPPED",xb="IDLE",Sb="KEY_LOADING",Eb="FRAG_LOADING",Pb="FRAG_LOADING_WAITING_RETRY",Tb="WAITING_TRACK",Lb="PARSING",Cb="PARSED",_b="ENDED",Ab="ERROR",Rb="WAITING_INIT_PTS",Ib="WAITING_LEVEL";class Db extends ev{constructor(t,e,i,r,s){super(r,t.logger),this.hls=void 0,this.fragPrevious=null,this.fragCurrent=null,this.fragmentTracker=void 0,this.transmuxer=null,this._state=wb,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.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.loadingParts=!1,this.loopSn=void 0,this.onMediaSeeking=()=>{const{config:t,fragCurrent:e,media:i,mediaBuffer:r,state:s}=this,a=i?i.currentTime:0,n=sv.bufferInfo(r||i,a,t.maxBufferHole),o=!n.len;if(this.log(`Media seeking to ${mg(a)?a.toFixed(3):a}, state: ${s}, ${o?"out of":"in"} buffer`),this.state===_b)this.resetLoadingState();else if(e){const i=t.maxFragLookUpTolerance,r=e.start-i,s=e.start+e.duration+i;if(o||s<n.start||r>n.end){const t=a>s;(a<r||t)&&(t&&e.loader&&(this.log(`Cancelling fragment load for seek (sn: ${e.sn})`),e.abortRequests(),this.resetLoadingState()),this.fragPrevious=null)}}if(i){this.fragmentTracker.removeFragmentsInRange(a,1/0,this.playlistType,!0);if(a>this.lastCurrentTime&&(this.lastCurrentTime=a),!this.loadingParts){const t=Math.max(n.end,a),e=this.shouldLoadParts(this.getLevelDetails(),t);e&&(this.log(`LL-Part loading ON after seeking to ${a.toFixed(2)} with buffer @${t.toFixed(2)}`),this.loadingParts=e)}}this.hls.hasEnoughToStart||(this.log(`Setting ${o?"startPosition":"nextLoadPosition"} to ${a} for seek without enough to start`),this.nextLoadPosition=a,o&&(this.startPosition=a)),this.tickImmediate()},this.onMediaEnded=()=>{this.log("setting startPosition to 0 because media ended"),this.startPosition=this.lastCurrentTime=0},this.playlistType=s,this.hls=t,this.fragmentLoader=new Qm(t.config),this.keyLoader=i,this.fragmentTracker=e,this.config=t.config,this.decrypter=new Wm(t.config)}registerListeners(){const{hls:t}=this;t.on(wg.MEDIA_ATTACHED,this.onMediaAttached,this),t.on(wg.MEDIA_DETACHING,this.onMediaDetaching,this),t.on(wg.MANIFEST_LOADING,this.onManifestLoading,this),t.on(wg.MANIFEST_LOADED,this.onManifestLoaded,this),t.on(wg.ERROR,this.onError,this)}unregisterListeners(){const{hls:t}=this;t.off(wg.MEDIA_ATTACHED,this.onMediaAttached,this),t.off(wg.MEDIA_DETACHING,this.onMediaDetaching,this),t.off(wg.MANIFEST_LOADING,this.onManifestLoading,this),t.off(wg.MANIFEST_LOADED,this.onManifestLoaded,this),t.off(wg.ERROR,this.onError,this)}doTick(){this.onTickEnd()}onTickEnd(){}startLoad(t){}stopLoad(){if(this.state===wb)return;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=wb}get startPositionValue(){const{nextLoadPosition:t,startPosition:e}=this;return-1===e&&t?t:e}get bufferingEnabled(){return this.buffering}pauseBuffering(){this.buffering=!1}resumeBuffering(){this.buffering=!0}get inFlightFrag(){return{frag:this.fragCurrent,state:this.state}}_streamEnded(t,e){if(e.live||!this.media)return!1;const i=t.end||0,r=this.config.timelineOffset||0;if(i<=r)return!1;const s=t.buffered;this.config.maxBufferHole&&s&&s.length>1&&(t=sv.bufferedInfo(s,t.start,0));const a=t.nextStart;if(a&&a>r&&a<e.edge)return!1;if(this.media.currentTime<t.start)return!1;const n=e.partList;if(null!=n&&n.length){const t=n[n.length-1];return sv.isBuffered(this.media,t.start+t.duration/2)}const o=e.fragments[e.fragments.length-1].type;return this.fragmentTracker.isEndListAppended(o)}getLevelDetails(){var t;if(this.levels&&null!==this.levelLastLoaded)return null==(t=this.levelLastLoaded)?void 0:t.details}get timelineOffset(){const t=this.config.timelineOffset;var e;return t?(null==(e=this.getLevelDetails())?void 0:e.appliedTimelineOffset)||t:0}onMediaAttached(t,e){const i=this.media=this.mediaBuffer=e.media;i.removeEventListener("seeking",this.onMediaSeeking),i.removeEventListener("ended",this.onMediaEnded),i.addEventListener("seeking",this.onMediaSeeking),i.addEventListener("ended",this.onMediaEnded);const r=this.config;this.levels&&r.autoStartLoad&&this.state===wb&&this.startLoad(r.startPosition)}onMediaDetaching(t,e){const i=!!e.transferMedia,r=this.media;if(null!==r){if(r.ended&&(this.log("MSE detaching and video ended, reset startPosition"),this.startPosition=this.lastCurrentTime=0),r.removeEventListener("seeking",this.onMediaSeeking),r.removeEventListener("ended",this.onMediaEnded),this.keyLoader&&!i&&this.keyLoader.detach(),this.media=this.mediaBuffer=null,this.loopSn=void 0,i)return this.resetLoadingState(),void this.resetTransmuxer();this.loadingParts=!1,this.fragmentTracker.removeAllFragments(),this.stopLoad()}}onManifestLoading(){this.initPTS=[],this.levels=this.levelLastLoaded=this.fragCurrent=null,this.lastCurrentTime=this.startPosition=0,this.startFragRequested=!1}onError(t,e){}onManifestLoaded(t,e){this.startTimeOffset=e.startTimeOffset}onHandlerDestroying(){this.stopLoad(),this.transmuxer&&(this.transmuxer.destroy(),this.transmuxer=null),super.onHandlerDestroying(),this.hls=this.onMediaSeeking=this.onMediaEnded=null}onHandlerDestroyed(){this.state=wb,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.startFragRequested=!0,this._loadFragForPlayback(t,e,i)}_loadFragForPlayback(t,e,i){this._doFragLoad(t,e,i,t=>{const e=t.frag;if(this.fragContextChanged(e))return this.warn(`${e.type} sn: ${e.sn}${t.part?" part: "+t.part.index:""} of ${this.fragInfo(e,!1,t.part)}) was dropped during download.`),void this.fragmentTracker.removeFragment(e);e.stats.chunkCount++,this._handleFragmentLoadProgress(t)}).then(t=>{if(!t)return;const e=this.state,i=t.frag;this.fragContextChanged(i)?(e===Eb||!this.fragCurrent&&e===Lb)&&(this.fragmentTracker.removeFragment(i),this.state=xb):("payload"in t&&(this.log(`Loaded ${i.type} sn: ${i.sn} of ${this.playlistLabel()} ${i.level}`),this.hls.trigger(wg.FRAG_LOADED,t)),this._handleFragmentLoadComplete(t))}).catch(e=>{this.state!==wb&&this.state!==Ab&&(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)===$m){const e=t.type,r=this.getFwdBufferInfo(this.mediaBuffer,e),s=Math.max(t.duration,r?r.len:this.config.maxBufferLength),a=this.backtrackFragment;(1===(a?t.sn-a.sn:0)||this.reduceMaxBufferLength(s,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)===Fm&&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)}waitForLive(t){const e=t.details;return(null==e?void 0:e.live)&&"EVENT"!==e.type&&(this.levelLastLoaded!==t||e.expired)}flushMainBuffer(t,e,i=null){if(!(t-e))return;const r={startOffset:t,endOffset:e,type:i};this.hls.trigger(wg.BUFFER_FLUSHING,r)}_loadInitSegment(t,e){this._doFragLoad(t,e).then(t=>{const e=null==t?void 0:t.frag;if(!e||this.fragContextChanged(e)||!this.levels)throw new Error("init load aborted");return t}).then(t=>{const{hls:e}=this,{frag:i,payload:r}=t,s=i.decryptdata;if(r&&r.byteLength>0&&null!=s&&s.key&&s.iv&&vv(s.method)){const a=self.performance.now();return this.decrypter.decrypt(new Uint8Array(r),s.key.buffer,s.iv.buffer,bv(s.method)).catch(t=>{throw e.trigger(wg.ERROR,{type:kg.MEDIA_ERROR,details:yg.FRAG_DECRYPT_ERROR,fatal:!1,error:t,reason:t.message,frag:i}),t}).then(r=>{const s=self.performance.now();return e.trigger(wg.FRAG_DECRYPTED,{frag:i,payload:r,stats:{tstart:a,tdecrypt:s}}),t.payload=r,this.completeInitSegmentLoad(t)})}return this.completeInitSegmentLoad(t)}).catch(e=>{this.state!==wb&&this.state!==Ab&&(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!==wb&&(this.state=xb),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){const i=this.mediaBuffer?this.mediaBuffer:this.media;if(this.log(`Buffered ${t.type} sn: ${t.sn}${e?" part: "+e.index:""} of ${this.fragInfo(t,!1,e)} > buffer:${i?yb(sv.getBuffered(i)):"(detached)"})`),ef(t)){var r;if(t.type!==Cg){const e=t.elementaryStreams;if(!Object.keys(e).some(t=>!!e[t]))return void(this.state=xb)}const e=null==(r=this.levels)?void 0:r[t.level];null!=e&&e.fragmentError&&(this.log(`Resetting level fragment error count of ${e.fragmentError} on frag buffered`),e.fragmentError=0)}this.state=xb}_handleFragmentLoadComplete(t){const{transmuxer:e}=this;if(!e)return;const{frag:i,part:r,partsLoaded:s}=t,a=!s||0===s.length||s.some(t=>!t),n=new iv(i.level,i.sn,i.stats.chunkCount+1,0,r?r.index:-1,!a);e.flush(n)}_handleFragmentLoadProgress(t){}_doFragLoad(t,e,i=null,r){var s;this.fragCurrent=t;const a=null==e?void 0:e.details;if(!this.levels||!a)throw new Error(`frag load aborted, missing level${a?"":" detail"}s`);let n=null;!t.encrypted||null!=(s=t.decryptdata)&&s.key?t.encrypted||(n=this.keyLoader.loadClear(t,a.encryptedFragments),n&&this.log("[eme] blocking frag load until media-keys acquired")):(this.log(`Loading key for ${t.sn} of [${a.startSN}-${a.endSN}], ${this.playlistLabel()} ${t.level}`),this.state=Sb,this.fragCurrent=t,n=this.keyLoader.load(t).then(t=>{if(!this.fragContextChanged(t.frag))return this.hls.trigger(wg.KEY_LOADED,t),this.state===Sb&&(this.state=xb),t}),this.hls.trigger(wg.KEY_LOADING,{frag:t}),null===this.fragCurrent&&(n=Promise.reject(new Error("frag load aborted, context changed in KEY_LOADING"))));const o=this.fragPrevious;if(ef(t)&&(!o||t.sn!==o.sn)){const i=this.shouldLoadParts(e.details,t.end);i!==this.loadingParts&&(this.log(`LL-Part loading ${i?"ON":"OFF"} loading sn ${null==o?void 0:o.sn}->${t.sn}`),this.loadingParts=i)}if(i=Math.max(t.start,i||0),this.loadingParts&&ef(t)){const s=a.partList;if(s&&r){i>t.end&&a.fragmentHint&&(t=a.fragmentHint);const o=this.getNextPart(s,t,i);if(o>-1){const l=s[o];let c;return t=this.fragCurrent=l.fragment,this.log(`Loading ${t.type} sn: ${t.sn} part: ${l.index} (${o}/${s.length-1}) of ${this.fragInfo(t,!1,l)}) cc: ${t.cc} [${a.startSN}-${a.endSN}], target: ${parseFloat(i.toFixed(3))}`),this.nextLoadPosition=l.start+l.duration,this.state=Eb,c=n?n.then(i=>!i||this.fragContextChanged(i.frag)?null:this.doFragPartsLoad(t,l,e,r)).catch(t=>this.handleFragLoadError(t)):this.doFragPartsLoad(t,l,e,r).catch(t=>this.handleFragLoadError(t)),this.hls.trigger(wg.FRAG_LOADING,{frag:t,part:l,targetBufferTime:i}),null===this.fragCurrent?Promise.reject(new Error("frag load aborted, context changed in FRAG_LOADING parts")):c}if(!t.url||this.loadedEndOfParts(s,i))return Promise.resolve(null)}}if(ef(t)&&this.loadingParts)this.log(`LL-Part loading OFF after next part miss @${i.toFixed(2)}`),this.loadingParts=!1;else if(!t.url)return Promise.resolve(null);this.log(`Loading ${t.type} sn: ${t.sn} of ${this.fragInfo(t,!1)}) cc: ${t.cc} ${a?"["+a.startSN+"-"+a.endSN+"]":""}, target: ${parseFloat(i.toFixed(3))}`),mg(t.sn)&&!this.bitrateTest&&(this.nextLoadPosition=t.start+t.duration),this.state=Eb;const l=this.config.progressive;let c;return c=l&&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,l?r:void 0),n]).then(([t])=>(!l&&t&&r&&r(t),t)).catch(t=>this.handleFragLoadError(t)),this.hls.trigger(wg.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((s,a)=>{var n;const o=[],l=null==(n=i.details)?void 0:n.partList,c=e=>{this.fragmentLoader.loadPart(t,e,r).then(r=>{o[e.index]=r;const a=r.part;this.hls.trigger(wg.FRAG_LOADED,r);const n=pb(i.details,t.sn,e.index+1)||ub(l,t.sn,e.index+1);if(!n)return s({frag:t,part:a,partsLoaded:o});c(n)}).catch(a)};c(e)})}handleFragLoadError(t){if("data"in t){const e=t.data;t.data&&e.details===yg.INTERNAL_ABORTED?this.handleFragLoadAborted(e.frag,e.part):this.hls.trigger(wg.ERROR,e)}else this.hls.trigger(wg.ERROR,{type:kg.OTHER_ERROR,details:yg.INTERNAL_EXCEPTION,err:t,error:t,fatal:!0});return null}_handleTransmuxerFlush(t){const e=this.getCurrentContext(t);if(!e||this.state!==Lb)return void(this.fragCurrent||this.state===wb||this.state===Ab||(this.state=xb));const{frag:i,part:r,level:s}=e,a=self.performance.now();i.stats.parsing.end=a,r&&(r.stats.parsing.end=a);const n=this.getLevelDetails(),o=n&&i.sn>n.endSN||this.shouldLoadParts(n,i.end);o!==this.loadingParts&&(this.log(`LL-Part loading ${o?"ON":"OFF"} after parsing segment ending @${i.end.toFixed(2)}`),this.loadingParts=o),this.updateLevelTiming(i,r,s,t.partial)}shouldLoadParts(t,e){if(this.config.lowLatencyMode){if(!t)return this.loadingParts;if(null!=t&&t.partList){var i;const s=t.partList[0];if(e>=s.end+((null==(i=t.fragmentHint)?void 0:i.duration)||0)){var r;if((this.hls.hasEnoughToStart?(null==(r=this.media)?void 0:r.currentTime)||this.lastCurrentTime:this.getLoadPosition())>s.start-s.fragment.duration)return!0}}}return!1}getCurrentContext(t){const{levels:e,fragCurrent:i}=this,{level:r,sn:s,part:a}=t;if(null==e||!e[r])return this.warn(`Levels object was unset while buffering fragment ${s} of ${this.playlistLabel()} ${r}. The current chunk will not be buffered.`),null;const n=e[r],o=n.details,l=a>-1?pb(o,s,a):null,c=l?l.fragment:hb(o,s,i);return c?(i&&i!==c&&(c.stats=i.stats),{frag:c,part:l,level:n}):null}bufferFragmentData(t,e,i,r,s){var a;if(!t||this.state!==Lb)return;const{data1:n,data2:o}=t;let l=n;if(n&&o&&(l=Sf(n,o)),null==(a=l)||!a.length)return;const c=this.initPTS[e.cc],d=c?-c.baseTime/c.timescale:void 0,h={type:t.type,frag:e,part:i,chunkMeta:r,offset:d,parent:e.type,data:l};if(this.hls.trigger(wg.BUFFER_APPENDING,h),t.dropped&&t.independent&&!i){if(s)return;this.flushBufferGap(e)}}flushBufferGap(t){const e=this.media;if(!e)return;if(!sv.isBuffered(e,e.currentTime))return void this.flushMainBuffer(0,t.start);const i=e.currentTime,r=sv.bufferInfo(e,i,0),s=t.duration,a=Math.min(2*this.config.maxFragLookUpTolerance,.25*s),n=Math.max(Math.min(t.start-a,r.end-a),i+a);t.start-n>a&&this.flushMainBuffer(n,t.start)}getFwdBufferInfo(t,e){var i;const r=this.getLoadPosition();if(!mg(r))return null;const s=this.lastCurrentTime>r||null!=(i=this.media)&&i.paused?0:this.config.maxBufferHole;return this.getFwdBufferInfoAtPos(t,r,e,s)}getFwdBufferInfoAtPos(t,e,i,r){const s=sv.bufferInfo(t,e,r);if(0===s.len&&void 0!==s.nextStart){const a=this.fragmentTracker.getBufferedFrag(e,i);if(a&&(s.nextStart<=a.end||a.gap)){const i=Math.max(Math.min(s.nextStart,a.end)-e,r);return sv.bufferInfo(t,e,i)}}return s}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),s=Math.max(t-3*e,i.maxMaxBufferLength/2,r);return s>=r&&(i.maxMaxBufferLength=s,this.warn(`Reduce max buffer length to ${s}s`),!0)}getAppendedFrag(t,e=Tg){var i;const r=null==(i=this.fragmentTracker)?void 0:i.getAppendedFrag(t,e);return r&&"fragment"in r?r.fragment:r}getNextFragment(t,e){const i=e.fragments,r=i.length;if(!r)return null;const{config:s}=this,a=i[0].start,n=s.lowLatencyMode&&!!e.partList;let o=null;if(e.live){const i=s.initialLiveManifestSize;if(r<i)return this.warn(`Not enough fragments to start playback (have: ${r}, need: ${i})`),null;if(!e.PTSKnown&&!this.startFragRequested&&-1===this.startPosition||t<a){var l;n&&!this.loadingParts&&(this.log("LL-Part loading ON for initial live fragment"),this.loadingParts=!0),o=this.getInitialLiveFragment(e);const i=this.hls.startPosition,r=this.hls.liveSyncPosition,s=o?(-1!==i&&i>=a?i:r)||o.start:t;this.log(`Setting startPosition to ${s} to match start frag at live edge. mainStart: ${i} liveSyncPosition: ${r} frag.start: ${null==(l=o)?void 0:l.start}`),this.startPosition=this.nextLoadPosition=s}}else t<=a&&(o=i[0]);if(!o){const i=this.loadingParts?e.partEnd:e.fragmentEnd;o=this.getFragmentAtPosition(t,i,e)}let c=this.filterReplacedPrimary(o,e);if(!c&&o){const t=o.sn-e.startSN;c=this.filterReplacedPrimary(i[t+1]||null,e)}return this.mapToInitFragWhenRequired(c)}isLoopLoading(t,e){const i=this.fragmentTracker.getState(t);return(i===Nm||i===Fm&&!!t.gap)&&this.nextLoadPosition>e}getNextFragmentLoopLoading(t,e,i,r,s){let a=null;if(t.gap&&(a=this.getNextFragment(this.nextLoadPosition,e),a&&!a.gap&&i.nextStart)){const t=this.getFwdBufferInfoAtPos(this.mediaBuffer?this.mediaBuffer:this.media,i.nextStart,r,0);if(null!==t&&i.len+t.len>=s){const t=a.sn;return this.loopSn!==t&&(this.log(`buffer full after gaps in "${r}" playlist starting at sn: ${t}`),this.loopSn=t),null}}return this.loopSn=void 0,a}get primaryPrefetch(){if(Mb(this.hls.config)){var t,e;if(null==(t=this.hls.interstitialsManager)||null==(e=t.playingItem)?void 0:e.event)return!0}return!1}filterReplacedPrimary(t,e){if(!t)return t;if(Mb(this.hls.config)&&t.type!==Cg){const i=this.hls.interstitialsManager,r=null==i?void 0:i.bufferingItem;if(r){const i=r.event;if(i){if(i.appendInPlace||Math.abs(t.start-r.start)>1||0===r.start)return null}else{if(t.end<=r.start&&!1===(null==e?void 0:e.live))return null;if(t.start>r.end&&r.nextEvent&&(r.nextEvent.appendInPlace||t.start-r.end>1))return null}}const s=null==i?void 0:i.playerQueue;if(s)for(let e=s.length;e--;){const i=s[e].interstitial;if(i.appendInPlace&&t.start>=i.startTime&&t.end<=i.resumeTime)return 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,s=!1,a=!0;for(let n=0,o=t.length;n<o;n++){const o=t[n];if(a=a&&!o.independent,r>-1&&i<o.start)break;const l=o.loaded;l?r=-1:(s||o.independent||a)&&o.fragment===e&&(r=n),s=l}return r}loadedEndOfParts(t,e){const i=t[t.length-1];return i&&e>i.start&&i.loaded}getInitialLiveFragment(t){const e=t.fragments,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||!mg(e))return null;if(e<(t[0].programDateTime||0))return null;if(e>=(t[t.length-1].endProgramDateTime||0))return null;for(let r=0;r<t.length;++r){const s=t[r];if(wm(e,i,s))return s}return null}(e,i.endProgramDateTime,this.config.maxFragLookUpTolerance)),!r){const s=i.sn+1;if(s>=t.startSN&&s<=t.endSN){const a=e[s-t.startSN];i.cc===a.cc&&(r=a,this.log(`Live playlist, switching playlist, load frag with next SN: ${r.sn}`))}r||(r=xm(t,i.cc,i.end),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:s}=this,{fragments:a,endSN:n}=i;const{fragmentHint:o}=i,{maxFragLookUpTolerance:l}=r,c=i.partList,d=!!(this.loadingParts&&null!=c&&c.length&&o);let h;if(d&&o&&!this.bitrateTest&&c[c.length-1].fragment.sn===o.sn&&(a=a.concat(o),n=o.sn),t<e){var p;h=km(s,a,t,t<this.lastCurrentTime||t>e-l||null!=(p=this.media)&&p.paused||!this.startFragRequested?0:l)}else h=a[a.length-1];if(h){const t=h.sn-i.startSN,e=this.fragmentTracker.getState(h);if((e===Nm||e===Fm&&h.gap)&&(s=h),s&&h.sn===s.sn&&(!d||c[0].fragment.sn>h.sn||!i.live&&!d)){if(s&&h.level===s.level){const e=a[t+1];h=h.sn<n&&this.fragmentTracker.getState(e)!==Nm?e:null}}}return h}alignPlaylists(t,e,i){const r=t.fragments.length;if(!r)return this.warn("No fragments in live playlist"),0;const s=t.fragmentStart,a=!e,n=t.alignedSliding&&mg(s);if(a||!n&&!s){!function(t,e){t&&(bb(e,t),!e.alignedSliding&&t&&kb(e,t),e.alignedSliding||!t||e.skippedSegments||lb(t,e,!1))}(i,t);const s=t.fragmentStart;return this.log(`Live playlist sliding: ${s.toFixed(2)} start-sn: ${e?e.startSN:"na"}->${t.startSN} fragments: ${r}`),s}return s}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;i<e&&(i=-1);const r=this.timelineOffset;if(-1===i){const s=null!==this.startTimeOffset,a=s?this.startTimeOffset:t.startTimeOffset;null!==a&&mg(a)?(i=e+a,a<0&&(i+=t.edge),i=Math.min(Math.max(e,i),e+t.totalduration),this.log(`Setting startPosition to ${i} for start time offset ${a} found in ${s?"multivariant":"media"} playlist`),this.startPosition=i):t.live?(i=this.hls.liveSyncPosition||e,this.log(`Setting startPosition to -1 to start at live edge ${i}`),this.startPosition=-1):(this.log("setting startPosition to 0 by default"),this.startPosition=i=0),this.lastCurrentTime=i+r}this.nextLoadPosition=i+r}getLoadPosition(){var t;const{media:e}=this;let i=0;return null!=(t=this.hls)&&t.hasEnoughToStart&&e?i=e.currentTime:this.nextLoadPosition>=0&&(i=this.nextLoadPosition),i}handleFragLoadAborted(t,e){this.transmuxer&&t.type===this.playlistType&&ef(t)&&t.stats.aborted&&(this.log(`Fragment ${t.sn}${e?" part "+e.index:""} of ${this.playlistLabel()} ${t.level} was aborted`),this.resetFragmentLoading(t))}resetFragmentLoading(t){this.fragCurrent&&(this.fragContextChanged(t)||this.state===Pb)||(this.state=xb)}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 s=e.details===yg.FRAG_GAP;s&&this.fragmentTracker.fragBuffered(i,!0);const a=e.errorAction,{action:n,flags:o,retryCount:l=0,retryConfig:c}=a||{},d=!!a&&!!c,h=d&&n===Rm,p=d&&!a.resolved&&o===Dm;if(!h&&p&&ef(i)&&!i.endList)this.resetFragmentErrors(t),this.treatAsGap(i),a.resolved=!0;else if((h||p)&&l<c.maxNumRetry){this.resetStartWhenNotLoaded(this.levelLastLoaded);const r=Pm(c,l);this.warn(`Fragment ${i.sn} of ${t} ${i.level} errored with ${e.details}, retrying loading ${l+1}/${c.maxNumRetry} in ${r}ms`),a.resolved=!0,this.retryDate=self.performance.now()+r,this.state=Pb}else if(c&&a){if(this.resetFragmentErrors(t),!(l<c.maxNumRetry))return void this.warn(`${e.details} reached or exceeded max retry (${l})`);s||n===Am||(a.resolved=!0)}else this.state=n===_m?Ib:Ab;this.tickImmediate()}reduceLengthAndFlushBuffer(t){if(this.state===Lb||this.state===Cb){const e=t.frag,i=t.parent,r=this.getFwdBufferInfo(this.mediaBuffer,i),s=r&&r.len>.5;s&&this.reduceMaxBufferLength(r.len,(null==e?void 0:e.duration)||10);const a=!s;return a&&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(),a}return!1}resetFragmentErrors(t){t===Lg&&(this.fragCurrent=null),this.hls.hasEnoughToStart||(this.startFragRequested=!1),this.state!==wb&&(this.state=xb)}afterBufferFlushed(t,e,i){if(!t)return;const r=sv.getBuffered(t);this.fragmentTracker.detectEvictedFragments(e,r,i),this.state===_b&&this.resetLoadingState()}resetLoadingState(){this.log("Reset loading state"),this.fragCurrent=null,this.fragPrevious=null,this.state!==wb&&(this.state=xb)}resetStartWhenNotLoaded(t){if(!this.hls.hasEnoughToStart){this.startFragRequested=!1;const e=t?t.details:null;null!=e&&e.live?(this.log("resetting startPosition for live start"),this.startPosition=-1,this.setStartPosition(e,e.fragmentStart),this.resetLoadingState()):this.nextLoadPosition=this.startPosition}}resetWhenMissingContext(t){this.warn(`The loading context changed while buffering fragment ${t.sn} of ${this.playlistLabel()} ${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){const s=i.details;if(!s)return void this.warn("level.details undefined");var a;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 l=r?0:ab(s,t,n.startPTS,n.endPTS,n.startDTS,n.endDTS);return this.hls.trigger(wg.LEVEL_PTS_UPDATED,{details:s,level:i,drift:l,type:a,frag:t,start:n.startPTS,end:n.endPTS}),!0}return e},!1)&&(0===i.fragmentError&&this.treatAsGap(t,i),null===(null==(a=this.transmuxer)?void 0:a.error))){const e=new Error(`Found no media in fragment ${t.sn} of ${this.playlistLabel()} ${t.level} resetting transmuxer to fallback to playlist timing`);if(this.warn(e.message),this.hls.trigger(wg.ERROR,{type:kg.MEDIA_ERROR,details:yg.FRAG_PARSING_ERROR,fatal:!1,error:e,frag:t,reason:`Found no media in msn ${t.sn} of ${this.playlistLabel()} "${i.url}"`}),!this.hls)return;this.resetTransmuxer()}this.state=Cb,this.log(`Parsed ${t.type} sn: ${t.sn}${e?" part: "+e.index:""} of ${this.fragInfo(t,!1,e)})`),this.hls.trigger(wg.FRAG_PARSED,{frag:t,part:e})}playlistLabel(){return this.playlistType===Tg?"level":"track"}fragInfo(t,e=!0,i){var r,s;return`${this.playlistLabel()} ${t.level} (${i?"part":"frag"}:[${(null!=(r=e&&!i?t.startPTS:(i||t).start)?r:NaN).toFixed(3)}-${(null!=(s=e&&!i?t.endPTS:(i||t).end)?s:NaN).toFixed(3)}]${i&&"main"===t.type?"INDEPENDENT="+(i.independent?"YES":"NO"):""}`}treatAsGap(t,e){e&&e.fragmentError++,t.gap=!0,this.fragmentTracker.removeFragment(t),this.fragmentTracker.fragBuffered(t,!0)}resetTransmuxer(){var t;null==(t=this.transmuxer)||t.reset()}recoverWorkerError(t){"demuxerWorker"===t.event&&(this.fragmentTracker.removeAllFragments(),this.transmuxer&&(this.transmuxer.destroy(),this.transmuxer=null),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}}function Mb(t){return!!t.interstitialsController&&!1!==t.enableInterstitialPlayback}class Ob{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 s=t[e];i.set(s,r),r+=s.length}return i}(t,e),this.reset(),i):new Uint8Array(0)}reset(){this.chunks.length=0,this.dataLength=0}}var Ub,$b={exports:{}};var Fb=(Ub||(Ub=1,function(t){var e=Object.prototype.hasOwnProperty,i="~";function r(){}function s(t,e,i){this.fn=t,this.context=e,this.once=i||!1}function a(t,e,r,a,n){if("function"!=typeof r)throw new TypeError("The listener must be a function");var o=new s(r,a||t,n),l=i?i+e:e;return t._events[l]?t._events[l].fn?t._events[l]=[t._events[l],o]:t._events[l].push(o):(t._events[l]=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,s=[];if(0===this._eventsCount)return s;for(r in t=this._events)e.call(t,r)&&s.push(i?r.slice(1):r);return Object.getOwnPropertySymbols?s.concat(Object.getOwnPropertySymbols(t)):s},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 s=0,a=r.length,n=new Array(a);s<a;s++)n[s]=r[s].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,s,a,n){var o=i?i+t:t;if(!this._events[o])return!1;var l,c,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,s),!0;case 5:return d.fn.call(d.context,e,r,s,a),!0;case 6:return d.fn.call(d.context,e,r,s,a,n),!0}for(c=1,l=new Array(h-1);c<h;c++)l[c-1]=arguments[c];d.fn.apply(d.context,l)}else{var p,u=d.length;for(c=0;c<u;c++)switch(d[c].once&&this.removeListener(t,d[c].fn,void 0,!0),h){case 1:d[c].fn.call(d[c].context);break;case 2:d[c].fn.call(d[c].context,e);break;case 3:d[c].fn.call(d[c].context,e,r);break;case 4:d[c].fn.call(d[c].context,e,r,s);break;default:if(!l)for(p=1,l=new Array(h-1);p<h;p++)l[p-1]=arguments[p];d[c].fn.apply(d[c].context,l)}}return!0},o.prototype.on=function(t,e,i){return a(this,t,e,i,!1)},o.prototype.once=function(t,e,i){return a(this,t,e,i,!0)},o.prototype.removeListener=function(t,e,r,s){var a=i?i+t:t;if(!this._events[a])return this;if(!e)return n(this,a),this;var o=this._events[a];if(o.fn)o.fn!==e||s&&!o.once||r&&o.context!==r||n(this,a);else{for(var l=0,c=[],d=o.length;l<d;l++)(o[l].fn!==e||s&&!o[l].once||r&&o[l].context!==r)&&c.push(o[l]);c.length?this._events[a]=1===c.length?c[0]:c:n(this,a)}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}($b)),$b.exports),Nb=qg(Fb);const jb="1.6.6",zb={};function Bb(t,e){return 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}function Gb(t,e){return 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}function Hb(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}function Vb(t,e){const i=e;let r=0;for(;Gb(t,e);){r+=10;r+=Hb(t,e+6),Bb(t,e+10)&&(r+=10),e+=r}if(r>0)return t.subarray(i,i+r)}function qb(t,e){return 255===t[e]&&240==(246&t[e+1])}function Kb(t,e){return 1&t[e+1]?7:9}function Yb(t,e){return(3&t[e+3])<<11|t[e+4]<<3|(224&t[e+5])>>>5}function Wb(t,e){return e+1<t.length&&qb(t,e)}function Zb(t,e){if(Wb(t,e)){const i=Kb(t,e);if(e+i>=t.length)return!1;const r=Yb(t,e);if(r<=i)return!1;const s=e+r;return s===t.length||Wb(t,s)}return!1}function Qb(t,e,i,r,s){if(!t.samplerate){const a=function(t,e,i,r){const s=e[i+2],a=s>>2&15;if(a>12){const e=new Error(`invalid ADTS sampling index:${a}`);return void t.emit(wg.ERROR,wg.ERROR,{type:kg.MEDIA_ERROR,details:yg.FRAG_PARSING_ERROR,fatal:!0,error:e,reason:e.message})}const n=1+(s>>6&3),o=e[i+3]>>6&3|(1&s)<<2,l="mp4a.40."+n,c=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350][a];let d=a;5!==n&&29!==n||(d-=3);const h=[n<<3|(14&d)>>1,(1&d)<<7|o<<3];return zg.log(`manifest codec:${r}, parsed codec:${l}, channels:${o}, rate:${c} (ADTS object type:${n} sampling index:${a})`),{config:h,samplerate:c,channelCount:o,codec:l,parsedCodec:l,manifestCodec:r}}(e,i,r,s);if(!a)return;Ig(t,a)}}function Xb(t){return 9216e4/t}function Jb(t,e,i,r,s){const a=r+s*Xb(t.samplerate),n=function(t,e){const i=Kb(t,e);if(e+i<=t.length){const r=Yb(t,e)-i;if(r>0)return{headerLength:i,frameLength:r}}}(e,i);let o;if(n){const{frameLength:r,headerLength:s}=n,l=s+r,c=Math.max(0,i+l-e.length);c?(o=new Uint8Array(l-s),o.set(e.subarray(i+s,e.length),0)):o=e.subarray(i+s,i+l);const d={unit:o,pts:a};return c||t.samples.push(d),{sample:d,length:l,missing:c}}const l=e.length-i;o=new Uint8Array(l),o.set(e.subarray(i,e.length),0);return{sample:{unit:o,pts:a},length:l,missing:-1}}function tk(t,e){return Gb(t,e)&&Hb(t,e+6)+10<=t.length-e}function ek(t,e=0,i=1/0){return function(t,e,i,r){const s=function(t){return t instanceof ArrayBuffer?t:t.buffer}(t);let a=1;"BYTES_PER_ELEMENT"in r&&(a=r.BYTES_PER_ELEMENT);const n=(h=t,h&&h.buffer instanceof ArrayBuffer&&void 0!==h.byteLength&&void 0!==h.byteOffset?t.byteOffset:0),o=(n+t.byteLength)/a,l=(n+e)/a,c=Math.floor(Math.max(0,Math.min(l,o))),d=Math.floor(Math.min(c+Math.max(i,0),o));var h;return new r(s,c,d-c)}(t,e,i,Uint8Array)}function ik(t){const e={key:t.type,description:"",data:"",mimeType:null,pictureType:null};if(t.size<2)return;if(3!==t.data[0])return void console.log("Ignore frame with unrecognized character encoding");const i=t.data.subarray(1).indexOf(0);if(-1===i)return;const r=Hg(ek(t.data,1,i)),s=t.data[2+i],a=t.data.subarray(3+i).indexOf(0);if(-1===a)return;const n=Hg(ek(t.data,3+i,a));let o;return o="--\x3e"===r?Hg(ek(t.data,4+i+a)):function(t){return t instanceof ArrayBuffer?t:0==t.byteOffset&&t.byteLength==t.buffer.byteLength?t.buffer:new Uint8Array(t).buffer}(t.data.subarray(4+i+a)),e.mimeType=r,e.pictureType=s,e.description=n,e.data=o,e}function rk(t){return"PRIV"===t.type?function(t){if(t.size<2)return;const e=Hg(t.data,!0),i=new Uint8Array(t.data.subarray(e.length+1));return{key:t.type,info:e,data:i.buffer}}(t):"W"===t.type[0]?function(t){if("WXXX"===t.type){if(t.size<2)return;let e=1;const i=Hg(t.data.subarray(e),!0);e+=i.length+1;const r=Hg(t.data.subarray(e));return{key:t.type,info:i,data:r}}const e=Hg(t.data);return{key:t.type,info:"",data:e}}(t):"APIC"===t.type?ik(t):function(t){if(t.size<2)return;if("TXXX"===t.type){let e=1;const i=Hg(t.data.subarray(e),!0);e+=i.length+1;const r=Hg(t.data.subarray(e));return{key:t.type,info:i,data:r}}const e=Hg(t.data.subarray(1));return{key:t.type,info:"",data:e}}(t)}function sk(t){const e=String.fromCharCode(t[0],t[1],t[2],t[3]),i=Hb(t,4);return{type:e,size:i,data:t.subarray(10,10+i)}}function ak(t){let e=0;const i=[];for(;Gb(t,e);){const r=Hb(t,e+6);t[e+5]>>6&1&&(e+=10),e+=10;const s=e+r;for(;e+10<s;){const r=sk(t.subarray(e)),s=rk(r);s&&i.push(s),e+=r.size+10}Bb(t,e)&&(e+=10)}return i}function nk(t){return t&&"PRIV"===t.key&&"com.apple.streaming.transportStreamTimestamp"===t.info}function ok(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)}}function lk(t){const e=ak(t);for(let t=0;t<e.length;t++){const i=e[t];if(nk(i))return ok(i)}}let ck=function(t){return t.audioId3="org.id3",t.dateRange="com.apple.quicktime.HLS",t.emsg="https://aomedia.org/emsg/ID3",t.misbklv="urn:misb:KLV:bin:1910.1",t}({});function dk(t="",e=9e4){return{type:t,id:-1,pid:-1,inputTimeScale:e,sequenceNumber:-1,samples:[],dropped:0}}class hk{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=Sf(this.cachedData,t),this.cachedData=null);let i,r=Vb(t,0),s=r?r.length:0;const a=this._audioTrack,n=this._id3Track,o=r?lk(r):void 0,l=t.length;for((null===this.basePTS||0===this.frameIndex&&mg(o))&&(this.basePTS=pk(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:ck.audioId3,duration:Number.POSITIVE_INFINITY});s<l;){if(this.canParse(t,s)){const e=this.appendFrame(a,t,s);e?(this.frameIndex++,this.lastPTS=e.sample.pts,s+=e.length,i=s):s=l}else tk(t,s)?(r=Vb(t,s),n.samples.push({pts:this.lastPTS,dts:this.lastPTS,data:r,type:ck.audioId3,duration:Number.POSITIVE_INFINITY}),s+=r.length,i=s):s++;if(s===l&&i!==l){const e=t.slice(i);this.cachedData?this.cachedData=Sf(this.cachedData,e):this.cachedData=e}}return{audioTrack:a,videoTrack:dk(),id3Track:n,textTrack:dk()}}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:dk(),id3Track:this._id3Track,textTrack:dk()}}destroy(){this.cachedData=null,this._audioTrack=this._id3Track=void 0}}const pk=(t,e,i)=>{if(mg(t))return 90*t;return 9e4*e+(i?9e4*i.baseTime/i.timescale:0)};let uk=null;const gk=[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],fk=[44100,48e3,32e3,22050,24e3,16e3,11025,12e3,8e3],mk=[[0,72,144,12],[0,0,0,0],[0,72,144,12],[0,144,144,12]],vk=[0,1,1,4];function bk(t,e,i,r,s){if(i+24>e.length)return;const a=kk(e,i);if(a&&i+a.frameLength<=e.length){const n=r+s*(9e4*a.samplesPerFrame/a.sampleRate),o={unit:e.subarray(i,i+a.frameLength),pts:n,dts:n};return t.config=[],t.channelCount=a.channelCount,t.samplerate=a.sampleRate,t.samples.push(o),{sample:o,length:a.frameLength,missing:0}}}function kk(t,e){const i=t[e+1]>>3&3,r=t[e+1]>>1&3,s=t[e+2]>>4&15,a=t[e+2]>>2&3;if(1!==i&&0!==s&&15!==s&&3!==a){const n=t[e+2]>>1&1,o=t[e+3]>>6,l=1e3*gk[14*(3===i?3-r:3===r?3:4)+s-1],c=fk[3*(3===i?0:2===i?1:2)+a],d=3===o?1:2,h=mk[i][r],p=vk[r],u=8*h*p,g=Math.floor(h*l/c+n)*p;if(null===uk){const t=(navigator.userAgent||"").match(/Chrome\/(\d+)/i);uk=t?parseInt(t[1]):0}return!!uk&&uk<=87&&2===r&&l>=224e3&&0===o&&(t[e+3]=128|t[e+3]),{sampleRate:c,channelCount:d,frameLength:g,samplesPerFrame:u}}}function yk(t,e){return!(255!==t[e]||224&~t[e+1]||!(6&t[e+1]))}function wk(t,e){return e+1<t.length&&yk(t,e)}function xk(t,e){if(e+1<t.length&&yk(t,e)){const i=4,r=kk(t,e);let s=i;null!=r&&r.frameLength&&(s=r.frameLength);const a=e+s;return a===t.length||wk(t,a)}return!1}const Sk=(t,e)=>{let i=0,r=5;e+=r;const s=new Uint32Array(1),a=new Uint32Array(1),n=new Uint8Array(1);for(;r>0;){n[0]=t[e];const o=Math.min(r,8),l=8-o;a[0]=4278190080>>>24+l<<l,s[0]=(n[0]&a[0])>>l,i=i?i<<o|s[0]:s[0],e+=1,r-=o}return i};class Ek extends hk{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=Pk(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=Vb(t,0);if(!e)return!1;const i=e.length;return 11===t[i]&&119===t[i+1]&&void 0!==lk(e)&&Sk(t,i)<16}}function Pk(t,e,i,r,s){if(i+8>e.length)return-1;if(11!==e[i]||119!==e[i+1])return-1;const a=e[i+4]>>6;if(a>=3)return-1;const n=[48e3,44100,32e3][a],o=63&e[i+4],l=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+a];if(i+l>e.length)return-1;const c=e[i+6]>>5;let d=0;2===c?d+=2:(1&c&&1!==c&&(d+=2),4&c&&(d+=2));const h=(e[i+6]<<8|e[i+7])>>12-d&1,p=[2,1,2,3,3,4,4,5][c]+h,u=e[i+5]>>3,g=7&e[i+5],f=new Uint8Array([a<<6|u<<1|g>>2,(3&g)<<6|c<<3|h<<2|o>>4,o<<4&224]),m=r+s*(1536/n*9e4),v=e.subarray(i,i+l);return t.config=f,t.channelCount=p,t.samplerate=n,t.samples.push({unit:v,pts:m}),l}const Tk=/\/emsg[-/]ID3/i;function Lk(t,e){return mg(t.presentationTime)?t.presentationTime/t.timeScale:e+t.presentationTimeDelta/t.timeScale}class Ck{constructor(t,e,i){this.keyData=void 0,this.decrypter=void 0,this.keyData=i,this.decrypter=new Wm(e,{removePKCS7Padding:!1})}decryptBuffer(t){return this.decrypter.decrypt(t,this.keyData.key.buffer,this.keyData.iv.buffer,Hm)}decryptAacSample(t,e,i){const r=t[e].unit;if(r.length<=16)return;const s=r.subarray(16,r.length-r.length%16),a=s.buffer.slice(s.byteOffset,s.byteOffset+s.length);this.decryptBuffer(a).then(s=>{const a=new Uint8Array(s);r.set(a,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,s){const a=Cf(s.data),n=this.getAvcEncryptedData(a);this.decryptBuffer(n.buffer).then(n=>{s.data=this.getAvcDecryptedUnit(a,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 s=t[e].units;for(;!(i>=s.length);i++){const a=s[i];if(!(a.data.length<=48||1!==a.type&&5!==a.type||(this.decryptAvcSample(t,e,i,r,a),this.decrypter.isSync())))return}}}}class _k{constructor(){this.VideoSample=null}createVideoSample(t,e,i){return{key:t,frame:!1,pts:e,dts:i,units:[],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)}}parseNALu(t,e,i){const r=e.byteLength;let s=t.naluState||0;const a=s,n=[];let o,l,c,d=0,h=-1,p=0;for(-1===s&&(h=0,p=this.getNALuType(e,0),s=0,d=1);d<r;)if(o=e[d++],s)if(1!==s)if(o)if(1===o){if(l=d-s-1,h>=0){const t={data:e.subarray(h,l),type:p};n.push(t)}else{const i=this.getLastNalUnit(t.samples);i&&(a&&d<=4-a&&i.state&&(i.data=i.data.subarray(0,i.data.byteLength-a)),l>0&&(i.data=Sf(i.data,e.subarray(0,l)),i.state=0))}d<r?(c=this.getNALuType(e,d),h=d,p=c,s=0):s=-1}else s=0;else s=3;else s=o?0:2;else s=o?0:1;if(h>=0&&s>=0){const t={data:e.subarray(h,r),type:p,state:s};n.push(t)}if(0===n.length){const i=this.getLastNalUnit(t.samples);i&&(i.data=Sf(i.data,e))}return t.naluState=s,n}}class Ak{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),s=Math.min(4,e);if(0===s)throw new Error("no bytes available");r.set(t.subarray(i,i+s)),this.word=new DataView(r.buffer).getUint32(0),this.bitsAvailable=8*s,this.bytesAvailable-=s}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&&zg.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)}}class Rk extends _k{parsePES(t,e,i,r){const s=this.parseNALu(t,i.data,r);let a,n=this.VideoSample,o=!1;i.data=null,n&&s.length&&!t.audFound&&(this.pushAccessUnit(n,t),n=this.VideoSample=this.createVideoSample(!1,i.pts,i.dts)),s.forEach(r=>{var s,l;switch(r.type){case 1:{let e=!1;a=!0;const s=r.data;if(o&&s.length>4){const t=this.readSliceType(s);2!==t&&4!==t&&7!==t&&9!==t||(e=!0)}var c;if(e)null!=(c=n)&&c.frame&&!n.key&&(this.pushAccessUnit(n,t),n=this.VideoSample=null);n||(n=this.VideoSample=this.createVideoSample(!0,i.pts,i.dts)),n.frame=!0,n.key=e;break}case 5:a=!0,null!=(s=n)&&s.frame&&!n.key&&(this.pushAccessUnit(n,t),n=this.VideoSample=null),n||(n=this.VideoSample=this.createVideoSample(!0,i.pts,i.dts)),n.key=!0,n.frame=!0;break;case 6:a=!0,Lf(r.data,1,i.pts,e.samples);break;case 7:{var d,h;a=!0,o=!0;const e=r.data,i=this.readSPS(e);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];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:a=!0,t.pps=[r.data];break;case 9:a=!0,t.audFound=!0,null!=(l=n)&&l.frame&&(this.pushAccessUnit(n,t),n=null),n||(n=this.VideoSample=this.createVideoSample(!1,i.pts,i.dts));break;case 12:a=!0;break;default:a=!1}if(n&&a){n.units.push(r)}}),r&&n&&(this.pushAccessUnit(n,t),this.VideoSample=null)}getNALuType(t,e){return 31&t[e]}readSliceType(t){const e=new Ak(t);return e.readUByte(),e.readUEG(),e.readUEG()}skipScalingList(t,e){let i,r=8,s=8;for(let a=0;a<t;a++)0!==s&&(i=e.readEG(),s=(r+i+256)%256),r=0===s?r:s}readSPS(t){const e=new Ak(t);let i,r,s,a=0,n=0,o=0,l=0;const c=e.readUByte.bind(e),d=e.readBits.bind(e),h=e.readUEG.bind(e),p=e.readBoolean.bind(e),u=e.skipBits.bind(e),g=e.skipEG.bind(e),f=e.skipUEG.bind(e),m=this.skipScalingList.bind(this);c();const v=c();if(d(5),u(3),c(),f(),100===v||110===v||122===v||244===v||44===v||83===v||86===v||118===v||128===v){const t=h();if(3===t&&u(1),f(),f(),u(1),p())for(r=3!==t?8:12,s=0;s<r;s++)p()&&m(s<6?16:64,e)}f();const b=h();if(0===b)h();else if(1===b)for(u(1),g(),g(),i=h(),s=0;s<i;s++)g();f(),u(1);const k=h(),y=h(),w=d(1);0===w&&u(1),u(1),p()&&(a=h(),n=h(),o=h(),l=h());let x=[1,1];if(p()&&p()){switch(c()){case 1:x=[1,1];break;case 2:x=[12,11];break;case 3:x=[10,11];break;case 4:x=[16,11];break;case 5:x=[40,33];break;case 6:x=[24,11];break;case 7:x=[20,11];break;case 8:x=[32,11];break;case 9:x=[80,33];break;case 10:x=[18,11];break;case 11:x=[15,11];break;case 12:x=[64,33];break;case 13:x=[160,99];break;case 14:x=[4,3];break;case 15:x=[3,2];break;case 16:x=[2,1];break;case 255:x=[c()<<8|c(),c()<<8|c()]}}return{width:Math.ceil(16*(k+1)-2*a-2*n),height:(2-w)*(y+1)*16-(w?2:4)*(o+l),pixelRatio:x}}}class Ik extends _k{constructor(...t){super(...t),this.initVPS=null}parsePES(t,e,i,r){const s=this.parseNALu(t,i.data,r);let a,n=this.VideoSample,o=!1;i.data=null,n&&s.length&&!t.audFound&&(this.pushAccessUnit(n,t),n=this.VideoSample=this.createVideoSample(!1,i.pts,i.dts)),s.forEach(r=>{var s,l;switch(r.type){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:case 9:n||(n=this.VideoSample=this.createVideoSample(!1,i.pts,i.dts)),n.frame=!0,a=!0;break;case 16:case 17:case 18:case 21:var c;if(a=!0,o)null!=(c=n)&&c.frame&&!n.key&&(this.pushAccessUnit(n,t),n=this.VideoSample=null);n||(n=this.VideoSample=this.createVideoSample(!0,i.pts,i.dts)),n.key=!0,n.frame=!0;break;case 19:case 20:a=!0,null!=(s=n)&&s.frame&&!n.key&&(this.pushAccessUnit(n,t),n=this.VideoSample=null),n||(n=this.VideoSample=this.createVideoSample(!0,i.pts,i.dts)),n.key=!0,n.frame=!0;break;case 39:a=!0,Lf(r.data,2,i.pts,e.samples);break;case 32:a=!0,t.vps||("object"!=typeof t.params&&(t.params={}),t.params=Ig(t.params,this.readVPS(r.data)),this.initVPS=r.data),t.vps=[r.data];break;case 33:if(a=!0,o=!0,void 0===t.vps||t.vps[0]===this.initVPS||void 0===t.sps||this.matchSPS(t.sps[0],r.data)||(this.initVPS=t.vps[0],t.sps=t.pps=void 0),!t.sps){const e=this.readSPS(r.data);t.width=e.width,t.height=e.height,t.pixelRatio=e.pixelRatio,t.codec=e.codecString,t.sps=[],"object"!=typeof t.params&&(t.params={});for(const i in e.params)t.params[i]=e.params[i]}this.pushParameterSet(t.sps,r.data,t.vps),n||(n=this.VideoSample=this.createVideoSample(!0,i.pts,i.dts)),n.key=!0;break;case 34:if(a=!0,"object"==typeof t.params){if(!t.pps){t.pps=[];const e=this.readPPS(r.data);for(const i in e)t.params[i]=e[i]}this.pushParameterSet(t.pps,r.data,t.vps)}break;case 35:a=!0,t.audFound=!0,null!=(l=n)&&l.frame&&(this.pushAccessUnit(n,t),n=null),n||(n=this.VideoSample=this.createVideoSample(!1,i.pts,i.dts));break;default:a=!1}if(n&&a){n.units.push(r)}}),r&&n&&(this.pushAccessUnit(n,t),this.VideoSample=null)}pushParameterSet(t,e,i){(i&&i[0]===this.initVPS||!i&&!t.length)&&t.push(e)}getNALuType(t,e){return(126&t[e])>>>1}ebsp2rbsp(t){const e=new Uint8Array(t.byteLength);let i=0;for(let r=0;r<t.byteLength;r++)r>=2&&3===t[r]&&0===t[r-1]&&0===t[r-2]||(e[i]=t[r],i++);return new Uint8Array(e.buffer,0,i)}pushAccessUnit(t,e){super.pushAccessUnit(t,e),this.initVPS&&(this.initVPS=null)}readVPS(t){const e=new Ak(t);e.readUByte(),e.readUByte(),e.readBits(4),e.skipBits(2),e.readBits(6);return{numTemporalLayers:e.readBits(3)+1,temporalIdNested:e.readBoolean()}}readSPS(t){const e=new Ak(this.ebsp2rbsp(t));e.readUByte(),e.readUByte(),e.readBits(4);const i=e.readBits(3);e.readBoolean();const r=e.readBits(2),s=e.readBoolean(),a=e.readBits(5),n=e.readUByte(),o=e.readUByte(),l=e.readUByte(),c=e.readUByte(),d=e.readUByte(),h=e.readUByte(),p=e.readUByte(),u=e.readUByte(),g=e.readUByte(),f=e.readUByte(),m=e.readUByte(),v=[],b=[];for(let t=0;t<i;t++)v.push(e.readBoolean()),b.push(e.readBoolean());if(i>0)for(let t=i;t<8;t++)e.readBits(2);for(let t=0;t<i;t++)v[t]&&(e.readUByte(),e.readUByte(),e.readUByte(),e.readUByte(),e.readUByte(),e.readUByte(),e.readUByte(),e.readUByte(),e.readUByte(),e.readUByte(),e.readUByte()),b[t]&&e.readUByte();e.readUEG();const k=e.readUEG();3==k&&e.skipBits(1);const y=e.readUEG(),w=e.readUEG(),x=e.readBoolean();let S=0,E=0,P=0,T=0;x&&(S+=e.readUEG(),E+=e.readUEG(),P+=e.readUEG(),T+=e.readUEG());const L=e.readUEG(),C=e.readUEG(),_=e.readUEG();for(let t=e.readBoolean()?0:i;t<=i;t++)e.skipUEG(),e.skipUEG(),e.skipUEG();e.skipUEG(),e.skipUEG(),e.skipUEG(),e.skipUEG(),e.skipUEG(),e.skipUEG();if(e.readBoolean()){if(e.readBoolean())for(let t=0;t<4;t++)for(let i=0;i<(3===t?2:6);i++){if(e.readBoolean()){const i=Math.min(64,1<<4+(t<<1));t>1&&e.readEG();for(let t=0;t<i;t++)e.readEG()}else e.readUEG()}}e.readBoolean(),e.readBoolean();e.readBoolean()&&(e.readUByte(),e.skipUEG(),e.skipUEG(),e.readBoolean());const A=e.readUEG();let R=0;for(let t=0;t<A;t++){let i=!1;if(0!==t&&(i=e.readBoolean()),i){t===A&&e.readUEG(),e.readBoolean(),e.readUEG();let i=0;for(let t=0;t<=R;t++){const t=e.readBoolean();let r=!1;t||(r=e.readBoolean()),(t||r)&&i++}R=i}else{const t=e.readUEG(),i=e.readUEG();R=t+i;for(let i=0;i<t;i++)e.readUEG(),e.readBoolean();for(let t=0;t<i;t++)e.readUEG(),e.readBoolean()}}if(e.readBoolean()){const t=e.readUEG();for(let i=0;i<t;i++){for(let t=0;t<_+4;t++)e.readBits(1);e.readBits(1)}}let I=0,D=1,M=1,O=!0,U=1,$=0;e.readBoolean(),e.readBoolean();let F=!1;if(e.readBoolean()){if(e.readBoolean()){const t=e.readUByte();t>0&&t<16?(D=[1,12,10,16,40,24,20,32,80,18,15,64,160,4,3,2][t-1],M=[1,11,11,11,33,11,11,11,33,11,11,33,99,3,2,1][t-1]):255===t&&(D=e.readBits(16),M=e.readBits(16))}e.readBoolean()&&e.readBoolean();if(e.readBoolean()){e.readBits(3),e.readBoolean();e.readBoolean()&&(e.readUByte(),e.readUByte(),e.readUByte())}e.readBoolean()&&(e.readUEG(),e.readUEG()),e.readBoolean(),e.readBoolean(),e.readBoolean(),F=e.readBoolean(),F&&(S+=e.readUEG(),E+=e.readUEG(),P+=e.readUEG(),T+=e.readUEG());if(e.readBoolean()){U=e.readBits(32),$=e.readBits(32);e.readBoolean()&&e.readUEG();if(e.readBoolean()){const t=e.readBoolean(),r=e.readBoolean();let s=!1;(t||r)&&(s=e.readBoolean(),s&&(e.readUByte(),e.readBits(5),e.readBoolean(),e.readBits(5)),e.readBits(4),e.readBits(4),s&&e.readBits(4),e.readBits(5),e.readBits(5),e.readBits(5));for(let a=0;a<=i;a++){O=e.readBoolean();let i=!1;O||e.readBoolean()?e.readEG():i=e.readBoolean();const a=i?1:e.readUEG()+1;if(t)for(let t=0;t<a;t++)e.readUEG(),e.readUEG(),s&&(e.readUEG(),e.readUEG()),e.skipBits(1);if(r)for(let t=0;t<a;t++)e.readUEG(),e.readUEG(),s&&(e.readUEG(),e.readUEG()),e.skipBits(1)}}}e.readBoolean()&&(e.readBoolean(),e.readBoolean(),e.readBoolean(),I=e.readUEG())}let N=y,j=w;if(x||F){let t=1,e=1;1===k?t=e=2:2==k&&(t=2),N=y-t*E-t*S,j=w-e*T-e*P}const z=r?["A","B","C"][r]:"",B=n<<24|o<<16|l<<8|c;let G=0;for(let t=0;t<32;t++)G=(G|(B>>t&1)<<31-t)>>>0;let H=G.toString(16);1===a&&"2"===H&&(H="6");return{codecString:`hvc1.${z}${a}.${H}.${s?"H":"L"}${m}.B0`,params:{general_tier_flag:s,general_profile_idc:a,general_profile_space:r,general_profile_compatibility_flags:[n,o,l,c],general_constraint_indicator_flags:[d,h,p,u,g,f],general_level_idc:m,bit_depth:L+8,bit_depth_luma_minus8:L,bit_depth_chroma_minus8:C,min_spatial_segmentation_idc:I,chroma_format_idc:k,frame_rate:{fixed:O,fps:$/U}},width:N,height:j,pixelRatio:[D,M]}}readPPS(t){const e=new Ak(this.ebsp2rbsp(t));e.readUByte(),e.readUByte(),e.skipUEG(),e.skipUEG(),e.skipBits(2),e.skipBits(3),e.skipBits(2),e.skipUEG(),e.skipUEG(),e.skipEG(),e.skipBits(2);e.readBoolean()&&e.skipUEG(),e.skipEG(),e.skipEG(),e.skipBits(4);const i=e.readBoolean(),r=e.readBoolean();let s=1;return r&&i?s=0:r?s=3:i&&(s=2),{parallelismType:s}}matchSPS(t,e){return String.fromCharCode.apply(null,t).substr(3)===String.fromCharCode.apply(null,e).substr(3)}}const Dk=188;class Mk{constructor(t,e,i,r){this.logger=void 0,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._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.logger=r,this.videoParser=null}static probe(t,e){const i=Mk.syncOffset(t);return i>0&&e.warn(`MPEG2-TS detected but first sync word found @ offset ${i}`),-1!==i}static syncOffset(t){const e=t.length;let i=Math.min(940,e-Dk)+1,r=0;for(;r<i;){let s=!1,a=-1,n=0;for(let o=r;o<e;o+=Dk){if(71!==t[o]||e-o!==Dk&&71!==t[o+Dk]){if(n)return-1;break}if(n++,-1===a&&(a=o,0!==a&&(i=Math.min(a+18612,t.length-Dk)+1)),s||(s=0===Ok(t,o)),s&&n>1&&(0===a&&n>2||o+Dk>i))return a}r++}return-1}static createTrack(t,e){return{container:"video"===t||"audio"===t?"video/mp2t":void 0,type:t,id:lf[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=Mk.createTrack("video"),this._videoTrack.duration=r,this._audioTrack=Mk.createTrack("audio",r),this._id3Track=Mk.createTrack("id3"),this._txtTrack=Mk.createTrack("text"),this._audioTrack.segmentCodec="aac",this.aacOverFlow=null,this.remainderData=null,this.audioCodec=e,this.videoCodec=i}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 s;i||(this.sampleAes=null);const a=this._videoTrack,n=this._audioTrack,o=this._id3Track,l=this._txtTrack;let c=a.pid,d=a.pesData,h=n.pid,p=o.pid,u=n.pesData,g=o.pesData,f=null,m=this.pmtParsed,v=this._pmtId,b=t.length;if(this.remainderData&&(b=(t=Sf(this.remainderData,t)).length,this.remainderData=null),b<Dk&&!r)return this.remainderData=t,{audioTrack:n,videoTrack:a,id3Track:o,textTrack:l};const k=Math.max(0,Mk.syncOffset(t));b-=(b-k)%Dk,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+=Dk)if(71===t[e]){const r=!!(64&t[e+1]),b=Ok(t,e);let y;if((48&t[e+3])>>4>1){if(y=e+5+t[e+4],y===e+Dk)continue}else y=e+4;switch(b){case c:if(r){if(d&&(s=jk(d,this.logger))){if(null===this.videoParser)switch(a.segmentCodec){case"avc":this.videoParser=new Rk;break;case"hevc":this.videoParser=new Ik}null!==this.videoParser&&this.videoParser.parsePES(a,l,s,!1)}d={data:[],size:0}}d&&(d.data.push(t.subarray(y,e+Dk)),d.size+=e+Dk-y);break;case h:if(r){if(u&&(s=jk(u,this.logger)))switch(n.segmentCodec){case"aac":this.parseAACPES(n,s);break;case"mp3":this.parseMPEGPES(n,s);break;case"ac3":this.parseAC3PES(n,s)}u={data:[],size:0}}u&&(u.data.push(t.subarray(y,e+Dk)),u.size+=e+Dk-y);break;case p:r&&(g&&(s=jk(g,this.logger))&&this.parseID3PES(o,s),g={data:[],size:0}),g&&(g.data.push(t.subarray(y,e+Dk)),g.size+=e+Dk-y);break;case 0:r&&(y+=t[y]+1),v=this._pmtId=Uk(t,y);break;case v:{r&&(y+=t[y]+1);const s=$k(t,y,this.typeSupported,i,this.observer,this.logger);c=s.videoPid,c>0&&(a.pid=c,a.segmentCodec=s.segmentVideoCodec),h=s.audioPid,h>0&&(n.pid=h,n.segmentCodec=s.segmentAudioCodec),p=s.id3Pid,p>0&&(o.pid=p),null===f||m||(this.logger.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&&Fk(this.observer,new Error(`Found ${y} TS packet/s that do not start with 0x47`),void 0,this.logger),a.pesData=d,n.pesData=u,o.pesData=g;const w={audioTrack:n,videoTrack:a,id3Track:o,textTrack:l};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:s}=t,a=i.pesData,n=e.pesData,o=r.pesData;let l;if(a&&(l=jk(a,this.logger))){if(null===this.videoParser)switch(i.segmentCodec){case"avc":this.videoParser=new Rk;break;case"hevc":this.videoParser=new Ik}null!==this.videoParser&&(this.videoParser.parsePES(i,s,l,!0),i.pesData=null)}else i.pesData=a;if(n&&(l=jk(n,this.logger))){switch(e.segmentCodec){case"aac":this.parseAACPES(e,l);break;case"mp3":this.parseMPEGPES(e,l);break;case"ac3":this.parseAC3PES(e,l)}e.pesData=null}else null!=n&&n.size&&this.logger.log("last AAC PES packet truncated,might overlap between fragments"),e.pesData=n;o&&(l=jk(o,this.logger))?(this.parseID3PES(r,l),r.pesData=null):r.pesData=o}demuxSampleAes(t,e,i){const r=this.demux(t,i,!0,!this.config.progressive),s=this.sampleAes=new Ck(this.observer,this.config,e);return this.decrypt(r,s)}decrypt(t,e){return new Promise(i=>{const{audioTrack:r,videoTrack:s}=t;r.samples&&"aac"===r.segmentCodec?e.decryptAacSamples(r.samples,0,()=>{s.samples?e.decryptAvcSamples(s.samples,0,0,()=>{i(t)}):i(t)}):s.samples&&e.decryptAvcSamples(s.samples,0,0,()=>{i(t)})})}destroy(){this.observer&&this.observer.removeAllListeners(),this.config=this.logger=this.observer=null,this.aacOverFlow=this.videoParser=this.remainderData=this.sampleAes=null,this._videoTrack=this._audioTrack=this._id3Track=this._txtTrack=void 0}parseAACPES(t,e){let i=0;const r=this.aacOverFlow;let s,a,n,o=e.data;if(r){this.aacOverFlow=null;const e=r.missing,s=r.sample.unit.byteLength;if(-1===e)o=Sf(r.sample.unit,o);else{const a=s-e;r.sample.unit.set(o.subarray(0,e),a),t.samples.push(r.sample),i=r.missing}}for(s=i,a=o.length;s<a-1&&!Wb(o,s);s++);if(s!==i){let t;const e=s<a-1;if(t=e?`AAC PES did not start with ADTS header,offset:${s}`:"No ADTS header found in AAC PES",Fk(this.observer,new Error(t),e,this.logger),!e)return}if(Qb(t,this.observer,o,s,this.audioCodec),void 0!==e.pts)n=e.pts;else{if(!r)return void this.logger.warn("[tsdemuxer]: AAC PES unknown PTS");{const e=Xb(t.samplerate);n=r.sample.pts+e}}let l,c=0;for(;s<a;){if(l=Jb(t,o,s,n,c),s+=l.length,l.missing){this.aacOverFlow=l;break}for(c++;s<a-1&&!Wb(o,s);s++);}}parseMPEGPES(t,e){const i=e.data,r=i.length;let s=0,a=0;const n=e.pts;if(void 0!==n)for(;a<r;)if(wk(i,a)){const e=bk(t,i,a,n,s);if(!e)break;a+=e.length,s++}else a++;else this.logger.warn("[tsdemuxer]: MPEG PES unknown PTS")}parseAC3PES(t,e){{const i=e.data,r=e.pts;if(void 0===r)return void this.logger.warn("[tsdemuxer]: AC3 PES unknown PTS");const s=i.length;let a,n=0,o=0;for(;o<s&&(a=Pk(t,i,o,r,n++))>0;)o+=a}}parseID3PES(t,e){if(void 0===e.pts)return void this.logger.warn("[tsdemuxer]: ID3 PES unknown PTS");const i=Ig({},e,{type:this._videoTrack?ck.emsg:ck.audioId3,duration:Number.POSITIVE_INFINITY});t.samples.push(i)}}function Ok(t,e){return((31&t[e+1])<<8)+t[e+2]}function Uk(t,e){return(31&t[e+10])<<8|t[e+11]}function $k(t,e,i,r,s,a){const n={audioPid:-1,videoPid:-1,id3Pid:-1,segmentVideoCodec:"avc",segmentAudioCodec:"aac"},o=e+3+((15&t[e+1])<<8|t[e+2])-4;for(e+=12+((15&t[e+10])<<8|t[e+11]);e<o;){const o=Ok(t,e),l=(15&t[e+3])<<8|t[e+4];switch(t[e]){case 207:if(!r){Nk("ADTS AAC",a);break}case 15:-1===n.audioPid&&(n.audioPid=o);break;case 21:-1===n.id3Pid&&(n.id3Pid=o);break;case 219:if(!r){Nk("H.264",a);break}case 27:-1===n.videoPid&&(n.videoPid=o);break;case 3:case 4:i.mpeg||i.mp3?-1===n.audioPid&&(n.audioPid=o,n.segmentAudioCodec="mp3"):a.log("MPEG audio found, not supported in this browser");break;case 193:if(!r){Nk("AC-3",a);break}case 129:i.ac3?-1===n.audioPid&&(n.audioPid=o,n.segmentAudioCodec="ac3"):a.log("AC-3 audio found, not supported in this browser");break;case 6:if(-1===n.audioPid&&l>0){let r=e+5,s=l;for(;s>2;){if(106===t[r])!0!==i.ac3?a.log("AC-3 audio found, not supported in this browser for now"):(n.audioPid=o,n.segmentAudioCodec="ac3");const e=t[r+1]+2;r+=e,s-=e}}break;case 194:case 135:return Fk(s,new Error("Unsupported EC-3 in M2TS found"),void 0,a),n;case 36:-1===n.videoPid&&(n.videoPid=o,n.segmentVideoCodec="hevc",a.log("HEVC in M2TS found"))}e+=l+5}return n}function Fk(t,e,i,r){r.warn(`parsing error: ${e.message}`),t.emit(wg.ERROR,wg.ERROR,{type:kg.MEDIA_ERROR,details:yg.FRAG_PARSING_ERROR,fatal:!1,levelRetry:i,error:e,reason:e.message})}function Nk(t,e){e.log(`${t} with AES-128-CBC encryption found in unencrypted stream`)}function jk(t,e){let i,r,s,a,n,o=0;const l=t.data;if(!t||0===t.size)return null;for(;l[0].length<19&&l.length>1;)l[0]=Sf(l[0],l[1]),l.splice(1,1);i=l[0];if(1===(i[0]<<16)+(i[1]<<8)+i[2]){if(r=(i[4]<<8)+i[5],r&&r>t.size-6)return null;const c=i[7];192&c&&(a=536870912*(14&i[9])+4194304*(255&i[10])+16384*(254&i[11])+128*(255&i[12])+(254&i[13])/2,64&c?(n=536870912*(14&i[14])+4194304*(255&i[15])+16384*(254&i[16])+128*(255&i[17])+(254&i[18])/2,a-n>54e5&&(e.warn(`${Math.round((a-n)/9e4)}s delta between PTS and DTS, align them`),a=n)):n=a),s=i[8];let d=s+9;if(t.size<=d)return null;t.size-=d;const h=new Uint8Array(t.size);for(let t=0,e=l.length;t<e;t++){i=l[t];let e=i.byteLength;if(d){if(d>e){d-=e;continue}i=i.subarray(d),e-=d,d=0}h.set(i,o),o+=e}return r&&(r-=s+3),{data:h,pts:a,dts:n,len:r}}return null}class zk{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 Bk=Math.pow(2,32)-1;class Gk{static init(){let t;for(t in Gk.types={avc1:[],avcC:[],hvc1:[],hvcC:[],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:[]},Gk.types)Gk.types.hasOwnProperty(t)&&(Gk.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]);Gk.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]),s=new Uint8Array([0,0,0,0,0,0,0,0]);Gk.STTS=Gk.STSC=Gk.STCO=s,Gk.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),Gk.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0]),Gk.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),Gk.STSD=new Uint8Array([0,0,0,0,0,0,0,1]);const a=new Uint8Array([105,115,111,109]),n=new Uint8Array([97,118,99,49]),o=new Uint8Array([0,0,0,1]);Gk.FTYP=Gk.box(Gk.types.ftyp,a,o,a,n),Gk.DINF=Gk.box(Gk.types.dinf,Gk.box(Gk.types.dref,r))}static box(t,...e){let i=8,r=e.length;const s=r;for(;r--;)i+=e[r].byteLength;const a=new Uint8Array(i);for(a[0]=i>>24&255,a[1]=i>>16&255,a[2]=i>>8&255,a[3]=255&i,a.set(t,4),r=0,i=8;r<s;r++)a.set(e[r],i),i+=e[r].byteLength;return a}static hdlr(t){return Gk.box(Gk.types.hdlr,Gk.HDLR_TYPES[t])}static mdat(t){return Gk.box(Gk.types.mdat,t)}static mdhd(t,e){e*=t;const i=Math.floor(e/(Bk+1)),r=Math.floor(e%(Bk+1));return Gk.box(Gk.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 Gk.box(Gk.types.mdia,Gk.mdhd(t.timescale||0,t.duration||0),Gk.hdlr(t.type),Gk.minf(t))}static mfhd(t){return Gk.box(Gk.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?Gk.box(Gk.types.minf,Gk.box(Gk.types.smhd,Gk.SMHD),Gk.DINF,Gk.stbl(t)):Gk.box(Gk.types.minf,Gk.box(Gk.types.vmhd,Gk.VMHD),Gk.DINF,Gk.stbl(t))}static moof(t,e,i){return Gk.box(Gk.types.moof,Gk.mfhd(t),Gk.traf(i,e))}static moov(t){let e=t.length;const i=[];for(;e--;)i[e]=Gk.trak(t[e]);return Gk.box.apply(null,[Gk.types.moov,Gk.mvhd(t[0].timescale||0,t[0].duration||0)].concat(i).concat(Gk.mvex(t)))}static mvex(t){let e=t.length;const i=[];for(;e--;)i[e]=Gk.trex(t[e]);return Gk.box.apply(null,[Gk.types.mvex,...i])}static mvhd(t,e){e*=t;const i=Math.floor(e/(Bk+1)),r=Math.floor(e%(Bk+1)),s=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 Gk.box(Gk.types.mvhd,s)}static sdtp(t){const e=t.samples||[],i=new Uint8Array(4+e.length);let r,s;for(r=0;r<e.length;r++)s=e[r].flags,i[r+4]=s.dependsOn<<4|s.isDependedOn<<2|s.hasRedundancy;return Gk.box(Gk.types.sdtp,i)}static stbl(t){return Gk.box(Gk.types.stbl,Gk.stsd(t),Gk.box(Gk.types.stts,Gk.STTS),Gk.box(Gk.types.stsc,Gk.STSC),Gk.box(Gk.types.stsz,Gk.STSZ),Gk.box(Gk.types.stco,Gk.STCO))}static avc1(t){let e,i,r,s=[],a=[];for(e=0;e<t.sps.length;e++)i=t.sps[e],r=i.byteLength,s.push(r>>>8&255),s.push(255&r),s=s.concat(Array.prototype.slice.call(i));for(e=0;e<t.pps.length;e++)i=t.pps[e],r=i.byteLength,a.push(r>>>8&255),a.push(255&r),a=a.concat(Array.prototype.slice.call(i));const n=Gk.box(Gk.types.avcC,new Uint8Array([1,s[3],s[4],s[5],255,224|t.sps.length].concat(s).concat([t.pps.length]).concat(a))),o=t.width,l=t.height,c=t.pixelRatio[0],d=t.pixelRatio[1];return Gk.box(Gk.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,l>>8&255,255&l,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,Gk.box(Gk.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),Gk.box(Gk.types.pasp,new Uint8Array([c>>24,c>>16&255,c>>8&255,255&c,d>>24,d>>16&255,d>>8&255,255&d])))}static esds(t){const e=t.config;return new Uint8Array([0,0,0,0,3,25,0,1,0,4,17,64,21,0,0,0,0,0,0,0,0,0,0,0,5,2,...e,6,1,2])}static audioStsd(t){const e=t.samplerate||0;return new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,t.channelCount||0,0,16,0,0,0,0,e>>8&255,255&e,0,0])}static mp4a(t){return Gk.box(Gk.types.mp4a,Gk.audioStsd(t),Gk.box(Gk.types.esds,Gk.esds(t)))}static mp3(t){return Gk.box(Gk.types[".mp3"],Gk.audioStsd(t))}static ac3(t){return Gk.box(Gk.types["ac-3"],Gk.audioStsd(t),Gk.box(Gk.types.dac3,t.config))}static stsd(t){const{segmentCodec:e}=t;if("audio"===t.type){if("aac"===e)return Gk.box(Gk.types.stsd,Gk.STSD,Gk.mp4a(t));if("ac3"===e&&t.config)return Gk.box(Gk.types.stsd,Gk.STSD,Gk.ac3(t));if("mp3"===e&&"mp3"===t.codec)return Gk.box(Gk.types.stsd,Gk.STSD,Gk.mp3(t))}else{if(!t.pps||!t.sps)throw new Error("video track missing pps or sps");if("avc"===e)return Gk.box(Gk.types.stsd,Gk.STSD,Gk.avc1(t));if("hevc"===e&&t.vps)return Gk.box(Gk.types.stsd,Gk.STSD,Gk.hvc1(t))}throw new Error(`unsupported ${t.type} segment codec (${e}/${t.codec})`)}static tkhd(t){const e=t.id,i=(t.duration||0)*(t.timescale||0),r=t.width||0,s=t.height||0,a=Math.floor(i/(Bk+1)),n=Math.floor(i%(Bk+1));return Gk.box(Gk.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,a>>24,a>>16&255,a>>8&255,255&a,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,s>>8&255,255&s,0,0]))}static traf(t,e){const i=Gk.sdtp(t),r=t.id,s=Math.floor(e/(Bk+1)),a=Math.floor(e%(Bk+1));return Gk.box(Gk.types.traf,Gk.box(Gk.types.tfhd,new Uint8Array([0,0,0,0,r>>24,r>>16&255,r>>8&255,255&r])),Gk.box(Gk.types.tfdt,new Uint8Array([1,0,0,0,s>>24,s>>16&255,s>>8&255,255&s,a>>24,a>>16&255,a>>8&255,255&a])),Gk.trun(t,i.length+16+20+8+16+8+8),i)}static trak(t){return t.duration=t.duration||4294967295,Gk.box(Gk.types.trak,Gk.tkhd(t),Gk.mdia(t))}static trex(t){const e=t.id;return Gk.box(Gk.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,s=12+16*r,a=new Uint8Array(s);let n,o,l,c,d,h;for(e+=8+s,a.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],l=o.duration,c=o.size,d=o.flags,h=o.cts,a.set([l>>>24&255,l>>>16&255,l>>>8&255,255&l,c>>>24&255,c>>>16&255,c>>>8&255,255&c,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 Gk.box(Gk.types.trun,a)}static initSegment(t){Gk.types||Gk.init();const e=Gk.moov(t);return Sf(Gk.FTYP,e)}static hvc1(t){const e=t.params,i=[t.vps,t.sps,t.pps],r=new Uint8Array([1,e.general_profile_space<<6|(e.general_tier_flag?32:0)|e.general_profile_idc,e.general_profile_compatibility_flags[0],e.general_profile_compatibility_flags[1],e.general_profile_compatibility_flags[2],e.general_profile_compatibility_flags[3],e.general_constraint_indicator_flags[0],e.general_constraint_indicator_flags[1],e.general_constraint_indicator_flags[2],e.general_constraint_indicator_flags[3],e.general_constraint_indicator_flags[4],e.general_constraint_indicator_flags[5],e.general_level_idc,240|e.min_spatial_segmentation_idc>>8,255&e.min_spatial_segmentation_idc,252|e.parallelismType,252|e.chroma_format_idc,248|e.bit_depth_luma_minus8,248|e.bit_depth_chroma_minus8,0,parseInt(e.frame_rate.fps),3|e.temporal_id_nested<<2|e.num_temporal_layers<<3|(e.frame_rate.fixed?64:0),i.length]);let s=r.length;for(let t=0;t<i.length;t+=1){s+=3;for(let e=0;e<i[t].length;e+=1)s+=2+i[t][e].length}const a=new Uint8Array(s);a.set(r,0),s=r.length;const n=i.length-1;for(let t=0;t<i.length;t+=1){a.set(new Uint8Array([32+t|(t===n?128:0),0,i[t].length]),s),s+=3;for(let e=0;e<i[t].length;e+=1)a.set(new Uint8Array([i[t][e].length>>8,255&i[t][e].length]),s),s+=2,a.set(i[t][e],s),s+=i[t][e].length}const o=Gk.box(Gk.types.hvcC,a),l=t.width,c=t.height,d=t.pixelRatio[0],h=t.pixelRatio[1];return Gk.box(Gk.types.hvc1,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,l>>8&255,255&l,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]),o,Gk.box(Gk.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),Gk.box(Gk.types.pasp,new Uint8Array([d>>24,d>>16&255,d>>8&255,255&d,h>>24,h>>16&255,h>>8&255,255&h])))}}Gk.types=void 0,Gk.HDLR_TYPES=void 0,Gk.STTS=void 0,Gk.STSC=void 0,Gk.STCO=void 0,Gk.STSZ=void 0,Gk.VMHD=void 0,Gk.SMHD=void 0,Gk.STSD=void 0,Gk.FTYP=void 0,Gk.DINF=void 0;function Hk(t,e,i=1,r=!1){const s=t*e*i;return r?Math.round(s):s}function Vk(t,e=!1){return Hk(t,1e3,1/9e4,e)}let qk,Kk=null,Yk=null;function Wk(t,e,i,r){return{duration:e,size:i,cts:r,flags:{isLeading:0,isDependedOn:0,hasRedundancy:0,degradPrio:0,dependsOn:t?2:1,isNonSync:t?0:1}}}class Zk extends Og{constructor(t,e,i,r){if(super("mp4-remuxer",r),this.observer=void 0,this.config=void 0,this.typeSupported=void 0,this.ISGenerated=!1,this._initPTS=null,this._initDTS=null,this.nextVideoTs=null,this.nextAudioTs=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===Kk){const t=(navigator.userAgent||"").match(/Chrome\/(\d+)/i);Kk=t?parseInt(t[1]):0}if(null===Yk){const t=navigator.userAgent.match(/Safari\/(\d+)/i);Yk=t?parseInt(t[1]):0}}destroy(){this.config=this.videoTrackConfig=this._initPTS=this._initDTS=null}resetTimeStamp(t){this.log("initPTS & initDTS reset"),this._initPTS=this._initDTS=t}resetNextTimestamp(){this.log("reset next timestamp"),this.isVideoContiguous=!1,this.isAudioContiguous=!1}resetInitSegment(){this.log("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 s=r.pts,a=s-t;return a<-4294967296&&(e=!0,s=Qk(s,i),a=s-t),a>0?t:s},i);return e&&this.debug("PTS rollover detected"),r}remux(t,e,i,r,s,a,n,o){let l,c,d,h,p,u,g=s,f=s;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,E;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==(E=t.pixelRatio)?void 0:E[1]))||!t&&y||null===this.nextAudioTs&&k)&&this.resetInitSegment()}this.ISGenerated||(d=this.generateIS(t,e,s,a));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(u=!0,n>0){this.warn(`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&&(this.warn(`No keyframe found out of ${b} video samples`),u=!1);if(this.ISGenerated){if(k&&y){const i=this.getVideoStartPts(e.samples),r=(Qk(t.samples[0].pts,i)-i)/e.inputTimeScale;g+=Math.max(0,r),f+=Math.max(0,-r)}if(k){if(t.samplerate||(this.warn("regenerate InitSegment as audio detected"),d=this.generateIS(t,e,s,a)),c=this.remuxAudio(t,g,this.isAudioContiguous,a,v||y||o===Lg?f:void 0),y){const r=c?c.endPTS-c.startPTS:0;e.inputTimeScale||(this.warn("regenerate InitSegment as video detected"),d=this.generateIS(t,e,s,a)),l=this.remuxVideo(e,f,i,r)}}else y&&(l=this.remuxVideo(e,f,i,0));l&&(l.firstKeyFrame=n,l.independent=-1!==n,l.firstKeyFramePTS=r)}}return this.ISGenerated&&this._initPTS&&this._initDTS&&(i.samples.length&&(p=Xk(i,s,this._initPTS,this._initDTS)),r.samples.length&&(h=Jk(r,s,this._initPTS))),{audio:c,video:l,initSegment:d,independent:u,text:h,id3:p}}generateIS(t,e,i,r){const s=t.samples,a=e.samples,n=this.typeSupported,o={},l=this._initPTS;let c,d,h,p,u=!l||r,g="audio/mp4";if(u&&(c=d=1/0),t.config&&s.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):Gk.initSegment([t]),metadata:{channelCount:t.channelCount}},u&&(p=t.id,h=t.inputTimeScale,l&&h===l.timescale?u=!1:c=d=s[0].pts-Math.round(h*i))}if(e.sps&&e.pps&&a.length){if(e.timescale=e.inputTimeScale,o.video={id:"main",container:"video/mp4",codec:e.codec,initSegment:Gk.initSegment([e]),metadata:{width:e.width,height:e.height}},u)if(p=e.id,h=e.inputTimeScale,l&&h===l.timescale)u=!1;else{const t=this.getVideoStartPts(a),e=Math.round(h*i);d=Math.min(d,Qk(a[0].dts,t)-e),c=Math.min(c,t-e)}this.videoTrackConfig={width:e.width,height:e.height,pixelRatio:e.pixelRatio}}if(Object.keys(o).length)return this.ISGenerated=!0,u?(this._initPTS={baseTime:c,timescale:h},this._initDTS={baseTime:d,timescale:h}):c=h=void 0,{tracks:o,initPTS:c,timescale:h,trackId:p}}remuxVideo(t,e,i,r){const s=t.inputTimeScale,a=t.samples,n=[],o=a.length,l=this._initPTS,c=l.baseTime*s/l.timescale;let d,h,p=this.nextVideoTs,u=8,g=this.videoSampleDuration,f=Number.POSITIVE_INFINITY,m=Number.NEGATIVE_INFINITY,v=!1;if(!i||null===p){const t=c+e*s,r=a[0].pts-Qk(a[0].dts,a[0].pts);Kk&&null!==p&&Math.abs(t-r-(p+c))<15e3?i=!0:p=t-r-c}const b=p+c;for(let t=0;t<o;t++){const e=a[t];e.pts=Qk(e.pts,b),e.dts=Qk(e.dts,b),e.dts<a[t>0?t-1:t].dts&&(v=!0)}v&&a.sort(function(t,e){const i=t.dts-e.dts,r=t.pts-e.pts;return i||r}),d=a[0].dts,h=a[a.length-1].dts;const k=h-d,y=k?Math.round(k/(o-1)):g||t.inputTimeScale/30;if(i){const i=d-b,r=i>y,s=i<-1;if((r||s)&&(r?this.warn(`${(t.segmentCodec||"").toUpperCase()}: ${Vk(i,!0)} ms (${i}dts) hole between fragments detected at ${e.toFixed(3)}`):this.warn(`${(t.segmentCodec||"").toUpperCase()}: ${Vk(-i,!0)} ms (${i}dts) overlapping between fragments detected at ${e.toFixed(3)}`),!s||b>=a[0].pts||Kk)){d=b;const t=a[0].pts-i;if(r)a[0].dts=d,a[0].pts=t;else{let e=!0;for(let r=0;r<a.length&&!(a[r].dts>t&&e);r++){const t=a[r].pts;if(a[r].dts-=i,a[r].pts-=i,r<a.length-1){const i=a[r+1].pts;e=i<=a[r].pts==i<=t}}}this.log(`Video: Initial PTS/DTS adjusted: ${Vk(t,!0)}/${Vk(d,!0)}, delta: ${Vk(i,!0)} ms`)}}d=Math.max(0,d);let w=0,x=0,S=d;for(let t=0;t<o;t++){const e=a[t],i=e.units,r=i.length;let s=0;for(let t=0;t<r;t++)s+=i[t].data.length;x+=s,w+=r,e.length=s,e.dts<S?(e.dts=S,S+=y/4|0||1):S=e.dts,f=Math.min(e.pts,f),m=Math.max(e.pts,m)}h=a[o-1].dts;const E=x+4*w+8;let P;try{P=new Uint8Array(E)}catch(t){return void this.observer.emit(wg.ERROR,wg.ERROR,{type:kg.MUX_ERROR,details:yg.REMUX_ALLOC_ERROR,fatal:!1,error:t,bytes:E,reason:`fail allocating video mdat ${E}`})}const T=new DataView(P.buffer);T.setUint32(0,E),P.set(Gk.types.mdat,4);let L=!1,C=Number.POSITIVE_INFINITY,_=Number.POSITIVE_INFINITY,A=Number.NEGATIVE_INFINITY,R=Number.NEGATIVE_INFINITY;for(let t=0;t<o;t++){const e=a[t],i=e.units;let l,d=0;for(let t=0,e=i.length;t<e;t++){const e=i[t],r=e.data,s=e.data.byteLength;T.setUint32(u,s),u+=4,P.set(r,u),u+=s,d+=4+s}if(t<o-1)g=a[t+1].dts-e.dts,l=a[t+1].pts-e.pts;else{const i=this.config,n=t>0?e.dts-a[t-1].dts:y;if(l=t>0?e.pts-a[t-1].pts:y,i.stretchShortVideoTrack&&null!==this.nextAudioTs){const t=Math.floor(i.maxBufferHole*s),a=(r?f+r*s:this.nextAudioTs+c)-e.pts;a>t?(g=a-n,g<0?g=n:L=!0,this.log(`It is approximately ${a/90} ms to the next segment; using duration ${g/90} ms for the last video frame.`)):g=n}else g=n}const h=Math.round(e.pts-e.dts);C=Math.min(C,g),A=Math.max(A,g),_=Math.min(_,l),R=Math.max(R,l),n.push(Wk(e.key,g,d,h))}if(n.length)if(Kk){if(Kk<70){const t=n[0].flags;t.dependsOn=2,t.isNonSync=0}}else if(Yk&&R-_<A-C&&y/A<.025&&0===n[0].cts){this.warn("Found irregular gaps in sample duration. Using PTS instead of DTS to determine MP4 sample duration.");let t=d;for(let e=0,i=n.length;e<i;e++){const r=t+n[e].duration,s=t+n[e].cts;if(e<i-1){const t=r+n[e+1].cts;n[e].duration=t-s}else n[e].duration=e?n[e-1].duration:y;n[e].cts=0,t=r}}g=L||!g?y:g;const I=h+g;this.nextVideoTs=p=I-c,this.videoSampleDuration=g,this.isVideoContiguous=!0;const D={data1:Gk.moof(t.sequenceNumber++,d,Ig(t,{samples:n})),data2:P,startPTS:(f-c)/s,endPTS:(m+g-c)/s,startDTS:(d-c)/s,endDTS:p/s,type:"video",hasAudio:!1,hasVideo:!0,nb:n.length,dropped:t.dropped};return t.samples=[],t.dropped=0,D}getSamplesPerFrame(t){switch(t.segmentCodec){case"mp3":return 1152;case"ac3":return 1536;default:return 1024}}remuxAudio(t,e,i,r,s){const a=t.inputTimeScale,n=a/(t.samplerate?t.samplerate:a),o=this.getSamplesPerFrame(t),l=o*n,c=this._initPTS,d="mp3"===t.segmentCodec&&this.typeSupported.mpeg,h=[],p=void 0!==s;let u=t.samples,g=d?0:8,f=this.nextAudioTs||-1;const m=c.baseTime*a/c.timescale,v=m+e*a;if(this.isAudioContiguous=i=i||u.length&&f>0&&(r&&Math.abs(v-(f+m))<9e3||Math.abs(Qk(u[0].pts,v)-(f+m))<20*l),u.forEach(function(t){t.pts=Qk(t.pts,v)}),!i||f<0){if(u=u.filter(t=>t.pts>=0),!u.length)return;f=0===s?0:r&&!p?Math.max(0,v-m):u[0].pts-m}if("aac"===t.segmentCodec){const e=this.config.maxAudioFramesDrift;for(let i=0,r=f+m;i<u.length;i++){const s=u[i],n=s.pts,o=n-r,c=Math.abs(1e3*o/a);if(o<=-e*l&&p)0===i&&(this.warn(`Audio frame @ ${(n/a).toFixed(3)}s overlaps marker by ${Math.round(1e3*o/a)} ms.`),this.nextAudioTs=f=n-m,r=n);else if(o>=e*l&&c<1e4&&p){let e=Math.round(o/l);for(r=n-e*l;r<0&&e&&l;)e--,r+=l;0===i&&(this.nextAudioTs=f=r-m),this.warn(`Injecting ${e} audio frames @ ${((r-m)/a).toFixed(3)}s due to ${Math.round(1e3*o/a)} ms gap.`);for(let a=0;a<e;a++){let e=zk.getSilentFrame(t.parsedCodec||t.manifestCodec||t.codec,t.channelCount);e||(this.log("Unable to get silent frame for given audio codec; duplicating last frame instead."),e=s.unit.subarray()),u.splice(i,0,{unit:e,pts:r}),r+=l,i++}}s.pts=r,r+=l}}let b,k=null,y=null,w=0,x=u.length;for(;x--;)w+=u[x].unit.byteLength;for(let e=0,r=u.length;e<r;e++){const r=u[e],s=r.unit;let a=r.pts;if(null!==y){h[e-1].duration=Math.round((a-y)/n)}else{if(i&&"aac"===t.segmentCodec&&(a=f+m),k=a,!(w>0))return;w+=g;try{b=new Uint8Array(w)}catch(t){return void this.observer.emit(wg.ERROR,wg.ERROR,{type:kg.MUX_ERROR,details:yg.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(Gk.types.mdat,4)}}b.set(s,g);const l=s.byteLength;g+=l,h.push(Wk(!0,o,l,0)),y=a}const S=h.length;if(!S)return;const E=h[h.length-1];f=y-m,this.nextAudioTs=f+n*E.duration;const P=d?new Uint8Array(0):Gk.moof(t.sequenceNumber++,k/n,Ig({},t,{samples:h}));t.samples=[];const T=(k-m)/a,L=f/a,C={data1:P,data2:b,startPTS:T,endPTS:L,startDTS:T,endDTS:L,type:"audio",hasAudio:!0,hasVideo:!1,nb:S};return this.isAudioContiguous=!0,C}}function Qk(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 Xk(t,e,i,r){const s=t.samples.length;if(!s)return;const a=t.inputTimeScale;for(let n=0;n<s;n++){const s=t.samples[n];s.pts=Qk(s.pts-i.baseTime*a/i.timescale,e*a)/a,s.dts=Qk(s.dts-r.baseTime*a/r.timescale,e*a)/a}const n=t.samples;return t.samples=[],{samples:n}}function Jk(t,e,i){const r=t.samples.length;if(!r)return;const s=t.inputTimeScale;for(let a=0;a<r;a++){const r=t.samples[a];r.pts=Qk(r.pts-i.baseTime*s/i.timescale,e*s)/s}t.samples.sort((t,e)=>t.pts-e.pts);const a=t.samples;return t.samples=[],{samples:a}}function ty(t,e,i=!1){return void 0!==(null==t?void 0:t.start)?(t.start+(i?t.duration:0))/t.timescale:e}function ey(t,e,i){const r=null==t?void 0:t.codec;if(r&&r.length>4)return r;if(e===Qg){if("ec-3"===r||"ac-3"===r||"alac"===r)return r;if("fLaC"===r||"Opus"===r){return zf(r,!1)}return i.warn(`Unhandled audio codec "${r}" in mp4 MAP`),r||"mp4a"}return i.warn(`Unhandled video codec "${r}" in mp4 MAP`),r||"avc1"}try{qk=self.performance.now.bind(self.performance)}catch(_){qk=Date.now}const iy=[{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 s=this.videoTrack=dk("video",1),a=this.audioTrack=dk("audio",1),n=this.txtTrack=dk("text",1);if(this.id3Track=dk("id3",1),this.timeOffset=0,null==t||!t.byteLength)return;const o=mf(t);if(o.video){const{id:t,timescale:e,codec:i,supplemental:r}=o.video;s.id=t,s.timescale=n.timescale=e,s.codec=i,s.supplemental=r}if(o.audio){const{id:t,timescale:e,codec:i}=o.audio;a.id=t,a.timescale=e,a.codec=i}n.id=lf.text,s.sampleDuration=0,s.duration=a.duration=r}resetContiguity(){this.remainderData=null}static probe(t){return function(t){const e=t.byteLength;for(let i=0;i<e;){const r=hf(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,s=this.txtTrack;if(this.config.progressive){this.remainderData&&(i=Sf(this.remainderData,t));const e=function(t){const e={valid:null,remainder:null},i=gf(t,["moof"]);if(i.length<2)return e.remainder=t,e;const r=i[i.length-1];return e.valid=t.slice(0,r.byteOffset-8),e.remainder=t.slice(r.byteOffset-8),e}(i);this.remainderData=e.remainder,r.samples=e.valid||new Uint8Array}else r.samples=i;const a=this.extractID3Track(r,e);return s.samples=Ef(e,r),{videoTrack:r,audioTrack:this.audioTrack,id3Track:a,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=Ef(t,e),{videoTrack:e,audioTrack:dk(),id3Track:r,textTrack:dk()}}extractID3Track(t,e){const i=this.id3Track;if(t.samples.length){const r=gf(t.samples,["emsg"]);r&&r.forEach(t=>{const r=function(t){const e=t[0];let i="",r="",s=0,a=0,n=0,o=0,l=0,c=0;if(0===e){for(;"\0"!==cf(t.subarray(c,c+1));)i+=cf(t.subarray(c,c+1)),c+=1;for(i+=cf(t.subarray(c,c+1)),c+=1;"\0"!==cf(t.subarray(c,c+1));)r+=cf(t.subarray(c,c+1)),c+=1;r+=cf(t.subarray(c,c+1)),c+=1,s=hf(t,12),a=hf(t,16),o=hf(t,20),l=hf(t,24),c=28}else if(1===e){c+=4,s=hf(t,c),c+=4;const e=hf(t,c);c+=4;const a=hf(t,c);for(c+=4,n=2**32*e+a,vg(n)||(n=Number.MAX_SAFE_INTEGER,zg.warn("Presentation time exceeds safe integer limit and wrapped to max safe integer in parsing emsg box")),o=hf(t,c),c+=4,l=hf(t,c),c+=4;"\0"!==cf(t.subarray(c,c+1));)i+=cf(t.subarray(c,c+1)),c+=1;for(i+=cf(t.subarray(c,c+1)),c+=1;"\0"!==cf(t.subarray(c,c+1));)r+=cf(t.subarray(c,c+1)),c+=1;r+=cf(t.subarray(c,c+1)),c+=1}return{schemeIdUri:i,value:r,timeScale:s,presentationTime:n,presentationTimeDelta:a,eventDuration:o,id:l,payload:t.subarray(c,t.byteLength)}}(t);if(Tk.test(r.schemeIdUri)){const t=Lk(r,e);let s=4294967295===r.eventDuration?Number.POSITIVE_INFINITY:r.eventDuration/r.timeScale;s<=.001&&(s=Number.POSITIVE_INFINITY);const a=r.payload;i.samples.push({data:a,len:a.byteLength,dts:t,pts:t,type:ck.emsg,duration:s})}else if(this.config.enableEmsgKLVMetadata&&r.schemeIdUri.startsWith("urn:misb:KLV:bin:1910.1")){const t=Lk(r,e);i.samples.push({data:r.payload,len:r.payload.byteLength,dts:t,pts:t,type:ck.misbklv,duration:Number.POSITIVE_INFINITY})}})}return i}demuxSampleAes(t,e,i){return Promise.reject(new Error("The MP4 demuxer does not support SAMPLE-AES decryption"))}destroy(){this.config=null,this.remainderData=null,this.videoTrack=this.audioTrack=this.id3Track=this.txtTrack=void 0}},remux:class extends Og{constructor(t,e,i,r){super("passthrough-remuxer",r),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,this.isVideoContiguous=!1}destroy(){}resetTimeStamp(t){this.lastEndTime=null;const e=this.initPTS;e&&t&&e.baseTime===t.baseTime&&e.timescale===t.timescale||(this.initPTS=t)}resetNextTimestamp(){this.isVideoContiguous=!1,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&&gf(t,["moov","trak"]).forEach(t=>{const e=gf(t,["mdia","minf","stbl","stsd"])[0].subarray(8);let r=gf(e,["enca"]);const s=r.length>0;s||(r=gf(e,["encv"])),r.forEach(t=>{gf(s?t.subarray(28):t.subarray(78),["sinf"]).forEach(t=>{const e=xf(t);if(e){const t=e.subarray(8,24);t.some(t=>0!==t)||(zg.log(`[eme] Patching keyId in 'enc${s?"a":"v"}>sinf>>tenc' box: ${Vg(t)} -> ${Vg(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=mf(t);r.audio&&(e=ey(r.audio,Qg,this)),r.video&&(i=ey(r.video,Xg,this));const s={};r.audio&&r.video?s.audiovideo={container:"video/mp4",codec:e+","+i,supplemental:r.video.supplemental,initSegment:t,id:"main"}:r.audio?s.audio={container:"audio/mp4",codec:e,initSegment:t,id:"audio"}:r.video?s.video={container:"video/mp4",codec:i,supplemental:r.video.supplemental,initSegment:t,id:"main"}:this.warn("initSegment does not contain moov or trak boxes."),this.initTracks=s}remux(t,e,i,r,s,a){var n,o;let{initPTS:l,lastEndTime:c}=this;const d={audio:void 0,video:void 0,text:r,id3:i,initSegment:void 0};mg(c)||(c=this.lastEndTime=s||0);const h=e.samples;if(null==h||!h.length)return d;const p={initPTS:void 0,timescale:void 0,trackId:void 0};let u=this.initData;if(null!=(n=u)&&n.length||(this.generateInitSegment(h),u=this.initData),null==(o=u)||!o.length)return this.warn("Failed to generate initSegment."),d;this.emitInitSegment&&(p.tracks=this.initTracks,this.emitInitSegment=!1);const g=function(t,e,i){const r={},s=gf(t,["moof","traf"]);for(let t=0;t<s.length;t++){const a=s[t],n=gf(a,["tfhd"])[0],o=hf(n,4),l=e[o];if(!l)continue;const c=r[o]||(r[o]={start:NaN,duration:0,sampleCount:0,timescale:l.timescale,type:l.type}),d=gf(a,["tfdt"])[0];if(d){const t=d[0];let e=hf(d,4);1===t&&(e===nf?i.warn("[mp4-demuxer]: Ignoring assumed invalid signed 64-bit track fragment decode time"):(e*=nf+1,e+=hf(d,8))),mg(e)&&(!mg(c.start)||e<c.start)&&(c.start=e)}const h=l.default,p=hf(n,0)|(null==h?void 0:h.flags);let u=(null==h?void 0:h.duration)||0;8&p&&(u=hf(n,2&p?12:8));const g=gf(a,["trun"]);let f=c.start||0,m=0,v=u;for(let t=0;t<g.length;t++){const e=g[t],i=hf(e,4),r=c.sampleCount;c.sampleCount+=i;const s=1&e[3],a=4&e[3],n=1&e[2],o=2&e[2],l=4&e[2],d=8&e[2];let h=8,p=i;for(s&&(h+=4),a&&i&&(1&e[h+1]||void 0!==c.keyFrameIndex||(c.keyFrameIndex=r),h+=4,n?(v=hf(e,h),h+=4):v=u,o&&(h+=4),d&&(h+=4),f+=v,m+=v,p--);p--;)n?(v=hf(e,h),h+=4):v=u,o&&(h+=4),l&&(1&e[h+1]||void 0===c.keyFrameIndex&&(c.keyFrameIndex=c.sampleCount-(p+1),c.keyFrameStart=f),h+=4),d&&(h+=4),f+=v,m+=v;!m&&u&&(m+=u*i)}c.duration+=m}if(!Object.keys(r).some(t=>r[t].duration)){let e=0;const i=gf(t,["sidx"]);for(let t=0;t<i.length;t++){const r=ff(i[t]);if(null!=r&&r.references){const t=r.references.reduce((t,e)=>t+e.info.duration||0,0);e=Math.max(e,t+r.earliestPresentationTime/r.timescale)}}e&&mg(e)&&Object.keys(r).forEach(t=>{r[t].duration||(r[t].duration=e*r[t].timescale-r[t].start)})}return r}(h,u,this),f=u.audio?g[u.audio.id]:null,m=u.video?g[u.video.id]:null,v=ty(m,1/0),b=ty(f,1/0),k=ty(m,0,!0),y=ty(f,0,!0);let w,x=s,S=0;if(f&&(!m||!l&&b<v||l&&l.trackId===u.audio.id)?(p.trackId=u.audio.id,w=f,S=y-b):m&&(p.trackId=u.video.id,w=m,S=k-v),w){const t=w.timescale;x=w.start/t,p.initPTS=w.start-s*t,p.timescale=t,l||(this.initPTS=l={baseTime:p.initPTS,timescale:t,trackId:p.trackId})}!a&&l||!function(t,e,i,r){if(null===t)return!0;const s=Math.max(r,1),a=e-t.baseTime/t.timescale;return Math.abs(a-i)>s}(l,x,s,S)&&p.timescale===l.timescale||(p.initPTS=x-s,p.timescale=1,l&&1===l.timescale&&this.warn(`Adjusting initPTS @${s} from ${l.baseTime/l.timescale} to ${p.initPTS}`),this.initPTS=l={baseTime:p.initPTS,timescale:1});const E=t?x-l.baseTime/l.timescale:c,P=E+S;S>0?this.lastEndTime=P:(this.warn("Duration parsed from mp4 should be greater than zero"),this.resetNextTimestamp());const T=!!u.audio,L=!!u.video;let C="";T&&(C+="audio"),L&&(C+="video");const _={data1:h,startPTS:E,startDTS:E,endPTS:P,endDTS:P,type:C,hasAudio:T,hasVideo:L,nb:1,dropped:0};d.audio=T&&!L?_:void 0,d.video=L?_:void 0;const A=null==m?void 0:m.sampleCount;if(A){const t=m.keyFrameIndex,e=-1!==t;_.nb=A,_.dropped=0===t||this.isVideoContiguous?0:e?t:A,_.independent=e,_.firstKeyFrame=t,e&&m.keyFrameStart&&(_.firstKeyFramePTS=(m.keyFrameStart-l.baseTime)/l.timescale),this.isVideoContiguous||(d.independent=e),this.isVideoContiguous||(this.isVideoContiguous=e),_.dropped&&this.warn(`fmp4 does not start with IDR: firstIDR ${t}/${A} dropped: ${_.dropped} start: ${_.firstKeyFramePTS||"NA"}`)}return d.initSegment=p,d.id3=Xk(i,s,l,l),r.samples.length&&(d.text=Jk(r,s,l)),d}}},{demux:Mk,remux:Zk},{demux:class extends hk{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,e){if(!t)return!1;const i=Vb(t,0);let r=(null==i?void 0:i.length)||0;if(xk(t,r))return!1;for(let i=t.length;r<i;r++)if(Zb(t,r))return e.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)&&qb(t,e)&&Yb(t,e)<=t.length-e}(t,e)}appendFrame(t,e,i){Qb(t,this.observer,e,i,t.manifestCodec);const r=Jb(t,e,i,this.basePTS,this.frameIndex);if(r&&0===r.missing)return r}},remux:Zk},{demux:class extends hk{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=Vb(t,0);let i=(null==e?void 0:e.length)||0;if(e&&11===t[i]&&119===t[i+1]&&void 0!==lk(e)&&Sk(t,i)<=16)return!1;for(let e=t.length;i<e;i++)if(xk(t,i))return zg.log("MPEG Audio sync word found !"),!0;return!1}canParse(t,e){return function(t,e){return yk(t,e)&&4<=t.length-e}(t,e)}appendFrame(t,e,i){if(null!==this.basePTS)return bk(t,e,i,this.basePTS,this.frameIndex)}},remux:Zk}];iy.splice(2,0,{demux:Ek,remux:Zk});class ry{constructor(t,e,i,r,s,a){this.asyncResult=!1,this.logger=void 0,this.observer=void 0,this.typeSupported=void 0,this.config=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.id=s,this.logger=a}configure(t){this.transmuxConfig=t,this.decrypter&&this.decrypter.reset()}push(t,e,i,r){const s=i.transmuxing;s.executeStart=qk();let a=new Uint8Array(t);const{currentTransmuxState:n,transmuxConfig:o}=this;r&&(this.currentTransmuxState=r);const{contiguous:l,discontinuity:c,trackSwitch:d,accurateTimeOffset:h,timeOffset:p,initSegmentChange:u}=r||n,{audioCodec:g,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}(a,e);if(k&&vv(k.method)){const t=this.getDecrypter(),e=bv(k.method);if(!t.isSync())return this.asyncResult=!0,this.decryptionPromise=t.webCryptoDecrypt(a,k.key.buffer,k.iv.buffer,e).then(t=>{const e=this.push(t,null,i);return this.decryptionPromise=null,e}),this.decryptionPromise;{let r=t.softwareDecrypt(a,k.key.buffer,k.iv.buffer,e);if(i.part>-1){const e=t.flush();r=e?e.buffer:e}if(!r)return s.executeEnd=qk(),sy(i);a=new Uint8Array(r)}}const y=this.needsProbing(c,d);if(y){const t=this.configureTransmuxer(a);if(t)return this.logger.warn(`[transmuxer] ${t.message}`),this.observer.emit(wg.ERROR,wg.ERROR,{type:kg.MEDIA_ERROR,details:yg.FRAG_PARSING_ERROR,fatal:!1,error:t,reason:t.message}),s.executeEnd=qk(),sy(i)}(c||d||u||y)&&this.resetInitSegment(b,g,f,v,e),(c||u||y)&&this.resetInitialTimestamp(m),l||this.resetContiguity();const w=this.transmux(a,k,p,h,i);this.asyncResult=ay(w);const x=this.currentTransmuxState;return x.contiguous=!0,x.discontinuity=!1,x.trackSwitch=!1,s.executeEnd=qk(),w}flush(t){const e=t.transmuxing;e.executeStart=qk();const{decrypter:i,currentTransmuxState:r,decryptionPromise:s}=this;if(s)return this.asyncResult=!0,s.then(()=>this.flush(t));const a=[],{timeOffset:n}=r;if(i){const e=i.flush();e&&a.push(this.push(e.buffer,null,t))}const{demuxer:o,remuxer:l}=this;if(!o||!l){e.executeEnd=qk();const i=[sy(t)];return this.asyncResult?Promise.resolve(i):i}const c=o.flush(n);return ay(c)?(this.asyncResult=!0,c.then(e=>(this.flushRemux(a,e,t),a))):(this.flushRemux(a,c,t),this.asyncResult?Promise.resolve(a):a)}flushRemux(t,e,i){const{audioTrack:r,videoTrack:s,id3Track:a,textTrack:n}=e,{accurateTimeOffset:o,timeOffset:l}=this.currentTransmuxState;this.logger.log(`[transmuxer.ts]: Flushed ${this.id} sn: ${i.sn}${i.part>-1?" part: "+i.part:""} of ${this.id===Tg?"level":"track"} ${i.level}`);const c=this.remuxer.remux(r,s,a,n,l,o,!0,this.id);t.push({remuxResult:c,chunkMeta:i}),i.transmuxing.executeEnd=qk()}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,s){const{demuxer:a,remuxer:n}=this;a&&n&&(a.resetInitSegment(t,e,i,r),n.resetInitSegment(t,e,i,s))}destroy(){this.demuxer&&(this.demuxer.destroy(),this.demuxer=void 0),this.remuxer&&(this.remuxer.destroy(),this.remuxer=void 0)}transmux(t,e,i,r,s){let a;return a=e&&"SAMPLE-AES"===e.method?this.transmuxSampleAes(t,e,i,r,s):this.transmuxUnencrypted(t,i,r,s),a}transmuxUnencrypted(t,e,i,r){const{audioTrack:s,videoTrack:a,id3Track:n,textTrack:o}=this.demuxer.demux(t,e,!1,!this.config.progressive);return{remuxResult:this.remuxer.remux(s,a,n,o,e,i,!1,this.id),chunkMeta:r}}transmuxSampleAes(t,e,i,r,s){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:s}))}configureTransmuxer(t){const{config:e,observer:i,typeSupported:r}=this;let s;for(let e=0,i=iy.length;e<i;e++){var a;if(null!=(a=iy[e].demux)&&a.probe(t,this.logger)){s=iy[e];break}}if(!s)return new Error("Failed to find demuxer by probing fragment data");const n=this.demuxer,o=this.remuxer,l=s.remux,c=s.demux;o&&o instanceof l||(this.remuxer=new l(i,e,r,this.logger)),n&&n instanceof c||(this.demuxer=new c(i,e,r,this.logger),this.probe=c.probe)}needsProbing(t,e){return!this.demuxer||!this.remuxer||t||e}getDecrypter(){let t=this.decrypter;return t||(t=this.decrypter=new Wm(this.config)),t}}const sy=t=>({remuxResult:{},chunkMeta:t});function ay(t){return"then"in t&&t.then instanceof Function}class ny{constructor(t,e,i,r,s){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=s||null}}class oy{constructor(t,e,i,r,s,a){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=s,this.initSegmentChange=a}}let ly=0;class cy{constructor(t,e,i,r){this.error=null,this.hls=void 0,this.id=void 0,this.instanceNo=ly++,this.observer=void 0,this.frag=null,this.part=null,this.useWorker=void 0,this.workerContext=null,this.transmuxer=null,this.onTransmuxComplete=void 0,this.onFlush=void 0,this.onWorkerMessage=t=>{const e=t.data,i=this.hls;if(i&&null!=e&&e.event&&e.instanceNo===this.instanceNo)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":i.logger[e.data.logType]&&i.logger[e.data.logType](e.data.message);break;default:e.data=e.data||{},e.data.frag=this.frag,e.data.part=this.part,e.data.id=this.id,i.trigger(e.event,e.data)}},this.onWorkerError=t=>{if(!this.hls)return;const e=new Error(`${t.message} (${t.filename}:${t.lineno})`);this.hls.config.enableWorker=!1,this.hls.logger.warn(`Error in "${this.id}" Web Worker, fallback to inline`),this.hls.trigger(wg.ERROR,{type:kg.OTHER_ERROR,details:yg.INTERNAL_EXCEPTION,fatal:!1,event:"demuxerWorker",error:e})};const s=t.config;this.hls=t,this.id=e,this.useWorker=!!s.enableWorker,this.onTransmuxComplete=i,this.onFlush=r;const a=(t,e)=>{(e=e||{}).frag=this.frag||void 0,t===wg.ERROR&&(e.parent=this.id,e.part=this.part,this.error=e.error),this.hls.trigger(t,e)};this.observer=new Nb,this.observer.on(wg.FRAG_DECRYPTED,a),this.observer.on(wg.ERROR,a);const n=Vf(s.preferManagedMediaSource);if(this.useWorker&&"undefined"!=typeof Worker){const i=this.hls.logger;if(s.workerPath||"function"==typeof __HLS_WORKER_BUNDLE__){try{s.workerPath?(i.log(`loading Web Worker ${s.workerPath} for "${e}"`),this.workerContext=function(t){const e=zb[t];if(e)return e.clientCount++,e;const i=new self.URL(t,self.location.href).href,r={worker:new self.Worker(i),scriptURL:i,clientCount:1};return zb[t]=r,r}(s.workerPath)):(i.log(`injecting Web Worker for "${e}"`),this.workerContext=function(){const t=zb[jb];if(t)return t.clientCount++,t;const e=new self.Blob([`var exports={};var module={exports:exports};function define(f){f()};define.amd=true;(${__HLS_WORKER_BUNDLE__.toString()})(true);`],{type:"text/javascript"}),i=self.URL.createObjectURL(e),r={worker:new self.Worker(i),objectURL:i,clientCount:1};return zb[jb]=r,r}());const{worker:t}=this.workerContext;t.addEventListener("message",this.onWorkerMessage),t.addEventListener("error",this.onWorkerError),t.postMessage({instanceNo:this.instanceNo,cmd:"init",typeSupported:n,id:e,config:cm(s)})}catch(r){i.warn(`Error setting up "${e}" Web Worker, fallback to inline`,r),this.terminateWorker(),this.error=null,this.transmuxer=new ry(this.observer,n,s,"",e,t.logger)}return}}this.transmuxer=new ry(this.observer,n,s,"",e,t.logger)}reset(){if(this.frag=null,this.part=null,this.workerContext){const t=this.instanceNo;this.instanceNo=ly++;const e=this.hls.config,i=Vf(e.preferManagedMediaSource);this.workerContext.worker.postMessage({instanceNo:this.instanceNo,cmd:"reset",resetNo:t,typeSupported:i,id:this.id,config:cm(e)})}}terminateWorker(){if(this.workerContext){const{worker:t}=this.workerContext;this.workerContext=null,t.removeEventListener("message",this.onWorkerMessage),t.removeEventListener("error",this.onWorkerError),function(t){const e=zb[t||jb];if(e&&1===e.clientCount--){const{worker:i,objectURL:r}=e;delete zb[t||jb],r&&self.URL.revokeObjectURL(r),i.terminate()}}(this.hls.config.workerPath)}}destroy(){if(this.workerContext)this.terminateWorker(),this.onWorkerMessage=this.onWorkerError=null;else{const t=this.transmuxer;t&&(t.destroy(),this.transmuxer=null)}const t=this.observer;t&&t.removeAllListeners(),this.frag=null,this.part=null,this.observer=null,this.hls=null}push(t,e,i,r,s,a,n,o,l,c){var d,h;l.transmuxing.start=self.performance.now();const{instanceNo:p,transmuxer:u}=this,g=a?a.start:s.start,f=s.decryptdata,m=this.frag,v=!(m&&s.cc===m.cc),b=!(m&&l.level===m.level),k=m?l.sn-m.sn:-1,y=this.part?l.part-this.part.index:-1,w=0===k&&l.id>1&&l.id===(null==m?void 0:m.stats.chunkCount),x=!b&&(1===k||0===k&&(1===y||w&&y<=0)),S=self.performance.now();(b||k||0===s.stats.parsing.start)&&(s.stats.parsing.start=S),!a||!y&&x||(a.stats.parsing.start=S);const E=!(m&&(null==(d=s.initSegment)?void 0:d.url)===(null==(h=m.initSegment)?void 0:h.url)),P=new oy(v,x,o,b,g,E);if(!x||v||E){this.hls.logger.log(`[transmuxer-interface]: Starting new transmux session for ${s.type} sn: ${l.sn}${l.part>-1?" part: "+l.part:""} ${this.id===Tg?"level":"track"}: ${l.level} id: ${l.id}\n discontinuity: ${v}\n trackSwitch: ${b}\n contiguous: ${x}\n accurateTimeOffset: ${o}\n timeOffset: ${g}\n initSegmentChange: ${E}`);const t=new ny(i,r,e,n,c);this.configureTransmuxer(t)}if(this.frag=s,this.part=a,this.workerContext)this.workerContext.worker.postMessage({instanceNo:p,cmd:"demux",data:t,decryptdata:f,chunkMeta:l,state:P},t instanceof ArrayBuffer?[t]:[]);else if(u){const e=u.push(t,f,l,P);ay(e)?e.then(t=>{this.handleTransmuxComplete(t)}).catch(t=>{this.transmuxerError(t,l,"transmuxer-interface push error")}):this.handleTransmuxComplete(e)}}flush(t){t.transmuxing.start=self.performance.now();const{instanceNo:e,transmuxer:i}=this;if(this.workerContext)this.workerContext.worker.postMessage({instanceNo:e,cmd:"flush",chunkMeta:t});else if(i){const e=i.flush(t);ay(e)?e.then(e=>{this.handleFlushResult(e,t)}).catch(e=>{this.transmuxerError(e,t,"transmuxer-interface flush error")}):this.handleFlushResult(e,t)}}transmuxerError(t,e,i){this.hls&&(this.error=t,this.hls.trigger(wg.ERROR,{type:kg.MEDIA_ERROR,details:yg.FRAG_PARSING_ERROR,chunkMeta:e,frag:this.frag||void 0,part:this.part||void 0,fatal:!1,error:t,err:t,reason:i}))}handleFlushResult(t,e){t.forEach(t=>{this.handleTransmuxComplete(t)}),this.onFlush(e)}configureTransmuxer(t){const{instanceNo:e,transmuxer:i}=this;this.workerContext?this.workerContext.worker.postMessage({instanceNo:e,cmd:"configure",config:t}):i&&i.configure(t)}handleTransmuxComplete(t){t.chunkMeta.transmuxing.end=self.performance.now(),this.onTransmuxComplete(t)}}class dy extends Og{constructor(t,e){super(e,t.logger),this.hls=void 0,this.canLoad=!1,this.timer=-1,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.loadPlaylist()}stopLoad(){this.canLoad=!1,this.clearTimer()}switchParams(t,e,i){const r=null==e?void 0:e.renditionReports;if(r){let s=-1;for(let i=0;i<r.length;i++){const a=r[i];let n;try{n=new self.URL(a.URI,e.url).href}catch(t){this.warn(`Could not construct new URL for Rendition Report: ${t}`),n=a.URI||""}if(n===t){s=i;break}n===t.substring(0,n.length)&&(s=i)}if(-1!==s){const t=r[s],a=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&&sm(i);return new am(a,n>=0?n:void 0,o)}}}loadPlaylist(t){this.clearTimer()}loadingPlaylist(t,e){this.clearTimer()}shouldLoadPlaylist(t){return this.canLoad&&!!t&&!!t.url&&(!t.details||t.details.live)}getUrlWithDirectives(t,e){if(e)try{return e.addDirectives(t)}catch(t){this.warn(`Could not construct new URL with HLS Delivery Directives: ${t}`)}return t}playlistLoaded(t,e,i){const{details:r,stats:s}=e,a=self.performance.now(),n=s.loading.first?Math.max(0,a-s.loading.first):0;r.advancedDateTime=Date.now()-n;const o=this.hls.config.timelineOffset;if(o!==r.appliedTimelineOffset){const t=Math.max(o||0,0);r.appliedTimelineOffset=t,r.fragments.forEach(e=>{e.start=e.playlistOffset+t})}if(r.live||null!=i&&i.live){const o="levelInfo"in e?e.levelInfo:e.track;if(r.reloaded(i),i&&r.fragments.length>0){nb(i,r);const t=r.playlistParsingError;if(t){this.warn(t);const i=this.hls;if(!i.config.ignorePlaylistParsingErrors){var l;const{networkDetails:a}=e;return void i.trigger(wg.ERROR,{type:kg.NETWORK_ERROR,details:yg.LEVEL_PARSING_ERROR,fatal:!1,url:r.url,error:t,reason:t.message,level:e.level||void 0,parent:null==(l=r.fragments[0])?void 0:l.type,networkDetails:a,stats:s})}r.playlistParsingError=null}}-1===r.requestScheduled&&(r.requestScheduled=s.loading.start);const c=this.hls.mainForwardBufferInfo,d=c?c.end-c.len:0,h=db(r,1e3*(r.edge-d));if(r.requestScheduled+h<a?r.requestScheduled=a:r.requestScheduled+=h,this.log(`live playlist ${t} ${r.advanced?"REFRESHED "+r.lastPartSn+"-"+r.lastPartIndex:r.updated?"UPDATED":"MISSED"}`),!this.canLoad||!r.live)return;let p,u,g;if(r.canBlockReload&&r.endSN&&r.advanced){const t=this.hls.config.lowLatencyMode,s=r.lastPartSn,n=r.endSN,l=r.lastPartIndex,c=s===n;-1!==l?c?(u=n+1,g=t?0:l):(u=s,g=t?l+1:r.maxPartIndex):u=n+1;const d=r.age,h=d+r.ageHeader;let f=Math.min(h-r.partTarget,1.5*r.targetduration);if(f>0){if(h>3*r.targetduration)this.log(`Playlist last advanced ${d.toFixed(2)}s ago. Omitting segment and part directives.`),u=void 0,g=void 0;else if(null!=i&&i.tuneInGoal&&h-r.partTarget>i.tuneInGoal)this.warn(`CDN Tune-in goal increased from: ${i.tuneInGoal} to: ${f} with playlist age: ${r.age}`),f=0;else{const t=Math.floor(f/r.targetduration);if(u+=t,void 0!==g){g+=Math.round(f%r.targetduration/r.partTarget)}this.log(`CDN Tune-in age: ${r.ageHeader}s last advanced ${d.toFixed(2)}s goal: ${f} skip sn ${t} to part ${g}`)}r.tuneInGoal=f}if(p=this.getDeliveryDirectives(r,e.deliveryDirectives,u,g),t||!c)return r.requestScheduled=a,void this.loadingPlaylist(o,p)}else(r.canBlockReload||r.canSkipUntil)&&(p=this.getDeliveryDirectives(r,e.deliveryDirectives,u,g));p&&void 0!==u&&r.canBlockReload&&(r.requestScheduled=s.loading.first+Math.max(h-2*n,h/2)),this.scheduleLoading(o,p,r)}else this.clearTimer()}scheduleLoading(t,e,i){const r=i||t.details;if(!r)return void this.loadingPlaylist(t,e);const s=self.performance.now(),a=r.requestScheduled;if(s>=a)return void this.loadingPlaylist(t,e);const n=a-s;this.log(`reload live playlist ${t.name||t.bitrate+"bps"} in ${Math.round(n)} ms`),this.clearTimer(),this.timer=self.setTimeout(()=>this.loadingPlaylist(t,e),n)}getDeliveryDirectives(t,e,i,r){let s=sm(t);return null!=e&&e.skip&&t.deltaUpdateFailed&&(i=e.msn,r=e.part,s=em),new am(i,r,s)}checkRetry(t){const e=t.details,i=Sm(t),r=t.errorAction,{action:s,retryCount:a=0,retryConfig:n}=r||{},o=!!r&&!!n&&(s===Rm||!r.resolved&&s===_m);if(o){var l;if(a>=n.maxNumRetry)return!1;if(i&&null!=(l=t.context)&&l.deliveryDirectives)this.warn(`Retrying playlist loading ${a+1}/${n.maxNumRetry} after "${e}" without delivery-directives`),this.loadPlaylist();else{const t=Pm(n,a);this.clearTimer(),this.timer=self.setTimeout(()=>this.loadPlaylist(),t),this.warn(`Retrying playlist loading ${a+1}/${n.maxNumRetry} after "${e}" in ${t}ms`)}t.levelRetry=!0,r.resolved=!0}return o}}function hy(t,e){if(t.length!==e.length)return!1;for(let i=0;i<t.length;i++)if(!py(t[i].attrs,e[i].attrs))return!1;return!0}function py(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 uy(t,e){return e.label.toLowerCase()===t.name.toLowerCase()&&(!e.language||e.language.toLowerCase()===(t.lang||"").toLowerCase())}class gy{constructor(t){this.tracks=void 0,this.queues={video:[],audio:[],audiovideo:[]},this.tracks=t}destroy(){this.tracks=this.queues=null}append(t,e,i){if(null===this.queues||null===this.tracks)return;const r=this.queues[e];r.push(t),1!==r.length||i||this.executeNext(e)}appendBlocker(t){return new Promise(e=>{const i={label:"async-blocker",execute:e,onStart:()=>{},onComplete:()=>{},onError:()=>{}};this.append(i,t)})}prependBlocker(t){return new Promise(e=>{if(this.queues){const i={label:"async-blocker-prepend",execute:e,onStart:()=>{},onComplete:()=>{},onError:()=>{}};this.queues[t].unshift(i)}})}removeBlockers(){null!==this.queues&&[this.queues.video,this.queues.audio,this.queues.audiovideo].forEach(t=>{var e;const i=null==(e=t[0])?void 0:e.label;"async-blocker"!==i&&"async-blocker-prepend"!==i||(t[0].execute(),t.splice(0,1))})}unblockAudio(t){if(null===this.queues)return;this.queues.audio[0]===t&&this.shiftAndExecuteNext("audio")}executeNext(t){if(null===this.queues||null===this.tracks)return;const e=this.queues[t];if(e.length){const r=e[0];try{r.execute()}catch(e){var i;if(r.onError(e),null===this.queues||null===this.tracks)return;const s=null==(i=this.tracks[t])?void 0:i.buffer;null!=s&&s.updating||this.shiftAndExecuteNext(t)}}}shiftAndExecuteNext(t){null!==this.queues&&(this.queues[t].shift(),this.executeNext(t))}current(t){var e;return(null==(e=this.queues)?void 0:e[t][0])||null}toString(){const{queues:t,tracks:e}=this;return null===t||null===e?"<destroyed>":`\n${this.list("video")}\n${this.list("audio")}\n${this.list("audiovideo")}}`}list(t){var e,i;return null!=(e=this.queues)&&e[t]||null!=(i=this.tracks)&&i[t]?`${t}: (${this.listSbInfo(t)}) ${this.listOps(t)}`:""}listSbInfo(t){var e;const i=null==(e=this.tracks)?void 0:e[t],r=null==i?void 0:i.buffer;return r?`SourceBuffer${r.updating?" updating":""}${i.ended?" ended":""}${i.ending?" ending":""}`:"none"}listOps(t){var e;return(null==(e=this.queues)?void 0:e[t].map(t=>t.label).join(", "))||""}}const fy=/(avc[1234]|hvc1|hev1|dvh[1e]|vp09|av01)(?:\.[^.,]+)+/,my="HlsJsTrackRemovedError";class vy extends Error{constructor(t){super(t),this.name=my}}function by(t){const e=t.querySelectorAll("source");[].slice.call(e).forEach(e=>{t.removeChild(e)})}function ky(t){return"audio"===t?1:0}class yy{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(wg.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),t.on(wg.MEDIA_ATTACHING,this.onMediaAttaching,this),t.on(wg.MANIFEST_PARSED,this.onManifestParsed,this),t.on(wg.LEVELS_UPDATED,this.onLevelsUpdated,this),t.on(wg.BUFFER_CODECS,this.onBufferCodecs,this),t.on(wg.MEDIA_DETACHING,this.onMediaDetaching,this)}unregisterListener(){const{hls:t}=this;t.off(wg.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),t.off(wg.MEDIA_ATTACHING,this.onMediaAttaching,this),t.off(wg.MANIFEST_PARSED,this.onManifestParsed,this),t.off(wg.LEVELS_UPDATED,this.onLevelsUpdated,this),t.off(wg.BUFFER_CODECS,this.onBufferCodecs,this),t.off(wg.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&&mg(this.autoLevelCapping)&&this.detectPlayerSize()}onBufferCodecs(t,e){this.hls.config.capLevelToPlayerSize&&e.video&&this.startCapping()}onMediaDetaching(){this.stopCapping(),this.media=null}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&&e.logger.log(`Setting autoLevelCapping to ${i}: ${t[i].height}p@${t[i].bitrate} for media ${this.mediaWidth}x${this.mediaHeight}`),e.autoLevelCapping=i,e.autoLevelEnabled&&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,yy.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 Math.min(t,this.hls.config.maxDevicePixelRatio)}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;const r=(t,e)=>!e||(t.width!==e.width||t.height!==e.height);let s=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)&&r(i,t[e+1])){s=e;break}}return s}}const wy={MANIFEST:"m",AUDIO:"a",VIDEO:"v",MUXED:"av",INIT:"i",CAPTION:"c",TIMED_TEXT:"tt",KEY:"k",OTHER:"o"},xy={HLS:"h"},Sy="CMCD-Object",Ey="CMCD-Request",Py="CMCD-Session",Ty="CMCD-Status",Ly={[Sy]:["br","d","ot","tb"],[Ey]:["bl","dl","mtp","nor","nrr","su"],[Py]:["cid","pr","sf","sid","st","v"],[Ty]:["bs","rtp"]};class Cy{constructor(t,e){Array.isArray(t)&&(t=t.map(t=>t instanceof Cy?t:new Cy(t))),this.value=t,this.params=e}}function _y(t,e,i,r){return new Error(`failed to ${t} "${s=e,Array.isArray(s)?JSON.stringify(s):s instanceof Map?"Map{}":s instanceof Set?"Set{}":"object"==typeof s?JSON.stringify(s):String(s)}" as ${i}`,{cause:r});var s}function Ay(t,e,i){return _y("serialize",t,e,i)}class Ry{constructor(t){this.description=t}}const Iy="Bare Item";function Dy(t){if(!1===ArrayBuffer.isView(t))throw Ay(t,"Byte Sequence");return`:${e=t,btoa(String.fromCharCode(...e))}:`;var e}function My(t){if(function(t){return t<-999999999999999||999999999999999<t}(t))throw Ay(t,"Integer");return t.toString()}function Oy(t,e){if(t<0)return-Oy(-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 Uy(t){const e=Oy(t,3);if(Math.floor(Math.abs(e)).toString().length>12)throw Ay(t,"Decimal");const i=e.toString();return i.includes(".")?i:`${i}.0`}const $y=/[\x00-\x1f\x7f]+/;function Fy(t){const e=(i=t).description||i.toString().slice(7,-1);var i;if(!1===/^([a-zA-Z*])([!#$%&'*+\-.^_`|~\w:/]*)$/.test(e))throw Ay(e,"Token");return e}function Ny(t){switch(typeof t){case"number":if(!mg(t))throw Ay(t,Iy);return Number.isInteger(t)?My(t):Uy(t);case"string":return function(t){if($y.test(t))throw Ay(t,"String");return`"${t.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}"`}(t);case"symbol":return Fy(t);case"boolean":return function(t){if("boolean"!=typeof t)throw Ay(t,"Boolean");return t?"?1":"?0"}(t);case"object":if(t instanceof Date)return function(t){return`@${My(t.getTime()/1e3)}`}(t);if(t instanceof Uint8Array)return Dy(t);if(t instanceof Ry)return Fy(t);default:throw Ay(t,Iy)}}function jy(t){if(!1===/^[a-z*][a-z0-9\-_.*]*$/.test(t))throw Ay(t,"Key");return t}function zy(t){return null==t?"":Object.entries(t).map(([t,e])=>!0===e?`;${jy(t)}`:`;${jy(t)}=${Ny(e)}`).join("")}function By(t){return t instanceof Cy?`${Ny(t.value)}${zy(t.params)}`:Ny(t)}function Gy(t,e={whitespace:!0}){if("object"!=typeof t)throw Ay(t,"Dict");const i=t instanceof Map?t.entries():Object.entries(t),r=(null==e?void 0:e.whitespace)?" ":"";return Array.from(i).map(([t,e])=>{e instanceof Cy==!1&&(e=new Cy(e));let i=jy(t);var r;return!0===e.value?i+=zy(e.params):(i+="=",Array.isArray(e.value)?i+=`(${(r=e).value.map(By).join(" ")})${zy(r.params)}`:i+=By(e)),i}).join(`,${r}`)}const Hy=t=>Math.round(t),Vy=t=>100*Hy(t/100),qy={br:Hy,d:Hy,bl:Vy,dl:Vy,mtp:Vy,nor:(t,e)=>((null==e?void 0:e.baseUrl)&&(t=function(t,e){const i=new URL(t),r=new URL(e);if(i.origin!==r.origin)return t;const s=i.pathname.split("/").slice(1),a=r.pathname.split("/").slice(1,-1);for(;s[0]===a[0];)s.shift(),a.shift();for(;a.length;)a.shift(),s.unshift("..");return s.join("/")}(t,e.baseUrl)),encodeURIComponent(t)),rtp:Vy,tb:Hy};function Ky(t,e){const i={};if(null==t||"object"!=typeof t)return i;const r=Object.keys(t).sort(),s=Ig({},qy,null==e?void 0:e.formatters),a=null==e?void 0:e.filter;return r.forEach(r=>{if(null==a?void 0:a(r))return;let n=t[r];const o=s[r];o&&(n=o(n,e)),"v"===r&&1===n||"pr"==r&&1===n||function(t){return"number"==typeof t?mg(t):null!=t&&""!==t&&!1!==t}(n)&&(function(t){return"ot"===t||"sf"===t||"st"===t}(r)&&"string"==typeof n&&(n=new Ry(n)),i[r]=n)}),i}function Yy(t,e={}){return t?function(t,e){return Gy(t,e)}(Ky(t,e),Ig({whitespace:!1},e)):""}function Wy(t,e,i){return Ig(t,function(t,e={}){const i={};if(!t)return i;const r=Object.entries(t),s=Object.entries(Ly).concat(Object.entries((null==e?void 0:e.customHeaderMap)||{})),a=r.reduce((t,e)=>{var i,r;const[a,n]=e,o=(null===(i=s.find(t=>t[1].includes(a)))||void 0===i?void 0:i[0])||Ey;return null!==(r=t[o])&&void 0!==r||(t[o]={}),t[o][a]=n,t},{});return Object.entries(a).reduce((t,[i,r])=>(t[i]=Yy(r,e),t),i)}(e,i))}const Zy=/CMCD=[^&#]+/;function Qy(t,e,i){const r=function(t,e={}){if(!t)return"";const i=Yy(t,e);return`CMCD=${encodeURIComponent(i)}`}(e,i);if(!r)return t;if(Zy.test(t))return t.replace(Zy,r);const s=t.includes("?")?"&":"?";return`${t}${s}${r}`}function Xy(t,e,i,r){t&&Object.keys(e).forEach(s=>{const a=t.filter(t=>t.groupId===s).map(t=>{const a=Ig({},t);return a.details=void 0,a.attrs=new pv(a.attrs),a.url=a.attrs.URI=Jy(t.url,t.attrs["STABLE-RENDITION-ID"],"PER-RENDITION-URIS",i),a.groupId=a.attrs["GROUP-ID"]=e[s],a.attrs["PATHWAY-ID"]=r,a});t.push(...a)})}function Jy(t,e,i,r){const{HOST:s,PARAMS:a,[i]:n}=r;let o;e&&(o=null==n?void 0:n[e],o&&(t=o));const l=new self.URL(t);return s&&!o&&(l.host=s),a&&Object.keys(a).sort().forEach(t=>{t&&l.searchParams.set(t,a[t])}),l.href}function tw(t,e,i){ew(t,e,i),t.addEventListener(e,i)}function ew(t,e,i){t.removeEventListener(e,i)}class iw extends Og{constructor(t){super("eme",t.logger),this.hls=void 0,this.config=void 0,this.media=null,this.keyFormatPromise=null,this.keySystemAccessPromises={},this._requestLicenseFailureCount=0,this.mediaKeySessions=[],this.keyIdToKeySessionPromise={},this.mediaKeys=null,this.setMediaKeysQueue=iw.CDMCleanupPromise?[iw.CDMCleanupPromise]:[],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=Ov(this.config));const e=t.map(Mv).filter(t=>!!t);this.keyFormatPromise=this.getKeyFormatPromise(e)}this.keyFormatPromise.then(s=>{const a=Cv(s);let n,o;if("sinf"===e){if(a!==Sv.FAIRPLAY)return void this.warn(`Ignoring unexpected "${t.type}" event with init data type: "${e}" for selected key-system ${a}`);const s=cf(new Uint8Array(i));try{const t=xf(kv(JSON.parse(s).sinf));if(!t)throw new Error("'schm' box missing or not cbcs/cenc with schi > tenc");n=new Uint8Array(t.subarray(8,24)),o=Sv.FAIRPLAY}catch(t){return void this.warn(`${r} Failed to parse sinf: ${t}`)}}else{if(a!==Sv.WIDEVINE&&a!==Sv.PLAYREADY)return void this.warn(`Ignoring unexpected "${t.type}" event with init data type: "${e}" for selected key-system ${a}`);const s=function(t){const e=[];if(t instanceof ArrayBuffer){const i=t.byteLength;let r=0;for(;r+32<i;){const i=Af(new DataView(t,r));e.push(i),r+=i.size}}return e}(i),l=s.filter(t=>!!t.systemId&&Dv(t.systemId)===a);l.length>1&&this.warn(`${r} Using first of ${l.length} pssh found for selected key-system ${a}`);const c=l[0];if(!c)return void(0===s.length||s.some(t=>!t.systemId)?this.warn(`${r} contains incomplete or invalid pssh data`):this.log(`ignoring ${r} for ${s.map(t=>Dv(t.systemId)).join(",")} pssh data in favor of playlist keys`));if(o=Dv(c.systemId),0===c.version&&c.data)if(o===Sv.WIDEVINE){const t=c.data.length-22;n=new Uint8Array(c.data.subarray(t,t+16))}else o===Sv.PLAYREADY&&(n=Fv(c.data))}if(!o||!n)return;const l=Vg(n),{keyIdToKeySessionPromise:c,mediaKeySessions:d}=this;let h=c[l];for(let t=0;t<d.length;t++){const r=d[t],s=r.decryptdata;if(!s.keyId)continue;const a=Vg(s.keyId);if(l===a||-1!==s.uri.replace(/-/g,"").indexOf(l)){if(h=c[a],s.pssh)break;delete c[a],s.pssh=new Uint8Array(i),s.keyId=n,h=c[l]=h.then(()=>this.generateRequestWithPreferredKeySession(r,e,i,"encrypted-event-key-match")),h.catch(t=>this.handleError(t));break}}if(!h){if(o!==a)return void this.log(`Ignoring "${t.type}" event with ${o} init data for selected key-system ${a}`);h=c[l]=this.getKeySystemSelectionPromise([o]).then(({keySystem:t,mediaKeys:r})=>{var s;this.throwIfDestroyed();const a=new jv("ISO-23001-7",l,null!=(s=Mv(t))?s:"");return a.pssh=new Uint8Array(i),a.keyId=n,this.attemptSetMediaKeys(t,r).then(()=>{this.throwIfDestroyed();const s=this.createMediaKeySessionContext({decryptdata:a,keySystem:t,mediaKeys:r});return this.generateRequestWithPreferredKeySession(s,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.onDestroying(),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(wg.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(wg.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.on(wg.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.on(wg.MANIFEST_LOADED,this.onManifestLoaded,this),this.hls.on(wg.DESTROYING,this.onDestroying,this)}unregisterListeners(){this.hls.off(wg.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.off(wg.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.off(wg.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.off(wg.MANIFEST_LOADED,this.onManifestLoaded,this),this.hls.off(wg.DESTROYING,this.onDestroying,this)}getLicenseServerUrl(t){const{drmSystems:e,widevineLicenseUrl:i}=this.config,r=e[t];return r?r.licenseUrl:t===Sv.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),s=e.map(t=>t.videoCodec).filter(i);return r.length+s.length===0&&s.push("avc1.42e01e"),new Promise((e,i)=>{const a=t=>{const n=t.shift();this.getMediaKeysPromise(n,r,s).then(t=>e({keySystem:n,mediaKeys:t})).catch(e=>{t.length?a(t):i(e instanceof rw?e:new rw({type:kg.KEY_SYSTEM_ERROR,details:yg.KEY_SYSTEM_NO_ACCESS,error:e,fatal:!0},e.message))})};a(t)})}requestMediaKeySystemAccess(t,e){const{requestMediaKeySystemAccessFunc:i}=this.config;if("function"!=typeof i){let t=`Configured requestMediaKeySystemAccess is not a function ${i}`;return null===Uv&&"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 s;switch(t){case Sv.FAIRPLAY:s=["cenc","sinf"];break;case Sv.WIDEVINE:case Sv.PLAYREADY:s=["cenc"];break;case Sv.CLEARKEY:s=["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}))}]}(s,e,i,r)}(t,e,i,this.config.drmSystemOptions),s=this.keySystemAccessPromises[t];let a=null==s?void 0:s.keySystemAccess;if(!a){this.log(`Requesting encrypted media "${t}" key-system access with config: ${cm(r)}`),a=this.requestMediaKeySystemAccess(t,r);const e=this.keySystemAccessPromises[t]={keySystemAccess:a};return a.catch(e=>{this.log(`Failed to obtain access to key-system "${t}": ${e}`)}),a.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(i=>(this.log(`Media-keys created for "${t}"`),e.hasMediaKeys=!0,r.then(e=>e?this.setMediaKeysServerCertificate(i,t,e):i))),e.mediaKeys.catch(e=>{this.error(`Failed to create media-keys for "${t}"}: ${e}`)}),e.mediaKeys})}return a.then(()=>s.mediaKeys)}createMediaKeySessionContext({decryptdata:t,keySystem:e,mediaKeys:i}){this.log(`Creating key-system session "${e}" keyId: ${Vg(t.keyId||[])}`);const r=i.createSession(),s={decryptdata:t,keySystem:e,mediaKeys:i,mediaKeysSession:r,keyStatus:"status-pending"};return this.mediaKeySessions.push(s),s}renewKeySession(t){const e=t.decryptdata;if(e.pssh){const i=this.createMediaKeySessionContext(t),r=this.getKeyIdString(e),s="cenc";this.keyIdToKeySessionPromise[r]=this.generateRequestWithPreferredKeySession(i,s,e.pssh.buffer,"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 Vg(t.keyId)}updateKeySession(t,e){var i;const r=t.mediaKeysSession;return this.log(`Updating key-session "${r.sessionId}" for keyID ${Vg((null==(i=t.decryptdata)?void 0:i.keyId)||[])}\n } (data length: ${e?e.byteLength:e})`),r.update(e)}getSelectedKeySystemFormats(){return Object.keys(this.keySystemAccessPromises).map(t=>({keySystem:t,hasMediaKeys:this.keySystemAccessPromises[t].hasMediaKeys})).filter(({hasMediaKeys:t})=>!!t).map(({keySystem:t})=>Mv(t)).filter(t=>!!t)}getKeySystemAccess(t){return this.getKeySystemSelectionPromise(t).then(({keySystem:t,mediaKeys:e})=>this.attemptSetMediaKeys(t,e))}selectKeySystem(t){return new Promise((e,i)=>this.getKeySystemSelectionPromise(t).then(({keySystem:t})=>{const r=Mv(t);r?e(r):i(new Error(`Unable to find format for key-system "${t}"`))}).catch(i))}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){const e=Ov(this.config),i=t.map(Cv).filter(t=>!!t&&-1!==e.indexOf(t));return this.selectKeySystem(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 s=this.keyIdToKeySessionPromise[i];if(!s){s=this.getKeySystemForKeyPromise(e).then(({keySystem:i,mediaKeys:s})=>(this.throwIfDestroyed(),this.log(`Handle encrypted media sn: ${t.frag.sn} ${t.frag.type}: ${t.frag.level} using key ${r}`),this.attemptSetMediaKeys(i,s).then(()=>(this.throwIfDestroyed(),this.createMediaKeySessionContext({keySystem:i,mediaKeys:s,decryptdata:e})))));(this.keyIdToKeySessionPromise[i]=s.then(t=>{const i=e.pssh?e.pssh.buffer:null;return this.generateRequestWithPreferredKeySession(t,"cenc",i,"playlist-key")})).catch(t=>this.handleError(t))}return s}throwIfDestroyed(t="Invalid state"){if(!this.hls)throw new Error("invalid state")}handleError(t){this.hls&&(this.error(t.message),t instanceof rw?this.hls.trigger(wg.ERROR,t.data):this.hls.trigger(wg.ERROR,{type:kg.KEY_SYSTEM_ERROR,details:yg.KEY_SYSTEM_NO_KEYS,error:t,fatal:!0}))}getKeySystemForKeyPromise(t){const e=this.getKeyIdString(t),i=this.keyIdToKeySessionPromise[e];if(!i){const e=Cv(t.keyFormat),i=e?[e]:Ov(this.config);return this.attemptKeySystemAccess(i)}return i}getKeySystemSelectionPromise(t){if(t.length||(t=Ov(this.config)),0===t.length)throw new rw({type:kg.KEY_SYSTEM_ERROR,details:yg.KEY_SYSTEM_NO_CONFIGURED_LICENSE,fatal:!0},`Missing key-system license configuration options ${cm({drmSystems:this.config.drmSystems})}`);return this.attemptKeySystemAccess(t)}attemptSetMediaKeys(t,e){if(this.mediaKeys===e)return Promise.resolve();const i=this.setMediaKeysQueue.slice();this.log(`Setting media-keys for "${t}"`);const r=Promise.all(i).then(()=>{if(!this.media)throw this.mediaKeys=null,new Error("Attempted to set mediaKeys without media element attached");return this.media.setMediaKeys(e)});return this.mediaKeys=e,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 s,a;const n=null==(s=this.config.drmSystems)||null==(a=s[t.keySystem])?void 0:a.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=r.initData?r.initData:null,t.decryptdata.pssh=i?new Uint8Array(i):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 l=this.getKeyIdString(t.decryptdata);this.log(`Generating key-session request for "${r}": ${l} (init data type: ${e} length: ${i?i.byteLength:null})`);const c=new Nb,d=t._onmessage=e=>{const i=t.mediaKeysSession;if(!i)return void c.emit("error",new Error("invalid state"));const{messageType:r,message:s}=e;this.log(`"${r}" message event for session "${i.sessionId}" message size: ${s.byteLength}`),"license-request"===r||"license-renewal"===r?this.renewLicense(t,s).catch(t=>{c.eventNames().length?c.emit("error",t):this.handleError(t)}):"license-release"===r?t.keySystem===Sv.FAIRPLAY&&(this.updateKeySession(t,yv("acknowledged")),this.removeSession(t)):this.warn(`unhandled media key message type "${r}"`)},h=t._onkeystatuseschange=e=>{if(!t.mediaKeysSession)return void c.emit("error",new Error("invalid state"));this.onKeyStatusChange(t);const i=t.keyStatus;c.emit("keyStatus",i),"expired"===i&&(this.warn(`${t.keySystem} expired for key ${l}`),this.renewKeySession(t))};tw(t.mediaKeysSession,"message",d),tw(t.mediaKeysSession,"keystatuseschange",h);const p=new Promise((t,e)=>{c.on("error",e),c.on("keyStatus",i=>{i.startsWith("usable")?t():"output-restricted"===i?e(new rw({type:kg.KEY_SYSTEM_ERROR,details:yg.KEY_SYSTEM_STATUS_OUTPUT_RESTRICTED,fatal:!1},"HDCP level output restricted")):"internal-error"===i?e(new rw({type:kg.KEY_SYSTEM_ERROR,details:yg.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: ${l}`)}).catch(t=>{throw new rw({type:kg.KEY_SYSTEM_ERROR,details:yg.KEY_SYSTEM_NO_SESSION,error:t,fatal:!1},`Error generating key-session request: ${t}`)}).then(()=>p).catch(e=>{throw c.removeAllListeners(),this.removeSession(t),e}).then(()=>(c.removeAllListeners(),t))}onKeyStatusChange(t){t.mediaKeysSession.keyStatuses.forEach((e,i)=>{if("string"==typeof i&&"object"==typeof e){const t=i;i=e,e=t}this.log(`key status change "${e}" for keyStatuses keyId: ${Vg("buffer"in i?new Uint8Array(i.buffer,i.byteOffset,i.byteLength):new Uint8Array(i))} session keyId: ${Vg(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((s,a)=>{const n={responseType:"arraybuffer",url:r},o=e.certLoadPolicy.default,l={loadPolicy:o,timeout:o.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0},c={onSuccess:(t,e,i,r)=>{s(t.data)},onError:(e,i,s,o)=>{a(new rw({type:kg.KEY_SYSTEM_ERROR,details:yg.KEY_SYSTEM_SERVER_CERTIFICATE_REQUEST_FAILED,fatal:!0,networkDetails:s,response:Mg({url:n.url,data:void 0},e)},`"${t}" certificate request failed (${r}). Status: ${e.code} (${e.text})`))},onTimeout:(e,i,s)=>{a(new rw({type:kg.KEY_SYSTEM_ERROR,details:yg.KEY_SYSTEM_SERVER_CERTIFICATE_REQUEST_FAILED,fatal:!0,networkDetails:s,response:{url:n.url,data:void 0}},`"${t}" certificate request timed out (${r})`))},onAbort:(t,e,i)=>{a(new Error("aborted"))}};i.load(n,l,c)})):Promise.resolve()}setMediaKeysServerCertificate(t,e,i){return new Promise((r,s)=>{t.setServerCertificate(i).then(s=>{this.log(`setServerCertificate ${s?"success":"not supported by CDM"} (${null==i?void 0:i.byteLength}) on "${e}"`),r(t)}).catch(t=>{s(new rw({type:kg.KEY_SYSTEM_ERROR,details:yg.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 rw({type:kg.KEY_SYSTEM_ERROR,details:yg.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"),s=r.querySelectorAll("HttpHeader");if(s.length>0){let e;for(let i=0,r=s.length;i<r;i++){var a,n;e=s[i];const r=null==(a=e.querySelector("name"))?void 0:a.textContent,o=null==(n=e.querySelector("value"))?void 0:n.textContent;r&&o&&t.setRequestHeader(r,o)}}const o=r.querySelector("Challenge"),l=null==o?void 0:o.textContent;if(!l)throw new Error("Cannot find <Challenge> in key message");return yv(atob(l))}setupLicenseXHR(t,e,i,r){const s=this.config.licenseXhrSetup;return s?Promise.resolve().then(()=>{if(!i.decryptdata)throw new Error("Key removed");return s.call(this.hls,t,e,i,r)}).catch(a=>{if(!i.decryptdata)throw a;return t.open("POST",e,!0),s.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,s)=>{const a=this.getLicenseServerUrlOrThrow(t.keySystem);this.log(`Sending license request to URL: ${a}`);const n=new XMLHttpRequest;n.responseType="arraybuffer",n.onreadystatechange=()=>{if(!this.hls||!t.mediaKeysSession)return s(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,a,t)}catch(t){this.error(t)}r(e)}else{const o=i.errorRetry,l=o?o.maxNumRetry:0;if(this._requestLicenseFailureCount++,this._requestLicenseFailureCount>l||n.status>=400&&n.status<500)s(new rw({type:kg.KEY_SYSTEM_ERROR,details:yg.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0,networkDetails:n,response:{url:a,data:void 0,code:n.status,text:n.statusText}},`License Request XHR failed (${a}). Status: ${n.status} (${n.statusText})`));else{const i=l-this._requestLicenseFailureCount+1;this.warn(`Retrying license request, ${i} attempts left`),this.requestLicense(t,e).then(r,s)}}},t.licenseXhr&&t.licenseXhr.readyState!==XMLHttpRequest.DONE&&t.licenseXhr.abort(),t.licenseXhr=n,this.setupLicenseXHR(n,a,t,e).then(({xhr:e,licenseChallenge:i})=>{t.keySystem==Sv.PLAYREADY&&(i=this.unpackPlayReadyKeyMessage(e,i)),e.send(i)})})}onDestroying(){this.unregisterListeners(),this._clear()}onMediaAttached(t,e){if(!this.config.emeEnabled)return;const i=e.media;this.media=i,tw(i,"encrypted",this.onMediaEncrypted),tw(i,"waitingforkey",this.onWaitingForKey)}onMediaDetached(){const t=this.media;t&&(ew(t,"encrypted",this.onMediaEncrypted),ew(t,"waitingforkey",this.onWaitingForKey),this.media=null,this.mediaKeys=null)}_clear(){var t;if(this._requestLicenseFailureCount=0,this.keyIdToKeySessionPromise={},!this.mediaKeys&&!this.mediaKeySessions.length)return;const e=this.media,i=this.mediaKeySessions.slice();this.mediaKeySessions=[],this.mediaKeys=null,jv.clearKeyUriToKeyIdMap();const r=i.length;iw.CDMCleanupPromise=Promise.all(i.map(t=>this.removeSession(t)).concat(null==e||null==(t=e.setMediaKeys(null))?void 0:t.catch(t=>{var e;this.log(`Could not clear media keys: ${t}`),null==(e=this.hls)||e.trigger(wg.ERROR,{type:kg.OTHER_ERROR,details:yg.KEY_SYSTEM_DESTROY_MEDIA_KEYS_ERROR,fatal:!1,error:new Error(`Could not clear media keys: ${t}`)})}))).catch(t=>{var e;this.log(`Could not close sessions and clear media keys: ${t}`),null==(e=this.hls)||e.trigger(wg.ERROR,{type:kg.OTHER_ERROR,details:yg.KEY_SYSTEM_DESTROY_CLOSE_SESSION_ERROR,fatal:!1,error:new Error(`Could not close sessions and clear media keys: ${t}`)})}).then(()=>{r&&this.log("finished closing key sessions and clearing media keys")})}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);r>-1&&this.mediaKeySessions.splice(r,1);const{drmSystemOptions:s}=this.config,a=function(t){var e;return"persistent-license"===t.sessionType||!(null==(e=t.sessionTypes)||!e.some(t=>"persistent-license"===t))}(s)?new Promise((t,i)=>{self.setTimeout(()=>i(new Error("MediaKeySession.remove() timeout")),8e3),e.remove().then(t)}):Promise.resolve();return a.catch(t=>{var e;this.log(`Could not remove session: ${t}`),null==(e=this.hls)||e.trigger(wg.ERROR,{type:kg.OTHER_ERROR,details:yg.KEY_SYSTEM_DESTROY_REMOVE_SESSION_ERROR,fatal:!1,error:new Error(`Could not remove session: ${t}`)})}).then(()=>e.close()).catch(t=>{var e;this.log(`Could not close session: ${t}`),null==(e=this.hls)||e.trigger(wg.ERROR,{type:kg.OTHER_ERROR,details:yg.KEY_SYSTEM_DESTROY_CLOSE_SESSION_ERROR,fatal:!1,error:new Error(`Could not close session: ${t}`)})})}}}iw.CDMCleanupPromise=void 0;class rw 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}}function sw(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 aw(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){zg.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){zg.debug(`[texttrack-utils]: Legacy TextTrackCue fallback failed: ${t}`)}}"disabled"===i&&(t.mode=i)}function nw(t,e){const i=t.mode;if("disabled"===i&&(t.mode="hidden"),t.cues)for(let i=t.cues.length;i--;)e&&t.cues[i].removeEventListener("enter",e),t.removeCue(t.cues[i]);"disabled"===i&&(t.mode=i)}function ow(t,e,i,r){const s=t.mode;if("disabled"===s&&(t.mode="hidden"),t.cues&&t.cues.length>0){const s=function(t,e,i){const r=[],s=function(t,e){if(e<=t[0].startTime)return 0;const i=t.length-1;if(e>t[i].endTime)return-1;let r,s=0,a=i;for(;s<=a;)if(r=Math.floor((a+s)/2),e<t[r].startTime)a=r-1;else{if(!(e>t[r].startTime&&s<i))return r;s=r+1}return t[s].startTime-e<e-t[a].startTime?s:a}(t,e);if(s>-1)for(let a=s,n=t.length;a<n;a++){const s=t[a];if(s.startTime>=e&&s.endTime<=i)r.push(s);else if(s.startTime>i)return r}return r}(t.cues,e,i);for(let e=0;e<s.length;e++)r&&!r(s[e])||t.removeCue(s[e])}"disabled"===s&&(t.mode=s)}function lw(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}function cw(t){let e=5381,i=t.length;for(;i;)e=33*e^t.charCodeAt(--i);return(e>>>0).toString()}const dw=.025;let hw=function(t){return t[t.Point=0]="Point",t[t.Range=1]="Range",t}({});function pw(t,e,i){return`${t.identifier}-${i+1}-${cw(e)}`}class uw{constructor(t,e){this.base=void 0,this._duration=null,this._timelineStart=null,this.appendInPlaceDisabled=void 0,this.appendInPlaceStarted=void 0,this.dateRange=void 0,this.hasPlayed=!1,this.cumulativeDuration=0,this.resumeOffset=NaN,this.playoutLimit=NaN,this.restrictions={skip:!1,jump:!1},this.snapOptions={out:!1,in:!1},this.assetList=[],this.assetListLoader=void 0,this.assetListResponse=null,this.resumeAnchor=void 0,this.error=void 0,this.resetOnResume=void 0,this.base=e,this.dateRange=t,this.setDateRange(t)}setDateRange(t){this.dateRange=t,this.resumeOffset=t.attr.optionalFloat("X-RESUME-OFFSET",this.resumeOffset),this.playoutLimit=t.attr.optionalFloat("X-PLAYOUT-LIMIT",this.playoutLimit),this.restrictions=t.attr.enumeratedStringList("X-RESTRICT",this.restrictions),this.snapOptions=t.attr.enumeratedStringList("X-SNAP",this.snapOptions)}reset(){var t;this.appendInPlaceStarted=!1,null==(t=this.assetListLoader)||t.destroy(),this.assetListLoader=void 0,this.supplementsPrimary||(this.assetListResponse=null,this.assetList=[],this._duration=null)}isAssetPastPlayoutLimit(t){var e;if(t>0&&t>=this.assetList.length)return!0;const i=this.playoutLimit;if(t<=0||isNaN(i))return!1;if(0===i)return!0;return((null==(e=this.assetList[t])?void 0:e.startOffset)||0)>i}findAssetIndex(t){return this.assetList.indexOf(t)}get identifier(){return this.dateRange.id}get startDate(){return this.dateRange.startDate}get startTime(){const t=this.dateRange.startTime;if(this.snapOptions.out){const e=this.dateRange.tagAnchor;if(e)return gw(t,e)}return t}get startOffset(){return this.cue.pre?0:this.startTime}get startIsAligned(){if(0===this.startTime||this.snapOptions.out)return!0;const t=this.dateRange.tagAnchor;if(t){const e=this.dateRange.startTime;return e-gw(e,t)<.1}return!1}get resumptionOffset(){const t=this.resumeOffset,e=mg(t)?t:this.duration;return this.cumulativeDuration+e}get resumeTime(){const t=this.startOffset+this.resumptionOffset;if(this.snapOptions.in){const e=this.resumeAnchor;if(e)return gw(t,e)}return t}get appendInPlace(){return!!this.appendInPlaceStarted||!this.appendInPlaceDisabled&&!(this.cue.once||this.cue.pre||!this.startIsAligned||!(isNaN(this.playoutLimit)&&isNaN(this.resumeOffset)||this.resumeOffset&&this.duration&&Math.abs(this.resumeOffset-this.duration)<dw))}set appendInPlace(t){this.appendInPlaceStarted?this.resetOnResume=!t:this.appendInPlaceDisabled=!t}get timelineStart(){return null!==this._timelineStart?this._timelineStart:this.startTime}set timelineStart(t){this._timelineStart=t}get duration(){const t=this.playoutLimit;let e;return e=null!==this._duration?this._duration:this.dateRange.duration?this.dateRange.duration:this.dateRange.plannedDuration||0,!isNaN(t)&&t<e&&(e=t),e}set duration(t){this._duration=t}get cue(){return this.dateRange.cue}get timelineOccupancy(){return"RANGE"===this.dateRange.attr["X-TIMELINE-OCCUPIES"]?hw.Range:hw.Point}get supplementsPrimary(){return"PRIMARY"===this.dateRange.attr["X-TIMELINE-STYLE"]}get contentMayVary(){return"NO"!==this.dateRange.attr["X-CONTENT-MAY-VARY"]}get assetUrl(){return this.dateRange.attr["X-ASSET-URI"]}get assetListUrl(){return this.dateRange.attr["X-ASSET-LIST"]}get baseUrl(){return this.base.url}get assetListLoaded(){return this.assetList.length>0||null!==this.assetListResponse}toString(){return`["${(t=this).identifier}" ${t.cue.pre?"<pre>":t.cue.post?"<post>":""}${t.timelineStart.toFixed(2)}-${t.resumeTime.toFixed(2)}]`;var t}}function gw(t,e){return t-e.start<e.duration/2&&!(Math.abs(t-(e.start+e.duration))<dw)?e.start:e.start+e.duration}function fw(t,e,i){const r=new self.URL(t,i);return"data:"!==r.protocol&&r.searchParams.set("_HLS_primary_id",e),r}function mw(t,e){for(;null!=(i=t.assetList[++e])&&i.error;)var i;return e}function vw(t){const e=t.timelineStart,i=t.duration||0;return`["${t.identifier}" ${e.toFixed(2)}-${(e+i).toFixed(2)}]`}class bw{constructor(t,e,i,r){this.hls=void 0,this.interstitial=void 0,this.assetItem=void 0,this.tracks=null,this.hasDetails=!1,this.mediaAttached=null,this._currentTime=void 0,this._bufferedEosTime=void 0,this.checkPlayout=()=>{this.reachedPlayout(this.currentTime)&&this.hls.trigger(wg.PLAYOUT_LIMIT_REACHED,{})};const s=this.hls=new t(e);this.interstitial=i,this.assetItem=r;let a=r.uri;try{a=fw(a,e.primarySessionId).href}catch(t){}s.loadSource(a);const n=()=>{this.hasDetails=!0};s.once(wg.LEVEL_LOADED,n),s.once(wg.AUDIO_TRACK_LOADED,n),s.once(wg.SUBTITLE_TRACK_LOADED,n),s.on(wg.MEDIA_ATTACHING,(t,{media:e})=>{this.removeMediaListeners(),this.mediaAttached=e;this.interstitial.playoutLimit&&(e.addEventListener("timeupdate",this.checkPlayout),this.appendInPlace&&s.on(wg.BUFFER_APPENDED,()=>{const t=this.bufferedEnd;this.reachedPlayout(t)&&(this._bufferedEosTime=t,s.trigger(wg.BUFFERED_TO_END,void 0))}))})}get appendInPlace(){var t;return(null==(t=this.interstitial)?void 0:t.appendInPlace)||!1}bufferedInPlaceToEnd(t){var e;if(!this.appendInPlace)return!1;if(null!=(e=this.hls)&&e.bufferedToEnd)return!0;if(!t||!this._bufferedEosTime)return!1;const i=this.timelineOffset,r=sv.bufferInfo(t,i,0);return this.getAssetTime(r.end)>=this._bufferedEosTime-.02}reachedPlayout(t){const e=this.interstitial.playoutLimit;return this.startOffset+t>=e}get destroyed(){var t;return!(null!=(t=this.hls)&&t.userConfig)}get assetId(){return this.assetItem.identifier}get interstitialId(){return this.assetItem.parentIdentifier}get media(){var t;return(null==(t=this.hls)?void 0:t.media)||null}get bufferedEnd(){const t=this.media||this.mediaAttached;if(!t)return this._bufferedEosTime?this._bufferedEosTime:this.currentTime;const e=sv.bufferInfo(t,t.currentTime,.001);return this.getAssetTime(e.end)}get currentTime(){const t=this.media||this.mediaAttached;return t?this.getAssetTime(t.currentTime):this._currentTime||0}get duration(){const t=this.assetItem.duration;return t||0}get remaining(){const t=this.duration;return t?Math.max(0,t-this.currentTime):0}get startOffset(){return this.assetItem.startOffset}get timelineOffset(){var t;return(null==(t=this.hls)?void 0:t.config.timelineOffset)||0}set timelineOffset(t){const e=this.timelineOffset;if(t!==e){const i=t-e;if(Math.abs(i)>1/9e4){if(this.hasDetails)throw new Error("Cannot set timelineOffset after playlists are loaded");this.hls.config.timelineOffset=t}}}getAssetTime(t){const e=this.timelineOffset,i=this.duration;return Math.min(Math.max(0,t-e),i)}removeMediaListeners(){const t=this.mediaAttached;t&&(this._currentTime=t.currentTime,this.bufferSnapShot(),t.removeEventListener("timeupdate",this.checkPlayout))}bufferSnapShot(){var t;this.mediaAttached&&(null!=(t=this.hls)&&t.bufferedToEnd&&(this._bufferedEosTime=this.bufferedEnd))}destroy(){this.removeMediaListeners(),this.hls.destroy(),this.hls=this.interstitial=null,this.tracks=this.mediaAttached=this.checkPlayout=null}attachMedia(t){this.hls.attachMedia(t)}detachMedia(){this.removeMediaListeners(),this.mediaAttached=null,this.hls.detachMedia()}resumeBuffering(){this.hls.resumeBuffering()}pauseBuffering(){this.hls.pauseBuffering()}transferMedia(){return this.bufferSnapShot(),this.hls.transferMedia()}resetDetails(){const t=this.hls;if(this.hasDetails){t.stopLoad();const e=t=>delete t.details;t.levels.forEach(e),t.allAudioTracks.forEach(e),t.allSubtitleTracks.forEach(e),this.hasDetails=!1}}on(t,e,i){this.hls.on(t,e)}once(t,e,i){this.hls.once(t,e)}off(t,e,i){this.hls.off(t,e)}toString(){var t;return`HlsAssetPlayer: ${vw(this.assetItem)} ${null==(t=this.hls)?void 0:t.sessionId} ${this.appendInPlace?"append-in-place":""}`}}class kw extends Og{constructor(t,e){super("interstitials-sched",e),this.onScheduleUpdate=void 0,this.eventMap={},this.events=null,this.items=null,this.durations={primary:0,playout:0,integrated:0},this.onScheduleUpdate=t}destroy(){this.reset(),this.onScheduleUpdate=null}reset(){this.eventMap={},this.setDurations(0,0,0),this.events&&this.events.forEach(t=>t.reset()),this.events=this.items=null}resetErrorsInRange(t,e){return this.events?this.events.reduce((i,r)=>t<=r.startOffset&&e>r.startOffset?(delete r.error,i+1):i,0):0}get duration(){const t=this.items;return t?t[t.length-1].end:0}get length(){return this.items?this.items.length:0}getEvent(t){return t&&this.eventMap[t]||null}hasEvent(t){return t in this.eventMap}findItemIndex(t,e){if(t.event)return this.findEventIndex(t.event.identifier);let i=-1;t.nextEvent?i=this.findEventIndex(t.nextEvent.identifier)-1:t.previousEvent&&(i=this.findEventIndex(t.previousEvent.identifier)+1);const r=this.items;if(r)for(r[i]||(void 0===e&&(e=t.start),i=this.findItemIndexAtTime(e));i>=0&&null!=(s=r[i])&&s.event;){var s;i--}return i}findItemIndexAtTime(t,e){const i=this.items;if(i)for(let r=0;r<i.length;r++){let s=i[r];if(e&&"primary"!==e&&(s=s[e]),t===s.start||t>s.start&&t<s.end)return r}return-1}findJumpRestrictedIndex(t,e){const i=this.items;if(i)for(let r=t;r<=e&&i[r];r++){const t=i[r].event;if(null!=t&&t.restrictions.jump&&!t.appendInPlace)return r}return-1}findEventIndex(t){const e=this.items;if(e)for(let r=e.length;r--;){var i;if((null==(i=e[r].event)?void 0:i.identifier)===t)return r}return-1}findAssetIndex(t,e){const i=t.assetList,r=i.length;if(r>1)for(let t=0;t<r;t++){const r=i[t];if(!r.error){const i=r.timelineStart;if(e===i||e>i&&e<i+(r.duration||0))return t}}return 0}get assetIdAtEnd(){var t,e;const i=null==(t=this.items)||null==(e=t[this.length-1])?void 0:e.event;if(i){const t=i.assetList,e=t[t.length-1];if(e)return e.identifier}return null}parseInterstitialDateRanges(t,e){const i=t.main.details,{dateRanges:r}=i,s=this.events,a=this.parseDateRanges(r,{url:i.url},e),n=Object.keys(r),o=s?s.filter(t=>!n.includes(t.identifier)):[];a.length&&a.sort((t,e)=>{const i=t.cue.pre,r=t.cue.post,s=e.cue.pre,a=e.cue.post;if(i&&!s)return-1;if(s&&!i)return 1;if(r&&!a)return 1;if(a&&!r)return-1;if(!(i||s||r||a)){const i=t.startTime,r=e.startTime;if(i!==r)return i-r}return t.dateRange.tagOrder-e.dateRange.tagOrder}),this.events=a,o.forEach(t=>{this.removeEvent(t)}),this.updateSchedule(t,o)}updateSchedule(t,e=[]){const i=this.events||[];if(i.length||e.length||this.length<2){const r=this.items,s=this.parseSchedule(i,t);(e.length||(null==r?void 0:r.length)!==s.length||s.some((t,e)=>Math.abs(t.playout.start-r[e].playout.start)>.005||Math.abs(t.playout.end-r[e].playout.end)>.005))&&(this.items=s,this.onScheduleUpdate(e,r))}}parseDateRanges(t,e,i){const r=[],s=Object.keys(t);for(let a=0;a<s.length;a++){const n=s[a],o=t[n];if(o.isInterstitial){let t=this.eventMap[n];t?t.setDateRange(o):(t=new uw(o,e),this.eventMap[n]=t,!1===i&&(t.appendInPlace=i)),r.push(t)}}return r}parseSchedule(t,e){const i=[],r=e.main.details,s=r.live?1/0:r.edge;let a=0;if((t=t.filter(t=>!(t.error||t.cue.once&&t.hasPlayed))).length){this.resolveOffsets(t,e);let r=0,o=0;if(t.forEach((e,n)=>{const l=e.cue.pre,c=e.cue.post,d=t[n-1]||null,h=e.appendInPlace,p=c?s:e.startOffset,u=e.duration,g=e.timelineOccupancy===hw.Range?u:0,f=e.resumptionOffset,m=(null==d?void 0:d.startTime)===p,v=p+e.cumulativeDuration;let b=h?v+u:p+f;if(l||!c&&p<=0){const t=o;o+=g,e.timelineStart=v;const r=a;a+=u,i.push({event:e,start:v,end:b,playout:{start:r,end:a},integrated:{start:t,end:o}})}else{if(!(p<=s))return;{if(!m){const s=p-r;if(s>.033){const l=r,c=o;o+=s;const d=a;a+=s;const h={previousEvent:t[n-1]||null,nextEvent:e,start:l,end:l+s,playout:{start:d,end:a},integrated:{start:c,end:o}};i.push(h)}else s>0&&d&&(d.cumulativeDuration+=s,i[i.length-1].end=p)}c&&(b=v),e.timelineStart=v;const s=o;o+=g;const l=a;a+=u,i.push({event:e,start:v,end:b,playout:{start:l,end:a},integrated:{start:s,end:o}})}}const k=e.resumeTime;r=c||k>s?s:k}),r<s){var n;const t=r,e=o,l=s-r;o+=l;const c=a;a+=l,i.push({previousEvent:(null==(n=i[i.length-1])?void 0:n.event)||null,nextEvent:null,start:r,end:t+l,playout:{start:c,end:a},integrated:{start:e,end:o}})}this.setDurations(s,a,o)}else{const t=0;i.push({previousEvent:null,nextEvent:null,start:t,end:s,playout:{start:t,end:s},integrated:{start:t,end:s}}),this.setDurations(s,s,s)}return i}setDurations(t,e,i){this.durations={primary:t,playout:e,integrated:i}}resolveOffsets(t,e){const i=e.main.details,r=i.live?1/0:i.edge;let s=0,a=-1;t.forEach((n,o)=>{const l=n.cue.pre,c=n.cue.post,d=l?0:c?r:n.startTime;this.updateAssetDurations(n);if(a===d?n.cumulativeDuration=s:(s=0,a=d),!c&&n.snapOptions.in&&(n.resumeAnchor=km(null,i.fragments,n.startOffset+n.resumptionOffset,0,0)||void 0),n.appendInPlace&&!n.appendInPlaceStarted){this.primaryCanResumeInPlaceAt(n,e)||(n.appendInPlace=!1)}if(!n.appendInPlace&&o+1<t.length){t[o+1].startTime-t[o].resumeTime<.033&&(t[o+1].appendInPlace=!1,t[o+1].appendInPlace&&this.warn(`Could not change append strategy for abutting event ${n}`))}const h=mg(n.resumeOffset)?n.resumeOffset:n.duration;s+=h})}primaryCanResumeInPlaceAt(t,e){const i=t.resumeTime,r=t.startTime+t.resumptionOffset;if(Math.abs(i-r)>dw)return this.log(`"${t.identifier}" resumption ${i} not aligned with estimated timeline end ${r}`),!1;if(!e)return this.log(`"${t.identifier}" resumption ${i} can not be aligned with media (none selected)`),!1;return!Object.keys(e).some(r=>{const s=e[r].details,a=s.edge;if(i>=a)return this.log(`"${t.identifier}" resumption ${i} past ${r} playlist end ${a}`),!1;const n=km(null,s.fragments,i);if(!n)return this.log(`"${t.identifier}" resumption ${i} does not align with any fragments in ${r} playlist (${s.fragStart}-${s.fragmentEnd})`),!0;const o="audio"===r?.175:0;return!(Math.abs(n.start-i)<dw+o||Math.abs(n.end-i)<dw+o)&&(this.log(`"${t.identifier}" resumption ${i} not aligned with ${r} fragment bounds (${n.start}-${n.end} sn: ${n.sn} cc: ${n.cc})`),!0)})}updateAssetDurations(t){if(!t.assetListLoaded)return;const e=t.timelineStart;let i=0,r=!1,s=!1;t.assetList.forEach((t,a)=>{const n=e+i;t.startOffset=i,t.timelineStart=n,r||(r=null===t.duration),s||(s=!!t.error);const o=t.error?0:t.duration||0;i+=o}),t.duration=r&&!s?Math.max(i,t.duration):i}removeEvent(t){t.reset(),delete this.eventMap[t.identifier]}}function yw(t){return`[${t.event?'"'+t.event.identifier+'"':"primary"}: ${t.start.toFixed(2)}-${t.end.toFixed(2)}]`}class ww{constructor(t){this.hls=void 0,this.hls=t}destroy(){this.hls=null}loadAssetList(t,e){const i=t.assetListUrl;let r;try{r=fw(i,this.hls.sessionId,t.baseUrl)}catch(e){const r=this.assignAssetListError(t,yg.ASSET_LIST_LOAD_ERROR,e,i);return void this.hls.trigger(wg.ERROR,r)}e&&"data:"!==r.protocol&&r.searchParams.set("_HLS_start_offset",""+e);const s=this.hls.config,a=new(0,s.loader)(s),n={responseType:"json",url:r.href},o=s.interstitialAssetListLoadPolicy.default,l={loadPolicy:o,timeout:o.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0},c={onSuccess:(e,i,r,s)=>{const a=e.data,n=null==a?void 0:a.ASSETS;if(!Array.isArray(n)){const e=this.assignAssetListError(t,yg.ASSET_LIST_PARSING_ERROR,new Error("Invalid interstitial asset list"),r.url,i,s);return void this.hls.trigger(wg.ERROR,e)}t.assetListResponse=a,this.hls.trigger(wg.ASSET_LIST_LOADED,{event:t,assetListResponse:a,networkDetails:s})},onError:(e,i,r,s)=>{const a=this.assignAssetListError(t,yg.ASSET_LIST_LOAD_ERROR,new Error(`Error loading X-ASSET-LIST: HTTP status ${e.code} ${e.text} (${i.url})`),i.url,s,r);this.hls.trigger(wg.ERROR,a)},onTimeout:(e,i,r)=>{const s=this.assignAssetListError(t,yg.ASSET_LIST_LOAD_TIMEOUT,new Error(`Timeout loading X-ASSET-LIST (${i.url})`),i.url,e,r);this.hls.trigger(wg.ERROR,s)}};return a.load(n,l,c),this.hls.trigger(wg.ASSET_LIST_LOADING,{event:t}),a}assignAssetListError(t,e,i,r,s,a){return t.error=i,{type:kg.NETWORK_ERROR,details:e,fatal:!1,interstitial:t,url:r,error:i,networkDetails:a,stats:s}}}function xw(t){null==t||t.play().catch(()=>{})}class Sw{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)}}}const Ew={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},Pw=t=>String.fromCharCode(Ew[t]||t),Tw=15,Lw=100,Cw={17:1,18:3,21:5,22:7,23:9,16:11,19:12,20:14},_w={17:2,18:4,21:6,22:8,23:10,19:13,20:15},Aw={25:1,26:3,29:5,30:7,31:9,24:11,27:12,28:14},Rw={25:2,26:4,29:6,30:8,31:10,27:13,28:15},Iw=["white","green","blue","cyan","red","yellow","magenta","black","transparent"];class Dw{constructor(){this.time=null,this.verboseLevel=0}log(t,e){if(this.verboseLevel>=t){const i="function"==typeof e?e():e;zg.log(`${this.time} [${t}] ${i}`)}}}const Mw=function(t){const e=[];for(let i=0;i<t.length;i++)e.push(t[i].toString(16));return e};class Ow{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 Uw{constructor(){this.uchar=" ",this.penState=new Ow}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 $w{constructor(t){this.chars=[],this.pos=0,this.currPenState=new Ow,this.cueStartTime=null,this.logger=void 0;for(let t=0;t<Lw;t++)this.chars.push(new Uw);this.logger=t}equals(t){for(let e=0;e<Lw;e++)if(!this.chars[e].equals(t.chars[e]))return!1;return!0}copy(t){for(let e=0;e<Lw;e++)this.chars[e].copy(t.chars[e])}isEmpty(){let t=!0;for(let e=0;e<Lw;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>Lw&&(this.logger.log(3,"Too large cursor position "+this.pos),this.pos=Lw)}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=Pw(t);this.pos>=Lw?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<Lw;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<Lw;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 Fw{constructor(t){this.rows=[],this.currRow=14,this.nrRollUpRows=null,this.lastOutputScreen=null,this.logger=void 0;for(let e=0;e<Tw;e++)this.rows.push(new $w(t));this.logger=t}reset(){for(let t=0;t<Tw;t++)this.rows[t].clear();this.currRow=14}equals(t){let e=!0;for(let i=0;i<Tw;i++)if(!this.rows[i].equals(t.rows[i])){e=!1;break}return e}copy(t){for(let e=0;e<Tw;e++)this.rows[e].copy(t.rows[e])}isEmpty(){let t=!0;for(let e=0;e<Tw;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 = "+cm(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<Tw;t++)this.rows[t].clear();const t=this.currRow+1-this.nrRollUpRows,i=this.lastOutputScreen;if(i){const r=i.rows[t].cueStartTime,s=this.logger.time;if(null!==r&&null!==s&&r<s)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 = "+cm(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<Tw;i++){const s=this.rows[i].getTextString();s&&(r=i+1,t?e.push("Row "+r+": '"+s+"'"):e.push(s.trim()))}return e.length>0&&(i=t?"["+e.join(" | ")+"]":e.join("\n")),i}getTextAndFormat(){return this.rows}}class Nw{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 Fw(i),this.nonDisplayedMemory=new Fw(i),this.lastOutputScreen=new Fw(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: "+cm(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 jw{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 Dw;this.channels=[null,new Nw(t,e,r),new Nw(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 s=!1,a=null;if(0===i&&0===r)continue;this.logger.log(3,()=>"["+Mw([e[t],e[t+1]])+"] -> ("+Mw([i,r])+")");const n=this.cmdHistory;if(i>=16&&i<=31){if(Bw(i,r,n)){zw(null,null,n),this.logger.log(3,()=>"Repeated command ("+Mw([i,r])+") is dropped");continue}zw(i,r,this.cmdHistory),s=this.parseCmd(i,r),s||(s=this.parseMidrow(i,r)),s||(s=this.parsePAC(i,r)),s||(s=this.parseBackgroundAttributes(i,r))}else zw(null,null,n);if(!s&&(a=this.parseChars(i,r),a)){const t=this.currentChannel;if(t&&t>0){this.channels[t].insertChars(a)}else this.logger.log(2,"No channel found yet. TEXT-MODE?")}s||a||this.logger.log(2,()=>"Couldn't parse cleaned data "+Mw([i,r])+" orig: "+Mw([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 ("+Mw([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?Cw[t]:Aw[t]:1===r?_w[t]:Rw[t];const s=this.channels[r];return!!s&&(s.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,s=null;if(t>=25?(i=2,s=t-8):(i=1,s=t),s>=17&&s<=19){let t;t=17===s?e+80:18===s?e+112:e+144,this.logger.log(2,()=>"Special char '"+Pw(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 = "+Mw(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=Iw[i],e%2==1&&(r.background=r.background+"_semi")):45===e?r.background="transparent":(r.foreground="black",47===e&&(r.underline=!0));const s=t<=23?1:2;return this.channels[s].setBkgData(r),!0}reset(){for(let t=0;t<Object.keys(this.channels).length;t++){const e=this.channels[t];e&&e.reset()}zw(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 zw(t,e,i){i.a=t,i.b=e}function Bw(t,e,i){return i.a===t&&i.b===e}var Gw=function(){if(null!=xv&&xv.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 s(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 a(e,a,n){const o=this,l={enumerable:!0};o.hasBeenReset=!1;let c="",d=!1,h=e,p=a,u=n,g=null,f="",m=!0,v="auto",b="start",k=50,y="middle",w=50,x="middle";Object.defineProperty(o,"id",s({},l,{get:function(){return c},set:function(t){c=""+t}})),Object.defineProperty(o,"pauseOnExit",s({},l,{get:function(){return d},set:function(t){d=!!t}})),Object.defineProperty(o,"startTime",s({},l,{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",s({},l,{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",s({},l,{get:function(){return u},set:function(t){u=""+t,this.hasBeenReset=!0}})),Object.defineProperty(o,"region",s({},l,{get:function(){return g},set:function(t){g=t,this.hasBeenReset=!0}})),Object.defineProperty(o,"vertical",s({},l,{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",s({},l,{get:function(){return m},set:function(t){m=!!t,this.hasBeenReset=!0}})),Object.defineProperty(o,"line",s({},l,{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",s({},l,{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",s({},l,{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",s({},l,{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",s({},l,{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",s({},l,{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 a.prototype.getCueAsHTML=function(){return self.WebVTT.convertCueToDOMTree(self,this.text)},a}();class Hw{decode(t,e){if(!t)return"";if("string"!=typeof t)throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(t))}}function Vw(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 qw{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 Kw(t,e,i,r){const s=r?t.split(r):[t];for(const t in s){if("string"!=typeof s[t])continue;const r=s[t].split(i);if(2!==r.length)continue;e(r[0],r[1])}}const Yw=new Gw(0,0,""),Ww="middle"===Yw.align?"middle":"center";function Zw(t,e,i){const r=t;function s(){const e=Vw(t);if(null===e)throw new Error("Malformed timestamp: "+r);return t=t.replace(/^[^\sa-zA-Z-]+/,""),e}function a(){t=t.replace(/^\s+/,"")}if(a(),e.startTime=s(),a(),"--\x3e"!==t.slice(0,3))throw new Error("Malformed time stamp (time stamps must be separated by '--\x3e'): "+r);t=t.slice(3),a(),e.endTime=s(),a(),function(t,e){const r=new qw;Kw(t,function(t,e){let s;switch(t){case"region":for(let s=i.length-1;s>=0;s--)if(i[s].id===e){r.set(t,i[s].region);break}break;case"vertical":r.alt(t,e,["rl","lr"]);break;case"line":s=e.split(","),r.integer(t,s[0]),r.percent(t,s[0])&&r.set("snapToLines",!1),r.alt(t,s[0],["auto"]),2===s.length&&r.alt("lineAlign",s[1],["start",Ww,"end"]);break;case"position":s=e.split(","),r.percent(t,s[0]),2===s.length&&r.alt("positionAlign",s[1],["start",Ww,"end","line-left","line-right","auto"]);break;case"size":r.percent(t,e);break;case"align":r.alt(t,e,["start",Ww,"end","left","right"])}},/:/,/\s/),e.region=r.get("region",null),e.vertical=r.get("vertical","");let s=r.get("line","auto");"auto"===s&&-1===Yw.line&&(s=-1),e.line=s,e.lineAlign=r.get("lineAlign","start"),e.snapToLines=r.get("snapToLines",!0),e.size=r.get("size",100),e.align=r.get("align",Ww);let a=r.get("position","auto");"auto"===a&&50===Yw.position&&(a="start"===e.align||"left"===e.align?0:"end"===e.align||"right"===e.align?100:50),e.position=a}(t,e)}function Qw(t){return t.replace(/<br(?: \/)?>/gi,"\n")}class Xw{constructor(){this.state="INITIAL",this.buffer="",this.decoder=new Hw,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=Qw(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}function r(t){Kw(t,function(t,e){},/:/)}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 s=!1;for(;e.buffer;){if(!/\r\n|\n/.test(e.buffer))return this;switch(s?s=!1:t=i(),e.state){case"HEADER":/:/.test(t)?r(t):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 Gw(0,0,""),e.state="CUE",-1===t.indexOf("--\x3e")){e.cue.id=t;continue}case"CUE":if(!e.cue){e.state="BADCUE";continue}try{Zw(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&&(s=!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 Jw=/\r\n|\n\r|\n|\r/g,tx=function(t,e,i=0){return t.slice(i,i+e.length)===e};function ex(t,e,i){return cw(t.toString())+cw(e.toString())+cw(i)}function ix(t,e,i,r,s,a,n){const o=new Xw,l=Hg(new Uint8Array(t)).trim().replace(Jw,"\n").split("\n"),c=[],d=e?function(t,e=1){return Hk(t,9e4,1/e)}(e.baseTime,e.timescale):0;let h,p="00:00.000",u=0,g=0,f=!0;o.oncue=function(t){const a=i[r];let n=i.ccOffset;const o=(u-d)/9e4;if(null!=a&&a.new&&(void 0!==g?n=i.ccOffset=a.start:function(t,e,i){let r=t[e],s=t[r.prevCC];if(!s||!s.new&&r.new)return t.ccOffset=t.presentationOffset=r.start,void(r.new=!1);for(;null!=(a=s)&&a.new;){var a;t.ccOffset+=r.start-s.start,r.new=!1,r=s,s=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 l=t.endTime-t.startTime,p=Qk(9e4*(t.startTime+n-g),9e4*s)/9e4;t.startTime=Math.max(p,0),t.endTime=Math.max(p+l,0);const f=t.text.trim();t.text=decodeURIComponent(encodeURIComponent(f)),t.id||(t.id=ex(t.startTime,t.endTime,f)),t.endTime>0&&c.push(t)},o.onparsingerror=function(t){h=t},o.onflush=function(){h?n(h):a(c)},l.forEach(t=>{if(f){if(tx(t,"X-TIMESTAMP-MAP=")){f=!1,t.slice(16).split(",").forEach(t=>{tx(t,"LOCAL:")?p=t.slice(6):tx(t,"MPEGTS:")&&(u=parseInt(t.slice(7)))});try{g=function(t){let e=parseInt(t.slice(-3));const i=parseInt(t.slice(-6,-4)),r=parseInt(t.slice(-9,-7)),s=t.length>9?parseInt(t.substring(0,t.indexOf(":"))):0;if(!(mg(e)&&mg(i)&&mg(r)&&mg(s)))throw Error(`Malformed X-TIMESTAMP-MAP: Local:${t}`);return e+=1e3*i,e+=6e4*r,e+=36e5*s,e}(p)/1e3}catch(t){h=t}return}""===t&&(f=!1)}o.parse(t+"\n")}),o.flush()}const rx="stpp.ttml.im1t",sx=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,ax=/^(\d*(?:\.\d*)?)(h|m|s|ms|f|t)$/,nx={left:"start",center:"center",right:"end",start:"start",end:"end"};function ox(t,e,i,r){const s=gf(new Uint8Array(t),["mdat"]);if(0===s.length)return void r(new Error("Could not parse IMSC1 mdat"));const a=s.map(t=>Hg(t)),n=function(t,e,i=1,r=!1){return Hk(t,e,1/i,r)}(e.baseTime,1,e.timescale);try{a.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 s={frameRate:30,subFrameRate:1,frameRateMultiplier:0,tickRate:0},a=Object.keys(s).reduce((t,e)=>(t[e]=r.getAttribute(`ttp:${e}`)||s[e],t),{}),n="preserve"!==r.getAttribute("xml:space"),o=cx(lx(r,"styling","style")),l=cx(lx(r,"layout","region")),c=lx(r,"body","[begin]");return[].map.call(c,t=>{const i=dx(t,n);if(!i||!t.hasAttribute("begin"))return null;const r=ux(t.getAttribute("begin"),a),s=ux(t.getAttribute("dur"),a);let c=ux(t.getAttribute("end"),a);if(null===r)throw px(t);if(null===c){if(null===s)throw px(t);c=r+s}const d=new Gw(r-e,c-e,i);d.id=ex(d.startTime,d.endTime,d.text);const h=function(t,e,i){const r="http://www.w3.org/ns/ttml#styling";let s=null;const a=["displayAlign","textAlign","color","backgroundColor","fontSize","fontFamily"],n=null!=t&&t.hasAttribute("style")?t.getAttribute("style"):null;n&&i.hasOwnProperty(n)&&(s=i[n]);return a.reduce((i,a)=>{const n=hx(e,r,a)||hx(t,r,a)||hx(s,r,a);return n&&(i[a]=n),i},{})}(l[t.getAttribute("region")],o[t.getAttribute("style")],o),{textAlign:p}=h;if(p){const t=nx[p];t&&(d.lineAlign=t),d.align=p}return Ig(d,h),d}).filter(t=>null!==t)}(t,n)))}catch(t){r(t)}}function lx(t,e,i){const r=t.getElementsByTagName(e)[0];return r?[].slice.call(r.querySelectorAll(i)):[]}function cx(t){return t.reduce((t,e)=>{const i=e.getAttribute("xml:id");return i&&(t[i]=e),t},{})}function dx(t,e){return[].slice.call(t.childNodes).reduce((t,i,r)=>{var s;return"br"===i.nodeName&&r?t+"\n":null!=(s=i.childNodes)&&s.length?dx(i,e):e?t+i.textContent.trim().replace(/\s+/g," "):t+i.textContent},"")}function hx(t,e,i){return t&&t.hasAttributeNS(e,i)?t.getAttributeNS(e,i):null}function px(t){return new Error(`Could not parse ttml timestamp ${t}`)}function ux(t,e){if(!t)return null;let i=Vw(t);return null===i&&(sx.test(t)?i=function(t,e){const i=sx.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):ax.test(t)&&(i=function(t,e){const i=ax.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}class gx{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}}function fx(t){return t.characteristics&&/transcribes-spoken-dialog/gi.test(t.characteristics)&&/describes-music-and-sound/gi.test(t.characteristics)?"captions":"subtitles"}function mx(t,e){return!!t&&t.kind===fx(e)&&uy(e,t)}function vx(t,e,i,r){return Math.min(e,r)-Math.max(t,i)}const bx=/\s/,kx={newCue(t,e,i,r){const s=[];let a,n,o,l,c;const d=self.VTTCue||self.TextTrackCue;for(let p=0;p<r.rows.length;p++)if(a=r.rows[p],o=!0,l=0,c="",!a.isEmpty()){var h;for(let t=0;t<a.chars.length;t++)bx.test(a.chars[t].uchar)&&o?l++:(c+=a.chars[t].uchar,o=!1);a.cueStartTime=e,e===i&&(i+=1e-4),l>=16?l--:l++;const r=Qw(c.trim()),u=ex(e,i,r);null!=t&&null!=(h=t.cues)&&h.getCueById(u)||(n=new d(e,i,r),n.id=u,n.line=p+1,n.align="left",n.position=10+Math.min(80,10*Math.floor(8*l/32)),s.push(n))}return t&&s.length&&(s.sort((t,e)=>"auto"===t.line||"auto"===e.line?0:t.line>8&&e.line>8?e.line-t.line:t.line-e.line),s.forEach(e=>aw(t,e))),s}};const yx=/(\d+)-(\d+)\/(\d+)/;class wx{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||xx,this.controller=new self.AbortController,this.stats=new Zg}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 s=function(t,e){const i={method:"GET",mode:"cors",credentials:"same-origin",signal:e,headers:new self.Headers(Ig({},t.headers))};t.rangeEnd&&i.headers.set("Range","bytes="+t.rangeStart+"-"+String(t.rangeEnd-1));return i}(t,this.controller.signal),a="arraybuffer"===t.responseType,n=a?"byteLength":"length",{maxTimeToFirstByteMs:o,maxLoadTimeMs:l}=e.loadPolicy;this.context=t,this.config=e,this.callbacks=i,this.request=this.fetchSetup(t,s),self.clearTimeout(this.requestTimeout),e.timeout=o&&mg(o)?o:l,this.requestTimeout=self.setTimeout(()=>{this.callbacks&&(this.abortInternal(),this.callbacks.onTimeout(r,t,this.response))},e.timeout);(ay(this.request)?this.request.then(self.fetch):self.fetch(this.request)).then(i=>{var s;this.response=this.loader=i;const n=Math.max(self.performance.now(),r.loading.start);if(self.clearTimeout(this.requestTimeout),e.timeout=l,this.requestTimeout=self.setTimeout(()=>{this.callbacks&&(this.abortInternal(),this.callbacks.onTimeout(r,t,this.response))},l-(n-r.loading.start)),!i.ok){const{status:t,statusText:e}=i;throw new Sx(e||"fetch, bad network response",t,i)}r.loading.first=n,r.total=function(t){const e=t.get("Content-Range");if(e){const t=function(t){const e=yx.exec(t);if(e)return parseInt(e[2])-parseInt(e[1])+1}(e);if(mg(t))return t}const i=t.get("Content-Length");if(i)return parseInt(i)}(i.headers)||r.total;const o=null==(s=this.callbacks)?void 0:s.onProgress;return o&&mg(e.highWaterMark)?this.loadProgressively(i,r,t,e.highWaterMark,o):a?i.arrayBuffer():"json"===t.responseType?i.json():i.text()}).then(i=>{var s,a;const o=this.response;if(!o)throw new Error("loader destroyed");self.clearTimeout(this.requestTimeout),r.loading.end=Math.max(self.performance.now(),r.loading.first);const l=i[n];l&&(r.loaded=r.total=l);const c={url:o.url,data:i,code:o.status},d=null==(s=this.callbacks)?void 0:s.onProgress;d&&!mg(e.highWaterMark)&&d(r,t,i,o),null==(a=this.callbacks)||a.onSuccess(c,r,t,o)}).catch(e=>{var i;if(self.clearTimeout(this.requestTimeout),r.aborted)return;const s=e&&e.code||0,a=e?e.message:null;null==(i=this.callbacks)||i.onError({code:s,text:a},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,s){const a=new Ob,n=t.body.getReader(),o=()=>n.read().then(n=>{if(n.done)return a.dataLength&&s(e,i,a.flush().buffer,t),Promise.resolve(new ArrayBuffer(0));const l=n.value,c=l.length;return e.loaded+=c,c<r||a.dataLength?(a.push(l),a.dataLength>=r&&s(e,i,a.flush().buffer,t)):s(e,i,l.buffer,t),o()}).catch(()=>Promise.reject());return o()}}function xx(t,e){return new self.Request(t.url,e)}class Sx extends Error{constructor(t,e,i){super(t),this.code=void 0,this.details=void 0,this.code=e,this.details=i}}const Ex=/^age:\s*[\d.]+\s*$/im;class Px{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 Zg,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 s=this.xhrSetup;s?Promise.resolve().then(()=>{if(this.loader===i&&!this.stats.aborted)return s(i,e.url)}).catch(t=>{if(this.loader===i&&!this.stats.aborted)return i.open("GET",e.url,!0),s(i,e.url)}).then(()=>{this.loader!==i||this.stats.aborted||this.openAndSendXhr(i,e,t)}).catch(t=>{var s;null==(s=this.callbacks)||s.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:s,maxLoadTimeMs:a}=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=s&&mg(s)?s:a,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,s=this.config;if(!i.aborted&&r>=2&&(0===i.loading.first&&(i.loading.first=Math.max(self.performance.now(),i.loading.start),s.timeout!==s.loadPolicy.maxLoadTimeMs&&(self.clearTimeout(this.requestTimeout),s.timeout=s.loadPolicy.maxLoadTimeMs,this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),s.loadPolicy.maxLoadTimeMs-(i.loading.first-i.loading.start)))),4===r)){self.clearTimeout(this.requestTimeout),e.onreadystatechange=null,e.onprogress=null;const r=e.status,l="text"===e.responseType?e.responseText:null;if(r>=200&&r<300){const s=null!=l?l:e.response;if(null!=s){var a,n;i.loading.end=Math.max(self.performance.now(),i.loading.first);const o="arraybuffer"===e.responseType?s.byteLength:s.length;i.loaded=i.total=o,i.bwEstimate=8e3*i.total/(i.loading.end-i.loading.first);const l=null==(a=this.callbacks)?void 0:a.onProgress;l&&l(i,t,s,e);const c={url:e.responseURL,data:s,code:r};return void(null==(n=this.callbacks)||n.onSuccess(c,i,t,e))}}const c=s.loadPolicy.errorRetry;var o;if(Lm(c,i.retry,!1,{url:t.url,data:void 0,code:r}))this.retry(c);else zg.error(`${r} while loading ${t.url}`),null==(o=this.callbacks)||o.onError({code:r,text:e.statusText},t,e,i)}}loadtimeout(){if(!this.config)return;const t=this.config.loadPolicy.timeoutRetry;if(Lm(t,this.stats.retry,!0))this.retry(t);else{var e;zg.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=Pm(t,i.retry),i.retry++,zg.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&&Ex.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 Tx=Mg(Mg({autoStartLoad:!0,startPosition:-1,defaultAudioCodec:void 0,debug:!1,capLevelOnFPSDrop:!1,capLevelToPlayerSize:!1,ignoreDevicePixelRatio:!1,maxDevicePixelRatio:Number.POSITIVE_INFINITY,preferManagedMediaSource:!0,initialLiveManifestSize:1,maxBufferLength:30,backBufferLength:1/0,frontBufferFlushThreshold:1/0,startOnSegmentBoundary:!1,maxBufferSize:6e7,maxFragLookUpTolerance:.25,maxBufferHole:.1,detectStallWithCurrentTimeMs:1250,highBufferWatchdogPeriod:2,nudgeOffset:.1,nudgeMaxRetry:3,nudgeOnVideoHole:!0,liveSyncMode:"edge",liveSyncDurationCount:3,liveSyncOnStallIncrease:1,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,ignorePlaylistParsingErrors:!1,loader:Px,fLoader:void 0,pLoader:void 0,xhrSetup:void 0,licenseXhrSetup:void 0,licenseResponseCallback:void 0,abrController:class extends Og{constructor(t){super("abr",t.logger),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.rebufferNotice=-1,this.supportedCache={},this.bwEstimator=void 0,this._abandonRulesCheck=t=>{var e;const{fragCurrent:i,partCurrent:r,hls:s}=this,{autoLevelEnabled:a,media:n}=s;if(!i||!n)return;const o=performance.now(),l=r?r.stats:i.stats,c=r?r.duration:i.duration,d=o-l.loading.start,h=s.minAutoLevel,p=i.level,u=this._nextAutoLevel;if(l.aborted||l.loaded&&l.loaded===l.total||p<=h)return this.clearTimer(),void(this._nextAutoLevel=-1);if(!a)return;const g=u>-1&&u!==p,f=!!t||g;if(!f&&(n.paused||!n.playbackRate||!n.readyState))return;const m=s.mainForwardBufferInfo;if(!f&&null===m)return;const v=this.bwEstimator.getEstimateTTFB(),b=Math.abs(n.playbackRate);if(d<=Math.max(v,c/(2*b)*1e3))return;const k=m?m.len/b:0,y=l.loading.first?l.loading.first-l.loading.start:-1,w=l.loaded&&y>-1,x=this.getBwEstimate(),S=s.levels,E=S[p],P=Math.max(l.loaded,Math.round(c*(i.bitrate||E.averageBitrate)/8));let T=w?d-y:d;T<1&&w&&(T=Math.min(d,8*l.loaded/x));const L=w?1e3*l.loaded/T:0,C=v/1e3,_=L?(P-l.loaded)/L:8*P/x+C;if(_<=k)return;const A=L?8*L:x,R=!0===(null==(e=(null==t?void 0:t.details)||this.hls.latestLevelDetails)?void 0:e.live),I=this.hls.config.abrBandWidthUpFactor;let D,M=Number.POSITIVE_INFINITY;for(D=p-1;D>h;D--){const t=S[D].maxBitrate,e=!S[D].details||R;if(M=this.getTimeToLoadFrag(C,A,c*t,e),M<Math.min(k,c+C))break}if(M>=_)return;if(M>10*c)return;w?this.bwEstimator.sample(d-Math.min(v,y),l.loaded):this.bwEstimator.sampleTTFB(d);const O=S[D].maxBitrate;this.getBwEstimate()*I>O&&this.resetEstimator(O);const U=this.findBestLevel(O,h,D,0,k,1,1);U>-1&&(D=U),this.warn(`Fragment ${i.sn}${r?" part "+r.index:""} of level ${p} is loading too slowly;\n Fragment duration: ${i.duration.toFixed(3)}\n Time to underbuffer: ${k.toFixed(3)} s\n Estimated load time for current fragment: ${_.toFixed(3)} s\n Estimated load time for down switch fragment: ${M.toFixed(3)} s\n TTFB estimate: ${0|y} ms\n Current BW estimate: ${mg(x)?0|x:"Unknown"} bps\n New BW estimate: ${0|this.getBwEstimate()} bps\n Switching to level ${D} @ ${0|O} bps`),s.nextLoadLevel=s.nextAutoLevel=D,this.clearTimer();const $=()=>{if(this.clearTimer(),this.fragCurrent===i&&this.hls.loadLevel===D&&D>0){const t=this.getStarvationDelay();if(this.warn(`Aborting inflight request ${D>0?"and switching down":""}\n Fragment duration: ${i.duration.toFixed(3)} s\n Time to underbuffer: ${t.toFixed(3)} s`),i.abortRequests(),this.fragCurrent=this.partCurrent=null,D>h){let e=this.findBestLevel(this.hls.levels[h].bitrate,h,D,0,t,1,1);-1===e&&(e=h),this.hls.nextLoadLevel=this.hls.nextAutoLevel=e,this.resetEstimator(this.hls.levels[e].bitrate)}}};g||_>2*M?$():this.timer=self.setInterval($,1e3*M),s.trigger(wg.FRAG_LOAD_EMERGENCY_ABORTED,{frag:i,part:r,stats:l})},this.hls=t,this.bwEstimator=this.initEstimator(),this.registerListeners()}resetEstimator(t){t&&(this.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 Ag(t.abrEwmaSlowVoD,t.abrEwmaFastVoD,t.abrEwmaDefaultEstimate)}registerListeners(){const{hls:t}=this;t.on(wg.MANIFEST_LOADING,this.onManifestLoading,this),t.on(wg.FRAG_LOADING,this.onFragLoading,this),t.on(wg.FRAG_LOADED,this.onFragLoaded,this),t.on(wg.FRAG_BUFFERED,this.onFragBuffered,this),t.on(wg.LEVEL_SWITCHING,this.onLevelSwitching,this),t.on(wg.LEVEL_LOADED,this.onLevelLoaded,this),t.on(wg.LEVELS_UPDATED,this.onLevelsUpdated,this),t.on(wg.MAX_AUTO_LEVEL_UPDATED,this.onMaxAutoLevelUpdated,this),t.on(wg.ERROR,this.onError,this)}unregisterListeners(){const{hls:t}=this;t&&(t.off(wg.MANIFEST_LOADING,this.onManifestLoading,this),t.off(wg.FRAG_LOADING,this.onFragLoading,this),t.off(wg.FRAG_LOADED,this.onFragLoaded,this),t.off(wg.FRAG_BUFFERED,this.onFragBuffered,this),t.off(wg.LEVEL_SWITCHING,this.onLevelSwitching,this),t.off(wg.LEVEL_LOADED,this.onLevelLoaded,this),t.off(wg.LEVELS_UPDATED,this.onLevelsUpdated,this),t.off(wg.MAX_AUTO_LEVEL_UPDATED,this.onMaxAutoLevelUpdated,this),t.off(wg.ERROR,this.onError,this))}destroy(){this.unregisterListeners(),this.clearTimer(),this.hls=this._abandonRulesCheck=this.supportedCache=null,this.fragCurrent=this.partCurrent=null}onManifestLoading(t,e){this.lastLoadedFragLevel=-1,this.firstSelection=-1,this.lastLevelLoadSec=0,this.supportedCache={},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 yg.BUFFER_ADD_CODEC_ERROR:case yg.BUFFER_APPEND_ERROR:this.lastLoadedFragLevel=-1,this.firstSelection=-1;break;case yg.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,s=e-i.loading.start,a=i.loading.first?i.loading.first-i.loading.start:-1;if(i.loaded&&a>-1){const t=this.bwEstimator.getEstimateTTFB();this.bwEstimator.sample(s-Math.min(t,a),i.loaded)}else this.bwEstimator.sampleTTFB(s)}break}}}getTimeToLoadFrag(t,e,i,r){return t+i/e+(r?t+this.lastLevelLoadSec:0)}onLevelLoaded(t,e){const i=this.hls.config,{loading:r}=e.stats,s=r.end-r.first;mg(s)&&(this.lastLevelLoadSec=s/1e3),e.details.live?this.bwEstimator.update(i.abrEwmaSlowLive,i.abrEwmaFastLive):this.bwEstimator.update(i.abrEwmaSlowVoD,i.abrEwmaFastVoD),this.timer>-1&&this._abandonRulesCheck(e.levelInfo)}onFragLoaded(t,{frag:e,part:i}){const r=i?i.stats:e.stats;if(e.type===Tg&&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,s=this.hls.levels[e.level],a=(s.loaded?s.loaded.bytes:0)+r.loaded,n=(s.loaded?s.loaded.duration:0)+t;s.loaded={bytes:a,duration:n},s.realBitrate=Math.round(8*a/n)}if(e.bitrateTest){const t={stats:r,frag:e,part:i,id:e.type};this.onFragBuffered(wg.FRAG_BUFFERED,t),e.bitrateTest=!1}else this.lastLoadedFragLevel=e.level}}onFragBuffered(t,e){const{frag:i,part:r}=e,s=null!=r&&r.stats.loaded?r.stats:i.stats;if(s.aborted)return;if(this.ignoreFragment(i))return;const a=s.parsing.end-s.loading.start-Math.min(s.loading.first-s.loading.start,this.bwEstimator.getEstimateTTFB());this.bwEstimator.sample(a,s.loaded),s.bwEstimate=this.getBwEstimate(),i.bitrateTest?this.bitrateTestDelay=a/1e3:this.bitrateTestDelay=0}ignoreFragment(t){return t.type!==Tg||"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,s=this.findBestLevel(i,e,t,0,r,1,1);if(s>-1)return s;const a=this.hls.firstLevel,n=Math.min(Math.max(a,e),t);return this.warn(`Could not find best starting auto level. Defaulting to first in playlist ${a} 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;if(i.levels.length<=1)return i.loadLevel;const{maxAutoLevel:r,config:s,minAutoLevel:a}=i,n=e?e.duration:t?t.duration:0,o=this.getBwEstimate(),l=this.getStarvationDelay();let c=s.abrBandWidthFactor,d=s.abrBandWidthUpFactor;if(l){const t=this.findBestLevel(o,a,r,l,0,c,d);if(t>=0)return this.rebufferNotice=-1,t}let h=n?Math.min(n,s.maxStarvationDelay):s.maxStarvationDelay;if(!l){const t=this.bitrateTestDelay;if(t){h=(n?Math.min(n,s.maxLoadingDelay):s.maxLoadingDelay)-t,this.info(`bitrate test took ${Math.round(1e3*t)}ms, set first fragment max fetchDuration to ${Math.round(1e3*h)} ms`),c=d=1}}const p=this.findBestLevel(o,a,r,l,h,c,d);if(this.rebufferNotice!==p&&(this.rebufferNotice=p,this.info(`${l?"rebuffering expected":"buffer is empty"}, optimal quality level ${p}`)),p>-1)return p;const u=i.levels[a],g=i.loadLevelObj;return g&&(null==u?void 0:u.bitrate)<g.bitrate?a: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,s,a,n){var o;const l=r+s,c=this.lastLoadedFragLevel,d=-1===c?this.hls.firstLevel:c,{fragCurrent:h,partCurrent:p}=this,{levels:u,allAudioTracks:g,loadLevel:f,config:m}=this.hls;if(1===u.length)return 0;const v=u[d],b=!(null==(o=this.hls.latestLevelDetails)||!o.live),k=-1===f||-1===c;let y,w="SDR",x=(null==v?void 0:v.frameRate)||0;const{audioPreference:S,videoPreference:E}=m,P=this.audioTracksByGroup||(this.audioTracksByGroup=hm(g));let T=-1;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,r)=>{if(!i.codecSet)return t;const s=i.audioGroups;let a=t[i.codecSet];a||(t[i.codecSet]=a={minBitrate:1/0,minHeight:1/0,minFramerate:1/0,minIndex:r,maxScore:0,videoRanges:{SDR:0},channels:{2:0},hasDefaultAudio:!s,fragmentError:0}),a.minBitrate=Math.min(a.minBitrate,i.bitrate);const n=Math.min(i.height,i.width);return a.minHeight=Math.min(a.minHeight,n),a.minFramerate=Math.min(a.minFramerate,i.frameRate),a.minIndex=Math.min(a.minIndex,r),a.maxScore=Math.max(a.maxScore,i.score),a.fragmentError+=i.fragmentError,a.videoRanges[i.videoRange]=(a.videoRanges[i.videoRange]||0)+1,s&&s.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},{})}(u,P,e,i)),s=function(t,e,i,r,s){const a=Object.keys(t),n=null==r?void 0:r.channels,o=null==r?void 0:r.audioCodec,l=null==s?void 0:s.videoCodec,c=n&&2===parseInt(n);let d=!1,h=!1,p=1/0,u=1/0,g=1/0,f=1/0,m=0,v=[];const{preferHDR:b,allowedVideoRanges:k}=lm(e,s);for(let e=a.length;e--;){const i=t[a[e]];d||(d=i.channels[2]>0),p=Math.min(p,i.minHeight),u=Math.min(u,i.minFramerate),g=Math.min(g,i.minBitrate),k.filter(t=>i.videoRanges[t]>0).length>0&&(h=!0)}p=mg(p)?p:0,u=mg(u)?u:0;const y=Math.max(1080,p),w=Math.max(30,u);g=mg(g)?g:i,i=Math.max(g,i),h||(e=void 0);const x=a.length>1;return{codecSet:a.reduce((e,r)=>{const s=t[r];if(r===e)return e;if(v=h?k.filter(t=>s.videoRanges[t]>0):[],x){if(s.minBitrate>i)return dm(r,`min bitrate of ${s.minBitrate} > current estimate of ${i}`),e;if(!s.hasDefaultAudio)return dm(r,"no renditions with default or auto-select sound found"),e;if(o&&r.indexOf(o.substring(0,4))%5!=0)return dm(r,`audio codec preference "${o}" not found`),e;if(n&&!c){if(!s.channels[n])return dm(r,`no renditions with ${n} channel sound found (channels options: ${Object.keys(s.channels)})`),e}else if((!o||c)&&d&&0===s.channels[2])return dm(r,"no renditions with stereo sound found"),e;if(s.minHeight>y)return dm(r,`min resolution of ${s.minHeight} > maximum of ${y}`),e;if(s.minFramerate>w)return dm(r,`min framerate of ${s.minFramerate} > maximum of ${w}`),e;if(!v.some(t=>s.videoRanges[t]>0))return dm(r,`no variants with VIDEO-RANGE of ${cm(v)} found`),e;if(l&&r.indexOf(l.substring(0,4))%5!=0)return dm(r,`video codec preference "${l}" not found`),e;if(s.maxScore<m)return dm(r,`max score of ${s.maxScore} < selected max of ${m}`),e}return e&&(Ff(r)>=Ff(e)||s.fragmentError>t[e].fragmentError)?e:(f=s.minIndex,m=s.maxScore,r)},void 0),videoRanges:v,preferHDR:b,minFramerate:u,minBitrate:g,minIndex:f}}(r,w,t,S,E),{codecSet:a,videoRanges:n,minFramerate:o,minBitrate:l,minIndex:c,preferHDR:d}=s;T=c,y=a,w=d?n[n.length-1]:n[0],x=o,t=Math.max(t,l),this.log(`picked start tier ${cm(s)}`)}else y=null==v?void 0:v.codecSet,w=null==v?void 0:v.videoRange;const L=p?p.duration:h?h.duration:0,C=this.bwEstimator.getEstimateTTFB()/1e3,_=[];for(let o=i;o>=e;o--){var A,R;const e=u[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)&&Wf(e,P,w,x,t,S)?(e.supportedPromise=Zf(e,P,i,this.supportedCache),e.supportedPromise.then(t=>{if(!this.hls)return;e.supportedResult=t;const i=this.hls.levels,r=i.indexOf(e);t.error?this.warn(`MediaCapabilities decodingInfo error: "${t.error}" for level ${r} ${cm(t)}`):t.supported?t.decodingInfoResults.some(t=>!1===t.smooth||!1===t.powerEfficient)&&this.log(`MediaCapabilities decodingInfo for level ${r} not smooth or powerEfficient: ${cm(t)}`):(this.warn(`Unsupported MediaCapabilities decodingInfo result for level ${r} ${cm(t)}`),r>-1&&i.length>1&&(this.log(`Removing unsupported level ${r}`),this.hls.removeLevel(r),-1===this.hls.loadLevel&&(this.hls.nextLoadLevel=0)))})):e.supportedResult=Kf}if((y&&e.codecSet!==y||w&&e.videoRange!==w||h&&x>e.frameRate||!h&&x>0&&x<e.frameRate||null!=(A=e.supportedResult)&&null!=(R=A.decodingInfoResults)&&R.some(t=>!1===t.smooth))&&(!k||o!==T)){_.push(o);continue}const g=e.details,v=(p?null==g?void 0:g.partTarget:null==g?void 0:g.averagetargetduration)||L;let E;E=h?n*t:a*t;const I=L&&r>=2*L&&0===s?e.averageBitrate:e.maxBitrate,D=this.getTimeToLoadFrag(C,E,I*v,void 0===g);if(E>=I&&(o===c||0===e.loadError&&0===e.fragmentError)&&(D<=C||!mg(D)||b&&!this.bitrateTestDelay||D<l)){const t=this.forcedAutoLevel;return o===f||-1!==t&&t===f||(_.length&&this.trace(`Skipped level(s) ${_.join(",")} of ${i} max with CODECS and VIDEO-RANGE:"${u[_[0]].codecs}" ${u[_[0]].videoRange}; not compatible with "${y}" ${w}`),this.info(`switch candidate:${d}->${o} adjustedbw(${Math.round(E)})-bitrate=${Math.round(E-I)} ttfb:${C.toFixed(1)} avgDuration:${v.toFixed(1)} maxFetchDuration:${l.toFixed(1)} fetchDuration:${D.toFixed(1)} firstSelection:${k} codecSet:${e.codecSet} videoRange:${e.videoRange} hls.loadLevel:${f}`)),k&&(this.firstSelection=o),o}}return-1}set nextAutoLevel(t){const e=this.deriveNextAutoLevel(t);this._nextAutoLevel!==e&&(this.nextAutoLevelKey="",this._nextAutoLevel=e)}deriveNextAutoLevel(t){const{maxAutoLevel:e,minAutoLevel:i}=this.hls;return Math.min(Math.max(t,i),e)}},bufferController:class extends Og{constructor(t,e){var i;super("buffer-controller",t.logger),this.hls=void 0,this.fragmentTracker=void 0,this.details=null,this._objectUrl=null,this.operationQueue=null,this.bufferCodecEventsTotal=0,this.media=null,this.mediaSource=null,this.lastMpegAudioChunk=null,this.blockedAudioAppend=null,this.lastVideoAppendEnd=0,this.appendSource=void 0,this.transferData=void 0,this.overrides=void 0,this.appendErrors={audio:0,video:0,audiovideo:0},this.tracks={},this.sourceBuffers=[[null,null],[null,null]],this._onEndStreaming=t=>{var e;this.hls&&"open"===(null==(e=this.mediaSource)?void 0:e.readyState)&&this.hls.pauseBuffering()},this._onStartStreaming=t=>{this.hls&&this.hls.resumeBuffering()},this._onMediaSourceOpen=t=>{const{media:e,mediaSource:i}=this;t&&this.log("Media source opened"),e&&i&&(i.removeEventListener("sourceopen",this._onMediaSourceOpen),e.removeEventListener("emptied",this._onMediaEmptied),this.updateDuration(),this.hls.trigger(wg.MEDIA_ATTACHED,{media:e,mediaSource:i}),null!==this.mediaSource&&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&&this.error(`Media element src was set while attaching MediaSource (${e} > ${t})`)},this.hls=t,this.fragmentTracker=e,this.appendSource=(i=Bg(t.config.preferManagedMediaSource),"undefined"!=typeof self&&i===self.ManagedMediaSource),this.initTracks(),this.registerListeners()}hasSourceTypes(){return Object.keys(this.tracks).length>0}destroy(){this.unregisterListeners(),this.details=null,this.lastMpegAudioChunk=this.blockedAudioAppend=null,this.transferData=this.overrides=void 0,this.operationQueue&&(this.operationQueue.destroy(),this.operationQueue=null),this.hls=this.fragmentTracker=null,this._onMediaSourceOpen=this._onMediaSourceClose=null,this._onMediaSourceEnded=null,this._onStartStreaming=this._onEndStreaming=null}registerListeners(){const{hls:t}=this;t.on(wg.MEDIA_ATTACHING,this.onMediaAttaching,this),t.on(wg.MEDIA_DETACHING,this.onMediaDetaching,this),t.on(wg.MANIFEST_LOADING,this.onManifestLoading,this),t.on(wg.MANIFEST_PARSED,this.onManifestParsed,this),t.on(wg.BUFFER_RESET,this.onBufferReset,this),t.on(wg.BUFFER_APPENDING,this.onBufferAppending,this),t.on(wg.BUFFER_CODECS,this.onBufferCodecs,this),t.on(wg.BUFFER_EOS,this.onBufferEos,this),t.on(wg.BUFFER_FLUSHING,this.onBufferFlushing,this),t.on(wg.LEVEL_UPDATED,this.onLevelUpdated,this),t.on(wg.FRAG_PARSED,this.onFragParsed,this),t.on(wg.FRAG_CHANGED,this.onFragChanged,this),t.on(wg.ERROR,this.onError,this)}unregisterListeners(){const{hls:t}=this;t.off(wg.MEDIA_ATTACHING,this.onMediaAttaching,this),t.off(wg.MEDIA_DETACHING,this.onMediaDetaching,this),t.off(wg.MANIFEST_LOADING,this.onManifestLoading,this),t.off(wg.MANIFEST_PARSED,this.onManifestParsed,this),t.off(wg.BUFFER_RESET,this.onBufferReset,this),t.off(wg.BUFFER_APPENDING,this.onBufferAppending,this),t.off(wg.BUFFER_CODECS,this.onBufferCodecs,this),t.off(wg.BUFFER_EOS,this.onBufferEos,this),t.off(wg.BUFFER_FLUSHING,this.onBufferFlushing,this),t.off(wg.LEVEL_UPDATED,this.onLevelUpdated,this),t.off(wg.FRAG_PARSED,this.onFragParsed,this),t.off(wg.FRAG_CHANGED,this.onFragChanged,this),t.off(wg.ERROR,this.onError,this)}transferMedia(){const{media:t,mediaSource:e}=this;if(!t)return null;const i={};if(this.operationQueue){const t=this.isUpdating();t||this.operationQueue.removeBlockers();const e=this.isQueued();(t||e)&&this.warn(`Transfering MediaSource with${e?" operations in queue":""}${t?" updating SourceBuffer(s)":""} ${this.operationQueue}`),this.operationQueue.destroy()}const r=this.transferData;return!this.sourceBufferCount&&r&&r.mediaSource===e?Ig(i,r.tracks):this.sourceBuffers.forEach(t=>{const[e]=t;e&&(i[e]=Ig({},this.tracks[e]),this.removeBuffer(e)),t[0]=t[1]=null}),{media:t,mediaSource:e,tracks:i}}initTracks(){this.sourceBuffers=[[null,null],[null,null]],this.tracks={},this.resetQueue(),this.resetAppendErrors(),this.lastMpegAudioChunk=this.blockedAudioAppend=null,this.lastVideoAppendEnd=0}onManifestLoading(){this.bufferCodecEventsTotal=0,this.details=null}onManifestParsed(t,e){var i;let r=2;(e.audio&&!e.video||!e.altAudio)&&(r=1),this.bufferCodecEventsTotal=r,this.log(`${r} bufferCodec event(s) expected.`),null!=(i=this.transferData)&&i.mediaSource&&this.sourceBufferCount&&r&&this.bufferCreated()}onMediaAttaching(t,e){const i=this.media=e.media,r=Bg(this.appendSource);if(this.transferData=this.overrides=void 0,i&&r){const t=!!e.mediaSource;(t||e.overrides)&&(this.transferData=e,this.overrides=e.overrides);const s=this.mediaSource=e.mediaSource||new r;if(this.assignMediaSource(s),t)this._objectUrl=i.src,this.attachTransferred();else{const t=this._objectUrl=self.URL.createObjectURL(s);if(this.appendSource)try{i.removeAttribute("src");const e=self.ManagedMediaSource;i.disableRemotePlayback=i.disableRemotePlayback||e&&s instanceof e,by(i),function(t,e){const i=self.document.createElement("source");i.type="video/mp4",i.src=e,t.appendChild(i)}(i,t),i.load()}catch(e){i.src=t}else i.src=t}i.addEventListener("emptied",this._onMediaEmptied)}}assignMediaSource(t){var e,i;this.log(`${(null==(e=this.transferData)?void 0:e.mediaSource)===t?"transferred":"created"} media source: ${null==(i=t.constructor)?void 0:i.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))}attachTransferred(){const t=this.media,e=this.transferData;if(!e||!t)return;const i=this.tracks,r=e.tracks,s=r?Object.keys(r):null,a=s?s.length:0,n=()=>{this.media&&this.mediaSourceOpenOrEnded&&this._onMediaSourceOpen()};if(r&&s&&a){if(!this.tracksReady)return this.hls.config.startFragPrefetch=!0,void this.log("attachTransferred: waiting for SourceBuffer track info");if(this.log(`attachTransferred: (bufferCodecEventsTotal ${this.bufferCodecEventsTotal})\nrequired tracks: ${cm(i,(t,e)=>"initSegment"===t?void 0:e)};\ntransfer tracks: ${cm(r,(t,e)=>"initSegment"===t?void 0:e)}}`),!Gg(r,i)){e.mediaSource=null,e.tracks=void 0;const s=t.currentTime,a=this.details,n=Math.max(s,(null==a?void 0:a.fragments[0].start)||0);return n-s>1?void this.log(`attachTransferred: waiting for playback to reach new tracks start time ${s} -> ${n}`):(this.warn(`attachTransferred: resetting MediaSource for incompatible tracks ("${Object.keys(r)}"->"${Object.keys(i)}") start time: ${n} currentTime: ${s}`),this.onMediaDetaching(wg.MEDIA_DETACHING,{}),this.onMediaAttaching(wg.MEDIA_ATTACHING,e),void(t.currentTime=n))}this.transferData=void 0,s.forEach(t=>{const e=t,i=r[e];if(i){const t=i.buffer;if(t){const r=this.fragmentTracker,s=i.id;if(r.hasFragments(s)||r.hasParts(s)){const i=sv.getBuffered(t);r.detectEvictedFragments(e,i,s,null,!0)}const a=ky(e),n=[e,t];this.sourceBuffers[a]=n,t.updating&&this.operationQueue&&this.operationQueue.prependBlocker(e),this.trackSourceBuffer(e,i)}}}),n(),this.bufferCreated()}else this.log("attachTransferred: MediaSource w/o SourceBuffers"),n()}get mediaSourceOpenOrEnded(){var t;const e=null==(t=this.mediaSource)?void 0:t.readyState;return"open"===e||"ended"===e}onMediaDetaching(t,e){const i=!!e.transferMedia;this.transferData=this.overrides=void 0;const{media:r,mediaSource:s,_objectUrl:a}=this;if(s){if(this.log("media source "+(i?"transferring":"detaching")),i)this.sourceBuffers.forEach(([t])=>{t&&this.removeBuffer(t)}),this.resetQueue();else{if(this.mediaSourceOpenOrEnded){const t="open"===s.readyState;try{const e=s.sourceBuffers;for(let i=e.length;i--;)t&&e[i].abort(),s.removeSourceBuffer(e[i]);t&&s.endOfStream()}catch(t){this.warn(`onMediaDetaching: ${t.message} while calling endOfStream`)}}this.sourceBufferCount&&this.onBufferReset()}s.removeEventListener("sourceopen",this._onMediaSourceOpen),s.removeEventListener("sourceended",this._onMediaSourceEnded),s.removeEventListener("sourceclose",this._onMediaSourceClose),this.appendSource&&(s.removeEventListener("startstreaming",this._onStartStreaming),s.removeEventListener("endstreaming",this._onEndStreaming)),this.mediaSource=null,this._objectUrl=null}r&&(r.removeEventListener("emptied",this._onMediaEmptied),i||(a&&self.URL.revokeObjectURL(a),this.mediaSrc===a?(r.removeAttribute("src"),this.appendSource&&by(r),r.load()):this.warn("media|source.src was changed by a third party - skip cleanup")),this.media=null),this.hls.trigger(wg.MEDIA_DETACHED,e)}onBufferReset(){this.sourceBuffers.forEach(([t])=>{t&&this.resetBuffer(t)}),this.initTracks()}resetBuffer(t){var e;const i=null==(e=this.tracks[t])?void 0:e.buffer;if(this.removeBuffer(t),i)try{var r;null!=(r=this.mediaSource)&&r.sourceBuffers.length&&this.mediaSource.removeSourceBuffer(i)}catch(e){this.warn(`onBufferReset ${t}`,e)}delete this.tracks[t]}removeBuffer(t){this.removeBufferListeners(t),this.sourceBuffers[ky(t)]=[null,null];const e=this.tracks[t];e&&(e.buffer=void 0)}resetQueue(){this.operationQueue&&this.operationQueue.destroy(),this.operationQueue=new gy(this.tracks)}onBufferCodecs(t,e){const i=this.tracks,r=Object.keys(e);this.log(`BUFFER_CODECS: "${r}" (current SB count ${this.sourceBufferCount})`);const s="audiovideo"in e&&(i.audio||i.video)||i.audiovideo&&("audio"in e||"video"in e),a=!s&&this.sourceBufferCount&&this.media&&r.some(t=>!i[t]);s||a?this.warn(`Unsupported transition between "${Object.keys(i)}" and "${r}" SourceBuffers`):(r.forEach(t=>{var r,s,a;const n=e[t],{id:o,codec:l,levelCodec:c,container:d,metadata:h,supplemental:p}=n;let u=i[t];const g=null==(r=this.transferData)||null==(s=r.tracks)?void 0:s[t],f=null!=g&&g.buffer?g:u,m=(null==f?void 0:f.pendingCodec)||(null==f?void 0:f.codec),v=null==f?void 0:f.levelCodec;u||(u=i[t]={buffer:void 0,listeners:[],codec:l,supplemental:p,container:d,levelCodec:c,metadata:h,id:o});const b=Bf(m,v),k=null==b?void 0:b.replace(fy,"$1");let y=Bf(l,c);const w=null==(a=y)?void 0:a.replace(fy,"$1");y&&b&&k!==w&&("audio"===t.slice(0,5)&&(y=zf(y,this.appendSource)),this.log(`switching codec ${m} to ${y}`),y!==(u.pendingCodec||u.codec)&&(u.pendingCodec=y),u.container=d,this.appendChangeType(t,d,y))}),(this.tracksReady||this.sourceBufferCount)&&(e.tracks=this.sourceBufferTracks),this.sourceBufferCount||this.mediaSourceOpenOrEnded&&this.checkPendingTracks())}get sourceBufferTracks(){return Object.keys(this.tracks).reduce((t,e)=>{const i=this.tracks[e];return t[e]={id:i.id,container:i.container,codec:i.codec,levelCodec:i.levelCodec},t},{})}appendChangeType(t,e,i){const r=`${e};codecs=${i}`,s={label:`change-type=${r}`,execute:()=>{const s=this.tracks[t];if(s){const a=s.buffer;null!=a&&a.changeType&&(this.log(`changing ${t} sourceBuffer type to ${r}`),a.changeType(r),s.codec=i,s.container=e)}this.shiftAndExecuteNext(t)},onStart:()=>{},onComplete:()=>{},onError:e=>{this.warn(`Failed to change ${t} SourceBuffer type`,e)}};this.append(s,t,this.isPending(this.tracks[t]))}blockAudio(t){var e;const i=t.start,r=i+.05*t.duration;if(!0===(null==(e=this.fragmentTracker.getAppendedFrag(i,Tg))?void 0:e.gap))return;const s={label:"block-audio",execute:()=>{var t;const e=this.tracks.video;(this.lastVideoAppendEnd>r||null!=e&&e.buffer&&sv.isBuffered(e.buffer,r)||!0===(null==(t=this.fragmentTracker.getAppendedFrag(r,Tg))?void 0:t.gap))&&(this.blockedAudioAppend=null,this.shiftAndExecuteNext("audio"))},onStart:()=>{},onComplete:()=>{},onError:t=>{this.warn("Error executing block-audio operation",t)}};this.blockedAudioAppend={op:s,frag:t},this.append(s,"audio",!0)}unblockAudio(){const{blockedAudioAppend:t,operationQueue:e}=this;t&&e&&(this.blockedAudioAppend=null,e.unblockAudio(t.op))}onBufferAppending(t,e){const{tracks:i}=this,{data:r,type:s,parent:a,frag:n,part:o,chunkMeta:l,offset:c}=e,d=l.buffering[s],{sn:h,cc:p}=n,u=self.performance.now();d.start=u;const g=n.stats.buffering,f=o?o.stats.buffering:null;0===g.start&&(g.start=u),f&&0===f.start&&(f.start=u);const m=i.audio;let v=!1;"audio"===s&&"audio/mpeg"===(null==m?void 0:m.container)&&(v=!this.lastMpegAudioChunk||1===l.id||this.lastMpegAudioChunk.sn!==l.sn,this.lastMpegAudioChunk=l);const b=i.video,k=null==b?void 0:b.buffer;if(k&&"initSegment"!==h){const t=o||n,e=this.blockedAudioAppend;if("audio"!==s||"main"===a||this.blockedAudioAppend){if("video"===s){const i=t.end;if(e){const t=e.frag.start;(i>t||i<this.lastVideoAppendEnd||sv.isBuffered(k,t))&&this.unblockAudio()}this.lastVideoAppendEnd=i}}else{const e=t.start+.05*t.duration,i=k.buffered,r=this.currentOp("video");i.length||r?!r&&!sv.isBuffered(k,e)&&this.lastVideoAppendEnd<e&&this.blockAudio(t):this.blockAudio(t)}}const y=(o||n).start,w={label:`append-${s}`,execute:()=>{var t;d.executeStart=self.performance.now();const e=null==(t=this.tracks[s])?void 0:t.buffer;e&&(v?this.updateTimestampOffset(e,y,.1,s,h,p):void 0!==c&&mg(c)&&this.updateTimestampOffset(e,c,1e-6,s,h,p)),this.appendExecutor(r,s)},onStart:()=>{},onComplete:()=>{const t=self.performance.now();d.executeEnd=d.end=t,0===g.first&&(g.first=t),f&&0===f.first&&(f.first=t);const e={};this.sourceBuffers.forEach(([t,i])=>{t&&(e[t]=sv.getBuffered(i))}),this.appendErrors[s]=0,"audio"===s||"video"===s?this.appendErrors.audiovideo=0:(this.appendErrors.audio=0,this.appendErrors.video=0),this.hls.trigger(wg.BUFFER_APPENDED,{type:s,frag:n,part:o,chunkMeta:l,parent:n.type,timeRanges:e})},onError:t=>{var e;const i={type:kg.MEDIA_ERROR,parent:n.type,details:yg.BUFFER_APPEND_ERROR,sourceBufferName:s,frag:n,part:o,chunkMeta:l,error:t,err:t,fatal:!1},r=null==(e=this.media)?void 0:e.error;if(t.code===DOMException.QUOTA_EXCEEDED_ERR||"QuotaExceededError"==t.name||"quota"in t)i.details=yg.BUFFER_FULL_ERROR;else if(t.code===DOMException.INVALID_STATE_ERR&&this.mediaSourceOpenOrEnded&&!r)i.errorAction=Om(!0);else if(t.name===my&&0===this.sourceBufferCount)i.errorAction=Om(!0);else{const t=++this.appendErrors[s];this.warn(`Failed ${t}/${this.hls.config.appendErrorMaxRetry} times to append segment in "${s}" sourceBuffer (${r||"no media error"})`),(t>=this.hls.config.appendErrorMaxRetry||r)&&(i.fatal=!0)}this.hls.trigger(wg.ERROR,i)}};this.append(w,s,this.isPending(this.tracks[s]))}getFlushOp(t,e,i){return this.log(`queuing "${t}" remove ${e}-${i}`),{label:"remove",execute:()=>{this.removeExecutor(t,e,i)},onStart:()=>{},onComplete:()=>{this.hls.trigger(wg.BUFFER_FLUSHED,{type:t})},onError:r=>{this.warn(`Failed to remove ${e}-${i} from "${t}" SourceBuffer`,r)}}}onBufferFlushing(t,e){const{type:i,startOffset:r,endOffset:s}=e;i?this.append(this.getFlushOp(i,r,s),i):this.sourceBuffers.forEach(([t])=>{t&&this.append(this.getFlushOp(t,r,s),t)})}onFragParsed(t,e){const{frag:i,part:r}=e,s=[],a=r?r.elementaryStreams:i.elementaryStreams;a[Jg]?s.push("audiovideo"):(a[Qg]&&s.push("audio"),a[Xg]&&s.push("video"));0===s.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(wg.FRAG_BUFFERED,{frag:i,part:r,stats:e,id:i.type})},s).catch(t=>{this.warn(`Fragment buffered callback ${t}`),this.stepOperationQueue(this.sourceBufferTypes)})}onFragChanged(t,e){this.trimBuffers()}get bufferedToEnd(){return this.sourceBufferCount>0&&!this.sourceBuffers.some(([t])=>{var e,i;return t&&(!(null!=(e=this.tracks[t])&&e.ended)||(null==(i=this.tracks[t])?void 0:i.ending))})}onBufferEos(t,e){var i;this.sourceBuffers.forEach(([t])=>{if(t){const i=this.tracks[t];e.type&&e.type!==t||(i.ending=!0,i.ended||(i.ended=!0,this.log(`${t} buffer reached EOS`)))}});const r=!1!==(null==(i=this.overrides)?void 0:i.endOfStream);this.sourceBufferCount>0&&!this.sourceBuffers.some(([t])=>{var e;return t&&!(null!=(e=this.tracks[t])&&e.ended)})&&(r?(this.log("Queueing EOS"),this.blockUntilOpen(()=>{this.tracksEnded();const{mediaSource:t}=this;t&&"open"===t.readyState?(this.log("Calling mediaSource.endOfStream()"),t.endOfStream(),this.hls.trigger(wg.BUFFERED_TO_END,void 0)):t&&this.log(`Could not call mediaSource.endOfStream(). mediaSource.readyState: ${t.readyState}`)})):(this.tracksEnded(),this.hls.trigger(wg.BUFFERED_TO_END,void 0)))}tracksEnded(){this.sourceBuffers.forEach(([t])=>{if(null!==t){const e=this.tracks[t];e&&(e.ending=!1)}})}onLevelUpdated(t,{details:e}){e.fragments.length&&(this.details=e,this.updateDuration())}updateDuration(){this.blockUntilOpen(()=>{const t=this.getDurationAndRange();t&&this.updateMediaSource(t)})}onError(t,e){if(e.details===yg.BUFFER_APPEND_ERROR&&e.frag){var i;const t=null==(i=e.errorAction)?void 0:i.nextAutoLevel;mg(t)&&t!==e.frag.level&&this.resetAppendErrors()}}resetAppendErrors(){this.appendErrors={audio:0,video:0,audiovideo:0}}trimBuffers(){const{hls:t,details:e,media:i}=this;if(!i||null===e)return;if(!this.sourceBufferCount)return;const r=t.config,s=i.currentTime,a=e.levelTargetDuration,n=e.live&&null!==r.liveBackBufferLength?r.liveBackBufferLength:r.backBufferLength;if(mg(n)&&n>=0){const t=Math.max(n,a),e=Math.floor(s/a)*a-t;this.flushBackBuffer(s,a,e)}if(mg(r.frontBufferFlushThreshold)&&r.frontBufferFlushThreshold>0){const t=Math.max(r.maxBufferLength,r.frontBufferFlushThreshold),e=Math.max(t,a),i=Math.floor(s/a)*a+e;this.flushFrontBuffer(s,a,i)}}flushBackBuffer(t,e,i){this.sourceBuffers.forEach(([t,e])=>{if(e){const s=sv.getBuffered(e);if(s.length>0&&i>s.start(0)){var r;this.hls.trigger(wg.BACK_BUFFER_REACHED,{bufferEnd:i});const e=this.tracks[t];if(null!=(r=this.details)&&r.live)this.hls.trigger(wg.LIVE_BACK_BUFFER_REACHED,{bufferEnd:i});else if(null!=e&&e.ended)return void this.log(`Cannot flush ${t} back buffer while SourceBuffer is in ended state`);this.hls.trigger(wg.BUFFER_FLUSHING,{startOffset:0,endOffset:i,type:t})}}})}flushFrontBuffer(t,e,i){this.sourceBuffers.forEach(([e,r])=>{if(r){const s=sv.getBuffered(r),a=s.length;if(a<2)return;const n=s.start(a-1),o=s.end(a-1);if(i>n||t>=n&&t<=o)return;this.hls.trigger(wg.BUFFER_FLUSHING,{startOffset:n,endOffset:1/0,type:e})}})}getDurationAndRange(){var t;const{details:e,mediaSource:i}=this;if(!e||!this.media||"open"!==(null==i?void 0:i.readyState))return null;const r=e.edge;if(e.live&&this.hls.config.liveDurationInfinity){if(e.fragments.length&&e.live&&i.setLiveSeekableRange){const t=Math.max(0,e.fragmentStart);return{duration:1/0,start:t,end:Math.max(t,r)}}return{duration:1/0}}const s=null==(t=this.overrides)?void 0:t.duration;if(s)return mg(s)?{duration:s}:null;const a=this.media.duration;return r>(mg(i.duration)?i.duration:0)&&r>a||!mg(a)?{duration:r}:null}updateMediaSource({duration:t,start:e,end:i}){const r=this.mediaSource;this.media&&r&&"open"===r.readyState&&(r.duration!==t&&(mg(t)&&this.log(`Updating MediaSource duration to ${t.toFixed(3)}`),r.duration=t),void 0!==e&&void 0!==i&&(this.log(`MediaSource duration is set to ${r.duration}. Setting seekable range to ${e}-${i}.`),r.setLiveSeekableRange(e,i)))}get tracksReady(){const t=this.pendingTrackCount;return t>0&&(t>=this.bufferCodecEventsTotal||this.isPending(this.tracks.audiovideo))}checkPendingTracks(){const{bufferCodecEventsTotal:t,pendingTrackCount:e,tracks:i}=this;if(this.log(`checkPendingTracks (pending: ${e} codec events expected: ${t}) ${cm(i)}`),this.tracksReady){var r;const t=null==(r=this.transferData)?void 0:r.tracks;t&&Object.keys(t).length?this.attachTransferred():this.createSourceBuffers()}}bufferCreated(){if(this.sourceBufferCount){const t={};this.sourceBuffers.forEach(([e,i])=>{if(e){const r=this.tracks[e];t[e]={buffer:i,container:r.container,codec:r.codec,supplemental:r.supplemental,levelCodec:r.levelCodec,id:r.id,metadata:r.metadata}}}),this.hls.trigger(wg.BUFFER_CREATED,{tracks:t}),this.log(`SourceBuffers created. Running queue: ${this.operationQueue}`),this.sourceBuffers.forEach(([t])=>{this.executeNext(t)})}else{const t=new Error("could not create source buffer for media codec(s)");this.hls.trigger(wg.ERROR,{type:kg.MEDIA_ERROR,details:yg.BUFFER_INCOMPATIBLE_CODECS_ERROR,fatal:!0,error:t,reason:t.message})}}createSourceBuffers(){const{tracks:t,sourceBuffers:e,mediaSource:i}=this;if(!i)throw new Error("createSourceBuffers called when mediaSource was null");for(const s in t){const a=s,n=t[a];if(this.isPending(n)){const t=this.getTrackCodec(n,a),s=`${n.container};codecs=${t}`;n.codec=t,this.log(`creating sourceBuffer(${s})${this.currentOp(a)?" Queued":""} ${cm(n)}`);try{const t=i.addSourceBuffer(s),r=ky(a),o=[a,t];e[r]=o,n.buffer=t}catch(t){var r;return this.error(`error while trying to add sourceBuffer: ${t.message}`),this.shiftAndExecuteNext(a),null==(r=this.operationQueue)||r.removeBlockers(),delete this.tracks[a],void this.hls.trigger(wg.ERROR,{type:kg.MEDIA_ERROR,details:yg.BUFFER_ADD_CODEC_ERROR,fatal:!1,error:t,sourceBufferName:a,mimeType:s,parent:n.id})}this.trackSourceBuffer(a,n)}}this.bufferCreated()}getTrackCodec(t,e){const i=t.supplemental;let r=t.codec;i&&("video"===e||"audiovideo"===e)&&Mf(i,"video")&&(r=function(t,e){const i=[];if(t){const e=t.split(",");for(let t=0;t<e.length;t++)Df(e[t],"video")||i.push(e[t])}return e&&i.push(e),i.join(",")}(r,i));const s=Bf(r,t.levelCodec);return s?"audio"===e.slice(0,5)?zf(s,this.appendSource):s:""}trackSourceBuffer(t,e){const i=e.buffer;if(!i)return;const r=this.getTrackCodec(e,t);this.tracks[t]={buffer:i,codec:r,container:e.container,levelCodec:e.levelCodec,supplemental:e.supplemental,metadata:e.metadata,id:e.id,listeners:[]},this.removeBufferListeners(t),this.addBufferListener(t,"updatestart",this.onSBUpdateStart),this.addBufferListener(t,"updateend",this.onSBUpdateEnd),this.addBufferListener(t,"error",this.onSBUpdateError),this.appendSource&&this.addBufferListener(t,"bufferedchange",(t,e)=>{const i=e.removedRanges;null!=i&&i.length&&this.hls.trigger(wg.BUFFER_FLUSHED,{type:t})})}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 e=this.currentOp(t);e&&e.onStart()}onSBUpdateEnd(t){var e;if("closed"===(null==(e=this.mediaSource)?void 0:e.readyState))return void this.resetBuffer(t);const i=this.currentOp(t);i&&(i.onComplete(),this.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(wg.ERROR,{type:kg.MEDIA_ERROR,details:yg.BUFFER_APPENDING_ERROR,sourceBufferName:t,error:r,fatal:!1});const s=this.currentOp(t);s&&s.onError(r)}updateTimestampOffset(t,e,i,r,s,a){const n=e-t.timestampOffset;Math.abs(n)>=i&&(this.log(`Updating ${r} SourceBuffer timestampOffset to ${e} (sn: ${s} cc: ${a})`),t.timestampOffset=e)}removeExecutor(t,e,i){const{media:r,mediaSource:s}=this,a=this.tracks[t],n=null==a?void 0:a.buffer;if(!r||!s||!n)return this.warn(`Attempting to remove from the ${t} SourceBuffer, but it does not exist`),void this.shiftAndExecuteNext(t);const o=mg(r.duration)?r.duration:1/0,l=mg(s.duration)?s.duration:1/0,c=Math.max(0,e),d=Math.min(i,o,l);d>c&&(!a.ending||a.ended)?(a.ended=!1,this.log(`Removing [${c},${d}] from the ${t} SourceBuffer`),n.remove(c,d)):this.shiftAndExecuteNext(t)}appendExecutor(t,e){const i=this.tracks[e],r=null==i?void 0:i.buffer;if(!r)throw new vy(`Attempting to append to the ${e} SourceBuffer, but it does not exist`);i.ending=!1,i.ended=!1,r.appendBuffer(t)}blockUntilOpen(t){if(this.isUpdating()||this.isQueued())this.blockBuffers(t).catch(t=>{this.warn(`SourceBuffer blocked callback ${t}`),this.stepOperationQueue(this.sourceBufferTypes)});else try{t()}catch(t){this.warn(`Callback run without blocking ${this.operationQueue} ${t}`)}}isUpdating(){return this.sourceBuffers.some(([t,e])=>t&&e.updating)}isQueued(){return this.sourceBuffers.some(([t])=>t&&!!this.currentOp(t))}isPending(t){return!!t&&!t.buffer}blockBuffers(t,e=this.sourceBufferTypes){if(!e.length)return this.log("Blocking operation requested, but no SourceBuffers exist"),Promise.resolve().then(t);const{operationQueue:i}=this,r=e.map(t=>this.appendBlocker(t));return e.length>1&&!!this.blockedAudioAppend&&this.unblockAudio(),Promise.all(r).then(e=>{i===this.operationQueue&&(t(),this.stepOperationQueue(this.sourceBufferTypes))})}stepOperationQueue(t){t.forEach(t=>{var e;const i=null==(e=this.tracks[t])?void 0:e.buffer;i&&!i.updating&&this.shiftAndExecuteNext(t)})}append(t,e,i){this.operationQueue&&this.operationQueue.append(t,e,i)}appendBlocker(t){if(this.operationQueue)return this.operationQueue.appendBlocker(t)}currentOp(t){return this.operationQueue?this.operationQueue.current(t):null}executeNext(t){t&&this.operationQueue&&this.operationQueue.executeNext(t)}shiftAndExecuteNext(t){this.operationQueue&&this.operationQueue.shiftAndExecuteNext(t)}get pendingTrackCount(){return Object.keys(this.tracks).reduce((t,e)=>t+(this.isPending(this.tracks[e])?1:0),0)}get sourceBufferCount(){return this.sourceBuffers.reduce((t,[e])=>t+(e?1:0),0)}get sourceBufferTypes(){return this.sourceBuffers.map(([t])=>t).filter(t=>!!t)}addBufferListener(t,e,i){const r=this.tracks[t];if(!r)return;const s=r.buffer;if(!s)return;const a=i.bind(this,t);r.listeners.push({event:e,listener:a}),s.addEventListener(e,a)}removeBufferListeners(t){const e=this.tracks[t];if(!e)return;const i=e.buffer;i&&(e.listeners.forEach(t=>{i.removeEventListener(t.event,t.listener)}),e.listeners.length=0)}},capLevelController:yy,errorController:class extends Og{constructor(t){super("error-controller",t.logger),this.hls=void 0,this.playlistError=0,this.penalizedRenditions={},this.hls=t,this.registerListeners()}registerListeners(){const t=this.hls;t.on(wg.ERROR,this.onError,this),t.on(wg.MANIFEST_LOADING,this.onManifestLoading,this),t.on(wg.LEVEL_UPDATED,this.onLevelUpdated,this)}unregisterListeners(){const t=this.hls;t&&(t.off(wg.ERROR,this.onError,this),t.off(wg.ERROR,this.onErrorOut,this),t.off(wg.MANIFEST_LOADING,this.onManifestLoading,this),t.off(wg.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)===Tg?t.level:this.hls.loadLevel}onManifestLoading(){this.playlistError=0,this.penalizedRenditions={}}onLevelUpdated(){this.playlistError=0}onError(t,e){var i;if(e.fatal)return;const r=this.hls,s=e.context;switch(e.details){case yg.FRAG_LOAD_ERROR:case yg.FRAG_LOAD_TIMEOUT:case yg.KEY_LOAD_ERROR:case yg.KEY_LOAD_TIMEOUT:return void(e.errorAction=this.getFragRetryOrSwitchAction(e));case yg.FRAG_PARSING_ERROR:if(null!=(i=e.frag)&&i.gap)return void(e.errorAction=Om());case yg.FRAG_GAP:case yg.FRAG_DECRYPT_ERROR:return e.errorAction=this.getFragRetryOrSwitchAction(e),void(e.errorAction.action=_m);case yg.LEVEL_EMPTY_ERROR:case yg.LEVEL_PARSING_ERROR:{var a,n;const t=e.parent===Tg?e.level:r.loadLevel;e.details===yg.LEVEL_EMPTY_ERROR&&null!=(a=e.context)&&null!=(n=a.levelDetails)&&n.live?e.errorAction=this.getPlaylistRetryOrSwitchAction(e,t):(e.levelRetry=!1,e.errorAction=this.getLevelSwitchAction(e,t))}return;case yg.LEVEL_LOAD_ERROR:case yg.LEVEL_LOAD_TIMEOUT:return void("number"==typeof(null==s?void 0:s.level)&&(e.errorAction=this.getPlaylistRetryOrSwitchAction(e,s.level)));case yg.AUDIO_TRACK_LOAD_ERROR:case yg.AUDIO_TRACK_LOAD_TIMEOUT:case yg.SUBTITLE_LOAD_ERROR:case yg.SUBTITLE_TRACK_LOAD_TIMEOUT:if(s){const t=r.loadLevelObj;if(t&&(s.type===Eg&&t.hasAudioGroup(s.groupId)||s.type===Pg&&t.hasSubtitleGroup(s.groupId)))return e.errorAction=this.getPlaylistRetryOrSwitchAction(e,r.loadLevel),e.errorAction.action=_m,void(e.errorAction.flags=Dm)}return;case yg.KEY_SYSTEM_STATUS_OUTPUT_RESTRICTED:{const t=r.loadLevelObj,i=null==t?void 0:t.attrs["HDCP-LEVEL"];i?e.errorAction={action:_m,flags:Mm,hdcpLevel:i}:this.keySystemError(e)}return;case yg.BUFFER_ADD_CODEC_ERROR:case yg.REMUX_ALLOC_ERROR:case yg.BUFFER_APPEND_ERROR:var o;if(!e.errorAction)e.errorAction=this.getLevelSwitchAction(e,null!=(o=e.level)?o:r.loadLevel);return;case yg.INTERNAL_EXCEPTION:case yg.BUFFER_APPENDING_ERROR:case yg.BUFFER_FULL_ERROR:case yg.LEVEL_SWITCH_ERROR:case yg.BUFFER_STALLED_ERROR:case yg.BUFFER_SEEK_OVER_HOLE:case yg.BUFFER_NUDGE_ON_STALL:return void(e.errorAction=Om())}e.type===kg.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=Em(this.hls.config.playlistLoadPolicy,t),r=this.playlistError++;if(Lm(i,r,Sm(t),t.response))return{action:Rm,flags:Im,retryConfig:i,retryCount:r};const s=this.getLevelSwitchAction(t,e);return i&&(s.retryConfig=i,s.retryCount=r),s}getFragRetryOrSwitchAction(t){const e=this.hls,i=this.getVariantLevelIndex(t.frag),r=e.levels[i],{fragLoadPolicy:s,keyLoadPolicy:a}=e.config,n=Em(t.details.startsWith("key")?a:s,t),o=e.levels.reduce((t,e)=>t+e.fragmentError,0);if(r){t.details!==yg.FRAG_GAP&&r.fragmentError++;if(Lm(n,o,Sm(t),t.response))return{action:Rm,flags:Im,retryConfig:n,retryCount:o}}const l=this.getLevelSwitchAction(t,i);return n&&(l.retryConfig=n,l.retryCount=o),l}getLevelSwitchAction(t,e){const i=this.hls;null==e&&(e=i.loadLevel);const r=this.hls.levels[e];if(r){var s,a;const e=t.details;r.loadError++,e===yg.BUFFER_APPEND_ERROR&&r.fragmentError++;let l=-1;const{levels:c,loadLevel:d,minAutoLevel:h,maxAutoLevel:p}=i;i.autoLevelEnabled||i.config.preserveManualLevelOnError||(i.loadLevel=-1);const u=null==(s=t.frag)?void 0:s.type,g=(u===Lg&&e===yg.FRAG_PARSING_ERROR||"audio"===t.sourceBufferName&&(e===yg.BUFFER_ADD_CODEC_ERROR||e===yg.BUFFER_APPEND_ERROR))&&c.some(({audioCodec:t})=>r.audioCodec!==t),f="video"===t.sourceBufferName&&(e===yg.BUFFER_ADD_CODEC_ERROR||e===yg.BUFFER_APPEND_ERROR)&&c.some(({codecSet:t,audioCodec:e})=>r.codecSet!==t&&r.audioCodec===e),{type:m,groupId:v}=null!=(a=t.context)?a:{};for(let i=c.length;i--;){const s=(i+d)%c.length;if(s!==d&&s>=h&&s<=p&&0===c[s].loadError){var n,o;const i=c[s];if(e===yg.FRAG_GAP&&u===Tg&&t.frag){const e=c[s].details;if(e){const i=km(t.frag,e.fragments,t.frag.start);if(null!=i&&i.gap)continue}}else{if(m===Eg&&i.hasAudioGroup(v)||m===Pg&&i.hasSubtitleGroup(v))continue;if(u===Lg&&null!=(n=r.audioGroups)&&n.some(t=>i.hasAudioGroup(t))||u===Cg&&null!=(o=r.subtitleGroups)&&o.some(t=>i.hasSubtitleGroup(t))||g&&r.audioCodec===i.audioCodec||!g&&r.audioCodec!==i.audioCodec||f&&r.codecSet===i.codecSet)continue}l=s;break}}if(l>-1&&i.loadLevel!==l)return t.levelRetry=!0,this.playlistError=0,{action:_m,flags:Im,nextAutoLevel:l}}return{action:_m,flags:Dm}}onErrorOut(t,e){var i;switch(null==(i=e.errorAction)?void 0:i.action){case Cm:break;case _m:this.sendAlternateToPenaltyBox(e),e.errorAction.resolved||e.details===yg.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:s,nextAutoLevel:a}=i;switch(r){case Im:this.switchLevel(t,a);break;case Mm:s&&(e.maxHdcpLevel=Jf[Jf.indexOf(s)-1],i.resolved=!0),this.warn(`Restricting playback to HDCP-LEVEL of "${e.maxHdcpLevel}" or lower`)}i.resolved||this.switchLevel(t,a)}switchLevel(t,e){if(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,t.details===yg.BUFFER_ADD_CODEC_ERROR&&t.mimeType&&"audiovideo"!==t.sourceBufferName)){const e=qf(t.mimeType),i=this.hls.levels;for(let r=i.length;r--;)i[r][`${t.sourceBufferName}Codec`]===e&&this.hls.removeLevel(r)}}},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(wg.MEDIA_ATTACHING,this.onMediaAttaching,this),this.hls.on(wg.MEDIA_DETACHING,this.onMediaDetaching,this)}unregisterListeners(){this.hls.off(wg.MEDIA_ATTACHING,this.onMediaAttaching,this),this.hls.off(wg.MEDIA_DETACHING,this.onMediaDetaching,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)}}onMediaDetaching(){this.media=null}checkFPS(t,e,i){const r=performance.now();if(e){if(this.lastTime){const t=r-this.lastTime,s=i-this.lastDroppedFrames,a=e-this.lastDecodedFrames,n=1e3*s/t,o=this.hls;if(o.trigger(wg.FPS_DROP,{currentDropped:s,currentDecoded:a,totalDroppedFrames:i}),n>0&&s>o.config.fpsDroppedMonitoringThreshold*a){let t=o.currentLevel;o.logger.warn("drop FPS ratio greater than max allowed value for currentLevel: "+t),t>0&&(-1===o.autoLevelCapping||o.autoLevelCapping>=t)&&(t-=1,o.trigger(wg.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:Uv,requireKeySystemAccessOnStart:!1,testBandwidth:!0,progressive:!1,lowLatencyMode:!0,cmcd:void 0,enableDateRangeMetadataCues:!0,enableEmsgMetadataCues:!0,enableEmsgKLVMetadata:!1,enableID3MetadataCues:!0,enableInterstitialPlayback:!0,interstitialAppendInPlace:!0,interstitialLiveLookAhead:10,useMediaCapabilities:!0,preserveManualLevelOnError:!1,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}}},interstitialAssetListLoadPolicy:{default:{maxTimeToFirstByteMs:1e4,maxLoadTimeMs:3e4,timeoutRetry:{maxNumRetry:0,retryDelayMs:0,maxRetryDelayMs:0},errorRetry:{maxNumRetry:0,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:kx,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 Db{constructor(t,e,i){super(t,e,i,"subtitle-stream-controller",Cg),this.currentTrackId=-1,this.tracksBuffered=[],this.mainDetails=null,this.registerListeners()}onHandlerDestroying(){this.unregisterListeners(),super.onHandlerDestroying(),this.mainDetails=null}registerListeners(){super.registerListeners();const{hls:t}=this;t.on(wg.LEVEL_LOADED,this.onLevelLoaded,this),t.on(wg.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),t.on(wg.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),t.on(wg.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),t.on(wg.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),t.on(wg.BUFFER_FLUSHING,this.onBufferFlushing,this)}unregisterListeners(){super.unregisterListeners();const{hls:t}=this;t.off(wg.LEVEL_LOADED,this.onLevelLoaded,this),t.off(wg.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),t.off(wg.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),t.off(wg.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),t.off(wg.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),t.off(wg.BUFFER_FLUSHING,this.onBufferFlushing,this)}startLoad(t,e){this.stopLoad(),this.state=xb,this.setInterval(500),this.nextLoadPosition=this.lastCurrentTime=t+this.timelineOffset,this.startPosition=e?-1:t,this.tick()}onManifestLoading(){super.onManifestLoading(),this.mainDetails=null}onMediaDetaching(t,e){this.tracksBuffered=[],super.onMediaDetaching(t,e)}onLevelLoaded(t,e){this.mainDetails=e.details}onSubtitleFragProcessed(t,e){const{frag:i,success:r}=e;if(this.fragContextChanged(i)||(ef(i)&&(this.fragPrevious=i),this.state=xb),!r)return;const s=this.tracksBuffered[this.currentTrackId];if(!s)return;let a;const n=i.start;for(let t=0;t<s.length;t++)if(n>=s[t].start&&n<=s[t].end){a=s[t];break}const o=i.start+i.duration;a?a.end=o:(a={start:n,end:o},s.push(a)),this.fragmentTracker.fragBuffered(i),this.fragBufferedComplete(i,null),this.media&&this.tick()}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,Cg)}}onError(t,e){const i=e.frag;(null==i?void 0:i.type)===Cg&&(e.details===yg.FRAG_GAP&&this.fragmentTracker.fragBuffered(i,!0),this.fragCurrent&&this.fragCurrent.abortRequests(),this.state!==wb&&(this.state=xb))}onSubtitleTracksUpdated(t,{subtitleTracks:e}){this.levels&&hy(this.levels,e)?this.levels=e.map(t=>new nm(t)):(this.tracksBuffered=[],this.levels=e.map(t=>{const e=new nm(t);return this.tracksBuffered[e.id]=[],e}),this.fragmentTracker.removeFragmentsInRange(0,Number.POSITIVE_INFINITY,Cg),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.state!==wb&&this.setInterval(500)}onSubtitleTrackLoaded(t,e){var i;const{currentTrackId:r,levels:s}=this,{details:a,id:n}=e;if(!s)return void this.warn(`Subtitle tracks were reset while loading level ${n}`);const o=s[n];if(n>=s.length||!o)return;this.log(`Subtitle track ${n} loaded [${a.startSN},${a.endSN}]${a.lastPartSn?`[part-${a.lastPartSn}-${a.lastPartIndex}]`:""},duration:${a.totalduration}`),this.mediaBuffer=this.mediaBufferTimeRanges;let l=0;if(a.live||null!=(i=o.details)&&i.live){if(a.deltaUpdateFailed)return;const t=this.mainDetails;if(!t)return void(this.startFragRequested=!1);const e=t.fragments[0];var c;if(o.details)l=this.alignPlaylists(a,o.details,null==(c=this.levelLastLoaded)?void 0:c.details),0===l&&e&&(l=e.start,cb(a,l));else a.hasProgramDateTime&&t.hasProgramDateTime?(kb(a,t),l=a.fragmentStart):e&&(l=e.start,cb(a,l));t&&!this.startFragRequested&&this.setStartPosition(t,l)}if(o.details=a,this.levelLastLoaded=o,n===r&&(this.hls.trigger(wg.SUBTITLE_TRACK_UPDATED,{details:a,id:n,groupId:e.groupId}),this.tick(),a.live&&!this.fragCurrent&&this.media&&this.state===xb)){km(null,a.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,s=this.hls;if(!this.fragContextChanged(e)&&i&&i.byteLength>0&&null!=r&&r.key&&r.iv&&vv(r.method)){const t=performance.now();this.decrypter.decrypt(new Uint8Array(i),r.key.buffer,r.iv.buffer,bv(r.method)).catch(t=>{throw s.trigger(wg.ERROR,{type:kg.MEDIA_ERROR,details:yg.FRAG_DECRYPT_ERROR,fatal:!1,error:t,reason:t.message,frag:e}),t}).then(i=>{const r=performance.now();s.trigger(wg.FRAG_DECRYPTED,{frag:e,payload:i,stats:{tstart:t,tdecrypt:r}})}).catch(t=>{this.warn(`${t.name}: ${t.message}`),this.state=xb})}}doTick(){if(this.media){if(this.state===xb){const{currentTrackId:t,levels:e}=this,i=null==e?void 0:e[t];if(!i||!e.length||!i.details)return;if(this.waitForLive(i))return;const{config:r}=this,s=this.getLoadPosition(),a=sv.bufferedInfo(this.tracksBuffered[this.currentTrackId]||[],s,r.maxBufferHole),{end:n,len:o}=a,l=i.details;if(o>this.hls.maxBufferLength+l.levelTargetDuration)return;const c=l.fragments,d=c.length,h=l.edge;let p=null;const u=this.fragPrevious;if(n<h){const t=r.maxFragLookUpTolerance,e=n>h-t?0:t;p=km(u,c,Math.max(c[0].start,n),e),!p&&u&&u.start<c[0].start&&(p=c[0])}else p=c[d-1];if(p=this.filterReplacedPrimary(p,i.details),!p)return;const g=c[p.sn-l.startSN-1];if(g&&g.cc===p.cc&&this.fragmentTracker.getState(g)===Um&&(p=g),this.fragmentTracker.getState(p)===Um){const t=this.mapToInitFragWhenRequired(p);t&&this.loadFragment(t,i,n)}}}else this.state=xb}loadFragment(t,e,i){ef(t)?super.loadFragment(t,e,i):this._loadInitSegment(t,e)}get mediaBufferTimeRanges(){return new Sw(this.tracksBuffered[this.currentTrackId]||[])}},subtitleTrackController:class extends dy{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.useTextTrackPolling=!1,this.subtitlePollingInterval=-1,this._subtitleDisplay=!0,this.asyncPollTrackChange=()=>this.pollTrackChange(0),this.onTextTracksChanged=()=>{if(this.useTextTrackPolling||self.clearInterval(this.subtitlePollingInterval),!this.media||!this.hls.config.renderTextTracksNatively)return;let t=null;const e=lw(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(wg.MEDIA_ATTACHED,this.onMediaAttached,this),t.on(wg.MEDIA_DETACHING,this.onMediaDetaching,this),t.on(wg.MANIFEST_LOADING,this.onManifestLoading,this),t.on(wg.MANIFEST_PARSED,this.onManifestParsed,this),t.on(wg.LEVEL_LOADING,this.onLevelLoading,this),t.on(wg.LEVEL_SWITCHING,this.onLevelSwitching,this),t.on(wg.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),t.on(wg.ERROR,this.onError,this)}unregisterListeners(){const{hls:t}=this;t.off(wg.MEDIA_ATTACHED,this.onMediaAttached,this),t.off(wg.MEDIA_DETACHING,this.onMediaDetaching,this),t.off(wg.MANIFEST_LOADING,this.onManifestLoading,this),t.off(wg.MANIFEST_PARSED,this.onManifestParsed,this),t.off(wg.LEVEL_LOADING,this.onLevelLoading,this),t.off(wg.LEVEL_SWITCHING,this.onLevelSwitching,this),t.off(wg.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),t.off(wg.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(t,e){const i=this.media;if(!i)return;const r=!!e.transferMedia;if(self.clearInterval(this.subtitlePollingInterval),this.useTextTrackPolling||i.textTracks.removeEventListener("change",this.asyncPollTrackChange),this.trackId>-1&&(this.queuedDefaultTrack=this.trackId),this.subtitleTrack=-1,this.media=null,r)return;lw(i.textTracks).forEach(t=>{nw(t)})}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:s}=e,a=this.tracksInGroup[i];if(!a||a.groupId!==r)return void this.warn(`Subtitle track with id:${i} and group:${r} not found in active group ${null==a?void 0:a.groupId}`);const n=a.details;a.details=e.details,this.log(`Subtitle track ${i} "${a.name}" lang:${a.lang} group:${r} loaded [${s.startSN}-${s.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 s=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(!s&&!this.tracksInGroup.length)return;this.tracksInGroup=t;const e=this.hls.config.subtitlePreference;if(!s&&e){this.selectDefaultTrack=!1;const i=um(e,t);if(i>-1)s=t[i];else{const t=um(e,this.tracks);s=this.tracks[t]}}let r=this.findTrackId(s);-1===r&&s&&(r=this.findTrackId(null));const a={subtitleTracks:t};this.log(`Updating subtitle tracks, ${t.length} track(s) found in "${null==i?void 0:i.join(",")}" group-id`),this.hls.trigger(wg.SUBTITLE_TRACKS_UPDATED,a),-1!==r&&-1===this.trackId&&this.setSubtitleTrack(r)}}findTrackId(t){const e=this.tracksInGroup,i=this.selectDefaultTrack;for(let r=0;r<e.length;r++){const s=e[r];if((!i||s.default)&&(i||t)&&(!t||gm(s,t)))return r}if(t){for(let i=0;i<e.length;i++){const r=e[i];if(py(t.attrs,r.attrs,["LANGUAGE","ASSOC-LANGUAGE","CHARACTERISTICS"]))return i}for(let i=0;i<e.length;i++){const r=e[i];if(py(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(uy(e[i],t))return i}}return-1}onError(t,e){!e.fatal&&e.context&&(e.context.type!==Pg||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){if(-1===t.id)return this.setSubtitleTrack(-1),null;const e=this.allSubtitleTracks;if(this.selectDefaultTrack=!1,e.length){const i=this.currentTrack;if(i&&gm(t,i))return i;const r=um(t,this.tracksInGroup);if(r>-1){const t=this.tracksInGroup[r];return this.setSubtitleTrack(r),t}if(i)return null;{const i=um(t,e);if(i>-1)return e[i]}}}return null}loadPlaylist(t){super.loadPlaylist(),this.shouldLoadPlaylist(this.currentTrack)&&this.scheduleLoading(this.currentTrack,t)}loadingPlaylist(t,e){super.loadingPlaylist(t,e);const i=t.id,r=t.groupId,s=this.getUrlWithDirectives(t.url,e),a=t.details,n=null==a?void 0:a.age;this.log(`Loading subtitle ${i} "${t.name}" lang:${t.lang} group:${r}${void 0!==(null==e?void 0:e.msn)?" at sn "+e.msn+" part "+e.part:""}${n&&a.live?" age "+n.toFixed(1)+(a.type&&" "+a.type||""):""} ${s}`),this.hls.trigger(wg.SUBTITLE_TRACK_LOADING,{url:s,id:i,groupId:r,deliveryDirectives:e||null,track:t})}toggleTrackModes(){const{media:t}=this;if(!t)return;const e=lw(t.textTracks),i=this.currentTrack;let r;if(i&&(r=e.filter(t=>uy(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||!mg(t))return void this.warn(`Invalid subtitle track id: ${t}`);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(wg.SUBTITLE_TRACK_SWITCH,{id:t});const s=!!r.details&&!r.details.live;if(t===this.trackId&&r===i&&s)return;this.log(`Switching to subtitle-track ${t}`+(r?` "${r.name}" lang:${r.lang} group:${r.groupId}`:""));const{id:a,groupId:n="",name:o,type:l,url:c}=r;this.hls.trigger(wg.SUBTITLE_TRACK_SWITCH,{id:a,groupId:n,name:o,type:l,url:c});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(wg.MEDIA_ATTACHING,this.onMediaAttaching,this),t.on(wg.MEDIA_DETACHING,this.onMediaDetaching,this),t.on(wg.MANIFEST_LOADING,this.onManifestLoading,this),t.on(wg.MANIFEST_LOADED,this.onManifestLoaded,this),t.on(wg.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),t.on(wg.FRAG_LOADING,this.onFragLoading,this),t.on(wg.FRAG_LOADED,this.onFragLoaded,this),t.on(wg.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),t.on(wg.FRAG_DECRYPTED,this.onFragDecrypted,this),t.on(wg.INIT_PTS_FOUND,this.onInitPtsFound,this),t.on(wg.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),t.on(wg.BUFFER_FLUSHING,this.onBufferFlushing,this)}destroy(){const{hls:t}=this;t.off(wg.MEDIA_ATTACHING,this.onMediaAttaching,this),t.off(wg.MEDIA_DETACHING,this.onMediaDetaching,this),t.off(wg.MANIFEST_LOADING,this.onManifestLoading,this),t.off(wg.MANIFEST_LOADED,this.onManifestLoaded,this),t.off(wg.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),t.off(wg.FRAG_LOADING,this.onFragLoading,this),t.off(wg.FRAG_LOADED,this.onFragLoaded,this),t.off(wg.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),t.off(wg.FRAG_DECRYPTED,this.onFragDecrypted,this),t.off(wg.INIT_PTS_FOUND,this.onInitPtsFound,this),t.off(wg.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),t.off(wg.BUFFER_FLUSHING,this.onBufferFlushing,this),this.hls=this.config=this.media=null,this.cea608Parser1=this.cea608Parser2=void 0}initCea608Parsers(){const t=new gx(this,"textTrack1"),e=new gx(this,"textTrack2"),i=new gx(this,"textTrack3"),r=new gx(this,"textTrack4");this.cea608Parser1=new jw(1,t,e),this.cea608Parser2=new jw(3,i,r)}addCues(t,e,i,r,s){let a=!1;for(let t=s.length;t--;){const r=s[t],n=vx(r[0],r[1],e,i);if(n>=0&&(r[0]=Math.min(r[0],e),r[1]=Math.max(r[1],i),a=!0,n/(i-e)>.5))return}if(a||s.push([e,i]),this.config.renderTextTracksNatively){const s=this.captionsTracks[t];this.Cues.newCue(s,e,i,r)}else{const s=this.Cues.newCue(null,e,i,r);this.hls.trigger(wg.CUES_PARSED,{type:"captions",cues:s,track:t})}}onInitPtsFound(t,{frag:e,id:i,initPTS:r,timescale:s}){const{unparsedVttFrags:a}=this;i===Tg&&(this.initPTS[e.cc]={baseTime:r,timescale:s}),a.length&&(this.unparsedVttFrags=[],a.forEach(t=>{this.initPTS[t.frag.cc]?this.onFragLoaded(wg.FRAG_LOADED,t):this.hls.trigger(wg.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:t.frag,error:new Error("Subtitle discontinuity domain does not match main")})}))}getExistingTrack(t,e){const{media:i}=this;if(i)for(let r=0;r<i.textTracks.length;r++){const s=i.textTracks[r];if(mx(s,{name:t,lang:e,characteristics:"transcribes-spoken-dialog,describes-music-and-sound"}))return s}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:s,languageCode:a}=e[t],n=this.getExistingTrack(s,a);if(n)i[t]=n,nw(i[t]),sw(i[t],r);else{const e=this.createTextTrack("captions",s,a);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(wg.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,e.mediaSource||this._cleanTracks()}onMediaDetaching(t,e){const i=!!e.transferMedia;if(this.media=null,i)return;const{captionsTracks:r}=this;Object.keys(r).forEach(t=>{nw(r[t]),delete r[t]}),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++)nw(e[t])}onSubtitleTracksUpdated(t,e){const i=e.subtitleTracks||[],r=i.some(t=>t.textCodec===rx);if(this.config.enableWebVTT||r&&this.config.enableIMSC1){if(hy(this.tracks,i))return void(this.tracks=i);if(this.textTracks=[],this.tracks=i,this.config.renderTextTracksNatively){const t=this.media,e=t?lw(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]&&mx(e[r],t)){i=e[r],e[r]=null;break}i&&(r=i)}if(r)nw(r);else{const e=fx(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&&this.hls.logger.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(wg.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===Tg){var i,r;const{cea608Parser1:t,cea608Parser2:s,lastSn:a}=this,{cc:n,sn:o}=e.frag,l=null!=(i=null==(r=e.part)?void 0:r.index)?i:-1;t&&s&&(o!==a+1||o===a&&l!==this.lastPartIndex+1||n!==this.lastCc)&&(t.reset(),s.reset()),this.lastCc=n,this.lastSn=o,this.lastPartIndex=l}}onFragLoaded(t,e){const{frag:i,payload:r}=e;if(i.type===Cg)if(r.byteLength){const t=i.decryptdata,s="stats"in e;if(null==t||!t.encrypted||s){const t=this.tracks[i.level],s=this.vttCCs;s[i.cc]||(s[i.cc]={start:i.start,prevCC:this.prevCC,new:!0},this.prevCC=i.cc),t&&t.textCodec===rx?this._parseIMSC1(i,r):this._parseVTTs(e)}}else this.hls.trigger(wg.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:i,error:new Error("Empty subtitle payload")})}_parseIMSC1(t,e){const i=this.hls;ox(e,this.initPTS[t.cc],e=>{this._appendCues(e,t.level),i.trigger(wg.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:t})},e=>{i.logger.log(`Failed to parse IMSC1: ${e}`),i.trigger(wg.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:t,error:e})})}_parseVTTs(t){var e;const{frag:i,payload:r}=t,{initPTS:s,unparsedVttFrags:a}=this,n=s.length-1;if(!s[i.cc]&&-1===n)return void a.push(t);const o=this.hls;ix(null!=(e=i.initSegment)&&e.data?Sf(i.initSegment.data,new Uint8Array(r)).buffer:r,this.initPTS[i.cc],this.vttCCs,i.cc,i.start,t=>{this._appendCues(t,i.level),o.trigger(wg.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:i})},e=>{const s="Missing initPTS for VTT MPEGTS"===e.message;s?a.push(t):this._fallbackToIMSC1(i,r),o.logger.log(`Failed to parse VTT cue: ${e}`),s&&n>i.cc||o.trigger(wg.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:i,error:e})})}_fallbackToIMSC1(t,e){const i=this.tracks[t.level];i.textCodec||ox(e,this.initPTS[t.cc],()=>{i.textCodec=rx,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=>aw(i,t))}else{const r=this.tracks[e];if(!r)return;const s=r.default?"default":"subtitles"+e;i.trigger(wg.CUES_PARSED,{type:"subtitles",cues:t,track:s})}}onFragDecrypted(t,e){const{frag:i}=e;i.type===Cg&&this.onFragLoaded(wg.FRAG_LOADED,e)}onSubtitleTracksCleared(){this.tracks=[],this.captionsTracks={}}onFragParsingUserdata(t,e){if(!this.enabled||!this.config.enableCEA708Captions)return;const{frag:i,samples:r}=e;if(i.type!==Tg||"NONE"!==this.closedCaptionsForLevel(i))for(let t=0;t<r.length;t++){const e=r[t].bytes;if(e){this.cea608Parser1||this.initCea608Parsers();const i=this.extractCea608Data(e);this.cea608Parser1.addData(r[t].pts,i[0]),this.cea608Parser2.addData(r[t].pts,i[1])}}}onBufferFlushing(t,{startOffset:e,endOffset:i,endOffsetSubtitles:r,type:s}){const{media:a}=this;if(a&&!(a.currentTime<i)){if(!s||"video"===s){const{captionsTracks:t}=this;Object.keys(t).forEach(r=>ow(t[r],e,i))}if(this.config.renderTextTracksNatively&&0===e&&void 0!==r){const{textTracks:t}=this;Object.keys(t).forEach(i=>ow(t[i],e,r))}}}extractCea608Data(t){const e=[[],[]],i=31&t[0];let r=2;for(let s=0;s<i;s++){const i=t[r++],s=127&t[r++],a=127&t[r++];if(0===s&&0===a)continue;if(!!(4&i)){const t=3&i;0!==t&&1!==t||(e[t].push(s),e[t].push(a))}}return e}},audioStreamController:class extends Db{constructor(t,e,i){super(t,e,i,"audio-stream-controller",Lg),this.mainAnchor=null,this.mainFragLoading=null,this.audioOnly=!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.resetItem()}resetItem(){this.mainDetails=this.mainAnchor=this.mainFragLoading=this.bufferedTrack=this.switchingTrack=this.waitingData=this.cachedTrackLoadedData=null}registerListeners(){super.registerListeners();const{hls:t}=this;t.on(wg.LEVEL_LOADED,this.onLevelLoaded,this),t.on(wg.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),t.on(wg.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),t.on(wg.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),t.on(wg.BUFFER_RESET,this.onBufferReset,this),t.on(wg.BUFFER_CREATED,this.onBufferCreated,this),t.on(wg.BUFFER_FLUSHING,this.onBufferFlushing,this),t.on(wg.BUFFER_FLUSHED,this.onBufferFlushed,this),t.on(wg.INIT_PTS_FOUND,this.onInitPtsFound,this),t.on(wg.FRAG_LOADING,this.onFragLoading,this),t.on(wg.FRAG_BUFFERED,this.onFragBuffered,this)}unregisterListeners(){const{hls:t}=this;t&&(super.unregisterListeners(),t.off(wg.LEVEL_LOADED,this.onLevelLoaded,this),t.off(wg.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),t.off(wg.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),t.off(wg.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),t.off(wg.BUFFER_RESET,this.onBufferReset,this),t.off(wg.BUFFER_CREATED,this.onBufferCreated,this),t.off(wg.BUFFER_FLUSHING,this.onBufferFlushing,this),t.off(wg.BUFFER_FLUSHED,this.onBufferFlushed,this),t.off(wg.INIT_PTS_FOUND,this.onInitPtsFound,this),t.off(wg.FRAG_LOADING,this.onFragLoading,this),t.off(wg.FRAG_BUFFERED,this.onFragBuffered,this))}onInitPtsFound(t,{frag:e,id:i,initPTS:r,timescale:s}){if(i===Tg){const t=e.cc,i=this.fragCurrent;if(this.initPTS[t]={baseTime:r,timescale:s},this.log(`InitPTS for cc: ${t} found from main: ${r}/${s}`),this.mainAnchor=e,this.state===Rb){const i=this.waitingData;(!i&&!this.loadingParts||i&&i.frag.cc!==t)&&this.syncWithAnchor(e,null==i?void 0:i.frag)}else!this.hls.hasEnoughToStart&&i&&i.cc!==t?(i.abortRequests(),this.syncWithAnchor(e,i)):this.state===xb&&this.tick()}}getLoadPosition(){return!this.startFragRequested&&this.nextLoadPosition>=0?this.nextLoadPosition:super.getLoadPosition()}syncWithAnchor(t,e){var i;const r=(null==(i=this.mainFragLoading)?void 0:i.frag)||null;if(e&&(null==r?void 0:r.cc)===e.cc)return;const s=(r||t).cc,a=xm(this.getLevelDetails(),s,this.getLoadPosition());a&&(this.log(`Waiting fragment cc (${null==e?void 0:e.cc}) cancelled because video is at cc ${t.cc}`),this.startFragRequested=!1,this.nextLoadPosition=a.start,this.resetLoadingState(),this.state===xb&&this.doTickIdle())}startLoad(t,e){if(!this.levels)return this.startPosition=t,void(this.state=wb);const i=this.lastCurrentTime;this.stopLoad(),this.setInterval(100),i>0&&-1===t?(this.log(`Override startPosition with lastCurrentTime @${i.toFixed(3)}`),t=i,this.state=xb):this.state=Tb,this.nextLoadPosition=this.lastCurrentTime=t+this.timelineOffset,this.startPosition=e?-1:t,this.tick()}doTick(){switch(this.state){case xb:this.doTickIdle();break;case Tb:{const{levels:t,trackId:e}=this,i=null==t?void 0:t[e],r=null==i?void 0:i.details;if(r&&!this.waitForLive(i)){if(this.waitForCdnTuneIn(r))break;this.state=Rb}break}case Pb:{var t;const e=performance.now(),i=this.retryDate;if(!i||e>=i||null!=(t=this.media)&&t.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=xb}break}case Rb:{const t=this.waitingData;if(t){const{frag:e,part:i,cache:r,complete:s}=t,a=this.mainAnchor;if(void 0!==this.initPTS[e.cc]){this.waitingData=null,this.state=Eb;const t={frag:e,part:i,payload:r.flush().buffer,networkDetails:null};this._handleFragmentLoadProgress(t),s&&super._handleFragmentLoadComplete(t)}else a&&a.cc!==t.frag.cc&&this.syncWithAnchor(a,t.frag)}else this.state=xb}}this.onTickEnd()}resetLoadingState(){const t=this.waitingData;t&&(this.fragmentTracker.removeFragment(t.frag),this.waitingData=null),super.resetLoadingState()}onTickEnd(){const{media:t}=this;null!=t&&t.readyState&&(this.lastCurrentTime=t.currentTime)}doTickIdle(){var t;const{hls:e,levels:i,media:r,trackId:s}=this,a=e.config;if(!this.buffering||!r&&!this.primaryPrefetch&&(this.startFragRequested||!a.startFragPrefetch)||null==i||!i[s])return;const n=i[s],o=n.details;if(!o||this.waitForLive(n)||this.waitForCdnTuneIn(o))return this.state=Tb,void(this.startFragRequested=!1);const l=this.mediaBuffer?this.mediaBuffer:this.media;this.bufferFlushed&&l&&(this.bufferFlushed=!1,this.afterBufferFlushed(l,Qg,Lg));const c=this.getFwdBufferInfo(l,Lg);if(null===c)return;if(!this.switchingTrack&&this._streamEnded(c,o))return e.trigger(wg.BUFFER_EOS,{type:"audio"}),void(this.state=_b);const d=c.len,h=e.maxBufferLength,p=o.fragments,u=p[0].start,g=this.getLoadPosition(),f=this.flushing?g:c.end;if(this.switchingTrack&&r){const t=g;o.PTSKnown&&t<u&&(c.end>u||c.nextStart)&&(this.log("Alt audio track ahead of main track, seek to start of alt audio track"),r.currentTime=u+.05)}if(d>=h&&!this.switchingTrack&&f<p[p.length-1].start)return;let m=this.getNextFragment(f,o);if(m&&this.isLoopLoading(m,f)&&(m=this.getNextFragmentLoopLoading(m,o,c,Tg,h)),!m)return void(this.bufferFlushed=!0);let v=(null==(t=this.mainFragLoading)?void 0:t.frag)||null;if(!this.audioOnly&&this.startFragRequested&&v&&ef(m)&&!m.endList&&(!o.live||!this.loadingParts&&f<this.hls.liveSyncPosition)&&(this.fragmentTracker.getState(v)===Nm&&(this.mainFragLoading=v=null),v&&ef(v))){if(m.start>v.end){const t=this.fragmentTracker.getFragAtPos(f,Tg);t&&t.end>v.end&&(v=t,this.mainFragLoading={frag:t,targetBufferTime:null})}if(m.start>v.end)return}this.loadFragment(m,n,f)}onMediaDetaching(t,e){this.bufferFlushed=this.flushing=!1,super.onMediaDetaching(t,e)}onAudioTracksUpdated(t,{audioTracks:e}){this.resetTransmuxer(),this.levels=e.map(t=>new nm(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.switchingTrack=e,this.flushAudioIfNeeded(e),this.state!==wb&&(this.setInterval(100),this.state=xb,this.tick())):(this.resetTransmuxer(),this.switchingTrack=null,this.bufferedTrack=e,this.clearInterval())}onManifestLoading(){super.onManifestLoading(),this.bufferFlushed=this.flushing=this.audioOnly=!1,this.resetItem(),this.trackId=-1}onLevelLoaded(t,e){this.mainDetails=e.details;const i=this.cachedTrackLoadedData;i&&(this.cachedTrackLoadedData=null,this.onAudioTrackLoaded(wg.AUDIO_TRACK_LOADED,i))}onAudioTrackLoaded(t,e){var i;const{levels:r}=this,{details:s,id:a,groupId:n,track:o}=e;if(!r)return void this.warn(`Audio tracks reset while loading track ${a} "${o.name}" of "${n}"`);const l=this.mainDetails;if(!l||s.endCC>l.endCC||l.expired)return this.cachedTrackLoadedData=e,void(this.state!==wb&&(this.state=Tb));this.cachedTrackLoadedData=null,this.log(`Audio track ${a} "${o.name}" of "${n}" loaded [${s.startSN},${s.endSN}]${s.lastPartSn?`[part-${s.lastPartSn}-${s.lastPartIndex}]`:""},duration:${s.totalduration}`);const c=r[a];let d=0;if(s.live||null!=(i=c.details)&&i.live){if(this.checkLiveUpdate(s),s.deltaUpdateFailed)return;var h;if(c.details)d=this.alignPlaylists(s,c.details,null==(h=this.levelLastLoaded)?void 0:h.details);s.alignedSliding||(bb(s,l),s.alignedSliding||kb(s,l),d=s.fragmentStart)}c.details=s,this.levelLastLoaded=c,this.startFragRequested||this.setStartPosition(l,d),this.hls.trigger(wg.AUDIO_TRACK_UPDATED,{details:s,id:a,groupId:e.groupId}),this.state!==Tb||this.waitForCdnTuneIn(s)||(this.state=xb),this.tick()}_handleFragmentLoadProgress(t){var e;const i=t.frag,{part:r,payload:s}=t,{config:a,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 l=o[n];if(!l)return void this.warn("Audio track is undefined on fragment load progress");const c=l.details;if(!c)return this.warn("Audio track details undefined on fragment load progress"),void this.removeUnbufferedFrags(i.start);const d=a.defaultAudioCodec||l.audioCodec||"mp4a.40.2";let h=this.transmuxer;h||(h=this.transmuxer=new cy(this.hls,Lg,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)));const p=this.initPTS[i.cc],u=null==(e=i.initSegment)?void 0:e.data;if(void 0!==p){const t=!1,e=r?r.index:-1,a=-1!==e,n=new iv(i.level,i.sn,i.stats.chunkCount,s.byteLength,e,a);h.push(s,u,d,"",i,r,c.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 [${c.startSN} ,${c.endSN}],track ${n}`);const{cache:t}=this.waitingData=this.waitingData||{frag:i,part:r,cache:new Ob,complete:!1};t.push(new Uint8Array(s)),this.state!==wb&&(this.state=Rb)}}_handleFragmentLoadComplete(t){this.waitingData?this.waitingData.complete=!0:super._handleFragmentLoadComplete(t)}onBufferReset(){this.mediaBuffer=null}onBufferCreated(t,e){this.bufferFlushed=this.flushing=!1;const i=e.tracks.audio;i&&(this.mediaBuffer=i.buffer||null)}onFragLoading(t,e){!this.audioOnly&&e.frag.type===Tg&&ef(e.frag)&&(this.mainFragLoading=e,this.state===xb&&this.tick())}onFragBuffered(t,e){const{frag:i,part:r}=e;if(i.type===Lg)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(ef(i)){this.fragPrevious=i;const t=this.switchingTrack;t&&(this.bufferedTrack=t,this.switchingTrack=null,this.hls.trigger(wg.AUDIO_TRACK_SWITCHED,Mg({},t)))}this.fragBufferedComplete(i,r),this.media&&this.tick()}else this.audioOnly||i.type!==Tg||i.elementaryStreams.video||i.elementaryStreams.audiovideo||(this.audioOnly=!0,this.mainFragLoading=null)}onError(t,e){var i;if(e.fatal)this.state=Ab;else switch(e.details){case yg.FRAG_GAP:case yg.FRAG_PARSING_ERROR:case yg.FRAG_DECRYPT_ERROR:case yg.FRAG_LOAD_ERROR:case yg.FRAG_LOAD_TIMEOUT:case yg.KEY_LOAD_ERROR:case yg.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(Lg,e);break;case yg.AUDIO_TRACK_LOAD_ERROR:case yg.AUDIO_TRACK_LOAD_TIMEOUT:case yg.LEVEL_PARSING_ERROR:e.levelRetry||this.state!==Tb||(null==(i=e.context)?void 0:i.type)!==Eg||(this.state=xb);break;case yg.BUFFER_ADD_CODEC_ERROR:case yg.BUFFER_APPEND_ERROR:if("audio"!==e.parent)return;this.reduceLengthAndFlushBuffer(e)||this.resetLoadingState();break;case yg.BUFFER_FULL_ERROR:if("audio"!==e.parent)return;this.reduceLengthAndFlushBuffer(e)&&(this.bufferedTrack=null,super.flushMainBuffer(0,Number.POSITIVE_INFINITY,"audio"));break;case yg.INTERNAL_EXCEPTION:this.recoverWorkerError(e)}}onBufferFlushing(t,{type:e}){e!==Xg&&(this.flushing=!0)}onBufferFlushed(t,{type:e}){if(e!==Xg){this.flushing=!1,this.bufferFlushed=!0,this.state===_b&&(this.state=xb);const t=this.mediaBuffer||this.media;t&&(this.afterBufferFlushed(t,e,Lg),this.tick())}}_handleTransmuxComplete(t){var e;const i="audio",{hls:r}=this,{remuxResult:s,chunkMeta:a}=t,n=this.getCurrentContext(a);if(!n)return void this.resetWhenMissingContext(a);const{frag:o,part:l,level:c}=n,{details:d}=c,{audio:h,text:p,id3:u,initSegment:g}=s;if(!this.fragContextChanged(o)&&d){if(this.state=Lb,this.switchingTrack&&h&&this.completeAudioSwitch(this.switchingTrack),null!=g&&g.tracks){const t=o.initSegment||o;this._bufferInitSegment(c,g.tracks,t,a),r.trigger(wg.FRAG_PARSING_INIT_SEGMENT,{frag:t,id:i,tracks:g.tracks})}if(h){const{startPTS:t,endPTS:e,startDTS:i,endDTS:r}=h;l&&(l.elementaryStreams[Qg]={startPTS:t,endPTS:e,startDTS:i,endDTS:r}),o.setElementaryStreamInfo(Qg,t,e,i,r),this.bufferFragmentData(h,o,l,a)}if(null!=u&&null!=(e=u.samples)&&e.length){const t=Ig({id:i,frag:o,details:d},u);r.trigger(wg.FRAG_PARSING_METADATA,t)}if(p){const t=Ig({id:i,frag:o,details:d},p);r.trigger(wg.FRAG_PARSING_USERDATA,t)}}else this.fragmentTracker.removeFragment(o)}_bufferInitSegment(t,e,i,r){if(this.state!==Lb)return;if(e.video&&delete e.video,e.audiovideo&&delete e.audiovideo,!e.audio)return;const s=e.audio;s.id=Lg;const a=t.audioCodec;this.log(`Init audio buffer, container:${s.container}, codecs[level/parsed]=[${a}/${s.codec}]`),a&&1===a.split(",").length&&(s.levelCodec=a),this.hls.trigger(wg.BUFFER_CODECS,e);const n=s.initSegment;if(null!=n&&n.byteLength){const t={type:"audio",frag:i,part:null,chunkMeta:r,parent:i.type,data:n};this.hls.trigger(wg.BUFFER_APPENDING,t)}this.tickImmediate()}loadFragment(t,e,i){const r=this.fragmentTracker.getState(t);var s;if(this.switchingTrack||r===Um||r===Fm)if(ef(t))if(null!=(s=e.details)&&s.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=Rb;const i=this.mainDetails;i&&i.fragmentStart!==e.details.fragmentStart&&kb(e.details,i)}else super.loadFragment(t,e,i);else this._loadInitSegment(t,e);else this.clearTrackerIfNeeded(t)}flushAudioIfNeeded(t){if(this.media&&this.bufferedTrack){const{name:e,lang:i,assocLang:r,characteristics:s,audioCodec:a,channels:n}=this.bufferedTrack;gm({name:e,lang:i,assocLang:r,characteristics:s,audioCodec:a,channels:n},t,fm)||(vm(t.url,this.hls)?(this.log("Switching audio track : flushing all audio"),super.flushMainBuffer(0,Number.POSITIVE_INFINITY,"audio"),this.bufferedTrack=null):this.bufferedTrack=t)}}completeAudioSwitch(t){const{hls:e}=this;this.flushAudioIfNeeded(t),this.bufferedTrack=t,this.switchingTrack=null,e.trigger(wg.AUDIO_TRACK_SWITCHED,Mg({},t))}},audioTrackController:class extends dy{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(wg.MANIFEST_LOADING,this.onManifestLoading,this),t.on(wg.MANIFEST_PARSED,this.onManifestParsed,this),t.on(wg.LEVEL_LOADING,this.onLevelLoading,this),t.on(wg.LEVEL_SWITCHING,this.onLevelSwitching,this),t.on(wg.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),t.on(wg.ERROR,this.onError,this)}unregisterListeners(){const{hls:t}=this;t.off(wg.MANIFEST_LOADING,this.onManifestLoading,this),t.off(wg.MANIFEST_PARSED,this.onManifestParsed,this),t.off(wg.LEVEL_LOADING,this.onLevelLoading,this),t.off(wg.LEVEL_SWITCHING,this.onLevelSwitching,this),t.off(wg.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),t.off(wg.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:s}=e,a=this.tracksInGroup[i];if(!a||a.groupId!==r)return void this.warn(`Audio track with id:${i} and group:${r} not found in active group ${null==a?void 0:a.groupId}`);const n=a.details;a.details=e.details,this.log(`Audio track ${i} "${a.name}" lang:${a.lang} group:${r} loaded [${s.startSN}-${s.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 s=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(!s&&!this.tracksInGroup.length)return;this.tracksInGroup=t;const e=this.hls.config.audioPreference;if(!s&&e){const i=um(e,t,fm);if(i>-1)s=t[i];else{const t=um(e,this.tracks);s=this.tracks[t]}}let r=this.findTrackId(s);-1===r&&s&&(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(wg.AUDIO_TRACKS_UPDATED,n);const o=this.trackId;if(-1!==r&&-1===o)this.setAudioTrack(r);else if(t.length&&-1===o){var a;const e=new Error(`No audio track selected for current audio group-ID(s): ${null==(a=this.groupIds)?void 0:a.join(",")} track count: ${t.length}`);this.warn(e.message),this.hls.trigger(wg.ERROR,{type:kg.MEDIA_ERROR,details:yg.AUDIO_TRACK_LOAD_ERROR,fatal:!0,error:e})}}}onError(t,e){!e.fatal&&e.context&&(e.context.type!==Eg||e.context.id!==this.trackId||this.groupIds&&-1===this.groupIds.indexOf(e.context.groupId)||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&&gm(t,r,fm))return r;const s=um(t,this.tracksInGroup,fm);if(s>-1){const t=this.tracksInGroup[s];return this.setAudioTrack(s),t}if(r){let r=e.loadLevel;-1===r&&(r=e.firstAutoLevel);const s=function(t,e,i,r,s){const a=e[r],n=e.reduce((t,e,i)=>{const r=e.uri;return(t[r]||(t[r]=[])).push(i),t},{}),o=n[a.uri];o.length>1&&(r=Math.max.apply(Math,o));const l=a.videoRange,c=a.frameRate,d=a.codecSet.substring(0,4),h=mm(e,r,e=>{if(e.videoRange!==l||e.frameRate!==c||e.codecSet.substring(0,4)!==d)return!1;const r=e.audioGroups,a=i.filter(t=>!r||-1!==r.indexOf(t.groupId));return um(t,a,s)>-1});return h>-1?h:mm(e,r,e=>{const r=e.audioGroups,a=i.filter(t=>!r||-1!==r.indexOf(t.groupId));return um(t,a,s)>-1})}(t,e.levels,i,r,fm);if(-1===s)return null;e.nextLoadLevel=s}if(t.channels||t.audioCodec){const e=um(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.selectDefaultTrack=!1;const i=this.currentTrack,r=e[t],s=r.details&&!r.details.live;if(t===this.trackId&&r===i&&s)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(wg.AUDIO_TRACK_SWITCHING,Mg({},r)),s)return;const a=this.switchParams(r.url,null==i?void 0:i.details,r.details);this.loadPlaylist(a)}findTrackId(t){const e=this.tracksInGroup;for(let i=0;i<e.length;i++){const r=e[i];if((!this.selectDefaultTrack||r.default)&&(!t||gm(t,r,fm)))return i}if(t){const{name:i,lang:r,assocLang:s,characteristics:a,audioCodec:n,channels:o}=t;for(let t=0;t<e.length;t++){if(gm({name:i,lang:r,assocLang:s,characteristics:a,audioCodec:n,channels:o},e[t],fm))return t}for(let i=0;i<e.length;i++){const r=e[i];if(py(t.attrs,r.attrs,["LANGUAGE","ASSOC-LANGUAGE","CHARACTERISTICS"]))return i}for(let i=0;i<e.length;i++){const r=e[i];if(py(t.attrs,r.attrs,["LANGUAGE"]))return i}}return-1}loadPlaylist(t){super.loadPlaylist();const e=this.currentTrack;this.shouldLoadPlaylist(e)&&vm(e.url,this.hls)&&this.scheduleLoading(e,t)}loadingPlaylist(t,e){super.loadingPlaylist(t,e);const i=t.id,r=t.groupId,s=this.getUrlWithDirectives(t.url,e),a=t.details,n=null==a?void 0:a.age;this.log(`Loading audio-track ${i} "${t.name}" lang:${t.lang} group:${r}${void 0!==(null==e?void 0:e.msn)?" at sn "+e.msn+" part "+e.part:""}${n&&a.live?" age "+n.toFixed(1)+(a.type&&" "+a.type||""):""} ${s}`),this.hls.trigger(wg.AUDIO_TRACK_LOADING,{url:s,id:i,groupId:r,deliveryDirectives:e||null,track:t})}},emeController:iw,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:wy.MANIFEST,su:!this.initialized})}catch(t){this.hls.logger.warn("Could not generate manifest CMCD data.",t)}},this.applyFragmentData=t=>{try{const{frag:e,part:i}=t,r=this.hls.levels[e.level],s=this.getObjectType(e),a={d:1e3*(i||e).duration,ot:s};s!==wy.VIDEO&&s!==wy.AUDIO&&s!=wy.MUXED||(a.br=r.bitrate/1e3,a.tb=this.getTopBandwidth(s)/1e3,a.bl=this.getBufferLength(s));const n=i?this.getNextPart(i):this.getNextFrag(e);null!=n&&n.url&&n.url!==e.url&&(a.nor=n.url),this.apply(t,a)}catch(t){this.hls.logger.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||t.sessionId,this.cid=i.contentId,this.useHeaders=!0===i.useHeaders,this.includeKeys=i.includeKeys,this.registerListeners())}registerListeners(){const t=this.hls;t.on(wg.MEDIA_ATTACHED,this.onMediaAttached,this),t.on(wg.MEDIA_DETACHED,this.onMediaDetached,this),t.on(wg.BUFFER_CREATED,this.onBufferCreated,this)}unregisterListeners(){const t=this.hls;t.off(wg.MEDIA_ATTACHED,this.onMediaAttached,this),t.off(wg.MEDIA_DETACHED,this.onMediaDetached,this),t.off(wg.BUFFER_CREATED,this.onBufferCreated,this)}destroy(){this.unregisterListeners(),this.onMediaDetached(),this.hls=this.config=this.audioBuffer=this.videoBuffer=null,this.onWaiting=this.onPlaying=this.media=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:xy.HLS,sid:this.sid,cid:this.cid,pr:null==(t=this.media)?void 0:t.playbackRate,mtp:this.hls.bandwidthEstimate/1e3}}apply(t,e={}){Ig(e,this.createData());const i=e.ot===wy.INIT||e.ot===wy.VIDEO||e.ot===wy.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),{}));const s={baseUrl:t.url};this.useHeaders?(t.headers||(t.headers={}),Wy(t.headers,e,s)):t.url=Qy(t.url,e,s)}getNextFrag(t){var e;const i=null==(e=this.hls.levels[t.level])?void 0:e.details;if(i){const e=t.sn-i.startSN;return i.fragments[e+1]}}getNextPart(t){var e,i;const{index:r,fragment:s}=t,a=null==(e=this.hls.levels[s.level])||null==(i=e.details)?void 0:i.partList;if(a){const{sn:t}=s;for(let e=a.length-1;e>=0;e--){const i=a[e];if(i.index===r&&i.fragment.sn===t)return a[e+1]}}}getObjectType(t){const{type:e}=t;return"subtitle"===e?wy.TIMED_TEXT:"initSegment"===t.sn?wy.INIT:"audio"===e?wy.AUDIO:"main"===e?this.hls.audioTracks.length?wy.VIDEO:wy.MUXED:void 0}getTopBandwidth(t){let e,i=0;const r=this.hls;if(t===wy.AUDIO)e=r.audioTracks;else{const t=r.maxAutoLevel,i=t>-1?t+1:r.levels.length;e=r.levels.slice(0,i)}return e.forEach(t=>{t.bitrate>i&&(i=t.bitrate)}),i>0?i:NaN}getBufferLength(t){const e=this.media,i=t===wy.AUDIO?this.audioBuffer:this.videoBuffer;if(!i||!e)return NaN;return 1e3*sv.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 extends Og{constructor(t){super("content-steering",t.logger),this.hls=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.registerListeners()}registerListeners(){const t=this.hls;t.on(wg.MANIFEST_LOADING,this.onManifestLoading,this),t.on(wg.MANIFEST_LOADED,this.onManifestLoaded,this),t.on(wg.MANIFEST_PARSED,this.onManifestParsed,this),t.on(wg.ERROR,this.onError,this)}unregisterListeners(){const t=this.hls;t&&(t.off(wg.MANIFEST_LOADING,this.onManifestLoading,this),t.off(wg.MANIFEST_LOADED,this.onManifestLoaded,this),t.off(wg.MANIFEST_PARSED,this.onManifestParsed,this),t.off(wg.ERROR,this.onError,this))}pathways(){return(this.levels||[]).reduce((t,e)=>(-1===t.indexOf(e.pathwayId)&&t.push(e.pathwayId),t),[])}get pathwayPriority(){return this._pathwayPriority}set pathwayPriority(t){this.updatePathwayPriority(t)}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)===_m&&i.flags===Dm){const t=this.levels;let r=this._pathwayPriority,s=this.pathwayId;if(e.context){const{groupId:i,pathwayId:r,type:a}=e.context;i&&t?s=this.getPathwayForGroupId(i,a,s):r&&(s=r)}s in this.penalizedPathways||(this.penalizedPathways[s]=performance.now()),!r&&t&&(r=this.pathways()),r&&r.length>1&&(this.updatePathwayPriority(r),i.resolved=this.pathwayId!==s),e.details!==yg.BUFFER_APPEND_ERROR||e.fatal?i.resolved||this.warn(`Could not resolve ${e.details} ("${e.error.message}") with content-steering for Pathway: ${s} levels: ${t?t.length:t} priorities: ${cm(r)} penalized: ${cm(this.penalizedPathways)}`):i.resolved=!0}}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 s=t[r];if(s in i)continue;if(s===this.pathwayId)return;const a=this.hls.nextLoadLevel,n=this.hls.levels[a];if(e=this.getLevelsForPathway(s),e.length>0){this.log(`Setting Pathway to "${s}"`),this.pathwayId=s,gb(e),this.hls.trigger(wg.LEVELS_UPDATED,{levels:e});const t=this.hls.levels[a];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=a);break}}}getPathwayForGroupId(t,e,i){const r=this.getLevelsForPathway(i).concat(this.levels||[]);for(let i=0;i<r.length;i++)if(e===Eg&&r[i].hasAudioGroup(t)||e===Pg&&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:s,"BASE-ID":a,"URI-REPLACEMENT":n}=t;if(e.some(t=>t.pathwayId===s))return;const o=this.getLevelsForPathway(a).map(t=>{const e=new pv(t.attrs);e["PATHWAY-ID"]=s;const a=e.AUDIO&&`${e.AUDIO}_clone_${s}`,o=e.SUBTITLES&&`${e.SUBTITLES}_clone_${s}`;a&&(i[e.AUDIO]=a,e.AUDIO=a),o&&(r[e.SUBTITLES]=o,e.SUBTITLES=o);const l=Jy(t.uri,e["STABLE-VARIANT-ID"],"PER-VARIANT-URIS",n),c=new nm({attrs:e,audioCodec:t.audioCodec,bitrate:t.bitrate,height:t.height,name:t.name,url:l,videoCodec:t.videoCodec,width:t.width});if(t.audioGroups)for(let e=1;e<t.audioGroups.length;e++)c.addGroupId("audio",`${t.audioGroups[e]}_clone_${s}`);if(t.subtitleGroups)for(let e=1;e<t.subtitleGroups.length;e++)c.addGroupId("text",`${t.subtitleGroups[e]}_clone_${s}`);return c});e.push(...o),Xy(this.audioTracks,i,n,s),Xy(this.subtitleTracks,r,n,s)})}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 s={responseType:"json",url:r.href},a=e.steeringManifestLoadPolicy.default,n=a.errorRetry||a.timeoutRetry||{},o={loadPolicy:a,timeout:a.maxLoadTimeMs,maxRetry:n.maxNumRetry||0,retryDelay:n.retryDelayMs||0,maxRetryDelay:n.maxRetryDelayMs||0},l={onSuccess:(t,e,i,s)=>{this.log(`Loaded steering manifest: "${r}"`);const a=t.data;if(1!==(null==a?void 0:a.VERSION))return void this.log(`Steering VERSION ${a.VERSION} not supported!`);this.updated=performance.now(),this.timeToLoad=a.TTL;const{"RELOAD-URI":n,"PATHWAY-CLONES":o,"PATHWAY-PRIORITY":l}=a;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 c={steeringManifest:a,url:r.toString()};this.hls.trigger(wg.STEERING_MANIFEST_LOADED,c),l&&this.updatePathwayPriority(l)},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 s=1e3*this.timeToLoad;if(429===t.code){const t=this.loader;if("function"==typeof(null==t?void 0:t.getResponseHeader)){const e=t.getResponseHeader("Retry-After");e&&(s=1e3*parseFloat(e))}return void this.log(`Steering manifest ${e.url} rate limited`)}this.scheduleRefresh(this.uri||e.url,s)},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(s,o,l)}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)}},interstitialsController:class extends Og{constructor(t,e){super("interstitials",t.logger),this.HlsPlayerClass=void 0,this.hls=void 0,this.assetListLoader=void 0,this.mediaSelection=null,this.altSelection=null,this.media=null,this.detachedData=null,this.requiredTracks=null,this.manager=null,this.playerQueue=[],this.bufferedPos=-1,this.timelinePos=-1,this.schedule=void 0,this.playingItem=null,this.bufferingItem=null,this.waitingItem=null,this.endedItem=null,this.playingAsset=null,this.endedAsset=null,this.bufferingAsset=null,this.shouldPlay=!1,this.onPlay=()=>{this.shouldPlay=!0},this.onPause=()=>{this.shouldPlay=!1},this.onSeeking=()=>{const t=this.currentTime;if(void 0===t||this.playbackDisabled)return;const e=t-this.timelinePos;if(Math.abs(e)<1/7056e5)return;const i=e<=-.01;this.timelinePos=t,this.bufferedPos=t;const r=this.playingItem;if(!r)return void this.checkBuffer();if(i){this.schedule.resetErrorsInRange(t,t-e)&&this.updateSchedule()}if(this.checkBuffer(),i&&t<r.start||t>=r.end){var s;const t=this.schedule.findItemIndexAtTime(this.timelinePos);if(!this.isInterstitial(r)&&null!=(s=this.media)&&s.paused&&(this.shouldPlay=!1),!i){const e=this.findItemIndex(r);if(t>e){const i=this.schedule.findJumpRestrictedIndex(e+1,t);if(i>e)return void this.setSchedulePosition(i)}}return void this.setSchedulePosition(t)}const a=this.playingAsset;if(!a){if(this.playingLastItem&&this.isInterstitial(r)){const e=r.event.assetList[0];e&&(this.endedItem=this.playingItem,this.playingItem=null,this.setScheduleToAssetAtTime(t,e))}return}const n=a.timelineStart,o=a.duration||0;(i&&t<n||t>=n+o)&&this.setScheduleToAssetAtTime(t,a)},this.onTimeupdate=()=>{const t=this.currentTime;if(void 0===t||this.playbackDisabled)return;if(!(t>this.timelinePos))return;this.timelinePos=t,t>this.bufferedPos&&this.checkBuffer();const e=this.playingItem;if(!e||this.playingLastItem)return;if(t>=e.end){this.timelinePos=e.end;const t=this.findItemIndex(e);this.setSchedulePosition(t+1)}const i=this.playingAsset;if(!i)return;t>=i.timelineStart+(i.duration||0)&&this.setScheduleToAssetAtTime(t,i)},this.onScheduleUpdate=(t,e)=>{const i=this.schedule,r=this.playingItem,s=i.events||[],a=i.items||[],n=i.durations,o=t.map(t=>t.identifier),l=!(!s.length&&!o.length);(l||e)&&this.log(`INTERSTITIALS_UPDATED (${s.length}): ${s}\nSchedule: ${a.map(t=>yw(t))} pos: ${this.timelinePos}`),o.length&&this.log(`Removed events ${o}`),this.playerQueue.forEach(t=>{if(t.interstitial.appendInPlace){const e=t.assetItem.timelineStart,i=t.timelineOffset-e;if(i)try{t.timelineOffset=e}catch(r){Math.abs(i)>dw&&this.warn(`${r} ("${t.assetId}" ${t.timelineOffset}->${e})`)}}});let c=null;if(r){const t=this.updateItem(r,this.timelinePos);this.itemsMatch(r,t)&&(this.playingItem=t,this.waitingItem=this.endedItem=null,c=()=>this.trimInPlace(t,r))}else this.waitingItem=this.updateItem(this.waitingItem),this.endedItem=this.updateItem(this.endedItem);const d=this.bufferingItem;if(d){const t=this.updateItem(d,this.bufferedPos);this.itemsMatch(d,t)?(this.bufferingItem=t,c||(c=()=>this.trimInPlace(t,d))):d.event&&(this.bufferingItem=this.playingItem,this.clearInterstitial(d.event,null))}if(t.forEach(t=>{t.assetList.forEach(t=>{this.clearAssetPlayer(t.identifier,null)})}),l||e){if(this.hls.trigger(wg.INTERSTITIALS_UPDATED,{events:s.slice(0),schedule:a.slice(0),durations:n,removedIds:o}),this.isInterstitial(r)&&o.includes(r.event.identifier))return this.warn(`Interstitial "${r.event.identifier}" removed while playing`),void this.primaryFallback(r.event);c&&c(),this.checkBuffer()}},this.hls=t,this.HlsPlayerClass=e,this.assetListLoader=new ww(t),this.schedule=new kw(this.onScheduleUpdate,t.logger),this.registerListeners()}registerListeners(){const t=this.hls;t.on(wg.MEDIA_ATTACHING,this.onMediaAttaching,this),t.on(wg.MEDIA_ATTACHED,this.onMediaAttached,this),t.on(wg.MEDIA_DETACHING,this.onMediaDetaching,this),t.on(wg.MANIFEST_LOADING,this.onManifestLoading,this),t.on(wg.LEVEL_UPDATED,this.onLevelUpdated,this),t.on(wg.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),t.on(wg.AUDIO_TRACK_UPDATED,this.onAudioTrackUpdated,this),t.on(wg.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),t.on(wg.SUBTITLE_TRACK_UPDATED,this.onSubtitleTrackUpdated,this),t.on(wg.EVENT_CUE_ENTER,this.onInterstitialCueEnter,this),t.on(wg.ASSET_LIST_LOADED,this.onAssetListLoaded,this),t.on(wg.BUFFER_APPENDED,this.onBufferAppended,this),t.on(wg.BUFFER_FLUSHED,this.onBufferFlushed,this),t.on(wg.BUFFERED_TO_END,this.onBufferedToEnd,this),t.on(wg.MEDIA_ENDED,this.onMediaEnded,this),t.on(wg.ERROR,this.onError,this),t.on(wg.DESTROYING,this.onDestroying,this)}unregisterListeners(){const t=this.hls;t&&(t.off(wg.MEDIA_ATTACHING,this.onMediaAttaching,this),t.off(wg.MEDIA_ATTACHED,this.onMediaAttached,this),t.off(wg.MEDIA_DETACHING,this.onMediaDetaching,this),t.off(wg.MANIFEST_LOADING,this.onManifestLoading,this),t.off(wg.LEVEL_UPDATED,this.onLevelUpdated,this),t.off(wg.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),t.off(wg.AUDIO_TRACK_UPDATED,this.onAudioTrackUpdated,this),t.off(wg.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),t.off(wg.SUBTITLE_TRACK_UPDATED,this.onSubtitleTrackUpdated,this),t.off(wg.EVENT_CUE_ENTER,this.onInterstitialCueEnter,this),t.off(wg.ASSET_LIST_LOADED,this.onAssetListLoaded,this),t.off(wg.BUFFER_CODECS,this.onBufferCodecs,this),t.off(wg.BUFFER_APPENDED,this.onBufferAppended,this),t.off(wg.BUFFER_FLUSHED,this.onBufferFlushed,this),t.off(wg.BUFFERED_TO_END,this.onBufferedToEnd,this),t.off(wg.MEDIA_ENDED,this.onMediaEnded,this),t.off(wg.ERROR,this.onError,this),t.off(wg.DESTROYING,this.onDestroying,this))}startLoad(){this.resumeBuffering()}stopLoad(){this.pauseBuffering()}resumeBuffering(){var t;null==(t=this.getBufferingPlayer())||t.resumeBuffering()}pauseBuffering(){var t;null==(t=this.getBufferingPlayer())||t.pauseBuffering()}destroy(){this.unregisterListeners(),this.stopLoad(),this.assetListLoader&&this.assetListLoader.destroy(),this.emptyPlayerQueue(),this.clearScheduleState(),this.schedule&&this.schedule.destroy(),this.media=this.detachedData=this.mediaSelection=this.requiredTracks=this.altSelection=this.manager=null,this.hls=this.HlsPlayerClass=this.schedule=this.log=null,this.assetListLoader=null,this.onPlay=this.onPause=this.onSeeking=this.onTimeupdate=null,this.onScheduleUpdate=null}onDestroying(){const t=this.primaryMedia||this.media;t&&this.removeMediaListeners(t)}removeMediaListeners(t){ew(t,"play",this.onPlay),ew(t,"pause",this.onPause),ew(t,"seeking",this.onSeeking),ew(t,"timeupdate",this.onTimeupdate)}onMediaAttaching(t,e){const i=this.media=e.media;tw(i,"seeking",this.onSeeking),tw(i,"timeupdate",this.onTimeupdate),tw(i,"play",this.onPlay),tw(i,"pause",this.onPause)}onMediaAttached(t,e){const i=this.effectivePlayingItem,r=this.detachedData;if(this.detachedData=null,null===i)this.checkStart();else if(!r){this.clearScheduleState();const t=this.findItemIndex(i);this.setSchedulePosition(t)}}clearScheduleState(){this.playingItem=this.bufferingItem=this.waitingItem=this.endedItem=this.playingAsset=this.endedAsset=this.bufferingAsset=null}onMediaDetaching(t,e){const i=!!e.transferMedia,r=this.media;if(this.media=null,!i&&(r&&this.removeMediaListeners(r),this.detachedData)){const t=this.getBufferingPlayer();t&&(this.playingAsset=this.endedAsset=this.bufferingAsset=this.bufferingItem=this.waitingItem=this.detachedData=null,t.detachMedia()),this.shouldPlay=!1}}get interstitialsManager(){if(!this.manager){if(!this.hls)return null;const t=this,e=()=>t.bufferingItem||t.waitingItem,i=e=>e?t.getAssetPlayer(e.identifier):e,r=(e,r,s,n,o)=>{if(e){let l=e[r].start;const c=e.event;if(c){if("playout"===r||c.timelineOccupancy!==hw.Point){const t=i(s);(null==t?void 0:t.interstitial)===c&&(l+=t.assetItem.startOffset+t[o])}}else{l+=("bufferedPos"===n?a():t[n])-e.start}return l}return 0},s=(e,i)=>{if(0!==e&&"primary"!==i&&t.schedule.length){var r;const s=t.schedule.findItemIndexAtTime(e),a=null==(r=t.schedule.items)?void 0:r[s];if(a){return e+(a[i].start-a.start)}}return e},a=()=>{const e=t.bufferedPos;return e===Number.MAX_VALUE?n("primary"):Math.max(e,0)},n=e=>{var i;return null!=(i=t.primaryDetails)&&i.live?t.primaryDetails.edge:t.schedule.durations[e]},o=(e,s)=>{var a,n;const o=t.effectivePlayingItem;if(null!=o&&null!=(a=o.event)&&a.restrictions.skip)return;t.log(`seek to ${e} "${s}"`);const l=t.effectivePlayingItem,c=t.schedule.findItemIndexAtTime(e,s),d=null==(n=t.schedule.items)?void 0:n[c],h=t.getBufferingPlayer(),p=null==h?void 0:h.interstitial,u=null==p?void 0:p.appendInPlace,g=l&&t.itemsMatch(l,d);if(l&&(u||g)){const a=i(t.playingAsset),n=(null==a?void 0:a.media)||t.primaryMedia;if(n){const i="primary"===s?n.currentTime:r(l,s,t.playingAsset,"timelinePos","currentTime"),o=e-i,c=(u?i:n.currentTime)+o;if(c>=0&&(!a||u||c<=a.duration))return void(n.currentTime=c)}}if(d){let i=e;if("primary"!==s){const t=e-d[s].start;i=d.start+t}const r=!t.isInterstitial(d);if(t.isInterstitial(l)&&!l.event.appendInPlace||!r&&!d.event.appendInPlace){if(l){const a=t.findItemIndex(l);if(c>a){const e=t.schedule.findJumpRestrictedIndex(a+1,c);if(e>a)return void t.setSchedulePosition(e)}let n=0;if(r)t.timelinePos=i,t.checkBuffer();else{var f;const t=null==d||null==(f=d.event)?void 0:f.assetList;if(t){const i=e-(d[s]||d).start;for(let e=t.length;e--;){const r=t[e];if(r.duration&&i>=r.startOffset&&i<r.startOffset+r.duration){n=e;break}}}}t.setSchedulePosition(c,n)}}else{const e=t.media||(u?null==h?void 0:h.media:null);e&&(e.currentTime=i)}}},l=()=>{const i=t.effectivePlayingItem;if(t.isInterstitial(i))return i;const r=e();return t.isInterstitial(r)?r:null},c={get currentTime(){const e=l(),i=t.effectivePlayingItem;return i&&i===e?r(i,"playout",t.effectivePlayingAsset,"timelinePos","currentTime")-i.playout.start:0},set currentTime(e){const i=l(),r=t.effectivePlayingItem;r&&r===i&&o(e+r.playout.start,"playout")},get duration(){const t=l();return t?t.playout.end-t.playout.start:0},get assetPlayers(){var e;const i=null==(e=l())?void 0:e.event.assetList;return i?i.map(e=>t.getAssetPlayer(e.identifier)):[]},get playingIndex(){var e;const i=null==(e=l())?void 0:e.event;return i&&t.effectivePlayingAsset?i.findAssetIndex(t.effectivePlayingAsset):-1},get scheduleItem(){return l()}};this.manager={get events(){var e,i;return(null==(e=t.schedule)||null==(i=e.events)?void 0:i.slice(0))||[]},get schedule(){var e,i;return(null==(e=t.schedule)||null==(i=e.items)?void 0:i.slice(0))||[]},get interstitialPlayer(){return l()?c:null},get playerQueue(){return t.playerQueue.slice(0)},get bufferingAsset(){return t.bufferingAsset},get bufferingItem(){return e()},get bufferingIndex(){const i=e();return t.findItemIndex(i)},get playingAsset(){return t.effectivePlayingAsset},get playingItem(){return t.effectivePlayingItem},get playingIndex(){const e=t.effectivePlayingItem;return t.findItemIndex(e)},primary:{get bufferedEnd(){return a()},get currentTime(){const e=t.timelinePos;return e>0?e:0},set currentTime(t){o(t,"primary")},get duration(){return n("primary")},get seekableStart(){var e;return(null==(e=t.primaryDetails)?void 0:e.fragmentStart)||0}},integrated:{get bufferedEnd(){return r(e(),"integrated",t.bufferingAsset,"bufferedPos","bufferedEnd")},get currentTime(){return r(t.effectivePlayingItem,"integrated",t.effectivePlayingAsset,"timelinePos","currentTime")},set currentTime(t){o(t,"integrated")},get duration(){return n("integrated")},get seekableStart(){var e;return s((null==(e=t.primaryDetails)?void 0:e.fragmentStart)||0,"integrated")}},skip:()=>{const e=t.effectivePlayingItem,i=null==e?void 0:e.event;if(i&&!i.restrictions.skip){const r=t.findItemIndex(e);if(i.appendInPlace){const t=e.playout.start+e.event.duration;o(t+.001,"playout")}else t.advanceAfterAssetEnded(i,r,1/0)}}}}return this.manager}get effectivePlayingItem(){return this.waitingItem||this.playingItem||this.endedItem}get effectivePlayingAsset(){return this.playingAsset||this.endedAsset}get playingLastItem(){var t;const e=this.playingItem,i=null==(t=this.schedule)?void 0:t.items;return!!(this.playbackStarted&&e&&i)&&this.findItemIndex(e)===i.length-1}get playbackStarted(){return null!==this.effectivePlayingItem}get currentTime(){var t,e,i;if(null===this.mediaSelection)return;const r=this.waitingItem||this.playingItem;if(this.isInterstitial(r)&&!r.event.appendInPlace)return;let s=this.media;!s&&null!=(t=this.bufferingItem)&&null!=(e=t.event)&&e.appendInPlace&&(s=this.primaryMedia);const a=null==(i=s)?void 0:i.currentTime;return void 0!==a&&mg(a)?a:void 0}get primaryMedia(){var t;return this.media||(null==(t=this.detachedData)?void 0:t.media)||null}isInterstitial(t){return!(null==t||!t.event)}retreiveMediaSource(t,e){const i=this.getAssetPlayer(t);i&&this.transferMediaFromPlayer(i,e)}transferMediaFromPlayer(t,e){const i=t.interstitial.appendInPlace,r=t.media;if(i&&r===this.primaryMedia){if(this.bufferingAsset=null,(!e||this.isInterstitial(e)&&!e.event.appendInPlace)&&e&&r)return void(this.detachedData={media:r});const i=t.transferMedia();this.log(`transfer MediaSource from ${t} ${cm(i)}`),this.detachedData=i}else e&&r&&(this.shouldPlay||(this.shouldPlay=!r.paused))}transferMediaTo(t,e){var i,r;if(t.media===e)return;let s=null;const a=this.hls,n=t!==a,o=n&&t.interstitial.appendInPlace,l=null==(i=this.detachedData)?void 0:i.mediaSource;let c;if(a.media)o&&(s=a.transferMedia(),this.detachedData=s),c="Primary";else if(l){const t=this.getBufferingPlayer();t?(s=t.transferMedia(),c=`${t}`):c="detached MediaSource"}else c="detached media";if(!s)if(l)s=this.detachedData,this.log(`using detachedData: MediaSource ${cm(s)}`);else if(!this.detachedData||a.media===e){const t=this.playerQueue;t.length>1&&t.forEach(t=>{if(n&&t.interstitial.appendInPlace!==o){const e=t.interstitial;this.clearInterstitial(t.interstitial,null),e.appendInPlace=!1,e.appendInPlace&&this.warn(`Could not change append strategy for queued assets ${e}`)}}),this.hls.detachMedia(),this.detachedData={media:e}}const d=s&&"mediaSource"in s&&"closed"!==(null==(r=s.mediaSource)?void 0:r.readyState),h=d&&s?s:e;if(this.log(`${d?"transfering MediaSource":"attaching media"} to ${n?t:"Primary"} from ${c}`),h===s){const e=n&&t.assetId===this.schedule.assetIdAtEnd;h.overrides={duration:this.schedule.duration,endOfStream:!n||e,cueRemoval:!n}}t.attachMedia(h)}onInterstitialCueEnter(){this.onTimeupdate()}checkStart(){const t=this.schedule,e=t.events;if(!e||this.playbackDisabled||!this.media)return;-1===this.bufferedPos&&(this.bufferedPos=0);const i=this.timelinePos,r=this.effectivePlayingItem;if(-1===i){const i=this.hls.startPosition;if(this.timelinePos=i,e.length&&e[0].cue.pre){const i=t.findEventIndex(e[0].identifier);this.setSchedulePosition(i)}else if(i>=0||!this.primaryLive){const e=this.timelinePos=i>0?i:0,r=t.findItemIndexAtTime(e);this.setSchedulePosition(r)}}else if(r&&!this.playingItem){const e=t.findItemIndex(r);this.setSchedulePosition(e)}}advanceAfterAssetEnded(t,e,i){const r=mw(t,i);if(t.isAssetPastPlayoutLimit(r)){const i=this.schedule.items;if(i){const r=e+1;if(r>=i.length)return void this.setSchedulePosition(-1);const s=t.resumeTime;this.timelinePos<s&&(this.timelinePos=s,this.checkBuffer()),this.setSchedulePosition(r)}}else this.setSchedulePosition(e,r)}setScheduleToAssetAtTime(t,e){const i=this.schedule,r=e.parentIdentifier,s=i.getEvent(r);if(s){const e=i.findEventIndex(r),a=i.findAssetIndex(s,t);this.advanceAfterAssetEnded(s,e,a-1)}}setSchedulePosition(t,e){const i=this.schedule.items;if(!i||this.playbackDisabled)return;this.log(`setSchedulePosition ${t}, ${e}`);const r=t>=0?i[t]:null,s=this.playingItem,a=this.playingLastItem;if(this.isInterstitial(s)){var n;const l=s.event,c=this.playingAsset,d=null==c?void 0:c.identifier,h=d?this.getAssetPlayer(d):null;if(h&&d&&(!this.eventItemsMatch(s,r)||void 0!==e&&d!==(null==(n=l.assetList)?void 0:n[e].identifier))){var o;const e=l.findAssetIndex(c);if(this.log(`INTERSTITIAL_ASSET_ENDED ${e+1}/${l.assetList.length} ${vw(c)}`),this.endedAsset=c,this.playingAsset=null,this.hls.trigger(wg.INTERSTITIAL_ASSET_ENDED,{asset:c,assetListIndex:e,event:l,schedule:i.slice(0),scheduleIndex:t,player:h}),s!==this.playingItem)return void(this.itemsMatch(s,this.playingItem)&&!this.playingAsset&&this.advanceAfterAssetEnded(l,this.findItemIndex(this.playingItem),e));this.retreiveMediaSource(d,r),!h.media||null!=(o=this.detachedData)&&o.mediaSource||h.detachMedia()}if(!this.eventItemsMatch(s,r)&&(this.endedItem=s,this.playingItem=null,this.log(`INTERSTITIAL_ENDED ${l} ${yw(s)}`),l.hasPlayed=!0,this.hls.trigger(wg.INTERSTITIAL_ENDED,{event:l,schedule:i.slice(0),scheduleIndex:t}),l.cue.once)){this.updateSchedule();const t=this.schedule.items;if(r&&t){const i=this.findItemIndex(r);this.advanceSchedule(i,t,e,s,a)}return}}this.advanceSchedule(t,i,e,s,a)}advanceSchedule(t,e,i,r,s){const a=t>=0?e[t]:null,n=this.primaryMedia,o=this.playerQueue;if(o.length&&o.forEach(e=>{const i=e.interstitial,r=this.schedule.findEventIndex(i.identifier);(r<t||r>t+1)&&this.clearInterstitial(i,a)}),this.isInterstitial(a)){this.timelinePos=Math.min(Math.max(this.timelinePos,a.start),a.end);const s=a.event;if(void 0===i){const e=mw(s,(i=this.schedule.findAssetIndex(s,this.timelinePos))-1);if(s.isAssetPastPlayoutLimit(e))return void this.advanceAfterAssetEnded(s,t,i);i=e}const o=this.waitingItem;this.assetsBuffered(a,n)||this.setBufferingItem(a);let l=this.preloadAssets(s,i);if(this.eventItemsMatch(a,o||r)||(this.waitingItem=a,this.log(`INTERSTITIAL_STARTED ${yw(a)} ${s.appendInPlace?"append in place":""}`),this.hls.trigger(wg.INTERSTITIAL_STARTED,{event:s,schedule:e.slice(0),scheduleIndex:t})),!s.assetListLoaded)return void this.log(`Waiting for ASSET-LIST to complete loading ${s}`);if(s.assetListLoader&&(s.assetListLoader.destroy(),s.assetListLoader=void 0),!n)return void this.log(`Waiting for attachMedia to start Interstitial ${s}`);this.waitingItem=this.endedItem=null,this.playingItem=a;const c=s.assetList[i];if(!c){const r=e[t+1],a=this.media;return r&&a&&!this.isInterstitial(r)&&a.currentTime<r.start&&(a.currentTime=this.timelinePos=r.start),void this.advanceAfterAssetEnded(s,t,i||0)}if(l||(l=this.getAssetPlayer(c.identifier)),null===l||l.destroyed){const t=s.assetList.length;this.warn(`asset ${i+1}/${t} player destroyed ${s}`),l=this.createAssetPlayer(s,c,i)}if(!this.eventItemsMatch(a,this.bufferingItem)&&s.appendInPlace&&this.isAssetBuffered(c))return;this.startAssetPlayer(l,i,e,t,n),this.shouldPlay&&xw(l.media)}else null!==a?(this.resumePrimary(a,t,r),this.shouldPlay&&xw(this.hls.media)):s&&this.isInterstitial(r)&&(this.endedItem=null,this.playingItem=r,r.event.appendInPlace||this.attachPrimary(this.schedule.durations.primary,null))}get playbackDisabled(){return!1===this.hls.config.enableInterstitialPlayback}get primaryDetails(){var t,e;return null==(t=this.mediaSelection)||null==(e=t.main)?void 0:e.details}get primaryLive(){var t;return!(null==(t=this.primaryDetails)||!t.live)}resumePrimary(t,e,i){var r;if(this.playingItem=t,this.playingAsset=this.endedAsset=null,this.waitingItem=this.endedItem=null,this.bufferedToItem(t),this.log(`resuming ${yw(t)}`),null==(r=this.detachedData)||!r.mediaSource){let i=this.timelinePos;(i<t.start||i>=t.end)&&(i=this.getPrimaryResumption(t,e),this.timelinePos=i),this.attachPrimary(i,t)}if(!i)return;const s=this.schedule.items;s&&(this.log(`INTERSTITIALS_PRIMARY_RESUMED ${yw(t)}`),this.hls.trigger(wg.INTERSTITIALS_PRIMARY_RESUMED,{schedule:s.slice(0),scheduleIndex:e}),this.checkBuffer())}getPrimaryResumption(t,e){const i=t.start;if(this.primaryLive){const t=this.primaryDetails;if(0===e)return this.hls.startPosition;if(t&&(i<t.fragmentStart||i>t.edge))return this.hls.liveSyncPosition||-1}return i}isAssetBuffered(t){const e=this.getAssetPlayer(t.identifier);if(null!=e&&e.hls)return e.hls.bufferedToEnd;return sv.bufferInfo(this.primaryMedia,this.timelinePos,0).end+1>=t.timelineStart+(t.duration||0)}attachPrimary(t,e,i){e?this.setBufferingItem(e):this.bufferingItem=this.playingItem,this.bufferingAsset=null;const r=this.primaryMedia;if(!r)return;const s=this.hls;s.media?this.checkBuffer():(this.transferMediaTo(s,r),i&&this.startLoadingPrimaryAt(t,i)),i||(this.timelinePos=t,this.startLoadingPrimaryAt(t,i))}startLoadingPrimaryAt(t,e){var i;const r=this.hls;!r.loadingEnabled||!r.media||Math.abs(((null==(i=r.mainForwardBufferInfo)?void 0:i.start)||r.media.currentTime)-t)>.5?r.startLoad(t,e):r.bufferingEnabled||r.resumeBuffering()}onManifestLoading(){this.stopLoad(),this.schedule.reset(),this.emptyPlayerQueue(),this.clearScheduleState(),this.shouldPlay=!1,this.bufferedPos=this.timelinePos=-1,this.mediaSelection=this.altSelection=this.manager=this.requiredTracks=null,this.hls.off(wg.BUFFER_CODECS,this.onBufferCodecs,this),this.hls.on(wg.BUFFER_CODECS,this.onBufferCodecs,this)}onLevelUpdated(t,e){if(-1===e.level)return;const i=this.hls.levels[e.level],r=Mg(Mg({},this.mediaSelection||this.altSelection),{},{main:i});this.mediaSelection=r,this.schedule.parseInterstitialDateRanges(r,this.hls.config.interstitialAppendInPlace),!this.effectivePlayingItem&&this.schedule.items&&this.checkStart()}onAudioTrackUpdated(t,e){const i=this.hls.audioTracks[e.id],r=this.mediaSelection;if(!r)return void(this.altSelection=Mg(Mg({},this.altSelection),{},{audio:i}));const s=Mg(Mg({},r),{},{audio:i});this.mediaSelection=s}onSubtitleTrackUpdated(t,e){const i=this.hls.subtitleTracks[e.id],r=this.mediaSelection;if(!r)return void(this.altSelection=Mg(Mg({},this.altSelection),{},{subtitles:i}));const s=Mg(Mg({},r),{},{subtitles:i});this.mediaSelection=s}onAudioTrackSwitching(t,e){const i=pm(e);this.playerQueue.forEach(t=>t.hls.setAudioOption(e)||t.hls.setAudioOption(i))}onSubtitleTrackSwitch(t,e){const i=pm(e);this.playerQueue.forEach(t=>t.hls.setSubtitleOption(e)||-1!==e.id&&t.hls.setSubtitleOption(i))}onBufferCodecs(t,e){const i=e.tracks;i&&(this.requiredTracks=i)}onBufferAppended(t,e){this.checkBuffer()}onBufferFlushed(t,e){const i=this.playingItem;if(i&&!this.itemsMatch(i,this.bufferingItem)&&!this.isInterstitial(i)){const t=this.timelinePos;this.bufferedPos=t,this.checkBuffer()}}onBufferedToEnd(t){const e=this.schedule.events;if(this.bufferedPos<Number.MAX_VALUE&&e){for(let t=0;t<e.length;t++){const r=e[t];if(r.cue.post){var i;const t=this.schedule.findEventIndex(r.identifier),e=null==(i=this.schedule.items)?void 0:i[t];this.isInterstitial(e)&&this.eventItemsMatch(e,this.bufferingItem)&&this.bufferedToItem(e,0);break}}this.bufferedPos=Number.MAX_VALUE}}onMediaEnded(t){const e=this.playingItem;if(!this.playingLastItem&&e){const t=this.findItemIndex(e);this.setSchedulePosition(t+1)}else this.shouldPlay=!1}updateItem(t,e){const i=this.schedule.items;if(t&&i){return i[this.findItemIndex(t,e)]||null}return null}trimInPlace(t,e){if(this.isInterstitial(t)&&t.event.appendInPlace&&e.end-t.end>.25){t.event.assetList.forEach((e,i)=>{t.event.isAssetPastPlayoutLimit(i)&&this.clearAssetPlayer(e.identifier,null)});const e=t.end+.25,i=sv.bufferInfo(this.primaryMedia,e,0);(i.end>e||(i.nextStart||0)>e)&&(this.attachPrimary(e,null),this.flushFrontBuffer(e))}}itemsMatch(t,e){return!!e&&(t===e||t.event&&e.event&&this.eventItemsMatch(t,e)||!t.event&&!e.event&&this.findItemIndex(t)===this.findItemIndex(e))}eventItemsMatch(t,e){var i;return!!e&&(t===e||t.event.identifier===(null==(i=e.event)?void 0:i.identifier))}findItemIndex(t,e){return t?this.schedule.findItemIndex(t,e):-1}updateSchedule(){const t=this.mediaSelection;t&&this.schedule.updateSchedule(t,[])}checkBuffer(t){const e=this.schedule.items;if(!e)return;const i=sv.bufferInfo(this.primaryMedia,this.timelinePos,0);t&&(this.bufferedPos=this.timelinePos),t||(t=i.len<1),this.updateBufferedPos(i.end,e,t)}updateBufferedPos(t,e,i){const r=this.schedule,s=this.bufferingItem;if(this.bufferedPos>t)return;if(1===e.length&&this.itemsMatch(e[0],s))return void(this.bufferedPos=t);const a=this.playingItem,n=this.findItemIndex(a);let o=r.findItemIndexAtTime(t);if(this.bufferedPos<t){var l,c;const i=this.findItemIndex(s),r=Math.min(i+1,e.length-1),a=e[r];if((-1===o&&s&&t>=s.end||null!=(l=a.event)&&l.appendInPlace&&t+.01>=a.start)&&(o=r),r-n>1&&!1===(null==s||null==(c=s.event)?void 0:c.appendInPlace))return;if(this.bufferedPos=t,o>i&&o>n)this.bufferedToItem(a);else{const e=this.primaryDetails;this.primaryLive&&e&&t>e.edge-e.targetduration&&a.start<e.edge+this.hls.config.interstitialLiveLookAhead&&this.isInterstitial(a)&&this.preloadAssets(a.event,0)}}else i&&a&&!this.itemsMatch(a,s)&&(o===n?this.bufferedToItem(a):o===n+1&&this.bufferedToItem(e[o]))}assetsBuffered(t,e){return 0!==t.event.assetList.length&&!t.event.assetList.some(t=>{const i=this.getAssetPlayer(t.identifier);return!(null!=i&&i.bufferedInPlaceToEnd(e))})}setBufferingItem(t){const e=this.bufferingItem,i=this.schedule;if(this.itemsMatch(t,e))this.bufferingItem!==t&&(this.bufferingItem=t);else{const{items:r,events:s}=i;if(!r||!s)return e;const a=this.isInterstitial(t),n=this.getBufferingPlayer();this.bufferingItem=t,this.bufferedPos=Math.max(t.start,Math.min(t.end,this.timelinePos));const o=n?n.remaining:e?e.end-this.timelinePos:0;this.log(`INTERSTITIALS_BUFFERED_TO_BOUNDARY ${yw(t)}`+(e?` (${o.toFixed(2)} remaining)`:"")),this.playbackDisabled||(a?t.event.assetList.forEach(t=>{const e=this.getAssetPlayer(t.identifier);e&&e.resumeBuffering()}):(this.hls.resumeBuffering(),this.playerQueue.forEach(t=>t.pauseBuffering()))),this.hls.trigger(wg.INTERSTITIALS_BUFFERED_TO_BOUNDARY,{events:s.slice(0),schedule:r.slice(0),bufferingIndex:this.findItemIndex(t),playingIndex:this.findItemIndex(this.playingItem)})}return e}bufferedToItem(t,e=0){const i=this.setBufferingItem(t);if(!this.playbackDisabled)if(this.isInterstitial(t))this.bufferedToEvent(t,e);else if(null!==i){this.bufferingAsset=null;const e=this.detachedData;if(e)if(e.mediaSource){const e=!0;this.attachPrimary(t.start,t,e)}else this.preloadPrimary(t);else this.preloadPrimary(t)}}preloadPrimary(t){const e=this.findItemIndex(t),i=this.getPrimaryResumption(t,e);this.startLoadingPrimaryAt(i)}bufferedToEvent(t,e){const i=t.event,r=0===i.assetList.length&&!i.assetListLoader,s=i.cue.once;if(r||!s){const t=this.preloadAssets(i,e);if(null!=t&&t.interstitial.appendInPlace){const r=i.assetList[e],s=this.primaryMedia;r&&s&&this.bufferAssetPlayer(t,s)}}}preloadAssets(t,e){const i=t.assetUrl,r=t.assetList.length,s=0===r&&!t.assetListLoader,a=t.cue.once;if(s){const s=t.timelineStart;if(t.appendInPlace){var n;const e=this.playingItem;this.isInterstitial(e)||(null==e||null==(n=e.nextEvent)?void 0:n.identifier)!==t.identifier||this.flushFrontBuffer(s+.25)}let a,o=0;if(!this.playingItem&&this.primaryLive&&(o=this.hls.startPosition,-1===o&&(o=this.hls.liveSyncPosition||0)),o&&!t.cue.pre&&!t.cue.post){const t=o-s;t>0&&(a=Math.round(1e3*t)/1e3)}if(this.log(`Load interstitial asset ${e+1}/${i?1:r} ${t}${a?` live-start: ${o} start-offset: ${a}`:""}`),i)return this.createAsset(t,0,0,s,t.duration,i);const l=this.assetListLoader.loadAssetList(t,a);l&&(t.assetListLoader=l)}else if(!a&&r){for(let i=e;i<r;i++){const e=t.assetList[i],r=this.getAssetPlayerQueueIndex(e.identifier);-1!==r&&!this.playerQueue[r].destroyed||e.error||this.createAssetPlayer(t,e,i)}return this.getAssetPlayer(t.assetList[e].identifier)}return null}flushFrontBuffer(t){const e=this.requiredTracks;if(!e)return;this.log(`Removing front buffer starting at ${t}`);Object.keys(e).forEach(e=>{this.hls.trigger(wg.BUFFER_FLUSHING,{startOffset:t,endOffset:1/0,type:e})})}getAssetPlayerQueueIndex(t){const e=this.playerQueue;for(let i=0;i<e.length;i++)if(t===e[i].assetId)return i;return-1}getAssetPlayer(t){const e=this.getAssetPlayerQueueIndex(t);return this.playerQueue[e]||null}getBufferingPlayer(){const{playerQueue:t,primaryMedia:e}=this;if(e)for(let i=0;i<t.length;i++)if(t[i].media===e)return t[i];return null}createAsset(t,e,i,r,s,a){const n={parentIdentifier:t.identifier,identifier:pw(t,a,e),duration:s,startOffset:i,timelineStart:r,uri:a};return this.createAssetPlayer(t,n,e)}createAssetPlayer(t,e,i){const r=this.hls,s=r.userConfig;let a=s.videoPreference;const n=r.loadLevelObj||r.levels[r.currentLevel];(a||n)&&(a=Ig({},a),n.videoCodec&&(a.videoCodec=n.videoCodec),n.videoRange&&(a.allowedVideoRanges=[n.videoRange]));const o=r.audioTracks[r.audioTrack],l=r.subtitleTracks[r.subtitleTrack];let c=0;if(this.primaryLive||t.appendInPlace){const t=this.timelinePos-e.timelineStart;if(t>1){const i=e.duration;i&&t<i&&(c=t)}}const d=e.identifier,h=Mg(Mg({},s),{},{autoStartLoad:!0,startFragPrefetch:!0,primarySessionId:r.sessionId,assetPlayerId:d,abrEwmaDefaultEstimate:r.bandwidthEstimate,interstitialsController:void 0,startPosition:c,liveDurationInfinity:!1,testBandwidth:!1,videoPreference:a,audioPreference:o||s.audioPreference,subtitlePreference:l||s.subtitlePreference});t.appendInPlace&&(t.appendInPlaceStarted=!0,e.timelineStart&&(h.timelineOffset=e.timelineStart));const p=h.cmcd;null!=p&&p.sessionId&&p.contentId&&(h.cmcd=Ig({},p,{contentId:cw(e.uri)})),this.getAssetPlayer(d)&&this.warn(`Duplicate date range identifier ${t} and asset ${d}`);const u=new bw(this.HlsPlayerClass,h,t,e);this.playerQueue.push(u),t.assetList[i]=e;const g=r=>{if(r.live){const e=new Error(`Interstitials MUST be VOD assets ${t}`),r={fatal:!0,type:kg.OTHER_ERROR,details:yg.INTERSTITIAL_ASSET_ITEM_ERROR,error:e};return void this.handleAssetItemError(r,t,this.schedule.findEventIndex(t.identifier),i,e.message)}const s=r.edge-r.fragmentStart,a=e.duration;(null===a||s>a)&&(this.log(`Interstitial asset "${d}" duration change ${a} > ${s}`),e.duration=s,this.updateSchedule())};u.on(wg.LEVEL_UPDATED,(t,{details:e})=>g(e)),u.on(wg.LEVEL_PTS_UPDATED,(t,{details:e})=>g(e));const f=(t,e)=>{const i=this.getAssetPlayer(d);if(i&&e.tracks){i.off(wg.BUFFER_CODECS,f),i.tracks=e.tracks;const t=this.primaryMedia;this.bufferingAsset===i.assetItem&&t&&!i.media&&this.bufferAssetPlayer(i,t)}};u.on(wg.BUFFER_CODECS,f);const m=()=>{var i;const r=this.getAssetPlayer(d);if(this.log(`buffered to end of asset ${r}`),!r)return;const s=this.schedule.findEventIndex(t.identifier),a=null==(i=this.schedule.items)?void 0:i[s];if(this.isInterstitial(a)){const i=t.findAssetIndex(e),r=mw(t,i);if(t.isAssetPastPlayoutLimit(r)){var n;const t=null==(n=this.schedule.items)?void 0:n[s+1];t&&this.bufferedToItem(t)}else this.bufferedToItem(a,r)}};u.on(wg.BUFFERED_TO_END,m);const v=e=>()=>{if(!this.getAssetPlayer(d))return;this.shouldPlay=!0;const i=this.schedule.findEventIndex(t.identifier);this.advanceAfterAssetEnded(t,i,e)};return u.once(wg.MEDIA_ENDED,v(i)),u.once(wg.PLAYOUT_LIMIT_REACHED,v(1/0)),u.on(wg.ERROR,(e,r)=>{const s=this.getAssetPlayer(d);if(r.details!==yg.BUFFER_STALLED_ERROR)this.handleAssetItemError(r,t,this.schedule.findEventIndex(t.identifier),i,`Asset player error ${r.error} ${t}`);else if(null!=s&&s.media){const e=s.currentTime,i=s.duration-e;e&&t.appendInPlace&&i/s.media.playbackRate<.5?(this.log(`Advancing buffer past end of asset ${d} ${t} at ${s.media.currentTime}`),m()):(this.warn(`Stalled at ${e} of ${e+i} in asset ${d} ${t}`),this.onTimeupdate(),this.checkBuffer(!0))}}),u.on(wg.DESTROYING,()=>{if(!this.getAssetPlayer(d))return;const e=new Error(`Asset player destroyed unexpectedly ${d}`),r={fatal:!0,type:kg.OTHER_ERROR,details:yg.INTERSTITIAL_ASSET_ITEM_ERROR,error:e};this.handleAssetItemError(r,t,this.schedule.findEventIndex(t.identifier),i,e.message)}),this.log(`INTERSTITIAL_ASSET_PLAYER_CREATED ${vw(e)}`),this.hls.trigger(wg.INTERSTITIAL_ASSET_PLAYER_CREATED,{asset:e,assetListIndex:i,event:t,player:u}),u}clearInterstitial(t,e){t.assetList.forEach(t=>{this.clearAssetPlayer(t.identifier,e)}),t.reset()}resetAssetPlayer(t){const e=this.getAssetPlayerQueueIndex(t);if(-1!==e){this.log(`reset asset player "${t}" after error`);const i=this.playerQueue[e];this.transferMediaFromPlayer(i,null),i.resetDetails()}}clearAssetPlayer(t,e){const i=this.getAssetPlayerQueueIndex(t);if(-1!==i){this.log(`clear asset player "${t}" toSegment: ${e?yw(e):e}`);const r=this.playerQueue[i];this.transferMediaFromPlayer(r,e),this.playerQueue.splice(i,1),r.destroy()}}emptyPlayerQueue(){let t;for(;t=this.playerQueue.pop();)t.destroy();this.playerQueue=[]}startAssetPlayer(t,e,i,r,s){const{interstitial:a,assetItem:n,assetId:o}=t,l=a.assetList.length,c=this.playingAsset;this.endedAsset=null,this.playingAsset=n,c&&c.identifier===o||(c&&(this.clearAssetPlayer(c.identifier,i[r]),delete c.error),this.log(`INTERSTITIAL_ASSET_STARTED ${e+1}/${l} ${vw(n)}`),this.hls.trigger(wg.INTERSTITIAL_ASSET_STARTED,{asset:n,assetListIndex:e,event:a,schedule:i.slice(0),scheduleIndex:r,player:t})),this.bufferAssetPlayer(t,s)}bufferAssetPlayer(t,e){var i,r;const{interstitial:s,assetItem:a}=t,n=this.schedule.findEventIndex(s.identifier),o=null==(i=this.schedule.items)?void 0:i[n];if(!o)return;this.setBufferingItem(o),this.bufferingAsset=a;const l=this.getBufferingPlayer();if(l===t)return;const c=s.appendInPlace;if(c&&!1===(null==l?void 0:l.interstitial.appendInPlace))return;const d=(null==l?void 0:l.tracks)||(null==(r=this.detachedData)?void 0:r.tracks)||this.requiredTracks;if(c&&a!==this.playingAsset){if(!t.tracks)return;if(d&&!Gg(d,t.tracks)){const e=new Error(`Asset ${vw(a)} SourceBuffer tracks ('${Object.keys(t.tracks)}') are not compatible with primary content tracks ('${Object.keys(d)}')`),i={fatal:!0,type:kg.OTHER_ERROR,details:yg.INTERSTITIAL_ASSET_ITEM_ERROR,error:e},r=s.findAssetIndex(a);return void this.handleAssetItemError(i,s,n,r,e.message)}}this.transferMediaTo(t,e)}handleAssetItemError(t,e,i,r,s){if(t.details===yg.BUFFER_STALLED_ERROR)return;const a=e.assetList[r];this.warn(`INTERSTITIAL_ASSET_ERROR ${a?vw(a):a} ${t.error}`);const n=null==a?void 0:a.identifier,o=this.getAssetPlayerQueueIndex(n),l=this.playerQueue[o]||null,c=this.schedule.items,d=Ig({},t,{fatal:!1,errorAction:Om(!0),asset:a,assetListIndex:r,event:e,schedule:c,scheduleIndex:i,player:l});if(this.hls.trigger(wg.INTERSTITIAL_ASSET_ERROR,d),!t.fatal)return;const h=this.playingAsset,p=new Error(s);if(a&&(this.clearAssetPlayer(n,null),a.error=p),e.assetList.some(t=>!t.error)){for(let t=r;t<e.assetList.length;t++)this.resetAssetPlayer(e.assetList[t].identifier);this.updateSchedule()}else e.error=p;e.error?this.primaryFallback(e):h&&h.identifier===n&&this.advanceAfterAssetEnded(e,i,r)}primaryFallback(t){const e=t.timelineStart,i=this.effectivePlayingItem;if(this.updateSchedule(),i){this.log(`Fallback to primary from event "${t.identifier}" start: ${e} pos: ${this.timelinePos} playing: ${i?yw(i):"<none>"} error: ${t.error}`);let r=this.timelinePos;-1===r&&(r=this.hls.startPosition);const s=this.updateItem(i,r);this.itemsMatch(i,s)&&this.clearInterstitial(t,null),t.appendInPlace&&(this.attachPrimary(e,null),this.flushFrontBuffer(e));const a=this.schedule.findItemIndexAtTime(r);this.setSchedulePosition(a)}else this.checkStart()}onAssetListLoaded(t,e){var i;const r=e.event,s=r.identifier,a=e.assetListResponse.ASSETS;if(!this.schedule.hasEvent(s))return;const n=r.timelineStart,o=r.duration;let l=0;a.forEach((t,e)=>{const i=parseFloat(t.DURATION);this.createAsset(r,e,l,n+l,i,t.URI),l+=i}),r.duration=l,this.log(`Loaded asset-list with duration: ${l} (was: ${o}) ${r}`);const c=this.waitingItem,d=(null==c?void 0:c.event.identifier)===s;this.updateSchedule();const h=null==(i=this.bufferingItem)?void 0:i.event;if(d){var p;const t=this.schedule.findEventIndex(s),e=null==(p=this.schedule.items)?void 0:p[t];if(e){if(!this.playingItem&&this.timelinePos>e.end){if(this.schedule.findItemIndexAtTime(this.timelinePos)!==t)return r.error=new Error(`Interstitial no longer within playback range ${this.timelinePos} ${r}`),void this.primaryFallback(r)}this.setBufferingItem(e)}this.setSchedulePosition(t)}else if((null==h?void 0:h.identifier)===s&&h.appendInPlace){const t=r.assetList[0],e=this.getAssetPlayer(t.identifier),i=this.primaryMedia;t&&e&&i&&this.bufferAssetPlayer(e,i)}}onError(t,e){switch(e.details){case yg.ASSET_LIST_PARSING_ERROR:case yg.ASSET_LIST_LOAD_ERROR:case yg.ASSET_LIST_LOAD_TIMEOUT:{const t=e.interstitial;t&&this.primaryFallback(t);break}case yg.BUFFER_STALLED_ERROR:this.onTimeupdate(),this.checkBuffer(!0)}}}});function Lx(t){return t&&"object"==typeof t?Array.isArray(t)?t.map(Lx):Object.keys(t).reduce((e,i)=>(e[i]=Lx(t[i]),e),{}):t}function Cx(t,e){const i=t.loader;if(i!==wx&&i!==Px)e.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=wx,t.progressive=!0,t.enableSoftwareAES=!0,e.log("[config]: Progressive streaming enabled, using FetchLoader"))}}class _x extends ev{constructor(t,e){super("gap-controller",t.logger),this.hls=null,this.fragmentTracker=null,this.media=null,this.mediaSource=void 0,this.nudgeRetry=0,this.stallReported=!1,this.stalled=null,this.moved=!1,this.seeking=!1,this.buffered={},this.lastCurrentTime=0,this.ended=0,this.waiting=0,this.onMediaPlaying=()=>{this.ended=0,this.waiting=0},this.onMediaWaiting=()=>{var t;null!=(t=this.media)&&t.seeking||(this.waiting=self.performance.now(),this.tick())},this.onMediaEnded=()=>{var t;this.hls&&(this.ended=(null==(t=this.media)?void 0:t.currentTime)||1,this.hls.trigger(wg.MEDIA_ENDED,{stalled:!1}))},this.hls=t,this.fragmentTracker=e,this.registerListeners()}registerListeners(){const{hls:t}=this;t&&(t.on(wg.MEDIA_ATTACHED,this.onMediaAttached,this),t.on(wg.MEDIA_DETACHING,this.onMediaDetaching,this),t.on(wg.BUFFER_APPENDED,this.onBufferAppended,this))}unregisterListeners(){const{hls:t}=this;t&&(t.off(wg.MEDIA_ATTACHED,this.onMediaAttached,this),t.off(wg.MEDIA_DETACHING,this.onMediaDetaching,this),t.off(wg.BUFFER_APPENDED,this.onBufferAppended,this))}destroy(){super.destroy(),this.unregisterListeners(),this.media=this.hls=this.fragmentTracker=null,this.mediaSource=void 0}onMediaAttached(t,e){this.setInterval(100),this.mediaSource=e.mediaSource;const i=this.media=e.media;tw(i,"playing",this.onMediaPlaying),tw(i,"waiting",this.onMediaWaiting),tw(i,"ended",this.onMediaEnded)}onMediaDetaching(t,e){this.clearInterval();const{media:i}=this;i&&(ew(i,"playing",this.onMediaPlaying),ew(i,"waiting",this.onMediaWaiting),ew(i,"ended",this.onMediaEnded),this.media=null),this.mediaSource=void 0}onBufferAppended(t,e){this.buffered=e.timeRanges}get hasBuffered(){return Object.keys(this.buffered).length>0}tick(){var t;if(null==(t=this.media)||!t.readyState||!this.hasBuffered)return;const e=this.media.currentTime;this.poll(e,this.lastCurrentTime),this.lastCurrentTime=e}poll(t,e){var i,r;const s=null==(i=this.hls)?void 0:i.config;if(!s)return;const a=this.media;if(!a)return;const{seeking:n}=a,o=this.seeking&&!n,l=!this.seeking&&n,c=a.paused&&!n||a.ended||0===a.playbackRate;if(this.seeking=n,t!==e)return e&&(this.ended=0),this.moved=!0,n||(this.nudgeRetry=0,s.nudgeOnVideoHole&&!c&&t>e&&this.nudgeOnVideoHole(t,e)),void(0===this.waiting&&this.stallResolved(t));if(l||o)return void(o&&this.stallResolved(t));if(c)return this.nudgeRetry=0,this.stallResolved(t),void(!this.ended&&a.ended&&this.hls&&(this.ended=t||1,this.hls.trigger(wg.MEDIA_ENDED,{stalled:!1})));if(!sv.getBuffered(a).length)return void(this.nudgeRetry=0);const d=sv.bufferInfo(a,t,0),h=d.nextStart||0,p=this.fragmentTracker;if(n&&p&&this.hls){const e=Ax(this.hls.inFlightFragments,t),i=d.len>2,r=!h||e||h-t>2&&!p.getPartialFragment(t);if(i||r)return;this.moved=!1}const u=null==(r=this.hls)?void 0:r.latestLevelDetails;if(!this.moved&&null!==this.stalled&&p){if(!(d.len>0)&&!h)return;const e=Math.max(h,d.start||0)-t,i=!(null==u||!u.live)?2*u.targetduration:2,r=p.getPartialFragment(t);if(e>0&&(e<=i||r))return void(a.paused||this._trySkipBufferHole(r))}const g=s.detectStallWithCurrentTimeMs,f=self.performance.now(),m=this.waiting;let v=this.stalled;if(null===v){if(!(m>0&&f-m<g))return void(this.stalled=f);v=this.stalled=m}const b=f-v;if(!n&&(b>=g||m)&&this.hls){var k;if("ended"===(null==(k=this.mediaSource)?void 0:k.readyState)&&(null==u||!u.live)&&Math.abs(t-((null==u?void 0:u.edge)||0))<1){if(this.ended)return;return this.ended=t||1,void this.hls.trigger(wg.MEDIA_ENDED,{stalled:!0})}if(this._reportStall(d),!this.media||!this.hls)return}const y=sv.bufferInfo(a,t,s.maxBufferHole);this._tryFixBufferStall(y,b,t)}stallResolved(t){const e=this.stalled;if(e&&this.hls&&(this.stalled=null,this.stallReported)){const i=self.performance.now()-e;this.log(`playback not stuck anymore @${t}, after ${Math.round(i)}ms`),this.stallReported=!1,this.waiting=0,this.hls.trigger(wg.STALL_RESOLVED,{})}}nudgeOnVideoHole(t,e){var i;const r=this.buffered.video;if(this.hls&&this.media&&this.fragmentTracker&&null!=(i=this.buffered.audio)&&i.length&&r&&r.length>1&&t>r.end(0)){const i=sv.bufferedInfo(sv.timeRangesToArray(this.buffered.audio),t,0);if(i.len>1&&e>=i.start){const i=sv.timeRangesToArray(r),s=sv.bufferedInfo(i,e,0).bufferedIndex;if(s>-1&&s<i.length-1){const e=sv.bufferedInfo(i,t,0).bufferedIndex,r=i[s].end,a=i[s+1].start;if((-1===e||e>s)&&a-r<1&&t-r<2){const i=new Error(`nudging playhead to flush pipeline after video hole. currentTime: ${t} hole: ${r} -> ${a} buffered index: ${e}`);this.warn(i.message),this.media.currentTime+=1e-6;const s=this.fragmentTracker.getPartialFragment(t)||void 0,n=sv.bufferInfo(this.media,t,0);this.hls.trigger(wg.ERROR,{type:kg.MEDIA_ERROR,details:yg.BUFFER_SEEK_OVER_HOLE,fatal:!1,error:i,reason:i.message,frag:s,buffer:n.len,bufferInfo:n})}}}}}_tryFixBufferStall(t,e,i){var r,s;const{fragmentTracker:a,media:n}=this,o=null==(r=this.hls)?void 0:r.config;if(!n||!a||!o)return;const l=null==(s=this.hls)?void 0:s.latestLevelDetails,c=a.getPartialFragment(i);if(c||null!=l&&l.live&&i<l.fragmentStart){if(this._trySkipBufferHole(c)||!this.media)return}const d=t.buffered,h=this.adjacentTraversal(t,i);(d&&d.length>1&&t.len>o.maxBufferHole||t.nextStart&&(t.nextStart-i<o.maxBufferHole||h))&&(e>1e3*o.highBufferWatchdogPeriod||this.waiting)&&(this.warn("Trying to nudge playhead over buffer-hole"),this._tryNudgeBuffer(t))}adjacentTraversal(t,e){const i=this.fragmentTracker,r=t.nextStart;if(i&&r){const t=i.getFragAtPos(e,Tg),s=i.getFragAtPos(r,Tg);if(t&&s)return s.sn-t.sn<2}return!1}_reportStall(t){const{hls:e,media:i,stallReported:r,stalled:s}=this;if(!r&&null!==s&&i&&e){this.stallReported=!0;const r=new Error(`Playback stalling at @${i.currentTime} due to low buffer (${cm(t)})`);this.warn(r.message),e.trigger(wg.ERROR,{type:kg.MEDIA_ERROR,details:yg.BUFFER_STALLED_ERROR,fatal:!1,error:r,buffer:t.len,bufferInfo:t,stalled:{start:s}})}}_trySkipBufferHole(t){var e;const{fragmentTracker:i,media:r}=this,s=null==(e=this.hls)?void 0:e.config;if(!r||!i||!s)return 0;const a=r.currentTime,n=sv.bufferInfo(r,a,0),o=a<n.start?n.start:n.nextStart;if(o&&this.hls){const e=n.len<=s.maxBufferHole,c=n.len>0&&n.len<1&&r.readyState<3,d=o-a;if(d>0&&(e||c)){if(d>s.maxBufferHole){let e=!1;if(0===a){const t=i.getAppendedFrag(0,Tg);t&&o<t.end&&(e=!0)}if(!e){const e=t||i.getAppendedFrag(a,Tg);if(e){var l;if(null==(l=this.hls.loadLevelObj)||!l.details)return 0;if(Ax(this.hls.inFlightFragments,o))return 0;let t=!1,r=e.end;for(;r<o;){const e=i.getAppendedFrag(r,Tg)||i.getPartialFragment(r);if(!e){t=!0;break}r+=e.duration}if(t)return 0}}}const e=Math.max(o+.05,a+.1);if(this.warn(`skipping hole, adjusting currentTime from ${a} to ${e}`),this.moved=!0,r.currentTime=e,null==t||!t.gap){const i=new Error(`fragment loaded with buffer holes, seeking from ${a} to ${e}`);this.hls.trigger(wg.ERROR,{type:kg.MEDIA_ERROR,details:yg.BUFFER_SEEK_OVER_HOLE,fatal:!1,error:i,reason:i.message,frag:t||void 0,buffer:n.len,bufferInfo:n})}return e}}return 0}_tryNudgeBuffer(t){const{hls:e,media:i,nudgeRetry:r}=this,s=null==e?void 0:e.config;if(!i||!s)return 0;const a=i.currentTime;if(this.nudgeRetry++,r<s.nudgeMaxRetry){const n=a+(r+1)*s.nudgeOffset,o=new Error(`Nudging 'currentTime' from ${a} to ${n}`);this.warn(o.message),i.currentTime=n,e.trigger(wg.ERROR,{type:kg.MEDIA_ERROR,details:yg.BUFFER_NUDGE_ON_STALL,error:o,fatal:!1,buffer:t.len,bufferInfo:t})}else{const i=new Error(`Playhead still not moving while enough data buffered @${a} after ${s.nudgeMaxRetry} nudges`);this.error(i.message),e.trigger(wg.ERROR,{type:kg.MEDIA_ERROR,details:yg.BUFFER_STALLED_ERROR,error:i,fatal:!0,buffer:t.len,bufferInfo:t})}}}function Ax(t,e){const i=Rx(t.main);if(i&&i.start<=e)return i;const r=Rx(t.audio);return r&&r.start<=e?r:null}function Rx(t){if(!t)return null;switch(t.state){case xb:case wb:case _b:case Ab:return null}return t.frag}function Ix(){if("undefined"!=typeof self)return self.VTTCue||self.TextTrackCue}function Dx(t,e,i,r,s){let a=new t(e,i,"");try{a.value=r,s&&(a.type=s)}catch(n){a=new t(e,i,cm(s?Mg({type:s},r):r))}return a}const Mx=(()=>{const t=Ix();try{t&&new t(0,Number.POSITIVE_INFINITY,"")}catch(t){return Number.MAX_VALUE}return Number.POSITIVE_INFINITY})();function Ox(t){return Uint8Array.from(t.replace(/^0x/,"").replace(/([\da-fA-F]{2}) ?/g,"0x$1 ").replace(/ +$/,"").split(" ")).buffer}class Ux{constructor(t){this.hls=void 0,this.id3Track=null,this.media=null,this.dateRangeCuesAppended={},this.removeCues=!0,this.onEventCueEnter=()=>{this.hls&&this.hls.trigger(wg.EVENT_CUE_ENTER,{})},this.hls=t,this._registerListeners()}destroy(){this._unregisterListeners(),this.id3Track=null,this.media=null,this.dateRangeCuesAppended={},this.hls=this.onEventCueEnter=null}_registerListeners(){const{hls:t}=this;t.on(wg.MEDIA_ATTACHING,this.onMediaAttaching,this),t.on(wg.MEDIA_ATTACHED,this.onMediaAttached,this),t.on(wg.MEDIA_DETACHING,this.onMediaDetaching,this),t.on(wg.MANIFEST_LOADING,this.onManifestLoading,this),t.on(wg.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),t.on(wg.BUFFER_FLUSHING,this.onBufferFlushing,this),t.on(wg.LEVEL_UPDATED,this.onLevelUpdated,this),t.on(wg.LEVEL_PTS_UPDATED,this.onLevelPtsUpdated,this)}_unregisterListeners(){const{hls:t}=this;t.off(wg.MEDIA_ATTACHING,this.onMediaAttaching,this),t.off(wg.MEDIA_ATTACHED,this.onMediaAttached,this),t.off(wg.MEDIA_DETACHING,this.onMediaDetaching,this),t.off(wg.MANIFEST_LOADING,this.onManifestLoading,this),t.off(wg.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),t.off(wg.BUFFER_FLUSHING,this.onBufferFlushing,this),t.off(wg.LEVEL_UPDATED,this.onLevelUpdated,this),t.off(wg.LEVEL_PTS_UPDATED,this.onLevelPtsUpdated,this)}onMediaAttaching(t,e){var i;this.media=e.media,!1===(null==(i=e.overrides)?void 0:i.cueRemoval)&&(this.removeCues=!1)}onMediaAttached(){const t=this.hls.latestLevelDetails;t&&this.updateDateRangeCues(t)}onMediaDetaching(t,e){this.media=null;!!e.transferMedia||(this.id3Track&&(this.removeCues&&nw(this.id3Track,this.onEventCueEnter),this.id3Track=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 sw(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:s}=e;this.id3Track||(this.id3Track=this.createTrack(this.media));const a=Ix();if(a)for(let t=0;t<s.length;t++){const e=s[t].type;if(e===ck.emsg&&!i||!r)continue;const n=ak(s[t].data);if(n){const i=s[t].pts;let r=i+s[t].duration;r>Mx&&(r=Mx);r-i<=0&&(r=i+.25);for(let t=0;t<n.length;t++){const s=n[t];if(!nk(s)){this.updateId3CueEnds(i,e);const t=Dx(a,i,r,s,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 s=r[i];s.type===e&&s.startTime<t&&s.endTime===Mx&&(s.endTime=t)}}onBufferFlushing(t,{startOffset:e,endOffset:i,type:r}){const{id3Track:s,hls:a}=this;if(!a)return;const{config:{enableEmsgMetadataCues:n,enableID3MetadataCues:o}}=a;if(s&&(n||o)){let t;t="audio"===r?t=>t.type===ck.audioId3&&o:"video"===r?t=>t.type===ck.emsg&&n:t=>t.type===ck.audioId3&&o||t.type===ck.emsg&&n,ow(s,e,i,t)}}onLevelUpdated(t,{details:e}){this.updateDateRangeCues(e,!0)}onLevelPtsUpdated(t,e){Math.abs(e.drift)>.01&&this.updateDateRangeCues(e.details)}updateDateRangeCues(t,e){if(!this.media||!t.hasProgramDateTime||!this.hls.config.enableDateRangeMetadataCues)return;const{id3Track:i}=this,{dateRanges:r}=t,s=Object.keys(r);let a=this.dateRangeCuesAppended;var n;if(i&&e)if(null!=(n=i.cues)&&n.length){const t=Object.keys(a).filter(t=>!s.includes(t));for(let e=t.length;e--;){const r=t[e],s=a[r].cues;delete a[r],Object.keys(s).forEach(t=>{try{const e=s[t];e.removeEventListener("enter",this.onEventCueEnter),i.removeCue(e)}catch(t){}})}}else a=this.dateRangeCuesAppended={};const o=t.fragments[t.fragments.length-1];if(0===s.length||!mg(null==o?void 0:o.programDateTime))return;this.id3Track||(this.id3Track=this.createTrack(this.media));const l=Ix();for(let t=0;t<s.length;t++){const e=s[t],i=r[e],n=i.startTime,o=a[e],c=(null==o?void 0:o.cues)||{};let d=(null==o?void 0:o.durationKnown)||!1,h=Mx;const{duration:p,endDate:u}=i;if(u&&null!==p)h=n+p,d=!0;else if(i.endOnNext&&!d){const t=s.reduce((t,e)=>{if(e!==i.id){const s=r[e];if(s.class===i.class&&s.startDate>i.startDate&&(!t||i.startDate<t.startDate))return s}return t},null);t&&(h=t.startTime,d=!0)}const g=Object.keys(i.attr);for(let t=0;t<g.length;t++){const r=g[t];if(!uv(r))continue;const s=c[r];if(s)d&&!o.durationKnown?s.endTime=h:Math.abs(s.startTime-n)>.01&&(s.startTime=n,s.endTime=h);else if(l){let t=i.attr[r];gv(r)&&(t=Ox(t));const s=Dx(l,n,h,{key:r,data:t},ck.dateRange);s&&(s.id=e,this.id3Track.addCue(s),c[r]=s,this.hls.config.interstitialsController&&("X-ASSET-LIST"!==r&&"X-ASSET-URL"!==r||s.addEventListener("enter",this.onEventCueEnter)))}}a[e]={cues:c,dateRange:i,durationKnown:d}}}}class $x{constructor(t){this.hls=void 0,this.config=void 0,this.media=null,this.currentTime=0,this.stallCount=0,this._latency=null,this._targetLatencyUpdated=!1,this.onTimeupdate=()=>{const{media:t}=this,e=this.levelDetails;if(!t||!e)return;this.currentTime=t.currentTime;const i=this.computeLatency();if(null===i)return;this._latency=i;const{lowLatencyMode:r,maxLiveSyncPlaybackRate:s}=this.config;if(!r||1===s||!e.live)return;const a=this.targetLatency;if(null===a)return;const n=i-a;if(n<Math.min(this.maxLatency,a+e.targetduration)&&n>.05&&this.forwardBufferLength>1){const e=Math.min(2,Math.max(1,s)),i=Math.round(2/(1+Math.exp(-.75*n-this.edgeStalled))*20)/20,r=Math.min(e,Math.max(1,i));this.changeMediaPlaybackRate(t,r)}else 1!==t.playbackRate&&0!==t.playbackRate&&this.changeMediaPlaybackRate(t,1)},this.hls=t,this.config=t.config,this.registerListeners()}get levelDetails(){var t;return(null==(t=this.hls)?void 0:t.latestLevelDetails)||null}get latency(){return this._latency||0}get maxLatency(){const{config:t}=this;if(void 0!==t.liveMaxLatencyDuration)return t.liveMaxLatencyDuration;const e=this.levelDetails;return e?t.liveMaxLatencyDurationCount*e.targetduration:0}get targetLatency(){const t=this.levelDetails;if(null===t||null===this.hls)return null;const{holdBack:e,partHoldBack:i,targetduration:r}=t,{liveSyncDuration:s,liveSyncDurationCount:a,lowLatencyMode:n}=this.config,o=this.hls.userConfig;let l=n&&i||e;(this._targetLatencyUpdated||o.liveSyncDuration||o.liveSyncDurationCount||0===l)&&(l=void 0!==s?s:a*r);const c=r;return l+Math.min(this.stallCount*this.config.liveSyncOnStallIncrease,c)}set targetLatency(t){this.stallCount=0,this.config.liveSyncDuration=t,this._targetLatencyUpdated=!0}get liveSyncPosition(){const t=this.estimateLiveEdge(),e=this.targetLatency;if(null===t||null===e)return null;const i=this.levelDetails;if(null===i)return null;const r=i.edge,s=t-e-this.edgeStalled,a=r-i.totalduration,n=r-(this.config.lowLatencyMode&&i.partTarget||i.targetduration);return Math.min(Math.max(a,s),n)}get drift(){const t=this.levelDetails;return null===t?1:t.drift}get edgeStalled(){const t=this.levelDetails;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}=this,e=this.levelDetails;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.hls=null}registerListeners(){const{hls:t}=this;t&&(t.on(wg.MEDIA_ATTACHED,this.onMediaAttached,this),t.on(wg.MEDIA_DETACHING,this.onMediaDetaching,this),t.on(wg.MANIFEST_LOADING,this.onManifestLoading,this),t.on(wg.LEVEL_UPDATED,this.onLevelUpdated,this),t.on(wg.ERROR,this.onError,this))}unregisterListeners(){const{hls:t}=this;t&&(t.off(wg.MEDIA_ATTACHED,this.onMediaAttached,this),t.off(wg.MEDIA_DETACHING,this.onMediaDetaching,this),t.off(wg.MANIFEST_LOADING,this.onManifestLoading,this),t.off(wg.LEVEL_UPDATED,this.onLevelUpdated,this),t.off(wg.ERROR,this.onError,this))}onMediaAttached(t,e){this.media=e.media,this.media.addEventListener("timeupdate",this.onTimeupdate)}onMediaDetaching(){this.media&&(this.media.removeEventListener("timeupdate",this.onTimeupdate),this.media=null)}onManifestLoading(){this._latency=null,this.stallCount=0}onLevelUpdated(t,{details:e}){e.advanced&&this.onTimeupdate(),!e.live&&this.media&&this.media.removeEventListener("timeupdate",this.onTimeupdate)}onError(t,e){var i;e.details===yg.BUFFER_STALLED_ERROR&&(this.stallCount++,this.hls&&null!=(i=this.levelDetails)&&i.live&&this.hls.logger.warn("[latency-controller]: Stall detected, adjusting target latency"))}changeMediaPlaybackRate(t,e){var i,r;t.playbackRate!==e&&(null==(i=this.hls)||i.logger.debug(`[latency-controller]: latency=${this.latency.toFixed(3)}, targetLatency=${null==(r=this.targetLatency)?void 0:r.toFixed(3)}, forwardBufferLength=${this.forwardBufferLength.toFixed(3)}: adjusting playback rate from ${t.playbackRate} to ${e}`),t.playbackRate=e)}estimateLiveEdge(){const t=this.levelDetails;return null===t?null:t.edge+t.age}computeLatency(){const t=this.estimateLiveEdge();return null===t?null:t-this.currentTime}}class Fx extends dy{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(wg.MANIFEST_LOADING,this.onManifestLoading,this),t.on(wg.MANIFEST_LOADED,this.onManifestLoaded,this),t.on(wg.LEVEL_LOADED,this.onLevelLoaded,this),t.on(wg.LEVELS_UPDATED,this.onLevelsUpdated,this),t.on(wg.FRAG_BUFFERED,this.onFragBuffered,this),t.on(wg.ERROR,this.onError,this)}_unregisterListeners(){const{hls:t}=this;t.off(wg.MANIFEST_LOADING,this.onManifestLoading,this),t.off(wg.MANIFEST_LOADED,this.onManifestLoaded,this),t.off(wg.LEVEL_LOADED,this.onLevelLoaded,this),t.off(wg.LEVELS_UPDATED,this.onLevelsUpdated,this),t.off(wg.FRAG_BUFFERED,this.onFragBuffered,this),t.off(wg.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=[],s={},a={};let n=!1,o=!1,l=!1;e.levels.forEach(t=>{const e=t.attrs;let{audioCodec:c,videoCodec:d}=t;c&&(t.audioCodec=c=zf(c,i)||void 0),d&&(d=t.videoCodec=function(t){const e=t.split(",");for(let t=0;t<e.length;t++){const i=e[t].split(".");i.length>2&&"avc1"===i[0]&&(e[t]=`avc1.${parseInt(i[1]).toString(16)}${("000"+parseInt(i[2]).toString(16)).slice(-4)}`)}return e.join(",")}(d));const{width:h,height:p,unknownCodecs:u}=t;let g=u?u.length:0;if(u)for(let e=g;e--;){const i=u[e];this.isAudioSupported(i)?(t.audioCodec=c=c?`${c},${i}`:i,g--,If.audio[c.substring(0,4)]=2):this.isVideoSupported(i)&&(t.videoCodec=d=d?`${d},${i}`:i,g--,If.video[d.substring(0,4)]=2)}if(n||(n=!(!h||!p)),o||(o=!!d),l||(l=!!c),g||c&&!this.isAudioSupported(c)||d&&!this.isVideoSupported(d))return void this.log(`Some or all CODECS not supported "${e.CODECS}"`);const{CODECS:f,"FRAME-RATE":m,"HDCP-LEVEL":v,"PATHWAY-ID":b,RESOLUTION:k,"VIDEO-RANGE":y}=e,w=`${`${b||"."}-`}${t.bitrate}-${k}-${m}-${f}-${y}-${v}`;if(s[w])if(s[w].uri===t.url||t.attrs["PATHWAY-ID"])s[w].addGroupId("audio",e.AUDIO),s[w].addGroupId("text",e.SUBTITLES);else{const e=a[w]+=1;t.attrs["PATHWAY-ID"]=new Array(e+1).join(".");const i=this.createLevel(t);s[w]=i,r.push(i)}else{const e=this.createLevel(t);s[w]=e,a[w]=1,r.push(e)}}),this.filterAndSortMediaOptions(r,e,n,o,l)}createLevel(t){const e=new nm(t),i=t.supplemental;if(null!=i&&i.videoCodec&&!this.isVideoSupported(i.videoCodec)){const t=new Error(`SUPPLEMENTAL-CODECS not supported "${i.videoCodec}"`);this.log(t.message),e.supportedResult=Yf(t,[])}return e}isAudioSupported(t){return Mf(t,"audio",this.hls.config.preferManagedMediaSource)}isVideoSupported(t){return Mf(t,"video",this.hls.config.preferManagedMediaSource)}filterAndSortMediaOptions(t,e,i,r,s){let a=[],n=[],o=t;if((i||r)&&s&&(o=o.filter(({videoCodec:t,videoRange:e,width:i,height:r})=>{return(!!t||!(!i||!r))&&(!!(s=e)&&tm.indexOf(s)>-1);var s})),0===o.length)return void Promise.resolve().then(()=>{if(this.hls){let t="no level with compatible codecs found in manifest",i=t;e.levels.length&&(i=`one or more CODECS in variant not supported: ${cm(e.levels.map(t=>t.attrs.CODECS).filter((t,e,i)=>i.indexOf(t)===e))}`,this.warn(i),t+=` (${i})`);const r=new Error(t);this.hls.trigger(wg.ERROR,{type:kg.MEDIA_ERROR,details:yg.MANIFEST_INCOMPATIBLE_CODECS_ERROR,fatal:!0,url:e.url,error:r,reason:i})}});e.audioTracks&&(a=e.audioTracks.filter(t=>!t.audioCodec||this.isAudioSupported(t.audioCodec)),Nx(a)),e.subtitles&&(n=e.subtitles,Nx(n));const l=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 tm.indexOf(t.videoRange)-tm.indexOf(e.videoRange);if(t.videoCodec!==e.videoCodec){const i=$f(t.videoCodec),r=$f(e.videoCodec);if(i!==r)return r-i}if(t.uri===e.uri&&t.codecSet!==e.codecSet){const i=Ff(t.codecSet),r=Ff(e.codecSet);if(i!==r)return r-i}return t.averageBitrate!==e.averageBitrate?t.averageBitrate-e.averageBitrate:0});let c=l[0];if(this.steering&&(o=this.steering.filterParsedLevels(o),o.length!==l.length))for(let t=0;t<l.length;t++)if(l[t].pathwayId===o[0].pathwayId){c=l[t];break}this._levels=o;for(let t=0;t<o.length;t++)if(o[t]===c){var d;this._firstLevel=t;const e=c.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===this.hls.abrEwmaDefaultEstimate&&(this.hls.bandwidthEstimate=t)}break}const h=s&&!r,p=this.hls.config,u=!(!p.audioStreamController||!p.audioTrackController),g={levels:o,audioTracks:a,subtitleTracks:n,sessionData:e.sessionData,sessionKeys:e.sessionKeys,firstLevel:this._firstLevel,stats:e.stats,audio:s,video:r,altAudio:u&&!h&&a.some(t=>!!t.url)};this.hls.trigger(wg.MANIFEST_PARSED,g)}get levels(){return 0===this._levels.length?null:this._levels}get loadLevelObj(){return this.currentLevel}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(wg.ERROR,{type:kg.OTHER_ERROR,details:yg.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,s=r?r.attrs["PATHWAY-ID"]:void 0,a=e[t],n=a.attrs["PATHWAY-ID"];if(this.currentLevelIndex=t,this.currentLevel=a,i===t&&r&&s===n)return;this.log(`Switching to level ${t} (${a.height?a.height+"p ":""}${a.videoRange?a.videoRange+" ":""}${a.codecSet?a.codecSet+" ":""}@${a.bitrate})${n?" with Pathway "+n:""} from level ${i}${s?" with Pathway "+s:""}`);const o={level:t,attrs:a.attrs,details:a.details,bitrate:a.bitrate,averageBitrate:a.averageBitrate,maxBitrate:a.maxBitrate,realBitrate:a.realBitrate,width:a.width,height:a.height,codecSet:a.codecSet,audioCodec:a.audioCodec,videoCodec:a.videoCodec,audioGroups:a.audioGroups,subtitleGroups:a.subtitleGroups,loaded:a.loaded,loadError:a.loadError,fragmentError:a.fragmentError,name:a.name,id:a.id,uri:a.uri,url:a.url,urlId:0,audioGroupIds:a.audioGroupIds,textGroupIds:a.textGroupIds};this.hls.trigger(wg.LEVEL_SWITCHING,o);const l=a.details;if(!l||l.live){const t=this.switchParams(a.uri,null==r?void 0:r.details,l);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}get pathways(){return this.steering?this.steering.pathways():[]}get pathwayPriority(){return this.steering?this.steering.pathwayPriority:null}set pathwayPriority(t){if(this.steering){const e=this.steering.pathways(),i=t.filter(t=>-1!==e.indexOf(t));if(t.length<1)return void this.warn(`pathwayPriority ${t} should contain at least one pathway from list: ${e}`);this.steering.pathwayPriority=i}}onError(t,e){!e.fatal&&e.context&&e.context.type===Sg&&e.context.level===this.level&&this.checkRetry(e)}onFragBuffered(t,{frag:e}){if(void 0!==e&&e.type===Tg){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:s}=e,a=e.levelInfo;var n;if(!a)return this.warn(`Invalid level index ${r}`),void(null!=(n=e.deliveryDirectives)&&n.skip&&(s.deltaUpdateFailed=!0));if(a===this.currentLevel||e.withoutMultiVariant){0===a.fragmentError&&(a.loadError=0);let t=a.details;t===e.details&&t.advanced&&(t=void 0),this.playlistLoaded(r,e,t)}else null!=(i=e.deliveryDirectives)&&i.skip&&(s.deltaUpdateFailed=!0)}loadPlaylist(t){super.loadPlaylist(),this.shouldLoadPlaylist(this.currentLevel)&&this.scheduleLoading(this.currentLevel,t)}loadingPlaylist(t,e){super.loadingPlaylist(t,e);const i=this.getUrlWithDirectives(t.uri,e),r=this.currentLevelIndex,s=t.attrs["PATHWAY-ID"],a=t.details,n=null==a?void 0:a.age;this.log(`Loading level index ${r}${void 0!==(null==e?void 0:e.msn)?" at sn "+e.msn+" part "+e.part:""}${s?" Pathway "+s:""}${n&&a.live?" age "+n.toFixed(1)+(a.type&&" "+a.type||""):""} ${i}`),this.hls.trigger(wg.LEVEL_LOADING,{url:i,level:r,levelInfo:t,pathwayId:t.attrs["PATHWAY-ID"],id:0,deliveryDirectives:e||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;if(1===this._levels.length)return;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));gb(i),this._levels=i,this.currentLevelIndex>-1&&null!=(e=this.currentLevel)&&e.details&&(this.currentLevelIndex=this.currentLevel.details.fragments[0].level),this.manualLevelIndex>-1&&(this.manualLevelIndex=this.currentLevelIndex);const r=i.length-1;this._firstLevel=Math.min(this._firstLevel,r),this._startLevel&&(this._startLevel=Math.min(this._startLevel,r)),this.hls.trigger(wg.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(wg.MAX_AUTO_LEVEL_UPDATED,{autoLevelCapping:t,levels:this.levels,maxAutoLevel:e,minAutoLevel:this.hls.minAutoLevel,maxHdcpLevel:i}))}}function Nx(t){const e={};t.forEach(t=>{const i=t.groupId||"";t.id=e[i]=e[i]||0,e[i]++})}function jx(){return self.SourceBuffer||self.WebKitSourceBuffer}function zx(){if(!Bg())return!1;const t=jx();return!t||t.prototype&&"function"==typeof t.prototype.appendBuffer&&"function"==typeof t.prototype.remove}class Bx extends Db{constructor(t,e,i){super(t,e,i,"stream-controller",Tg),this.audioCodecSwap=!1,this.level=-1,this._forceStartLoad=!1,this._hasEnoughToStart=!1,this.altAudio=0,this.audioOnly=!1,this.fragPlaying=null,this.fragLastKbps=0,this.couldBacktrack=!1,this.backtrackFragment=null,this.audioCodecSwitch=!1,this.videoBuffer=null,this.onMediaPlaying=()=>{this.tick()},this.onMediaSeeked=()=>{const t=this.media,e=t?t.currentTime:null;if(null===e||!mg(e))return;if(this.log(`Media seeked to ${e.toFixed(3)}`),!this.getBufferedFrag(e))return;const i=this.getFwdBufferInfoAtPos(t,e,Tg,0);null!==i&&0!==i.len?this.tick():this.warn(`Main forward buffer length at ${e} on "seeked" event ${i?i.len:"empty"})`)},this.registerListeners()}registerListeners(){super.registerListeners();const{hls:t}=this;t.on(wg.MANIFEST_PARSED,this.onManifestParsed,this),t.on(wg.LEVEL_LOADING,this.onLevelLoading,this),t.on(wg.LEVEL_LOADED,this.onLevelLoaded,this),t.on(wg.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),t.on(wg.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),t.on(wg.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),t.on(wg.BUFFER_CREATED,this.onBufferCreated,this),t.on(wg.BUFFER_FLUSHED,this.onBufferFlushed,this),t.on(wg.LEVELS_UPDATED,this.onLevelsUpdated,this),t.on(wg.FRAG_BUFFERED,this.onFragBuffered,this)}unregisterListeners(){super.unregisterListeners();const{hls:t}=this;t.off(wg.MANIFEST_PARSED,this.onManifestParsed,this),t.off(wg.LEVEL_LOADED,this.onLevelLoaded,this),t.off(wg.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),t.off(wg.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),t.off(wg.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),t.off(wg.BUFFER_CREATED,this.onBufferCreated,this),t.off(wg.BUFFER_FLUSHED,this.onBufferFlushed,this),t.off(wg.LEVELS_UPDATED,this.onLevelsUpdated,this),t.off(wg.FRAG_BUFFERED,this.onFragBuffered,this)}onHandlerDestroying(){this.onMediaPlaying=this.onMediaSeeked=null,this.unregisterListeners(),super.onHandlerDestroying()}startLoad(t,e){if(this.levels){const{lastCurrentTime:i,hls:r}=this;if(this.stopLoad(),this.setInterval(100),this.level=-1,!this.startFragRequested){let t=r.startLevel;-1===t&&(r.config.testBandwidth&&this.levels.length>1?(t=0,this.bitrateTest=!0):t=r.firstAutoLevel),r.nextLoadLevel=t,this.level=r.loadLevel,this._hasEnoughToStart=!!e}i>0&&-1===t&&!e&&(this.log(`Override startPosition with lastCurrentTime @${i.toFixed(3)}`),t=i),this.state=xb,this.nextLoadPosition=this.lastCurrentTime=t+this.timelineOffset,this.startPosition=e?-1:t,this.tick()}else this._forceStartLoad=!0,this.state=wb}stopLoad(){this._forceStartLoad=!1,super.stopLoad()}doTick(){switch(this.state){case Ib:{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&&!this.waitForLive(i))){if(this.waitForCdnTuneIn(r))break;this.state=xb;break}if(this.hls.nextLoadLevel!==this.level){this.state=xb;break}break}case Pb:{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=xb}}}this.state===xb&&this.doTickIdle(),this.onTickEnd()}onTickEnd(){var t;super.onTickEnd(),null!=(t=this.media)&&t.readyState&&!1===this.media.seeking&&(this.lastCurrentTime=this.media.currentTime),this.checkFragmentChanged()}doTickIdle(){const{hls:t,levelLastLoaded:e,levels:i,media:r}=this;if(null===e||!r&&!this.primaryPrefetch&&(this.startFragRequested||!t.config.startFragPrefetch))return;if(this.altAudio&&this.audioOnly)return;const s=this.buffering?t.nextLoadLevel:t.loadLevel;if(null==i||!i[s])return;const a=i[s],n=this.getMainFwdBufferInfo();if(null===n)return;const o=this.getLevelDetails();if(o&&this._streamEnded(n,o)){const t={};return 2===this.altAudio&&(t.type="video"),this.hls.trigger(wg.BUFFER_EOS,t),void(this.state=_b)}if(!this.buffering)return;t.loadLevel!==s&&-1===t.manualLevel&&this.log(`Adapting to level ${s} from level ${this.level}`),this.level=t.nextLoadLevel=s;const l=a.details;if(!l||this.state===Ib||this.waitForLive(a))return this.level=s,this.state=Ib,void(this.startFragRequested=!1);const c=n.len,d=this.getMaxBufferLength(a.maxBitrate);if(c>=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,l);if(this.couldBacktrack&&!this.fragPrevious&&p&&ef(p)&&this.fragmentTracker.getState(p)!==Nm){var u;const t=(null!=(u=this.backtrackFragment)?u:p).sn-l.startSN,e=l.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?Qg:Xg,e=(t===Xg?this.videoBuffer:this.mediaBuffer)||this.media;e&&this.afterBufferFlushed(e,t,Tg)}p=this.getNextFragmentLoopLoading(p,l,n,Tg,d)}p&&(!p.initSegment||p.initSegment.data||this.bitrateTest||(p=p.initSegment),this.loadFragment(p,a,h))}loadFragment(t,e,i){const r=this.fragmentTracker.getState(t);r===Um||r===Fm?ef(t)?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)):super.loadFragment(t,e,i):this._loadInitSegment(t,e):this.clearTrackerIfNeeded(t)}getBufferedFrag(t){return this.fragmentTracker.getBufferedFrag(t,Tg)}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 s=this.getLevelDetails();if(null!=s&&s.live){const t=this.getMainFwdBufferInfo();if(!t||t.len<2*s.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 a=this.getBufferedFrag(e.currentTime+i);if(a){const t=this.followingBufferedFrag(a);if(t){this.abortCurrentFrag();const e=t.maxStartPTS?t.maxStartPTS:t.start,i=t.duration,r=Math.max(a.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 Sb:case Eb:case Pb:case Lb:case Cb:this.state=xb}this.nextLoadPosition=this.getLoadPosition()}flushMainBuffer(t,e){super.flushMainBuffer(t,e,2===this.altAudio?"video":null)}onMediaAttached(t,e){super.onMediaAttached(t,e);const i=e.media;tw(i,"playing",this.onMediaPlaying),tw(i,"seeked",this.onMediaSeeked)}onMediaDetaching(t,e){const{media:i}=this;i&&(ew(i,"playing",this.onMediaPlaying),ew(i,"seeked",this.onMediaSeeked)),this.videoBuffer=null,this.fragPlaying=null,super.onMediaDetaching(t,e);!!e.transferMedia||(this._hasEnoughToStart=!1)}onManifestLoading(){super.onManifestLoading(),this.log("Trigger BUFFER_RESET"),this.hls.trigger(wg.BUFFER_RESET,void 0),this.couldBacktrack=!1,this.fragLastKbps=0,this.fragPlaying=this.backtrackFragment=null,this.altAudio=0,this.audioOnly=!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=jx();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!==xb)return;const r=e.levelInfo;(!r.details||r.details.live&&(this.levelLastLoaded!==r||r.details.expired)||this.waitForCdnTuneIn(r.details))&&(this.state=Ib)}onLevelLoaded(t,e){var i;const{levels:r,startFragRequested:s}=this,a=e.level,n=e.details,o=n.totalduration;if(!r)return void this.warn(`Levels were reset while loading level ${a}`);this.log(`Level ${a} loaded [${n.startSN},${n.endSN}]${n.lastPartSn?`[part-${n.lastPartSn}-${n.lastPartIndex}]`:""}, cc [${n.startCC}, ${n.endCC}] duration:${o}`);const l=e.levelInfo,c=this.fragCurrent;!c||this.state!==Eb&&this.state!==Pb||c.level!==e.level&&c.loader&&this.abortCurrentFrag();let d=0;if(n.live||null!=(i=l.details)&&i.live){var h;if(this.checkLiveUpdate(n),n.deltaUpdateFailed)return;d=this.alignPlaylists(n,l.details,null==(h=this.levelLastLoaded)?void 0:h.details)}if(l.details=n,this.levelLastLoaded=l,s||this.setStartPosition(n,d),this.hls.trigger(wg.LEVEL_UPDATED,{details:n,level:a}),this.state===Ib){if(this.waitForCdnTuneIn(n))return;this.state=xb}s&&n.live&&this.synchronizeToLiveEdge(n),this.tick()}synchronizeToLiveEdge(t){const{config:e,media:i}=this;if(!i)return;const r=this.hls.liveSyncPosition,s=this.getLoadPosition(),a=t.fragmentStart,n=t.edge,o=s>=a-e.maxFragLookUpTolerance&&s<=n;if(null!==r&&i.duration>r&&(s<r||!o)){const a=void 0!==e.liveMaxLatencyDuration?e.liveMaxLatencyDuration:e.liveMaxLatencyDurationCount*t.targetduration;if((!o&&i.readyState<4||s<n-a)&&(this._hasEnoughToStart||(this.nextLoadPosition=r),i.readyState))if(this.warn(`Playback: ${s.toFixed(3)} is located too far from the end of live sliding playlist: ${n}, reset currentTime to : ${r.toFixed(3)}`),"buffered"===this.config.liveSyncMode){var l;const t=sv.bufferInfo(i,r,0);if(null==t||null==(l=t.buffered)||!l.length)return void(i.currentTime=r);if(t.start<=s)return void(i.currentTime=r);const{nextStart:e}=sv.bufferedInfo(t.buffered,s,0);e&&(i.currentTime=e)}else i.currentTime=r}}_handleFragmentLoadProgress(t){var e;const i=t.frag,{part:r,payload:s}=t,{levels:a}=this;if(!a)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=a[i.level];if(!n)return void this.warn(`Level ${i.level} not found on progress`);const 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 l=n.videoCodec,c=o.PTSKnown||!o.live,d=null==(e=i.initSegment)?void 0:e.data,h=this._getAudioCodec(n),p=this.transmuxer=this.transmuxer||new cy(this.hls,Tg,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)),u=r?r.index:-1,g=-1!==u,f=new iv(i.level,i.sn,i.stats.chunkCount,s.byteLength,u,g),m=this.initPTS[i.cc];p.push(s,d,h,l,i,r,o.totalduration,c,f,m)}onAudioTrackSwitching(t,e){const i=this.hls,r=2===this.altAudio;if(vm(e.url,i))this.altAudio=1;else{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();if(r)return this.fragmentTracker.removeAllFragments(),i.once(wg.BUFFER_FLUSHED,()=>{var t;null==(t=this.hls)||t.trigger(wg.AUDIO_TRACK_SWITCHED,e)}),void i.trigger(wg.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:null});i.trigger(wg.AUDIO_TRACK_SWITCHED,e)}}onAudioTrackSwitched(t,e){const i=vm(e.url,this.hls);if(i){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=i?2:0,this.tick()}onBufferCreated(t,e){const i=e.tracks;let r,s,a=!1;for(const t in i){const e=i[t];if("main"===e.id){if(s=t,r=e,"video"===t){const e=i[t];e&&(this.videoBuffer=e.buffer)}}else a=!0}a&&r?(this.log(`Alternate track found, use ${s}.buffered to schedule main fragment loading`),this.mediaBuffer=r.buffer):this.mediaBuffer=this.media}onFragBuffered(t,e){const{frag:i,part:r}=e,s=i.type===Tg;if(s){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===Cb&&(this.state=xb));const t=r?r.stats:i.stats;this.fragLastKbps=Math.round(8*t.total/(t.buffering.end-t.loading.first)),ef(i)&&(this.fragPrevious=i),this.fragBufferedComplete(i,r)}const a=this.media;a&&(!this._hasEnoughToStart&&sv.getBuffered(a).length&&(this._hasEnoughToStart=!0,this.seekToStartPos()),s&&this.tick())}get hasEnoughToStart(){return this._hasEnoughToStart}onError(t,e){var i;if(e.fatal)this.state=Ab;else switch(e.details){case yg.FRAG_GAP:case yg.FRAG_PARSING_ERROR:case yg.FRAG_DECRYPT_ERROR:case yg.FRAG_LOAD_ERROR:case yg.FRAG_LOAD_TIMEOUT:case yg.KEY_LOAD_ERROR:case yg.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(Tg,e);break;case yg.LEVEL_LOAD_ERROR:case yg.LEVEL_LOAD_TIMEOUT:case yg.LEVEL_PARSING_ERROR:e.levelRetry||this.state!==Ib||(null==(i=e.context)?void 0:i.type)!==Sg||(this.state=xb);break;case yg.BUFFER_ADD_CODEC_ERROR:case yg.BUFFER_APPEND_ERROR:if("main"!==e.parent)return;this.reduceLengthAndFlushBuffer(e)&&this.resetLoadingState();break;case yg.BUFFER_FULL_ERROR:if("main"!==e.parent)return;this.reduceLengthAndFlushBuffer(e)&&this.flushMainBuffer(0,Number.POSITIVE_INFINITY);break;case yg.INTERNAL_EXCEPTION:this.recoverWorkerError(e)}}onFragLoadEmergencyAborted(){this.state=xb,this._hasEnoughToStart||(this.startFragRequested=!1,this.nextLoadPosition=this.lastCurrentTime),this.tickImmediate()}onBufferFlushed(t,{type:e}){if(e!==Qg||!this.altAudio){const t=(e===Xg?this.videoBuffer:this.mediaBuffer)||this.media;t&&(this.afterBufferFlushed(t,e,Tg),this.tick())}}onLevelsUpdated(t,e){this.level>-1&&this.fragCurrent&&(this.level=this.fragCurrent.level,-1===this.level&&this.resetWhenMissingContext(this.fragCurrent)),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=this.timelineOffset;r&&i&&(i+=r);const s=this.getLevelDetails(),a=sv.getBuffered(t),n=a.length?a.start(0):0,o=n-i,l=Math.max(this.config.maxBufferHole,this.config.maxFragLookUpTolerance);(this.config.startOnSegmentBoundary||o>0&&(o<l||this.loadingParts&&o<2*((null==s?void 0:s.partTarget)||0)))&&(this.log(`adjusting start position by ${o} to match buffer start`),i+=o,this.startPosition=i),e<i&&(this.log(`seek to target start position ${i} from current time ${e} buffer start ${n}`),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(t=>{const{hls:i}=this,r=null==t?void 0:t.frag;if(!r||this.fragContextChanged(r))return;e.fragmentError=0,this.state=xb,this.startFragRequested=!1,this.bitrateTest=!1;const s=r.stats;s.parsing.start=s.parsing.end=s.buffering.start=s.buffering.end=self.performance.now(),i.trigger(wg.FRAG_LOADED,t),r.bitrateTest=!1})}_handleTransmuxComplete(t){var e;const i=this.playlistType,{hls:r}=this,{remuxResult:s,chunkMeta:a}=t,n=this.getCurrentContext(a);if(!n)return void this.resetWhenMissingContext(a);const{frag:o,part:l,level:c}=n,{video:d,text:h,id3:p,initSegment:u}=s,{details:g}=c,f=this.altAudio?void 0:s.audio;if(this.fragContextChanged(o))this.fragmentTracker.removeFragment(o);else{if(this.state=Lb,u){if(null!=u&&u.tracks){const t=o.initSegment||o;this._bufferInitSegment(c,u.tracks,t,a),r.trigger(wg.FRAG_PARSING_INIT_SEGMENT,{frag:t,id:i,tracks:u.tracks})}const t=u.initPTS,e=u.timescale,s=this.initPTS[o.cc];!mg(t)||s&&s.baseTime===t&&s.timescale===e||(this.initPTS[o.cc]={baseTime:t,timescale:e},r.trigger(wg.INIT_PTS_FOUND,{frag:o,id:i,initPTS:t,timescale:e}))}if(d&&g){f&&"audiovideo"===d.type&&this.logMuxedErr(o);const t=g.fragments[o.sn-1-g.startSN],e=o.sn===g.startSN,i=!t||o.cc>t.cc;if(!1!==s.independent){const{startPTS:t,endPTS:r,startDTS:s,endDTS:n}=d;if(l)l.elementaryStreams[d.type]={startPTS:t,endPTS:r,startDTS:s,endDTS:n};else if(d.firstKeyFrame&&d.independent&&1===a.id&&!i&&(this.couldBacktrack=!0),d.dropped&&d.independent){const s=this.getMainFwdBufferInfo(),a=(s?s.end:this.getLoadPosition())+this.config.maxBufferHole,l=d.firstKeyFramePTS?d.firstKeyFramePTS:t;if(!e&&a<l-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-(g.appliedTimelineOffset||0)>2&&(o.gap=!0);o.setElementaryStreamInfo(d.type,t,r,s,n),this.backtrackFragment&&(this.backtrackFragment=o),this.bufferFragmentData(d,o,l,a,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;l&&(l.elementaryStreams[Qg]={startPTS:t,endPTS:e,startDTS:i,endDTS:r}),o.setElementaryStreamInfo(Qg,t,e,i,r),this.bufferFragmentData(f,o,l,a)}if(g&&null!=p&&null!=(e=p.samples)&&e.length){const t={id:i,frag:o,details:g,samples:p.samples};r.trigger(wg.FRAG_PARSING_METADATA,t)}if(g&&h){const t={id:i,frag:o,details:g,samples:h.samples};r.trigger(wg.FRAG_PARSING_USERDATA,t)}}}logMuxedErr(t){this.warn(`${ef(t)?"Media":"Init"} segment with muxed audiovideo where only video expected: ${t.url}`)}_bufferInitSegment(t,e,i,r){if(this.state!==Lb)return;this.audioOnly=!!e.audio&&!e.video,this.altAudio&&!this.audioOnly&&(delete e.audio,e.audiovideo&&this.logMuxedErr(i));const{audio:s,video:a,audiovideo:n}=e;if(s){const i=t.audioCodec;let r=Bf(s.codec,i);"mp4a"===r&&(r="mp4a.40.5");const a=navigator.userAgent.toLowerCase();if(this.audioCodecSwitch){r&&(r=-1!==r.indexOf("mp4a.40.5")?"mp4a.40.2":"mp4a.40.5");const t=s.metadata;t&&"channelCount"in t&&1!==(t.channelCount||1)&&-1===a.indexOf("firefox")&&(r="mp4a.40.5")}r&&-1!==r.indexOf("mp4a.40.5")&&-1!==a.indexOf("android")&&"audio/mpeg"!==s.container&&(r="mp4a.40.2",this.log(`Android: force audio codec to ${r}`)),i&&i!==r&&this.log(`Swapping manifest audio codec "${i}" for "${r}"`),s.levelCodec=r,s.id=Tg,this.log(`Init audio buffer, container:${s.container}, codecs[selected/level/parsed]=[${r||""}/${i||""}/${s.codec}]`),delete e.audiovideo}if(a){a.levelCodec=t.videoCodec,a.id=Tg;const i=a.codec;if(4===(null==i?void 0:i.length))switch(i){case"hvc1":case"hev1":a.codec="hvc1.1.6.L120.90";break;case"av01":a.codec="av01.0.04M.08";break;case"avc1":a.codec="avc1.42e01e"}this.log(`Init video buffer, container:${a.container}, codecs[level/parsed]=[${t.videoCodec||""}/${i}]${a.codec!==i?" parsed-corrected="+a.codec:""}${a.supplemental?" supplemental="+a.supplemental:""}`),delete e.audiovideo}n&&(this.log(`Init audiovideo buffer, container:${n.container}, codecs[level/parsed]=[${t.codecs}/${n.codec}]`),delete e.video,delete e.audio);const o=Object.keys(e);if(o.length){if(this.hls.trigger(wg.BUFFER_CODECS,e),!this.hls)return;o.forEach(t=>{const s=e[t].initSegment;null!=s&&s.byteLength&&this.hls.trigger(wg.BUFFER_APPENDING,{type:t,data:s,frag:i,part:null,chunkMeta:r,parent:i.type})})}this.tickImmediate()}getMainFwdBufferInfo(){const t=this.mediaBuffer&&2===this.altAudio?this.mediaBuffer:this.media;return this.getFwdBufferInfo(t,Tg)}get maxBufferLength(){const{levels:t,level:e}=this,i=null==t?void 0:t[e];return i?this.getMaxBufferLength(i.maxBitrate):this.config.maxBufferLength}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=xb}checkFragmentChanged(){const t=this.media;let e=null;if(t&&t.readyState>1&&!1===t.seeking){const i=t.currentTime;if(sv.isBuffered(t,i)?e=this.getAppendedFrag(i):sv.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(wg.FRAG_CHANGED,{frag:e}),t&&t.level===i||this.hls.trigger(wg.LEVEL_SWITCHED,{level:i}))}}}get nextLevel(){const t=this.nextBufferedFrag;return t?t.level:-1}get currentFrag(){var t;if(this.fragPlaying)return this.fragPlaying;const e=(null==(t=this.media)?void 0:t.currentTime)||this.lastCurrentTime;return mg(e)?this.getAppendedFrag(e):null}get currentProgramDateTime(){var t;const e=(null==(t=this.media)?void 0:t.currentTime)||this.lastCurrentTime;if(mg(e)){const t=this.getLevelDetails(),i=this.currentFrag||(t?km(null,t.fragments,e):null);if(i){const t=i.programDateTime;if(null!==t){const r=t+1e3*(e-i.start);return new Date(r)}}}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 Gx{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=yg.KEY_LOAD_ERROR,i,r,s){return new tv({type:kg.NETWORK_ERROR,details:e,fatal:!1,frag:t,response:s,error:i,networkDetails:r})}loadClear(t,e){if(this.emeController&&this.config.emeEnabled&&!this.emeController.getSelectedKeySystemFormats().length)if(e.length){const{sn:i,cc:r}=t;for(let t=0;t<e.length;t++){const s=e[t];if(r<=s.cc&&("initSegment"===i||"initSegment"===s.sn||i<s.sn))return this.emeController.selectKeySystemFormat(s).then(t=>{if(s.setKeyFormat(t),this.emeController&&this.config.requireKeySystemAccessOnStart){const e=Cv(t);if(e)return this.emeController.getKeySystemAccess([e])}})}}else if(this.config.requireKeySystemAccessOnStart){const t=Ov(this.config);if(t.length)return this.emeController.getKeySystemAccess(t)}return null}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 s=t.decryptdata;if(!s){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,yg.KEY_LOAD_ERROR,i))}const a=s.uri;if(!a)return Promise.reject(this.createKeyLoadError(t,yg.KEY_LOAD_ERROR,new Error(`Invalid key URI: "${a}"`)));let n=this.keyUriToKeyInfo[a];if(null!=(i=n)&&i.decryptdata.key)return s.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=>(s.key=e.keyInfo.decryptdata.key,{frag:t,keyInfo:n}))}switch(n=this.keyUriToKeyInfo[a]={decryptdata:s,keyLoadPromise:null,loader:null,mediaKeySessionContext:null},s.method){case"ISO-23001-7":case"SAMPLE-AES":case"SAMPLE-AES-CENC":case"SAMPLE-AES-CTR":return"identity"===s.keyFormat?this.loadKeyHTTP(n,t):this.loadKeyEME(n,t);case"AES-128":case"AES-256":case"AES-256-CTR":return this.loadKeyHTTP(n,t);default:return Promise.reject(this.createKeyLoadError(t,yg.KEY_LOAD_ERROR,new Error(`Key supplied with unsupported METHOD: "${s.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((s,a)=>{const n={keyInfo:t,frag:e,responseType:"arraybuffer",url:t.decryptdata.uri},o=i.keyLoadPolicy.default,l={loadPolicy:o,timeout:o.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0},c={onSuccess:(t,e,i,r)=>{const{frag:n,keyInfo:o,url:l}=i;if(!n.decryptdata||o!==this.keyUriToKeyInfo[l])return a(this.createKeyLoadError(n,yg.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,s({frag:n,keyInfo:o})},onError:(t,i,r,s)=>{this.resetLoader(i),a(this.createKeyLoadError(e,yg.KEY_LOAD_ERROR,new Error(`HTTP Error ${t.code} loading key ${t.text}`),r,Mg({url:n.url,data:void 0},t)))},onTimeout:(t,i,r)=>{this.resetLoader(i),a(this.createKeyLoadError(e,yg.KEY_LOAD_TIMEOUT,new Error("key loading timed out"),r))},onAbort:(t,i,r)=>{this.resetLoader(i),a(this.createKeyLoadError(e,yg.INTERNAL_ABORTED,new Error("key loading aborted"),r))}};r.load(n,l,c)})}resetLoader(t){const{frag:e,keyInfo:i,url:r}=t,s=i.loader;e.keyLoader===s&&(e.keyLoader=null,i.loader=null),delete this.keyUriToKeyInfo[r],s&&s.destroy()}}function Hx(t){const{type:e}=t;switch(e){case Eg:return Lg;case Pg:return Cg;default:return Tg}}function Vx(t,e){let i=t.url;return void 0!==i&&0!==i.indexOf("data:")||(i=e.url),i}class qx{constructor(t){this.hls=void 0,this.loaders=Object.create(null),this.variableList=null,this.onManifestLoaded=this.checkAutostartLoad,this.hls=t,this.registerListeners()}startLoad(t){}stopLoad(){this.destroyInternalLoaders()}registerListeners(){const{hls:t}=this;t.on(wg.MANIFEST_LOADING,this.onManifestLoading,this),t.on(wg.LEVEL_LOADING,this.onLevelLoading,this),t.on(wg.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),t.on(wg.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this),t.on(wg.LEVELS_UPDATED,this.onLevelsUpdated,this)}unregisterListeners(){const{hls:t}=this;t.off(wg.MANIFEST_LOADING,this.onManifestLoading,this),t.off(wg.LEVEL_LOADING,this.onLevelLoading,this),t.off(wg.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),t.off(wg.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this),t.off(wg.LEVELS_UPDATED,this.onLevelsUpdated,this)}createInternalLoader(t){const e=this.hls.config,i=e.pLoader,r=e.loader,s=new(i||r)(e);return this.loaders[t.type]=s,s}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:xg,url:i,deliveryDirectives:null,levelOrTrack:null})}onLevelLoading(t,e){const{id:i,level:r,pathwayId:s,url:a,deliveryDirectives:n,levelInfo:o}=e;this.load({id:i,level:r,pathwayId:s,responseType:"text",type:Sg,url:a,deliveryDirectives:n,levelOrTrack:o})}onAudioTrackLoading(t,e){const{id:i,groupId:r,url:s,deliveryDirectives:a,track:n}=e;this.load({id:i,groupId:r,level:null,responseType:"text",type:Eg,url:s,deliveryDirectives:a,levelOrTrack:n})}onSubtitleTrackLoading(t,e){const{id:i,groupId:r,url:s,deliveryDirectives:a,track:n}=e;this.load({id:i,groupId:r,level:null,responseType:"text",type:Pg,url:s,deliveryDirectives:a,levelOrTrack:n})}onLevelsUpdated(t,e){const i=this.loaders[Sg];if(i){const t=i.context;t&&!e.levels.some(e=>e===t.levelOrTrack)&&(i.abort(),delete this.loaders[Sg])}}load(t){var e;const i=this.hls.config;let r,s=this.getInternalLoader(t);if(s){const e=this.hls.logger,i=s.context;if(i&&i.levelOrTrack===t.levelOrTrack&&(i.url===t.url||i.deliveryDirectives&&!t.deliveryDirectives))return void(i.url===t.url?e.log(`[playlist-loader]: ignore ${t.url} ongoing request`):e.log(`[playlist-loader]: ignore ${t.url} in favor of ${i.url}`));e.log(`[playlist-loader]: aborting previous loader for type: ${t.type}`),s.abort()}if(r=t.type===xg?i.manifestLoadPolicy.default:Ig({},i.playlistLoadPolicy.default,{timeoutRetry:null,errorRetry:null}),s=this.createInternalLoader(t),mg(null==(e=t.deliveryDirectives)?void 0:e.part)){let e;if(t.type===Sg&&null!==t.level?e=this.hls.levels[t.level].details:t.type===Eg&&null!==t.id?e=this.hls.audioTracks[t.id].details:t.type===Pg&&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=Ig({},r,{maxTimeToFirstByteMs:Math.min(e,r.maxTimeToFirstByteMs),maxLoadTimeMs:Math.min(e,r.maxTimeToFirstByteMs)})}}}const a=r.errorRetry||r.timeoutRetry||{},n={loadPolicy:r,timeout:r.maxLoadTimeMs,maxRetry:a.maxNumRetry||0,retryDelay:a.retryDelayMs||0,maxRetryDelay:a.maxRetryDelayMs||0},o={onSuccess:(t,e,i,r)=>{const s=this.getInternalLoader(i);this.resetInternalLoader(i.type);const a=t.data;0===a.indexOf("#EXTM3U")?(e.parsing.start=performance.now(),qv.isMediaPlaylist(a)||i.type!==xg?this.handleTrackOrLevelPlaylist(t,e,i,r||null,s):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)}};s.load(t,n,o)}checkAutostartLoad(){if(!this.hls)return;const{config:{autoStartLoad:t,startPosition:e},forceStartLoad:i}=this.hls;(t||i)&&(this.hls.logger.log(`${t?"auto":"force"} startLoad with configured startPosition ${e}`),this.hls.startLoad(e))}handleMasterPlaylist(t,e,i,r){const s=this.hls,a=t.data,n=Vx(t,i),o=qv.parseMasterPlaylist(a,n);if(o.playlistParsingError)return void this.handleManifestParsingError(t,i,o.playlistParsingError,r,e);const{contentSteering:l,levels:c,sessionData:d,sessionKeys:h,startTimeOffset:p,variableList:u}=o;this.variableList=u;const{AUDIO:g=[],SUBTITLES:f,"CLOSED-CAPTIONS":m}=qv.parseMasterPlaylistMedia(a,n,o);if(g.length){g.some(t=>!t.url)||!c[0].audioCodec||c[0].attrs.AUDIO||(this.hls.logger.log("[playlist-loader]: audio codec signaled in quality level, but no embedded audio track signaled, create one"),g.unshift({type:"main",name:"main",groupId:"main",default:!1,autoselect:!1,forced:!1,id:-1,attrs:new pv({}),bitrate:0,url:""}))}s.trigger(wg.MANIFEST_LOADED,{levels:c,audioTracks:g,subtitles:f,captions:m,contentSteering:l,url:n,stats:e,networkDetails:r,sessionData:d,sessionKeys:h,startTimeOffset:p,variableList:u})}handleTrackOrLevelPlaylist(t,e,i,r,s){const a=this.hls,{id:n,level:o,type:l}=i,c=Vx(t,i),d=mg(o)?o:mg(n)?n:0,h=Hx(i),p=qv.parseLevelPlaylist(t.data,c,d,h,0,this.variableList);if(l===xg){const t={attrs:new pv({}),bitrate:0,details:p,name:"",url:c};p.requestScheduled=e.loading.start+db(p,0),a.trigger(wg.MANIFEST_LOADED,{levels:[t],audioTracks:[],url:c,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,s)}handleManifestParsingError(t,e,i,r,s){this.hls.trigger(wg.ERROR,{type:kg.NETWORK_ERROR,details:yg.MANIFEST_PARSING_ERROR,fatal:e.type===xg,url:t.url,err:i,error:i,reason:i.message,response:t,context:e,networkDetails:r,stats:s})}handleNetworkError(t,e,i=!1,r,s){let a=`A network ${i?"timeout":"error"+(r?" (status "+r.code+")":"")} occurred while loading ${t.type}`;t.type===Sg?a+=`: ${t.level} id: ${t.id}`:t.type!==Eg&&t.type!==Pg||(a+=` id: ${t.id} group-id: "${t.groupId}"`);const n=new Error(a);this.hls.logger.warn(`[playlist-loader]: ${a}`);let o=yg.UNKNOWN,l=!1;const c=this.getInternalLoader(t);switch(t.type){case xg:o=i?yg.MANIFEST_LOAD_TIMEOUT:yg.MANIFEST_LOAD_ERROR,l=!0;break;case Sg:o=i?yg.LEVEL_LOAD_TIMEOUT:yg.LEVEL_LOAD_ERROR,l=!1;break;case Eg:o=i?yg.AUDIO_TRACK_LOAD_TIMEOUT:yg.AUDIO_TRACK_LOAD_ERROR,l=!1;break;case Pg:o=i?yg.SUBTITLE_TRACK_LOAD_TIMEOUT:yg.SUBTITLE_LOAD_ERROR,l=!1}c&&this.resetInternalLoader(t.type);const d={type:kg.NETWORK_ERROR,details:o,fatal:l,url:t.url,loader:c,context:t,error:n,networkDetails:e,stats:s};if(r){const i=(null==e?void 0:e.url)||t.url;d.response=Mg({url:i,data:void 0},r)}this.hls.trigger(wg.ERROR,d)}handlePlaylistLoaded(t,e,i,r,s,a){const n=this.hls,{type:o,level:l,id:c,groupId:d,deliveryDirectives:h}=r,p=Vx(e,r),u=Hx(r),g="number"==typeof r.level&&u===Tg?l:void 0;if(!t.fragments.length){const a=t.playlistParsingError=new Error("No Segments found in Playlist");return void n.trigger(wg.ERROR,{type:kg.NETWORK_ERROR,details:yg.LEVEL_EMPTY_ERROR,fatal:!1,url:p,error:a,reason:a.message,response:e,context:r,level:g,parent:u,networkDetails:s,stats:i})}t.targetduration||(t.playlistParsingError=new Error("Missing Target Duration"));const f=t.playlistParsingError;if(f){if(this.hls.logger.warn(f),!n.config.ignorePlaylistParsingErrors)return void n.trigger(wg.ERROR,{type:kg.NETWORK_ERROR,details:yg.LEVEL_PARSING_ERROR,fatal:!1,url:p,error:f,reason:f.message,response:e,context:r,level:g,parent:u,networkDetails:s,stats:i});t.playlistParsingError=null}switch(t.live&&a&&(a.getCacheAge&&(t.ageHeader=a.getCacheAge()||0),a.getCacheAge&&!isNaN(t.ageHeader)||(t.ageHeader=0)),o){case xg:case Sg:n.trigger(wg.LEVEL_LOADED,{details:t,levelInfo:r.levelOrTrack||n.levels[0],level:g||0,id:c||0,stats:i,networkDetails:s,deliveryDirectives:h,withoutMultiVariant:o===xg});break;case Eg:n.trigger(wg.AUDIO_TRACK_LOADED,{details:t,track:r.levelOrTrack,id:c||0,groupId:d||"",stats:i,networkDetails:s,deliveryDirectives:h});break;case Pg:n.trigger(wg.SUBTITLE_TRACK_LOADED,{details:t,track:r.levelOrTrack,id:c||0,groupId:d||"",stats:i,networkDetails:s,deliveryDirectives:h})}}}class Kx{static get version(){return jb}static isMSESupported(){return zx()}static isSupported(){return function(){if(!zx())return!1;const t=Bg();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(Uf(e,"video")))||["mp4a.40.2","fLaC"].some(e=>t.isTypeSupported(Uf(e,"audio"))))}()}static getMediaSource(){return Bg()}static get Events(){return wg}static get MetadataSchema(){return ck}static get ErrorTypes(){return kg}static get ErrorDetails(){return yg}static get DefaultConfig(){return Kx.defaultConfig?Kx.defaultConfig:Tx}static set DefaultConfig(t){Kx.defaultConfig=t}constructor(t={}){this.config=void 0,this.userConfig=void 0,this.logger=void 0,this.coreComponents=void 0,this.networkControllers=void 0,this._emitter=new Nb,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.audioStreamController=void 0,this.subtititleStreamController=void 0,this.audioTrackController=void 0,this.subtitleTrackController=void 0,this.interstitialsController=void 0,this.gapController=void 0,this.emeController=void 0,this.cmcdController=void 0,this._media=null,this._url=null,this._sessionId=void 0,this.triggeringException=void 0,this.started=!1;const e=this.logger=function(t,e,i){const r=Fg();if("object"==typeof console&&!0===t||"object"==typeof t){const s=["debug","log","info","warn","error"];s.forEach(e=>{r[e]=Ng(e,t,i)});try{r.log(`Debug logs enabled for "${e}" in hls.js version 1.6.6`)}catch(t){return Fg()}s.forEach(e=>{jg[e]=Ng(e,t)})}else Ig(jg,r);return r}(t.debug||!1,"Hls instance",t.assetPlayerId),i=this.config=function(t,e,i){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 r=Lx(t),s=["TimeOut","MaxRetry","RetryDelay","MaxRetryTimeout"];return["manifest","level","frag"].forEach(t=>{const a=`${"level"===t?"playlist":t}LoadPolicy`,n=void 0===e[a],o=[];s.forEach(i=>{const s=`${t}Loading${i}`,l=e[s];if(void 0!==l&&n){o.push(s);const t=r[a].default;switch(e[a]={default:t},i){case"TimeOut":t.maxLoadTimeMs=l,t.maxTimeToFirstByteMs=l;break;case"MaxRetry":t.errorRetry.maxNumRetry=l,t.timeoutRetry.maxNumRetry=l;break;case"RetryDelay":t.errorRetry.retryDelayMs=l,t.timeoutRetry.retryDelayMs=l;break;case"MaxRetryTimeout":t.errorRetry.maxRetryDelayMs=l,t.timeoutRetry.maxRetryDelayMs=l}}}),o.length&&i.warn(`hls.js config: "${o.join('", "')}" setting(s) are deprecated, use "${a}": ${cm(e[a])}`)}),Mg(Mg({},r),e)}(Kx.DefaultConfig,t,e);this.userConfig=t,i.progressive&&Cx(i,e);const{abrController:r,bufferController:s,capLevelController:a,errorController:n,fpsController:o}=i,l=new n(this),c=this.abrController=new r(this),d=new jm(this),h=i.interstitialsController,p=h?this.interstitialsController=new h(this,Kx):null,u=this.bufferController=new s(this,d),g=this.capLevelController=new a(this),f=new o(this),m=new qx(this),v=i.contentSteeringController,b=v?new v(this):null,k=this.levelController=new Fx(this,b),y=new Ux(this),w=new Gx(this.config),x=this.streamController=new Bx(this,d,w),S=this.gapController=new _x(this,d);g.setStreamController(x),f.setStreamController(x);const E=[m,k,x];p&&E.splice(1,0,p),b&&E.splice(1,0,b),this.networkControllers=E;const P=[c,u,S,g,f,y,d];this.audioTrackController=this.createController(i.audioTrackController,E);const T=i.audioStreamController;T&&E.push(this.audioStreamController=new T(this,d,w)),this.subtitleTrackController=this.createController(i.subtitleTrackController,E);const L=i.subtitleStreamController;L&&E.push(this.subtititleStreamController=new L(this,d,w)),this.createController(i.timelineController,P),w.emeController=this.emeController=this.createController(i.emeController,P),this.cmcdController=this.createController(i.cmcdController,P),this.latencyController=this.createController($x,P),this.coreComponents=P,E.push(l);const C=l.onErrorOut;"function"==typeof C&&this.on(wg.ERROR,C,l),this.on(wg.MANIFEST_LOADED,m.onManifestLoaded,m)}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(this.logger.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===wg.ERROR;this.trigger(wg.ERROR,{type:kg.OTHER_ERROR,details:yg.INTERNAL_EXCEPTION,fatal:i,event:t,error:e}),this.triggeringException=!1}}return!1}listenerCount(t){return this._emitter.listenerCount(t)}destroy(){this.logger.log("destroy"),this.trigger(wg.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){if(!t||"media"in t&&!t.media){const e=new Error(`attachMedia failed: invalid argument (${t})`);return void this.trigger(wg.ERROR,{type:kg.OTHER_ERROR,details:yg.ATTACH_MEDIA_ERROR,fatal:!0,error:e})}this.logger.log("attachMedia"),this._media&&(this.logger.warn("media must be detached before attaching"),this.detachMedia());const e="media"in t,i=e?t.media:t,r=e?t:{media:i};this._media=i,this.trigger(wg.MEDIA_ATTACHING,r)}detachMedia(){this.logger.log("detachMedia"),this.trigger(wg.MEDIA_DETACHING,{}),this._media=null}transferMedia(){this._media=null;const t=this.bufferController.transferMedia();return this.trigger(wg.MEDIA_DETACHING,{transferMedia:t}),t}loadSource(t){this.stopLoad();const e=this.media,i=this._url,r=this._url=Wg.buildAbsoluteURL(self.location.href,t,{alwaysNormalize:!0});this._autoLevelCapping=-1,this._maxHdcpLevel=null,this.logger.log(`loadSource:${r}`),e&&i&&(i!==r||this.bufferController.hasSourceTypes())&&(this.detachMedia(),this.attachMedia(e)),this.trigger(wg.MANIFEST_LOADING,{url:t})}get url(){return this._url}get hasEnoughToStart(){return this.streamController.hasEnoughToStart}get startPosition(){return this.streamController.startPositionValue}startLoad(t=-1,e){this.logger.log(`startLoad(${t+(e?", <skip seek to start>":"")})`),this.started=!0,this.resumeBuffering();for(let i=0;i<this.networkControllers.length&&(this.networkControllers[i].startLoad(t,e),this.started&&this.networkControllers);i++);}stopLoad(){this.logger.log("stopLoad"),this.started=!1;for(let t=0;t<this.networkControllers.length&&(this.networkControllers[t].stopLoad(),!this.started&&this.networkControllers);t++);}get loadingEnabled(){return this.started}get bufferingEnabled(){return this.streamController.bufferingEnabled}resumeBuffering(){this.bufferingEnabled||(this.logger.log("resume buffering"),this.networkControllers.forEach(t=>{t.resumeBuffering&&t.resumeBuffering()}))}pauseBuffering(){this.bufferingEnabled&&(this.logger.log("pause buffering"),this.networkControllers.forEach(t=>{t.pauseBuffering&&t.pauseBuffering()}))}get inFlightFragments(){const t={[Tg]:this.streamController.inFlightFrag};return this.audioStreamController&&(t[Lg]=this.audioStreamController.inFlightFrag),this.subtititleStreamController&&(t[Cg]=this.subtititleStreamController.inFlightFrag),t}swapAudioCodec(){this.logger.log("swapAudioCodec"),this.streamController.swapAudioCodec()}recoverMediaError(){this.logger.log("recoverMediaError");const t=this._media,e=null==t?void 0:t.currentTime;this.detachMedia(),t&&(this.attachMedia(t),e&&this.startLoad(e))}removeLevel(t){this.levelController.removeLevel(t)}get sessionId(){let t=this._sessionId;return t||(t=this._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)})}}}()),t}get levels(){const t=this.levelController.levels;return t||[]}get latestLevelDetails(){return this.streamController.getLevelDetails()||null}get loadLevelObj(){return this.levelController.loadLevelObj}get currentLevel(){return this.streamController.currentLevel}set currentLevel(t){this.logger.log(`set currentLevel:${t}`),this.levelController.manualLevel=t,this.streamController.immediateLevelSwitch()}get nextLevel(){return this.streamController.nextLevel}set nextLevel(t){this.logger.log(`set nextLevel:${t}`),this.levelController.manualLevel=t,this.streamController.nextLevelSwitch()}get loadLevel(){return this.levelController.level}set loadLevel(t){this.logger.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){this.logger.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){this.logger.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 abrEwmaDefaultEstimate(){const{bwEstimator:t}=this.abrController;return t?t.defaultEstimate:NaN}get ttfbEstimate(){const{bwEstimator:t}=this.abrController;return t?t.getEstimateTTFB():NaN}set autoLevelCapping(t){this._autoLevelCapping!==t&&(this.logger.log(`set autoLevelCapping:${t}`),this._autoLevelCapping=t,this.levelController.checkMaxAutoUpdated())}get maxHdcpLevel(){return this._maxHdcpLevel}set maxHdcpLevel(t){(function(t){return Jf.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()}get maxBufferLength(){return this.streamController.maxBufferLength}setAudioOption(t){var e;return(null==(e=this.audioTrackController)?void 0:e.setAudioOption(t))||null}setSubtitleOption(t){var e;return(null==(e=this.subtitleTrackController)?void 0: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}set targetLatency(t){this.latencyController.targetLatency=t}get drift(){return this.latencyController.drift}get forceStartLoad(){return this.streamController.forceStartLoad}get pathways(){return this.levelController.pathways}get pathwayPriority(){return this.levelController.pathwayPriority}set pathwayPriority(t){this.levelController.pathwayPriority=t}get bufferedToEnd(){var t;return!(null==(t=this.bufferController)||!t.bufferedToEnd)}get interstitialsManager(){var t;return(null==(t=this.interstitialsController)?void 0:t.interstitialsManager)||null}getMediaDecodingInfo(t,e=this.allAudioTracks){return Zf(t,hm(e),navigator.mediaCapabilities)}}function Yx(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")}`}Kx.defaultConfig=void 0;var Wx=function(t,e,i,r){var s,a=arguments.length,n=a<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--)(s=t[o])&&(n=(a<3?s(n):a>3?s(e,i,n):s(e,i))||n);return a>3&&n&&Object.defineProperty(e,i,n),n};const Zx=class{constructor(t){o(this,t),this.apiError=W(this,"rtkApiError",7),this.statsIntervalTimer=null,this.t=Fe(),this.iconPack=Ne,this.isSupported=!0,this.playerState=Xt.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=Xt.PLAYING):(this.videoRef.pause(),this.playerState=Xt.IDLE)},this.changeQuality=t=>{this.selectedQuality=t,this.hls&&(this.hls.currentLevel=t)},this.cleanupPlayer=()=>{var t;this.playerState=Xt.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!==Xt.PLAYING&&this.playerState!==Xt.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}`),Kx.isSupported()?(this.meeting.__internals__.logger.info("rtk-livestream-player:: Initialising HLS. HLS is Supported"),this.hls=new Kx({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(Kx.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(Kx.Events.MEDIA_ATTACHED,()=>{this.meeting.__internals__.logger.info("rtk-livestream-player:: media attached")}),this.hls.on(Kx.Events.MEDIA_DETACHED,()=>{this.meeting.__internals__.logger.info("rtk-livestream-player:: media detached")}),this.hls.on(Kx.Events.DESTROYING,()=>{this.meeting.__internals__.logger.info("rtk-livestream-player:: hls is getting destroyed")}),this.hls.on(Kx.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=Xt.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:s,loadingMessage:a,showIcon:n}=this.getLoadingState();return z(G,null,z("div",{class:"player-container h-full max-h-full min-h-full w-full min-w-full max-w-full"},z("div",{ref:async t=>{this.videoContainerRef=t},class:"video-container relative flex h-full w-full flex-col items-center justify-center pb-20"},z("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===Xt.PAUSED&&(this.playerState=Xt.PLAYING)},onPause:()=>this.playerState=Xt.PAUSED}),this.playerState!==Xt.IDLE&&!this.hideControls&&z("div",{class:"control-bar",style:{width:`${null===(e=this.videoRef)||void 0===e?void 0:e.clientWidth}px`}},z("div",{class:"control-groups"},z("rtk-icon",{id:"playPause",onClick:this.togglePlay,size:"lg",class:"control-btn",icon:this.playerState===Xt.PLAYING?this.iconPack.pause:this.iconPack.play}),z("rtk-icon",{size:"lg",class:"control-btn",icon:this.iconPack.fastForward,onClick:this.fastForwardToLatest}),z("span",{class:"timings"},Yx(this.currentTime)," /"," ",Yx(this.duration))),z("div",{class:"control-groups"},z("select",{class:"level-select",onChange:t=>this.changeQuality(parseInt(t.target.value))},this.qualityLevels.map(t=>z("option",{value:t.level,selected:this.selectedQuality===t.level},t.resolution))),z("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&&z("div",{class:"unmute-popup"},z("h3",null,this.t("audio_playback.title")),z("p",null,this.t("audio_playback.description")),z("rtk-button",{kind:"wide",onClick:()=>{this.audioPlaybackError=!1,this.videoRef&&(this.videoRef.muted=!1,this.videoRef.play(),this.playerState=Xt.PLAYING)},title:this.t("audio_playback")},this.t("audio_playback"))),i&&z("div",{class:"loader"},z("rtk-icon",{icon:this.iconPack.warning}),z("p",null,r)),!i&&s&&z("div",{class:"loader"},n&&z("rtk-spinner",{id:"icon",part:"spinner",iconPack:this.iconPack,size:"md"}),z("p",null,a))))}get el(){return Y(this)}static get watchers(){return{livestreamState:["updateLivestreamId"],meeting:["meetingChanged"]}}};Wx([si()],Zx.prototype,"meeting",void 0),Wx([si()],Zx.prototype,"size",void 0),Wx([si()],Zx.prototype,"t",void 0),Wx([si()],Zx.prototype,"iconPack",void 0),Zx.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 Qx=function(t,e,i,r){var s,a=arguments.length,n=a<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--)(s=t[o])&&(n=(a<3?s(n):a>3?s(e,i,n):s(e,i))||n);return a>3&&n&&Object.defineProperty(e,i,n),n};const Xx=class{constructor(t){o(this,t),this.variant="primary",this.iconPack=Ne,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)?z(G,{tabIndex:0,role:"log","aria-label":`${this.viewerCount} ${this.t("viewers")}`},z("rtk-icon",{icon:this.iconPack.viewers,tabIndex:-1,"aria-hidden":!0,part:"icon"}),this.viewerCount," ",this.t("viewers")):z(G,{"data-hidden":!0})}static get watchers(){return{meeting:["meetingChanged"]}}};Qx([si()],Xx.prototype,"meeting",void 0),Qx([si()],Xx.prototype,"iconPack",void 0),Qx([si()],Xx.prototype,"t",void 0),Xx.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 Jx=Object.freeze({__proto__:null,rtk_livestream_indicator:fg,rtk_livestream_player:Zx,rtk_viewer_count:Xx});var tS=function(t,e,i,r){var s,a=arguments.length,n=a<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--)(s=t[o])&&(n=(a<3?s(n):a>3?s(e,i,n):s(e,i))||n);return a>3&&n&&Object.defineProperty(e,i,n),n};const eS=class{constructor(t){o(this,t),this.isScreenShare=!1,this.variant="default",this.iconPack=Ne,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)||""),s=(null===(e=this.participant)||void 0===e?void 0:e.id)===(null===(i=this.meeting)||void 0===i?void 0:i.self.id);return z(G,{key:"52aa7e44f5a12d953eb5637346fff58cd40ed0bb",title:r},z("slot",{key:"24d7325456abe1ec7051c44eaf6067446e459f2d",name:"start"}),z("span",{key:"c2e7c6d2ca6ab1f5e097ccccad09b52fcc9c846a",class:"name"},this.formatNameTag(r,s)),z("slot",{key:"586b6e09b16c88cc219f45843ac8dfd746c0482a",name:"end"}))}static get watchers(){return{size:["sizeChanged"]}}};tS([si()],eS.prototype,"meeting",void 0),tS([si()],eS.prototype,"size",void 0),tS([si()],eS.prototype,"iconPack",void 0),tS([si()],eS.prototype,"t",void 0),eS.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 iS=Object.freeze({__proto__:null,rtk_name_tag:eS});var rS=function(t,e,i,r){var s,a=arguments.length,n=a<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--)(s=t[o])&&(n=(a<3?s(n):a>3?s(e,i,n):s(e,i))||n);return a>3&&n&&Object.defineProperty(e,i,n),n};const sS=class{constructor(t){o(this,t),this.config=Ie,this.hideHeader=!1,this.iconPack=Ne,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 z("div",null,z(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 z(G,{key:"54501f9cebd4dee4398cb0161341c72008a1bf22"},z("div",{key:"9157670e4ed76beb38ad5c6e3405a1707ff8d262",class:"participants-container"},!this.hideHeader&&z("div",{key:"71d44cb3842d749a19526068700f788727ff5c28",class:"heading-count",part:"heading-count"},this.t("participants")," (",this.participants.length,")"),z("rtk-virtualized-participant-list",{key:"8239db7509da6cc5334b8d860e9954527febacf2",items:this.participants,renderItem:this.createParticipantNode,part:"participants",class:"participants",emptyListElement:z("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"]}}};rS([si()],sS.prototype,"meeting",void 0),rS([si()],sS.prototype,"states",void 0),rS([si()],sS.prototype,"size",void 0),rS([si()],sS.prototype,"iconPack",void 0),rS([si()],sS.prototype,"t",void 0),sS.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 aS=function(t,e,i,r){var s,a=arguments.length,n=a<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--)(s=t[o])&&(n=(a<3?s(n):a>3?s(e,i,n):s(e,i))||n);return a>3&&n&&Object.defineProperty(e,i,n),n};const nS=class{constructor(t){o(this,t),this.config=Ie,this.iconPack=Ne,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,s,a,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===(a=await(null===(s=this.meeting.stage)||void 0===s?void 0:s.getAccessRequests()))||void 0===a?void 0:a.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 z("div",{class:"stage-requested-participants"},z("div",{class:"heading-count",part:"staged-heading-count"},this.t("stage_request.header_title")," (",this.stageRequestedParticipants.length,")"),z("ul",{class:"participants",part:"staged-participants"},this.stageRequestedParticipants.map(t=>z("li",{class:"waiting-participant",key:t.id},z("div",{class:"participant-details"},z("rtk-avatar",{participant:t,size:"sm",iconPack:this.iconPack,t:this.t}),z("p",{class:"name",title:t.name},t.name)),z("div",{class:"waitlist-controls"},z("rtk-tooltip",{label:this.t("stage_request.deny_request"),variant:"secondary"},z("rtk-button",{variant:"secondary",kind:"icon",onClick:()=>this.rejectStageRequest(t)},z("rtk-icon",{class:"deny",icon:this.iconPack.dismiss}))),z("rtk-tooltip",{label:this.t("stage_request.accept_request"),variant:"secondary"},z("rtk-button",{variant:"secondary",kind:"icon",onClick:()=>this.acceptStageRequest(t)},z("rtk-icon",{class:"accept",icon:this.iconPack.checkmark}))))))),z("div",{class:"bulk-actions"},z("rtk-button",{class:"accept-all-button",variant:"secondary",onClick:this.acceptAllStageRequest},this.t("stage_request.accept_all")),z("rtk-button",{class:"deny-all-button",variant:"danger",onClick:this.denyAllStageRequest},this.t("stage_request.deny_all"))))}static get watchers(){return{meeting:["meetingChanged"]}}};aS([si()],nS.prototype,"meeting",void 0),aS([si()],nS.prototype,"size",void 0),aS([si()],nS.prototype,"iconPack",void 0),aS([si()],nS.prototype,"t",void 0),nS.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 oS=function(t,e,i,r){var s,a=arguments.length,n=a<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--)(s=t[o])&&(n=(a<3?s(n):a>3?s(e,i,n):s(e,i))||n);return a>3&&n&&Object.defineProperty(e,i,n),n};const lS=class{constructor(t){o(this,t),this.updateStageViewers=()=>{this.getViewers(this.search)},this.config=Ie,this.hideHeader=!1,this.iconPack=Ne,this.view="sidebar",this.search="",this.t=Fe(),this.stageViewers=[],this.createParticipantNode=t=>z("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 z("div",{class:"list"},!this.hideHeader&&z("div",{class:"heading-count",part:"heading-count"},this.t("viewers")," (",this.stageViewers.length,")"),z("rtk-virtualized-participant-list",{items:this.stageViewers,renderItem:this.createParticipantNode,class:"participants",part:"participants",style:{height:"100%"},emptyListElement:z("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"]}}};oS([si()],lS.prototype,"meeting",void 0),oS([si()],lS.prototype,"size",void 0),oS([si()],lS.prototype,"iconPack",void 0),oS([si()],lS.prototype,"t",void 0),lS.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 cS=function(t,e,i,r){var s,a=arguments.length,n=a<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--)(s=t[o])&&(n=(a<3?s(n):a>3?s(e,i,n):s(e,i))||n);return a>3&&n&&Object.defineProperty(e,i,n),n};const dS=class{constructor(t){o(this,t),this.config=Ie,this.iconPack=Ne,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 z("div",{class:"waiting-participants"},z("div",{class:"heading-count",part:"waitlisted-heading-count"},this.t("waitlist.header_title")," (",this.waitlistedParticipants.length,")"),z("ul",{class:"participants",part:"waitlisted-participants"},this.waitlistedParticipants.map(t=>z("li",{class:"waiting-participant",key:t.id},z("div",{class:"participant-details"},z("rtk-avatar",{participant:t,size:"sm",iconPack:this.iconPack,t:this.t}),z("p",{class:"name",title:t.name},t.name)),z("div",{class:"waitlist-controls"},z("rtk-tooltip",{label:this.t("waitlist.deny_request"),variant:"secondary"},z("rtk-button",{variant:"secondary",kind:"icon",onClick:()=>this.rejectWaitingRoomRequest(t.id)},z("rtk-icon",{class:"deny",icon:this.iconPack.dismiss}))),z("rtk-tooltip",{label:this.t("waitlist.accept_request"),variant:"secondary"},z("rtk-button",{variant:"secondary",kind:"icon",onClick:()=>this.acceptWaitingRoomRequest(t.id)},z("rtk-icon",{class:"accept",icon:this.iconPack.checkmark}))))))),z("rtk-button",{class:"accept-all-button",variant:"secondary",kind:"wide",onClick:this.acceptAllWaitingRoomRequests},this.t("waitlist.accept_all")))}static get watchers(){return{meeting:["meetingChanged"]}}};cS([si()],dS.prototype,"meeting",void 0),cS([si()],dS.prototype,"size",void 0),cS([si()],dS.prototype,"iconPack",void 0),cS([si()],dS.prototype,"t",void 0),dS.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 hS=Object.freeze({__proto__:null,rtk_participants_stage_list:sS,rtk_participants_stage_queue:nS,rtk_participants_viewer_list:lS,rtk_participants_waiting_list:dS});var pS=function(t,e,i,r){var s,a=arguments.length,n=a<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--)(s=t[o])&&(n=(a<3?s(n):a>3?s(e,i,n):s(e,i))||n);return a>3&&n&&Object.defineProperty(e,i,n),n};const uS=class{constructor(t){o(this,t),this.iconPack=Ne,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,P(()=>{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:z(G,null,z("header",{part:"header"},z("div",null,this.plugin.name),this.canClosePlugin&&z("div",null,z("rtk-button",{kind:"icon",onClick:()=>this.plugin.deactivate(),part:"button"},z("rtk-icon",{icon:this.iconPack.dismiss})))),z("div",{class:"iframe-container"},!this.canInteractWithPlugin()&&this.viewModeEnabled?z("div",{class:"block-inputs"}):null,z("iframe",{ref:t=>this.onIframeRef(t),part:"iframe"})))}static get watchers(){return{meeting:["meetingChanged"],plugin:["pluginChanged"]}}};pS([si()],uS.prototype,"meeting",void 0),pS([si()],uS.prototype,"iconPack",void 0),pS([si()],uS.prototype,"t",void 0),uS.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 gS=function(t,e,i,r){var s,a=arguments.length,n=a<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--)(s=t[o])&&(n=(a<3?s(n):a>3?s(e,i,n):s(e,i))||n);return a>3&&n&&Object.defineProperty(e,i,n),n};const fS=class{constructor(t){o(this,t),this.tabChange=W(this,"tabChange",7),this.config=Ie,this.layout="row",this.iconPack=Ne,this.t=Fe(),this.tabs=[]}render(){return z(G,{key:"d80fd5c45bdae491e9bfe398f7ba9d7ede356e02"},z("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,s,a;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===(s=this.activeTab)||void 0===s?void 0:s.participant.id)===t.participant.id)&&(n=!0),"screenshare"===t.type){const e=t.participant,i=ti(e.name);return z("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)},z("div",{class:"center col"},z("rtk-icon",{icon:this.iconPack.share_screen_person}),z("span",{class:"name"},e.id===(null===(a=this.meeting)||void 0===a?void 0:a.self.id)?this.t("you"):Qe(i,6))))}if("plugin"===t.type){const e=t.plugin;return z("rtk-button",{title:e.name,key:e.id,kind:"icon",variant:n?"primary":"secondary",class:{tab:!0,active:n},onClick:()=>this.tabChange.emit(t)},z("div",{class:"center col"},z("img",{src:e.picture}),z("span",{class:"name"},Qe(e.name,6))))}}))}};gS([si()],fS.prototype,"size",void 0),gS([si()],fS.prototype,"meeting",void 0),gS([si()],fS.prototype,"states",void 0),gS([si()],fS.prototype,"iconPack",void 0),gS([si()],fS.prototype,"t",void 0),fS.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 mS=Object.freeze({__proto__:null,rtk_plugin_main:uS,rtk_tab_bar:fS});var vS=function(t,e,i,r){var s,a=arguments.length,n=a<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--)(s=t[o])&&(n=(a<3?s(n):a>3?s(e,i,n):s(e,i))||n);return a>3&&n&&Object.defineProperty(e,i,n),n};const bS=class{constructor(t){o(this,t),this.stateUpdate=W(this,"rtkStateUpdate",7),this.config=Ie,this.iconPack=Ne,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 z(G,{key:"74f2d9af55a0670b4ae5406f73b333187e8c3d92"},z("ul",{key:"955e4e2a9d101b5027ef725175996c8e72a94b30",class:"scrollbar"},this.plugins.map(t=>z("li",{key:t.name,class:"plugin"},z("div",{class:"metadata"},z("img",{src:t.picture}),z("div",{class:"name"},t.name)),!this.activatedPluginsId.includes(t.id)&&this.canStartPlugins&&z("div",{class:"buttons"},z("rtk-button",{kind:"icon",size:"lg",onClick:()=>{t.activate(),this.close()},"aria-label":`${this.t("activate")} ${t.name}`},z("rtk-icon",{icon:this.iconPack.rocket,tabIndex:-1,"aria-hidden":!0}))),this.activatedPluginsId.includes(t.id)&&this.canClosePlugins&&z("div",{class:"buttons"},z("rtk-button",{kind:"icon",size:"lg",onClick:()=>{t.deactivate()},"aria-label":`${this.t("close")} ${t.name}`},z("rtk-icon",{icon:this.iconPack.dismiss,tabIndex:-1,"aria-hidden":!0})))))))}static get watchers(){return{meeting:["meetingChanged"]}}};vS([si()],bS.prototype,"meeting",void 0),vS([si()],bS.prototype,"size",void 0),vS([si()],bS.prototype,"iconPack",void 0),vS([si()],bS.prototype,"t",void 0),bS.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 kS=function(t,e,i,r){var s,a=arguments.length,n=a<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--)(s=t[o])&&(n=(a<3?s(n):a>3?s(e,i,n):s(e,i))||n);return a>3&&n&&Object.defineProperty(e,i,n),n};const yS=class{constructor(t){o(this,t),this.config=Ie,this.iconPack=Ne,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(){Ji(this.pollEl)}render(){return z(G,{key:"aac0c84486146fa17436746fb6def9cc4e539a2c"},z("div",{key:"179c4496372623a2ea2f7c0b555b84ea1cae12ee",class:"ctr",part:"container"},z("div",{key:"07b09fc28d75b1d40dec83eecae3661dfca1dbd2",class:"polls-view scrollbar",ref:t=>this.pollEl=t,part:"polls"},0==this.polls.length&&!0!==this.create&&z("div",{key:"841f91b0da755e48498c520a8234cf6b926b058c",class:"empty-polls"},this.t("polls.empty")),this.polls.map(t=>{var e;return z("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&&z("rtk-poll-form",{key:"c6545dffc24f5409417666404ab73bf546834a8b",part:"poll-form",onRtkCreatePoll:t=>{this.onCreate(t.detail)},iconPack:this.iconPack,t:this.t})),this.permissions.polls.canCreate&&z("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"]}}};kS([si()],yS.prototype,"meeting",void 0),kS([si()],yS.prototype,"size",void 0),kS([si()],yS.prototype,"iconPack",void 0),kS([si()],yS.prototype,"t",void 0),yS.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 wS=Object.freeze({__proto__:null,rtk_plugins:bS,rtk_polls:yS});var xS=function(t,e,i,r){var s,a=arguments.length,n=a<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--)(s=t[o])&&(n=(a<3?s(n):a>3?s(e,i,n):s(e,i))||n);return a>3&&n&&Object.defineProperty(e,i,n),n};const SS=class{constructor(t){o(this,t),this.stateUpdate=W(this,"rtkStateUpdate",7),this.iconPack=Ne,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,s=!0===(null===(t=null==r?void 0:r.prefs)||void 0===t?void 0:t.muteNotificationSounds)||"true"===Ve("mute-notification-sounds");return z(G,null,z("rtk-microphone-selector",Object.assign({},i),z("rtk-audio-visualizer",{participant:null===(e=this.meeting)||void 0===e?void 0:e.self,iconPack:this.iconPack,t:this.t,slot:"indicator"})),z("rtk-speaker-selector",Object.assign({},i)),z("div",{class:"group",part:"notification-toggle"},z("div",{class:"row"},z("label",{htmlFor:"notification-toggle"},this.t("settings.notification_sound")),z("rtk-switch",{id:"notification-toggle",checked:!s,onRtkChange:t=>{const{checked:e}=t.target,i=!e;this.stateUpdate.emit({prefs:{muteNotificationSounds:i}}),He("mute-notification-sounds",i)},iconPack:this.iconPack,t:this.t}))))}};xS([si()],SS.prototype,"meeting",void 0),xS([si()],SS.prototype,"states",void 0),xS([si()],SS.prototype,"size",void 0),xS([si()],SS.prototype,"iconPack",void 0),xS([si()],SS.prototype,"t",void 0),SS.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 ES=function(t,e,i,r){var s,a=arguments.length,n=a<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--)(s=t[o])&&(n=(a<3?s(n):a>3?s(e,i,n):s(e,i))||n);return a>3&&n&&Object.defineProperty(e,i,n),n};const PS=class{constructor(t){o(this,t),this.stateUpdate=W(this,"rtkStateUpdate",7),this.iconPack=Ne,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},s=this.states,a=!0===(null===(t=null==s?void 0:s.prefs)||void 0===t?void 0:t.mirrorVideo)||"true"===Ve("mirror-video");return z(G,null,z("div",{class:"section",part:"tile-preview"},z("div",{class:"group",part:"tile-preview"},!0===this.videoEnabled?z("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:s,size:this.size,isPreview:!0}):z("div",{class:"camera-off-helper"},z("rtk-participant-tile",{meeting:this.meeting,participant:null===(i=this.meeting)||void 0===i?void 0:i.self,size:this.size},z("div",null,z("rtk-icon",{id:"icon",icon:this.iconPack.video_off,tabIndex:-1,"aria-hidden":!0}),z("div",null,this.t("settings.camera_off"))))))),z("rtk-camera-selector",Object.assign({},r)),z("div",{class:"group",part:"mirror-toggle"},z("div",{class:"row"},z("label",{htmlFor:"mirror-toggle"},this.t("settings.mirror_video")),z("rtk-switch",{checked:a,iconPack:this.iconPack,t:this.t,onRtkChange:t=>{const{checked:e}=t.target;this.stateUpdate.emit({prefs:{mirrorVideo:e}}),He("mirror-video",e)}}))))}static get watchers(){return{meeting:["meetingChanged"]}}};ES([si()],PS.prototype,"meeting",void 0),ES([si()],PS.prototype,"states",void 0),ES([si()],PS.prototype,"size",void 0),ES([si()],PS.prototype,"iconPack",void 0),ES([si()],PS.prototype,"t",void 0),PS.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 TS=Object.freeze({__proto__:null,rtk_settings_audio:SS,rtk_settings_video:PS});const LS=class{constructor(t){o(this,t),this.dismiss=W(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 z(G,{key:"d3efdcb1d165c36ffcb706dea742420f8c6c003d"},z("div",{key:"3b00a1827697ff4d13b62edfa46889b71226f004",class:"ctr"},z("p",{key:"908819abb385a61cf06de6f43f57274e5f494b93",class:"message"},z("span",{key:"7f951cddb567daed904a6ecbabb766794e659438",class:"name"},this.transcript.name),": ",this.transcript.transcript)))}static get watchers(){return{transcript:["transcriptChanged"]}}};!function(t,e,i,r){var s,a=arguments.length,n=a<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--)(s=t[o])&&(n=(a<3?s(n):a>3?s(e,i,n):s(e,i))||n);a>3&&n&&Object.defineProperty(e,i,n)}([si()],LS.prototype,"t",void 0),LS.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 CS=Object.freeze({__proto__:null,rtk_transcript:LS});const _S=(t,e)=>{if(null==t)return;const i=Math.round(1.5),r=[...Array(3)].map((t,r)=>{let s=r;return s>i-1&&(s=3-s-1),Math.round((s+1)/(i+1)*e)}),{width:s,height:a}=t,n=t.getContext("2d");let o=2;const l=1*s/r.length,c=l-4;n.clearRect(0,0,s,a),n.fillStyle="rgb(0,0,0,0.0)",n.fillRect(0,0,s,a);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*a)+a/2,a/2-2.5),i=Math.max(2*(a/2-e),5);n.moveTo(o+c/2,e),n.lineTo(o+c/2,e+i),o+=l}n.stroke()};var AS=function(t,e,i,r){var s,a=arguments.length,n=a<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--)(s=t[o])&&(n=(a<3?s(n):a>3?s(e,i,n):s(e,i))||n);return a>3&&n&&Object.defineProperty(e,i,n),n};const RS=class{constructor(t){o(this,t),this.variant="bars",this.iconPack=Ne,this.t=Fe(),this.hideMuted=!1,this.isScreenShare=!1,this.volume=0}connectedCallback(){this.participantChanged(this.participant)}componentDidLoad(){_S(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),_S(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=$c(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,_S(this.visualizer,this.volume))})}render(){return z(G,{key:"349422ab6a49e3c2dd84f0f41b51828dfd571d20"},z("div",{key:"7564acaefc95a3610db3020a8e0de44f9d8bff48",class:{hideMuted:this.hideMuted}},z("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&&z("rtk-icon",{key:"868d229037f6029ec95ab38b1345783a95fe5c6d",icon:this.iconPack.mic_off,part:"mic-off-icon"})))}static get watchers(){return{participant:["participantChanged"]}}};AS([si()],RS.prototype,"size",void 0),AS([si()],RS.prototype,"iconPack",void 0),AS([si()],RS.prototype,"t",void 0),RS.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 IS=function(t,e,i,r){var s,a=arguments.length,n=a<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--)(s=t[o])&&(n=(a<3?s(n):a>3?s(e,i,n):s(e,i))||n);return a>3&&n&&Object.defineProperty(e,i,n),n};const DS=class{constructor(t){o(this,t),this.iconPack=Ne,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,s;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===(s=this.meeting)||void 0===s||s.self.removeListener("mediaPermissionUpdate",this.mediaPermissionUpdateListener)}meetingChanged(t){null!=t&&P(async()=>{var e,i;const{self:r,stage:s}=t,a=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==s||s.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=a.find(t=>t.deviceId===n.deviceId))&&void 0!==i?i:n,...a.filter(t=>t.deviceId!==n.deviceId)]:a})}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 z(G,null,this.canProduceAudio&&z("div",{part:"microphone-selection",class:"group container "+this.variant},z("label",{slot:"label"},"inline"!==this.variant&&this.t("settings.microphone_input"),z("rtk-icon",{icon:this.iconPack.mic_on,size:"sm"})),z("div",{class:"row"},z("select",{class:"rtk-select",onChange:t=>this.setDevice(t.target.value)},this.audioinputDevices.map(({deviceId:e,label:i})=>{var r;return z("option",{value:e,selected:(null===(r=this.currentDevices.audio)||void 0===r?void 0:r.deviceId)===e},i||"Microphone "+ ++t)})),z("slot",{name:"indicator"}))))}static get watchers(){return{meeting:["meetingChanged"]}}};IS([si()],DS.prototype,"meeting",void 0),IS([si()],DS.prototype,"size",void 0),IS([si()],DS.prototype,"iconPack",void 0),IS([si()],DS.prototype,"t",void 0),DS.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 MS=function(t,e,i,r){var s,a=arguments.length,n=a<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--)(s=t[o])&&(n=(a<3?s(n):a>3?s(e,i,n):s(e,i))||n);return a>3&&n&&Object.defineProperty(e,i,n),n};const OS=class{constructor(t){o(this,t),this.variant="full",this.iconPack=Ne,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&&P(async()=>{var e,i;const{self:r}=t,s=await t.self.getSpeakerDevices(),a=null===(e=t.self.getCurrentDevices())||void 0===e?void 0:e.speaker;this.currentDevices={speaker:a},r.addListener("deviceListUpdate",this.deviceListUpdateListener),r.addListener("deviceUpdate",this.deviceUpdateListener),r.addListener("mediaPermissionUpdate",this.mediaPermissionUpdate),this.speakerDevices=null!=a?[null!==(i=s.find(t=>t.deviceId===a.deviceId))&&void 0!==i?i:a,...s.filter(t=>t.deviceId!==a.deviceId)]:s})}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 z(G,null,z("audio",{preload:"auto",src:"https://assets.dyte.io/ui-kit/speaker-test.mp3",ref:t=>this.testAudioEl=t}),z("div",{class:"group "+this.variant,part:"speaker-selection"},this.speakerDevices.length>0&&!oe(this.meeting)&&z("div",{class:"container"},z("label",null,"inline"!==this.variant&&this.t("settings.speaker_output"),z("rtk-icon",{icon:this.iconPack.speaker,size:"sm"})),z("div",{class:"row"},z("select",{class:"rtk-select",onChange:t=>this.setDevice(t.target.value)},this.speakerDevices.map(({deviceId:e,label:i})=>{var r;return z("option",{value:e,selected:(null===(r=this.currentDevices.speaker)||void 0===r?void 0:r.deviceId)===e},i||"Speaker "+ ++t)})))),"full"===this.variant&&z("rtk-button",{variant:"secondary",onClick:()=>this.testAudio()},z("rtk-icon",{icon:this.iconPack.speaker,slot:"start"}),this.t("test"))))}static get watchers(){return{meeting:["meetingChanged"]}}};MS([si()],OS.prototype,"meeting",void 0),MS([si()],OS.prototype,"states",void 0),MS([si()],OS.prototype,"size",void 0),MS([si()],OS.prototype,"iconPack",void 0),MS([si()],OS.prototype,"t",void 0),OS.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 US=function(t,e,i,r){var s,a=arguments.length,n=a<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--)(s=t[o])&&(n=(a<3?s(n):a>3?s(e,i,n):s(e,i))||n);return a>3&&n&&Object.defineProperty(e,i,n),n};const $S=class{constructor(t){o(this,t),this.onChange=W(this,"rtkChange",4),this.checked=!1,this.readonly=!1,this.disabled=!1,this.iconPack=Ne,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 z(G,{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},z("div",{key:"32d41bcd264ad0b9484eb994c8880935d499ebcf",class:"switch",part:"switch"}))}static get watchers(){return{checked:["checkedChange"]}}};US([si()],$S.prototype,"iconPack",void 0),US([si()],$S.prototype,"t",void 0),$S.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 FS=Object.freeze({__proto__:null,rtk_audio_visualizer:RS,rtk_microphone_selector:DS,rtk_speaker_selector:OS,rtk_switch:$S});var NS=function(t,e,i,r){var s,a=arguments.length,n=a<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--)(s=t[o])&&(n=(a<3?s(n):a>3?s(e,i,n):s(e,i))||n);return a>3&&n&&Object.defineProperty(e,i,n),n};const jS=class{constructor(t){o(this,t),this.stateUpdate=W(this,"rtkStateUpdate",7),this.variant="button",this.iconPack=Ne,this.t=Fe(),this.fullScreenActive=!1,this.isFullScreenSupported=!0,this.onFullScreenchange=()=>{this.fullScreenActive=Gp()},this.toggleFullScreen=()=>{let t=this.targetElement||document.querySelector("rtk-meeting");t&&(this.fullScreenActive?(Bp(),this.fullScreenActive=!1):(zp(t),this.fullScreenActive=!0),this.stateUpdate.emit({activeMoreMenu:!1}))}}connectedCallback(){this.isFullScreenSupported=Hp(),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?z(G,{title:this.t("full_screen")},z("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})):z(G,{"data-hidden":!0})}};NS([si()],jS.prototype,"states",void 0),NS([si()],jS.prototype,"size",void 0),NS([si()],jS.prototype,"iconPack",void 0),NS([si()],jS.prototype,"t",void 0),jS.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 zS=Object.freeze({__proto__:null,rtk_fullscreen_toggle:jS});var BS=function(t,e,i,r){var s,a=arguments.length,n=a<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--)(s=t[o])&&(n=(a<3?s(n):a>3?s(e,i,n):s(e,i))||n);return a>3&&n&&Object.defineProperty(e,i,n),n};const GS=class{constructor(t){o(this,t),this.rtkSendNotification=W(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=Ne,this.t=Fe(),this.config=Ie,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");ho(t,e,{placement:"bottom-end",middleware:[ao({allowedPlacements:["bottom-end","top-end"],alignment:"end"}),so(4),no({padding:8}),lo()]}).then(({x:t,y:i,placement:r})=>{let s=null;s="bottom-end"===r?{right:`${t}px`,top:`${i}px`}:{right:`${t}px`,bottom:`${i}px`},Object.assign(e.style,s)})},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,s,a,n,o;if(null!=t){const{self:l}=t;this.canDisableParticipantAudio=l.permissions.canAllowParticipantAudio||l.permissions.canDisableParticipantAudio,this.canDisableParticipantVideo=l.permissions.canAllowParticipantVideo||l.permissions.canDisableParticipantVideo,this.canKickParticipant=l.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=l.permissions.pinParticipant,this.canAllowParticipantOnStage=l.permissions.acceptStageRequests&&l.permissions.stageEnabled&&(!0!==(null===(s=this.meeting)||void 0===s?void 0:s.__internals__.features.hasFeature(re))||"webinar_admin"!==(null===(a=this.participant)||void 0===a?void 0:a.presetName))&&(!0!==(null===(n=this.meeting)||void 0===n?void 0:n.__internals__.features.hasFeature(se))||"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,s,a,n,o,l;const c="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&&!c||this.canKickParticipant||this.canPinParticipant&&this.isOnStage||this.canAllowParticipantOnStage,p=ti((null===(i=this.participant)||void 0===i?void 0:i.name)||""),u=this.isOnStage||["GROUP_CALL","AUDIO_ROOM"].includes(null===(r=this.meeting)||void 0===r?void 0:r.meta.viewType),g={meeting:this.meeting,size:"sm",states:this.states,config:this.config,iconPack:this.iconPack,t:this.t};return z(G,{key:"9a717049edf15cfec3e497a30a37f873dcb37fd8"},z("div",{class:"left",key:null===(s=this.participant)||void 0===s?void 0:s.id},z("rtk-avatar",{key:"4e161f74ce11be1050c95556065867289ab618b2",participant:this.participant,size:"sm",iconPack:this.iconPack,t:this.t}),z("p",{key:"c1e71db1ba1ed2e8defbbb9802c22df8b64670fc",class:"name",title:p},Qe(p,16)," ",(null===(a=this.meeting)||void 0===a?void 0:a.self.id)===(null===(n=this.participant)||void 0===n?void 0:n.id)&&this.t("(you)"))),"sidebar"===this.view&&z("div",{key:"165e14ba9f5e063820c6f440dc9eb03344e7bcdf",class:"right"},u&&z("rtk-icon",{key:"d6651dc9e7eb12ed56742f08096ef239bd4429c1",class:{red:!this.audioEnabled},icon:this.audioEnabled?this.iconPack.mic_on:this.iconPack.mic_off}),u&&!c&&z("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 s;const{config:a,size:n,states:o}=e;let l,c={},d=[];Array.isArray(t)?[l,c,...d]=t:l=t;const h=null===(s=null==a?void 0:a.root)||void 0===s?void 0:s[l];null!=h&&"props"in h&&(i=Object.assign(Object.assign({},h.props),i)),i=Object.assign(Object.assign({},i),c),l in r&&(i=Object.assign(Object.assign({},i),r[l]));const p=tr({element:l,size:n,states:o,config:a});return er({selectors:p,root:a.root}).length})({element:"rtk-participant",defaults:g,childProps:{participant:this.participant}})>0)&&z("div",{key:"202a957dfe004c8c1f2195bf93c9ce9ce167a96f",class:"menu"},z("span",{key:"a01163f9da5fab4a1d7922f8abfe5a2e4a4dcf2c",id:"trigger",onClick:this.onMenuToggle},z("rtk-button",{key:"144e0c418b6a038d560f8087825471b649229ecb",variant:"ghost",kind:"icon",slot:"trigger"},z("rtk-icon",{key:"18abb20a0969e0332d8fe2b5dcfe41bfc66955f7",class:"more",icon:this.iconPack.more_vertical}))),z("span",{key:"3a22ebe5a21228b6ea6e15933d961b24085dce44",id:"menu-list"},this.menuOpen&&z("rtk-menu-list",{key:"86688ad10d1440c5b534fe2f002225e0368ae24a",iconPack:this.iconPack,t:this.t},this.canPinParticipant&&u&&!c&&z("rtk-menu-item",{key:"c22833b86d8583bdaec723a269afa7298cb0ca0d",onClick:()=>{this.isPinned?this.participant.unpin():this.participant.pin()},iconPack:this.iconPack,t:this.t},z("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&&z("rtk-menu-item",{key:"b651953a9b02065ca223c46dd7dbadedc8401031",iconPack:this.iconPack,t:this.t,onClick:()=>{this.isHidden?this.participant.show():this.participant.hide()}},z("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&&u&&this.audioEnabled&&z("rtk-menu-item",{key:"86f670083fa1000cc99c5a57d4da2cb789c88aee",iconPack:this.iconPack,t:this.t,onClick:()=>{this.participant.disableAudio()}},z("rtk-icon",{key:"d75504ef4431c83efea2d281baad6a10c8a2e3b3",icon:this.iconPack.mic_off,slot:"start"}),this.t("mute")),this.canDisableParticipantVideo&&u&&this.videoEnabled&&z("rtk-menu-item",{key:"2634fae26bc72fec773f3a7f85fad7ebc1cfca11",iconPack:this.iconPack,t:this.t,onClick:()=>{this.participant.disableVideo()}},z("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===(l=this.meeting)||void 0===l?void 0:l.self.id)&&z("rtk-menu-item",{key:"64ab2f51f494b8d3d445ae9aece430e8c0fca673",iconPack:this.iconPack,t:this.t,class:this.isOnStage?"red":"",onClick:this.inviteToStageToggle},z("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&&z("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)}},z("rtk-icon",{key:"10cb3a42b4c861241d983d9cb1ebfe594500fbc3",icon:this.iconPack.dismiss,slot:"start"}),this.t("kick")),z("slot",{key:"ed681666f5bb8bf06a6fac4b929853d9b6bc704c"},z(rr,{key:"8177a2248bf03ffbe26a7f0f560eb81439a00fb3",element:"rtk-participant",defaults:g,childProps:{participant:this.participant},deepProps:!0,onlyChildren:!0})))))))}get host(){return Y(this)}static get watchers(){return{meeting:["meetingChanged"],participant:["participantChanged"]}}};BS([si()],GS.prototype,"meeting",void 0),BS([si()],GS.prototype,"states",void 0),BS([si()],GS.prototype,"iconPack",void 0),BS([si()],GS.prototype,"t",void 0),GS.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 HS=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 z("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 z("div",{key:"02cd1150b5e7b65f25178c0ce673ee823feec9d8",class:"virtual-list-container",style:{position:"relative",height:"100%",overflowX:"hidden",overflowY:"auto"}},z("div",{key:"0f886b79c861b3010d60df73a7b343955e97a8f2",style:{height:`${e}px`,position:"relative"}},(null===(t=this.items)||void 0===t?void 0:t.length)?this.renderItems():this.emptyListElement),z("div",{key:"d290097b0d363d9a580e71da1260e87456248dc4",style:{height:`${this.itemHeight}px`}}))}get el(){return Y(this)}static get watchers(){return{items:["itemsChanged"]}}};HS.style=":host{height:100%;width:100%}";var VS=Object.freeze({__proto__:null,rtk_participant:GS,rtk_virtualized_participant_list:HS});var qS=function(t,e,i,r){var s,a=arguments.length,n=a<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--)(s=t[o])&&(n=(a<3?s(n):a>3?s(e,i,n):s(e,i))||n);return a>3&&n&&Object.defineProperty(e,i,n),n};const KS=class{constructor(t){o(this,t),this.iconPack=Ne,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),P(async()=>{var e,i;const r=await t.self.getVideoDevices(),s=null===(e=t.self.getCurrentDevices())||void 0===e?void 0:e.video;this.videoDevices=null!=s?[null!==(i=r.find(t=>t.deviceId===s.deviceId))&&void 0!==i?i:s,...r.filter(t=>t.deviceId!==s.deviceId)]:r}))}connectedCallback(){this.meetingChanged(this.meeting)}disconnectedCallback(){var t,e,i,r,s;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===(s=this.meeting)||void 0===s||s.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 z(G,null,this.canProduceVideo&&z("div",{class:"group container "+this.variant,part:"camera-selection"},z("label",null,"inline"!==this.variant&&this.t("camera"),z("rtk-icon",{icon:this.iconPack.video_on,size:"sm"})),z("div",{class:"row"},z("select",{class:"rtk-select",onChange:t=>this.setDevice(t.target.value)},this.videoDevices.map(({deviceId:e,label:i})=>{var r;return z("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"]}}};qS([si()],KS.prototype,"meeting",void 0),qS([si()],KS.prototype,"size",void 0),qS([si()],KS.prototype,"iconPack",void 0),qS([si()],KS.prototype,"t",void 0),KS.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 YS=function(t,e,i,r){var s,a=arguments.length,n=a<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--)(s=t[o])&&(n=(a<3?s(n):a>3?s(e,i,n):s(e,i))||n);return a>3&&n&&Object.defineProperty(e,i,n),n};const WS=class{constructor(t){o(this,t),this.tileLoad=W(this,"tileLoad",7),this.tileUnload=W(this,"tileUnload",7),this.isPinned=!1,this.mediaConnectionError=!1,this.nameTagPosition="bottom-left",this.isPreview=!1,this.config=Ie,this.variant="solid",this.iconPack=Ne,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:s}=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==s?void 0:s.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 z(G,{key:"3e979a21a98a39b061612531ef9bd644d39a983e"},z("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&&z("rtk-icon",{key:"02ca6b139670e6ac3ac16a24248329a4dc09976d",class:"pinned-icon",icon:this.iconPack.pin,"aria-label":this.t("pinned"),part:"pinned-icon"}),this.mediaConnectionError&&z("div",{key:"5bf2f0b14e7d077b3ebd9bec74291bf746fcf6c9",class:"network-container",part:"network-indicator"},z("rtk-icon",{key:"32ee83f5d08430273ae0bce3424e2e1a3206419a",class:"network-icon",icon:this.iconPack.disconnected,"aria-label":this.t("pinned"),part:"pinned-icon"})),z("slot",{key:"781a75e98ff649fb94672cb7ce4f176ef0c1c090"},z(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"]}}};YS([si()],WS.prototype,"meeting",void 0),YS([si()],WS.prototype,"states",void 0),YS([si()],WS.prototype,"size",void 0),YS([si()],WS.prototype,"iconPack",void 0),YS([si()],WS.prototype,"t",void 0),WS.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 ZS=Object.freeze({__proto__:null,rtk_camera_selector:KS,rtk_participant_tile:WS});var QS=function(t,e,i,r){var s,a=arguments.length,n=a<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--)(s=t[o])&&(n=(a<3?s(n):a>3?s(e,i,n):s(e,i))||n);return a>3&&n&&Object.defineProperty(e,i,n),n};const XS=class{constructor(t){o(this,t),this.onVote=W(this,"rtkVotePoll",7),this.iconPack=Ne,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 z(G,{key:"3436a978185495090fcf81a59f40e3d0f9bac969"},z("div",{key:"1349450369add7268b290b2b75ca07aa28820683",class:"ctr"},z("p",{key:"f36ddcb1f30368e5b311fe7f11cca87785c9570c",class:"poll-title"},this.t("polls.by")," ",Qe(ti(this.poll.createdBy),20)),z("div",{key:"6c5ac869b1c182d09d9e1490a312797c913d24b1",class:"poll"},z("p",{key:"1c3ca8f47cf9a08f3ac7ef47e144330b922534fc",class:"poll-question"},this.poll.question),z("div",{key:"e5e60be4359714828d1d25bb24f5f143a1c6428f",class:"poll-answers"},z("span",{key:"60eeb63b59d1f3d8c44a1cbd53c42e82877f22d1"},this.t("polls.answers")),z("span",{key:"6c6a42a4e6b84ec18ad94bcd4015ed4047b7b0aa"},this.poll.voted.length)),this.poll.options.map((e,i)=>z("div",{class:{active:e.votes.some(t=>t.id===this.self),"open-vote":this.permissions.polls.canVote&&!t,"poll-option":!0}},z("div",{class:"poll-option-header","data-disabled":!this.permissions.polls.canVote},z("label",null,!t&&z("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)}),z("p",null,e.text)),z("span",{class:"counter"},e.count)),z("div",{class:"votes"},e.votes.slice(0,this.MAX_VOTES_RENDER).map(t=>{if(!this.poll.anonymous||this.self===this.poll.createdByUserId)return z("rtk-tooltip",{label:t.name},z("div",{class:"vote"},ri(t.name)))}),e.votes.length>this.MAX_VOTES_RENDER&&z("rtk-tooltip",{label:`+${e.votes.length-this.MAX_VOTES_RENDER} more `},z("div",{class:"vote"},"+",e.votes.length-this.MAX_VOTES_RENDER))))))))}};QS([si()],XS.prototype,"iconPack",void 0),QS([si()],XS.prototype,"t",void 0),XS.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 JS=function(t,e,i,r){var s,a=arguments.length,n=a<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--)(s=t[o])&&(n=(a<3?s(n):a>3?s(e,i,n):s(e,i))||n);return a>3&&n&&Object.defineProperty(e,i,n),n};const tE=class{constructor(t){o(this,t),this.onCreate=W(this,"rtkCreatePoll",7),this.iconPack=Ne,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 z(G,{key:"a5d66ad4586b3e3bf360fc7f3330cbebfcc27d29"},z("div",{key:"ab293118b0a4e4f0839da8b1f28e8bb4c3075e00",class:"create-poll"},z("p",{key:"dd851c73436db148c85fa4ae605841acc4047114"},this.t("polls.question")),z("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)=>z("div",{class:"option"},z("input",{placeholder:this.t("polls.option.placeholder"),value:t,onInput:t=>this.updateOption(t,e)}),e>1&&z("rtk-button",{kind:"icon",class:"auto remove-option",variant:"secondary",onClick:()=>this.removeOption(e)},z("rtk-icon",{icon:this.iconPack.subtract})))),z("rtk-button",{key:"d33f567bcd74edf4ace17cd3a0ca36daf69eeb8c",class:"add-option",variant:"secondary",onClick:()=>this.addOption()},this.t("polls.option")),z("label",{key:"1ded9b5aeec6b5b5fec3cc2ec43c488b48a0568b"},z("input",{key:"37047cb8a6ccb8c37fc56261fb2f32fa0ff19d92",id:"anonymous",type:"checkbox",onChange:t=>this.anonymous=t.target.checked}),this.t("polls.results.anon")),z("label",{key:"50ac11b8af600d337cc2a1d8ec934e1abac7eaf6"},z("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")),z("rtk-button",{key:"36f2228ca82a29f9d72f768fa65028690230a26f",kind:"wide",onClick:()=>this.handleSubmit()},this.t("polls.create")),this.error&&z("span",{key:"fe7a37df641bcf672e8c85a87251df19d8d1fc91",class:"error-text"},this.error.message)))}};JS([si()],tE.prototype,"iconPack",void 0),JS([si()],tE.prototype,"t",void 0),tE.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 eE=Object.freeze({__proto__:null,rtk_poll:XS,rtk_poll_form:tE});const iE=class{constructor(t){o(this,t),this.tabChange=W(this,"tabChange",7),this.sidebarClose=W(this,"sidebarClose",7),this.view="sidebar",this.tabs=[],this.hideHeader=!1,this.hideCloseAction=!1,this.iconPack=Ne,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 z(G,{key:"4afc881e8aeb5f51014817e1287aed7700bb56fb",ref:t=>this.hostEl=t,class:this.view},!this.hideCloseAction&&z("rtk-button",{key:"e95b2c25d32535630e0ccf30b46f067395c41a7f",ref:t=>this.closeButton=t,variant:"ghost",kind:"icon",class:"close",onClick:this.onClose,"aria-label":this.t("close")},z("rtk-icon",{key:"0d6398171fbebd8d9b0895fc2e9f0b08e7980ab2",icon:this.iconPack.dismiss})),e&&!this.hideHeader&&z("header",{key:"e92a6c60fa280a36b4643873d48adca3210e3c51",class:"main-header"},z("h3",{key:"8097b3e815c3005c7750c7076eb54242406034a9"},e.name),z("slot",{key:"f91814a6fb62726790ae5c91111be0f6d1ea121c",name:"pinned-state"})),t&&z("header",{key:"5ec434bbc22ffa7acf8a76361e02718080c7a99d",class:"mobile-tabs"},this.tabs.map(t=>z("button",{onClick:()=>{this.tabChange.emit(t.id)},class:{active:this.currentTab===t.id}},t.name))),z("slot",{key:"77ee9da399e6991cc7bf3e0d979ffeec47e4b769",name:this.currentTab}))}static get watchers(){return{currentTab:["handleFocusCloseButton"]}}};!function(t,e,i,r){var s,a=arguments.length,n=a<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--)(s=t[o])&&(n=(a<3?s(n):a>3?s(e,i,n):s(e,i))||n);a>3&&n&&Object.defineProperty(e,i,n)}([si()],iE.prototype,"t",void 0),iE.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 rE=Object.freeze({__proto__:null,rtk_sidebar_ui:iE});var sE=function(t,e,i,r){var s,a=arguments.length,n=a<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--)(s=t[o])&&(n=(a<3?s(n):a>3?s(e,i,n):s(e,i))||n);return a>3&&n&&Object.defineProperty(e,i,n),n};const aE=class{constructor(t){o(this,t),this.iconPack=Ne,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 z(G,null,z("rtk-tooltip",{size:"md",label:this.t("remote_access.indicator")},z("div",{id:"sync-button",class:{tab:!0,active:this.isSpotlighted},onClick:()=>this.updateSpotlightState(!this.isSpotlighted)},z("span",{class:"name"},"Sync"),z("rtk-icon",{id:"icon",icon:this.isSpotlighted?this.iconPack.checkmark:this.iconPack.warning,tabIndex:-1,"aria-hidden":!0}))))}static get watchers(){return{meeting:["meetingChanged"]}}};sE([si()],aE.prototype,"meeting",void 0),sE([si()],aE.prototype,"iconPack",void 0),sE([si()],aE.prototype,"t",void 0),sE([si()],aE.prototype,"size",void 0),aE.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 nE=Object.freeze({__proto__:null,rtk_spotlight_indicator:aE});var oE=function(t,e,i,r){var s,a=arguments.length,n=a<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--)(s=t[o])&&(n=(a<3?s(n):a>3?s(e,i,n):s(e,i))||n);return a>3&&n&&Object.defineProperty(e,i,n),n};const lE=class{constructor(t){o(this,t),this.variant="button",this.showWarning=!1,this.disabled=!1,this.iconPack=Ne,this.brandIcon=!1}render(){return z(G,{key:"9a1150fd8a0fbd0022f33f325e7413d0670d0820"},z("button",{key:"0fabd8a63a8013e1630dd3838f0c2f1378f423f7","aria-label":this.label,part:"button"},this.isLoading?z("rtk-spinner",{id:"icon",part:"spinner",iconPack:this.iconPack}):z("rtk-icon",{id:"icon",icon:this.icon,tabIndex:-1,"aria-hidden":!0,part:"icon"}),z("span",{key:"117f1bff41fb719a832ef89d000b2abef6f1388a",class:"label",part:"label"},this.label),this.showWarning&&z("rtk-icon",{key:"4d8b9170c833a930e013613089755ec768df0695",id:"warning-indicator",icon:this.iconPack.warning,part:"warning-indicator"})))}static get delegatesFocus(){return!0}};oE([si()],lE.prototype,"size",void 0),oE([si()],lE.prototype,"iconPack",void 0),lE.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 cE=Object.freeze({__proto__:null,rtk_controlbar_button:lE});return t.defineCustomElements=async(t,e)=>{if("undefined"!=typeof window)return await void 0,Gt(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}({});
|