hx-live-client-plus 1.0.58 → 1.0.60

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (122) hide show
  1. package/lib/assets/addressBook/add.png +0 -0
  2. package/lib/assets/addressBook/search.png +0 -0
  3. package/lib/assets/addressBook/tradd.png +0 -0
  4. package/lib/assets/addressBook/trmin.png +0 -0
  5. package/lib/assets/addressBook/user.png +0 -0
  6. package/lib/assets/audio/README.txt +2 -0
  7. package/lib/assets/font/PingFang-Medium.ttf +0 -0
  8. package/lib/assets/img/entry/add_icon.png +0 -0
  9. package/lib/assets/img/entry/audio_level_icon.png +0 -0
  10. package/lib/assets/img/entry/empty_logo.png +0 -0
  11. package/lib/assets/img/entry/entry_logo.png +0 -0
  12. package/lib/assets/img/entry/icon_date.png +0 -0
  13. package/lib/assets/img/entry/icon_more.png +0 -0
  14. package/lib/assets/img/entry/icon_room.png +0 -0
  15. package/lib/assets/img/entry/join_dialog_logo.png +0 -0
  16. package/lib/assets/img/entry/join_icon.png +0 -0
  17. package/lib/assets/img/entry/launch_dialog_logo.png +0 -0
  18. package/lib/assets/img/entry/launch_icon.png +0 -0
  19. package/lib/assets/img/entry/preview_dialog_logo.png +0 -0
  20. package/lib/assets/img/entry/preview_icon.png +0 -0
  21. package/lib/assets/img/entry/video_bg.png +0 -0
  22. package/lib/assets/img/index/avatar.png +0 -0
  23. package/lib/assets/img/index/bgc.png +0 -0
  24. package/lib/assets/img/index/jt.png +0 -0
  25. package/lib/assets/img/index/jx.png +0 -0
  26. package/lib/assets/img/index/kg.png +0 -0
  27. package/lib/assets/img/index/logo.png +0 -0
  28. package/lib/assets/img/index/mkf.png +0 -0
  29. package/lib/assets/img/index/sjt.png +0 -0
  30. package/lib/assets/img/index/sxt.png +0 -0
  31. package/lib/assets/img/index/tex.png +0 -0
  32. package/lib/assets/img/index/tx.png +0 -0
  33. package/lib/assets/img/index/xtx.png +0 -0
  34. package/lib/assets/img/index/yq.png +0 -0
  35. package/lib/assets/img/meeting/board-bg.png +0 -0
  36. package/lib/assets/img/meeting/btn_icon_call.png +0 -0
  37. package/lib/assets/img/meeting/btn_icon_mini.png +0 -0
  38. package/lib/assets/img/meeting/call_board_icon.png +0 -0
  39. package/lib/assets/img/meeting/camera-off-large.png +0 -0
  40. package/lib/assets/img/meeting/camera-off-small.png +0 -0
  41. package/lib/assets/img/meeting/camera-on-large.png +0 -0
  42. package/lib/assets/img/meeting/camera-on-small.png +0 -0
  43. package/lib/assets/img/meeting/chat-large.png +0 -0
  44. package/lib/assets/img/meeting/chat.png +0 -0
  45. package/lib/assets/img/meeting/check-icon.png +0 -0
  46. package/lib/assets/img/meeting/checked_icon.png +0 -0
  47. package/lib/assets/img/meeting/clock.png +0 -0
  48. package/lib/assets/img/meeting/close.png +0 -0
  49. package/lib/assets/img/meeting/copy-icon.png +0 -0
  50. package/lib/assets/img/meeting/des-ava.png +0 -0
  51. package/lib/assets/img/meeting/emoji-logo.png +0 -0
  52. package/lib/assets/img/meeting/invite.png +0 -0
  53. package/lib/assets/img/meeting/layout-active-logo.png +0 -0
  54. package/lib/assets/img/meeting/layout-active1.png +0 -0
  55. package/lib/assets/img/meeting/layout-active2.png +0 -0
  56. package/lib/assets/img/meeting/layout-active3.png +0 -0
  57. package/lib/assets/img/meeting/layout-active4.png +0 -0
  58. package/lib/assets/img/meeting/layout-logo.png +0 -0
  59. package/lib/assets/img/meeting/layout1.png +0 -0
  60. package/lib/assets/img/meeting/layout2.png +0 -0
  61. package/lib/assets/img/meeting/layout3.png +0 -0
  62. package/lib/assets/img/meeting/layout4.png +0 -0
  63. package/lib/assets/img/meeting/member-large.png +0 -0
  64. package/lib/assets/img/meeting/member.png +0 -0
  65. package/lib/assets/img/meeting/mic-off-large.png +0 -0
  66. package/lib/assets/img/meeting/mic-off-small.png +0 -0
  67. package/lib/assets/img/meeting/mic-on-large.png +0 -0
  68. package/lib/assets/img/meeting/mic-on-small.png +0 -0
  69. package/lib/assets/img/meeting/more.png +0 -0
  70. package/lib/assets/img/meeting/more_icon.png +0 -0
  71. package/lib/assets/img/meeting/pic-logo.png +0 -0
  72. package/lib/assets/img/meeting/record.png +0 -0
  73. package/lib/assets/img/meeting/screen.png +0 -0
  74. package/lib/assets/img/meeting/search-input-icon.png +0 -0
  75. package/lib/assets/img/meeting/send-logo.png +0 -0
  76. package/lib/assets/img/meeting/setting.png +0 -0
  77. package/lib/assets/img/meeting/share.png +0 -0
  78. package/lib/assets/img/meeting/signal.png +0 -0
  79. package/lib/assets/img/meeting/signal_good.png +0 -0
  80. package/lib/assets/img/meeting/signal_poor.png +0 -0
  81. package/lib/assets/img/meeting/theme_logo.png +0 -0
  82. package/lib/assets/img/meeting/to-bottom.png +0 -0
  83. package/lib/assets/img/meeting/to-top.png +0 -0
  84. package/lib/assets/img/multi/add.png +0 -0
  85. package/lib/assets/img/multi/add_user_icon.png +0 -0
  86. package/lib/assets/img/multi/close_icon.png +0 -0
  87. package/lib/assets/img/multi/item_close.png +0 -0
  88. package/lib/assets/img/multi/join_icon.png +0 -0
  89. package/lib/assets/img/multi/launch_icon.png +0 -0
  90. package/lib/assets/img/multi/preview_icon.png +0 -0
  91. package/lib/assets/img/multi/quick_icon.png +0 -0
  92. package/lib/assets/img/multi/screen_icon.png +0 -0
  93. package/lib/assets/img/multi/search.png +0 -0
  94. package/lib/assets/img/multi/tree_expand.png +0 -0
  95. package/lib/assets/img/multi/tree_slide.png +0 -0
  96. package/lib/assets/img/multi/user.png +0 -0
  97. package/lib/assets/img/point/avatar_icon.png +0 -0
  98. package/lib/assets/img/point/cam-off.png +0 -0
  99. package/lib/assets/img/point/cam-on.png +0 -0
  100. package/lib/assets/img/point/cancel_icon.png +0 -0
  101. package/lib/assets/img/point/clear_icon.png +0 -0
  102. package/lib/assets/img/point/close_icon.png +0 -0
  103. package/lib/assets/img/point/duration_icon.png +0 -0
  104. package/lib/assets/img/point/full_screen_icon.png +0 -0
  105. package/lib/assets/img/point/hang_off_icon.png +0 -0
  106. package/lib/assets/img/point/hang_on_icon.png +0 -0
  107. package/lib/assets/img/point/mic-mini-on.png +0 -0
  108. package/lib/assets/img/point/mic-off.png +0 -0
  109. package/lib/assets/img/point/mic-on.png +0 -0
  110. package/lib/assets/img/point/mini_icon.png +0 -0
  111. package/lib/assets/img/point/preview_icon.png +0 -0
  112. package/lib/assets/img/point/share_icon.png +0 -0
  113. package/lib/assets/img/point/speaker-off.png +0 -0
  114. package/lib/assets/img/point/speaker-on.png +0 -0
  115. package/lib/assets/img/point/tx.png +0 -0
  116. package/lib/assets/img/point/video_icon.png +0 -0
  117. package/lib/assets/img/point/voice_icon.png +0 -0
  118. package/lib/favicon.ico +0 -0
  119. package/lib/hx-live-client-plus.css +1 -0
  120. package/lib/hx-live-client-plus.js +65738 -0
  121. package/lib/hx-live-client-plus.umd.cjs +384 -0
  122. package/package.json +1 -1
@@ -0,0 +1,384 @@
1
+ (function(ui,l){typeof exports=="object"&&typeof module<"u"?l(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],l):(ui=typeof globalThis<"u"?globalThis:ui||self,l(ui.hxLiveClientPlus={},ui.Vue))})(this,function(ui,l){"use strict";const Zg=i=>{let e,t,n,r=Math.floor(i%3600);return Math.floor(i/3600)>0?e=Math.floor(i/3600)<=9?"0"+Math.floor(i/3600):Math.floor(i/3600):e="00",Math.floor(r/60)>0?t=Math.floor(r/60)<=9?"0"+Math.floor(r/60):Math.floor(r/60):t="00",Math.floor(r%60)>0?n=Math.floor(r%60)<=9?"0"+Math.floor(r%60):Math.floor(r%60):n="00",`${e}:${t}:${n}`},gx=(i=16)=>{let e=String(new Date().getTime());const t="0123456789";for(let n=0;n<=i-e.length;n++){const r=Math.floor(Math.random()*t.length);e+=t[r]}return e},vx=(i,e)=>typeof window.getComputedStyle<"u"?window.getComputedStyle(i,null)[e]:typeof i.currentStyle!="undefiend"?i.currentStyle[e]:"",yx=(i,e,t)=>{e===""?t(new Error("请输入手机号")):/^1[345789]\d{9}$/.test(e)?t():t(new Error("请输入正确手机号"))},bx='a[href],button:not([disabled]),button:not([hidden]),:not([tabindex="-1"]),input:not([disabled]),input:not([type="hidden"]),select:not([disabled]),textarea:not([disabled])',_x=i=>process.env.NODE_ENV==="test"?!0:getComputedStyle(i).position==="fixed"?!1:i.offsetParent!==null,e0=i=>Array.from(i.querySelectorAll(bx)).filter(e=>kx(e)&&_x(e)),kx=i=>{if(i.tabIndex>0||i.tabIndex===0&&i.getAttribute("tabIndex")!==null)return!0;if(i.disabled)return!1;switch(i.nodeName){case"A":return!!i.href&&i.rel!=="ignore";case"INPUT":return!(i.type==="hidden"||i.type==="file");case"BUTTON":case"SELECT":case"TEXTAREA":return!0;default:return!1}};var t0;const zn=typeof window<"u",Tx=i=>typeof i=="string",Sx=()=>{};zn&&((t0=window==null?void 0:window.navigator)!=null&&t0.userAgent)&&/iP(ad|hone|od)/.test(window.navigator.userAgent);function gh(i){return typeof i=="function"?i():l.unref(i)}function Cx(i){return i}function vh(i){return l.getCurrentScope()?(l.onScopeDispose(i),!0):!1}function xx(i,e=!0){l.getCurrentInstance()?l.onMounted(i):e?i():l.nextTick(i)}function Ex(i,e,t={}){const{immediate:n=!0}=t,r=l.ref(!1);let s=null;function a(){s&&(clearTimeout(s),s=null)}function o(){r.value=!1,a()}function c(...u){a(),r.value=!0,s=setTimeout(()=>{r.value=!1,s=null,i(...u)},gh(e))}return n&&(r.value=!0,zn&&c()),vh(o),{isPending:l.readonly(r),start:c,stop:o}}function n0(i){var e;const t=gh(i);return(e=t==null?void 0:t.$el)!=null?e:t}const i0=zn?window:void 0;function ka(...i){let e,t,n,r;if(Tx(i[0])||Array.isArray(i[0])?([t,n,r]=i,e=i0):[e,t,n,r]=i,!e)return Sx;Array.isArray(t)||(t=[t]),Array.isArray(n)||(n=[n]);const s=[],a=()=>{s.forEach(d=>d()),s.length=0},o=(d,h,b,v)=>(d.addEventListener(h,b,v),()=>d.removeEventListener(h,b,v)),c=l.watch(()=>[n0(e),gh(r)],([d,h])=>{a(),d&&s.push(...t.flatMap(b=>n.map(v=>o(d,b,v,h))))},{immediate:!0,flush:"post"}),u=()=>{c(),a()};return vh(u),u}function wx(i,e=!1){const t=l.ref(),n=()=>t.value=!!i();return n(),xx(n,e),t}const r0=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},s0="__vueuse_ssr_handlers__";r0[s0]=r0[s0]||{};var a0=Object.getOwnPropertySymbols,Dx=Object.prototype.hasOwnProperty,Ax=Object.prototype.propertyIsEnumerable,Ix=(i,e)=>{var t={};for(var n in i)Dx.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&a0)for(var n of a0(i))e.indexOf(n)<0&&Ax.call(i,n)&&(t[n]=i[n]);return t};function o0(i,e,t={}){const n=t,{window:r=i0}=n,s=Ix(n,["window"]);let a;const o=wx(()=>r&&"ResizeObserver"in r),c=()=>{a&&(a.disconnect(),a=void 0)},u=l.watch(()=>n0(i),h=>{c(),o.value&&r&&h&&(a=new ResizeObserver(e),a.observe(h,s))},{immediate:!0,flush:"post"}),d=()=>{c(),u()};return vh(d),{isSupported:o,stop:d}}var l0;(function(i){i.UP="UP",i.RIGHT="RIGHT",i.DOWN="DOWN",i.LEFT="LEFT",i.NONE="NONE"})(l0||(l0={}));var Px=Object.defineProperty,c0=Object.getOwnPropertySymbols,Nx=Object.prototype.hasOwnProperty,Ox=Object.prototype.propertyIsEnumerable,u0=(i,e,t)=>e in i?Px(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t,Mx=(i,e)=>{for(var t in e||(e={}))Nx.call(e,t)&&u0(i,t,e[t]);if(c0)for(var t of c0(e))Ox.call(e,t)&&u0(i,t,e[t]);return i};Mx({linear:Cx},{easeInSine:[.12,0,.39,0],easeOutSine:[.61,1,.88,1],easeInOutSine:[.37,0,.63,1],easeInQuad:[.11,0,.5,0],easeOutQuad:[.5,1,.89,1],easeInOutQuad:[.45,0,.55,1],easeInCubic:[.32,0,.67,0],easeOutCubic:[.33,1,.68,1],easeInOutCubic:[.65,0,.35,1],easeInQuart:[.5,0,.75,0],easeOutQuart:[.25,1,.5,1],easeInOutQuart:[.76,0,.24,1],easeInQuint:[.64,0,.78,0],easeOutQuint:[.22,1,.36,1],easeInOutQuint:[.83,0,.17,1],easeInExpo:[.7,0,.84,0],easeOutExpo:[.16,1,.3,1],easeInOutExpo:[.87,0,.13,1],easeInCirc:[.55,0,1,.45],easeOutCirc:[0,.55,.45,1],easeInOutCirc:[.85,0,.15,1],easeInBack:[.36,0,.66,-.56],easeOutBack:[.34,1.56,.64,1],easeInOutBack:[.68,-.6,.32,1.6]});const Rx=()=>zn&&/firefox/i.test(window.navigator.userAgent);/**
2
+ * @vue/shared v3.5.13
3
+ * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
+ * @license MIT
5
+ **/process.env.NODE_ENV!=="production"&&Object.freeze({}),process.env.NODE_ENV!=="production"&&Object.freeze([]);const Vo=()=>{},Lx=Object.prototype.hasOwnProperty,pc=(i,e)=>Lx.call(i,e),Yr=i=>typeof i=="function",Ui=i=>typeof i=="string",jo=i=>i!==null&&typeof i=="object",Bx=i=>{const e=Object.create(null);return t=>e[t]||(e[t]=i(t))},Ux=/-(\w)/g,Fx=Bx(i=>i.replace(Ux,(e,t)=>t?t.toUpperCase():""));var Vx=typeof global=="object"&&global&&global.Object===Object&&global,jx=typeof self=="object"&&self&&self.Object===Object&&self,yh=Vx||jx||Function("return this")(),Jr=yh.Symbol,d0=Object.prototype,$x=d0.hasOwnProperty,Hx=d0.toString,$o=Jr?Jr.toStringTag:void 0;function qx(i){var e=$x.call(i,$o),t=i[$o];try{i[$o]=void 0;var n=!0}catch{}var r=Hx.call(i);return n&&(e?i[$o]=t:delete i[$o]),r}var zx=Object.prototype,Gx=zx.toString;function Wx(i){return Gx.call(i)}var Kx="[object Null]",Xx="[object Undefined]",h0=Jr?Jr.toStringTag:void 0;function bh(i){return i==null?i===void 0?Xx:Kx:h0&&h0 in Object(i)?qx(i):Wx(i)}function _h(i){return i!=null&&typeof i=="object"}var Yx="[object Symbol]";function kh(i){return typeof i=="symbol"||_h(i)&&bh(i)==Yx}function Jx(i,e){for(var t=-1,n=i==null?0:i.length,r=Array(n);++t<n;)r[t]=e(i[t],t,i);return r}var Ho=Array.isArray,f0=Jr?Jr.prototype:void 0,p0=f0?f0.toString:void 0;function m0(i){if(typeof i=="string")return i;if(Ho(i))return Jx(i,m0)+"";if(kh(i))return p0?p0.call(i):"";var e=i+"";return e=="0"&&1/i==-1/0?"-0":e}function mc(i){var e=typeof i;return i!=null&&(e=="object"||e=="function")}function Qx(i){return i}var Zx="[object AsyncFunction]",eE="[object Function]",tE="[object GeneratorFunction]",nE="[object Proxy]";function iE(i){if(!mc(i))return!1;var e=bh(i);return e==eE||e==tE||e==Zx||e==nE}var Th=yh["__core-js_shared__"],g0=function(){var i=/[^.]+$/.exec(Th&&Th.keys&&Th.keys.IE_PROTO||"");return i?"Symbol(src)_1."+i:""}();function rE(i){return!!g0&&g0 in i}var sE=Function.prototype,aE=sE.toString;function oE(i){if(i!=null){try{return aE.call(i)}catch{}try{return i+""}catch{}}return""}var lE=/[\\^$.*+?()[\]{}|]/g,cE=/^\[object .+?Constructor\]$/,uE=Function.prototype,dE=Object.prototype,hE=uE.toString,fE=dE.hasOwnProperty,pE=RegExp("^"+hE.call(fE).replace(lE,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function mE(i){if(!mc(i)||rE(i))return!1;var e=iE(i)?pE:cE;return e.test(oE(i))}function gE(i,e){return i==null?void 0:i[e]}function Sh(i,e){var t=gE(i,e);return mE(t)?t:void 0}function vE(i,e,t){switch(t.length){case 0:return i.call(e);case 1:return i.call(e,t[0]);case 2:return i.call(e,t[0],t[1]);case 3:return i.call(e,t[0],t[1],t[2])}return i.apply(e,t)}var yE=800,bE=16,_E=Date.now;function kE(i){var e=0,t=0;return function(){var n=_E(),r=bE-(n-t);if(t=n,r>0){if(++e>=yE)return arguments[0]}else e=0;return i.apply(void 0,arguments)}}function TE(i){return function(){return i}}var gc=function(){try{var i=Sh(Object,"defineProperty");return i({},"",{}),i}catch{}}(),SE=gc?function(i,e){return gc(i,"toString",{configurable:!0,enumerable:!1,value:TE(e),writable:!0})}:Qx,CE=kE(SE),xE=9007199254740991,EE=/^(?:0|[1-9]\d*)$/;function v0(i,e){var t=typeof i;return e=e??xE,!!e&&(t=="number"||t!="symbol"&&EE.test(i))&&i>-1&&i%1==0&&i<e}function wE(i,e,t){e=="__proto__"&&gc?gc(i,e,{configurable:!0,enumerable:!0,value:t,writable:!0}):i[e]=t}function y0(i,e){return i===e||i!==i&&e!==e}var DE=Object.prototype,AE=DE.hasOwnProperty;function IE(i,e,t){var n=i[e];(!(AE.call(i,e)&&y0(n,t))||t===void 0&&!(e in i))&&wE(i,e,t)}var b0=Math.max;function PE(i,e,t){return e=b0(e===void 0?i.length-1:e,0),function(){for(var n=arguments,r=-1,s=b0(n.length-e,0),a=Array(s);++r<s;)a[r]=n[e+r];r=-1;for(var o=Array(e+1);++r<e;)o[r]=n[r];return o[e]=t(a),vE(i,this,o)}}var NE=9007199254740991;function OE(i){return typeof i=="number"&&i>-1&&i%1==0&&i<=NE}var ME="[object Arguments]";function _0(i){return _h(i)&&bh(i)==ME}var k0=Object.prototype,RE=k0.hasOwnProperty,LE=k0.propertyIsEnumerable,T0=_0(function(){return arguments}())?_0:function(i){return _h(i)&&RE.call(i,"callee")&&!LE.call(i,"callee")},BE=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,UE=/^\w*$/;function FE(i,e){if(Ho(i))return!1;var t=typeof i;return t=="number"||t=="symbol"||t=="boolean"||i==null||kh(i)?!0:UE.test(i)||!BE.test(i)||e!=null&&i in Object(e)}var qo=Sh(Object,"create");function VE(){this.__data__=qo?qo(null):{},this.size=0}function jE(i){var e=this.has(i)&&delete this.__data__[i];return this.size-=e?1:0,e}var $E="__lodash_hash_undefined__",HE=Object.prototype,qE=HE.hasOwnProperty;function zE(i){var e=this.__data__;if(qo){var t=e[i];return t===$E?void 0:t}return qE.call(e,i)?e[i]:void 0}var GE=Object.prototype,WE=GE.hasOwnProperty;function KE(i){var e=this.__data__;return qo?e[i]!==void 0:WE.call(e,i)}var XE="__lodash_hash_undefined__";function YE(i,e){var t=this.__data__;return this.size+=this.has(i)?0:1,t[i]=qo&&e===void 0?XE:e,this}function xs(i){var e=-1,t=i==null?0:i.length;for(this.clear();++e<t;){var n=i[e];this.set(n[0],n[1])}}xs.prototype.clear=VE,xs.prototype.delete=jE,xs.prototype.get=zE,xs.prototype.has=KE,xs.prototype.set=YE;function JE(){this.__data__=[],this.size=0}function vc(i,e){for(var t=i.length;t--;)if(y0(i[t][0],e))return t;return-1}var QE=Array.prototype,ZE=QE.splice;function ew(i){var e=this.__data__,t=vc(e,i);if(t<0)return!1;var n=e.length-1;return t==n?e.pop():ZE.call(e,t,1),--this.size,!0}function tw(i){var e=this.__data__,t=vc(e,i);return t<0?void 0:e[t][1]}function nw(i){return vc(this.__data__,i)>-1}function iw(i,e){var t=this.__data__,n=vc(t,i);return n<0?(++this.size,t.push([i,e])):t[n][1]=e,this}function Ta(i){var e=-1,t=i==null?0:i.length;for(this.clear();++e<t;){var n=i[e];this.set(n[0],n[1])}}Ta.prototype.clear=JE,Ta.prototype.delete=ew,Ta.prototype.get=tw,Ta.prototype.has=nw,Ta.prototype.set=iw;var rw=Sh(yh,"Map");function sw(){this.size=0,this.__data__={hash:new xs,map:new(rw||Ta),string:new xs}}function aw(i){var e=typeof i;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?i!=="__proto__":i===null}function yc(i,e){var t=i.__data__;return aw(e)?t[typeof e=="string"?"string":"hash"]:t.map}function ow(i){var e=yc(this,i).delete(i);return this.size-=e?1:0,e}function lw(i){return yc(this,i).get(i)}function cw(i){return yc(this,i).has(i)}function uw(i,e){var t=yc(this,i),n=t.size;return t.set(i,e),this.size+=t.size==n?0:1,this}function Es(i){var e=-1,t=i==null?0:i.length;for(this.clear();++e<t;){var n=i[e];this.set(n[0],n[1])}}Es.prototype.clear=sw,Es.prototype.delete=ow,Es.prototype.get=lw,Es.prototype.has=cw,Es.prototype.set=uw;var dw="Expected a function";function Ch(i,e){if(typeof i!="function"||e!=null&&typeof e!="function")throw new TypeError(dw);var t=function(){var n=arguments,r=e?e.apply(this,n):n[0],s=t.cache;if(s.has(r))return s.get(r);var a=i.apply(this,n);return t.cache=s.set(r,a)||s,a};return t.cache=new(Ch.Cache||Es),t}Ch.Cache=Es;var hw=500;function fw(i){var e=Ch(i,function(n){return t.size===hw&&t.clear(),n}),t=e.cache;return e}var pw=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,mw=/\\(\\)?/g,gw=fw(function(i){var e=[];return i.charCodeAt(0)===46&&e.push(""),i.replace(pw,function(t,n,r,s){e.push(r?s.replace(mw,"$1"):n||t)}),e});function vw(i){return i==null?"":m0(i)}function bc(i,e){return Ho(i)?i:FE(i,e)?[i]:gw(vw(i))}function xh(i){if(typeof i=="string"||kh(i))return i;var e=i+"";return e=="0"&&1/i==-1/0?"-0":e}function S0(i,e){e=bc(e,i);for(var t=0,n=e.length;i!=null&&t<n;)i=i[xh(e[t++])];return t&&t==n?i:void 0}function yw(i,e,t){var n=i==null?void 0:S0(i,e);return n===void 0?t:n}function bw(i,e){for(var t=-1,n=e.length,r=i.length;++t<n;)i[r+t]=e[t];return i}var C0=Jr?Jr.isConcatSpreadable:void 0;function _w(i){return Ho(i)||T0(i)||!!(C0&&i&&i[C0])}function kw(i,e,t,n,r){var s=-1,a=i.length;for(t||(t=_w),r||(r=[]);++s<a;){var o=i[s];t(o)?bw(r,o):r[r.length]=o}return r}function Tw(i){var e=i==null?0:i.length;return e?kw(i):[]}function Sw(i){return CE(PE(i,void 0,Tw),i+"")}function Cw(i,e){return i!=null&&e in Object(i)}function xw(i,e,t){e=bc(e,i);for(var n=-1,r=e.length,s=!1;++n<r;){var a=xh(e[n]);if(!(s=i!=null&&t(i,a)))break;i=i[a]}return s||++n!=r?s:(r=i==null?0:i.length,!!r&&OE(r)&&v0(a,r)&&(Ho(i)||T0(i)))}function Ew(i,e){return i!=null&&xw(i,e,Cw)}function x0(i){for(var e=-1,t=i==null?0:i.length,n={};++e<t;){var r=i[e];n[r[0]]=r[1]}return n}function E0(i){return i==null}function ww(i,e,t,n){if(!mc(i))return i;e=bc(e,i);for(var r=-1,s=e.length,a=s-1,o=i;o!=null&&++r<s;){var c=xh(e[r]),u=t;if(c==="__proto__"||c==="constructor"||c==="prototype")return i;if(r!=a){var d=o[c];u=void 0,u===void 0&&(u=mc(d)?d:v0(e[r+1])?[]:{})}IE(o,c,u),o=o[c]}return i}function Dw(i,e,t){for(var n=-1,r=e.length,s={};++n<r;){var a=e[n],o=S0(i,a);t(o,a)&&ww(s,bc(a,i),o)}return s}function Aw(i,e){return Dw(i,e,function(t,n){return Ew(i,n)})}var Iw=Sw(function(i,e){return i==null?{}:Aw(i,e)});const w0=i=>i===void 0,ws=i=>typeof i=="number",_c=i=>typeof Element>"u"?!1:i instanceof Element,Pw=i=>Ui(i)?!Number.isNaN(Number(i)):!1,D0=i=>Object.keys(i);class A0 extends Error{constructor(e){super(e),this.name="ElementPlusError"}}function Nw(i,e){throw new A0(`[${i}] ${e}`)}function Fi(i,e){if(process.env.NODE_ENV!=="production"){const t=Ui(i)?new A0(`[${i}] ${e}`):i;console.warn(t)}}const Ow="utils/dom/style",I0=(i="")=>i.split(" ").filter(e=>!!e.trim()),P0=(i,e)=>{if(!i||!e)return!1;if(e.includes(" "))throw new Error("className should not contain space.");return i.classList.contains(e)},Mw=(i,e)=>{!i||!e.trim()||i.classList.add(...I0(e))},Rw=(i,e)=>{!i||!e.trim()||i.classList.remove(...I0(e))},Lw=(i,e)=>{var t;if(!zn||!i)return"";let n=Fx(e);n==="float"&&(n="cssFloat");try{const r=i.style[n];if(r)return r;const s=(t=document.defaultView)==null?void 0:t.getComputedStyle(i,"");return s?s[n]:""}catch{return i.style[n]}};function zo(i,e="px"){if(!i)return"";if(ws(i)||Pw(i))return`${i}${e}`;if(Ui(i))return i;Fi(Ow,"binding value must be a string or number")}let kc;const Bw=i=>{var e;if(!zn)return 0;if(kc!==void 0)return kc;const t=document.createElement("div");t.className=`${i}-scrollbar__wrap`,t.style.visibility="hidden",t.style.width="100px",t.style.position="absolute",t.style.top="-9999px",document.body.appendChild(t);const n=t.offsetWidth;t.style.overflow="scroll";const r=document.createElement("div");r.style.width="100%",t.appendChild(r);const s=r.offsetWidth;return(e=t.parentNode)==null||e.removeChild(t),kc=n-s,kc};/*! Element Plus Icons Vue v2.3.1 */var Uw=l.defineComponent({name:"CircleCheck",__name:"circle-check",setup(i){return(e,t)=>(l.openBlock(),l.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[l.createElementVNode("path",{fill:"currentColor",d:"M512 896a384 384 0 1 0 0-768 384 384 0 0 0 0 768m0 64a448 448 0 1 1 0-896 448 448 0 0 1 0 896"}),l.createElementVNode("path",{fill:"currentColor",d:"M745.344 361.344a32 32 0 0 1 45.312 45.312l-288 288a32 32 0 0 1-45.312 0l-160-160a32 32 0 1 1 45.312-45.312L480 626.752l265.344-265.408z"})]))}}),Fw=Uw,Vw=l.defineComponent({name:"CircleCloseFilled",__name:"circle-close-filled",setup(i){return(e,t)=>(l.openBlock(),l.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[l.createElementVNode("path",{fill:"currentColor",d:"M512 64a448 448 0 1 1 0 896 448 448 0 0 1 0-896m0 393.664L407.936 353.6a38.4 38.4 0 1 0-54.336 54.336L457.664 512 353.6 616.064a38.4 38.4 0 1 0 54.336 54.336L512 566.336 616.064 670.4a38.4 38.4 0 1 0 54.336-54.336L566.336 512 670.4 407.936a38.4 38.4 0 1 0-54.336-54.336z"})]))}}),N0=Vw,jw=l.defineComponent({name:"CircleClose",__name:"circle-close",setup(i){return(e,t)=>(l.openBlock(),l.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[l.createElementVNode("path",{fill:"currentColor",d:"m466.752 512-90.496-90.496a32 32 0 0 1 45.248-45.248L512 466.752l90.496-90.496a32 32 0 1 1 45.248 45.248L557.248 512l90.496 90.496a32 32 0 1 1-45.248 45.248L512 557.248l-90.496 90.496a32 32 0 0 1-45.248-45.248z"}),l.createElementVNode("path",{fill:"currentColor",d:"M512 896a384 384 0 1 0 0-768 384 384 0 0 0 0 768m0 64a448 448 0 1 1 0-896 448 448 0 0 1 0 896"})]))}}),O0=jw,$w=l.defineComponent({name:"Close",__name:"close",setup(i){return(e,t)=>(l.openBlock(),l.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[l.createElementVNode("path",{fill:"currentColor",d:"M764.288 214.592 512 466.88 259.712 214.592a31.936 31.936 0 0 0-45.12 45.12L466.752 512 214.528 764.224a31.936 31.936 0 1 0 45.12 45.184L512 557.184l252.288 252.288a31.936 31.936 0 0 0 45.12-45.12L557.12 512.064l252.288-252.352a31.936 31.936 0 1 0-45.12-45.184z"})]))}}),Eh=$w,Hw=l.defineComponent({name:"Hide",__name:"hide",setup(i){return(e,t)=>(l.openBlock(),l.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[l.createElementVNode("path",{fill:"currentColor",d:"M876.8 156.8c0-9.6-3.2-16-9.6-22.4-6.4-6.4-12.8-9.6-22.4-9.6-9.6 0-16 3.2-22.4 9.6L736 220.8c-64-32-137.6-51.2-224-60.8-160 16-288 73.6-377.6 176C44.8 438.4 0 496 0 512s48 73.6 134.4 176c22.4 25.6 44.8 48 73.6 67.2l-86.4 89.6c-6.4 6.4-9.6 12.8-9.6 22.4 0 9.6 3.2 16 9.6 22.4 6.4 6.4 12.8 9.6 22.4 9.6 9.6 0 16-3.2 22.4-9.6l704-710.4c3.2-6.4 6.4-12.8 6.4-22.4Zm-646.4 528c-76.8-70.4-128-128-153.6-172.8 28.8-48 80-105.6 153.6-172.8C304 272 400 230.4 512 224c64 3.2 124.8 19.2 176 44.8l-54.4 54.4C598.4 300.8 560 288 512 288c-64 0-115.2 22.4-160 64s-64 96-64 160c0 48 12.8 89.6 35.2 124.8L256 707.2c-9.6-6.4-19.2-16-25.6-22.4Zm140.8-96c-12.8-22.4-19.2-48-19.2-76.8 0-44.8 16-83.2 48-112 32-28.8 67.2-48 112-48 28.8 0 54.4 6.4 73.6 19.2zM889.599 336c-12.8-16-28.8-28.8-41.6-41.6l-48 48c73.6 67.2 124.8 124.8 150.4 169.6-28.8 48-80 105.6-153.6 172.8-73.6 67.2-172.8 108.8-284.8 115.2-51.2-3.2-99.2-12.8-140.8-28.8l-48 48c57.6 22.4 118.4 38.4 188.8 44.8 160-16 288-73.6 377.6-176C979.199 585.6 1024 528 1024 512s-48.001-73.6-134.401-176Z"}),l.createElementVNode("path",{fill:"currentColor",d:"M511.998 672c-12.8 0-25.6-3.2-38.4-6.4l-51.2 51.2c28.8 12.8 57.6 19.2 89.6 19.2 64 0 115.2-22.4 160-64 41.6-41.6 64-96 64-160 0-32-6.4-64-19.2-89.6l-51.2 51.2c3.2 12.8 6.4 25.6 6.4 38.4 0 44.8-16 83.2-48 112-32 28.8-67.2 48-112 48Z"})]))}}),qw=Hw,zw=l.defineComponent({name:"InfoFilled",__name:"info-filled",setup(i){return(e,t)=>(l.openBlock(),l.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[l.createElementVNode("path",{fill:"currentColor",d:"M512 64a448 448 0 1 1 0 896.064A448 448 0 0 1 512 64m67.2 275.072c33.28 0 60.288-23.104 60.288-57.344s-27.072-57.344-60.288-57.344c-33.28 0-60.16 23.104-60.16 57.344s26.88 57.344 60.16 57.344M590.912 699.2c0-6.848 2.368-24.64 1.024-34.752l-52.608 60.544c-10.88 11.456-24.512 19.392-30.912 17.28a12.992 12.992 0 0 1-8.256-14.72l87.68-276.992c7.168-35.136-12.544-67.2-54.336-71.296-44.096 0-108.992 44.736-148.48 101.504 0 6.784-1.28 23.68.064 33.792l52.544-60.608c10.88-11.328 23.552-19.328 29.952-17.152a12.8 12.8 0 0 1 7.808 16.128L388.48 728.576c-10.048 32.256 8.96 63.872 55.04 71.04 67.84 0 107.904-43.648 147.456-100.416z"})]))}}),M0=zw,Gw=l.defineComponent({name:"Loading",__name:"loading",setup(i){return(e,t)=>(l.openBlock(),l.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[l.createElementVNode("path",{fill:"currentColor",d:"M512 64a32 32 0 0 1 32 32v192a32 32 0 0 1-64 0V96a32 32 0 0 1 32-32m0 640a32 32 0 0 1 32 32v192a32 32 0 1 1-64 0V736a32 32 0 0 1 32-32m448-192a32 32 0 0 1-32 32H736a32 32 0 1 1 0-64h192a32 32 0 0 1 32 32m-640 0a32 32 0 0 1-32 32H96a32 32 0 0 1 0-64h192a32 32 0 0 1 32 32M195.2 195.2a32 32 0 0 1 45.248 0L376.32 331.008a32 32 0 0 1-45.248 45.248L195.2 240.448a32 32 0 0 1 0-45.248zm452.544 452.544a32 32 0 0 1 45.248 0L828.8 783.552a32 32 0 0 1-45.248 45.248L647.744 692.992a32 32 0 0 1 0-45.248zM828.8 195.264a32 32 0 0 1 0 45.184L692.992 376.32a32 32 0 0 1-45.248-45.248l135.808-135.808a32 32 0 0 1 45.248 0m-452.544 452.48a32 32 0 0 1 0 45.248L240.448 828.8a32 32 0 0 1-45.248-45.248l135.808-135.808a32 32 0 0 1 45.248 0z"})]))}}),Tc=Gw,Ww=l.defineComponent({name:"SuccessFilled",__name:"success-filled",setup(i){return(e,t)=>(l.openBlock(),l.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[l.createElementVNode("path",{fill:"currentColor",d:"M512 64a448 448 0 1 1 0 896 448 448 0 0 1 0-896m-55.808 536.384-99.52-99.584a38.4 38.4 0 1 0-54.336 54.336l126.72 126.72a38.272 38.272 0 0 0 54.336 0l262.4-262.464a38.4 38.4 0 1 0-54.272-54.336z"})]))}}),R0=Ww,Kw=l.defineComponent({name:"View",__name:"view",setup(i){return(e,t)=>(l.openBlock(),l.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[l.createElementVNode("path",{fill:"currentColor",d:"M512 160c320 0 512 352 512 352S832 864 512 864 0 512 0 512s192-352 512-352m0 64c-225.28 0-384.128 208.064-436.8 288 52.608 79.872 211.456 288 436.8 288 225.28 0 384.128-208.064 436.8-288-52.608-79.872-211.456-288-436.8-288zm0 64a224 224 0 1 1 0 448 224 224 0 0 1 0-448m0 64a160.192 160.192 0 0 0-160 160c0 88.192 71.744 160 160 160s160-71.808 160-160-71.744-160-160-160"})]))}}),Xw=Kw,Yw=l.defineComponent({name:"WarningFilled",__name:"warning-filled",setup(i){return(e,t)=>(l.openBlock(),l.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[l.createElementVNode("path",{fill:"currentColor",d:"M512 64a448 448 0 1 1 0 896 448 448 0 0 1 0-896m0 192a58.432 58.432 0 0 0-58.24 63.744l23.36 256.384a35.072 35.072 0 0 0 69.76 0l23.296-256.384A58.432 58.432 0 0 0 512 256m0 512a51.2 51.2 0 1 0 0-102.4 51.2 51.2 0 0 0 0 102.4"})]))}}),L0=Yw;const B0="__epPropKey",On=i=>i,Jw=i=>jo(i)&&!!i[B0],U0=(i,e)=>{if(!jo(i)||Jw(i))return i;const{values:t,required:n,default:r,type:s,validator:a}=i,c={type:s,required:!!n,validator:t||a?u=>{let d=!1,h=[];if(t&&(h=Array.from(t),pc(i,"default")&&h.push(r),d||(d=h.includes(u))),a&&(d||(d=a(u))),!d&&h.length>0){const b=[...new Set(h)].map(v=>JSON.stringify(v)).join(", ");l.warn(`Invalid prop: validation failed${e?` for prop "${e}"`:""}. Expected one of [${b}], got value ${JSON.stringify(u)}.`)}return d}:void 0,[B0]:!0};return pc(i,"default")&&(c.default=r),c},Er=i=>x0(Object.entries(i).map(([e,t])=>[e,U0(t,e)])),Go=On([String,Object,Function]),F0={Close:Eh,SuccessFilled:R0,InfoFilled:M0,WarningFilled:L0,CircleCloseFilled:N0},Sc={success:R0,warning:L0,error:N0,info:M0},Qw={validating:Tc,success:Fw,error:O0},Cc=(i,e)=>{if(i.install=t=>{for(const n of[i,...Object.values(e??{})])t.component(n.name,n)},e)for(const[t,n]of Object.entries(e))i[t]=n;return i},Zw=(i,e)=>(i.install=t=>{i._context=t._context,t.config.globalProperties[e]=i},i),e3=i=>(i.install=Vo,i),xc={tab:"Tab",esc:"Escape"},wh="update:modelValue",V0=["","default","small","large"],t3=i=>["",...V0].includes(i);var Ec=(i=>(i[i.TEXT=1]="TEXT",i[i.CLASS=2]="CLASS",i[i.STYLE=4]="STYLE",i[i.PROPS=8]="PROPS",i[i.FULL_PROPS=16]="FULL_PROPS",i[i.HYDRATE_EVENTS=32]="HYDRATE_EVENTS",i[i.STABLE_FRAGMENT=64]="STABLE_FRAGMENT",i[i.KEYED_FRAGMENT=128]="KEYED_FRAGMENT",i[i.UNKEYED_FRAGMENT=256]="UNKEYED_FRAGMENT",i[i.NEED_PATCH=512]="NEED_PATCH",i[i.DYNAMIC_SLOTS=1024]="DYNAMIC_SLOTS",i[i.HOISTED=-1]="HOISTED",i[i.BAIL=-2]="BAIL",i))(Ec||{});const n3=i=>/([\uAC00-\uD7AF\u3130-\u318F])+/gi.test(i),j0=i=>i,i3=["class","style"],r3=/^on[A-Z]/,s3=(i={})=>{const{excludeListeners:e=!1,excludeKeys:t}=i,n=l.computed(()=>((t==null?void 0:t.value)||[]).concat(i3)),r=l.getCurrentInstance();return r?l.computed(()=>{var s;return x0(Object.entries((s=r.proxy)==null?void 0:s.$attrs).filter(([a])=>!n.value.includes(a)&&!(e&&r3.test(a))))}):(Fi("use-attrs","getCurrentInstance() returned null. useAttrs() must be called at the top of a setup function"),l.computed(()=>({})))},a3=({from:i,replacement:e,scope:t,version:n,ref:r,type:s="API"},a)=>{l.watch(()=>l.unref(a),o=>{o&&Fi(t,`[${s}] ${i} is about to be deprecated in version ${n}, please use ${e} instead.
6
+ For more detail, please visit: ${r}
7
+ `)},{immediate:!0})},o3=(i,e,t,n)=>{let r={offsetX:0,offsetY:0};const s=u=>{const d=u.clientX,h=u.clientY,{offsetX:b,offsetY:v}=r,y=i.value.getBoundingClientRect(),p=y.left,f=y.top,m=y.width,_=y.height,k=document.documentElement.clientWidth,D=document.documentElement.clientHeight,w=-p+b,A=-f+v,x=k-p-m+b,P=D-f-_+v,S=U=>{let B=b+U.clientX-d,Q=v+U.clientY-h;n!=null&&n.value||(B=Math.min(Math.max(B,w),x),Q=Math.min(Math.max(Q,A),P)),r={offsetX:B,offsetY:Q},i.value&&(i.value.style.transform=`translate(${zo(B)}, ${zo(Q)})`)},M=()=>{document.removeEventListener("mousemove",S),document.removeEventListener("mouseup",M)};document.addEventListener("mousemove",S),document.addEventListener("mouseup",M)},a=()=>{e.value&&i.value&&e.value.addEventListener("mousedown",s)},o=()=>{e.value&&i.value&&e.value.removeEventListener("mousedown",s)},c=()=>{r={offsetX:0,offsetY:0},i.value&&(i.value.style.transform="none")};return l.onMounted(()=>{l.watchEffect(()=>{t.value?a():o()})}),l.onBeforeUnmount(()=>{o()}),{resetPostion:c}};var l3={name:"en",el:{breadcrumb:{label:"Breadcrumb"},colorpicker:{confirm:"OK",clear:"Clear",defaultLabel:"color picker",description:"current color is {color}. press enter to select a new color.",alphaLabel:"pick alpha value"},datepicker:{now:"Now",today:"Today",cancel:"Cancel",clear:"Clear",confirm:"OK",dateTablePrompt:"Use the arrow keys and enter to select the day of the month",monthTablePrompt:"Use the arrow keys and enter to select the month",yearTablePrompt:"Use the arrow keys and enter to select the year",selectedDate:"Selected date",selectDate:"Select date",selectTime:"Select time",startDate:"Start Date",startTime:"Start Time",endDate:"End Date",endTime:"End Time",prevYear:"Previous Year",nextYear:"Next Year",prevMonth:"Previous Month",nextMonth:"Next Month",year:"",month1:"January",month2:"February",month3:"March",month4:"April",month5:"May",month6:"June",month7:"July",month8:"August",month9:"September",month10:"October",month11:"November",month12:"December",week:"week",weeks:{sun:"Sun",mon:"Mon",tue:"Tue",wed:"Wed",thu:"Thu",fri:"Fri",sat:"Sat"},weeksFull:{sun:"Sunday",mon:"Monday",tue:"Tuesday",wed:"Wednesday",thu:"Thursday",fri:"Friday",sat:"Saturday"},months:{jan:"Jan",feb:"Feb",mar:"Mar",apr:"Apr",may:"May",jun:"Jun",jul:"Jul",aug:"Aug",sep:"Sep",oct:"Oct",nov:"Nov",dec:"Dec"}},inputNumber:{decrease:"decrease number",increase:"increase number"},select:{loading:"Loading",noMatch:"No matching data",noData:"No data",placeholder:"Select"},mention:{loading:"Loading"},dropdown:{toggleDropdown:"Toggle Dropdown"},cascader:{noMatch:"No matching data",loading:"Loading",placeholder:"Select",noData:"No data"},pagination:{goto:"Go to",pagesize:"/page",total:"Total {total}",pageClassifier:"",page:"Page",prev:"Go to previous page",next:"Go to next page",currentPage:"page {pager}",prevPages:"Previous {pager} pages",nextPages:"Next {pager} pages",deprecationWarning:"Deprecated usages detected, please refer to the el-pagination documentation for more details"},dialog:{close:"Close this dialog"},drawer:{close:"Close this dialog"},messagebox:{title:"Message",confirm:"OK",cancel:"Cancel",error:"Illegal input",close:"Close this dialog"},upload:{deleteTip:"press delete to remove",delete:"Delete",preview:"Preview",continue:"Continue"},slider:{defaultLabel:"slider between {min} and {max}",defaultRangeStartLabel:"pick start value",defaultRangeEndLabel:"pick end value"},table:{emptyText:"No Data",confirmFilter:"Confirm",resetFilter:"Reset",clearFilter:"All",sumText:"Sum"},tour:{next:"Next",previous:"Previous",finish:"Finish"},tree:{emptyText:"No Data"},transfer:{noMatch:"No matching data",noData:"No data",titles:["List 1","List 2"],filterPlaceholder:"Enter keyword",noCheckedFormat:"{total} items",hasCheckedFormat:"{checked}/{total} checked"},image:{error:"FAILED"},pageHeader:{title:"Back"},popconfirm:{confirmButtonText:"Yes",cancelButtonText:"No"},carousel:{leftArrow:"Carousel arrow left",rightArrow:"Carousel arrow right",indicator:"Carousel switch to index {index}"}}};const c3=i=>(e,t)=>u3(e,t,l.unref(i)),u3=(i,e,t)=>yw(t,i,i).replace(/\{(\w+)\}/g,(n,r)=>{var s;return`${(s=e==null?void 0:e[r])!=null?s:`{${r}}`}`}),d3=i=>{const e=l.computed(()=>l.unref(i).name),t=l.isRef(i)?i:l.ref(i);return{lang:e,locale:t,t:c3(i)}},$0=Symbol("localeContextKey"),h3=i=>{const e=i||l.inject($0,l.ref());return d3(l.computed(()=>e.value||l3))},wc="el",f3="is-",Ds=(i,e,t,n,r)=>{let s=`${i}-${e}`;return t&&(s+=`-${t}`),n&&(s+=`__${n}`),r&&(s+=`--${r}`),s},H0=Symbol("namespaceContextKey"),q0=i=>{const e=i||(l.getCurrentInstance()?l.inject(H0,l.ref(wc)):l.ref(wc));return l.computed(()=>l.unref(e)||wc)},tr=(i,e)=>{const t=q0(e);return{namespace:t,b:(p="")=>Ds(t.value,i,p,"",""),e:p=>p?Ds(t.value,i,"",p,""):"",m:p=>p?Ds(t.value,i,"","",p):"",be:(p,f)=>p&&f?Ds(t.value,i,p,f,""):"",em:(p,f)=>p&&f?Ds(t.value,i,"",p,f):"",bm:(p,f)=>p&&f?Ds(t.value,i,p,"",f):"",bem:(p,f,m)=>p&&f&&m?Ds(t.value,i,p,f,m):"",is:(p,...f)=>{const m=f.length>=1?f[0]:!0;return p&&m?`${f3}${p}`:""},cssVar:p=>{const f={};for(const m in p)p[m]&&(f[`--${t.value}-${m}`]=p[m]);return f},cssVarName:p=>`--${t.value}-${p}`,cssVarBlock:p=>{const f={};for(const m in p)p[m]&&(f[`--${t.value}-${i}-${m}`]=p[m]);return f},cssVarBlockName:p=>`--${t.value}-${i}-${p}`}},p3=(i,e={})=>{l.isRef(i)||Nw("[useLockscreen]","You need to pass a ref param to this function");const t=e.ns||tr("popup"),n=l.computed(()=>t.bm("parent","hidden"));if(!zn||P0(document.body,n.value))return;let r=0,s=!1,a="0";const o=()=>{setTimeout(()=>{Rw(document==null?void 0:document.body,n.value),s&&document&&(document.body.style.width=a)},200)};l.watch(i,c=>{if(!c){o();return}s=!P0(document.body,n.value),s&&(a=document.body.style.width),r=Bw(t.namespace.value);const u=document.documentElement.clientHeight<document.body.scrollHeight,d=Lw(document.body,"overflowY");r>0&&(u||d==="scroll")&&s&&(document.body.style.width=`calc(100% - ${r}px)`),Mw(document.body,n.value)}),l.onScopeDispose(()=>o())},z0=i=>{const e=l.getCurrentInstance();return l.computed(()=>{var t,n;return(n=(t=e==null?void 0:e.proxy)==null?void 0:t.$props)==null?void 0:n[i]})},G0=i=>{if(!i)return{onClick:Vo,onMousedown:Vo,onMouseup:Vo};let e=!1,t=!1;return{onClick:a=>{e&&t&&i(a),e=t=!1},onMousedown:a=>{e=a.target===a.currentTarget},onMouseup:a=>{t=a.target===a.currentTarget}}},Dh={prefix:Math.floor(Math.random()*1e4),current:0},m3=Symbol("elIdInjection"),g3=()=>l.getCurrentInstance()?l.inject(m3,Dh):Dh,Ah=i=>{const e=g3();!zn&&e===Dh&&Fi("IdInjection",`Looks like you are using server rendering, you must provide a id provider to ensure the hydration process to be succeed
8
+ usage: app.provide(ID_INJECTION_KEY, {
9
+ prefix: number,
10
+ current: number,
11
+ })`);const t=q0();return l.computed(()=>l.unref(i)||`${t.value}-id-${e.prefix}-${e.current++}`)};let Sa=[];const W0=i=>{const e=i;e.key===xc.esc&&Sa.forEach(t=>t(e))},v3=i=>{l.onMounted(()=>{Sa.length===0&&document.addEventListener("keydown",W0),zn&&Sa.push(i)}),l.onBeforeUnmount(()=>{Sa=Sa.filter(e=>e!==i),Sa.length===0&&zn&&document.removeEventListener("keydown",W0)})},K0={current:0},X0=l.ref(0),Y0=2e3,J0=Symbol("elZIndexContextKey"),Q0=Symbol("zIndexContextKey"),y3=i=>{const e=l.getCurrentInstance()?l.inject(J0,K0):K0,t=i||(l.getCurrentInstance()?l.inject(Q0,void 0):void 0),n=l.computed(()=>{const a=l.unref(t);return ws(a)?a:Y0}),r=l.computed(()=>n.value+X0.value),s=()=>(e.current++,X0.value=e.current,r.value);return!zn&&!l.inject(J0)&&Fi("ZIndexInjection",`Looks like you are using server rendering, you must provide a z-index provider to ensure the hydration process to be succeed
12
+ usage: app.provide(ZINDEX_INJECTION_KEY, { current: 0 })`),{initialZIndex:n,currentZIndex:r,nextZIndex:s}};function b3(i){let e;function t(){if(i.value==null)return;const{selectionStart:r,selectionEnd:s,value:a}=i.value;if(r==null||s==null)return;const o=a.slice(0,Math.max(0,r)),c=a.slice(Math.max(0,s));e={selectionStart:r,selectionEnd:s,value:a,beforeTxt:o,afterTxt:c}}function n(){if(i.value==null||e==null)return;const{value:r}=i.value,{beforeTxt:s,afterTxt:a,selectionStart:o}=e;if(s==null||a==null||o==null)return;let c=r.length;if(r.endsWith(a))c=r.length-a.length;else if(r.startsWith(s))c=s.length;else{const u=s[o-1],d=r.indexOf(u,o-1);d!==-1&&(c=d+1)}i.value.setSelectionRange(c,c)}return[t,n]}const Ih=U0({type:String,values:V0,required:!1}),Z0=Symbol("size"),_3=()=>{const i=l.inject(Z0,{});return l.computed(()=>l.unref(i.size)||"")};function k3(i,{beforeFocus:e,afterFocus:t,beforeBlur:n,afterBlur:r}={}){const s=l.getCurrentInstance(),{emit:a}=s,o=l.shallowRef(),c=l.ref(!1),u=b=>{Yr(e)&&e(b)||c.value||(c.value=!0,a("focus",b),t==null||t())},d=b=>{var v;Yr(n)&&n(b)||b.relatedTarget&&((v=o.value)!=null&&v.contains(b.relatedTarget))||(c.value=!1,a("blur",b),r==null||r())},h=()=>{var b,v;(b=o.value)!=null&&b.contains(document.activeElement)&&o.value!==document.activeElement||(v=i.value)==null||v.focus()};return l.watch(o,b=>{b&&b.setAttribute("tabindex","-1")}),ka(o,"focus",u,!0),ka(o,"blur",d,!0),ka(o,"click",h,!0),process.env.NODE_ENV==="test"&&l.onMounted(()=>{const b=_c(i.value)?i.value:document.querySelector("input,textarea");b&&(ka(b,"focus",u,!0),ka(b,"blur",d,!0))}),{isFocused:c,wrapperRef:o,handleFocus:u,handleBlur:d}}function T3({afterComposition:i,emit:e}){const t=l.ref(!1),n=o=>{e==null||e("compositionstart",o),t.value=!0},r=o=>{var c;e==null||e("compositionupdate",o);const u=(c=o.target)==null?void 0:c.value,d=u[u.length-1]||"";t.value=!n3(d)},s=o=>{e==null||e("compositionend",o),t.value&&(t.value=!1,l.nextTick(()=>i(o)))};return{isComposing:t,handleComposition:o=>{o.type==="compositionend"?s(o):r(o)},handleCompositionStart:n,handleCompositionUpdate:r,handleCompositionEnd:s}}const S3=Symbol("emptyValuesContextKey"),C3=Er({emptyValues:Array,valueOnClear:{type:[String,Number,Boolean,Function],default:void 0,validator:i=>Yr(i)?!i():!i}}),x3=Er({ariaLabel:String,ariaOrientation:{type:String,values:["horizontal","vertical","undefined"]},ariaControls:String}),E3=i=>Iw(x3,i),ev=Symbol(),Dc=l.ref();function Ph(i,e=void 0){const t=l.getCurrentInstance()?l.inject(ev,Dc):Dc;return i?l.computed(()=>{var n,r;return(r=(n=t.value)==null?void 0:n[i])!=null?r:e}):t}function tv(i,e){const t=Ph(),n=tr(i,l.computed(()=>{var o;return((o=t.value)==null?void 0:o.namespace)||wc})),r=h3(l.computed(()=>{var o;return(o=t.value)==null?void 0:o.locale})),s=y3(l.computed(()=>{var o;return((o=t.value)==null?void 0:o.zIndex)||Y0})),a=l.computed(()=>{var o;return l.unref(e)||((o=t.value)==null?void 0:o.size)||""});return nv(l.computed(()=>l.unref(t)||{})),{ns:n,locale:r,zIndex:s,size:a}}const nv=(i,e,t=!1)=>{var n;const r=!!l.getCurrentInstance(),s=r?Ph():void 0,a=(n=void 0)!=null?n:r?l.provide:void 0;if(!a){Fi("provideGlobalConfig","provideGlobalConfig() can only be used inside setup().");return}const o=l.computed(()=>{const c=l.unref(i);return s!=null&&s.value?w3(s.value,c):c});return a(ev,o),a($0,l.computed(()=>o.value.locale)),a(H0,l.computed(()=>o.value.namespace)),a(Q0,l.computed(()=>o.value.zIndex)),a(Z0,{size:l.computed(()=>o.value.size||"")}),a(S3,l.computed(()=>({emptyValues:o.value.emptyValues,valueOnClear:o.value.valueOnClear}))),(t||!Dc.value)&&(Dc.value=o.value),o},w3=(i,e)=>{const t=[...new Set([...D0(i),...D0(e)])],n={};for(const r of t)n[r]=e[r]!==void 0?e[r]:i[r];return n},D3=Er({a11y:{type:Boolean,default:!0},locale:{type:On(Object)},size:Ih,button:{type:On(Object)},experimentalFeatures:{type:On(Object)},keyboardNavigation:{type:Boolean,default:!0},message:{type:On(Object)},zIndex:Number,namespace:{type:String,default:"el"},...C3}),Nh={};l.defineComponent({name:"ElConfigProvider",props:D3,setup(i,{slots:e}){l.watch(()=>i.message,n=>{Object.assign(Nh,n??{})},{immediate:!0,deep:!0});const t=nv(i);return()=>l.renderSlot(e,"default",{config:t==null?void 0:t.value})}});var Qr=(i,e)=>{const t=i.__vccOpts||i;for(const[n,r]of e)t[n]=r;return t};const A3=Er({size:{type:On([Number,String])},color:{type:String}}),I3=l.defineComponent({name:"ElIcon",inheritAttrs:!1}),P3=l.defineComponent({...I3,props:A3,setup(i){const e=i,t=tr("icon"),n=l.computed(()=>{const{size:r,color:s}=e;return!r&&!s?{}:{fontSize:w0(r)?void 0:zo(r),"--color":s}});return(r,s)=>(l.openBlock(),l.createElementBlock("i",l.mergeProps({class:l.unref(t).b(),style:l.unref(n)},r.$attrs),[l.renderSlot(r.$slots,"default")],16))}});var N3=Qr(P3,[["__file","icon.vue"]]);const nr=Cc(N3),Oh=Symbol("formContextKey"),iv=Symbol("formItemContextKey"),rv=(i,e={})=>{const t=l.ref(void 0),n=e.prop?t:z0("size"),r=e.global?t:_3(),s=e.form?{size:void 0}:l.inject(Oh,void 0),a=e.formItem?{size:void 0}:l.inject(iv,void 0);return l.computed(()=>n.value||l.unref(i)||(a==null?void 0:a.size)||(s==null?void 0:s.size)||r.value||"")},Mh=i=>{const e=z0("disabled"),t=l.inject(Oh,void 0);return l.computed(()=>e.value||l.unref(i)||(t==null?void 0:t.disabled)||!1)},sv=()=>{const i=l.inject(Oh,void 0),e=l.inject(iv,void 0);return{form:i,formItem:e}},O3=(i,{formItemContext:e,disableIdGeneration:t,disableIdManagement:n})=>{t||(t=l.ref(!1)),n||(n=l.ref(!1));const r=l.ref();let s;const a=l.computed(()=>{var o;return!!(!(i.label||i.ariaLabel)&&e&&e.inputIds&&((o=e.inputIds)==null?void 0:o.length)<=1)});return l.onMounted(()=>{s=l.watch([l.toRef(i,"id"),t],([o,c])=>{const u=o??(c?void 0:Ah().value);u!==r.value&&(e!=null&&e.removeInputId&&(r.value&&e.removeInputId(r.value),!(n!=null&&n.value)&&!c&&u&&e.addInputId(u)),r.value=u)},{immediate:!0})}),l.onUnmounted(()=>{s&&s(),e!=null&&e.removeInputId&&r.value&&e.removeInputId(r.value)}),{isLabeledByFormItem:a,inputId:r}};let Vi;const M3=`
13
+ height:0 !important;
14
+ visibility:hidden !important;
15
+ ${Rx()?"":"overflow:hidden !important;"}
16
+ position:absolute !important;
17
+ z-index:-1000 !important;
18
+ top:0 !important;
19
+ right:0 !important;
20
+ `,R3=["letter-spacing","line-height","padding-top","padding-bottom","font-family","font-weight","font-size","text-rendering","text-transform","width","text-indent","padding-left","padding-right","border-width","box-sizing"];function L3(i){const e=window.getComputedStyle(i),t=e.getPropertyValue("box-sizing"),n=Number.parseFloat(e.getPropertyValue("padding-bottom"))+Number.parseFloat(e.getPropertyValue("padding-top")),r=Number.parseFloat(e.getPropertyValue("border-bottom-width"))+Number.parseFloat(e.getPropertyValue("border-top-width"));return{contextStyle:R3.map(a=>`${a}:${e.getPropertyValue(a)}`).join(";"),paddingSize:n,borderSize:r,boxSizing:t}}function av(i,e=1,t){var n;Vi||(Vi=document.createElement("textarea"),document.body.appendChild(Vi));const{paddingSize:r,borderSize:s,boxSizing:a,contextStyle:o}=L3(i);Vi.setAttribute("style",`${o};${M3}`),Vi.value=i.value||i.placeholder||"";let c=Vi.scrollHeight;const u={};a==="border-box"?c=c+s:a==="content-box"&&(c=c-r),Vi.value="";const d=Vi.scrollHeight-r;if(ws(e)){let h=d*e;a==="border-box"&&(h=h+r+s),c=Math.max(h,c),u.minHeight=`${h}px`}if(ws(t)){let h=d*t;a==="border-box"&&(h=h+r+s),c=Math.min(h,c)}return u.height=`${c}px`,(n=Vi.parentNode)==null||n.removeChild(Vi),Vi=void 0,u}const B3=Er({id:{type:String,default:void 0},size:Ih,disabled:Boolean,modelValue:{type:On([String,Number,Object]),default:""},maxlength:{type:[String,Number]},minlength:{type:[String,Number]},type:{type:String,default:"text"},resize:{type:String,values:["none","both","horizontal","vertical"]},autosize:{type:On([Boolean,Object]),default:!1},autocomplete:{type:String,default:"off"},formatter:{type:Function},parser:{type:Function},placeholder:{type:String},form:{type:String},readonly:Boolean,clearable:Boolean,showPassword:Boolean,showWordLimit:Boolean,suffixIcon:{type:Go},prefixIcon:{type:Go},containerRole:{type:String,default:void 0},tabindex:{type:[String,Number],default:0},validateEvent:{type:Boolean,default:!0},inputStyle:{type:On([Object,Array,String]),default:()=>j0({})},autofocus:Boolean,rows:{type:Number,default:2},...E3(["ariaLabel"])}),U3={[wh]:i=>Ui(i),input:i=>Ui(i),change:i=>Ui(i),focus:i=>i instanceof FocusEvent,blur:i=>i instanceof FocusEvent,clear:()=>!0,mouseleave:i=>i instanceof MouseEvent,mouseenter:i=>i instanceof MouseEvent,keydown:i=>i instanceof Event,compositionstart:i=>i instanceof CompositionEvent,compositionupdate:i=>i instanceof CompositionEvent,compositionend:i=>i instanceof CompositionEvent},F3=l.defineComponent({name:"ElInput",inheritAttrs:!1}),V3=l.defineComponent({...F3,props:B3,emits:U3,setup(i,{expose:e,emit:t}){const n=i,r=l.useAttrs(),s=l.useSlots(),a=l.computed(()=>{const _e={};return n.containerRole==="combobox"&&(_e["aria-haspopup"]=r["aria-haspopup"],_e["aria-owns"]=r["aria-owns"],_e["aria-expanded"]=r["aria-expanded"]),_e}),o=l.computed(()=>[n.type==="textarea"?f.b():p.b(),p.m(v.value),p.is("disabled",y.value),p.is("exceed",W.value),{[p.b("group")]:s.prepend||s.append,[p.m("prefix")]:s.prefix||n.prefixIcon,[p.m("suffix")]:s.suffix||n.suffixIcon||n.clearable||n.showPassword,[p.bm("suffix","password-clear")]:L.value&&$.value,[p.b("hidden")]:n.type==="hidden"},r.class]),c=l.computed(()=>[p.e("wrapper"),p.is("focus",S.value)]),u=s3({excludeKeys:l.computed(()=>Object.keys(a.value))}),{form:d,formItem:h}=sv(),{inputId:b}=O3(n,{formItemContext:h}),v=rv(),y=Mh(),p=tr("input"),f=tr("textarea"),m=l.shallowRef(),_=l.shallowRef(),k=l.ref(!1),D=l.ref(!1),w=l.ref(),A=l.shallowRef(n.inputStyle),x=l.computed(()=>m.value||_.value),{wrapperRef:P,isFocused:S}=k3(x,{afterBlur(){var _e;n.validateEvent&&((_e=h==null?void 0:h.validate)==null||_e.call(h,"blur").catch(Re=>Fi(Re)))}}),M=l.computed(()=>{var _e;return(_e=d==null?void 0:d.statusIcon)!=null?_e:!1}),U=l.computed(()=>(h==null?void 0:h.validateState)||""),B=l.computed(()=>U.value&&Qw[U.value]),Q=l.computed(()=>D.value?Xw:qw),ie=l.computed(()=>[r.style]),Y=l.computed(()=>[n.inputStyle,A.value,{resize:n.resize}]),q=l.computed(()=>E0(n.modelValue)?"":String(n.modelValue)),L=l.computed(()=>n.clearable&&!y.value&&!n.readonly&&!!q.value&&(S.value||k.value)),$=l.computed(()=>n.showPassword&&!y.value&&!n.readonly&&!!q.value&&(!!q.value||S.value)),H=l.computed(()=>n.showWordLimit&&!!n.maxlength&&(n.type==="text"||n.type==="textarea")&&!y.value&&!n.readonly&&!n.showPassword),j=l.computed(()=>q.value.length),W=l.computed(()=>!!H.value&&j.value>Number(n.maxlength)),ae=l.computed(()=>!!s.suffix||!!n.suffixIcon||L.value||n.showPassword||H.value||!!U.value&&M.value),[Ee,Ae]=b3(m);o0(_,_e=>{if(xe(),!H.value||n.resize!=="both")return;const Re=_e[0],{width:Ie}=Re.contentRect;w.value={right:`calc(100% - ${Ie+15+6}px)`}});const ee=()=>{const{type:_e,autosize:Re}=n;if(!(!zn||_e!=="textarea"||!_.value))if(Re){const Ie=jo(Re)?Re.minRows:void 0,it=jo(Re)?Re.maxRows:void 0,_t=av(_.value,Ie,it);A.value={overflowY:"hidden",..._t},l.nextTick(()=>{_.value.offsetHeight,A.value=_t})}else A.value={minHeight:av(_.value).minHeight}},xe=(_e=>{let Re=!1;return()=>{var Ie;if(Re||!n.autosize)return;((Ie=_.value)==null?void 0:Ie.offsetParent)===null||(_e(),Re=!0)}})(ee),Ne=()=>{const _e=x.value,Re=n.formatter?n.formatter(q.value):q.value;!_e||_e.value===Re||(_e.value=Re)},He=async _e=>{Ee();let{value:Re}=_e.target;if(n.formatter&&(Re=n.parser?n.parser(Re):Re),!be.value){if(Re===q.value){Ne();return}t(wh,Re),t("input",Re),await l.nextTick(),Ne(),Ae()}},Be=_e=>{t("change",_e.target.value)},{isComposing:be,handleCompositionStart:Fe,handleCompositionUpdate:le,handleCompositionEnd:ze}=T3({emit:t,afterComposition:He}),oe=()=>{D.value=!D.value,de()},de=async()=>{var _e;await l.nextTick(),(_e=x.value)==null||_e.focus()},Le=()=>{var _e;return(_e=x.value)==null?void 0:_e.blur()},Ve=_e=>{k.value=!1,t("mouseleave",_e)},Ke=_e=>{k.value=!0,t("mouseenter",_e)},Ge=_e=>{t("keydown",_e)},ke=()=>{var _e;(_e=x.value)==null||_e.select()},$e=()=>{t(wh,""),t("change",""),t("clear"),t("input","")};return l.watch(()=>n.modelValue,()=>{var _e;l.nextTick(()=>ee()),n.validateEvent&&((_e=h==null?void 0:h.validate)==null||_e.call(h,"change").catch(Re=>Fi(Re)))}),l.watch(q,()=>Ne()),l.watch(()=>n.type,async()=>{await l.nextTick(),Ne(),ee()}),l.onMounted(()=>{!n.formatter&&n.parser&&Fi("ElInput","If you set the parser, you also need to set the formatter."),Ne(),l.nextTick(ee)}),e({input:m,textarea:_,ref:x,textareaStyle:Y,autosize:l.toRef(n,"autosize"),isComposing:be,focus:de,blur:Le,select:ke,clear:$e,resizeTextarea:ee}),(_e,Re)=>(l.openBlock(),l.createElementBlock("div",l.mergeProps(l.unref(a),{class:[l.unref(o),{[l.unref(p).bm("group","append")]:_e.$slots.append,[l.unref(p).bm("group","prepend")]:_e.$slots.prepend}],style:l.unref(ie),role:_e.containerRole,onMouseenter:Ke,onMouseleave:Ve}),[l.createCommentVNode(" input "),_e.type!=="textarea"?(l.openBlock(),l.createElementBlock(l.Fragment,{key:0},[l.createCommentVNode(" prepend slot "),_e.$slots.prepend?(l.openBlock(),l.createElementBlock("div",{key:0,class:l.normalizeClass(l.unref(p).be("group","prepend"))},[l.renderSlot(_e.$slots,"prepend")],2)):l.createCommentVNode("v-if",!0),l.createElementVNode("div",{ref_key:"wrapperRef",ref:P,class:l.normalizeClass(l.unref(c))},[l.createCommentVNode(" prefix slot "),_e.$slots.prefix||_e.prefixIcon?(l.openBlock(),l.createElementBlock("span",{key:0,class:l.normalizeClass(l.unref(p).e("prefix"))},[l.createElementVNode("span",{class:l.normalizeClass(l.unref(p).e("prefix-inner"))},[l.renderSlot(_e.$slots,"prefix"),_e.prefixIcon?(l.openBlock(),l.createBlock(l.unref(nr),{key:0,class:l.normalizeClass(l.unref(p).e("icon"))},{default:l.withCtx(()=>[(l.openBlock(),l.createBlock(l.resolveDynamicComponent(_e.prefixIcon)))]),_:1},8,["class"])):l.createCommentVNode("v-if",!0)],2)],2)):l.createCommentVNode("v-if",!0),l.createElementVNode("input",l.mergeProps({id:l.unref(b),ref_key:"input",ref:m,class:l.unref(p).e("inner")},l.unref(u),{minlength:_e.minlength,maxlength:_e.maxlength,type:_e.showPassword?D.value?"text":"password":_e.type,disabled:l.unref(y),readonly:_e.readonly,autocomplete:_e.autocomplete,tabindex:_e.tabindex,"aria-label":_e.ariaLabel,placeholder:_e.placeholder,style:_e.inputStyle,form:_e.form,autofocus:_e.autofocus,onCompositionstart:l.unref(Fe),onCompositionupdate:l.unref(le),onCompositionend:l.unref(ze),onInput:He,onChange:Be,onKeydown:Ge}),null,16,["id","minlength","maxlength","type","disabled","readonly","autocomplete","tabindex","aria-label","placeholder","form","autofocus","onCompositionstart","onCompositionupdate","onCompositionend"]),l.createCommentVNode(" suffix slot "),l.unref(ae)?(l.openBlock(),l.createElementBlock("span",{key:1,class:l.normalizeClass(l.unref(p).e("suffix"))},[l.createElementVNode("span",{class:l.normalizeClass(l.unref(p).e("suffix-inner"))},[!l.unref(L)||!l.unref($)||!l.unref(H)?(l.openBlock(),l.createElementBlock(l.Fragment,{key:0},[l.renderSlot(_e.$slots,"suffix"),_e.suffixIcon?(l.openBlock(),l.createBlock(l.unref(nr),{key:0,class:l.normalizeClass(l.unref(p).e("icon"))},{default:l.withCtx(()=>[(l.openBlock(),l.createBlock(l.resolveDynamicComponent(_e.suffixIcon)))]),_:1},8,["class"])):l.createCommentVNode("v-if",!0)],64)):l.createCommentVNode("v-if",!0),l.unref(L)?(l.openBlock(),l.createBlock(l.unref(nr),{key:1,class:l.normalizeClass([l.unref(p).e("icon"),l.unref(p).e("clear")]),onMousedown:l.withModifiers(l.unref(Vo),["prevent"]),onClick:$e},{default:l.withCtx(()=>[l.createVNode(l.unref(O0))]),_:1},8,["class","onMousedown"])):l.createCommentVNode("v-if",!0),l.unref($)?(l.openBlock(),l.createBlock(l.unref(nr),{key:2,class:l.normalizeClass([l.unref(p).e("icon"),l.unref(p).e("password")]),onClick:oe},{default:l.withCtx(()=>[(l.openBlock(),l.createBlock(l.resolveDynamicComponent(l.unref(Q))))]),_:1},8,["class"])):l.createCommentVNode("v-if",!0),l.unref(H)?(l.openBlock(),l.createElementBlock("span",{key:3,class:l.normalizeClass(l.unref(p).e("count"))},[l.createElementVNode("span",{class:l.normalizeClass(l.unref(p).e("count-inner"))},l.toDisplayString(l.unref(j))+" / "+l.toDisplayString(_e.maxlength),3)],2)):l.createCommentVNode("v-if",!0),l.unref(U)&&l.unref(B)&&l.unref(M)?(l.openBlock(),l.createBlock(l.unref(nr),{key:4,class:l.normalizeClass([l.unref(p).e("icon"),l.unref(p).e("validateIcon"),l.unref(p).is("loading",l.unref(U)==="validating")])},{default:l.withCtx(()=>[(l.openBlock(),l.createBlock(l.resolveDynamicComponent(l.unref(B))))]),_:1},8,["class"])):l.createCommentVNode("v-if",!0)],2)],2)):l.createCommentVNode("v-if",!0)],2),l.createCommentVNode(" append slot "),_e.$slots.append?(l.openBlock(),l.createElementBlock("div",{key:1,class:l.normalizeClass(l.unref(p).be("group","append"))},[l.renderSlot(_e.$slots,"append")],2)):l.createCommentVNode("v-if",!0)],64)):(l.openBlock(),l.createElementBlock(l.Fragment,{key:1},[l.createCommentVNode(" textarea "),l.createElementVNode("textarea",l.mergeProps({id:l.unref(b),ref_key:"textarea",ref:_,class:[l.unref(f).e("inner"),l.unref(p).is("focus",l.unref(S))]},l.unref(u),{minlength:_e.minlength,maxlength:_e.maxlength,tabindex:_e.tabindex,disabled:l.unref(y),readonly:_e.readonly,autocomplete:_e.autocomplete,style:l.unref(Y),"aria-label":_e.ariaLabel,placeholder:_e.placeholder,form:_e.form,autofocus:_e.autofocus,rows:_e.rows,onCompositionstart:l.unref(Fe),onCompositionupdate:l.unref(le),onCompositionend:l.unref(ze),onInput:He,onChange:Be,onKeydown:Ge}),null,16,["id","minlength","maxlength","tabindex","disabled","readonly","autocomplete","aria-label","placeholder","form","autofocus","rows","onCompositionstart","onCompositionupdate","onCompositionend"]),l.unref(H)?(l.openBlock(),l.createElementBlock("span",{key:0,style:l.normalizeStyle(w.value),class:l.normalizeClass(l.unref(p).e("count"))},l.toDisplayString(l.unref(j))+" / "+l.toDisplayString(_e.maxlength),7)):l.createCommentVNode("v-if",!0)],64))],16,["role"]))}});var j3=Qr(V3,[["__file","input.vue"]]);const $3=Cc(j3),Rh="focus-trap.focus-after-trapped",Lh="focus-trap.focus-after-released",H3="focus-trap.focusout-prevented",ov={cancelable:!0,bubbles:!1},q3={cancelable:!0,bubbles:!1},lv="focusAfterTrapped",cv="focusAfterReleased",z3=Symbol("elFocusTrap"),Bh=l.ref(),Ac=l.ref(0),Uh=l.ref(0);let Ic=0;const uv=i=>{const e=[],t=document.createTreeWalker(i,NodeFilter.SHOW_ELEMENT,{acceptNode:n=>{const r=n.tagName==="INPUT"&&n.type==="hidden";return n.disabled||n.hidden||r?NodeFilter.FILTER_SKIP:n.tabIndex>=0||n===document.activeElement?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;t.nextNode();)e.push(t.currentNode);return e},dv=(i,e)=>{for(const t of i)if(!G3(t,e))return t},G3=(i,e)=>{if(process.env.NODE_ENV==="test")return!1;if(getComputedStyle(i).visibility==="hidden")return!0;for(;i;){if(e&&i===e)return!1;if(getComputedStyle(i).display==="none")return!0;i=i.parentElement}return!1},W3=i=>{const e=uv(i),t=dv(e,i),n=dv(e.reverse(),i);return[t,n]},K3=i=>i instanceof HTMLInputElement&&"select"in i,Zr=(i,e)=>{if(i&&i.focus){const t=document.activeElement;i.focus({preventScroll:!0}),Uh.value=window.performance.now(),i!==t&&K3(i)&&e&&i.select()}};function hv(i,e){const t=[...i],n=i.indexOf(e);return n!==-1&&t.splice(n,1),t}const X3=()=>{let i=[];return{push:n=>{const r=i[0];r&&n!==r&&r.pause(),i=hv(i,n),i.unshift(n)},remove:n=>{var r,s;i=hv(i,n),(s=(r=i[0])==null?void 0:r.resume)==null||s.call(r)}}},Y3=(i,e=!1)=>{const t=document.activeElement;for(const n of i)if(Zr(n,e),document.activeElement!==t)return},fv=X3(),J3=()=>Ac.value>Uh.value,Pc=()=>{Bh.value="pointer",Ac.value=window.performance.now()},pv=()=>{Bh.value="keyboard",Ac.value=window.performance.now()},Q3=()=>(l.onMounted(()=>{Ic===0&&(document.addEventListener("mousedown",Pc),document.addEventListener("touchstart",Pc),document.addEventListener("keydown",pv)),Ic++}),l.onBeforeUnmount(()=>{Ic--,Ic<=0&&(document.removeEventListener("mousedown",Pc),document.removeEventListener("touchstart",Pc),document.removeEventListener("keydown",pv))}),{focusReason:Bh,lastUserFocusTimestamp:Ac,lastAutomatedFocusTimestamp:Uh}),Nc=i=>new CustomEvent(H3,{...q3,detail:i}),Z3=l.defineComponent({name:"ElFocusTrap",inheritAttrs:!1,props:{loop:Boolean,trapped:Boolean,focusTrapEl:Object,focusStartEl:{type:[Object,String],default:"first"}},emits:[lv,cv,"focusin","focusout","focusout-prevented","release-requested"],setup(i,{emit:e}){const t=l.ref();let n,r;const{focusReason:s}=Q3();v3(y=>{i.trapped&&!a.paused&&e("release-requested",y)});const a={paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}},o=y=>{if(!i.loop&&!i.trapped||a.paused)return;const{key:p,altKey:f,ctrlKey:m,metaKey:_,currentTarget:k,shiftKey:D}=y,{loop:w}=i,A=p===xc.tab&&!f&&!m&&!_,x=document.activeElement;if(A&&x){const P=k,[S,M]=W3(P);if(S&&M){if(!D&&x===M){const B=Nc({focusReason:s.value});e("focusout-prevented",B),B.defaultPrevented||(y.preventDefault(),w&&Zr(S,!0))}else if(D&&[S,P].includes(x)){const B=Nc({focusReason:s.value});e("focusout-prevented",B),B.defaultPrevented||(y.preventDefault(),w&&Zr(M,!0))}}else if(x===P){const B=Nc({focusReason:s.value});e("focusout-prevented",B),B.defaultPrevented||y.preventDefault()}}};l.provide(z3,{focusTrapRef:t,onKeydown:o}),l.watch(()=>i.focusTrapEl,y=>{y&&(t.value=y)},{immediate:!0}),l.watch([t],([y],[p])=>{y&&(y.addEventListener("keydown",o),y.addEventListener("focusin",d),y.addEventListener("focusout",h)),p&&(p.removeEventListener("keydown",o),p.removeEventListener("focusin",d),p.removeEventListener("focusout",h))});const c=y=>{e(lv,y)},u=y=>e(cv,y),d=y=>{const p=l.unref(t);if(!p)return;const f=y.target,m=y.relatedTarget,_=f&&p.contains(f);i.trapped||m&&p.contains(m)||(n=m),_&&e("focusin",y),!a.paused&&i.trapped&&(_?r=f:Zr(r,!0))},h=y=>{const p=l.unref(t);if(!(a.paused||!p))if(i.trapped){const f=y.relatedTarget;!E0(f)&&!p.contains(f)&&setTimeout(()=>{if(!a.paused&&i.trapped){const m=Nc({focusReason:s.value});e("focusout-prevented",m),m.defaultPrevented||Zr(r,!0)}},0)}else{const f=y.target;f&&p.contains(f)||e("focusout",y)}};async function b(){await l.nextTick();const y=l.unref(t);if(y){fv.push(a);const p=y.contains(document.activeElement)?n:document.activeElement;if(n=p,!y.contains(p)){const m=new Event(Rh,ov);y.addEventListener(Rh,c),y.dispatchEvent(m),m.defaultPrevented||l.nextTick(()=>{let _=i.focusStartEl;Ui(_)||(Zr(_),document.activeElement!==_&&(_="first")),_==="first"&&Y3(uv(y),!0),(document.activeElement===p||_==="container")&&Zr(y)})}}}function v(){const y=l.unref(t);if(y){y.removeEventListener(Rh,c);const p=new CustomEvent(Lh,{...ov,detail:{focusReason:s.value}});y.addEventListener(Lh,u),y.dispatchEvent(p),!p.defaultPrevented&&(s.value=="keyboard"||!J3()||y.contains(document.activeElement))&&Zr(n??document.body),y.removeEventListener(Lh,u),fv.remove(a)}}return l.onMounted(()=>{i.trapped&&b(),l.watch(()=>i.trapped,y=>{y?b():v()})}),l.onBeforeUnmount(()=>{i.trapped&&v(),t.value&&(t.value.removeEventListener("keydown",o),t.value.removeEventListener("focusin",d),t.value.removeEventListener("focusout",h),t.value=void 0)}),{onKeydown:o}}});function e4(i,e,t,n,r,s){return l.renderSlot(i.$slots,"default",{handleKeydown:i.onKeydown})}var t4=Qr(Z3,[["render",e4],["__file","focus-trap.vue"]]);const n4=Er({value:{type:[String,Number],default:""},max:{type:Number,default:99},isDot:Boolean,hidden:Boolean,type:{type:String,values:["primary","success","warning","info","danger"],default:"danger"},showZero:{type:Boolean,default:!0},color:String,badgeStyle:{type:On([String,Object,Array])},offset:{type:On(Array),default:[0,0]},badgeClass:{type:String}}),i4=l.defineComponent({name:"ElBadge"}),r4=l.defineComponent({...i4,props:n4,setup(i,{expose:e}){const t=i,n=tr("badge"),r=l.computed(()=>t.isDot?"":ws(t.value)&&ws(t.max)?t.max<t.value?`${t.max}+`:t.value===0&&!t.showZero?"":`${t.value}`:`${t.value}`),s=l.computed(()=>{var a,o,c,u,d;return[{backgroundColor:t.color,marginRight:zo(-((o=(a=t.offset)==null?void 0:a[0])!=null?o:0)),marginTop:zo((u=(c=t.offset)==null?void 0:c[1])!=null?u:0)},(d=t.badgeStyle)!=null?d:{}]});return e({content:r}),(a,o)=>(l.openBlock(),l.createElementBlock("div",{class:l.normalizeClass(l.unref(n).b())},[l.renderSlot(a.$slots,"default"),l.createVNode(l.Transition,{name:`${l.unref(n).namespace.value}-zoom-in-center`,persisted:""},{default:l.withCtx(()=>[l.withDirectives(l.createElementVNode("sup",{class:l.normalizeClass([l.unref(n).e("content"),l.unref(n).em("content",a.type),l.unref(n).is("fixed",!!a.$slots.default),l.unref(n).is("dot",a.isDot),a.badgeClass]),style:l.normalizeStyle(l.unref(s)),textContent:l.toDisplayString(l.unref(r))},null,14,["textContent"]),[[l.vShow,!a.hidden&&(l.unref(r)||a.isDot)]])]),_:1},8,["name"])],2))}});var s4=Qr(r4,[["__file","badge.vue"]]);const a4=Cc(s4),mv=Symbol("buttonGroupContextKey"),o4=(i,e)=>{a3({from:"type.text",replacement:"link",version:"3.0.0",scope:"props",ref:"https://element-plus.org/en-US/component/button.html#button-attributes"},l.computed(()=>i.type==="text"));const t=l.inject(mv,void 0),n=Ph("button"),{form:r}=sv(),s=rv(l.computed(()=>t==null?void 0:t.size)),a=Mh(),o=l.ref(),c=l.useSlots(),u=l.computed(()=>i.type||(t==null?void 0:t.type)||""),d=l.computed(()=>{var y,p,f;return(f=(p=i.autoInsertSpace)!=null?p:(y=n.value)==null?void 0:y.autoInsertSpace)!=null?f:!1}),h=l.computed(()=>i.tag==="button"?{ariaDisabled:a.value||i.loading,disabled:a.value||i.loading,autofocus:i.autofocus,type:i.nativeType}:{}),b=l.computed(()=>{var y;const p=(y=c.default)==null?void 0:y.call(c);if(d.value&&(p==null?void 0:p.length)===1){const f=p[0];if((f==null?void 0:f.type)===l.Text){const m=f.children;return new RegExp("^\\p{Unified_Ideograph}{2}$","u").test(m.trim())}}return!1});return{_disabled:a,_size:s,_type:u,_ref:o,_props:h,shouldAddSpace:b,handleClick:y=>{i.nativeType==="reset"&&(r==null||r.resetFields()),e("click",y)}}},Fh=Er({size:Ih,disabled:Boolean,type:{type:String,values:["default","primary","success","warning","info","danger","text",""],default:""},icon:{type:Go},nativeType:{type:String,values:["button","submit","reset"],default:"button"},loading:Boolean,loadingIcon:{type:Go,default:()=>Tc},plain:Boolean,text:Boolean,link:Boolean,bg:Boolean,autofocus:Boolean,round:Boolean,circle:Boolean,color:String,dark:Boolean,autoInsertSpace:{type:Boolean,default:void 0},tag:{type:On([String,Object]),default:"button"}}),l4={click:i=>i instanceof MouseEvent};function En(i,e){c4(i)&&(i="100%");var t=u4(i);return i=e===360?i:Math.min(e,Math.max(0,parseFloat(i))),t&&(i=parseInt(String(i*e),10)/100),Math.abs(i-e)<1e-6?1:(e===360?i=(i<0?i%e+e:i%e)/parseFloat(String(e)):i=i%e/parseFloat(String(e)),i)}function Oc(i){return Math.min(1,Math.max(0,i))}function c4(i){return typeof i=="string"&&i.indexOf(".")!==-1&&parseFloat(i)===1}function u4(i){return typeof i=="string"&&i.indexOf("%")!==-1}function gv(i){return i=parseFloat(i),(isNaN(i)||i<0||i>1)&&(i=1),i}function Mc(i){return i<=1?"".concat(Number(i)*100,"%"):i}function As(i){return i.length===1?"0"+i:String(i)}function d4(i,e,t){return{r:En(i,255)*255,g:En(e,255)*255,b:En(t,255)*255}}function vv(i,e,t){i=En(i,255),e=En(e,255),t=En(t,255);var n=Math.max(i,e,t),r=Math.min(i,e,t),s=0,a=0,o=(n+r)/2;if(n===r)a=0,s=0;else{var c=n-r;switch(a=o>.5?c/(2-n-r):c/(n+r),n){case i:s=(e-t)/c+(e<t?6:0);break;case e:s=(t-i)/c+2;break;case t:s=(i-e)/c+4;break}s/=6}return{h:s,s:a,l:o}}function Vh(i,e,t){return t<0&&(t+=1),t>1&&(t-=1),t<1/6?i+(e-i)*(6*t):t<1/2?e:t<2/3?i+(e-i)*(2/3-t)*6:i}function h4(i,e,t){var n,r,s;if(i=En(i,360),e=En(e,100),t=En(t,100),e===0)r=t,s=t,n=t;else{var a=t<.5?t*(1+e):t+e-t*e,o=2*t-a;n=Vh(o,a,i+1/3),r=Vh(o,a,i),s=Vh(o,a,i-1/3)}return{r:n*255,g:r*255,b:s*255}}function yv(i,e,t){i=En(i,255),e=En(e,255),t=En(t,255);var n=Math.max(i,e,t),r=Math.min(i,e,t),s=0,a=n,o=n-r,c=n===0?0:o/n;if(n===r)s=0;else{switch(n){case i:s=(e-t)/o+(e<t?6:0);break;case e:s=(t-i)/o+2;break;case t:s=(i-e)/o+4;break}s/=6}return{h:s,s:c,v:a}}function f4(i,e,t){i=En(i,360)*6,e=En(e,100),t=En(t,100);var n=Math.floor(i),r=i-n,s=t*(1-e),a=t*(1-r*e),o=t*(1-(1-r)*e),c=n%6,u=[t,a,s,s,o,t][c],d=[o,t,t,a,s,s][c],h=[s,s,o,t,t,a][c];return{r:u*255,g:d*255,b:h*255}}function bv(i,e,t,n){var r=[As(Math.round(i).toString(16)),As(Math.round(e).toString(16)),As(Math.round(t).toString(16))];return n&&r[0].startsWith(r[0].charAt(1))&&r[1].startsWith(r[1].charAt(1))&&r[2].startsWith(r[2].charAt(1))?r[0].charAt(0)+r[1].charAt(0)+r[2].charAt(0):r.join("")}function p4(i,e,t,n,r){var s=[As(Math.round(i).toString(16)),As(Math.round(e).toString(16)),As(Math.round(t).toString(16)),As(m4(n))];return r&&s[0].startsWith(s[0].charAt(1))&&s[1].startsWith(s[1].charAt(1))&&s[2].startsWith(s[2].charAt(1))&&s[3].startsWith(s[3].charAt(1))?s[0].charAt(0)+s[1].charAt(0)+s[2].charAt(0)+s[3].charAt(0):s.join("")}function m4(i){return Math.round(parseFloat(i)*255).toString(16)}function _v(i){return di(i)/255}function di(i){return parseInt(i,16)}function g4(i){return{r:i>>16,g:(i&65280)>>8,b:i&255}}var jh={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",goldenrod:"#daa520",gold:"#ffd700",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavenderblush:"#fff0f5",lavender:"#e6e6fa",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"};function v4(i){var e={r:0,g:0,b:0},t=1,n=null,r=null,s=null,a=!1,o=!1;return typeof i=="string"&&(i=_4(i)),typeof i=="object"&&(wr(i.r)&&wr(i.g)&&wr(i.b)?(e=d4(i.r,i.g,i.b),a=!0,o=String(i.r).substr(-1)==="%"?"prgb":"rgb"):wr(i.h)&&wr(i.s)&&wr(i.v)?(n=Mc(i.s),r=Mc(i.v),e=f4(i.h,n,r),a=!0,o="hsv"):wr(i.h)&&wr(i.s)&&wr(i.l)&&(n=Mc(i.s),s=Mc(i.l),e=h4(i.h,n,s),a=!0,o="hsl"),Object.prototype.hasOwnProperty.call(i,"a")&&(t=i.a)),t=gv(t),{ok:a,format:i.format||o,r:Math.min(255,Math.max(e.r,0)),g:Math.min(255,Math.max(e.g,0)),b:Math.min(255,Math.max(e.b,0)),a:t}}var y4="[-\\+]?\\d+%?",b4="[-\\+]?\\d*\\.\\d+%?",es="(?:".concat(b4,")|(?:").concat(y4,")"),$h="[\\s|\\(]+(".concat(es,")[,|\\s]+(").concat(es,")[,|\\s]+(").concat(es,")\\s*\\)?"),Hh="[\\s|\\(]+(".concat(es,")[,|\\s]+(").concat(es,")[,|\\s]+(").concat(es,")[,|\\s]+(").concat(es,")\\s*\\)?"),ji={CSS_UNIT:new RegExp(es),rgb:new RegExp("rgb"+$h),rgba:new RegExp("rgba"+Hh),hsl:new RegExp("hsl"+$h),hsla:new RegExp("hsla"+Hh),hsv:new RegExp("hsv"+$h),hsva:new RegExp("hsva"+Hh),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/};function _4(i){if(i=i.trim().toLowerCase(),i.length===0)return!1;var e=!1;if(jh[i])i=jh[i],e=!0;else if(i==="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var t=ji.rgb.exec(i);return t?{r:t[1],g:t[2],b:t[3]}:(t=ji.rgba.exec(i),t?{r:t[1],g:t[2],b:t[3],a:t[4]}:(t=ji.hsl.exec(i),t?{h:t[1],s:t[2],l:t[3]}:(t=ji.hsla.exec(i),t?{h:t[1],s:t[2],l:t[3],a:t[4]}:(t=ji.hsv.exec(i),t?{h:t[1],s:t[2],v:t[3]}:(t=ji.hsva.exec(i),t?{h:t[1],s:t[2],v:t[3],a:t[4]}:(t=ji.hex8.exec(i),t?{r:di(t[1]),g:di(t[2]),b:di(t[3]),a:_v(t[4]),format:e?"name":"hex8"}:(t=ji.hex6.exec(i),t?{r:di(t[1]),g:di(t[2]),b:di(t[3]),format:e?"name":"hex"}:(t=ji.hex4.exec(i),t?{r:di(t[1]+t[1]),g:di(t[2]+t[2]),b:di(t[3]+t[3]),a:_v(t[4]+t[4]),format:e?"name":"hex8"}:(t=ji.hex3.exec(i),t?{r:di(t[1]+t[1]),g:di(t[2]+t[2]),b:di(t[3]+t[3]),format:e?"name":"hex"}:!1)))))))))}function wr(i){return!!ji.CSS_UNIT.exec(String(i))}var k4=function(){function i(e,t){e===void 0&&(e=""),t===void 0&&(t={});var n;if(e instanceof i)return e;typeof e=="number"&&(e=g4(e)),this.originalInput=e;var r=v4(e);this.originalInput=e,this.r=r.r,this.g=r.g,this.b=r.b,this.a=r.a,this.roundA=Math.round(100*this.a)/100,this.format=(n=t.format)!==null&&n!==void 0?n:r.format,this.gradientType=t.gradientType,this.r<1&&(this.r=Math.round(this.r)),this.g<1&&(this.g=Math.round(this.g)),this.b<1&&(this.b=Math.round(this.b)),this.isValid=r.ok}return i.prototype.isDark=function(){return this.getBrightness()<128},i.prototype.isLight=function(){return!this.isDark()},i.prototype.getBrightness=function(){var e=this.toRgb();return(e.r*299+e.g*587+e.b*114)/1e3},i.prototype.getLuminance=function(){var e=this.toRgb(),t,n,r,s=e.r/255,a=e.g/255,o=e.b/255;return s<=.03928?t=s/12.92:t=Math.pow((s+.055)/1.055,2.4),a<=.03928?n=a/12.92:n=Math.pow((a+.055)/1.055,2.4),o<=.03928?r=o/12.92:r=Math.pow((o+.055)/1.055,2.4),.2126*t+.7152*n+.0722*r},i.prototype.getAlpha=function(){return this.a},i.prototype.setAlpha=function(e){return this.a=gv(e),this.roundA=Math.round(100*this.a)/100,this},i.prototype.isMonochrome=function(){var e=this.toHsl().s;return e===0},i.prototype.toHsv=function(){var e=yv(this.r,this.g,this.b);return{h:e.h*360,s:e.s,v:e.v,a:this.a}},i.prototype.toHsvString=function(){var e=yv(this.r,this.g,this.b),t=Math.round(e.h*360),n=Math.round(e.s*100),r=Math.round(e.v*100);return this.a===1?"hsv(".concat(t,", ").concat(n,"%, ").concat(r,"%)"):"hsva(".concat(t,", ").concat(n,"%, ").concat(r,"%, ").concat(this.roundA,")")},i.prototype.toHsl=function(){var e=vv(this.r,this.g,this.b);return{h:e.h*360,s:e.s,l:e.l,a:this.a}},i.prototype.toHslString=function(){var e=vv(this.r,this.g,this.b),t=Math.round(e.h*360),n=Math.round(e.s*100),r=Math.round(e.l*100);return this.a===1?"hsl(".concat(t,", ").concat(n,"%, ").concat(r,"%)"):"hsla(".concat(t,", ").concat(n,"%, ").concat(r,"%, ").concat(this.roundA,")")},i.prototype.toHex=function(e){return e===void 0&&(e=!1),bv(this.r,this.g,this.b,e)},i.prototype.toHexString=function(e){return e===void 0&&(e=!1),"#"+this.toHex(e)},i.prototype.toHex8=function(e){return e===void 0&&(e=!1),p4(this.r,this.g,this.b,this.a,e)},i.prototype.toHex8String=function(e){return e===void 0&&(e=!1),"#"+this.toHex8(e)},i.prototype.toHexShortString=function(e){return e===void 0&&(e=!1),this.a===1?this.toHexString(e):this.toHex8String(e)},i.prototype.toRgb=function(){return{r:Math.round(this.r),g:Math.round(this.g),b:Math.round(this.b),a:this.a}},i.prototype.toRgbString=function(){var e=Math.round(this.r),t=Math.round(this.g),n=Math.round(this.b);return this.a===1?"rgb(".concat(e,", ").concat(t,", ").concat(n,")"):"rgba(".concat(e,", ").concat(t,", ").concat(n,", ").concat(this.roundA,")")},i.prototype.toPercentageRgb=function(){var e=function(t){return"".concat(Math.round(En(t,255)*100),"%")};return{r:e(this.r),g:e(this.g),b:e(this.b),a:this.a}},i.prototype.toPercentageRgbString=function(){var e=function(t){return Math.round(En(t,255)*100)};return this.a===1?"rgb(".concat(e(this.r),"%, ").concat(e(this.g),"%, ").concat(e(this.b),"%)"):"rgba(".concat(e(this.r),"%, ").concat(e(this.g),"%, ").concat(e(this.b),"%, ").concat(this.roundA,")")},i.prototype.toName=function(){if(this.a===0)return"transparent";if(this.a<1)return!1;for(var e="#"+bv(this.r,this.g,this.b,!1),t=0,n=Object.entries(jh);t<n.length;t++){var r=n[t],s=r[0],a=r[1];if(e===a)return s}return!1},i.prototype.toString=function(e){var t=!!e;e=e??this.format;var n=!1,r=this.a<1&&this.a>=0,s=!t&&r&&(e.startsWith("hex")||e==="name");return s?e==="name"&&this.a===0?this.toName():this.toRgbString():(e==="rgb"&&(n=this.toRgbString()),e==="prgb"&&(n=this.toPercentageRgbString()),(e==="hex"||e==="hex6")&&(n=this.toHexString()),e==="hex3"&&(n=this.toHexString(!0)),e==="hex4"&&(n=this.toHex8String(!0)),e==="hex8"&&(n=this.toHex8String()),e==="name"&&(n=this.toName()),e==="hsl"&&(n=this.toHslString()),e==="hsv"&&(n=this.toHsvString()),n||this.toHexString())},i.prototype.toNumber=function(){return(Math.round(this.r)<<16)+(Math.round(this.g)<<8)+Math.round(this.b)},i.prototype.clone=function(){return new i(this.toString())},i.prototype.lighten=function(e){e===void 0&&(e=10);var t=this.toHsl();return t.l+=e/100,t.l=Oc(t.l),new i(t)},i.prototype.brighten=function(e){e===void 0&&(e=10);var t=this.toRgb();return t.r=Math.max(0,Math.min(255,t.r-Math.round(255*-(e/100)))),t.g=Math.max(0,Math.min(255,t.g-Math.round(255*-(e/100)))),t.b=Math.max(0,Math.min(255,t.b-Math.round(255*-(e/100)))),new i(t)},i.prototype.darken=function(e){e===void 0&&(e=10);var t=this.toHsl();return t.l-=e/100,t.l=Oc(t.l),new i(t)},i.prototype.tint=function(e){return e===void 0&&(e=10),this.mix("white",e)},i.prototype.shade=function(e){return e===void 0&&(e=10),this.mix("black",e)},i.prototype.desaturate=function(e){e===void 0&&(e=10);var t=this.toHsl();return t.s-=e/100,t.s=Oc(t.s),new i(t)},i.prototype.saturate=function(e){e===void 0&&(e=10);var t=this.toHsl();return t.s+=e/100,t.s=Oc(t.s),new i(t)},i.prototype.greyscale=function(){return this.desaturate(100)},i.prototype.spin=function(e){var t=this.toHsl(),n=(t.h+e)%360;return t.h=n<0?360+n:n,new i(t)},i.prototype.mix=function(e,t){t===void 0&&(t=50);var n=this.toRgb(),r=new i(e).toRgb(),s=t/100,a={r:(r.r-n.r)*s+n.r,g:(r.g-n.g)*s+n.g,b:(r.b-n.b)*s+n.b,a:(r.a-n.a)*s+n.a};return new i(a)},i.prototype.analogous=function(e,t){e===void 0&&(e=6),t===void 0&&(t=30);var n=this.toHsl(),r=360/t,s=[this];for(n.h=(n.h-(r*e>>1)+720)%360;--e;)n.h=(n.h+r)%360,s.push(new i(n));return s},i.prototype.complement=function(){var e=this.toHsl();return e.h=(e.h+180)%360,new i(e)},i.prototype.monochromatic=function(e){e===void 0&&(e=6);for(var t=this.toHsv(),n=t.h,r=t.s,s=t.v,a=[],o=1/e;e--;)a.push(new i({h:n,s:r,v:s})),s=(s+o)%1;return a},i.prototype.splitcomplement=function(){var e=this.toHsl(),t=e.h;return[this,new i({h:(t+72)%360,s:e.s,l:e.l}),new i({h:(t+216)%360,s:e.s,l:e.l})]},i.prototype.onBackground=function(e){var t=this.toRgb(),n=new i(e).toRgb(),r=t.a+n.a*(1-t.a);return new i({r:(t.r*t.a+n.r*n.a*(1-t.a))/r,g:(t.g*t.a+n.g*n.a*(1-t.a))/r,b:(t.b*t.a+n.b*n.a*(1-t.a))/r,a:r})},i.prototype.triad=function(){return this.polyad(3)},i.prototype.tetrad=function(){return this.polyad(4)},i.prototype.polyad=function(e){for(var t=this.toHsl(),n=t.h,r=[this],s=360/e,a=1;a<e;a++)r.push(new i({h:(n+a*s)%360,s:t.s,l:t.l}));return r},i.prototype.equals=function(e){return this.toRgbString()===new i(e).toRgbString()},i}();function ts(i,e=20){return i.mix("#141414",e).toString()}function T4(i){const e=Mh(),t=tr("button");return l.computed(()=>{let n={},r=i.color;if(r){const s=r.match(/var\((.*?)\)/);s&&(r=window.getComputedStyle(window.document.documentElement).getPropertyValue(s[1]));const a=new k4(r),o=i.dark?a.tint(20).toString():ts(a,20);if(i.plain)n=t.cssVarBlock({"bg-color":i.dark?ts(a,90):a.tint(90).toString(),"text-color":r,"border-color":i.dark?ts(a,50):a.tint(50).toString(),"hover-text-color":`var(${t.cssVarName("color-white")})`,"hover-bg-color":r,"hover-border-color":r,"active-bg-color":o,"active-text-color":`var(${t.cssVarName("color-white")})`,"active-border-color":o}),e.value&&(n[t.cssVarBlockName("disabled-bg-color")]=i.dark?ts(a,90):a.tint(90).toString(),n[t.cssVarBlockName("disabled-text-color")]=i.dark?ts(a,50):a.tint(50).toString(),n[t.cssVarBlockName("disabled-border-color")]=i.dark?ts(a,80):a.tint(80).toString());else{const c=i.dark?ts(a,30):a.tint(30).toString(),u=a.isDark()?`var(${t.cssVarName("color-white")})`:`var(${t.cssVarName("color-black")})`;if(n=t.cssVarBlock({"bg-color":r,"text-color":u,"border-color":r,"hover-bg-color":c,"hover-text-color":u,"hover-border-color":c,"active-bg-color":o,"active-border-color":o}),e.value){const d=i.dark?ts(a,50):a.tint(50).toString();n[t.cssVarBlockName("disabled-bg-color")]=d,n[t.cssVarBlockName("disabled-text-color")]=i.dark?"rgba(255, 255, 255, 0.5)":`var(${t.cssVarName("color-white")})`,n[t.cssVarBlockName("disabled-border-color")]=d}}}return n})}const S4=l.defineComponent({name:"ElButton"}),C4=l.defineComponent({...S4,props:Fh,emits:l4,setup(i,{expose:e,emit:t}){const n=i,r=T4(n),s=tr("button"),{_ref:a,_size:o,_type:c,_disabled:u,_props:d,shouldAddSpace:h,handleClick:b}=o4(n,t),v=l.computed(()=>[s.b(),s.m(c.value),s.m(o.value),s.is("disabled",u.value),s.is("loading",n.loading),s.is("plain",n.plain),s.is("round",n.round),s.is("circle",n.circle),s.is("text",n.text),s.is("link",n.link),s.is("has-bg",n.bg)]);return e({ref:a,size:o,type:c,disabled:u,shouldAddSpace:h}),(y,p)=>(l.openBlock(),l.createBlock(l.resolveDynamicComponent(y.tag),l.mergeProps({ref_key:"_ref",ref:a},l.unref(d),{class:l.unref(v),style:l.unref(r),onClick:l.unref(b)}),{default:l.withCtx(()=>[y.loading?(l.openBlock(),l.createElementBlock(l.Fragment,{key:0},[y.$slots.loading?l.renderSlot(y.$slots,"loading",{key:0}):(l.openBlock(),l.createBlock(l.unref(nr),{key:1,class:l.normalizeClass(l.unref(s).is("loading"))},{default:l.withCtx(()=>[(l.openBlock(),l.createBlock(l.resolveDynamicComponent(y.loadingIcon)))]),_:1},8,["class"]))],64)):y.icon||y.$slots.icon?(l.openBlock(),l.createBlock(l.unref(nr),{key:1},{default:l.withCtx(()=>[y.icon?(l.openBlock(),l.createBlock(l.resolveDynamicComponent(y.icon),{key:0})):l.renderSlot(y.$slots,"icon",{key:1})]),_:3})):l.createCommentVNode("v-if",!0),y.$slots.default?(l.openBlock(),l.createElementBlock("span",{key:2,class:l.normalizeClass({[l.unref(s).em("text","expand")]:l.unref(h)})},[l.renderSlot(y.$slots,"default")],2)):l.createCommentVNode("v-if",!0)]),_:3},16,["class","style","onClick"]))}});var x4=Qr(C4,[["__file","button.vue"]]);const E4={size:Fh.size,type:Fh.type},w4=l.defineComponent({name:"ElButtonGroup"}),D4=l.defineComponent({...w4,props:E4,setup(i){const e=i;l.provide(mv,l.reactive({size:l.toRef(e,"size"),type:l.toRef(e,"type")}));const t=tr("button");return(n,r)=>(l.openBlock(),l.createElementBlock("div",{class:l.normalizeClass(l.unref(t).b("group"))},[l.renderSlot(n.$slots,"default")],2))}});var kv=Qr(D4,[["__file","button-group.vue"]]);const Rc=Cc(x4,{ButtonGroup:kv});e3(kv);var Lc=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Ca(i){return i&&i.__esModule&&Object.prototype.hasOwnProperty.call(i,"default")?i.default:i}function A4(i){if(i.__esModule)return i;var e=i.default;if(typeof e=="function"){var t=function n(){return this instanceof n?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};t.prototype=e.prototype}else t={};return Object.defineProperty(t,"__esModule",{value:!0}),Object.keys(i).forEach(function(n){var r=Object.getOwnPropertyDescriptor(i,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:function(){return i[n]}})}),t}var Bc={exports:{}},I4=Bc.exports,Tv;function P4(){return Tv||(Tv=1,function(i,e){(function(t,n){i.exports=n()})(I4,function(){var t=1e3,n=6e4,r=36e5,s="millisecond",a="second",o="minute",c="hour",u="day",d="week",h="month",b="quarter",v="year",y="date",p="Invalid Date",f=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,m=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,_={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(ie){var Y=["th","st","nd","rd"],q=ie%100;return"["+ie+(Y[(q-20)%10]||Y[q]||Y[0])+"]"}},k=function(ie,Y,q){var L=String(ie);return!L||L.length>=Y?ie:""+Array(Y+1-L.length).join(q)+ie},D={s:k,z:function(ie){var Y=-ie.utcOffset(),q=Math.abs(Y),L=Math.floor(q/60),$=q%60;return(Y<=0?"+":"-")+k(L,2,"0")+":"+k($,2,"0")},m:function ie(Y,q){if(Y.date()<q.date())return-ie(q,Y);var L=12*(q.year()-Y.year())+(q.month()-Y.month()),$=Y.clone().add(L,h),H=q-$<0,j=Y.clone().add(L+(H?-1:1),h);return+(-(L+(q-$)/(H?$-j:j-$))||0)},a:function(ie){return ie<0?Math.ceil(ie)||0:Math.floor(ie)},p:function(ie){return{M:h,y:v,w:d,d:u,D:y,h:c,m:o,s:a,ms:s,Q:b}[ie]||String(ie||"").toLowerCase().replace(/s$/,"")},u:function(ie){return ie===void 0}},w="en",A={};A[w]=_;var x="$isDayjsObject",P=function(ie){return ie instanceof B||!(!ie||!ie[x])},S=function ie(Y,q,L){var $;if(!Y)return w;if(typeof Y=="string"){var H=Y.toLowerCase();A[H]&&($=H),q&&(A[H]=q,$=H);var j=Y.split("-");if(!$&&j.length>1)return ie(j[0])}else{var W=Y.name;A[W]=Y,$=W}return!L&&$&&(w=$),$||!L&&w},M=function(ie,Y){if(P(ie))return ie.clone();var q=typeof Y=="object"?Y:{};return q.date=ie,q.args=arguments,new B(q)},U=D;U.l=S,U.i=P,U.w=function(ie,Y){return M(ie,{locale:Y.$L,utc:Y.$u,x:Y.$x,$offset:Y.$offset})};var B=function(){function ie(q){this.$L=S(q.locale,null,!0),this.parse(q),this.$x=this.$x||q.x||{},this[x]=!0}var Y=ie.prototype;return Y.parse=function(q){this.$d=function(L){var $=L.date,H=L.utc;if($===null)return new Date(NaN);if(U.u($))return new Date;if($ instanceof Date)return new Date($);if(typeof $=="string"&&!/Z$/i.test($)){var j=$.match(f);if(j){var W=j[2]-1||0,ae=(j[7]||"0").substring(0,3);return H?new Date(Date.UTC(j[1],W,j[3]||1,j[4]||0,j[5]||0,j[6]||0,ae)):new Date(j[1],W,j[3]||1,j[4]||0,j[5]||0,j[6]||0,ae)}}return new Date($)}(q),this.init()},Y.init=function(){var q=this.$d;this.$y=q.getFullYear(),this.$M=q.getMonth(),this.$D=q.getDate(),this.$W=q.getDay(),this.$H=q.getHours(),this.$m=q.getMinutes(),this.$s=q.getSeconds(),this.$ms=q.getMilliseconds()},Y.$utils=function(){return U},Y.isValid=function(){return this.$d.toString()!==p},Y.isSame=function(q,L){var $=M(q);return this.startOf(L)<=$&&$<=this.endOf(L)},Y.isAfter=function(q,L){return M(q)<this.startOf(L)},Y.isBefore=function(q,L){return this.endOf(L)<M(q)},Y.$g=function(q,L,$){return U.u(q)?this[L]:this.set($,q)},Y.unix=function(){return Math.floor(this.valueOf()/1e3)},Y.valueOf=function(){return this.$d.getTime()},Y.startOf=function(q,L){var $=this,H=!!U.u(L)||L,j=U.p(q),W=function(He,Be){var be=U.w($.$u?Date.UTC($.$y,Be,He):new Date($.$y,Be,He),$);return H?be:be.endOf(u)},ae=function(He,Be){return U.w($.toDate()[He].apply($.toDate("s"),(H?[0,0,0,0]:[23,59,59,999]).slice(Be)),$)},Ee=this.$W,Ae=this.$M,ee=this.$D,fe="set"+(this.$u?"UTC":"");switch(j){case v:return H?W(1,0):W(31,11);case h:return H?W(1,Ae):W(0,Ae+1);case d:var xe=this.$locale().weekStart||0,Ne=(Ee<xe?Ee+7:Ee)-xe;return W(H?ee-Ne:ee+(6-Ne),Ae);case u:case y:return ae(fe+"Hours",0);case c:return ae(fe+"Minutes",1);case o:return ae(fe+"Seconds",2);case a:return ae(fe+"Milliseconds",3);default:return this.clone()}},Y.endOf=function(q){return this.startOf(q,!1)},Y.$set=function(q,L){var $,H=U.p(q),j="set"+(this.$u?"UTC":""),W=($={},$[u]=j+"Date",$[y]=j+"Date",$[h]=j+"Month",$[v]=j+"FullYear",$[c]=j+"Hours",$[o]=j+"Minutes",$[a]=j+"Seconds",$[s]=j+"Milliseconds",$)[H],ae=H===u?this.$D+(L-this.$W):L;if(H===h||H===v){var Ee=this.clone().set(y,1);Ee.$d[W](ae),Ee.init(),this.$d=Ee.set(y,Math.min(this.$D,Ee.daysInMonth())).$d}else W&&this.$d[W](ae);return this.init(),this},Y.set=function(q,L){return this.clone().$set(q,L)},Y.get=function(q){return this[U.p(q)]()},Y.add=function(q,L){var $,H=this;q=Number(q);var j=U.p(L),W=function(Ae){var ee=M(H);return U.w(ee.date(ee.date()+Math.round(Ae*q)),H)};if(j===h)return this.set(h,this.$M+q);if(j===v)return this.set(v,this.$y+q);if(j===u)return W(1);if(j===d)return W(7);var ae=($={},$[o]=n,$[c]=r,$[a]=t,$)[j]||1,Ee=this.$d.getTime()+q*ae;return U.w(Ee,this)},Y.subtract=function(q,L){return this.add(-1*q,L)},Y.format=function(q){var L=this,$=this.$locale();if(!this.isValid())return $.invalidDate||p;var H=q||"YYYY-MM-DDTHH:mm:ssZ",j=U.z(this),W=this.$H,ae=this.$m,Ee=this.$M,Ae=$.weekdays,ee=$.months,fe=$.meridiem,xe=function(Be,be,Fe,le){return Be&&(Be[be]||Be(L,H))||Fe[be].slice(0,le)},Ne=function(Be){return U.s(W%12||12,Be,"0")},He=fe||function(Be,be,Fe){var le=Be<12?"AM":"PM";return Fe?le.toLowerCase():le};return H.replace(m,function(Be,be){return be||function(Fe){switch(Fe){case"YY":return String(L.$y).slice(-2);case"YYYY":return U.s(L.$y,4,"0");case"M":return Ee+1;case"MM":return U.s(Ee+1,2,"0");case"MMM":return xe($.monthsShort,Ee,ee,3);case"MMMM":return xe(ee,Ee);case"D":return L.$D;case"DD":return U.s(L.$D,2,"0");case"d":return String(L.$W);case"dd":return xe($.weekdaysMin,L.$W,Ae,2);case"ddd":return xe($.weekdaysShort,L.$W,Ae,3);case"dddd":return Ae[L.$W];case"H":return String(W);case"HH":return U.s(W,2,"0");case"h":return Ne(1);case"hh":return Ne(2);case"a":return He(W,ae,!0);case"A":return He(W,ae,!1);case"m":return String(ae);case"mm":return U.s(ae,2,"0");case"s":return String(L.$s);case"ss":return U.s(L.$s,2,"0");case"SSS":return U.s(L.$ms,3,"0");case"Z":return j}return null}(Be)||j.replace(":","")})},Y.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},Y.diff=function(q,L,$){var H,j=this,W=U.p(L),ae=M(q),Ee=(ae.utcOffset()-this.utcOffset())*n,Ae=this-ae,ee=function(){return U.m(j,ae)};switch(W){case v:H=ee()/12;break;case h:H=ee();break;case b:H=ee()/3;break;case d:H=(Ae-Ee)/6048e5;break;case u:H=(Ae-Ee)/864e5;break;case c:H=Ae/r;break;case o:H=Ae/n;break;case a:H=Ae/t;break;default:H=Ae}return $?H:U.a(H)},Y.daysInMonth=function(){return this.endOf(h).$D},Y.$locale=function(){return A[this.$L]},Y.locale=function(q,L){if(!q)return this.$L;var $=this.clone(),H=S(q,L,!0);return H&&($.$L=H),$},Y.clone=function(){return U.w(this.$d,this)},Y.toDate=function(){return new Date(this.valueOf())},Y.toJSON=function(){return this.isValid()?this.toISOString():null},Y.toISOString=function(){return this.$d.toISOString()},Y.toString=function(){return this.$d.toUTCString()},ie}(),Q=B.prototype;return M.prototype=Q,[["$ms",s],["$s",a],["$m",o],["$H",c],["$W",u],["$M",h],["$y",v],["$D",y]].forEach(function(ie){Q[ie[1]]=function(Y){return this.$g(Y,ie[0],ie[1])}}),M.extend=function(ie,Y){return ie.$i||(ie(Y,B,M),ie.$i=!0),M},M.locale=S,M.isDayjs=P,M.unix=function(ie){return M(1e3*ie)},M.en=A[w],M.Ls=A,M.p={},M})}(Bc)),Bc.exports}var N4=P4();const Zn=Ca(N4),qh="_trap-focus-children",Is=[],Sv=i=>{var e;if(Is.length===0)return;const t=Is[Is.length-1][qh];if(t.length>0&&i.code===xc.tab){if(t.length===1){i.preventDefault(),document.activeElement!==t[0]&&t[0].focus();return}const n=i.shiftKey,r=i.target===t[0],s=i.target===t[t.length-1];if(r&&n&&(i.preventDefault(),t[t.length-1].focus()),s&&!n&&(i.preventDefault(),t[0].focus()),process.env.NODE_ENV==="test"){const a=t.indexOf(i.target);a!==-1&&((e=t[n?a-1:a+1])==null||e.focus())}}},O4={beforeMount(i){i[qh]=e0(i),Is.push(i),Is.length<=1&&document.addEventListener("keydown",Sv)},updated(i){l.nextTick(()=>{i[qh]=e0(i)})},unmounted(){Is.shift(),Is.length===0&&document.removeEventListener("keydown",Sv)}},M4=Er({mask:{type:Boolean,default:!0},customMaskEvent:Boolean,overlayClass:{type:On([String,Array,Object])},zIndex:{type:On([String,Number])}}),R4={click:i=>i instanceof MouseEvent},L4="overlay";var B4=l.defineComponent({name:"ElOverlay",props:M4,emits:R4,setup(i,{slots:e,emit:t}){const n=tr(L4),r=c=>{t("click",c)},{onClick:s,onMousedown:a,onMouseup:o}=G0(i.customMaskEvent?void 0:r);return()=>i.mask?l.createVNode("div",{class:[n.b(),i.overlayClass],style:{zIndex:i.zIndex},onClick:s,onMousedown:a,onMouseup:o},[l.renderSlot(e,"default")],Ec.STYLE|Ec.CLASS|Ec.PROPS,["onClick","onMouseup","onMousedown"]):l.h("div",{class:i.overlayClass,style:{zIndex:i.zIndex,position:"fixed",top:"0px",right:"0px",bottom:"0px",left:"0px"}},[l.renderSlot(e,"default")])}});const U4=B4,Cv=["success","info","warning","error"],Mn=j0({customClass:"",center:!1,dangerouslyUseHTMLString:!1,duration:3e3,icon:void 0,id:"",message:"",onClose:void 0,showClose:!1,type:"info",plain:!1,offset:16,zIndex:0,grouping:!1,repeatNum:1,appendTo:zn?document.body:void 0}),F4=Er({customClass:{type:String,default:Mn.customClass},center:{type:Boolean,default:Mn.center},dangerouslyUseHTMLString:{type:Boolean,default:Mn.dangerouslyUseHTMLString},duration:{type:Number,default:Mn.duration},icon:{type:Go,default:Mn.icon},id:{type:String,default:Mn.id},message:{type:On([String,Object,Function]),default:Mn.message},onClose:{type:On(Function),default:Mn.onClose},showClose:{type:Boolean,default:Mn.showClose},type:{type:String,values:Cv,default:Mn.type},plain:{type:Boolean,default:Mn.plain},offset:{type:Number,default:Mn.offset},zIndex:{type:Number,default:Mn.zIndex},grouping:{type:Boolean,default:Mn.grouping},repeatNum:{type:Number,default:Mn.repeatNum}}),V4={destroy:()=>!0},$i=l.shallowReactive([]),j4=i=>{const e=$i.findIndex(r=>r.id===i),t=$i[e];let n;return e>0&&(n=$i[e-1]),{current:t,prev:n}},$4=i=>{const{prev:e}=j4(i);return e?e.vm.exposed.bottom.value:0},H4=(i,e)=>$i.findIndex(n=>n.id===i)>0?16:e,q4=l.defineComponent({name:"ElMessage"}),z4=l.defineComponent({...q4,props:F4,emits:V4,setup(i,{expose:e}){const t=i,{Close:n}=F0,{ns:r,zIndex:s}=tv("message"),{currentZIndex:a,nextZIndex:o}=s,c=l.ref(),u=l.ref(!1),d=l.ref(0);let h;const b=l.computed(()=>t.type?t.type==="error"?"danger":t.type:"info"),v=l.computed(()=>{const x=t.type;return{[r.bm("icon",x)]:x&&Sc[x]}}),y=l.computed(()=>t.icon||Sc[t.type]||""),p=l.computed(()=>$4(t.id)),f=l.computed(()=>H4(t.id,t.offset)+p.value),m=l.computed(()=>d.value+f.value),_=l.computed(()=>({top:`${f.value}px`,zIndex:a.value}));function k(){t.duration!==0&&({stop:h}=Ex(()=>{w()},t.duration))}function D(){h==null||h()}function w(){u.value=!1}function A({code:x}){x===xc.esc&&w()}return l.onMounted(()=>{k(),o(),u.value=!0}),l.watch(()=>t.repeatNum,()=>{D(),k()}),ka(document,"keydown",A),o0(c,()=>{d.value=c.value.getBoundingClientRect().height}),e({visible:u,bottom:m,close:w}),(x,P)=>(l.openBlock(),l.createBlock(l.Transition,{name:l.unref(r).b("fade"),onBeforeLeave:x.onClose,onAfterLeave:S=>x.$emit("destroy"),persisted:""},{default:l.withCtx(()=>[l.withDirectives(l.createElementVNode("div",{id:x.id,ref_key:"messageRef",ref:c,class:l.normalizeClass([l.unref(r).b(),{[l.unref(r).m(x.type)]:x.type},l.unref(r).is("center",x.center),l.unref(r).is("closable",x.showClose),l.unref(r).is("plain",x.plain),x.customClass]),style:l.normalizeStyle(l.unref(_)),role:"alert",onMouseenter:D,onMouseleave:k},[x.repeatNum>1?(l.openBlock(),l.createBlock(l.unref(a4),{key:0,value:x.repeatNum,type:l.unref(b),class:l.normalizeClass(l.unref(r).e("badge"))},null,8,["value","type","class"])):l.createCommentVNode("v-if",!0),l.unref(y)?(l.openBlock(),l.createBlock(l.unref(nr),{key:1,class:l.normalizeClass([l.unref(r).e("icon"),l.unref(v)])},{default:l.withCtx(()=>[(l.openBlock(),l.createBlock(l.resolveDynamicComponent(l.unref(y))))]),_:1},8,["class"])):l.createCommentVNode("v-if",!0),l.renderSlot(x.$slots,"default",{},()=>[x.dangerouslyUseHTMLString?(l.openBlock(),l.createElementBlock(l.Fragment,{key:1},[l.createCommentVNode(" Caution here, message could've been compromised, never use user's input as message "),l.createElementVNode("p",{class:l.normalizeClass(l.unref(r).e("content")),innerHTML:x.message},null,10,["innerHTML"])],2112)):(l.openBlock(),l.createElementBlock("p",{key:0,class:l.normalizeClass(l.unref(r).e("content"))},l.toDisplayString(x.message),3))]),x.showClose?(l.openBlock(),l.createBlock(l.unref(nr),{key:2,class:l.normalizeClass(l.unref(r).e("closeBtn")),onClick:l.withModifiers(w,["stop"])},{default:l.withCtx(()=>[l.createVNode(l.unref(n))]),_:1},8,["class","onClick"])):l.createCommentVNode("v-if",!0)],46,["id"]),[[l.vShow,u.value]])]),_:3},8,["name","onBeforeLeave","onAfterLeave"]))}});var G4=Qr(z4,[["__file","message.vue"]]);let W4=1;const xv=i=>{const e=!i||Ui(i)||l.isVNode(i)||Yr(i)?{message:i}:i,t={...Mn,...e};if(!t.appendTo)t.appendTo=document.body;else if(Ui(t.appendTo)){let n=document.querySelector(t.appendTo);_c(n)||(Fi("ElMessage","the appendTo option is not an HTMLElement. Falling back to document.body."),n=document.body),t.appendTo=n}return t},K4=i=>{const e=$i.indexOf(i);if(e===-1)return;$i.splice(e,1);const{handler:t}=i;t.close()},X4=({appendTo:i,...e},t)=>{const n=`message_${W4++}`,r=e.onClose,s=document.createElement("div"),a={...e,id:n,onClose:()=>{r==null||r(),K4(d)},onDestroy:()=>{l.render(null,s)}},o=l.createVNode(G4,a,Yr(a.message)||l.isVNode(a.message)?{default:Yr(a.message)?a.message:()=>a.message}:null);o.appContext=t||xa._context,l.render(o,s),i.appendChild(s.firstElementChild);const c=o.component,d={id:n,vnode:o,vm:c,handler:{close:()=>{c.exposed.visible.value=!1}},props:o.component.props};return d},xa=(i={},e)=>{if(!zn)return{close:()=>{}};if(ws(Nh.max)&&$i.length>=Nh.max)return{close:()=>{}};const t=xv(i);if(t.grouping&&$i.length){const r=$i.find(({vnode:s})=>{var a;return((a=s.props)==null?void 0:a.message)===t.message});if(r)return r.props.repeatNum+=1,r.props.type=t.type,r.handler}const n=X4(t,e);return $i.push(n),n.handler};Cv.forEach(i=>{xa[i]=(e={},t)=>{const n=xv(e);return xa({...n,type:i},t)}});function Y4(i){for(const e of $i)(!i||i===e.props.type)&&e.handler.close()}xa.closeAll=Y4,xa._context=null;const Rn=Zw(xa,"$message"),J4=l.defineComponent({name:"ElMessageBox",directives:{TrapFocus:O4},components:{ElButton:Rc,ElFocusTrap:t4,ElInput:$3,ElOverlay:U4,ElIcon:nr,...F0},inheritAttrs:!1,props:{buttonSize:{type:String,validator:t3},modal:{type:Boolean,default:!0},lockScroll:{type:Boolean,default:!0},showClose:{type:Boolean,default:!0},closeOnClickModal:{type:Boolean,default:!0},closeOnPressEscape:{type:Boolean,default:!0},closeOnHashChange:{type:Boolean,default:!0},center:Boolean,draggable:Boolean,overflow:Boolean,roundButton:{default:!1,type:Boolean},container:{type:String,default:"body"},boxType:{type:String,default:""}},emits:["vanish","action"],setup(i,{emit:e}){const{locale:t,zIndex:n,ns:r,size:s}=tv("message-box",l.computed(()=>i.buttonSize)),{t:a}=t,{nextZIndex:o}=n,c=l.ref(!1),u=l.reactive({autofocus:!0,beforeClose:null,callback:null,cancelButtonText:"",cancelButtonClass:"",confirmButtonText:"",confirmButtonClass:"",customClass:"",customStyle:{},dangerouslyUseHTMLString:!1,distinguishCancelAndClose:!1,icon:"",inputPattern:null,inputPlaceholder:"",inputType:"text",inputValue:null,inputValidator:null,inputErrorMessage:"",message:null,modalFade:!0,modalClass:"",showCancelButton:!1,showConfirmButton:!0,type:"",title:void 0,showInput:!1,action:"",confirmButtonLoading:!1,cancelButtonLoading:!1,confirmButtonLoadingIcon:l.markRaw(Tc),cancelButtonLoadingIcon:l.markRaw(Tc),confirmButtonDisabled:!1,editorErrorMessage:"",validateError:!1,zIndex:o()}),d=l.computed(()=>{const q=u.type;return{[r.bm("icon",q)]:q&&Sc[q]}}),h=Ah(),b=Ah(),v=l.computed(()=>u.icon||Sc[u.type]||""),y=l.computed(()=>!!u.message),p=l.ref(),f=l.ref(),m=l.ref(),_=l.ref(),k=l.ref(),D=l.computed(()=>u.confirmButtonClass);l.watch(()=>u.inputValue,async q=>{await l.nextTick(),i.boxType==="prompt"&&q!==null&&B()},{immediate:!0}),l.watch(()=>c.value,q=>{var L,$;q&&(i.boxType!=="prompt"&&(u.autofocus?m.value=($=(L=k.value)==null?void 0:L.$el)!=null?$:p.value:m.value=p.value),u.zIndex=o()),i.boxType==="prompt"&&(q?l.nextTick().then(()=>{var H;_.value&&_.value.$el&&(u.autofocus?m.value=(H=Q())!=null?H:p.value:m.value=p.value)}):(u.editorErrorMessage="",u.validateError=!1))});const w=l.computed(()=>i.draggable),A=l.computed(()=>i.overflow);o3(p,f,w,A),l.onMounted(async()=>{await l.nextTick(),i.closeOnHashChange&&window.addEventListener("hashchange",x)}),l.onBeforeUnmount(()=>{i.closeOnHashChange&&window.removeEventListener("hashchange",x)});function x(){c.value&&(c.value=!1,l.nextTick(()=>{u.action&&e("action",u.action)}))}const P=()=>{i.closeOnClickModal&&U(u.distinguishCancelAndClose?"close":"cancel")},S=G0(P),M=q=>{if(u.inputType!=="textarea")return q.preventDefault(),U("confirm")},U=q=>{var L;i.boxType==="prompt"&&q==="confirm"&&!B()||(u.action=q,u.beforeClose?(L=u.beforeClose)==null||L.call(u,q,u,x):x())},B=()=>{if(i.boxType==="prompt"){const q=u.inputPattern;if(q&&!q.test(u.inputValue||""))return u.editorErrorMessage=u.inputErrorMessage||a("el.messagebox.error"),u.validateError=!0,!1;const L=u.inputValidator;if(typeof L=="function"){const $=L(u.inputValue);if($===!1)return u.editorErrorMessage=u.inputErrorMessage||a("el.messagebox.error"),u.validateError=!0,!1;if(typeof $=="string")return u.editorErrorMessage=$,u.validateError=!0,!1}}return u.editorErrorMessage="",u.validateError=!1,!0},Q=()=>{const q=_.value.$refs;return q.input||q.textarea},ie=()=>{U("close")},Y=()=>{i.closeOnPressEscape&&ie()};return i.lockScroll&&p3(c),{...l.toRefs(u),ns:r,overlayEvent:S,visible:c,hasMessage:y,typeClass:d,contentId:h,inputId:b,btnSize:s,iconComponent:v,confirmButtonClasses:D,rootRef:p,focusStartRef:m,headerRef:f,inputRef:_,confirmRef:k,doClose:x,handleClose:ie,onCloseRequested:Y,handleWrapperClick:P,handleInputEnter:M,handleAction:U,t:a}}});function Q4(i,e,t,n,r,s){const a=l.resolveComponent("el-icon"),o=l.resolveComponent("close"),c=l.resolveComponent("el-input"),u=l.resolveComponent("el-button"),d=l.resolveComponent("el-focus-trap"),h=l.resolveComponent("el-overlay");return l.openBlock(),l.createBlock(l.Transition,{name:"fade-in-linear",onAfterLeave:b=>i.$emit("vanish"),persisted:""},{default:l.withCtx(()=>[l.withDirectives(l.createVNode(h,{"z-index":i.zIndex,"overlay-class":[i.ns.is("message-box"),i.modalClass],mask:i.modal},{default:l.withCtx(()=>[l.createElementVNode("div",{role:"dialog","aria-label":i.title,"aria-modal":"true","aria-describedby":i.showInput?void 0:i.contentId,class:l.normalizeClass(`${i.ns.namespace.value}-overlay-message-box`),onClick:i.overlayEvent.onClick,onMousedown:i.overlayEvent.onMousedown,onMouseup:i.overlayEvent.onMouseup},[l.createVNode(d,{loop:"",trapped:i.visible,"focus-trap-el":i.rootRef,"focus-start-el":i.focusStartRef,onReleaseRequested:i.onCloseRequested},{default:l.withCtx(()=>[l.createElementVNode("div",{ref:"rootRef",class:l.normalizeClass([i.ns.b(),i.customClass,i.ns.is("draggable",i.draggable),{[i.ns.m("center")]:i.center}]),style:l.normalizeStyle(i.customStyle),tabindex:"-1",onClick:l.withModifiers(()=>{},["stop"])},[i.title!==null&&i.title!==void 0?(l.openBlock(),l.createElementBlock("div",{key:0,ref:"headerRef",class:l.normalizeClass([i.ns.e("header"),{"show-close":i.showClose}])},[l.createElementVNode("div",{class:l.normalizeClass(i.ns.e("title"))},[i.iconComponent&&i.center?(l.openBlock(),l.createBlock(a,{key:0,class:l.normalizeClass([i.ns.e("status"),i.typeClass])},{default:l.withCtx(()=>[(l.openBlock(),l.createBlock(l.resolveDynamicComponent(i.iconComponent)))]),_:1},8,["class"])):l.createCommentVNode("v-if",!0),l.createElementVNode("span",null,l.toDisplayString(i.title),1)],2),i.showClose?(l.openBlock(),l.createElementBlock("button",{key:0,type:"button",class:l.normalizeClass(i.ns.e("headerbtn")),"aria-label":i.t("el.messagebox.close"),onClick:b=>i.handleAction(i.distinguishCancelAndClose?"close":"cancel"),onKeydown:l.withKeys(l.withModifiers(b=>i.handleAction(i.distinguishCancelAndClose?"close":"cancel"),["prevent"]),["enter"])},[l.createVNode(a,{class:l.normalizeClass(i.ns.e("close"))},{default:l.withCtx(()=>[l.createVNode(o)]),_:1},8,["class"])],42,["aria-label","onClick","onKeydown"])):l.createCommentVNode("v-if",!0)],2)):l.createCommentVNode("v-if",!0),l.createElementVNode("div",{id:i.contentId,class:l.normalizeClass(i.ns.e("content"))},[l.createElementVNode("div",{class:l.normalizeClass(i.ns.e("container"))},[i.iconComponent&&!i.center&&i.hasMessage?(l.openBlock(),l.createBlock(a,{key:0,class:l.normalizeClass([i.ns.e("status"),i.typeClass])},{default:l.withCtx(()=>[(l.openBlock(),l.createBlock(l.resolveDynamicComponent(i.iconComponent)))]),_:1},8,["class"])):l.createCommentVNode("v-if",!0),i.hasMessage?(l.openBlock(),l.createElementBlock("div",{key:1,class:l.normalizeClass(i.ns.e("message"))},[l.renderSlot(i.$slots,"default",{},()=>[i.dangerouslyUseHTMLString?(l.openBlock(),l.createBlock(l.resolveDynamicComponent(i.showInput?"label":"p"),{key:1,for:i.showInput?i.inputId:void 0,innerHTML:i.message},null,8,["for","innerHTML"])):(l.openBlock(),l.createBlock(l.resolveDynamicComponent(i.showInput?"label":"p"),{key:0,for:i.showInput?i.inputId:void 0},{default:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(i.dangerouslyUseHTMLString?"":i.message),1)]),_:1},8,["for"]))])],2)):l.createCommentVNode("v-if",!0)],2),l.withDirectives(l.createElementVNode("div",{class:l.normalizeClass(i.ns.e("input"))},[l.createVNode(c,{id:i.inputId,ref:"inputRef",modelValue:i.inputValue,"onUpdate:modelValue":b=>i.inputValue=b,type:i.inputType,placeholder:i.inputPlaceholder,"aria-invalid":i.validateError,class:l.normalizeClass({invalid:i.validateError}),onKeydown:l.withKeys(i.handleInputEnter,["enter"])},null,8,["id","modelValue","onUpdate:modelValue","type","placeholder","aria-invalid","class","onKeydown"]),l.createElementVNode("div",{class:l.normalizeClass(i.ns.e("errormsg")),style:l.normalizeStyle({visibility:i.editorErrorMessage?"visible":"hidden"})},l.toDisplayString(i.editorErrorMessage),7)],2),[[l.vShow,i.showInput]])],10,["id"]),l.createElementVNode("div",{class:l.normalizeClass(i.ns.e("btns"))},[i.showCancelButton?(l.openBlock(),l.createBlock(u,{key:0,loading:i.cancelButtonLoading,"loading-icon":i.cancelButtonLoadingIcon,class:l.normalizeClass([i.cancelButtonClass]),round:i.roundButton,size:i.btnSize,onClick:b=>i.handleAction("cancel"),onKeydown:l.withKeys(l.withModifiers(b=>i.handleAction("cancel"),["prevent"]),["enter"])},{default:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(i.cancelButtonText||i.t("el.messagebox.cancel")),1)]),_:1},8,["loading","loading-icon","class","round","size","onClick","onKeydown"])):l.createCommentVNode("v-if",!0),l.withDirectives(l.createVNode(u,{ref:"confirmRef",type:"primary",loading:i.confirmButtonLoading,"loading-icon":i.confirmButtonLoadingIcon,class:l.normalizeClass([i.confirmButtonClasses]),round:i.roundButton,disabled:i.confirmButtonDisabled,size:i.btnSize,onClick:b=>i.handleAction("confirm"),onKeydown:l.withKeys(l.withModifiers(b=>i.handleAction("confirm"),["prevent"]),["enter"])},{default:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(i.confirmButtonText||i.t("el.messagebox.confirm")),1)]),_:1},8,["loading","loading-icon","class","round","disabled","size","onClick","onKeydown"]),[[l.vShow,i.showConfirmButton]])],2)],14,["onClick"])]),_:3},8,["trapped","focus-trap-el","focus-start-el","onReleaseRequested"])],42,["aria-label","aria-describedby","onClick","onMousedown","onMouseup"])]),_:3},8,["z-index","overlay-class","mask"]),[[l.vShow,i.visible]])]),_:3},8,["onAfterLeave"])}var Z4=Qr(J4,[["render",Q4],["__file","index.vue"]]);const Wo=new Map,e5=i=>{let e=document.body;return i.appendTo&&(Ui(i.appendTo)&&(e=document.querySelector(i.appendTo)),_c(i.appendTo)&&(e=i.appendTo),_c(e)||(Fi("ElMessageBox","the appendTo option is not an HTMLElement. Falling back to document.body."),e=document.body)),e},t5=(i,e,t=null)=>{const n=l.createVNode(Z4,i,Yr(i.message)||l.isVNode(i.message)?{default:Yr(i.message)?i.message:()=>i.message}:null);return n.appContext=t,l.render(n,e),e5(i).appendChild(e.firstElementChild),n.component},n5=()=>document.createElement("div"),i5=(i,e)=>{const t=n5();i.onVanish=()=>{l.render(null,t),Wo.delete(r)},i.onAction=s=>{const a=Wo.get(r);let o;i.showInput?o={value:r.inputValue,action:s}:o=s,i.callback?i.callback(o,n.proxy):s==="cancel"||s==="close"?i.distinguishCancelAndClose&&s!=="cancel"?a.reject("close"):a.reject("cancel"):a.resolve(o)};const n=t5(i,t,e),r=n.proxy;for(const s in i)pc(i,s)&&!pc(r.$props,s)&&(r[s]=i[s]);return r.visible=!0,r};function Ea(i,e=null){if(!zn)return Promise.reject();let t;return Ui(i)||l.isVNode(i)?i={message:i}:t=i.callback,new Promise((n,r)=>{const s=i5(i,e??Ea._context);Wo.set(s,{options:i,callback:t,resolve:n,reject:r})})}const r5=["alert","confirm","prompt"],s5={alert:{closeOnPressEscape:!1,closeOnClickModal:!1},confirm:{showCancelButton:!0},prompt:{showCancelButton:!0,showInput:!0}};r5.forEach(i=>{Ea[i]=a5(i)});function a5(i){return(e,t,n,r)=>{let s="";return jo(t)?(n=t,s=""):w0(t)?s="":s=t,Ea(Object.assign({title:s,message:e,type:"",...s5[i]},n,{boxType:i}),r)}}Ea.close=()=>{Wo.forEach((i,e)=>{e.doClose()}),Wo.clear()},Ea._context=null;const ns=Ea;ns.install=i=>{ns._context=i._context,i.config.globalProperties.$msgbox=ns,i.config.globalProperties.$messageBox=ns,i.config.globalProperties.$alert=ns.alert,i.config.globalProperties.$confirm=ns.confirm,i.config.globalProperties.$prompt=ns.prompt};const Ev=ns;class _n{constructor(){}success(e){Rn({type:"success",...e})}error(e){Rn({type:"error",...e})}warning(e){Rn({type:"warning",...e})}info(e){Rn({type:"info",...e})}message(e,t){const n=document.getElementsByClassName("el-message")[0];n&&(n==null||n.remove()),Rn({type:e,message:t})}}function o5(i){return{all:i=i||new Map,on:function(e,t){var n=i.get(e);n?n.push(t):i.set(e,[t])},off:function(e,t){var n=i.get(e);n&&(t?n.splice(n.indexOf(t)>>>0,1):i.set(e,[]))},emit:function(e,t){var n=i.get(e);n&&n.slice().map(function(r){r(t)}),(n=i.get("*"))&&n.slice().map(function(r){r(e,t)})}}}const ut=o5();function wv(i,e){return function(){return i.apply(e,arguments)}}const{toString:l5}=Object.prototype,{getPrototypeOf:zh}=Object,Uc=(i=>e=>{const t=l5.call(e);return i[t]||(i[t]=t.slice(8,-1).toLowerCase())})(Object.create(null)),Hi=i=>(i=i.toLowerCase(),e=>Uc(e)===i),Fc=i=>e=>typeof e===i,{isArray:wa}=Array,Ko=Fc("undefined");function c5(i){return i!==null&&!Ko(i)&&i.constructor!==null&&!Ko(i.constructor)&&hi(i.constructor.isBuffer)&&i.constructor.isBuffer(i)}const Dv=Hi("ArrayBuffer");function u5(i){let e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(i):e=i&&i.buffer&&Dv(i.buffer),e}const d5=Fc("string"),hi=Fc("function"),Av=Fc("number"),Vc=i=>i!==null&&typeof i=="object",h5=i=>i===!0||i===!1,jc=i=>{if(Uc(i)!=="object")return!1;const e=zh(i);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in i)&&!(Symbol.iterator in i)},f5=Hi("Date"),p5=Hi("File"),m5=Hi("Blob"),g5=Hi("FileList"),v5=i=>Vc(i)&&hi(i.pipe),y5=i=>{let e;return i&&(typeof FormData=="function"&&i instanceof FormData||hi(i.append)&&((e=Uc(i))==="formdata"||e==="object"&&hi(i.toString)&&i.toString()==="[object FormData]"))},b5=Hi("URLSearchParams"),[_5,k5,T5,S5]=["ReadableStream","Request","Response","Headers"].map(Hi),C5=i=>i.trim?i.trim():i.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Xo(i,e,{allOwnKeys:t=!1}={}){if(i===null||typeof i>"u")return;let n,r;if(typeof i!="object"&&(i=[i]),wa(i))for(n=0,r=i.length;n<r;n++)e.call(null,i[n],n,i);else{const s=t?Object.getOwnPropertyNames(i):Object.keys(i),a=s.length;let o;for(n=0;n<a;n++)o=s[n],e.call(null,i[o],o,i)}}function Iv(i,e){e=e.toLowerCase();const t=Object.keys(i);let n=t.length,r;for(;n-- >0;)if(r=t[n],e===r.toLowerCase())return r;return null}const Ps=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,Pv=i=>!Ko(i)&&i!==Ps;function Gh(){const{caseless:i}=Pv(this)&&this||{},e={},t=(n,r)=>{const s=i&&Iv(e,r)||r;jc(e[s])&&jc(n)?e[s]=Gh(e[s],n):jc(n)?e[s]=Gh({},n):wa(n)?e[s]=n.slice():e[s]=n};for(let n=0,r=arguments.length;n<r;n++)arguments[n]&&Xo(arguments[n],t);return e}const x5=(i,e,t,{allOwnKeys:n}={})=>(Xo(e,(r,s)=>{t&&hi(r)?i[s]=wv(r,t):i[s]=r},{allOwnKeys:n}),i),E5=i=>(i.charCodeAt(0)===65279&&(i=i.slice(1)),i),w5=(i,e,t,n)=>{i.prototype=Object.create(e.prototype,n),i.prototype.constructor=i,Object.defineProperty(i,"super",{value:e.prototype}),t&&Object.assign(i.prototype,t)},D5=(i,e,t,n)=>{let r,s,a;const o={};if(e=e||{},i==null)return e;do{for(r=Object.getOwnPropertyNames(i),s=r.length;s-- >0;)a=r[s],(!n||n(a,i,e))&&!o[a]&&(e[a]=i[a],o[a]=!0);i=t!==!1&&zh(i)}while(i&&(!t||t(i,e))&&i!==Object.prototype);return e},A5=(i,e,t)=>{i=String(i),(t===void 0||t>i.length)&&(t=i.length),t-=e.length;const n=i.indexOf(e,t);return n!==-1&&n===t},I5=i=>{if(!i)return null;if(wa(i))return i;let e=i.length;if(!Av(e))return null;const t=new Array(e);for(;e-- >0;)t[e]=i[e];return t},P5=(i=>e=>i&&e instanceof i)(typeof Uint8Array<"u"&&zh(Uint8Array)),N5=(i,e)=>{const n=(i&&i[Symbol.iterator]).call(i);let r;for(;(r=n.next())&&!r.done;){const s=r.value;e.call(i,s[0],s[1])}},O5=(i,e)=>{let t;const n=[];for(;(t=i.exec(e))!==null;)n.push(t);return n},M5=Hi("HTMLFormElement"),R5=i=>i.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(t,n,r){return n.toUpperCase()+r}),Nv=(({hasOwnProperty:i})=>(e,t)=>i.call(e,t))(Object.prototype),L5=Hi("RegExp"),Ov=(i,e)=>{const t=Object.getOwnPropertyDescriptors(i),n={};Xo(t,(r,s)=>{let a;(a=e(r,s,i))!==!1&&(n[s]=a||r)}),Object.defineProperties(i,n)},B5=i=>{Ov(i,(e,t)=>{if(hi(i)&&["arguments","caller","callee"].indexOf(t)!==-1)return!1;const n=i[t];if(hi(n)){if(e.enumerable=!1,"writable"in e){e.writable=!1;return}e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+t+"'")})}})},U5=(i,e)=>{const t={},n=r=>{r.forEach(s=>{t[s]=!0})};return wa(i)?n(i):n(String(i).split(e)),t},F5=()=>{},V5=(i,e)=>i!=null&&Number.isFinite(i=+i)?i:e,Wh="abcdefghijklmnopqrstuvwxyz",Mv="0123456789",Rv={DIGIT:Mv,ALPHA:Wh,ALPHA_DIGIT:Wh+Wh.toUpperCase()+Mv},j5=(i=16,e=Rv.ALPHA_DIGIT)=>{let t="";const{length:n}=e;for(;i--;)t+=e[Math.random()*n|0];return t};function $5(i){return!!(i&&hi(i.append)&&i[Symbol.toStringTag]==="FormData"&&i[Symbol.iterator])}const H5=i=>{const e=new Array(10),t=(n,r)=>{if(Vc(n)){if(e.indexOf(n)>=0)return;if(!("toJSON"in n)){e[r]=n;const s=wa(n)?[]:{};return Xo(n,(a,o)=>{const c=t(a,r+1);!Ko(c)&&(s[o]=c)}),e[r]=void 0,s}}return n};return t(i,0)},q5=Hi("AsyncFunction"),z5=i=>i&&(Vc(i)||hi(i))&&hi(i.then)&&hi(i.catch),Lv=((i,e)=>i?setImmediate:e?((t,n)=>(Ps.addEventListener("message",({source:r,data:s})=>{r===Ps&&s===t&&n.length&&n.shift()()},!1),r=>{n.push(r),Ps.postMessage(t,"*")}))(`axios@${Math.random()}`,[]):t=>setTimeout(t))(typeof setImmediate=="function",hi(Ps.postMessage)),G5=typeof queueMicrotask<"u"?queueMicrotask.bind(Ps):typeof process<"u"&&process.nextTick||Lv,Se={isArray:wa,isArrayBuffer:Dv,isBuffer:c5,isFormData:y5,isArrayBufferView:u5,isString:d5,isNumber:Av,isBoolean:h5,isObject:Vc,isPlainObject:jc,isReadableStream:_5,isRequest:k5,isResponse:T5,isHeaders:S5,isUndefined:Ko,isDate:f5,isFile:p5,isBlob:m5,isRegExp:L5,isFunction:hi,isStream:v5,isURLSearchParams:b5,isTypedArray:P5,isFileList:g5,forEach:Xo,merge:Gh,extend:x5,trim:C5,stripBOM:E5,inherits:w5,toFlatObject:D5,kindOf:Uc,kindOfTest:Hi,endsWith:A5,toArray:I5,forEachEntry:N5,matchAll:O5,isHTMLForm:M5,hasOwnProperty:Nv,hasOwnProp:Nv,reduceDescriptors:Ov,freezeMethods:B5,toObjectSet:U5,toCamelCase:R5,noop:F5,toFiniteNumber:V5,findKey:Iv,global:Ps,isContextDefined:Pv,ALPHABET:Rv,generateString:j5,isSpecCompliantForm:$5,toJSONObject:H5,isAsyncFn:q5,isThenable:z5,setImmediate:Lv,asap:G5};function vt(i,e,t,n,r){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=i,this.name="AxiosError",e&&(this.code=e),t&&(this.config=t),n&&(this.request=n),r&&(this.response=r,this.status=r.status?r.status:null)}Se.inherits(vt,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:Se.toJSONObject(this.config),code:this.code,status:this.status}}});const Bv=vt.prototype,Uv={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(i=>{Uv[i]={value:i}}),Object.defineProperties(vt,Uv),Object.defineProperty(Bv,"isAxiosError",{value:!0}),vt.from=(i,e,t,n,r,s)=>{const a=Object.create(Bv);return Se.toFlatObject(i,a,function(c){return c!==Error.prototype},o=>o!=="isAxiosError"),vt.call(a,i.message,e,t,n,r),a.cause=i,a.name=i.name,s&&Object.assign(a,s),a};const W5=null;function Kh(i){return Se.isPlainObject(i)||Se.isArray(i)}function Fv(i){return Se.endsWith(i,"[]")?i.slice(0,-2):i}function Vv(i,e,t){return i?i.concat(e).map(function(r,s){return r=Fv(r),!t&&s?"["+r+"]":r}).join(t?".":""):e}function K5(i){return Se.isArray(i)&&!i.some(Kh)}const X5=Se.toFlatObject(Se,{},null,function(e){return/^is[A-Z]/.test(e)});function $c(i,e,t){if(!Se.isObject(i))throw new TypeError("target must be an object");e=e||new FormData,t=Se.toFlatObject(t,{metaTokens:!0,dots:!1,indexes:!1},!1,function(p,f){return!Se.isUndefined(f[p])});const n=t.metaTokens,r=t.visitor||d,s=t.dots,a=t.indexes,c=(t.Blob||typeof Blob<"u"&&Blob)&&Se.isSpecCompliantForm(e);if(!Se.isFunction(r))throw new TypeError("visitor must be a function");function u(y){if(y===null)return"";if(Se.isDate(y))return y.toISOString();if(!c&&Se.isBlob(y))throw new vt("Blob is not supported. Use a Buffer instead.");return Se.isArrayBuffer(y)||Se.isTypedArray(y)?c&&typeof Blob=="function"?new Blob([y]):Buffer.from(y):y}function d(y,p,f){let m=y;if(y&&!f&&typeof y=="object"){if(Se.endsWith(p,"{}"))p=n?p:p.slice(0,-2),y=JSON.stringify(y);else if(Se.isArray(y)&&K5(y)||(Se.isFileList(y)||Se.endsWith(p,"[]"))&&(m=Se.toArray(y)))return p=Fv(p),m.forEach(function(k,D){!(Se.isUndefined(k)||k===null)&&e.append(a===!0?Vv([p],D,s):a===null?p:p+"[]",u(k))}),!1}return Kh(y)?!0:(e.append(Vv(f,p,s),u(y)),!1)}const h=[],b=Object.assign(X5,{defaultVisitor:d,convertValue:u,isVisitable:Kh});function v(y,p){if(!Se.isUndefined(y)){if(h.indexOf(y)!==-1)throw Error("Circular reference detected in "+p.join("."));h.push(y),Se.forEach(y,function(m,_){(!(Se.isUndefined(m)||m===null)&&r.call(e,m,Se.isString(_)?_.trim():_,p,b))===!0&&v(m,p?p.concat(_):[_])}),h.pop()}}if(!Se.isObject(i))throw new TypeError("data must be an object");return v(i),e}function jv(i){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(i).replace(/[!'()~]|%20|%00/g,function(n){return e[n]})}function Xh(i,e){this._pairs=[],i&&$c(i,this,e)}const $v=Xh.prototype;$v.append=function(e,t){this._pairs.push([e,t])},$v.toString=function(e){const t=e?function(n){return e.call(this,n,jv)}:jv;return this._pairs.map(function(r){return t(r[0])+"="+t(r[1])},"").join("&")};function Y5(i){return encodeURIComponent(i).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Hv(i,e,t){if(!e)return i;const n=t&&t.encode||Y5;Se.isFunction(t)&&(t={serialize:t});const r=t&&t.serialize;let s;if(r?s=r(e,t):s=Se.isURLSearchParams(e)?e.toString():new Xh(e,t).toString(n),s){const a=i.indexOf("#");a!==-1&&(i=i.slice(0,a)),i+=(i.indexOf("?")===-1?"?":"&")+s}return i}class qv{constructor(){this.handlers=[]}use(e,t,n){return this.handlers.push({fulfilled:e,rejected:t,synchronous:n?n.synchronous:!1,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){Se.forEach(this.handlers,function(n){n!==null&&e(n)})}}const zv={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},J5={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<"u"?URLSearchParams:Xh,FormData:typeof FormData<"u"?FormData:null,Blob:typeof Blob<"u"?Blob:null},protocols:["http","https","file","blob","url","data"]},Yh=typeof window<"u"&&typeof document<"u",Jh=typeof navigator=="object"&&navigator||void 0,Q5=Yh&&(!Jh||["ReactNative","NativeScript","NS"].indexOf(Jh.product)<0),Z5=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",e8=Yh&&window.location.href||"http://localhost",Ln={...Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:Yh,hasStandardBrowserEnv:Q5,hasStandardBrowserWebWorkerEnv:Z5,navigator:Jh,origin:e8},Symbol.toStringTag,{value:"Module"})),...J5};function t8(i,e){return $c(i,new Ln.classes.URLSearchParams,Object.assign({visitor:function(t,n,r,s){return Ln.isNode&&Se.isBuffer(t)?(this.append(n,t.toString("base64")),!1):s.defaultVisitor.apply(this,arguments)}},e))}function n8(i){return Se.matchAll(/\w+|\[(\w*)]/g,i).map(e=>e[0]==="[]"?"":e[1]||e[0])}function i8(i){const e={},t=Object.keys(i);let n;const r=t.length;let s;for(n=0;n<r;n++)s=t[n],e[s]=i[s];return e}function Gv(i){function e(t,n,r,s){let a=t[s++];if(a==="__proto__")return!0;const o=Number.isFinite(+a),c=s>=t.length;return a=!a&&Se.isArray(r)?r.length:a,c?(Se.hasOwnProp(r,a)?r[a]=[r[a],n]:r[a]=n,!o):((!r[a]||!Se.isObject(r[a]))&&(r[a]=[]),e(t,n,r[a],s)&&Se.isArray(r[a])&&(r[a]=i8(r[a])),!o)}if(Se.isFormData(i)&&Se.isFunction(i.entries)){const t={};return Se.forEachEntry(i,(n,r)=>{e(n8(n),r,t,0)}),t}return null}function r8(i,e,t){if(Se.isString(i))try{return(e||JSON.parse)(i),Se.trim(i)}catch(n){if(n.name!=="SyntaxError")throw n}return(t||JSON.stringify)(i)}const Yo={transitional:zv,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){const n=t.getContentType()||"",r=n.indexOf("application/json")>-1,s=Se.isObject(e);if(s&&Se.isHTMLForm(e)&&(e=new FormData(e)),Se.isFormData(e))return r?JSON.stringify(Gv(e)):e;if(Se.isArrayBuffer(e)||Se.isBuffer(e)||Se.isStream(e)||Se.isFile(e)||Se.isBlob(e)||Se.isReadableStream(e))return e;if(Se.isArrayBufferView(e))return e.buffer;if(Se.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let o;if(s){if(n.indexOf("application/x-www-form-urlencoded")>-1)return t8(e,this.formSerializer).toString();if((o=Se.isFileList(e))||n.indexOf("multipart/form-data")>-1){const c=this.env&&this.env.FormData;return $c(o?{"files[]":e}:e,c&&new c,this.formSerializer)}}return s||r?(t.setContentType("application/json",!1),r8(e)):e}],transformResponse:[function(e){const t=this.transitional||Yo.transitional,n=t&&t.forcedJSONParsing,r=this.responseType==="json";if(Se.isResponse(e)||Se.isReadableStream(e))return e;if(e&&Se.isString(e)&&(n&&!this.responseType||r)){const a=!(t&&t.silentJSONParsing)&&r;try{return JSON.parse(e)}catch(o){if(a)throw o.name==="SyntaxError"?vt.from(o,vt.ERR_BAD_RESPONSE,this,null,this.response):o}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Ln.classes.FormData,Blob:Ln.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};Se.forEach(["delete","get","head","post","put","patch"],i=>{Yo.headers[i]={}});const s8=Se.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),a8=i=>{const e={};let t,n,r;return i&&i.split(`
21
+ `).forEach(function(a){r=a.indexOf(":"),t=a.substring(0,r).trim().toLowerCase(),n=a.substring(r+1).trim(),!(!t||e[t]&&s8[t])&&(t==="set-cookie"?e[t]?e[t].push(n):e[t]=[n]:e[t]=e[t]?e[t]+", "+n:n)}),e},Wv=Symbol("internals");function Jo(i){return i&&String(i).trim().toLowerCase()}function Hc(i){return i===!1||i==null?i:Se.isArray(i)?i.map(Hc):String(i)}function o8(i){const e=Object.create(null),t=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let n;for(;n=t.exec(i);)e[n[1]]=n[2];return e}const l8=i=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(i.trim());function Qh(i,e,t,n,r){if(Se.isFunction(n))return n.call(this,e,t);if(r&&(e=t),!!Se.isString(e)){if(Se.isString(n))return e.indexOf(n)!==-1;if(Se.isRegExp(n))return n.test(e)}}function c8(i){return i.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,t,n)=>t.toUpperCase()+n)}function u8(i,e){const t=Se.toCamelCase(" "+e);["get","set","has"].forEach(n=>{Object.defineProperty(i,n+t,{value:function(r,s,a){return this[n].call(this,e,r,s,a)},configurable:!0})})}let ei=class{constructor(e){e&&this.set(e)}set(e,t,n){const r=this;function s(o,c,u){const d=Jo(c);if(!d)throw new Error("header name must be a non-empty string");const h=Se.findKey(r,d);(!h||r[h]===void 0||u===!0||u===void 0&&r[h]!==!1)&&(r[h||c]=Hc(o))}const a=(o,c)=>Se.forEach(o,(u,d)=>s(u,d,c));if(Se.isPlainObject(e)||e instanceof this.constructor)a(e,t);else if(Se.isString(e)&&(e=e.trim())&&!l8(e))a(a8(e),t);else if(Se.isHeaders(e))for(const[o,c]of e.entries())s(c,o,n);else e!=null&&s(t,e,n);return this}get(e,t){if(e=Jo(e),e){const n=Se.findKey(this,e);if(n){const r=this[n];if(!t)return r;if(t===!0)return o8(r);if(Se.isFunction(t))return t.call(this,r,n);if(Se.isRegExp(t))return t.exec(r);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=Jo(e),e){const n=Se.findKey(this,e);return!!(n&&this[n]!==void 0&&(!t||Qh(this,this[n],n,t)))}return!1}delete(e,t){const n=this;let r=!1;function s(a){if(a=Jo(a),a){const o=Se.findKey(n,a);o&&(!t||Qh(n,n[o],o,t))&&(delete n[o],r=!0)}}return Se.isArray(e)?e.forEach(s):s(e),r}clear(e){const t=Object.keys(this);let n=t.length,r=!1;for(;n--;){const s=t[n];(!e||Qh(this,this[s],s,e,!0))&&(delete this[s],r=!0)}return r}normalize(e){const t=this,n={};return Se.forEach(this,(r,s)=>{const a=Se.findKey(n,s);if(a){t[a]=Hc(r),delete t[s];return}const o=e?c8(s):String(s).trim();o!==s&&delete t[s],t[o]=Hc(r),n[o]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return Se.forEach(this,(n,r)=>{n!=null&&n!==!1&&(t[r]=e&&Se.isArray(n)?n.join(", "):n)}),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,t])=>e+": "+t).join(`
22
+ `)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){const n=new this(e);return t.forEach(r=>n.set(r)),n}static accessor(e){const n=(this[Wv]=this[Wv]={accessors:{}}).accessors,r=this.prototype;function s(a){const o=Jo(a);n[o]||(u8(r,a),n[o]=!0)}return Se.isArray(e)?e.forEach(s):s(e),this}};ei.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),Se.reduceDescriptors(ei.prototype,({value:i},e)=>{let t=e[0].toUpperCase()+e.slice(1);return{get:()=>i,set(n){this[t]=n}}}),Se.freezeMethods(ei);function Zh(i,e){const t=this||Yo,n=e||t,r=ei.from(n.headers);let s=n.data;return Se.forEach(i,function(o){s=o.call(t,s,r.normalize(),e?e.status:void 0)}),r.normalize(),s}function Kv(i){return!!(i&&i.__CANCEL__)}function Da(i,e,t){vt.call(this,i??"canceled",vt.ERR_CANCELED,e,t),this.name="CanceledError"}Se.inherits(Da,vt,{__CANCEL__:!0});function Xv(i,e,t){const n=t.config.validateStatus;!t.status||!n||n(t.status)?i(t):e(new vt("Request failed with status code "+t.status,[vt.ERR_BAD_REQUEST,vt.ERR_BAD_RESPONSE][Math.floor(t.status/100)-4],t.config,t.request,t))}function d8(i){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(i);return e&&e[1]||""}function h8(i,e){i=i||10;const t=new Array(i),n=new Array(i);let r=0,s=0,a;return e=e!==void 0?e:1e3,function(c){const u=Date.now(),d=n[s];a||(a=u),t[r]=c,n[r]=u;let h=s,b=0;for(;h!==r;)b+=t[h++],h=h%i;if(r=(r+1)%i,r===s&&(s=(s+1)%i),u-a<e)return;const v=d&&u-d;return v?Math.round(b*1e3/v):void 0}}function f8(i,e){let t=0,n=1e3/e,r,s;const a=(u,d=Date.now())=>{t=d,r=null,s&&(clearTimeout(s),s=null),i.apply(null,u)};return[(...u)=>{const d=Date.now(),h=d-t;h>=n?a(u,d):(r=u,s||(s=setTimeout(()=>{s=null,a(r)},n-h)))},()=>r&&a(r)]}const qc=(i,e,t=3)=>{let n=0;const r=h8(50,250);return f8(s=>{const a=s.loaded,o=s.lengthComputable?s.total:void 0,c=a-n,u=r(c),d=a<=o;n=a;const h={loaded:a,total:o,progress:o?a/o:void 0,bytes:c,rate:u||void 0,estimated:u&&o&&d?(o-a)/u:void 0,event:s,lengthComputable:o!=null,[e?"download":"upload"]:!0};i(h)},t)},Yv=(i,e)=>{const t=i!=null;return[n=>e[0]({lengthComputable:t,total:i,loaded:n}),e[1]]},Jv=i=>(...e)=>Se.asap(()=>i(...e)),p8=Ln.hasStandardBrowserEnv?((i,e)=>t=>(t=new URL(t,Ln.origin),i.protocol===t.protocol&&i.host===t.host&&(e||i.port===t.port)))(new URL(Ln.origin),Ln.navigator&&/(msie|trident)/i.test(Ln.navigator.userAgent)):()=>!0,m8=Ln.hasStandardBrowserEnv?{write(i,e,t,n,r,s){const a=[i+"="+encodeURIComponent(e)];Se.isNumber(t)&&a.push("expires="+new Date(t).toGMTString()),Se.isString(n)&&a.push("path="+n),Se.isString(r)&&a.push("domain="+r),s===!0&&a.push("secure"),document.cookie=a.join("; ")},read(i){const e=document.cookie.match(new RegExp("(^|;\\s*)("+i+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove(i){this.write(i,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function g8(i){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(i)}function v8(i,e){return e?i.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):i}function Qv(i,e){return i&&!g8(e)?v8(i,e):e}const Zv=i=>i instanceof ei?{...i}:i;function Ns(i,e){e=e||{};const t={};function n(u,d,h,b){return Se.isPlainObject(u)&&Se.isPlainObject(d)?Se.merge.call({caseless:b},u,d):Se.isPlainObject(d)?Se.merge({},d):Se.isArray(d)?d.slice():d}function r(u,d,h,b){if(Se.isUndefined(d)){if(!Se.isUndefined(u))return n(void 0,u,h,b)}else return n(u,d,h,b)}function s(u,d){if(!Se.isUndefined(d))return n(void 0,d)}function a(u,d){if(Se.isUndefined(d)){if(!Se.isUndefined(u))return n(void 0,u)}else return n(void 0,d)}function o(u,d,h){if(h in e)return n(u,d);if(h in i)return n(void 0,u)}const c={url:s,method:s,data:s,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,withXSRFToken:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,beforeRedirect:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,responseEncoding:a,validateStatus:o,headers:(u,d,h)=>r(Zv(u),Zv(d),h,!0)};return Se.forEach(Object.keys(Object.assign({},i,e)),function(d){const h=c[d]||r,b=h(i[d],e[d],d);Se.isUndefined(b)&&h!==o||(t[d]=b)}),t}const ey=i=>{const e=Ns({},i);let{data:t,withXSRFToken:n,xsrfHeaderName:r,xsrfCookieName:s,headers:a,auth:o}=e;e.headers=a=ei.from(a),e.url=Hv(Qv(e.baseURL,e.url),i.params,i.paramsSerializer),o&&a.set("Authorization","Basic "+btoa((o.username||"")+":"+(o.password?unescape(encodeURIComponent(o.password)):"")));let c;if(Se.isFormData(t)){if(Ln.hasStandardBrowserEnv||Ln.hasStandardBrowserWebWorkerEnv)a.setContentType(void 0);else if((c=a.getContentType())!==!1){const[u,...d]=c?c.split(";").map(h=>h.trim()).filter(Boolean):[];a.setContentType([u||"multipart/form-data",...d].join("; "))}}if(Ln.hasStandardBrowserEnv&&(n&&Se.isFunction(n)&&(n=n(e)),n||n!==!1&&p8(e.url))){const u=r&&s&&m8.read(s);u&&a.set(r,u)}return e},y8=typeof XMLHttpRequest<"u"&&function(i){return new Promise(function(t,n){const r=ey(i);let s=r.data;const a=ei.from(r.headers).normalize();let{responseType:o,onUploadProgress:c,onDownloadProgress:u}=r,d,h,b,v,y;function p(){v&&v(),y&&y(),r.cancelToken&&r.cancelToken.unsubscribe(d),r.signal&&r.signal.removeEventListener("abort",d)}let f=new XMLHttpRequest;f.open(r.method.toUpperCase(),r.url,!0),f.timeout=r.timeout;function m(){if(!f)return;const k=ei.from("getAllResponseHeaders"in f&&f.getAllResponseHeaders()),w={data:!o||o==="text"||o==="json"?f.responseText:f.response,status:f.status,statusText:f.statusText,headers:k,config:i,request:f};Xv(function(x){t(x),p()},function(x){n(x),p()},w),f=null}"onloadend"in f?f.onloadend=m:f.onreadystatechange=function(){!f||f.readyState!==4||f.status===0&&!(f.responseURL&&f.responseURL.indexOf("file:")===0)||setTimeout(m)},f.onabort=function(){f&&(n(new vt("Request aborted",vt.ECONNABORTED,i,f)),f=null)},f.onerror=function(){n(new vt("Network Error",vt.ERR_NETWORK,i,f)),f=null},f.ontimeout=function(){let D=r.timeout?"timeout of "+r.timeout+"ms exceeded":"timeout exceeded";const w=r.transitional||zv;r.timeoutErrorMessage&&(D=r.timeoutErrorMessage),n(new vt(D,w.clarifyTimeoutError?vt.ETIMEDOUT:vt.ECONNABORTED,i,f)),f=null},s===void 0&&a.setContentType(null),"setRequestHeader"in f&&Se.forEach(a.toJSON(),function(D,w){f.setRequestHeader(w,D)}),Se.isUndefined(r.withCredentials)||(f.withCredentials=!!r.withCredentials),o&&o!=="json"&&(f.responseType=r.responseType),u&&([b,y]=qc(u,!0),f.addEventListener("progress",b)),c&&f.upload&&([h,v]=qc(c),f.upload.addEventListener("progress",h),f.upload.addEventListener("loadend",v)),(r.cancelToken||r.signal)&&(d=k=>{f&&(n(!k||k.type?new Da(null,i,f):k),f.abort(),f=null)},r.cancelToken&&r.cancelToken.subscribe(d),r.signal&&(r.signal.aborted?d():r.signal.addEventListener("abort",d)));const _=d8(r.url);if(_&&Ln.protocols.indexOf(_)===-1){n(new vt("Unsupported protocol "+_+":",vt.ERR_BAD_REQUEST,i));return}f.send(s||null)})},b8=(i,e)=>{const{length:t}=i=i?i.filter(Boolean):[];if(e||t){let n=new AbortController,r;const s=function(u){if(!r){r=!0,o();const d=u instanceof Error?u:this.reason;n.abort(d instanceof vt?d:new Da(d instanceof Error?d.message:d))}};let a=e&&setTimeout(()=>{a=null,s(new vt(`timeout ${e} of ms exceeded`,vt.ETIMEDOUT))},e);const o=()=>{i&&(a&&clearTimeout(a),a=null,i.forEach(u=>{u.unsubscribe?u.unsubscribe(s):u.removeEventListener("abort",s)}),i=null)};i.forEach(u=>u.addEventListener("abort",s));const{signal:c}=n;return c.unsubscribe=()=>Se.asap(o),c}},_8=function*(i,e){let t=i.byteLength;if(t<e){yield i;return}let n=0,r;for(;n<t;)r=n+e,yield i.slice(n,r),n=r},k8=async function*(i,e){for await(const t of T8(i))yield*_8(t,e)},T8=async function*(i){if(i[Symbol.asyncIterator]){yield*i;return}const e=i.getReader();try{for(;;){const{done:t,value:n}=await e.read();if(t)break;yield n}}finally{await e.cancel()}},ty=(i,e,t,n)=>{const r=k8(i,e);let s=0,a,o=c=>{a||(a=!0,n&&n(c))};return new ReadableStream({async pull(c){try{const{done:u,value:d}=await r.next();if(u){o(),c.close();return}let h=d.byteLength;if(t){let b=s+=h;t(b)}c.enqueue(new Uint8Array(d))}catch(u){throw o(u),u}},cancel(c){return o(c),r.return()}},{highWaterMark:2})},zc=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",ny=zc&&typeof ReadableStream=="function",S8=zc&&(typeof TextEncoder=="function"?(i=>e=>i.encode(e))(new TextEncoder):async i=>new Uint8Array(await new Response(i).arrayBuffer())),iy=(i,...e)=>{try{return!!i(...e)}catch{return!1}},C8=ny&&iy(()=>{let i=!1;const e=new Request(Ln.origin,{body:new ReadableStream,method:"POST",get duplex(){return i=!0,"half"}}).headers.has("Content-Type");return i&&!e}),ry=64*1024,ef=ny&&iy(()=>Se.isReadableStream(new Response("").body)),Gc={stream:ef&&(i=>i.body)};zc&&(i=>{["text","arrayBuffer","blob","formData","stream"].forEach(e=>{!Gc[e]&&(Gc[e]=Se.isFunction(i[e])?t=>t[e]():(t,n)=>{throw new vt(`Response type '${e}' is not supported`,vt.ERR_NOT_SUPPORT,n)})})})(new Response);const x8=async i=>{if(i==null)return 0;if(Se.isBlob(i))return i.size;if(Se.isSpecCompliantForm(i))return(await new Request(Ln.origin,{method:"POST",body:i}).arrayBuffer()).byteLength;if(Se.isArrayBufferView(i)||Se.isArrayBuffer(i))return i.byteLength;if(Se.isURLSearchParams(i)&&(i=i+""),Se.isString(i))return(await S8(i)).byteLength},E8=async(i,e)=>{const t=Se.toFiniteNumber(i.getContentLength());return t??x8(e)},tf={http:W5,xhr:y8,fetch:zc&&(async i=>{let{url:e,method:t,data:n,signal:r,cancelToken:s,timeout:a,onDownloadProgress:o,onUploadProgress:c,responseType:u,headers:d,withCredentials:h="same-origin",fetchOptions:b}=ey(i);u=u?(u+"").toLowerCase():"text";let v=b8([r,s&&s.toAbortSignal()],a),y;const p=v&&v.unsubscribe&&(()=>{v.unsubscribe()});let f;try{if(c&&C8&&t!=="get"&&t!=="head"&&(f=await E8(d,n))!==0){let w=new Request(e,{method:"POST",body:n,duplex:"half"}),A;if(Se.isFormData(n)&&(A=w.headers.get("content-type"))&&d.setContentType(A),w.body){const[x,P]=Yv(f,qc(Jv(c)));n=ty(w.body,ry,x,P)}}Se.isString(h)||(h=h?"include":"omit");const m="credentials"in Request.prototype;y=new Request(e,{...b,signal:v,method:t.toUpperCase(),headers:d.normalize().toJSON(),body:n,duplex:"half",credentials:m?h:void 0});let _=await fetch(y);const k=ef&&(u==="stream"||u==="response");if(ef&&(o||k&&p)){const w={};["status","statusText","headers"].forEach(S=>{w[S]=_[S]});const A=Se.toFiniteNumber(_.headers.get("content-length")),[x,P]=o&&Yv(A,qc(Jv(o),!0))||[];_=new Response(ty(_.body,ry,x,()=>{P&&P(),p&&p()}),w)}u=u||"text";let D=await Gc[Se.findKey(Gc,u)||"text"](_,i);return!k&&p&&p(),await new Promise((w,A)=>{Xv(w,A,{data:D,headers:ei.from(_.headers),status:_.status,statusText:_.statusText,config:i,request:y})})}catch(m){throw p&&p(),m&&m.name==="TypeError"&&/fetch/i.test(m.message)?Object.assign(new vt("Network Error",vt.ERR_NETWORK,i,y),{cause:m.cause||m}):vt.from(m,m&&m.code,i,y)}})};Se.forEach(tf,(i,e)=>{if(i){try{Object.defineProperty(i,"name",{value:e})}catch{}Object.defineProperty(i,"adapterName",{value:e})}});const sy=i=>`- ${i}`,w8=i=>Se.isFunction(i)||i===null||i===!1,ay={getAdapter:i=>{i=Se.isArray(i)?i:[i];const{length:e}=i;let t,n;const r={};for(let s=0;s<e;s++){t=i[s];let a;if(n=t,!w8(t)&&(n=tf[(a=String(t)).toLowerCase()],n===void 0))throw new vt(`Unknown adapter '${a}'`);if(n)break;r[a||"#"+s]=n}if(!n){const s=Object.entries(r).map(([o,c])=>`adapter ${o} `+(c===!1?"is not supported by the environment":"is not available in the build"));let a=e?s.length>1?`since :
23
+ `+s.map(sy).join(`
24
+ `):" "+sy(s[0]):"as no adapter specified";throw new vt("There is no suitable adapter to dispatch the request "+a,"ERR_NOT_SUPPORT")}return n},adapters:tf};function nf(i){if(i.cancelToken&&i.cancelToken.throwIfRequested(),i.signal&&i.signal.aborted)throw new Da(null,i)}function oy(i){return nf(i),i.headers=ei.from(i.headers),i.data=Zh.call(i,i.transformRequest),["post","put","patch"].indexOf(i.method)!==-1&&i.headers.setContentType("application/x-www-form-urlencoded",!1),ay.getAdapter(i.adapter||Yo.adapter)(i).then(function(n){return nf(i),n.data=Zh.call(i,i.transformResponse,n),n.headers=ei.from(n.headers),n},function(n){return Kv(n)||(nf(i),n&&n.response&&(n.response.data=Zh.call(i,i.transformResponse,n.response),n.response.headers=ei.from(n.response.headers))),Promise.reject(n)})}const ly="1.7.9",Wc={};["object","boolean","number","function","string","symbol"].forEach((i,e)=>{Wc[i]=function(n){return typeof n===i||"a"+(e<1?"n ":" ")+i}});const cy={};Wc.transitional=function(e,t,n){function r(s,a){return"[Axios v"+ly+"] Transitional option '"+s+"'"+a+(n?". "+n:"")}return(s,a,o)=>{if(e===!1)throw new vt(r(a," has been removed"+(t?" in "+t:"")),vt.ERR_DEPRECATED);return t&&!cy[a]&&(cy[a]=!0,console.warn(r(a," has been deprecated since v"+t+" and will be removed in the near future"))),e?e(s,a,o):!0}},Wc.spelling=function(e){return(t,n)=>(console.warn(`${n} is likely a misspelling of ${e}`),!0)};function D8(i,e,t){if(typeof i!="object")throw new vt("options must be an object",vt.ERR_BAD_OPTION_VALUE);const n=Object.keys(i);let r=n.length;for(;r-- >0;){const s=n[r],a=e[s];if(a){const o=i[s],c=o===void 0||a(o,s,i);if(c!==!0)throw new vt("option "+s+" must be "+c,vt.ERR_BAD_OPTION_VALUE);continue}if(t!==!0)throw new vt("Unknown option "+s,vt.ERR_BAD_OPTION)}}const Kc={assertOptions:D8,validators:Wc},ir=Kc.validators;let Os=class{constructor(e){this.defaults=e,this.interceptors={request:new qv,response:new qv}}async request(e,t){try{return await this._request(e,t)}catch(n){if(n instanceof Error){let r={};Error.captureStackTrace?Error.captureStackTrace(r):r=new Error;const s=r.stack?r.stack.replace(/^.+\n/,""):"";try{n.stack?s&&!String(n.stack).endsWith(s.replace(/^.+\n.+\n/,""))&&(n.stack+=`
25
+ `+s):n.stack=s}catch{}}throw n}}_request(e,t){typeof e=="string"?(t=t||{},t.url=e):t=e||{},t=Ns(this.defaults,t);const{transitional:n,paramsSerializer:r,headers:s}=t;n!==void 0&&Kc.assertOptions(n,{silentJSONParsing:ir.transitional(ir.boolean),forcedJSONParsing:ir.transitional(ir.boolean),clarifyTimeoutError:ir.transitional(ir.boolean)},!1),r!=null&&(Se.isFunction(r)?t.paramsSerializer={serialize:r}:Kc.assertOptions(r,{encode:ir.function,serialize:ir.function},!0)),Kc.assertOptions(t,{baseUrl:ir.spelling("baseURL"),withXsrfToken:ir.spelling("withXSRFToken")},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase();let a=s&&Se.merge(s.common,s[t.method]);s&&Se.forEach(["delete","get","head","post","put","patch","common"],y=>{delete s[y]}),t.headers=ei.concat(a,s);const o=[];let c=!0;this.interceptors.request.forEach(function(p){typeof p.runWhen=="function"&&p.runWhen(t)===!1||(c=c&&p.synchronous,o.unshift(p.fulfilled,p.rejected))});const u=[];this.interceptors.response.forEach(function(p){u.push(p.fulfilled,p.rejected)});let d,h=0,b;if(!c){const y=[oy.bind(this),void 0];for(y.unshift.apply(y,o),y.push.apply(y,u),b=y.length,d=Promise.resolve(t);h<b;)d=d.then(y[h++],y[h++]);return d}b=o.length;let v=t;for(h=0;h<b;){const y=o[h++],p=o[h++];try{v=y(v)}catch(f){p.call(this,f);break}}try{d=oy.call(this,v)}catch(y){return Promise.reject(y)}for(h=0,b=u.length;h<b;)d=d.then(u[h++],u[h++]);return d}getUri(e){e=Ns(this.defaults,e);const t=Qv(e.baseURL,e.url);return Hv(t,e.params,e.paramsSerializer)}};Se.forEach(["delete","get","head","options"],function(e){Os.prototype[e]=function(t,n){return this.request(Ns(n||{},{method:e,url:t,data:(n||{}).data}))}}),Se.forEach(["post","put","patch"],function(e){function t(n){return function(s,a,o){return this.request(Ns(o||{},{method:e,headers:n?{"Content-Type":"multipart/form-data"}:{},url:s,data:a}))}}Os.prototype[e]=t(),Os.prototype[e+"Form"]=t(!0)});let A8=class mx{constructor(e){if(typeof e!="function")throw new TypeError("executor must be a function.");let t;this.promise=new Promise(function(s){t=s});const n=this;this.promise.then(r=>{if(!n._listeners)return;let s=n._listeners.length;for(;s-- >0;)n._listeners[s](r);n._listeners=null}),this.promise.then=r=>{let s;const a=new Promise(o=>{n.subscribe(o),s=o}).then(r);return a.cancel=function(){n.unsubscribe(s)},a},e(function(s,a,o){n.reason||(n.reason=new Da(s,a,o),t(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const t=this._listeners.indexOf(e);t!==-1&&this._listeners.splice(t,1)}toAbortSignal(){const e=new AbortController,t=n=>{e.abort(n)};return this.subscribe(t),e.signal.unsubscribe=()=>this.unsubscribe(t),e.signal}static source(){let e;return{token:new mx(function(r){e=r}),cancel:e}}};function I8(i){return function(t){return i.apply(null,t)}}function P8(i){return Se.isObject(i)&&i.isAxiosError===!0}const rf={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(rf).forEach(([i,e])=>{rf[e]=i});function uy(i){const e=new Os(i),t=wv(Os.prototype.request,e);return Se.extend(t,Os.prototype,e,{allOwnKeys:!0}),Se.extend(t,e,null,{allOwnKeys:!0}),t.create=function(r){return uy(Ns(i,r))},t}const un=uy(Yo);un.Axios=Os,un.CanceledError=Da,un.CancelToken=A8,un.isCancel=Kv,un.VERSION=ly,un.toFormData=$c,un.AxiosError=vt,un.Cancel=un.CanceledError,un.all=function(e){return Promise.all(e)},un.spread=I8,un.isAxiosError=P8,un.mergeConfig=Ns,un.AxiosHeaders=ei,un.formToJSON=i=>Gv(Se.isHTMLForm(i)?new FormData(i):i),un.getAdapter=ay.getAdapter,un.HttpStatusCode=rf,un.default=un;const{Axios:fH,AxiosError:pH,CanceledError:mH,isCancel:gH,CancelToken:vH,VERSION:yH,all:bH,Cancel:_H,isAxiosError:kH,spread:TH,toFormData:SH,AxiosHeaders:CH,HttpStatusCode:xH,formToJSON:EH,getAdapter:wH,mergeConfig:DH}=un,Ct=un.create({timeout:6e4});Ct.defaults.headers.post["Content-Type"]="application/json; charset=utf-8",Ct.interceptors.request.use(function(i){return i},function(i){return Promise.reject(i)}),Ct.interceptors.response.use(function(i){return i},function(i){return Promise.reject(i)});const N8=(i={},{baseUrl:e,token:t}={})=>Ct.get("/api/conferenceRoom/getReserveConferenceByLoginUser",{params:i,baseURL:e,headers:{satoken:t}}),O8=(i={},{baseUrl:e,token:t}={})=>Ct.post("/api/v1/scheduleMeeting",i,{baseURL:e,headers:{satoken:t}}),M8=(i={},{baseUrl:e,token:t}={})=>Ct.post("/api/v1/modifyAppointMeeting",i,{baseURL:e,headers:{satoken:t}}),dy=(i={},{baseUrl:e,token:t}={})=>Ct.post("/api/v1/deleteAppointMeeting",i,{baseURL:e,headers:{satoken:t}}),hy=(i={},{baseUrl:e,token:t}={})=>Ct.get("/api/conferenceRoom/getInviteParticipantsByRoomName",{params:i,baseURL:e,headers:{satoken:t}}),Qo=(i={},{baseUrl:e,token:t}={})=>Ct.post("/api/conferenceRoom/addInviteParticipants",i,{baseURL:e,headers:{satoken:t}}),fy=(i={},{baseUrl:e,token:t}={})=>Ct.post("/api/sysOffices/queryOfficeAndUserTree",i,{baseURL:e,headers:{satoken:t}}),R8=(i={},{baseUrl:e,token:t}={})=>Ct.get("/api/commonGroup/getCommonGroups",{params:i,baseURL:e,headers:{satoken:t}}),L8=(i={},{baseUrl:e,token:t}={})=>Ct.post("/api/commonGroup/addCommonGroup",i,{baseURL:e,headers:{satoken:t}}),B8=(i={},{baseUrl:e,token:t}={})=>Ct.put("/api/commonGroup/updateCommonGroup",i,{baseURL:e,headers:{satoken:t}}),U8=(i="",{baseUrl:e,token:t}={})=>Ct.delete("/api/commonGroup/deleteCommonGroup/"+i,{baseURL:e,headers:{satoken:t}}),F8=(i={},{baseUrl:e,token:t}={})=>Ct.post("/api/weChat/getWeChatUrl",i,{baseURL:e,headers:{satoken:t}}),sf=(i={},{baseUrl:e,token:t}={})=>Ct.post("/api/conferenceRoom/sendMsgAndNoticeMakeCallByZX",i,{baseURL:e,headers:{satoken:t}}),V8=(i={},{baseUrl:e,token:t}={})=>Ct.post("/api/wx/sendWxNotify",i,{baseURL:e,headers:{satoken:t}}),af=(i={},{baseUrl:e,token:t}={})=>Ct.post("/api/v1/makeCall",i,{baseURL:e,headers:{satoken:t}}),j8=(i={},{baseUrl:e,token:t}={})=>Ct.get("/api/smc/querySites",{params:i,baseURL:e,headers:{satoken:t}}),py=(i,e={},{baseUrl:t,token:n}={})=>Ct.post(`/api/smc/scheduleConf?roomName=${i}`,e,{baseURL:t,headers:{satoken:n}}),$8=(i,e={},{baseUrl:t,token:n}={})=>Ct.post(`/api/smc/disconnectSites?roomName=${i}`,e,{baseURL:t,headers:{satoken:n}}),H8=(i,e={},{baseUrl:t,token:n}={})=>Ct.post(`/api/smc/connectSites?roomName=${i}`,e,{baseURL:t,headers:{satoken:n}}),my=(i={},{baseUrl:e,token:t}={})=>Ct.post(`/api/smc/queryConfSitesStatus?roomName=${i}`,null,{baseURL:e,headers:{satoken:t}}),of=(i={},{baseUrl:e,token:t}={})=>Ct.post(`/api/smc/delScheduleConf?roomName=${i}`,null,{baseURL:e,headers:{satoken:t}}),gy=(i={},{baseUrl:e,token:t}={})=>Ct.post(`/api/smc/getScheduleConfCode?roomName=${i}`,null,{baseURL:e,headers:{satoken:t}});var lf,vy;function Xc(){if(vy)return lf;vy=1;var i;return typeof window<"u"?i=window:typeof Lc<"u"?i=Lc:typeof self<"u"?i=self:i={},lf=i,lf}var q8=Xc();const te=Ca(q8),z8=A4(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));var cf,yy;function by(){if(yy)return cf;yy=1;var i=typeof Lc<"u"?Lc:typeof window<"u"?window:{},e=z8,t;return typeof document<"u"?t=document:(t=i["__GLOBAL_DOCUMENT_CACHE@4"],t||(t=i["__GLOBAL_DOCUMENT_CACHE@4"]=e)),cf=t,cf}var G8=by();const Ue=Ca(G8);var Yc={exports:{}},uf={exports:{}},_y;function W8(){return _y||(_y=1,function(i){function e(){return i.exports=e=Object.assign?Object.assign.bind():function(t){for(var n=1;n<arguments.length;n++){var r=arguments[n];for(var s in r)({}).hasOwnProperty.call(r,s)&&(t[s]=r[s])}return t},i.exports.__esModule=!0,i.exports.default=i.exports,e.apply(null,arguments)}i.exports=e,i.exports.__esModule=!0,i.exports.default=i.exports}(uf)),uf.exports}var df,ky;function K8(){if(ky)return df;ky=1,df=e;var i=Object.prototype.toString;function e(t){if(!t)return!1;var n=i.call(t);return n==="[object Function]"||typeof t=="function"&&n!=="[object RegExp]"||typeof window<"u"&&(t===window.setTimeout||t===window.alert||t===window.confirm||t===window.prompt)}return df}var hf,Ty;function X8(){if(Ty)return hf;Ty=1;function i(r,s){var a=typeof Symbol<"u"&&r[Symbol.iterator]||r["@@iterator"];if(a)return(a=a.call(r)).next.bind(a);if(Array.isArray(r)||(a=e(r))||s){a&&(r=a);var o=0;return function(){return o>=r.length?{done:!0}:{done:!1,value:r[o++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
26
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function e(r,s){if(r){if(typeof r=="string")return t(r,s);var a=Object.prototype.toString.call(r).slice(8,-1);if(a==="Object"&&r.constructor&&(a=r.constructor.name),a==="Map"||a==="Set")return Array.from(r);if(a==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a))return t(r,s)}}function t(r,s){(s==null||s>r.length)&&(s=r.length);for(var a=0,o=new Array(s);a<s;a++)o[a]=r[a];return o}var n=function(){function r(){this.typeToInterceptorsMap_=new Map,this.enabled_=!1}var s=r.prototype;return s.getIsEnabled=function(){return this.enabled_},s.enable=function(){this.enabled_=!0},s.disable=function(){this.enabled_=!1},s.reset=function(){this.typeToInterceptorsMap_=new Map,this.enabled_=!1},s.addInterceptor=function(o,c){this.typeToInterceptorsMap_.has(o)||this.typeToInterceptorsMap_.set(o,new Set);var u=this.typeToInterceptorsMap_.get(o);return u.has(c)?!1:(u.add(c),!0)},s.removeInterceptor=function(o,c){var u=this.typeToInterceptorsMap_.get(o);return u&&u.has(c)?(u.delete(c),!0):!1},s.clearInterceptorsByType=function(o){var c=this.typeToInterceptorsMap_.get(o);return c?(this.typeToInterceptorsMap_.delete(o),this.typeToInterceptorsMap_.set(o,new Set),!0):!1},s.clear=function(){return this.typeToInterceptorsMap_.size?(this.typeToInterceptorsMap_=new Map,!0):!1},s.getForType=function(o){return this.typeToInterceptorsMap_.get(o)||new Set},s.execute=function(o,c){for(var u=this.getForType(o),d=i(u),h;!(h=d()).done;){var b=h.value;try{c=b(c)}catch{}}return c},r}();return hf=n,hf}var ff,Sy;function Y8(){if(Sy)return ff;Sy=1;var i=function(){function t(){this.maxAttempts_=1,this.delayFactor_=.1,this.fuzzFactor_=.1,this.initialDelay_=1e3,this.enabled_=!1}var n=t.prototype;return n.getIsEnabled=function(){return this.enabled_},n.enable=function(){this.enabled_=!0},n.disable=function(){this.enabled_=!1},n.reset=function(){this.maxAttempts_=1,this.delayFactor_=.1,this.fuzzFactor_=.1,this.initialDelay_=1e3,this.enabled_=!1},n.getMaxAttempts=function(){return this.maxAttempts_},n.setMaxAttempts=function(s){this.maxAttempts_=s},n.getDelayFactor=function(){return this.delayFactor_},n.setDelayFactor=function(s){this.delayFactor_=s},n.getFuzzFactor=function(){return this.fuzzFactor_},n.setFuzzFactor=function(s){this.fuzzFactor_=s},n.getInitialDelay=function(){return this.initialDelay_},n.setInitialDelay=function(s){this.initialDelay_=s},n.createRetry=function(s){var a=s===void 0?{}:s,o=a.maxAttempts,c=a.delayFactor,u=a.fuzzFactor,d=a.initialDelay;return new e({maxAttempts:o||this.maxAttempts_,delayFactor:c||this.delayFactor_,fuzzFactor:u||this.fuzzFactor_,initialDelay:d||this.initialDelay_})},t}(),e=function(){function t(r){this.maxAttempts_=r.maxAttempts,this.delayFactor_=r.delayFactor,this.fuzzFactor_=r.fuzzFactor,this.currentDelay_=r.initialDelay,this.currentAttempt_=1}var n=t.prototype;return n.moveToNextAttempt=function(){this.currentAttempt_++;var s=this.currentDelay_*this.delayFactor_;this.currentDelay_=this.currentDelay_+s},n.shouldRetry=function(){return this.currentAttempt_<this.maxAttempts_},n.getCurrentDelay=function(){return this.currentDelay_},n.getCurrentMinPossibleDelay=function(){return(1-this.fuzzFactor_)*this.currentDelay_},n.getCurrentMaxPossibleDelay=function(){return(1+this.fuzzFactor_)*this.currentDelay_},n.getCurrentFuzzedDelay=function(){var s=this.getCurrentMinPossibleDelay(),a=this.getCurrentMaxPossibleDelay();return s+Math.random()*(a-s)},t}();return ff=i,ff}var pf,Cy;function J8(){if(Cy)return pf;Cy=1;var i=Xc(),e=function(r,s){return s===void 0&&(s=!1),function(a,o,c){if(a){r(a);return}if(o.statusCode>=400&&o.statusCode<=599){var u=c;if(s)if(i.TextDecoder){var d=t(o.headers&&o.headers["content-type"]);try{u=new TextDecoder(d).decode(c)}catch{}}else u=String.fromCharCode.apply(null,new Uint8Array(c));r({cause:u});return}r(null,c)}};function t(n){return n===void 0&&(n=""),n.toLowerCase().split(";").reduce(function(r,s){var a=s.split("="),o=a[0],c=a[1];return o.trim()==="charset"?c.trim():r},"utf-8")}return pf=e,pf}var xy;function Q8(){if(xy)return Yc.exports;xy=1;var i=Xc(),e=W8(),t=K8(),n=X8(),r=Y8();u.httpHandler=J8(),u.requestInterceptorsStorage=new n,u.responseInterceptorsStorage=new n,u.retryManager=new r;/**
27
+ * @license
28
+ * slighly modified parse-headers 2.0.2 <https://github.com/kesla/parse-headers/>
29
+ * Copyright (c) 2014 David Björklund
30
+ * Available under the MIT license
31
+ * <https://github.com/kesla/parse-headers/blob/master/LICENCE>
32
+ */var s=function(y){var p={};return y&&y.trim().split(`
33
+ `).forEach(function(f){var m=f.indexOf(":"),_=f.slice(0,m).trim().toLowerCase(),k=f.slice(m+1).trim();typeof p[_]>"u"?p[_]=k:Array.isArray(p[_])?p[_].push(k):p[_]=[p[_],k]}),p};Yc.exports=u,Yc.exports.default=u,u.XMLHttpRequest=i.XMLHttpRequest||b,u.XDomainRequest="withCredentials"in new u.XMLHttpRequest?u.XMLHttpRequest:i.XDomainRequest,a(["get","put","post","patch","head","delete"],function(v){u[v==="delete"?"del":v]=function(y,p,f){return p=c(y,p,f),p.method=v.toUpperCase(),d(p)}});function a(v,y){for(var p=0;p<v.length;p++)y(v[p])}function o(v){for(var y in v)if(v.hasOwnProperty(y))return!1;return!0}function c(v,y,p){var f=v;return t(y)?(p=y,typeof v=="string"&&(f={uri:v})):f=e({},y,{uri:v}),f.callback=p,f}function u(v,y,p){return y=c(v,y,p),d(y)}function d(v){if(typeof v.callback>"u")throw new Error("callback argument missing");if(v.requestType&&u.requestInterceptorsStorage.getIsEnabled()){var y={uri:v.uri||v.url,headers:v.headers||{},body:v.body,metadata:v.metadata||{},retry:v.retry,timeout:v.timeout},p=u.requestInterceptorsStorage.execute(v.requestType,y);v.uri=p.uri,v.headers=p.headers,v.body=p.body,v.metadata=p.metadata,v.retry=p.retry,v.timeout=p.timeout}var f=!1,m=function($,H,j){f||(f=!0,v.callback($,H,j))};function _(){A.readyState===4&&!u.responseInterceptorsStorage.getIsEnabled()&&setTimeout(w,0)}function k(){var L=void 0;if(A.response?L=A.response:L=A.responseText||h(A),ie)try{L=JSON.parse(L)}catch{}return L}function D(L){if(clearTimeout(Y),clearTimeout(v.retryTimeout),L instanceof Error||(L=new Error(""+(L||"Unknown XMLHttpRequest Error"))),L.statusCode=0,!P&&u.retryManager.getIsEnabled()&&v.retry&&v.retry.shouldRetry()){v.retryTimeout=setTimeout(function(){v.retry.moveToNextAttempt(),v.xhr=A,d(v)},v.retry.getCurrentFuzzedDelay());return}if(v.requestType&&u.responseInterceptorsStorage.getIsEnabled()){var $={headers:q.headers||{},body:q.body,responseUrl:A.responseURL,responseType:A.responseType},H=u.responseInterceptorsStorage.execute(v.requestType,$);q.body=H.body,q.headers=H.headers}return m(L,q)}function w(){if(!P){var L;clearTimeout(Y),clearTimeout(v.retryTimeout),v.useXDR&&A.status===void 0?L=200:L=A.status===1223?204:A.status;var $=q,H=null;if(L!==0?($={body:k(),statusCode:L,method:M,headers:{},url:S,rawRequest:A},A.getAllResponseHeaders&&($.headers=s(A.getAllResponseHeaders()))):H=new Error("Internal XMLHttpRequest Error"),v.requestType&&u.responseInterceptorsStorage.getIsEnabled()){var j={headers:$.headers||{},body:$.body,responseUrl:A.responseURL,responseType:A.responseType},W=u.responseInterceptorsStorage.execute(v.requestType,j);$.body=W.body,$.headers=W.headers}return m(H,$,$.body)}}var A=v.xhr||null;A||(v.cors||v.useXDR?A=new u.XDomainRequest:A=new u.XMLHttpRequest);var x,P,S=A.url=v.uri||v.url,M=A.method=v.method||"GET",U=v.body||v.data,B=A.headers=v.headers||{},Q=!!v.sync,ie=!1,Y,q={body:void 0,headers:{},statusCode:0,method:M,url:S,rawRequest:A};if("json"in v&&v.json!==!1&&(ie=!0,B.accept||B.Accept||(B.Accept="application/json"),M!=="GET"&&M!=="HEAD"&&(B["content-type"]||B["Content-Type"]||(B["Content-Type"]="application/json"),U=JSON.stringify(v.json===!0?U:v.json))),A.onreadystatechange=_,A.onload=w,A.onerror=D,A.onprogress=function(){},A.onabort=function(){P=!0,clearTimeout(v.retryTimeout)},A.ontimeout=D,A.open(M,S,!Q,v.username,v.password),Q||(A.withCredentials=!!v.withCredentials),!Q&&v.timeout>0&&(Y=setTimeout(function(){if(!P){P=!0,A.abort("timeout");var L=new Error("XMLHttpRequest timeout");L.code="ETIMEDOUT",D(L)}},v.timeout)),A.setRequestHeader)for(x in B)B.hasOwnProperty(x)&&A.setRequestHeader(x,B[x]);else if(v.headers&&!o(v.headers))throw new Error("Headers cannot be set on an XDomainRequest object");return"responseType"in v&&(A.responseType=v.responseType),"beforeSend"in v&&typeof v.beforeSend=="function"&&v.beforeSend(A),A.send(U||null),A}function h(v){try{if(v.responseType==="document")return v.responseXML;var y=v.responseXML&&v.responseXML.documentElement.nodeName==="parsererror";if(v.responseType===""&&!y)return v.responseXML}catch{}return null}function b(){}return Yc.exports}var Z8=Q8();const Ey=Ca(Z8);var mf={exports:{}},gf,wy;function e6(){if(wy)return gf;wy=1;var i=by(),e=Object.create||function(){function S(){}return function(M){if(arguments.length!==1)throw new Error("Object.create shim only accepts one parameter.");return S.prototype=M,new S}}();function t(S,M){this.name="ParsingError",this.code=S.code,this.message=M||S.message}t.prototype=e(Error.prototype),t.prototype.constructor=t,t.Errors={BadSignature:{code:0,message:"Malformed WebVTT signature."},BadTimeStamp:{code:1,message:"Malformed time stamp."}};function n(S){function M(B,Q,ie,Y){return(B|0)*3600+(Q|0)*60+(ie|0)+(Y|0)/1e3}var U=S.match(/^(\d+):(\d{1,2})(:\d{1,2})?\.(\d{3})/);return U?U[3]?M(U[1],U[2],U[3].replace(":",""),U[4]):U[1]>59?M(U[1],U[2],0,U[4]):M(0,U[1],U[2],U[4]):null}function r(){this.values=e(null)}r.prototype={set:function(S,M){!this.get(S)&&M!==""&&(this.values[S]=M)},get:function(S,M,U){return U?this.has(S)?this.values[S]:M[U]:this.has(S)?this.values[S]:M},has:function(S){return S in this.values},alt:function(S,M,U){for(var B=0;B<U.length;++B)if(M===U[B]){this.set(S,M);break}},integer:function(S,M){/^-?\d+$/.test(M)&&this.set(S,parseInt(M,10))},percent:function(S,M){return M.match(/^([\d]{1,3})(\.[\d]*)?%$/)&&(M=parseFloat(M),M>=0&&M<=100)?(this.set(S,M),!0):!1}};function s(S,M,U,B){var Q=B?S.split(B):[S];for(var ie in Q)if(typeof Q[ie]=="string"){var Y=Q[ie].split(U);if(Y.length===2){var q=Y[0].trim(),L=Y[1].trim();M(q,L)}}}function a(S,M,U){var B=S;function Q(){var q=n(S);if(q===null)throw new t(t.Errors.BadTimeStamp,"Malformed timestamp: "+B);return S=S.replace(/^[^\sa-zA-Z-]+/,""),q}function ie(q,L){var $=new r;s(q,function(H,j){switch(H){case"region":for(var W=U.length-1;W>=0;W--)if(U[W].id===j){$.set(H,U[W].region);break}break;case"vertical":$.alt(H,j,["rl","lr"]);break;case"line":var ae=j.split(","),Ee=ae[0];$.integer(H,Ee),$.percent(H,Ee)&&$.set("snapToLines",!1),$.alt(H,Ee,["auto"]),ae.length===2&&$.alt("lineAlign",ae[1],["start","center","end"]);break;case"position":ae=j.split(","),$.percent(H,ae[0]),ae.length===2&&$.alt("positionAlign",ae[1],["start","center","end"]);break;case"size":$.percent(H,j);break;case"align":$.alt(H,j,["start","center","end","left","right"]);break}},/:/,/\s/),L.region=$.get("region",null),L.vertical=$.get("vertical","");try{L.line=$.get("line","auto")}catch{}L.lineAlign=$.get("lineAlign","start"),L.snapToLines=$.get("snapToLines",!0),L.size=$.get("size",100);try{L.align=$.get("align","center")}catch{L.align=$.get("align","middle")}try{L.position=$.get("position","auto")}catch{L.position=$.get("position",{start:0,left:0,center:50,middle:50,end:100,right:100},L.align)}L.positionAlign=$.get("positionAlign",{start:"start",left:"start",center:"center",middle:"center",end:"end",right:"end"},L.align)}function Y(){S=S.replace(/^\s+/,"")}if(Y(),M.startTime=Q(),Y(),S.substr(0,3)!=="-->")throw new t(t.Errors.BadTimeStamp,"Malformed time stamp (time stamps must be separated by '-->'): "+B);S=S.substr(3),Y(),M.endTime=Q(),Y(),ie(S,M)}var o=i.createElement&&i.createElement("textarea"),c={c:"span",i:"i",b:"b",u:"u",ruby:"ruby",rt:"rt",v:"span",lang:"span"},u={white:"rgba(255,255,255,1)",lime:"rgba(0,255,0,1)",cyan:"rgba(0,255,255,1)",red:"rgba(255,0,0,1)",yellow:"rgba(255,255,0,1)",magenta:"rgba(255,0,255,1)",blue:"rgba(0,0,255,1)",black:"rgba(0,0,0,1)"},d={v:"title",lang:"lang"},h={rt:"ruby"};function b(S,M){function U(){if(!M)return null;function Ee(ee){return M=M.substr(ee.length),ee}var Ae=M.match(/^([^<]*)(<[^>]*>?)?/);return Ee(Ae[1]?Ae[1]:Ae[2])}function B(Ee){return o.innerHTML=Ee,Ee=o.textContent,o.textContent="",Ee}function Q(Ee,Ae){return!h[Ae.localName]||h[Ae.localName]===Ee.localName}function ie(Ee,Ae){var ee=c[Ee];if(!ee)return null;var fe=S.document.createElement(ee),xe=d[Ee];return xe&&Ae&&(fe[xe]=Ae.trim()),fe}for(var Y=S.document.createElement("div"),q=Y,L,$=[];(L=U())!==null;){if(L[0]==="<"){if(L[1]==="/"){$.length&&$[$.length-1]===L.substr(2).replace(">","")&&($.pop(),q=q.parentNode);continue}var H=n(L.substr(1,L.length-2)),j;if(H){j=S.document.createProcessingInstruction("timestamp",H),q.appendChild(j);continue}var W=L.match(/^<([^.\s/0-9>]+)(\.[^\s\\>]+)?([^>\\]+)?(\\?)>?$/);if(!W||(j=ie(W[1],W[3]),!j)||!Q(q,j))continue;if(W[2]){var ae=W[2].split(".");ae.forEach(function(Ee){var Ae=/^bg_/.test(Ee),ee=Ae?Ee.slice(3):Ee;if(u.hasOwnProperty(ee)){var fe=Ae?"background-color":"color",xe=u[ee];j.style[fe]=xe}}),j.className=ae.join(" ")}$.push(W[1]),q.appendChild(j),q=j;continue}q.appendChild(S.document.createTextNode(B(L)))}return Y}var v=[[1470,1470],[1472,1472],[1475,1475],[1478,1478],[1488,1514],[1520,1524],[1544,1544],[1547,1547],[1549,1549],[1563,1563],[1566,1610],[1645,1647],[1649,1749],[1765,1766],[1774,1775],[1786,1805],[1807,1808],[1810,1839],[1869,1957],[1969,1969],[1984,2026],[2036,2037],[2042,2042],[2048,2069],[2074,2074],[2084,2084],[2088,2088],[2096,2110],[2112,2136],[2142,2142],[2208,2208],[2210,2220],[8207,8207],[64285,64285],[64287,64296],[64298,64310],[64312,64316],[64318,64318],[64320,64321],[64323,64324],[64326,64449],[64467,64829],[64848,64911],[64914,64967],[65008,65020],[65136,65140],[65142,65276],[67584,67589],[67592,67592],[67594,67637],[67639,67640],[67644,67644],[67647,67669],[67671,67679],[67840,67867],[67872,67897],[67903,67903],[67968,68023],[68030,68031],[68096,68096],[68112,68115],[68117,68119],[68121,68147],[68160,68167],[68176,68184],[68192,68223],[68352,68405],[68416,68437],[68440,68466],[68472,68479],[68608,68680],[126464,126467],[126469,126495],[126497,126498],[126500,126500],[126503,126503],[126505,126514],[126516,126519],[126521,126521],[126523,126523],[126530,126530],[126535,126535],[126537,126537],[126539,126539],[126541,126543],[126545,126546],[126548,126548],[126551,126551],[126553,126553],[126555,126555],[126557,126557],[126559,126559],[126561,126562],[126564,126564],[126567,126570],[126572,126578],[126580,126583],[126585,126588],[126590,126590],[126592,126601],[126603,126619],[126625,126627],[126629,126633],[126635,126651],[1114109,1114109]];function y(S){for(var M=0;M<v.length;M++){var U=v[M];if(S>=U[0]&&S<=U[1])return!0}return!1}function p(S){var M=[],U="",B;if(!S||!S.childNodes)return"ltr";function Q(q,L){for(var $=L.childNodes.length-1;$>=0;$--)q.push(L.childNodes[$])}function ie(q){if(!q||!q.length)return null;var L=q.pop(),$=L.textContent||L.innerText;if($){var H=$.match(/^.*(\n|\r)/);return H?(q.length=0,H[0]):$}if(L.tagName==="ruby")return ie(q);if(L.childNodes)return Q(q,L),ie(q)}for(Q(M,S);U=ie(M);)for(var Y=0;Y<U.length;Y++)if(B=U.charCodeAt(Y),y(B))return"rtl";return"ltr"}function f(S){if(typeof S.line=="number"&&(S.snapToLines||S.line>=0&&S.line<=100))return S.line;if(!S.track||!S.track.textTrackList||!S.track.textTrackList.mediaElement)return-1;for(var M=S.track,U=M.textTrackList,B=0,Q=0;Q<U.length&&U[Q]!==M;Q++)U[Q].mode==="showing"&&B++;return++B*-1}function m(){}m.prototype.applyStyles=function(S,M){M=M||this.div;for(var U in S)S.hasOwnProperty(U)&&(M.style[U]=S[U])},m.prototype.formatStyle=function(S,M){return S===0?0:S+M};function _(S,M,U){m.call(this),this.cue=M,this.cueDiv=b(S,M.text);var B={color:"rgba(255, 255, 255, 1)",backgroundColor:"rgba(0, 0, 0, 0.8)",position:"relative",left:0,right:0,top:0,bottom:0,display:"inline",writingMode:M.vertical===""?"horizontal-tb":M.vertical==="lr"?"vertical-lr":"vertical-rl",unicodeBidi:"plaintext"};this.applyStyles(B,this.cueDiv),this.div=S.document.createElement("div"),B={direction:p(this.cueDiv),writingMode:M.vertical===""?"horizontal-tb":M.vertical==="lr"?"vertical-lr":"vertical-rl",unicodeBidi:"plaintext",textAlign:M.align==="middle"?"center":M.align,font:U.font,whiteSpace:"pre-line",position:"absolute"},this.applyStyles(B),this.div.appendChild(this.cueDiv);var Q=0;switch(M.positionAlign){case"start":case"line-left":Q=M.position;break;case"center":Q=M.position-M.size/2;break;case"end":case"line-right":Q=M.position-M.size;break}M.vertical===""?this.applyStyles({left:this.formatStyle(Q,"%"),width:this.formatStyle(M.size,"%")}):this.applyStyles({top:this.formatStyle(Q,"%"),height:this.formatStyle(M.size,"%")}),this.move=function(ie){this.applyStyles({top:this.formatStyle(ie.top,"px"),bottom:this.formatStyle(ie.bottom,"px"),left:this.formatStyle(ie.left,"px"),right:this.formatStyle(ie.right,"px"),height:this.formatStyle(ie.height,"px"),width:this.formatStyle(ie.width,"px")})}}_.prototype=e(m.prototype),_.prototype.constructor=_;function k(S){var M,U,B,Q;if(S.div){U=S.div.offsetHeight,B=S.div.offsetWidth,Q=S.div.offsetTop;var ie=(ie=S.div.childNodes)&&(ie=ie[0])&&ie.getClientRects&&ie.getClientRects();S=S.div.getBoundingClientRect(),M=ie?Math.max(ie[0]&&ie[0].height||0,S.height/ie.length):0}this.left=S.left,this.right=S.right,this.top=S.top||Q,this.height=S.height||U,this.bottom=S.bottom||Q+(S.height||U),this.width=S.width||B,this.lineHeight=M!==void 0?M:S.lineHeight}k.prototype.move=function(S,M){switch(M=M!==void 0?M:this.lineHeight,S){case"+x":this.left+=M,this.right+=M;break;case"-x":this.left-=M,this.right-=M;break;case"+y":this.top+=M,this.bottom+=M;break;case"-y":this.top-=M,this.bottom-=M;break}},k.prototype.overlaps=function(S){return this.left<S.right&&this.right>S.left&&this.top<S.bottom&&this.bottom>S.top},k.prototype.overlapsAny=function(S){for(var M=0;M<S.length;M++)if(this.overlaps(S[M]))return!0;return!1},k.prototype.within=function(S){return this.top>=S.top&&this.bottom<=S.bottom&&this.left>=S.left&&this.right<=S.right},k.prototype.overlapsOppositeAxis=function(S,M){switch(M){case"+x":return this.left<S.left;case"-x":return this.right>S.right;case"+y":return this.top<S.top;case"-y":return this.bottom>S.bottom}},k.prototype.intersectPercentage=function(S){var M=Math.max(0,Math.min(this.right,S.right)-Math.max(this.left,S.left)),U=Math.max(0,Math.min(this.bottom,S.bottom)-Math.max(this.top,S.top)),B=M*U;return B/(this.height*this.width)},k.prototype.toCSSCompatValues=function(S){return{top:this.top-S.top,bottom:S.bottom-this.bottom,left:this.left-S.left,right:S.right-this.right,height:this.height,width:this.width}},k.getSimpleBoxPosition=function(S){var M=S.div?S.div.offsetHeight:S.tagName?S.offsetHeight:0,U=S.div?S.div.offsetWidth:S.tagName?S.offsetWidth:0,B=S.div?S.div.offsetTop:S.tagName?S.offsetTop:0;S=S.div?S.div.getBoundingClientRect():S.tagName?S.getBoundingClientRect():S;var Q={left:S.left,right:S.right,top:S.top||B,height:S.height||M,bottom:S.bottom||B+(S.height||M),width:S.width||U};return Q};function D(S,M,U,B){function Q(ee,fe){for(var xe,Ne=new k(ee),He=1,Be=0;Be<fe.length;Be++){for(;ee.overlapsOppositeAxis(U,fe[Be])||ee.within(U)&&ee.overlapsAny(B);)ee.move(fe[Be]);if(ee.within(U))return ee;var be=ee.intersectPercentage(U);He>be&&(xe=new k(ee),He=be),ee=new k(Ne)}return xe||Ne}var ie=new k(M),Y=M.cue,q=f(Y),L=[];if(Y.snapToLines){var $;switch(Y.vertical){case"":L=["+y","-y"],$="height";break;case"rl":L=["+x","-x"],$="width";break;case"lr":L=["-x","+x"],$="width";break}var H=ie.lineHeight,j=H*Math.round(q),W=U[$]+H,ae=L[0];Math.abs(j)>W&&(j=j<0?-1:1,j*=Math.ceil(W/H)*H),q<0&&(j+=Y.vertical===""?U.height:U.width,L=L.reverse()),ie.move(ae,j)}else{var Ee=ie.lineHeight/U.height*100;switch(Y.lineAlign){case"center":q-=Ee/2;break;case"end":q-=Ee;break}switch(Y.vertical){case"":M.applyStyles({top:M.formatStyle(q,"%")});break;case"rl":M.applyStyles({left:M.formatStyle(q,"%")});break;case"lr":M.applyStyles({right:M.formatStyle(q,"%")});break}L=["+y","-x","+x","-y"],ie=new k(M)}var Ae=Q(ie,L);M.move(Ae.toCSSCompatValues(U))}function w(){}w.StringDecoder=function(){return{decode:function(S){if(!S)return"";if(typeof S!="string")throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(S))}}},w.convertCueToDOMTree=function(S,M){return!S||!M?null:b(S,M)};var A=.05,x="sans-serif",P="1.5%";return w.processCues=function(S,M,U){if(!S||!M||!U)return null;for(;U.firstChild;)U.removeChild(U.firstChild);var B=S.document.createElement("div");B.style.position="absolute",B.style.left="0",B.style.right="0",B.style.top="0",B.style.bottom="0",B.style.margin=P,U.appendChild(B);function Q(H){for(var j=0;j<H.length;j++)if(H[j].hasBeenReset||!H[j].displayState)return!0;return!1}if(!Q(M)){for(var ie=0;ie<M.length;ie++)B.appendChild(M[ie].displayState);return}var Y=[],q=k.getSimpleBoxPosition(B),L=Math.round(q.height*A*100)/100,$={font:L+"px "+x};(function(){for(var H,j,W=0;W<M.length;W++)j=M[W],H=new _(S,j,$),B.appendChild(H.div),D(S,H,q,Y),j.displayState=H.div,Y.push(k.getSimpleBoxPosition(H))})()},w.Parser=function(S,M,U){U||(U=M,M={}),M||(M={}),this.window=S,this.vttjs=M,this.state="INITIAL",this.buffer="",this.decoder=U||new TextDecoder("utf8"),this.regionList=[]},w.Parser.prototype={reportOrThrowError:function(S){if(S instanceof t)this.onparsingerror&&this.onparsingerror(S);else throw S},parse:function(S){var M=this;S&&(M.buffer+=M.decoder.decode(S,{stream:!0}));function U(){for(var H=M.buffer,j=0;j<H.length&&H[j]!=="\r"&&H[j]!==`
34
+ `;)++j;var W=H.substr(0,j);return H[j]==="\r"&&++j,H[j]===`
35
+ `&&++j,M.buffer=H.substr(j),W}function B(H){var j=new r;if(s(H,function(ae,Ee){switch(ae){case"id":j.set(ae,Ee);break;case"width":j.percent(ae,Ee);break;case"lines":j.integer(ae,Ee);break;case"regionanchor":case"viewportanchor":var Ae=Ee.split(",");if(Ae.length!==2)break;var ee=new r;if(ee.percent("x",Ae[0]),ee.percent("y",Ae[1]),!ee.has("x")||!ee.has("y"))break;j.set(ae+"X",ee.get("x")),j.set(ae+"Y",ee.get("y"));break;case"scroll":j.alt(ae,Ee,["up"]);break}},/=/,/\s/),j.has("id")){var W=new(M.vttjs.VTTRegion||M.window.VTTRegion);W.width=j.get("width",100),W.lines=j.get("lines",3),W.regionAnchorX=j.get("regionanchorX",0),W.regionAnchorY=j.get("regionanchorY",100),W.viewportAnchorX=j.get("viewportanchorX",0),W.viewportAnchorY=j.get("viewportanchorY",100),W.scroll=j.get("scroll",""),M.onregion&&M.onregion(W),M.regionList.push({id:j.get("id"),region:W})}}function Q(H){var j=new r;s(H,function(W,ae){switch(W){case"MPEGT":j.integer(W+"S",ae);break;case"LOCA":j.set(W+"L",n(ae));break}},/[^\d]:/,/,/),M.ontimestampmap&&M.ontimestampmap({MPEGTS:j.get("MPEGTS"),LOCAL:j.get("LOCAL")})}function ie(H){H.match(/X-TIMESTAMP-MAP/)?s(H,function(j,W){switch(j){case"X-TIMESTAMP-MAP":Q(W);break}},/=/):s(H,function(j,W){switch(j){case"Region":B(W);break}},/:/)}try{var Y;if(M.state==="INITIAL"){if(!/\r\n|\n/.test(M.buffer))return this;Y=U();var q=Y.match(/^WEBVTT([ \t].*)?$/);if(!q||!q[0])throw new t(t.Errors.BadSignature);M.state="HEADER"}for(var L=!1;M.buffer;){if(!/\r\n|\n/.test(M.buffer))return this;switch(L?L=!1:Y=U(),M.state){case"HEADER":/:/.test(Y)?ie(Y):Y||(M.state="ID");continue;case"NOTE":Y||(M.state="ID");continue;case"ID":if(/^NOTE($|[ \t])/.test(Y)){M.state="NOTE";break}if(!Y)continue;M.cue=new(M.vttjs.VTTCue||M.window.VTTCue)(0,0,"");try{M.cue.align="center"}catch{M.cue.align="middle"}if(M.state="CUE",Y.indexOf("-->")===-1){M.cue.id=Y;continue}case"CUE":try{a(Y,M.cue,M.regionList)}catch(H){M.reportOrThrowError(H),M.cue=null,M.state="BADCUE";continue}M.state="CUETEXT";continue;case"CUETEXT":var $=Y.indexOf("-->")!==-1;if(!Y||$&&(L=!0)){M.oncue&&M.oncue(M.cue),M.cue=null,M.state="ID";continue}M.cue.text&&(M.cue.text+=`
36
+ `),M.cue.text+=Y.replace(/\u2028/g,`
37
+ `).replace(/u2029/g,`
38
+ `);continue;case"BADCUE":Y||(M.state="ID");continue}}}catch(H){M.reportOrThrowError(H),M.state==="CUETEXT"&&M.cue&&M.oncue&&M.oncue(M.cue),M.cue=null,M.state=M.state==="INITIAL"?"BADWEBVTT":"BADCUE"}return this},flush:function(){var S=this;try{if(S.buffer+=S.decoder.decode(),(S.cue||S.state==="HEADER")&&(S.buffer+=`
39
+
40
+ `,S.parse()),S.state==="INITIAL")throw new t(t.Errors.BadSignature)}catch(M){S.reportOrThrowError(M)}return S.onflush&&S.onflush(),this}},gf=w,gf}var vf,Dy;function t6(){if(Dy)return vf;Dy=1;var i="auto",e={"":1,lr:1,rl:1},t={start:1,center:1,end:1,left:1,right:1,auto:1,"line-left":1,"line-right":1};function n(a){if(typeof a!="string")return!1;var o=e[a.toLowerCase()];return o?a.toLowerCase():!1}function r(a){if(typeof a!="string")return!1;var o=t[a.toLowerCase()];return o?a.toLowerCase():!1}function s(a,o,c){this.hasBeenReset=!1;var u="",d=!1,h=a,b=o,v=c,y=null,p="",f=!0,m="auto",_="start",k="auto",D="auto",w=100,A="center";Object.defineProperties(this,{id:{enumerable:!0,get:function(){return u},set:function(x){u=""+x}},pauseOnExit:{enumerable:!0,get:function(){return d},set:function(x){d=!!x}},startTime:{enumerable:!0,get:function(){return h},set:function(x){if(typeof x!="number")throw new TypeError("Start time must be set to a number.");h=x,this.hasBeenReset=!0}},endTime:{enumerable:!0,get:function(){return b},set:function(x){if(typeof x!="number")throw new TypeError("End time must be set to a number.");b=x,this.hasBeenReset=!0}},text:{enumerable:!0,get:function(){return v},set:function(x){v=""+x,this.hasBeenReset=!0}},region:{enumerable:!0,get:function(){return y},set:function(x){y=x,this.hasBeenReset=!0}},vertical:{enumerable:!0,get:function(){return p},set:function(x){var P=n(x);if(P===!1)throw new SyntaxError("Vertical: an invalid or illegal direction string was specified.");p=P,this.hasBeenReset=!0}},snapToLines:{enumerable:!0,get:function(){return f},set:function(x){f=!!x,this.hasBeenReset=!0}},line:{enumerable:!0,get:function(){return m},set:function(x){if(typeof x!="number"&&x!==i)throw new SyntaxError("Line: an invalid number or illegal string was specified.");m=x,this.hasBeenReset=!0}},lineAlign:{enumerable:!0,get:function(){return _},set:function(x){var P=r(x);P?(_=P,this.hasBeenReset=!0):console.warn("lineAlign: an invalid or illegal string was specified.")}},position:{enumerable:!0,get:function(){return k},set:function(x){if(x<0||x>100)throw new Error("Position must be between 0 and 100.");k=x,this.hasBeenReset=!0}},positionAlign:{enumerable:!0,get:function(){return D},set:function(x){var P=r(x);P?(D=P,this.hasBeenReset=!0):console.warn("positionAlign: an invalid or illegal string was specified.")}},size:{enumerable:!0,get:function(){return w},set:function(x){if(x<0||x>100)throw new Error("Size must be between 0 and 100.");w=x,this.hasBeenReset=!0}},align:{enumerable:!0,get:function(){return A},set:function(x){var P=r(x);if(!P)throw new SyntaxError("align: an invalid or illegal alignment string was specified.");A=P,this.hasBeenReset=!0}}}),this.displayState=void 0}return s.prototype.getCueAsHTML=function(){return WebVTT.convertCueToDOMTree(window,this.text)},vf=s,vf}var yf,Ay;function n6(){if(Ay)return yf;Ay=1;var i={"":!0,up:!0};function e(r){if(typeof r!="string")return!1;var s=i[r.toLowerCase()];return s?r.toLowerCase():!1}function t(r){return typeof r=="number"&&r>=0&&r<=100}function n(){var r=100,s=3,a=0,o=100,c=0,u=100,d="";Object.defineProperties(this,{width:{enumerable:!0,get:function(){return r},set:function(h){if(!t(h))throw new Error("Width must be between 0 and 100.");r=h}},lines:{enumerable:!0,get:function(){return s},set:function(h){if(typeof h!="number")throw new TypeError("Lines must be set to a number.");s=h}},regionAnchorY:{enumerable:!0,get:function(){return o},set:function(h){if(!t(h))throw new Error("RegionAnchorX must be between 0 and 100.");o=h}},regionAnchorX:{enumerable:!0,get:function(){return a},set:function(h){if(!t(h))throw new Error("RegionAnchorY must be between 0 and 100.");a=h}},viewportAnchorY:{enumerable:!0,get:function(){return u},set:function(h){if(!t(h))throw new Error("ViewportAnchorY must be between 0 and 100.");u=h}},viewportAnchorX:{enumerable:!0,get:function(){return c},set:function(h){if(!t(h))throw new Error("ViewportAnchorX must be between 0 and 100.");c=h}},scroll:{enumerable:!0,get:function(){return d},set:function(h){var b=e(h);b===!1?console.warn("Scroll: an invalid or illegal string was specified."):d=b}}})}return yf=n,yf}var Iy;function i6(){if(Iy)return mf.exports;Iy=1;var i=Xc(),e=mf.exports={WebVTT:e6(),VTTCue:t6(),VTTRegion:n6()};i.vttjs=e,i.WebVTT=e.WebVTT;var t=e.VTTCue,n=e.VTTRegion,r=i.VTTCue,s=i.VTTRegion;return e.shim=function(){i.VTTCue=t,i.VTTRegion=n},e.restore=function(){i.VTTCue=r,i.VTTRegion=s},i.VTTCue||e.shim(),mf.exports}var r6=i6();const Py=Ca(r6);function dn(){return dn=Object.assign?Object.assign.bind():function(i){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var n in t)({}).hasOwnProperty.call(t,n)&&(i[n]=t[n])}return i},dn.apply(null,arguments)}var Ny="https://example.com",Jc=function(e,t){if(/^[a-z]+:/i.test(t))return t;/^data:/.test(e)&&(e=te.location&&te.location.href||"");var n=/^\/\//.test(e),r=!te.location&&!/\/\//i.test(e);e=new te.URL(e,te.location||Ny);var s=new URL(t,e);return r?s.href.slice(Ny.length):n?s.href.slice(s.protocol.length):s.href},bf=function(){function i(){this.listeners={}}var e=i.prototype;return e.on=function(n,r){this.listeners[n]||(this.listeners[n]=[]),this.listeners[n].push(r)},e.off=function(n,r){if(!this.listeners[n])return!1;var s=this.listeners[n].indexOf(r);return this.listeners[n]=this.listeners[n].slice(0),this.listeners[n].splice(s,1),s>-1},e.trigger=function(n){var r=this.listeners[n];if(r)if(arguments.length===2)for(var s=r.length,a=0;a<s;++a)r[a].call(this,arguments[1]);else for(var o=Array.prototype.slice.call(arguments,1),c=r.length,u=0;u<c;++u)r[u].apply(this,o)},e.dispose=function(){this.listeners={}},e.pipe=function(n){this.on("data",function(r){n.push(r)})},i}(),s6=function(e){return te.atob?te.atob(e):Buffer.from(e,"base64").toString("binary")};function Oy(i){for(var e=s6(i),t=new Uint8Array(e.length),n=0;n<e.length;n++)t[n]=e.charCodeAt(n);return t}/*! @name m3u8-parser @version 7.2.0 @license Apache-2.0 */class a6 extends bf{constructor(){super(),this.buffer=""}push(e){let t;for(this.buffer+=e,t=this.buffer.indexOf(`
41
+ `);t>-1;t=this.buffer.indexOf(`
42
+ `))this.trigger("data",this.buffer.substring(0,t)),this.buffer=this.buffer.substring(t+1)}}const o6=" ",_f=function(i){const e=/([0-9.]*)?@?([0-9.]*)?/.exec(i||""),t={};return e[1]&&(t.length=parseInt(e[1],10)),e[2]&&(t.offset=parseInt(e[2],10)),t},l6=function(){const t="(?:"+"[^=]*"+")=(?:"+'"[^"]*"|[^,]*'+")";return new RegExp("(?:^|,)("+t+")")},Gn=function(i){const e={};if(!i)return e;const t=i.split(l6());let n=t.length,r;for(;n--;)t[n]!==""&&(r=/([^=]*)=(.*)/.exec(t[n]).slice(1),r[0]=r[0].replace(/^\s+|\s+$/g,""),r[1]=r[1].replace(/^\s+|\s+$/g,""),r[1]=r[1].replace(/^['"](.*)['"]$/g,"$1"),e[r[0]]=r[1]);return e},My=i=>{const e=i.split("x"),t={};return e[0]&&(t.width=parseInt(e[0],10)),e[1]&&(t.height=parseInt(e[1],10)),t};class c6 extends bf{constructor(){super(),this.customParsers=[],this.tagMappers=[]}push(e){let t,n;if(e=e.trim(),e.length===0)return;if(e[0]!=="#"){this.trigger("data",{type:"uri",uri:e});return}this.tagMappers.reduce((s,a)=>{const o=a(e);return o===e?s:s.concat([o])},[e]).forEach(s=>{for(let a=0;a<this.customParsers.length;a++)if(this.customParsers[a].call(this,s))return;if(s.indexOf("#EXT")!==0){this.trigger("data",{type:"comment",text:s.slice(1)});return}if(s=s.replace("\r",""),t=/^#EXTM3U/.exec(s),t){this.trigger("data",{type:"tag",tagType:"m3u"});return}if(t=/^#EXTINF:([0-9\.]*)?,?(.*)?$/.exec(s),t){n={type:"tag",tagType:"inf"},t[1]&&(n.duration=parseFloat(t[1])),t[2]&&(n.title=t[2]),this.trigger("data",n);return}if(t=/^#EXT-X-TARGETDURATION:([0-9.]*)?/.exec(s),t){n={type:"tag",tagType:"targetduration"},t[1]&&(n.duration=parseInt(t[1],10)),this.trigger("data",n);return}if(t=/^#EXT-X-VERSION:([0-9.]*)?/.exec(s),t){n={type:"tag",tagType:"version"},t[1]&&(n.version=parseInt(t[1],10)),this.trigger("data",n);return}if(t=/^#EXT-X-MEDIA-SEQUENCE:(\-?[0-9.]*)?/.exec(s),t){n={type:"tag",tagType:"media-sequence"},t[1]&&(n.number=parseInt(t[1],10)),this.trigger("data",n);return}if(t=/^#EXT-X-DISCONTINUITY-SEQUENCE:(\-?[0-9.]*)?/.exec(s),t){n={type:"tag",tagType:"discontinuity-sequence"},t[1]&&(n.number=parseInt(t[1],10)),this.trigger("data",n);return}if(t=/^#EXT-X-PLAYLIST-TYPE:(.*)?$/.exec(s),t){n={type:"tag",tagType:"playlist-type"},t[1]&&(n.playlistType=t[1]),this.trigger("data",n);return}if(t=/^#EXT-X-BYTERANGE:(.*)?$/.exec(s),t){n=dn(_f(t[1]),{type:"tag",tagType:"byterange"}),this.trigger("data",n);return}if(t=/^#EXT-X-ALLOW-CACHE:(YES|NO)?/.exec(s),t){n={type:"tag",tagType:"allow-cache"},t[1]&&(n.allowed=!/NO/.test(t[1])),this.trigger("data",n);return}if(t=/^#EXT-X-MAP:(.*)$/.exec(s),t){if(n={type:"tag",tagType:"map"},t[1]){const a=Gn(t[1]);a.URI&&(n.uri=a.URI),a.BYTERANGE&&(n.byterange=_f(a.BYTERANGE))}this.trigger("data",n);return}if(t=/^#EXT-X-STREAM-INF:(.*)$/.exec(s),t){n={type:"tag",tagType:"stream-inf"},t[1]&&(n.attributes=Gn(t[1]),n.attributes.RESOLUTION&&(n.attributes.RESOLUTION=My(n.attributes.RESOLUTION)),n.attributes.BANDWIDTH&&(n.attributes.BANDWIDTH=parseInt(n.attributes.BANDWIDTH,10)),n.attributes["FRAME-RATE"]&&(n.attributes["FRAME-RATE"]=parseFloat(n.attributes["FRAME-RATE"])),n.attributes["PROGRAM-ID"]&&(n.attributes["PROGRAM-ID"]=parseInt(n.attributes["PROGRAM-ID"],10))),this.trigger("data",n);return}if(t=/^#EXT-X-MEDIA:(.*)$/.exec(s),t){n={type:"tag",tagType:"media"},t[1]&&(n.attributes=Gn(t[1])),this.trigger("data",n);return}if(t=/^#EXT-X-ENDLIST/.exec(s),t){this.trigger("data",{type:"tag",tagType:"endlist"});return}if(t=/^#EXT-X-DISCONTINUITY/.exec(s),t){this.trigger("data",{type:"tag",tagType:"discontinuity"});return}if(t=/^#EXT-X-PROGRAM-DATE-TIME:(.*)$/.exec(s),t){n={type:"tag",tagType:"program-date-time"},t[1]&&(n.dateTimeString=t[1],n.dateTimeObject=new Date(t[1])),this.trigger("data",n);return}if(t=/^#EXT-X-KEY:(.*)$/.exec(s),t){n={type:"tag",tagType:"key"},t[1]&&(n.attributes=Gn(t[1]),n.attributes.IV&&(n.attributes.IV.substring(0,2).toLowerCase()==="0x"&&(n.attributes.IV=n.attributes.IV.substring(2)),n.attributes.IV=n.attributes.IV.match(/.{8}/g),n.attributes.IV[0]=parseInt(n.attributes.IV[0],16),n.attributes.IV[1]=parseInt(n.attributes.IV[1],16),n.attributes.IV[2]=parseInt(n.attributes.IV[2],16),n.attributes.IV[3]=parseInt(n.attributes.IV[3],16),n.attributes.IV=new Uint32Array(n.attributes.IV))),this.trigger("data",n);return}if(t=/^#EXT-X-START:(.*)$/.exec(s),t){n={type:"tag",tagType:"start"},t[1]&&(n.attributes=Gn(t[1]),n.attributes["TIME-OFFSET"]=parseFloat(n.attributes["TIME-OFFSET"]),n.attributes.PRECISE=/YES/.test(n.attributes.PRECISE)),this.trigger("data",n);return}if(t=/^#EXT-X-CUE-OUT-CONT:(.*)?$/.exec(s),t){n={type:"tag",tagType:"cue-out-cont"},t[1]?n.data=t[1]:n.data="",this.trigger("data",n);return}if(t=/^#EXT-X-CUE-OUT:(.*)?$/.exec(s),t){n={type:"tag",tagType:"cue-out"},t[1]?n.data=t[1]:n.data="",this.trigger("data",n);return}if(t=/^#EXT-X-CUE-IN:?(.*)?$/.exec(s),t){n={type:"tag",tagType:"cue-in"},t[1]?n.data=t[1]:n.data="",this.trigger("data",n);return}if(t=/^#EXT-X-SKIP:(.*)$/.exec(s),t&&t[1]){n={type:"tag",tagType:"skip"},n.attributes=Gn(t[1]),n.attributes.hasOwnProperty("SKIPPED-SEGMENTS")&&(n.attributes["SKIPPED-SEGMENTS"]=parseInt(n.attributes["SKIPPED-SEGMENTS"],10)),n.attributes.hasOwnProperty("RECENTLY-REMOVED-DATERANGES")&&(n.attributes["RECENTLY-REMOVED-DATERANGES"]=n.attributes["RECENTLY-REMOVED-DATERANGES"].split(o6)),this.trigger("data",n);return}if(t=/^#EXT-X-PART:(.*)$/.exec(s),t&&t[1]){n={type:"tag",tagType:"part"},n.attributes=Gn(t[1]),["DURATION"].forEach(function(a){n.attributes.hasOwnProperty(a)&&(n.attributes[a]=parseFloat(n.attributes[a]))}),["INDEPENDENT","GAP"].forEach(function(a){n.attributes.hasOwnProperty(a)&&(n.attributes[a]=/YES/.test(n.attributes[a]))}),n.attributes.hasOwnProperty("BYTERANGE")&&(n.attributes.byterange=_f(n.attributes.BYTERANGE)),this.trigger("data",n);return}if(t=/^#EXT-X-SERVER-CONTROL:(.*)$/.exec(s),t&&t[1]){n={type:"tag",tagType:"server-control"},n.attributes=Gn(t[1]),["CAN-SKIP-UNTIL","PART-HOLD-BACK","HOLD-BACK"].forEach(function(a){n.attributes.hasOwnProperty(a)&&(n.attributes[a]=parseFloat(n.attributes[a]))}),["CAN-SKIP-DATERANGES","CAN-BLOCK-RELOAD"].forEach(function(a){n.attributes.hasOwnProperty(a)&&(n.attributes[a]=/YES/.test(n.attributes[a]))}),this.trigger("data",n);return}if(t=/^#EXT-X-PART-INF:(.*)$/.exec(s),t&&t[1]){n={type:"tag",tagType:"part-inf"},n.attributes=Gn(t[1]),["PART-TARGET"].forEach(function(a){n.attributes.hasOwnProperty(a)&&(n.attributes[a]=parseFloat(n.attributes[a]))}),this.trigger("data",n);return}if(t=/^#EXT-X-PRELOAD-HINT:(.*)$/.exec(s),t&&t[1]){n={type:"tag",tagType:"preload-hint"},n.attributes=Gn(t[1]),["BYTERANGE-START","BYTERANGE-LENGTH"].forEach(function(a){if(n.attributes.hasOwnProperty(a)){n.attributes[a]=parseInt(n.attributes[a],10);const o=a==="BYTERANGE-LENGTH"?"length":"offset";n.attributes.byterange=n.attributes.byterange||{},n.attributes.byterange[o]=n.attributes[a],delete n.attributes[a]}}),this.trigger("data",n);return}if(t=/^#EXT-X-RENDITION-REPORT:(.*)$/.exec(s),t&&t[1]){n={type:"tag",tagType:"rendition-report"},n.attributes=Gn(t[1]),["LAST-MSN","LAST-PART"].forEach(function(a){n.attributes.hasOwnProperty(a)&&(n.attributes[a]=parseInt(n.attributes[a],10))}),this.trigger("data",n);return}if(t=/^#EXT-X-DATERANGE:(.*)$/.exec(s),t&&t[1]){n={type:"tag",tagType:"daterange"},n.attributes=Gn(t[1]),["ID","CLASS"].forEach(function(o){n.attributes.hasOwnProperty(o)&&(n.attributes[o]=String(n.attributes[o]))}),["START-DATE","END-DATE"].forEach(function(o){n.attributes.hasOwnProperty(o)&&(n.attributes[o]=new Date(n.attributes[o]))}),["DURATION","PLANNED-DURATION"].forEach(function(o){n.attributes.hasOwnProperty(o)&&(n.attributes[o]=parseFloat(n.attributes[o]))}),["END-ON-NEXT"].forEach(function(o){n.attributes.hasOwnProperty(o)&&(n.attributes[o]=/YES/i.test(n.attributes[o]))}),["SCTE35-CMD"," SCTE35-OUT","SCTE35-IN"].forEach(function(o){n.attributes.hasOwnProperty(o)&&(n.attributes[o]=n.attributes[o].toString(16))});const a=/^X-([A-Z]+-)+[A-Z]+$/;for(const o in n.attributes){if(!a.test(o))continue;const c=/[0-9A-Fa-f]{6}/g.test(n.attributes[o]),u=/^\d+(\.\d+)?$/.test(n.attributes[o]);n.attributes[o]=c?n.attributes[o].toString(16):u?parseFloat(n.attributes[o]):String(n.attributes[o])}this.trigger("data",n);return}if(t=/^#EXT-X-INDEPENDENT-SEGMENTS/.exec(s),t){this.trigger("data",{type:"tag",tagType:"independent-segments"});return}if(t=/^#EXT-X-I-FRAMES-ONLY/.exec(s),t){this.trigger("data",{type:"tag",tagType:"i-frames-only"});return}if(t=/^#EXT-X-CONTENT-STEERING:(.*)$/.exec(s),t){n={type:"tag",tagType:"content-steering"},n.attributes=Gn(t[1]),this.trigger("data",n);return}if(t=/^#EXT-X-I-FRAME-STREAM-INF:(.*)$/.exec(s),t){n={type:"tag",tagType:"i-frame-playlist"},n.attributes=Gn(t[1]),n.attributes.URI&&(n.uri=n.attributes.URI),n.attributes.BANDWIDTH&&(n.attributes.BANDWIDTH=parseInt(n.attributes.BANDWIDTH,10)),n.attributes.RESOLUTION&&(n.attributes.RESOLUTION=My(n.attributes.RESOLUTION)),n.attributes["AVERAGE-BANDWIDTH"]&&(n.attributes["AVERAGE-BANDWIDTH"]=parseInt(n.attributes["AVERAGE-BANDWIDTH"],10)),n.attributes["FRAME-RATE"]&&(n.attributes["FRAME-RATE"]=parseFloat(n.attributes["FRAME-RATE"])),this.trigger("data",n);return}if(t=/^#EXT-X-DEFINE:(.*)$/.exec(s),t){n={type:"tag",tagType:"define"},n.attributes=Gn(t[1]),this.trigger("data",n);return}this.trigger("data",{type:"tag",data:s.slice(4)})})}addParser({expression:e,customType:t,dataParser:n,segment:r}){typeof n!="function"&&(n=s=>s),this.customParsers.push(s=>{if(e.exec(s))return this.trigger("data",{type:"custom",data:n(s),customType:t,segment:r}),!0})}addTagMapper({expression:e,map:t}){const n=r=>e.test(r)?t(r):r;this.tagMappers.push(n)}}const u6=i=>i.toLowerCase().replace(/-(\w)/g,e=>e[1].toUpperCase()),is=function(i){const e={};return Object.keys(i).forEach(function(t){e[u6(t)]=i[t]}),e},kf=function(i){const{serverControl:e,targetDuration:t,partTargetDuration:n}=i;if(!e)return;const r="#EXT-X-SERVER-CONTROL",s="holdBack",a="partHoldBack",o=t&&t*3,c=n&&n*2;t&&!e.hasOwnProperty(s)&&(e[s]=o,this.trigger("info",{message:`${r} defaulting HOLD-BACK to targetDuration * 3 (${o}).`})),o&&e[s]<o&&(this.trigger("warn",{message:`${r} clamping HOLD-BACK (${e[s]}) to targetDuration * 3 (${o})`}),e[s]=o),n&&!e.hasOwnProperty(a)&&(e[a]=n*3,this.trigger("info",{message:`${r} defaulting PART-HOLD-BACK to partTargetDuration * 3 (${e[a]}).`})),n&&e[a]<c&&(this.trigger("warn",{message:`${r} clamping PART-HOLD-BACK (${e[a]}) to partTargetDuration * 2 (${c}).`}),e[a]=c)};class d6 extends bf{constructor(e={}){super(),this.lineStream=new a6,this.parseStream=new c6,this.lineStream.pipe(this.parseStream),this.mainDefinitions=e.mainDefinitions||{},this.params=new URL(e.uri,"https://a.com").searchParams,this.lastProgramDateTime=null;const t=this,n=[];let r={},s,a,o=!1;const c=function(){},u={AUDIO:{},VIDEO:{},"CLOSED-CAPTIONS":{},SUBTITLES:{}},d="urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed";let h=0;this.manifest={allowCache:!0,discontinuityStarts:[],dateRanges:[],iFramePlaylists:[],segments:[]};let b=0,v=0;const y={};this.on("end",()=>{r.uri||!r.parts&&!r.preloadHints||(!r.map&&s&&(r.map=s),!r.key&&a&&(r.key=a),!r.timeline&&typeof h=="number"&&(r.timeline=h),this.manifest.preloadSegment=r)}),this.parseStream.on("data",function(p){let f,m;if(t.manifest.definitions){for(const _ in t.manifest.definitions)if(p.uri&&(p.uri=p.uri.replace(`{$${_}}`,t.manifest.definitions[_])),p.attributes)for(const k in p.attributes)typeof p.attributes[k]=="string"&&(p.attributes[k]=p.attributes[k].replace(`{$${_}}`,t.manifest.definitions[_]))}({tag(){({version(){p.version&&(this.manifest.version=p.version)},"allow-cache"(){this.manifest.allowCache=p.allowed,"allowed"in p||(this.trigger("info",{message:"defaulting allowCache to YES"}),this.manifest.allowCache=!0)},byterange(){const _={};"length"in p&&(r.byterange=_,_.length=p.length,"offset"in p||(p.offset=b)),"offset"in p&&(r.byterange=_,_.offset=p.offset),b=_.offset+_.length},endlist(){this.manifest.endList=!0},inf(){"mediaSequence"in this.manifest||(this.manifest.mediaSequence=0,this.trigger("info",{message:"defaulting media sequence to zero"})),"discontinuitySequence"in this.manifest||(this.manifest.discontinuitySequence=0,this.trigger("info",{message:"defaulting discontinuity sequence to zero"})),p.title&&(r.title=p.title),p.duration>0&&(r.duration=p.duration),p.duration===0&&(r.duration=.01,this.trigger("info",{message:"updating zero segment duration to a small value"})),this.manifest.segments=n},key(){if(!p.attributes){this.trigger("warn",{message:"ignoring key declaration without attribute list"});return}if(p.attributes.METHOD==="NONE"){a=null;return}if(!p.attributes.URI){this.trigger("warn",{message:"ignoring key declaration without URI"});return}if(p.attributes.KEYFORMAT==="com.apple.streamingkeydelivery"){this.manifest.contentProtection=this.manifest.contentProtection||{},this.manifest.contentProtection["com.apple.fps.1_0"]={attributes:p.attributes};return}if(p.attributes.KEYFORMAT==="com.microsoft.playready"){this.manifest.contentProtection=this.manifest.contentProtection||{},this.manifest.contentProtection["com.microsoft.playready"]={uri:p.attributes.URI};return}if(p.attributes.KEYFORMAT===d){if(["SAMPLE-AES","SAMPLE-AES-CTR","SAMPLE-AES-CENC"].indexOf(p.attributes.METHOD)===-1){this.trigger("warn",{message:"invalid key method provided for Widevine"});return}if(p.attributes.METHOD==="SAMPLE-AES-CENC"&&this.trigger("warn",{message:"SAMPLE-AES-CENC is deprecated, please use SAMPLE-AES-CTR instead"}),p.attributes.URI.substring(0,23)!=="data:text/plain;base64,"){this.trigger("warn",{message:"invalid key URI provided for Widevine"});return}if(!(p.attributes.KEYID&&p.attributes.KEYID.substring(0,2)==="0x")){this.trigger("warn",{message:"invalid key ID provided for Widevine"});return}this.manifest.contentProtection=this.manifest.contentProtection||{},this.manifest.contentProtection["com.widevine.alpha"]={attributes:{schemeIdUri:p.attributes.KEYFORMAT,keyId:p.attributes.KEYID.substring(2)},pssh:Oy(p.attributes.URI.split(",")[1])};return}p.attributes.METHOD||this.trigger("warn",{message:"defaulting key method to AES-128"}),a={method:p.attributes.METHOD||"AES-128",uri:p.attributes.URI},typeof p.attributes.IV<"u"&&(a.iv=p.attributes.IV)},"media-sequence"(){if(!isFinite(p.number)){this.trigger("warn",{message:"ignoring invalid media sequence: "+p.number});return}this.manifest.mediaSequence=p.number},"discontinuity-sequence"(){if(!isFinite(p.number)){this.trigger("warn",{message:"ignoring invalid discontinuity sequence: "+p.number});return}this.manifest.discontinuitySequence=p.number,h=p.number},"playlist-type"(){if(!/VOD|EVENT/.test(p.playlistType)){this.trigger("warn",{message:"ignoring unknown playlist type: "+p.playlist});return}this.manifest.playlistType=p.playlistType},map(){s={},p.uri&&(s.uri=p.uri),p.byterange&&(s.byterange=p.byterange),a&&(s.key=a)},"stream-inf"(){if(this.manifest.playlists=n,this.manifest.mediaGroups=this.manifest.mediaGroups||u,!p.attributes){this.trigger("warn",{message:"ignoring empty stream-inf attributes"});return}r.attributes||(r.attributes={}),dn(r.attributes,p.attributes)},media(){if(this.manifest.mediaGroups=this.manifest.mediaGroups||u,!(p.attributes&&p.attributes.TYPE&&p.attributes["GROUP-ID"]&&p.attributes.NAME)){this.trigger("warn",{message:"ignoring incomplete or missing media group"});return}const _=this.manifest.mediaGroups[p.attributes.TYPE];_[p.attributes["GROUP-ID"]]=_[p.attributes["GROUP-ID"]]||{},f=_[p.attributes["GROUP-ID"]],m={default:/yes/i.test(p.attributes.DEFAULT)},m.default?m.autoselect=!0:m.autoselect=/yes/i.test(p.attributes.AUTOSELECT),p.attributes.LANGUAGE&&(m.language=p.attributes.LANGUAGE),p.attributes.URI&&(m.uri=p.attributes.URI),p.attributes["INSTREAM-ID"]&&(m.instreamId=p.attributes["INSTREAM-ID"]),p.attributes.CHARACTERISTICS&&(m.characteristics=p.attributes.CHARACTERISTICS),p.attributes.FORCED&&(m.forced=/yes/i.test(p.attributes.FORCED)),f[p.attributes.NAME]=m},discontinuity(){h+=1,r.discontinuity=!0,this.manifest.discontinuityStarts.push(n.length)},"program-date-time"(){typeof this.manifest.dateTimeString>"u"&&(this.manifest.dateTimeString=p.dateTimeString,this.manifest.dateTimeObject=p.dateTimeObject),r.dateTimeString=p.dateTimeString,r.dateTimeObject=p.dateTimeObject;const{lastProgramDateTime:_}=this;this.lastProgramDateTime=new Date(p.dateTimeString).getTime(),_===null&&this.manifest.segments.reduceRight((k,D)=>(D.programDateTime=k-D.duration*1e3,D.programDateTime),this.lastProgramDateTime)},targetduration(){if(!isFinite(p.duration)||p.duration<0){this.trigger("warn",{message:"ignoring invalid target duration: "+p.duration});return}this.manifest.targetDuration=p.duration,kf.call(this,this.manifest)},start(){if(!p.attributes||isNaN(p.attributes["TIME-OFFSET"])){this.trigger("warn",{message:"ignoring start declaration without appropriate attribute list"});return}this.manifest.start={timeOffset:p.attributes["TIME-OFFSET"],precise:p.attributes.PRECISE}},"cue-out"(){r.cueOut=p.data},"cue-out-cont"(){r.cueOutCont=p.data},"cue-in"(){r.cueIn=p.data},skip(){this.manifest.skip=is(p.attributes),this.warnOnMissingAttributes_("#EXT-X-SKIP",p.attributes,["SKIPPED-SEGMENTS"])},part(){o=!0;const _=this.manifest.segments.length,k=is(p.attributes);r.parts=r.parts||[],r.parts.push(k),k.byterange&&(k.byterange.hasOwnProperty("offset")||(k.byterange.offset=v),v=k.byterange.offset+k.byterange.length);const D=r.parts.length-1;this.warnOnMissingAttributes_(`#EXT-X-PART #${D} for segment #${_}`,p.attributes,["URI","DURATION"]),this.manifest.renditionReports&&this.manifest.renditionReports.forEach((w,A)=>{w.hasOwnProperty("lastPart")||this.trigger("warn",{message:`#EXT-X-RENDITION-REPORT #${A} lacks required attribute(s): LAST-PART`})})},"server-control"(){const _=this.manifest.serverControl=is(p.attributes);_.hasOwnProperty("canBlockReload")||(_.canBlockReload=!1,this.trigger("info",{message:"#EXT-X-SERVER-CONTROL defaulting CAN-BLOCK-RELOAD to false"})),kf.call(this,this.manifest),_.canSkipDateranges&&!_.hasOwnProperty("canSkipUntil")&&this.trigger("warn",{message:"#EXT-X-SERVER-CONTROL lacks required attribute CAN-SKIP-UNTIL which is required when CAN-SKIP-DATERANGES is set"})},"preload-hint"(){const _=this.manifest.segments.length,k=is(p.attributes),D=k.type&&k.type==="PART";r.preloadHints=r.preloadHints||[],r.preloadHints.push(k),k.byterange&&(k.byterange.hasOwnProperty("offset")||(k.byterange.offset=D?v:0,D&&(v=k.byterange.offset+k.byterange.length)));const w=r.preloadHints.length-1;if(this.warnOnMissingAttributes_(`#EXT-X-PRELOAD-HINT #${w} for segment #${_}`,p.attributes,["TYPE","URI"]),!!k.type)for(let A=0;A<r.preloadHints.length-1;A++){const x=r.preloadHints[A];x.type&&x.type===k.type&&this.trigger("warn",{message:`#EXT-X-PRELOAD-HINT #${w} for segment #${_} has the same TYPE ${k.type} as preload hint #${A}`})}},"rendition-report"(){const _=is(p.attributes);this.manifest.renditionReports=this.manifest.renditionReports||[],this.manifest.renditionReports.push(_);const k=this.manifest.renditionReports.length-1,D=["LAST-MSN","URI"];o&&D.push("LAST-PART"),this.warnOnMissingAttributes_(`#EXT-X-RENDITION-REPORT #${k}`,p.attributes,D)},"part-inf"(){this.manifest.partInf=is(p.attributes),this.warnOnMissingAttributes_("#EXT-X-PART-INF",p.attributes,["PART-TARGET"]),this.manifest.partInf.partTarget&&(this.manifest.partTargetDuration=this.manifest.partInf.partTarget),kf.call(this,this.manifest)},daterange(){this.manifest.dateRanges.push(is(p.attributes));const _=this.manifest.dateRanges.length-1;this.warnOnMissingAttributes_(`#EXT-X-DATERANGE #${_}`,p.attributes,["ID","START-DATE"]);const k=this.manifest.dateRanges[_];k.endDate&&k.startDate&&new Date(k.endDate)<new Date(k.startDate)&&this.trigger("warn",{message:"EXT-X-DATERANGE END-DATE must be equal to or later than the value of the START-DATE"}),k.duration&&k.duration<0&&this.trigger("warn",{message:"EXT-X-DATERANGE DURATION must not be negative"}),k.plannedDuration&&k.plannedDuration<0&&this.trigger("warn",{message:"EXT-X-DATERANGE PLANNED-DURATION must not be negative"});const D=!!k.endOnNext;if(D&&!k.class&&this.trigger("warn",{message:"EXT-X-DATERANGE with an END-ON-NEXT=YES attribute must have a CLASS attribute"}),D&&(k.duration||k.endDate)&&this.trigger("warn",{message:"EXT-X-DATERANGE with an END-ON-NEXT=YES attribute must not contain DURATION or END-DATE attributes"}),k.duration&&k.endDate){const A=k.startDate.getTime()+k.duration*1e3;this.manifest.dateRanges[_].endDate=new Date(A)}if(!y[k.id])y[k.id]=k;else{for(const A in y[k.id])if(k[A]&&JSON.stringify(y[k.id][A])!==JSON.stringify(k[A])){this.trigger("warn",{message:"EXT-X-DATERANGE tags with the same ID in a playlist must have the same attributes values"});break}const w=this.manifest.dateRanges.findIndex(A=>A.id===k.id);this.manifest.dateRanges[w]=dn(this.manifest.dateRanges[w],k),y[k.id]=dn(y[k.id],k),this.manifest.dateRanges.pop()}},"independent-segments"(){this.manifest.independentSegments=!0},"i-frames-only"(){this.manifest.iFramesOnly=!0,this.requiredCompatibilityversion(this.manifest.version,4)},"content-steering"(){this.manifest.contentSteering=is(p.attributes),this.warnOnMissingAttributes_("#EXT-X-CONTENT-STEERING",p.attributes,["SERVER-URI"])},define(){this.manifest.definitions=this.manifest.definitions||{};const _=(k,D)=>{if(k in this.manifest.definitions){this.trigger("error",{message:`EXT-X-DEFINE: Duplicate name ${k}`});return}this.manifest.definitions[k]=D};if("QUERYPARAM"in p.attributes){if("NAME"in p.attributes||"IMPORT"in p.attributes){this.trigger("error",{message:"EXT-X-DEFINE: Invalid attributes"});return}const k=this.params.get(p.attributes.QUERYPARAM);if(!k){this.trigger("error",{message:`EXT-X-DEFINE: No query param ${p.attributes.QUERYPARAM}`});return}_(p.attributes.QUERYPARAM,decodeURIComponent(k));return}if("NAME"in p.attributes){if("IMPORT"in p.attributes){this.trigger("error",{message:"EXT-X-DEFINE: Invalid attributes"});return}if(!("VALUE"in p.attributes)||typeof p.attributes.VALUE!="string"){this.trigger("error",{message:`EXT-X-DEFINE: No value for ${p.attributes.NAME}`});return}_(p.attributes.NAME,p.attributes.VALUE);return}if("IMPORT"in p.attributes){if(!this.mainDefinitions[p.attributes.IMPORT]){this.trigger("error",{message:`EXT-X-DEFINE: No value ${p.attributes.IMPORT} to import, or IMPORT used on main playlist`});return}_(p.attributes.IMPORT,this.mainDefinitions[p.attributes.IMPORT]);return}this.trigger("error",{message:"EXT-X-DEFINE: No attribute"})},"i-frame-playlist"(){this.manifest.iFramePlaylists.push({attributes:p.attributes,uri:p.uri,timeline:h}),this.warnOnMissingAttributes_("#EXT-X-I-FRAME-STREAM-INF",p.attributes,["BANDWIDTH","URI"])}}[p.tagType]||c).call(t)},uri(){r.uri=p.uri,n.push(r),this.manifest.targetDuration&&!("duration"in r)&&(this.trigger("warn",{message:"defaulting segment duration to the target duration"}),r.duration=this.manifest.targetDuration),a&&(r.key=a),r.timeline=h,s&&(r.map=s),v=0,this.lastProgramDateTime!==null&&(r.programDateTime=this.lastProgramDateTime,this.lastProgramDateTime+=r.duration*1e3),r={}},comment(){},custom(){p.segment?(r.custom=r.custom||{},r.custom[p.customType]=p.data):(this.manifest.custom=this.manifest.custom||{},this.manifest.custom[p.customType]=p.data)}})[p.type].call(t)})}requiredCompatibilityversion(e,t){(e<t||!e)&&this.trigger("warn",{message:`manifest must be at least version ${t}`})}warnOnMissingAttributes_(e,t,n){const r=[];n.forEach(function(s){t.hasOwnProperty(s)||r.push(s)}),r.length&&this.trigger("warn",{message:`${e} lacks required attribute(s): ${r.join(", ")}`})}push(e){this.lineStream.push(e)}end(){this.lineStream.push(`
43
+ `),this.manifest.dateRanges.length&&this.lastProgramDateTime===null&&this.trigger("warn",{message:"A playlist with EXT-X-DATERANGE tag must contain atleast one EXT-X-PROGRAM-DATE-TIME tag"}),this.lastProgramDateTime=null,this.trigger("end")}addParser(e){this.parseStream.addParser(e)}addTagMapper(e){this.parseStream.addTagMapper(e)}}var Ms={mp4:/^(av0?1|avc0?[1234]|vp0?9|flac|opus|mp3|mp4a|mp4v|stpp.ttml.im1t)/,webm:/^(vp0?[89]|av0?1|opus|vorbis)/,ogg:/^(vp0?[89]|theora|flac|opus|vorbis)/,video:/^(av0?1|avc0?[1234]|vp0?[89]|hvc1|hev1|theora|mp4v)/,audio:/^(mp4a|flac|vorbis|opus|ac-[34]|ec-3|alac|mp3|speex|aac)/,text:/^(stpp.ttml.im1t)/,muxerVideo:/^(avc0?1)/,muxerAudio:/^(mp4a)/,muxerText:/a^/},h6=["video","audio","text"],Ry=["Video","Audio","Text"],Ly=function(e){return e&&e.replace(/avc1\.(\d+)\.(\d+)/i,function(t,n,r){var s=("00"+Number(n).toString(16)).slice(-2),a=("00"+Number(r).toString(16)).slice(-2);return"avc1."+s+"00"+a})},rr=function(e){e===void 0&&(e="");var t=e.split(","),n=[];return t.forEach(function(r){r=r.trim();var s;h6.forEach(function(a){var o=Ms[a].exec(r.toLowerCase());if(!(!o||o.length<=1)){s=a;var c=r.substring(0,o[1].length),u=r.replace(c,"");n.push({type:c,details:u,mediaType:a})}}),s||n.push({type:r,details:"",mediaType:"unknown"})}),n},f6=function(e,t){if(!e.mediaGroups.AUDIO||!t)return null;var n=e.mediaGroups.AUDIO[t];if(!n)return null;for(var r in n){var s=n[r];if(s.default&&s.playlists)return rr(s.playlists[0].attributes.CODECS)}return null},By=function(e){return e===void 0&&(e=""),Ms.audio.test(e.trim().toLowerCase())},p6=function(e){return e===void 0&&(e=""),Ms.text.test(e.trim().toLowerCase())},Aa=function(e){if(!(!e||typeof e!="string")){var t=e.toLowerCase().split(",").map(function(s){return Ly(s.trim())}),n="video";t.length===1&&By(t[0])?n="audio":t.length===1&&p6(t[0])&&(n="application");var r="mp4";return t.every(function(s){return Ms.mp4.test(s)})?r="mp4":t.every(function(s){return Ms.webm.test(s)})?r="webm":t.every(function(s){return Ms.ogg.test(s)})&&(r="ogg"),n+"/"+r+';codecs="'+e+'"'}},Zo=function(e,t){return e===void 0&&(e=""),t===void 0&&(t=!1),te.MediaSource&&te.MediaSource.isTypeSupported&&te.MediaSource.isTypeSupported(Aa(e))||t&&te.ManagedMediaSource&&te.ManagedMediaSource.isTypeSupported&&te.ManagedMediaSource.isTypeSupported(Aa(e))||!1},Tf=function(e){return e===void 0&&(e=""),e.toLowerCase().split(",").every(function(t){t=t.trim();for(var n=0;n<Ry.length;n++){var r=Ry[n];if(Ms["muxer"+r].test(t))return!0}return!1})},Uy="mp4a.40.2",m6="avc1.4d400d",g6=/^(audio|video|application)\/(x-|vnd\.apple\.)?mpegurl/i,v6=/^application\/dash\+xml/i,Fy=function(e){return g6.test(e)?"hls":v6.test(e)?"dash":e==="application/vnd.videojs.vhs+json"?"vhs-json":null},y6=function(e){return e.toString(2).length},b6=function(e){return Math.ceil(y6(e)/8)},Vy=function(e){return ArrayBuffer.isView==="function"?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer},_6=function(e){return Vy(e)},st=function(e){return e instanceof Uint8Array?e:(!Array.isArray(e)&&!_6(e)&&!(e instanceof ArrayBuffer)&&(typeof e!="number"||typeof e=="number"&&e!==e?e=0:e=[e]),new Uint8Array(e&&e.buffer||e,e&&e.byteOffset||0,e&&e.byteLength||0))},wn=te.BigInt||Number,Sf=[wn("0x1"),wn("0x100"),wn("0x10000"),wn("0x1000000"),wn("0x100000000"),wn("0x10000000000"),wn("0x1000000000000"),wn("0x100000000000000"),wn("0x10000000000000000")];(function(){var i=new Uint16Array([65484]),e=new Uint8Array(i.buffer,i.byteOffset,i.byteLength);return e[0]===255?"big":e[0]===204?"little":"unknown"})();var k6=function(e,t){var n=t===void 0?{}:t,r=n.signed,s=r===void 0?!1:r,a=n.le,o=a===void 0?!1:a;e=st(e);var c=o?"reduce":"reduceRight",u=e[c]?e[c]:Array.prototype[c],d=u.call(e,function(b,v,y){var p=o?y:Math.abs(y+1-e.length);return b+wn(v)*Sf[p]},wn(0));if(s){var h=Sf[e.length]/wn(2)-wn(1);d=wn(d),d>h&&(d-=h,d-=h,d-=wn(2))}return Number(d)},T6=function(e,t){var n={},r=n.le,s=r===void 0?!1:r;(typeof e!="bigint"&&typeof e!="number"||typeof e=="number"&&e!==e)&&(e=0),e=wn(e);for(var a=b6(e),o=new Uint8Array(new ArrayBuffer(a)),c=0;c<a;c++){var u=s?c:Math.abs(c+1-o.length);o[u]=Number(e/Sf[c]&wn(255)),e<0&&(o[u]=Math.abs(~o[u]),o[u]-=c===0?1:2)}return o},jy=function(e,t){if(typeof e!="string"&&e&&typeof e.toString=="function"&&(e=e.toString()),typeof e!="string")return new Uint8Array;t||(e=unescape(encodeURIComponent(e)));for(var n=new Uint8Array(e.length),r=0;r<e.length;r++)n[r]=e.charCodeAt(r);return n},S6=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];if(t=t.filter(function(o){return o&&(o.byteLength||o.length)&&typeof o!="string"}),t.length<=1)return st(t[0]);var r=t.reduce(function(o,c,u){return o+(c.byteLength||c.length)},0),s=new Uint8Array(r),a=0;return t.forEach(function(o){o=st(o),s.set(o,a),a+=o.byteLength}),s},Xt=function(e,t,n){var r=n===void 0?{}:n,s=r.offset,a=s===void 0?0:s,o=r.mask,c=o===void 0?[]:o;e=st(e),t=st(t);var u=t.every?t.every:Array.prototype.every;return t.length&&e.length-a>=t.length&&u.call(t,function(d,h){var b=c[h]?c[h]&e[a+h]:e[a+h];return d===b})},C6=function(e,t,n){t.forEach(function(r){for(var s in e.mediaGroups[r])for(var a in e.mediaGroups[r][s]){var o=e.mediaGroups[r][s][a];n(o,r,s,a)}})},el={},Dr={},Rs={},$y;function Qc(){if($y)return Rs;$y=1;function i(s,a,o){if(o===void 0&&(o=Array.prototype),s&&typeof o.find=="function")return o.find.call(s,a);for(var c=0;c<s.length;c++)if(Object.prototype.hasOwnProperty.call(s,c)){var u=s[c];if(a.call(void 0,u,c,s))return u}}function e(s,a){return a===void 0&&(a=Object),a&&typeof a.freeze=="function"?a.freeze(s):s}function t(s,a){if(s===null||typeof s!="object")throw new TypeError("target is not an object");for(var o in a)Object.prototype.hasOwnProperty.call(a,o)&&(s[o]=a[o]);return s}var n=e({HTML:"text/html",isHTML:function(s){return s===n.HTML},XML_APPLICATION:"application/xml",XML_TEXT:"text/xml",XML_XHTML_APPLICATION:"application/xhtml+xml",XML_SVG_IMAGE:"image/svg+xml"}),r=e({HTML:"http://www.w3.org/1999/xhtml",isHTML:function(s){return s===r.HTML},SVG:"http://www.w3.org/2000/svg",XML:"http://www.w3.org/XML/1998/namespace",XMLNS:"http://www.w3.org/2000/xmlns/"});return Rs.assign=t,Rs.find=i,Rs.freeze=e,Rs.MIME_TYPE=n,Rs.NAMESPACE=r,Rs}var Hy;function qy(){if(Hy)return Dr;Hy=1;var i=Qc(),e=i.find,t=i.NAMESPACE;function n(V){return V!==""}function r(V){return V?V.split(/[\t\n\f\r ]+/).filter(n):[]}function s(V,G){return V.hasOwnProperty(G)||(V[G]=!0),V}function a(V){if(!V)return[];var G=r(V);return Object.keys(G.reduce(s,{}))}function o(V){return function(G){return V&&V.indexOf(G)!==-1}}function c(V,G){for(var se in V)Object.prototype.hasOwnProperty.call(V,se)&&(G[se]=V[se])}function u(V,G){var se=V.prototype;if(!(se instanceof G)){let ve=function(){};ve.prototype=G.prototype,ve=new ve,c(se,ve),V.prototype=se=ve}se.constructor!=V&&(typeof V!="function"&&console.error("unknown Class:"+V),se.constructor=V)}var d={},h=d.ELEMENT_NODE=1,b=d.ATTRIBUTE_NODE=2,v=d.TEXT_NODE=3,y=d.CDATA_SECTION_NODE=4,p=d.ENTITY_REFERENCE_NODE=5,f=d.ENTITY_NODE=6,m=d.PROCESSING_INSTRUCTION_NODE=7,_=d.COMMENT_NODE=8,k=d.DOCUMENT_NODE=9,D=d.DOCUMENT_TYPE_NODE=10,w=d.DOCUMENT_FRAGMENT_NODE=11,A=d.NOTATION_NODE=12,x={},P={};x.INDEX_SIZE_ERR=(P[1]="Index size error",1),x.DOMSTRING_SIZE_ERR=(P[2]="DOMString size error",2);var S=x.HIERARCHY_REQUEST_ERR=(P[3]="Hierarchy request error",3);x.WRONG_DOCUMENT_ERR=(P[4]="Wrong document",4),x.INVALID_CHARACTER_ERR=(P[5]="Invalid character",5),x.NO_DATA_ALLOWED_ERR=(P[6]="No data allowed",6),x.NO_MODIFICATION_ALLOWED_ERR=(P[7]="No modification allowed",7);var M=x.NOT_FOUND_ERR=(P[8]="Not found",8);x.NOT_SUPPORTED_ERR=(P[9]="Not supported",9);var U=x.INUSE_ATTRIBUTE_ERR=(P[10]="Attribute in use",10);x.INVALID_STATE_ERR=(P[11]="Invalid state",11),x.SYNTAX_ERR=(P[12]="Syntax error",12),x.INVALID_MODIFICATION_ERR=(P[13]="Invalid modification",13),x.NAMESPACE_ERR=(P[14]="Invalid namespace",14),x.INVALID_ACCESS_ERR=(P[15]="Invalid access",15);function B(V,G){if(G instanceof Error)var se=G;else se=this,Error.call(this,P[V]),this.message=P[V],Error.captureStackTrace&&Error.captureStackTrace(this,B);return se.code=V,G&&(this.message=this.message+": "+G),se}B.prototype=Error.prototype,c(x,B);function Q(){}Q.prototype={length:0,item:function(V){return V>=0&&V<this.length?this[V]:null},toString:function(V,G){for(var se=[],ve=0;ve<this.length;ve++)Jn(this[ve],se,V,G);return se.join("")},filter:function(V){return Array.prototype.filter.call(this,V)},indexOf:function(V){return Array.prototype.indexOf.call(this,V)}};function ie(V,G){this._node=V,this._refresh=G,Y(this)}function Y(V){var G=V._node._inc||V._node.ownerDocument._inc;if(V._inc!==G){var se=V._refresh(V._node);if(zr(V,"length",se.length),!V.$$length||se.length<V.$$length)for(var ve=se.length;ve in V;ve++)Object.prototype.hasOwnProperty.call(V,ve)&&delete V[ve];c(se,V),V._inc=G}}ie.prototype.item=function(V){return Y(this),this[V]||null},u(ie,Q);function q(){}function L(V,G){for(var se=V.length;se--;)if(V[se]===G)return se}function $(V,G,se,ve){if(ve?G[L(G,ve)]=se:G[G.length++]=se,V){se.ownerElement=V;var We=V.ownerDocument;We&&(ve&&fe(We,V,ve),ee(We,V,se))}}function H(V,G,se){var ve=L(G,se);if(ve>=0){for(var We=G.length-1;ve<We;)G[ve]=G[++ve];if(G.length=We,V){var at=V.ownerDocument;at&&(fe(at,V,se),se.ownerElement=null)}}else throw new B(M,new Error(V.tagName+"@"+se))}q.prototype={length:0,item:Q.prototype.item,getNamedItem:function(V){for(var G=this.length;G--;){var se=this[G];if(se.nodeName==V)return se}},setNamedItem:function(V){var G=V.ownerElement;if(G&&G!=this._ownerElement)throw new B(U);var se=this.getNamedItem(V.nodeName);return $(this._ownerElement,this,V,se),se},setNamedItemNS:function(V){var G=V.ownerElement,se;if(G&&G!=this._ownerElement)throw new B(U);return se=this.getNamedItemNS(V.namespaceURI,V.localName),$(this._ownerElement,this,V,se),se},removeNamedItem:function(V){var G=this.getNamedItem(V);return H(this._ownerElement,this,G),G},removeNamedItemNS:function(V,G){var se=this.getNamedItemNS(V,G);return H(this._ownerElement,this,se),se},getNamedItemNS:function(V,G){for(var se=this.length;se--;){var ve=this[se];if(ve.localName==G&&ve.namespaceURI==V)return ve}return null}};function j(){}j.prototype={hasFeature:function(V,G){return!0},createDocument:function(V,G,se){var ve=new Ae;if(ve.implementation=this,ve.childNodes=new Q,ve.doctype=se||null,se&&ve.appendChild(se),G){var We=ve.createElementNS(V,G);ve.appendChild(We)}return ve},createDocumentType:function(V,G,se){var ve=new _t;return ve.name=V,ve.nodeName=V,ve.publicId=G||"",ve.systemId=se||"",ve}};function W(){}W.prototype={firstChild:null,lastChild:null,previousSibling:null,nextSibling:null,attributes:null,parentNode:null,childNodes:null,ownerDocument:null,nodeValue:null,namespaceURI:null,prefix:null,localName:null,insertBefore:function(V,G){return Ke(this,V,G)},replaceChild:function(V,G){Ke(this,V,G,Ve),G&&this.removeChild(G)},removeChild:function(V){return Ne(this,V)},appendChild:function(V){return this.insertBefore(V,null)},hasChildNodes:function(){return this.firstChild!=null},cloneNode:function(V){return Tr(this.ownerDocument||this,this,V)},normalize:function(){for(var V=this.firstChild;V;){var G=V.nextSibling;G&&G.nodeType==v&&V.nodeType==v?(this.removeChild(G),V.appendData(G.data)):(V.normalize(),V=G)}},isSupported:function(V,G){return this.ownerDocument.implementation.hasFeature(V,G)},hasAttributes:function(){return this.attributes.length>0},lookupPrefix:function(V){for(var G=this;G;){var se=G._nsMap;if(se){for(var ve in se)if(Object.prototype.hasOwnProperty.call(se,ve)&&se[ve]===V)return ve}G=G.nodeType==b?G.ownerDocument:G.parentNode}return null},lookupNamespaceURI:function(V){for(var G=this;G;){var se=G._nsMap;if(se&&Object.prototype.hasOwnProperty.call(se,V))return se[V];G=G.nodeType==b?G.ownerDocument:G.parentNode}return null},isDefaultNamespace:function(V){var G=this.lookupPrefix(V);return G==null}};function ae(V){return V=="<"&&"&lt;"||V==">"&&"&gt;"||V=="&"&&"&amp;"||V=='"'&&"&quot;"||"&#"+V.charCodeAt()+";"}c(d,W),c(d,W.prototype);function Ee(V,G){if(G(V))return!0;if(V=V.firstChild)do if(Ee(V,G))return!0;while(V=V.nextSibling)}function Ae(){this.ownerDocument=this}function ee(V,G,se){V&&V._inc++;var ve=se.namespaceURI;ve===t.XMLNS&&(G._nsMap[se.prefix?se.localName:""]=se.value)}function fe(V,G,se,ve){V&&V._inc++;var We=se.namespaceURI;We===t.XMLNS&&delete G._nsMap[se.prefix?se.localName:""]}function xe(V,G,se){if(V&&V._inc){V._inc++;var ve=G.childNodes;if(se)ve[ve.length++]=se;else{for(var We=G.firstChild,at=0;We;)ve[at++]=We,We=We.nextSibling;ve.length=at,delete ve[ve.length]}}}function Ne(V,G){var se=G.previousSibling,ve=G.nextSibling;return se?se.nextSibling=ve:V.firstChild=ve,ve?ve.previousSibling=se:V.lastChild=se,G.parentNode=null,G.previousSibling=null,G.nextSibling=null,xe(V.ownerDocument,V),G}function He(V){return V&&(V.nodeType===W.DOCUMENT_NODE||V.nodeType===W.DOCUMENT_FRAGMENT_NODE||V.nodeType===W.ELEMENT_NODE)}function Be(V){return V&&(Fe(V)||le(V)||be(V)||V.nodeType===W.DOCUMENT_FRAGMENT_NODE||V.nodeType===W.COMMENT_NODE||V.nodeType===W.PROCESSING_INSTRUCTION_NODE)}function be(V){return V&&V.nodeType===W.DOCUMENT_TYPE_NODE}function Fe(V){return V&&V.nodeType===W.ELEMENT_NODE}function le(V){return V&&V.nodeType===W.TEXT_NODE}function ze(V,G){var se=V.childNodes||[];if(e(se,Fe)||be(G))return!1;var ve=e(se,be);return!(G&&ve&&se.indexOf(ve)>se.indexOf(G))}function oe(V,G){var se=V.childNodes||[];function ve(at){return Fe(at)&&at!==G}if(e(se,ve))return!1;var We=e(se,be);return!(G&&We&&se.indexOf(We)>se.indexOf(G))}function de(V,G,se){if(!He(V))throw new B(S,"Unexpected parent node type "+V.nodeType);if(se&&se.parentNode!==V)throw new B(M,"child not in parent");if(!Be(G)||be(G)&&V.nodeType!==W.DOCUMENT_NODE)throw new B(S,"Unexpected node type "+G.nodeType+" for parent node type "+V.nodeType)}function Le(V,G,se){var ve=V.childNodes||[],We=G.childNodes||[];if(G.nodeType===W.DOCUMENT_FRAGMENT_NODE){var at=We.filter(Fe);if(at.length>1||e(We,le))throw new B(S,"More than one element or text in fragment");if(at.length===1&&!ze(V,se))throw new B(S,"Element in fragment can not be inserted before doctype")}if(Fe(G)&&!ze(V,se))throw new B(S,"Only one element can be added and only after doctype");if(be(G)){if(e(ve,be))throw new B(S,"Only one doctype is allowed");var Et=e(ve,Fe);if(se&&ve.indexOf(Et)<ve.indexOf(se))throw new B(S,"Doctype can only be inserted before an element");if(!se&&Et)throw new B(S,"Doctype can not be appended since element is present")}}function Ve(V,G,se){var ve=V.childNodes||[],We=G.childNodes||[];if(G.nodeType===W.DOCUMENT_FRAGMENT_NODE){var at=We.filter(Fe);if(at.length>1||e(We,le))throw new B(S,"More than one element or text in fragment");if(at.length===1&&!oe(V,se))throw new B(S,"Element in fragment can not be inserted before doctype")}if(Fe(G)&&!oe(V,se))throw new B(S,"Only one element can be added and only after doctype");if(be(G)){if(e(ve,function(Oe){return be(Oe)&&Oe!==se}))throw new B(S,"Only one doctype is allowed");var Et=e(ve,Fe);if(se&&ve.indexOf(Et)<ve.indexOf(se))throw new B(S,"Doctype can only be inserted before an element")}}function Ke(V,G,se,ve){de(V,G,se),V.nodeType===W.DOCUMENT_NODE&&(ve||Le)(V,G,se);var We=G.parentNode;if(We&&We.removeChild(G),G.nodeType===w){var at=G.firstChild;if(at==null)return G;var Et=G.lastChild}else at=Et=G;var nt=se?se.previousSibling:V.lastChild;at.previousSibling=nt,Et.nextSibling=se,nt?nt.nextSibling=at:V.firstChild=at,se==null?V.lastChild=Et:se.previousSibling=Et;do at.parentNode=V;while(at!==Et&&(at=at.nextSibling));return xe(V.ownerDocument||V,V),G.nodeType==w&&(G.firstChild=G.lastChild=null),G}function Ge(V,G){return G.parentNode&&G.parentNode.removeChild(G),G.parentNode=V,G.previousSibling=V.lastChild,G.nextSibling=null,G.previousSibling?G.previousSibling.nextSibling=G:V.firstChild=G,V.lastChild=G,xe(V.ownerDocument,V,G),G}Ae.prototype={nodeName:"#document",nodeType:k,doctype:null,documentElement:null,_inc:1,insertBefore:function(V,G){if(V.nodeType==w){for(var se=V.firstChild;se;){var ve=se.nextSibling;this.insertBefore(se,G),se=ve}return V}return Ke(this,V,G),V.ownerDocument=this,this.documentElement===null&&V.nodeType===h&&(this.documentElement=V),V},removeChild:function(V){return this.documentElement==V&&(this.documentElement=null),Ne(this,V)},replaceChild:function(V,G){Ke(this,V,G,Ve),V.ownerDocument=this,G&&this.removeChild(G),Fe(V)&&(this.documentElement=V)},importNode:function(V,G){return oi(this,V,G)},getElementById:function(V){var G=null;return Ee(this.documentElement,function(se){if(se.nodeType==h&&se.getAttribute("id")==V)return G=se,!0}),G},getElementsByClassName:function(V){var G=a(V);return new ie(this,function(se){var ve=[];return G.length>0&&Ee(se.documentElement,function(We){if(We!==se&&We.nodeType===h){var at=We.getAttribute("class");if(at){var Et=V===at;if(!Et){var nt=a(at);Et=G.every(o(nt))}Et&&ve.push(We)}}}),ve})},createElement:function(V){var G=new ke;G.ownerDocument=this,G.nodeName=V,G.tagName=V,G.localName=V,G.childNodes=new Q;var se=G.attributes=new q;return se._ownerElement=G,G},createDocumentFragment:function(){var V=new Yn;return V.ownerDocument=this,V.childNodes=new Q,V},createTextNode:function(V){var G=new Re;return G.ownerDocument=this,G.appendData(V),G},createComment:function(V){var G=new Ie;return G.ownerDocument=this,G.appendData(V),G},createCDATASection:function(V){var G=new it;return G.ownerDocument=this,G.appendData(V),G},createProcessingInstruction:function(V,G){var se=new Tt;return se.ownerDocument=this,se.tagName=se.nodeName=se.target=V,se.nodeValue=se.data=G,se},createAttribute:function(V){var G=new $e;return G.ownerDocument=this,G.name=V,G.nodeName=V,G.localName=V,G.specified=!0,G},createEntityReference:function(V){var G=new Ri;return G.ownerDocument=this,G.nodeName=V,G},createElementNS:function(V,G){var se=new ke,ve=G.split(":"),We=se.attributes=new q;return se.childNodes=new Q,se.ownerDocument=this,se.nodeName=G,se.tagName=G,se.namespaceURI=V,ve.length==2?(se.prefix=ve[0],se.localName=ve[1]):se.localName=G,We._ownerElement=se,se},createAttributeNS:function(V,G){var se=new $e,ve=G.split(":");return se.ownerDocument=this,se.nodeName=G,se.name=G,se.namespaceURI=V,se.specified=!0,ve.length==2?(se.prefix=ve[0],se.localName=ve[1]):se.localName=G,se}},u(Ae,W);function ke(){this._nsMap={}}ke.prototype={nodeType:h,hasAttribute:function(V){return this.getAttributeNode(V)!=null},getAttribute:function(V){var G=this.getAttributeNode(V);return G&&G.value||""},getAttributeNode:function(V){return this.attributes.getNamedItem(V)},setAttribute:function(V,G){var se=this.ownerDocument.createAttribute(V);se.value=se.nodeValue=""+G,this.setAttributeNode(se)},removeAttribute:function(V){var G=this.getAttributeNode(V);G&&this.removeAttributeNode(G)},appendChild:function(V){return V.nodeType===w?this.insertBefore(V,null):Ge(this,V)},setAttributeNode:function(V){return this.attributes.setNamedItem(V)},setAttributeNodeNS:function(V){return this.attributes.setNamedItemNS(V)},removeAttributeNode:function(V){return this.attributes.removeNamedItem(V.nodeName)},removeAttributeNS:function(V,G){var se=this.getAttributeNodeNS(V,G);se&&this.removeAttributeNode(se)},hasAttributeNS:function(V,G){return this.getAttributeNodeNS(V,G)!=null},getAttributeNS:function(V,G){var se=this.getAttributeNodeNS(V,G);return se&&se.value||""},setAttributeNS:function(V,G,se){var ve=this.ownerDocument.createAttributeNS(V,G);ve.value=ve.nodeValue=""+se,this.setAttributeNode(ve)},getAttributeNodeNS:function(V,G){return this.attributes.getNamedItemNS(V,G)},getElementsByTagName:function(V){return new ie(this,function(G){var se=[];return Ee(G,function(ve){ve!==G&&ve.nodeType==h&&(V==="*"||ve.tagName==V)&&se.push(ve)}),se})},getElementsByTagNameNS:function(V,G){return new ie(this,function(se){var ve=[];return Ee(se,function(We){We!==se&&We.nodeType===h&&(V==="*"||We.namespaceURI===V)&&(G==="*"||We.localName==G)&&ve.push(We)}),ve})}},Ae.prototype.getElementsByTagName=ke.prototype.getElementsByTagName,Ae.prototype.getElementsByTagNameNS=ke.prototype.getElementsByTagNameNS,u(ke,W);function $e(){}$e.prototype.nodeType=b,u($e,W);function _e(){}_e.prototype={data:"",substringData:function(V,G){return this.data.substring(V,V+G)},appendData:function(V){V=this.data+V,this.nodeValue=this.data=V,this.length=V.length},insertData:function(V,G){this.replaceData(V,0,G)},appendChild:function(V){throw new Error(P[S])},deleteData:function(V,G){this.replaceData(V,G,"")},replaceData:function(V,G,se){var ve=this.data.substring(0,V),We=this.data.substring(V+G);se=ve+se+We,this.nodeValue=this.data=se,this.length=se.length}},u(_e,W);function Re(){}Re.prototype={nodeName:"#text",nodeType:v,splitText:function(V){var G=this.data,se=G.substring(V);G=G.substring(0,V),this.data=this.nodeValue=G,this.length=G.length;var ve=this.ownerDocument.createTextNode(se);return this.parentNode&&this.parentNode.insertBefore(ve,this.nextSibling),ve}},u(Re,_e);function Ie(){}Ie.prototype={nodeName:"#comment",nodeType:_},u(Ie,_e);function it(){}it.prototype={nodeName:"#cdata-section",nodeType:y},u(it,_e);function _t(){}_t.prototype.nodeType=D,u(_t,W);function Ot(){}Ot.prototype.nodeType=A,u(Ot,W);function Hn(){}Hn.prototype.nodeType=f,u(Hn,W);function Ri(){}Ri.prototype.nodeType=p,u(Ri,W);function Yn(){}Yn.prototype.nodeName="#document-fragment",Yn.prototype.nodeType=w,u(Yn,W);function Tt(){}Tt.prototype.nodeType=m,u(Tt,W);function Hr(){}Hr.prototype.serializeToString=function(V,G,se){return bi.call(V,G,se)},W.prototype.toString=bi;function bi(V,G){var se=[],ve=this.nodeType==9&&this.documentElement||this,We=ve.prefix,at=ve.namespaceURI;if(at&&We==null){var We=ve.lookupPrefix(at);if(We==null)var Et=[{namespace:at,prefix:null}]}return Jn(this,se,V,G,Et),se.join("")}function qn(V,G,se){var ve=V.prefix||"",We=V.namespaceURI;if(!We||ve==="xml"&&We===t.XML||We===t.XMLNS)return!1;for(var at=se.length;at--;){var Et=se[at];if(Et.prefix===ve)return Et.namespace!==We}return!0}function qr(V,G,se){V.push(" ",G,'="',se.replace(/[<>&"\t\n\r]/g,ae),'"')}function Jn(V,G,se,ve,We){if(We||(We=[]),ve)if(V=ve(V),V){if(typeof V=="string"){G.push(V);return}}else return;switch(V.nodeType){case h:var at=V.attributes,Et=at.length,nn=V.firstChild,nt=V.tagName;se=t.isHTML(V.namespaceURI)||se;var Oe=nt;if(!se&&!V.prefix&&V.namespaceURI){for(var pn,on=0;on<at.length;on++)if(at.item(on).name==="xmlns"){pn=at.item(on).value;break}if(!pn)for(var ln=We.length-1;ln>=0;ln--){var _i=We[ln];if(_i.prefix===""&&_i.namespace===V.namespaceURI){pn=_i.namespace;break}}if(pn!==V.namespaceURI)for(var ln=We.length-1;ln>=0;ln--){var _i=We[ln];if(_i.namespace===V.namespaceURI){_i.prefix&&(Oe=_i.prefix+":"+nt);break}}}G.push("<",Oe);for(var Mt=0;Mt<Et;Mt++){var wt=at.item(Mt);wt.prefix=="xmlns"?We.push({prefix:wt.localName,namespace:wt.value}):wt.nodeName=="xmlns"&&We.push({prefix:"",namespace:wt.value})}for(var Mt=0;Mt<Et;Mt++){var wt=at.item(Mt);if(qn(wt,se,We)){var li=wt.prefix||"",Gr=wt.namespaceURI;qr(G,li?"xmlns:"+li:"xmlns",Gr),We.push({prefix:li,namespace:Gr})}Jn(wt,G,se,ve,We)}if(nt===Oe&&qn(V,se,We)){var li=V.prefix||"",Gr=V.namespaceURI;qr(G,li?"xmlns:"+li:"xmlns",Gr),We.push({prefix:li,namespace:Gr})}if(nn||se&&!/^(?:meta|link|img|br|hr|input)$/i.test(nt)){if(G.push(">"),se&&/^script$/i.test(nt))for(;nn;)nn.data?G.push(nn.data):Jn(nn,G,se,ve,We.slice()),nn=nn.nextSibling;else for(;nn;)Jn(nn,G,se,ve,We.slice()),nn=nn.nextSibling;G.push("</",Oe,">")}else G.push("/>");return;case k:case w:for(var nn=V.firstChild;nn;)Jn(nn,G,se,ve,We.slice()),nn=nn.nextSibling;return;case b:return qr(G,V.name,V.value);case v:return G.push(V.data.replace(/[<&>]/g,ae));case y:return G.push("<![CDATA[",V.data,"]]>");case _:return G.push("<!--",V.data,"-->");case D:var ci=V.publicId,ki=V.systemId;if(G.push("<!DOCTYPE ",V.name),ci)G.push(" PUBLIC ",ci),ki&&ki!="."&&G.push(" ",ki),G.push(">");else if(ki&&ki!=".")G.push(" SYSTEM ",ki,">");else{var Dt=V.internalSubset;Dt&&G.push(" [",Dt,"]"),G.push(">")}return;case m:return G.push("<?",V.target," ",V.data,"?>");case p:return G.push("&",V.nodeName,";");default:G.push("??",V.nodeName)}}function oi(V,G,se){var ve;switch(G.nodeType){case h:ve=G.cloneNode(!1),ve.ownerDocument=V;case w:break;case b:se=!0;break}if(ve||(ve=G.cloneNode(!1)),ve.ownerDocument=V,ve.parentNode=null,se)for(var We=G.firstChild;We;)ve.appendChild(oi(V,We,se)),We=We.nextSibling;return ve}function Tr(V,G,se){var ve=new G.constructor;for(var We in G)if(Object.prototype.hasOwnProperty.call(G,We)){var at=G[We];typeof at!="object"&&at!=ve[We]&&(ve[We]=at)}switch(G.childNodes&&(ve.childNodes=new Q),ve.ownerDocument=V,ve.nodeType){case h:var Et=G.attributes,nt=ve.attributes=new q,Oe=Et.length;nt._ownerElement=ve;for(var pn=0;pn<Oe;pn++)ve.setAttributeNode(Tr(V,Et.item(pn),!0));break;case b:se=!0}if(se)for(var on=G.firstChild;on;)ve.appendChild(Tr(V,on,se)),on=on.nextSibling;return ve}function zr(V,G,se){V[G]=se}try{if(Object.defineProperty){let V=function(G){switch(G.nodeType){case h:case w:var se=[];for(G=G.firstChild;G;)G.nodeType!==7&&G.nodeType!==8&&se.push(V(G)),G=G.nextSibling;return se.join("");default:return G.nodeValue}};Object.defineProperty(ie.prototype,"length",{get:function(){return Y(this),this.$$length}}),Object.defineProperty(W.prototype,"textContent",{get:function(){return V(this)},set:function(G){switch(this.nodeType){case h:case w:for(;this.firstChild;)this.removeChild(this.firstChild);(G||String(G))&&this.appendChild(this.ownerDocument.createTextNode(G));break;default:this.data=G,this.value=G,this.nodeValue=G}}}),zr=function(G,se,ve){G["$$"+se]=ve}}}catch{}return Dr.DocumentType=_t,Dr.DOMException=B,Dr.DOMImplementation=j,Dr.Element=ke,Dr.Node=W,Dr.NodeList=Q,Dr.XMLSerializer=Hr,Dr}var tl={},Cf={},zy;function x6(){return zy||(zy=1,function(i){var e=Qc().freeze;i.XML_ENTITIES=e({amp:"&",apos:"'",gt:">",lt:"<",quot:'"'}),i.HTML_ENTITIES=e({Aacute:"Á",aacute:"á",Abreve:"Ă",abreve:"ă",ac:"∾",acd:"∿",acE:"∾̳",Acirc:"Â",acirc:"â",acute:"´",Acy:"А",acy:"а",AElig:"Æ",aelig:"æ",af:"⁡",Afr:"𝔄",afr:"𝔞",Agrave:"À",agrave:"à",alefsym:"ℵ",aleph:"ℵ",Alpha:"Α",alpha:"α",Amacr:"Ā",amacr:"ā",amalg:"⨿",AMP:"&",amp:"&",And:"⩓",and:"∧",andand:"⩕",andd:"⩜",andslope:"⩘",andv:"⩚",ang:"∠",ange:"⦤",angle:"∠",angmsd:"∡",angmsdaa:"⦨",angmsdab:"⦩",angmsdac:"⦪",angmsdad:"⦫",angmsdae:"⦬",angmsdaf:"⦭",angmsdag:"⦮",angmsdah:"⦯",angrt:"∟",angrtvb:"⊾",angrtvbd:"⦝",angsph:"∢",angst:"Å",angzarr:"⍼",Aogon:"Ą",aogon:"ą",Aopf:"𝔸",aopf:"𝕒",ap:"≈",apacir:"⩯",apE:"⩰",ape:"≊",apid:"≋",apos:"'",ApplyFunction:"⁡",approx:"≈",approxeq:"≊",Aring:"Å",aring:"å",Ascr:"𝒜",ascr:"𝒶",Assign:"≔",ast:"*",asymp:"≈",asympeq:"≍",Atilde:"Ã",atilde:"ã",Auml:"Ä",auml:"ä",awconint:"∳",awint:"⨑",backcong:"≌",backepsilon:"϶",backprime:"‵",backsim:"∽",backsimeq:"⋍",Backslash:"∖",Barv:"⫧",barvee:"⊽",Barwed:"⌆",barwed:"⌅",barwedge:"⌅",bbrk:"⎵",bbrktbrk:"⎶",bcong:"≌",Bcy:"Б",bcy:"б",bdquo:"„",becaus:"∵",Because:"∵",because:"∵",bemptyv:"⦰",bepsi:"϶",bernou:"ℬ",Bernoullis:"ℬ",Beta:"Β",beta:"β",beth:"ℶ",between:"≬",Bfr:"𝔅",bfr:"𝔟",bigcap:"⋂",bigcirc:"◯",bigcup:"⋃",bigodot:"⨀",bigoplus:"⨁",bigotimes:"⨂",bigsqcup:"⨆",bigstar:"★",bigtriangledown:"▽",bigtriangleup:"△",biguplus:"⨄",bigvee:"⋁",bigwedge:"⋀",bkarow:"⤍",blacklozenge:"⧫",blacksquare:"▪",blacktriangle:"▴",blacktriangledown:"▾",blacktriangleleft:"◂",blacktriangleright:"▸",blank:"␣",blk12:"▒",blk14:"░",blk34:"▓",block:"█",bne:"=⃥",bnequiv:"≡⃥",bNot:"⫭",bnot:"⌐",Bopf:"𝔹",bopf:"𝕓",bot:"⊥",bottom:"⊥",bowtie:"⋈",boxbox:"⧉",boxDL:"╗",boxDl:"╖",boxdL:"╕",boxdl:"┐",boxDR:"╔",boxDr:"╓",boxdR:"╒",boxdr:"┌",boxH:"═",boxh:"─",boxHD:"╦",boxHd:"╤",boxhD:"╥",boxhd:"┬",boxHU:"╩",boxHu:"╧",boxhU:"╨",boxhu:"┴",boxminus:"⊟",boxplus:"⊞",boxtimes:"⊠",boxUL:"╝",boxUl:"╜",boxuL:"╛",boxul:"┘",boxUR:"╚",boxUr:"╙",boxuR:"╘",boxur:"└",boxV:"║",boxv:"│",boxVH:"╬",boxVh:"╫",boxvH:"╪",boxvh:"┼",boxVL:"╣",boxVl:"╢",boxvL:"╡",boxvl:"┤",boxVR:"╠",boxVr:"╟",boxvR:"╞",boxvr:"├",bprime:"‵",Breve:"˘",breve:"˘",brvbar:"¦",Bscr:"ℬ",bscr:"𝒷",bsemi:"⁏",bsim:"∽",bsime:"⋍",bsol:"\\",bsolb:"⧅",bsolhsub:"⟈",bull:"•",bullet:"•",bump:"≎",bumpE:"⪮",bumpe:"≏",Bumpeq:"≎",bumpeq:"≏",Cacute:"Ć",cacute:"ć",Cap:"⋒",cap:"∩",capand:"⩄",capbrcup:"⩉",capcap:"⩋",capcup:"⩇",capdot:"⩀",CapitalDifferentialD:"ⅅ",caps:"∩︀",caret:"⁁",caron:"ˇ",Cayleys:"ℭ",ccaps:"⩍",Ccaron:"Č",ccaron:"č",Ccedil:"Ç",ccedil:"ç",Ccirc:"Ĉ",ccirc:"ĉ",Cconint:"∰",ccups:"⩌",ccupssm:"⩐",Cdot:"Ċ",cdot:"ċ",cedil:"¸",Cedilla:"¸",cemptyv:"⦲",cent:"¢",CenterDot:"·",centerdot:"·",Cfr:"ℭ",cfr:"𝔠",CHcy:"Ч",chcy:"ч",check:"✓",checkmark:"✓",Chi:"Χ",chi:"χ",cir:"○",circ:"ˆ",circeq:"≗",circlearrowleft:"↺",circlearrowright:"↻",circledast:"⊛",circledcirc:"⊚",circleddash:"⊝",CircleDot:"⊙",circledR:"®",circledS:"Ⓢ",CircleMinus:"⊖",CirclePlus:"⊕",CircleTimes:"⊗",cirE:"⧃",cire:"≗",cirfnint:"⨐",cirmid:"⫯",cirscir:"⧂",ClockwiseContourIntegral:"∲",CloseCurlyDoubleQuote:"”",CloseCurlyQuote:"’",clubs:"♣",clubsuit:"♣",Colon:"∷",colon:":",Colone:"⩴",colone:"≔",coloneq:"≔",comma:",",commat:"@",comp:"∁",compfn:"∘",complement:"∁",complexes:"ℂ",cong:"≅",congdot:"⩭",Congruent:"≡",Conint:"∯",conint:"∮",ContourIntegral:"∮",Copf:"ℂ",copf:"𝕔",coprod:"∐",Coproduct:"∐",COPY:"©",copy:"©",copysr:"℗",CounterClockwiseContourIntegral:"∳",crarr:"↵",Cross:"⨯",cross:"✗",Cscr:"𝒞",cscr:"𝒸",csub:"⫏",csube:"⫑",csup:"⫐",csupe:"⫒",ctdot:"⋯",cudarrl:"⤸",cudarrr:"⤵",cuepr:"⋞",cuesc:"⋟",cularr:"↶",cularrp:"⤽",Cup:"⋓",cup:"∪",cupbrcap:"⩈",CupCap:"≍",cupcap:"⩆",cupcup:"⩊",cupdot:"⊍",cupor:"⩅",cups:"∪︀",curarr:"↷",curarrm:"⤼",curlyeqprec:"⋞",curlyeqsucc:"⋟",curlyvee:"⋎",curlywedge:"⋏",curren:"¤",curvearrowleft:"↶",curvearrowright:"↷",cuvee:"⋎",cuwed:"⋏",cwconint:"∲",cwint:"∱",cylcty:"⌭",Dagger:"‡",dagger:"†",daleth:"ℸ",Darr:"↡",dArr:"⇓",darr:"↓",dash:"‐",Dashv:"⫤",dashv:"⊣",dbkarow:"⤏",dblac:"˝",Dcaron:"Ď",dcaron:"ď",Dcy:"Д",dcy:"д",DD:"ⅅ",dd:"ⅆ",ddagger:"‡",ddarr:"⇊",DDotrahd:"⤑",ddotseq:"⩷",deg:"°",Del:"∇",Delta:"Δ",delta:"δ",demptyv:"⦱",dfisht:"⥿",Dfr:"𝔇",dfr:"𝔡",dHar:"⥥",dharl:"⇃",dharr:"⇂",DiacriticalAcute:"´",DiacriticalDot:"˙",DiacriticalDoubleAcute:"˝",DiacriticalGrave:"`",DiacriticalTilde:"˜",diam:"⋄",Diamond:"⋄",diamond:"⋄",diamondsuit:"♦",diams:"♦",die:"¨",DifferentialD:"ⅆ",digamma:"ϝ",disin:"⋲",div:"÷",divide:"÷",divideontimes:"⋇",divonx:"⋇",DJcy:"Ђ",djcy:"ђ",dlcorn:"⌞",dlcrop:"⌍",dollar:"$",Dopf:"𝔻",dopf:"𝕕",Dot:"¨",dot:"˙",DotDot:"⃜",doteq:"≐",doteqdot:"≑",DotEqual:"≐",dotminus:"∸",dotplus:"∔",dotsquare:"⊡",doublebarwedge:"⌆",DoubleContourIntegral:"∯",DoubleDot:"¨",DoubleDownArrow:"⇓",DoubleLeftArrow:"⇐",DoubleLeftRightArrow:"⇔",DoubleLeftTee:"⫤",DoubleLongLeftArrow:"⟸",DoubleLongLeftRightArrow:"⟺",DoubleLongRightArrow:"⟹",DoubleRightArrow:"⇒",DoubleRightTee:"⊨",DoubleUpArrow:"⇑",DoubleUpDownArrow:"⇕",DoubleVerticalBar:"∥",DownArrow:"↓",Downarrow:"⇓",downarrow:"↓",DownArrowBar:"⤓",DownArrowUpArrow:"⇵",DownBreve:"̑",downdownarrows:"⇊",downharpoonleft:"⇃",downharpoonright:"⇂",DownLeftRightVector:"⥐",DownLeftTeeVector:"⥞",DownLeftVector:"↽",DownLeftVectorBar:"⥖",DownRightTeeVector:"⥟",DownRightVector:"⇁",DownRightVectorBar:"⥗",DownTee:"⊤",DownTeeArrow:"↧",drbkarow:"⤐",drcorn:"⌟",drcrop:"⌌",Dscr:"𝒟",dscr:"𝒹",DScy:"Ѕ",dscy:"ѕ",dsol:"⧶",Dstrok:"Đ",dstrok:"đ",dtdot:"⋱",dtri:"▿",dtrif:"▾",duarr:"⇵",duhar:"⥯",dwangle:"⦦",DZcy:"Џ",dzcy:"џ",dzigrarr:"⟿",Eacute:"É",eacute:"é",easter:"⩮",Ecaron:"Ě",ecaron:"ě",ecir:"≖",Ecirc:"Ê",ecirc:"ê",ecolon:"≕",Ecy:"Э",ecy:"э",eDDot:"⩷",Edot:"Ė",eDot:"≑",edot:"ė",ee:"ⅇ",efDot:"≒",Efr:"𝔈",efr:"𝔢",eg:"⪚",Egrave:"È",egrave:"è",egs:"⪖",egsdot:"⪘",el:"⪙",Element:"∈",elinters:"⏧",ell:"ℓ",els:"⪕",elsdot:"⪗",Emacr:"Ē",emacr:"ē",empty:"∅",emptyset:"∅",EmptySmallSquare:"◻",emptyv:"∅",EmptyVerySmallSquare:"▫",emsp:" ",emsp13:" ",emsp14:" ",ENG:"Ŋ",eng:"ŋ",ensp:" ",Eogon:"Ę",eogon:"ę",Eopf:"𝔼",eopf:"𝕖",epar:"⋕",eparsl:"⧣",eplus:"⩱",epsi:"ε",Epsilon:"Ε",epsilon:"ε",epsiv:"ϵ",eqcirc:"≖",eqcolon:"≕",eqsim:"≂",eqslantgtr:"⪖",eqslantless:"⪕",Equal:"⩵",equals:"=",EqualTilde:"≂",equest:"≟",Equilibrium:"⇌",equiv:"≡",equivDD:"⩸",eqvparsl:"⧥",erarr:"⥱",erDot:"≓",Escr:"ℰ",escr:"ℯ",esdot:"≐",Esim:"⩳",esim:"≂",Eta:"Η",eta:"η",ETH:"Ð",eth:"ð",Euml:"Ë",euml:"ë",euro:"€",excl:"!",exist:"∃",Exists:"∃",expectation:"ℰ",ExponentialE:"ⅇ",exponentiale:"ⅇ",fallingdotseq:"≒",Fcy:"Ф",fcy:"ф",female:"♀",ffilig:"ffi",fflig:"ff",ffllig:"ffl",Ffr:"𝔉",ffr:"𝔣",filig:"fi",FilledSmallSquare:"◼",FilledVerySmallSquare:"▪",fjlig:"fj",flat:"♭",fllig:"fl",fltns:"▱",fnof:"ƒ",Fopf:"𝔽",fopf:"𝕗",ForAll:"∀",forall:"∀",fork:"⋔",forkv:"⫙",Fouriertrf:"ℱ",fpartint:"⨍",frac12:"½",frac13:"⅓",frac14:"¼",frac15:"⅕",frac16:"⅙",frac18:"⅛",frac23:"⅔",frac25:"⅖",frac34:"¾",frac35:"⅗",frac38:"⅜",frac45:"⅘",frac56:"⅚",frac58:"⅝",frac78:"⅞",frasl:"⁄",frown:"⌢",Fscr:"ℱ",fscr:"𝒻",gacute:"ǵ",Gamma:"Γ",gamma:"γ",Gammad:"Ϝ",gammad:"ϝ",gap:"⪆",Gbreve:"Ğ",gbreve:"ğ",Gcedil:"Ģ",Gcirc:"Ĝ",gcirc:"ĝ",Gcy:"Г",gcy:"г",Gdot:"Ġ",gdot:"ġ",gE:"≧",ge:"≥",gEl:"⪌",gel:"⋛",geq:"≥",geqq:"≧",geqslant:"⩾",ges:"⩾",gescc:"⪩",gesdot:"⪀",gesdoto:"⪂",gesdotol:"⪄",gesl:"⋛︀",gesles:"⪔",Gfr:"𝔊",gfr:"𝔤",Gg:"⋙",gg:"≫",ggg:"⋙",gimel:"ℷ",GJcy:"Ѓ",gjcy:"ѓ",gl:"≷",gla:"⪥",glE:"⪒",glj:"⪤",gnap:"⪊",gnapprox:"⪊",gnE:"≩",gne:"⪈",gneq:"⪈",gneqq:"≩",gnsim:"⋧",Gopf:"𝔾",gopf:"𝕘",grave:"`",GreaterEqual:"≥",GreaterEqualLess:"⋛",GreaterFullEqual:"≧",GreaterGreater:"⪢",GreaterLess:"≷",GreaterSlantEqual:"⩾",GreaterTilde:"≳",Gscr:"𝒢",gscr:"ℊ",gsim:"≳",gsime:"⪎",gsiml:"⪐",Gt:"≫",GT:">",gt:">",gtcc:"⪧",gtcir:"⩺",gtdot:"⋗",gtlPar:"⦕",gtquest:"⩼",gtrapprox:"⪆",gtrarr:"⥸",gtrdot:"⋗",gtreqless:"⋛",gtreqqless:"⪌",gtrless:"≷",gtrsim:"≳",gvertneqq:"≩︀",gvnE:"≩︀",Hacek:"ˇ",hairsp:" ",half:"½",hamilt:"ℋ",HARDcy:"Ъ",hardcy:"ъ",hArr:"⇔",harr:"↔",harrcir:"⥈",harrw:"↭",Hat:"^",hbar:"ℏ",Hcirc:"Ĥ",hcirc:"ĥ",hearts:"♥",heartsuit:"♥",hellip:"…",hercon:"⊹",Hfr:"ℌ",hfr:"𝔥",HilbertSpace:"ℋ",hksearow:"⤥",hkswarow:"⤦",hoarr:"⇿",homtht:"∻",hookleftarrow:"↩",hookrightarrow:"↪",Hopf:"ℍ",hopf:"𝕙",horbar:"―",HorizontalLine:"─",Hscr:"ℋ",hscr:"𝒽",hslash:"ℏ",Hstrok:"Ħ",hstrok:"ħ",HumpDownHump:"≎",HumpEqual:"≏",hybull:"⁃",hyphen:"‐",Iacute:"Í",iacute:"í",ic:"⁣",Icirc:"Î",icirc:"î",Icy:"И",icy:"и",Idot:"İ",IEcy:"Е",iecy:"е",iexcl:"¡",iff:"⇔",Ifr:"ℑ",ifr:"𝔦",Igrave:"Ì",igrave:"ì",ii:"ⅈ",iiiint:"⨌",iiint:"∭",iinfin:"⧜",iiota:"℩",IJlig:"IJ",ijlig:"ij",Im:"ℑ",Imacr:"Ī",imacr:"ī",image:"ℑ",ImaginaryI:"ⅈ",imagline:"ℐ",imagpart:"ℑ",imath:"ı",imof:"⊷",imped:"Ƶ",Implies:"⇒",in:"∈",incare:"℅",infin:"∞",infintie:"⧝",inodot:"ı",Int:"∬",int:"∫",intcal:"⊺",integers:"ℤ",Integral:"∫",intercal:"⊺",Intersection:"⋂",intlarhk:"⨗",intprod:"⨼",InvisibleComma:"⁣",InvisibleTimes:"⁢",IOcy:"Ё",iocy:"ё",Iogon:"Į",iogon:"į",Iopf:"𝕀",iopf:"𝕚",Iota:"Ι",iota:"ι",iprod:"⨼",iquest:"¿",Iscr:"ℐ",iscr:"𝒾",isin:"∈",isindot:"⋵",isinE:"⋹",isins:"⋴",isinsv:"⋳",isinv:"∈",it:"⁢",Itilde:"Ĩ",itilde:"ĩ",Iukcy:"І",iukcy:"і",Iuml:"Ï",iuml:"ï",Jcirc:"Ĵ",jcirc:"ĵ",Jcy:"Й",jcy:"й",Jfr:"𝔍",jfr:"𝔧",jmath:"ȷ",Jopf:"𝕁",jopf:"𝕛",Jscr:"𝒥",jscr:"𝒿",Jsercy:"Ј",jsercy:"ј",Jukcy:"Є",jukcy:"є",Kappa:"Κ",kappa:"κ",kappav:"ϰ",Kcedil:"Ķ",kcedil:"ķ",Kcy:"К",kcy:"к",Kfr:"𝔎",kfr:"𝔨",kgreen:"ĸ",KHcy:"Х",khcy:"х",KJcy:"Ќ",kjcy:"ќ",Kopf:"𝕂",kopf:"𝕜",Kscr:"𝒦",kscr:"𝓀",lAarr:"⇚",Lacute:"Ĺ",lacute:"ĺ",laemptyv:"⦴",lagran:"ℒ",Lambda:"Λ",lambda:"λ",Lang:"⟪",lang:"⟨",langd:"⦑",langle:"⟨",lap:"⪅",Laplacetrf:"ℒ",laquo:"«",Larr:"↞",lArr:"⇐",larr:"←",larrb:"⇤",larrbfs:"⤟",larrfs:"⤝",larrhk:"↩",larrlp:"↫",larrpl:"⤹",larrsim:"⥳",larrtl:"↢",lat:"⪫",lAtail:"⤛",latail:"⤙",late:"⪭",lates:"⪭︀",lBarr:"⤎",lbarr:"⤌",lbbrk:"❲",lbrace:"{",lbrack:"[",lbrke:"⦋",lbrksld:"⦏",lbrkslu:"⦍",Lcaron:"Ľ",lcaron:"ľ",Lcedil:"Ļ",lcedil:"ļ",lceil:"⌈",lcub:"{",Lcy:"Л",lcy:"л",ldca:"⤶",ldquo:"“",ldquor:"„",ldrdhar:"⥧",ldrushar:"⥋",ldsh:"↲",lE:"≦",le:"≤",LeftAngleBracket:"⟨",LeftArrow:"←",Leftarrow:"⇐",leftarrow:"←",LeftArrowBar:"⇤",LeftArrowRightArrow:"⇆",leftarrowtail:"↢",LeftCeiling:"⌈",LeftDoubleBracket:"⟦",LeftDownTeeVector:"⥡",LeftDownVector:"⇃",LeftDownVectorBar:"⥙",LeftFloor:"⌊",leftharpoondown:"↽",leftharpoonup:"↼",leftleftarrows:"⇇",LeftRightArrow:"↔",Leftrightarrow:"⇔",leftrightarrow:"↔",leftrightarrows:"⇆",leftrightharpoons:"⇋",leftrightsquigarrow:"↭",LeftRightVector:"⥎",LeftTee:"⊣",LeftTeeArrow:"↤",LeftTeeVector:"⥚",leftthreetimes:"⋋",LeftTriangle:"⊲",LeftTriangleBar:"⧏",LeftTriangleEqual:"⊴",LeftUpDownVector:"⥑",LeftUpTeeVector:"⥠",LeftUpVector:"↿",LeftUpVectorBar:"⥘",LeftVector:"↼",LeftVectorBar:"⥒",lEg:"⪋",leg:"⋚",leq:"≤",leqq:"≦",leqslant:"⩽",les:"⩽",lescc:"⪨",lesdot:"⩿",lesdoto:"⪁",lesdotor:"⪃",lesg:"⋚︀",lesges:"⪓",lessapprox:"⪅",lessdot:"⋖",lesseqgtr:"⋚",lesseqqgtr:"⪋",LessEqualGreater:"⋚",LessFullEqual:"≦",LessGreater:"≶",lessgtr:"≶",LessLess:"⪡",lesssim:"≲",LessSlantEqual:"⩽",LessTilde:"≲",lfisht:"⥼",lfloor:"⌊",Lfr:"𝔏",lfr:"𝔩",lg:"≶",lgE:"⪑",lHar:"⥢",lhard:"↽",lharu:"↼",lharul:"⥪",lhblk:"▄",LJcy:"Љ",ljcy:"љ",Ll:"⋘",ll:"≪",llarr:"⇇",llcorner:"⌞",Lleftarrow:"⇚",llhard:"⥫",lltri:"◺",Lmidot:"Ŀ",lmidot:"ŀ",lmoust:"⎰",lmoustache:"⎰",lnap:"⪉",lnapprox:"⪉",lnE:"≨",lne:"⪇",lneq:"⪇",lneqq:"≨",lnsim:"⋦",loang:"⟬",loarr:"⇽",lobrk:"⟦",LongLeftArrow:"⟵",Longleftarrow:"⟸",longleftarrow:"⟵",LongLeftRightArrow:"⟷",Longleftrightarrow:"⟺",longleftrightarrow:"⟷",longmapsto:"⟼",LongRightArrow:"⟶",Longrightarrow:"⟹",longrightarrow:"⟶",looparrowleft:"↫",looparrowright:"↬",lopar:"⦅",Lopf:"𝕃",lopf:"𝕝",loplus:"⨭",lotimes:"⨴",lowast:"∗",lowbar:"_",LowerLeftArrow:"↙",LowerRightArrow:"↘",loz:"◊",lozenge:"◊",lozf:"⧫",lpar:"(",lparlt:"⦓",lrarr:"⇆",lrcorner:"⌟",lrhar:"⇋",lrhard:"⥭",lrm:"‎",lrtri:"⊿",lsaquo:"‹",Lscr:"ℒ",lscr:"𝓁",Lsh:"↰",lsh:"↰",lsim:"≲",lsime:"⪍",lsimg:"⪏",lsqb:"[",lsquo:"‘",lsquor:"‚",Lstrok:"Ł",lstrok:"ł",Lt:"≪",LT:"<",lt:"<",ltcc:"⪦",ltcir:"⩹",ltdot:"⋖",lthree:"⋋",ltimes:"⋉",ltlarr:"⥶",ltquest:"⩻",ltri:"◃",ltrie:"⊴",ltrif:"◂",ltrPar:"⦖",lurdshar:"⥊",luruhar:"⥦",lvertneqq:"≨︀",lvnE:"≨︀",macr:"¯",male:"♂",malt:"✠",maltese:"✠",Map:"⤅",map:"↦",mapsto:"↦",mapstodown:"↧",mapstoleft:"↤",mapstoup:"↥",marker:"▮",mcomma:"⨩",Mcy:"М",mcy:"м",mdash:"—",mDDot:"∺",measuredangle:"∡",MediumSpace:" ",Mellintrf:"ℳ",Mfr:"𝔐",mfr:"𝔪",mho:"℧",micro:"µ",mid:"∣",midast:"*",midcir:"⫰",middot:"·",minus:"−",minusb:"⊟",minusd:"∸",minusdu:"⨪",MinusPlus:"∓",mlcp:"⫛",mldr:"…",mnplus:"∓",models:"⊧",Mopf:"𝕄",mopf:"𝕞",mp:"∓",Mscr:"ℳ",mscr:"𝓂",mstpos:"∾",Mu:"Μ",mu:"μ",multimap:"⊸",mumap:"⊸",nabla:"∇",Nacute:"Ń",nacute:"ń",nang:"∠⃒",nap:"≉",napE:"⩰̸",napid:"≋̸",napos:"ʼn",napprox:"≉",natur:"♮",natural:"♮",naturals:"ℕ",nbsp:" ",nbump:"≎̸",nbumpe:"≏̸",ncap:"⩃",Ncaron:"Ň",ncaron:"ň",Ncedil:"Ņ",ncedil:"ņ",ncong:"≇",ncongdot:"⩭̸",ncup:"⩂",Ncy:"Н",ncy:"н",ndash:"–",ne:"≠",nearhk:"⤤",neArr:"⇗",nearr:"↗",nearrow:"↗",nedot:"≐̸",NegativeMediumSpace:"​",NegativeThickSpace:"​",NegativeThinSpace:"​",NegativeVeryThinSpace:"​",nequiv:"≢",nesear:"⤨",nesim:"≂̸",NestedGreaterGreater:"≫",NestedLessLess:"≪",NewLine:`
44
+ `,nexist:"∄",nexists:"∄",Nfr:"𝔑",nfr:"𝔫",ngE:"≧̸",nge:"≱",ngeq:"≱",ngeqq:"≧̸",ngeqslant:"⩾̸",nges:"⩾̸",nGg:"⋙̸",ngsim:"≵",nGt:"≫⃒",ngt:"≯",ngtr:"≯",nGtv:"≫̸",nhArr:"⇎",nharr:"↮",nhpar:"⫲",ni:"∋",nis:"⋼",nisd:"⋺",niv:"∋",NJcy:"Њ",njcy:"њ",nlArr:"⇍",nlarr:"↚",nldr:"‥",nlE:"≦̸",nle:"≰",nLeftarrow:"⇍",nleftarrow:"↚",nLeftrightarrow:"⇎",nleftrightarrow:"↮",nleq:"≰",nleqq:"≦̸",nleqslant:"⩽̸",nles:"⩽̸",nless:"≮",nLl:"⋘̸",nlsim:"≴",nLt:"≪⃒",nlt:"≮",nltri:"⋪",nltrie:"⋬",nLtv:"≪̸",nmid:"∤",NoBreak:"⁠",NonBreakingSpace:" ",Nopf:"ℕ",nopf:"𝕟",Not:"⫬",not:"¬",NotCongruent:"≢",NotCupCap:"≭",NotDoubleVerticalBar:"∦",NotElement:"∉",NotEqual:"≠",NotEqualTilde:"≂̸",NotExists:"∄",NotGreater:"≯",NotGreaterEqual:"≱",NotGreaterFullEqual:"≧̸",NotGreaterGreater:"≫̸",NotGreaterLess:"≹",NotGreaterSlantEqual:"⩾̸",NotGreaterTilde:"≵",NotHumpDownHump:"≎̸",NotHumpEqual:"≏̸",notin:"∉",notindot:"⋵̸",notinE:"⋹̸",notinva:"∉",notinvb:"⋷",notinvc:"⋶",NotLeftTriangle:"⋪",NotLeftTriangleBar:"⧏̸",NotLeftTriangleEqual:"⋬",NotLess:"≮",NotLessEqual:"≰",NotLessGreater:"≸",NotLessLess:"≪̸",NotLessSlantEqual:"⩽̸",NotLessTilde:"≴",NotNestedGreaterGreater:"⪢̸",NotNestedLessLess:"⪡̸",notni:"∌",notniva:"∌",notnivb:"⋾",notnivc:"⋽",NotPrecedes:"⊀",NotPrecedesEqual:"⪯̸",NotPrecedesSlantEqual:"⋠",NotReverseElement:"∌",NotRightTriangle:"⋫",NotRightTriangleBar:"⧐̸",NotRightTriangleEqual:"⋭",NotSquareSubset:"⊏̸",NotSquareSubsetEqual:"⋢",NotSquareSuperset:"⊐̸",NotSquareSupersetEqual:"⋣",NotSubset:"⊂⃒",NotSubsetEqual:"⊈",NotSucceeds:"⊁",NotSucceedsEqual:"⪰̸",NotSucceedsSlantEqual:"⋡",NotSucceedsTilde:"≿̸",NotSuperset:"⊃⃒",NotSupersetEqual:"⊉",NotTilde:"≁",NotTildeEqual:"≄",NotTildeFullEqual:"≇",NotTildeTilde:"≉",NotVerticalBar:"∤",npar:"∦",nparallel:"∦",nparsl:"⫽⃥",npart:"∂̸",npolint:"⨔",npr:"⊀",nprcue:"⋠",npre:"⪯̸",nprec:"⊀",npreceq:"⪯̸",nrArr:"⇏",nrarr:"↛",nrarrc:"⤳̸",nrarrw:"↝̸",nRightarrow:"⇏",nrightarrow:"↛",nrtri:"⋫",nrtrie:"⋭",nsc:"⊁",nsccue:"⋡",nsce:"⪰̸",Nscr:"𝒩",nscr:"𝓃",nshortmid:"∤",nshortparallel:"∦",nsim:"≁",nsime:"≄",nsimeq:"≄",nsmid:"∤",nspar:"∦",nsqsube:"⋢",nsqsupe:"⋣",nsub:"⊄",nsubE:"⫅̸",nsube:"⊈",nsubset:"⊂⃒",nsubseteq:"⊈",nsubseteqq:"⫅̸",nsucc:"⊁",nsucceq:"⪰̸",nsup:"⊅",nsupE:"⫆̸",nsupe:"⊉",nsupset:"⊃⃒",nsupseteq:"⊉",nsupseteqq:"⫆̸",ntgl:"≹",Ntilde:"Ñ",ntilde:"ñ",ntlg:"≸",ntriangleleft:"⋪",ntrianglelefteq:"⋬",ntriangleright:"⋫",ntrianglerighteq:"⋭",Nu:"Ν",nu:"ν",num:"#",numero:"№",numsp:" ",nvap:"≍⃒",nVDash:"⊯",nVdash:"⊮",nvDash:"⊭",nvdash:"⊬",nvge:"≥⃒",nvgt:">⃒",nvHarr:"⤄",nvinfin:"⧞",nvlArr:"⤂",nvle:"≤⃒",nvlt:"<⃒",nvltrie:"⊴⃒",nvrArr:"⤃",nvrtrie:"⊵⃒",nvsim:"∼⃒",nwarhk:"⤣",nwArr:"⇖",nwarr:"↖",nwarrow:"↖",nwnear:"⤧",Oacute:"Ó",oacute:"ó",oast:"⊛",ocir:"⊚",Ocirc:"Ô",ocirc:"ô",Ocy:"О",ocy:"о",odash:"⊝",Odblac:"Ő",odblac:"ő",odiv:"⨸",odot:"⊙",odsold:"⦼",OElig:"Œ",oelig:"œ",ofcir:"⦿",Ofr:"𝔒",ofr:"𝔬",ogon:"˛",Ograve:"Ò",ograve:"ò",ogt:"⧁",ohbar:"⦵",ohm:"Ω",oint:"∮",olarr:"↺",olcir:"⦾",olcross:"⦻",oline:"‾",olt:"⧀",Omacr:"Ō",omacr:"ō",Omega:"Ω",omega:"ω",Omicron:"Ο",omicron:"ο",omid:"⦶",ominus:"⊖",Oopf:"𝕆",oopf:"𝕠",opar:"⦷",OpenCurlyDoubleQuote:"“",OpenCurlyQuote:"‘",operp:"⦹",oplus:"⊕",Or:"⩔",or:"∨",orarr:"↻",ord:"⩝",order:"ℴ",orderof:"ℴ",ordf:"ª",ordm:"º",origof:"⊶",oror:"⩖",orslope:"⩗",orv:"⩛",oS:"Ⓢ",Oscr:"𝒪",oscr:"ℴ",Oslash:"Ø",oslash:"ø",osol:"⊘",Otilde:"Õ",otilde:"õ",Otimes:"⨷",otimes:"⊗",otimesas:"⨶",Ouml:"Ö",ouml:"ö",ovbar:"⌽",OverBar:"‾",OverBrace:"⏞",OverBracket:"⎴",OverParenthesis:"⏜",par:"∥",para:"¶",parallel:"∥",parsim:"⫳",parsl:"⫽",part:"∂",PartialD:"∂",Pcy:"П",pcy:"п",percnt:"%",period:".",permil:"‰",perp:"⊥",pertenk:"‱",Pfr:"𝔓",pfr:"𝔭",Phi:"Φ",phi:"φ",phiv:"ϕ",phmmat:"ℳ",phone:"☎",Pi:"Π",pi:"π",pitchfork:"⋔",piv:"ϖ",planck:"ℏ",planckh:"ℎ",plankv:"ℏ",plus:"+",plusacir:"⨣",plusb:"⊞",pluscir:"⨢",plusdo:"∔",plusdu:"⨥",pluse:"⩲",PlusMinus:"±",plusmn:"±",plussim:"⨦",plustwo:"⨧",pm:"±",Poincareplane:"ℌ",pointint:"⨕",Popf:"ℙ",popf:"𝕡",pound:"£",Pr:"⪻",pr:"≺",prap:"⪷",prcue:"≼",prE:"⪳",pre:"⪯",prec:"≺",precapprox:"⪷",preccurlyeq:"≼",Precedes:"≺",PrecedesEqual:"⪯",PrecedesSlantEqual:"≼",PrecedesTilde:"≾",preceq:"⪯",precnapprox:"⪹",precneqq:"⪵",precnsim:"⋨",precsim:"≾",Prime:"″",prime:"′",primes:"ℙ",prnap:"⪹",prnE:"⪵",prnsim:"⋨",prod:"∏",Product:"∏",profalar:"⌮",profline:"⌒",profsurf:"⌓",prop:"∝",Proportion:"∷",Proportional:"∝",propto:"∝",prsim:"≾",prurel:"⊰",Pscr:"𝒫",pscr:"𝓅",Psi:"Ψ",psi:"ψ",puncsp:" ",Qfr:"𝔔",qfr:"𝔮",qint:"⨌",Qopf:"ℚ",qopf:"𝕢",qprime:"⁗",Qscr:"𝒬",qscr:"𝓆",quaternions:"ℍ",quatint:"⨖",quest:"?",questeq:"≟",QUOT:'"',quot:'"',rAarr:"⇛",race:"∽̱",Racute:"Ŕ",racute:"ŕ",radic:"√",raemptyv:"⦳",Rang:"⟫",rang:"⟩",rangd:"⦒",range:"⦥",rangle:"⟩",raquo:"»",Rarr:"↠",rArr:"⇒",rarr:"→",rarrap:"⥵",rarrb:"⇥",rarrbfs:"⤠",rarrc:"⤳",rarrfs:"⤞",rarrhk:"↪",rarrlp:"↬",rarrpl:"⥅",rarrsim:"⥴",Rarrtl:"⤖",rarrtl:"↣",rarrw:"↝",rAtail:"⤜",ratail:"⤚",ratio:"∶",rationals:"ℚ",RBarr:"⤐",rBarr:"⤏",rbarr:"⤍",rbbrk:"❳",rbrace:"}",rbrack:"]",rbrke:"⦌",rbrksld:"⦎",rbrkslu:"⦐",Rcaron:"Ř",rcaron:"ř",Rcedil:"Ŗ",rcedil:"ŗ",rceil:"⌉",rcub:"}",Rcy:"Р",rcy:"р",rdca:"⤷",rdldhar:"⥩",rdquo:"”",rdquor:"”",rdsh:"↳",Re:"ℜ",real:"ℜ",realine:"ℛ",realpart:"ℜ",reals:"ℝ",rect:"▭",REG:"®",reg:"®",ReverseElement:"∋",ReverseEquilibrium:"⇋",ReverseUpEquilibrium:"⥯",rfisht:"⥽",rfloor:"⌋",Rfr:"ℜ",rfr:"𝔯",rHar:"⥤",rhard:"⇁",rharu:"⇀",rharul:"⥬",Rho:"Ρ",rho:"ρ",rhov:"ϱ",RightAngleBracket:"⟩",RightArrow:"→",Rightarrow:"⇒",rightarrow:"→",RightArrowBar:"⇥",RightArrowLeftArrow:"⇄",rightarrowtail:"↣",RightCeiling:"⌉",RightDoubleBracket:"⟧",RightDownTeeVector:"⥝",RightDownVector:"⇂",RightDownVectorBar:"⥕",RightFloor:"⌋",rightharpoondown:"⇁",rightharpoonup:"⇀",rightleftarrows:"⇄",rightleftharpoons:"⇌",rightrightarrows:"⇉",rightsquigarrow:"↝",RightTee:"⊢",RightTeeArrow:"↦",RightTeeVector:"⥛",rightthreetimes:"⋌",RightTriangle:"⊳",RightTriangleBar:"⧐",RightTriangleEqual:"⊵",RightUpDownVector:"⥏",RightUpTeeVector:"⥜",RightUpVector:"↾",RightUpVectorBar:"⥔",RightVector:"⇀",RightVectorBar:"⥓",ring:"˚",risingdotseq:"≓",rlarr:"⇄",rlhar:"⇌",rlm:"‏",rmoust:"⎱",rmoustache:"⎱",rnmid:"⫮",roang:"⟭",roarr:"⇾",robrk:"⟧",ropar:"⦆",Ropf:"ℝ",ropf:"𝕣",roplus:"⨮",rotimes:"⨵",RoundImplies:"⥰",rpar:")",rpargt:"⦔",rppolint:"⨒",rrarr:"⇉",Rrightarrow:"⇛",rsaquo:"›",Rscr:"ℛ",rscr:"𝓇",Rsh:"↱",rsh:"↱",rsqb:"]",rsquo:"’",rsquor:"’",rthree:"⋌",rtimes:"⋊",rtri:"▹",rtrie:"⊵",rtrif:"▸",rtriltri:"⧎",RuleDelayed:"⧴",ruluhar:"⥨",rx:"℞",Sacute:"Ś",sacute:"ś",sbquo:"‚",Sc:"⪼",sc:"≻",scap:"⪸",Scaron:"Š",scaron:"š",sccue:"≽",scE:"⪴",sce:"⪰",Scedil:"Ş",scedil:"ş",Scirc:"Ŝ",scirc:"ŝ",scnap:"⪺",scnE:"⪶",scnsim:"⋩",scpolint:"⨓",scsim:"≿",Scy:"С",scy:"с",sdot:"⋅",sdotb:"⊡",sdote:"⩦",searhk:"⤥",seArr:"⇘",searr:"↘",searrow:"↘",sect:"§",semi:";",seswar:"⤩",setminus:"∖",setmn:"∖",sext:"✶",Sfr:"𝔖",sfr:"𝔰",sfrown:"⌢",sharp:"♯",SHCHcy:"Щ",shchcy:"щ",SHcy:"Ш",shcy:"ш",ShortDownArrow:"↓",ShortLeftArrow:"←",shortmid:"∣",shortparallel:"∥",ShortRightArrow:"→",ShortUpArrow:"↑",shy:"­",Sigma:"Σ",sigma:"σ",sigmaf:"ς",sigmav:"ς",sim:"∼",simdot:"⩪",sime:"≃",simeq:"≃",simg:"⪞",simgE:"⪠",siml:"⪝",simlE:"⪟",simne:"≆",simplus:"⨤",simrarr:"⥲",slarr:"←",SmallCircle:"∘",smallsetminus:"∖",smashp:"⨳",smeparsl:"⧤",smid:"∣",smile:"⌣",smt:"⪪",smte:"⪬",smtes:"⪬︀",SOFTcy:"Ь",softcy:"ь",sol:"/",solb:"⧄",solbar:"⌿",Sopf:"𝕊",sopf:"𝕤",spades:"♠",spadesuit:"♠",spar:"∥",sqcap:"⊓",sqcaps:"⊓︀",sqcup:"⊔",sqcups:"⊔︀",Sqrt:"√",sqsub:"⊏",sqsube:"⊑",sqsubset:"⊏",sqsubseteq:"⊑",sqsup:"⊐",sqsupe:"⊒",sqsupset:"⊐",sqsupseteq:"⊒",squ:"□",Square:"□",square:"□",SquareIntersection:"⊓",SquareSubset:"⊏",SquareSubsetEqual:"⊑",SquareSuperset:"⊐",SquareSupersetEqual:"⊒",SquareUnion:"⊔",squarf:"▪",squf:"▪",srarr:"→",Sscr:"𝒮",sscr:"𝓈",ssetmn:"∖",ssmile:"⌣",sstarf:"⋆",Star:"⋆",star:"☆",starf:"★",straightepsilon:"ϵ",straightphi:"ϕ",strns:"¯",Sub:"⋐",sub:"⊂",subdot:"⪽",subE:"⫅",sube:"⊆",subedot:"⫃",submult:"⫁",subnE:"⫋",subne:"⊊",subplus:"⪿",subrarr:"⥹",Subset:"⋐",subset:"⊂",subseteq:"⊆",subseteqq:"⫅",SubsetEqual:"⊆",subsetneq:"⊊",subsetneqq:"⫋",subsim:"⫇",subsub:"⫕",subsup:"⫓",succ:"≻",succapprox:"⪸",succcurlyeq:"≽",Succeeds:"≻",SucceedsEqual:"⪰",SucceedsSlantEqual:"≽",SucceedsTilde:"≿",succeq:"⪰",succnapprox:"⪺",succneqq:"⪶",succnsim:"⋩",succsim:"≿",SuchThat:"∋",Sum:"∑",sum:"∑",sung:"♪",Sup:"⋑",sup:"⊃",sup1:"¹",sup2:"²",sup3:"³",supdot:"⪾",supdsub:"⫘",supE:"⫆",supe:"⊇",supedot:"⫄",Superset:"⊃",SupersetEqual:"⊇",suphsol:"⟉",suphsub:"⫗",suplarr:"⥻",supmult:"⫂",supnE:"⫌",supne:"⊋",supplus:"⫀",Supset:"⋑",supset:"⊃",supseteq:"⊇",supseteqq:"⫆",supsetneq:"⊋",supsetneqq:"⫌",supsim:"⫈",supsub:"⫔",supsup:"⫖",swarhk:"⤦",swArr:"⇙",swarr:"↙",swarrow:"↙",swnwar:"⤪",szlig:"ß",Tab:" ",target:"⌖",Tau:"Τ",tau:"τ",tbrk:"⎴",Tcaron:"Ť",tcaron:"ť",Tcedil:"Ţ",tcedil:"ţ",Tcy:"Т",tcy:"т",tdot:"⃛",telrec:"⌕",Tfr:"𝔗",tfr:"𝔱",there4:"∴",Therefore:"∴",therefore:"∴",Theta:"Θ",theta:"θ",thetasym:"ϑ",thetav:"ϑ",thickapprox:"≈",thicksim:"∼",ThickSpace:"  ",thinsp:" ",ThinSpace:" ",thkap:"≈",thksim:"∼",THORN:"Þ",thorn:"þ",Tilde:"∼",tilde:"˜",TildeEqual:"≃",TildeFullEqual:"≅",TildeTilde:"≈",times:"×",timesb:"⊠",timesbar:"⨱",timesd:"⨰",tint:"∭",toea:"⤨",top:"⊤",topbot:"⌶",topcir:"⫱",Topf:"𝕋",topf:"𝕥",topfork:"⫚",tosa:"⤩",tprime:"‴",TRADE:"™",trade:"™",triangle:"▵",triangledown:"▿",triangleleft:"◃",trianglelefteq:"⊴",triangleq:"≜",triangleright:"▹",trianglerighteq:"⊵",tridot:"◬",trie:"≜",triminus:"⨺",TripleDot:"⃛",triplus:"⨹",trisb:"⧍",tritime:"⨻",trpezium:"⏢",Tscr:"𝒯",tscr:"𝓉",TScy:"Ц",tscy:"ц",TSHcy:"Ћ",tshcy:"ћ",Tstrok:"Ŧ",tstrok:"ŧ",twixt:"≬",twoheadleftarrow:"↞",twoheadrightarrow:"↠",Uacute:"Ú",uacute:"ú",Uarr:"↟",uArr:"⇑",uarr:"↑",Uarrocir:"⥉",Ubrcy:"Ў",ubrcy:"ў",Ubreve:"Ŭ",ubreve:"ŭ",Ucirc:"Û",ucirc:"û",Ucy:"У",ucy:"у",udarr:"⇅",Udblac:"Ű",udblac:"ű",udhar:"⥮",ufisht:"⥾",Ufr:"𝔘",ufr:"𝔲",Ugrave:"Ù",ugrave:"ù",uHar:"⥣",uharl:"↿",uharr:"↾",uhblk:"▀",ulcorn:"⌜",ulcorner:"⌜",ulcrop:"⌏",ultri:"◸",Umacr:"Ū",umacr:"ū",uml:"¨",UnderBar:"_",UnderBrace:"⏟",UnderBracket:"⎵",UnderParenthesis:"⏝",Union:"⋃",UnionPlus:"⊎",Uogon:"Ų",uogon:"ų",Uopf:"𝕌",uopf:"𝕦",UpArrow:"↑",Uparrow:"⇑",uparrow:"↑",UpArrowBar:"⤒",UpArrowDownArrow:"⇅",UpDownArrow:"↕",Updownarrow:"⇕",updownarrow:"↕",UpEquilibrium:"⥮",upharpoonleft:"↿",upharpoonright:"↾",uplus:"⊎",UpperLeftArrow:"↖",UpperRightArrow:"↗",Upsi:"ϒ",upsi:"υ",upsih:"ϒ",Upsilon:"Υ",upsilon:"υ",UpTee:"⊥",UpTeeArrow:"↥",upuparrows:"⇈",urcorn:"⌝",urcorner:"⌝",urcrop:"⌎",Uring:"Ů",uring:"ů",urtri:"◹",Uscr:"𝒰",uscr:"𝓊",utdot:"⋰",Utilde:"Ũ",utilde:"ũ",utri:"▵",utrif:"▴",uuarr:"⇈",Uuml:"Ü",uuml:"ü",uwangle:"⦧",vangrt:"⦜",varepsilon:"ϵ",varkappa:"ϰ",varnothing:"∅",varphi:"ϕ",varpi:"ϖ",varpropto:"∝",vArr:"⇕",varr:"↕",varrho:"ϱ",varsigma:"ς",varsubsetneq:"⊊︀",varsubsetneqq:"⫋︀",varsupsetneq:"⊋︀",varsupsetneqq:"⫌︀",vartheta:"ϑ",vartriangleleft:"⊲",vartriangleright:"⊳",Vbar:"⫫",vBar:"⫨",vBarv:"⫩",Vcy:"В",vcy:"в",VDash:"⊫",Vdash:"⊩",vDash:"⊨",vdash:"⊢",Vdashl:"⫦",Vee:"⋁",vee:"∨",veebar:"⊻",veeeq:"≚",vellip:"⋮",Verbar:"‖",verbar:"|",Vert:"‖",vert:"|",VerticalBar:"∣",VerticalLine:"|",VerticalSeparator:"❘",VerticalTilde:"≀",VeryThinSpace:" ",Vfr:"𝔙",vfr:"𝔳",vltri:"⊲",vnsub:"⊂⃒",vnsup:"⊃⃒",Vopf:"𝕍",vopf:"𝕧",vprop:"∝",vrtri:"⊳",Vscr:"𝒱",vscr:"𝓋",vsubnE:"⫋︀",vsubne:"⊊︀",vsupnE:"⫌︀",vsupne:"⊋︀",Vvdash:"⊪",vzigzag:"⦚",Wcirc:"Ŵ",wcirc:"ŵ",wedbar:"⩟",Wedge:"⋀",wedge:"∧",wedgeq:"≙",weierp:"℘",Wfr:"𝔚",wfr:"𝔴",Wopf:"𝕎",wopf:"𝕨",wp:"℘",wr:"≀",wreath:"≀",Wscr:"𝒲",wscr:"𝓌",xcap:"⋂",xcirc:"◯",xcup:"⋃",xdtri:"▽",Xfr:"𝔛",xfr:"𝔵",xhArr:"⟺",xharr:"⟷",Xi:"Ξ",xi:"ξ",xlArr:"⟸",xlarr:"⟵",xmap:"⟼",xnis:"⋻",xodot:"⨀",Xopf:"𝕏",xopf:"𝕩",xoplus:"⨁",xotime:"⨂",xrArr:"⟹",xrarr:"⟶",Xscr:"𝒳",xscr:"𝓍",xsqcup:"⨆",xuplus:"⨄",xutri:"△",xvee:"⋁",xwedge:"⋀",Yacute:"Ý",yacute:"ý",YAcy:"Я",yacy:"я",Ycirc:"Ŷ",ycirc:"ŷ",Ycy:"Ы",ycy:"ы",yen:"¥",Yfr:"𝔜",yfr:"𝔶",YIcy:"Ї",yicy:"ї",Yopf:"𝕐",yopf:"𝕪",Yscr:"𝒴",yscr:"𝓎",YUcy:"Ю",yucy:"ю",Yuml:"Ÿ",yuml:"ÿ",Zacute:"Ź",zacute:"ź",Zcaron:"Ž",zcaron:"ž",Zcy:"З",zcy:"з",Zdot:"Ż",zdot:"ż",zeetrf:"ℨ",ZeroWidthSpace:"​",Zeta:"Ζ",zeta:"ζ",Zfr:"ℨ",zfr:"𝔷",ZHcy:"Ж",zhcy:"ж",zigrarr:"⇝",Zopf:"ℤ",zopf:"𝕫",Zscr:"𝒵",zscr:"𝓏",zwj:"‍",zwnj:"‌"}),i.entityMap=i.HTML_ENTITIES}(Cf)),Cf}var Zc={},Gy;function E6(){if(Gy)return Zc;Gy=1;var i=Qc().NAMESPACE,e=/[A-Z_a-z\xC0-\xD6\xD8-\xF6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,t=new RegExp("[\\-\\.0-9"+e.source.slice(1,-1)+"\\u00B7\\u0300-\\u036F\\u203F-\\u2040]"),n=new RegExp("^"+e.source+t.source+"*(?::"+e.source+t.source+"*)?$"),r=0,s=1,a=2,o=3,c=4,u=5,d=6,h=7;function b(S,M){this.message=S,this.locator=M,Error.captureStackTrace&&Error.captureStackTrace(this,b)}b.prototype=new Error,b.prototype.name=b.name;function v(){}v.prototype={parse:function(S,M,U){var B=this.domBuilder;B.startDocument(),D(M,M={}),y(S,M,U,B,this.errorHandler),B.endDocument()}};function y(S,M,U,B,Q){function ie(ke){if(ke>65535){ke-=65536;var $e=55296+(ke>>10),_e=56320+(ke&1023);return String.fromCharCode($e,_e)}else return String.fromCharCode(ke)}function Y(ke){var $e=ke.slice(1,-1);return Object.hasOwnProperty.call(U,$e)?U[$e]:$e.charAt(0)==="#"?ie(parseInt($e.substr(1).replace("x","0x"))):(Q.error("entity not found:"+ke),ke)}function q(ke){if(ke>Ae){var $e=S.substring(Ae,ke).replace(/&#?\w+;/g,Y);W&&L(Ae),B.characters($e,0,ke-Ae),Ae=ke}}function L(ke,$e){for(;ke>=H&&($e=j.exec(S));)$=$e.index,H=$+$e[0].length,W.lineNumber++;W.columnNumber=ke-$+1}for(var $=0,H=0,j=/.*(?:\r\n?|\n)|.*$/g,W=B.locator,ae=[{currentNSMap:M}],Ee={},Ae=0;;){try{var ee=S.indexOf("<",Ae);if(ee<0){if(!S.substr(Ae).match(/^\s*$/)){var fe=B.doc,xe=fe.createTextNode(S.substr(Ae));fe.appendChild(xe),B.currentElement=xe}return}switch(ee>Ae&&q(ee),S.charAt(ee+1)){case"/":var de=S.indexOf(">",ee+3),Ne=S.substring(ee+2,de).replace(/[ \t\n\r]+$/g,""),He=ae.pop();de<0?(Ne=S.substring(ee+2).replace(/[\s<].*/,""),Q.error("end tag name: "+Ne+" is not complete:"+He.tagName),de=ee+1+Ne.length):Ne.match(/\s</)&&(Ne=Ne.replace(/[\s<].*/,""),Q.error("end tag name: "+Ne+" maybe not complete"),de=ee+1+Ne.length);var Be=He.localNSMap,be=He.tagName==Ne,Fe=be||He.tagName&&He.tagName.toLowerCase()==Ne.toLowerCase();if(Fe){if(B.endElement(He.uri,He.localName,Ne),Be)for(var le in Be)Object.prototype.hasOwnProperty.call(Be,le)&&B.endPrefixMapping(le);be||Q.fatalError("end tag name: "+Ne+" is not match the current start tagName:"+He.tagName)}else ae.push(He);de++;break;case"?":W&&L(ee),de=A(S,ee,B);break;case"!":W&&L(ee),de=w(S,ee,B,Q);break;default:W&&L(ee);var ze=new x,oe=ae[ae.length-1].currentNSMap,de=f(S,ee,ze,oe,Y,Q),Le=ze.length;if(!ze.closed&&k(S,de,ze.tagName,Ee)&&(ze.closed=!0,U.nbsp||Q.warning("unclosed xml attribute")),W&&Le){for(var Ve=p(W,{}),Ke=0;Ke<Le;Ke++){var Ge=ze[Ke];L(Ge.offset),Ge.locator=p(W,{})}B.locator=Ve,m(ze,B,oe)&&ae.push(ze),B.locator=W}else m(ze,B,oe)&&ae.push(ze);i.isHTML(ze.uri)&&!ze.closed?de=_(S,de,ze.tagName,Y,B):de++}}catch(ke){if(ke instanceof b)throw ke;Q.error("element parse error: "+ke),de=-1}de>Ae?Ae=de:q(Math.max(ee,Ae)+1)}}function p(S,M){return M.lineNumber=S.lineNumber,M.columnNumber=S.columnNumber,M}function f(S,M,U,B,Q,ie){function Y(W,ae,Ee){U.attributeNames.hasOwnProperty(W)&&ie.fatalError("Attribute "+W+" redefined"),U.addValue(W,ae.replace(/[\t\n\r]/g," ").replace(/&#?\w+;/g,Q),Ee)}for(var q,L,$=++M,H=r;;){var j=S.charAt($);switch(j){case"=":if(H===s)q=S.slice(M,$),H=o;else if(H===a)H=o;else throw new Error("attribute equal must after attrName");break;case"'":case'"':if(H===o||H===s)if(H===s&&(ie.warning('attribute value must after "="'),q=S.slice(M,$)),M=$+1,$=S.indexOf(j,M),$>0)L=S.slice(M,$),Y(q,L,M-1),H=u;else throw new Error("attribute value no end '"+j+"' match");else if(H==c)L=S.slice(M,$),Y(q,L,M),ie.warning('attribute "'+q+'" missed start quot('+j+")!!"),M=$+1,H=u;else throw new Error('attribute value must after "="');break;case"/":switch(H){case r:U.setTagName(S.slice(M,$));case u:case d:case h:H=h,U.closed=!0;case c:case s:break;case a:U.closed=!0;break;default:throw new Error("attribute invalid close char('/')")}break;case"":return ie.error("unexpected end of input"),H==r&&U.setTagName(S.slice(M,$)),$;case">":switch(H){case r:U.setTagName(S.slice(M,$));case u:case d:case h:break;case c:case s:L=S.slice(M,$),L.slice(-1)==="/"&&(U.closed=!0,L=L.slice(0,-1));case a:H===a&&(L=q),H==c?(ie.warning('attribute "'+L+'" missed quot(")!'),Y(q,L,M)):((!i.isHTML(B[""])||!L.match(/^(?:disabled|checked|selected)$/i))&&ie.warning('attribute "'+L+'" missed value!! "'+L+'" instead!!'),Y(L,L,M));break;case o:throw new Error("attribute value missed!!")}return $;case"€":j=" ";default:if(j<=" ")switch(H){case r:U.setTagName(S.slice(M,$)),H=d;break;case s:q=S.slice(M,$),H=a;break;case c:var L=S.slice(M,$);ie.warning('attribute "'+L+'" missed quot(")!!'),Y(q,L,M);case u:H=d;break}else switch(H){case a:U.tagName,(!i.isHTML(B[""])||!q.match(/^(?:disabled|checked|selected)$/i))&&ie.warning('attribute "'+q+'" missed value!! "'+q+'" instead2!!'),Y(q,q,M),M=$,H=s;break;case u:ie.warning('attribute space is required"'+q+'"!!');case d:H=s,M=$;break;case o:H=c,M=$;break;case h:throw new Error("elements closed character '/' and '>' must be connected to")}}$++}}function m(S,M,U){for(var B=S.tagName,Q=null,j=S.length;j--;){var ie=S[j],Y=ie.qName,q=ie.value,W=Y.indexOf(":");if(W>0)var L=ie.prefix=Y.slice(0,W),$=Y.slice(W+1),H=L==="xmlns"&&$;else $=Y,L=null,H=Y==="xmlns"&&"";ie.localName=$,H!==!1&&(Q==null&&(Q={},D(U,U={})),U[H]=Q[H]=q,ie.uri=i.XMLNS,M.startPrefixMapping(H,q))}for(var j=S.length;j--;){ie=S[j];var L=ie.prefix;L&&(L==="xml"&&(ie.uri=i.XML),L!=="xmlns"&&(ie.uri=U[L||""]))}var W=B.indexOf(":");W>0?(L=S.prefix=B.slice(0,W),$=S.localName=B.slice(W+1)):(L=null,$=S.localName=B);var ae=S.uri=U[L||""];if(M.startElement(ae,$,B,S),S.closed){if(M.endElement(ae,$,B),Q)for(L in Q)Object.prototype.hasOwnProperty.call(Q,L)&&M.endPrefixMapping(L)}else return S.currentNSMap=U,S.localNSMap=Q,!0}function _(S,M,U,B,Q){if(/^(?:script|textarea)$/i.test(U)){var ie=S.indexOf("</"+U+">",M),Y=S.substring(M+1,ie);if(/[&<]/.test(Y))return/^script$/i.test(U)?(Q.characters(Y,0,Y.length),ie):(Y=Y.replace(/&#?\w+;/g,B),Q.characters(Y,0,Y.length),ie)}return M+1}function k(S,M,U,B){var Q=B[U];return Q==null&&(Q=S.lastIndexOf("</"+U+">"),Q<M&&(Q=S.lastIndexOf("</"+U)),B[U]=Q),Q<M}function D(S,M){for(var U in S)Object.prototype.hasOwnProperty.call(S,U)&&(M[U]=S[U])}function w(S,M,U,B){var Q=S.charAt(M+2);switch(Q){case"-":if(S.charAt(M+3)==="-"){var ie=S.indexOf("-->",M+4);return ie>M?(U.comment(S,M+4,ie-M-4),ie+3):(B.error("Unclosed comment"),-1)}else return-1;default:if(S.substr(M+3,6)=="CDATA["){var ie=S.indexOf("]]>",M+9);return U.startCDATA(),U.characters(S,M+9,ie-M-9),U.endCDATA(),ie+3}var Y=P(S,M),q=Y.length;if(q>1&&/!doctype/i.test(Y[0][0])){var L=Y[1][0],$=!1,H=!1;q>3&&(/^public$/i.test(Y[2][0])?($=Y[3][0],H=q>4&&Y[4][0]):/^system$/i.test(Y[2][0])&&(H=Y[3][0]));var j=Y[q-1];return U.startDTD(L,$,H),U.endDTD(),j.index+j[0].length}}return-1}function A(S,M,U){var B=S.indexOf("?>",M);if(B){var Q=S.substring(M,B).match(/^<\?(\S*)\s*([\s\S]*?)\s*$/);return Q?(Q[0].length,U.processingInstruction(Q[1],Q[2]),B+2):-1}return-1}function x(){this.attributeNames={}}x.prototype={setTagName:function(S){if(!n.test(S))throw new Error("invalid tagName:"+S);this.tagName=S},addValue:function(S,M,U){if(!n.test(S))throw new Error("invalid attribute:"+S);this.attributeNames[S]=this.length,this[this.length++]={qName:S,value:M,offset:U}},length:0,getLocalName:function(S){return this[S].localName},getLocator:function(S){return this[S].locator},getQName:function(S){return this[S].qName},getURI:function(S){return this[S].uri},getValue:function(S){return this[S].value}};function P(S,M){var U,B=[],Q=/'[^']+'|"[^"]+"|[^\s<>\/=]+=?|(\/?\s*>|<)/g;for(Q.lastIndex=M,Q.exec(S);U=Q.exec(S);)if(B.push(U),U[1])return B}return Zc.XMLReader=v,Zc.ParseError=b,Zc}var Wy;function w6(){if(Wy)return tl;Wy=1;var i=Qc(),e=qy(),t=x6(),n=E6(),r=e.DOMImplementation,s=i.NAMESPACE,a=n.ParseError,o=n.XMLReader;function c(f){return f.replace(/\r[\n\u0085]/g,`
45
+ `).replace(/[\r\u0085\u2028]/g,`
46
+ `)}function u(f){this.options=f||{locator:{}}}u.prototype.parseFromString=function(f,m){var _=this.options,k=new o,D=_.domBuilder||new h,w=_.errorHandler,A=_.locator,x=_.xmlns||{},P=/\/x?html?$/.test(m),S=P?t.HTML_ENTITIES:t.XML_ENTITIES;A&&D.setDocumentLocator(A),k.errorHandler=d(w,D,A),k.domBuilder=_.domBuilder||D,P&&(x[""]=s.HTML),x.xml=x.xml||s.XML;var M=_.normalizeLineEndings||c;return f&&typeof f=="string"?k.parse(M(f),x,S):k.errorHandler.error("invalid doc source"),D.doc};function d(f,m,_){if(!f){if(m instanceof h)return m;f=m}var k={},D=f instanceof Function;_=_||{};function w(A){var x=f[A];!x&&D&&(x=f.length==2?function(P){f(A,P)}:f),k[A]=x&&function(P){x("[xmldom "+A+"] "+P+v(_))}||function(){}}return w("warning"),w("error"),w("fatalError"),k}function h(){this.cdata=!1}function b(f,m){m.lineNumber=f.lineNumber,m.columnNumber=f.columnNumber}h.prototype={startDocument:function(){this.doc=new r().createDocument(null,null,null),this.locator&&(this.doc.documentURI=this.locator.systemId)},startElement:function(f,m,_,k){var D=this.doc,w=D.createElementNS(f,_||m),A=k.length;p(this,w),this.currentElement=w,this.locator&&b(this.locator,w);for(var x=0;x<A;x++){var f=k.getURI(x),P=k.getValue(x),_=k.getQName(x),S=D.createAttributeNS(f,_);this.locator&&b(k.getLocator(x),S),S.value=S.nodeValue=P,w.setAttributeNode(S)}},endElement:function(f,m,_){var k=this.currentElement;k.tagName,this.currentElement=k.parentNode},startPrefixMapping:function(f,m){},endPrefixMapping:function(f){},processingInstruction:function(f,m){var _=this.doc.createProcessingInstruction(f,m);this.locator&&b(this.locator,_),p(this,_)},ignorableWhitespace:function(f,m,_){},characters:function(f,m,_){if(f=y.apply(this,arguments),f){if(this.cdata)var k=this.doc.createCDATASection(f);else var k=this.doc.createTextNode(f);this.currentElement?this.currentElement.appendChild(k):/^\s*$/.test(f)&&this.doc.appendChild(k),this.locator&&b(this.locator,k)}},skippedEntity:function(f){},endDocument:function(){this.doc.normalize()},setDocumentLocator:function(f){(this.locator=f)&&(f.lineNumber=0)},comment:function(f,m,_){f=y.apply(this,arguments);var k=this.doc.createComment(f);this.locator&&b(this.locator,k),p(this,k)},startCDATA:function(){this.cdata=!0},endCDATA:function(){this.cdata=!1},startDTD:function(f,m,_){var k=this.doc.implementation;if(k&&k.createDocumentType){var D=k.createDocumentType(f,m,_);this.locator&&b(this.locator,D),p(this,D),this.doc.doctype=D}},warning:function(f){console.warn("[xmldom warning] "+f,v(this.locator))},error:function(f){console.error("[xmldom error] "+f,v(this.locator))},fatalError:function(f){throw new a(f,this.locator)}};function v(f){if(f)return`
47
+ @`+(f.systemId||"")+"#[line:"+f.lineNumber+",col:"+f.columnNumber+"]"}function y(f,m,_){return typeof f=="string"?f.substr(m,_):f.length>=m+_||m?new java.lang.String(f,m,_)+"":f}"endDTD,startEntity,endEntity,attributeDecl,elementDecl,externalEntityDecl,internalEntityDecl,resolveEntity,getExternalSubset,notationDecl,unparsedEntityDecl".replace(/\w+/g,function(f){h.prototype[f]=function(){return null}});function p(f,m){f.currentElement?f.currentElement.appendChild(m):f.doc.appendChild(m)}return tl.__DOMHandler=h,tl.normalizeLineEndings=c,tl.DOMParser=u,tl}var Ky;function D6(){if(Ky)return el;Ky=1;var i=qy();return el.DOMImplementation=i.DOMImplementation,el.XMLSerializer=i.XMLSerializer,el.DOMParser=w6().DOMParser,el}var A6=D6();/*! @name mpd-parser @version 1.3.1 @license Apache-2.0 */const Xy=i=>!!i&&typeof i=="object",kn=(...i)=>i.reduce((e,t)=>(typeof t!="object"||Object.keys(t).forEach(n=>{Array.isArray(e[n])&&Array.isArray(t[n])?e[n]=e[n].concat(t[n]):Xy(e[n])&&Xy(t[n])?e[n]=kn(e[n],t[n]):e[n]=t[n]}),e),{}),Yy=i=>Object.keys(i).map(e=>i[e]),I6=(i,e)=>{const t=[];for(let n=i;n<e;n++)t.push(n);return t},Ia=i=>i.reduce((e,t)=>e.concat(t),[]),Jy=i=>{if(!i.length)return[];const e=[];for(let t=0;t<i.length;t++)e.push(i[t]);return e},P6=(i,e)=>i.reduce((t,n,r)=>(n[e]&&t.push(r),t),[]),N6=(i,e)=>Yy(i.reduce((t,n)=>(n.forEach(r=>{t[e(r)]=r}),t),{}));var Pa={INVALID_NUMBER_OF_PERIOD:"INVALID_NUMBER_OF_PERIOD",DASH_EMPTY_MANIFEST:"DASH_EMPTY_MANIFEST",DASH_INVALID_XML:"DASH_INVALID_XML",NO_BASE_URL:"NO_BASE_URL",SEGMENT_TIME_UNSPECIFIED:"SEGMENT_TIME_UNSPECIFIED",UNSUPPORTED_UTC_TIMING_SCHEME:"UNSUPPORTED_UTC_TIMING_SCHEME"};const nl=({baseUrl:i="",source:e="",range:t="",indexRange:n=""})=>{const r={uri:e,resolvedUri:Jc(i||"",e)};if(t||n){const a=(t||n).split("-");let o=te.BigInt?te.BigInt(a[0]):parseInt(a[0],10),c=te.BigInt?te.BigInt(a[1]):parseInt(a[1],10);o<Number.MAX_SAFE_INTEGER&&typeof o=="bigint"&&(o=Number(o)),c<Number.MAX_SAFE_INTEGER&&typeof c=="bigint"&&(c=Number(c));let u;typeof c=="bigint"||typeof o=="bigint"?u=te.BigInt(c)-te.BigInt(o)+te.BigInt(1):u=c-o+1,typeof u=="bigint"&&u<Number.MAX_SAFE_INTEGER&&(u=Number(u)),r.byterange={length:u,offset:o}}return r},O6=i=>{let e;return typeof i.offset=="bigint"||typeof i.length=="bigint"?e=te.BigInt(i.offset)+te.BigInt(i.length)-te.BigInt(1):e=i.offset+i.length-1,`${i.offset}-${e}`},Qy=i=>(i&&typeof i!="number"&&(i=parseInt(i,10)),isNaN(i)?null:i),M6={static(i){const{duration:e,timescale:t=1,sourceDuration:n,periodDuration:r}=i,s=Qy(i.endNumber),a=e/t;return typeof s=="number"?{start:0,end:s}:typeof r=="number"?{start:0,end:r/a}:{start:0,end:n/a}},dynamic(i){const{NOW:e,clientOffset:t,availabilityStartTime:n,timescale:r=1,duration:s,periodStart:a=0,minimumUpdatePeriod:o=0,timeShiftBufferDepth:c=1/0}=i,u=Qy(i.endNumber),d=(e+t)/1e3,h=n+a,v=d+o-h,y=Math.ceil(v*r/s),p=Math.floor((d-h-c)*r/s),f=Math.floor((d-h)*r/s);return{start:Math.max(0,p),end:typeof u=="number"?u:Math.min(y,f)}}},R6=i=>e=>{const{duration:t,timescale:n=1,periodStart:r,startNumber:s=1}=i;return{number:s+e,duration:t/n,timeline:r,time:e*t}},xf=i=>{const{type:e,duration:t,timescale:n=1,periodDuration:r,sourceDuration:s}=i,{start:a,end:o}=M6[e](i),c=I6(a,o).map(R6(i));if(e==="static"){const u=c.length-1,d=typeof r=="number"?r:s;c[u].duration=d-t/n*u}return c},Zy=i=>{const{baseUrl:e,initialization:t={},sourceDuration:n,indexRange:r="",periodStart:s,presentationTime:a,number:o=0,duration:c}=i;if(!e)throw new Error(Pa.NO_BASE_URL);const u=nl({baseUrl:e,source:t.sourceURL,range:t.range}),d=nl({baseUrl:e,source:e,indexRange:r});if(d.map=u,c){const h=xf(i);h.length&&(d.duration=h[0].duration,d.timeline=h[0].timeline)}else n&&(d.duration=n,d.timeline=s);return d.presentationTime=a||s,d.number=o,[d]},Ef=(i,e,t)=>{const n=i.sidx.map?i.sidx.map:null,r=i.sidx.duration,s=i.timeline||0,a=i.sidx.byterange,o=a.offset+a.length,c=e.timescale,u=e.references.filter(f=>f.referenceType!==1),d=[],h=i.endList?"static":"dynamic",b=i.sidx.timeline;let v=b,y=i.mediaSequence||0,p;typeof e.firstOffset=="bigint"?p=te.BigInt(o)+e.firstOffset:p=o+e.firstOffset;for(let f=0;f<u.length;f++){const m=e.references[f],_=m.referencedSize,k=m.subsegmentDuration;let D;typeof p=="bigint"?D=p+te.BigInt(_)-te.BigInt(1):D=p+_-1;const w=`${p}-${D}`,x=Zy({baseUrl:t,timescale:c,timeline:s,periodStart:b,presentationTime:v,number:y,duration:k,sourceDuration:r,indexRange:w,type:h})[0];n&&(x.map=n),d.push(x),typeof p=="bigint"?p+=te.BigInt(_):p+=_,v+=k/c,y++}return i.segments=d,i},L6=["AUDIO","SUBTITLES"],B6=1/60,e1=i=>N6(i,({timeline:e})=>e).sort((e,t)=>e.timeline>t.timeline?1:-1),U6=(i,e)=>{for(let t=0;t<i.length;t++)if(i[t].attributes.NAME===e)return i[t];return null},t1=i=>{let e=[];return C6(i,L6,(t,n,r,s)=>{e=e.concat(t.playlists||[])}),e},n1=({playlist:i,mediaSequence:e})=>{i.mediaSequence=e,i.segments.forEach((t,n)=>{t.number=i.mediaSequence+n})},F6=({oldPlaylists:i,newPlaylists:e,timelineStarts:t})=>{e.forEach(n=>{n.discontinuitySequence=t.findIndex(function({timeline:c}){return c===n.timeline});const r=U6(i,n.attributes.NAME);if(!r||n.sidx)return;const s=n.segments[0],a=r.segments.findIndex(function(c){return Math.abs(c.presentationTime-s.presentationTime)<B6});if(a===-1){n1({playlist:n,mediaSequence:r.mediaSequence+r.segments.length}),n.segments[0].discontinuity=!0,n.discontinuityStarts.unshift(0),(!r.segments.length&&n.timeline>r.timeline||r.segments.length&&n.timeline>r.segments[r.segments.length-1].timeline)&&n.discontinuitySequence--;return}r.segments[a].discontinuity&&!s.discontinuity&&(s.discontinuity=!0,n.discontinuityStarts.unshift(0),n.discontinuitySequence--),n1({playlist:n,mediaSequence:r.segments[a].number})})},V6=({oldManifest:i,newManifest:e})=>{const t=i.playlists.concat(t1(i)),n=e.playlists.concat(t1(e));return e.timelineStarts=e1([i.timelineStarts,e.timelineStarts]),F6({oldPlaylists:t,newPlaylists:n,timelineStarts:e.timelineStarts}),e},eu=i=>i&&i.uri+"-"+O6(i.byterange),wf=i=>{const e=i.reduce(function(n,r){return n[r.attributes.baseUrl]||(n[r.attributes.baseUrl]=[]),n[r.attributes.baseUrl].push(r),n},{});let t=[];return Object.values(e).forEach(n=>{const r=Yy(n.reduce((s,a)=>{const o=a.attributes.id+(a.attributes.lang||"");return s[o]?(a.segments&&(a.segments[0]&&(a.segments[0].discontinuity=!0),s[o].segments.push(...a.segments)),a.attributes.contentProtection&&(s[o].attributes.contentProtection=a.attributes.contentProtection)):(s[o]=a,s[o].attributes.timelineStarts=[]),s[o].attributes.timelineStarts.push({start:a.attributes.periodStart,timeline:a.attributes.periodStart}),s},{}));t=t.concat(r)}),t.map(n=>(n.discontinuityStarts=P6(n.segments||[],"discontinuity"),n))},Df=(i,e)=>{const t=eu(i.sidx),n=t&&e[t]&&e[t].sidx;return n&&Ef(i,n,i.sidx.resolvedUri),i},j6=(i,e={})=>{if(!Object.keys(e).length)return i;for(const t in i)i[t]=Df(i[t],e);return i},$6=({attributes:i,segments:e,sidx:t,mediaSequence:n,discontinuitySequence:r,discontinuityStarts:s},a)=>{const o={attributes:{NAME:i.id,BANDWIDTH:i.bandwidth,CODECS:i.codecs,"PROGRAM-ID":1},uri:"",endList:i.type==="static",timeline:i.periodStart,resolvedUri:i.baseUrl||"",targetDuration:i.duration,discontinuitySequence:r,discontinuityStarts:s,timelineStarts:i.timelineStarts,mediaSequence:n,segments:e};return i.contentProtection&&(o.contentProtection=i.contentProtection),i.serviceLocation&&(o.attributes.serviceLocation=i.serviceLocation),t&&(o.sidx=t),a&&(o.attributes.AUDIO="audio",o.attributes.SUBTITLES="subs"),o},H6=({attributes:i,segments:e,mediaSequence:t,discontinuityStarts:n,discontinuitySequence:r})=>{typeof e>"u"&&(e=[{uri:i.baseUrl,timeline:i.periodStart,resolvedUri:i.baseUrl||"",duration:i.sourceDuration,number:0}],i.duration=i.sourceDuration);const s={NAME:i.id,BANDWIDTH:i.bandwidth,"PROGRAM-ID":1};i.codecs&&(s.CODECS=i.codecs);const a={attributes:s,uri:"",endList:i.type==="static",timeline:i.periodStart,resolvedUri:i.baseUrl||"",targetDuration:i.duration,timelineStarts:i.timelineStarts,discontinuityStarts:n,discontinuitySequence:r,mediaSequence:t,segments:e};return i.serviceLocation&&(a.attributes.serviceLocation=i.serviceLocation),a},q6=(i,e={},t=!1)=>{let n;const r=i.reduce((s,a)=>{const o=a.attributes.role&&a.attributes.role.value||"",c=a.attributes.lang||"";let u=a.attributes.label||"main";if(c&&!a.attributes.label){const h=o?` (${o})`:"";u=`${a.attributes.lang}${h}`}s[u]||(s[u]={language:c,autoselect:!0,default:o==="main",playlists:[],uri:""});const d=Df($6(a,t),e);return s[u].playlists.push(d),typeof n>"u"&&o==="main"&&(n=a,n.default=!0),s},{});if(!n){const s=Object.keys(r)[0];r[s].default=!0}return r},z6=(i,e={})=>i.reduce((t,n)=>{const r=n.attributes.label||n.attributes.lang||"text",s=n.attributes.lang||"und";return t[r]||(t[r]={language:s,default:!1,autoselect:!1,playlists:[],uri:""}),t[r].playlists.push(Df(H6(n),e)),t},{}),G6=i=>i.reduce((e,t)=>(t&&t.forEach(n=>{const{channel:r,language:s}=n;e[s]={autoselect:!1,default:!1,instreamId:r,language:s},n.hasOwnProperty("aspectRatio")&&(e[s].aspectRatio=n.aspectRatio),n.hasOwnProperty("easyReader")&&(e[s].easyReader=n.easyReader),n.hasOwnProperty("3D")&&(e[s]["3D"]=n["3D"])}),e),{}),W6=({attributes:i,segments:e,sidx:t,discontinuityStarts:n})=>{const r={attributes:{NAME:i.id,AUDIO:"audio",SUBTITLES:"subs",RESOLUTION:{width:i.width,height:i.height},CODECS:i.codecs,BANDWIDTH:i.bandwidth,"PROGRAM-ID":1},uri:"",endList:i.type==="static",timeline:i.periodStart,resolvedUri:i.baseUrl||"",targetDuration:i.duration,discontinuityStarts:n,timelineStarts:i.timelineStarts,segments:e};return i.frameRate&&(r.attributes["FRAME-RATE"]=i.frameRate),i.contentProtection&&(r.contentProtection=i.contentProtection),i.serviceLocation&&(r.attributes.serviceLocation=i.serviceLocation),t&&(r.sidx=t),r},K6=({attributes:i})=>i.mimeType==="video/mp4"||i.mimeType==="video/webm"||i.contentType==="video",X6=({attributes:i})=>i.mimeType==="audio/mp4"||i.mimeType==="audio/webm"||i.contentType==="audio",Y6=({attributes:i})=>i.mimeType==="text/vtt"||i.contentType==="text",J6=(i,e)=>{i.forEach(t=>{t.mediaSequence=0,t.discontinuitySequence=e.findIndex(function({timeline:n}){return n===t.timeline}),t.segments&&t.segments.forEach((n,r)=>{n.number=r})})},i1=i=>i?Object.keys(i).reduce((e,t)=>{const n=i[t];return e.concat(n.playlists)},[]):[],Q6=({dashPlaylists:i,locations:e,contentSteering:t,sidxMapping:n={},previousManifest:r,eventStream:s})=>{if(!i.length)return{};const{sourceDuration:a,type:o,suggestedPresentationDelay:c,minimumUpdatePeriod:u}=i[0].attributes,d=wf(i.filter(K6)).map(W6),h=wf(i.filter(X6)),b=wf(i.filter(Y6)),v=i.map(D=>D.attributes.captionServices).filter(Boolean),y={allowCache:!0,discontinuityStarts:[],segments:[],endList:!0,mediaGroups:{AUDIO:{},VIDEO:{},"CLOSED-CAPTIONS":{},SUBTITLES:{}},uri:"",duration:a,playlists:j6(d,n)};u>=0&&(y.minimumUpdatePeriod=u*1e3),e&&(y.locations=e),t&&(y.contentSteering=t),o==="dynamic"&&(y.suggestedPresentationDelay=c),s&&s.length>0&&(y.eventStream=s);const p=y.playlists.length===0,f=h.length?q6(h,n,p):null,m=b.length?z6(b,n):null,_=d.concat(i1(f),i1(m)),k=_.map(({timelineStarts:D})=>D);return y.timelineStarts=e1(k),J6(_,y.timelineStarts),f&&(y.mediaGroups.AUDIO.audio=f),m&&(y.mediaGroups.SUBTITLES.subs=m),v.length&&(y.mediaGroups["CLOSED-CAPTIONS"].cc=G6(v)),r?V6({oldManifest:r,newManifest:y}):y},Z6=(i,e,t)=>{const{NOW:n,clientOffset:r,availabilityStartTime:s,timescale:a=1,periodStart:o=0,minimumUpdatePeriod:c=0}=i,u=(n+r)/1e3,d=s+o,b=u+c-d;return Math.ceil((b*a-e)/t)},r1=(i,e)=>{const{type:t,minimumUpdatePeriod:n=0,media:r="",sourceDuration:s,timescale:a=1,startNumber:o=1,periodStart:c}=i,u=[];let d=-1;for(let h=0;h<e.length;h++){const b=e[h],v=b.d,y=b.r||0,p=b.t||0;d<0&&(d=p),p&&p>d&&(d=p);let f;if(y<0){const k=h+1;k===e.length?t==="dynamic"&&n>0&&r.indexOf("$Number$")>0?f=Z6(i,d,v):f=(s*a-d)/v:f=(e[k].t-d)/v}else f=y+1;const m=o+u.length+f;let _=o+u.length;for(;_<m;)u.push({number:_,duration:v/a,time:d,timeline:c}),d+=v,_++}return u},eD=/\$([A-z]*)(?:(%0)([0-9]+)d)?\$/g,tD=i=>(e,t,n,r)=>{if(e==="$$")return"$";if(typeof i[t]>"u")return e;const s=""+i[t];return t==="RepresentationID"||(n?r=parseInt(r,10):r=1,s.length>=r)?s:`${new Array(r-s.length+1).join("0")}${s}`},s1=(i,e)=>i.replace(eD,tD(e)),nD=(i,e)=>!i.duration&&!e?[{number:i.startNumber||1,duration:i.sourceDuration,time:0,timeline:i.periodStart}]:i.duration?xf(i):r1(i,e),iD=(i,e)=>{const t={RepresentationID:i.id,Bandwidth:i.bandwidth||0},{initialization:n={sourceURL:"",range:""}}=i,r=nl({baseUrl:i.baseUrl,source:s1(n.sourceURL,t),range:n.range});return nD(i,e).map(a=>{t.Number=a.number,t.Time=a.time;const o=s1(i.media||"",t),c=i.timescale||1,u=i.presentationTimeOffset||0,d=i.periodStart+(a.time-u)/c;return{uri:o,timeline:a.timeline,duration:a.duration,resolvedUri:Jc(i.baseUrl||"",o),map:r,number:a.number,presentationTime:d}})},rD=(i,e)=>{const{baseUrl:t,initialization:n={}}=i,r=nl({baseUrl:t,source:n.sourceURL,range:n.range}),s=nl({baseUrl:t,source:e.media,range:e.mediaRange});return s.map=r,s},sD=(i,e)=>{const{duration:t,segmentUrls:n=[],periodStart:r}=i;if(!t&&!e||t&&e)throw new Error(Pa.SEGMENT_TIME_UNSPECIFIED);const s=n.map(c=>rD(i,c));let a;return t&&(a=xf(i)),e&&(a=r1(i,e)),a.map((c,u)=>{if(s[u]){const d=s[u],h=i.timescale||1,b=i.presentationTimeOffset||0;return d.timeline=c.timeline,d.duration=c.duration,d.number=c.number,d.presentationTime=r+(c.time-b)/h,d}}).filter(c=>c)},aD=({attributes:i,segmentInfo:e})=>{let t,n;e.template?(n=iD,t=kn(i,e.template)):e.base?(n=Zy,t=kn(i,e.base)):e.list&&(n=sD,t=kn(i,e.list));const r={attributes:i};if(!n)return r;const s=n(t,e.segmentTimeline);if(t.duration){const{duration:a,timescale:o=1}=t;t.duration=a/o}else s.length?t.duration=s.reduce((a,o)=>Math.max(a,Math.ceil(o.duration)),0):t.duration=0;return r.attributes=t,r.segments=s,e.base&&t.indexRange&&(r.sidx=s[0],r.segments=[]),r},oD=i=>i.map(aD),Yt=(i,e)=>Jy(i.childNodes).filter(({tagName:t})=>t===e),il=i=>i.textContent.trim(),lD=i=>parseFloat(i.split("/").reduce((e,t)=>e/t)),Na=i=>{const o=/P(?:(\d*)Y)?(?:(\d*)M)?(?:(\d*)D)?(?:T(?:(\d*)H)?(?:(\d*)M)?(?:([\d.]*)S)?)?/.exec(i);if(!o)return 0;const[c,u,d,h,b,v]=o.slice(1);return parseFloat(c||0)*31536e3+parseFloat(u||0)*2592e3+parseFloat(d||0)*86400+parseFloat(h||0)*3600+parseFloat(b||0)*60+parseFloat(v||0)},cD=i=>(/^\d+-\d+-\d+T\d+:\d+:\d+(\.\d+)?$/.test(i)&&(i+="Z"),Date.parse(i)),a1={mediaPresentationDuration(i){return Na(i)},availabilityStartTime(i){return cD(i)/1e3},minimumUpdatePeriod(i){return Na(i)},suggestedPresentationDelay(i){return Na(i)},type(i){return i},timeShiftBufferDepth(i){return Na(i)},start(i){return Na(i)},width(i){return parseInt(i,10)},height(i){return parseInt(i,10)},bandwidth(i){return parseInt(i,10)},frameRate(i){return lD(i)},startNumber(i){return parseInt(i,10)},timescale(i){return parseInt(i,10)},presentationTimeOffset(i){return parseInt(i,10)},duration(i){const e=parseInt(i,10);return isNaN(e)?Na(i):e},d(i){return parseInt(i,10)},t(i){return parseInt(i,10)},r(i){return parseInt(i,10)},presentationTime(i){return parseInt(i,10)},DEFAULT(i){return i}},vn=i=>i&&i.attributes?Jy(i.attributes).reduce((e,t)=>{const n=a1[t.name]||a1.DEFAULT;return e[t.name]=n(t.value),e},{}):{},uD={"urn:uuid:1077efec-c0b2-4d02-ace3-3c1e52e2fb4b":"org.w3.clearkey","urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed":"com.widevine.alpha","urn:uuid:9a04f079-9840-4286-ab92-e65be0885f95":"com.microsoft.playready","urn:uuid:f239e769-efa3-4850-9c16-a903c6932efb":"com.adobe.primetime","urn:mpeg:dash:mp4protection:2011":"mp4protection"},tu=(i,e)=>e.length?Ia(i.map(function(t){return e.map(function(n){const r=il(n),s=Jc(t.baseUrl,r),a=kn(vn(n),{baseUrl:s});return s!==r&&!a.serviceLocation&&t.serviceLocation&&(a.serviceLocation=t.serviceLocation),a})})):i,Af=i=>{const e=Yt(i,"SegmentTemplate")[0],t=Yt(i,"SegmentList")[0],n=t&&Yt(t,"SegmentURL").map(h=>kn({tag:"SegmentURL"},vn(h))),r=Yt(i,"SegmentBase")[0],s=t||e,a=s&&Yt(s,"SegmentTimeline")[0],o=t||r||e,c=o&&Yt(o,"Initialization")[0],u=e&&vn(e);u&&c?u.initialization=c&&vn(c):u&&u.initialization&&(u.initialization={sourceURL:u.initialization});const d={template:u,segmentTimeline:a&&Yt(a,"S").map(h=>vn(h)),list:t&&kn(vn(t),{segmentUrls:n,initialization:vn(c)}),base:r&&kn(vn(r),{initialization:vn(c)})};return Object.keys(d).forEach(h=>{d[h]||delete d[h]}),d},dD=(i,e,t)=>n=>{const r=Yt(n,"BaseURL"),s=tu(e,r),a=kn(i,vn(n)),o=Af(n);return s.map(c=>({segmentInfo:kn(t,o),attributes:kn(a,c)}))},hD=i=>i.reduce((e,t)=>{const n=vn(t);n.schemeIdUri&&(n.schemeIdUri=n.schemeIdUri.toLowerCase());const r=uD[n.schemeIdUri];if(r){e[r]={attributes:n};const s=Yt(t,"cenc:pssh")[0];if(s){const a=il(s);e[r].pssh=a&&Oy(a)}}return e},{}),fD=i=>{if(i.schemeIdUri==="urn:scte:dash:cc:cea-608:2015")return(typeof i.value!="string"?[]:i.value.split(";")).map(t=>{let n,r;return r=t,/^CC\d=/.test(t)?[n,r]=t.split("="):/^CC\d$/.test(t)&&(n=t),{channel:n,language:r}});if(i.schemeIdUri==="urn:scte:dash:cc:cea-708:2015")return(typeof i.value!="string"?[]:i.value.split(";")).map(t=>{const n={channel:void 0,language:void 0,aspectRatio:1,easyReader:0,"3D":0};if(/=/.test(t)){const[r,s=""]=t.split("=");n.channel=r,n.language=t,s.split(",").forEach(a=>{const[o,c]=a.split(":");o==="lang"?n.language=c:o==="er"?n.easyReader=Number(c):o==="war"?n.aspectRatio=Number(c):o==="3D"&&(n["3D"]=Number(c))})}else n.language=t;return n.channel&&(n.channel="SERVICE"+n.channel),n})},pD=i=>Ia(Yt(i.node,"EventStream").map(e=>{const t=vn(e),n=t.schemeIdUri;return Yt(e,"Event").map(r=>{const s=vn(r),a=s.presentationTime||0,o=t.timescale||1,c=s.duration||0,u=a/o+i.attributes.start;return{schemeIdUri:n,value:t.value,id:s.id,start:u,end:u+c/o,messageData:il(r)||s.messageData,contentEncoding:t.contentEncoding,presentationTimeOffset:t.presentationTimeOffset||0}})})),mD=(i,e,t)=>n=>{const r=vn(n),s=tu(e,Yt(n,"BaseURL")),a=Yt(n,"Role")[0],o={role:vn(a)};let c=kn(i,r,o);const u=Yt(n,"Accessibility")[0],d=fD(vn(u));d&&(c=kn(c,{captionServices:d}));const h=Yt(n,"Label")[0];if(h&&h.childNodes.length){const f=h.childNodes[0].nodeValue.trim();c=kn(c,{label:f})}const b=hD(Yt(n,"ContentProtection"));Object.keys(b).length&&(c=kn(c,{contentProtection:b}));const v=Af(n),y=Yt(n,"Representation"),p=kn(t,v);return Ia(y.map(dD(c,s,p)))},gD=(i,e)=>(t,n)=>{const r=tu(e,Yt(t.node,"BaseURL")),s=kn(i,{periodStart:t.attributes.start});typeof t.attributes.duration=="number"&&(s.periodDuration=t.attributes.duration);const a=Yt(t.node,"AdaptationSet"),o=Af(t.node);return Ia(a.map(mD(s,r,o)))},vD=(i,e)=>{if(i.length>1&&e({type:"warn",message:"The MPD manifest should contain no more than one ContentSteering tag"}),!i.length)return null;const t=kn({serverURL:il(i[0])},vn(i[0]));return t.queryBeforeStart=t.queryBeforeStart==="true",t},yD=({attributes:i,priorPeriodAttributes:e,mpdType:t})=>typeof i.start=="number"?i.start:e&&typeof e.start=="number"&&typeof e.duration=="number"?e.start+e.duration:!e&&t==="static"?0:null,bD=(i,e={})=>{const{manifestUri:t="",NOW:n=Date.now(),clientOffset:r=0,eventHandler:s=function(){}}=e,a=Yt(i,"Period");if(!a.length)throw new Error(Pa.INVALID_NUMBER_OF_PERIOD);const o=Yt(i,"Location"),c=vn(i),u=tu([{baseUrl:t}],Yt(i,"BaseURL")),d=Yt(i,"ContentSteering");c.type=c.type||"static",c.sourceDuration=c.mediaPresentationDuration||0,c.NOW=n,c.clientOffset=r,o.length&&(c.locations=o.map(il));const h=[];return a.forEach((b,v)=>{const y=vn(b),p=h[v-1];y.start=yD({attributes:y,priorPeriodAttributes:p?p.attributes:null,mpdType:c.type}),h.push({node:b,attributes:y})}),{locations:c.locations,contentSteeringInfo:vD(d,s),representationInfo:Ia(h.map(gD(c,u))),eventStream:Ia(h.map(pD))}},o1=i=>{if(i==="")throw new Error(Pa.DASH_EMPTY_MANIFEST);const e=new A6.DOMParser;let t,n;try{t=e.parseFromString(i,"application/xml"),n=t&&t.documentElement.tagName==="MPD"?t.documentElement:null}catch{}if(!n||n&&n.getElementsByTagName("parsererror").length>0)throw new Error(Pa.DASH_INVALID_XML);return n},_D=i=>{const e=Yt(i,"UTCTiming")[0];if(!e)return null;const t=vn(e);switch(t.schemeIdUri){case"urn:mpeg:dash:utc:http-head:2014":case"urn:mpeg:dash:utc:http-head:2012":t.method="HEAD";break;case"urn:mpeg:dash:utc:http-xsdate:2014":case"urn:mpeg:dash:utc:http-iso:2014":case"urn:mpeg:dash:utc:http-xsdate:2012":case"urn:mpeg:dash:utc:http-iso:2012":t.method="GET";break;case"urn:mpeg:dash:utc:direct:2014":case"urn:mpeg:dash:utc:direct:2012":t.method="DIRECT",t.value=Date.parse(t.value);break;case"urn:mpeg:dash:utc:http-ntp:2014":case"urn:mpeg:dash:utc:ntp:2014":case"urn:mpeg:dash:utc:sntp:2014":default:throw new Error(Pa.UNSUPPORTED_UTC_TIMING_SCHEME)}return t},kD=(i,e={})=>{const t=bD(o1(i),e),n=oD(t.representationInfo);return Q6({dashPlaylists:n,locations:t.locations,contentSteering:t.contentSteeringInfo,sidxMapping:e.sidxMapping,previousManifest:e.previousManifest,eventStream:t.eventStream})},TD=i=>_D(o1(i));var If,l1;function SD(){if(l1)return If;l1=1;var i=Math.pow(2,32),e=function(t){var n=new DataView(t.buffer,t.byteOffset,t.byteLength),r;return n.getBigUint64?(r=n.getBigUint64(0),r<Number.MAX_SAFE_INTEGER?Number(r):r):n.getUint32(0)*i+n.getUint32(4)};return If={getUint64:e,MAX_UINT32:i},If}var Pf,c1;function CD(){if(c1)return Pf;c1=1;var i=SD().getUint64,e=function(t){var n=new DataView(t.buffer,t.byteOffset,t.byteLength),r={version:t[0],flags:new Uint8Array(t.subarray(1,4)),references:[],referenceId:n.getUint32(4),timescale:n.getUint32(8)},s=12;r.version===0?(r.earliestPresentationTime=n.getUint32(s),r.firstOffset=n.getUint32(s+4),s+=8):(r.earliestPresentationTime=i(t.subarray(s)),r.firstOffset=i(t.subarray(s+8)),s+=16),s+=2;var a=n.getUint16(s);for(s+=2;a>0;s+=12,a--)r.references.push({referenceType:(t[s]&128)>>>7,referencedSize:n.getUint32(s)&2147483647,subsegmentDuration:n.getUint32(s+4),startsWithSap:!!(t[s+8]&128),sapType:(t[s+8]&112)>>>4,sapDeltaTime:n.getUint32(s+8)&268435455});return r};return Pf=e,Pf}var xD=CD();const ED=Ca(xD);var wD=st([73,68,51]),DD=function(e,t){t===void 0&&(t=0),e=st(e);var n=e[t+5],r=e[t+6]<<21|e[t+7]<<14|e[t+8]<<7|e[t+9],s=(n&16)>>4;return s?r+20:r+10},rl=function i(e,t){return t===void 0&&(t=0),e=st(e),e.length-t<10||!Xt(e,wD,{offset:t})?t:(t+=DD(e,t),i(e,t))},u1=function(e){return typeof e=="string"?jy(e):e},AD=function(e){return Array.isArray(e)?e.map(function(t){return u1(t)}):[u1(e)]},ID=function i(e,t,n){n===void 0&&(n=!1),t=AD(t),e=st(e);var r=[];if(!t.length)return r;for(var s=0;s<e.length;){var a=(e[s]<<24|e[s+1]<<16|e[s+2]<<8|e[s+3])>>>0,o=e.subarray(s+4,s+8);if(a===0)break;var c=s+a;if(c>e.length){if(n)break;c=e.length}var u=e.subarray(s+8,c);Xt(o,t[0])&&(t.length===1?r.push(u):r.push.apply(r,i(u,t.slice(1),n))),s=c}return r},nu={EBML:st([26,69,223,163]),DocType:st([66,130]),Segment:st([24,83,128,103]),SegmentInfo:st([21,73,169,102]),Tracks:st([22,84,174,107]),Track:st([174]),TrackNumber:st([215]),DefaultDuration:st([35,227,131]),TrackEntry:st([174]),TrackType:st([131]),FlagDefault:st([136]),CodecID:st([134]),CodecPrivate:st([99,162]),VideoTrack:st([224]),AudioTrack:st([225]),Cluster:st([31,67,182,117]),Timestamp:st([231]),TimestampScale:st([42,215,177]),BlockGroup:st([160]),BlockDuration:st([155]),Block:st([161]),SimpleBlock:st([163])},Nf=[128,64,32,16,8,4,2,1],PD=function(e){for(var t=1,n=0;n<Nf.length&&!(e&Nf[n]);n++)t++;return t},iu=function(e,t,n,r){n===void 0&&(n=!0),r===void 0&&(r=!1);var s=PD(e[t]),a=e.subarray(t,t+s);return n&&(a=Array.prototype.slice.call(e,t,t+s),a[0]^=Nf[s-1]),{length:s,value:k6(a,{signed:r}),bytes:a}},d1=function i(e){return typeof e=="string"?e.match(/.{1,2}/g).map(function(t){return i(t)}):typeof e=="number"?T6(e):e},ND=function(e){return Array.isArray(e)?e.map(function(t){return d1(t)}):[d1(e)]},OD=function i(e,t,n){if(n>=t.length)return t.length;var r=iu(t,n,!1);if(Xt(e.bytes,r.bytes))return n;var s=iu(t,n+r.length);return i(e,t,n+s.length+s.value+r.length)},h1=function i(e,t){t=ND(t),e=st(e);var n=[];if(!t.length)return n;for(var r=0;r<e.length;){var s=iu(e,r,!1),a=iu(e,r+s.length),o=r+s.length+a.length;a.value===127&&(a.value=OD(s,e,o),a.value!==e.length&&(a.value-=o));var c=o+a.value>e.length?e.length:o+a.value,u=e.subarray(o,c);Xt(t[0],s.bytes)&&(t.length===1?n.push(u):n=n.concat(i(u,t.slice(1))));var d=s.length+a.length+u.length;r+=d}return n},MD=st([0,0,0,1]),RD=st([0,0,1]),LD=st([0,0,3]),BD=function(e){for(var t=[],n=1;n<e.length-2;)Xt(e.subarray(n,n+3),LD)&&(t.push(n+2),n++),n++;if(t.length===0)return e;var r=e.length-t.length,s=new Uint8Array(r),a=0;for(n=0;n<r;a++,n++)a===t[0]&&(a++,t.shift()),s[n]=e[a];return s},f1=function(e,t,n,r){e=st(e),n=[].concat(n);for(var s=0,a,o=0;s<e.length&&(o<r||a);){var c=void 0;if(Xt(e.subarray(s),MD)?c=4:Xt(e.subarray(s),RD)&&(c=3),!c){s++;continue}if(o++,a)return BD(e.subarray(a,s));var u=void 0;t==="h264"?u=e[s+c]&31:t==="h265"&&(u=e[s+c]>>1&63),n.indexOf(u)!==-1&&(a=s+c),s+=c+(t==="h264"?1:2)}return e.subarray(0,0)},UD=function(e,t,n){return f1(e,"h264",t,n)},FD=function(e,t,n){return f1(e,"h265",t,n)},Wn={webm:st([119,101,98,109]),matroska:st([109,97,116,114,111,115,107,97]),flac:st([102,76,97,67]),ogg:st([79,103,103,83]),ac3:st([11,119]),riff:st([82,73,70,70]),avi:st([65,86,73]),wav:st([87,65,86,69]),"3gp":st([102,116,121,112,51,103]),mp4:st([102,116,121,112]),fmp4:st([115,116,121,112]),mov:st([102,116,121,112,113,116]),moov:st([109,111,111,118]),moof:st([109,111,111,102])},Oa={aac:function(e){var t=rl(e);return Xt(e,[255,16],{offset:t,mask:[255,22]})},mp3:function(e){var t=rl(e);return Xt(e,[255,2],{offset:t,mask:[255,6]})},webm:function(e){var t=h1(e,[nu.EBML,nu.DocType])[0];return Xt(t,Wn.webm)},mkv:function(e){var t=h1(e,[nu.EBML,nu.DocType])[0];return Xt(t,Wn.matroska)},mp4:function(e){if(Oa["3gp"](e)||Oa.mov(e))return!1;if(Xt(e,Wn.mp4,{offset:4})||Xt(e,Wn.fmp4,{offset:4})||Xt(e,Wn.moof,{offset:4})||Xt(e,Wn.moov,{offset:4}))return!0},mov:function(e){return Xt(e,Wn.mov,{offset:4})},"3gp":function(e){return Xt(e,Wn["3gp"],{offset:4})},ac3:function(e){var t=rl(e);return Xt(e,Wn.ac3,{offset:t})},ts:function(e){if(e.length<189&&e.length>=1)return e[0]===71;for(var t=0;t+188<e.length&&t<188;){if(e[t]===71&&e[t+188]===71)return!0;t+=1}return!1},flac:function(e){var t=rl(e);return Xt(e,Wn.flac,{offset:t})},ogg:function(e){return Xt(e,Wn.ogg)},avi:function(e){return Xt(e,Wn.riff)&&Xt(e,Wn.avi,{offset:8})},wav:function(e){return Xt(e,Wn.riff)&&Xt(e,Wn.wav,{offset:8})},h264:function(e){return UD(e,7,3).length},h265:function(e){return FD(e,[32,33],3).length}},Of=Object.keys(Oa).filter(function(i){return i!=="ts"&&i!=="h264"&&i!=="h265"}).concat(["ts","h264","h265"]);Of.forEach(function(i){var e=Oa[i];Oa[i]=function(t){return e(st(t))}});var VD=Oa,Mf=function(e){e=st(e);for(var t=0;t<Of.length;t++){var n=Of[t];if(VD[n](e))return n}return""},jD=function(e){return ID(e,["moof"]).length>0},Rf,p1;function $D(){if(p1)return Rf;p1=1;var i=9e4,e,t,n,r,s,a,o;return e=function(c){return c*i},t=function(c,u){return c*u},n=function(c){return c/i},r=function(c,u){return c/u},s=function(c,u){return e(r(c,u))},a=function(c,u){return t(n(c),u)},o=function(c,u,d){return n(d?c:c-u)},Rf={ONE_SECOND_IN_TS:i,secondsToVideoTs:e,secondsToAudioTs:t,videoTsToSeconds:n,audioTsToSeconds:r,audioTsToVideoTs:s,videoTsToAudioTs:a,metadataTsToSeconds:o},Rf}var Ls=$D();/**
48
+ * @license
49
+ * Video.js 8.23.3 <http://videojs.com/>
50
+ * Copyright Brightcove, Inc. <https://www.brightcove.com/>
51
+ * Available under Apache License Version 2.0
52
+ * <https://github.com/videojs/video.js/blob/main/LICENSE>
53
+ *
54
+ * Includes vtt.js <https://github.com/mozilla/vtt.js>
55
+ * Available under Apache License Version 2.0
56
+ * <https://github.com/mozilla/vtt.js/blob/main/LICENSE>
57
+ */var Lf="8.23.3";const Ar={},rs=function(i,e){return Ar[i]=Ar[i]||[],e&&(Ar[i]=Ar[i].concat(e)),Ar[i]},HD=function(i,e){rs(i,e)},m1=function(i,e){const t=rs(i).indexOf(e);return t<=-1?!1:(Ar[i]=Ar[i].slice(),Ar[i].splice(t,1),!0)},qD=function(i,e){rs(i,[].concat(e).map(t=>{const n=(...r)=>(m1(i,n),t(...r));return n}))},ru={prefixed:!0},su=[["requestFullscreen","exitFullscreen","fullscreenElement","fullscreenEnabled","fullscreenchange","fullscreenerror","fullscreen"],["webkitRequestFullscreen","webkitExitFullscreen","webkitFullscreenElement","webkitFullscreenEnabled","webkitfullscreenchange","webkitfullscreenerror","-webkit-full-screen"]],g1=su[0];let sl;for(let i=0;i<su.length;i++)if(su[i][1]in Ue){sl=su[i];break}if(sl){for(let i=0;i<sl.length;i++)ru[g1[i]]=sl[i];ru.prefixed=sl[0]!==g1[0]}let ti=[];const zD=(i,e,t)=>(n,r,s)=>{const a=e.levels[r],o=new RegExp(`^(${a})$`);let c=i;if(n!=="log"&&s.unshift(n.toUpperCase()+":"),t&&(c=`%c${i}`,s.unshift(t)),s.unshift(c+":"),ti){ti.push([].concat(s));const d=ti.length-1e3;ti.splice(0,d>0?d:0)}if(!te.console)return;let u=te.console[n];!u&&n==="debug"&&(u=te.console.info||te.console.log),!(!u||!a||!o.test(n))&&u[Array.isArray(s)?"apply":"call"](te.console,s)};function Bf(i,e=":",t=""){let n="info",r;function s(...a){r("log",n,a)}return r=zD(i,s,t),s.createLogger=(a,o,c)=>{const u=o!==void 0?o:e,d=c!==void 0?c:t,h=`${i} ${u} ${a}`;return Bf(h,u,d)},s.createNewLogger=(a,o,c)=>Bf(a,o,c),s.levels={all:"debug|log|warn|error",off:"",debug:"debug|log|warn|error",info:"log|warn|error",warn:"warn|error",error:"error",DEFAULT:n},s.level=a=>{if(typeof a=="string"){if(!s.levels.hasOwnProperty(a))throw new Error(`"${a}" in not a valid log level`);n=a}return n},s.history=()=>ti?[].concat(ti):[],s.history.filter=a=>(ti||[]).filter(o=>new RegExp(`.*${a}.*`).test(o[0])),s.history.clear=()=>{ti&&(ti.length=0)},s.history.disable=()=>{ti!==null&&(ti.length=0,ti=null)},s.history.enable=()=>{ti===null&&(ti=[])},s.error=(...a)=>r("error",n,a),s.warn=(...a)=>r("warn",n,a),s.debug=(...a)=>r("debug",n,a),s}const bt=Bf("VIDEOJS"),v1=bt.createLogger,GD=Object.prototype.toString,y1=function(i){return sr(i)?Object.keys(i):[]};function Ma(i,e){y1(i).forEach(t=>e(i[t],t))}function b1(i,e,t=0){return y1(i).reduce((n,r)=>e(n,i[r],r),t)}function sr(i){return!!i&&typeof i=="object"}function Ra(i){return sr(i)&&GD.call(i)==="[object Object]"&&i.constructor===Object}function Lt(...i){const e={};return i.forEach(t=>{t&&Ma(t,(n,r)=>{if(!Ra(n)){e[r]=n;return}Ra(e[r])||(e[r]={}),e[r]=Lt(e[r],n)})}),e}function _1(i={}){const e=[];for(const t in i)if(i.hasOwnProperty(t)){const n=i[t];e.push(n)}return e}function au(i,e,t,n=!0){const r=a=>Object.defineProperty(i,e,{value:a,enumerable:!0,writable:!0}),s={configurable:!0,enumerable:!0,get(){const a=t();return r(a),a}};return n&&(s.set=r),Object.defineProperty(i,e,s)}var WD=Object.freeze({__proto__:null,each:Ma,reduce:b1,isObject:sr,isPlain:Ra,merge:Lt,values:_1,defineLazyProperty:au});let Uf=!1,k1=null,qi=!1,T1,S1=!1,La=!1,Ba=!1,ar=!1,Ff=null,ou=null;const KD=!!(te.cast&&te.cast.framework&&te.cast.framework.CastReceiverContext);let C1=null,lu=!1,cu=!1,uu=!1,du=!1,hu=!1,fu=!1,pu=!1;const al=!!(Ua()&&("ontouchstart"in te||te.navigator.maxTouchPoints||te.DocumentTouch&&te.document instanceof te.DocumentTouch)),ss=te.navigator&&te.navigator.userAgentData;if(ss&&ss.platform&&ss.brands&&(qi=ss.platform==="Android",La=!!ss.brands.find(i=>i.brand==="Microsoft Edge"),Ba=!!ss.brands.find(i=>i.brand==="Chromium"),ar=!La&&Ba,Ff=ou=(ss.brands.find(i=>i.brand==="Chromium")||{}).version||null,cu=ss.platform==="Windows"),!Ba){const i=te.navigator&&te.navigator.userAgent||"";Uf=/iPod/i.test(i),k1=function(){const e=i.match(/OS (\d+)_/i);return e&&e[1]?e[1]:null}(),qi=/Android/i.test(i),T1=function(){const e=i.match(/Android (\d+)(?:\.(\d+))?(?:\.(\d+))*/i);if(!e)return null;const t=e[1]&&parseFloat(e[1]),n=e[2]&&parseFloat(e[2]);return t&&n?parseFloat(e[1]+"."+e[2]):t||null}(),S1=/Firefox/i.test(i),La=/Edg/i.test(i),Ba=/Chrome/i.test(i)||/CriOS/i.test(i),ar=!La&&Ba,Ff=ou=function(){const e=i.match(/(Chrome|CriOS)\/(\d+)/);return e&&e[2]?parseFloat(e[2]):null}(),C1=function(){const e=/MSIE\s(\d+)\.\d/.exec(i);let t=e&&parseFloat(e[1]);return!t&&/Trident\/7.0/i.test(i)&&/rv:11.0/.test(i)&&(t=11),t}(),hu=/Tizen/i.test(i),fu=/Web0S/i.test(i),pu=hu||fu,lu=/Safari/i.test(i)&&!ar&&!qi&&!La&&!pu,cu=/Windows/i.test(i),uu=/iPad/i.test(i)||lu&&al&&!/iPhone/i.test(i),du=/iPhone/i.test(i)&&!uu}const Bn=du||uu||Uf,mu=(lu||Bn)&&!ar;var x1=Object.freeze({__proto__:null,get IS_IPOD(){return Uf},get IOS_VERSION(){return k1},get IS_ANDROID(){return qi},get ANDROID_VERSION(){return T1},get IS_FIREFOX(){return S1},get IS_EDGE(){return La},get IS_CHROMIUM(){return Ba},get IS_CHROME(){return ar},get CHROMIUM_VERSION(){return Ff},get CHROME_VERSION(){return ou},IS_CHROMECAST_RECEIVER:KD,get IE_VERSION(){return C1},get IS_SAFARI(){return lu},get IS_WINDOWS(){return cu},get IS_IPAD(){return uu},get IS_IPHONE(){return du},get IS_TIZEN(){return hu},get IS_WEBOS(){return fu},get IS_SMART_TV(){return pu},TOUCH_ENABLED:al,IS_IOS:Bn,IS_ANY_SAFARI:mu});function E1(i){return typeof i=="string"&&!!i.trim()}function XD(i){if(i.indexOf(" ")>=0)throw new Error("class has illegal whitespace characters")}function Ua(){return Ue===te.document}function Fa(i){return sr(i)&&i.nodeType===1}function w1(){try{return te.parent!==te.self}catch{return!0}}function D1(i){return function(e,t){if(!E1(e))return Ue[i](null);E1(t)&&(t=Ue.querySelector(t));const n=Fa(t)?t:Ue;return n[i]&&n[i](e)}}function ot(i="div",e={},t={},n){const r=Ue.createElement(i);return Object.getOwnPropertyNames(e).forEach(function(s){const a=e[s];s==="textContent"?as(r,a):(r[s]!==a||s==="tabIndex")&&(r[s]=a)}),Object.getOwnPropertyNames(t).forEach(function(s){r.setAttribute(s,t[s])}),n&&jf(r,n),r}function as(i,e){return typeof i.textContent>"u"?i.innerText=e:i.textContent=e,i}function Vf(i,e){e.firstChild?e.insertBefore(i,e.firstChild):e.appendChild(i)}function ol(i,e){return XD(e),i.classList.contains(e)}function Bs(i,...e){return i.classList.add(...e.reduce((t,n)=>t.concat(n.split(/\s+/)),[])),i}function gu(i,...e){return i?(i.classList.remove(...e.reduce((t,n)=>t.concat(n.split(/\s+/)),[])),i):(bt.warn("removeClass was called with an element that doesn't exist"),null)}function A1(i,e,t){return typeof t=="function"&&(t=t(i,e)),typeof t!="boolean"&&(t=void 0),e.split(/\s+/).forEach(n=>i.classList.toggle(n,t)),i}function I1(i,e){Object.getOwnPropertyNames(e).forEach(function(t){const n=e[t];n===null||typeof n>"u"||n===!1?i.removeAttribute(t):i.setAttribute(t,n===!0?"":n)})}function os(i){const e={},t=["autoplay","controls","playsinline","loop","muted","default","defaultMuted"];if(i&&i.attributes&&i.attributes.length>0){const n=i.attributes;for(let r=n.length-1;r>=0;r--){const s=n[r].name;let a=n[r].value;t.includes(s)&&(a=a!==null),e[s]=a}}return e}function P1(i,e){return i.getAttribute(e)}function Va(i,e,t){i.setAttribute(e,t)}function vu(i,e){i.removeAttribute(e)}function N1(){Ue.body.focus(),Ue.onselectstart=function(){return!1}}function O1(){Ue.onselectstart=function(){return!0}}function ja(i){if(i&&i.getBoundingClientRect&&i.parentNode){const e=i.getBoundingClientRect(),t={};return["bottom","height","left","right","top","width"].forEach(n=>{e[n]!==void 0&&(t[n]=e[n])}),t.height||(t.height=parseFloat($a(i,"height"))),t.width||(t.width=parseFloat($a(i,"width"))),t}}function ll(i){if(!i||i&&!i.offsetParent)return{left:0,top:0,width:0,height:0};const e=i.offsetWidth,t=i.offsetHeight;let n=0,r=0;for(;i.offsetParent&&i!==Ue[ru.fullscreenElement];)n+=i.offsetLeft,r+=i.offsetTop,i=i.offsetParent;return{left:n,top:r,width:e,height:t}}function yu(i,e){const t={x:0,y:0};if(Bn){let d=i;for(;d&&d.nodeName.toLowerCase()!=="html";){const h=$a(d,"transform");if(/^matrix/.test(h)){const b=h.slice(7,-1).split(/,\s/).map(Number);t.x+=b[4],t.y+=b[5]}else if(/^matrix3d/.test(h)){const b=h.slice(9,-1).split(/,\s/).map(Number);t.x+=b[12],t.y+=b[13]}if(d.assignedSlot&&d.assignedSlot.parentElement&&te.WebKitCSSMatrix){const b=te.getComputedStyle(d.assignedSlot.parentElement).transform,v=new te.WebKitCSSMatrix(b);t.x+=v.m41,t.y+=v.m42}d=d.parentNode||d.host}}const n={},r=ll(e.target),s=ll(i),a=s.width,o=s.height;let c=e.offsetY-(s.top-r.top),u=e.offsetX-(s.left-r.left);return e.changedTouches&&(u=e.changedTouches[0].pageX-s.left,c=e.changedTouches[0].pageY+s.top,Bn&&(u-=t.x,c-=t.y)),n.y=1-Math.max(0,Math.min(1,c/o)),n.x=Math.max(0,Math.min(1,u/a)),n}function M1(i){return sr(i)&&i.nodeType===3}function bu(i){for(;i.firstChild;)i.removeChild(i.firstChild);return i}function R1(i){return typeof i=="function"&&(i=i()),(Array.isArray(i)?i:[i]).map(e=>{if(typeof e=="function"&&(e=e()),Fa(e)||M1(e))return e;if(typeof e=="string"&&/\S/.test(e))return Ue.createTextNode(e)}).filter(e=>e)}function jf(i,e){return R1(e).forEach(t=>i.appendChild(t)),i}function L1(i,e){return jf(bu(i),e)}function cl(i){return i.button===void 0&&i.buttons===void 0||i.button===0&&i.buttons===void 0||i.type==="mouseup"&&i.button===0&&i.buttons===0||i.type==="mousedown"&&i.button===0&&i.buttons===0?!0:!(i.button!==0||i.buttons!==1)}const ls=D1("querySelector"),B1=D1("querySelectorAll");function $a(i,e){if(!i||!e)return"";if(typeof te.getComputedStyle=="function"){let t;try{t=te.getComputedStyle(i)}catch{return""}return t?t.getPropertyValue(e)||t[e]:""}return""}function U1(i){[...Ue.styleSheets].forEach(e=>{try{const t=[...e.cssRules].map(r=>r.cssText).join(""),n=Ue.createElement("style");n.textContent=t,i.document.head.appendChild(n)}catch{const n=Ue.createElement("link");n.rel="stylesheet",n.type=e.type,n.media=e.media.mediaText,n.href=e.href,i.document.head.appendChild(n)}})}var F1=Object.freeze({__proto__:null,isReal:Ua,isEl:Fa,isInFrame:w1,createEl:ot,textContent:as,prependTo:Vf,hasClass:ol,addClass:Bs,removeClass:gu,toggleClass:A1,setAttributes:I1,getAttributes:os,getAttribute:P1,setAttribute:Va,removeAttribute:vu,blockTextSelection:N1,unblockTextSelection:O1,getBoundingClientRect:ja,findPosition:ll,getPointerPosition:yu,isTextNode:M1,emptyEl:bu,normalizeContent:R1,appendContent:jf,insertContent:L1,isSingleLeftClick:cl,$:ls,$$:B1,computedStyle:$a,copyStyleSheetsToWindow:U1});let V1=!1,$f;const YD=function(){if($f.options.autoSetup===!1)return;const i=Array.prototype.slice.call(Ue.getElementsByTagName("video")),e=Array.prototype.slice.call(Ue.getElementsByTagName("audio")),t=Array.prototype.slice.call(Ue.getElementsByTagName("video-js")),n=i.concat(e,t);if(n&&n.length>0)for(let r=0,s=n.length;r<s;r++){const a=n[r];if(a&&a.getAttribute)a.player===void 0&&a.getAttribute("data-setup")!==null&&$f(a);else{Hf(1);break}}else V1||Hf(1)};function Hf(i,e){Ua()&&(e&&($f=e),te.setTimeout(YD,i))}function qf(){V1=!0,te.removeEventListener("load",qf)}Ua()&&(Ue.readyState==="complete"?qf():te.addEventListener("load",qf));const j1=function(i){const e=Ue.createElement("style");return e.className=i,e},$1=function(i,e){i.styleSheet?i.styleSheet.cssText=e:i.textContent=e};var Kn=new WeakMap;let JD=3;function Ei(){return JD++}function H1(i,e){if(!Kn.has(i))return;const t=Kn.get(i);t.handlers[e].length===0&&(delete t.handlers[e],i.removeEventListener?i.removeEventListener(e,t.dispatcher,!1):i.detachEvent&&i.detachEvent("on"+e,t.dispatcher)),Object.getOwnPropertyNames(t.handlers).length<=0&&(delete t.handlers,delete t.dispatcher,delete t.disabled),Object.getOwnPropertyNames(t).length===0&&Kn.delete(i)}function zf(i,e,t,n){t.forEach(function(r){i(e,r,n)})}function _u(i){if(i.fixed_)return i;function e(){return!0}function t(){return!1}if(!i||!i.isPropagationStopped||!i.isImmediatePropagationStopped){const n=i||te.event;i={};const r=["layerX","layerY","keyLocation","path","webkitMovementX","webkitMovementY","mozPressure","mozInputSource"];for(const s in n)r.includes(s)||s==="returnValue"&&n.preventDefault||(i[s]=n[s]);if(i.target||(i.target=i.srcElement||Ue),i.relatedTarget||(i.relatedTarget=i.fromElement===i.target?i.toElement:i.fromElement),i.preventDefault=function(){n.preventDefault&&n.preventDefault(),i.returnValue=!1,n.returnValue=!1,i.defaultPrevented=!0},i.defaultPrevented=!1,i.stopPropagation=function(){n.stopPropagation&&n.stopPropagation(),i.cancelBubble=!0,n.cancelBubble=!0,i.isPropagationStopped=e},i.isPropagationStopped=t,i.stopImmediatePropagation=function(){n.stopImmediatePropagation&&n.stopImmediatePropagation(),i.isImmediatePropagationStopped=e,i.stopPropagation()},i.isImmediatePropagationStopped=t,i.clientX!==null&&i.clientX!==void 0){const s=Ue.documentElement,a=Ue.body;i.pageX=i.clientX+(s&&s.scrollLeft||a&&a.scrollLeft||0)-(s&&s.clientLeft||a&&a.clientLeft||0),i.pageY=i.clientY+(s&&s.scrollTop||a&&a.scrollTop||0)-(s&&s.clientTop||a&&a.clientTop||0)}i.which=i.charCode||i.keyCode,i.button!==null&&i.button!==void 0&&(i.button=i.button&1?0:i.button&4?1:i.button&2?2:0)}return i.fixed_=!0,i}let ku;const QD=function(){if(typeof ku!="boolean"){ku=!1;try{const i=Object.defineProperty({},"passive",{get(){ku=!0}});te.addEventListener("test",null,i),te.removeEventListener("test",null,i)}catch{}}return ku},ZD=["touchstart","touchmove"];function fi(i,e,t){if(Array.isArray(e))return zf(fi,i,e,t);Kn.has(i)||Kn.set(i,{});const n=Kn.get(i);if(n.handlers||(n.handlers={}),n.handlers[e]||(n.handlers[e]=[]),t.guid||(t.guid=Ei()),n.handlers[e].push(t),n.dispatcher||(n.disabled=!1,n.dispatcher=function(r,s){if(n.disabled)return;r=_u(r);const a=n.handlers[r.type];if(a){const o=a.slice(0);for(let c=0,u=o.length;c<u&&!r.isImmediatePropagationStopped();c++)try{o[c].call(i,r,s)}catch(d){bt.error(d)}}}),n.handlers[e].length===1)if(i.addEventListener){let r=!1;QD()&&ZD.indexOf(e)>-1&&(r={passive:!0}),i.addEventListener(e,n.dispatcher,r)}else i.attachEvent&&i.attachEvent("on"+e,n.dispatcher)}function Un(i,e,t){if(!Kn.has(i))return;const n=Kn.get(i);if(!n.handlers)return;if(Array.isArray(e))return zf(Un,i,e,t);const r=function(a,o){n.handlers[o]=[],H1(a,o)};if(e===void 0){for(const a in n.handlers)Object.prototype.hasOwnProperty.call(n.handlers||{},a)&&r(i,a);return}const s=n.handlers[e];if(s){if(!t){r(i,e);return}if(t.guid)for(let a=0;a<s.length;a++)s[a].guid===t.guid&&s.splice(a--,1);H1(i,e)}}function Ha(i,e,t){const n=Kn.has(i)?Kn.get(i):{},r=i.parentNode||i.ownerDocument;if(typeof e=="string"?e={type:e,target:i}:e.target||(e.target=i),e=_u(e),n.dispatcher&&n.dispatcher.call(i,e,t),r&&!e.isPropagationStopped()&&e.bubbles===!0)Ha.call(null,r,e,t);else if(!r&&!e.defaultPrevented&&e.target&&e.target[e.type]){Kn.has(e.target)||Kn.set(e.target,{});const s=Kn.get(e.target);e.target[e.type]&&(s.disabled=!0,typeof e.target[e.type]=="function"&&e.target[e.type](),s.disabled=!1)}return!e.defaultPrevented}function Tu(i,e,t){if(Array.isArray(e))return zf(Tu,i,e,t);const n=function(){Un(i,e,n),t.apply(this,arguments)};n.guid=t.guid=t.guid||Ei(),fi(i,e,n)}function Gf(i,e,t){const n=function(){Un(i,e,n),t.apply(this,arguments)};n.guid=t.guid=t.guid||Ei(),fi(i,e,n)}var eA=Object.freeze({__proto__:null,fixEvent:_u,on:fi,off:Un,trigger:Ha,one:Tu,any:Gf});const wi=30,zt=function(i,e,t){e.guid||(e.guid=Ei());const n=e.bind(i);return n.guid=t?t+"_"+e.guid:e.guid,n},or=function(i,e){let t=te.performance.now();return function(...r){const s=te.performance.now();s-t>=e&&(i(...r),t=s)}},q1=function(i,e,t,n=te){let r;const s=()=>{n.clearTimeout(r),r=null},a=function(){const o=this,c=arguments;let u=function(){r=null,u=null,t||i.apply(o,c)};!r&&t&&i.apply(o,c),n.clearTimeout(r),r=n.setTimeout(u,e)};return a.cancel=s,a};var tA=Object.freeze({__proto__:null,UPDATE_REFRESH_INTERVAL:wi,bind_:zt,throttle:or,debounce:q1});let ul;class pi{on(e,t){const n=this.addEventListener;this.addEventListener=()=>{},fi(this,e,t),this.addEventListener=n}off(e,t){Un(this,e,t)}one(e,t){const n=this.addEventListener;this.addEventListener=()=>{},Tu(this,e,t),this.addEventListener=n}any(e,t){const n=this.addEventListener;this.addEventListener=()=>{},Gf(this,e,t),this.addEventListener=n}trigger(e){const t=e.type||e;typeof e=="string"&&(e={type:t}),e=_u(e),this.allowedEvents_[t]&&this["on"+t]&&this["on"+t](e),Ha(this,e)}queueTrigger(e){ul||(ul=new Map);const t=e.type||e;let n=ul.get(this);n||(n=new Map,ul.set(this,n));const r=n.get(t);n.delete(t),te.clearTimeout(r);const s=te.setTimeout(()=>{n.delete(t),n.size===0&&(n=null,ul.delete(this)),this.trigger(e)},0);n.set(t,s)}}pi.prototype.allowedEvents_={},pi.prototype.addEventListener=pi.prototype.on,pi.prototype.removeEventListener=pi.prototype.off,pi.prototype.dispatchEvent=pi.prototype.trigger;const Su=i=>typeof i.name=="function"?i.name():typeof i.name=="string"?i.name:i.name_?i.name_:i.constructor&&i.constructor.name?i.constructor.name:typeof i,Ir=i=>i instanceof pi||!!i.eventBusEl_&&["on","one","off","trigger"].every(e=>typeof i[e]=="function"),nA=(i,e)=>{Ir(i)?e():(i.eventedCallbacks||(i.eventedCallbacks=[]),i.eventedCallbacks.push(e))},Wf=i=>typeof i=="string"&&/\S/.test(i)||Array.isArray(i)&&!!i.length,Cu=(i,e,t)=>{if(!i||!i.nodeName&&!Ir(i))throw new Error(`Invalid target for ${Su(e)}#${t}; must be a DOM node or evented object.`)},z1=(i,e,t)=>{if(!Wf(i))throw new Error(`Invalid event type for ${Su(e)}#${t}; must be a non-empty string or array.`)},G1=(i,e,t)=>{if(typeof i!="function")throw new Error(`Invalid listener for ${Su(e)}#${t}; must be a function.`)},Kf=(i,e,t)=>{const n=e.length<3||e[0]===i||e[0]===i.eventBusEl_;let r,s,a;return n?(r=i.eventBusEl_,e.length>=3&&e.shift(),[s,a]=e):(r=e[0],s=e[1],a=e[2]),Cu(r,i,t),z1(s,i,t),G1(a,i,t),a=zt(i,a),{isTargetingSelf:n,target:r,type:s,listener:a}},Us=(i,e,t,n)=>{Cu(i,i,e),i.nodeName?eA[e](i,t,n):i[e](t,n)},iA={on(...i){const{isTargetingSelf:e,target:t,type:n,listener:r}=Kf(this,i,"on");if(Us(t,"on",n,r),!e){const s=()=>this.off(t,n,r);s.guid=r.guid;const a=()=>this.off("dispose",s);a.guid=r.guid,Us(this,"on","dispose",s),Us(t,"on","dispose",a)}},one(...i){const{isTargetingSelf:e,target:t,type:n,listener:r}=Kf(this,i,"one");if(e)Us(t,"one",n,r);else{const s=(...a)=>{this.off(t,n,s),r.apply(null,a)};s.guid=r.guid,Us(t,"one",n,s)}},any(...i){const{isTargetingSelf:e,target:t,type:n,listener:r}=Kf(this,i,"any");if(e)Us(t,"any",n,r);else{const s=(...a)=>{this.off(t,n,s),r.apply(null,a)};s.guid=r.guid,Us(t,"any",n,s)}},off(i,e,t){if(!i||Wf(i))Un(this.eventBusEl_,i,e);else{const n=i,r=e;Cu(n,this,"off"),z1(r,this,"off"),G1(t,this,"off"),t=zt(this,t),this.off("dispose",t),n.nodeName?(Un(n,r,t),Un(n,"dispose",t)):Ir(n)&&(n.off(r,t),n.off("dispose",t))}},trigger(i,e){Cu(this.eventBusEl_,this,"trigger");const t=i&&typeof i!="string"?i.type:i;if(!Wf(t))throw new Error(`Invalid event type for ${Su(this)}#trigger; must be a non-empty string or object with a type key that has a non-empty value.`);return Ha(this.eventBusEl_,i,e)}};function Xf(i,e={}){const{eventBusKey:t}=e;if(t){if(!i[t].nodeName)throw new Error(`The eventBusKey "${t}" does not refer to an element.`);i.eventBusEl_=i[t]}else i.eventBusEl_=ot("span",{className:"vjs-event-bus"});return Object.assign(i,iA),i.eventedCallbacks&&i.eventedCallbacks.forEach(n=>{n()}),i.on("dispose",()=>{i.off(),[i,i.el_,i.eventBusEl_].forEach(function(n){n&&Kn.has(n)&&Kn.delete(n)}),te.setTimeout(()=>{i.eventBusEl_=null},0)}),i}const rA={state:{},setState(i){typeof i=="function"&&(i=i());let e;return Ma(i,(t,n)=>{this.state[n]!==t&&(e=e||{},e[n]={from:this.state[n],to:t}),this.state[n]=t}),e&&Ir(this)&&this.trigger({changes:e,type:"statechanged"}),e}};function W1(i,e){return Object.assign(i,rA),i.state=Object.assign({},i.state,e),typeof i.handleStateChanged=="function"&&Ir(i)&&i.on("statechanged",i.handleStateChanged),i}const dl=function(i){return typeof i!="string"?i:i.replace(/./,e=>e.toLowerCase())},rn=function(i){return typeof i!="string"?i:i.replace(/./,e=>e.toUpperCase())},K1=function(i,e){return rn(i)===rn(e)};var sA=Object.freeze({__proto__:null,toLowerCase:dl,toTitleCase:rn,titleCaseEquals:K1});class Ce{constructor(e,t,n){if(!e&&this.play?this.player_=e=this:this.player_=e,this.isDisposed_=!1,this.parentComponent_=null,this.options_=Lt({},this.options_),t=this.options_=Lt(this.options_,t),this.id_=t.id||t.el&&t.el.id,!this.id_){const r=e&&e.id&&e.id()||"no_player";this.id_=`${r}_component_${Ei()}`}this.name_=t.name||null,t.el?this.el_=t.el:t.createEl!==!1&&(this.el_=this.createEl()),t.className&&this.el_&&t.className.split(" ").forEach(r=>this.addClass(r)),["on","off","one","any","trigger"].forEach(r=>{this[r]=void 0}),t.evented!==!1&&(Xf(this,{eventBusKey:this.el_?"el_":null}),this.handleLanguagechange=this.handleLanguagechange.bind(this),this.on(this.player_,"languagechange",this.handleLanguagechange)),W1(this,this.constructor.defaultState),this.children_=[],this.childIndex_={},this.childNameIndex_={},this.setTimeoutIds_=new Set,this.setIntervalIds_=new Set,this.rafIds_=new Set,this.namedRafs_=new Map,this.clearingTimersOnDispose_=!1,t.initChildren!==!1&&this.initChildren(),this.ready(n),t.reportTouchActivity!==!1&&this.enableTouchActivity()}dispose(e={}){if(!this.isDisposed_){if(this.readyQueue_&&(this.readyQueue_.length=0),this.trigger({type:"dispose",bubbles:!1}),this.isDisposed_=!0,this.children_)for(let t=this.children_.length-1;t>=0;t--)this.children_[t].dispose&&this.children_[t].dispose();this.children_=null,this.childIndex_=null,this.childNameIndex_=null,this.parentComponent_=null,this.el_&&(this.el_.parentNode&&(e.restoreEl?this.el_.parentNode.replaceChild(e.restoreEl,this.el_):this.el_.parentNode.removeChild(this.el_)),this.el_=null),this.player_=null}}isDisposed(){return!!this.isDisposed_}player(){return this.player_}options(e){return e?(this.options_=Lt(this.options_,e),this.options_):this.options_}el(){return this.el_}createEl(e,t,n){return ot(e,t,n)}localize(e,t,n=e){const r=this.player_.language&&this.player_.language(),s=this.player_.languages&&this.player_.languages(),a=s&&s[r],o=r&&r.split("-")[0],c=s&&s[o];let u=n;return a&&a[e]?u=a[e]:c&&c[e]&&(u=c[e]),t&&(u=u.replace(/\{(\d+)\}/g,function(d,h){const b=t[h-1];let v=b;return typeof b>"u"&&(v=d),v})),u}handleLanguagechange(){}contentEl(){return this.contentEl_||this.el_}id(){return this.id_}name(){return this.name_}children(){return this.children_}getChildById(e){return this.childIndex_[e]}getChild(e){if(e)return this.childNameIndex_[e]}getDescendant(...e){e=e.reduce((n,r)=>n.concat(r),[]);let t=this;for(let n=0;n<e.length;n++)if(t=t.getChild(e[n]),!t||!t.getChild)return;return t}setIcon(e,t=this.el()){if(!this.player_.options_.experimentalSvgIcons)return;const n="http://www.w3.org/2000/svg",r=ot("span",{className:"vjs-icon-placeholder vjs-svg-icon"},{"aria-hidden":"true"}),s=Ue.createElementNS(n,"svg");s.setAttributeNS(null,"viewBox","0 0 512 512");const a=Ue.createElementNS(n,"use");return s.appendChild(a),a.setAttributeNS(null,"href",`#vjs-icon-${e}`),r.appendChild(s),this.iconIsSet_?t.replaceChild(r,t.querySelector(".vjs-icon-placeholder")):t.appendChild(r),this.iconIsSet_=!0,r}addChild(e,t={},n=this.children_.length){let r,s;if(typeof e=="string"){s=rn(e);const a=t.componentClass||s;t.name=s;const o=Ce.getComponent(a);if(!o)throw new Error(`Component ${a} does not exist`);if(typeof o!="function")return null;r=new o(this.player_||this,t)}else r=e;if(r.parentComponent_&&r.parentComponent_.removeChild(r),this.children_.splice(n,0,r),r.parentComponent_=this,typeof r.id=="function"&&(this.childIndex_[r.id()]=r),s=s||r.name&&rn(r.name()),s&&(this.childNameIndex_[s]=r,this.childNameIndex_[dl(s)]=r),typeof r.el=="function"&&r.el()){let a=null;this.children_[n+1]&&(this.children_[n+1].el_?a=this.children_[n+1].el_:Fa(this.children_[n+1])&&(a=this.children_[n+1])),this.contentEl().insertBefore(r.el(),a)}return r}removeChild(e){if(typeof e=="string"&&(e=this.getChild(e)),!e||!this.children_)return;let t=!1;for(let r=this.children_.length-1;r>=0;r--)if(this.children_[r]===e){t=!0,this.children_.splice(r,1);break}if(!t)return;e.parentComponent_=null,this.childIndex_[e.id()]=null,this.childNameIndex_[rn(e.name())]=null,this.childNameIndex_[dl(e.name())]=null;const n=e.el();n&&n.parentNode===this.contentEl()&&this.contentEl().removeChild(e.el())}initChildren(){const e=this.options_.children;if(e){const t=this.options_,n=a=>{const o=a.name;let c=a.opts;if(t[o]!==void 0&&(c=t[o]),c===!1)return;c===!0&&(c={}),c.playerOptions=this.options_.playerOptions;const u=this.addChild(o,c);u&&(this[o]=u)};let r;const s=Ce.getComponent("Tech");Array.isArray(e)?r=e:r=Object.keys(e),r.concat(Object.keys(this.options_).filter(function(a){return!r.some(function(o){return typeof o=="string"?a===o:a===o.name})})).map(a=>{let o,c;return typeof a=="string"?(o=a,c=e[o]||this.options_[o]||{}):(o=a.name,c=a),{name:o,opts:c}}).filter(a=>{const o=Ce.getComponent(a.opts.componentClass||rn(a.name));return o&&!s.isTech(o)}).forEach(n)}}buildCSSClass(){return""}ready(e,t=!1){if(e){if(!this.isReady_){this.readyQueue_=this.readyQueue_||[],this.readyQueue_.push(e);return}t?e.call(this):this.setTimeout(e,1)}}triggerReady(){this.isReady_=!0,this.setTimeout(function(){const e=this.readyQueue_;this.readyQueue_=[],e&&e.length>0&&e.forEach(function(t){t.call(this)},this),this.trigger("ready")},1)}$(e,t){return ls(e,t||this.contentEl())}$$(e,t){return B1(e,t||this.contentEl())}hasClass(e){return ol(this.el_,e)}addClass(...e){Bs(this.el_,...e)}removeClass(...e){gu(this.el_,...e)}toggleClass(e,t){A1(this.el_,e,t)}show(){this.removeClass("vjs-hidden")}hide(){this.addClass("vjs-hidden")}lockShowing(){this.addClass("vjs-lock-showing")}unlockShowing(){this.removeClass("vjs-lock-showing")}getAttribute(e){return P1(this.el_,e)}setAttribute(e,t){Va(this.el_,e,t)}removeAttribute(e){vu(this.el_,e)}width(e,t){return this.dimension("width",e,t)}height(e,t){return this.dimension("height",e,t)}dimensions(e,t){this.width(e,!0),this.height(t)}dimension(e,t,n){if(t!==void 0){(t===null||t!==t)&&(t=0),(""+t).indexOf("%")!==-1||(""+t).indexOf("px")!==-1?this.el_.style[e]=t:t==="auto"?this.el_.style[e]="":this.el_.style[e]=t+"px",n||this.trigger("componentresize");return}if(!this.el_)return 0;const r=this.el_.style[e],s=r.indexOf("px");return parseInt(s!==-1?r.slice(0,s):this.el_["offset"+rn(e)],10)}currentDimension(e){let t=0;if(e!=="width"&&e!=="height")throw new Error("currentDimension only accepts width or height value");if(t=$a(this.el_,e),t=parseFloat(t),t===0||isNaN(t)){const n=`offset${rn(e)}`;t=this.el_[n]}return t}currentDimensions(){return{width:this.currentDimension("width"),height:this.currentDimension("height")}}currentWidth(){return this.currentDimension("width")}currentHeight(){return this.currentDimension("height")}getPositions(){const e=this.el_.getBoundingClientRect(),t={x:e.x,y:e.y,width:e.width,height:e.height,top:e.top,right:e.right,bottom:e.bottom,left:e.left},n={x:e.left+e.width/2,y:e.top+e.height/2,width:0,height:0,top:e.top+e.height/2,right:e.left+e.width/2,bottom:e.top+e.height/2,left:e.left+e.width/2};return{boundingClientRect:t,center:n}}focus(){this.el_.focus()}blur(){this.el_.blur()}handleKeyDown(e){this.player_&&(e.key!=="Tab"&&!(this.player_.options_.playerOptions.spatialNavigation&&this.player_.options_.playerOptions.spatialNavigation.enabled)&&e.stopPropagation(),this.player_.handleKeyDown(e))}handleKeyPress(e){this.handleKeyDown(e)}emitTapEvents(){let e=0,t=null;const n=10,r=200;let s;this.on("touchstart",function(o){o.touches.length===1&&(t={pageX:o.touches[0].pageX,pageY:o.touches[0].pageY},e=te.performance.now(),s=!0)}),this.on("touchmove",function(o){if(o.touches.length>1)s=!1;else if(t){const c=o.touches[0].pageX-t.pageX,u=o.touches[0].pageY-t.pageY;Math.sqrt(c*c+u*u)>n&&(s=!1)}});const a=function(){s=!1};this.on("touchleave",a),this.on("touchcancel",a),this.on("touchend",function(o){t=null,s===!0&&te.performance.now()-e<r&&(o.preventDefault(),this.trigger("tap"))})}enableTouchActivity(){if(!this.player()||!this.player().reportUserActivity)return;const e=zt(this.player(),this.player().reportUserActivity);let t;this.on("touchstart",function(){e(),this.clearInterval(t),t=this.setInterval(e,250)});const n=function(r){e(),this.clearInterval(t)};this.on("touchmove",e),this.on("touchend",n),this.on("touchcancel",n)}setTimeout(e,t){var n;return e=zt(this,e),this.clearTimersOnDispose_(),n=te.setTimeout(()=>{this.setTimeoutIds_.has(n)&&this.setTimeoutIds_.delete(n),e()},t),this.setTimeoutIds_.add(n),n}clearTimeout(e){return this.setTimeoutIds_.has(e)&&(this.setTimeoutIds_.delete(e),te.clearTimeout(e)),e}setInterval(e,t){e=zt(this,e),this.clearTimersOnDispose_();const n=te.setInterval(e,t);return this.setIntervalIds_.add(n),n}clearInterval(e){return this.setIntervalIds_.has(e)&&(this.setIntervalIds_.delete(e),te.clearInterval(e)),e}requestAnimationFrame(e){this.clearTimersOnDispose_();var t;return e=zt(this,e),t=te.requestAnimationFrame(()=>{this.rafIds_.has(t)&&this.rafIds_.delete(t),e()}),this.rafIds_.add(t),t}requestNamedAnimationFrame(e,t){this.namedRafs_.has(e)&&this.cancelNamedAnimationFrame(e),this.clearTimersOnDispose_(),t=zt(this,t);const n=this.requestAnimationFrame(()=>{t(),this.namedRafs_.has(e)&&this.namedRafs_.delete(e)});return this.namedRafs_.set(e,n),e}cancelNamedAnimationFrame(e){this.namedRafs_.has(e)&&(this.cancelAnimationFrame(this.namedRafs_.get(e)),this.namedRafs_.delete(e))}cancelAnimationFrame(e){return this.rafIds_.has(e)&&(this.rafIds_.delete(e),te.cancelAnimationFrame(e)),e}clearTimersOnDispose_(){this.clearingTimersOnDispose_||(this.clearingTimersOnDispose_=!0,this.one("dispose",()=>{[["namedRafs_","cancelNamedAnimationFrame"],["rafIds_","cancelAnimationFrame"],["setTimeoutIds_","clearTimeout"],["setIntervalIds_","clearInterval"]].forEach(([e,t])=>{this[e].forEach((n,r)=>this[t](r))}),this.clearingTimersOnDispose_=!1}))}getIsDisabled(){return!!this.el_.disabled}getIsExpresslyInert(){return this.el_.inert&&!this.el_.ownerDocument.documentElement.inert}getIsFocusable(e){return(e||this.el_).tabIndex>=0&&!(this.getIsDisabled()||this.getIsExpresslyInert())}getIsAvailableToBeFocused(e){function t(s){const a=te.getComputedStyle(s,null),o=a.getPropertyValue("visibility");return a.getPropertyValue("display")!=="none"&&!["hidden","collapse"].includes(o)}function n(s){return!(!t(s.parentElement)||!t(s)||s.style.opacity==="0"||te.getComputedStyle(s).height==="0px"||te.getComputedStyle(s).width==="0px")}function r(s){if(s.offsetWidth+s.offsetHeight+s.getBoundingClientRect().height+s.getBoundingClientRect().width===0)return!1;const a={x:s.getBoundingClientRect().left+s.offsetWidth/2,y:s.getBoundingClientRect().top+s.offsetHeight/2};if(a.x<0||a.x>(Ue.documentElement.clientWidth||te.innerWidth)||a.y<0||a.y>(Ue.documentElement.clientHeight||te.innerHeight))return!1;let o=Ue.elementFromPoint(a.x,a.y);for(;o;){if(o===s)return!0;if(o.parentNode)o=o.parentNode;else return!1}}return e||(e=this.el()),!!(r(e)&&n(e)&&(!e.parentElement||e.tabIndex>=0))}static registerComponent(e,t){if(typeof e!="string"||!e)throw new Error(`Illegal component name, "${e}"; must be a non-empty string.`);const n=Ce.getComponent("Tech"),r=n&&n.isTech(t),s=Ce===t||Ce.prototype.isPrototypeOf(t.prototype);if(r||!s){let o;throw r?o="techs must be registered using Tech.registerTech()":o="must be a Component subclass",new Error(`Illegal component, "${e}"; ${o}.`)}e=rn(e),Ce.components_||(Ce.components_={});const a=Ce.getComponent("Player");if(e==="Player"&&a&&a.players){const o=a.players,c=Object.keys(o);if(o&&c.length>0){for(let u=0;u<c.length;u++)if(o[c[u]]!==null)throw new Error("Can not register Player component after player has been created.")}}return Ce.components_[e]=t,Ce.components_[dl(e)]=t,t}static getComponent(e){if(!(!e||!Ce.components_))return Ce.components_[e]}}Ce.registerComponent("Component",Ce);function aA(i,e,t){if(typeof e!="number"||e<0||e>t)throw new Error(`Failed to execute '${i}' on 'TimeRanges': The index provided (${e}) is non-numeric or out of bounds (0-${t}).`)}function X1(i,e,t,n){return aA(i,n,t.length-1),t[n][e]}function Yf(i){let e;return i===void 0||i.length===0?e={length:0,start(){throw new Error("This TimeRanges object is empty")},end(){throw new Error("This TimeRanges object is empty")}}:e={length:i.length,start:X1.bind(null,"start",0,i),end:X1.bind(null,"end",1,i)},te.Symbol&&te.Symbol.iterator&&(e[te.Symbol.iterator]=()=>(i||[]).values()),e}function zi(i,e){return Array.isArray(i)?Yf(i):i===void 0||e===void 0?Yf():Yf([[i,e]])}const Y1=function(i,e){i=i<0?0:i;let t=Math.floor(i%60),n=Math.floor(i/60%60),r=Math.floor(i/3600);const s=Math.floor(e/60%60),a=Math.floor(e/3600);return(isNaN(i)||i===1/0)&&(r=n=t="-"),r=r>0||a>0?r+":":"",n=((r||s>=10)&&n<10?"0"+n:n)+":",t=t<10?"0"+t:t,r+n+t};let Jf=Y1;function J1(i){Jf=i}function Q1(){Jf=Y1}function Fs(i,e=i){return Jf(i,e)}var oA=Object.freeze({__proto__:null,createTimeRanges:zi,createTimeRange:zi,setFormatTime:J1,resetFormatTime:Q1,formatTime:Fs});function Z1(i,e){let t=0,n,r;if(!e)return 0;(!i||!i.length)&&(i=zi(0,0));for(let s=0;s<i.length;s++)n=i.start(s),r=i.end(s),r>e&&(r=e),t+=r-n;return t/e}function Qt(i){if(i instanceof Qt)return i;typeof i=="number"?this.code=i:typeof i=="string"?this.message=i:sr(i)&&(typeof i.code=="number"&&(this.code=i.code),Object.assign(this,i)),this.message||(this.message=Qt.defaultMessages[this.code]||"")}Qt.prototype.code=0,Qt.prototype.message="",Qt.prototype.status=null,Qt.prototype.metadata=null,Qt.errorTypes=["MEDIA_ERR_CUSTOM","MEDIA_ERR_ABORTED","MEDIA_ERR_NETWORK","MEDIA_ERR_DECODE","MEDIA_ERR_SRC_NOT_SUPPORTED","MEDIA_ERR_ENCRYPTED"],Qt.defaultMessages={1:"You aborted the media playback",2:"A network error caused the media download to fail part-way.",3:"The media playback was aborted due to a corruption problem or because the media used features your browser did not support.",4:"The media could not be loaded, either because the server or network failed or because the format is not supported.",5:"The media is encrypted and we do not have the keys to decrypt it."},Qt.MEDIA_ERR_CUSTOM=0,Qt.prototype.MEDIA_ERR_CUSTOM=0,Qt.MEDIA_ERR_ABORTED=1,Qt.prototype.MEDIA_ERR_ABORTED=1,Qt.MEDIA_ERR_NETWORK=2,Qt.prototype.MEDIA_ERR_NETWORK=2,Qt.MEDIA_ERR_DECODE=3,Qt.prototype.MEDIA_ERR_DECODE=3,Qt.MEDIA_ERR_SRC_NOT_SUPPORTED=4,Qt.prototype.MEDIA_ERR_SRC_NOT_SUPPORTED=4,Qt.MEDIA_ERR_ENCRYPTED=5,Qt.prototype.MEDIA_ERR_ENCRYPTED=5;function hl(i){return i!=null&&typeof i.then=="function"}function lr(i){hl(i)&&i.then(null,e=>{})}const Qf=function(i){return["kind","label","language","id","inBandMetadataTrackDispatchType","mode","src"].reduce((t,n,r)=>(i[n]&&(t[n]=i[n]),t),{cues:i.cues&&Array.prototype.map.call(i.cues,function(t){return{startTime:t.startTime,endTime:t.endTime,text:t.text,id:t.id}})})};var Zf={textTracksToJson:function(i){const e=i.$$("track"),t=Array.prototype.map.call(e,r=>r.track);return Array.prototype.map.call(e,function(r){const s=Qf(r.track);return r.src&&(s.src=r.src),s}).concat(Array.prototype.filter.call(i.textTracks(),function(r){return t.indexOf(r)===-1}).map(Qf))},jsonToTextTracks:function(i,e){return i.forEach(function(t){const n=e.addRemoteTextTrack(t).track;!t.src&&t.cues&&t.cues.forEach(r=>n.addCue(r))}),e.textTracks()},trackToJson:Qf};const ep="vjs-modal-dialog";class qa extends Ce{constructor(e,t){super(e,t),this.handleKeyDown_=n=>this.handleKeyDown(n),this.close_=n=>this.close(n),this.opened_=this.hasBeenOpened_=this.hasBeenFilled_=!1,this.closeable(!this.options_.uncloseable),this.content(this.options_.content),this.contentEl_=ot("div",{className:`${ep}-content`},{role:"document"}),this.descEl_=ot("p",{className:`${ep}-description vjs-control-text`,id:this.el().getAttribute("aria-describedby")}),as(this.descEl_,this.description()),this.el_.appendChild(this.descEl_),this.el_.appendChild(this.contentEl_)}createEl(){return super.createEl("div",{className:this.buildCSSClass(),tabIndex:-1},{"aria-describedby":`${this.id()}_description`,"aria-hidden":"true","aria-label":this.label(),role:"dialog","aria-live":"polite"})}dispose(){this.contentEl_=null,this.descEl_=null,this.previouslyActiveEl_=null,super.dispose()}buildCSSClass(){return`${ep} vjs-hidden ${super.buildCSSClass()}`}label(){return this.localize(this.options_.label||"Modal Window")}description(){let e=this.options_.description||this.localize("This is a modal window.");return this.closeable()&&(e+=" "+this.localize("This modal can be closed by pressing the Escape key or activating the close button.")),e}open(){if(this.opened_){this.options_.fillAlways&&this.fill();return}const e=this.player();this.trigger("beforemodalopen"),this.opened_=!0,(this.options_.fillAlways||!this.hasBeenOpened_&&!this.hasBeenFilled_)&&this.fill(),this.wasPlaying_=!e.paused(),this.options_.pauseOnOpen&&this.wasPlaying_&&e.pause(),this.on("keydown",this.handleKeyDown_),this.hadControls_=e.controls(),e.controls(!1),this.show(),this.conditionalFocus_(),this.el().setAttribute("aria-hidden","false"),this.trigger("modalopen"),this.hasBeenOpened_=!0}opened(e){return typeof e=="boolean"&&this[e?"open":"close"](),this.opened_}close(){if(!this.opened_)return;const e=this.player();this.trigger("beforemodalclose"),this.opened_=!1,this.wasPlaying_&&this.options_.pauseOnOpen&&e.play(),this.off("keydown",this.handleKeyDown_),this.hadControls_&&e.controls(!0),this.hide(),this.el().setAttribute("aria-hidden","true"),this.trigger({type:"modalclose",bubbles:!0}),this.conditionalBlur_(),this.options_.temporary&&this.dispose()}closeable(e){if(typeof e=="boolean"){const t=this.closeable_=!!e;let n=this.getChild("closeButton");if(t&&!n){const r=this.contentEl_;this.contentEl_=this.el_,n=this.addChild("closeButton",{controlText:"Close Modal Dialog"}),this.contentEl_=r,this.on(n,"close",this.close_)}!t&&n&&(this.off(n,"close",this.close_),this.removeChild(n),n.dispose())}return this.closeable_}fill(){this.fillWith(this.content())}fillWith(e){const t=this.contentEl(),n=t.parentNode,r=t.nextSibling;this.trigger("beforemodalfill"),this.hasBeenFilled_=!0,n.removeChild(t),this.empty(),L1(t,e),this.trigger("modalfill"),r?n.insertBefore(t,r):n.appendChild(t);const s=this.getChild("closeButton");s&&n.appendChild(s.el_),this.trigger("aftermodalfill")}empty(){this.trigger("beforemodalempty"),bu(this.contentEl()),this.trigger("modalempty")}content(e){return typeof e<"u"&&(this.content_=e),this.content_}conditionalFocus_(){const e=Ue.activeElement,t=this.player_.el_;this.previouslyActiveEl_=null,(t.contains(e)||t===e)&&(this.previouslyActiveEl_=e,this.focus())}conditionalBlur_(){this.previouslyActiveEl_&&(this.previouslyActiveEl_.focus(),this.previouslyActiveEl_=null)}handleKeyDown(e){if(this.trigger({type:"modalKeydown",originalEvent:e,target:this,bubbles:!0}),e.stopPropagation(),e.key==="Escape"&&this.closeable()){e.preventDefault(),this.close();return}if(e.key!=="Tab")return;const t=this.focusableEls_(),n=this.el_.querySelector(":focus");let r;for(let s=0;s<t.length;s++)if(n===t[s]){r=s;break}Ue.activeElement===this.el_&&(r=0),e.shiftKey&&r===0?(t[t.length-1].focus(),e.preventDefault()):!e.shiftKey&&r===t.length-1&&(t[0].focus(),e.preventDefault())}focusableEls_(){const e=this.el_.querySelectorAll("*");return Array.prototype.filter.call(e,t=>(t instanceof te.HTMLAnchorElement||t instanceof te.HTMLAreaElement)&&t.hasAttribute("href")||(t instanceof te.HTMLInputElement||t instanceof te.HTMLSelectElement||t instanceof te.HTMLTextAreaElement||t instanceof te.HTMLButtonElement)&&!t.hasAttribute("disabled")||t instanceof te.HTMLIFrameElement||t instanceof te.HTMLObjectElement||t instanceof te.HTMLEmbedElement||t.hasAttribute("tabindex")&&t.getAttribute("tabindex")!==-1||t.hasAttribute("contenteditable"))}}qa.prototype.options_={pauseOnOpen:!0,temporary:!0},Ce.registerComponent("ModalDialog",qa);class Vs extends pi{constructor(e=[]){super(),this.tracks_=[],Object.defineProperty(this,"length",{get(){return this.tracks_.length}});for(let t=0;t<e.length;t++)this.addTrack(e[t])}addTrack(e){const t=this.tracks_.length;""+t in this||Object.defineProperty(this,t,{get(){return this.tracks_[t]}}),this.tracks_.indexOf(e)===-1&&(this.tracks_.push(e),this.trigger({track:e,type:"addtrack",target:this})),e.labelchange_=()=>{this.trigger({track:e,type:"labelchange",target:this})},Ir(e)&&e.addEventListener("labelchange",e.labelchange_)}removeTrack(e){let t;for(let n=0,r=this.length;n<r;n++)if(this[n]===e){t=this[n],t.off&&t.off(),this.tracks_.splice(n,1);break}t&&this.trigger({track:t,type:"removetrack",target:this})}getTrackById(e){let t=null;for(let n=0,r=this.length;n<r;n++){const s=this[n];if(s.id===e){t=s;break}}return t}}Vs.prototype.allowedEvents_={change:"change",addtrack:"addtrack",removetrack:"removetrack",labelchange:"labelchange"};for(const i in Vs.prototype.allowedEvents_)Vs.prototype["on"+i]=null;const tp=function(i,e){for(let t=0;t<i.length;t++)!Object.keys(i[t]).length||e.id===i[t].id||(i[t].enabled=!1)};class eb extends Vs{constructor(e=[]){for(let t=e.length-1;t>=0;t--)if(e[t].enabled){tp(e,e[t]);break}super(e),this.changing_=!1}addTrack(e){e.enabled&&tp(this,e),super.addTrack(e),e.addEventListener&&(e.enabledChange_=()=>{this.changing_||(this.changing_=!0,tp(this,e),this.changing_=!1,this.trigger("change"))},e.addEventListener("enabledchange",e.enabledChange_))}removeTrack(e){super.removeTrack(e),e.removeEventListener&&e.enabledChange_&&(e.removeEventListener("enabledchange",e.enabledChange_),e.enabledChange_=null)}}const np=function(i,e){for(let t=0;t<i.length;t++)!Object.keys(i[t]).length||e.id===i[t].id||(i[t].selected=!1)};class tb extends Vs{constructor(e=[]){for(let t=e.length-1;t>=0;t--)if(e[t].selected){np(e,e[t]);break}super(e),this.changing_=!1,Object.defineProperty(this,"selectedIndex",{get(){for(let t=0;t<this.length;t++)if(this[t].selected)return t;return-1},set(){}})}addTrack(e){e.selected&&np(this,e),super.addTrack(e),e.addEventListener&&(e.selectedChange_=()=>{this.changing_||(this.changing_=!0,np(this,e),this.changing_=!1,this.trigger("change"))},e.addEventListener("selectedchange",e.selectedChange_))}removeTrack(e){super.removeTrack(e),e.removeEventListener&&e.selectedChange_&&(e.removeEventListener("selectedchange",e.selectedChange_),e.selectedChange_=null)}}class ip extends Vs{addTrack(e){super.addTrack(e),this.queueChange_||(this.queueChange_=()=>this.queueTrigger("change")),this.triggerSelectedlanguagechange||(this.triggerSelectedlanguagechange_=()=>this.trigger("selectedlanguagechange")),e.addEventListener("modechange",this.queueChange_),["metadata","chapters"].indexOf(e.kind)===-1&&e.addEventListener("modechange",this.triggerSelectedlanguagechange_)}removeTrack(e){super.removeTrack(e),e.removeEventListener&&(this.queueChange_&&e.removeEventListener("modechange",this.queueChange_),this.selectedlanguagechange_&&e.removeEventListener("modechange",this.triggerSelectedlanguagechange_))}toJSON(){return this.tracks_.map(e=>e.toJSON())}}class lA{constructor(e=[]){this.trackElements_=[],Object.defineProperty(this,"length",{get(){return this.trackElements_.length}});for(let t=0,n=e.length;t<n;t++)this.addTrackElement_(e[t])}addTrackElement_(e){const t=this.trackElements_.length;""+t in this||Object.defineProperty(this,t,{get(){return this.trackElements_[t]}}),this.trackElements_.indexOf(e)===-1&&this.trackElements_.push(e)}getTrackElementByTrack_(e){let t;for(let n=0,r=this.trackElements_.length;n<r;n++)if(e===this.trackElements_[n].track){t=this.trackElements_[n];break}return t}removeTrackElement_(e){for(let t=0,n=this.trackElements_.length;t<n;t++)if(e===this.trackElements_[t]){this.trackElements_[t].track&&typeof this.trackElements_[t].track.off=="function"&&this.trackElements_[t].track.off(),typeof this.trackElements_[t].off=="function"&&this.trackElements_[t].off(),this.trackElements_.splice(t,1);break}}}class xu{constructor(e){xu.prototype.setCues_.call(this,e),Object.defineProperty(this,"length",{get(){return this.length_}})}setCues_(e){const t=this.length||0;let n=0;const r=e.length;this.cues_=e,this.length_=e.length;const s=function(a){""+a in this||Object.defineProperty(this,""+a,{get(){return this.cues_[a]}})};if(t<r)for(n=t;n<r;n++)s.call(this,n)}getCueById(e){let t=null;for(let n=0,r=this.length;n<r;n++){const s=this[n];if(s.id===e){t=s;break}}return t}}const cA={alternative:"alternative",captions:"captions",main:"main",sign:"sign",subtitles:"subtitles",commentary:"commentary"},uA={alternative:"alternative",descriptions:"descriptions",main:"main","main-desc":"main-desc",translation:"translation",commentary:"commentary"},dA={subtitles:"subtitles",captions:"captions",descriptions:"descriptions",chapters:"chapters",metadata:"metadata"},nb={disabled:"disabled",hidden:"hidden",showing:"showing"};class rp extends pi{constructor(e={}){super();const t={id:e.id||"vjs_track_"+Ei(),kind:e.kind||"",language:e.language||""};let n=e.label||"";for(const r in t)Object.defineProperty(this,r,{get(){return t[r]},set(){}});Object.defineProperty(this,"label",{get(){return n},set(r){r!==n&&(n=r,this.trigger("labelchange"))}})}}const sp=function(i){return new URL(i,Ue.baseURI)},ib=function(i){return new URL(i,Ue.baseURI).href},ap=function(i){if(typeof i=="string"){const t=i.split("?")[0].replace(/\/+$/,"").match(/\.([^.\/]+)$/);return t?t[1].toLowerCase():""}return""},Eu=function(i,e=te.location){return sp(i).origin!==e.origin};var hA=Object.freeze({__proto__:null,parseUrl:sp,getAbsoluteURL:ib,getFileExtension:ap,isCrossOrigin:Eu});const rb=function(i,e){const t=new te.WebVTT.Parser(te,te.vttjs,te.WebVTT.StringDecoder()),n=[];t.oncue=function(r){e.addCue(r)},t.onparsingerror=function(r){n.push(r)},t.onflush=function(){e.trigger({type:"loadeddata",target:e})},t.parse(i),n.length>0&&(te.console&&te.console.groupCollapsed&&te.console.groupCollapsed(`Text Track parsing errors for ${e.src}`),n.forEach(r=>bt.error(r)),te.console&&te.console.groupEnd&&te.console.groupEnd()),t.flush()},sb=function(i,e){const t={uri:i},n=Eu(i);n&&(t.cors=n);const r=e.tech_.crossOrigin()==="use-credentials";r&&(t.withCredentials=r),Ey(t,zt(this,function(s,a,o){if(s)return bt.error(s,a);e.loaded_=!0,typeof te.WebVTT!="function"?e.tech_&&e.tech_.any(["vttjsloaded","vttjserror"],c=>{if(c.type==="vttjserror"){bt.error(`vttjs failed to load, stopping trying to process ${e.src}`);return}return rb(o,e)}):rb(o,e)}))};class fl extends rp{constructor(e={}){if(!e.tech)throw new Error("A tech was not provided.");const t=Lt(e,{kind:dA[e.kind]||"subtitles",language:e.language||e.srclang||""});let n=nb[t.mode]||"disabled";const r=t.default;(t.kind==="metadata"||t.kind==="chapters")&&(n="hidden"),super(t),this.tech_=t.tech,this.cues_=[],this.activeCues_=[],this.preload_=this.tech_.preloadTextTracks!==!1;const s=new xu(this.cues_),a=new xu(this.activeCues_);let o=!1;this.timeupdateHandler=zt(this,function(u={}){if(!this.tech_.isDisposed()){if(!this.tech_.isReady_){u.type!=="timeupdate"&&(this.rvf_=this.tech_.requestVideoFrameCallback(this.timeupdateHandler));return}this.activeCues=this.activeCues,o&&(this.trigger("cuechange"),o=!1),u.type!=="timeupdate"&&(this.rvf_=this.tech_.requestVideoFrameCallback(this.timeupdateHandler))}});const c=()=>{this.stopTracking()};this.tech_.one("dispose",c),n!=="disabled"&&this.startTracking(),Object.defineProperties(this,{default:{get(){return r},set(){}},mode:{get(){return n},set(u){nb[u]&&n!==u&&(n=u,!this.preload_&&n!=="disabled"&&this.cues.length===0&&sb(this.src,this),this.stopTracking(),n!=="disabled"&&this.startTracking(),this.trigger("modechange"))}},cues:{get(){return this.loaded_?s:null},set(){}},activeCues:{get(){if(!this.loaded_)return null;if(this.cues.length===0)return a;const u=this.tech_.currentTime(),d=[];for(let h=0,b=this.cues.length;h<b;h++){const v=this.cues[h];v.startTime<=u&&v.endTime>=u&&d.push(v)}if(o=!1,d.length!==this.activeCues_.length)o=!0;else for(let h=0;h<d.length;h++)this.activeCues_.indexOf(d[h])===-1&&(o=!0);return this.activeCues_=d,a.setCues_(this.activeCues_),a},set(){}}}),t.src?(this.src=t.src,this.preload_||(this.loaded_=!0),(this.preload_||t.kind!=="subtitles"&&t.kind!=="captions")&&sb(this.src,this)):this.loaded_=!0}startTracking(){this.rvf_=this.tech_.requestVideoFrameCallback(this.timeupdateHandler),this.tech_.on("timeupdate",this.timeupdateHandler)}stopTracking(){this.rvf_&&(this.tech_.cancelVideoFrameCallback(this.rvf_),this.rvf_=void 0),this.tech_.off("timeupdate",this.timeupdateHandler)}addCue(e){let t=e;if(!("getCueAsHTML"in t)){t=new te.vttjs.VTTCue(e.startTime,e.endTime,e.text);for(const r in e)r in t||(t[r]=e[r]);t.id=e.id,t.originalCue_=e}const n=this.tech_.textTracks();for(let r=0;r<n.length;r++)n[r]!==this&&n[r].removeCue(t);this.cues_.push(t),this.cues.setCues_(this.cues_)}toJSON(){return Zf.trackToJson(this)}removeCue(e){let t=this.cues_.length;for(;t--;){const n=this.cues_[t];if(n===e||n.originalCue_&&n.originalCue_===e){this.cues_.splice(t,1),this.cues.setCues_(this.cues_);break}}}}fl.prototype.allowedEvents_={cuechange:"cuechange"};class ab extends rp{constructor(e={}){const t=Lt(e,{kind:uA[e.kind]||""});super(t);let n=!1;Object.defineProperty(this,"enabled",{get(){return n},set(r){typeof r!="boolean"||r===n||(n=r,this.trigger("enabledchange"))}}),t.enabled&&(this.enabled=t.enabled),this.loaded_=!0}}class ob extends rp{constructor(e={}){const t=Lt(e,{kind:cA[e.kind]||""});super(t);let n=!1;Object.defineProperty(this,"selected",{get(){return n},set(r){typeof r!="boolean"||r===n||(n=r,this.trigger("selectedchange"))}}),t.selected&&(this.selected=t.selected)}}class Pr extends pi{constructor(e={}){super();let t;const n=new fl(e);this.kind=n.kind,this.src=n.src,this.srclang=n.language,this.label=n.label,this.default=n.default,Object.defineProperties(this,{readyState:{get(){return t}},track:{get(){return n}}}),t=Pr.NONE,n.addEventListener("loadeddata",()=>{t=Pr.LOADED,this.trigger({type:"load",target:this})})}}Pr.prototype.allowedEvents_={load:"load"},Pr.NONE=0,Pr.LOADING=1,Pr.LOADED=2,Pr.ERROR=3;const Di={audio:{ListClass:eb,TrackClass:ab,capitalName:"Audio"},video:{ListClass:tb,TrackClass:ob,capitalName:"Video"},text:{ListClass:ip,TrackClass:fl,capitalName:"Text"}};Object.keys(Di).forEach(function(i){Di[i].getterName=`${i}Tracks`,Di[i].privateName=`${i}Tracks_`});const za={remoteText:{ListClass:ip,TrackClass:fl,capitalName:"RemoteText",getterName:"remoteTextTracks",privateName:"remoteTextTracks_"},remoteTextEl:{ListClass:lA,TrackClass:Pr,capitalName:"RemoteTextTrackEls",getterName:"remoteTextTrackEls",privateName:"remoteTextTrackEls_"}},Xn=Object.assign({},Di,za);za.names=Object.keys(za),Di.names=Object.keys(Di),Xn.names=[].concat(za.names).concat(Di.names);function fA(i,e,t,n,r={}){const s=i.textTracks();r.kind=e,t&&(r.label=t),n&&(r.language=n),r.tech=i;const a=new Xn.text.TrackClass(r);return s.addTrack(a),a}class gt extends Ce{constructor(e={},t=function(){}){e.reportTouchActivity=!1,super(null,e,t),this.onDurationChange_=n=>this.onDurationChange(n),this.trackProgress_=n=>this.trackProgress(n),this.trackCurrentTime_=n=>this.trackCurrentTime(n),this.stopTrackingCurrentTime_=n=>this.stopTrackingCurrentTime(n),this.disposeSourceHandler_=n=>this.disposeSourceHandler(n),this.queuedHanders_=new Set,this.hasStarted_=!1,this.on("playing",function(){this.hasStarted_=!0}),this.on("loadstart",function(){this.hasStarted_=!1}),Xn.names.forEach(n=>{const r=Xn[n];e&&e[r.getterName]&&(this[r.privateName]=e[r.getterName])}),this.featuresProgressEvents||this.manualProgressOn(),this.featuresTimeupdateEvents||this.manualTimeUpdatesOn(),["Text","Audio","Video"].forEach(n=>{e[`native${n}Tracks`]===!1&&(this[`featuresNative${n}Tracks`]=!1)}),e.nativeCaptions===!1||e.nativeTextTracks===!1?this.featuresNativeTextTracks=!1:(e.nativeCaptions===!0||e.nativeTextTracks===!0)&&(this.featuresNativeTextTracks=!0),this.featuresNativeTextTracks||this.emulateTextTracks(),this.preloadTextTracks=e.preloadTextTracks!==!1,this.autoRemoteTextTracks_=new Xn.text.ListClass,this.initTrackListeners(),e.nativeControlsForTouch||this.emitTapEvents(),this.constructor&&(this.name_=this.constructor.name||"Unknown Tech")}triggerSourceset(e){this.isReady_||this.one("ready",()=>this.setTimeout(()=>this.triggerSourceset(e),1)),this.trigger({src:e,type:"sourceset"})}manualProgressOn(){this.on("durationchange",this.onDurationChange_),this.manualProgress=!0,this.one("ready",this.trackProgress_)}manualProgressOff(){this.manualProgress=!1,this.stopTrackingProgress(),this.off("durationchange",this.onDurationChange_)}trackProgress(e){this.stopTrackingProgress(),this.progressInterval=this.setInterval(zt(this,function(){const t=this.bufferedPercent();this.bufferedPercent_!==t&&this.trigger("progress"),this.bufferedPercent_=t,t===1&&this.stopTrackingProgress()}),500)}onDurationChange(e){this.duration_=this.duration()}buffered(){return zi(0,0)}bufferedPercent(){return Z1(this.buffered(),this.duration_)}stopTrackingProgress(){this.clearInterval(this.progressInterval)}manualTimeUpdatesOn(){this.manualTimeUpdates=!0,this.on("play",this.trackCurrentTime_),this.on("pause",this.stopTrackingCurrentTime_)}manualTimeUpdatesOff(){this.manualTimeUpdates=!1,this.stopTrackingCurrentTime(),this.off("play",this.trackCurrentTime_),this.off("pause",this.stopTrackingCurrentTime_)}trackCurrentTime(){this.currentTimeInterval&&this.stopTrackingCurrentTime(),this.currentTimeInterval=this.setInterval(function(){this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})},250)}stopTrackingCurrentTime(){this.clearInterval(this.currentTimeInterval),this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})}dispose(){this.clearTracks(Di.names),this.manualProgress&&this.manualProgressOff(),this.manualTimeUpdates&&this.manualTimeUpdatesOff(),super.dispose()}clearTracks(e){e=[].concat(e),e.forEach(t=>{const n=this[`${t}Tracks`]()||[];let r=n.length;for(;r--;){const s=n[r];t==="text"&&this.removeRemoteTextTrack(s),n.removeTrack(s)}})}cleanupAutoTextTracks(){const e=this.autoRemoteTextTracks_||[];let t=e.length;for(;t--;){const n=e[t];this.removeRemoteTextTrack(n)}}reset(){}crossOrigin(){}setCrossOrigin(){}error(e){return e!==void 0&&(this.error_=new Qt(e),this.trigger("error")),this.error_}played(){return this.hasStarted_?zi(0,0):zi()}play(){}setScrubbing(e){}scrubbing(){}setCurrentTime(e){this.manualTimeUpdates&&this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})}initTrackListeners(){Di.names.forEach(e=>{const t=Di[e],n=()=>{this.trigger(`${e}trackchange`)},r=this[t.getterName]();r.addEventListener("removetrack",n),r.addEventListener("addtrack",n),this.on("dispose",()=>{r.removeEventListener("removetrack",n),r.removeEventListener("addtrack",n)})})}addWebVttScript_(){if(!te.WebVTT)if(Ue.body.contains(this.el())){if(!this.options_["vtt.js"]&&Ra(Py)&&Object.keys(Py).length>0){this.trigger("vttjsloaded");return}const e=Ue.createElement("script");e.src=this.options_["vtt.js"]||"https://vjs.zencdn.net/vttjs/0.14.1/vtt.min.js",e.onload=()=>{this.trigger("vttjsloaded")},e.onerror=()=>{this.trigger("vttjserror")},this.on("dispose",()=>{e.onload=null,e.onerror=null}),te.WebVTT=!0,this.el().parentNode.appendChild(e)}else this.ready(this.addWebVttScript_)}emulateTextTracks(){const e=this.textTracks(),t=this.remoteTextTracks(),n=o=>e.addTrack(o.track),r=o=>e.removeTrack(o.track);t.on("addtrack",n),t.on("removetrack",r),this.addWebVttScript_();const s=()=>this.trigger("texttrackchange"),a=()=>{s();for(let o=0;o<e.length;o++){const c=e[o];c.removeEventListener("cuechange",s),c.mode==="showing"&&c.addEventListener("cuechange",s)}};a(),e.addEventListener("change",a),e.addEventListener("addtrack",a),e.addEventListener("removetrack",a),this.on("dispose",function(){t.off("addtrack",n),t.off("removetrack",r),e.removeEventListener("change",a),e.removeEventListener("addtrack",a),e.removeEventListener("removetrack",a);for(let o=0;o<e.length;o++)e[o].removeEventListener("cuechange",s)})}addTextTrack(e,t,n){if(!e)throw new Error("TextTrack kind is required but was not provided");return fA(this,e,t,n)}createRemoteTextTrack(e){const t=Lt(e,{tech:this});return new za.remoteTextEl.TrackClass(t)}addRemoteTextTrack(e={},t){const n=this.createRemoteTextTrack(e);return typeof t!="boolean"&&(t=!1),this.remoteTextTrackEls().addTrackElement_(n),this.remoteTextTracks().addTrack(n.track),t===!1&&this.ready(()=>this.autoRemoteTextTracks_.addTrack(n.track)),n}removeRemoteTextTrack(e){const t=this.remoteTextTrackEls().getTrackElementByTrack_(e);this.remoteTextTrackEls().removeTrackElement_(t),this.remoteTextTracks().removeTrack(e),this.autoRemoteTextTracks_.removeTrack(e)}getVideoPlaybackQuality(){return{}}requestPictureInPicture(){return Promise.reject()}disablePictureInPicture(){return!0}setDisablePictureInPicture(){}requestVideoFrameCallback(e){const t=Ei();return!this.isReady_||this.paused()?(this.queuedHanders_.add(t),this.one("playing",()=>{this.queuedHanders_.has(t)&&(this.queuedHanders_.delete(t),e())})):this.requestNamedAnimationFrame(t,e),t}cancelVideoFrameCallback(e){this.queuedHanders_.has(e)?this.queuedHanders_.delete(e):this.cancelNamedAnimationFrame(e)}setPoster(){}playsinline(){}setPlaysinline(){}overrideNativeAudioTracks(e){}overrideNativeVideoTracks(e){}canPlayType(e){return""}static canPlayType(e){return""}static canPlaySource(e,t){return gt.canPlayType(e.type)}static isTech(e){return e.prototype instanceof gt||e instanceof gt||e===gt}static registerTech(e,t){if(gt.techs_||(gt.techs_={}),!gt.isTech(t))throw new Error(`Tech ${e} must be a Tech`);if(!gt.canPlayType)throw new Error("Techs must have a static canPlayType method on them");if(!gt.canPlaySource)throw new Error("Techs must have a static canPlaySource method on them");return e=rn(e),gt.techs_[e]=t,gt.techs_[dl(e)]=t,e!=="Tech"&&gt.defaultTechOrder_.push(e),t}static getTech(e){if(e){if(gt.techs_&&gt.techs_[e])return gt.techs_[e];if(e=rn(e),te&&te.videojs&&te.videojs[e])return bt.warn(`The ${e} tech was added to the videojs object when it should be registered using videojs.registerTech(name, tech)`),te.videojs[e]}}}Xn.names.forEach(function(i){const e=Xn[i];gt.prototype[e.getterName]=function(){return this[e.privateName]=this[e.privateName]||new e.ListClass,this[e.privateName]}}),gt.prototype.featuresVolumeControl=!0,gt.prototype.featuresMuteControl=!0,gt.prototype.featuresFullscreenResize=!1,gt.prototype.featuresPlaybackRate=!1,gt.prototype.featuresProgressEvents=!1,gt.prototype.featuresSourceset=!1,gt.prototype.featuresTimeupdateEvents=!1,gt.prototype.featuresNativeTextTracks=!1,gt.prototype.featuresVideoFrameCallback=!1,gt.withSourceHandlers=function(i){i.registerSourceHandler=function(t,n){let r=i.sourceHandlers;r||(r=i.sourceHandlers=[]),n===void 0&&(n=r.length),r.splice(n,0,t)},i.canPlayType=function(t){const n=i.sourceHandlers||[];let r;for(let s=0;s<n.length;s++)if(r=n[s].canPlayType(t),r)return r;return""},i.selectSourceHandler=function(t,n){const r=i.sourceHandlers||[];let s;for(let a=0;a<r.length;a++)if(s=r[a].canHandleSource(t,n),s)return r[a];return null},i.canPlaySource=function(t,n){const r=i.selectSourceHandler(t,n);return r?r.canHandleSource(t,n):""},["seekable","seeking","duration"].forEach(function(t){const n=this[t];typeof n=="function"&&(this[t]=function(){return this.sourceHandler_&&this.sourceHandler_[t]?this.sourceHandler_[t].apply(this.sourceHandler_,arguments):n.apply(this,arguments)})},i.prototype),i.prototype.setSource=function(t){let n=i.selectSourceHandler(t,this.options_);n||(i.nativeSourceHandler?n=i.nativeSourceHandler:bt.error("No source handler found for the current source.")),this.disposeSourceHandler(),this.off("dispose",this.disposeSourceHandler_),n!==i.nativeSourceHandler&&(this.currentSource_=t),this.sourceHandler_=n.handleSource(t,this,this.options_),this.one("dispose",this.disposeSourceHandler_)},i.prototype.disposeSourceHandler=function(){this.currentSource_&&(this.clearTracks(["audio","video"]),this.currentSource_=null),this.cleanupAutoTextTracks(),this.sourceHandler_&&(this.sourceHandler_.dispose&&this.sourceHandler_.dispose(),this.sourceHandler_=null)}},Ce.registerComponent("Tech",gt),gt.registerTech("Tech",gt),gt.defaultTechOrder_=[];const js={},wu={},Du={};function pA(i,e){js[i]=js[i]||[],js[i].push(e)}function mA(i,e,t){i.setTimeout(()=>$s(e,js[e.type],t,i),1)}function gA(i,e){i.forEach(t=>t.setTech&&t.setTech(e))}function vA(i,e,t){return i.reduceRight(op(t),e[t]())}function yA(i,e,t,n){return e[t](i.reduce(op(t),n))}function lb(i,e,t,n=null){const r="call"+rn(t),s=i.reduce(op(r),n),a=s===Du,o=a?null:e[t](s);return kA(i,t,o,a),o}const bA={buffered:1,currentTime:1,duration:1,muted:1,played:1,paused:1,seekable:1,volume:1,ended:1},_A={setCurrentTime:1,setMuted:1,setVolume:1},cb={play:1,pause:1};function op(i){return(e,t)=>e===Du?Du:t[i]?t[i](e):e}function kA(i,e,t,n){for(let r=i.length-1;r>=0;r--){const s=i[r];s[e]&&s[e](n,t)}}function TA(i){wu.hasOwnProperty(i.id())&&delete wu[i.id()]}function SA(i,e){const t=wu[i.id()];let n=null;if(t==null)return n=e(i),wu[i.id()]=[[e,n]],n;for(let r=0;r<t.length;r++){const[s,a]=t[r];s===e&&(n=a)}return n===null&&(n=e(i),t.push([e,n])),n}function $s(i={},e=[],t,n,r=[],s=!1){const[a,...o]=e;if(typeof a=="string")$s(i,js[a],t,n,r,s);else if(a){const c=SA(n,a);if(!c.setSource)return r.push(c),$s(i,o,t,n,r,s);c.setSource(Object.assign({},i),function(u,d){if(u)return $s(i,o,t,n,r,s);r.push(c),$s(d,i.type===d.type?o:js[d.type],t,n,r,s)})}else o.length?$s(i,o,t,n,r,s):s?t(i,r):$s(i,js["*"],t,n,r,!0)}const CA={opus:"video/ogg",ogv:"video/ogg",mp4:"video/mp4",mov:"video/mp4",m4v:"video/mp4",mkv:"video/x-matroska",m4a:"audio/mp4",mp3:"audio/mpeg",aac:"audio/aac",caf:"audio/x-caf",flac:"audio/flac",oga:"audio/ogg",wav:"audio/wav",m3u8:"application/x-mpegURL",mpd:"application/dash+xml",jpg:"image/jpeg",jpeg:"image/jpeg",gif:"image/gif",png:"image/png",svg:"image/svg+xml",webp:"image/webp"},Au=function(i=""){const e=ap(i);return CA[e.toLowerCase()]||""},xA=(i,e)=>{if(!e)return"";if(i.cache_.source.src===e&&i.cache_.source.type)return i.cache_.source.type;const t=i.cache_.sources.filter(r=>r.src===e);if(t.length)return t[0].type;const n=i.$$("source");for(let r=0;r<n.length;r++){const s=n[r];if(s.type&&s.src&&s.src===e)return s.type}return Au(e)},ub=function(i){if(Array.isArray(i)){let e=[];i.forEach(function(t){t=ub(t),Array.isArray(t)?e=e.concat(t):sr(t)&&e.push(t)}),i=e}else typeof i=="string"&&i.trim()?i=[db({src:i})]:sr(i)&&typeof i.src=="string"&&i.src&&i.src.trim()?i=[db(i)]:i=[];return i};function db(i){if(!i.type){const e=Au(i.src);e&&(i.type=e)}return i}var EA=`<svg xmlns="http://www.w3.org/2000/svg">
58
+ <defs>
59
+ <symbol viewBox="0 0 48 48" id="vjs-icon-play">
60
+ <path d="M16 10v28l22-14z"></path>
61
+ </symbol>
62
+ <symbol viewBox="0 0 48 48" id="vjs-icon-pause">
63
+ <path d="M12 38h8V10h-8v28zm16-28v28h8V10h-8z"></path>
64
+ </symbol>
65
+ <symbol viewBox="0 0 48 48" id="vjs-icon-audio">
66
+ <path d="M24 2C14.06 2 6 10.06 6 20v14c0 3.31 2.69 6 6 6h6V24h-8v-4c0-7.73 6.27-14 14-14s14 6.27 14 14v4h-8v16h6c3.31 0 6-2.69 6-6V20c0-9.94-8.06-18-18-18z"></path>
67
+ </symbol>
68
+ <symbol viewBox="0 0 48 48" id="vjs-icon-captions">
69
+ <path d="M38 8H10c-2.21 0-4 1.79-4 4v24c0 2.21 1.79 4 4 4h28c2.21 0 4-1.79 4-4V12c0-2.21-1.79-4-4-4zM22 22h-3v-1h-4v6h4v-1h3v2a2 2 0 0 1-2 2h-6a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2h6a2 2 0 0 1 2 2v2zm14 0h-3v-1h-4v6h4v-1h3v2a2 2 0 0 1-2 2h-6a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2h6a2 2 0 0 1 2 2v2z"></path>
70
+ </symbol>
71
+ <symbol viewBox="0 0 48 48" id="vjs-icon-subtitles">
72
+ <path d="M40 8H8c-2.21 0-4 1.79-4 4v24c0 2.21 1.79 4 4 4h32c2.21 0 4-1.79 4-4V12c0-2.21-1.79-4-4-4zM8 24h8v4H8v-4zm20 12H8v-4h20v4zm12 0h-8v-4h8v4zm0-8H20v-4h20v4z"></path>
73
+ </symbol>
74
+ <symbol viewBox="0 0 48 48" id="vjs-icon-fullscreen-enter">
75
+ <path d="M14 28h-4v10h10v-4h-6v-6zm-4-8h4v-6h6v-4H10v10zm24 14h-6v4h10V28h-4v6zm-6-24v4h6v6h4V10H28z"></path>
76
+ </symbol>
77
+ <symbol viewBox="0 0 48 48" id="vjs-icon-fullscreen-exit">
78
+ <path d="M10 32h6v6h4V28H10v4zm6-16h-6v4h10V10h-4v6zm12 22h4v-6h6v-4H28v10zm4-22v-6h-4v10h10v-4h-6z"></path>
79
+ </symbol>
80
+ <symbol viewBox="0 0 48 48" id="vjs-icon-play-circle">
81
+ <path d="M20 33l12-9-12-9v18zm4-29C12.95 4 4 12.95 4 24s8.95 20 20 20 20-8.95 20-20S35.05 4 24 4zm0 36c-8.82 0-16-7.18-16-16S15.18 8 24 8s16 7.18 16 16-7.18 16-16 16z"></path>
82
+ </symbol>
83
+ <symbol viewBox="0 0 48 48" id="vjs-icon-volume-mute">
84
+ <path d="M33 24c0-3.53-2.04-6.58-5-8.05v4.42l4.91 4.91c.06-.42.09-.85.09-1.28zm5 0c0 1.88-.41 3.65-1.08 5.28l3.03 3.03C41.25 29.82 42 27 42 24c0-8.56-5.99-15.72-14-17.54v4.13c5.78 1.72 10 7.07 10 13.41zM8.55 6L6 8.55 15.45 18H6v12h8l10 10V26.55l8.51 8.51c-1.34 1.03-2.85 1.86-4.51 2.36v4.13a17.94 17.94 0 0 0 7.37-3.62L39.45 42 42 39.45l-18-18L8.55 6zM24 8l-4.18 4.18L24 16.36V8z"></path>
85
+ </symbol>
86
+ <symbol viewBox="0 0 48 48" id="vjs-icon-volume-low">
87
+ <path d="M14 18v12h8l10 10V8L22 18h-8z"></path>
88
+ </symbol>
89
+ <symbol viewBox="0 0 48 48" id="vjs-icon-volume-medium">
90
+ <path d="M37 24c0-3.53-2.04-6.58-5-8.05v16.11c2.96-1.48 5-4.53 5-8.06zm-27-6v12h8l10 10V8L18 18h-8z"></path>
91
+ </symbol>
92
+ <symbol viewBox="0 0 48 48" id="vjs-icon-volume-high">
93
+ <path d="M6 18v12h8l10 10V8L14 18H6zm27 6c0-3.53-2.04-6.58-5-8.05v16.11c2.96-1.48 5-4.53 5-8.06zM28 6.46v4.13c5.78 1.72 10 7.07 10 13.41s-4.22 11.69-10 13.41v4.13c8.01-1.82 14-8.97 14-17.54S36.01 8.28 28 6.46z"></path>
94
+ </symbol>
95
+ <symbol viewBox="0 0 48 48" id="vjs-icon-spinner">
96
+ <path d="M18.8 21l9.53-16.51C26.94 4.18 25.49 4 24 4c-4.8 0-9.19 1.69-12.64 4.51l7.33 12.69.11-.2zm24.28-3c-1.84-5.85-6.3-10.52-11.99-12.68L23.77 18h19.31zm.52 2H28.62l.58 1 9.53 16.5C41.99 33.94 44 29.21 44 24c0-1.37-.14-2.71-.4-4zm-26.53 4l-7.8-13.5C6.01 14.06 4 18.79 4 24c0 1.37.14 2.71.4 4h14.98l-2.31-4zM4.92 30c1.84 5.85 6.3 10.52 11.99 12.68L24.23 30H4.92zm22.54 0l-7.8 13.51c1.4.31 2.85.49 4.34.49 4.8 0 9.19-1.69 12.64-4.51L29.31 26.8 27.46 30z"></path>
97
+ </symbol>
98
+ <symbol viewBox="0 0 24 24" id="vjs-icon-hd">
99
+ <path d="M19 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-8 12H9.5v-2h-2v2H6V9h1.5v2.5h2V9H11v6zm2-6h4c.55 0 1 .45 1 1v4c0 .55-.45 1-1 1h-4V9zm1.5 4.5h2v-3h-2v3z"></path>
100
+ </symbol>
101
+ <symbol viewBox="0 0 48 48" id="vjs-icon-chapters">
102
+ <path d="M6 26h4v-4H6v4zm0 8h4v-4H6v4zm0-16h4v-4H6v4zm8 8h28v-4H14v4zm0 8h28v-4H14v4zm0-20v4h28v-4H14z"></path>
103
+ </symbol>
104
+ <symbol viewBox="0 0 40 40" id="vjs-icon-downloading">
105
+ <path d="M18.208 36.875q-3.208-.292-5.979-1.729-2.771-1.438-4.812-3.729-2.042-2.292-3.188-5.229-1.146-2.938-1.146-6.23 0-6.583 4.334-11.416 4.333-4.834 10.833-5.5v3.166q-5.167.75-8.583 4.646Q6.25 14.75 6.25 19.958q0 5.209 3.396 9.104 3.396 3.896 8.562 4.646zM20 28.417L11.542 20l2.083-2.083 4.917 4.916v-11.25h2.916v11.25l4.875-4.916L28.417 20zm1.792 8.458v-3.167q1.833-.25 3.541-.958 1.709-.708 3.167-1.875l2.333 2.292q-1.958 1.583-4.25 2.541-2.291.959-4.791 1.167zm6.791-27.792q-1.541-1.125-3.25-1.854-1.708-.729-3.541-1.021V3.042q2.5.25 4.77 1.208 2.271.958 4.271 2.5zm4.584 21.584l-2.25-2.25q1.166-1.5 1.854-3.209.687-1.708.937-3.541h3.209q-.292 2.5-1.229 4.791-.938 2.292-2.521 4.209zm.541-12.417q-.291-1.833-.958-3.562-.667-1.73-1.833-3.188l2.375-2.208q1.541 1.916 2.458 4.208.917 2.292 1.167 4.75z"></path>
106
+ </symbol>
107
+ <symbol viewBox="0 0 48 48" id="vjs-icon-file-download">
108
+ <path d="M10.8 40.55q-1.35 0-2.375-1T7.4 37.15v-7.7h3.4v7.7h26.35v-7.7h3.4v7.7q0 1.4-1 2.4t-2.4 1zM24 32.1L13.9 22.05l2.45-2.45 5.95 5.95V7.15h3.4v18.4l5.95-5.95 2.45 2.45z"></path>
109
+ </symbol>
110
+ <symbol viewBox="0 0 48 48" id="vjs-icon-file-download-done">
111
+ <path d="M9.8 40.5v-3.45h28.4v3.45zm9.2-9.05L7.4 19.85l2.45-2.35L19 26.65l19.2-19.2 2.4 2.4z"></path>
112
+ </symbol>
113
+ <symbol viewBox="0 0 48 48" id="vjs-icon-file-download-off">
114
+ <path d="M4.9 4.75L43.25 43.1 41 45.3l-4.75-4.75q-.05.05-.075.025-.025-.025-.075-.025H10.8q-1.35 0-2.375-1T7.4 37.15v-7.7h3.4v7.7h22.05l-7-7-1.85 1.8L13.9 21.9l1.85-1.85L2.7 7zm26.75 14.7l2.45 2.45-3.75 3.8-2.45-2.5zM25.7 7.15V21.1l-3.4-3.45V7.15z"></path>
115
+ </symbol>
116
+ <symbol viewBox="0 0 48 48" id="vjs-icon-share">
117
+ <path d="M36 32.17c-1.52 0-2.89.59-3.93 1.54L17.82 25.4c.11-.45.18-.92.18-1.4s-.07-.95-.18-1.4l14.1-8.23c1.07 1 2.5 1.62 4.08 1.62 3.31 0 6-2.69 6-6s-2.69-6-6-6-6 2.69-6 6c0 .48.07.95.18 1.4l-14.1 8.23c-1.07-1-2.5-1.62-4.08-1.62-3.31 0-6 2.69-6 6s2.69 6 6 6c1.58 0 3.01-.62 4.08-1.62l14.25 8.31c-.1.42-.16.86-.16 1.31A5.83 5.83 0 1 0 36 32.17z"></path>
118
+ </symbol>
119
+ <symbol viewBox="0 0 48 48" id="vjs-icon-cog">
120
+ <path d="M38.86 25.95c.08-.64.14-1.29.14-1.95s-.06-1.31-.14-1.95l4.23-3.31c.38-.3.49-.84.24-1.28l-4-6.93c-.25-.43-.77-.61-1.22-.43l-4.98 2.01c-1.03-.79-2.16-1.46-3.38-1.97L29 4.84c-.09-.47-.5-.84-1-.84h-8c-.5 0-.91.37-.99.84l-.75 5.3a14.8 14.8 0 0 0-3.38 1.97L9.9 10.1a1 1 0 0 0-1.22.43l-4 6.93c-.25.43-.14.97.24 1.28l4.22 3.31C9.06 22.69 9 23.34 9 24s.06 1.31.14 1.95l-4.22 3.31c-.38.3-.49.84-.24 1.28l4 6.93c.25.43.77.61 1.22.43l4.98-2.01c1.03.79 2.16 1.46 3.38 1.97l.75 5.3c.08.47.49.84.99.84h8c.5 0 .91-.37.99-.84l.75-5.3a14.8 14.8 0 0 0 3.38-1.97l4.98 2.01a1 1 0 0 0 1.22-.43l4-6.93c.25-.43.14-.97-.24-1.28l-4.22-3.31zM24 31c-3.87 0-7-3.13-7-7s3.13-7 7-7 7 3.13 7 7-3.13 7-7 7z"></path>
121
+ </symbol>
122
+ <symbol viewBox="0 0 48 48" id="vjs-icon-square">
123
+ <path d="M36 8H12c-2.21 0-4 1.79-4 4v24c0 2.21 1.79 4 4 4h24c2.21 0 4-1.79 4-4V12c0-2.21-1.79-4-4-4zm0 28H12V12h24v24z"></path>
124
+ </symbol>
125
+ <symbol viewBox="0 0 48 48" id="vjs-icon-circle">
126
+ <circle cx="24" cy="24" r="20"></circle>
127
+ </symbol>
128
+ <symbol viewBox="0 0 48 48" id="vjs-icon-circle-outline">
129
+ <path d="M24 4C12.95 4 4 12.95 4 24s8.95 20 20 20 20-8.95 20-20S35.05 4 24 4zm0 36c-8.82 0-16-7.18-16-16S15.18 8 24 8s16 7.18 16 16-7.18 16-16 16z"></path>
130
+ </symbol>
131
+ <symbol viewBox="0 0 48 48" id="vjs-icon-circle-inner-circle">
132
+ <path d="M24 4C12.97 4 4 12.97 4 24s8.97 20 20 20 20-8.97 20-20S35.03 4 24 4zm0 36c-8.82 0-16-7.18-16-16S15.18 8 24 8s16 7.18 16 16-7.18 16-16 16zm6-16c0 3.31-2.69 6-6 6s-6-2.69-6-6 2.69-6 6-6 6 2.69 6 6z"></path>
133
+ </symbol>
134
+ <symbol viewBox="0 0 48 48" id="vjs-icon-cancel">
135
+ <path d="M24 4C12.95 4 4 12.95 4 24s8.95 20 20 20 20-8.95 20-20S35.05 4 24 4zm10 27.17L31.17 34 24 26.83 16.83 34 14 31.17 21.17 24 14 16.83 16.83 14 24 21.17 31.17 14 34 16.83 26.83 24 34 31.17z"></path>
136
+ </symbol>
137
+ <symbol viewBox="0 0 48 48" id="vjs-icon-replay">
138
+ <path d="M24 10V2L14 12l10 10v-8c6.63 0 12 5.37 12 12s-5.37 12-12 12-12-5.37-12-12H8c0 8.84 7.16 16 16 16s16-7.16 16-16-7.16-16-16-16z"></path>
139
+ </symbol>
140
+ <symbol viewBox="0 0 48 48" id="vjs-icon-repeat">
141
+ <path d="M14 14h20v6l8-8-8-8v6H10v12h4v-8zm20 20H14v-6l-8 8 8 8v-6h24V26h-4v8z"></path>
142
+ </symbol>
143
+ <symbol viewBox="0 96 48 48" id="vjs-icon-replay-5">
144
+ <path d="M17.689 98l-8.697 8.696 8.697 8.697 2.486-2.485-4.32-4.319h1.302c4.93 0 9.071 1.722 12.424 5.165 3.352 3.443 5.029 7.638 5.029 12.584h3.55c0-2.958-.553-5.73-1.658-8.313-1.104-2.583-2.622-4.841-4.555-6.774-1.932-1.932-4.19-3.45-6.773-4.555-2.584-1.104-5.355-1.657-8.313-1.657H15.5l4.615-4.615zm-8.08 21.659v13.861h11.357v5.008H9.609V143h12.7c.834 0 1.55-.298 2.146-.894.596-.597.895-1.31.895-2.145v-7.781c0-.835-.299-1.55-.895-2.147a2.929 2.929 0 0 0-2.147-.894h-8.227v-5.096H25.35v-4.384z"></path>
145
+ </symbol>
146
+ <symbol viewBox="0 96 48 48" id="vjs-icon-replay-10">
147
+ <path d="M42.315 125.63c0-4.997-1.694-9.235-5.08-12.713-3.388-3.479-7.571-5.218-12.552-5.218h-1.315l4.363 4.363-2.51 2.51-8.787-8.786L25.221 97l2.45 2.45-4.662 4.663h1.375c2.988 0 5.788.557 8.397 1.673 2.61 1.116 4.892 2.65 6.844 4.602 1.953 1.953 3.487 4.234 4.602 6.844 1.116 2.61 1.674 5.41 1.674 8.398zM8.183 142v-19.657H3.176V117.8h9.643V142zm13.63 0c-1.156 0-2.127-.393-2.912-1.178-.778-.778-1.168-1.746-1.168-2.902v-16.04c0-1.156.393-2.127 1.178-2.912.779-.779 1.746-1.168 2.902-1.168h7.696c1.156 0 2.126.392 2.911 1.177.779.78 1.168 1.747 1.168 2.903v16.04c0 1.156-.392 2.127-1.177 2.912-.779.779-1.746 1.168-2.902 1.168zm.556-4.636h6.583v-15.02H22.37z"></path>
148
+ </symbol>
149
+ <symbol viewBox="0 96 48 48" id="vjs-icon-replay-30">
150
+ <path d="M26.047 97l-8.733 8.732 8.733 8.733 2.496-2.494-4.336-4.338h1.307c4.95 0 9.108 1.73 12.474 5.187 3.367 3.458 5.051 7.668 5.051 12.635h3.565c0-2.97-.556-5.751-1.665-8.346-1.109-2.594-2.633-4.862-4.574-6.802-1.94-1.941-4.208-3.466-6.803-4.575-2.594-1.109-5.375-1.664-8.345-1.664H23.85l4.634-4.634zM2.555 117.531v4.688h10.297v5.25H5.873v4.687h6.979v5.156H2.555V142H13.36c1.061 0 1.95-.395 2.668-1.186.718-.79 1.076-1.772 1.076-2.94v-16.218c0-1.168-.358-2.149-1.076-2.94-.717-.79-1.607-1.185-2.668-1.185zm22.482.14c-1.149 0-2.11.39-2.885 1.165-.78.78-1.172 1.744-1.172 2.893v15.943c0 1.149.388 2.11 1.163 2.885.78.78 1.745 1.172 2.894 1.172h7.649c1.148 0 2.11-.388 2.884-1.163.78-.78 1.17-1.745 1.17-2.894v-15.943c0-1.15-.386-2.111-1.16-2.885-.78-.78-1.746-1.172-2.894-1.172zm.553 4.518h6.545v14.93H25.59z"></path>
151
+ </symbol>
152
+ <symbol viewBox="0 96 48 48" id="vjs-icon-forward-5">
153
+ <path d="M29.508 97l-2.431 2.43 4.625 4.625h-1.364c-2.965 0-5.742.554-8.332 1.66-2.589 1.107-4.851 2.629-6.788 4.566-1.937 1.937-3.458 4.2-4.565 6.788-1.107 2.59-1.66 5.367-1.66 8.331h3.557c0-4.957 1.68-9.16 5.04-12.611 3.36-3.45 7.51-5.177 12.451-5.177h1.304l-4.326 4.33 2.49 2.49 8.715-8.716zm-9.783 21.61v13.89h11.382v5.018H19.725V142h12.727a2.93 2.93 0 0 0 2.15-.896 2.93 2.93 0 0 0 .896-2.15v-7.798c0-.837-.299-1.554-.896-2.152a2.93 2.93 0 0 0-2.15-.896h-8.245V123h11.29v-4.392z"></path>
154
+ </symbol>
155
+ <symbol viewBox="0 96 48 48" id="vjs-icon-forward-10">
156
+ <path d="M23.119 97l-2.386 2.383 4.538 4.538h-1.339c-2.908 0-5.633.543-8.173 1.63-2.54 1.085-4.76 2.577-6.66 4.478-1.9 1.9-3.392 4.12-4.478 6.66-1.085 2.54-1.629 5.264-1.629 8.172h3.49c0-4.863 1.648-8.986 4.944-12.372 3.297-3.385 7.368-5.078 12.216-5.078h1.279l-4.245 4.247 2.443 2.442 8.55-8.55zm-9.52 21.45v4.42h4.871V142h4.513v-23.55zm18.136 0c-1.125 0-2.066.377-2.824 1.135-.764.764-1.148 1.709-1.148 2.834v15.612c0 1.124.38 2.066 1.139 2.824.764.764 1.708 1.145 2.833 1.145h7.489c1.125 0 2.066-.378 2.824-1.136.764-.764 1.145-1.709 1.145-2.833v-15.612c0-1.125-.378-2.067-1.136-2.825-.764-.764-1.708-1.145-2.833-1.145zm.54 4.42h6.408v14.617h-6.407z"></path>
157
+ </symbol>
158
+ <symbol viewBox="0 96 48 48" id="vjs-icon-forward-30">
159
+ <path d="M25.549 97l-2.437 2.434 4.634 4.635H26.38c-2.97 0-5.753.555-8.347 1.664-2.594 1.109-4.861 2.633-6.802 4.574-1.94 1.94-3.465 4.207-4.574 6.802-1.109 2.594-1.664 5.377-1.664 8.347h3.565c0-4.967 1.683-9.178 5.05-12.636 3.366-3.458 7.525-5.187 12.475-5.187h1.307l-4.335 4.338 2.495 2.494 8.732-8.732zm-11.553 20.53v4.689h10.297v5.249h-6.978v4.688h6.978v5.156H13.996V142h10.808c1.06 0 1.948-.395 2.666-1.186.718-.79 1.077-1.771 1.077-2.94v-16.217c0-1.169-.36-2.15-1.077-2.94-.718-.79-1.605-1.186-2.666-1.186zm21.174.168c-1.149 0-2.11.389-2.884 1.163-.78.78-1.172 1.745-1.172 2.894v15.942c0 1.15.388 2.11 1.162 2.885.78.78 1.745 1.17 2.894 1.17h7.649c1.149 0 2.11-.386 2.885-1.16.78-.78 1.17-1.746 1.17-2.895v-15.942c0-1.15-.387-2.11-1.161-2.885-.78-.78-1.745-1.172-2.894-1.172zm.552 4.516h6.542v14.931h-6.542z"></path>
160
+ </symbol>
161
+ <symbol viewBox="0 0 512 512" id="vjs-icon-audio-description">
162
+ <g fill-rule="evenodd"><path d="M227.29 381.351V162.993c50.38-1.017 89.108-3.028 117.631 17.126 27.374 19.342 48.734 56.965 44.89 105.325-4.067 51.155-41.335 94.139-89.776 98.475-24.085 2.155-71.972 0-71.972 0s-.84-1.352-.773-2.568m48.755-54.804c31.43 1.26 53.208-16.633 56.495-45.386 4.403-38.51-21.188-63.552-58.041-60.796v103.612c-.036 1.466.575 2.22 1.546 2.57"></path><path d="M383.78 381.328c13.336 3.71 17.387-11.06 23.215-21.408 12.722-22.571 22.294-51.594 22.445-84.774.221-47.594-18.343-82.517-35.6-106.182h-8.51c-.587 3.874 2.226 7.315 3.865 10.276 13.166 23.762 25.367 56.553 25.54 94.194.2 43.176-14.162 79.278-30.955 107.894"></path><path d="M425.154 381.328c13.336 3.71 17.384-11.061 23.215-21.408 12.721-22.571 22.291-51.594 22.445-84.774.221-47.594-18.343-82.517-35.6-106.182h-8.511c-.586 3.874 2.226 7.315 3.866 10.276 13.166 23.762 25.367 56.553 25.54 94.194.2 43.176-14.162 79.278-30.955 107.894"></path><path d="M466.26 381.328c13.337 3.71 17.385-11.061 23.216-21.408 12.722-22.571 22.292-51.594 22.445-84.774.221-47.594-18.343-82.517-35.6-106.182h-8.51c-.587 3.874 2.225 7.315 3.865 10.276 13.166 23.762 25.367 56.553 25.54 94.194.2 43.176-14.162 79.278-30.955 107.894M4.477 383.005H72.58l18.573-28.484 64.169-.135s.065 19.413.065 28.62h48.756V160.307h-58.816c-5.653 9.537-140.85 222.697-140.85 222.697zm152.667-145.282v71.158l-40.453-.27 40.453-70.888z"></path></g>
163
+ </symbol>
164
+ <symbol viewBox="0 0 48 48" id="vjs-icon-next-item">
165
+ <path d="M12 36l17-12-17-12v24zm20-24v24h4V12h-4z"></path>
166
+ </symbol>
167
+ <symbol viewBox="0 0 48 48" id="vjs-icon-previous-item">
168
+ <path d="M12 12h4v24h-4zm7 12l17 12V12z"></path>
169
+ </symbol>
170
+ <symbol viewBox="0 0 48 48" id="vjs-icon-shuffle">
171
+ <path d="M21.17 18.34L10.83 8 8 10.83l10.34 10.34 2.83-2.83zM29 8l4.09 4.09L8 37.17 10.83 40l25.09-25.09L40 19V8H29zm.66 18.83l-2.83 2.83 6.26 6.26L29 40h11V29l-4.09 4.09-6.25-6.26z"></path>
172
+ </symbol>
173
+ <symbol viewBox="0 0 48 48" id="vjs-icon-cast">
174
+ <path d="M42 6H6c-2.21 0-4 1.79-4 4v6h4v-6h36v28H28v4h14c2.21 0 4-1.79 4-4V10c0-2.21-1.79-4-4-4zM2 36v6h6c0-3.31-2.69-6-6-6zm0-8v4c5.52 0 10 4.48 10 10h4c0-7.73-6.27-14-14-14zm0-8v4c9.94 0 18 8.06 18 18h4c0-12.15-9.85-22-22-22z"></path>
175
+ </symbol>
176
+ <symbol viewBox="0 0 48 48" id="vjs-icon-picture-in-picture-enter">
177
+ <path d="M38 22H22v11.99h16V22zm8 16V9.96C46 7.76 44.2 6 42 6H6C3.8 6 2 7.76 2 9.96V38c0 2.2 1.8 4 4 4h36c2.2 0 4-1.8 4-4zm-4 .04H6V9.94h36v28.1z"></path>
178
+ </symbol>
179
+ <symbol viewBox="0 0 22 18" id="vjs-icon-picture-in-picture-exit">
180
+ <path d="M18 4H4v10h14V4zm4 12V1.98C22 .88 21.1 0 20 0H2C.9 0 0 .88 0 1.98V16c0 1.1.9 2 2 2h18c1.1 0 2-.9 2-2zm-2 .02H2V1.97h18v14.05z"></path>
181
+ <path fill="none" d="M-1-3h24v24H-1z"></path>
182
+ </symbol>
183
+ <symbol viewBox="0 0 1792 1792" id="vjs-icon-facebook">
184
+ <path d="M1343 12v264h-157q-86 0-116 36t-30 108v189h293l-39 296h-254v759H734V905H479V609h255V391q0-186 104-288.5T1115 0q147 0 228 12z"></path>
185
+ </symbol>
186
+ <symbol viewBox="0 0 1792 1792" id="vjs-icon-linkedin">
187
+ <path d="M477 625v991H147V625h330zm21-306q1 73-50.5 122T312 490h-2q-82 0-132-49t-50-122q0-74 51.5-122.5T314 148t133 48.5T498 319zm1166 729v568h-329v-530q0-105-40.5-164.5T1168 862q-63 0-105.5 34.5T999 982q-11 30-11 81v553H659q2-399 2-647t-1-296l-1-48h329v144h-2q20-32 41-56t56.5-52 87-43.5T1285 602q171 0 275 113.5t104 332.5z"></path>
188
+ </symbol>
189
+ <symbol viewBox="0 0 1200 1227" id="vjs-icon-twitter">
190
+ <path d="M714.163 519.284L1160.89 0H1055.03L667.137 450.887L357.328 0H0L468.492 681.821L0 1226.37H105.866L515.491 750.218L842.672 1226.37H1200L714.137 519.284H714.163ZM569.165 687.828L521.697 619.934L144.011 79.6944H306.615L611.412 515.685L658.88 583.579L1055.08 1150.3H892.476L569.165 687.854V687.828Z"/>
191
+ </symbol>
192
+ <symbol viewBox="0 0 1792 1792" id="vjs-icon-tumblr">
193
+ <path d="M1328 1329l80 237q-23 35-111 66t-177 32q-104 2-190.5-26T787 1564t-95-106-55.5-120-16.5-118V676H452V461q72-26 129-69.5t91-90 58-102 34-99T779 12q1-5 4.5-8.5T791 0h244v424h333v252h-334v518q0 30 6.5 56t22.5 52.5 49.5 41.5 81.5 14q78-2 134-29z"></path>
194
+ </symbol>
195
+ <symbol viewBox="0 0 1792 1792" id="vjs-icon-pinterest">
196
+ <path d="M1664 896q0 209-103 385.5T1281.5 1561 896 1664q-111 0-218-32 59-93 78-164 9-34 54-211 20 39 73 67.5t114 28.5q121 0 216-68.5t147-188.5 52-270q0-114-59.5-214T1180 449t-255-63q-105 0-196 29t-154.5 77-109 110.5-67 129.5T377 866q0 104 40 183t117 111q30 12 38-20 2-7 8-31t8-30q6-23-11-43-51-61-51-151 0-151 104.5-259.5T904 517q151 0 235.5 82t84.5 213q0 170-68.5 289T980 1220q-61 0-98-43.5T859 1072q8-35 26.5-93.5t30-103T927 800q0-50-27-83t-77-33q-62 0-105 57t-43 142q0 73 25 122l-99 418q-17 70-13 177-206-91-333-281T128 896q0-209 103-385.5T510.5 231 896 128t385.5 103T1561 510.5 1664 896z"></path>
197
+ </symbol>
198
+ </defs>
199
+ </svg>`;const hb=hu?10009:fu?461:8,Ga={codes:{play:415,pause:19,ff:417,rw:412,back:hb},names:{415:"play",19:"pause",417:"ff",412:"rw",[hb]:"back"},isEventKey(i,e){return e=e.toLowerCase(),!!(this.names[i.keyCode]&&this.names[i.keyCode]===e)},getEventName(i){if(this.names[i.keyCode])return this.names[i.keyCode];if(this.codes[i.code]){const e=this.codes[i.code];return this.names[e]}return null}},fb=5;class wA extends pi{constructor(e){super(),this.player_=e,this.focusableComponents=[],this.isListening_=!1,this.isPaused_=!1,this.onKeyDown_=this.onKeyDown_.bind(this),this.lastFocusedComponent_=null}start(){this.isListening_||(this.player_.on("keydown",this.onKeyDown_),this.player_.on("modalKeydown",this.onKeyDown_),this.player_.on("loadedmetadata",()=>{this.focus(this.updateFocusableComponents()[0])}),this.player_.on("modalclose",()=>{this.refocusComponent()}),this.player_.on("focusin",this.handlePlayerFocus_.bind(this)),this.player_.on("focusout",this.handlePlayerBlur_.bind(this)),this.isListening_=!0,this.player_.errorDisplay&&this.player_.errorDisplay.on("aftermodalfill",()=>{this.updateFocusableComponents(),this.focusableComponents.length&&(this.focusableComponents.length>1?this.focusableComponents[1].focus():this.focusableComponents[0].focus())}))}stop(){this.player_.off("keydown",this.onKeyDown_),this.isListening_=!1}onKeyDown_(e){const t=e.originalEvent?e.originalEvent:e;if(["ArrowLeft","ArrowRight","ArrowUp","ArrowDown"].includes(t.key)){if(this.isPaused_)return;t.preventDefault();const n=t.key.substring(5).toLowerCase();this.move(n)}else if(Ga.isEventKey(t,"play")||Ga.isEventKey(t,"pause")||Ga.isEventKey(t,"ff")||Ga.isEventKey(t,"rw")){t.preventDefault();const n=Ga.getEventName(t);this.performMediaAction_(n)}else Ga.isEventKey(t,"Back")&&e.target&&typeof e.target.closeable=="function"&&e.target.closeable()&&(t.preventDefault(),e.target.close())}performMediaAction_(e){if(this.player_)switch(e){case"play":this.player_.paused()&&this.player_.play();break;case"pause":this.player_.paused()||this.player_.pause();break;case"ff":this.userSeek_(this.player_.currentTime()+fb);break;case"rw":this.userSeek_(this.player_.currentTime()-fb);break}}userSeek_(e){this.player_.liveTracker&&this.player_.liveTracker.isLive()&&this.player_.liveTracker.nextSeekedFromUser(),this.player_.currentTime(e)}pause(){this.isPaused_=!0}resume(){this.isPaused_=!1}handlePlayerBlur_(e){const t=e.relatedTarget;let n=null;const r=this.getCurrentComponent(e.target);t&&(n=!!t.closest(".video-js"),t.classList.contains("vjs-text-track-settings")&&!this.isPaused_&&this.searchForTrackSelect_()),(!e.currentTarget.contains(e.relatedTarget)&&!n||!t)&&(r&&r.name()==="CloseButton"?this.refocusComponent():(this.pause(),r&&r.el()&&(this.lastFocusedComponent_=r)))}handlePlayerFocus_(){this.getCurrentComponent()&&this.getCurrentComponent().getIsFocusable()&&this.resume()}updateFocusableComponents(){const e=this.player_,t=[];function n(r){for(const s of r)s.hasOwnProperty("el_")&&s.getIsFocusable()&&s.getIsAvailableToBeFocused(s.el())&&t.push(s),s.hasOwnProperty("children_")&&s.children_.length>0&&n(s.children_)}return e.children_.forEach(r=>{if(r.hasOwnProperty("el_"))if(r.getIsFocusable&&r.getIsAvailableToBeFocused&&r.getIsFocusable()&&r.getIsAvailableToBeFocused(r.el())){t.push(r);return}else r.hasOwnProperty("children_")&&r.children_.length>0?n(r.children_):r.hasOwnProperty("items")&&r.items.length>0?n(r.items):this.findSuitableDOMChild(r)&&t.push(r);if(r.name_==="ErrorDisplay"&&r.opened_){const s=r.el_.querySelector(".vjs-errors-ok-button-container");s&&s.querySelectorAll("button").forEach((o,c)=>{t.push({name:()=>"ModalButton"+(c+1),el:()=>o,getPositions:()=>{const u=o.getBoundingClientRect(),d={x:u.x,y:u.y,width:u.width,height:u.height,top:u.top,right:u.right,bottom:u.bottom,left:u.left},h={x:u.left+u.width/2,y:u.top+u.height/2,width:0,height:0,top:u.top+u.height/2,right:u.left+u.width/2,bottom:u.top+u.height/2,left:u.left+u.width/2};return{boundingClientRect:d,center:h}},getIsAvailableToBeFocused:()=>!0,getIsFocusable:u=>!0,focus:()=>o.focus()})})}}),this.focusableComponents=t,this.focusableComponents}findSuitableDOMChild(e){function t(n){if(e.getIsFocusable(n)&&e.getIsAvailableToBeFocused(n))return n;for(let r=0;r<n.children.length;r++){const s=n.children[r],a=t(s);if(a)return a}return null}return e.el()?t(e.el()):null}getCurrentComponent(e){this.updateFocusableComponents();const t=e||document.activeElement;if(this.focusableComponents.length){for(const n of this.focusableComponents)if(n.el()===t)return n}}add(e){const t=[...this.focusableComponents];e.hasOwnProperty("el_")&&e.getIsFocusable()&&e.getIsAvailableToBeFocused(e.el())&&t.push(e),this.focusableComponents=t,this.trigger({type:"focusableComponentsChanged",focusableComponents:this.focusableComponents})}remove(e){for(let t=0;t<this.focusableComponents.length;t++)if(this.focusableComponents[t].name()===e.name()){this.focusableComponents.splice(t,1),this.trigger({type:"focusableComponentsChanged",focusableComponents:this.focusableComponents});return}}clear(){this.focusableComponents.length>0&&(this.focusableComponents=[],this.trigger({type:"focusableComponentsChanged",focusableComponents:this.focusableComponents}))}move(e){const t=this.getCurrentComponent();if(!t)return;const n=t.getPositions(),r=this.focusableComponents.filter(a=>a!==t&&this.isInDirection_(n.boundingClientRect,a.getPositions().boundingClientRect,e)),s=this.findBestCandidate_(n.center,r,e);s?this.focus(s):this.trigger({type:"endOfFocusableComponents",direction:e,focusedComponent:t})}findBestCandidate_(e,t,n){let r=1/0,s=null;for(const a of t){const o=a.getPositions().center,c=this.calculateDistance_(e,o,n);c<r&&(r=c,s=a)}return s}isInDirection_(e,t,n){switch(n){case"right":return t.left>=e.right;case"left":return t.right<=e.left;case"down":return t.top>=e.bottom;case"up":return t.bottom<=e.top;default:return!1}}refocusComponent(){if(this.lastFocusedComponent_){this.player_.userActive()||this.player_.userActive(!0),this.updateFocusableComponents();for(let e=0;e<this.focusableComponents.length;e++)if(this.focusableComponents[e].name()===this.lastFocusedComponent_.name()){this.focus(this.focusableComponents[e]);return}}else this.focus(this.updateFocusableComponents()[0])}focus(e){typeof e=="object"&&(e.getIsAvailableToBeFocused(e.el())?e.focus():this.findSuitableDOMChild(e)&&this.findSuitableDOMChild(e).focus())}calculateDistance_(e,t,n){const r=Math.abs(e.x-t.x),s=Math.abs(e.y-t.y);let a;switch(n){case"right":case"left":a=r+s*100;break;case"up":a=s*2+r*.5;break;case"down":a=s*5+r;break;default:a=r+s}return a}searchForTrackSelect_(){const e=this;for(const t of e.updateFocusableComponents())if(t.constructor.name==="TextTrackSelect"){e.focus(t);break}}}class DA extends Ce{constructor(e,t,n){const r=Lt({createEl:!1},t);if(super(e,r,n),!t.playerOptions.sources||t.playerOptions.sources.length===0)for(let s=0,a=t.playerOptions.techOrder;s<a.length;s++){const o=rn(a[s]);let c=gt.getTech(o);if(o||(c=Ce.getComponent(o)),c&&c.isSupported()){e.loadTech_(o);break}}else e.src(t.playerOptions.sources)}}Ce.registerComponent("MediaLoader",DA);class Iu extends Ce{constructor(e,t){super(e,t),this.options_.controlText&&this.controlText(this.options_.controlText),this.handleMouseOver_=n=>this.handleMouseOver(n),this.handleMouseOut_=n=>this.handleMouseOut(n),this.handleClick_=n=>this.handleClick(n),this.handleKeyDown_=n=>this.handleKeyDown(n),this.emitTapEvents(),this.enable()}createEl(e="div",t={},n={}){t=Object.assign({className:this.buildCSSClass(),tabIndex:0},t),e==="button"&&bt.error(`Creating a ClickableComponent with an HTML element of ${e} is not supported; use a Button instead.`),n=Object.assign({role:"button"},n),this.tabIndex_=t.tabIndex;const r=ot(e,t,n);return this.player_.options_.experimentalSvgIcons||r.appendChild(ot("span",{className:"vjs-icon-placeholder"},{"aria-hidden":!0})),this.createControlTextEl(r),r}dispose(){this.controlTextEl_=null,super.dispose()}createControlTextEl(e){return this.controlTextEl_=ot("span",{className:"vjs-control-text"},{"aria-live":"polite"}),e&&e.appendChild(this.controlTextEl_),this.controlText(this.controlText_,e),this.controlTextEl_}controlText(e,t=this.el()){if(e===void 0)return this.controlText_||"Need Text";const n=this.localize(e);this.controlText_=e,as(this.controlTextEl_,n),!this.nonIconControl&&!this.player_.options_.noUITitleAttributes&&t.setAttribute("title",n)}buildCSSClass(){return`vjs-control vjs-button ${super.buildCSSClass()}`}enable(){this.enabled_||(this.enabled_=!0,this.removeClass("vjs-disabled"),this.el_.setAttribute("aria-disabled","false"),typeof this.tabIndex_<"u"&&this.el_.setAttribute("tabIndex",this.tabIndex_),this.on(["tap","click"],this.handleClick_),this.on("keydown",this.handleKeyDown_))}disable(){this.enabled_=!1,this.addClass("vjs-disabled"),this.el_.setAttribute("aria-disabled","true"),typeof this.tabIndex_<"u"&&this.el_.removeAttribute("tabIndex"),this.off("mouseover",this.handleMouseOver_),this.off("mouseout",this.handleMouseOut_),this.off(["tap","click"],this.handleClick_),this.off("keydown",this.handleKeyDown_)}handleLanguagechange(){this.controlText(this.controlText_)}handleClick(e){this.options_.clickHandler&&this.options_.clickHandler.call(this,arguments)}handleKeyDown(e){e.key===" "||e.key==="Enter"?(e.preventDefault(),e.stopPropagation(),this.trigger("click")):super.handleKeyDown(e)}}Ce.registerComponent("ClickableComponent",Iu);class lp extends Iu{constructor(e,t){super(e,t),this.update(),this.update_=n=>this.update(n),e.on("posterchange",this.update_)}dispose(){this.player().off("posterchange",this.update_),super.dispose()}createEl(){return ot("div",{className:"vjs-poster"})}crossOrigin(e){if(typeof e>"u")return this.$("img")?this.$("img").crossOrigin:this.player_.tech_&&this.player_.tech_.isReady_?this.player_.crossOrigin():this.player_.options_.crossOrigin||this.player_.options_.crossorigin||null;if(e!==null&&e!=="anonymous"&&e!=="use-credentials"){this.player_.log.warn(`crossOrigin must be null, "anonymous" or "use-credentials", given "${e}"`);return}this.$("img")&&(this.$("img").crossOrigin=e)}update(e){const t=this.player().poster();this.setSrc(t),t?this.show():this.hide()}setSrc(e){if(!e){this.el_.textContent="";return}this.$("img")||this.el_.appendChild(ot("picture",{className:"vjs-poster",tabIndex:-1},{},ot("img",{loading:"lazy",crossOrigin:this.crossOrigin()},{alt:""}))),this.$("img").src=e}handleClick(e){this.player_.controls()&&(this.player_.tech(!0)&&this.player_.tech(!0).focus(),this.player_.paused()?lr(this.player_.play()):this.player_.pause())}}lp.prototype.crossorigin=lp.prototype.crossOrigin,Ce.registerComponent("PosterImage",lp);const Ai="#222",pb="#ccc",AA={monospace:"monospace",sansSerif:"sans-serif",serif:"serif",monospaceSansSerif:'"Andale Mono", "Lucida Console", monospace',monospaceSerif:'"Courier New", monospace',proportionalSansSerif:"sans-serif",proportionalSerif:"serif",casual:'"Comic Sans MS", Impact, fantasy',script:'"Monotype Corsiva", cursive',smallcaps:'"Andale Mono", "Lucida Console", monospace, sans-serif'};function cp(i,e){let t;if(i.length===4)t=i[1]+i[1]+i[2]+i[2]+i[3]+i[3];else if(i.length===7)t=i.slice(1);else throw new Error("Invalid color code provided, "+i+"; must be formatted as e.g. #f0e or #f604e2.");return"rgba("+parseInt(t.slice(0,2),16)+","+parseInt(t.slice(2,4),16)+","+parseInt(t.slice(4,6),16)+","+e+")"}function cr(i,e,t){try{i.style[e]=t}catch{return}}function mb(i){return i?`${i}px`:""}class IA extends Ce{constructor(e,t,n){super(e,t,n);const r=a=>this.updateDisplay(a),s=a=>{this.updateDisplayOverlay(),this.updateDisplay(a)};e.on("loadstart",a=>this.toggleDisplay(a)),e.on("useractive",r),e.on("userinactive",r),e.on("texttrackchange",r),e.on("loadedmetadata",a=>{this.updateDisplayOverlay(),this.preselectTrack(a)}),e.ready(zt(this,function(){if(e.tech_&&e.tech_.featuresNativeTextTracks){this.hide();return}e.on("fullscreenchange",s),e.on("playerresize",s);const a=te.screen.orientation||te,o=te.screen.orientation?"change":"orientationchange";a.addEventListener(o,s),e.on("dispose",()=>a.removeEventListener(o,s));const c=this.options_.playerOptions.tracks||[];for(let u=0;u<c.length;u++)this.player_.addRemoteTextTrack(c[u],!0);this.preselectTrack()}))}preselectTrack(){const e={captions:1,subtitles:1},t=this.player_.textTracks(),n=this.player_.cache_.selectedLanguage;let r,s,a;for(let o=0;o<t.length;o++){const c=t[o];n&&n.enabled&&n.language&&n.language===c.language&&c.kind in e?c.kind===n.kind?a=c:a||(a=c):n&&!n.enabled?(a=null,r=null,s=null):c.default&&(c.kind==="descriptions"&&!r?r=c:c.kind in e&&!s&&(s=c))}a?a.mode="showing":s?s.mode="showing":r&&(r.mode="showing")}toggleDisplay(){this.player_.tech_&&this.player_.tech_.featuresNativeTextTracks?this.hide():this.show()}createEl(){return super.createEl("div",{className:"vjs-text-track-display"},{translate:"yes","aria-live":"off","aria-atomic":"true"})}clearDisplay(){typeof te.WebVTT=="function"&&te.WebVTT.processCues(te,[],this.el_)}updateDisplay(){const e=this.player_.textTracks(),t=this.options_.allowMultipleShowingTracks;if(this.clearDisplay(),t){const a=[];for(let o=0;o<e.length;++o){const c=e[o];c.mode==="showing"&&a.push(c)}this.updateForTrack(a);return}let n=null,r=null,s=e.length;for(;s--;){const a=e[s];a.mode==="showing"&&(a.kind==="descriptions"?n=a:r=a)}if(r?(this.getAttribute("aria-live")!=="off"&&this.setAttribute("aria-live","off"),this.updateForTrack(r)):n&&(this.getAttribute("aria-live")!=="assertive"&&this.setAttribute("aria-live","assertive"),this.updateForTrack(n)),!te.CSS.supports("inset","10px")){const a=this.el_,o=a.querySelectorAll(".vjs-text-track-cue"),c=this.player_.controlBar.el_.getBoundingClientRect().height,u=this.player_.el_.getBoundingClientRect().height;a.style="",cr(a,"position","relative"),cr(a,"height",u-c+"px"),cr(a,"top","unset"),pu?cr(a,"bottom",u+"px"):cr(a,"bottom","0px"),o.length>0&&o.forEach(d=>{if(d.style.inset){const h=d.style.inset.split(" ");h.length===3&&Object.assign(d.style,{top:h[0],right:h[1],bottom:h[2],left:"unset"})}})}}updateDisplayOverlay(){if(!this.player_.videoHeight()||!te.CSS.supports("inset-inline: 10px"))return;const e=this.player_.currentWidth(),t=this.player_.currentHeight(),n=e/t,r=this.player_.videoWidth()/this.player_.videoHeight();let s=0,a=0;Math.abs(n-r)>.1&&(n>r?s=Math.round((e-t*r)/2):a=Math.round((t-e/r)/2)),cr(this.el_,"insetInline",mb(s)),cr(this.el_,"insetBlock",mb(a))}updateDisplayState(e){const t=this.player_.textTrackSettings.getValues(),n=e.activeCues;let r=n.length;for(;r--;){const s=n[r];if(!s)continue;const a=s.displayState;if(t.color&&(a.firstChild.style.color=t.color),t.textOpacity&&cr(a.firstChild,"color",cp(t.color||"#fff",t.textOpacity)),t.backgroundColor&&(a.firstChild.style.backgroundColor=t.backgroundColor),t.backgroundOpacity&&cr(a.firstChild,"backgroundColor",cp(t.backgroundColor||"#000",t.backgroundOpacity)),t.windowColor&&(t.windowOpacity?cr(a,"backgroundColor",cp(t.windowColor,t.windowOpacity)):a.style.backgroundColor=t.windowColor),t.edgeStyle&&(t.edgeStyle==="dropshadow"?a.firstChild.style.textShadow=`2px 2px 3px ${Ai}, 2px 2px 4px ${Ai}, 2px 2px 5px ${Ai}`:t.edgeStyle==="raised"?a.firstChild.style.textShadow=`1px 1px ${Ai}, 2px 2px ${Ai}, 3px 3px ${Ai}`:t.edgeStyle==="depressed"?a.firstChild.style.textShadow=`1px 1px ${pb}, 0 1px ${pb}, -1px -1px ${Ai}, 0 -1px ${Ai}`:t.edgeStyle==="uniform"&&(a.firstChild.style.textShadow=`0 0 4px ${Ai}, 0 0 4px ${Ai}, 0 0 4px ${Ai}, 0 0 4px ${Ai}`)),t.fontPercent&&t.fontPercent!==1){const o=te.parseFloat(a.style.fontSize);a.style.fontSize=o*t.fontPercent+"px",a.style.height="auto",a.style.top="auto"}t.fontFamily&&t.fontFamily!=="default"&&(t.fontFamily==="small-caps"?a.firstChild.style.fontVariant="small-caps":a.firstChild.style.fontFamily=AA[t.fontFamily])}}updateForTrack(e){if(Array.isArray(e)||(e=[e]),typeof te.WebVTT!="function"||e.every(n=>!n.activeCues))return;const t=[];for(let n=0;n<e.length;++n){const r=e[n];for(let s=0;s<r.activeCues.length;++s)t.push(r.activeCues[s])}te.WebVTT.processCues(te,t,this.el_);for(let n=0;n<e.length;++n){const r=e[n];for(let s=0;s<r.activeCues.length;++s){const a=r.activeCues[s].displayState;Bs(a,"vjs-text-track-cue","vjs-text-track-cue-"+(r.language?r.language:n)),r.language&&Va(a,"lang",r.language)}this.player_.textTrackSettings&&this.updateDisplayState(r)}}}Ce.registerComponent("TextTrackDisplay",IA);class PA extends Ce{createEl(){const e=this.player_.isAudio(),t=this.localize(e?"Audio Player":"Video Player"),n=ot("span",{className:"vjs-control-text",textContent:this.localize("{1} is loading.",[t])}),r=super.createEl("div",{className:"vjs-loading-spinner",dir:"ltr"});return r.appendChild(n),r}handleLanguagechange(){this.$(".vjs-control-text").textContent=this.localize("{1} is loading.",[this.player_.isAudio()?"Audio Player":"Video Player"])}}Ce.registerComponent("LoadingSpinner",PA);class Fn extends Iu{createEl(e,t={},n={}){e="button",t=Object.assign({className:this.buildCSSClass()},t),n=Object.assign({type:"button"},n);const r=ot(e,t,n);return this.player_.options_.experimentalSvgIcons||r.appendChild(ot("span",{className:"vjs-icon-placeholder"},{"aria-hidden":!0})),this.createControlTextEl(r),r}addChild(e,t={}){const n=this.constructor.name;return bt.warn(`Adding an actionable (user controllable) child to a Button (${n}) is not supported; use a ClickableComponent instead.`),Ce.prototype.addChild.call(this,e,t)}enable(){super.enable(),this.el_.removeAttribute("disabled")}disable(){super.disable(),this.el_.setAttribute("disabled","disabled")}handleKeyDown(e){if(e.key===" "||e.key==="Enter"){e.stopPropagation();return}super.handleKeyDown(e)}}Ce.registerComponent("Button",Fn);class gb extends Fn{constructor(e,t){super(e,t),this.mouseused_=!1,this.setIcon("play"),this.on("mousedown",n=>this.handleMouseDown(n))}buildCSSClass(){return"vjs-big-play-button"}handleClick(e){const t=this.player_.play();if(e.type==="tap"||this.mouseused_&&"clientX"in e&&"clientY"in e){lr(t),this.player_.tech(!0)&&this.player_.tech(!0).focus();return}const n=this.player_.getChild("controlBar"),r=n&&n.getChild("playToggle");if(!r){this.player_.tech(!0).focus();return}const s=()=>r.focus();hl(t)?t.then(s,()=>{}):this.setTimeout(s,1)}handleKeyDown(e){this.mouseused_=!1,super.handleKeyDown(e)}handleMouseDown(e){this.mouseused_=!0}}gb.prototype.controlText_="Play Video",Ce.registerComponent("BigPlayButton",gb);class NA extends Fn{constructor(e,t){super(e,t),this.setIcon("cancel"),this.controlText(t&&t.controlText||this.localize("Close"))}buildCSSClass(){return`vjs-close-button ${super.buildCSSClass()}`}handleClick(e){this.trigger({type:"close",bubbles:!1})}handleKeyDown(e){e.key==="Escape"?(e.preventDefault(),e.stopPropagation(),this.trigger("click")):super.handleKeyDown(e)}}Ce.registerComponent("CloseButton",NA);class vb extends Fn{constructor(e,t={}){super(e,t),t.replay=t.replay===void 0||t.replay,this.setIcon("play"),this.on(e,"play",n=>this.handlePlay(n)),this.on(e,"pause",n=>this.handlePause(n)),t.replay&&this.on(e,"ended",n=>this.handleEnded(n))}buildCSSClass(){return`vjs-play-control ${super.buildCSSClass()}`}handleClick(e){this.player_.paused()?lr(this.player_.play()):this.player_.pause()}handleSeeked(e){this.removeClass("vjs-ended"),this.player_.paused()?this.handlePause(e):this.handlePlay(e)}handlePlay(e){this.removeClass("vjs-ended","vjs-paused"),this.addClass("vjs-playing"),this.setIcon("pause"),this.controlText("Pause")}handlePause(e){this.removeClass("vjs-playing"),this.addClass("vjs-paused"),this.setIcon("play"),this.controlText("Play")}handleEnded(e){this.removeClass("vjs-playing"),this.addClass("vjs-ended"),this.setIcon("replay"),this.controlText("Replay"),this.one(this.player_,"seeked",t=>this.handleSeeked(t))}}vb.prototype.controlText_="Play",Ce.registerComponent("PlayToggle",vb);class Wa extends Ce{constructor(e,t){super(e,t),this.on(e,["timeupdate","ended","seeking"],n=>this.update(n)),this.updateTextNode_()}createEl(){const e=this.buildCSSClass(),t=super.createEl("div",{className:`${e} vjs-time-control vjs-control`}),n=ot("span",{className:"vjs-control-text",textContent:`${this.localize(this.labelText_)} `},{role:"presentation"});return t.appendChild(n),this.contentEl_=ot("span",{className:`${e}-display`},{role:"presentation"}),t.appendChild(this.contentEl_),t}dispose(){this.contentEl_=null,this.textNode_=null,super.dispose()}update(e){!this.player_.options_.enableSmoothSeeking&&e.type==="seeking"||this.updateContent(e)}updateTextNode_(e=0){e=Fs(e),this.formattedTime_!==e&&(this.formattedTime_=e,this.requestNamedAnimationFrame("TimeDisplay#updateTextNode_",()=>{if(!this.contentEl_)return;let t=this.textNode_;t&&this.contentEl_.firstChild!==t&&(t=null,bt.warn("TimeDisplay#updateTextnode_: Prevented replacement of text node element since it was no longer a child of this node. Appending a new node instead.")),this.textNode_=Ue.createTextNode(this.formattedTime_),this.textNode_&&(t?this.contentEl_.replaceChild(this.textNode_,t):this.contentEl_.appendChild(this.textNode_))}))}updateContent(e){}}Wa.prototype.labelText_="Time",Wa.prototype.controlText_="Time",Ce.registerComponent("TimeDisplay",Wa);class up extends Wa{buildCSSClass(){return"vjs-current-time"}updateContent(e){let t;this.player_.ended()?t=this.player_.duration():e&&e.target&&typeof e.target.pendingSeekTime=="function"?t=e.target.pendingSeekTime():t=this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime(),this.updateTextNode_(t)}}up.prototype.labelText_="Current Time",up.prototype.controlText_="Current Time",Ce.registerComponent("CurrentTimeDisplay",up);class dp extends Wa{constructor(e,t){super(e,t);const n=r=>this.updateContent(r);this.on(e,"durationchange",n),this.on(e,"loadstart",n),this.on(e,"loadedmetadata",n)}buildCSSClass(){return"vjs-duration"}updateContent(e){const t=this.player_.duration();this.updateTextNode_(t)}}dp.prototype.labelText_="Duration",dp.prototype.controlText_="Duration",Ce.registerComponent("DurationDisplay",dp);class OA extends Ce{createEl(){const e=super.createEl("div",{className:"vjs-time-control vjs-time-divider"},{"aria-hidden":!0}),t=super.createEl("div"),n=super.createEl("span",{textContent:"/"});return t.appendChild(n),e.appendChild(t),e}}Ce.registerComponent("TimeDivider",OA);class hp extends Wa{constructor(e,t){super(e,t),this.on(e,"durationchange",n=>this.updateContent(n))}buildCSSClass(){return"vjs-remaining-time"}createEl(){const e=super.createEl();return this.options_.displayNegative!==!1&&e.insertBefore(ot("span",{},{"aria-hidden":!0},"-"),this.contentEl_),e}updateContent(e){if(typeof this.player_.duration()!="number")return;let t;this.player_.ended()?t=0:this.player_.remainingTimeDisplay?t=this.player_.remainingTimeDisplay():t=this.player_.remainingTime(),this.updateTextNode_(t)}}hp.prototype.labelText_="Remaining Time",hp.prototype.controlText_="Remaining Time",Ce.registerComponent("RemainingTimeDisplay",hp);class MA extends Ce{constructor(e,t){super(e,t),this.updateShowing(),this.on(this.player(),"durationchange",n=>this.updateShowing(n))}createEl(){const e=super.createEl("div",{className:"vjs-live-control vjs-control"});return this.contentEl_=ot("div",{className:"vjs-live-display"},{"aria-live":"off"}),this.contentEl_.appendChild(ot("span",{className:"vjs-control-text",textContent:`${this.localize("Stream Type")} `})),this.contentEl_.appendChild(Ue.createTextNode(this.localize("LIVE"))),e.appendChild(this.contentEl_),e}dispose(){this.contentEl_=null,super.dispose()}updateShowing(e){this.player().duration()===1/0?this.show():this.hide()}}Ce.registerComponent("LiveDisplay",MA);class yb extends Fn{constructor(e,t){super(e,t),this.updateLiveEdgeStatus(),this.player_.liveTracker&&(this.updateLiveEdgeStatusHandler_=n=>this.updateLiveEdgeStatus(n),this.on(this.player_.liveTracker,"liveedgechange",this.updateLiveEdgeStatusHandler_))}createEl(){const e=super.createEl("button",{className:"vjs-seek-to-live-control vjs-control"});return this.setIcon("circle",e),this.textEl_=ot("span",{className:"vjs-seek-to-live-text",textContent:this.localize("LIVE")},{"aria-hidden":"true"}),e.appendChild(this.textEl_),e}updateLiveEdgeStatus(){!this.player_.liveTracker||this.player_.liveTracker.atLiveEdge()?(this.setAttribute("aria-disabled",!0),this.addClass("vjs-at-live-edge"),this.controlText("Seek to live, currently playing live")):(this.setAttribute("aria-disabled",!1),this.removeClass("vjs-at-live-edge"),this.controlText("Seek to live, currently behind live"))}handleClick(){this.player_.liveTracker.seekToLiveEdge()}dispose(){this.player_.liveTracker&&this.off(this.player_.liveTracker,"liveedgechange",this.updateLiveEdgeStatusHandler_),this.textEl_=null,super.dispose()}}yb.prototype.controlText_="Seek to live, currently playing live",Ce.registerComponent("SeekToLive",yb);function pl(i,e,t){return i=Number(i),Math.min(t,Math.max(e,isNaN(i)?e:i))}var RA=Object.freeze({__proto__:null,clamp:pl});class fp extends Ce{constructor(e,t){super(e,t),this.handleMouseDown_=n=>this.handleMouseDown(n),this.handleMouseUp_=n=>this.handleMouseUp(n),this.handleKeyDown_=n=>this.handleKeyDown(n),this.handleClick_=n=>this.handleClick(n),this.handleMouseMove_=n=>this.handleMouseMove(n),this.update_=n=>this.update(n),this.bar=this.getChild(this.options_.barName),this.vertical(!!this.options_.vertical),this.enable()}enabled(){return this.enabled_}enable(){this.enabled()||(this.on("mousedown",this.handleMouseDown_),this.on("touchstart",this.handleMouseDown_),this.on("keydown",this.handleKeyDown_),this.on("click",this.handleClick_),this.on(this.player_,"controlsvisible",this.update),this.playerEvent&&this.on(this.player_,this.playerEvent,this.update),this.removeClass("disabled"),this.setAttribute("tabindex",0),this.enabled_=!0)}disable(){if(!this.enabled())return;const e=this.bar.el_.ownerDocument;this.off("mousedown",this.handleMouseDown_),this.off("touchstart",this.handleMouseDown_),this.off("keydown",this.handleKeyDown_),this.off("click",this.handleClick_),this.off(this.player_,"controlsvisible",this.update_),this.off(e,"mousemove",this.handleMouseMove_),this.off(e,"mouseup",this.handleMouseUp_),this.off(e,"touchmove",this.handleMouseMove_),this.off(e,"touchend",this.handleMouseUp_),this.removeAttribute("tabindex"),this.addClass("disabled"),this.playerEvent&&this.off(this.player_,this.playerEvent,this.update),this.enabled_=!1}createEl(e,t={},n={}){return t.className=t.className+" vjs-slider",t=Object.assign({tabIndex:0},t),n=Object.assign({role:"slider","aria-valuenow":0,"aria-valuemin":0,"aria-valuemax":100},n),super.createEl(e,t,n)}handleMouseDown(e){const t=this.bar.el_.ownerDocument;e.type==="mousedown"&&e.preventDefault(),e.type==="touchstart"&&!ar&&e.preventDefault(),N1(),this.addClass("vjs-sliding"),this.trigger("slideractive"),this.on(t,"mousemove",this.handleMouseMove_),this.on(t,"mouseup",this.handleMouseUp_),this.on(t,"touchmove",this.handleMouseMove_),this.on(t,"touchend",this.handleMouseUp_),this.handleMouseMove(e,!0)}handleMouseMove(e){}handleMouseUp(e){const t=this.bar.el_.ownerDocument;O1(),this.removeClass("vjs-sliding"),this.trigger("sliderinactive"),this.off(t,"mousemove",this.handleMouseMove_),this.off(t,"mouseup",this.handleMouseUp_),this.off(t,"touchmove",this.handleMouseMove_),this.off(t,"touchend",this.handleMouseUp_),this.update()}update(){if(!this.el_||!this.bar)return;const e=this.getProgress();return e===this.progress_||(this.progress_=e,this.requestNamedAnimationFrame("Slider#update",()=>{const t=this.vertical()?"height":"width";this.bar.el().style[t]=(e*100).toFixed(2)+"%"})),e}getProgress(){return Number(pl(this.getPercent(),0,1).toFixed(4))}calculateDistance(e){const t=yu(this.el_,e);return this.vertical()?t.y:t.x}handleKeyDown(e){const t=this.options_.playerOptions.spatialNavigation,n=t&&t.enabled,r=t&&t.horizontalSeek;n?r&&e.key==="ArrowLeft"||!r&&e.key==="ArrowDown"?(e.preventDefault(),e.stopPropagation(),this.stepBack()):r&&e.key==="ArrowRight"||!r&&e.key==="ArrowUp"?(e.preventDefault(),e.stopPropagation(),this.stepForward()):(this.pendingSeekTime()&&(this.pendingSeekTime(null),this.userSeek_(this.player_.currentTime())),super.handleKeyDown(e)):e.key==="ArrowLeft"||e.key==="ArrowDown"?(e.preventDefault(),e.stopPropagation(),this.stepBack()):e.key==="ArrowUp"||e.key==="ArrowRight"?(e.preventDefault(),e.stopPropagation(),this.stepForward()):super.handleKeyDown(e)}handleClick(e){e.stopPropagation(),e.preventDefault()}vertical(e){if(e===void 0)return this.vertical_||!1;this.vertical_=!!e,this.vertical_?this.addClass("vjs-slider-vertical"):this.addClass("vjs-slider-horizontal")}}Ce.registerComponent("Slider",fp);const pp=(i,e)=>pl(i/e*100,0,100).toFixed(2)+"%";class LA extends Ce{constructor(e,t){super(e,t),this.partEls_=[],this.on(e,"progress",n=>this.update(n))}createEl(){const e=super.createEl("div",{className:"vjs-load-progress"}),t=ot("span",{className:"vjs-control-text"}),n=ot("span",{textContent:this.localize("Loaded")}),r=Ue.createTextNode(": ");return this.percentageEl_=ot("span",{className:"vjs-control-text-loaded-percentage",textContent:"0%"}),e.appendChild(t),t.appendChild(n),t.appendChild(r),t.appendChild(this.percentageEl_),e}dispose(){this.partEls_=null,this.percentageEl_=null,super.dispose()}update(e){this.requestNamedAnimationFrame("LoadProgressBar#update",()=>{const t=this.player_.liveTracker,n=this.player_.buffered(),r=t&&t.isLive()?t.seekableEnd():this.player_.duration(),s=this.player_.bufferedEnd(),a=this.partEls_,o=pp(s,r);this.percent_!==o&&(this.el_.style.width=o,as(this.percentageEl_,o),this.percent_=o);for(let c=0;c<n.length;c++){const u=n.start(c),d=n.end(c);let h=a[c];h||(h=this.el_.appendChild(ot()),a[c]=h),!(h.dataset.start===u&&h.dataset.end===d)&&(h.dataset.start=u,h.dataset.end=d,h.style.left=pp(u,s),h.style.width=pp(d-u,s))}for(let c=a.length;c>n.length;c--)this.el_.removeChild(a[c-1]);a.length=n.length})}}Ce.registerComponent("LoadProgressBar",LA);class BA extends Ce{constructor(e,t){super(e,t),this.update=or(zt(this,this.update),wi)}createEl(){return super.createEl("div",{className:"vjs-time-tooltip"},{"aria-hidden":"true"})}update(e,t,n){const r=ll(this.el_),s=ja(this.player_.el()),a=e.width*t;if(!s||!r)return;let o=e.left-s.left+a,c=e.width-a+(s.right-e.right);c||(c=e.width-a,o=a);let u=r.width/2;o<u?u+=u-o:c<u&&(u=c),u<0?u=0:u>r.width&&(u=r.width),u=Math.round(u),this.el_.style.right=`-${u}px`,this.write(n)}write(e){as(this.el_,e)}updateTime(e,t,n,r){this.requestNamedAnimationFrame("TimeTooltip#updateTime",()=>{let s;const a=this.player_.duration();if(this.player_.liveTracker&&this.player_.liveTracker.isLive()){const o=this.player_.liveTracker.liveWindow(),c=o-t*o;s=(c<1?"":"-")+Fs(c,o)}else s=Fs(n,a);this.update(e,t,s),r&&r()})}}Ce.registerComponent("TimeTooltip",BA);class mp extends Ce{constructor(e,t){super(e,t),this.setIcon("circle"),this.update=or(zt(this,this.update),wi)}createEl(){return super.createEl("div",{className:"vjs-play-progress vjs-slider-bar"},{"aria-hidden":"true"})}update(e,t,n){const r=this.getChild("timeTooltip");if(!r)return;const s=n&&n.target&&typeof n.target.pendingSeekTime=="function"?n.target.pendingSeekTime():this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime();r.updateTime(e,t,s)}}mp.prototype.options_={children:[]},!Bn&&!qi&&mp.prototype.options_.children.push("timeTooltip"),Ce.registerComponent("PlayProgressBar",mp);class bb extends Ce{constructor(e,t){super(e,t),this.update=or(zt(this,this.update),wi)}createEl(){return super.createEl("div",{className:"vjs-mouse-display"})}update(e,t){const n=t*this.player_.duration();this.getChild("timeTooltip").updateTime(e,t,n,()=>{this.el_.style.left=`${e.width*t}px`})}}bb.prototype.options_={children:["timeTooltip"]},Ce.registerComponent("MouseTimeDisplay",bb);class Pu extends fp{constructor(e,t){t=Lt(Pu.prototype.options_,t),t.children=[...t.children];const n=e.options_.disableSeekWhileScrubbingOnMobile&&(Bn||qi)||e.options_.disableSeekWhileScrubbingOnSTV;(!Bn&&!qi||n)&&t.children.splice(1,0,"mouseTimeDisplay"),super(e,t),this.shouldDisableSeekWhileScrubbing_=n,this.pendingSeekTime_=null,this.setEventHandlers_()}setEventHandlers_(){this.update_=zt(this,this.update),this.update=or(this.update_,wi),this.on(this.player_,["durationchange","timeupdate"],this.update),this.on(this.player_,["ended"],this.update_),this.player_.liveTracker&&this.on(this.player_.liveTracker,"liveedgechange",this.update),this.updateInterval=null,this.enableIntervalHandler_=e=>this.enableInterval_(e),this.disableIntervalHandler_=e=>this.disableInterval_(e),this.on(this.player_,["playing"],this.enableIntervalHandler_),this.on(this.player_,["ended","pause","waiting"],this.disableIntervalHandler_),"hidden"in Ue&&"visibilityState"in Ue&&this.on(Ue,"visibilitychange",this.toggleVisibility_)}toggleVisibility_(e){Ue.visibilityState==="hidden"?(this.cancelNamedAnimationFrame("SeekBar#update"),this.cancelNamedAnimationFrame("Slider#update"),this.disableInterval_(e)):(!this.player_.ended()&&!this.player_.paused()&&this.enableInterval_(),this.update())}enableInterval_(){this.updateInterval||(this.updateInterval=this.setInterval(this.update,wi))}disableInterval_(e){this.player_.liveTracker&&this.player_.liveTracker.isLive()&&e&&e.type!=="ended"||this.updateInterval&&(this.clearInterval(this.updateInterval),this.updateInterval=null)}createEl(){return super.createEl("div",{className:"vjs-progress-holder"},{"aria-label":this.localize("Progress Bar")})}update(e){if(Ue.visibilityState==="hidden")return;const t=super.update();return this.requestNamedAnimationFrame("SeekBar#update",()=>{const n=this.player_.ended()?this.player_.duration():this.getCurrentTime_(),r=this.player_.liveTracker;let s=this.player_.duration();r&&r.isLive()&&(s=this.player_.liveTracker.liveCurrentTime()),this.percent_!==t&&(this.el_.setAttribute("aria-valuenow",(t*100).toFixed(2)),this.percent_=t),(this.currentTime_!==n||this.duration_!==s)&&(this.el_.setAttribute("aria-valuetext",this.localize("progress bar timing: currentTime={1} duration={2}",[Fs(n,s),Fs(s,s)],"{1} of {2}")),this.currentTime_=n,this.duration_=s),this.bar&&this.bar.update(ja(this.el()),this.getProgress(),e)}),t}userSeek_(e){this.player_.liveTracker&&this.player_.liveTracker.isLive()&&this.player_.liveTracker.nextSeekedFromUser(),this.player_.currentTime(e)}getCurrentTime_(){return this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime()}pendingSeekTime(e){if(e!==void 0)if(e!==null){const t=this.player_.duration();this.pendingSeekTime_=Math.max(0,Math.min(e,t))}else this.pendingSeekTime_=null;return this.pendingSeekTime_}getPercent(){if(this.pendingSeekTime()!==null)return this.pendingSeekTime()/this.player_.duration();const e=this.getCurrentTime_();let t;const n=this.player_.liveTracker;return n&&n.isLive()?(t=(e-n.seekableStart())/n.liveWindow(),n.atLiveEdge()&&(t=1)):t=e/this.player_.duration(),t}handleMouseDown(e){cl(e)&&(e.stopPropagation(),this.videoWasPlaying=!this.player_.paused(),this.shouldDisableSeekWhileScrubbing_||this.player_.pause(),super.handleMouseDown(e))}handleMouseMove(e,t=!1){if(!cl(e)||isNaN(this.player_.duration()))return;!t&&!this.player_.scrubbing()&&this.player_.scrubbing(!0);let n;const r=this.calculateDistance(e),s=this.player_.liveTracker;if(!s||!s.isLive())n=r*this.player_.duration(),n===this.player_.duration()&&(n=n-.1);else{if(r>=.99){s.seekToLiveEdge();return}const a=s.seekableStart(),o=s.liveCurrentTime();if(n=a+r*s.liveWindow(),n>=o&&(n=o),n<=a&&(n=a+.1),n===1/0)return}this.shouldDisableSeekWhileScrubbing_?this.pendingSeekTime(n):this.userSeek_(n),this.player_.options_.enableSmoothSeeking&&this.update()}enable(){super.enable();const e=this.getChild("mouseTimeDisplay");e&&e.show()}disable(){super.disable();const e=this.getChild("mouseTimeDisplay");e&&e.hide()}handleMouseUp(e){super.handleMouseUp(e),e&&e.stopPropagation(),this.player_.scrubbing(!1),this.pendingSeekTime()!==null&&(this.userSeek_(this.pendingSeekTime()),this.pendingSeekTime(null)),this.player_.trigger({type:"timeupdate",target:this,manuallyTriggered:!0}),this.videoWasPlaying?lr(this.player_.play()):this.update_()}handlePendingSeek_(e){this.player_.paused()||this.player_.pause();const t=this.pendingSeekTime()!==null?this.pendingSeekTime():this.player_.currentTime();this.pendingSeekTime(t+e),this.player_.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})}stepForward(){this.shouldDisableSeekWhileScrubbing_?this.handlePendingSeek_(this.options().stepSeconds):this.userSeek_(this.player_.currentTime()+this.options().stepSeconds)}stepBack(){this.shouldDisableSeekWhileScrubbing_?this.handlePendingSeek_(-this.options().stepSeconds):this.userSeek_(this.player_.currentTime()-this.options().stepSeconds)}handleAction(e){this.pendingSeekTime()!==null&&(this.userSeek_(this.pendingSeekTime()),this.pendingSeekTime(null)),this.player_.paused()?this.player_.play():this.player_.pause()}handleKeyDown(e){const t=this.player_.liveTracker;if(e.key===" "||e.key==="Enter")e.preventDefault(),e.stopPropagation(),this.handleAction(e);else if(e.key==="Home")e.preventDefault(),e.stopPropagation(),this.userSeek_(0);else if(e.key==="End")e.preventDefault(),e.stopPropagation(),t&&t.isLive()?this.userSeek_(t.liveCurrentTime()):this.userSeek_(this.player_.duration());else if(/^[0-9]$/.test(e.key)){e.preventDefault(),e.stopPropagation();const n=parseInt(e.key,10)*.1;t&&t.isLive()?this.userSeek_(t.seekableStart()+t.liveWindow()*n):this.userSeek_(this.player_.duration()*n)}else e.key==="PageDown"?(e.preventDefault(),e.stopPropagation(),this.userSeek_(this.player_.currentTime()-this.options().stepSeconds*this.options().pageMultiplier)):e.key==="PageUp"?(e.preventDefault(),e.stopPropagation(),this.userSeek_(this.player_.currentTime()+this.options().stepSeconds*this.options().pageMultiplier)):super.handleKeyDown(e)}dispose(){this.disableInterval_(),this.off(this.player_,["durationchange","timeupdate"],this.update),this.off(this.player_,["ended"],this.update_),this.player_.liveTracker&&this.off(this.player_.liveTracker,"liveedgechange",this.update),this.off(this.player_,["playing"],this.enableIntervalHandler_),this.off(this.player_,["ended","pause","waiting"],this.disableIntervalHandler_),"hidden"in Ue&&"visibilityState"in Ue&&this.off(Ue,"visibilitychange",this.toggleVisibility_),super.dispose()}}Pu.prototype.options_={children:["loadProgressBar","playProgressBar"],barName:"playProgressBar",stepSeconds:5,pageMultiplier:12},Ce.registerComponent("SeekBar",Pu);class _b extends Ce{constructor(e,t){super(e,t),this.handleMouseMove=or(zt(this,this.handleMouseMove),wi),this.throttledHandleMouseSeek=or(zt(this,this.handleMouseSeek),wi),this.handleMouseUpHandler_=n=>this.handleMouseUp(n),this.handleMouseDownHandler_=n=>this.handleMouseDown(n),this.enable()}createEl(){return super.createEl("div",{className:"vjs-progress-control vjs-control"})}handleMouseMove(e){const t=this.getChild("seekBar");if(!t)return;const n=t.getChild("playProgressBar"),r=t.getChild("mouseTimeDisplay");if(!n&&!r)return;const s=t.el(),a=ll(s);let o=yu(s,e).x;o=pl(o,0,1),r&&r.update(a,o),n&&n.update(a,t.getProgress())}handleMouseSeek(e){const t=this.getChild("seekBar");t&&t.handleMouseMove(e)}enabled(){return this.enabled_}disable(){if(this.children().forEach(e=>e.disable&&e.disable()),!!this.enabled()&&(this.off(["mousedown","touchstart"],this.handleMouseDownHandler_),this.off(this.el_,["mousemove","touchmove"],this.handleMouseMove),this.removeListenersAddedOnMousedownAndTouchstart(),this.addClass("disabled"),this.enabled_=!1,this.player_.scrubbing())){const e=this.getChild("seekBar");this.player_.scrubbing(!1),e.videoWasPlaying&&lr(this.player_.play())}}enable(){this.children().forEach(e=>e.enable&&e.enable()),!this.enabled()&&(this.on(["mousedown","touchstart"],this.handleMouseDownHandler_),this.on(this.el_,["mousemove","touchmove"],this.handleMouseMove),this.removeClass("disabled"),this.enabled_=!0)}removeListenersAddedOnMousedownAndTouchstart(){const e=this.el_.ownerDocument;this.off(e,"mousemove",this.throttledHandleMouseSeek),this.off(e,"touchmove",this.throttledHandleMouseSeek),this.off(e,"mouseup",this.handleMouseUpHandler_),this.off(e,"touchend",this.handleMouseUpHandler_)}handleMouseDown(e){const t=this.el_.ownerDocument,n=this.getChild("seekBar");n&&n.handleMouseDown(e),this.on(t,"mousemove",this.throttledHandleMouseSeek),this.on(t,"touchmove",this.throttledHandleMouseSeek),this.on(t,"mouseup",this.handleMouseUpHandler_),this.on(t,"touchend",this.handleMouseUpHandler_)}handleMouseUp(e){const t=this.getChild("seekBar");t&&t.handleMouseUp(e),this.removeListenersAddedOnMousedownAndTouchstart()}}_b.prototype.options_={children:["seekBar"]},Ce.registerComponent("ProgressControl",_b);class kb extends Fn{constructor(e,t){super(e,t),this.setIcon("picture-in-picture-enter"),this.on(e,["enterpictureinpicture","leavepictureinpicture"],n=>this.handlePictureInPictureChange(n)),this.on(e,["disablepictureinpicturechanged","loadedmetadata"],n=>this.handlePictureInPictureEnabledChange(n)),this.on(e,["loadedmetadata","audioonlymodechange","audiopostermodechange"],()=>this.handlePictureInPictureAudioModeChange()),this.disable()}buildCSSClass(){return`vjs-picture-in-picture-control vjs-hidden ${super.buildCSSClass()}`}handlePictureInPictureAudioModeChange(){if(!(this.player_.currentType().substring(0,5)==="audio"||this.player_.audioPosterMode()||this.player_.audioOnlyMode())){this.show();return}this.player_.isInPictureInPicture()&&this.player_.exitPictureInPicture(),this.hide()}handlePictureInPictureEnabledChange(){Ue.pictureInPictureEnabled&&this.player_.disablePictureInPicture()===!1||this.player_.options_.enableDocumentPictureInPicture&&"documentPictureInPicture"in te?this.enable():this.disable()}handlePictureInPictureChange(e){this.player_.isInPictureInPicture()?(this.setIcon("picture-in-picture-exit"),this.controlText("Exit Picture-in-Picture")):(this.setIcon("picture-in-picture-enter"),this.controlText("Picture-in-Picture")),this.handlePictureInPictureEnabledChange()}handleClick(e){this.player_.isInPictureInPicture()?this.player_.exitPictureInPicture():this.player_.requestPictureInPicture()}show(){typeof Ue.exitPictureInPicture=="function"&&super.show()}}kb.prototype.controlText_="Picture-in-Picture",Ce.registerComponent("PictureInPictureToggle",kb);class Tb extends Fn{constructor(e,t){super(e,t),this.setIcon("fullscreen-enter"),this.on(e,"fullscreenchange",n=>this.handleFullscreenChange(n)),Ue[e.fsApi_.fullscreenEnabled]===!1&&this.disable()}buildCSSClass(){return`vjs-fullscreen-control ${super.buildCSSClass()}`}handleFullscreenChange(e){this.player_.isFullscreen()?(this.controlText("Exit Fullscreen"),this.setIcon("fullscreen-exit")):(this.controlText("Fullscreen"),this.setIcon("fullscreen-enter"))}handleClick(e){this.player_.isFullscreen()?this.player_.exitFullscreen():this.player_.requestFullscreen()}}Tb.prototype.controlText_="Fullscreen",Ce.registerComponent("FullscreenToggle",Tb);const UA=function(i,e){e.tech_&&!e.tech_.featuresVolumeControl&&i.addClass("vjs-hidden"),i.on(e,"loadstart",function(){e.tech_.featuresVolumeControl?i.removeClass("vjs-hidden"):i.addClass("vjs-hidden")})};class FA extends Ce{createEl(){const e=super.createEl("div",{className:"vjs-volume-level"});return this.setIcon("circle",e),e.appendChild(super.createEl("span",{className:"vjs-control-text"})),e}}Ce.registerComponent("VolumeLevel",FA);class VA extends Ce{constructor(e,t){super(e,t),this.update=or(zt(this,this.update),wi)}createEl(){return super.createEl("div",{className:"vjs-volume-tooltip"},{"aria-hidden":"true"})}update(e,t,n,r){if(!n){const s=ja(this.el_),a=ja(this.player_.el()),o=e.width*t;if(!a||!s)return;const c=e.left-a.left+o,u=e.width-o+(a.right-e.right);let d=s.width/2;c<d?d+=d-c:u<d&&(d=u),d<0?d=0:d>s.width&&(d=s.width),this.el_.style.right=`-${d}px`}this.write(`${r}%`)}write(e){as(this.el_,e)}updateVolume(e,t,n,r,s){this.requestNamedAnimationFrame("VolumeLevelTooltip#updateVolume",()=>{this.update(e,t,n,r.toFixed(0)),s&&s()})}}Ce.registerComponent("VolumeLevelTooltip",VA);class Sb extends Ce{constructor(e,t){super(e,t),this.update=or(zt(this,this.update),wi)}createEl(){return super.createEl("div",{className:"vjs-mouse-display"})}update(e,t,n){const r=100*t;this.getChild("volumeLevelTooltip").updateVolume(e,t,n,r,()=>{n?this.el_.style.bottom=`${e.height*t}px`:this.el_.style.left=`${e.width*t}px`})}}Sb.prototype.options_={children:["volumeLevelTooltip"]},Ce.registerComponent("MouseVolumeLevelDisplay",Sb);class Nu extends fp{constructor(e,t){super(e,t),this.on("slideractive",n=>this.updateLastVolume_(n)),this.on(e,"volumechange",n=>this.updateARIAAttributes(n)),e.ready(()=>this.updateARIAAttributes())}createEl(){return super.createEl("div",{className:"vjs-volume-bar vjs-slider-bar"},{"aria-label":this.localize("Volume Level"),"aria-live":"polite"})}handleMouseDown(e){cl(e)&&super.handleMouseDown(e)}handleMouseMove(e){const t=this.getChild("mouseVolumeLevelDisplay");if(t){const n=this.el(),r=ja(n),s=this.vertical();let a=yu(n,e);a=s?a.y:a.x,a=pl(a,0,1),t.update(r,a,s)}cl(e)&&(this.checkMuted(),this.player_.volume(this.calculateDistance(e)))}checkMuted(){this.player_.muted()&&this.player_.muted(!1)}getPercent(){return this.player_.muted()?0:this.player_.volume()}stepForward(){this.checkMuted(),this.player_.volume(this.player_.volume()+.1)}stepBack(){this.checkMuted(),this.player_.volume(this.player_.volume()-.1)}updateARIAAttributes(e){const t=this.player_.muted()?0:this.volumeAsPercentage_();this.el_.setAttribute("aria-valuenow",t),this.el_.setAttribute("aria-valuetext",t+"%")}volumeAsPercentage_(){return Math.round(this.player_.volume()*100)}updateLastVolume_(){const e=this.player_.volume();this.one("sliderinactive",()=>{this.player_.volume()===0&&this.player_.lastVolume_(e)})}}Nu.prototype.options_={children:["volumeLevel"],barName:"volumeLevel"},!Bn&&!qi&&Nu.prototype.options_.children.splice(0,0,"mouseVolumeLevelDisplay"),Nu.prototype.playerEvent="volumechange",Ce.registerComponent("VolumeBar",Nu);class Cb extends Ce{constructor(e,t={}){t.vertical=t.vertical||!1,(typeof t.volumeBar>"u"||Ra(t.volumeBar))&&(t.volumeBar=t.volumeBar||{},t.volumeBar.vertical=t.vertical),super(e,t),UA(this,e),this.throttledHandleMouseMove=or(zt(this,this.handleMouseMove),wi),this.handleMouseUpHandler_=n=>this.handleMouseUp(n),this.on("mousedown",n=>this.handleMouseDown(n)),this.on("touchstart",n=>this.handleMouseDown(n)),this.on("mousemove",n=>this.handleMouseMove(n)),this.on(this.volumeBar,["focus","slideractive"],()=>{this.volumeBar.addClass("vjs-slider-active"),this.addClass("vjs-slider-active"),this.trigger("slideractive")}),this.on(this.volumeBar,["blur","sliderinactive"],()=>{this.volumeBar.removeClass("vjs-slider-active"),this.removeClass("vjs-slider-active"),this.trigger("sliderinactive")})}createEl(){let e="vjs-volume-horizontal";return this.options_.vertical&&(e="vjs-volume-vertical"),super.createEl("div",{className:`vjs-volume-control vjs-control ${e}`})}handleMouseDown(e){const t=this.el_.ownerDocument;this.on(t,"mousemove",this.throttledHandleMouseMove),this.on(t,"touchmove",this.throttledHandleMouseMove),this.on(t,"mouseup",this.handleMouseUpHandler_),this.on(t,"touchend",this.handleMouseUpHandler_)}handleMouseUp(e){const t=this.el_.ownerDocument;this.off(t,"mousemove",this.throttledHandleMouseMove),this.off(t,"touchmove",this.throttledHandleMouseMove),this.off(t,"mouseup",this.handleMouseUpHandler_),this.off(t,"touchend",this.handleMouseUpHandler_)}handleMouseMove(e){this.volumeBar.handleMouseMove(e)}}Cb.prototype.options_={children:["volumeBar"]},Ce.registerComponent("VolumeControl",Cb);const jA=function(i,e){e.tech_&&!e.tech_.featuresMuteControl&&i.addClass("vjs-hidden"),i.on(e,"loadstart",function(){e.tech_.featuresMuteControl?i.removeClass("vjs-hidden"):i.addClass("vjs-hidden")})};class xb extends Fn{constructor(e,t){super(e,t),jA(this,e),this.on(e,["loadstart","volumechange"],n=>this.update(n))}buildCSSClass(){return`vjs-mute-control ${super.buildCSSClass()}`}handleClick(e){const t=this.player_.volume(),n=this.player_.lastVolume_();if(t===0){const r=n<.1?.1:n;this.player_.volume(r),this.player_.muted(!1)}else this.player_.muted(!this.player_.muted())}update(e){this.updateIcon_(),this.updateControlText_()}updateIcon_(){const e=this.player_.volume();let t=3;this.setIcon("volume-high"),Bn&&this.player_.tech_&&this.player_.tech_.el_&&this.player_.muted(this.player_.tech_.el_.muted),e===0||this.player_.muted()?(this.setIcon("volume-mute"),t=0):e<.33?(this.setIcon("volume-low"),t=1):e<.67&&(this.setIcon("volume-medium"),t=2),gu(this.el_,[0,1,2,3].reduce((n,r)=>n+`${r?" ":""}vjs-vol-${r}`,"")),Bs(this.el_,`vjs-vol-${t}`)}updateControlText_(){const t=this.player_.muted()||this.player_.volume()===0?"Unmute":"Mute";this.controlText()!==t&&this.controlText(t)}}xb.prototype.controlText_="Mute",Ce.registerComponent("MuteToggle",xb);class Eb extends Ce{constructor(e,t={}){typeof t.inline<"u"?t.inline=t.inline:t.inline=!0,(typeof t.volumeControl>"u"||Ra(t.volumeControl))&&(t.volumeControl=t.volumeControl||{},t.volumeControl.vertical=!t.inline),super(e,t),this.handleKeyPressHandler_=n=>this.handleKeyPress(n),this.on(e,["loadstart"],n=>this.volumePanelState_(n)),this.on(this.muteToggle,"keyup",n=>this.handleKeyPress(n)),this.on(this.volumeControl,"keyup",n=>this.handleVolumeControlKeyUp(n)),this.on("keydown",n=>this.handleKeyPress(n)),this.on("mouseover",n=>this.handleMouseOver(n)),this.on("mouseout",n=>this.handleMouseOut(n)),this.on(this.volumeControl,["slideractive"],this.sliderActive_),this.on(this.volumeControl,["sliderinactive"],this.sliderInactive_)}sliderActive_(){this.addClass("vjs-slider-active")}sliderInactive_(){this.removeClass("vjs-slider-active")}volumePanelState_(){this.volumeControl.hasClass("vjs-hidden")&&this.muteToggle.hasClass("vjs-hidden")&&this.addClass("vjs-hidden"),this.volumeControl.hasClass("vjs-hidden")&&!this.muteToggle.hasClass("vjs-hidden")&&this.addClass("vjs-mute-toggle-only")}createEl(){let e="vjs-volume-panel-horizontal";return this.options_.inline||(e="vjs-volume-panel-vertical"),super.createEl("div",{className:`vjs-volume-panel vjs-control ${e}`})}dispose(){this.handleMouseOut(),super.dispose()}handleVolumeControlKeyUp(e){e.key==="Escape"&&this.muteToggle.focus()}handleMouseOver(e){this.addClass("vjs-hover"),fi(Ue,"keyup",this.handleKeyPressHandler_)}handleMouseOut(e){this.removeClass("vjs-hover"),Un(Ue,"keyup",this.handleKeyPressHandler_)}handleKeyPress(e){e.key==="Escape"&&this.handleMouseOut()}}Eb.prototype.options_={children:["muteToggle","volumeControl"]},Ce.registerComponent("VolumePanel",Eb);class wb extends Fn{constructor(e,t){super(e,t),this.validOptions=[5,10,30],this.skipTime=this.getSkipForwardTime(),this.skipTime&&this.validOptions.includes(this.skipTime)?(this.setIcon(`forward-${this.skipTime}`),this.controlText(this.localize("Skip forward {1} seconds",[this.skipTime.toLocaleString(e.language())])),this.show()):this.hide()}getSkipForwardTime(){const e=this.options_.playerOptions;return e.controlBar&&e.controlBar.skipButtons&&e.controlBar.skipButtons.forward}buildCSSClass(){return`vjs-skip-forward-${this.getSkipForwardTime()} ${super.buildCSSClass()}`}handleClick(e){if(isNaN(this.player_.duration()))return;const t=this.player_.currentTime(),n=this.player_.liveTracker,r=n&&n.isLive()?n.seekableEnd():this.player_.duration();let s;t+this.skipTime<=r?s=t+this.skipTime:s=r,this.player_.currentTime(s)}handleLanguagechange(){this.controlText(this.localize("Skip forward {1} seconds",[this.skipTime]))}}wb.prototype.controlText_="Skip Forward",Ce.registerComponent("SkipForward",wb);class Db extends Fn{constructor(e,t){super(e,t),this.validOptions=[5,10,30],this.skipTime=this.getSkipBackwardTime(),this.skipTime&&this.validOptions.includes(this.skipTime)?(this.setIcon(`replay-${this.skipTime}`),this.controlText(this.localize("Skip backward {1} seconds",[this.skipTime.toLocaleString(e.language())])),this.show()):this.hide()}getSkipBackwardTime(){const e=this.options_.playerOptions;return e.controlBar&&e.controlBar.skipButtons&&e.controlBar.skipButtons.backward}buildCSSClass(){return`vjs-skip-backward-${this.getSkipBackwardTime()} ${super.buildCSSClass()}`}handleClick(e){const t=this.player_.currentTime(),n=this.player_.liveTracker,r=n&&n.isLive()&&n.seekableStart();let s;r&&t-this.skipTime<=r?s=r:t>=this.skipTime?s=t-this.skipTime:s=0,this.player_.currentTime(s)}handleLanguagechange(){this.controlText(this.localize("Skip backward {1} seconds",[this.skipTime]))}}Db.prototype.controlText_="Skip Backward",Ce.registerComponent("SkipBackward",Db);class Ab extends Ce{constructor(e,t){super(e,t),t&&(this.menuButton_=t.menuButton),this.focusedChild_=-1,this.on("keydown",n=>this.handleKeyDown(n)),this.boundHandleBlur_=n=>this.handleBlur(n),this.boundHandleTapClick_=n=>this.handleTapClick(n)}addEventListenerForItem(e){e instanceof Ce&&(this.on(e,"blur",this.boundHandleBlur_),this.on(e,["tap","click"],this.boundHandleTapClick_))}removeEventListenerForItem(e){e instanceof Ce&&(this.off(e,"blur",this.boundHandleBlur_),this.off(e,["tap","click"],this.boundHandleTapClick_))}removeChild(e){typeof e=="string"&&(e=this.getChild(e)),this.removeEventListenerForItem(e),super.removeChild(e)}addItem(e){const t=this.addChild(e);t&&this.addEventListenerForItem(t)}createEl(){const e=this.options_.contentElType||"ul";this.contentEl_=ot(e,{className:"vjs-menu-content"}),this.contentEl_.setAttribute("role","menu");const t=super.createEl("div",{append:this.contentEl_,className:"vjs-menu"});return t.appendChild(this.contentEl_),fi(t,"click",function(n){n.preventDefault(),n.stopImmediatePropagation()}),t}dispose(){this.contentEl_=null,this.boundHandleBlur_=null,this.boundHandleTapClick_=null,super.dispose()}handleBlur(e){const t=e.relatedTarget||Ue.activeElement;if(!this.children().some(n=>n.el()===t)){const n=this.menuButton_;n&&n.buttonPressed_&&t!==n.el().firstChild&&n.unpressButton()}}handleTapClick(e){if(this.menuButton_){this.menuButton_.unpressButton();const t=this.children();if(!Array.isArray(t))return;const n=t.filter(r=>r.el()===e.target)[0];if(!n)return;n.name()!=="CaptionSettingsMenuItem"&&this.menuButton_.focus()}}handleKeyDown(e){e.key==="ArrowLeft"||e.key==="ArrowDown"?(e.preventDefault(),e.stopPropagation(),this.stepForward()):(e.key==="ArrowRight"||e.key==="ArrowUp")&&(e.preventDefault(),e.stopPropagation(),this.stepBack())}stepForward(){let e=0;this.focusedChild_!==void 0&&(e=this.focusedChild_+1),this.focus(e)}stepBack(){let e=0;this.focusedChild_!==void 0&&(e=this.focusedChild_-1),this.focus(e)}focus(e=0){const t=this.children().slice();t.length&&t[0].hasClass("vjs-menu-title")&&t.shift(),t.length>0&&(e<0?e=0:e>=t.length&&(e=t.length-1),this.focusedChild_=e,t[e].el_.focus())}}Ce.registerComponent("Menu",Ab);class gp extends Ce{constructor(e,t={}){super(e,t),this.menuButton_=new Fn(e,t),this.menuButton_.controlText(this.controlText_),this.menuButton_.el_.setAttribute("aria-haspopup","true");const n=Fn.prototype.buildCSSClass();this.menuButton_.el_.className=this.buildCSSClass()+" "+n,this.menuButton_.removeClass("vjs-control"),this.addChild(this.menuButton_),this.update(),this.enabled_=!0;const r=s=>this.handleClick(s);this.handleMenuKeyUp_=s=>this.handleMenuKeyUp(s),this.on(this.menuButton_,"tap",r),this.on(this.menuButton_,"click",r),this.on(this.menuButton_,"keydown",s=>this.handleKeyDown(s)),this.on(this.menuButton_,"mouseenter",()=>{this.addClass("vjs-hover"),this.menu.show(),fi(Ue,"keyup",this.handleMenuKeyUp_)}),this.on("mouseleave",s=>this.handleMouseLeave(s)),this.on("keydown",s=>this.handleSubmenuKeyDown(s))}update(){const e=this.createMenu();this.menu&&(this.menu.dispose(),this.removeChild(this.menu)),this.menu=e,this.addChild(e),this.buttonPressed_=!1,this.menuButton_.el_.setAttribute("aria-expanded","false"),this.items&&this.items.length<=this.hideThreshold_?(this.hide(),this.menu.contentEl_.removeAttribute("role")):(this.show(),this.menu.contentEl_.setAttribute("role","menu"))}createMenu(){const e=new Ab(this.player_,{menuButton:this});if(this.hideThreshold_=0,this.options_.title){const t=ot("li",{className:"vjs-menu-title",textContent:rn(this.options_.title),tabIndex:-1}),n=new Ce(this.player_,{el:t});e.addItem(n)}if(this.items=this.createItems(),this.items)for(let t=0;t<this.items.length;t++)e.addItem(this.items[t]);return e}createItems(){}createEl(){return super.createEl("div",{className:this.buildWrapperCSSClass()},{})}setIcon(e){super.setIcon(e,this.menuButton_.el_)}buildWrapperCSSClass(){let e="vjs-menu-button";this.options_.inline===!0?e+="-inline":e+="-popup";const t=Fn.prototype.buildCSSClass();return`vjs-menu-button ${e} ${t} ${super.buildCSSClass()}`}buildCSSClass(){let e="vjs-menu-button";return this.options_.inline===!0?e+="-inline":e+="-popup",`vjs-menu-button ${e} ${super.buildCSSClass()}`}controlText(e,t=this.menuButton_.el()){return this.menuButton_.controlText(e,t)}dispose(){this.handleMouseLeave(),super.dispose()}handleClick(e){this.buttonPressed_?this.unpressButton():this.pressButton()}handleMouseLeave(e){this.removeClass("vjs-hover"),Un(Ue,"keyup",this.handleMenuKeyUp_)}focus(){this.menuButton_.focus()}blur(){this.menuButton_.blur()}handleKeyDown(e){e.key==="Escape"||e.key==="Tab"?(this.buttonPressed_&&this.unpressButton(),!e.key==="Tab"&&(e.preventDefault(),this.menuButton_.focus())):(e.key==="Up"||e.key==="Down"&&!(this.player_.options_.playerOptions.spatialNavigation&&this.player_.options_.playerOptions.spatialNavigation.enabled))&&(this.buttonPressed_||(e.preventDefault(),this.pressButton()))}handleMenuKeyUp(e){(e.key==="Escape"||e.key==="Tab")&&this.removeClass("vjs-hover")}handleSubmenuKeyPress(e){this.handleSubmenuKeyDown(e)}handleSubmenuKeyDown(e){(e.key==="Escape"||e.key==="Tab")&&(this.buttonPressed_&&this.unpressButton(),!e.key==="Tab"&&(e.preventDefault(),this.menuButton_.focus()))}pressButton(){if(this.enabled_){if(this.buttonPressed_=!0,this.menu.show(),this.menu.lockShowing(),this.menuButton_.el_.setAttribute("aria-expanded","true"),Bn&&w1())return;this.menu.focus()}}unpressButton(){this.enabled_&&(this.buttonPressed_=!1,this.menu.unlockShowing(),this.menu.hide(),this.menuButton_.el_.setAttribute("aria-expanded","false"))}disable(){this.unpressButton(),this.enabled_=!1,this.addClass("vjs-disabled"),this.menuButton_.disable()}enable(){this.enabled_=!0,this.removeClass("vjs-disabled"),this.menuButton_.enable()}}Ce.registerComponent("MenuButton",gp);class vp extends gp{constructor(e,t){const n=t.tracks;if(super(e,t),this.items.length<=1&&this.hide(),!n)return;const r=zt(this,this.update);n.addEventListener("removetrack",r),n.addEventListener("addtrack",r),n.addEventListener("labelchange",r),this.player_.on("ready",r),this.player_.on("dispose",function(){n.removeEventListener("removetrack",r),n.removeEventListener("addtrack",r),n.removeEventListener("labelchange",r)})}}Ce.registerComponent("TrackButton",vp);class ml extends Iu{constructor(e,t){super(e,t),this.selectable=t.selectable,this.isSelected_=t.selected||!1,this.multiSelectable=t.multiSelectable,this.selected(this.isSelected_),this.selectable?this.multiSelectable?this.el_.setAttribute("role","menuitemcheckbox"):this.el_.setAttribute("role","menuitemradio"):this.el_.setAttribute("role","menuitem")}createEl(e,t,n){this.nonIconControl=!0;const r=super.createEl("li",Object.assign({className:"vjs-menu-item",tabIndex:-1},t),n),s=ot("span",{className:"vjs-menu-item-text",textContent:this.localize(this.options_.label)});return this.player_.options_.experimentalSvgIcons?r.appendChild(s):r.replaceChild(s,r.querySelector(".vjs-icon-placeholder")),r}handleKeyDown(e){["Tab","Escape","ArrowUp","ArrowLeft","ArrowRight","ArrowDown"].includes(e.key)||super.handleKeyDown(e)}handleClick(e){this.selected(!0)}selected(e){this.selectable&&(e?(this.addClass("vjs-selected"),this.el_.setAttribute("aria-checked","true"),this.controlText(", selected"),this.isSelected_=!0):(this.removeClass("vjs-selected"),this.el_.setAttribute("aria-checked","false"),this.controlText(""),this.isSelected_=!1))}}Ce.registerComponent("MenuItem",ml);class gl extends ml{constructor(e,t){const n=t.track,r=e.textTracks();t.label=n.label||n.language||"Unknown",t.selected=n.mode==="showing",super(e,t),this.track=n,this.kinds=(t.kinds||[t.kind||this.track.kind]).filter(Boolean);const s=(...o)=>{this.handleTracksChange.apply(this,o)},a=(...o)=>{this.handleSelectedLanguageChange.apply(this,o)};if(e.on(["loadstart","texttrackchange"],s),r.addEventListener("change",s),r.addEventListener("selectedlanguagechange",a),this.on("dispose",function(){e.off(["loadstart","texttrackchange"],s),r.removeEventListener("change",s),r.removeEventListener("selectedlanguagechange",a)}),r.onchange===void 0){let o;this.on(["tap","click"],function(){if(typeof te.Event!="object")try{o=new te.Event("change")}catch{}o||(o=Ue.createEvent("Event"),o.initEvent("change",!0,!0)),r.dispatchEvent(o)})}this.handleTracksChange()}handleClick(e){const t=this.track,n=this.player_.textTracks();if(super.handleClick(e),!!n)for(let r=0;r<n.length;r++){const s=n[r];this.kinds.indexOf(s.kind)!==-1&&(s===t?s.mode!=="showing"&&(s.mode="showing"):s.mode!=="disabled"&&(s.mode="disabled"))}}handleTracksChange(e){const t=this.track.mode==="showing";t!==this.isSelected_&&this.selected(t)}handleSelectedLanguageChange(e){if(this.track.mode==="showing"){const t=this.player_.cache_.selectedLanguage;if(t&&t.enabled&&t.language===this.track.language&&t.kind!==this.track.kind)return;this.player_.cache_.selectedLanguage={enabled:!0,language:this.track.language,kind:this.track.kind}}}dispose(){this.track=null,super.dispose()}}Ce.registerComponent("TextTrackMenuItem",gl);class Ib extends gl{constructor(e,t){t.track={player:e,kind:t.kind,kinds:t.kinds,default:!1,mode:"disabled"},t.kinds||(t.kinds=[t.kind]),t.label?t.track.label=t.label:t.track.label=t.kinds.join(" and ")+" off",t.selectable=!0,t.multiSelectable=!1,super(e,t)}handleTracksChange(e){const t=this.player().textTracks();let n=!0;for(let r=0,s=t.length;r<s;r++){const a=t[r];if(this.options_.kinds.indexOf(a.kind)>-1&&a.mode==="showing"){n=!1;break}}n!==this.isSelected_&&this.selected(n)}handleSelectedLanguageChange(e){const t=this.player().textTracks();let n=!0;for(let r=0,s=t.length;r<s;r++){const a=t[r];if(["captions","descriptions","subtitles"].indexOf(a.kind)>-1&&a.mode==="showing"){n=!1;break}}n&&(this.player_.cache_.selectedLanguage={enabled:!1})}handleLanguagechange(){this.$(".vjs-menu-item-text").textContent=this.player_.localize(this.options_.label),super.handleLanguagechange()}}Ce.registerComponent("OffTextTrackMenuItem",Ib);class Ka extends vp{constructor(e,t={}){t.tracks=e.textTracks(),super(e,t)}createItems(e=[],t=gl){let n;this.label_&&(n=`${this.label_} off`),e.push(new Ib(this.player_,{kinds:this.kinds_,kind:this.kind_,label:n})),this.hideThreshold_+=1;const r=this.player_.textTracks();Array.isArray(this.kinds_)||(this.kinds_=[this.kind_]);for(let s=0;s<r.length;s++){const a=r[s];if(this.kinds_.indexOf(a.kind)>-1){const o=new t(this.player_,{track:a,kinds:this.kinds_,kind:this.kind_,selectable:!0,multiSelectable:!1});o.addClass(`vjs-${a.kind}-menu-item`),e.push(o)}}return e}}Ce.registerComponent("TextTrackButton",Ka);class Pb extends ml{constructor(e,t){const n=t.track,r=t.cue,s=e.currentTime();t.selectable=!0,t.multiSelectable=!1,t.label=r.text,t.selected=r.startTime<=s&&s<r.endTime,super(e,t),this.track=n,this.cue=r}handleClick(e){super.handleClick(),this.player_.currentTime(this.cue.startTime)}}Ce.registerComponent("ChaptersTrackMenuItem",Pb);class yp extends Ka{constructor(e,t,n){super(e,t,n),this.setIcon("chapters"),this.selectCurrentItem_=()=>{this.items.forEach(r=>{r.selected(this.track_.activeCues[0]===r.cue)})}}buildCSSClass(){return`vjs-chapters-button ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-chapters-button ${super.buildWrapperCSSClass()}`}update(e){if(e&&e.track&&e.track.kind!=="chapters")return;const t=this.findChaptersTrack();t!==this.track_?(this.setTrack(t),super.update()):(!this.items||t&&t.cues&&t.cues.length!==this.items.length)&&super.update()}setTrack(e){if(this.track_!==e){if(this.updateHandler_||(this.updateHandler_=this.update.bind(this)),this.track_){const t=this.player_.remoteTextTrackEls().getTrackElementByTrack_(this.track_);t&&t.removeEventListener("load",this.updateHandler_),this.track_.removeEventListener("cuechange",this.selectCurrentItem_),this.track_=null}if(this.track_=e,this.track_){this.track_.mode="hidden";const t=this.player_.remoteTextTrackEls().getTrackElementByTrack_(this.track_);t&&t.addEventListener("load",this.updateHandler_),this.track_.addEventListener("cuechange",this.selectCurrentItem_)}}}findChaptersTrack(){const e=this.player_.textTracks()||[];for(let t=e.length-1;t>=0;t--){const n=e[t];if(n.kind===this.kind_)return n}}getMenuCaption(){return this.track_&&this.track_.label?this.track_.label:this.localize(rn(this.kind_))}createMenu(){return this.options_.title=this.getMenuCaption(),super.createMenu()}createItems(){const e=[];if(!this.track_)return e;const t=this.track_.cues;if(!t)return e;for(let n=0,r=t.length;n<r;n++){const s=t[n],a=new Pb(this.player_,{track:this.track_,cue:s});e.push(a)}return e}}yp.prototype.kind_="chapters",yp.prototype.controlText_="Chapters",Ce.registerComponent("ChaptersButton",yp);class bp extends Ka{constructor(e,t,n){super(e,t,n),this.setIcon("audio-description");const r=e.textTracks(),s=zt(this,this.handleTracksChange);r.addEventListener("change",s),this.on("dispose",function(){r.removeEventListener("change",s)})}handleTracksChange(e){const t=this.player().textTracks();let n=!1;for(let r=0,s=t.length;r<s;r++){const a=t[r];if(a.kind!==this.kind_&&a.mode==="showing"){n=!0;break}}n?this.disable():this.enable()}buildCSSClass(){return`vjs-descriptions-button ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-descriptions-button ${super.buildWrapperCSSClass()}`}}bp.prototype.kind_="descriptions",bp.prototype.controlText_="Descriptions",Ce.registerComponent("DescriptionsButton",bp);class _p extends Ka{constructor(e,t,n){super(e,t,n),this.setIcon("subtitles")}buildCSSClass(){return`vjs-subtitles-button ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-subtitles-button ${super.buildWrapperCSSClass()}`}}_p.prototype.kind_="subtitles",_p.prototype.controlText_="Subtitles",Ce.registerComponent("SubtitlesButton",_p);class kp extends gl{constructor(e,t){t.track={player:e,kind:t.kind,label:t.kind+" settings",selectable:!1,default:!1,mode:"disabled"},t.selectable=!1,t.name="CaptionSettingsMenuItem",super(e,t),this.addClass("vjs-texttrack-settings"),this.controlText(", opens "+t.kind+" settings dialog")}handleClick(e){this.player().getChild("textTrackSettings").open()}handleLanguagechange(){this.$(".vjs-menu-item-text").textContent=this.player_.localize(this.options_.kind+" settings"),super.handleLanguagechange()}}Ce.registerComponent("CaptionSettingsMenuItem",kp);class Tp extends Ka{constructor(e,t,n){super(e,t,n),this.setIcon("captions")}buildCSSClass(){return`vjs-captions-button ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-captions-button ${super.buildWrapperCSSClass()}`}createItems(){const e=[];return!(this.player().tech_&&this.player().tech_.featuresNativeTextTracks)&&this.player().getChild("textTrackSettings")&&(e.push(new kp(this.player_,{kind:this.kind_})),this.hideThreshold_+=1),super.createItems(e)}}Tp.prototype.kind_="captions",Tp.prototype.controlText_="Captions",Ce.registerComponent("CaptionsButton",Tp);class Nb extends gl{createEl(e,t,n){const r=super.createEl(e,t,n),s=r.querySelector(".vjs-menu-item-text");return this.options_.track.kind==="captions"&&(this.player_.options_.experimentalSvgIcons?this.setIcon("captions",r):s.appendChild(ot("span",{className:"vjs-icon-placeholder"},{"aria-hidden":!0})),s.appendChild(ot("span",{className:"vjs-control-text",textContent:` ${this.localize("Captions")}`}))),r}}Ce.registerComponent("SubsCapsMenuItem",Nb);class Sp extends Ka{constructor(e,t={}){super(e,t),this.label_="subtitles",this.setIcon("subtitles"),["en","en-us","en-ca","fr-ca"].indexOf(this.player_.language_)>-1&&(this.label_="captions",this.setIcon("captions")),this.menuButton_.controlText(rn(this.label_))}buildCSSClass(){return`vjs-subs-caps-button ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-subs-caps-button ${super.buildWrapperCSSClass()}`}createItems(){let e=[];return!(this.player().tech_&&this.player().tech_.featuresNativeTextTracks)&&this.player().getChild("textTrackSettings")&&(e.push(new kp(this.player_,{kind:this.label_})),this.hideThreshold_+=1),e=super.createItems(e,Nb),e}}Sp.prototype.kinds_=["captions","subtitles"],Sp.prototype.controlText_="Subtitles",Ce.registerComponent("SubsCapsButton",Sp);class Ob extends ml{constructor(e,t){const n=t.track,r=e.audioTracks();t.label=n.label||n.language||"Unknown",t.selected=n.enabled,super(e,t),this.track=n,this.addClass(`vjs-${n.kind}-menu-item`);const s=(...a)=>{this.handleTracksChange.apply(this,a)};r.addEventListener("change",s),this.on("dispose",()=>{r.removeEventListener("change",s)})}createEl(e,t,n){const r=super.createEl(e,t,n),s=r.querySelector(".vjs-menu-item-text");return["main-desc","descriptions"].indexOf(this.options_.track.kind)>=0&&(s.appendChild(ot("span",{className:"vjs-icon-placeholder"},{"aria-hidden":!0})),s.appendChild(ot("span",{className:"vjs-control-text",textContent:" "+this.localize("Descriptions")}))),r}handleClick(e){if(super.handleClick(e),this.track.enabled=!0,this.player_.tech_.featuresNativeAudioTracks){const t=this.player_.audioTracks();for(let n=0;n<t.length;n++){const r=t[n];r!==this.track&&(r.enabled=r===this.track)}}}handleTracksChange(e){this.selected(this.track.enabled)}}Ce.registerComponent("AudioTrackMenuItem",Ob);class Mb extends vp{constructor(e,t={}){t.tracks=e.audioTracks(),super(e,t),this.setIcon("audio")}buildCSSClass(){return`vjs-audio-button ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-audio-button ${super.buildWrapperCSSClass()}`}createItems(e=[]){this.hideThreshold_=1;const t=this.player_.audioTracks();for(let n=0;n<t.length;n++){const r=t[n];e.push(new Ob(this.player_,{track:r,selectable:!0,multiSelectable:!1}))}return e}}Mb.prototype.controlText_="Audio Track",Ce.registerComponent("AudioTrackButton",Mb);class Cp extends ml{constructor(e,t){const n=t.rate,r=parseFloat(n,10);t.label=n,t.selected=r===e.playbackRate(),t.selectable=!0,t.multiSelectable=!1,super(e,t),this.label=n,this.rate=r,this.on(e,"ratechange",s=>this.update(s))}handleClick(e){super.handleClick(),this.player().playbackRate(this.rate)}update(e){this.selected(this.player().playbackRate()===this.rate)}}Cp.prototype.contentElType="button",Ce.registerComponent("PlaybackRateMenuItem",Cp);class Rb extends gp{constructor(e,t){super(e,t),this.menuButton_.el_.setAttribute("aria-describedby",this.labelElId_),this.updateVisibility(),this.updateLabel(),this.on(e,"loadstart",n=>this.updateVisibility(n)),this.on(e,"ratechange",n=>this.updateLabel(n)),this.on(e,"playbackrateschange",n=>this.handlePlaybackRateschange(n))}createEl(){const e=super.createEl();return this.labelElId_="vjs-playback-rate-value-label-"+this.id_,this.labelEl_=ot("div",{className:"vjs-playback-rate-value",id:this.labelElId_,textContent:"1x"}),e.appendChild(this.labelEl_),e}dispose(){this.labelEl_=null,super.dispose()}buildCSSClass(){return`vjs-playback-rate ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-playback-rate ${super.buildWrapperCSSClass()}`}createItems(){const e=this.playbackRates(),t=[];for(let n=e.length-1;n>=0;n--)t.push(new Cp(this.player(),{rate:e[n]+"x"}));return t}handlePlaybackRateschange(e){this.update()}playbackRates(){const e=this.player();return e.playbackRates&&e.playbackRates()||[]}playbackRateSupported(){return this.player().tech_&&this.player().tech_.featuresPlaybackRate&&this.playbackRates()&&this.playbackRates().length>0}updateVisibility(e){this.playbackRateSupported()?this.removeClass("vjs-hidden"):this.addClass("vjs-hidden")}updateLabel(e){this.playbackRateSupported()&&(this.labelEl_.textContent=this.player().playbackRate()+"x")}}Rb.prototype.controlText_="Playback Rate",Ce.registerComponent("PlaybackRateMenuButton",Rb);class Lb extends Ce{buildCSSClass(){return`vjs-spacer ${super.buildCSSClass()}`}createEl(e="div",t={},n={}){return t.className||(t.className=this.buildCSSClass()),super.createEl(e,t,n)}}Ce.registerComponent("Spacer",Lb);class $A extends Lb{buildCSSClass(){return`vjs-custom-control-spacer ${super.buildCSSClass()}`}createEl(){return super.createEl("div",{className:this.buildCSSClass(),textContent:" "})}}Ce.registerComponent("CustomControlSpacer",$A);class Bb extends Ce{createEl(){return super.createEl("div",{className:"vjs-control-bar",dir:"ltr"})}}Bb.prototype.options_={children:["playToggle","skipBackward","skipForward","volumePanel","currentTimeDisplay","timeDivider","durationDisplay","progressControl","liveDisplay","seekToLive","remainingTimeDisplay","customControlSpacer","playbackRateMenuButton","chaptersButton","descriptionsButton","subsCapsButton","audioTrackButton","pictureInPictureToggle","fullscreenToggle"]},Ce.registerComponent("ControlBar",Bb);class Ub extends qa{constructor(e,t){super(e,t),this.on(e,"error",n=>{this.open(n)})}buildCSSClass(){return`vjs-error-display ${super.buildCSSClass()}`}content(){const e=this.player().error();return e?this.localize(e.message):""}}Ub.prototype.options_=Object.assign({},qa.prototype.options_,{pauseOnOpen:!1,fillAlways:!0,temporary:!1,uncloseable:!0}),Ce.registerComponent("ErrorDisplay",Ub);class Fb extends Ce{constructor(e,t={}){super(e,t),this.el_.setAttribute("aria-labelledby",this.selectLabelledbyIds)}createEl(){return this.selectLabelledbyIds=[this.options_.legendId,this.options_.labelId].join(" ").trim(),ot("select",{id:this.options_.id},{},this.options_.SelectOptions.map(t=>{const n=(this.options_.labelId?this.options_.labelId:`vjs-track-option-${Ei()}`)+"-"+t[1].replace(/\W+/g,""),r=ot("option",{id:n,value:this.localize(t[0]),textContent:this.localize(t[1])});return r.setAttribute("aria-labelledby",`${this.selectLabelledbyIds} ${n}`),r}))}}Ce.registerComponent("TextTrackSelect",Fb);class Hs extends Ce{constructor(e,t={}){super(e,t);const n=ot("legend",{textContent:this.localize(this.options_.legendText),id:this.options_.legendId});this.el().appendChild(n);const r=this.options_.selects;for(const s of r){const a=this.options_.selectConfigs[s],o=a.className,c=a.id.replace("%s",this.options_.id_);let u=null;const d=`vjs_select_${Ei()}`;if(this.options_.type==="colors"){u=ot("span",{className:o});const b=ot("label",{id:c,className:"vjs-label",textContent:this.localize(a.label)});b.setAttribute("for",d),u.appendChild(b)}const h=new Fb(e,{SelectOptions:a.options,legendId:this.options_.legendId,id:d,labelId:c});this.addChild(h),this.options_.type==="colors"&&(u.appendChild(h.el()),this.el().appendChild(u))}}createEl(){return ot("fieldset",{className:this.options_.className})}}Ce.registerComponent("TextTrackFieldset",Hs);class Vb extends Ce{constructor(e,t={}){super(e,t);const n=this.options_.textTrackComponentid,r=new Hs(e,{id_:n,legendId:`captions-text-legend-${n}`,legendText:this.localize("Text"),className:"vjs-fg vjs-track-setting",selects:this.options_.fieldSets[0],selectConfigs:this.options_.selectConfigs,type:"colors"});this.addChild(r);const s=new Hs(e,{id_:n,legendId:`captions-background-${n}`,legendText:this.localize("Text Background"),className:"vjs-bg vjs-track-setting",selects:this.options_.fieldSets[1],selectConfigs:this.options_.selectConfigs,type:"colors"});this.addChild(s);const a=new Hs(e,{id_:n,legendId:`captions-window-${n}`,legendText:this.localize("Caption Area Background"),className:"vjs-window vjs-track-setting",selects:this.options_.fieldSets[2],selectConfigs:this.options_.selectConfigs,type:"colors"});this.addChild(a)}createEl(){return ot("div",{className:"vjs-track-settings-colors"})}}Ce.registerComponent("TextTrackSettingsColors",Vb);class jb extends Ce{constructor(e,t={}){super(e,t);const n=this.options_.textTrackComponentid,r=new Hs(e,{id_:n,legendId:`captions-font-size-${n}`,legendText:"Font Size",className:"vjs-font-percent vjs-track-setting",selects:this.options_.fieldSets[0],selectConfigs:this.options_.selectConfigs,type:"font"});this.addChild(r);const s=new Hs(e,{id_:n,legendId:`captions-edge-style-${n}`,legendText:this.localize("Text Edge Style"),className:"vjs-edge-style vjs-track-setting",selects:this.options_.fieldSets[1],selectConfigs:this.options_.selectConfigs,type:"font"});this.addChild(s);const a=new Hs(e,{id_:n,legendId:`captions-font-family-${n}`,legendText:this.localize("Font Family"),className:"vjs-font-family vjs-track-setting",selects:this.options_.fieldSets[2],selectConfigs:this.options_.selectConfigs,type:"font"});this.addChild(a)}createEl(){return ot("div",{className:"vjs-track-settings-font"})}}Ce.registerComponent("TextTrackSettingsFont",jb);class $b extends Ce{constructor(e,t={}){super(e,t);const n=new Fn(e,{controlText:this.localize("restore all settings to the default values"),className:"vjs-default-button"});n.el().classList.remove("vjs-control","vjs-button"),n.el().textContent=this.localize("Reset"),this.addChild(n);const r=this.localize("Done"),s=new Fn(e,{controlText:r,className:"vjs-done-button"});s.el().classList.remove("vjs-control","vjs-button"),s.el().textContent=r,this.addChild(s)}createEl(){return ot("div",{className:"vjs-track-settings-controls"})}}Ce.registerComponent("TrackSettingsControls",$b);const xp="vjs-text-track-settings",Hb=["#000","Black"],qb=["#00F","Blue"],zb=["#0FF","Cyan"],Gb=["#0F0","Green"],Wb=["#F0F","Magenta"],Kb=["#F00","Red"],Xb=["#FFF","White"],Yb=["#FF0","Yellow"],Ep=["1","Opaque"],wp=["0.5","Semi-Transparent"],Jb=["0","Transparent"],cs={backgroundColor:{selector:".vjs-bg-color > select",id:"captions-background-color-%s",label:"Color",options:[Hb,Xb,Kb,Gb,qb,Yb,Wb,zb],className:"vjs-bg-color"},backgroundOpacity:{selector:".vjs-bg-opacity > select",id:"captions-background-opacity-%s",label:"Opacity",options:[Ep,wp,Jb],className:"vjs-bg-opacity vjs-opacity"},color:{selector:".vjs-text-color > select",id:"captions-foreground-color-%s",label:"Color",options:[Xb,Hb,Kb,Gb,qb,Yb,Wb,zb],className:"vjs-text-color"},edgeStyle:{selector:".vjs-edge-style > select",id:"",label:"Text Edge Style",options:[["none","None"],["raised","Raised"],["depressed","Depressed"],["uniform","Uniform"],["dropshadow","Drop shadow"]]},fontFamily:{selector:".vjs-font-family > select",id:"",label:"Font Family",options:[["proportionalSansSerif","Proportional Sans-Serif"],["monospaceSansSerif","Monospace Sans-Serif"],["proportionalSerif","Proportional Serif"],["monospaceSerif","Monospace Serif"],["casual","Casual"],["script","Script"],["small-caps","Small Caps"]]},fontPercent:{selector:".vjs-font-percent > select",id:"",label:"Font Size",options:[["0.50","50%"],["0.75","75%"],["1.00","100%"],["1.25","125%"],["1.50","150%"],["1.75","175%"],["2.00","200%"],["3.00","300%"],["4.00","400%"]],default:2,parser:i=>i==="1.00"?null:Number(i)},textOpacity:{selector:".vjs-text-opacity > select",id:"captions-foreground-opacity-%s",label:"Opacity",options:[Ep,wp],className:"vjs-text-opacity vjs-opacity"},windowColor:{selector:".vjs-window-color > select",id:"captions-window-color-%s",label:"Color",className:"vjs-window-color"},windowOpacity:{selector:".vjs-window-opacity > select",id:"captions-window-opacity-%s",label:"Opacity",options:[Jb,wp,Ep],className:"vjs-window-opacity vjs-opacity"}};cs.windowColor.options=cs.backgroundColor.options;function Qb(i,e){if(e&&(i=e(i)),i&&i!=="none")return i}function HA(i,e){const t=i.options[i.options.selectedIndex].value;return Qb(t,e)}function qA(i,e,t){if(e){for(let n=0;n<i.options.length;n++)if(Qb(i.options[n].value,t)===e){i.selectedIndex=n;break}}}class zA extends qa{constructor(e,t){t.temporary=!1,super(e,t),this.updateDisplay=this.updateDisplay.bind(this),this.fill(),this.hasBeenOpened_=this.hasBeenFilled_=!0,this.renderModalComponents(e),this.endDialog=ot("p",{className:"vjs-control-text",textContent:this.localize("End of dialog window.")}),this.el().appendChild(this.endDialog),this.setDefaults(),t.persistTextTrackSettings===void 0&&(this.options_.persistTextTrackSettings=this.options_.playerOptions.persistTextTrackSettings),this.bindFunctionsToSelectsAndButtons(),this.options_.persistTextTrackSettings&&this.restoreSettings()}renderModalComponents(e){const t=new Vb(e,{textTrackComponentid:this.id_,selectConfigs:cs,fieldSets:[["color","textOpacity"],["backgroundColor","backgroundOpacity"],["windowColor","windowOpacity"]]});this.addChild(t);const n=new jb(e,{textTrackComponentid:this.id_,selectConfigs:cs,fieldSets:[["fontPercent"],["edgeStyle"],["fontFamily"]]});this.addChild(n);const r=new $b(e);this.addChild(r)}bindFunctionsToSelectsAndButtons(){this.on(this.$(".vjs-done-button"),["click","tap"],()=>{this.saveSettings(),this.close()}),this.on(this.$(".vjs-default-button"),["click","tap"],()=>{this.setDefaults(),this.updateDisplay()}),Ma(cs,e=>{this.on(this.$(e.selector),"change",this.updateDisplay)})}dispose(){this.endDialog=null,super.dispose()}label(){return this.localize("Caption Settings Dialog")}description(){return this.localize("Beginning of dialog window. Escape will cancel and close the window.")}buildCSSClass(){return super.buildCSSClass()+" vjs-text-track-settings"}getValues(){return b1(cs,(e,t,n)=>{const r=HA(this.$(t.selector),t.parser);return r!==void 0&&(e[n]=r),e},{})}setValues(e){Ma(cs,(t,n)=>{qA(this.$(t.selector),e[n],t.parser)})}setDefaults(){Ma(cs,e=>{const t=e.hasOwnProperty("default")?e.default:0;this.$(e.selector).selectedIndex=t})}restoreSettings(){let e;try{e=JSON.parse(te.localStorage.getItem(xp))}catch(t){bt.warn(t)}e&&this.setValues(e)}saveSettings(){if(!this.options_.persistTextTrackSettings)return;const e=this.getValues();try{Object.keys(e).length?te.localStorage.setItem(xp,JSON.stringify(e)):te.localStorage.removeItem(xp)}catch(t){bt.warn(t)}}updateDisplay(){const e=this.player_.getChild("textTrackDisplay");e&&e.updateDisplay()}handleLanguagechange(){this.fill(),this.renderModalComponents(this.player_),this.bindFunctionsToSelectsAndButtons()}}Ce.registerComponent("TextTrackSettings",zA);class GA extends Ce{constructor(e,t){let n=t.ResizeObserver||te.ResizeObserver;t.ResizeObserver===null&&(n=!1);const r=Lt({createEl:!n,reportTouchActivity:!1},t);super(e,r),this.ResizeObserver=t.ResizeObserver||te.ResizeObserver,this.loadListener_=null,this.resizeObserver_=null,this.debouncedHandler_=q1(()=>{this.resizeHandler()},100,!1,this),n?(this.resizeObserver_=new this.ResizeObserver(this.debouncedHandler_),this.resizeObserver_.observe(e.el())):(this.loadListener_=()=>{if(!this.el_||!this.el_.contentWindow)return;const s=this.debouncedHandler_;let a=this.unloadListener_=function(){Un(this,"resize",s),Un(this,"unload",a),a=null};fi(this.el_.contentWindow,"unload",a),fi(this.el_.contentWindow,"resize",s)},this.one("load",this.loadListener_))}createEl(){return super.createEl("iframe",{className:"vjs-resize-manager",tabIndex:-1,title:this.localize("No content")},{"aria-hidden":"true"})}resizeHandler(){!this.player_||!this.player_.trigger||this.player_.trigger("playerresize")}dispose(){this.debouncedHandler_&&this.debouncedHandler_.cancel(),this.resizeObserver_&&(this.player_.el()&&this.resizeObserver_.unobserve(this.player_.el()),this.resizeObserver_.disconnect()),this.loadListener_&&this.off("load",this.loadListener_),this.el_&&this.el_.contentWindow&&this.unloadListener_&&this.unloadListener_.call(this.el_.contentWindow),this.ResizeObserver=null,this.resizeObserver=null,this.debouncedHandler_=null,this.loadListener_=null,super.dispose()}}Ce.registerComponent("ResizeManager",GA);const WA={trackingThreshold:20,liveTolerance:15};class KA extends Ce{constructor(e,t){const n=Lt(WA,t,{createEl:!1});super(e,n),this.trackLiveHandler_=()=>this.trackLive_(),this.handlePlay_=r=>this.handlePlay(r),this.handleFirstTimeupdate_=r=>this.handleFirstTimeupdate(r),this.handleSeeked_=r=>this.handleSeeked(r),this.seekToLiveEdge_=r=>this.seekToLiveEdge(r),this.reset_(),this.on(this.player_,"durationchange",r=>this.handleDurationchange(r)),this.on(this.player_,"canplay",()=>this.toggleTracking())}trackLive_(){const e=this.player_.seekable();if(!e||!e.length)return;const t=Number(te.performance.now().toFixed(4)),n=this.lastTime_===-1?0:(t-this.lastTime_)/1e3;this.lastTime_=t,this.pastSeekEnd_=this.pastSeekEnd()+n;const r=this.liveCurrentTime(),s=this.player_.currentTime();let a=this.player_.paused()||this.seekedBehindLive_||Math.abs(r-s)>this.options_.liveTolerance;(!this.timeupdateSeen_||r===1/0)&&(a=!1),a!==this.behindLiveEdge_&&(this.behindLiveEdge_=a,this.trigger("liveedgechange"))}handleDurationchange(){this.toggleTracking()}toggleTracking(){this.player_.duration()===1/0&&this.liveWindow()>=this.options_.trackingThreshold?(this.player_.options_.liveui&&this.player_.addClass("vjs-liveui"),this.startTracking()):(this.player_.removeClass("vjs-liveui"),this.stopTracking())}startTracking(){this.isTracking()||(this.timeupdateSeen_||(this.timeupdateSeen_=this.player_.hasStarted()),this.trackingInterval_=this.setInterval(this.trackLiveHandler_,wi),this.trackLive_(),this.on(this.player_,["play","pause"],this.trackLiveHandler_),this.timeupdateSeen_?this.on(this.player_,"seeked",this.handleSeeked_):(this.one(this.player_,"play",this.handlePlay_),this.one(this.player_,"timeupdate",this.handleFirstTimeupdate_)))}handleFirstTimeupdate(){this.timeupdateSeen_=!0,this.on(this.player_,"seeked",this.handleSeeked_)}handleSeeked(){const e=Math.abs(this.liveCurrentTime()-this.player_.currentTime());this.seekedBehindLive_=this.nextSeekedFromUser_&&e>2,this.nextSeekedFromUser_=!1,this.trackLive_()}handlePlay(){this.one(this.player_,"timeupdate",this.seekToLiveEdge_)}reset_(){this.lastTime_=-1,this.pastSeekEnd_=0,this.lastSeekEnd_=-1,this.behindLiveEdge_=!0,this.timeupdateSeen_=!1,this.seekedBehindLive_=!1,this.nextSeekedFromUser_=!1,this.clearInterval(this.trackingInterval_),this.trackingInterval_=null,this.off(this.player_,["play","pause"],this.trackLiveHandler_),this.off(this.player_,"seeked",this.handleSeeked_),this.off(this.player_,"play",this.handlePlay_),this.off(this.player_,"timeupdate",this.handleFirstTimeupdate_),this.off(this.player_,"timeupdate",this.seekToLiveEdge_)}nextSeekedFromUser(){this.nextSeekedFromUser_=!0}stopTracking(){this.isTracking()&&(this.reset_(),this.trigger("liveedgechange"))}seekableEnd(){const e=this.player_.seekable(),t=[];let n=e?e.length:0;for(;n--;)t.push(e.end(n));return t.length?t.sort()[t.length-1]:1/0}seekableStart(){const e=this.player_.seekable(),t=[];let n=e?e.length:0;for(;n--;)t.push(e.start(n));return t.length?t.sort()[0]:0}liveWindow(){const e=this.liveCurrentTime();return e===1/0?0:e-this.seekableStart()}isLive(){return this.isTracking()}atLiveEdge(){return!this.behindLiveEdge()}liveCurrentTime(){return this.pastSeekEnd()+this.seekableEnd()}pastSeekEnd(){const e=this.seekableEnd();return this.lastSeekEnd_!==-1&&e!==this.lastSeekEnd_&&(this.pastSeekEnd_=0),this.lastSeekEnd_=e,this.pastSeekEnd_}behindLiveEdge(){return this.behindLiveEdge_}isTracking(){return typeof this.trackingInterval_=="number"}seekToLiveEdge(){this.seekedBehindLive_=!1,!this.atLiveEdge()&&(this.nextSeekedFromUser_=!1,this.player_.currentTime(this.liveCurrentTime()))}dispose(){this.stopTracking(),super.dispose()}}Ce.registerComponent("LiveTracker",KA);class XA extends Ce{constructor(e,t){super(e,t),this.on("statechanged",n=>this.updateDom_()),this.updateDom_()}createEl(){return this.els={title:ot("div",{className:"vjs-title-bar-title",id:`vjs-title-bar-title-${Ei()}`}),description:ot("div",{className:"vjs-title-bar-description",id:`vjs-title-bar-description-${Ei()}`})},ot("div",{className:"vjs-title-bar"},{},_1(this.els))}updateDom_(){const e=this.player_.tech_,t=e&&e.el_,n={title:"aria-labelledby",description:"aria-describedby"};["title","description"].forEach(r=>{const s=this.state[r],a=this.els[r],o=n[r];bu(a),s&&as(a,s),t&&(t.removeAttribute(o),s&&t.setAttribute(o,a.id))}),this.state.title||this.state.description?this.show():this.hide()}update(e){this.setState(e)}dispose(){const e=this.player_.tech_,t=e&&e.el_;t&&(t.removeAttribute("aria-labelledby"),t.removeAttribute("aria-describedby")),super.dispose(),this.els=null}}Ce.registerComponent("TitleBar",XA);const YA={initialDisplay:4e3,position:[],takeFocus:!1};class JA extends Fn{constructor(e,t){t=Lt(YA,t),super(e,t),this.controlText(t.controlText),this.hide(),this.on(this.player_,["useractive","userinactive"],n=>{this.removeClass("force-display")})}buildCSSClass(){return`vjs-transient-button focus-visible ${this.options_.position.map(e=>`vjs-${e}`).join(" ")}`}createEl(){const e=ot("button",{},{type:"button",class:this.buildCSSClass()},ot("span"));return this.controlTextEl_=e.querySelector("span"),e}show(){super.show(),this.addClass("force-display"),this.options_.takeFocus&&this.el().focus({preventScroll:!0}),this.forceDisplayTimeout=this.player_.setTimeout(()=>{this.removeClass("force-display")},this.options_.initialDisplay)}hide(){this.removeClass("force-display"),super.hide()}dispose(){this.player_.clearTimeout(this.forceDisplayTimeout),super.dispose()}}Ce.registerComponent("TransientButton",JA);const Dp=i=>{const e=i.el();if(e.hasAttribute("src"))return i.triggerSourceset(e.src),!0;const t=i.$$("source"),n=[];let r="";if(!t.length)return!1;for(let s=0;s<t.length;s++){const a=t[s].src;a&&n.indexOf(a)===-1&&n.push(a)}return n.length?(n.length===1&&(r=n[0]),i.triggerSourceset(r),!0):!1},QA=Object.defineProperty({},"innerHTML",{get(){return this.cloneNode(!0).innerHTML},set(i){const e=Ue.createElement(this.nodeName.toLowerCase());e.innerHTML=i;const t=Ue.createDocumentFragment();for(;e.childNodes.length;)t.appendChild(e.childNodes[0]);return this.innerText="",te.Element.prototype.appendChild.call(this,t),this.innerHTML}}),Zb=(i,e)=>{let t={};for(let n=0;n<i.length&&(t=Object.getOwnPropertyDescriptor(i[n],e),!(t&&t.set&&t.get));n++);return t.enumerable=!0,t.configurable=!0,t},ZA=i=>Zb([i.el(),te.HTMLMediaElement.prototype,te.Element.prototype,QA],"innerHTML"),e2=function(i){const e=i.el();if(e.resetSourceWatch_)return;const t={},n=ZA(i),r=s=>(...a)=>{const o=s.apply(e,a);return Dp(i),o};["append","appendChild","insertAdjacentHTML"].forEach(s=>{e[s]&&(t[s]=e[s],e[s]=r(t[s]))}),Object.defineProperty(e,"innerHTML",Lt(n,{set:r(n.set)})),e.resetSourceWatch_=()=>{e.resetSourceWatch_=null,Object.keys(t).forEach(s=>{e[s]=t[s]}),Object.defineProperty(e,"innerHTML",n)},i.one("sourceset",e.resetSourceWatch_)},eI=Object.defineProperty({},"src",{get(){return this.hasAttribute("src")?ib(te.Element.prototype.getAttribute.call(this,"src")):""},set(i){return te.Element.prototype.setAttribute.call(this,"src",i),i}}),tI=i=>Zb([i.el(),te.HTMLMediaElement.prototype,eI],"src"),nI=function(i){if(!i.featuresSourceset)return;const e=i.el();if(e.resetSourceset_)return;const t=tI(i),n=e.setAttribute,r=e.load;Object.defineProperty(e,"src",Lt(t,{set:s=>{const a=t.set.call(e,s);return i.triggerSourceset(e.src),a}})),e.setAttribute=(s,a)=>{const o=n.call(e,s,a);return/src/i.test(s)&&i.triggerSourceset(e.src),o},e.load=()=>{const s=r.call(e);return Dp(i)||(i.triggerSourceset(""),e2(i)),s},e.currentSrc?i.triggerSourceset(e.currentSrc):Dp(i)||e2(i),e.resetSourceset_=()=>{e.resetSourceset_=null,e.load=r,e.setAttribute=n,Object.defineProperty(e,"src",t),e.resetSourceWatch_&&e.resetSourceWatch_()}};class Qe extends gt{constructor(e,t){super(e,t);const n=e.source;let r=!1;if(this.featuresVideoFrameCallback=this.featuresVideoFrameCallback&&this.el_.tagName==="VIDEO",n&&(this.el_.currentSrc!==n.src||e.tag&&e.tag.initNetworkState_===3)?this.setSource(n):this.handleLateInit_(this.el_),e.enableSourceset&&this.setupSourcesetHandling_(),this.isScrubbing_=!1,this.el_.hasChildNodes()){const s=this.el_.childNodes;let a=s.length;const o=[];for(;a--;){const c=s[a];c.nodeName.toLowerCase()==="track"&&(this.featuresNativeTextTracks?(this.remoteTextTrackEls().addTrackElement_(c),this.remoteTextTracks().addTrack(c.track),this.textTracks().addTrack(c.track),!r&&!this.el_.hasAttribute("crossorigin")&&Eu(c.src)&&(r=!0)):o.push(c))}for(let c=0;c<o.length;c++)this.el_.removeChild(o[c])}this.proxyNativeTracks_(),this.featuresNativeTextTracks&&r&&bt.warn(`Text Tracks are being loaded from another origin but the crossorigin attribute isn't used.
200
+ This may prevent text tracks from loading.`),this.restoreMetadataTracksInIOSNativePlayer_(),(al||du)&&e.nativeControlsForTouch===!0&&this.setControls(!0),this.proxyWebkitFullscreen_(),this.triggerReady()}dispose(){this.el_&&this.el_.resetSourceset_&&this.el_.resetSourceset_(),Qe.disposeMediaElement(this.el_),this.options_=null,super.dispose()}setupSourcesetHandling_(){nI(this)}restoreMetadataTracksInIOSNativePlayer_(){const e=this.textTracks();let t;const n=()=>{t=[];for(let s=0;s<e.length;s++){const a=e[s];a.kind==="metadata"&&t.push({track:a,storedMode:a.mode})}};n(),e.addEventListener("change",n),this.on("dispose",()=>e.removeEventListener("change",n));const r=()=>{for(let s=0;s<t.length;s++){const a=t[s];a.track.mode==="disabled"&&a.track.mode!==a.storedMode&&(a.track.mode=a.storedMode)}e.removeEventListener("change",r)};this.on("webkitbeginfullscreen",()=>{e.removeEventListener("change",n),e.removeEventListener("change",r),e.addEventListener("change",r)}),this.on("webkitendfullscreen",()=>{e.removeEventListener("change",n),e.addEventListener("change",n),e.removeEventListener("change",r)})}overrideNative_(e,t){if(t!==this[`featuresNative${e}Tracks`])return;const n=e.toLowerCase();this[`${n}TracksListeners_`]&&Object.keys(this[`${n}TracksListeners_`]).forEach(r=>{this.el()[`${n}Tracks`].removeEventListener(r,this[`${n}TracksListeners_`][r])}),this[`featuresNative${e}Tracks`]=!t,this[`${n}TracksListeners_`]=null,this.proxyNativeTracksForType_(n)}overrideNativeAudioTracks(e){this.overrideNative_("Audio",e)}overrideNativeVideoTracks(e){this.overrideNative_("Video",e)}proxyNativeTracksForType_(e){const t=Di[e],n=this.el()[t.getterName],r=this[t.getterName]();if(!this[`featuresNative${t.capitalName}Tracks`]||!n||!n.addEventListener)return;const s={change:o=>{const c={type:"change",target:r,currentTarget:r,srcElement:r};r.trigger(c),e==="text"&&this[za.remoteText.getterName]().trigger(c)},addtrack(o){r.addTrack(o.track)},removetrack(o){r.removeTrack(o.track)}},a=function(){const o=[];for(let c=0;c<r.length;c++){let u=!1;for(let d=0;d<n.length;d++)if(n[d]===r[c]){u=!0;break}u||o.push(r[c])}for(;o.length;)r.removeTrack(o.shift())};this[t.getterName+"Listeners_"]=s,Object.keys(s).forEach(o=>{const c=s[o];n.addEventListener(o,c),this.on("dispose",u=>n.removeEventListener(o,c))}),this.on("loadstart",a),this.on("dispose",o=>this.off("loadstart",a))}proxyNativeTracks_(){Di.names.forEach(e=>{this.proxyNativeTracksForType_(e)})}createEl(){let e=this.options_.tag;if(!e||!(this.options_.playerElIngest||this.movingMediaElementInDOM)){if(e){const n=e.cloneNode(!0);e.parentNode&&e.parentNode.insertBefore(n,e),Qe.disposeMediaElement(e),e=n}else{e=Ue.createElement("video");const n=this.options_.tag&&os(this.options_.tag),r=Lt({},n);(!al||this.options_.nativeControlsForTouch!==!0)&&delete r.controls,I1(e,Object.assign(r,{id:this.options_.techId,class:"vjs-tech"}))}e.playerId=this.options_.playerId}typeof this.options_.preload<"u"&&Va(e,"preload",this.options_.preload),this.options_.disablePictureInPicture!==void 0&&(e.disablePictureInPicture=this.options_.disablePictureInPicture);const t=["loop","muted","playsinline","autoplay"];for(let n=0;n<t.length;n++){const r=t[n],s=this.options_[r];typeof s<"u"&&(s?Va(e,r,r):vu(e,r),e[r]=s)}return e}handleLateInit_(e){if(e.networkState===0||e.networkState===3)return;if(e.readyState===0){let n=!1;const r=function(){n=!0};this.on("loadstart",r);const s=function(){n||this.trigger("loadstart")};this.on("loadedmetadata",s),this.ready(function(){this.off("loadstart",r),this.off("loadedmetadata",s),n||this.trigger("loadstart")});return}const t=["loadstart"];t.push("loadedmetadata"),e.readyState>=2&&t.push("loadeddata"),e.readyState>=3&&t.push("canplay"),e.readyState>=4&&t.push("canplaythrough"),this.ready(function(){t.forEach(function(n){this.trigger(n)},this)})}setScrubbing(e){this.isScrubbing_=e}scrubbing(){return this.isScrubbing_}setCurrentTime(e){try{this.isScrubbing_&&this.el_.fastSeek&&mu?this.el_.fastSeek(e):this.el_.currentTime=e}catch(t){bt(t,"Video is not ready. (Video.js)")}}duration(){if(this.el_.duration===1/0&&qi&&ar&&this.el_.currentTime===0){const e=()=>{this.el_.currentTime>0&&(this.el_.duration===1/0&&this.trigger("durationchange"),this.off("timeupdate",e))};return this.on("timeupdate",e),NaN}return this.el_.duration||NaN}width(){return this.el_.offsetWidth}height(){return this.el_.offsetHeight}proxyWebkitFullscreen_(){if(!("webkitDisplayingFullscreen"in this.el_))return;const e=function(){this.trigger("fullscreenchange",{isFullscreen:!1}),this.el_.controls&&!this.options_.nativeControlsForTouch&&this.controls()&&(this.el_.controls=!1)},t=function(){"webkitPresentationMode"in this.el_&&this.el_.webkitPresentationMode!=="picture-in-picture"&&(this.one("webkitendfullscreen",e),this.trigger("fullscreenchange",{isFullscreen:!0,nativeIOSFullscreen:!0}))};this.on("webkitbeginfullscreen",t),this.on("dispose",()=>{this.off("webkitbeginfullscreen",t),this.off("webkitendfullscreen",e)})}supportsFullScreen(){return typeof this.el_.webkitEnterFullScreen=="function"}enterFullScreen(){const e=this.el_;if(e.paused&&e.networkState<=e.HAVE_METADATA)lr(this.el_.play()),this.setTimeout(function(){e.pause();try{e.webkitEnterFullScreen()}catch(t){this.trigger("fullscreenerror",t)}},0);else try{e.webkitEnterFullScreen()}catch(t){this.trigger("fullscreenerror",t)}}exitFullScreen(){if(!this.el_.webkitDisplayingFullscreen){this.trigger("fullscreenerror",new Error("The video is not fullscreen"));return}this.el_.webkitExitFullScreen()}requestPictureInPicture(){return this.el_.requestPictureInPicture()}requestVideoFrameCallback(e){return this.featuresVideoFrameCallback&&!this.el_.webkitKeys?this.el_.requestVideoFrameCallback(e):super.requestVideoFrameCallback(e)}cancelVideoFrameCallback(e){this.featuresVideoFrameCallback&&!this.el_.webkitKeys?this.el_.cancelVideoFrameCallback(e):super.cancelVideoFrameCallback(e)}src(e){if(e===void 0)return this.el_.src;this.setSrc(e)}addSourceElement(e,t){if(!e)return bt.error("Invalid source URL."),!1;const n={src:e};t&&(n.type=t);const r=ot("source",{},n);return this.el_.appendChild(r),!0}removeSourceElement(e){if(!e)return bt.error("Source URL is required to remove the source element."),!1;const t=this.el_.querySelectorAll("source");for(const n of t)if(n.src===e)return this.el_.removeChild(n),!0;return bt.warn(`No matching source element found with src: ${e}`),!1}reset(){Qe.resetMediaElement(this.el_)}currentSrc(){return this.currentSource_?this.currentSource_.src:this.el_.currentSrc}setControls(e){this.el_.controls=!!e}addTextTrack(e,t,n){return this.featuresNativeTextTracks?this.el_.addTextTrack(e,t,n):super.addTextTrack(e,t,n)}createRemoteTextTrack(e){if(!this.featuresNativeTextTracks)return super.createRemoteTextTrack(e);const t=Ue.createElement("track");return e.kind&&(t.kind=e.kind),e.label&&(t.label=e.label),(e.language||e.srclang)&&(t.srclang=e.language||e.srclang),e.default&&(t.default=e.default),e.id&&(t.id=e.id),e.src&&(t.src=e.src),t}addRemoteTextTrack(e,t){const n=super.addRemoteTextTrack(e,t);return this.featuresNativeTextTracks&&this.el().appendChild(n),n}removeRemoteTextTrack(e){if(super.removeRemoteTextTrack(e),this.featuresNativeTextTracks){const t=this.$$("track");let n=t.length;for(;n--;)(e===t[n]||e===t[n].track)&&this.el().removeChild(t[n])}}getVideoPlaybackQuality(){if(typeof this.el().getVideoPlaybackQuality=="function")return this.el().getVideoPlaybackQuality();const e={};return typeof this.el().webkitDroppedFrameCount<"u"&&typeof this.el().webkitDecodedFrameCount<"u"&&(e.droppedVideoFrames=this.el().webkitDroppedFrameCount,e.totalVideoFrames=this.el().webkitDecodedFrameCount),te.performance&&(e.creationTime=te.performance.now()),e}}au(Qe,"TEST_VID",function(){if(!Ua())return;const i=Ue.createElement("video"),e=Ue.createElement("track");return e.kind="captions",e.srclang="en",e.label="English",i.appendChild(e),i}),Qe.isSupported=function(){try{Qe.TEST_VID.volume=.5}catch{return!1}return!!(Qe.TEST_VID&&Qe.TEST_VID.canPlayType)},Qe.canPlayType=function(i){return Qe.TEST_VID.canPlayType(i)},Qe.canPlaySource=function(i,e){return Qe.canPlayType(i.type)},Qe.canControlVolume=function(){try{const i=Qe.TEST_VID.volume;Qe.TEST_VID.volume=i/2+.1;const e=i!==Qe.TEST_VID.volume;return e&&Bn?(te.setTimeout(()=>{Qe&&Qe.prototype&&(Qe.prototype.featuresVolumeControl=i!==Qe.TEST_VID.volume)}),!1):e}catch{return!1}},Qe.canMuteVolume=function(){try{const i=Qe.TEST_VID.muted;return Qe.TEST_VID.muted=!i,Qe.TEST_VID.muted?Va(Qe.TEST_VID,"muted","muted"):vu(Qe.TEST_VID,"muted","muted"),i!==Qe.TEST_VID.muted}catch{return!1}},Qe.canControlPlaybackRate=function(){if(qi&&ar&&ou<58)return!1;try{const i=Qe.TEST_VID.playbackRate;return Qe.TEST_VID.playbackRate=i/2+.1,i!==Qe.TEST_VID.playbackRate}catch{return!1}},Qe.canOverrideAttributes=function(){try{const i=()=>{};Object.defineProperty(Ue.createElement("video"),"src",{get:i,set:i}),Object.defineProperty(Ue.createElement("audio"),"src",{get:i,set:i}),Object.defineProperty(Ue.createElement("video"),"innerHTML",{get:i,set:i}),Object.defineProperty(Ue.createElement("audio"),"innerHTML",{get:i,set:i})}catch{return!1}return!0},Qe.supportsNativeTextTracks=function(){return mu||Bn&&ar},Qe.supportsNativeVideoTracks=function(){return!!(Qe.TEST_VID&&Qe.TEST_VID.videoTracks)},Qe.supportsNativeAudioTracks=function(){return!!(Qe.TEST_VID&&Qe.TEST_VID.audioTracks)},Qe.Events=["loadstart","suspend","abort","error","emptied","stalled","loadedmetadata","loadeddata","canplay","canplaythrough","playing","waiting","seeking","seeked","ended","durationchange","timeupdate","progress","play","pause","ratechange","resize","volumechange"],[["featuresMuteControl","canMuteVolume"],["featuresPlaybackRate","canControlPlaybackRate"],["featuresSourceset","canOverrideAttributes"],["featuresNativeTextTracks","supportsNativeTextTracks"],["featuresNativeVideoTracks","supportsNativeVideoTracks"],["featuresNativeAudioTracks","supportsNativeAudioTracks"]].forEach(function([i,e]){au(Qe.prototype,i,()=>Qe[e](),!0)}),Qe.prototype.featuresVolumeControl=Qe.canControlVolume(),Qe.prototype.movingMediaElementInDOM=!Bn,Qe.prototype.featuresFullscreenResize=!0,Qe.prototype.featuresProgressEvents=!0,Qe.prototype.featuresTimeupdateEvents=!0,Qe.prototype.featuresVideoFrameCallback=!!(Qe.TEST_VID&&Qe.TEST_VID.requestVideoFrameCallback),Qe.disposeMediaElement=function(i){if(i){for(i.parentNode&&i.parentNode.removeChild(i);i.hasChildNodes();)i.removeChild(i.firstChild);i.removeAttribute("src"),typeof i.load=="function"&&function(){try{i.load()}catch{}}()}},Qe.resetMediaElement=function(i){if(!i)return;const e=i.querySelectorAll("source");let t=e.length;for(;t--;)i.removeChild(e[t]);i.removeAttribute("src"),typeof i.load=="function"&&function(){try{i.load()}catch{}}()},["muted","defaultMuted","autoplay","controls","loop","playsinline"].forEach(function(i){Qe.prototype[i]=function(){return this.el_[i]||this.el_.hasAttribute(i)}}),["muted","defaultMuted","autoplay","loop","playsinline"].forEach(function(i){Qe.prototype["set"+rn(i)]=function(e){this.el_[i]=e,e?this.el_.setAttribute(i,i):this.el_.removeAttribute(i)}}),["paused","currentTime","buffered","volume","poster","preload","error","seeking","seekable","ended","playbackRate","defaultPlaybackRate","disablePictureInPicture","played","networkState","readyState","videoWidth","videoHeight","crossOrigin"].forEach(function(i){Qe.prototype[i]=function(){return this.el_[i]}}),["volume","src","poster","preload","playbackRate","defaultPlaybackRate","disablePictureInPicture","crossOrigin"].forEach(function(i){Qe.prototype["set"+rn(i)]=function(e){this.el_[i]=e}}),["pause","load","play"].forEach(function(i){Qe.prototype[i]=function(){return this.el_[i]()}}),gt.withSourceHandlers(Qe),Qe.nativeSourceHandler={},Qe.nativeSourceHandler.canPlayType=function(i){try{return Qe.TEST_VID.canPlayType(i)}catch{return""}},Qe.nativeSourceHandler.canHandleSource=function(i,e){if(i.type)return Qe.nativeSourceHandler.canPlayType(i.type);if(i.src){const t=ap(i.src);return Qe.nativeSourceHandler.canPlayType(`video/${t}`)}return""},Qe.nativeSourceHandler.handleSource=function(i,e,t){e.setSrc(i.src)},Qe.nativeSourceHandler.dispose=function(){},Qe.registerSourceHandler(Qe.nativeSourceHandler),gt.registerTech("Html5",Qe);const t2=["progress","abort","suspend","emptied","stalled","loadedmetadata","loadeddata","timeupdate","resize","volumechange","texttrackchange"],Ap={canplay:"CanPlay",canplaythrough:"CanPlayThrough",playing:"Playing",seeked:"Seeked"},Ip=["tiny","xsmall","small","medium","large","xlarge","huge"],Ou={};Ip.forEach(i=>{const e=i.charAt(0)==="x"?`x-${i.substring(1)}`:i;Ou[i]=`vjs-layout-${e}`});const iI={tiny:210,xsmall:320,small:425,medium:768,large:1440,xlarge:2560,huge:1/0};class At extends Ce{constructor(e,t,n){if(e.id=e.id||t.id||`vjs_video_${Ei()}`,t=Object.assign(At.getTagSettings(e),t),t.initChildren=!1,t.createEl=!1,t.evented=!1,t.reportTouchActivity=!1,!t.language){const a=e.closest("[lang]");a&&(t.language=a.getAttribute("lang"))}if(super(null,t,n),this.boundDocumentFullscreenChange_=a=>this.documentFullscreenChange_(a),this.boundFullWindowOnEscKey_=a=>this.fullWindowOnEscKey(a),this.boundUpdateStyleEl_=a=>this.updateStyleEl_(a),this.boundApplyInitTime_=a=>this.applyInitTime_(a),this.boundUpdateCurrentBreakpoint_=a=>this.updateCurrentBreakpoint_(a),this.boundHandleTechClick_=a=>this.handleTechClick_(a),this.boundHandleTechDoubleClick_=a=>this.handleTechDoubleClick_(a),this.boundHandleTechTouchStart_=a=>this.handleTechTouchStart_(a),this.boundHandleTechTouchMove_=a=>this.handleTechTouchMove_(a),this.boundHandleTechTouchEnd_=a=>this.handleTechTouchEnd_(a),this.boundHandleTechTap_=a=>this.handleTechTap_(a),this.boundUpdatePlayerHeightOnAudioOnlyMode_=a=>this.updatePlayerHeightOnAudioOnlyMode_(a),this.isFullscreen_=!1,this.log=v1(this.id_),this.fsApi_=ru,this.isPosterFromTech_=!1,this.queuedCallbacks_=[],this.isReady_=!1,this.hasStarted_=!1,this.userActive_=!1,this.debugEnabled_=!1,this.audioOnlyMode_=!1,this.audioPosterMode_=!1,this.audioOnlyCache_={controlBarHeight:null,playerHeight:null,hiddenChildren:[]},!this.options_||!this.options_.techOrder||!this.options_.techOrder.length)throw new Error("No techOrder specified. Did you overwrite videojs.options instead of just changing the properties you want to override?");if(this.tag=e,this.tagAttributes=e&&os(e),this.language(this.options_.language),t.languages){const a={};Object.getOwnPropertyNames(t.languages).forEach(function(o){a[o.toLowerCase()]=t.languages[o]}),this.languages_=a}else this.languages_=At.prototype.options_.languages;this.resetCache_(),this.poster_=t.poster||"",this.controls_=!!t.controls,e.controls=!1,e.removeAttribute("controls"),this.changingSrc_=!1,this.playCallbacks_=[],this.playTerminatedQueue_=[],e.hasAttribute("autoplay")?this.autoplay(!0):this.autoplay(this.options_.autoplay),t.plugins&&Object.keys(t.plugins).forEach(a=>{if(typeof this[a]!="function")throw new Error(`plugin "${a}" does not exist`)}),this.scrubbing_=!1,this.el_=this.createEl(),Xf(this,{eventBusKey:"el_"}),this.fsApi_.requestFullscreen&&(fi(Ue,this.fsApi_.fullscreenchange,this.boundDocumentFullscreenChange_),this.on(this.fsApi_.fullscreenchange,this.boundDocumentFullscreenChange_)),this.fluid_&&this.on(["playerreset","resize"],this.boundUpdateStyleEl_);const r=Lt(this.options_);if(t.plugins&&Object.keys(t.plugins).forEach(a=>{this[a](t.plugins[a])}),t.debug&&this.debug(!0),this.options_.playerOptions=r,this.middleware_=[],this.playbackRates(t.playbackRates),t.experimentalSvgIcons){const o=new te.DOMParser().parseFromString(EA,"image/svg+xml");if(o.querySelector("parsererror"))bt.warn("Failed to load SVG Icons. Falling back to Font Icons."),this.options_.experimentalSvgIcons=null;else{const u=o.documentElement;u.style.display="none",this.el_.appendChild(u),this.addClass("vjs-svg-icons-enabled")}}this.initChildren(),this.isAudio(e.nodeName.toLowerCase()==="audio"),this.controls()?this.addClass("vjs-controls-enabled"):this.addClass("vjs-controls-disabled"),this.el_.setAttribute("role","region"),this.isAudio()?this.el_.setAttribute("aria-label",this.localize("Audio Player")):this.el_.setAttribute("aria-label",this.localize("Video Player")),this.isAudio()&&this.addClass("vjs-audio"),t.spatialNavigation&&t.spatialNavigation.enabled&&(this.spatialNavigation=new wA(this),this.addClass("vjs-spatial-navigation-enabled")),al&&this.addClass("vjs-touch-enabled"),Bn||this.addClass("vjs-workinghover"),At.players[this.id_]=this;const s=Lf.split(".")[0];this.addClass(`vjs-v${s}`),this.userActive(!0),this.reportUserActivity(),this.one("play",a=>this.listenForUserActivity_(a)),this.on("keydown",a=>this.handleKeyDown(a)),this.on("languagechange",a=>this.handleLanguagechange(a)),this.breakpoints(this.options_.breakpoints),this.responsive(this.options_.responsive),this.on("ready",()=>{this.audioPosterMode(this.options_.audioPosterMode),this.audioOnlyMode(this.options_.audioOnlyMode)})}dispose(){this.trigger("dispose"),this.off("dispose"),Un(Ue,this.fsApi_.fullscreenchange,this.boundDocumentFullscreenChange_),Un(Ue,"keydown",this.boundFullWindowOnEscKey_),this.styleEl_&&this.styleEl_.parentNode&&(this.styleEl_.parentNode.removeChild(this.styleEl_),this.styleEl_=null),At.players[this.id_]=null,this.tag&&this.tag.player&&(this.tag.player=null),this.el_&&this.el_.player&&(this.el_.player=null),this.tech_&&(this.tech_.dispose(),this.isPosterFromTech_=!1,this.poster_=""),this.playerElIngest_&&(this.playerElIngest_=null),this.tag&&(this.tag=null),TA(this),Xn.names.forEach(e=>{const t=Xn[e],n=this[t.getterName]();n&&n.off&&n.off()}),super.dispose({restoreEl:this.options_.restoreEl})}createEl(){let e=this.tag,t,n=this.playerElIngest_=e.parentNode&&e.parentNode.hasAttribute&&e.parentNode.hasAttribute("data-vjs-player");const r=this.tag.tagName.toLowerCase()==="video-js";n?t=this.el_=e.parentNode:r||(t=this.el_=super.createEl("div"));const s=os(e);if(r){for(t=this.el_=e,e=this.tag=Ue.createElement("video");t.children.length;)e.appendChild(t.firstChild);ol(t,"video-js")||Bs(t,"video-js"),t.appendChild(e),n=this.playerElIngest_=t,Object.keys(t).forEach(c=>{try{e[c]=t[c]}catch{}})}e.setAttribute("tabindex","-1"),s.tabindex="-1",ar&&cu&&(e.setAttribute("role","application"),s.role="application"),e.removeAttribute("width"),e.removeAttribute("height"),"width"in s&&delete s.width,"height"in s&&delete s.height,Object.getOwnPropertyNames(s).forEach(function(c){r&&c==="class"||t.setAttribute(c,s[c]),r&&e.setAttribute(c,s[c])}),e.playerId=e.id,e.id+="_html5_api",e.className="vjs-tech",e.player=t.player=this,this.addClass("vjs-paused");const a=["IS_SMART_TV","IS_TIZEN","IS_WEBOS","IS_ANDROID","IS_IPAD","IS_IPHONE","IS_CHROMECAST_RECEIVER"].filter(c=>x1[c]).map(c=>"vjs-device-"+c.substring(3).toLowerCase().replace(/\_/g,"-"));if(this.addClass(...a),te.VIDEOJS_NO_DYNAMIC_STYLE!==!0){this.styleEl_=j1("vjs-styles-dimensions");const c=ls(".vjs-styles-defaults"),u=ls("head");u.insertBefore(this.styleEl_,c?c.nextSibling:u.firstChild)}this.fill_=!1,this.fluid_=!1,this.width(this.options_.width),this.height(this.options_.height),this.fill(this.options_.fill),this.fluid(this.options_.fluid),this.aspectRatio(this.options_.aspectRatio),this.crossOrigin(this.options_.crossOrigin||this.options_.crossorigin);const o=e.getElementsByTagName("a");for(let c=0;c<o.length;c++){const u=o.item(c);Bs(u,"vjs-hidden"),u.setAttribute("hidden","hidden")}return e.initNetworkState_=e.networkState,e.parentNode&&!n&&e.parentNode.insertBefore(t,e),Vf(e,t),this.children_.unshift(e),this.el_.setAttribute("lang",this.language_),this.el_.setAttribute("translate","no"),this.el_=t,t}crossOrigin(e){if(typeof e>"u")return this.techGet_("crossOrigin");if(e!==null&&e!=="anonymous"&&e!=="use-credentials"){bt.warn(`crossOrigin must be null, "anonymous" or "use-credentials", given "${e}"`);return}this.techCall_("setCrossOrigin",e),this.posterImage&&this.posterImage.crossOrigin(e)}width(e){return this.dimension("width",e)}height(e){return this.dimension("height",e)}dimension(e,t){const n=e+"_";if(t===void 0)return this[n]||0;if(t===""||t==="auto"){this[n]=void 0,this.updateStyleEl_();return}const r=parseFloat(t);if(isNaN(r)){bt.error(`Improper value "${t}" supplied for for ${e}`);return}this[n]=r,this.updateStyleEl_()}fluid(e){if(e===void 0)return!!this.fluid_;this.fluid_=!!e,Ir(this)&&this.off(["playerreset","resize"],this.boundUpdateStyleEl_),e?(this.addClass("vjs-fluid"),this.fill(!1),nA(this,()=>{this.on(["playerreset","resize"],this.boundUpdateStyleEl_)})):this.removeClass("vjs-fluid"),this.updateStyleEl_()}fill(e){if(e===void 0)return!!this.fill_;this.fill_=!!e,e?(this.addClass("vjs-fill"),this.fluid(!1)):this.removeClass("vjs-fill")}aspectRatio(e){if(e===void 0)return this.aspectRatio_;if(!/^\d+\:\d+$/.test(e))throw new Error("Improper value supplied for aspect ratio. The format should be width:height, for example 16:9.");this.aspectRatio_=e,this.fluid(!0),this.updateStyleEl_()}updateStyleEl_(){if(te.VIDEOJS_NO_DYNAMIC_STYLE===!0){const o=typeof this.width_=="number"?this.width_:this.options_.width,c=typeof this.height_=="number"?this.height_:this.options_.height,u=this.tech_&&this.tech_.el();u&&(o>=0&&(u.width=o),c>=0&&(u.height=c));return}let e,t,n,r;this.aspectRatio_!==void 0&&this.aspectRatio_!=="auto"?n=this.aspectRatio_:this.videoWidth()>0?n=this.videoWidth()+":"+this.videoHeight():n="16:9";const s=n.split(":"),a=s[1]/s[0];this.width_!==void 0?e=this.width_:this.height_!==void 0?e=this.height_/a:e=this.videoWidth()||300,this.height_!==void 0?t=this.height_:t=e*a,/^[^a-zA-Z]/.test(this.id())?r="dimensions-"+this.id():r=this.id()+"-dimensions",this.addClass(r),$1(this.styleEl_,`
201
+ .${r} {
202
+ width: ${e}px;
203
+ height: ${t}px;
204
+ }
205
+
206
+ .${r}.vjs-fluid:not(.vjs-audio-only-mode) {
207
+ padding-top: ${a*100}%;
208
+ }
209
+ `)}loadTech_(e,t){this.tech_&&this.unloadTech_();const n=rn(e),r=e.charAt(0).toLowerCase()+e.slice(1);n!=="Html5"&&this.tag&&(gt.getTech("Html5").disposeMediaElement(this.tag),this.tag.player=null,this.tag=null),this.techName_=n,this.isReady_=!1;let s=this.autoplay();(typeof this.autoplay()=="string"||this.autoplay()===!0&&this.options_.normalizeAutoplay)&&(s=!1);const a={source:t,autoplay:s,nativeControlsForTouch:this.options_.nativeControlsForTouch,playerId:this.id(),techId:`${this.id()}_${r}_api`,playsinline:this.options_.playsinline,preload:this.options_.preload,loop:this.options_.loop,disablePictureInPicture:this.options_.disablePictureInPicture,muted:this.options_.muted,poster:this.poster(),language:this.language(),playerElIngest:this.playerElIngest_||!1,"vtt.js":this.options_["vtt.js"],canOverridePoster:!!this.options_.techCanOverridePoster,enableSourceset:this.options_.enableSourceset};Xn.names.forEach(c=>{const u=Xn[c];a[u.getterName]=this[u.privateName]}),Object.assign(a,this.options_[n]),Object.assign(a,this.options_[r]),Object.assign(a,this.options_[e.toLowerCase()]),this.tag&&(a.tag=this.tag),t&&t.src===this.cache_.src&&this.cache_.currentTime>0&&(a.startTime=this.cache_.currentTime);const o=gt.getTech(e);if(!o)throw new Error(`No Tech named '${n}' exists! '${n}' should be registered using videojs.registerTech()'`);this.tech_=new o(a),this.tech_.ready(zt(this,this.handleTechReady_),!0),Zf.jsonToTextTracks(this.textTracksJson_||[],this.tech_),t2.forEach(c=>{this.on(this.tech_,c,u=>this[`handleTech${rn(c)}_`](u))}),Object.keys(Ap).forEach(c=>{this.on(this.tech_,c,u=>{if(this.tech_.playbackRate()===0&&this.tech_.seeking()){this.queuedCallbacks_.push({callback:this[`handleTech${Ap[c]}_`].bind(this),event:u});return}this[`handleTech${Ap[c]}_`](u)})}),this.on(this.tech_,"loadstart",c=>this.handleTechLoadStart_(c)),this.on(this.tech_,"sourceset",c=>this.handleTechSourceset_(c)),this.on(this.tech_,"waiting",c=>this.handleTechWaiting_(c)),this.on(this.tech_,"ended",c=>this.handleTechEnded_(c)),this.on(this.tech_,"seeking",c=>this.handleTechSeeking_(c)),this.on(this.tech_,"play",c=>this.handleTechPlay_(c)),this.on(this.tech_,"pause",c=>this.handleTechPause_(c)),this.on(this.tech_,"durationchange",c=>this.handleTechDurationChange_(c)),this.on(this.tech_,"fullscreenchange",(c,u)=>this.handleTechFullscreenChange_(c,u)),this.on(this.tech_,"fullscreenerror",(c,u)=>this.handleTechFullscreenError_(c,u)),this.on(this.tech_,"enterpictureinpicture",c=>this.handleTechEnterPictureInPicture_(c)),this.on(this.tech_,"leavepictureinpicture",c=>this.handleTechLeavePictureInPicture_(c)),this.on(this.tech_,"error",c=>this.handleTechError_(c)),this.on(this.tech_,"posterchange",c=>this.handleTechPosterChange_(c)),this.on(this.tech_,"textdata",c=>this.handleTechTextData_(c)),this.on(this.tech_,"ratechange",c=>this.handleTechRateChange_(c)),this.on(this.tech_,"loadedmetadata",this.boundUpdateStyleEl_),this.usingNativeControls(this.techGet_("controls")),this.controls()&&!this.usingNativeControls()&&this.addTechControlsListeners_(),this.tech_.el().parentNode!==this.el()&&(n!=="Html5"||!this.tag)&&Vf(this.tech_.el(),this.el()),this.tag&&(this.tag.player=null,this.tag=null)}unloadTech_(){Xn.names.forEach(e=>{const t=Xn[e];this[t.privateName]=this[t.getterName]()}),this.textTracksJson_=Zf.textTracksToJson(this.tech_),this.isReady_=!1,this.tech_.dispose(),this.tech_=!1,this.isPosterFromTech_&&(this.poster_="",this.trigger("posterchange")),this.isPosterFromTech_=!1}tech(e){return e===void 0&&bt.warn(`Using the tech directly can be dangerous. I hope you know what you're doing.
210
+ See https://github.com/videojs/video.js/issues/2617 for more info.
211
+ `),this.tech_}version(){return{"video.js":Lf}}addTechControlsListeners_(){this.removeTechControlsListeners_(),this.on(this.tech_,"click",this.boundHandleTechClick_),this.on(this.tech_,"dblclick",this.boundHandleTechDoubleClick_),this.on(this.tech_,"touchstart",this.boundHandleTechTouchStart_),this.on(this.tech_,"touchmove",this.boundHandleTechTouchMove_),this.on(this.tech_,"touchend",this.boundHandleTechTouchEnd_),this.on(this.tech_,"tap",this.boundHandleTechTap_)}removeTechControlsListeners_(){this.off(this.tech_,"tap",this.boundHandleTechTap_),this.off(this.tech_,"touchstart",this.boundHandleTechTouchStart_),this.off(this.tech_,"touchmove",this.boundHandleTechTouchMove_),this.off(this.tech_,"touchend",this.boundHandleTechTouchEnd_),this.off(this.tech_,"click",this.boundHandleTechClick_),this.off(this.tech_,"dblclick",this.boundHandleTechDoubleClick_)}handleTechReady_(){this.triggerReady(),this.cache_.volume&&this.techCall_("setVolume",this.cache_.volume),this.handleTechPosterChange_(),this.handleTechDurationChange_()}handleTechLoadStart_(){this.removeClass("vjs-ended","vjs-seeking"),this.error(null),this.handleTechDurationChange_(),this.paused()?(this.hasStarted(!1),this.trigger("loadstart")):this.trigger("loadstart"),this.manualAutoplay_(this.autoplay()===!0&&this.options_.normalizeAutoplay?"play":this.autoplay())}manualAutoplay_(e){if(!this.tech_||typeof e!="string")return;const t=()=>{const r=this.muted();this.muted(!0);const s=()=>{this.muted(r)};this.playTerminatedQueue_.push(s);const a=this.play();if(hl(a))return a.catch(o=>{throw s(),new Error(`Rejection at manualAutoplay. Restoring muted value. ${o||""}`)})};let n;if(e==="any"&&!this.muted()?(n=this.play(),hl(n)&&(n=n.catch(t))):e==="muted"&&!this.muted()?n=t():n=this.play(),!!hl(n))return n.then(()=>{this.trigger({type:"autoplay-success",autoplay:e})}).catch(()=>{this.trigger({type:"autoplay-failure",autoplay:e})})}updateSourceCaches_(e=""){let t=e,n="";typeof t!="string"&&(t=e.src,n=e.type),this.cache_.source=this.cache_.source||{},this.cache_.sources=this.cache_.sources||[],t&&!n&&(n=xA(this,t)),this.cache_.source=Lt({},e,{src:t,type:n});const r=this.cache_.sources.filter(c=>c.src&&c.src===t),s=[],a=this.$$("source"),o=[];for(let c=0;c<a.length;c++){const u=os(a[c]);s.push(u),u.src&&u.src===t&&o.push(u.src)}o.length&&!r.length?this.cache_.sources=s:r.length||(this.cache_.sources=[this.cache_.source]),this.cache_.src=t}handleTechSourceset_(e){if(!this.changingSrc_){let t=s=>this.updateSourceCaches_(s);const n=this.currentSource().src,r=e.src;n&&!/^blob:/.test(n)&&/^blob:/.test(r)&&(!this.lastSource_||this.lastSource_.tech!==r&&this.lastSource_.player!==n)&&(t=()=>{}),t(r),e.src||this.tech_.any(["sourceset","loadstart"],s=>{if(s.type==="sourceset")return;const a=this.techGet_("currentSrc");this.lastSource_.tech=a,this.updateSourceCaches_(a)})}this.lastSource_={player:this.currentSource().src,tech:e.src},this.trigger({src:e.src,type:"sourceset"})}hasStarted(e){if(e===void 0)return this.hasStarted_;e!==this.hasStarted_&&(this.hasStarted_=e,this.hasStarted_?this.addClass("vjs-has-started"):this.removeClass("vjs-has-started"))}handleTechPlay_(){this.removeClass("vjs-ended","vjs-paused"),this.addClass("vjs-playing"),this.hasStarted(!0),this.trigger("play")}handleTechRateChange_(){this.tech_.playbackRate()>0&&this.cache_.lastPlaybackRate===0&&(this.queuedCallbacks_.forEach(e=>e.callback(e.event)),this.queuedCallbacks_=[]),this.cache_.lastPlaybackRate=this.tech_.playbackRate(),this.trigger("ratechange")}handleTechWaiting_(){this.addClass("vjs-waiting"),this.trigger("waiting");const e=this.currentTime(),t=()=>{e!==this.currentTime()&&(this.removeClass("vjs-waiting"),this.off("timeupdate",t))};this.on("timeupdate",t)}handleTechCanPlay_(){this.removeClass("vjs-waiting"),this.trigger("canplay")}handleTechCanPlayThrough_(){this.removeClass("vjs-waiting"),this.trigger("canplaythrough")}handleTechPlaying_(){this.removeClass("vjs-waiting"),this.trigger("playing")}handleTechSeeking_(){this.addClass("vjs-seeking"),this.trigger("seeking")}handleTechSeeked_(){this.removeClass("vjs-seeking","vjs-ended"),this.trigger("seeked")}handleTechPause_(){this.removeClass("vjs-playing"),this.addClass("vjs-paused"),this.trigger("pause")}handleTechEnded_(){this.addClass("vjs-ended"),this.removeClass("vjs-waiting"),this.options_.loop?(this.currentTime(0),this.play()):this.paused()||this.pause(),this.trigger("ended")}handleTechDurationChange_(){this.duration(this.techGet_("duration"))}handleTechClick_(e){this.controls_&&(this.options_===void 0||this.options_.userActions===void 0||this.options_.userActions.click===void 0||this.options_.userActions.click!==!1)&&(this.options_!==void 0&&this.options_.userActions!==void 0&&typeof this.options_.userActions.click=="function"?this.options_.userActions.click.call(this,e):this.paused()?lr(this.play()):this.pause())}handleTechDoubleClick_(e){if(!this.controls_)return;Array.prototype.some.call(this.$$(".vjs-control-bar, .vjs-modal-dialog"),n=>n.contains(e.target))||(this.options_===void 0||this.options_.userActions===void 0||this.options_.userActions.doubleClick===void 0||this.options_.userActions.doubleClick!==!1)&&(this.options_!==void 0&&this.options_.userActions!==void 0&&typeof this.options_.userActions.doubleClick=="function"?this.options_.userActions.doubleClick.call(this,e):this.isInPictureInPicture()&&!Ue.pictureInPictureElement?this.exitPictureInPicture():this.isFullscreen()?this.exitFullscreen():this.requestFullscreen())}handleTechTap_(){this.userActive(!this.userActive())}handleTechTouchStart_(){this.userWasActive=this.userActive()}handleTechTouchMove_(){this.userWasActive&&this.reportUserActivity()}handleTechTouchEnd_(e){e.cancelable&&e.preventDefault()}toggleFullscreenClass_(){this.isFullscreen()?this.addClass("vjs-fullscreen"):this.removeClass("vjs-fullscreen")}documentFullscreenChange_(e){const t=e.target.player;if(t&&t!==this)return;const n=this.el();let r=Ue[this.fsApi_.fullscreenElement]===n;!r&&n.matches&&(r=n.matches(":"+this.fsApi_.fullscreen)),this.isFullscreen(r)}handleTechFullscreenChange_(e,t){t&&(t.nativeIOSFullscreen&&(this.addClass("vjs-ios-native-fs"),this.tech_.one("webkitendfullscreen",()=>{this.removeClass("vjs-ios-native-fs")})),this.isFullscreen(t.isFullscreen))}handleTechFullscreenError_(e,t){this.trigger("fullscreenerror",t)}togglePictureInPictureClass_(){this.isInPictureInPicture()?this.addClass("vjs-picture-in-picture"):this.removeClass("vjs-picture-in-picture")}handleTechEnterPictureInPicture_(e){this.isInPictureInPicture(!0)}handleTechLeavePictureInPicture_(e){this.isInPictureInPicture(!1)}handleTechError_(){const e=this.tech_.error();e&&this.error(e)}handleTechTextData_(){let e=null;arguments.length>1&&(e=arguments[1]),this.trigger("textdata",e)}getCache(){return this.cache_}resetCache_(){this.cache_={currentTime:0,initTime:0,inactivityTimeout:this.options_.inactivityTimeout,duration:NaN,lastVolume:1,lastPlaybackRate:this.defaultPlaybackRate(),media:null,src:"",source:{},sources:[],playbackRates:[],volume:1}}techCall_(e,t){this.ready(function(){if(e in _A)return yA(this.middleware_,this.tech_,e,t);if(e in cb)return lb(this.middleware_,this.tech_,e,t);try{this.tech_&&this.tech_[e](t)}catch(n){throw bt(n),n}},!0)}techGet_(e){if(!(!this.tech_||!this.tech_.isReady_)){if(e in bA)return vA(this.middleware_,this.tech_,e);if(e in cb)return lb(this.middleware_,this.tech_,e);try{return this.tech_[e]()}catch(t){throw this.tech_[e]===void 0?(bt(`Video.js: ${e} method not defined for ${this.techName_} playback technology.`,t),t):t.name==="TypeError"?(bt(`Video.js: ${e} unavailable on ${this.techName_} playback technology element.`,t),this.tech_.isReady_=!1,t):(bt(t),t)}}}play(){return new Promise(e=>{this.play_(e)})}play_(e=lr){this.playCallbacks_.push(e);const t=!!(!this.changingSrc_&&(this.src()||this.currentSrc())),n=!!(mu||Bn);if(this.waitToPlay_&&(this.off(["ready","loadstart"],this.waitToPlay_),this.waitToPlay_=null),!this.isReady_||!t){this.waitToPlay_=a=>{this.play_()},this.one(["ready","loadstart"],this.waitToPlay_),!t&&n&&this.load();return}const r=this.techGet_("play");n&&this.hasClass("vjs-ended")&&this.resetProgressBar_(),r===null?this.runPlayTerminatedQueue_():this.runPlayCallbacks_(r)}runPlayTerminatedQueue_(){const e=this.playTerminatedQueue_.slice(0);this.playTerminatedQueue_=[],e.forEach(function(t){t()})}runPlayCallbacks_(e){const t=this.playCallbacks_.slice(0);this.playCallbacks_=[],this.playTerminatedQueue_=[],t.forEach(function(n){n(e)})}pause(){this.techCall_("pause")}paused(){return this.techGet_("paused")!==!1}played(){return this.techGet_("played")||zi(0,0)}scrubbing(e){if(typeof e>"u")return this.scrubbing_;this.scrubbing_=!!e,this.techCall_("setScrubbing",this.scrubbing_),e?this.addClass("vjs-scrubbing"):this.removeClass("vjs-scrubbing")}currentTime(e){if(e===void 0)return this.cache_.currentTime=this.techGet_("currentTime")||0,this.cache_.currentTime;if(e<0&&(e=0),!this.isReady_||this.changingSrc_||!this.tech_||!this.tech_.isReady_){this.cache_.initTime=e,this.off("canplay",this.boundApplyInitTime_),this.one("canplay",this.boundApplyInitTime_);return}this.techCall_("setCurrentTime",e),this.cache_.initTime=0,isFinite(e)&&(this.cache_.currentTime=Number(e))}applyInitTime_(){this.currentTime(this.cache_.initTime)}duration(e){if(e===void 0)return this.cache_.duration!==void 0?this.cache_.duration:NaN;e=parseFloat(e),e<0&&(e=1/0),e!==this.cache_.duration&&(this.cache_.duration=e,e===1/0?this.addClass("vjs-live"):this.removeClass("vjs-live"),isNaN(e)||this.trigger("durationchange"))}remainingTime(){return this.duration()-this.currentTime()}remainingTimeDisplay(){return Math.floor(this.duration())-Math.floor(this.currentTime())}buffered(){let e=this.techGet_("buffered");return(!e||!e.length)&&(e=zi(0,0)),e}seekable(){let e=this.techGet_("seekable");return(!e||!e.length)&&(e=zi(0,0)),e}seeking(){return this.techGet_("seeking")}ended(){return this.techGet_("ended")}networkState(){return this.techGet_("networkState")}readyState(){return this.techGet_("readyState")}bufferedPercent(){return Z1(this.buffered(),this.duration())}bufferedEnd(){const e=this.buffered(),t=this.duration();let n=e.end(e.length-1);return n>t&&(n=t),n}volume(e){let t;if(e!==void 0){t=Math.max(0,Math.min(1,e)),this.cache_.volume=t,this.techCall_("setVolume",t),t>0&&this.lastVolume_(t);return}return t=parseFloat(this.techGet_("volume")),isNaN(t)?1:t}muted(e){if(e!==void 0){this.techCall_("setMuted",e);return}return this.techGet_("muted")||!1}defaultMuted(e){return e!==void 0&&this.techCall_("setDefaultMuted",e),this.techGet_("defaultMuted")||!1}lastVolume_(e){if(e!==void 0&&e!==0){this.cache_.lastVolume=e;return}return this.cache_.lastVolume}supportsFullScreen(){return this.techGet_("supportsFullScreen")||!1}isFullscreen(e){if(e!==void 0){const t=this.isFullscreen_;this.isFullscreen_=!!e,this.isFullscreen_!==t&&this.fsApi_.prefixed&&this.trigger("fullscreenchange"),this.toggleFullscreenClass_();return}return this.isFullscreen_}requestFullscreen(e){this.isInPictureInPicture()&&this.exitPictureInPicture();const t=this;return new Promise((n,r)=>{function s(){t.off("fullscreenerror",o),t.off("fullscreenchange",a)}function a(){s(),n()}function o(u,d){s(),r(d)}t.one("fullscreenchange",a),t.one("fullscreenerror",o);const c=t.requestFullscreenHelper_(e);c&&(c.then(s,s),c.then(n,r))})}requestFullscreenHelper_(e){let t;if(this.fsApi_.prefixed||(t=this.options_.fullscreen&&this.options_.fullscreen.options||{},e!==void 0&&(t=e)),this.fsApi_.requestFullscreen){const n=this.el_[this.fsApi_.requestFullscreen](t);return n&&n.then(()=>this.isFullscreen(!0),()=>this.isFullscreen(!1)),n}else this.tech_.supportsFullScreen()&&!this.options_.preferFullWindow?this.techCall_("enterFullScreen"):this.enterFullWindow()}exitFullscreen(){const e=this;return new Promise((t,n)=>{function r(){e.off("fullscreenerror",a),e.off("fullscreenchange",s)}function s(){r(),t()}function a(c,u){r(),n(u)}e.one("fullscreenchange",s),e.one("fullscreenerror",a);const o=e.exitFullscreenHelper_();o&&(o.then(r,r),o.then(t,n))})}exitFullscreenHelper_(){if(this.fsApi_.requestFullscreen){const e=Ue[this.fsApi_.exitFullscreen]();return e&&lr(e.then(()=>this.isFullscreen(!1))),e}else this.tech_.supportsFullScreen()&&!this.options_.preferFullWindow?this.techCall_("exitFullScreen"):this.exitFullWindow()}enterFullWindow(){this.isFullscreen(!0),this.isFullWindow=!0,this.docOrigOverflow=Ue.documentElement.style.overflow,fi(Ue,"keydown",this.boundFullWindowOnEscKey_),Ue.documentElement.style.overflow="hidden",Bs(Ue.body,"vjs-full-window"),this.trigger("enterFullWindow")}fullWindowOnEscKey(e){e.key==="Escape"&&this.isFullscreen()===!0&&(this.isFullWindow?this.exitFullWindow():this.exitFullscreen())}exitFullWindow(){this.isFullscreen(!1),this.isFullWindow=!1,Un(Ue,"keydown",this.boundFullWindowOnEscKey_),Ue.documentElement.style.overflow=this.docOrigOverflow,gu(Ue.body,"vjs-full-window"),this.trigger("exitFullWindow")}disablePictureInPicture(e){if(e===void 0)return this.techGet_("disablePictureInPicture");this.techCall_("setDisablePictureInPicture",e),this.options_.disablePictureInPicture=e,this.trigger("disablepictureinpicturechanged")}isInPictureInPicture(e){if(e!==void 0){this.isInPictureInPicture_=!!e,this.togglePictureInPictureClass_();return}return!!this.isInPictureInPicture_}requestPictureInPicture(){if(this.options_.enableDocumentPictureInPicture&&te.documentPictureInPicture){const e=Ue.createElement(this.el().tagName);return e.classList=this.el().classList,e.classList.add("vjs-pip-container"),this.posterImage&&e.appendChild(this.posterImage.el().cloneNode(!0)),this.titleBar&&e.appendChild(this.titleBar.el().cloneNode(!0)),e.appendChild(ot("p",{className:"vjs-pip-text"},{},this.localize("Playing in picture-in-picture"))),te.documentPictureInPicture.requestWindow({width:this.videoWidth(),height:this.videoHeight()}).then(t=>(U1(t),this.el_.parentNode.insertBefore(e,this.el_),t.document.body.appendChild(this.el_),t.document.body.classList.add("vjs-pip-window"),this.player_.isInPictureInPicture(!0),this.player_.trigger({type:"enterpictureinpicture",pipWindow:t}),t.addEventListener("pagehide",n=>{const r=n.target.querySelector(".video-js");e.parentNode.replaceChild(r,e),this.player_.isInPictureInPicture(!1),this.player_.trigger("leavepictureinpicture")}),t))}return"pictureInPictureEnabled"in Ue&&this.disablePictureInPicture()===!1?this.techGet_("requestPictureInPicture"):Promise.reject("No PiP mode is available")}exitPictureInPicture(){if(te.documentPictureInPicture&&te.documentPictureInPicture.window)return te.documentPictureInPicture.window.close(),Promise.resolve();if("pictureInPictureEnabled"in Ue)return Ue.exitPictureInPicture()}handleKeyDown(e){const{userActions:t}=this.options_;!t||!t.hotkeys||(r=>{const s=r.tagName.toLowerCase();if(r.isContentEditable)return!0;const a=["button","checkbox","hidden","radio","reset","submit"];return s==="input"?a.indexOf(r.type)===-1:["textarea"].indexOf(s)!==-1})(this.el_.ownerDocument.activeElement)||(typeof t.hotkeys=="function"?t.hotkeys.call(this,e):this.handleHotkeys(e))}handleHotkeys(e){const t=this.options_.userActions?this.options_.userActions.hotkeys:{},{fullscreenKey:n=a=>e.key.toLowerCase()==="f",muteKey:r=a=>e.key.toLowerCase()==="m",playPauseKey:s=a=>e.key.toLowerCase()==="k"||e.key.toLowerCase()===" "}=t;if(n.call(this,e)){e.preventDefault(),e.stopPropagation();const a=Ce.getComponent("FullscreenToggle");Ue[this.fsApi_.fullscreenEnabled]!==!1&&a.prototype.handleClick.call(this,e)}else r.call(this,e)?(e.preventDefault(),e.stopPropagation(),Ce.getComponent("MuteToggle").prototype.handleClick.call(this,e)):s.call(this,e)&&(e.preventDefault(),e.stopPropagation(),Ce.getComponent("PlayToggle").prototype.handleClick.call(this,e))}canPlayType(e){let t;for(let n=0,r=this.options_.techOrder;n<r.length;n++){const s=r[n];let a=gt.getTech(s);if(a||(a=Ce.getComponent(s)),!a){bt.error(`The "${s}" tech is undefined. Skipped browser support check for that tech.`);continue}if(a.isSupported()&&(t=a.canPlayType(e),t))return t}return""}selectSource(e){const t=this.options_.techOrder.map(o=>[o,gt.getTech(o)]).filter(([o,c])=>c?c.isSupported():(bt.error(`The "${o}" tech is undefined. Skipped browser support check for that tech.`),!1)),n=function(o,c,u){let d;return o.some(h=>c.some(b=>{if(d=u(h,b),d)return!0})),d};let r;const s=o=>(c,u)=>o(u,c),a=([o,c],u)=>{if(c.canPlaySource(u,this.options_[o.toLowerCase()]))return{source:u,tech:o}};return this.options_.sourceOrder?r=n(e,t,s(a)):r=n(t,e,a),r||!1}handleSrc_(e,t){if(typeof e>"u")return this.cache_.src||"";this.resetRetryOnError_&&this.resetRetryOnError_();const n=ub(e);if(!n.length){this.setTimeout(function(){this.error({code:4,message:this.options_.notSupportedMessage})},0);return}if(this.changingSrc_=!0,t||(this.cache_.sources=n),this.updateSourceCaches_(n[0]),mA(this,n[0],(r,s)=>{if(this.middleware_=s,t||(this.cache_.sources=n),this.updateSourceCaches_(r),this.src_(r)){if(n.length>1)return this.handleSrc_(n.slice(1));this.changingSrc_=!1,this.setTimeout(function(){this.error({code:4,message:this.options_.notSupportedMessage})},0),this.triggerReady();return}gA(s,this.tech_)}),n.length>1){const r=()=>{this.error(null),this.handleSrc_(n.slice(1),!0)},s=()=>{this.off("error",r)};this.one("error",r),this.one("playing",s),this.resetRetryOnError_=()=>{this.off("error",r),this.off("playing",s)}}}src(e){return this.handleSrc_(e,!1)}src_(e){const t=this.selectSource([e]);return t?K1(t.tech,this.techName_)?(this.ready(function(){this.tech_.constructor.prototype.hasOwnProperty("setSource")?this.techCall_("setSource",e):this.techCall_("src",e.src),this.changingSrc_=!1},!0),!1):(this.changingSrc_=!0,this.loadTech_(t.tech,t.source),this.tech_.ready(()=>{this.changingSrc_=!1}),!1):!0}addSourceElement(e,t){return this.tech_?this.tech_.addSourceElement(e,t):!1}removeSourceElement(e){return this.tech_?this.tech_.removeSourceElement(e):!1}load(){if(this.tech_&&this.tech_.vhs){this.src(this.currentSource());return}this.techCall_("load")}reset(){if(this.paused())this.doReset_();else{const e=this.play();lr(e.then(()=>this.doReset_()))}}doReset_(){this.tech_&&this.tech_.clearTracks("text"),this.removeClass("vjs-playing"),this.addClass("vjs-paused"),this.resetCache_(),this.poster(""),this.loadTech_(this.options_.techOrder[0],null),this.techCall_("reset"),this.resetControlBarUI_(),this.error(null),this.titleBar&&this.titleBar.update({title:void 0,description:void 0}),Ir(this)&&this.trigger("playerreset")}resetControlBarUI_(){this.resetProgressBar_(),this.resetPlaybackRate_(),this.resetVolumeBar_()}resetProgressBar_(){this.currentTime(0);const{currentTimeDisplay:e,durationDisplay:t,progressControl:n,remainingTimeDisplay:r}=this.controlBar||{},{seekBar:s}=n||{};e&&e.updateContent(),t&&t.updateContent(),r&&r.updateContent(),s&&(s.update(),s.loadProgressBar&&s.loadProgressBar.update())}resetPlaybackRate_(){this.playbackRate(this.defaultPlaybackRate()),this.handleTechRateChange_()}resetVolumeBar_(){this.volume(1),this.trigger("volumechange")}currentSources(){const e=this.currentSource(),t=[];return Object.keys(e).length!==0&&t.push(e),this.cache_.sources||t}currentSource(){return this.cache_.source||{}}currentSrc(){return this.currentSource()&&this.currentSource().src||""}currentType(){return this.currentSource()&&this.currentSource().type||""}preload(e){if(e!==void 0){this.techCall_("setPreload",e),this.options_.preload=e;return}return this.techGet_("preload")}autoplay(e){if(e===void 0)return this.options_.autoplay||!1;let t;typeof e=="string"&&/(any|play|muted)/.test(e)||e===!0&&this.options_.normalizeAutoplay?(this.options_.autoplay=e,this.manualAutoplay_(typeof e=="string"?e:"play"),t=!1):e?this.options_.autoplay=!0:this.options_.autoplay=!1,t=typeof t>"u"?this.options_.autoplay:t,this.tech_&&this.techCall_("setAutoplay",t)}playsinline(e){return e!==void 0&&(this.techCall_("setPlaysinline",e),this.options_.playsinline=e),this.techGet_("playsinline")}loop(e){if(e!==void 0){this.techCall_("setLoop",e),this.options_.loop=e;return}return this.techGet_("loop")}poster(e){if(e===void 0)return this.poster_;e||(e=""),e!==this.poster_&&(this.poster_=e,this.techCall_("setPoster",e),this.isPosterFromTech_=!1,this.trigger("posterchange"))}handleTechPosterChange_(){if((!this.poster_||this.options_.techCanOverridePoster)&&this.tech_&&this.tech_.poster){const e=this.tech_.poster()||"";e!==this.poster_&&(this.poster_=e,this.isPosterFromTech_=!0,this.trigger("posterchange"))}}controls(e){if(e===void 0)return!!this.controls_;e=!!e,this.controls_!==e&&(this.controls_=e,this.usingNativeControls()&&this.techCall_("setControls",e),this.controls_?(this.removeClass("vjs-controls-disabled"),this.addClass("vjs-controls-enabled"),this.trigger("controlsenabled"),this.usingNativeControls()||this.addTechControlsListeners_()):(this.removeClass("vjs-controls-enabled"),this.addClass("vjs-controls-disabled"),this.trigger("controlsdisabled"),this.usingNativeControls()||this.removeTechControlsListeners_()))}usingNativeControls(e){if(e===void 0)return!!this.usingNativeControls_;e=!!e,this.usingNativeControls_!==e&&(this.usingNativeControls_=e,this.usingNativeControls_?(this.addClass("vjs-using-native-controls"),this.trigger("usingnativecontrols")):(this.removeClass("vjs-using-native-controls"),this.trigger("usingcustomcontrols")))}error(e){if(e===void 0)return this.error_||null;if(rs("beforeerror").forEach(t=>{const n=t(this,e);if(!(sr(n)&&!Array.isArray(n)||typeof n=="string"||typeof n=="number"||n===null)){this.log.error("please return a value that MediaError expects in beforeerror hooks");return}e=n}),this.options_.suppressNotSupportedError&&e&&e.code===4){const t=function(){this.error(e)};this.options_.suppressNotSupportedError=!1,this.any(["click","touchstart"],t),this.one("loadstart",function(){this.off(["click","touchstart"],t)});return}if(e===null){this.error_=null,this.removeClass("vjs-error"),this.errorDisplay&&this.errorDisplay.close();return}this.error_=new Qt(e),this.addClass("vjs-error"),bt.error(`(CODE:${this.error_.code} ${Qt.errorTypes[this.error_.code]})`,this.error_.message,this.error_),this.trigger("error"),rs("error").forEach(t=>t(this,this.error_))}reportUserActivity(e){this.userActivity_=!0}userActive(e){if(e===void 0)return this.userActive_;if(e=!!e,e!==this.userActive_){if(this.userActive_=e,this.userActive_){this.userActivity_=!0,this.removeClass("vjs-user-inactive"),this.addClass("vjs-user-active"),this.trigger("useractive");return}this.tech_&&this.tech_.one("mousemove",function(t){t.stopPropagation(),t.preventDefault()}),this.userActivity_=!1,this.removeClass("vjs-user-active"),this.addClass("vjs-user-inactive"),this.trigger("userinactive")}}listenForUserActivity_(){let e,t,n;const r=zt(this,this.reportUserActivity),s=function(h){(h.screenX!==t||h.screenY!==n)&&(t=h.screenX,n=h.screenY,r())},a=function(){r(),this.clearInterval(e),e=this.setInterval(r,250)},o=function(h){r(),this.clearInterval(e)};this.on("mousedown",a),this.on("mousemove",s),this.on("mouseup",o),this.on("mouseleave",o);const c=this.getChild("controlBar");c&&!Bn&&!qi&&(c.on("mouseenter",function(h){this.player().options_.inactivityTimeout!==0&&(this.player().cache_.inactivityTimeout=this.player().options_.inactivityTimeout),this.player().options_.inactivityTimeout=0}),c.on("mouseleave",function(h){this.player().options_.inactivityTimeout=this.player().cache_.inactivityTimeout})),this.on("keydown",r),this.on("keyup",r);let u;const d=function(){if(!this.userActivity_)return;this.userActivity_=!1,this.userActive(!0),this.clearTimeout(u);const h=this.options_.inactivityTimeout;h<=0||(u=this.setTimeout(function(){this.userActivity_||this.userActive(!1)},h))};this.setInterval(d,250)}playbackRate(e){if(e!==void 0){this.techCall_("setPlaybackRate",e);return}return this.tech_&&this.tech_.featuresPlaybackRate?this.cache_.lastPlaybackRate||this.techGet_("playbackRate"):1}defaultPlaybackRate(e){return e!==void 0?this.techCall_("setDefaultPlaybackRate",e):this.tech_&&this.tech_.featuresPlaybackRate?this.techGet_("defaultPlaybackRate"):1}isAudio(e){if(e!==void 0){this.isAudio_=!!e;return}return!!this.isAudio_}updatePlayerHeightOnAudioOnlyMode_(){const e=this.getChild("ControlBar");!e||this.audioOnlyCache_.controlBarHeight===e.currentHeight()||(this.audioOnlyCache_.controlBarHeight=e.currentHeight(),this.height(this.audioOnlyCache_.controlBarHeight))}enableAudioOnlyUI_(){this.addClass("vjs-audio-only-mode");const e=this.children(),t=this.getChild("ControlBar"),n=t&&t.currentHeight();e.forEach(r=>{r!==t&&r.el_&&!r.hasClass("vjs-hidden")&&(r.hide(),this.audioOnlyCache_.hiddenChildren.push(r))}),this.audioOnlyCache_.playerHeight=this.currentHeight(),this.audioOnlyCache_.controlBarHeight=n,this.on("playerresize",this.boundUpdatePlayerHeightOnAudioOnlyMode_),this.height(n),this.trigger("audioonlymodechange")}disableAudioOnlyUI_(){this.removeClass("vjs-audio-only-mode"),this.off("playerresize",this.boundUpdatePlayerHeightOnAudioOnlyMode_),this.audioOnlyCache_.hiddenChildren.forEach(e=>e.show()),this.height(this.audioOnlyCache_.playerHeight),this.trigger("audioonlymodechange")}audioOnlyMode(e){if(typeof e!="boolean"||e===this.audioOnlyMode_)return this.audioOnlyMode_;if(this.audioOnlyMode_=e,e){const t=[];return this.isInPictureInPicture()&&t.push(this.exitPictureInPicture()),this.isFullscreen()&&t.push(this.exitFullscreen()),this.audioPosterMode()&&t.push(this.audioPosterMode(!1)),Promise.all(t).then(()=>this.enableAudioOnlyUI_())}return Promise.resolve().then(()=>this.disableAudioOnlyUI_())}enablePosterModeUI_(){(this.tech_&&this.tech_).hide(),this.addClass("vjs-audio-poster-mode"),this.trigger("audiopostermodechange")}disablePosterModeUI_(){(this.tech_&&this.tech_).show(),this.removeClass("vjs-audio-poster-mode"),this.trigger("audiopostermodechange")}audioPosterMode(e){return typeof e!="boolean"||e===this.audioPosterMode_?this.audioPosterMode_:(this.audioPosterMode_=e,e?this.audioOnlyMode()?this.audioOnlyMode(!1).then(()=>{this.enablePosterModeUI_()}):Promise.resolve().then(()=>{this.enablePosterModeUI_()}):Promise.resolve().then(()=>{this.disablePosterModeUI_()}))}addTextTrack(e,t,n){if(this.tech_)return this.tech_.addTextTrack(e,t,n)}addRemoteTextTrack(e,t){if(this.tech_)return this.tech_.addRemoteTextTrack(e,t)}removeRemoteTextTrack(e={}){let{track:t}=e;if(t||(t=e),this.tech_)return this.tech_.removeRemoteTextTrack(t)}getVideoPlaybackQuality(){return this.techGet_("getVideoPlaybackQuality")}videoWidth(){return this.tech_&&this.tech_.videoWidth&&this.tech_.videoWidth()||0}videoHeight(){return this.tech_&&this.tech_.videoHeight&&this.tech_.videoHeight()||0}language(e){if(e===void 0)return this.language_;this.language_!==String(e).toLowerCase()&&(this.language_=String(e).toLowerCase(),Ir(this)&&this.trigger("languagechange"))}languages(){return Lt(At.prototype.options_.languages,this.languages_)}toJSON(){const e=Lt(this.options_),t=e.tracks;e.tracks=[];for(let n=0;n<t.length;n++){let r=t[n];r=Lt(r),r.player=void 0,e.tracks[n]=r}return e}createModal(e,t){t=t||{},t.content=e||"";const n=new qa(this,t);return this.addChild(n),n.on("dispose",()=>{this.removeChild(n)}),n.open(),n}updateCurrentBreakpoint_(){if(!this.responsive())return;const e=this.currentBreakpoint(),t=this.currentWidth();for(let n=0;n<Ip.length;n++){const r=Ip[n],s=this.breakpoints_[r];if(t<=s){if(e===r)return;e&&this.removeClass(Ou[e]),this.addClass(Ou[r]),this.breakpoint_=r;break}}}removeCurrentBreakpoint_(){const e=this.currentBreakpointClass();this.breakpoint_="",e&&this.removeClass(e)}breakpoints(e){return e===void 0?Object.assign(this.breakpoints_):(this.breakpoint_="",this.breakpoints_=Object.assign({},iI,e),this.updateCurrentBreakpoint_(),Object.assign(this.breakpoints_))}responsive(e){if(e===void 0)return this.responsive_;e=!!e;const t=this.responsive_;if(e!==t)return this.responsive_=e,e?(this.on("playerresize",this.boundUpdateCurrentBreakpoint_),this.updateCurrentBreakpoint_()):(this.off("playerresize",this.boundUpdateCurrentBreakpoint_),this.removeCurrentBreakpoint_()),e}currentBreakpoint(){return this.breakpoint_}currentBreakpointClass(){return Ou[this.breakpoint_]||""}loadMedia(e,t){if(!e||typeof e!="object")return;const n=this.crossOrigin();this.reset(),this.cache_.media=Lt(e);const{artist:r,artwork:s,description:a,poster:o,src:c,textTracks:u,title:d}=this.cache_.media;!s&&o&&(this.cache_.media.artwork=[{src:o,type:Au(o)}]),n&&this.crossOrigin(n),c&&this.src(c),o&&this.poster(o),Array.isArray(u)&&u.forEach(h=>this.addRemoteTextTrack(h,!1)),this.titleBar&&this.titleBar.update({title:d,description:a||r||""}),this.ready(t)}getMedia(){if(!this.cache_.media){const e=this.poster(),t=this.currentSources(),n=Array.prototype.map.call(this.remoteTextTracks(),s=>({kind:s.kind,label:s.label,language:s.language,src:s.src})),r={src:t,textTracks:n};return e&&(r.poster=e,r.artwork=[{src:r.poster,type:Au(r.poster)}]),r}return Lt(this.cache_.media)}static getTagSettings(e){const t={sources:[],tracks:[]},n=os(e),r=n["data-setup"];if(ol(e,"vjs-fill")&&(n.fill=!0),ol(e,"vjs-fluid")&&(n.fluid=!0),r!==null)try{Object.assign(n,JSON.parse(r||"{}"))}catch(s){bt.error("data-setup",s)}if(Object.assign(t,n),e.hasChildNodes()){const s=e.childNodes;for(let a=0,o=s.length;a<o;a++){const c=s[a],u=c.nodeName.toLowerCase();u==="source"?t.sources.push(os(c)):u==="track"&&t.tracks.push(os(c))}}return t}debug(e){if(e===void 0)return this.debugEnabled_;e?(this.trigger("debugon"),this.previousLogLevel_=this.log.level,this.log.level("debug"),this.debugEnabled_=!0):(this.trigger("debugoff"),this.log.level(this.previousLogLevel_),this.previousLogLevel_=void 0,this.debugEnabled_=!1)}playbackRates(e){if(e===void 0)return this.cache_.playbackRates;Array.isArray(e)&&e.every(t=>typeof t=="number")&&(this.cache_.playbackRates=e,this.trigger("playbackrateschange"))}}At.prototype.videoTracks=()=>{},At.prototype.audioTracks=()=>{},At.prototype.textTracks=()=>{},At.prototype.remoteTextTracks=()=>{},At.prototype.remoteTextTrackEls=()=>{},Xn.names.forEach(function(i){const e=Xn[i];At.prototype[e.getterName]=function(){return this.tech_?this.tech_[e.getterName]():(this[e.privateName]=this[e.privateName]||new e.ListClass,this[e.privateName])}}),At.prototype.crossorigin=At.prototype.crossOrigin,At.players={};const vl=te.navigator;At.prototype.options_={techOrder:gt.defaultTechOrder_,html5:{},enableSourceset:!0,inactivityTimeout:2e3,playbackRates:[],liveui:!1,children:["mediaLoader","posterImage","titleBar","textTrackDisplay","loadingSpinner","bigPlayButton","liveTracker","controlBar","errorDisplay","textTrackSettings","resizeManager"],language:vl&&(vl.languages&&vl.languages[0]||vl.userLanguage||vl.language)||"en",languages:{},notSupportedMessage:"No compatible source was found for this media.",normalizeAutoplay:!1,fullscreen:{options:{navigationUI:"hide"}},breakpoints:{},responsive:!1,audioOnlyMode:!1,audioPosterMode:!1,spatialNavigation:{enabled:!1,horizontalSeek:!1},enableSmoothSeeking:!1,disableSeekWhileScrubbingOnMobile:!1,disableSeekWhileScrubbingOnSTV:!1},t2.forEach(function(i){At.prototype[`handleTech${rn(i)}_`]=function(){return this.trigger(i)}}),Ce.registerComponent("Player",At);const Mu="plugin",Xa="activePlugins_",Ya={},Ru=i=>Ya.hasOwnProperty(i),Lu=i=>Ru(i)?Ya[i]:void 0,n2=(i,e)=>{i[Xa]=i[Xa]||{},i[Xa][e]=!0},Bu=(i,e,t)=>{const n=(t?"before":"")+"pluginsetup";i.trigger(n,e),i.trigger(n+":"+e.name,e)},rI=function(i,e){const t=function(){Bu(this,{name:i,plugin:e,instance:null},!0);const n=e.apply(this,arguments);return n2(this,i),Bu(this,{name:i,plugin:e,instance:n}),n};return Object.keys(e).forEach(function(n){t[n]=e[n]}),t},i2=(i,e)=>(e.prototype.name=i,function(...t){Bu(this,{name:i,plugin:e,instance:null},!0);const n=new e(this,...t);return this[i]=()=>n,Bu(this,n.getEventHash()),n});class ni{constructor(e){if(this.constructor===ni)throw new Error("Plugin must be sub-classed; not directly instantiated.");this.player=e,this.log||(this.log=this.player.log.createLogger(this.name)),Xf(this),delete this.trigger,W1(this,this.constructor.defaultState),n2(e,this.name),this.dispose=this.dispose.bind(this),e.on("dispose",this.dispose)}version(){return this.constructor.VERSION}getEventHash(e={}){return e.name=this.name,e.plugin=this.constructor,e.instance=this,e}trigger(e,t={}){return Ha(this.eventBusEl_,e,this.getEventHash(t))}handleStateChanged(e){}dispose(){const{name:e,player:t}=this;this.trigger("dispose"),this.off(),t.off("dispose",this.dispose),t[Xa][e]=!1,this.player=this.state=null,t[e]=i2(e,Ya[e])}static isBasic(e){const t=typeof e=="string"?Lu(e):e;return typeof t=="function"&&!ni.prototype.isPrototypeOf(t.prototype)}static registerPlugin(e,t){if(typeof e!="string")throw new Error(`Illegal plugin name, "${e}", must be a string, was ${typeof e}.`);if(Ru(e))bt.warn(`A plugin named "${e}" already exists. You may want to avoid re-registering plugins!`);else if(At.prototype.hasOwnProperty(e))throw new Error(`Illegal plugin name, "${e}", cannot share a name with an existing player method!`);if(typeof t!="function")throw new Error(`Illegal plugin for "${e}", must be a function, was ${typeof t}.`);return Ya[e]=t,e!==Mu&&(ni.isBasic(t)?At.prototype[e]=rI(e,t):At.prototype[e]=i2(e,t)),t}static deregisterPlugin(e){if(e===Mu)throw new Error("Cannot de-register base plugin.");Ru(e)&&(delete Ya[e],delete At.prototype[e])}static getPlugins(e=Object.keys(Ya)){let t;return e.forEach(n=>{const r=Lu(n);r&&(t=t||{},t[n]=r)}),t}static getPluginVersion(e){const t=Lu(e);return t&&t.VERSION||""}}ni.getPlugin=Lu,ni.BASE_PLUGIN_NAME=Mu,ni.registerPlugin(Mu,ni),At.prototype.usingPlugin=function(i){return!!this[Xa]&&this[Xa][i]===!0},At.prototype.hasPlugin=function(i){return!!Ru(i)};function sI(i,e){let t=!1;return function(...n){return t||bt.warn(i),t=!0,e.apply(this,n)}}function Gi(i,e,t,n){return sI(`${e} is deprecated and will be removed in ${i}.0; please use ${t} instead.`,n)}var aI={NetworkBadStatus:"networkbadstatus",NetworkRequestFailed:"networkrequestfailed",NetworkRequestAborted:"networkrequestaborted",NetworkRequestTimeout:"networkrequesttimeout",NetworkBodyParserFailed:"networkbodyparserfailed",StreamingHlsPlaylistParserError:"streaminghlsplaylistparsererror",StreamingDashManifestParserError:"streamingdashmanifestparsererror",StreamingContentSteeringParserError:"streamingcontentsteeringparsererror",StreamingVttParserError:"streamingvttparsererror",StreamingFailedToSelectNextSegment:"streamingfailedtoselectnextsegment",StreamingFailedToDecryptSegment:"streamingfailedtodecryptsegment",StreamingFailedToTransmuxSegment:"streamingfailedtotransmuxsegment",StreamingFailedToAppendSegment:"streamingfailedtoappendsegment",StreamingCodecsChangeError:"streamingcodecschangeerror"};const r2=i=>i.indexOf("#")===0?i.slice(1):i;function pe(i,e,t){let n=pe.getPlayer(i);if(n)return e&&bt.warn(`Player "${i}" is already initialised. Options will not be applied.`),t&&n.ready(t),n;const r=typeof i=="string"?ls("#"+r2(i)):i;if(!Fa(r))throw new TypeError("The element or ID supplied is not valid. (videojs)");const a=("getRootNode"in r?r.getRootNode()instanceof te.ShadowRoot:!1)?r.getRootNode():r.ownerDocument.body;(!r.ownerDocument.defaultView||!a.contains(r))&&bt.warn("The element supplied is not included in the DOM"),e=e||{},e.restoreEl===!0&&(e.restoreEl=(r.parentNode&&r.parentNode.hasAttribute&&r.parentNode.hasAttribute("data-vjs-player")?r.parentNode:r).cloneNode(!0)),rs("beforesetup").forEach(c=>{const u=c(r,Lt(e));if(!sr(u)||Array.isArray(u)){bt.error("please return an object in beforesetup hooks");return}e=Lt(e,u)});const o=Ce.getComponent("Player");return n=new o(r,e,t),rs("setup").forEach(c=>c(n)),n}if(pe.hooks_=Ar,pe.hooks=rs,pe.hook=HD,pe.hookOnce=qD,pe.removeHook=m1,te.VIDEOJS_NO_DYNAMIC_STYLE!==!0&&Ua()){let i=ls(".vjs-styles-defaults");if(!i){i=j1("vjs-styles-defaults");const e=ls("head");e&&e.insertBefore(i,e.firstChild),$1(i,`
212
+ .video-js {
213
+ width: 300px;
214
+ height: 150px;
215
+ }
216
+
217
+ .vjs-fluid:not(.vjs-audio-only-mode) {
218
+ padding-top: 56.25%
219
+ }
220
+ `)}}Hf(1,pe),pe.VERSION=Lf,pe.options=At.prototype.options_,pe.getPlayers=()=>At.players,pe.getPlayer=i=>{const e=At.players;let t;if(typeof i=="string"){const n=r2(i),r=e[n];if(r)return r;t=ls("#"+n)}else t=i;if(Fa(t)){const{player:n,playerId:r}=t;if(n||e[r])return n||e[r]}},pe.getAllPlayers=()=>Object.keys(At.players).map(i=>At.players[i]).filter(Boolean),pe.players=At.players,pe.getComponent=Ce.getComponent,pe.registerComponent=(i,e)=>(gt.isTech(e)&&bt.warn(`The ${i} tech was registered as a component. It should instead be registered using videojs.registerTech(name, tech)`),Ce.registerComponent.call(Ce,i,e)),pe.getTech=gt.getTech,pe.registerTech=gt.registerTech,pe.use=pA,Object.defineProperty(pe,"middleware",{value:{},writeable:!1,enumerable:!0}),Object.defineProperty(pe.middleware,"TERMINATOR",{value:Du,writeable:!1,enumerable:!0}),pe.browser=x1,pe.obj=WD,pe.mergeOptions=Gi(9,"videojs.mergeOptions","videojs.obj.merge",Lt),pe.defineLazyProperty=Gi(9,"videojs.defineLazyProperty","videojs.obj.defineLazyProperty",au),pe.bind=Gi(9,"videojs.bind","native Function.prototype.bind",zt),pe.registerPlugin=ni.registerPlugin,pe.deregisterPlugin=ni.deregisterPlugin,pe.plugin=(i,e)=>(bt.warn("videojs.plugin() is deprecated; use videojs.registerPlugin() instead"),ni.registerPlugin(i,e)),pe.getPlugins=ni.getPlugins,pe.getPlugin=ni.getPlugin,pe.getPluginVersion=ni.getPluginVersion,pe.addLanguage=function(i,e){return i=(""+i).toLowerCase(),pe.options.languages=Lt(pe.options.languages,{[i]:e}),pe.options.languages[i]},pe.log=bt,pe.createLogger=v1,pe.time=oA,pe.createTimeRange=Gi(9,"videojs.createTimeRange","videojs.time.createTimeRanges",zi),pe.createTimeRanges=Gi(9,"videojs.createTimeRanges","videojs.time.createTimeRanges",zi),pe.formatTime=Gi(9,"videojs.formatTime","videojs.time.formatTime",Fs),pe.setFormatTime=Gi(9,"videojs.setFormatTime","videojs.time.setFormatTime",J1),pe.resetFormatTime=Gi(9,"videojs.resetFormatTime","videojs.time.resetFormatTime",Q1),pe.parseUrl=Gi(9,"videojs.parseUrl","videojs.url.parseUrl",sp),pe.isCrossOrigin=Gi(9,"videojs.isCrossOrigin","videojs.url.isCrossOrigin",Eu),pe.EventTarget=pi,pe.any=Gf,pe.on=fi,pe.one=Tu,pe.off=Un,pe.trigger=Ha,pe.xhr=Ey,pe.TrackList=Vs,pe.TextTrack=fl,pe.TextTrackList=ip,pe.AudioTrack=ab,pe.AudioTrackList=eb,pe.VideoTrack=ob,pe.VideoTrackList=tb,["isEl","isTextNode","createEl","hasClass","addClass","removeClass","toggleClass","setAttributes","getAttributes","emptyEl","appendContent","insertContent"].forEach(i=>{pe[i]=function(){return bt.warn(`videojs.${i}() is deprecated; use videojs.dom.${i}() instead`),F1[i].apply(null,arguments)}}),pe.computedStyle=Gi(9,"videojs.computedStyle","videojs.dom.computedStyle",$a),pe.dom=F1,pe.fn=tA,pe.num=RA,pe.str=sA,pe.url=hA,pe.Error=aI;/*! @name videojs-contrib-quality-levels @version 4.1.0 @license Apache-2.0 */class oI{constructor(e){let t=this;return t.id=e.id,t.label=t.id,t.width=e.width,t.height=e.height,t.bitrate=e.bandwidth,t.frameRate=e.frameRate,t.enabled_=e.enabled,Object.defineProperty(t,"enabled",{get(){return t.enabled_()},set(n){t.enabled_(n)}}),t}}class Uu extends pe.EventTarget{constructor(){super();let e=this;return e.levels_=[],e.selectedIndex_=-1,Object.defineProperty(e,"selectedIndex",{get(){return e.selectedIndex_}}),Object.defineProperty(e,"length",{get(){return e.levels_.length}}),e[Symbol.iterator]=()=>e.levels_.values(),e}addQualityLevel(e){let t=this.getQualityLevelById(e.id);if(t)return t;const n=this.levels_.length;return t=new oI(e),""+n in this||Object.defineProperty(this,n,{get(){return this.levels_[n]}}),this.levels_.push(t),this.trigger({qualityLevel:t,type:"addqualitylevel"}),t}removeQualityLevel(e){let t=null;for(let n=0,r=this.length;n<r;n++)if(this[n]===e){t=this.levels_.splice(n,1)[0],this.selectedIndex_===n?this.selectedIndex_=-1:this.selectedIndex_>n&&this.selectedIndex_--;break}return t&&this.trigger({qualityLevel:e,type:"removequalitylevel"}),t}getQualityLevelById(e){for(let t=0,n=this.length;t<n;t++){const r=this[t];if(r.id===e)return r}return null}dispose(){this.selectedIndex_=-1,this.levels_.length=0}}Uu.prototype.allowedEvents_={change:"change",addqualitylevel:"addqualitylevel",removequalitylevel:"removequalitylevel"};for(const i in Uu.prototype.allowedEvents_)Uu.prototype["on"+i]=null;var s2="4.1.0";const lI=function(i,e){const t=i.qualityLevels,n=new Uu,r=function(){n.dispose(),i.qualityLevels=t,i.off("dispose",r)};return i.on("dispose",r),i.qualityLevels=()=>n,i.qualityLevels.VERSION=s2,n},a2=function(i){return lI(this,pe.obj.merge({},i))};pe.registerPlugin("qualityLevels",a2),a2.VERSION=s2;/*! @name @videojs/http-streaming @version 3.17.0 @license Apache-2.0 */const ii=Jc,Fu=(i,e)=>e&&e.responseURL&&i!==e.responseURL?e.responseURL:i,Ii=i=>pe.log.debug?pe.log.debug.bind(pe,"VHS:",`${i} >`):function(){};function It(...i){const e=pe.obj||pe;return(e.merge||e.mergeOptions).apply(e,i)}function Tn(...i){const e=pe.time||pe;return(e.createTimeRanges||e.createTimeRanges).apply(e,i)}function cI(i){if(i.length===0)return"Buffered Ranges are empty";let e=`Buffered Ranges:
221
+ `;for(let t=0;t<i.length;t++){const n=i.start(t),r=i.end(t);e+=`${n} --> ${r}. Duration (${r-n})
222
+ `}return e}const ur=1/30,dr=ur*3,o2=function(i,e){const t=[];let n;if(i&&i.length)for(n=0;n<i.length;n++)e(i.start(n),i.end(n))&&t.push([i.start(n),i.end(n)]);return Tn(t)},Ja=function(i,e){return o2(i,function(t,n){return t-dr<=e&&n+dr>=e})},Vu=function(i,e){return o2(i,function(t){return t-ur>=e})},uI=function(i){if(i.length<2)return Tn();const e=[];for(let t=1;t<i.length;t++){const n=i.end(t-1),r=i.start(t);e.push([n,r])}return Tn(e)},dI=function(i,e){let t=null,n=null,r=0;const s=[],a=[];if(!i||!i.length||!e||!e.length)return Tn();let o=i.length;for(;o--;)s.push({time:i.start(o),type:"start"}),s.push({time:i.end(o),type:"end"});for(o=e.length;o--;)s.push({time:e.start(o),type:"start"}),s.push({time:e.end(o),type:"end"});for(s.sort(function(c,u){return c.time-u.time}),o=0;o<s.length;o++)s[o].type==="start"?(r++,r===2&&(t=s[o].time)):s[o].type==="end"&&(r--,r===1&&(n=s[o].time)),t!==null&&n!==null&&(a.push([t,n]),t=null,n=null);return Tn(a)},l2=i=>{const e=[];if(!i||!i.length)return"";for(let t=0;t<i.length;t++)e.push(i.start(t)+" => "+i.end(t));return e.join(", ")},hI=function(i,e,t=1){return((i.length?i.end(i.length-1):0)-e)/t},qs=i=>{const e=[];for(let t=0;t<i.length;t++)e.push({start:i.start(t),end:i.end(t)});return e},fI=function(i,e){if(i===e)return!1;if(!i&&e||!e&&i||i.length!==e.length)return!0;for(let t=0;t<i.length;t++)if(i.start(t)!==e.start(t)||i.end(t)!==e.end(t))return!0;return!1},Pp=function(i){if(!(!i||!i.length||!i.end))return i.end(i.length-1)},Np=function(i,e){let t=0;if(!i||!i.length)return t;for(let n=0;n<i.length;n++){const r=i.start(n),s=i.end(n);if(!(e>s)){if(e>r&&e<=s){t+=s-e;continue}t+=s-r}}return t},Op=(i,e)=>{if(!e.preload)return e.duration;let t=0;return(e.parts||[]).forEach(function(n){t+=n.duration}),(e.preloadHints||[]).forEach(function(n){n.type==="PART"&&(t+=i.partTargetDuration)}),t},Mp=i=>(i.segments||[]).reduce((e,t,n)=>(t.parts?t.parts.forEach(function(r,s){e.push({duration:r.duration,segmentIndex:n,partIndex:s,part:r,segment:t})}):e.push({duration:t.duration,segmentIndex:n,partIndex:null,segment:t,part:null}),e),[]),c2=i=>{const e=i.segments&&i.segments.length&&i.segments[i.segments.length-1];return e&&e.parts||[]},u2=({preloadSegment:i})=>{if(!i)return;const{parts:e,preloadHints:t}=i;let n=(t||[]).reduce((r,s)=>r+(s.type==="PART"?1:0),0);return n+=e&&e.length?e.length:0,n},d2=(i,e)=>{if(e.endList)return 0;if(i&&i.suggestedPresentationDelay)return i.suggestedPresentationDelay;const t=c2(e).length>0;return t&&e.serverControl&&e.serverControl.partHoldBack?e.serverControl.partHoldBack:t&&e.partTargetDuration?e.partTargetDuration*3:e.serverControl&&e.serverControl.holdBack?e.serverControl.holdBack:e.targetDuration?e.targetDuration*3:0},pI=function(i,e){let t=0,n=e-i.mediaSequence,r=i.segments[n];if(r){if(typeof r.start<"u")return{result:r.start,precise:!0};if(typeof r.end<"u")return{result:r.end-r.duration,precise:!0}}for(;n--;){if(r=i.segments[n],typeof r.end<"u")return{result:t+r.end,precise:!0};if(t+=Op(i,r),typeof r.start<"u")return{result:t+r.start,precise:!0}}return{result:t,precise:!1}},mI=function(i,e){let t=0,n,r=e-i.mediaSequence;for(;r<i.segments.length;r++){if(n=i.segments[r],typeof n.start<"u")return{result:n.start-t,precise:!0};if(t+=Op(i,n),typeof n.end<"u")return{result:n.end-t,precise:!0}}return{result:-1,precise:!1}},h2=function(i,e,t){if(typeof e>"u"&&(e=i.mediaSequence+i.segments.length),e<i.mediaSequence)return 0;const n=pI(i,e);if(n.precise)return n.result;const r=mI(i,e);return r.precise?r.result:n.result+t},f2=function(i,e,t){if(!i)return 0;if(typeof t!="number"&&(t=0),typeof e>"u"){if(i.totalDuration)return i.totalDuration;if(!i.endList)return te.Infinity}return h2(i,e,t)},yl=function({defaultDuration:i,durationList:e,startIndex:t,endIndex:n}){let r=0;if(t>n&&([t,n]=[n,t]),t<0){for(let s=t;s<Math.min(0,n);s++)r+=i;t=0}for(let s=t;s<n;s++)r+=e[s].duration;return r},p2=function(i,e,t,n){if(!i||!i.segments)return null;if(i.endList)return f2(i);if(e===null)return null;e=e||0;let r=h2(i,i.mediaSequence+i.segments.length,e);return t&&(n=typeof n=="number"?n:d2(null,i),r-=n),Math.max(0,r)},gI=function(i,e,t){const r=e||0;let s=p2(i,e,!0,t);return s===null?Tn():(s<r&&(s=r),Tn(r,s))},vI=function({playlist:i,currentTime:e,startingSegmentIndex:t,startingPartIndex:n,startTime:r,exactManifestTimings:s}){let a=e-r;const o=Mp(i);let c=0;for(let u=0;u<o.length;u++){const d=o[u];if(t===d.segmentIndex&&!(typeof n=="number"&&typeof d.partIndex=="number"&&n!==d.partIndex)){c=u;break}}if(a<0){if(c>0)for(let u=c-1;u>=0;u--){const d=o[u];if(a+=d.duration,s){if(a<0)continue}else if(a+ur<=0)continue;return{partIndex:d.partIndex,segmentIndex:d.segmentIndex,startTime:r-yl({defaultDuration:i.targetDuration,durationList:o,startIndex:c,endIndex:u})}}return{partIndex:o[0]&&o[0].partIndex||null,segmentIndex:o[0]&&o[0].segmentIndex||0,startTime:e}}if(c<0){for(let u=c;u<0;u++)if(a-=i.targetDuration,a<0)return{partIndex:o[0]&&o[0].partIndex||null,segmentIndex:o[0]&&o[0].segmentIndex||0,startTime:e};c=0}for(let u=c;u<o.length;u++){const d=o[u];a-=d.duration;const h=d.duration>ur,b=a===0,v=h&&a+ur>=0;if(!((b||v)&&u!==o.length-1)){if(s){if(a>0)continue}else if(a-ur>=0)continue;return{partIndex:d.partIndex,segmentIndex:d.segmentIndex,startTime:r+yl({defaultDuration:i.targetDuration,durationList:o,startIndex:c,endIndex:u})}}}return{segmentIndex:o[o.length-1].segmentIndex,partIndex:o[o.length-1].partIndex,startTime:e}},m2=function(i){return i.excludeUntil&&i.excludeUntil>Date.now()},Rp=function(i){return i.excludeUntil&&i.excludeUntil===1/0},ju=function(i){const e=m2(i);return!i.disabled&&!e},yI=function(i){return i.disabled},bI=function(i){for(let e=0;e<i.segments.length;e++)if(i.segments[e].key)return!0;return!1},g2=function(i,e){return e.attributes&&e.attributes[i]},_I=function(i,e,t,n=0){return g2("BANDWIDTH",t)?(i*t.attributes.BANDWIDTH-n*8)/e:NaN},Lp=(i,e)=>{if(i.playlists.length===1)return!0;const t=e.attributes.BANDWIDTH||Number.MAX_VALUE;return i.playlists.filter(n=>ju(n)?(n.attributes.BANDWIDTH||0)<t:!1).length===0},Bp=(i,e)=>!i&&!e||!i&&e||i&&!e?!1:!!(i===e||i.id&&e.id&&i.id===e.id||i.resolvedUri&&e.resolvedUri&&i.resolvedUri===e.resolvedUri||i.uri&&e.uri&&i.uri===e.uri),v2=function(i,e){const t=i&&i.mediaGroups&&i.mediaGroups.AUDIO||{};let n=!1;for(const r in t){for(const s in t[r])if(n=e(t[r][s]),n)break;if(n)break}return!!n},bl=i=>{if(!i||!i.playlists||!i.playlists.length)return v2(i,t=>t.playlists&&t.playlists.length||t.uri);for(let e=0;e<i.playlists.length;e++){const t=i.playlists[e],n=t.attributes&&t.attributes.CODECS;if(!(n&&n.split(",").every(s=>By(s))||v2(i,s=>Bp(t,s))))return!1}return!0};var ri={liveEdgeDelay:d2,duration:f2,seekable:gI,getMediaInfoForTime:vI,isEnabled:ju,isDisabled:yI,isExcluded:m2,isIncompatible:Rp,playlistEnd:p2,isAes:bI,hasAttribute:g2,estimateSegmentRequestTime:_I,isLowestEnabledRendition:Lp,isAudioOnly:bl,playlistMatch:Bp,segmentDurationWithParts:Op};const{log:y2}=pe,Qa=(i,e)=>`${i}-${e}`,b2=(i,e,t)=>`placeholder-uri-${i}-${e}-${t}`,kI=({onwarn:i,oninfo:e,manifestString:t,customTagParsers:n=[],customTagMappers:r=[],llhls:s})=>{const a=new d6;i&&a.on("warn",i),e&&a.on("info",e),n.forEach(u=>a.addParser(u)),r.forEach(u=>a.addTagMapper(u)),a.push(t),a.end();const o=a.manifest;if(s||(["preloadSegment","skip","serverControl","renditionReports","partInf","partTargetDuration"].forEach(function(u){o.hasOwnProperty(u)&&delete o[u]}),o.segments&&o.segments.forEach(function(u){["parts","preloadHints"].forEach(function(d){u.hasOwnProperty(d)&&delete u[d]})})),!o.targetDuration){let u=10;o.segments&&o.segments.length&&(u=o.segments.reduce((d,h)=>Math.max(d,h.duration),0)),i&&i({message:`manifest has no targetDuration defaulting to ${u}`}),o.targetDuration=u}const c=c2(o);if(c.length&&!o.partTargetDuration){const u=c.reduce((d,h)=>Math.max(d,h.duration),0);i&&(i({message:`manifest has no partTargetDuration defaulting to ${u}`}),y2.error("LL-HLS manifest has parts but lacks required #EXT-X-PART-INF:PART-TARGET value. See https://datatracker.ietf.org/doc/html/draft-pantos-hls-rfc8216bis-09#section-4.4.3.7. Playback is not guaranteed.")),o.partTargetDuration=u}return o},Za=(i,e)=>{i.mediaGroups&&["AUDIO","SUBTITLES"].forEach(t=>{if(i.mediaGroups[t])for(const n in i.mediaGroups[t])for(const r in i.mediaGroups[t][n]){const s=i.mediaGroups[t][n][r];e(s,t,n,r)}})},_2=({playlist:i,uri:e,id:t})=>{i.id=t,i.playlistErrors_=0,e&&(i.uri=e),i.attributes=i.attributes||{}},TI=i=>{let e=i.playlists.length;for(;e--;){const t=i.playlists[e];_2({playlist:t,id:Qa(e,t.uri)}),t.resolvedUri=ii(i.uri,t.uri),i.playlists[t.id]=t,i.playlists[t.uri]=t,t.attributes.BANDWIDTH||y2.warn("Invalid playlist STREAM-INF detected. Missing BANDWIDTH attribute.")}},SI=i=>{Za(i,e=>{e.uri&&(e.resolvedUri=ii(i.uri,e.uri))})},CI=(i,e)=>{const t=Qa(0,e),n={mediaGroups:{AUDIO:{},VIDEO:{},"CLOSED-CAPTIONS":{},SUBTITLES:{}},uri:te.location.href,resolvedUri:te.location.href,playlists:[{uri:e,id:t,resolvedUri:e,attributes:{}}]};return n.playlists[t]=n.playlists[0],n.playlists[e]=n.playlists[0],n},k2=(i,e,t=b2)=>{i.uri=e;for(let r=0;r<i.playlists.length;r++)if(!i.playlists[r].uri){const s=`placeholder-uri-${r}`;i.playlists[r].uri=s}const n=bl(i);Za(i,(r,s,a,o)=>{if(!r.playlists||!r.playlists.length){if(n&&s==="AUDIO"&&!r.uri)for(let c=0;c<i.playlists.length;c++){const u=i.playlists[c];if(u.attributes&&u.attributes.AUDIO&&u.attributes.AUDIO===a)return}r.playlists=[dn({},r)]}r.playlists.forEach(function(c,u){const d=t(s,a,o,c),h=Qa(u,d);c.uri?c.resolvedUri=c.resolvedUri||ii(i.uri,c.uri):(c.uri=u===0?d:h,c.resolvedUri=c.uri),c.id=c.id||h,c.attributes=c.attributes||{},i.playlists[c.id]=c,i.playlists[c.uri]=c})}),TI(i),SI(i)};class T2{constructor(){this.offset_=null,this.pendingDateRanges_=new Map,this.processedDateRanges_=new Map}setOffset(e=[]){if(this.offset_!==null||!e.length)return;const[t]=e;t.programDateTime!==void 0&&(this.offset_=t.programDateTime/1e3)}setPendingDateRanges(e=[]){if(!e.length)return;const[t]=e,n=t.startDate.getTime();this.trimProcessedDateRanges_(n),this.pendingDateRanges_=e.reduce((r,s)=>(r.set(s.id,s),r),new Map)}processDateRange(e){this.pendingDateRanges_.delete(e.id),this.processedDateRanges_.set(e.id,e)}getDateRangesToProcess(){if(this.offset_===null)return[];const e={},t=[];this.pendingDateRanges_.forEach((n,r)=>{if(!this.processedDateRanges_.has(r)&&(n.startTime=n.startDate.getTime()/1e3-this.offset_,n.processDateRange=()=>this.processDateRange(n),t.push(n),!!n.class))if(e[n.class]){const s=e[n.class].push(n);n.classListIndex=s-1}else e[n.class]=[n],n.classListIndex=0});for(const n of t){const r=e[n.class]||[];n.endDate?n.endTime=n.endDate.getTime()/1e3-this.offset_:n.endOnNext&&r[n.classListIndex+1]?n.endTime=r[n.classListIndex+1].startTime:n.duration?n.endTime=n.startTime+n.duration:n.plannedDuration?n.endTime=n.startTime+n.plannedDuration:n.endTime=n.startTime}return t}trimProcessedDateRanges_(e){new Map(this.processedDateRanges_).forEach((n,r)=>{n.startDate.getTime()<e&&this.processedDateRanges_.delete(r)})}}const S2=22,zs=({requestType:i,request:e,error:t,parseFailure:n})=>{const r=e.status<200||e.status>299,s=e.status>=400&&e.status<=499,a={uri:e.uri,requestType:i},o=r&&!s||n;if(t&&s)a.error=dn({},t),a.errorType=pe.Error.NetworkRequestFailed;else if(e.aborted)a.errorType=pe.Error.NetworkRequestAborted;else if(e.timedout)a.erroType=pe.Error.NetworkRequestTimeout;else if(o){const c=n?pe.Error.NetworkBodyParserFailed:pe.Error.NetworkBadStatus;a.errorType=c,a.status=e.status,a.headers=e.headers}return a},xI=Ii("CodecUtils"),C2=function(i){const e=i.attributes||{};if(e.CODECS)return rr(e.CODECS)},x2=(i,e)=>{const t=e.attributes||{};return i&&i.mediaGroups&&i.mediaGroups.AUDIO&&t.AUDIO&&i.mediaGroups.AUDIO[t.AUDIO]},EI=(i,e)=>{if(!x2(i,e))return!0;const t=e.attributes||{},n=i.mediaGroups.AUDIO[t.AUDIO];for(const r in n)if(!n[r].uri&&!n[r].playlists)return!0;return!1},_l=function(i){const e={};return i.forEach(({mediaType:t,type:n,details:r})=>{e[t]=e[t]||[],e[t].push(Ly(`${n}${r}`))}),Object.keys(e).forEach(function(t){if(e[t].length>1){xI(`multiple ${t} codecs found as attributes: ${e[t].join(", ")}. Setting playlist codecs to null so that we wait for mux.js to probe segments for real codecs.`),e[t]=null;return}e[t]=e[t][0]}),e},E2=function(i){let e=0;return i.audio&&e++,i.video&&e++,e},kl=function(i,e){const t=e.attributes||{},n=_l(C2(e)||[]);if(x2(i,e)&&!n.audio&&!EI(i,e)){const r=_l(f6(i,t.AUDIO)||[]);r.audio&&(n.audio=r.audio)}return n},{EventTarget:wI}=pe,DI=(i,e)=>{if(e.endList||!e.serverControl)return i;const t={};if(e.serverControl.canBlockReload){const{preloadSegment:n}=e;let r=e.mediaSequence+e.segments.length;if(n){const s=n.parts||[],a=u2(e)-1;a>-1&&a!==s.length-1&&(t._HLS_part=a),(a>-1||s.length)&&r--}t._HLS_msn=r}if(e.serverControl&&e.serverControl.canSkipUntil&&(t._HLS_skip=e.serverControl.canSkipDateranges?"v2":"YES"),Object.keys(t).length){const n=new te.URL(i);["_HLS_skip","_HLS_msn","_HLS_part"].forEach(function(r){t.hasOwnProperty(r)&&n.searchParams.set(r,t[r])}),i=n.toString()}return i},AI=(i,e)=>{if(!i)return e;const t=It(i,e);if(i.preloadHints&&!e.preloadHints&&delete t.preloadHints,i.parts&&!e.parts)delete t.parts;else if(i.parts&&e.parts)for(let n=0;n<e.parts.length;n++)i.parts&&i.parts[n]&&(t.parts[n]=It(i.parts[n],e.parts[n]));return!i.skipped&&e.skipped&&(t.skipped=!1),i.preload&&!e.preload&&(t.preload=!1),t},II=(i,e,t)=>{const n=i.slice(),r=e.slice();t=t||0;const s=[];let a;for(let o=0;o<r.length;o++){const c=n[o+t],u=r[o];c?(a=c.map||a,s.push(AI(c,u))):(a&&!u.map&&(u.map=a),s.push(u))}return s},w2=(i,e)=>{!i.resolvedUri&&i.uri&&(i.resolvedUri=ii(e,i.uri)),i.key&&!i.key.resolvedUri&&(i.key.resolvedUri=ii(e,i.key.uri)),i.map&&!i.map.resolvedUri&&(i.map.resolvedUri=ii(e,i.map.uri)),i.map&&i.map.key&&!i.map.key.resolvedUri&&(i.map.key.resolvedUri=ii(e,i.map.key.uri)),i.parts&&i.parts.length&&i.parts.forEach(t=>{t.resolvedUri||(t.resolvedUri=ii(e,t.uri))}),i.preloadHints&&i.preloadHints.length&&i.preloadHints.forEach(t=>{t.resolvedUri||(t.resolvedUri=ii(e,t.uri))})},D2=function(i){const e=i.segments||[],t=i.preloadSegment;if(t&&t.parts&&t.parts.length){if(t.preloadHints){for(let n=0;n<t.preloadHints.length;n++)if(t.preloadHints[n].type==="MAP")return e}t.duration=i.targetDuration,t.preload=!0,e.push(t)}return e},A2=(i,e)=>i===e||i.segments&&e.segments&&i.segments.length===e.segments.length&&i.endList===e.endList&&i.mediaSequence===e.mediaSequence&&i.preloadSegment===e.preloadSegment,Up=(i,e,t=A2)=>{const n=It(i,{}),r=n.playlists[e.id];if(!r||t(r,e))return null;e.segments=D2(e);const s=It(r,e);if(s.preloadSegment&&!e.preloadSegment&&delete s.preloadSegment,r.segments){if(e.skip){e.segments=e.segments||[];for(let a=0;a<e.skip.skippedSegments;a++)e.segments.unshift({skipped:!0})}s.segments=II(r.segments,e.segments,e.mediaSequence-r.mediaSequence)}s.segments.forEach(a=>{w2(a,s.resolvedUri)});for(let a=0;a<n.playlists.length;a++)n.playlists[a].id===e.id&&(n.playlists[a]=s);return n.playlists[e.id]=s,n.playlists[e.uri]=s,Za(i,(a,o,c,u)=>{if(a.playlists)for(let d=0;d<a.playlists.length;d++)e.id===a.playlists[d].id&&(a.playlists[d]=s)}),n},Fp=(i,e)=>{const t=i.segments||[],n=t[t.length-1],r=n&&n.parts&&n.parts[n.parts.length-1],s=r&&r.duration||n&&n.duration;return e&&s?s*1e3:(i.partTargetDuration||i.targetDuration||10)*500},I2=(i,e,t)=>{if(!i)return;const n=[];return i.forEach(r=>{if(!r.attributes)return;const{BANDWIDTH:s,RESOLUTION:a,CODECS:o}=r.attributes;n.push({id:r.id,bandwidth:s,resolution:a,codecs:o})}),{type:e,isLive:t,renditions:n}};class eo extends wI{constructor(e,t,n={}){if(super(),!e)throw new Error("A non-empty playlist URL or object is required");this.logger_=Ii("PlaylistLoader");const{withCredentials:r=!1}=n;this.src=e,this.vhs_=t,this.withCredentials=r,this.addDateRangesToTextTrack_=n.addDateRangesToTextTrack;const s=t.options_;this.customTagParsers=s&&s.customTagParsers||[],this.customTagMappers=s&&s.customTagMappers||[],this.llhls=s&&s.llhls,this.dateRangesStorage_=new T2,this.state="HAVE_NOTHING",this.handleMediaupdatetimeout_=this.handleMediaupdatetimeout_.bind(this),this.on("mediaupdatetimeout",this.handleMediaupdatetimeout_),this.on("loadedplaylist",this.handleLoadedPlaylist_.bind(this))}handleLoadedPlaylist_(){const e=this.media();if(!e)return;this.dateRangesStorage_.setOffset(e.segments),this.dateRangesStorage_.setPendingDateRanges(e.dateRanges);const t=this.dateRangesStorage_.getDateRangesToProcess();!t.length||!this.addDateRangesToTextTrack_||this.addDateRangesToTextTrack_(t)}handleMediaupdatetimeout_(){if(this.state!=="HAVE_METADATA")return;const e=this.media();let t=ii(this.main.uri,e.uri);this.llhls&&(t=DI(t,e)),this.state="HAVE_CURRENT_METADATA",this.request=this.vhs_.xhr({uri:t,withCredentials:this.withCredentials,requestType:"hls-playlist"},(n,r)=>{if(this.request){if(n)return this.playlistRequestError(this.request,this.media(),"HAVE_METADATA");this.haveMetadata({playlistString:this.request.responseText,url:this.media().uri,id:this.media().id})}})}playlistRequestError(e,t,n){const{uri:r,id:s}=t;this.request=null,n&&(this.state=n),this.error={playlist:this.main.playlists[s],status:e.status,message:`HLS playlist request error at URL: ${r}.`,responseText:e.responseText,code:e.status>=500?4:2,metadata:zs({requestType:e.requestType,request:e,error:e.error})},this.trigger("error")}parseManifest_({url:e,manifestString:t}){try{const n=kI({onwarn:({message:r})=>this.logger_(`m3u8-parser warn for ${e}: ${r}`),oninfo:({message:r})=>this.logger_(`m3u8-parser info for ${e}: ${r}`),manifestString:t,customTagParsers:this.customTagParsers,customTagMappers:this.customTagMappers,llhls:this.llhls});return!n.playlists||!n.playlists.length||this.excludeAudioOnlyVariants(n.playlists),n}catch(n){this.error=n,this.error.metadata={errorType:pe.Error.StreamingHlsPlaylistParserError,error:n}}}excludeAudioOnlyVariants(e){const t=n=>{const r=n.attributes||{},{width:s,height:a}=r.RESOLUTION||{};if(s&&a)return!0;const o=C2(n)||[];return!!_l(o).video};e.some(t)&&e.forEach(n=>{t(n)||(n.excludeUntil=1/0)})}haveMetadata({playlistString:e,playlistObject:t,url:n,id:r}){this.request=null,this.state="HAVE_METADATA";const s={playlistInfo:{type:"media",uri:n}};this.trigger({type:"playlistparsestart",metadata:s});const a=t||this.parseManifest_({url:n,manifestString:e});a.lastRequest=Date.now(),_2({playlist:a,uri:n,id:r});const o=Up(this.main,a);this.targetDuration=a.partTargetDuration||a.targetDuration,this.pendingMedia_=null,o?(this.main=o,this.media_=this.main.playlists[r]):this.trigger("playlistunchanged"),this.updateMediaUpdateTimeout_(Fp(this.media(),!!o)),s.parsedPlaylist=I2(this.main.playlists,s.playlistInfo.type,!this.media_.endList),this.trigger({type:"playlistparsecomplete",metadata:s}),this.trigger("loadedplaylist")}dispose(){this.trigger("dispose"),this.stopRequest(),te.clearTimeout(this.mediaUpdateTimeout),te.clearTimeout(this.finalRenditionTimeout),this.dateRangesStorage_=new T2,this.off()}stopRequest(){if(this.request){const e=this.request;this.request=null,e.onreadystatechange=null,e.abort()}}media(e,t){if(!e)return this.media_;if(this.state==="HAVE_NOTHING")throw new Error("Cannot switch media playlist from "+this.state);if(typeof e=="string"){if(!this.main.playlists[e])throw new Error("Unknown playlist URI: "+e);e=this.main.playlists[e]}if(te.clearTimeout(this.finalRenditionTimeout),t){const o=(e.partTargetDuration||e.targetDuration)/2*1e3||5e3;this.finalRenditionTimeout=te.setTimeout(this.media.bind(this,e,!1),o);return}const n=this.state,r=!this.media_||e.id!==this.media_.id,s=this.main.playlists[e.id];if(s&&s.endList||e.endList&&e.segments.length){this.request&&(this.request.onreadystatechange=null,this.request.abort(),this.request=null),this.state="HAVE_METADATA",this.media_=e,r&&(this.trigger("mediachanging"),n==="HAVE_MAIN_MANIFEST"?this.trigger("loadedmetadata"):this.trigger("mediachange"));return}if(this.updateMediaUpdateTimeout_(Fp(e,!0)),!r)return;if(this.state="SWITCHING_MEDIA",this.request){if(e.resolvedUri===this.request.url)return;this.request.onreadystatechange=null,this.request.abort(),this.request=null}this.media_&&this.trigger("mediachanging"),this.pendingMedia_=e;const a={playlistInfo:{type:"media",uri:e.uri}};this.trigger({type:"playlistrequeststart",metadata:a}),this.request=this.vhs_.xhr({uri:e.resolvedUri,withCredentials:this.withCredentials,requestType:"hls-playlist"},(o,c)=>{if(this.request){if(e.lastRequest=Date.now(),e.resolvedUri=Fu(e.resolvedUri,c),o)return this.playlistRequestError(this.request,e,n);this.trigger({type:"playlistrequestcomplete",metadata:a}),this.haveMetadata({playlistString:c.responseText,url:e.uri,id:e.id}),n==="HAVE_MAIN_MANIFEST"?this.trigger("loadedmetadata"):this.trigger("mediachange")}})}pause(){this.mediaUpdateTimeout&&(te.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null),this.stopRequest(),this.state==="HAVE_NOTHING"&&(this.started=!1),this.state==="SWITCHING_MEDIA"?this.media_?this.state="HAVE_METADATA":this.state="HAVE_MAIN_MANIFEST":this.state==="HAVE_CURRENT_METADATA"&&(this.state="HAVE_METADATA")}load(e){this.mediaUpdateTimeout&&(te.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null);const t=this.media();if(e){const n=t?(t.partTargetDuration||t.targetDuration)/2*1e3:5e3;this.mediaUpdateTimeout=te.setTimeout(()=>{this.mediaUpdateTimeout=null,this.load()},n);return}if(!this.started){this.start();return}t&&!t.endList?this.trigger("mediaupdatetimeout"):this.trigger("loadedplaylist")}updateMediaUpdateTimeout_(e){this.mediaUpdateTimeout&&(te.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null),!(!this.media()||this.media().endList)&&(this.mediaUpdateTimeout=te.setTimeout(()=>{this.mediaUpdateTimeout=null,this.trigger("mediaupdatetimeout"),this.updateMediaUpdateTimeout_(e)},e))}start(){if(this.started=!0,typeof this.src=="object"){this.src.uri||(this.src.uri=te.location.href),this.src.resolvedUri=this.src.uri,setTimeout(()=>{this.setupInitialPlaylist(this.src)},0);return}const e={playlistInfo:{type:"multivariant",uri:this.src}};this.trigger({type:"playlistrequeststart",metadata:e}),this.request=this.vhs_.xhr({uri:this.src,withCredentials:this.withCredentials,requestType:"hls-playlist"},(t,n)=>{if(!this.request)return;if(this.request=null,t)return this.error={status:n.status,message:`HLS playlist request error at URL: ${this.src}.`,responseText:n.responseText,code:2,metadata:zs({requestType:n.requestType,request:n,error:t})},this.state==="HAVE_NOTHING"&&(this.started=!1),this.trigger("error");this.trigger({type:"playlistrequestcomplete",metadata:e}),this.src=Fu(this.src,n),this.trigger({type:"playlistparsestart",metadata:e});const r=this.parseManifest_({manifestString:n.responseText,url:this.src});e.parsedPlaylist=I2(r.playlists,e.playlistInfo.type,!1),this.trigger({type:"playlistparsecomplete",metadata:e}),this.setupInitialPlaylist(r)})}srcUri(){return typeof this.src=="string"?this.src:this.src.uri}setupInitialPlaylist(e){if(this.state="HAVE_MAIN_MANIFEST",e.playlists){this.main=e,k2(this.main,this.srcUri()),e.playlists.forEach(n=>{n.segments=D2(n),n.segments.forEach(r=>{w2(r,n.resolvedUri)})}),this.trigger("loadedplaylist"),this.request||this.media(this.main.playlists[0]);return}const t=this.srcUri()||te.location.href;this.main=CI(e,t),this.haveMetadata({playlistObject:e,url:t,id:this.main.playlists[0].id}),this.trigger("loadedmetadata")}updateOrDeleteClone(e,t){const n=this.main,r=e.ID;let s=n.playlists.length;for(;s--;){const a=n.playlists[s];if(a.attributes["PATHWAY-ID"]===r){const o=a.resolvedUri,c=a.id;if(t){const u=this.createCloneURI_(a.resolvedUri,e),d=Qa(r,u),h=this.createCloneAttributes_(r,a.attributes),b=this.createClonePlaylist_(a,d,e,h);n.playlists[s]=b,n.playlists[d]=b,n.playlists[u]=b}else n.playlists.splice(s,1);delete n.playlists[c],delete n.playlists[o]}}this.updateOrDeleteCloneMedia(e,t)}updateOrDeleteCloneMedia(e,t){const n=this.main,r=e.ID;["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(s=>{if(!(!n.mediaGroups[s]||!n.mediaGroups[s][r])){for(const a in n.mediaGroups[s])if(a===r){for(const o in n.mediaGroups[s][a])n.mediaGroups[s][a][o].playlists.forEach((u,d)=>{const h=n.playlists[u.id],b=h.id,v=h.resolvedUri;delete n.playlists[b],delete n.playlists[v]});delete n.mediaGroups[s][a]}}}),t&&this.createClonedMediaGroups_(e)}addClonePathway(e,t={}){const n=this.main,r=n.playlists.length,s=this.createCloneURI_(t.resolvedUri,e),a=Qa(e.ID,s),o=this.createCloneAttributes_(e.ID,t.attributes),c=this.createClonePlaylist_(t,a,e,o);n.playlists[r]=c,n.playlists[a]=c,n.playlists[s]=c,this.createClonedMediaGroups_(e)}createClonedMediaGroups_(e){const t=e.ID,n=e["BASE-ID"],r=this.main;["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(s=>{if(!(!r.mediaGroups[s]||r.mediaGroups[s][t]))for(const a in r.mediaGroups[s]){if(a===n)r.mediaGroups[s][t]={};else continue;for(const o in r.mediaGroups[s][a]){const c=r.mediaGroups[s][a][o];r.mediaGroups[s][t][o]=dn({},c);const u=r.mediaGroups[s][t][o],d=this.createCloneURI_(c.resolvedUri,e);u.resolvedUri=d,u.uri=d,u.playlists=[],c.playlists.forEach((h,b)=>{const v=r.playlists[h.id],y=b2(s,t,o),p=Qa(t,y);if(v&&!r.playlists[p]){const f=this.createClonePlaylist_(v,p,e),m=f.resolvedUri;r.playlists[p]=f,r.playlists[m]=f}u.playlists[b]=this.createClonePlaylist_(h,p,e)})}}})}createClonePlaylist_(e,t,n,r){const s=this.createCloneURI_(e.resolvedUri,n),a={resolvedUri:s,uri:s,id:t};return e.segments&&(a.segments=[]),r&&(a.attributes=r),It(e,a)}createCloneURI_(e,t){const n=new URL(e);n.hostname=t["URI-REPLACEMENT"].HOST;const r=t["URI-REPLACEMENT"].PARAMS;for(const s of Object.keys(r))n.searchParams.set(s,r[s]);return n.href}createCloneAttributes_(e,t){const n={"PATHWAY-ID":e};return["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(r=>{t[r]&&(n[r]=e)}),n}getKeyIdSet(e){if(e.contentProtection){const t=new Set;for(const n in e.contentProtection){const r=e.contentProtection[n].attributes.keyId;r&&t.add(r.toLowerCase())}return t}}}const Vp=function(i,e,t,n){const r=i.responseType==="arraybuffer"?i.response:i.responseText;!e&&r&&(i.responseTime=Date.now(),i.roundTripTime=i.responseTime-i.requestTime,i.bytesReceived=r.byteLength||r.length,i.bandwidth||(i.bandwidth=Math.floor(i.bytesReceived/i.roundTripTime*8*1e3))),t.headers&&(i.responseHeaders=t.headers),e&&e.code==="ETIMEDOUT"&&(i.timedout=!0),!e&&!i.aborted&&t.statusCode!==200&&t.statusCode!==206&&t.statusCode!==0&&(e=new Error("XHR Failed with a response of: "+(i&&(r||i.responseText)))),n(e,i)},PI=(i,e)=>{if(!i||!i.size)return;let t=e;return i.forEach(n=>{t=n(t)}),t},NI=(i,e,t,n)=>{!i||!i.size||i.forEach(r=>{r(e,t,n)})},P2=function(){const i=function e(t,n){t=It({timeout:45e3},t);const r=e.beforeRequest||pe.Vhs.xhr.beforeRequest,s=e._requestCallbackSet||pe.Vhs.xhr._requestCallbackSet||new Set,a=e._responseCallbackSet||pe.Vhs.xhr._responseCallbackSet;r&&typeof r=="function"&&(pe.log.warn("beforeRequest is deprecated, use onRequest instead."),s.add(r));const o=pe.Vhs.xhr.original===!0?pe.xhr:pe.Vhs.xhr,c=PI(s,t);s.delete(r);const u=o(c||t,function(h,b){return NI(a,u,h,b),Vp(u,h,b,n)}),d=u.abort;return u.abort=function(){return u.aborted=!0,d.apply(u,arguments)},u.uri=t.uri,u.requestType=t.requestType,u.requestTime=Date.now(),u};return i.original=!0,i},OI=function(i){let e;const t=i.offset;return typeof i.offset=="bigint"||typeof i.length=="bigint"?e=te.BigInt(i.offset)+te.BigInt(i.length)-te.BigInt(1):e=i.offset+i.length-1,"bytes="+t+"-"+e},jp=function(i){const e={};return i.byterange&&(e.Range=OI(i.byterange)),e},MI=function(i,e){return i.start(e)+"-"+i.end(e)},RI=function(i,e){const t=i.toString(16);return"00".substring(0,2-t.length)+t+(e%2?" ":"")},LI=function(i){return i>=32&&i<126?String.fromCharCode(i):"."},N2=function(i){const e={};return Object.keys(i).forEach(t=>{const n=i[t];Vy(n)?e[t]={bytes:n.buffer,byteOffset:n.byteOffset,byteLength:n.byteLength}:e[t]=n}),e},$u=function(i){const e=i.byterange||{length:1/0,offset:0};return[e.length,e.offset,i.resolvedUri].join(",")},O2=function(i){return i.resolvedUri},M2=i=>{const e=Array.prototype.slice.call(i),t=16;let n="",r,s;for(let a=0;a<e.length/t;a++)r=e.slice(a*t,a*t+t).map(RI).join(""),s=e.slice(a*t,a*t+t).map(LI).join(""),n+=r+" "+s+`
223
+ `;return n};var BI=Object.freeze({__proto__:null,createTransferableMessage:N2,initSegmentId:$u,segmentKeyId:O2,hexDump:M2,tagDump:({bytes:i})=>M2(i),textRanges:i=>{let e="",t;for(t=0;t<i.length;t++)e+=MI(i,t)+" ";return e}});const R2=.25,UI=(i,e)=>{if(!e.dateTimeObject)return null;const t=e.videoTimingInfo.transmuxerPrependedSeconds,r=e.videoTimingInfo.transmuxedPresentationStart+t,s=i-r;return new Date(e.dateTimeObject.getTime()+s*1e3)},FI=i=>i.transmuxedPresentationEnd-i.transmuxedPresentationStart-i.transmuxerPrependedSeconds,VI=(i,e)=>{let t;try{t=new Date(i)}catch{return null}if(!e||!e.segments||e.segments.length===0)return null;let n=e.segments[0];if(t<new Date(n.dateTimeObject))return null;for(let c=0;c<e.segments.length-1;c++){n=e.segments[c];const u=new Date(e.segments[c+1].dateTimeObject);if(t<u)break}const r=e.segments[e.segments.length-1],s=r.dateTimeObject,a=r.videoTimingInfo?FI(r.videoTimingInfo):r.duration+r.duration*R2,o=new Date(s.getTime()+a*1e3);return t>o?null:(t>new Date(s)&&(n=r),{segment:n,estimatedStart:n.videoTimingInfo?n.videoTimingInfo.transmuxedPresentationStart:ri.duration(e,e.mediaSequence+e.segments.indexOf(n)),type:n.videoTimingInfo?"accurate":"estimate"})},jI=(i,e)=>{if(!e||!e.segments||e.segments.length===0)return null;let t=0,n;for(let s=0;s<e.segments.length&&(n=e.segments[s],t=n.videoTimingInfo?n.videoTimingInfo.transmuxedPresentationEnd:t+n.duration,!(i<=t));s++);const r=e.segments[e.segments.length-1];if(r.videoTimingInfo&&r.videoTimingInfo.transmuxedPresentationEnd<i)return null;if(i>t){if(i>t+r.duration*R2)return null;n=r}return{segment:n,estimatedStart:n.videoTimingInfo?n.videoTimingInfo.transmuxedPresentationStart:t-n.duration,type:n.videoTimingInfo?"accurate":"estimate"}},$I=(i,e)=>{let t,n;try{t=new Date(i),n=new Date(e)}catch{}const r=t.getTime();return(n.getTime()-r)/1e3},HI=i=>{if(!i.segments||i.segments.length===0)return!1;for(let e=0;e<i.segments.length;e++)if(!i.segments[e].dateTimeObject)return!1;return!0},qI=({playlist:i,time:e=void 0,callback:t})=>{if(!t)throw new Error("getProgramTime: callback must be provided");if(!i||e===void 0)return t({message:"getProgramTime: playlist and time must be provided"});const n=jI(e,i);if(!n)return t({message:"valid programTime was not found"});if(n.type==="estimate")return t({message:"Accurate programTime could not be determined. Please seek to e.seekTime and try again",seekTime:n.estimatedStart});const r={mediaSeconds:e},s=UI(e,n.segment);return s&&(r.programDateTime=s.toISOString()),t(null,r)},L2=({programTime:i,playlist:e,retryCount:t=2,seekTo:n,pauseAfterSeek:r=!0,tech:s,callback:a})=>{if(!a)throw new Error("seekToProgramTime: callback must be provided");if(typeof i>"u"||!e||!n)return a({message:"seekToProgramTime: programTime, seekTo and playlist must be provided"});if(!e.endList&&!s.hasStarted_)return a({message:"player must be playing a live stream to start buffering"});if(!HI(e))return a({message:"programDateTime tags must be provided in the manifest "+e.resolvedUri});const o=VI(i,e);if(!o)return a({message:`${i} was not found in the stream`});const c=o.segment,u=$I(c.dateTimeObject,i);if(o.type==="estimate"){if(t===0)return a({message:`${i} is not buffered yet. Try again`});n(o.estimatedStart+u),s.one("seeked",()=>{L2({programTime:i,playlist:e,retryCount:t-1,seekTo:n,pauseAfterSeek:r,tech:s,callback:a})});return}const d=c.start+u,h=()=>a(null,s.currentTime());s.one("seeked",h),r&&s.pause(),n(d)},$p=(i,e)=>{if(i.readyState===4)return e()},zI=(i,e,t,n)=>{let r=[],s,a=!1;const o=function(h,b,v,y){return b.abort(),a=!0,t(h,b,v,y)},c=function(h,b){if(a)return;if(h)return h.metadata=zs({requestType:n,request:b,error:h}),o(h,b,"",r);const v=b.responseText.substring(r&&r.byteLength||0,b.responseText.length);if(r=S6(r,jy(v,!0)),s=s||rl(r),r.length<10||s&&r.length<s+2)return $p(b,()=>o(h,b,"",r));const y=Mf(r);return y==="ts"&&r.length<188?$p(b,()=>o(h,b,"",r)):!y&&r.length<376?$p(b,()=>o(h,b,"",r)):o(null,b,y,r)},d=e({uri:i,beforeSend(h){h.overrideMimeType("text/plain; charset=x-user-defined"),h.addEventListener("progress",function({total:b,loaded:v}){return Vp(h,null,{statusCode:h.status},c)})}},function(h,b){return Vp(d,h,b,c)});return d},{EventTarget:GI}=pe,B2=function(i,e){if(!A2(i,e)||i.sidx&&e.sidx&&(i.sidx.offset!==e.sidx.offset||i.sidx.length!==e.sidx.length))return!1;if(!i.sidx&&e.sidx||i.sidx&&!e.sidx||i.segments&&!e.segments||!i.segments&&e.segments)return!1;if(!i.segments&&!e.segments)return!0;for(let t=0;t<i.segments.length;t++){const n=i.segments[t],r=e.segments[t];if(n.uri!==r.uri)return!1;if(!n.byterange&&!r.byterange)continue;const s=n.byterange,a=r.byterange;if(s&&!a||!s&&a||s.offset!==a.offset||s.length!==a.length)return!1}return!0},WI=(i,e,t,n)=>{const r=n.attributes.NAME||t;return`placeholder-uri-${i}-${e}-${r}`},KI=({mainXml:i,srcUrl:e,clientOffset:t,sidxMapping:n,previousManifest:r})=>{const s=kD(i,{manifestUri:e,clientOffset:t,sidxMapping:n,previousManifest:r});return k2(s,e,WI),s},XI=(i,e)=>{Za(i,(t,n,r,s)=>{(!e.mediaGroups[n][r]||!(s in e.mediaGroups[n][r]))&&delete i.mediaGroups[n][r][s]})},YI=(i,e,t)=>{let n=!0,r=It(i,{duration:e.duration,minimumUpdatePeriod:e.minimumUpdatePeriod,timelineStarts:e.timelineStarts});for(let s=0;s<e.playlists.length;s++){const a=e.playlists[s];if(a.sidx){const c=eu(a.sidx);t&&t[c]&&t[c].sidx&&Ef(a,t[c].sidx,a.sidx.resolvedUri)}const o=Up(r,a,B2);o&&(r=o,n=!1)}return Za(e,(s,a,o,c)=>{if(s.playlists&&s.playlists.length){const u=s.playlists[0].id,d=Up(r,s.playlists[0],B2);d&&(r=d,c in r.mediaGroups[a][o]||(r.mediaGroups[a][o][c]=s),r.mediaGroups[a][o][c].playlists[0]=r.playlists[u],n=!1)}}),XI(r,e),e.minimumUpdatePeriod!==i.minimumUpdatePeriod&&(n=!1),n?null:r},JI=(i,e)=>(!i.map&&!e.map||!!(i.map&&e.map&&i.map.byterange.offset===e.map.byterange.offset&&i.map.byterange.length===e.map.byterange.length))&&i.uri===e.uri&&i.byterange.offset===e.byterange.offset&&i.byterange.length===e.byterange.length,U2=(i,e)=>{const t={};for(const n in i){const s=i[n].sidx;if(s){const a=eu(s);if(!e[a])break;const o=e[a].sidxInfo;JI(o,s)&&(t[a]=e[a])}}return t},QI=(i,e)=>{let n=U2(i.playlists,e);return Za(i,(r,s,a,o)=>{if(r.playlists&&r.playlists.length){const c=r.playlists;n=It(n,U2(c,e))}}),n};class Hp extends GI{constructor(e,t,n={},r){super(),this.isPaused_=!0,this.mainPlaylistLoader_=r||this,r||(this.isMain_=!0);const{withCredentials:s=!1}=n;if(this.vhs_=t,this.withCredentials=s,this.addMetadataToTextTrack=n.addMetadataToTextTrack,!e)throw new Error("A non-empty playlist URL or object is required");this.on("minimumUpdatePeriod",()=>{this.refreshXml_()}),this.on("mediaupdatetimeout",()=>{this.refreshMedia_(this.media().id)}),this.state="HAVE_NOTHING",this.loadedPlaylists_={},this.logger_=Ii("DashPlaylistLoader"),this.isMain_?(this.mainPlaylistLoader_.srcUrl=e,this.mainPlaylistLoader_.sidxMapping_={}):this.childPlaylist_=e}get isPaused(){return this.isPaused_}requestErrored_(e,t,n){if(!this.request)return!0;if(this.request=null,e)return this.error=typeof e=="object"&&!(e instanceof Error)?e:{status:t.status,message:"DASH request error at URL: "+t.uri,response:t.response,code:2,metadata:e.metadata},n&&(this.state=n),this.trigger("error"),!0}addSidxSegments_(e,t,n){const r=e.sidx&&eu(e.sidx);if(!e.sidx||!r||this.mainPlaylistLoader_.sidxMapping_[r]){te.clearTimeout(this.mediaRequest_),this.mediaRequest_=te.setTimeout(()=>n(!1),0);return}const s=Fu(e.sidx.resolvedUri),a=(c,u)=>{if(this.requestErrored_(c,u,t))return;const d=this.mainPlaylistLoader_.sidxMapping_,{requestType:h}=u;let b;try{b=ED(st(u.response).subarray(8))}catch(v){v.metadata=zs({requestType:h,request:u,parseFailure:!0}),this.requestErrored_(v,u,t);return}return d[r]={sidxInfo:e.sidx,sidx:b},Ef(e,b,e.sidx.resolvedUri),n(!0)},o="dash-sidx";this.request=zI(s,this.vhs_.xhr,(c,u,d,h)=>{if(c)return a(c,u);if(!d||d!=="mp4"){const y=d||"unknown";return a({status:u.status,message:`Unsupported ${y} container type for sidx segment at URL: ${s}`,response:"",playlist:e,internal:!0,playlistExclusionDuration:1/0,code:2},u)}const{offset:b,length:v}=e.sidx.byterange;if(h.length>=v+b)return a(c,{response:h.subarray(b,b+v),status:u.status,uri:u.uri});this.request=this.vhs_.xhr({uri:s,responseType:"arraybuffer",requestType:"dash-sidx",headers:jp({byterange:e.sidx.byterange})},a)},o)}dispose(){this.isPaused_=!0,this.trigger("dispose"),this.stopRequest(),this.loadedPlaylists_={},te.clearTimeout(this.minimumUpdatePeriodTimeout_),te.clearTimeout(this.mediaRequest_),te.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null,this.mediaRequest_=null,this.minimumUpdatePeriodTimeout_=null,this.mainPlaylistLoader_.createMupOnMedia_&&(this.off("loadedmetadata",this.mainPlaylistLoader_.createMupOnMedia_),this.mainPlaylistLoader_.createMupOnMedia_=null),this.off()}hasPendingRequest(){return this.request||this.mediaRequest_}stopRequest(){if(this.request){const e=this.request;this.request=null,e.onreadystatechange=null,e.abort()}}media(e){if(!e)return this.media_;if(this.state==="HAVE_NOTHING")throw new Error("Cannot switch media playlist from "+this.state);const t=this.state;if(typeof e=="string"){if(!this.mainPlaylistLoader_.main.playlists[e])throw new Error("Unknown playlist URI: "+e);e=this.mainPlaylistLoader_.main.playlists[e]}const n=!this.media_||e.id!==this.media_.id;if(n&&this.loadedPlaylists_[e.id]&&this.loadedPlaylists_[e.id].endList){this.state="HAVE_METADATA",this.media_=e,n&&(this.trigger("mediachanging"),this.trigger("mediachange"));return}n&&(this.media_&&this.trigger("mediachanging"),this.addSidxSegments_(e,t,r=>{this.haveMetadata({startingState:t,playlist:e})}))}haveMetadata({startingState:e,playlist:t}){this.state="HAVE_METADATA",this.loadedPlaylists_[t.id]=t,te.clearTimeout(this.mediaRequest_),this.mediaRequest_=null,this.refreshMedia_(t.id),e==="HAVE_MAIN_MANIFEST"?this.trigger("loadedmetadata"):this.trigger("mediachange")}pause(){this.isPaused_=!0,this.mainPlaylistLoader_.createMupOnMedia_&&(this.off("loadedmetadata",this.mainPlaylistLoader_.createMupOnMedia_),this.mainPlaylistLoader_.createMupOnMedia_=null),this.stopRequest(),te.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null,this.isMain_&&(te.clearTimeout(this.mainPlaylistLoader_.minimumUpdatePeriodTimeout_),this.mainPlaylistLoader_.minimumUpdatePeriodTimeout_=null),this.state==="HAVE_NOTHING"&&(this.started=!1)}load(e){this.isPaused_=!1,te.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null;const t=this.media();if(e){const n=t?t.targetDuration/2*1e3:5e3;this.mediaUpdateTimeout=te.setTimeout(()=>this.load(),n);return}if(!this.started){this.start();return}t&&!t.endList?(this.isMain_&&!this.minimumUpdatePeriodTimeout_&&(this.trigger("minimumUpdatePeriod"),this.updateMinimumUpdatePeriodTimeout_()),this.trigger("mediaupdatetimeout")):this.trigger("loadedplaylist")}start(){if(this.started=!0,!this.isMain_){te.clearTimeout(this.mediaRequest_),this.mediaRequest_=te.setTimeout(()=>this.haveMain_(),0);return}this.requestMain_((e,t)=>{this.haveMain_(),!this.hasPendingRequest()&&!this.media_&&this.media(this.mainPlaylistLoader_.main.playlists[0])})}requestMain_(e){const t={manifestInfo:{uri:this.mainPlaylistLoader_.srcUrl}};this.trigger({type:"manifestrequeststart",metadata:t}),this.request=this.vhs_.xhr({uri:this.mainPlaylistLoader_.srcUrl,withCredentials:this.withCredentials,requestType:"dash-manifest"},(n,r)=>{if(n){const{requestType:a}=r;n.metadata=zs({requestType:a,request:r,error:n})}if(this.requestErrored_(n,r)){this.state==="HAVE_NOTHING"&&(this.started=!1);return}this.trigger({type:"manifestrequestcomplete",metadata:t});const s=r.responseText!==this.mainPlaylistLoader_.mainXml_;if(this.mainPlaylistLoader_.mainXml_=r.responseText,r.responseHeaders&&r.responseHeaders.date?this.mainLoaded_=Date.parse(r.responseHeaders.date):this.mainLoaded_=Date.now(),this.mainPlaylistLoader_.srcUrl=Fu(this.mainPlaylistLoader_.srcUrl,r),s){this.handleMain_(),this.syncClientServerClock_(()=>e(r,s));return}return e(r,s)})}syncClientServerClock_(e){const t=TD(this.mainPlaylistLoader_.mainXml_);if(t===null)return this.mainPlaylistLoader_.clientOffset_=this.mainLoaded_-Date.now(),e();if(t.method==="DIRECT")return this.mainPlaylistLoader_.clientOffset_=t.value-Date.now(),e();this.request=this.vhs_.xhr({uri:ii(this.mainPlaylistLoader_.srcUrl,t.value),method:t.method,withCredentials:this.withCredentials,requestType:"dash-clock-sync"},(n,r)=>{if(!this.request)return;if(n){const{requestType:a}=r;return this.error.metadata=zs({requestType:a,request:r,error:n}),this.mainPlaylistLoader_.clientOffset_=this.mainLoaded_-Date.now(),e()}let s;t.method==="HEAD"?!r.responseHeaders||!r.responseHeaders.date?s=this.mainLoaded_:s=Date.parse(r.responseHeaders.date):s=Date.parse(r.responseText),this.mainPlaylistLoader_.clientOffset_=s-Date.now(),e()})}haveMain_(){this.state="HAVE_MAIN_MANIFEST",this.isMain_?this.trigger("loadedplaylist"):this.media_||this.media(this.childPlaylist_)}handleMain_(){te.clearTimeout(this.mediaRequest_),this.mediaRequest_=null;const e=this.mainPlaylistLoader_.main,t={manifestInfo:{uri:this.mainPlaylistLoader_.srcUrl}};this.trigger({type:"manifestparsestart",metadata:t});let n;try{n=KI({mainXml:this.mainPlaylistLoader_.mainXml_,srcUrl:this.mainPlaylistLoader_.srcUrl,clientOffset:this.mainPlaylistLoader_.clientOffset_,sidxMapping:this.mainPlaylistLoader_.sidxMapping_,previousManifest:e})}catch(s){this.error=s,this.error.metadata={errorType:pe.Error.StreamingDashManifestParserError,error:s},this.trigger("error")}e&&(n=YI(e,n,this.mainPlaylistLoader_.sidxMapping_)),this.mainPlaylistLoader_.main=n||e;const r=this.mainPlaylistLoader_.main.locations&&this.mainPlaylistLoader_.main.locations[0];if(r&&r!==this.mainPlaylistLoader_.srcUrl&&(this.mainPlaylistLoader_.srcUrl=r),(!e||n&&n.minimumUpdatePeriod!==e.minimumUpdatePeriod)&&this.updateMinimumUpdatePeriodTimeout_(),this.addEventStreamToMetadataTrack_(n),n){const{duration:s,endList:a}=n,o=[];n.playlists.forEach(u=>{o.push({id:u.id,bandwidth:u.attributes.BANDWIDTH,resolution:u.attributes.RESOLUTION,codecs:u.attributes.CODECS})});const c={duration:s,isLive:!a,renditions:o};t.parsedManifest=c,this.trigger({type:"manifestparsecomplete",metadata:t})}return!!n}updateMinimumUpdatePeriodTimeout_(){const e=this.mainPlaylistLoader_;e.createMupOnMedia_&&(e.off("loadedmetadata",e.createMupOnMedia_),e.createMupOnMedia_=null),e.minimumUpdatePeriodTimeout_&&(te.clearTimeout(e.minimumUpdatePeriodTimeout_),e.minimumUpdatePeriodTimeout_=null);let t=e.main&&e.main.minimumUpdatePeriod;if(t===0&&(e.media()?t=e.media().targetDuration*1e3:(e.createMupOnMedia_=e.updateMinimumUpdatePeriodTimeout_,e.one("loadedmetadata",e.createMupOnMedia_))),typeof t!="number"||t<=0){t<0&&this.logger_(`found invalid minimumUpdatePeriod of ${t}, not setting a timeout`);return}this.createMUPTimeout_(t)}createMUPTimeout_(e){const t=this.mainPlaylistLoader_;t.minimumUpdatePeriodTimeout_=te.setTimeout(()=>{t.minimumUpdatePeriodTimeout_=null,t.trigger("minimumUpdatePeriod"),t.createMUPTimeout_(e)},e)}refreshXml_(){this.requestMain_((e,t)=>{t&&(this.media_&&(this.media_=this.mainPlaylistLoader_.main.playlists[this.media_.id]),this.mainPlaylistLoader_.sidxMapping_=QI(this.mainPlaylistLoader_.main,this.mainPlaylistLoader_.sidxMapping_),this.addSidxSegments_(this.media(),this.state,n=>{this.refreshMedia_(this.media().id)}))})}refreshMedia_(e){if(!e)throw new Error("refreshMedia_ must take a media id");this.media_&&this.isMain_&&this.handleMain_();const t=this.mainPlaylistLoader_.main.playlists,n=!this.media_||this.media_!==t[e];if(n?this.media_=t[e]:this.trigger("playlistunchanged"),!this.mediaUpdateTimeout){const r=()=>{this.media().endList||(this.mediaUpdateTimeout=te.setTimeout(()=>{this.trigger("mediaupdatetimeout"),r()},Fp(this.media(),!!n)))};r()}this.trigger("loadedplaylist")}addEventStreamToMetadataTrack_(e){if(e&&this.mainPlaylistLoader_.main.eventStream){const t=this.mainPlaylistLoader_.main.eventStream.map(n=>({cueTime:n.start,frames:[{data:n.messageData}]}));this.addMetadataToTextTrack("EventStream",t,this.mainPlaylistLoader_.main.duration)}}getKeyIdSet(e){if(e.contentProtection){const t=new Set;for(const n in e.contentProtection){const r=e.contentProtection[n].attributes["cenc:default_KID"];r&&t.add(r.replace(/-/g,"").toLowerCase())}return t}}}var Sn={GOAL_BUFFER_LENGTH:30,MAX_GOAL_BUFFER_LENGTH:60,BACK_BUFFER_LENGTH:30,GOAL_BUFFER_LENGTH_RATE:1,INITIAL_BANDWIDTH:4194304,BANDWIDTH_VARIANCE:1.2,BUFFER_LOW_WATER_LINE:0,MAX_BUFFER_LOW_WATER_LINE:30,EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE:16,BUFFER_LOW_WATER_LINE_RATE:1,BUFFER_HIGH_WATER_LINE:30};const ZI=i=>{const e=new Uint8Array(new ArrayBuffer(i.length));for(let t=0;t<i.length;t++)e[t]=i.charCodeAt(t);return e.buffer},F2=function(i){return i.on=i.addEventListener,i.off=i.removeEventListener,i},eP=function(i){try{return URL.createObjectURL(new Blob([i],{type:"application/javascript"}))}catch{const t=new BlobBuilder;return t.append(i),URL.createObjectURL(t.getBlob())}},V2=function(i){return function(){const e=eP(i),t=F2(new Worker(e));t.objURL=e;const n=t.terminate;return t.on=t.addEventListener,t.off=t.removeEventListener,t.terminate=function(){return URL.revokeObjectURL(e),n.call(this)},t}},j2=function(i){return`var browserWorkerPolyFill = ${F2.toString()};
224
+ browserWorkerPolyFill(self);
225
+ `+i},$2=function(i){return i.toString().replace(/^function.+?{/,"").slice(0,-1)},tP=j2($2(function(){var i=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},e=function(){this.init=function(){var g={};this.on=function(T,E){g[T]||(g[T]=[]),g[T]=g[T].concat(E)},this.off=function(T,E){var C;return g[T]?(C=g[T].indexOf(E),g[T]=g[T].slice(),g[T].splice(C,1),C>-1):!1},this.trigger=function(T){var E,C,I,O;if(E=g[T],!!E)if(arguments.length===2)for(I=E.length,C=0;C<I;++C)E[C].call(this,arguments[1]);else{for(O=[],C=arguments.length,C=1;C<arguments.length;++C)O.push(arguments[C]);for(I=E.length,C=0;C<I;++C)E[C].apply(this,O)}},this.dispose=function(){g={}}}};e.prototype.pipe=function(g){return this.on("data",function(T){g.push(T)}),this.on("done",function(T){g.flush(T)}),this.on("partialdone",function(T){g.partialFlush(T)}),this.on("endedtimeline",function(T){g.endTimeline(T)}),this.on("reset",function(T){g.reset(T)}),g},e.prototype.push=function(g){this.trigger("data",g)},e.prototype.flush=function(g){this.trigger("done",g)},e.prototype.partialFlush=function(g){this.trigger("partialdone",g)},e.prototype.endTimeline=function(g){this.trigger("endedtimeline",g)},e.prototype.reset=function(g){this.trigger("reset",g)};var t=e,n=Math.pow(2,32),r=function(g){var T=new DataView(g.buffer,g.byteOffset,g.byteLength),E;return T.getBigUint64?(E=T.getBigUint64(0),E<Number.MAX_SAFE_INTEGER?Number(E):E):T.getUint32(0)*n+T.getUint32(4)},s={getUint64:r,MAX_UINT32:n},a=s.MAX_UINT32,o,c,u,d,h,b,v,y,p,f,m,_,k,D,w,A,x,P,S,M,U,B,Q,ie,Y,q,L,$,H,j,W,ae,Ee,Ae,ee,fe;(function(){var g;if(Q={avc1:[],avcC:[],btrt:[],dinf:[],dref:[],esds:[],ftyp:[],hdlr:[],mdat:[],mdhd:[],mdia:[],mfhd:[],minf:[],moof:[],moov:[],mp4a:[],mvex:[],mvhd:[],pasp:[],sdtp:[],smhd:[],stbl:[],stco:[],stsc:[],stsd:[],stsz:[],stts:[],styp:[],tfdt:[],tfhd:[],traf:[],trak:[],trun:[],trex:[],tkhd:[],vmhd:[]},!(typeof Uint8Array>"u")){for(g in Q)Q.hasOwnProperty(g)&&(Q[g]=[g.charCodeAt(0),g.charCodeAt(1),g.charCodeAt(2),g.charCodeAt(3)]);ie=new Uint8Array([105,115,111,109]),q=new Uint8Array([97,118,99,49]),Y=new Uint8Array([0,0,0,1]),L=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]),$=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]),H={video:L,audio:$},ae=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),W=new Uint8Array([0,0,0,0,0,0,0,0]),Ee=new Uint8Array([0,0,0,0,0,0,0,0]),Ae=Ee,ee=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),fe=Ee,j=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0])}})(),o=function(g){var T=[],E=0,C,I,O;for(C=1;C<arguments.length;C++)T.push(arguments[C]);for(C=T.length;C--;)E+=T[C].byteLength;for(I=new Uint8Array(E+8),O=new DataView(I.buffer,I.byteOffset,I.byteLength),O.setUint32(0,I.byteLength),I.set(g,4),C=0,E=8;C<T.length;C++)I.set(T[C],E),E+=T[C].byteLength;return I},c=function(){return o(Q.dinf,o(Q.dref,ae))},u=function(g){return o(Q.esds,new Uint8Array([0,0,0,0,3,25,0,0,0,4,17,64,21,0,6,0,0,0,218,192,0,0,218,192,5,2,g.audioobjecttype<<3|g.samplingfrequencyindex>>>1,g.samplingfrequencyindex<<7|g.channelcount<<3,6,1,2]))},d=function(){return o(Q.ftyp,ie,Y,ie,q)},A=function(g){return o(Q.hdlr,H[g])},h=function(g){return o(Q.mdat,g)},w=function(g){var T=new Uint8Array([0,0,0,0,0,0,0,2,0,0,0,3,0,1,95,144,g.duration>>>24&255,g.duration>>>16&255,g.duration>>>8&255,g.duration&255,85,196,0,0]);return g.samplerate&&(T[12]=g.samplerate>>>24&255,T[13]=g.samplerate>>>16&255,T[14]=g.samplerate>>>8&255,T[15]=g.samplerate&255),o(Q.mdhd,T)},D=function(g){return o(Q.mdia,w(g),A(g.type),v(g))},b=function(g){return o(Q.mfhd,new Uint8Array([0,0,0,0,(g&4278190080)>>24,(g&16711680)>>16,(g&65280)>>8,g&255]))},v=function(g){return o(Q.minf,g.type==="video"?o(Q.vmhd,j):o(Q.smhd,W),c(),P(g))},y=function(g,T){for(var E=[],C=T.length;C--;)E[C]=M(T[C]);return o.apply(null,[Q.moof,b(g)].concat(E))},p=function(g){for(var T=g.length,E=[];T--;)E[T]=_(g[T]);return o.apply(null,[Q.moov,m(4294967295)].concat(E).concat(f(g)))},f=function(g){for(var T=g.length,E=[];T--;)E[T]=U(g[T]);return o.apply(null,[Q.mvex].concat(E))},m=function(g){var T=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,2,0,1,95,144,(g&4278190080)>>24,(g&16711680)>>16,(g&65280)>>8,g&255,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 o(Q.mvhd,T)},x=function(g){var T=g.samples||[],E=new Uint8Array(4+T.length),C,I;for(I=0;I<T.length;I++)C=T[I].flags,E[I+4]=C.dependsOn<<4|C.isDependedOn<<2|C.hasRedundancy;return o(Q.sdtp,E)},P=function(g){return o(Q.stbl,S(g),o(Q.stts,fe),o(Q.stsc,Ae),o(Q.stsz,ee),o(Q.stco,Ee))},function(){var g,T;S=function(E){return o(Q.stsd,new Uint8Array([0,0,0,0,0,0,0,1]),E.type==="video"?g(E):T(E))},g=function(E){var C=E.sps||[],I=E.pps||[],O=[],K=[],X,Z;for(X=0;X<C.length;X++)O.push((C[X].byteLength&65280)>>>8),O.push(C[X].byteLength&255),O=O.concat(Array.prototype.slice.call(C[X]));for(X=0;X<I.length;X++)K.push((I[X].byteLength&65280)>>>8),K.push(I[X].byteLength&255),K=K.concat(Array.prototype.slice.call(I[X]));if(Z=[Q.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,(E.width&65280)>>8,E.width&255,(E.height&65280)>>8,E.height&255,0,72,0,0,0,72,0,0,0,0,0,0,0,1,19,118,105,100,101,111,106,115,45,99,111,110,116,114,105,98,45,104,108,115,0,0,0,0,0,0,0,0,0,0,0,0,0,24,17,17]),o(Q.avcC,new Uint8Array([1,E.profileIdc,E.profileCompatibility,E.levelIdc,255].concat([C.length],O,[I.length],K))),o(Q.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192]))],E.sarRatio){var ne=E.sarRatio[0],ce=E.sarRatio[1];Z.push(o(Q.pasp,new Uint8Array([(ne&4278190080)>>24,(ne&16711680)>>16,(ne&65280)>>8,ne&255,(ce&4278190080)>>24,(ce&16711680)>>16,(ce&65280)>>8,ce&255])))}return o.apply(null,Z)},T=function(E){return o(Q.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,(E.channelcount&65280)>>8,E.channelcount&255,(E.samplesize&65280)>>8,E.samplesize&255,0,0,0,0,(E.samplerate&65280)>>8,E.samplerate&255,0,0]),u(E))}}(),k=function(g){var T=new Uint8Array([0,0,0,7,0,0,0,0,0,0,0,0,(g.id&4278190080)>>24,(g.id&16711680)>>16,(g.id&65280)>>8,g.id&255,0,0,0,0,(g.duration&4278190080)>>24,(g.duration&16711680)>>16,(g.duration&65280)>>8,g.duration&255,0,0,0,0,0,0,0,0,0,0,0,0,1,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,(g.width&65280)>>8,g.width&255,0,0,(g.height&65280)>>8,g.height&255,0,0]);return o(Q.tkhd,T)},M=function(g){var T,E,C,I,O,K,X;return T=o(Q.tfhd,new Uint8Array([0,0,0,58,(g.id&4278190080)>>24,(g.id&16711680)>>16,(g.id&65280)>>8,g.id&255,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0])),K=Math.floor(g.baseMediaDecodeTime/a),X=Math.floor(g.baseMediaDecodeTime%a),E=o(Q.tfdt,new Uint8Array([1,0,0,0,K>>>24&255,K>>>16&255,K>>>8&255,K&255,X>>>24&255,X>>>16&255,X>>>8&255,X&255])),O=92,g.type==="audio"?(C=B(g,O),o(Q.traf,T,E,C)):(I=x(g),C=B(g,I.length+O),o(Q.traf,T,E,C,I))},_=function(g){return g.duration=g.duration||4294967295,o(Q.trak,k(g),D(g))},U=function(g){var T=new Uint8Array([0,0,0,0,(g.id&4278190080)>>24,(g.id&16711680)>>16,(g.id&65280)>>8,g.id&255,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]);return g.type!=="video"&&(T[T.length-1]=0),o(Q.trex,T)},function(){var g,T,E;E=function(C,I){var O=0,K=0,X=0,Z=0;return C.length&&(C[0].duration!==void 0&&(O=1),C[0].size!==void 0&&(K=2),C[0].flags!==void 0&&(X=4),C[0].compositionTimeOffset!==void 0&&(Z=8)),[0,0,O|K|X|Z,1,(C.length&4278190080)>>>24,(C.length&16711680)>>>16,(C.length&65280)>>>8,C.length&255,(I&4278190080)>>>24,(I&16711680)>>>16,(I&65280)>>>8,I&255]},T=function(C,I){var O,K,X,Z,ne,ce;for(Z=C.samples||[],I+=20+16*Z.length,X=E(Z,I),K=new Uint8Array(X.length+Z.length*16),K.set(X),O=X.length,ce=0;ce<Z.length;ce++)ne=Z[ce],K[O++]=(ne.duration&4278190080)>>>24,K[O++]=(ne.duration&16711680)>>>16,K[O++]=(ne.duration&65280)>>>8,K[O++]=ne.duration&255,K[O++]=(ne.size&4278190080)>>>24,K[O++]=(ne.size&16711680)>>>16,K[O++]=(ne.size&65280)>>>8,K[O++]=ne.size&255,K[O++]=ne.flags.isLeading<<2|ne.flags.dependsOn,K[O++]=ne.flags.isDependedOn<<6|ne.flags.hasRedundancy<<4|ne.flags.paddingValue<<1|ne.flags.isNonSyncSample,K[O++]=ne.flags.degradationPriority&61440,K[O++]=ne.flags.degradationPriority&15,K[O++]=(ne.compositionTimeOffset&4278190080)>>>24,K[O++]=(ne.compositionTimeOffset&16711680)>>>16,K[O++]=(ne.compositionTimeOffset&65280)>>>8,K[O++]=ne.compositionTimeOffset&255;return o(Q.trun,K)},g=function(C,I){var O,K,X,Z,ne,ce;for(Z=C.samples||[],I+=20+8*Z.length,X=E(Z,I),O=new Uint8Array(X.length+Z.length*8),O.set(X),K=X.length,ce=0;ce<Z.length;ce++)ne=Z[ce],O[K++]=(ne.duration&4278190080)>>>24,O[K++]=(ne.duration&16711680)>>>16,O[K++]=(ne.duration&65280)>>>8,O[K++]=ne.duration&255,O[K++]=(ne.size&4278190080)>>>24,O[K++]=(ne.size&16711680)>>>16,O[K++]=(ne.size&65280)>>>8,O[K++]=ne.size&255;return o(Q.trun,O)},B=function(C,I){return C.type==="audio"?g(C,I):T(C,I)}}();var xe={ftyp:d,mdat:h,moof:y,moov:p,initSegment:function(g){var T=d(),E=p(g),C;return C=new Uint8Array(T.byteLength+E.byteLength),C.set(T),C.set(E,T.byteLength),C}},Ne=function(g){var T,E,C=[],I=[];for(I.byteLength=0,I.nalCount=0,I.duration=0,C.byteLength=0,T=0;T<g.length;T++)E=g[T],E.nalUnitType==="access_unit_delimiter_rbsp"?(C.length&&(C.duration=E.dts-C.dts,I.byteLength+=C.byteLength,I.nalCount+=C.length,I.duration+=C.duration,I.push(C)),C=[E],C.byteLength=E.data.byteLength,C.pts=E.pts,C.dts=E.dts):(E.nalUnitType==="slice_layer_without_partitioning_rbsp_idr"&&(C.keyFrame=!0),C.duration=E.dts-C.dts,C.byteLength+=E.data.byteLength,C.push(E));return I.length&&(!C.duration||C.duration<=0)&&(C.duration=I[I.length-1].duration),I.byteLength+=C.byteLength,I.nalCount+=C.length,I.duration+=C.duration,I.push(C),I},He=function(g){var T,E,C=[],I=[];for(C.byteLength=0,C.nalCount=0,C.duration=0,C.pts=g[0].pts,C.dts=g[0].dts,I.byteLength=0,I.nalCount=0,I.duration=0,I.pts=g[0].pts,I.dts=g[0].dts,T=0;T<g.length;T++)E=g[T],E.keyFrame?(C.length&&(I.push(C),I.byteLength+=C.byteLength,I.nalCount+=C.nalCount,I.duration+=C.duration),C=[E],C.nalCount=E.length,C.byteLength=E.byteLength,C.pts=E.pts,C.dts=E.dts,C.duration=E.duration):(C.duration+=E.duration,C.nalCount+=E.length,C.byteLength+=E.byteLength,C.push(E));return I.length&&C.duration<=0&&(C.duration=I[I.length-1].duration),I.byteLength+=C.byteLength,I.nalCount+=C.nalCount,I.duration+=C.duration,I.push(C),I},Be=function(g){var T;return!g[0][0].keyFrame&&g.length>1&&(T=g.shift(),g.byteLength-=T.byteLength,g.nalCount-=T.nalCount,g[0][0].dts=T.dts,g[0][0].pts=T.pts,g[0][0].duration+=T.duration),g},be=function(){return{size:0,flags:{isLeading:0,dependsOn:1,isDependedOn:0,hasRedundancy:0,degradationPriority:0,isNonSyncSample:1}}},Fe=function(g,T){var E=be();return E.dataOffset=T,E.compositionTimeOffset=g.pts-g.dts,E.duration=g.duration,E.size=4*g.length,E.size+=g.byteLength,g.keyFrame&&(E.flags.dependsOn=2,E.flags.isNonSyncSample=0),E},le=function(g,T){var E,C,I,O,K,X=T||0,Z=[];for(E=0;E<g.length;E++)for(O=g[E],C=0;C<O.length;C++)K=O[C],I=Fe(K,X),X+=I.size,Z.push(I);return Z},ze=function(g){var T,E,C,I,O,K,X=0,Z=g.byteLength,ne=g.nalCount,ce=Z+4*ne,Te=new Uint8Array(ce),Ye=new DataView(Te.buffer);for(T=0;T<g.length;T++)for(I=g[T],E=0;E<I.length;E++)for(O=I[E],C=0;C<O.length;C++)K=O[C],Ye.setUint32(X,K.data.byteLength),X+=4,Te.set(K.data,X),X+=K.data.byteLength;return Te},oe=function(g,T){var E,C=T||0,I=[];return E=Fe(g,C),I.push(E),I},de=function(g){var T,E,C=0,I=g.byteLength,O=g.length,K=I+4*O,X=new Uint8Array(K),Z=new DataView(X.buffer);for(T=0;T<g.length;T++)E=g[T],Z.setUint32(C,E.data.byteLength),C+=4,X.set(E.data,C),C+=E.data.byteLength;return X},Le={groupNalsIntoFrames:Ne,groupFramesIntoGops:He,extendFirstKeyFrame:Be,generateSampleTable:le,concatenateNalData:ze,generateSampleTableForFrame:oe,concatenateNalDataForFrame:de},Ve=[33,16,5,32,164,27],Ke=[33,65,108,84,1,2,4,8,168,2,4,8,17,191,252],Ge=function(g){for(var T=[];g--;)T.push(0);return T},ke=function(g){return Object.keys(g).reduce(function(T,E){return T[E]=new Uint8Array(g[E].reduce(function(C,I){return C.concat(I)},[])),T},{})},$e,_e=function(){if(!$e){var g={96e3:[Ve,[227,64],Ge(154),[56]],88200:[Ve,[231],Ge(170),[56]],64e3:[Ve,[248,192],Ge(240),[56]],48e3:[Ve,[255,192],Ge(268),[55,148,128],Ge(54),[112]],44100:[Ve,[255,192],Ge(268),[55,163,128],Ge(84),[112]],32e3:[Ve,[255,192],Ge(268),[55,234],Ge(226),[112]],24e3:[Ve,[255,192],Ge(268),[55,255,128],Ge(268),[111,112],Ge(126),[224]],16e3:[Ve,[255,192],Ge(268),[55,255,128],Ge(268),[111,255],Ge(269),[223,108],Ge(195),[1,192]],12e3:[Ke,Ge(268),[3,127,248],Ge(268),[6,255,240],Ge(268),[13,255,224],Ge(268),[27,253,128],Ge(259),[56]],11025:[Ke,Ge(268),[3,127,248],Ge(268),[6,255,240],Ge(268),[13,255,224],Ge(268),[27,255,192],Ge(268),[55,175,128],Ge(108),[112]],8e3:[Ke,Ge(268),[3,121,16],Ge(47),[7]]};$e=ke(g)}return $e},Re=9e4,Ie,it,_t,Ot,Hn,Ri,Yn;Ie=function(g){return g*Re},it=function(g,T){return g*T},_t=function(g){return g/Re},Ot=function(g,T){return g/T},Hn=function(g,T){return Ie(Ot(g,T))},Ri=function(g,T){return it(_t(g),T)},Yn=function(g,T,E){return _t(E?g:g-T)};var Tt={ONE_SECOND_IN_TS:Re,secondsToVideoTs:Ie,secondsToAudioTs:it,videoTsToSeconds:_t,audioTsToSeconds:Ot,audioTsToVideoTs:Hn,videoTsToAudioTs:Ri,metadataTsToSeconds:Yn},Hr=_e,bi=Tt,qn=function(g){var T,E,C=0;for(T=0;T<g.length;T++)E=g[T],C+=E.data.byteLength;return C},qr=function(g,T,E,C){var I,O=0,K=0,X=0,Z=0,ne,ce,Te;if(T.length&&(I=bi.audioTsToVideoTs(g.baseMediaDecodeTime,g.samplerate),O=Math.ceil(bi.ONE_SECOND_IN_TS/(g.samplerate/1024)),E&&C&&(K=I-Math.max(E,C),X=Math.floor(K/O),Z=X*O),!(X<1||Z>bi.ONE_SECOND_IN_TS/2))){for(ne=Hr()[g.samplerate],ne||(ne=T[0].data),ce=0;ce<X;ce++)Te=T[0],T.splice(0,0,{data:ne,dts:Te.dts-O,pts:Te.pts-O});return g.baseMediaDecodeTime-=Math.floor(bi.videoTsToAudioTs(Z,g.samplerate)),Z}},Jn=function(g,T,E){return T.minSegmentDts>=E?g:(T.minSegmentDts=1/0,g.filter(function(C){return C.dts>=E?(T.minSegmentDts=Math.min(T.minSegmentDts,C.dts),T.minSegmentPts=T.minSegmentDts,!0):!1}))},oi=function(g){var T,E,C=[];for(T=0;T<g.length;T++)E=g[T],C.push({size:E.data.byteLength,duration:1024});return C},Tr=function(g){var T,E,C=0,I=new Uint8Array(qn(g));for(T=0;T<g.length;T++)E=g[T],I.set(E.data,C),C+=E.data.byteLength;return I},zr={prefixWithSilence:qr,trimAdtsFramesByEarliestDts:Jn,generateSampleTable:oi,concatenateFrameData:Tr},V=Tt.ONE_SECOND_IN_TS,G=function(g,T){typeof T.pts=="number"&&(g.timelineStartInfo.pts===void 0&&(g.timelineStartInfo.pts=T.pts),g.minSegmentPts===void 0?g.minSegmentPts=T.pts:g.minSegmentPts=Math.min(g.minSegmentPts,T.pts),g.maxSegmentPts===void 0?g.maxSegmentPts=T.pts:g.maxSegmentPts=Math.max(g.maxSegmentPts,T.pts)),typeof T.dts=="number"&&(g.timelineStartInfo.dts===void 0&&(g.timelineStartInfo.dts=T.dts),g.minSegmentDts===void 0?g.minSegmentDts=T.dts:g.minSegmentDts=Math.min(g.minSegmentDts,T.dts),g.maxSegmentDts===void 0?g.maxSegmentDts=T.dts:g.maxSegmentDts=Math.max(g.maxSegmentDts,T.dts))},se=function(g){delete g.minSegmentDts,delete g.maxSegmentDts,delete g.minSegmentPts,delete g.maxSegmentPts},ve=function(g,T){var E,C,I=g.minSegmentDts;return T||(I-=g.timelineStartInfo.dts),E=g.timelineStartInfo.baseMediaDecodeTime,E+=I,E=Math.max(0,E),g.type==="audio"&&(C=g.samplerate/V,E*=C,E=Math.floor(E)),E},We={clearDtsInfo:se,calculateTrackBaseMediaDecodeTime:ve,collectDtsInfo:G},at=4,Et=128,nt=function(g){for(var T=0,E={payloadType:-1,payloadSize:0},C=0,I=0;T<g.byteLength&&g[T]!==Et;){for(;g[T]===255;)C+=255,T++;for(C+=g[T++];g[T]===255;)I+=255,T++;if(I+=g[T++],!E.payload&&C===at){var O=String.fromCharCode(g[T+3],g[T+4],g[T+5],g[T+6]);if(O==="GA94"){E.payloadType=C,E.payloadSize=I,E.payload=g.subarray(T,T+I);break}else E.payload=void 0}T+=I,C=0,I=0}return E},Oe=function(g){return g.payload[0]!==181||(g.payload[1]<<8|g.payload[2])!==49||String.fromCharCode(g.payload[3],g.payload[4],g.payload[5],g.payload[6])!=="GA94"||g.payload[7]!==3?null:g.payload.subarray(8,g.payload.length-1)},pn=function(g,T){var E=[],C,I,O,K;if(!(T[0]&64))return E;for(I=T[0]&31,C=0;C<I;C++)O=C*3,K={type:T[O+2]&3,pts:g},T[O+2]&4&&(K.ccData=T[O+3]<<8|T[O+4],E.push(K));return E},on=function(g){for(var T=g.byteLength,E=[],C=1,I,O;C<T-2;)g[C]===0&&g[C+1]===0&&g[C+2]===3?(E.push(C+2),C+=2):C++;if(E.length===0)return g;I=T-E.length,O=new Uint8Array(I);var K=0;for(C=0;C<I;K++,C++)K===E[0]&&(K++,E.shift()),O[C]=g[K];return O},ln={parseSei:nt,parseUserData:Oe,parseCaptionPackets:pn,discardEmulationPreventionBytes:on,USER_DATA_REGISTERED_ITU_T_T35:at},_i=t,Mt=ln,wt=function(g){g=g||{},wt.prototype.init.call(this),this.parse708captions_=typeof g.parse708captions=="boolean"?g.parse708captions:!0,this.captionPackets_=[],this.ccStreams_=[new $t(0,0),new $t(0,1),new $t(1,0),new $t(1,1)],this.parse708captions_&&(this.cc708Stream_=new Dt({captionServices:g.captionServices})),this.reset(),this.ccStreams_.forEach(function(T){T.on("data",this.trigger.bind(this,"data")),T.on("partialdone",this.trigger.bind(this,"partialdone")),T.on("done",this.trigger.bind(this,"done"))},this),this.parse708captions_&&(this.cc708Stream_.on("data",this.trigger.bind(this,"data")),this.cc708Stream_.on("partialdone",this.trigger.bind(this,"partialdone")),this.cc708Stream_.on("done",this.trigger.bind(this,"done")))};wt.prototype=new _i,wt.prototype.push=function(g){var T,E,C;if(g.nalUnitType==="sei_rbsp"&&(T=Mt.parseSei(g.escapedRBSP),!!T.payload&&T.payloadType===Mt.USER_DATA_REGISTERED_ITU_T_T35&&(E=Mt.parseUserData(T),!!E))){if(g.dts<this.latestDts_){this.ignoreNextEqualDts_=!0;return}else if(g.dts===this.latestDts_&&this.ignoreNextEqualDts_){this.numSameDts_--,this.numSameDts_||(this.ignoreNextEqualDts_=!1);return}C=Mt.parseCaptionPackets(g.pts,E),this.captionPackets_=this.captionPackets_.concat(C),this.latestDts_!==g.dts&&(this.numSameDts_=0),this.numSameDts_++,this.latestDts_=g.dts}},wt.prototype.flushCCStreams=function(g){this.ccStreams_.forEach(function(T){return g==="flush"?T.flush():T.partialFlush()},this)},wt.prototype.flushStream=function(g){if(!this.captionPackets_.length){this.flushCCStreams(g);return}this.captionPackets_.forEach(function(T,E){T.presortIndex=E}),this.captionPackets_.sort(function(T,E){return T.pts===E.pts?T.presortIndex-E.presortIndex:T.pts-E.pts}),this.captionPackets_.forEach(function(T){T.type<2?this.dispatchCea608Packet(T):this.dispatchCea708Packet(T)},this),this.captionPackets_.length=0,this.flushCCStreams(g)},wt.prototype.flush=function(){return this.flushStream("flush")},wt.prototype.partialFlush=function(){return this.flushStream("partialFlush")},wt.prototype.reset=function(){this.latestDts_=null,this.ignoreNextEqualDts_=!1,this.numSameDts_=0,this.activeCea608Channel_=[null,null],this.ccStreams_.forEach(function(g){g.reset()})},wt.prototype.dispatchCea608Packet=function(g){this.setsTextOrXDSActive(g)?this.activeCea608Channel_[g.type]=null:this.setsChannel1Active(g)?this.activeCea608Channel_[g.type]=0:this.setsChannel2Active(g)&&(this.activeCea608Channel_[g.type]=1),this.activeCea608Channel_[g.type]!==null&&this.ccStreams_[(g.type<<1)+this.activeCea608Channel_[g.type]].push(g)},wt.prototype.setsChannel1Active=function(g){return(g.ccData&30720)===4096},wt.prototype.setsChannel2Active=function(g){return(g.ccData&30720)===6144},wt.prototype.setsTextOrXDSActive=function(g){return(g.ccData&28928)===256||(g.ccData&30974)===4138||(g.ccData&30974)===6186},wt.prototype.dispatchCea708Packet=function(g){this.parse708captions_&&this.cc708Stream_.push(g)};var li={127:9834,4128:32,4129:160,4133:8230,4138:352,4140:338,4144:9608,4145:8216,4146:8217,4147:8220,4148:8221,4149:8226,4153:8482,4154:353,4156:339,4157:8480,4159:376,4214:8539,4215:8540,4216:8541,4217:8542,4218:9168,4219:9124,4220:9123,4221:9135,4222:9126,4223:9121,4256:12600},Gr=function(g){var T=li[g]||g;return g&4096&&g===T?"":String.fromCharCode(T)},nn=function(g){return 32<=g&&g<=127||160<=g&&g<=255},ci=function(g){this.windowNum=g,this.reset()};ci.prototype.reset=function(){this.clearText(),this.pendingNewLine=!1,this.winAttr={},this.penAttr={},this.penLoc={},this.penColor={},this.visible=0,this.rowLock=0,this.columnLock=0,this.priority=0,this.relativePositioning=0,this.anchorVertical=0,this.anchorHorizontal=0,this.anchorPoint=0,this.rowCount=1,this.virtualRowCount=this.rowCount+1,this.columnCount=41,this.windowStyle=0,this.penStyle=0},ci.prototype.getText=function(){return this.rows.join(`
226
+ `)},ci.prototype.clearText=function(){this.rows=[""],this.rowIdx=0},ci.prototype.newLine=function(g){for(this.rows.length>=this.virtualRowCount&&typeof this.beforeRowOverflow=="function"&&this.beforeRowOverflow(g),this.rows.length>0&&(this.rows.push(""),this.rowIdx++);this.rows.length>this.virtualRowCount;)this.rows.shift(),this.rowIdx--},ci.prototype.isEmpty=function(){return this.rows.length===0?!0:this.rows.length===1?this.rows[0]==="":!1},ci.prototype.addText=function(g){this.rows[this.rowIdx]+=g},ci.prototype.backspace=function(){if(!this.isEmpty()){var g=this.rows[this.rowIdx];this.rows[this.rowIdx]=g.substr(0,g.length-1)}};var ki=function(g,T,E){this.serviceNum=g,this.text="",this.currentWindow=new ci(-1),this.windows=[],this.stream=E,typeof T=="string"&&this.createTextDecoder(T)};ki.prototype.init=function(g,T){this.startPts=g;for(var E=0;E<8;E++)this.windows[E]=new ci(E),typeof T=="function"&&(this.windows[E].beforeRowOverflow=T)},ki.prototype.setCurrentWindow=function(g){this.currentWindow=this.windows[g]},ki.prototype.createTextDecoder=function(g){if(typeof TextDecoder>"u")this.stream.trigger("log",{level:"warn",message:"The `encoding` option is unsupported without TextDecoder support"});else try{this.textDecoder_=new TextDecoder(g)}catch(T){this.stream.trigger("log",{level:"warn",message:"TextDecoder could not be created with "+g+" encoding. "+T})}};var Dt=function(g){g=g||{},Dt.prototype.init.call(this);var T=this,E=g.captionServices||{},C={},I;Object.keys(E).forEach(O=>{I=E[O],/^SERVICE/.test(O)&&(C[O]=I.encoding)}),this.serviceEncodings=C,this.current708Packet=null,this.services={},this.push=function(O){O.type===3?(T.new708Packet(),T.add708Bytes(O)):(T.current708Packet===null&&T.new708Packet(),T.add708Bytes(O))}};Dt.prototype=new _i,Dt.prototype.new708Packet=function(){this.current708Packet!==null&&this.push708Packet(),this.current708Packet={data:[],ptsVals:[]}},Dt.prototype.add708Bytes=function(g){var T=g.ccData,E=T>>>8,C=T&255;this.current708Packet.ptsVals.push(g.pts),this.current708Packet.data.push(E),this.current708Packet.data.push(C)},Dt.prototype.push708Packet=function(){var g=this.current708Packet,T=g.data,E=null,C=null,I=0,O=T[I++];for(g.seq=O>>6,g.sizeCode=O&63;I<T.length;I++)O=T[I++],E=O>>5,C=O&31,E===7&&C>0&&(O=T[I++],E=O),this.pushServiceBlock(E,I,C),C>0&&(I+=C-1)},Dt.prototype.pushServiceBlock=function(g,T,E){var C,I=T,O=this.current708Packet.data,K=this.services[g];for(K||(K=this.initService(g,I));I<T+E&&I<O.length;I++)C=O[I],nn(C)?I=this.handleText(I,K):C===24?I=this.multiByteCharacter(I,K):C===16?I=this.extendedCommands(I,K):128<=C&&C<=135?I=this.setCurrentWindow(I,K):152<=C&&C<=159?I=this.defineWindow(I,K):C===136?I=this.clearWindows(I,K):C===140?I=this.deleteWindows(I,K):C===137?I=this.displayWindows(I,K):C===138?I=this.hideWindows(I,K):C===139?I=this.toggleWindows(I,K):C===151?I=this.setWindowAttributes(I,K):C===144?I=this.setPenAttributes(I,K):C===145?I=this.setPenColor(I,K):C===146?I=this.setPenLocation(I,K):C===143?K=this.reset(I,K):C===8?K.currentWindow.backspace():C===12?K.currentWindow.clearText():C===13?K.currentWindow.pendingNewLine=!0:C===14?K.currentWindow.clearText():C===141&&I++},Dt.prototype.extendedCommands=function(g,T){var E=this.current708Packet.data,C=E[++g];return nn(C)&&(g=this.handleText(g,T,{isExtended:!0})),g},Dt.prototype.getPts=function(g){return this.current708Packet.ptsVals[Math.floor(g/2)]},Dt.prototype.initService=function(g,T){var C="SERVICE"+g,E=this,C,I;return C in this.serviceEncodings&&(I=this.serviceEncodings[C]),this.services[g]=new ki(g,I,E),this.services[g].init(this.getPts(T),function(O){E.flushDisplayed(O,E.services[g])}),this.services[g]},Dt.prototype.handleText=function(g,T,E){var C=E&&E.isExtended,I=E&&E.isMultiByte,O=this.current708Packet.data,K=C?4096:0,X=O[g],Z=O[g+1],ne=T.currentWindow,ce,Te;function Ye(De){return De.map(rt=>("0"+(rt&255).toString(16)).slice(-2)).join("")}if(I?(Te=[X,Z],g++):Te=[X],T.textDecoder_&&!C)ce=T.textDecoder_.decode(new Uint8Array(Te));else if(I){const De=Ye(Te);ce=String.fromCharCode(parseInt(De,16))}else ce=Gr(K|X);return ne.pendingNewLine&&!ne.isEmpty()&&ne.newLine(this.getPts(g)),ne.pendingNewLine=!1,ne.addText(ce),g},Dt.prototype.multiByteCharacter=function(g,T){var E=this.current708Packet.data,C=E[g+1],I=E[g+2];return nn(C)&&nn(I)&&(g=this.handleText(++g,T,{isMultiByte:!0})),g},Dt.prototype.setCurrentWindow=function(g,T){var E=this.current708Packet.data,C=E[g],I=C&7;return T.setCurrentWindow(I),g},Dt.prototype.defineWindow=function(g,T){var E=this.current708Packet.data,C=E[g],I=C&7;T.setCurrentWindow(I);var O=T.currentWindow;return C=E[++g],O.visible=(C&32)>>5,O.rowLock=(C&16)>>4,O.columnLock=(C&8)>>3,O.priority=C&7,C=E[++g],O.relativePositioning=(C&128)>>7,O.anchorVertical=C&127,C=E[++g],O.anchorHorizontal=C,C=E[++g],O.anchorPoint=(C&240)>>4,O.rowCount=C&15,C=E[++g],O.columnCount=C&63,C=E[++g],O.windowStyle=(C&56)>>3,O.penStyle=C&7,O.virtualRowCount=O.rowCount+1,g},Dt.prototype.setWindowAttributes=function(g,T){var E=this.current708Packet.data,C=E[g],I=T.currentWindow.winAttr;return C=E[++g],I.fillOpacity=(C&192)>>6,I.fillRed=(C&48)>>4,I.fillGreen=(C&12)>>2,I.fillBlue=C&3,C=E[++g],I.borderType=(C&192)>>6,I.borderRed=(C&48)>>4,I.borderGreen=(C&12)>>2,I.borderBlue=C&3,C=E[++g],I.borderType+=(C&128)>>5,I.wordWrap=(C&64)>>6,I.printDirection=(C&48)>>4,I.scrollDirection=(C&12)>>2,I.justify=C&3,C=E[++g],I.effectSpeed=(C&240)>>4,I.effectDirection=(C&12)>>2,I.displayEffect=C&3,g},Dt.prototype.flushDisplayed=function(g,T){for(var E=[],C=0;C<8;C++)T.windows[C].visible&&!T.windows[C].isEmpty()&&E.push(T.windows[C].getText());T.endPts=g,T.text=E.join(`
227
+
228
+ `),this.pushCaption(T),T.startPts=g},Dt.prototype.pushCaption=function(g){g.text!==""&&(this.trigger("data",{startPts:g.startPts,endPts:g.endPts,text:g.text,stream:"cc708_"+g.serviceNum}),g.text="",g.startPts=g.endPts)},Dt.prototype.displayWindows=function(g,T){var E=this.current708Packet.data,C=E[++g],I=this.getPts(g);this.flushDisplayed(I,T);for(var O=0;O<8;O++)C&1<<O&&(T.windows[O].visible=1);return g},Dt.prototype.hideWindows=function(g,T){var E=this.current708Packet.data,C=E[++g],I=this.getPts(g);this.flushDisplayed(I,T);for(var O=0;O<8;O++)C&1<<O&&(T.windows[O].visible=0);return g},Dt.prototype.toggleWindows=function(g,T){var E=this.current708Packet.data,C=E[++g],I=this.getPts(g);this.flushDisplayed(I,T);for(var O=0;O<8;O++)C&1<<O&&(T.windows[O].visible^=1);return g},Dt.prototype.clearWindows=function(g,T){var E=this.current708Packet.data,C=E[++g],I=this.getPts(g);this.flushDisplayed(I,T);for(var O=0;O<8;O++)C&1<<O&&T.windows[O].clearText();return g},Dt.prototype.deleteWindows=function(g,T){var E=this.current708Packet.data,C=E[++g],I=this.getPts(g);this.flushDisplayed(I,T);for(var O=0;O<8;O++)C&1<<O&&T.windows[O].reset();return g},Dt.prototype.setPenAttributes=function(g,T){var E=this.current708Packet.data,C=E[g],I=T.currentWindow.penAttr;return C=E[++g],I.textTag=(C&240)>>4,I.offset=(C&12)>>2,I.penSize=C&3,C=E[++g],I.italics=(C&128)>>7,I.underline=(C&64)>>6,I.edgeType=(C&56)>>3,I.fontStyle=C&7,g},Dt.prototype.setPenColor=function(g,T){var E=this.current708Packet.data,C=E[g],I=T.currentWindow.penColor;return C=E[++g],I.fgOpacity=(C&192)>>6,I.fgRed=(C&48)>>4,I.fgGreen=(C&12)>>2,I.fgBlue=C&3,C=E[++g],I.bgOpacity=(C&192)>>6,I.bgRed=(C&48)>>4,I.bgGreen=(C&12)>>2,I.bgBlue=C&3,C=E[++g],I.edgeRed=(C&48)>>4,I.edgeGreen=(C&12)>>2,I.edgeBlue=C&3,g},Dt.prototype.setPenLocation=function(g,T){var E=this.current708Packet.data,C=E[g],I=T.currentWindow.penLoc;return T.currentWindow.pendingNewLine=!0,C=E[++g],I.row=C&15,C=E[++g],I.column=C&63,g},Dt.prototype.reset=function(g,T){var E=this.getPts(g);return this.flushDisplayed(E,T),this.initService(T.serviceNum,g)};var kg={42:225,92:233,94:237,95:243,96:250,123:231,124:247,125:209,126:241,127:9608,304:174,305:176,306:189,307:191,308:8482,309:162,310:163,311:9834,312:224,313:160,314:232,315:226,316:234,317:238,318:244,319:251,544:193,545:201,546:211,547:218,548:220,549:252,550:8216,551:161,552:42,553:39,554:8212,555:169,556:8480,557:8226,558:8220,559:8221,560:192,561:194,562:199,563:200,564:202,565:203,566:235,567:206,568:207,569:239,570:212,571:217,572:249,573:219,574:171,575:187,800:195,801:227,802:205,803:204,804:236,805:210,806:242,807:213,808:245,809:123,810:125,811:92,812:94,813:95,814:124,815:126,816:196,817:228,818:214,819:246,820:223,821:165,822:164,823:9474,824:197,825:229,826:216,827:248,828:9484,829:9488,830:9492,831:9496},oa=function(g){return g===null?"":(g=kg[g]||g,String.fromCharCode(g))},Co=14,Qi=[4352,4384,4608,4640,5376,5408,5632,5664,5888,5920,4096,4864,4896,5120,5152],Sr=function(){for(var g=[],T=Co+1;T--;)g.push({text:"",indent:0,offset:0});return g},$t=function(g,T){$t.prototype.init.call(this),this.field_=g||0,this.dataChannel_=T||0,this.name_="CC"+((this.field_<<1|this.dataChannel_)+1),this.setConstants(),this.reset(),this.push=function(E){var C,I,O,K,X;if(C=E.ccData&32639,C===this.lastControlCode_){this.lastControlCode_=null;return}if((C&61440)===4096?this.lastControlCode_=C:C!==this.PADDING_&&(this.lastControlCode_=null),O=C>>>8,K=C&255,C!==this.PADDING_)if(C===this.RESUME_CAPTION_LOADING_)this.mode_="popOn";else if(C===this.END_OF_CAPTION_)this.mode_="popOn",this.clearFormatting(E.pts),this.flushDisplayed(E.pts),I=this.displayed_,this.displayed_=this.nonDisplayed_,this.nonDisplayed_=I,this.startPts_=E.pts;else if(C===this.ROLL_UP_2_ROWS_)this.rollUpRows_=2,this.setRollUp(E.pts);else if(C===this.ROLL_UP_3_ROWS_)this.rollUpRows_=3,this.setRollUp(E.pts);else if(C===this.ROLL_UP_4_ROWS_)this.rollUpRows_=4,this.setRollUp(E.pts);else if(C===this.CARRIAGE_RETURN_)this.clearFormatting(E.pts),this.flushDisplayed(E.pts),this.shiftRowsUp_(),this.startPts_=E.pts;else if(C===this.BACKSPACE_)this.mode_==="popOn"?this.nonDisplayed_[this.row_].text=this.nonDisplayed_[this.row_].text.slice(0,-1):this.displayed_[this.row_].text=this.displayed_[this.row_].text.slice(0,-1);else if(C===this.ERASE_DISPLAYED_MEMORY_)this.flushDisplayed(E.pts),this.displayed_=Sr();else if(C===this.ERASE_NON_DISPLAYED_MEMORY_)this.nonDisplayed_=Sr();else if(C===this.RESUME_DIRECT_CAPTIONING_)this.mode_!=="paintOn"&&(this.flushDisplayed(E.pts),this.displayed_=Sr()),this.mode_="paintOn",this.startPts_=E.pts;else if(this.isSpecialCharacter(O,K))O=(O&3)<<8,X=oa(O|K),this[this.mode_](E.pts,X),this.column_++;else if(this.isExtCharacter(O,K))this.mode_==="popOn"?this.nonDisplayed_[this.row_].text=this.nonDisplayed_[this.row_].text.slice(0,-1):this.displayed_[this.row_].text=this.displayed_[this.row_].text.slice(0,-1),O=(O&3)<<8,X=oa(O|K),this[this.mode_](E.pts,X),this.column_++;else if(this.isMidRowCode(O,K))this.clearFormatting(E.pts),this[this.mode_](E.pts," "),this.column_++,(K&14)===14&&this.addFormatting(E.pts,["i"]),(K&1)===1&&this.addFormatting(E.pts,["u"]);else if(this.isOffsetControlCode(O,K)){const ne=K&3;this.nonDisplayed_[this.row_].offset=ne,this.column_+=ne}else if(this.isPAC(O,K)){var Z=Qi.indexOf(C&7968);if(this.mode_==="rollUp"&&(Z-this.rollUpRows_+1<0&&(Z=this.rollUpRows_-1),this.setRollUp(E.pts,Z)),Z!==this.row_&&Z>=0&&Z<=14&&(this.clearFormatting(E.pts),this.row_=Z),K&1&&this.formatting_.indexOf("u")===-1&&this.addFormatting(E.pts,["u"]),(C&16)===16){const ne=(C&14)>>1;this.column_=ne*4,this.nonDisplayed_[this.row_].indent+=ne}this.isColorPAC(K)&&(K&14)===14&&this.addFormatting(E.pts,["i"])}else this.isNormalChar(O)&&(K===0&&(K=null),X=oa(O),X+=oa(K),this[this.mode_](E.pts,X),this.column_+=X.length)}};$t.prototype=new _i,$t.prototype.flushDisplayed=function(g){const T=C=>{this.trigger("log",{level:"warn",message:"Skipping a malformed 608 caption at index "+C+"."})},E=[];this.displayed_.forEach((C,I)=>{if(C&&C.text&&C.text.length){try{C.text=C.text.trim()}catch{T(I)}C.text.length&&E.push({text:C.text,line:I+1,position:10+Math.min(70,C.indent*10)+C.offset*2.5})}else C==null&&T(I)}),E.length&&this.trigger("data",{startPts:this.startPts_,endPts:g,content:E,stream:this.name_})},$t.prototype.reset=function(){this.mode_="popOn",this.topRow_=0,this.startPts_=0,this.displayed_=Sr(),this.nonDisplayed_=Sr(),this.lastControlCode_=null,this.column_=0,this.row_=Co,this.rollUpRows_=2,this.formatting_=[]},$t.prototype.setConstants=function(){this.dataChannel_===0?(this.BASE_=16,this.EXT_=17,this.CONTROL_=(20|this.field_)<<8,this.OFFSET_=23):this.dataChannel_===1&&(this.BASE_=24,this.EXT_=25,this.CONTROL_=(28|this.field_)<<8,this.OFFSET_=31),this.PADDING_=0,this.RESUME_CAPTION_LOADING_=this.CONTROL_|32,this.END_OF_CAPTION_=this.CONTROL_|47,this.ROLL_UP_2_ROWS_=this.CONTROL_|37,this.ROLL_UP_3_ROWS_=this.CONTROL_|38,this.ROLL_UP_4_ROWS_=this.CONTROL_|39,this.CARRIAGE_RETURN_=this.CONTROL_|45,this.RESUME_DIRECT_CAPTIONING_=this.CONTROL_|41,this.BACKSPACE_=this.CONTROL_|33,this.ERASE_DISPLAYED_MEMORY_=this.CONTROL_|44,this.ERASE_NON_DISPLAYED_MEMORY_=this.CONTROL_|46},$t.prototype.isSpecialCharacter=function(g,T){return g===this.EXT_&&T>=48&&T<=63},$t.prototype.isExtCharacter=function(g,T){return(g===this.EXT_+1||g===this.EXT_+2)&&T>=32&&T<=63},$t.prototype.isMidRowCode=function(g,T){return g===this.EXT_&&T>=32&&T<=47},$t.prototype.isOffsetControlCode=function(g,T){return g===this.OFFSET_&&T>=33&&T<=35},$t.prototype.isPAC=function(g,T){return g>=this.BASE_&&g<this.BASE_+8&&T>=64&&T<=127},$t.prototype.isColorPAC=function(g){return g>=64&&g<=79||g>=96&&g<=127},$t.prototype.isNormalChar=function(g){return g>=32&&g<=127},$t.prototype.setRollUp=function(g,T){if(this.mode_!=="rollUp"&&(this.row_=Co,this.mode_="rollUp",this.flushDisplayed(g),this.nonDisplayed_=Sr(),this.displayed_=Sr()),T!==void 0&&T!==this.row_)for(var E=0;E<this.rollUpRows_;E++)this.displayed_[T-E]=this.displayed_[this.row_-E],this.displayed_[this.row_-E]={text:"",indent:0,offset:0};T===void 0&&(T=this.row_),this.topRow_=T-this.rollUpRows_+1},$t.prototype.addFormatting=function(g,T){this.formatting_=this.formatting_.concat(T);var E=T.reduce(function(C,I){return C+"<"+I+">"},"");this[this.mode_](g,E)},$t.prototype.clearFormatting=function(g){if(this.formatting_.length){var T=this.formatting_.reverse().reduce(function(E,C){return E+"</"+C+">"},"");this.formatting_=[],this[this.mode_](g,T)}},$t.prototype.popOn=function(g,T){var E=this.nonDisplayed_[this.row_].text;E+=T,this.nonDisplayed_[this.row_].text=E},$t.prototype.rollUp=function(g,T){var E=this.displayed_[this.row_].text;E+=T,this.displayed_[this.row_].text=E},$t.prototype.shiftRowsUp_=function(){var g;for(g=0;g<this.topRow_;g++)this.displayed_[g]={text:"",indent:0,offset:0};for(g=this.row_+1;g<Co+1;g++)this.displayed_[g]={text:"",indent:0,offset:0};for(g=this.topRow_;g<this.row_;g++)this.displayed_[g]=this.displayed_[g+1];this.displayed_[this.row_]={text:"",indent:0,offset:0}},$t.prototype.paintOn=function(g,T){var E=this.displayed_[this.row_].text;E+=T,this.displayed_[this.row_].text=E};var Jl={CaptionStream:wt,Cea608Stream:$t,Cea708Stream:Dt},xo={H264_STREAM_TYPE:27,ADTS_STREAM_TYPE:15,METADATA_STREAM_TYPE:21},Tg=t,Eo=8589934592,Sg=4294967296,Fd="shared",Ql=function(g,T){var E=1;for(g>T&&(E=-1);Math.abs(T-g)>Sg;)g+=E*Eo;return g},wo=function(g){var T,E;wo.prototype.init.call(this),this.type_=g||Fd,this.push=function(C){if(C.type==="metadata"){this.trigger("data",C);return}this.type_!==Fd&&C.type!==this.type_||(E===void 0&&(E=C.dts),C.dts=Ql(C.dts,E),C.pts=Ql(C.pts,E),T=C.dts,this.trigger("data",C))},this.flush=function(){E=T,this.trigger("done")},this.endTimeline=function(){this.flush(),this.trigger("endedtimeline")},this.discontinuity=function(){E=void 0,T=void 0},this.reset=function(){this.discontinuity(),this.trigger("reset")}};wo.prototype=new Tg;var Vd={TimestampRolloverStream:wo,handleRollover:Ql},jd=(g,T,E)=>{if(!g)return-1;for(var C=E;C<g.length;C++)if(g[C]===T)return C;return-1},Cg={typedArrayIndexOf:jd},_s=Cg.typedArrayIndexOf,la={Utf8:3},$d=function(g,T,E){var C,I="";for(C=T;C<E;C++)I+="%"+("00"+g[C].toString(16)).slice(-2);return I},ca=function(g,T,E){return decodeURIComponent($d(g,T,E))},ua=function(g,T,E){return unescape($d(g,T,E))},Cr=function(g){return g[0]<<21|g[1]<<14|g[2]<<7|g[3]},qt={APIC:function(g){var T=1,E,C,I="-->";g.data[0]===la.Utf8&&(E=_s(g.data,0,T),!(E<0)&&(g.mimeType=ua(g.data,T,E),T=E+1,g.pictureType=g.data[T],T++,C=_s(g.data,0,T),!(C<0)&&(g.description=ca(g.data,T,C),T=C+1,g.mimeType===I?g.url=ua(g.data,T,g.data.length):g.pictureData=g.data.subarray(T,g.data.length))))},"T*":function(g){g.data[0]===la.Utf8&&(g.value=ca(g.data,1,g.data.length).replace(/\0*$/,""),g.values=g.value.split("\0"))},TXXX:function(g){var T;g.data[0]===la.Utf8&&(T=_s(g.data,0,1),T!==-1&&(g.description=ca(g.data,1,T),g.value=ca(g.data,T+1,g.data.length).replace(/\0*$/,""),g.data=g.value))},"W*":function(g){g.url=ua(g.data,0,g.data.length).replace(/\0.*$/,"")},WXXX:function(g){var T;g.data[0]===la.Utf8&&(T=_s(g.data,0,1),T!==-1&&(g.description=ca(g.data,1,T),g.url=ua(g.data,T+1,g.data.length).replace(/\0.*$/,"")))},PRIV:function(g){var T;for(T=0;T<g.data.length;T++)if(g.data[T]===0){g.owner=ua(g.data,0,T);break}g.privateData=g.data.subarray(T+1),g.data=g.privateData}},xg=function(g){var T,E,C=10,I=0,O=[];if(!(g.length<10||g[0]!==73||g[1]!==68||g[2]!==51)){I=Cr(g.subarray(6,10)),I+=10;var K=g[5]&64;K&&(C+=4,C+=Cr(g.subarray(10,14)),I-=Cr(g.subarray(16,20)));do{if(T=Cr(g.subarray(C+4,C+8)),T<1)break;E=String.fromCharCode(g[C],g[C+1],g[C+2],g[C+3]);var X={id:E,data:g.subarray(C+10,C+T+10)};X.key=X.id,qt[X.id]?qt[X.id](X):X.id[0]==="T"?qt["T*"](X):X.id[0]==="W"&&qt["W*"](X),O.push(X),C+=10,C+=T}while(C<I);return O}},Hd={parseId3Frames:xg,parseSyncSafeInteger:Cr,frameParsers:qt},Eg=t,da=xo,Ti=Hd,Do;Do=function(g){var T={descriptor:g&&g.descriptor},E=0,C=[],I=0,O;if(Do.prototype.init.call(this),this.dispatchType=da.METADATA_STREAM_TYPE.toString(16),T.descriptor)for(O=0;O<T.descriptor.length;O++)this.dispatchType+=("00"+T.descriptor[O].toString(16)).slice(-2);this.push=function(K){var X,Z,ne,ce,Te,Ye;if(K.type==="timed-metadata"){if(K.dataAlignmentIndicator&&(I=0,C.length=0),C.length===0&&(K.data.length<10||K.data[0]!==73||K.data[1]!==68||K.data[2]!==51)){this.trigger("log",{level:"warn",message:"Skipping unrecognized metadata packet"});return}if(C.push(K),I+=K.data.byteLength,C.length===1&&(E=Ti.parseSyncSafeInteger(K.data.subarray(6,10)),E+=10),!(I<E)){for(X={data:new Uint8Array(E),frames:[],pts:C[0].pts,dts:C[0].dts},Te=0;Te<E;)X.data.set(C[0].data.subarray(0,E-Te),Te),Te+=C[0].data.byteLength,I-=C[0].data.byteLength,C.shift();Z=10,X.data[5]&64&&(Z+=4,Z+=Ti.parseSyncSafeInteger(X.data.subarray(10,14)),E-=Ti.parseSyncSafeInteger(X.data.subarray(16,20)));do{if(ne=Ti.parseSyncSafeInteger(X.data.subarray(Z+4,Z+8)),ne<1){this.trigger("log",{level:"warn",message:"Malformed ID3 frame encountered. Skipping remaining metadata parsing."});break}if(Ye=String.fromCharCode(X.data[Z],X.data[Z+1],X.data[Z+2],X.data[Z+3]),ce={id:Ye,data:X.data.subarray(Z+10,Z+ne+10)},ce.key=ce.id,Ti.frameParsers[ce.id]?Ti.frameParsers[ce.id](ce):ce.id[0]==="T"?Ti.frameParsers["T*"](ce):ce.id[0]==="W"&&Ti.frameParsers["W*"](ce),ce.owner==="com.apple.streaming.transportStreamTimestamp"){var De=ce.data,rt=(De[3]&1)<<30|De[4]<<22|De[5]<<14|De[6]<<6|De[7]>>>2;rt*=4,rt+=De[7]&3,ce.timeStamp=rt,X.pts===void 0&&X.dts===void 0&&(X.pts=ce.timeStamp,X.dts=ce.timeStamp),this.trigger("timestamp",ce)}X.frames.push(ce),Z+=10,Z+=ne}while(Z<E);this.trigger("data",X)}}}},Do.prototype=new Eg;var wg=Do,Ao=t,Zl=Jl,Si=xo,Dg=Vd.TimestampRolloverStream,ha,fa,ks,Ts=188,ec=71;ha=function(){var g=new Uint8Array(Ts),T=0;ha.prototype.init.call(this),this.push=function(E){var C=0,I=Ts,O;for(T?(O=new Uint8Array(E.byteLength+T),O.set(g.subarray(0,T)),O.set(E,T),T=0):O=E;I<O.byteLength;){if(O[C]===ec&&O[I]===ec){this.trigger("data",O.subarray(C,I)),C+=Ts,I+=Ts;continue}C++,I++}C<O.byteLength&&(g.set(O.subarray(C),0),T=O.byteLength-C)},this.flush=function(){T===Ts&&g[0]===ec&&(this.trigger("data",g),T=0),this.trigger("done")},this.endTimeline=function(){this.flush(),this.trigger("endedtimeline")},this.reset=function(){T=0,this.trigger("reset")}},ha.prototype=new Ao,fa=function(){var g,T,E,C;fa.prototype.init.call(this),C=this,this.packetsWaitingForPmt=[],this.programMapTable=void 0,g=function(I,O){var K=0;O.payloadUnitStartIndicator&&(K+=I[K]+1),O.type==="pat"?T(I.subarray(K),O):E(I.subarray(K),O)},T=function(I,O){O.section_number=I[7],O.last_section_number=I[8],C.pmtPid=(I[10]&31)<<8|I[11],O.pmtPid=C.pmtPid},E=function(I,O){var K,X,Z,ne;if(I[5]&1){for(C.programMapTable={video:null,audio:null,"timed-metadata":{}},K=(I[1]&15)<<8|I[2],X=3+K-4,Z=(I[10]&15)<<8|I[11],ne=12+Z;ne<X;){var ce=I[ne],Te=(I[ne+1]&31)<<8|I[ne+2];ce===Si.H264_STREAM_TYPE&&C.programMapTable.video===null?C.programMapTable.video=Te:ce===Si.ADTS_STREAM_TYPE&&C.programMapTable.audio===null?C.programMapTable.audio=Te:ce===Si.METADATA_STREAM_TYPE&&(C.programMapTable["timed-metadata"][Te]=ce),ne+=((I[ne+3]&15)<<8|I[ne+4])+5}O.programMapTable=C.programMapTable}},this.push=function(I){var O={},K=4;if(O.payloadUnitStartIndicator=!!(I[1]&64),O.pid=I[1]&31,O.pid<<=8,O.pid|=I[2],(I[3]&48)>>>4>1&&(K+=I[K]+1),O.pid===0)O.type="pat",g(I.subarray(K),O),this.trigger("data",O);else if(O.pid===this.pmtPid)for(O.type="pmt",g(I.subarray(K),O),this.trigger("data",O);this.packetsWaitingForPmt.length;)this.processPes_.apply(this,this.packetsWaitingForPmt.shift());else this.programMapTable===void 0?this.packetsWaitingForPmt.push([I,K,O]):this.processPes_(I,K,O)},this.processPes_=function(I,O,K){K.pid===this.programMapTable.video?K.streamType=Si.H264_STREAM_TYPE:K.pid===this.programMapTable.audio?K.streamType=Si.ADTS_STREAM_TYPE:K.streamType=this.programMapTable["timed-metadata"][K.pid],K.type="pes",K.data=I.subarray(O),this.trigger("data",K)}},fa.prototype=new Ao,fa.STREAM_TYPES={h264:27,adts:15},ks=function(){var g=this,T=!1,E={data:[],size:0},C={data:[],size:0},I={data:[],size:0},O,K=function(Z,ne){var ce;const Te=Z[0]<<16|Z[1]<<8|Z[2];ne.data=new Uint8Array,Te===1&&(ne.packetLength=6+(Z[4]<<8|Z[5]),ne.dataAlignmentIndicator=(Z[6]&4)!==0,ce=Z[7],ce&192&&(ne.pts=(Z[9]&14)<<27|(Z[10]&255)<<20|(Z[11]&254)<<12|(Z[12]&255)<<5|(Z[13]&254)>>>3,ne.pts*=4,ne.pts+=(Z[13]&6)>>>1,ne.dts=ne.pts,ce&64&&(ne.dts=(Z[14]&14)<<27|(Z[15]&255)<<20|(Z[16]&254)<<12|(Z[17]&255)<<5|(Z[18]&254)>>>3,ne.dts*=4,ne.dts+=(Z[18]&6)>>>1)),ne.data=Z.subarray(9+Z[8]))},X=function(Z,ne,ce){var Te=new Uint8Array(Z.size),Ye={type:ne},De=0,rt=0,yt=!1,xn;if(!(!Z.data.length||Z.size<9)){for(Ye.trackId=Z.data[0].pid,De=0;De<Z.data.length;De++)xn=Z.data[De],Te.set(xn.data,rt),rt+=xn.data.byteLength;K(Te,Ye),yt=ne==="video"||Ye.packetLength<=Z.size,(ce||yt)&&(Z.size=0,Z.data.length=0),yt&&g.trigger("data",Ye)}};ks.prototype.init.call(this),this.push=function(Z){({pat:function(){},pes:function(){var ne,ce;switch(Z.streamType){case Si.H264_STREAM_TYPE:ne=E,ce="video";break;case Si.ADTS_STREAM_TYPE:ne=C,ce="audio";break;case Si.METADATA_STREAM_TYPE:ne=I,ce="timed-metadata";break;default:return}Z.payloadUnitStartIndicator&&X(ne,ce,!0),ne.data.push(Z),ne.size+=Z.data.byteLength},pmt:function(){var ne={type:"metadata",tracks:[]};O=Z.programMapTable,O.video!==null&&ne.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+O.video,codec:"avc",type:"video"}),O.audio!==null&&ne.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+O.audio,codec:"adts",type:"audio"}),T=!0,g.trigger("data",ne)}})[Z.type]()},this.reset=function(){E.size=0,E.data.length=0,C.size=0,C.data.length=0,this.trigger("reset")},this.flushStreams_=function(){X(E,"video"),X(C,"audio"),X(I,"timed-metadata")},this.flush=function(){if(!T&&O){var Z={type:"metadata",tracks:[]};O.video!==null&&Z.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+O.video,codec:"avc",type:"video"}),O.audio!==null&&Z.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+O.audio,codec:"adts",type:"audio"}),g.trigger("data",Z)}T=!1,this.flushStreams_(),this.trigger("done")}},ks.prototype=new Ao;var qd={PAT_PID:0,MP2T_PACKET_LENGTH:Ts,TransportPacketStream:ha,TransportParseStream:fa,ElementaryStream:ks,TimestampRolloverStream:Dg,CaptionStream:Zl.CaptionStream,Cea608Stream:Zl.Cea608Stream,Cea708Stream:Zl.Cea708Stream,MetadataStream:wg};for(var tc in Si)Si.hasOwnProperty(tc)&&(qd[tc]=Si[tc]);var Io=qd,Ag=t,Ig=Tt.ONE_SECOND_IN_TS,pa,zd=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];pa=function(g){var T,E=0;pa.prototype.init.call(this),this.skipWarn_=function(C,I){this.trigger("log",{level:"warn",message:`adts skiping bytes ${C} to ${I} in frame ${E} outside syncword`})},this.push=function(C){var I=0,O,K,X,Z,ne;if(g||(E=0),C.type==="audio"){T&&T.length?(X=T,T=new Uint8Array(X.byteLength+C.data.byteLength),T.set(X),T.set(C.data,X.byteLength)):T=C.data;for(var ce;I+7<T.length;){if(T[I]!==255||(T[I+1]&246)!==240){typeof ce!="number"&&(ce=I),I++;continue}if(typeof ce=="number"&&(this.skipWarn_(ce,I),ce=null),K=(~T[I+1]&1)*2,O=(T[I+3]&3)<<11|T[I+4]<<3|(T[I+5]&224)>>5,Z=((T[I+6]&3)+1)*1024,ne=Z*Ig/zd[(T[I+2]&60)>>>2],T.byteLength-I<O)break;this.trigger("data",{pts:C.pts+E*ne,dts:C.dts+E*ne,sampleCount:Z,audioobjecttype:(T[I+2]>>>6&3)+1,channelcount:(T[I+2]&1)<<2|(T[I+3]&192)>>>6,samplerate:zd[(T[I+2]&60)>>>2],samplingfrequencyindex:(T[I+2]&60)>>>2,samplesize:16,data:T.subarray(I+7+K,I+O)}),E++,I+=O}typeof ce=="number"&&(this.skipWarn_(ce,I),ce=null),T=T.subarray(I)}},this.flush=function(){E=0,this.trigger("done")},this.reset=function(){T=void 0,this.trigger("reset")},this.endTimeline=function(){T=void 0,this.trigger("endedtimeline")}},pa.prototype=new Ag;var Pg=pa,Gd;Gd=function(g){var T=g.byteLength,E=0,C=0;this.length=function(){return 8*T},this.bitsAvailable=function(){return 8*T+C},this.loadWord=function(){var I=g.byteLength-T,O=new Uint8Array(4),K=Math.min(4,T);if(K===0)throw new Error("no bytes available");O.set(g.subarray(I,I+K)),E=new DataView(O.buffer).getUint32(0),C=K*8,T-=K},this.skipBits=function(I){var O;C>I?(E<<=I,C-=I):(I-=C,O=Math.floor(I/8),I-=O*8,T-=O,this.loadWord(),E<<=I,C-=I)},this.readBits=function(I){var O=Math.min(C,I),K=E>>>32-O;return C-=O,C>0?E<<=O:T>0&&this.loadWord(),O=I-O,O>0?K<<O|this.readBits(O):K},this.skipLeadingZeros=function(){var I;for(I=0;I<C;++I)if(E&2147483648>>>I)return E<<=I,C-=I,I;return this.loadWord(),I+this.skipLeadingZeros()},this.skipUnsignedExpGolomb=function(){this.skipBits(1+this.skipLeadingZeros())},this.skipExpGolomb=function(){this.skipBits(1+this.skipLeadingZeros())},this.readUnsignedExpGolomb=function(){var I=this.skipLeadingZeros();return this.readBits(I+1)-1},this.readExpGolomb=function(){var I=this.readUnsignedExpGolomb();return 1&I?1+I>>>1:-1*(I>>>1)},this.readBoolean=function(){return this.readBits(1)===1},this.readUnsignedByte=function(){return this.readBits(8)},this.loadWord()};var Ng=Gd,Wd=t,nc=Ng,Po,No,Kd;No=function(){var g=0,T,E;No.prototype.init.call(this),this.push=function(C){var I;E?(I=new Uint8Array(E.byteLength+C.data.byteLength),I.set(E),I.set(C.data,E.byteLength),E=I):E=C.data;for(var O=E.byteLength;g<O-3;g++)if(E[g+2]===1){T=g+5;break}for(;T<O;)switch(E[T]){case 0:if(E[T-1]!==0){T+=2;break}else if(E[T-2]!==0){T++;break}g+3!==T-2&&this.trigger("data",E.subarray(g+3,T-2));do T++;while(E[T]!==1&&T<O);g=T-2,T+=3;break;case 1:if(E[T-1]!==0||E[T-2]!==0){T+=3;break}this.trigger("data",E.subarray(g+3,T-2)),g=T-2,T+=3;break;default:T+=3;break}E=E.subarray(g),T-=g,g=0},this.reset=function(){E=null,g=0,this.trigger("reset")},this.flush=function(){E&&E.byteLength>3&&this.trigger("data",E.subarray(g+3)),E=null,g=0,this.trigger("done")},this.endTimeline=function(){this.flush(),this.trigger("endedtimeline")}},No.prototype=new Wd,Kd={100:!0,110:!0,122:!0,244:!0,44:!0,83:!0,86:!0,118:!0,128:!0,138:!0,139:!0,134:!0},Po=function(){var g=new No,T,E,C,I,O,K,X;Po.prototype.init.call(this),T=this,this.push=function(Z){Z.type==="video"&&(E=Z.trackId,C=Z.pts,I=Z.dts,g.push(Z))},g.on("data",function(Z){var ne={trackId:E,pts:C,dts:I,data:Z,nalUnitTypeCode:Z[0]&31};switch(ne.nalUnitTypeCode){case 5:ne.nalUnitType="slice_layer_without_partitioning_rbsp_idr";break;case 6:ne.nalUnitType="sei_rbsp",ne.escapedRBSP=O(Z.subarray(1));break;case 7:ne.nalUnitType="seq_parameter_set_rbsp",ne.escapedRBSP=O(Z.subarray(1)),ne.config=K(ne.escapedRBSP);break;case 8:ne.nalUnitType="pic_parameter_set_rbsp";break;case 9:ne.nalUnitType="access_unit_delimiter_rbsp";break}T.trigger("data",ne)}),g.on("done",function(){T.trigger("done")}),g.on("partialdone",function(){T.trigger("partialdone")}),g.on("reset",function(){T.trigger("reset")}),g.on("endedtimeline",function(){T.trigger("endedtimeline")}),this.flush=function(){g.flush()},this.partialFlush=function(){g.partialFlush()},this.reset=function(){g.reset()},this.endTimeline=function(){g.endTimeline()},X=function(Z,ne){var ce=8,Te=8,Ye,De;for(Ye=0;Ye<Z;Ye++)Te!==0&&(De=ne.readExpGolomb(),Te=(ce+De+256)%256),ce=Te===0?ce:Te},O=function(Z){for(var ne=Z.byteLength,ce=[],Te=1,Ye,De;Te<ne-2;)Z[Te]===0&&Z[Te+1]===0&&Z[Te+2]===3?(ce.push(Te+2),Te+=2):Te++;if(ce.length===0)return Z;Ye=ne-ce.length,De=new Uint8Array(Ye);var rt=0;for(Te=0;Te<Ye;rt++,Te++)rt===ce[0]&&(rt++,ce.shift()),De[Te]=Z[rt];return De},K=function(Z){var ne=0,ce=0,Te=0,Ye=0,De,rt,yt,xn,xi,Cs,cc,uc,dc,hc,mh,Kt=[1,1],fc,er;if(De=new nc(Z),rt=De.readUnsignedByte(),xn=De.readUnsignedByte(),yt=De.readUnsignedByte(),De.skipUnsignedExpGolomb(),Kd[rt]&&(xi=De.readUnsignedExpGolomb(),xi===3&&De.skipBits(1),De.skipUnsignedExpGolomb(),De.skipUnsignedExpGolomb(),De.skipBits(1),De.readBoolean()))for(mh=xi!==3?8:12,er=0;er<mh;er++)De.readBoolean()&&(er<6?X(16,De):X(64,De));if(De.skipUnsignedExpGolomb(),Cs=De.readUnsignedExpGolomb(),Cs===0)De.readUnsignedExpGolomb();else if(Cs===1)for(De.skipBits(1),De.skipExpGolomb(),De.skipExpGolomb(),cc=De.readUnsignedExpGolomb(),er=0;er<cc;er++)De.skipExpGolomb();if(De.skipUnsignedExpGolomb(),De.skipBits(1),uc=De.readUnsignedExpGolomb(),dc=De.readUnsignedExpGolomb(),hc=De.readBits(1),hc===0&&De.skipBits(1),De.skipBits(1),De.readBoolean()&&(ne=De.readUnsignedExpGolomb(),ce=De.readUnsignedExpGolomb(),Te=De.readUnsignedExpGolomb(),Ye=De.readUnsignedExpGolomb()),De.readBoolean()&&De.readBoolean()){switch(fc=De.readUnsignedByte(),fc){case 1:Kt=[1,1];break;case 2:Kt=[12,11];break;case 3:Kt=[10,11];break;case 4:Kt=[16,11];break;case 5:Kt=[40,33];break;case 6:Kt=[24,11];break;case 7:Kt=[20,11];break;case 8:Kt=[32,11];break;case 9:Kt=[80,33];break;case 10:Kt=[18,11];break;case 11:Kt=[15,11];break;case 12:Kt=[64,33];break;case 13:Kt=[160,99];break;case 14:Kt=[4,3];break;case 15:Kt=[3,2];break;case 16:Kt=[2,1];break;case 255:{Kt=[De.readUnsignedByte()<<8|De.readUnsignedByte(),De.readUnsignedByte()<<8|De.readUnsignedByte()];break}}Kt&&Kt[0]/Kt[1]}return{profileIdc:rt,levelIdc:yt,profileCompatibility:xn,width:(uc+1)*16-ne*2-ce*2,height:(2-hc)*(dc+1)*16-Te*2-Ye*2,sarRatio:Kt}}},Po.prototype=new Wd;var ic={H264Stream:Po},Og=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350],Xd=function(g,T){var E=g[T+6]<<21|g[T+7]<<14|g[T+8]<<7|g[T+9],C=g[T+5],I=(C&16)>>4;return E=E>=0?E:0,I?E+20:E+10},Yd=function(g,T){return g.length-T<10||g[T]!==73||g[T+1]!==68||g[T+2]!==51?T:(T+=Xd(g,T),Yd(g,T))},Mg=function(g){var T=Yd(g,0);return g.length>=T+2&&(g[T]&255)===255&&(g[T+1]&240)===240&&(g[T+1]&22)===16},Jd=function(g){return g[0]<<21|g[1]<<14|g[2]<<7|g[3]},Rg=function(g,T,E){var C,I="";for(C=T;C<E;C++)I+="%"+("00"+g[C].toString(16)).slice(-2);return I},Lg=function(g,T,E){return unescape(Rg(g,T,E))},Qd=function(g,T){var E=(g[T+5]&224)>>5,C=g[T+4]<<3,I=g[T+3]&6144;return I|C|E},Zd=function(g,T){return g[T]===73&&g[T+1]===68&&g[T+2]===51?"timed-metadata":g[T]&!0&&(g[T+1]&240)===240?"audio":null},Bg=function(g){for(var T=0;T+5<g.length;){if(g[T]!==255||(g[T+1]&246)!==240){T++;continue}return Og[(g[T+2]&60)>>>2]}return null},eh=function(g){var T,E,C,I;T=10,g[5]&64&&(T+=4,T+=Jd(g.subarray(10,14)));do{if(E=Jd(g.subarray(T+4,T+8)),E<1)return null;if(I=String.fromCharCode(g[T],g[T+1],g[T+2],g[T+3]),I==="PRIV"){C=g.subarray(T+10,T+E+10);for(var O=0;O<C.byteLength;O++)if(C[O]===0){var K=Lg(C,0,O);if(K==="com.apple.streaming.transportStreamTimestamp"){var X=C.subarray(O+1),Z=(X[3]&1)<<30|X[4]<<22|X[5]<<14|X[6]<<6|X[7]>>>2;return Z*=4,Z+=X[7]&3,Z}break}}T+=10,T+=E}while(T<g.byteLength);return null},Oo={isLikelyAacData:Mg,parseId3TagSize:Xd,parseAdtsSize:Qd,parseType:Zd,parseSampleRate:Bg,parseAacTimestamp:eh},Ug=t,th=Oo,ma;ma=function(){var g=new Uint8Array,T=0;ma.prototype.init.call(this),this.setTimestamp=function(E){T=E},this.push=function(E){var C=0,I=0,O,K,X,Z;for(g.length?(Z=g.length,g=new Uint8Array(E.byteLength+Z),g.set(g.subarray(0,Z)),g.set(E,Z)):g=E;g.length-I>=3;){if(g[I]===73&&g[I+1]===68&&g[I+2]===51){if(g.length-I<10||(C=th.parseId3TagSize(g,I),I+C>g.length))break;K={type:"timed-metadata",data:g.subarray(I,I+C)},this.trigger("data",K),I+=C;continue}else if((g[I]&255)===255&&(g[I+1]&240)===240){if(g.length-I<7||(C=th.parseAdtsSize(g,I),I+C>g.length))break;X={type:"audio",data:g.subarray(I,I+C),pts:T,dts:T},this.trigger("data",X),I+=C;continue}I++}O=g.length-I,O>0?g=g.subarray(I):g=new Uint8Array},this.reset=function(){g=new Uint8Array,this.trigger("reset")},this.endTimeline=function(){g=new Uint8Array,this.trigger("endedtimeline")}},ma.prototype=new Ug;var nh=ma,Fg=["audioobjecttype","channelcount","samplerate","samplingfrequencyindex","samplesize"],Vg=Fg,jg=["width","height","profileIdc","levelIdc","profileCompatibility","sarRatio"],$g=jg,Mo=t,ga=xe,va=Le,Ro=zr,Ci=We,Li=Io,Lo=Tt,Bi=Pg,ih=ic.H264Stream,Hg=nh,qg=Oo.isLikelyAacData,zg=Tt.ONE_SECOND_IN_TS,rh=Vg,ya=$g,Bo,Wr,ba,Kr,sh=function(g,T){T.stream=g,this.trigger("log",T)},ah=function(g,T){for(var E=Object.keys(T),C=0;C<E.length;C++){var I=E[C];I==="headOfPipeline"||!T[I].on||T[I].on("log",sh.bind(g,I))}},oh=function(g,T){var E;if(g.length!==T.length)return!1;for(E=0;E<g.length;E++)if(g[E]!==T[E])return!1;return!0},lh=function(g,T,E,C,I,O){var K=E-T,X=C-T,Z=I-E;return{start:{dts:g,pts:g+K},end:{dts:g+X,pts:g+Z},prependedContentDuration:O,baseMediaDecodeTime:g}};Wr=function(g,T){var E=[],C,I=0,O=0,K=1/0;T=T||{},C=T.firstSequenceNumber||0,Wr.prototype.init.call(this),this.push=function(X){Ci.collectDtsInfo(g,X),g&&rh.forEach(function(Z){g[Z]=X[Z]}),E.push(X)},this.setEarliestDts=function(X){I=X},this.setVideoBaseMediaDecodeTime=function(X){K=X},this.setAudioAppendStart=function(X){O=X},this.flush=function(){var X,Z,ne,ce,Te,Ye,De;if(E.length===0){this.trigger("done","AudioSegmentStream");return}X=Ro.trimAdtsFramesByEarliestDts(E,g,I),g.baseMediaDecodeTime=Ci.calculateTrackBaseMediaDecodeTime(g,T.keepOriginalTimestamps),De=Ro.prefixWithSilence(g,X,O,K),g.samples=Ro.generateSampleTable(X),ne=ga.mdat(Ro.concatenateFrameData(X)),E=[],Z=ga.moof(C,[g]),ce=new Uint8Array(Z.byteLength+ne.byteLength),C++,ce.set(Z),ce.set(ne,Z.byteLength),Ci.clearDtsInfo(g),Te=Math.ceil(zg*1024/g.samplerate),X.length&&(Ye=X.length*Te,this.trigger("segmentTimingInfo",lh(Lo.audioTsToVideoTs(g.baseMediaDecodeTime,g.samplerate),X[0].dts,X[0].pts,X[0].dts+Ye,X[0].pts+Ye,De||0)),this.trigger("timingInfo",{start:X[0].pts,end:X[0].pts+Ye})),this.trigger("data",{track:g,boxes:ce}),this.trigger("done","AudioSegmentStream")},this.reset=function(){Ci.clearDtsInfo(g),E=[],this.trigger("reset")}},Wr.prototype=new Mo,Bo=function(g,T){var E,C=[],I=[],O,K;T=T||{},E=T.firstSequenceNumber||0,Bo.prototype.init.call(this),delete g.minPTS,this.gopCache_=[],this.push=function(X){Ci.collectDtsInfo(g,X),X.nalUnitType==="seq_parameter_set_rbsp"&&!O&&(O=X.config,g.sps=[X.data],ya.forEach(function(Z){g[Z]=O[Z]},this)),X.nalUnitType==="pic_parameter_set_rbsp"&&!K&&(K=X.data,g.pps=[X.data]),C.push(X)},this.flush=function(){for(var X,Z,ne,ce,Te,Ye,De=0,rt,yt;C.length&&C[0].nalUnitType!=="access_unit_delimiter_rbsp";)C.shift();if(C.length===0){this.resetStream_(),this.trigger("done","VideoSegmentStream");return}if(X=va.groupNalsIntoFrames(C),ne=va.groupFramesIntoGops(X),ne[0][0].keyFrame||(Z=this.getGopForFusion_(C[0],g),Z?(De=Z.duration,ne.unshift(Z),ne.byteLength+=Z.byteLength,ne.nalCount+=Z.nalCount,ne.pts=Z.pts,ne.dts=Z.dts,ne.duration+=Z.duration):ne=va.extendFirstKeyFrame(ne)),I.length){var xn;if(T.alignGopsAtEnd?xn=this.alignGopsAtEnd_(ne):xn=this.alignGopsAtStart_(ne),!xn){this.gopCache_.unshift({gop:ne.pop(),pps:g.pps,sps:g.sps}),this.gopCache_.length=Math.min(6,this.gopCache_.length),C=[],this.resetStream_(),this.trigger("done","VideoSegmentStream");return}Ci.clearDtsInfo(g),ne=xn}Ci.collectDtsInfo(g,ne),g.samples=va.generateSampleTable(ne),Te=ga.mdat(va.concatenateNalData(ne)),g.baseMediaDecodeTime=Ci.calculateTrackBaseMediaDecodeTime(g,T.keepOriginalTimestamps),this.trigger("processedGopsInfo",ne.map(function(xi){return{pts:xi.pts,dts:xi.dts,byteLength:xi.byteLength}})),rt=ne[0],yt=ne[ne.length-1],this.trigger("segmentTimingInfo",lh(g.baseMediaDecodeTime,rt.dts,rt.pts,yt.dts+yt.duration,yt.pts+yt.duration,De)),this.trigger("timingInfo",{start:ne[0].pts,end:ne[ne.length-1].pts+ne[ne.length-1].duration}),this.gopCache_.unshift({gop:ne.pop(),pps:g.pps,sps:g.sps}),this.gopCache_.length=Math.min(6,this.gopCache_.length),C=[],this.trigger("baseMediaDecodeTime",g.baseMediaDecodeTime),this.trigger("timelineStartInfo",g.timelineStartInfo),ce=ga.moof(E,[g]),Ye=new Uint8Array(ce.byteLength+Te.byteLength),E++,Ye.set(ce),Ye.set(Te,ce.byteLength),this.trigger("data",{track:g,boxes:Ye}),this.resetStream_(),this.trigger("done","VideoSegmentStream")},this.reset=function(){this.resetStream_(),C=[],this.gopCache_.length=0,I.length=0,this.trigger("reset")},this.resetStream_=function(){Ci.clearDtsInfo(g),O=void 0,K=void 0},this.getGopForFusion_=function(X){var Z=45e3,ne=1/0,ce,Te,Ye,De,rt;for(rt=0;rt<this.gopCache_.length;rt++)De=this.gopCache_[rt],Ye=De.gop,!(!(g.pps&&oh(g.pps[0],De.pps[0]))||!(g.sps&&oh(g.sps[0],De.sps[0])))&&(Ye.dts<g.timelineStartInfo.dts||(ce=X.dts-Ye.dts-Ye.duration,ce>=-1e4&&ce<=Z&&(!Te||ne>ce)&&(Te=De,ne=ce)));return Te?Te.gop:null},this.alignGopsAtStart_=function(X){var Z,ne,ce,Te,Ye,De,rt,yt;for(Ye=X.byteLength,De=X.nalCount,rt=X.duration,Z=ne=0;Z<I.length&&ne<X.length&&(ce=I[Z],Te=X[ne],ce.pts!==Te.pts);){if(Te.pts>ce.pts){Z++;continue}ne++,Ye-=Te.byteLength,De-=Te.nalCount,rt-=Te.duration}return ne===0?X:ne===X.length?null:(yt=X.slice(ne),yt.byteLength=Ye,yt.duration=rt,yt.nalCount=De,yt.pts=yt[0].pts,yt.dts=yt[0].dts,yt)},this.alignGopsAtEnd_=function(X){var Z,ne,ce,Te,Ye,De;for(Z=I.length-1,ne=X.length-1,Ye=null,De=!1;Z>=0&&ne>=0;){if(ce=I[Z],Te=X[ne],ce.pts===Te.pts){De=!0;break}if(ce.pts>Te.pts){Z--;continue}Z===I.length-1&&(Ye=ne),ne--}if(!De&&Ye===null)return null;var rt;if(De?rt=ne:rt=Ye,rt===0)return X;var yt=X.slice(rt),xn=yt.reduce(function(xi,Cs){return xi.byteLength+=Cs.byteLength,xi.duration+=Cs.duration,xi.nalCount+=Cs.nalCount,xi},{byteLength:0,duration:0,nalCount:0});return yt.byteLength=xn.byteLength,yt.duration=xn.duration,yt.nalCount=xn.nalCount,yt.pts=yt[0].pts,yt.dts=yt[0].dts,yt},this.alignGopsWith=function(X){I=X}},Bo.prototype=new Mo,Kr=function(g,T){this.numberOfTracks=0,this.metadataStream=T,g=g||{},typeof g.remux<"u"?this.remuxTracks=!!g.remux:this.remuxTracks=!0,typeof g.keepOriginalTimestamps=="boolean"?this.keepOriginalTimestamps=g.keepOriginalTimestamps:this.keepOriginalTimestamps=!1,this.pendingTracks=[],this.videoTrack=null,this.pendingBoxes=[],this.pendingCaptions=[],this.pendingMetadata=[],this.pendingBytes=0,this.emittedTracks=0,Kr.prototype.init.call(this),this.push=function(E){if(E.content||E.text)return this.pendingCaptions.push(E);if(E.frames)return this.pendingMetadata.push(E);this.pendingTracks.push(E.track),this.pendingBytes+=E.boxes.byteLength,E.track.type==="video"&&(this.videoTrack=E.track,this.pendingBoxes.push(E.boxes)),E.track.type==="audio"&&(this.audioTrack=E.track,this.pendingBoxes.unshift(E.boxes))}},Kr.prototype=new Mo,Kr.prototype.flush=function(g){var T=0,E={captions:[],captionStreams:{},metadata:[],info:{}},C,I,O,K=0,X;if(this.pendingTracks.length<this.numberOfTracks){if(g!=="VideoSegmentStream"&&g!=="AudioSegmentStream")return;if(this.remuxTracks)return;if(this.pendingTracks.length===0){this.emittedTracks++,this.emittedTracks>=this.numberOfTracks&&(this.trigger("done"),this.emittedTracks=0);return}}if(this.videoTrack?(K=this.videoTrack.timelineStartInfo.pts,ya.forEach(function(Z){E.info[Z]=this.videoTrack[Z]},this)):this.audioTrack&&(K=this.audioTrack.timelineStartInfo.pts,rh.forEach(function(Z){E.info[Z]=this.audioTrack[Z]},this)),this.videoTrack||this.audioTrack){for(this.pendingTracks.length===1?E.type=this.pendingTracks[0].type:E.type="combined",this.emittedTracks+=this.pendingTracks.length,O=ga.initSegment(this.pendingTracks),E.initSegment=new Uint8Array(O.byteLength),E.initSegment.set(O),E.data=new Uint8Array(this.pendingBytes),X=0;X<this.pendingBoxes.length;X++)E.data.set(this.pendingBoxes[X],T),T+=this.pendingBoxes[X].byteLength;for(X=0;X<this.pendingCaptions.length;X++)C=this.pendingCaptions[X],C.startTime=Lo.metadataTsToSeconds(C.startPts,K,this.keepOriginalTimestamps),C.endTime=Lo.metadataTsToSeconds(C.endPts,K,this.keepOriginalTimestamps),E.captionStreams[C.stream]=!0,E.captions.push(C);for(X=0;X<this.pendingMetadata.length;X++)I=this.pendingMetadata[X],I.cueTime=Lo.metadataTsToSeconds(I.pts,K,this.keepOriginalTimestamps),E.metadata.push(I);for(E.metadata.dispatchType=this.metadataStream.dispatchType,this.pendingTracks.length=0,this.videoTrack=null,this.pendingBoxes.length=0,this.pendingCaptions.length=0,this.pendingBytes=0,this.pendingMetadata.length=0,this.trigger("data",E),X=0;X<E.captions.length;X++)C=E.captions[X],this.trigger("caption",C);for(X=0;X<E.metadata.length;X++)I=E.metadata[X],this.trigger("id3Frame",I)}this.emittedTracks>=this.numberOfTracks&&(this.trigger("done"),this.emittedTracks=0)},Kr.prototype.setRemux=function(g){this.remuxTracks=g},ba=function(g){var T=this,E=!0,C,I;ba.prototype.init.call(this),g=g||{},this.baseMediaDecodeTime=g.baseMediaDecodeTime||0,this.transmuxPipeline_={},this.setupAacPipeline=function(){var O={};this.transmuxPipeline_=O,O.type="aac",O.metadataStream=new Li.MetadataStream,O.aacStream=new Hg,O.audioTimestampRolloverStream=new Li.TimestampRolloverStream("audio"),O.timedMetadataTimestampRolloverStream=new Li.TimestampRolloverStream("timed-metadata"),O.adtsStream=new Bi,O.coalesceStream=new Kr(g,O.metadataStream),O.headOfPipeline=O.aacStream,O.aacStream.pipe(O.audioTimestampRolloverStream).pipe(O.adtsStream),O.aacStream.pipe(O.timedMetadataTimestampRolloverStream).pipe(O.metadataStream).pipe(O.coalesceStream),O.metadataStream.on("timestamp",function(K){O.aacStream.setTimestamp(K.timeStamp)}),O.aacStream.on("data",function(K){K.type!=="timed-metadata"&&K.type!=="audio"||O.audioSegmentStream||(I=I||{timelineStartInfo:{baseMediaDecodeTime:T.baseMediaDecodeTime},codec:"adts",type:"audio"},O.coalesceStream.numberOfTracks++,O.audioSegmentStream=new Wr(I,g),O.audioSegmentStream.on("log",T.getLogTrigger_("audioSegmentStream")),O.audioSegmentStream.on("timingInfo",T.trigger.bind(T,"audioTimingInfo")),O.adtsStream.pipe(O.audioSegmentStream).pipe(O.coalesceStream),T.trigger("trackinfo",{hasAudio:!!I,hasVideo:!!C}))}),O.coalesceStream.on("data",this.trigger.bind(this,"data")),O.coalesceStream.on("done",this.trigger.bind(this,"done")),ah(this,O)},this.setupTsPipeline=function(){var O={};this.transmuxPipeline_=O,O.type="ts",O.metadataStream=new Li.MetadataStream,O.packetStream=new Li.TransportPacketStream,O.parseStream=new Li.TransportParseStream,O.elementaryStream=new Li.ElementaryStream,O.timestampRolloverStream=new Li.TimestampRolloverStream,O.adtsStream=new Bi,O.h264Stream=new ih,O.captionStream=new Li.CaptionStream(g),O.coalesceStream=new Kr(g,O.metadataStream),O.headOfPipeline=O.packetStream,O.packetStream.pipe(O.parseStream).pipe(O.elementaryStream).pipe(O.timestampRolloverStream),O.timestampRolloverStream.pipe(O.h264Stream),O.timestampRolloverStream.pipe(O.adtsStream),O.timestampRolloverStream.pipe(O.metadataStream).pipe(O.coalesceStream),O.h264Stream.pipe(O.captionStream).pipe(O.coalesceStream),O.elementaryStream.on("data",function(K){var X;if(K.type==="metadata"){for(X=K.tracks.length;X--;)!C&&K.tracks[X].type==="video"?(C=K.tracks[X],C.timelineStartInfo.baseMediaDecodeTime=T.baseMediaDecodeTime):!I&&K.tracks[X].type==="audio"&&(I=K.tracks[X],I.timelineStartInfo.baseMediaDecodeTime=T.baseMediaDecodeTime);C&&!O.videoSegmentStream&&(O.coalesceStream.numberOfTracks++,O.videoSegmentStream=new Bo(C,g),O.videoSegmentStream.on("log",T.getLogTrigger_("videoSegmentStream")),O.videoSegmentStream.on("timelineStartInfo",function(Z){I&&!g.keepOriginalTimestamps&&(I.timelineStartInfo=Z,O.audioSegmentStream.setEarliestDts(Z.dts-T.baseMediaDecodeTime))}),O.videoSegmentStream.on("processedGopsInfo",T.trigger.bind(T,"gopInfo")),O.videoSegmentStream.on("segmentTimingInfo",T.trigger.bind(T,"videoSegmentTimingInfo")),O.videoSegmentStream.on("baseMediaDecodeTime",function(Z){I&&O.audioSegmentStream.setVideoBaseMediaDecodeTime(Z)}),O.videoSegmentStream.on("timingInfo",T.trigger.bind(T,"videoTimingInfo")),O.h264Stream.pipe(O.videoSegmentStream).pipe(O.coalesceStream)),I&&!O.audioSegmentStream&&(O.coalesceStream.numberOfTracks++,O.audioSegmentStream=new Wr(I,g),O.audioSegmentStream.on("log",T.getLogTrigger_("audioSegmentStream")),O.audioSegmentStream.on("timingInfo",T.trigger.bind(T,"audioTimingInfo")),O.audioSegmentStream.on("segmentTimingInfo",T.trigger.bind(T,"audioSegmentTimingInfo")),O.adtsStream.pipe(O.audioSegmentStream).pipe(O.coalesceStream)),T.trigger("trackinfo",{hasAudio:!!I,hasVideo:!!C})}}),O.coalesceStream.on("data",this.trigger.bind(this,"data")),O.coalesceStream.on("id3Frame",function(K){K.dispatchType=O.metadataStream.dispatchType,T.trigger("id3Frame",K)}),O.coalesceStream.on("caption",this.trigger.bind(this,"caption")),O.coalesceStream.on("done",this.trigger.bind(this,"done")),ah(this,O)},this.setBaseMediaDecodeTime=function(O){var K=this.transmuxPipeline_;g.keepOriginalTimestamps||(this.baseMediaDecodeTime=O),I&&(I.timelineStartInfo.dts=void 0,I.timelineStartInfo.pts=void 0,Ci.clearDtsInfo(I),K.audioTimestampRolloverStream&&K.audioTimestampRolloverStream.discontinuity()),C&&(K.videoSegmentStream&&(K.videoSegmentStream.gopCache_=[]),C.timelineStartInfo.dts=void 0,C.timelineStartInfo.pts=void 0,Ci.clearDtsInfo(C),K.captionStream.reset()),K.timestampRolloverStream&&K.timestampRolloverStream.discontinuity()},this.setAudioAppendStart=function(O){I&&this.transmuxPipeline_.audioSegmentStream.setAudioAppendStart(O)},this.setRemux=function(O){var K=this.transmuxPipeline_;g.remux=O,K&&K.coalesceStream&&K.coalesceStream.setRemux(O)},this.alignGopsWith=function(O){C&&this.transmuxPipeline_.videoSegmentStream&&this.transmuxPipeline_.videoSegmentStream.alignGopsWith(O)},this.getLogTrigger_=function(O){var K=this;return function(X){X.stream=O,K.trigger("log",X)}},this.push=function(O){if(E){var K=qg(O);K&&this.transmuxPipeline_.type!=="aac"?this.setupAacPipeline():!K&&this.transmuxPipeline_.type!=="ts"&&this.setupTsPipeline(),E=!1}this.transmuxPipeline_.headOfPipeline.push(O)},this.flush=function(){E=!0,this.transmuxPipeline_.headOfPipeline.flush()},this.endTimeline=function(){this.transmuxPipeline_.headOfPipeline.endTimeline()},this.reset=function(){this.transmuxPipeline_.headOfPipeline&&this.transmuxPipeline_.headOfPipeline.reset()},this.resetCaptions=function(){this.transmuxPipeline_.captionStream&&this.transmuxPipeline_.captionStream.reset()}},ba.prototype=new Mo;var Gg={Transmuxer:ba},N=function(g){return g>>>0},R=function(g){return("00"+g.toString(16)).slice(-2)},z={toUnsigned:N,toHexString:R},J=function(g){var T="";return T+=String.fromCharCode(g[0]),T+=String.fromCharCode(g[1]),T+=String.fromCharCode(g[2]),T+=String.fromCharCode(g[3]),T},re=J,ue=z.toUnsigned,ye=re,ge=function(g,T){var E=[],C,I,O,K,X;if(!T.length)return null;for(C=0;C<g.byteLength;)I=ue(g[C]<<24|g[C+1]<<16|g[C+2]<<8|g[C+3]),O=ye(g.subarray(C+4,C+8)),K=I>1?C+I:g.byteLength,O===T[0]&&(T.length===1?E.push(g.subarray(C+8,K)):(X=ge(g.subarray(C+8,K),T.slice(1)),X.length&&(E=E.concat(X)))),C=K;return E},me=ge,tt=z.toUnsigned,Je=s.getUint64,kt=function(g){var T={version:g[0],flags:new Uint8Array(g.subarray(1,4))};return T.version===1?T.baseMediaDecodeTime=Je(g.subarray(4)):T.baseMediaDecodeTime=tt(g[4]<<24|g[5]<<16|g[6]<<8|g[7]),T},Zi=kt,mn=function(g){var T=new DataView(g.buffer,g.byteOffset,g.byteLength),E={version:g[0],flags:new Uint8Array(g.subarray(1,4)),trackId:T.getUint32(4)},C=E.flags[2]&1,I=E.flags[2]&2,O=E.flags[2]&8,K=E.flags[2]&16,X=E.flags[2]&32,Z=E.flags[0]&65536,ne=E.flags[0]&131072,ce;return ce=8,C&&(ce+=4,E.baseDataOffset=T.getUint32(12),ce+=4),I&&(E.sampleDescriptionIndex=T.getUint32(ce),ce+=4),O&&(E.defaultSampleDuration=T.getUint32(ce),ce+=4),K&&(E.defaultSampleSize=T.getUint32(ce),ce+=4),X&&(E.defaultSampleFlags=T.getUint32(ce)),Z&&(E.durationIsEmpty=!0),!C&&ne&&(E.baseDataOffsetIsMoof=!0),E},Nn=mn,ch=function(g){return{isLeading:(g[0]&12)>>>2,dependsOn:g[0]&3,isDependedOn:(g[1]&192)>>>6,hasRedundancy:(g[1]&48)>>>4,paddingValue:(g[1]&14)>>>1,isNonSyncSample:g[1]&1,degradationPriority:g[2]<<8|g[3]}},mt=ch,cn=mt,Xr=function(g){var T={version:g[0],flags:new Uint8Array(g.subarray(1,4)),samples:[]},E=new DataView(g.buffer,g.byteOffset,g.byteLength),C=T.flags[2]&1,I=T.flags[2]&4,O=T.flags[1]&1,K=T.flags[1]&2,X=T.flags[1]&4,Z=T.flags[1]&8,ne=E.getUint32(4),ce=8,Te;for(C&&(T.dataOffset=E.getInt32(ce),ce+=4),I&&ne&&(Te={flags:cn(g.subarray(ce,ce+4))},ce+=4,O&&(Te.duration=E.getUint32(ce),ce+=4),K&&(Te.size=E.getUint32(ce),ce+=4),Z&&(T.version===1?Te.compositionTimeOffset=E.getInt32(ce):Te.compositionTimeOffset=E.getUint32(ce),ce+=4),T.samples.push(Te),ne--);ne--;)Te={},O&&(Te.duration=E.getUint32(ce),ce+=4),K&&(Te.size=E.getUint32(ce),ce+=4),X&&(Te.flags=cn(g.subarray(ce,ce+4)),ce+=4),Z&&(T.version===1?Te.compositionTimeOffset=E.getInt32(ce):Te.compositionTimeOffset=E.getUint32(ce),ce+=4),T.samples.push(Te);return T},uh=Xr,rc={tfdt:Zi,trun:uh},sc={parseTfdt:rc.tfdt,parseTrun:rc.trun},h$=function(g){for(var T=0,E=String.fromCharCode(g[T]),C="";E!=="\0";)C+=E,T++,E=String.fromCharCode(g[T]);return C+=E,C},f$={uint8ToCString:h$},dh=f$.uint8ToCString,p$=s.getUint64,m$=function(g){var T=4,E=g[0],C,I,O,K,X,Z,ne,ce;if(E===0){C=dh(g.subarray(T)),T+=C.length,I=dh(g.subarray(T)),T+=I.length;var Te=new DataView(g.buffer);O=Te.getUint32(T),T+=4,X=Te.getUint32(T),T+=4,Z=Te.getUint32(T),T+=4,ne=Te.getUint32(T),T+=4}else if(E===1){var Te=new DataView(g.buffer);O=Te.getUint32(T),T+=4,K=p$(g.subarray(T)),T+=8,Z=Te.getUint32(T),T+=4,ne=Te.getUint32(T),T+=4,C=dh(g.subarray(T)),T+=C.length,I=dh(g.subarray(T)),T+=I.length}ce=new Uint8Array(g.subarray(T,g.byteLength));var Ye={scheme_id_uri:C,value:I,timescale:O||1,presentation_time:K,presentation_time_delta:X,event_duration:Z,id:ne,message_data:ce};return v$(E,Ye)?Ye:void 0},g$=function(g,T,E,C){return g||g===0?g/T:C+E/T},v$=function(g,T){var E=T.scheme_id_uri!=="\0",C=g===0&&ZC(T.presentation_time_delta)&&E,I=g===1&&ZC(T.presentation_time)&&E;return!(g>1)&&C||I},ZC=function(g){return g!==void 0||g!==null},y$={parseEmsgBox:m$,scaleTime:g$},ac;typeof window<"u"?ac=window:typeof i<"u"?ac=i:typeof self<"u"?ac=self:ac={};var ex=ac,hh=z.toUnsigned,oc=z.toHexString,gn=me,Uo=re,Wg=y$,b$=Nn,_$=uh,k$=Zi,T$=s.getUint64,tx,nx,ix,rx,sx,Kg,ax,Xg=ex,S$=Hd.parseId3Frames;tx=function(g){var T={},E=gn(g,["moov","trak"]);return E.reduce(function(C,I){var O,K,X,Z,ne;return O=gn(I,["tkhd"])[0],!O||(K=O[0],X=K===0?12:20,Z=hh(O[X]<<24|O[X+1]<<16|O[X+2]<<8|O[X+3]),ne=gn(I,["mdia","mdhd"])[0],!ne)?null:(K=ne[0],X=K===0?12:20,C[Z]=hh(ne[X]<<24|ne[X+1]<<16|ne[X+2]<<8|ne[X+3]),C)},T)},nx=function(g,T){var E;E=gn(T,["moof","traf"]);var C=E.reduce(function(I,O){var K=gn(O,["tfhd"])[0],X=hh(K[4]<<24|K[5]<<16|K[6]<<8|K[7]),Z=g[X]||9e4,ne=gn(O,["tfdt"])[0],ce=new DataView(ne.buffer,ne.byteOffset,ne.byteLength),Te;ne[0]===1?Te=T$(ne.subarray(4,12)):Te=ce.getUint32(4);let Ye;return typeof Te=="bigint"?Ye=Te/Xg.BigInt(Z):typeof Te=="number"&&!isNaN(Te)&&(Ye=Te/Z),Ye<Number.MAX_SAFE_INTEGER&&(Ye=Number(Ye)),Ye<I&&(I=Ye),I},1/0);return typeof C=="bigint"||isFinite(C)?C:0},ix=function(g,T){var E=gn(T,["moof","traf"]),C=0,I=0,O;if(E&&E.length){var K=gn(E[0],["tfhd"])[0],X=gn(E[0],["trun"])[0],Z=gn(E[0],["tfdt"])[0];if(K){var ne=b$(K);O=ne.trackId}if(Z){var ce=k$(Z);C=ce.baseMediaDecodeTime}if(X){var Te=_$(X);Te.samples&&Te.samples.length&&(I=Te.samples[0].compositionTimeOffset||0)}}var Ye=g[O]||9e4;typeof C=="bigint"&&(I=Xg.BigInt(I),Ye=Xg.BigInt(Ye));var De=(C+I)/Ye;return typeof De=="bigint"&&De<Number.MAX_SAFE_INTEGER&&(De=Number(De)),De},rx=function(g){var T=gn(g,["moov","trak"]),E=[];return T.forEach(function(C){var I=gn(C,["mdia","hdlr"]),O=gn(C,["tkhd"]);I.forEach(function(K,X){var Z=Uo(K.subarray(8,12)),ne=O[X],ce,Te,Ye;Z==="vide"&&(ce=new DataView(ne.buffer,ne.byteOffset,ne.byteLength),Te=ce.getUint8(0),Ye=Te===0?ce.getUint32(12):ce.getUint32(20),E.push(Ye))})}),E},Kg=function(g){var T=g[0],E=T===0?12:20;return hh(g[E]<<24|g[E+1]<<16|g[E+2]<<8|g[E+3])},sx=function(g){var T=gn(g,["moov","trak"]),E=[];return T.forEach(function(C){var I={},O=gn(C,["tkhd"])[0],K,X;O&&(K=new DataView(O.buffer,O.byteOffset,O.byteLength),X=K.getUint8(0),I.id=X===0?K.getUint32(12):K.getUint32(20));var Z=gn(C,["mdia","hdlr"])[0];if(Z){var ne=Uo(Z.subarray(8,12));ne==="vide"?I.type="video":ne==="soun"?I.type="audio":I.type=ne}var ce=gn(C,["mdia","minf","stbl","stsd"])[0];if(ce){var Te=ce.subarray(8);I.codec=Uo(Te.subarray(4,8));var Ye=gn(Te,[I.codec])[0],De,rt;Ye&&(/^[asm]vc[1-9]$/i.test(I.codec)?(De=Ye.subarray(78),rt=Uo(De.subarray(4,8)),rt==="avcC"&&De.length>11?(I.codec+=".",I.codec+=oc(De[9]),I.codec+=oc(De[10]),I.codec+=oc(De[11])):I.codec="avc1.4d400d"):/^mp4[a,v]$/i.test(I.codec)?(De=Ye.subarray(28),rt=Uo(De.subarray(4,8)),rt==="esds"&&De.length>20&&De[19]!==0?(I.codec+="."+oc(De[19]),I.codec+="."+oc(De[20]>>>2&63).replace(/^0/,"")):I.codec="mp4a.40.2"):I.codec=I.codec.toLowerCase())}var yt=gn(C,["mdia","mdhd"])[0];yt&&(I.timescale=Kg(yt)),E.push(I)}),E},ax=function(g,T=0){var E=gn(g,["emsg"]);return E.map(C=>{var I=Wg.parseEmsgBox(new Uint8Array(C)),O=S$(I.message_data);return{cueTime:Wg.scaleTime(I.presentation_time,I.timescale,I.presentation_time_delta,T),duration:Wg.scaleTime(I.event_duration,I.timescale),frames:O}})};var lc={findBox:gn,parseType:Uo,timescale:tx,startTime:nx,compositionStartTime:ix,videoTrackIds:rx,tracks:sx,getTimescaleFromMediaHeader:Kg,getEmsgID3:ax};const{parseTrun:C$}=sc,{findBox:ox}=lc;var lx=ex,x$=function(g){var T=ox(g,["moof","traf"]),E=ox(g,["mdat"]),C=[];return E.forEach(function(I,O){var K=T[O];C.push({mdat:I,traf:K})}),C},E$=function(g,T,E){var C=T,I=E.defaultSampleDuration||0,O=E.defaultSampleSize||0,K=E.trackId,X=[];return g.forEach(function(Z){var ne=C$(Z),ce=ne.samples;ce.forEach(function(Te){Te.duration===void 0&&(Te.duration=I),Te.size===void 0&&(Te.size=O),Te.trackId=K,Te.dts=C,Te.compositionTimeOffset===void 0&&(Te.compositionTimeOffset=0),typeof C=="bigint"?(Te.pts=C+lx.BigInt(Te.compositionTimeOffset),C+=lx.BigInt(Te.duration)):(Te.pts=C+Te.compositionTimeOffset,C+=Te.duration)}),X=X.concat(ce)}),X},cx={getMdatTrafPairs:x$,parseSamples:E$},w$=ln.discardEmulationPreventionBytes,D$=Jl.CaptionStream,Yg=me,A$=Zi,I$=Nn,{getMdatTrafPairs:P$,parseSamples:N$}=cx,O$=function(g,T){for(var E=g,C=0;C<T.length;C++){var I=T[C];if(E<I.size)return I;E-=I.size}return null},M$=function(g,T,E){var C=new DataView(g.buffer,g.byteOffset,g.byteLength),I={logs:[],seiNals:[]},O,K,X,Z;for(K=0;K+4<g.length;K+=X)if(X=C.getUint32(K),K+=4,!(X<=0))switch(g[K]&31){case 6:var ne=g.subarray(K+1,K+1+X),ce=O$(K,T);if(O={nalUnitType:"sei_rbsp",size:X,data:ne,escapedRBSP:w$(ne),trackId:E},ce)O.pts=ce.pts,O.dts=ce.dts,Z=ce;else if(Z)O.pts=Z.pts,O.dts=Z.dts;else{I.logs.push({level:"warn",message:"We've encountered a nal unit without data at "+K+" for trackId "+E+". See mux.js#223."});break}I.seiNals.push(O);break}return I},R$=function(g,T){var E={},C=P$(g);return C.forEach(function(I){var O=I.mdat,K=I.traf,X=Yg(K,["tfhd"]),Z=I$(X[0]),ne=Z.trackId,ce=Yg(K,["tfdt"]),Te=ce.length>0?A$(ce[0]).baseMediaDecodeTime:0,Ye=Yg(K,["trun"]),De,rt;T===ne&&Ye.length>0&&(De=N$(Ye,Te,Z),rt=M$(O,De,ne),E[ne]||(E[ne]={seiNals:[],logs:[]}),E[ne].seiNals=E[ne].seiNals.concat(rt.seiNals),E[ne].logs=E[ne].logs.concat(rt.logs))}),E},L$=function(g,T,E){var C;if(T===null)return null;C=R$(g,T);var I=C[T]||{};return{seiNals:I.seiNals,logs:I.logs,timescale:E}},B$=function(){var g=!1,T,E,C,I,O,K;this.isInitialized=function(){return g},this.init=function(X){T=new D$,g=!0,K=X?X.isPartial:!1,T.on("data",function(Z){Z.startTime=Z.startPts/I,Z.endTime=Z.endPts/I,O.captions.push(Z),O.captionStreams[Z.stream]=!0}),T.on("log",function(Z){O.logs.push(Z)})},this.isNewInit=function(X,Z){return X&&X.length===0||Z&&typeof Z=="object"&&Object.keys(Z).length===0?!1:C!==X[0]||I!==Z[C]},this.parse=function(X,Z,ne){var ce;if(this.isInitialized()){if(!Z||!ne)return null;if(this.isNewInit(Z,ne))C=Z[0],I=ne[C];else if(C===null||!I)return E.push(X),null}else return null;for(;E.length>0;){var Te=E.shift();this.parse(Te,Z,ne)}return ce=L$(X,C,I),ce&&ce.logs&&(O.logs=O.logs.concat(ce.logs)),ce===null||!ce.seiNals?O.logs.length?{logs:O.logs,captions:[],captionStreams:[]}:null:(this.pushNals(ce.seiNals),this.flushStream(),O)},this.pushNals=function(X){if(!this.isInitialized()||!X||X.length===0)return null;X.forEach(function(Z){T.push(Z)})},this.flushStream=function(){if(!this.isInitialized())return null;K?T.partialFlush():T.flush()},this.clearParsedCaptions=function(){O.captions=[],O.captionStreams={},O.logs=[]},this.resetCaptionStream=function(){if(!this.isInitialized())return null;T.reset()},this.clearAllCaptions=function(){this.clearParsedCaptions(),this.resetCaptionStream()},this.reset=function(){E=[],C=null,I=null,O?this.clearParsedCaptions():O={captions:[],captionStreams:{},logs:[]},this.resetCaptionStream()},this.reset()},U$=B$;const{parseTfdt:F$}=sc,Ss=me,{getTimescaleFromMediaHeader:V$}=lc,{parseSamples:j$,getMdatTrafPairs:$$}=cx;var ux=function(){let g=9e4;this.init=function(T){const E=Ss(T,["moov","trak","mdia","mdhd"])[0];E&&(g=V$(E))},this.parseSegment=function(T){const E=[],C=$$(T);let I=0;return C.forEach(function(O){const K=O.mdat,X=O.traf,Z=Ss(X,["tfdt"])[0],ne=Ss(X,["tfhd"])[0],ce=Ss(X,["trun"]);if(Z&&(I=F$(Z).baseMediaDecodeTime),ce.length&&ne){const Te=j$(ce,I,ne);let Ye=0;Te.forEach(function(De){const rt="utf-8",yt=new TextDecoder(rt),xn=K.slice(Ye,Ye+De.size);if(Ss(xn,["vtte"])[0]){Ye+=De.size;return}Ss(xn,["vttc"]).forEach(function(cc){const uc=Ss(cc,["payl"])[0],dc=Ss(cc,["sttg"])[0],hc=De.pts/g,mh=(De.pts+De.duration)/g;let Kt,fc;if(uc)try{Kt=yt.decode(uc)}catch(er){console.error(er)}if(dc)try{fc=yt.decode(dc)}catch(er){console.error(er)}De.duration&&Kt&&E.push({cueText:Kt,start:hc,end:mh,settings:fc})}),Ye+=De.size})}}),E}},Jg=xo,dx=function(g){var T=g[1]&31;return T<<=8,T|=g[2],T},fh=function(g){return!!(g[1]&64)},ph=function(g){var T=0;return(g[3]&48)>>>4>1&&(T+=g[4]+1),T},H$=function(g,T){var E=dx(g);return E===0?"pat":E===T?"pmt":T?"pes":null},q$=function(g){var T=fh(g),E=4+ph(g);return T&&(E+=g[E]+1),(g[E+10]&31)<<8|g[E+11]},z$=function(g){var T={},E=fh(g),C=4+ph(g);if(E&&(C+=g[C]+1),!!(g[C+5]&1)){var I,O,K;I=(g[C+1]&15)<<8|g[C+2],O=3+I-4,K=(g[C+10]&15)<<8|g[C+11];for(var X=12+K;X<O;){var Z=C+X;T[(g[Z+1]&31)<<8|g[Z+2]]=g[Z],X+=((g[Z+3]&15)<<8|g[Z+4])+5}return T}},G$=function(g,T){var E=dx(g),C=T[E];switch(C){case Jg.H264_STREAM_TYPE:return"video";case Jg.ADTS_STREAM_TYPE:return"audio";case Jg.METADATA_STREAM_TYPE:return"timed-metadata";default:return null}},W$=function(g){var T=fh(g);if(!T)return null;var E=4+ph(g);if(E>=g.byteLength)return null;var C=null,I;return I=g[E+7],I&192&&(C={},C.pts=(g[E+9]&14)<<27|(g[E+10]&255)<<20|(g[E+11]&254)<<12|(g[E+12]&255)<<5|(g[E+13]&254)>>>3,C.pts*=4,C.pts+=(g[E+13]&6)>>>1,C.dts=C.pts,I&64&&(C.dts=(g[E+14]&14)<<27|(g[E+15]&255)<<20|(g[E+16]&254)<<12|(g[E+17]&255)<<5|(g[E+18]&254)>>>3,C.dts*=4,C.dts+=(g[E+18]&6)>>>1)),C},Qg=function(g){switch(g){case 5:return"slice_layer_without_partitioning_rbsp_idr";case 6:return"sei_rbsp";case 7:return"seq_parameter_set_rbsp";case 8:return"pic_parameter_set_rbsp";case 9:return"access_unit_delimiter_rbsp";default:return null}},K$=function(g){for(var T=4+ph(g),E=g.subarray(T),C=0,I=0,O=!1,K;I<E.byteLength-3;I++)if(E[I+2]===1){C=I+5;break}for(;C<E.byteLength;)switch(E[C]){case 0:if(E[C-1]!==0){C+=2;break}else if(E[C-2]!==0){C++;break}I+3!==C-2&&(K=Qg(E[I+3]&31),K==="slice_layer_without_partitioning_rbsp_idr"&&(O=!0));do C++;while(E[C]!==1&&C<E.length);I=C-2,C+=3;break;case 1:if(E[C-1]!==0||E[C-2]!==0){C+=3;break}K=Qg(E[I+3]&31),K==="slice_layer_without_partitioning_rbsp_idr"&&(O=!0),I=C-2,C+=3;break;default:C+=3;break}return E=E.subarray(I),C-=I,I=0,E&&E.byteLength>3&&(K=Qg(E[I+3]&31),K==="slice_layer_without_partitioning_rbsp_idr"&&(O=!0)),O},X$={parseType:H$,parsePat:q$,parsePmt:z$,parsePayloadUnitStartIndicator:fh,parsePesType:G$,parsePesTime:W$,videoPacketContainsKeyFrame:K$},hx=xo,Fo=Vd.handleRollover,Rt={};Rt.ts=X$,Rt.aac=Oo;var _a=Tt.ONE_SECOND_IN_TS,Qn=188,xr=71,Y$=function(g,T){for(var E=0,C=Qn,I,O;C<g.byteLength;){if(g[E]===xr&&g[C]===xr){switch(I=g.subarray(E,C),O=Rt.ts.parseType(I,T.pid),O){case"pat":T.pid=Rt.ts.parsePat(I);break;case"pmt":var K=Rt.ts.parsePmt(I);T.table=T.table||{},Object.keys(K).forEach(function(X){T.table[X]=K[X]});break}E+=Qn,C+=Qn;continue}E++,C++}},fx=function(g,T,E){for(var C=0,I=Qn,O,K,X,Z,ne,ce=!1;I<=g.byteLength;){if(g[C]===xr&&(g[I]===xr||I===g.byteLength)){switch(O=g.subarray(C,I),K=Rt.ts.parseType(O,T.pid),K){case"pes":X=Rt.ts.parsePesType(O,T.table),Z=Rt.ts.parsePayloadUnitStartIndicator(O),X==="audio"&&Z&&(ne=Rt.ts.parsePesTime(O),ne&&(ne.type="audio",E.audio.push(ne),ce=!0));break}if(ce)break;C+=Qn,I+=Qn;continue}C++,I++}for(I=g.byteLength,C=I-Qn,ce=!1;C>=0;){if(g[C]===xr&&(g[I]===xr||I===g.byteLength)){switch(O=g.subarray(C,I),K=Rt.ts.parseType(O,T.pid),K){case"pes":X=Rt.ts.parsePesType(O,T.table),Z=Rt.ts.parsePayloadUnitStartIndicator(O),X==="audio"&&Z&&(ne=Rt.ts.parsePesTime(O),ne&&(ne.type="audio",E.audio.push(ne),ce=!0));break}if(ce)break;C-=Qn,I-=Qn;continue}C--,I--}},J$=function(g,T,E){for(var C=0,I=Qn,O,K,X,Z,ne,ce,Te,Ye,De=!1,rt={data:[],size:0};I<g.byteLength;){if(g[C]===xr&&g[I]===xr){switch(O=g.subarray(C,I),K=Rt.ts.parseType(O,T.pid),K){case"pes":if(X=Rt.ts.parsePesType(O,T.table),Z=Rt.ts.parsePayloadUnitStartIndicator(O),X==="video"&&(Z&&!De&&(ne=Rt.ts.parsePesTime(O),ne&&(ne.type="video",E.video.push(ne),De=!0)),!E.firstKeyFrame)){if(Z&&rt.size!==0){for(ce=new Uint8Array(rt.size),Te=0;rt.data.length;)Ye=rt.data.shift(),ce.set(Ye,Te),Te+=Ye.byteLength;if(Rt.ts.videoPacketContainsKeyFrame(ce)){var yt=Rt.ts.parsePesTime(ce);yt?(E.firstKeyFrame=yt,E.firstKeyFrame.type="video"):console.warn("Failed to extract PTS/DTS from PES at first keyframe. This could be an unusual TS segment, or else mux.js did not parse your TS segment correctly. If you know your TS segments do contain PTS/DTS on keyframes please file a bug report! You can try ffprobe to double check for yourself.")}rt.size=0}rt.data.push(O),rt.size+=O.byteLength}break}if(De&&E.firstKeyFrame)break;C+=Qn,I+=Qn;continue}C++,I++}for(I=g.byteLength,C=I-Qn,De=!1;C>=0;){if(g[C]===xr&&g[I]===xr){switch(O=g.subarray(C,I),K=Rt.ts.parseType(O,T.pid),K){case"pes":X=Rt.ts.parsePesType(O,T.table),Z=Rt.ts.parsePayloadUnitStartIndicator(O),X==="video"&&Z&&(ne=Rt.ts.parsePesTime(O),ne&&(ne.type="video",E.video.push(ne),De=!0));break}if(De)break;C-=Qn,I-=Qn;continue}C--,I--}},Q$=function(g,T){if(g.audio&&g.audio.length){var E=T;(typeof E>"u"||isNaN(E))&&(E=g.audio[0].dts),g.audio.forEach(function(O){O.dts=Fo(O.dts,E),O.pts=Fo(O.pts,E),O.dtsTime=O.dts/_a,O.ptsTime=O.pts/_a})}if(g.video&&g.video.length){var C=T;if((typeof C>"u"||isNaN(C))&&(C=g.video[0].dts),g.video.forEach(function(O){O.dts=Fo(O.dts,C),O.pts=Fo(O.pts,C),O.dtsTime=O.dts/_a,O.ptsTime=O.pts/_a}),g.firstKeyFrame){var I=g.firstKeyFrame;I.dts=Fo(I.dts,C),I.pts=Fo(I.pts,C),I.dtsTime=I.dts/_a,I.ptsTime=I.pts/_a}}},Z$=function(g){for(var T=!1,E=0,C=null,I=null,O=0,K=0,X;g.length-K>=3;){var Z=Rt.aac.parseType(g,K);switch(Z){case"timed-metadata":if(g.length-K<10){T=!0;break}if(O=Rt.aac.parseId3TagSize(g,K),O>g.length){T=!0;break}I===null&&(X=g.subarray(K,K+O),I=Rt.aac.parseAacTimestamp(X)),K+=O;break;case"audio":if(g.length-K<7){T=!0;break}if(O=Rt.aac.parseAdtsSize(g,K),O>g.length){T=!0;break}C===null&&(X=g.subarray(K,K+O),C=Rt.aac.parseSampleRate(X)),E++,K+=O;break;default:K++;break}if(T)return null}if(C===null||I===null)return null;var ne=_a/C,ce={audio:[{type:"audio",dts:I,pts:I},{type:"audio",dts:I+E*1024*ne,pts:I+E*1024*ne}]};return ce},eH=function(g){var T={pid:null,table:null},E={};Y$(g,T);for(var C in T.table)if(T.table.hasOwnProperty(C)){var I=T.table[C];switch(I){case hx.H264_STREAM_TYPE:E.video=[],J$(g,T,E),E.video.length===0&&delete E.video;break;case hx.ADTS_STREAM_TYPE:E.audio=[],fx(g,T,E),E.audio.length===0&&delete E.audio;break}}return E},tH=function(g,T){var E=Rt.aac.isLikelyAacData(g),C;return E?C=Z$(g):C=eH(g),!C||!C.audio&&!C.video?null:(Q$(C,T),C)},nH={inspect:tH,parseAudioPes_:fx};const iH=function(g,T){T.on("data",function(E){const C=E.initSegment;E.initSegment={data:C.buffer,byteOffset:C.byteOffset,byteLength:C.byteLength};const I=E.data;E.data=I.buffer,g.postMessage({action:"data",segment:E,byteOffset:I.byteOffset,byteLength:I.byteLength},[E.data])}),T.on("done",function(E){g.postMessage({action:"done"})}),T.on("gopInfo",function(E){g.postMessage({action:"gopInfo",gopInfo:E})}),T.on("videoSegmentTimingInfo",function(E){const C={start:{decode:Tt.videoTsToSeconds(E.start.dts),presentation:Tt.videoTsToSeconds(E.start.pts)},end:{decode:Tt.videoTsToSeconds(E.end.dts),presentation:Tt.videoTsToSeconds(E.end.pts)},baseMediaDecodeTime:Tt.videoTsToSeconds(E.baseMediaDecodeTime)};E.prependedContentDuration&&(C.prependedContentDuration=Tt.videoTsToSeconds(E.prependedContentDuration)),g.postMessage({action:"videoSegmentTimingInfo",videoSegmentTimingInfo:C})}),T.on("audioSegmentTimingInfo",function(E){const C={start:{decode:Tt.videoTsToSeconds(E.start.dts),presentation:Tt.videoTsToSeconds(E.start.pts)},end:{decode:Tt.videoTsToSeconds(E.end.dts),presentation:Tt.videoTsToSeconds(E.end.pts)},baseMediaDecodeTime:Tt.videoTsToSeconds(E.baseMediaDecodeTime)};E.prependedContentDuration&&(C.prependedContentDuration=Tt.videoTsToSeconds(E.prependedContentDuration)),g.postMessage({action:"audioSegmentTimingInfo",audioSegmentTimingInfo:C})}),T.on("id3Frame",function(E){g.postMessage({action:"id3Frame",id3Frame:E})}),T.on("caption",function(E){g.postMessage({action:"caption",caption:E})}),T.on("trackinfo",function(E){g.postMessage({action:"trackinfo",trackInfo:E})}),T.on("audioTimingInfo",function(E){g.postMessage({action:"audioTimingInfo",audioTimingInfo:{start:Tt.videoTsToSeconds(E.start),end:Tt.videoTsToSeconds(E.end)}})}),T.on("videoTimingInfo",function(E){g.postMessage({action:"videoTimingInfo",videoTimingInfo:{start:Tt.videoTsToSeconds(E.start),end:Tt.videoTsToSeconds(E.end)}})}),T.on("log",function(E){g.postMessage({action:"log",log:E})})};class px{constructor(T,E){this.options=E||{},this.self=T,this.init()}init(){this.transmuxer&&this.transmuxer.dispose(),this.transmuxer=new Gg.Transmuxer(this.options),iH(this.self,this.transmuxer)}pushMp4Captions(T){this.captionParser||(this.captionParser=new U$,this.captionParser.init());const E=new Uint8Array(T.data,T.byteOffset,T.byteLength),C=this.captionParser.parse(E,T.trackIds,T.timescales);this.self.postMessage({action:"mp4Captions",captions:C&&C.captions||[],logs:C&&C.logs||[],data:E.buffer},[E.buffer])}initMp4WebVttParser(T){this.webVttParser||(this.webVttParser=new ux);const E=new Uint8Array(T.data,T.byteOffset,T.byteLength);this.webVttParser.init(E)}getMp4WebVttText(T){this.webVttParser||(this.webVttParser=new ux);const E=new Uint8Array(T.data,T.byteOffset,T.byteLength),C=this.webVttParser.parseSegment(E);this.self.postMessage({action:"getMp4WebVttText",mp4VttCues:C||[],data:E.buffer},[E.buffer])}probeMp4StartTime({timescales:T,data:E}){const C=lc.startTime(T,E);this.self.postMessage({action:"probeMp4StartTime",startTime:C,data:E},[E.buffer])}probeMp4Tracks({data:T}){const E=lc.tracks(T);this.self.postMessage({action:"probeMp4Tracks",tracks:E,data:T},[T.buffer])}probeEmsgID3({data:T,offset:E}){const C=lc.getEmsgID3(T,E);this.self.postMessage({action:"probeEmsgID3",id3Frames:C,emsgData:T},[T.buffer])}probeTs({data:T,baseStartTime:E}){const C=typeof E=="number"&&!isNaN(E)?E*Tt.ONE_SECOND_IN_TS:void 0,I=nH.inspect(T,C);let O=null;I&&(O={hasVideo:I.video&&I.video.length===2||!1,hasAudio:I.audio&&I.audio.length===2||!1},O.hasVideo&&(O.videoStart=I.video[0].ptsTime),O.hasAudio&&(O.audioStart=I.audio[0].ptsTime)),this.self.postMessage({action:"probeTs",result:O,data:T},[T.buffer])}clearAllMp4Captions(){this.captionParser&&this.captionParser.clearAllCaptions()}clearParsedMp4Captions(){this.captionParser&&this.captionParser.clearParsedCaptions()}push(T){const E=new Uint8Array(T.data,T.byteOffset,T.byteLength);this.transmuxer.push(E)}reset(){this.transmuxer.reset()}setTimestampOffset(T){const E=T.timestampOffset||0;this.transmuxer.setBaseMediaDecodeTime(Math.round(Tt.secondsToVideoTs(E)))}setAudioAppendStart(T){this.transmuxer.setAudioAppendStart(Math.ceil(Tt.secondsToVideoTs(T.appendStart)))}setRemux(T){this.transmuxer.setRemux(T.remux)}flush(T){this.transmuxer.flush(),self.postMessage({action:"done",type:"transmuxed"})}endTimeline(){this.transmuxer.endTimeline(),self.postMessage({action:"endedtimeline",type:"transmuxed"})}alignGopsWith(T){this.transmuxer.alignGopsWith(T.gopsToAlignWith.slice())}}self.onmessage=function(g){if(g.data.action==="init"&&g.data.options){this.messageHandlers=new px(self,g.data.options);return}this.messageHandlers||(this.messageHandlers=new px(self)),g.data&&g.data.action&&g.data.action!=="init"&&this.messageHandlers[g.data.action]&&this.messageHandlers[g.data.action](g.data)}}));var nP=V2(tP);const iP=(i,e,t)=>{const{type:n,initSegment:r,captions:s,captionStreams:a,metadata:o,videoFrameDtsTime:c,videoFramePtsTime:u}=i.data.segment;e.buffer.push({captions:s,captionStreams:a,metadata:o});const d=i.data.segment.boxes||{data:i.data.segment.data},h={type:n,data:new Uint8Array(d.data,d.data.byteOffset,d.data.byteLength),initSegment:new Uint8Array(r.data,r.byteOffset,r.byteLength)};typeof c<"u"&&(h.videoFrameDtsTime=c),typeof u<"u"&&(h.videoFramePtsTime=u),t(h)},rP=({transmuxedData:i,callback:e})=>{i.buffer=[],e(i)},sP=(i,e)=>{e.gopInfo=i.data.gopInfo},H2=i=>{const{transmuxer:e,bytes:t,audioAppendStart:n,gopsToAlignWith:r,remux:s,onData:a,onTrackInfo:o,onAudioTimingInfo:c,onVideoTimingInfo:u,onVideoSegmentTimingInfo:d,onAudioSegmentTimingInfo:h,onId3:b,onCaptions:v,onDone:y,onEndedTimeline:p,onTransmuxerLog:f,isEndOfTimeline:m,segment:_,triggerSegmentEventFn:k}=i,D={buffer:[]};let w=m;const A=P=>{e.currentTransmux===i&&(P.data.action==="data"&&iP(P,D,a),P.data.action==="trackinfo"&&o(P.data.trackInfo),P.data.action==="gopInfo"&&sP(P,D),P.data.action==="audioTimingInfo"&&c(P.data.audioTimingInfo),P.data.action==="videoTimingInfo"&&u(P.data.videoTimingInfo),P.data.action==="videoSegmentTimingInfo"&&d(P.data.videoSegmentTimingInfo),P.data.action==="audioSegmentTimingInfo"&&h(P.data.audioSegmentTimingInfo),P.data.action==="id3Frame"&&b([P.data.id3Frame],P.data.id3Frame.dispatchType),P.data.action==="caption"&&v(P.data.caption),P.data.action==="endedtimeline"&&(w=!1,p()),P.data.action==="log"&&f(P.data.log),P.data.type==="transmuxed"&&(w||(e.onmessage=null,rP({transmuxedData:D,callback:y}),q2(e))))},x=()=>{const P={message:"Received an error message from the transmuxer worker",metadata:{errorType:pe.Error.StreamingFailedToTransmuxSegment,segmentInfo:Gs({segment:_})}};y(null,P)};if(e.onmessage=A,e.onerror=x,n&&e.postMessage({action:"setAudioAppendStart",appendStart:n}),Array.isArray(r)&&e.postMessage({action:"alignGopsWith",gopsToAlignWith:r}),typeof s<"u"&&e.postMessage({action:"setRemux",remux:s}),t.byteLength){const P=t instanceof ArrayBuffer?t:t.buffer,S=t instanceof ArrayBuffer?0:t.byteOffset;k({type:"segmenttransmuxingstart",segment:_}),e.postMessage({action:"push",data:P,byteOffset:S,byteLength:t.byteLength},[P])}m&&e.postMessage({action:"endTimeline"}),e.postMessage({action:"flush"})},q2=i=>{i.currentTransmux=null,i.transmuxQueue.length&&(i.currentTransmux=i.transmuxQueue.shift(),typeof i.currentTransmux=="function"?i.currentTransmux():H2(i.currentTransmux))},z2=(i,e)=>{i.postMessage({action:e}),q2(i)},G2=(i,e)=>{if(!e.currentTransmux){e.currentTransmux=i,z2(e,i);return}e.transmuxQueue.push(z2.bind(null,e,i))},aP=i=>{G2("reset",i)},oP=i=>{G2("endTimeline",i)},W2=i=>{if(!i.transmuxer.currentTransmux){i.transmuxer.currentTransmux=i,H2(i);return}i.transmuxer.transmuxQueue.push(i)};var qp={reset:aP,endTimeline:oP,transmux:W2,createTransmuxer:i=>{const e=new nP;e.currentTransmux=null,e.transmuxQueue=[];const t=e.terminate;return e.terminate=()=>(e.currentTransmux=null,e.transmuxQueue.length=0,t.call(e)),e.postMessage({action:"init",options:i}),e}};const to=function(i){const e=i.transmuxer,t=i.endAction||i.action,n=i.callback,r=dn({},i,{endAction:null,transmuxer:null,callback:null}),s=a=>{a.data.action===t&&(e.removeEventListener("message",s),a.data.data&&(a.data.data=new Uint8Array(a.data.data,i.byteOffset||0,i.byteLength||a.data.data.byteLength),i.data&&(i.data=a.data.data)),n(a.data))};if(e.addEventListener("message",s),i.data){const a=i.data instanceof ArrayBuffer;r.byteOffset=a?0:i.data.byteOffset,r.byteLength=i.data.byteLength;const o=[a?i.data:i.data.buffer];e.postMessage(r,o)}else e.postMessage(r)},hr={FAILURE:2,TIMEOUT:-101,ABORTED:-102},K2="wvtt",zp=i=>{i.forEach(e=>{e.abort()})},lP=i=>({bandwidth:i.bandwidth,bytesReceived:i.bytesReceived||0,roundTripTime:i.roundTripTime||0}),cP=i=>{const e=i.target,n={bandwidth:1/0,bytesReceived:0,roundTripTime:Date.now()-e.requestTime||0};return n.bytesReceived=i.loaded,n.bandwidth=Math.floor(n.bytesReceived/n.roundTripTime*8*1e3),n},Gp=(i,e)=>{const{requestType:t}=e,n=zs({requestType:t,request:e,error:i});return e.timedout?{status:e.status,message:"HLS request timed-out at URL: "+e.uri,code:hr.TIMEOUT,xhr:e,metadata:n}:e.aborted?{status:e.status,message:"HLS request aborted at URL: "+e.uri,code:hr.ABORTED,xhr:e,metadata:n}:i?{status:e.status,message:"HLS request errored at URL: "+e.uri,code:hr.FAILURE,xhr:e,metadata:n}:e.responseType==="arraybuffer"&&e.response.byteLength===0?{status:e.status,message:"Empty HLS response at URL: "+e.uri,code:hr.FAILURE,xhr:e,metadata:n}:null},X2=(i,e,t,n)=>(r,s)=>{const a=s.response,o=Gp(r,s);if(o)return t(o,i);if(a.byteLength!==16)return t({status:s.status,message:"Invalid HLS key at URL: "+s.uri,code:hr.FAILURE,xhr:s},i);const c=new DataView(a),u=new Uint32Array([c.getUint32(0),c.getUint32(4),c.getUint32(8),c.getUint32(12)]);for(let h=0;h<e.length;h++)e[h].bytes=u;const d={uri:s.uri};return n({type:"segmentkeyloadcomplete",segment:i,keyInfo:d}),t(null,i)},uP=(i,e)=>{e===K2&&i.transmuxer.postMessage({action:"initMp4WebVttParser",data:i.map.bytes})},dP=(i,e,t)=>{e===K2&&to({action:"getMp4WebVttText",data:i.bytes,transmuxer:i.transmuxer,callback:({data:n,mp4VttCues:r})=>{i.bytes=n,t(null,i,{mp4VttCues:r})}})},Y2=(i,e)=>{const t=Mf(i.map.bytes);if(t!=="mp4"){const n=i.map.resolvedUri||i.map.uri,r=t||"unknown";return e({internal:!0,message:`Found unsupported ${r} container for initialization segment at URL: ${n}`,code:hr.FAILURE,metadata:{mediaType:r}})}to({action:"probeMp4Tracks",data:i.map.bytes,transmuxer:i.transmuxer,callback:({tracks:n,data:r})=>(i.map.bytes=r,n.forEach(function(s){i.map.tracks=i.map.tracks||{},!i.map.tracks[s.type]&&(i.map.tracks[s.type]=s,typeof s.id=="number"&&s.timescale&&(i.map.timescales=i.map.timescales||{},i.map.timescales[s.id]=s.timescale),s.type==="text"&&uP(i,s.codec))}),e(null))})},hP=({segment:i,finishProcessingFn:e,triggerSegmentEventFn:t})=>(n,r)=>{const s=Gp(n,r);if(s)return e(s,i);const a=new Uint8Array(r.response);if(t({type:"segmentloaded",segment:i}),i.map.key)return i.map.encryptedBytes=a,e(null,i);i.map.bytes=a,Y2(i,function(o){if(o)return o.xhr=r,o.status=r.status,e(o,i);e(null,i)})},fP=({segment:i,finishProcessingFn:e,responseType:t,triggerSegmentEventFn:n})=>(r,s)=>{const a=Gp(r,s);if(a)return e(a,i);n({type:"segmentloaded",segment:i});const o=t==="arraybuffer"||!s.responseText?s.response:ZI(s.responseText.substring(i.lastReachedChar||0));return i.stats=lP(s),i.key?i.encryptedBytes=new Uint8Array(o):i.bytes=new Uint8Array(o),e(null,i)},pP=({segment:i,bytes:e,trackInfoFn:t,timingInfoFn:n,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:s,id3Fn:a,captionsFn:o,isEndOfTimeline:c,endedTimelineFn:u,dataFn:d,doneFn:h,onTransmuxerLog:b,triggerSegmentEventFn:v})=>{const y=i.map&&i.map.tracks||{},p=!!(y.audio&&y.video);let f=n.bind(null,i,"audio","start");const m=n.bind(null,i,"audio","end");let _=n.bind(null,i,"video","start");const k=n.bind(null,i,"video","end"),D=()=>W2({bytes:e,transmuxer:i.transmuxer,audioAppendStart:i.audioAppendStart,gopsToAlignWith:i.gopsToAlignWith,remux:p,onData:w=>{w.type=w.type==="combined"?"video":w.type,d(i,w)},onTrackInfo:w=>{t&&(p&&(w.isMuxed=!0),t(i,w))},onAudioTimingInfo:w=>{f&&typeof w.start<"u"&&(f(w.start),f=null),m&&typeof w.end<"u"&&m(w.end)},onVideoTimingInfo:w=>{_&&typeof w.start<"u"&&(_(w.start),_=null),k&&typeof w.end<"u"&&k(w.end)},onVideoSegmentTimingInfo:w=>{const A={pts:{start:w.start.presentation,end:w.end.presentation},dts:{start:w.start.decode,end:w.end.decode}};v({type:"segmenttransmuxingtiminginfoavailable",segment:i,timingInfo:A}),r(w)},onAudioSegmentTimingInfo:w=>{const A={pts:{start:w.start.pts,end:w.end.pts},dts:{start:w.start.dts,end:w.end.dts}};v({type:"segmenttransmuxingtiminginfoavailable",segment:i,timingInfo:A}),s(w)},onId3:(w,A)=>{a(i,w,A)},onCaptions:w=>{o(i,[w])},isEndOfTimeline:c,onEndedTimeline:()=>{u()},onTransmuxerLog:b,onDone:(w,A)=>{h&&(w.type=w.type==="combined"?"video":w.type,v({type:"segmenttransmuxingcomplete",segment:i}),h(A,i,w))},segment:i,triggerSegmentEventFn:v});to({action:"probeTs",transmuxer:i.transmuxer,data:e,baseStartTime:i.baseStartTime,callback:w=>{i.bytes=e=w.data;const A=w.result;A&&(t(i,{hasAudio:A.hasAudio,hasVideo:A.hasVideo,isMuxed:p}),t=null),D()}})},J2=({segment:i,bytes:e,trackInfoFn:t,timingInfoFn:n,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:s,id3Fn:a,captionsFn:o,isEndOfTimeline:c,endedTimelineFn:u,dataFn:d,doneFn:h,onTransmuxerLog:b,triggerSegmentEventFn:v})=>{let y=new Uint8Array(e);if(jD(y)){i.isFmp4=!0;const{tracks:p}=i.map;if(p.text&&(!p.audio||!p.video)){d(i,{data:y,type:"text"}),dP(i,p.text.codec,h);return}const m={isFmp4:!0,hasVideo:!!p.video,hasAudio:!!p.audio};p.audio&&p.audio.codec&&p.audio.codec!=="enca"&&(m.audioCodec=p.audio.codec),p.video&&p.video.codec&&p.video.codec!=="encv"&&(m.videoCodec=p.video.codec),p.video&&p.audio&&(m.isMuxed=!0),t(i,m);const _=(k,D)=>{d(i,{data:y,type:m.hasAudio&&!m.isMuxed?"audio":"video"}),D&&D.length&&a(i,D),k&&k.length&&o(i,k),h(null,i,{})};to({action:"probeMp4StartTime",timescales:i.map.timescales,data:y,transmuxer:i.transmuxer,callback:({data:k,startTime:D})=>{e=k.buffer,i.bytes=y=k,m.hasAudio&&!m.isMuxed&&n(i,"audio","start",D),m.hasVideo&&n(i,"video","start",D),to({action:"probeEmsgID3",data:y,transmuxer:i.transmuxer,offset:D,callback:({emsgData:w,id3Frames:A})=>{if(e=w.buffer,i.bytes=y=w,!p.video||!w.byteLength||!i.transmuxer){_(void 0,A);return}to({action:"pushMp4Captions",endAction:"mp4Captions",transmuxer:i.transmuxer,data:y,timescales:i.map.timescales,trackIds:[p.video.id],callback:x=>{e=x.data.buffer,i.bytes=y=x.data,x.logs.forEach(function(P){b(It(P,{stream:"mp4CaptionParser"}))}),_(x.captions,A)}})}})}});return}if(!i.transmuxer){h(null,i,{});return}if(typeof i.container>"u"&&(i.container=Mf(y)),i.container!=="ts"&&i.container!=="aac"){t(i,{hasAudio:!1,hasVideo:!1}),h(null,i,{});return}pP({segment:i,bytes:e,trackInfoFn:t,timingInfoFn:n,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:s,id3Fn:a,captionsFn:o,isEndOfTimeline:c,endedTimelineFn:u,dataFn:d,doneFn:h,onTransmuxerLog:b,triggerSegmentEventFn:v})},Q2=function({id:i,key:e,encryptedBytes:t,decryptionWorker:n,segment:r,doneFn:s},a){const o=u=>{if(u.data.source===i){n.removeEventListener("message",o);const d=u.data.decrypted;a(new Uint8Array(d.bytes,d.byteOffset,d.byteLength))}};n.onerror=()=>{const u="An error occurred in the decryption worker",d=Gs({segment:r}),h={message:u,metadata:{error:new Error(u),errorType:pe.Error.StreamingFailedToDecryptSegment,segmentInfo:d,keyInfo:{uri:r.key.resolvedUri||r.map.key.resolvedUri}}};s(h,r)},n.addEventListener("message",o);let c;e.bytes.slice?c=e.bytes.slice():c=new Uint32Array(Array.prototype.slice.call(e.bytes)),n.postMessage(N2({source:i,encrypted:t,key:c,iv:e.iv}),[t.buffer,c.buffer])},mP=({decryptionWorker:i,segment:e,trackInfoFn:t,timingInfoFn:n,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:s,id3Fn:a,captionsFn:o,isEndOfTimeline:c,endedTimelineFn:u,dataFn:d,doneFn:h,onTransmuxerLog:b,triggerSegmentEventFn:v})=>{v({type:"segmentdecryptionstart"}),Q2({id:e.requestId,key:e.key,encryptedBytes:e.encryptedBytes,decryptionWorker:i,segment:e,doneFn:h},y=>{e.bytes=y,v({type:"segmentdecryptioncomplete",segment:e}),J2({segment:e,bytes:e.bytes,trackInfoFn:t,timingInfoFn:n,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:s,id3Fn:a,captionsFn:o,isEndOfTimeline:c,endedTimelineFn:u,dataFn:d,doneFn:h,onTransmuxerLog:b,triggerSegmentEventFn:v})})},gP=({activeXhrs:i,decryptionWorker:e,trackInfoFn:t,timingInfoFn:n,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:s,id3Fn:a,captionsFn:o,isEndOfTimeline:c,endedTimelineFn:u,dataFn:d,doneFn:h,onTransmuxerLog:b,triggerSegmentEventFn:v})=>{let y=0,p=!1;return(f,m)=>{if(!p){if(f)return p=!0,zp(i),h(f,m);if(y+=1,y===i.length){const _=function(){if(m.encryptedBytes)return mP({decryptionWorker:e,segment:m,trackInfoFn:t,timingInfoFn:n,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:s,id3Fn:a,captionsFn:o,isEndOfTimeline:c,endedTimelineFn:u,dataFn:d,doneFn:h,onTransmuxerLog:b,triggerSegmentEventFn:v});J2({segment:m,bytes:m.bytes,trackInfoFn:t,timingInfoFn:n,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:s,id3Fn:a,captionsFn:o,isEndOfTimeline:c,endedTimelineFn:u,dataFn:d,doneFn:h,onTransmuxerLog:b,triggerSegmentEventFn:v})};if(m.endOfAllRequests=Date.now(),m.map&&m.map.encryptedBytes&&!m.map.bytes)return v({type:"segmentdecryptionstart",segment:m}),Q2({decryptionWorker:e,id:m.requestId+"-init",encryptedBytes:m.map.encryptedBytes,key:m.map.key,segment:m,doneFn:h},k=>{m.map.bytes=k,v({type:"segmentdecryptioncomplete",segment:m}),Y2(m,D=>{if(D)return zp(i),h(D,m);_()})});_()}}}},vP=({loadendState:i,abortFn:e})=>t=>{t.target.aborted&&e&&!i.calledAbortFn&&(e(),i.calledAbortFn=!0)},yP=({segment:i,progressFn:e,trackInfoFn:t,timingInfoFn:n,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:s,id3Fn:a,captionsFn:o,isEndOfTimeline:c,endedTimelineFn:u,dataFn:d})=>h=>{if(!h.target.aborted)return i.stats=It(i.stats,cP(h)),!i.stats.firstBytesReceivedAt&&i.stats.bytesReceived&&(i.stats.firstBytesReceivedAt=Date.now()),e(h,i)},bP=({xhr:i,xhrOptions:e,decryptionWorker:t,segment:n,abortFn:r,progressFn:s,trackInfoFn:a,timingInfoFn:o,videoSegmentTimingInfoFn:c,audioSegmentTimingInfoFn:u,id3Fn:d,captionsFn:h,isEndOfTimeline:b,endedTimelineFn:v,dataFn:y,doneFn:p,onTransmuxerLog:f,triggerSegmentEventFn:m})=>{const _=[],k=gP({activeXhrs:_,decryptionWorker:t,trackInfoFn:a,timingInfoFn:o,videoSegmentTimingInfoFn:c,audioSegmentTimingInfoFn:u,id3Fn:d,captionsFn:h,isEndOfTimeline:b,endedTimelineFn:v,dataFn:y,doneFn:p,onTransmuxerLog:f,triggerSegmentEventFn:m});if(n.key&&!n.key.bytes){const P=[n.key];n.map&&!n.map.bytes&&n.map.key&&n.map.key.resolvedUri===n.key.resolvedUri&&P.push(n.map.key);const S=It(e,{uri:n.key.resolvedUri,responseType:"arraybuffer",requestType:"segment-key"}),M=X2(n,P,k,m),U={uri:n.key.resolvedUri};m({type:"segmentkeyloadstart",segment:n,keyInfo:U});const B=i(S,M);_.push(B)}if(n.map&&!n.map.bytes){if(n.map.key&&(!n.key||n.key.resolvedUri!==n.map.key.resolvedUri)){const B=It(e,{uri:n.map.key.resolvedUri,responseType:"arraybuffer",requestType:"segment-key"}),Q=X2(n,[n.map.key],k,m),ie={uri:n.map.key.resolvedUri};m({type:"segmentkeyloadstart",segment:n,keyInfo:ie});const Y=i(B,Q);_.push(Y)}const S=It(e,{uri:n.map.resolvedUri,responseType:"arraybuffer",headers:jp(n.map),requestType:"segment-media-initialization"}),M=hP({segment:n,finishProcessingFn:k,triggerSegmentEventFn:m});m({type:"segmentloadstart",segment:n});const U=i(S,M);_.push(U)}const D=It(e,{uri:n.part&&n.part.resolvedUri||n.resolvedUri,responseType:"arraybuffer",headers:jp(n),requestType:"segment"}),w=fP({segment:n,finishProcessingFn:k,responseType:D.responseType,triggerSegmentEventFn:m});m({type:"segmentloadstart",segment:n});const A=i(D,w);A.addEventListener("progress",yP({segment:n,progressFn:s,trackInfoFn:a,timingInfoFn:o,videoSegmentTimingInfoFn:c,audioSegmentTimingInfoFn:u,id3Fn:d,captionsFn:h,isEndOfTimeline:b,endedTimelineFn:v,dataFn:y})),_.push(A);const x={};return _.forEach(P=>{P.addEventListener("loadend",vP({loadendState:x,abortFn:r}))}),()=>zp(_)},Hu=Ii("PlaylistSelector"),Z2=function(i){if(!i||!i.playlist)return;const e=i.playlist;return JSON.stringify({id:e.id,bandwidth:i.bandwidth,width:i.width,height:i.height,codecs:e.attributes&&e.attributes.CODECS||""})},no=function(i,e){if(!i)return"";const t=te.getComputedStyle(i);return t?t[e]:""},io=function(i,e){const t=i.slice();i.sort(function(n,r){const s=e(n,r);return s===0?t.indexOf(n)-t.indexOf(r):s})},Wp=function(i,e){let t,n;return i.attributes.BANDWIDTH&&(t=i.attributes.BANDWIDTH),t=t||te.Number.MAX_VALUE,e.attributes.BANDWIDTH&&(n=e.attributes.BANDWIDTH),n=n||te.Number.MAX_VALUE,t-n},_P=function(i,e){let t,n;return i.attributes.RESOLUTION&&i.attributes.RESOLUTION.width&&(t=i.attributes.RESOLUTION.width),t=t||te.Number.MAX_VALUE,e.attributes.RESOLUTION&&e.attributes.RESOLUTION.width&&(n=e.attributes.RESOLUTION.width),n=n||te.Number.MAX_VALUE,t===n&&i.attributes.BANDWIDTH&&e.attributes.BANDWIDTH?i.attributes.BANDWIDTH-e.attributes.BANDWIDTH:t-n};let e_=function(i){const{main:e,bandwidth:t,playerWidth:n,playerHeight:r,playerObjectFit:s,limitRenditionByPlayerDimensions:a,playlistController:o}=i;if(!e)return;const c={bandwidth:t,width:n,height:r,limitRenditionByPlayerDimensions:a};let u=e.playlists;ri.isAudioOnly(e)&&(u=o.getAudioTrackPlaylists_(),c.audioOnly=!0);let d=u.map(x=>{let P;const S=x.attributes&&x.attributes.RESOLUTION&&x.attributes.RESOLUTION.width,M=x.attributes&&x.attributes.RESOLUTION&&x.attributes.RESOLUTION.height;return P=x.attributes&&x.attributes.BANDWIDTH,P=P||te.Number.MAX_VALUE,{bandwidth:P,width:S,height:M,playlist:x}});io(d,(x,P)=>x.bandwidth-P.bandwidth),d=d.filter(x=>!ri.isIncompatible(x.playlist));let h=d.filter(x=>ri.isEnabled(x.playlist));h.length||(h=d.filter(x=>!ri.isDisabled(x.playlist)));const b=h.filter(x=>x.bandwidth*Sn.BANDWIDTH_VARIANCE<t);let v=b[b.length-1];const y=b.filter(x=>x.bandwidth===v.bandwidth)[0];if(a===!1){const x=y||h[0]||d[0];if(x&&x.playlist){let P="sortedPlaylistReps";return y&&(P="bandwidthBestRep"),h[0]&&(P="enabledPlaylistReps"),Hu(`choosing ${Z2(x)} using ${P} with options`,c),x.playlist}return Hu("could not choose a playlist with options",c),null}const p=b.filter(x=>x.width&&x.height);io(p,(x,P)=>x.width-P.width);const f=p.filter(x=>x.width===n&&x.height===r);v=f[f.length-1];const m=f.filter(x=>x.bandwidth===v.bandwidth)[0];let _,k,D;m||(_=p.filter(x=>s==="cover"?x.width>n&&x.height>r:x.width>n||x.height>r),k=_.filter(x=>x.width===_[0].width&&x.height===_[0].height),v=k[k.length-1],D=k.filter(x=>x.bandwidth===v.bandwidth)[0]);let w;if(o.leastPixelDiffSelector){const x=p.map(P=>(P.pixelDiff=Math.abs(P.width-n)+Math.abs(P.height-r),P));io(x,(P,S)=>P.pixelDiff===S.pixelDiff?S.bandwidth-P.bandwidth:P.pixelDiff-S.pixelDiff),w=x[0]}const A=w||D||m||y||h[0]||d[0];if(A&&A.playlist){let x="sortedPlaylistReps";return w?x="leastPixelDiffRep":D?x="resolutionPlusOneRep":m?x="resolutionBestRep":y?x="bandwidthBestRep":h[0]&&(x="enabledPlaylistReps"),Hu(`choosing ${Z2(A)} using ${x} with options`,c),A.playlist}return Hu("could not choose a playlist with options",c),null};const t_=function(){let i=this.useDevicePixelRatio&&te.devicePixelRatio||1;return isNaN(this.customPixelRatio)||(i=this.customPixelRatio),e_({main:this.playlists.main,bandwidth:this.systemBandwidth,playerWidth:parseInt(no(this.tech_.el(),"width"),10)*i,playerHeight:parseInt(no(this.tech_.el(),"height"),10)*i,playerObjectFit:this.usePlayerObjectFit?no(this.tech_.el(),"objectFit"):"",limitRenditionByPlayerDimensions:this.limitRenditionByPlayerDimensions,playlistController:this.playlistController_})},kP=function(i){let e=-1,t=-1;if(i<0||i>1)throw new Error("Moving average bandwidth decay must be between 0 and 1.");return function(){let n=this.useDevicePixelRatio&&te.devicePixelRatio||1;return isNaN(this.customPixelRatio)||(n=this.customPixelRatio),e<0&&(e=this.systemBandwidth,t=this.systemBandwidth),this.systemBandwidth>0&&this.systemBandwidth!==t&&(e=i*this.systemBandwidth+(1-i)*e,t=this.systemBandwidth),e_({main:this.playlists.main,bandwidth:e,playerWidth:parseInt(no(this.tech_.el(),"width"),10)*n,playerHeight:parseInt(no(this.tech_.el(),"height"),10)*n,playerObjectFit:this.usePlayerObjectFit?no(this.tech_.el(),"objectFit"):"",limitRenditionByPlayerDimensions:this.limitRenditionByPlayerDimensions,playlistController:this.playlistController_})}},TP=function(i){const{main:e,currentTime:t,bandwidth:n,duration:r,segmentDuration:s,timeUntilRebuffer:a,currentTimeline:o,syncController:c}=i,u=e.playlists.filter(y=>!ri.isIncompatible(y));let d=u.filter(ri.isEnabled);d.length||(d=u.filter(y=>!ri.isDisabled(y)));const b=d.filter(ri.hasAttribute.bind(null,"BANDWIDTH")).map(y=>{const f=c.getSyncPoint(y,r,o,t)?1:2,_=ri.estimateSegmentRequestTime(s,n,y)*f-a;return{playlist:y,rebufferingImpact:_}}),v=b.filter(y=>y.rebufferingImpact<=0);return io(v,(y,p)=>Wp(p.playlist,y.playlist)),v.length?v[0]:(io(b,(y,p)=>y.rebufferingImpact-p.rebufferingImpact),b[0]||null)},SP=function(){const i=this.playlists.main.playlists.filter(ri.isEnabled);return io(i,(t,n)=>Wp(t,n)),i.filter(t=>!!kl(this.playlists.main,t).video)[0]||null},CP=i=>{let e=0,t;return i.bytes&&(t=new Uint8Array(i.bytes),i.segments.forEach(n=>{t.set(n,e),e+=n.byteLength})),t};function n_(i){try{return new URL(i).pathname.split("/").slice(-2).join("/")}catch{return""}}const xP=function(i,e,t){if(!i[t]){e.trigger({type:"usage",name:"vhs-608"});let n=t;/^cc708_/.test(t)&&(n="SERVICE"+t.split("_")[1]);const r=e.textTracks().getTrackById(n);if(r)i[t]=r;else{const s=e.options_.vhs&&e.options_.vhs.captionServices||{};let a=t,o=t,c=!1;const u=s[n];u&&(a=u.label,o=u.language,c=u.default),i[t]=e.addRemoteTextTrack({kind:"captions",id:n,default:c,label:a,language:o},!1).track}}},EP=function({inbandTextTracks:i,captionArray:e,timestampOffset:t}){if(!e)return;const n=te.WebKitDataCue||te.VTTCue;e.forEach(r=>{const s=r.stream;r.content?r.content.forEach(a=>{const o=new n(r.startTime+t,r.endTime+t,a.text);o.line=a.line,o.align="left",o.position=a.position,o.positionAlign="line-left",i[s].addCue(o)}):i[s].addCue(new n(r.startTime+t,r.endTime+t,r.text))})},wP=function(i){Object.defineProperties(i.frame,{id:{get(){return pe.log.warn("cue.frame.id is deprecated. Use cue.value.key instead."),i.value.key}},value:{get(){return pe.log.warn("cue.frame.value is deprecated. Use cue.value.data instead."),i.value.data}},privateData:{get(){return pe.log.warn("cue.frame.privateData is deprecated. Use cue.value.data instead."),i.value.data}}})},DP=({inbandTextTracks:i,metadataArray:e,timestampOffset:t,videoDuration:n})=>{if(!e)return;const r=te.WebKitDataCue||te.VTTCue,s=i.metadataTrack_;if(!s||(e.forEach(d=>{const h=d.cueTime+t;typeof h!="number"||te.isNaN(h)||h<0||!(h<1/0)||!d.frames||!d.frames.length||d.frames.forEach(b=>{const v=new r(h,h,b.value||b.url||b.data||"");v.frame=b,v.value=b,wP(v),s.addCue(v)})}),!s.cues||!s.cues.length))return;const a=s.cues,o=[];for(let d=0;d<a.length;d++)a[d]&&o.push(a[d]);const c=o.reduce((d,h)=>{const b=d[h.startTime]||[];return b.push(h),d[h.startTime]=b,d},{}),u=Object.keys(c).sort((d,h)=>Number(d)-Number(h));u.forEach((d,h)=>{const b=c[d],v=isFinite(n)?n:d,y=Number(u[h+1])||v;b.forEach(p=>{p.endTime=y})})},AP={id:"ID",class:"CLASS",startDate:"START-DATE",duration:"DURATION",endDate:"END-DATE",endOnNext:"END-ON-NEXT",plannedDuration:"PLANNED-DURATION",scte35Out:"SCTE35-OUT",scte35In:"SCTE35-IN"},IP=new Set(["id","class","startDate","duration","endDate","endOnNext","startTime","endTime","processDateRange"]),PP=({inbandTextTracks:i,dateRanges:e})=>{const t=i.metadataTrack_;if(!t)return;const n=te.WebKitDataCue||te.VTTCue;e.forEach(r=>{for(const s of Object.keys(r)){if(IP.has(s))continue;const a=new n(r.startTime,r.endTime,"");a.id=r.id,a.type="com.apple.quicktime.HLS",a.value={key:AP[s],data:r[s]},(s==="scte35Out"||s==="scte35In")&&(a.value.data=new Uint8Array(a.value.data.match(/[\da-f]{2}/gi)).buffer),t.addCue(a)}r.processDateRange()})},i_=(i,e,t)=>{i.metadataTrack_||(i.metadataTrack_=t.addRemoteTextTrack({kind:"metadata",label:"Timed Metadata"},!1).track,pe.browser.IS_ANY_SAFARI||(i.metadataTrack_.inBandMetadataTrackDispatchType=e))},Tl=function(i,e,t){let n,r;if(t&&t.cues)for(n=t.cues.length;n--;)r=t.cues[n],r.startTime>=i&&r.endTime<=e&&t.removeCue(r)},NP=function(i){const e=i.cues;if(!e)return;const t={};for(let n=e.length-1;n>=0;n--){const r=e[n],s=`${r.startTime}-${r.endTime}-${r.text}`;t[s]?i.removeCue(r):t[s]=r}},OP=(i,e,t)=>{if(typeof e>"u"||e===null||!i.length)return[];const n=Math.ceil((e-t+3)*Ls.ONE_SECOND_IN_TS);let r;for(r=0;r<i.length&&!(i[r].pts>n);r++);return i.slice(r)},MP=(i,e,t)=>{if(!e.length)return i;if(t)return e.slice();const n=e[0].pts;let r=0;for(r;r<i.length&&!(i[r].pts>=n);r++);return i.slice(0,r).concat(e)},RP=(i,e,t,n)=>{const r=Math.ceil((e-n)*Ls.ONE_SECOND_IN_TS),s=Math.ceil((t-n)*Ls.ONE_SECOND_IN_TS),a=i.slice();let o=i.length;for(;o--&&!(i[o].pts<=s););if(o===-1)return a;let c=o+1;for(;c--&&!(i[c].pts<=r););return c=Math.max(c,0),a.splice(c,o-c+1),a},LP=function(i,e){if(!i&&!e||!i&&e||i&&!e)return!1;if(i===e)return!0;const t=Object.keys(i).sort(),n=Object.keys(e).sort();if(t.length!==n.length)return!1;for(let r=0;r<t.length;r++){const s=t[r];if(s!==n[r]||i[s]!==e[s])return!1}return!0},BP=function(i,e,t){e=e||[];const n=[];let r=0;for(let s=0;s<e.length;s++){const a=e[s];if(i===a.timeline&&(n.push(s),r+=a.duration,r>t))return s}return n.length===0?0:n[n.length-1]},Sl=1,UP=500,r_=i=>typeof i=="number"&&isFinite(i),qu=1/60,FP=(i,e,t)=>i!=="main"||!e||!t?null:!t.hasAudio&&!t.hasVideo?"Neither audio nor video found in segment.":e.hasVideo&&!t.hasVideo?"Only audio found in segment when we expected video. We can't switch to audio only from a stream that had video. To get rid of this message, please add codec information to the manifest.":!e.hasVideo&&t.hasVideo?"Video found in segment when we expected only audio. We can't switch to a stream with video from an audio only stream. To get rid of this message, please add codec information to the manifest.":null,VP=(i,e,t)=>{let n=e-Sn.BACK_BUFFER_LENGTH;i.length&&(n=Math.max(n,i.start(0)));const r=e-t;return Math.min(r,n)},ro=i=>{const{startOfSegment:e,duration:t,segment:n,part:r,playlist:{mediaSequence:s,id:a,segments:o=[]},mediaIndex:c,partIndex:u,timeline:d}=i,h=o.length-1;let b="mediaIndex/partIndex increment";i.getMediaInfoForTime?b=`getMediaInfoForTime (${i.getMediaInfoForTime})`:i.isSyncRequest&&(b="getSyncSegmentCandidate (isSyncRequest)"),i.independent&&(b+=` with independent ${i.independent}`);const v=typeof u=="number",y=i.segment.uri?"segment":"pre-segment",p=v?u2({preloadSegment:n})-1:0;return`${y} [${s+c}/${s+h}]`+(v?` part [${u}/${p}]`:"")+` segment start/end [${n.start} => ${n.end}]`+(v?` part start/end [${r.start} => ${r.end}]`:"")+` startOfSegment [${e}] duration [${t}] timeline [${d}] selected by [${b}] playlist [${a}]`},s_=i=>`${i}TimingInfo`,jP=({segmentTimeline:i,currentTimeline:e,startOfSegment:t,buffered:n,overrideCheck:r})=>!r&&i===e?null:i<e?t:n.length?n.end(n.length-1):t,Kp=({timelineChangeController:i,currentTimeline:e,segmentTimeline:t,loaderType:n,audioDisabled:r})=>{if(e===t)return!1;if(n==="audio"){const s=i.lastTimelineChange({type:"main"});return!s||s.to!==t}if(n==="main"&&r){const s=i.pendingTimelineChange({type:"audio"});return!(s&&s.to===t)}return!1},$P=i=>{if(!i)return!1;const e=i.pendingTimelineChange({type:"audio"}),t=i.pendingTimelineChange({type:"main"}),n=e&&t,r=n&&e.to!==t.to;return!!(n&&e.from!==-1&&t.from!==-1&&r)},HP=i=>{const e=i.timelineChangeController_.pendingTimelineChange({type:"audio"}),t=i.timelineChangeController_.pendingTimelineChange({type:"main"});return e&&t&&e.to<t.to},us=i=>{const e=i.pendingSegment_;if(!e)return;if(Kp({timelineChangeController:i.timelineChangeController_,currentTimeline:i.currentTimeline_,segmentTimeline:e.timeline,loaderType:i.loaderType_,audioDisabled:i.audioDisabled_})&&$P(i.timelineChangeController_)){if(HP(i)){i.timelineChangeController_.trigger("audioTimelineBehind");return}i.timelineChangeController_.trigger("fixBadTimelineChange")}},qP=i=>{let e=0;return["video","audio"].forEach(function(t){const n=i[`${t}TimingInfo`];if(!n)return;const{start:r,end:s}=n;let a;typeof r=="bigint"||typeof s=="bigint"?a=te.BigInt(s)-te.BigInt(r):typeof r=="number"&&typeof s=="number"&&(a=s-r),typeof a<"u"&&a>e&&(e=a)}),typeof e=="bigint"&&e<Number.MAX_SAFE_INTEGER&&(e=Number(e)),e},a_=({segmentDuration:i,maxDuration:e})=>i?Math.round(i)>e+ur:!1,zP=(i,e)=>{if(e!=="hls")return null;const t=qP({audioTimingInfo:i.audioTimingInfo,videoTimingInfo:i.videoTimingInfo});if(!t)return null;const n=i.playlist.targetDuration,r=a_({segmentDuration:t,maxDuration:n*2}),s=a_({segmentDuration:t,maxDuration:n}),a=`Segment with index ${i.mediaIndex} from playlist ${i.playlist.id} has a duration of ${t} when the reported duration is ${i.duration} and the target duration is ${n}. For HLS content, a duration in excess of the target duration may result in playback issues. See the HLS specification section on EXT-X-TARGETDURATION for more details: https://tools.ietf.org/html/draft-pantos-http-live-streaming-23#section-4.3.3.1`;return r||s?{severity:r?"warn":"info",message:a}:null},Gs=({type:i,segment:e})=>{if(!e)return;const t=!!(e.key||e.map&&e.map.ke),n=!!(e.map&&!e.map.bytes),r=e.startOfSegment===void 0?e.start:e.startOfSegment;return{type:i||e.type,uri:e.resolvedUri||e.uri,start:r,duration:e.duration,isEncrypted:t,isMediaInitialization:n}};class Xp extends pe.EventTarget{constructor(e,t={}){if(super(),!e)throw new TypeError("Initialization settings are required");if(typeof e.currentTime!="function")throw new TypeError("No currentTime getter specified");if(!e.mediaSource)throw new TypeError("No MediaSource specified");this.bandwidth=e.bandwidth,this.throughput={rate:0,count:0},this.roundTrip=NaN,this.resetStats_(),this.mediaIndex=null,this.partIndex=null,this.hasPlayed_=e.hasPlayed,this.currentTime_=e.currentTime,this.seekable_=e.seekable,this.seeking_=e.seeking,this.duration_=e.duration,this.mediaSource_=e.mediaSource,this.vhs_=e.vhs,this.loaderType_=e.loaderType,this.currentMediaInfo_=void 0,this.startingMediaInfo_=void 0,this.segmentMetadataTrack_=e.segmentMetadataTrack,this.goalBufferLength_=e.goalBufferLength,this.sourceType_=e.sourceType,this.sourceUpdater_=e.sourceUpdater,this.inbandTextTracks_=e.inbandTextTracks,this.state_="INIT",this.timelineChangeController_=e.timelineChangeController,this.shouldSaveSegmentTimingInfo_=!0,this.parse708captions_=e.parse708captions,this.useDtsForTimestampOffset_=e.useDtsForTimestampOffset,this.captionServices_=e.captionServices,this.exactManifestTimings=e.exactManifestTimings,this.addMetadataToTextTrack=e.addMetadataToTextTrack,this.checkBufferTimeout_=null,this.error_=void 0,this.currentTimeline_=-1,this.shouldForceTimestampOffsetAfterResync_=!1,this.pendingSegment_=null,this.xhrOptions_=null,this.pendingSegments_=[],this.audioDisabled_=!1,this.isPendingTimestampOffset_=!1,this.gopBuffer_=[],this.timeMapping_=0,this.safeAppend_=!1,this.appendInitSegment_={audio:!0,video:!0},this.playlistOfLastInitSegment_={audio:null,video:null},this.callQueue_=[],this.loadQueue_=[],this.metadataQueue_={id3:[],caption:[]},this.waitingOnRemove_=!1,this.quotaExceededErrorRetryTimeout_=null,this.activeInitSegmentId_=null,this.initSegments_={},this.cacheEncryptionKeys_=e.cacheEncryptionKeys,this.keyCache_={},this.decrypter_=e.decrypter,this.syncController_=e.syncController,this.syncPoint_={segmentIndex:0,time:0},this.transmuxer_=this.createTransmuxer_(),this.triggerSyncInfoUpdate_=()=>this.trigger("syncinfoupdate"),this.syncController_.on("syncinfoupdate",this.triggerSyncInfoUpdate_),this.mediaSource_.addEventListener("sourceopen",()=>{this.isEndOfStream_()||(this.ended_=!1)}),this.fetchAtBuffer_=!1,this.logger_=Ii(`SegmentLoader[${this.loaderType_}]`),Object.defineProperty(this,"state",{get(){return this.state_},set(n){n!==this.state_&&(this.logger_(`${this.state_} -> ${n}`),this.state_=n,this.trigger("statechange"))}}),this.sourceUpdater_.on("ready",()=>{this.hasEnoughInfoToAppend_()?this.processCallQueue_():us(this)}),this.sourceUpdater_.on("codecschange",n=>{this.trigger(dn({type:"codecschange"},n))}),this.loaderType_==="main"&&this.timelineChangeController_.on("pendingtimelinechange",()=>{this.hasEnoughInfoToAppend_()?this.processCallQueue_():us(this)}),this.loaderType_==="audio"&&this.timelineChangeController_.on("timelinechange",n=>{this.trigger(dn({type:"timelinechange"},n)),this.hasEnoughInfoToLoad_()?this.processLoadQueue_():us(this),this.hasEnoughInfoToAppend_()?this.processCallQueue_():us(this)})}get mediaSequenceSync_(){return this.syncController_.getMediaSequenceSync(this.loaderType_)}createTransmuxer_(){return qp.createTransmuxer({remux:!1,alignGopsAtEnd:this.safeAppend_,keepOriginalTimestamps:!0,parse708captions:this.parse708captions_,captionServices:this.captionServices_})}resetStats_(){this.mediaBytesTransferred=0,this.mediaRequests=0,this.mediaRequestsAborted=0,this.mediaRequestsTimedout=0,this.mediaRequestsErrored=0,this.mediaTransferDuration=0,this.mediaSecondsLoaded=0,this.mediaAppends=0}dispose(){this.trigger("dispose"),this.state="DISPOSED",this.pause(),this.abort_(),this.transmuxer_&&this.transmuxer_.terminate(),this.resetStats_(),this.checkBufferTimeout_&&te.clearTimeout(this.checkBufferTimeout_),this.syncController_&&this.triggerSyncInfoUpdate_&&this.syncController_.off("syncinfoupdate",this.triggerSyncInfoUpdate_),this.off()}setAudio(e){this.audioDisabled_=!e,e?this.appendInitSegment_.audio=!0:this.sourceUpdater_.removeAudio(0,this.duration_())}abort(){if(this.state!=="WAITING"){this.pendingSegment_&&(this.pendingSegment_=null),this.timelineChangeController_.clearPendingTimelineChange(this.loaderType_);return}this.abort_(),this.state="READY",this.paused()||this.monitorBuffer_()}abort_(){this.pendingSegment_&&this.pendingSegment_.abortRequests&&this.pendingSegment_.abortRequests(),this.pendingSegment_=null,this.callQueue_=[],this.loadQueue_=[],this.metadataQueue_.id3=[],this.metadataQueue_.caption=[],this.timelineChangeController_.clearPendingTimelineChange(this.loaderType_),this.waitingOnRemove_=!1,te.clearTimeout(this.quotaExceededErrorRetryTimeout_),this.quotaExceededErrorRetryTimeout_=null}checkForAbort_(e){return this.state==="APPENDING"&&!this.pendingSegment_?(this.state="READY",!0):!this.pendingSegment_||this.pendingSegment_.requestId!==e}error(e){return typeof e<"u"&&(this.logger_("error occurred:",e),this.error_=e),this.pendingSegment_=null,this.error_}endOfStream(){this.ended_=!0,this.transmuxer_&&qp.reset(this.transmuxer_),this.gopBuffer_.length=0,this.pause(),this.trigger("ended")}buffered_(){const e=this.getMediaInfo_();if(!this.sourceUpdater_||!e)return Tn();if(this.loaderType_==="main"){const{hasAudio:t,hasVideo:n,isMuxed:r}=e;if(n&&t&&!this.audioDisabled_&&!r)return this.sourceUpdater_.buffered();if(n)return this.sourceUpdater_.videoBuffered()}return this.sourceUpdater_.audioBuffered()}initSegmentForMap(e,t=!1){if(!e)return null;const n=$u(e);let r=this.initSegments_[n];return t&&!r&&e.bytes&&(this.initSegments_[n]=r={resolvedUri:e.resolvedUri,byterange:e.byterange,bytes:e.bytes,tracks:e.tracks,timescales:e.timescales}),r||e}segmentKey(e,t=!1){if(!e)return null;const n=O2(e);let r=this.keyCache_[n];this.cacheEncryptionKeys_&&t&&!r&&e.bytes&&(this.keyCache_[n]=r={resolvedUri:e.resolvedUri,bytes:e.bytes});const s={resolvedUri:(r||e).resolvedUri};return r&&(s.bytes=r.bytes),s}couldBeginLoading_(){return this.playlist_&&!this.paused()}load(){if(this.monitorBuffer_(),!!this.playlist_){if(this.state==="INIT"&&this.couldBeginLoading_())return this.init_();!this.couldBeginLoading_()||this.state!=="READY"&&this.state!=="INIT"||(this.state="READY")}}init_(){return this.state="READY",this.resetEverything(),this.monitorBuffer_()}playlist(e,t={}){if(!e||this.playlist_&&this.playlist_.endList&&e.endList&&this.playlist_.uri===e.uri)return;const n=this.playlist_,r=this.pendingSegment_;this.playlist_=e,this.xhrOptions_=t,this.state==="INIT"&&(e.syncInfo={mediaSequence:e.mediaSequence,time:0},this.loaderType_==="main"&&this.syncController_.setDateTimeMappingForStart(e));let s=null;if(n&&(n.id?s=n.id:n.uri&&(s=n.uri)),this.logger_(`playlist update [${s} => ${e.id||e.uri}]`),this.mediaSequenceSync_&&(this.mediaSequenceSync_.update(e,this.currentTime_()),this.logger_(`Playlist update:
229
+ currentTime: ${this.currentTime_()}
230
+ bufferedEnd: ${Pp(this.buffered_())}
231
+ `,this.mediaSequenceSync_.diagnostics)),this.trigger("syncinfoupdate"),this.state==="INIT"&&this.couldBeginLoading_())return this.init_();if(!n||n.uri!==e.uri){this.mediaIndex!==null&&(!e.endList&&typeof e.partTargetDuration=="number"?this.resetLoader():this.resyncLoader()),this.currentMediaInfo_=void 0,this.trigger("playlistupdate");return}const a=e.mediaSequence-n.mediaSequence;if(this.logger_(`live window shift [${a}]`),this.mediaIndex!==null)if(this.mediaIndex-=a,this.mediaIndex<0)this.mediaIndex=null,this.partIndex=null;else{const o=this.playlist_.segments[this.mediaIndex];if(this.partIndex&&(!o.parts||!o.parts.length||!o.parts[this.partIndex])){const c=this.mediaIndex;this.logger_(`currently processing part (index ${this.partIndex}) no longer exists.`),this.resetLoader(),this.mediaIndex=c}}r&&(r.mediaIndex-=a,r.mediaIndex<0?(r.mediaIndex=null,r.partIndex=null):(r.mediaIndex>=0&&(r.segment=e.segments[r.mediaIndex]),r.partIndex>=0&&r.segment.parts&&(r.part=r.segment.parts[r.partIndex]))),this.syncController_.saveExpiredSegmentInfo(n,e)}pause(){this.checkBufferTimeout_&&(te.clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=null)}paused(){return this.checkBufferTimeout_===null}resetEverything(e){this.ended_=!1,this.activeInitSegmentId_=null,this.appendInitSegment_={audio:!0,video:!0},this.resetLoader(),this.remove(0,1/0,e),this.transmuxer_&&(this.transmuxer_.postMessage({action:"clearAllMp4Captions"}),this.transmuxer_.postMessage({action:"reset"}))}resetLoader(){this.fetchAtBuffer_=!1,this.mediaSequenceSync_&&this.mediaSequenceSync_.resetAppendedStatus(),this.resyncLoader()}resyncLoader(){this.transmuxer_&&qp.reset(this.transmuxer_),this.mediaIndex=null,this.partIndex=null,this.syncPoint_=null,this.isPendingTimestampOffset_=!1;const e=this.currentMediaInfo_&&this.currentMediaInfo_.isFmp4;this.sourceType_==="hls"&&!e&&(this.shouldForceTimestampOffsetAfterResync_=!0),this.callQueue_=[],this.loadQueue_=[],this.metadataQueue_.id3=[],this.metadataQueue_.caption=[],this.abort(),this.transmuxer_&&this.transmuxer_.postMessage({action:"clearParsedMp4Captions"})}remove(e,t,n=()=>{},r=!1){if(t===1/0&&(t=this.duration_()),t<=e){this.logger_("skipping remove because end ${end} is <= start ${start}");return}if(!this.sourceUpdater_||!this.getMediaInfo_()){this.logger_("skipping remove because no source updater or starting media info");return}let s=1;const a=()=>{s--,s===0&&n()};(r||!this.audioDisabled_)&&(s++,this.sourceUpdater_.removeAudio(e,t,a)),(r||this.loaderType_==="main")&&(this.gopBuffer_=RP(this.gopBuffer_,e,t,this.timeMapping_),s++,this.sourceUpdater_.removeVideo(e,t,a));for(const o in this.inbandTextTracks_)Tl(e,t,this.inbandTextTracks_[o]);Tl(e,t,this.segmentMetadataTrack_),a()}monitorBuffer_(){this.checkBufferTimeout_&&te.clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=te.setTimeout(this.monitorBufferTick_.bind(this),1)}monitorBufferTick_(){this.state==="READY"&&this.fillBuffer_(),this.checkBufferTimeout_&&te.clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=te.setTimeout(this.monitorBufferTick_.bind(this),UP)}fillBuffer_(){if(this.sourceUpdater_.updating())return;const e=this.chooseNextRequest_();if(!e)return;const t={segmentInfo:Gs({type:this.loaderType_,segment:e})};this.trigger({type:"segmentselected",metadata:t}),typeof e.timestampOffset=="number"&&(this.isPendingTimestampOffset_=!1,this.timelineChangeController_.pendingTimelineChange({type:this.loaderType_,from:this.currentTimeline_,to:e.timeline})),this.loadSegment_(e)}isEndOfStream_(e=this.mediaIndex,t=this.playlist_,n=this.partIndex){if(!t||!this.mediaSource_)return!1;const r=typeof e=="number"&&t.segments[e],s=e+1===t.segments.length,a=!r||!r.parts||n+1===r.parts.length;return t.endList&&this.mediaSource_.readyState==="open"&&s&&a}chooseNextRequest_(){const e=this.buffered_(),t=Pp(e)||0,n=Np(e,this.currentTime_()),r=!this.hasPlayed_()&&n>=1,s=n>=this.goalBufferLength_(),a=this.playlist_.segments;if(!a.length||r||s)return null;this.syncPoint_=this.syncPoint_||this.syncController_.getSyncPoint(this.playlist_,this.duration_(),this.currentTimeline_,this.currentTime_(),this.loaderType_);const o={partIndex:null,mediaIndex:null,startOfSegment:null,playlist:this.playlist_,isSyncRequest:!this.syncPoint_};if(o.isSyncRequest)o.mediaIndex=BP(this.currentTimeline_,a,t),this.logger_(`choose next request. Can not find sync point. Fallback to media Index: ${o.mediaIndex}`);else if(this.mediaIndex!==null){const b=a[this.mediaIndex],v=typeof this.partIndex=="number"?this.partIndex:-1;o.startOfSegment=b.end?b.end:t,b.parts&&b.parts[v+1]?(o.mediaIndex=this.mediaIndex,o.partIndex=v+1):o.mediaIndex=this.mediaIndex+1}else{let b,v,y;const p=this.fetchAtBuffer_?t:this.currentTime_();if(this.mediaSequenceSync_&&this.logger_(`chooseNextRequest_ request after Quality Switch:
232
+ For TargetTime: ${p}.
233
+ CurrentTime: ${this.currentTime_()}
234
+ BufferedEnd: ${t}
235
+ Fetch At Buffer: ${this.fetchAtBuffer_}
236
+ `,this.mediaSequenceSync_.diagnostics),this.mediaSequenceSync_&&this.mediaSequenceSync_.isReliable){const f=this.getSyncInfoFromMediaSequenceSync_(p);if(!f){const m="No sync info found while using media sequence sync";return this.error({message:m,metadata:{errorType:pe.Error.StreamingFailedToSelectNextSegment,error:new Error(m)}}),this.logger_("chooseNextRequest_ - no sync info found using media sequence sync"),null}this.logger_(`chooseNextRequest_ mediaSequence syncInfo (${f.start} --> ${f.end})`),b=f.segmentIndex,v=f.partIndex,y=f.start}else{this.logger_("chooseNextRequest_ - fallback to a regular segment selection algorithm, based on a syncPoint.");const f=ri.getMediaInfoForTime({exactManifestTimings:this.exactManifestTimings,playlist:this.playlist_,currentTime:p,startingPartIndex:this.syncPoint_.partIndex,startingSegmentIndex:this.syncPoint_.segmentIndex,startTime:this.syncPoint_.time});b=f.segmentIndex,v=f.partIndex,y=f.startTime}o.getMediaInfoForTime=this.fetchAtBuffer_?`bufferedEnd ${p}`:`currentTime ${p}`,o.mediaIndex=b,o.startOfSegment=y,o.partIndex=v,this.logger_(`choose next request. Playlist switched and we have a sync point. Media Index: ${o.mediaIndex} `)}const c=a[o.mediaIndex];let u=c&&typeof o.partIndex=="number"&&c.parts&&c.parts[o.partIndex];if(!c||typeof o.partIndex=="number"&&!u)return null;typeof o.partIndex!="number"&&c.parts&&(o.partIndex=0,u=c.parts[0]);const d=this.vhs_.playlists&&this.vhs_.playlists.main&&this.vhs_.playlists.main.independentSegments||this.playlist_.independentSegments;if(!n&&u&&!d&&!u.independent)if(o.partIndex===0){const b=a[o.mediaIndex-1],v=b.parts&&b.parts.length&&b.parts[b.parts.length-1];v&&v.independent&&(o.mediaIndex-=1,o.partIndex=b.parts.length-1,o.independent="previous segment")}else c.parts[o.partIndex-1].independent&&(o.partIndex-=1,o.independent="previous part");const h=this.mediaSource_&&this.mediaSource_.readyState==="ended";return o.mediaIndex>=a.length-1&&h&&!this.seeking_()?null:(this.shouldForceTimestampOffsetAfterResync_&&(this.shouldForceTimestampOffsetAfterResync_=!1,o.forceTimestampOffset=!0,this.logger_("choose next request. Force timestamp offset after loader resync")),this.generateSegmentInfo_(o))}getSyncInfoFromMediaSequenceSync_(e){if(!this.mediaSequenceSync_)return null;const t=Math.max(e,this.mediaSequenceSync_.start);e!==t&&this.logger_(`getSyncInfoFromMediaSequenceSync_. Pulled target time from ${e} to ${t}`);const n=this.mediaSequenceSync_.getSyncInfoForTime(t);if(!n)return null;if(!n.isAppended)return n;const r=this.mediaSequenceSync_.getSyncInfoForTime(n.end);return r?(r.isAppended&&this.logger_("getSyncInfoFromMediaSequenceSync_: We encounter unexpected scenario where next media sequence sync info is also appended!"),r):null}generateSegmentInfo_(e){const{independent:t,playlist:n,mediaIndex:r,startOfSegment:s,isSyncRequest:a,partIndex:o,forceTimestampOffset:c,getMediaInfoForTime:u}=e,d=n.segments[r],h=typeof o=="number"&&d.parts[o],b={requestId:"segment-loader-"+Math.random(),uri:h&&h.resolvedUri||d.resolvedUri,mediaIndex:r,partIndex:h?o:null,isSyncRequest:a,startOfSegment:s,playlist:n,bytes:null,encryptedBytes:null,timestampOffset:null,timeline:d.timeline,duration:h&&h.duration||d.duration,segment:d,part:h,byteLength:0,transmuxer:this.transmuxer_,getMediaInfoForTime:u,independent:t},v=typeof c<"u"?c:this.isPendingTimestampOffset_;b.timestampOffset=this.timestampOffsetForSegment_({segmentTimeline:d.timeline,currentTimeline:this.currentTimeline_,startOfSegment:s,buffered:this.buffered_(),overrideCheck:v});const y=Pp(this.sourceUpdater_.audioBuffered());return typeof y=="number"&&(b.audioAppendStart=y-this.sourceUpdater_.audioTimestampOffset()),this.sourceUpdater_.videoBuffered().length&&(b.gopsToAlignWith=OP(this.gopBuffer_,this.currentTime_()-this.sourceUpdater_.videoTimestampOffset(),this.timeMapping_)),b}timestampOffsetForSegment_(e){return jP(e)}earlyAbortWhenNeeded_(e){if(this.vhs_.tech_.paused()||!this.xhrOptions_.timeout||!this.playlist_.attributes.BANDWIDTH||Date.now()-(e.firstBytesReceivedAt||Date.now())<1e3)return;const t=this.currentTime_(),n=e.bandwidth,r=this.pendingSegment_.duration,s=ri.estimateSegmentRequestTime(r,n,this.playlist_,e.bytesReceived),a=hI(this.buffered_(),t,this.vhs_.tech_.playbackRate())-1;if(s<=a)return;const o=TP({main:this.vhs_.playlists.main,currentTime:t,bandwidth:n,duration:this.duration_(),segmentDuration:r,timeUntilRebuffer:a,currentTimeline:this.currentTimeline_,syncController:this.syncController_});if(!o)return;const u=s-a-o.rebufferingImpact;let d=.5;a<=ur&&(d=1),!(!o.playlist||o.playlist.uri===this.playlist_.uri||u<d)&&(this.bandwidth=o.playlist.attributes.BANDWIDTH*Sn.BANDWIDTH_VARIANCE+1,this.trigger("earlyabort"))}handleAbort_(e){this.logger_(`Aborting ${ro(e)}`),this.mediaRequestsAborted+=1}handleProgress_(e,t){this.earlyAbortWhenNeeded_(t.stats),!this.checkForAbort_(t.requestId)&&this.trigger("progress")}handleTrackInfo_(e,t){const{hasAudio:n,hasVideo:r}=t,s={segmentInfo:Gs({type:this.loaderType_,segment:e}),trackInfo:{hasAudio:n,hasVideo:r}};this.trigger({type:"segmenttransmuxingtrackinfoavailable",metadata:s}),this.earlyAbortWhenNeeded_(e.stats),!this.checkForAbort_(e.requestId)&&(this.checkForIllegalMediaSwitch(t)||(t=t||{},LP(this.currentMediaInfo_,t)||(this.appendInitSegment_={audio:!0,video:!0},this.startingMediaInfo_=t,this.currentMediaInfo_=t,this.logger_("trackinfo update",t),this.trigger("trackinfo")),!this.checkForAbort_(e.requestId)&&(this.pendingSegment_.trackInfo=t,this.hasEnoughInfoToAppend_()?this.processCallQueue_():us(this))))}handleTimingInfo_(e,t,n,r){if(this.earlyAbortWhenNeeded_(e.stats),this.checkForAbort_(e.requestId))return;const s=this.pendingSegment_,a=s_(t);s[a]=s[a]||{},s[a][n]=r,this.logger_(`timinginfo: ${t} - ${n} - ${r}`),this.hasEnoughInfoToAppend_()?this.processCallQueue_():us(this)}handleCaptions_(e,t){if(this.earlyAbortWhenNeeded_(e.stats),this.checkForAbort_(e.requestId))return;if(t.length===0){this.logger_("SegmentLoader received no captions from a caption event");return}if(!this.pendingSegment_.hasAppendedData_){this.metadataQueue_.caption.push(this.handleCaptions_.bind(this,e,t));return}const r=this.sourceUpdater_.videoTimestampOffset()===null?this.sourceUpdater_.audioTimestampOffset():this.sourceUpdater_.videoTimestampOffset(),s={};t.forEach(a=>{s[a.stream]=s[a.stream]||{startTime:1/0,captions:[],endTime:0};const o=s[a.stream];o.startTime=Math.min(o.startTime,a.startTime+r),o.endTime=Math.max(o.endTime,a.endTime+r),o.captions.push(a)}),Object.keys(s).forEach(a=>{const{startTime:o,endTime:c,captions:u}=s[a],d=this.inbandTextTracks_;this.logger_(`adding cues from ${o} -> ${c} for ${a}`),xP(d,this.vhs_.tech_,a),Tl(o,c,d[a]),EP({captionArray:u,inbandTextTracks:d,timestampOffset:r})}),this.transmuxer_&&this.transmuxer_.postMessage({action:"clearParsedMp4Captions"})}handleId3_(e,t,n){if(this.earlyAbortWhenNeeded_(e.stats),this.checkForAbort_(e.requestId))return;if(!this.pendingSegment_.hasAppendedData_){this.metadataQueue_.id3.push(this.handleId3_.bind(this,e,t,n));return}this.addMetadataToTextTrack(n,t,this.duration_())}processMetadataQueue_(){this.metadataQueue_.id3.forEach(e=>e()),this.metadataQueue_.caption.forEach(e=>e()),this.metadataQueue_.id3=[],this.metadataQueue_.caption=[]}processCallQueue_(){const e=this.callQueue_;this.callQueue_=[],e.forEach(t=>t())}processLoadQueue_(){const e=this.loadQueue_;this.loadQueue_=[],e.forEach(t=>t())}hasEnoughInfoToLoad_(){if(this.loaderType_!=="audio")return!0;const e=this.pendingSegment_;return e?this.getCurrentMediaInfo_()?!Kp({timelineChangeController:this.timelineChangeController_,currentTimeline:this.currentTimeline_,segmentTimeline:e.timeline,loaderType:this.loaderType_,audioDisabled:this.audioDisabled_}):!0:!1}getCurrentMediaInfo_(e=this.pendingSegment_){return e&&e.trackInfo||this.currentMediaInfo_}getMediaInfo_(e=this.pendingSegment_){return this.getCurrentMediaInfo_(e)||this.startingMediaInfo_}getPendingSegmentPlaylist(){return this.pendingSegment_?this.pendingSegment_.playlist:null}hasEnoughInfoToAppend_(){if(!this.sourceUpdater_.ready()||this.waitingOnRemove_||this.quotaExceededErrorRetryTimeout_)return!1;const e=this.pendingSegment_,t=this.getCurrentMediaInfo_();if(!e||!t)return!1;const{hasAudio:n,hasVideo:r,isMuxed:s}=t;return!(r&&!e.videoTimingInfo||n&&!this.audioDisabled_&&!s&&!e.audioTimingInfo||Kp({timelineChangeController:this.timelineChangeController_,currentTimeline:this.currentTimeline_,segmentTimeline:e.timeline,loaderType:this.loaderType_,audioDisabled:this.audioDisabled_}))}handleData_(e,t){if(this.earlyAbortWhenNeeded_(e.stats),this.checkForAbort_(e.requestId))return;if(this.callQueue_.length||!this.hasEnoughInfoToAppend_()){us(this),this.callQueue_.push(this.handleData_.bind(this,e,t));return}const n=this.pendingSegment_;if(this.setTimeMapping_(n.timeline),this.updateMediaSecondsLoaded_(n.part||n.segment),this.mediaSource_.readyState!=="closed"){if(e.map&&(e.map=this.initSegmentForMap(e.map,!0),n.segment.map=e.map),e.key&&this.segmentKey(e.key,!0),n.isFmp4=e.isFmp4,n.timingInfo=n.timingInfo||{},n.isFmp4)this.trigger("fmp4"),n.timingInfo.start=n[s_(t.type)].start;else{const r=this.getCurrentMediaInfo_(),s=this.loaderType_==="main"&&r&&r.hasVideo;let a;s&&(a=n.videoTimingInfo.start),n.timingInfo.start=this.trueSegmentStart_({currentStart:n.timingInfo.start,playlist:n.playlist,mediaIndex:n.mediaIndex,currentVideoTimestampOffset:this.sourceUpdater_.videoTimestampOffset(),useVideoTimingInfo:s,firstVideoFrameTimeForData:a,videoTimingInfo:n.videoTimingInfo,audioTimingInfo:n.audioTimingInfo})}if(this.updateAppendInitSegmentStatus(n,t.type),this.updateSourceBufferTimestampOffset_(n),n.isSyncRequest){this.updateTimingInfoEnd_(n),this.syncController_.saveSegmentTimingInfo({segmentInfo:n,shouldSaveTimelineMapping:this.loaderType_==="main"});const r=this.chooseNextRequest_();if(r.mediaIndex!==n.mediaIndex||r.partIndex!==n.partIndex){this.logger_("sync segment was incorrect, not appending");return}this.logger_("sync segment was correct, appending")}n.hasAppendedData_=!0,this.processMetadataQueue_(),this.appendData_(n,t)}}updateAppendInitSegmentStatus(e,t){this.loaderType_==="main"&&typeof e.timestampOffset=="number"&&!e.changedTimestampOffset&&(this.appendInitSegment_={audio:!0,video:!0}),this.playlistOfLastInitSegment_[t]!==e.playlist&&(this.appendInitSegment_[t]=!0)}getInitSegmentAndUpdateState_({type:e,initSegment:t,map:n,playlist:r}){if(n){const s=$u(n);if(this.activeInitSegmentId_===s)return null;t=this.initSegmentForMap(n,!0).bytes,this.activeInitSegmentId_=s}return t&&this.appendInitSegment_[e]?(this.playlistOfLastInitSegment_[e]=r,this.appendInitSegment_[e]=!1,this.activeInitSegmentId_=null,t):null}handleQuotaExceededError_({segmentInfo:e,type:t,bytes:n},r){const s=this.sourceUpdater_.audioBuffered(),a=this.sourceUpdater_.videoBuffered();s.length>1&&this.logger_("On QUOTA_EXCEEDED_ERR, found gaps in the audio buffer: "+qs(s).join(", ")),a.length>1&&this.logger_("On QUOTA_EXCEEDED_ERR, found gaps in the video buffer: "+qs(a).join(", "));const o=s.length?s.start(0):0,c=s.length?s.end(s.length-1):0,u=a.length?a.start(0):0,d=a.length?a.end(a.length-1):0;if(c-o<=Sl&&d-u<=Sl){this.logger_(`On QUOTA_EXCEEDED_ERR, single segment too large to append to buffer, triggering an error. Appended byte length: ${n.byteLength}, audio buffer: ${qs(s).join(", ")}, video buffer: ${qs(a).join(", ")}, `),this.error({message:"Quota exceeded error with append of a single segment of content",excludeUntil:1/0}),this.trigger("error");return}this.waitingOnRemove_=!0,this.callQueue_.push(this.appendToSourceBuffer_.bind(this,{segmentInfo:e,type:t,bytes:n}));const b=this.currentTime_()-Sl;this.logger_(`On QUOTA_EXCEEDED_ERR, removing audio/video from 0 to ${b}`),this.remove(0,b,()=>{this.logger_(`On QUOTA_EXCEEDED_ERR, retrying append in ${Sl}s`),this.waitingOnRemove_=!1,this.quotaExceededErrorRetryTimeout_=te.setTimeout(()=>{this.logger_("On QUOTA_EXCEEDED_ERR, re-processing call queue"),this.quotaExceededErrorRetryTimeout_=null,this.processCallQueue_()},Sl*1e3)},!0)}handleAppendError_({segmentInfo:e,type:t,bytes:n},r){if(r){if(r.code===S2){this.handleQuotaExceededError_({segmentInfo:e,type:t,bytes:n});return}this.logger_("Received non QUOTA_EXCEEDED_ERR on append",r),this.error({message:`${t} append of ${n.length}b failed for segment #${e.mediaIndex} in playlist ${e.playlist.id}`,metadata:{errorType:pe.Error.StreamingFailedToAppendSegment}}),this.trigger("appenderror")}}appendToSourceBuffer_({segmentInfo:e,type:t,initSegment:n,data:r,bytes:s}){if(!s){const o=[r];let c=r.byteLength;n&&(o.unshift(n),c+=n.byteLength),s=CP({bytes:c,segments:o})}const a={segmentInfo:Gs({type:this.loaderType_,segment:e})};this.trigger({type:"segmentappendstart",metadata:a}),this.sourceUpdater_.appendBuffer({segmentInfo:e,type:t,bytes:s},this.handleAppendError_.bind(this,{segmentInfo:e,type:t,bytes:s}))}handleSegmentTimingInfo_(e,t,n){if(!this.pendingSegment_||t!==this.pendingSegment_.requestId)return;const r=this.pendingSegment_.segment,s=`${e}TimingInfo`;r[s]||(r[s]={}),r[s].transmuxerPrependedSeconds=n.prependedContentDuration||0,r[s].transmuxedPresentationStart=n.start.presentation,r[s].transmuxedDecodeStart=n.start.decode,r[s].transmuxedPresentationEnd=n.end.presentation,r[s].transmuxedDecodeEnd=n.end.decode,r[s].baseMediaDecodeTime=n.baseMediaDecodeTime}appendData_(e,t){const{type:n,data:r}=t;if(!r||!r.byteLength||n==="audio"&&this.audioDisabled_)return;const s=this.getInitSegmentAndUpdateState_({type:n,initSegment:t.initSegment,playlist:e.playlist,map:e.isFmp4?e.segment.map:null});this.appendToSourceBuffer_({segmentInfo:e,type:n,initSegment:s,data:r})}loadSegment_(e){if(this.state="WAITING",this.pendingSegment_=e,this.trimBackBuffer_(e),typeof e.timestampOffset=="number"&&this.transmuxer_&&this.transmuxer_.postMessage({action:"clearAllMp4Captions"}),!this.hasEnoughInfoToLoad_()){us(this),this.loadQueue_.push(()=>{const t=dn({},e,{forceTimestampOffset:!0});dn(e,this.generateSegmentInfo_(t)),this.isPendingTimestampOffset_=!1,this.updateTransmuxerAndRequestSegment_(e)});return}this.updateTransmuxerAndRequestSegment_(e)}updateTransmuxerAndRequestSegment_(e){this.shouldUpdateTransmuxerTimestampOffset_(e.timestampOffset)&&(this.gopBuffer_.length=0,e.gopsToAlignWith=[],this.timeMapping_=0,this.transmuxer_.postMessage({action:"reset"}),this.transmuxer_.postMessage({action:"setTimestampOffset",timestampOffset:e.timestampOffset}));const t=this.createSimplifiedSegmentObj_(e),n=this.isEndOfStream_(e.mediaIndex,e.playlist,e.partIndex),r=this.mediaIndex!==null,s=e.timeline!==this.currentTimeline_&&e.timeline>0,a=n||r&&s;this.logger_(`Requesting
237
+ ${n_(e.uri)}
238
+ ${ro(e)}`),t.map&&!t.map.bytes&&(this.logger_("going to request init segment."),this.appendInitSegment_={video:!0,audio:!0}),e.abortRequests=bP({xhr:this.vhs_.xhr,xhrOptions:this.xhrOptions_,decryptionWorker:this.decrypter_,segment:t,abortFn:this.handleAbort_.bind(this,e),progressFn:this.handleProgress_.bind(this),trackInfoFn:this.handleTrackInfo_.bind(this),timingInfoFn:this.handleTimingInfo_.bind(this),videoSegmentTimingInfoFn:this.handleSegmentTimingInfo_.bind(this,"video",e.requestId),audioSegmentTimingInfoFn:this.handleSegmentTimingInfo_.bind(this,"audio",e.requestId),captionsFn:this.handleCaptions_.bind(this),isEndOfTimeline:a,endedTimelineFn:()=>{this.logger_("received endedtimeline callback")},id3Fn:this.handleId3_.bind(this),dataFn:this.handleData_.bind(this),doneFn:this.segmentRequestFinished_.bind(this),onTransmuxerLog:({message:o,level:c,stream:u})=>{this.logger_(`${ro(e)} logged from transmuxer stream ${u} as a ${c}: ${o}`)},triggerSegmentEventFn:({type:o,segment:c,keyInfo:u,trackInfo:d,timingInfo:h})=>{const v={segmentInfo:Gs({segment:c})};u&&(v.keyInfo=u),d&&(v.trackInfo=d),h&&(v.timingInfo=h),this.trigger({type:o,metadata:v})}})}trimBackBuffer_(e){const t=VP(this.seekable_(),this.currentTime_(),this.playlist_.targetDuration||10);t>0&&this.remove(0,t)}createSimplifiedSegmentObj_(e){const t=e.segment,n=e.part,r=e.segment.key||e.segment.map&&e.segment.map.key,s=e.segment.map&&!e.segment.map.bytes,a={resolvedUri:n?n.resolvedUri:t.resolvedUri,byterange:n?n.byterange:t.byterange,requestId:e.requestId,transmuxer:e.transmuxer,audioAppendStart:e.audioAppendStart,gopsToAlignWith:e.gopsToAlignWith,part:e.part,type:this.loaderType_,start:e.startOfSegment,duration:e.duration,isEncrypted:r,isMediaInitialization:s},o=e.playlist.segments[e.mediaIndex-1];if(o&&o.timeline===t.timeline&&(o.videoTimingInfo?a.baseStartTime=o.videoTimingInfo.transmuxedDecodeEnd:o.audioTimingInfo&&(a.baseStartTime=o.audioTimingInfo.transmuxedDecodeEnd)),t.key){const c=t.key.iv||new Uint32Array([0,0,0,e.mediaIndex+e.playlist.mediaSequence]);a.key=this.segmentKey(t.key),a.key.iv=c}return t.map&&(a.map=this.initSegmentForMap(t.map)),a}saveTransferStats_(e){this.mediaRequests+=1,e&&(this.mediaBytesTransferred+=e.bytesReceived,this.mediaTransferDuration+=e.roundTripTime)}saveBandwidthRelatedStats_(e,t){if(this.pendingSegment_.byteLength=t.bytesReceived,e<qu){this.logger_(`Ignoring segment's bandwidth because its duration of ${e} is less than the min to record ${qu}`);return}const n={bandwidthInfo:{from:this.bandwidth,to:t.bandwidth}};this.trigger({type:"bandwidthupdated",metadata:n}),this.bandwidth=t.bandwidth,this.roundTrip=t.roundTripTime}handleTimeout_(){this.mediaRequestsTimedout+=1,this.bandwidth=1,this.roundTrip=NaN,this.trigger("bandwidthupdate"),this.trigger("timeout")}segmentRequestFinished_(e,t,n){if(this.callQueue_.length){this.callQueue_.push(this.segmentRequestFinished_.bind(this,e,t,n));return}if(this.saveTransferStats_(t.stats),!this.pendingSegment_||t.requestId!==this.pendingSegment_.requestId)return;if(e){if(this.pendingSegment_=null,this.state="READY",e.code===hr.ABORTED)return;if(this.pause(),e.code===hr.TIMEOUT){this.handleTimeout_();return}this.mediaRequestsErrored+=1,this.error(e),this.trigger("error");return}const r=this.pendingSegment_;this.saveBandwidthRelatedStats_(r.duration,t.stats),r.endOfAllRequests=t.endOfAllRequests,n.gopInfo&&(this.gopBuffer_=MP(this.gopBuffer_,n.gopInfo,this.safeAppend_)),this.state="APPENDING",this.trigger("appending"),this.waitForAppendsToComplete_(r)}setTimeMapping_(e){const t=this.syncController_.mappingForTimeline(e);t!==null&&(this.timeMapping_=t)}updateMediaSecondsLoaded_(e){typeof e.start=="number"&&typeof e.end=="number"?this.mediaSecondsLoaded+=e.end-e.start:this.mediaSecondsLoaded+=e.duration}shouldUpdateTransmuxerTimestampOffset_(e){return e===null?!1:this.loaderType_==="main"&&e!==this.sourceUpdater_.videoTimestampOffset()||!this.audioDisabled_&&e!==this.sourceUpdater_.audioTimestampOffset()}trueSegmentStart_({currentStart:e,playlist:t,mediaIndex:n,firstVideoFrameTimeForData:r,currentVideoTimestampOffset:s,useVideoTimingInfo:a,videoTimingInfo:o,audioTimingInfo:c}){if(typeof e<"u")return e;if(!a)return c.start;const u=t.segments[n-1];return n===0||!u||typeof u.start>"u"||u.end!==r+s?r:o.start}waitForAppendsToComplete_(e){const t=this.getCurrentMediaInfo_(e);if(!t){this.error({message:"No starting media returned, likely due to an unsupported media format.",playlistExclusionDuration:1/0}),this.trigger("error");return}const{hasAudio:n,hasVideo:r,isMuxed:s}=t,a=this.loaderType_==="main"&&r,o=!this.audioDisabled_&&n&&!s;if(e.waitingOnAppends=0,!e.hasAppendedData_){!e.timingInfo&&typeof e.timestampOffset=="number"&&(this.isPendingTimestampOffset_=!0),e.timingInfo={start:0},e.waitingOnAppends++,this.isPendingTimestampOffset_||(this.updateSourceBufferTimestampOffset_(e),this.processMetadataQueue_()),this.checkAppendsDone_(e);return}a&&e.waitingOnAppends++,o&&e.waitingOnAppends++,a&&this.sourceUpdater_.videoQueueCallback(this.checkAppendsDone_.bind(this,e)),o&&this.sourceUpdater_.audioQueueCallback(this.checkAppendsDone_.bind(this,e))}checkAppendsDone_(e){this.checkForAbort_(e.requestId)||(e.waitingOnAppends--,e.waitingOnAppends===0&&this.handleAppendsDone_())}checkForIllegalMediaSwitch(e){const t=FP(this.loaderType_,this.getCurrentMediaInfo_(),e);return t?(this.error({message:t,playlistExclusionDuration:1/0}),this.trigger("error"),!0):!1}updateSourceBufferTimestampOffset_(e){if(e.timestampOffset===null||typeof e.timingInfo.start!="number"||e.changedTimestampOffset||this.loaderType_!=="main")return;let t=!1;e.timestampOffset-=this.getSegmentStartTimeForTimestampOffsetCalculation_({videoTimingInfo:e.segment.videoTimingInfo,audioTimingInfo:e.segment.audioTimingInfo,timingInfo:e.timingInfo}),e.changedTimestampOffset=!0,e.timestampOffset!==this.sourceUpdater_.videoTimestampOffset()&&(this.sourceUpdater_.videoTimestampOffset(e.timestampOffset),t=!0),e.timestampOffset!==this.sourceUpdater_.audioTimestampOffset()&&(this.sourceUpdater_.audioTimestampOffset(e.timestampOffset),t=!0),t&&this.trigger("timestampoffset")}getSegmentStartTimeForTimestampOffsetCalculation_({videoTimingInfo:e,audioTimingInfo:t,timingInfo:n}){return this.useDtsForTimestampOffset_?e&&typeof e.transmuxedDecodeStart=="number"?e.transmuxedDecodeStart:t&&typeof t.transmuxedDecodeStart=="number"?t.transmuxedDecodeStart:n.start:n.start}updateTimingInfoEnd_(e){e.timingInfo=e.timingInfo||{};const t=this.getMediaInfo_(),r=this.loaderType_==="main"&&t&&t.hasVideo&&e.videoTimingInfo?e.videoTimingInfo:e.audioTimingInfo;r&&(e.timingInfo.end=typeof r.end=="number"?r.end:r.start+e.duration)}handleAppendsDone_(){if(this.pendingSegment_){const c={segmentInfo:Gs({type:this.loaderType_,segment:this.pendingSegment_})};this.trigger({type:"appendsdone",metadata:c})}if(!this.pendingSegment_){this.state="READY",this.paused()||this.monitorBuffer_();return}const e=this.pendingSegment_;e.part&&e.part.syncInfo?e.part.syncInfo.markAppended():e.segment.syncInfo&&e.segment.syncInfo.markAppended(),this.updateTimingInfoEnd_(e),this.shouldSaveSegmentTimingInfo_&&this.syncController_.saveSegmentTimingInfo({segmentInfo:e,shouldSaveTimelineMapping:this.loaderType_==="main"});const t=zP(e,this.sourceType_);if(t&&(t.severity==="warn"?pe.log.warn(t.message):this.logger_(t.message)),this.recordThroughput_(e),this.pendingSegment_=null,this.state="READY",e.isSyncRequest&&(this.trigger("syncinfoupdate"),!e.hasAppendedData_)){this.logger_(`Throwing away un-appended sync request ${ro(e)}`);return}this.logger_(`Appended ${ro(e)}`),this.addSegmentMetadataCue_(e),this.fetchAtBuffer_=!0,this.currentTimeline_!==e.timeline&&(this.timelineChangeController_.lastTimelineChange({type:this.loaderType_,from:this.currentTimeline_,to:e.timeline}),this.loaderType_==="main"&&!this.audioDisabled_&&this.timelineChangeController_.lastTimelineChange({type:"audio",from:this.currentTimeline_,to:e.timeline})),this.currentTimeline_=e.timeline,this.trigger("syncinfoupdate");const n=e.segment,r=e.part,s=n.end&&this.currentTime_()-n.end>e.playlist.targetDuration*3,a=r&&r.end&&this.currentTime_()-r.end>e.playlist.partTargetDuration*3;if(s||a){this.logger_(`bad ${s?"segment":"part"} ${ro(e)}`),this.resetEverything();return}this.mediaIndex!==null&&this.trigger("bandwidthupdate"),this.trigger("progress"),this.mediaIndex=e.mediaIndex,this.partIndex=e.partIndex,this.isEndOfStream_(e.mediaIndex,e.playlist,e.partIndex)&&this.endOfStream(),this.trigger("appended"),e.hasAppendedData_&&this.mediaAppends++,this.paused()||this.monitorBuffer_()}recordThroughput_(e){if(e.duration<qu){this.logger_(`Ignoring segment's throughput because its duration of ${e.duration} is less than the min to record ${qu}`);return}const t=this.throughput.rate,n=Date.now()-e.endOfAllRequests+1,r=Math.floor(e.byteLength/n*8*1e3);this.throughput.rate+=(r-t)/++this.throughput.count}addSegmentMetadataCue_(e){if(!this.segmentMetadataTrack_)return;const t=e.segment,n=t.start,r=t.end;if(!r_(n)||!r_(r))return;Tl(n,r,this.segmentMetadataTrack_);const s=te.WebKitDataCue||te.VTTCue,a={custom:t.custom,dateTimeObject:t.dateTimeObject,dateTimeString:t.dateTimeString,programDateTime:t.programDateTime,bandwidth:e.playlist.attributes.BANDWIDTH,resolution:e.playlist.attributes.RESOLUTION,codecs:e.playlist.attributes.CODECS,byteLength:e.byteLength,uri:e.uri,timeline:e.timeline,playlist:e.playlist.id,start:n,end:r},o=JSON.stringify(a),c=new s(n,r,o);c.value=a,this.segmentMetadataTrack_.addCue(c)}}function Nr(){}const o_=function(i){return typeof i!="string"?i:i.replace(/./,e=>e.toUpperCase())},GP=["video","audio"],Yp=(i,e)=>{const t=e[`${i}Buffer`];return t&&t.updating||e.queuePending[i]},WP=(i,e)=>{for(let t=0;t<e.length;t++){const n=e[t];if(n.type==="mediaSource")return null;if(n.type===i)return t}return null},so=(i,e)=>{if(e.queue.length===0)return;let t=0,n=e.queue[t];if(n.type==="mediaSource"){!e.updating()&&e.mediaSource.readyState!=="closed"&&(e.queue.shift(),n.action(e),n.doneFn&&n.doneFn(),so("audio",e),so("video",e));return}if(i!=="mediaSource"&&!(!e.ready()||e.mediaSource.readyState==="closed"||Yp(i,e))){if(n.type!==i){if(t=WP(i,e.queue),t===null)return;n=e.queue[t]}if(e.queue.splice(t,1),e.queuePending[i]=n,n.action(i,e),!n.doneFn){e.queuePending[i]=null,so(i,e);return}}},l_=(i,e)=>{const t=e[`${i}Buffer`],n=o_(i);t&&(t.removeEventListener("updateend",e[`on${n}UpdateEnd_`]),t.removeEventListener("error",e[`on${n}Error_`]),e.codecs[i]=null,e[`${i}Buffer`]=null)},fr=(i,e)=>i&&e&&Array.prototype.indexOf.call(i.sourceBuffers,e)!==-1,mi={appendBuffer:(i,e,t)=>(n,r)=>{const s=r[`${n}Buffer`];if(fr(r.mediaSource,s)){r.logger_(`Appending segment ${e.mediaIndex}'s ${i.length} bytes to ${n}Buffer`);try{s.appendBuffer(i)}catch(a){r.logger_(`Error with code ${a.code} `+(a.code===S2?"(QUOTA_EXCEEDED_ERR) ":"")+`when appending segment ${e.mediaIndex} to ${n}Buffer`),r.queuePending[n]=null,t(a)}}},remove:(i,e)=>(t,n)=>{const r=n[`${t}Buffer`];if(fr(n.mediaSource,r)){n.logger_(`Removing ${i} to ${e} from ${t}Buffer`);try{r.remove(i,e)}catch{n.logger_(`Remove ${i} to ${e} from ${t}Buffer failed`)}}},timestampOffset:i=>(e,t)=>{const n=t[`${e}Buffer`];fr(t.mediaSource,n)&&(t.logger_(`Setting ${e}timestampOffset to ${i}`),n.timestampOffset=i)},callback:i=>(e,t)=>{i()},endOfStream:i=>e=>{if(e.mediaSource.readyState==="open"){e.logger_(`Calling mediaSource endOfStream(${i||""})`);try{e.mediaSource.endOfStream(i)}catch(t){pe.log.warn("Failed to call media source endOfStream",t)}}},duration:i=>e=>{e.logger_(`Setting mediaSource duration to ${i}`);try{e.mediaSource.duration=i}catch(t){pe.log.warn("Failed to set media source duration",t)}},abort:()=>(i,e)=>{if(e.mediaSource.readyState!=="open")return;const t=e[`${i}Buffer`];if(fr(e.mediaSource,t)){e.logger_(`calling abort on ${i}Buffer`);try{t.abort()}catch(n){pe.log.warn(`Failed to abort on ${i}Buffer`,n)}}},addSourceBuffer:(i,e)=>t=>{const n=o_(i),r=Aa(e);t.logger_(`Adding ${i}Buffer with codec ${e} to mediaSource`);const s=t.mediaSource.addSourceBuffer(r);s.addEventListener("updateend",t[`on${n}UpdateEnd_`]),s.addEventListener("error",t[`on${n}Error_`]),t.codecs[i]=e,t[`${i}Buffer`]=s},removeSourceBuffer:i=>e=>{const t=e[`${i}Buffer`];if(l_(i,e),!!fr(e.mediaSource,t)){e.logger_(`Removing ${i}Buffer with codec ${e.codecs[i]} from mediaSource`);try{e.mediaSource.removeSourceBuffer(t)}catch(n){pe.log.warn(`Failed to removeSourceBuffer ${i}Buffer`,n)}}},changeType:i=>(e,t)=>{const n=t[`${e}Buffer`],r=Aa(i);if(!fr(t.mediaSource,n))return;const s=i.substring(0,i.indexOf(".")),a=t.codecs[e];if(a.substring(0,a.indexOf("."))===s)return;const c={codecsChangeInfo:{from:a,to:i}};t.trigger({type:"codecschange",metadata:c}),t.logger_(`changing ${e}Buffer codec from ${a} to ${i}`);try{n.changeType(r),t.codecs[e]=i}catch(u){c.errorType=pe.Error.StreamingCodecsChangeError,c.error=u,u.metadata=c,t.error_=u,t.trigger("error"),pe.log.warn(`Failed to changeType on ${e}Buffer`,u)}}},gi=({type:i,sourceUpdater:e,action:t,doneFn:n,name:r})=>{e.queue.push({type:i,action:t,doneFn:n,name:r}),so(i,e)},c_=(i,e)=>t=>{const n=e[`${i}Buffered`](),r=cI(n);if(e.logger_(`received "updateend" event for ${i} Source Buffer: `,r),e.queuePending[i]){const s=e.queuePending[i].doneFn;e.queuePending[i]=null,s&&s(e[`${i}Error_`])}so(i,e)};class u_ extends pe.EventTarget{constructor(e){super(),this.mediaSource=e,this.sourceopenListener_=()=>so("mediaSource",this),this.mediaSource.addEventListener("sourceopen",this.sourceopenListener_),this.logger_=Ii("SourceUpdater"),this.audioTimestampOffset_=0,this.videoTimestampOffset_=0,this.queue=[],this.queuePending={audio:null,video:null},this.delayedAudioAppendQueue_=[],this.videoAppendQueued_=!1,this.codecs={},this.onVideoUpdateEnd_=c_("video",this),this.onAudioUpdateEnd_=c_("audio",this),this.onVideoError_=t=>{this.videoError_=t},this.onAudioError_=t=>{this.audioError_=t},this.createdSourceBuffers_=!1,this.initializedEme_=!1,this.triggeredReady_=!1}initializedEme(){this.initializedEme_=!0,this.triggerReady()}hasCreatedSourceBuffers(){return this.createdSourceBuffers_}hasInitializedAnyEme(){return this.initializedEme_}ready(){return this.hasCreatedSourceBuffers()&&this.hasInitializedAnyEme()}createSourceBuffers(e){this.hasCreatedSourceBuffers()||(this.addOrChangeSourceBuffers(e),this.createdSourceBuffers_=!0,this.trigger("createdsourcebuffers"),this.triggerReady())}triggerReady(){this.ready()&&!this.triggeredReady_&&(this.triggeredReady_=!0,this.trigger("ready"))}addSourceBuffer(e,t){gi({type:"mediaSource",sourceUpdater:this,action:mi.addSourceBuffer(e,t),name:"addSourceBuffer"})}abort(e){gi({type:e,sourceUpdater:this,action:mi.abort(e),name:"abort"})}removeSourceBuffer(e){if(!this.canRemoveSourceBuffer()){pe.log.error("removeSourceBuffer is not supported!");return}gi({type:"mediaSource",sourceUpdater:this,action:mi.removeSourceBuffer(e),name:"removeSourceBuffer"})}canRemoveSourceBuffer(){return!pe.browser.IS_FIREFOX&&te.MediaSource&&te.MediaSource.prototype&&typeof te.MediaSource.prototype.removeSourceBuffer=="function"}static canChangeType(){return te.SourceBuffer&&te.SourceBuffer.prototype&&typeof te.SourceBuffer.prototype.changeType=="function"}canChangeType(){return this.constructor.canChangeType()}changeType(e,t){if(!this.canChangeType()){pe.log.error("changeType is not supported!");return}gi({type:e,sourceUpdater:this,action:mi.changeType(t),name:"changeType"})}addOrChangeSourceBuffers(e){if(!e||typeof e!="object"||Object.keys(e).length===0)throw new Error("Cannot addOrChangeSourceBuffers to undefined codecs");Object.keys(e).forEach(t=>{const n=e[t];if(!this.hasCreatedSourceBuffers())return this.addSourceBuffer(t,n);this.canChangeType()&&this.changeType(t,n)})}appendBuffer(e,t){const{segmentInfo:n,type:r,bytes:s}=e;if(this.processedAppend_=!0,r==="audio"&&this.videoBuffer&&!this.videoAppendQueued_){this.delayedAudioAppendQueue_.push([e,t]),this.logger_(`delayed audio append of ${s.length} until video append`);return}const a=t;if(gi({type:r,sourceUpdater:this,action:mi.appendBuffer(s,n||{mediaIndex:-1},a),doneFn:t,name:"appendBuffer"}),r==="video"){if(this.videoAppendQueued_=!0,!this.delayedAudioAppendQueue_.length)return;const o=this.delayedAudioAppendQueue_.slice();this.logger_(`queuing delayed audio ${o.length} appendBuffers`),this.delayedAudioAppendQueue_.length=0,o.forEach(c=>{this.appendBuffer.apply(this,c)})}}audioBuffered(){return fr(this.mediaSource,this.audioBuffer)&&this.audioBuffer.buffered?this.audioBuffer.buffered:Tn()}videoBuffered(){return fr(this.mediaSource,this.videoBuffer)&&this.videoBuffer.buffered?this.videoBuffer.buffered:Tn()}buffered(){const e=fr(this.mediaSource,this.videoBuffer)?this.videoBuffer:null,t=fr(this.mediaSource,this.audioBuffer)?this.audioBuffer:null;return t&&!e?this.audioBuffered():e&&!t?this.videoBuffered():dI(this.audioBuffered(),this.videoBuffered())}setDuration(e,t=Nr){gi({type:"mediaSource",sourceUpdater:this,action:mi.duration(e),name:"duration",doneFn:t})}endOfStream(e=null,t=Nr){typeof e!="string"&&(e=void 0),gi({type:"mediaSource",sourceUpdater:this,action:mi.endOfStream(e),name:"endOfStream",doneFn:t})}removeAudio(e,t,n=Nr){if(!this.audioBuffered().length||this.audioBuffered().end(0)===0){n();return}gi({type:"audio",sourceUpdater:this,action:mi.remove(e,t),doneFn:n,name:"remove"})}removeVideo(e,t,n=Nr){if(!this.videoBuffered().length||this.videoBuffered().end(0)===0){n();return}gi({type:"video",sourceUpdater:this,action:mi.remove(e,t),doneFn:n,name:"remove"})}updating(){return!!(Yp("audio",this)||Yp("video",this))}audioTimestampOffset(e){return typeof e<"u"&&this.audioBuffer&&this.audioTimestampOffset_!==e&&(gi({type:"audio",sourceUpdater:this,action:mi.timestampOffset(e),name:"timestampOffset"}),this.audioTimestampOffset_=e),this.audioTimestampOffset_}videoTimestampOffset(e){return typeof e<"u"&&this.videoBuffer&&this.videoTimestampOffset_!==e&&(gi({type:"video",sourceUpdater:this,action:mi.timestampOffset(e),name:"timestampOffset"}),this.videoTimestampOffset_=e),this.videoTimestampOffset_}audioQueueCallback(e){this.audioBuffer&&gi({type:"audio",sourceUpdater:this,action:mi.callback(e),name:"callback"})}videoQueueCallback(e){this.videoBuffer&&gi({type:"video",sourceUpdater:this,action:mi.callback(e),name:"callback"})}dispose(){this.trigger("dispose"),GP.forEach(e=>{this.abort(e),this.canRemoveSourceBuffer()?this.removeSourceBuffer(e):this[`${e}QueueCallback`](()=>l_(e,this))}),this.videoAppendQueued_=!1,this.delayedAudioAppendQueue_.length=0,this.sourceopenListener_&&this.mediaSource.removeEventListener("sourceopen",this.sourceopenListener_),this.off()}}const d_=i=>decodeURIComponent(escape(String.fromCharCode.apply(null,i))),KP=i=>{const e=new Uint8Array(i);return Array.from(e).map(t=>t.toString(16).padStart(2,"0")).join("")},h_=new Uint8Array(`
239
+
240
+ `.split("").map(i=>i.charCodeAt(0)));class XP extends Error{constructor(){super("Trying to parse received VTT cues, but there is no WebVTT. Make sure vtt.js is loaded.")}}class YP extends Xp{constructor(e,t={}){super(e,t),this.mediaSource_=null,this.subtitlesTrack_=null,this.featuresNativeTextTracks_=e.featuresNativeTextTracks,this.loadVttJs=e.loadVttJs,this.shouldSaveSegmentTimingInfo_=!1}buffered_(){if(!this.subtitlesTrack_||!this.subtitlesTrack_.cues||!this.subtitlesTrack_.cues.length)return Tn();const e=this.subtitlesTrack_.cues,t=e[0].startTime,n=e[e.length-1].startTime;return Tn([[t,n]])}initSegmentForMap(e,t=!1){if(!e)return null;const n=$u(e);let r=this.initSegments_[n];if(t&&!r&&e.bytes){const s=h_.byteLength+e.bytes.byteLength,a=new Uint8Array(s);a.set(e.bytes),a.set(h_,e.bytes.byteLength),this.initSegments_[n]=r={resolvedUri:e.resolvedUri,byterange:e.byterange,bytes:a}}return r||e}couldBeginLoading_(){return this.playlist_&&this.subtitlesTrack_&&!this.paused()}init_(){return this.state="READY",this.resetEverything(),this.monitorBuffer_()}track(e){return typeof e>"u"?this.subtitlesTrack_:(this.subtitlesTrack_=e,this.state==="INIT"&&this.couldBeginLoading_()&&this.init_(),this.subtitlesTrack_)}remove(e,t){Tl(e,t,this.subtitlesTrack_)}fillBuffer_(){const e=this.chooseNextRequest_();if(e){if(this.syncController_.timestampOffsetForTimeline(e.timeline)===null){const t=()=>{this.state="READY",this.paused()||this.monitorBuffer_()};this.syncController_.one("timestampoffset",t),this.state="WAITING_ON_TIMELINE";return}this.loadSegment_(e)}}timestampOffsetForSegment_(){return null}chooseNextRequest_(){return this.skipEmptySegments_(super.chooseNextRequest_())}skipEmptySegments_(e){for(;e&&e.segment.empty;){if(e.mediaIndex+1>=e.playlist.segments.length){e=null;break}e=this.generateSegmentInfo_({playlist:e.playlist,mediaIndex:e.mediaIndex+1,startOfSegment:e.startOfSegment+e.duration,isSyncRequest:e.isSyncRequest})}return e}stopForError(e){this.error(e),this.state="READY",this.pause(),this.trigger("error")}segmentRequestFinished_(e,t,n){if(!this.subtitlesTrack_){this.state="READY";return}if(this.saveTransferStats_(t.stats),!this.pendingSegment_){this.state="READY",this.mediaRequestsAborted+=1;return}if(e){e.code===hr.TIMEOUT&&this.handleTimeout_(),e.code===hr.ABORTED?this.mediaRequestsAborted+=1:this.mediaRequestsErrored+=1,this.stopForError(e);return}const r=this.pendingSegment_,s=n.mp4VttCues&&n.mp4VttCues.length;s&&(r.mp4VttCues=n.mp4VttCues),this.saveBandwidthRelatedStats_(r.duration,t.stats),t.key&&this.segmentKey(t.key,!0),this.state="APPENDING",this.trigger("appending");const a=r.segment;if(a.map&&(a.map.bytes=t.map.bytes),r.bytes=t.bytes,typeof te.WebVTT!="function"&&typeof this.loadVttJs=="function"){this.state="WAITING_ON_VTTJS",this.loadVttJs().then(()=>this.segmentRequestFinished_(e,t,n),()=>this.stopForError({message:"Error loading vtt.js"}));return}a.requested=!0;try{this.parseVTTCues_(r)}catch(o){this.stopForError({message:o.message,metadata:{errorType:pe.Error.StreamingVttParserError,error:o}});return}if(s||this.updateTimeMapping_(r,this.syncController_.timelines[r.timeline],this.playlist_),r.cues.length?r.timingInfo={start:r.cues[0].startTime,end:r.cues[r.cues.length-1].endTime}:r.timingInfo={start:r.startOfSegment,end:r.startOfSegment+r.duration},r.isSyncRequest){this.trigger("syncinfoupdate"),this.pendingSegment_=null,this.state="READY";return}r.byteLength=r.bytes.byteLength,this.mediaSecondsLoaded+=a.duration,r.cues.forEach(o=>{this.subtitlesTrack_.addCue(this.featuresNativeTextTracks_?new te.VTTCue(o.startTime,o.endTime,o.text):o)}),NP(this.subtitlesTrack_),this.handleAppendsDone_()}handleData_(e,t){const n=e&&e.type==="vtt",r=t&&t.type==="text";n&&r&&super.handleData_(e,t)}updateTimingInfoEnd_(){}parseMp4VttCues_(e){const t=this.sourceUpdater_.videoTimestampOffset()===null?this.sourceUpdater_.audioTimestampOffset():this.sourceUpdater_.videoTimestampOffset();e.mp4VttCues.forEach(n=>{const r=n.start+t,s=n.end+t,a=new te.VTTCue(r,s,n.cueText);n.settings&&n.settings.split(" ").forEach(o=>{const c=o.split(":"),u=c[0],d=c[1];a[u]=isNaN(d)?d:Number(d)}),e.cues.push(a)})}parseVTTCues_(e){let t,n=!1;if(typeof te.WebVTT!="function")throw new XP;if(e.cues=[],e.timestampmap={MPEGTS:0,LOCAL:0},e.mp4VttCues){this.parseMp4VttCues_(e);return}typeof te.TextDecoder=="function"?t=new te.TextDecoder("utf8"):(t=te.WebVTT.StringDecoder(),n=!0);const r=new te.WebVTT.Parser(te,te.vttjs,t);if(r.oncue=e.cues.push.bind(e.cues),r.ontimestampmap=a=>{e.timestampmap=a},r.onparsingerror=a=>{pe.log.warn("Error encountered when parsing cues: "+a.message)},e.segment.map){let a=e.segment.map.bytes;n&&(a=d_(a)),r.parse(a)}let s=e.bytes;n&&(s=d_(s)),r.parse(s),r.flush()}updateTimeMapping_(e,t,n){const r=e.segment;if(!t)return;if(!e.cues.length){r.empty=!0;return}const{MPEGTS:s,LOCAL:a}=e.timestampmap,c=s/Ls.ONE_SECOND_IN_TS-a+t.mapping;if(e.cues.forEach(u=>{const d=u.endTime-u.startTime,h=this.handleRollover_(u.startTime+c,t.time);u.startTime=Math.max(h,0),u.endTime=Math.max(h+d,0)}),!n.syncInfo){const u=e.cues[0].startTime,d=e.cues[e.cues.length-1].startTime;n.syncInfo={mediaSequence:n.mediaSequence+e.mediaIndex,time:Math.min(u,d-r.duration)}}}handleRollover_(e,t){if(t===null)return e;let n=e*Ls.ONE_SECOND_IN_TS;const r=t*Ls.ONE_SECOND_IN_TS;let s;for(r<n?s=-8589934592:s=8589934592;Math.abs(n-r)>4294967296;)n+=s;return n/Ls.ONE_SECOND_IN_TS}}const JP=function(i,e){const t=i.cues;for(let n=0;n<t.length;n++){const r=t[n];if(e>=r.adStartTime&&e<=r.adEndTime)return r}return null},QP=function(i,e,t=0){if(!i.segments)return;let n=t,r;for(let s=0;s<i.segments.length;s++){const a=i.segments[s];if(r||(r=JP(e,n+a.duration/2)),r){if("cueIn"in a){r.endTime=n,r.adEndTime=n,n+=a.duration,r=null;continue}if(n<r.endTime){n+=a.duration;continue}r.endTime+=a.duration}else if("cueOut"in a&&(r=new te.VTTCue(n,n+a.duration,a.cueOut),r.adStartTime=n,r.adEndTime=n+parseFloat(a.cueOut),e.addCue(r)),"cueOutCont"in a){const[o,c]=a.cueOutCont.split("/").map(parseFloat);r=new te.VTTCue(n,n+a.duration,""),r.adStartTime=n-o,r.adEndTime=r.adStartTime+c,e.addCue(r)}n+=a.duration}};class f_{constructor({start:e,end:t,segmentIndex:n,partIndex:r=null,appended:s=!1}){this.start_=e,this.end_=t,this.segmentIndex_=n,this.partIndex_=r,this.appended_=s}isInRange(e){return e>=this.start&&e<this.end}markAppended(){this.appended_=!0}resetAppendedStatus(){this.appended_=!1}get isAppended(){return this.appended_}get start(){return this.start_}get end(){return this.end_}get segmentIndex(){return this.segmentIndex_}get partIndex(){return this.partIndex_}}class ZP{constructor(e,t=[]){this.segmentSyncInfo_=e,this.partsSyncInfo_=t}get segmentSyncInfo(){return this.segmentSyncInfo_}get partsSyncInfo(){return this.partsSyncInfo_}get hasPartsSyncInfo(){return this.partsSyncInfo_.length>0}resetAppendStatus(){this.segmentSyncInfo_.resetAppendedStatus(),this.partsSyncInfo_.forEach(e=>e.resetAppendedStatus())}}class p_{constructor(){this.storage_=new Map,this.diagnostics_="",this.isReliable_=!1,this.start_=-1/0,this.end_=1/0}get start(){return this.start_}get end(){return this.end_}get diagnostics(){return this.diagnostics_}get isReliable(){return this.isReliable_}resetAppendedStatus(){this.storage_.forEach(e=>e.resetAppendStatus())}update(e,t){const{mediaSequence:n,segments:r}=e;if(this.isReliable_=this.isReliablePlaylist_(n,r),!!this.isReliable_)return this.updateStorage_(r,n,this.calculateBaseTime_(n,r,t))}getSyncInfoForTime(e){for(const{segmentSyncInfo:t,partsSyncInfo:n}of this.storage_.values())if(n.length){for(const r of n)if(r.isInRange(e))return r}else if(t.isInRange(e))return t;return null}getSyncInfoForMediaSequence(e){return this.storage_.get(e)}updateStorage_(e,t,n){const r=new Map;let s=`
241
+ `,a=n,o=t;this.start_=a,e.forEach((c,u)=>{const d=this.storage_.get(o),h=a,b=h+c.duration,v=!!(d&&d.segmentSyncInfo&&d.segmentSyncInfo.isAppended),y=new f_({start:h,end:b,appended:v,segmentIndex:u});c.syncInfo=y;let p=a;const f=(c.parts||[]).map((m,_)=>{const k=p,D=p+m.duration,w=!!(d&&d.partsSyncInfo&&d.partsSyncInfo[_]&&d.partsSyncInfo[_].isAppended),A=new f_({start:k,end:D,appended:w,segmentIndex:u,partIndex:_});return p=D,s+=`Media Sequence: ${o}.${_} | Range: ${k} --> ${D} | Appended: ${w}
242
+ `,m.syncInfo=A,A});r.set(o,new ZP(y,f)),s+=`${n_(c.resolvedUri)} | Media Sequence: ${o} | Range: ${h} --> ${b} | Appended: ${v}
243
+ `,o++,a=b}),this.end_=a,this.storage_=r,this.diagnostics_=s}calculateBaseTime_(e,t,n){if(!this.storage_.size)return 0;if(this.storage_.has(e))return this.storage_.get(e).segmentSyncInfo.start;const r=Math.min(...this.storage_.keys());if(e<r){const s=r-e;let a=this.storage_.get(r).segmentSyncInfo.start;for(let o=0;o<s;o++){const c=t[o];a-=c.duration}return a}return n}isReliablePlaylist_(e,t){return e!=null&&Array.isArray(t)&&t.length}}class m_ extends p_{constructor(e){super(),this.parent_=e}calculateBaseTime_(e,t,n){if(!this.storage_.size){const r=this.parent_.getSyncInfoForMediaSequence(e);return r?r.segmentSyncInfo.start:0}return super.calculateBaseTime_(e,t,n)}}const eN=86400,Jp=[{name:"VOD",run:(i,e,t,n,r)=>t!==1/0?{time:0,segmentIndex:0,partIndex:null}:null},{name:"MediaSequence",run:(i,e,t,n,r,s)=>{const a=i.getMediaSequenceSync(s);if(!a||!a.isReliable)return null;const o=a.getSyncInfoForTime(r);return o?{time:o.start,partIndex:o.partIndex,segmentIndex:o.segmentIndex}:null}},{name:"ProgramDateTime",run:(i,e,t,n,r)=>{if(!Object.keys(i.timelineToDatetimeMappings).length)return null;let s=null,a=null;const o=Mp(e);r=r||0;for(let c=0;c<o.length;c++){const u=e.endList||r===0?c:o.length-(c+1),d=o[u],h=d.segment,b=i.timelineToDatetimeMappings[h.timeline];if(!b||!h.dateTimeObject)continue;let y=h.dateTimeObject.getTime()/1e3+b;if(h.parts&&typeof d.partIndex=="number")for(let f=0;f<d.partIndex;f++)y+=h.parts[f].duration;const p=Math.abs(r-y);if(a!==null&&(p===0||a<p))break;a=p,s={time:y,segmentIndex:d.segmentIndex,partIndex:d.partIndex}}return s}},{name:"Segment",run:(i,e,t,n,r)=>{let s=null,a=null;r=r||0;const o=Mp(e);for(let c=0;c<o.length;c++){const u=e.endList||r===0?c:o.length-(c+1),d=o[u],h=d.segment,b=d.part&&d.part.start||h&&h.start;if(h.timeline===n&&typeof b<"u"){const v=Math.abs(r-b);if(a!==null&&a<v)break;(!s||a===null||a>=v)&&(a=v,s={time:b,segmentIndex:d.segmentIndex,partIndex:d.partIndex})}}return s}},{name:"Discontinuity",run:(i,e,t,n,r)=>{let s=null;if(r=r||0,e.discontinuityStarts&&e.discontinuityStarts.length){let a=null;for(let o=0;o<e.discontinuityStarts.length;o++){const c=e.discontinuityStarts[o],u=e.discontinuitySequence+o+1,d=i.discontinuities[u];if(d){const h=Math.abs(r-d.time);if(a!==null&&a<h)break;(!s||a===null||a>=h)&&(a=h,s={time:d.time,segmentIndex:c,partIndex:null})}}}return s}},{name:"Playlist",run:(i,e,t,n,r)=>e.syncInfo?{time:e.syncInfo.time,segmentIndex:e.syncInfo.mediaSequence-e.mediaSequence,partIndex:null}:null}];class tN extends pe.EventTarget{constructor(e={}){super(),this.timelines=[],this.discontinuities=[],this.timelineToDatetimeMappings={};const t=new p_,n=new m_(t),r=new m_(t);this.mediaSequenceStorage_={main:t,audio:n,vtt:r},this.logger_=Ii("SyncController")}getMediaSequenceSync(e){return this.mediaSequenceStorage_[e]||null}getSyncPoint(e,t,n,r,s){if(t!==1/0)return Jp.find(({name:c})=>c==="VOD").run(this,e,t);const a=this.runStrategies_(e,t,n,r,s);if(!a.length)return null;for(const o of a){const{syncPoint:c,strategy:u}=o,{segmentIndex:d,time:h}=c;if(d<0)continue;const b=e.segments[d],v=h,y=v+b.duration;if(this.logger_(`Strategy: ${u}. Current time: ${r}. selected segment: ${d}. Time: [${v} -> ${y}]}`),r>=v&&r<y)return this.logger_("Found sync point with exact match: ",c),c}return this.selectSyncPoint_(a,{key:"time",value:r})}getExpiredTime(e,t){if(!e||!e.segments)return null;const n=this.runStrategies_(e,t,e.discontinuitySequence,0);if(!n.length)return null;const r=this.selectSyncPoint_(n,{key:"segmentIndex",value:0});return r.segmentIndex>0&&(r.time*=-1),Math.abs(r.time+yl({defaultDuration:e.targetDuration,durationList:e.segments,startIndex:r.segmentIndex,endIndex:0}))}runStrategies_(e,t,n,r,s){const a=[];for(let o=0;o<Jp.length;o++){const c=Jp[o],u=c.run(this,e,t,n,r,s);u&&(u.strategy=c.name,a.push({strategy:c.name,syncPoint:u}))}return a}selectSyncPoint_(e,t){let n=e[0].syncPoint,r=Math.abs(e[0].syncPoint[t.key]-t.value),s=e[0].strategy;for(let a=1;a<e.length;a++){const o=Math.abs(e[a].syncPoint[t.key]-t.value);o<r&&(r=o,n=e[a].syncPoint,s=e[a].strategy)}return this.logger_(`syncPoint for [${t.key}: ${t.value}] chosen with strategy [${s}]: [time:${n.time}, segmentIndex:${n.segmentIndex}`+(typeof n.partIndex=="number"?`,partIndex:${n.partIndex}`:"")+"]"),n}saveExpiredSegmentInfo(e,t){const n=t.mediaSequence-e.mediaSequence;if(n>eN){pe.log.warn(`Not saving expired segment info. Media sequence gap ${n} is too large.`);return}for(let r=n-1;r>=0;r--){const s=e.segments[r];if(s&&typeof s.start<"u"){t.syncInfo={mediaSequence:e.mediaSequence+r,time:s.start},this.logger_(`playlist refresh sync: [time:${t.syncInfo.time}, mediaSequence: ${t.syncInfo.mediaSequence}]`),this.trigger("syncinfoupdate");break}}}setDateTimeMappingForStart(e){if(this.timelineToDatetimeMappings={},e.segments&&e.segments.length&&e.segments[0].dateTimeObject){const t=e.segments[0],n=t.dateTimeObject.getTime()/1e3;this.timelineToDatetimeMappings[t.timeline]=-n}}saveSegmentTimingInfo({segmentInfo:e,shouldSaveTimelineMapping:t}){const n=this.calculateSegmentTimeMapping_(e,e.timingInfo,t),r=e.segment;n&&(this.saveDiscontinuitySyncInfo_(e),e.playlist.syncInfo||(e.playlist.syncInfo={mediaSequence:e.playlist.mediaSequence+e.mediaIndex,time:r.start}));const s=r.dateTimeObject;r.discontinuity&&t&&s&&(this.timelineToDatetimeMappings[r.timeline]=-(s.getTime()/1e3))}timestampOffsetForTimeline(e){return typeof this.timelines[e]>"u"?null:this.timelines[e].time}mappingForTimeline(e){return typeof this.timelines[e]>"u"?null:this.timelines[e].mapping}calculateSegmentTimeMapping_(e,t,n){const r=e.segment,s=e.part;let a=this.timelines[e.timeline],o,c;if(typeof e.timestampOffset=="number")a={time:e.startOfSegment,mapping:e.startOfSegment-t.start},n&&(this.timelines[e.timeline]=a,this.trigger("timestampoffset"),this.logger_(`time mapping for timeline ${e.timeline}: [time: ${a.time}] [mapping: ${a.mapping}]`)),o=e.startOfSegment,c=t.end+a.mapping;else if(a)o=t.start+a.mapping,c=t.end+a.mapping;else return!1;return s&&(s.start=o,s.end=c),(!r.start||o<r.start)&&(r.start=o),r.end=c,!0}saveDiscontinuitySyncInfo_(e){const t=e.playlist,n=e.segment;if(n.discontinuity)this.discontinuities[n.timeline]={time:n.start,accuracy:0};else if(t.discontinuityStarts&&t.discontinuityStarts.length)for(let r=0;r<t.discontinuityStarts.length;r++){const s=t.discontinuityStarts[r],a=t.discontinuitySequence+r+1,o=s-e.mediaIndex,c=Math.abs(o);if(!this.discontinuities[a]||this.discontinuities[a].accuracy>c){let u;o<0?u=n.start-yl({defaultDuration:t.targetDuration,durationList:t.segments,startIndex:e.mediaIndex,endIndex:s}):u=n.end+yl({defaultDuration:t.targetDuration,durationList:t.segments,startIndex:e.mediaIndex+1,endIndex:s}),this.discontinuities[a]={time:u,accuracy:c}}}}dispose(){this.trigger("dispose"),this.off()}}class nN extends pe.EventTarget{constructor(){super(),this.pendingTimelineChanges_={},this.lastTimelineChanges_={}}clearPendingTimelineChange(e){this.pendingTimelineChanges_[e]=null,this.trigger("pendingtimelinechange")}pendingTimelineChange({type:e,from:t,to:n}){return typeof t=="number"&&typeof n=="number"&&(this.pendingTimelineChanges_[e]={type:e,from:t,to:n},this.trigger("pendingtimelinechange")),this.pendingTimelineChanges_[e]}lastTimelineChange({type:e,from:t,to:n}){if(typeof t=="number"&&typeof n=="number"){this.lastTimelineChanges_[e]={type:e,from:t,to:n},delete this.pendingTimelineChanges_[e];const r={timelineChangeInfo:{from:t,to:n}};this.trigger({type:"timelinechange",metadata:r})}return this.lastTimelineChanges_[e]}dispose(){this.trigger("dispose"),this.pendingTimelineChanges_={},this.lastTimelineChanges_={},this.off()}}const iN=j2($2(function(){var i=function(){function p(){this.listeners={}}var f=p.prototype;return f.on=function(_,k){this.listeners[_]||(this.listeners[_]=[]),this.listeners[_].push(k)},f.off=function(_,k){if(!this.listeners[_])return!1;var D=this.listeners[_].indexOf(k);return this.listeners[_]=this.listeners[_].slice(0),this.listeners[_].splice(D,1),D>-1},f.trigger=function(_){var k=this.listeners[_];if(k)if(arguments.length===2)for(var D=k.length,w=0;w<D;++w)k[w].call(this,arguments[1]);else for(var A=Array.prototype.slice.call(arguments,1),x=k.length,P=0;P<x;++P)k[P].apply(this,A)},f.dispose=function(){this.listeners={}},f.pipe=function(_){this.on("data",function(k){_.push(k)})},p}();/*! @name pkcs7 @version 1.0.4 @license Apache-2.0 */function e(p){return p.subarray(0,p.byteLength-p[p.byteLength-1])}/*! @name aes-decrypter @version 4.0.2 @license Apache-2.0 */const t=function(){const p=[[[],[],[],[],[]],[[],[],[],[],[]]],f=p[0],m=p[1],_=f[4],k=m[4];let D,w,A;const x=[],P=[];let S,M,U,B,Q,ie;for(D=0;D<256;D++)P[(x[D]=D<<1^(D>>7)*283)^D]=D;for(w=A=0;!_[w];w^=S||1,A=P[A]||1)for(B=A^A<<1^A<<2^A<<3^A<<4,B=B>>8^B&255^99,_[w]=B,k[B]=w,U=x[M=x[S=x[w]]],ie=U*16843009^M*65537^S*257^w*16843008,Q=x[B]*257^B*16843008,D=0;D<4;D++)f[D][w]=Q=Q<<24^Q>>>8,m[D][B]=ie=ie<<24^ie>>>8;for(D=0;D<5;D++)f[D]=f[D].slice(0),m[D]=m[D].slice(0);return p};let n=null;class r{constructor(f){n||(n=t()),this._tables=[[n[0][0].slice(),n[0][1].slice(),n[0][2].slice(),n[0][3].slice(),n[0][4].slice()],[n[1][0].slice(),n[1][1].slice(),n[1][2].slice(),n[1][3].slice(),n[1][4].slice()]];let m,_,k;const D=this._tables[0][4],w=this._tables[1],A=f.length;let x=1;if(A!==4&&A!==6&&A!==8)throw new Error("Invalid aes key size");const P=f.slice(0),S=[];for(this._key=[P,S],m=A;m<4*A+28;m++)k=P[m-1],(m%A===0||A===8&&m%A===4)&&(k=D[k>>>24]<<24^D[k>>16&255]<<16^D[k>>8&255]<<8^D[k&255],m%A===0&&(k=k<<8^k>>>24^x<<24,x=x<<1^(x>>7)*283)),P[m]=P[m-A]^k;for(_=0;m;_++,m--)k=P[_&3?m:m-4],m<=4||_<4?S[_]=k:S[_]=w[0][D[k>>>24]]^w[1][D[k>>16&255]]^w[2][D[k>>8&255]]^w[3][D[k&255]]}decrypt(f,m,_,k,D,w){const A=this._key[1];let x=f^A[0],P=k^A[1],S=_^A[2],M=m^A[3],U,B,Q;const ie=A.length/4-2;let Y,q=4;const L=this._tables[1],$=L[0],H=L[1],j=L[2],W=L[3],ae=L[4];for(Y=0;Y<ie;Y++)U=$[x>>>24]^H[P>>16&255]^j[S>>8&255]^W[M&255]^A[q],B=$[P>>>24]^H[S>>16&255]^j[M>>8&255]^W[x&255]^A[q+1],Q=$[S>>>24]^H[M>>16&255]^j[x>>8&255]^W[P&255]^A[q+2],M=$[M>>>24]^H[x>>16&255]^j[P>>8&255]^W[S&255]^A[q+3],q+=4,x=U,P=B,S=Q;for(Y=0;Y<4;Y++)D[(3&-Y)+w]=ae[x>>>24]<<24^ae[P>>16&255]<<16^ae[S>>8&255]<<8^ae[M&255]^A[q++],U=x,x=P,P=S,S=M,M=U}}class s extends i{constructor(){super(i),this.jobs=[],this.delay=1,this.timeout_=null}processJob_(){this.jobs.shift()(),this.jobs.length?this.timeout_=setTimeout(this.processJob_.bind(this),this.delay):this.timeout_=null}push(f){this.jobs.push(f),this.timeout_||(this.timeout_=setTimeout(this.processJob_.bind(this),this.delay))}}const a=function(p){return p<<24|(p&65280)<<8|(p&16711680)>>8|p>>>24},o=function(p,f,m){const _=new Int32Array(p.buffer,p.byteOffset,p.byteLength>>2),k=new r(Array.prototype.slice.call(f)),D=new Uint8Array(p.byteLength),w=new Int32Array(D.buffer);let A,x,P,S,M,U,B,Q,ie;for(A=m[0],x=m[1],P=m[2],S=m[3],ie=0;ie<_.length;ie+=4)M=a(_[ie]),U=a(_[ie+1]),B=a(_[ie+2]),Q=a(_[ie+3]),k.decrypt(M,U,B,Q,w,ie),w[ie]=a(w[ie]^A),w[ie+1]=a(w[ie+1]^x),w[ie+2]=a(w[ie+2]^P),w[ie+3]=a(w[ie+3]^S),A=M,x=U,P=B,S=Q;return D};class c{constructor(f,m,_,k){const D=c.STEP,w=new Int32Array(f.buffer),A=new Uint8Array(f.byteLength);let x=0;for(this.asyncStream_=new s,this.asyncStream_.push(this.decryptChunk_(w.subarray(x,x+D),m,_,A)),x=D;x<w.length;x+=D)_=new Uint32Array([a(w[x-4]),a(w[x-3]),a(w[x-2]),a(w[x-1])]),this.asyncStream_.push(this.decryptChunk_(w.subarray(x,x+D),m,_,A));this.asyncStream_.push(function(){k(null,e(A))})}static get STEP(){return 32e3}decryptChunk_(f,m,_,k){return function(){const D=o(f,m,_);k.set(D,f.byteOffset)}}}var u=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},d;typeof window<"u"?d=window:typeof u<"u"?d=u:typeof self<"u"?d=self:d={};var h=d,b=function(f){return ArrayBuffer.isView==="function"?ArrayBuffer.isView(f):f&&f.buffer instanceof ArrayBuffer},v=h.BigInt||Number;v("0x1"),v("0x100"),v("0x10000"),v("0x1000000"),v("0x100000000"),v("0x10000000000"),v("0x1000000000000"),v("0x100000000000000"),v("0x10000000000000000"),function(){var p=new Uint16Array([65484]),f=new Uint8Array(p.buffer,p.byteOffset,p.byteLength);return f[0]===255?"big":f[0]===204?"little":"unknown"}();const y=function(p){const f={};return Object.keys(p).forEach(m=>{const _=p[m];b(_)?f[m]={bytes:_.buffer,byteOffset:_.byteOffset,byteLength:_.byteLength}:f[m]=_}),f};self.onmessage=function(p){const f=p.data,m=new Uint8Array(f.encrypted.bytes,f.encrypted.byteOffset,f.encrypted.byteLength),_=new Uint32Array(f.key.bytes,f.key.byteOffset,f.key.byteLength/4),k=new Uint32Array(f.iv.bytes,f.iv.byteOffset,f.iv.byteLength/4);new c(m,_,k,function(D,w){self.postMessage(y({source:f.source,decrypted:w}),[w.buffer])})}}));var rN=V2(iN);const sN=i=>{let e=i.default?"main":"alternative";return i.characteristics&&i.characteristics.indexOf("public.accessibility.describes-video")>=0&&(e="main-desc"),e},g_=(i,e)=>{i.abort(),i.pause(),e&&e.activePlaylistLoader&&(e.activePlaylistLoader.pause(),e.activePlaylistLoader=null)},Qp=(i,e)=>{e.activePlaylistLoader=i,i.load()},aN=(i,e)=>()=>{const{segmentLoaders:{[i]:t,main:n},mediaTypes:{[i]:r}}=e,s=r.activeTrack(),a=r.getActiveGroup(),o=r.activePlaylistLoader,c=r.lastGroup_;if(!(a&&c&&a.id===c.id)&&(r.lastGroup_=a,r.lastTrack_=s,g_(t,r),!(!a||a.isMainPlaylist))){if(!a.playlistLoader){o&&n.resetEverything();return}t.resyncLoader(),Qp(a.playlistLoader,r)}},oN=(i,e)=>()=>{const{segmentLoaders:{[i]:t},mediaTypes:{[i]:n}}=e;n.lastGroup_=null,t.abort(),t.pause()},lN=(i,e)=>()=>{const{mainPlaylistLoader:t,segmentLoaders:{[i]:n,main:r},mediaTypes:{[i]:s}}=e,a=s.activeTrack(),o=s.getActiveGroup(),c=s.activePlaylistLoader,u=s.lastTrack_;if(!(u&&a&&u.id===a.id)&&(s.lastGroup_=o,s.lastTrack_=a,g_(n,s),!!o)){if(o.isMainPlaylist){if(!a||!u||a.id===u.id)return;const d=e.vhs.playlistController_,h=d.selectPlaylist();if(d.media()===h)return;s.logger_(`track change. Switching main audio from ${u.id} to ${a.id}`),t.pause(),r.resetEverything(),d.fastQualityChange_(h);return}if(i==="AUDIO"){if(!o.playlistLoader){r.setAudio(!0),r.resetEverything();return}n.setAudio(!0),r.setAudio(!1)}if(c===o.playlistLoader){Qp(o.playlistLoader,s);return}n.track&&n.track(a),n.resetEverything(),Qp(o.playlistLoader,s)}},zu={AUDIO:(i,e)=>()=>{const{mediaTypes:{[i]:t},excludePlaylist:n}=e,r=t.activeTrack(),s=t.activeGroup(),a=(s.filter(c=>c.default)[0]||s[0]).id,o=t.tracks[a];if(r===o){n({error:{message:"Problem encountered loading the default audio track."}});return}pe.log.warn("Problem encountered loading the alternate audio track.Switching back to default.");for(const c in t.tracks)t.tracks[c].enabled=t.tracks[c]===o;t.onTrackChanged()},SUBTITLES:(i,e)=>()=>{const{mediaTypes:{[i]:t}}=e;pe.log.warn("Problem encountered loading the subtitle track.Disabling subtitle track.");const n=t.activeTrack();n&&(n.mode="disabled"),t.onTrackChanged()}},v_={AUDIO:(i,e,t)=>{if(!e)return;const{tech:n,requestOptions:r,segmentLoaders:{[i]:s}}=t;e.on("loadedmetadata",()=>{const a=e.media();s.playlist(a,r),(!n.paused()||a.endList&&n.preload()!=="none")&&s.load()}),e.on("loadedplaylist",()=>{s.playlist(e.media(),r),n.paused()||s.load()}),e.on("error",zu[i](i,t))},SUBTITLES:(i,e,t)=>{const{tech:n,requestOptions:r,segmentLoaders:{[i]:s},mediaTypes:{[i]:a}}=t;e.on("loadedmetadata",()=>{const o=e.media();s.playlist(o,r),s.track(a.activeTrack()),(!n.paused()||o.endList&&n.preload()!=="none")&&s.load()}),e.on("loadedplaylist",()=>{s.playlist(e.media(),r),n.paused()||s.load()}),e.on("error",zu[i](i,t))}},cN={AUDIO:(i,e)=>{const{vhs:t,sourceType:n,segmentLoaders:{[i]:r},requestOptions:s,main:{mediaGroups:a},mediaTypes:{[i]:{groups:o,tracks:c,logger_:u}},mainPlaylistLoader:d}=e,h=bl(d.main);(!a[i]||Object.keys(a[i]).length===0)&&(a[i]={main:{default:{default:!0}}},h&&(a[i].main.default.playlists=d.main.playlists));for(const b in a[i]){o[b]||(o[b]=[]);for(const v in a[i][b]){let y=a[i][b][v],p;if(h?(u(`AUDIO group '${b}' label '${v}' is a main playlist`),y.isMainPlaylist=!0,p=null):n==="vhs-json"&&y.playlists?p=new eo(y.playlists[0],t,s):y.resolvedUri?p=new eo(y.resolvedUri,t,s):y.playlists&&n==="dash"?p=new Hp(y.playlists[0],t,s,d):p=null,y=It({id:v,playlistLoader:p},y),v_[i](i,y.playlistLoader,e),o[b].push(y),typeof c[v]>"u"){const f=new pe.AudioTrack({id:v,kind:sN(y),enabled:!1,language:y.language,default:y.default,label:v});c[v]=f}}}r.on("error",zu[i](i,e))},SUBTITLES:(i,e)=>{const{tech:t,vhs:n,sourceType:r,segmentLoaders:{[i]:s},requestOptions:a,main:{mediaGroups:o},mediaTypes:{[i]:{groups:c,tracks:u}},mainPlaylistLoader:d}=e;for(const h in o[i]){c[h]||(c[h]=[]);for(const b in o[i][h]){if(!n.options_.useForcedSubtitles&&o[i][h][b].forced)continue;let v=o[i][h][b],y;if(r==="hls")y=new eo(v.resolvedUri,n,a);else if(r==="dash"){if(!v.playlists.filter(f=>f.excludeUntil!==1/0).length)return;y=new Hp(v.playlists[0],n,a,d)}else r==="vhs-json"&&(y=new eo(v.playlists?v.playlists[0]:v.resolvedUri,n,a));if(v=It({id:b,playlistLoader:y},v),v_[i](i,v.playlistLoader,e),c[h].push(v),typeof u[b]>"u"){const p=t.addRemoteTextTrack({id:b,kind:"subtitles",default:v.default&&v.autoselect,language:v.language,label:b},!1).track;u[b]=p}}}s.on("error",zu[i](i,e))},"CLOSED-CAPTIONS":(i,e)=>{const{tech:t,main:{mediaGroups:n},mediaTypes:{[i]:{groups:r,tracks:s}}}=e;for(const a in n[i]){r[a]||(r[a]=[]);for(const o in n[i][a]){const c=n[i][a][o];if(!/^(?:CC|SERVICE)/.test(c.instreamId))continue;const u=t.options_.vhs&&t.options_.vhs.captionServices||{};let d={label:o,language:c.language,instreamId:c.instreamId,default:c.default&&c.autoselect};if(u[d.instreamId]&&(d=It(d,u[d.instreamId])),d.default===void 0&&delete d.default,r[a].push(It({id:o},c)),typeof s[o]>"u"){const h=t.addRemoteTextTrack({id:d.instreamId,kind:"captions",default:d.default,language:d.language,label:d.label},!1).track;s[o]=h}}}}},y_=(i,e)=>{for(let t=0;t<i.length;t++)if(Bp(e,i[t])||i[t].playlists&&y_(i[t].playlists,e))return!0;return!1},uN=(i,e)=>t=>{const{mainPlaylistLoader:n,mediaTypes:{[i]:{groups:r}}}=e,s=n.media();if(!s)return null;let a=null;s.attributes[i]&&(a=r[s.attributes[i]]);const o=Object.keys(r);if(!a)if(i==="AUDIO"&&o.length>1&&bl(e.main))for(let c=0;c<o.length;c++){const u=r[o[c]];if(y_(u,s)){a=u;break}}else r.main?a=r.main:o.length===1&&(a=r[o[0]]);return typeof t>"u"?a:t===null||!a?null:a.filter(c=>c.id===t.id)[0]||null},dN={AUDIO:(i,e)=>()=>{const{mediaTypes:{[i]:{tracks:t}}}=e;for(const n in t)if(t[n].enabled)return t[n];return null},SUBTITLES:(i,e)=>()=>{const{mediaTypes:{[i]:{tracks:t}}}=e;for(const n in t)if(t[n].mode==="showing"||t[n].mode==="hidden")return t[n];return null}},hN=(i,{mediaTypes:e})=>()=>{const t=e[i].activeTrack();return t?e[i].activeGroup(t):null},fN=i=>{["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(u=>{cN[u](u,i)});const{mediaTypes:e,mainPlaylistLoader:t,tech:n,vhs:r,segmentLoaders:{["AUDIO"]:s,main:a}}=i;["AUDIO","SUBTITLES"].forEach(u=>{e[u].activeGroup=uN(u,i),e[u].activeTrack=dN[u](u,i),e[u].onGroupChanged=aN(u,i),e[u].onGroupChanging=oN(u,i),e[u].onTrackChanged=lN(u,i),e[u].getActiveGroup=hN(u,i)});const o=e.AUDIO.activeGroup();if(o){const u=(o.filter(h=>h.default)[0]||o[0]).id;e.AUDIO.tracks[u].enabled=!0,e.AUDIO.onGroupChanged(),e.AUDIO.onTrackChanged(),e.AUDIO.getActiveGroup().playlistLoader?(a.setAudio(!1),s.setAudio(!0)):a.setAudio(!0)}t.on("mediachange",()=>{["AUDIO","SUBTITLES"].forEach(u=>e[u].onGroupChanged())}),t.on("mediachanging",()=>{["AUDIO","SUBTITLES"].forEach(u=>e[u].onGroupChanging())});const c=()=>{e.AUDIO.onTrackChanged(),n.trigger({type:"usage",name:"vhs-audio-change"})};n.audioTracks().addEventListener("change",c),n.remoteTextTracks().addEventListener("change",e.SUBTITLES.onTrackChanged),r.on("dispose",()=>{n.audioTracks().removeEventListener("change",c),n.remoteTextTracks().removeEventListener("change",e.SUBTITLES.onTrackChanged)}),n.clearTracks("audio");for(const u in e.AUDIO.tracks)n.audioTracks().addTrack(e.AUDIO.tracks[u])},pN=()=>{const i={};return["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(e=>{i[e]={groups:{},tracks:{},activePlaylistLoader:null,activeGroup:Nr,activeTrack:Nr,getActiveGroup:Nr,onGroupChanged:Nr,onTrackChanged:Nr,lastTrack_:null,logger_:Ii(`MediaGroups[${e}]`)}}),i};class b_{constructor(){this.priority_=[],this.pathwayClones_=new Map}set version(e){e===1&&(this.version_=e)}set ttl(e){this.ttl_=e||300}set reloadUri(e){e&&(this.reloadUri_=ii(this.reloadUri_,e))}set priority(e){e&&e.length&&(this.priority_=e)}set pathwayClones(e){e&&e.length&&(this.pathwayClones_=new Map(e.map(t=>[t.ID,t])))}get version(){return this.version_}get ttl(){return this.ttl_}get reloadUri(){return this.reloadUri_}get priority(){return this.priority_}get pathwayClones(){return this.pathwayClones_}}class mN extends pe.EventTarget{constructor(e,t){super(),this.currentPathway=null,this.defaultPathway=null,this.queryBeforeStart=!1,this.availablePathways_=new Set,this.steeringManifest=new b_,this.proxyServerUrl_=null,this.manifestType_=null,this.ttlTimeout_=null,this.request_=null,this.currentPathwayClones=new Map,this.nextPathwayClones=new Map,this.excludedSteeringManifestURLs=new Set,this.logger_=Ii("Content Steering"),this.xhr_=e,this.getBandwidth_=t}assignTagProperties(e,t){this.manifestType_=t.serverUri?"HLS":"DASH";const n=t.serverUri||t.serverURL;if(!n){this.logger_(`steering manifest URL is ${n}, cannot request steering manifest.`),this.trigger("error");return}if(n.startsWith("data:")){this.decodeDataUriManifest_(n.substring(n.indexOf(",")+1));return}this.steeringManifest.reloadUri=ii(e,n),this.defaultPathway=t.pathwayId||t.defaultServiceLocation,this.queryBeforeStart=t.queryBeforeStart,this.proxyServerUrl_=t.proxyServerURL,this.defaultPathway&&!this.queryBeforeStart&&this.trigger("content-steering")}requestSteeringManifest(e){const t=this.steeringManifest.reloadUri;if(!t)return;const n=e?t:this.getRequestURI(t);if(!n){this.logger_("No valid content steering manifest URIs. Stopping content steering."),this.trigger("error"),this.dispose();return}const r={contentSteeringInfo:{uri:n}};this.trigger({type:"contentsteeringloadstart",metadata:r}),this.request_=this.xhr_({uri:n,requestType:"content-steering-manifest"},(s,a)=>{if(s){if(a.status===410){this.logger_(`manifest request 410 ${s}.`),this.logger_(`There will be no more content steering requests to ${n} this session.`),this.excludedSteeringManifestURLs.add(n);return}if(a.status===429){const u=a.responseHeaders["retry-after"];this.logger_(`manifest request 429 ${s}.`),this.logger_(`content steering will retry in ${u} seconds.`),this.startTTLTimeout_(parseInt(u,10));return}this.logger_(`manifest failed to load ${s}.`),this.startTTLTimeout_();return}this.trigger({type:"contentsteeringloadcomplete",metadata:r});let o;try{o=JSON.parse(this.request_.responseText)}catch(u){const d={errorType:pe.Error.StreamingContentSteeringParserError,error:u};this.trigger({type:"error",metadata:d})}this.assignSteeringProperties_(o);const c={contentSteeringInfo:r.contentSteeringInfo,contentSteeringManifest:{version:this.steeringManifest.version,reloadUri:this.steeringManifest.reloadUri,priority:this.steeringManifest.priority}};this.trigger({type:"contentsteeringparsed",metadata:c}),this.startTTLTimeout_()})}setProxyServerUrl_(e){const t=new te.URL(e),n=new te.URL(this.proxyServerUrl_);return n.searchParams.set("url",encodeURI(t.toString())),this.setSteeringParams_(n.toString())}decodeDataUriManifest_(e){const t=JSON.parse(te.atob(e));this.assignSteeringProperties_(t)}setSteeringParams_(e){const t=new te.URL(e),n=this.getPathway(),r=this.getBandwidth_();if(n){const s=`_${this.manifestType_}_pathway`;t.searchParams.set(s,n)}if(r){const s=`_${this.manifestType_}_throughput`;t.searchParams.set(s,r)}return t.toString()}assignSteeringProperties_(e){if(this.steeringManifest.version=e.VERSION,!this.steeringManifest.version){this.logger_(`manifest version is ${e.VERSION}, which is not supported.`),this.trigger("error");return}this.steeringManifest.ttl=e.TTL,this.steeringManifest.reloadUri=e["RELOAD-URI"],this.steeringManifest.priority=e["PATHWAY-PRIORITY"]||e["SERVICE-LOCATION-PRIORITY"],this.steeringManifest.pathwayClones=e["PATHWAY-CLONES"],this.nextPathwayClones=this.steeringManifest.pathwayClones,this.availablePathways_.size||(this.logger_("There are no available pathways for content steering. Ending content steering."),this.trigger("error"),this.dispose());const n=(r=>{for(const s of r)if(this.availablePathways_.has(s))return s;return[...this.availablePathways_][0]})(this.steeringManifest.priority);this.currentPathway!==n&&(this.currentPathway=n,this.trigger("content-steering"))}getPathway(){return this.currentPathway||this.defaultPathway}getRequestURI(e){if(!e)return null;const t=r=>this.excludedSteeringManifestURLs.has(r);if(this.proxyServerUrl_){const r=this.setProxyServerUrl_(e);if(!t(r))return r}const n=this.setSteeringParams_(e);return t(n)?null:n}startTTLTimeout_(e=this.steeringManifest.ttl){const t=e*1e3;this.ttlTimeout_=te.setTimeout(()=>{this.requestSteeringManifest()},t)}clearTTLTimeout_(){te.clearTimeout(this.ttlTimeout_),this.ttlTimeout_=null}abort(){this.request_&&this.request_.abort(),this.request_=null}dispose(){this.off("content-steering"),this.off("error"),this.abort(),this.clearTTLTimeout_(),this.currentPathway=null,this.defaultPathway=null,this.queryBeforeStart=null,this.proxyServerUrl_=null,this.manifestType_=null,this.ttlTimeout_=null,this.request_=null,this.excludedSteeringManifestURLs=new Set,this.availablePathways_=new Set,this.steeringManifest=new b_}addAvailablePathway(e){e&&this.availablePathways_.add(e)}clearAvailablePathways(){this.availablePathways_.clear()}excludePathway(e){return this.availablePathways_.delete(e)}didDASHTagChange(e,t){return!t&&this.steeringManifest.reloadUri||t&&(ii(e,t.serverURL)!==this.steeringManifest.reloadUri||t.defaultServiceLocation!==this.defaultPathway||t.queryBeforeStart!==this.queryBeforeStart||t.proxyServerURL!==this.proxyServerUrl_)}getAvailablePathways(){return this.availablePathways_}}const gN=(i,e)=>{let t=null;return(...n)=>{clearTimeout(t),t=setTimeout(()=>{i.apply(null,n)},e)}},vN=10;let ds;const yN=["mediaRequests","mediaRequestsAborted","mediaRequestsTimedout","mediaRequestsErrored","mediaTransferDuration","mediaBytesTransferred","mediaAppends"],bN=function(i){return this.audioSegmentLoader_[i]+this.mainSegmentLoader_[i]},_N=function({currentPlaylist:i,buffered:e,currentTime:t,nextPlaylist:n,bufferLowWaterLine:r,bufferHighWaterLine:s,duration:a,bufferBasedABR:o,log:c}){if(!n)return pe.log.warn("We received no playlist to switch to. Please check your stream."),!1;const u=`allowing switch ${i&&i.id||"null"} -> ${n.id}`;if(!i)return c(`${u} as current playlist is not set`),!0;if(n.id===i.id)return!1;const d=!!Ja(e,t).length;if(!i.endList)return!d&&typeof i.partTargetDuration=="number"?(c(`not ${u} as current playlist is live llhls, but currentTime isn't in buffered.`),!1):(c(`${u} as current playlist is live`),!0);const h=Np(e,t),b=o?Sn.EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE:Sn.MAX_BUFFER_LOW_WATER_LINE;if(a<b)return c(`${u} as duration < max low water line (${a} < ${b})`),!0;const v=n.attributes.BANDWIDTH,y=i.attributes.BANDWIDTH;if(v<y&&(!o||h<s)){let p=`${u} as next bandwidth < current bandwidth (${v} < ${y})`;return o&&(p+=` and forwardBuffer < bufferHighWaterLine (${h} < ${s})`),c(p),!0}if((!o||v>y)&&h>=r){let p=`${u} as forwardBuffer >= bufferLowWaterLine (${h} >= ${r})`;return o&&(p+=` and next bandwidth > current bandwidth (${v} > ${y})`),c(p),!0}return c(`not ${u} as no switching criteria met`),!1};class kN extends pe.EventTarget{constructor(e){super(),this.fastQualityChange_=gN(this.fastQualityChange_.bind(this),100);const{src:t,withCredentials:n,tech:r,bandwidth:s,externVhs:a,useCueTags:o,playlistExclusionDuration:c,enableLowInitialPlaylist:u,sourceType:d,cacheEncryptionKeys:h,bufferBasedABR:b,leastPixelDiffSelector:v,captionServices:y,experimentalUseMMS:p}=e;if(!t)throw new Error("A non-empty playlist URL or JSON manifest string is required");let{maxPlaylistRetries:f}=e;(f===null||typeof f>"u")&&(f=1/0),ds=a,this.bufferBasedABR=!!b,this.leastPixelDiffSelector=!!v,this.withCredentials=n,this.tech_=r,this.vhs_=r.vhs,this.player_=e.player_,this.sourceType_=d,this.useCueTags_=o,this.playlistExclusionDuration=c,this.maxPlaylistRetries=f,this.enableLowInitialPlaylist=u,this.usingManagedMediaSource_=!1,this.useCueTags_&&(this.cueTagsTrack_=this.tech_.addTextTrack("metadata","ad-cues"),this.cueTagsTrack_.inBandMetadataTrackDispatchType=""),this.requestOptions_={withCredentials:n,maxPlaylistRetries:f,timeout:null},this.on("error",this.pauseLoading),this.mediaTypes_=pN(),p&&te.ManagedMediaSource?(this.tech_.el_.disableRemotePlayback=!0,this.mediaSource=new te.ManagedMediaSource,this.usingManagedMediaSource_=!0,pe.log("Using ManagedMediaSource")):te.MediaSource&&(this.mediaSource=new te.MediaSource),this.handleDurationChange_=this.handleDurationChange_.bind(this),this.handleSourceOpen_=this.handleSourceOpen_.bind(this),this.handleSourceEnded_=this.handleSourceEnded_.bind(this),this.load=this.load.bind(this),this.pause=this.pause.bind(this),this.mediaSource.addEventListener("durationchange",this.handleDurationChange_),this.mediaSource.addEventListener("sourceopen",this.handleSourceOpen_),this.mediaSource.addEventListener("sourceended",this.handleSourceEnded_),this.mediaSource.addEventListener("startstreaming",this.load),this.mediaSource.addEventListener("endstreaming",this.pause),this.seekable_=Tn(),this.hasPlayed_=!1,this.syncController_=new tN(e),this.segmentMetadataTrack_=r.addRemoteTextTrack({kind:"metadata",label:"segment-metadata"},!1).track,this.segmentMetadataTrack_.mode="hidden",this.decrypter_=new rN,this.sourceUpdater_=new u_(this.mediaSource),this.inbandTextTracks_={},this.timelineChangeController_=new nN,this.keyStatusMap_=new Map;const m={vhs:this.vhs_,parse708captions:e.parse708captions,useDtsForTimestampOffset:e.useDtsForTimestampOffset,captionServices:y,mediaSource:this.mediaSource,currentTime:this.tech_.currentTime.bind(this.tech_),seekable:()=>this.seekable(),seeking:()=>this.tech_.seeking(),duration:()=>this.duration(),hasPlayed:()=>this.hasPlayed_,goalBufferLength:()=>this.goalBufferLength(),bandwidth:s,syncController:this.syncController_,decrypter:this.decrypter_,sourceType:this.sourceType_,inbandTextTracks:this.inbandTextTracks_,cacheEncryptionKeys:h,sourceUpdater:this.sourceUpdater_,timelineChangeController:this.timelineChangeController_,exactManifestTimings:e.exactManifestTimings,addMetadataToTextTrack:this.addMetadataToTextTrack.bind(this)};this.mainPlaylistLoader_=this.sourceType_==="dash"?new Hp(t,this.vhs_,It(this.requestOptions_,{addMetadataToTextTrack:this.addMetadataToTextTrack.bind(this)})):new eo(t,this.vhs_,It(this.requestOptions_,{addDateRangesToTextTrack:this.addDateRangesToTextTrack_.bind(this)})),this.setupMainPlaylistLoaderListeners_(),this.mainSegmentLoader_=new Xp(It(m,{segmentMetadataTrack:this.segmentMetadataTrack_,loaderType:"main"}),e),this.audioSegmentLoader_=new Xp(It(m,{loaderType:"audio"}),e),this.subtitleSegmentLoader_=new YP(It(m,{loaderType:"vtt",featuresNativeTextTracks:this.tech_.featuresNativeTextTracks,loadVttJs:()=>new Promise((D,w)=>{function A(){r.off("vttjserror",x),D()}function x(){r.off("vttjsloaded",A),w()}r.one("vttjsloaded",A),r.one("vttjserror",x),r.addWebVttScript_()})}),e);const _=()=>this.mainSegmentLoader_.bandwidth;this.contentSteeringController_=new mN(this.vhs_.xhr,_),this.setupSegmentLoaderListeners_(),this.bufferBasedABR&&(this.mainPlaylistLoader_.one("loadedplaylist",()=>this.startABRTimer_()),this.tech_.on("pause",()=>this.stopABRTimer_()),this.tech_.on("play",()=>this.startABRTimer_())),yN.forEach(D=>{this[D+"_"]=bN.bind(this,D)}),this.logger_=Ii("pc"),this.triggeredFmp4Usage=!1,this.tech_.preload()==="none"?(this.loadOnPlay_=()=>{this.loadOnPlay_=null,this.mainPlaylistLoader_.load()},this.tech_.one("play",this.loadOnPlay_)):this.mainPlaylistLoader_.load(),this.timeToLoadedData__=-1,this.mainAppendsToLoadedData__=-1,this.audioAppendsToLoadedData__=-1;const k=this.tech_.preload()==="none"?"play":"loadstart";this.tech_.one(k,()=>{const D=Date.now();this.tech_.one("loadeddata",()=>{this.timeToLoadedData__=Date.now()-D,this.mainAppendsToLoadedData__=this.mainSegmentLoader_.mediaAppends,this.audioAppendsToLoadedData__=this.audioSegmentLoader_.mediaAppends})})}mainAppendsToLoadedData_(){return this.mainAppendsToLoadedData__}audioAppendsToLoadedData_(){return this.audioAppendsToLoadedData__}appendsToLoadedData_(){const e=this.mainAppendsToLoadedData_(),t=this.audioAppendsToLoadedData_();return e===-1||t===-1?-1:e+t}timeToLoadedData_(){return this.timeToLoadedData__}checkABR_(e="abr"){const t=this.selectPlaylist();t&&this.shouldSwitchToMedia_(t)&&this.switchMedia_(t,e)}switchMedia_(e,t,n){const r=this.media(),s=r&&(r.id||r.uri),a=e&&(e.id||e.uri);if(s&&s!==a){this.logger_(`switch media ${s} -> ${a} from ${t}`);const o={renditionInfo:{id:a,bandwidth:e.attributes.BANDWIDTH,resolution:e.attributes.RESOLUTION,codecs:e.attributes.CODECS},cause:t};this.trigger({type:"renditionselected",metadata:o}),this.tech_.trigger({type:"usage",name:`vhs-rendition-change-${t}`})}this.mainPlaylistLoader_.media(e,n)}switchMediaForDASHContentSteering_(){["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(e=>{const t=this.mediaTypes_[e],n=t?t.activeGroup():null,r=this.contentSteeringController_.getPathway();if(n&&r){const a=(n.length?n[0].playlists:n.playlists).filter(o=>o.attributes.serviceLocation===r);a.length&&this.mediaTypes_[e].activePlaylistLoader.media(a[0])}})}startABRTimer_(){this.stopABRTimer_(),this.abrTimer_=te.setInterval(()=>this.checkABR_(),250)}stopABRTimer_(){this.tech_.scrubbing&&this.tech_.scrubbing()||(te.clearInterval(this.abrTimer_),this.abrTimer_=null)}getAudioTrackPlaylists_(){const e=this.main(),t=e&&e.playlists||[];if(!e||!e.mediaGroups||!e.mediaGroups.AUDIO)return t;const n=e.mediaGroups.AUDIO,r=Object.keys(n);let s;if(Object.keys(this.mediaTypes_.AUDIO.groups).length)s=this.mediaTypes_.AUDIO.activeTrack();else{const o=n.main||r.length&&n[r[0]];for(const c in o)if(o[c].default){s={label:c};break}}if(!s)return t;const a=[];for(const o in n)if(n[o][s.label]){const c=n[o][s.label];if(c.playlists&&c.playlists.length)a.push.apply(a,c.playlists);else if(c.uri)a.push(c);else if(e.playlists.length)for(let u=0;u<e.playlists.length;u++){const d=e.playlists[u];d.attributes&&d.attributes.AUDIO&&d.attributes.AUDIO===o&&a.push(d)}}return a.length?a:t}setupMainPlaylistLoaderListeners_(){this.mainPlaylistLoader_.on("loadedmetadata",()=>{const t=this.mainPlaylistLoader_.media(),n=t.targetDuration*1.5*1e3;Lp(this.mainPlaylistLoader_.main,this.mainPlaylistLoader_.media())?this.requestOptions_.timeout=0:this.requestOptions_.timeout=n,t.endList&&this.tech_.preload()!=="none"&&(this.mainSegmentLoader_.playlist(t,this.requestOptions_),this.mainSegmentLoader_.load()),fN({sourceType:this.sourceType_,segmentLoaders:{AUDIO:this.audioSegmentLoader_,SUBTITLES:this.subtitleSegmentLoader_,main:this.mainSegmentLoader_},tech:this.tech_,requestOptions:this.requestOptions_,mainPlaylistLoader:this.mainPlaylistLoader_,vhs:this.vhs_,main:this.main(),mediaTypes:this.mediaTypes_,excludePlaylist:this.excludePlaylist.bind(this)}),this.triggerPresenceUsage_(this.main(),t),this.setupFirstPlay(),!this.mediaTypes_.AUDIO.activePlaylistLoader||this.mediaTypes_.AUDIO.activePlaylistLoader.media()?this.trigger("selectedinitialmedia"):this.mediaTypes_.AUDIO.activePlaylistLoader.one("loadedmetadata",()=>{this.trigger("selectedinitialmedia")})}),this.mainPlaylistLoader_.on("loadedplaylist",()=>{this.loadOnPlay_&&this.tech_.off("play",this.loadOnPlay_);let t=this.mainPlaylistLoader_.media();if(!t){this.attachContentSteeringListeners_(),this.initContentSteeringController_(),this.excludeUnsupportedVariants_();let n;if(this.enableLowInitialPlaylist&&(n=this.selectInitialPlaylist()),n||(n=this.selectPlaylist()),!n||!this.shouldSwitchToMedia_(n)||(this.initialMedia_=n,this.switchMedia_(this.initialMedia_,"initial"),!(this.sourceType_==="vhs-json"&&this.initialMedia_.segments)))return;t=this.initialMedia_}this.handleUpdatedMediaPlaylist(t)}),this.mainPlaylistLoader_.on("error",()=>{const t=this.mainPlaylistLoader_.error;this.excludePlaylist({playlistToExclude:t.playlist,error:t})}),this.mainPlaylistLoader_.on("mediachanging",()=>{this.mainSegmentLoader_.abort(),this.mainSegmentLoader_.pause()}),this.mainPlaylistLoader_.on("mediachange",()=>{const t=this.mainPlaylistLoader_.media(),n=t.targetDuration*1.5*1e3;Lp(this.mainPlaylistLoader_.main,this.mainPlaylistLoader_.media())?this.requestOptions_.timeout=0:this.requestOptions_.timeout=n,this.sourceType_==="dash"&&this.mainPlaylistLoader_.isPaused&&this.mainPlaylistLoader_.load(),this.mainSegmentLoader_.pause(),this.mainSegmentLoader_.playlist(t,this.requestOptions_),this.waitingForFastQualityPlaylistReceived_?this.runFastQualitySwitch_():this.mainSegmentLoader_.load(),this.tech_.trigger({type:"mediachange",bubbles:!0})}),this.mainPlaylistLoader_.on("playlistunchanged",()=>{const t=this.mainPlaylistLoader_.media();if(t.lastExcludeReason_==="playlist-unchanged")return;this.stuckAtPlaylistEnd_(t)&&(this.excludePlaylist({error:{message:"Playlist no longer updating.",reason:"playlist-unchanged"}}),this.tech_.trigger("playliststuck"))}),this.mainPlaylistLoader_.on("renditiondisabled",()=>{this.tech_.trigger({type:"usage",name:"vhs-rendition-disabled"})}),this.mainPlaylistLoader_.on("renditionenabled",()=>{this.tech_.trigger({type:"usage",name:"vhs-rendition-enabled"})}),["manifestrequeststart","manifestrequestcomplete","manifestparsestart","manifestparsecomplete","playlistrequeststart","playlistrequestcomplete","playlistparsestart","playlistparsecomplete","renditiondisabled","renditionenabled"].forEach(t=>{this.mainPlaylistLoader_.on(t,n=>{this.player_.trigger(dn({},n))})})}handleUpdatedMediaPlaylist(e){this.useCueTags_&&this.updateAdCues_(e),this.mainSegmentLoader_.pause(),this.mainSegmentLoader_.playlist(e,this.requestOptions_),this.waitingForFastQualityPlaylistReceived_&&this.runFastQualitySwitch_(),this.updateDuration(!e.endList),this.tech_.paused()||(this.mainSegmentLoader_.load(),this.audioSegmentLoader_&&this.audioSegmentLoader_.load())}triggerPresenceUsage_(e,t){const n=e.mediaGroups||{};let r=!0;const s=Object.keys(n.AUDIO);for(const a in n.AUDIO)for(const o in n.AUDIO[a])n.AUDIO[a][o].uri||(r=!1);r&&this.tech_.trigger({type:"usage",name:"vhs-demuxed"}),Object.keys(n.SUBTITLES).length&&this.tech_.trigger({type:"usage",name:"vhs-webvtt"}),ds.Playlist.isAes(t)&&this.tech_.trigger({type:"usage",name:"vhs-aes"}),s.length&&Object.keys(n.AUDIO[s[0]]).length>1&&this.tech_.trigger({type:"usage",name:"vhs-alternate-audio"}),this.useCueTags_&&this.tech_.trigger({type:"usage",name:"vhs-playlist-cue-tags"})}shouldSwitchToMedia_(e){const t=this.mainPlaylistLoader_.media()||this.mainPlaylistLoader_.pendingMedia_,n=this.tech_.currentTime(),r=this.bufferLowWaterLine(),s=this.bufferHighWaterLine(),a=this.tech_.buffered();return _N({buffered:a,currentTime:n,currentPlaylist:t,nextPlaylist:e,bufferLowWaterLine:r,bufferHighWaterLine:s,duration:this.duration(),bufferBasedABR:this.bufferBasedABR,log:this.logger_})}setupSegmentLoaderListeners_(){this.mainSegmentLoader_.on("bandwidthupdate",()=>{this.checkABR_("bandwidthupdate"),this.tech_.trigger("bandwidthupdate")}),this.mainSegmentLoader_.on("timeout",()=>{this.bufferBasedABR&&this.mainSegmentLoader_.load()}),this.bufferBasedABR||this.mainSegmentLoader_.on("progress",()=>{this.trigger("progress")}),this.mainSegmentLoader_.on("error",()=>{const n=this.mainSegmentLoader_.error();this.excludePlaylist({playlistToExclude:n.playlist,error:n})}),this.mainSegmentLoader_.on("appenderror",()=>{this.error=this.mainSegmentLoader_.error_,this.trigger("error")}),this.mainSegmentLoader_.on("syncinfoupdate",()=>{this.onSyncInfoUpdate_()}),this.mainSegmentLoader_.on("timestampoffset",()=>{this.tech_.trigger({type:"usage",name:"vhs-timestamp-offset"})}),this.audioSegmentLoader_.on("syncinfoupdate",()=>{this.onSyncInfoUpdate_()}),this.audioSegmentLoader_.on("appenderror",()=>{this.error=this.audioSegmentLoader_.error_,this.trigger("error")}),this.mainSegmentLoader_.on("ended",()=>{this.logger_("main segment loader ended"),this.onEndOfStream()}),this.timelineChangeController_.on("audioTimelineBehind",()=>{const n=this.audioSegmentLoader_.pendingSegment_;if(!n||!n.segment||!n.segment.syncInfo)return;const r=n.segment.syncInfo.end+.01;this.tech_.setCurrentTime(r)}),this.timelineChangeController_.on("fixBadTimelineChange",()=>{this.logger_("Fix bad timeline change. Restarting al segment loaders..."),this.mainSegmentLoader_.pause(),this.mainSegmentLoader_.resetEverything(),this.mediaTypes_.AUDIO.activePlaylistLoader&&(this.audioSegmentLoader_.pause(),this.audioSegmentLoader_.resetEverything()),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&(this.subtitleSegmentLoader_.pause(),this.subtitleSegmentLoader_.resetEverything()),this.load()}),this.mainSegmentLoader_.on("earlyabort",n=>{this.bufferBasedABR||(this.delegateLoaders_("all",["abort"]),this.excludePlaylist({error:{message:"Aborted early because there isn't enough bandwidth to complete the request without rebuffering."},playlistExclusionDuration:vN}))});const e=()=>{if(!this.sourceUpdater_.hasCreatedSourceBuffers())return this.tryToCreateSourceBuffers_();const n=this.getCodecsOrExclude_();n&&this.sourceUpdater_.addOrChangeSourceBuffers(n)};this.mainSegmentLoader_.on("trackinfo",e),this.audioSegmentLoader_.on("trackinfo",e),this.mainSegmentLoader_.on("fmp4",()=>{this.triggeredFmp4Usage||(this.tech_.trigger({type:"usage",name:"vhs-fmp4"}),this.triggeredFmp4Usage=!0)}),this.audioSegmentLoader_.on("fmp4",()=>{this.triggeredFmp4Usage||(this.tech_.trigger({type:"usage",name:"vhs-fmp4"}),this.triggeredFmp4Usage=!0)}),this.audioSegmentLoader_.on("ended",()=>{this.logger_("audioSegmentLoader ended"),this.onEndOfStream()}),["segmentselected","segmentloadstart","segmentloaded","segmentkeyloadstart","segmentkeyloadcomplete","segmentdecryptionstart","segmentdecryptioncomplete","segmenttransmuxingstart","segmenttransmuxingcomplete","segmenttransmuxingtrackinfoavailable","segmenttransmuxingtiminginfoavailable","segmentappendstart","appendsdone","bandwidthupdated","timelinechange","codecschange"].forEach(n=>{this.mainSegmentLoader_.on(n,r=>{this.player_.trigger(dn({},r))}),this.audioSegmentLoader_.on(n,r=>{this.player_.trigger(dn({},r))}),this.subtitleSegmentLoader_.on(n,r=>{this.player_.trigger(dn({},r))})})}mediaSecondsLoaded_(){return Math.max(this.audioSegmentLoader_.mediaSecondsLoaded+this.mainSegmentLoader_.mediaSecondsLoaded)}load(){this.mainSegmentLoader_.load(),this.mediaTypes_.AUDIO.activePlaylistLoader&&this.audioSegmentLoader_.load(),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&this.subtitleSegmentLoader_.load()}pause(){this.mainSegmentLoader_.pause(),this.mediaTypes_.AUDIO.activePlaylistLoader&&this.audioSegmentLoader_.pause(),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&this.subtitleSegmentLoader_.pause()}fastQualityChange_(e=this.selectPlaylist()){if(e&&e===this.mainPlaylistLoader_.media()){this.logger_("skipping fastQualityChange because new media is same as old");return}this.switchMedia_(e,"fast-quality"),this.waitingForFastQualityPlaylistReceived_=!0}runFastQualitySwitch_(){this.waitingForFastQualityPlaylistReceived_=!1,this.mainSegmentLoader_.pause(),this.mainSegmentLoader_.resetEverything(),this.mediaTypes_.AUDIO.activePlaylistLoader&&(this.audioSegmentLoader_.pause(),this.audioSegmentLoader_.resetEverything()),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&(this.subtitleSegmentLoader_.pause(),this.subtitleSegmentLoader_.resetEverything()),this.load()}play(){if(this.setupFirstPlay())return;this.tech_.ended()&&this.tech_.setCurrentTime(0),this.hasPlayed_&&this.load();const e=this.tech_.seekable();if(this.tech_.duration()===1/0&&this.tech_.currentTime()<e.start(0))return this.tech_.setCurrentTime(e.end(e.length-1))}setupFirstPlay(){const e=this.mainPlaylistLoader_.media();if(!e||this.tech_.paused()||this.hasPlayed_)return!1;if(!e.endList||e.start){const t=this.seekable();if(!t.length)return!1;const n=t.end(0);let r=n;if(e.start){const s=e.start.timeOffset;s<0?r=Math.max(n+s,t.start(0)):r=Math.min(n,s)}this.trigger("firstplay"),this.tech_.setCurrentTime(r)}return this.hasPlayed_=!0,this.load(),!0}handleSourceOpen_(){if(this.tryToCreateSourceBuffers_(),this.tech_.autoplay()){const e=this.tech_.play();typeof e<"u"&&typeof e.then=="function"&&e.then(null,t=>{})}this.trigger("sourceopen")}handleSourceEnded_(){if(!this.inbandTextTracks_.metadataTrack_)return;const e=this.inbandTextTracks_.metadataTrack_.cues;if(!e||!e.length)return;const t=this.duration();e[e.length-1].endTime=isNaN(t)||Math.abs(t)===1/0?Number.MAX_VALUE:t}handleDurationChange_(){this.tech_.trigger("durationchange")}onEndOfStream(){let e=this.mainSegmentLoader_.ended_;if(this.mediaTypes_.AUDIO.activePlaylistLoader){const t=this.mainSegmentLoader_.getCurrentMediaInfo_();!t||t.hasVideo?e=e&&this.audioSegmentLoader_.ended_:e=this.audioSegmentLoader_.ended_}e&&(this.stopABRTimer_(),this.sourceUpdater_.endOfStream())}stuckAtPlaylistEnd_(e){if(!this.seekable().length)return!1;const n=this.syncController_.getExpiredTime(e,this.duration());if(n===null)return!1;const r=ds.Playlist.playlistEnd(e,n),s=this.tech_.currentTime(),a=this.tech_.buffered();if(!a.length)return r-s<=dr;const o=a.end(a.length-1);return o-s<=dr&&r-o<=dr}excludePlaylist({playlistToExclude:e=this.mainPlaylistLoader_.media(),error:t={},playlistExclusionDuration:n}){if(e=e||this.mainPlaylistLoader_.media(),n=n||t.playlistExclusionDuration||this.playlistExclusionDuration,!e){this.error=t,this.mediaSource.readyState!=="open"?this.trigger("error"):this.sourceUpdater_.endOfStream("network");return}e.playlistErrors_++;const r=this.mainPlaylistLoader_.main.playlists,s=r.filter(ju),a=s.length===1&&s[0]===e;if(r.length===1&&n!==1/0)return pe.log.warn(`Problem encountered with playlist ${e.id}. Trying again since it is the only playlist.`),this.tech_.trigger("retryplaylist"),this.mainPlaylistLoader_.load(a);if(a){if(this.main().contentSteering){const y=this.pathwayAttribute_(e),p=this.contentSteeringController_.steeringManifest.ttl*1e3;this.contentSteeringController_.excludePathway(y),this.excludeThenChangePathway_(),setTimeout(()=>{this.contentSteeringController_.addAvailablePathway(y)},p);return}let v=!1;r.forEach(y=>{if(y===e)return;const p=y.excludeUntil;typeof p<"u"&&p!==1/0&&(v=!0,delete y.excludeUntil)}),v&&(pe.log.warn("Removing other playlists from the exclusion list because the last rendition is about to be excluded."),this.tech_.trigger("retryplaylist"))}let o;e.playlistErrors_>this.maxPlaylistRetries?o=1/0:o=Date.now()+n*1e3,e.excludeUntil=o,t.reason&&(e.lastExcludeReason_=t.reason),this.tech_.trigger("excludeplaylist"),this.tech_.trigger({type:"usage",name:"vhs-rendition-excluded"});const c=this.selectPlaylist();if(!c){this.error="Playback cannot continue. No available working or supported playlists.",this.trigger("error");return}const u=t.internal?this.logger_:pe.log.warn,d=t.message?" "+t.message:"";u(`${t.internal?"Internal problem":"Problem"} encountered with playlist ${e.id}.${d} Switching to playlist ${c.id}.`),c.attributes.AUDIO!==e.attributes.AUDIO&&this.delegateLoaders_("audio",["abort","pause"]),c.attributes.SUBTITLES!==e.attributes.SUBTITLES&&this.delegateLoaders_("subtitle",["abort","pause"]),this.delegateLoaders_("main",["abort","pause"]);const h=c.targetDuration/2*1e3||5*1e3,b=typeof c.lastRequest=="number"&&Date.now()-c.lastRequest<=h;return this.switchMedia_(c,"exclude",a||b)}pauseLoading(){this.delegateLoaders_("all",["abort","pause"]),this.stopABRTimer_()}delegateLoaders_(e,t){const n=[],r=e==="all";(r||e==="main")&&n.push(this.mainPlaylistLoader_);const s=[];(r||e==="audio")&&s.push("AUDIO"),(r||e==="subtitle")&&(s.push("CLOSED-CAPTIONS"),s.push("SUBTITLES")),s.forEach(a=>{const o=this.mediaTypes_[a]&&this.mediaTypes_[a].activePlaylistLoader;o&&n.push(o)}),["main","audio","subtitle"].forEach(a=>{const o=this[`${a}SegmentLoader_`];o&&(e===a||e==="all")&&n.push(o)}),n.forEach(a=>t.forEach(o=>{typeof a[o]=="function"&&a[o]()}))}setCurrentTime(e){const t=Ja(this.tech_.buffered(),e);if(!(this.mainPlaylistLoader_&&this.mainPlaylistLoader_.media())||!this.mainPlaylistLoader_.media().segments)return 0;if(t&&t.length)return e;this.mainSegmentLoader_.pause(),this.mainSegmentLoader_.resetEverything(),this.mediaTypes_.AUDIO.activePlaylistLoader&&(this.audioSegmentLoader_.pause(),this.audioSegmentLoader_.resetEverything()),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&(this.subtitleSegmentLoader_.pause(),this.subtitleSegmentLoader_.resetEverything()),this.load()}duration(){if(!this.mainPlaylistLoader_)return 0;const e=this.mainPlaylistLoader_.media();return e?e.endList?this.mediaSource?this.mediaSource.duration:ds.Playlist.duration(e):1/0:0}seekable(){return this.seekable_}getSeekableRange_(e,t){const n=e.media();if(!n)return null;const r=this.syncController_.getMediaSequenceSync(t);if(r&&r.isReliable){const o=r.start,c=r.end;if(!isFinite(o)||!isFinite(c))return null;const u=ds.Playlist.liveEdgeDelay(this.mainPlaylistLoader_.main,n),d=Math.max(o,c-u);return Tn([[o,d]])}const s=this.syncController_.getExpiredTime(n,this.duration());if(s===null)return null;const a=ds.Playlist.seekable(n,s,ds.Playlist.liveEdgeDelay(this.mainPlaylistLoader_.main,n));return a.length?a:null}computeFinalSeekable_(e,t){if(!t)return e;const n=e.start(0),r=e.end(0),s=t.start(0),a=t.end(0);return s>r||n>a?e:Tn([[Math.max(n,s),Math.min(r,a)]])}onSyncInfoUpdate_(){if(!this.mainPlaylistLoader_)return;const e=this.getSeekableRange_(this.mainPlaylistLoader_,"main");if(!e)return;let t;if(this.mediaTypes_.AUDIO.activePlaylistLoader&&(t=this.getSeekableRange_(this.mediaTypes_.AUDIO.activePlaylistLoader,"audio"),!t))return;const n=this.seekable_;if(this.seekable_=this.computeFinalSeekable_(e,t),!this.seekable_||n&&n.length&&this.seekable_.length&&n.start(0)===this.seekable_.start(0)&&n.end(0)===this.seekable_.end(0))return;this.logger_(`seekable updated [${l2(this.seekable_)}]`);const r={seekableRanges:this.seekable_};this.trigger({type:"seekablerangeschanged",metadata:r}),this.tech_.trigger("seekablechanged")}updateDuration(e){if(this.updateDuration_&&(this.mediaSource.removeEventListener("sourceopen",this.updateDuration_),this.updateDuration_=null),this.mediaSource.readyState!=="open"){this.updateDuration_=this.updateDuration.bind(this,e),this.mediaSource.addEventListener("sourceopen",this.updateDuration_);return}if(e){const r=this.seekable();if(!r.length)return;(isNaN(this.mediaSource.duration)||this.mediaSource.duration<r.end(r.length-1))&&this.sourceUpdater_.setDuration(r.end(r.length-1));return}const t=this.tech_.buffered();let n=ds.Playlist.duration(this.mainPlaylistLoader_.media());t.length>0&&(n=Math.max(n,t.end(t.length-1))),this.mediaSource.duration!==n&&this.sourceUpdater_.setDuration(n)}dispose(){this.trigger("dispose"),this.decrypter_.terminate(),this.mainPlaylistLoader_.dispose(),this.mainSegmentLoader_.dispose(),this.contentSteeringController_.dispose(),this.keyStatusMap_.clear(),this.loadOnPlay_&&this.tech_.off("play",this.loadOnPlay_),["AUDIO","SUBTITLES"].forEach(e=>{const t=this.mediaTypes_[e].groups;for(const n in t)t[n].forEach(r=>{r.playlistLoader&&r.playlistLoader.dispose()})}),this.audioSegmentLoader_.dispose(),this.subtitleSegmentLoader_.dispose(),this.sourceUpdater_.dispose(),this.timelineChangeController_.dispose(),this.stopABRTimer_(),this.updateDuration_&&this.mediaSource.removeEventListener("sourceopen",this.updateDuration_),this.mediaSource.removeEventListener("durationchange",this.handleDurationChange_),this.mediaSource.removeEventListener("sourceopen",this.handleSourceOpen_),this.mediaSource.removeEventListener("sourceended",this.handleSourceEnded_),this.off()}main(){return this.mainPlaylistLoader_.main}media(){return this.mainPlaylistLoader_.media()||this.initialMedia_}areMediaTypesKnown_(){const e=!!this.mediaTypes_.AUDIO.activePlaylistLoader,t=!!this.mainSegmentLoader_.getCurrentMediaInfo_(),n=e?!!this.audioSegmentLoader_.getCurrentMediaInfo_():!0;return!(!t||!n)}getCodecsOrExclude_(){const e={main:this.mainSegmentLoader_.getCurrentMediaInfo_()||{},audio:this.audioSegmentLoader_.getCurrentMediaInfo_()||{}},t=this.mainSegmentLoader_.getPendingSegmentPlaylist()||this.media();e.video=e.main;const n=kl(this.main(),t),r={},s=!!this.mediaTypes_.AUDIO.activePlaylistLoader;if(e.main.hasVideo&&(r.video=n.video||e.main.videoCodec||m6),e.main.isMuxed&&(r.video+=`,${n.audio||e.main.audioCodec||Uy}`),(e.main.hasAudio&&!e.main.isMuxed||e.audio.hasAudio||s)&&(r.audio=n.audio||e.main.audioCodec||e.audio.audioCodec||Uy,e.audio.isFmp4=e.main.hasAudio&&!e.main.isMuxed?e.main.isFmp4:e.audio.isFmp4),!r.audio&&!r.video){this.excludePlaylist({playlistToExclude:t,error:{message:"Could not determine codecs for playlist."},playlistExclusionDuration:1/0});return}const a=(u,d)=>u?Zo(d,this.usingManagedMediaSource_):Tf(d),o={};let c;if(["video","audio"].forEach(function(u){if(r.hasOwnProperty(u)&&!a(e[u].isFmp4,r[u])){const d=e[u].isFmp4?"browser":"muxer";o[d]=o[d]||[],o[d].push(r[u]),u==="audio"&&(c=d)}}),s&&c&&t.attributes.AUDIO){const u=t.attributes.AUDIO;this.main().playlists.forEach(d=>{(d.attributes&&d.attributes.AUDIO)===u&&d!==t&&(d.excludeUntil=1/0)}),this.logger_(`excluding audio group ${u} as ${c} does not support codec(s): "${r.audio}"`)}if(Object.keys(o).length){const u=Object.keys(o).reduce((d,h)=>(d&&(d+=", "),d+=`${h} does not support codec(s): "${o[h].join(",")}"`,d),"")+".";this.excludePlaylist({playlistToExclude:t,error:{internal:!0,message:u},playlistExclusionDuration:1/0});return}if(this.sourceUpdater_.hasCreatedSourceBuffers()&&!this.sourceUpdater_.canChangeType()){const u=[];if(["video","audio"].forEach(d=>{const h=(rr(this.sourceUpdater_.codecs[d]||"")[0]||{}).type,b=(rr(r[d]||"")[0]||{}).type;h&&b&&h.toLowerCase()!==b.toLowerCase()&&u.push(`"${this.sourceUpdater_.codecs[d]}" -> "${r[d]}"`)}),u.length){this.excludePlaylist({playlistToExclude:t,error:{message:`Codec switching not supported: ${u.join(", ")}.`,internal:!0},playlistExclusionDuration:1/0});return}}return r}tryToCreateSourceBuffers_(){if(this.mediaSource.readyState!=="open"||this.sourceUpdater_.hasCreatedSourceBuffers()||!this.areMediaTypesKnown_())return;const e=this.getCodecsOrExclude_();if(!e)return;this.sourceUpdater_.createSourceBuffers(e);const t=[e.video,e.audio].filter(Boolean).join(",");this.excludeIncompatibleVariants_(t)}excludeUnsupportedVariants_(){const e=this.main().playlists,t=[];Object.keys(e).forEach(n=>{const r=e[n];if(t.indexOf(r.id)!==-1)return;t.push(r.id);const s=kl(this.main,r),a=[];s.audio&&!Tf(s.audio)&&!Zo(s.audio,this.usingManagedMediaSource_)&&a.push(`audio codec ${s.audio}`),s.video&&!Tf(s.video)&&!Zo(s.video,this.usingManagedMediaSource_)&&a.push(`video codec ${s.video}`),s.text&&s.text==="stpp.ttml.im1t"&&a.push(`text codec ${s.text}`),a.length&&(r.excludeUntil=1/0,this.logger_(`excluding ${r.id} for unsupported: ${a.join(", ")}`))})}excludeIncompatibleVariants_(e){const t=[],n=this.main().playlists,r=_l(rr(e)),s=E2(r),a=r.video&&rr(r.video)[0]||null,o=r.audio&&rr(r.audio)[0]||null;Object.keys(n).forEach(c=>{const u=n[c];if(t.indexOf(u.id)!==-1||u.excludeUntil===1/0)return;t.push(u.id);const d=[],h=kl(this.mainPlaylistLoader_.main,u),b=E2(h);if(!(!h.audio&&!h.video)){if(b!==s&&d.push(`codec count "${b}" !== "${s}"`),!this.sourceUpdater_.canChangeType()){const v=h.video&&rr(h.video)[0]||null,y=h.audio&&rr(h.audio)[0]||null;v&&a&&v.type.toLowerCase()!==a.type.toLowerCase()&&d.push(`video codec "${v.type}" !== "${a.type}"`),y&&o&&y.type.toLowerCase()!==o.type.toLowerCase()&&d.push(`audio codec "${y.type}" !== "${o.type}"`)}d.length&&(u.excludeUntil=1/0,this.logger_(`excluding ${u.id}: ${d.join(" && ")}`))}})}updateAdCues_(e){let t=0;const n=this.seekable();n.length&&(t=n.start(0)),QP(e,this.cueTagsTrack_,t)}goalBufferLength(){const e=this.tech_.currentTime(),t=Sn.GOAL_BUFFER_LENGTH,n=Sn.GOAL_BUFFER_LENGTH_RATE,r=Math.max(t,Sn.MAX_GOAL_BUFFER_LENGTH);return Math.min(t+e*n,r)}bufferLowWaterLine(){const e=this.tech_.currentTime(),t=Sn.BUFFER_LOW_WATER_LINE,n=Sn.BUFFER_LOW_WATER_LINE_RATE,r=Math.max(t,Sn.MAX_BUFFER_LOW_WATER_LINE),s=Math.max(t,Sn.EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE);return Math.min(t+e*n,this.bufferBasedABR?s:r)}bufferHighWaterLine(){return Sn.BUFFER_HIGH_WATER_LINE}addDateRangesToTextTrack_(e){i_(this.inbandTextTracks_,"com.apple.streaming",this.tech_),PP({inbandTextTracks:this.inbandTextTracks_,dateRanges:e})}addMetadataToTextTrack(e,t,n){const r=this.sourceUpdater_.videoBuffer?this.sourceUpdater_.videoTimestampOffset():this.sourceUpdater_.audioTimestampOffset();i_(this.inbandTextTracks_,e,this.tech_),DP({inbandTextTracks:this.inbandTextTracks_,metadataArray:t,timestampOffset:r,videoDuration:n})}pathwayAttribute_(e){return e.attributes["PATHWAY-ID"]||e.attributes.serviceLocation}initContentSteeringController_(){const e=this.main();if(e.contentSteering){for(const t of e.playlists)this.contentSteeringController_.addAvailablePathway(this.pathwayAttribute_(t));if(this.contentSteeringController_.assignTagProperties(e.uri,e.contentSteering),this.contentSteeringController_.queryBeforeStart){this.contentSteeringController_.requestSteeringManifest(!0);return}this.tech_.one("canplay",()=>{this.contentSteeringController_.requestSteeringManifest()})}}resetContentSteeringController_(){this.contentSteeringController_.clearAvailablePathways(),this.contentSteeringController_.dispose(),this.initContentSteeringController_()}attachContentSteeringListeners_(){this.contentSteeringController_.on("content-steering",this.excludeThenChangePathway_.bind(this)),["contentsteeringloadstart","contentsteeringloadcomplete","contentsteeringparsed"].forEach(t=>{this.contentSteeringController_.on(t,n=>{this.trigger(dn({},n))})}),this.sourceType_==="dash"&&this.mainPlaylistLoader_.on("loadedplaylist",()=>{const t=this.main();(this.contentSteeringController_.didDASHTagChange(t.uri,t.contentSteering)||(()=>{const s=this.contentSteeringController_.getAvailablePathways(),a=[];for(const o of t.playlists){const c=o.attributes.serviceLocation;if(c&&(a.push(c),!s.has(c)))return!0}return!!(!a.length&&s.size)})())&&this.resetContentSteeringController_()})}excludeThenChangePathway_(){const e=this.contentSteeringController_.getPathway();if(!e)return;this.handlePathwayClones_();const n=this.main().playlists,r=new Set;let s=!1;Object.keys(n).forEach(a=>{const o=n[a],c=this.pathwayAttribute_(o),u=c&&e!==c;o.excludeUntil===1/0&&o.lastExcludeReason_==="content-steering"&&!u&&(delete o.excludeUntil,delete o.lastExcludeReason_,s=!0);const h=!o.excludeUntil&&o.excludeUntil!==1/0;!r.has(o.id)&&u&&h&&(r.add(o.id),o.excludeUntil=1/0,o.lastExcludeReason_="content-steering",this.logger_(`excluding ${o.id} for ${o.lastExcludeReason_}`))}),this.contentSteeringController_.manifestType_==="DASH"&&Object.keys(this.mediaTypes_).forEach(a=>{const o=this.mediaTypes_[a];if(o.activePlaylistLoader){const c=o.activePlaylistLoader.media_;c&&c.attributes.serviceLocation!==e&&(s=!0)}}),s&&this.changeSegmentPathway_()}handlePathwayClones_(){const t=this.main().playlists,n=this.contentSteeringController_.currentPathwayClones,r=this.contentSteeringController_.nextPathwayClones;if(n&&n.size||r&&r.size){for(const[a,o]of n.entries())r.get(a)||(this.mainPlaylistLoader_.updateOrDeleteClone(o),this.contentSteeringController_.excludePathway(a));for(const[a,o]of r.entries()){const c=n.get(a);if(!c){t.filter(d=>d.attributes["PATHWAY-ID"]===o["BASE-ID"]).forEach(d=>{this.mainPlaylistLoader_.addClonePathway(o,d)}),this.contentSteeringController_.addAvailablePathway(a);continue}this.equalPathwayClones_(c,o)||(this.mainPlaylistLoader_.updateOrDeleteClone(o,!0),this.contentSteeringController_.addAvailablePathway(a))}this.contentSteeringController_.currentPathwayClones=new Map(JSON.parse(JSON.stringify([...r])))}}equalPathwayClones_(e,t){if(e["BASE-ID"]!==t["BASE-ID"]||e.ID!==t.ID||e["URI-REPLACEMENT"].HOST!==t["URI-REPLACEMENT"].HOST)return!1;const n=e["URI-REPLACEMENT"].PARAMS,r=t["URI-REPLACEMENT"].PARAMS;for(const s in n)if(n[s]!==r[s])return!1;for(const s in r)if(n[s]!==r[s])return!1;return!0}changeSegmentPathway_(){const e=this.selectPlaylist();this.pauseLoading(),this.contentSteeringController_.manifestType_==="DASH"&&this.switchMediaForDASHContentSteering_(),this.switchMedia_(e,"content-steering")}excludeNonUsablePlaylistsByKeyId_(){if(!this.mainPlaylistLoader_||!this.mainPlaylistLoader_.main)return;let e=0;const t="non-usable";this.mainPlaylistLoader_.main.playlists.forEach(n=>{const r=this.mainPlaylistLoader_.getKeyIdSet(n);!r||!r.size||r.forEach(s=>{const a="usable",o=this.keyStatusMap_.has(s)&&this.keyStatusMap_.get(s)===a,c=n.lastExcludeReason_===t&&n.excludeUntil===1/0;o?o&&c&&(delete n.excludeUntil,delete n.lastExcludeReason_,this.logger_(`enabling playlist ${n.id} because key ID ${s} is ${a}`)):(n.excludeUntil!==1/0&&n.lastExcludeReason_!==t&&(n.excludeUntil=1/0,n.lastExcludeReason_=t,this.logger_(`excluding playlist ${n.id} because the key ID ${s} doesn't exist in the keyStatusMap or is not ${a}`)),e++)})}),e>=this.mainPlaylistLoader_.main.playlists.length&&this.mainPlaylistLoader_.main.playlists.forEach(n=>{const r=n&&n.attributes&&n.attributes.RESOLUTION&&n.attributes.RESOLUTION.height<720,s=n.excludeUntil===1/0&&n.lastExcludeReason_===t;r&&s&&(delete n.excludeUntil,pe.log.warn(`enabling non-HD playlist ${n.id} because all playlists were excluded due to ${t} key IDs`))})}addKeyStatus_(e,t){const s=(typeof e=="string"?e:KP(e)).slice(0,32).toLowerCase();this.logger_(`KeyStatus '${t}' with key ID ${s} added to the keyStatusMap`),this.keyStatusMap_.set(s,t)}updatePlaylistByKeyStatus(e,t){this.addKeyStatus_(e,t),this.waitingForFastQualityPlaylistReceived_||this.excludeNonUsableThenChangePlaylist_(),this.mainPlaylistLoader_.off("loadedplaylist",this.excludeNonUsableThenChangePlaylist_.bind(this)),this.mainPlaylistLoader_.on("loadedplaylist",this.excludeNonUsableThenChangePlaylist_.bind(this))}excludeNonUsableThenChangePlaylist_(){this.excludeNonUsablePlaylistsByKeyId_(),this.fastQualityChange_()}}const TN=(i,e,t)=>n=>{const r=i.main.playlists[e],s=Rp(r),a=ju(r);if(typeof n>"u")return a;n?delete r.disabled:r.disabled=!0;const o={renditionInfo:{id:e,bandwidth:r.attributes.BANDWIDTH,resolution:r.attributes.RESOLUTION,codecs:r.attributes.CODECS},cause:"fast-quality"};return n!==a&&!s&&(n?(t(r),i.trigger({type:"renditionenabled",metadata:o})):i.trigger({type:"renditiondisabled",metadata:o})),n};class SN{constructor(e,t,n){const{playlistController_:r}=e,s=r.fastQualityChange_.bind(r);if(t.attributes){const a=t.attributes.RESOLUTION;this.width=a&&a.width,this.height=a&&a.height,this.bandwidth=t.attributes.BANDWIDTH,this.frameRate=t.attributes["FRAME-RATE"]}this.codecs=kl(r.main(),t),this.playlist=t,this.id=n,this.enabled=TN(e.playlists,t.id,s)}}const CN=function(i){i.representations=()=>{const e=i.playlistController_.main(),t=bl(e)?i.playlistController_.getAudioTrackPlaylists_():e.playlists;return t?t.filter(n=>!Rp(n)).map((n,r)=>new SN(i,n,n.id)):[]}},__=["seeking","seeked","pause","playing","error"];class xN extends pe.EventTarget{constructor(e){super(),this.playlistController_=e.playlistController,this.tech_=e.tech,this.seekable=e.seekable,this.allowSeeksWithinUnsafeLiveWindow=e.allowSeeksWithinUnsafeLiveWindow,this.liveRangeSafeTimeDelta=e.liveRangeSafeTimeDelta,this.media=e.media,this.playedRanges_=[],this.consecutiveUpdates=0,this.lastRecordedTime=null,this.checkCurrentTimeTimeout_=null,this.logger_=Ii("PlaybackWatcher"),this.logger_("initialize");const t=()=>this.monitorCurrentTime_(),n=()=>this.monitorCurrentTime_(),r=()=>this.techWaiting_(),s=()=>this.resetTimeUpdate_(),a=this.playlistController_,o=["main","subtitle","audio"],c={};o.forEach(d=>{c[d]={reset:()=>this.resetSegmentDownloads_(d),updateend:()=>this.checkSegmentDownloads_(d)},a[`${d}SegmentLoader_`].on("appendsdone",c[d].updateend),a[`${d}SegmentLoader_`].on("playlistupdate",c[d].reset),this.tech_.on(["seeked","seeking"],c[d].reset)});const u=d=>{["main","audio"].forEach(h=>{a[`${h}SegmentLoader_`][d]("appended",this.seekingAppendCheck_)})};this.seekingAppendCheck_=()=>{this.fixesBadSeeks_()&&(this.consecutiveUpdates=0,this.lastRecordedTime=this.tech_.currentTime(),u("off"))},this.clearSeekingAppendCheck_=()=>u("off"),this.watchForBadSeeking_=()=>{this.clearSeekingAppendCheck_(),u("on")},this.tech_.on("seeked",this.clearSeekingAppendCheck_),this.tech_.on("seeking",this.watchForBadSeeking_),this.tech_.on("waiting",r),this.tech_.on(__,s),this.tech_.on("canplay",n),this.tech_.one("play",t),this.dispose=()=>{this.clearSeekingAppendCheck_(),this.logger_("dispose"),this.tech_.off("waiting",r),this.tech_.off(__,s),this.tech_.off("canplay",n),this.tech_.off("play",t),this.tech_.off("seeking",this.watchForBadSeeking_),this.tech_.off("seeked",this.clearSeekingAppendCheck_),o.forEach(d=>{a[`${d}SegmentLoader_`].off("appendsdone",c[d].updateend),a[`${d}SegmentLoader_`].off("playlistupdate",c[d].reset),this.tech_.off(["seeked","seeking"],c[d].reset)}),this.checkCurrentTimeTimeout_&&te.clearTimeout(this.checkCurrentTimeTimeout_),this.resetTimeUpdate_()}}monitorCurrentTime_(){this.checkCurrentTime_(),this.checkCurrentTimeTimeout_&&te.clearTimeout(this.checkCurrentTimeTimeout_),this.checkCurrentTimeTimeout_=te.setTimeout(this.monitorCurrentTime_.bind(this),250)}resetSegmentDownloads_(e){const t=this.playlistController_[`${e}SegmentLoader_`];this[`${e}StalledDownloads_`]>0&&this.logger_(`resetting possible stalled download count for ${e} loader`),this[`${e}StalledDownloads_`]=0,this[`${e}Buffered_`]=t.buffered_()}checkSegmentDownloads_(e){const t=this.playlistController_,n=t[`${e}SegmentLoader_`],r=n.buffered_(),s=fI(this[`${e}Buffered_`],r);if(this[`${e}Buffered_`]=r,s){const a={bufferedRanges:r};t.trigger({type:"bufferedrangeschanged",metadata:a}),this.resetSegmentDownloads_(e);return}this[`${e}StalledDownloads_`]++,this.logger_(`found #${this[`${e}StalledDownloads_`]} ${e} appends that did not increase buffer (possible stalled download)`,{playlistId:n.playlist_&&n.playlist_.id,buffered:qs(r)}),!(this[`${e}StalledDownloads_`]<10)&&(this.logger_(`${e} loader stalled download exclusion`),this.resetSegmentDownloads_(e),this.tech_.trigger({type:"usage",name:`vhs-${e}-download-exclusion`}),e!=="subtitle"&&t.excludePlaylist({error:{message:`Excessive ${e} segment downloading detected.`},playlistExclusionDuration:1/0}))}checkCurrentTime_(){if(this.tech_.paused()||this.tech_.seeking())return;const e=this.tech_.currentTime(),t=this.tech_.buffered();if(this.lastRecordedTime===e&&(!t.length||e+dr>=t.end(t.length-1)))return this.techWaiting_();if(this.consecutiveUpdates>=5&&e===this.lastRecordedTime)this.consecutiveUpdates++,this.waiting_();else if(e===this.lastRecordedTime)this.consecutiveUpdates++;else{this.playedRanges_.push(Tn([this.lastRecordedTime,e]));const n={playedRanges:this.playedRanges_};this.playlistController_.trigger({type:"playedrangeschanged",metadata:n}),this.consecutiveUpdates=0,this.lastRecordedTime=e}}resetTimeUpdate_(){this.consecutiveUpdates=0}fixesBadSeeks_(){if(!this.tech_.seeking())return!1;const t=this.seekable(),n=this.tech_.currentTime(),r=this.afterSeekableWindow_(t,n,this.media(),this.allowSeeksWithinUnsafeLiveWindow);let s;if(r&&(s=t.end(t.length-1)),this.beforeSeekableWindow_(t,n)){const y=t.start(0);s=y+(y===t.end(0)?0:dr)}if(typeof s<"u")return this.logger_(`Trying to seek outside of seekable at time ${n} with seekable range ${l2(t)}. Seeking to ${s}.`),this.tech_.setCurrentTime(s),!0;const a=this.playlistController_.sourceUpdater_,o=this.tech_.buffered(),c=a.audioBuffer?a.audioBuffered():null,u=a.videoBuffer?a.videoBuffered():null,d=this.media(),h=d.partTargetDuration?d.partTargetDuration:(d.targetDuration-ur)*2,b=[c,u];for(let y=0;y<b.length;y++){if(!b[y])continue;if(Np(b[y],n)<h)return!1}const v=Vu(o,n);return v.length===0?!1:(s=v.start(0)+dr,this.logger_(`Buffered region starts (${v.start(0)}) just beyond seek point (${n}). Seeking to ${s}.`),this.tech_.setCurrentTime(s),!0)}waiting_(){if(this.techWaiting_())return;const e=this.tech_.currentTime(),t=this.tech_.buffered(),n=Ja(t,e);if(n.length&&e+3<=n.end(0)){this.resetTimeUpdate_(),this.tech_.setCurrentTime(e),this.logger_(`Stopped at ${e} while inside a buffered region [${n.start(0)} -> ${n.end(0)}]. Attempting to resume playback by seeking to the current time.`),this.tech_.trigger({type:"usage",name:"vhs-unknown-waiting"});return}}techWaiting_(){const e=this.seekable(),t=this.tech_.currentTime();if(this.tech_.seeking())return!0;if(this.beforeSeekableWindow_(e,t)){const o=e.end(e.length-1);return this.logger_(`Fell out of live window at time ${t}. Seeking to live point (seekable end) ${o}`),this.resetTimeUpdate_(),this.tech_.setCurrentTime(o),this.tech_.trigger({type:"usage",name:"vhs-live-resync"}),!0}const n=this.tech_.vhs.playlistController_.sourceUpdater_,r=this.tech_.buffered();if(this.videoUnderflow_({audioBuffered:n.audioBuffered(),videoBuffered:n.videoBuffered(),currentTime:t}))return this.resetTimeUpdate_(),this.tech_.setCurrentTime(t),this.tech_.trigger({type:"usage",name:"vhs-video-underflow"}),!0;const a=Vu(r,t);return a.length>0?(this.logger_(`Stopped at ${t} and seeking to ${a.start(0)}`),this.resetTimeUpdate_(),this.skipTheGap_(t),!0):!1}afterSeekableWindow_(e,t,n,r=!1){if(!e.length)return!1;let s=e.end(e.length-1)+dr;const a=!n.endList,o=typeof n.partTargetDuration=="number";return a&&(o||r)&&(s=e.end(e.length-1)+n.targetDuration*3),t>s}beforeSeekableWindow_(e,t){return!!(e.length&&e.start(0)>0&&t<e.start(0)-this.liveRangeSafeTimeDelta)}videoUnderflow_({videoBuffered:e,audioBuffered:t,currentTime:n}){if(!e)return;let r;if(e.length&&t.length){const s=Ja(e,n-3),a=Ja(e,n),o=Ja(t,n);o.length&&!a.length&&s.length&&(r={start:s.end(0),end:o.end(0)})}else Vu(e,n).length||(r=this.gapFromVideoUnderflow_(e,n));return r?(this.logger_(`Encountered a gap in video from ${r.start} to ${r.end}. Seeking to current time ${n}`),!0):!1}skipTheGap_(e){const t=this.tech_.buffered(),n=this.tech_.currentTime(),r=Vu(t,n);if(this.resetTimeUpdate_(),r.length===0||n!==e)return;this.logger_("skipTheGap_:","currentTime:",n,"scheduled currentTime:",e,"nextRange start:",r.start(0)),this.tech_.setCurrentTime(r.start(0)+ur);const s={gapInfo:{from:n,to:r.start(0)}};this.playlistController_.trigger({type:"gapjumped",metadata:s}),this.tech_.trigger({type:"usage",name:"vhs-gap-skip"})}gapFromVideoUnderflow_(e,t){const n=uI(e);for(let r=0;r<n.length;r++){const s=n.start(r),a=n.end(r);if(t-s<4&&t-s>2)return{start:s,end:a}}return null}}const EN={errorInterval:30,getSource(i){const t=this.tech({IWillNotUseThisInPlugins:!0}).currentSource_||this.currentSource();return i(t)}},k_=function(i,e){let t=0,n=0;const r=It(EN,e);i.ready(()=>{i.trigger({type:"usage",name:"vhs-error-reload-initialized"})});const s=function(){n&&i.currentTime(n)},a=function(d){d!=null&&(n=i.duration()!==1/0&&i.currentTime()||0,i.one("loadedmetadata",s),i.src(d),i.trigger({type:"usage",name:"vhs-error-reload"}),i.play())},o=function(){if(Date.now()-t<r.errorInterval*1e3){i.trigger({type:"usage",name:"vhs-error-reload-canceled"});return}if(!r.getSource||typeof r.getSource!="function"){pe.log.error("ERROR: reloadSourceOnError - The option getSource must be a function!");return}return t=Date.now(),r.getSource.call(i,a)},c=function(){i.off("loadedmetadata",s),i.off("error",o),i.off("dispose",c)},u=function(d){c(),k_(i,d)};i.on("error",o),i.on("dispose",c),i.reloadSourceOnError=u},wN=function(i){k_(this,i)};var T_="3.17.0",DN="7.1.0",AN="1.3.1",IN="7.2.0",PN="4.0.2";const Zt={PlaylistLoader:eo,Playlist:ri,utils:BI,STANDARD_PLAYLIST_SELECTOR:t_,INITIAL_PLAYLIST_SELECTOR:SP,lastBandwidthSelector:t_,movingAverageBandwidthSelector:kP,comparePlaylistBandwidth:Wp,comparePlaylistResolution:_P,xhr:P2()};Object.keys(Sn).forEach(i=>{Object.defineProperty(Zt,i,{get(){return pe.log.warn(`using Vhs.${i} is UNSAFE be sure you know what you are doing`),Sn[i]},set(e){if(pe.log.warn(`using Vhs.${i} is UNSAFE be sure you know what you are doing`),typeof e!="number"||e<0){pe.log.warn(`value of Vhs.${i} must be greater than or equal to 0`);return}Sn[i]=e}})});const S_="videojs-vhs",C_=function(i,e){const t=e.media();let n=-1;for(let r=0;r<i.length;r++)if(i[r].id===t.id){n=r;break}i.selectedIndex_=n,i.trigger({selectedIndex:n,type:"change"})},NN=function(i,e){e.representations().forEach(t=>{i.addQualityLevel(t)}),C_(i,e.playlists)};Zt.canPlaySource=function(){return pe.log.warn("VHS is no longer a tech. Please remove it from your player's techOrder.")};const ON=(i,e,t)=>{if(!i)return i;let n={};e&&e.attributes&&e.attributes.CODECS&&(n=_l(rr(e.attributes.CODECS))),t&&t.attributes&&t.attributes.CODECS&&(n.audio=t.attributes.CODECS);const r=Aa(n.video),s=Aa(n.audio),a={};for(const o in i)a[o]={},s&&(a[o].audioContentType=s),r&&(a[o].videoContentType=r),e.contentProtection&&e.contentProtection[o]&&e.contentProtection[o].pssh&&(a[o].pssh=e.contentProtection[o].pssh),typeof i[o]=="string"&&(a[o].url=i[o]);return It(i,a)},MN=(i,e)=>i.reduce((t,n)=>{if(!n.contentProtection)return t;const r=e.reduce((s,a)=>{const o=n.contentProtection[a];return o&&o.pssh&&(s[a]={pssh:o.pssh}),s},{});return Object.keys(r).length&&t.push(r),t},[]),RN=({player:i,sourceKeySystems:e,audioMedia:t,mainPlaylists:n})=>{if(!i.eme.initializeMediaKeys)return Promise.resolve();const r=t?n.concat([t]):n,s=MN(r,Object.keys(e)),a=[],o=[];return s.forEach(c=>{o.push(new Promise((u,d)=>{i.tech_.one("keysessioncreated",u)})),a.push(new Promise((u,d)=>{i.eme.initializeMediaKeys({keySystems:c},h=>{if(h){d(h);return}u()})}))}),Promise.race([Promise.all(a),Promise.race(o)])},LN=({player:i,sourceKeySystems:e,media:t,audioMedia:n})=>{const r=ON(e,t,n);return r?(i.currentSource().keySystems=r,r&&!i.eme?(pe.log.warn("DRM encrypted source cannot be decrypted without a DRM plugin"),!1):!0):!1},x_=()=>{if(!te.localStorage)return null;const i=te.localStorage.getItem(S_);if(!i)return null;try{return JSON.parse(i)}catch{return null}},BN=i=>{if(!te.localStorage)return!1;let e=x_();e=e?It(e,i):i;try{te.localStorage.setItem(S_,JSON.stringify(e))}catch{return!1}return e},UN=i=>i.toLowerCase().indexOf("data:application/vnd.videojs.vhs+json,")===0?JSON.parse(i.substring(i.indexOf(",")+1)):i,E_=(i,e)=>{i._requestCallbackSet||(i._requestCallbackSet=new Set),i._requestCallbackSet.add(e)},w_=(i,e)=>{i._responseCallbackSet||(i._responseCallbackSet=new Set),i._responseCallbackSet.add(e)},D_=(i,e)=>{i._requestCallbackSet&&(i._requestCallbackSet.delete(e),i._requestCallbackSet.size||delete i._requestCallbackSet)},A_=(i,e)=>{i._responseCallbackSet&&(i._responseCallbackSet.delete(e),i._responseCallbackSet.size||delete i._responseCallbackSet)};Zt.supportsNativeHls=function(){if(!Ue||!Ue.createElement)return!1;const i=Ue.createElement("video");return pe.getTech("Html5").isSupported()?["application/vnd.apple.mpegurl","audio/mpegurl","audio/x-mpegurl","application/x-mpegurl","video/x-mpegurl","video/mpegurl","application/mpegurl"].some(function(t){return/maybe|probably/i.test(i.canPlayType(t))}):!1}(),Zt.supportsNativeDash=function(){return!Ue||!Ue.createElement||!pe.getTech("Html5").isSupported()?!1:/maybe|probably/i.test(Ue.createElement("video").canPlayType("application/dash+xml"))}(),Zt.supportsTypeNatively=i=>i==="hls"?Zt.supportsNativeHls:i==="dash"?Zt.supportsNativeDash:!1,Zt.isSupported=function(){return pe.log.warn("VHS is no longer a tech. Please remove it from your player's techOrder.")},Zt.xhr.onRequest=function(i){E_(Zt.xhr,i)},Zt.xhr.onResponse=function(i){w_(Zt.xhr,i)},Zt.xhr.offRequest=function(i){D_(Zt.xhr,i)},Zt.xhr.offResponse=function(i){A_(Zt.xhr,i)};const FN=pe.getComponent("Component");class I_ extends FN{constructor(e,t,n){if(super(t,n.vhs),typeof n.initialBandwidth=="number"&&(this.options_.bandwidth=n.initialBandwidth),this.logger_=Ii("VhsHandler"),t.options_&&t.options_.playerId){const r=pe.getPlayer(t.options_.playerId);this.player_=r}if(this.tech_=t,this.source_=e,this.stats={},this.ignoreNextSeekingEvent_=!1,this.setOptions_(),this.options_.overrideNative&&t.overrideNativeAudioTracks&&t.overrideNativeVideoTracks)t.overrideNativeAudioTracks(!0),t.overrideNativeVideoTracks(!0);else if(this.options_.overrideNative&&(t.featuresNativeVideoTracks||t.featuresNativeAudioTracks))throw new Error("Overriding native VHS requires emulated tracks. See https://git.io/vMpjB");this.on(Ue,["fullscreenchange","webkitfullscreenchange","mozfullscreenchange","MSFullscreenChange"],r=>{const s=Ue.fullscreenElement||Ue.webkitFullscreenElement||Ue.mozFullScreenElement||Ue.msFullscreenElement;s&&s.contains(this.tech_.el())?this.playlistController_.fastQualityChange_():this.playlistController_.checkABR_()}),this.on(this.tech_,"seeking",function(){if(this.ignoreNextSeekingEvent_){this.ignoreNextSeekingEvent_=!1;return}this.setCurrentTime(this.tech_.currentTime())}),this.on(this.tech_,"error",function(){this.tech_.error()&&this.playlistController_&&this.playlistController_.pauseLoading()}),this.on(this.tech_,"play",this.play)}setOptions_(e={}){if(this.options_=It(this.options_,e),this.options_.withCredentials=this.options_.withCredentials||!1,this.options_.limitRenditionByPlayerDimensions=this.options_.limitRenditionByPlayerDimensions!==!1,this.options_.useDevicePixelRatio=this.options_.useDevicePixelRatio||!1,this.options_.usePlayerObjectFit=this.options_.usePlayerObjectFit||!1,this.options_.useBandwidthFromLocalStorage=typeof this.source_.useBandwidthFromLocalStorage<"u"?this.source_.useBandwidthFromLocalStorage:this.options_.useBandwidthFromLocalStorage||!1,this.options_.useForcedSubtitles=this.options_.useForcedSubtitles||!1,this.options_.useNetworkInformationApi=typeof this.options_.useNetworkInformationApi<"u"?this.options_.useNetworkInformationApi:!0,this.options_.useDtsForTimestampOffset=this.options_.useDtsForTimestampOffset||!1,this.options_.customTagParsers=this.options_.customTagParsers||[],this.options_.customTagMappers=this.options_.customTagMappers||[],this.options_.cacheEncryptionKeys=this.options_.cacheEncryptionKeys||!1,this.options_.llhls=this.options_.llhls!==!1,this.options_.bufferBasedABR=this.options_.bufferBasedABR||!1,typeof this.options_.playlistExclusionDuration!="number"&&(this.options_.playlistExclusionDuration=60),typeof this.options_.bandwidth!="number"&&this.options_.useBandwidthFromLocalStorage){const n=x_();n&&n.bandwidth&&(this.options_.bandwidth=n.bandwidth,this.tech_.trigger({type:"usage",name:"vhs-bandwidth-from-local-storage"})),n&&n.throughput&&(this.options_.throughput=n.throughput,this.tech_.trigger({type:"usage",name:"vhs-throughput-from-local-storage"}))}typeof this.options_.bandwidth!="number"&&(this.options_.bandwidth=Sn.INITIAL_BANDWIDTH),this.options_.enableLowInitialPlaylist=this.options_.enableLowInitialPlaylist&&this.options_.bandwidth===Sn.INITIAL_BANDWIDTH,["withCredentials","useDevicePixelRatio","usePlayerObjectFit","customPixelRatio","limitRenditionByPlayerDimensions","bandwidth","customTagParsers","customTagMappers","cacheEncryptionKeys","playlistSelector","initialPlaylistSelector","bufferBasedABR","liveRangeSafeTimeDelta","llhls","useForcedSubtitles","useNetworkInformationApi","useDtsForTimestampOffset","exactManifestTimings","leastPixelDiffSelector"].forEach(n=>{typeof this.source_[n]<"u"&&(this.options_[n]=this.source_[n])}),this.limitRenditionByPlayerDimensions=this.options_.limitRenditionByPlayerDimensions,this.useDevicePixelRatio=this.options_.useDevicePixelRatio,this.usePlayerObjectFit=this.options_.usePlayerObjectFit;const t=this.options_.customPixelRatio;typeof t=="number"&&t>=0&&(this.customPixelRatio=t)}setOptions(e={}){this.setOptions_(e)}src(e,t){if(!e)return;this.setOptions_(),this.options_.src=UN(this.source_.src),this.options_.tech=this.tech_,this.options_.externVhs=Zt,this.options_.sourceType=Fy(t),this.options_.seekTo=s=>{this.tech_.setCurrentTime(s)},this.options_.player_=this.player_,this.playlistController_=new kN(this.options_);const n=It({liveRangeSafeTimeDelta:dr},this.options_,{seekable:()=>this.seekable(),media:()=>this.playlistController_.media(),playlistController:this.playlistController_});this.playbackWatcher_=new xN(n),this.attachStreamingEventListeners_(),this.playlistController_.on("error",()=>{const s=pe.players[this.tech_.options_.playerId];let a=this.playlistController_.error;typeof a=="object"&&!a.code?a.code=3:typeof a=="string"&&(a={message:a,code:3}),s.error(a)});const r=this.options_.bufferBasedABR?Zt.movingAverageBandwidthSelector(.55):Zt.STANDARD_PLAYLIST_SELECTOR;this.playlistController_.selectPlaylist=this.selectPlaylist?this.selectPlaylist.bind(this):r.bind(this),this.playlistController_.selectInitialPlaylist=Zt.INITIAL_PLAYLIST_SELECTOR.bind(this),this.playlists=this.playlistController_.mainPlaylistLoader_,this.mediaSource=this.playlistController_.mediaSource,Object.defineProperties(this,{selectPlaylist:{get(){return this.playlistController_.selectPlaylist},set(s){this.playlistController_.selectPlaylist=s.bind(this)}},throughput:{get(){return this.playlistController_.mainSegmentLoader_.throughput.rate},set(s){this.playlistController_.mainSegmentLoader_.throughput.rate=s,this.playlistController_.mainSegmentLoader_.throughput.count=1}},bandwidth:{get(){let s=this.playlistController_.mainSegmentLoader_.bandwidth;const a=te.navigator.connection||te.navigator.mozConnection||te.navigator.webkitConnection,o=1e7;if(this.options_.useNetworkInformationApi&&a){const c=a.downlink*1e3*1e3;c>=o&&s>=o?s=Math.max(s,c):s=c}return s},set(s){this.playlistController_.mainSegmentLoader_.bandwidth=s,this.playlistController_.mainSegmentLoader_.throughput={rate:0,count:0}}},systemBandwidth:{get(){const s=1/(this.bandwidth||1);let a;return this.throughput>0?a=1/this.throughput:a=0,Math.floor(1/(s+a))},set(){pe.log.error('The "systemBandwidth" property is read-only')}}}),this.options_.bandwidth&&(this.bandwidth=this.options_.bandwidth),this.options_.throughput&&(this.throughput=this.options_.throughput),Object.defineProperties(this.stats,{bandwidth:{get:()=>this.bandwidth||0,enumerable:!0},mediaRequests:{get:()=>this.playlistController_.mediaRequests_()||0,enumerable:!0},mediaRequestsAborted:{get:()=>this.playlistController_.mediaRequestsAborted_()||0,enumerable:!0},mediaRequestsTimedout:{get:()=>this.playlistController_.mediaRequestsTimedout_()||0,enumerable:!0},mediaRequestsErrored:{get:()=>this.playlistController_.mediaRequestsErrored_()||0,enumerable:!0},mediaTransferDuration:{get:()=>this.playlistController_.mediaTransferDuration_()||0,enumerable:!0},mediaBytesTransferred:{get:()=>this.playlistController_.mediaBytesTransferred_()||0,enumerable:!0},mediaSecondsLoaded:{get:()=>this.playlistController_.mediaSecondsLoaded_()||0,enumerable:!0},mediaAppends:{get:()=>this.playlistController_.mediaAppends_()||0,enumerable:!0},mainAppendsToLoadedData:{get:()=>this.playlistController_.mainAppendsToLoadedData_()||0,enumerable:!0},audioAppendsToLoadedData:{get:()=>this.playlistController_.audioAppendsToLoadedData_()||0,enumerable:!0},appendsToLoadedData:{get:()=>this.playlistController_.appendsToLoadedData_()||0,enumerable:!0},timeToLoadedData:{get:()=>this.playlistController_.timeToLoadedData_()||0,enumerable:!0},buffered:{get:()=>qs(this.tech_.buffered()),enumerable:!0},currentTime:{get:()=>this.tech_.currentTime(),enumerable:!0},currentSource:{get:()=>this.tech_.currentSource_,enumerable:!0},currentTech:{get:()=>this.tech_.name_,enumerable:!0},duration:{get:()=>this.tech_.duration(),enumerable:!0},main:{get:()=>this.playlists.main,enumerable:!0},playerDimensions:{get:()=>this.tech_.currentDimensions(),enumerable:!0},seekable:{get:()=>qs(this.tech_.seekable()),enumerable:!0},timestamp:{get:()=>Date.now(),enumerable:!0},videoPlaybackQuality:{get:()=>this.tech_.getVideoPlaybackQuality(),enumerable:!0}}),this.tech_.one("canplay",this.playlistController_.setupFirstPlay.bind(this.playlistController_)),this.tech_.on("bandwidthupdate",()=>{this.options_.useBandwidthFromLocalStorage&&BN({bandwidth:this.bandwidth,throughput:Math.round(this.throughput)})}),this.playlistController_.on("selectedinitialmedia",()=>{CN(this)}),this.playlistController_.sourceUpdater_.on("createdsourcebuffers",()=>{this.setupEme_()}),this.on(this.playlistController_,"progress",function(){this.tech_.trigger("progress")}),this.on(this.playlistController_,"firstplay",function(){this.ignoreNextSeekingEvent_=!0}),this.setupQualityLevels_(),this.tech_.el()&&(this.mediaSourceUrl_=te.URL.createObjectURL(this.playlistController_.mediaSource),(pe.browser.IS_ANY_SAFARI||pe.browser.IS_IOS)&&this.options_.overrideNative&&this.options_.sourceType==="hls"&&typeof this.tech_.addSourceElement=="function"?(this.tech_.addSourceElement(this.mediaSourceUrl_),this.tech_.addSourceElement(this.source_.src)):this.tech_.src(this.mediaSourceUrl_))}createKeySessions_(){const e=this.playlistController_.mediaTypes_.AUDIO.activePlaylistLoader;this.logger_("waiting for EME key session creation"),RN({player:this.player_,sourceKeySystems:this.source_.keySystems,audioMedia:e&&e.media(),mainPlaylists:this.playlists.main.playlists}).then(()=>{this.logger_("created EME key session"),this.playlistController_.sourceUpdater_.initializedEme()}).catch(t=>{this.logger_("error while creating EME key session",t),this.player_.error({message:"Failed to initialize media keys for EME",code:3})})}handleWaitingForKey_(){this.logger_("waitingforkey fired, attempting to create any new key sessions"),this.createKeySessions_()}setupEme_(){const e=this.playlistController_.mediaTypes_.AUDIO.activePlaylistLoader,t=LN({player:this.player_,sourceKeySystems:this.source_.keySystems,media:this.playlists.media(),audioMedia:e&&e.media()});if(this.player_.tech_.on("keystatuschange",n=>{this.playlistController_.updatePlaylistByKeyStatus(n.keyId,n.status)}),this.handleWaitingForKey_=this.handleWaitingForKey_.bind(this),this.player_.tech_.on("waitingforkey",this.handleWaitingForKey_),!t){this.playlistController_.sourceUpdater_.initializedEme();return}this.createKeySessions_()}setupQualityLevels_(){const e=pe.players[this.tech_.options_.playerId];!e||!e.qualityLevels||this.qualityLevels_||(this.qualityLevels_=e.qualityLevels(),this.playlistController_.on("selectedinitialmedia",()=>{NN(this.qualityLevels_,this)}),this.playlists.on("mediachange",()=>{C_(this.qualityLevels_,this.playlists)}))}static version(){return{"@videojs/http-streaming":T_,"mux.js":DN,"mpd-parser":AN,"m3u8-parser":IN,"aes-decrypter":PN}}version(){return this.constructor.version()}canChangeType(){return u_.canChangeType()}play(){this.playlistController_.play()}setCurrentTime(e){this.playlistController_.setCurrentTime(e)}duration(){return this.playlistController_.duration()}seekable(){return this.playlistController_.seekable()}dispose(){this.playbackWatcher_&&this.playbackWatcher_.dispose(),this.playlistController_&&this.playlistController_.dispose(),this.qualityLevels_&&this.qualityLevels_.dispose(),this.tech_&&this.tech_.vhs&&delete this.tech_.vhs,this.mediaSourceUrl_&&te.URL.revokeObjectURL&&(te.URL.revokeObjectURL(this.mediaSourceUrl_),this.mediaSourceUrl_=null),this.tech_&&this.tech_.off("waitingforkey",this.handleWaitingForKey_),super.dispose()}convertToProgramTime(e,t){return qI({playlist:this.playlistController_.media(),time:e,callback:t})}seekToProgramTime(e,t,n=!0,r=2){return L2({programTime:e,playlist:this.playlistController_.media(),retryCount:r,pauseAfterSeek:n,seekTo:this.options_.seekTo,tech:this.options_.tech,callback:t})}setupXhrHooks_(){this.xhr.onRequest=e=>{E_(this.xhr,e)},this.xhr.onResponse=e=>{w_(this.xhr,e)},this.xhr.offRequest=e=>{D_(this.xhr,e)},this.xhr.offResponse=e=>{A_(this.xhr,e)},this.player_.trigger("xhr-hooks-ready")}attachStreamingEventListeners_(){const e=["seekablerangeschanged","bufferedrangeschanged","contentsteeringloadstart","contentsteeringloadcomplete","contentsteeringparsed"],t=["gapjumped","playedrangeschanged"];e.forEach(n=>{this.playlistController_.on(n,r=>{this.player_.trigger(dn({},r))})}),t.forEach(n=>{this.playbackWatcher_.on(n,r=>{this.player_.trigger(dn({},r))})})}}const Gu={name:"videojs-http-streaming",VERSION:T_,canHandleSource(i,e={}){const t=It(pe.options,e);return!t.vhs.experimentalUseMMS&&!Zo("avc1.4d400d,mp4a.40.2",!1)?!1:Gu.canPlayType(i.type,t)},handleSource(i,e,t={}){const n=It(pe.options,t);return e.vhs=new I_(i,e,n),e.vhs.xhr=P2(),e.vhs.setupXhrHooks_(),e.vhs.src(i.src,i.type),e.vhs},canPlayType(i,e){const t=Fy(i);if(!t)return"";const n=Gu.getOverrideNative(e);return!Zt.supportsTypeNatively(t)||n?"maybe":""},getOverrideNative(i={}){const{vhs:e={}}=i,t=!(pe.browser.IS_ANY_SAFARI||pe.browser.IS_IOS),{overrideNative:n=t}=e;return n}};Zo("avc1.4d400d,mp4a.40.2",!0)&&pe.getTech("Html5").registerSourceHandler(Gu,0),pe.VhsHandler=I_,pe.VhsSourceHandler=Gu,pe.Vhs=Zt,pe.use||pe.registerComponent("Vhs",Zt),pe.options.vhs=pe.options.vhs||{},(!pe.getPlugin||!pe.getPlugin("reloadSourceOnError"))&&pe.registerPlugin("reloadSourceOnError",wN);class VN{constructor(){this.isInitialized=!1,this.pollingInterval=null,this.currentPollingIndex=0,this.pollingParticipants=[],this.ctx=null,this.pollingDisabled=!1,this.voiceActivatedIdentity=null,this.voiceActivatedParticipant=null}init(e){this.isInitialized||(this.ctx=Object.assign({getParticipants:()=>[],getCurrentLayout:()=>"grid",getCurrentRoomMode:()=>"normal",pollingIntervalMs:null},e||{}),this.isInitialized=!0,this._setupMittListeners())}destroy(){this.stopScreenPolling(),this.isInitialized=!1,this.ctx=null}getMaxVisibleParticipantsByLayout(){var n,r,s,a;const e=((r=(n=this.ctx)==null?void 0:n.getCurrentLayout)==null?void 0:r.call(n))||"grid";return(((a=(s=this.ctx)==null?void 0:s.getCurrentRoomMode)==null?void 0:a.call(s))||"normal")==="pointTurn"?10:e==="rightSide"?5:e==="grid"?16:4}shouldStartPolling(){var s,a,o,c,u,d,h;const e=((a=(s=this.ctx)==null?void 0:s.getParticipants)==null?void 0:a.call(s))||[],t=((c=(o=this.ctx)==null?void 0:o.getCurrentLayout)==null?void 0:c.call(o))||"grid",n=((d=(u=this.ctx)==null?void 0:u.getCurrentRoomMode)==null?void 0:d.call(u))||"normal",r=(h=this.ctx)==null?void 0:h.pollingIntervalMs;return this.pollingDisabled||!r||r<=0?!1:n==="pointTurn"?e.length>11:t==="rightSide"?e.length>5:e.length>4}adjustPollingState(){if(!this.isInitialized)return;if(this.pollingDisabled){this.stopScreenPolling();return}const e=this.shouldStartPolling(),t=!!this.pollingInterval;e&&!t?this.startScreenPolling():!e&&t&&this.stopScreenPolling()}startScreenPolling(){if(!this.isInitialized||this.pollingInterval||!this.shouldStartPolling())return;this.currentPollingIndex=0,this.pollingParticipants=[];const e=this.ctx.pollingIntervalMs;if(!e||e<=0){console.warn("轮询间隔未设置或无效,无法启动轮询");return}this.executeScreenPolling(),this.pollingInterval=setInterval(()=>{this.executeScreenPolling()},e),setTimeout(()=>{this.pollingInterval&&this.executeScreenPolling()},100)}stopScreenPolling(){this.pollingInterval&&(clearInterval(this.pollingInterval),this.pollingInterval=null),this.currentPollingIndex=0,this.pollingParticipants=[]}executeScreenPolling(){var t,n,r,s;if(!this.isInitialized||!this.shouldStartPolling())return;const e=((n=(t=this.ctx)==null?void 0:t.getCurrentRoomMode)==null?void 0:n.call(t))||"normal";if((s=(r=this.ctx)==null?void 0:r.getCurrentLayout)!=null&&s.call(r),e==="pointTurn"){this.executePointTurnPolling();return}this.updatePollingIndex(),this.emitScreenPollingEvent()}executePointTurnPolling(){var a,o,c,u;const e=((o=(a=this.ctx)==null?void 0:a.getParticipants)==null?void 0:o.call(a))||[],t=10;let n=null;try{n=((u=(c=this.ctx)==null?void 0:c.getHostIdentity)==null?void 0:u.call(c))||null}catch{n=null}let r=[...e];if(n){const d=r.findIndex(h=>h&&h.identity===n);d!==-1&&r.splice(d,1)}if(r.length<=t){this.stopScreenPolling(),this.emitPointTurnPollingEvent(r.slice(0,t));return}this.currentPollingIndex=this.currentPollingIndex%r.length;const s=[];for(let d=0;d<t;d++){const h=(this.currentPollingIndex+d)%r.length;s.push(r[h])}this.emitPointTurnPollingEvent(s),this.currentPollingIndex=(this.currentPollingIndex+5)%r.length}updatePollingIndex(){var a,o,c,u,d,h,b,v;const e=((o=(a=this.ctx)==null?void 0:a.getParticipants)==null?void 0:o.call(a))||[],t=e.length;if(t===0)return;const n=this.getMaxVisibleParticipantsByLayout(),r=((u=(c=this.ctx)==null?void 0:c.getCurrentLayout)==null?void 0:u.call(c))||"grid",s=((h=(d=this.ctx)==null?void 0:d.getCurrentRoomMode)==null?void 0:h.call(d))||"normal";if(t<=n){this.currentPollingIndex=0;return}if(r==="rightSide"&&s==="normal"){let y=null;try{y=((v=(b=this.ctx)==null?void 0:b.getHostIdentity)==null?void 0:v.call(b))||null}catch{y=null}const p=this.voiceActivatedParticipant&&this.voiceActivatedParticipant.identity||this.voiceActivatedIdentity;let f=!1;if(y&&e.find(m=>m&&m.identity===y)&&(f=!0),!f&&p&&e.find(m=>m&&m.identity===p)&&(f=!0),f){const m=Math.max(t-1,1);this.currentPollingIndex=(this.currentPollingIndex+1)%m}else{const m=Math.max(t,1);this.currentPollingIndex=(this.currentPollingIndex+1)%m}}else{const y=Math.max(t-n,1);this.currentPollingIndex=(this.currentPollingIndex+1)%y}}getPollingParticipants(){var c,u,d,h,b,v;const e=[...((u=(c=this.ctx)==null?void 0:c.getParticipants)==null?void 0:u.call(c))||[]],t=this.getMaxVisibleParticipantsByLayout(),n=((h=(d=this.ctx)==null?void 0:d.getCurrentLayout)==null?void 0:h.call(d))||"grid",r=((v=(b=this.ctx)==null?void 0:b.getCurrentRoomMode)==null?void 0:v.call(b))||"normal",s=this.currentPollingIndex,a=[];if(this.shouldStartPolling())if(n==="rightSide"&&r==="normal")a.push(...this._getRightSidePollingParticipants(e,t,s));else for(let y=0;y<t&&y<e.length;y++)a.push(e[(s+y)%e.length]);else for(let y=0;y<t&&y<e.length;y++)a.push(e[y]);const o=this.voiceActivatedParticipant&&this.voiceActivatedParticipant.identity||this.voiceActivatedIdentity;if(o){const y=a.findIndex(p=>p&&p.identity===o);if(y>0){const[p]=a.splice(y,1);a.unshift(p)}}return a}_getRightSidePollingParticipants(e,t,n){var b,v;const r=[];let s=null;try{s=((v=(b=this.ctx)==null?void 0:b.getHostIdentity)==null?void 0:v.call(b))||null}catch{s=null}const a=this.voiceActivatedParticipant&&this.voiceActivatedParticipant.identity||this.voiceActivatedIdentity;let o=null,c=!1;if(s){const y=e.find(p=>p&&p.identity===s);y&&(o=y,c=!0)}if(!c&&a){const y=e.find(p=>p&&p.identity===a);y&&(o=y,c=!0)}if(!o){const y=n%e.length;o=e[y]}o&&r.push(o);const u=new Set;o&&u.add(o.identity);let d=1,h=n;for(;d<t&&d<e.length;){const y=e[h%e.length];if(y&&!u.has(y.identity)&&(r.push(y),u.add(y.identity),d++),h++,h-n>=e.length)break}return r}_setupMittListeners(){try{typeof ut<"u"&&ut&&(ut.on("voiceActivated",e=>{if(e){typeof e=="string"?(this.voiceActivatedIdentity=e,this.voiceActivatedParticipant=null):typeof e=="object"&&(this.voiceActivatedParticipant=e,this.voiceActivatedIdentity=e.identity||null);try{const t=this.getPollingParticipants();ut.emit("updateVisibleParticipants",{participants:t,currentIndex:this.currentPollingIndex,isPolling:!!this.pollingInterval,action:"replace"})}catch(t){console.warn("同步语音激励到可见列表失败",t)}}}),ut.on("setPollingEnabled",e=>{this.setPollingEnabled(!!e)}))}catch(e){console.warn("autoPolling mitt listeners setup failed",e)}}emitScreenPollingEvent(){const e=this.getPollingParticipants();ut.emit("screenPolling",{timestamp:Date.now(),currentIndex:this.currentPollingIndex,participants:this.pollingParticipants,visibleParticipants:e,interval:this.ctx.pollingIntervalMs}),ut.emit("updateVisibleParticipants",{participants:e,currentIndex:this.currentPollingIndex,isPolling:!0,action:"replace"})}emitPointTurnPollingEvent(e){ut.emit("pointTurnPolling",{timestamp:Date.now(),currentIndex:this.currentPollingIndex,participants:e,interval:this.ctx.pollingIntervalMs})}setPollingInterval(e){this.ctx&&(this.ctx.pollingIntervalMs=e,!this.pollingDisabled&&this.pollingInterval&&(this.stopScreenPolling(),this.startScreenPolling()))}setPollingEnabled(e){this.pollingDisabled=!e,e?(this.adjustPollingState(),this.pollingInterval&&this.shouldStartPolling()&&setTimeout(()=>{this.executeScreenPolling()},50)):this.stopScreenPolling()}setVoiceActivatedIdentity(e){this.voiceActivatedIdentity=e||null}getPollingStatus(){var e;return{isActive:!!this.pollingInterval,currentIndex:this.currentPollingIndex,interval:(e=this.ctx)==null?void 0:e.pollingIntervalMs}}}const Cl=new VN,jN=i=>Cl.init(i),$N=()=>Cl.stopScreenPolling(),xl=()=>Cl.adjustPollingState(),P_=i=>Cl.setPollingInterval(i),Wu=i=>Cl.setPollingEnabled(i),N_="/assets/img/point/close_icon.png",HN="/assets/img/point/clear_icon.png",Bt=(i,e)=>{const t=i.__vccOpts||i;for(const[n,r]of e)t[n]=r;return t},Ku=i=>(l.pushScopeId("data-v-d6406cb6"),i=i(),l.popScopeId(),i),qN={class:"live-call-board"},zN={class:"live-call-board-title"},GN=Ku(()=>l.createElementVNode("span",null,"拨号盘",-1)),WN={class:"live-call-board-list"},KN=["onClick"],XN={class:"live-call-board-foot"},YN=[Ku(()=>l.createElementVNode("div",{class:"btn-icon"},null,-1))],JN=[Ku(()=>l.createElementVNode("div",{class:"btn-icon"},null,-1))],QN=[Ku(()=>l.createElementVNode("div",{class:"btn-icon"},null,-1))],El=Bt({__name:"LiveCallBoard",props:{defaultCallNum:{type:String,default:""},defaultCallingMethod:{type:Array,default:()=>["voice","video","mini"]}},emits:["callBoardClose","voiceCall","videoCall","miniCall"],setup(i,{emit:e}){const t=new _n,n=i,r=l.ref(""),s=e;function a(b){return/^[\d#*]+$/.test(b)}function o(b){r.value+=b}function c(){r.value?a(r.value)?(s("voiceCall",r.value),s("callBoardClose")):t.message("error","手机号中包含不合法字符"):t.message("error","联系方式不能为空")}function u(){r.value?a(r.value)?(s("videoCall",r.value),s("callBoardClose")):t.message("error","手机号中包含不合法字符"):t.message("error","联系方式不能为空")}function d(){r.value?a(r.value)?(s("miniCall",r.value),s("callBoardClose")):t.message("error","手机号中包含不合法字符"):t.message("error",{message:"联系方式不能为空"})}function h(){r.value.length>0&&(r.value=r.value.substring(0,r.value.length-1))}return l.onMounted(()=>{r.value=n.defaultCallNum}),(b,v)=>{const y=l.resolveComponent("el-input");return l.openBlock(),l.createElementBlock("div",qN,[l.createElementVNode("div",zN,[GN,l.createElementVNode("img",{class:"title-close-icon",src:N_,alt:"",onClick:v[0]||(v[0]=p=>b.$emit("callBoardClose"))})]),l.createVNode(y,{modelValue:r.value,"onUpdate:modelValue":v[1]||(v[1]=p=>r.value=p),type:"mobile",placeholder:"请输入号码",disabled:"",clearable:""},{suffix:l.withCtx(()=>[l.createElementVNode("img",{class:"del-icon",src:HN,alt:"",onClick:h})]),_:1},8,["modelValue"]),l.createElementVNode("div",WN,[(l.openBlock(),l.createElementBlock(l.Fragment,null,l.renderList("123456789*0#",(p,f)=>l.createElementVNode("div",{class:"live-call-board-list-item",key:f,onClick:m=>o(p)},l.toDisplayString(p),9,KN)),64))]),l.createElementVNode("div",XN,[i.defaultCallingMethod.includes("voice")?(l.openBlock(),l.createElementBlock("div",{key:0,class:"live-call-board-foot-btn voice-btn",onClick:c},YN)):l.createCommentVNode("",!0),i.defaultCallingMethod.includes("video")?(l.openBlock(),l.createElementBlock("div",{key:1,class:"live-call-board-foot-btn video-btn",onClick:u},JN)):l.createCommentVNode("",!0),i.defaultCallingMethod.includes("mini")?(l.openBlock(),l.createElementBlock("div",{key:2,class:"live-call-board-foot-btn mini-btn",onClick:d},QN)):l.createCommentVNode("",!0)])])}}},[["__scopeId","data-v-d6406cb6"]]),ZN="/assets/img/point/hang_on_icon.png",e7="/assets/img/point/hang_off_icon.png",Xu=i=>(l.pushScopeId("data-v-380eda98"),i=i(),l.popScopeId(),i),t7={class:"receive-board"},n7={class:"receive-board-title"},i7={class:"receive-board-msg"},r7=[Xu(()=>l.createElementVNode("img",{class:"btn-icon",src:ZN,alt:""},null,-1)),Xu(()=>l.createElementVNode("span",null,"接听",-1))],s7=[Xu(()=>l.createElementVNode("img",{class:"btn-icon",src:e7,alt:""},null,-1)),Xu(()=>l.createElementVNode("span",null,"挂断",-1))],a7=Bt({__name:"LiveInviteReceive",props:{meetingType:{type:String,default:"video"},inviteData:{type:Object,default:()=>{}}},emits:["receiveBoardClose","acceptInviteCall","refuseInviteCall"],setup(i,{emit:e}){const t=i,n=e;function r(){n("acceptInviteCall",{roomNum:t.inviteData.roomNum,fromIdentity:t.inviteData.fromIdentity,fromOrg:t.inviteData.fromOrg,meetingType:t.meetingType})}function s(){n("refuseInviteCall",{roomNum:t.inviteData.roomNum,fromIdentity:t.inviteData.fromIdentity,fromOrg:t.inviteData.fromOrg,meetingType:t.meetingType})}return(a,o)=>{var c;return l.openBlock(),l.createElementBlock("div",t7,[l.createElementVNode("div",n7,[l.createElementVNode("span",null,l.toDisplayString(i.meetingType==="voice"?"语音呼叫":"视频呼叫"),1),l.createElementVNode("img",{class:"title-close-icon",src:N_,alt:"",onClick:o[0]||(o[0]=u=>a.$emit("receiveBoardClose"))})]),l.createElementVNode("div",i7,[l.createElementVNode("img",{class:l.normalizeClass(["receive-type-icon",i.meetingType==="voice"?"receive-type-icon-voice":"receive-type-icon-video"]),src:"",alt:""},null,2),l.createElementVNode("span",null,l.toDisplayString(`【${((c=i.inviteData)==null?void 0:c.fromIdentity)??"会议发起人"}】邀请您进行${i.meetingType==="voice"?"语音":"视频"}通话`),1)]),l.createElementVNode("div",{class:"receive-board-foot"},[l.createElementVNode("div",{class:"receive-board-foot-btn accept-btn",onClick:r},r7),l.createElementVNode("div",{class:"receive-board-foot-btn refuse-btn",onClick:s},s7)])])}}},[["__scopeId","data-v-380eda98"]]),Dn=i=>(l.pushScopeId("data-v-0afc60d4"),i=i(),l.popScopeId(),i),o7={class:"point-meeting-top"},l7={class:"top-group"},c7=Dn(()=>l.createElementVNode("div",{class:"duration-icon"},null,-1)),u7={class:"point-meeting-wrapper"},d7={key:0,class:"waiting-mask-video"},h7=[Dn(()=>l.createElementVNode("div",{class:"icon"},null,-1)),Dn(()=>l.createElementVNode("div",{class:"title"},"麦克风",-1))],f7=[Dn(()=>l.createElementVNode("div",{class:"icon"},null,-1)),Dn(()=>l.createElementVNode("div",{class:"title"},"麦克风",-1))],p7=[Dn(()=>l.createElementVNode("div",{class:"icon"},null,-1)),Dn(()=>l.createElementVNode("div",{class:"title"},"摄像头",-1))],m7=[Dn(()=>l.createElementVNode("div",{class:"icon"},null,-1)),Dn(()=>l.createElementVNode("div",{class:"title"},"摄像头",-1))],g7=[Dn(()=>l.createElementVNode("div",{class:"icon"},null,-1)),Dn(()=>l.createElementVNode("div",{class:"title"},"扬声器",-1))],v7=[Dn(()=>l.createElementVNode("div",{class:"icon"},null,-1)),Dn(()=>l.createElementVNode("div",{class:"title"},"扬声器",-1))],y7=Dn(()=>l.createElementVNode("div",{class:"icon"},null,-1)),b7={class:"title"},_7=Dn(()=>l.createElementVNode("div",{class:"icon"},null,-1)),k7={class:"title"},T7=[Dn(()=>l.createElementVNode("div",{class:"icon"},null,-1)),Dn(()=>l.createElementVNode("div",{class:"title"},"结束通话",-1))],wl=Bt({__name:"LivePointMeeting",props:{joinType:{type:String,default:"join"},meetingNum:{type:String,default:""},meetingType:{type:String,default:"video"},invitePhone:{type:String,default:""},isDraggable:{type:Boolean,default:!1},inviteWays:{type:String,default:"phoneCall"},inviteIdentity:{type:String,default:""}},emits:["meetingStarted","miniLinkSend","meetingEnded","meetingDialogClose"],setup(i,{emit:e}){const t=new _n;let n=null,r=null,s=null;const a=i,o=e,c=l.ref(),u=l.ref(""),d=l.ref(""),h=l.ref(""),b=l.ref(null),v=l.ref([]);l.ref([]);const y=l.ref([]),p=l.ref(!1),f=l.ref(!1),m=l.ref(!1),_=l.ref(!1),k=l.ref(!0),D=l.ref(!1),w=l.ref(!1),A=l.ref(0),x=l.ref(!0),P=l.ref(!1),S=l.ref(3),M=l.computed(()=>y.value.length),U=l.computed(()=>Zg(A.value)),B={mounted:(le,ze)=>{ze.value&&(le.style.cursor="move",le.onmousedown=oe=>{oe.stopPropagation(),oe.preventDefault();const de=document.getElementById("point-meeting"),Le=/^matrix3d\((?:[-\d.]+,\s*){12}([-\d.]+),\s*([-\d.]+)(?:,\s*[-\d.]+){2}\)/,Ve=/^matrix\((?:[-\d.]+,\s*){4}([-\d.]+),\s*([-\d.]+)\)$/;let Ke=vx(de,"transform"),Ge=Ke.match(Le)||Ke.match(Ve),ke=oe.clientX,$e=oe.clientY,_e=Ge[1],Re=Ge[2],Ie=ke-_e,it=$e-Re;le.onmousemove=function(_t){_t.stopPropagation(),_t.preventDefault();let Ot=_t.clientX-Ie,Hn=_t.clientY-it;de.style.transform=`translate(${Ot}px, ${Hn}px)`},le.onmouseup=function(_t){le.onmousemove=null,le.onmouseup=null},window.onmouseup=function(_t){le.onmousemove=null,le.onmouseup=null}})}};l.watch(()=>S.value,le=>{le<=0&&(P.value=!1,r&&clearInterval(r))});async function Q(){s&&await s.createRoom()}async function ie(){if(!s)return;const le={echoCancellation:!0,noiseSuppression:!0,roomNum:a.joinType==="launch"?h.value:a.meetingNum};try{await s.joinRoom(le)}catch{t.message("error","加入会议失败")}}function Y(le){v.value.indexOf(le)<0&&v.value.push(le)}function q(){s&&v.value.length>0&&v.value.forEach(le=>{s.off(le)})}function L(){n&&(clearInterval(n),n=null)}async function $(){await s.changeCameraStatus()}async function H(){await s.changeMicrophoneStatus()}async function j(){await s.changeScreenShareStatus()}async function W(){await s.setParticipantDeafness(u.value)}async function ae(){await s.cancelParticipantDeafness(u.value)}function Ee(le){S.value=le,P.value=!0,r&&clearInterval(r),r=setInterval(()=>{S.value>0&&S.value--},1e3)}function Ae(){if(!D.value)return;const le=document.querySelector("#point-meeting-contain .layout-blur"),ze=document.querySelector("#point-meeting-contain .layout-normal");if(k.value){if(le.hasChildNodes){const oe=le.firstElementChild;if(oe.id===`participant-${u.value}`)le.style.visibility="hidden",k.value=!1;else if(ze.hasChildNodes){const de=ze.firstElementChild;le.appendChild(de),ze.appendChild(oe),le.style.visibility="hidden",k.value=!1}else ze.appendChild(oe),le.style.visibility="hidden",k.value=!1}}else if(_.value){t.message("error","当前正在共享屏幕,无法开启预览");return}else le.style.visibility="visible",k.value=!0}function ee(){if(!s){t.message("error","liveClient未能成功初始化");return}s.on("errorPush",le=>{Y("errorPush"),console.error("出错位置"+le.type+":",le.message)}),s.on("roomCreatedSuccess",async le=>{Y("roomCreatedSuccess"),t.message("success","会议房间创建成功"),h.value=le,await ie()}),s.on("roomCreatedFail",le=>{Y("roomCreatedFail"),t.message("error","会议房间创建失败")}),s.on("joinRoomError",le=>{Y("joinRoomError"),console.error("加入会议失败",le),t.message("error","加入会议失败")}),s.on("roomConnected",le=>{if(Y("roomConnected"),s!=null&&s.room&&(b.value=JSON.parse(s.room.metadata),D.value=!0,o("meetingStarted"),a.joinType==="launch")){if(a.inviteWays==="phoneCall")a.meetingType==="video"||a.meetingType==="voice"?s.makeCall(a.invitePhone,a.invitePhone).then(()=>{t.message("success","外呼邀请发送成功"),w.value=!0}).catch(ze=>{t.message("error","外呼邀请发送失败"),console.error(ze)}):a.meetingType==="miniLink"&&(o("miniLinkSend",{roomNum:h.value,phone:a.invitePhone}),w.value=!0);else if(a.inviteWays==="identity"){const ze=JSON.stringify({meetingType:a.meetingType});s.inviteThirdParty(a.inviteIdentity,s.org,ze).then(()=>{t.message("success","PC邀请发送成功")}).catch(()=>{t.message("error","PC邀请发送失败")})}}}),s.on("localCameraChange",le=>{Y("localCameraChange"),f.value=le,f.value?t.message("success","摄像头已开启"):t.message("success","摄像头已关闭")}),s.on("localMicrophoneChange",le=>{Y("localMicrophoneChange"),p.value=le,p.value?t.message("success","麦克风已开启"):t.message("success","麦克风已关闭")}),s.on("localScreenShareChange",le=>{Y("localScreenShareChange"),_.value=le,_.value?t.success({messsage:"屏幕共享已开启"}):t.success({messsage:"屏幕共享已关闭"})}),s.on("videoCallRender",le=>{Y("videoCallRender"),be(le)}),s.on("audioCallRender",le=>{Y("audioCallRender"),Fe(le)}),s.on("roomDisconnected",()=>{if(Y("roomDisconnected"),t.message("info","房间链接已断开"),D.value=!1,o("meetingEnded"),s){s._eventsInitialized=!1;try{s.removeAllListeners()}catch(le){console.warn("清理liveClient事件监听器失败:",le)}}s.deleteRoom(u.value).then(()=>{L(),fe()}).catch(le=>{console.error(le),L(),fe()})})}function fe(){o("meetingDialogClose")}async function xe(){s&&await s.leaveRoom()}async function Ne(le){document.fullscreenElement||document.msFullscreenElement||document.mozFullScreenElement||document.webkitFullscreenElement?document.exitFullscreen?document.exitFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.webkitCancelFullScreen?document.webkitCancelFullScreen():document.msExitFullscreen&&document.msExitFullscreen():(await l.nextTick(),c.value.requestFullscreen&&c.value.requestFullscreen())}function He(le){if(M.value<=0)y.value.push(le);else{const ze=y.value.findIndex(oe=>oe.identity===le.identity);ze!==-1?y.value.splice(ze,1,le):y.value.push(le)}}function Be(le){if(!(M.value<=0)){const ze=y.value.findIndex(oe=>oe.identity===le.identity);ze!==-1&&y.value.splice(ze,1)}}function be(le){if(console.log("视频通话渲染"+le.identity+":",le),le.isLocal){const Ie=JSON.parse(le.metadata);f.value=le.isCameraEnabled,p.value=le.isMicrophoneEnabled,_.value=le.isScreenShareEnabled,m.value=!Ie.isDeafness,u.value=le.identity,d.value=le.name}const ze=document.getElementById("point-meeting-contain");let oe=document.getElementById(`participant-${le.identity}`),de=document.querySelector("#point-meeting-contain .layout-blur"),Le=document.querySelector("#point-meeting-contain .layout-normal");if(de||(de=document.createElement("div"),de.className="layout-blur",ze.appendChild(de)),Le||(Le=document.createElement("div"),Le.className="layout-normal",ze.insertBefore(Le,ze.firstElementChild??null)),!ze){t.message("error","会议容器不存在");return}if(!oe&&!le.remove){if(oe=document.createElement("div"),oe.id=`participant-${le.identity}`,oe.className=le.isLocal?"participant local":"participant",le.isScreenShareEnabled||le.isCameraEnabled?oe.innerHTML=`
244
+ <video id="video-${le.identity}" class="p-video" autoplay webkit-playsinline playsinline x5-video-player-type="h5"></video>
245
+ <div id="describe-${le.identity}" class="describe">
246
+ <div class="describe-left">
247
+ <div class="avatar"></div>
248
+ <div id="${le.identity}" class="identity">${le.isLocal?le.name+"(我)":le.name}</div>
249
+ </div>
250
+ <div class="tools">
251
+ <div id="microphone-${le.identity}" class="microphone"></div>
252
+ </div>
253
+ </div>
254
+ `:oe.innerHTML=`
255
+ <video id="video-${le.identity}" class="p-video" autoplay webkit-playsinline playsinline x5-video-player-type="h5"></video>
256
+ <div id="board-${le.identity}" class="board">
257
+ <div class="board-icon"></div>
258
+ <div class="board-title">
259
+ <span class="board-title-text">${le.name}</span>
260
+ <div id="microphone-${le.identity}" class="microphone"></div>
261
+ </div>
262
+ </div>
263
+ `,le.isLocal){if(de.hasChildNodes){let Ie=null;for(;Ie=de.firstElementChild;)Le.insertBefore(Ie,Le.firstElementChild??null)}de.appendChild(oe)}else{if(M.value>=2)return;if(Le.hasChildNodes){let Ie=null;for(;Ie=Le.firstElementChild;)de.appendChild(Ie)}Le.appendChild(oe)}He(le)}let Ve=document.getElementById(`video-${le.identity}`);if(le.remove){Ve&&(Ve.srcObject=null,Ve.src="",Ve.remove()),oe&&oe.remove(),Be(le),le.videoTrack&&le.videoTrack.detach(),le.audioTrack&&le.audioTrack.detach();return}a.joinType==="launch"&&!le.isLocal&&(a.meetingType==="miniLink"?le.isLocal||(w.value=!1):!le.isLocal&&(le!=null&&le.audioTrack)&&(w.value=!1));let Ke=document.getElementById(`describe-${le.identity}`),Ge=document.getElementById(`board-${le.identity}`),ke=document.getElementById(`microphone-${le.identity}`);const $e=()=>{s.changeParticipantMicrophoneStatus(le.identity,!0)},_e=()=>{s.changeParticipantMicrophoneStatus(le.identity,!1)},Re=()=>{if(!k.value)return;let Ie=document.querySelector("#point-meeting-contain .layout-blur"),it=document.querySelector("#point-meeting-contain .layout-normal"),_t=Ie.firstElementChild,Ot=document.getElementById(`participant-${le.identity}`);if(_t){if(_t.id===`participant-${le.identity}`)return;it.insertBefore(_t,it.firstChild??null),Ot&&Ie.appendChild(Ot)}else Ie.appendChild(Ot)};oe&&(oe.onclick=Re),le.isScreenShareEnabled||le.isCameraEnabled?(Ge&&(oe.removeChild(Ge),Ge=null),Ke||(Ke=document.createElement("div"),Ke.className="describe",Ke.id=`describe-${le.identity}`,Ke.innerHTML=`
264
+ <div class="describe-left">
265
+ <div class="avatar"></div>
266
+ <div id="${le.identity}" class="identity">${le.isLocal?le.name+"(我)":le.name}</div>
267
+ </div>
268
+ <div class="tools">
269
+ <div id="microphone-${le.identity}" class="microphone"></div>
270
+ </div>
271
+ `,oe.appendChild(Ke))):(Ke&&(oe.removeChild(Ke),Ke=null),Ge||(Ge=document.createElement("div"),Ge.className="board",Ge.id=`board-${le.identity}`,Ge.innerHTML=`
272
+ <div class="board-icon"></div>
273
+ <div class="board-title">
274
+ <span class="board-title-text">${le.name}</span>
275
+ <div id="microphone-${le.identity}" class="microphone"></div>
276
+ </div>
277
+ `,Ge&&oe.appendChild(Ge))),ke=document.getElementById(`microphone-${le.identity}`),ke&&le.isMicrophoneEnabled?(ke.className="microphone microphone-active",ke.onclick=$e):ke&&!le.isMicrophoneEnabled&&(ke.className="microphone microphone-inactive",ke.onclick=_e),le.videoTrack&&le.videoTrack.attach(Ve),le.isLocal||le.audioTrack&&le.audioTrack.attach(Ve),He(le),y.value.length>=1&&(JSON.parse(s.room.metadata),x.value&&(n&&(clearInterval(n),n=null),n=setInterval(()=>{A.value++,x.value=!1},1e3)))}function Fe(le){if(console.log("语音通话渲染"+le.identity+":",le),le.isLocal){const ze=JSON.parse(le.metadata);p.value=le.isMicrophoneEnabled,m.value=!ze.isDeafness,u.value=le.identity,d.value=le.name}if(!le.isLocal){const ze=document.getElementById("point-meeting-contain");let oe=document.getElementById(`participant-${le.identity}`);if(!ze){t.message("error","会议容器不存在");return}!oe&&!le.remove&&(oe=document.createElement("div"),oe.id=`participant-${le.identity}`,oe.className=le.isLocal?"participant local":"participant",oe.innerHTML=`
278
+ <audio id="audio-${le.identity}" class="p-audio" autoplay></audio>
279
+ <div class="participant-icon"></div>
280
+ <div class="participant-title">
281
+ <span class="participant-title-text">${le.name}</span>
282
+ <div id="microphone-${le.identity}" class="microphone"></div>
283
+ </div>
284
+ `,le.isLocal?ze.insertBefore(oe,ze.firstChild??null):ze.appendChild(oe),He(le));let de=document.getElementById(`audio=${le.identity}`);le.remove&&(de&&(de.srcObject=null,de.src="",de.remove()),oe&&oe.remove(),Be(le),le.audioTrack&&le.audioTrack.detach()),a.joinType==="launch"&&le!=null&&le.audioTrack&&(w.value=!1);let Le=document.getElementById(`microphone-${le.identity}`);const Ve=()=>{s.changeParticipantMicrophoneStatus(le.identity,!0)},Ke=()=>{s.changeParticipantMicrophoneStatus(le.identity,!1)};Le&&le.isMicrophoneEnabled?(Le.className="microphone microphone-active",Le.onclick=Ve):Le&&!le.isMicrophoneEnabled&&(Le.className="microphone microphone-inactive",Le.onclick=Ke),le.audioTrack&&le.audioTrack.attach(de)}if(He(le),y.value.length>=1){const ze=JSON.parse(s.room.metadata);console.log("metadata2222:",ze),x.value&&(n&&(clearInterval(n),n=null),n=setInterval(()=>{A.value++,x.value=!1},1e3))}}return l.onMounted(()=>{s=window.liveClient,console.log("liveClient",s),ee(),a.joinType==="launch"?(a.meetingType==="video"||a.meetingType==="miniLink"?s.roomMode="auto":a.meetingType==="voice"&&(s.roomMode="audio"),Q()):(a.meetingType==="video"||a.meetingType==="miniLink"?s.roomMode="auto":a.meetingType==="voice"&&(s.roomMode="audio"),ie()),Ee(4)}),l.onBeforeUnmount(()=>{D.value&&xe(),q()}),(le,ze)=>(l.openBlock(),l.createElementBlock("div",{ref_key:"rootElm",ref:c,class:"point-meeting",id:"point-meeting",style:l.normalizeStyle({resize:i.isDraggable?"both":"none"})},[l.withDirectives((l.openBlock(),l.createElementBlock("div",o7,[l.createElementVNode("div",l7,[c7,l.createElementVNode("span",null,l.toDisplayString(U.value),1)]),l.createElementVNode("div",{class:"top-group"},[l.createElementVNode("div",{class:"full-screen-btn",onClick:Ne}),l.createElementVNode("div",{class:"close-btn",onClick:fe})])])),[[B,i.isDraggable]]),l.createElementVNode("div",u7,[l.createElementVNode("div",{id:"point-meeting-contain",class:l.normalizeClass(["meeting-contain",i.meetingType==="video"||i.meetingType==="miniLink"?"meeting-contain-video":"meeting-contain-audio"]),onMousemove:ze[0]||(ze[0]=oe=>Ee(4))},[w.value?(l.openBlock(),l.createElementBlock("div",d7,"呼叫中...")):l.createCommentVNode("",!0)],34)]),l.createElementVNode("div",{class:l.normalizeClass(["point-meeting-foot",{"point-meeting-foot-show":P.value}])},[p.value?(l.openBlock(),l.createElementBlock("div",{key:0,class:"point-meeting-foot-btn mic-on",onClick:H},h7)):(l.openBlock(),l.createElementBlock("div",{key:1,class:"point-meeting-foot-btn mic-off",onClick:H},f7)),i.meetingType!=="voice"?(l.openBlock(),l.createElementBlock(l.Fragment,{key:2},[f.value?(l.openBlock(),l.createElementBlock("div",{key:0,class:"point-meeting-foot-btn cam-on",onClick:$},p7)):(l.openBlock(),l.createElementBlock("div",{key:1,class:"point-meeting-foot-btn cam-off",onClick:$},m7))],64)):l.createCommentVNode("",!0),m.value?(l.openBlock(),l.createElementBlock("div",{key:3,class:"point-meeting-foot-btn speaker-on",onClick:W},g7)):(l.openBlock(),l.createElementBlock("div",{key:4,class:"point-meeting-foot-btn speaker-off",onClick:ae},v7)),i.meetingType!=="voice"?(l.openBlock(),l.createElementBlock(l.Fragment,{key:5},[l.createElementVNode("div",{class:"point-meeting-foot-btn screen-share",onClick:j},[y7,l.createElementVNode("div",b7,l.toDisplayString(_.value?"结束共享":"共享屏幕"),1)]),l.createElementVNode("div",{class:"point-meeting-foot-btn preview",onClick:Ae},[_7,l.createElementVNode("div",k7,l.toDisplayString(k.value?"关闭预览":"开启预览"),1)])],64)):l.createCommentVNode("",!0),l.createElementVNode("div",{class:"point-meeting-foot-btn cancel",onClick:xe},T7)],2)],4))}},[["__scopeId","data-v-0afc60d4"]]),Yu={__name:"LivePoint",props:{isCallBoardShow:{type:Boolean,default:!1},defaultCallNum:{type:String,default:""},isDraggable:{type:Boolean,default:!1},isInviteReceiveShow:{type:Boolean,default:!1},inviteMeetingType:{type:String,default:"video"},inviteData:{type:Object,default:()=>({})},defaultCallingMethod:{type:Array,default:()=>["voice","video","mini"]}},emits:["callBoardClose","inviteReceiveClose","miniLinkInvite"],setup(i,{expose:e,emit:t}){let n=null;const r=new _n,s=t,a=l.ref(!1),o=l.reactive({joinType:"join",meetingNum:"",meetingType:"video",invitePhone:""}),c=l.ref("phoneCall"),u=l.ref("");function d(m){o.joinType="launch",o.meetingType="voice",o.invitePhone=m,c.value="phoneCall",a.value=!0}function h(m){o.joinType="launch",o.meetingType="video",o.invitePhone=m,c.value="phoneCall",a.value=!0}function b(m){o.joinType="launch",o.meetingType="miniLink",o.invitePhone=m,c.value="phoneCall",a.value=!0}function v(m){n.acceptInvite(m.roomNum,m.fromIdentity,m.fromOrg).then(()=>{o.joinType="join",o.meetingType=m.meetingType,o.meetingNum=m.roomNum,a.value=!0,s("inviteReceiveClose")}).catch(()=>{r.message("error","接受会议邀请失败,请重试")})}function y(m){n.refuseInvite(m.roomNum,m.fromIdentity,m.fromOrg).then(()=>{s("inviteReceiveClose")}).catch(()=>{r.message("error","拒绝会议邀请失败,请重试")})}function p(m){s("miniLinkInvite",m)}function f(){a.value=!1}return l.onMounted(async()=>{await l.nextTick(),n=window.liveClient}),e({makeVoiceCall:d,makeVideoCall:h,makeMiniCall:b}),(m,_)=>(l.openBlock(),l.createElementBlock("div",null,[(l.openBlock(),l.createBlock(l.Teleport,{to:"body"},[i.isCallBoardShow?(l.openBlock(),l.createBlock(El,{key:0,"default-call-num":i.defaultCallNum,defaultCallingMethod:i.defaultCallingMethod,onVoiceCall:d,onVideoCall:h,onMiniCall:b,onCallBoardClose:_[0]||(_[0]=k=>m.$emit("callBoardClose"))},null,8,["default-call-num","defaultCallingMethod"])):l.createCommentVNode("",!0)])),(l.openBlock(),l.createBlock(l.Teleport,{to:"body"},[i.isInviteReceiveShow?(l.openBlock(),l.createBlock(a7,{key:0,meetingType:i.inviteMeetingType,inviteData:i.inviteData,onReceiveBoardClose:m.inviteReceiveClose,onAcceptInviteCall:v,onRefuseInviteCall:y},null,8,["meetingType","inviteData","onReceiveBoardClose"])):l.createCommentVNode("",!0)])),(l.openBlock(),l.createBlock(l.Teleport,{to:"body"},[a.value?(l.openBlock(),l.createBlock(wl,{key:0,joinType:o.joinType,meetingNum:o.meetingNum,meetingType:o.meetingType,invitePhone:o.invitePhone,inviteWays:c.value,inviteIdentity:u.value,isDraggable:i.isDraggable,onMeetingDialogClose:f,onMiniLinkSend:p},null,8,["joinType","meetingNum","meetingType","invitePhone","inviteWays","inviteIdentity","isDraggable"])):l.createCommentVNode("",!0)]))]))}};Yu.install=function(i){i.component("LivePoint",Yu)},El.install=function(i){i.component("LiveCallBoard",El)},wl.install=function(i){i.component("LivePointMeeting",wl)};const S7="/assets/img/multi/tree_slide.png",C7="/assets/img/multi/tree_expand.png",x7="/assets/img/multi/launch_icon.png",E7="/assets/img/entry/icon_date.png",w7="/assets/img/index/yq.png",O_="/assets/img/multi/user.png",D7="/assets/img/multi/add.png",A7=i=>(l.pushScopeId("data-v-aa1de33f"),i=i(),l.popScopeId(),i),I7={class:"telephone-invite"},P7={class:"CustomHeader"},N7=A7(()=>l.createElementVNode("div",{class:"ivits"},"邀请非通讯录人员",-1)),O7={class:"contentsinit"},M7=Bt({__name:"TelephoneInvitation",emits:["inviteCancel","inviteConfirm"],setup(i,{emit:e}){const t=e,n=l.ref(!1),r=l.ref(),s=l.reactive({name:"",phone:""}),a=l.reactive({name:[{required:!0,message:"请输入姓名",trigger:"blur"}],phone:[{validator:yx,trigger:"blur"}]});ut.on("getinvitTions",()=>{n.value=!0});const o=()=>{t("inviteCancel"),n.value=!1},c=async()=>{await l.nextTick(),r.value.validate(u=>{console.log("valid",u),u?(t("inviteConfirm",{name:s.name,phone:s.phone}),n.value=!1):console.log("表单校验不通过")})};return l.watch(()=>n.value,u=>{u&&(s.name="",s.phone="")}),(u,d)=>{const h=l.resolveComponent("el-input"),b=l.resolveComponent("el-form-item"),v=l.resolveComponent("el-form"),y=l.resolveComponent("el-dialog");return l.openBlock(),l.createElementBlock("div",I7,[l.createVNode(y,{modelValue:n.value,"onUpdate:modelValue":d[3]||(d[3]=p=>n.value=p),"show-close":!1,class:"telephoneInvit",width:"460"},{header:l.withCtx(()=>[l.createElementVNode("div",P7,[N7,l.createElementVNode("div",{class:"close",onClick:d[0]||(d[0]=p=>n.value=!1)})])]),default:l.withCtx(()=>[l.createElementVNode("div",O7,[l.createVNode(v,{model:s,"hide-required-asterisk":"",ref_key:"createForm",ref:r,rules:a,"label-width":"70",class:"customForm"},{default:l.withCtx(()=>[l.createVNode(b,{label:"姓名",prop:"name"},{default:l.withCtx(()=>[l.createVNode(h,{modelValue:s.name,"onUpdate:modelValue":d[1]||(d[1]=p=>s.name=p)},null,8,["modelValue"])]),_:1}),l.createVNode(b,{label:"电话",prop:"phone"},{default:l.withCtx(()=>[l.createVNode(h,{modelValue:s.phone,"onUpdate:modelValue":d[2]||(d[2]=p=>s.phone=p)},null,8,["modelValue"])]),_:1}),l.createVNode(b,{"label-width":"0"},{default:l.withCtx(()=>[l.createElementVNode("div",{class:"isokmul"},[l.createElementVNode("div",{onClick:o},"取消"),l.createElementVNode("div",{onClick:c},"确定")])]),_:1})]),_:1},8,["model","rules"])])]),_:1},8,["modelValue"])])}}},[["__scopeId","data-v-aa1de33f"]]),R7=i=>(l.pushScopeId("data-v-c23caf5b"),i=i(),l.popScopeId(),i),L7={class:"CustomHeader"},B7=R7(()=>l.createElementVNode("div",{class:"ivits"},"添加人员到常用分组",-1)),U7={class:"contentsinit"},F7=Bt({__name:"AddGroupDialog",emits:["addGroupCancel","addGroupConfirm"],setup(i,{emit:e}){const t=e,n=l.ref(!1),r=l.ref(),s=l.reactive({name:"",sort:1}),a=l.reactive({name:[{required:!0,message:"请输入分组名",trigger:"blur"},{max:10,message:"分组名不能超过10个字符",trigger:"blur"}],sort:[{required:!0,message:"请输入序号",trigger:"change"}]});ut.on("groupAddOpen",()=>{n.value=!0});const o=()=>{t("addGroupCancel"),n.value=!1},c=async()=>{await l.nextTick(),r.value.validate(u=>{console.log("valid",u),u?(t("addGroupConfirm",{name:s.name,sort:s.sort}),n.value=!1):console.log("表单校验不通过")})};return l.watch(()=>n.value,u=>{u&&(s.name="",s.sort=1)}),(u,d)=>{const h=l.resolveComponent("el-input"),b=l.resolveComponent("el-form-item"),v=l.resolveComponent("el-input-number"),y=l.resolveComponent("el-form"),p=l.resolveComponent("el-dialog");return l.openBlock(),l.createElementBlock("div",null,[l.createVNode(p,{modelValue:n.value,"onUpdate:modelValue":d[3]||(d[3]=f=>n.value=f),"show-close":!1,class:"telephoneInvit",width:"460"},{header:l.withCtx(()=>[l.createElementVNode("div",L7,[B7,l.createElementVNode("div",{class:"close",onClick:d[0]||(d[0]=f=>n.value=!1)})])]),default:l.withCtx(()=>[l.createElementVNode("div",U7,[l.createVNode(y,{model:s,"hide-required-asterisk":"",ref_key:"createForm",ref:r,rules:a,"label-width":"70",class:"customForm"},{default:l.withCtx(()=>[l.createVNode(b,{label:"分组名",prop:"name"},{default:l.withCtx(()=>[l.createVNode(h,{modelValue:s.name,"onUpdate:modelValue":d[1]||(d[1]=f=>s.name=f)},null,8,["modelValue"])]),_:1}),l.createVNode(b,{label:"排序",prop:"sort"},{default:l.withCtx(()=>[l.createVNode(v,{modelValue:s.sort,"onUpdate:modelValue":d[2]||(d[2]=f=>s.sort=f),min:0,"controls-position":"right",size:"large"},null,8,["modelValue"])]),_:1}),l.createVNode(b,{"label-width":"0"},{default:l.withCtx(()=>[l.createElementVNode("div",{class:"isokmul"},[l.createElementVNode("div",{onClick:o},"取消"),l.createElementVNode("div",{onClick:c},"确定")])]),_:1})]),_:1},8,["model","rules"])])]),_:1},8,["modelValue"])])}}},[["__scopeId","data-v-c23caf5b"]]),V7=i=>(l.pushScopeId("data-v-1174fbdd"),i=i(),l.popScopeId(),i),j7={class:"CustomHeader"},$7=V7(()=>l.createElementVNode("div",{class:"ivits"},"编辑分组",-1)),H7={class:"contentsinit"},q7=Bt({__name:"EditGroupDialog",emits:["editGroupCancel","editGroupConfirm"],setup(i,{emit:e}){const t=e,n=l.ref(!1),r=l.ref(),s=l.reactive({name:"",sort:1}),a=l.ref(""),o=l.reactive({name:[{required:!0,message:"请输入分组名称",trigger:"blur"},{max:10,message:"分组名不能超过10个字符",trigger:"blur"}],sort:[{required:!0,message:"请输入序号",trigger:"change"}]});ut.on("groupEditOpen",async d=>{n.value=!0,await l.nextTick(),a.value=d.groupId,s.name=d.label,s.sort=d.sort});const c=()=>{t("editGroupCancel"),n.value=!1},u=async()=>{await l.nextTick(),r.value.validate(d=>{d?(t("editGroupConfirm",{name:s.name,sort:s.sort,groupId:a.value}),n.value=!1):console.log("表单校验不通过")})};return l.watch(()=>n.value,d=>{d&&(s.name="",s.sort=0)}),(d,h)=>{const b=l.resolveComponent("el-input"),v=l.resolveComponent("el-form-item"),y=l.resolveComponent("el-input-number"),p=l.resolveComponent("el-form"),f=l.resolveComponent("el-dialog");return l.openBlock(),l.createElementBlock("div",null,[l.createVNode(f,{modelValue:n.value,"onUpdate:modelValue":h[3]||(h[3]=m=>n.value=m),"show-close":!1,class:"telephoneInvit",width:"460"},{header:l.withCtx(()=>[l.createElementVNode("div",j7,[$7,l.createElementVNode("div",{class:"close",onClick:h[0]||(h[0]=m=>n.value=!1)})])]),default:l.withCtx(()=>[l.createElementVNode("div",H7,[l.createVNode(p,{model:s,"hide-required-asterisk":"",ref_key:"createForm",ref:r,rules:o,"label-width":"70",class:"customForm"},{default:l.withCtx(()=>[l.createVNode(v,{label:"分组名",prop:"name"},{default:l.withCtx(()=>[l.createVNode(b,{modelValue:s.name,"onUpdate:modelValue":h[1]||(h[1]=m=>s.name=m)},null,8,["modelValue"])]),_:1}),l.createVNode(v,{label:"排序",prop:"sort"},{default:l.withCtx(()=>[l.createVNode(y,{modelValue:s.sort,"onUpdate:modelValue":h[2]||(h[2]=m=>s.sort=m),min:0,"controls-position":"right",size:"large"},null,8,["modelValue"])]),_:1}),l.createVNode(v,{"label-width":"0"},{default:l.withCtx(()=>[l.createElementVNode("div",{class:"isokmul"},[l.createElementVNode("div",{onClick:c},"取消"),l.createElementVNode("div",{onClick:u},"确定")])]),_:1})]),_:1},8,["model","rules"])])]),_:1},8,["modelValue"])])}}},[["__scopeId","data-v-1174fbdd"]]),hs=i=>(l.pushScopeId("data-v-46ca144d"),i=i(),l.popScopeId(),i),z7={class:"addressbox"},G7={class:"CustomHeader"},W7={class:"tabs"},K7=["onClick"],X7=hs(()=>l.createElementVNode("div",{class:"fgx"},null,-1)),Y7={class:"checkBox"},J7={class:"userLeft"},Q7=hs(()=>l.createElementVNode("i",{class:"el-input__icon el-icon-search"},null,-1)),Z7={class:"custom-tree-node"},eO=["title"],tO={key:1,class:"custom-tree-node-user"},nO=hs(()=>l.createElementVNode("span",{class:l.normalizeClass(["custom-tree-node-icon"])},null,-1)),iO=["title"],rO={class:"treeFlexInof1"},sO={class:"iconS"},aO=["src"],oO=["src"],lO=["src"],cO={class:"custom-tree-node"},uO={style:{"max-width":"300px","text-overflow":"ellipsis",overflow:"hidden"}},dO={class:"custom-tree-node"},hO={key:0,class:"custom-tree-node-editable"},fO=["title"],pO={key:0,class:"node-options"},mO=["onClick"],gO=["onClick"],vO={key:1,class:"custom-tree-node-user"},yO=hs(()=>l.createElementVNode("span",{class:l.normalizeClass(["custom-tree-node-icon"])},null,-1)),bO=["title"],_O={class:"userRight"},kO={class:"checkUse"},TO=hs(()=>l.createElementVNode("div",{class:"titl"},"已选",-1)),SO={class:"count"},CO=[hs(()=>l.createElementVNode("img",{src:w7,alt:""},null,-1))],xO={class:"checkutl"},EO={class:"label"},wO=hs(()=>l.createElementVNode("img",{src:O_,alt:""},null,-1)),DO=["onClick"],AO=hs(()=>l.createElementVNode("img",{src:D7,alt:""},null,-1)),Zp=Bt({__name:"AddressBook",props:{inviteList:{type:Array,default:()=>[]},baseUrl:{type:String,default:""},token:{type:String,default:""},componentType:{type:String,default:""}},emits:["inviteListUpdate","appendInvitePeople"],setup(i,{emit:e}){const t=new _n,n=[{id:0,name:"组织机构"},{id:2,name:"会场列表"},{id:1,name:"常用分组"}],r=i,s=e,a=l.ref(!1),o=l.ref(0),c=l.ref(""),u=l.ref(),d=l.ref(),h=l.ref(),b=l.reactive({arr:[],usualArr:[],meetingArr:[]}),v=l.ref([]),y=l.ref([]),p=l.ref(!1),f=l.ref(!1),m=l.ref([]),_=l.computed(()=>f.value?n.filter(ee=>ee.id!==2):n);l.watch(f,ee=>{ee&&o.value===2&&(o.value=0)});const k=l.computed(()=>m.value.length),D=l.computed(()=>m.value.length>0?m.value.filter(ee=>ee.sourceTab===o.value).map(ee=>o.value===2?ee.id??ee.uri??ee.userId:ee.userId):[]),w=async ee=>{c.value="";const fe=[],xe=new Map;(r.inviteList||[]).forEach(Ne=>{const He={...Ne};if(He.uri){He.id=He.id??He.uri,(He.sourceTab===void 0||He.sourceTab===null)&&(He.sourceTab=2);const Be=He.id;xe.has(Be)||(xe.set(Be,!0),fe.push(He))}else{(He.sourceTab===void 0||He.sourceTab===null)&&(He.sourceTab=0);const Be=He.userId;xe.has(Be)||(xe.set(Be,!0),fe.push(He))}}),m.value=fe,a.value=!0,ee?(p.value=ee.isInner,f.value=ee.isVolte||!1,(f.value||ee.clearData)&&(m.value=[],await l.nextTick(),u.value&&u.value.setCheckedKeys([],!1),d.value&&d.value.setCheckedKeys([],!1),h.value&&h.value.setCheckedKeys([],!1))):(p.value=!1,f.value=!1)};(r.componentType==="meeting"||r.componentType==="")&&ut.on("getaddressBookUserForMeeting",w),(r.componentType==="voiceBroadcast"||r.componentType==="")&&ut.on("getaddressBookUserForVoiceBroadcast",w),(r.componentType==="preview"||r.componentType==="")&&ut.on("getaddressBookUserForPreview",w),(r.componentType==="addressBook"||r.componentType==="")&&ut.on("getaddressBookUserForAddressBook",w),r.componentType===""&&ut.on("getaddressBookUser",w);const A=ee=>{m.value.findIndex(fe=>fe.userId===ee.userId)===-1&&m.value.push(ee)},x=ee=>{const fe=m.value.findIndex(xe=>xe.userId===ee);fe!==-1&&m.value.splice(fe,1)},P=()=>{ut.emit("getinvitTions")},S=()=>{ut.emit("groupAddOpen")},M=(ee,fe)=>ee?o.value===2?fe.name.includes(ee):fe.label.includes(ee):!0,U=(ee,fe)=>{let xe;if(fe!==void 0?xe=fe:(ee==null?void 0:ee.type)==="SITE_TYPE_IP"||(ee==null?void 0:ee.type)==="SITE_TYPE_SIP"?xe=2:(ee==null||ee.classify,xe=0),(ee==null?void 0:ee.classify)==="人员")return{userId:ee.id,userName:ee.label,mobile:ee.phone,sourceTab:xe,...ee};if((ee==null?void 0:ee.type)==="SITE_TYPE_IP"||(ee==null?void 0:ee.type)==="SITE_TYPE_SIP")return{userId:ee.uri,userName:ee.name,mobile:ee.ipAddress,label:ee.name,id:ee.uri,classify:"会场",sourceTab:xe,...ee};{const Ne={userId:ee.id,userName:ee.label,mobile:ee.equipmentCode,sourceTab:xe,...ee};return Ne.mobile=ee.equipmentCode,Ne}},B=async(ee,fe)=>{await l.nextTick();let xe=[];o.value===0?xe=u.value.getCheckedNodes(!0,!1):o.value===2&&(xe=h.value.getCheckedNodes(!0,!1)),m.value=m.value.filter(Ne=>Ne.sourceTab!==o.value),xe.forEach(Ne=>{const He=U(Ne,o.value);A(He)})},Q=async()=>{await l.nextTick();let ee=d.value.getCheckedNodes(!0,!1).filter(fe=>fe.label.includes(c.value)&&!fe.children);y.value=ee.map(fe=>U(fe)),console.log("所有选中节点(常用分组)",y.value)},ie=()=>new Promise((ee,fe)=>{fy({},{baseUrl:r.baseUrl,token:r.token}).then(xe=>{var Ne,He;console.log("获取通讯录组织树",xe),((Ne=xe.data)==null?void 0:Ne.code)===0?(He=xe.data)!=null&&He.data&&(b.arr=xe.data.data,ee()):(t.message("error","获取通讯录组织数据失败"),fe())})}),Y=()=>new Promise((ee,fe)=>{R8({},{baseUrl:r.baseUrl,token:r.token}).then(xe=>{console.log("获取常用组织树",xe),xe.data&&xe.data.length>=0?(b.usualArr=xe.data,ee()):(b.usualArr=[],fe())})}),q=()=>new Promise((ee,fe)=>{j8({},{baseUrl:r.baseUrl,token:r.token}).then(xe=>{var Ne,He,Be;console.log("获取会场列表",xe),((Ne=xe.data)==null?void 0:Ne.code)===0?(He=xe.data)!=null&&He.data&&Array.isArray(xe.data.data)?(b.meetingArr=xe.data.data.map(be=>({...be,id:be.uri,name:be.name||be.uri,label:be.name||be.uri})),console.log("会场列表数据已加载:",b.meetingArr),ee()):(console.log("会场列表数据为空或格式不正确:",xe.data),b.meetingArr=[],ee()):(console.error("获取会场列表失败:",xe.data),t.message("error",`获取会场列表数据失败: ${((Be=xe.data)==null?void 0:Be.msg)||"未知错误"}`),b.meetingArr=[],fe())}).catch(xe=>{console.error("获取会场列表API调用失败:",xe),t.message("error","获取会场列表失败,请检查网络连接"),b.meetingArr=[],fe(xe)})}),L=ee=>{const fe=gx(17);A({userName:ee.name,userId:fe,mobile:ee.phone,id:fe,label:ee.name,phone:ee.phone,classify:"人员"})},$=ee=>{let fe={name:ee.name,sort:ee.sort,userList:k.value>0?m.value.map(xe=>{const Ne=JSON.parse(JSON.stringify(xe));return delete Ne.userId,delete Ne.userName,delete Ne.mobile,Ne}):[]};L8(fe,{baseUrl:r.baseUrl,token:r.token}).then(async xe=>{xe.data.code==0?(t.message("success","添加到常用分组成功"),await Y(),await l.nextTick(),d.value.setCheckedKeys(D.value,!1),y.value=d.value.getCheckedNodes(!0,!1).map(Ne=>U(Ne))):fe.userList.length<=0&&t.message("error","添加到常用分组失败,请先勾选要添加的用户")})},H=ee=>{ut.emit("groupEditOpen",{groupId:ee.id,label:ee.label,sort:ee.sort})},j=ee=>{console.log("编辑分组确认",ee);let fe={id:ee.groupId,name:ee.name,sort:ee.sort};B8(fe,{baseUrl:r.baseUrl,token:r.token}).then(async xe=>{console.log("更新常用分组",xe),xe.data.code==0&&(t.message("success","分组更新成功"),await Y(),await l.nextTick(),d.value.setCheckedKeys(D.value,!1),y.value=d.value.getCheckedNodes(!0,!1).map(Ne=>U(Ne)))})},W=ee=>{U8(ee.id,{baseUrl:r.baseUrl,token:r.token}).then(async fe=>{console.log("删除分组",fe),fe.data.code===0&&(t.message("success","删除分组成功"),await Y(),await l.nextTick(),d.value.setCheckedKeys(D.value,!1),y.value=d.value.getCheckedNodes(!0,!1).map(xe=>U(xe)))})},ae=ee=>{x(ee.userId),o.value===0?(u.value.setCheckedKeys(D.value,!1),v.value=u.value.getCheckedNodes(!0,!1).map(fe=>U(fe))):o.value===2?h.value.setCheckedKeys(D.value,!1):(d.value.setCheckedKeys(D.value,!1),y.value=d.value.getCheckedNodes(!0,!1).map(fe=>U(fe)))},Ee=()=>{m.value=[],a.value=!1},Ae=()=>{f.value?m.value.forEach(ee=>{ut.emit("startVideoCall",ee.mobile)}):(s("inviteListUpdate",m.value),p.value&&s("appendInvitePeople",m.value)),a.value=!1};return l.watch(()=>c.value,async ee=>{await l.nextTick(),o.value===0?u.value.filter(ee):o.value===2?h.value.filter(ee):d.value.filter(ee)}),l.watch(()=>a.value,async ee=>{ee&&(await ie(),await Y(),await q(),await l.nextTick(),o.value===0?(console.log("inviteKeysNum",k.value),u.value.setCheckedKeys(D.value,!0),v.value=u.value.getCheckedNodes(!0,!1).map(fe=>U(fe))):o.value===2?h.value.setCheckedKeys(D.value,!0):(d.value.setCheckedKeys(D.value,!0),y.value=d.value.getCheckedNodes(!0,!1).map(fe=>U(fe))))}),l.watch(()=>o.value,async ee=>{await l.nextTick(),console.log("newActiveIndex",ee),ee===0?(console.log("inviteKeysNum",k.value),k.value>0?(u.value.setCheckedKeys(D.value,!1),v.value=u.value.getCheckedNodes(!0,!1).map(fe=>U(fe))):(b.arr=b.arr,v.value=[]),u.value.filter(c.value)):ee===2?((!b.meetingArr||b.meetingArr.length===0)&&await q(),await l.nextTick(),k.value>0&&h.value.setCheckedKeys(D.value,!1),h.value.filter(c.value)):(k.value>0?(d.value.setCheckedKeys(D.value,!1),y.value=d.value.getCheckedNodes(!0,!1).map(fe=>U(fe))):(b.usualArr=b.usualArr,y.value=[]),d.value.filter(c.value))}),l.watch(()=>v.value,(ee,fe)=>{console.log("checkedNodes",ee,fe),ee.length>0&&ee.forEach(xe=>{A(xe)}),console.log("inviteList111",m.value),console.log("inviteList222",m.value)},{deep:!0}),l.watch(()=>y.value,(ee,fe)=>{console.log("usualCheckedNodes",ee,fe),ee.length>0&&ee.forEach(xe=>{A(xe)}),console.log("inviteList111111",m.value),console.log("inviteList222222",m.value)},{deep:!0}),(ee,fe)=>{const xe=l.resolveComponent("el-input"),Ne=l.resolveComponent("el-tree"),He=l.resolveComponent("el-dialog");return l.openBlock(),l.createElementBlock(l.Fragment,null,[l.createElementVNode("div",z7,[l.createVNode(He,{modelValue:a.value,"onUpdate:modelValue":fe[2]||(fe[2]=Be=>a.value=Be),"show-close":!1,class:"addresslogClass",width:"878"},{header:l.withCtx(()=>[l.createElementVNode("div",G7,[l.createElementVNode("div",W7,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(_.value,Be=>(l.openBlock(),l.createElementBlock("div",{key:Be.id,class:l.normalizeClass(["tabItem",o.value==Be.id?"activeBorder":""]),onClick:be=>o.value=Be.id},l.toDisplayString(Be.name),11,K7))),128))]),l.createElementVNode("div",{class:"close",onClick:fe[0]||(fe[0]=Be=>a.value=!1)})])]),default:l.withCtx(()=>[X7,l.createElementVNode("div",Y7,[l.createElementVNode("div",J7,[l.createVNode(xe,{class:"search-input",modelValue:c.value,"onUpdate:modelValue":fe[1]||(fe[1]=Be=>c.value=Be),placeholder:"请输入名称进行搜索"},{suffix:l.withCtx(()=>[Q7]),_:1},8,["modelValue"]),l.withDirectives(l.createVNode(Ne,{ref_key:"treeRef",ref:u,class:"tree-content","show-checkbox":"","node-key":"id",data:b.arr,onCheck:B,"filter-node-method":M},{default:l.withCtx(({node:Be,data:be})=>[l.createElementVNode("span",Z7,[be.children?(l.openBlock(),l.createElementBlock("span",{key:0,class:"custom-tree-node-label",title:Be.label},l.toDisplayString(Be.label),9,eO)):(l.openBlock(),l.createElementBlock("span",tO,[nO,l.createElementVNode("span",{class:"custom-tree-node-label",title:Be.label},l.toDisplayString(Be.label),9,iO)]))])]),_:1},8,["data"]),[[l.vShow,o.value===0]]),l.withDirectives(l.createVNode(Ne,{ref_key:"meetingHomeRef",ref:h,class:"custom-tree","show-checkbox":"","node-key":"id",data:b.meetingArr,onCheck:B,"filter-node-method":M},{default:l.withCtx(({node:Be,data:be})=>[l.createElementVNode("div",rO,[l.createElementVNode("span",sO,[be.children?Be.expanded?(l.openBlock(),l.createElementBlock("img",{key:1,src:ee.splic,alt:""},null,8,oO)):(l.openBlock(),l.createElementBlock("img",{key:2,src:ee.add,alt:""},null,8,lO)):(l.openBlock(),l.createElementBlock("img",{key:0,src:l.unref(O_),class:"user"},null,8,aO))]),l.createElementVNode("div",cO,[l.createElementVNode("div",uO,l.toDisplayString(be.name),1)])])]),_:1},8,["data"]),[[l.vShow,o.value===2]]),l.withDirectives(l.createVNode(Ne,{ref_key:"treeUsualRef",ref:d,class:"tree-content","show-checkbox":"","node-key":"id",data:b.usualArr,onCheck:Q,"filter-node-method":M},{default:l.withCtx(({node:Be,data:be})=>[l.createElementVNode("span",dO,[be.children?(l.openBlock(),l.createElementBlock("div",hO,[l.createElementVNode("span",{class:"custom-tree-node-label",title:Be.label},l.toDisplayString(Be.label),9,fO),be.children?(l.openBlock(),l.createElementBlock("div",pO,[l.createElementVNode("div",{class:"node-option",onClick:Fe=>H(be)}," 编辑 ",8,mO),l.createElementVNode("div",{class:"node-option",onClick:Fe=>W(be)}," 删除 ",8,gO)])):l.createCommentVNode("",!0)])):(l.openBlock(),l.createElementBlock("span",vO,[yO,l.createElementVNode("span",{class:"custom-tree-node-label",title:Be.label},l.toDisplayString(Be.label),9,bO)]))])]),_:1},8,["data"]),[[l.vShow,o.value===1]])]),l.createElementVNode("div",_O,[l.createElementVNode("div",kO,[TO,l.createElementVNode("div",SO,l.toDisplayString(k.value),1),l.createElementVNode("div",{class:"adds",onClick:P},CO)]),l.createElementVNode("div",xO,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(m.value,Be=>(l.openBlock(),l.createElementBlock("div",{key:Be.userId??Be.id??Be.uri,class:"userFlex"},[l.createElementVNode("div",EO,[wO,l.createTextVNode(" "+l.toDisplayString(Be.userName||Be.name),1)]),l.createElementVNode("div",{class:"close",onClick:be=>ae(Be)},null,8,DO)]))),128))])])]),l.createElementVNode("div",{class:"footersFull"},[l.createElementVNode("div",{class:"addfz",onClick:S},[AO,l.createTextVNode(" 添加分组 ")]),l.createElementVNode("div",{class:"isokmul"},[l.createElementVNode("div",{onClick:Ee},"取消"),l.createElementVNode("div",{onClick:Ae},"确定")])])]),_:1},8,["modelValue"])]),l.createVNode(M7,{onInviteConfirm:L}),l.createVNode(F7,{onAddGroupConfirm:$}),l.createVNode(q7,{onEditGroupConfirm:j})],64)}}},[["__scopeId","data-v-46ca144d"]]),IO=["onClick"],PO=Bt({__name:"PreviewMoreOption",props:{previewMeetingData:{type:Object},optionDialogOffset:{type:Object,default:{left:"0px",top:"0px"}},mobile:{type:String,default:""}},emits:["close","endMeeting","checkMeetingDetail","updateMeetingDetail","cancelMeeting"],setup(i,{emit:e}){const t=i,n=e,r=l.computed(()=>{var a,o;if(((a=t.previewMeetingData)==null?void 0:a.status)==0)return t.mobile===t.previewMeetingData.owner?["查看会议详情","修改会议信息","取消会议"]:["查看会议详情"];if(((o=t.previewMeetingData)==null?void 0:o.status)==1)return t.mobile===t.previewMeetingData.owner?["查看会议详情","结束会议"]:["查看会议详情"]}),s=a=>{switch(a){case"查看会议详情":n("checkMeetingDetail",t.previewMeetingData);break;case"修改会议信息":n("updateMeetingDetail",t.previewMeetingData);break;case"取消会议":n("cancelMeeting",t.previewMeetingData);break;case"结束会议":n("endMeeting",t.previewMeetingData);break}n("close")};return l.onMounted(()=>{}),(a,o)=>(l.openBlock(),l.createElementBlock("div",{class:"more-option",style:l.normalizeStyle(t.optionDialogOffset)},[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(r.value,(c,u)=>(l.openBlock(),l.createElementBlock("div",{class:l.normalizeClass(["more-option-item",{"more-option-item-danger":c==="结束会议"}]),key:"o"+u,onClick:d=>s(c)},l.toDisplayString(c),11,IO))),128))],4))}},[["__scopeId","data-v-a2b8a447"]]),NO="/assets/img/entry/preview_dialog_logo.png",Dl=i=>(l.pushScopeId("data-v-5376302e"),i=i(),l.popScopeId(),i),OO={class:"dialog-head"},MO={class:"dialog-head-group"},RO=Dl(()=>l.createElementVNode("img",{class:"dialog-logo",src:NO},null,-1)),LO={class:"dialog-head-group"},BO={class:"dialog-contain"},UO={class:"box-form"},FO={class:"yaoq"},VO=Dl(()=>l.createElementVNode("div",{class:"yaoq-title"},"邀请参会人",-1)),jO={class:"invite-list"},$O=[Dl(()=>l.createElementVNode("div",{class:"icon"},null,-1))],HO=Dl(()=>l.createElementVNode("div",{class:"split"},"...",-1)),qO={class:"badge"},zO=[Dl(()=>l.createElementVNode("div",{class:"icon"},null,-1))],GO={class:"time-range"},WO={class:"time-range"},KO={class:"meeting-remind"},XO={class:"meeting-remind-wrap"},YO=["onClick"],JO={key:1},QO={class:"meeting-setter"},ZO={key:0,class:"foot-btns"},eM=Bt({__name:"PreviewMeetingDialog",props:{width:{type:String,default:"auto"},height:{type:String,default:"auto"},title:{type:String,default:"发起会议"},previewType:{type:String,default:"add"},previewMeetingData:{type:Object,default:()=>({})},userData:{type:Object,default:()=>({})},org:{type:String,default:"default"},baseUrl:{type:String,default:""},inviteList:{type:Array,default:()=>[]},token:{type:String,default:""}},emits:["close","previewSuccess","updateSuccess","previewResetInviteList","previewUpdateInviteList"],setup(i,{emit:e}){const t=e,n=i;let r=null;const s=new _n,a=l.reactive({roomName:"",venueName:"",organizingUnit:"",beginDate:"",beginTime:"",endDate:"",endTime:"",timeZone:"",joinBeforeHostEnabled:!1,inviteOtherEnabled:!1,joinMute:!1,autoRecord:!1}),o=l.ref(),c=l.ref([{label:"(GMT+8:00)中国标准时间-北京",value:"Asia/Shanghai"}]),u=l.ref([{remind:0,unit:"min"}]),d=l.ref([{label:"分钟",value:"min"},{label:"小时",value:"h"}]),h=l.computed(()=>n.inviteList.length),b=()=>{n.previewType!=="detail"&&ut.emit("getaddressBookUserForPreview")},v=w=>{u.value.length<=1?s.message("info","至少保留一条数据"):u.value.splice(w,1)},y=()=>{u.value.push({remind:0,unit:"min"})},p=()=>{const w=Zn(a.beginDate).format("YYYY-MM-DD")+" "+Zn(Zn(a.beginDate).format("YYYY-MM-DD")+" "+a.beginTime).format("HH:mm:ss"),A=Zn(a.endDate).format("YYYY-MM-DD")+" "+Zn(Zn(a.endDate).format("YYYY-MM-DD")+" "+a.endTime).format("HH:mm:ss");return a.roomName.length<=0?(s.message("error","会议主题不能为空"),!1):a.roomName.length>20?(s.message("error","会议主题字数不能超过20个字符"),!1):a.beginDate?a.beginTime?a.endDate?a.endTime?new Date(w).getTime()-Date.now()<=0?(s.message("error","开始时间不能在当前时间之前"),!1):new Date(A).getTime()-new Date(w).getTime()<0?(s.message("error","结束时间不能在开始时间之前"),!1):a.timeZone?(a.beginFullTime=w,a.endFullTime=A,!0):(s.message("error","时区不能为空"),!1):(s.message("error","会议结束时间不能为空"),!1):(s.message("error","会议结束日期不能为空"),!1):(s.message("error","会议开始时间不能为空"),!1):(s.message("error","会议开始日期不能为空"),!1)};function f(){t("previewResetInviteList"),t("close")}const m=()=>{let w=[],A=[];if(h.value>0?(w=(n.inviteList||[]).filter(S=>!(S!=null&&S.uri)).map(S=>(S==null?void 0:S.classify)==="人员"?{userId:S==null?void 0:S.userId,org:n.org,userName:S==null?void 0:S.userName,officeName:S==null?void 0:S.officeName,metadata:{phone:S.mobile,classify:S.classify}}:{userId:S==null?void 0:S.userId,org:n.org,userName:S==null?void 0:S.userName,officeName:S==null?void 0:S.officeName,metadata:{classify:S==null?void 0:S.classify,phone:"",equipmentCode:S==null?void 0:S.mobile,equipmentPassword:S==null?void 0:S.equipmentPassword,equipmentType:S==null?void 0:S.equipmentType}}),w.findIndex(S=>S.metadata.classify==="人员"&&S.metadata.phone==n.userData.mobile)<0&&w.push({userId:n.userData.userId,userName:n.userData.username,phone:n.userData.mobile,org:n.org,metadata:{phone:n.userData.mobile,classify:"人员"}})):w.push({userId:n.userData.userId,userName:n.userData.username,phone:n.userData.mobile,org:n.org,metadata:{phone:n.userData.mobile,classify:"人员"}}),u.value.length>0?(u.value.forEach(x=>{x.remind&&(x.unit=="min"?A.push(Number(x.remind)+"m"):A.push(Number(x.remind)+"h"))}),A=Array.from(new Set(A))):A=[],p()){console.log("beginFullTime111",a.beginTime),console.log("endFullTime111",a.endTime);const x={owner:n.userData.mobile,ownerName:n.userData.username,roomAlias:a.roomName,phone:n.userData.mobile,org:n.org,inviteParticipants:w,appointmentStart:new Date(a.beginFullTime).toISOString(),appointmentEnd:new Date(a.endFullTime).toISOString(),zone:a.timeZone,joinBefore:a.joinBeforeHostEnabled,inviteOther:a.inviteOtherEnabled,mute:a.joinMute,autoRecord:a.autoRecord,preMeetingNotify:A.join(","),metadata:{venueName:a.venueName,meetingCompany:a.organizingUnit}};O8(x,{baseUrl:r.baseUrl,token:n.token}).then(P=>{if((P==null?void 0:P.data.code)===200){s.message("success","会议预约成功");try{const S=Array.isArray(n.inviteList)?n.inviteList.filter(M=>M&&M.uri):[];S.length>0&&py(P.data.data,S,{baseUrl:n.baseUrl,token:n.token}).catch(M=>console.error("scheduleConf error",M))}catch(S){console.error(S)}t("previewSuccess"),t("close")}})}},_=()=>{let w=[],A=[];if(h.value>0?(w=(n.inviteList||[]).filter(S=>!(S!=null&&S.uri)).map(S=>(S==null?void 0:S.classify)==="人员"?{userId:S==null?void 0:S.userId,userName:S==null?void 0:S.userName,officeName:S==null?void 0:S.officeName,org:n.org,metadata:{classify:S==null?void 0:S.classify,phone:S==null?void 0:S.mobile}}:{userId:S==null?void 0:S.userId,userName:S==null?void 0:S.userName,officeName:S==null?void 0:S.officeName,org:n.org,metadata:{classify:S==null?void 0:S.classify,phone:"",equipmentCode:S==null?void 0:S.mobile,equipmentPassword:S==null?void 0:S.equipmentPassword,equipmentType:S==null?void 0:S.equipmentType}}),w.findIndex(S=>S.metadata.classify==="人员"&&S.metadata.phone==n.userData.mobile)<0&&w.push({userId:n.userData.userId,userName:n.userData.username,phone:n.userData.mobile,org:n.org,metadata:{phone:n.userData.mobile,classify:"人员"}})):w.push({userId:n.userData.userId,userName:n.userData.username,phone:n.userData.mobile,org:n.org,metadata:{phone:n.userData.mobile,classify:"人员"}}),u.value.length>0?(u.value.forEach(x=>{x.remind&&(x.unit=="min"?A.push(Number(x.remind)+"m"):A.push(Number(x.remind)+"h"))}),A=Array.from(new Set(A))):A=[],p()){const x={room:n.previewMeetingData.roomNum,owner:n.userData.mobile,ownerName:n.userData.username,roomAlias:a.roomName,phone:n.userData.mobile,org:n.org,inviteParticipants:w,appointmentStart:new Date(a.beginFullTime).toISOString(),appointmentEnd:new Date(a.endFullTime).toISOString(),zone:a.timeZone,joinBefore:a.joinBeforeHostEnabled,inviteOther:a.inviteOtherEnabled,mute:a.joinMute,autoRecord:a.autoRecord,preMeetingNotify:A.join(","),metadata:{venueName:a.venueName,meetingCompany:a.organizingUnit}};M8(x,{baseUrl:r.baseUrl,token:n.token}).then(P=>{console.log("修改预约会议",P),(P==null?void 0:P.data.code)===200&&(s.message("success","更新预约成功"),t("updateSuccess"),t("close"))})}},k=(w,A)=>{typeof w=="string"&&Number(w)<0&&(u.value[A].remind=0)};function D(){r=window.liveClient}return l.onMounted(async()=>{if(D(),n.previewType==="add")t("previewResetInviteList");else if(n.previewType==="edit"||n.previewType==="detail"){console.log("传参",n.previewMeetingData),a.roomName=n.previewMeetingData.roomName,a.beginDate=Zn(n.previewMeetingData.beginFullTime).format("YYYY/MM/DD"),a.beginTime=Zn(n.previewMeetingData.beginFullTime).format("HH:mm"),a.endDate=Zn(n.previewMeetingData.endFullTime).format("YYYY/MM/DD"),a.endTime=Zn(n.previewMeetingData.endFullTime).format("HH:mm"),a.venueName=n.previewMeetingData.venueName,a.organizingUnit=n.previewMeetingData.meetingCompany,a.timeZone=n.previewMeetingData.zone,a.joinBeforeHostEnabled=n.previewMeetingData.joinBefore,a.inviteOtherEnabled=n.previewMeetingData.inviteOthers,a.joinMute=n.previewMeetingData.joinMute,a.autoRecord=n.previewMeetingData.autoRecord;const w=n.previewMeetingData.preMeetingNotify.split(",");w.length>0&&(u.value=[],w.forEach(A=>{A.endsWith("m")?u.value.push({remind:A.substring(0,A.length-1),unit:"min"}):u.value.push({remind:A.substring(0,A.length-1),unit:"h"})})),hy({roomName:n.previewMeetingData.roomNum},{baseUrl:n.baseUrl,token:n.token}).then(A=>{if(console.log("获取预约邀请人列表",A),A.data.code===0)if(A.data.data.length>0){const x=A.data.data.filter(P=>JSON.parse(P.metadata).phone!==n.userData.mobile).map(P=>{const S=JSON.parse(P.metadata);return S.classify==="人员"?{classify:S.classify,userName:P.userName,userId:P.userId,mobile:S.phone,officeName:P.officeName,id:P.userId,label:P.userName,phone:S.phone,sourceTab:0}:{classify:S.classify,userName:P.userName,userId:P.userId,mobile:S.equipmentCode,officeName:P.officeName,phone:S.phone,equipmentCode:S.equipmentCode,equipmentPassword:S.equipmentPassword,equipmentType:S.equipmentType,id:P.userId,label:P.userName,sourceTab:0}});t("previewUpdateInviteList",x)}else t("previewUpdateInviteList",[]);else s.message("error","获取被邀请人列表失败"),t("previewUpdateInviteList",[])}),my(n.previewMeetingData.roomNum,{baseUrl:n.baseUrl,token:n.token}).then(A=>{var x,P;((x=A==null?void 0:A.data)==null?void 0:x.code)===0&&Array.isArray((P=A==null?void 0:A.data)==null?void 0:P.data)&&t("previewUpdateInviteList",[...n.inviteList,...A.data.data])}).catch(A=>console.error("queryConfSitesStatus error",A))}}),l.onBeforeUnmount(()=>{}),(w,A)=>{const x=l.resolveComponent("el-input"),P=l.resolveComponent("el-form-item"),S=l.resolveComponent("el-date-picker"),M=l.resolveComponent("el-time-select"),U=l.resolveComponent("el-option"),B=l.resolveComponent("el-select"),Q=l.resolveComponent("el-checkbox"),ie=l.resolveComponent("el-form");return l.openBlock(),l.createElementBlock("div",{class:"mask",onClick:A[14]||(A[14]=l.withModifiers(Y=>t("close"),["self"]))},[l.createElementVNode("div",{class:"dialog",style:l.normalizeStyle({width:n.width,height:n.height})},[l.createElementVNode("div",OO,[l.createElementVNode("div",MO,[RO,l.createElementVNode("span",null,l.toDisplayString(n.title),1)]),l.createElementVNode("div",LO,[l.createElementVNode("div",{class:"close-icon",onClick:A[0]||(A[0]=Y=>t("close"))})])]),l.createElementVNode("div",BO,[l.createElementVNode("div",UO,[l.createVNode(ie,{model:a,"hide-required-asterisk":"",ref_key:"previewForm",ref:o,"label-width":"100","label-position":"right",class:"customForm"},{default:l.withCtx(()=>[l.createVNode(P,{label:"会议主题"},{default:l.withCtx(()=>[l.createVNode(x,{modelValue:a.roomName,"onUpdate:modelValue":A[1]||(A[1]=Y=>a.roomName=Y),disabled:n.previewType==="detail",placeholder:"请输入"},null,8,["modelValue","disabled"])]),_:1}),l.createVNode(P,{label:"会场名称"},{default:l.withCtx(()=>[l.createVNode(x,{modelValue:a.venueName,"onUpdate:modelValue":A[2]||(A[2]=Y=>a.venueName=Y),disabled:n.previewType==="detail",placeholder:"请输入"},null,8,["modelValue","disabled"])]),_:1}),l.createVNode(P,{label:"组会单位"},{default:l.withCtx(()=>[l.createVNode(x,{modelValue:a.organizingUnit,"onUpdate:modelValue":A[3]||(A[3]=Y=>a.organizingUnit=Y),disabled:n.previewType==="detail",placeholder:"请输入"},null,8,["modelValue","disabled"])]),_:1}),l.createElementVNode("div",FO,[VO,l.createElementVNode("div",jO,[h.value<=3?(l.openBlock(),l.createElementBlock(l.Fragment,{key:0},[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(i.inviteList,(Y,q)=>(l.openBlock(),l.createElementBlock("div",{class:"invite-list-item invite-list-item-user",key:"i"+q}))),128)),l.createElementVNode("div",{class:"invite-list-item invite-list-item-system",onClick:b},$O)],64)):(l.openBlock(),l.createElementBlock(l.Fragment,{key:1},[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(i.inviteList.slice(0,3),(Y,q)=>(l.openBlock(),l.createElementBlock("div",{class:"invite-list-item invite-list-item-user",key:"i"+q}))),128)),HO,l.createElementVNode("div",qO,l.toDisplayString(h.value),1),l.createElementVNode("div",{class:"invite-list-item invite-list-item-system",onClick:b},zO)],64))])]),l.createVNode(P,{label:"开始时间"},{default:l.withCtx(()=>[l.createElementVNode("div",GO,[l.createVNode(S,{modelValue:a.beginDate,"onUpdate:modelValue":A[4]||(A[4]=Y=>a.beginDate=Y),disabled:n.previewType==="detail",type:"date",placeholder:"请选择",format:"YYYY/MM/DD",style:{"margin-right":"10px"}},null,8,["modelValue","disabled"]),l.createVNode(M,{modelValue:a.beginTime,"onUpdate:modelValue":A[5]||(A[5]=Y=>a.beginTime=Y),disabled:n.previewType==="detail",style:{width:"50%"},start:"00:00",step:"00:30",end:"23:59",placeholder:"请选择"},null,8,["modelValue","disabled"])])]),_:1}),l.createVNode(P,{label:"结束时间"},{default:l.withCtx(()=>[l.createElementVNode("div",WO,[l.createVNode(S,{modelValue:a.endDate,"onUpdate:modelValue":A[6]||(A[6]=Y=>a.endDate=Y),disabled:n.previewType==="detail",type:"date",placeholder:"请选择",format:"YYYY/MM/DD",style:{"margin-right":"5px"}},null,8,["modelValue","disabled"]),l.createVNode(M,{modelValue:a.endTime,"onUpdate:modelValue":A[7]||(A[7]=Y=>a.endTime=Y),disabled:n.previewType==="detail",style:{width:"50%"},start:"00:00",step:"00:30",end:"23:59",placeholder:"请选择"},null,8,["modelValue","disabled"])])]),_:1}),l.createVNode(P,{label:"时区"},{default:l.withCtx(()=>[l.createVNode(B,{modelValue:a.timeZone,"onUpdate:modelValue":A[8]||(A[8]=Y=>a.timeZone=Y),disabled:n.previewType==="detail",placeholder:"请选择"},{default:l.withCtx(()=>[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(c.value,Y=>(l.openBlock(),l.createBlock(U,{key:Y.value,label:Y.label,value:Y.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue","disabled"])]),_:1}),l.createVNode(P,{label:"会前提醒"},{default:l.withCtx(()=>[l.createElementVNode("div",KO,[l.createElementVNode("div",XO,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(u.value,(Y,q)=>(l.openBlock(),l.createElementBlock("div",{class:"meeting-remind-list",key:"r"+q},[l.createVNode(x,{modelValue:Y.remind,"onUpdate:modelValue":L=>Y.remind=L,type:"number",disabled:n.previewType==="detail",style:{width:"90px","margin-right":"10px"},min:0,onInput:L=>k(L,q)},null,8,["modelValue","onUpdate:modelValue","disabled","onInput"]),l.createVNode(B,{modelValue:Y.unit,"onUpdate:modelValue":L=>Y.unit=L,disabled:n.previewType==="detail",placeholder:"请选择",style:{width:"68px","margin-right":"10px"}},{default:l.withCtx(()=>[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(d.value,L=>(l.openBlock(),l.createBlock(U,{key:L.value,label:L.label,value:L.value},null,8,["label","value"]))),128))]),_:2},1032,["modelValue","onUpdate:modelValue","disabled"]),n.previewType!=="detail"?(l.openBlock(),l.createElementBlock("div",{key:0,class:"del-btn",onClick:L=>v(q)}," 删除 ",8,YO)):l.createCommentVNode("",!0)]))),128))]),n.previewType!=="detail"?(l.openBlock(),l.createElementBlock("div",{key:0,class:"btn-add",onClick:A[9]||(A[9]=Y=>y())}," 添加提醒 ")):(l.openBlock(),l.createElementBlock("div",JO))])]),_:1}),l.createVNode(P,{label:"会议设置"},{default:l.withCtx(()=>[l.createElementVNode("div",QO,[l.createVNode(Q,{modelValue:a.joinBeforeHostEnabled,"onUpdate:modelValue":A[10]||(A[10]=Y=>a.joinBeforeHostEnabled=Y),disabled:n.previewType==="detail",label:"允许在主持人入会之前加入"},null,8,["modelValue","disabled"]),l.createVNode(Q,{modelValue:a.inviteOtherEnabled,"onUpdate:modelValue":A[11]||(A[11]=Y=>a.inviteOtherEnabled=Y),disabled:n.previewType==="detail",label:"允许参会者邀请其他人"},null,8,["modelValue","disabled"]),l.createVNode(Q,{modelValue:a.joinMute,"onUpdate:modelValue":A[12]||(A[12]=Y=>a.joinMute=Y),disabled:n.previewType==="detail",label:"参会人加入会议时静音"},null,8,["modelValue","disabled"]),l.createVNode(Q,{modelValue:a.autoRecord,"onUpdate:modelValue":A[13]||(A[13]=Y=>a.autoRecord=Y),disabled:n.previewType==="detail",label:"自动录制"},null,8,["modelValue","disabled"])])]),_:1})]),_:1},8,["model"]),n.previewType!=="detail"?(l.openBlock(),l.createElementBlock("div",ZO,[l.createElementVNode("div",{class:"btn btn-cancel",onClick:f},"取消"),n.previewType==="add"?(l.openBlock(),l.createElementBlock("div",{key:0,class:"btn btn-confirm",onClick:m}," 预约会议 ")):l.createCommentVNode("",!0),n.previewType==="edit"?(l.openBlock(),l.createElementBlock("div",{key:1,class:"btn btn-confirm",onClick:_}," 修改预约 ")):l.createCommentVNode("",!0)])):l.createCommentVNode("",!0)])])],4)])}}},[["__scopeId","data-v-5376302e"]]),tM="/assets/img/index/jx.png",M_="/assets/img/index/sjt.png",R_="/assets/img/meeting/setting.png";function Ut(i,e,t){return e=lt(e),function(n,r){if(r&&(typeof r=="object"||typeof r=="function"))return r;if(r!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return ct(n)}(i,em()?Reflect.construct(e,t||[],lt(i).constructor):e.apply(i,t))}function em(){try{var i=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(em=function(){return!!i})()}function F(){F=function(){return e};var i,e={},t=Object.prototype,n=t.hasOwnProperty,r=Object.defineProperty||function(q,L,$){q[L]=$.value},s=typeof Symbol=="function"?Symbol:{},a=s.iterator||"@@iterator",o=s.asyncIterator||"@@asyncIterator",c=s.toStringTag||"@@toStringTag";function u(q,L,$){return Object.defineProperty(q,L,{value:$,enumerable:!0,configurable:!0,writable:!0}),q[L]}try{u({},"")}catch{u=function(L,$,H){return L[$]=H}}function d(q,L,$,H){var j=L&&L.prototype instanceof m?L:m,W=Object.create(j.prototype),ae=new ie(H||[]);return r(W,"_invoke",{value:M(q,$,ae)}),W}function h(q,L,$){try{return{type:"normal",arg:q.call(L,$)}}catch(H){return{type:"throw",arg:H}}}e.wrap=d;var b="suspendedStart",v="suspendedYield",y="executing",p="completed",f={};function m(){}function _(){}function k(){}var D={};u(D,a,function(){return this});var w=Object.getPrototypeOf,A=w&&w(w(Y([])));A&&A!==t&&n.call(A,a)&&(D=A);var x=k.prototype=m.prototype=Object.create(D);function P(q){["next","throw","return"].forEach(function(L){u(q,L,function($){return this._invoke(L,$)})})}function S(q,L){function $(j,W,ae,Ee){var Ae=h(q[j],q,W);if(Ae.type!=="throw"){var ee=Ae.arg,fe=ee.value;return fe&&typeof fe=="object"&&n.call(fe,"__await")?L.resolve(fe.__await).then(function(xe){$("next",xe,ae,Ee)},function(xe){$("throw",xe,ae,Ee)}):L.resolve(fe).then(function(xe){ee.value=xe,ae(ee)},function(xe){return $("throw",xe,ae,Ee)})}Ee(Ae.arg)}var H;r(this,"_invoke",{value:function(j,W){function ae(){return new L(function(Ee,Ae){$(j,W,Ee,Ae)})}return H=H?H.then(ae,ae):ae()}})}function M(q,L,$){var H=b;return function(j,W){if(H===y)throw new Error("Generator is already running");if(H===p){if(j==="throw")throw W;return{value:i,done:!0}}for($.method=j,$.arg=W;;){var ae=$.delegate;if(ae){var Ee=U(ae,$);if(Ee){if(Ee===f)continue;return Ee}}if($.method==="next")$.sent=$._sent=$.arg;else if($.method==="throw"){if(H===b)throw H=p,$.arg;$.dispatchException($.arg)}else $.method==="return"&&$.abrupt("return",$.arg);H=y;var Ae=h(q,L,$);if(Ae.type==="normal"){if(H=$.done?p:v,Ae.arg===f)continue;return{value:Ae.arg,done:$.done}}Ae.type==="throw"&&(H=p,$.method="throw",$.arg=Ae.arg)}}}function U(q,L){var $=L.method,H=q.iterator[$];if(H===i)return L.delegate=null,$==="throw"&&q.iterator.return&&(L.method="return",L.arg=i,U(q,L),L.method==="throw")||$!=="return"&&(L.method="throw",L.arg=new TypeError("The iterator does not provide a '"+$+"' method")),f;var j=h(H,q.iterator,L.arg);if(j.type==="throw")return L.method="throw",L.arg=j.arg,L.delegate=null,f;var W=j.arg;return W?W.done?(L[q.resultName]=W.value,L.next=q.nextLoc,L.method!=="return"&&(L.method="next",L.arg=i),L.delegate=null,f):W:(L.method="throw",L.arg=new TypeError("iterator result is not an object"),L.delegate=null,f)}function B(q){var L={tryLoc:q[0]};1 in q&&(L.catchLoc=q[1]),2 in q&&(L.finallyLoc=q[2],L.afterLoc=q[3]),this.tryEntries.push(L)}function Q(q){var L=q.completion||{};L.type="normal",delete L.arg,q.completion=L}function ie(q){this.tryEntries=[{tryLoc:"root"}],q.forEach(B,this),this.reset(!0)}function Y(q){if(q||q===""){var L=q[a];if(L)return L.call(q);if(typeof q.next=="function")return q;if(!isNaN(q.length)){var $=-1,H=function j(){for(;++$<q.length;)if(n.call(q,$))return j.value=q[$],j.done=!1,j;return j.value=i,j.done=!0,j};return H.next=H}}throw new TypeError(typeof q+" is not iterable")}return _.prototype=k,r(x,"constructor",{value:k,configurable:!0}),r(k,"constructor",{value:_,configurable:!0}),_.displayName=u(k,c,"GeneratorFunction"),e.isGeneratorFunction=function(q){var L=typeof q=="function"&&q.constructor;return!!L&&(L===_||(L.displayName||L.name)==="GeneratorFunction")},e.mark=function(q){return Object.setPrototypeOf?Object.setPrototypeOf(q,k):(q.__proto__=k,u(q,c,"GeneratorFunction")),q.prototype=Object.create(x),q},e.awrap=function(q){return{__await:q}},P(S.prototype),u(S.prototype,o,function(){return this}),e.AsyncIterator=S,e.async=function(q,L,$,H,j){j===void 0&&(j=Promise);var W=new S(d(q,L,$,H),j);return e.isGeneratorFunction(L)?W:W.next().then(function(ae){return ae.done?ae.value:W.next()})},P(x),u(x,c,"Generator"),u(x,a,function(){return this}),u(x,"toString",function(){return"[object Generator]"}),e.keys=function(q){var L=Object(q),$=[];for(var H in L)$.push(H);return $.reverse(),function j(){for(;$.length;){var W=$.pop();if(W in L)return j.value=W,j.done=!1,j}return j.done=!0,j}},e.values=Y,ie.prototype={constructor:ie,reset:function(q){if(this.prev=0,this.next=0,this.sent=this._sent=i,this.done=!1,this.delegate=null,this.method="next",this.arg=i,this.tryEntries.forEach(Q),!q)for(var L in this)L.charAt(0)==="t"&&n.call(this,L)&&!isNaN(+L.slice(1))&&(this[L]=i)},stop:function(){this.done=!0;var q=this.tryEntries[0].completion;if(q.type==="throw")throw q.arg;return this.rval},dispatchException:function(q){if(this.done)throw q;var L=this;function $(Ae,ee){return W.type="throw",W.arg=q,L.next=Ae,ee&&(L.method="next",L.arg=i),!!ee}for(var H=this.tryEntries.length-1;H>=0;--H){var j=this.tryEntries[H],W=j.completion;if(j.tryLoc==="root")return $("end");if(j.tryLoc<=this.prev){var ae=n.call(j,"catchLoc"),Ee=n.call(j,"finallyLoc");if(ae&&Ee){if(this.prev<j.catchLoc)return $(j.catchLoc,!0);if(this.prev<j.finallyLoc)return $(j.finallyLoc)}else if(ae){if(this.prev<j.catchLoc)return $(j.catchLoc,!0)}else{if(!Ee)throw new Error("try statement without catch or finally");if(this.prev<j.finallyLoc)return $(j.finallyLoc)}}}},abrupt:function(q,L){for(var $=this.tryEntries.length-1;$>=0;--$){var H=this.tryEntries[$];if(H.tryLoc<=this.prev&&n.call(H,"finallyLoc")&&this.prev<H.finallyLoc){var j=H;break}}j&&(q==="break"||q==="continue")&&j.tryLoc<=L&&L<=j.finallyLoc&&(j=null);var W=j?j.completion:{};return W.type=q,W.arg=L,j?(this.method="next",this.next=j.finallyLoc,f):this.complete(W)},complete:function(q,L){if(q.type==="throw")throw q.arg;return q.type==="break"||q.type==="continue"?this.next=q.arg:q.type==="return"?(this.rval=this.arg=q.arg,this.method="return",this.next="end"):q.type==="normal"&&L&&(this.next=L),f},finish:function(q){for(var L=this.tryEntries.length-1;L>=0;--L){var $=this.tryEntries[L];if($.finallyLoc===q)return this.complete($.completion,$.afterLoc),Q($),f}},catch:function(q){for(var L=this.tryEntries.length-1;L>=0;--L){var $=this.tryEntries[L];if($.tryLoc===q){var H=$.completion;if(H.type==="throw"){var j=H.arg;Q($)}return j}}throw new Error("illegal catch attempt")},delegateYield:function(q,L,$){return this.delegate={iterator:Y(q),resultName:L,nextLoc:$},this.method==="next"&&(this.arg=i),f}},e}function L_(i){var e=function(t,n){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var s=r.call(t,n);if(typeof s!="object")return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return(n==="string"?String:Number)(t)}(i,"string");return typeof e=="symbol"?e:String(e)}function et(i){return et=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},et(i)}function B_(i,e,t,n,r,s,a){try{var o=i[s](a),c=o.value}catch(u){return void t(u)}o.done?e(c):Promise.resolve(c).then(n,r)}function An(i){return function(){var e=this,t=arguments;return new Promise(function(n,r){var s=i.apply(e,t);function a(c){B_(s,n,r,a,o,"next",c)}function o(c){B_(s,n,r,a,o,"throw",c)}a(void 0)})}}function ht(i,e){if(!(i instanceof e))throw new TypeError("Cannot call a class as a function")}function U_(i,e){for(var t=0;t<e.length;t++){var n=e[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(i,L_(n.key),n)}}function ft(i,e,t){return e&&U_(i.prototype,e),t&&U_(i,t),Object.defineProperty(i,"prototype",{writable:!1}),i}function ao(i,e,t){return(e=L_(e))in i?Object.defineProperty(i,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):i[e]=t,i}function Ft(i,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");i.prototype=Object.create(e&&e.prototype,{constructor:{value:i,writable:!0,configurable:!0}}),Object.defineProperty(i,"prototype",{writable:!1}),e&&Al(i,e)}function lt(i){return lt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},lt(i)}function Al(i,e){return Al=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,n){return t.__proto__=n,t},Al(i,e)}function Ju(i){var e=typeof Map=="function"?new Map:void 0;return Ju=function(t){if(t===null||!function(r){try{return Function.toString.call(r).indexOf("[native code]")!==-1}catch{return typeof r=="function"}}(t))return t;if(typeof t!="function")throw new TypeError("Super expression must either be null or a function");if(e!==void 0){if(e.has(t))return e.get(t);e.set(t,n)}function n(){return function(r,s,a){if(em())return Reflect.construct.apply(null,arguments);var o=[null];o.push.apply(o,s);var c=new(r.bind.apply(r,o));return a&&Al(c,a.prototype),c}(t,arguments,lt(this).constructor)}return n.prototype=Object.create(t.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),Al(n,t)},Ju(i)}function ct(i){if(i===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return i}function pt(){return pt=typeof Reflect<"u"&&Reflect.get?Reflect.get.bind():function(i,e,t){var n=function(s,a){for(;!Object.prototype.hasOwnProperty.call(s,a)&&(s=lt(s))!==null;);return s}(i,e);if(n){var r=Object.getOwnPropertyDescriptor(n,e);return r.get?r.get.call(3>arguments.length?i:t):r.value}},pt.apply(this,arguments)}function Pt(i,e){return function(t){if(Array.isArray(t))return t}(i)||function(t,n){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var s,a,o,c,u=[],d=!0,h=!1;try{if(o=(r=r.call(t)).next,n===0){if(Object(r)!==r)return;d=!1}else for(;!(d=(s=o.call(r)).done)&&(u.push(s.value),u.length!==n);d=!0);}catch(b){h=!0,a=b}finally{try{if(!d&&r.return!=null&&(c=r.return(),Object(c)!==c))return}finally{if(h)throw a}}return u}}(i,e)||tm(i,e)||function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
285
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function Pi(i){return function(e){if(Array.isArray(e))return nm(e)}(i)||function(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}(i)||tm(i)||function(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
286
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function tm(i,e){if(i){if(typeof i=="string")return nm(i,e);var t=Object.prototype.toString.call(i).slice(8,-1);return t==="Object"&&i.constructor&&(t=i.constructor.name),t==="Map"||t==="Set"?Array.from(i):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?nm(i,e):void 0}}function nm(i,e){(e==null||e>i.length)&&(e=i.length);for(var t=0,n=new Array(e);e>t;t++)n[t]=i[t];return n}function dt(i,e){var t=typeof Symbol<"u"&&i[Symbol.iterator]||i["@@iterator"];if(!t){if(Array.isArray(i)||(t=tm(i))||e){t&&(i=t);var n=0,r=function(){};return{s:r,n:function(){return n<i.length?{done:!1,value:i[n++]}:{done:!0}},e:function(c){throw c},f:r}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
287
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var s,a=!0,o=!1;return{s:function(){t=t.call(i)},n:function(){var c=t.next();return a=c.done,c},e:function(c){o=!0,s=c},f:function(){try{a||t.return==null||t.return()}finally{if(o)throw s}}}}function Nt(i,e){return function(t,n){return n.get?n.get.call(t):n.value}(i,F_(i,e,"get"))}function Or(i,e,t){return function(n,r,s){if(r.set)r.set.call(n,s);else{if(!r.writable)throw new TypeError("attempted to set read only private field");r.value=s}}(i,F_(i,e,"set"),t),t}function F_(i,e,t){if(!e.has(i))throw new TypeError("attempted to "+t+" private field on non-instance");return e.get(i)}function en(i,e,t){if(!e.has(i))throw new TypeError("attempted to get private field on non-instance");return t}function V_(i,e){if(e.has(i))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Mr(i,e,t){V_(i,e),e.set(i,t)}function Wi(i,e){V_(i,e),e.add(i)}function nM(i,e){return e.forEach(function(t){t&&typeof t!="string"&&!Array.isArray(t)&&Object.keys(t).forEach(function(n){if(n!=="default"&&!(n in i)){var r=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(i,n,r.get?r:{enumerable:!0,get:function(){return t[n]}})}})}),Object.freeze(i)}function sn(i,e){if(!i)throw new Error(e)}var iM=34028234663852886e22,rM=-34028234663852886e22,sM=4294967295,aM=2147483647,oM=-2147483648;function Qu(i){if(typeof i!="number")throw new Error("invalid int 32: "+et(i));if(!Number.isInteger(i)||i>aM||oM>i)throw new Error("invalid int 32: "+i)}function im(i){if(typeof i!="number")throw new Error("invalid uint 32: "+et(i));if(!Number.isInteger(i)||i>sM||0>i)throw new Error("invalid uint 32: "+i)}function j_(i){if(typeof i!="number")throw new Error("invalid float 32: "+et(i));if(Number.isFinite(i)&&(i>iM||rM>i))throw new Error("invalid float 32: "+i)}var $_=Symbol("@bufbuild/protobuf/enum-type");function lM(i){var e=i[$_];return sn(e,"missing enum type on enum object"),e}function H_(i,e,t,n){i[$_]=q_(e,t.map(function(r){return{no:r.no,name:r.name,localName:i[r.no]}}))}function q_(i,e,t){var n,r=Object.create(null),s=Object.create(null),a=[],o=dt(e);try{for(o.s();!(n=o.n()).done;){var c=n.value,u=z_(c);a.push(u),r[c.name]=u,s[c.no]=u}}catch(d){o.e(d)}finally{o.f()}return{typeName:i,values:a,findName:function(d){return r[d]},findNumber:function(d){return s[d]}}}function cM(i,e,t){var n,r={},s=dt(e);try{for(s.s();!(n=s.n()).done;){var a=z_(n.value);r[a.localName]=a.no,r[a.no]=a.localName}}catch(o){s.e(o)}finally{s.f()}return H_(r,i,e),r}function z_(i){return"localName"in i?i:Object.assign(Object.assign({},i),{localName:i.name})}var rm=function(){function i(){ht(this,i)}return ft(i,[{key:"equals",value:function(e){return this.getType().runtime.util.equals(this.getType(),this,e)}},{key:"clone",value:function(){return this.getType().runtime.util.clone(this)}},{key:"fromBinary",value:function(e,t){var n=this.getType().runtime.bin,r=n.makeReadOptions(t);return n.readMessage(this,r.readerFactory(e),e.byteLength,r),this}},{key:"fromJson",value:function(e,t){var n=this.getType(),r=n.runtime.json,s=r.makeReadOptions(t);return r.readMessage(n,e,s,this),this}},{key:"fromJsonString",value:function(e,t){var n;try{n=JSON.parse(e)}catch(r){throw new Error("cannot decode ".concat(this.getType().typeName," from JSON: ").concat(r instanceof Error?r.message:String(r)))}return this.fromJson(n,t)}},{key:"toBinary",value:function(e){var t=this.getType().runtime.bin,n=t.makeWriteOptions(e),r=n.writerFactory();return t.writeMessage(this,r,n),r.finish()}},{key:"toJson",value:function(e){var t=this.getType().runtime.json,n=t.makeWriteOptions(e);return t.writeMessage(this,n)}},{key:"toJsonString",value:function(e){var t,n=this.toJson(e);return JSON.stringify(n,null,(t=e==null?void 0:e.prettySpaces)!==null&&t!==void 0?t:0)}},{key:"toJSON",value:function(){return this.toJson({emitDefaultValues:!0})}},{key:"getType",value:function(){return Object.getPrototypeOf(this).constructor}}]),i}();function uM(){for(var i=0,e=0,t=0;28>t;t+=7){var n=this.buf[this.pos++];if(i|=(127&n)<<t,(128&n)==0)return this.assertBounds(),[i,e]}var r=this.buf[this.pos++];if(i|=(15&r)<<28,e=(112&r)>>4,(128&r)==0)return this.assertBounds(),[i,e];for(var s=3;31>=s;s+=7){var a=this.buf[this.pos++];if(e|=(127&a)<<s,(128&a)==0)return this.assertBounds(),[i,e]}throw new Error("invalid varint")}function sm(i,e,t){for(var n=0;28>n;n+=7){var r=i>>>n,s=!(!(r>>>7)&&e==0),a=255&(s?128|r:r);if(t.push(a),!s)return}var o=i>>>28&15|(7&e)<<4,c=!!(e>>3);if(t.push(255&(c?128|o:o)),c){for(var u=3;31>u;u+=7){var d=e>>>u,h=!!(d>>>7),b=255&(h?128|d:d);if(t.push(b),!h)return}t.push(e>>>31&1)}}var Zu=4294967296;function G_(i){var e=i[0]==="-";e&&(i=i.slice(1));var t=1e6,n=0,r=0;function s(a,o){var c=Number(i.slice(a,o));r*=t,Zu>(n=n*t+c)||(r+=n/Zu|0,n%=Zu)}return s(-24,-18),s(-18,-12),s(-12,-6),s(-6),e?K_(n,r):am(n,r)}function W_(i,e){var t=function(u,d){return{lo:u>>>0,hi:d>>>0}}(i,e);if(i=t.lo,2097151>=(e=t.hi))return String(Zu*e+i);var n=16777215&(i>>>24|e<<8),r=e>>16&65535,s=(16777215&i)+6777216*n+6710656*r,a=n+8147497*r,o=2*r,c=1e7;return c>s||(a+=Math.floor(s/c),s%=c),c>a||(o+=Math.floor(a/c),a%=c),o.toString()+X_(a)+X_(s)}function am(i,e){return{lo:0|i,hi:0|e}}function K_(i,e){return e=~e,i?i=1+~i:e+=1,am(i,e)}var X_=function(i){var e=String(i);return"0000000".slice(e.length)+e};function Y_(i,e){if(i<0){for(var t=0;9>t;t++)e.push(127&i|128),i>>=7;e.push(1)}else{for(;i>127;)e.push(127&i|128),i>>>=7;e.push(i)}}function dM(){var i=this.buf[this.pos++],e=127&i;if(!(128&i))return this.assertBounds(),e;if(e|=(127&(i=this.buf[this.pos++]))<<7,(128&i)==0)return this.assertBounds(),e;if(e|=(127&(i=this.buf[this.pos++]))<<14,(128&i)==0)return this.assertBounds(),e;if(e|=(127&(i=this.buf[this.pos++]))<<21,(128&i)==0)return this.assertBounds(),e;e|=(15&(i=this.buf[this.pos++]))<<28;for(var t=5;128&i&&10>t;t++)i=this.buf[this.pos++];if(128&i)throw new Error("invalid varint");return this.assertBounds(),e>>>0}var Pe,fs,hn,Gt=function(){var i=new DataView(new ArrayBuffer(8));if(typeof BigInt=="function"&&typeof i.getBigInt64=="function"&&typeof i.getBigUint64=="function"&&typeof i.setBigInt64=="function"&&typeof i.setBigUint64=="function"&&((typeof process>"u"?"undefined":et(process))!="object"||et(process.env)!="object"||process.env.BUF_BIGINT_DISABLE!=="1")){var e=BigInt("-9223372036854775808"),t=BigInt("9223372036854775807"),n=BigInt("0"),r=BigInt("18446744073709551615");return{zero:BigInt(0),supported:!0,parse:function(o){var c=typeof o=="bigint"?o:BigInt(o);if(c>t||e>c)throw new Error("int64 invalid: ".concat(o));return c},uParse:function(o){var c=typeof o=="bigint"?o:BigInt(o);if(c>r||n>c)throw new Error("uint64 invalid: ".concat(o));return c},enc:function(o){return i.setBigInt64(0,this.parse(o),!0),{lo:i.getInt32(0,!0),hi:i.getInt32(4,!0)}},uEnc:function(o){return i.setBigInt64(0,this.uParse(o),!0),{lo:i.getInt32(0,!0),hi:i.getInt32(4,!0)}},dec:function(o,c){return i.setInt32(0,o,!0),i.setInt32(4,c,!0),i.getBigInt64(0,!0)},uDec:function(o,c){return i.setInt32(0,o,!0),i.setInt32(4,c,!0),i.getBigUint64(0,!0)}}}var s=function(o){return sn(/^-?[0-9]+$/.test(o),"int64 invalid: ".concat(o))},a=function(o){return sn(/^[0-9]+$/.test(o),"uint64 invalid: ".concat(o))};return{zero:"0",supported:!1,parse:function(o){return typeof o!="string"&&(o=o.toString()),s(o),o},uParse:function(o){return typeof o!="string"&&(o=o.toString()),a(o),o},enc:function(o){return typeof o!="string"&&(o=o.toString()),s(o),G_(o)},uEnc:function(o){return typeof o!="string"&&(o=o.toString()),a(o),G_(o)},dec:function(o,c){return function(u,d){var h=am(u,d),b=2147483648&h.hi;b&&(h=K_(h.lo,h.hi));var v=W_(h.lo,h.hi);return b?"-"+v:v}(o,c)},uDec:function(o,c){return W_(o,c)}}}();function ps(i,e,t){if(e===t)return!0;if(i==Pe.BYTES){if(!(e instanceof Uint8Array&&t instanceof Uint8Array)||e.length!==t.length)return!1;for(var n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}switch(i){case Pe.UINT64:case Pe.FIXED64:case Pe.INT64:case Pe.SFIXED64:case Pe.SINT64:return e==t}return!1}function oo(i,e){switch(i){case Pe.BOOL:return!1;case Pe.UINT64:case Pe.FIXED64:case Pe.INT64:case Pe.SFIXED64:case Pe.SINT64:return e==0?Gt.zero:"0";case Pe.DOUBLE:case Pe.FLOAT:return 0;case Pe.BYTES:return new Uint8Array(0);case Pe.STRING:return"";default:return 0}}function J_(i,e){switch(i){case Pe.BOOL:return e===!1;case Pe.STRING:return e==="";case Pe.BYTES:return e instanceof Uint8Array&&!e.byteLength;default:return e==0}}(function(i){i[i.DOUBLE=1]="DOUBLE",i[i.FLOAT=2]="FLOAT",i[i.INT64=3]="INT64",i[i.UINT64=4]="UINT64",i[i.INT32=5]="INT32",i[i.FIXED64=6]="FIXED64",i[i.FIXED32=7]="FIXED32",i[i.BOOL=8]="BOOL",i[i.STRING=9]="STRING",i[i.BYTES=12]="BYTES",i[i.UINT32=13]="UINT32",i[i.SFIXED32=15]="SFIXED32",i[i.SFIXED64=16]="SFIXED64",i[i.SINT32=17]="SINT32",i[i.SINT64=18]="SINT64"})(Pe||(Pe={})),function(i){i[i.BIGINT=0]="BIGINT",i[i.STRING=1]="STRING"}(fs||(fs={})),function(i){i[i.Varint=0]="Varint",i[i.Bit64=1]="Bit64",i[i.LengthDelimited=2]="LengthDelimited",i[i.StartGroup=3]="StartGroup",i[i.EndGroup=4]="EndGroup",i[i.Bit32=5]="Bit32"}(hn||(hn={}));var hM=function(){function i(e){ht(this,i),this.stack=[],this.textEncoder=e??new TextEncoder,this.chunks=[],this.buf=[]}return ft(i,[{key:"finish",value:function(){this.chunks.push(new Uint8Array(this.buf));for(var e=0,t=0;t<this.chunks.length;t++)e+=this.chunks[t].length;for(var n=new Uint8Array(e),r=0,s=0;s<this.chunks.length;s++)n.set(this.chunks[s],r),r+=this.chunks[s].length;return this.chunks=[],n}},{key:"fork",value:function(){return this.stack.push({chunks:this.chunks,buf:this.buf}),this.chunks=[],this.buf=[],this}},{key:"join",value:function(){var e=this.finish(),t=this.stack.pop();if(!t)throw new Error("invalid state, fork stack empty");return this.chunks=t.chunks,this.buf=t.buf,this.uint32(e.byteLength),this.raw(e)}},{key:"tag",value:function(e,t){return this.uint32((e<<3|t)>>>0)}},{key:"raw",value:function(e){return this.buf.length&&(this.chunks.push(new Uint8Array(this.buf)),this.buf=[]),this.chunks.push(e),this}},{key:"uint32",value:function(e){for(im(e);e>127;)this.buf.push(127&e|128),e>>>=7;return this.buf.push(e),this}},{key:"int32",value:function(e){return Qu(e),Y_(e,this.buf),this}},{key:"bool",value:function(e){return this.buf.push(e?1:0),this}},{key:"bytes",value:function(e){return this.uint32(e.byteLength),this.raw(e)}},{key:"string",value:function(e){var t=this.textEncoder.encode(e);return this.uint32(t.byteLength),this.raw(t)}},{key:"float",value:function(e){j_(e);var t=new Uint8Array(4);return new DataView(t.buffer).setFloat32(0,e,!0),this.raw(t)}},{key:"double",value:function(e){var t=new Uint8Array(8);return new DataView(t.buffer).setFloat64(0,e,!0),this.raw(t)}},{key:"fixed32",value:function(e){im(e);var t=new Uint8Array(4);return new DataView(t.buffer).setUint32(0,e,!0),this.raw(t)}},{key:"sfixed32",value:function(e){Qu(e);var t=new Uint8Array(4);return new DataView(t.buffer).setInt32(0,e,!0),this.raw(t)}},{key:"sint32",value:function(e){return Qu(e),Y_(e=(e<<1^e>>31)>>>0,this.buf),this}},{key:"sfixed64",value:function(e){var t=new Uint8Array(8),n=new DataView(t.buffer),r=Gt.enc(e);return n.setInt32(0,r.lo,!0),n.setInt32(4,r.hi,!0),this.raw(t)}},{key:"fixed64",value:function(e){var t=new Uint8Array(8),n=new DataView(t.buffer),r=Gt.uEnc(e);return n.setInt32(0,r.lo,!0),n.setInt32(4,r.hi,!0),this.raw(t)}},{key:"int64",value:function(e){var t=Gt.enc(e);return sm(t.lo,t.hi,this.buf),this}},{key:"sint64",value:function(e){var t=Gt.enc(e),n=t.hi>>31;return sm(t.lo<<1^n,(t.hi<<1|t.lo>>>31)^n,this.buf),this}},{key:"uint64",value:function(e){var t=Gt.uEnc(e);return sm(t.lo,t.hi,this.buf),this}}]),i}(),fM=function(){function i(e,t){ht(this,i),this.varint64=uM,this.uint32=dM,this.buf=e,this.len=e.length,this.pos=0,this.view=new DataView(e.buffer,e.byteOffset,e.byteLength),this.textDecoder=t??new TextDecoder}return ft(i,[{key:"tag",value:function(){var e=this.uint32(),t=e>>>3,n=7&e;if(0>=t||0>n||n>5)throw new Error("illegal tag: field no "+t+" wire type "+n);return[t,n]}},{key:"skip",value:function(e,t){var n=this.pos;switch(e){case hn.Varint:for(;128&this.buf[this.pos++];);break;case hn.Bit64:this.pos+=4;case hn.Bit32:this.pos+=4;break;case hn.LengthDelimited:var r=this.uint32();this.pos+=r;break;case hn.StartGroup:for(;;){var s=Pt(this.tag(),2),a=s[0],o=s[1];if(o===hn.EndGroup){if(t!==void 0&&a!==t)throw new Error("invalid end group tag");break}this.skip(o,a)}break;default:throw new Error("cant skip wire type "+e)}return this.assertBounds(),this.buf.subarray(n,this.pos)}},{key:"assertBounds",value:function(){if(this.pos>this.len)throw new RangeError("premature EOF")}},{key:"int32",value:function(){return 0|this.uint32()}},{key:"sint32",value:function(){var e=this.uint32();return e>>>1^-(1&e)}},{key:"int64",value:function(){return Gt.dec.apply(Gt,Pi(this.varint64()))}},{key:"uint64",value:function(){return Gt.uDec.apply(Gt,Pi(this.varint64()))}},{key:"sint64",value:function(){var e=Pt(this.varint64(),2),t=e[0],n=e[1],r=-(1&t);return t=(t>>>1|(1&n)<<31)^r,n=n>>>1^r,Gt.dec(t,n)}},{key:"bool",value:function(){var e=Pt(this.varint64(),2),t=e[0],n=e[1];return t!==0||n!==0}},{key:"fixed32",value:function(){return this.view.getUint32((this.pos+=4)-4,!0)}},{key:"sfixed32",value:function(){return this.view.getInt32((this.pos+=4)-4,!0)}},{key:"fixed64",value:function(){return Gt.uDec(this.sfixed32(),this.sfixed32())}},{key:"sfixed64",value:function(){return Gt.dec(this.sfixed32(),this.sfixed32())}},{key:"float",value:function(){return this.view.getFloat32((this.pos+=4)-4,!0)}},{key:"double",value:function(){return this.view.getFloat64((this.pos+=8)-8,!0)}},{key:"bytes",value:function(){var e=this.uint32(),t=this.pos;return this.pos+=e,this.assertBounds(),this.buf.subarray(t,t+e)}},{key:"string",value:function(){return this.textDecoder.decode(this.bytes())}}]),i}();function Q_(i){var e=i.field.localName,t=Object.create(null);return t[e]=function(n){var r=n.field;if(r.repeated)return[];if(r.default!==void 0)return r.default;switch(r.kind){case"enum":return r.T.values[0].no;case"scalar":return oo(r.T,r.L);case"message":var s=r.T,a=new s;return s.fieldWrapper?s.fieldWrapper.unwrapField(a):a;case"map":throw"map fields are not allowed to be extensions"}}(i),[t,function(){return t[e]}]}for(var Rr="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split(""),ed=[],td=0;td<Rr.length;td++)ed[Rr[td].charCodeAt(0)]=td;ed[45]=Rr.indexOf("+"),ed[95]=Rr.indexOf("/");var Z_={dec:function(i){var e=3*i.length/4;i[i.length-2]=="="?e-=2:i[i.length-1]=="="&&(e-=1);for(var t,n=new Uint8Array(e),r=0,s=0,a=0,o=0;o<i.length;o++){if((t=ed[i.charCodeAt(o)])===void 0)switch(i[o]){case"=":s=0;case`
288
+ `:case"\r":case" ":case" ":continue;default:throw Error("invalid base64 string.")}switch(s){case 0:a=t,s=1;break;case 1:n[r++]=a<<2|(48&t)>>4,a=t,s=2;break;case 2:n[r++]=(15&a)<<4|(60&t)>>2,a=t,s=3;break;case 3:n[r++]=(3&a)<<6|t,s=0;break}}if(s==1)throw Error("invalid base64 string.");return n.subarray(0,r)},enc:function(i){for(var e,t="",n=0,r=0,s=0;s<i.length;s++)switch(e=i[s],n){case 0:t+=Rr[e>>2],r=(3&e)<<4,n=1;break;case 1:t+=Rr[r|e>>4],r=(15&e)<<2,n=2;break;case 2:t+=Rr[r|e>>6],t+=Rr[63&e],n=0;break}return n&&(t+=Rr[r],t+="=",n==1&&(t+="=")),t}};function pM(i,e,t){tk(e,i);var n,r=e.runtime.bin.makeReadOptions(t),s=function(h,b){if(!b.repeated&&(b.kind=="enum"||b.kind=="scalar")){for(var v=h.length-1;v>=0;--v)if(h[v].no==b.no)return[h[v]];return[]}return h.filter(function(y){return y.no===b.no})}(i.getType().runtime.bin.listUnknownFields(i),e.field),a=Pt(Q_(e),2),o=a[0],c=a[1],u=dt(s);try{for(u.s();!(n=u.n()).done;){var d=n.value;e.runtime.bin.readField(o,r.readerFactory(d.data),e.field,d.wireType,r)}}catch(h){u.e(h)}finally{u.f()}return c()}function mM(i,e,t,n){tk(e,i);var r=e.runtime.bin.makeReadOptions(n),s=e.runtime.bin.makeWriteOptions(n);if(ek(i,e)){var a=i.getType().runtime.bin.listUnknownFields(i).filter(function(m){return m.no!=e.field.no});i.getType().runtime.bin.discardUnknownFields(i);var o,c=dt(a);try{for(c.s();!(o=c.n()).done;){var u=o.value;i.getType().runtime.bin.onUnknownField(i,u.no,u.wireType,u.data)}}catch(m){c.e(m)}finally{c.f()}}var d=s.writerFactory(),h=e.field;h.opt||h.repeated||h.kind!="enum"&&h.kind!="scalar"||(h=Object.assign(Object.assign({},e.field),{opt:!0})),e.runtime.bin.writeField(h,t,d,s);for(var b=r.readerFactory(d.finish());b.pos<b.len;){var v=Pt(b.tag(),2),y=v[0],p=v[1],f=b.skip(p,y);i.getType().runtime.bin.onUnknownField(i,y,p,f)}}function ek(i,e){var t=i.getType();return e.extendee.typeName===t.typeName&&!!t.runtime.bin.listUnknownFields(i).find(function(n){return n.no==e.field.no})}function tk(i,e){sn(i.extendee.typeName==e.getType().typeName,"extension ".concat(i.typeName," can only be applied to message ").concat(i.extendee.typeName))}function nk(i,e){var t=i.localName;if(i.repeated)return e[t].length>0;if(i.oneof)return e[i.oneof.localName].case===t;switch(i.kind){case"enum":case"scalar":return i.opt||i.req?e[t]!==void 0:i.kind=="enum"?e[t]!==i.T.values[0].no:!J_(i.T,e[t]);case"message":return e[t]!==void 0;case"map":return Object.keys(e[t]).length>0}}function ik(i,e){var t=i.localName,n=!i.opt&&!i.req;if(i.repeated)e[t]=[];else if(i.oneof)e[i.oneof.localName]={case:void 0};else switch(i.kind){case"map":e[t]={};break;case"enum":e[t]=n?i.T.values[0].no:void 0;break;case"scalar":e[t]=n?oo(i.T,i.L):void 0;break;case"message":e[t]=void 0;break}}function Ws(i,e){if(i===null||et(i)!="object"||!Object.getOwnPropertyNames(rm.prototype).every(function(n){return n in i&&typeof i[n]=="function"}))return!1;var t=i.getType();return t!==null&&typeof t=="function"&&"typeName"in t&&typeof t.typeName=="string"&&(e===void 0||t.typeName==e.typeName)}function rk(i,e){return Ws(e)||!i.fieldWrapper?e:i.fieldWrapper.wrapField(e)}Pe.DOUBLE,Pe.FLOAT,Pe.INT64,Pe.UINT64,Pe.INT32,Pe.UINT32,Pe.BOOL,Pe.STRING,Pe.BYTES;var sk={ignoreUnknownFields:!1},ak={emitDefaultValues:!1,enumAsInteger:!1,useProtoFieldName:!1,prettySpaces:0};function gM(i){return i?Object.assign(Object.assign({},sk),i):sk}function vM(i){return i?Object.assign(Object.assign({},ak),i):ak}var nd=Symbol(),id=Symbol();function pr(i){if(i===null)return"null";switch(et(i)){case"object":return Array.isArray(i)?"array":"object";case"string":return i.length>100?"string":'"'.concat(i.split('"').join('\\"'),'"');default:return String(i)}}function ok(i,e,t,n,r){var s=t.localName;if(t.repeated){if(sn(t.kind!="map"),e===null)return;if(!Array.isArray(e))throw new Error("cannot decode field ".concat(r.typeName,".").concat(t.name," from JSON: ").concat(pr(e)));var a,o=i[s],c=dt(e);try{for(c.s();!(a=c.n()).done;){var u=a.value;if(u===null)throw new Error("cannot decode field ".concat(r.typeName,".").concat(t.name," from JSON: ").concat(pr(u)));switch(t.kind){case"message":o.push(t.T.fromJson(u,n));break;case"enum":var d=om(t.T,u,n.ignoreUnknownFields,!0);d!==id&&o.push(d);break;case"scalar":try{o.push(Il(t.T,u,t.L,!0))}catch(U){var h="cannot decode field ".concat(r.typeName,".").concat(t.name," from JSON: ").concat(pr(u));throw U instanceof Error&&U.message.length>0&&(h+=": ".concat(U.message)),new Error(h)}break}}}catch(U){c.e(U)}finally{c.f()}}else if(t.kind=="map"){if(e===null)return;if(et(e)!="object"||Array.isArray(e))throw new Error("cannot decode field ".concat(r.typeName,".").concat(t.name," from JSON: ").concat(pr(e)));for(var b=i[s],v=0,y=Object.entries(e);v<y.length;v++){var p=Pt(y[v],2),f=p[0],m=p[1];if(m===null)throw new Error("cannot decode field ".concat(r.typeName,".").concat(t.name," from JSON: map value null"));var _=void 0;try{_=yM(t.K,f)}catch(U){var k="cannot decode map key for field ".concat(r.typeName,".").concat(t.name," from JSON: ").concat(pr(e));throw U instanceof Error&&U.message.length>0&&(k+=": ".concat(U.message)),new Error(k)}switch(t.V.kind){case"message":b[_]=t.V.T.fromJson(m,n);break;case"enum":var D=om(t.V.T,m,n.ignoreUnknownFields,!0);D!==id&&(b[_]=D);break;case"scalar":try{b[_]=Il(t.V.T,m,fs.BIGINT,!0)}catch(U){var w="cannot decode map value for field ".concat(r.typeName,".").concat(t.name," from JSON: ").concat(pr(e));throw U instanceof Error&&U.message.length>0&&(w+=": ".concat(U.message)),new Error(w)}break}}}else switch(t.oneof&&(i=i[t.oneof.localName]={case:s},s="value"),t.kind){case"message":var A=t.T;if(e===null&&A.typeName!="google.protobuf.Value")return;var x=i[s];Ws(x)?x.fromJson(e,n):(i[s]=x=A.fromJson(e,n),A.fieldWrapper&&!t.oneof&&(i[s]=A.fieldWrapper.unwrapField(x)));break;case"enum":var P=om(t.T,e,n.ignoreUnknownFields,!1);switch(P){case nd:ik(t,i);break;case id:break;default:i[s]=P;break}break;case"scalar":try{var S=Il(t.T,e,t.L,!1);switch(S){case nd:ik(t,i);break;default:i[s]=S;break}}catch(U){var M="cannot decode field ".concat(r.typeName,".").concat(t.name," from JSON: ").concat(pr(e));throw U instanceof Error&&U.message.length>0&&(M+=": ".concat(U.message)),new Error(M)}break}}function yM(i,e){if(i===Pe.BOOL)switch(e){case"true":e=!0;break;case"false":e=!1;break}return Il(i,e,fs.BIGINT,!0).toString()}function Il(i,e,t,n){if(e===null)return n?oo(i,t):nd;switch(i){case Pe.DOUBLE:case Pe.FLOAT:if(e==="NaN")return Number.NaN;if(e==="Infinity")return Number.POSITIVE_INFINITY;if(e==="-Infinity")return Number.NEGATIVE_INFINITY;if(e===""||typeof e=="string"&&e.trim().length!==e.length||typeof e!="string"&&typeof e!="number")break;var r=Number(e);if(Number.isNaN(r)||!Number.isFinite(r))break;return i==Pe.FLOAT&&j_(r),r;case Pe.INT32:case Pe.FIXED32:case Pe.SFIXED32:case Pe.SINT32:case Pe.UINT32:var s;if(typeof e=="number"?s=e:typeof e=="string"&&e.length>0&&e.trim().length===e.length&&(s=Number(e)),s===void 0)break;return i==Pe.UINT32||i==Pe.FIXED32?im(s):Qu(s),s;case Pe.INT64:case Pe.SFIXED64:case Pe.SINT64:if(typeof e!="number"&&typeof e!="string")break;var a=Gt.parse(e);return t?a.toString():a;case Pe.FIXED64:case Pe.UINT64:if(typeof e!="number"&&typeof e!="string")break;var o=Gt.uParse(e);return t?o.toString():o;case Pe.BOOL:if(typeof e!="boolean")break;return e;case Pe.STRING:if(typeof e!="string")break;try{encodeURIComponent(e)}catch{throw new Error("invalid UTF8")}return e;case Pe.BYTES:if(e==="")return new Uint8Array(0);if(typeof e!="string")break;return Z_.dec(e)}throw new Error}function om(i,e,t,n){if(e===null)return i.typeName=="google.protobuf.NullValue"?0:n?i.values[0].no:nd;switch(et(e)){case"number":if(Number.isInteger(e))return e;break;case"string":var r=i.findName(e);if(r!==void 0)return r.no;if(t)return id;break}throw new Error("cannot decode enum ".concat(i.typeName," from JSON: ").concat(pr(e)))}function bM(i){return!(!i.repeated&&i.kind!="map")||!i.oneof&&i.kind!="message"&&!i.opt&&!i.req}function lk(i,e,t){if(i.kind=="map"){sn(et(e)=="object"&&e!=null);var n={},r=Object.entries(e);switch(i.V.kind){case"scalar":var s,a=dt(r);try{for(a.s();!(s=a.n()).done;){var o=Pt(s.value,2),c=o[0],u=o[1];n[c.toString()]=rd(i.V.T,u)}}catch(S){a.e(S)}finally{a.f()}break;case"message":var d,h=dt(r);try{for(h.s();!(d=h.n()).done;){var b=Pt(d.value,2),v=b[0],y=b[1];n[v.toString()]=y.toJson(t)}}catch(S){h.e(S)}finally{h.f()}break;case"enum":var p,f=i.V.T,m=dt(r);try{for(m.s();!(p=m.n()).done;){var _=Pt(p.value,2),k=_[0],D=_[1];n[k.toString()]=lm(f,D,t.enumAsInteger)}}catch(S){m.e(S)}finally{m.f()}break}return t.emitDefaultValues||r.length>0?n:void 0}if(i.repeated){sn(Array.isArray(e));var w=[];switch(i.kind){case"scalar":for(var A=0;A<e.length;A++)w.push(rd(i.T,e[A]));break;case"enum":for(var x=0;x<e.length;x++)w.push(lm(i.T,e[x],t.enumAsInteger));break;case"message":for(var P=0;P<e.length;P++)w.push(e[P].toJson(t));break}return t.emitDefaultValues||w.length>0?w:void 0}switch(i.kind){case"scalar":return rd(i.T,e);case"enum":return lm(i.T,e,t.enumAsInteger);case"message":return rk(i.T,e).toJson(t)}}function lm(i,e,t){var n;if(sn(typeof e=="number"),i.typeName=="google.protobuf.NullValue")return null;if(t)return e;var r=i.findNumber(e);return(n=r==null?void 0:r.name)!==null&&n!==void 0?n:e}function rd(i,e){switch(i){case Pe.INT32:case Pe.SFIXED32:case Pe.SINT32:case Pe.FIXED32:case Pe.UINT32:return sn(typeof e=="number"),e;case Pe.FLOAT:case Pe.DOUBLE:return sn(typeof e=="number"),Number.isNaN(e)?"NaN":e===Number.POSITIVE_INFINITY?"Infinity":e===Number.NEGATIVE_INFINITY?"-Infinity":e;case Pe.STRING:return sn(typeof e=="string"),e;case Pe.BOOL:return sn(typeof e=="boolean"),e;case Pe.UINT64:case Pe.FIXED64:case Pe.INT64:case Pe.SFIXED64:case Pe.SINT64:return sn(typeof e=="bigint"||typeof e=="string"||typeof e=="number"),e.toString();case Pe.BYTES:return sn(e instanceof Uint8Array),Z_.enc(e)}}var lo=Symbol("@bufbuild/protobuf/unknown-fields"),ck={readUnknownFields:!0,readerFactory:function(i){return new fM(i)}},uk={writeUnknownFields:!0,writerFactory:function(){return new hM}};function _M(i){return i?Object.assign(Object.assign({},ck),i):ck}function kM(i){return i?Object.assign(Object.assign({},uk),i):uk}function dk(i,e,t,n,r){var s=t.repeated,a=t.localName;switch(t.oneof&&((i=i[t.oneof.localName]).case!=a&&delete i.value,i.case=a,a="value"),t.kind){case"scalar":case"enum":var o=t.kind=="enum"?Pe.INT32:t.T,c=ad;if(t.kind=="scalar"&&t.L>0&&(c=TM),s){var u=i[a];if(n==hn.LengthDelimited&&o!=Pe.STRING&&o!=Pe.BYTES)for(var d=e.uint32()+e.pos;e.pos<d;)u.push(c(e,o));else u.push(c(e,o))}else i[a]=c(e,o);break;case"message":var h=t.T;s?i[a].push(sd(e,new h,r,t)):Ws(i[a])?sd(e,i[a],r,t):(i[a]=sd(e,new h,r,t),!h.fieldWrapper||t.oneof||t.repeated||(i[a]=h.fieldWrapper.unwrapField(i[a])));break;case"map":var b=function(f,m,_){for(var k,D,w=m.uint32(),A=m.pos+w;m.pos<A;)switch(Pt(m.tag(),1)[0]){case 1:k=ad(m,f.K);break;case 2:switch(f.V.kind){case"scalar":D=ad(m,f.V.T);break;case"enum":D=m.int32();break;case"message":D=sd(m,new f.V.T,_,void 0);break}break}if(k===void 0&&(k=oo(f.K,fs.BIGINT)),typeof k!="string"&&typeof k!="number"&&(k=k.toString()),D===void 0)switch(f.V.kind){case"scalar":D=oo(f.V.T,fs.BIGINT);break;case"enum":D=f.V.T.values[0].no;break;case"message":D=new f.V.T;break}return[k,D]}(t,e,r),v=Pt(b,2),y=v[0],p=v[1];i[a][y]=p;break}}function sd(i,e,t,n){var r=e.getType().runtime.bin,s=n==null?void 0:n.delimited;return r.readMessage(e,i,s?n.no:i.uint32(),t,s),e}function TM(i,e){var t=ad(i,e);return typeof t=="bigint"?t.toString():t}function ad(i,e){switch(e){case Pe.STRING:return i.string();case Pe.BOOL:return i.bool();case Pe.DOUBLE:return i.double();case Pe.FLOAT:return i.float();case Pe.INT32:return i.int32();case Pe.INT64:return i.int64();case Pe.UINT64:return i.uint64();case Pe.FIXED64:return i.fixed64();case Pe.BYTES:return i.bytes();case Pe.FIXED32:return i.fixed32();case Pe.SFIXED32:return i.sfixed32();case Pe.SFIXED64:return i.sfixed64();case Pe.SINT64:return i.sint64();case Pe.UINT32:return i.uint32();case Pe.SINT32:return i.sint32()}}function hk(i,e,t,n){sn(e!==void 0);var r=i.repeated;switch(i.kind){case"scalar":case"enum":var s=i.kind=="enum"?Pe.INT32:i.T;if(r)if(sn(Array.isArray(e)),i.packed)(function(y,p,f,m){if(m.length){y.tag(f,hn.LengthDelimited).fork();for(var _=Pt(pk(p),2)[1],k=0;k<m.length;k++)y[_](m[k]);y.join()}})(t,s,i.no,e);else{var a,o=dt(e);try{for(o.s();!(a=o.n()).done;){var c=a.value;Pl(t,s,i.no,c)}}catch(y){o.e(y)}finally{o.f()}}else Pl(t,s,i.no,e);break;case"message":if(r){sn(Array.isArray(e));var u,d=dt(e);try{for(d.s();!(u=d.n()).done;)fk(t,n,i,u.value)}catch(y){d.e(y)}finally{d.f()}}else fk(t,n,i,e);break;case"map":sn(et(e)=="object"&&e!=null);for(var h=0,b=Object.entries(e);h<b.length;h++){var v=Pt(b[h],2);SM(t,n,i,v[0],v[1])}break}}function SM(i,e,t,n,r){i.tag(t.no,hn.LengthDelimited),i.fork();var s=n;switch(t.K){case Pe.INT32:case Pe.FIXED32:case Pe.UINT32:case Pe.SFIXED32:case Pe.SINT32:s=Number.parseInt(n);break;case Pe.BOOL:sn(n=="true"||n=="false"),s=n=="true";break}switch(Pl(i,t.K,1,s),t.V.kind){case"scalar":Pl(i,t.V.T,2,r);break;case"enum":Pl(i,Pe.INT32,2,r);break;case"message":sn(r!==void 0),i.tag(2,hn.LengthDelimited).bytes(r.toBinary(e));break}i.join()}function fk(i,e,t,n){var r=rk(t.T,n);t.delimited?i.tag(t.no,hn.StartGroup).raw(r.toBinary(e)).tag(t.no,hn.EndGroup):i.tag(t.no,hn.LengthDelimited).bytes(r.toBinary(e))}function Pl(i,e,t,n){sn(n!==void 0);var r=Pt(pk(e),2),s=r[0],a=r[1];i.tag(t,s)[a](n)}function pk(i){var e=hn.Varint;switch(i){case Pe.BYTES:case Pe.STRING:e=hn.LengthDelimited;break;case Pe.DOUBLE:case Pe.FIXED64:case Pe.SFIXED64:e=hn.Bit64;break;case Pe.FIXED32:case Pe.SFIXED32:case Pe.FLOAT:e=hn.Bit32;break}return[e,Pe[i].toLowerCase()]}function od(i){if(i===void 0)return i;if(Ws(i))return i.clone();if(i instanceof Uint8Array){var e=new Uint8Array(i.byteLength);return e.set(i),e}return i}function Nl(i){return i instanceof Uint8Array?i:new Uint8Array(i)}var CM=function(){function i(e,t){ht(this,i),this._fields=e,this._normalizer=t}return ft(i,[{key:"findJsonName",value:function(e){if(!this.jsonNames){var t,n={},r=dt(this.list());try{for(r.s();!(t=r.n()).done;){var s=t.value;n[s.jsonName]=n[s.name]=s}}catch(a){r.e(a)}finally{r.f()}this.jsonNames=n}return this.jsonNames[e]}},{key:"find",value:function(e){if(!this.numbers){var t,n={},r=dt(this.list());try{for(r.s();!(t=r.n()).done;){var s=t.value;n[s.no]=s}}catch(a){r.e(a)}finally{r.f()}this.numbers=n}return this.numbers[e]}},{key:"list",value:function(){return this.all||(this.all=this._normalizer(this._fields)),this.all}},{key:"byNumber",value:function(){return this.numbersAsc||(this.numbersAsc=this.list().concat().sort(function(e,t){return e.no-t.no})),this.numbersAsc}},{key:"byMember",value:function(){if(!this.members){this.members=[];var e,t,n=this.members,r=dt(this.list());try{for(r.s();!(t=r.n()).done;){var s=t.value;s.oneof?s.oneof!==e&&(e=s.oneof,n.push(e)):n.push(s)}}catch(a){r.e(a)}finally{r.f()}}return this.members}}]),i}();function mk(i,e){var t=gk(i);return e?t:AM(DM(t))}var xM=gk;function gk(i){for(var e=!1,t=[],n=0;n<i.length;n++){var r=i.charAt(n);switch(r){case"_":e=!0;break;case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":t.push(r),e=!1;break;default:e&&(e=!1,r=r.toUpperCase()),t.push(r);break}}return t.join("")}var EM=new Set(["constructor","toString","toJSON","valueOf"]),wM=new Set(["getType","clone","equals","fromBinary","fromJson","fromJsonString","toBinary","toJson","toJsonString","toObject"]),vk=function(i){return"".concat(i,"$")},DM=function(i){return wM.has(i)?vk(i):i},AM=function(i){return EM.has(i)?vk(i):i},IM=function(){function i(e){ht(this,i),this.kind="oneof",this.repeated=!1,this.packed=!1,this.opt=!1,this.req=!1,this.default=void 0,this.fields=[],this.name=e,this.localName=mk(e,!1)}return ft(i,[{key:"addField",value:function(e){sn(e.oneof===this,"field ".concat(e.name," not one of ").concat(this.name)),this.fields.push(e)}},{key:"findField",value:function(e){if(!this._lookup){this._lookup=Object.create(null);for(var t=0;t<this.fields.length;t++)this._lookup[this.fields[t].localName]=this.fields[t]}return this._lookup[e]}}]),i}(),yk,bk,we=(yk=function(i){return new CM(i,function(e){return function(t,n){var r,s,a,o,c,u,d,h,b=[],v=dt(typeof t=="function"?t():t);try{for(v.s();!(h=v.n()).done;){var y=h.value,p=y;if(p.localName=mk(y.name,y.oneof!==void 0),p.jsonName=(r=y.jsonName)!==null&&r!==void 0?r:xM(y.name),p.repeated=(s=y.repeated)!==null&&s!==void 0&&s,y.kind=="scalar"&&(p.L=(a=y.L)!==null&&a!==void 0?a:fs.BIGINT),p.delimited=(o=y.delimited)!==null&&o!==void 0&&o,p.req=(c=y.req)!==null&&c!==void 0&&c,p.opt=(u=y.opt)!==null&&u!==void 0&&u,y.packed===void 0&&(p.packed=y.kind=="enum"||y.kind=="scalar"&&y.T!=Pe.BYTES&&y.T!=Pe.STRING),y.oneof!==void 0){var f=typeof y.oneof=="string"?y.oneof:y.oneof.name;d&&d.name==f||(d=new IM(f)),p.oneof=d,d.addField(p)}b.push(p)}}catch(m){v.e(m)}finally{v.f()}return b}(e)})},bk=function(i){var e,t=dt(i.getType().fields.byMember());try{for(t.s();!(e=t.n()).done;){var n=e.value;if(!n.opt){var r=n.localName,s=i;if(n.repeated)s[r]=[];else switch(n.kind){case"oneof":s[r]={case:void 0};break;case"enum":s[r]=0;break;case"map":s[r]={};break;case"scalar":s[r]=oo(n.T,n.L);break}}}}catch(a){t.e(a)}finally{t.f()}},{syntax:"proto3",json:{makeReadOptions:gM,makeWriteOptions:vM,readMessage:function(i,e,t,n){if(e==null||Array.isArray(e)||et(e)!="object")throw new Error("cannot decode message ".concat(i.typeName," from JSON: ").concat(pr(e)));n=n??new i;for(var r=new Map,s=t.typeRegistry,a=0,o=Object.entries(e);a<o.length;a++){var c=Pt(o[a],2),u=c[0],d=c[1],h=i.fields.findJsonName(u);if(h){if(h.oneof){if(d===null&&h.kind=="scalar")continue;var b=r.get(h.oneof);if(b!==void 0)throw new Error("cannot decode message ".concat(i.typeName,' from JSON: multiple keys for oneof "').concat(h.oneof.name,'" present: "').concat(b,'", "').concat(u,'"'));r.set(h.oneof,u)}ok(n,d,h,t,i)}else{var v=!1;if(s!=null&&s.findExtension&&u.startsWith("[")&&u.endsWith("]")){var y=s.findExtension(u.substring(1,u.length-1));if(y&&y.extendee.typeName==i.typeName){v=!0;var p=Pt(Q_(y),2),f=p[0],m=p[1];ok(f,d,y.field,t,y),mM(n,y,m(),t)}}if(!v&&!t.ignoreUnknownFields)throw new Error("cannot decode message ".concat(i.typeName,' from JSON: key "').concat(u,'" is unknown'))}}return n},writeMessage:function(i,e){var t,n=i.getType(),r={};try{var s,a=dt(n.fields.byNumber());try{for(a.s();!(s=a.n()).done;){if(!nk(t=s.value,i)){if(t.req)throw"required field not set";if(!e.emitDefaultValues||!bM(t))continue}var o=lk(t,t.oneof?i[t.oneof.localName].value:i[t.localName],e);o!==void 0&&(r[e.useProtoFieldName?t.name:t.jsonName]=o)}}catch(m){a.e(m)}finally{a.f()}var c=e.typeRegistry;if(c!=null&&c.findExtensionFor){var u,d=dt(n.runtime.bin.listUnknownFields(i));try{for(d.s();!(u=d.n()).done;){var h=u.value,b=c.findExtensionFor(n.typeName,h.no);if(b&&ek(i,b)){var v=pM(i,b,e),y=lk(b.field,v,e);y!==void 0&&(r[b.field.jsonName]=y)}}}catch(m){d.e(m)}finally{d.f()}}}catch(m){var p=t?"cannot encode field ".concat(n.typeName,".").concat(t.name," to JSON"):"cannot encode message ".concat(n.typeName," to JSON"),f=m instanceof Error?m.message:String(m);throw new Error(p+(f.length>0?": ".concat(f):""))}return r},readScalar:function(i,e,t){return Il(i,e,t??fs.BIGINT,!0)},writeScalar:function(i,e,t){if(e!==void 0)return t||J_(i,e)?rd(i,e):void 0},debug:pr},bin:{makeReadOptions:_M,makeWriteOptions:kM,listUnknownFields:function(i){var e;return(e=i[lo])!==null&&e!==void 0?e:[]},discardUnknownFields:function(i){delete i[lo]},writeUnknownFields:function(i,e){var t=i[lo];if(t){var n,r=dt(t);try{for(r.s();!(n=r.n()).done;){var s=n.value;e.tag(s.no,s.wireType).raw(s.data)}}catch(a){r.e(a)}finally{r.f()}}},onUnknownField:function(i,e,t,n){var r=i;Array.isArray(r[lo])||(r[lo]=[]),r[lo].push({no:e,wireType:t,data:n})},readMessage:function(i,e,t,n,r){for(var s,a,o=i.getType(),c=r?e.len:e.pos+t;e.pos<c;){var u=Pt(e.tag(),2);if(s=u[0],a=u[1],r===!0&&a==hn.EndGroup)break;var d=o.fields.find(s);if(d)dk(i,e,d,a,n);else{var h=e.skip(a,s);n.readUnknownFields&&this.onUnknownField(i,s,a,h)}}if(r&&(a!=hn.EndGroup||s!==t))throw new Error("invalid end group tag")},readField:dk,writeMessage:function(i,e,t){var n,r=i.getType(),s=dt(r.fields.byNumber());try{for(s.s();!(n=s.n()).done;){var a=n.value;if(nk(a,i))hk(a,a.oneof?i[a.oneof.localName].value:i[a.localName],e,t);else if(a.req)throw new Error("cannot encode field ".concat(r.typeName,".").concat(a.name," to binary: required field not set"))}}catch(o){s.e(o)}finally{s.f()}return t.writeUnknownFields&&this.writeUnknownFields(i,e),e},writeField:function(i,e,t,n){e!==void 0&&hk(i,e,t,n)}},util:Object.assign(Object.assign({},{setEnumType:H_,initPartial:function(i,e){if(i!==void 0){var t,n=dt(e.getType().fields.byMember());try{var r=function(){var s=t.value,a=s.localName,o=e,c=i;if(c[a]==null)return 0;switch(s.kind){case"oneof":var u=c[a].case;if(u===void 0)return 0;var d=s.findField(u),h=c[a].value;d&&d.kind=="message"&&!Ws(h,d.T)?h=new d.T(h):d&&d.kind==="scalar"&&d.T===Pe.BYTES&&(h=Nl(h)),o[a]={case:u,value:h};break;case"scalar":case"enum":var b=c[a];s.T===Pe.BYTES&&(b=s.repeated?b.map(Nl):Nl(b)),o[a]=b;break;case"map":switch(s.V.kind){case"scalar":case"enum":if(s.V.T===Pe.BYTES)for(var v=0,y=Object.entries(c[a]);v<y.length;v++){var p=Pt(y[v],2),f=p[0],m=p[1];o[a][f]=Nl(m)}else Object.assign(o[a],c[a]);break;case"message":for(var _=s.V.T,k=0,D=Object.keys(c[a]);k<D.length;k++){var w=D[k],A=c[a][w];_.fieldWrapper||(A=new _(A)),o[a][w]=A}break}break;case"message":var x=s.T;if(s.repeated)o[a]=c[a].map(function(S){return Ws(S,x)?S:new x(S)});else{var P=c[a];x.fieldWrapper?x.typeName==="google.protobuf.BytesValue"?o[a]=Nl(P):o[a]=P:o[a]=Ws(P,x)?P:new x(P)}break}};for(n.s();!(t=n.n()).done;)r()}catch(s){n.e(s)}finally{n.f()}}},equals:function(i,e,t){return e===t||!(!e||!t)&&i.fields.byMember().every(function(n){var r=e[n.localName],s=t[n.localName];if(n.repeated){if(r.length!==s.length)return!1;switch(n.kind){case"message":return r.every(function(d,h){return n.T.equals(d,s[h])});case"scalar":return r.every(function(d,h){return ps(n.T,d,s[h])});case"enum":return r.every(function(d,h){return ps(Pe.INT32,d,s[h])})}throw new Error("repeated cannot contain ".concat(n.kind))}switch(n.kind){case"message":return n.T.equals(r,s);case"enum":return ps(Pe.INT32,r,s);case"scalar":return ps(n.T,r,s);case"oneof":if(r.case!==s.case)return!1;var a=n.findField(r.case);if(a===void 0)return!0;switch(a.kind){case"message":return a.T.equals(r.value,s.value);case"enum":return ps(Pe.INT32,r.value,s.value);case"scalar":return ps(a.T,r.value,s.value)}throw new Error("oneof cannot contain ".concat(a.kind));case"map":var o=Object.keys(r).concat(Object.keys(s));switch(n.V.kind){case"message":var c=n.V.T;return o.every(function(d){return c.equals(r[d],s[d])});case"enum":return o.every(function(d){return ps(Pe.INT32,r[d],s[d])});case"scalar":var u=n.V.T;return o.every(function(d){return ps(u,r[d],s[d])})}break}})},clone:function(i){var e,t=i.getType(),n=new t,r=n,s=dt(t.fields.byMember());try{for(s.s();!(e=s.n()).done;){var a=e.value,o=i[a.localName],c=void 0;if(a.repeated)c=o.map(od);else if(a.kind=="map"){c=r[a.localName];for(var u=0,d=Object.entries(o);u<d.length;u++){var h=Pt(d[u],2),b=h[0],v=h[1];c[b]=od(v)}}else c=a.kind=="oneof"?a.findField(o.case)?{case:o.case,value:od(o.value)}:{case:void 0}:od(o);r[a.localName]=c}}catch(m){s.e(m)}finally{s.f()}var y,p=dt(t.runtime.bin.listUnknownFields(i));try{for(p.s();!(y=p.n()).done;){var f=y.value;t.runtime.bin.onUnknownField(r,f.no,f.wireType,f.data)}}catch(m){p.e(m)}finally{p.f()}return n}}),{newFieldList:yk,initFields:bk}),makeMessageType:function(i,e,t){return function(n,r,s,a){var o,c=(o=a==null?void 0:a.localName)!==null&&o!==void 0?o:r.substring(r.lastIndexOf(".")+1),u=ao({},c,function(d){n.util.initFields(this),n.util.initPartial(d,this)})[c];return Object.setPrototypeOf(u.prototype,new rm),Object.assign(u,{runtime:n,typeName:r,fields:n.util.newFieldList(s),fromBinary:function(d,h){return new u().fromBinary(d,h)},fromJson:function(d,h){return new u().fromJson(d,h)},fromJsonString:function(d,h){return new u().fromJsonString(d,h)},equals:function(d,h){return n.util.equals(u,d,h)}}),u}(this,i,e,t)},makeEnum:cM,makeEnumType:q_,getEnumType:lM,makeExtension:function(i,e,t){return function(n,r,s,a){var o;return{typeName:r,extendee:s,get field(){if(!o){var c=typeof a=="function"?a():a;c.name=r.split(".").pop(),c.jsonName="[".concat(r,"]"),o=n.util.newFieldList([c]).list()[0]}return o},runtime:n}}(this,i,e,t)}}),Ks=function(i){function e(t){var n;return ht(this,e),(n=Ut(this,e)).seconds=Gt.zero,n.nanos=0,we.util.initPartial(t,ct(n)),n}return Ft(e,rm),ft(e,[{key:"fromJson",value:function(t,n){if(typeof t!="string")throw new Error("cannot decode google.protobuf.Timestamp from JSON: ".concat(we.json.debug(t)));var r=t.match(/^([0-9]{4})-([0-9]{2})-([0-9]{2})T([0-9]{2}):([0-9]{2}):([0-9]{2})(?:Z|\.([0-9]{3,9})Z|([+-][0-9][0-9]:[0-9][0-9]))$/);if(!r)throw new Error("cannot decode google.protobuf.Timestamp from JSON: invalid RFC 3339 string");var s=Date.parse(r[1]+"-"+r[2]+"-"+r[3]+"T"+r[4]+":"+r[5]+":"+r[6]+(r[8]?r[8]:"Z"));if(Number.isNaN(s))throw new Error("cannot decode google.protobuf.Timestamp from JSON: invalid RFC 3339 string");if(s<Date.parse("0001-01-01T00:00:00Z")||s>Date.parse("9999-12-31T23:59:59Z"))throw new Error("cannot decode message google.protobuf.Timestamp from JSON: must be from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z inclusive");return this.seconds=Gt.parse(s/1e3),this.nanos=0,r[7]&&(this.nanos=parseInt("1"+r[7]+"0".repeat(9-r[7].length))-1e9),this}},{key:"toJson",value:function(t){var n=1e3*Number(this.seconds);if(n<Date.parse("0001-01-01T00:00:00Z")||n>Date.parse("9999-12-31T23:59:59Z"))throw new Error("cannot encode google.protobuf.Timestamp to JSON: must be from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z inclusive");if(0>this.nanos)throw new Error("cannot encode google.protobuf.Timestamp to JSON: nanos must not be negative");var r="Z";if(this.nanos>0){var s=(this.nanos+1e9).toString().substring(1);r=s.substring(3)==="000000"?"."+s.substring(0,3)+"Z":s.substring(6)==="000"?"."+s.substring(0,6)+"Z":"."+s+"Z"}return new Date(n).toISOString().replace(".000Z",r)}},{key:"toDate",value:function(){return new Date(1e3*Number(this.seconds)+Math.ceil(this.nanos/1e6))}}],[{key:"now",value:function(){return e.fromDate(new Date)}},{key:"fromDate",value:function(t){var n=t.getTime();return new e({seconds:Gt.parse(Math.floor(n/1e3)),nanos:n%1e3*1e6})}},{key:"fromBinary",value:function(t,n){return new e().fromBinary(t,n)}},{key:"fromJson",value:function(t,n){return new e().fromJson(t,n)}},{key:"fromJsonString",value:function(t,n){return new e().fromJsonString(t,n)}},{key:"equals",value:function(t,n){return we.util.equals(e,t,n)}}]),e}();Ks.runtime=we,Ks.typeName="google.protobuf.Timestamp",Ks.fields=we.util.newFieldList(function(){return[{no:1,name:"seconds",kind:"scalar",T:3},{no:2,name:"nanos",kind:"scalar",T:5}]});var PM=we.makeMessageType("livekit.MetricsBatch",function(){return[{no:1,name:"timestamp_ms",kind:"scalar",T:3},{no:2,name:"normalized_timestamp",kind:"message",T:Ks},{no:3,name:"str_data",kind:"scalar",T:9,repeated:!0},{no:4,name:"time_series",kind:"message",T:NM,repeated:!0},{no:5,name:"events",kind:"message",T:MM,repeated:!0}]}),NM=we.makeMessageType("livekit.TimeSeriesMetric",function(){return[{no:1,name:"label",kind:"scalar",T:13},{no:2,name:"participant_identity",kind:"scalar",T:13},{no:3,name:"track_sid",kind:"scalar",T:13},{no:4,name:"samples",kind:"message",T:OM,repeated:!0},{no:5,name:"rid",kind:"scalar",T:13}]}),OM=we.makeMessageType("livekit.MetricSample",function(){return[{no:1,name:"timestamp_ms",kind:"scalar",T:3},{no:2,name:"normalized_timestamp",kind:"message",T:Ks},{no:3,name:"value",kind:"scalar",T:2}]}),MM=we.makeMessageType("livekit.EventMetric",function(){return[{no:1,name:"label",kind:"scalar",T:13},{no:2,name:"participant_identity",kind:"scalar",T:13},{no:3,name:"track_sid",kind:"scalar",T:13},{no:4,name:"start_timestamp_ms",kind:"scalar",T:3},{no:5,name:"end_timestamp_ms",kind:"scalar",T:3,opt:!0},{no:6,name:"normalized_start_timestamp",kind:"message",T:Ks},{no:7,name:"normalized_end_timestamp",kind:"message",T:Ks,opt:!0},{no:8,name:"metadata",kind:"scalar",T:9},{no:9,name:"rid",kind:"scalar",T:13}]}),Ki=we.makeEnum("livekit.TrackType",[{no:0,name:"AUDIO"},{no:1,name:"VIDEO"},{no:2,name:"DATA"}]),Vn=we.makeEnum("livekit.TrackSource",[{no:0,name:"UNKNOWN"},{no:1,name:"CAMERA"},{no:2,name:"MICROPHONE"},{no:3,name:"SCREEN_SHARE"},{no:4,name:"SCREEN_SHARE_AUDIO"}]),cm=we.makeEnum("livekit.VideoQuality",[{no:0,name:"LOW"},{no:1,name:"MEDIUM"},{no:2,name:"HIGH"},{no:3,name:"OFF"}]),Ol=we.makeEnum("livekit.ConnectionQuality",[{no:0,name:"POOR"},{no:1,name:"GOOD"},{no:2,name:"EXCELLENT"},{no:3,name:"LOST"}]),Ml=we.makeEnum("livekit.ClientConfigSetting",[{no:0,name:"UNSET"},{no:1,name:"DISABLED"},{no:2,name:"ENABLED"}]),co=we.makeEnum("livekit.DisconnectReason",[{no:0,name:"UNKNOWN_REASON"},{no:1,name:"CLIENT_INITIATED"},{no:2,name:"DUPLICATE_IDENTITY"},{no:3,name:"SERVER_SHUTDOWN"},{no:4,name:"PARTICIPANT_REMOVED"},{no:5,name:"ROOM_DELETED"},{no:6,name:"STATE_MISMATCH"},{no:7,name:"JOIN_FAILURE"},{no:8,name:"MIGRATION"},{no:9,name:"SIGNAL_CLOSE"},{no:10,name:"ROOM_CLOSED"},{no:11,name:"USER_UNAVAILABLE"},{no:12,name:"USER_REJECTED"}]),uo=we.makeEnum("livekit.ReconnectReason",[{no:0,name:"RR_UNKNOWN"},{no:1,name:"RR_SIGNAL_DISCONNECTED"},{no:2,name:"RR_PUBLISHER_FAILED"},{no:3,name:"RR_SUBSCRIBER_FAILED"},{no:4,name:"RR_SWITCH_CANDIDATE"}]),RM=we.makeEnum("livekit.SubscriptionError",[{no:0,name:"SE_UNKNOWN"},{no:1,name:"SE_CODEC_UNSUPPORTED"},{no:2,name:"SE_TRACK_NOTFOUND"}]),mr=we.makeEnum("livekit.AudioTrackFeature",[{no:0,name:"TF_STEREO"},{no:1,name:"TF_NO_DTX"},{no:2,name:"TF_AUTO_GAIN_CONTROL"},{no:3,name:"TF_ECHO_CANCELLATION"},{no:4,name:"TF_NOISE_SUPPRESSION"},{no:5,name:"TF_ENHANCED_NOISE_CANCELLATION"}]),um=we.makeMessageType("livekit.Room",function(){return[{no:1,name:"sid",kind:"scalar",T:9},{no:2,name:"name",kind:"scalar",T:9},{no:3,name:"empty_timeout",kind:"scalar",T:13},{no:14,name:"departure_timeout",kind:"scalar",T:13},{no:4,name:"max_participants",kind:"scalar",T:13},{no:5,name:"creation_time",kind:"scalar",T:3},{no:6,name:"turn_password",kind:"scalar",T:9},{no:7,name:"enabled_codecs",kind:"message",T:ld,repeated:!0},{no:8,name:"metadata",kind:"scalar",T:9},{no:9,name:"num_participants",kind:"scalar",T:13},{no:11,name:"num_publishers",kind:"scalar",T:13},{no:10,name:"active_recording",kind:"scalar",T:8},{no:13,name:"version",kind:"message",T:wk}]}),ld=we.makeMessageType("livekit.Codec",function(){return[{no:1,name:"mime",kind:"scalar",T:9},{no:2,name:"fmtp_line",kind:"scalar",T:9}]}),LM=we.makeMessageType("livekit.ParticipantPermission",function(){return[{no:1,name:"can_subscribe",kind:"scalar",T:8},{no:2,name:"can_publish",kind:"scalar",T:8},{no:3,name:"can_publish_data",kind:"scalar",T:8},{no:9,name:"can_publish_sources",kind:"enum",T:we.getEnumType(Vn),repeated:!0},{no:7,name:"hidden",kind:"scalar",T:8},{no:8,name:"recorder",kind:"scalar",T:8},{no:10,name:"can_update_metadata",kind:"scalar",T:8},{no:11,name:"agent",kind:"scalar",T:8},{no:12,name:"can_subscribe_metrics",kind:"scalar",T:8}]}),Rl=we.makeMessageType("livekit.ParticipantInfo",function(){return[{no:1,name:"sid",kind:"scalar",T:9},{no:2,name:"identity",kind:"scalar",T:9},{no:3,name:"state",kind:"enum",T:we.getEnumType(dm)},{no:4,name:"tracks",kind:"message",T:ho,repeated:!0},{no:5,name:"metadata",kind:"scalar",T:9},{no:6,name:"joined_at",kind:"scalar",T:3},{no:9,name:"name",kind:"scalar",T:9},{no:10,name:"version",kind:"scalar",T:13},{no:11,name:"permission",kind:"message",T:LM},{no:12,name:"region",kind:"scalar",T:9},{no:13,name:"is_publisher",kind:"scalar",T:8},{no:14,name:"kind",kind:"enum",T:we.getEnumType(cd)},{no:15,name:"attributes",kind:"map",K:9,V:{kind:"scalar",T:9}},{no:16,name:"disconnect_reason",kind:"enum",T:we.getEnumType(co)}]}),dm=we.makeEnum("livekit.ParticipantInfo.State",[{no:0,name:"JOINING"},{no:1,name:"JOINED"},{no:2,name:"ACTIVE"},{no:3,name:"DISCONNECTED"}]),cd=we.makeEnum("livekit.ParticipantInfo.Kind",[{no:0,name:"STANDARD"},{no:1,name:"INGRESS"},{no:2,name:"EGRESS"},{no:3,name:"SIP"},{no:4,name:"AGENT"}]),Ni=we.makeEnum("livekit.Encryption.Type",[{no:0,name:"NONE"},{no:1,name:"GCM"},{no:2,name:"CUSTOM"}]),BM=we.makeMessageType("livekit.SimulcastCodecInfo",function(){return[{no:1,name:"mime_type",kind:"scalar",T:9},{no:2,name:"mid",kind:"scalar",T:9},{no:3,name:"cid",kind:"scalar",T:9},{no:4,name:"layers",kind:"message",T:Xs,repeated:!0}]}),ho=we.makeMessageType("livekit.TrackInfo",function(){return[{no:1,name:"sid",kind:"scalar",T:9},{no:2,name:"type",kind:"enum",T:we.getEnumType(Ki)},{no:3,name:"name",kind:"scalar",T:9},{no:4,name:"muted",kind:"scalar",T:8},{no:5,name:"width",kind:"scalar",T:13},{no:6,name:"height",kind:"scalar",T:13},{no:7,name:"simulcast",kind:"scalar",T:8},{no:8,name:"disable_dtx",kind:"scalar",T:8},{no:9,name:"source",kind:"enum",T:we.getEnumType(Vn)},{no:10,name:"layers",kind:"message",T:Xs,repeated:!0},{no:11,name:"mime_type",kind:"scalar",T:9},{no:12,name:"mid",kind:"scalar",T:9},{no:13,name:"codecs",kind:"message",T:BM,repeated:!0},{no:14,name:"stereo",kind:"scalar",T:8},{no:15,name:"disable_red",kind:"scalar",T:8},{no:16,name:"encryption",kind:"enum",T:we.getEnumType(Ni)},{no:17,name:"stream",kind:"scalar",T:9},{no:18,name:"version",kind:"message",T:wk},{no:19,name:"audio_features",kind:"enum",T:we.getEnumType(mr),repeated:!0}]}),Xs=we.makeMessageType("livekit.VideoLayer",function(){return[{no:1,name:"quality",kind:"enum",T:we.getEnumType(cm)},{no:2,name:"width",kind:"scalar",T:13},{no:3,name:"height",kind:"scalar",T:13},{no:4,name:"bitrate",kind:"scalar",T:13},{no:5,name:"ssrc",kind:"scalar",T:13}]}),Ll=we.makeMessageType("livekit.DataPacket",function(){return[{no:1,name:"kind",kind:"enum",T:we.getEnumType(yn)},{no:4,name:"participant_identity",kind:"scalar",T:9},{no:5,name:"destination_identities",kind:"scalar",T:9,repeated:!0},{no:2,name:"user",kind:"message",T:kk,oneof:"value"},{no:3,name:"speaker",kind:"message",T:UM,oneof:"value"},{no:6,name:"sip_dtmf",kind:"message",T:Tk,oneof:"value"},{no:7,name:"transcription",kind:"message",T:FM,oneof:"value"},{no:8,name:"metrics",kind:"message",T:PM,oneof:"value"},{no:9,name:"chat_message",kind:"message",T:hm,oneof:"value"},{no:10,name:"rpc_request",kind:"message",T:jM,oneof:"value"},{no:11,name:"rpc_ack",kind:"message",T:$M,oneof:"value"},{no:12,name:"rpc_response",kind:"message",T:HM,oneof:"value"}]}),yn=we.makeEnum("livekit.DataPacket.Kind",[{no:0,name:"RELIABLE"},{no:1,name:"LOSSY"}]),UM=we.makeMessageType("livekit.ActiveSpeakerUpdate",function(){return[{no:1,name:"speakers",kind:"message",T:_k,repeated:!0}]}),_k=we.makeMessageType("livekit.SpeakerInfo",function(){return[{no:1,name:"sid",kind:"scalar",T:9},{no:2,name:"level",kind:"scalar",T:2},{no:3,name:"active",kind:"scalar",T:8}]}),kk=we.makeMessageType("livekit.UserPacket",function(){return[{no:1,name:"participant_sid",kind:"scalar",T:9},{no:5,name:"participant_identity",kind:"scalar",T:9},{no:2,name:"payload",kind:"scalar",T:12},{no:3,name:"destination_sids",kind:"scalar",T:9,repeated:!0},{no:6,name:"destination_identities",kind:"scalar",T:9,repeated:!0},{no:4,name:"topic",kind:"scalar",T:9,opt:!0},{no:8,name:"id",kind:"scalar",T:9,opt:!0},{no:9,name:"start_time",kind:"scalar",T:4,opt:!0},{no:10,name:"end_time",kind:"scalar",T:4,opt:!0}]}),Tk=we.makeMessageType("livekit.SipDTMF",function(){return[{no:3,name:"code",kind:"scalar",T:13},{no:4,name:"digit",kind:"scalar",T:9}]}),FM=we.makeMessageType("livekit.Transcription",function(){return[{no:2,name:"transcribed_participant_identity",kind:"scalar",T:9},{no:3,name:"track_id",kind:"scalar",T:9},{no:4,name:"segments",kind:"message",T:VM,repeated:!0}]}),VM=we.makeMessageType("livekit.TranscriptionSegment",function(){return[{no:1,name:"id",kind:"scalar",T:9},{no:2,name:"text",kind:"scalar",T:9},{no:3,name:"start_time",kind:"scalar",T:4},{no:4,name:"end_time",kind:"scalar",T:4},{no:5,name:"final",kind:"scalar",T:8},{no:6,name:"language",kind:"scalar",T:9}]}),hm=we.makeMessageType("livekit.ChatMessage",function(){return[{no:1,name:"id",kind:"scalar",T:9},{no:2,name:"timestamp",kind:"scalar",T:3},{no:3,name:"edit_timestamp",kind:"scalar",T:3,opt:!0},{no:4,name:"message",kind:"scalar",T:9},{no:5,name:"deleted",kind:"scalar",T:8},{no:6,name:"generated",kind:"scalar",T:8}]}),jM=we.makeMessageType("livekit.RpcRequest",function(){return[{no:1,name:"id",kind:"scalar",T:9},{no:2,name:"method",kind:"scalar",T:9},{no:3,name:"payload",kind:"scalar",T:9},{no:4,name:"response_timeout_ms",kind:"scalar",T:13},{no:5,name:"version",kind:"scalar",T:13}]}),$M=we.makeMessageType("livekit.RpcAck",function(){return[{no:1,name:"request_id",kind:"scalar",T:9}]}),HM=we.makeMessageType("livekit.RpcResponse",function(){return[{no:1,name:"request_id",kind:"scalar",T:9},{no:2,name:"payload",kind:"scalar",T:9,oneof:"value"},{no:3,name:"error",kind:"message",T:qM,oneof:"value"}]}),qM=we.makeMessageType("livekit.RpcError",function(){return[{no:1,name:"code",kind:"scalar",T:13},{no:2,name:"message",kind:"scalar",T:9},{no:3,name:"data",kind:"scalar",T:9}]}),Sk=we.makeMessageType("livekit.ParticipantTracks",function(){return[{no:1,name:"participant_sid",kind:"scalar",T:9},{no:2,name:"track_sids",kind:"scalar",T:9,repeated:!0}]}),zM=we.makeMessageType("livekit.ServerInfo",function(){return[{no:1,name:"edition",kind:"enum",T:we.getEnumType(GM)},{no:2,name:"version",kind:"scalar",T:9},{no:3,name:"protocol",kind:"scalar",T:5},{no:4,name:"region",kind:"scalar",T:9},{no:5,name:"node_id",kind:"scalar",T:9},{no:6,name:"debug_info",kind:"scalar",T:9},{no:7,name:"agent_protocol",kind:"scalar",T:5}]}),GM=we.makeEnum("livekit.ServerInfo.Edition",[{no:0,name:"Standard"},{no:1,name:"Cloud"}]),WM=we.makeMessageType("livekit.ClientInfo",function(){return[{no:1,name:"sdk",kind:"enum",T:we.getEnumType(Ck)},{no:2,name:"version",kind:"scalar",T:9},{no:3,name:"protocol",kind:"scalar",T:5},{no:4,name:"os",kind:"scalar",T:9},{no:5,name:"os_version",kind:"scalar",T:9},{no:6,name:"device_model",kind:"scalar",T:9},{no:7,name:"browser",kind:"scalar",T:9},{no:8,name:"browser_version",kind:"scalar",T:9},{no:9,name:"address",kind:"scalar",T:9},{no:10,name:"network",kind:"scalar",T:9},{no:11,name:"other_sdks",kind:"scalar",T:9}]}),Ck=we.makeEnum("livekit.ClientInfo.SDK",[{no:0,name:"UNKNOWN"},{no:1,name:"JS"},{no:2,name:"SWIFT"},{no:3,name:"ANDROID"},{no:4,name:"FLUTTER"},{no:5,name:"GO"},{no:6,name:"UNITY"},{no:7,name:"REACT_NATIVE"},{no:8,name:"RUST"},{no:9,name:"PYTHON"},{no:10,name:"CPP"},{no:11,name:"UNITY_WEB"},{no:12,name:"NODE"}]),xk=we.makeMessageType("livekit.ClientConfiguration",function(){return[{no:1,name:"video",kind:"message",T:Ek},{no:2,name:"screen",kind:"message",T:Ek},{no:3,name:"resume_connection",kind:"enum",T:we.getEnumType(Ml)},{no:4,name:"disabled_codecs",kind:"message",T:KM},{no:5,name:"force_relay",kind:"enum",T:we.getEnumType(Ml)}]}),Ek=we.makeMessageType("livekit.VideoConfiguration",function(){return[{no:1,name:"hardware_encoder",kind:"enum",T:we.getEnumType(Ml)}]}),KM=we.makeMessageType("livekit.DisabledCodecs",function(){return[{no:1,name:"codecs",kind:"message",T:ld,repeated:!0},{no:2,name:"publish",kind:"message",T:ld,repeated:!0}]}),wk=we.makeMessageType("livekit.TimedVersion",function(){return[{no:1,name:"unix_micro",kind:"scalar",T:3},{no:2,name:"ticks",kind:"scalar",T:5}]}),Xi=we.makeEnum("livekit.SignalTarget",[{no:0,name:"PUBLISHER"},{no:1,name:"SUBSCRIBER"}]),fm=we.makeEnum("livekit.StreamState",[{no:0,name:"ACTIVE"},{no:1,name:"PAUSED"}]),XM=we.makeEnum("livekit.CandidateProtocol",[{no:0,name:"UDP"},{no:1,name:"TCP"},{no:2,name:"TLS"}]),YM=we.makeMessageType("livekit.SignalRequest",function(){return[{no:1,name:"offer",kind:"message",T:Ys,oneof:"message"},{no:2,name:"answer",kind:"message",T:Ys,oneof:"message"},{no:3,name:"trickle",kind:"message",T:gm,oneof:"message"},{no:4,name:"add_track",kind:"message",T:mm,oneof:"message"},{no:5,name:"mute",kind:"message",T:vm,oneof:"message"},{no:6,name:"subscription",kind:"message",T:ud,oneof:"message"},{no:7,name:"track_setting",kind:"message",T:Ak,oneof:"message"},{no:8,name:"leave",kind:"message",T:dd,oneof:"message"},{no:10,name:"update_layers",kind:"message",T:Pk,oneof:"message"},{no:11,name:"subscription_permission",kind:"message",T:Rk,oneof:"message"},{no:12,name:"sync_state",kind:"message",T:Lk,oneof:"message"},{no:13,name:"simulate",kind:"message",T:gr,oneof:"message"},{no:14,name:"ping",kind:"scalar",T:3,oneof:"message"},{no:15,name:"update_metadata",kind:"message",T:Nk,oneof:"message"},{no:16,name:"ping_req",kind:"message",T:Uk,oneof:"message"},{no:17,name:"update_audio_track",kind:"message",T:Ik,oneof:"message"},{no:18,name:"update_video_track",kind:"message",T:t9,oneof:"message"}]}),Dk=we.makeMessageType("livekit.SignalResponse",function(){return[{no:1,name:"join",kind:"message",T:JM,oneof:"message"},{no:2,name:"answer",kind:"message",T:Ys,oneof:"message"},{no:3,name:"offer",kind:"message",T:Ys,oneof:"message"},{no:4,name:"trickle",kind:"message",T:gm,oneof:"message"},{no:5,name:"update",kind:"message",T:e9,oneof:"message"},{no:6,name:"track_published",kind:"message",T:ym,oneof:"message"},{no:8,name:"leave",kind:"message",T:dd,oneof:"message"},{no:9,name:"mute",kind:"message",T:vm,oneof:"message"},{no:10,name:"speakers_changed",kind:"message",T:n9,oneof:"message"},{no:11,name:"room_update",kind:"message",T:i9,oneof:"message"},{no:12,name:"connection_quality",kind:"message",T:s9,oneof:"message"},{no:13,name:"stream_state_update",kind:"message",T:o9,oneof:"message"},{no:14,name:"subscribed_quality_update",kind:"message",T:c9,oneof:"message"},{no:15,name:"subscription_permission_update",kind:"message",T:u9,oneof:"message"},{no:16,name:"refresh_token",kind:"scalar",T:9,oneof:"message"},{no:17,name:"track_unpublished",kind:"message",T:ZM,oneof:"message"},{no:18,name:"pong",kind:"scalar",T:3,oneof:"message"},{no:19,name:"reconnect",kind:"message",T:QM,oneof:"message"},{no:20,name:"pong_resp",kind:"message",T:d9,oneof:"message"},{no:21,name:"subscription_response",kind:"message",T:p9,oneof:"message"},{no:22,name:"request_response",kind:"message",T:m9,oneof:"message"},{no:23,name:"track_subscribed",kind:"message",T:g9,oneof:"message"}]}),pm=we.makeMessageType("livekit.SimulcastCodec",function(){return[{no:1,name:"codec",kind:"scalar",T:9},{no:2,name:"cid",kind:"scalar",T:9}]}),mm=we.makeMessageType("livekit.AddTrackRequest",function(){return[{no:1,name:"cid",kind:"scalar",T:9},{no:2,name:"name",kind:"scalar",T:9},{no:3,name:"type",kind:"enum",T:we.getEnumType(Ki)},{no:4,name:"width",kind:"scalar",T:13},{no:5,name:"height",kind:"scalar",T:13},{no:6,name:"muted",kind:"scalar",T:8},{no:7,name:"disable_dtx",kind:"scalar",T:8},{no:8,name:"source",kind:"enum",T:we.getEnumType(Vn)},{no:9,name:"layers",kind:"message",T:Xs,repeated:!0},{no:10,name:"simulcast_codecs",kind:"message",T:pm,repeated:!0},{no:11,name:"sid",kind:"scalar",T:9},{no:12,name:"stereo",kind:"scalar",T:8},{no:13,name:"disable_red",kind:"scalar",T:8},{no:14,name:"encryption",kind:"enum",T:we.getEnumType(Ni)},{no:15,name:"stream",kind:"scalar",T:9}]}),gm=we.makeMessageType("livekit.TrickleRequest",function(){return[{no:1,name:"candidateInit",kind:"scalar",T:9},{no:2,name:"target",kind:"enum",T:we.getEnumType(Xi)},{no:3,name:"final",kind:"scalar",T:8}]}),vm=we.makeMessageType("livekit.MuteTrackRequest",function(){return[{no:1,name:"sid",kind:"scalar",T:9},{no:2,name:"muted",kind:"scalar",T:8}]}),JM=we.makeMessageType("livekit.JoinResponse",function(){return[{no:1,name:"room",kind:"message",T:um},{no:2,name:"participant",kind:"message",T:Rl},{no:3,name:"other_participants",kind:"message",T:Rl,repeated:!0},{no:4,name:"server_version",kind:"scalar",T:9},{no:5,name:"ice_servers",kind:"message",T:Ok,repeated:!0},{no:6,name:"subscriber_primary",kind:"scalar",T:8},{no:7,name:"alternative_url",kind:"scalar",T:9},{no:8,name:"client_configuration",kind:"message",T:xk},{no:9,name:"server_region",kind:"scalar",T:9},{no:10,name:"ping_timeout",kind:"scalar",T:5},{no:11,name:"ping_interval",kind:"scalar",T:5},{no:12,name:"server_info",kind:"message",T:zM},{no:13,name:"sif_trailer",kind:"scalar",T:12},{no:14,name:"enabled_publish_codecs",kind:"message",T:ld,repeated:!0},{no:15,name:"fast_publish",kind:"scalar",T:8}]}),QM=we.makeMessageType("livekit.ReconnectResponse",function(){return[{no:1,name:"ice_servers",kind:"message",T:Ok,repeated:!0},{no:2,name:"client_configuration",kind:"message",T:xk}]}),ym=we.makeMessageType("livekit.TrackPublishedResponse",function(){return[{no:1,name:"cid",kind:"scalar",T:9},{no:2,name:"track",kind:"message",T:ho}]}),ZM=we.makeMessageType("livekit.TrackUnpublishedResponse",function(){return[{no:1,name:"track_sid",kind:"scalar",T:9}]}),Ys=we.makeMessageType("livekit.SessionDescription",function(){return[{no:1,name:"type",kind:"scalar",T:9},{no:2,name:"sdp",kind:"scalar",T:9}]}),e9=we.makeMessageType("livekit.ParticipantUpdate",function(){return[{no:1,name:"participants",kind:"message",T:Rl,repeated:!0}]}),ud=we.makeMessageType("livekit.UpdateSubscription",function(){return[{no:1,name:"track_sids",kind:"scalar",T:9,repeated:!0},{no:2,name:"subscribe",kind:"scalar",T:8},{no:3,name:"participant_tracks",kind:"message",T:Sk,repeated:!0}]}),Ak=we.makeMessageType("livekit.UpdateTrackSettings",function(){return[{no:1,name:"track_sids",kind:"scalar",T:9,repeated:!0},{no:3,name:"disabled",kind:"scalar",T:8},{no:4,name:"quality",kind:"enum",T:we.getEnumType(cm)},{no:5,name:"width",kind:"scalar",T:13},{no:6,name:"height",kind:"scalar",T:13},{no:7,name:"fps",kind:"scalar",T:13},{no:8,name:"priority",kind:"scalar",T:13}]}),Ik=we.makeMessageType("livekit.UpdateLocalAudioTrack",function(){return[{no:1,name:"track_sid",kind:"scalar",T:9},{no:2,name:"features",kind:"enum",T:we.getEnumType(mr),repeated:!0}]}),t9=we.makeMessageType("livekit.UpdateLocalVideoTrack",function(){return[{no:1,name:"track_sid",kind:"scalar",T:9},{no:2,name:"width",kind:"scalar",T:13},{no:3,name:"height",kind:"scalar",T:13}]}),dd=we.makeMessageType("livekit.LeaveRequest",function(){return[{no:1,name:"can_reconnect",kind:"scalar",T:8},{no:2,name:"reason",kind:"enum",T:we.getEnumType(co)},{no:3,name:"action",kind:"enum",T:we.getEnumType(fo)},{no:4,name:"regions",kind:"message",T:h9}]}),fo=we.makeEnum("livekit.LeaveRequest.Action",[{no:0,name:"DISCONNECT"},{no:1,name:"RESUME"},{no:2,name:"RECONNECT"}]),Pk=we.makeMessageType("livekit.UpdateVideoLayers",function(){return[{no:1,name:"track_sid",kind:"scalar",T:9},{no:2,name:"layers",kind:"message",T:Xs,repeated:!0}]}),Nk=we.makeMessageType("livekit.UpdateParticipantMetadata",function(){return[{no:1,name:"metadata",kind:"scalar",T:9},{no:2,name:"name",kind:"scalar",T:9},{no:3,name:"attributes",kind:"map",K:9,V:{kind:"scalar",T:9}},{no:4,name:"request_id",kind:"scalar",T:13}]}),Ok=we.makeMessageType("livekit.ICEServer",function(){return[{no:1,name:"urls",kind:"scalar",T:9,repeated:!0},{no:2,name:"username",kind:"scalar",T:9},{no:3,name:"credential",kind:"scalar",T:9}]}),n9=we.makeMessageType("livekit.SpeakersChanged",function(){return[{no:1,name:"speakers",kind:"message",T:_k,repeated:!0}]}),i9=we.makeMessageType("livekit.RoomUpdate",function(){return[{no:1,name:"room",kind:"message",T:um}]}),r9=we.makeMessageType("livekit.ConnectionQualityInfo",function(){return[{no:1,name:"participant_sid",kind:"scalar",T:9},{no:2,name:"quality",kind:"enum",T:we.getEnumType(Ol)},{no:3,name:"score",kind:"scalar",T:2}]}),s9=we.makeMessageType("livekit.ConnectionQualityUpdate",function(){return[{no:1,name:"updates",kind:"message",T:r9,repeated:!0}]}),a9=we.makeMessageType("livekit.StreamStateInfo",function(){return[{no:1,name:"participant_sid",kind:"scalar",T:9},{no:2,name:"track_sid",kind:"scalar",T:9},{no:3,name:"state",kind:"enum",T:we.getEnumType(fm)}]}),o9=we.makeMessageType("livekit.StreamStateUpdate",function(){return[{no:1,name:"stream_states",kind:"message",T:a9,repeated:!0}]}),bm=we.makeMessageType("livekit.SubscribedQuality",function(){return[{no:1,name:"quality",kind:"enum",T:we.getEnumType(cm)},{no:2,name:"enabled",kind:"scalar",T:8}]}),l9=we.makeMessageType("livekit.SubscribedCodec",function(){return[{no:1,name:"codec",kind:"scalar",T:9},{no:2,name:"qualities",kind:"message",T:bm,repeated:!0}]}),c9=we.makeMessageType("livekit.SubscribedQualityUpdate",function(){return[{no:1,name:"track_sid",kind:"scalar",T:9},{no:2,name:"subscribed_qualities",kind:"message",T:bm,repeated:!0},{no:3,name:"subscribed_codecs",kind:"message",T:l9,repeated:!0}]}),Mk=we.makeMessageType("livekit.TrackPermission",function(){return[{no:1,name:"participant_sid",kind:"scalar",T:9},{no:2,name:"all_tracks",kind:"scalar",T:8},{no:3,name:"track_sids",kind:"scalar",T:9,repeated:!0},{no:4,name:"participant_identity",kind:"scalar",T:9}]}),Rk=we.makeMessageType("livekit.SubscriptionPermission",function(){return[{no:1,name:"all_participants",kind:"scalar",T:8},{no:2,name:"track_permissions",kind:"message",T:Mk,repeated:!0}]}),u9=we.makeMessageType("livekit.SubscriptionPermissionUpdate",function(){return[{no:1,name:"participant_sid",kind:"scalar",T:9},{no:2,name:"track_sid",kind:"scalar",T:9},{no:3,name:"allowed",kind:"scalar",T:8}]}),Lk=we.makeMessageType("livekit.SyncState",function(){return[{no:1,name:"answer",kind:"message",T:Ys},{no:2,name:"subscription",kind:"message",T:ud},{no:3,name:"publish_tracks",kind:"message",T:ym,repeated:!0},{no:4,name:"data_channels",kind:"message",T:Bk,repeated:!0},{no:5,name:"offer",kind:"message",T:Ys},{no:6,name:"track_sids_disabled",kind:"scalar",T:9,repeated:!0}]}),Bk=we.makeMessageType("livekit.DataChannelInfo",function(){return[{no:1,name:"label",kind:"scalar",T:9},{no:2,name:"id",kind:"scalar",T:13},{no:3,name:"target",kind:"enum",T:we.getEnumType(Xi)}]}),gr=we.makeMessageType("livekit.SimulateScenario",function(){return[{no:1,name:"speaker_update",kind:"scalar",T:5,oneof:"scenario"},{no:2,name:"node_failure",kind:"scalar",T:8,oneof:"scenario"},{no:3,name:"migration",kind:"scalar",T:8,oneof:"scenario"},{no:4,name:"server_leave",kind:"scalar",T:8,oneof:"scenario"},{no:5,name:"switch_candidate_protocol",kind:"enum",T:we.getEnumType(XM),oneof:"scenario"},{no:6,name:"subscriber_bandwidth",kind:"scalar",T:3,oneof:"scenario"},{no:7,name:"disconnect_signal_on_resume",kind:"scalar",T:8,oneof:"scenario"},{no:8,name:"disconnect_signal_on_resume_no_messages",kind:"scalar",T:8,oneof:"scenario"},{no:9,name:"leave_request_full_reconnect",kind:"scalar",T:8,oneof:"scenario"}]}),Uk=we.makeMessageType("livekit.Ping",function(){return[{no:1,name:"timestamp",kind:"scalar",T:3},{no:2,name:"rtt",kind:"scalar",T:3}]}),d9=we.makeMessageType("livekit.Pong",function(){return[{no:1,name:"last_ping_timestamp",kind:"scalar",T:3},{no:2,name:"timestamp",kind:"scalar",T:3}]}),h9=we.makeMessageType("livekit.RegionSettings",function(){return[{no:1,name:"regions",kind:"message",T:f9,repeated:!0}]}),f9=we.makeMessageType("livekit.RegionInfo",function(){return[{no:1,name:"region",kind:"scalar",T:9},{no:2,name:"url",kind:"scalar",T:9},{no:3,name:"distance",kind:"scalar",T:3}]}),p9=we.makeMessageType("livekit.SubscriptionResponse",function(){return[{no:1,name:"track_sid",kind:"scalar",T:9},{no:2,name:"err",kind:"enum",T:we.getEnumType(RM)}]}),m9=we.makeMessageType("livekit.RequestResponse",function(){return[{no:1,name:"request_id",kind:"scalar",T:13},{no:2,name:"reason",kind:"enum",T:we.getEnumType(Fk)},{no:3,name:"message",kind:"scalar",T:9}]}),Fk=we.makeEnum("livekit.RequestResponse.Reason",[{no:0,name:"OK"},{no:1,name:"NOT_FOUND"},{no:2,name:"NOT_ALLOWED"},{no:3,name:"LIMIT_EXCEEDED"}]),g9=we.makeMessageType("livekit.TrackSubscribed",function(){return[{no:1,name:"track_sid",kind:"scalar",T:9}]});function v9(i){return i&&i.__esModule&&Object.prototype.hasOwnProperty.call(i,"default")?i.default:i}var Vk,_m={exports:{}},jk,$k,km,Tm,Yi,hd=(Vk||(Vk=1,$k=_m.exports,km=function(){var i=function(){},e="undefined",t=(typeof window>"u"?"undefined":et(window))!==e&&et(window.navigator)!==e&&/Trident\/|MSIE /.test(window.navigator.userAgent),n=["trace","debug","info","warn","error"],r={},s=null;function a(v,y){var p=v[y];if(typeof p.bind=="function")return p.bind(v);try{return Function.prototype.bind.call(p,v)}catch{return function(){return Function.prototype.apply.apply(p,[v,arguments])}}}function o(){console.log&&(console.log.apply||Function.prototype.apply.apply(console.log,[console,arguments]))}function c(){for(var v=this.getLevel(),y=0;y<n.length;y++){var p=n[y];this[p]=v>y?i:this.methodFactory(p,v,this.name)}if(this.log=this.debug,(typeof console>"u"?"undefined":et(console))===e&&v<this.levels.SILENT)return"No console available for logging"}function u(v){return function(){(typeof console>"u"?"undefined":et(console))!==e&&(c.call(this),this[v].apply(this,arguments))}}function d(v,y,p){return function(f){return f==="debug"&&(f="log"),(typeof console>"u"?"undefined":et(console))!==e&&(f==="trace"&&t?o:console[f]!==void 0?a(console,f):console.log!==void 0?a(console,"log"):i)}(v)||u.apply(this,arguments)}function h(v,y){var p,f,m,_=this,k="loglevel";function D(){var x;if((typeof window>"u"?"undefined":et(window))!==e&&k){try{x=window.localStorage[k]}catch{}if(et(x)===e)try{var P=window.document.cookie,S=encodeURIComponent(k),M=P.indexOf(S+"=");M!==-1&&(x=/^([^;]+)/.exec(P.slice(M+S.length+1))[1])}catch{}return _.levels[x]===void 0&&(x=void 0),x}}function w(x){var P=x;if(typeof P=="string"&&_.levels[P.toUpperCase()]!==void 0&&(P=_.levels[P.toUpperCase()]),typeof P!="number"||0>P||P>_.levels.SILENT)throw new TypeError("log.setLevel() called with invalid level: "+x);return P}typeof v=="string"?k+=":"+v:et(v)==="symbol"&&(k=void 0),_.name=v,_.levels={TRACE:0,DEBUG:1,INFO:2,WARN:3,ERROR:4,SILENT:5},_.methodFactory=y||d,_.getLevel=function(){return m??f??p},_.setLevel=function(x,P){return m=w(x),P!==!1&&function(S){var M=(n[S]||"silent").toUpperCase();if((typeof window>"u"?"undefined":et(window))!==e&&k){try{return void(window.localStorage[k]=M)}catch{}try{window.document.cookie=encodeURIComponent(k)+"="+M+";"}catch{}}}(m),c.call(_)},_.setDefaultLevel=function(x){f=w(x),D()||_.setLevel(x,!1)},_.resetLevel=function(){m=null,function(){if((typeof window>"u"?"undefined":et(window))!==e&&k){try{window.localStorage.removeItem(k)}catch{}try{window.document.cookie=encodeURIComponent(k)+"=; expires=Thu, 01 Jan 1970 00:00:00 UTC"}catch{}}}(),c.call(_)},_.enableAll=function(x){_.setLevel(_.levels.TRACE,x)},_.disableAll=function(x){_.setLevel(_.levels.SILENT,x)},_.rebuild=function(){if(s!==_&&(p=w(s.getLevel())),c.call(_),s===_)for(var x in r)r[x].rebuild()},p=w(s?s.getLevel():"WARN");var A=D();A!=null&&(m=w(A)),c.call(_)}(s=new h).getLogger=function(v){if(et(v)!=="symbol"&&typeof v!="string"||v==="")throw new TypeError("You must supply a name when creating a logger.");var y=r[v];return y||(y=r[v]=new h(v,s.methodFactory)),y};var b=(typeof window>"u"?"undefined":et(window))!==e?window.log:void 0;return s.noConflict=function(){return(typeof window>"u"?"undefined":et(window))!==e&&window.log===s&&(window.log=b),s},s.getLoggers=function(){return r},s.default=s,s},(jk=_m).exports?jk.exports=km():$k.log=km()),_m.exports);(function(i){i[i.trace=0]="trace",i[i.debug=1]="debug",i[i.info=2]="info",i[i.warn=3]="warn",i[i.error=4]="error",i[i.silent=5]="silent"})(Tm||(Tm={})),function(i){i.Default="livekit",i.Room="livekit-room",i.Participant="livekit-participant",i.Track="livekit-track",i.Publication="livekit-track-publication",i.Engine="livekit-engine",i.Signal="livekit-signal",i.PCManager="livekit-pc-manager",i.PCTransport="livekit-pc-transport",i.E2EE="lk-e2ee"}(Yi||(Yi={}));var xt=hd.getLogger("livekit");function Lr(i){var e=hd.getLogger(i);return e.setDefaultLevel(xt.getLevel()),e}Object.values(Yi).map(function(i){return hd.getLogger(i)}),xt.setDefaultLevel(Tm.info);var y9=hd.getLogger("lk-e2ee"),Bl=7e3,b9=[0,300,1200,2700,4800,Bl,Bl,Bl,Bl,Bl],_9=function(){function i(e){ht(this,i),this._retryDelays=e!==void 0?Pi(e):b9}return ft(i,[{key:"nextRetryDelayInMs",value:function(e){if(e.retryCount>=this._retryDelays.length)return null;var t=this._retryDelays[e.retryCount];return e.retryCount>1?t+1e3*Math.random():t}}]),i}();function he(i,e,t,n){return new(t||(t=Promise))(function(r,s){function a(u){try{c(n.next(u))}catch(d){s(d)}}function o(u){try{c(n.throw(u))}catch(d){s(d)}}function c(u){var d;u.done?r(u.value):(d=u.value,d instanceof t?d:new t(function(h){h(d)})).then(a,o)}c((n=n.apply(i,e||[])).next())})}function k9(i){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&i[e],n=0;if(t)return t.call(i);if(i&&typeof i.length=="number")return{next:function(){return i&&n>=i.length&&(i=void 0),{value:i&&i[n++],done:!i}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function po(i){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e,t=i[Symbol.asyncIterator];return t?t.call(i):(i=k9(i),e={},n("next"),n("throw"),n("return"),e[Symbol.asyncIterator]=function(){return this},e);function n(r){e[r]=i[r]&&function(s){return new Promise(function(a,o){(function(c,u,d,h){Promise.resolve(h).then(function(b){c({value:b,done:d})},u)})(a,o,(s=i[r](s)).done,s.value)})}}}typeof SuppressedError=="function"&&SuppressedError;var Hk,fd={exports:{}},Js=function(){if(Hk)return fd.exports;Hk=1;var i,e=(typeof Reflect>"u"?"undefined":et(Reflect))==="object"?Reflect:null,t=e&&typeof e.apply=="function"?e.apply:function(p,f,m){return Function.prototype.apply.call(p,f,m)};i=e&&typeof e.ownKeys=="function"?e.ownKeys:Object.getOwnPropertySymbols?function(p){return Object.getOwnPropertyNames(p).concat(Object.getOwnPropertySymbols(p))}:function(p){return Object.getOwnPropertyNames(p)};var n=Number.isNaN||function(p){return p!=p};function r(){r.init.call(this)}fd.exports=r,fd.exports.once=function(p,f){return new Promise(function(m,_){function k(w){p.removeListener(f,D),_(w)}function D(){typeof p.removeListener=="function"&&p.removeListener("error",k),m([].slice.call(arguments))}y(p,f,D,{once:!0}),f!=="error"&&function(w,A,x){typeof w.on=="function"&&y(w,"error",A,x)}(p,k,{once:!0})})},r.EventEmitter=r,r.prototype._events=void 0,r.prototype._eventsCount=0,r.prototype._maxListeners=void 0;var s=10;function a(p){if(typeof p!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+et(p))}function o(p){return p._maxListeners===void 0?r.defaultMaxListeners:p._maxListeners}function c(p,f,m,_){var k,D,w;if(a(m),(D=p._events)===void 0?(D=p._events=Object.create(null),p._eventsCount=0):(D.newListener!==void 0&&(p.emit("newListener",f,m.listener?m.listener:m),D=p._events),w=D[f]),w===void 0)w=D[f]=m,++p._eventsCount;else if(typeof w=="function"?w=D[f]=_?[m,w]:[w,m]:_?w.unshift(m):w.push(m),(k=o(p))>0&&w.length>k&&!w.warned){w.warned=!0;var A=new Error("Possible EventEmitter memory leak detected. "+w.length+" "+String(f)+" listeners added. Use emitter.setMaxListeners() to increase limit");A.name="MaxListenersExceededWarning",A.emitter=p,A.type=f,A.count=w.length}return p}function u(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function d(p,f,m){var _={fired:!1,wrapFn:void 0,target:p,type:f,listener:m},k=u.bind(_);return k.listener=m,_.wrapFn=k,k}function h(p,f,m){var _=p._events;if(_===void 0)return[];var k=_[f];return k===void 0?[]:typeof k=="function"?m?[k.listener||k]:[k]:m?function(D){for(var w=new Array(D.length),A=0;A<w.length;++A)w[A]=D[A].listener||D[A];return w}(k):v(k,k.length)}function b(p){var f=this._events;if(f!==void 0){var m=f[p];if(typeof m=="function")return 1;if(m!==void 0)return m.length}return 0}function v(p,f){for(var m=new Array(f),_=0;f>_;++_)m[_]=p[_];return m}function y(p,f,m,_){if(typeof p.on=="function")_.once?p.once(f,m):p.on(f,m);else{if(typeof p.addEventListener!="function")throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+et(p));p.addEventListener(f,function k(D){_.once&&p.removeEventListener(f,k),m(D)})}}return Object.defineProperty(r,"defaultMaxListeners",{enumerable:!0,get:function(){return s},set:function(p){if(typeof p!="number"||0>p||n(p))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+p+".");s=p}}),r.init=function(){this._events!==void 0&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},r.prototype.setMaxListeners=function(p){if(typeof p!="number"||0>p||n(p))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+p+".");return this._maxListeners=p,this},r.prototype.getMaxListeners=function(){return o(this)},r.prototype.emit=function(p){for(var f=[],m=1;arguments.length>m;m++)f.push(arguments[m]);var _=p==="error",k=this._events;if(k!==void 0)_=_&&k.error===void 0;else if(!_)return!1;if(_){var D;if(f.length>0&&(D=f[0]),D instanceof Error)throw D;var w=new Error("Unhandled error."+(D?" ("+D.message+")":""));throw w.context=D,w}var A=k[p];if(A===void 0)return!1;if(typeof A=="function")t(A,this,f);else{var x=A.length,P=v(A,x);for(m=0;x>m;++m)t(P[m],this,f)}return!0},r.prototype.addListener=function(p,f){return c(this,p,f,!1)},r.prototype.on=r.prototype.addListener,r.prototype.prependListener=function(p,f){return c(this,p,f,!0)},r.prototype.once=function(p,f){return a(f),this.on(p,d(this,p,f)),this},r.prototype.prependOnceListener=function(p,f){return a(f),this.prependListener(p,d(this,p,f)),this},r.prototype.removeListener=function(p,f){var m,_,k,D,w;if(a(f),(_=this._events)===void 0)return this;if((m=_[p])===void 0)return this;if(m===f||m.listener===f)--this._eventsCount==0?this._events=Object.create(null):(delete _[p],_.removeListener&&this.emit("removeListener",p,m.listener||f));else if(typeof m!="function"){for(k=-1,D=m.length-1;D>=0;D--)if(m[D]===f||m[D].listener===f){w=m[D].listener,k=D;break}if(0>k)return this;k===0?m.shift():function(A,x){for(;x+1<A.length;x++)A[x]=A[x+1];A.pop()}(m,k),m.length===1&&(_[p]=m[0]),_.removeListener!==void 0&&this.emit("removeListener",p,w||f)}return this},r.prototype.off=r.prototype.removeListener,r.prototype.removeAllListeners=function(p){var f,m,_;if((m=this._events)===void 0)return this;if(m.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):m[p]!==void 0&&(--this._eventsCount==0?this._events=Object.create(null):delete m[p]),this;if(arguments.length===0){var k,D=Object.keys(m);for(_=0;_<D.length;++_)(k=D[_])!=="removeListener"&&this.removeAllListeners(k);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(typeof(f=m[p])=="function")this.removeListener(p,f);else if(f!==void 0)for(_=f.length-1;_>=0;_--)this.removeListener(p,f[_]);return this},r.prototype.listeners=function(p){return h(this,p,!0)},r.prototype.rawListeners=function(p){return h(this,p,!1)},r.listenerCount=function(p,f){return typeof p.listenerCount=="function"?p.listenerCount(f):b.call(p,f)},r.prototype.listenerCount=b,r.prototype.eventNames=function(){return this._eventsCount>0?i(this._events):[]},fd.exports}(),qk=!0;function pd(i,e,t){var n=i.match(e);return n&&n.length>=t&&parseInt(n[t],10)}function Qs(i,e,t){if(i.RTCPeerConnection){var n=i.RTCPeerConnection.prototype,r=n.addEventListener;n.addEventListener=function(a,o){if(a!==e)return r.apply(this,arguments);var c=function(u){var d=t(u);d&&(o.handleEvent?o.handleEvent(d):o(d))};return this._eventMap=this._eventMap||{},this._eventMap[e]||(this._eventMap[e]=new Map),this._eventMap[e].set(o,c),r.apply(this,[a,c])};var s=n.removeEventListener;n.removeEventListener=function(a,o){if(a!==e||!this._eventMap||!this._eventMap[e])return s.apply(this,arguments);if(!this._eventMap[e].has(o))return s.apply(this,arguments);var c=this._eventMap[e].get(o);return this._eventMap[e].delete(o),this._eventMap[e].size===0&&delete this._eventMap[e],Object.keys(this._eventMap).length===0&&delete this._eventMap,s.apply(this,[a,c])},Object.defineProperty(n,"on"+e,{get:function(){return this["_on"+e]},set:function(a){this["_on"+e]&&(this.removeEventListener(e,this["_on"+e]),delete this["_on"+e]),a&&this.addEventListener(e,this["_on"+e]=a)},enumerable:!0,configurable:!0})}}function T9(i){return typeof i!="boolean"?new Error("Argument type: "+et(i)+". Please use a boolean."):(qk=i,i?"adapter.js logging disabled":"adapter.js logging enabled")}function S9(i){return typeof i!="boolean"?new Error("Argument type: "+et(i)+". Please use a boolean."):"adapter.js deprecation warnings "+(i?"disabled":"enabled")}function zk(){typeof window>"u"||et(window)}function Gk(i){return Object.prototype.toString.call(i)==="[object Object]"}function Wk(i){return Gk(i)?Object.keys(i).reduce(function(e,t){var n=Gk(i[t]),r=n?Wk(i[t]):i[t],s=n&&!Object.keys(r).length;return r===void 0||s?e:Object.assign(e,ao({},t,r))},{}):i}function Sm(i,e,t){e&&!t.has(e.id)&&(t.set(e.id,e),Object.keys(e).forEach(function(n){n.endsWith("Id")?Sm(i,i.get(e[n]),t):n.endsWith("Ids")&&e[n].forEach(function(r){Sm(i,i.get(r),t)})}))}function Kk(i,e,t){var n=t?"outbound-rtp":"inbound-rtp",r=new Map;if(e===null)return r;var s=[];return i.forEach(function(a){a.type==="track"&&a.trackIdentifier===e.id&&s.push(a)}),s.forEach(function(a){i.forEach(function(o){o.type===n&&o.trackId===a.id&&Sm(i,o,r)})}),r}var Xk=zk;function Yk(i,e){var t=i&&i.navigator;if(t.mediaDevices){var n=function(o){if(et(o)!=="object"||o.mandatory||o.optional)return o;var c={};return Object.keys(o).forEach(function(u){if(u!=="require"&&u!=="advanced"&&u!=="mediaSource"){var d=et(o[u])==="object"?o[u]:{ideal:o[u]};d.exact!==void 0&&typeof d.exact=="number"&&(d.min=d.max=d.exact);var h=function(v,y){return v?v+y.charAt(0).toUpperCase()+y.slice(1):y==="deviceId"?"sourceId":y};if(d.ideal!==void 0){c.optional=c.optional||[];var b={};typeof d.ideal=="number"?(b[h("min",u)]=d.ideal,c.optional.push(b),(b={})[h("max",u)]=d.ideal,c.optional.push(b)):(b[h("",u)]=d.ideal,c.optional.push(b))}d.exact!==void 0&&typeof d.exact!="number"?(c.mandatory=c.mandatory||{},c.mandatory[h("",u)]=d.exact):["min","max"].forEach(function(v){d[v]!==void 0&&(c.mandatory=c.mandatory||{},c.mandatory[h(v,u)]=d[v])})}}),o.advanced&&(c.optional=(c.optional||[]).concat(o.advanced)),c},r=function(o,c){if(e.version>=61)return c(o);if((o=JSON.parse(JSON.stringify(o)))&&et(o.audio)==="object"){var u=function(v,y,p){y in v&&!(p in v)&&(v[p]=v[y],delete v[y])};u((o=JSON.parse(JSON.stringify(o))).audio,"autoGainControl","googAutoGainControl"),u(o.audio,"noiseSuppression","googNoiseSuppression"),o.audio=n(o.audio)}if(o&&et(o.video)==="object"){var d=o.video.facingMode;d=d&&(et(d)==="object"?d:{ideal:d});var h,b=66>e.version;if(d&&(d.exact==="user"||d.exact==="environment"||d.ideal==="user"||d.ideal==="environment")&&(!t.mediaDevices.getSupportedConstraints||!t.mediaDevices.getSupportedConstraints().facingMode||b)&&(delete o.video.facingMode,d.exact==="environment"||d.ideal==="environment"?h=["back","rear"]:d.exact!=="user"&&d.ideal!=="user"||(h=["front"]),h))return t.mediaDevices.enumerateDevices().then(function(v){var y=(v=v.filter(function(p){return p.kind==="videoinput"})).find(function(p){return h.some(function(f){return p.label.toLowerCase().includes(f)})});return!y&&v.length&&h.includes("back")&&(y=v[v.length-1]),y&&(o.video.deviceId=d.exact?{exact:y.deviceId}:{ideal:y.deviceId}),o.video=n(o.video),Xk("chrome: "+JSON.stringify(o)),c(o)});o.video=n(o.video)}return Xk("chrome: "+JSON.stringify(o)),c(o)},s=function(o){return 64>e.version?{name:{PermissionDeniedError:"NotAllowedError",PermissionDismissedError:"NotAllowedError",InvalidStateError:"NotAllowedError",DevicesNotFoundError:"NotFoundError",ConstraintNotSatisfiedError:"OverconstrainedError",TrackStartError:"NotReadableError",MediaDeviceFailedDueToShutdown:"NotAllowedError",MediaDeviceKillSwitchOn:"NotAllowedError",TabCaptureError:"AbortError",ScreenCaptureError:"AbortError",DeviceCaptureError:"AbortError"}[o.name]||o.name,message:o.message,constraint:o.constraint||o.constraintName,toString:function(){return this.name+(this.message&&": ")+this.message}}:o};if(t.getUserMedia=(function(o,c,u){r(o,function(d){t.webkitGetUserMedia(d,c,function(h){u&&u(s(h))})})}).bind(t),t.mediaDevices.getUserMedia){var a=t.mediaDevices.getUserMedia.bind(t.mediaDevices);t.mediaDevices.getUserMedia=function(o){return r(o,function(c){return a(c).then(function(u){if(c.audio&&!u.getAudioTracks().length||c.video&&!u.getVideoTracks().length)throw u.getTracks().forEach(function(d){d.stop()}),new DOMException("","NotFoundError");return u},function(u){return Promise.reject(s(u))})})}}}}function Jk(i){i.MediaStream=i.MediaStream||i.webkitMediaStream}function Qk(i){if(et(i)==="object"&&i.RTCPeerConnection&&!("ontrack"in i.RTCPeerConnection.prototype)){Object.defineProperty(i.RTCPeerConnection.prototype,"ontrack",{get:function(){return this._ontrack},set:function(t){this._ontrack&&this.removeEventListener("track",this._ontrack),this.addEventListener("track",this._ontrack=t)},enumerable:!0,configurable:!0});var e=i.RTCPeerConnection.prototype.setRemoteDescription;i.RTCPeerConnection.prototype.setRemoteDescription=function(){var t=this;return this._ontrackpoly||(this._ontrackpoly=function(n){n.stream.addEventListener("addtrack",function(r){var s;s=i.RTCPeerConnection.prototype.getReceivers?t.getReceivers().find(function(o){return o.track&&o.track.id===r.track.id}):{track:r.track};var a=new Event("track");a.track=r.track,a.receiver=s,a.transceiver={receiver:s},a.streams=[n.stream],t.dispatchEvent(a)}),n.stream.getTracks().forEach(function(r){var s;s=i.RTCPeerConnection.prototype.getReceivers?t.getReceivers().find(function(o){return o.track&&o.track.id===r.id}):{track:r};var a=new Event("track");a.track=r,a.receiver=s,a.transceiver={receiver:s},a.streams=[n.stream],t.dispatchEvent(a)})},this.addEventListener("addstream",this._ontrackpoly)),e.apply(this,arguments)}}else Qs(i,"track",function(t){return t.transceiver||Object.defineProperty(t,"transceiver",{value:{receiver:t.receiver}}),t})}function Zk(i){if(et(i)==="object"&&i.RTCPeerConnection&&!("getSenders"in i.RTCPeerConnection.prototype)&&"createDTMFSender"in i.RTCPeerConnection.prototype){var e=function(o,c){return{track:c,get dtmf(){return this._dtmf===void 0&&(c.kind==="audio"?this._dtmf=o.createDTMFSender(c):this._dtmf=null),this._dtmf},_pc:o}};if(!i.RTCPeerConnection.prototype.getSenders){i.RTCPeerConnection.prototype.getSenders=function(){return this._senders=this._senders||[],this._senders.slice()};var t=i.RTCPeerConnection.prototype.addTrack;i.RTCPeerConnection.prototype.addTrack=function(o,c){var u=t.apply(this,arguments);return u||(u=e(this,o),this._senders.push(u)),u};var n=i.RTCPeerConnection.prototype.removeTrack;i.RTCPeerConnection.prototype.removeTrack=function(o){n.apply(this,arguments);var c=this._senders.indexOf(o);c!==-1&&this._senders.splice(c,1)}}var r=i.RTCPeerConnection.prototype.addStream;i.RTCPeerConnection.prototype.addStream=function(o){var c=this;this._senders=this._senders||[],r.apply(this,[o]),o.getTracks().forEach(function(u){c._senders.push(e(c,u))})};var s=i.RTCPeerConnection.prototype.removeStream;i.RTCPeerConnection.prototype.removeStream=function(o){var c=this;this._senders=this._senders||[],s.apply(this,[o]),o.getTracks().forEach(function(u){var d=c._senders.find(function(h){return h.track===u});d&&c._senders.splice(c._senders.indexOf(d),1)})}}else if(et(i)==="object"&&i.RTCPeerConnection&&"getSenders"in i.RTCPeerConnection.prototype&&"createDTMFSender"in i.RTCPeerConnection.prototype&&i.RTCRtpSender&&!("dtmf"in i.RTCRtpSender.prototype)){var a=i.RTCPeerConnection.prototype.getSenders;i.RTCPeerConnection.prototype.getSenders=function(){var o=this,c=a.apply(this,[]);return c.forEach(function(u){return u._pc=o}),c},Object.defineProperty(i.RTCRtpSender.prototype,"dtmf",{get:function(){return this._dtmf===void 0&&(this.track.kind==="audio"?this._dtmf=this._pc.createDTMFSender(this.track):this._dtmf=null),this._dtmf}})}}function eT(i){if(et(i)==="object"&&i.RTCPeerConnection&&i.RTCRtpSender&&i.RTCRtpReceiver){if(!("getStats"in i.RTCRtpSender.prototype)){var e=i.RTCPeerConnection.prototype.getSenders;e&&(i.RTCPeerConnection.prototype.getSenders=function(){var s=this,a=e.apply(this,[]);return a.forEach(function(o){return o._pc=s}),a});var t=i.RTCPeerConnection.prototype.addTrack;t&&(i.RTCPeerConnection.prototype.addTrack=function(){var s=t.apply(this,arguments);return s._pc=this,s}),i.RTCRtpSender.prototype.getStats=function(){var s=this;return this._pc.getStats().then(function(a){return Kk(a,s.track,!0)})}}if(!("getStats"in i.RTCRtpReceiver.prototype)){var n=i.RTCPeerConnection.prototype.getReceivers;n&&(i.RTCPeerConnection.prototype.getReceivers=function(){var s=this,a=n.apply(this,[]);return a.forEach(function(o){return o._pc=s}),a}),Qs(i,"track",function(s){return s.receiver._pc=s.srcElement,s}),i.RTCRtpReceiver.prototype.getStats=function(){var s=this;return this._pc.getStats().then(function(a){return Kk(a,s.track,!1)})}}if("getStats"in i.RTCRtpSender.prototype&&"getStats"in i.RTCRtpReceiver.prototype){var r=i.RTCPeerConnection.prototype.getStats;i.RTCPeerConnection.prototype.getStats=function(){if(arguments.length>0&&arguments[0]instanceof i.MediaStreamTrack){var s,a,o,c=arguments[0];return this.getSenders().forEach(function(u){u.track===c&&(s?o=!0:s=u)}),this.getReceivers().forEach(function(u){return u.track===c&&(a?o=!0:a=u),u.track===c}),o||s&&a?Promise.reject(new DOMException("There are more than one sender or receiver for the track.","InvalidAccessError")):s?s.getStats():a?a.getStats():Promise.reject(new DOMException("There is no sender or receiver for the track.","InvalidAccessError"))}return r.apply(this,arguments)}}}}function tT(i){i.RTCPeerConnection.prototype.getLocalStreams=function(){var s=this;return this._shimmedLocalStreams=this._shimmedLocalStreams||{},Object.keys(this._shimmedLocalStreams).map(function(a){return s._shimmedLocalStreams[a][0]})};var e=i.RTCPeerConnection.prototype.addTrack;i.RTCPeerConnection.prototype.addTrack=function(s,a){if(!a)return e.apply(this,arguments);this._shimmedLocalStreams=this._shimmedLocalStreams||{};var o=e.apply(this,arguments);return this._shimmedLocalStreams[a.id]?this._shimmedLocalStreams[a.id].indexOf(o)===-1&&this._shimmedLocalStreams[a.id].push(o):this._shimmedLocalStreams[a.id]=[a,o],o};var t=i.RTCPeerConnection.prototype.addStream;i.RTCPeerConnection.prototype.addStream=function(s){var a=this;this._shimmedLocalStreams=this._shimmedLocalStreams||{},s.getTracks().forEach(function(u){if(a.getSenders().find(function(d){return d.track===u}))throw new DOMException("Track already exists.","InvalidAccessError")});var o=this.getSenders();t.apply(this,arguments);var c=this.getSenders().filter(function(u){return o.indexOf(u)===-1});this._shimmedLocalStreams[s.id]=[s].concat(c)};var n=i.RTCPeerConnection.prototype.removeStream;i.RTCPeerConnection.prototype.removeStream=function(s){return this._shimmedLocalStreams=this._shimmedLocalStreams||{},delete this._shimmedLocalStreams[s.id],n.apply(this,arguments)};var r=i.RTCPeerConnection.prototype.removeTrack;i.RTCPeerConnection.prototype.removeTrack=function(s){var a=this;return this._shimmedLocalStreams=this._shimmedLocalStreams||{},s&&Object.keys(this._shimmedLocalStreams).forEach(function(o){var c=a._shimmedLocalStreams[o].indexOf(s);c!==-1&&a._shimmedLocalStreams[o].splice(c,1),a._shimmedLocalStreams[o].length===1&&delete a._shimmedLocalStreams[o]}),r.apply(this,arguments)}}function nT(i,e){if(i.RTCPeerConnection){if(i.RTCPeerConnection.prototype.addTrack&&e.version>=65)return tT(i);var t=i.RTCPeerConnection.prototype.getLocalStreams;i.RTCPeerConnection.prototype.getLocalStreams=function(){var c=this,u=t.apply(this);return this._reverseStreams=this._reverseStreams||{},u.map(function(d){return c._reverseStreams[d.id]})};var n=i.RTCPeerConnection.prototype.addStream;i.RTCPeerConnection.prototype.addStream=function(c){var u=this;if(this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{},c.getTracks().forEach(function(h){if(u.getSenders().find(function(b){return b.track===h}))throw new DOMException("Track already exists.","InvalidAccessError")}),!this._reverseStreams[c.id]){var d=new i.MediaStream(c.getTracks());this._streams[c.id]=d,this._reverseStreams[d.id]=c,c=d}n.apply(this,[c])};var r=i.RTCPeerConnection.prototype.removeStream;i.RTCPeerConnection.prototype.removeStream=function(c){this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{},r.apply(this,[this._streams[c.id]||c]),delete this._reverseStreams[this._streams[c.id]?this._streams[c.id].id:c.id],delete this._streams[c.id]},i.RTCPeerConnection.prototype.addTrack=function(c,u){var d=this;if(this.signalingState==="closed")throw new DOMException("The RTCPeerConnection's signalingState is 'closed'.","InvalidStateError");var h=[].slice.call(arguments,1);if(h.length!==1||!h[0].getTracks().find(function(y){return y===c}))throw new DOMException("The adapter.js addTrack polyfill only supports a single stream which is associated with the specified track.","NotSupportedError");if(this.getSenders().find(function(y){return y.track===c}))throw new DOMException("Track already exists.","InvalidAccessError");this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{};var b=this._streams[u.id];if(b)b.addTrack(c),Promise.resolve().then(function(){d.dispatchEvent(new Event("negotiationneeded"))});else{var v=new i.MediaStream([c]);this._streams[u.id]=v,this._reverseStreams[v.id]=u,this.addStream(v)}return this.getSenders().find(function(y){return y.track===c})},["createOffer","createAnswer"].forEach(function(c){var u=i.RTCPeerConnection.prototype[c],d=ao({},c,function(){var h=this,b=arguments;return arguments.length&&typeof arguments[0]=="function"?u.apply(this,[function(v){var y=o(h,v);b[0].apply(null,[y])},function(v){b[1]&&b[1].apply(null,v)},arguments[2]]):u.apply(this,arguments).then(function(v){return o(h,v)})});i.RTCPeerConnection.prototype[c]=d[c]});var s=i.RTCPeerConnection.prototype.setLocalDescription;i.RTCPeerConnection.prototype.setLocalDescription=function(){return arguments.length&&arguments[0].type?(arguments[0]=function(c,u){var d=u.sdp;return Object.keys(c._reverseStreams||[]).forEach(function(h){var b=c._reverseStreams[h],v=c._streams[b.id];d=d.replace(new RegExp(b.id,"g"),v.id)}),new RTCSessionDescription({type:u.type,sdp:d})}(this,arguments[0]),s.apply(this,arguments)):s.apply(this,arguments)};var a=Object.getOwnPropertyDescriptor(i.RTCPeerConnection.prototype,"localDescription");Object.defineProperty(i.RTCPeerConnection.prototype,"localDescription",{get:function(){var c=a.get.apply(this);return c.type===""?c:o(this,c)}}),i.RTCPeerConnection.prototype.removeTrack=function(c){var u,d=this;if(this.signalingState==="closed")throw new DOMException("The RTCPeerConnection's signalingState is 'closed'.","InvalidStateError");if(!c._pc)throw new DOMException("Argument 1 of RTCPeerConnection.removeTrack does not implement interface RTCRtpSender.","TypeError");if(c._pc!==this)throw new DOMException("Sender was not created by this connection.","InvalidAccessError");this._streams=this._streams||{},Object.keys(this._streams).forEach(function(h){d._streams[h].getTracks().find(function(b){return c.track===b})&&(u=d._streams[h])}),u&&(u.getTracks().length===1?this.removeStream(this._reverseStreams[u.id]):u.removeTrack(c.track),this.dispatchEvent(new Event("negotiationneeded")))}}function o(c,u){var d=u.sdp;return Object.keys(c._reverseStreams||[]).forEach(function(h){var b=c._reverseStreams[h],v=c._streams[b.id];d=d.replace(new RegExp(v.id,"g"),b.id)}),new RTCSessionDescription({type:u.type,sdp:d})}}function Cm(i,e){!i.RTCPeerConnection&&i.webkitRTCPeerConnection&&(i.RTCPeerConnection=i.webkitRTCPeerConnection),i.RTCPeerConnection&&53>e.version&&["setLocalDescription","setRemoteDescription","addIceCandidate"].forEach(function(t){var n=i.RTCPeerConnection.prototype[t],r=ao({},t,function(){return arguments[0]=new(t==="addIceCandidate"?i.RTCIceCandidate:i.RTCSessionDescription)(arguments[0]),n.apply(this,arguments)});i.RTCPeerConnection.prototype[t]=r[t]})}function iT(i,e){Qs(i,"negotiationneeded",function(t){var n=t.target;if(!(72>e.version||n.getConfiguration&&n.getConfiguration().sdpSemantics==="plan-b")||n.signalingState==="stable")return t})}var rT=Object.freeze({__proto__:null,fixNegotiationNeeded:iT,shimAddTrackRemoveTrack:nT,shimAddTrackRemoveTrackWithNative:tT,shimGetSendersWithDtmf:Zk,shimGetUserMedia:Yk,shimMediaStream:Jk,shimOnTrack:Qk,shimPeerConnection:Cm,shimSenderReceiverGetStats:eT});function sT(i,e){var t=i&&i.navigator,n=i&&i.MediaStreamTrack;if(t.getUserMedia=function(c,u,d){t.mediaDevices.getUserMedia(c).then(u,d)},55>=e.version||!("autoGainControl"in t.mediaDevices.getSupportedConstraints())){var r=function(c,u,d){u in c&&!(d in c)&&(c[d]=c[u],delete c[u])},s=t.mediaDevices.getUserMedia.bind(t.mediaDevices);if(t.mediaDevices.getUserMedia=function(c){return et(c)==="object"&&et(c.audio)==="object"&&(c=JSON.parse(JSON.stringify(c)),r(c.audio,"autoGainControl","mozAutoGainControl"),r(c.audio,"noiseSuppression","mozNoiseSuppression")),s(c)},n&&n.prototype.getSettings){var a=n.prototype.getSettings;n.prototype.getSettings=function(){var c=a.apply(this,arguments);return r(c,"mozAutoGainControl","autoGainControl"),r(c,"mozNoiseSuppression","noiseSuppression"),c}}if(n&&n.prototype.applyConstraints){var o=n.prototype.applyConstraints;n.prototype.applyConstraints=function(c){return this.kind==="audio"&&et(c)==="object"&&(c=JSON.parse(JSON.stringify(c)),r(c,"autoGainControl","mozAutoGainControl"),r(c,"noiseSuppression","mozNoiseSuppression")),o.apply(this,[c])}}}}function aT(i){et(i)==="object"&&i.RTCTrackEvent&&"receiver"in i.RTCTrackEvent.prototype&&!("transceiver"in i.RTCTrackEvent.prototype)&&Object.defineProperty(i.RTCTrackEvent.prototype,"transceiver",{get:function(){return{receiver:this.receiver}}})}function xm(i,e){if(et(i)==="object"&&(i.RTCPeerConnection||i.mozRTCPeerConnection)){!i.RTCPeerConnection&&i.mozRTCPeerConnection&&(i.RTCPeerConnection=i.mozRTCPeerConnection),53>e.version&&["setLocalDescription","setRemoteDescription","addIceCandidate"].forEach(function(r){var s=i.RTCPeerConnection.prototype[r],a=ao({},r,function(){return arguments[0]=new(r==="addIceCandidate"?i.RTCIceCandidate:i.RTCSessionDescription)(arguments[0]),s.apply(this,arguments)});i.RTCPeerConnection.prototype[r]=a[r]});var t={inboundrtp:"inbound-rtp",outboundrtp:"outbound-rtp",candidatepair:"candidate-pair",localcandidate:"local-candidate",remotecandidate:"remote-candidate"},n=i.RTCPeerConnection.prototype.getStats;i.RTCPeerConnection.prototype.getStats=function(){var r=Array.prototype.slice.call(arguments),s=r[0],a=r[1],o=r[2];return n.apply(this,[s||null]).then(function(c){if(53>e.version&&!a)try{c.forEach(function(u){u.type=t[u.type]||u.type})}catch(u){if(u.name!=="TypeError")throw u;c.forEach(function(d,h){c.set(h,Object.assign({},d,{type:t[d.type]||d.type}))})}return c}).then(a,o)}}}function oT(i){if(et(i)==="object"&&i.RTCPeerConnection&&i.RTCRtpSender&&(!i.RTCRtpSender||!("getStats"in i.RTCRtpSender.prototype))){var e=i.RTCPeerConnection.prototype.getSenders;e&&(i.RTCPeerConnection.prototype.getSenders=function(){var n=this,r=e.apply(this,[]);return r.forEach(function(s){return s._pc=n}),r});var t=i.RTCPeerConnection.prototype.addTrack;t&&(i.RTCPeerConnection.prototype.addTrack=function(){var n=t.apply(this,arguments);return n._pc=this,n}),i.RTCRtpSender.prototype.getStats=function(){return this.track?this._pc.getStats(this.track):Promise.resolve(new Map)}}}function lT(i){if(et(i)==="object"&&i.RTCPeerConnection&&i.RTCRtpSender&&(!i.RTCRtpSender||!("getStats"in i.RTCRtpReceiver.prototype))){var e=i.RTCPeerConnection.prototype.getReceivers;e&&(i.RTCPeerConnection.prototype.getReceivers=function(){var t=this,n=e.apply(this,[]);return n.forEach(function(r){return r._pc=t}),n}),Qs(i,"track",function(t){return t.receiver._pc=t.srcElement,t}),i.RTCRtpReceiver.prototype.getStats=function(){return this._pc.getStats(this.track)}}}function cT(i){i.RTCPeerConnection&&!("removeStream"in i.RTCPeerConnection.prototype)&&(i.RTCPeerConnection.prototype.removeStream=function(e){var t=this;this.getSenders().forEach(function(n){n.track&&e.getTracks().includes(n.track)&&t.removeTrack(n)})})}function uT(i){i.DataChannel&&!i.RTCDataChannel&&(i.RTCDataChannel=i.DataChannel)}function dT(i){if(et(i)==="object"&&i.RTCPeerConnection){var e=i.RTCPeerConnection.prototype.addTransceiver;e&&(i.RTCPeerConnection.prototype.addTransceiver=function(){this.setParametersPromises=[];var t=arguments[1]&&arguments[1].sendEncodings;t===void 0&&(t=[]);var n=(t=Pi(t)).length>0;n&&t.forEach(function(o){if("rid"in o&&!/^[a-z0-9]{0,16}$/i.test(o.rid))throw new TypeError("Invalid RID value provided.");if("scaleResolutionDownBy"in o&&parseFloat(o.scaleResolutionDownBy)<1)throw new RangeError("scale_resolution_down_by must be >= 1.0");if("maxFramerate"in o&&parseFloat(o.maxFramerate)<0)throw new RangeError("max_framerate must be >= 0.0")});var r=e.apply(this,arguments);if(n){var s=r.sender,a=s.getParameters();(!("encodings"in a)||a.encodings.length===1&&Object.keys(a.encodings[0]).length===0)&&(a.encodings=t,s.sendEncodings=t,this.setParametersPromises.push(s.setParameters(a).then(function(){delete s.sendEncodings}).catch(function(){delete s.sendEncodings})))}return r})}}function hT(i){if(et(i)==="object"&&i.RTCRtpSender){var e=i.RTCRtpSender.prototype.getParameters;e&&(i.RTCRtpSender.prototype.getParameters=function(){var t=e.apply(this,arguments);return"encodings"in t||(t.encodings=[].concat(this.sendEncodings||[{}])),t})}}function fT(i){if(et(i)==="object"&&i.RTCPeerConnection){var e=i.RTCPeerConnection.prototype.createOffer;i.RTCPeerConnection.prototype.createOffer=function(){var t=arguments,n=this;return this.setParametersPromises&&this.setParametersPromises.length?Promise.all(this.setParametersPromises).then(function(){return e.apply(n,t)}).finally(function(){n.setParametersPromises=[]}):e.apply(this,arguments)}}}function pT(i){if(et(i)==="object"&&i.RTCPeerConnection){var e=i.RTCPeerConnection.prototype.createAnswer;i.RTCPeerConnection.prototype.createAnswer=function(){var t=arguments,n=this;return this.setParametersPromises&&this.setParametersPromises.length?Promise.all(this.setParametersPromises).then(function(){return e.apply(n,t)}).finally(function(){n.setParametersPromises=[]}):e.apply(this,arguments)}}}var mT=Object.freeze({__proto__:null,shimAddTransceiver:dT,shimCreateAnswer:pT,shimCreateOffer:fT,shimGetDisplayMedia:function(i,e){i.navigator.mediaDevices&&"getDisplayMedia"in i.navigator.mediaDevices||i.navigator.mediaDevices&&(i.navigator.mediaDevices.getDisplayMedia=function(t){if(!t||!t.video){var n=new DOMException("getDisplayMedia without video constraints is undefined");return n.name="NotFoundError",n.code=8,Promise.reject(n)}return t.video===!0?t.video={mediaSource:e}:t.video.mediaSource=e,i.navigator.mediaDevices.getUserMedia(t)})},shimGetParameters:hT,shimGetUserMedia:sT,shimOnTrack:aT,shimPeerConnection:xm,shimRTCDataChannel:uT,shimReceiverGetStats:lT,shimRemoveStream:cT,shimSenderGetStats:oT});function gT(i){if(et(i)==="object"&&i.RTCPeerConnection){if("getLocalStreams"in i.RTCPeerConnection.prototype||(i.RTCPeerConnection.prototype.getLocalStreams=function(){return this._localStreams||(this._localStreams=[]),this._localStreams}),!("addStream"in i.RTCPeerConnection.prototype)){var e=i.RTCPeerConnection.prototype.addTrack;i.RTCPeerConnection.prototype.addStream=function(t){var n=this;this._localStreams||(this._localStreams=[]),this._localStreams.includes(t)||this._localStreams.push(t),t.getAudioTracks().forEach(function(r){return e.call(n,r,t)}),t.getVideoTracks().forEach(function(r){return e.call(n,r,t)})},i.RTCPeerConnection.prototype.addTrack=function(t){for(var n=this,r=arguments.length,s=new Array(r>1?r-1:0),a=1;r>a;a++)s[a-1]=arguments[a];return s&&s.forEach(function(o){n._localStreams?n._localStreams.includes(o)||n._localStreams.push(o):n._localStreams=[o]}),e.apply(this,arguments)}}"removeStream"in i.RTCPeerConnection.prototype||(i.RTCPeerConnection.prototype.removeStream=function(t){var n=this;this._localStreams||(this._localStreams=[]);var r=this._localStreams.indexOf(t);if(r!==-1){this._localStreams.splice(r,1);var s=t.getTracks();this.getSenders().forEach(function(a){s.includes(a.track)&&n.removeTrack(a)})}})}}function vT(i){if(et(i)==="object"&&i.RTCPeerConnection&&("getRemoteStreams"in i.RTCPeerConnection.prototype||(i.RTCPeerConnection.prototype.getRemoteStreams=function(){return this._remoteStreams?this._remoteStreams:[]}),!("onaddstream"in i.RTCPeerConnection.prototype))){Object.defineProperty(i.RTCPeerConnection.prototype,"onaddstream",{get:function(){return this._onaddstream},set:function(t){var n=this;this._onaddstream&&(this.removeEventListener("addstream",this._onaddstream),this.removeEventListener("track",this._onaddstreampoly)),this.addEventListener("addstream",this._onaddstream=t),this.addEventListener("track",this._onaddstreampoly=function(r){r.streams.forEach(function(s){if(n._remoteStreams||(n._remoteStreams=[]),!n._remoteStreams.includes(s)){n._remoteStreams.push(s);var a=new Event("addstream");a.stream=s,n.dispatchEvent(a)}})})}});var e=i.RTCPeerConnection.prototype.setRemoteDescription;i.RTCPeerConnection.prototype.setRemoteDescription=function(){var t=this;return this._onaddstreampoly||this.addEventListener("track",this._onaddstreampoly=function(n){n.streams.forEach(function(r){if(t._remoteStreams||(t._remoteStreams=[]),0>t._remoteStreams.indexOf(r)){t._remoteStreams.push(r);var s=new Event("addstream");s.stream=r,t.dispatchEvent(s)}})}),e.apply(t,arguments)}}}function yT(i){if(et(i)==="object"&&i.RTCPeerConnection){var e=i.RTCPeerConnection.prototype,t=e.createOffer,n=e.createAnswer,r=e.setLocalDescription,s=e.setRemoteDescription,a=e.addIceCandidate;e.createOffer=function(c,u){var d=2>arguments.length?arguments[0]:arguments[2],h=t.apply(this,[d]);return u?(h.then(c,u),Promise.resolve()):h},e.createAnswer=function(c,u){var d=2>arguments.length?arguments[0]:arguments[2],h=n.apply(this,[d]);return u?(h.then(c,u),Promise.resolve()):h};var o=function(c,u,d){var h=r.apply(this,[c]);return d?(h.then(u,d),Promise.resolve()):h};e.setLocalDescription=o,o=function(c,u,d){var h=s.apply(this,[c]);return d?(h.then(u,d),Promise.resolve()):h},e.setRemoteDescription=o,o=function(c,u,d){var h=a.apply(this,[c]);return d?(h.then(u,d),Promise.resolve()):h},e.addIceCandidate=o}}function bT(i){var e=i&&i.navigator;if(e.mediaDevices&&e.mediaDevices.getUserMedia){var t=e.mediaDevices,n=t.getUserMedia.bind(t);e.mediaDevices.getUserMedia=function(r){return n(_T(r))}}!e.getUserMedia&&e.mediaDevices&&e.mediaDevices.getUserMedia&&(e.getUserMedia=(function(r,s,a){e.mediaDevices.getUserMedia(r).then(s,a)}).bind(e))}function _T(i){return i&&i.video!==void 0?Object.assign({},i,{video:Wk(i.video)}):i}function kT(i){if(i.RTCPeerConnection){var e=i.RTCPeerConnection;i.RTCPeerConnection=function(t,n){if(t&&t.iceServers){for(var r=[],s=0;s<t.iceServers.length;s++){var a=t.iceServers[s];a.urls===void 0&&a.url?((a=JSON.parse(JSON.stringify(a))).urls=a.url,delete a.url,r.push(a)):r.push(t.iceServers[s])}t.iceServers=r}return new e(t,n)},i.RTCPeerConnection.prototype=e.prototype,"generateCertificate"in e&&Object.defineProperty(i.RTCPeerConnection,"generateCertificate",{get:function(){return e.generateCertificate}})}}function TT(i){et(i)==="object"&&i.RTCTrackEvent&&"receiver"in i.RTCTrackEvent.prototype&&!("transceiver"in i.RTCTrackEvent.prototype)&&Object.defineProperty(i.RTCTrackEvent.prototype,"transceiver",{get:function(){return{receiver:this.receiver}}})}function ST(i){var e=i.RTCPeerConnection.prototype.createOffer;i.RTCPeerConnection.prototype.createOffer=function(t){if(t){t.offerToReceiveAudio!==void 0&&(t.offerToReceiveAudio=!!t.offerToReceiveAudio);var n=this.getTransceivers().find(function(s){return s.receiver.track.kind==="audio"});t.offerToReceiveAudio===!1&&n?n.direction==="sendrecv"?n.setDirection?n.setDirection("sendonly"):n.direction="sendonly":n.direction==="recvonly"&&(n.setDirection?n.setDirection("inactive"):n.direction="inactive"):t.offerToReceiveAudio!==!0||n||this.addTransceiver("audio",{direction:"recvonly"}),t.offerToReceiveVideo!==void 0&&(t.offerToReceiveVideo=!!t.offerToReceiveVideo);var r=this.getTransceivers().find(function(s){return s.receiver.track.kind==="video"});t.offerToReceiveVideo===!1&&r?r.direction==="sendrecv"?r.setDirection?r.setDirection("sendonly"):r.direction="sendonly":r.direction==="recvonly"&&(r.setDirection?r.setDirection("inactive"):r.direction="inactive"):t.offerToReceiveVideo!==!0||r||this.addTransceiver("video",{direction:"recvonly"})}return e.apply(this,arguments)}}function CT(i){et(i)!=="object"||i.AudioContext||(i.AudioContext=i.webkitAudioContext)}var xT,ET=Object.freeze({__proto__:null,shimAudioContext:CT,shimCallbacksAPI:yT,shimConstraints:_T,shimCreateOfferLegacy:ST,shimGetUserMedia:bT,shimLocalStreamsAPI:gT,shimRTCIceServerUrls:kT,shimRemoteStreamsAPI:vT,shimTrackEventTransceiver:TT}),wT={exports:{}},DT=(xT||(xT=1,function(i){var e={generateIdentifier:function(){return Math.random().toString(36).substring(2,12)}};e.localCName=e.generateIdentifier(),e.splitLines=function(t){return t.trim().split(`
289
+ `).map(function(n){return n.trim()})},e.splitSections=function(t){return t.split(`
290
+ m=`).map(function(n,r){return(r>0?"m="+n:n).trim()+`\r
291
+ `})},e.getDescription=function(t){var n=e.splitSections(t);return n&&n[0]},e.getMediaSections=function(t){var n=e.splitSections(t);return n.shift(),n},e.matchPrefix=function(t,n){return e.splitLines(t).filter(function(r){return r.indexOf(n)===0})},e.parseCandidate=function(t){for(var n,r={foundation:(n=t.indexOf("a=candidate:")===0?t.substring(12).split(" "):t.substring(10).split(" "))[0],component:{1:"rtp",2:"rtcp"}[n[1]]||n[1],protocol:n[2].toLowerCase(),priority:parseInt(n[3],10),ip:n[4],address:n[4],port:parseInt(n[5],10),type:n[7]},s=8;s<n.length;s+=2)switch(n[s]){case"raddr":r.relatedAddress=n[s+1];break;case"rport":r.relatedPort=parseInt(n[s+1],10);break;case"tcptype":r.tcpType=n[s+1];break;case"ufrag":r.ufrag=n[s+1],r.usernameFragment=n[s+1];break;default:r[n[s]]===void 0&&(r[n[s]]=n[s+1]);break}return r},e.writeCandidate=function(t){var n=[];n.push(t.foundation);var r=t.component;r==="rtp"?n.push(1):r==="rtcp"?n.push(2):n.push(r),n.push(t.protocol.toUpperCase()),n.push(t.priority),n.push(t.address||t.ip),n.push(t.port);var s=t.type;return n.push("typ"),n.push(s),s!=="host"&&t.relatedAddress&&t.relatedPort&&(n.push("raddr"),n.push(t.relatedAddress),n.push("rport"),n.push(t.relatedPort)),t.tcpType&&t.protocol.toLowerCase()==="tcp"&&(n.push("tcptype"),n.push(t.tcpType)),(t.usernameFragment||t.ufrag)&&(n.push("ufrag"),n.push(t.usernameFragment||t.ufrag)),"candidate:"+n.join(" ")},e.parseIceOptions=function(t){return t.substring(14).split(" ")},e.parseRtpMap=function(t){var n=t.substring(9).split(" "),r={payloadType:parseInt(n.shift(),10)};return n=n[0].split("/"),r.name=n[0],r.clockRate=parseInt(n[1],10),r.channels=n.length===3?parseInt(n[2],10):1,r.numChannels=r.channels,r},e.writeRtpMap=function(t){var n=t.payloadType;t.preferredPayloadType!==void 0&&(n=t.preferredPayloadType);var r=t.channels||t.numChannels||1;return"a=rtpmap:"+n+" "+t.name+"/"+t.clockRate+(r!==1?"/"+r:"")+`\r
292
+ `},e.parseExtmap=function(t){var n=t.substring(9).split(" ");return{id:parseInt(n[0],10),direction:n[0].indexOf("/")>0?n[0].split("/")[1]:"sendrecv",uri:n[1],attributes:n.slice(2).join(" ")}},e.writeExtmap=function(t){return"a=extmap:"+(t.id||t.preferredId)+(t.direction&&t.direction!=="sendrecv"?"/"+t.direction:"")+" "+t.uri+(t.attributes?" "+t.attributes:"")+`\r
293
+ `},e.parseFmtp=function(t){for(var n,r={},s=t.substring(t.indexOf(" ")+1).split(";"),a=0;a<s.length;a++)r[(n=s[a].trim().split("="))[0].trim()]=n[1];return r},e.writeFmtp=function(t){var n="",r=t.payloadType;if(t.preferredPayloadType!==void 0&&(r=t.preferredPayloadType),t.parameters&&Object.keys(t.parameters).length){var s=[];Object.keys(t.parameters).forEach(function(a){t.parameters[a]!==void 0?s.push(a+"="+t.parameters[a]):s.push(a)}),n+="a=fmtp:"+r+" "+s.join(";")+`\r
294
+ `}return n},e.parseRtcpFb=function(t){var n=t.substring(t.indexOf(" ")+1).split(" ");return{type:n.shift(),parameter:n.join(" ")}},e.writeRtcpFb=function(t){var n="",r=t.payloadType;return t.preferredPayloadType!==void 0&&(r=t.preferredPayloadType),t.rtcpFeedback&&t.rtcpFeedback.length&&t.rtcpFeedback.forEach(function(s){n+="a=rtcp-fb:"+r+" "+s.type+(s.parameter&&s.parameter.length?" "+s.parameter:"")+`\r
295
+ `}),n},e.parseSsrcMedia=function(t){var n=t.indexOf(" "),r={ssrc:parseInt(t.substring(7,n),10)},s=t.indexOf(":",n);return s>-1?(r.attribute=t.substring(n+1,s),r.value=t.substring(s+1)):r.attribute=t.substring(n+1),r},e.parseSsrcGroup=function(t){var n=t.substring(13).split(" ");return{semantics:n.shift(),ssrcs:n.map(function(r){return parseInt(r,10)})}},e.getMid=function(t){var n=e.matchPrefix(t,"a=mid:")[0];if(n)return n.substring(6)},e.parseFingerprint=function(t){var n=t.substring(14).split(" ");return{algorithm:n[0].toLowerCase(),value:n[1].toUpperCase()}},e.getDtlsParameters=function(t,n){return{role:"auto",fingerprints:e.matchPrefix(t+n,"a=fingerprint:").map(e.parseFingerprint)}},e.writeDtlsParameters=function(t,n){var r="a=setup:"+n+`\r
296
+ `;return t.fingerprints.forEach(function(s){r+="a=fingerprint:"+s.algorithm+" "+s.value+`\r
297
+ `}),r},e.parseCryptoLine=function(t){var n=t.substring(9).split(" ");return{tag:parseInt(n[0],10),cryptoSuite:n[1],keyParams:n[2],sessionParams:n.slice(3)}},e.writeCryptoLine=function(t){return"a=crypto:"+t.tag+" "+t.cryptoSuite+" "+(et(t.keyParams)==="object"?e.writeCryptoKeyParams(t.keyParams):t.keyParams)+(t.sessionParams?" "+t.sessionParams.join(" "):"")+`\r
298
+ `},e.parseCryptoKeyParams=function(t){if(t.indexOf("inline:")!==0)return null;var n=t.substring(7).split("|");return{keyMethod:"inline",keySalt:n[0],lifeTime:n[1],mkiValue:n[2]?n[2].split(":")[0]:void 0,mkiLength:n[2]?n[2].split(":")[1]:void 0}},e.writeCryptoKeyParams=function(t){return t.keyMethod+":"+t.keySalt+(t.lifeTime?"|"+t.lifeTime:"")+(t.mkiValue&&t.mkiLength?"|"+t.mkiValue+":"+t.mkiLength:"")},e.getCryptoParameters=function(t,n){return e.matchPrefix(t+n,"a=crypto:").map(e.parseCryptoLine)},e.getIceParameters=function(t,n){var r=e.matchPrefix(t+n,"a=ice-ufrag:")[0],s=e.matchPrefix(t+n,"a=ice-pwd:")[0];return r&&s?{usernameFragment:r.substring(12),password:s.substring(10)}:null},e.writeIceParameters=function(t){var n="a=ice-ufrag:"+t.usernameFragment+`\r
299
+ a=ice-pwd:`+t.password+`\r
300
+ `;return t.iceLite&&(n+=`a=ice-lite\r
301
+ `),n},e.parseRtpParameters=function(t){var n={codecs:[],headerExtensions:[],fecMechanisms:[],rtcp:[]},r=e.splitLines(t)[0].split(" ");n.profile=r[2];for(var s=3;s<r.length;s++){var a=r[s],o=e.matchPrefix(t,"a=rtpmap:"+a+" ")[0];if(o){var c=e.parseRtpMap(o),u=e.matchPrefix(t,"a=fmtp:"+a+" ");switch(c.parameters=u.length?e.parseFmtp(u[0]):{},c.rtcpFeedback=e.matchPrefix(t,"a=rtcp-fb:"+a+" ").map(e.parseRtcpFb),n.codecs.push(c),c.name.toUpperCase()){case"RED":case"ULPFEC":n.fecMechanisms.push(c.name.toUpperCase());break}}}e.matchPrefix(t,"a=extmap:").forEach(function(h){n.headerExtensions.push(e.parseExtmap(h))});var d=e.matchPrefix(t,"a=rtcp-fb:* ").map(e.parseRtcpFb);return n.codecs.forEach(function(h){d.forEach(function(b){h.rtcpFeedback.find(function(v){return v.type===b.type&&v.parameter===b.parameter})||h.rtcpFeedback.push(b)})}),n},e.writeRtpDescription=function(t,n){var r="";r+="m="+t+" ",r+=n.codecs.length>0?"9":"0",r+=" "+(n.profile||"UDP/TLS/RTP/SAVPF")+" ",r+=n.codecs.map(function(a){return a.preferredPayloadType!==void 0?a.preferredPayloadType:a.payloadType}).join(" ")+`\r
302
+ `,r+=`c=IN IP4 0.0.0.0\r
303
+ `,r+=`a=rtcp:9 IN IP4 0.0.0.0\r
304
+ `,n.codecs.forEach(function(a){r+=e.writeRtpMap(a),r+=e.writeFmtp(a),r+=e.writeRtcpFb(a)});var s=0;return n.codecs.forEach(function(a){a.maxptime>s&&(s=a.maxptime)}),s>0&&(r+="a=maxptime:"+s+`\r
305
+ `),n.headerExtensions&&n.headerExtensions.forEach(function(a){r+=e.writeExtmap(a)}),r},e.parseRtpEncodingParameters=function(t){var n,r=[],s=e.parseRtpParameters(t),a=s.fecMechanisms.indexOf("RED")!==-1,o=s.fecMechanisms.indexOf("ULPFEC")!==-1,c=e.matchPrefix(t,"a=ssrc:").map(function(b){return e.parseSsrcMedia(b)}).filter(function(b){return b.attribute==="cname"}),u=c.length>0&&c[0].ssrc,d=e.matchPrefix(t,"a=ssrc-group:FID").map(function(b){return b.substring(17).split(" ").map(function(v){return parseInt(v,10)})});d.length>0&&d[0].length>1&&d[0][0]===u&&(n=d[0][1]),s.codecs.forEach(function(b){if(b.name.toUpperCase()==="RTX"&&b.parameters.apt){var v={ssrc:u,codecPayloadType:parseInt(b.parameters.apt,10)};u&&n&&(v.rtx={ssrc:n}),r.push(v),a&&((v=JSON.parse(JSON.stringify(v))).fec={ssrc:u,mechanism:o?"red+ulpfec":"red"},r.push(v))}}),r.length===0&&u&&r.push({ssrc:u});var h=e.matchPrefix(t,"b=");return h.length&&(h=h[0].indexOf("b=TIAS:")===0?parseInt(h[0].substring(7),10):h[0].indexOf("b=AS:")===0?1e3*parseInt(h[0].substring(5),10)*.95-16e3:void 0,r.forEach(function(b){b.maxBitrate=h})),r},e.parseRtcpParameters=function(t){var n={},r=e.matchPrefix(t,"a=ssrc:").map(function(o){return e.parseSsrcMedia(o)}).filter(function(o){return o.attribute==="cname"})[0];r&&(n.cname=r.value,n.ssrc=r.ssrc);var s=e.matchPrefix(t,"a=rtcp-rsize");n.reducedSize=s.length>0,n.compound=s.length===0;var a=e.matchPrefix(t,"a=rtcp-mux");return n.mux=a.length>0,n},e.writeRtcpParameters=function(t){var n="";return t.reducedSize&&(n+=`a=rtcp-rsize\r
306
+ `),t.mux&&(n+=`a=rtcp-mux\r
307
+ `),t.ssrc!==void 0&&t.cname&&(n+="a=ssrc:"+t.ssrc+" cname:"+t.cname+`\r
308
+ `),n},e.parseMsid=function(t){var n,r=e.matchPrefix(t,"a=msid:");if(r.length===1)return{stream:(n=r[0].substring(7).split(" "))[0],track:n[1]};var s=e.matchPrefix(t,"a=ssrc:").map(function(a){return e.parseSsrcMedia(a)}).filter(function(a){return a.attribute==="msid"});return s.length>0?{stream:(n=s[0].value.split(" "))[0],track:n[1]}:void 0},e.parseSctpDescription=function(t){var n,r=e.parseMLine(t),s=e.matchPrefix(t,"a=max-message-size:");s.length>0&&(n=parseInt(s[0].substring(19),10)),isNaN(n)&&(n=65536);var a=e.matchPrefix(t,"a=sctp-port:");if(a.length>0)return{port:parseInt(a[0].substring(12),10),protocol:r.fmt,maxMessageSize:n};var o=e.matchPrefix(t,"a=sctpmap:");if(o.length>0){var c=o[0].substring(10).split(" ");return{port:parseInt(c[0],10),protocol:c[1],maxMessageSize:n}}},e.writeSctpDescription=function(t,n){var r=[];return r=t.protocol!=="DTLS/SCTP"?["m="+t.kind+" 9 "+t.protocol+" "+n.protocol+`\r
309
+ `,`c=IN IP4 0.0.0.0\r
310
+ `,"a=sctp-port:"+n.port+`\r
311
+ `]:["m="+t.kind+" 9 "+t.protocol+" "+n.port+`\r
312
+ `,`c=IN IP4 0.0.0.0\r
313
+ `,"a=sctpmap:"+n.port+" "+n.protocol+` 65535\r
314
+ `],n.maxMessageSize!==void 0&&r.push("a=max-message-size:"+n.maxMessageSize+`\r
315
+ `),r.join("")},e.generateSessionId=function(){return Math.random().toString().substr(2,22)},e.writeSessionBoilerplate=function(t,n,r){var s=n!==void 0?n:2;return`v=0\r
316
+ o=`+(r||"thisisadapterortc")+" "+(t||e.generateSessionId())+" "+s+` IN IP4 127.0.0.1\r
317
+ s=-\r
318
+ t=0 0\r
319
+ `},e.getDirection=function(t,n){for(var r=e.splitLines(t),s=0;s<r.length;s++)switch(r[s]){case"a=sendrecv":case"a=sendonly":case"a=recvonly":case"a=inactive":return r[s].substring(2)}return n?e.getDirection(n):"sendrecv"},e.getKind=function(t){return e.splitLines(t)[0].split(" ")[0].substring(2)},e.isRejected=function(t){return t.split(" ",2)[1]==="0"},e.parseMLine=function(t){var n=e.splitLines(t)[0].substring(2).split(" ");return{kind:n[0],port:parseInt(n[1],10),protocol:n[2],fmt:n.slice(3).join(" ")}},e.parseOLine=function(t){var n=e.matchPrefix(t,"o=")[0].substring(2).split(" ");return{username:n[0],sessionId:n[1],sessionVersion:parseInt(n[2],10),netType:n[3],addressType:n[4],address:n[5]}},e.isValidSDP=function(t){if(typeof t!="string"||t.length===0)return!1;for(var n=e.splitLines(t),r=0;r<n.length;r++)if(2>n[r].length||n[r].charAt(1)!=="=")return!1;return!0},i.exports=e}(wT)),wT.exports),mo=v9(DT),C9=nM({__proto__:null,default:mo},[DT]);function md(i){if(!(!i.RTCIceCandidate||i.RTCIceCandidate&&"foundation"in i.RTCIceCandidate.prototype)){var e=i.RTCIceCandidate;i.RTCIceCandidate=function(t){if(et(t)==="object"&&t.candidate&&t.candidate.indexOf("a=")===0&&((t=JSON.parse(JSON.stringify(t))).candidate=t.candidate.substring(2)),t.candidate&&t.candidate.length){var n=new e(t),r=mo.parseCandidate(t.candidate);for(var s in r)s in n||Object.defineProperty(n,s,{value:r[s]});return n.toJSON=function(){return{candidate:n.candidate,sdpMid:n.sdpMid,sdpMLineIndex:n.sdpMLineIndex,usernameFragment:n.usernameFragment}},n}return new e(t)},i.RTCIceCandidate.prototype=e.prototype,Qs(i,"icecandidate",function(t){return t.candidate&&Object.defineProperty(t,"candidate",{value:new i.RTCIceCandidate(t.candidate),writable:"false"}),t})}}function Em(i){!i.RTCIceCandidate||i.RTCIceCandidate&&"relayProtocol"in i.RTCIceCandidate.prototype||Qs(i,"icecandidate",function(e){if(e.candidate){var t=mo.parseCandidate(e.candidate.candidate);t.type==="relay"&&(e.candidate.relayProtocol={0:"tls",1:"tcp",2:"udp"}[t.priority>>24])}return e})}function gd(i,e){if(i.RTCPeerConnection){"sctp"in i.RTCPeerConnection.prototype||Object.defineProperty(i.RTCPeerConnection.prototype,"sctp",{get:function(){return this._sctp===void 0?null:this._sctp}});var t=i.RTCPeerConnection.prototype.setRemoteDescription;i.RTCPeerConnection.prototype.setRemoteDescription=function(){var n,r;if(this._sctp=null,e.browser!=="chrome"||e.version<76||this.getConfiguration().sdpSemantics==="plan-b"&&Object.defineProperty(this,"sctp",{get:function(){return this._sctp===void 0?null:this._sctp},enumerable:!0,configurable:!0}),function(d){if(!d||!d.sdp)return!1;var h=mo.splitSections(d.sdp);return h.shift(),h.some(function(b){var v=mo.parseMLine(b);return v&&v.kind==="application"&&v.protocol.indexOf("SCTP")!==-1})}(arguments[0])){var s,a=function(d){var h=d.sdp.match(/mozilla...THIS_IS_SDPARTA-(\d+)/);if(h===null||2>h.length)return-1;var b=parseInt(h[1],10);return b!=b?-1:b}(arguments[0]),o=(n=a,r=65536,e.browser==="firefox"&&(r=57>e.version?n===-1?16384:2147483637:60>e.version?e.version===57?65535:65536:2147483637),r),c=function(d,h){var b=65536;e.browser==="firefox"&&e.version===57&&(b=65535);var v=mo.matchPrefix(d.sdp,"a=max-message-size:");return v.length>0?b=parseInt(v[0].substring(19),10):e.browser==="firefox"&&h!==-1&&(b=2147483637),b}(arguments[0],a);s=o===0&&c===0?Number.POSITIVE_INFINITY:o===0||c===0?Math.max(o,c):Math.min(o,c);var u={};Object.defineProperty(u,"maxMessageSize",{get:function(){return s}}),this._sctp=u}return t.apply(this,arguments)}}}function vd(i){if(i.RTCPeerConnection&&"createDataChannel"in i.RTCPeerConnection.prototype){var e=i.RTCPeerConnection.prototype.createDataChannel;i.RTCPeerConnection.prototype.createDataChannel=function(){var n=e.apply(this,arguments);return t(n,this),n},Qs(i,"datachannel",function(n){return t(n.channel,n.target),n})}function t(n,r){var s=n.send;n.send=function(){var a=arguments[0],o=a.length||a.size||a.byteLength;if(n.readyState==="open"&&r.sctp&&o>r.sctp.maxMessageSize)throw new TypeError("Message too large (can send a maximum of "+r.sctp.maxMessageSize+" bytes)");return s.apply(n,arguments)}}}function wm(i){if(i.RTCPeerConnection&&!("connectionState"in i.RTCPeerConnection.prototype)){var e=i.RTCPeerConnection.prototype;Object.defineProperty(e,"connectionState",{get:function(){return{completed:"connected",checking:"connecting"}[this.iceConnectionState]||this.iceConnectionState},enumerable:!0,configurable:!0}),Object.defineProperty(e,"onconnectionstatechange",{get:function(){return this._onconnectionstatechange||null},set:function(t){this._onconnectionstatechange&&(this.removeEventListener("connectionstatechange",this._onconnectionstatechange),delete this._onconnectionstatechange),t&&this.addEventListener("connectionstatechange",this._onconnectionstatechange=t)},enumerable:!0,configurable:!0}),["setLocalDescription","setRemoteDescription"].forEach(function(t){var n=e[t];e[t]=function(){return this._connectionstatechangepoly||(this._connectionstatechangepoly=function(r){var s=r.target;if(s._lastConnectionState!==s.connectionState){s._lastConnectionState=s.connectionState;var a=new Event("connectionstatechange",r);s.dispatchEvent(a)}return r},this.addEventListener("iceconnectionstatechange",this._connectionstatechangepoly)),n.apply(this,arguments)}})}}function Dm(i,e){if(i.RTCPeerConnection&&(e.browser!=="chrome"||71>e.version)&&(e.browser!=="safari"||605>e.version)){var t=i.RTCPeerConnection.prototype.setRemoteDescription;i.RTCPeerConnection.prototype.setRemoteDescription=function(n){if(n&&n.sdp&&n.sdp.indexOf(`
320
+ a=extmap-allow-mixed`)!==-1){var r=n.sdp.split(`
321
+ `).filter(function(s){return s.trim()!=="a=extmap-allow-mixed"}).join(`
322
+ `);i.RTCSessionDescription&&n instanceof i.RTCSessionDescription?arguments[0]=new i.RTCSessionDescription({type:n.type,sdp:r}):n.sdp=r}return t.apply(this,arguments)}}}function yd(i,e){if(i.RTCPeerConnection&&i.RTCPeerConnection.prototype){var t=i.RTCPeerConnection.prototype.addIceCandidate;t&&t.length!==0&&(i.RTCPeerConnection.prototype.addIceCandidate=function(){return arguments[0]?(e.browser==="chrome"&&78>e.version||e.browser==="firefox"&&68>e.version||e.browser==="safari")&&arguments[0]&&arguments[0].candidate===""?Promise.resolve():t.apply(this,arguments):(arguments[1]&&arguments[1].apply(null),Promise.resolve())})}}function bd(i,e){if(i.RTCPeerConnection&&i.RTCPeerConnection.prototype){var t=i.RTCPeerConnection.prototype.setLocalDescription;t&&t.length!==0&&(i.RTCPeerConnection.prototype.setLocalDescription=function(){var n=this,r=arguments[0]||{};if(et(r)!=="object"||r.type&&r.sdp)return t.apply(this,arguments);if(!(r={type:r.type,sdp:r.sdp}).type)switch(this.signalingState){case"stable":case"have-local-offer":case"have-remote-pranswer":r.type="offer";break;default:r.type="answer";break}return r.sdp||r.type!=="offer"&&r.type!=="answer"?t.apply(this,[r]):(r.type==="offer"?this.createOffer:this.createAnswer).apply(this).then(function(s){return t.apply(n,[s])})})}}var x9=Object.freeze({__proto__:null,removeExtmapAllowMixed:Dm,shimAddIceCandidateNullOrEmpty:yd,shimConnectionState:wm,shimMaxMessageSize:gd,shimParameterlessSetLocalDescription:bd,shimRTCIceCandidate:md,shimRTCIceCandidateRelayProtocol:Em,shimSendThrowTypeError:vd});(function(){var i=(arguments.length>0&&arguments[0]!==void 0?arguments[0]:{}).window,e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{shimChrome:!0,shimFirefox:!0,shimSafari:!0},t=zk,n=function(s){var a={browser:null,version:null};if(s===void 0||!s.navigator||!s.navigator.userAgent)return a.browser="Not a browser.",a;var o=s.navigator;if(o.userAgentData&&o.userAgentData.brands){var c=o.userAgentData.brands.find(function(u){return u.brand==="Chromium"});if(c)return{browser:"chrome",version:parseInt(c.version,10)}}if(o.mozGetUserMedia)a.browser="firefox",a.version=pd(o.userAgent,/Firefox\/(\d+)\./,1);else if(o.webkitGetUserMedia||s.isSecureContext===!1&&s.webkitRTCPeerConnection)a.browser="chrome",a.version=pd(o.userAgent,/Chrom(e|ium)\/(\d+)\./,2);else{if(!s.RTCPeerConnection||!o.userAgent.match(/AppleWebKit\/(\d+)\./))return a.browser="Not a supported browser.",a;a.browser="safari",a.version=pd(o.userAgent,/AppleWebKit\/(\d+)\./,1),a.supportsUnifiedPlan=s.RTCRtpTransceiver&&"currentDirection"in s.RTCRtpTransceiver.prototype}return a}(i),r={browserDetails:n,commonShim:x9,extractVersion:pd,disableLog:T9,disableWarnings:S9,sdp:C9};switch(n.browser){case"chrome":if(!rT||!Cm||!e.shimChrome||n.version===null)return t(),r;t(),r.browserShim=rT,yd(i,n),bd(i),Yk(i,n),Jk(i),Cm(i,n),Qk(i),nT(i,n),Zk(i),eT(i),iT(i,n),md(i),Em(i),wm(i),gd(i,n),vd(i),Dm(i,n);break;case"firefox":if(!mT||!xm||!e.shimFirefox)return t(),r;t(),r.browserShim=mT,yd(i,n),bd(i),sT(i,n),xm(i,n),aT(i),cT(i),oT(i),lT(i),uT(i),dT(i),hT(i),fT(i),pT(i),md(i),wm(i),gd(i,n),vd(i);break;case"safari":if(!ET||!e.shimSafari)return t(),r;t(),r.browserShim=ET,yd(i,n),bd(i),kT(i),ST(i),yT(i),gT(i),vT(i),TT(i),bT(i),CT(i),md(i),Em(i),gd(i,n),vd(i),Dm(i,n);break;default:t();break}})({window:typeof window>"u"?void 0:window});var Ul,AT,ms,IT,_d="lk_e2ee";function E9(){return window.RTCRtpSender!==void 0&&window.RTCRtpSender.prototype.createEncodedStreams!==void 0||Am()}function Am(){return window.RTCRtpScriptTransform!==void 0}(function(i){i.SetKey="setKey",i.RatchetRequest="ratchetRequest",i.KeyRatcheted="keyRatcheted"})(Ul||(Ul={})),function(i){i.KeyRatcheted="keyRatcheted"}(AT||(AT={})),function(i){i.ParticipantEncryptionStatusChanged="participantEncryptionStatusChanged",i.EncryptionError="encryptionError"}(ms||(ms={})),function(i){i.Error="cryptorError"}(IT||(IT={}));var jn,Zs=function(i){function e(t,n){var r;return ht(this,e),(r=Ut(this,e,[n||"an error has occured"])).code=t,r}return Ft(e,Ju(Error)),ft(e)}();(function(i){i[i.NotAllowed=0]="NotAllowed",i[i.ServerUnreachable=1]="ServerUnreachable",i[i.InternalError=2]="InternalError",i[i.Cancelled=3]="Cancelled",i[i.LeaveRequest=4]="LeaveRequest"})(jn||(jn={}));var kd,PT,je,Xe,Ze,qe,Wt=function(i){function e(t,n,r){var s;return ht(this,e),(s=Ut(this,e,[1,t])).status=r,s.reason=n,s}return Ft(e,Zs),ft(e)}(),Im=function(i){function e(t){return ht(this,e),Ut(this,e,[21,t??"device is unsupported"])}return Ft(e,Zs),ft(e)}(),vr=function(i){function e(t){return ht(this,e),Ut(this,e,[20,t??"track is invalid"])}return Ft(e,Zs),ft(e)}(),w9=function(i){function e(t){return ht(this,e),Ut(this,e,[10,t??"unsupported server"])}return Ft(e,Zs),ft(e)}(),bn=function(i){function e(t){return ht(this,e),Ut(this,e,[12,t??"unexpected connection state"])}return Ft(e,Zs),ft(e)}(),Pm=function(i){function e(t){return ht(this,e),Ut(this,e,[13,t??"unable to negotiate"])}return Ft(e,Zs),ft(e)}(),NT=function(i){function e(t,n){var r;return ht(this,e),(r=Ut(this,e,[15,t])).reason=n,r}return Ft(e,Zs),ft(e)}();function Nm(i,e,t){var n,r,s;e===void 0&&(e=50),t===void 0&&(t={});var a=(n=t.isImmediate)!=null&&n,o=(r=t.callback)!=null&&r,c=t.maxWait,u=Date.now(),d=[];function h(){if(c!==void 0){var v=Date.now()-u;if(v+e>=c)return c-v}return e}var b=function(){var v=[].slice.call(arguments),y=this;return new Promise(function(p,f){var m=a&&s===void 0;if(s!==void 0&&clearTimeout(s),s=setTimeout(function(){if(s=void 0,u=Date.now(),!a){var k=i.apply(y,v);o&&o(k),d.forEach(function(D){return(0,D.resolve)(k)}),d=[]}},h()),m){var _=i.apply(y,v);return o&&o(_),p(_)}d.push({resolve:p,reject:f})})};return b.cancel=function(v){s!==void 0&&clearTimeout(s),d.forEach(function(y){return(0,y.reject)(v)}),d=[]},b}(function(i){i.PermissionDenied="PermissionDenied",i.NotFound="NotFound",i.DeviceInUse="DeviceInUse",i.Other="Other"})(kd||(kd={})),function(i){i.getFailure=function(e){if(e&&"name"in e)return e.name==="NotFoundError"||e.name==="DevicesNotFoundError"?i.NotFound:e.name==="NotAllowedError"||e.name==="PermissionDeniedError"?i.PermissionDenied:e.name==="NotReadableError"||e.name==="TrackStartError"?i.DeviceInUse:i.Other}}(kd||(kd={})),function(i){i[i.InvalidKey=0]="InvalidKey",i[i.MissingKey=1]="MissingKey",i[i.InternalError=2]="InternalError"}(PT||(PT={})),function(i){i.Connected="connected",i.Reconnecting="reconnecting",i.SignalReconnecting="signalReconnecting",i.Reconnected="reconnected",i.Disconnected="disconnected",i.ConnectionStateChanged="connectionStateChanged",i.MediaDevicesChanged="mediaDevicesChanged",i.ParticipantConnected="participantConnected",i.ParticipantDisconnected="participantDisconnected",i.TrackPublished="trackPublished",i.TrackSubscribed="trackSubscribed",i.TrackSubscriptionFailed="trackSubscriptionFailed",i.TrackUnpublished="trackUnpublished",i.TrackUnsubscribed="trackUnsubscribed",i.TrackMuted="trackMuted",i.TrackUnmuted="trackUnmuted",i.LocalTrackPublished="localTrackPublished",i.LocalTrackUnpublished="localTrackUnpublished",i.LocalAudioSilenceDetected="localAudioSilenceDetected",i.ActiveSpeakersChanged="activeSpeakersChanged",i.ParticipantMetadataChanged="participantMetadataChanged",i.ParticipantNameChanged="participantNameChanged",i.ParticipantAttributesChanged="participantAttributesChanged",i.RoomMetadataChanged="roomMetadataChanged",i.DataReceived="dataReceived",i.SipDTMFReceived="sipDTMFReceived",i.TranscriptionReceived="transcriptionReceived",i.ConnectionQualityChanged="connectionQualityChanged",i.TrackStreamStateChanged="trackStreamStateChanged",i.TrackSubscriptionPermissionChanged="trackSubscriptionPermissionChanged",i.TrackSubscriptionStatusChanged="trackSubscriptionStatusChanged",i.AudioPlaybackStatusChanged="audioPlaybackChanged",i.VideoPlaybackStatusChanged="videoPlaybackChanged",i.MediaDevicesError="mediaDevicesError",i.ParticipantPermissionsChanged="participantPermissionsChanged",i.SignalConnected="signalConnected",i.RecordingStatusChanged="recordingStatusChanged",i.ParticipantEncryptionStatusChanged="participantEncryptionStatusChanged",i.EncryptionError="encryptionError",i.DCBufferStatusChanged="dcBufferStatusChanged",i.ActiveDeviceChanged="activeDeviceChanged",i.ChatMessage="chatMessage",i.LocalTrackSubscribed="localTrackSubscribed",i.MetricsReceived="metricsReceived"}(je||(je={})),function(i){i.TrackPublished="trackPublished",i.TrackSubscribed="trackSubscribed",i.TrackSubscriptionFailed="trackSubscriptionFailed",i.TrackUnpublished="trackUnpublished",i.TrackUnsubscribed="trackUnsubscribed",i.TrackMuted="trackMuted",i.TrackUnmuted="trackUnmuted",i.LocalTrackPublished="localTrackPublished",i.LocalTrackUnpublished="localTrackUnpublished",i.ParticipantMetadataChanged="participantMetadataChanged",i.ParticipantNameChanged="participantNameChanged",i.DataReceived="dataReceived",i.SipDTMFReceived="sipDTMFReceived",i.TranscriptionReceived="transcriptionReceived",i.IsSpeakingChanged="isSpeakingChanged",i.ConnectionQualityChanged="connectionQualityChanged",i.TrackStreamStateChanged="trackStreamStateChanged",i.TrackSubscriptionPermissionChanged="trackSubscriptionPermissionChanged",i.TrackSubscriptionStatusChanged="trackSubscriptionStatusChanged",i.MediaDevicesError="mediaDevicesError",i.AudioStreamAcquired="audioStreamAcquired",i.ParticipantPermissionsChanged="participantPermissionsChanged",i.PCTrackAdded="pcTrackAdded",i.AttributesChanged="attributesChanged",i.LocalTrackSubscribed="localTrackSubscribed",i.ChatMessage="chatMessage"}(Xe||(Xe={})),function(i){i.TransportsCreated="transportsCreated",i.Connected="connected",i.Disconnected="disconnected",i.Resuming="resuming",i.Resumed="resumed",i.Restarting="restarting",i.Restarted="restarted",i.SignalResumed="signalResumed",i.SignalRestarted="signalRestarted",i.Closing="closing",i.MediaTrackAdded="mediaTrackAdded",i.ActiveSpeakersUpdate="activeSpeakersUpdate",i.DataPacketReceived="dataPacketReceived",i.RTPVideoMapUpdate="rtpVideoMapUpdate",i.DCBufferStatusChanged="dcBufferStatusChanged",i.ParticipantUpdate="participantUpdate",i.RoomUpdate="roomUpdate",i.SpeakersChanged="speakersChanged",i.StreamStateChanged="streamStateChanged",i.ConnectionQualityUpdate="connectionQualityUpdate",i.SubscriptionError="subscriptionError",i.SubscriptionPermissionUpdate="subscriptionPermissionUpdate",i.RemoteMute="remoteMute",i.SubscribedQualityUpdate="subscribedQualityUpdate",i.LocalTrackUnpublished="localTrackUnpublished",i.LocalTrackSubscribed="localTrackSubscribed",i.Offline="offline",i.SignalRequestResponse="signalRequestResponse"}(Ze||(Ze={})),function(i){i.Message="message",i.Muted="muted",i.Unmuted="unmuted",i.Restarted="restarted",i.Ended="ended",i.Subscribed="subscribed",i.Unsubscribed="unsubscribed",i.UpdateSettings="updateSettings",i.UpdateSubscription="updateSubscription",i.AudioPlaybackStarted="audioPlaybackStarted",i.AudioPlaybackFailed="audioPlaybackFailed",i.AudioSilenceDetected="audioSilenceDetected",i.VisibilityChanged="visibilityChanged",i.VideoDimensionsChanged="videoDimensionsChanged",i.VideoPlaybackStarted="videoPlaybackStarted",i.VideoPlaybackFailed="videoPlaybackFailed",i.ElementAttached="elementAttached",i.ElementDetached="elementDetached",i.UpstreamPaused="upstreamPaused",i.UpstreamResumed="upstreamResumed",i.SubscriptionPermissionChanged="subscriptionPermissionChanged",i.SubscriptionStatusChanged="subscriptionStatusChanged",i.SubscriptionFailed="subscriptionFailed",i.TrackProcessorUpdate="trackProcessorUpdate",i.AudioTrackFeatureUpdate="audioTrackFeatureUpdate",i.TranscriptionReceived="transcriptionReceived",i.TimeSyncUpdate="timeSyncUpdate"}(qe||(qe={}));var Om,D9=/version\/(\d+(\.?_?\d+)+)/i;function Br(i){var e=1>=arguments.length||arguments[1]===void 0||arguments[1];if(typeof navigator<"u"){var t=navigator.userAgent.toLowerCase();if(Om===void 0||e){var n=A9.find(function(r){return r.test.test(t)});Om=n==null?void 0:n.describe(t)}return Om}}var A9=[{test:/firefox|iceweasel|fxios/i,describe:function(i){return{name:"Firefox",version:Td(/(?:firefox|iceweasel|fxios)[\s/](\d+(\.?_?\d+)+)/i,i),os:i.toLowerCase().includes("fxios")?"iOS":void 0,osVersion:Mm(i)}}},{test:/chrom|crios|crmo/i,describe:function(i){return{name:"Chrome",version:Td(/(?:chrome|chromium|crios|crmo)\/(\d+(\.?_?\d+)+)/i,i),os:i.toLowerCase().includes("crios")?"iOS":void 0,osVersion:Mm(i)}}},{test:/safari|applewebkit/i,describe:function(i){return{name:"Safari",version:Td(D9,i),os:i.includes("mobile/")?"iOS":"macOS",osVersion:Mm(i)}}}];function Td(i,e){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,n=e.match(i);return n&&n.length>=t&&n[t]||""}function Mm(i){return i.includes("mac os")?Td(/\(.+?(\d+_\d+(:?_\d+)?)/,i,1).replace(/_/g,"."):void 0}var In=ft(function i(){ht(this,i)});In.setTimeout=function(){return setTimeout.apply(void 0,arguments)},In.setInterval=function(){return setInterval.apply(void 0,arguments)},In.clearTimeout=function(){return clearTimeout.apply(void 0,arguments)},In.clearInterval=function(){return clearInterval.apply(void 0,arguments)};var Rm,Vt=function(){function i(e,t,n,r,s){if(ht(this,i),et(e)==="object")this.width=e.width,this.height=e.height,this.aspectRatio=e.aspectRatio,this.encoding={maxBitrate:e.maxBitrate,maxFramerate:e.maxFramerate,priority:e.priority};else{if(t===void 0||n===void 0)throw new TypeError("Unsupported options: provide at least width, height and maxBitrate");this.width=e,this.height=t,this.aspectRatio=e/t,this.encoding={maxBitrate:n,maxFramerate:r,priority:s}}}return ft(i,[{key:"resolution",get:function(){return{width:this.width,height:this.height,frameRate:this.encoding.maxFramerate,aspectRatio:this.aspectRatio}}}]),i}(),I9=["vp8","h264"],OT=["vp8","h264","vp9","av1"];function P9(i){return!!I9.find(function(e){return e===i})}(function(i){i.telephone={maxBitrate:12e3},i.speech={maxBitrate:2e4},i.music={maxBitrate:32e3},i.musicStereo={maxBitrate:48e3},i.musicHighQuality={maxBitrate:64e3},i.musicHighQualityStereo={maxBitrate:96e3}})(Rm||(Rm={}));var Fl={h90:new Vt(160,90,9e4,20),h180:new Vt(320,180,16e4,20),h216:new Vt(384,216,18e4,20),h360:new Vt(640,360,45e4,20),h540:new Vt(960,540,8e5,25),h720:new Vt(1280,720,17e5,30),h1080:new Vt(1920,1080,3e6,30),h1440:new Vt(2560,1440,5e6,30),h2160:new Vt(3840,2160,8e6,30)},Lm={h120:new Vt(160,120,7e4,20),h180:new Vt(240,180,125e3,20),h240:new Vt(320,240,14e4,20),h360:new Vt(480,360,33e4,20),h480:new Vt(640,480,5e5,20),h540:new Vt(720,540,6e5,25),h720:new Vt(960,720,13e5,30),h1080:new Vt(1440,1080,23e5,30),h1440:new Vt(1920,1440,38e5,30)},Bm={h360fps3:new Vt(640,360,2e5,3,"medium"),h360fps15:new Vt(640,360,4e5,15,"medium"),h720fps5:new Vt(1280,720,8e5,5,"medium"),h720fps15:new Vt(1280,720,15e5,15,"medium"),h720fps30:new Vt(1280,720,2e6,30,"medium"),h1080fps15:new Vt(1920,1080,25e5,15,"medium"),h1080fps30:new Vt(1920,1080,5e6,30,"medium"),original:new Vt(0,0,7e6,30,"medium")},Oi,Vl=[];(function(i){i[i.LOW=0]="LOW",i[i.MEDIUM=1]="MEDIUM",i[i.HIGH=2]="HIGH"})(Oi||(Oi={}));var Me=function(i){function e(t,n){var r;ht(this,e);var s,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return(r=Ut(this,e)).attachedElements=[],r.isMuted=!1,r.streamState=e.StreamState.Active,r.isInBackground=!1,r._currentBitrate=0,r.log=xt,r.appVisibilityChangedListener=function(){r.backgroundTimeout&&clearTimeout(r.backgroundTimeout),document.visibilityState==="hidden"?r.backgroundTimeout=setTimeout(function(){return r.handleAppVisibilityChanged()},5e3):r.handleAppVisibilityChanged()},r.log=Lr((s=a.loggerName)!==null&&s!==void 0?s:Yi.Track),r.loggerContextCb=a.loggerContextCb,r.setMaxListeners(100),r.kind=n,r._mediaStreamTrack=t,r._mediaStreamID=t.id,r.source=e.Source.Unknown,r}return Ft(e,Js.EventEmitter),ft(e,[{key:"logContext",get:function(){var t;return Object.assign(Object.assign({},(t=this.loggerContextCb)===null||t===void 0?void 0:t.call(this)),Ht(this))}},{key:"currentBitrate",get:function(){return this._currentBitrate}},{key:"mediaStreamTrack",get:function(){return this._mediaStreamTrack}},{key:"mediaStreamID",get:function(){return this._mediaStreamID}},{key:"attach",value:function(t){var n=this,r="audio";this.kind===e.Kind.Video&&(r="video"),this.attachedElements.length===0&&this.kind===e.Kind.Video&&this.addAppVisibilityListener(),t||(r==="audio"&&(Vl.forEach(function(o){o.parentElement!==null||t||(t=o)}),t&&Vl.splice(Vl.indexOf(t),1)),t||(t=document.createElement(r))),this.attachedElements.includes(t)||this.attachedElements.push(t),go(this.mediaStreamTrack,t);var s=t.srcObject.getTracks(),a=s.some(function(o){return o.kind==="audio"});return t.play().then(function(){n.emit(a?qe.AudioPlaybackStarted:qe.VideoPlaybackStarted)}).catch(function(o){o.name==="NotAllowedError"?n.emit(a?qe.AudioPlaybackFailed:qe.VideoPlaybackFailed,o):o.name==="AbortError"?xt.debug("".concat(a?"audio":"video"," playback aborted, likely due to new play request")):xt.warn("could not playback ".concat(a?"audio":"video"),o),a&&t&&s.some(function(c){return c.kind==="video"})&&o.name==="NotAllowedError"&&(t.muted=!0,t.play().catch(function(){}))}),this.emit(qe.ElementAttached,t),t}},{key:"detach",value:function(t){var n=this;try{if(t){vo(this.mediaStreamTrack,t);var r=this.attachedElements.indexOf(t);return 0>r||(this.attachedElements.splice(r,1),this.recycleElement(t),this.emit(qe.ElementDetached,t)),t}var s=[];return this.attachedElements.forEach(function(a){vo(n.mediaStreamTrack,a),s.push(a),n.recycleElement(a),n.emit(qe.ElementDetached,a)}),this.attachedElements=[],s}finally{this.attachedElements.length===0&&this.removeAppVisibilityListener()}}},{key:"stop",value:function(){this.stopMonitor(),this._mediaStreamTrack.stop()}},{key:"enable",value:function(){this._mediaStreamTrack.enabled=!0}},{key:"disable",value:function(){this._mediaStreamTrack.enabled=!1}},{key:"stopMonitor",value:function(){this.monitorInterval&&clearInterval(this.monitorInterval),this.timeSyncHandle&&cancelAnimationFrame(this.timeSyncHandle)}},{key:"updateLoggerOptions",value:function(t){t.loggerName&&(this.log=Lr(t.loggerName)),t.loggerContextCb&&(this.loggerContextCb=t.loggerContextCb)}},{key:"recycleElement",value:function(t){if(t instanceof HTMLAudioElement){var n=!0;t.pause(),Vl.forEach(function(r){r.parentElement||(n=!1)}),n&&Vl.push(t)}}},{key:"handleAppVisibilityChanged",value:function(){return he(this,void 0,void 0,F().mark(function t(){var n=this;return F().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:this.isInBackground=document.visibilityState==="hidden",this.isInBackground||this.kind!==e.Kind.Video||setTimeout(function(){return n.attachedElements.forEach(function(s){return s.play().catch(function(){})})},0);case 2:case"end":return r.stop()}},t,this)}))}},{key:"addAppVisibilityListener",value:function(){vi()?(this.isInBackground=document.visibilityState==="hidden",document.addEventListener("visibilitychange",this.appVisibilityChangedListener)):this.isInBackground=!1}},{key:"removeAppVisibilityListener",value:function(){vi()&&document.removeEventListener("visibilitychange",this.appVisibilityChangedListener)}}]),e}();function go(i,e){var t,n;t=e.srcObject instanceof MediaStream?e.srcObject:new MediaStream,(n=i.kind==="audio"?t.getAudioTracks():t.getVideoTracks()).includes(i)||(n.forEach(function(r){t.removeTrack(r)}),t.addTrack(i)),ea()&&e instanceof HTMLVideoElement||(e.autoplay=!0),e.muted=t.getAudioTracks().length===0,e instanceof HTMLVideoElement&&(e.playsInline=!0),e.srcObject!==t&&(e.srcObject=t,(ea()||yo())&&e instanceof HTMLVideoElement&&setTimeout(function(){e.srcObject=t,e.play().catch(function(){})},0))}function vo(i,e){if(e.srcObject instanceof MediaStream){var t=e.srcObject;t.removeTrack(i),t.getTracks().length>0?e.srcObject=t:e.srcObject=null}}function MT(i,e,t){var n,r=(n=function(s){if(s!==void 0)return typeof structuredClone=="function"?structuredClone(s):JSON.parse(JSON.stringify(s))}(i))!==null&&n!==void 0?n:{};return r.audio===!0&&(r.audio={}),r.video===!0&&(r.video={}),r.audio&&Um(r.audio,e),r.video&&Um(r.video,t),r}function Um(i,e){return Object.keys(e).forEach(function(t){i[t]===void 0&&(i[t]=e[t])}),i}function Sd(i){var e={};if(i.video)if(et(i.video)==="object"){var t={},n=t,r=i.video;Object.keys(r).forEach(function(s){switch(s){case"resolution":Um(n,r.resolution);break;default:n[s]=r[s]}}),e.video=t}else e.video=i.video;else e.video=!1;return i.audio?et(i.audio)==="object"?e.audio=i.audio:e.audio=!0:e.audio=!1,e}function N9(i){return he(this,arguments,void 0,function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:200;return F().mark(function n(){var r,s,a,o,c;return F().wrap(function(u){for(;;)switch(u.prev=u.next){case 0:if(!(r=RT())){u.next=14;break}return(s=r.createAnalyser()).fftSize=2048,a=s.frequencyBinCount,o=new Uint8Array(a),r.createMediaStreamSource(new MediaStream([e.mediaStreamTrack])).connect(s),u.next=10,yr(t);case 10:return s.getByteTimeDomainData(o),c=o.some(function(d){return d!==128&&d!==0}),r.close(),u.abrupt("return",!c);case 14:return u.abrupt("return",!1);case 15:case"end":return u.stop()}},n)})()})}function RT(){var i=typeof window<"u"&&(window.AudioContext||window.webkitAudioContext);if(i)return new i({latencyHint:"interactive"})}function LT(i){return i===Me.Source.Microphone?"audioinput":i===Me.Source.Camera?"videoinput":void 0}function O9(i){var e,t,n=(e=i.video)===null||e===void 0||e;return i.resolution&&i.resolution.width>0&&i.resolution.height>0&&(n=typeof n=="boolean"?{}:n,n=ea()?Object.assign(Object.assign({},n),{width:{max:i.resolution.width},height:{max:i.resolution.height},frameRate:i.resolution.frameRate}):Object.assign(Object.assign({},n),{width:{ideal:i.resolution.width},height:{ideal:i.resolution.height},frameRate:i.resolution.frameRate})),{audio:(t=i.audio)!==null&&t!==void 0&&t,video:n,controller:i.controller,selfBrowserSurface:i.selfBrowserSurface,surfaceSwitching:i.surfaceSwitching,systemAudio:i.systemAudio,preferCurrentTab:i.preferCurrentTab}}function Cd(i){var e=i.split("/")[1].toLowerCase();if(!OT.includes(e))throw Error("Video codec not supported: ".concat(e));return e}function Ht(i){return i instanceof Me?{trackID:i.sid,source:i.source,muted:i.isMuted,enabled:i.mediaStreamTrack.enabled,kind:i.kind,streamID:i.mediaStreamID,streamTrackID:i.mediaStreamTrack.id}:{trackID:i.trackSid,enabled:i.isEnabled,muted:i.isMuted,trackInfo:Object.assign({mimeType:i.mimeType,name:i.trackName,encrypted:i.isEncrypted,kind:i.kind,source:i.source},i.track?Ht(i.track):{})}}(function(i){var e,t,n;(function(r){r.Audio="audio",r.Video="video",r.Unknown="unknown"})(e=i.Kind||(i.Kind={})),function(r){r.Camera="camera",r.Microphone="microphone",r.ScreenShare="screen_share",r.ScreenShareAudio="screen_share_audio",r.Unknown="unknown"}(t=i.Source||(i.Source={})),function(r){r.Active="active",r.Paused="paused",r.Unknown="unknown"}(n=i.StreamState||(i.StreamState={})),i.kindToProto=function(r){switch(r){case e.Audio:return Ki.AUDIO;case e.Video:return Ki.VIDEO;default:return Ki.DATA}},i.kindFromProto=function(r){switch(r){case Ki.AUDIO:return e.Audio;case Ki.VIDEO:return e.Video;default:return e.Unknown}},i.sourceToProto=function(r){switch(r){case t.Camera:return Vn.CAMERA;case t.Microphone:return Vn.MICROPHONE;case t.ScreenShare:return Vn.SCREEN_SHARE;case t.ScreenShareAudio:return Vn.SCREEN_SHARE_AUDIO;default:return Vn.UNKNOWN}},i.sourceFromProto=function(r){switch(r){case Vn.CAMERA:return t.Camera;case Vn.MICROPHONE:return t.Microphone;case Vn.SCREEN_SHARE:return t.ScreenShare;case Vn.SCREEN_SHARE_AUDIO:return t.ScreenShareAudio;default:return t.Unknown}},i.streamStateFromProto=function(r){switch(r){case fm.ACTIVE:return n.Active;case fm.PAUSED:return n.Paused;default:return n.Unknown}}})(Me||(Me={}));var BT="https://aomediacodec.github.io/av1-rtp-spec/#dependency-descriptor-rtp-header-extension";function yr(i){return he(this,void 0,void 0,F().mark(function e(){return F().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",new Promise(function(n){return In.setTimeout(n,i)}));case 1:case"end":return t.stop()}},e)}))}function Fm(){return"addTransceiver"in RTCPeerConnection.prototype}function Vm(){return"addTrack"in RTCPeerConnection.prototype}function M9(){if(!("getCapabilities"in RTCRtpSender)||ea())return!1;var i=RTCRtpSender.getCapabilities("video"),e=!1;if(i){var t,n=dt(i.codecs);try{for(n.s();!(t=n.n()).done;)if(t.value.mimeType==="video/AV1"){e=!0;break}}catch(r){n.e(r)}finally{n.f()}}return e}function R9(){if(!("getCapabilities"in RTCRtpSender)||yo())return!1;if(ea()){var i=Br();if(i!=null&&i.version&&0>$l(i.version,"16"))return!1}var e=RTCRtpSender.getCapabilities("video"),t=!1;if(e){var n,r=dt(e.codecs);try{for(r.s();!(n=r.n()).done;)if(n.value.mimeType==="video/VP9"){t=!0;break}}catch(s){r.e(s)}finally{r.f()}}return t}function jl(i){return i==="av1"||i==="vp9"}function jm(i){return!!document&&(i||(i=document.createElement("audio")),"setSinkId"in i)}function yo(){var i;return((i=Br())===null||i===void 0?void 0:i.name)==="Firefox"}function ea(){var i;return((i=Br())===null||i===void 0?void 0:i.name)==="Safari"}function UT(){var i,e;return!!vi()&&((e=(i=navigator.userAgentData)===null||i===void 0?void 0:i.mobile)!==null&&e!==void 0?e:/Tablet|iPad|Mobile|Android|BlackBerry/.test(navigator.userAgent))}function L9(){var i=Br(),e="17.2";if(i)return i.name!=="Safari"&&i.os!=="iOS"||!(i.os!=="iOS"||!i.osVersion||0>$l(e,i.osVersion))||i.name==="Safari"&&$l(e,i.version)>=0}function vi(){return typeof document<"u"}function Ur(){return navigator.product=="ReactNative"}function $m(i){return i.hostname.endsWith(".livekit.cloud")||i.hostname.endsWith(".livekit.run")}function FT(){if(global&&global.LiveKitReactNativeGlobal)return global.LiveKitReactNativeGlobal}function VT(){if(Ur()){var i=FT();return i?i.platform:void 0}}function jT(){if(vi())return window.devicePixelRatio;if(Ur()){var i=FT();if(i)return i.devicePixelRatio}return 1}function $l(i,e){for(var t=i.split("."),n=e.split("."),r=Math.min(t.length,n.length),s=0;r>s;++s){var a=parseInt(t[s],10),o=parseInt(n[s],10);if(a>o)return 1;if(o>a)return-1;if(s===r-1&&a===o)return 0}return i===""&&e!==""?-1:e===""?1:t.length==n.length?0:t.length<n.length?-1:1}function B9(i){var e,t=dt(i);try{for(t.s();!(e=t.n()).done;){var n=e.value;n.target.handleResize(n)}}catch(r){t.e(r)}finally{t.f()}}function U9(i){var e,t=dt(i);try{for(t.s();!(e=t.n()).done;){var n=e.value;n.target.handleVisibilityChanged(n)}}catch(r){t.e(r)}finally{t.f()}}var xd,Hm=null,$T=function(){return Hm||(Hm=new ResizeObserver(B9)),Hm},qm=null,HT=function(){return qm||(qm=new IntersectionObserver(U9,{root:null,rootMargin:"0px"})),qm};function qT(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:16,e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:16,t=arguments.length>2&&arguments[2]!==void 0&&arguments[2],n=arguments.length>3&&arguments[3]!==void 0&&arguments[3],r=document.createElement("canvas");r.width=i,r.height=e;var s=r.getContext("2d");s==null||s.fillRect(0,0,r.width,r.height),n&&s&&(s.beginPath(),s.arc(i/2,e/2,50,0,2*Math.PI,!0),s.closePath(),s.fillStyle="grey",s.fill());var a=Pt(r.captureStream().getTracks(),1)[0];if(!a)throw Error("Could not get empty media stream video track");return a.enabled=t,a}function zm(){if(!xd){var i=new AudioContext,e=i.createOscillator(),t=i.createGain();t.gain.setValueAtTime(0,0);var n=i.createMediaStreamDestination();e.connect(t),t.connect(n),e.start();var r=Pt(n.stream.getAudioTracks(),1);if(!(xd=r[0]))throw Error("Could not get empty media stream audio track");xd.enabled=!1}return xd.clone()}var zT=ft(function i(e,t){var n=this;ht(this,i),this.onFinally=t,this.promise=new Promise(function(r,s){return he(n,void 0,void 0,F().mark(function a(){return F().wrap(function(o){for(;;)switch(o.prev=o.next){case 0:if(this.resolve=r,this.reject=s,!e){o.next=5;break}return o.next=5,e(r,s);case 5:case"end":return o.stop()}},a,this)}))}).finally(function(){var r;return(r=n.onFinally)===null||r===void 0?void 0:r.call(n)})}),yi=function(){function i(){ht(this,i),this._locking=Promise.resolve(),this._locks=0}return ft(i,[{key:"isLocked",value:function(){return this._locks>0}},{key:"lock",value:function(){var e,t=this;this._locks+=1;var n=new Promise(function(s){return e=function(){t._locks-=1,s()}}),r=this._locking.then(function(){return e});return this._locking=this._locking.then(function(){return n}),r}}]),i}();function Fr(i){if(typeof i=="string"||typeof i=="number")return i;if(Array.isArray(i))return i[0];if(i.exact)return Array.isArray(i.exact)?i.exact[0]:i.exact;if(i.ideal)return Array.isArray(i.ideal)?i.ideal[0]:i.ideal;throw Error("could not unwrap constraint")}function GT(i){return i.startsWith("ws")?i.replace(/^(ws)/,"http"):i}var Gm="default",br=function(){function i(){ht(this,i)}return ft(i,[{key:"getDevices",value:function(e){return he(this,arguments,void 0,function(t){var n=this,r=1>=arguments.length||arguments[1]===void 0||arguments[1];return F().mark(function s(){var a,o,c,u;return F().wrap(function(d){for(;;)switch(d.prev=d.next){case 0:if(((a=i.userMediaPromiseMap)===null||a===void 0?void 0:a.size)<=0){d.next=15;break}if(xt.debug("awaiting getUserMedia promise"),d.prev=2,!t){d.next=8;break}return d.next=6,i.userMediaPromiseMap.get(t);case 6:d.next=10;break;case 8:return d.next=10,Promise.all(i.userMediaPromiseMap.values());case 10:d.next=15;break;case 12:d.prev=12,d.t0=d.catch(2),xt.warn("error waiting for media permissons");case 15:return d.next=17,navigator.mediaDevices.enumerateDevices();case 17:if(o=d.sent,!r||ea()&&n.hasDeviceInUse(t)){d.next=29;break}if(!(o.filter(function(h){return h.kind===t}).length===0||o.some(function(h){var b=h.label==="",v=!t||h.kind===t;return b&&v}))){d.next=29;break}return c={video:t!=="audioinput"&&t!=="audiooutput",audio:t!=="videoinput"},d.next=24,navigator.mediaDevices.getUserMedia(c);case 24:return u=d.sent,d.next=27,navigator.mediaDevices.enumerateDevices();case 27:o=d.sent,u.getTracks().forEach(function(h){h.stop()});case 29:return t&&(o=o.filter(function(h){return h.kind===t})),d.abrupt("return",o);case 31:case"end":return d.stop()}},s,null,[[2,12]])})()})}},{key:"normalizeDeviceId",value:function(e,t,n){return he(this,void 0,void 0,F().mark(function r(){var s,a,o;return F().wrap(function(c){for(;;)switch(c.prev=c.next){case 0:if(t===Gm){c.next=2;break}return c.abrupt("return",t);case 2:return c.next=4,this.getDevices(e);case 4:if(s=c.sent,a=s.find(function(u){return u.deviceId===Gm})){c.next=9;break}return xt.warn("could not reliably determine default device"),c.abrupt("return",void 0);case 9:if(o=s.find(function(u){return u.deviceId!==Gm&&u.groupId===(n??a.groupId)})){c.next=13;break}return xt.warn("could not reliably determine default device"),c.abrupt("return",void 0);case 13:return c.abrupt("return",o==null?void 0:o.deviceId);case 14:case"end":return c.stop()}},r,this)}))}},{key:"hasDeviceInUse",value:function(e){return e?i.userMediaPromiseMap.has(e):i.userMediaPromiseMap.size>0}}],[{key:"getInstance",value:function(){return this.instance===void 0&&(this.instance=new i),this.instance}}]),i}();br.mediaDeviceKinds=["audioinput","audiooutput","videoinput"],br.userMediaPromiseMap=new Map;var Hl,bo=function(i){function e(t,n,r){var s;ht(this,e);var a=arguments.length>3&&arguments[3]!==void 0&&arguments[3];return(s=Ut(this,e,[t,n,arguments.length>4?arguments[4]:void 0])).manuallyStopped=!1,s._isUpstreamPaused=!1,s.handleTrackMuteEvent=function(){return s.debouncedTrackMuteHandler().catch(function(){return s.log.debug("track mute bounce got cancelled by an unmute event",s.logContext)})},s.debouncedTrackMuteHandler=Nm(function(){return he(ct(s),void 0,void 0,F().mark(function o(){return F().wrap(function(c){for(;;)switch(c.prev=c.next){case 0:return c.next=2,this.pauseUpstream();case 2:case"end":return c.stop()}},o,this)}))},5e3),s.handleTrackUnmuteEvent=function(){return he(ct(s),void 0,void 0,F().mark(function o(){return F().wrap(function(c){for(;;)switch(c.prev=c.next){case 0:return this.debouncedTrackMuteHandler.cancel("unmute"),c.next=3,this.resumeUpstream();case 3:case"end":return c.stop()}},o,this)}))},s.handleEnded=function(){s.isInBackground&&(s.reacquireTrack=!0),s._mediaStreamTrack.removeEventListener("mute",s.handleTrackMuteEvent),s._mediaStreamTrack.removeEventListener("unmute",s.handleTrackUnmuteEvent),s.emit(qe.Ended,ct(s))},s.reacquireTrack=!1,s.providedByUser=a,s.muteLock=new yi,s.pauseUpstreamLock=new yi,s.processorLock=new yi,s.restartLock=new yi,s.setMediaStreamTrack(t,!0),s._constraints=t.getConstraints(),r&&(s._constraints=r),s}return Ft(e,Me),ft(e,[{key:"sender",get:function(){return this._sender},set:function(t){this._sender=t}},{key:"constraints",get:function(){return this._constraints}},{key:"id",get:function(){return this._mediaStreamTrack.id}},{key:"dimensions",get:function(){if(this.kind===Me.Kind.Video){var t=this._mediaStreamTrack.getSettings(),n=t.width,r=t.height;return n&&r?{width:n,height:r}:void 0}}},{key:"isUpstreamPaused",get:function(){return this._isUpstreamPaused}},{key:"isUserProvided",get:function(){return this.providedByUser}},{key:"mediaStreamTrack",get:function(){var t,n;return(n=(t=this.processor)===null||t===void 0?void 0:t.processedTrack)!==null&&n!==void 0?n:this._mediaStreamTrack}},{key:"setMediaStreamTrack",value:function(t,n){return he(this,void 0,void 0,F().mark(function r(){var s,a,o=this;return F().wrap(function(c){for(;;)switch(c.prev=c.next){case 0:if(t!==this._mediaStreamTrack||n){c.next=2;break}return c.abrupt("return");case 2:if(this._mediaStreamTrack&&(this.attachedElements.forEach(function(u){vo(o._mediaStreamTrack,u)}),this.debouncedTrackMuteHandler.cancel("new-track"),this._mediaStreamTrack.removeEventListener("ended",this.handleEnded),this._mediaStreamTrack.removeEventListener("mute",this.handleTrackMuteEvent),this._mediaStreamTrack.removeEventListener("unmute",this.handleTrackUnmuteEvent)),this.mediaStream=new MediaStream([t]),t&&(t.addEventListener("ended",this.handleEnded),t.addEventListener("mute",this.handleTrackMuteEvent),t.addEventListener("unmute",this.handleTrackUnmuteEvent),this._constraints=t.getConstraints()),!this.processor||!t){c.next=20;break}return c.next=8,this.processorLock.lock();case 8:if(a=c.sent,c.prev=9,this.log.debug("restarting processor",this.logContext),this.kind!=="unknown"){c.next=13;break}throw TypeError("cannot set processor on track of unknown kind");case 13:return this.processorElement&&(go(t,this.processorElement),this.processorElement.muted=!0),c.next=16,this.processor.restart({track:t,kind:this.kind,element:this.processorElement});case 16:s=this.processor.processedTrack;case 17:return c.prev=17,a(),c.finish(17);case 20:if(!this.sender){c.next=23;break}return c.next=23,this.sender.replaceTrack(s??t);case 23:if(this.providedByUser||this._mediaStreamTrack===t||this._mediaStreamTrack.stop(),this._mediaStreamTrack=t,!t){c.next=30;break}return this._mediaStreamTrack.enabled=!this.isMuted,c.next=29,this.resumeUpstream();case 29:this.attachedElements.forEach(function(u){go(s??t,u)});case 30:case"end":return c.stop()}},r,this,[[9,,17,20]])}))}},{key:"waitForDimensions",value:function(){return he(this,arguments,void 0,function(){var t=this,n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:1e3;return F().mark(function r(){var s,a,o;return F().wrap(function(c){for(;;)switch(c.prev=c.next){case 0:if(t.kind!==Me.Kind.Audio){c.next=2;break}throw new Error("cannot get dimensions for audio tracks");case 2:if(((s=Br())===null||s===void 0?void 0:s.os)!=="iOS"){c.next=5;break}return c.next=5,yr(10);case 5:a=Date.now();case 6:if(Date.now()-a>=n){c.next=14;break}if(!(o=t.dimensions)){c.next=10;break}return c.abrupt("return",o);case 10:return c.next=12,yr(50);case 12:c.next=6;break;case 14:throw new vr("unable to get track dimensions after timeout");case 15:case"end":return c.stop()}},r)})()})}},{key:"getDeviceId",value:function(){return he(this,arguments,void 0,function(){var t=this,n=0>=arguments.length||arguments[0]===void 0||arguments[0];return F().mark(function r(){var s,a,o,c;return F().wrap(function(u){for(;;)switch(u.prev=u.next){case 0:if(t.source!==Me.Source.ScreenShare){u.next=2;break}return u.abrupt("return");case 2:return s=t._mediaStreamTrack.getSettings(),a=s.deviceId,o=s.groupId,c=t.kind===Me.Kind.Audio?"audioinput":"videoinput",u.abrupt("return",n?br.getInstance().normalizeDeviceId(c,a,o):a);case 5:case"end":return u.stop()}},r)})()})}},{key:"mute",value:function(){return he(this,void 0,void 0,F().mark(function t(){return F().wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return this.setTrackMuted(!0),n.abrupt("return",this);case 2:case"end":return n.stop()}},t,this)}))}},{key:"unmute",value:function(){return he(this,void 0,void 0,F().mark(function t(){return F().wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return this.setTrackMuted(!1),n.abrupt("return",this);case 2:case"end":return n.stop()}},t,this)}))}},{key:"replaceTrack",value:function(t,n){return he(this,void 0,void 0,F().mark(function r(){var s,a;return F().wrap(function(o){for(;;)switch(o.prev=o.next){case 0:if(this.sender){o.next=2;break}throw new vr("unable to replace an unpublished track");case 2:return typeof n=="boolean"?s=n:n!==void 0&&(s=n.userProvidedTrack,a=n.stopProcessor),this.providedByUser=s==null||s,this.log.debug("replace MediaStreamTrack",this.logContext),o.next=7,this.setMediaStreamTrack(t);case 7:if(!a||!this.processor){o.next=10;break}return o.next=10,this.stopProcessor();case 10:return o.abrupt("return",this);case 11:case"end":return o.stop()}},r,this)}))}},{key:"restart",value:function(t){return he(this,void 0,void 0,F().mark(function n(){var r,s,a,o,c=this;return F().wrap(function(u){for(;;)switch(u.prev=u.next){case 0:return this.manuallyStopped=!1,u.next=3,this.restartLock.lock();case 3:return r=u.sent,u.prev=4,t||(t=this._constraints),this.log.debug("restarting track with constraints",Object.assign(Object.assign({},this.logContext),{constraints:t})),s={audio:!1,video:!1},this.kind===Me.Kind.Video?s.video=t:s.audio=t,this.attachedElements.forEach(function(d){vo(c.mediaStreamTrack,d)}),this._mediaStreamTrack.removeEventListener("ended",this.handleEnded),this._mediaStreamTrack.stop(),u.next=14,navigator.mediaDevices.getUserMedia(s);case 14:return a=u.sent,(o=a.getTracks()[0]).addEventListener("ended",this.handleEnded),this.log.debug("re-acquired MediaStreamTrack",this.logContext),u.next=20,this.setMediaStreamTrack(o);case 20:return this._constraints=t,this.emit(qe.Restarted,this),this.manuallyStopped&&(this.log.warn("track was stopped during a restart, stopping restarted track",this.logContext),this.stop()),u.abrupt("return",this);case 24:return u.prev=24,r(),u.finish(24);case 27:case"end":return u.stop()}},n,this,[[4,,24,27]])}))}},{key:"setTrackMuted",value:function(t){this.log.debug("setting ".concat(this.kind," track ").concat(t?"muted":"unmuted"),this.logContext),this.isMuted===t&&this._mediaStreamTrack.enabled!==t||(this.isMuted=t,this._mediaStreamTrack.enabled=!t,this.emit(t?qe.Muted:qe.Unmuted,this))}},{key:"needsReAcquisition",get:function(){return this._mediaStreamTrack.readyState!=="live"||this._mediaStreamTrack.muted||!this._mediaStreamTrack.enabled||this.reacquireTrack}},{key:"handleAppVisibilityChanged",value:function(){var t=this,n=Object.create(null,{handleAppVisibilityChanged:{get:function(){return pt(lt(e.prototype),"handleAppVisibilityChanged",t)}}});return he(this,void 0,void 0,F().mark(function r(){return F().wrap(function(s){for(;;)switch(s.prev=s.next){case 0:return s.next=2,n.handleAppVisibilityChanged.call(this);case 2:if(UT()){s.next=4;break}return s.abrupt("return");case 4:if(this.log.debug("visibility changed, is in Background: ".concat(this.isInBackground),this.logContext),this.isInBackground||!this.needsReAcquisition||this.isUserProvided||this.isMuted){s.next=10;break}return this.log.debug("track needs to be reacquired, restarting ".concat(this.source),this.logContext),s.next=9,this.restart();case 9:this.reacquireTrack=!1;case 10:case"end":return s.stop()}},r,this)}))}},{key:"stop",value:function(){var t;this.manuallyStopped=!0,pt(lt(e.prototype),"stop",this).call(this),this._mediaStreamTrack.removeEventListener("ended",this.handleEnded),this._mediaStreamTrack.removeEventListener("mute",this.handleTrackMuteEvent),this._mediaStreamTrack.removeEventListener("unmute",this.handleTrackUnmuteEvent),(t=this.processor)===null||t===void 0||t.destroy(),this.processor=void 0}},{key:"pauseUpstream",value:function(){return he(this,void 0,void 0,F().mark(function t(){var n,r;return F().wrap(function(s){for(;;)switch(s.prev=s.next){case 0:return s.next=2,this.pauseUpstreamLock.lock();case 2:if(n=s.sent,s.prev=3,this._isUpstreamPaused!==!0){s.next=6;break}return s.abrupt("return");case 6:if(this.sender){s.next=9;break}return this.log.warn("unable to pause upstream for an unpublished track",this.logContext),s.abrupt("return");case 9:if(this._isUpstreamPaused=!0,this.emit(qe.UpstreamPaused,this),((r=Br())==null?void 0:r.name)!=="Safari"||$l(r.version,"12.0")>=0){s.next=14;break}throw new Im("pauseUpstream is not supported on Safari < 12.");case 14:return s.next=16,this.sender.replaceTrack(null);case 16:return s.prev=16,n(),s.finish(16);case 19:case"end":return s.stop()}},t,this,[[3,,16,19]])}))}},{key:"resumeUpstream",value:function(){return he(this,void 0,void 0,F().mark(function t(){var n;return F().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,this.pauseUpstreamLock.lock();case 2:if(n=r.sent,r.prev=3,this._isUpstreamPaused!==!1){r.next=6;break}return r.abrupt("return");case 6:if(this.sender){r.next=9;break}return this.log.warn("unable to resume upstream for an unpublished track",this.logContext),r.abrupt("return");case 9:return this._isUpstreamPaused=!1,this.emit(qe.UpstreamResumed,this),r.next=13,this.sender.replaceTrack(this.mediaStreamTrack);case 13:return r.prev=13,n(),r.finish(13);case 16:case"end":return r.stop()}},t,this,[[3,,13,16]])}))}},{key:"getRTCStatsReport",value:function(){return he(this,void 0,void 0,F().mark(function t(){var n,r;return F().wrap(function(s){for(;;)switch(s.prev=s.next){case 0:if(!((n=this.sender)===null||n===void 0)&&n.getStats){s.next=2;break}return s.abrupt("return");case 2:return s.next=4,this.sender.getStats();case 4:return r=s.sent,s.abrupt("return",r);case 6:case"end":return s.stop()}},t,this)}))}},{key:"setProcessor",value:function(t){return he(this,arguments,void 0,function(n){var r=this,s=1>=arguments.length||arguments[1]===void 0||arguments[1];return F().mark(function a(){var o,c,u,d,h,b,v;return F().wrap(function(y){for(;;)switch(y.prev=y.next){case 0:return y.next=2,r.processorLock.lock();case 2:return c=y.sent,y.prev=3,r.log.debug("setting up processor",r.logContext),u=document.createElement(r.kind),d={kind:r.kind,track:r._mediaStreamTrack,element:u,audioContext:r.audioContext},y.next=9,n.init(d);case 9:if(r.log.debug("processor initialized",r.logContext),!r.processor){y.next=13;break}return y.next=13,r.stopProcessor();case 13:if(r.kind!=="unknown"){y.next=15;break}throw TypeError("cannot set processor on track of unknown kind");case 15:if(go(r._mediaStreamTrack,u),u.muted=!0,u.play().catch(function(p){return r.log.error("failed to play processor element",Object.assign(Object.assign({},r.logContext),{error:p}))}),r.processor=n,r.processorElement=u,!r.processor.processedTrack){y.next=25;break}h=dt(r.attachedElements);try{for(h.s();!(b=h.n()).done;)(v=b.value)!==r.processorElement&&s&&(vo(r._mediaStreamTrack,v),go(r.processor.processedTrack,v))}catch(p){h.e(p)}finally{h.f()}return y.next=25,(o=r.sender)===null||o===void 0?void 0:o.replaceTrack(r.processor.processedTrack);case 25:r.emit(qe.TrackProcessorUpdate,r.processor);case 26:return y.prev=26,c(),y.finish(26);case 29:case"end":return y.stop()}},a,null,[[3,,26,29]])})()})}},{key:"getProcessor",value:function(){return this.processor}},{key:"stopProcessor",value:function(){return he(this,arguments,void 0,function(){var t=this,n=0>=arguments.length||arguments[0]===void 0||arguments[0];return F().mark(function r(){var s,a;return F().wrap(function(o){for(;;)switch(o.prev=o.next){case 0:if(t.processor){o.next=2;break}return o.abrupt("return");case 2:return t.log.debug("stopping processor",t.logContext),(s=t.processor.processedTrack)===null||s===void 0||s.stop(),o.next=6,t.processor.destroy();case 6:return t.processor=void 0,n||((a=t.processorElement)===null||a===void 0||a.remove(),t.processorElement=void 0),o.next=10,t._mediaStreamTrack.applyConstraints(t._constraints);case 10:return o.next=12,t.setMediaStreamTrack(t._mediaStreamTrack,!0);case 12:t.emit(qe.TrackProcessorUpdate);case 13:case"end":return o.stop()}},r)})()})}}]),e}(),F9=function(i){function e(t){var n;return ht(this,e),(n=Ut(this,e)).onWorkerMessage=function(r){var s,a,o=r.data,c=o.kind,u=o.data;switch(c){case"error":xt.error(u.error.message),n.emit(ms.EncryptionError,u.error);break;case"initAck":u.enabled&&n.keyProvider.getKeys().forEach(function(h){n.postKey(h)});break;case"enable":if(u.enabled&&n.keyProvider.getKeys().forEach(function(h){n.postKey(h)}),n.encryptionEnabled!==u.enabled&&u.participantIdentity===((s=n.room)===null||s===void 0?void 0:s.localParticipant.identity))n.emit(ms.ParticipantEncryptionStatusChanged,u.enabled,n.room.localParticipant),n.encryptionEnabled=u.enabled;else if(u.participantIdentity){var d=(a=n.room)===null||a===void 0?void 0:a.getParticipantByIdentity(u.participantIdentity);if(!d)throw TypeError("couldn't set encryption status, participant not found".concat(u.participantIdentity));n.emit(ms.ParticipantEncryptionStatusChanged,u.enabled,d)}break;case"ratchetKey":n.keyProvider.emit(Ul.KeyRatcheted,u.material,u.keyIndex);break}},n.onWorkerError=function(r){xt.error("e2ee worker encountered an error:",{error:r.error}),n.emit(ms.EncryptionError,r.error)},n.keyProvider=t.keyProvider,n.worker=t.worker,n.encryptionEnabled=!1,n}return Ft(e,Js.EventEmitter),ft(e,[{key:"setup",value:function(t){if(!E9())throw new Im("tried to setup end-to-end encryption on an unsupported browser");if(xt.info("setting up e2ee"),t!==this.room){this.room=t,this.setupEventListeners(t,this.keyProvider);var n={kind:"init",data:{keyProviderOptions:this.keyProvider.getOptions(),loglevel:y9.getLevel()}};this.worker&&(xt.info("initializing worker",{worker:this.worker}),this.worker.onmessage=this.onWorkerMessage,this.worker.onerror=this.onWorkerError,this.worker.postMessage(n))}}},{key:"setParticipantCryptorEnabled",value:function(t,n){xt.debug("set e2ee to ".concat(t," for participant ").concat(n)),this.postEnable(t,n)}},{key:"setSifTrailer",value:function(t){t&&t.length!==0?this.postSifTrailer(t):xt.warn("ignoring server sent trailer as it's empty")}},{key:"setupEngine",value:function(t){var n=this;t.on(Ze.RTPVideoMapUpdate,function(r){n.postRTPMap(r)})}},{key:"setupEventListeners",value:function(t,n){var r=this;t.on(je.TrackPublished,function(s,a){return r.setParticipantCryptorEnabled(s.trackInfo.encryption!==Ni.NONE,a.identity)}),t.on(je.ConnectionStateChanged,function(s){s===jt.Connected&&t.remoteParticipants.forEach(function(a){a.trackPublications.forEach(function(o){r.setParticipantCryptorEnabled(o.trackInfo.encryption!==Ni.NONE,a.identity)})})}).on(je.TrackUnsubscribed,function(s,a,o){var c,u={kind:"removeTransform",data:{participantIdentity:o.identity,trackId:s.mediaStreamID}};(c=r.worker)===null||c===void 0||c.postMessage(u)}).on(je.TrackSubscribed,function(s,a,o){r.setupE2EEReceiver(s,o.identity,a.trackInfo)}).on(je.SignalConnected,function(){if(!r.room)throw new TypeError("expected room to be present on signal connect");n.getKeys().forEach(function(s){r.postKey(s)}),r.setParticipantCryptorEnabled(r.room.localParticipant.isE2EEEnabled,r.room.localParticipant.identity)}),t.localParticipant.on(Xe.LocalTrackPublished,function(s){return he(r,void 0,void 0,F().mark(function a(){return F().wrap(function(o){for(;;)switch(o.prev=o.next){case 0:this.setupE2EESender(s.track,s.track.sender);case 1:case"end":return o.stop()}},a,this)}))}),n.on(Ul.SetKey,function(s){return r.postKey(s)}).on(Ul.RatchetRequest,function(s,a){return r.postRatchetRequest(s,a)})}},{key:"postRatchetRequest",value:function(t,n){if(!this.worker)throw Error("could not ratchet key, worker is missing");var r={kind:"ratchetRequest",data:{participantIdentity:t,keyIndex:n}};this.worker.postMessage(r)}},{key:"postKey",value:function(t){var n,r=t.key,s=t.participantIdentity,a=t.keyIndex;if(!this.worker)throw Error("could not set key, worker is missing");var o={kind:"setKey",data:{participantIdentity:s,isPublisher:s===((n=this.room)===null||n===void 0?void 0:n.localParticipant.identity),key:r,keyIndex:a}};this.worker.postMessage(o)}},{key:"postEnable",value:function(t,n){if(!this.worker)throw new ReferenceError("failed to enable e2ee, worker is not ready");var r={kind:"enable",data:{enabled:t,participantIdentity:n}};this.worker.postMessage(r)}},{key:"postRTPMap",value:function(t){var n;if(!this.worker)throw TypeError("could not post rtp map, worker is missing");if(!(!((n=this.room)===null||n===void 0)&&n.localParticipant.identity))throw TypeError("could not post rtp map, local participant identity is missing");var r={kind:"setRTPMap",data:{map:t,participantIdentity:this.room.localParticipant.identity}};this.worker.postMessage(r)}},{key:"postSifTrailer",value:function(t){if(!this.worker)throw Error("could not post SIF trailer, worker is missing");var n={kind:"setSifTrailer",data:{trailer:t}};this.worker.postMessage(n)}},{key:"setupE2EEReceiver",value:function(t,n,r){if(t.receiver){if(!(r!=null&&r.mimeType)||r.mimeType==="")throw new TypeError("MimeType missing from trackInfo, cannot set up E2EE cryptor");this.handleReceiver(t.receiver,t.mediaStreamID,n,t.kind==="video"?Cd(r.mimeType):void 0)}}},{key:"setupE2EESender",value:function(t,n){t instanceof bo&&n?this.handleSender(n,t.mediaStreamID,void 0):n||xt.warn("early return because sender is not ready")}},{key:"handleReceiver",value:function(t,n,r,s){return he(this,void 0,void 0,F().mark(function a(){var o,c,u,d,h,b;return F().wrap(function(v){for(;;)switch(v.prev=v.next){case 0:if(this.worker){v.next=2;break}return v.abrupt("return");case 2:if(!Am()){v.next=7;break}o={kind:"decode",participantIdentity:r,trackId:n,codec:s},t.transform=new RTCRtpScriptTransform(this.worker,o),v.next=16;break;case 7:if(!(_d in t)||!s){v.next=11;break}return c={kind:"updateCodec",data:{trackId:n,codec:s,participantIdentity:r}},this.worker.postMessage(c),v.abrupt("return");case 11:u=t.writableStream,d=t.readableStream,u&&d||(h=t.createEncodedStreams(),t.writableStream=h.writable,u=h.writable,t.readableStream=h.readable,d=h.readable),b={kind:"decode",data:{readableStream:d,writableStream:u,trackId:n,codec:s,participantIdentity:r}},this.worker.postMessage(b,[d,u]);case 16:t[_d]=!0;case 17:case"end":return v.stop()}},a,this)}))}},{key:"handleSender",value:function(t,n,r){var s;if(!(_d in t)&&this.worker){if(!(!((s=this.room)===null||s===void 0)&&s.localParticipant.identity)||this.room.localParticipant.identity==="")throw TypeError("local identity needs to be known in order to set up encrypted sender");if(Am()){xt.info("initialize script transform");var a={kind:"encode",participantIdentity:this.room.localParticipant.identity,trackId:n,codec:r};t.transform=new RTCRtpScriptTransform(this.worker,a)}else{xt.info("initialize encoded streams");var o=t.createEncodedStreams(),c={kind:"encode",data:{readableStream:o.readable,writableStream:o.writable,codec:r,trackId:n,participantIdentity:this.room.localParticipant.identity}};this.worker.postMessage(c,[o.readable,o.writable])}t[_d]=!0}}}]),e}();(function(i){i[i.WAITING=0]="WAITING",i[i.RUNNING=1]="RUNNING",i[i.COMPLETED=2]="COMPLETED"})(Hl||(Hl={}));var Jt,V9=function(){function i(){ht(this,i),this.pendingTasks=new Map,this.taskMutex=new yi,this.nextTaskIndex=0}return ft(i,[{key:"run",value:function(e){return he(this,void 0,void 0,F().mark(function t(){var n,r;return F().wrap(function(s){for(;;)switch(s.prev=s.next){case 0:return n={id:this.nextTaskIndex++,enqueuedAt:Date.now(),status:Hl.WAITING},this.pendingTasks.set(n.id,n),s.next=4,this.taskMutex.lock();case 4:return r=s.sent,s.prev=5,n.executedAt=Date.now(),n.status=Hl.RUNNING,s.next=10,e();case 10:return s.abrupt("return",s.sent);case 11:return s.prev=11,n.status=Hl.COMPLETED,this.pendingTasks.delete(n.id),r(),s.finish(11);case 16:case"end":return s.stop()}},t,this,[[5,,11,16]])}))}},{key:"flush",value:function(){return he(this,void 0,void 0,F().mark(function e(){var t=this;return F().wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return n.abrupt("return",this.run(function(){return he(t,void 0,void 0,F().mark(function r(){return F().wrap(function(s){for(;;)switch(s.prev=s.next){case 0:case"end":return s.stop()}},r)}))}));case 1:case"end":return n.stop()}},e,this)}))}},{key:"snapshot",value:function(){return Array.from(this.pendingTasks.values())}}]),i}(),j9=["syncState","trickle","offer","answer","simulate","leave"];function $9(i){var e=j9.indexOf(i.case)>=0;return xt.trace("request allowed to bypass queue:",{canPass:e,req:i}),e}(function(i){i[i.CONNECTING=0]="CONNECTING",i[i.CONNECTED=1]="CONNECTED",i[i.RECONNECTING=2]="RECONNECTING",i[i.DISCONNECTING=3]="DISCONNECTING",i[i.DISCONNECTED=4]="DISCONNECTED"})(Jt||(Jt={}));var H9=function(){function i(){var e=this;ht(this,i);var t,n=arguments.length>0&&arguments[0]!==void 0&&arguments[0],r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.rtt=0,this.state=Jt.DISCONNECTED,this.log=xt,this._requestId=0,this.resetCallbacks=function(){e.onAnswer=void 0,e.onLeave=void 0,e.onLocalTrackPublished=void 0,e.onLocalTrackUnpublished=void 0,e.onNegotiateRequested=void 0,e.onOffer=void 0,e.onRemoteMuteChanged=void 0,e.onSubscribedQualityUpdate=void 0,e.onTokenRefresh=void 0,e.onTrickle=void 0,e.onClose=void 0},this.log=Lr((t=r.loggerName)!==null&&t!==void 0?t:Yi.Signal),this.loggerContextCb=r.loggerContextCb,this.useJSON=n,this.requestQueue=new V9,this.queuedRequests=[],this.closingLock=new yi,this.connectionLock=new yi,this.state=Jt.DISCONNECTED}return ft(i,[{key:"currentState",get:function(){return this.state}},{key:"isDisconnected",get:function(){return this.state===Jt.DISCONNECTING||this.state===Jt.DISCONNECTED}},{key:"isEstablishingConnection",get:function(){return this.state===Jt.CONNECTING||this.state===Jt.RECONNECTING}},{key:"getNextRequestId",value:function(){return this._requestId+=1,this._requestId}},{key:"logContext",get:function(){var e,t;return(t=(e=this.loggerContextCb)===null||e===void 0?void 0:e.call(this))!==null&&t!==void 0?t:{}}},{key:"join",value:function(e,t,n,r){return he(this,void 0,void 0,F().mark(function s(){var a;return F().wrap(function(o){for(;;)switch(o.prev=o.next){case 0:return this.state=Jt.CONNECTING,this.options=n,o.next=4,this.connect(e,t,n,r);case 4:return a=o.sent,o.abrupt("return",a);case 6:case"end":return o.stop()}},s,this)}))}},{key:"reconnect",value:function(e,t,n,r){return he(this,void 0,void 0,F().mark(function s(){var a;return F().wrap(function(o){for(;;)switch(o.prev=o.next){case 0:if(this.options){o.next=3;break}return this.log.warn("attempted to reconnect without signal options being set, ignoring",this.logContext),o.abrupt("return");case 3:return this.state=Jt.RECONNECTING,this.clearPingInterval(),o.next=7,this.connect(e,t,Object.assign(Object.assign({},this.options),{reconnect:!0,sid:n,reconnectReason:r}));case 7:return a=o.sent,o.abrupt("return",a);case 9:case"end":return o.stop()}},s,this)}))}},{key:"connect",value:function(e,t,n,r){var s=this;this.connectOptions=n,e=(e=function(u){return u.startsWith("http")?u.replace(/^(http)/,"ws"):u}(e)).replace(/\/$/,""),e+="/rtc";var a,o,c=function(u,d,h){var b,v=new URLSearchParams;return v.set("access_token",u),h.reconnect&&(v.set("reconnect","1"),h.sid&&v.set("sid",h.sid)),v.set("auto_subscribe",h.autoSubscribe?"1":"0"),v.set("sdk",Ur()?"reactnative":"js"),v.set("version",d.version),v.set("protocol",d.protocol.toString()),d.deviceModel&&v.set("device_model",d.deviceModel),d.os&&v.set("os",d.os),d.osVersion&&v.set("os_version",d.osVersion),d.browser&&v.set("browser",d.browser),d.browserVersion&&v.set("browser_version",d.browserVersion),h.adaptiveStream&&v.set("adaptive_stream","1"),h.reconnectReason&&v.set("reconnect_reason",h.reconnectReason.toString()),!((b=navigator.connection)===null||b===void 0)&&b.type&&v.set("network",navigator.connection.type),"?".concat(v.toString())}(t,(o=new WM({sdk:Ck.JS,protocol:15,version:"2.5.9"}),Ur()&&(o.os=(a=VT())!==null&&a!==void 0?a:""),o),n);return new Promise(function(u,d){return he(s,void 0,void 0,F().mark(function h(){var b,v,y,p=this;return F().wrap(function(f){for(;;)switch(f.prev=f.next){case 0:return f.next=2,this.connectionLock.lock();case 2:if(b=f.sent,f.prev=3,v=function(){return he(p,void 0,void 0,F().mark(function m(){return F().wrap(function(_){for(;;)switch(_.prev=_.next){case 0:this.close(),clearTimeout(y),d(new Wt("room connection has been cancelled (signal)"));case 3:case"end":return _.stop()}},m,this)}))},y=setTimeout(function(){p.close(),d(new Wt("room connection has timed out (signal)"))},n.websocketTimeout),r!=null&&r.aborted&&v(),r==null||r.addEventListener("abort",v),this.log.debug("connecting to ".concat(e+c),this.logContext),!this.ws){f.next=12;break}return f.next=12,this.close(!1);case 12:this.ws=new WebSocket(e+c),this.ws.binaryType="arraybuffer",this.ws.onopen=function(){clearTimeout(y)},this.ws.onerror=function(m){return he(p,void 0,void 0,F().mark(function _(){var k,D;return F().wrap(function(w){for(;;)switch(w.prev=w.next){case 0:if(this.state===Jt.CONNECTED){w.next=21;break}return this.state=Jt.DISCONNECTED,clearTimeout(y),w.prev=3,w.next=6,fetch("http".concat(e.substring(2),"/validate").concat(c));case 6:if(!(k=w.sent).status.toFixed(0).startsWith("4")){w.next=14;break}return w.next=10,k.text();case 10:D=w.sent,d(new Wt(D,jn.NotAllowed,k.status)),w.next=15;break;case 14:d(new Wt("Internal error",jn.InternalError,k.status));case 15:w.next=20;break;case 17:w.prev=17,w.t0=w.catch(3),d(new Wt("server was not reachable",jn.ServerUnreachable));case 20:return w.abrupt("return");case 21:this.handleWSError(m);case 22:case"end":return w.stop()}},_,this,[[3,17]])}))},this.ws.onmessage=function(m){return he(p,void 0,void 0,F().mark(function _(){var k,D,w,A,x,P;return F().wrap(function(S){for(;;)switch(S.prev=S.next){case 0:if(typeof m.data!="string"){S.next=5;break}x=JSON.parse(m.data),A=Dk.fromJson(x,{ignoreUnknownFields:!0}),S.next=11;break;case 5:if(!(m.data instanceof ArrayBuffer)){S.next=9;break}A=Dk.fromBinary(new Uint8Array(m.data)),S.next=11;break;case 9:return this.log.error("could not decode websocket message: ".concat(et(m.data)),this.logContext),S.abrupt("return");case 11:if(this.state===Jt.CONNECTED){S.next=16;break}if(P=!1,((k=A.message)===null||k===void 0?void 0:k.case)==="join"?(this.state=Jt.CONNECTED,r==null||r.removeEventListener("abort",v),this.pingTimeoutDuration=A.message.value.pingTimeout,this.pingIntervalDuration=A.message.value.pingInterval,this.pingTimeoutDuration&&this.pingTimeoutDuration>0&&(this.log.debug("ping config",Object.assign(Object.assign({},this.logContext),{timeout:this.pingTimeoutDuration,interval:this.pingIntervalDuration})),this.startPingInterval()),u(A.message.value)):this.state===Jt.RECONNECTING&&A.message.case!=="leave"?(this.state=Jt.CONNECTED,r==null||r.removeEventListener("abort",v),this.startPingInterval(),((D=A.message)===null||D===void 0?void 0:D.case)==="reconnect"?u(A.message.value):(this.log.debug("declaring signal reconnected without reconnect response received",this.logContext),u(void 0),P=!0)):this.isEstablishingConnection&&A.message.case==="leave"?d(new Wt("Received leave request while trying to (re)connect",jn.LeaveRequest)):n.reconnect||d(new Wt("did not receive join response, got ".concat((w=A.message)===null||w===void 0?void 0:w.case," instead"))),P){S.next=16;break}return S.abrupt("return");case 16:if(!this.signalLatency){S.next=19;break}return S.next=19,yr(this.signalLatency);case 19:this.handleSignalResponse(A);case 20:case"end":return S.stop()}},_,this)}))},this.ws.onclose=function(m){p.isEstablishingConnection&&d(new Wt("Websocket got closed during a (re)connection attempt")),p.log.warn("websocket closed",Object.assign(Object.assign({},p.logContext),{reason:m.reason,code:m.code,wasClean:m.wasClean,state:p.state})),p.handleOnClose(m.reason)};case 18:return f.prev=18,b(),f.finish(18);case 21:case"end":return f.stop()}},h,this,[[3,,18,21]])}))})}},{key:"close",value:function(){return he(this,arguments,void 0,function(){var e=this,t=0>=arguments.length||arguments[0]===void 0||arguments[0];return F().mark(function n(){var r,s;return F().wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return a.next=2,e.closingLock.lock();case 2:if(r=a.sent,a.prev=3,e.clearPingInterval(),t&&(e.state=Jt.DISCONNECTING),!e.ws){a.next=16;break}if(e.ws.onmessage=null,e.ws.onopen=null,e.ws.onclose=null,s=new Promise(function(o){e.ws?e.ws.onclose=function(){o()}:o()}),e.ws.readyState>=e.ws.CLOSING){a.next=15;break}return e.ws.close(),a.next=15,Promise.race([s,yr(250)]);case 15:e.ws=void 0;case 16:return a.prev=16,t&&(e.state=Jt.DISCONNECTED),r(),a.finish(16);case 20:case"end":return a.stop()}},n,null,[[3,,16,20]])})()})}},{key:"sendOffer",value:function(e){this.log.debug("sending offer",Object.assign(Object.assign({},this.logContext),{offerSdp:e.sdp})),this.sendRequest({case:"offer",value:Ed(e)})}},{key:"sendAnswer",value:function(e){return this.log.debug("sending answer",Object.assign(Object.assign({},this.logContext),{answerSdp:e.sdp})),this.sendRequest({case:"answer",value:Ed(e)})}},{key:"sendIceCandidate",value:function(e,t){return this.log.trace("sending ice candidate",Object.assign(Object.assign({},this.logContext),{candidate:e})),this.sendRequest({case:"trickle",value:new gm({candidateInit:JSON.stringify(e),target:t})})}},{key:"sendMuteTrack",value:function(e,t){return this.sendRequest({case:"mute",value:new vm({sid:e,muted:t})})}},{key:"sendAddTrack",value:function(e){return this.sendRequest({case:"addTrack",value:e})}},{key:"sendUpdateLocalMetadata",value:function(e,t){return he(this,arguments,void 0,function(n,r){var s=this,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return F().mark(function o(){var c;return F().wrap(function(u){for(;;)switch(u.prev=u.next){case 0:return c=s.getNextRequestId(),u.next=3,s.sendRequest({case:"updateMetadata",value:new Nk({requestId:c,metadata:n,name:r,attributes:a})});case 3:return u.abrupt("return",c);case 4:case"end":return u.stop()}},o)})()})}},{key:"sendUpdateTrackSettings",value:function(e){this.sendRequest({case:"trackSetting",value:e})}},{key:"sendUpdateSubscription",value:function(e){return this.sendRequest({case:"subscription",value:e})}},{key:"sendSyncState",value:function(e){return this.sendRequest({case:"syncState",value:e})}},{key:"sendUpdateVideoLayers",value:function(e,t){return this.sendRequest({case:"updateLayers",value:new Pk({trackSid:e,layers:t})})}},{key:"sendUpdateSubscriptionPermissions",value:function(e,t){return this.sendRequest({case:"subscriptionPermission",value:new Rk({allParticipants:e,trackPermissions:t})})}},{key:"sendSimulateScenario",value:function(e){return this.sendRequest({case:"simulate",value:e})}},{key:"sendPing",value:function(){return Promise.all([this.sendRequest({case:"ping",value:Gt.parse(Date.now())}),this.sendRequest({case:"pingReq",value:new Uk({timestamp:Gt.parse(Date.now()),rtt:Gt.parse(this.rtt)})})])}},{key:"sendUpdateLocalAudioTrack",value:function(e,t){return this.sendRequest({case:"updateAudioTrack",value:new Ik({trackSid:e,features:t})})}},{key:"sendLeave",value:function(){return this.sendRequest({case:"leave",value:new dd({reason:co.CLIENT_INITIATED,action:fo.DISCONNECT})})}},{key:"sendRequest",value:function(e){return he(this,arguments,void 0,function(t){var n=this,r=arguments.length>1&&arguments[1]!==void 0&&arguments[1];return F().mark(function s(){var a;return F().wrap(function(o){for(;;)switch(o.prev=o.next){case 0:if(!(!r&&!$9(t))||n.state!==Jt.RECONNECTING){o.next=4;break}return n.queuedRequests.push(function(){return he(n,void 0,void 0,F().mark(function c(){return F().wrap(function(u){for(;;)switch(u.prev=u.next){case 0:return u.next=2,this.sendRequest(t,!0);case 2:case"end":return u.stop()}},c,this)}))}),o.abrupt("return");case 4:if(r){o.next=7;break}return o.next=7,n.requestQueue.flush();case 7:if(!n.signalLatency){o.next=10;break}return o.next=10,yr(n.signalLatency);case 10:if(n.ws&&n.ws.readyState===n.ws.OPEN){o.next=13;break}return n.log.error("cannot send signal request before connected, type: ".concat(t==null?void 0:t.case),n.logContext),o.abrupt("return");case 13:a=new YM({message:t});try{n.useJSON?n.ws.send(a.toJsonString()):n.ws.send(a.toBinary())}catch(c){n.log.error("error sending signal message",Object.assign(Object.assign({},n.logContext),{error:c}))}case 15:case"end":return o.stop()}},s)})()})}},{key:"handleSignalResponse",value:function(e){var t,n,r=e.message;if(r!=null){var s=!1;if(r.case==="answer"){var a=WT(r.value);this.onAnswer&&this.onAnswer(a)}else if(r.case==="offer"){var o=WT(r.value);this.onOffer&&this.onOffer(o)}else if(r.case==="trickle"){var c=JSON.parse(r.value.candidateInit);this.onTrickle&&this.onTrickle(c,r.value.target)}else r.case==="update"?this.onParticipantUpdate&&this.onParticipantUpdate((t=r.value.participants)!==null&&t!==void 0?t:[]):r.case==="trackPublished"?this.onLocalTrackPublished&&this.onLocalTrackPublished(r.value):r.case==="speakersChanged"?this.onSpeakersChanged&&this.onSpeakersChanged((n=r.value.speakers)!==null&&n!==void 0?n:[]):r.case==="leave"?this.onLeave&&this.onLeave(r.value):r.case==="mute"?this.onRemoteMuteChanged&&this.onRemoteMuteChanged(r.value.sid,r.value.muted):r.case==="roomUpdate"?this.onRoomUpdate&&r.value.room&&this.onRoomUpdate(r.value.room):r.case==="connectionQuality"?this.onConnectionQuality&&this.onConnectionQuality(r.value):r.case==="streamStateUpdate"?this.onStreamStateUpdate&&this.onStreamStateUpdate(r.value):r.case==="subscribedQualityUpdate"?this.onSubscribedQualityUpdate&&this.onSubscribedQualityUpdate(r.value):r.case==="subscriptionPermissionUpdate"?this.onSubscriptionPermissionUpdate&&this.onSubscriptionPermissionUpdate(r.value):r.case==="refreshToken"?this.onTokenRefresh&&this.onTokenRefresh(r.value):r.case==="trackUnpublished"?this.onLocalTrackUnpublished&&this.onLocalTrackUnpublished(r.value):r.case==="subscriptionResponse"?this.onSubscriptionError&&this.onSubscriptionError(r.value):r.case==="pong"||(r.case==="pongResp"?(this.rtt=Date.now()-Number.parseInt(r.value.lastPingTimestamp.toString()),this.resetPingTimeout(),s=!0):r.case==="requestResponse"?this.onRequestResponse&&this.onRequestResponse(r.value):r.case==="trackSubscribed"?this.onLocalTrackSubscribed&&this.onLocalTrackSubscribed(r.value.trackSid):this.log.debug("unsupported message",Object.assign(Object.assign({},this.logContext),{msgCase:r.case})));s||this.resetPingTimeout()}else this.log.debug("received unsupported message",this.logContext)}},{key:"setReconnected",value:function(){for(;this.queuedRequests.length>0;){var e=this.queuedRequests.shift();e&&this.requestQueue.run(e)}}},{key:"handleOnClose",value:function(e){return he(this,void 0,void 0,F().mark(function t(){var n;return F().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:if(this.state!==Jt.DISCONNECTED){r.next=2;break}return r.abrupt("return");case 2:return n=this.onClose,r.next=5,this.close();case 5:this.log.debug("websocket connection closed: ".concat(e),Object.assign(Object.assign({},this.logContext),{reason:e})),n&&n(e);case 7:case"end":return r.stop()}},t,this)}))}},{key:"handleWSError",value:function(e){this.log.error("websocket error",Object.assign(Object.assign({},this.logContext),{error:e}))}},{key:"resetPingTimeout",value:function(){var e=this;this.clearPingTimeout(),this.pingTimeoutDuration?this.pingTimeout=In.setTimeout(function(){e.log.warn("ping timeout triggered. last pong received at: ".concat(new Date(Date.now()-1e3*e.pingTimeoutDuration).toUTCString()),e.logContext),e.handleOnClose("ping timeout")},1e3*this.pingTimeoutDuration):this.log.warn("ping timeout duration not set",this.logContext)}},{key:"clearPingTimeout",value:function(){this.pingTimeout&&In.clearTimeout(this.pingTimeout)}},{key:"startPingInterval",value:function(){var e=this;this.clearPingInterval(),this.resetPingTimeout(),this.pingIntervalDuration?(this.log.debug("start ping interval",this.logContext),this.pingInterval=In.setInterval(function(){e.sendPing()},1e3*this.pingIntervalDuration)):this.log.warn("ping interval duration not set",this.logContext)}},{key:"clearPingInterval",value:function(){this.log.debug("clearing ping interval",this.logContext),this.clearPingTimeout(),this.pingInterval&&In.clearInterval(this.pingInterval)}}]),i}();function WT(i){var e={type:"offer",sdp:i.sdp};switch(i.type){case"answer":case"offer":case"pranswer":case"rollback":e.type=i.type;break}return e}function Ed(i){return new Ys({sdp:i.sdp,type:i.type})}var KT,XT,Wm,YT,JT,_r={},QT={},Km={exports:{}};function ZT(){if(KT)return Km.exports;KT=1;var i=Km.exports={v:[{name:"version",reg:/^(\d*)$/}],o:[{name:"origin",reg:/^(\S*) (\d*) (\d*) (\S*) IP(\d) (\S*)/,names:["username","sessionId","sessionVersion","netType","ipVer","address"],format:"%s %s %d %s IP%d %s"}],s:[{name:"name"}],i:[{name:"description"}],u:[{name:"uri"}],e:[{name:"email"}],p:[{name:"phone"}],z:[{name:"timezones"}],r:[{name:"repeats"}],t:[{name:"timing",reg:/^(\d*) (\d*)/,names:["start","stop"],format:"%d %d"}],c:[{name:"connection",reg:/^IN IP(\d) (\S*)/,names:["version","ip"],format:"IN IP%d %s"}],b:[{push:"bandwidth",reg:/^(TIAS|AS|CT|RR|RS):(\d*)/,names:["type","limit"],format:"%s:%s"}],m:[{reg:/^(\w*) (\d*) ([\w/]*)(?: (.*))?/,names:["type","port","protocol","payloads"],format:"%s %d %s %s"}],a:[{push:"rtp",reg:/^rtpmap:(\d*) ([\w\-.]*)(?:\s*\/(\d*)(?:\s*\/(\S*))?)?/,names:["payload","codec","rate","encoding"],format:function(e){return e.encoding?"rtpmap:%d %s/%s/%s":e.rate?"rtpmap:%d %s/%s":"rtpmap:%d %s"}},{push:"fmtp",reg:/^fmtp:(\d*) ([\S| ]*)/,names:["payload","config"],format:"fmtp:%d %s"},{name:"control",reg:/^control:(.*)/,format:"control:%s"},{name:"rtcp",reg:/^rtcp:(\d*)(?: (\S*) IP(\d) (\S*))?/,names:["port","netType","ipVer","address"],format:function(e){return e.address!=null?"rtcp:%d %s IP%d %s":"rtcp:%d"}},{push:"rtcpFbTrrInt",reg:/^rtcp-fb:(\*|\d*) trr-int (\d*)/,names:["payload","value"],format:"rtcp-fb:%s trr-int %d"},{push:"rtcpFb",reg:/^rtcp-fb:(\*|\d*) ([\w-_]*)(?: ([\w-_]*))?/,names:["payload","type","subtype"],format:function(e){return e.subtype!=null?"rtcp-fb:%s %s %s":"rtcp-fb:%s %s"}},{push:"ext",reg:/^extmap:(\d+)(?:\/(\w+))?(?: (urn:ietf:params:rtp-hdrext:encrypt))? (\S*)(?: (\S*))?/,names:["value","direction","encrypt-uri","uri","config"],format:function(e){return"extmap:%d"+(e.direction?"/%s":"%v")+(e["encrypt-uri"]?" %s":"%v")+" %s"+(e.config?" %s":"")}},{name:"extmapAllowMixed",reg:/^(extmap-allow-mixed)/},{push:"crypto",reg:/^crypto:(\d*) ([\w_]*) (\S*)(?: (\S*))?/,names:["id","suite","config","sessionConfig"],format:function(e){return e.sessionConfig!=null?"crypto:%d %s %s %s":"crypto:%d %s %s"}},{name:"setup",reg:/^setup:(\w*)/,format:"setup:%s"},{name:"connectionType",reg:/^connection:(new|existing)/,format:"connection:%s"},{name:"mid",reg:/^mid:([^\s]*)/,format:"mid:%s"},{name:"msid",reg:/^msid:(.*)/,format:"msid:%s"},{name:"ptime",reg:/^ptime:(\d*(?:\.\d*)*)/,format:"ptime:%d"},{name:"maxptime",reg:/^maxptime:(\d*(?:\.\d*)*)/,format:"maxptime:%d"},{name:"direction",reg:/^(sendrecv|recvonly|sendonly|inactive)/},{name:"icelite",reg:/^(ice-lite)/},{name:"iceUfrag",reg:/^ice-ufrag:(\S*)/,format:"ice-ufrag:%s"},{name:"icePwd",reg:/^ice-pwd:(\S*)/,format:"ice-pwd:%s"},{name:"fingerprint",reg:/^fingerprint:(\S*) (\S*)/,names:["type","hash"],format:"fingerprint:%s %s"},{push:"candidates",reg:/^candidate:(\S*) (\d*) (\S*) (\d*) (\S*) (\d*) typ (\S*)(?: raddr (\S*) rport (\d*))?(?: tcptype (\S*))?(?: generation (\d*))?(?: network-id (\d*))?(?: network-cost (\d*))?/,names:["foundation","component","transport","priority","ip","port","type","raddr","rport","tcptype","generation","network-id","network-cost"],format:function(e){var t="candidate:%s %d %s %d %s %d typ %s";return t+=e.raddr!=null?" raddr %s rport %d":"%v%v",t+=e.tcptype!=null?" tcptype %s":"%v",e.generation!=null&&(t+=" generation %d"),t+=e["network-id"]!=null?" network-id %d":"%v",t+=e["network-cost"]!=null?" network-cost %d":"%v"}},{name:"endOfCandidates",reg:/^(end-of-candidates)/},{name:"remoteCandidates",reg:/^remote-candidates:(.*)/,format:"remote-candidates:%s"},{name:"iceOptions",reg:/^ice-options:(\S*)/,format:"ice-options:%s"},{push:"ssrcs",reg:/^ssrc:(\d*) ([\w_-]*)(?::(.*))?/,names:["id","attribute","value"],format:function(e){var t="ssrc:%d";return e.attribute!=null&&(t+=" %s",e.value!=null&&(t+=":%s")),t}},{push:"ssrcGroups",reg:/^ssrc-group:([\x21\x23\x24\x25\x26\x27\x2A\x2B\x2D\x2E\w]*) (.*)/,names:["semantics","ssrcs"],format:"ssrc-group:%s %s"},{name:"msidSemantic",reg:/^msid-semantic:\s?(\w*) (\S*)/,names:["semantic","token"],format:"msid-semantic: %s %s"},{push:"groups",reg:/^group:(\w*) (.*)/,names:["type","mids"],format:"group:%s %s"},{name:"rtcpMux",reg:/^(rtcp-mux)/},{name:"rtcpRsize",reg:/^(rtcp-rsize)/},{name:"sctpmap",reg:/^sctpmap:([\w_/]*) (\S*)(?: (\S*))?/,names:["sctpmapNumber","app","maxMessageSize"],format:function(e){return e.maxMessageSize!=null?"sctpmap:%s %s %s":"sctpmap:%s %s"}},{name:"xGoogleFlag",reg:/^x-google-flag:([^\s]*)/,format:"x-google-flag:%s"},{push:"rids",reg:/^rid:([\d\w]+) (\w+)(?: ([\S| ]*))?/,names:["id","direction","params"],format:function(e){return e.params?"rid:%s %s %s":"rid:%s %s"}},{push:"imageattrs",reg:new RegExp("^imageattr:(\\d+|\\*)[\\s\\t]+(send|recv)[\\s\\t]+(\\*|\\[\\S+\\](?:[\\s\\t]+\\[\\S+\\])*)(?:[\\s\\t]+(recv|send)[\\s\\t]+(\\*|\\[\\S+\\](?:[\\s\\t]+\\[\\S+\\])*))?"),names:["pt","dir1","attrs1","dir2","attrs2"],format:function(e){return"imageattr:%s %s %s"+(e.dir2?" %s %s":"")}},{name:"simulcast",reg:new RegExp("^simulcast:(send|recv) ([a-zA-Z0-9\\-_~;,]+)(?:\\s?(send|recv) ([a-zA-Z0-9\\-_~;,]+))?$"),names:["dir1","list1","dir2","list2"],format:function(e){return"simulcast:%s %s"+(e.dir2?" %s %s":"")}},{name:"simulcast_03",reg:/^simulcast:[\s\t]+([\S+\s\t]+)$/,names:["value"],format:"simulcast: %s"},{name:"framerate",reg:/^framerate:(\d+(?:$|\.\d+))/,format:"framerate:%s"},{name:"sourceFilter",reg:/^source-filter: *(excl|incl) (\S*) (IP4|IP6|\*) (\S*) (.*)/,names:["filterMode","netType","addressTypes","destAddress","srcList"],format:"source-filter: %s %s %s %s %s"},{name:"bundleOnly",reg:/^(bundle-only)/},{name:"label",reg:/^label:(.+)/,format:"label:%s"},{name:"sctpPort",reg:/^sctp-port:(\d+)$/,format:"sctp-port:%s"},{name:"maxMessageSize",reg:/^max-message-size:(\d+)$/,format:"max-message-size:%s"},{push:"tsRefClocks",reg:/^ts-refclk:([^\s=]*)(?:=(\S*))?/,names:["clksrc","clksrcExt"],format:function(e){return"ts-refclk:%s"+(e.clksrcExt!=null?"=%s":"")}},{name:"mediaClk",reg:/^mediaclk:(?:id=(\S*))? *([^\s=]*)(?:=(\S*))?(?: *rate=(\d+)\/(\d+))?/,names:["id","mediaClockName","mediaClockValue","rateNumerator","rateDenominator"],format:function(e){var t="mediaclk:";return t+=e.id!=null?"id=%s %s":"%v%s",t+=e.mediaClockValue!=null?"=%s":"",t+=e.rateNumerator!=null?" rate=%s":"",t+=e.rateDenominator!=null?"/%s":""}},{name:"keywords",reg:/^keywds:(.+)$/,format:"keywds:%s"},{name:"content",reg:/^content:(.+)/,format:"content:%s"},{name:"bfcpFloorCtrl",reg:/^floorctrl:(c-only|s-only|c-s)/,format:"floorctrl:%s"},{name:"bfcpConfId",reg:/^confid:(\d+)/,format:"confid:%s"},{name:"bfcpUserId",reg:/^userid:(\d+)/,format:"userid:%s"},{name:"bfcpFloorId",reg:/^floorid:(.+) (?:m-stream|mstrm):(.+)/,names:["id","mStream"],format:"floorid:%s mstrm:%s"},{push:"invalid",names:["value"]}]};return Object.keys(i).forEach(function(e){i[e].forEach(function(t){t.reg||(t.reg=/(.*)/),t.format||(t.format="%s")})}),Km.exports}function q9(){return XT||(XT=1,function(i){var e=function(a){return String(Number(a))===a?Number(a):a},t=function(a,o,c){var u=a.name&&a.names;a.push&&!o[a.push]?o[a.push]=[]:u&&!o[a.name]&&(o[a.name]={});var d=a.push?{}:u?o[a.name]:o;(function(h,b,v,y){if(y&&!v)b[y]=e(h[1]);else for(var p=0;p<v.length;p+=1)h[p+1]!=null&&(b[v[p]]=e(h[p+1]))})(c.match(a.reg),d,a.names,a.name),a.push&&o[a.push].push(d)},n=ZT(),r=RegExp.prototype.test.bind(/^([a-z])=(.*)/);i.parse=function(a){var o={},c=[],u=o;return a.split(/(\r\n|\r|\n)/).filter(r).forEach(function(d){var h=d[0],b=d.slice(2);h==="m"&&(c.push({rtp:[],fmtp:[]}),u=c[c.length-1]);for(var v=0;v<(n[h]||[]).length;v+=1){var y=n[h][v];if(y.reg.test(b))return t(y,u,b)}}),o.media=c,o};var s=function(a,o){var c=o.split(/=(.+)/,2);return c.length===2?a[c[0]]=e(c[1]):c.length===1&&o.length>1&&(a[c[0]]=void 0),a};i.parseParams=function(a){return a.split(/;\s?/).reduce(s,{})},i.parseFmtpConfig=i.parseParams,i.parsePayloads=function(a){return a.toString().split(" ").map(Number)},i.parseRemoteCandidates=function(a){for(var o=[],c=a.split(" ").map(e),u=0;u<c.length;u+=3)o.push({component:c[u],ip:c[u+1],port:c[u+2]});return o},i.parseImageAttributes=function(a){return a.split(" ").map(function(o){return o.substring(1,o.length-1).split(",").reduce(s,{})})},i.parseSimulcastStreamList=function(a){return a.split(";").map(function(o){return o.split(",").map(function(c){var u,d=!1;return c[0]!=="~"?u=e(c):(u=e(c.substring(1,c.length)),d=!0),{scid:u,paused:d}})})}}(QT)),QT}function z9(){if(YT)return Wm;YT=1;var i=ZT(),e=/%[sdv%]/g,t=function(a){var o=1,c=arguments,u=c.length;return a.replace(e,function(d){if(o>=u)return d;var h=c[o];switch(o+=1,d){case"%%":return"%";case"%s":return String(h);case"%d":return Number(h);case"%v":return""}})},n=function(a,o,c){var u=[a+"="+(o.format instanceof Function?o.format(o.push?c:c[o.name]):o.format)];if(o.names)for(var d=0;d<o.names.length;d+=1){var h=o.names[d];o.name?u.push(c[o.name][h]):u.push(c[o.names[d]])}else u.push(c[o.name]);return t.apply(null,u)},r=["v","o","s","i","u","e","p","c","b","t","r","z","a"],s=["i","c","b","a"];return Wm=function(a,o){o=o||{},a.version==null&&(a.version=0),a.name==null&&(a.name=" "),a.media.forEach(function(h){h.payloads==null&&(h.payloads="")});var c=o.outerOrder||r,u=o.innerOrder||s,d=[];return c.forEach(function(h){i[h].forEach(function(b){b.name in a&&a[b.name]!=null?d.push(n(h,b,a)):b.push in a&&a[b.push]!=null&&a[b.push].forEach(function(v){d.push(n(h,b,v))})})}),a.media.forEach(function(h){d.push(n("m",i.m[0],h)),u.forEach(function(b){i[b].forEach(function(v){v.name in h&&h[v.name]!=null?d.push(n(b,v,h)):v.push in h&&h[v.push]!=null&&h[v.push].forEach(function(y){d.push(n(b,v,y))})})})}),d.join(`\r
323
+ `)+`\r
324
+ `},Wm}var gs=function(){if(JT)return _r;JT=1;var i=q9(),e=z9();return _r.write=e,_r.parse=i.parse,_r.parseParams=i.parseParams,_r.parseFmtpConfig=i.parseFmtpConfig,_r.parsePayloads=i.parsePayloads,_r.parseRemoteCandidates=i.parseRemoteCandidates,_r.parseImageAttributes=i.parseImageAttributes,_r.parseSimulcastStreamList=i.parseSimulcastStreamList,_r}(),eS="negotiationStarted",tS="negotiationComplete",nS="rtpVideoPayloadTypes",iS=function(i){function e(t){var n;ht(this,e);var r,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return(n=Ut(this,e)).log=xt,n.pendingCandidates=[],n.restartingIce=!1,n.renegotiate=!1,n.trackBitrates=[],n.remoteStereoMids=[],n.remoteNackMids=[],n.negotiate=Nm(function(a){return he(ct(n),void 0,void 0,F().mark(function o(){return F().wrap(function(c){for(;;)switch(c.prev=c.next){case 0:return this.emit(eS),c.prev=1,c.next=4,this.createAndSendOffer();case 4:c.next=13;break;case 6:if(c.prev=6,c.t0=c.catch(1),!a){c.next=12;break}a(c.t0),c.next=13;break;case 12:throw c.t0;case 13:case"end":return c.stop()}},o,this,[[1,6]])}))},20),n.close=function(){n._pc&&(n._pc.close(),n._pc.onconnectionstatechange=null,n._pc.oniceconnectionstatechange=null,n._pc.onicegatheringstatechange=null,n._pc.ondatachannel=null,n._pc.onnegotiationneeded=null,n._pc.onsignalingstatechange=null,n._pc.onicecandidate=null,n._pc.ondatachannel=null,n._pc.ontrack=null,n._pc.onconnectionstatechange=null,n._pc.oniceconnectionstatechange=null,n._pc=null)},n.log=Lr((r=s.loggerName)!==null&&r!==void 0?r:Yi.PCTransport),n.loggerOptions=s,n.config=t,n._pc=n.createPC(),n}return Ft(e,Js.EventEmitter),ft(e,[{key:"pc",get:function(){return this._pc||(this._pc=this.createPC()),this._pc}},{key:"createPC",value:function(){var t=this,n=new RTCPeerConnection(this.config);return n.onicecandidate=function(r){var s;r.candidate&&((s=t.onIceCandidate)===null||s===void 0||s.call(t,r.candidate))},n.onicecandidateerror=function(r){var s;(s=t.onIceCandidateError)===null||s===void 0||s.call(t,r)},n.oniceconnectionstatechange=function(){var r;(r=t.onIceConnectionStateChange)===null||r===void 0||r.call(t,n.iceConnectionState)},n.onsignalingstatechange=function(){var r;(r=t.onSignalingStatechange)===null||r===void 0||r.call(t,n.signalingState)},n.onconnectionstatechange=function(){var r;(r=t.onConnectionStateChange)===null||r===void 0||r.call(t,n.connectionState)},n.ondatachannel=function(r){var s;(s=t.onDataChannel)===null||s===void 0||s.call(t,r)},n.ontrack=function(r){var s;(s=t.onTrack)===null||s===void 0||s.call(t,r)},n}},{key:"logContext",get:function(){var t,n;return Object.assign({},(n=(t=this.loggerOptions).loggerContextCb)===null||n===void 0?void 0:n.call(t))}},{key:"isICEConnected",get:function(){return this._pc!==null&&(this.pc.iceConnectionState==="connected"||this.pc.iceConnectionState==="completed")}},{key:"addIceCandidate",value:function(t){return he(this,void 0,void 0,F().mark(function n(){return F().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:if(!this.pc.remoteDescription||this.restartingIce){r.next=2;break}return r.abrupt("return",this.pc.addIceCandidate(t));case 2:this.pendingCandidates.push(t);case 3:case"end":return r.stop()}},n,this)}))}},{key:"setRemoteDescription",value:function(t){return he(this,void 0,void 0,F().mark(function n(){var r,s,a,o,c,u,d=this;return F().wrap(function(h){for(;;)switch(h.prev=h.next){case 0:return s=void 0,t.type==="offer"?(a=W9(t),o=a.stereoMids,c=a.nackMids,this.remoteStereoMids=o,this.remoteNackMids=c):t.type==="answer"&&((u=gs.parse((r=t.sdp)!==null&&r!==void 0?r:"")).media.forEach(function(b){b.type==="audio"&&d.trackBitrates.some(function(v){if(!v.transceiver||b.mid!=v.transceiver.mid)return!1;var y=0;if(b.rtp.some(function(k){return k.codec.toUpperCase()===v.codec.toUpperCase()&&(y=k.payload,!0)}),y===0)return!0;var p,f=!1,m=dt(b.fmtp);try{for(m.s();!(p=m.n()).done;){var _=p.value;if(_.payload===y){_.config=_.config.split(";").filter(function(k){return!k.includes("maxaveragebitrate")}).join(";"),v.maxbr>0&&(_.config+=";maxaveragebitrate=".concat(1e3*v.maxbr)),f=!0;break}}}catch(k){m.e(k)}finally{m.f()}return f||v.maxbr>0&&b.fmtp.push({payload:y,config:"maxaveragebitrate=".concat(1e3*v.maxbr)}),!0})}),s=gs.write(u)),h.next=4,this.setMungedSDP(t,s,!0);case 4:if(this.pendingCandidates.forEach(function(b){d.pc.addIceCandidate(b)}),this.pendingCandidates=[],this.restartingIce=!1,!this.renegotiate){h.next=13;break}return this.renegotiate=!1,h.next=11,this.createAndSendOffer();case 11:h.next=14;break;case 13:t.type==="answer"&&(this.emit(tS),t.sdp&&gs.parse(t.sdp).media.forEach(function(b){b.type==="video"&&d.emit(nS,b.rtp)}));case 14:case"end":return h.stop()}},n,this)}))}},{key:"createAndSendOffer",value:function(t){return he(this,void 0,void 0,F().mark(function n(){var r,s,a,o,c=this;return F().wrap(function(u){for(;;)switch(u.prev=u.next){case 0:if(this.onOffer!==void 0){u.next=2;break}return u.abrupt("return");case 2:if(t!=null&&t.iceRestart&&(this.log.debug("restarting ICE",this.logContext),this.restartingIce=!0),!this._pc||this._pc.signalingState!=="have-local-offer"){u.next=14;break}if(s=this._pc.remoteDescription,!(t!=null&&t.iceRestart)||!s){u.next=10;break}return u.next=8,this._pc.setRemoteDescription(s);case 8:u.next=12;break;case 10:return this.renegotiate=!0,u.abrupt("return");case 12:u.next=17;break;case 14:if(this._pc&&this._pc.signalingState!=="closed"){u.next=17;break}return this.log.warn("could not createOffer with closed peer connection",this.logContext),u.abrupt("return");case 17:return this.log.debug("starting to negotiate",this.logContext),u.next=20,this.pc.createOffer(t);case 20:return a=u.sent,this.log.debug("original offer",Object.assign({sdp:a.sdp},this.logContext)),(o=gs.parse((r=a.sdp)!==null&&r!==void 0?r:"")).media.forEach(function(d){d.type==="audio"?rS(d,[],[]):d.type==="video"&&c.trackBitrates.some(function(h){if(!d.msid||!h.cid||!d.msid.includes(h.cid))return!1;var b=0;if(d.rtp.some(function(m){return m.codec.toUpperCase()===h.codec.toUpperCase()&&(b=m.payload,!0)}),b===0||(jl(h.codec)&&G9(d),h.codec!=="av1"))return!0;var v,y=Math.round(.7*h.maxbr),p=dt(d.fmtp);try{for(p.s();!(v=p.n()).done;){var f=v.value;if(f.payload===b){f.config.includes("x-google-start-bitrate")||(f.config+=";x-google-start-bitrate=".concat(y));break}}}catch(m){p.e(m)}finally{p.f()}return!0})}),u.next=26,this.setMungedSDP(a,gs.write(o));case 26:this.onOffer(a);case 27:case"end":return u.stop()}},n,this)}))}},{key:"createAndSetAnswer",value:function(){return he(this,void 0,void 0,F().mark(function t(){var n,r,s,a=this;return F().wrap(function(o){for(;;)switch(o.prev=o.next){case 0:return o.next=2,this.pc.createAnswer();case 2:return r=o.sent,(s=gs.parse((n=r.sdp)!==null&&n!==void 0?n:"")).media.forEach(function(c){c.type==="audio"&&rS(c,a.remoteStereoMids,a.remoteNackMids)}),o.next=7,this.setMungedSDP(r,gs.write(s));case 7:return o.abrupt("return",r);case 8:case"end":return o.stop()}},t,this)}))}},{key:"createDataChannel",value:function(t,n){return this.pc.createDataChannel(t,n)}},{key:"addTransceiver",value:function(t,n){return this.pc.addTransceiver(t,n)}},{key:"addTrack",value:function(t){if(!this._pc)throw new bn("PC closed, cannot add track");return this._pc.addTrack(t)}},{key:"setTrackCodecBitrate",value:function(t){this.trackBitrates.push(t)}},{key:"setConfiguration",value:function(t){var n;if(!this._pc)throw new bn("PC closed, cannot configure");return(n=this._pc)===null||n===void 0?void 0:n.setConfiguration(t)}},{key:"canRemoveTrack",value:function(){var t;return!!(!((t=this._pc)===null||t===void 0)&&t.removeTrack)}},{key:"removeTrack",value:function(t){var n;return(n=this._pc)===null||n===void 0?void 0:n.removeTrack(t)}},{key:"getConnectionState",value:function(){var t,n;return(n=(t=this._pc)===null||t===void 0?void 0:t.connectionState)!==null&&n!==void 0?n:"closed"}},{key:"getICEConnectionState",value:function(){var t,n;return(n=(t=this._pc)===null||t===void 0?void 0:t.iceConnectionState)!==null&&n!==void 0?n:"closed"}},{key:"getSignallingState",value:function(){var t,n;return(n=(t=this._pc)===null||t===void 0?void 0:t.signalingState)!==null&&n!==void 0?n:"closed"}},{key:"getTransceivers",value:function(){var t,n;return(n=(t=this._pc)===null||t===void 0?void 0:t.getTransceivers())!==null&&n!==void 0?n:[]}},{key:"getSenders",value:function(){var t,n;return(n=(t=this._pc)===null||t===void 0?void 0:t.getSenders())!==null&&n!==void 0?n:[]}},{key:"getLocalDescription",value:function(){var t;return(t=this._pc)===null||t===void 0?void 0:t.localDescription}},{key:"getRemoteDescription",value:function(){var t;return(t=this.pc)===null||t===void 0?void 0:t.remoteDescription}},{key:"getStats",value:function(){return this.pc.getStats()}},{key:"getConnectedAddress",value:function(){return he(this,void 0,void 0,F().mark(function t(){var n,r,s,a,o;return F().wrap(function(c){for(;;)switch(c.prev=c.next){case 0:if(this._pc){c.next=2;break}return c.abrupt("return");case 2:return r="",s=new Map,a=new Map,c.next=7,this._pc.getStats();case 7:if(c.sent.forEach(function(u){switch(u.type){case"transport":r=u.selectedCandidatePairId;break;case"candidate-pair":r===""&&u.selected&&(r=u.id),s.set(u.id,u);break;case"remote-candidate":a.set(u.id,"".concat(u.address,":").concat(u.port));break}}),r!==""){c.next=11;break}return c.abrupt("return",void 0);case 11:if((o=(n=s.get(r))===null||n===void 0?void 0:n.remoteCandidateId)!==void 0){c.next=14;break}return c.abrupt("return",void 0);case 14:return c.abrupt("return",a.get(o));case 15:case"end":return c.stop()}},t,this)}))}},{key:"setMungedSDP",value:function(t,n,r){return he(this,void 0,void 0,F().mark(function s(){var a,o,c;return F().wrap(function(u){for(;;)switch(u.prev=u.next){case 0:if(!n){u.next=19;break}if(a=t.sdp,t.sdp=n,u.prev=3,this.log.debug("setting munged ".concat(r?"remote":"local"," description"),this.logContext),!r){u.next=10;break}return u.next=8,this.pc.setRemoteDescription(t);case 8:u.next=12;break;case 10:return u.next=12,this.pc.setLocalDescription(t);case 12:return u.abrupt("return");case 15:u.prev=15,u.t0=u.catch(3),this.log.warn("not able to set ".concat(t.type,", falling back to unmodified sdp"),Object.assign(Object.assign({},this.logContext),{error:u.t0,sdp:n})),t.sdp=a;case 19:if(u.prev=19,!r){u.next=25;break}return u.next=23,this.pc.setRemoteDescription(t);case 23:u.next=27;break;case 25:return u.next=27,this.pc.setLocalDescription(t);case 27:u.next=37;break;case 29:throw u.prev=29,u.t1=u.catch(19),o="unknown error",u.t1 instanceof Error?o=u.t1.message:typeof u.t1=="string"&&(o=u.t1),c={error:o,sdp:t.sdp},!r&&this.pc.remoteDescription&&(c.remoteSdp=this.pc.remoteDescription),this.log.error("unable to set ".concat(t.type),Object.assign(Object.assign({},this.logContext),{fields:c})),new Pm(o);case 37:case"end":return u.stop()}},s,this,[[3,15],[19,29]])}))}}]),e}();function rS(i,e,t){var n=0;i.rtp.some(function(r){return r.codec==="opus"&&(n=r.payload,!0)}),n>0&&(i.rtcpFb||(i.rtcpFb=[]),t.includes(i.mid)&&!i.rtcpFb.some(function(r){return r.payload===n&&r.type==="nack"})&&i.rtcpFb.push({payload:n,type:"nack"}),e.includes(i.mid)&&i.fmtp.some(function(r){return r.payload===n&&(r.config.includes("stereo=1")||(r.config+=";stereo=1"),!0)}))}function G9(i){var e,t,n=0;!((e=i.ext)===null||e===void 0)&&e.some(function(r){return r.uri===BT||(r.value>n&&(n=r.value),!1)})||(t=i.ext)===null||t===void 0||t.push({value:n+1,uri:BT})}function W9(i){var e,t=[],n=[],r=gs.parse((e=i.sdp)!==null&&e!==void 0?e:""),s=0;return r.media.forEach(function(a){var o;a.type==="audio"&&(a.rtp.some(function(c){return c.codec==="opus"&&(s=c.payload,!0)}),!((o=a.rtcpFb)===null||o===void 0)&&o.some(function(c){return c.payload===s&&c.type==="nack"})&&n.push(a.mid),a.fmtp.some(function(c){return c.payload===s&&(c.config.includes("sprop-stereo=1")&&t.push(a.mid),!0)}))}),{stereoMids:t,nackMids:n}}var an,Xm="vp8",K9={audioPreset:Rm.music,dtx:!0,red:!0,forceStereo:!1,simulcast:!0,screenShareEncoding:Bm.h1080fps15.encoding,stopMicTrackOnMute:!1,videoCodec:Xm,backupCodec:!0},sS={autoGainControl:!0,echoCancellation:!0,noiseSuppression:!0},aS={resolution:Fl.h720.resolution},X9={adaptiveStream:!1,dynacast:!1,stopLocalTrackOnUnpublish:!0,reconnectPolicy:new _9,disconnectOnPageLeave:!0,webAudioMix:!1},Ym={autoSubscribe:!0,maxRetries:1,peerConnectionTimeout:15e3,websocketTimeout:15e3};(function(i){i[i.NEW=0]="NEW",i[i.CONNECTING=1]="CONNECTING",i[i.CONNECTED=2]="CONNECTED",i[i.FAILED=3]="FAILED",i[i.CLOSING=4]="CLOSING",i[i.CLOSED=5]="CLOSED"})(an||(an={}));var Y9=function(){function i(e,t,n){var r,s=this;ht(this,i),this.peerConnectionTimeout=Ym.peerConnectionTimeout,this.log=xt,this.updateState=function(){var a,o=s.state,c=s.requiredTransports.map(function(u){return u.getConnectionState()});c.every(function(u){return u==="connected"})?s.state=an.CONNECTED:c.some(function(u){return u==="failed"})?s.state=an.FAILED:c.some(function(u){return u==="connecting"})?s.state=an.CONNECTING:c.every(function(u){return u==="closed"})?s.state=an.CLOSED:c.some(function(u){return u==="closed"})?s.state=an.CLOSING:c.every(function(u){return u==="new"})&&(s.state=an.NEW),o!==s.state&&(s.log.debug("pc state change: from ".concat(an[o]," to ").concat(an[s.state]),s.logContext),(a=s.onStateChange)===null||a===void 0||a.call(s,s.state,s.publisher.getConnectionState(),s.subscriber.getConnectionState()))},this.log=Lr((r=n.loggerName)!==null&&r!==void 0?r:Yi.PCManager),this.loggerOptions=n,this.isPublisherConnectionRequired=!t,this.isSubscriberConnectionRequired=t,this.publisher=new iS(e,n),this.subscriber=new iS(e,n),this.publisher.onConnectionStateChange=this.updateState,this.subscriber.onConnectionStateChange=this.updateState,this.publisher.onIceConnectionStateChange=this.updateState,this.subscriber.onIceConnectionStateChange=this.updateState,this.publisher.onSignalingStatechange=this.updateState,this.subscriber.onSignalingStatechange=this.updateState,this.publisher.onIceCandidate=function(a){var o;(o=s.onIceCandidate)===null||o===void 0||o.call(s,a,Xi.PUBLISHER)},this.subscriber.onIceCandidate=function(a){var o;(o=s.onIceCandidate)===null||o===void 0||o.call(s,a,Xi.SUBSCRIBER)},this.subscriber.onDataChannel=function(a){var o;(o=s.onDataChannel)===null||o===void 0||o.call(s,a)},this.subscriber.onTrack=function(a){var o;(o=s.onTrack)===null||o===void 0||o.call(s,a)},this.publisher.onOffer=function(a){var o;(o=s.onPublisherOffer)===null||o===void 0||o.call(s,a)},this.state=an.NEW,this.connectionLock=new yi,this.remoteOfferLock=new yi}return ft(i,[{key:"needsPublisher",get:function(){return this.isPublisherConnectionRequired}},{key:"needsSubscriber",get:function(){return this.isSubscriberConnectionRequired}},{key:"currentState",get:function(){return this.state}},{key:"logContext",get:function(){var e,t;return Object.assign({},(t=(e=this.loggerOptions).loggerContextCb)===null||t===void 0?void 0:t.call(e))}},{key:"requirePublisher",value:function(){var e=0>=arguments.length||arguments[0]===void 0||arguments[0];this.isPublisherConnectionRequired=e,this.updateState()}},{key:"requireSubscriber",value:function(){var e=0>=arguments.length||arguments[0]===void 0||arguments[0];this.isSubscriberConnectionRequired=e,this.updateState()}},{key:"createAndSendPublisherOffer",value:function(e){return this.publisher.createAndSendOffer(e)}},{key:"setPublisherAnswer",value:function(e){return this.publisher.setRemoteDescription(e)}},{key:"removeTrack",value:function(e){return this.publisher.removeTrack(e)}},{key:"close",value:function(){return he(this,void 0,void 0,F().mark(function e(){var t,n,r,s;return F().wrap(function(a){for(;;)switch(a.prev=a.next){case 0:if(this.publisher&&this.publisher.getSignallingState()!=="closed"){t=this.publisher,n=dt(t.getSenders());try{for(n.s();!(r=n.n()).done;){s=r.value;try{t.canRemoveTrack()&&t.removeTrack(s)}catch(o){this.log.warn("could not removeTrack",Object.assign(Object.assign({},this.logContext),{error:o}))}}}catch(o){n.e(o)}finally{n.f()}}return a.next=3,Promise.all([this.publisher.close(),this.subscriber.close()]);case 3:this.updateState();case 4:case"end":return a.stop()}},e,this)}))}},{key:"triggerIceRestart",value:function(){return he(this,void 0,void 0,F().mark(function e(){return F().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(this.subscriber.restartingIce=!0,!this.needsPublisher){t.next=4;break}return t.next=4,this.createAndSendPublisherOffer({iceRestart:!0});case 4:case"end":return t.stop()}},e,this)}))}},{key:"addIceCandidate",value:function(e,t){return he(this,void 0,void 0,F().mark(function n(){return F().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:if(t!==Xi.PUBLISHER){r.next=5;break}return r.next=3,this.publisher.addIceCandidate(e);case 3:r.next=7;break;case 5:return r.next=7,this.subscriber.addIceCandidate(e);case 7:case"end":return r.stop()}},n,this)}))}},{key:"createSubscriberAnswerFromOffer",value:function(e){return he(this,void 0,void 0,F().mark(function t(){var n,r;return F().wrap(function(s){for(;;)switch(s.prev=s.next){case 0:return this.log.debug("received server offer",Object.assign(Object.assign({},this.logContext),{RTCSdpType:e.type,sdp:e.sdp,signalingState:this.subscriber.getSignallingState().toString()})),s.next=3,this.remoteOfferLock.lock();case 3:return n=s.sent,s.prev=4,s.next=7,this.subscriber.setRemoteDescription(e);case 7:return s.next=9,this.subscriber.createAndSetAnswer();case 9:return r=s.sent,s.abrupt("return",r);case 11:return s.prev=11,n(),s.finish(11);case 14:case"end":return s.stop()}},t,this,[[4,,11,14]])}))}},{key:"updateConfiguration",value:function(e,t){this.publisher.setConfiguration(e),this.subscriber.setConfiguration(e),t&&this.triggerIceRestart()}},{key:"ensurePCTransportConnection",value:function(e,t){return he(this,void 0,void 0,F().mark(function n(){var r,s,a=this;return F().wrap(function(o){for(;;)switch(o.prev=o.next){case 0:return o.next=2,this.connectionLock.lock();case 2:return s=o.sent,o.prev=3,this.isPublisherConnectionRequired&&this.publisher.getConnectionState()!=="connected"&&this.publisher.getConnectionState()!=="connecting"&&(this.log.debug("negotiation required, start negotiating",this.logContext),this.publisher.negotiate()),o.next=7,Promise.all((r=this.requiredTransports)===null||r===void 0?void 0:r.map(function(c){return a.ensureTransportConnected(c,e,t)}));case 7:return o.prev=7,s(),o.finish(7);case 10:case"end":return o.stop()}},n,this,[[3,,7,10]])}))}},{key:"negotiate",value:function(e){return he(this,void 0,void 0,F().mark(function t(){var n=this;return F().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.abrupt("return",new Promise(function(s,a){return he(n,void 0,void 0,F().mark(function o(){var c,u,d=this;return F().wrap(function(h){for(;;)switch(h.prev=h.next){case 0:return c=setTimeout(function(){a("negotiation timed out")},this.peerConnectionTimeout),u=function(){clearTimeout(c),a("negotiation aborted")},e.signal.addEventListener("abort",u),this.publisher.once(eS,function(){e.signal.aborted||d.publisher.once(tS,function(){clearTimeout(c),s()})}),h.next=6,this.publisher.negotiate(function(b){clearTimeout(c),a(b)});case 6:case"end":return h.stop()}},o,this)}))}));case 1:case"end":return r.stop()}},t)}))}},{key:"addPublisherTransceiver",value:function(e,t){return this.publisher.addTransceiver(e,t)}},{key:"addPublisherTrack",value:function(e){return this.publisher.addTrack(e)}},{key:"createPublisherDataChannel",value:function(e,t){return this.publisher.createDataChannel(e,t)}},{key:"getConnectedAddress",value:function(e){return e===Xi.PUBLISHER||e===Xi.SUBSCRIBER?this.publisher.getConnectedAddress():this.requiredTransports[0].getConnectedAddress()}},{key:"requiredTransports",get:function(){var e=[];return this.isPublisherConnectionRequired&&e.push(this.publisher),this.isSubscriberConnectionRequired&&e.push(this.subscriber),e}},{key:"ensureTransportConnected",value:function(e,t){return he(this,arguments,void 0,function(n,r){var s=this,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.peerConnectionTimeout;return F().mark(function o(){return F().wrap(function(c){for(;;)switch(c.prev=c.next){case 0:if(n.getConnectionState()!=="connected"){c.next=3;break}return c.abrupt("return");case 3:return c.abrupt("return",new Promise(function(u,d){return he(s,void 0,void 0,F().mark(function h(){var b,v,y=this;return F().wrap(function(p){for(;;)switch(p.prev=p.next){case 0:b=function(){y.log.warn("abort transport connection",y.logContext),In.clearTimeout(v),d(new Wt("room connection has been cancelled",jn.Cancelled))},r!=null&&r.signal.aborted&&b(),r==null||r.signal.addEventListener("abort",b),v=In.setTimeout(function(){r==null||r.signal.removeEventListener("abort",b),d(new Wt("could not establish pc connection"))},a);case 4:if(this.state===an.CONNECTED){p.next=12;break}return p.next=7,yr(50);case 7:if(!(r!=null&&r.signal.aborted)){p.next=10;break}return d(new Wt("room connection has been cancelled",jn.Cancelled)),p.abrupt("return");case 10:p.next=4;break;case 12:In.clearTimeout(v),r==null||r.signal.removeEventListener("abort",b),u();case 15:case"end":return p.stop()}},h,this)}))}));case 4:case"end":return c.stop()}},o)})()})}}]),i}(),Jm=2e3;function wd(i,e){return e?("bytesReceived"in i?(t=i.bytesReceived,n=e.bytesReceived):"bytesSent"in i&&(t=i.bytesSent,n=e.bytesSent),t===void 0||n===void 0||i.timestamp===void 0||e.timestamp===void 0?0:8*(t-n)*1e3/(i.timestamp-e.timestamp)):0;var t,n}var Pn=function(i){function e(t,n){var r;ht(this,e);var s=2>=arguments.length||arguments[2]===void 0||arguments[2],a=arguments.length>3?arguments[3]:void 0,o=arguments.length>4?arguments[4]:void 0;return(r=Ut(this,e,[t,Me.Kind.Audio,n,s,o])).stopOnMute=!1,r.isKrispNoiseFilterEnabled=!1,r.monitorSender=function(){return he(ct(r),void 0,void 0,F().mark(function c(){var u;return F().wrap(function(d){for(;;)switch(d.prev=d.next){case 0:if(this.sender){d.next=3;break}return this._currentBitrate=0,d.abrupt("return");case 3:return d.prev=3,d.next=6,this.getSenderStats();case 6:u=d.sent,d.next=13;break;case 9:return d.prev=9,d.t0=d.catch(3),this.log.error("could not get audio sender stats",Object.assign(Object.assign({},this.logContext),{error:d.t0})),d.abrupt("return");case 13:u&&this.prevStats&&(this._currentBitrate=wd(u,this.prevStats)),this.prevStats=u;case 15:case"end":return d.stop()}},c,this,[[3,9]])}))},r.handleKrispNoiseFilterEnable=function(){r.isKrispNoiseFilterEnabled=!0,r.log.debug("Krisp noise filter enabled",r.logContext),r.emit(qe.AudioTrackFeatureUpdate,ct(r),mr.TF_ENHANCED_NOISE_CANCELLATION,!0)},r.handleKrispNoiseFilterDisable=function(){r.isKrispNoiseFilterEnabled=!1,r.log.debug("Krisp noise filter disabled",r.logContext),r.emit(qe.AudioTrackFeatureUpdate,ct(r),mr.TF_ENHANCED_NOISE_CANCELLATION,!1)},r.audioContext=a,r.checkForSilence(),r}return Ft(e,bo),ft(e,[{key:"enhancedNoiseCancellation",get:function(){return this.isKrispNoiseFilterEnabled}},{key:"setDeviceId",value:function(t){return he(this,void 0,void 0,F().mark(function n(){return F().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:if(this._constraints.deviceId!==t||this._mediaStreamTrack.getSettings().deviceId!==Fr(t)){r.next=2;break}return r.abrupt("return",!0);case 2:if(this._constraints.deviceId=t,this.isMuted){r.next=6;break}return r.next=6,this.restartTrack();case 6:return r.abrupt("return",this.isMuted||Fr(t)===this._mediaStreamTrack.getSettings().deviceId);case 7:case"end":return r.stop()}},n,this)}))}},{key:"mute",value:function(){var t=this,n=Object.create(null,{mute:{get:function(){return pt(lt(e.prototype),"mute",t)}}});return he(this,void 0,void 0,F().mark(function r(){var s;return F().wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return a.next=2,this.muteLock.lock();case 2:if(s=a.sent,a.prev=3,!this.isMuted){a.next=7;break}return this.log.debug("Track already muted",this.logContext),a.abrupt("return",this);case 7:return this.source===Me.Source.Microphone&&this.stopOnMute&&!this.isUserProvided&&(this.log.debug("stopping mic track",this.logContext),this._mediaStreamTrack.stop()),a.next=10,n.mute.call(this);case 10:return a.abrupt("return",this);case 11:return a.prev=11,s(),a.finish(11);case 14:case"end":return a.stop()}},r,this,[[3,,11,14]])}))}},{key:"unmute",value:function(){var t=this,n=Object.create(null,{unmute:{get:function(){return pt(lt(e.prototype),"unmute",t)}}});return he(this,void 0,void 0,F().mark(function r(){var s,a;return F().wrap(function(o){for(;;)switch(o.prev=o.next){case 0:return o.next=2,this.muteLock.lock();case 2:if(s=o.sent,o.prev=3,this.isMuted){o.next=7;break}return this.log.debug("Track already unmuted",this.logContext),o.abrupt("return",this);case 7:if(a=this._constraints.deviceId&&this._mediaStreamTrack.getSettings().deviceId!==Fr(this._constraints.deviceId),this.source!==Me.Source.Microphone||!this.stopOnMute&&this._mediaStreamTrack.readyState!=="ended"&&!a||this.isUserProvided){o.next=12;break}return this.log.debug("reacquiring mic track",this.logContext),o.next=12,this.restartTrack();case 12:return o.next=14,n.unmute.call(this);case 14:return o.abrupt("return",this);case 15:return o.prev=15,s(),o.finish(15);case 18:case"end":return o.stop()}},r,this,[[3,,15,18]])}))}},{key:"restartTrack",value:function(t){return he(this,void 0,void 0,F().mark(function n(){var r,s;return F().wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return t&&typeof(s=Sd({audio:t})).audio!="boolean"&&(r=s.audio),a.next=3,this.restart(r);case 3:case"end":return a.stop()}},n,this)}))}},{key:"restart",value:function(t){var n=this,r=Object.create(null,{restart:{get:function(){return pt(lt(e.prototype),"restart",n)}}});return he(this,void 0,void 0,F().mark(function s(){var a;return F().wrap(function(o){for(;;)switch(o.prev=o.next){case 0:return o.next=2,r.restart.call(this,t);case 2:return a=o.sent,this.checkForSilence(),o.abrupt("return",a);case 5:case"end":return o.stop()}},s,this)}))}},{key:"startMonitor",value:function(){var t=this;vi()&&(this.monitorInterval||(this.monitorInterval=setInterval(function(){t.monitorSender()},Jm)))}},{key:"setProcessor",value:function(t){return he(this,void 0,void 0,F().mark(function n(){var r,s,a;return F().wrap(function(o){for(;;)switch(o.prev=o.next){case 0:return o.next=2,this.processorLock.lock();case 2:if(s=o.sent,o.prev=3,this.audioContext){o.next=6;break}throw Error("Audio context needs to be set on LocalAudioTrack in order to enable processors");case 6:if(!this.processor){o.next=9;break}return o.next=9,this.stopProcessor();case 9:return a={kind:this.kind,track:this._mediaStreamTrack,audioContext:this.audioContext},this.log.debug("setting up audio processor ".concat(t.name),this.logContext),o.next=13,t.init(a);case 13:if(this.processor=t,!this.processor.processedTrack){o.next=19;break}return o.next=17,(r=this.sender)===null||r===void 0?void 0:r.replaceTrack(this.processor.processedTrack);case 17:this.processor.processedTrack.addEventListener("enable-lk-krisp-noise-filter",this.handleKrispNoiseFilterEnable),this.processor.processedTrack.addEventListener("disable-lk-krisp-noise-filter",this.handleKrispNoiseFilterDisable);case 19:this.emit(qe.TrackProcessorUpdate,this.processor);case 20:return o.prev=20,s(),o.finish(20);case 23:case"end":return o.stop()}},n,this,[[3,,20,23]])}))}},{key:"setAudioContext",value:function(t){this.audioContext=t}},{key:"getSenderStats",value:function(){return he(this,void 0,void 0,F().mark(function t(){var n,r;return F().wrap(function(s){for(;;)switch(s.prev=s.next){case 0:if(!((n=this.sender)===null||n===void 0)&&n.getStats){s.next=2;break}return s.abrupt("return",void 0);case 2:return s.next=4,this.sender.getStats();case 4:return s.sent.forEach(function(a){a.type==="outbound-rtp"&&(r={type:"audio",streamId:a.id,packetsSent:a.packetsSent,packetsLost:a.packetsLost,bytesSent:a.bytesSent,timestamp:a.timestamp,roundTripTime:a.roundTripTime,jitter:a.jitter})}),s.abrupt("return",r);case 7:case"end":return s.stop()}},t,this)}))}},{key:"checkForSilence",value:function(){return he(this,void 0,void 0,F().mark(function t(){var n;return F().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,N9(this);case 2:return(n=r.sent)&&(this.isMuted||this.log.warn("silence detected on local audio track",this.logContext),this.emit(qe.AudioSilenceDetected)),r.abrupt("return",n);case 5:case"end":return r.stop()}},t,this)}))}}]),e}();function oS(i,e,t){switch(i.kind){case"audio":return new Pn(i,e,!1,void 0,t);case"video":return new $n(i,e,!1,t);default:throw new vr("unsupported track type: ".concat(i.kind))}}var J9=Object.values(Fl),Q9=Object.values(Lm),Z9=Object.values(Bm),eR=[Fl.h180,Fl.h360],tR=[Lm.h180,Lm.h360],nR=function(i){return[{scaleResolutionDownBy:2,fps:i.encoding.maxFramerate}].map(function(e){var t,n;return new Vt(Math.floor(i.width/e.scaleResolutionDownBy),Math.floor(i.height/e.scaleResolutionDownBy),Math.max(15e4,Math.floor(i.encoding.maxBitrate/(Math.pow(e.scaleResolutionDownBy,2)*(((t=i.encoding.maxFramerate)!==null&&t!==void 0?t:30)/((n=e.fps)!==null&&n!==void 0?n:30))))),e.fps,i.encoding.priority)})},Qm=["q","h","f"];function Zm(i,e,t,n){var r,s,a=n==null?void 0:n.videoEncoding;i&&(a=n==null?void 0:n.screenShareEncoding);var o=n==null?void 0:n.simulcast,c=n==null?void 0:n.scalabilityMode,u=n==null?void 0:n.videoCodec;if(!a&&!o&&!c||!e||!t)return[{}];a||(a=function(D,w,A,x){for(var P=function(Q,ie,Y){if(Q)return Z9;var q=ie>Y?ie/Y:Y/ie;return Math.abs(q-16/9)<Math.abs(q-4/3)?J9:Q9}(D,w,A),S=P[0].encoding,M=Math.max(w,A),U=0;U<P.length;U+=1){var B=P[U];if(S=B.encoding,B.width>=M)break}if(x)switch(x){case"av1":(S=Object.assign({},S)).maxBitrate=.7*S.maxBitrate;break;case"vp9":(S=Object.assign({},S)).maxBitrate=.85*S.maxBitrate;break}return S}(i,e,t,u),xt.debug("using video encoding",a));var d=new Vt(e,t,a.maxBitrate,a.maxFramerate,a.priority);if(c&&jl(u)){var h=new uS(c),b=[];if(h.spatial>3)throw new Error("unsupported scalabilityMode: ".concat(c));var v=Br();if(ea()||Ur()||(v==null?void 0:v.name)==="Chrome"&&0>$l(v==null?void 0:v.version,"113")){for(var y=h.suffix=="h"?2:3,p=0;p<h.spatial;p+=1)b.push({rid:Qm[2-p],maxBitrate:a.maxBitrate/Math.pow(y,p),maxFramerate:d.encoding.maxFramerate});b[0].scalabilityMode=c}else b.push({maxBitrate:a.maxBitrate,maxFramerate:d.encoding.maxFramerate,scalabilityMode:c});return d.encoding.priority&&(b[0].priority=d.encoding.priority,b[0].networkPriority=d.encoding.priority),xt.debug("using svc encoding",{encodings:b}),b}if(!o)return[a];var f,m=[];if((m=i?(r=cS(n==null?void 0:n.screenShareSimulcastLayers))!==null&&r!==void 0?r:lS(i,d):(s=cS(n==null?void 0:n.videoSimulcastLayers))!==null&&s!==void 0?s:lS(i,d)).length>0){var _=m[0];m.length>1&&(f=Pt(m,2)[1]);var k=Math.max(e,t);if(k>=960&&f)return eg(e,t,[_,f,d]);if(k>=480)return eg(e,t,[_,d])}return eg(e,t,[d])}function iR(i,e,t){var n,r,s,a;if(t.backupCodec&&t.backupCodec!==!0&&t.backupCodec.codec!==t.videoCodec){e!==t.backupCodec.codec&&xt.warn("requested a different codec than specified as backup",{serverRequested:e,backup:t.backupCodec.codec}),t.videoCodec=e,t.videoEncoding=t.backupCodec.encoding;var o=i.mediaStreamTrack.getSettings(),c=(n=o.width)!==null&&n!==void 0?n:(r=i.dimensions)===null||r===void 0?void 0:r.width,u=(s=o.height)!==null&&s!==void 0?s:(a=i.dimensions)===null||a===void 0?void 0:a.height;return Zm(i.source===Me.Source.ScreenShare,c,u,t)}}function lS(i,e){if(i)return nR(e);var t=e.width,n=e.height,r=t>n?t/n:n/t;return Math.abs(r-16/9)<Math.abs(r-4/3)?eR:tR}function eg(i,e,t){var n=[];if(t.forEach(function(a,o){if(o<Qm.length){var c=Math.min(i,e),u={rid:Qm[o],scaleResolutionDownBy:Math.max(1,c/Math.min(a.width,a.height)),maxBitrate:a.encoding.maxBitrate};a.encoding.maxFramerate&&(u.maxFramerate=a.encoding.maxFramerate);var d=yo()||o===0;a.encoding.priority&&d&&(u.priority=a.encoding.priority,u.networkPriority=a.encoding.priority),n.push(u)}}),Ur()&&VT()==="ios"){var r=void 0;n.forEach(function(a){r?a.maxFramerate&&a.maxFramerate>r&&(r=a.maxFramerate):r=a.maxFramerate});var s=!0;n.forEach(function(a){var o;a.maxFramerate!=r&&(s&&(s=!1,xt.info("Simulcast on iOS React-Native requires all encodings to share the same framerate.")),xt.info('Setting framerate of encoding "'.concat((o=a.rid)!==null&&o!==void 0?o:"",'" to ').concat(r)),a.maxFramerate=r)})}return n}function cS(i){if(i)return i.sort(function(e,t){var n=e.encoding,r=t.encoding;return n.maxBitrate>r.maxBitrate?1:n.maxBitrate<r.maxBitrate?-1:n.maxBitrate===r.maxBitrate&&n.maxFramerate&&r.maxFramerate?n.maxFramerate>r.maxFramerate?1:-1:0})}var uS=function(){function i(e){ht(this,i);var t=e.match(/^L(\d)T(\d)(h|_KEY|_KEY_SHIFT){0,1}$/);if(!t)throw new Error("invalid scalability mode");if(this.spatial=parseInt(t[1]),this.temporal=parseInt(t[2]),t.length>3)switch(t[3]){case"h":case"_KEY":case"_KEY_SHIFT":this.suffix=t[3]}}return ft(i,[{key:"toString",value:function(){var e;return"L".concat(this.spatial,"T").concat(this.temporal).concat((e=this.suffix)!==null&&e!==void 0?e:"")}}]),i}();function rR(i){return i.source===Me.Source.ScreenShare||i.constraints.height&&Fr(i.constraints.height)>=1080?"maintain-resolution":"balanced"}var $n=function(i){function e(t,n){var r;ht(this,e);var s=2>=arguments.length||arguments[2]===void 0||arguments[2],a=arguments.length>3?arguments[3]:void 0;return(r=Ut(this,e,[t,Me.Kind.Video,n,s,a])).simulcastCodecs=new Map,r.degradationPreference="balanced",r.monitorSender=function(){return he(ct(r),void 0,void 0,F().mark(function o(){var c,u,d,h=this;return F().wrap(function(b){for(;;)switch(b.prev=b.next){case 0:if(this.sender){b.next=3;break}return this._currentBitrate=0,b.abrupt("return");case 3:return b.prev=3,b.next=6,this.getSenderStats();case 6:c=b.sent,b.next=13;break;case 9:return b.prev=9,b.t0=b.catch(3),this.log.error("could not get audio sender stats",Object.assign(Object.assign({},this.logContext),{error:b.t0})),b.abrupt("return");case 13:u=new Map(c.map(function(v){return[v.rid,v]})),this.prevStats&&(d=0,u.forEach(function(v,y){var p,f=(p=h.prevStats)===null||p===void 0?void 0:p.get(y);d+=wd(v,f)}),this._currentBitrate=d),this.prevStats=u;case 16:case"end":return b.stop()}},o,this,[[3,9]])}))},r.senderLock=new yi,r}return Ft(e,bo),ft(e,[{key:"sender",get:function(){return this._sender},set:function(t){this._sender=t,this.degradationPreference&&this.setDegradationPreference(this.degradationPreference)}},{key:"isSimulcast",get:function(){return!(!this.sender||1>=this.sender.getParameters().encodings.length)}},{key:"startMonitor",value:function(t){var n,r=this;if(this.signalClient=t,vi()){var s=(n=this.sender)===null||n===void 0?void 0:n.getParameters();s&&(this.encodings=s.encodings),this.monitorInterval||(this.monitorInterval=setInterval(function(){r.monitorSender()},Jm))}}},{key:"stop",value:function(){this._mediaStreamTrack.getConstraints(),this.simulcastCodecs.forEach(function(t){t.mediaStreamTrack.stop()}),pt(lt(e.prototype),"stop",this).call(this)}},{key:"pauseUpstream",value:function(){var t=this,n=Object.create(null,{pauseUpstream:{get:function(){return pt(lt(e.prototype),"pauseUpstream",t)}}});return he(this,void 0,void 0,F().mark(function r(){var s,a,o,c,u,d,h,b,v;return F().wrap(function(y){for(;;)switch(y.prev=y.next){case 0:return y.next=2,n.pauseUpstream.call(this);case 2:y.prev=2,d=!0,h=po(this.simulcastCodecs.values());case 4:return y.next=6,h.next();case 6:if(b=y.sent,s=b.done){y.next=17;break}return c=b.value,d=!1,v=c,y.next=14,(u=v.sender)===null||u===void 0?void 0:u.replaceTrack(null);case 14:d=!0,y.next=4;break;case 17:y.next=22;break;case 19:y.prev=19,y.t0=y.catch(2),a={error:y.t0};case 22:if(y.prev=22,y.prev=23,d||s||!(o=h.return)){y.next=27;break}return y.next=27,o.call(h);case 27:if(y.prev=27,!a){y.next=30;break}throw a.error;case 30:return y.finish(27);case 31:return y.finish(22);case 32:case"end":return y.stop()}},r,this,[[2,19,22,32],[23,,27,31]])}))}},{key:"resumeUpstream",value:function(){var t=this,n=Object.create(null,{resumeUpstream:{get:function(){return pt(lt(e.prototype),"resumeUpstream",t)}}});return he(this,void 0,void 0,F().mark(function r(){var s,a,o,c,u,d,h,b,v;return F().wrap(function(y){for(;;)switch(y.prev=y.next){case 0:return y.next=2,n.resumeUpstream.call(this);case 2:y.prev=2,d=!0,h=po(this.simulcastCodecs.values());case 4:return y.next=6,h.next();case 6:if(b=y.sent,s=b.done){y.next=17;break}return c=b.value,d=!1,v=c,y.next=14,(u=v.sender)===null||u===void 0?void 0:u.replaceTrack(v.mediaStreamTrack);case 14:d=!0,y.next=4;break;case 17:y.next=22;break;case 19:y.prev=19,y.t0=y.catch(2),a={error:y.t0};case 22:if(y.prev=22,y.prev=23,d||s||!(o=h.return)){y.next=27;break}return y.next=27,o.call(h);case 27:if(y.prev=27,!a){y.next=30;break}throw a.error;case 30:return y.finish(27);case 31:return y.finish(22);case 32:case"end":return y.stop()}},r,this,[[2,19,22,32],[23,,27,31]])}))}},{key:"mute",value:function(){var t=this,n=Object.create(null,{mute:{get:function(){return pt(lt(e.prototype),"mute",t)}}});return he(this,void 0,void 0,F().mark(function r(){var s;return F().wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return a.next=2,this.muteLock.lock();case 2:if(s=a.sent,a.prev=3,!this.isMuted){a.next=7;break}return this.log.debug("Track already muted",this.logContext),a.abrupt("return",this);case 7:return this.source!==Me.Source.Camera||this.isUserProvided||(this.log.debug("stopping camera track",this.logContext),this._mediaStreamTrack.stop()),a.next=10,n.mute.call(this);case 10:return a.abrupt("return",this);case 11:return a.prev=11,s(),a.finish(11);case 14:case"end":return a.stop()}},r,this,[[3,,11,14]])}))}},{key:"unmute",value:function(){var t=this,n=Object.create(null,{unmute:{get:function(){return pt(lt(e.prototype),"unmute",t)}}});return he(this,void 0,void 0,F().mark(function r(){var s;return F().wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return a.next=2,this.muteLock.lock();case 2:if(s=a.sent,a.prev=3,this.isMuted){a.next=7;break}return this.log.debug("Track already unmuted",this.logContext),a.abrupt("return",this);case 7:if(this.source!==Me.Source.Camera||this.isUserProvided){a.next=11;break}return this.log.debug("reacquiring camera track",this.logContext),a.next=11,this.restartTrack();case 11:return a.next=13,n.unmute.call(this);case 13:return a.abrupt("return",this);case 14:return a.prev=14,s(),a.finish(14);case 17:case"end":return a.stop()}},r,this,[[3,,14,17]])}))}},{key:"setTrackMuted",value:function(t){pt(lt(e.prototype),"setTrackMuted",this).call(this,t);var n,r=dt(this.simulcastCodecs.values());try{for(r.s();!(n=r.n()).done;)n.value.mediaStreamTrack.enabled=!t}catch(s){r.e(s)}finally{r.f()}}},{key:"getSenderStats",value:function(){return he(this,void 0,void 0,F().mark(function t(){var n,r,s;return F().wrap(function(a){for(;;)switch(a.prev=a.next){case 0:if(!((n=this.sender)===null||n===void 0)&&n.getStats){a.next=2;break}return a.abrupt("return",[]);case 2:return r=[],a.next=5,this.sender.getStats();case 5:return(s=a.sent).forEach(function(o){var c;if(o.type==="outbound-rtp"){var u={type:"video",streamId:o.id,frameHeight:o.frameHeight,frameWidth:o.frameWidth,framesPerSecond:o.framesPerSecond,framesSent:o.framesSent,firCount:o.firCount,pliCount:o.pliCount,nackCount:o.nackCount,packetsSent:o.packetsSent,bytesSent:o.bytesSent,qualityLimitationReason:o.qualityLimitationReason,qualityLimitationDurations:o.qualityLimitationDurations,qualityLimitationResolutionChanges:o.qualityLimitationResolutionChanges,rid:(c=o.rid)!==null&&c!==void 0?c:o.id,retransmittedPacketsSent:o.retransmittedPacketsSent,targetBitrate:o.targetBitrate,timestamp:o.timestamp},d=s.get(o.remoteId);d&&(u.jitter=d.jitter,u.packetsLost=d.packetsLost,u.roundTripTime=d.roundTripTime),r.push(u)}}),r.sort(function(o,c){var u,d;return((u=c.frameWidth)!==null&&u!==void 0?u:0)-((d=o.frameWidth)!==null&&d!==void 0?d:0)}),a.abrupt("return",r);case 9:case"end":return a.stop()}},t,this)}))}},{key:"setPublishingQuality",value:function(t){for(var n=[],r=Oi.LOW;r<=Oi.HIGH;r+=1)n.push(new bm({quality:r,enabled:t>=r}));this.log.debug("setting publishing quality. max quality ".concat(t),this.logContext),this.setPublishingLayers(n)}},{key:"setDeviceId",value:function(t){return he(this,void 0,void 0,F().mark(function n(){return F().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:if(this._constraints.deviceId!==t||this._mediaStreamTrack.getSettings().deviceId!==Fr(t)){r.next=2;break}return r.abrupt("return",!0);case 2:if(this._constraints.deviceId=t,this.isMuted){r.next=6;break}return r.next=6,this.restartTrack();case 6:return r.abrupt("return",this.isMuted||Fr(t)===this._mediaStreamTrack.getSettings().deviceId);case 7:case"end":return r.stop()}},n,this)}))}},{key:"restartTrack",value:function(t){return he(this,void 0,void 0,F().mark(function n(){var r,s,a,o,c,u,d,h,b,v;return F().wrap(function(y){for(;;)switch(y.prev=y.next){case 0:return t&&typeof(u=Sd({video:t})).video!="boolean"&&(c=u.video),y.next=3,this.restart(c);case 3:y.prev=3,d=!0,h=po(this.simulcastCodecs.values());case 5:return y.next=7,h.next();case 7:if(b=y.sent,r=b.done){y.next=20;break}if(o=b.value,d=!1,!(v=o).sender){y.next=17;break}return v.mediaStreamTrack=this.mediaStreamTrack.clone(),y.next=17,v.sender.replaceTrack(v.mediaStreamTrack);case 17:d=!0,y.next=5;break;case 20:y.next=25;break;case 22:y.prev=22,y.t0=y.catch(3),s={error:y.t0};case 25:if(y.prev=25,y.prev=26,d||r||!(a=h.return)){y.next=30;break}return y.next=30,a.call(h);case 30:if(y.prev=30,!s){y.next=33;break}throw s.error;case 33:return y.finish(30);case 34:return y.finish(25);case 35:case"end":return y.stop()}},n,this,[[3,22,25,35],[26,,30,34]])}))}},{key:"setProcessor",value:function(t){var n=this,r=Object.create(null,{setProcessor:{get:function(){return pt(lt(e.prototype),"setProcessor",n)}}});return he(this,arguments,void 0,function(s){var a=this,o=1>=arguments.length||arguments[1]===void 0||arguments[1];return F().mark(function c(){var u,d,h,b,v,y,p,f,m,_;return F().wrap(function(k){for(;;)switch(k.prev=k.next){case 0:return k.next=2,r.setProcessor.call(a,s,o);case 2:if(!(!((v=a.processor)===null||v===void 0)&&v.processedTrack)){k.next=33;break}k.prev=3,p=!0,f=po(a.simulcastCodecs.values());case 5:return k.next=7,f.next();case 7:if(m=k.sent,u=m.done){k.next=18;break}return b=m.value,p=!1,_=b,k.next=15,(y=_.sender)===null||y===void 0?void 0:y.replaceTrack(a.processor.processedTrack);case 15:p=!0,k.next=5;break;case 18:k.next=23;break;case 20:k.prev=20,k.t0=k.catch(3),d={error:k.t0};case 23:if(k.prev=23,k.prev=24,p||u||!(h=f.return)){k.next=28;break}return k.next=28,h.call(f);case 28:if(k.prev=28,!d){k.next=31;break}throw d.error;case 31:return k.finish(28);case 32:return k.finish(23);case 33:case"end":return k.stop()}},c,null,[[3,20,23,33],[24,,28,32]])})()})}},{key:"setDegradationPreference",value:function(t){return he(this,void 0,void 0,F().mark(function n(){var r;return F().wrap(function(s){for(;;)switch(s.prev=s.next){case 0:if(this.degradationPreference=t,this.sender)try{this.log.debug("setting degradationPreference to ".concat(t),this.logContext),(r=this.sender.getParameters()).degradationPreference=t,this.sender.setParameters(r)}catch(a){this.log.warn("failed to set degradationPreference",Object.assign({error:a},this.logContext))}case 2:case"end":return s.stop()}},n,this)}))}},{key:"addSimulcastTrack",value:function(t,n){if(!this.simulcastCodecs.has(t)){var r={codec:t,mediaStreamTrack:this.mediaStreamTrack.clone(),sender:void 0,encodings:n};return this.simulcastCodecs.set(t,r),r}this.log.error("".concat(t," already added, skipping adding simulcast codec"),this.logContext)}},{key:"setSimulcastTrackSender",value:function(t,n){var r=this,s=this.simulcastCodecs.get(t);s&&(s.sender=n,setTimeout(function(){r.subscribedCodecs&&r.setPublishingCodecs(r.subscribedCodecs)},5e3))}},{key:"setPublishingCodecs",value:function(t){return he(this,void 0,void 0,F().mark(function n(){var r,s,a,o,c,u,d,h,b,v,y,p;return F().wrap(function(f){for(;;)switch(f.prev=f.next){case 0:if(this.log.debug("setting publishing codecs",Object.assign(Object.assign({},this.logContext),{codecs:t,currentCodec:this.codec})),this.codec||0>=t.length){f.next=5;break}return f.next=4,this.setPublishingLayers(t[0].qualities);case 4:return f.abrupt("return",[]);case 5:this.subscribedCodecs=t,h=[],f.prev=7,r=!0,s=po(t);case 9:return f.next=11,s.next();case 11:if(a=f.sent,o=a.done){f.next=52;break}if(d=a.value,r=!1,b=d,this.codec&&this.codec!==b.codec){f.next=22;break}return f.next=20,this.setPublishingLayers(b.qualities);case 20:f.next=49;break;case 22:if(v=this.simulcastCodecs.get(b.codec),this.log.debug("try setPublishingCodec for ".concat(b.codec),Object.assign(Object.assign({},this.logContext),{simulcastCodecInfo:v})),v&&v.sender){f.next=45;break}y=dt(b.qualities),f.prev=26,y.s();case 28:if((p=y.n()).done){f.next=35;break}if(!p.value.enabled){f.next=33;break}return h.push(b.codec),f.abrupt("break",35);case 33:f.next=28;break;case 35:f.next=40;break;case 37:f.prev=37,f.t0=f.catch(26),y.e(f.t0);case 40:return f.prev=40,y.f(),f.finish(40);case 43:f.next=49;break;case 45:if(!v.encodings){f.next=49;break}return this.log.debug("try setPublishingLayersForSender ".concat(b.codec),this.logContext),f.next=49,dS(v.sender,v.encodings,b.qualities,this.senderLock,this.log,this.logContext);case 49:r=!0,f.next=9;break;case 52:f.next=57;break;case 54:f.prev=54,f.t1=f.catch(7),c={error:f.t1};case 57:if(f.prev=57,f.prev=58,r||o||!(u=s.return)){f.next=62;break}return f.next=62,u.call(s);case 62:if(f.prev=62,!c){f.next=65;break}throw c.error;case 65:return f.finish(62);case 66:return f.finish(57);case 67:return f.abrupt("return",h);case 68:case"end":return f.stop()}},n,this,[[7,54,57,67],[26,37,40,43],[58,,62,66]])}))}},{key:"setPublishingLayers",value:function(t){return he(this,void 0,void 0,F().mark(function n(){return F().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:if(this.log.debug("setting publishing layers",Object.assign(Object.assign({},this.logContext),{qualities:t})),this.sender&&this.encodings){r.next=3;break}return r.abrupt("return");case 3:return r.next=5,dS(this.sender,this.encodings,t,this.senderLock,this.log,this.logContext);case 5:case"end":return r.stop()}},n,this)}))}},{key:"handleAppVisibilityChanged",value:function(){var t=this,n=Object.create(null,{handleAppVisibilityChanged:{get:function(){return pt(lt(e.prototype),"handleAppVisibilityChanged",t)}}});return he(this,void 0,void 0,F().mark(function r(){return F().wrap(function(s){for(;;)switch(s.prev=s.next){case 0:return s.next=2,n.handleAppVisibilityChanged.call(this);case 2:if(UT()){s.next=4;break}return s.abrupt("return");case 4:this.isInBackground&&this.source===Me.Source.Camera&&(this._mediaStreamTrack.enabled=!1);case 5:case"end":return s.stop()}},r,this)}))}}]),e}();function dS(i,e,t,n,r,s){return he(this,void 0,void 0,F().mark(function a(){var o,c,u,d;return F().wrap(function(h){for(;;)switch(h.prev=h.next){case 0:return h.next=2,n.lock();case 2:if(o=h.sent,r.debug("setPublishingLayersForSender",Object.assign(Object.assign({},s),{sender:i,qualities:t,senderEncodings:e})),h.prev=4,c=i.getParameters(),u=c.encodings){h.next=9;break}return h.abrupt("return");case 9:if(u.length===e.length){h.next=12;break}return r.warn("cannot set publishing layers, encodings mismatch",Object.assign(Object.assign({},s),{encodings:u,senderEncodings:e})),h.abrupt("return");case 12:if(d=!1,u.forEach(function(b,v){var y,p=(y=b.rid)!==null&&y!==void 0?y:"";p===""&&(p="q");var f=hS(p),m=t.find(function(_){return _.quality===f});m&&b.active!==m.enabled&&(d=!0,b.active=m.enabled,r.debug("setting layer ".concat(m.quality," to ").concat(b.active?"enabled":"disabled"),s),yo()&&(m.enabled?(b.scaleResolutionDownBy=e[v].scaleResolutionDownBy,b.maxBitrate=e[v].maxBitrate,b.maxFrameRate=e[v].maxFrameRate):(b.scaleResolutionDownBy=4,b.maxBitrate=10,b.maxFrameRate=2)))}),!d){h.next=20;break}return c.encodings=u,r.debug("setting encodings",Object.assign(Object.assign({},s),{encodings:c.encodings})),h.next=20,i.setParameters(c);case 20:return h.prev=20,o(),h.finish(20);case 23:case"end":return h.stop()}},a,null,[[4,,20,23]])}))}function hS(i){switch(i){case"f":return Oi.HIGH;case"h":return Oi.MEDIUM;case"q":return Oi.LOW;default:return Oi.HIGH}}function fS(i,e,t,n){if(!t)return[new Xs({quality:Oi.HIGH,width:i,height:e,bitrate:0,ssrc:0})];if(n){for(var r=t[0].scalabilityMode,s=new uS(r),a=[],o=s.suffix=="h"?1.5:2,c=s.suffix=="h"?2:3,u=0;u<s.spatial;u+=1)a.push(new Xs({quality:Math.min(Oi.HIGH,s.spatial-1)-u,width:Math.ceil(i/Math.pow(o,u)),height:Math.ceil(e/Math.pow(o,u)),bitrate:t[0].maxBitrate?Math.ceil(t[0].maxBitrate/Math.pow(c,u)):0,ssrc:0}));return a}return t.map(function(d){var h,b,v,y=(h=d.scaleResolutionDownBy)!==null&&h!==void 0?h:1,p=hS((b=d.rid)!==null&&b!==void 0?b:"");return new Xs({quality:p,width:Math.ceil(i/y),height:Math.ceil(e/y),bitrate:(v=d.maxBitrate)!==null&&v!==void 0?v:0,ssrc:0})})}var Ji,pS="_lossy",mS="_reliable",tg="leave-reconnect";(function(i){i[i.New=0]="New",i[i.Connected=1]="Connected",i[i.Disconnected=2]="Disconnected",i[i.Reconnecting=3]="Reconnecting",i[i.Closed=4]="Closed"})(Ji||(Ji={}));var sR=function(i){function e(t){var n,r;return ht(this,e),(n=Ut(this,e)).options=t,n.rtcConfig={},n.peerConnectionTimeout=Ym.peerConnectionTimeout,n.fullReconnectOnNext=!1,n.subscriberPrimary=!1,n.pcState=Ji.New,n._isClosed=!0,n.pendingTrackResolvers={},n.reconnectAttempts=0,n.reconnectStart=0,n.attemptingReconnect=!1,n.joinAttempts=0,n.maxJoinAttempts=1,n.shouldFailNext=!1,n.log=xt,n.handleDataChannel=function(s){return he(ct(n),[s],void 0,function(a){var o=this,c=a.channel;return F().mark(function u(){return F().wrap(function(d){for(;;)switch(d.prev=d.next){case 0:if(c){d.next=2;break}return d.abrupt("return");case 2:if(c.label!==mS){d.next=6;break}o.reliableDCSub=c,d.next=11;break;case 6:if(c.label!==pS){d.next=10;break}o.lossyDCSub=c,d.next=11;break;case 10:return d.abrupt("return");case 11:o.log.debug("on data channel ".concat(c.id,", ").concat(c.label),o.logContext),c.onmessage=o.handleDataMessage;case 13:case"end":return d.stop()}},u)})()})},n.handleDataMessage=function(s){return he(ct(n),void 0,void 0,F().mark(function a(){var o,c,u,d,h;return F().wrap(function(b){for(;;)switch(b.prev=b.next){case 0:return b.next=2,this.dataProcessLock.lock();case 2:if(u=b.sent,b.prev=3,!(s.data instanceof ArrayBuffer)){b.next=8;break}d=s.data,b.next=16;break;case 8:if(!(s.data instanceof Blob)){b.next=14;break}return b.next=11,s.data.arrayBuffer();case 11:d=b.sent,b.next=16;break;case 14:return this.log.error("unsupported data type",Object.assign(Object.assign({},this.logContext),{data:s.data})),b.abrupt("return");case 16:h=Ll.fromBinary(new Uint8Array(d)),((o=h.value)===null||o===void 0?void 0:o.case)==="speaker"?this.emit(Ze.ActiveSpeakersUpdate,h.value.value.speakers):(((c=h.value)===null||c===void 0?void 0:c.case)==="user"&&aR(h,h.value.value),this.emit(Ze.DataPacketReceived,h));case 18:return b.prev=18,u(),b.finish(18);case 21:case"end":return b.stop()}},a,this,[[3,,18,21]])}))},n.handleDataError=function(s){var a=s.currentTarget.maxRetransmits===0?"lossy":"reliable";if(s instanceof ErrorEvent&&s.error){var o=s.error.error;n.log.error("DataChannel error on ".concat(a,": ").concat(s.message),Object.assign(Object.assign({},n.logContext),{error:o}))}else n.log.error("Unknown DataChannel error on ".concat(a),Object.assign(Object.assign({},n.logContext),{event:s}))},n.handleBufferedAmountLow=function(s){var a=s.currentTarget.maxRetransmits===0?yn.LOSSY:yn.RELIABLE;n.updateAndEmitDCBufferStatus(a)},n.handleDisconnect=function(s,a){if(!n._isClosed){n.log.warn("".concat(s," disconnected"),n.logContext),n.reconnectAttempts===0&&(n.reconnectStart=Date.now());var o=Date.now()-n.reconnectStart,c=n.getNextRetryDelay({elapsedMs:o,retryCount:n.reconnectAttempts});c!==null?(s===tg&&(c=0),n.log.debug("reconnecting in ".concat(c,"ms"),n.logContext),n.clearReconnectTimeout(),n.token&&n.regionUrlProvider&&n.regionUrlProvider.updateToken(n.token),n.reconnectTimeout=In.setTimeout(function(){return n.attemptReconnect(a).finally(function(){return n.reconnectTimeout=void 0})},c)):function(u){n.log.warn("could not recover connection after ".concat(n.reconnectAttempts," attempts, ").concat(u,"ms. giving up"),n.logContext),n.emit(Ze.Disconnected),n.close()}(o)}},n.waitForRestarted=function(){return new Promise(function(s,a){n.pcState===Ji.Connected&&s();var o=function(){n.off(Ze.Disconnected,c),s()},c=function(){n.off(Ze.Restarted,o),a()};n.once(Ze.Restarted,o),n.once(Ze.Disconnected,c)})},n.updateAndEmitDCBufferStatus=function(s){var a=n.isBufferStatusLow(s);a!==void 0&&a!==n.dcBufferStatus.get(s)&&(n.dcBufferStatus.set(s,a),n.emit(Ze.DCBufferStatusChanged,a,s))},n.isBufferStatusLow=function(s){var a=n.dataChannelForKind(s);if(a)return a.bufferedAmount<=a.bufferedAmountLowThreshold},n.handleBrowserOnLine=function(){n.client.currentState===Jt.RECONNECTING&&(n.clearReconnectTimeout(),n.attemptReconnect(uo.RR_SIGNAL_DISCONNECTED))},n.log=Lr((r=t.loggerName)!==null&&r!==void 0?r:Yi.Engine),n.loggerOptions={loggerName:t.loggerName,loggerContextCb:function(){return n.logContext}},n.client=new H9(void 0,n.loggerOptions),n.client.signalLatency=n.options.expSignalLatency,n.reconnectPolicy=n.options.reconnectPolicy,n.registerOnLineListener(),n.closingLock=new yi,n.dataProcessLock=new yi,n.dcBufferStatus=new Map([[yn.LOSSY,!0],[yn.RELIABLE,!0]]),n.client.onParticipantUpdate=function(s){return n.emit(Ze.ParticipantUpdate,s)},n.client.onConnectionQuality=function(s){return n.emit(Ze.ConnectionQualityUpdate,s)},n.client.onRoomUpdate=function(s){return n.emit(Ze.RoomUpdate,s)},n.client.onSubscriptionError=function(s){return n.emit(Ze.SubscriptionError,s)},n.client.onSubscriptionPermissionUpdate=function(s){return n.emit(Ze.SubscriptionPermissionUpdate,s)},n.client.onSpeakersChanged=function(s){return n.emit(Ze.SpeakersChanged,s)},n.client.onStreamStateUpdate=function(s){return n.emit(Ze.StreamStateChanged,s)},n.client.onRequestResponse=function(s){return n.emit(Ze.SignalRequestResponse,s)},n}return Ft(e,Js.EventEmitter),ft(e,[{key:"isClosed",get:function(){return this._isClosed}},{key:"pendingReconnect",get:function(){return!!this.reconnectTimeout}},{key:"logContext",get:function(){var t,n,r,s,a,o,c,u;return{room:(n=(t=this.latestJoinResponse)===null||t===void 0?void 0:t.room)===null||n===void 0?void 0:n.name,roomID:(s=(r=this.latestJoinResponse)===null||r===void 0?void 0:r.room)===null||s===void 0?void 0:s.sid,participant:(o=(a=this.latestJoinResponse)===null||a===void 0?void 0:a.participant)===null||o===void 0?void 0:o.identity,pID:(u=(c=this.latestJoinResponse)===null||c===void 0?void 0:c.participant)===null||u===void 0?void 0:u.sid}}},{key:"join",value:function(t,n,r,s){return he(this,void 0,void 0,F().mark(function a(){var o;return F().wrap(function(c){for(;;)switch(c.prev=c.next){case 0:return this.url=t,this.token=n,this.signalOpts=r,this.maxJoinAttempts=r.maxRetries,c.prev=4,this.joinAttempts+=1,this.setupSignalClientCallbacks(),c.next=9,this.client.join(t,n,r,s);case 9:if(o=c.sent,this._isClosed=!1,this.latestJoinResponse=o,this.subscriberPrimary=o.subscriberPrimary,this.pcManager){c.next=16;break}return c.next=16,this.configure(o);case 16:return this.subscriberPrimary&&!o.fastPublish||this.negotiate(),this.clientConfiguration=o.clientConfiguration,c.abrupt("return",o);case 21:if(c.prev=21,c.t0=c.catch(4),!(c.t0 instanceof Wt)){c.next=28;break}if(c.t0.reason!==jn.ServerUnreachable){c.next=28;break}if(this.log.warn("Couldn't connect to server, attempt ".concat(this.joinAttempts," of ").concat(this.maxJoinAttempts),this.logContext),this.joinAttempts>=this.maxJoinAttempts){c.next=28;break}return c.abrupt("return",this.join(t,n,r,s));case 28:throw c.t0;case 29:case"end":return c.stop()}},a,this,[[4,21]])}))}},{key:"close",value:function(){return he(this,void 0,void 0,F().mark(function t(){var n;return F().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,this.closingLock.lock();case 2:if(n=r.sent,!this.isClosed){r.next=6;break}return n(),r.abrupt("return");case 6:return r.prev=6,this._isClosed=!0,this.emit(Ze.Closing),this.removeAllListeners(),this.deregisterOnLineListener(),this.clearPendingReconnect(),r.next=14,this.cleanupPeerConnections();case 14:return r.next=16,this.cleanupClient();case 16:return r.prev=16,n(),r.finish(16);case 19:case"end":return r.stop()}},t,this,[[6,,16,19]])}))}},{key:"cleanupPeerConnections",value:function(){return he(this,void 0,void 0,F().mark(function t(){var n,r;return F().wrap(function(s){for(;;)switch(s.prev=s.next){case 0:return s.next=2,(n=this.pcManager)===null||n===void 0?void 0:n.close();case 2:this.pcManager=void 0,(r=function(a){a&&(a.close(),a.onbufferedamountlow=null,a.onclose=null,a.onclosing=null,a.onerror=null,a.onmessage=null,a.onopen=null)})(this.lossyDC),r(this.lossyDCSub),r(this.reliableDC),r(this.reliableDCSub),this.lossyDC=void 0,this.lossyDCSub=void 0,this.reliableDC=void 0,this.reliableDCSub=void 0;case 12:case"end":return s.stop()}},t,this)}))}},{key:"cleanupClient",value:function(){return he(this,void 0,void 0,F().mark(function t(){return F().wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,this.client.close();case 2:this.client.resetCallbacks();case 3:case"end":return n.stop()}},t,this)}))}},{key:"addTrack",value:function(t){var n=this;if(this.pendingTrackResolvers[t.cid])throw new vr("a track with the same ID has already been published");return new Promise(function(r,s){var a=setTimeout(function(){delete n.pendingTrackResolvers[t.cid],s(new Wt("publication of local track timed out, no response from server"))},1e4);n.pendingTrackResolvers[t.cid]={resolve:function(o){clearTimeout(a),r(o)},reject:function(){clearTimeout(a),s(new Error("Cancelled publication by calling unpublish"))}},n.client.sendAddTrack(t)})}},{key:"removeTrack",value:function(t){if(t.track&&this.pendingTrackResolvers[t.track.id]){var n=this.pendingTrackResolvers[t.track.id].reject;n&&n(),delete this.pendingTrackResolvers[t.track.id]}try{return this.pcManager.removeTrack(t),!0}catch(r){this.log.warn("failed to remove track",Object.assign(Object.assign({},this.logContext),{error:r}))}return!1}},{key:"updateMuteStatus",value:function(t,n){this.client.sendMuteTrack(t,n)}},{key:"dataSubscriberReadyState",get:function(){var t;return(t=this.reliableDCSub)===null||t===void 0?void 0:t.readyState}},{key:"getConnectedServerAddress",value:function(){return he(this,void 0,void 0,F().mark(function t(){var n;return F().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.abrupt("return",(n=this.pcManager)===null||n===void 0?void 0:n.getConnectedAddress());case 1:case"end":return r.stop()}},t,this)}))}},{key:"setRegionUrlProvider",value:function(t){this.regionUrlProvider=t}},{key:"configure",value:function(t){return he(this,void 0,void 0,F().mark(function n(){var r,s,a,o=this;return F().wrap(function(c){for(;;)switch(c.prev=c.next){case 0:if(!this.pcManager||this.pcManager.currentState===an.NEW){c.next=2;break}return c.abrupt("return");case 2:this.participantSid=(r=t.participant)===null||r===void 0?void 0:r.sid,a=this.makeRTCConfiguration(t),this.pcManager=new Y9(a,t.subscriberPrimary,this.loggerOptions),this.emit(Ze.TransportsCreated,this.pcManager.publisher,this.pcManager.subscriber),this.pcManager.onIceCandidate=function(d,h){o.client.sendIceCandidate(d,h)},this.pcManager.onPublisherOffer=function(d){o.client.sendOffer(d)},this.pcManager.onDataChannel=this.handleDataChannel,this.pcManager.onStateChange=function(d,h,b){return he(o,void 0,void 0,F().mark(function v(){var y,p,f;return F().wrap(function(m){for(;;)switch(m.prev=m.next){case 0:this.log.debug("primary PC state changed ".concat(d),this.logContext),["closed","disconnected","failed"].includes(h)&&(this.publisherConnectionPromise=void 0),d===an.CONNECTED?(y=this.pcState===Ji.New,this.pcState=Ji.Connected,y&&this.emit(Ze.Connected,t)):d===an.FAILED&&this.pcState===Ji.Connected&&(this.pcState=Ji.Disconnected,this.handleDisconnect("peerconnection failed",b==="failed"?uo.RR_SUBSCRIBER_FAILED:uo.RR_PUBLISHER_FAILED)),p=this.client.isDisconnected||this.client.currentState===Jt.RECONNECTING,f=[an.FAILED,an.CLOSING,an.CLOSED].includes(d),p&&f&&!this._isClosed&&this.emit(Ze.Offline);case 6:case"end":return m.stop()}},v,this)}))},this.pcManager.onTrack=function(d){o.emit(Ze.MediaTrackAdded,d.track,d.streams[0],d.receiver)},(u=(s=t.serverInfo)===null||s===void 0?void 0:s.protocol)!==void 0&&u>13||this.createDataChannels();case 12:case"end":return c.stop()}var u},n,this)}))}},{key:"setupSignalClientCallbacks",value:function(){var t=this;this.client.onAnswer=function(n){return he(t,void 0,void 0,F().mark(function r(){return F().wrap(function(s){for(;;)switch(s.prev=s.next){case 0:if(this.pcManager){s.next=2;break}return s.abrupt("return");case 2:return this.log.debug("received server answer",Object.assign(Object.assign({},this.logContext),{RTCSdpType:n.type})),s.next=5,this.pcManager.setPublisherAnswer(n);case 5:case"end":return s.stop()}},r,this)}))},this.client.onTrickle=function(n,r){t.pcManager&&(t.log.trace("got ICE candidate from peer",Object.assign(Object.assign({},t.logContext),{candidate:n,target:r})),t.pcManager.addIceCandidate(n,r))},this.client.onOffer=function(n){return he(t,void 0,void 0,F().mark(function r(){var s;return F().wrap(function(a){for(;;)switch(a.prev=a.next){case 0:if(this.pcManager){a.next=2;break}return a.abrupt("return");case 2:return a.next=4,this.pcManager.createSubscriberAnswerFromOffer(n);case 4:s=a.sent,this.client.sendAnswer(s);case 6:case"end":return a.stop()}},r,this)}))},this.client.onLocalTrackPublished=function(n){var r;if(t.log.debug("received trackPublishedResponse",Object.assign(Object.assign({},t.logContext),{cid:n.cid,track:(r=n.track)===null||r===void 0?void 0:r.sid})),t.pendingTrackResolvers[n.cid]){var s=t.pendingTrackResolvers[n.cid].resolve;delete t.pendingTrackResolvers[n.cid],s(n.track)}else t.log.error("missing track resolver for ".concat(n.cid),Object.assign(Object.assign({},t.logContext),{cid:n.cid}))},this.client.onLocalTrackUnpublished=function(n){t.emit(Ze.LocalTrackUnpublished,n)},this.client.onLocalTrackSubscribed=function(n){t.emit(Ze.LocalTrackSubscribed,n)},this.client.onTokenRefresh=function(n){t.token=n},this.client.onRemoteMuteChanged=function(n,r){t.emit(Ze.RemoteMute,n,r)},this.client.onSubscribedQualityUpdate=function(n){t.emit(Ze.SubscribedQualityUpdate,n)},this.client.onClose=function(){t.handleDisconnect("signal",uo.RR_SIGNAL_DISCONNECTED)},this.client.onLeave=function(n){switch(t.log.debug("client leave request",Object.assign(Object.assign({},t.logContext),{reason:n==null?void 0:n.reason})),n.regions&&t.regionUrlProvider&&(t.log.debug("updating regions",t.logContext),t.regionUrlProvider.setServerReportedRegions(n.regions)),n.action){case fo.DISCONNECT:t.emit(Ze.Disconnected,n==null?void 0:n.reason),t.close();break;case fo.RECONNECT:t.fullReconnectOnNext=!0,t.handleDisconnect(tg);break;case fo.RESUME:t.handleDisconnect(tg)}}}},{key:"makeRTCConfiguration",value:function(t){var n,r=Object.assign({},this.rtcConfig);if(!((n=this.signalOpts)===null||n===void 0)&&n.e2eeEnabled&&(this.log.debug("E2EE - setting up transports with insertable streams",this.logContext),r.encodedInsertableStreams=!0),t.iceServers&&!r.iceServers){var s=[];t.iceServers.forEach(function(a){var o={urls:a.urls};a.username&&(o.username=a.username),a.credential&&(o.credential=a.credential),s.push(o)}),r.iceServers=s}return t.clientConfiguration&&t.clientConfiguration.forceRelay===Ml.ENABLED&&(r.iceTransportPolicy="relay"),r.sdpSemantics="unified-plan",r.continualGatheringPolicy="gather_continually",r}},{key:"createDataChannels",value:function(){this.pcManager&&(this.lossyDC&&(this.lossyDC.onmessage=null,this.lossyDC.onerror=null),this.reliableDC&&(this.reliableDC.onmessage=null,this.reliableDC.onerror=null),this.lossyDC=this.pcManager.createPublisherDataChannel(pS,{ordered:!0,maxRetransmits:0}),this.reliableDC=this.pcManager.createPublisherDataChannel(mS,{ordered:!0}),this.lossyDC.onmessage=this.handleDataMessage,this.reliableDC.onmessage=this.handleDataMessage,this.lossyDC.onerror=this.handleDataError,this.reliableDC.onerror=this.handleDataError,this.lossyDC.bufferedAmountLowThreshold=65535,this.reliableDC.bufferedAmountLowThreshold=65535,this.lossyDC.onbufferedamountlow=this.handleBufferedAmountLow,this.reliableDC.onbufferedamountlow=this.handleBufferedAmountLow)}},{key:"createSender",value:function(t,n,r){return he(this,void 0,void 0,F().mark(function s(){var a,o;return F().wrap(function(c){for(;;)switch(c.prev=c.next){case 0:if(!Fm()){c.next=5;break}return c.next=3,this.createTransceiverRTCRtpSender(t,n,r);case 3:return a=c.sent,c.abrupt("return",a);case 5:if(!Vm()){c.next=11;break}return this.log.warn("using add-track fallback",this.logContext),c.next=9,this.createRTCRtpSender(t.mediaStreamTrack);case 9:return o=c.sent,c.abrupt("return",o);case 11:throw new bn("Required webRTC APIs not supported on this device");case 12:case"end":return c.stop()}},s,this)}))}},{key:"createSimulcastSender",value:function(t,n,r,s){return he(this,void 0,void 0,F().mark(function a(){return F().wrap(function(o){for(;;)switch(o.prev=o.next){case 0:if(!Fm()){o.next=2;break}return o.abrupt("return",this.createSimulcastTransceiverSender(t,n,r,s));case 2:if(!Vm()){o.next=5;break}return this.log.debug("using add-track fallback",this.logContext),o.abrupt("return",this.createRTCRtpSender(t.mediaStreamTrack));case 5:throw new bn("Cannot stream on this device");case 6:case"end":return o.stop()}},a,this)}))}},{key:"createTransceiverRTCRtpSender",value:function(t,n,r){return he(this,void 0,void 0,F().mark(function s(){var a,o,c;return F().wrap(function(u){for(;;)switch(u.prev=u.next){case 0:if(this.pcManager){u.next=2;break}throw new bn("publisher is closed");case 2:return a=[],t.mediaStream&&a.push(t.mediaStream),t instanceof $n&&(t.codec=n.videoCodec),o={direction:"sendonly",streams:a},r&&(o.sendEncodings=r),u.next=9,this.pcManager.addPublisherTransceiver(t.mediaStreamTrack,o);case 9:return c=u.sent,u.abrupt("return",c.sender);case 11:case"end":return u.stop()}},s,this)}))}},{key:"createSimulcastTransceiverSender",value:function(t,n,r,s){return he(this,void 0,void 0,F().mark(function a(){var o,c;return F().wrap(function(u){for(;;)switch(u.prev=u.next){case 0:if(this.pcManager){u.next=2;break}throw new bn("publisher is closed");case 2:return o={direction:"sendonly"},s&&(o.sendEncodings=s),u.next=6,this.pcManager.addPublisherTransceiver(n.mediaStreamTrack,o);case 6:if(c=u.sent,r.videoCodec){u.next=9;break}return u.abrupt("return");case 9:return t.setSimulcastTrackSender(r.videoCodec,c.sender),u.abrupt("return",c.sender);case 11:case"end":return u.stop()}},a,this)}))}},{key:"createRTCRtpSender",value:function(t){return he(this,void 0,void 0,F().mark(function n(){return F().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:if(this.pcManager){r.next=2;break}throw new bn("publisher is closed");case 2:return r.abrupt("return",this.pcManager.addPublisherTrack(t));case 3:case"end":return r.stop()}},n,this)}))}},{key:"attemptReconnect",value:function(t){return he(this,void 0,void 0,F().mark(function n(){var r,s,a,o;return F().wrap(function(c){for(;;)switch(c.prev=c.next){case 0:if(!this._isClosed){c.next=2;break}return c.abrupt("return");case 2:if(!this.attemptingReconnect){c.next=5;break}return xt.warn("already attempting reconnect, returning early",this.logContext),c.abrupt("return");case 5:if(((r=this.clientConfiguration)===null||r===void 0?void 0:r.resumeConnection)!==Ml.DISABLED&&((a=(s=this.pcManager)===null||s===void 0?void 0:s.currentState)!==null&&a!==void 0?a:an.NEW)!==an.NEW||(this.fullReconnectOnNext=!0),c.prev=6,this.attemptingReconnect=!0,!this.fullReconnectOnNext){c.next=13;break}return c.next=11,this.restartConnection();case 11:c.next=15;break;case 13:return c.next=15,this.resumeConnection(t);case 15:this.clearPendingReconnect(),this.fullReconnectOnNext=!1,c.next=32;break;case 19:if(c.prev=19,c.t0=c.catch(6),this.reconnectAttempts+=1,o=!0,c.t0 instanceof bn?(this.log.debug("received unrecoverable error",Object.assign(Object.assign({},this.logContext),{error:c.t0})),o=!1):c.t0 instanceof _o||(this.fullReconnectOnNext=!0),!o){c.next=28;break}this.handleDisconnect("reconnect",uo.RR_UNKNOWN),c.next=32;break;case 28:return this.log.info("could not recover connection after ".concat(this.reconnectAttempts," attempts, ").concat(Date.now()-this.reconnectStart,"ms. giving up"),this.logContext),this.emit(Ze.Disconnected),c.next=32,this.close();case 32:return c.prev=32,this.attemptingReconnect=!1,c.finish(32);case 35:case"end":return c.stop()}},n,this,[[6,19,32,35]])}))}},{key:"getNextRetryDelay",value:function(t){try{return this.reconnectPolicy.nextRetryDelayInMs(t)}catch(n){this.log.warn("encountered error in reconnect policy",Object.assign(Object.assign({},this.logContext),{error:n}))}return null}},{key:"restartConnection",value:function(t){return he(this,void 0,void 0,F().mark(function n(){var r,s,a,o,c;return F().wrap(function(u){for(;;)switch(u.prev=u.next){case 0:if(u.prev=0,this.url&&this.token){u.next=3;break}throw new bn("could not reconnect, url or token not saved");case 3:if(this.log.info("reconnecting, attempt: ".concat(this.reconnectAttempts),this.logContext),this.emit(Ze.Restarting),this.client.isDisconnected){u.next=8;break}return u.next=8,this.client.sendLeave();case 8:return u.next=10,this.cleanupPeerConnections();case 10:return u.next=12,this.cleanupClient();case 12:if(u.prev=12,this.signalOpts){u.next=16;break}throw this.log.warn("attempted connection restart, without signal options present",this.logContext),new _o;case 16:return u.next=18,this.join(t??this.url,this.token,this.signalOpts);case 18:o=u.sent,u.next=26;break;case 21:if(u.prev=21,u.t0=u.catch(12),!(u.t0 instanceof Wt&&u.t0.reason===jn.NotAllowed)){u.next=25;break}throw new bn("could not reconnect, token might be expired");case 25:throw new _o;case 26:if(!this.shouldFailNext){u.next=29;break}throw this.shouldFailNext=!1,new Error("simulated failure");case 29:return this.client.setReconnected(),this.emit(Ze.SignalRestarted,o),u.next=33,this.waitForPCReconnected();case 33:if(this.client.currentState===Jt.CONNECTED){u.next=35;break}throw new _o("Signal connection got severed during reconnect");case 35:(r=this.regionUrlProvider)===null||r===void 0||r.resetAttempts(),this.emit(Ze.Restarted),u.next=52;break;case 39:return u.prev=39,u.t1=u.catch(0),u.next=43,(s=this.regionUrlProvider)===null||s===void 0?void 0:s.getNextBestRegionUrl();case 43:if(!(c=u.sent)){u.next=50;break}return u.next=47,this.restartConnection(c);case 47:return u.abrupt("return");case 50:throw(a=this.regionUrlProvider)===null||a===void 0||a.resetAttempts(),u.t1;case 52:case"end":return u.stop()}},n,this,[[0,39],[12,21]])}))}},{key:"resumeConnection",value:function(t){return he(this,void 0,void 0,F().mark(function n(){var r,s,a,o;return F().wrap(function(c){for(;;)switch(c.prev=c.next){case 0:if(this.url&&this.token){c.next=2;break}throw new bn("could not reconnect, url or token not saved");case 2:if(this.pcManager){c.next=4;break}throw new bn("publisher and subscriber connections unset");case 4:return this.log.info("resuming signal connection, attempt ".concat(this.reconnectAttempts),this.logContext),this.emit(Ze.Resuming),c.prev=6,this.setupSignalClientCallbacks(),c.next=10,this.client.reconnect(this.url,this.token,this.participantSid,t);case 10:s=c.sent,c.next=22;break;case 13:if(c.prev=13,c.t0=c.catch(6),a="",c.t0 instanceof Error&&(a=c.t0.message,this.log.error(c.t0.message,Object.assign(Object.assign({},this.logContext),{error:c.t0}))),!(c.t0 instanceof Wt&&c.t0.reason===jn.NotAllowed)){c.next=19;break}throw new bn("could not reconnect, token might be expired");case 19:if(!(c.t0 instanceof Wt&&c.t0.reason===jn.LeaveRequest)){c.next=21;break}throw c.t0;case 21:throw new _o(a);case 22:if(this.emit(Ze.SignalResumed),s?(o=this.makeRTCConfiguration(s),this.pcManager.updateConfiguration(o)):this.log.warn("Did not receive reconnect response",this.logContext),!this.shouldFailNext){c.next=27;break}throw this.shouldFailNext=!1,new Error("simulated failure");case 27:return c.next=29,this.pcManager.triggerIceRestart();case 29:return c.next=31,this.waitForPCReconnected();case 31:if(this.client.currentState===Jt.CONNECTED){c.next=33;break}throw new _o("Signal connection got severed during reconnect");case 33:this.client.setReconnected(),((r=this.reliableDC)===null||r===void 0?void 0:r.readyState)==="open"&&this.reliableDC.id===null&&this.createDataChannels(),this.emit(Ze.Resumed);case 36:case"end":return c.stop()}},n,this,[[6,13]])}))}},{key:"waitForPCInitialConnection",value:function(t,n){return he(this,void 0,void 0,F().mark(function r(){return F().wrap(function(s){for(;;)switch(s.prev=s.next){case 0:if(this.pcManager){s.next=2;break}throw new bn("PC manager is closed");case 2:return s.next=4,this.pcManager.ensurePCTransportConnection(n,t);case 4:case"end":return s.stop()}},r,this)}))}},{key:"waitForPCReconnected",value:function(){return he(this,void 0,void 0,F().mark(function t(){return F().wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return this.pcState=Ji.Reconnecting,this.log.debug("waiting for peer connection to reconnect",this.logContext),n.prev=2,n.next=5,yr(2e3);case 5:if(this.pcManager){n.next=7;break}throw new bn("PC manager is closed");case 7:return n.next=9,this.pcManager.ensurePCTransportConnection(void 0,this.peerConnectionTimeout);case 9:this.pcState=Ji.Connected,n.next=16;break;case 12:throw n.prev=12,n.t0=n.catch(2),this.pcState=Ji.Disconnected,new Wt("could not establish PC connection, ".concat(n.t0.message));case 16:case"end":return n.stop()}},t,this,[[2,12]])}))}},{key:"sendDataPacket",value:function(t,n){return he(this,void 0,void 0,F().mark(function r(){var s,a;return F().wrap(function(o){for(;;)switch(o.prev=o.next){case 0:return s=t.toBinary(),o.next=3,this.ensurePublisherConnected(n);case 3:(a=this.dataChannelForKind(n))&&a.send(s),this.updateAndEmitDCBufferStatus(n);case 6:case"end":return o.stop()}},r,this)}))}},{key:"ensureDataTransportConnected",value:function(t){return he(this,arguments,void 0,function(n){var r=this,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.subscriberPrimary;return F().mark(function a(){var o,c,u,d,h,b;return F().wrap(function(v){for(;;)switch(v.prev=v.next){case 0:if(r.pcManager){v.next=2;break}throw new bn("PC manager is closed");case 2:if(c=s?r.pcManager.subscriber:r.pcManager.publisher,u=s?"Subscriber":"Publisher",c){v.next=6;break}throw new Wt("".concat(u," connection not set"));case 6:if(d=!1,s||r.dataChannelForKind(n,s)||(r.createDataChannels(),d=!0),d||s||r.pcManager.publisher.isICEConnected||r.pcManager.publisher.getICEConnectionState()==="checking"||(d=!0),d&&r.negotiate(),((h=r.dataChannelForKind(n,s))==null?void 0:h.readyState)!=="open"){v.next=13;break}return v.abrupt("return");case 13:b=new Date().getTime()+r.peerConnectionTimeout;case 14:if(new Date().getTime()>=b){v.next=21;break}if(!c.isICEConnected||((o=r.dataChannelForKind(n,s))===null||o===void 0?void 0:o.readyState)!=="open"){v.next=17;break}return v.abrupt("return");case 17:return v.next=19,yr(50);case 19:v.next=14;break;case 21:throw new Wt("could not establish ".concat(u," connection, state: ").concat(c.getICEConnectionState()));case 22:case"end":return v.stop()}},a)})()})}},{key:"ensurePublisherConnected",value:function(t){return he(this,void 0,void 0,F().mark(function n(){return F().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return this.publisherConnectionPromise||(this.publisherConnectionPromise=this.ensureDataTransportConnected(t,!1)),r.next=3,this.publisherConnectionPromise;case 3:case"end":return r.stop()}},n,this)}))}},{key:"verifyTransport",value:function(){return!!this.pcManager&&this.pcManager.currentState===an.CONNECTED&&!(!this.client.ws||this.client.ws.readyState===WebSocket.CLOSED)}},{key:"negotiate",value:function(){return he(this,void 0,void 0,F().mark(function t(){var n=this;return F().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.abrupt("return",new Promise(function(s,a){return he(n,void 0,void 0,F().mark(function o(){var c,u,d=this;return F().wrap(function(h){for(;;)switch(h.prev=h.next){case 0:if(this.pcManager){h.next=3;break}return a(new Pm("PC manager is closed")),h.abrupt("return");case 3:return this.pcManager.requirePublisher(),this.pcManager.publisher.getTransceivers().length!=0||this.lossyDC||this.reliableDC||this.createDataChannels(),c=new AbortController,u=function(){c.abort(),d.log.debug("engine disconnected while negotiation was ongoing",d.logContext),s()},this.isClosed&&a("cannot negotiate on closed engine"),this.on(Ze.Closing,u),this.pcManager.publisher.once(nS,function(b){var v=new Map;b.forEach(function(y){var p,f=y.codec.toLowerCase();p=f,OT.includes(p)&&v.set(y.payload,f)}),d.emit(Ze.RTPVideoMapUpdate,v)}),h.prev=10,h.next=13,this.pcManager.negotiate(c);case 13:s(),h.next=21;break;case 16:h.prev=16,h.t0=h.catch(10),h.t0 instanceof Pm&&(this.fullReconnectOnNext=!0),this.handleDisconnect("negotiation",uo.RR_UNKNOWN),a(h.t0);case 21:return h.prev=21,this.off(Ze.Closing,u),h.finish(21);case 24:case"end":return h.stop()}},o,this,[[10,16,21,24]])}))}));case 1:case"end":return r.stop()}},t)}))}},{key:"dataChannelForKind",value:function(t,n){if(n){if(t===yn.LOSSY)return this.lossyDCSub;if(t===yn.RELIABLE)return this.reliableDCSub}else{if(t===yn.LOSSY)return this.lossyDC;if(t===yn.RELIABLE)return this.reliableDC}}},{key:"sendSyncState",value:function(t,n){var r,s;if(this.pcManager){var a,o,c=this.pcManager.subscriber.getLocalDescription(),u=this.pcManager.subscriber.getRemoteDescription(),d=(s=(r=this.signalOpts)===null||r===void 0?void 0:r.autoSubscribe)===null||s===void 0||s,h=new Array,b=new Array;t.forEach(function(v){v.isDesired!==d&&h.push(v.trackSid),v.isEnabled||b.push(v.trackSid)}),this.client.sendSyncState(new Lk({answer:c?Ed({sdp:c.sdp,type:c.type}):void 0,offer:u?Ed({sdp:u.sdp,type:u.type}):void 0,subscription:new ud({trackSids:h,subscribe:!d,participantTracks:[]}),publishTracks:(a=n,o=[],a.forEach(function(v){v.track!==void 0&&o.push(new ym({cid:v.track.mediaStreamID,track:v.trackInfo}))}),o),dataChannels:this.dataChannelsInfo(),trackSidsDisabled:b}))}else this.log.warn("sync state cannot be sent without peer connection setup",this.logContext)}},{key:"failNext",value:function(){this.shouldFailNext=!0}},{key:"dataChannelsInfo",value:function(){var t=[],n=function(r,s){(r==null?void 0:r.id)!==void 0&&r.id!==null&&t.push(new Bk({label:r.label,id:r.id,target:s}))};return n(this.dataChannelForKind(yn.LOSSY),Xi.PUBLISHER),n(this.dataChannelForKind(yn.RELIABLE),Xi.PUBLISHER),n(this.dataChannelForKind(yn.LOSSY,!0),Xi.SUBSCRIBER),n(this.dataChannelForKind(yn.RELIABLE,!0),Xi.SUBSCRIBER),t}},{key:"clearReconnectTimeout",value:function(){this.reconnectTimeout&&In.clearTimeout(this.reconnectTimeout)}},{key:"clearPendingReconnect",value:function(){this.clearReconnectTimeout(),this.reconnectAttempts=0}},{key:"registerOnLineListener",value:function(){vi()&&window.addEventListener("online",this.handleBrowserOnLine)}},{key:"deregisterOnLineListener",value:function(){vi()&&window.removeEventListener("online",this.handleBrowserOnLine)}}]),e}(),_o=function(i){function e(){return ht(this,e),Ut(this,e,arguments)}return Ft(e,Ju(Error)),ft(e)}();function aR(i,e){var t=i.participantIdentity?i.participantIdentity:e.participantIdentity;i.participantIdentity=t,e.participantIdentity=t;var n=i.destinationIdentities.length!==0?i.destinationIdentities:e.destinationIdentities;i.destinationIdentities=n,e.destinationIdentities=n}var gS=function(){function i(e,t){ht(this,i),this.lastUpdateAt=0,this.settingsCacheTime=3e3,this.attemptedRegions=[],this.serverUrl=new URL(e),this.token=t}return ft(i,[{key:"updateToken",value:function(e){this.token=e}},{key:"isCloud",value:function(){return $m(this.serverUrl)}},{key:"getServerUrl",value:function(){return this.serverUrl}},{key:"getNextBestRegionUrl",value:function(e){return he(this,void 0,void 0,F().mark(function t(){var n,r,s=this;return F().wrap(function(a){for(;;)switch(a.prev=a.next){case 0:if(this.isCloud()){a.next=2;break}throw Error("region availability is only supported for LiveKit Cloud domains");case 2:if(this.regionSettings&&Date.now()-this.lastUpdateAt<=this.settingsCacheTime){a.next=6;break}return a.next=5,this.fetchRegionSettings(e);case 5:this.regionSettings=a.sent;case 6:if((n=this.regionSettings.regions.filter(function(o){return!s.attemptedRegions.find(function(c){return c.url===o.url})})).length<=0){a.next=14;break}return r=n[0],this.attemptedRegions.push(r),xt.debug("next region: ".concat(r.region)),a.abrupt("return",r.url);case 14:return a.abrupt("return",null);case 15:case"end":return a.stop()}},t,this)}))}},{key:"resetAttempts",value:function(){this.attemptedRegions=[]}},{key:"fetchRegionSettings",value:function(e){return he(this,void 0,void 0,F().mark(function t(){var n,r;return F().wrap(function(s){for(;;)switch(s.prev=s.next){case 0:return s.next=2,fetch("".concat((a=this.serverUrl,"".concat(a.protocol.replace("ws","http"),"//").concat(a.host,"/settings")),"/regions"),{headers:{authorization:"Bearer ".concat(this.token)},signal:e});case 2:if(!(n=s.sent).ok){s.next=11;break}return s.next=6,n.json();case 6:return r=s.sent,this.lastUpdateAt=Date.now(),s.abrupt("return",r);case 11:throw new Wt("Could not fetch region settings: ".concat(n.statusText),n.status===401?jn.NotAllowed:void 0,n.status);case 12:case"end":return s.stop()}var a},t,this)}))}},{key:"setServerReportedRegions",value:function(e){this.regionSettings=e,this.lastUpdateAt=Date.now()}}]),i}(),vS=function(i){function e(t,n,r,s,a){var o;return ht(this,e),(o=Ut(this,e,[t,r,a])).sid=n,o.receiver=s,o}return Ft(e,Me),ft(e,[{key:"setMuted",value:function(t){this.isMuted!==t&&(this.isMuted=t,this._mediaStreamTrack.enabled=!t,this.emit(t?qe.Muted:qe.Unmuted,this))}},{key:"setMediaStream",value:function(t){var n=this;this.mediaStream=t,t.addEventListener("removetrack",function r(s){s.track===n._mediaStreamTrack&&(t.removeEventListener("removetrack",r),n.receiver&&"playoutDelayHint"in n.receiver&&(n.receiver.playoutDelayHint=void 0),n.receiver=void 0,n._currentBitrate=0,n.emit(qe.Ended,n))})}},{key:"start",value:function(){this.startMonitor(),pt(lt(e.prototype),"enable",this).call(this)}},{key:"stop",value:function(){this.stopMonitor(),pt(lt(e.prototype),"disable",this).call(this)}},{key:"getRTCStatsReport",value:function(){return he(this,void 0,void 0,F().mark(function t(){var n,r;return F().wrap(function(s){for(;;)switch(s.prev=s.next){case 0:if(!((n=this.receiver)===null||n===void 0)&&n.getStats){s.next=2;break}return s.abrupt("return");case 2:return s.next=4,this.receiver.getStats();case 4:return r=s.sent,s.abrupt("return",r);case 6:case"end":return s.stop()}},t,this)}))}},{key:"setPlayoutDelay",value:function(t){this.receiver?"playoutDelayHint"in this.receiver?this.receiver.playoutDelayHint=t:this.log.warn("Playout delay not supported in this browser"):this.log.warn("Cannot set playout delay, track already ended")}},{key:"getPlayoutDelay",value:function(){if(this.receiver){if("playoutDelayHint"in this.receiver)return this.receiver.playoutDelayHint;this.log.warn("Playout delay not supported in this browser")}else this.log.warn("Cannot get playout delay, track already ended");return 0}},{key:"startMonitor",value:function(){var t=this;this.monitorInterval||(this.monitorInterval=setInterval(function(){return t.monitorReceiver()},Jm)),typeof RTCRtpReceiver<"u"&&"getSynchronizationSources"in RTCRtpReceiver&&this.registerTimeSyncUpdate()}},{key:"registerTimeSyncUpdate",value:function(){var t=this;(function n(){var r;t.timeSyncHandle=requestAnimationFrame(function(){return n()});var s=(r=t.receiver)===null||r===void 0?void 0:r.getSynchronizationSources()[0];if(s){var a=s.timestamp,o=s.rtpTimestamp;o&&t.rtpTimestamp!==o&&(t.emit(qe.TimeSyncUpdate,{timestamp:a,rtpTimestamp:o}),t.rtpTimestamp=o)}})()}}]),e}(),ql=function(i){function e(t,n,r,s,a,o){var c;return ht(this,e),(c=Ut(this,e,[t,n,Me.Kind.Audio,r,o])).monitorReceiver=function(){return he(ct(c),void 0,void 0,F().mark(function u(){var d;return F().wrap(function(h){for(;;)switch(h.prev=h.next){case 0:if(this.receiver){h.next=3;break}return this._currentBitrate=0,h.abrupt("return");case 3:return h.next=5,this.getReceiverStats();case 5:(d=h.sent)&&this.prevStats&&this.receiver&&(this._currentBitrate=wd(d,this.prevStats)),this.prevStats=d;case 8:case"end":return h.stop()}},u,this)}))},c.audioContext=s,c.webAudioPluginNodes=[],a&&(c.sinkId=a.deviceId),c}return Ft(e,vS),ft(e,[{key:"setVolume",value:function(t){var n,r,s=dt(this.attachedElements);try{for(s.s();!(r=s.n()).done;){var a=r.value;this.audioContext?(n=this.gainNode)===null||n===void 0||n.gain.setTargetAtTime(t,0,.1):a.volume=t}}catch(o){s.e(o)}finally{s.f()}Ur()&&this._mediaStreamTrack._setVolume(t),this.elementVolume=t}},{key:"getVolume",value:function(){if(this.elementVolume)return this.elementVolume;if(Ur())return 1;var t=0;return this.attachedElements.forEach(function(n){n.volume>t&&(t=n.volume)}),t}},{key:"setSinkId",value:function(t){return he(this,void 0,void 0,F().mark(function n(){return F().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return this.sinkId=t,r.next=3,Promise.all(this.attachedElements.map(function(s){if(jm(s))return s.setSinkId(t)}));case 3:case"end":return r.stop()}},n,this)}))}},{key:"attach",value:function(t){var n=this.attachedElements.length===0;return t?pt(lt(e.prototype),"attach",this).call(this,t):t=pt(lt(e.prototype),"attach",this).call(this),this.sinkId&&jm(t)&&t.setSinkId(this.sinkId),this.audioContext&&n&&(this.log.debug("using audio context mapping",this.logContext),this.connectWebAudio(this.audioContext,t),t.volume=0,t.muted=!0),this.elementVolume&&this.setVolume(this.elementVolume),t}},{key:"detach",value:function(t){var n;return t?(n=pt(lt(e.prototype),"detach",this).call(this,t),this.audioContext&&(this.attachedElements.length>0?this.connectWebAudio(this.audioContext,this.attachedElements[0]):this.disconnectWebAudio())):(n=pt(lt(e.prototype),"detach",this).call(this),this.disconnectWebAudio()),n}},{key:"setAudioContext",value:function(t){this.audioContext=t,t&&this.attachedElements.length>0?this.connectWebAudio(t,this.attachedElements[0]):t||this.disconnectWebAudio()}},{key:"setWebAudioPlugins",value:function(t){this.webAudioPluginNodes=t,this.attachedElements.length>0&&this.audioContext&&this.connectWebAudio(this.audioContext,this.attachedElements[0])}},{key:"connectWebAudio",value:function(t,n){var r=this;this.disconnectWebAudio(),this.sourceNode=t.createMediaStreamSource(n.srcObject);var s=this.sourceNode;this.webAudioPluginNodes.forEach(function(a){s.connect(a),s=a}),this.gainNode=t.createGain(),s.connect(this.gainNode),this.gainNode.connect(t.destination),this.elementVolume&&this.gainNode.gain.setTargetAtTime(this.elementVolume,0,.1),t.state!=="running"&&t.resume().then(function(){t.state!=="running"&&r.emit(qe.AudioPlaybackFailed,new Error("Audio Context couldn't be started automatically"))}).catch(function(a){r.emit(qe.AudioPlaybackFailed,a)})}},{key:"disconnectWebAudio",value:function(){var t,n;(t=this.gainNode)===null||t===void 0||t.disconnect(),(n=this.sourceNode)===null||n===void 0||n.disconnect(),this.gainNode=void 0,this.sourceNode=void 0}},{key:"getReceiverStats",value:function(){return he(this,void 0,void 0,F().mark(function t(){var n;return F().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:if(this.receiver&&this.receiver.getStats){r.next=2;break}return r.abrupt("return");case 2:return r.next=4,this.receiver.getStats();case 4:return r.sent.forEach(function(s){s.type==="inbound-rtp"&&(n={type:"audio",timestamp:s.timestamp,jitter:s.jitter,bytesReceived:s.bytesReceived,concealedSamples:s.concealedSamples,concealmentEvents:s.concealmentEvents,silentConcealedSamples:s.silentConcealedSamples,silentConcealmentEvents:s.silentConcealmentEvents,totalAudioEnergy:s.totalAudioEnergy,totalSamplesDuration:s.totalSamplesDuration})}),r.abrupt("return",n);case 7:case"end":return r.stop()}},t,this)}))}}]),e}(),zl=function(i){function e(t,n,r,s,a){var o;return ht(this,e),(o=Ut(this,e,[t,n,Me.Kind.Video,r,a])).elementInfos=[],o.monitorReceiver=function(){return he(ct(o),void 0,void 0,F().mark(function c(){var u;return F().wrap(function(d){for(;;)switch(d.prev=d.next){case 0:if(this.receiver){d.next=3;break}return this._currentBitrate=0,d.abrupt("return");case 3:return d.next=5,this.getReceiverStats();case 5:(u=d.sent)&&this.prevStats&&this.receiver&&(this._currentBitrate=wd(u,this.prevStats)),this.prevStats=u;case 8:case"end":return d.stop()}},c,this)}))},o.debouncedHandleResize=Nm(function(){o.updateDimensions()},100),o.adaptiveStreamSettings=s,o}return Ft(e,vS),ft(e,[{key:"isAdaptiveStream",get:function(){return this.adaptiveStreamSettings!==void 0}},{key:"mediaStreamTrack",get:function(){return this._mediaStreamTrack}},{key:"setMuted",value:function(t){var n=this;pt(lt(e.prototype),"setMuted",this).call(this,t),this.attachedElements.forEach(function(r){t?vo(n._mediaStreamTrack,r):go(n._mediaStreamTrack,r)})}},{key:"attach",value:function(t){if(t?pt(lt(e.prototype),"attach",this).call(this,t):t=pt(lt(e.prototype),"attach",this).call(this),this.adaptiveStreamSettings&&this.elementInfos.find(function(r){return r.element===t})===void 0){var n=new oR(t);this.observeElementInfo(n)}return t}},{key:"observeElementInfo",value:function(t){var n=this;this.adaptiveStreamSettings&&this.elementInfos.find(function(r){return r===t})===void 0?(t.handleResize=function(){n.debouncedHandleResize()},t.handleVisibilityChanged=function(){n.updateVisibility()},this.elementInfos.push(t),t.observe(),this.debouncedHandleResize(),this.updateVisibility()):this.log.warn("visibility resize observer not triggered",this.logContext)}},{key:"stopObservingElementInfo",value:function(t){if(this.isAdaptiveStream){var n,r=this.elementInfos.filter(function(a){return a===t}),s=dt(r);try{for(s.s();!(n=s.n()).done;)n.value.stopObserving()}catch(a){s.e(a)}finally{s.f()}this.elementInfos=this.elementInfos.filter(function(a){return a!==t}),this.updateVisibility(),this.debouncedHandleResize()}else this.log.warn("stopObservingElementInfo ignored",this.logContext)}},{key:"detach",value:function(t){var n;if(t)return this.stopObservingElement(t),pt(lt(e.prototype),"detach",this).call(this,t);var r,s=dt(n=pt(lt(e.prototype),"detach",this).call(this));try{for(s.s();!(r=s.n()).done;){var a=r.value;this.stopObservingElement(a)}}catch(o){s.e(o)}finally{s.f()}return n}},{key:"getDecoderImplementation",value:function(){var t;return(t=this.prevStats)===null||t===void 0?void 0:t.decoderImplementation}},{key:"getReceiverStats",value:function(){return he(this,void 0,void 0,F().mark(function t(){var n,r,s,a;return F().wrap(function(o){for(;;)switch(o.prev=o.next){case 0:if(this.receiver&&this.receiver.getStats){o.next=2;break}return o.abrupt("return");case 2:return o.next=4,this.receiver.getStats();case 4:return n=o.sent,s="",a=new Map,n.forEach(function(c){c.type==="inbound-rtp"?(s=c.codecId,r={type:"video",framesDecoded:c.framesDecoded,framesDropped:c.framesDropped,framesReceived:c.framesReceived,packetsReceived:c.packetsReceived,packetsLost:c.packetsLost,frameWidth:c.frameWidth,frameHeight:c.frameHeight,pliCount:c.pliCount,firCount:c.firCount,nackCount:c.nackCount,jitter:c.jitter,timestamp:c.timestamp,bytesReceived:c.bytesReceived,decoderImplementation:c.decoderImplementation}):c.type==="codec"&&a.set(c.id,c)}),r&&s!==""&&a.get(s)&&(r.mimeType=a.get(s).mimeType),o.abrupt("return",r);case 10:case"end":return o.stop()}},t,this)}))}},{key:"stopObservingElement",value:function(t){var n,r=this.elementInfos.filter(function(o){return o.element===t}),s=dt(r);try{for(s.s();!(n=s.n()).done;){var a=n.value;this.stopObservingElementInfo(a)}}catch(o){s.e(o)}finally{s.f()}}},{key:"handleAppVisibilityChanged",value:function(){var t=this,n=Object.create(null,{handleAppVisibilityChanged:{get:function(){return pt(lt(e.prototype),"handleAppVisibilityChanged",t)}}});return he(this,void 0,void 0,F().mark(function r(){return F().wrap(function(s){for(;;)switch(s.prev=s.next){case 0:return s.next=2,n.handleAppVisibilityChanged.call(this);case 2:if(this.isAdaptiveStream){s.next=4;break}return s.abrupt("return");case 4:this.updateVisibility();case 5:case"end":return s.stop()}},r,this)}))}},{key:"updateVisibility",value:function(){var t,n,r=this,s=this.elementInfos.reduce(function(u,d){return Math.max(u,d.visibilityChangedAt||0)},0),a=!((n=(t=this.adaptiveStreamSettings)===null||t===void 0?void 0:t.pauseVideoInBackground)!==null&&n!==void 0&&!n)&&this.isInBackground,o=this.elementInfos.some(function(u){return u.pictureInPicture}),c=this.elementInfos.some(function(u){return u.visible})&&!a||o;this.lastVisible!==c&&(c||Date.now()-s>=100?(this.lastVisible=c,this.emit(qe.VisibilityChanged,c,this)):In.setTimeout(function(){r.updateVisibility()},100))}},{key:"updateDimensions",value:function(){var t,n,r,s=0,a=0,o=this.getPixelDensity(),c=dt(this.elementInfos);try{for(c.s();!(r=c.n()).done;){var u=r.value,d=u.width()*o,h=u.height()*o;d+h>s+a&&(s=d,a=h)}}catch(b){c.e(b)}finally{c.f()}((t=this.lastDimensions)===null||t===void 0?void 0:t.width)===s&&((n=this.lastDimensions)===null||n===void 0?void 0:n.height)===a||(this.lastDimensions={width:s,height:a},this.emit(qe.VideoDimensionsChanged,this.lastDimensions,this))}},{key:"getPixelDensity",value:function(){var t,n=(t=this.adaptiveStreamSettings)===null||t===void 0?void 0:t.pixelDensity;return n==="screen"?jT():n||(jT()>2?2:1)}}]),e}(),oR=function(){function i(e,t){var n=this;ht(this,i),this.onVisibilityChanged=function(r){var s,a=r.target,o=r.isIntersecting;a===n.element&&(n.isIntersecting=o,n.visibilityChangedAt=Date.now(),(s=n.handleVisibilityChanged)===null||s===void 0||s.call(n))},this.onEnterPiP=function(){var r;n.isPiP=!0,(r=n.handleVisibilityChanged)===null||r===void 0||r.call(n)},this.onLeavePiP=function(){var r;n.isPiP=!1,(r=n.handleVisibilityChanged)===null||r===void 0||r.call(n)},this.element=e,this.isIntersecting=t??yS(e),this.isPiP=vi()&&document.pictureInPictureElement===e,this.visibilityChangedAt=0}return ft(i,[{key:"visible",get:function(){return this.isPiP||this.isIntersecting}},{key:"pictureInPicture",get:function(){return this.isPiP}},{key:"width",value:function(){return this.element.clientWidth}},{key:"height",value:function(){return this.element.clientHeight}},{key:"observe",value:function(){var e=this;this.isIntersecting=yS(this.element),this.isPiP=document.pictureInPictureElement===this.element,this.element.handleResize=function(){var t;(t=e.handleResize)===null||t===void 0||t.call(e)},this.element.handleVisibilityChanged=this.onVisibilityChanged,HT().observe(this.element),$T().observe(this.element),this.element.addEventListener("enterpictureinpicture",this.onEnterPiP),this.element.addEventListener("leavepictureinpicture",this.onLeavePiP)}},{key:"stopObserving",value:function(){var e,t;(e=HT())===null||e===void 0||e.unobserve(this.element),(t=$T())===null||t===void 0||t.unobserve(this.element),this.element.removeEventListener("enterpictureinpicture",this.onEnterPiP),this.element.removeEventListener("leavepictureinpicture",this.onLeavePiP)}}]),i}();function yS(i){for(var e=i.offsetTop,t=i.offsetLeft,n=i.offsetWidth,r=i.offsetHeight,s=i.hidden,a=getComputedStyle(i),o=a.opacity,c=a.display;i.offsetParent;)e+=(i=i.offsetParent).offsetTop,t+=i.offsetLeft;return e<window.pageYOffset+window.innerHeight&&t<window.pageXOffset+window.innerWidth&&e+r>window.pageYOffset&&t+n>window.pageXOffset&&!s&&(o===""||parseFloat(o)>0)&&c!=="none"}var Vr=function(i){function e(t,n,r,s){var a,o;return ht(this,e),(a=Ut(this,e)).metadataMuted=!1,a.encryption=Ni.NONE,a.log=xt,a.handleMuted=function(){a.emit(qe.Muted)},a.handleUnmuted=function(){a.emit(qe.Unmuted)},a.log=Lr((o=s==null?void 0:s.loggerName)!==null&&o!==void 0?o:Yi.Publication),a.loggerContextCb=a.loggerContextCb,a.setMaxListeners(100),a.kind=t,a.trackSid=n,a.trackName=r,a.source=Me.Source.Unknown,a}return Ft(e,Js.EventEmitter),ft(e,[{key:"setTrack",value:function(t){this.track&&(this.track.off(qe.Muted,this.handleMuted),this.track.off(qe.Unmuted,this.handleUnmuted)),this.track=t,t&&(t.on(qe.Muted,this.handleMuted),t.on(qe.Unmuted,this.handleUnmuted))}},{key:"logContext",get:function(){var t;return Object.assign(Object.assign({},(t=this.loggerContextCb)===null||t===void 0?void 0:t.call(this)),Ht(this))}},{key:"isMuted",get:function(){return this.metadataMuted}},{key:"isEnabled",get:function(){return!0}},{key:"isSubscribed",get:function(){return this.track!==void 0}},{key:"isEncrypted",get:function(){return this.encryption!==Ni.NONE}},{key:"audioTrack",get:function(){if(this.track instanceof Pn||this.track instanceof ql)return this.track}},{key:"videoTrack",get:function(){if(this.track instanceof $n||this.track instanceof zl)return this.track}},{key:"updateInfo",value:function(t){this.trackSid=t.sid,this.trackName=t.name,this.source=Me.sourceFromProto(t.source),this.mimeType=t.mimeType,this.kind===Me.Kind.Video&&t.width>0&&(this.dimensions={width:t.width,height:t.height},this.simulcasted=t.simulcast),this.encryption=t.encryption,this.trackInfo=t,this.log.debug("update publication info",Object.assign(Object.assign({},this.logContext),{info:t}))}}]),e}();(function(i){var e,t;(e=i.SubscriptionStatus||(i.SubscriptionStatus={})).Desired="desired",e.Subscribed="subscribed",e.Unsubscribed="unsubscribed",(t=i.PermissionStatus||(i.PermissionStatus={})).Allowed="allowed",t.NotAllowed="not_allowed"})(Vr||(Vr={}));var vs,Dd=function(i){function e(t,n,r,s){var a;return ht(this,e),(a=Ut(this,e,[t,n.sid,n.name,s])).track=void 0,a.handleTrackEnded=function(){a.emit(qe.Ended)},a.updateInfo(n),a.setTrack(r),a}return Ft(e,Vr),ft(e,[{key:"isUpstreamPaused",get:function(){var t;return(t=this.track)===null||t===void 0?void 0:t.isUpstreamPaused}},{key:"setTrack",value:function(t){this.track&&this.track.off(qe.Ended,this.handleTrackEnded),pt(lt(e.prototype),"setTrack",this).call(this,t),t&&t.on(qe.Ended,this.handleTrackEnded)}},{key:"isMuted",get:function(){return this.track?this.track.isMuted:pt(lt(e.prototype),"isMuted",this)}},{key:"audioTrack",get:function(){return pt(lt(e.prototype),"audioTrack",this)}},{key:"videoTrack",get:function(){return pt(lt(e.prototype),"videoTrack",this)}},{key:"mute",value:function(){return he(this,void 0,void 0,F().mark(function t(){var n;return F().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.abrupt("return",(n=this.track)===null||n===void 0?void 0:n.mute());case 1:case"end":return r.stop()}},t,this)}))}},{key:"unmute",value:function(){return he(this,void 0,void 0,F().mark(function t(){var n;return F().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.abrupt("return",(n=this.track)===null||n===void 0?void 0:n.unmute());case 1:case"end":return r.stop()}},t,this)}))}},{key:"pauseUpstream",value:function(){return he(this,void 0,void 0,F().mark(function t(){var n;return F().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,(n=this.track)===null||n===void 0?void 0:n.pauseUpstream();case 2:case"end":return r.stop()}},t,this)}))}},{key:"resumeUpstream",value:function(){return he(this,void 0,void 0,F().mark(function t(){var n;return F().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,(n=this.track)===null||n===void 0?void 0:n.resumeUpstream();case 2:case"end":return r.stop()}},t,this)}))}},{key:"getTrackFeatures",value:function(){var t;if(this.track instanceof Pn){var n=this.track.mediaStreamTrack.getSettings(),r=new Set;return n.autoGainControl&&r.add(mr.TF_AUTO_GAIN_CONTROL),n.echoCancellation&&r.add(mr.TF_ECHO_CANCELLATION),n.noiseSuppression&&r.add(mr.TF_NOISE_SUPPRESSION),n.channelCount&&n.channelCount>1&&r.add(mr.TF_STEREO),!((t=this.options)===null||t===void 0)&&t.dtx||r.add(mr.TF_NO_DTX),this.track.enhancedNoiseCancellation&&r.add(mr.TF_ENHANCED_NOISE_CANCELLATION),Array.from(r.values())}return[]}}]),e}();function bS(i){var e,t;return et(i.audio)==="object"&&i.audio.processor&&(e=i.audio.processor),et(i.video)==="object"&&i.video.processor&&(t=i.video.processor),{audioProcessor:e,videoProcessor:t}}function lR(i){return he(this,void 0,void 0,F().mark(function e(){var t,n,r,s,a,o,c,u,d,h=this;return F().wrap(function(b){for(;;)switch(b.prev=b.next){case 0:return i!=null||(i={}),(t=i.audio)!==null&&t!==void 0||(i.audio=!0),(n=i.video)!==null&&n!==void 0||(i.video=!0),r=bS(i),s=r.audioProcessor,a=r.videoProcessor,o=MT(i,sS,aS),c=Sd(o),u=navigator.mediaDevices.getUserMedia(c),i.audio&&(br.userMediaPromiseMap.set("audioinput",u),u.catch(function(){return br.userMediaPromiseMap.delete("audioinput")})),i.video&&(br.userMediaPromiseMap.set("videoinput",u),u.catch(function(){return br.userMediaPromiseMap.delete("videoinput")})),b.next=11,u;case 11:return d=b.sent,b.abrupt("return",Promise.all(d.getTracks().map(function(v){return he(h,void 0,void 0,F().mark(function y(){var p,f,m,_;return F().wrap(function(k){for(;;)switch(k.prev=k.next){case 0:if((p=v.kind==="audio")?o.audio:o.video,typeof(m=p?c.audio:c.video)!="boolean"&&(f=m),f?f.deviceId=v.getSettings().deviceId:f={deviceId:v.getSettings().deviceId},(_=oS(v,f)).kind===Me.Kind.Video?_.source=Me.Source.Camera:_.kind===Me.Kind.Audio&&(_.source=Me.Source.Microphone),_.mediaStream=d,!(_ instanceof Pn&&s)){k.next=13;break}return k.next=11,_.setProcessor(s);case 11:k.next=16;break;case 13:if(!(_ instanceof $n&&a)){k.next=16;break}return k.next=16,_.setProcessor(a);case 16:return k.abrupt("return",_);case 17:case"end":return k.stop()}},y)}))})));case 13:case"end":return b.stop()}},e)}))}(function(i){i.Excellent="excellent",i.Good="good",i.Poor="poor",i.Lost="lost",i.Unknown="unknown"})(vs||(vs={}));var _S=function(i){function e(t,n,r,s,a){var o;ht(this,e);var c,u=arguments.length>5&&arguments[5]!==void 0?arguments[5]:cd.STANDARD;return(o=Ut(this,e)).audioLevel=0,o.isSpeaking=!1,o._connectionQuality=vs.Unknown,o.log=xt,o.log=Lr((c=a==null?void 0:a.loggerName)!==null&&c!==void 0?c:Yi.Participant),o.loggerOptions=a,o.setMaxListeners(100),o.sid=t,o.identity=n,o.name=r,o.metadata=s,o.audioTrackPublications=new Map,o.videoTrackPublications=new Map,o.trackPublications=new Map,o._kind=u,o._attributes={},o}return Ft(e,Js.EventEmitter),ft(e,[{key:"logContext",get:function(){var t,n;return Object.assign({},(n=(t=this.loggerOptions)===null||t===void 0?void 0:t.loggerContextCb)===null||n===void 0?void 0:n.call(t))}},{key:"isEncrypted",get:function(){return this.trackPublications.size>0&&Array.from(this.trackPublications.values()).every(function(t){return t.isEncrypted})}},{key:"isAgent",get:function(){var t;return((t=this.permissions)===null||t===void 0?void 0:t.agent)||this.kind===cd.AGENT}},{key:"kind",get:function(){return this._kind}},{key:"attributes",get:function(){return Object.freeze(Object.assign({},this._attributes))}},{key:"getTrackPublications",value:function(){return Array.from(this.trackPublications.values())}},{key:"getTrackPublication",value:function(t){var n,r=dt(this.trackPublications);try{for(r.s();!(n=r.n()).done;){var s=Pt(n.value,2)[1];if(s.source===t)return s}}catch(a){r.e(a)}finally{r.f()}}},{key:"getTrackPublicationByName",value:function(t){var n,r=dt(this.trackPublications);try{for(r.s();!(n=r.n()).done;){var s=Pt(n.value,2)[1];if(s.trackName===t)return s}}catch(a){r.e(a)}finally{r.f()}}},{key:"connectionQuality",get:function(){return this._connectionQuality}},{key:"isCameraEnabled",get:function(){var t,n=this.getTrackPublication(Me.Source.Camera);return!((t=n==null?void 0:n.isMuted)===null||t===void 0||t)}},{key:"isMicrophoneEnabled",get:function(){var t,n=this.getTrackPublication(Me.Source.Microphone);return!((t=n==null?void 0:n.isMuted)===null||t===void 0||t)}},{key:"isScreenShareEnabled",get:function(){return!!this.getTrackPublication(Me.Source.ScreenShare)}},{key:"isLocal",get:function(){return!1}},{key:"joinedAt",get:function(){return this.participantInfo?new Date(1e3*Number.parseInt(this.participantInfo.joinedAt.toString())):new Date}},{key:"updateInfo",value:function(t){return(!this.participantInfo||this.participantInfo.sid!==t.sid||this.participantInfo.version<=t.version)&&(this.identity=t.identity,this.sid=t.sid,this._setName(t.name),this._setMetadata(t.metadata),this._setAttributes(t.attributes),t.permission&&this.setPermissions(t.permission),this.participantInfo=t,this.log.trace("update participant info",Object.assign(Object.assign({},this.logContext),{info:t})),!0)}},{key:"_setMetadata",value:function(t){var n=this.metadata!==t,r=this.metadata;this.metadata=t,n&&this.emit(Xe.ParticipantMetadataChanged,r)}},{key:"_setName",value:function(t){var n=this.name!==t;this.name=t,n&&this.emit(Xe.ParticipantNameChanged,t)}},{key:"_setAttributes",value:function(t){var n=function(r,s){var a;r===void 0&&(r={}),s===void 0&&(s={});var o,c={},u=dt([].concat(Pi(Object.keys(s)),Pi(Object.keys(r))));try{for(u.s();!(o=u.n()).done;){var d=o.value;r[d]!==s[d]&&(c[d]=(a=s[d])!==null&&a!==void 0?a:"")}}catch(h){u.e(h)}finally{u.f()}return c}(this.attributes,t);this._attributes=t,Object.keys(n).length>0&&this.emit(Xe.AttributesChanged,n)}},{key:"setPermissions",value:function(t){var n,r,s,a,o,c,u=this,d=this.permissions,h=t.canPublish!==((n=this.permissions)===null||n===void 0?void 0:n.canPublish)||t.canSubscribe!==((r=this.permissions)===null||r===void 0?void 0:r.canSubscribe)||t.canPublishData!==((s=this.permissions)===null||s===void 0?void 0:s.canPublishData)||t.hidden!==((a=this.permissions)===null||a===void 0?void 0:a.hidden)||t.recorder!==((o=this.permissions)===null||o===void 0?void 0:o.recorder)||t.canPublishSources.length!==this.permissions.canPublishSources.length||t.canPublishSources.some(function(b,v){var y;return b!==((y=u.permissions)===null||y===void 0?void 0:y.canPublishSources[v])})||t.canSubscribeMetrics!==((c=this.permissions)===null||c===void 0?void 0:c.canSubscribeMetrics);return this.permissions=t,h&&this.emit(Xe.ParticipantPermissionsChanged,d),h}},{key:"setIsSpeaking",value:function(t){t!==this.isSpeaking&&(this.isSpeaking=t,t&&(this.lastSpokeAt=new Date),this.emit(Xe.IsSpeakingChanged,t))}},{key:"setConnectionQuality",value:function(t){var n=this._connectionQuality;this._connectionQuality=function(r){switch(r){case Ol.EXCELLENT:return vs.Excellent;case Ol.GOOD:return vs.Good;case Ol.POOR:return vs.Poor;case Ol.LOST:return vs.Lost;default:return vs.Unknown}}(t),n!==this._connectionQuality&&this.emit(Xe.ConnectionQualityChanged,this._connectionQuality)}},{key:"setAudioContext",value:function(t){this.audioContext=t,this.audioTrackPublications.forEach(function(n){return(n.track instanceof ql||n.track instanceof Pn)&&n.track.setAudioContext(t)})}},{key:"addTrackPublication",value:function(t){var n=this;t.on(qe.Muted,function(){n.emit(Xe.TrackMuted,t)}),t.on(qe.Unmuted,function(){n.emit(Xe.TrackUnmuted,t)});var r=t;switch(r.track&&(r.track.sid=t.trackSid),this.trackPublications.set(t.trackSid,t),t.kind){case Me.Kind.Audio:this.audioTrackPublications.set(t.trackSid,t);break;case Me.Kind.Video:this.videoTrackPublications.set(t.trackSid,t);break}}}]),e}(),jt,kS=function(i){function e(t,n,r,s){var a;return ht(this,e),(a=Ut(this,e,[t,n,void 0,void 0,{loggerName:s.loggerName,loggerContextCb:function(){return a.engine.logContext}}])).pendingPublishing=new Set,a.pendingPublishPromises=new Map,a.participantTrackPermissions=[],a.allParticipantsAllowedToSubscribe=!0,a.encryptionType=Ni.NONE,a.enabledPublishVideoCodecs=[],a.handleReconnecting=function(){a.reconnectFuture||(a.reconnectFuture=new zT)},a.handleReconnected=function(){var o,c;(c=(o=a.reconnectFuture)===null||o===void 0?void 0:o.resolve)===null||c===void 0||c.call(o),a.reconnectFuture=void 0,a.updateTrackSubscriptionPermissions()},a.handleDisconnected=function(){var o,c;a.reconnectFuture&&(a.reconnectFuture.promise.catch(function(u){return a.log.warn(u.message,a.logContext)}),(c=(o=a.reconnectFuture)===null||o===void 0?void 0:o.reject)===null||c===void 0||c.call(o,"Got disconnected during reconnection attempt"),a.reconnectFuture=void 0)},a.handleSignalRequestResponse=function(o){var c=o.requestId,u=o.reason,d=o.message,h=a.pendingSignalRequests.get(c);h&&(u!==Fk.OK&&h.reject(new NT(d,u)),a.pendingSignalRequests.delete(c))},a.updateTrackSubscriptionPermissions=function(){a.log.debug("updating track subscription permissions",Object.assign(Object.assign({},a.logContext),{allParticipantsAllowed:a.allParticipantsAllowedToSubscribe,participantTrackPermissions:a.participantTrackPermissions})),a.engine.client.sendUpdateSubscriptionPermissions(a.allParticipantsAllowedToSubscribe,a.participantTrackPermissions.map(function(o){return function(c){var u,d,h;if(!c.participantSid&&!c.participantIdentity)throw new Error("Invalid track permission, must provide at least one of participantIdentity and participantSid");return new Mk({participantIdentity:(u=c.participantIdentity)!==null&&u!==void 0?u:"",participantSid:(d=c.participantSid)!==null&&d!==void 0?d:"",allTracks:(h=c.allowAll)!==null&&h!==void 0&&h,trackSids:c.allowedTrackSids||[]})}(o)}))},a.onTrackUnmuted=function(o){a.onTrackMuted(o,o.isUpstreamPaused)},a.onTrackMuted=function(o,c){c===void 0&&(c=!0),o.sid?a.engine.updateMuteStatus(o.sid,c):a.log.error("could not update mute status for unpublished track",Object.assign(Object.assign({},a.logContext),Ht(o)))},a.onTrackUpstreamPaused=function(o){a.log.debug("upstream paused",Object.assign(Object.assign({},a.logContext),Ht(o))),a.onTrackMuted(o,!0)},a.onTrackUpstreamResumed=function(o){a.log.debug("upstream resumed",Object.assign(Object.assign({},a.logContext),Ht(o))),a.onTrackMuted(o,o.isMuted)},a.onTrackFeatureUpdate=function(o){var c=a.audioTrackPublications.get(o.sid);c?a.engine.client.sendUpdateLocalAudioTrack(c.trackSid,c.getTrackFeatures()):a.log.warn("Could not update local audio track settings, missing publication for track ".concat(o.sid),a.logContext)},a.handleSubscribedQualityUpdate=function(o){return he(ct(a),void 0,void 0,F().mark(function c(){var u,d,h,b,v,y,p,f,m,_,k,D;return F().wrap(function(w){for(;;)switch(w.prev=w.next){case 0:if(!((v=this.roomOptions)===null||v===void 0)&&v.dynacast){w.next=2;break}return w.abrupt("return");case 2:if(p=this.videoTrackPublications.get(o.trackSid)){w.next=6;break}return this.log.warn("received subscribed quality update for unknown track",Object.assign(Object.assign({},this.logContext),{trackSid:o.trackSid})),w.abrupt("return");case 6:if(o.subscribedCodecs.length<=0){w.next=46;break}if(p.videoTrack){w.next=9;break}return w.abrupt("return");case 9:return w.next=11,p.videoTrack.setPublishingCodecs(o.subscribedCodecs);case 11:f=w.sent,w.prev=12,m=!0,_=po(f);case 14:return w.next=16,_.next();case 16:if(k=w.sent,u=k.done){w.next=29;break}if(b=k.value,m=!1,!P9(D=b)){w.next=26;break}return this.log.debug("publish ".concat(D," for ").concat(p.videoTrack.sid),Object.assign(Object.assign({},this.logContext),Ht(p))),w.next=26,this.publishAdditionalCodecForTrack(p.videoTrack,D,p.options);case 26:m=!0,w.next=14;break;case 29:w.next=34;break;case 31:w.prev=31,w.t0=w.catch(12),d={error:w.t0};case 34:if(w.prev=34,w.prev=35,m||u||!(h=_.return)){w.next=39;break}return w.next=39,h.call(_);case 39:if(w.prev=39,!d){w.next=42;break}throw d.error;case 42:return w.finish(39);case 43:return w.finish(34);case 44:w.next=49;break;case 46:if(o.subscribedQualities.length<=0){w.next=49;break}return w.next=49,(y=p.videoTrack)===null||y===void 0?void 0:y.setPublishingLayers(o.subscribedQualities);case 49:case"end":return w.stop()}},c,this,[[12,31,34,44],[35,,39,43]])}))},a.handleLocalTrackUnpublished=function(o){var c=a.trackPublications.get(o.trackSid);c?a.unpublishTrack(c.track):a.log.warn("received unpublished event for unknown track",Object.assign(Object.assign({},a.logContext),{trackSid:o.trackSid}))},a.handleTrackEnded=function(o){return he(ct(a),void 0,void 0,F().mark(function c(){var u;return F().wrap(function(d){for(;;)switch(d.prev=d.next){case 0:if(o.source!==Me.Source.ScreenShare&&o.source!==Me.Source.ScreenShareAudio){d.next=5;break}this.log.debug("unpublishing local track due to TrackEnded",Object.assign(Object.assign({},this.logContext),Ht(o))),this.unpublishTrack(o),d.next=41;break;case 5:if(!o.isUserProvided){d.next=10;break}return d.next=8,o.mute();case 8:d.next=41;break;case 10:if(!(o instanceof Pn||o instanceof $n)){d.next=41;break}if(d.prev=11,!vi()){d.next=25;break}return d.prev=13,d.next=16,navigator==null?void 0:navigator.permissions.query({name:o.source===Me.Source.Camera?"camera":"microphone"});case 16:if(!(u=d.sent)||u.state!=="denied"){d.next=21;break}throw this.log.warn("user has revoked access to ".concat(o.source),Object.assign(Object.assign({},this.logContext),Ht(o))),u.onchange=function(){u.state!=="denied"&&(o.isMuted||o.restartTrack(),u.onchange=null)},new Error("GetUserMedia Permission denied");case 21:d.next=25;break;case 23:d.prev=23,d.t0=d.catch(13);case 25:if(o.isMuted){d.next=34;break}if(this.log.debug("track ended, attempting to use a different device",Object.assign(Object.assign({},this.logContext),Ht(o))),!(o instanceof Pn)){d.next=32;break}return d.next=30,o.restartTrack({deviceId:"default"});case 30:d.next=34;break;case 32:return d.next=34,o.restartTrack();case 34:d.next=41;break;case 36:return d.prev=36,d.t1=d.catch(11),this.log.warn("could not restart track, muting instead",Object.assign(Object.assign({},this.logContext),Ht(o))),d.next=41,o.mute();case 41:case"end":return d.stop()}},c,this,[[11,36],[13,23]])}))},a.audioTrackPublications=new Map,a.videoTrackPublications=new Map,a.trackPublications=new Map,a.engine=r,a.roomOptions=s,a.setupEngine(r),a.activeDeviceMap=new Map,a.pendingSignalRequests=new Map,a}return Ft(e,_S),ft(e,[{key:"lastCameraError",get:function(){return this.cameraError}},{key:"lastMicrophoneError",get:function(){return this.microphoneError}},{key:"isE2EEEnabled",get:function(){return this.encryptionType!==Ni.NONE}},{key:"getTrackPublication",value:function(t){var n=pt(lt(e.prototype),"getTrackPublication",this).call(this,t);if(n)return n}},{key:"getTrackPublicationByName",value:function(t){var n=pt(lt(e.prototype),"getTrackPublicationByName",this).call(this,t);if(n)return n}},{key:"setupEngine",value:function(t){var n=this;this.engine=t,this.engine.on(Ze.RemoteMute,function(r,s){var a=n.trackPublications.get(r);a&&a.track&&(s?a.mute():a.unmute())}),this.engine.on(Ze.Connected,this.handleReconnected).on(Ze.SignalRestarted,this.handleReconnected).on(Ze.SignalResumed,this.handleReconnected).on(Ze.Restarting,this.handleReconnecting).on(Ze.Resuming,this.handleReconnecting).on(Ze.LocalTrackUnpublished,this.handleLocalTrackUnpublished).on(Ze.SubscribedQualityUpdate,this.handleSubscribedQualityUpdate).on(Ze.Disconnected,this.handleDisconnected).on(Ze.SignalRequestResponse,this.handleSignalRequestResponse)}},{key:"setMetadata",value:function(t){return he(this,void 0,void 0,F().mark(function n(){return F().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,this.requestMetadataUpdate({metadata:t});case 2:case"end":return r.stop()}},n,this)}))}},{key:"setName",value:function(t){return he(this,void 0,void 0,F().mark(function n(){return F().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,this.requestMetadataUpdate({name:t});case 2:case"end":return r.stop()}},n,this)}))}},{key:"setAttributes",value:function(t){return he(this,void 0,void 0,F().mark(function n(){return F().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,this.requestMetadataUpdate({attributes:t});case 2:case"end":return r.stop()}},n,this)}))}},{key:"requestMetadataUpdate",value:function(t){return he(this,arguments,void 0,function(n){var r=this,s=n.metadata,a=n.name,o=n.attributes;return F().mark(function c(){return F().wrap(function(u){for(;;)switch(u.prev=u.next){case 0:return u.abrupt("return",new Promise(function(d,h){return he(r,void 0,void 0,F().mark(function b(){var v,y,p,f,m,_=this;return F().wrap(function(k){for(;;)switch(k.prev=k.next){case 0:return k.prev=0,p=!1,k.next=4,this.engine.client.sendUpdateLocalMetadata((v=s??this.metadata)!==null&&v!==void 0?v:"",(y=a??this.name)!==null&&y!==void 0?y:"",o);case 4:f=k.sent,m=performance.now(),this.pendingSignalRequests.set(f,{resolve:d,reject:function(D){h(D),p=!0},values:{name:a,metadata:s,attributes:o}});case 7:if(performance.now()-m>=5e3||p){k.next=16;break}if(a&&this.name!==a||s&&this.metadata!==s||o&&!Object.entries(o).every(function(D){var w=Pt(D,2),A=w[0],x=w[1];return _.attributes[A]===x||x===""&&!_.attributes[A]})){k.next=12;break}return this.pendingSignalRequests.delete(f),d(),k.abrupt("return");case 12:return k.next=14,yr(50);case 14:k.next=7;break;case 16:h(new NT("Request to update local metadata timed out","TimeoutError")),k.next=22;break;case 19:k.prev=19,k.t0=k.catch(0),k.t0 instanceof Error&&h(k.t0);case 22:case"end":return k.stop()}},b,this,[[0,19]])}))}));case 1:case"end":return u.stop()}},c)})()})}},{key:"setCameraEnabled",value:function(t,n,r){return this.setTrackEnabled(Me.Source.Camera,t,n,r)}},{key:"setMicrophoneEnabled",value:function(t,n,r){return this.setTrackEnabled(Me.Source.Microphone,t,n,r)}},{key:"setScreenShareEnabled",value:function(t,n,r){return this.setTrackEnabled(Me.Source.ScreenShare,t,n,r)}},{key:"setPermissions",value:function(t){var n=this.permissions,r=pt(lt(e.prototype),"setPermissions",this).call(this,t);return r&&n&&this.emit(Xe.ParticipantPermissionsChanged,n),r}},{key:"setE2EEEnabled",value:function(t){return he(this,void 0,void 0,F().mark(function n(){return F().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return this.encryptionType=t?Ni.GCM:Ni.NONE,r.next=3,this.republishAllTracks(void 0,!1);case 3:case"end":return r.stop()}},n,this)}))}},{key:"setTrackEnabled",value:function(t,n,r,s){return he(this,void 0,void 0,F().mark(function a(){var o,c,u,d,h,b,v,y,p,f,m,_;return F().wrap(function(k){for(;;)switch(k.prev=k.next){case 0:if(this.log.debug("setTrackEnabled",Object.assign(Object.assign({},this.logContext),{source:t,enabled:n})),!this.republishPromise){k.next=4;break}return k.next=4,this.republishPromise;case 4:if(u=this.getTrackPublication(t),!n){k.next=57;break}if(!u){k.next=11;break}return k.next=9,u.unmute();case 9:k.next=55;break;case 11:if(!this.pendingPublishing.has(t)){k.next=19;break}return k.next=14,this.waitForPendingPublicationOfSource(t);case 14:return(h=k.sent)||this.log.info("skipping duplicate published source",Object.assign(Object.assign({},this.logContext),{source:t})),k.next=18,h==null?void 0:h.unmute();case 18:return k.abrupt("return",h);case 19:this.pendingPublishing.add(t),k.prev=20,k.t0=t,k.next=k.t0===Me.Source.Camera?24:k.t0===Me.Source.Microphone?28:k.t0===Me.Source.ScreenShare?32:36;break;case 24:return k.next=26,this.createTracks({video:(o=r)===null||o===void 0||o});case 26:return d=k.sent,k.abrupt("break",37);case 28:return k.next=30,this.createTracks({audio:(c=r)===null||c===void 0||c});case 30:return d=k.sent,k.abrupt("break",37);case 32:return k.next=34,this.createScreenTracks(Object.assign({},r));case 34:return d=k.sent,k.abrupt("break",37);case 36:throw new vr(t);case 37:b=[],v=dt(d);try{for(v.s();!(y=v.n()).done;)p=y.value,this.log.info("publishing track",Object.assign(Object.assign({},this.logContext),Ht(p))),b.push(this.publishTrack(p,s))}catch(D){v.e(D)}finally{v.f()}return k.next=42,Promise.all(b);case 42:f=k.sent,m=Pt(f,1),u=m[0],k.next=52;break;case 47:throw k.prev=47,k.t1=k.catch(20),d==null||d.forEach(function(D){D.stop()}),k.t1 instanceof Error&&!(k.t1 instanceof vr)&&this.emit(Xe.MediaDevicesError,k.t1),k.t1;case 52:return k.prev=52,this.pendingPublishing.delete(t),k.finish(52);case 55:k.next=72;break;case 57:if(u!=null&&u.track){k.next=61;break}return k.next=60,this.waitForPendingPublicationOfSource(t);case 60:u=k.sent;case 61:if(!u||!u.track){k.next=72;break}if(t!==Me.Source.ScreenShare){k.next=70;break}return k.next=65,this.unpublishTrack(u.track);case 65:u=k.sent,(_=this.getTrackPublication(Me.Source.ScreenShareAudio))&&_.track&&this.unpublishTrack(_.track),k.next=72;break;case 70:return k.next=72,u.mute();case 72:return k.abrupt("return",u);case 73:case"end":return k.stop()}},a,this,[[20,47,52,55]])}))}},{key:"enableCameraAndMicrophone",value:function(){return he(this,void 0,void 0,F().mark(function t(){var n,r=this;return F().wrap(function(s){for(;;)switch(s.prev=s.next){case 0:if(!this.pendingPublishing.has(Me.Source.Camera)&&!this.pendingPublishing.has(Me.Source.Microphone)){s.next=2;break}return s.abrupt("return");case 2:return this.pendingPublishing.add(Me.Source.Camera),this.pendingPublishing.add(Me.Source.Microphone),s.prev=4,s.next=7,this.createTracks({audio:!0,video:!0});case 7:return n=s.sent,s.next=10,Promise.all(n.map(function(a){return r.publishTrack(a)}));case 10:return s.prev=10,this.pendingPublishing.delete(Me.Source.Camera),this.pendingPublishing.delete(Me.Source.Microphone),s.finish(10);case 14:case"end":return s.stop()}},t,this,[[4,,10,14]])}))}},{key:"createTracks",value:function(t){return he(this,void 0,void 0,F().mark(function n(){var r,s,a,o,c,u,d,h,b=this;return F().wrap(function(v){for(;;)switch(v.prev=v.next){case 0:return t!=null||(t={}),a=bS(t),o=a.audioProcessor,c=a.videoProcessor,u=MT(t,(r=this.roomOptions)===null||r===void 0?void 0:r.audioCaptureDefaults,(s=this.roomOptions)===null||s===void 0?void 0:s.videoCaptureDefaults),d=Sd(u),v.prev=4,v.next=7,navigator.mediaDevices.getUserMedia(d);case 7:h=v.sent,v.next=14;break;case 10:throw v.prev=10,v.t0=v.catch(4),v.t0 instanceof Error&&(d.audio&&(this.microphoneError=v.t0),d.video&&(this.cameraError=v.t0)),v.t0;case 14:return d.audio&&(this.microphoneError=void 0,this.emit(Xe.AudioStreamAcquired)),d.video&&(this.cameraError=void 0),v.abrupt("return",Promise.all(h.getTracks().map(function(y){return he(b,void 0,void 0,F().mark(function p(){var f,m,_,k,D=this;return F().wrap(function(w){for(;;)switch(w.prev=w.next){case 0:if((f=y.kind==="audio")?u.audio:u.video,typeof(_=f?d.audio:d.video)!="boolean"&&(m=_),(k=oS(y,m,{loggerName:this.roomOptions.loggerName,loggerContextCb:function(){return D.logContext}})).kind===Me.Kind.Video?k.source=Me.Source.Camera:k.kind===Me.Kind.Audio&&(k.source=Me.Source.Microphone,k.setAudioContext(this.audioContext)),k.mediaStream=h,!(k instanceof Pn&&o)){w.next=12;break}return w.next=10,k.setProcessor(o);case 10:w.next=15;break;case 12:if(!(k instanceof $n&&c)){w.next=15;break}return w.next=15,k.setProcessor(c);case 15:return w.abrupt("return",k);case 16:case"end":return w.stop()}},p,this)}))})));case 17:case"end":return v.stop()}},n,this,[[4,10]])}))}},{key:"createScreenTracks",value:function(t){return he(this,void 0,void 0,F().mark(function n(){var r,s,a,o,c,u,d=this;return F().wrap(function(h){for(;;)switch(h.prev=h.next){case 0:if(t===void 0&&(t={}),navigator.mediaDevices.getDisplayMedia!==void 0){h.next=3;break}throw new Im("getDisplayMedia not supported");case 3:return t.resolution!==void 0||(b=void 0,((b=Br())==null?void 0:b.name)==="Safari"&&b.version.startsWith("17."))||(t.resolution=Bm.h1080fps30.resolution),r=O9(t),h.next=7,navigator.mediaDevices.getDisplayMedia(r);case 7:if(s=h.sent,(a=s.getVideoTracks()).length!==0){h.next=11;break}throw new vr("no video track found");case 11:return(o=new $n(a[0],void 0,!1,{loggerName:this.roomOptions.loggerName,loggerContextCb:function(){return d.logContext}})).source=Me.Source.ScreenShare,t.contentHint&&(o.mediaStreamTrack.contentHint=t.contentHint),c=[o],s.getAudioTracks().length>0&&(this.emit(Xe.AudioStreamAcquired),(u=new Pn(s.getAudioTracks()[0],void 0,!1,this.audioContext,{loggerName:this.roomOptions.loggerName,loggerContextCb:function(){return d.logContext}})).source=Me.Source.ScreenShareAudio,c.push(u)),h.abrupt("return",c);case 17:case"end":return h.stop()}var b},n,this)}))}},{key:"publishTrack",value:function(t,n){return he(this,void 0,void 0,F().mark(function r(){return F().wrap(function(s){for(;;)switch(s.prev=s.next){case 0:return s.abrupt("return",this.publishOrRepublishTrack(t,n));case 1:case"end":return s.stop()}},r,this)}))}},{key:"publishOrRepublishTrack",value:function(t,n){return he(this,arguments,void 0,function(r,s){var a=this,o=arguments.length>2&&arguments[2]!==void 0&&arguments[2];return F().mark(function c(){var u,d,h,b,v,y,p,f,m,_,k,D;return F().wrap(function(w){for(;;)switch(w.prev=w.next){case 0:return r instanceof Pn&&r.setAudioContext(a.audioContext),w.next=3,(u=a.reconnectFuture)===null||u===void 0?void 0:u.promise;case 3:if(!a.republishPromise||o){w.next=6;break}return w.next=6,a.republishPromise;case 6:if(!(r instanceof bo&&a.pendingPublishPromises.has(r))){w.next=9;break}return w.next=9,a.pendingPublishPromises.get(r);case 9:if(!(r instanceof MediaStreamTrack)){w.next=13;break}v=r.getConstraints(),w.next=22;break;case 13:v=r.constraints,y=void 0,w.t0=r.source,w.next=w.t0===Me.Source.Microphone?18:w.t0===Me.Source.Camera?20:21;break;case 18:return y="audioinput",w.abrupt("break",21);case 20:y="videoinput";case 21:y&&a.activeDeviceMap.has(y)&&(v=Object.assign(Object.assign({},v),{deviceId:a.activeDeviceMap.get(y)}));case 22:if(!(r instanceof MediaStreamTrack)){w.next=33;break}w.t1=r.kind,w.next=w.t1==="audio"?26:w.t1==="video"?28:30;break;case 26:return r=new Pn(r,v,!0,a.audioContext,{loggerName:a.roomOptions.loggerName,loggerContextCb:function(){return a.logContext}}),w.abrupt("break",31);case 28:return r=new $n(r,v,!0,{loggerName:a.roomOptions.loggerName,loggerContextCb:function(){return a.logContext}}),w.abrupt("break",31);case 30:throw new vr("unsupported MediaStreamTrack kind ".concat(r.kind));case 31:w.next=34;break;case 33:r.updateLoggerOptions({loggerName:a.roomOptions.loggerName,loggerContextCb:function(){return a.logContext}});case 34:if(a.trackPublications.forEach(function(A){A.track&&A.track===r&&(p=A)}),!p){w.next=38;break}return a.log.warn("track has already been published, skipping",Object.assign(Object.assign({},a.logContext),Ht(p))),w.abrupt("return",p);case 38:return f="channelCount"in r.mediaStreamTrack.getSettings()&&r.mediaStreamTrack.getSettings().channelCount===2||r.mediaStreamTrack.getConstraints().channelCount===2,(m=(d=s==null?void 0:s.forceStereo)!==null&&d!==void 0?d:f)&&(s||(s={}),s.dtx===void 0&&a.log.info("Opus DTX will be disabled for stereo tracks by default. Enable them explicitly to make it work.",Object.assign(Object.assign({},a.logContext),Ht(r))),s.red===void 0&&a.log.info("Opus RED will be disabled for stereo tracks by default. Enable them explicitly to make it work."),(h=s.dtx)!==null&&h!==void 0||(s.dtx=!1),(b=s.red)!==null&&b!==void 0||(s.red=!1)),_=Object.assign(Object.assign({},a.roomOptions.publishDefaults),s),!L9()&&a.roomOptions.e2ee&&(a.log.info("End-to-end encryption is set up, simulcast publishing will be disabled on Safari versions and iOS browsers running iOS < v17.2",Object.assign({},a.logContext)),_.simulcast=!1),_.source&&(r.source=_.source),k=a.publish(r,_,m),a.pendingPublishPromises.set(r,k),w.prev=46,w.next=49,k;case 49:return D=w.sent,w.abrupt("return",D);case 53:throw w.prev=53,w.t2=w.catch(46),w.t2;case 56:return w.prev=56,a.pendingPublishPromises.delete(r),w.finish(56);case 59:case"end":return w.stop()}},c,null,[[46,53,56,59]])})()})}},{key:"publish",value:function(t,n,r){return he(this,void 0,void 0,F().mark(function s(){var a,o,c,u,d,h,b,v,y,p,f,m,_,k,D,w,A,x,P,S,M,U=this;return F().wrap(function(B){for(;;)switch(B.prev=B.next){case 0:if(Array.from(this.trackPublications.values()).find(function(Q){return t instanceof bo&&Q.source===t.source})&&t.source!==Me.Source.Unknown&&this.log.info("publishing a second track with the same source: ".concat(t.source),Object.assign(Object.assign({},this.logContext),Ht(t))),n.stopMicTrackOnMute&&t instanceof Pn&&(t.stopOnMute=!0),t.source===Me.Source.ScreenShare&&yo()&&(n.simulcast=!1),n.videoCodec!=="av1"||M9()||(n.videoCodec=void 0),n.videoCodec!=="vp9"||R9()||(n.videoCodec=void 0),n.videoCodec===void 0&&(n.videoCodec=Xm),this.enabledPublishVideoCodecs.length>0&&(this.enabledPublishVideoCodecs.some(function(Q){return n.videoCodec===Cd(Q.mime)})||(n.videoCodec=Cd(this.enabledPublishVideoCodecs[0].mime))),f=n.videoCodec,t.on(qe.Muted,this.onTrackMuted),t.on(qe.Unmuted,this.onTrackUnmuted),t.on(qe.Ended,this.handleTrackEnded),t.on(qe.UpstreamPaused,this.onTrackUpstreamPaused),t.on(qe.UpstreamResumed,this.onTrackUpstreamResumed),t.on(qe.AudioTrackFeatureUpdate,this.onTrackFeatureUpdate),m=new mm({cid:t.mediaStreamTrack.id,name:n.name,type:Me.kindToProto(t.kind),muted:t.isMuted,source:Me.sourceToProto(t.source),disableDtx:!((a=n.dtx)===null||a===void 0||a),encryption:this.encryptionType,stereo:r,disableRed:this.isE2EEEnabled||!((o=n.red)===null||o===void 0||o),stream:n==null?void 0:n.stream}),t.kind!==Me.Kind.Video){B.next=36;break}return k={width:0,height:0},B.prev=18,B.next=21,t.waitForDimensions();case 21:k=B.sent,B.next=29;break;case 24:B.prev=24,B.t0=B.catch(18),D=(u=(c=this.roomOptions.videoCaptureDefaults)===null||c===void 0?void 0:c.resolution)!==null&&u!==void 0?u:Fl.h720.resolution,k={width:D.width,height:D.height},this.log.error("could not determine track dimensions, using defaults",Object.assign(Object.assign(Object.assign({},this.logContext),Ht(t)),{dims:k}));case 29:m.width=k.width,m.height=k.height,t instanceof $n&&(jl(f)&&(t.source===Me.Source.ScreenShare&&(n.scalabilityMode="L1T3","contentHint"in t.mediaStreamTrack&&(t.mediaStreamTrack.contentHint="motion",this.log.info("forcing contentHint to motion for screenshare with SVC codecs",Object.assign(Object.assign({},this.logContext),Ht(t))))),n.scalabilityMode=(d=n.scalabilityMode)!==null&&d!==void 0?d:"L3T3_KEY"),m.simulcastCodecs=[new pm({codec:f,cid:t.mediaStreamTrack.id})],n.backupCodec===!0&&(n.backupCodec={codec:Xm}),n.backupCodec&&f!==n.backupCodec.codec&&m.encryption===Ni.NONE&&(this.roomOptions.dynacast||(this.roomOptions.dynacast=!0),m.simulcastCodecs.push(new pm({codec:n.backupCodec.codec,cid:""})))),_=Zm(t.source===Me.Source.ScreenShare,m.width,m.height,n),m.layers=fS(m.width,m.height,_,jl(n.videoCodec)),B.next=37;break;case 36:t.kind===Me.Kind.Audio&&(_=[{maxBitrate:(h=n.audioPreset)===null||h===void 0?void 0:h.maxBitrate,priority:(v=(b=n.audioPreset)===null||b===void 0?void 0:b.priority)!==null&&v!==void 0?v:"high",networkPriority:(p=(y=n.audioPreset)===null||y===void 0?void 0:y.priority)!==null&&p!==void 0?p:"high"}]);case 37:if(this.engine&&!this.engine.isClosed){B.next=39;break}throw new bn("cannot publish track when not connected");case 39:if(w=function(){return he(U,void 0,void 0,F().mark(function Q(){var ie,Y,q,L,$,H,j;return F().wrap(function(W){for(;;)switch(W.prev=W.next){case 0:if(this.engine.pcManager){W.next=2;break}throw new bn("pcManager is not ready");case 2:return W.next=4,this.engine.createSender(t,n,_);case 4:if(t.sender=W.sent,t instanceof $n&&((ie=n.degradationPreference)!==null&&ie!==void 0||(n.degradationPreference=rR(t)),t.setDegradationPreference(n.degradationPreference)),!_){W.next=31;break}if(!yo()||t.kind!==Me.Kind.Audio){W.next=30;break}L=void 0,$=dt(this.engine.pcManager.publisher.getTransceivers()),W.prev=10,$.s();case 12:if((H=$.n()).done){W.next=19;break}if((j=H.value).sender!==t.sender){W.next=17;break}return L=j,W.abrupt("break",19);case 17:W.next=12;break;case 19:W.next=24;break;case 21:W.prev=21,W.t0=W.catch(10),$.e(W.t0);case 24:return W.prev=24,$.f(),W.finish(24);case 27:L&&this.engine.pcManager.publisher.setTrackCodecBitrate({transceiver:L,codec:"opus",maxbr:!((Y=_[0])===null||Y===void 0)&&Y.maxBitrate?_[0].maxBitrate/1e3:0}),W.next=31;break;case 30:t.codec&&jl(t.codec)&&(!((q=_[0])===null||q===void 0)&&q.maxBitrate)&&this.engine.pcManager.publisher.setTrackCodecBitrate({cid:m.cid,codec:t.codec,maxbr:_[0].maxBitrate/1e3});case 31:return W.next=33,this.engine.negotiate();case 33:case"end":return W.stop()}},Q,this,[[10,21,24,27]])}))},this.enabledPublishVideoCodecs.length<=0){B.next=47;break}return B.next=43,Promise.all([this.engine.addTrack(m),w()]);case 43:x=B.sent,A=x[0],B.next=54;break;case 47:return B.next=49,this.engine.addTrack(m);case 49:return(A=B.sent).codecs.forEach(function(Q){P===void 0&&(P=Q.mimeType)}),P&&t.kind===Me.Kind.Video&&(S=Cd(P))!==f&&(this.log.debug("falling back to server selected codec",Object.assign(Object.assign(Object.assign({},this.logContext),Ht(t)),{codec:S})),n.videoCodec=S,_=Zm(t.source===Me.Source.ScreenShare,m.width,m.height,n)),B.next=54,w();case 54:return(M=new Dd(t.kind,A,t,{loggerName:this.roomOptions.loggerName,loggerContextCb:function(){return U.logContext}})).options=n,t.sid=A.sid,this.log.debug("publishing ".concat(t.kind," with encodings"),Object.assign(Object.assign({},this.logContext),{encodings:_,trackInfo:A})),t instanceof $n?t.startMonitor(this.engine.client):t instanceof Pn&&t.startMonitor(),this.addTrackPublication(M),this.emit(Xe.LocalTrackPublished,M),B.abrupt("return",M);case 62:case"end":return B.stop()}},s,this,[[18,24]])}))}},{key:"isLocal",get:function(){return!0}},{key:"publishAdditionalCodecForTrack",value:function(t,n,r){return he(this,void 0,void 0,F().mark(function s(){var a,o,c,u,d,h,b,v,y,p=this;return F().wrap(function(f){for(;;)switch(f.prev=f.next){case 0:if(this.encryptionType===Ni.NONE){f.next=2;break}return f.abrupt("return");case 2:if(this.trackPublications.forEach(function(m){m.track&&m.track===t&&(o=m)}),o){f.next=5;break}throw new vr("track is not published");case 5:if(t instanceof $n){f.next=7;break}throw new vr("track is not a video track");case 7:if(c=Object.assign(Object.assign({},(a=this.roomOptions)===null||a===void 0?void 0:a.publishDefaults),r),u=iR(t,n,c)){f.next=12;break}return this.log.info("backup codec has been disabled, ignoring request to add additional codec for track",Object.assign(Object.assign({},this.logContext),Ht(t))),f.abrupt("return");case 12:if(d=t.addSimulcastTrack(n,u)){f.next=15;break}return f.abrupt("return");case 15:if((h=new mm({cid:d.mediaStreamTrack.id,type:Me.kindToProto(t.kind),muted:t.isMuted,source:Me.sourceToProto(t.source),sid:t.sid,simulcastCodecs:[{codec:c.videoCodec,cid:d.mediaStreamTrack.id}]})).layers=fS(h.width,h.height,u),this.engine&&!this.engine.isClosed){f.next=19;break}throw new bn("cannot publish track when not connected");case 19:return b=function(){return he(p,void 0,void 0,F().mark(function m(){return F().wrap(function(_){for(;;)switch(_.prev=_.next){case 0:return _.next=2,this.engine.createSimulcastSender(t,d,c,u);case 2:return _.next=4,this.engine.negotiate();case 4:case"end":return _.stop()}},m,this)}))},f.next=22,Promise.all([this.engine.addTrack(h),b()]);case 22:v=f.sent,y=v[0],this.log.debug("published ".concat(n," for track ").concat(t.sid),Object.assign(Object.assign({},this.logContext),{encodings:u,trackInfo:y}));case 25:case"end":return f.stop()}},s,this)}))}},{key:"unpublishTrack",value:function(t,n){return he(this,void 0,void 0,F().mark(function r(){var s,a,o,c,u,d,h,b,v,y,p,f,m,_;return F().wrap(function(k){for(;;)switch(k.prev=k.next){case 0:if(!(t instanceof bo)){k.next=6;break}if(!(o=this.pendingPublishPromises.get(t))){k.next=6;break}return this.log.info("awaiting publish promise before attempting to unpublish",Object.assign(Object.assign({},this.logContext),Ht(t))),k.next=6,o;case 6:if(c=this.getPublicationForTrack(t),u=c?Ht(c):void 0,this.log.debug("unpublishing track",Object.assign(Object.assign({},this.logContext),u)),c&&c.track){k.next=12;break}return this.log.warn("track was not unpublished because no publication was found",Object.assign(Object.assign({},this.logContext),u)),k.abrupt("return",void 0);case 12:if((t=c.track).off(qe.Muted,this.onTrackMuted),t.off(qe.Unmuted,this.onTrackUnmuted),t.off(qe.Ended,this.handleTrackEnded),t.off(qe.UpstreamPaused,this.onTrackUpstreamPaused),t.off(qe.UpstreamResumed,this.onTrackUpstreamResumed),t.off(qe.AudioTrackFeatureUpdate,this.onTrackFeatureUpdate),n===void 0&&(n=(a=(s=this.roomOptions)===null||s===void 0?void 0:s.stopLocalTrackOnUnpublish)===null||a===void 0||a),n&&t.stop(),d=!1,h=t.sender,t.sender=void 0,this.engine.pcManager&&this.engine.pcManager.currentState<an.FAILED&&h)try{b=dt(this.engine.pcManager.publisher.getTransceivers());try{for(b.s();!(v=b.n()).done;)(y=v.value).sender===h&&(y.direction="inactive",d=!0)}catch(D){b.e(D)}finally{b.f()}if(this.engine.removeTrack(h)&&(d=!0),t instanceof $n){p=dt(t.simulcastCodecs);try{for(p.s();!(f=p.n()).done;)m=Pt(f.value,2),(_=m[1]).sender&&(this.engine.removeTrack(_.sender)&&(d=!0),_.sender=void 0)}catch(D){p.e(D)}finally{p.f()}t.simulcastCodecs.clear()}}catch(D){this.log.warn("failed to unpublish track",Object.assign(Object.assign(Object.assign({},this.logContext),u),{error:D}))}this.trackPublications.delete(c.trackSid),k.t0=c.kind,k.next=k.t0===Me.Kind.Audio?29:k.t0===Me.Kind.Video?31:33;break;case 29:return this.audioTrackPublications.delete(c.trackSid),k.abrupt("break",33);case 31:return this.videoTrackPublications.delete(c.trackSid),k.abrupt("break",33);case 33:if(this.emit(Xe.LocalTrackUnpublished,c),c.setTrack(void 0),!d){k.next=38;break}return k.next=38,this.engine.negotiate();case 38:return k.abrupt("return",c);case 39:case"end":return k.stop()}},r,this)}))}},{key:"unpublishTracks",value:function(t){return he(this,void 0,void 0,F().mark(function n(){var r,s=this;return F().wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return a.next=2,Promise.all(t.map(function(o){return s.unpublishTrack(o)}));case 2:return r=a.sent,a.abrupt("return",r.filter(function(o){return o instanceof Dd}));case 4:case"end":return a.stop()}},n)}))}},{key:"republishAllTracks",value:function(t){return he(this,arguments,void 0,function(n){var r=this,s=1>=arguments.length||arguments[1]===void 0||arguments[1];return F().mark(function a(){return F().wrap(function(o){for(;;)switch(o.prev=o.next){case 0:if(!r.republishPromise){o.next=3;break}return o.next=3,r.republishPromise;case 3:return r.republishPromise=new Promise(function(c,u){return he(r,void 0,void 0,F().mark(function d(){var h,b=this;return F().wrap(function(v){for(;;)switch(v.prev=v.next){case 0:return v.prev=0,h=[],this.trackPublications.forEach(function(y){y.track&&(n&&(y.options=Object.assign(Object.assign({},y.options),n)),h.push(y))}),v.next=5,Promise.all(h.map(function(y){return he(b,void 0,void 0,F().mark(function p(){var f;return F().wrap(function(m){for(;;)switch(m.prev=m.next){case 0:return f=y.track,m.next=3,this.unpublishTrack(f,!1);case 3:if(!s||f.isMuted||f.source===Me.Source.ScreenShare||f.source===Me.Source.ScreenShareAudio||!(f instanceof Pn||f instanceof $n)||f.isUserProvided){m.next=7;break}return this.log.debug("restarting existing track",Object.assign(Object.assign({},this.logContext),{track:y.trackSid})),m.next=7,f.restartTrack();case 7:return m.next=9,this.publishOrRepublishTrack(f,y.options,!0);case 9:case"end":return m.stop()}},p,this)}))}));case 5:c(),v.next=11;break;case 8:v.prev=8,v.t0=v.catch(0),u(v.t0);case 11:return v.prev=11,this.republishPromise=void 0,v.finish(11);case 14:case"end":return v.stop()}},d,this,[[0,8,11,14]])}))}),o.next=6,r.republishPromise;case 6:case"end":return o.stop()}},a)})()})}},{key:"publishData",value:function(t){return he(this,arguments,void 0,function(n){var r=this,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return F().mark(function a(){var o,c,u,d;return F().wrap(function(h){for(;;)switch(h.prev=h.next){case 0:return o=s.reliable?yn.RELIABLE:yn.LOSSY,c=s.destinationIdentities,u=s.topic,d=new Ll({kind:o,value:{case:"user",value:new kk({participantIdentity:r.identity,payload:n,destinationIdentities:c,topic:u})}}),h.next=6,r.engine.sendDataPacket(d,o);case 6:case"end":return h.stop()}},a)})()})}},{key:"publishDtmf",value:function(t,n){return he(this,void 0,void 0,F().mark(function r(){var s;return F().wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return s=new Ll({kind:yn.RELIABLE,value:{case:"sipDtmf",value:new Tk({code:t,digit:n})}}),a.next=3,this.engine.sendDataPacket(s,yn.RELIABLE);case 3:case"end":return a.stop()}},r,this)}))}},{key:"sendChatMessage",value:function(t){return he(this,void 0,void 0,F().mark(function n(){var r,s;return F().wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return r={id:crypto.randomUUID(),message:t,timestamp:Date.now()},s=new Ll({value:{case:"chatMessage",value:new hm(Object.assign(Object.assign({},r),{timestamp:Gt.parse(r.timestamp)}))}}),a.next=4,this.engine.sendDataPacket(s,yn.RELIABLE);case 4:return this.emit(Xe.ChatMessage,r),a.abrupt("return",r);case 6:case"end":return a.stop()}},n,this)}))}},{key:"editChatMessage",value:function(t,n){return he(this,void 0,void 0,F().mark(function r(){var s,a;return F().wrap(function(o){for(;;)switch(o.prev=o.next){case 0:return s=Object.assign(Object.assign({},n),{message:t,editTimestamp:Date.now()}),a=new Ll({value:{case:"chatMessage",value:new hm(Object.assign(Object.assign({},s),{timestamp:Gt.parse(s.timestamp),editTimestamp:Gt.parse(s.editTimestamp)}))}}),o.next=4,this.engine.sendDataPacket(a,yn.RELIABLE);case 4:return this.emit(Xe.ChatMessage,s),o.abrupt("return",s);case 6:case"end":return o.stop()}},r,this)}))}},{key:"setTrackSubscriptionPermissions",value:function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];this.participantTrackPermissions=n,this.allParticipantsAllowedToSubscribe=t,this.engine.client.isDisconnected||this.updateTrackSubscriptionPermissions()}},{key:"setEnabledPublishCodecs",value:function(t){this.enabledPublishVideoCodecs=t.filter(function(n){return n.mime.split("/")[0].toLowerCase()==="video"})}},{key:"updateInfo",value:function(t){var n=this;return t.sid===this.sid&&!!pt(lt(e.prototype),"updateInfo",this).call(this,t)&&(t.tracks.forEach(function(r){var s,a,o=n.trackPublications.get(r.sid);if(o){var c=o.isMuted||(a=(s=o.track)===null||s===void 0?void 0:s.isUpstreamPaused)!==null&&a!==void 0&&a;c!==r.muted&&(n.log.debug("updating server mute state after reconcile",Object.assign(Object.assign(Object.assign({},n.logContext),Ht(o)),{mutedOnServer:c})),n.engine.client.sendMuteTrack(r.sid,c))}}),!0)}},{key:"getPublicationForTrack",value:function(t){var n;return this.trackPublications.forEach(function(r){var s=r.track;s&&(t instanceof MediaStreamTrack?(s instanceof Pn||s instanceof $n)&&s.mediaStreamTrack===t&&(n=r):t===s&&(n=r))}),n}},{key:"waitForPendingPublicationOfSource",value:function(t){return he(this,void 0,void 0,F().mark(function n(){var r;return F().wrap(function(s){for(;;)switch(s.prev=s.next){case 0:if(!(r=Array.from(this.pendingPublishPromises.entries()).find(function(a){return Pt(a,1)[0].source===t}))){s.next=3;break}return s.abrupt("return",r[1]);case 3:case"end":return s.stop()}},n,this)}))}}]),e}(),TS=function(i){function e(t,n,r,s){var a;return ht(this,e),(a=Ut(this,e,[t,n.sid,n.name,s])).track=void 0,a.allowed=!0,a.disabled=!1,a.currentVideoQuality=Oi.HIGH,a.handleEnded=function(o){a.setTrack(void 0),a.emit(qe.Ended,o)},a.handleVisibilityChange=function(o){a.log.debug("adaptivestream video visibility ".concat(a.trackSid,", visible=").concat(o),a.logContext),a.disabled=!o,a.emitTrackUpdate()},a.handleVideoDimensionsChange=function(o){a.log.debug("adaptivestream video dimensions ".concat(o.width,"x").concat(o.height),a.logContext),a.videoDimensions=o,a.emitTrackUpdate()},a.subscribed=r,a.updateInfo(n),a}return Ft(e,Vr),ft(e,[{key:"setSubscribed",value:function(t){var n=this.subscriptionStatus,r=this.permissionStatus;this.subscribed=t,t&&(this.allowed=!0);var s=new ud({trackSids:[this.trackSid],subscribe:this.subscribed,participantTracks:[new Sk({participantSid:"",trackSids:[this.trackSid]})]});this.emit(qe.UpdateSubscription,s),this.emitSubscriptionUpdateIfChanged(n),this.emitPermissionUpdateIfChanged(r)}},{key:"subscriptionStatus",get:function(){return this.subscribed===!1?Vr.SubscriptionStatus.Unsubscribed:pt(lt(e.prototype),"isSubscribed",this)?Vr.SubscriptionStatus.Subscribed:Vr.SubscriptionStatus.Desired}},{key:"permissionStatus",get:function(){return this.allowed?Vr.PermissionStatus.Allowed:Vr.PermissionStatus.NotAllowed}},{key:"isSubscribed",get:function(){return this.subscribed!==!1&&pt(lt(e.prototype),"isSubscribed",this)}},{key:"isDesired",get:function(){return this.subscribed!==!1}},{key:"isEnabled",get:function(){return!this.disabled}},{key:"setEnabled",value:function(t){this.isManualOperationAllowed()&&this.disabled!==!t&&(this.disabled=!t,this.emitTrackUpdate())}},{key:"setVideoQuality",value:function(t){this.isManualOperationAllowed()&&this.currentVideoQuality!==t&&(this.currentVideoQuality=t,this.videoDimensions=void 0,this.emitTrackUpdate())}},{key:"setVideoDimensions",value:function(t){var n,r;this.isManualOperationAllowed()&&(((n=this.videoDimensions)===null||n===void 0?void 0:n.width)===t.width&&((r=this.videoDimensions)===null||r===void 0?void 0:r.height)===t.height||(this.track instanceof zl&&(this.videoDimensions=t),this.currentVideoQuality=void 0,this.emitTrackUpdate()))}},{key:"setVideoFPS",value:function(t){this.isManualOperationAllowed()&&this.track instanceof zl&&this.fps!==t&&(this.fps=t,this.emitTrackUpdate())}},{key:"videoQuality",get:function(){return this.currentVideoQuality}},{key:"setTrack",value:function(t){var n=this.subscriptionStatus,r=this.permissionStatus,s=this.track;s!==t&&(s&&(s.off(qe.VideoDimensionsChanged,this.handleVideoDimensionsChange),s.off(qe.VisibilityChanged,this.handleVisibilityChange),s.off(qe.Ended,this.handleEnded),s.detach(),s.stopMonitor(),this.emit(qe.Unsubscribed,s)),pt(lt(e.prototype),"setTrack",this).call(this,t),t&&(t.sid=this.trackSid,t.on(qe.VideoDimensionsChanged,this.handleVideoDimensionsChange),t.on(qe.VisibilityChanged,this.handleVisibilityChange),t.on(qe.Ended,this.handleEnded),this.emit(qe.Subscribed,t)),this.emitPermissionUpdateIfChanged(r),this.emitSubscriptionUpdateIfChanged(n))}},{key:"setAllowed",value:function(t){var n=this.subscriptionStatus,r=this.permissionStatus;this.allowed=t,this.emitPermissionUpdateIfChanged(r),this.emitSubscriptionUpdateIfChanged(n)}},{key:"setSubscriptionError",value:function(t){this.emit(qe.SubscriptionFailed,t)}},{key:"updateInfo",value:function(t){pt(lt(e.prototype),"updateInfo",this).call(this,t);var n=this.metadataMuted;this.metadataMuted=t.muted,this.track?this.track.setMuted(t.muted):n!==t.muted&&this.emit(t.muted?qe.Muted:qe.Unmuted)}},{key:"emitSubscriptionUpdateIfChanged",value:function(t){var n=this.subscriptionStatus;t!==n&&this.emit(qe.SubscriptionStatusChanged,n,t)}},{key:"emitPermissionUpdateIfChanged",value:function(t){this.permissionStatus!==t&&this.emit(qe.SubscriptionPermissionChanged,this.permissionStatus,t)}},{key:"isManualOperationAllowed",value:function(){return this.kind===Me.Kind.Video&&this.isAdaptiveStream?(this.log.warn("adaptive stream is enabled, cannot change video track settings",this.logContext),!1):!!this.isDesired||(this.log.warn("cannot update track settings when not subscribed",this.logContext),!1)}},{key:"isAdaptiveStream",get:function(){return this.track instanceof zl&&this.track.isAdaptiveStream}},{key:"emitTrackUpdate",value:function(){var t=new Ak({trackSids:[this.trackSid],disabled:this.disabled,fps:this.fps});this.videoDimensions?(t.width=Math.ceil(this.videoDimensions.width),t.height=Math.ceil(this.videoDimensions.height)):this.currentVideoQuality!==void 0?t.quality=this.currentVideoQuality:t.quality=Oi.HIGH,this.emit(qe.UpdateSettings,t)}}]),e}(),SS=function(i){function e(t,n,r,s,a,o){var c;return ht(this,e),(c=Ut(this,e,[n,r||"",s,a,o,arguments.length>6&&arguments[6]!==void 0?arguments[6]:cd.STANDARD])).signalClient=t,c.trackPublications=new Map,c.audioTrackPublications=new Map,c.videoTrackPublications=new Map,c.volumeMap=new Map,c}return Ft(e,_S),ft(e,[{key:"logContext",get:function(){return Object.assign(Object.assign({},pt(lt(e.prototype),"logContext",this)),{rpID:this.sid,remoteParticipant:this.identity})}},{key:"addTrackPublication",value:function(t){var n=this;pt(lt(e.prototype),"addTrackPublication",this).call(this,t),t.on(qe.UpdateSettings,function(r){n.log.debug("send update settings",Object.assign(Object.assign({},n.logContext),Ht(t))),n.signalClient.sendUpdateTrackSettings(r)}),t.on(qe.UpdateSubscription,function(r){r.participantTracks.forEach(function(s){s.participantSid=n.sid}),n.signalClient.sendUpdateSubscription(r)}),t.on(qe.SubscriptionPermissionChanged,function(r){n.emit(Xe.TrackSubscriptionPermissionChanged,t,r)}),t.on(qe.SubscriptionStatusChanged,function(r){n.emit(Xe.TrackSubscriptionStatusChanged,t,r)}),t.on(qe.Subscribed,function(r){n.emit(Xe.TrackSubscribed,r,t)}),t.on(qe.Unsubscribed,function(r){n.emit(Xe.TrackUnsubscribed,r,t)}),t.on(qe.SubscriptionFailed,function(r){n.emit(Xe.TrackSubscriptionFailed,t.trackSid,r)})}},{key:"getTrackPublication",value:function(t){var n=pt(lt(e.prototype),"getTrackPublication",this).call(this,t);if(n)return n}},{key:"getTrackPublicationByName",value:function(t){var n=pt(lt(e.prototype),"getTrackPublicationByName",this).call(this,t);if(n)return n}},{key:"setVolume",value:function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Me.Source.Microphone;this.volumeMap.set(n,t);var r=this.getTrackPublication(n);r&&r.track&&r.track.setVolume(t)}},{key:"getVolume",value:function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Me.Source.Microphone,n=this.getTrackPublication(t);return n&&n.track?n.track.getVolume():this.volumeMap.get(t)}},{key:"addSubscribedMediaTrack",value:function(t,n,r,s,a,o){var c,u=this,d=this.getTrackPublicationBySid(n);return d||n.startsWith("TR")||this.trackPublications.forEach(function(h){d||t.kind!==h.kind.toString()||(d=h)}),d?t.readyState==="ended"?(this.log.error("unable to subscribe because MediaStreamTrack is ended. Do not call MediaStreamTrack.stop()",Object.assign(Object.assign({},this.logContext),Ht(d))),void this.emit(Xe.TrackSubscriptionFailed,n)):((c=t.kind==="video"?new zl(t,n,s,a):new ql(t,n,s,this.audioContext,this.audioOutput)).source=d.source,c.isMuted=d.isMuted,c.setMediaStream(r),c.start(),d.setTrack(c),this.volumeMap.has(d.source)&&c instanceof ql&&c.setVolume(this.volumeMap.get(d.source)),d):o===0?(this.log.error("could not find published track",Object.assign(Object.assign({},this.logContext),{trackSid:n})),void this.emit(Xe.TrackSubscriptionFailed,n)):(o===void 0&&(o=20),void setTimeout(function(){u.addSubscribedMediaTrack(t,n,r,s,a,o-1)},150))}},{key:"hasMetadata",get:function(){return!!this.participantInfo}},{key:"getTrackPublicationBySid",value:function(t){return this.trackPublications.get(t)}},{key:"updateInfo",value:function(t){var n=this;if(!pt(lt(e.prototype),"updateInfo",this).call(this,t))return!1;var r=new Map,s=new Map;return t.tracks.forEach(function(a){var o,c,u=n.getTrackPublicationBySid(a.sid);if(u)u.updateInfo(a);else{var d=Me.kindFromProto(a.type);if(!d)return;(u=new TS(d,a,(o=n.signalClient.connectOptions)===null||o===void 0?void 0:o.autoSubscribe,{loggerContextCb:function(){return n.logContext},loggerName:(c=n.loggerOptions)===null||c===void 0?void 0:c.loggerName})).updateInfo(a),s.set(a.sid,u);var h=Array.from(n.trackPublications.values()).find(function(b){return b.source===(u==null?void 0:u.source)});h&&u.source!==Me.Source.Unknown&&n.log.debug("received a second track publication for ".concat(n.identity," with the same source: ").concat(u.source),Object.assign(Object.assign({},n.logContext),{oldTrack:Ht(h),newTrack:Ht(u)})),n.addTrackPublication(u)}r.set(a.sid,u)}),this.trackPublications.forEach(function(a){r.has(a.trackSid)||(n.log.trace("detected removed track on remote participant, unpublishing",Object.assign(Object.assign({},n.logContext),Ht(a))),n.unpublishTrack(a.trackSid,!0))}),s.forEach(function(a){n.emit(Xe.TrackPublished,a)}),!0}},{key:"unpublishTrack",value:function(t,n){var r=this.trackPublications.get(t);if(r){var s=r.track;switch(s&&(s.stop(),r.setTrack(void 0)),this.trackPublications.delete(t),r.kind){case Me.Kind.Audio:this.audioTrackPublications.delete(t);break;case Me.Kind.Video:this.videoTrackPublications.delete(t);break}n&&this.emit(Xe.TrackUnpublished,r)}}},{key:"setAudioOutput",value:function(t){return he(this,void 0,void 0,F().mark(function n(){var r;return F().wrap(function(s){for(;;)switch(s.prev=s.next){case 0:return this.audioOutput=t,r=[],this.audioTrackPublications.forEach(function(a){var o;a.track instanceof ql&&r.push(a.track.setSinkId((o=t.deviceId)!==null&&o!==void 0?o:"default"))}),s.next=5,Promise.all(r);case 5:case"end":return s.stop()}},n,this)}))}},{key:"emit",value:function(t){for(var n,r=arguments.length,s=new Array(r>1?r-1:0),a=1;r>a;a++)s[a-1]=arguments[a];return this.log.trace("participant event",Object.assign(Object.assign({},this.logContext),{event:t,args:s})),(n=pt(lt(e.prototype),"emit",this)).call.apply(n,[this,t].concat(s))}}],[{key:"fromParticipantInfo",value:function(t,n,r){return new e(t,n.sid,n.identity,n.name,n.metadata,r,n.kind)}}]),e}();(function(i){i.Disconnected="disconnected",i.Connecting="connecting",i.Connected="connected",i.Reconnecting="reconnecting",i.SignalReconnecting="signalReconnecting"})(jt||(jt={}));var CS,Ad=function(i){function e(t){var n,r,s,a;return ht(this,e),n=Ut(this,e),r=ct(n),n.state=jt.Disconnected,n.activeSpeakers=[],n.isE2EEEnabled=!1,n.audioEnabled=!0,n.isVideoPlaybackBlocked=!1,n.log=xt,n.bufferedEvents=[],n.isResuming=!1,n.connect=function(o,c,u){return he(ct(n),void 0,void 0,F().mark(function d(){var h,b,v,y,p=this;return F().wrap(function(f){for(;;)switch(f.prev=f.next){case 0:if(typeof RTCPeerConnection<"u"&&(Fm()||Vm())){f.next=6;break}if(!Ur()){f.next=5;break}throw Error("WebRTC isn't detected, have you called registerGlobals?");case 5:throw Error("LiveKit doesn't seem to be supported on this browser. Try to update your browser and make sure no browser extensions are disabling webRTC.");case 6:return f.next=8,this.disconnectLock.lock();case 8:if(b=f.sent,this.state!==jt.Connected){f.next=13;break}return this.log.info("already connected to room ".concat(this.name),this.logContext),b(),f.abrupt("return",Promise.resolve());case 13:if(!this.connectFuture){f.next=16;break}return b(),f.abrupt("return",this.connectFuture.promise);case 16:return this.setAndEmitConnectionState(jt.Connecting),((h=this.regionUrlProvider)===null||h===void 0?void 0:h.getServerUrl().toString())!==o&&(this.regionUrl=void 0,this.regionUrlProvider=void 0),$m(new URL(o))&&(this.regionUrlProvider===void 0?this.regionUrlProvider=new gS(o,c):this.regionUrlProvider.updateToken(c),this.regionUrlProvider.fetchRegionSettings().then(function(m){var _;(_=p.regionUrlProvider)===null||_===void 0||_.setServerReportedRegions(m)}).catch(function(m){p.log.warn("could not fetch region settings",Object.assign(Object.assign({},p.logContext),{error:m}))})),v=function m(_,k,D){return he(p,void 0,void 0,F().mark(function w(){var A,x,P,S;return F().wrap(function(M){for(;;)switch(M.prev=M.next){case 0:return this.abortController&&this.abortController.abort(),P=new AbortController,this.abortController=P,b==null||b(),M.prev=4,M.next=7,this.attemptConnection(D??o,c,u,P);case 7:this.abortController=void 0,_(),M.next=40;break;case 11:if(M.prev=11,M.t0=M.catch(4),!(this.regionUrlProvider&&M.t0 instanceof Wt&&M.t0.reason!==jn.Cancelled&&M.t0.reason!==jn.NotAllowed)){M.next=38;break}return S=null,M.prev=15,M.next=18,this.regionUrlProvider.getNextBestRegionUrl((A=this.abortController)===null||A===void 0?void 0:A.signal);case 18:S=M.sent,M.next=27;break;case 21:if(M.prev=21,M.t1=M.catch(15),!(M.t1 instanceof Wt)||M.t1.status!==401&&M.t1.reason!==jn.Cancelled){M.next=27;break}return this.handleDisconnect(this.options.stopLocalTrackOnUnpublish),k(M.t1),M.abrupt("return");case 27:if(!S||!((x=this.abortController)===null||x===void 0)&&x.signal.aborted){M.next=34;break}return this.log.info("Initial connection failed with ConnectionError: ".concat(M.t0.message,". Retrying with another region: ").concat(S),this.logContext),this.recreateEngine(),M.next=32,m(_,k,S);case 32:M.next=36;break;case 34:this.handleDisconnect(this.options.stopLocalTrackOnUnpublish),k(M.t0);case 36:M.next=40;break;case 38:this.handleDisconnect(this.options.stopLocalTrackOnUnpublish),k(M.t0);case 40:case"end":return M.stop()}},w,this,[[4,11],[15,21]])}))},y=this.regionUrl,this.regionUrl=void 0,this.connectFuture=new zT(function(m,_){v(m,_,y)},function(){p.clearConnectionFutures()}),f.abrupt("return",this.connectFuture.promise);case 24:case"end":return f.stop()}},d,this)}))},n.connectSignal=function(o,c,u,d,h,b){return he(ct(n),void 0,void 0,F().mark(function v(){var y,p,f,m,_;return F().wrap(function(k){for(;;)switch(k.prev=k.next){case 0:return k.next=2,u.join(o,c,{autoSubscribe:d.autoSubscribe,adaptiveStream:et(h.adaptiveStream)==="object"||h.adaptiveStream,maxRetries:d.maxRetries,e2eeEnabled:!!this.e2eeManager,websocketTimeout:d.websocketTimeout},b.signal);case 2:if(m=k.sent,(_=m.serverInfo)||(_={version:m.serverVersion,region:m.serverRegion}),this.serverInfo=_,this.log.debug("connected to Livekit Server ".concat(Object.entries(_).map(function(D){var w=Pt(D,2),A=w[0],x=w[1];return"".concat(A,": ").concat(x)}).join(", ")),{room:(y=m.room)===null||y===void 0?void 0:y.name,roomSid:(p=m.room)===null||p===void 0?void 0:p.sid,identity:(f=m.participant)===null||f===void 0?void 0:f.identity}),_.version){k.next=9;break}throw new w9("unknown server version");case 9:return _.version==="0.15.1"&&this.options.dynacast&&(this.log.debug("disabling dynacast due to server version",this.logContext),h.dynacast=!1),k.abrupt("return",m);case 11:case"end":return k.stop()}},v,this)}))},n.applyJoinResponse=function(o){var c=o.participant;if(n.localParticipant.sid=c.sid,n.localParticipant.identity=c.identity,n.localParticipant.setEnabledPublishCodecs(o.enabledPublishCodecs),n.options.e2ee&&n.e2eeManager)try{n.e2eeManager.setSifTrailer(o.sifTrailer)}catch(u){n.log.error(u instanceof Error?u.message:"Could not set SifTrailer",Object.assign(Object.assign({},n.logContext),{error:u}))}n.handleParticipantUpdates([c].concat(Pi(o.otherParticipants))),o.room&&n.handleRoomUpdate(o.room)},n.attemptConnection=function(o,c,u,d){return he(ct(n),void 0,void 0,F().mark(function h(){var b,v,y,p,f;return F().wrap(function(m){for(;;)switch(m.prev=m.next){case 0:return this.state===jt.Reconnecting||this.isResuming||!((b=this.engine)===null||b===void 0)&&b.pendingReconnect?(this.log.info("Reconnection attempt replaced by new connection attempt",this.logContext),this.recreateEngine()):this.maybeCreateEngine(),!((v=this.regionUrlProvider)===null||v===void 0)&&v.isCloud()&&this.engine.setRegionUrlProvider(this.regionUrlProvider),this.acquireAudioContext(),this.connOptions=Object.assign(Object.assign({},Ym),u),this.connOptions.rtcConfig&&(this.engine.rtcConfig=this.connOptions.rtcConfig),this.connOptions.peerConnectionTimeout&&(this.engine.peerConnectionTimeout=this.connOptions.peerConnectionTimeout),m.prev=6,m.next=9,this.connectSignal(o,c,this.engine,this.connOptions,this.options,d);case 9:p=m.sent,this.applyJoinResponse(p),this.setupLocalParticipantEvents(),this.emit(je.SignalConnected),m.next=25;break;case 15:return m.prev=15,m.t0=m.catch(6),m.next=19,this.engine.close();case 19:throw this.recreateEngine(),f=new Wt("could not establish signal connection"),m.t0 instanceof Error&&(f.message="".concat(f.message,": ").concat(m.t0.message)),m.t0 instanceof Wt&&(f.reason=m.t0.reason,f.status=m.t0.status),this.log.debug("error trying to establish signal connection",Object.assign(Object.assign({},this.logContext),{error:m.t0})),f;case 25:if(!d.signal.aborted){m.next=30;break}return m.next=28,this.engine.close();case 28:throw this.recreateEngine(),new Wt("Connection attempt aborted");case 30:return m.prev=30,m.next=33,this.engine.waitForPCInitialConnection(this.connOptions.peerConnectionTimeout,d);case 33:m.next=41;break;case 35:return m.prev=35,m.t1=m.catch(30),m.next=39,this.engine.close();case 39:throw this.recreateEngine(),m.t1;case 41:vi()&&this.options.disconnectOnPageLeave&&(window.addEventListener("pagehide",this.onPageLeave),window.addEventListener("beforeunload",this.onPageLeave)),vi()&&(document.addEventListener("freeze",this.onPageLeave),(y=navigator.mediaDevices)===null||y===void 0||y.addEventListener("devicechange",this.handleDeviceChange)),this.setAndEmitConnectionState(jt.Connected),this.emit(je.Connected),this.registerConnectionReconcile();case 46:case"end":return m.stop()}},h,this,[[6,15],[30,35]])}))},n.disconnect=function(){for(var o=arguments.length,c=new Array(o),u=0;o>u;u++)c[u]=arguments[u];return he(r,[].concat(c),void 0,function(){var d=this,h=0>=arguments.length||arguments[0]===void 0||arguments[0];return F().mark(function b(){var v,y,p,f,m;return F().wrap(function(_){for(;;)switch(_.prev=_.next){case 0:return _.next=2,d.disconnectLock.lock();case 2:if(m=_.sent,_.prev=3,d.state!==jt.Disconnected){_.next=7;break}return d.log.debug("already disconnected",d.logContext),_.abrupt("return");case 7:if(d.log.info("disconnect from room",Object.assign({},d.logContext)),(d.state===jt.Connecting||d.state===jt.Reconnecting||d.isResuming)&&(d.log.warn("abort connection attempt",d.logContext),(v=d.abortController)===null||v===void 0||v.abort(),(p=(y=d.connectFuture)===null||y===void 0?void 0:y.reject)===null||p===void 0||p.call(y,new Wt("Client initiated disconnect")),d.connectFuture=void 0),(f=d.engine)===null||f===void 0?void 0:f.client.isDisconnected){_.next=12;break}return _.next=12,d.engine.client.sendLeave();case 12:if(!d.engine){_.next=15;break}return _.next=15,d.engine.close();case 15:d.handleDisconnect(h,co.CLIENT_INITIATED),d.engine=void 0;case 17:return _.prev=17,m(),_.finish(17);case 20:case"end":return _.stop()}},b,null,[[3,,17,20]])})()})},n.onPageLeave=function(){return he(ct(n),void 0,void 0,F().mark(function o(){return F().wrap(function(c){for(;;)switch(c.prev=c.next){case 0:return this.log.info("Page leave detected, disconnecting",this.logContext),c.next=3,this.disconnect();case 3:case"end":return c.stop()}},o,this)}))},n.startAudio=function(){return he(ct(n),void 0,void 0,F().mark(function o(){var c,u,d,h,b,v,y=this;return F().wrap(function(p){for(;;)switch(p.prev=p.next){case 0:return c=[],(u=Br())&&u.os==="iOS"&&(d="livekit-dummy-audio-el",(h=document.getElementById(d))||((h=document.createElement("audio")).id=d,h.autoplay=!0,h.hidden=!0,(b=zm()).enabled=!0,v=new MediaStream([b]),h.srcObject=v,document.addEventListener("visibilitychange",function(){h&&(h.srcObject=document.hidden?null:v,document.hidden||(y.log.debug("page visible again, triggering startAudio to resume playback and update playback status",y.logContext),y.startAudio()))}),document.body.append(h),this.once(je.Disconnected,function(){h==null||h.remove(),h=null})),c.push(h)),this.remoteParticipants.forEach(function(f){f.audioTrackPublications.forEach(function(m){m.track&&m.track.attachedElements.forEach(function(_){c.push(_)})})}),p.prev=4,p.next=7,Promise.all([this.acquireAudioContext()].concat(Pi(c.map(function(f){return f.muted=!1,f.play()}))));case 7:this.handleAudioPlaybackStarted(),p.next=14;break;case 10:throw p.prev=10,p.t0=p.catch(4),this.handleAudioPlaybackFailed(p.t0),p.t0;case 14:case"end":return p.stop()}},o,this,[[4,10]])}))},n.startVideo=function(){return he(ct(n),void 0,void 0,F().mark(function o(){var c,u,d,h=this;return F().wrap(function(b){for(;;)switch(b.prev=b.next){case 0:c=[],u=dt(this.remoteParticipants.values());try{for(u.s();!(d=u.n()).done;)d.value.videoTrackPublications.forEach(function(v){var y;(y=v.track)===null||y===void 0||y.attachedElements.forEach(function(p){c.includes(p)||c.push(p)})})}catch(v){u.e(v)}finally{u.f()}return b.next=5,Promise.all(c.map(function(v){return v.play()})).then(function(){h.handleVideoPlaybackStarted()}).catch(function(v){v.name==="NotAllowedError"?h.handleVideoPlaybackFailed():h.log.warn("Resuming video playback failed, make sure you call `startVideo` directly in a user gesture handler",h.logContext)});case 5:case"end":return b.stop()}},o,this)}))},n.handleRestarting=function(){n.clearConnectionReconcile(),n.isResuming=!1;var o,c=dt(n.remoteParticipants.values());try{for(c.s();!(o=c.n()).done;){var u=o.value;n.handleParticipantDisconnected(u.identity,u)}}catch(d){c.e(d)}finally{c.f()}n.setAndEmitConnectionState(jt.Reconnecting)&&n.emit(je.Reconnecting)},n.handleSignalRestarted=function(o){return he(ct(n),void 0,void 0,F().mark(function c(){return F().wrap(function(u){for(;;)switch(u.prev=u.next){case 0:return this.log.debug("signal reconnected to server, region ".concat(o.serverRegion),Object.assign(Object.assign({},this.logContext),{region:o.serverRegion})),this.bufferedEvents=[],this.applyJoinResponse(o),u.prev=3,u.next=6,this.localParticipant.republishAllTracks(void 0,!0);case 6:u.next=11;break;case 8:u.prev=8,u.t0=u.catch(3),this.log.error("error trying to re-publish tracks after reconnection",Object.assign(Object.assign({},this.logContext),{error:u.t0}));case 11:return u.prev=11,u.next=14,this.engine.waitForRestarted();case 14:this.log.debug("fully reconnected to server",Object.assign(Object.assign({},this.logContext),{region:o.serverRegion})),u.next=20;break;case 17:return u.prev=17,u.t1=u.catch(11),u.abrupt("return");case 20:this.setAndEmitConnectionState(jt.Connected),this.emit(je.Reconnected),this.registerConnectionReconcile(),this.emitBufferedEvents();case 24:case"end":return u.stop()}},c,this,[[3,8],[11,17]])}))},n.handleParticipantUpdates=function(o){o.forEach(function(c){var u;if(c.identity!==n.localParticipant.identity){c.identity===""&&(c.identity=(u=n.sidToIdentity.get(c.sid))!==null&&u!==void 0?u:"");var d=n.remoteParticipants.get(c.identity);c.state===dm.DISCONNECTED?n.handleParticipantDisconnected(c.identity,d):d=n.getOrCreateParticipant(c.identity,c)}else n.localParticipant.updateInfo(c)})},n.handleActiveSpeakersUpdate=function(o){var c=[],u={};o.forEach(function(d){if(u[d.sid]=!0,d.sid===n.localParticipant.sid)n.localParticipant.audioLevel=d.level,n.localParticipant.setIsSpeaking(!0),c.push(n.localParticipant);else{var h=n.getRemoteParticipantBySid(d.sid);h&&(h.audioLevel=d.level,h.setIsSpeaking(!0),c.push(h))}}),u[n.localParticipant.sid]||(n.localParticipant.audioLevel=0,n.localParticipant.setIsSpeaking(!1)),n.remoteParticipants.forEach(function(d){u[d.sid]||(d.audioLevel=0,d.setIsSpeaking(!1))}),n.activeSpeakers=c,n.emitWhenConnected(je.ActiveSpeakersChanged,c)},n.handleSpeakersChanged=function(o){var c=new Map;n.activeSpeakers.forEach(function(d){var h=n.remoteParticipants.get(d.identity);h&&h.sid!==d.sid||c.set(d.sid,d)}),o.forEach(function(d){var h=n.getRemoteParticipantBySid(d.sid);d.sid===n.localParticipant.sid&&(h=n.localParticipant),h&&(h.audioLevel=d.level,h.setIsSpeaking(d.active),d.active?c.set(d.sid,h):c.delete(d.sid))});var u=Array.from(c.values());u.sort(function(d,h){return h.audioLevel-d.audioLevel}),n.activeSpeakers=u,n.emitWhenConnected(je.ActiveSpeakersChanged,u)},n.handleStreamStateUpdate=function(o){o.streamStates.forEach(function(c){var u=n.getRemoteParticipantBySid(c.participantSid);if(u){var d=u.getTrackPublicationBySid(c.trackSid);if(d&&d.track){var h=Me.streamStateFromProto(c.state);h!==d.track.streamState&&(d.track.streamState=h,u.emit(Xe.TrackStreamStateChanged,d,d.track.streamState),n.emitWhenConnected(je.TrackStreamStateChanged,d,d.track.streamState,u))}}})},n.handleSubscriptionPermissionUpdate=function(o){var c=n.getRemoteParticipantBySid(o.participantSid);if(c){var u=c.getTrackPublicationBySid(o.trackSid);u&&u.setAllowed(o.allowed)}},n.handleSubscriptionError=function(o){var c=Array.from(n.remoteParticipants.values()).find(function(d){return d.trackPublications.has(o.trackSid)});if(c){var u=c.getTrackPublicationBySid(o.trackSid);u&&u.setSubscriptionError(o.err)}},n.handleDataPacket=function(o){var c=n.remoteParticipants.get(o.participantIdentity);o.value.case==="user"?n.handleUserPacket(c,o.value.value,o.kind):o.value.case==="transcription"?n.handleTranscription(c,o.value.value):o.value.case==="sipDtmf"?n.handleSipDtmf(c,o.value.value):o.value.case==="chatMessage"?n.handleChatMessage(c,o.value.value):o.value.case==="metrics"&&n.handleMetrics(o.value.value,c)},n.handleUserPacket=function(o,c,u){n.emit(je.DataReceived,c.payload,o,u,c.topic),o==null||o.emit(Xe.DataReceived,c.payload,u)},n.handleSipDtmf=function(o,c){n.emit(je.SipDTMFReceived,c,o),o==null||o.emit(Xe.SipDTMFReceived,c)},n.bufferedSegments=new Map,n.handleTranscription=function(o,c){var u=c.transcribedParticipantIdentity===n.localParticipant.identity?n.localParticipant:n.getParticipantByIdentity(c.transcribedParticipantIdentity),d=u==null?void 0:u.trackPublications.get(c.trackId),h=function(b,v){return b.segments.map(function(y){var p,f=y.id,m=y.text,_=y.language,k=y.startTime,D=y.endTime,w=y.final,A=(p=v.get(f))!==null&&p!==void 0?p:Date.now(),x=Date.now();return w?v.delete(f):v.set(f,A),{id:f,text:m,startTime:Number.parseInt(k.toString()),endTime:Number.parseInt(D.toString()),final:w,language:_,firstReceivedTime:A,lastReceivedTime:x}})}(c,n.transcriptionReceivedTimes);d==null||d.emit(qe.TranscriptionReceived,h),u==null||u.emit(Xe.TranscriptionReceived,h,d),n.emit(je.TranscriptionReceived,h,u,d)},n.handleChatMessage=function(o,c){var u=function(d){var h=d.id,b=d.timestamp,v=d.message,y=d.editTimestamp;return{id:h,timestamp:Number.parseInt(b.toString()),editTimestamp:y?Number.parseInt(y.toString()):void 0,message:v}}(c);n.emit(je.ChatMessage,u,o)},n.handleMetrics=function(o,c){n.emit(je.MetricsReceived,o,c)},n.handleAudioPlaybackStarted=function(){n.canPlaybackAudio||(n.audioEnabled=!0,n.emit(je.AudioPlaybackStatusChanged,!0))},n.handleAudioPlaybackFailed=function(o){n.log.warn("could not playback audio",Object.assign(Object.assign({},n.logContext),{error:o})),n.canPlaybackAudio&&(n.audioEnabled=!1,n.emit(je.AudioPlaybackStatusChanged,!1))},n.handleVideoPlaybackStarted=function(){n.isVideoPlaybackBlocked&&(n.isVideoPlaybackBlocked=!1,n.emit(je.VideoPlaybackStatusChanged,!0))},n.handleVideoPlaybackFailed=function(){n.isVideoPlaybackBlocked||(n.isVideoPlaybackBlocked=!0,n.emit(je.VideoPlaybackStatusChanged,!1))},n.handleDeviceChange=function(){return he(ct(n),void 0,void 0,F().mark(function o(){var c,u,d,h,b,v=this;return F().wrap(function(y){for(;;)switch(y.prev=y.next){case 0:return y.next=2,br.getInstance().getDevices(void 0,!1);case 2:c=y.sent,u=["audiooutput"],d=F().mark(function p(){var f,m;return F().wrap(function(_){for(;;)switch(_.prev=_.next){case 0:if(f=b[h],0>=(m=c.filter(function(k){return k.kind===f})).length||m.find(function(k){return k.deviceId===v.getActiveDevice(f)})){_.next=5;break}return _.next=5,v.switchActiveDevice(f,m[0].deviceId);case 5:case"end":return _.stop()}},p)}),h=0,b=u;case 6:if(h>=b.length){y.next=11;break}return y.delegateYield(d(),"t0",8);case 8:h++,y.next=6;break;case 11:this.emit(je.MediaDevicesChanged);case 12:case"end":return y.stop()}},o,this)}))},n.handleRoomUpdate=function(o){var c=n.roomInfo;n.roomInfo=o,c&&c.metadata!==o.metadata&&n.emitWhenConnected(je.RoomMetadataChanged,o.metadata),(c==null?void 0:c.activeRecording)!==o.activeRecording&&n.emitWhenConnected(je.RecordingStatusChanged,o.activeRecording)},n.handleConnectionQualityUpdate=function(o){o.updates.forEach(function(c){if(c.participantSid!==n.localParticipant.sid){var u=n.getRemoteParticipantBySid(c.participantSid);u&&u.setConnectionQuality(c.quality)}else n.localParticipant.setConnectionQuality(c.quality)})},n.onLocalParticipantMetadataChanged=function(o){n.emit(je.ParticipantMetadataChanged,o,n.localParticipant)},n.onLocalParticipantNameChanged=function(o){n.emit(je.ParticipantNameChanged,o,n.localParticipant)},n.onLocalAttributesChanged=function(o){n.emit(je.ParticipantAttributesChanged,o,n.localParticipant)},n.onLocalTrackMuted=function(o){n.emit(je.TrackMuted,o,n.localParticipant)},n.onLocalTrackUnmuted=function(o){n.emit(je.TrackUnmuted,o,n.localParticipant)},n.onTrackProcessorUpdate=function(o){var c;(c=o==null?void 0:o.onPublish)===null||c===void 0||c.call(o,ct(n))},n.onLocalTrackPublished=function(o){return he(ct(n),void 0,void 0,F().mark(function c(){var u,d,h,b,v,y,p,f;return F().wrap(function(m){for(;;)switch(m.prev=m.next){case 0:if((u=o.track)===null||u===void 0||u.on(qe.TrackProcessorUpdate,this.onTrackProcessorUpdate),(d=o.track)===null||d===void 0||d.on(qe.Restarted,this.onLocalTrackRestarted),(v=(b=(h=o.track)===null||h===void 0?void 0:h.getProcessor())===null||b===void 0?void 0:b.onPublish)===null||v===void 0||v.call(b,this),this.emit(je.LocalTrackPublished,o,this.localParticipant),!(o.track instanceof Pn)){m.next=9;break}return m.next=7,o.track.checkForSilence();case 7:m.sent&&this.emit(je.LocalAudioSilenceDetected,o);case 9:return m.next=11,(y=o.track)===null||y===void 0?void 0:y.getDeviceId();case 11:p=m.sent,(f=LT(o.source))&&p&&p!==this.localParticipant.activeDeviceMap.get(f)&&(this.localParticipant.activeDeviceMap.set(f,p),this.emit(je.ActiveDeviceChanged,f,p));case 14:case"end":return m.stop()}},c,this)}))},n.onLocalTrackUnpublished=function(o){var c,u;(c=o.track)===null||c===void 0||c.off(qe.TrackProcessorUpdate,n.onTrackProcessorUpdate),(u=o.track)===null||u===void 0||u.off(qe.Restarted,n.onLocalTrackRestarted),n.emit(je.LocalTrackUnpublished,o,n.localParticipant)},n.onLocalTrackRestarted=function(o){return he(ct(n),void 0,void 0,F().mark(function c(){var u,d;return F().wrap(function(h){for(;;)switch(h.prev=h.next){case 0:return h.next=2,o.getDeviceId(!1);case 2:u=h.sent,(d=LT(o.source))&&u&&u!==this.localParticipant.activeDeviceMap.get(d)&&(this.log.debug("local track restarted, setting ".concat(d," ").concat(u," active"),this.logContext),this.localParticipant.activeDeviceMap.set(d,u),this.emit(je.ActiveDeviceChanged,d,u));case 5:case"end":return h.stop()}},c,this)}))},n.onLocalConnectionQualityChanged=function(o){n.emit(je.ConnectionQualityChanged,o,n.localParticipant)},n.onMediaDevicesError=function(o){n.emit(je.MediaDevicesError,o)},n.onLocalParticipantPermissionsChanged=function(o){n.emit(je.ParticipantPermissionsChanged,o,n.localParticipant)},n.onLocalChatMessageSent=function(o){n.emit(je.ChatMessage,o,n.localParticipant)},n.setMaxListeners(100),n.remoteParticipants=new Map,n.sidToIdentity=new Map,n.options=Object.assign(Object.assign({},X9),t),n.log=Lr((s=n.options.loggerName)!==null&&s!==void 0?s:Yi.Room),n.transcriptionReceivedTimes=new Map,n.options.audioCaptureDefaults=Object.assign(Object.assign({},sS),t==null?void 0:t.audioCaptureDefaults),n.options.videoCaptureDefaults=Object.assign(Object.assign({},aS),t==null?void 0:t.videoCaptureDefaults),n.options.publishDefaults=Object.assign(Object.assign({},K9),t==null?void 0:t.publishDefaults),n.maybeCreateEngine(),n.disconnectLock=new yi,n.localParticipant=new kS("","",n.engine,n.options),n.options.videoCaptureDefaults.deviceId&&n.localParticipant.activeDeviceMap.set("videoinput",Fr(n.options.videoCaptureDefaults.deviceId)),n.options.audioCaptureDefaults.deviceId&&n.localParticipant.activeDeviceMap.set("audioinput",Fr(n.options.audioCaptureDefaults.deviceId)),!((a=n.options.audioOutput)===null||a===void 0)&&a.deviceId&&n.switchActiveDevice("audiooutput",Fr(n.options.audioOutput.deviceId)).catch(function(o){return n.log.warn("Could not set audio output: ".concat(o.message),n.logContext)}),n.options.e2ee&&n.setupE2EE(),n}return Ft(e,Js.EventEmitter),ft(e,[{key:"setE2EEEnabled",value:function(t){return he(this,void 0,void 0,F().mark(function n(){return F().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:if(!this.e2eeManager){r.next=6;break}return r.next=3,Promise.all([this.localParticipant.setE2EEEnabled(t)]);case 3:this.localParticipant.identity!==""&&this.e2eeManager.setParticipantCryptorEnabled(t,this.localParticipant.identity),r.next=7;break;case 6:throw Error("e2ee not configured, please set e2ee settings within the room options");case 7:case"end":return r.stop()}},n,this)}))}},{key:"setupE2EE",value:function(){var t,n=this;this.options.e2ee&&(this.e2eeManager=new F9(this.options.e2ee),this.e2eeManager.on(ms.ParticipantEncryptionStatusChanged,function(r,s){s instanceof kS&&(n.isE2EEEnabled=r),n.emit(je.ParticipantEncryptionStatusChanged,r,s)}),this.e2eeManager.on(ms.EncryptionError,function(r){return n.emit(je.EncryptionError,r)}),(t=this.e2eeManager)===null||t===void 0||t.setup(this))}},{key:"logContext",get:function(){var t;return{room:this.name,roomID:(t=this.roomInfo)===null||t===void 0?void 0:t.sid,participant:this.localParticipant.identity,pID:this.localParticipant.sid}}},{key:"isRecording",get:function(){var t,n;return(n=(t=this.roomInfo)===null||t===void 0?void 0:t.activeRecording)!==null&&n!==void 0&&n}},{key:"getSid",value:function(){return he(this,void 0,void 0,F().mark(function t(){var n=this;return F().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:if(this.state!==jt.Disconnected){r.next=2;break}return r.abrupt("return","");case 2:if(!this.roomInfo||this.roomInfo.sid===""){r.next=4;break}return r.abrupt("return",this.roomInfo.sid);case 4:return r.abrupt("return",new Promise(function(s,a){var o=function c(u){u.sid!==""&&(n.engine.off(Ze.RoomUpdate,c),s(u.sid))};n.engine.on(Ze.RoomUpdate,o),n.once(je.Disconnected,function(){n.engine.off(Ze.RoomUpdate,o),a("Room disconnected before room server id was available")})}));case 5:case"end":return r.stop()}},t,this)}))}},{key:"name",get:function(){var t,n;return(n=(t=this.roomInfo)===null||t===void 0?void 0:t.name)!==null&&n!==void 0?n:""}},{key:"metadata",get:function(){var t;return(t=this.roomInfo)===null||t===void 0?void 0:t.metadata}},{key:"numParticipants",get:function(){var t,n;return(n=(t=this.roomInfo)===null||t===void 0?void 0:t.numParticipants)!==null&&n!==void 0?n:0}},{key:"numPublishers",get:function(){var t,n;return(n=(t=this.roomInfo)===null||t===void 0?void 0:t.numPublishers)!==null&&n!==void 0?n:0}},{key:"maybeCreateEngine",value:function(){var t=this;this.engine&&!this.engine.isClosed||(this.engine=new sR(this.options),this.engine.on(Ze.ParticipantUpdate,this.handleParticipantUpdates).on(Ze.RoomUpdate,this.handleRoomUpdate).on(Ze.SpeakersChanged,this.handleSpeakersChanged).on(Ze.StreamStateChanged,this.handleStreamStateUpdate).on(Ze.ConnectionQualityUpdate,this.handleConnectionQualityUpdate).on(Ze.SubscriptionError,this.handleSubscriptionError).on(Ze.SubscriptionPermissionUpdate,this.handleSubscriptionPermissionUpdate).on(Ze.MediaTrackAdded,function(n,r,s){t.onTrackAdded(n,r,s)}).on(Ze.Disconnected,function(n){t.handleDisconnect(t.options.stopLocalTrackOnUnpublish,n)}).on(Ze.ActiveSpeakersUpdate,this.handleActiveSpeakersUpdate).on(Ze.DataPacketReceived,this.handleDataPacket).on(Ze.Resuming,function(){t.clearConnectionReconcile(),t.isResuming=!0,t.log.info("Resuming signal connection",t.logContext),t.setAndEmitConnectionState(jt.SignalReconnecting)&&t.emit(je.SignalReconnecting)}).on(Ze.Resumed,function(){t.registerConnectionReconcile(),t.isResuming=!1,t.log.info("Resumed signal connection",t.logContext),t.updateSubscriptions(),t.emitBufferedEvents(),t.setAndEmitConnectionState(jt.Connected)&&t.emit(je.Reconnected)}).on(Ze.SignalResumed,function(){t.bufferedEvents=[],(t.state===jt.Reconnecting||t.isResuming)&&t.sendSyncState()}).on(Ze.Restarting,this.handleRestarting).on(Ze.SignalRestarted,this.handleSignalRestarted).on(Ze.Offline,function(){t.setAndEmitConnectionState(jt.Reconnecting)&&t.emit(je.Reconnecting)}).on(Ze.DCBufferStatusChanged,function(n,r){t.emit(je.DCBufferStatusChanged,n,r)}).on(Ze.LocalTrackSubscribed,function(n){var r=t.localParticipant.getTrackPublications().find(function(s){return s.trackSid===n});r?(t.localParticipant.emit(Xe.LocalTrackSubscribed,r),t.emitWhenConnected(je.LocalTrackSubscribed,r,t.localParticipant)):t.log.warn("could not find local track subscription for subscribed event",t.logContext)}),this.localParticipant&&this.localParticipant.setupEngine(this.engine),this.e2eeManager&&this.e2eeManager.setupEngine(this.engine))}},{key:"prepareConnection",value:function(t,n){return he(this,void 0,void 0,F().mark(function r(){var s;return F().wrap(function(a){for(;;)switch(a.prev=a.next){case 0:if(this.state===jt.Disconnected){a.next=2;break}return a.abrupt("return");case 2:if(this.log.debug("prepareConnection to ".concat(t),this.logContext),a.prev=3,!$m(new URL(t))||!n){a.next=16;break}return this.regionUrlProvider=new gS(t,n),a.next=8,this.regionUrlProvider.getNextBestRegionUrl();case 8:if(!(s=a.sent)||this.state!==jt.Disconnected){a.next=14;break}return this.regionUrl=s,a.next=13,fetch(GT(s),{method:"HEAD"});case 13:this.log.debug("prepared connection to ".concat(s),this.logContext);case 14:a.next=18;break;case 16:return a.next=18,fetch(GT(t),{method:"HEAD"});case 18:a.next=23;break;case 20:a.prev=20,a.t0=a.catch(3),this.log.warn("could not prepare connection",Object.assign(Object.assign({},this.logContext),{error:a.t0}));case 23:case"end":return a.stop()}},r,this,[[3,20]])}))}},{key:"getParticipantByIdentity",value:function(t){return this.localParticipant.identity===t?this.localParticipant:this.remoteParticipants.get(t)}},{key:"clearConnectionFutures",value:function(){this.connectFuture=void 0}},{key:"simulateScenario",value:function(t,n){return he(this,void 0,void 0,F().mark(function r(){var s,a,o=this;return F().wrap(function(c){for(;;)switch(c.prev=c.next){case 0:s=function(){},c.t0=t,c.next=c.t0==="signal-reconnect"?4:c.t0==="speaker"?7:c.t0==="node-failure"?9:c.t0==="server-leave"?11:c.t0==="migration"?13:c.t0==="resume-reconnect"?15:c.t0==="disconnect-signal-on-resume"?19:c.t0==="disconnect-signal-on-resume-no-messages"?22:c.t0==="full-reconnect"?25:c.t0==="force-tcp"||c.t0==="force-tls"?29:c.t0==="subscriber-bandwidth"?32:c.t0==="leave-full-reconnect"?36:37;break;case 4:return c.next=6,this.engine.client.handleOnClose("simulate disconnect");case 6:return c.abrupt("break",37);case 7:return a=new gr({scenario:{case:"speakerUpdate",value:3}}),c.abrupt("break",37);case 9:return a=new gr({scenario:{case:"nodeFailure",value:!0}}),c.abrupt("break",37);case 11:return a=new gr({scenario:{case:"serverLeave",value:!0}}),c.abrupt("break",37);case 13:return a=new gr({scenario:{case:"migration",value:!0}}),c.abrupt("break",37);case 15:return this.engine.failNext(),c.next=18,this.engine.client.handleOnClose("simulate resume-disconnect");case 18:return c.abrupt("break",37);case 19:return s=function(){return he(o,void 0,void 0,F().mark(function u(){return F().wrap(function(d){for(;;)switch(d.prev=d.next){case 0:return d.next=2,this.engine.client.handleOnClose("simulate resume-disconnect");case 2:case"end":return d.stop()}},u,this)}))},a=new gr({scenario:{case:"disconnectSignalOnResume",value:!0}}),c.abrupt("break",37);case 22:return s=function(){return he(o,void 0,void 0,F().mark(function u(){return F().wrap(function(d){for(;;)switch(d.prev=d.next){case 0:return d.next=2,this.engine.client.handleOnClose("simulate resume-disconnect");case 2:case"end":return d.stop()}},u,this)}))},a=new gr({scenario:{case:"disconnectSignalOnResumeNoMessages",value:!0}}),c.abrupt("break",37);case 25:return this.engine.fullReconnectOnNext=!0,c.next=28,this.engine.client.handleOnClose("simulate full-reconnect");case 28:return c.abrupt("break",37);case 29:return a=new gr({scenario:{case:"switchCandidateProtocol",value:t==="force-tls"?2:1}}),s=function(){return he(o,void 0,void 0,F().mark(function u(){var d;return F().wrap(function(h){for(;;)switch(h.prev=h.next){case 0:(d=this.engine.client.onLeave)&&d(new dd({reason:co.CLIENT_INITIATED,action:fo.RECONNECT}));case 2:case"end":return h.stop()}},u,this)}))},c.abrupt("break",37);case 32:if(n!==void 0&&typeof n=="number"){c.next=34;break}throw new Error("subscriber-bandwidth requires a number as argument");case 34:return a=new gr({scenario:{case:"subscriberBandwidth",value:BigInt(n)}}),c.abrupt("break",37);case 36:a=new gr({scenario:{case:"leaveRequestFullReconnect",value:!0}});case 37:if(!a){c.next=42;break}return c.next=40,this.engine.client.sendSimulateScenario(a);case 40:return c.next=42,s();case 42:case"end":return c.stop()}},r,this)}))}},{key:"canPlaybackAudio",get:function(){return this.audioEnabled}},{key:"canPlaybackVideo",get:function(){return!this.isVideoPlaybackBlocked}},{key:"getActiveDevice",value:function(t){return this.localParticipant.activeDeviceMap.get(t)}},{key:"switchActiveDevice",value:function(t,n){return he(this,arguments,void 0,function(r,s){var a=this,o=arguments.length>2&&arguments[2]!==void 0&&arguments[2];return F().mark(function c(){var u,d,h,b,v,y,p,f,m,_,k,D,w,A,x;return F().wrap(function(P){for(;;)switch(P.prev=P.next){case 0:if(f=!1,m=!0,_=o?{exact:s}:s,r!=="audioinput"){P.next=20;break}return k=(u=a.getActiveDevice(r))!==null&&u!==void 0?u:a.options.audioCaptureDefaults.deviceId,a.options.audioCaptureDefaults.deviceId=_,f=k!==_,D=Array.from(a.localParticipant.audioTrackPublications.values()).filter(function(S){return S.source===Me.Source.Microphone}),P.prev=8,P.next=11,Promise.all(D.map(function(S){var M;return(M=S.audioTrack)===null||M===void 0?void 0:M.setDeviceId(_)}));case 11:m=P.sent.every(function(S){return S===!0}),P.next=18;break;case 14:throw P.prev=14,P.t0=P.catch(8),a.options.audioCaptureDefaults.deviceId=k,P.t0;case 18:P.next=67;break;case 20:if(r!=="videoinput"){P.next=37;break}return w=(d=a.getActiveDevice(r))!==null&&d!==void 0?d:a.options.videoCaptureDefaults.deviceId,a.options.videoCaptureDefaults.deviceId=_,f=w!==_,A=Array.from(a.localParticipant.videoTrackPublications.values()).filter(function(S){return S.source===Me.Source.Camera}),P.prev=25,P.next=28,Promise.all(A.map(function(S){var M;return(M=S.videoTrack)===null||M===void 0?void 0:M.setDeviceId(_)}));case 28:m=P.sent.every(function(S){return S===!0}),P.next=35;break;case 31:throw P.prev=31,P.t1=P.catch(25),a.options.videoCaptureDefaults.deviceId=w,P.t1;case 35:P.next=67;break;case 37:if(r!=="audiooutput"){P.next=67;break}if(!(!jm()&&!a.options.webAudioMix||a.options.webAudioMix&&a.audioContext&&!("setSinkId"in a.audioContext))){P.next=40;break}throw new Error("cannot switch audio output, setSinkId not supported");case 40:if(!a.options.webAudioMix){P.next=53;break}return P.next=43,br.getInstance().normalizeDeviceId("audiooutput",s);case 43:if(P.t3=h=P.sent,P.t2=P.t3!==null,!P.t2){P.next=47;break}P.t2=h!==void 0;case 47:if(!P.t2){P.next=51;break}P.t4=h,P.next=52;break;case 51:P.t4="";case 52:s=P.t4;case 53:return(b=(p=a.options).audioOutput)!==null&&b!==void 0||(p.audioOutput={}),x=(v=a.getActiveDevice(r))!==null&&v!==void 0?v:a.options.audioOutput.deviceId,a.options.audioOutput.deviceId=s,f=x!==_,P.prev=57,a.options.webAudioMix&&((y=a.audioContext)===null||y===void 0||y.setSinkId(s)),P.next=61,Promise.all(Array.from(a.remoteParticipants.values()).map(function(S){return S.setAudioOutput({deviceId:s})}));case 61:P.next=67;break;case 63:throw P.prev=63,P.t5=P.catch(57),a.options.audioOutput.deviceId=x,P.t5;case 67:return f&&m&&(a.localParticipant.activeDeviceMap.set(r,s),a.emit(je.ActiveDeviceChanged,r,s)),P.abrupt("return",m);case 69:case"end":return P.stop()}},c,null,[[8,14],[25,31],[57,63]])})()})}},{key:"setupLocalParticipantEvents",value:function(){this.localParticipant.on(Xe.ParticipantMetadataChanged,this.onLocalParticipantMetadataChanged).on(Xe.ParticipantNameChanged,this.onLocalParticipantNameChanged).on(Xe.AttributesChanged,this.onLocalAttributesChanged).on(Xe.TrackMuted,this.onLocalTrackMuted).on(Xe.TrackUnmuted,this.onLocalTrackUnmuted).on(Xe.LocalTrackPublished,this.onLocalTrackPublished).on(Xe.LocalTrackUnpublished,this.onLocalTrackUnpublished).on(Xe.ConnectionQualityChanged,this.onLocalConnectionQualityChanged).on(Xe.MediaDevicesError,this.onMediaDevicesError).on(Xe.AudioStreamAcquired,this.startAudio).on(Xe.ChatMessage,this.onLocalChatMessageSent).on(Xe.ParticipantPermissionsChanged,this.onLocalParticipantPermissionsChanged)}},{key:"recreateEngine",value:function(){var t;(t=this.engine)===null||t===void 0||t.close(),this.engine=void 0,this.isResuming=!1,this.remoteParticipants.clear(),this.sidToIdentity.clear(),this.bufferedEvents=[],this.maybeCreateEngine()}},{key:"onTrackAdded",value:function(t,n,r){var s=this;if(this.state===jt.Connecting||this.state===jt.Reconnecting){var a=function(){s.onTrackAdded(t,n,r),o()},o=function y(){s.off(je.Reconnected,a),s.off(je.Connected,a),s.off(je.Disconnected,y)};return this.once(je.Reconnected,a),this.once(je.Connected,a),void this.once(je.Disconnected,o)}if(this.state!==jt.Disconnected){var c=function(y){var p=y.split("|");return p.length>1?[p[0],y.substr(p[0].length+1)]:[y,""]}(n.id),u=c[0],d=c[1],h=t.id;if(d&&d.startsWith("TR")&&(h=d),u!==this.localParticipant.sid){var b,v=Array.from(this.remoteParticipants.values()).find(function(y){return y.sid===u});v?(this.options.adaptiveStream&&(b=et(this.options.adaptiveStream)==="object"?this.options.adaptiveStream:{}),v.addSubscribedMediaTrack(t,h,n,r,b)):this.log.error("Tried to add a track for a participant, that's not present. Sid: ".concat(u),this.logContext)}else this.log.warn("tried to create RemoteParticipant for local participant",this.logContext)}else this.log.warn("skipping incoming track after Room disconnected",this.logContext)}},{key:"handleDisconnect",value:function(){var t,n=this,r=0>=arguments.length||arguments[0]===void 0||arguments[0],s=arguments.length>1?arguments[1]:void 0;if(this.clearConnectionReconcile(),this.isResuming=!1,this.bufferedEvents=[],this.transcriptionReceivedTimes.clear(),this.state!==jt.Disconnected){this.regionUrl=void 0;try{this.remoteParticipants.forEach(function(a){a.trackPublications.forEach(function(o){a.unpublishTrack(o.trackSid)})}),this.localParticipant.trackPublications.forEach(function(a){var o,c;a.track&&n.localParticipant.unpublishTrack(a.track,r),r&&((o=a.track)===null||o===void 0||o.detach(),(c=a.track)===null||c===void 0||c.stop())}),this.localParticipant.off(Xe.ParticipantMetadataChanged,this.onLocalParticipantMetadataChanged).off(Xe.ParticipantNameChanged,this.onLocalParticipantNameChanged).off(Xe.AttributesChanged,this.onLocalAttributesChanged).off(Xe.TrackMuted,this.onLocalTrackMuted).off(Xe.TrackUnmuted,this.onLocalTrackUnmuted).off(Xe.LocalTrackPublished,this.onLocalTrackPublished).off(Xe.LocalTrackUnpublished,this.onLocalTrackUnpublished).off(Xe.ConnectionQualityChanged,this.onLocalConnectionQualityChanged).off(Xe.MediaDevicesError,this.onMediaDevicesError).off(Xe.AudioStreamAcquired,this.startAudio).off(Xe.ChatMessage,this.onLocalChatMessageSent).off(Xe.ParticipantPermissionsChanged,this.onLocalParticipantPermissionsChanged),this.localParticipant.trackPublications.clear(),this.localParticipant.videoTrackPublications.clear(),this.localParticipant.audioTrackPublications.clear(),this.remoteParticipants.clear(),this.sidToIdentity.clear(),this.activeSpeakers=[],this.audioContext&&typeof this.options.webAudioMix=="boolean"&&(this.audioContext.close(),this.audioContext=void 0),vi()&&(window.removeEventListener("beforeunload",this.onPageLeave),window.removeEventListener("pagehide",this.onPageLeave),window.removeEventListener("freeze",this.onPageLeave),(t=navigator.mediaDevices)===null||t===void 0||t.removeEventListener("devicechange",this.handleDeviceChange))}finally{this.setAndEmitConnectionState(jt.Disconnected),this.emit(je.Disconnected,s)}}}},{key:"handleParticipantDisconnected",value:function(t,n){this.remoteParticipants.delete(t),n&&(n.trackPublications.forEach(function(r){n.unpublishTrack(r.trackSid,!0)}),this.emit(je.ParticipantDisconnected,n))}},{key:"acquireAudioContext",value:function(){return he(this,void 0,void 0,F().mark(function t(){var n,r,s,a=this;return F().wrap(function(o){for(;;)switch(o.prev=o.next){case 0:if(typeof this.options.webAudioMix!="boolean"&&this.options.webAudioMix.audioContext?this.audioContext=this.options.webAudioMix.audioContext:this.audioContext&&this.audioContext.state!=="closed"||(this.audioContext=(n=RT())!==null&&n!==void 0?n:void 0),!this.audioContext||this.audioContext.state!=="suspended"){o.next=10;break}return o.prev=2,o.next=5,this.audioContext.resume();case 5:o.next=10;break;case 7:o.prev=7,o.t0=o.catch(2),this.log.warn("Could not resume audio context",Object.assign(Object.assign({},this.logContext),{error:o.t0}));case 10:this.options.webAudioMix&&this.remoteParticipants.forEach(function(c){return c.setAudioContext(a.audioContext)}),this.localParticipant.setAudioContext(this.audioContext),(s=((r=this.audioContext)===null||r===void 0?void 0:r.state)==="running")!==this.canPlaybackAudio&&(this.audioEnabled=s,this.emit(je.AudioPlaybackStatusChanged,s));case 14:case"end":return o.stop()}},t,this,[[2,7]])}))}},{key:"createParticipant",value:function(t,n){var r,s,a=this;return s=n?SS.fromParticipantInfo(this.engine.client,n,{loggerContextCb:function(){return a.logContext},loggerName:this.options.loggerName}):new SS(this.engine.client,"",t,void 0,void 0,{loggerContextCb:function(){return a.logContext},loggerName:this.options.loggerName}),this.options.webAudioMix&&s.setAudioContext(this.audioContext),!((r=this.options.audioOutput)===null||r===void 0)&&r.deviceId&&s.setAudioOutput(this.options.audioOutput).catch(function(o){return a.log.warn("Could not set audio output: ".concat(o.message),a.logContext)}),s}},{key:"getOrCreateParticipant",value:function(t,n){var r=this;if(this.remoteParticipants.has(t)){var s=this.remoteParticipants.get(t);return n&&s.updateInfo(n)&&this.sidToIdentity.set(n.sid,n.identity),s}var a=this.createParticipant(t,n);return this.remoteParticipants.set(t,a),this.sidToIdentity.set(n.sid,n.identity),this.emitWhenConnected(je.ParticipantConnected,a),a.on(Xe.TrackPublished,function(o){r.emitWhenConnected(je.TrackPublished,o,a)}).on(Xe.TrackSubscribed,function(o,c){o.kind===Me.Kind.Audio?(o.on(qe.AudioPlaybackStarted,r.handleAudioPlaybackStarted),o.on(qe.AudioPlaybackFailed,r.handleAudioPlaybackFailed)):o.kind===Me.Kind.Video&&(o.on(qe.VideoPlaybackFailed,r.handleVideoPlaybackFailed),o.on(qe.VideoPlaybackStarted,r.handleVideoPlaybackStarted)),r.emit(je.TrackSubscribed,o,c,a)}).on(Xe.TrackUnpublished,function(o){r.emit(je.TrackUnpublished,o,a)}).on(Xe.TrackUnsubscribed,function(o,c){r.emit(je.TrackUnsubscribed,o,c,a)}).on(Xe.TrackSubscriptionFailed,function(o){r.emit(je.TrackSubscriptionFailed,o,a)}).on(Xe.TrackMuted,function(o){r.emitWhenConnected(je.TrackMuted,o,a)}).on(Xe.TrackUnmuted,function(o){r.emitWhenConnected(je.TrackUnmuted,o,a)}).on(Xe.ParticipantMetadataChanged,function(o){r.emitWhenConnected(je.ParticipantMetadataChanged,o,a)}).on(Xe.ParticipantNameChanged,function(o){r.emitWhenConnected(je.ParticipantNameChanged,o,a)}).on(Xe.AttributesChanged,function(o){r.emitWhenConnected(je.ParticipantAttributesChanged,o,a)}).on(Xe.ConnectionQualityChanged,function(o){r.emitWhenConnected(je.ConnectionQualityChanged,o,a)}).on(Xe.ParticipantPermissionsChanged,function(o){r.emitWhenConnected(je.ParticipantPermissionsChanged,o,a)}).on(Xe.TrackSubscriptionStatusChanged,function(o,c){r.emitWhenConnected(je.TrackSubscriptionStatusChanged,o,c,a)}).on(Xe.TrackSubscriptionFailed,function(o,c){r.emit(je.TrackSubscriptionFailed,o,a,c)}).on(Xe.TrackSubscriptionPermissionChanged,function(o,c){r.emitWhenConnected(je.TrackSubscriptionPermissionChanged,o,c,a)}),n&&a.updateInfo(n),a}},{key:"sendSyncState",value:function(){var t=Array.from(this.remoteParticipants.values()).reduce(function(r,s){return r.push.apply(r,Pi(s.getTrackPublications())),r},[]),n=this.localParticipant.getTrackPublications();this.engine.sendSyncState(t,n)}},{key:"updateSubscriptions",value:function(){var t,n=dt(this.remoteParticipants.values());try{for(n.s();!(t=n.n()).done;){var r,s=dt(t.value.videoTrackPublications.values());try{for(s.s();!(r=s.n()).done;){var a=r.value;a.isSubscribed&&a instanceof TS&&a.emitTrackUpdate()}}catch(o){s.e(o)}finally{s.f()}}}catch(o){n.e(o)}finally{n.f()}}},{key:"getRemoteParticipantBySid",value:function(t){var n=this.sidToIdentity.get(t);if(n)return this.remoteParticipants.get(n)}},{key:"registerConnectionReconcile",value:function(){var t=this;this.clearConnectionReconcile();var n=0;this.connectionReconcileInterval=In.setInterval(function(){t.engine&&!t.engine.isClosed&&t.engine.verifyTransport()?n=0:(n++,t.log.warn("detected connection state mismatch",Object.assign(Object.assign({},t.logContext),{numFailures:n,engine:{closed:t.engine.isClosed,transportsConnected:t.engine.verifyTransport()}})),3>n||(t.recreateEngine(),t.handleDisconnect(t.options.stopLocalTrackOnUnpublish,co.STATE_MISMATCH)))},4e3)}},{key:"clearConnectionReconcile",value:function(){this.connectionReconcileInterval&&In.clearInterval(this.connectionReconcileInterval)}},{key:"setAndEmitConnectionState",value:function(t){return t!==this.state&&(this.state=t,this.emit(je.ConnectionStateChanged,this.state),!0)}},{key:"emitBufferedEvents",value:function(){var t=this;this.bufferedEvents.forEach(function(n){var r=Pt(n,2),s=r[0],a=r[1];t.emit.apply(t,[s].concat(Pi(a)))}),this.bufferedEvents=[]}},{key:"emitWhenConnected",value:function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),s=1;n>s;s++)r[s-1]=arguments[s];if(this.state===jt.Reconnecting||this.isResuming||!this.engine||this.engine.pendingReconnect)this.bufferedEvents.push([t,r]);else if(this.state===jt.Connected)return this.emit.apply(this,[t].concat(r));return!1}},{key:"simulateParticipants",value:function(t){return he(this,void 0,void 0,F().mark(function n(){var r,s,a,o,c,u,d,h,b,v,y,p,f,m=this;return F().wrap(function(_){for(;;)switch(_.prev=_.next){case 0:if(a=Object.assign({audio:!0,video:!0,useRealTracks:!1},t.publish),o=Object.assign({count:9,audio:!1,video:!0,aspectRatios:[1.66,1.7,1.3]},t.participants),this.handleDisconnect(),this.roomInfo=new um({sid:"RM_SIMULATED",name:"simulated-room",emptyTimeout:0,maxParticipants:0,creationTime:Gt.parse(new Date().getTime()),metadata:"",numParticipants:1,numPublishers:1,turnPassword:"",enabledCodecs:[],activeRecording:!1}),this.localParticipant.updateInfo(new Rl({identity:"simulated-local",name:"local-name"})),this.setupLocalParticipantEvents(),this.emit(je.SignalConnected),this.emit(je.Connected),this.setAndEmitConnectionState(jt.Connected),!a.video){_.next=29;break}if(_.t0=Dd,_.t1=Me.Kind.Video,_.t2=new ho({source:Vn.CAMERA,sid:Math.floor(1e4*Math.random()).toString(),type:Ki.AUDIO,name:"video-dummy"}),_.t3=$n,!a.useRealTracks){_.next=20;break}return _.next=17,window.navigator.mediaDevices.getUserMedia({video:!0});case 17:_.t4=_.sent.getVideoTracks()[0],_.next=21;break;case 20:_.t4=qT(160*((r=o.aspectRatios[0])!==null&&r!==void 0?r:1),160,!0,!0);case 21:_.t5=_.t4,_.t6=void 0,_.t7={loggerName:this.options.loggerName,loggerContextCb:function(){return m.logContext}},_.t8=new _.t3(_.t5,_.t6,!1,_.t7),_.t9={loggerName:this.options.loggerName,loggerContextCb:function(){return m.logContext}},c=new _.t0(_.t1,_.t2,_.t8,_.t9),this.localParticipant.addTrackPublication(c),this.localParticipant.emit(Xe.LocalTrackPublished,c);case 29:if(!a.audio){_.next=50;break}if(_.t10=Dd,_.t11=Me.Kind.Audio,_.t12=new ho({source:Vn.MICROPHONE,sid:Math.floor(1e4*Math.random()).toString(),type:Ki.AUDIO}),_.t13=Pn,!a.useRealTracks){_.next=40;break}return _.next=37,navigator.mediaDevices.getUserMedia({audio:!0});case 37:_.t14=_.sent.getAudioTracks()[0],_.next=41;break;case 40:_.t14=zm();case 41:_.t15=_.t14,_.t16=void 0,_.t17=this.audioContext,_.t18={loggerName:this.options.loggerName,loggerContextCb:function(){return m.logContext}},_.t19=new _.t13(_.t15,_.t16,!1,_.t17,_.t18),_.t20={loggerName:this.options.loggerName,loggerContextCb:function(){return m.logContext}},u=new _.t10(_.t11,_.t12,_.t19,_.t20),this.localParticipant.addTrackPublication(u),this.localParticipant.emit(Xe.LocalTrackPublished,u);case 50:for(d=0;d<o.count-1;d+=1)h=new Rl({sid:Math.floor(1e4*Math.random()).toString(),identity:"simulated-".concat(d),state:dm.ACTIVE,tracks:[],joinedAt:Gt.parse(Date.now())}),b=this.getOrCreateParticipant(h.identity,h),o.video&&(v=qT(160*((s=o.aspectRatios[d%o.aspectRatios.length])!==null&&s!==void 0?s:1),160,!1,!0),y=new ho({source:Vn.CAMERA,sid:Math.floor(1e4*Math.random()).toString(),type:Ki.AUDIO}),b.addSubscribedMediaTrack(v,y.sid,new MediaStream([v]),new RTCRtpReceiver),h.tracks=[].concat(Pi(h.tracks),[y])),o.audio&&(p=zm(),f=new ho({source:Vn.MICROPHONE,sid:Math.floor(1e4*Math.random()).toString(),type:Ki.AUDIO}),b.addSubscribedMediaTrack(p,f.sid,new MediaStream([p]),new RTCRtpReceiver),h.tracks=[].concat(Pi(h.tracks),[f])),b.updateInfo(h);case 51:case"end":return _.stop()}},n,this)}))}},{key:"emit",value:function(t){for(var n,r=arguments.length,s=new Array(r>1?r-1:0),a=1;r>a;a++)s[a-1]=arguments[a];if(t!==je.ActiveSpeakersChanged){var o=xS(s).filter(function(c){return c!==void 0});this.log.debug("room event ".concat(t),Object.assign(Object.assign({},this.logContext),{event:t,args:o}))}return(n=pt(lt(e.prototype),"emit",this)).call.apply(n,[this,t].concat(s))}}],[{key:"getLocalDevices",value:function(t){var n=1>=arguments.length||arguments[1]===void 0||arguments[1];return br.getInstance().getDevices(t,n)}}]),e}();function xS(i){return i.map(function(e){if(e)return Array.isArray(e)?xS(e):et(e)==="object"?"logContext"in e&&e.logContext:e})}(function(i){i[i.IDLE=0]="IDLE",i[i.RUNNING=1]="RUNNING",i[i.SKIPPED=2]="SKIPPED",i[i.SUCCESS=3]="SUCCESS",i[i.FAILED=4]="FAILED"})(CS||(CS={}));var ng=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function cR(i){return i&&i.__esModule&&Object.prototype.hasOwnProperty.call(i,"default")?i.default:i}var ES={exports:{}},wS,DS={exports:{}};function St(){return wS||(wS=1,DS.exports=function(){var i=i||function(e,t){var n;if(typeof window<"u"&&window.crypto&&(n=window.crypto),typeof self<"u"&&self.crypto&&(n=self.crypto),typeof globalThis<"u"&&globalThis.crypto&&(n=globalThis.crypto),!n&&typeof window<"u"&&window.msCrypto&&(n=window.msCrypto),!n&&ng!==void 0&&ng.crypto&&(n=ng.crypto),!n)try{n=require("crypto")}catch{}var r=function(){if(n){if(typeof n.getRandomValues=="function")try{return n.getRandomValues(new Uint32Array(1))[0]}catch{}if(typeof n.randomBytes=="function")try{return n.randomBytes(4).readInt32LE()}catch{}}throw new Error("Native crypto module could not be used to get secure random number.")},s=Object.create||function(){function f(){}return function(m){var _;return f.prototype=m,_=new f,f.prototype=null,_}}(),a={},o=a.lib={},c=o.Base={extend:function(f){var m=s(this);return f&&m.mixIn(f),m.hasOwnProperty("init")&&this.init!==m.init||(m.init=function(){m.$super.init.apply(this,arguments)}),m.init.prototype=m,m.$super=this,m},create:function(){var f=this.extend();return f.init.apply(f,arguments),f},init:function(){},mixIn:function(f){for(var m in f)f.hasOwnProperty(m)&&(this[m]=f[m]);f.hasOwnProperty("toString")&&(this.toString=f.toString)},clone:function(){return this.init.prototype.extend(this)}},u=o.WordArray=c.extend({init:function(f,m){f=this.words=f||[],this.sigBytes=m!=t?m:4*f.length},toString:function(f){return(f||h).stringify(this)},concat:function(f){var m=this.words,_=f.words,k=this.sigBytes,D=f.sigBytes;if(this.clamp(),k%4)for(var w=0;D>w;w++){var A=_[w>>>2]>>>24-w%4*8&255;m[k+w>>>2]|=A<<24-(k+w)%4*8}else for(var x=0;D>x;x+=4)m[k+x>>>2]=_[x>>>2];return this.sigBytes+=D,this},clamp:function(){var f=this.words,m=this.sigBytes;f[m>>>2]&=4294967295<<32-m%4*8,f.length=e.ceil(m/4)},clone:function(){var f=c.clone.call(this);return f.words=this.words.slice(0),f},random:function(f){for(var m=[],_=0;f>_;_+=4)m.push(r());return new u.init(m,f)}}),d=a.enc={},h=d.Hex={stringify:function(f){for(var m=f.words,_=f.sigBytes,k=[],D=0;_>D;D++){var w=m[D>>>2]>>>24-D%4*8&255;k.push((w>>>4).toString(16)),k.push((15&w).toString(16))}return k.join("")},parse:function(f){for(var m=f.length,_=[],k=0;m>k;k+=2)_[k>>>3]|=parseInt(f.substr(k,2),16)<<24-k%8*4;return new u.init(_,m/2)}},b=d.Latin1={stringify:function(f){for(var m=f.words,_=f.sigBytes,k=[],D=0;_>D;D++){var w=m[D>>>2]>>>24-D%4*8&255;k.push(String.fromCharCode(w))}return k.join("")},parse:function(f){for(var m=f.length,_=[],k=0;m>k;k++)_[k>>>2]|=(255&f.charCodeAt(k))<<24-k%4*8;return new u.init(_,m)}},v=d.Utf8={stringify:function(f){try{return decodeURIComponent(escape(b.stringify(f)))}catch{throw new Error("Malformed UTF-8 data")}},parse:function(f){return b.parse(unescape(encodeURIComponent(f)))}},y=o.BufferedBlockAlgorithm=c.extend({reset:function(){this._data=new u.init,this._nDataBytes=0},_append:function(f){typeof f=="string"&&(f=v.parse(f)),this._data.concat(f),this._nDataBytes+=f.sigBytes},_process:function(f){var m,_=this._data,k=_.words,D=_.sigBytes,w=this.blockSize,A=D/(4*w),x=(A=f?e.ceil(A):e.max((0|A)-this._minBufferSize,0))*w,P=e.min(4*x,D);if(x){for(var S=0;x>S;S+=w)this._doProcessBlock(k,S);m=k.splice(0,x),_.sigBytes-=P}return new u.init(m,P)},clone:function(){var f=c.clone.call(this);return f._data=this._data.clone(),f},_minBufferSize:0});o.Hasher=y.extend({cfg:c.extend(),init:function(f){this.cfg=this.cfg.extend(f),this.reset()},reset:function(){y.reset.call(this),this._doReset()},update:function(f){return this._append(f),this._process(),this},finalize:function(f){return f&&this._append(f),this._doFinalize()},blockSize:16,_createHelper:function(f){return function(m,_){return new f.init(_).finalize(m)}},_createHmacHelper:function(f){return function(m,_){return new p.HMAC.init(f,_).finalize(m)}}});var p=a.algo={};return a}(Math);return i}()),DS.exports}var AS,IS={exports:{}};function Id(){return AS||(AS=1,IS.exports=function(i){return n=(t=i).lib,r=n.Base,s=n.WordArray,(a=t.x64={}).Word=r.extend({init:function(o,c){this.high=o,this.low=c}}),a.WordArray=r.extend({init:function(o,c){o=this.words=o||[],this.sigBytes=c!=e?c:8*o.length},toX32:function(){for(var o=this.words,c=o.length,u=[],d=0;c>d;d++){var h=o[d];u.push(h.high),u.push(h.low)}return s.create(u,this.sigBytes)},clone:function(){for(var o=r.clone.call(this),c=o.words=this.words.slice(0),u=c.length,d=0;u>d;d++)c[d]=c[d].clone();return o}}),i;var e,t,n,r,s,a}(St())),IS.exports}var PS,NS={exports:{}};function uR(){return PS||(PS=1,NS.exports=function(i){return function(){if(typeof ArrayBuffer=="function"){var e=i.lib.WordArray,t=e.init,n=e.init=function(r){if(r instanceof ArrayBuffer&&(r=new Uint8Array(r)),(r instanceof Int8Array||typeof Uint8ClampedArray<"u"&&r instanceof Uint8ClampedArray||r instanceof Int16Array||r instanceof Uint16Array||r instanceof Int32Array||r instanceof Uint32Array||r instanceof Float32Array||r instanceof Float64Array)&&(r=new Uint8Array(r.buffer,r.byteOffset,r.byteLength)),r instanceof Uint8Array){for(var s=r.byteLength,a=[],o=0;s>o;o++)a[o>>>2]|=r[o]<<24-o%4*8;t.call(this,a,s)}else t.apply(this,arguments)};n.prototype=e}}(),i.lib.WordArray}(St())),NS.exports}var OS,MS={exports:{}};function dR(){return OS||(OS=1,MS.exports=function(i){return function(){var e=i,t=e.lib.WordArray,n=e.enc;function r(s){return s<<8&4278255360|s>>>8&16711935}n.Utf16=n.Utf16BE={stringify:function(s){for(var a=s.words,o=s.sigBytes,c=[],u=0;o>u;u+=2){var d=a[u>>>2]>>>16-u%4*8&65535;c.push(String.fromCharCode(d))}return c.join("")},parse:function(s){for(var a=s.length,o=[],c=0;a>c;c++)o[c>>>1]|=s.charCodeAt(c)<<16-c%2*16;return t.create(o,2*a)}},n.Utf16LE={stringify:function(s){for(var a=s.words,o=s.sigBytes,c=[],u=0;o>u;u+=2){var d=r(a[u>>>2]>>>16-u%4*8&65535);c.push(String.fromCharCode(d))}return c.join("")},parse:function(s){for(var a=s.length,o=[],c=0;a>c;c++)o[c>>>1]|=r(s.charCodeAt(c)<<16-c%2*16);return t.create(o,2*a)}}}(),i.enc.Utf16}(St())),MS.exports}var RS,LS={exports:{}};function ta(){return RS||(RS=1,LS.exports=function(i){return function(){var e=i,t=e.lib.WordArray;function n(r,s,a){for(var o=[],c=0,u=0;s>u;u++)if(u%4){var d=a[r.charCodeAt(u-1)]<<u%4*2|a[r.charCodeAt(u)]>>>6-u%4*2;o[c>>>2]|=d<<24-c%4*8,c++}return t.create(o,c)}e.enc.Base64={stringify:function(r){var s=r.words,a=r.sigBytes,o=this._map;r.clamp();for(var c=[],u=0;a>u;u+=3)for(var d=(s[u>>>2]>>>24-u%4*8&255)<<16|(s[u+1>>>2]>>>24-(u+1)%4*8&255)<<8|s[u+2>>>2]>>>24-(u+2)%4*8&255,h=0;4>h&&a>u+.75*h;h++)c.push(o.charAt(d>>>6*(3-h)&63));var b=o.charAt(64);if(b)for(;c.length%4;)c.push(b);return c.join("")},parse:function(r){var s=r.length,a=this._map,o=this._reverseMap;if(!o){o=this._reverseMap=[];for(var c=0;c<a.length;c++)o[a.charCodeAt(c)]=c}var u=a.charAt(64);if(u){var d=r.indexOf(u);d!==-1&&(s=d)}return n(r,s,o)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="}}(),i.enc.Base64}(St())),LS.exports}var BS,US={exports:{}};function hR(){return BS||(BS=1,US.exports=function(i){return function(){var e=i,t=e.lib.WordArray;function n(r,s,a){for(var o=[],c=0,u=0;s>u;u++)if(u%4){var d=a[r.charCodeAt(u-1)]<<u%4*2|a[r.charCodeAt(u)]>>>6-u%4*2;o[c>>>2]|=d<<24-c%4*8,c++}return t.create(o,c)}e.enc.Base64url={stringify:function(r,s){s===void 0&&(s=!0);var a=r.words,o=r.sigBytes,c=s?this._safe_map:this._map;r.clamp();for(var u=[],d=0;o>d;d+=3)for(var h=(a[d>>>2]>>>24-d%4*8&255)<<16|(a[d+1>>>2]>>>24-(d+1)%4*8&255)<<8|a[d+2>>>2]>>>24-(d+2)%4*8&255,b=0;4>b&&o>d+.75*b;b++)u.push(c.charAt(h>>>6*(3-b)&63));var v=c.charAt(64);if(v)for(;u.length%4;)u.push(v);return u.join("")},parse:function(r,s){s===void 0&&(s=!0);var a=r.length,o=s?this._safe_map:this._map,c=this._reverseMap;if(!c){c=this._reverseMap=[];for(var u=0;u<o.length;u++)c[o.charCodeAt(u)]=u}var d=o.charAt(64);if(d){var h=r.indexOf(d);h!==-1&&(a=h)}return n(r,a,c)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",_safe_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"}}(),i.enc.Base64url}(St())),US.exports}var FS,VS={exports:{}};function na(){return FS||(FS=1,VS.exports=function(i){return function(e){var t=i,n=t.lib,r=n.WordArray,s=n.Hasher,a=t.algo,o=[];(function(){for(var v=0;64>v;v++)o[v]=4294967296*e.abs(e.sin(v+1))|0})();var c=a.MD5=s.extend({_doReset:function(){this._hash=new r.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(v,y){for(var p=0;16>p;p++){var f=y+p,m=v[f];v[f]=16711935&(m<<8|m>>>24)|4278255360&(m<<24|m>>>8)}var _=this._hash.words,k=v[y+0],D=v[y+1],w=v[y+2],A=v[y+3],x=v[y+4],P=v[y+5],S=v[y+6],M=v[y+7],U=v[y+8],B=v[y+9],Q=v[y+10],ie=v[y+11],Y=v[y+12],q=v[y+13],L=v[y+14],$=v[y+15],H=_[0],j=_[1],W=_[2],ae=_[3];H=u(H,j,W,ae,k,7,o[0]),ae=u(ae,H,j,W,D,12,o[1]),W=u(W,ae,H,j,w,17,o[2]),j=u(j,W,ae,H,A,22,o[3]),H=u(H,j,W,ae,x,7,o[4]),ae=u(ae,H,j,W,P,12,o[5]),W=u(W,ae,H,j,S,17,o[6]),j=u(j,W,ae,H,M,22,o[7]),H=u(H,j,W,ae,U,7,o[8]),ae=u(ae,H,j,W,B,12,o[9]),W=u(W,ae,H,j,Q,17,o[10]),j=u(j,W,ae,H,ie,22,o[11]),H=u(H,j,W,ae,Y,7,o[12]),ae=u(ae,H,j,W,q,12,o[13]),W=u(W,ae,H,j,L,17,o[14]),H=d(H,j=u(j,W,ae,H,$,22,o[15]),W,ae,D,5,o[16]),ae=d(ae,H,j,W,S,9,o[17]),W=d(W,ae,H,j,ie,14,o[18]),j=d(j,W,ae,H,k,20,o[19]),H=d(H,j,W,ae,P,5,o[20]),ae=d(ae,H,j,W,Q,9,o[21]),W=d(W,ae,H,j,$,14,o[22]),j=d(j,W,ae,H,x,20,o[23]),H=d(H,j,W,ae,B,5,o[24]),ae=d(ae,H,j,W,L,9,o[25]),W=d(W,ae,H,j,A,14,o[26]),j=d(j,W,ae,H,U,20,o[27]),H=d(H,j,W,ae,q,5,o[28]),ae=d(ae,H,j,W,w,9,o[29]),W=d(W,ae,H,j,M,14,o[30]),H=h(H,j=d(j,W,ae,H,Y,20,o[31]),W,ae,P,4,o[32]),ae=h(ae,H,j,W,U,11,o[33]),W=h(W,ae,H,j,ie,16,o[34]),j=h(j,W,ae,H,L,23,o[35]),H=h(H,j,W,ae,D,4,o[36]),ae=h(ae,H,j,W,x,11,o[37]),W=h(W,ae,H,j,M,16,o[38]),j=h(j,W,ae,H,Q,23,o[39]),H=h(H,j,W,ae,q,4,o[40]),ae=h(ae,H,j,W,k,11,o[41]),W=h(W,ae,H,j,A,16,o[42]),j=h(j,W,ae,H,S,23,o[43]),H=h(H,j,W,ae,B,4,o[44]),ae=h(ae,H,j,W,Y,11,o[45]),W=h(W,ae,H,j,$,16,o[46]),H=b(H,j=h(j,W,ae,H,w,23,o[47]),W,ae,k,6,o[48]),ae=b(ae,H,j,W,M,10,o[49]),W=b(W,ae,H,j,L,15,o[50]),j=b(j,W,ae,H,P,21,o[51]),H=b(H,j,W,ae,Y,6,o[52]),ae=b(ae,H,j,W,A,10,o[53]),W=b(W,ae,H,j,Q,15,o[54]),j=b(j,W,ae,H,D,21,o[55]),H=b(H,j,W,ae,U,6,o[56]),ae=b(ae,H,j,W,$,10,o[57]),W=b(W,ae,H,j,S,15,o[58]),j=b(j,W,ae,H,q,21,o[59]),H=b(H,j,W,ae,x,6,o[60]),ae=b(ae,H,j,W,ie,10,o[61]),W=b(W,ae,H,j,w,15,o[62]),j=b(j,W,ae,H,B,21,o[63]),_[0]=_[0]+H|0,_[1]=_[1]+j|0,_[2]=_[2]+W|0,_[3]=_[3]+ae|0},_doFinalize:function(){var v=this._data,y=v.words,p=8*this._nDataBytes,f=8*v.sigBytes;y[f>>>5]|=128<<24-f%32;var m=e.floor(p/4294967296),_=p;y[15+(f+64>>>9<<4)]=16711935&(m<<8|m>>>24)|4278255360&(m<<24|m>>>8),y[14+(f+64>>>9<<4)]=16711935&(_<<8|_>>>24)|4278255360&(_<<24|_>>>8),v.sigBytes=4*(y.length+1),this._process();for(var k=this._hash,D=k.words,w=0;4>w;w++){var A=D[w];D[w]=16711935&(A<<8|A>>>24)|4278255360&(A<<24|A>>>8)}return k},clone:function(){var v=s.clone.call(this);return v._hash=this._hash.clone(),v}});function u(v,y,p,f,m,_,k){var D=v+(y&p|~y&f)+m+k;return(D<<_|D>>>32-_)+y}function d(v,y,p,f,m,_,k){var D=v+(y&f|p&~f)+m+k;return(D<<_|D>>>32-_)+y}function h(v,y,p,f,m,_,k){var D=v+(y^p^f)+m+k;return(D<<_|D>>>32-_)+y}function b(v,y,p,f,m,_,k){var D=v+(p^(y|~f))+m+k;return(D<<_|D>>>32-_)+y}t.MD5=s._createHelper(c),t.HmacMD5=s._createHmacHelper(c)}(Math),i.MD5}(St())),VS.exports}var jS,$S={exports:{}};function HS(){return jS||(jS=1,$S.exports=function(i){return t=(e=i).lib,n=t.WordArray,r=t.Hasher,s=e.algo,a=[],o=s.SHA1=r.extend({_doReset:function(){this._hash=new n.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(c,u){for(var d=this._hash.words,h=d[0],b=d[1],v=d[2],y=d[3],p=d[4],f=0;80>f;f++){if(16>f)a[f]=0|c[u+f];else{var m=a[f-3]^a[f-8]^a[f-14]^a[f-16];a[f]=m<<1|m>>>31}var _=(h<<5|h>>>27)+p+a[f];_+=20>f?1518500249+(b&v|~b&y):40>f?1859775393+(b^v^y):60>f?(b&v|b&y|v&y)-1894007588:(b^v^y)-899497514,p=y,y=v,v=b<<30|b>>>2,b=h,h=_}d[0]=d[0]+h|0,d[1]=d[1]+b|0,d[2]=d[2]+v|0,d[3]=d[3]+y|0,d[4]=d[4]+p|0},_doFinalize:function(){var c=this._data,u=c.words,d=8*this._nDataBytes,h=8*c.sigBytes;return u[h>>>5]|=128<<24-h%32,u[14+(h+64>>>9<<4)]=Math.floor(d/4294967296),u[15+(h+64>>>9<<4)]=d,c.sigBytes=4*u.length,this._process(),this._hash},clone:function(){var c=r.clone.call(this);return c._hash=this._hash.clone(),c}}),e.SHA1=r._createHelper(o),e.HmacSHA1=r._createHmacHelper(o),i.SHA1;var e,t,n,r,s,a,o}(St())),$S.exports}var qS,zS={exports:{}};function ig(){return qS||(qS=1,zS.exports=function(i){return function(e){var t=i,n=t.lib,r=n.WordArray,s=n.Hasher,a=t.algo,o=[],c=[];(function(){function h(p){for(var f=e.sqrt(p),m=2;f>=m;m++)if(!(p%m))return!1;return!0}function b(p){return 4294967296*(p-(0|p))|0}for(var v=2,y=0;64>y;)h(v)&&(8>y&&(o[y]=b(e.pow(v,.5))),c[y]=b(e.pow(v,1/3)),y++),v++})();var u=[],d=a.SHA256=s.extend({_doReset:function(){this._hash=new r.init(o.slice(0))},_doProcessBlock:function(h,b){for(var v=this._hash.words,y=v[0],p=v[1],f=v[2],m=v[3],_=v[4],k=v[5],D=v[6],w=v[7],A=0;64>A;A++){if(16>A)u[A]=0|h[b+A];else{var x=u[A-15],P=(x<<25|x>>>7)^(x<<14|x>>>18)^x>>>3,S=u[A-2],M=(S<<15|S>>>17)^(S<<13|S>>>19)^S>>>10;u[A]=P+u[A-7]+M+u[A-16]}var U=y&p^y&f^p&f,B=(y<<30|y>>>2)^(y<<19|y>>>13)^(y<<10|y>>>22),Q=w+((_<<26|_>>>6)^(_<<21|_>>>11)^(_<<7|_>>>25))+(_&k^~_&D)+c[A]+u[A];w=D,D=k,k=_,_=m+Q|0,m=f,f=p,p=y,y=Q+(B+U)|0}v[0]=v[0]+y|0,v[1]=v[1]+p|0,v[2]=v[2]+f|0,v[3]=v[3]+m|0,v[4]=v[4]+_|0,v[5]=v[5]+k|0,v[6]=v[6]+D|0,v[7]=v[7]+w|0},_doFinalize:function(){var h=this._data,b=h.words,v=8*this._nDataBytes,y=8*h.sigBytes;return b[y>>>5]|=128<<24-y%32,b[14+(y+64>>>9<<4)]=e.floor(v/4294967296),b[15+(y+64>>>9<<4)]=v,h.sigBytes=4*b.length,this._process(),this._hash},clone:function(){var h=s.clone.call(this);return h._hash=this._hash.clone(),h}});t.SHA256=s._createHelper(d),t.HmacSHA256=s._createHmacHelper(d)}(Math),i.SHA256}(St())),zS.exports}var GS,WS,KS={exports:{}};function XS(){return WS||(WS=1,KS.exports=function(i){return function(){var e=i,t=e.lib.Hasher,n=e.x64,r=n.Word,s=n.WordArray,a=e.algo;function o(){return r.create.apply(r,arguments)}var c=[o(1116352408,3609767458),o(1899447441,602891725),o(3049323471,3964484399),o(3921009573,2173295548),o(961987163,4081628472),o(1508970993,3053834265),o(2453635748,2937671579),o(2870763221,3664609560),o(3624381080,2734883394),o(310598401,1164996542),o(607225278,1323610764),o(1426881987,3590304994),o(1925078388,4068182383),o(2162078206,991336113),o(2614888103,633803317),o(3248222580,3479774868),o(3835390401,2666613458),o(4022224774,944711139),o(264347078,2341262773),o(604807628,2007800933),o(770255983,1495990901),o(1249150122,1856431235),o(1555081692,3175218132),o(1996064986,2198950837),o(2554220882,3999719339),o(2821834349,766784016),o(2952996808,2566594879),o(3210313671,3203337956),o(3336571891,1034457026),o(3584528711,2466948901),o(113926993,3758326383),o(338241895,168717936),o(666307205,1188179964),o(773529912,1546045734),o(1294757372,1522805485),o(1396182291,2643833823),o(1695183700,2343527390),o(1986661051,1014477480),o(2177026350,1206759142),o(2456956037,344077627),o(2730485921,1290863460),o(2820302411,3158454273),o(3259730800,3505952657),o(3345764771,106217008),o(3516065817,3606008344),o(3600352804,1432725776),o(4094571909,1467031594),o(275423344,851169720),o(430227734,3100823752),o(506948616,1363258195),o(659060556,3750685593),o(883997877,3785050280),o(958139571,3318307427),o(1322822218,3812723403),o(1537002063,2003034995),o(1747873779,3602036899),o(1955562222,1575990012),o(2024104815,1125592928),o(2227730452,2716904306),o(2361852424,442776044),o(2428436474,593698344),o(2756734187,3733110249),o(3204031479,2999351573),o(3329325298,3815920427),o(3391569614,3928383900),o(3515267271,566280711),o(3940187606,3454069534),o(4118630271,4000239992),o(116418474,1914138554),o(174292421,2731055270),o(289380356,3203993006),o(460393269,320620315),o(685471733,587496836),o(852142971,1086792851),o(1017036298,365543100),o(1126000580,2618297676),o(1288033470,3409855158),o(1501505948,4234509866),o(1607167915,987167468),o(1816402316,1246189591)],u=[];(function(){for(var h=0;80>h;h++)u[h]=o()})();var d=a.SHA512=t.extend({_doReset:function(){this._hash=new s.init([new r.init(1779033703,4089235720),new r.init(3144134277,2227873595),new r.init(1013904242,4271175723),new r.init(2773480762,1595750129),new r.init(1359893119,2917565137),new r.init(2600822924,725511199),new r.init(528734635,4215389547),new r.init(1541459225,327033209)])},_doProcessBlock:function(h,b){for(var v=this._hash.words,y=v[0],p=v[1],f=v[2],m=v[3],_=v[4],k=v[5],D=v[6],w=v[7],A=y.high,x=y.low,P=p.high,S=p.low,M=f.high,U=f.low,B=m.high,Q=m.low,ie=_.high,Y=_.low,q=k.high,L=k.low,$=D.high,H=D.low,j=w.high,W=w.low,ae=A,Ee=x,Ae=P,ee=S,fe=M,xe=U,Ne=B,He=Q,Be=ie,be=Y,Fe=q,le=L,ze=$,oe=H,de=j,Le=W,Ve=0;80>Ve;Ve++){var Ke,Ge,ke=u[Ve];if(16>Ve)Ge=ke.high=0|h[b+2*Ve],Ke=ke.low=0|h[b+2*Ve+1];else{var $e=u[Ve-15],_e=$e.high,Re=$e.low,Ie=(_e>>>1|Re<<31)^(_e>>>8|Re<<24)^_e>>>7,it=(Re>>>1|_e<<31)^(Re>>>8|_e<<24)^(Re>>>7|_e<<25),_t=u[Ve-2],Ot=_t.high,Hn=_t.low,Ri=(Ot>>>19|Hn<<13)^(Ot<<3|Hn>>>29)^Ot>>>6,Yn=(Hn>>>19|Ot<<13)^(Hn<<3|Ot>>>29)^(Hn>>>6|Ot<<26),Tt=u[Ve-7],Hr=Tt.high,bi=Tt.low,qn=u[Ve-16],qr=qn.high,Jn=qn.low;Ge=(Ge=(Ge=Ie+Hr+(it>>>0>(Ke=it+bi)>>>0?1:0))+Ri+(Yn>>>0>(Ke+=Yn)>>>0?1:0))+qr+(Jn>>>0>(Ke+=Jn)>>>0?1:0),ke.high=Ge,ke.low=Ke}var oi,Tr=Be&Fe^~Be&ze,zr=be&le^~be&oe,V=ae&Ae^ae&fe^Ae&fe,G=Ee&ee^Ee&xe^ee&xe,se=(ae>>>28|Ee<<4)^(ae<<30|Ee>>>2)^(ae<<25|Ee>>>7),ve=(Ee>>>28|ae<<4)^(Ee<<30|ae>>>2)^(Ee<<25|ae>>>7),We=(Be>>>14|be<<18)^(Be>>>18|be<<14)^(Be<<23|be>>>9),at=(be>>>14|Be<<18)^(be>>>18|Be<<14)^(be<<23|Be>>>9),Et=c[Ve],nt=Et.high,Oe=Et.low,pn=de+We+(Le>>>0>(oi=Le+at)>>>0?1:0),on=ve+G;de=ze,Le=oe,ze=Fe,oe=le,Fe=Be,le=be,Be=Ne+(pn=(pn=(pn=pn+Tr+(zr>>>0>(oi+=zr)>>>0?1:0))+nt+(Oe>>>0>(oi+=Oe)>>>0?1:0))+Ge+(Ke>>>0>(oi+=Ke)>>>0?1:0))+(He>>>0>(be=He+oi|0)>>>0?1:0)|0,Ne=fe,He=xe,fe=Ae,xe=ee,Ae=ae,ee=Ee,ae=pn+(se+V+(ve>>>0>on>>>0?1:0))+(oi>>>0>(Ee=oi+on|0)>>>0?1:0)|0}x=y.low=x+Ee,y.high=A+ae+(Ee>>>0>x>>>0?1:0),S=p.low=S+ee,p.high=P+Ae+(ee>>>0>S>>>0?1:0),U=f.low=U+xe,f.high=M+fe+(xe>>>0>U>>>0?1:0),Q=m.low=Q+He,m.high=B+Ne+(He>>>0>Q>>>0?1:0),Y=_.low=Y+be,_.high=ie+Be+(be>>>0>Y>>>0?1:0),L=k.low=L+le,k.high=q+Fe+(le>>>0>L>>>0?1:0),H=D.low=H+oe,D.high=$+ze+(oe>>>0>H>>>0?1:0),W=w.low=W+Le,w.high=j+de+(Le>>>0>W>>>0?1:0)},_doFinalize:function(){var h=this._data,b=h.words,v=8*this._nDataBytes,y=8*h.sigBytes;return b[y>>>5]|=128<<24-y%32,b[30+(y+128>>>10<<5)]=Math.floor(v/4294967296),b[31+(y+128>>>10<<5)]=v,h.sigBytes=4*b.length,this._process(),this._hash.toX32()},clone:function(){var h=t.clone.call(this);return h._hash=this._hash.clone(),h},blockSize:32});e.SHA512=t._createHelper(d),e.HmacSHA512=t._createHmacHelper(d)}(),i.SHA512}(St(),Id())),KS.exports}var YS,JS,QS={exports:{}};function fR(){return JS||(JS=1,QS.exports=function(i){return function(e){var t=i,n=t.lib,r=n.WordArray,s=n.Hasher,a=t.x64.Word,o=t.algo,c=[],u=[],d=[];(function(){for(var v=1,y=0,p=0;24>p;p++){c[v+5*y]=(p+1)*(p+2)/2%64;var f=(2*v+3*y)%5;v=y%5,y=f}for(v=0;5>v;v++)for(y=0;5>y;y++)u[v+5*y]=y+(2*v+3*y)%5*5;for(var m=1,_=0;24>_;_++){for(var k=0,D=0,w=0;7>w;w++){if(1&m){var A=(1<<w)-1;32>A?D^=1<<A:k^=1<<A-32}128&m?m=m<<1^113:m<<=1}d[_]=a.create(k,D)}})();var h=[];(function(){for(var v=0;25>v;v++)h[v]=a.create()})();var b=o.SHA3=s.extend({cfg:s.cfg.extend({outputLength:512}),_doReset:function(){for(var v=this._state=[],y=0;25>y;y++)v[y]=new a.init;this.blockSize=(1600-2*this.cfg.outputLength)/32},_doProcessBlock:function(v,y){for(var p=this._state,f=this.blockSize/2,m=0;f>m;m++){var _=v[y+2*m],k=v[y+2*m+1];_=16711935&(_<<8|_>>>24)|4278255360&(_<<24|_>>>8),k=16711935&(k<<8|k>>>24)|4278255360&(k<<24|k>>>8),(W=p[m]).high^=k,W.low^=_}for(var D=0;24>D;D++){for(var w=0;5>w;w++){for(var A=0,x=0,P=0;5>P;P++)A^=(W=p[w+5*P]).high,x^=W.low;var S=h[w];S.high=A,S.low=x}for(w=0;5>w;w++){var M=h[(w+4)%5],U=h[(w+1)%5],B=U.high,Q=U.low;for(A=M.high^(B<<1|Q>>>31),x=M.low^(Q<<1|B>>>31),P=0;5>P;P++)(W=p[w+5*P]).high^=A,W.low^=x}for(var ie=1;25>ie;ie++){var Y=(W=p[ie]).high,q=W.low,L=c[ie];32>L?(A=Y<<L|q>>>32-L,x=q<<L|Y>>>32-L):(A=q<<L-32|Y>>>64-L,x=Y<<L-32|q>>>64-L);var $=h[u[ie]];$.high=A,$.low=x}var H=h[0],j=p[0];for(H.high=j.high,H.low=j.low,w=0;5>w;w++)for(P=0;5>P;P++){var W=p[ie=w+5*P],ae=h[ie],Ee=h[(w+1)%5+5*P],Ae=h[(w+2)%5+5*P];W.high=ae.high^~Ee.high&Ae.high,W.low=ae.low^~Ee.low&Ae.low}W=p[0];var ee=d[D];W.high^=ee.high,W.low^=ee.low}},_doFinalize:function(){var v=this._data,y=v.words;this._nDataBytes;var p=8*v.sigBytes,f=32*this.blockSize;y[p>>>5]|=1<<24-p%32,y[(e.ceil((p+1)/f)*f>>>5)-1]|=128,v.sigBytes=4*y.length,this._process();for(var m=this._state,_=this.cfg.outputLength/8,k=_/8,D=[],w=0;k>w;w++){var A=m[w],x=A.high,P=A.low;x=16711935&(x<<8|x>>>24)|4278255360&(x<<24|x>>>8),P=16711935&(P<<8|P>>>24)|4278255360&(P<<24|P>>>8),D.push(P),D.push(x)}return new r.init(D,_)},clone:function(){for(var v=s.clone.call(this),y=v._state=this._state.slice(0),p=0;25>p;p++)y[p]=y[p].clone();return v}});t.SHA3=s._createHelper(b),t.HmacSHA3=s._createHmacHelper(b)}(Math),i.SHA3}(St(),Id())),QS.exports}var ZS,eC,tC={exports:{}};function rg(){return eC||(eC=1,tC.exports=function(i){var e,t,n;t=(e=i).lib.Base,n=e.enc.Utf8,e.algo.HMAC=t.extend({init:function(r,s){r=this._hasher=new r.init,typeof s=="string"&&(s=n.parse(s));var a=r.blockSize,o=4*a;s.sigBytes>o&&(s=r.finalize(s)),s.clamp();for(var c=this._oKey=s.clone(),u=this._iKey=s.clone(),d=c.words,h=u.words,b=0;a>b;b++)d[b]^=1549556828,h[b]^=909522486;c.sigBytes=u.sigBytes=o,this.reset()},reset:function(){var r=this._hasher;r.reset(),r.update(this._iKey)},update:function(r){return this._hasher.update(r),this},finalize:function(r){var s=this._hasher,a=s.finalize(r);return s.reset(),s.finalize(this._oKey.clone().concat(a))}})}(St())),tC.exports}var nC,iC,rC={exports:{}};function ys(){return iC||(iC=1,rC.exports=function(i){return t=(e=i).lib,n=t.Base,r=t.WordArray,s=e.algo,a=s.MD5,o=s.EvpKDF=n.extend({cfg:n.extend({keySize:4,hasher:a,iterations:1}),init:function(c){this.cfg=this.cfg.extend(c)},compute:function(c,u){for(var d,h=this.cfg,b=h.hasher.create(),v=r.create(),y=v.words,p=h.keySize,f=h.iterations;y.length<p;){d&&b.update(d),d=b.update(c).finalize(u),b.reset();for(var m=1;f>m;m++)d=b.finalize(d),b.reset();v.concat(d)}return v.sigBytes=4*p,v}}),e.EvpKDF=function(c,u,d){return o.create(d).compute(c,u)},i.EvpKDF;var e,t,n,r,s,a,o}(St(),HS(),rg())),rC.exports}var sC,aC={exports:{}};function Cn(){return sC||(sC=1,aC.exports=function(i){i.lib.Cipher||function(e){var t=i,n=t.lib,r=n.Base,s=n.WordArray,a=n.BufferedBlockAlgorithm,o=t.enc;o.Utf8;var c=o.Base64,u=t.algo.EvpKDF,d=n.Cipher=a.extend({cfg:r.extend(),createEncryptor:function(D,w){return this.create(this._ENC_XFORM_MODE,D,w)},createDecryptor:function(D,w){return this.create(this._DEC_XFORM_MODE,D,w)},init:function(D,w,A){this.cfg=this.cfg.extend(A),this._xformMode=D,this._key=w,this.reset()},reset:function(){a.reset.call(this),this._doReset()},process:function(D){return this._append(D),this._process()},finalize:function(D){return D&&this._append(D),this._doFinalize()},keySize:4,ivSize:4,_ENC_XFORM_MODE:1,_DEC_XFORM_MODE:2,_createHelper:function(){function D(w){return typeof w=="string"?k:m}return function(w){return{encrypt:function(A,x,P){return D(x).encrypt(w,A,x,P)},decrypt:function(A,x,P){return D(x).decrypt(w,A,x,P)}}}}()});n.StreamCipher=d.extend({_doFinalize:function(){return this._process(!0)},blockSize:1});var h=t.mode={},b=n.BlockCipherMode=r.extend({createEncryptor:function(D,w){return this.Encryptor.create(D,w)},createDecryptor:function(D,w){return this.Decryptor.create(D,w)},init:function(D,w){this._cipher=D,this._iv=w}}),v=h.CBC=function(){var D=b.extend();function w(A,x,P){var S,M=this._iv;M?(S=M,this._iv=e):S=this._prevBlock;for(var U=0;P>U;U++)A[x+U]^=S[U]}return D.Encryptor=D.extend({processBlock:function(A,x){var P=this._cipher,S=P.blockSize;w.call(this,A,x,S),P.encryptBlock(A,x),this._prevBlock=A.slice(x,x+S)}}),D.Decryptor=D.extend({processBlock:function(A,x){var P=this._cipher,S=P.blockSize,M=A.slice(x,x+S);P.decryptBlock(A,x),w.call(this,A,x,S),this._prevBlock=M}}),D}(),y=(t.pad={}).Pkcs7={pad:function(D,w){for(var A=4*w,x=A-D.sigBytes%A,P=x<<24|x<<16|x<<8|x,S=[],M=0;x>M;M+=4)S.push(P);var U=s.create(S,x);D.concat(U)},unpad:function(D){var w=255&D.words[D.sigBytes-1>>>2];D.sigBytes-=w}};n.BlockCipher=d.extend({cfg:d.cfg.extend({mode:v,padding:y}),reset:function(){var D;d.reset.call(this);var w=this.cfg,A=w.iv,x=w.mode;this._xformMode==this._ENC_XFORM_MODE?D=x.createEncryptor:(D=x.createDecryptor,this._minBufferSize=1),this._mode&&this._mode.__creator==D?this._mode.init(this,A&&A.words):(this._mode=D.call(x,this,A&&A.words),this._mode.__creator=D)},_doProcessBlock:function(D,w){this._mode.processBlock(D,w)},_doFinalize:function(){var D,w=this.cfg.padding;return this._xformMode==this._ENC_XFORM_MODE?(w.pad(this._data,this.blockSize),D=this._process(!0)):(D=this._process(!0),w.unpad(D)),D},blockSize:4});var p=n.CipherParams=r.extend({init:function(D){this.mixIn(D)},toString:function(D){return(D||this.formatter).stringify(this)}}),f=(t.format={}).OpenSSL={stringify:function(D){var w=D.ciphertext,A=D.salt;return(A?s.create([1398893684,1701076831]).concat(A).concat(w):w).toString(c)},parse:function(D){var w,A=c.parse(D),x=A.words;return x[0]==1398893684&&x[1]==1701076831&&(w=s.create(x.slice(2,4)),x.splice(0,4),A.sigBytes-=16),p.create({ciphertext:A,salt:w})}},m=n.SerializableCipher=r.extend({cfg:r.extend({format:f}),encrypt:function(D,w,A,x){x=this.cfg.extend(x);var P=D.createEncryptor(A,x),S=P.finalize(w),M=P.cfg;return p.create({ciphertext:S,key:A,iv:M.iv,algorithm:D,mode:M.mode,padding:M.padding,blockSize:D.blockSize,formatter:x.format})},decrypt:function(D,w,A,x){return x=this.cfg.extend(x),w=this._parse(w,x.format),D.createDecryptor(A,x).finalize(w.ciphertext)},_parse:function(D,w){return typeof D=="string"?w.parse(D,this):D}}),_=(t.kdf={}).OpenSSL={execute:function(D,w,A,x,P){if(x||(x=s.random(8)),P)S=u.create({keySize:w+A,hasher:P}).compute(D,x);else var S=u.create({keySize:w+A}).compute(D,x);var M=s.create(S.words.slice(w),4*A);return S.sigBytes=4*w,p.create({key:S,iv:M,salt:x})}},k=n.PasswordBasedCipher=m.extend({cfg:m.cfg.extend({kdf:_}),encrypt:function(D,w,A,x){var P=(x=this.cfg.extend(x)).kdf.execute(A,D.keySize,D.ivSize,x.salt,x.hasher);x.iv=P.iv;var S=m.encrypt.call(this,D,w,P.key,x);return S.mixIn(P),S},decrypt:function(D,w,A,x){x=this.cfg.extend(x),w=this._parse(w,x.format);var P=x.kdf.execute(A,D.keySize,D.ivSize,w.salt,x.hasher);return x.iv=P.iv,m.decrypt.call(this,D,w,P.key,x)}})}()}(St(),ys())),aC.exports}var oC,lC={exports:{}};function pR(){return oC||(oC=1,lC.exports=function(i){return i.mode.CFB=function(){var e=i.lib.BlockCipherMode.extend();function t(n,r,s,a){var o,c=this._iv;c?(o=c.slice(0),this._iv=void 0):o=this._prevBlock,a.encryptBlock(o,0);for(var u=0;s>u;u++)n[r+u]^=o[u]}return e.Encryptor=e.extend({processBlock:function(n,r){var s=this._cipher,a=s.blockSize;t.call(this,n,r,a,s),this._prevBlock=n.slice(r,r+a)}}),e.Decryptor=e.extend({processBlock:function(n,r){var s=this._cipher,a=s.blockSize,o=n.slice(r,r+a);t.call(this,n,r,a,s),this._prevBlock=o}}),e}(),i.mode.CFB}(St(),Cn())),lC.exports}var cC,uC={exports:{}};function mR(){return cC||(cC=1,uC.exports=function(i){return i.mode.CTR=(e=i.lib.BlockCipherMode.extend(),t=e.Encryptor=e.extend({processBlock:function(n,r){var s=this._cipher,a=s.blockSize,o=this._iv,c=this._counter;o&&(c=this._counter=o.slice(0),this._iv=void 0);var u=c.slice(0);s.encryptBlock(u,0),c[a-1]=c[a-1]+1|0;for(var d=0;a>d;d++)n[r+d]^=u[d]}}),e.Decryptor=t,e),i.mode.CTR;var e,t}(St(),Cn())),uC.exports}var dC,hC={exports:{}};function gR(){return dC||(dC=1,hC.exports=function(i){return i.mode.CTRGladman=function(){var e=i.lib.BlockCipherMode.extend();function t(s){if((s>>24&255)==255){var a=s>>16&255,o=s>>8&255,c=255&s;a===255?(a=0,o===255?(o=0,c===255?c=0:++c):++o):++a,s=0,s+=a<<16,s+=o<<8,s+=c}else s+=1<<24;return s}function n(s){return(s[0]=t(s[0]))===0&&(s[1]=t(s[1])),s}var r=e.Encryptor=e.extend({processBlock:function(s,a){var o=this._cipher,c=o.blockSize,u=this._iv,d=this._counter;u&&(d=this._counter=u.slice(0),this._iv=void 0),n(d);var h=d.slice(0);o.encryptBlock(h,0);for(var b=0;c>b;b++)s[a+b]^=h[b]}});return e.Decryptor=r,e}(),i.mode.CTRGladman}(St(),Cn())),hC.exports}var fC,pC={exports:{}};function vR(){return fC||(fC=1,pC.exports=function(i){return i.mode.OFB=(e=i.lib.BlockCipherMode.extend(),t=e.Encryptor=e.extend({processBlock:function(n,r){var s=this._cipher,a=s.blockSize,o=this._iv,c=this._keystream;o&&(c=this._keystream=o.slice(0),this._iv=void 0),s.encryptBlock(c,0);for(var u=0;a>u;u++)n[r+u]^=c[u]}}),e.Decryptor=t,e),i.mode.OFB;var e,t}(St(),Cn())),pC.exports}var mC,gC,vC,yC,bC,_C,kC,TC,SC,CC={exports:{}};function yR(){return SC||(SC=1,CC.exports=function(i){return function(){var e=i,t=e.lib,n=t.WordArray,r=t.BlockCipher,s=e.algo,a=[57,49,41,33,25,17,9,1,58,50,42,34,26,18,10,2,59,51,43,35,27,19,11,3,60,52,44,36,63,55,47,39,31,23,15,7,62,54,46,38,30,22,14,6,61,53,45,37,29,21,13,5,28,20,12,4],o=[14,17,11,24,1,5,3,28,15,6,21,10,23,19,12,4,26,8,16,7,27,20,13,2,41,52,31,37,47,55,30,40,51,45,33,48,44,49,39,56,34,53,46,42,50,36,29,32],c=[1,2,4,6,8,10,12,14,15,17,19,21,23,25,27,28],u=[{0:8421888,268435456:32768,536870912:8421378,805306368:2,1073741824:512,1342177280:8421890,1610612736:8389122,1879048192:8388608,2147483648:514,2415919104:8389120,2684354560:33280,2952790016:8421376,3221225472:32770,3489660928:8388610,3758096384:0,4026531840:33282,134217728:0,402653184:8421890,671088640:33282,939524096:32768,1207959552:8421888,1476395008:512,1744830464:8421378,2013265920:2,2281701376:8389120,2550136832:33280,2818572288:8421376,3087007744:8389122,3355443200:8388610,3623878656:32770,3892314112:514,4160749568:8388608,1:32768,268435457:2,536870913:8421888,805306369:8388608,1073741825:8421378,1342177281:33280,1610612737:512,1879048193:8389122,2147483649:8421890,2415919105:8421376,2684354561:8388610,2952790017:33282,3221225473:514,3489660929:8389120,3758096385:32770,4026531841:0,134217729:8421890,402653185:8421376,671088641:8388608,939524097:512,1207959553:32768,1476395009:8388610,1744830465:2,2013265921:33282,2281701377:32770,2550136833:8389122,2818572289:514,3087007745:8421888,3355443201:8389120,3623878657:0,3892314113:33280,4160749569:8421378},{0:1074282512,16777216:16384,33554432:524288,50331648:1074266128,67108864:1073741840,83886080:1074282496,100663296:1073758208,117440512:16,134217728:540672,150994944:1073758224,167772160:1073741824,184549376:540688,201326592:524304,218103808:0,234881024:16400,251658240:1074266112,8388608:1073758208,25165824:540688,41943040:16,58720256:1073758224,75497472:1074282512,92274688:1073741824,109051904:524288,125829120:1074266128,142606336:524304,159383552:0,176160768:16384,192937984:1074266112,209715200:1073741840,226492416:540672,243269632:1074282496,260046848:16400,268435456:0,285212672:1074266128,301989888:1073758224,318767104:1074282496,335544320:1074266112,352321536:16,369098752:540688,385875968:16384,402653184:16400,419430400:524288,436207616:524304,452984832:1073741840,469762048:540672,486539264:1073758208,503316480:1073741824,520093696:1074282512,276824064:540688,293601280:524288,310378496:1074266112,327155712:16384,343932928:1073758208,360710144:1074282512,377487360:16,394264576:1073741824,411041792:1074282496,427819008:1073741840,444596224:1073758224,461373440:524304,478150656:0,494927872:16400,511705088:1074266128,528482304:540672},{0:260,1048576:0,2097152:67109120,3145728:65796,4194304:65540,5242880:67108868,6291456:67174660,7340032:67174400,8388608:67108864,9437184:67174656,10485760:65792,11534336:67174404,12582912:67109124,13631488:65536,14680064:4,15728640:256,524288:67174656,1572864:67174404,2621440:0,3670016:67109120,4718592:67108868,5767168:65536,6815744:65540,7864320:260,8912896:4,9961472:256,11010048:67174400,12058624:65796,13107200:65792,14155776:67109124,15204352:67174660,16252928:67108864,16777216:67174656,17825792:65540,18874368:65536,19922944:67109120,20971520:256,22020096:67174660,23068672:67108868,24117248:0,25165824:67109124,26214400:67108864,27262976:4,28311552:65792,29360128:67174400,30408704:260,31457280:65796,32505856:67174404,17301504:67108864,18350080:260,19398656:67174656,20447232:0,21495808:65540,22544384:67109120,23592960:256,24641536:67174404,25690112:65536,26738688:67174660,27787264:65796,28835840:67108868,29884416:67109124,30932992:67174400,31981568:4,33030144:65792},{0:2151682048,65536:2147487808,131072:4198464,196608:2151677952,262144:0,327680:4198400,393216:2147483712,458752:4194368,524288:2147483648,589824:4194304,655360:64,720896:2147487744,786432:2151678016,851968:4160,917504:4096,983040:2151682112,32768:2147487808,98304:64,163840:2151678016,229376:2147487744,294912:4198400,360448:2151682112,425984:0,491520:2151677952,557056:4096,622592:2151682048,688128:4194304,753664:4160,819200:2147483648,884736:4194368,950272:4198464,1015808:2147483712,1048576:4194368,1114112:4198400,1179648:2147483712,1245184:0,1310720:4160,1376256:2151678016,1441792:2151682048,1507328:2147487808,1572864:2151682112,1638400:2147483648,1703936:2151677952,1769472:4198464,1835008:2147487744,1900544:4194304,1966080:64,2031616:4096,1081344:2151677952,1146880:2151682112,1212416:0,1277952:4198400,1343488:4194368,1409024:2147483648,1474560:2147487808,1540096:64,1605632:2147483712,1671168:4096,1736704:2147487744,1802240:2151678016,1867776:4160,1933312:2151682048,1998848:4194304,2064384:4198464},{0:128,4096:17039360,8192:262144,12288:536870912,16384:537133184,20480:16777344,24576:553648256,28672:262272,32768:16777216,36864:537133056,40960:536871040,45056:553910400,49152:553910272,53248:0,57344:17039488,61440:553648128,2048:17039488,6144:553648256,10240:128,14336:17039360,18432:262144,22528:537133184,26624:553910272,30720:536870912,34816:537133056,38912:0,43008:553910400,47104:16777344,51200:536871040,55296:553648128,59392:16777216,63488:262272,65536:262144,69632:128,73728:536870912,77824:553648256,81920:16777344,86016:553910272,90112:537133184,94208:16777216,98304:553910400,102400:553648128,106496:17039360,110592:537133056,114688:262272,118784:536871040,122880:0,126976:17039488,67584:553648256,71680:16777216,75776:17039360,79872:537133184,83968:536870912,88064:17039488,92160:128,96256:553910272,100352:262272,104448:553910400,108544:0,112640:553648128,116736:16777344,120832:262144,124928:537133056,129024:536871040},{0:268435464,256:8192,512:270532608,768:270540808,1024:268443648,1280:2097152,1536:2097160,1792:268435456,2048:0,2304:268443656,2560:2105344,2816:8,3072:270532616,3328:2105352,3584:8200,3840:270540800,128:270532608,384:270540808,640:8,896:2097152,1152:2105352,1408:268435464,1664:268443648,1920:8200,2176:2097160,2432:8192,2688:268443656,2944:270532616,3200:0,3456:270540800,3712:2105344,3968:268435456,4096:268443648,4352:270532616,4608:270540808,4864:8200,5120:2097152,5376:268435456,5632:268435464,5888:2105344,6144:2105352,6400:0,6656:8,6912:270532608,7168:8192,7424:268443656,7680:270540800,7936:2097160,4224:8,4480:2105344,4736:2097152,4992:268435464,5248:268443648,5504:8200,5760:270540808,6016:270532608,6272:270540800,6528:270532616,6784:8192,7040:2105352,7296:2097160,7552:0,7808:268435456,8064:268443656},{0:1048576,16:33555457,32:1024,48:1049601,64:34604033,80:0,96:1,112:34603009,128:33555456,144:1048577,160:33554433,176:34604032,192:34603008,208:1025,224:1049600,240:33554432,8:34603009,24:0,40:33555457,56:34604032,72:1048576,88:33554433,104:33554432,120:1025,136:1049601,152:33555456,168:34603008,184:1048577,200:1024,216:34604033,232:1,248:1049600,256:33554432,272:1048576,288:33555457,304:34603009,320:1048577,336:33555456,352:34604032,368:1049601,384:1025,400:34604033,416:1049600,432:1,448:0,464:34603008,480:33554433,496:1024,264:1049600,280:33555457,296:34603009,312:1,328:33554432,344:1048576,360:1025,376:34604032,392:33554433,408:34603008,424:0,440:34604033,456:1049601,472:1024,488:33555456,504:1048577},{0:134219808,1:131072,2:134217728,3:32,4:131104,5:134350880,6:134350848,7:2048,8:134348800,9:134219776,10:133120,11:134348832,12:2080,13:0,14:134217760,15:133152,2147483648:2048,2147483649:134350880,2147483650:134219808,2147483651:134217728,2147483652:134348800,2147483653:133120,2147483654:133152,2147483655:32,2147483656:134217760,2147483657:2080,2147483658:131104,2147483659:134350848,2147483660:0,2147483661:134348832,2147483662:134219776,2147483663:131072,16:133152,17:134350848,18:32,19:2048,20:134219776,21:134217760,22:134348832,23:131072,24:0,25:131104,26:134348800,27:134219808,28:134350880,29:133120,30:2080,31:134217728,2147483664:131072,2147483665:2048,2147483666:134348832,2147483667:133152,2147483668:32,2147483669:134348800,2147483670:134217728,2147483671:134219808,2147483672:134350880,2147483673:134217760,2147483674:134219776,2147483675:0,2147483676:133120,2147483677:2080,2147483678:131104,2147483679:134350848}],d=[4160749569,528482304,33030144,2064384,129024,8064,504,2147483679],h=s.DES=r.extend({_doReset:function(){for(var p=this._key.words,f=[],m=0;56>m;m++){var _=a[m]-1;f[m]=p[_>>>5]>>>31-_%32&1}for(var k=this._subKeys=[],D=0;16>D;D++){var w=k[D]=[],A=c[D];for(m=0;24>m;m++)w[m/6|0]|=f[(o[m]-1+A)%28]<<31-m%6,w[4+(m/6|0)]|=f[28+(o[m+24]-1+A)%28]<<31-m%6;for(w[0]=w[0]<<1|w[0]>>>31,m=1;7>m;m++)w[m]=w[m]>>>4*(m-1)+3;w[7]=w[7]<<5|w[7]>>>27}var x=this._invSubKeys=[];for(m=0;16>m;m++)x[m]=k[15-m]},encryptBlock:function(p,f){this._doCryptBlock(p,f,this._subKeys)},decryptBlock:function(p,f){this._doCryptBlock(p,f,this._invSubKeys)},_doCryptBlock:function(p,f,m){this._lBlock=p[f],this._rBlock=p[f+1],b.call(this,4,252645135),b.call(this,16,65535),v.call(this,2,858993459),v.call(this,8,16711935),b.call(this,1,1431655765);for(var _=0;16>_;_++){for(var k=m[_],D=this._lBlock,w=this._rBlock,A=0,x=0;8>x;x++)A|=u[x][((w^k[x])&d[x])>>>0];this._lBlock=w,this._rBlock=D^A}var P=this._lBlock;this._lBlock=this._rBlock,this._rBlock=P,b.call(this,1,1431655765),v.call(this,8,16711935),v.call(this,2,858993459),b.call(this,16,65535),b.call(this,4,252645135),p[f]=this._lBlock,p[f+1]=this._rBlock},keySize:2,ivSize:2,blockSize:2});function b(p,f){var m=(this._lBlock>>>p^this._rBlock)&f;this._rBlock^=m,this._lBlock^=m<<p}function v(p,f){var m=(this._rBlock>>>p^this._lBlock)&f;this._lBlock^=m,this._rBlock^=m<<p}e.DES=r._createHelper(h);var y=s.TripleDES=r.extend({_doReset:function(){var p=this._key.words;if(p.length!==2&&p.length!==4&&6>p.length)throw new Error("Invalid key length - 3DES requires the key length to be 64, 128, 192 or >192.");var f=p.slice(0,2),m=4>p.length?p.slice(0,2):p.slice(2,4),_=6>p.length?p.slice(0,2):p.slice(4,6);this._des1=h.createEncryptor(n.create(f)),this._des2=h.createEncryptor(n.create(m)),this._des3=h.createEncryptor(n.create(_))},encryptBlock:function(p,f){this._des1.encryptBlock(p,f),this._des2.decryptBlock(p,f),this._des3.encryptBlock(p,f)},decryptBlock:function(p,f){this._des3.decryptBlock(p,f),this._des2.encryptBlock(p,f),this._des1.decryptBlock(p,f)},keySize:6,ivSize:2,blockSize:2});e.TripleDES=r._createHelper(y)}(),i.TripleDES}(St(),ta(),na(),ys(),Cn())),CC.exports}var xC,EC,wC,DC,AC={exports:{}};function bR(){return DC||(DC=1,AC.exports=function(i){return function(){var e=i,t=e.lib.BlockCipher,n=e.algo;const r=16,s=[608135816,2242054355,320440878,57701188,2752067618,698298832,137296536,3964562569,1160258022,953160567,3193202383,887688300,3232508343,3380367581,1065670069,3041331479,2450970073,2306472731],a=[[3509652390,2564797868,805139163,3491422135,3101798381,1780907670,3128725573,4046225305,614570311,3012652279,134345442,2240740374,1667834072,1901547113,2757295779,4103290238,227898511,1921955416,1904987480,2182433518,2069144605,3260701109,2620446009,720527379,3318853667,677414384,3393288472,3101374703,2390351024,1614419982,1822297739,2954791486,3608508353,3174124327,2024746970,1432378464,3864339955,2857741204,1464375394,1676153920,1439316330,715854006,3033291828,289532110,2706671279,2087905683,3018724369,1668267050,732546397,1947742710,3462151702,2609353502,2950085171,1814351708,2050118529,680887927,999245976,1800124847,3300911131,1713906067,1641548236,4213287313,1216130144,1575780402,4018429277,3917837745,3693486850,3949271944,596196993,3549867205,258830323,2213823033,772490370,2760122372,1774776394,2652871518,566650946,4142492826,1728879713,2882767088,1783734482,3629395816,2517608232,2874225571,1861159788,326777828,3124490320,2130389656,2716951837,967770486,1724537150,2185432712,2364442137,1164943284,2105845187,998989502,3765401048,2244026483,1075463327,1455516326,1322494562,910128902,469688178,1117454909,936433444,3490320968,3675253459,1240580251,122909385,2157517691,634681816,4142456567,3825094682,3061402683,2540495037,79693498,3249098678,1084186820,1583128258,426386531,1761308591,1047286709,322548459,995290223,1845252383,2603652396,3431023940,2942221577,3202600964,3727903485,1712269319,422464435,3234572375,1170764815,3523960633,3117677531,1434042557,442511882,3600875718,1076654713,1738483198,4213154764,2393238008,3677496056,1014306527,4251020053,793779912,2902807211,842905082,4246964064,1395751752,1040244610,2656851899,3396308128,445077038,3742853595,3577915638,679411651,2892444358,2354009459,1767581616,3150600392,3791627101,3102740896,284835224,4246832056,1258075500,768725851,2589189241,3069724005,3532540348,1274779536,3789419226,2764799539,1660621633,3471099624,4011903706,913787905,3497959166,737222580,2514213453,2928710040,3937242737,1804850592,3499020752,2949064160,2386320175,2390070455,2415321851,4061277028,2290661394,2416832540,1336762016,1754252060,3520065937,3014181293,791618072,3188594551,3933548030,2332172193,3852520463,3043980520,413987798,3465142937,3030929376,4245938359,2093235073,3534596313,375366246,2157278981,2479649556,555357303,3870105701,2008414854,3344188149,4221384143,3956125452,2067696032,3594591187,2921233993,2428461,544322398,577241275,1471733935,610547355,4027169054,1432588573,1507829418,2025931657,3646575487,545086370,48609733,2200306550,1653985193,298326376,1316178497,3007786442,2064951626,458293330,2589141269,3591329599,3164325604,727753846,2179363840,146436021,1461446943,4069977195,705550613,3059967265,3887724982,4281599278,3313849956,1404054877,2845806497,146425753,1854211946],[1266315497,3048417604,3681880366,3289982499,290971e4,1235738493,2632868024,2414719590,3970600049,1771706367,1449415276,3266420449,422970021,1963543593,2690192192,3826793022,1062508698,1531092325,1804592342,2583117782,2714934279,4024971509,1294809318,4028980673,1289560198,2221992742,1669523910,35572830,157838143,1052438473,1016535060,1802137761,1753167236,1386275462,3080475397,2857371447,1040679964,2145300060,2390574316,1461121720,2956646967,4031777805,4028374788,33600511,2920084762,1018524850,629373528,3691585981,3515945977,2091462646,2486323059,586499841,988145025,935516892,3367335476,2599673255,2839830854,265290510,3972581182,2759138881,3795373465,1005194799,847297441,406762289,1314163512,1332590856,1866599683,4127851711,750260880,613907577,1450815602,3165620655,3734664991,3650291728,3012275730,3704569646,1427272223,778793252,1343938022,2676280711,2052605720,1946737175,3164576444,3914038668,3967478842,3682934266,1661551462,3294938066,4011595847,840292616,3712170807,616741398,312560963,711312465,1351876610,322626781,1910503582,271666773,2175563734,1594956187,70604529,3617834859,1007753275,1495573769,4069517037,2549218298,2663038764,504708206,2263041392,3941167025,2249088522,1514023603,1998579484,1312622330,694541497,2582060303,2151582166,1382467621,776784248,2618340202,3323268794,2497899128,2784771155,503983604,4076293799,907881277,423175695,432175456,1378068232,4145222326,3954048622,3938656102,3820766613,2793130115,2977904593,26017576,3274890735,3194772133,1700274565,1756076034,4006520079,3677328699,720338349,1533947780,354530856,688349552,3973924725,1637815568,332179504,3949051286,53804574,2852348879,3044236432,1282449977,3583942155,3416972820,4006381244,1617046695,2628476075,3002303598,1686838959,431878346,2686675385,1700445008,1080580658,1009431731,832498133,3223435511,2605976345,2271191193,2516031870,1648197032,4164389018,2548247927,300782431,375919233,238389289,3353747414,2531188641,2019080857,1475708069,455242339,2609103871,448939670,3451063019,1395535956,2413381860,1841049896,1491858159,885456874,4264095073,4001119347,1565136089,3898914787,1108368660,540939232,1173283510,2745871338,3681308437,4207628240,3343053890,4016749493,1699691293,1103962373,3625875870,2256883143,3830138730,1031889488,3479347698,1535977030,4236805024,3251091107,2132092099,1774941330,1199868427,1452454533,157007616,2904115357,342012276,595725824,1480756522,206960106,497939518,591360097,863170706,2375253569,3596610801,1814182875,2094937945,3421402208,1082520231,3463918190,2785509508,435703966,3908032597,1641649973,2842273706,3305899714,1510255612,2148256476,2655287854,3276092548,4258621189,236887753,3681803219,274041037,1734335097,3815195456,3317970021,1899903192,1026095262,4050517792,356393447,2410691914,3873677099,3682840055],[3913112168,2491498743,4132185628,2489919796,1091903735,1979897079,3170134830,3567386728,3557303409,857797738,1136121015,1342202287,507115054,2535736646,337727348,3213592640,1301675037,2528481711,1895095763,1721773893,3216771564,62756741,2142006736,835421444,2531993523,1442658625,3659876326,2882144922,676362277,1392781812,170690266,3921047035,1759253602,3611846912,1745797284,664899054,1329594018,3901205900,3045908486,2062866102,2865634940,3543621612,3464012697,1080764994,553557557,3656615353,3996768171,991055499,499776247,1265440854,648242737,3940784050,980351604,3713745714,1749149687,3396870395,4211799374,3640570775,1161844396,3125318951,1431517754,545492359,4268468663,3499529547,1437099964,2702547544,3433638243,2581715763,2787789398,1060185593,1593081372,2418618748,4260947970,69676912,2159744348,86519011,2512459080,3838209314,1220612927,3339683548,133810670,1090789135,1078426020,1569222167,845107691,3583754449,4072456591,1091646820,628848692,1613405280,3757631651,526609435,236106946,48312990,2942717905,3402727701,1797494240,859738849,992217954,4005476642,2243076622,3870952857,3732016268,765654824,3490871365,2511836413,1685915746,3888969200,1414112111,2273134842,3281911079,4080962846,172450625,2569994100,980381355,4109958455,2819808352,2716589560,2568741196,3681446669,3329971472,1835478071,660984891,3704678404,4045999559,3422617507,3040415634,1762651403,1719377915,3470491036,2693910283,3642056355,3138596744,1364962596,2073328063,1983633131,926494387,3423689081,2150032023,4096667949,1749200295,3328846651,309677260,2016342300,1779581495,3079819751,111262694,1274766160,443224088,298511866,1025883608,3806446537,1145181785,168956806,3641502830,3584813610,1689216846,3666258015,3200248200,1692713982,2646376535,4042768518,1618508792,1610833997,3523052358,4130873264,2001055236,3610705100,2202168115,4028541809,2961195399,1006657119,2006996926,3186142756,1430667929,3210227297,1314452623,4074634658,4101304120,2273951170,1399257539,3367210612,3027628629,1190975929,2062231137,2333990788,2221543033,2438960610,1181637006,548689776,2362791313,3372408396,3104550113,3145860560,296247880,1970579870,3078560182,3769228297,1714227617,3291629107,3898220290,166772364,1251581989,493813264,448347421,195405023,2709975567,677966185,3703036547,1463355134,2715995803,1338867538,1343315457,2802222074,2684532164,233230375,2599980071,2000651841,3277868038,1638401717,4028070440,3237316320,6314154,819756386,300326615,590932579,1405279636,3267499572,3150704214,2428286686,3959192993,3461946742,1862657033,1266418056,963775037,2089974820,2263052895,1917689273,448879540,3550394620,3981727096,150775221,3627908307,1303187396,508620638,2975983352,2726630617,1817252668,1876281319,1457606340,908771278,3720792119,3617206836,2455994898,1729034894,1080033504],[976866871,3556439503,2881648439,1522871579,1555064734,1336096578,3548522304,2579274686,3574697629,3205460757,3593280638,3338716283,3079412587,564236357,2993598910,1781952180,1464380207,3163844217,3332601554,1699332808,1393555694,1183702653,3581086237,1288719814,691649499,2847557200,2895455976,3193889540,2717570544,1781354906,1676643554,2592534050,3230253752,1126444790,2770207658,2633158820,2210423226,2615765581,2414155088,3127139286,673620729,2805611233,1269405062,4015350505,3341807571,4149409754,1057255273,2012875353,2162469141,2276492801,2601117357,993977747,3918593370,2654263191,753973209,36408145,2530585658,25011837,3520020182,2088578344,530523599,2918365339,1524020338,1518925132,3760827505,3759777254,1202760957,3985898139,3906192525,674977740,4174734889,2031300136,2019492241,3983892565,4153806404,3822280332,352677332,2297720250,60907813,90501309,3286998549,1016092578,2535922412,2839152426,457141659,509813237,4120667899,652014361,1966332200,2975202805,55981186,2327461051,676427537,3255491064,2882294119,3433927263,1307055953,942726286,933058658,2468411793,3933900994,4215176142,1361170020,2001714738,2830558078,3274259782,1222529897,1679025792,2729314320,3714953764,1770335741,151462246,3013232138,1682292957,1483529935,471910574,1539241949,458788160,3436315007,1807016891,3718408830,978976581,1043663428,3165965781,1927990952,4200891579,2372276910,3208408903,3533431907,1412390302,2931980059,4132332400,1947078029,3881505623,4168226417,2941484381,1077988104,1320477388,886195818,18198404,3786409e3,2509781533,112762804,3463356488,1866414978,891333506,18488651,661792760,1628790961,3885187036,3141171499,876946877,2693282273,1372485963,791857591,2686433993,3759982718,3167212022,3472953795,2716379847,445679433,3561995674,3504004811,3574258232,54117162,3331405415,2381918588,3769707343,4154350007,1140177722,4074052095,668550556,3214352940,367459370,261225585,2610173221,4209349473,3468074219,3265815641,314222801,3066103646,3808782860,282218597,3406013506,3773591054,379116347,1285071038,846784868,2669647154,3771962079,3550491691,2305946142,453669953,1268987020,3317592352,3279303384,3744833421,2610507566,3859509063,266596637,3847019092,517658769,3462560207,3443424879,370717030,4247526661,2224018117,4143653529,4112773975,2788324899,2477274417,1456262402,2901442914,1517677493,1846949527,2295493580,3734397586,2176403920,1280348187,1908823572,3871786941,846861322,1172426758,3287448474,3383383037,1655181056,3139813346,901632758,1897031941,2986607138,3066810236,3447102507,1393639104,373351379,950779232,625454576,3124240540,4148612726,2007998917,544563296,2244738638,2330496472,2058025392,1291430526,424198748,50039436,29584100,3605783033,2429876329,2791104160,1057563949,3255363231,3075367218,3463963227,1469046755,985887462]];var o={pbox:[],sbox:[]};function c(v,y){let p=y>>24&255,f=y>>16&255,m=y>>8&255,_=255&y,k=v.sbox[0][p]+v.sbox[1][f];return k^=v.sbox[2][m],k+=v.sbox[3][_],k}function u(v,y,p){let f,m=y,_=p;for(let k=0;r>k;++k)m^=v.pbox[k],_=c(v,m)^_,f=m,m=_,_=f;return f=m,m=_,_=f,_^=v.pbox[r],m^=v.pbox[r+1],{left:m,right:_}}function d(v,y,p){let f,m=y,_=p;for(let k=r+1;k>1;--k)m^=v.pbox[k],_=c(v,m)^_,f=m,m=_,_=f;return f=m,m=_,_=f,_^=v.pbox[1],m^=v.pbox[0],{left:m,right:_}}function h(v,y,p){for(let D=0;4>D;D++){v.sbox[D]=[];for(let w=0;256>w;w++)v.sbox[D][w]=a[D][w]}let f=0;for(let D=0;r+2>D;D++)v.pbox[D]=s[D]^y[f],f++,p>f||(f=0);let m=0,_=0,k=0;for(let D=0;r+2>D;D+=2)k=u(v,m,_),m=k.left,_=k.right,v.pbox[D]=m,v.pbox[D+1]=_;for(let D=0;4>D;D++)for(let w=0;256>w;w+=2)k=u(v,m,_),m=k.left,_=k.right,v.sbox[D][w]=m,v.sbox[D][w+1]=_;return!0}var b=n.Blowfish=t.extend({_doReset:function(){if(this._keyPriorReset!==this._key){var v=this._keyPriorReset=this._key,y=v.words,p=v.sigBytes/4;h(o,y,p)}},encryptBlock:function(v,y){var p=u(o,v[y],v[y+1]);v[y]=p.left,v[y+1]=p.right},decryptBlock:function(v,y){var p=d(o,v[y],v[y+1]);v[y]=p.left,v[y+1]=p.right},blockSize:2,keySize:4,ivSize:2});e.Blowfish=t._createHelper(b)}(),i.Blowfish}(St(),ta(),na(),ys(),Cn())),AC.exports}ES.exports=function(i){return i}(St(),Id(),uR(),dR(),ta(),hR(),na(),HS(),ig(),GS||(GS=1,function(i){return t=(e=i).lib.WordArray,n=e.algo,r=n.SHA256,s=n.SHA224=r.extend({_doReset:function(){this._hash=new t.init([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428])},_doFinalize:function(){var a=r._doFinalize.call(this);return a.sigBytes-=4,a}}),e.SHA224=r._createHelper(s),e.HmacSHA224=r._createHmacHelper(s),i.SHA224;var e,t,n,r,s}(St(),ig())),XS(),YS||(YS=1,function(i){return t=(e=i).x64,n=t.Word,r=t.WordArray,s=e.algo,a=s.SHA512,o=s.SHA384=a.extend({_doReset:function(){this._hash=new r.init([new n.init(3418070365,3238371032),new n.init(1654270250,914150663),new n.init(2438529370,812702999),new n.init(355462360,4144912697),new n.init(1731405415,4290775857),new n.init(2394180231,1750603025),new n.init(3675008525,1694076839),new n.init(1203062813,3204075428)])},_doFinalize:function(){var c=a._doFinalize.call(this);return c.sigBytes-=16,c}}),e.SHA384=a._createHelper(o),e.HmacSHA384=a._createHmacHelper(o),i.SHA384;var e,t,n,r,s,a,o}(St(),Id(),XS())),fR(),ZS||(ZS=1,function(i){return function(e){var t=i,n=t.lib,r=n.WordArray,s=n.Hasher,a=t.algo,o=r.create([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13]),c=r.create([5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11]),u=r.create([11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6]),d=r.create([8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]),h=r.create([0,1518500249,1859775393,2400959708,2840853838]),b=r.create([1352829926,1548603684,1836072691,2053994217,0]),v=a.RIPEMD160=s.extend({_doReset:function(){this._hash=r.create([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(D,w){for(var A=0;16>A;A++){var x=w+A,P=D[x];D[x]=16711935&(P<<8|P>>>24)|4278255360&(P<<24|P>>>8)}var S,M,U,B,Q,ie,Y,q,L,$,H,j=this._hash.words,W=h.words,ae=b.words,Ee=o.words,Ae=c.words,ee=u.words,fe=d.words;for(ie=S=j[0],Y=M=j[1],q=U=j[2],L=B=j[3],$=Q=j[4],A=0;80>A;A+=1)H=S+D[w+Ee[A]]|0,H+=16>A?y(M,U,B)+W[0]:32>A?p(M,U,B)+W[1]:48>A?f(M,U,B)+W[2]:64>A?m(M,U,B)+W[3]:_(M,U,B)+W[4],H=(H=k(H|=0,ee[A]))+Q|0,S=Q,Q=B,B=k(U,10),U=M,M=H,H=ie+D[w+Ae[A]]|0,H+=16>A?_(Y,q,L)+ae[0]:32>A?m(Y,q,L)+ae[1]:48>A?f(Y,q,L)+ae[2]:64>A?p(Y,q,L)+ae[3]:y(Y,q,L)+ae[4],H=(H=k(H|=0,fe[A]))+$|0,ie=$,$=L,L=k(q,10),q=Y,Y=H;H=j[1]+U+L|0,j[1]=j[2]+B+$|0,j[2]=j[3]+Q+ie|0,j[3]=j[4]+S+Y|0,j[4]=j[0]+M+q|0,j[0]=H},_doFinalize:function(){var D=this._data,w=D.words,A=8*this._nDataBytes,x=8*D.sigBytes;w[x>>>5]|=128<<24-x%32,w[14+(x+64>>>9<<4)]=16711935&(A<<8|A>>>24)|4278255360&(A<<24|A>>>8),D.sigBytes=4*(w.length+1),this._process();for(var P=this._hash,S=P.words,M=0;5>M;M++){var U=S[M];S[M]=16711935&(U<<8|U>>>24)|4278255360&(U<<24|U>>>8)}return P},clone:function(){var D=s.clone.call(this);return D._hash=this._hash.clone(),D}});function y(D,w,A){return D^w^A}function p(D,w,A){return D&w|~D&A}function f(D,w,A){return(D|~w)^A}function m(D,w,A){return D&A|w&~A}function _(D,w,A){return D^(w|~A)}function k(D,w){return D<<w|D>>>32-w}t.RIPEMD160=s._createHelper(v),t.HmacRIPEMD160=s._createHmacHelper(v)}(),i.RIPEMD160}(St())),rg(),nC||(nC=1,function(i){return n=(t=(e=i).lib).Base,r=t.WordArray,a=(s=e.algo).SHA256,o=s.HMAC,c=s.PBKDF2=n.extend({cfg:n.extend({keySize:4,hasher:a,iterations:25e4}),init:function(u){this.cfg=this.cfg.extend(u)},compute:function(u,d){for(var h=this.cfg,b=o.create(h.hasher,u),v=r.create(),y=r.create([1]),p=v.words,f=y.words,m=h.keySize,_=h.iterations;p.length<m;){var k=b.update(d).finalize(y);b.reset();for(var D=k.words,w=D.length,A=k,x=1;_>x;x++){A=b.finalize(A),b.reset();for(var P=A.words,S=0;w>S;S++)D[S]^=P[S]}v.concat(k),f[0]++}return v.sigBytes=4*m,v}}),e.PBKDF2=function(u,d,h){return c.create(h).compute(u,d)},i.PBKDF2;var e,t,n,r,s,a,o,c}(St(),ig(),rg())),ys(),Cn(),pR(),mR(),gR(),vR(),mC||(mC=1,function(i){return i.mode.ECB=((e=i.lib.BlockCipherMode.extend()).Encryptor=e.extend({processBlock:function(t,n){this._cipher.encryptBlock(t,n)}}),e.Decryptor=e.extend({processBlock:function(t,n){this._cipher.decryptBlock(t,n)}}),e),i.mode.ECB;var e}(St(),Cn())),gC||(gC=1,function(i){return i.pad.AnsiX923={pad:function(e,t){var n=e.sigBytes,r=4*t,s=r-n%r,a=n+s-1;e.clamp(),e.words[a>>>2]|=s<<24-a%4*8,e.sigBytes+=s},unpad:function(e){var t=255&e.words[e.sigBytes-1>>>2];e.sigBytes-=t}},i.pad.Ansix923}(St(),Cn())),vC||(vC=1,function(i){return i.pad.Iso10126={pad:function(e,t){var n=4*t,r=n-e.sigBytes%n;e.concat(i.lib.WordArray.random(r-1)).concat(i.lib.WordArray.create([r<<24],1))},unpad:function(e){var t=255&e.words[e.sigBytes-1>>>2];e.sigBytes-=t}},i.pad.Iso10126}(St(),Cn())),yC||(yC=1,function(i){return i.pad.Iso97971={pad:function(e,t){e.concat(i.lib.WordArray.create([2147483648],1)),i.pad.ZeroPadding.pad(e,t)},unpad:function(e){i.pad.ZeroPadding.unpad(e),e.sigBytes--}},i.pad.Iso97971}(St(),Cn())),bC||(bC=1,function(i){return i.pad.ZeroPadding={pad:function(e,t){var n=4*t;e.clamp(),e.sigBytes+=n-(e.sigBytes%n||n)},unpad:function(e){var t=e.words,n=e.sigBytes-1;for(n=e.sigBytes-1;n>=0;n--)if(t[n>>>2]>>>24-n%4*8&255){e.sigBytes=n+1;break}}},i.pad.ZeroPadding}(St(),Cn())),_C||(_C=1,function(i){return i.pad.NoPadding={pad:function(){},unpad:function(){}},i.pad.NoPadding}(St(),Cn())),kC||(kC=1,function(i){return t=(e=i).lib.CipherParams,n=e.enc.Hex,e.format.Hex={stringify:function(r){return r.ciphertext.toString(n)},parse:function(r){var s=n.parse(r);return t.create({ciphertext:s})}},i.format.Hex;var e,t,n}(St(),Cn())),TC||(TC=1,function(i){return function(){var e=i,t=e.lib.BlockCipher,n=e.algo,r=[],s=[],a=[],o=[],c=[],u=[],d=[],h=[],b=[],v=[];(function(){for(var f=[],m=0;256>m;m++)f[m]=128>m?m<<1:m<<1^283;var _=0,k=0;for(m=0;256>m;m++){var D=k^k<<1^k<<2^k<<3^k<<4;D=D>>>8^255&D^99,r[_]=D,s[D]=_;var w=f[_],A=f[w],x=f[A],P=257*f[D]^16843008*D;a[_]=P<<24|P>>>8,o[_]=P<<16|P>>>16,c[_]=P<<8|P>>>24,u[_]=P,P=16843009*x^65537*A^257*w^16843008*_,d[D]=P<<24|P>>>8,h[D]=P<<16|P>>>16,b[D]=P<<8|P>>>24,v[D]=P,_?(_=w^f[f[f[x^w]]],k^=f[f[k]]):_=k=1}})();var y=[0,1,2,4,8,16,32,64,128,27,54],p=n.AES=t.extend({_doReset:function(){if(!this._nRounds||this._keyPriorReset!==this._key){for(var f=this._keyPriorReset=this._key,m=f.words,_=f.sigBytes/4,k=4*((this._nRounds=_+6)+1),D=this._keySchedule=[],w=0;k>w;w++)_>w?D[w]=m[w]:(P=D[w-1],w%_?_>6&&w%_==4&&(P=r[P>>>24]<<24|r[P>>>16&255]<<16|r[P>>>8&255]<<8|r[255&P]):(P=r[(P=P<<8|P>>>24)>>>24]<<24|r[P>>>16&255]<<16|r[P>>>8&255]<<8|r[255&P],P^=y[w/_|0]<<24),D[w]=D[w-_]^P);for(var A=this._invKeySchedule=[],x=0;k>x;x++){if(w=k-x,x%4)var P=D[w];else P=D[w-4];A[x]=4>x||4>=w?P:d[r[P>>>24]]^h[r[P>>>16&255]]^b[r[P>>>8&255]]^v[r[255&P]]}}},encryptBlock:function(f,m){this._doCryptBlock(f,m,this._keySchedule,a,o,c,u,r)},decryptBlock:function(f,m){var _=f[m+1];f[m+1]=f[m+3],f[m+3]=_,this._doCryptBlock(f,m,this._invKeySchedule,d,h,b,v,s),_=f[m+1],f[m+1]=f[m+3],f[m+3]=_},_doCryptBlock:function(f,m,_,k,D,w,A,x){for(var P=this._nRounds,S=f[m]^_[0],M=f[m+1]^_[1],U=f[m+2]^_[2],B=f[m+3]^_[3],Q=4,ie=1;P>ie;ie++){var Y=k[S>>>24]^D[M>>>16&255]^w[U>>>8&255]^A[255&B]^_[Q++],q=k[M>>>24]^D[U>>>16&255]^w[B>>>8&255]^A[255&S]^_[Q++],L=k[U>>>24]^D[B>>>16&255]^w[S>>>8&255]^A[255&M]^_[Q++],$=k[B>>>24]^D[S>>>16&255]^w[M>>>8&255]^A[255&U]^_[Q++];S=Y,M=q,U=L,B=$}Y=(x[S>>>24]<<24|x[M>>>16&255]<<16|x[U>>>8&255]<<8|x[255&B])^_[Q++],q=(x[M>>>24]<<24|x[U>>>16&255]<<16|x[B>>>8&255]<<8|x[255&S])^_[Q++],L=(x[U>>>24]<<24|x[B>>>16&255]<<16|x[S>>>8&255]<<8|x[255&M])^_[Q++],$=(x[B>>>24]<<24|x[S>>>16&255]<<16|x[M>>>8&255]<<8|x[255&U])^_[Q++],f[m]=Y,f[m+1]=q,f[m+2]=L,f[m+3]=$},keySize:8});e.AES=t._createHelper(p)}(),i.AES}(St(),ta(),na(),ys(),Cn())),yR(),xC||(xC=1,function(i){return function(){var e=i,t=e.lib.StreamCipher,n=e.algo,r=n.RC4=t.extend({_doReset:function(){for(var o=this._key,c=o.words,u=o.sigBytes,d=this._S=[],h=0;256>h;h++)d[h]=h;h=0;for(var b=0;256>h;h++){var v=h%u,y=c[v>>>2]>>>24-v%4*8&255;b=(b+d[h]+y)%256;var p=d[h];d[h]=d[b],d[b]=p}this._i=this._j=0},_doProcessBlock:function(o,c){o[c]^=s.call(this)},keySize:8,ivSize:0});function s(){for(var o=this._S,c=this._i,u=this._j,d=0,h=0;4>h;h++){u=(u+o[c=(c+1)%256])%256;var b=o[c];o[c]=o[u],o[u]=b,d|=o[(o[c]+o[u])%256]<<24-8*h}return this._i=c,this._j=u,d}e.RC4=t._createHelper(r);var a=n.RC4Drop=r.extend({cfg:r.cfg.extend({drop:192}),_doReset:function(){r._doReset.call(this);for(var o=this.cfg.drop;o>0;o--)s.call(this)}});e.RC4Drop=t._createHelper(a)}(),i.RC4}(St(),ta(),na(),ys(),Cn())),EC||(EC=1,function(i){return function(){var e=i,t=e.lib.StreamCipher,n=e.algo,r=[],s=[],a=[],o=n.Rabbit=t.extend({_doReset:function(){for(var u=this._key.words,d=this.cfg.iv,h=0;4>h;h++)u[h]=16711935&(u[h]<<8|u[h]>>>24)|4278255360&(u[h]<<24|u[h]>>>8);var b=this._X=[u[0],u[3]<<16|u[2]>>>16,u[1],u[0]<<16|u[3]>>>16,u[2],u[1]<<16|u[0]>>>16,u[3],u[2]<<16|u[1]>>>16],v=this._C=[u[2]<<16|u[2]>>>16,4294901760&u[0]|65535&u[1],u[3]<<16|u[3]>>>16,4294901760&u[1]|65535&u[2],u[0]<<16|u[0]>>>16,4294901760&u[2]|65535&u[3],u[1]<<16|u[1]>>>16,4294901760&u[3]|65535&u[0]];for(this._b=0,h=0;4>h;h++)c.call(this);for(h=0;8>h;h++)v[h]^=b[h+4&7];if(d){var y=d.words,p=y[0],f=y[1],m=16711935&(p<<8|p>>>24)|4278255360&(p<<24|p>>>8),_=16711935&(f<<8|f>>>24)|4278255360&(f<<24|f>>>8),k=m>>>16|4294901760&_,D=_<<16|65535&m;for(v[0]^=m,v[1]^=k,v[2]^=_,v[3]^=D,v[4]^=m,v[5]^=k,v[6]^=_,v[7]^=D,h=0;4>h;h++)c.call(this)}},_doProcessBlock:function(u,d){var h=this._X;c.call(this),r[0]=h[0]^h[5]>>>16^h[3]<<16,r[1]=h[2]^h[7]>>>16^h[5]<<16,r[2]=h[4]^h[1]>>>16^h[7]<<16,r[3]=h[6]^h[3]>>>16^h[1]<<16;for(var b=0;4>b;b++)r[b]=16711935&(r[b]<<8|r[b]>>>24)|4278255360&(r[b]<<24|r[b]>>>8),u[d+b]^=r[b]},blockSize:4,ivSize:2});function c(){for(var u=this._X,d=this._C,h=0;8>h;h++)s[h]=d[h];for(d[0]=d[0]+1295307597+this._b|0,d[1]=d[1]+3545052371+(d[0]>>>0<s[0]>>>0?1:0)|0,d[2]=d[2]+886263092+(d[1]>>>0<s[1]>>>0?1:0)|0,d[3]=d[3]+1295307597+(d[2]>>>0<s[2]>>>0?1:0)|0,d[4]=d[4]+3545052371+(d[3]>>>0<s[3]>>>0?1:0)|0,d[5]=d[5]+886263092+(d[4]>>>0<s[4]>>>0?1:0)|0,d[6]=d[6]+1295307597+(d[5]>>>0<s[5]>>>0?1:0)|0,d[7]=d[7]+3545052371+(d[6]>>>0<s[6]>>>0?1:0)|0,this._b=d[7]>>>0<s[7]>>>0?1:0,h=0;8>h;h++){var b=u[h]+d[h],v=65535&b,y=b>>>16,p=((v*v>>>17)+v*y>>>15)+y*y,f=((4294901760&b)*b|0)+((65535&b)*b|0);a[h]=p^f}u[0]=a[0]+(a[7]<<16|a[7]>>>16)+(a[6]<<16|a[6]>>>16)|0,u[1]=a[1]+(a[0]<<8|a[0]>>>24)+a[7]|0,u[2]=a[2]+(a[1]<<16|a[1]>>>16)+(a[0]<<16|a[0]>>>16)|0,u[3]=a[3]+(a[2]<<8|a[2]>>>24)+a[1]|0,u[4]=a[4]+(a[3]<<16|a[3]>>>16)+(a[2]<<16|a[2]>>>16)|0,u[5]=a[5]+(a[4]<<8|a[4]>>>24)+a[3]|0,u[6]=a[6]+(a[5]<<16|a[5]>>>16)+(a[4]<<16|a[4]>>>16)|0,u[7]=a[7]+(a[6]<<8|a[6]>>>24)+a[5]|0}e.Rabbit=t._createHelper(o)}(),i.Rabbit}(St(),ta(),na(),ys(),Cn())),wC||(wC=1,function(i){return function(){var e=i,t=e.lib.StreamCipher,n=e.algo,r=[],s=[],a=[],o=n.RabbitLegacy=t.extend({_doReset:function(){var u=this._key.words,d=this.cfg.iv,h=this._X=[u[0],u[3]<<16|u[2]>>>16,u[1],u[0]<<16|u[3]>>>16,u[2],u[1]<<16|u[0]>>>16,u[3],u[2]<<16|u[1]>>>16],b=this._C=[u[2]<<16|u[2]>>>16,4294901760&u[0]|65535&u[1],u[3]<<16|u[3]>>>16,4294901760&u[1]|65535&u[2],u[0]<<16|u[0]>>>16,4294901760&u[2]|65535&u[3],u[1]<<16|u[1]>>>16,4294901760&u[3]|65535&u[0]];this._b=0;for(var v=0;4>v;v++)c.call(this);for(v=0;8>v;v++)b[v]^=h[v+4&7];if(d){var y=d.words,p=y[0],f=y[1],m=16711935&(p<<8|p>>>24)|4278255360&(p<<24|p>>>8),_=16711935&(f<<8|f>>>24)|4278255360&(f<<24|f>>>8),k=m>>>16|4294901760&_,D=_<<16|65535&m;for(b[0]^=m,b[1]^=k,b[2]^=_,b[3]^=D,b[4]^=m,b[5]^=k,b[6]^=_,b[7]^=D,v=0;4>v;v++)c.call(this)}},_doProcessBlock:function(u,d){var h=this._X;c.call(this),r[0]=h[0]^h[5]>>>16^h[3]<<16,r[1]=h[2]^h[7]>>>16^h[5]<<16,r[2]=h[4]^h[1]>>>16^h[7]<<16,r[3]=h[6]^h[3]>>>16^h[1]<<16;for(var b=0;4>b;b++)r[b]=16711935&(r[b]<<8|r[b]>>>24)|4278255360&(r[b]<<24|r[b]>>>8),u[d+b]^=r[b]},blockSize:4,ivSize:2});function c(){for(var u=this._X,d=this._C,h=0;8>h;h++)s[h]=d[h];for(d[0]=d[0]+1295307597+this._b|0,d[1]=d[1]+3545052371+(d[0]>>>0<s[0]>>>0?1:0)|0,d[2]=d[2]+886263092+(d[1]>>>0<s[1]>>>0?1:0)|0,d[3]=d[3]+1295307597+(d[2]>>>0<s[2]>>>0?1:0)|0,d[4]=d[4]+3545052371+(d[3]>>>0<s[3]>>>0?1:0)|0,d[5]=d[5]+886263092+(d[4]>>>0<s[4]>>>0?1:0)|0,d[6]=d[6]+1295307597+(d[5]>>>0<s[5]>>>0?1:0)|0,d[7]=d[7]+3545052371+(d[6]>>>0<s[6]>>>0?1:0)|0,this._b=d[7]>>>0<s[7]>>>0?1:0,h=0;8>h;h++){var b=u[h]+d[h],v=65535&b,y=b>>>16,p=((v*v>>>17)+v*y>>>15)+y*y,f=((4294901760&b)*b|0)+((65535&b)*b|0);a[h]=p^f}u[0]=a[0]+(a[7]<<16|a[7]>>>16)+(a[6]<<16|a[6]>>>16)|0,u[1]=a[1]+(a[0]<<8|a[0]>>>24)+a[7]|0,u[2]=a[2]+(a[1]<<16|a[1]>>>16)+(a[0]<<16|a[0]>>>16)|0,u[3]=a[3]+(a[2]<<8|a[2]>>>24)+a[1]|0,u[4]=a[4]+(a[3]<<16|a[3]>>>16)+(a[2]<<16|a[2]>>>16)|0,u[5]=a[5]+(a[4]<<8|a[4]>>>24)+a[3]|0,u[6]=a[6]+(a[5]<<16|a[5]>>>16)+(a[4]<<16|a[4]>>>16)|0,u[7]=a[7]+(a[6]<<8|a[6]>>>24)+a[5]|0}e.RabbitLegacy=t._createHelper(o)}(),i.RabbitLegacy}(St(),ta(),na(),ys(),Cn())),bR());var Pd=cR(ES.exports),bs=new WeakMap,sg=new WeakMap,ag=new WeakMap,IC=new WeakSet,_R=function(){function i(e,t,n){ht(this,i),Wi(this,IC),Mr(this,bs,{writable:!0,value:null}),Mr(this,sg,{writable:!0,value:null}),Mr(this,ag,{writable:!0,value:null}),this.url=e,this.socket=null,this.isOpen=!1,this.messageHandlers=new Map,this.openHandlers=new Map,this.closeHandlers=[],this.errorHandlers=[],Or(this,sg,t),Or(this,ag,n)}return ft(i,[{key:"connect",value:function(){var e=this,t=en(this,IC,kR).call(this),n=t.timestamp,r=t.signature,s=this.url.indexOf("&timestamp");this.url=s>-1?this.url.replace(this.url.substring(s),"&timestamp=".concat(n,"&signature=").concat(r)):"".concat(this.url,"&timestamp=").concat(n,"&signature=").concat(r),this.socket=new WebSocket(this.url),this.socket.onopen=function(a){e.isOpen=!0,e.openHandlers.size>0&&e.openHandlers.forEach(function(o){return o()}),Nt(e,bs)&&(clearInterval(Nt(e,bs)),Or(e,bs,null)),Or(e,bs,setInterval(function(){e.send({cmd:"HeartBreak"})},1e4))},this.socket.onmessage=function(a){e.messageHandlers.size>0&&e.messageHandlers.forEach(function(o){return o(a.data)})},this.socket.onclose=function(a){e.closeHandlers.forEach(function(o){return o(a)})},this.socket.onerror=function(a){e.errorHandlers.forEach(function(o){return o(a)})}}},{key:"send",value:function(e){var t=this;this.socket.readyState===WebSocket.OPEN?this.socket.send(JSON.stringify(e)):this.socket.readyState===WebSocket.CLOSED?this.isOpen&&(this.connect(),this.clearOpenHandler(),this.addOpenHandler("MsgSend",function(){t.socket.send(JSON.stringify(e))})):(this.clearOpenHandler(),this.addOpenHandler("MsgSend",function(){t.socket.send(JSON.stringify(e))}))}},{key:"addMessageHandler",value:function(e,t){this.messageHandlers.has(e)?(this.messageHandlers.delete(e),this.messageHandlers.set(e,t)):this.messageHandlers.set(e,t)}},{key:"addOpenHandler",value:function(e,t){this.openHandlers.has(e)?(this.openHandlers.delete(e),this.openHandlers.set(e,t)):this.openHandlers.set(e,t)}},{key:"addCloseHandler",value:function(e){this.closeHandlers.push(e)}},{key:"addErrorHandler",value:function(e){this.errorHandlers.push(e)}},{key:"clearMessageHandler",value:function(){this.messageHandlers.clear()}},{key:"clearOpenHandler",value:function(){this.openHandlers.clear()}},{key:"clearCloseHandler",value:function(){this.closeHandlers=[]}},{key:"clearErrorHandler",value:function(){this.errorHandlers=[]}},{key:"close",value:function(){this.socket.close(),this.isOpen=!1,Nt(this,bs)&&(clearInterval(Nt(this,bs)),Or(this,bs,null))}}]),i}();function kR(){var i=Math.floor(Date.now()/1e3),e="".concat(Nt(this,sg)).concat(i),t=Pd.HmacSHA256(e,Nt(this,ag));return{timestamp:i,signature:Pd.enc.Base64.stringify(t).replace(/\+/g,"-").replace(/\//g,"_")}}var ia=new WeakMap,TR=function(){function i(){var e;ht(this,i),Mr(this,ia,{writable:!0,value:void 0}),Or(this,ia,{all:e=e||new Map,on:function(t,n){var r=e.get(t);r?r.push(n):e.set(t,[n])},off:function(t,n){var r=e.get(t);r&&(n?r.splice(r.indexOf(n)>>>0,1):e.set(t,[]))},emit:function(t,n){var r=e.get(t);r&&r.slice().map(function(s){s(n)}),(r=e.get("*"))&&r.slice().map(function(s){s(t,n)})}})}return ft(i,[{key:"on",value:function(e,t){Nt(this,ia).on(e,t)}},{key:"off",value:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;t&&typeof t=="function"?Nt(this,ia).off(e,t):Nt(this,ia).off(e)}},{key:"emit",value:function(e,t){Nt(this,ia).emit(e,t)}},{key:"removeAllListeners",value:function(){Nt(this,ia).all.clear()}}]),i}(),Nd=new WeakMap,Od=new WeakMap,Md=new WeakMap,Mi=new WeakMap,og=new WeakMap,PC=new WeakSet,Rd=new WeakSet,NC=new WeakSet,kr=new WeakSet,OC=new WeakSet,MC=new WeakSet,RC=new WeakSet,Ld=new WeakSet,LC=new WeakSet,BC=new WeakSet,lg=function(i){function e(){var f,m=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},_=m.userId,k=m.org,D=m.roomName,w=D===void 0?"":D,A=m.roomMode,x=A===void 0?"auto":A,P=m.baseUrl;ht(this,e),Wi(ct(f=Ut(this,e)),BC),Wi(ct(f),LC),Wi(ct(f),Ld),Wi(ct(f),RC),Wi(ct(f),MC),Wi(ct(f),OC),Wi(ct(f),kr),Wi(ct(f),NC),Wi(ct(f),Rd),Wi(ct(f),PC),Mr(ct(f),Nd,{writable:!0,value:""}),Mr(ct(f),Od,{writable:!0,value:""}),Mr(ct(f),Md,{writable:!0,value:null}),Mr(ct(f),Mi,{writable:!0,value:"devkey"}),Mr(ct(f),og,{writable:!0,value:"hongxinlkclient&BBX5Y8PtsACxFEEApUPs"}),f.userId=_,f.org=k,f.roomName=w,f.roomNum,f.room=null,f.roomMode=x,f.baseUrl=P,f.encoder=new TextEncoder,f.decoder=new TextDecoder,f.wshead=f.baseUrl.split("//")[0]=="http:"?"ws://":"wss://";var S=en(ct(f),kr,jr).call(ct(f)),M=S.timestamp,U=S.signature;return f.websocketUrl="".concat(f.wshead).concat(f.baseUrl.split("//")[1],"/socket?org=").concat(f.org,"&identity=").concat(f.userId,"&apikey=").concat(Nt(ct(f),Mi),"&timestamp=").concat(M,"&signature=").concat(U),f.socket=new _R(f.websocketUrl,Nt(ct(f),Mi),Nt(ct(f),og)),f.socket.addOpenHandler("SocketOpen",function(){f.emit("socketOpen")}),f.socket.connect(),en(ct(f),PC,SR).call(ct(f)),f}var t,n,r,s,a,o,c,u,d,h,b,v,y,p;return Ft(e,TR),ft(e,[{key:"isShareEnable",get:function(){return!(!this.room||!this.room.localParticipant)&&this.room.localParticipant.isScreenShareEnabled}},{key:"isCameraEnable",get:function(){return!(!this.room||!this.room.localParticipant)&&this.room.localParticipant.isCameraEnabled}},{key:"isMicrophoneEnable",get:function(){return!(!this.room||!this.room.localParticipant)&&this.room.localParticipant.isMicrophoneEnabled}},{key:"sendMessage",value:function(f,m){var _={cmd:"SendText",data:{room:this.roomNum,identity:this.userId,name:m,text:f}};this.socket.send(_)}},{key:"screenShot",value:function(f){var m=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},_=en(this,NC,CR).call(this,f);if(_){var k=document.createElement("canvas");return k.width=m.width,k.height=m.height,k.getContext("2d").drawImage(_,0,0,m.width,m.height),k.toDataURL("image/png",m.quality)}this.emit("errorPush",{type:"screenShot",message:"DOM元素不存在"})}},{key:"uploadScreenShot",value:(p=An(F().mark(function f(m){var _,k,D,w,A,x,P,S,M,U=arguments;return F().wrap(function(B){for(;;)switch(B.prev=B.next){case 0:return _=U.length>1&&U[1]!==void 0?U[1]:{},D=this.screenShot(m,_),(w=D.indexOf(","))>-1&&(k=D.substring(w+1)),A=en(this,kr,jr).call(this),x=A.timestamp,P=A.signature,B.next=7,fetch(this.baseUrl+"/api/FileFind/upload/image/sample",ao({method:"POST",headers:{"Content-Type":"application/json;charset=utf-8"},body:JSON.stringify({base64:k,org:this.org,owner:this.userId})},"headers",{apikey:Nt(this,Mi),timestamp:x,signature:P}));case 7:return S=B.sent,B.prev=8,B.next=11,S.json();case 11:((M=B.sent)==null?void 0:M.code)===200?this.emit("imageUploadSuccess",D):this.emit("imageUploadFail",M),B.next=18;break;case 15:B.prev=15,B.t0=B.catch(8),this.emit("imageUploadFail",B.t0);case 18:case"end":return B.stop()}},f,this,[[8,15]])})),function(f){return p.apply(this,arguments)})},{key:"judgeUserInMeeting",value:function(){var f=this,m=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"";return new Promise(function(_,k){var D=en(f,kr,jr).call(f),w=D.timestamp,A=D.signature;fetch(f.baseUrl+"/api/v1/IsParticipantExist",{method:"POST",headers:{"Content-Type":"application/json;charset=utf-8",apikey:Nt(f,Mi),timestamp:w,signature:A},body:JSON.stringify({room:m,identity:f.userId})}).then(function(x){return x.json()}).then(function(x){(x==null?void 0:x.code)===200?_(x==null?void 0:x.data):k()}).catch(function(x){k(x)})})}},{key:"judgeRoomExist",value:function(){var f=this,m=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"";return new Promise(function(_,k){var D=en(f,kr,jr).call(f),w=D.timestamp,A=D.signature;fetch(f.baseUrl+"/api/v1/isRoomExist",{method:"POST",headers:{"Content-Type":"application/json;charset=utf-8",apikey:Nt(f,Mi),timestamp:w,signature:A},body:JSON.stringify({room:m})}).then(function(x){return x.json()}).then(function(x){_(x)}).catch(function(x){k(x)})})}},{key:"setParticipantDeafness",value:function(f){var m=this;return new Promise(function(_,k){f||(m.emit("errorPush",{type:"setParticipantDeafness",message:"identity不能为空"}),k());var D={cmd:"DoDeafness",data:{room:m.roomNum,identity:f}};m.socket.send(D),m.socket.addMessageHandler("SetParticipantDeafness",function(w){var A,x=JSON.parse(w);x.cmd==="DoDeafness"&&((x==null?void 0:x.data.code)=="200"?_():(m.emit("errorPush",{type:"setParticipantDeafness",message:(A=x.data.msg)!==null&&A!==void 0?A:"与会者置聋失败"}),k()))})})}},{key:"cancelParticipantDeafness",value:function(f){var m=this;return new Promise(function(_,k){f||(m.emit("errorPush",{type:"cancelParticipantDeafness",message:"identity不能为空"}),k());var D={cmd:"UnDoDeafness",data:{room:m.roomNum,identity:f}};m.socket.send(D),m.socket.addMessageHandler("CancelParticipantDeafness",function(w){var A,x=JSON.parse(w);x.cmd==="UnDoDeafness"&&((x==null?void 0:x.data.code)=="200"?_():(m.emit("errorPush",{type:"cancelParticipantDeafness",message:(A=x.data.msg)!==null&&A!==void 0?A:"与会者取消置聋失败"}),k()))})})}},{key:"addCoHost",value:function(f,m){var _=this;return new Promise(function(k,D){f&&m||(_.emit("errorPush",{type:"addCoHost",message:"关键参数缺失"}),D(new Error("关键参数缺失")));var w={cmd:"AddCoHost",data:{room:_.roomNum,identity:_.userId,coHostId:f,coHostName:m}};_.socket.send(w),_.socket.addMessageHandler("AddCoHost",function(A){var x,P,S=JSON.parse(A);S.cmd==="AddCoHost"&&((S==null?void 0:S.data.code)=="200"?k():(_.emit("errorPush",{type:"addCoHost",message:(x=S.data.msg)!==null&&x!==void 0?x:"联席主持人设置失败"}),D(new Error((P=S.data.msg)!==null&&P!==void 0?P:"联席主持人设置失败"))))})})}},{key:"removeCoHost",value:function(f,m){var _=this;return new Promise(function(k,D){f&&m||(_.emit("errorPush",{type:"removeCoHost",message:"关键参数缺失"}),D(new Error("关键参数缺失")));var w={cmd:"RemoveCoHost",data:{room:_.roomNum,identity:_.userId,coHostId:f,coHostName:m}};_.socket.send(w),_.socket.addMessageHandler("RemoveCoHost",function(A){var x,P,S=JSON.parse(A);S.cmd==="RemoveCoHost"&&((S==null?void 0:S.data.code)=="200"?k():(_.emit("errorPush",{type:"removeCoHost",message:(x=S.data.msg)!==null&&x!==void 0?x:"移除联席主持人失败"}),D(new Error((P=S.data.msg)!==null&&P!==void 0?P:"联席主持人设置失败"))))})})}},{key:"modifyPermission",value:function(f,m){var _=this;return new Promise(function(k,D){f&&m||(_.emit("errorPush",{type:"modifyPermission",message:"关键参数缺失"}),D(new Error("关键参数缺失")));var w={cmd:"ModifyPermission",data:{room:_.roomNum,identity:_.userId,permission:f,input:m}};_.socket.send(w),_.socket.addMessageHandler("ModifyPermission",function(A){var x,P,S=JSON.parse(A);S.cmd==="ModifyPermission"&&((S==null?void 0:S.data.code)=="200"?k():(_.emit("errorPush",{type:"modifyPermission",message:(x=S.data.msg)!==null&&x!==void 0?x:"修改与会者权限失败"}),D(new Error((P=S.data.msg)!==null&&P!==void 0?P:"修改与会者权限失败"))))})})}},{key:"createRoom",value:(y=An(F().mark(function f(){var m,_,k,D,w,A,x,P,S,M,U;return F().wrap(function(B){for(;;)switch(B.prev=B.next){case 0:if(this.baseUrl){B.next=3;break}return this.emit("errorPush",{type:"createRoom",message:"请输入baseUrl"}),B.abrupt("return");case 3:if(this.roomName){B.next=6;break}return this.emit("errorPush",{type:"createRoom",message:"房间名不能为空"}),B.abrupt("return");case 6:if(this.org&&this.userId){B.next=9;break}return this.emit("errorPush",{type:"createRoom",message:"创建房间前请先登录"}),B.abrupt("return");case 9:return k="",B.prev=10,D=en(this,kr,jr).call(this),w=D.timestamp,A=D.signature,B.next=14,fetch(this.baseUrl+"/api/v1/creatRoom",{method:"POST",body:JSON.stringify({roomAlias:this.roomName,org:this.org,owner:this.userId}),headers:{apikey:Nt(this,Mi),timestamp:w,signature:A}});case 14:return x=B.sent,B.next=17,x.json();case 17:if((m=B.sent).code!=200){B.next=36;break}return k=m.data,P=en(this,kr,jr).call(this),S=P.timestamp,M=P.signature,B.next=23,fetch(this.baseUrl+"/api/v1/createDispatcher",{method:"POST",body:JSON.stringify({org:this.org,room:k,called:k}),headers:{apikey:Nt(this,Mi),timestamp:S,signature:M}});case 23:return U=B.sent,B.next=26,U.json();case 26:if((_=B.sent).code!=200){B.next=32;break}this.emit("roomCreatedSuccess",k),Or(this,Md,_.data),B.next=34;break;case 32:return this.emit("roomCreatedFail",_.msg),B.abrupt("return","");case 34:B.next=38;break;case 36:return this.emit("roomCreatedFail",m.msg),B.abrupt("return","");case 38:B.next=43;break;case 40:B.prev=40,B.t0=B.catch(10),this.emit("roomCreatedFail",B.t0);case 43:return B.abrupt("return",k);case 44:case"end":return B.stop()}},f,this,[[10,40]])})),function(){return y.apply(this,arguments)})},{key:"joinRoom",value:(v=An(F().mark(function f(){var m,_,k,D,w,A,x,P,S,M,U,B,Q,ie,Y,q,L,$,H,j,W,ae,Ee,Ae,ee,fe,xe,Ne,He,Be,be,Fe,le=this,ze=arguments;return F().wrap(function(oe){for(;;)switch(oe.prev=oe.next){case 0:if(w=(D=ze.length>0&&ze[0]!==void 0?ze[0]:{}).audioDeviceId,A=w===void 0?"":w,x=D.videoDeviceId,P=x===void 0?"":x,S=D.outputDeviceId,M=S===void 0?"":S,U=D.facingMode,B=U===void 0?"user":U,Q=D.autoGainControl,ie=D.echoCancellation,Y=D.noiseSuppression,q=D.roomNum,L=D.cameraStatus,$=L===void 0||L,H=D.microphoneStatus,j=H===void 0||H,W=D.origin,ae=W===void 0?"0":W,Ee=D.videoCodec,q){oe.next=4;break}return this.emit("errorPush",{type:"joinRoom",message:"请输入房间号"}),oe.abrupt("return");case 4:return Ae={audioCaptureDefaults:{deviceId:A||"default",autoGainControl:Q!=null&&Q,echoCancellation:ie!=null&&ie,noiseSuppression:Y!=null&&Y},videoCaptureDefaults:{},stopLocalTrackOnUnpublish:!0,adaptiveStream:!0},M&&(Ae.audioOutput={deviceId:M}),ee={autoSubscribe:!0},P?Ae.videoCaptureDefaults.deviceId=P:Ae.videoCaptureDefaults.facingMode=B,Ee&&typeof Ee=="string"&&(fe={videoCodec:Ee},Ae.publishDefaults=fe),this.roomNum=q,oe.prev=10,oe.next=13,en(this,MC,ER).call(this,this.roomNum,ae);case 13:return xe=oe.sent,Ne=this.baseUrl.split("//")[1],He=Ne.split("/ylapi")[0],Or(this,Nd,"".concat(this.wshead).concat(He)),Or(this,Od,xe.token),this.room=new Ad(Ae),oe.next=21,this.room.prepareConnection(Nt(this,Nd),Nt(this,Od));case 21:return en(this,RC,wR).call(this),oe.next=24,this.room.connect(Nt(this,Nd),Nt(this,Od),ee);case 24:oe.next=30;break;case 26:return oe.prev=26,oe.t0=oe.catch(10),this.emit("joinRoomError",oe.t0),oe.abrupt("return");case 30:if(oe.prev=30,this.roomMode!=="auto"){oe.next=39;break}return oe.next=34,this.room.localParticipant.setCameraEnabled($);case 34:return oe.next=36,this.room.localParticipant.setMicrophoneEnabled(j);case 36:en(this,Rd,cg).call(this,"video"),oe.next=44;break;case 39:return oe.next=41,this.room.localParticipant.setMicrophoneEnabled(j);case 41:return oe.next=43,this.room.localParticipant.setCameraEnabled(!1);case 43:en(this,Rd,cg).call(this,"audio");case 44:oe.next=49;break;case 46:oe.prev=46,oe.t1=oe.catch(30);case 49:return Be=(m=this.room.getActiveDevice("audioinput"))!==null&&m!==void 0?m:"default",be=(_=this.room.getActiveDevice("videoinput"))!==null&&_!==void 0?_:"default",Fe=(k=this.room.getActiveDevice("audiooutput"))!==null&&k!==void 0?k:"default",this.room.remoteParticipants.forEach(function(de){en(le,Ld,ug).call(le,de)}),en(this,Ld,ug).call(this,this.room.localParticipant),oe.abrupt("return",{audioInputDevice:Be,videoInputDevice:be,audioOutputDevice:Fe});case 55:case"end":return oe.stop()}},f,this,[[10,26],[30,46]])})),function(){return v.apply(this,arguments)})},{key:"makeCall",value:function(f,m,_){var k=this;return new Promise(function(D,w){var A=null;k.roomNum||(k.emit("errorPush",{type:"makeCall",message:"请先加入房间"}),w()),k.baseUrl||(k.emit("errorPush",{type:"makeCall",message:"baseUrl为空"}),w()),A=_?{name:f,org:k.org,room:k.roomNum,dnis:m,type:_}:{name:f,org:k.org,room:k.roomNum,dnis:m};var x=en(k,kr,jr).call(k),P=x.timestamp,S=x.signature;fetch(k.baseUrl+"/api/v1/makeCall",{method:"POST",body:JSON.stringify(A),headers:{apikey:Nt(k,Mi),timestamp:P,signature:S}}).then(function(M){return M.json()}).then(function(M){var U;M.code==200?(k.emit("makeCallSuccess"),D()):(k.emit("errorPush",{type:"makeCall",message:(U=M.msg)!==null&&U!==void 0?U:"呼出失败"}),w())}).catch(function(M){k.emit("errorPush",{type:"makeCall",message:M}),w()})})}},{key:"pushVideoStream",value:function(){var f,m=this;if(this.roomNum)return new Promise(function(_,k){var D={cmd:"StartOutputStream",data:{room:m.roomNum,url:"rtmp://10.2.14.199/live/"}};m.socket.send(D),m.socket.addMessageHandler("StartOutputStream",function(w){var A,x,P=JSON.parse(w);P.cmd==="StartOutputStream"&&((P==null?void 0:P.data.code)=="200"?(m.emit("startPushing",P.data),_(P.data.result)):(m.emit("errorPush",{type:"pushVideoStream",message:(A=(x=P.data)===null||x===void 0?void 0:x.msg)!==null&&A!==void 0?A:"推流失败"}),k()))})});this.emit("errorPush",{type:"pushVideoStream",message:(f=result.msg)!==null&&f!==void 0?f:"请先加入房间"})}},{key:"stopPushVideoStream",value:function(){var f=this;if(this.roomNum)return new Promise(function(m,_){var k={cmd:"StopOutputStream",data:{room:f.roomNum}};f.socket.send(k),f.socket.addMessageHandler("StopOutputStream",function(D){var w,A,x=JSON.parse(D);x.cmd==="StopOutputStream"&&((x==null?void 0:x.data.code)=="200"?(f.emit("stopPushing",x.data),m()):(f.emit("errorPush",{type:"stopPushVideoStream",message:(w=(A=x.data)===null||A===void 0?void 0:A.msg)!==null&&w!==void 0?w:"停止推流失败"}),_()))})});this.emit("errorPush",{type:"stopPushVideoStream",message:"请先加入房间"})}},{key:"moveoutParticipant",value:function(f){var m=this;if(this.roomNum)return new Promise(function(_,k){var D={cmd:"RemoveParticipant",data:{room:m.roomNum,identity:f}};m.socket.send(D),m.socket.addMessageHandler("RemoveParticipant",function(w){var A,x=JSON.parse(w);x.cmd==="RemoveParticipant"&&((x==null?void 0:x.data.code)=="200"?_():(m.emit("errorPush",{type:"moveoutParticipant",message:(A=x.data.msg)!==null&&A!==void 0?A:"移出房间失败"}),k()))})});this.emit("errorPush",{type:"moveoutParticipant",message:"请先加入房间"})}},{key:"updateParticipantName",value:function(f,m){var _=this,k=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"0";if(this.roomNum)return new Promise(function(D,w){var A={cmd:"UpdateParticipant",data:{room:_.roomNum,identity:f,name:m,isPermission:k}};_.socket.send(A),_.socket.addMessageHandler("UpdateParticipant",function(x){var P,S=JSON.parse(x);S.cmd==="UpdateParticipant"&&((S==null?void 0:S.data.code)=="200"?D():(_.emit("errorPush",{type:"updateParticipantName",message:(P=S.data.msg)!==null&&P!==void 0?P:"修改与会者名称失败"}),w()))})});this.emit("errorPush",{type:"updateParticipantName",message:"请先加入房间"})}},{key:"setParticipantToHost",value:function(f,m){var _=this;return new Promise(function(k,D){_.roomNum&&f&&m&&_.userId||(_.emit("errorPush",{type:"setParticipantToHost",message:"关键参数缺失"}),D("关键参数缺失"));var w={cmd:"AddHost",data:{room:_.roomNum,identity:_.userId,hostId:f,hostName:m}};_.socket.addMessageHandler("SetParticipantToHost",function(A){var x,P,S=JSON.parse(A);S.cmd==="AddHost"&&((S==null?void 0:S.data.code)=="200"?k():(_.emit("errorPush",{type:"setParticipantToHost",message:(x=S.data.msg)!==null&&x!==void 0?x:"添加为主持人失败"}),D((P=S.data.msg)!==null&&P!==void 0?P:"添加为主持人失败")))}),_.socket.send(w)})}},{key:"startRecord",value:function(){var f=this;if(this.roomNum)return new Promise(function(m,_){var k={cmd:"StartRecording",data:{room:f.roomNum}};f.socket.send(k),f.socket.addMessageHandler("StartRecording",function(D){var w,A=JSON.parse(D);A.cmd==="StartRecording"&&((A==null?void 0:A.data.code)=="200"?(f.emit("startRecording",A.data.result),m(A.data.result)):(f.emit("errorPush",{type:"startRecord",message:(w=A.data.msg)!==null&&w!==void 0?w:"录制失败"}),_()))})});this.emit("errorPush",{type:"startRecord",message:"请先加入房间"})}},{key:"stopRecord",value:function(){var f=this;if(this.roomNum)return new Promise(function(m,_){var k={cmd:"StopRecording",data:{room:f.roomNum}};f.socket.send(k),f.socket.addMessageHandler("StopRecording",function(D){var w,A,x=JSON.parse(D);x.cmd==="StopRecording"&&((x==null?void 0:x.data.code)=="200"?(f.emit("stopRecording",x.data),m()):(f.emit("errorPush",{type:"stopRecord",message:(w=(A=x.data)===null||A===void 0?void 0:A.msg)!==null&&w!==void 0?w:"停止录制失败"}),_()))})});this.emit("errorPush",{type:"stopRecord",message:"请先加入房间"})}},{key:"pullStream",value:function(f,m){var _=this;return new Promise(function(k,D){m||D("streamIdentity不能为空");var w={cmd:"StartInputStream",data:{room:_.roomNum,identity:m,url:f}};_.socket.send(w),_.socket.addMessageHandler("StartInputStream",function(A){var x,P,S=JSON.parse(A);S.cmd==="StartInputStream"&&((S==null?void 0:S.data.code)=="200"?(_.emit("startPulling",S.data.result),k(S.data.result)):(_.emit("errorPush",{type:"pullStream",message:(x=(P=S.data)===null||P===void 0?void 0:P.msg)!==null&&x!==void 0?x:"拉流失败"}),D()))})})}},{key:"stopPullStream",value:function(){var f=this;return new Promise(function(m,_){var k={cmd:"StopInputStream",data:{room:f.roomNum,identity:"liuang3a5gdf"}};f.socket.send(k),f.socket.addMessageHandler("StopInputStream",function(D){var w,A,x=JSON.parse(D);x.cmd==="StopInputStream"&&((x==null?void 0:x.data.code)=="200"?(f.emit("stopPulling",x.data),m()):(f.emit("errorPush",{type:"stopPullStream",message:(w=(A=x.data)===null||A===void 0?void 0:A.msg)!==null&&w!==void 0?w:"停止拉流失败"}),_()))})})}},{key:"inviteThirdParty",value:function(f){var m=this,_=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"1478649882954985474",k=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"";return new Promise(function(D,w){f||(m.emit("errorPush",{type:"inviteThirdParty",message:"被邀请人姓名不能为空"}),w());var A={cmd:"Invite",data:{room:m.roomNum,identity:m.userId,inviteOrg:_,inviteIdentity:f,metadata:k}};m.socket.addMessageHandler("inviteThirdParty",function(x){var P,S=JSON.parse(x);S.cmd==="Invite"&&(((P=S.data)===null||P===void 0?void 0:P.code)==="200"?(m.emit("inviteThirdSuccess"),D()):(m.emit("inviteThirdFail"),w()))}),m.socket.send(A)})}},{key:"acceptInvite",value:function(f,m,_){var k=this;return new Promise(function(D,w){f&&m&&_||(k.emit("errorPush",{type:"acceptInvite",message:"关键参数缺失"}),w());var A={cmd:"Accept",data:{room:f,identity:k.userId,toOrg:_,toIdentity:m}};k.socket.addMessageHandler("inviteAccept",function(x){var P,S=JSON.parse(x);S.cmd==="Accept"&&(((P=S.data)===null||P===void 0?void 0:P.code)==="200"?(k.emit("acceptInviteSuccess"),D()):(k.emit("acceptInviteFail"),w()))}),k.socket.send(A)})}},{key:"refuseInvite",value:function(f,m,_){var k=this;return new Promise(function(D,w){f&&m&&_||(k.emit("errorPush",{type:"refuseInvite",message:"关键参数缺失"}),w());var A={cmd:"Refuse",data:{room:f,identity:k.userId,toOrg:_,toIdentity:m}};k.socket.addMessageHandler("inviteRefuse",function(x){var P,S=JSON.parse(x);S.cmd==="Refuse"&&(((P=S.data)===null||P===void 0?void 0:P.code)==="200"?(k.emit("refuseInviteSuccess"),D()):(k.emit("refuseInviteFail"),w()))}),k.socket.send(A)})}},{key:"enterText",value:function(f){if(this.room&&this.room.localParticipant){var m=this.room.localParticipant,_=this.encoder.encode(f);m.publishData(_,yn.RELIABLE)}else this.emit("errorPush",{type:"enterText",message:"请先加入房间"})}},{key:"leaveRoom",value:(b=An(F().mark(function f(){return F().wrap(function(m){for(;;)switch(m.prev=m.next){case 0:if(!this.room){m.next=4;break}return m.next=3,this.room.disconnect();case 3:this.room=null;case 4:case"end":return m.stop()}},f,this)})),function(){return b.apply(this,arguments)})},{key:"deleteRoom",value:function(f){var m=this;return new Promise(function(_,k){var D={cmd:"DeleteRoom",data:{room:m.roomNum,identity:f}};m.socket.send(D),m.socket.addMessageHandler("DeleteRoom",function(w){var A=JSON.parse(w);A.cmd==="DeleteRoom"&&((A==null?void 0:A.data.code)=="200"?_():k(A==null?void 0:A.data.msg))})})}},{key:"closeSocket",value:function(){this.socket.close()}},{key:"publishLocalParticipant",value:(h=An(F().mark(function f(){var m,_=this;return F().wrap(function(k){for(;;)switch(k.prev=k.next){case 0:return k.next=2,lR({audio:!0,video:!0});case 2:m=k.sent,this.room.localParticipant&&m.forEach(function(D){_.room.localParticipant.publishTrack(m)});case 5:case"end":return k.stop()}},f,this)})),function(){return h.apply(this,arguments)})},{key:"changeAudioDevice",value:(d=An(F().mark(function f(m){return F().wrap(function(_){for(;;)switch(_.prev=_.next){case 0:if(!this.room){_.next=3;break}return _.next=3,this.room.switchActiveDevice("audioinput",m);case 3:case"end":return _.stop()}},f,this)})),function(f){return d.apply(this,arguments)})},{key:"changeVideoDevice",value:(u=An(F().mark(function f(m){return F().wrap(function(_){for(;;)switch(_.prev=_.next){case 0:if(!this.room){_.next=11;break}return _.prev=1,_.next=4,this.room.switchActiveDevice("videoinput",m);case 4:_.sent,_.next=11;break;case 8:throw _.prev=8,_.t0=_.catch(1),new Error("sdkError",_.t0);case 11:case"end":return _.stop()}},f,this,[[1,8]])})),function(f){return u.apply(this,arguments)})},{key:"changeOutputDevice",value:(c=An(F().mark(function f(m){return F().wrap(function(_){for(;;)switch(_.prev=_.next){case 0:if(!this.room){_.next=3;break}return _.next=3,this.room.switchActiveDevice("audiooutput",m);case 3:case"end":return _.stop()}},f,this)})),function(f){return c.apply(this,arguments)})},{key:"flipCamera",value:function(){var f,m,_,k=(f=this.room)===null||f===void 0?void 0:f.localParticipant.getTrackPublication(Me.Source.Camera);if(k){var D={facingMode:((m=k.videoTrack)===null||m===void 0?void 0:m.constraints).facingMode==="user"?"environment":"user"};return(_=k.videoTrack)===null||_===void 0||_.restartTrack(D),D.facingMode}this.emit("errorPush",{type:"flipCamera",message:"请先加入房间"})}},{key:"changeCameraStatus",value:(o=An(F().mark(function f(){var m;return F().wrap(function(_){for(;;)switch(_.prev=_.next){case 0:if(!this.room||!this.room.localParticipant){_.next=12;break}if(!(m=this.room.localParticipant).isCameraEnabled){_.next=7;break}return _.next=5,m.setCameraEnabled(!1);case 5:_.next=9;break;case 7:return _.next=9,m.setCameraEnabled(!0);case 9:this.emit("localCameraChange",m.isCameraEnabled),_.next=13;break;case 12:this.emit("errorPush",{type:"changeCameraStatus",message:"请先加入房间"});case 13:case"end":return _.stop()}},f,this)})),function(){return o.apply(this,arguments)})},{key:"changeMicrophoneStatus",value:(a=An(F().mark(function f(){var m;return F().wrap(function(_){for(;;)switch(_.prev=_.next){case 0:if(!this.room||!this.room.localParticipant){_.next=12;break}if(!(m=this.room.localParticipant).isMicrophoneEnabled){_.next=7;break}return _.next=5,m.setMicrophoneEnabled(!1);case 5:_.next=9;break;case 7:return _.next=9,m.setMicrophoneEnabled(!0);case 9:this.emit("localMicrophoneChange",m.isMicrophoneEnabled),_.next=13;break;case 12:this.emit("errorPush",{type:"changeMicrophoneStatus",message:"请先加入房间"});case 13:case"end":return _.stop()}},f,this)})),function(){return a.apply(this,arguments)})},{key:"changeScreenShareStatus",value:(s=An(F().mark(function f(){var m,_;return F().wrap(function(k){for(;;)switch(k.prev=k.next){case 0:if(!this.room||!this.room.localParticipant){k.next=9;break}return m=this.room.localParticipant,_=m.isScreenShareEnabled,k.next=5,m.setScreenShareEnabled(!_,{audio:!0});case 5:_||en(this,Rd,cg).call(this,"share"),this.emit("localScreenShareChange",m.isScreenShareEnabled),k.next=10;break;case 9:this.emit("errorPush",{type:"changeScreenShareStatus",message:"请先加入房间"});case 10:case"end":return k.stop()}},f,this)})),function(){return s.apply(this,arguments)})},{key:"changeParticipantMicrophoneStatus",value:(r=An(F().mark(function f(m,_){var k,D,w,A,x,P=this;return F().wrap(function(S){for(;;)switch(S.prev=S.next){case 0:if(m){S.next=3;break}return this.emit("errorPush",{type:"changeParticipantMicrophoneStatus",message:"请输入要查询的identity"}),S.abrupt("return");case 3:if(k=this.room.getParticipantByIdentity(m)){S.next=7;break}return this.emit("errorPush",{type:"changeParticipantMicrophoneStatus",message:"该参与者不存在"}),S.abrupt("return");case 7:if(!k.isLocal){S.next=13;break}return S.next=10,k.setMicrophoneEnabled(!_);case 10:this.emit("localMicrophoneChange",this.room.localParticipant.isMicrophoneEnabled),S.next=19;break;case 13:if(D=k.getTrackPublication(Me.Source.Microphone),w=D?D.trackSid:void 0){S.next=18;break}return this.emit("errorPush",{type:"changeParticipantMicrophoneStatus",message:"trackId不存在"}),S.abrupt("return");case 18:_?(A={cmd:"Mute",data:{org:this.org,room:this.roomNum,input:"1",identity:m,trackId:w}},this.socket.addMessageHandler("Mute",function(M){var U,B,Q=JSON.parse(M);Q.cmd==="Mute"&&((Q==null?void 0:Q.data.code)=="200"||P.emit("errorPush",{type:"changeParticipantMicrophoneStatus",message:(U=(B=Q.data)===null||B===void 0?void 0:B.msg)!==null&&U!==void 0?U:"关闭指定参与者麦克风失败"}))}),this.socket.send(A)):(x={cmd:"UnMute",data:{org:this.org,room:this.roomNum,input:"1",identity:m,trackId:w}},this.socket.addMessageHandler("UnMute",function(M){var U,B,Q,ie=JSON.parse(M);ie.cmd==="UnMute"&&((ie==null?void 0:ie.data.code)=="200"||(U=ie.data)!==null&&U!==void 0&&U.msg&&P.emit("errorPush",{type:"changeParticipantMicrophoneStatus",message:(B=(Q=ie.data)===null||Q===void 0?void 0:Q.msg)!==null&&B!==void 0?B:"请求开启指定参与者麦克风失败"}))}),this.socket.send(x));case 19:case"end":return S.stop()}},f,this)})),function(f,m){return r.apply(this,arguments)})},{key:"changeParticipantCameraStatus",value:(n=An(F().mark(function f(m,_){var k,D,w,A,x,P=this;return F().wrap(function(S){for(;;)switch(S.prev=S.next){case 0:if(m){S.next=3;break}return this.emit("errorPush",{type:"changeParticipantCameraStatus",message:"请输入要查询的identity"}),S.abrupt("return");case 3:if(k=this.room.getParticipantByIdentity(m)){S.next=7;break}return this.emit("errorPush",{type:"changeParticipantCameraStatus",message:"该参与者不存在"}),S.abrupt("return");case 7:if(!k.isLocal){S.next=13;break}return S.next=10,k.setCameraEnabled(!_);case 10:this.emit("localCameraChange",this.room.localParticipant.isCameraEnabled),S.next=19;break;case 13:if(D=k.getTrackPublication(Me.Source.Camera),w=D?D.trackSid:void 0){S.next=18;break}return this.emit("errorPush",{type:"changeParticipantCameraStatus",message:"trackId不存在"}),S.abrupt("return");case 18:_?(A={cmd:"Mute",data:{org:this.org,room:this.roomNum,identity:m,trackId:w,input:"2"}},this.socket.addMessageHandler("Mute",function(M){var U,B,Q=JSON.parse(M);Q.cmd==="Mute"&&((Q==null?void 0:Q.data.code)=="200"||P.emit("errorPush",{type:"changeParticipantCameraStatus",message:(U=(B=Q.data)===null||B===void 0?void 0:B.msg)!==null&&U!==void 0?U:"关闭指定参与者摄像头失败"}))}),this.socket.send(A)):(x={cmd:"UnMute",data:{org:this.org,room:this.roomNum,identity:m,trackId:w,input:"2"}},this.socket.addMessageHandler("UnMute",function(M){var U,B,Q,ie=JSON.parse(M);ie.cmd==="UnMute"&&((ie==null?void 0:ie.data.code)=="200"||(U=ie.data)!==null&&U!==void 0&&U.msg&&P.emit("errorPush",{type:"changeParticipantCameraStatus",message:(B=(Q=ie.data)===null||Q===void 0?void 0:Q.msg)!==null&&B!==void 0?B:"请求打开指定参与者摄像头失败"}))}),this.socket.send(x));case 19:case"end":return S.stop()}},f,this)})),function(f,m){return n.apply(this,arguments)})},{key:"startTrackAttach",value:function(f){var m={};if(m.name=f.name?f.name:f.identity,m.roomMode=this.roomMode,m.identity=f.identity,m.audioLevel=f.audioLevel,m.isSpeaking=f.isSpeaking,m.metadata=f.metadata,m.sid=f.sid,m.isLocal=f.isLocal,m.isMicrophoneEnabled=f.isMicrophoneEnabled,this.roomMode==="auto"){m.isCameraEnabled=f.isCameraEnabled,m.isScreenShareEnabled=f.isScreenShareEnabled;var _=f.getTrackPublication(Me.Source.Camera),k=f.getTrackPublication(Me.Source.Microphone);f.isScreenShareEnabled&&(_=f.getTrackPublication(Me.Source.ScreenShare),k=f.getTrackPublication(Me.Source.ScreenShareAudio)),m.videoTrack=_?_.videoTrack:void 0,m.audioTrack=k?k.audioTrack:void 0,this.emit("trackAttach",m)}else{var D=f.getTrackPublication(Me.Source.Microphone);m.audioTrack=D?D.audioTrack:void 0,this.emit("trackAttach",m)}}},{key:"renderParticipant",value:function(f){var m=arguments.length>1&&arguments[1]!==void 0&&arguments[1];this.roomMode==="auto"?this.renderToVideo(f,m):this.roomMode==="audio"&&this.renderToAudio(f,m)}},{key:"renderToVideo",value:function(f,m){var _={},k=f.name,D=f.identity,w=f.audioLevel,A=f.isSpeaking,x=f.metadata,P=f.sid,S=f.isCameraEnabled,M=f.isLocal,U=f.isMicrophoneEnabled,B=f.isScreenShareEnabled,Q=f.connectionQuality;_.remove=m,_.name=k||D,_.roomMode=this.roomMode,_.identity=D,_.audioLevel=w,_.isSpeaking=A,_.metadata=x,_.sid=P,_.isCameraEnabled=S,_.isLocal=M,_.isMicrophoneEnabled=U,_.isScreenShareEnabled=B,_.connectionQuality=Q;var ie=f.getTrackPublication(Me.Source.Camera),Y=f.getTrackPublication(Me.Source.Microphone);B&&(ie=f.getTrackPublication(Me.Source.ScreenShare),Y=f.getTrackPublication(Me.Source.ScreenShareAudio)),_.videoTrack=ie?ie.videoTrack:void 0,_.audioTrack=Y?Y.audioTrack:void 0,this.emit("videoCallRender",_)}},{key:"renderToAudio",value:function(f,m){var _={},k=f.name,D=f.identity,w=f.audioLevel,A=f.isSpeaking,x=f.metadata,P=f.sid,S=f.isLocal,M=f.isMicrophoneEnabled,U=f.connectionQuality;_.remove=m,_.name=k||D,_.roomMode=this.roomMode,_.identity=D,_.audioLevel=w,_.isSpeaking=A,_.metadata=x,_.sid=P,_.isLocal=S,_.isMicrophoneEnabled=M,_.connectionQuality=U;var B=f.getTrackPublication(Me.Source.Microphone);_.audioTrack=B?B.audioTrack:void 0,this.emit("audioCallRender",_)}},{key:"updateVideoSize",value:function(f,m){m.innerHTML="(".concat(f.videoWidth,"x").concat(f.videoHeight,")")}},{key:"sendInviteNotice",value:function(f,m,_){var k=this;return new Promise(function(D,w){_||w("缺少roomNum参数");var A=en(k,kr,jr).call(k),x=A.timestamp,P=A.signature;fetch(k.baseUrl+"/api/v1/noticeMakeCall",{method:"POST",headers:{"Content-Type":"application/json;charset=utf-8",apikey:Nt(k,Mi),timestamp:x,signature:P},body:JSON.stringify({name:f,dnis:m,room:_})}).then(function(S){return S.json()}).then(function(S){var M;(S==null?void 0:S.code)==200?D():w((M=S==null?void 0:S.msg)!==null&&M!==void 0?M:"语音播报接口出错")}).catch(function(S){w(S)})})}}],[{key:"getDeviceList",value:(t=An(F().mark(function f(){var m,_,k;return F().wrap(function(D){for(;;)switch(D.prev=D.next){case 0:return D.next=2,Ad.getLocalDevices("audioinput");case 2:return m=D.sent,D.next=5,Ad.getLocalDevices("videoinput");case 5:return _=D.sent,D.next=8,Ad.getLocalDevices("audiooutput");case 8:return k=D.sent,D.abrupt("return",{audioDevices:m,videoDevices:_,outputDevices:k});case 10:case"end":return D.stop()}},f)})),function(){return t.apply(this,arguments)})}]),e}();function SR(){var i=this;this.socket.addMessageHandler("ResUnMute",function(e){var t,n=JSON.parse(e);n.cmd==="ResUnMute"&&((n==null?void 0:n.data.code)=="200"?i.emit("requestDeviceOpen",n.data):i.emit("errorPush",{type:"requestDeviceOpen",message:(t=n==null?void 0:n.data.msg)!==null&&t!==void 0?t:"更改用户设备失败"}))}),this.socket.addMessageHandler("ResThirdInvite",function(e){var t,n=JSON.parse(e);n.cmd==="ResInvite"&&((t=n.data)===null||t===void 0?void 0:t.code)=="200"&&i.emit("receiveInviteSuccess",{roomNum:n.data.room,fromIdentity:n.data.fromIdentity,fromOrg:n.data.fromOrg,metadata:n.data.metadata})}),this.socket.addMessageHandler("ResAccept",function(e){var t,n=JSON.parse(e);n.cmd==="ResAccept"&&((t=n.data)===null||t===void 0?void 0:t.code)=="200"&&i.emit("receiveInviteAccept",{roomNum:n.data.room,fromIdentity:n.data.fromIdentity,fromOrg:n.data.fromOrg})}),this.socket.addMessageHandler("ResRefuse",function(e){var t,n=JSON.parse(e);n.cmd==="ResRefuse"&&((t=n.data)===null||t===void 0?void 0:t.code)=="200"&&i.emit("receiveInviteRefuse",{roomNum:n.data.room,fromIdentity:n.data.fromIdentity,fromOrg:n.data.fromOrg})}),this.socket.addMessageHandler("SendText",function(e){var t,n=JSON.parse(e);n.cmd==="SendText"&&(((t=n.data)===null||t===void 0?void 0:t.code)=="200"?i.emit("sendTextSuccess",n.data.msg):i.emit("sendTextFailed",n.data.msg))}),this.socket.addMessageHandler("ResReceiveMsg",function(e){var t,n=JSON.parse(e);n.cmd==="ResReceiveMsg"&&((t=n.data)===null||t===void 0?void 0:t.code)=="200"&&i.emit("messageReceived",{origin:n==null?void 0:n.data.fromIdentity,content:n==null?void 0:n.data.text,fromName:n==null?void 0:n.data.fromName,fromOrg:n==null?void 0:n.data.fromOrg,room:n==null?void 0:n.data.room})}),this.socket.addMessageHandler("ResAddHost",function(e){var t,n=JSON.parse(e);n.cmd==="ResAddHost"&&((t=n.data)===null||t===void 0?void 0:t.code)=="200"&&i.emit("setHostSuccess",{hostId:n==null?void 0:n.data.hostId,hostName:n==null?void 0:n.data.hostName})}),this.socket.addMessageHandler("ResAddCoHost",function(e){var t,n=JSON.parse(e);n.cmd==="ResAddCoHost"&&((t=n.data)===null||t===void 0?void 0:t.code)=="200"&&i.emit("addCoHostSuccess",{coHostId:n==null?void 0:n.data.coHostId,coHostName:n==null?void 0:n.data.coHostName})}),this.socket.addMessageHandler("ResRemoveCoHost",function(e){var t,n=JSON.parse(e);n.cmd==="ResRemoveCoHost"&&((t=n.data)===null||t===void 0?void 0:t.code)=="200"&&i.emit("removeCoHostSuccess",{coHostId:n==null?void 0:n.data.coHostId,coHostName:n==null?void 0:n.data.coHostName})}),this.socket.addMessageHandler("ResModifyPermission",function(e){var t,n,r,s=JSON.parse(e);s.cmd==="ResModifyPermission"&&((t=s.data)===null||t===void 0?void 0:t.code)=="200"&&i.emit("roomPermissionChange",{permission:(n=s.data)===null||n===void 0?void 0:n.permission,input:(r=s.data)===null||r===void 0?void 0:r.input})})}function cg(i){if(this.roomNum){var e={cmd:"SdkCall",data:{room:this.roomNum,sdkType:i}};this.socket.send(e)}else this.emit("errorPush",{type:"getSdkCallNum",message:"请先加入房间"})}function CR(i){return document.getElementById(i)}function jr(){var i=Math.floor(Date.now()/1e3),e="".concat(Nt(this,Mi)).concat(i),t=Pd.HmacSHA256(e,Nt(this,og));return{timestamp:i,signature:Pd.enc.Base64.stringify(t).replace(/\+/g,"-").replace(/\//g,"_")}}function xR(){return UC.apply(this,arguments)}function UC(){return(UC=An(F().mark(function i(){var e,t,n,r;return F().wrap(function(s){for(;;)switch(s.prev=s.next){case 0:if(Nt(this,Md)){s.next=2;break}return s.abrupt("return");case 2:if(this.baseUrl){s.next=4;break}return s.abrupt("return");case 4:return s.prev=4,e=en(this,kr,jr).call(this),t=e.timestamp,n=e.signature,s.next=8,fetch(this.baseUrl+"/api/v1/deleteDispatcher",{method:"POST",body:JSON.stringify({ruleId:Nt(this,Md)}),headers:{"Content-Type":"application/json;chartset=UTF-8",apikey:Nt(this,Mi),timestamp:t,signature:n}});case 8:return r=s.sent,s.next=11,r.json();case 11:s.sent.code!==200&&this.emit("errorPush",{type:"dispatchInCall",message:"解除呼入绑定失败"}),s.next=18;break;case 15:s.prev=15,s.t0=s.catch(4),this.emit("errorPush",{type:"dispatchInCall",message:"解除呼入绑定失败"});case 18:case"end":return s.stop()}},i,this,[[4,15]])}))).apply(this,arguments)}function ER(i){var e=this,t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"0";if(i)return new Promise(function(n,r){var s={cmd:"GetToken",data:{org:e.org,room:i,identity:e.userId,origin:t}};e.socket.send(s),e.socket.addMessageHandler("GetToken",function(a){var o,c,u=JSON.parse(a);u.cmd==="GetToken"&&((u==null?void 0:u.data.code)=="200"?n({roomUrl:u.data.url,token:u.data.token}):(e.emit("errorPush",{type:"getToken",message:(o=(c=u.data)===null||c===void 0?void 0:c.msg)!==null&&o!==void 0?o:"获取会议token失败"}),r()))})});this.emit("errorPush",{type:"getToken",message:"未获取到房间号"})}function wR(){var i=this;this.room.on(je.Connected,function(){i.emit("roomConnected")}),this.room.on(je.Disconnected,function(){var e=An(F().mark(function t(n){return F().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,en(i,BC,AR).call(i);case 2:i.emit("roomDisconnected",n);case 3:case"end":return r.stop()}},t)}));return function(t){return e.apply(this,arguments)}}()),this.room.on(je.ParticipantConnected,function(e){i.emit("participantConnected",e),en(i,Ld,ug).call(i,e)}),this.room.on(je.ParticipantDisconnected,function(e){en(i,LC,DR).call(i,e)}),this.room.on(je.ActiveDeviceChanged,function(e,t){i.emit("mediaDeviceChange",{kind:e,deviceId:t})}),this.room.on(je.ActiveSpeakersChanged,function(e){var t;t=e.map(function(n){var r;return{identity:n.identity,isLocal:n.isLocal,audioLevel:n.audioLevel,name:(r=n.name)!==null&&r!==void 0?r:n.identity}}),i.emit("activeSpeakerChange",t)}),this.room.on(je.LocalTrackPublished,function(e){i.renderParticipant(i.room.localParticipant),i.startTrackAttach(i.room.localParticipant)}),this.room.on(je.LocalTrackUnpublished,function(){i.renderParticipant(i.room.localParticipant),i.startTrackAttach(i.room.localParticipant)}),this.room.on(je.TrackPublished,function(e,t){i.startTrackAttach(t)}),this.room.on(je.TrackUnpublished,function(e,t){i.startTrackAttach(t)}),this.room.on(je.TrackSubscribed,function(e,t,n){i.renderParticipant(n),i.startTrackAttach(n)}),this.room.on(je.TrackUnsubscribed,function(e,t,n){i.renderParticipant(n),i.startTrackAttach(n)}),this.room.on(je.RoomMetadataChanged,function(e){i.emit("roomMetadataChanged",e)})}function ug(i){var e=this;i.on(Xe.ParticipantMetadataChanged,function(){e.renderParticipant(i)}),i.on(Xe.TrackMuted,function(t){e.renderParticipant(i),e.startTrackAttach(i)}),i.on(Xe.TrackUnmuted,function(t){e.renderParticipant(i),e.startTrackAttach(i)}),i.on(Xe.IsSpeakingChanged,function(){e.renderParticipant(i)}),i.on(Xe.ConnectionQualityChanged,function(){e.renderParticipant(i)}),i.on(Xe.ParticipantNameChanged,function(t){e.renderParticipant(i)})}function DR(i){this.renderParticipant(i,!0)}function AR(i){return FC.apply(this,arguments)}function FC(){return(FC=An(F().mark(function i(e){var t=this;return F().wrap(function(n){for(;;)switch(n.prev=n.next){case 0:if(this.room){n.next=2;break}return n.abrupt("return");case 2:return this.renderParticipant(this.room.localParticipant,!0),this.room.remoteParticipants.forEach(function(r){t.renderParticipant(r,!0)}),n.next=7,en(this,OC,xR).call(this);case 7:case"end":return n.stop()}},i,this)}))).apply(this,arguments)}const dg=i=>(l.pushScopeId("data-v-c12bddcb"),i=i(),l.popScopeId(),i),IR={class:"check-dialog-inner"},PR={class:"control-list",style:{border:"none"}},NR=dg(()=>l.createElementVNode("div",{class:"control-list-title"},"麦克风",-1)),OR=["onClick"],MR={class:"control-list-item-value"},RR={class:"control-list"},LR=dg(()=>l.createElementVNode("div",{class:"control-list-title"},"扬声器",-1)),BR=["onClick"],UR={class:"control-list-item-value"},FR={key:1,class:"control-list"},VR=dg(()=>l.createElementVNode("div",{class:"control-list-title"},"摄像头",-1)),jR=["onClick"],$R={class:"control-list-item-value"},HR={key:2,class:"control-list"},qR=["onClick"],zR={class:"control-list-item-value"},Gl=Bt({__name:"SelectDialog",props:{position:{type:Object,default:()=>({left:"0px",bottom:"40px"})},dialogType:{type:String,default:"audio"},otherOptionList:{type:Array,default:()=>[{label:"会议模式",value:"normal"},{label:"点调模式",value:"pointTurn"}]},audioDevices:{type:Array,default:()=>[]},outputDevices:{type:Array,default:()=>[]},videoDevices:{type:Array,default:()=>[]},activeDevice:{type:Object,default:()=>({})},currentRoomMode:{type:String,default:"normal"}},emits:["chooseAudioInputDevice","chooseAudioOutputDevice","chooseVideoDevice","chooseOtherItem","close"],setup(i,{emit:e}){const t=e;function n(o){t("chooseAudioInputDevice",o.value),t("close")}function r(o){t("chooseAudioOutputDevice",o.value),t("close")}function s(o){t("chooseVideoDevice",o.value),t("close")}function a(o){t("chooseOtherItem",o.value),t("close")}return(o,c)=>(l.openBlock(),l.createElementBlock("div",{class:"check-dialog",style:l.normalizeStyle(i.position)},[l.createElementVNode("div",IR,[i.dialogType==="audio"?(l.openBlock(),l.createElementBlock(l.Fragment,{key:0},[l.createElementVNode("div",PR,[NR,(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(i.audioDevices,u=>{var d,h,b,v;return l.openBlock(),l.createElementBlock("div",{class:l.normalizeClass(["control-list-item",{"control-list-item-checked":((d=i.activeDevice)==null?void 0:d.audioInputDevice)&&u.value==((h=i.activeDevice)==null?void 0:h.audioInputDevice)}]),key:u.value,onClick:y=>n(u)},[l.createElementVNode("div",MR,l.toDisplayString(u.label),1),l.createElementVNode("div",{class:l.normalizeClass(["check",{"is-checked":((b=i.activeDevice)==null?void 0:b.audioInputDevice)&&u.value==((v=i.activeDevice)==null?void 0:v.audioInputDevice)}])},null,2)],10,OR)}),128))]),l.createElementVNode("div",RR,[LR,(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(i.outputDevices,u=>{var d,h,b,v;return l.openBlock(),l.createElementBlock("div",{class:l.normalizeClass(["control-list-item",{"control-list-item-checked":((d=i.activeDevice)==null?void 0:d.audioOutputDevice)&&u.value==((h=i.activeDevice)==null?void 0:h.audioOutputDevice)}]),key:u.value,onClick:y=>r(u)},[l.createElementVNode("div",UR,l.toDisplayString(u.label),1),l.createElementVNode("div",{class:l.normalizeClass(["check",{"is-checked":((b=i.activeDevice)==null?void 0:b.audioOutputDevice)&&u.value==((v=i.activeDevice)==null?void 0:v.audioOutputDevice)}])},null,2)],10,BR)}),128))])],64)):i.dialogType==="video"?(l.openBlock(),l.createElementBlock("div",FR,[VR,(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(i.videoDevices,u=>{var d,h,b,v;return l.openBlock(),l.createElementBlock("div",{class:l.normalizeClass(["control-list-item",{"control-list-item-checked":((d=i.activeDevice)==null?void 0:d.videoDevice)&&u.value==((h=i.activeDevice)==null?void 0:h.videoDevice)}]),key:u.value,onClick:y=>s(u)},[l.createElementVNode("div",$R,l.toDisplayString(u.label),1),l.createElementVNode("div",{class:l.normalizeClass(["check",{"is-checked":((b=i.activeDevice)==null?void 0:b.videoDevice)&&u.value==((v=i.activeDevice)==null?void 0:v.videoDevice)}])},null,2)],10,jR)}),128))])):i.dialogType==="other"?(l.openBlock(),l.createElementBlock("div",HR,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(i.otherOptionList,u=>(l.openBlock(),l.createElementBlock("div",{class:l.normalizeClass(["control-list-item",{"control-list-item-checked":i.currentRoomMode===u.value}]),key:u.value,onClick:d=>a(u)},[l.createElementVNode("div",zR,l.toDisplayString(u.label),1),l.createElementVNode("div",{class:l.normalizeClass(["check",{"is-checked":i.currentRoomMode===u.value}])},null,2)],10,qR))),128))])):l.createCommentVNode("",!0)])],4))}},[["__scopeId","data-v-c12bddcb"]]),ko="/assets/img/index/tx.png",hg=new _n;function GR(){const i=l.ref(null),e=l.ref(null),t=l.ref(null),n=l.ref(!1),r=l.ref(0),s=u=>new Promise((d,h)=>{var b;(b=i.value)!=null&&b.setSinkId?i.value.setSinkId(u).then(d).catch(h):(hg.message("error","当前浏览器不支持指定扬声器设备"),h())});return{startmicroVolumnCheck:async(u,d,h,b,v)=>{let y=u;if(i.value||(i.value=d||new AudioContext),!b){hg.message("error","请先选择音频输出扬声器");return}s(b).then(async()=>{n.value=!0;const p={audio:h&&h!=="default"?{deviceId:h}:"default"};if(!y){const k=await navigator.mediaDevices.getUserMedia(p);y=i.value.createMediaStreamSource(k)}e.value=i.value.createAnalyser(),t.value=i.value.createGain(),t.value.gain.value=v,e.value.fftSize=32,y.connect(e.value),e.value.connect(t.value),t.value.connect(i.value.destination);const f=e.value.frequencyBinCount,m=new Uint8Array(f);function _(){e.value.getByteFrequencyData(m);let k=0;for(let D=0;D<f;D++)k+=m[D];r.value=Math.floor(k/f/255*100),n.value?requestAnimationFrame(_):r.value=0}_()}).catch(p=>{console.error(p),hg.message("error",`设置${b}扬声器失败`)})},stopmicroVolumnCheck:()=>{var u,d;n.value=!1,(u=t.value)==null||u.disconnect(),(d=e.value)==null||d.disconnect()},setMicroOutputVolumn:u=>{n.value&&(t.value.gain.value=u)},isMicroDetectStart:n,microVolumn:r}}const WR="/assets/audio/moon_light.ogg",fg=new _n;function KR(){const i=l.ref(null),e=l.ref(!1),t=l.ref(null),n=l.ref(null),r=l.ref(0),s=u=>new Promise((d,h)=>{var b;(b=i.value)!=null&&b.setSinkId?i.value.setSinkId(u).then(d).catch(h):(fg.message("error","当前浏览器不支持指定扬声器设备"),h())});return{startOutputVolumeCheck:async(u,d,h="audio-detect-player",b,v)=>{let y=u;if(i.value||(i.value=d||new AudioContext),!b){fg.message("error","请先选择要检测的扬声器");return}s(b).then(()=>{if(e.value=!0,!y){let _=document.getElementById(h);_||(_=document.createElement("audio"),_.id=h,_.src=WR,_.autoplay=!0,document.body.appendChild(_),_.onloadeddata=function(){_.play()}),y=i.value.createMediaElementSource(_)}t.value=i.value.createAnalyser(),n.value=i.value.createGain(),n.value.gain.value=v,t.value.fftSize=32,y.connect(t.value),t.value.connect(n.value),n.value.connect(i.value.destination);const p=t.value.frequencyBinCount,f=new Uint8Array(p);function m(){t.value.getByteFrequencyData(f);let _=0;for(let k=0;k<p;k++)_+=f[k];r.value=Math.floor(_/p/255*100),e.value?requestAnimationFrame(m):r.value=0}m()}).catch(p=>{console.error(p),fg.message("error",`设置${b}扬声器失败`)})},stopOutputVolumeCheck:(u="audio-detect-player")=>{var h,b;const d=document.getElementById(u);d&&d.remove(),e.value=!1,(h=n.value)==null||h.disconnect(),(b=t.value)==null||b.disconnect()},setOutputVolumn:u=>{e.value&&(n.value.gain.value=u)},isOutputDetectStart:e,outputVolumn:r}}const si=i=>(l.pushScopeId("data-v-c01a99c7"),i=i(),l.popScopeId(),i),XR={class:"addressbox"},YR={class:"CustomHeader"},JR={class:"tabs"},QR=["onClick"],ZR=si(()=>l.createElementVNode("div",{class:"fgx"},null,-1)),eL={key:0,class:"setter-content"},tL={class:"setter-item",style:{"margin-bottom":"19px"}},nL=si(()=>l.createElementVNode("div",{class:"setter-item-title"},"扬声器",-1)),iL={class:"setter-item-content"},rL={class:"setter-item-tool"},sL={class:"setter-item-show"},aL=si(()=>l.createElementVNode("div",{class:"setter-item-show-title"},[l.createElementVNode("span",null,"输出等级"),l.createElementVNode("img",{class:"icon",src:ko,alt:""})],-1)),oL={class:"setter-item-show-outter"},lL={class:"setter-item-show-split-layer"},cL={class:"setter-item-control"},uL=si(()=>l.createElementVNode("div",{class:"setter-item-show-title"},[l.createElementVNode("span",null,"输出等级"),l.createElementVNode("img",{class:"icon",src:ko,alt:""})],-1)),dL={class:"setter-item"},hL=si(()=>l.createElementVNode("div",{class:"setter-item-title"},"麦克风",-1)),fL={class:"setter-item-content"},pL={class:"setter-item-tool"},mL={class:"setter-item-show"},gL=si(()=>l.createElementVNode("div",{class:"setter-item-show-title"},[l.createElementVNode("span",null,"输出等级"),l.createElementVNode("img",{class:"icon",src:ko,alt:""})],-1)),vL={class:"setter-item-show-outter"},yL={class:"setter-item-show-split-layer"},bL={class:"setter-item-control"},_L=si(()=>l.createElementVNode("div",{class:"setter-item-show-title"},[l.createElementVNode("span",null,"输出等级"),l.createElementVNode("img",{class:"icon",src:ko,alt:""})],-1)),kL={key:1,class:"setter-content"},TL={class:"meeting-ordinary-setter"},SL=[si(()=>l.createElementVNode("div",{class:"meeting-ordinary-setter-item-check"},null,-1)),si(()=>l.createElementVNode("span",{class:"meeting-ordinary-setter-item-name"},"语音激励",-1))],CL=[si(()=>l.createElementVNode("div",{class:"meeting-ordinary-setter-item-check"},null,-1)),si(()=>l.createElementVNode("span",{class:"meeting-ordinary-setter-item-name"},"自动接听",-1))],xL={style:{display:"flex","align-items":"center",height:"32px",width:"100%"}},EL=si(()=>l.createElementVNode("span",{class:"meeting-ordinary-setter-item-name"},"画面轮询",-1)),wL={key:0,style:{display:"flex","align-items":"center","margin-top":"10px"}},DL=si(()=>l.createElementVNode("span",{style:{"white-space":"nowrap","margin-right":"15px"}},"轮询间隔:",-1)),AL={key:1,style:{"margin-left":"5px"}},IL={key:2,class:"setter-content",style:{padding:"6px 12px 24px"}},PL=si(()=>l.createElementVNode("div",{class:"camera-setter"},[l.createElementVNode("video",{id:"camera-setter-video-ele",class:"camera-setter-video",muted:"",autoplay:""})],-1)),NL={class:"camera-setter-foot"},VC="hx_device_setter_settings",pg=Bt({__name:"DeviceSetter",setup(i){const e=new _n,t=()=>{console.log("关闭按钮被点击"),o.value=!1},n=l.ref(!1),r=()=>{n.value=!!(document.fullscreenElement||document.webkitFullscreenElement||document.mozFullScreenElement||document.msFullscreenElement)},s=()=>{["fullscreenchange","webkitfullscreenchange","mozfullscreenchange","MSFullscreenChange"].forEach(de=>{document.addEventListener(de,r)})},a=()=>{["fullscreenchange","webkitfullscreenchange","mozfullscreenchange","MSFullscreenChange"].forEach(de=>{document.removeEventListener(de,r)})},o=l.ref(!1),c=l.ref(0),u=l.ref(""),d=l.ref("0%"),h=l.ref(100),b=l.ref(""),v=l.ref("0%"),y=l.ref(100),p=l.ref([]),f=l.ref(""),m=[{id:0,name:"音频设置"},{id:1,name:"视频设置"},{id:2,name:"通用设置"}],_=l.ref([]),k=l.ref([]),D=l.ref([]),w=l.ref(!1),A=l.ref(!1),x=l.ref(!1),P=l.ref(5),S=l.ref(5),M=[{value:5,label:"5秒"},{value:10,label:"10秒"},{value:15,label:"15秒"},{value:"custom",label:"自定义"}],U=async()=>{var oe,de,Le;try{const{audioDevices:Ve,videoDevices:Ke,outputDevices:Ge}=await lg.getDeviceList(),ke=Ge&&((oe=Ge[0])!=null&&oe.label)?Ge[0].label:"扬声器",$e=Ve&&((de=Ve[0])!=null&&de.label)?Ve[0].label:"麦克风",_e=Ke&&((Le=Ke[0])!=null&&Le.label)?Ke[0].label:"摄像头";k.value=[{label:`默认 - ${ke}`,value:"default"}].concat(Ge.map(Re=>({label:Re.label,value:Re.deviceId}))),_.value=[{label:`默认 - ${$e}`,value:"default"}].concat(Ve.map(Re=>({label:Re.label,value:Re.deviceId}))),D.value=[{label:`默认 - ${_e}`,value:"default"}].concat(Ke.map(Re=>({label:Re.label,value:Re.deviceId})))}catch(Ve){console.error(Ve)}};function B(){try{const oe=localStorage.getItem(VC);if(!oe)return;const de=JSON.parse(oe);if(typeof de.isVoiceMotivationOpen=="boolean"&&(w.value=de.isVoiceMotivationOpen),typeof de.isAutoPolling=="boolean"&&(A.value=de.isAutoPolling),typeof de.isAutoAnswer=="boolean"&&(x.value=de.isAutoAnswer),typeof de.pollingIntervalMs=="number"){const Le=de.pollingIntervalMs/1e3;P.value=Le,S.value=[5,10,15].includes(Le)?Le:"custom"}}catch(oe){console.warn("loadPersistedSettings err",oe)}}function Q(){try{const oe={isVoiceMotivationOpen:w.value,isAutoPolling:A.value,isAutoAnswer:x.value,pollingIntervalMs:(S.value==="custom"?P.value:S.value)*1e3};localStorage.setItem(VC,JSON.stringify(oe))}catch(oe){console.warn("persistSettings err",oe)}}const ie=()=>{w.value=!w.value,ut.emit("voiceMotivationChange",w.value)},Y=()=>{x.value=!x.value,ut.emit("autoAnswerChange",x.value)},q=()=>{A.value=!A.value,ut.emit("autoPollingToggle",A.value)},L=oe=>{oe!=="custom"&&(P.value=oe,ut.emit("pollingIntervalChange",oe*1e3))},$=oe=>{ut.emit("pollingIntervalChange",Number(oe)*1e3)},H=()=>{let oe=parseInt(P.value);(isNaN(oe)||oe<5)&&(oe=5),oe>300&&(oe=300),P.value=oe,ut.emit("pollingIntervalChange",oe*1e3)},{microVolumn:j,isMicroDetectStart:W,startmicroVolumnCheck:ae,stopmicroVolumnCheck:Ee,setMicroOutputVolumn:Ae}=GR(),{outputVolumn:ee,isOutputDetectStart:fe,startOutputVolumeCheck:xe,stopOutputVolumeCheck:Ne,setOutputVolumn:He}=KR(),Be=()=>{fe.value&&Ne(),W.value?Ee():b.value?ae(void 0,void 0,b.value,u.value,y.value/100):e.message("error","请先选择要检测的麦克风")},be=()=>{W.value&&Ee(),fe.value?Ne():xe(void 0,void 0,"audio-detect-player",u.value,h.value/100)};l.watch([w,A,x,S,P],()=>{Q()});const Fe=async()=>{try{let oe=null;if(!f.value||f.value==="default"){oe=await navigator.mediaDevices.getUserMedia({video:!0});const de=document.getElementById("camera-setter-video-ele");p.value=oe.getTracks(),de&&(de.srcObject=oe);return}try{oe=await navigator.mediaDevices.getUserMedia({video:{deviceId:f.value}});const de=document.getElementById("camera-setter-video-ele");p.value=oe.getTracks(),de&&(de.srcObject=oe);return}catch(de){console.warn("指定视频设备启动失败,回退默认摄像头",de),oe=await navigator.mediaDevices.getUserMedia({video:!0});const Le=document.getElementById("camera-setter-video-ele");p.value=oe.getTracks(),Le&&(Le.srcObject=oe);return}}catch(oe){console.error("初始化视频流失败:",oe);try{console.log("尝试使用默认视频设备");const de=await navigator.mediaDevices.getUserMedia({video:!0}),Le=document.getElementById("camera-setter-video-ele");p.value=de.getTracks(),Le&&(Le.srcObject=de)}catch(de){console.error("使用默认设备也失败:",de),console.log("无法启动任何视频设备,但设置界面仍可正常使用")}}},le=()=>{console.log("allTracks",p.value),p.value.length>0&&p.value.forEach(oe=>{oe.stop()})},ze=()=>{let oe=document.querySelector("#camera-setter-video-ele");oe&&(oe.pause(),oe.srcObject=null,oe.src=""),le()};return ut.on("getDeviceSetter",async oe=>{var Ve,Ke,Ge;o.value=!0,c.value=oe.type,await U(),B();const de=window.liveClient||{},Le=(oe==null?void 0:oe.tempActive)||(de==null?void 0:de.activeDevice)||{};if(u.value=(Le==null?void 0:Le.audioOutputDevice)||((Ve=de==null?void 0:de.activeDevice)==null?void 0:Ve.audioOutputDevice)||u.value||"default",b.value=(Le==null?void 0:Le.audioInputDevice)||((Ke=de==null?void 0:de.activeDevice)==null?void 0:Ke.audioInputDevice)||b.value||"default",f.value=(Le==null?void 0:Le.videoDevice)||((Ge=de==null?void 0:de.activeDevice)==null?void 0:Ge.videoInputDevice)||f.value||"default",f.value)try{if((await navigator.mediaDevices.enumerateDevices()).filter(Re=>Re.kind==="videoinput").some(Re=>Re.deviceId===f.value))console.log("找到可用视频设备,初始化视频流"),Fe();else{console.log("存储的视频设备ID无效,尝试回退并初始化默认视频流"),f.value="";try{await Fe()}catch(Re){console.warn("回退默认视频流失败",Re)}}}catch{console.log("无法枚举设备,跳过视频流初始化"),f.value=""}else console.log("没有视频设备或设备ID无效,但设置界面已打开")}),l.watch(()=>b.value,oe=>{oe&&b.value&&Ee()}),l.watch(()=>y.value,oe=>{Ae(oe/100)}),l.watch(()=>j.value,oe=>{v.value=oe>50?"100%":(oe/50).toFixed(2)*100+"%"}),l.watch(()=>h.value,oe=>{He(oe/100)}),l.watch(()=>ee.value,oe=>{d.value=oe>24?"100%":(oe/24).toFixed(2)*100+"%"}),l.watch(()=>u.value,oe=>{fe.value&&Ne()}),l.watch(()=>c.value,async()=>{if(W.value&&Ee(),fe.value&&Ne(),ze(),f.value)try{(await navigator.mediaDevices.enumerateDevices()).filter(Ve=>Ve.kind==="videoinput").some(Ve=>Ve.deviceId===f.value)?(console.log("切换标签页:找到可用视频设备,初始化视频流"),Fe()):(console.log("切换标签页:存储的视频设备ID无效,跳过视频流初始化"),f.value="")}catch{console.log("切换标签页:无法枚举设备,跳过视频流初始化"),f.value=""}else console.log("切换标签页:没有视频设备,跳过视频流初始化")}),l.watch(()=>f.value,oe=>{ut.emit("setterVideoDeviceChange",oe)}),l.watch(()=>o.value,async oe=>{oe||(await l.nextTick(),ze())}),l.onMounted(()=>{r(),s()}),l.onUnmounted(()=>{a()}),(oe,de)=>{const Le=l.resolveComponent("el-icon"),Ve=l.resolveComponent("el-option"),Ke=l.resolveComponent("el-select"),Ge=l.resolveComponent("el-slider"),ke=l.resolveComponent("el-radio"),$e=l.resolveComponent("el-radio-group"),_e=l.resolveComponent("el-input"),Re=l.resolveComponent("el-dialog");return l.openBlock(),l.createElementBlock("div",XR,[l.createVNode(Re,{modelValue:o.value,"onUpdate:modelValue":de[8]||(de[8]=Ie=>o.value=Ie),"show-close":!1,class:"addresslogClass2",width:"588px","append-to-body":!n.value,style:{background:"#252e3d",height:"560px"}},{header:l.withCtx(()=>[l.createElementVNode("div",YR,[l.createElementVNode("div",JR,[(l.openBlock(),l.createElementBlock(l.Fragment,null,l.renderList(m,Ie=>l.createElementVNode("div",{key:Ie.id,class:l.normalizeClass(["tabItem",c.value==Ie.id?"activeBorder":""]),onClick:it=>c.value=Ie.id},l.toDisplayString(Ie.name),11,QR)),64))]),l.createElementVNode("div",{onClick:l.withModifiers(t,["stop"]),style:{cursor:"pointer",padding:"4px"}},[l.createVNode(Le,{size:24,style:{color:"#fff"}},{default:l.withCtx(()=>[l.createVNode(l.unref(Eh))]),_:1})])])]),default:l.withCtx(()=>[ZR,c.value===0?(l.openBlock(),l.createElementBlock("div",eL,[l.createElementVNode("div",tL,[nL,l.createElementVNode("div",iL,[l.createElementVNode("div",rL,[l.createVNode(Ke,{modelValue:u.value,"onUpdate:modelValue":de[0]||(de[0]=Ie=>u.value=Ie)},{default:l.withCtx(()=>[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(k.value,Ie=>(l.openBlock(),l.createBlock(Ve,{key:Ie.value,label:Ie.label,value:Ie.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"]),l.createElementVNode("div",{class:"detect-btn",onClick:be},l.toDisplayString(l.unref(fe)?"停止监测":"扬声器监测"),1)]),l.createElementVNode("div",sL,[aL,l.createElementVNode("div",oL,[l.createElementVNode("div",lL,[(l.openBlock(),l.createElementBlock(l.Fragment,null,l.renderList(9,Ie=>l.createElementVNode("div",{class:"setter-item-show-split",key:Ie})),64))]),l.createElementVNode("div",{class:"setter-item-show-inner",style:l.normalizeStyle({width:d.value})},null,4)])]),l.createElementVNode("div",cL,[uL,l.createVNode(Ge,{modelValue:h.value,"onUpdate:modelValue":de[1]||(de[1]=Ie=>h.value=Ie)},null,8,["modelValue"])])])]),l.createElementVNode("div",dL,[hL,l.createElementVNode("div",fL,[l.createElementVNode("div",pL,[l.createVNode(Ke,{modelValue:b.value,"onUpdate:modelValue":de[2]||(de[2]=Ie=>b.value=Ie)},{default:l.withCtx(()=>[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(_.value,Ie=>(l.openBlock(),l.createBlock(Ve,{key:Ie.value,label:Ie.label,value:Ie.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"]),l.createElementVNode("div",{class:"detect-btn",onClick:Be},l.toDisplayString(l.unref(W)?"停止监测":"开始监测"),1)]),l.createElementVNode("div",mL,[gL,l.createElementVNode("div",vL,[l.createElementVNode("div",yL,[(l.openBlock(),l.createElementBlock(l.Fragment,null,l.renderList(9,Ie=>l.createElementVNode("div",{class:"setter-item-show-split",key:Ie})),64))]),l.createElementVNode("div",{class:"setter-item-show-inner",style:l.normalizeStyle({width:v.value})},null,4)])]),l.createElementVNode("div",bL,[_L,l.createVNode(Ge,{modelValue:y.value,"onUpdate:modelValue":de[3]||(de[3]=Ie=>y.value=Ie)},null,8,["modelValue"])])])])])):c.value===2?(l.openBlock(),l.createElementBlock("div",kL,[l.createElementVNode("div",TL,[l.createElementVNode("div",{class:l.normalizeClass(["meeting-ordinary-setter-item",{"meeting-ordinary-setter-item-checked":w.value}]),onClick:ie},SL,2),l.createElementVNode("div",{class:l.normalizeClass(["meeting-ordinary-setter-item",{"meeting-ordinary-setter-item-checked":x.value}]),onClick:Y},CL,2),l.createElementVNode("div",{class:l.normalizeClass(["meeting-ordinary-setter-item",{"meeting-ordinary-setter-item-checked":A.value}]),style:{"flex-direction":"column","align-items":"start",height:"auto"},onClick:de[6]||(de[6]=l.withModifiers(()=>{},["stop"]))},[l.createElementVNode("div",xL,[l.createElementVNode("div",{class:"meeting-ordinary-setter-item-check",onClick:l.withModifiers(q,["stop"])}),EL]),A.value?(l.openBlock(),l.createElementBlock("div",wL,[DL,l.createVNode($e,{modelValue:S.value,"onUpdate:modelValue":de[4]||(de[4]=Ie=>S.value=Ie),onChange:L},{default:l.withCtx(()=>[(l.openBlock(),l.createElementBlock(l.Fragment,null,l.renderList(M,Ie=>l.createVNode(ke,{key:Ie.value,value:Ie.value},{default:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(Ie.label),1)]),_:2},1032,["value"])),64))]),_:1},8,["modelValue"]),S.value==="custom"?(l.openBlock(),l.createBlock(_e,{key:0,modelValue:P.value,"onUpdate:modelValue":de[5]||(de[5]=Ie=>P.value=Ie),type:"number",min:5,max:300,style:{width:"80px","margin-left":"10px"},onChange:$,onBlur:H},null,8,["modelValue"])):l.createCommentVNode("",!0),S.value==="custom"?(l.openBlock(),l.createElementBlock("span",AL,"秒")):l.createCommentVNode("",!0)])):l.createCommentVNode("",!0)],2)])])):c.value===1?(l.openBlock(),l.createElementBlock("div",IL,[PL,l.createElementVNode("div",NL,[l.createVNode(Ke,{style:{width:"100%"},modelValue:f.value,"onUpdate:modelValue":de[7]||(de[7]=Ie=>f.value=Ie)},{default:l.withCtx(()=>[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(D.value,Ie=>(l.openBlock(),l.createBlock(Ve,{key:Ie.value,label:Ie.label,value:Ie.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])])])):l.createCommentVNode("",!0)]),_:1},8,["modelValue","append-to-body"])])}}},[["__scopeId","data-v-c01a99c7"]]),ra=i=>(l.pushScopeId("data-v-2549abd9"),i=i(),l.popScopeId(),i),OL={class:"dialog"},ML={class:"dialog-head"},RL={class:"dialog-contain"},LL={class:"video-contain"},BL=ra(()=>l.createElementVNode("div",{class:"avatar"},null,-1)),UL={id:"video-ele",class:"video-ele",muted:"",autoplay:""},FL=[ra(()=>l.createElementVNode("img",{class:"mirror-switch-icon",src:tM},null,-1)),ra(()=>l.createElementVNode("span",null,"镜像",-1))],VL={class:"tool-bar"},jL={class:"tool-bar-group"},$L={class:"imgsf"},HL=ra(()=>l.createElementVNode("div",{class:"xian"},null,-1)),qL=[ra(()=>l.createElementVNode("img",{src:M_,alt:""},null,-1))],zL={class:"imgsf"},GL=ra(()=>l.createElementVNode("div",{class:"xian"},null,-1)),WL=[ra(()=>l.createElementVNode("img",{src:M_,alt:""},null,-1))],KL={class:"imgsf"},jC=Bt({__name:"MeetingReadyDialog",props:{dialogType:{type:String,default:"launch"},tempRoomNum:{type:String,default:""},meetingTitle:{type:String,default:"调度会议"}},emits:["close","launchMeeting","joinMeeting"],setup(i,{emit:e}){const t=new _n,n=e,r=i,s=l.ref(""),a=l.ref(""),o=l.ref(!0),c=l.ref(!0),u=l.ref(null),d=l.ref(!1),h=l.ref(!1),b=l.ref([]),v=l.ref(!1),y=l.ref([]),p=l.ref([]),f=l.ref([]),m=l.reactive({audioInputDevice:"",audioOutputDevice:"",videoDevice:""}),_=l.ref(!1);l.watch(()=>o.value,async L=>{let $=null;L?$={audio:m!=null&&m.audioInputDevice?{deviceId:m.audioInputDevice}:!0,video:m!=null&&m.videoDevice?{deviceId:m.videoDevice}:{facingMode:u}}:$={audio:m!=null&&m.audioInputDevice?{deviceId:m.audioInputDevice}:!0,video:!1},await S($)});function k(){if(s.value==""){t.message("error","会议名称不能为空");return}else if(s.value.length>10){t.message("error","会议名称不能超过10个字符");return}console.log("发起会议时传递的设备ID:",{audioInputDevice:m.audioInputDevice,audioOutputDevice:m.audioOutputDevice,videoDevice:m.videoDevice}),n("launchMeeting",{roomName:s.value,cameraStatus:o.value,microphoneStatus:c.value,audioInputDevice:m.audioInputDevice,audioOutputDevice:m.audioOutputDevice,videoDevice:m.videoDevice}),n("close")}function D(){if(a.value==""){t.message("error","会议名称不能为空");return}n("joinMeeting",{roomNum:a.value,cameraStatus:o.value,microphoneStatus:c.value,audioInputDevice:m.audioInputDevice,audioOutputDevice:m.audioOutputDevice,videoDevice:m.videoDevice}),n("close")}async function w(){try{if(!navigator.mediaDevices||!navigator.mediaDevices.enumerateDevices){console.warn("浏览器不支持 enumerateDevices 或 mediaDevices 为 undefined"),t.message("warning","浏览器不支持设备枚举或未授权访问,请检查浏览器或使用兼容的浏览器"),y.value=[],f.value=[],p.value=[];return}const{audioDevices:L,videoDevices:$,outputDevices:H}=await lg.getDeviceList();y.value=L.map(j=>({label:j.label,value:j.deviceId})),f.value=$.map(j=>({label:j.label,value:j.deviceId})),p.value=H.map(j=>({label:j.label,value:j.deviceId}))}catch(L){console.error(L),t.message("error","获取设备列表失败")}}function A(){c.value=!c.value}function x(){o.value=!o.value}function P(){b.value.length>0&&b.value.forEach(L=>{L.stop()})}async function S(L){try{if(!navigator.mediaDevices||!navigator.mediaDevices.getUserMedia)throw new Error("当前环境不支持媒体设备访问 (getUserMedia 不可用)");const $=await navigator.mediaDevices.getUserMedia(L);let H=document.querySelector("#video-ele");H&&(H.srcObject=$,P(),b.value=$.getTracks(),H.onloadedmetadata=function(j){H.play()})}catch($){throw new Error($)}}function M(){let L=document.querySelector("#video-ele");L&&(L.pause(),L.srcObject=null,L.src=""),P()}async function U(){u.value="user";const L={audio:c.value,video:o.value?{facingMode:u.value}:o.value};if(!navigator.mediaDevices||!navigator.mediaDevices.getUserMedia){console.warn("跳过视频流初始化:getUserMedia 不可用");return}await S(L)}async function B(L){if(L&&L!==(m==null?void 0:m.audioInputDevice)){if(m.audioInputDevice=L,console.log("用户选择麦克风设备:",L),!c.value)return;try{const $=await navigator.mediaDevices.getUserMedia({audio:{deviceId:L}}),H=document.querySelector("#video-ele"),j=H==null?void 0:H.srcObject;if(j&&H)j.getAudioTracks().forEach(Ee=>Ee.stop()),$.getAudioTracks().forEach(Ee=>{j.addTrack(Ee)}),b.value=j.getTracks(),H.srcObject=j;else{let W={audio:c.value?{deviceId:L}:!0,video:o.value?m!=null&&m.videoDevice?{deviceId:m.videoDevice}:{facingMode:u.value}:o.value};const ae=await navigator.mediaDevices.getUserMedia(W);let Ee=document.querySelector("#video-ele");Ee&&(Ee.srcObject=ae,b.value=ae.getTracks())}$.getTracks().forEach(W=>W.stop())}catch($){console.error("切换音频设备失败:",$);let H={audio:c.value?{deviceId:L}:!0,video:o.value?m!=null&&m.videoDevice?{deviceId:m.videoDevice}:{facingMode:u.value}:o.value};const j=await navigator.mediaDevices.getUserMedia(H);let W=document.querySelector("#video-ele");W&&(W.srcObject=j,b.value=j.getTracks())}}}function Q(L){L&&L!==m.audioOutputDevice&&(m.audioOutputDevice=L)}async function ie(L){if(L&&L!==m.videoDevice){m.videoDevice=L;let $={audio:m!=null&&m.audioInputDevice?{deviceId:m.audioInputDevice}:!0,video:o.value?{deviceId:L}:o.value};await S($)}}async function Y(){v.value=!v.value,await l.nextTick();let L=document.getElementById("video-ele");L&&(v.value?L.style.transform="rotateY(180deg)":L.style.transform="rotateY(0deg)")}l.onMounted(async()=>{await w(),await U(),r.dialogType==="join"&&(a.value=r.tempRoomNum),s.value=r.meetingTitle}),l.onBeforeUnmount(()=>{M()});async function q(){_.value||(_.value=!0,await l.nextTick()),ut.emit("getDeviceSetter",{type:0,tempActive:m})}return(L,$)=>{const H=l.resolveComponent("el-input");return l.openBlock(),l.createElementBlock("div",{class:"mask",onClick:$[7]||($[7]=l.withModifiers(j=>n("close"),["self"]))},[l.createElementVNode("div",OL,[l.createElementVNode("div",ML,[i.dialogType==="launch"?(l.openBlock(),l.createBlock(H,{key:0,class:"search-input",modelValue:s.value,"onUpdate:modelValue":$[0]||($[0]=j=>s.value=j),placeholder:"请输入会议名称"},null,8,["modelValue"])):(l.openBlock(),l.createBlock(H,{key:1,class:"search-input",modelValue:a.value,"onUpdate:modelValue":$[1]||($[1]=j=>a.value=j),placeholder:"请输入会议ID"},null,8,["modelValue"])),l.createElementVNode("div",{class:"close-icon",onClick:$[2]||($[2]=j=>n("close"))})]),l.createElementVNode("div",RL,[l.createElementVNode("div",LL,[BL,l.withDirectives(l.createElementVNode("video",UL,null,512),[[l.vShow,o.value]]),l.createElementVNode("div",{class:"mirror-switch",onClick:Y},FL)]),l.createElementVNode("div",VL,[l.createElementVNode("div",jL,[l.createElementVNode("div",$L,[l.createElementVNode("div",{class:l.normalizeClass(["img-icon",c.value?"img-icon-mic-on":"img-icon-mic-off"]),onClick:A},null,2),HL,l.createElementVNode("div",{style:{width:"20px",height:"20px",display:"flex","align-items":"center","justify-content":"center"},onClick:$[3]||($[3]=j=>d.value=!d.value)},qL),d.value?(l.openBlock(),l.createBlock(Gl,{key:0,dialogType:"audio",audioDevices:y.value,outputDevices:p.value,activeDevice:m,onClose:$[4]||($[4]=j=>d.value=!1),onChooseAudioInputDevice:B,onChooseAudioOutputDevice:Q},null,8,["audioDevices","outputDevices","activeDevice"])):l.createCommentVNode("",!0)]),l.createElementVNode("div",zL,[l.createElementVNode("div",{class:l.normalizeClass(["img-icon",o.value?"img-icon-cam-on":"img-icon-cam-off"]),onClick:x},null,2),GL,l.createElementVNode("div",{style:{width:"20px",height:"20px",display:"flex","justify-content":"center","align-items":"center"},onClick:$[5]||($[5]=j=>h.value=!h.value)},WL),h.value?(l.openBlock(),l.createBlock(Gl,{key:0,dialogType:"video",videoDevices:f.value,activeDevice:m,onClose:$[6]||($[6]=j=>h.value=!1),onChooseVideoDevice:ie},null,8,["videoDevices","activeDevice"])):l.createCommentVNode("",!0)]),l.createElementVNode("div",KL,[l.createElementVNode("img",{src:R_,alt:"",onClick:q,class:"set"}),_.value?(l.openBlock(),l.createBlock(pg,{key:0,tempActiveDevice:m},null,8,["tempActiveDevice"])):l.createCommentVNode("",!0)])]),i.dialogType==="launch"?(l.openBlock(),l.createElementBlock("div",{key:0,class:"tool-bar-btn",onClick:k}," 发起会议 ")):(l.openBlock(),l.createElementBlock("div",{key:1,class:"tool-bar-btn",onClick:D},"加入会议"))])])])])}}},[["__scopeId","data-v-2549abd9"]]),XL="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABMAAAASCAYAAAC5DOVpAAAAAXNSR0IArs4c6QAAASZJREFUOE/Vky1PA0EQht/ZEhJCA8E0KBSWf0AQFagqCPwExCU9cjkOe1Mk10K4DRBMEdRgcXiw/IJ6FArZ3g65a67ZUkJWFALrdj6eyXy8hBk+miELYxgzz7+9S4+IakUBEYOKuk1P4zu74OERawE2SpsQ3eskvs7/Y5gX8eqc4JVAB4ZkkDuzIZ6uzrlvw5oh70BhqUgWaQhUTbfjrS9haZudW/ejVlMEez8LC4JgYaiWe7rDu65L8cN4U0B13eGTiTZdAd/FOc/Hpdg/gHkeVyuL0tVJa9+lpTymWICiuk4+LaA82r93Z5acjg1kQERZBnm+TPhlQpsRN4xgfWSjbQDVKQWMhI4bIqyUyWTQvTjjBxvmh5yCsGYJ/XFK6K5D/7Wj/QBDX4YTWE81agAAAABJRU5ErkJggg==",$C="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABUAAAAUCAYAAABiS3YzAAAAAXNSR0IArs4c6QAAAqBJREFUOE+lU0FoE0EUfX+TaFrjwZKDBxXMqZBDxVu9tEgVsYqCGujBg6dCS5VikaCklCCKYlEsVkF62ChSNiii5lKkQQXFU/FUsFLSi1KMklJEaZr5dnZ3NrPNBg/OZXZmZ968/977BG2MFTm88AUjYJwAIaL/AwMgd4eRMQilGuN8lZHO99OKflYds/f6HnIfCVxU9+UsB9XBJDYbhFGjilItgkcQWIbA0JMBWlTAftAHbAlGwscwYBEOIUNVLFQNTNuPAqv4g3PTw1Ry1/VbqUm2gH+DgvHKGqSxM5M8bgAxiSCAQn6AXjSAnr5XB9UqdiQAbFntiUFCIB3aiWI+RbXNxfjKPzXBFuvlGwAxmMmzyH9fADA888xnQzTRwPTkXbaIkbCNUtQIYHbWcg4cZLPPPb8QBHqHLZCjaU8S8R0tiCiOzM4XSQB3fFxEZamM3+6+GQh6/Laj6e42RPu7Ofl9tc5L10lFblcb8eWnmFtbtx8yXw4HMO0dZ2ujjEQsitBgD9q3hjnqwWpOqeyWyvQj9x4ldrQ1C0GgR29tipS/i2RslC9SjDp5BhMhVxgJYHrkJlus5dQXDc04O1fSPG+y42bOXAoAPXzDKV/S2b8H8W1RRGQmocxR3+78+RsqyyuOUVLTmXQA6KHrbDFhbzyGlt4OJH+tuYnX9JTuqyRsb4V4/A6f1gUEC5ivrwSAHrzmMI1GEDq2D+1bIogqEIMAoeVUvvO1gnJxHktun5mzQaDdV9naEDwhHfE8Uh2jd4/b7E7PAiQ7T8CczQQw7cryFIAOFaNmXaT2fSkjTL3J0P2GNu3Kcqdg2P3bMCSC0EzbdIAMnH2bofkGULlxIMudIYEUA61NOt3TRmpsEH7WDFgfRmnOq7Dpxf/48RdZkAok9Jke3QAAAABJRU5ErkJggg==",YL="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAI0AAACMCAYAAABBAioAAAAAAXNSR0IArs4c6QAAIABJREFUeF7kfQecVNX59vOee6fubC/AwrK7dEFFBAUBBUSjYk/UxGhiD3bRGP92sEWNvRAssSSaBvbewSiKCCooCNKWtuzC9tmdeu95vz13ZpbZZXfnzoIl+U4yvx28p99n3vP2Q/j/uDAz1QC99Sh6Owi9iOBmIAeEnHbbwmhQ/yagwZCoYhPVfjeqSoiC/z9uH/3/sOgW5mLDNPfTSNsXQG9muCwQkAwBogqMKtLQIA00ko6GaBRwO2JACUWR43AAbCCHdLhgonccVL2llEIIYfXFkE3E/K2haYuzgfVExP+re/s/BxpFPRqj0dFCcxzCLPcRJIIMWaEJ8a0AlnmINn0fL9PPXMTAUJLYD1IOgIAbwA5Tyv9k6/oCIjK+j3F/jD7/J0CzgznTDRwppTwUgASwEkK8nU209sfY1MSYfuZCmOYhkmiyAEwA66JCvJz3PQH3h1rrfy1omNnRCPwc0jyeGTXE/FKOw/HBD7VxPRnHzzzCkPJkMJcJjb4MIvDP3pS5vSd9/Zht/utAUxcO7026OBMQLgjxQi7R/B9zA3s6dm04PELTxekE6m0w3szTtOeJSFGjn3z5rwANM2t1ZuQEQdoxgPyiRjgeG0wU/snvrs0J1rNxHKQ8iUHfhIT+cDFRwGbTH6XaTxo0a5hd+YieC2Asm/xyvu56/kfZpR9o0CbmoYaMXipBWyGify0g79YfaOi0hvlJgoaZ9VoZvZAEhsso/lLodC5Ja1X/5ZUbOTQ4KjEDQtuWD/0+Imr5KS3pJweaGg4fz8ApgPhLITn+K/mVPfWCt4dCg+HAZZoQa/LgmP1TEdt/MqDZzqFBAnQNgPkF5Hp2T238/0I/tRwYb0ptuhD8TAG53/ux1/Sjg4aZnTUIX8ySCyHctxURNX/fm7KZOc9pYChLs0wIrVRpiSXL3kQim5k9BMpOzEFtkAQ3gtFAxA0gUSUYVSabVWFoyx1OVPxQjOs2s+UiEmJkFJGrSyi77vvep676/1FBU83N+4LFDUy4uzd5P/s+NmELc77DxCTDNMZpgkYCYiyDFSjqmVEB5o2CqIIIDcyigWE2akJj9Vep42TcDkWgHGZll+JSQaKXZC4jQhkDHmZsgqDPBPNXJuSHxbq+6PsSn7fzdp9E5gMC/HYReed+H3uWqs8fBTRLeImjL4ZfxtLMqhe+W0cQRVJN1O5zZhZbDWMKmI8iop8B2JuZNxCwiIDPTJOWZbj1r/KIGu322V29Sub+HDb3Ew4ayVKOk8A4MDIAfEyaeIuFeKUf0Xd7YqzkPqo4+GsGT4ggcn0p5dTv6f676+8HB80WbsrXoN0FiGf6kGePMLrK3rTJMKYyyzOJ6Fi1KGZ+VQjtLRGJfNjX6938Q27qunB4HyfRZEk4noDJBKyCoGeiwnxpALlX76m5VHNogAl5q0T4T/0o96s91W+qfn5Q0GzhxnECjoujiFyyJ34dG5lzpRG6hIh+B8AHYC4x/7vU4Xk/1cJ/qOdrmLN0M3K0YPxKQh4DovcI/NdSzT2PiKJ7Yh5bufkOgraumDyP74n+UvXxg4FmGzefyaABxZRxY6pJpXq+hv0jhKnNBHASgd4liKcMzfniT11LXMlcEJahc5n5EgnKBMs7ocvHB+0B+9NW9v8SwMHF8F2+p8D4ozHCyrC4FYGbAP62H/meSQWI7p6vZf/ezGImmI4D8xMs+bEhTt8PRpZ3Z+4d266NNh/JRNcz8b4EPOYQdE8ZZWzbnTG2cXiECWOmBu9FfYh27E5fPxpPs4HZ7UDL7YCc24+yPu3pIr7lYBmxcTeYjmXmx0kTfxxGGZU97e+n1O67aPNhTDwThJEM3JUlfPfsjgi/getzHHA96IS8qoh8Vd/HWr+346meOacFLQ+a4DtLKXNFTya/rKoqQy/03EygGQT8jULadcMy/jfA0nE/VkQbppImbgNjuGS+eIf2xT+m0JQeOW5VcVWGiawnTZi39KfMb3qy9z84pdnIDbk6nE8K0OV9yFPRk0kv5/oTBOPPAFUy4fx9KOf/C/vTCqP+bBZ0HwNLo8Rn7U+5G3uyf4ot2MKBf4N4Zgn5vu5JHz8YT5MAjKIOxeRJe8GrmDNDsn6OIMW30JX7ajmP7ckF/zf0tYLZZ8j6e0E4zWR5ZaPIf3xKD9xF48D5F4hn7Ung7NHjaTNv9hDn/1UQ/aEngPk8umOy0OifBPpCBuW5YzIKd4sx/G8ASHdz/Irrp0g2/07Aaic5fjGiB6aDmCAS/Ccgru1H7j2iZNxjoFnB7MySgXs1oc8uJte36byw+cy6D7VXETBTgK/ZnwrvTaf9nqq7gTkHIeREzfYhLA4NDXCjoZzIilD4IcsK3u4LAU8z6AgJHHMgFX6Y7vhLmB29ZfCZqJAzyvcAc7zHQLPJbJkthXy4jDLTAswSrsuWMJ5SjlYEceIBVLA43U1Jp77SHi8PREe5NO1AQO4FpqEAlQlCKbMVQWAFOO1S4gEpDGxklspetcGUtJiFXBV064vGfM/edou5+gKAHgTo6gNQoHxslAO97VLJ7GUZfFwKzyUlRLtl7NwjoNnMoYs10LZiSs+zbhHX9hOQrwHc3AIcOYWK9riFW4Hki3B4oJPoFGJMYmASIRb31H1JbE1y+JJloOi8GdHnDF5AQry8UtcXnfI9+Psu5poDmPltInpJoGL6GBqTlka5koP9TRPX99PcF9Nu2Pt2GzSbjZZpzDS8v8N7d6rXkPx8MW/fj5k+IKaXD9QKzkqnrZ26ixobBzvc+hkE+g0B/TshHfUArWKmZYK4AtAqWEaqYVIDNK39MWSaOdC0HM0hsqXk3iR5pATKQBgGcHnHvhncxMBzmpMeHQnPknSpQnfrW8y1JQC/zsw1TtJ/Popy0zoyt3JklCnNk/trnmvt7GNndXYLNJUcHmZIOaO/5jk/nQks5vr9mM0PiTH7QK2gx5PvOKbijTwR/9Eg+gMBE2J0ga3ThoFaAr2tPg6Hvmi/PcQULgnW9YdwjJUkJhHLI5h4kJqXGpWs0bEShL/W6tUPTKPBe8QZfj6v8Hm5SP3g3CycU8ZSVm06+7/FCP6WAVmie3rk7NZj0FRWVnplr9ynhHCflY4G8xOuOVBjvGsY8oYJzqIH01lsV3WVq0UgOuBcTdC1zOiXVK+JmP7FJJ+d6Mj7aE+MlaqPRaHGwaZGxzGbZ4Kwd6I+AU0GeI5Ld943jnzVqfpJ9XwFr3C2cK+3AeQz9QA4ZuBeFtpTJeRKW4fTY9BsMgN3a1HxeF+3fVP/p7xjf2KaTxKXjtUL/ppqY1I9n8tztTzz0FM14A4Afa36DGbgXZ3EU4foef9K1cf3+Xx+uG5vockrJeM0ALoieQo8TLgLwn/3FCoP7e74i4yauUzYyyEiU8ZQcY3d/mISVehvLuH+XSGR3247Va9HoNnE4RNIclGJ5rateFsU2TEamvhAgq8brxU8nM4kO6v7amTLSKfQHyVgbAwrkAKYR0wPHObo1WM71+7Oq7P2b3Btli7Nq5nlFQkmnAG/CXlBs9bnX7vDNM/lFc4Ss/f7IM5wCDFlDOXZdi6r4mB5ROKc/prn+nTWnTZoNjEXkwzdUaJ5fmt3ICUlQdJySH5ynCP/SrvtOqunNskjM2cJaMoJPUFb3oLkm452lnwvLqO7M9/ktm/wmiyWnqsBugqAZk2e8J4gPmsa9dvS03HUnvTn3p9AYoOu5f16TBp+OpvN0CUQ2tcl5Fhgd/z0QWOG5gjhuq0fka1FfsKNeZo0P2TQ4nFa7jl2J9ZZvZd443CA/glmlTJEEcrNgsSFx1G/13an3x+67atcOczk6EMMHBZn0v1EOPsEKn2up3NZxlUZQen8Gow3xul5F6fTzyYz+GS4ITBjcH5+k512aYFmoxE6Rmiidwk5/2Knc3VuRs2Gfyt+4yA91zpGelJm8SwxDL89WwBxzzQyCTx7G8yrLt1DEklP5rW7bZ7jDWcw+GGOeR2qH8EcYNvvT6HxPUqW9FloxxCpa59C4rqDnHmP2J3fNuayqBE6r7/Dc52dNrZBo0JknWboiVLdc7qdjlWdz8yG/zOlvDRDjwwZSb17FCX4KC9xZCL3fgIujI9bDRgnn0pDfxBpyO5ae1rvH7y6gKA9B9CkWB/8RQja1LOoPC39S2L8z4y6oxn0b2g0aRzlLLU7r41mcJYmtJf6kTOlU5tt0Gwyw9eygZdKXa6VdiayMFp/iADeM6UcNdGV3yN/mmd5TZaA/hKYp8TGlG9lkHHK8TQsLW7fznwTdb6NNh1EGm6U4HEA5xBolWA8NkRk3f99Zrf6h7nuj6A4r0NUK0AH/4rK0jLJJNawKFp/M4PPEbq+r10djlJbFJn7PLJOc05PZVG3BZrNzH3ZDF/TX3fbOisXsr+IDFM5/9w13pFzVzovLVH3Wa7NIm6aD8b+sURFfO9p2oA/9KQvu22WB5qvMGHeE2aGwUoxxxBEcBDBBbG4zpM5IdWG2h2rs3r/5HVnm1I8RIBXmVZYaGNPp1JbP9KO/X0SrVfK080HOXNtnwwbjdCxALlLdde87tZhCzQbo6H7he662a6ha2G04TkB5B3kyFGZqdIuc3lddtTQ5kNgFBgmES79tVb257Q7SqPBF35/YSSK7S2GRFBKRNkKg7FA4xYErybU56PRORmTvk+K8wxX7E+S5xMoC8wRlnLi6c6Bn6exFKvqf9hfqEfNb4XQpo/TM21n29hohJ+JaM5zu3PSTwmajeHwcNLx8/6a61Y7E/841HQcafw0dOeoCT1wwprLddlR6Z/PjFEEGEzyktO1cttMnZ05dlbn022Bz5qi8sCmiESLKRFR0ZUM6ALwaIRMh0CWU4AjXs+UctptpVx383wmUrE/CXoXQB6AZmlGD/qta1DabpufRprOZMj7hUMfalcLvSkaPYSIh5bozi7DYVKDJhJ6QDhcV9tJf/oRN+SKiPhGEN9xkDP7oXRf4Fze7gsb4f8AHAOM4It/o5U+mm4/6dZXUZnzK8JmXVCiPiTRHGWEDLZA41BUxgHkuARy3AK5Th4/ocz7vSsP/x5aN1jqjs/AyCWgmXUa9RsqSTuH4MJIw3vMtHWiK/sMu/uyyYg8EdYcF3ZFbboFzcZweAQJnNDf4brNzoALw/5bQXz4BGdW2uK1MjZujm5+lEBnE1ksxUW/cZbY1jjbmV9XdebOZc23T9SoaZGoCzCaQnHQSEBXVMYJ5HgJ+RkCOV4+6rBB7rd2Zzy7bf8aqRglIOYjlpBgrQjIA0/LKU0rBPfjlh3F5HCuZqJpEx1ZtiTO9dHgITppg/rrzic7m2u3oNkUDd9Feuh2OxkKFoYaBkKIlRwNT5iYUZi2E/gz0S1XMOMeNclWH5ibznCVzLK7uXui3qvLjIodzVxa18xoDDKCUUBKwKEDmS5CrpdQkAlkuPS8Y/altF7c7szvmeCmg1mj98DkBGF+iaPvz9JlxheGmu4AYdpWZ+YouyaLikj4yQ0O5+86G6tL0Kz1+4scLtd1pU7nZXYW/UnY/28G0wRX1il26ifXeTKwdbymYWHsv/ELZ7j6/SLdPnanvnLUWrJBXrRyCz1U62c0Bqyk07HjSQNUvtlcH1CYRaEJB1BB7x84M9VfI1vPBluKTQGBm85w9E3rB6WUrKGwv4IlzTjYm9mtZJTYx01G6DiG7izV9V201F2CZmM0ehXp+vP9idaleiEfBZsmkhDvsFMbdjB50kru/HfemGtEHJvAllb0O4+rfp9TaMQeyyLR2dwrK9mbnYfJTJgEiclE2JcB9+drgTXbgKYgEE4CTYZbHU/A0fsDLpW9HFgNhrJzLTDdeDl7N90nU+2vev50cMtfiUTM3sc4+AxP8cd22iXq/CfQeIkQ4saoy1c+xUYOIJXCbpMZnV2qO6d3HKdT0Cj+YqAZfby/7rTlUfdxqOUjZrnyYE/mLgN0t7BZzKIsuO05EJ2o9BJS0NizXX16pJdItYGKmrSEMVUyziDgZCS5fCpfCkVV1N8124ENNUAwspPSFPqAvfsBPpdKjR//tB/wPQb+nenG099XijNllAyEVGYI2gtANYdCw87KTU9r/HHIv4Yg7p3gzpiTar/U84po+HpIPF/mah8o0CloKqLRQ4WUhf1dLmU36rZ82NIyStN4UdQl+06hLNv+HNavp7lqKmuw0oEJgevOcPX+Y6rx0n2u0skGQjhbMm5goKSjh6/6N0vAZMCUbInahgm88C3DHwYmlgKD88kSvR0C0DSCFgdO8lysjSQ0EuHZgIFbevlotx2tOq71b+HKvaQUS61ESuA5Z3v6JEwrtrblo4D/UhLi6lyXt8xOTiCVlQORyIxSl0slW2grnYMmFHlIczmusiVmB5ufAOA92OM71dbM45UerF2T5fNkbSXAR8DiM7290pa4uhtPidHNYZxrSlwPRklXdYWIUZioCQSjEoEIEDKApz9m1DYDx+4HDC8meBwEjxNwaoCmyE03RT1ufbF3bvXgRjsvJ519e6Kl8jZBmuUiy2yMPjuj7xd22yveJhhs2QBB5x/szrDlGbAxEnlqvcNxXjJDvMvq1zFna1Hz9jKnnhLF8wOBfjpxhaDo0AnunJS8T/LinmrZoewjN4DQIgSPPNPdK6323W1UdQMPdDrxNzDGW5ubqJz4El+1YnIVYBRlCRuMlgjQFGYEwoxXlgL1LYzJw4HBvQg+F8HnJnh0wKmTdUypdlbpJEghjqsmAZyanUFv2H2xduo91VK9nkHlRFgaWbnpoOlj7Ecl/CfYfA2Bfn2wJ2MfO2OtD4dPJhb+crejTc2wC2gqwuFfa0JUljhSO+X8J9B8FROOmeTxHWJnAok6j9fW9hMuGc9OxU+c4ytSCaZ3uyjqUh/ABQAeVkjp7u4cXYu/awUaGQONojLNYQUexvpaoDnEGFJEyHIrUZusj0cnS6JSFEoNoNqmojoEPNHgxcXltGc0yU81Vx8uQW8BJEA87ZyMojftbt78pqYCzaFtMCQmH5qRkdIK/snmzZ7iXr1uKXM625zndgHNhkjkkTKHQ8XFdJuxQEVU1gSDGwm4/BCvNy1f3L807biXBF0OcE0owOUXFe1+vJNKa5LdgscZOF1RDwWYxOKSvyc2V4HG4mcUEyzVy1cKPSVqx/4qKmIyWxphpw64dYJbV9JTnKcRsf7bqE2coiWITvJfVVEQvmLCcfle2iOp3J7w1ywEYTyYtxv+aPn04mLbqfH/09LyEjNvnOTz2VKnVIQij29wOS5IHFHtQLNhwwY3+pY8UO7UU0pBHwWDE5n5ea/H0y8d98LZtbUlLicSYvmt52bm32D3V9JVvaoqznD48L5kjFUgsFO0+EtPAEcxwobJFm+jqIclTVmKEUDVVSBzKCZYMcNJu6badUvSEidYDDhNLDG2IItW2Zljd3WeaNgxhjX6zKI2LI87N6vwVbt9/icYnMSSn9cCLeUTCwtTuplsiBhnaqSt6+8gS6PcHjTR6GRI6lPu0v+ZagIfNgceIKLMQzI8Z6eqm/z88ca6W0FQHmJ1kZBRurtUhpl9tc1YLBl7WXjpjKx0MkG18GR+NkGdEuJ3rEmsM0vMVgDqIDUl2qQ1pkBYODA630U98jFqt5dNdUpXMwHgb87NzBuZTlDehy2BSmJx1iE+twqD6bas8XOhw2lcVuZyWA7o7UBTETVvphZxX2lO92py62hqCe2QoF9M8dnPoP1oXV22ENgKogwwP3ZeTl5KitbdapjZW9OC+abEgR0pTCe86S5ddQROqs1Lft4GmHQaxTdcaAi7TOydnb17l5g93tAwGsSWyUaQNv6cLPvZxhY0B/6mQDYpw3OmnSVsjBhzSp264hc7UJqIOafcqVkPuisLgsGDSeK5SRmeXqnqtv9l1B/Pkl4CWXxnnwtzep7/Vmksd/gx32RMtHUk2UWR2hR1NMWpi9V38k/L5vHX3b4oyiUIfjejLDt794LxH2tsUClmh7DkZ6bn5tqOEPnAH5ykEb3Ssm1z0bTBqSM/N4TN2x1OcXc/otq27VixfbvPk5V72wC3IyVzNN8fvJUEjZyc4T42HdA8WtewCILGEuOT3+VmT0inbce62/18W6vby7WKiU0WedvecRwku5xWnQAgUafjX9VvAjRWsySJrCPDm5hfZ9i0jsFkcZ8tTgQ64fMdmZi4O7qcR+rrbyISNxIhwkR9p2fZU7AqnU1zS2gbafrPJ3kc/0n1LipCxjRVp8ytv9G2hRVBnsLC7FXu0lNKQguaw99A0gOTs7p21Ok4iUcbGgaCheUPInQ6+bzMzB6Ha1TX80gp8JWpnEBTrfYn+jzBIylNeO8s6rEmfO6KFc764n4qmYGXGcedn5dlmyH+sDn0OkAfTfK5VIRqCr7GX6g7vReXu7SZbaBZHzKvFC7xfBnRhu5av9fc3EuHo8qQzoLDssh24PmcusbTCOJZEGrPz80sSDXJrp6rPCuiCVWGRKaScP6bi6JAShIzCUNKsmlNT9cyp65pIYHGtyoz3zk/P/MIu/0saA5dAYgTJvuctvRs60LGnIFu/YIk0BizB7j1i1INOL85eiRYPjwl02VlR7Bb5tQ2vwXCEQT85/w8Xzxcw27rnfWqGvhag6GOpm6pjB0WprPR246dxNHUxRR70n8np5QFGl3g697ZGNXTSzgeqW2+jAn3gxF1ymD+OTbEaLWsD/zhEYLoS1+GI8dOUqb1oRhGkkHz8AC3njLaYL4/fD1B7D850/Fzu6/80TrOlhyw4niIcdH5BRk9chJvbOS8ZkatUqi1U8R2lneoU+YiPuOuKFRHbWAHPqRtvR377qxdZ3U6GVdRG2UMFYQjinPoHbt7mlxvjt9fxGGxjUh1Q+PPz7fvjjq/KVJvwph2WFbqNhvC5o2GKZ60lqtcIUrD8r4Bbu2SVJP+oDH8Ngnx6ZRMh21HoNk1kQMIxmLLntziLbiwND3Pt/lcX6aZ8rC+4awjHGH9JKV860wdswsj281iOuJMVe2ufUcNs/UD2JW/7VFGBYva6Kjc4Ku/PSro4yk9uBzjzzUBlYRxMBGuvCDfa3lA2inzm6KfkqA/T/bpKbPJV4SNE0loTRZo1oR4oA4cU+6mB1INNN9vbBPg0yZl2r8De/aO0HSAVUTB+osKPQNTjZF4vpCrigxDn8PEP1dvdFBzgaWxtbSwPSz+lgi21wYtjW9Brhu5WTYyqXUy1vrNjQgbMat3v94+uNQXm2UXIkQxt4tNGfWIaiYE0wdRky84zF1oOxvn7B2BFwE6gRgLLyzyTLQ5FcxvijwCptCUbMeMVG3WNYf3IV0/xALN+hCre5HcA9z0SncNFzVzr4A0qyik9ZlSRLZTqD+8I/QqAccw8MHFhe6pqSannn8Y9u9lyPBig6TPgESWdKF/KMcCjXrh7bSSnXSowFG5I4iaFkZ9gFEfBGoCQFgK+LIzrQ6C/hZkijAOKndg30HZ3fdJQCQq8d6yRizfasKXlxufBCHYHIALUeR5gQxdojBTQ36mQFG2E/k57tQKY0VpCAi4wtjgaIAOAQcENNZ+O9mTm5ICqOXP3hH6fetNNHczc9RR6M6YbjNzxPuNkYsFiZ9PydJTxqgp+x6H5S3W3m+I8FnhSGTpMJ9reXcv9P3GyIEE8fah2XqunRefqPPQ9nA9ATkC+OOFRa6UQebvtOwoZlOsjkD6IixhgDGK86EbumUXalPmdUAOS8bHy2qwuoZQE9LhyfB0mGbXNoZsox5nHt5755mTpIhRXzdWNuPfnwfhzMzqvk+rnUI1IRwMQ4sGsV9/Fw7eOwtOxbyo0oniUB1Rilgt0bZbIHOQgJMEHJo+dqo3O2XG0weqwntrAlZWKx085Pwity1p7P2G6KEkxNxDszRbEu26kDnH2vZ1QfMmaYiHB2d2f3PH+03GsQS69dAsbaRd0Ny7mfMczqglmkuioy4r2umX0VUfb9Q2vBFh86gQSyjQKMI/US+yvOqU1NRZUVTg6Xer0CQ6vtSuRtlV1ZtlNuF3R8cSaiWXNRsbMe9LA053h6MsDREq2tKME/d3Y1h5TqcTUnYt5XLxlayDnw0LNG4LOFTlbWosn1KeOmvWQ9UR5VvtYKJDLi1y2ApXmV/L/ViXm0NGQ/Y0G6lG1gXMhxPH0wMD3GRDE8zTWZonHJqtH2UXNPfvCA3VTM2y6rIRLbm0n7fbvDYvVislINYGpYmQlIhIiWzNgXGu3Laox2SGVfVrmoxHXtuKJi0DpiCwskSbDM3cVSzvSkCKrYcRaWzC5H2zkOUmkCCsqQxidY0G3eFoW3LH8ePEo91zRU0MnSxzhDAZQgKhphbMOLYIeVnOXfpSUpTia6o5iGUhP5wiBhq3JuAS2iHHFKWOWXpwW2QjiPoz5KmX9XalVNImJvFBkwxpTPtMsqErWhcyVQYPYF2A7x3opStSAeH9BvN2gAZOzRG2w1Tur4xOFEQftVq2o5f21nfuVheDPbe58fQIy2cCpkTICo9l7JuRgTKXt42f6dj0q9W1eO3rhBtdDChRB8FwEkxdQGpk5VbzBEy4A914TaVBOZLnoPoO+HRE3AJaVEKYgGZIOMPSAm7yKZojgrjoxNJ2FnYLdHFKownGSzU1lh+PAoxHfXTxj1/0zVZ5+7otD1RFvyTQfgBdd2lvzbaW+f1GswqG/PnUfMcnqcZYF+RHrPVUhPjBMjddmqrBew3mbKUKmJpDKV1BE33dt804SoDeYGD7jD5atwbOjbU8/JvmloeqI8ahAUOBhhE2JX5enAeNhQWajoKTlIyZf/kWIqPtVuROl6F+8YEsHUGfjvxtIaSX77vrndlR6oWUEjk1UbiCO4Hb3V5efmwhcpKpTYwFsvQ1ytHr+co6mGC4dSvpALKcWt3EPN/xxVnUbdjK/duM9wl0KDEev7RYU1c02irvN8hviej3h2andktdH+L48RTghwZ4KaWO5r16+RyBvp0sI2GKAAAgAElEQVSaS7Ydp+6v5F8A/BwI62b0EZ1qkZXFel0N7iDg9yv9IWwJRNASlQha8dSMMwflWRGPnYHG3xLF7f/aDLL8L9vzsck7lnykbN4vByVfxXIGJR9XXbXvSqej6tf39SB3666JqzrqcFTdRD/T9vNgwqjY7yeJ37YcvBRoXtjUgIDJcGuEDIdAplNgQq5PAetDzYETu3JduX+rfBWEYwC8MaNYHG0LMa384nv1cjEE3XtYNqU80taFWL0n63i6f6CXUsrp79bx60LDu1Oz6X67E7pvC19ApO5twqoZfa2YnV3K8s38hClxdjQKrA0FsT1sxEETy2Z45l7ZVsRjNFlyiveyvT6Ee+am50G54dDeKP9gV42BokZGjgZHvQn9ID+Mb71Ag4Zwbx3OKqNTkdx0xI6kdEp5PnD+SYN3aaK8A90a8MJ6P+ojpuWPrEDjcwrs486A0wE4HFjGOiaM7E27ZBa7f4v5DEicDsKCGcUUTwSVembv17OK23rmsFxKmaZ3XZBnWaBZG+D7B9kAzXv1/AEBr0zNTQ80gAWaLy7vR6M7LmHxGh4RkfimJQSEI8A2CqIxItEciVEalyCcvW+m5berpKeEe0LiF7p2UxPmvGwrZ2Tb0JuP6IeSt7fE+hKAvzwLWeub0Dg0Cy1HOlH8QA0yr6pGy3s5kF+4sPX3RSi+bwdIMppLfPBt3nmFQ09Ao5sh3Dlj//YgTDqeXl/Xgk3+OGichCyXQLH0wO0geN2Ay4nLxw3c9R3ct4UfAUE5tn11eV8alRousRoWaCTmHpZPKRMupA2ad2p5EQn86/A0QHPPpjilIXxxRSegeX8F3+UP4MqmABAIAZHsoJW1wR9my8lb/drOG5NhURoFmo48zcKlVZg7v7qdu0rbZiVJ1ckCduUx/VGwsBqOhrB1PlRP7Yfe725B4z65CB/jQeEfK5F3Yy2a3syCscSBHdf2RcEdlZAeHTsm9EbvdzdDujSLwRZRhhY2LSmps3ET/y35cSgQxKM3jos9ik9MPVfHkwqReXV1EBsaTAskPgUaN8Htd1v/zvQCOZmonjocxR3dO+/ZxI9QDDQrriihtmzpqcCjQCNNvHx4AaVMD5M2aN6tYyUFPZ8WaDbwBdAsSvP17/tTPJXrzmW89AUvrG3A+Ho/EAgDGb3DaAxKCzQqNDbDQbhwgsfiaRKJhpL5kMXLqvHX15OOp671d22Dbj9hALIXVcG5XfEijJqflaLwrY3wjyyA+fMM5Ny4EUW3NKLhdR8iizTU31SGnFs2Qno01B7SD4VvVMDMcoJ1Aa05ChHuICJ1fEvJhk+lIohE8OgsKySrrVig0WKgefGbMNbVmvA4VCgwIctDCNe4LKqbkwkU5AAeE9nTxlG7FK73bGyjNJ//vj8dmAosiefv1vN7YDx/eJ7KLtp92QmaFn5kUAalvBTjnVp+nQTeTQc091bwOUxQKWRX/b50V57mHwv5tep6HL2jKUZpevdXoIFFbYJhwOsErjjUjRYFGiNmQkguK9bW44Fn03Purz15MDI/roSjOmAdEQ1HlyPn1fUI7F8EnJyJjGvWofjOAGpf8iD0KSFw+2B4r18L06Oj8dD+yHtlHYxslyXuaP4IyDo37RU1XoYLuPeag9qDJq6nUUCZ92UYa7azFdGZ6SZkewg1lQ44BSE/G+idD7gFvKeMp3Yc+F0V/AIRTlQ8zZX97fM079bye8R45rCCNHiadQG+b6BXxSF1X96u4ecE4dvD8+1LT3dV8IkEvMCMTX8op9KOIzwxn8+sacJT2+oAfxAoHxBFQwtb31vCbOWHueFolwUaZSC03DsThYBt2wO47t6d6XDa+faqenHmJ+FyqZ43nToM3gVboFe3WMeD/4RByHphDYIH9oJ+ai70K1ah/L4Itj/vQuBjRvTevaD/YRXYo8N/RDmynl9jURplMBKK0sTPzcQRZVHCOLgT87H4p7j5YGDfDFx3UXv2ztII67Coy5z5EVQ3MbxOQqYnllBp6xbd0t30ygX6FOCT8ybTLu6yd1Xw68SYBsK8K8vIti7tnRpeLATuPSwvtfSk+N+YlbuZ7xvsSw2ad2r4SRD8P8tPrT1OvNe71vFhILzLQONVA2gXHfrD73F+KISKrTXwNQSA8v4G6lsAxeOoCEdlxvnTLx1oVjHW0Z0WbuudMFDXGMKMWxa2Z3Z2MSO3j01q/u3e8D27wiJbLAihqaXwvFeByL6FcP6mELhyJQbPlqia54B/gQn6877gS1UycCB8SH+45m+0nM+VDMwuDaS49K5KJzL91IOKceZJe7Xjzyzbk66OY+Cu16OoawFUihN1NOVkAFsrNbh0Qt8Ci6c59KLDaH7HIe9ax1YAHQF3XTnASi9rq7xdw98Q49qfFXZvsFadrQvs1NM8MMCbGghv7eCbiVB+RAH9xtZsWjMD/GkN7w8BlelABkPwzBpBu+SeeeId/pkZxtv1TUDIJ1GvslG1xCiPAsq9v9EQUWr4aCyQLfmECoYMnHd1Iq3/TrTEWJtkLUgMZaw8sH8xBK7nlNeBdR9TWz3ru2IqgiZyD2U0fUkw6xno5QKq1VVNu3K7Zl8ftK0d483aj7vzzqnYjK783UjsNzxmH0zUVIo9lx5LZ3L9vwxrrSp2PNurEioRPAFhMcFeHx44+2edq0f+tJ5XIhb/ddH/DSTbjm7v1PAWKXHqkUWxYLjuyppmvjshct+peTAzVazxWzV8MRhHH1lItm1Pd6/nUlPCupubGKOvGkydZjl4ez4PIxNzVgR48uYmoL5ZgYYRCBHOOxwYWkJWrLWl4EtCjfp++a2fotGSgnc1Qiarz1gnRIdkw7HOD1LMa6cyVzLX2pmVKelsBBA6pA8cK2qh1XYOqvauXTGY3HPt/shTPFESRVQ6GnU0ZbqAS/8iLaZYUZlslYHLB4zNpErWce2nk/HMrC7ur7xzDe8AoYAIR181MLV2N7GSt3dwSEQx6vBiSpnseq0/bkZY28x/gMC/BqWIM36rln8BE9cdWUQqIbSt8ugSdtRnw6IuLHHeNUOp23sV/vgSn9TQgnkN6ohqAZT+Zp9S4MzDYB1Riq+xLN1JG/7pl9vx9Ivx25jVkeEUkK5Y/KwCClQqV6feeq85Q9/c0rUXFwO5mRL7jciDV7UHUFUTwtJvGgGx02DZceFmkQdmjsM67igkQYYJisjYR/07yaHZoUXx4A2jIRQTEyc1aiR1NKksopU1wH2vxI4mi5/xAZkZuGPmibiuuwjK25dzLnlgXWjKBsZcsxelDO5XdV/fwL21DGxzuVE4JYtS5hda28IqOTawxs/qUtAtg7KoW4PVm9V8kCC8eEQR9baFmHil21fzN63M2QhmzL12KP2yu7az5rOOenzQFMTB6nhqDioyDVxzokoDAgTjwfnJfTQHovi/u9eCdEcMKMqWY3Tu3mfljulITKydNnHa0bk4SElQHUogaODJeRVYtSmZknWQozsGNllR/wBbGZBaTYhWNmvgN8fkYux++e1GaDuanMBznwLLN+4ETZYXzUKgZNaJ3V/vfMsqPlIXeFONkSFQdOng7t1cEhN4azsfDOC1I4usDKIpyxp/HDTfNfJYoWHYIF/3Itd71dzLAKqiJjKOLSbbWQr+uJrvIcYVDCy9dhiNSTWz21/j3LCJj1rCGNESjh1J1xwL63hSOWSSXT4TXMa/Xt+Iz751xBjUTnx3E2OSokQWquKRlNbFSyH87qR8DCnP3kV5mMxTv/L+NixYasbsXInMFCmiFnaOq4StMG65tBQuh2g7SBOGSnU0qZQmD70T492UWJ7hQrMmMO7G41LHfd++mu9lxuVE2H7NULId+fpmNU8nxnlH9k79Xlbu4D4uL86z9nx1JRdo2bhsUEZqUfrNKlbKjalH9SLbCZhvXcXHK4u/su9duxepLNwpyx1zOTvqw+yIgdMUdTmwFBhZAiulmRJWLIqfREzCEYk7ntiGYDQjZjJOJift+Ne4SVk5hZkR7D+Y8YsjCuBIeNV1NbN4H2s2NOH1j8PYVueIscWJsXbJjpUcjkkwjTDOPtaFvQa1/0ErLbA6mnzOWAzUEwsBlwZlZ/qUgN/cMC11okw1jdtW8UfEUL7BT127F9lOyvBmNc8mhufI3qnbrGnigyAwoG071/j5z4MzU7s8vFnFb4Pw9lG96N6Ubz5e4Y/f8hBmqJhjmAbG3LivvfNW1b/jbR5vEn6d4cL44/fGqKYQLJ2N5Suc4G3i46hUIavX+9HcImFIQkgBLMIIhiQM1hAKSetX7HUB/YoERg51IT/X3Z5/7kSjHPfebLfcr1c3YM0miR0NsS1UWT81jZHl06EJCY9LQNcYHhfB7QR65evoVeht60P1qdiaBAOs/Nu/2opVq6rxhabhn5GP8casWfYdOG77lneAUcCEX1+/F6XM+pGYyJvb+AMi/PPI3tRlWvtE3TVNfDZpWLYTNC380OCM1O4Rb1Sxyl4+cFpv+pVd0Jw8l7WRw1EJQhFLPHTDPql9dzr2PWsWi/Mux0dNIYxv7oK3SW7TOUfTvtfkoydZndJRtdJxLh3VQN3tQ2f9WvXj0ZVKzM5wAtluqEs8cgbmke07KBPj3rqMx0GHRflZw7AbhpH1A7VT3tjGVaThpKOKuvfVUX2tbeY/hQO4eSdomvhuPRPXpxK7X6/i44lxy7Q+u9qRupvkLV/zg0S4hBlf37BPem0T/W6r5eEhYEWjojaRnbYoW1kj7OzgD1RHbXrCU09JTIqXaT2eZvXJppt6MoVbvuGnW+MDzgBj+/JvUTzvFLJl13i7istNxnoZQd4xNmLRvvPz/UMyacZO0DTz6SSwfpC3ewnqlSou1yTW5LuQNy6/vcGsuwXf+hVPlALK4ClDQPEf90k/ZaqiNudeho+aoxjvD6lsnDEfm46ZIxI6uASYOlHKxqbagWS0O5k6MLi7qgl3deBKrL9T6pLUgTqWFP/iVnoZp9LHwO9j9M/N7V5C6mp/b17OKsml4jVuvGFfusUu8F7bwhcIgbOnFdMBdtqsbeYHBvnosmSeZriKtR7so/tSdfB6Ja9vjVu/YVox/T1V3cTzWUvYKxxQ+lXlJ3zXzJH21dzJY2yu4b5SwxbF26hjysqPF2eKuz2S4vxvW76ZrqTnZH1eMgOdNAnr/duwpneCSysdmxK+rGPJETuWPDpO6ZNDttLPd9zvG5bzPjpjuZqTpmPUdSMo5XWCiT7eqGQ15nfTiillWNGqOt5Xc2DC4EyKhbCookJz+zbhoSHZlDKp0Rvb+MFW3iT/6L6U0tk5eZGzvuQ/E+ECMNbNHEVpJRBI7mdrI18SMvCgxRQrhZ8yL8QzjncHYpvvudMuUrVN9TwBIAUYFd+UOJYyXViy+gscNGUKlH+FHVas3fxmfckvE+E45YPdx0C/6WMoaveH/MZW3mowfnNcP/ogVZvv/DydCYuG+mgnI6warW7k2UOzKWXmiFc38zRBePToftRlUufOJjFrKe8LgWXqmQR+dvMo6yKsNAvTmjVwenthcXMY+6pjygJO3G2iK/6mMwND4kW2JS/q4LPb3RuMidttcXHtDGKdAih+JKnYJgUYZS7IdMHfFMWQEYWojtk/0wPNXcs4o8W0BIwsAi6eOYpm293M17fwfiAsNJzofXwhpUzW+J2f/7zVh0tVhs92BHiNny+UBhYOzSXrxXZVXt7BmXrYyt4w5fhSit+eknq66i4E/gLqar39ifDJrP13Ne+n7oVJaca+qEJBkQfr/GFkKt2NUvxZKertJDpKRRZSPU9M0k69+LGoeBgFmIR9Sd3sAsLPSs/DB5gbcxNKFzQ3LuH/a70tMZaQiFF60xiyfZnJa1v5QQD9julLtrJ/fNfEjw7JIitHYjvQfNfAA1jgV0NtZGZ6dTM/S4zGY/qnpkztjqjP+ThJeNnSrQmMvW1/Su9uKOaYV8IpEN/NwZBWfkAFMMAfAQLKUSvuPpFOwiM77z41mDuvkUhclAwYK+cAY3rpQ1CXcEmVfmPmTGWAT4/S3LiElctiPxAeuHl06sCA5Bm+uoVXagLXTismpXTttnxXw2PZiX2GZsXshruwet818RNDsuicVB29spmPIuCxY0vSPKKWsFeJeQB6EWPRzQdSexe2VAMzE24CYUXrVuVCrL0dU10a3lTURjHGCjjqqErkAk6o+zvrNpW+xc7z2I88VjrqfRImAsXDWF54zpjrg0Pgz5P+hivWfgOJekiMaPXRmAlGGqC5YQlfgcSlasCwWw+wr5t5cT0f6HBivumydzStbuSbTIknh+fSxk5Boyq4GfenSgv78irOFBnWyz/j2BL7Zng16A2L+FcQ+KfysTGAcXccSPZvg02ABhCjK0FLiyu05dPLDs334vU24MQvxUhkmOhp+tZU+O3qeTx7p3UcKcAo5Z36KD7GZNx5/Gu4ZfnnMEaHIZe2gmZWK2hmpQGaWfPZZ3ixiggq8PwftxyYnkDy6iZ+EgznsaVk6/plZaQcnLlT8bsLpVlRz6MchAOH5FDKC0df3cy3t94HtM+xpaQCtGyXez9hT62GbwgYAMayW8epUFI7JcbPKEozGRALYgnFrc8rp2DYmL5YEIgiU7lQKOY4EcFgZc7q4q6EjhJ2Ow+anWaqRCKIdomP2n518UYJpV3imh+lh1E+zgowyrbUFMRFEx+te7YOeQbyYMIFiW1Wl5LTOJ6uX8zq7gdLYNFbb5iZNY5sx/C8WsleNqAuZTvhuNLUWmDFsgA4aUgO/SnxhjrVRKxu4MeG5lDKsM4XKngvlS+Oguh97NDUvhjJsLj6U56sEyyXRSZccttYejg1bFq9bGe1HakxwDRu0aA5BMIO7cGTff1O3Nf5N1NitAKNYo6VsVMdV+3S16e4bCP1PHbWSACljXeJGyAVYBIUxqvDv7zSPO2Iv2ofQ2VO8cJERYVEWZmcDMgFSpi0SWmuX8gDOWb/yWDCn24bS/+Xznxf2ciKmb081B8j7NxnubqRb9SdeHqgZyeT3RVoro4A8/bJSW1hfWUjv8TAtuNLU+t3khenJCm5GCot7Ilg1AuJQbPGp0rEHAeN4mdGWOBJUBodQWiINGkFHt214FL3VbkeMUNpjC3gRGNKwASvk3z3QbtU9TZ3P2HQTqS9tyQjdYlYXDqyKEycykSieH3W+/jDi0uaa5t90kCtYcAVNVHTy4QTJopjlEaBxo4ENeszXsSw7oBoEUDxrA5hLKmW8MpG/k6auPWEAfS3VHXV89VN/NjQrPYEpFPQrGrgciEwfUgWXZ2q41c38GRJeEk4UZyOj43qd9YXXCyiUClo1U2wH954oDp1uitMs1opTTzZnxgOiAAggs3Qqn3Q0AgdEg74oF8xNlpy0QTHnS4NhyjQJANHieYJn5yEi0VXx1dHkpzgVyxTQPy2OQUWpeFVHyVSK8CAuPrzjfL6s+dF32+MuMOQzQZMaSA7yygGjMpYrsnYZwXYjth982esLgezrruWwNRZY1Mr5ZJ388UNfIJGeDrTi35TimhnmGgXW766iSeCUT40m9pl4+pCUd4aeN3ATwzNxvRUV/jMZdZcm/AlJN48vjw9Uqnmeuti/qUAYoHnEpdfO667kF9FaW5qVanNRIKn6de4Rdui9RPQ6vUsT67W1AwdZtABFzkydXI9dqJ+yIH9xYVuB+2XoDbKPTj5yFKUR+Xxs6hOByeuBN9iHUOxLJxWqjMLMAmwJIEGhOpV2/HYb56JzGto5iAJjoY0d9SKqmOfkddSZ9bl5xmohYn8OJWJ8zTWWF1IUHd8wSNlFItAcLemH3z2ugPtO/cnMPFyBX+p4Hl8Od2eihhYVKaBH8vOxuUdbwfuEjRrG/lIg+EblkMpM4u/VMEqBfozmhMlaVMbZuH+HPOIoJRMIQcw6YoDqIt0YazcfC0dTex4WinKKoaLihHQsKlOQ4amgTQdps/hJuhMYSdLcijqc8sxzpFHDeFfF/noSEVpEtQmwesoiqNMEW0UJ0kdbFGXuM3IusYnTmGUZJSQkJrDWLa8Sr4wfZ75pj/CIRiICumMhJwhA2EZzdS8Ub8JA84aEw1RE64+5ui9IZfmQkLFEFg8jQWbXRTRs+ezr8WHbxgoZUZ1yMDw1Ed5e1i8uoFPMIG/u3WUHFmSig0AllVxkduDC4dmJwh7ez6uU9DNn896n/3w2LDc1B5dito4K7AQjOUnDEjNQHcc8PaPONfpxkoQlO/xDvJg2BUjOltYEiM8HDR85UotAK+IoExEAjVajXDoiGZrEC06TKFCEh0uculhGXE4NHLAgD4knzKvO1xMHlpI44p8dIAQyFWAUR8FGIviqAkmuXNazFPsEgzLOq2AIwQidS389cZ6/uz5r/nDZ5ZKpY1VqSWiirqQ4YySK2SEGjkK4YnCC5Vv0oAHSvEv4YKJMCQOSwZN58q9e5fyQlZXK6r5EUZfNabziI7uqMdLG3gtNMw+oX9qg7Tq59t6vokZ84bn0Tcd++2S0qiKq+r5LKFj3ZBMSnnhwvNreH9Nw4cmsPcvBsSUQOmU+z/noSDLWutkYKXDg7EXjejk3E1S7o3OhVharO6ohYZsaKis15CRq0Fr1r1C6AFTOFzCrUNRHRlRueis75akan039F/uLYoPH6wP75uD/tke6p3pol5ODRnqSmYFHkHEEZNbAhHUN4W5qrIRm7/cirUPfxJZY5gwIWGSpin5zIDuMCjCRkRw1B11RRWV8Ybd0YDHyjVpoMUSs80yH8yKJH7G0tN04aX3wFJLp2JddS1NnHf52O6jOTrb8xfX8sUk8IdIEINP6STurGObTzazJz8Ldw7N7txZrlvQrKnlLEl4dGge2boJ9+X1/Awz+pwwkA5LBzCJug99zseRsEwMilIvLXRjfMdFWuFuSuxeAZo8AqR0NWWAiACiMgAN/kYd3mwtw2jRWnwZFkBckbDOunVMaYw4cKShsXRooJ26Huu7MAiyg6Zc6AzDUGcUt8o5DA0SUjeJWDk7qf9iwIyY5HAYxGyEhSsKLWQiwAY0TxQOv5kTNE1HTo6xQ9WvhTk8H7wSkCevAM+dq3JY7no0zV7CdzNBpXpVGzKnZhQu7irmqav9VnoZM4iNYPzuhEH0op33srqBrxEaXhmc2blDe7egiVObGSTwydDsrviMndN4eRMXk4E1DJx6/IDUIZ6dLWD253yOplkJA9QR8dr5o6nD9UA7FXyWyF0JGuRaK9bqg0QvDaI6HOdtrGMKOpxWXiQLONChcYRif2VUXX0qQEpYjgGHyRAwHQoUBBnduTfCwVY+M0QVoVIgUSlHLahYSUvdrLgVkww2yQkjxC7DyzAo3GIKb4bhb2iUBZnZRo2sljCjEtn91BHF7Y+m9qB55Eu+Eow7rbkxnq1qwlmzpnR/r2hn+/nqBn5BMgqOH0C2Ls3YvJk9LT7cMSy364jblKCxqI3AA0NzySKRqcqrG/gsYtxc58ew347cNVtTqvbq+aNf8eWCcW/c/WBRlgOTdlKcJNDE7U9QR5Sl6ANZx1SwXsumXNHohoaWFh1Oobn9pIW8EK6wRWkE66TBtCJy44BRspEqUcXmWv9HsmeKAo0CigCTuhHVCWnxJE5IClt5a03S2AxF3Ca4VsKTb2SGYfodjSbc2SaaETvMyiFHuyCXKk2wErWV3WlWwnwV42me+IJvl4SrFBslgY8rnZjaWThzqr18ZQ1PIh0vGQbGnDg4tc7NIhJ1fJ3JeGlEftdhMylBozpaXc+W/+nQPEp5le/cuaxlHADl1LP16HL6daqFdfZcKf5Kv8ItIFwb19uvls044JyJyu8jLkEljJZKilIeJQo4FRUCBR4Nvl4xEIUatUzKFhxt1pqJBIwMDc6Q5raAQoLDFi2ygMMmkUVhFJA6Kwowqqj8RRqr8GyL2rS6WCpnDEma2wwGghLMEro04WATDVKiV3bsCGuEokYxoCmF3nDwrFapaRZuUibuNsnp6a/4SUaMhwHjw0ADjrloSmqdSscpv72MM4xMS7i4/ehyUlcMpCybmT0tdbhjWIoED7ZAw8zaqno8s1eePRC8vp5LCfhaABcdOaC9YijlzJMqPP0FX6AJKyGSOtOrBOGY0/ZFLBY8boNq4236tCYO2wYqQ4WoqFT5xnSBWk1AUwl5cyiTIGSgRW9RakTKUHnkCUZIc6M1fDMcioFHfbf+hlXAZdvekAZW4TDKBQYul0pFgJACTZRV9hEOBlhmeFi2cEbs6JJNEs4sRZuk9b8mMIotJZ5E7lLGYaPlyfOAeYrKqKXMBD+5Gj5X2ErJYvGDTPiHW8dZdhjXzvb0jQ1Wrpo8fwt+ZrePlbV8n5B4ZFhh9xZzW6BRk1pRw4dqGvYelkvKeSdleWs9n0ICf5aMMUeVk5UAoCflH8tYMeH/iLsdBAVw6a9G4ok2f4SbQCevAM1Lpjh5IGyA6KVVi+o6TaB/ASHYSrciTRrc1t23AlEfWXroQEB4naBAlAjeeFr8KEh925kxKP4tCobDw95AAAGPV2Y4WrgloqiOTyITMjvUyI2hbC5wwqzxgtEMhg8masGWIq9yKaN49M5jSVGZWTP5n1/jIDahMqD2ib+QOavrcGlPeBi1x+9s4DNZ4GEzgmHTBtszZq5t5EHSxC+H5JGlce6u2AaN6mR1PT8sNczcy+aNcm9X8GPEODCvDAekc3d3xwnPXc77KDdmALEgaImXIiGccfo4+NsMmDvtUVBKP9QOt5yQ14a3aQgKKszsRTt8IHhBaGiwqE9WuIma3FmEiJ8QIYLPB0SbrT3xtaYEaYbP+qu+WTr3sE/xMioNkiI2DCczXFmc425gUZsj6zw1DHUpIAolGrcw6vsxMsGWCwSWYnLxaC5cMY/njTg5pswDMG85rra0TzGHe5gmzjp1FKmQlB6VDzbyCJPxmQROPqIsNTuRGGRVHT+TlYvpxZQ63Do90NRw32orHHMAAA0pSURBVNZz/6ahuXSunRWpc1Vk42MCVh1WZk9s76rflz/mzGgWXhSExC0uW0nishNH4oVZs26imTNn8k2tfM4sFVOhTvJKWKlEl7og4AehTPW8TaBZEHxKTVcIqABjBSJFhQDkhEENKu1SdaNiqHeWRiDHlW295AYXOBf1qOdcqTLM1NTUAHsVyOI14Mph4LImcEUtOC5Sw5KSvlvAuHAy4xSlj7mplbjM5Be+xL7Q8VcQYvdMMCojjCN+NXJXZZqdvVZ13q7iDC2Mb8F4/LAy+6Esqxr4HJbYvlce2br/Mi3QqImtaeBzWaJqSB69ZmcxKmkABbGqlfQ+OrU0tQG0uz4Vk+0cjkuVZGWlKouxpq9zFFcdPwrfkmKOEyWZ8sQZ5eEAInmgtXWgfo2gLSVAcRPIbI61q0609YEKAjVU4y3gQqWi3q4e7EAvbyFX+5JyBDSC+2ELtmT3Y+SBsQZQYPFUgpcWgycvWIAFhZMtCUmREuVoNXcpslxO3MqE6co4Hk9E8KhL4vdH9FDaVLObu4KdBT6oTFhrskpwhl3KvkZdqEG4bEge/cHO+1R10gaNYorXNuBJj4Yr+tk8puav4zHkwPutjgGXHGrTJN/dAl5ZxuWajkfBODxeTynHnm7Vu86cNhJb25hk9VCBR5WYK4UydGJBH9Dw90ArRwCoTdqD/KTvjVsICgzqWmFUoMIiVRVAbRlbxx7WAvmD2KIkVlkKi1/BApw8fDLPa40oavPIU1H5FXAV+nEZCSj/F+vqI1Z0CDj7mL3pbbsvrKt6Czbz3NZcwMMhMXFKuf2gu+/q+BHdiZkDfPaDF9MGjZr019Xcy+3CbYNz7B1Tqs2HFXwoCbzFjNMnldLc3d0kRXWyRuCXRJgDRuy+HqVQE/i7jOCuI/ezzICx/L7KyBmnQievmEfzTj5ZpcOmkwvBFgMNYHTlUlo6ejSsI23bSkKf4Yzkv5XDY+CI+b/EyoIFgKIkMVBynCGP/TvuH/POchRKgXM0wlWtl5Mmcg4qQ/vdrYrHW6YNJpVCa7fKR5v4Ecn4mXTgwCnF9p3h1tXzZSZj7ZA8ej2dCfQINGqAtXV8lNAwcEC2HY+72JQ+2sSnMuMpEjj14BJ7Ku1Ui3ljDbucEVwBwtUEZMXfqCTG5ww8pHnx/JRyCsXhs9MLXPE/rZ2rjwUkxZwmqFJ3g8bF5ETbtqpxxjZBq95biakk8UsWONO6tytemPFYKIjrjh1j/+V2N52PNrOiuCdrhH3Gl9DWVPuVeL6uiYdIiTMG56SOruzYZ49BYwGnnm9g4LXBufSl3cl+tJF/16o/eJAETp/QL7Xbhd1+FXg8Bi4nWL6z/draMQxBeAmEl7Uw3pkwkiwOJVaS8oy3cw6O+SEnJJy2Qyth+U5k99upyeGn5rN7UC9MNIFfgnA8GIVJ7cKt6R7ntMbJ/emQ4RTP82Z3ZV3XW7iZHwPjpIiJ8VPKyXYy5cpK9ga9eCKUjTNG0K6JM1PNbLdAs4LZ6W7Ak4aGGUNt5GtLTObjCsu+NEcypk/oT0+lmmQ6z5lZ/GclTiINZwhgWgdPcGUGWEmMD6XEZ5qBxeFaVEyZoihReuXjZTwULgwFYxwIh6gbE1uTmXqTY6hUTB8THndq+Me4wfaTJdiZySebWemqJksD0yYOsB++ovpe38D/Eg5cXpbRMwDvFmjUBLb5uTBo4J66HJxjl2NX7T7dysdCWh57Nx1UstPT3c6G2a2zZDUXGMAvpcQJRDFNaxelgghVYFQpLQ4Y7XLEMKwM870lWzyJ8vlRXLGlIO6kqGiml0yBZycMxXfpBsClWtv8FezzZuE1CeSRE4eP62WfgVV9b2jgPwqB10uz7EfGdpzTboNGdagu95IaLi3PSZ0qP3kCn23hkQL4mCWez/DjdyNs+Hqk2tSuni9bxhkBJ44QhHECmASBfdU9XD3tL6ndcgY+k4xFmsCCA4aQigX7XsqSah4oI3iFCXUm4/jxNjzwkieyro5Pa7VFuQbmkors7HHZI6CxgFPHEyEwrTSHlPOz7fLVZu5rKF2LcorTcPSYYvvxyLYH6aLiZ6u4XBCGaQSVfr8MbFGRHCiKomzeOy+Nb2CydMBVAqiQhI2aQEVgB1aN73A/we7Oqav2S7bw0Qz8nQjztgdwcbpS16YmPk4Cg8qy7Ke962oueww0FnDq+besoagsi+5OZ/OWVLKy1DwoGL8QAufsV0wvpNP+f73uks18h8oiBsaM0SWpc+N13I+NDTxaXdBXmoMZRPayZHW3p3sUNGqgika+kBhGaU7qC6c6TuyLTVYiwHuUx7zTid+PsBFm8b8MmMUbeYTDgafAyGCBk/fvQyvTXW+Fn/cSEpf4szCjJ5JSZ+PtcdCoQTY18AXKxakkM33gfF3NA03Dik7Ig8TZI20k3El3I/8b6i/bxn9g0/Ip+rtBuGRMGnmbE+tbX88jHQJnNW3BVXuSX/xeQKMmvaWBz2eCoyQ79W1lHV+iioTIG4yriPAHAt5udOK8iTYS7/w3gCHVHL/eyuOVTocI2f+vu3OLjbKI4vhvZrctVHe3UKDtlkWMIhUIgohFQwATETVGwUSFByPBYGKiIiReQ6KEaDCEgGhIjL4QvCQmPBAIauILJl5qDAlBoE1FbaVdyq3t9pKW7jfHnQ/WFCzsftvtdpfnmW/mnNP/TmfO7T/g8OLdkfQj1YPXbu2Qe+KwpquFV7MJGLvHiIHGBU5MnhPDrEhZ+sGwwYofa5UpjvCJhkWJ7u1bi4rZVnODgudws4RLirBdx59IXMZ3lPTw7rQMQwzN7bJca5Z2nmJ9tgEz4qCxG7TGZKEjPBUJpaYGutav8ERUlhjBEjmMsxm1M6q9l3Gk+oWP1nh9s4QdH28peCGRsHZAadbPHMYLssWmOWhCPwX4MJ0C/0z0HtGTJilQS7vMFcXb/j5WVw5BDZyO4Da6fjzKKg0blSIA7MTPrkI9ef5sk7v646xVirUC+xO5yZvujKij6djiWnOiMdkqwpFwSH0+nHVSfZsT0Fw+cSZg2OUYNkfGZ24cW805O8pKS/yuwPJ871aKj6ZVpSadSGWMXIzXn5KnlY/VCA8L7DWaTTMqM0+8sjK3i5T1drqpIluqPcQBM9U3Z6CxAv4mUlTdxXti+COcwZP8aiVPtMn9PsPLiczAlaI4ooRPcdg3bXJ6ebGZGs3rd41tch+GZxFWiabHCF84cT6Y6dGjO9S+zZ0y3w/rtGZDZWBwMNarlOnPzylokmK1xWSFgccu9LEuG76YxkYJqgArleIZG8SzKTH21eX3sW/KRI+NINO33TVnNjZKiQ6wVHAvtUsQIqLYqzR7/jnG9w9kUPQ21GbRmLyeKKgb2xLkfS9xv+GqOCqgsUI390i4OM42gT1VIW89+66ndGNUJvoUy4HHgUW2Xt/mgNnGyTjUCdTfNoyL5lB7nzwldygfczTUOpdiWwtEaLFsNQ7sv72Cg6latnj5Q56LSU1c2KQUOyqC6VMoednjenNHDTRWKBHxn+nmeWOY4+vntUlZ9gDb7L7axSwQWADUItQCU5QiagxNWlPvRrbhNJoOE6ctkczVh4+OK4zmUOZThEQoM7anKJdiVcrGrIQaYKzYOi/FL7YSoEhzaPJETmY7wm1laovJBkn02SPIxqv7xmQLFKnWGVXQJIU73SG3onnDr/l5Qgp2u1QKpRo//rdUlY5lqlZMV8JUY5iqNBViUx5soFK5ke8xScNczo/pE6EjwdzW6aZQQBOaqBYanDhNPsOJSORKYvVUcngdP9crtc4ArwjsrAypOq/fZ3N+XoAmqVD0gjzq97Mi7vBl1bj/805nU/FCWetMt1Qq4R3H0FARZJfKINMu27rmFWiscpbYY1Y3axAWirB5Ukg1ZlvpQljv7FmpooT1to+RUWzP1csoHdvkHWj++5d1Wm7SpaxDUa3h4wmB1JzR6Sic73PO9kiVMrwphuIBw5bw5S7h+SR33oImaaRWkdLiLl4SxTyt+Kz85kyYW/LJ5EPLcqFbZjsOq5WPPlsDX16aX76mwVLnPWiSwtowwvkYq7TmXgP1F4Wvwx6S2fMRNtafE6pkuRaWKc3RXofdkVDqJoqjrUvBgGawoayfwpKNaZVoDy/UyUUOlnugRhxto7d3yQNiWGE0fm04sHM733phxh1t+QsSNEmjWT/M0kdYaOBJCyBj+B0/3+Xb0W5PlPIwDyrDMtFuu6PDTh9fZdsvlSswFTRoBhvJ1jvFepnnGB7SGluEHVeGQ2aAX8ePz12yupXpvEjQ1+O2ol+ktNuZpmvA8GNTgG9y6e4fKRDdMKC52kA2+2/ufBajqBVDhdZuNxlLvNrg9/FXvI+mccN8mYhIqKPHdQ5aR2GNGKrcKgYhZhQ/+B3qggV+7xoKeDcsaIZS1pajlpZSY/xM1zYUINwi0K+gJEHrN0bEdkWjX2tKEJJVl8o2pbZz3Ll2zLi82v22sM6IW85SLwM0hArgEpuN0+dfvgOtoDQyRzUAAAAASUVORK5CYII=",To=i=>(l.pushScopeId("data-v-77275189"),i=i(),l.popScopeId(),i),JL={class:"custom-video-player"},QL=["id","controls","data-setup","width","height"],ZL=["src","type"],eB=To(()=>l.createElementVNode("p",{class:"vjs-no-js"},[l.createTextVNode(" To view this video please enable JavaScript, and consider upgrading to a "),l.createElementVNode("a",{href:"https://videojs.com/html5-video-support/",target:"_blank"},[l.createTextVNode(" web browser that "),l.createElementVNode("span",null,"supports HTML5 video")])],-1)),tB={key:0,class:"error-overlay"},nB={class:"error-message"},iB=To(()=>l.createElementVNode("i",{class:"el-icon-warning"},null,-1)),rB=To(()=>l.createElementVNode("p",null,"视频加载失败",-1)),sB={class:"error-detail"},aB={key:1,class:"loading-overlay"},oB=[To(()=>l.createElementVNode("div",{class:"loading-spinner"},[l.createElementVNode("i",{class:"el-icon-loading"}),l.createElementVNode("p",null,"视频加载中...")],-1))],lB={key:0,class:"custom-controls"},cB=To(()=>l.createElementVNode("i",{class:"el-icon-close"},null,-1)),uB=To(()=>l.createElementVNode("i",{class:"el-icon-camera"},null,-1)),dB=Bt({__name:"CustomVideoPlayer",props:{videoUrl:{type:String,default:""},controls:{type:Boolean,default:!0},showCustomButton:{type:Boolean,default:!1},hideSnapshotButton:{type:Boolean,default:!1},live:{type:Boolean,default:!1},hasvideo:{type:Boolean,default:!0},width:{type:[String,Number],default:"100%"},height:{type:[String,Number],default:"auto"},lang:{type:String,default:"zh-CN"}},emits:["closeVideo","play","pause","ended","error","loadeddata"],setup(i,{expose:e,emit:t}){const n=i,r=t;e({pause:()=>{a.value&&a.value.pause()},play:()=>{a.value&&a.value.play()},dispose:()=>{a.value&&(a.value.dispose(),a.value=null)}});const s=l.ref(null),a=l.ref(null),o=l.ref(`video-player-${Date.now()}`),c=l.ref(!1),u=l.ref(""),d=l.ref(!1),h=JSON.stringify({fluid:!0,responsive:!0,playbackRates:[.5,1,1.25,1.5,2],language:n.lang,techOrder:["html5"],html5:{vhs:{overrideNative:!0}}}),b=x=>{if(!x)return"video/mp4";const P=x.split(".").pop().toLowerCase();return{mp4:"video/mp4",webm:"video/webm",ogg:"video/ogg",mov:"video/quicktime",avi:"video/x-msvideo",m3u8:"application/x-mpegURL",flv:"video/x-flv"}[P]||"video/mp4"},v=async()=>{if(!(!s.value||!n.videoUrl))try{d.value=!0,c.value=!1,a.value&&(a.value.dispose(),a.value=null),await l.nextTick(),a.value=pe(s.value,{controls:n.controls,fluid:!0,responsive:!0,playbackRates:[.5,1,1.25,1.5,2],language:n.lang,techOrder:["html5"],sources:[{src:n.videoUrl,type:b(n.videoUrl)}],html5:{vhs:{overrideNative:!0}}}),a.value.ready(()=>{console.log("Video.js player is ready"),d.value=!1}),a.value.on("error",x=>{console.error("Video.js error:",x),y(x)}),a.value.on("play",()=>{r("play")}),a.value.on("pause",()=>{r("pause")}),a.value.on("ended",()=>{r("ended")}),a.value.on("loadeddata",()=>{r("loadeddata"),d.value=!1})}catch(x){console.error("Failed to initialize player:",x),y(x)}},y=x=>{c.value=!0,d.value=!1,u.value=(x==null?void 0:x.message)||"视频加载失败,请检查视频地址是否正确",r("error",x),Rn.error("视频加载失败")},p=()=>{d.value=!0,c.value=!1},f=()=>{d.value=!1,r("loadeddata")},m=()=>{r("play")},_=()=>{r("pause")},k=()=>{r("ended")},D=()=>{a.value&&a.value.pause(),r("closeVideo")},w=()=>{if(a.value)try{const x=document.createElement("canvas"),P=a.value.el().querySelector("video");P.videoWidth&&P.videoHeight?(x.width=P.videoWidth,x.height=P.videoHeight,x.getContext("2d").drawImage(P,0,0,x.width,x.height),x.toBlob(M=>{const U=URL.createObjectURL(M),B=document.createElement("a");B.href=U,B.download=`screenshot-${Date.now()}.png`,document.body.appendChild(B),B.click(),document.body.removeChild(B),URL.revokeObjectURL(U),Rn.success("截图已保存")},"image/png")):Rn.warning("视频尚未加载完成")}catch(x){console.error("Screenshot failed:",x),Rn.error("截图失败")}},A=()=>{c.value=!1,u.value="",v()};return l.watch(()=>n.videoUrl,x=>{x&&v()},{immediate:!0}),l.onMounted(()=>{n.videoUrl&&v()}),l.onUnmounted(()=>{a.value&&(a.value.dispose(),a.value=null)}),(x,P)=>(l.openBlock(),l.createElementBlock("div",JL,[l.createElementVNode("div",{class:l.normalizeClass(["video-container",{"has-error":c.value}])},[l.createElementVNode("video",{ref_key:"videoElement",ref:s,id:o.value,class:"video-js vjs-default-skin",controls:i.controls,"data-setup":l.unref(h),width:i.width,height:i.height,preload:"metadata",onError:y,onLoadstart:p,onLoadeddata:f,onPlay:m,onPause:_,onEnded:k},[l.createElementVNode("source",{src:i.videoUrl,type:b(i.videoUrl)},null,8,ZL),eB],40,QL),c.value?(l.openBlock(),l.createElementBlock("div",tB,[l.createElementVNode("div",nB,[iB,rB,l.createElementVNode("p",sB,l.toDisplayString(u.value),1),l.createVNode(l.unref(Rc),{onClick:A,size:"small",type:"primary"},{default:l.withCtx(()=>[l.createTextVNode("重试")]),_:1})])])):l.createCommentVNode("",!0),d.value?(l.openBlock(),l.createElementBlock("div",aB,oB)):l.createCommentVNode("",!0)],2),i.showCustomButton?(l.openBlock(),l.createElementBlock("div",lB,[l.createVNode(l.unref(Rc),{onClick:D,size:"small"},{default:l.withCtx(()=>[cB,l.createTextVNode(" 关闭视频 ")]),_:1}),i.hideSnapshotButton?l.createCommentVNode("",!0):(l.openBlock(),l.createBlock(l.unref(Rc),{key:0,onClick:w,size:"small"},{default:l.withCtx(()=>[uB,l.createTextVNode(" 截图 ")]),_:1}))])):l.createCommentVNode("",!0)]))}},[["__scopeId","data-v-77275189"]]),hB=(i={},{baseUrl:e,token:t}={})=>Ct.post("/api/conferenceRecord/getConferenceRecordByPage",i,{baseURL:e,headers:{satoken:t}}),fB=(i={},{baseUrl:e,token:t}={})=>Ct.post("/api/conferenceRecord/deleteConferenceRecord",i,{baseURL:e,headers:{satoken:t}}),pB=(i={},{baseUrl:e,token:t}={})=>Ct.post("/api/conferenceRecord/updateConferenceRecord",i,{baseURL:e,headers:{satoken:t}}),mB=(i="",{baseUrl:e,token:t}={})=>Ct.post(`/api/asr/getMessageByBytes?fileUrl=${i}`,null,{baseURL:e,headers:{satoken:t}}),HC=(i={},{baseUrl:e,token:t}={})=>Ct.post("/api/v1/displayUsers",i,{baseURL:e,headers:{satoken:t}}),So=(i={},{baseUrl:e,token:t}={})=>Ct.post("api/v1/muteParticipant",i,{baseURL:e,headers:{satoken:t}}),gB=(i={},{baseUrl:e,token:t}={})=>Ct.post("/api/ddhy/sendMsg",i,{baseURL:e,headers:{satoken:t}}),vB=(i={},{baseUrl:e,token:t}={})=>Ct.get("/api/ddhy/getMsg",{params:i,baseURL:e,headers:{satoken:t}}),Wl=i=>(l.pushScopeId("data-v-069a8805"),i=i(),l.popScopeId(),i),yB={class:"manage-container"},bB={class:"main-box"},_B={class:"main-top-box"},kB={class:"searchArea"},TB={class:"main-list-box"},SB={class:"table-box"},CB={class:"video-header"},xB={class:"video-title"},EB=Wl(()=>l.createElementVNode("span",null,null,-1)),wB={class:"el-dialog__title"},DB={class:"video-close"},AB={class:"video-dialog-body"},IB={class:"video-player-box"},PB={key:0,class:"video-transcribe-box"},NB=[Wl(()=>l.createElementVNode("div",{class:"transcribe-title"},[l.createElementVNode("img",{src:$C,alt:""}),l.createElementVNode("div",null,"文字记录")],-1)),Wl(()=>l.createElementVNode("div",{class:"transcribe-loading"},[l.createElementVNode("img",{src:YL,alt:""}),l.createElementVNode("div",{class:"transcribe-loading-text"},"智能生成中...")],-1))],OB={key:1,class:"video-transcribe-box"},MB=Wl(()=>l.createElementVNode("div",{class:"transcribe-title"},[l.createElementVNode("img",{src:$C,alt:""}),l.createElementVNode("div",null,"文字记录")],-1)),RB={class:"transcribe-content"},LB={class:"message-list"},BB=Wl(()=>l.createElementVNode("div",{class:"message-footer"},"机器识别仅供参考",-1)),UB=Bt({__name:"HistoryVideoDialog",props:{baseUrl:{type:String,default:""},token:{type:String,default:""}},setup(i){const e=i;l.ref("0");const t=l.ref(0),n=l.ref(1),r=l.ref(10),s=l.ref([]),a=l.reactive({fileName:"",ownerName:"",createdAt:[],roomMode:"0"}),o=l.ref([]),c=l.ref(!1),u=l.ref(""),d=l.ref("http://10.227.1.34:18080/mp3"),h=l.ref("http://10.227.1.31:7101/recordings"),b=l.ref(""),v=l.ref(!1),y=l.reactive({}),p=l.reactive({fileName:[{required:!0,message:"请输入文件名称",trigger:"blur"}]});l.ref("");const f=l.ref(!0),m=l.ref(""),_=l.ref(""),k=l.ref(!1),D=l.ref(null),w=l.ref(null),A=async()=>{let ee="",fe="";if(a.createdAt[0]){let Ne=new Date(a.createdAt[0]);Ne.setUTCHours(Ne.getUTCHours()+8),ee=Ne.toISOString().replace(/T/," ").replace(/\..+/,"")}if(a.createdAt[1]){let Ne=new Date(a.createdAt[1]);Ne.setUTCHours(Ne.getUTCHours()+8),fe=Ne.toISOString().replace(/T/," ").replace(/\..+/,"")}let xe={fileName:a.fileName,ownerName:a.ownerName,roomMode:a.roomMode,start:ee,end:fe,page:{current:n.value,size:r.value}};try{const Ne=await hB(xe,{baseUrl:e.baseUrl,token:e.token});console.log(Ne,"res"),Ne.status==200?(o.value=Ne.data?Ne.data.data:[],t.value=Ne.data?Ne.data.recordsTotal:0):(o.value=[],t.value=0)}catch(Ne){o.value=[],t.value=0,console.log(Ne)}},x=()=>{console.log(a.fileName,"1111")},P=()=>{a.fileName="",a.ownerName="",a.createdAt=[],t.value=0,n.value=1,r.value=10,s.value=[],A()},S=ee=>{s.value=ee},M=async ee=>{try{await Ev.confirm("确定删除这条录像文件?","警告",{type:"warning"});const fe={id:ee.id},xe=await fB(fe,{baseUrl:e.baseUrl,token:e.token});xe.data.code===0?(Rn.success("删除成功"),A()):Rn.error(xe.data.msg)}catch(fe){fe==="cancel"?Rn.info("已取消删除"):console.error("删除失败:",fe)}},U=async ee=>{c.value=!0,u.value=h.value+ee.filePath,b.value=ee.fileName||"夏小明的直播间";try{let fe=d.value+ee.filePath.replace(/4$/,"3");const xe=await mB(fe,{baseUrl:e.baseUrl,token:e.token});xe.data&&xe.data.code==0&&(m.value=xe.data.msg)}catch(fe){console.log(fe)}f.value=!0,setTimeout(()=>{f.value=!1},2e3)},B=()=>{w.value&&w.value.pause(),c.value=!1,u.value=""},Q=()=>{console.log("视频开始播放")},ie=()=>{console.log("视频暂停")},Y=()=>{console.log("视频播放结束")},q=ee=>{console.error("视频播放错误:",ee),Rn.error("视频播放出现错误")},L=ee=>{let fe=h.value+ee.filePath;W(fe,ee.fileName)},$=ee=>{v.value=!0,Object.assign(y,ee)},H=async()=>{var fe;if(await((fe=D.value)==null?void 0:fe.validate()))try{const xe={id:y.id,fileName:y.fileName},Ne=await pB(xe,{baseUrl:e.baseUrl,token:e.token});Ne.data.code===0?(Rn.success("重命名成功"),v.value=!1,A()):Rn.error(Ne.data.msg)}catch(xe){console.error("重命名失败:",xe),Rn.error("重命名失败")}},j=()=>{var ee;v.value=!1,(ee=D.value)==null||ee.resetFields(),Object.assign(y,{})},W=async(ee,fe)=>{const Ne=await(await fetch(ee)).blob();let He=document.createElement("a");He.style.display="none",He.download=`${fe}.mp4`,He.href=URL.createObjectURL(Ne),document.body.appendChild(He),He.click(),document.body.removeChild(He)},ae=ee=>{n.value=ee,A()},Ee=ee=>{r.value=ee,n.value=t.value/r.value<n.value?Math.ceil(t.value/r.value):n.value,A()},Ae=()=>{k.value=!k.value};return l.onMounted(()=>{A()}),(ee,fe)=>{const xe=l.resolveComponent("el-input"),Ne=l.resolveComponent("el-form-item"),He=l.resolveComponent("el-col"),Be=l.resolveComponent("el-date-picker"),be=l.resolveComponent("el-button"),Fe=l.resolveComponent("el-row"),le=l.resolveComponent("el-form"),ze=l.resolveComponent("el-table-column"),oe=l.resolveComponent("el-table"),de=l.resolveComponent("el-pagination"),Le=l.resolveComponent("el-icon"),Ve=l.resolveComponent("el-dialog");return l.openBlock(),l.createElementBlock("div",yB,[l.createElementVNode("div",bB,[l.createElementVNode("div",_B,[l.createElementVNode("div",kB,[l.createVNode(le,{ref:"queryFormRef",model:a,"label-width":"90px","label-position":"right",size:"small"},{default:l.withCtx(()=>[l.createVNode(Fe,{gutter:24},{default:l.withCtx(()=>[l.createVNode(He,{span:5},{default:l.withCtx(()=>[l.createVNode(Ne,{label:"文件名称"},{default:l.withCtx(()=>[l.createVNode(xe,{modelValue:a.fileName,"onUpdate:modelValue":fe[0]||(fe[0]=Ke=>a.fileName=Ke),maxlength:100,placeholder:"请输入文件名称",onInput:x},null,8,["modelValue"])]),_:1})]),_:1}),l.createVNode(He,{span:5},{default:l.withCtx(()=>[l.createVNode(Ne,{label:"创建者"},{default:l.withCtx(()=>[l.createVNode(xe,{modelValue:a.ownerName,"onUpdate:modelValue":fe[1]||(fe[1]=Ke=>a.ownerName=Ke),maxlength:100,placeholder:"请输入创建者"},null,8,["modelValue"])]),_:1})]),_:1}),l.createVNode(He,{span:8},{default:l.withCtx(()=>[l.createVNode(Ne,{label:"创建时间"},{default:l.withCtx(()=>[l.createVNode(Be,{modelValue:a.createdAt,"onUpdate:modelValue":fe[2]||(fe[2]=Ke=>a.createdAt=Ke),type:"datetimerange","start-placeholder":"开始时间","end-placeholder":"结束时间"},null,8,["modelValue"])]),_:1})]),_:1}),l.createVNode(He,{span:6},{default:l.withCtx(()=>[l.createVNode(Ne,{style:{"text-align":"right","margin-top":"0"}},{default:l.withCtx(()=>[l.createVNode(be,{onClick:fe[3]||(fe[3]=Ke=>A()),class:"query-btn"},{default:l.withCtx(()=>[l.createTextVNode("查询")]),_:1}),l.createVNode(be,{onClick:fe[4]||(fe[4]=Ke=>P()),class:"reset"},{default:l.withCtx(()=>[l.createTextVNode("重置")]),_:1})]),_:1})]),_:1})]),_:1})]),_:1},8,["model"])])]),l.createElementVNode("div",TB,[l.createElementVNode("div",SB,[l.createVNode(oe,{data:o.value,height:"500px","row-key":"id",onSelectionChange:S,style:{background:"#252e3d"},"header-cell-style":{background:"#252e3d",color:"#fff"},border:""},{default:l.withCtx(()=>[l.createVNode(ze,{type:"selection",align:"center",width:"55"}),l.createVNode(ze,{type:"index",align:"center",label:"序号",width:"80"}),l.createVNode(ze,{prop:"fileName",align:"center",label:"文件名称"}),l.createVNode(ze,{prop:"createdAt",align:"center",label:"创建时间"}),l.createVNode(ze,{prop:"size",align:"center",label:"文件大小"}),l.createVNode(ze,{prop:"ownerName",align:"center",label:"文件创建者"}),l.createVNode(ze,{prop:"action",align:"center",label:"操作",fixed:"right"},{default:l.withCtx(({row:Ke})=>[l.createVNode(be,{class:"editBtn",text:"",size:"small",onClick:Ge=>U(Ke)},{default:l.withCtx(()=>[l.createTextVNode("播放")]),_:2},1032,["onClick"]),l.createVNode(be,{class:"editBtn",text:"",size:"small",onClick:Ge=>L(Ke)},{default:l.withCtx(()=>[l.createTextVNode("下载")]),_:2},1032,["onClick"]),l.createVNode(be,{class:"editBtn",text:"",size:"small",onClick:Ge=>$(Ke)},{default:l.withCtx(()=>[l.createTextVNode("重命名")]),_:2},1032,["onClick"]),l.createVNode(be,{class:"delBtn",text:"",size:"small",onClick:Ge=>M(Ke)},{default:l.withCtx(()=>[l.createTextVNode("删除")]),_:2},1032,["onClick"])]),_:1})]),_:1},8,["data"])]),l.createVNode(de,{"current-page":n.value,"page-size":r.value,"page-sizes":[10,20,30,40],layout:"total, sizes, prev, pager, next, jumper",total:t.value,onSizeChange:Ee,onCurrentChange:ae,background:""},null,8,["current-page","page-size","total"])])]),l.createVNode(Ve,{modelValue:c.value,"onUpdate:modelValue":fe[6]||(fe[6]=Ke=>c.value=Ke),width:"70%",height:"65%",center:"","show-close":!1,fullscreen:k.value,class:l.normalizeClass(["video-dialog",{"is-fullscreen":k.value}])},{title:l.withCtx(()=>[l.createElementVNode("div",CB,[l.createElementVNode("div",xB,[EB,l.createElementVNode("div",wB,l.toDisplayString(b.value),1)]),l.createElementVNode("div",DB,[l.createElementVNode("img",{src:XL,alt:"",class:"fullscreen-icon",onClick:Ae}),l.createVNode(Le,{class:"el-dialog__close",onClick:B,style:{"font-size":"20px"}},{default:l.withCtx(()=>[l.createVNode(l.unref(Eh))]),_:1})])])]),default:l.withCtx(()=>[l.createElementVNode("div",AB,[l.createElementVNode("div",IB,[l.createVNode(dB,{ref_key:"playerRef",ref:w,lang:"zh-CN",videoUrl:u.value,controls:!0,"show-custom-button":!0,"hide-snapshot-button":!0,live:!1,hasvideo:!0,onCloseVideo:B,onPlay:Q,onPause:ie,onEnded:Y,onError:q},null,8,["videoUrl"])]),f.value?(l.openBlock(),l.createElementBlock("div",PB,NB)):(l.openBlock(),l.createElementBlock("div",OB,[MB,l.createElementVNode("div",RB,[l.createVNode(xe,{modelValue:_.value,"onUpdate:modelValue":fe[5]||(fe[5]=Ke=>_.value=Ke),style:{height:"36px"},placeholder:"请输入名称进行查询"},null,8,["modelValue"]),l.createElementVNode("div",LB,l.toDisplayString(m.value),1),BB])]))])]),_:1},8,["modelValue","fullscreen","class"]),l.createVNode(Ve,{modelValue:v.value,"onUpdate:modelValue":fe[10]||(fe[10]=Ke=>v.value=Ke),title:"录像重命名",width:"30%",height:"30%",class:"reactName"},{footer:l.withCtx(()=>[l.createVNode(be,{type:"primary",onClick:fe[8]||(fe[8]=Ke=>H()),style:{width:"80px"}},{default:l.withCtx(()=>[l.createTextVNode("确定")]),_:1}),l.createVNode(be,{type:"default",onClick:fe[9]||(fe[9]=Ke=>j()),style:{width:"80px"}},{default:l.withCtx(()=>[l.createTextVNode("取消")]),_:1})]),default:l.withCtx(()=>[l.createVNode(le,{ref_key:"detailFormRef",ref:D,model:y,"label-width":"100px",rules:p,style:{"margin-top":"20px"}},{default:l.withCtx(()=>[l.createVNode(Ne,{label:"文件名称",prop:"fileName"},{default:l.withCtx(()=>[l.createVNode(xe,{type:"text",maxlength:50,modelValue:y.fileName,"onUpdate:modelValue":fe[7]||(fe[7]=Ke=>y.fileName=Ke),placeholder:"请输入文件名称"},null,8,["modelValue"])]),_:1})]),_:1},8,["model","rules"])]),_:1},8,["modelValue"])])}}},[["__scopeId","data-v-069a8805"]]),fn=i=>(l.pushScopeId("data-v-66270129"),i=i(),l.popScopeId(),i),FB={class:"live-address-book-head"},VB={class:"live-address-book-head-title"},jB={class:"live-address-book-content"},$B={class:"content-left-side"},HB=[fn(()=>l.createElementVNode("div",{class:"enter-item-icon enter-item-icon-quick"},null,-1)),fn(()=>l.createElementVNode("div",{class:"enter-item-title"},"快速会议",-1))],qB=[fn(()=>l.createElementVNode("div",{class:"enter-item-icon enter-item-icon-join"},null,-1)),fn(()=>l.createElementVNode("div",{class:"enter-item-title"},"加入会议",-1))],zB=[fn(()=>l.createElementVNode("div",{class:"enter-item-icon enter-item-icon-preview"},null,-1)),fn(()=>l.createElementVNode("div",{class:"enter-item-title"},"预约会议",-1))],GB={class:"left-item"},WB=fn(()=>l.createElementVNode("div",{class:"left-item-title"},[l.createElementVNode("div",{class:"label"},"通讯录")],-1)),KB={class:"left-item-content"},XB={class:"search-bar"},YB=fn(()=>l.createElementVNode("i",{class:"el-input__icon el-icon-search"},null,-1)),JB={class:"custom-tree-node"},QB={key:0,class:"custom-tree-node-user"},ZB={key:0,class:"custom-tree-node-prefix-icon",src:S7,alt:""},eU={key:1,class:"custom-tree-node-prefix-icon",src:C7,alt:""},tU=["title"],nU={key:1,class:"custom-tree-node-user",style:{"margin-left":"-20px"}},iU=fn(()=>l.createElementVNode("span",{class:l.normalizeClass(["custom-tree-node-icon"])},null,-1)),rU=["title"],sU={class:"chosen"},aU={class:"chosen-title"},oU=fn(()=>l.createElementVNode("div",{class:"chosen-title-label"},"已选",-1)),lU={class:"chosen-title-num"},cU=[fn(()=>l.createElementVNode("span",null,"重置",-1))],uU=[fn(()=>l.createElementVNode("img",{class:"option-icon",src:x7,alt:""},null,-1)),fn(()=>l.createElementVNode("span",null,"发起会议",-1))],dU={class:"content-right-side"},hU={class:"meeting-entry-right-head"},fU=fn(()=>l.createElementVNode("img",{class:"logo",src:E7,alt:""},null,-1)),pU={style:{display:"flex","align-items":"center","justify-content":"space-between",width:"100%"}},mU=fn(()=>l.createElementVNode("span",{style:{"margin-right":"30px"}},"今天",-1)),gU={class:"preview-meeting-list-left"},vU={class:"preview-meeting-list-left-primary"},yU=fn(()=>l.createElementVNode("div",{class:"preview-logo"},null,-1)),bU={class:"preview-meeting-name"},_U={class:"preview-meeting-list-left-sub"},kU={class:"meeting-message-item"},TU=fn(()=>l.createElementVNode("div",{class:"meeting-message-item-title"},"发起人:",-1)),SU={class:"meeting-message-item-value"},CU={class:"meeting-message-item"},xU=fn(()=>l.createElementVNode("div",{class:"meeting-message-item-title"},"时间:",-1)),EU={class:"meeting-message-item-value"},wU={class:"meeting-message-item"},DU=fn(()=>l.createElementVNode("div",{class:"meeting-message-item-title"},"会议ID:",-1)),AU={class:"meeting-message-item-value"},IU={class:"preview-meeting-list-right"},PU=["onClick"],NU=["onClick"],OU={key:1,class:"empty-box"},MU=[fn(()=>l.createElementVNode("div",{class:"empty-logo"},null,-1)),fn(()=>l.createElementVNode("div",{class:"empty-text"},"今日暂无会议",-1))],Kl=Bt({__name:"LiveAddressBook",props:{title:{type:String,default:"视频会商"},baseUrl:{type:String,default:""},meetingVideo:{type:Boolean,default:!1},userData:{type:Object,default:()=>({})},org:{type:String,default:"default"},token:{type:String,default:""},meetingTitle:{type:String,default:"调度会议"}},emits:["enterDialogClose","quickLaunch","launchMeeting","joinMeeting"],setup(i,{expose:e,emit:t}){let n=null;const r=new _n,s=i,a=t,o=l.ref(!1),c=l.ref(),u=l.ref(),d=l.ref(""),h=l.ref([]),b=l.ref([]),v=l.ref([]),y=l.ref([]),p=l.ref(null),f=l.ref({}),m=l.ref("add"),_=l.ref(!1),k=l.ref(!1),D=l.reactive({left:"0px",top:"0px"}),w=l.ref(""),A=l.ref(!1),x=l.ref("launch"),P=l.computed(()=>v.value.length),S=l.computed(()=>v.value.length>0?v.value.map(ke=>ke.userId):[]),M=l.computed(()=>Zn().format("MM月DD日")),U=l.computed(()=>y.value.length);l.watch(()=>d.value,async ke=>{await l.nextTick(),c.value.filter(ke)}),l.watch(()=>b.value,(ke,$e)=>{ke.length>0&&ke.forEach(_e=>{Y(_e)}),$e.forEach(_e=>{ke.length>0?ke.findIndex(Ie=>Ie.userId===_e.userId)<0&&q(_e.mobile):(c.value.setChecked(_e.userId,!1,!1),q(_e.mobile))})},{deep:!0});function B(){o.value=!0}function Q(ke){return new Promise(($e,_e)=>{fy({},{baseUrl:s.baseUrl,token:ke||s.token}).then(Re=>{var Ie,it;console.log("获取通讯录组织树",Re),((Ie=Re.data)==null?void 0:Ie.code)===0?(it=Re.data)!=null&&it.data&&(h.value=Re.data.data,$e()):(r.message("error","获取通讯录组织数据失败"),_e())})})}function ie(ke){return P.value>0?v.value.findIndex(_e=>_e.mobile===ke):-1}function Y(ke){if(P.value<=0)v.value.push(ke);else{if(ie(ke.mobile)!==-1)return;v.value.push(ke)}}function q(ke){if(P.value>0){const $e=ie(ke);$e!==-1&&v.value.splice($e,1)}}function L(){ut.emit("getaddressBookUserForAddressBook")}async function $(ke){b.value=ke,await l.nextTick(),c.value.setCheckedKeys(S.value,!1)}async function H(ke){var $e;document.fullscreenElement||document.msFullscreenElement||document.mozFullScreenElement||document.webkitFullscreenElement?document.exitFullscreen?document.exitFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.webkitCancelFullScreen?document.webkitCancelFullScreen():document.msExitFullscreen&&document.msExitFullscreen():(await l.nextTick(),($e=u.value)!=null&&$e.requestFullscreen&&u.value.requestFullscreen())}function j(){a("enterDialogClose")}function W(){A.value=!1}function ae(ke,$e){return ke?$e.label.includes(ke):!0}async function Ee(){await l.nextTick();const ke=c.value.getCheckedNodes(!0,!1);b.value=ke.filter($e=>!$e.children).map($e=>Ae($e))}function Ae(ke){if(ke!=null&&ke.classify&&ke.classify==="设备"){const $e={userId:ke.id,userName:ke.label,mobile:ke.equipmentCode,...ke};return $e.mobile=ke.equipmentCode,$e}else return{userId:ke.id,userName:ke.label,mobile:ke.phone,...ke}}function ee(ke){N8({},{baseUrl:s.baseUrl,token:ke||s.token}).then($e=>{var _e;((_e=$e.data)==null?void 0:_e.code)==0?(y.value=[],$e.data.data.length>0&&(y.value=$e.data.data.map(Re=>{var Ie,it;return{roomName:Re.roomAlias,roomNum:Re.roomName,status:Re.status,beginTime:Zn(Re.reserveStart).format("HH:mm"),endTime:Zn(Re.reserveEnd).format("HH:mm"),beginFullTime:Re.reserveStart,endFullTime:Re.reserveEnd,creator:Re.ownerName,realNumParticipants:Re.realNumParticipants,owner:Re.owner,org:Re.org,preMeetingNotify:Re.preMeetingNotify,joinBefore:Re.joinBefore!==0,joinMute:Re.joinMute!==0,autoRecord:Re.autoRecord!==0,inviteOthers:Re.inviteOthers!==0,venueName:Re!=null&&Re.metadata&&Re.metadata!=="null"?(Ie=JSON.parse(Re.metadata))==null?void 0:Ie.venueName:"",meetingCompany:Re!=null&&Re.metadata&&Re.metadata!=="null"?(it=JSON.parse(Re.metadata))==null?void 0:it.meetingCompany:"",zone:Re.zone}}))):y.value=[]})}function fe(ke){console.log(ke,"e123"),f.value=ke,m.value="edit",_.value=!0}function xe(ke){f.value=ke,m.value="detail",_.value=!0}function Ne(ke){const $e={identity:ke.owner,room:ke.roomNum,org:ke.org};dy($e,{baseUrl:window.liveClient.baseUrl,token:s.token}).then(_e=>{(_e==null?void 0:_e.data.code)===200?(of(ke.roomNum,{baseUrl:s.baseUrl,token:s.token}),r.message("success","成功取消会议"),ee()):r.message("error","取消会议失败")})}function He(ke){const $e={identity:ke.owner,room:ke.roomNum,org:ke.org};dy($e,{baseUrl:window.liveClient.baseUrl,token:s.token}).then(_e=>{(_e==null?void 0:_e.data.code)===200?(of(ke.roomNum,{baseUrl:s.baseUrl,token:s.token}),ee()):r.message("error","结束会议失败")})}function Be(){a("quickLaunch",{roomName:s.userData.username+"的视频会议",cameraStatus:!0,microphoneStatus:!0,audioInputDevice:"",audioOutputDevice:"",videoDevice:"",inviteList:v.value}),j()}function be(ke){const $e={...ke,inviteList:v.value};a("launchMeeting",$e),j()}function Fe(ke){const $e={...ke,inviteList:[]};a("joinMeeting",$e),j()}function le(){b.value=[]}function ze(){le()}function oe(ke){v.value=Array.isArray(ke)?ke:[],b.value=Array.isArray(ke)?ke:[]}function de(){x.value="launch",A.value=!0}function Le(){w.value="",x.value="join",A.value=!0}function Ve(){m.value="add",_.value=!0}function Ke(ke){w.value=ke.roomNum,x.value="join",A.value=!0}function Ge(ke,$e){var _e;k.value?((_e=p.value)==null?void 0:_e.roomNum)===ke.roomNum?k.value=!1:(k.value=!1,p.value=ke,D.left=$e.target.offsetLeft-60+"px",D.top=$e.target.offsetTop+24+"px",k.value=!0):(p.value=ke,D.left=$e.target.offsetLeft-60+"px",D.top=$e.target.offsetTop+24+"px",k.value=!0)}return l.onMounted(()=>{n=setInterval(()=>{ee()},5e3)}),l.onBeforeUnmount(()=>{n&&(clearInterval(n),n=null)}),e({getUserAndOrgTreeData:Q,getPreviewMeetingList:ee}),(ke,$e)=>{const _e=l.resolveComponent("el-input"),Re=l.resolveComponent("el-tree"),Ie=l.resolveComponent("el-dialog");return l.openBlock(),l.createElementBlock("div",{class:"live-address-book",ref_key:"rootElm",ref:u},[l.createElementVNode("div",FB,[l.createElementVNode("div",VB,l.toDisplayString(i.title),1),l.createElementVNode("div",{class:"head-btn-group"},[l.createElementVNode("div",{class:"head-btn head-btn-screen",onClick:H}),l.createElementVNode("div",{class:"head-btn head-btn-close",onClick:j})])]),l.createElementVNode("div",jB,[l.createElementVNode("div",$B,[l.createElementVNode("div",{class:"enter-list"},[l.createElementVNode("div",{class:"enter-list-item",onClick:Be},HB),l.createElementVNode("div",{class:"enter-list-item",onClick:Le},qB),l.createElementVNode("div",{class:"enter-list-item",onClick:Ve},zB)]),l.createElementVNode("div",GB,[WB,l.createElementVNode("div",KB,[l.createElementVNode("div",XB,[l.createVNode(_e,{class:"search-input",modelValue:d.value,"onUpdate:modelValue":$e[0]||($e[0]=it=>d.value=it),placeholder:"请输入名称进行搜索"},{suffix:l.withCtx(()=>[YB]),_:1},8,["modelValue"])]),l.createVNode(Re,{class:"tree-content",data:h.value,"default-expand-all":!1,"node-key":"id","show-checkbox":"","filter-node-method":ae,ref_key:"tree",ref:c,onCheck:Ee},{default:l.withCtx(({node:it,data:_t})=>[l.createElementVNode("span",JB,[_t.children?(l.openBlock(),l.createElementBlock("span",QB,[_t.children.length<=0?(l.openBlock(),l.createElementBlock(l.Fragment,{key:0},[it.expanded?(l.openBlock(),l.createElementBlock("img",ZB)):(l.openBlock(),l.createElementBlock("img",eU))],64)):l.createCommentVNode("",!0),l.createElementVNode("span",{class:"custom-tree-node-label",title:it.label},l.toDisplayString(it.label),9,tU)])):(l.openBlock(),l.createElementBlock("span",nU,[iU,l.createElementVNode("span",{class:"custom-tree-node-label",title:it.label},l.toDisplayString(it.label),9,rU)]))])]),_:1},8,["data"]),l.createElementVNode("div",sU,[l.createElementVNode("div",aU,[oU,l.createElementVNode("div",lU,l.toDisplayString(P.value),1),l.createElementVNode("div",{class:"chosen-title-icon",onClick:L})])]),l.createElementVNode("div",{class:"options"},[l.createElementVNode("div",{class:"option option-reset",onClick:le},cU),l.createElementVNode("div",{class:"option option-launch",onClick:de},uU)])])])]),l.createElementVNode("div",dU,[l.createElementVNode("div",hU,[fU,l.createElementVNode("div",pU,[l.createElementVNode("div",null,[mU,l.createElementVNode("span",null,l.toDisplayString(M.value),1)]),i.meetingVideo?(l.openBlock(),l.createElementBlock("div",{key:0,style:{cursor:"pointer"},onClick:B}," 会议录像 ")):l.createCommentVNode("",!0)])]),l.createElementVNode("div",{class:l.normalizeClass(["meeting-entry-right-content",{"meeting-entry-right-content-empty":U.value<=0}])},[U.value>0?(l.openBlock(!0),l.createElementBlock(l.Fragment,{key:0},l.renderList(y.value,(it,_t)=>(l.openBlock(),l.createElementBlock("div",{class:"preview-meeting-list",key:"p"+_t},[l.createElementVNode("div",gU,[l.createElementVNode("div",vU,[yU,l.createElementVNode("div",bU,l.toDisplayString(it.roomName),1),l.createElementVNode("div",{class:l.normalizeClass(["preview-meeting-status",it.status==0?"preview-meeting-status-unstart":"preview-meeting-status-start"])},l.toDisplayString(it.status==0?"待开始":"已开始"),3)]),l.createElementVNode("div",_U,[l.createElementVNode("div",kU,[TU,l.createElementVNode("div",SU,l.toDisplayString(it.creator),1)]),l.createElementVNode("div",CU,[xU,l.createElementVNode("div",EU,l.toDisplayString(it.beginTime)+"~"+l.toDisplayString(it.endTime),1)]),l.createElementVNode("div",wU,[DU,l.createElementVNode("div",AU,l.toDisplayString(it.roomNum),1)])])]),l.createElementVNode("div",IU,[l.createElementVNode("div",{class:"enter-btn",onClick:Ot=>Ke(it)}," 进入会议 ",8,PU),l.createElementVNode("div",{class:"more-btn",onClick:Ot=>Ge(it,Ot)},null,8,NU)])]))),128)):(l.openBlock(),l.createElementBlock("div",OU,MU))],2)])]),l.createVNode(Zp,{inviteList:v.value,baseUrl:i.baseUrl,token:i.token,onInviteListUpdate:$},null,8,["inviteList","baseUrl","token"]),k.value?(l.openBlock(),l.createBlock(PO,{key:0,previewMeetingData:p.value,optionDialogOffset:D,mobile:i.userData.mobile,onUpdateMeetingDetail:fe,onCheckMeetingDetail:xe,onCancelMeeting:Ne,onEndMeeting:He,onClose:$e[1]||($e[1]=it=>k.value=!1)},null,8,["previewMeetingData","optionDialogOffset","mobile"])):l.createCommentVNode("",!0),_.value?(l.openBlock(),l.createBlock(eM,{key:1,width:"540px",title:"预约会议",previewType:m.value,previewMeetingData:f.value,baseUrl:i.baseUrl,inviteList:v.value,userData:i.userData,org:i.org,token:i.token,onClose:$e[2]||($e[2]=it=>_.value=!1),onPreviewSuccess:ee,onUpdateSuccess:ee,onPreviewResetInviteList:ze,onPreviewUpdateInviteList:oe},null,8,["previewType","previewMeetingData","baseUrl","inviteList","userData","org","token"])):l.createCommentVNode("",!0),A.value?(l.openBlock(),l.createBlock(jC,{key:2,dialogType:x.value,tempRoomNum:w.value,onClose:W,onLaunchMeeting:be,onJoinMeeting:Fe,meetingTitle:i.meetingTitle},null,8,["dialogType","tempRoomNum","meetingTitle"])):l.createCommentVNode("",!0),l.createVNode(Ie,{modelValue:o.value,"onUpdate:modelValue":$e[3]||($e[3]=it=>o.value=it),width:"80%",onClose:$e[4]||($e[4]=it=>o.value=!1),style:{background:"#252e3d"},class:"history-video-dialog"},{default:l.withCtx(()=>[l.createVNode(UB,{baseUrl:i.baseUrl,token:i.token},null,8,["baseUrl","token"])]),_:1},8,["modelValue"])],512)}}},[["__scopeId","data-v-66270129"]]);Kl.install=function(i){i.component("LiveAddressBook",Kl)};const qC="/assets/img/meeting/share.png",RU="/assets/img/meeting/chat.png",zC="/assets/img/meeting/record.png",LU="/assets/img/meeting/member.png",BU="/assets/img/meeting/invite.png",UU="/assets/img/meeting/copy-icon.png",mg=i=>(l.pushScopeId("data-v-737c89fc"),i=i(),l.popScopeId(),i),FU={class:"dialog-inner"},VU={class:"mark-list"},jU=mg(()=>l.createElementVNode("div",{class:"mark-list-title"},"会议主题",-1)),$U={class:"mark-list-value"},HU={class:"mark-list"},qU=mg(()=>l.createElementVNode("div",{class:"mark-list-title"},"会议ID",-1)),zU={class:"mark-list-value"},GU={id:"meeting-num"},WU={class:"mark-icon"},KU={class:"mark-list"},XU=mg(()=>l.createElementVNode("div",{class:"mark-list-title"},"会议发起人",-1)),YU={class:"mark-list-value"},JU=Bt({__name:"ThemeDialog",props:{position:{type:Object,default:()=>({left:"0px",top:"36px"})},meetingName:{type:String},meetingNum:{type:String},meetingH5Link:{type:String},meetingWXLink:{type:String},meetingCreator:{type:String}},setup(i){const e=i,t=new _n,n=async s=>{await l.nextTick();let a=document.getElementById(s);if(a){if(navigator.clipboard){const o=a.innerText;console.log("复制内容",o),navigator.clipboard.writeText(o).then(()=>{t.message("success","已复制到剪贴板")}).catch(c=>{t.message("error","复制失败,请重试")})}else t.message("warning","当前浏览器不支持复制内容");a=null}},r=async()=>{if(await l.nextTick(),navigator.clipboard){const s=`会议主题:${e.meetingName}
325
+ 会议ID:${e.meetingNum}
326
+ 会议链接:${e.meetingH5Link}
327
+ 小程序链接:${e.meetingWXLink}
328
+ 会议发起人:${e.meetingCreator}`;navigator.clipboard.writeText(s).then(()=>{t.message("success","已复制到剪贴板")}).catch(a=>{t.message("error","复制失败,请重试")})}else t.message("warning","当前浏览器不支持复制内容")};return(s,a)=>(l.openBlock(),l.createElementBlock("div",{class:"dialog",style:l.normalizeStyle(e.position)},[l.createElementVNode("div",FU,[l.createElementVNode("div",VU,[jU,l.createElementVNode("div",$U,[l.createElementVNode("span",null,l.toDisplayString(i.meetingName),1)])]),l.createElementVNode("div",HU,[qU,l.createElementVNode("div",zU,[l.createElementVNode("span",GU,l.toDisplayString(i.meetingNum),1),l.createElementVNode("div",WU,[l.createElementVNode("img",{src:UU,alt:"",onClick:a[0]||(a[0]=o=>n("meeting-num"))})])])]),l.createElementVNode("div",KU,[XU,l.createElementVNode("div",YU,l.toDisplayString(i.meetingCreator),1)]),l.createElementVNode("div",{class:"dialog-inner-foot"},[l.createElementVNode("div",{class:"dialog-inner-foot-btn",onClick:r},"一键复制")])])],4))}},[["__scopeId","data-v-737c89fc"]]),GC=i=>(l.pushScopeId("data-v-c7fcde8d"),i=i(),l.popScopeId(),i),QU={class:"dialog-inner"},ZU={class:"mark-list"},eF=GC(()=>l.createElementVNode("div",{class:"mark-list-title"},"网络质量",-1)),tF={class:"mark-list-value"},nF={class:"mark-list"},iF=GC(()=>l.createElementVNode("div",{class:"mark-list-title"},"通话延迟",-1)),rF={class:"mark-list-value"},sF=Bt({__name:"NetworkDetect",props:{position:{type:Object,default:()=>({left:"0px",top:"25px"})},meetingQuality:{type:String},meetingTTL:{type:[String,Number]}},setup(i){const e=i;return(t,n)=>(l.openBlock(),l.createElementBlock("div",{class:"dialog",style:l.normalizeStyle(e.position)},[l.createElementVNode("div",QU,[l.createElementVNode("div",ZU,[eF,l.createElementVNode("div",tF,[l.createElementVNode("span",null,l.toDisplayString(i.meetingQuality),1)])]),l.createElementVNode("div",nF,[iF,l.createElementVNode("div",rF,[l.createElementVNode("span",null,l.toDisplayString(i.meetingTTL)+"ms",1)])])])],4))}},[["__scopeId","data-v-c7fcde8d"]]),aF=i=>(l.pushScopeId("data-v-75b60137"),i=i(),l.popScopeId(),i),oF={class:"dialog-inner"},lF=["onClick"],cF=aF(()=>l.createElementVNode("div",{class:"icon"},null,-1)),uF={class:"title"},dF=Bt({__name:"LayoutSwitch",props:{position:{type:Object,default:()=>({right:"0px",top:"25px"})},currentLayout:{type:String},layoutList:{type:Array},layoutLabels:{type:Array},currentRoomMode:{type:String}},emits:["setLayout"],setup(i,{emit:e}){const t=new _n,n=i,r=e,s=a=>{n.currentRoomMode==="normal"?r("setLayout",a):t.message("info","点调模式下无法切换布局,请切换到会议模式后重试")};return(a,o)=>(l.openBlock(),l.createElementBlock("div",{class:"dialog",style:l.normalizeStyle(n.position)},[l.createElementVNode("div",oF,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(i.layoutList,(c,u)=>(l.openBlock(),l.createElementBlock("div",{class:l.normalizeClass(["layout-list",i.currentLayout===c?"layout-list-"+c+"-active":"layout-list-"+c]),key:c,onClick:d=>s(c)},[cF,l.createElementVNode("div",uF,l.toDisplayString(i.layoutLabels[u]),1)],10,lF))),128))])],4))}},[["__scopeId","data-v-75b60137"]]),gg="/assets/img/index/avatar.png",WC="/assets/img/meeting/mic-off-small.png",KC="/assets/img/meeting/camera-off-small.png",ai=i=>(l.pushScopeId("data-v-691d358b"),i=i(),l.popScopeId(),i),hF={class:"member-manage"},fF={class:"member-manage-head"},pF={class:"member-manage-head-left"},mF=ai(()=>l.createElementVNode("div",{class:"logo"},null,-1)),gF=ai(()=>l.createElementVNode("div",{class:"title"},"成员管理",-1)),vF={class:"tab-content"},yF=ai(()=>l.createElementVNode("div",{class:"input-suffix-icon"},null,-1)),bF={class:"member-list"},_F={class:"member-list-item-group"},kF=ai(()=>l.createElementVNode("img",{class:"avatar",src:gg,alt:""},null,-1)),TF={class:"name"},SF={key:0,class:"host"},CF={class:"member-list-item-group"},xF=["onClick"],EF=["onClick"],wF=["onClick"],DF={class:"tab-content-foot"},AF=[ai(()=>l.createElementVNode("img",{class:"btn-icon",src:WC,alt:""},null,-1)),ai(()=>l.createElementVNode("span",null,"全员静音",-1))],IF=[ai(()=>l.createElementVNode("img",{class:"btn-icon",src:KC,alt:""},null,-1)),ai(()=>l.createElementVNode("span",null,"全员关闭摄像头",-1))],PF={class:"tab-content"},NF=ai(()=>l.createElementVNode("div",{class:"input-suffix-icon"},null,-1)),OF={class:"member-list"},MF={class:"member-list-item-group"},RF=ai(()=>l.createElementVNode("img",{class:"avatar",src:gg,alt:""},null,-1)),LF={class:"name"},BF={key:0,class:"host"},UF={class:"member-list-item-group"},FF=["onClick"],VF=["onClick"],jF={class:"tab-content-foot"},$F=[ai(()=>l.createElementVNode("img",{class:"btn-icon",src:WC,alt:""},null,-1)),ai(()=>l.createElementVNode("span",null,"全员静音",-1))],HF=[ai(()=>l.createElementVNode("img",{class:"btn-icon",src:KC,alt:""},null,-1)),ai(()=>l.createElementVNode("span",null,"全员关闭摄像头",-1))],qF=Bt({__name:"MemberManage",props:{joinedList:{type:Array},participants:{type:Array},localIdentity:{type:String},tempInvitedList:{type:Array},inviteList:{type:Array},meetingNum:{type:String},meetingName:{type:String},meetingHost:{type:Object}},emits:["close","participantCameraSwitch","participantMicrophoneSwitch","allCameraClose","allMicrophoneClose","openMoreDialog","closeMoreDialog","appendMemberInvite","removeUnjoinItem","filterJoinedList"],setup(i,{emit:e}){const t=i,n=e,r=l.ref("joined"),s=l.ref(""),a=l.ref(""),o=l.ref([]),c=l.computed(()=>t.participants.length),u=l.computed(()=>t.tempInvitedList.length);function d(x){return t.meetingHost.ownerId===x}function h(x){if(c.value>0){let P=t.participants.findIndex(S=>S.name===x);return P>=0?P:-1}else return-1}const b=(x,P)=>{n("participantCameraSwitch",{identity:x,isMute:P})},v=(x,P)=>{n("participantMicrophoneSwitch",{identity:x,isMute:P})},y=(x,P)=>{n("openMoreDialog",{identity:x,clientX:P.clientX,clientY:P.clientY})},p=x=>{console.log("点击事件",x.target.className),x.target.className.includes("icon-btn-option")||x.target.className.includes("more-icon")||n("closeMoreDialog")},f=()=>{window.addEventListener("click",p)},m=()=>{window.removeEventListener("click",p)},_=(x,P)=>{console.log("tab点击",x,P)},k=x=>{console.log("participants",t.participants),console.log("tempInvitedList",t.tempInvitedList),u.value>0?c.value>0?(o.value=[],t.tempInvitedList.forEach(P=>{h(P.userName)<0&&P.userName.includes(x)&&o.value.push(P)})):o.value=t.tempInvitedList.filter(P=>P.userName.includes(x)):o.value=[],console.log("unjoinList",o.value)},D=x=>{n("removeUnjoinItem",x)},w=x=>{n("appendMemberInvite",x)},A=()=>{n("close")};return l.watch(()=>s.value,x=>{n("filterJoinedList",x)}),l.watch(()=>t.meetingHost.ownerId,x=>{n("filterJoinedList",s.value)}),l.watch(()=>c.value,x=>{k(a.value)}),l.watch(()=>u.value,x=>{k(a.value)}),l.watch(()=>a.value,x=>{k(x)}),l.onMounted(()=>{k(a.value),f()}),l.onBeforeUnmount(()=>{m()}),(x,P)=>{const S=l.resolveComponent("el-input"),M=l.resolveComponent("el-tab-pane"),U=l.resolveComponent("el-tabs");return l.openBlock(),l.createElementBlock("div",hF,[l.createElementVNode("div",fF,[l.createElementVNode("div",pF,[mF,gF,l.withDirectives(l.createElementVNode("div",{class:"num"},l.toDisplayString(c.value),513),[[l.vShow,c.value>0]])]),l.createElementVNode("div",{class:"close",onClick:A})]),l.createVNode(U,{modelValue:r.value,"onUpdate:modelValue":P[6]||(P[6]=B=>r.value=B),class:"member-manage-contain",onTabClick:_},{default:l.withCtx(()=>[l.createVNode(M,{label:"会议中",name:"joined"},{default:l.withCtx(()=>[l.createElementVNode("div",vF,[l.createVNode(S,{modelValue:s.value,"onUpdate:modelValue":P[0]||(P[0]=B=>s.value=B),placeholder:"请输入名称查询"},{suffix:l.withCtx(()=>[yF]),_:1},8,["modelValue"]),l.createElementVNode("div",bF,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(i.participants,B=>(l.openBlock(),l.createElementBlock("div",{class:"member-list-item",key:B.identity},[l.createElementVNode("div",_F,[kF,l.createElementVNode("span",TF,l.toDisplayString(B.name),1),d(B.identity)?(l.openBlock(),l.createElementBlock("span",SF,"主持人")):l.createCommentVNode("",!0)]),l.createElementVNode("div",CF,[l.createElementVNode("div",{class:l.normalizeClass(["icon-btn",B.isMicrophoneEnabled?"icon-btn-mic-on":"icon-btn-mic-off"]),onClick:Q=>v(B.identity,B.isMicrophoneEnabled)},null,10,xF),l.createElementVNode("div",{class:l.normalizeClass(["icon-btn",B.isCameraEnabled?"icon-btn-cam-on":"icon-btn-cam-off"]),onClick:Q=>b(B.identity,B.isCameraEnabled)},null,10,EF),l.createElementVNode("div",{class:"icon-btn icon-btn-option",onClick:Q=>y(B.identity,Q)},null,8,wF)])]))),128))]),l.createElementVNode("div",DF,[l.createElementVNode("div",{class:"tab-content-foot-btn",onClick:P[1]||(P[1]=B=>n("allMicrophoneClose"))},AF),l.createElementVNode("div",{class:"tab-content-foot-btn",onClick:P[2]||(P[2]=B=>n("allCameraClose"))},IF)])])]),_:1}),d(i.localIdentity)?(l.openBlock(),l.createBlock(M,{key:0,label:"未入会",name:"unJoin"},{default:l.withCtx(()=>[l.createElementVNode("div",PF,[l.createVNode(S,{modelValue:a.value,"onUpdate:modelValue":P[3]||(P[3]=B=>a.value=B),placeholder:"请输入名称查询"},{suffix:l.withCtx(()=>[NF]),_:1},8,["modelValue"]),l.createElementVNode("div",OF,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(o.value,B=>(l.openBlock(),l.createElementBlock("div",{class:"member-list-item",key:B.mobile},[l.createElementVNode("div",MF,[RF,l.createElementVNode("span",LF,l.toDisplayString(B.userName),1),d(B.mobile)?(l.openBlock(),l.createElementBlock("span",BF,"主持人")):l.createCommentVNode("",!0)]),l.createElementVNode("div",UF,[l.createElementVNode("div",{class:"text-btn text-btn-remove",onClick:Q=>D(B)}," 移除 ",8,FF),l.createElementVNode("div",{class:"text-btn text-btn-invite",onClick:Q=>w(B)}," 邀请 ",8,VF)])]))),128))]),l.createElementVNode("div",jF,[l.createElementVNode("div",{class:"tab-content-foot-btn",onClick:P[4]||(P[4]=B=>n("allMicrophoneClose"))},$F),l.createElementVNode("div",{class:"tab-content-foot-btn",onClick:P[5]||(P[5]=B=>n("allCameraClose"))},HF)])])]),_:1})):l.createCommentVNode("",!0)]),_:1},8,["modelValue"])])}}},[["__scopeId","data-v-691d358b"]]),zF=[{codes:"1F600",char:"😀",name:"grinning face"},{codes:"1F603",char:"😃",name:"grinning face with big eyes"},{codes:"1F604",char:"😄",name:"grinning face with smiling eyes"},{codes:"1F601",char:"😁",name:"beaming face with smiling eyes"},{codes:"1F606",char:"😆",name:"grinning squinting face"},{codes:"1F605",char:"😅",name:"grinning face with sweat"},{codes:"1F923",char:"🤣",name:"rolling on the floor laughing"},{codes:"1F602",char:"😂",name:"face with tears of joy"},{codes:"1F642",char:"🙂",name:"slightly smiling face"},{codes:"1F643",char:"🙃",name:"upside-down face"},{codes:"1F609",char:"😉",name:"winking face"},{codes:"1F60A",char:"😊",name:"smiling face with smiling eyes"},{codes:"1F607",char:"😇",name:"smiling face with halo"},{codes:"1F970",char:"🥰",name:"smiling face with hearts"},{codes:"1F60D",char:"😍",name:"smiling face with heart-eyes"},{codes:"1F929",char:"🤩",name:"star-struck"},{codes:"1F618",char:"😘",name:"face blowing a kiss"},{codes:"1F617",char:"😗",name:"kissing face"},{codes:"1F61A",char:"😚",name:"kissing face with closed eyes"},{codes:"1F619",char:"😙",name:"kissing face with smiling eyes"},{codes:"1F44B",char:"👋",name:"waving hand"},{codes:"1F91A",char:"🤚",name:"raised back of hand"},{codes:"1F590",char:"🖐",name:"hand with fingers splayed"},{codes:"270B",char:"✋",name:"raised hand"},{codes:"1F596",char:"🖖",name:"vulcan salute"},{codes:"1F44C",char:"👌",name:"OK hand"},{codes:"1F90F",char:"🤏",name:"pinching hand"},{codes:"270C",char:"✌",name:"victory hand"},{codes:"1F91E",char:"🤞",name:"crossed fingers"},{codes:"1F91F",char:"🤟",name:"love-you gesture"},{codes:"1F918",char:"🤘",name:"sign of the horns"},{codes:"1F919",char:"🤙",name:"call me hand"},{codes:"1F448",char:"👈",name:"backhand index pointing left"},{codes:"1F449",char:"👉",name:"backhand index pointing right"},{codes:"1F446",char:"👆",name:"backhand index pointing up"},{codes:"1F595",char:"🖕",name:"middle finger"},{codes:"1F447",char:"👇",name:"backhand index pointing down"},{codes:"261D FE0F",char:"☝️",name:"index pointing up"},{codes:"1F44D",char:"👍",name:"thumbs up"},{codes:"1F44E",char:"👎",name:"thumbs down"},{codes:"270A",char:"✊",name:"raised fist"},{codes:"1F44A",char:"👊",name:"oncoming fist"},{codes:"1F91B",char:"🤛",name:"left-facing fist"},{codes:"1F91C",char:"🤜",name:"right-facing fist"}],Xl=i=>(l.pushScopeId("data-v-5dd4cec6"),i=i(),l.popScopeId(),i),GF={class:"chat"},WF=Xl(()=>l.createElementVNode("div",{class:"chat-head-left"},[l.createElementVNode("div",{class:"logo"}),l.createElementVNode("div",{class:"title"},"聊天")],-1)),KF={class:"chat-content",id:"chat-content"},XF={class:"message-item-content"},YF={class:"message-item-content-top"},JF={class:"name"},QF=["src"],ZF={key:1,class:"message-item-content-value"},eV=Xl(()=>l.createElementVNode("img",{class:"message-item-avatar",src:ko,alt:""},null,-1)),tV=Xl(()=>l.createElementVNode("img",{class:"message-item-avatar",src:ko,alt:""},null,-1)),nV={class:"message-item-content"},iV={class:"message-item-content-top"},rV={class:"name"},sV=["src"],aV={key:1,class:"message-item-content-value"},oV={class:"chat-foot"},lV={class:"prefix-btns"},cV={class:"emotion-list"},uV=["onClick"],dV=Xl(()=>l.createElementVNode("div",{class:"btn btn-emoji"},null,-1)),hV=Xl(()=>l.createElementVNode("div",{class:"btn"},null,-1)),fV=Bt({__name:"ChatArea",props:{localIdentity:{type:String},messageList:{type:Array},fileUploadUrl:{type:String},imgUrl:{type:String}},emits:["close","messageSend"],setup(i,{expose:e,emit:t}){const n=i,r=t,s=new _n,a=l.ref(""),o=l.ref([]),c=l.ref(),u=l.ref(),d=l.computed(()=>n.messageList.length),h=()=>{a.value=""},b=async()=>{await l.nextTick();let k=document.getElementById("chat-content");if(!k){console.error("不存在消息队列容器");return}k.scrollTop=k.scrollHeight+180},v=()=>{r("close")},y=k=>{k.length<=0?s.message("error","不能发送空白消息"):r("messageSend",k)},p=k=>/\.(jpg|jpeg|png|gif|bmp)$/i.test(k),f=async k=>{var w,A;console.log("emoji",k);let D="";if(await l.nextTick(),(A=(w=window.getSelection().anchorNode)==null?void 0:w.className)!=null&&A.includes("el-input")){let P=document.getElementById("inputEle").selectionStart;D=a.value.substring(0,P)+k+a.value.substring(P)}else D=a.value+k;a.value=D,c.value.focus()},m=(k,D)=>{if(k.url){const w=n.imgUrl+k.url.substring(k.url.indexOf("/equipmentphoto"));y(w)}},_=k=>p(k.name)?k.size>20*1024*1024?(s.message("error","文件大小不得超过20M"),!1):!0:(s.message("error","请上传图片"),!1);return l.watch(()=>d.value,k=>{b()}),l.onMounted(()=>{zF.forEach(k=>{o.value.push(k.char)})}),e({clearInputContent:h}),(k,D)=>{const w=l.resolveComponent("el-popover"),A=l.resolveComponent("el-upload"),x=l.resolveComponent("el-input");return l.openBlock(),l.createElementBlock("div",GF,[l.createElementVNode("div",{class:"chat-head"},[WF,l.createElementVNode("div",{class:"close",onClick:v})]),l.createElementVNode("div",KF,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(i.messageList,(P,S)=>(l.openBlock(),l.createElementBlock("div",{class:l.normalizeClass(["message-item",P.origin===i.localIdentity?"message-item-local":"message-item-other"]),key:"m"+S},[P.origin===i.localIdentity?(l.openBlock(),l.createElementBlock(l.Fragment,{key:0},[l.createElementVNode("div",XF,[l.createElementVNode("div",YF,[l.createElementVNode("span",JF,l.toDisplayString(P.fromName),1),l.createElementVNode("span",null,l.toDisplayString(P.timestamp),1)]),p(P.content)?(l.openBlock(),l.createElementBlock("img",{key:0,class:"message-image",src:P.content,alt:""},null,8,QF)):l.createCommentVNode("",!0),p(P.content)?l.createCommentVNode("",!0):(l.openBlock(),l.createElementBlock("div",ZF,[l.createElementVNode("span",null,l.toDisplayString(P.content),1)]))]),eV],64)):(l.openBlock(),l.createElementBlock(l.Fragment,{key:1},[tV,l.createElementVNode("div",nV,[l.createElementVNode("div",iV,[l.createElementVNode("span",rV,l.toDisplayString(P.fromName),1),l.createElementVNode("span",null,l.toDisplayString(P.timestamp),1)]),p(P.content)?(l.openBlock(),l.createElementBlock("img",{key:0,class:"message-image",src:P.content,alt:""},null,8,sV)):l.createCommentVNode("",!0),p(P.content)?l.createCommentVNode("",!0):(l.openBlock(),l.createElementBlock("div",aV,[l.createElementVNode("span",null,l.toDisplayString(P.content),1)]))])],64))],2))),128))]),l.createElementVNode("div",oV,[l.createVNode(x,{ref_key:"inputRef",ref:c,id:"inputEle",modelValue:a.value,"onUpdate:modelValue":D[1]||(D[1]=P=>a.value=P),placeholder:"开始聊天",onKeyup:D[2]||(D[2]=l.withKeys(P=>y(a.value),["enter"]))},{prefix:l.withCtx(()=>[l.createElementVNode("div",lV,[l.createVNode(w,{placement:"top",width:"200",trigger:"hover","popper-class":"custom-popover"},{reference:l.withCtx(()=>[dV]),default:l.withCtx(()=>[l.createElementVNode("div",cV,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(o.value,(P,S)=>(l.openBlock(),l.createElementBlock("a",{href:"javascript:void(0);",onClick:M=>f(P),key:S,class:"emotion-item"},l.toDisplayString(P),9,uV))),128))])]),_:1}),l.createVNode(A,{ref_key:"uploadRef",ref:u,action:i.fileUploadUrl,multiple:!1,"on-success":m,"before-upload":_},{default:l.withCtx(()=>[hV]),_:1},8,["action"])])]),suffix:l.withCtx(()=>[l.createElementVNode("div",{class:"btn btn-send",onClick:D[0]||(D[0]=P=>y(a.value))})]),_:1},8,["modelValue"])])])}}},[["__scopeId","data-v-5dd4cec6"]]),pV={class:"check-dialog-inner"},mV={class:"control-list"},gV=["onClick"],vV=Bt({__name:"LeaveOptionDialog",props:{position:{type:Object,default:()=>({left:"0px",bottom:"40px"})},otherOptionList:{type:Array,default:()=>["结束会议","离开会议"]}},emits:["cancelMeeting","leaveMeeting","optionClose"],setup(i,{emit:e}){const t=i,n=e,r=s=>{switch(s){case"结束会议":n("cancelMeeting");break;case"离开会议":n("leaveMeeting");break}n("optionClose")};return(s,a)=>(l.openBlock(),l.createElementBlock("div",{class:"check-dialog",style:l.normalizeStyle(t.position)},[l.createElementVNode("div",pV,[l.createElementVNode("div",mV,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(t.otherOptionList,o=>(l.openBlock(),l.createElementBlock("div",{class:l.normalizeClass(["control-list-item"]),key:o.value,onClick:c=>r(o)},l.toDisplayString(o),9,gV))),128))])])],4))}},[["__scopeId","data-v-e06551cc"]]),XC=i=>(l.pushScopeId("data-v-468c6895"),i=i(),l.popScopeId(),i),yV={class:"appoint-dialog-title"},bV={class:"member-list"},_V=["onClick"],kV=XC(()=>l.createElementVNode("img",{class:"member-item-avatar",src:gg,alt:""},null,-1)),TV={class:"member-item-name"},SV=XC(()=>l.createElementVNode("div",{class:"member-item-check"},null,-1)),CV=Bt({__name:"AppointDialog",props:{position:{type:Object,default:()=>({right:"127px",bottom:"84px"})},title:{type:String,default:"指定主持人"},participants:{type:Array},meetingHost:{type:Object}},emits:["appointHost","closeDialog"],setup(i,{emit:e}){const t=new _n,n=i,r=l.ref([]),s=l.ref(null),a=e,o=l.computed(()=>n.participants.length);function c(h){return n.meetingHost.ownerId===h}const u=()=>{if(c(s.value.ownerId)){t.message("info","当前与会者为已存在的会议主持人,无法更改");return}a("appointHost",s.value),a("closeDialog")},d=h=>{s.value={ownerId:h.identity,ownerName:h.name}};return l.watchEffect(()=>{s.value=n.meetingHost,o.value>0?r.value.length>0?(r.value=r.value.filter(h=>n.participants.findIndex(b=>b.identity===h.identity)>-1),n.participants.forEach(h=>{r.value.findIndex(b=>b.identity===h.identity)<=-1&&r.value.push({identity:h.identity,name:h.name})})):r.value=n.participants.map(h=>({identity:h.identity,name:h.name})):r.value=[]}),l.onMounted(()=>{}),(h,b)=>(l.openBlock(),l.createElementBlock("div",{class:"appoint-dialog",style:l.normalizeStyle(n.position)},[l.createElementVNode("div",yV,l.toDisplayString(n.title),1),l.createElementVNode("div",bV,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(r.value,(v,y)=>(l.openBlock(),l.createElementBlock("div",{class:l.normalizeClass(["member-item",{"member-item-checked":s.value.ownerId===v.identity}]),key:"p"+y,onClick:l.withModifiers(p=>d(v),["stop"])},[kV,l.createElementVNode("span",TV,l.toDisplayString(v.name),1),SV],10,_V))),128))]),l.createElementVNode("div",{class:"appoint-dialog-foot"},[l.createElementVNode("div",{class:"foot-btn",onClick:u},"指定并离开")])],4))}},[["__scopeId","data-v-468c6895"]]),xV=["onClick"],EV=Bt({__name:"MoreOptionDialog",props:{curBlur:{type:String,default:""},identity:{type:String,default:""},optionDialogOffset:{type:Object,default:{left:"0px",top:"0px"}},localIdentity:{type:String},meetingHost:{type:Object},participants:{type:Array},currentDisplayIdentity:{type:String,default:null}},emits:["close","setToBlur","removeFromBlur","closeMicro","closeCamera","setToHost","setToDeafness","cancelDeafness","updateName","remove","distributeScreen","cancelDistributeScreen"],setup(i,{emit:e}){const t=i,n=e,r=l.computed(()=>{if(a(t.localIdentity)){if(o(t.identity))return[t.curBlur===t.identity?"取消设为主屏":"设为主屏","关闭麦克风",t.currentDisplayIdentity===t.identity?"取消分发画面":"分发画面","修改名称","移出会议"]}else return t.curBlur===t.identity?t.identity===t.localIdentity?["取消设为主屏","修改名称"]:["取消设为主屏"]:t.identity===t.localIdentity?["设为主屏","修改名称"]:["设为主屏"]}),s=l.computed(()=>t.participants.length);function a(u){return t.meetingHost.ownerId===u}function o(u){if(s.value>0){const d=t.participants.findIndex(h=>h.identity===u);return d>-1?t.participants[d]:null}else return null}const c=u=>{switch(u){case"设为主屏":n("setToBlur",t.identity);break;case"取消设为主屏":n("removeFromBlur",t.identity);break;case"关闭麦克风":n("closeMicro",t.identity);break;case"分发画面":n("distributeScreen",t.identity);break;case"取消分发画面":n("cancelDistributeScreen",t.identity);break;case"关闭摄像头":n("closeCamera",t.identity);break;case"设为主持人":n("setToHost",t.identity);break;case"置聋":n("setToDeafness",t.identity);break;case"取消置聋":n("cancelDeafness",t.identity);break;case"修改名称":n("updateName",t.identity);break;case"移出会议":n("remove",t.identity);break}n("close")};return l.onMounted(()=>{}),(u,d)=>(l.openBlock(),l.createElementBlock("div",{class:"more-option",style:l.normalizeStyle(t.optionDialogOffset)},[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(r.value,(h,b)=>(l.openBlock(),l.createElementBlock("div",{class:l.normalizeClass(["more-option-item",{"more-option-item-danger":h==="移出会议"}]),key:"o"+b,onClick:v=>c(h)},l.toDisplayString(h),11,xV))),128))],4))}},[["__scopeId","data-v-eb018a10"]]),wV="/assets/img/meeting/close.png",vg=i=>(l.pushScopeId("data-v-d78ab697"),i=i(),l.popScopeId(),i),DV={class:"call-board-title"},AV=vg(()=>l.createElementVNode("span",null,"拨号盘",-1)),IV={class:"call-board-list"},PV=["onClick"],NV={class:"call-board-foot"},OV=[vg(()=>l.createElementVNode("div",{class:"btn-icon"},null,-1))],MV=[vg(()=>l.createElementVNode("div",{class:"btn-icon"},null,-1))],RV=Bt({__name:"CallBoard",props:{position:{type:Object,default:()=>({right:"127px",bottom:"84px"})},defaultCallingMethod:{type:Array,default:()=>["voice","video","mini"]}},emits:["closeCallBoard","phoneCall","miniCall"],setup(i,{emit:e}){const t=new _n,n=i,r=e,s=l.ref(""),a=d=>/^[\d#*]+$/.test(d),o=d=>{s.value+=d},c=()=>{s.value?a(s.value)?r("phoneCall",s.value):t.message("error","手机号中包含不合法字符"):t.message("error","联系方式不能为空")},u=()=>{s.value?r("miniCall",s.value):t.message("error","联系方式不能为空")};return(d,h)=>{const b=l.resolveComponent("el-input");return l.openBlock(),l.createElementBlock("div",{class:"call-board",style:l.normalizeStyle(n.position)},[l.createElementVNode("div",DV,[AV,l.createElementVNode("img",{class:"title-close-icon",src:wV,alt:"",onClick:h[0]||(h[0]=v=>r("closeCallBoard"))})]),l.createVNode(b,{modelValue:s.value,"onUpdate:modelValue":h[1]||(h[1]=v=>s.value=v),type:"mobile",clearable:""},null,8,["modelValue"]),l.createElementVNode("div",IV,[(l.openBlock(),l.createElementBlock(l.Fragment,null,l.renderList("123456789*0#",(v,y)=>l.createElementVNode("div",{class:"call-board-list-item",key:y,onClick:p=>o(v)},l.toDisplayString(v),9,PV)),64))]),l.createElementVNode("div",NV,[i.defaultCallingMethod.includes("video")?(l.openBlock(),l.createElementBlock("div",{key:0,class:"call-board-foot-btn call-btn",onClick:c},OV)):l.createCommentVNode("",!0),i.defaultCallingMethod.includes("mini")?(l.openBlock(),l.createElementBlock("div",{key:1,class:"call-board-foot-btn mini-btn",onClick:u},MV)):l.createCommentVNode("",!0)])],4)}}},[["__scopeId","data-v-d78ab697"]]),LV=i=>(l.pushScopeId("data-v-a0281acb"),i=i(),l.popScopeId(),i),BV={class:"chat-wrap"},UV={class:"chat-content",id:"chat-content"},FV=LV(()=>l.createElementVNode("div",{class:"chat-message"},[l.createElementVNode("span",{class:"msg-content"},"您已进入会议,可以开始聊天了")],-1)),VV={class:"msg-origin"},jV={class:"msg-content"},$V=Bt({__name:"InstantMessage",props:{messageList:{type:Array}},emits:["messageSend"],setup(i,{expose:e,emit:t}){const n=l.ref(""),r=t,s=i,a=l.computed(()=>s.messageList.length);l.watch(()=>a.value,h=>{o()});const o=()=>{let h=document.getElementById("chat-content");if(!h){console.error("不存在对应元素");return}h.scrollTop=h.scrollHeight},c=()=>{n.value.length?r("messageSend",n.value):ElMessage({message:"不能发送空白消息",type:"warning"})},u=h=>/\.(jpg|jpeg|png|gif|bmp)$/i.test(h);return e({clearInput:()=>{n.value=""}}),(h,b)=>{const v=l.resolveComponent("el-input");return l.openBlock(),l.createElementBlock("div",BV,[l.createElementVNode("div",UV,[FV,(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(i.messageList,(y,p)=>(l.openBlock(),l.createElementBlock("div",{class:"chat-message",key:"a"+p},[l.createElementVNode("span",VV,l.toDisplayString(y.fromName)+":",1),l.createElementVNode("span",jV,l.toDisplayString(u(y.content)?"[图片消息]请点击下方聊天按钮查看":y.content),1)]))),128))]),l.createElementVNode("div",null,[l.createVNode(v,{modelValue:n.value,"onUpdate:modelValue":b[0]||(b[0]=y=>n.value=y),placeholder:"说点什么。。。。",clearable:"",onKeyup:l.withKeys(c,["enter"])},null,8,["modelValue"])])])}}},[["__scopeId","data-v-a0281acb"]]),HV=i=>(l.pushScopeId("data-v-68022380"),i=i(),l.popScopeId(),i),qV={class:"CustomHeader"},zV=HV(()=>l.createElementVNode("div",{class:"ivits"},"修改与会者名称",-1)),GV={class:"contentsinit"},WV=Bt({__name:"UpdateNameDialog",emits:["updateNameCancel","updateNameConfirm"],setup(i,{emit:e}){const t=e,n=l.ref(!1),r=l.ref(),s=l.reactive({name:"",sort:1}),a=l.ref(""),o=l.reactive({name:[{required:!0,message:"请输入名称",trigger:"blur"},{min:1,max:10,message:"与会者名称不应超过10个字符",trigger:"blur"}]});ut.on("updateName",d=>{n.value=!0,a.value=d.identity});const c=()=>{t("updateNameCancel"),n.value=!1},u=async()=>{await l.nextTick(),r.value.validate(d=>{console.log("valid",d),d?(t("updateNameConfirm",{name:s.name,identity:a.value}),n.value=!1):console.log("表单校验不通过")})};return l.watch(()=>n.value,d=>{d&&(s.name="")}),(d,h)=>{const b=l.resolveComponent("el-input"),v=l.resolveComponent("el-form-item"),y=l.resolveComponent("el-form"),p=l.resolveComponent("el-dialog");return l.openBlock(),l.createElementBlock("div",null,[l.createVNode(p,{modelValue:n.value,"onUpdate:modelValue":h[2]||(h[2]=f=>n.value=f),"show-close":!1,class:"telephoneInvit",width:"460"},{header:l.withCtx(()=>[l.createElementVNode("div",qV,[zV,l.createElementVNode("div",{class:"close",onClick:h[0]||(h[0]=f=>n.value=!1)})])]),default:l.withCtx(()=>[l.createElementVNode("div",GV,[l.createVNode(y,{model:s,"hide-required-asterisk":"",ref_key:"createForm",ref:r,rules:o,"label-width":"100",class:"customForm"},{default:l.withCtx(()=>[l.createVNode(v,{label:"与会者名称",prop:"name"},{default:l.withCtx(()=>[l.createVNode(b,{modelValue:s.name,"onUpdate:modelValue":h[1]||(h[1]=f=>s.name=f)},null,8,["modelValue"])]),_:1}),l.createVNode(v,{"label-width":"110"},{default:l.withCtx(()=>[l.createElementVNode("div",{class:"isokmul"},[l.createElementVNode("div",{onClick:c},"取消"),l.createElementVNode("div",{onClick:u},"确定")])]),_:1})]),_:1},8,["model","rules"])])]),_:1},8,["modelValue"])])}}},[["__scopeId","data-v-68022380"]]),KV=()=>{const i=l.ref(null),e=s=>{i.value=new IntersectionObserver(s,{root:null,rootMargin:"0px",threshold:.1})};function t(s){i.value&&i.value.observe(s)}function n(s){i.value&&i.value.unobserve(s)}function r(){i.value&&(i.value.disconnect(),i.value=null)}return{interceptionObserver:i,createInterceptionObserver:e,observeElement:t,unobserveElement:n,endInterceptionObserve:r}},XV=()=>{const i=l.ref(!0),e=l.ref(null);function t(s,a){if(s&&s===a.identity||a!=null&&a.isInViewport||e.value===a.identity)return;const o=document.getElementById(`participant-${a.identity}`),c=document.querySelector("#meeting-contain .layout-participant");if(o&&c){if(c.firstChild&&c.firstChild.id===o.id)return;c.insertBefore(o,c.firstChild??null),e.value=a.identity}}function n(s){if(s!=null&&s.isInViewport||e.value===s.identity)return;const a=document.getElementById(`participant-${s.identity}`),o=document.getElementById("meeting-contain");if(a&&o){if(o.firstChild&&o.firstChild.id===a.id)return;o.insertBefore(a,o.firstChild??null),e.value=s.identity}}function r(s,a,o,c){if(i.value&&c&&c.length>0){const u=c.findIndex(d=>d.identity===s.identity);u>=0&&(a==="blur"?t(o,c[u]):n(c[u]))}}return{onSpeakerVoiceMotivate:r}},YV=new _n;class JV{constructor(){this.roomStore=null,this.meetingStore=null,this.setMemberBlur=null,this.removeCurBlur=null,this.isInitialized=!1,this.pollingInterval=null,this.lastSyncTimestamp=0}init(e,t,n,r){this.roomStore=e,this.meetingStore=t,this.setMemberBlurLocal=n,this.removeCurBlurLocal=r,this.isInitialized=!0}async initializeLayoutSync(){if(!this.isInitialized){console.error("布局同步管理器未初始化");return}await this.fetchLayoutSyncData(!0)}startPolling(){if(!this.isInitialized){console.error("布局同步管理器未初始化");return}this.stopPolling(),this.pollingInterval=setInterval(()=>{this.meetingStore.meetingNum&&this.fetchLayoutSyncData(!1)},3e3)}stopPolling(){this.pollingInterval&&(clearInterval(this.pollingInterval),this.pollingInterval=null)}async fetchLayoutSyncData(e=!1){if(console.log(this.meetingStore,"this.meetingStore"),!this.meetingStore.meetingNum){console.log("meetingNum为空,跳过布局同步数据获取");return}try{const t=await vB({roomId:this.meetingStore.meetingNum},{baseUrl:this.meetingStore.baseUrl,token:this.meetingStore.token});if(t&&t.data&&t.data.success===!0&&t.data.msg)try{const n=typeof t.data.msg=="string"?t.data.msg.trim():"";if(!n)return;let r=null;try{r=JSON.parse(n)}catch{console.warn("getMsg.msg 非法JSON,跳过处理。原始值:",n);return}if(!e&&r.status===!1)return;this.handleLayoutSyncResponse(r,e)}catch(n){console.error("解析同步数据失败:",n)}else console.log("getMsg接口返回空数据或失败状态,跳过处理")}catch(t){console.error("获取布局同步数据失败:",t)}}async sendLayoutSync(e,t={}){var n;try{const r={type:e,...t},s={action:JSON.stringify(r),roomId:this.meetingStore.meetingNum,status:!0,userId:[this.meetingStore.localIdentity]},a=await gB(s,{baseUrl:this.meetingStore.baseUrl,token:this.meetingStore.token});if(a&&a.data.code===0)return{success:!0,data:a.data};throw new Error((a==null?void 0:a.msg)||((n=a==null?void 0:a.data)==null?void 0:n.msg)||"发送失败")}catch(r){return console.error("布局同步发送失败:",r),{success:!1,error:r}}}handleLayoutSyncResponse(e,t=!1){if(!(!t&&e.userId&&e.userId.includes(this.meetingStore.localIdentity)))try{const n=typeof(e==null?void 0:e.action)=="string"?e.action.trim():"";if(!n)return;let r=null;try{r=JSON.parse(n)}catch{console.warn("action 非法JSON,跳过处理。原始值:",n);return}if(!r||typeof r!="object")return;switch(r.type){case"switchLayout":this.handleLayoutSwitch(r);break;case"switchMode":this.handleModeSwitch(r);break;case"setFocus":this.handleFocusSet(r);break;default:}}catch(n){console.error("解析操作数据失败:",n)}}handleLayoutSwitch(e){e.layout&&e.layout!==this.roomStore.currentLayout&&(this.roomStore.setCurrentLayout(e.layout),this.triggerLayoutUpdate(e.layout)),e.focusedParticipant!==void 0&&(this.roomStore.setFocusedParticipant(e.focusedParticipant),e.focusedParticipant&&this.setMemberBlurLocal?this.setMemberBlurLocal(e.focusedParticipant):e.focusedParticipant===null&&this.removeCurBlurLocal&&this.removeCurBlurLocal())}handleModeSwitch(e){e.roomMode&&e.roomMode!==this.roomStore.currentRoomMode?(console.log("模式需要切换,从",this.roomStore.currentRoomMode,"切换到",e.roomMode),this.roomStore.setCurrentRoomMode(e.roomMode),console.log("模式已更新为:",this.roomStore.currentRoomMode)):console.log("模式无需切换,当前模式:",this.roomStore.currentRoomMode,"新模式:",e.roomMode)}handleFocusSet(e){e.focusedParticipant!==this.roomStore.focusedParticipant&&(this.roomStore.setFocusedParticipant(e.focusedParticipant),e.focusedParticipant&&this.setMemberBlurLocal?this.setMemberBlurLocal(e.focusedParticipant):e.focusedParticipant===null&&this.removeCurBlurLocal&&this.removeCurBlurLocal())}triggerLayoutUpdate(e){typeof window<"u"&&window.dispatchEvent&&window.dispatchEvent(new CustomEvent("layoutSync:layoutChanged",{detail:{layout:e}}))}triggerModeUpdate(e){typeof window<"u"&&window.dispatchEvent&&window.dispatchEvent(new CustomEvent("layoutSync:modeChanged",{detail:{roomMode:e}}))}validateOperationPermission(e,t){return e?!0:(YV.message("info",`只有主持人可以${t}`),!1)}}const $r=new JV,sa=async(i,e={})=>$r.sendLayoutSync(i,e),YC=async()=>$r.initializeLayoutSync(),JC=()=>{$r.startPolling()},QV=()=>{$r.stopPolling()},tn=i=>(l.pushScopeId("data-v-0cbc3d71"),i=i(),l.popScopeId(),i),ZV={class:l.normalizeClass(["meeting-room-top-bar"])},ej={class:"bar-group"},tj=tn(()=>l.createElementVNode("div",{class:"meeting-theme"},[l.createElementVNode("div",{class:"meeting-theme-logo"}),l.createElementVNode("span",{style:{"white-space":"nowrap"}},"会议主题")],-1)),nj={class:"meeting-name-text"},ij=tn(()=>l.createElementVNode("div",{class:"meeting-name-icon"},null,-1)),rj={class:"meeting-duration"},sj=tn(()=>l.createElementVNode("div",{class:"meeting-duration-logo"},null,-1)),aj={class:"bar-group"},oj={class:"meeting-room-contain"},lj={class:"bar-group"},cj={class:"custom-select"},uj=[tn(()=>l.createElementVNode("div",{class:"arrow-icon"},null,-1))],dj={class:"custom-select"},hj=[tn(()=>l.createElementVNode("div",{class:"arrow-icon"},null,-1))],fj={class:"bar-group"},pj={key:0,class:"custom-select"},mj=tn(()=>l.createElementVNode("div",{class:"theme-icon"},null,-1)),gj=tn(()=>l.createElementVNode("div",{class:"theme-text"},"会议模式",-1)),vj=[tn(()=>l.createElementVNode("div",{class:"arrow-icon"},null,-1))],yj=[tn(()=>l.createElementVNode("img",{class:"t-btn-icon",src:qC,alt:""},null,-1)),tn(()=>l.createElementVNode("span",null,"共享屏幕",-1))],bj=[tn(()=>l.createElementVNode("img",{class:"t-btn-icon",src:qC,alt:""},null,-1)),tn(()=>l.createElementVNode("span",null,"结束共享",-1))],_j=[tn(()=>l.createElementVNode("img",{class:"t-btn-icon",src:RU,alt:""},null,-1)),tn(()=>l.createElementVNode("span",null,"聊天",-1))],kj=[tn(()=>l.createElementVNode("img",{class:"t-btn-icon",src:zC,alt:""},null,-1)),tn(()=>l.createElementVNode("span",null,"录制",-1))],Tj=[tn(()=>l.createElementVNode("img",{class:"t-btn-icon",src:zC,alt:""},null,-1)),tn(()=>l.createElementVNode("span",null,"结束录制",-1))],Sj=[tn(()=>l.createElementVNode("img",{class:"t-btn-icon",src:LU,alt:""},null,-1)),tn(()=>l.createElementVNode("span",null,"成员管理",-1))],Cj=[tn(()=>l.createElementVNode("span",null,"一键VOLTE",-1))],xj=[tn(()=>l.createElementVNode("img",{class:"t-btn-icon",src:BU,alt:""},null,-1))],Ej=tn(()=>l.createElementVNode("img",{class:"t-btn-icon",src:R_,alt:""},null,-1)),wj={class:"meeting-room-contain-right"},aa=`
329
+ <div class="board">
330
+ <div class="board-icon"></div>
331
+ </div>
332
+ <div class="describe">
333
+ <div class="describe-left">
334
+ <div class="avatar"></div>
335
+ <div class="identity">空缺席位</div>
336
+ </div>
337
+ <div class="tools"></div>
338
+ </div>
339
+ `,Yl=Bt({__name:"LiveMultipleMeeting",props:{tempMeetingName:{type:String,default:""},tempMeetingNum:{type:String,default:""},tempCameraStatus:{type:Boolean},meetingVideo:{type:Boolean,default:!1},tempMicroStatus:{type:Boolean},tempActiveDevice:{type:Object,default:()=>({})},tempInviteList:{type:Array,default:()=>[]},baseUrl:{type:String,default:""},meetingUrl:{type:String,default:""},userData:{type:Object,default:()=>({})},org:{type:String,default:"default"},joinType:{type:String,default:"launch"},token:{type:String,default:""},fileUploadUrl:{type:String},imgUrl:{type:String},h5Url:{type:String,default:""},isCustomizeMiniInvitations:{type:Boolean,default:!1},miniPagePath:{type:String,default:""},defaultInviteWay:{type:String,default:"mini"},wxOfficial:{type:Boolean,default:!1},defaultCallingMethod:{type:Array,default:()=>["voice","video","mini"]}},emits:["multiMeetingClose","miniInviteSend","inviteMessageSend"],setup(i,{expose:e,emit:t}){const n=i,r=t,s=l.ref(),a=l.ref(""),o=l.ref(""),c=l.ref(""),u=l.ref([]),d=l.ref([]),h=l.ref([]),b=l.ref([]),v=l.ref(""),y=l.ref({ownerId:"",ownerName:""}),p=l.ref(""),f=l.ref(""),m=l.ref(""),_=l.ref(""),k=l.ref([]),D=l.ref([]),w=l.ref([]),A=l.reactive({audioInputDevice:"",audioOutputDevice:"",videoDevice:""}),x=l.reactive({audioInputDevice:"",audioOutputDevice:"",videoDevice:""}),P=l.ref([]),S=l.ref(""),M=l.ref(""),U=l.ref("grid"),B=l.ref("normal"),Q=l.ref(["grid","rightSide"]),ie=l.ref(["宫格","右侧边栏"]),Y=l.ref(0),q=l.ref(!1),L=l.ref(!1),$=l.ref(!1),H=l.ref(!1),j=l.ref(!1),W=l.ref(!1),ae=l.ref(!1),Ee=l.ref(!1),Ae=l.ref(!1),ee=l.ref(!1),fe=l.ref(!1),xe=l.ref(!1),Ne=l.ref(null),He=l.ref([]),Be=l.ref([]),be=l.ref(null),Fe=l.ref(null),le=l.ref(!1),ze=l.ref({}),oe=l.ref(!1),de=l.ref(!1),Le=l.ref(!1),Ve=l.ref(!1),Ke=l.ref(""),Ge=l.ref(!1),ke=l.ref(3);l.ref("测试短信");const $e=l.ref(!1),_e=l.ref(!1),Re=l.ref(!1),Ie=l.ref(!1),it=l.ref({}),_t=l.ref(!1),Ot=l.ref(!1),Hn=l.ref({}),Ri=l.ref(null),Yn=l.ref(!1),Tt=l.ref(""),Hr=l.ref(!0),bi=l.ref(!1),qn=l.ref(null),qr=l.ref(),Jn=l.ref();l.ref(0);const{createInterceptionObserver:oi,observeElement:Tr,unobserveElement:zr,endInterceptionObserve:V}=KV();XV();const G=N=>{console.log(`交叉观察器触发,检测到 ${N.length} 个元素变化`),N.forEach(R=>{console.log("观察器目标元素:",{id:R.target.id,className:R.target.className,tagName:R.target.tagName});const z=R.target.getAttribute("data-identity");if(!z){console.log(`❌ 无法获取参与者identity,元素ID: ${R.target.id}`);return}const J=document.getElementById(`video-${z}`);console.log(`参与者 ${z} 视口状态变化:`,{isIntersecting:R.isIntersecting,intersectionRatio:R.intersectionRatio,boundingClientRect:R.boundingClientRect});const re=h.value.findIndex(ye=>ye.identity===z);if(re===-1){if(console.log(`未找到参与者: ${z},尝试从DOM元素获取数据`),!document.getElementById(`participant-${z}`)){console.log(`❌ 无法找到参与者元素: ${z}`);return}setTimeout(()=>{const ge=h.value.findIndex(me=>me.identity===z);if(ge!==-1){const me=h.value[ge];console.log(`✅ 重试找到参与者: ${z}`),R.isIntersecting?(me.isInViewport=!0,me.videoTrack&&J&&(!J.src&&!J.currentSrc?requestAnimationFrame(()=>{me.videoTrack.attach(J),console.log(`✅ 重试渲染视频: ${z}`)}):console.log(`✅ 重试时视频已在渲染: ${z}`))):(me.isInViewport=!1,me.videoTrack&&requestAnimationFrame(()=>{me.videoTrack.detach(),console.log(`❌ 重试停止渲染视频: ${z}`)}))}else console.log(`❌ 重试后仍未找到参与者: ${z}`)},50);return}const ue=h.value[re];R.isIntersecting?(ue.isInViewport=!0,ue.videoTrack&&J?!J.src&&!J.currentSrc?requestAnimationFrame(()=>{ue.videoTrack.attach(J),console.log(`✅ 开始渲染视频: ${z}`)}):console.log(`✅ 视频已在渲染: ${z}`):console.log(`❌ 无法渲染视频: ${z}`,{hasVideoTrack:!!ue.videoTrack,hasVideoElement:!!J,videoTrackDetails:ue.videoTrack?{id:ue.videoTrack.id,kind:ue.videoTrack.kind,enabled:ue.videoTrack.enabled,muted:ue.videoTrack.muted}:null})):(ue.isInViewport=!1,ue.videoTrack&&requestAnimationFrame(()=>{ue.videoTrack.detach(),console.log(`❌ 停止渲染视频: ${z}`)}))})},se=()=>{oi(G),console.log("交叉观察器已初始化")},ve=()=>{console.log("=== 视频渲染状态调试 ==="),console.log("当前布局:",U.value),console.log("麦克风状态:",Ae.value),console.log("参与者数量:",h.value.length),h.value.forEach(N=>{const R=document.getElementById(`video-${N.identity}`),z=document.getElementById(`participant-${N.identity}`);console.log(`参与者 ${N.identity}:`,{hasVideoTrack:!!N.videoTrack,hasVideoElement:!!R,hasParticipantElement:!!z,isInViewport:N.isInViewport,videoElementSrc:R?R.src:"N/A"})})},We=()=>{console.log("=== 手动触发视口检测 ==="),document.querySelectorAll('[id^="participant-"]').forEach(R=>{const z=R.getAttribute("data-identity"),J=R.getBoundingClientRect(),re=J.top>=0&&J.left>=0&&J.bottom<=window.innerHeight&&J.right<=window.innerWidth;if(console.log(`参与者 ${z} 手动检测:`,{rect:J,isInViewport:re,windowSize:{width:window.innerWidth,height:window.innerHeight}}),re&&U.value==="grid"){const ue=document.getElementById(`video-${z}`),ye=h.value.find(ge=>ge.identity===z);ye&&ye.videoTrack&&ue?(ye.videoTrack.attach(ue),console.log(`✅ 手动渲染视频: ${z}`)):console.log(`❌ 无法手动渲染视频: ${z}`,{hasParticipantData:!!ye,hasVideoTrack:ye?!!ye.videoTrack:!1,hasVideoElement:!!ue})}})},at=()=>{console.log("=== 检查中间三个参与者状态 ===");const N=document.querySelectorAll('[id^="participant-"]'),R=Array.from(N).map(ye=>{const ge=ye.getAttribute("data-identity"),me=ye.getBoundingClientRect();return{identity:ge,rect:me,element:ye}});R.sort((ye,ge)=>ye.rect.top-ge.rect.top);const z=3,J=z,re=z*2,ue=R.slice(J,re);console.log("中间行参与者:",ue.map(ye=>ye.identity)),ue.forEach(ye=>{const ge=ye.identity,me=document.getElementById(`video-${ge}`),tt=h.value.find(Je=>Je.identity===ge);if(console.log(`中间参与者 ${ge} 详细状态:`,{hasParticipantData:!!tt,hasVideoTrack:tt?!!tt.videoTrack:!1,hasVideoElement:!!me,videoTrackDetails:tt&&tt.videoTrack?{id:tt.videoTrack.id,kind:tt.videoTrack.kind,enabled:tt.videoTrack.enabled,muted:tt.videoTrack.muted,readyState:tt.videoTrack.readyState}:null,videoElementDetails:me?{src:me.src,currentSrc:me.currentSrc,readyState:me.readyState,videoWidth:me.videoWidth,videoHeight:me.videoHeight,paused:me.paused,ended:me.ended,error:me.error}:null}),tt&&tt.videoTrack&&me){const Je=ye.element.getBoundingClientRect(),kt=Je.top>=0&&Je.left>=0&&Je.bottom<=window.innerHeight&&Je.right<=window.innerWidth;console.log(`中间参与者 ${ge} 视口检查:`,{rect:Je,isInViewport:kt,windowSize:{width:window.innerWidth,height:window.innerHeight}}),kt&&!me.src&&!me.currentSrc&&(console.log(`🔧 强制渲染中间参与者: ${ge}`),tt.videoTrack.attach(me))}})},Et=()=>{console.log("=== 强制检查所有参与者视口状态 ==="),h.value.forEach(N=>{const R=document.getElementById(`participant-${N.identity}`),z=document.getElementById(`video-${N.identity}`);if(R&&z){const J=R.getBoundingClientRect(),re=J.top>=0&&J.left>=0&&J.bottom<=window.innerHeight&&J.right<=window.innerWidth;console.log(`参与者 ${N.identity} 强制检查:`,{isInViewport:re,hasVideoTrack:!!N.videoTrack,videoSrc:z.src,videoCurrentSrc:z.currentSrc,videoReadyState:z.readyState,videoWidth:z.videoWidth,videoHeight:z.videoHeight}),re&&N.videoTrack&&!z.src&&!z.currentSrc&&(console.log(`🔧 强制重新attach: ${N.identity}`),N.videoTrack.detach(),setTimeout(()=>{N.videoTrack.attach(z)},50))}})},nt=new _n;let Oe=null,pn=null,on=null,ln=null;const _i=l.computed(()=>Zg(Y.value)),Mt=l.computed(()=>h.value.length);ut.on("voiceMotivationChange",N=>{de.value=!!N}),ut.on("autoAnswerChange",N=>{Le.value=!!N}),ut.on("autoPollingToggle",N=>{if(Ve.value=!!N,N){try{const R=localStorage.getItem("hx_device_setter_settings");if(R){const z=JSON.parse(R);z&&typeof z.pollingIntervalMs=="number"&&z.pollingIntervalMs>0&&P_(z.pollingIntervalMs)}}catch(R){console.warn("读取轮询间隔设置失败",R)}Wu(!0)}else{try{Wu(!1)}catch(R){console.error("setPollingEnabled error:",R)}ut.emit("updateVisibleParticipants",{participants:(h.value||[]).slice(0,16),currentIndex:0,isPolling:!1,action:"replace"})}}),ut.on("pollingIntervalChange",N=>{try{P_(N),xl()}catch(R){console.warn("设置轮询间隔失败",R)}});const wt=l.computed(()=>u.value.length),li=l.computed(()=>d.value.length),Gr=l.computed(()=>Mt.value>0?h.value.findIndex(R=>R.isScreenShareEnabled):-1),nn=l.computed(()=>B.value==="pointTurn"?"point-turn":U.value==="grid"?Mt.value<=1?"grid1":Mt.value<=2?"grid2":Mt.value<=4?"grid3":Mt.value<=6?"grid4":"grid5":U.value);function ci(N){var ue;if(U.value!=="rightSide")return;const R=document.querySelector("#room .layout-rightside");if(!R)return;const z=5,J=[...N];let re=0;for(let ye=0;ye<J.length&&re<z;ye++){const ge=(ue=J[ye])==null?void 0:ue.identity;if(!ge)continue;const me=document.getElementById(`participant-${ge}`);me&&R.contains(me)&&(R.appendChild(me),re++)}}const ki=async N=>{var R,z;try{const J={display:N,org:n.org||"default",room:o.value},re=await HC(J,{baseUrl:n.meetingUrl,token:n.token});((R=re==null?void 0:re.data)==null?void 0:R.code)===0||(re==null?void 0:re.status)===200?(qn.value=N,nt.message("success","分发画面成功")):nt.message("error",((z=re==null?void 0:re.data)==null?void 0:z.msg)||"分发画面失败")}catch(J){console.error("分发画面失败",J),nt.message("error","分发画面失败,请稍后重试")}},Dt=async N=>{var R,z;try{const J={display:" ",org:n.org||"default",room:o.value},re=await HC(J,{baseUrl:n.meetingUrl,token:n.token});((R=re==null?void 0:re.data)==null?void 0:R.code)===0||(re==null?void 0:re.status)===200?(qn.value=null,nt.message("success","取消分发画面成功")):nt.message("error",((z=re==null?void 0:re.data)==null?void 0:z.msg)||"取消分发画面失败")}catch(J){console.error("取消分发画面失败",J),nt.message("error","取消分发画面失败,请稍后重试")}};function kg(N){if(U.value=N,Fe.value===p.value&&sa("switchLayout",{layout:N,focusedParticipant:be.value}).then(R=>{R.success?console.log("布局同步发送成功"):console.error("布局同步发送失败:",R.error)}).catch(R=>{console.error("布局同步发送异常:",R)}),N==="grid")l.nextTick(()=>{const R=document.querySelectorAll('[id^="participant-"]');console.log(`切换到宫格布局,设置观察器,参与者数量: ${R.length}`),R.forEach((z,J)=>{const re=z.getAttribute("data-identity");z.hasAttribute("data-observer-set")?console.log(`参与者 ${re} 已设置过观察器,跳过`):(Tr(z),z.setAttribute("data-observer-set","true"),console.log(`设置观察器 ${J+1}: ${re}`))}),setTimeout(()=>{ve(),We(),at(),Et()},100)});else{const R=document.querySelectorAll('[id^="participant-"]');console.log(`切换到其他布局,停止观察,参与者数量: ${R.length}`),R.forEach(z=>{zr(z),z.removeAttribute("data-observer-set");const J=z.getAttribute("data-identity"),re=z.querySelector("video");if(re&&J){const ue=h.value.find(ye=>ye.identity===J);ue&&ue.videoTrack&&(ue.videoTrack.attach(re),console.log(`恢复视频渲染: ${J}`))}})}}function oa(N){const R=document.getElementById("room");if(!R)return;R.style.position="relative",R.querySelectorAll('[id^="participant-"]').forEach(re=>{re.style.display="none"});const J=document.getElementById(`participant-${N}`);if(J){J.style.display="block",J.style.position="absolute",J.style.top="0",J.style.left="0",J.style.width="100%",J.style.height="100%",J.style.maxHeight="none",J.style.zIndex="99",J.style.margin="0",J.style.borderRadius="0";const re=J.querySelector("video");re&&(re.style.width="100%",re.style.height="100%",re.style.objectFit="cover",re.style.borderRadius="0");const ue=J.querySelector("canvas");ue&&(ue.style.width="100%",ue.style.height="100%",ue.style.objectFit="cover",ue.style.borderRadius="0");const ye=J.querySelector(".describe");ye&&(ye.style.position="absolute",ye.style.bottom="20px",ye.style.left="20px",ye.style.right="auto",ye.style.zIndex="1000")}}function Co(){const N=document.getElementById("room");if(!N)return;N.style.position="",N.querySelectorAll('[id^="participant-"]').forEach(z=>{z.style.display="block",z.style.position="",z.style.top="",z.style.left="",z.style.width="",z.style.height="",z.style.maxHeight="",z.style.zIndex="",z.style.margin="",z.style.borderRadius="";const J=z.querySelector("video");J&&(J.style.width="",J.style.height="",J.style.objectFit="",J.style.borderRadius="");const re=z.querySelector("canvas");re&&(re.style.width="",re.style.height="",re.style.objectFit="",re.style.borderRadius="");const ue=z.querySelector(".describe");ue&&(ue.style.position="",ue.style.bottom="",ue.style.left="",ue.style.right="",ue.style.zIndex="")})}function Qi(N){return y.value.ownerId===N}function Sr(N){if(Mt.value>0){let R=h.value.findIndex(z=>z.identity===N);return R>=0?R:-1}else return-1}function $t(N){if(li.value<=0)d.value.push(N);else{if(d.value.findIndex(z=>z.mobile===N.mobile)>-1)return;d.value.push(N)}}function Jl(N){if(N.audioTrack||N.videoTrack)if(Mt.value<=0)h.value.push(N);else{const R=Sr(N.identity);R!==-1?h.value.splice(R,1,N):h.value.push(N)}console.log(`参与者 ${N.identity} 已添加到数组,当前数组长度: ${h.value.length}`)}function xo(N){y.value.ownerId=N.hostId,y.value.ownerName=N.hostName}function Tg(N){if(Mt.value>0){let R=Sr(N);R!==-1&&h.value.splice(R,1)}}function Eo(){b.value=[],h.value.forEach(N=>{N.name.includes(v.value)&&b.value.push({identity:N==null?void 0:N.identity,name:N.name,audioLevel:N.audioLevel,isCameraEnabled:N.isCameraEnabled,isLocal:N.isLocal,isMicrophoneEnabled:N.isMicrophoneEnabled,isScreenShareEnabled:N.isScreenShareEnabled,isSpeaking:N.isSpeaking,sid:N.sid,metadata:N.metadata})})}function Sg(N){v.value=N,Eo()}function Fd(N){if(wt.value>0){let R=wo(N);R!==-1&&u.value.splice(R,1)}}function Ql(N){(wt.value<=0||wo(N.mobile)<0)&&u.value.push(N)}function wo(N){return wt.value>0?u.value.findIndex(z=>z.mobile===N):-1}function Vd(N){if(li.value>0){const R=d.value.findIndex(z=>z.mobile===N);R!==-1&&d.value.splice(R,1)}}function jd(N){return Mt.value>0?h.value.findIndex(z=>z.isScreenShareEnabled&&z.identity!==N):-1}function Cg(N){P.value.push(N)}function _s(N){if(Mt.value>0){const R=h.value.findIndex(z=>z.identity===N);return R>-1?h.value[R]:null}else return null}function la(){if(Mt.value>0){const N=h.value.findIndex(R=>R.isLocal);return N>-1?h.value[N]:null}else return null}const $d=N=>{const z=window.innerHeight,J=N.clientY,re=10;let ue;const ye=z-J,ge=J;ye>=268+re?ue=J+re+"px":ge>=268+re?ue=J-268-re+"px":ye>ge?ue=Math.max(10,z-268-10)+"px":ue=Math.min(J-re,10)+"px",ze.value={left:q.value?N.clientX-120+"px":N.clientX-400+"px",top:ue},Ke.value===N.identity&&le.value?le.value=!1:(le.value=!1,Ke.value=N.identity,le.value=!0)};function ca(N){var z;Vd(N.mobile),Fd(N.mobile);const R=u.value.map(J=>(J==null?void 0:J.classify)==="人员"?{roomName:o.value,roomAlias:a.value,userId:J.userId,userName:J.userName,officeName:J==null?void 0:J.officeName,metadata:JSON.stringify({classify:J==null?void 0:J.classify,phone:J==null?void 0:J.mobile})}:{roomName:o.value,roomAlias:a.value,userId:J.userId,userName:J.userName,officeName:J==null?void 0:J.officeName,metadata:JSON.stringify({phone:"",classify:J==null?void 0:J.classify,equipmentCode:J==null?void 0:J.mobile,equipmentPassword:J==null?void 0:J.equipmentPassword,equipmentType:J==null?void 0:J.equipmentType})});n.joinType==="launch"&&R.findIndex(re=>re.userId===n.userData.userId)<0&&R.push({roomName:o.value,roomAlias:a.value,userId:n.userData.userId,userName:n.userData.username,officeName:(z=n.userData)==null?void 0:z.officeName,metadata:JSON.stringify({classify:"人员",phone:n.userData.mobile})}),Qo(R,{baseUrl:n.baseUrl,token:n.token}).then(J=>{console.log("储存已邀请用户",J)})}const ua=()=>{le.value=!1},Cr=async()=>{try{const{audioDevices:N,videoDevices:R,outputDevices:z}=await lg.getDeviceList();k.value=N.map(J=>({label:J.label,value:J.deviceId})),D.value=R.map(J=>({label:J.label,value:J.deviceId})),w.value=z.map(J=>({label:J.label,value:J.deviceId}))}catch{nt.message("error","获取设备列表失败")}},qt=N=>{He.value.indexOf(N)<0&&He.value.push(N)},xg=()=>{pn&&(clearInterval(pn),pn=null),on&&(clearInterval(on),on=null),ln&&(clearInterval(ln),ln=null)},Hd=()=>{Be.value.length>0&&Be.value.forEach(N=>{N==null||N.detach(),N==null||N.stop()})},Eg=()=>{Oe&&He.value.length>0&&He.value.forEach(N=>{console.log("解除绑定事件:",N),Oe.off(N)})},da=()=>{Re.value=!0,r("multiMeetingClose")},Ti=async()=>{if(Oe){await Oe.leaveRoom();try{_e.value&&o.value&&await of(o.value,{baseUrl:n.baseUrl,token:n.token})}catch(N){console.error("delScheduleConf error",N)}}},Do=N=>{Qi(p.value)?Ie.value?Ie.value=!1:(it.value={left:N.target.offsetLeft-40+"px",bottom:N.target.offsetTop+60+"px"},Ie.value=!0):(_e.value=!1,Ti())},wg=N=>{Qi(p.value)?Ie.value?Ie.value=!1:(it.value={left:N.target.offsetLeft-140+"px",bottom:N.target.offsetTop+60+"px"},Ie.value=!0):(_e.value=!1,Ti())},Ao=async()=>{bi.value?(_e.value=!0,Ti()):Ev.confirm("点击结束会议后会议将被解散,您确定要这么做么?","警告",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then(()=>{_e.value=!0,Ti()}).catch(()=>{})},Zl=()=>{Mt.value<=1&&Qi(p.value)?Ao():_t.value=!0},Si=N=>{Oe.setParticipantToHost(N.ownerId,N.ownerName).then(()=>{console.log(`成功指派 ${N.ownerName} 为主持人`)}).catch(R=>{console.error(`指派 ${N.ownerName} 失败`,R)})},Dg=()=>{var R;if(!Oe||!(Oe!=null&&Oe.room))return;let N=null;switch((R=Oe.room)==null?void 0:R.localParticipant.connectionQuality){case"excellent":case"good":N="良好";break;case"poor":N="较差";break;case"lost":case"unknown":N="极差";break}m.value=N??"暂无"},ha=async()=>{let N={echoCancellation:!0,noiseSuppression:!0,roomNum:o.value,cameraStatus:ee.value,microphoneStatus:Ae.value,audioDeviceId:A.audioInputDevice,videoDeviceId:A.videoDevice,outputDeviceId:A.audioOutputDevice};console.log("调用SDK joinRoom时的设备参数:",{audioDeviceId:N.audioDeviceId,videoDeviceId:N.videoDeviceId,outputDeviceId:N.outputDeviceId});let R=null;try{R=await Oe.joinRoom(N),A&&R&&(!A.audioInputDevice&&R.audioInputDevice&&(A.audioInputDevice=R.audioInputDevice),!A.audioOutputDevice&&R.audioOutputDevice&&(A.audioOutputDevice=R.audioOutputDevice),!A.videoDevice&&R.videoInputDevice&&(A.videoDevice=R.videoInputDevice),console.log("activeDevice:",A))}catch(z){console.error("加入会议失败",z)}},fa=async N=>{var R;try{await py(o.value,N,{baseUrl:n.baseUrl,token:n.token});const z=await gy(o.value,{baseUrl:n.baseUrl,token:n.token}),J=(R=z==null?void 0:z.data)==null?void 0:R.msg;J&&await af({dnis:J,mute:!0,name:"重庆市卫健委",org:"default",room:o.value,type:6},{baseUrl:n.meetingUrl,token:n.token})}catch(z){console.error("scheduleConfAndCall error",z)}},ks=async N=>{if(!N||N.length===0)return;const R=N.filter(ue=>ue.proxy),z=N.filter(ue=>!ue.proxy),J=z.map(ue=>ue&&ue.uri?H8(o.value,[ue],{baseUrl:n.baseUrl,token:n.token}):Oe.makeCall(ue.userName,ue.mobile,Number(ue.equipmentType))),re=async(ue,ye=8)=>{let ge=0;const me=[],tt=Array.from({length:ye},async()=>{for(;ge<ue.length;){const Je=ge++,kt=ue[Je];let Zi=!1;for(let mn=1;mn<=1&&!Zi;mn++){try{const{data:Nn}=await af({name:kt.userName,dnis:kt.mobile,type:Number(kt.equipmentType),proxy:kt.proxy,org:n.org,room:o.value},{baseUrl:n.meetingUrl});if(Nn.code===200)Zi=!0,$t(kt),me[Je]={success:!0,item:kt};else if(Nn.code===500)console.warn(`外呼邀请失败 (${kt.userName}),状态码: 500,尝试重试 ${mn}/6`);else{console.error(`外呼邀请失败 (${kt.userName}),状态码: ${Nn.code}`),nt.message("error",`外呼邀请失败 (${kt.userName}): ${Nn.msg||"未知错误"}`),me[Je]={success:!1,item:kt,error:new Error(`Status code ${Nn.code}`)};break}}catch(Nn){console.error(`外呼邀请异常 (${kt.userName})`,Nn),mn===6&&(nt.message("error",`外呼邀请异常 (${kt.userName}): ${Nn.msg||"网络异常"}`),me[Je]={success:!1,item:kt,error:Nn})}!Zi&&mn<6&&await new Promise(Nn=>setTimeout(Nn,200*mn))}}});return await Promise.all(tt),me};try{const[ue,ye]=await Promise.all([Promise.allSettled(J),re(R,8)]),ge=ue.filter(Je=>Je.status==="rejected");ge.length>0&&(console.error(`无proxy设备邀请失败: ${ge.length}个`),ge.forEach((Je,kt)=>{const Zi=z[kt];nt.message("error",`设备邀请失败 (${Zi.userName}): ${Je.reason.message||"未知错误"}`)}));const me=ge.length+ye.filter(Je=>!Je.success).length,tt=N.length-me;me===0?nt.message("success",`所有设备邀请成功 (${tt}/${N.length})`):nt.message("warning",`设备邀请完成: ${tt}成功, ${me}失败`)}catch(ue){console.error("发送设备邀请失败:",ue),nt.message("error","发送设备邀请失败")}},Ts=()=>{hy({roomName:o.value},{baseUrl:n.baseUrl,token:n.token}).then(N=>{N.data.code===0?N.data.data.length>0?(u.value=N.data.data.filter(R=>JSON.parse(R.metadata).phone!==n.userData.mobile).map(R=>{const z=JSON.parse(R.metadata);return z.classify==="人员"?{classify:z.classify,userName:R.userName,userId:R.userId,mobile:z.phone,officeName:R.officeName,id:R.userId,label:R.userName,phone:z.phone}:{classify:z.classify,userName:R.userName,userId:R.userId,mobile:z.equipmentCode,officeName:R.officeName,phone:z.phone,equipmentCode:z.equipmentCode,equipmentPassword:z.equipmentPassword,equipmentType:z.equipmentType,id:R.userId,label:R.userName}}),d.value=u.value,console.log("已邀请人员",d.value,u.value)):(u.value=[],d.value=[]):(u.value=[],d.value=[])})},ec=N=>{if(N&&(N!=null&&N.identity)){const R=document.getElementById(`participant-${N.identity}`);if(R)if(B.value==="pointTurn"){if(!(N.identity===Fe.value||N.identity===be.value)){const z=document.querySelector("#room .point-turn-top"),J=document.querySelector("#room .point-turn-bottom"),re=document.querySelector("#room .point-turn-other");if(!z||!J||!re)return;if(R.parentElement)if(R.parentElement.className==="point-turn-top"){if(R.id===z.firstElementChild.id)return;z.insertBefore(R,z.firstChild??null)}else R.parentElement.className==="point-turn-bottom"?document.querySelectorAll(".point-turn-top .participant").length>=5&&(re.insertBefore(z.lastElementChild,re.firstChild??null),z.insertBefore(R,z.firstChild??null),J.insertBefore(re.firstChild,J.firstChild??null)):document.querySelectorAll(".point-turn-top .participant").length>=5&&document.querySelectorAll(".point-turn-bottom .participant").length>=5&&(re.insertBefore(J.lastElementChild,re.firstChild??null),J.insertBefore(z.lastElementChild,J.firstChild??null),z.insertBefore(R,z.firstChild??null))}}else{const z=document.getElementById("room");if(U.value==="grid"){if(R.id===z.firstElementChild.id)return;z.insertBefore(R,z.firstChild??null)}else if(U.value==="rightSide"){const J=document.querySelector("#room .layout-rightside"),re=document.querySelector("#room .layout-leftside");if(!re||!J)return;if(N.identity!==be.value){if(R.id===re.firstElementChild.id||R.id===J.firstElementChild.id)return;J.insertBefore(R,J.firstElementChild??null)}}}}else return},qd=N=>{let R=document.createElement("div");return R.id=`participant-${N.identity}`,R.className=N.isLocal?"participant local":"participant",R.setAttribute("data-identity",N.identity),R.setAttribute("data-is-in-viewport","false"),N.isScreenShareEnabled?R.innerHTML=`
340
+ <video id="video-${N.identity}" class="p-video" autoplay webkit-playsinline playsinline x5-video-player-type="h5"></video>
341
+ <div id="screenshare-${N.identity}" class="screen-share-suspension">
342
+ ${N.name} 正在共享屏幕
343
+ </div>
344
+ <div class="describe">
345
+ <div class="describe-left">
346
+ <div class="avatar"></div>
347
+ <div id="${N.identity}" class="identity">${N.isLocal?N.name+"(我)":N.name}</div>
348
+ </div>
349
+ <div class="tools">
350
+ <div id="microphone-${N.identity}" class="microphone"></div>
351
+ </div>
352
+ </div>
353
+ `:N.isCameraEnabled?R.innerHTML=`
354
+ <video id="video-${N.identity}" class="p-video" autoplay webkit-playsinline playsinline x5-video-player-type="h5"></video>
355
+ <div id="signal-${N.identity}" class="signal-icon signal-icon-good"></div>
356
+ <div id="more-${N.identity}" class="more-icon"></div>
357
+ <div class="describe">
358
+ <div class="describe-left">
359
+ <div class="avatar"></div>
360
+ <div id="${N.identity}" class="identity">${N.isLocal?N.name+"(我)":N.name}</div>
361
+ </div>
362
+ <div class="tools">
363
+ <div id="microphone-${N.identity}" class="microphone"></div>
364
+ </div>
365
+ </div>
366
+ `:R.innerHTML=`
367
+ <video id="video-${N.identity}" class="p-video" autoplay webkit-playsinline playsinline x5-video-player-type="h5"></video>
368
+ <div id="board-${N.identity}" class="board">
369
+ <div class="board-icon"></div>
370
+ </div>
371
+ <div id="signal-${N.identity}" class="signal-icon signal-icon-good"></div>
372
+ <div id="more-${N.identity}" class="more-icon"></div>
373
+ <div class="describe">
374
+ <div class="describe-left">
375
+ <div class="avatar"></div>
376
+ <div id="${N.identity}" class="identity">${N.isLocal?N.name+"(我)":N.name}</div>
377
+ </div>
378
+ <div class="tools">
379
+ <div id="microphone-${N.identity}" class="microphone"></div>
380
+ </div>
381
+ </div>
382
+ `,R},tc=(N,R,z)=>{if(B.value==="pointTurn"){let J=document.querySelector("#room .point-turn-top"),re=document.querySelector("#room .point-turn-center"),ue=document.querySelector("#room .point-turn-bottom"),ye=document.querySelector("#room .point-turn-other");if(J||(J=document.createElement("div"),J.className="point-turn-top",N.insertBefore(J,N.firstChild??null)),re||(re=document.createElement("div"),re.className="point-turn-center",N.appendChild(re)),ue||(ue=document.createElement("div"),ue.className="point-turn-bottom",N.appendChild(ue)),ye||(ye=document.createElement("div"),ye.className="point-turn-other",N.appendChild(ye)),Fe.value===z.identity)if(re.hasChildNodes()){let ge=document.querySelectorAll(".point-turn-center .participant");ge.length>0?ge.length===1?re.insertBefore(R,re.firstChild??null):ge[0].id?(document.querySelectorAll(".point-turn-top .participant").length>=5?document.querySelectorAll(".point-turn-bottom .participant").length>=5?ye.appendChild(ge[0]):ue.appendChild(ge[0]):J.appendChild(ge[0]),re.insertBefore(R,re.firstChild??null)):(re.removeChild(ge[0]),re.insertBefore(R,re.firstChild??null)):re.insertBefore(R,re.firstChild??null)}else re.appendChild(R);else if(be.value===z.identity)if(re.hasChildNodes()){let ge=document.querySelectorAll(".point-turn-center .participant");ge.length>0?ge.length===1?re.appendChild(R):ge[1].id?(document.querySelectorAll(".point-turn-top .participant").length>=5?document.querySelectorAll(".point-turn-bottom .participant").length>=5?ye.appendChild(ge[1]):ue.appendChild(ge[1]):J.appendChild(ge[1]),re.appendChild(R)):(re.removeChild(ge[1]),re.appendChild(R)):re.appendChild(R)}else re.appendChild(R);else document.querySelectorAll(".point-turn-top .participant").length>=5?document.querySelectorAll(".point-turn-bottom .participant").length>=5?ye.appendChild(R):ue.appendChild(R):J.appendChild(R)}else if(U.value==="grid")z.isLocal?N.insertBefore(R,N.firstChild??null):N.appendChild(R);else if(U.value==="rightSide"){let J=document.querySelector("#room .layout-rightside"),re=document.querySelector("#room .layout-leftside");re||(re=document.createElement("div"),re.className="layout-leftside",N.insertBefore(re,N.firstChild??null)),J||(J=document.createElement("div"),J.className="layout-rightside",N.appendChild(J)),be.value&&be.value===z.identity?re.hasChildNodes()&&(J.insertBefore(re.firstChild,J.firstChild??null),re.appendChild(R)):z.isLocal?(re.hasChildNodes()&&J.insertBefore(re.firstChild,J.firstChild??null),re.appendChild(R)):J.appendChild(R)}return N},Io=N=>{U.value=N,Fe.value===p.value&&sa("switchLayout",{layout:N,focusedParticipant:be.value}).then(R=>{R.success?console.log("布局同步发送成功"):console.error("布局同步发送失败:",R.error)}).catch(R=>{console.error("布局同步发送异常:",R)})},Ag=N=>{console.log(`与会者渲染 ${N.identity}`,N),N.isLocal&&(p.value=N.identity,f.value=N.name,ee.value=N.isCameraEnabled,Ae.value=N.isMicrophoneEnabled,fe.value=N.isScreenShareEnabled,console.log("本地用户渲染,更新设备状态:",{camera:ee.value,microphone:Ae.value,screenShare:fe.value})),!Fe.value&&Qi(N.identity)&&!N.remove&&(Fe.value=N.identity);let R=document.getElementById("room");if(!R){nt.message("error","会议容器不存在");return}let z=document.getElementById(`participant-${N.identity}`);if(!z&&!N.remove&&(N.audioTrack||N.videoTrack)){if(z=qd(N),R=tc(R,z,N),Jl(N),d.value.length>0){const mt=d.value.findIndex(cn=>cn.classify!=="人员"&&"sip_"+cn.mobile===N.identity);mt!==-1&&Oe.updateParticipantName(N.identity,d.value[mt].userName)}if(u.value.length>0){const mt=u.value.findIndex(cn=>cn.mobile==N.identity);mt!==-1&&Oe.updateParticipantName(N.identity,u.value[mt].userName)}u.value.forEach(mt=>{console.log("静音监控"),mt.mobile==N.identity&&mt.type=="监控/监控1"&&Oe.changeParticipantMicrophoneStatus(N.identity,!0)})}let J=document.getElementById(`video-${N.identity}`),re=document.getElementById(`board-${N.identity}`),ue=document.getElementById(`microphone-${N.identity}`),ye=document.getElementById(`signal-${N.identity}`),ge=document.getElementById(`more-${N.identity}`);const me=async()=>{Oe.changeParticipantMicrophoneStatus(N.identity,!0);try{const mt={owner:"administrators",org:"default",room:o.value,identity:N.identity,input:1,cmd:!0};await So(mt,{baseUrl:n.meetingUrl,token:n.token})}catch(mt){console.error("muteParticipant (unableMicrophone) error:",mt)}},tt=async()=>{console.log("micro click -> unmute (false)",N.identity),Oe.changeParticipantMicrophoneStatus(N.identity,!1);try{const mt={owner:"administrators",org:"default",room:o.value,identity:N.identity,input:1,cmd:!1};await So(mt,{baseUrl:n.meetingUrl,token:n.token})}catch(mt){console.error("muteParticipant (enableMicrophone) error:",mt)}},Je=()=>{ye&&(ye.style.visibility="visible"),ge&&(ge.style.visibility="visible")},kt=()=>{ye&&(ye.style.visibility="hidden"),ge&&(ge.style.visibility="hidden")},Zi=mt=>{ze.value={left:mt.clientX-110+"px",top:mt.clientY+35+"px"},Ke.value===N.identity&&le.value?le.value=!1:(le.value=!1,Ke.value=N.identity,le.value=!0)};ue&&N.isMicrophoneEnabled?(ue.className="microphone microphone-active",ue.onclick=me):ue&&!N.isMicrophoneEnabled&&(ue.className="microphone microphone-inactive",ue.onclick=tt),z&&(z.onmouseenter=Je,z.onmouseleave=kt),ge&&(ge.onclick=Zi),ye&&(N.connectionQuality==="excellent"||N.connectionQuality==="good"?ye.className="signal-icon signal-icon-good":ye.className="signal-icon signal-icon-poor");let mn=document.getElementById(`screenshare-${N.identity}`);if(N.isScreenShareEnabled)mn||(mn=document.createElement("div"),mn.id=`screenshare-${N.identity}`,mn.className="screen-share-suspension",mn.innerHTML=`${N.name} 正在共享屏幕`,z&&z.appendChild(mn)),re&&(z&&z.removeChild(re),re=null),ye&&(z&&z.removeChild(ye),ye=null),ge&&(z&&z.removeChild(ge),ge=null);else if(N.isCameraEnabled)mn&&(z&&z.removeChild(mn),mn=null),re&&(z&&z.removeChild(re),re=null),ye||(ye=document.createElement("div"),ye.id=`signal-${N.identity}`,N.connectionQuality==="excellent"||N.connectionQuality==="good"?ye.className="signal-icon signal-icon-good":ye.className="signal-icon signal-icon-poor",z&&z.appendChild(ye)),ge||(ge=document.createElement("div"),ge.id=`more-${N.identity}`,ge.className="more-icon",z&&z.appendChild(ge));else{if(!re){re=document.createElement("div"),re.id=`board-${N.identity}`,re.className="board";let mt=document.createElement("div");mt.className="board-icon",re.appendChild(mt),z&&(z==null||z.appendChild(re))}mn&&(z&&z.removeChild(mn),mn=null)}if(N.remove){if(J&&(J.srcObject=null,J.src="",J.remove()),z&&z.remove(),Tg(N.identity),Eo(),B.value==="pointTurn")if(N.identity===Fe.value){const mt=document.querySelector("#room .point-turn-center"),cn=document.createElement("div");cn.className="participant",cn.innerHTML=aa,mt.insertBefore(cn,mt.firstChild??null),Fe.value===be.value?Fe.value=be.value=null:Fe.value=null}else if(N.identity===be.value){let mt=document.createElement("div"),cn=document.querySelector("#room .point-turn-center");mt.className="participant",mt.innerHTML=aa,cn.appendChild(mt),be.value=null}else{let mt=document.querySelector("#room .point-turn-top"),cn=document.querySelector("#room .point-turn-bottom"),Xr=document.querySelector("#room .point-turn-other"),uh=mt.children.length,rc=cn.children.length,sc=Xr.children.length;uh<5?rc>0?mt.appendChild(cn.firstElementChild):sc>0&&mt.appendChild(Xr.firstChild):rc<5&&sc>0&&cn.appendChild(Xr.firstChild)}else U.value==="rightSide"&&be.value&&be.value===N.identity&&Io("grid"),be.value===N.identity&&(Fe.value===be.value?Fe.value=be.value=null:be.value=null);N.videoTrack&&N.videoTrack.detach(),N.audioTrack&&N.audioTrack.detach();return}if(N.isScreenShareEnabled&&B.value!=="pointTurn"){if(U.value==="grid")jd(N.identity)!==-1||(Yn.value=!0,Tt.value=U.value,be.value=N.identity,Io("rightSide"));else if(U.value==="rightSide"&&jd(N.identity)===-1){Yn.value=!0,Tt.value=U.value,be.value=N.identity;const mt=document.querySelector("#room .layout-rightside"),cn=document.querySelector("#room .layout-leftside");if(z&&cn){let Xr=null;for(;Xr=cn.firstChild;)Xr&&mt&&mt.appendChild(Xr);cn.insertBefore(z,cn.firstChild??null)}}}Dg(),N.videoTrack&&(U.value==="grid"?(console.log(`参与者 ${N.identity} 在宫格布局中,延迟设置交叉观察器`),setTimeout(()=>{const mt=document.getElementById(`participant-${N.identity}`);mt&&!mt.hasAttribute("data-observer-set")&&(Tr(mt),mt.setAttribute("data-observer-set","true"),console.log(`延迟为参与者 ${N.identity} 设置交叉观察器`))},200)):N.videoTrack.attach(J)),N.isLocal||N.audioTrack&&N.audioTrack.attach(J);let Nn=document.getElementById(N.identity);Nn&&(Nn.innerHTML=N.isLocal?N.name+"(我)":N.name);const ch=h.value.findIndex(mt=>mt.identity===N.identity);ch===-1?(Jl(N),Eo()):(h.value.splice(ch,1,N),console.log(`更新参与者数据: ${N.identity}`),Eo()),N.isLocal&&(ee.value!==N.isCameraEnabled&&console.log(`本地摄像头状态变化: ${ee.value} -> ${N.isCameraEnabled}`),Ae.value!==N.isMicrophoneEnabled&&console.log(`本地麦克风状态变化: ${Ae.value} -> ${N.isMicrophoneEnabled}`)),B.value==="normal"&&Gr===-1&&Yn.value&&(Io(Tt.value),Yn.value=!1),Mt.value>=1&&(JSON.parse(Oe.room.metadata),Hr.value&&(on&&(clearInterval(on),on=null),on=setInterval(()=>{Y.value++,Hr.value=!1},1e3)))},Ig=()=>{if(!Oe){nt.message("error","liveClient初始化失败");return}if(Oe._eventsInitialized){console.log("liveClient事件已初始化,跳过重复注册");return}console.log("开始注册liveClient事件监听器"),Oe.on("errorPush",N=>{qt("errorPush"),console.error("出错位置"+N.type+":",N.message),nt.message("error",N.message)}),Oe.on("socketOpen",()=>{qt("socketOpen"),nt.message("success","链接建立成功")}),Oe.on("roomCreatedSuccess",async N=>{qt("roomCreatedSuccess"),nt.message("success","会议房间创建成功"),o.value=N,$r.meetingStore&&($r.meetingStore.meetingNum=N),await ha();try{await YC(),JC(),console.log("会议房间创建后,布局同步初始化成功")}catch(R){console.error("会议房间创建后,布局同步初始化失败:",R)}}),Oe.on("roomCreatedFail",N=>{qt("roomCreatedFail"),nt.message("error","会议房间创建失败")}),Oe.on("joinRoomError",N=>{qt("joinRoomError"),console.error("加入房间失败",N),$e.value=!1,nt.message("error","加入房间失败")}),Oe.on("roomConnected",async N=>{var R,z,J,re;if(qt("roomConnected"),Oe.room){const ue=JSON.parse(Oe.room.metadata);console.log("metadata222:",ue,ue.owner),a.value=ue.roomAlias,c.value=ue.creator??"暂无",y.value=ue.owner,ue.display&&ue.display.trim()!==""&&!Qi(p.value)&&(qn.value=ue.display,console.log("检测到分发画面设置:",ue.display),oa(ue.display))}(R=n.userData)!=null&&R.username&&Oe.updateParticipantName(n.userData.mobile,n.userData.username),pn=setInterval(()=>{_.value=navigator.connection.rtt},1e3),S.value=`${n.h5Url}?roomNum=${o.value}&tenantId=${n.org}&userName=${n.userData.username}&mobile=${n.userData.mobile}`,console.log("joinType",n.joinType);try{const ue=await my(o.value,{baseUrl:n.baseUrl,token:n.token});((z=ue==null?void 0:ue.data)==null?void 0:z.code)===0&&Array.isArray((J=ue==null?void 0:ue.data)==null?void 0:J.data)&&u.value.push(...ue.data.data)}catch(ue){console.error("queryConfSitesStatus error",ue)}if(setTimeout(()=>{Po()},2e3),n.joinType==="launch"){if(u.value=n.tempInviteList,wt.value>0){const ue=u.value.filter(me=>(me==null?void 0:me.classify)==="人员"),ye=u.value.filter(me=>(me==null?void 0:me.classify)!=="人员");if(ue.length>0){if(n.wxOfficial)for(let me=0;me<ue.length;me++)ah(ue[me]);else if(n.isCustomizeMiniInvitations)r("inviteMessageSend",{inviteUserList:ue,meetingName:a.value,meetingNum:o.value,fromUser:n.userData.username});else for(let me=0;me<ue.length;me++){if(n.defaultInviteWay==="mini")try{const tt=await Wr(ue[me].userName,ue[me].mobile),Je=await sf([{roomName:a.value,userName:ue[me].userName,phone:ue[me].mobile,message:tt.messageTemplate}],{baseUrl:n.baseUrl,token:n.token});console.log("成功发送短信链接与语音播报",tt,Je)}catch(tt){console.error("发送语音播报失败",tt)}else ya(ue[me].mobile);me>0&&(me+1)%10===0&&await ba(500)}ue.forEach(me=>{$t(me)})}ks(ye);const ge=u.value.map(me=>(me==null?void 0:me.classify)==="人员"?{roomName:o.value,roomAlias:a.value,userId:me.userId,userName:me.userName,officeName:me==null?void 0:me.officeName,metadata:JSON.stringify({classify:me==null?void 0:me.classify,phone:me==null?void 0:me.mobile})}:{roomName:o.value,roomAlias:a.value,userId:me.userId,userName:me.userName,officeName:me==null?void 0:me.officeName,metadata:JSON.stringify({phone:"",classify:me==null?void 0:me.classify,equipmentCode:me==null?void 0:me.mobile,equipmentPassword:me==null?void 0:me.equipmentPassword,equipmentType:me==null?void 0:me.equipmentType})});n.joinType==="launch"&&ge.findIndex(tt=>tt.userId===n.userData.userId)<0&&ge.push({roomName:o.value,roomAlias:a.value,userId:n.userData.userId,userName:n.userData.username,officeName:(re=n.userData)==null?void 0:re.officeName,metadata:JSON.stringify({classify:"人员",phone:n.userData.mobile})}),Qo(ge,{baseUrl:n.baseUrl,token:n.token}).then(me=>{console.log("储存已邀请用户",me)})}}else Ts();$e.value=!0}),Oe.on("setHostSuccess",async N=>{if(qt("setHostSuccess"),console.log("主持人添加成功",N),xo(N),Fe.value!==y.value.ownerId){await l.nextTick();let R=l.toValue(Fe);Fe.value=y.value.ownerId,console.log("修改前主持人",R),console.log("修改后主持人",Fe.value);let z=document.getElementById(`participant-${Fe.value}`);if(B.value==="pointTurn"){const J=document.querySelector("#room .point-turn-top"),re=document.querySelector("#room .point-turn-center"),ue=document.querySelector("#room .point-turn-bottom"),ye=document.querySelector("#room .point-turn-other");let ge=J.children.length,me=ue.children.length,tt=ye.children.length;if(re.hasChildNodes()){let Je=re.children;if(console.log("childNodes",Je),Fe.value===be.value)if(Je[0].id){document.querySelectorAll(".point-turn-top .participant").length>=5?document.querySelectorAll(".point-turn-bottom .participant").length>=5?ye.appendChild(Je[0]):ue.appendChild(Je[0]):J.appendChild(Je[0]),re.insertBefore(z,re.firstElementChild??null);let kt=document.createElement("div");kt.className="participant",kt.innerHTML=aa,re.appendChild(kt)}else re.insertBefore(z,re.firstElementChild??null);else Je[0].id?(document.querySelectorAll(".point-turn-top .participant").length>=5?document.querySelectorAll(".point-turn-bottom .participant").length>=5?ye.appendChild(Je[0]):ue.appendChild(Je[0]):J.appendChild(Je[0]),re.insertBefore(z,re.firstElementChild??null)):(re.removeChild(Je[0]),re.insertBefore(z,re.firstElementChild??null))}else{re.insertBefore(z,re.firstElementChild??null);let Je=document.createElement("div");Je.className="participant",Je.innerHTML=aa,re.appendChild(Je)}ge<5?me>0?J.appendChild(ue.firstElementChild):tt>0&&J.appendChild(ye.firstChild):me<5&&tt>0&&ue.appendChild(ye.firstChild)}}}),Oe.on("roomMetadataChanged",N=>{console.log("roomMetadataChanged",N,JSON.parse(N));const R=JSON.parse(N);Qi(p.value)||(R.display&&R.display.trim()!==""&&R.display!==qn.value?(qn.value=R.display,console.log("分发画面已更新:",R.display),oa(R.display)):(!R.display||R.display.trim()==="")&&qn.value&&(qn.value=null,console.log("分发画面已取消"),Co()))}),Oe.on("roomDisconnected",()=>{if(qt("roomDisconnected"),nt.message("info","房间链接已断开"),$e.value=!1,xg(),Hd(),Oe){Oe._eventsInitialized=!1;try{Oe.removeAllListeners()}catch(N){console.warn("清理liveClient事件监听器失败:",N)}}_e.value?Oe.deleteRoom(n.userData.mobile).then(()=>{da()}).catch(N=>{da()}):da()}),Oe.on("localCameraChange",N=>{qt("localCameraChange"),ee.value=N,ee.value?nt.message("success","摄像头已开启"):nt.message("success","摄像头已关闭")}),Oe.on("localMicrophoneChange",N=>{qt("localMicrophoneChange"),Ae.value=N,Ae.value?nt.message("success","麦克风已开启"):nt.message("success","麦克风已关闭")}),Oe.on("localScreenShareChange",N=>{qt("localScreenShareChange"),fe.value=N,fe.value?nt.message("success","屏幕共享已开启"):nt.message("success","屏幕共享已关闭")}),Oe.on("startRecording",N=>{qt("startRecording"),xe.value=!0,Ne.value=N,nt.message("success","开始录制")}),Oe.on("stopRecording",N=>{qt("stopRecording"),xe.value=!1,nt.message("success","结束录制")}),Oe.on("requestDeviceOpen",N=>{qt("requestDeviceOpen"),N.input=="1"?nt.message("info","房主请求您开启麦克风"):N.input=="2"&&nt.message("info","房主请求您开启摄像头")}),Oe.on("mediaDeviceChange",async N=>{qt("mediaDeviceChange");const R=!W.value&&!ae.value,z=x.audioInputDevice||x.audioOutputDevice||x.videoDevice;let J=!1;if((N.kind==="audioinput"&&x.audioInputDevice&&N.deviceId!==x.audioInputDevice||N.kind==="audiooutput"&&x.audioOutputDevice&&N.deviceId!==x.audioOutputDevice||N.kind==="videoinput"&&x.videoDevice&&N.deviceId!==x.videoDevice)&&(J=!0),R&&z||J){setTimeout(async()=>{if(console.log("=== 开始恢复用户选择的设备 ==="),x.audioInputDevice&&N.kind==="audioinput"){console.log("恢复用户选择的麦克风设备:",x.audioInputDevice);try{await Oe.changeAudioDevice(x.audioInputDevice),A.audioInputDevice=x.audioInputDevice,console.log("麦克风设备恢复成功")}catch(re){console.error("麦克风设备恢复失败:",re)}}if(x.audioOutputDevice&&N.kind==="audiooutput"){console.log("恢复用户选择的扬声器设备:",x.audioOutputDevice);try{await Oe.changeOutputDevice(x.audioOutputDevice),A.audioOutputDevice=x.audioOutputDevice,console.log("扬声器设备恢复成功")}catch(re){console.error("扬声器设备恢复失败:",re)}}if(x.videoDevice&&N.kind==="videoinput"){console.log("恢复用户选择的摄像头设备:",x.videoDevice);try{await Oe.changeVideoDevice(x.videoDevice),A.videoDevice=x.videoDevice,console.log("摄像头设备恢复成功")}catch(re){console.error("摄像头设备恢复失败:",re)}}console.log("=== 设备恢复完成 ===")},100),console.log("=== mediaDeviceChange 事件结束(延迟恢复) ===");return}if(N.kind=="audioinput"){if(x.audioInputDevice&&R&&N.deviceId!==x.audioInputDevice){console.log("用户已选择麦克风设备,忽略系统自动切换");return}A.audioInputDevice!==N.deviceId?(console.log("麦克风设备变更:",A.audioInputDevice,"->",N.deviceId),A.audioInputDevice=N.deviceId,nt.message("success","设备切换成功"),await Cr()):console.log("麦克风设备未变更,跳过更新")}else if(N.kind=="videoinput"){if(x.videoDevice&&R&&N.deviceId!==x.videoDevice){console.log("用户已选择摄像头设备,忽略系统自动切换");return}A.videoDevice!==N.deviceId?(console.log("摄像头设备变更:",A.videoDevice,"->",N.deviceId),A.videoDevice=N.deviceId,nt.message("success","设备切换成功"),await Cr()):console.log("摄像头设备未变更,跳过更新")}else{if(x.audioOutputDevice&&R&&N.deviceId!==x.audioOutputDevice){console.log("用户已选择扬声器设备,忽略系统自动切换");return}A.audioOutputDevice!==N.deviceId?(console.log("扬声器设备变更:",A.audioOutputDevice,"->",N.deviceId),A.audioOutputDevice=N.deviceId,nt.message("success","设备切换成功"),await Cr()):console.log("扬声器设备未变更,跳过更新")}}),Oe.on("sendTextFailed",N=>{qt("sendTextFailed"),nt.message("error","e")}),Oe.on("sendTextSuccess",async N=>{qt("sendTextSuccess"),await l.nextTick(),Jn.value&&Jn.value.clearInputContent(),Ri.value&&Ri.value.clearInput()}),Oe.on("messageReceived",N=>{qt("sendTextSuccess"),N.timestamp=Zn().format("HH:mm"),Cg(N)}),Oe.on("videoCallRender",N=>{qt("videoCallRender"),Ag(N)}),Oe.on("activeSpeakerChange",N=>{if(qt("activeSpeakerChange"),N.length>0){let R=0,z=-1;if(N.forEach((J,re)=>{J.audioLevel>R&&(R=J.audioLevel,z=re)}),z>=0){const J=N[z];ec(J);try{const{setVoiceActivatedIdentity:re}=require("../utils/autoPolling.js");typeof re=="function"&&re(J.identity)}catch{}try{ut.emit("voiceActivated",J)}catch(re){console.warn("emit voiceActivated failed",re)}}}}),Oe.on("makeCallSuccess",()=>{qt("makeCallSuccess"),nt.message("success","外呼邀请发送成功"),Ot.value=!1}),Oe._eventsInitialized=!0,console.log("liveClient事件监听器注册完成")},pa=()=>{if(Oe&&Oe._eventsInitialized){console.log("liveClient已初始化,跳过重复初始化");return}if(Oe&&!Oe._eventsInitialized){console.log("检测到liveClient状态异常,重新初始化");try{Oe.removeAllListeners()}catch(N){console.warn("清理异常liveClient失败:",N)}}Oe=window.liveClient,Ig()},zd=async()=>{Oe&&await Oe.createRoom()},Pg=async()=>{await Oe.startRecord()},Gd=async()=>{await Oe.stopRecord()},Ng=()=>{ut.emit("getaddressBookUserForMeeting",{isInner:!0,clearData:!0})},Wd=()=>{ut.emit("getaddressBookUserForMeeting",{isInner:!0,isVolte:!0})},nc=async(N=[])=>{if(n.isCustomizeMiniInvitations)r("inviteMessageSend",{inviteUserList:N,meetingName:a.value,meetingNum:o.value,fromUser:n.userData.username});else for(let R=0;R<N.length;R++){if(n.defaultInviteWay==="mini")try{const z=await Wr(N[R].userName,N[R].mobile),J=await sf([{roomName:a.value,userName:N[R].userName,phone:N[R].mobile,message:z.messageTemplate}],{baseUrl:n.baseUrl,token:n.token});console.log("成功发送短信链接与语音播报",z,J)}catch(z){console.error("发送语音播报失败",z)}else ya(N[R].mobile);R>0&&(R+1)%10===0&&await ba(500)}N.forEach(R=>{$t(R)})},Po=async()=>{var N;try{const R=await gy(o.value,{baseUrl:n.baseUrl,token:n.token}),z=(N=R==null?void 0:R.data)==null?void 0:N.msg;console.log(z,"dnis"),z&&af({dnis:z,mute:!0,name:"重庆市卫健委",org:"default",room:o.value,type:6},{baseUrl:n.meetingUrl,token:n.token})}catch(R){console.error("getScheduleConfCode error",R)}},No=async N=>{var ye;u.value=N;let R=[],z=-1;u.value.forEach(ge=>{li.value>0?(z=d.value.findIndex(me=>me.mobile===ge.mobile),z<0&&R.push(ge)):R.push(ge)}),console.log("本次追加邀请人员",R);const J=R.filter(ge=>(ge==null?void 0:ge.classify)==="人员"),re=R.filter(ge=>ge&&ge.uri),ue=R.filter(ge=>(ge==null?void 0:ge.classify)!=="人员"&&!(ge!=null&&ge.uri));if(J.length>0&&nc(J),ks(ue),re.length>0&&await fa(re),wt.value>0){const me=u.value.filter(tt=>!(tt!=null&&tt.uri)).map(tt=>(tt==null?void 0:tt.classify)==="人员"?{roomName:o.value,roomAlias:a.value,userId:tt.userId,userName:tt.userName,officeName:tt.officeName,metadata:JSON.stringify({classify:tt.classify,phone:tt.mobile})}:{roomName:o.value,roomAlias:a.value,userId:tt.userId,userName:tt.userName,officeName:tt.officeName,metadata:JSON.stringify({phone:"",classify:tt==null?void 0:tt.classify,equipmentCode:tt==null?void 0:tt.mobile,equipmentPassword:tt==null?void 0:tt.equipmentPassword,equipmentType:tt==null?void 0:tt.equipmentType})});n.joinType==="launch"&&me.findIndex(Je=>Je.userId===n.userData.userId)<0&&me.push({roomName:o.value,roomAlias:a.value,userId:n.userData.userId,userName:n.userData.username,officeName:(ye=n.userData)==null?void 0:ye.officeName,metadata:JSON.stringify({classify:"人员",phone:n.userData.mobile})}),Qo(me,{baseUrl:n.baseUrl,token:n.token}).then(tt=>{console.log("储存已邀请用户",tt)})}},Kd=N=>{nc([N])},ic=async(N,R)=>{if(!R){nt("error","设备id不存在");return}if(N=="audioinput")await Oe.changeAudioDevice(R);else if(N=="audiooutput")await Oe.changeOutputDevice(R);else if(N=="videoinput")await Oe.changeVideoDevice(R);else return},Og=async N=>{await ic("audioinput",N),x.audioInputDevice=N,W.value=!1},Xd=async N=>{await ic("audiooutput",N),x.audioOutputDevice=N,W.value=!1},Yd=async N=>{await ic("videoinput",N),x.videoDevice=N,ae.value=!1},Mg=async()=>{oe.value||(oe.value=!0,await l.nextTick(),await l.nextTick()),ut.emit("getDeviceSetter",{type:0,tempActive:A})},Jd=N=>{B.value=N,Ee.value=!1,Fe.value===p.value&&sa("switchMode",{roomMode:N}).then(R=>{R.success?console.log("模式切换同步发送成功"):console.error("模式切换同步发送失败:",R.error)}).catch(R=>{console.error("模式切换同步发送异常:",R)})},Rg=async()=>{await Oe.changeCameraStatus();try{const N={owner:"administrators",org:"default",room:o.value,identity:p.value,input:2,cmd:!ee.value};await So(N,{baseUrl:n.meetingUrl,token:n.token})}catch(N){console.error("调用muteParticipant接口失败:",N)}},Lg=async()=>{await Oe.changeMicrophoneStatus(),await new Promise(N=>setTimeout(N,100));try{const N={owner:"administrators",org:"default",room:o.value,identity:p.value,input:1,cmd:!Ae.value},R=await So(N,{baseUrl:n.meetingUrl,token:n.token})}catch(N){console.error("调用muteParticipant接口失败:",N)}},Qd=async()=>{await Oe.changeScreenShareStatus()},Zd=N=>{Oe.sendMessage(N,f.value)},Bg=()=>{h.value=[],ee.value=n.tempCameraStatus,Ae.value=n.tempMicroStatus,n.tempActiveDevice&&(n.tempActiveDevice.audioInputDevice&&(A.audioInputDevice=n.tempActiveDevice.audioInputDevice,x.audioInputDevice=n.tempActiveDevice.audioInputDevice),n.tempActiveDevice.audioOutputDevice&&(A.audioOutputDevice=n.tempActiveDevice.audioOutputDevice,x.audioOutputDevice=n.tempActiveDevice.audioOutputDevice),n.tempActiveDevice.videoDevice&&(A.videoDevice=n.tempActiveDevice.videoDevice,x.videoDevice=n.tempActiveDevice.videoDevice),console.log("会议组件接收到的设备参数:",n.tempActiveDevice),console.log("初始化后的activeDevice:",A),console.log("用户选择的设备:",x))},eh=async N=>{if(Oe){const R=!N.isMute,z=N.isMute;Oe.changeParticipantCameraStatus(N.identity,z);try{const J={owner:"administrators",org:"default",room:o.value,identity:N.identity,input:2,cmd:z};await So(J,{baseUrl:n.meetingUrl,token:n.token});const re=h.value.findIndex(ue=>ue.identity===N.identity);re!==-1&&(h.value[re].isCameraEnabled=R,console.log(`手动更新参与者 ${N.identity} 摄像头状态为: ${R}`))}catch(J){console.error("调用muteParticipant接口失败:",J)}}},Oo=async N=>{if(Oe){const R=!N.isMute,z=N.isMute;Oe.changeParticipantMicrophoneStatus(N.identity,z);try{const J={owner:"administrators",org:"default",room:o.value,identity:N.identity,input:1,cmd:z};await So(J,{baseUrl:n.meetingUrl,token:n.token});const re=h.value.findIndex(ue=>ue.identity===N.identity);re!==-1&&(h.value[re].isMicrophoneEnabled=R,console.log(`手动更新参与者 ${N.identity} 麦克风状态为: ${R}`))}catch(J){console.error("调用muteParticipant接口失败:",J)}}},Ug=()=>{Mt.value>0&&h.value.forEach(N=>{Qi(N.identity)||N.isCameraEnabled&&eh({identity:N.identity,isMute:!0})})},th=async()=>{Mt.value>0&&h.value.forEach(N=>{Qi(N.identity)||N.isMicrophoneEnabled&&Oo({identity:N.identity,isMute:!0})})},ma=async(N,R=!1)=>{if(B.value==="pointTurn"){if(Fe.value&&Fe.value===N&&!R){nt.message("info","当前与会者已被设置为主持人,暂无法设为焦点");return}if(be.value&&be.value===N){nt.message("info","当前与会者已被设置为焦点");return}be.value=N,Fe.value===p.value&&sa("setFocus",{focusedParticipant:N}).then(ue=>{ue.success?console.log("聚焦同步发送成功"):console.error("聚焦同步发送失败:",ue.error)}).catch(ue=>{console.error("聚焦同步发送异常:",ue)}),await l.nextTick();const z=document.querySelector("#room .point-turn-center"),J=document.getElementById(`participant-${be.value}`);let re=null;if(J&&(re=J.parentElement,console.log("焦点元素的父元素",re,re.className),z)){if(z.children.length<2){if(z.appendChild(J),re&&re.className!=="point-turn-other"){const ue=document.querySelector("#room .point-turn-other");ue&&ue.children.length>0&&re.appendChild(ue.firstChild)}}else if(z.lastChild.id)re&&(re.appendChild(z.lastChild),z.appendChild(J));else if(z.removeChild(z.lastChild),z.appendChild(J),re&&re.className!=="point-turn-other"){const ue=document.querySelector("#room .point-turn-other");ue&&ue.children.length>0&&re.appendChild(J)}}}else if(U.value==="rightSide"){if(be.value&&be.value===N){nt.message("info","当前与会者已被设置为焦点");return}be.value=N,Fe.value===p.value&&sa("setFocus",{focusedParticipant:N}).then(ue=>{ue.success?console.log("聚焦同步发送成功"):console.error("聚焦同步发送失败:",ue.error)}).catch(ue=>{console.error("聚焦同步发送异常:",ue)});const z=document.querySelector("#room .layout-rightside"),J=document.querySelector("#room .layout-leftside"),re=document.getElementById(`participant-${be.value}`);if(re&&J){let ue=null;for(;ue=J.firstChild;)ue&&z&&z.appendChild(ue);J.insertBefore(re,J.firstChild??null)}}else U.value==="grid"&&(be.value&&be.value===N?nt.message("info","当前与会者已被设置为焦点"):(be.value=N,Fe.value===p.value&&sa("setFocus",{focusedParticipant:N}).then(z=>{z.success?console.log("聚焦同步发送成功"):console.error("聚焦同步发送失败:",z.error)}).catch(z=>{console.error("聚焦同步发送异常:",z)})),Io("rightSide"))},nh=()=>{const N=document.getElementById(`participant-${be.value}`);if(Fe.value===p.value&&sa("setFocus",{focusedParticipant:null}).then(R=>{R.success?console.log("取消聚焦同步发送成功"):console.error("取消聚焦同步发送失败:",R.error)}).catch(R=>{console.error("取消聚焦同步发送异常:",R)}),B.value==="pointTurn"){if(N){const R=document.querySelector("#room .point-turn-top"),z=document.querySelector("#room .point-turn-center"),J=document.querySelector("#room .point-turn-bottom"),re=document.querySelector("#room .point-turn-other");R.children.length>=5?J.children.length>=5?re.appendChild(N):J.appendChild(N):R.appendChild(N);const ue=document.createElement("div");ue.className="participant",ue.innerHTML=aa,z.appendChild(ue)}}else if(U.value==="rightSide"){const R=document.querySelector("#room .layout-rightside"),z=document.querySelector("#room .layout-leftside");if(N){let J=null;for(;J=z.firstChild;)J&&R&&R.appendChild(J)}if(Fe.value){const J=document.getElementById(`participant-${Fe.value}`);J&&z&&z.insertBefore(J,z.firstChild??null)}}be.value=null},Fg=N=>{Oe&&Oe.changeParticipantMicrophoneStatus(N,!0)},Vg=N=>{Oe&&Oe.changeParticipantCameraStatus(N,!0)},jg=N=>{var R;Qi(N)||Oe.setParticipantToHost(N,(R=_s(N))==null?void 0:R.name)},$g=async N=>{Oe&&await Oe.setParticipantDeafness(N)},Mo=async N=>{Oe&&await Oe.cancelParticipantDeafness(N)},ga=N=>{ut.emit("updateName",{identity:N})},va=async N=>{Oe&&await Oe.updateParticipantName(N.identity,N.name)},Ro=async N=>{if(Oe){await Oe.moveoutParticipant(N);try{const R=_s(N);if(R&&(R.uri||R.metadata&&/"equipmentCode"|"equipmentType"/i.test(R.metadata))&&o.value){const J=R.uri?{uri:R.uri}:{};await $8(o.value,J,{baseUrl:n.baseUrl,token:n.token})}}catch(R){console.error("disconnectSites error",R)}}},Ci=async()=>{document.fullscreenElement||document.msFullscreenElement||document.mozFullScreenElement||document.webkitFullscreenElement?document.exitFullscreen?document.exitFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.webkitCancelFullScreen?document.webkitCancelFullScreen():document.msExitFullscreen&&document.msExitFullscreen():(await l.nextTick(),s.value.requestFullscreen&&s.value.requestFullscreen())},Li=(N=3,R)=>{ke.value=N,Ge.value=!0,ln&&clearInterval(ln),ln=setInterval(()=>{ke.value>0&&ke.value--},1e3)},Lo=()=>{console.log("点击",ln),ln&&clearInterval(ln),Ge.value=!0},Bi=(N,R)=>{if(!N)return!1;const z=N.className;return z?typeof z=="string"?z.split(/\s+/).includes(R):typeof z.contains=="function"?z.contains(R):typeof z.baseVal=="string"?z.baseVal.split(/\s+/).includes(R):!1:!1},ih=N=>{const R=N&&N.target;Bi(R,"meeting-name")||($.value=!1),Bi(R,"exit-btn")||Bi(R,"close-meeting-icon")||(Ie.value=!1),Bi(R,"member-item")||Bi(R,"appoint-dialog")||Bi(R,"member-list")||Bi(R,"control-list-item")||(_t.value=!1),Bi(R,"icon-btn-option")||Bi(R,"more-icon")||(le.value=!1)},Hg=N=>{Re.value||N.preventDefault()},qg=()=>{window.addEventListener("click",ih),window.addEventListener("beforeunload",Hg),document.addEventListener("fullscreenchange",sh)},zg=()=>{window.removeEventListener("click",ih),document.removeEventListener("fullscreenchange",sh)},rh=N=>{Ot.value?Ot.value=!1:(Ot.value=!0,Hn.value={bottom:N.target.offsetTop+50+"px",left:N.target.clientLeft-122+"px"})};function ya(N){const R=Oe||window.liveClient;if(!R||typeof R.makeCall!="function"){console.error("liveClient 未就绪,无法发起外呼"),nt.message("error","外呼服务未就绪,请稍后再试");return}R.makeCall(N,"0"+N);let z=[{roomName:o.value,roomAlias:a.value,userId:N,userName:N,officeName:"",metadata:JSON.stringify({classify:"人员",phone:N})}];Qo(z,{baseUrl:n.baseUrl,token:n.token}).then(J=>{console.log("储存已邀请用户volte",J)})}const Bo=async N=>{if(n.isCustomizeMiniInvitations)r("miniInviteSend",{inviteMobile:N,fromUser:n.userData.username,meetingName:a.value,meetingNum:o.value});else try{const R=await Wr(N,N),z=await sf([{roomName:a.value,userName:N,phone:N,message:R.messageTemplate}],{baseUrl:n.baseUrl,token:n.token});nt.message("success","成功发送短信链接与语音播报"),Ot.value=!1}catch(R){console.error("发送语音播报失败",R)}};function Wr(N,R){return new Promise((z,J)=>{F8({path:n.miniPagePath,query:`roomNum=${o.value}&tenantId=${n.org}&userName=${N}&mobile=${R}&joinType=join&cameraStatus=true&microphoneStatus=true}`},{baseUrl:n.baseUrl,token:n.token}).then(re=>{if(console.log("生成小程序链接地址",re),re.data.code==0){const ue=re.data.msg,ye=`【鸿信翼联视频会议】 邀请您参加视频会议。
383
+ 会议主题:${a.value}
384
+ 微信小程序参会链接:${ue}`;z({meetingWXLink:ue,messageTemplate:ye})}else J(re.data.msg)})})}function ba(N){return new Promise(R=>setTimeout(R,N))}function Kr(N){var J;let R=[],z=-1;if(N&&N.length>0){N.forEach(ye=>{li.value>0?(z=d.value.findIndex(ge=>ge.mobile===ye.mobile),z<0&&R.push(ye)):R.push(ye),Ql(ye)}),console.log("本次追加邀请人员",R);const re=R.filter(ye=>(ye==null?void 0:ye.classify)==="人员"),ue=R.filter(ye=>(ye==null?void 0:ye.classify)!=="人员");if(re.length>0&&nc(re),ks(ue),wt.value>0){const ye=u.value.map(ge=>(ge==null?void 0:ge.classify)==="人员"?{roomName:o.value,roomAlias:a.value,userId:ge.userId,userName:ge.userName,officeName:ge.officeName,metadata:JSON.stringify({classify:ge.classify,phone:ge.mobile})}:{roomName:o.value,roomAlias:a.value,userId:ge.userId,userName:ge.userName,officeName:ge.officeName,metadata:JSON.stringify({phone:"",classify:ge==null?void 0:ge.classify,equipmentCode:ge==null?void 0:ge.mobile,equipmentPassword:ge==null?void 0:ge.equipmentPassword,equipmentType:ge==null?void 0:ge.equipmentType})});n.joinType==="launch"&&ye.findIndex(me=>me.userId===n.userData.userId)<0&&ye.push({roomName:o.value,roomAlias:a.value,userId:n.userData.userId,userName:n.userData.username,officeName:(J=n.userData)==null?void 0:J.officeName,metadata:JSON.stringify({classify:"人员",phone:n.userData.mobile})}),Qo(ye,{baseUrl:n.baseUrl,token:n.token}).then(ge=>{console.log("储存已邀请用户",ge)})}}}function sh(){document.fullscreenElement?bi.value=!0:bi.value=!1}const ah=async N=>{try{const R=await V8({orgcode:"500103014",username:"dianxintest",password:"abcd@1234",template_id:"qke0p5vGp_PAyEV-p620NbjwvjZ9xCNmkqKvv_jtmBE",url:`${n.h5Url}index?roomNum=${o.value}&userName=${N.label}&mobile=${N.mobile}&tenantId=${n.org}`,client_msg_id:"",firstvalue:"",keyword1value:`请参加会议!会议号:${o.value}`,keyword2value:oh(new Date),remark:""},{baseUrl:n.baseUrl,token:n.token});console.log("成功发送微信通知",R,result)}catch(R){console.error("发送语音播报失败",R)}},oh=N=>{const R=N.getFullYear(),z=String(N.getMonth()+1).padStart(2,"0"),J=String(N.getDate()).padStart(2,"0"),re=String(N.getHours()).padStart(2,"0"),ue=String(N.getMinutes()).padStart(2,"0"),ye=String(N.getSeconds()).padStart(2,"0");return`${R}-${z}-${J} ${re}:${ue}:${ye}`};l.watch(()=>ke.value,N=>{N<=0&&(Ge.value=!1,ln&&clearInterval(ln))}),l.watch(()=>Mt.value,(N,R)=>{N!==R&&xl()}),l.watch(()=>U.value,async(N,R)=>{if(console.log("新布局",N),console.log("旧布局",R),await l.nextTick(),B.value=="normal"){let z=document.getElementById("room");if(z){if(R==="grid"&&N==="rightSide"){let J=document.querySelector("#room .layout-rightside"),re=document.querySelector("#room .layout-leftside");if(re||(re=document.createElement("div"),re.className="layout-leftside"),J||(J=document.createElement("div"),J.className="layout-rightside"),be.value){let ue=_s(be.value);if(ue){const ye=document.getElementById(`participant-${ue.identity}`);if(ye){if(re.hasChildNodes()){let ge;for(;ge=re.firstChild;)ge&&J.appendChild(ge)}if(re.appendChild(ye),z.hasChildNodes()){let ge;for(;ge=z.firstElementChild;)ge&&J.appendChild(ge)}}}else if(ue=la(),ue){const ye=document.getElementById(`participant-${ue.identity}`);if(ye){if(re.hasChildNodes()){let ge;for(;ge=re.firstChild;)ge&&J.appendChild(ge)}if(re.appendChild(ye),z.hasChildNodes()){let ge;for(;ge=z.firstElementChild;)ge&&J.appendChild(ge)}}}}else{let ue=la();if(ue){const ye=document.getElementById(`participant-${ue.identity}`);if(ye){if(re.hasChildNodes()){let ge;for(;ge=re.firstChild;)ge&&J.appendChild(ge)}if(re.appendChild(ye),z.hasChildNodes()){let ge;for(;ge=z.firstChild;)ge&&J.appendChild(ge)}}}}z.insertBefore(re,z.firstChild??null),z.appendChild(J)}if(R==="rightSide"&&N==="grid"){let J=document.querySelector("#room .layout-rightside"),re=document.querySelector("#room .layout-leftside");console.log("layoutSideEle",J,re);const ue=document.createDocumentFragment();if(J){if(J.hasChildNodes()){let ye;for(;ye=J.firstChild;)ue.appendChild(ye)}z.removeChild(J)}if(re){if(re.hasChildNodes()){let ye;for(;ye=re.firstChild;)console.log("layoutLeftSideEleChild",re,ye),z.insertBefore(ye,z.firstChild??null)}z.removeChild(re)}z.appendChild(ue)}}}xl()}),l.watch(()=>B.value,async N=>{console.log("当前会议模式",N),await l.nextTick();let R=document.getElementById("room");if(N==="pointTurn"){let z=document.createElement("div");z.className="point-turn-top";let J=document.createElement("div");J.className="point-turn-center";let re=document.createElement("div");re.className="point-turn-bottom";let ue=document.createElement("div");ue.className="point-turn-other";let ye=document.createElement("div"),ge=document.createElement("div");if(ye.className="participant",ye.innerHTML=aa,ge.className="participant",ge.innerHTML=aa,J.appendChild(ye),J.appendChild(ge),U.value==="grid"){let me=null;for(;me=R.firstChild;)me&&(Fe.value&&me.id===`participant-${Fe.value}`&&(J.removeChild(ye),J.insertBefore(me,J.firstChild??null)),be.value&&me.id===`participant-${be.value}`&&(be.value===Fe.value||(J.removeChild(ge),J.appendChild(me))),(!Fe.value&&!be.value||!(me.id===`participant-${Fe.value}`||me.id===`participant-${be.value}`))&&(z.children.length>=5?re.children.length>=5?ue.appendChild(me):re.appendChild(me):z.appendChild(me)))}if(U.value==="rightSide"){let me=document.querySelector("#room .layout-rightside"),tt=document.querySelector("#room .layout-leftside");if(tt){let Je=null;for(;Je=tt.firstChild;)Je&&(Fe.value&&Je.id===`participant-${Fe.value}`&&(J.removeChild(ye),J.insertBefore(Je,J.firstChild??null)),be.value&&Je.id===`participant-${be.value}`&&(be.value===Fe.value||(J.removeChild(ge),J.appendChild(Je))),(!Fe.value&&!be.value||!(Je.id===`participant-${Fe.value}`||Je.id===`participant-${be.value}`))&&(z.children.length>=5?re.children.length>=5?ue.appendChild(Je):re.appendChild(Je):z.appendChild(Je)));R.removeChild(tt)}if(me){let Je=null;for(;Je=me.firstChild;)Je&&(Fe.value&&Je.id===`participant-${Fe.value}`&&(J.removeChild(ye),J.insertBefore(Je,J.firstChild??null)),be.value&&Je.id===`participant-${be.value}`&&(be.value===Fe.value||(J.removeChild(ge),J.appendChild(Je))),(!Fe.value&&!be.value||!(Je.id===`participant-${Fe.value}`||Je.id===`participant-${be.value}`))&&(z.children.length>=5?re.children.length>=5?ue.appendChild(Je):re.appendChild(Je):z.appendChild(Je)));R.removeChild(me)}}R.insertBefore(z,R.firstChild??null),R.appendChild(J),R.appendChild(re),R.appendChild(ue)}else{let z=document.querySelector("#room .point-turn-top"),J=document.querySelector("#room .point-turn-center"),re=document.querySelector("#room .point-turn-bottom"),ue=document.querySelector("#room .point-turn-other");if(console.log("currentLayout",U.value),U.value==="grid"){if(z){if(z.children.length>0){let ye=null;for(;ye=z.firstChild;)ye&&R.appendChild(ye)}R.removeChild(z)}if(J){if(J.children.length>0){let ye=null;for(;ye=J.firstChild;)ye&&(ye.id?R.appendChild(ye):ye.remove())}R.removeChild(J)}if(re){if(re.children.length>0){let ye=null;for(;ye=re.firstChild;)ye&&R.appendChild(ye)}R.removeChild(re)}if(ue){if(ue.children.length>0){let ye=null;for(;ye=ue.firstChild;)ye&&R.appendChild(ye)}R.removeChild(ue)}}if(U.value==="rightSide"){let ye=document.createElement("div");ye.className="layout-leftside";let ge=document.createElement("div");if(ge.className="layout-rightside",!be.value&&Fe.value&&(be.value=Fe.value),z){if(z.children.length>0){let me=null;for(;me=z.firstChild;)me&&(be.value&&me.id===`participant-${be.value}`?ye.appendChild(me):ge.appendChild(me))}R.removeChild(z)}if(J){if(J.children.length>0){let me=null;for(;me=J.firstChild;)me&&(me.id?be.value&&me.id===`participant-${be.value}`?ye.appendChild(me):ge.appendChild(me):me.remove())}R.removeChild(J)}if(re){if(re.children.length>0){let me=null;for(;me=re.firstChild;)me&&(be.value&&me.id===`participant-${be.value}`?ye.appendChild(me):ge.appendChild(me))}R.removeChild(re)}if(ue){if(ue.children.length>0){let me=null;for(;me=ue.firstChild;)me&&(be.value&&me.id===`participant-${be.value}`?ye.appendChild(me):ge.appendChild(me))}R.removeChild(ue)}R.appendChild(ye),R.appendChild(ge)}}try{const z=localStorage.getItem("hx_device_setter_settings");if(z){const J=JSON.parse(z);J&&typeof J.isAutoPolling=="boolean"&&Wu(J.isAutoPolling)}}catch(z){console.warn("读取本地轮询开关失败",z)}xl()}),l.onMounted(async()=>{await Cr(),Bg(),setTimeout(()=>{se()},300);let N=null;try{const R=localStorage.getItem("hx_device_setter_settings");if(R){const z=JSON.parse(R);z&&typeof z.pollingIntervalMs=="number"&&z.pollingIntervalMs>0&&(N=z.pollingIntervalMs)}}catch(R){console.warn("读取本地轮询设置失败",R)}jN({getParticipants:()=>h.value,getCurrentLayout:()=>U.value,getCurrentRoomMode:()=>B.value,pollingIntervalMs:N,getHostIdentity:()=>Fe.value}),$r.init({setCurrentLayout:R=>{U.value=R},setCurrentRoomMode:R=>{console.log("setCurrentRoomMode 被调用,新模式:",R),B.value=R,console.log("currentRoomMode 已更新为:",B.value)},setFocusedParticipant:R=>{be.value=R},get currentLayout(){return U.value},get currentRoomMode(){return B.value},get focusedParticipant(){return be.value}},{meetingNum:o.value,localIdentity:p.value,baseUrl:n.baseUrl,token:n.token},ma,nh);try{const R=localStorage.getItem("hx_device_setter_settings");if(R){const z=JSON.parse(R);if(z&&typeof z.isAutoPolling=="boolean")try{Wu(z.isAutoPolling)}catch(J){console.warn("同步本地轮询开关到 manager 失败",J)}}}catch(R){console.warn("读取本地轮询设置失败",R)}if(window.liveClient||await new Promise(R=>{const z=()=>{window.removeEventListener("liveClientReady",z),R()};window.addEventListener("liveClientReady",z,{once:!0}),setTimeout(()=>{window.removeEventListener("liveClientReady",z),R()},3e3)}),n.joinType==="launch")pa(),Oe.roomName=n.tempMeetingName,await zd();else{pa(),o.value=n.tempMeetingNum,$r.meetingStore&&($r.meetingStore.meetingNum=n.tempMeetingNum),await ha();try{await YC(),JC(),console.log("加入会议后,布局同步初始化成功")}catch(R){console.error("加入会议后,布局同步初始化失败:",R)}}Li(5),qg(),ut.on("getmeetingMembers",Gg),ut.on("startVideoCall",lh),ut.on("updateVisibleParticipants",R=>{R&&Array.isArray(R.participants)&&U.value==="rightSide"&&ci(R.participants)}),ut.on("pointTurnPolling",R=>{if(!R||!Array.isArray(R.participants)||B.value!=="pointTurn")return;const z=document.querySelector("#room .point-turn-top"),J=document.querySelector("#room .point-turn-bottom"),re=document.querySelector("#room .point-turn-center");if(!z||!J||!re)return;const ue=R.participants.filter(Je=>!!(Je&&Je.identity)),ye=5,ge=5,me=ue.slice(0,ye),tt=ue.slice(ye,ye+ge);me.forEach(Je=>{const kt=document.getElementById(`participant-${Je.identity}`);kt&&kt!==re.firstChild&&kt!==re.lastChild&&z.appendChild(kt)}),tt.forEach(Je=>{const kt=document.getElementById(`participant-${Je.identity}`);kt&&kt!==re.firstChild&&kt!==re.lastChild&&J.appendChild(kt)})}),xl()}),l.onBeforeUnmount(()=>{Eg(),zg(),Oe=null,$N(),QV(),V()}),e({appendInvite:Kr});const lh=N=>{console.log("Received start video call for mobile:",N),ya(N)},Gg=()=>{console.log("Getting meeting members...")};return(N,R)=>(l.openBlock(),l.createElementBlock("div",{class:"meeting-room",ref_key:"rootElm",ref:s},[l.createElementVNode("div",ZV,[l.createElementVNode("div",ej,[tj,l.createElementVNode("div",{class:"meeting-name",onClick:R[0]||(R[0]=l.withModifiers(z=>$.value=!$.value,["stop"]))},[l.createElementVNode("span",nj,l.toDisplayString(a.value),1),ij,$.value?(l.openBlock(),l.createBlock(JU,{key:0,meetingName:a.value,meetingNum:o.value,meetingH5Link:S.value,meetingWXLink:M.value,meetingCreator:c.value},null,8,["meetingName","meetingNum","meetingH5Link","meetingWXLink","meetingCreator"])):l.createCommentVNode("",!0)]),l.createElementVNode("div",{class:"meeting-signal",onMouseenterCapture:R[3]||(R[3]=z=>H.value=!0),onMouseleave:R[4]||(R[4]=z=>H.value=!1)},[H.value?(l.openBlock(),l.createBlock(sF,{key:0,meetingQuality:m.value,meetingTTL:_.value,onMouseenter:R[1]||(R[1]=z=>H.value=!0),onMouseleave:R[2]||(R[2]=z=>H.value=!1)},null,8,["meetingQuality","meetingTTL"])):l.createCommentVNode("",!0)],32)]),l.createElementVNode("div",rj,[sj,l.createElementVNode("span",null,l.toDisplayString(_i.value),1)]),l.createElementVNode("div",aj,[l.createElementVNode("div",{class:l.normalizeClass(["btn",j.value?"layout-active":"layout"]),onMouseenterCapture:R[7]||(R[7]=z=>j.value=!0),onMouseleave:R[8]||(R[8]=z=>j.value=!1)},[j.value?(l.openBlock(),l.createBlock(dF,{key:0,currentLayout:U.value,layoutList:Q.value,layoutLabels:ie.value,currentRoomMode:B.value,onSetLayout:kg,onMouseenter:R[5]||(R[5]=z=>j.value=!0),onMouseleave:R[6]||(R[6]=z=>j.value=!1)},null,8,["currentLayout","layoutList","layoutLabels","currentRoomMode"])):l.createCommentVNode("",!0)],34),l.createElementVNode("div",{class:"btn full-screen",onClick:R[9]||(R[9]=z=>Ci())}),l.createElementVNode("div",{class:"btn close-meeting-icon",onClick:R[10]||(R[10]=z=>$e.value?wg(z):da())})])]),l.createElementVNode("div",oj,[l.createElementVNode("div",{class:l.normalizeClass(["meeting-room-contain-left",{"meeting-room-contain-left-slide":q.value||L.value}])},[l.createElementVNode("div",{class:l.normalizeClass(["meeting",nn.value]),id:"room",onMousemove:R[11]||(R[11]=z=>Li(5))},null,34),l.createVNode($V,{"message-list":P.value,ref_key:"instantRef",ref:Ri,onMessageSend:Zd},null,8,["message-list"]),l.createElementVNode("div",{class:l.normalizeClass(["meeting-control-bar",{"meeting-control-bar-show":Ge.value}]),onMousemove:Lo},[l.createElementVNode("div",lj,[l.createElementVNode("div",cj,[l.createElementVNode("div",{class:l.normalizeClass(["custom-select-btn",Ae.value?"mic-on":"mic-off"]),onClick:Lg},null,2),l.createElementVNode("div",{class:"custom-select-right",onClick:R[12]||(R[12]=z=>W.value=!W.value)},uj),W.value?(l.openBlock(),l.createBlock(Gl,{key:0,dialogType:"audio",audioDevices:k.value,outputDevices:w.value,activeDevice:A,onChooseAudioInputDevice:Og,onChooseAudioOutputDevice:Xd},null,8,["audioDevices","outputDevices","activeDevice"])):l.createCommentVNode("",!0)]),l.createElementVNode("div",dj,[l.createElementVNode("div",{class:l.normalizeClass(["custom-select-btn",ee.value?"cam-on":"cam-off"]),onClick:Rg},null,2),l.createElementVNode("div",{class:"custom-select-right",onClick:R[13]||(R[13]=z=>ae.value=!ae.value)},hj),ae.value?(l.openBlock(),l.createBlock(Gl,{key:0,videoDevices:D.value,activeDevice:A,dialogType:"video",onChooseVideoDevice:Yd},null,8,["videoDevices","activeDevice"])):l.createCommentVNode("",!0)])]),l.createElementVNode("div",fj,[c.value===p.value?(l.openBlock(),l.createElementBlock("div",pj,[mj,gj,l.createElementVNode("div",{class:"custom-select-right",onClick:R[14]||(R[14]=z=>Ee.value=!Ee.value)},vj),Ee.value?(l.openBlock(),l.createBlock(Gl,{key:0,currentRoomMode:B.value,dialogType:"other",onChooseOtherItem:Jd},null,8,["currentRoomMode"])):l.createCommentVNode("",!0)])):l.createCommentVNode("",!0),fe.value?(l.openBlock(),l.createElementBlock("div",{key:2,class:"t-btn",onClick:Qd},bj)):(l.openBlock(),l.createElementBlock("div",{key:1,class:"t-btn",onClick:Qd},yj)),l.createElementVNode("div",{class:"t-btn",onClick:R[15]||(R[15]=z=>L.value=!L.value)},_j),xe.value?(l.openBlock(),l.createElementBlock("div",{key:4,class:"t-btn",onClick:Gd},Tj)):(l.openBlock(),l.createElementBlock("div",{key:3,class:"t-btn",onClick:Pg},kj)),l.createElementVNode("div",{class:"t-btn",onClick:R[16]||(R[16]=z=>q.value=!q.value)},Sj),i.meetingVideo?(l.openBlock(),l.createElementBlock("div",{key:5,class:"t-btn",onClick:Wd},Cj)):l.createCommentVNode("",!0),l.createElementVNode("div",{class:"t-btn",onClick:Ng},xj),c.value===p.value?(l.openBlock(),l.createElementBlock("div",{key:6,class:"t-btn t-btn-qtm",onClick:R[18]||(R[18]=l.withModifiers(z=>rh(z),["self"]))},[Ot.value?(l.openBlock(),l.createBlock(RV,{key:0,position:Hn.value,defaultCallingMethod:i.defaultCallingMethod,onCloseCallBoard:R[17]||(R[17]=z=>Ot.value=!1),onPhoneCall:ya,onMiniCall:Bo},null,8,["position","defaultCallingMethod"])):l.createCommentVNode("",!0)])):l.createCommentVNode("",!0),l.createElementVNode("div",{class:"t-btn",onClick:Mg},[Ej,oe.value?(l.openBlock(),l.createBlock(pg,{key:0,tempActiveDevice:{audioInputDevice:A.audioInputDevice,audioOutputDevice:A.audioOutputDevice,videoDevice:A.videoDevice}},null,8,["tempActiveDevice"])):l.createCommentVNode("",!0)])]),l.createElementVNode("div",{class:"exit-btn",onClick:R[19]||(R[19]=z=>$e.value?Do(z):da())}," 结束会议 ")],34),_t.value?(l.openBlock(),l.createBlock(CV,{key:0,participants:h.value,meetingHost:y.value,onAppointHost:Si,onCloseDialog:R[20]||(R[20]=z=>_t.value=!1)},null,8,["participants","meetingHost"])):l.createCommentVNode("",!0)],2),l.createElementVNode("div",wj,[q.value?(l.openBlock(),l.createBlock(qF,{key:0,ref_key:"memeberManageRef",ref:qr,joinedList:b.value,participants:h.value,localIdentity:p.value,tempInvitedList:d.value,inviteList:u.value,meetingNum:o.value,meetingName:a.value,meetingHost:y.value,onClose:R[21]||(R[21]=z=>{q.value=!1,le.value=!1}),onCloseMoreDialog:ua,onParticipantCameraSwitch:eh,onParticipantMicrophoneSwitch:Oo,onAllCameraClose:Ug,onAllMicrophoneClose:th,onOpenMoreDialog:$d,onAppendMemberInvite:Kd,onRemoveUnjoinItem:ca,onFilterJoinedList:Sg},null,8,["joinedList","participants","localIdentity","tempInvitedList","inviteList","meetingNum","meetingName","meetingHost"])):l.createCommentVNode("",!0),L.value?(l.openBlock(),l.createBlock(fV,{key:1,ref_key:"chatAreaRef",ref:Jn,localIdentity:p.value,messageList:P.value,fileUploadUrl:i.fileUploadUrl,imgUrl:i.imgUrl,onClose:R[22]||(R[22]=z=>L.value=!1),onMessageSend:Zd},null,8,["localIdentity","messageList","fileUploadUrl","imgUrl"])):l.createCommentVNode("",!0)])]),Ie.value?(l.openBlock(),l.createBlock(vV,{key:0,position:it.value,onCancelMeeting:Ao,onLeaveMeeting:Zl,onOptionClose:R[23]||(R[23]=z=>Ie.value=!1)},null,8,["position"])):l.createCommentVNode("",!0),le.value?(l.openBlock(),l.createBlock(EV,{key:1,curBlur:be.value,identity:Ke.value,optionDialogOffset:ze.value,localIdentity:p.value,meetingHost:y.value,participants:h.value,currentDisplayIdentity:qn.value,onClose:R[24]||(R[24]=z=>le.value=!1),onSetToBlur:ma,onRemoveFromBlur:nh,onCloseMicro:Fg,onCloseCamera:Vg,onSetToHost:jg,onSetToDeafness:$g,onCancelDeafness:Mo,onUpdateName:ga,onRemove:Ro,onDistributeScreen:ki,onCancelDistributeScreen:Dt},null,8,["curBlur","identity","optionDialogOffset","localIdentity","meetingHost","participants","currentDisplayIdentity"])):l.createCommentVNode("",!0),l.createVNode(Zp,{baseUrl:i.baseUrl,token:i.token,inviteList:u.value,componentType:"meeting",onAppendInvitePeople:No},null,8,["baseUrl","token","inviteList"]),l.createVNode(WV,{onUpdateNameConfirm:va})],512))}},[["__scopeId","data-v-0cbc3d71"]]),yg={__name:"LiveMulti",props:{isEnterDialogShow:{type:Boolean,default:!1},baseUrl:{type:String,default:""},meetingUrl:{type:String,default:""},userData:{type:Object,default:()=>({})},meetingVideo:{type:Boolean,default:!1},org:{type:String,default:"default"},token:{type:String,default:""},fileUploadUrl:{type:String,default:""},imgUrl:{type:String,default:""},h5Url:{type:String,default:""},isCustomizeMiniInvitations:{type:Boolean,default:!1},miniPagePath:{type:String,default:""},defaultInviteWay:{type:String,default:"mini"},wxOfficial:{type:Boolean,default:!1},defaultCallingMethod:{type:Array,default:()=>["voice","video","mini"]},meetingTitle:{type:String,default:"调度会议"}},emits:["enterDialogClose","miniInviteSend","inviteMessageSend"],setup(i,{emit:e}){const t=i,n=e,r=l.ref(null),s=l.computed(()=>r.value||t.token),a=l.ref(null),o=l.ref(!1),c=l.ref({roomName:"",roomNum:"",cameraStatus:!0,microphoneStatus:!0,audioInputDevice:"",audioOutputDevice:"",videoDevice:"",inviteList:[],joinType:"launch"});function u(f){c.value={roomName:f.roomName,roomNum:"",cameraStatus:f.cameraStatus,microphoneStatus:f.microphoneStatus,audioInputDevice:f.audioInputDevice,audioOutputDevice:f.audioOutputDevice,videoDevice:f.videoDevice,inviteList:f.inviteList,joinType:"launch"},o.value=!0}function d(f){c.value={roomName:f.roomName,roomNum:"",cameraStatus:f.cameraStatus,microphoneStatus:f.microphoneStatus,audioInputDevice:f.audioInputDevice,audioOutputDevice:f.audioOutputDevice,videoDevice:f.videoDevice,inviteList:f.inviteList,joinType:"launch"},o.value=!0}function h(f){c.value={roomName:"",roomNum:f.roomNum,cameraStatus:f.cameraStatus,microphoneStatus:f.microphoneStatus,audioInputDevice:f.audioInputDevice,audioOutputDevice:f.audioOutputDevice,videoDevice:f.videoDevice,inviteList:f.inviteList,joinType:"join"},o.value=!0}function b(){o.value=!1}function v(f){n("miniInviteSend",f)}function y(f){n("inviteMessageSend",f)}async function p(){const f=localStorage.getItem("xtoken");if(f&&t.baseUrl)try{const _=await(await fetch(`${t.baseUrl}/api/systemUserJwt/sso-login?xtoken=${f}`,{method:"POST",headers:{"Content-Type":"application/json"}})).json();_.code===0?(r.value=_.data.tokenValue,a.value.getUserAndOrgTreeData(r.value),a.value.getPreviewMeetingList(r.value)):console.error("Component LiveMulti: Failed to fetch token:",_.message)}catch(m){console.error("Component LiveMulti: Error fetching token:",m)}else a.value.getUserAndOrgTreeData(),a.value.getPreviewMeetingList()}return l.onMounted(()=>{localStorage.getItem("xtoken")?p():(a.value.getUserAndOrgTreeData(),a.value.getPreviewMeetingList())}),(f,m)=>(l.openBlock(),l.createElementBlock("div",null,[(l.openBlock(),l.createBlock(l.Teleport,{to:"body"},[l.withDirectives(l.createVNode(Kl,{onEnterDialogClose:m[0]||(m[0]=_=>f.$emit("enterDialogClose")),baseUrl:i.baseUrl,userData:i.userData,org:i.org,token:s.value,meetingTitle:i.meetingTitle,onQuickLaunch:u,onLaunchMeeting:d,onJoinMeeting:h,meetingVideo:i.meetingVideo,ref_key:"addressBookRef",ref:a},null,8,["baseUrl","userData","org","token","meetingTitle","meetingVideo"]),[[l.vShow,i.isEnterDialogShow]])])),(l.openBlock(),l.createBlock(l.Teleport,{to:"body"},[o.value?(l.openBlock(),l.createBlock(Yl,{key:0,baseUrl:i.baseUrl,token:s.value,meetingUrl:i.meetingUrl,org:i.org,userData:i.userData,tempMeetingName:c.value.roomName,tempMeetingNum:c.value.roomNum,tempCameraStatus:c.value.cameraStatus,tempMicroStatus:c.value.microphoneStatus,tempActiveDevice:{audioInputDevice:c.value.audioInputDevice,audioOutputDevice:c.value.audioOutputDevice,videoDevice:c.value.videoDevice},joinType:c.value.joinType,tempInviteList:c.value.inviteList,fileUploadUrl:i.fileUploadUrl,imgUrl:i.imgUrl,h5Url:i.h5Url,isCustomizeMiniInvitations:i.isCustomizeMiniInvitations,wxOfficial:i.wxOfficial,miniPagePath:i.miniPagePath,defaultCallingMethod:i.defaultCallingMethod,defaultInviteWay:i.defaultInviteWay,onMultiMeetingClose:b,onMiniInviteSend:v,onInviteMessageSend:y,meetingVideo:i.meetingVideo},null,8,["baseUrl","token","meetingUrl","org","userData","tempMeetingName","tempMeetingNum","tempCameraStatus","tempMicroStatus","tempActiveDevice","joinType","tempInviteList","fileUploadUrl","imgUrl","h5Url","isCustomizeMiniInvitations","wxOfficial","miniPagePath","defaultCallingMethod","defaultInviteWay","meetingVideo"])):l.createCommentVNode("",!0)]))]))}};yg.install=function(i){i.component("LiveMulti",yg)},Yl.install=function(i){i.component("LiveMultipleMeeting",Yl)};const bg={__name:"LiveMultipersonMeeting",props:{isEnterDialogShow:{type:Boolean,default:!1},dialogType:{type:String,default:"launch"},tempRoomNum:{type:String,default:""},inviteList:{type:Array,default:()=>[]},baseUrl:{type:String,default:""},meetingUrl:{type:String,default:""},userData:{type:Object,default:()=>({})},org:{type:String,default:"default"},token:{type:String,default:""},fileUploadUrl:{type:String,default:""},imgUrl:{type:String,default:""},h5Url:{type:String,default:""},isCustomizeMiniInvitations:{type:Boolean,default:!1},miniPagePath:{type:String,default:""},defaultInviteWay:{type:String,default:"mini"}},emits:["enterDialogClose","miniInviteSend","inviteMessageSend"],setup(i,{expose:e,emit:t}){const n=i,r=t,s=l.ref(),a=l.ref(null),o=l.computed(()=>a.value||n.token),c=l.ref(!1),u=l.ref({roomName:"",roomNum:"",cameraStatus:!0,microphoneStatus:!0,audioInputDevice:"",audioOutputDevice:"",videoDevice:"",joinType:"launch"});function d(k){u.value={...k,roomNum:"",joinType:"launch"},c.value=!0}function h(k){u.value={...k,roomName:"",joinType:"join"},c.value=!0}function b(){u.value={roomName:n.userData.username+"的视频会议",roomNum:"",cameraStatus:!0,microphoneStatus:!0,audioInputDevice:"",audioOutputDevice:"",videoDevice:"",joinType:"launch"},c.value=!0}function v(){r("enterDialogClose")}function y(){c.value=!1}function p(k){r("miniInviteSend",k)}function f(k){r("inviteMessageSend",k)}async function m(k){await l.nextTick(),s.value&&s.value.appendInvite(k)}async function _(){const k=localStorage.getItem("xtoken");if(k&&n.baseUrl)try{const w=await(await fetch(`${n.baseUrl}/api/systemUserJwt/sso-login?xtoken=${k}`,{method:"POST",headers:{"Content-Type":"application/json"}})).json();w.code===0?a.value=w.data.tokenValue:console.error("Component LiveMultipersonMeeting: Failed to fetch token:",w.message)}catch(D){console.error("Component LiveMultipersonMeeting: Error fetching token:",D)}else console.warn("Component LiveMultipersonMeeting: Cannot fetch token. xtoken not found in localStorage or baseUrl prop is missing.")}return l.onMounted(()=>{localStorage.getItem("xtoken")&&_()}),e({quickLaunch:b,launchMeeting:d,joinMeeting:h,appendInvite:m}),(k,D)=>(l.openBlock(),l.createElementBlock("div",null,[(l.openBlock(),l.createBlock(l.Teleport,{to:"body"},[i.isEnterDialogShow?(l.openBlock(),l.createBlock(jC,{key:0,dialogType:i.dialogType,tempRoomNum:i.tempRoomNum,onLaunchMeeting:d,onJoinMeeting:h,onClose:v},null,8,["dialogType","tempRoomNum"])):l.createCommentVNode("",!0)])),(l.openBlock(),l.createBlock(l.Teleport,{to:"body"},[c.value?(l.openBlock(),l.createBlock(Yl,{key:0,ref_key:"liveMultipleMeetingRef",ref:s,baseUrl:i.baseUrl,token:o.value,meetingUrl:i.meetingUrl,org:i.org,userData:i.userData,tempMeetingName:u.value.roomName,tempMeetingNum:u.value.roomNum,tempCameraStatus:u.value.cameraStatus,tempMicroStatus:u.value.microphoneStatus,tempActiveDevice:{audioInputDevice:u.value.audioInputDevice,audioOutputDevice:u.value.audioOutputDevice,videoDevice:u.value.videoDevice},joinType:u.value.joinType,tempInviteList:i.inviteList,fileUploadUrl:i.fileUploadUrl,imgUrl:i.imgUrl,h5Url:i.h5Url,isCustomizeMiniInvitations:i.isCustomizeMiniInvitations,miniPagePath:i.miniPagePath,defaultInviteWay:i.defaultInviteWay,onMultiMeetingClose:y,onMiniInviteSend:p,onInviteMessageSend:f},null,8,["baseUrl","token","meetingUrl","org","userData","tempMeetingName","tempMeetingNum","tempCameraStatus","tempMicroStatus","tempActiveDevice","joinType","tempInviteList","fileUploadUrl","imgUrl","h5Url","isCustomizeMiniInvitations","miniPagePath","defaultInviteWay"])):l.createCommentVNode("",!0)]))]))}};bg.install=function(i){i.component("LiveMultipersonMeeting",bg)};const Dj="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAzCAYAAADVY1sUAAAAAXNSR0IArs4c6QAAAaZJREFUaEPt2ettwzAMBGByso7SxyJNJkm7STdjIcAqDMMWSenOcAP5b6zHp5MtS1F5kkufxCETcrUkZyIzEdIIzKlFGtjuakOJmNmbiLyIyI+qfne3liiYbdOFLBU+Vn24qeo90af0rWZ2E5HPpaCJyLs3gBHIl4i8bnpDw2wQtdmHqn60RiQCKdNqnUitD445QGASKb0+aKD8BMM02riraplqzctNpJZmYkYRpY9hCCsZBCINQWNQiC4ICoNEdENGMWjEEKQXw0AMQ7IYFgICiWLMrHxy7K0HoXUCto54FbXWmaUsDQFLJLBo7o0DJIlacWpB9FJxptm6OBQBTySYDBzBhBw92OVLtkDg+xnG1DpC/AXGwEAhjVfs9vGCJwODtNaJRVG3rpRkIJDIYtfY/UGemWFIBOG8zSDTbAiSQbAx3ZAeBBPTBRlBsDBpCALBwKQgSAQaE4YwEEhMCMJEoDAuZOcQu7YN/4qlHpma2d4hNhzhJEM5xKYhDjDQQ+z//0dPZHt7hXvch/0KnYz0YUIio3TmPTORM0c70tZMJDJKZ97zCzEUP0NhkckVAAAAAElFTkSuQmCC",QC="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAAkCAYAAADhAJiYAAAAAXNSR0IArs4c6QAAArFJREFUWEfFmI1RFUEQhGcy0AwkA81AMoAIxAiUCIQIhAiECMQIJAMwAs1AMmjvu9q92jvuZ+ZelUzV1nsF+9PbOz29+9x2hqQvZnZmZq9KqzM9mtm9mV26+1N2es8OoL+kr2b2eWPsvbsfZ+dPA5L0xsx+Bxc6dnfYCsceQDcdoA/BFdIspQCVvLkIgqndLtz9MjpmFpCkt2ZG+1Ma3z91yfo+OvGkH4l+ZWa/yt/7ueeO8xkgSd/N7GTnwtlh5Ndpq8YRoKB6sotu9b9y9/PaaQAkCVZg5yViUGMLCCkj6ZeIQY09IElU3G8vgaRZs2epAvp5oIJQEeyiHqxkT/xw95MKKHtceNQ1Up76VWEbn8seP2XgqALKSJ3aBL18LkZnMZmKzjwjhtjNQ5DuoxaMJIol45/c/a5FKCmaCjD+jnlbleHeuPha3Lj7xyIEcgVm2+oNaxQ6cgqx8D9AbcW5u1PJbVoY/26wxC7qYktHwm5hsb8LBViC2dcV8RTQGsXDQEmwA/ilGHbc9WXn+OBSjG4EGUC9CsqukTc5txTt0XI7QHW7AK0dWYahsw78bQG/xdD8kUmC1j6xVmLwnJWjGJUFSTAJo2sxTurEtXRw5pJHbKC9PU5VtnW0FeRY9sk70KC0Jp/qZe6xrdySMg6w2zo2K3Vhj5qGaUdjt3XUBVDP7dRCSjHk5pD1sl7+1cuiFXVutxRKcoDaBIi9bt8rs7WOqO9EjyDTb6hxLaBDWMosPtcX/+uNeVqpt4rYoQvPjb/ulDk8y+eeQf8T1J27n7Yolx6KJCetXsL4joSjT+gpE7y/sBI+69zUrP7msAlo6VwkRe5M0+H8LBN+fqfe9qUyZ66mg+tHk28PoIwaRzYTAZUGlGBppJ4ImGeyjw4qoGqSt28xKjYNSwnnTbvuP+syQDSUk68hAAAAAElFTkSuQmCC",Aj="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAYAAACM/rhtAAAAAXNSR0IArs4c6QAAAsFJREFUWEfdmOtVFEEQhasycDMQI5AIlAw0AiEC0QBQIxAiECJQIxAjkAwgA8mg8JvT1adn7Jczs+5q/4Fzpqb79q3HvbMqe750z/HJ/wXQzB6JyAsReSYijwP79yJyLSJfVfVu7Yx0MRiAvRaRUxEBZGkB9GRNoE2AZgZT3xLGekh6o6rnHpgwD8P3qnrTswkxVYAzwfnZEWQA+CO5JEAvReRCVSmR4moBhLnnvbfNxB06W2ZGeXycxAD0qFYSRYBmdiwinxaA49VrVT3in8DibaaGYZCLZBusBnApe343GKJ5AElaX2UufaOqhzkysgDDbX8uZM9f/6Cq7wPAXJo97lhVr6ZnlgBSdzC4xmI+MjthkL+fC5vGckiflwCuUX9+TlqHtYszfja9DO4CINgOps1SYvCpiDC31li9KeaszXQu1rqYJqnJWi/4WPxmRrO8K7zYn+JQ0EgV+rt0xbSZWW10XarqSVcNBoBoMIN1yULKGC10cGu/OC+bXewBBXnqBYwyoBCD1laGNI+z7PGgx83MSfVIYxvs4WxgL2samgDD7WvFPWV05AkzTiaNRzlOa46mC2BSQwDNaSkhACNVI7kK6oHp8IkAu8ReuUbXaqYbYLqJmaEIqeVH7Fe3+1012NsR24prGVZYcqbmYIDZUfGHmsQwpPsSQ7NQHt9V1fyw3wCaGTLHtCeNaygJB5+ntdloHDzjW1Ud7N4IoJmhHPFjZw5llXcA+tJrNRBR0vvogCJAM4O1wVhucY1m3i8mazN20PABYIcMrYk5ddg11zSw6ABL3wprAvO9aAgMhEsgaQZobm0cIKZgSbf+6UX49QFSyF4tzQf6l9PrF0nTXJPRnQGM7qVhYvcG4FmhRp7sKsUpgzRIqUm+7Bxgq7sc4NLfYGrnRF1NgvjSu2iB+/fdTM8Ntx0zy7BuG1S6/wPgWUXGlCU/owAAAABJRU5ErkJggg==",Bd=i=>(l.pushScopeId("data-v-f64ae524"),i=i(),l.popScopeId(),i),Ij={class:"dialog"},Pj=Bd(()=>l.createElementVNode("div",{style:{display:"flex",height:"100%","align-items":"center","margin-top":"-14px"}},[l.createElementVNode("div",{class:"title-text"},"语音播报"),l.createElementVNode("div",{class:"text"},"指令查询")],-1)),Nj={class:"dialog-content","element-loading-text":"视频合成中","element-loading-background":"rgba(0, 0, 0, 0.6)"},Oj={class:"main-content"},Mj={class:"form-top"},Rj={class:"num-picker"},Lj={class:"picker-num"},Bj={class:"textarea-wrapper"},Uj={class:"voice-detect-btn-outter"},Fj={class:"synthesis-settings"},Vj=Bd(()=>l.createElementVNode("div",{class:"settings-title"},[l.createElementVNode("img",{src:QC,alt:"",style:{width:"18px",height:"18px","margin-right":"10px"}}),l.createElementVNode("span",null,"合成设置")],-1)),jj={class:"form-top"},$j={class:"num-picker"},Hj={class:"picker-num"},qj={class:"success-area"},zj={class:"success-content"},Gj={key:0,class:"success-title"},Wj={key:1,class:"success-title"},Kj={class:"audio-list"},Xj={class:"custom-video-player"},Yj=["src"],Jj={class:"controls"},Qj={key:0},Zj={key:1},e$={class:"time"},t$=["max"],n$={class:"receiver-area"},i$={class:"receiver-title"},r$=Bd(()=>l.createElementVNode("img",{src:QC,style:{width:"18px",height:"18px","margin-right":"10px"}},null,-1)),s$=Bd(()=>l.createElementVNode("span",null,"接收人:",-1)),a$={class:"receiver-count"},o$={class:"receiver-list"},l$=["onClick"],c$={class:"success-btns"},Ud=Bt({__name:"VoiceBroadcast",props:{baseUrl:{type:String,default:""},token:{type:String,default:""},org:{type:String,default:"default"}},emits:["dialogClose","taskCreated"],setup(i,{expose:e,emit:t}){const n=i,r=t,s=l.ref(null),a=l.computed(()=>s.value||n.token),o=new _n,c=l.ref(),u=l.reactive({title:[{required:!0,message:"请输入指令标题",trigger:"blur"}],deadlineTime:[{type:"date",required:!0,message:"请选择呼叫截止时间",trigger:"change"}]}),d=l.reactive({title:"",speechRate:"1",callNum:1,deadlineTime:""}),h=l.ref([{label:"1.0x(默认)",value:"1"},{label:"0.5x",value:"0.5"},{label:"1.5x",value:"1.5"},{label:"2.0x",value:"2.0"}]),b=l.ref(!1);l.ref([]);const v=l.ref(""),y=l.ref(!1),p=l.ref(""),f=l.ref(!1),m=l.ref([]);l.computed(()=>m.value.length);async function _(oe){if(Array.isArray(oe)){const de=new Map;oe.forEach(Ve=>{de.has(Ve.userId)||de.set(Ve.userId,{userName:Ve.userName||Ve.label||Ve.userId,userId:Ve.userId,phone:Ve.phone})});const Le=Array.from(de.values());Q.value=Le,m.value=Le}console.log(Q.value,"2222")}const k=()=>{M(),B.value="",Q.value=[],m.value=[],w.value="",U.value="edit",f.value=!1,r("dialogClose")},D=async()=>{if(y.value)try{(await fetch("https://10.227.1.31:8442/ylapi/api/v1/stopAudioToWS",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({room:H.value||($==null?void 0:$.roomNumber)||"",identity:localStorage.getItem("userId")||"admin"})})).ok?(console.log("语音识别停止成功"),y.value=!1):console.warn("停止语音识别API调用失败")}catch(oe){console.error("停止语音识别失败:",oe)}else try{const oe=await fetch("https://10.227.1.31:8442/ylapi/api/v1/startAudioToWS",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({room:H.value||($==null?void 0:$.roomNumber)||"",identity:localStorage.getItem("userId")||"admin"})});if(oe.ok){const de=await oe.json();console.log("语音识别启动成功:",de),y.value=!0}else o.message("error","启动语音识别失败")}catch(oe){console.error("语音识别启动失败:",oe),o.message("error","启动语音识别服务失败")}},w=l.ref(""),A=async()=>{b.value=!0;try{const oe=await fetch("https://10.227.1.31:8442/ytapi/ai/api/v1/video/notice/querySynthesizeTask",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({org:n.org,taskId:w.value})});if(oe.ok){const de=await oe.json();de.data&&(typeof de.data=="string"&&de.data||typeof de.data=="object"&&Object.keys(de.data).length>0)?(B.value=de.data,o.message("success",de.msg)):o.message("warning",de.msg),U.value="success"}else o.message("error","查询合成任务状态失败")}catch{o.message("error","查询合成任务状态失败")}finally{b.value=!1}},x=()=>{c.value&&c.value.validate(async oe=>{if(oe){if(!p.value){o.message("warning","请输入通知内容");return}b.value=!0;try{const de=await fetch("https://10.227.1.31:8442/ytapi/ai/api/v1/video/notice/synthesizeVideo",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({org:n.org,videoBackground:"https://10.227.1.31:8442/assets/loginbg-DG29K9gD.png",text:p.value})});if(de.ok){const Le=await de.json();console.log("视频合成成功:",Le),Le.code==200?(w.value=Le.data,v.value=p.value,o.message("success",Le.msg||"合成任务已提交"),await A()):o.message("error",Le.msg||"音频合成失败")}else o.message("error","音频合成失败");U.value="success"}catch(de){console.error("视频合成失败:",de),o.message("error","音频合成接口异常")}finally{b.value=!1}}})};function P(){d.callNum>1&&d.callNum--}function S(){d.callNum++}function M(){d.title="",p.value="",d.callNum=1,d.speechRate="1",d.deadlineTime=""}const U=l.ref("edit"),B=l.ref(""),Q=l.ref([]);function ie(){ut.emit("getaddressBookUserForVoiceBroadcast")}function Y(oe){Q.value.splice(oe,1),m.value.splice(oe,1)}function q(oe){return oe.getTime()<Date.now()-60*1e3}async function L(){if(!d.title){o.message("warning","请输入指令标题");return}if(!p.value){o.message("warning","请输入通知内容");return}if(!d.deadlineTime||new Date(d.deadlineTime).getTime()<Date.now()-60*1e3){o.message("warning","呼叫截止时间不能早于当前时间");return}if(B.value===""||typeof B.value=="object"&&!Array.isArray(B.value)&&Object.keys(B.value).length===0){if(w.value)try{const oe=await fetch("https://10.227.1.31:8442/ytapi/ai/api/v1/video/notice/querySynthesizeTask",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({org:n.org,taskId:w.value})});if(oe.ok){const de=await oe.json();B.value=de.data,console.log(de.data,"2323"),typeof de.data=="object"&&o.message("warning","语音合成中")}else{o.message("error","查询合成任务失败");return}}catch{o.message("error","查询合成任务失败");return}if(B.value===""||typeof B.value=="object"&&!Array.isArray(B.value)&&Object.keys(B.value).length===0)return}if(!Q.value.length){o.message("warning","请选择接收人");return}try{const oe=await fetch("https://10.227.1.31:8442/ytapi/ai/api/v1/video/notice/createVideoCallTask",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({org:n.org,taskId:w.value,cyclesNumber:d.callNum,deadlineTime:d.deadlineTime,title:d.title,sendIdentityId:localStorage.getItem("userId")||"",sendIdentityName:localStorage.getItem("userName")||localStorage.getItem("userId"),videoUrl:B.value||"",callObjects:Q.value.map(de=>({callName:de.userName,callIdentity:de.userId,phoneNumber:de.phone||"",callDepartment:de.department||""}))})});if(oe.ok){const de=await oe.json(),{code:Le,msg:Ve}=de;Le==200?(o.message("success",Ve),r("taskCreated",{code:Le,msg:Ve}),M(),B.value="",Q.value=[],m.value=[],w.value="",U.value="edit",k()):o.message("error",Ve||"下发失败")}else o.message("error","下发失败")}catch{o.message("error","下发接口异常")}}let $=null;const H=l.ref(""),j=()=>{$=window.liveClient};async function W(){if($||j(),!$){console.error("liveClient初始化失败");return}try{const oe=await $.createRoom();oe&&($.roomNumber=oe,H.value=oe)}catch(oe){console.error("创建房间失败",oe)}}const ae=l.ref(null),Ee=l.ref(!1),Ae=l.ref(0),ee=l.ref(0);function fe(){ae.value&&(Ee.value?ae.value.pause():ae.value.play())}function xe(){Ee.value=!0}function Ne(){Ee.value=!1}function He(oe){Ae.value=oe.target.currentTime}function Be(oe){ee.value=oe.target.duration}function be(){ae.value&&(ae.value.currentTime=Number(Ae.value))}function Fe(oe){oe=Math.floor(oe);const de=String(Math.floor(oe/60)).padStart(1,"0"),Le=String(oe%60).padStart(2,"0");return`${de}:${Le}`}function le(oe){if(f.value=!0,W(),oe&&oe.length>0){const de=oe.filter(Le=>Le.classify==="人员").map(Le=>({userName:Le.userName||Le.label||Le.userId,userId:Le.userId,phone:Le.phone}));Q.value=de,m.value=de}else Q.value=[],m.value=[]}async function ze(){const oe=localStorage.getItem("xtoken");if(oe&&n.baseUrl)try{const Le=await(await fetch(`${n.baseUrl}/api/systemUserJwt/sso-login?xtoken=${oe}`,{method:"POST",headers:{"Content-Type":"application/json"}})).json();Le.code==0?s.value=Le.data.tokenValue:console.error("Component VoiceBroadcast: Failed to fetch token:",Le.message)}catch(de){console.error("Component VoiceBroadcast: Error fetching token:",de)}else console.warn("Component VoiceBroadcast: Cannot fetch token. xtoken not found in localStorage or baseUrl prop is missing.")}return l.onMounted(()=>{localStorage.getItem("xtoken")&&ze(),j(),ut.on("inviteListUpdate",oe=>{if(Array.isArray(oe)){const de=new Map;Q.value.forEach(Ve=>de.set(Ve.userId,Ve)),oe.forEach(Ve=>de.set(Ve.userId,{userName:Ve.userName||Ve.label||Ve.userId,userId:Ve.userId,phone:Ve.phone}));const Le=Array.from(de.values());Q.value=Le,m.value=Le}})}),e({openDialog:le}),(oe,de)=>{const Le=l.resolveComponent("el-input"),Ve=l.resolveComponent("el-form-item"),Ke=l.resolveComponent("el-date-picker"),Ge=l.resolveComponent("el-form"),ke=l.resolveComponent("el-option"),$e=l.resolveComponent("el-select"),_e=l.resolveComponent("el-dialog"),Re=l.resolveDirective("loading");return l.openBlock(),l.createElementBlock("div",null,[l.createElementVNode("div",Ij,[l.createVNode(_e,{modelValue:f.value,"onUpdate:modelValue":de[8]||(de[8]=Ie=>f.value=Ie),overflow:"","close-on-press-escape":!1,draggable:"","close-on-click-modal":!0,"show-close":!1,modal:!0,"align-center":""},{header:l.withCtx(()=>[l.createElementVNode("div",{class:"title"},[Pj,l.createElementVNode("img",{src:Dj,alt:"",onClick:k})])]),default:l.withCtx(()=>[l.withDirectives((l.openBlock(),l.createElementBlock("div",Nj,[l.createElementVNode("div",Oj,[U.value==="edit"?(l.openBlock(),l.createElementBlock(l.Fragment,{key:0},[l.createVNode(Ge,{ref_key:"mainFormRef",ref:c,model:d,class:"main-form",rules:u},{default:l.withCtx(()=>[l.createElementVNode("div",Mj,[l.createVNode(Ve,{label:"指令标题:",prop:"title"},{default:l.withCtx(()=>[l.createVNode(Le,{modelValue:d.title,"onUpdate:modelValue":de[0]||(de[0]=Ie=>d.title=Ie),placeholder:"请输入"},null,8,["modelValue"])]),_:1}),l.createVNode(Ve,{label:"循环呼叫次数:"},{default:l.withCtx(()=>[l.createElementVNode("div",Rj,[l.createElementVNode("div",{class:"picker-btn picker-btn-sub",onClick:P}),l.createElementVNode("div",Lj,l.toDisplayString(d.callNum),1),l.createElementVNode("div",{class:"picker-btn picker-btn-plus",onClick:S})])]),_:1}),l.createVNode(Ve,{label:"呼叫截止时间:",prop:"deadlineTime"},{default:l.withCtx(()=>[l.createVNode(Ke,{modelValue:d.deadlineTime,"onUpdate:modelValue":de[1]||(de[1]=Ie=>d.deadlineTime=Ie),type:"datetime",placeholder:"请选择呼叫截止时间",format:"YYYY-MM-DD HH:mm:ss","date-format":"MMM DD, YYYY","time-format":"HH:mm:ss","disabled-date":q},null,8,["modelValue"])]),_:1})]),l.createElementVNode("div",Bj,[l.createVNode(Le,{class:"voice-detect-content",type:"textarea",modelValue:p.value,"onUpdate:modelValue":de[2]||(de[2]=Ie=>p.value=Ie),placeholder:"请输入通知内容(200字以内)",rows:8,resize:"none",maxlength:"200"},null,8,["modelValue"]),l.createElementVNode("div",Uj,[l.createElementVNode("div",{class:"btn",onClick:D},l.toDisplayString(y.value?"停止识别":"语音识别"),1)])])]),_:1},8,["model","rules"]),l.createElementVNode("div",Fj,[Vj,l.createVNode(Ge,{model:d},{default:l.withCtx(()=>[l.createVNode(Ve,{label:"调节语速:"},{default:l.withCtx(()=>[l.createVNode($e,{modelValue:d.speechRate,"onUpdate:modelValue":de[3]||(de[3]=Ie=>d.speechRate=Ie),placeholder:"1.0x(默认)"},{default:l.withCtx(()=>[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(h.value,Ie=>(l.openBlock(),l.createBlock(ke,{key:Ie.value,label:Ie.label,value:Ie.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1})]),_:1},8,["model"])]),l.createElementVNode("div",{class:"generate-button-wrapper"},[l.createElementVNode("div",{class:"btn",onClick:x},"开始合成")])],64)):U.value==="success"?(l.openBlock(),l.createElementBlock(l.Fragment,{key:1},[l.createVNode(Ge,{ref_key:"mainFormRef",ref:c,model:d,class:"main-form",rules:u},{default:l.withCtx(()=>[l.createElementVNode("div",jj,[l.createVNode(Ve,{label:"指令标题:",prop:"title"},{default:l.withCtx(()=>[l.createVNode(Le,{modelValue:d.title,"onUpdate:modelValue":de[4]||(de[4]=Ie=>d.title=Ie),placeholder:"请输入"},null,8,["modelValue"])]),_:1}),l.createVNode(Ve,{label:"循环呼叫次数:"},{default:l.withCtx(()=>[l.createElementVNode("div",$j,[l.createElementVNode("div",{class:"picker-btn picker-btn-sub",onClick:P}),l.createElementVNode("div",Hj,l.toDisplayString(d.callNum),1),l.createElementVNode("div",{class:"picker-btn picker-btn-plus",onClick:S})])]),_:1}),l.createVNode(Ve,{label:"呼叫截止时间:",prop:"deadlineTime"},{default:l.withCtx(()=>[l.createVNode(Ke,{modelValue:d.deadlineTime,"onUpdate:modelValue":de[5]||(de[5]=Ie=>d.deadlineTime=Ie),type:"datetime",placeholder:"请选择呼叫截止时间",format:"YYYY-MM-DD HH:mm:ss","date-format":"MMM DD, YYYY","time-format":"HH:mm:ss","disabled-date":q},null,8,["modelValue"])]),_:1})])]),_:1},8,["model","rules"]),l.createElementVNode("div",qj,[l.createElementVNode("div",zj,[B.value&&B.value.length>0?(l.openBlock(),l.createElementBlock("div",Gj," 语音文件生成成功 ")):(l.openBlock(),l.createElementBlock("div",Wj,"语音文件生成中...")),l.createElementVNode("div",Kj,[l.createElementVNode("div",Xj,[l.createElementVNode("video",{ref_key:"videoRef",ref:ae,src:B.value,onTimeupdate:He,onLoadedmetadata:Be,onPlay:xe,onPause:Ne,style:{display:"none"}},null,40,Yj),l.createElementVNode("div",Jj,[l.createElementVNode("button",{onClick:fe,class:"play-btn"},[Ee.value?(l.openBlock(),l.createElementBlock("span",Zj,"⏸️")):(l.openBlock(),l.createElementBlock("span",Qj,"▶️"))]),l.createElementVNode("span",e$,l.toDisplayString(Fe(Ae.value))+" / "+l.toDisplayString(Fe(ee.value)),1),l.withDirectives(l.createElementVNode("input",{type:"range",min:"0",max:ee.value,step:"0.1","onUpdate:modelValue":de[6]||(de[6]=Ie=>Ae.value=Ie),onInput:be,class:"progress-bar"},null,40,t$),[[l.vModelText,Ae.value]])])])])]),l.createElementVNode("div",n$,[l.createElementVNode("div",i$,[r$,s$,l.createElementVNode("span",a$,l.toDisplayString(Q.value.length),1),l.createElementVNode("img",{src:Aj,style:{width:"18px",height:"18px","margin-left":"11px",cursor:"pointer"},onClick:ie})]),l.createElementVNode("div",o$,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(Q.value,(Ie,it)=>(l.openBlock(),l.createElementBlock("span",{class:"receiver-tag",key:Ie.userId},[l.createTextVNode(l.toDisplayString(Ie.userName)+" ",1),l.createElementVNode("span",{class:"receiver-remove",onClick:_t=>Y(it)},"×",8,l$)]))),128))])]),l.createElementVNode("div",c$,[l.createElementVNode("div",{class:"btn btn-back",onClick:de[7]||(de[7]=Ie=>U.value="edit")}," 返回上一步 "),l.createElementVNode("div",{class:"btn btn-cancel",onClick:k},"取消"),l.createElementVNode("div",{class:"btn btn-send",onClick:L}," 下发 ")])])],64)):l.createCommentVNode("",!0)])])),[[Re,b.value]])]),_:1},8,["modelValue"])]),l.createVNode(Zp,{inviteList:m.value,baseUrl:i.baseUrl,token:a.value,componentType:"voiceBroadcast",onInviteListUpdate:_},null,8,["inviteList","baseUrl","token"])])}}},[["__scopeId","data-v-f64ae524"]]);Ud.install=function(i){i.component("VoiceBroadcast",Ud)};const u$=[Yu,El,wl,Kl,yg,Yl,bg,Ud,pg],_g=i=>{_g.installed||u$.forEach(e=>{i.use(e)})},d$={install:_g};ui.LiveAddressBook=Kl,ui.LiveCallBoard=El,ui.LivePoint=Yu,ui.LivePointMeeting=wl,ui.VoiceBroadcast=Ud,ui.default=d$,ui.install=_g,Object.defineProperties(ui,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});