UNPKG

@zoom/meetingsdk

Version:
1 lines 213 kB
!function(e){var t={};function n(s){if(t[s])return t[s].exports;var r=t[s]={i:s,l:!1,exports:{}};return e[s].call(r.exports,r,r.exports,n),r.l=!0,r.exports}n.m=e,n.c=t,n.d=function(e,t,s){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:s})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var s=Object.create(null);if(n.r(s),Object.defineProperty(s,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)n.d(s,r,function(t){return e[t]}.bind(null,r));return s},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=59)}([,,,function(e,t,n){"use strict";var s=n(5),r=n(16);new Error;const i=new Map;function a(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"|";return e?e.toString().replaceAll(/[,,]/g,t):""}let o=null,u=null;function c(e,t){var n,s;if(!function(e){const t=performance.now();return(!i.has(e)||t-i.get(e)>5e3)&&(i.set(e,t),!0)}(e))return;let c;try{c=a("object"==typeof t?JSON.stringify(t):t)}catch(e){c=a(t)}null===(n=u)||void 0===n||n("NEM-".concat(e,"-").concat(c)),r.a.error("NotifyUIError,event=".concat(e,",data=").concat(c)),null===(s=o)||void 0===s||s(e,t)}var l=n(15);function h(){return self.GROWABLE_HEAP_I8?self.GROWABLE_HEAP_I8():Module.HEAP8}function d(){return self.GROWABLE_HEAP_U8?self.GROWABLE_HEAP_U8():Module.HEAPU8}function f(){return self.GROWABLE_HEAP_U16?self.GROWABLE_HEAP_U16():Module.HEAPU16}function _(){return self.GROWABLE_HEAP_U32?self.GROWABLE_HEAP_U32():Module.HEAPU32}function p(){return self.GROWABLE_HEAP_F32?self.GROWABLE_HEAP_F32():Module.HEAPF32}async function m(e,t){try{const n=await new Promise((e,t)=>{const n=s=>{let r=s.data;"DOWNLOAD_WASM_FROM_MAIN_THREAD_OK"===r.command?(v("DE"),self.removeEventListener("message",n),e(r.data)):"DOWNLOAD_WASM_FROM_MAIN_THREAD_FAILED"===r.command&&(self.removeEventListener("message",n),t(new Error("Failed to download WASM file: ".concat(wasmUrl," from main thread"))))};self.addEventListener("message",n),v("DS"),postMessage({status:s.E,url:wasmUrl})});let r=await WebAssembly.instantiate(n,e);r.instance?(self.wasmModuleToShare=r.module,t(r.instance)):(self.wasmModuleToShare=n,t(r))}catch(e){v("IF"),g("E:H Failed to download and instantiate WASM file: ".concat(wasmUrl),e)}}n.d(t,"d",(function(){return h})),n.d(t,"g",(function(){return d})),n.d(t,"e",(function(){return f})),n.d(t,"f",(function(){return _})),n.d(t,"c",(function(){return p})),n.d(t,"q",(function(){return m})),n.d(t,"i",(function(){return E})),n.d(t,"u",(function(){return g})),n.d(t,"t",(function(){return A})),n.d(t,"o",(function(){return v})),n.d(t,"n",(function(){return S})),n.d(t,"v",(function(){return y})),n.d(t,"w",(function(){return T})),n.d(t,"p",(function(){return w})),n.d(t,"s",(function(){return D})),n.d(t,"k",(function(){return I})),n.d(t,"m",(function(){return C})),n.d(t,"r",(function(){return R})),n.d(t,"l",(function(){return U})),n.d(t,"x",(function(){return x})),n.d(t,"b",(function(){return F})),n.d(t,"h",(function(){return W})),n.d(t,"y",(function(){return q})),n.d(t,"a",(function(){return j})),n.d(t,"j",(function(){return V}));const b="function"!=typeof importScripts;function E(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;b?r.a.error(e,t):g(e,t)}function g(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;var n,r,i,a;(t instanceof Error||t instanceof ErrorEvent)&&(e+=" Message: "+(null===(n=t)||void 0===n?void 0:n.message)+" Stack: "+(null!==(r=null===(i=t)||void 0===i||null===(i=i.error)||void 0===i?void 0:i.stack)&&void 0!==r?r:null===(a=t)||void 0===a?void 0:a.stack),t=null);postMessage({status:s.G,errorMessage:e,errorEvent:t})}function A(e){postMessage({status:s.G,errorMessage:e,level:"low"})}function v(e){postMessage({status:s.zb,data:e})}function S(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(t)return t.postMessage({status:s.f,data:e});postMessage({status:s.f,data:e})}function y(e){postMessage({status:s.M,canvasId:e,replaceCanvas:!1})}function T(e){postMessage({status:s.N,canvasId:e})}function w(e){b?c(l.k,e):postMessage({status:s.Bb,where:e})}function M(){let e=this;this.promise=new Promise((function(t,n){e.reject=n,e.resolve=t}))}function D(e){let t;try{if(t=null==e?void 0:e.getContext("2d",{willReadFrequently:!0}),!t)throw new Error("getContext return null for willReadFrequently, canvas:".concat(e))}catch(n){t=null==e?void 0:e.getContext("2d")}return t||g("get2DContextFromCanvas return null"),t}class I{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:15e5;this.uint8Map={},this.availableIndex=[],this.capacity=e,this.bytesPerElement=t,this.avaiableIndexMap={},this.deferedList=[];for(let n=0;n<e;n++)this.uint8Map[n]=new Uint8Array(t),this.availableIndex.push(n),this.avaiableIndexMap[n]=!0}increaseBufferSize(e){let t=this.bytesPerElement+e;this.bytesPerElement=t;for(let e=0;e<this.capacity;e++){let n=this.uint8Map[e],s=new Uint8Array(t);s.set(n,0),this.uint8Map[e]=s}}getCapacity(){return this.capacity}get(){if(this.availableIndex.length>0){let e=this.availableIndex.shift();return this.avaiableIndexMap[e]=!1,new Promise((t,n)=>{t({index:e,uint8s:this.uint8Map[e]})})}{let e=new M;return this.deferedList.push(e),e.promise}}getSync(){if(this.availableIndex.length>0){let e=this.availableIndex.shift();return this.avaiableIndexMap[e]=!1,{index:e,uint8s:this.uint8Map[e]}}return null}recycle(e){if(!0!==this.avaiableIndexMap[e]&&(this.avaiableIndexMap[e]=!0,this.availableIndex.push(e),this.deferedList.length>0)){this.deferedList.shift().resolve(this.get())}}}class C{constructor(e){this.sharedBufferList=e}storeFlexible(e,t){let n=e.byteLength-this.sharedBufferList.bytesPerElement;if(n>0){let e=Math.floor(.1*this.sharedBufferList.bytesPerElement),s=n>e?n:e;if(s+this.sharedBufferList.bytesPerElement>t)return Promise.reject("too big, more than maxBytesPerElement");this.sharedBufferList.increaseBufferSize(s)}return this.store(e)}store(e){return this.sharedBufferList.get().then(t=>{try{return this.obj=t,t.uint8s.set(e,0),this.yuvdata=new Uint8Array(t.uint8s.buffer,0,e.byteLength),!0}catch(e){throw e}finally{this.autoRecycle()}})}storeSync(e){let t=this.sharedBufferList.getSync();return null!==t&&(this.obj=t,t.uint8s.set(e,0),this.yuvdata=new Uint8Array(t.uint8s.buffer,0,e.byteLength),!0)}autoRecycle(){this.autoRecycleInterval=setTimeout(()=>{console.log("autoRecycle",this.obj.index),this.recycle()},5e3)}recycle(){try{this.autoRecycleInterval&&clearInterval(this.autoRecycleInterval),this.sharedBufferList.recycle(this.obj.index)}catch(e){g("Error in YuvWrap.recycle: ".concat(e))}}}function O(e,t){t>=e.groupSize||(e.openStatusArray[t]?console.warn("group web transport index ".concat(t,", status reopene")):(e.openStatusArray[t]=!0,e.openedCount+=1,e.openedCount>1||e.params.onopen(e)))}function k(e,t){t>=e.groupSize||(e.openStatusArray[t]?(e.openStatusArray[t]=!1,e.openedCount>0&&(e.openedCount-=1,0==e.openedCount&&e.params.onclose(e))):console.warn("group web transport index ".concat(t,", not open")))}const L=["","MOZ_","OP_","WEBKIT_"];function R(e,t){for(var n=0;n<L.length;++n){var s=L[n]+t,r=e.getExtension(s);if(r)return r}}class U{constructor(e){this.params=e,this.label=this.params.label||"",this.id=this.params.id||0,this.groupSize=e.groupSize,this.openedCount=0,this.sendIndex=0,this.transportArray=[],this.openStatusArray=[];for(let e=0;e<this.groupSize;e++)this.transportArray.push(null),this.openStatusArray.push(!1)}async connect(){for(let e=0;e<this.groupSize;e++){let t=this.params.url;e>0&&(t+="&index="+e);let n={url:t,label:this.params.label,id:this.id,onmessage:this.params.onmessage,onopen:O,onclose:k,group:this,index:e},s=new N(n);await s.connect(),this.transportArray[e]=s}}send(e){if(!(this.openedCount<=0))for(let t=0;t<this.groupSize;t++){this.sendIndex+=1;let t=this.sendIndex%this.groupSize;if(this.transportArray[t]&&this.openStatusArray[t]){this.transportArray[t].send(e);break}}}forceClose(){for(let e=0;e<this.groupSize;e++)this.transportArray[e]&&this.transportArray[e].forceClose()}}class N{constructor(e){this.params=e,this.label=this.params.label||"",this.id=this.params.id||0,this.successfulConnectedCount=0,this.connectIndex=0,this.heartbeat=new Uint8Array([104,101,97,114,116,98,101,97,116]),this.transport=null,this.transport_ready=!1,this.isDestroyed=!1,this.inReading=!1,this.heartbeatStarted=!1,this.reader=null}async connect(){this.reconnect()}async reconnect(){if(this.isReconnectNow||this.isTimerExist||this.isDestroyed)return;this.isReconnectNow=!0,this.isTimerExist=!0;let e=Math.pow(2,this.connectIndex)-1;this.connectIndex+=1,setTimeout(async()=>{if(this.isDestroyed)return;this.isTimerExist=!1;let{url:e}=this.params,t=new WebTransport(e);this.transport=t,t.closed.then(()=>{this.reader=null,this.transport_ready=!1,this.params.onclose&&this.params.onclose(this.params.group,this.params.index)}).catch(e=>{this.reader=null,this.transport_ready=!1,this.params.onerror&&this.params.onerror(e),this.params.onclose(this.params.group,this.params.index),this.connectIndex<8&&this.reconnect()});try{if(this.isReconnectNow=!1,await t.ready,this.isDestroyed)return void this.close();this.transport_ready=!0,this.successfulConnectedCount++,t.datagrams.incomingMaxAge=1e3,t.datagrams.outgoingMaxAge=100,t.datagrams.incomingHighWaterMark=800,t.datagrams.outgoingHighWaterMark=800,this.writer=t.datagrams.writable.getWriter(),this.reader=t.datagrams.readable.getReader(),await this.writer.ready,this.params.onopen(this.params.group,this.params.index)}catch(e){return this.params.onerror&&this.params.onerror(e),void this.close()}this.startHeartbeat(),this.read()},1e3*e)}send(e){this.transport_ready&&this.writer.write(e)}async sendAwaitReady(e){this.transport_ready&&await this.writer.ready,this.transport_ready&&await this.writer.write(e)}async startHeartbeat(){if(!this.heartbeatStarted)for(this.heartbeatStarted=!0;;)try{await this.sleep(3e3),await this.sendAwaitReady(this.heartbeat)}catch(e){}}sleep(e){return new Promise(t=>setTimeout(t,e))}localTime(){let e=new Date;return"local time : "+e.getDate()+"/"+(e.getMonth()+1)+"/"+e.getFullYear()+" @ "+e.getHours()+":"+e.getMinutes()+":"+e.getSeconds()+" "}close(){try{this.transport_ready=!1,this.transport&&this.transport.close()}catch(e){}}forceClose(){this.isDestroyed||(this.isDestroyed=!0,this.close())}async read(){if(!this.inReading){for(this.inReading=!0;this.reader;)try{const{value:e,done:t}=await this.reader.read();if(t)break;this.params.onmessage(e)}catch(e){break}this.inReading=!1}}}const P=new Map,B=[90,180,360,720,1080],H=new class{constructor(){this.ssrcInfoMap=new Map,this.timer=null}updateSSRCInfo(e,t){this.ssrcInfoMap.has(e)||this.ssrcInfoMap.set(e,{firstTime:0,lastTime:0,frames:0,fps:0}),this._calculateFPS(e,t),this._removeZeroFPS()}_calculateFPS(e,t){const n=this.ssrcInfoMap.get(e);if(0===n.frames?n.firstTime=t:n.lastTime=t,n.frames+=1,n.frames>2&&n.frames%5==0&&n.lastTime-n.firstTime>=1e3){const t=Math.floor(1e3/((n.lastTime-n.firstTime)/(n.frames-1)));n.fps!==t&&(this._notifyFPS(e,t),n.fps=t),n.firstTime=n.lastTime,n.frames=1}}_removeZeroFPS(){let e=Date.now();this.ssrcInfoMap.forEach((t,n)=>{const s=this.ssrcInfoMap.get(n);s&&e-s.lastTime>2e3&&(this.ssrcInfoMap.delete(n),this._notifyFPS(n,0))})}_notifyFPS(e,t){postMessage({status:s.u,data:{ssrc:e,fps:t}})}_checkIfNewFrameComing(){this.timer&&(clearTimeout(this.timer),this.timer=null),this.timer=setTimeout(()=>{this._removeZeroFPS(),this.timer=null},2500)}};function x(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;const{r_w:r,r_h:i,rotation:a,ssrc:o}=e;let u=1==a||3==a,c=u?i:r,l=u?r:i;const h=o>>10<<10,d=B.reduce((e,t)=>Math.abs(e-l)>Math.abs(t-l)?t:e,B[0]),f=B.findIndex(e=>e===d);if(!P.get(h)||P.get(h).width!==c||P.get(h).height!==l){const e={width:c,height:l,ssrc:h,quality:f};P.set(h,e),n?n(e):postMessage({status:s.v,data:e})}t&&H.updateSSRCInfo(h,Date.now())}function F(e,t){return e&&t?Math.abs(e/t-4/3)<.01?2:Math.abs(e/t-16/9)<.01?3:1:1}function W(e,t,n,s,r){if(!r&&!s||1==e)return!1;let i=s&&t>=640,a=r&&t>=1280;return 2!=e||640==t&&480==n?i||a:((i||a)&&E("ratio is 4:3 but wencodec not supported width: ".concat(t,", height: ").concat(n)),!1)}function q(e,t){e?e.send(t):g("websocket is null",new Error("message type ".concat(t[0])))}function j(e){return e&&"undefined"!=typeof atob?Uint8Array.from(atob(e),e=>e.charCodeAt(0)):null}function V(e,t){return t&&(!e||e.websocketaddress!=t)}},function(e,t,n){"use strict";n.d(t,"y",(function(){return s})),n.d(t,"Y",(function(){return r})),n.d(t,"L",(function(){return i})),n.d(t,"K",(function(){return a})),n.d(t,"J",(function(){return o})),n.d(t,"v",(function(){return u})),n.d(t,"q",(function(){return c})),n.d(t,"r",(function(){return l})),n.d(t,"w",(function(){return h})),n.d(t,"x",(function(){return d})),n.d(t,"u",(function(){return f})),n.d(t,"X",(function(){return _})),n.d(t,"P",(function(){return p})),n.d(t,"Q",(function(){return m})),n.d(t,"O",(function(){return b})),n.d(t,"M",(function(){return E})),n.d(t,"s",(function(){return g})),n.d(t,"k",(function(){return A})),n.d(t,"n",(function(){return v})),n.d(t,"l",(function(){return S})),n.d(t,"m",(function(){return y})),n.d(t,"db",(function(){return T})),n.d(t,"B",(function(){return w})),n.d(t,"C",(function(){return M})),n.d(t,"W",(function(){return D})),n.d(t,"ab",(function(){return I})),n.d(t,"V",(function(){return C})),n.d(t,"Z",(function(){return O})),n.d(t,"N",(function(){return k})),n.d(t,"h",(function(){return L})),n.d(t,"g",(function(){return R})),n.d(t,"f",(function(){return U})),n.d(t,"A",(function(){return N})),n.d(t,"z",(function(){return P})),n.d(t,"S",(function(){return B})),n.d(t,"R",(function(){return H})),n.d(t,"e",(function(){return x})),n.d(t,"o",(function(){return F})),n.d(t,"T",(function(){return W})),n.d(t,"U",(function(){return q})),n.d(t,"G",(function(){return j})),n.d(t,"E",(function(){return V})),n.d(t,"H",(function(){return Y})),n.d(t,"I",(function(){return z})),n.d(t,"F",(function(){return G})),n.d(t,"bb",(function(){return Z})),n.d(t,"c",(function(){return K})),n.d(t,"b",(function(){return X})),n.d(t,"cb",(function(){return Q})),n.d(t,"d",(function(){return J})),n.d(t,"t",(function(){return $})),n.d(t,"D",(function(){return ee})),n.d(t,"p",(function(){return te})),n.d(t,"a",(function(){return ne})),n.d(t,"j",(function(){return se})),n.d(t,"i",(function(){return re}));const s=1e3,r=5,i=43,a=44,o=45,u=0,c=1,l=146,h=2,d=7,f=9,_=17,p=10,m=11,b=12,E=102,g=107,A=0,v=1,S=2,y=3,T=65,w=0,M=1,D=-1,I=0,C=1,O=2,k=3,L=1,R=2,U=3,N={SESSION_TYPE_CONF:0,SESSION_TYPE_AUDIO:1,SESSION_TYPE_DESKSHARE:2,SESSION_TYPE_VIDEO:3,SESSION_TYPE_CHAT:4,SESSION_TYPE_TELEPHONE:5,SESSION_TYPE_ZC_PING:6,SESSION_TYPE_TOTAL_CNT:7},P={CONNECT_TYPE_UDP:0,CONNECT_TYPE_TCP:1},B=24,H=20,x=15,F=10,W=8294400,q=5,j=0,V=1,Y=2,z=15,G=5,Z=400,K=7,X=8,Q={DESKTOP:0,MOBILE:1,ANDROID:2,IPHONE:3},J={DESKTOP_SOURCE:0,UAC_SOURCE:1},$={SHARE_REMOTE_CONTROL_UAC_MOUSE:144,SHARE_REMOTE_CONTROL_UAC_JPEG_FRAME:145},ee=1,te=25,ne=1,se=(new Map([["useinbandfec",{value:1,operater:"add"}],["maxaveragebitrate",{value:48e3,operater:"add"}],["maxplaybackrate",{value:24e3,operater:"add"}],["sprop-maxcapturerate",{value:24e3,operater:"add"}],["sprop-stereo",{value:1,operater:"sub"}],["stereo",{value:1,operater:"sub"}]]),new Map([["useinbandfec",{value:1,operater:"sub"}],["maxaveragebitrate",{value:96e3,operater:"add"}],["maxplaybackrate",{value:48e3,operater:"add"}],["sprop-maxcapturerate",{value:48e3,operater:"add"}],["sprop-stereo",{value:1,operater:"add"}],["stereo",{value:1,operater:"add"}]]),new Map([["useinbandfec",{value:1,operater:"sub"}],["maxaveragebitrate",{value:96e3,operater:"add"}],["maxplaybackrate",{value:48e3,operater:"add"}],["sprop-maxcapturerate",{value:48e3,operater:"add"}],["sprop-stereo",{value:1,operater:"add"}],["stereo",{value:1,operater:"add"}]]),new Map([["useinbandfec",{value:1,operater:"sub"}],["maxaveragebitrate",{value:128e3,operater:"add"}],["maxplaybackrate",{value:48e3,operater:"add"}],["sprop-maxcapturerate",{value:48e3,operater:"add"}],["sprop-stereo",{value:1,operater:"add"}],["stereo",{value:1,operater:"add"}]]),new Map([["useinbandfec",{value:1,operater:"sub"}],["maxaveragebitrate",{value:128e3,operater:"add"}],["maxplaybackrate",{value:48e3,operater:"add"}],["sprop-maxcapturerate",{value:48e3,operater:"add"}],["sprop-stereo",{value:1,operater:"add"}],["stereo",{value:1,operater:"add"}]]),new Map([["useinbandfec",{value:1,operater:"sub"}],["maxaveragebitrate",{value:"96000",operater:"add"}],["maxplaybackrate",{value:"48000",operater:"add"}],["sprop-maxcapturerate",{value:"48000",operater:"add"}]]),new Map([["useinbandfec",{value:1,operater:"add"}],["maxaveragebitrate",{value:64e3,operater:"add"}],["maxplaybackrate",{value:24e3,operater:"add"}],["sprop-maxcapturerate",{value:24e3,operater:"add"}],["sprop-stereo",{value:1,operater:"sub"}],["stereo",{value:1,operater:"sub"}]]),{VIDEO:0,SHARE:1}),re={PAUSE:0,RESUME:1,STOP:2}},function(e,t,n){"use strict";n.d(t,"j",(function(){return s})),n.d(t,"h",(function(){return r})),n.d(t,"l",(function(){return i})),n.d(t,"sb",(function(){return a})),n.d(t,"qb",(function(){return o})),n.d(t,"ub",(function(){return u})),n.d(t,"Z",(function(){return c})),n.d(t,"d",(function(){return l})),n.d(t,"bb",(function(){return h})),n.d(t,"db",(function(){return d})),n.d(t,"D",(function(){return f})),n.d(t,"ob",(function(){return _})),n.d(t,"H",(function(){return p})),n.d(t,"Eb",(function(){return m})),n.d(t,"n",(function(){return b})),n.d(t,"vb",(function(){return E})),n.d(t,"E",(function(){return g})),n.d(t,"b",(function(){return A})),n.d(t,"zb",(function(){return v})),n.d(t,"S",(function(){return S})),n.d(t,"I",(function(){return y})),n.d(t,"T",(function(){return T})),n.d(t,"xb",(function(){return w})),n.d(t,"f",(function(){return M})),n.d(t,"nb",(function(){return D})),n.d(t,"mb",(function(){return I})),n.d(t,"eb",(function(){return C})),n.d(t,"X",(function(){return O})),n.d(t,"V",(function(){return k})),n.d(t,"a",(function(){return L})),n.d(t,"z",(function(){return R})),n.d(t,"Fb",(function(){return U})),n.d(t,"G",(function(){return N})),n.d(t,"wb",(function(){return P})),n.d(t,"v",(function(){return B})),n.d(t,"u",(function(){return H})),n.d(t,"t",(function(){return x})),n.d(t,"w",(function(){return F})),n.d(t,"U",(function(){return W})),n.d(t,"jb",(function(){return q})),n.d(t,"kb",(function(){return j})),n.d(t,"R",(function(){return V})),n.d(t,"hb",(function(){return Y})),n.d(t,"ib",(function(){return z})),n.d(t,"F",(function(){return G})),n.d(t,"r",(function(){return Z})),n.d(t,"q",(function(){return K})),n.d(t,"y",(function(){return X})),n.d(t,"p",(function(){return Q})),n.d(t,"x",(function(){return J})),n.d(t,"Cb",(function(){return $})),n.d(t,"O",(function(){return ee})),n.d(t,"P",(function(){return te})),n.d(t,"Ab",(function(){return ne})),n.d(t,"C",(function(){return se})),n.d(t,"B",(function(){return re})),n.d(t,"A",(function(){return ie})),n.d(t,"K",(function(){return ae})),n.d(t,"J",(function(){return oe})),n.d(t,"L",(function(){return ue})),n.d(t,"o",(function(){return ce})),n.d(t,"s",(function(){return le})),n.d(t,"gb",(function(){return he})),n.d(t,"fb",(function(){return de})),n.d(t,"Db",(function(){return fe})),n.d(t,"Q",(function(){return _e})),n.d(t,"i",(function(){return pe})),n.d(t,"g",(function(){return me})),n.d(t,"k",(function(){return be})),n.d(t,"m",(function(){return Ee})),n.d(t,"rb",(function(){return ge})),n.d(t,"pb",(function(){return Ae})),n.d(t,"tb",(function(){return ve})),n.d(t,"Y",(function(){return Se})),n.d(t,"cb",(function(){return ye})),n.d(t,"ab",(function(){return Te})),n.d(t,"c",(function(){return we})),n.d(t,"M",(function(){return Me})),n.d(t,"Bb",(function(){return De})),n.d(t,"N",(function(){return Ie})),n.d(t,"yb",(function(){return Ce})),n.d(t,"W",(function(){return Oe})),n.d(t,"lb",(function(){return ke})),n.d(t,"e",(function(){return Le}));const s=1,r=2,i=3,a=7,o=8,u=9,c=12,l=14,h=15,d=16,f=18,_=20,p=21,m=24,b=26,E=27,g=30,A=31,v=35,S=36,y=37,T=38,w=47,M=48,D=50,I=51,C=52,O=53,k=54,L=56,R=57,U=60,N=61,P=62,B=66.5,H=66.6,x=67,F=68,W=69,q=71,j=72,V=73,Y=75,z=76,G=78,Z=105,K=106,X=107,Q=108,J=109,$=120,ee=121,te=122,ne=123,se=124,re=125,ie=126,ae=127,oe=128,ue=129,ce=132,le=133,he=135,de=136,fe=137,_e=151,pe=-1,me=-2,be=-3,Ee=-5,ge=-7,Ae=-8,ve=-9,Se=-12,ye=-14,Te=-15,we=-23,Me=-26,De=-27,Ie=-28,Ce=-35,Oe=-129,ke=-130,Le=-131},function(e,t,n){"use strict";n.d(t,"e",(function(){return l})),n.d(t,"b",(function(){return d})),n.d(t,"d",(function(){return f})),n.d(t,"a",(function(){return _})),n.d(t,"c",(function(){return p}));var s=n(7),r=n.n(s),i=n(14),a=n(17),o=n(5),u=n(10),c=n(13);const l={AUDIO_DECODE:1,AUDIO_ENCODE:2,VIDEO_DECODE:4,VIDEO_ENCODE:8,SHARR_DECODE:16,SHARR_ENCODE:32},h=e=>{0};class d{constructor(){this.onmessage=h,this.status=d.CLOSED,this.onopen=h,this.onclose=h,this.onwer=null}send(e){}delete(){this.onmessage=h,this.onopen=h,this.onclose=h,this.close()}sendVideo(e,t){}sendWasm(e){}open(){this.status=d.OPEN,this.onopen()}close(){this.status=d.CLOSED,this.onclose()}}r()(d,"OPEN",1),r()(d,"CLOSED",2);class f extends d{constructor(){super({}),this.sab={},this.port=null,this.onmessage=h,this.sender=h,this.videoSender=h,this.reciver=h,this.wasmSender=h}send(e){this.sender(e)}sendVideo(e,t){this.videoSender(e,t)}sendWasm(e){this.wasmSender(e)}delete(){try{var e,t;this.onmessage=h,this.sender=h,this.videoSender=h,this.reciver=h,this.wasmSender=h;let{consumer:n}=(null===(e=this.sab)||void 0===e?void 0:e.reciver)||{};null==n||n.setDataCallback(h),null==n||n.cancelConsume(),this.sab={},this.port&&(this.port.onmessage=h),null===(t=this.port)||void 0===t||t.close()}catch(e){}}open(){this.status!=d.OPEN||this.onopen()}close(){this.status=d.CLOSED,this.delete(),this.onclose()}_onmessage(e){let{cmd:t,data:n}=e.data;switch(t){case o.J:this.reciver();break;case o.K:this.onmessage(n,0);break;case o.L:this.status=n,this.status==d.OPEN?this.onopen():this.onclose()}}createSendAndReceive(){if(!this.port)return;let{sender:e,reciver:t}=this.sab,{sabqueue:n,interval:s}=e||{};n?s?(this.sender=e=>{n.enqueue(e)},this.wasmSender=e=>{n.enqueue(e)},this.videoSender=(e,t)=>{if(!n.enqueueSafe([e,t],!1)){let s=new Uint8Array(t.length+e.length);s.set(e,0),s.set(t,e.length),n.enqueueSafe(s)}}):(this.sender=e=>{n.enqueue(e),this.port.postMessage({cmd:o.J})},this.wasmSender=e=>{n.enqueue(e),this.port.postMessage({cmd:o.J})},this.videoSender=(e,t)=>{if(!n.enqueueSafe([e,t],!1)){let s=new Uint8Array(t.length+e.length);s.set(e,0),s.set(t,e.length),n.enqueueSafe(s)}this.port.postMessage({cmd:o.J})}):(this.sender=e=>{this.port.postMessage({cmd:o.K,data:e},[e.buffer])},this.wasmSender=e=>{let t=new Uint8Array(e.length);t.set(e,0),this.port.postMessage({cmd:o.K,data:t},[t.buffer])},this.videoSender=(e,t)=>{let n=new Uint8Array(t.length+e.length);n.set(e,0),n.set(t,e.length),this.port.postMessage({cmd:o.K,data:n},[n.buffer])});let{sabqueue:r,consumer:u,useCopy:c,interval:l,offset:h}=t||{};if(u&&(u.cancelConsume(),u=null),r){const e=c?e=>{this.onmessage(e,0)}:h?e=>{this.onmessage(e.uint8s,e.begin)}:e=>{this.onmessage(e.uint8s,0)};let n=null,s=_.dataTransportMgr.monitorlogfn;if(l&&s){var d;let e=new i.b({tag:"WCL_M,VDRB"+(null===(d=this.onwer)||void 0===d?void 0:d.type),interval:1e4,reportcallback:m});n=e.timeoutReport.bind(e)}u=new a.a(r,e,n),t.consumer=u,l?u.consume(l,c):this.reciver=()=>{u.consumeAll(c)}}}setMsgPort(e){e!=this.port&&(this.port&&(this.port.onmessage=h,this.port.close(),this.port=null),this.port=e,this.port&&(this._listeners||(this._listeners=this._onmessage.bind(this)),this.port.onmessage=this._listeners,this.createSendAndReceive()))}setSabBuffer(e,t){if(null!=e&&e.sab){let{sab:t,useCopy:n,interval:s,offset:r,length:i,useOneElement:o}=e,u=new a.b(r>0?t.buffer:t,void 0,void 0,!!o,r,i,r>0?t:null);this.sab.sender={sabqueue:u,interval:s,useCopy:n,offset:r}}if(null!=t&&t.sab){var n;let{sab:e,useCopy:s,interval:r,offset:i,length:o,useOneElement:u}=t,c=new a.b(i>0?e.buffer:e,void 0,void 0,!!u,i,o,i>0?e:null),{consumer:l}=(null===(n=this.sab)||void 0===n?void 0:n.reciver)||{};l&&(l.cancelConsume(),this.sab.reciver.consumer=null,this.sab.reciver.sabqueue=null),this.sab.reciver={sabqueue:c,interval:r,useCopy:s,offset:i}}this.createSendAndReceive()}setStatus(e){this.port?this.status!=e&&(this.status=e,this.port.postMessage({cmd:o.L,data:e})):console.error("MsgQueueSocket not initialized")}}class _{constructor(e){this.onmessage=h,this.onopen=h,this.onclose=h,this.connect_type=e.connect_type||_.UDP,this.type=e.type,this.id=e.id||Math.floor(performance.now())<<10|e.type,this.sock=e.sock||new d,this.mgr=e.mgr,this.sock.onmessage=this._onmessage.bind(this),this.sock.onclose=this._onclose.bind(this),this.sock.onopen=this._onopen.bind(this),this.sock.onwer=this,this.remote=e.remote,this.sabInfo=null,this.portInfo=null,this.target_thread=u.b.NO_THREAD,this.local=!!e.local,this._create()}_create(){let e=_.dataTransportMgr;e.transportlists.push(this),!this.local&&e&&e.mainThread&&e.type==c.a.THREAD_SUB&&e.createRemoteTransport(this,e.mainThread)}_close(){let e=_.dataTransportMgr,t=e.transportlists.indexOf(this);-1!=t&&e.transportlists.splice(t,1),!this.local&&e&&e.mainThread&&e.type==c.a.THREAD_SUB&&e.closeRemoteTransport(this,e.mainThread)}_onmessage(e,t){this.onmessage(e,t)}_onclose(){this.onclose()}_onopen(){this.onopen()}isReady(){return!0}send(e){this.sock.send(e)}sendVideo(e,t){this.sock.sendVideo(e,t)}sendWasmData(e){this.sock.sendWasm(e)}setSocket(e){let t=this.sock;this.sock=e,this.sock&&(this.sock.onwer=this,this.sock.onmessage=this._onmessage.bind(this),this.sock.onclose=this._onclose.bind(this),this.sock.onopen=this._onopen.bind(this)),t&&t.delete()}open(){this.sock.open()}close(){this._close(),this.sock.close()}setMsgPort(e){if(!(this.sock instanceof f))throw new Error("tansport sock is not a MsgQueueSocket");this.sock.setMsgPort(e)}setSabBuffer(e,t){if(!(this.sock instanceof f))throw new Error("tansport sock is not a MsgQueueSocket");this.sock.setSabBuffer(e,t)}setStatus(e){this.sock instanceof f&&this.sock.setStatus(e)}}r()(_,"UDP",0),r()(_,"TCP",1),r()(_,"RLB_UDP",2),r()(_,"dataTransportMgr",null);class p{constructor(e){this.sock=null,this.onmessage=h}isReady(){return!1}send(){h()}setStatus(e){0}}function m(e,t,n,s){var r;null===(r=c.a.monitorlogfn)||void 0===r||r.call(c.a,e,"".concat(t,",").concat(n,",").concat(s))}},function(e,t,n){var s=n(35);e.exports=function(e,t,n){return(t=s(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t,n){"use strict";n.d(t,"q",(function(){return s})),n.d(t,"b",(function(){return r})),n.d(t,"c",(function(){return i})),n.d(t,"d",(function(){return a})),n.d(t,"i",(function(){return o})),n.d(t,"j",(function(){return u})),n.d(t,"l",(function(){return c})),n.d(t,"r",(function(){return l})),n.d(t,"s",(function(){return h})),n.d(t,"t",(function(){return d})),n.d(t,"m",(function(){return f})),n.d(t,"o",(function(){return _})),n.d(t,"e",(function(){return p})),n.d(t,"n",(function(){return m})),n.d(t,"p",(function(){return b})),n.d(t,"g",(function(){return E})),n.d(t,"h",(function(){return g})),n.d(t,"a",(function(){return A})),n.d(t,"f",(function(){return v})),n.d(t,"k",(function(){return S}));const s=1,r=2,i=3,a=4,o=5,u=6,c=7,l=8,h=9,d=10,f=11,_=129,p=130,m=131,b=132,E=133,g=134,A=135,v=136,S=137},,function(e,t,n){"use strict";n.d(t,"a",(function(){return i})),n.d(t,"b",(function(){return a}));var s=n(7),r=n.n(s);class i{constructor(){this.onmessage=()=>{}}addEventListener(){}close(){}}class a{constructor(e){this.transportMap={},this.netthreadworker=null,this.type=e.type,this.mgr=e,this.transportlistsChnagelinster=[]}addEventListener(e){-1==this.transportlistsChnagelinster.indexOf(e)&&this.transportlistsChnagelinster.push(e)}removeEventListener(e){let t=this.transportlistsChnagelinster.indexOf(e);-1!=t&&this.transportlistsChnagelinster.splice(t,1)}addTransport(e,t){e.id in this.transportMap||(this.transportMap[e.id]=e,this.transportlistsChnagelinster.forEach(n=>{n(e,t,1)}))}removeTransport(e){var t;let n=e.id;n in this.transportMap&&(delete this.transportMap[n],null===(t=e.sock)||void 0===t||t.close(),this.transportlistsChnagelinster.forEach(t=>{t(e,e.channel,0)}))}getTransportByType(e){for(let t in this.transportMap){let n=this.transportMap[t],s=n.target_thread==a.SELF_THREAD;if(n.type==e&&s)return n}return null}}r()(a,"NO_THREAD",0),r()(a,"SELF_THREAD",1)},function(e,t,n){"use strict";function s(){this.a=[],this.b=0,this.residue=null}s.prototype.getLength=function(){return this.a.length-this.b},s.prototype.isEmpty=function(){return 0==this.a.length},s.prototype.enqueue=function(e){this.a.push(e)},s.prototype.dequeue=function(){if(0!=this.a.length){var e=this.a[this.b];return 2*++this.b>=this.a.length&&(this.a=this.a.slice(this.b),this.b=0),e}return null},s.prototype.peek=function(){return 0<this.a.length?this.a[this.b]:void 0},s.prototype.clear=function(){this.a=[],this.b=0},t.a=s},function(e,t,n){"use strict";n.d(t,"a",(function(){return s})),n.d(t,"b",(function(){return r})),n.d(t,"c",(function(){return i}));const s={AUDIO:1,SHARING:2,VIDEO:3},r={VIDEO_ENCODE:"0",VIDEO_DECODE:"1",AUDIO_ENCODE:"2",AUDIO_DECODE:"3",SHARING_ENCODE:"4",SHARING_DECODE:"5"},i=((()=>{const e={};for(const t in r)e[r[t]]="WCL_"+t})(),{[r.AUDIO_ENCODE]:"audio.encode",[r.AUDIO_DECODE]:"audio.decode",[r.VIDEO_ENCODE]:"video.encode",[r.VIDEO_DECODE]:"video.decode",[r.SHARING_ENCODE]:"share.encode",[r.SHARING_DECODE]:"share.decode"})},function(e,t,n){"use strict";n.d(t,"b",(function(){return c})),n.d(t,"a",(function(){return l}));var s=n(7),r=n.n(s),i=n(5),a=n(10),o=n(6),u=n(22);function c(e,t,n){if(!e)return;let s=o.a.dataTransportMgr;s.type===l.THREAD_MAIN?(s.setSabBuffer(e,t,n),e.remote.postMessage({cmd:i.gb,transportId:e.id,sender:n,reciver:t})):(e.setSabBuffer(t,n),s.mainThread.postMessage({cmd:i.gb,transportId:e.id,sender:n,reciver:t}))}class l{constructor(e){let t=e||{};this.type=t.type||l.THREAD_MAIN,this.refs={},this.transportlists=[],this.mainThread=t.remote,this.subthreadlistner=null,this.channellists=[],this.mediadatachannel=new a.b(this)}_onrecvmainthreadlistener(e){let{cmd:t,transportId:n,data:s}=e.data,r=this.transportlists.find(e=>e.id===n);if(r||t==i.s)switch(t){case i.s:this.addRemoteTransport(e.data,null);break;case i.fb:r.setMsgPort(s||new a.a);break;case i.gb:r.setSabBuffer(e.data.sender,e.data.reciver);break;case i.o:r.remote=null,this.removeTransport(r)}}_onrecvsubthreadlistener(e,t){let{cmd:n,transportId:s,transportType:r}=t.data,a=this.transportlists.find(e=>e.id===s);switch(n){case i.s:this.addRemoteTransport(t.data,e);break;case i.gb:this.setSabBufferInfo(a,t.data.sender,t.data.reciver);break;case i.o:a.remote=null,this.removeTransport(a)}}createRemoteTransport(e,t){let n={cmd:i.s,transportType:e.type,transportId:e.id};e.portInfo?(n.port=e.portInfo,t.postMessage(n,[e.portInfo])):t.postMessage(n)}closeRemoteTransport(e,t){t.postMessage({cmd:i.o,transportType:e.type,transportId:e.id})}setRemoteTransportSABBUffer(e,t){var n,s,r,a;(null!==(n=e.sabInfo)&&void 0!==n&&n.sender||null!==(s=e.sabInfo)&&void 0!==s&&s.reciver)&&t.postMessage({cmd:i.gb,transportId:e.id,sender:null===(r=e.sabInfo)||void 0===r?void 0:r.sender,reciver:null===(a=e.sabInfo)||void 0===a?void 0:a.reciver})}addRemoteTransport(e,t){let{transportId:n,port:s,transportType:r}=e;let i=this.createMsgSocketTransport(r);i.id=n,i.remote=t,i.portInfo=s,s?i.setMsgPort(i.portInfo):this.bindMessageChannel(i),this.addTransport(i)}addTransport(e){let t=this.getChannelByTransportType(e.type);if(!t)return;let n=t.target_thread||a.b.SELF_THREAD;e.target_thread=n,this.bindTransPortForChannel(e,t)}removeTransport(e){let t=this.transportlists.indexOf(e);-1!=t&&(this.transportlists.splice(t,1),e.remote&&this.closeRemoteTransport(e,e.remote),e.target_thread!=a.b.NO_THREAD&&this.unbindTransPortForChannel(e))}createMsgSocketTransport(e){let t=null;return t=new o.a({mgr:this,sock:new o.d,type:e,local:!0}),t}bindMessageChannel(e){if(this.type!=l.THREAD_MAIN)return void console.error("error this call only in main thread");let t=new MessageChannel;e.portInfo=t.port1,e.remote.postMessage({cmd:i.fb,transportId:e.id,data:t.port2},[t.port2])}setSabBufferInfo(e,t,n){this.type==l.THREAD_MAIN?(e.sabInfo||(e.sabInfo={}),n&&(n.useCopy=!0),t&&(t.useCopy=!0),e.sabInfo={sender:t,reciver:n},e.target_thread!=a.b.NO_THREAD&&(e.target_thread!=a.b.SELF_THREAD?this.setRemoteTransportSABBUffer(e,e.target_thread):e.setSabBuffer(t,n))):console.error("<<<<< setSabBufferInfo in sub thread")}addDataChannel(e){if(e instanceof u.a){try{this.checkTransport(e)}catch(e){console.error("addDataChannel error",e)}this.channellists.push(e)}else console.error("channel must be a DataChannelWrapper")}removeDataChannel(e){if(!(e instanceof u.a))return void console.error("channel must be a DataChannelWrapper");let t=this.channellists.indexOf(e);-1!==t&&this.channellists.splice(t,1)}removeTransportByRemote(e){let t=[];for(let n=0;n<this.channellists.length;n++){let s=this.channellists[n];s.remote===e&&t.push(s)}for(let e=0;e<t.length;e++)this.removeTransport(t[e])}reinit(){let e=[...this.transportlists];for(let t=0;t<e.length;t++)this.removeTransport(e[t])}getTransportByType(e){return this.mediadatachannel.getTransportByType(e)}addTransportListChangeListener(e){this.mediadatachannel.addEventListener(e)}remoteTransportListChangeListener(e){this.mediadatachannel.removeEventListener(e)}checkTransport(e){this.transportlists.forEach(t=>{if(!e.transportlists.includes(t.type))return;let n=e.target_thread||a.b.SELF_THREAD;n==t.target_thread||(this.type==l.THREAD_MAIN&&t.target_thread!=a.b.NO_THREAD&&t.target_thread!=n&&(this.unbindTransPortForChannel(t),this.bindMessageChannel(t)),t.target_thread=n,this.bindTransPortForChannel(t,e))})}bindTransPortForChannel(e,t){e.channel=t;let n=e.target_thread;if(n!=a.b.SELF_THREAD)this.createRemoteTransport(e,n),this.setRemoteTransportSABBUffer(e,n);else{var s,r,i,o;if(e.portInfo&&e.setMsgPort(e.portInfo),null!==(s=e.sabInfo)&&void 0!==s&&s.sender||null!==(r=e.sabInfo)&&void 0!==r&&r.reciver)e.setSabBuffer(null===(i=e.sabInfo)||void 0===i?void 0:i.sender,null===(o=e.sabInfo)||void 0===o?void 0:o.reciver);this.mediadatachannel.addTransport(e,t)}}unbindTransPortForChannel(e){e.target_thread!=a.b.SELF_THREAD?this.type==l.THREAD_MAIN&&this.closeRemoteTransport(e,e.target_thread):this.mediadatachannel.removeTransport(e)}getChannelByTransportType(e){for(let t=0;t<this.channellists.length;t++){let n=this.channellists[t];if(n.isReady()&&n.transportlists.includes(e))return n}return null}}r()(l,"THREAD_MAIN",1),r()(l,"THREAD_SUB",2)},function(e,t,n){"use strict";function s(e){return e[0]<<24|e[1]<<16|e[2]<<8|e[3]}n.d(t,"b",(function(){return i})),n.d(t,"c",(function(){return r})),n.d(t,"a",(function(){return a}));const r={IsQosReport:function(e){return 21==e[4]&&0==e[13]},GetQOSSeq:function(e){!function(e){e[0],e[1]}(e.slice(17,19))},GetQOSTime:function(e){return 104==e[0]||16!=e[4]&&1!=e[5]?s(e.slice(19,23)):s(e.slice(15,19))},IsVideoPkg:function(e){return 103==e[0]}};class i{constructor(e){let t=e||{};this.last_report_time=0,this.timeout_count=0,this.interval_report_time=t.interval||3e3,this.tag=t.tag||"monitor",this.max_timeout=0,this.min_timeout=2147483647,this.reportcallback=t.reportcallback,this._timeoutid=0}_report(){this.reportcallback&&this.reportcallback(this.tag,Math.ceil(this.max_timeout),Math.ceil(this.min_timeout),this.timeout_count),this.timeout_count=0,this.max_timeout=0,this.min_timeout=2147483647}timeoutReport(e,t){if(this.timeout_count++,e>this.max_timeout&&(this.max_timeout=e),e<this.min_timeout&&(this.min_timeout=e),this._timeoutid)return;let n=this;this._timeoutid=setTimeout(()=>{n._report(),n._timeoutid=0},this.interval_report_time)}}class a extends class{constructor(e){this._tag=e.tag||"MONITOR",this._base_time=0,this._interval_id=-1,this._timeout=Math.max(1e3,e.timeout||0),this._callback=e.callback}_report(){let e=Date.now(),t=this.getSamples(e);t||(t=[]);let n="".concat(this._base_time,":").concat(e-this._base_time,":").concat(t.join("|"));this._callback&&this._callback(this._tag,n)}getSamples(e){}onStart(){}onStop(){}start(){-1==this._interval_id&&(this._base_time=Date.now(),this._interval_id=setInterval(this._report.bind(this),this._timeout),this.onStart())}stop(){-1!=this._interval_id&&(clearInterval(this._interval_id),this._interval_id=-1,this._report(),this.onStop())}}{constructor(e){super(e),this._count=0}onStart(){this._count=0}sample(){this._count++}getSamples(e){return[this._count]}}},function(e,t,n){"use strict";n.d(t,"c",(function(){return s})),n.d(t,"f",(function(){return r})),n.d(t,"e",(function(){return i})),n.d(t,"a",(function(){return a})),n.d(t,"k",(function(){return o})),n.d(t,"g",(function(){return u})),n.d(t,"h",(function(){return c})),n.d(t,"b",(function(){return l})),n.d(t,"j",(function(){return h})),n.d(t,"i",(function(){return d})),n.d(t,"l",(function(){return f})),n.d(t,"d",(function(){return _}));const s=3,r=6,i=34,a=38,o=-51,u="SHARING_PARAM_INFO_FROM_SOCKET",c=121,l="AUDIO_QOS_DATA",h="VIDEO_QOS_DATA",d="VIDEOSHARE_QOS_DATA",f={VIDEO_ENCODE:"0",VIDEO_DECODE:"1",AUDIO_ENCODE:"2",AUDIO_DECODE:"3",SHARING_ENCODE:"4",SHARING_DECODE:"5"},_="EXPOSE_VB_FRAME"},function(e,t,n){"use strict";const s=e=>0==(e&e-1);let r=new class{constructor(){this._highFrequencyLogs={},this.fixVersion=""}setInstance(e,t){this._instance=e,this.fixVersion=t}getMessageFromErrorOrEvent(e,t){let n=e;return t instanceof ErrorEvent?(t.filename&&(n+=" File: ".concat(t.filename)),(t.lineno||t.colno)&&(n+=" Line: ".concat(t.lineno,":").concat(t.colno)),t.message&&(n+=" Message: ".concat(t.message)),t.error&&(n+="\nStack: ".concat(t.error.stack))):t instanceof Error?(t.fileName&&(n+=" File: ".concat(t.fileName)),(t.lineNumber||t.columnNumber)&&(n+=" Line: ".concat(t.lineNumber,":").concat(t.columnNumber)),t.message&&(n+=" Message: ".concat(t.message)),t.stack&&(n+=" Stack: ".concat(t.stack)),t.name&&(n+=" Name: ".concat(t.name)),t.constraint&&(n+=" Constraint: ".concat(t.constraint))):t instanceof CloseEvent?(t.code&&(n+=" Code: ".concat(t.code)),t.reason&&(n+=" Reason: ".concat(t.reason)),n+=" wasClean: ".concat(t.wasClean)):t instanceof DOMException?(t.message&&(n+=" Message: ".concat(t.message)),t.name&&(n+=" Name: ".concat(t.name))):n+=t?t.toString():"",n}error(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;e=this.getMessageFromErrorOrEvent(e,t),this._highFrequencyLogs[e]?this._highFrequencyLogs[e]+=1:this._highFrequencyLogs[e]=1;const n=s(this._highFrequencyLogs[e]);this._instance&&n&&this._instance.error(e,[this.fixVersion])}severityerror(e,t){this._instance&&this._instance.error(JSON.stringify(e),t)}directReport(e,t){var n,s;this._instance&&(t||(t=["MEDIASDK_INFO"]),null===(n=(s=this._instance).directReport)||void 0===n||n.call(s,{msg:e},t))}warn(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;e=this.getMessageFromErrorOrEvent(e,t),this._instance&&this._instance.warn(e)}log(e){this._instance&&this._instance.log(e)}clearHighFrequencyLogs(){this._highFrequencyLogs={}}};t.a=r},function(e,t,n){"use strict";n.d(t,"b",(function(){return i})),n.d(t,"a",(function(){return a})),n.d(t,"c",(function(){return o}));var s=n(11),r=n(16);class i{static getStorageForCapacity(){return new SharedArrayBuffer(8+((arguments.length>0&&void 0!==arguments[0]?arguments[0]:80)+1)*(arguments.length>1&&void 0!==arguments[1]?arguments[1]:1500))}constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1500,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",s=arguments.length>3&&void 0!==arguments[3]&&arguments[3],r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:e.byteLength,a=arguments.length>6?arguments[6]:void 0;this.offset=r,this._BYTES_PER_ELEMENT=t,this.capacity=(i-8)/t,this.usableCapacity=this.capacity-1,this.buf=e,this.write_ptr=new Uint32Array(this.buf,r,1),this.read_ptr=new Uint32Array(this.buf,r+4,1),this.storageUint8sByteOffset=r+8,this.storageUint8s=new Uint8Array(this.buf,this.storageUint8sByteOffset,i-8),this.byteLength=i,this.label=n,this.usingOneElementBuffer=s,a&&(this.wasmMemory=a),s&&(this.oneElementBuffer=new ArrayBuffer(t)),this.repushhander=0,this.repushlogcount=0,this.monitorpace=0}checkBuffer(){this.wasmMemory&&this.wasmMemory.buffer!=this.buf&&(console.log("buffer change"),this.buf=this.wasmMemory.buffer,this.storageUint8s=new Uint8Array(this.buf,this.storageUint8sByteOffset,this.byteLength-8))}enqueue(e){return this.available_write()>0&&this.push(e),{rd:Atomics.load(this.read_ptr,0),wr:Atomics.load(this.write_ptr,0)}}enqueueSafe(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;for(this.dataBuffer||(this.dataBuffer=new s.a);this.dataBuffer.getLength()>0&&this.available_write()>0;){let e=this.dataBuffer.dequeue();e&&this.push(e)}let i=this.dataBuffer.getLength();if(e){if(this.available_write()>0&&0==i)return this.push(e),!0;if(!t)return!1;this.dataBuffer.enqueue(e),++i}if(i>0&&!this.repushhander&&(this.repushhander=setTimeout(()=>{this.repushlogcount%10==0&&console.warn("<<< retry consume cache data"),this.repushlogcount++,this.repushhander=0,this.enqueueSafe(null)},30)),i>=1e3&&(r.a.warn("Cached data in SAB reached critical value, will be cleared"),this.dataBuffer.clear(),n&&n("vqslclear")),i>0&&n){let e=performance.now();(!this.monitorpace||e-this.monitorpace>2e4)&&(this.monitorpace=e,n&&n("vqsl"+i))}return!0}push(e){return e instanceof Array?this._pushArray(e):this._push(e)}_pushArray(e){var t=Atomics.load(this.write_ptr,0);this.checkBuffer();let n=0;e.forEach(e=>{this.storageUint8s.set(e,t*this._BYTES_PER_ELEMENT+8+4+n),n+=e.byteLength}),new Uint32Array(this.buf,this.offset+t*this._BYTES_PER_ELEMENT+8,1)[0]=n;let s=(t+1)%this.capacity;return Atomics.store(this.write_ptr,0,s),!0}_push(e){var t=Atomics.load(this.write_ptr,0);this.checkBuffer(),this.storageUint8s.set(e,t*this._BYTES_PER_ELEMENT+8+4,e.byteLength),new Uint32Array(this.buf,this.offset+t*this._BYTES_PER_ELEMENT+8,1)[0]=e.byteLength;let n=(t+1)%this.capacity;return Atomics.store(this.write_ptr,0,n),!0}addReadPtr(){var e=Atomics.load(this.read_ptr,0);Atomics.store(this.read_ptr,0,(e+1)%this.capacity)}dequeue(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];var t=Atomics.load(this.read_ptr,0);this.checkBuffer();let n,s,r,i=new Uint32Array(this.buf,this.offset+t*this._BYTES_PER_ELEMENT+8,1);if(e){n=this.oneElementBuffer?new Uint8Array(this.oneElementBuffer,0,i[0]):new Uint8Array(i[0]);let e=new Uint8Array(this.storageUint8s.buffer,t*this._BYTES_PER_ELEMENT+8+4+this.storageUint8sByteOffset,n.byteLength);n.set(e,0)}else n=this.storageUint8s.subarray(t*this._BYTES_PER_ELEMENT+8+4,t*this._BYTES_PER_ELEMENT+8+4+i[0]),s=t*this._BYTES_PER_ELEMENT+8+4+this.storageUint8sByteOffset,r=t*this._BYTES_PER_ELEMENT+8+4+i[0]+this.storageUint8sByteOffset;return e&&Atomics.store(this.read_ptr,0,(t+1)%this.capacity),e?n:{bCopyData:e,uint8s:n,begin:s,end:r}}available_read(){var e=Atomics.load(this.read_ptr,0),t=Atomics.load(this.write_ptr,0);return this._available_read(e,t)}available_write(){var e=Atomics.load(this.read_ptr,0),t=Atomics.load(this.write_ptr,0);return this._available_write(e,t)}is_available_write(){var e=Atomics.load(this.read_ptr,0),t=Atomics.load(this.write_ptr,0);return this._is_available_write(e,t)}_available_read(e,t){return(t+this.capacity-e)%this.capacity}_available_write(e,t){return this.usableCapacity-this._available_read(e,t)}_is_available_write(e,t){return this._available_write(e,t)>0}_storage_capacity(){return this.capacity}}class a{constructor(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:50,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:80;if(!(e instanceof i))throw new Error("RingBuffer required");this.rb=e,this.dataCallback=t,this.interval=null,this.requestID=null,this.timeout_call=n,this.tick_lasted_time=0,this.timeoutMS=s,this.maxCount=r}setDataCallback(e){this.dataCallback=e}consume(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:20,t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];this.interval||(this.bCopyData=t,this.interval=setInterval(()=>{let e=performance.now();if(this.timeout_call){if(0!=this.tick_lasted_time){let t=e-this.tick_lasted_time;t>=this.timeoutMS&&this.timeout_call(t,e)}this.tick_lasted_time=e}this._dequeue()},e),console.log("consume interval ".concat(this.interval)))}consumeAll(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.bCopyData=e,this._dequeue()}_dequeue(){let e=Math.min(this.rb.available_read(),this.maxCount);for(this.consoume_count=0;this.consoume_count<e;){this.consoume_count++;let e=this.rb.dequeue(this.bCopyData);this.dataCallback(e),this.bCopyData||this.rb.addReadPtr()}}_consumeForAnimationFrame(){this._dequeue(),this.requestID=requestAnimationFrame(this._consumeForAnimationFrame.bind(this))}consumeUsingRequestAnimationFrame(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.requestID||(this.bCopyData=e,this._consumeForAnimationFrame())}cancelConsume(){console.log("cancelConsume interval ".concat(this.interval," requestID ").concat(this.requestID)),this.tick_lasted_time=0,clearInterval(this.interval),this.requestID&&cancelAnimationFrame(this.requestID),this.interval=null,this.requestID=null}}class o{constructor(){this.timeStampKey="video_timestamp",this.keysList=["video_ssrc","video_width","video_height","rendering_x","rendering_y","rendering_w","rendering_h","rotation","yuv_limited"],this.bCopyData=null,this.begin=null,this.end=null}setOBJ(e){this.obj=e,this.yuvUint8s=e.data}setBuffer(e){!1===e.bCopyData?(this.objUint8s=e.uint8s,this.bCopyData=e.bCopyData,this.begin=e.begin,this.end=e.end):(this.objUint8s=e,this.bCopyData=!0,this.begin=0,this.end=e.byteLength)}buffer2Obj(){let e=new Uint32Array(this.objUint8s.buffer,this.begin,9),t=new DataView(this.objUint8s.buffer,this.begin+40,16),n={};this.keysList.forEach((t,s)=>{n[t]=e[s]}),n[this.timeStampKey]=Number(t.getBigUint64(0,!0));let s,r=Number(t.getBigUint64(8,!0)),i=new Uint8Array(this.objUint8s.buffer,this.begin+40+8+8,r);return s=(this.bCopyData,i),n.data=s,n}obj2buffer(){let e=new Uint8Array(56),t=this.keysList,n=new Uint32Array(e.buffer,0,9),s=new DataView(e.buffer,40,16);return t.forEach((e,t)=>{n[t]=this.obj[e]}),s.setBigUint64(0,BigInt(this.obj[this.timeStampKey]),!0),s.setBigUint64(8,BigInt(this.yuvUint8s.byteLength),!0),[e,this.yuvUint8s]}}},,,,,function(e,t,n){"use strict";var s=n(7),r=n.n(s),i=n(14);function a(e){let t=e||{};this._samples=[],this._interval_id=0,this._lasted_update_time=0,this._lasted_group_time=0,this._enable=!1,this._interval_time=t.interval||3e4,this._customer_callback=t.report_call,this._tag=t.tag||"netreport",this._group_interval=t.group_interval||1e3,this._enable_advanced=t.advanced||!1,this._current_count=0,this._qos_report=new i.b({tag:"jitter",interval:3e4,reportcallback:this._qos_report_timeout.bind(this)}),this._qos_report_samples=[],this._cureen_qos_report=0}a.prototype._qos_report_timeout=function(e,t,n,s){if(this._customer_callback){let r="".concat(e,",").concat(t,",").concat(n,",").concat(s);this._customer_callback(this._tag+"TimeOut",r)}},a.prototype._report=function(){let e=(new Date).getTime(),t="".concat(e,"-").concat(this._samples.length,"-").concat(this._samples),n="".concat(e,"-").concat(this._qos_report_samples.length,"-").concat(this._qos_report_samples);t=t.replaceAll(",","|"),n=n.replaceAll(",","|"),this._customer_callback?(this._customer_callback(this._tag,t),this._enable_advanced&&this._customer_callback(this._tag+"QOS",n)):console.error("tag:".concat(this._tag,",").concat(t))},a.prototype._group=function(){let e=performance.now();if(e>=this._lasted_group_time+1700){let t=Math.round((e-this._lasted_group_time)/1e3)-1;for(let e=0;e<t;e++)this._samples.push(-1)}this._lasted_group_time=e,this._samples.push(this._current_count),this._qos_report_samples.push(this._cureen_qos_report),this._cureen_qos_report=0,this._current_count=0,e>=this._lasted_update_time+this._interval_time&&(this._lasted_update_time=e,this._report(),this._samples=[],this._qos_report_samples=[])},a.prototype.start=function(){this._enable||(this._lasted_update_time=performance.now(),this._lasted_group_time=this._lasted_update_time,this._samples=[],this._current_count=0,this._qos_report_samples=[],this._cureen_qos_report=0,this._interval_id=setInterval(this._group.bind(this),this._group_interval),this._enable=!0)},a.prototype.stop=function(){this._enable&&(clearInterval(this._interval_id),this._interval_id=0,this._enable=!1)},a.prototype.sample=function(e){if(this._enable&&(this._current_count++,this._enable_advanced)){if(i.c.IsQosReport(e))return void this._cureen_qos_report++;if(i.c.IsVideoPkg(e)){let t=i.c.GetQOSTime(e),n=performance.now();if(this._lasted_qos_ts){let e=n-this._lasted_sys_ts-(t-this._lasted_qos_ts);e>30&&this._qos_report.timeoutReport(e,n)}this._lasted_qos_ts=t,this._lasted_sys_ts=n,this._lasted_data=e}}};var o=n(8),u=n(12),c=n(5);n.d(t,"b",(function(){return l})),n.d(t,"a",(function(){return h}));class l{constructor(e,t){this.type=e,this.transportlists=[],this.transfered=!!t,this.onmessage=()=>{}}send(){}isReady(){return!1}}class h{constructor(e,t,n,s){this.id=e,this.typ