@vinay.kumar.ha/videosdk-ui-toolkit 2.3.5-1.5 → 2.3.5-1.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/lib/annoter.min.js +3 -0
- package/dist/lib/audio.encode.wasm +0 -0
- package/dist/lib/audio.light.simd.wasm +0 -0
- package/dist/lib/audio.simd.wasm +0 -0
- package/dist/lib/audio_light_simd.min.js +2 -0
- package/dist/lib/audio_simd.min.js +2 -0
- package/dist/lib/graphics.min.js +2 -0
- package/dist/lib/js_audio_level_worklet_process.min.js +2 -0
- package/dist/lib/js_audio_level_worklet_process_light.min.js +2 -0
- package/dist/lib/js_audio_process.min.js +2 -0
- package/dist/lib/js_audio_processor_worklet.min.js +2 -0
- package/dist/lib/js_audio_worklet.min.js +2 -0
- package/dist/lib/js_audio_worklet_light_simd.min.js +2 -0
- package/dist/lib/js_audio_worklet_process.min.js +2 -0
- package/dist/lib/js_audio_worklet_simd.min.js +2 -0
- package/dist/lib/js_media.min.js +3 -0
- package/dist/lib/js_sharing_audio_worklet.min.js +2 -0
- package/dist/lib/manifest.json +338 -0
- package/dist/lib/mesh_thread.min.js +2 -0
- package/dist/lib/net.wasm +0 -0
- package/dist/lib/net_thread.min.js +2 -0
- package/dist/lib/pako.min.js +2 -0
- package/dist/lib/qrscanner.min.js +2 -0
- package/dist/lib/share_processor.min.js +2 -0
- package/dist/lib/sharing_m.min.js +3 -0
- package/dist/lib/sharing_mtsimd.min.js +3 -0
- package/dist/lib/sharing_s.min.js +2 -0
- package/dist/lib/sharing_simd.min.js +2 -0
- package/dist/lib/tp.min.js +2 -0
- package/dist/lib/tp.wasm +0 -0
- package/dist/lib/vb-resource/dualModel.bin +0 -0
- package/dist/lib/vb-resource/tf.min.js +18 -0
- package/dist/lib/vb.min.js +2 -0
- package/dist/lib/vb_worker.min.js +2 -0
- package/dist/lib/video.decode.js +1 -0
- package/dist/lib/video.decode.wasm +0 -0
- package/dist/lib/video.mt.js +1 -0
- package/dist/lib/video.mt.wasm +0 -0
- package/dist/lib/video.mtsimd.js +1 -0
- package/dist/lib/video.mtsimd.wasm +0 -0
- package/dist/lib/video.simd.js +1 -0
- package/dist/lib/video.simd.wasm +0 -0
- package/dist/lib/video_m.min.js +3 -0
- package/dist/lib/video_mtsimd.min.js +3 -0
- package/dist/lib/video_processor.min.js +2 -0
- package/dist/lib/video_s.min.js +2 -0
- package/dist/lib/video_share_mtsimd.min.js +3 -0
- package/dist/lib/video_simd.min.js +2 -0
- package/dist/lib/wasm_ssrc_stream_service_dynmod.min.js +2 -0
- package/dist/lib/webgpu_renderer_dynmod.min.js +2 -0
- package/dist/lib/wmsc.min.js +2 -0
- package/dist/videosdk-ui-toolkit.min.esm.js +1832 -1832
- package/dist/videosdk-ui-toolkit.min.umd.js +82 -82
- package/package.json +1 -1
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
(()=>{var e={1265:(e,t,r)=>{e.exports=r(4598)},6984:(e,t,r)=>{e.exports=r(9792)},7201:(e,t,r)=>{e.exports=r(3042)},1829:(e,t,r)=>{"use strict";var i=r(2222);e.exports=i},6040:(e,t,r)=>{"use strict";var i=r(8251);e.exports=i},7264:(e,t,r)=>{"use strict";var i=r(4139);r(768),r(8549),r(7152),r(1372),e.exports=i},9692:(e,t,r)=>{"use strict";var i=r(7045);e.exports=i},5663:(e,t,r)=>{"use strict";var i=r(70);e.exports=i},6823:(e,t,r)=>{"use strict";var i=r(8280),n=r(2017),a=String.prototype;e.exports=function(e){var t=e.replaceAll;return"string"==typeof e||e===a||i(a,e)&&t===a.replaceAll?n:t}},1042:(e,t,r)=>{"use strict";var i=r(8280),n=r(7511),a=String.prototype;e.exports=function(e){var t=e.trim;return"string"==typeof e||e===a||i(a,e)&&t===a.trim?n:t}},1926:(e,t,r)=>{"use strict";r(6750);var i=r(2046).Object,n=e.exports=function(e,t,r){return i.defineProperty(e,t,r)};i.defineProperty.sham&&(n.sham=!0)},2017:(e,t,r)=>{"use strict";r(1398),r(1995),r(929);var i=r(1747);e.exports=i("String","replaceAll")},7511:(e,t,r)=>{"use strict";r(727);var i=r(1747);e.exports=i("String","trim")},3842:(e,t,r)=>{"use strict";r(8545),r(3643),r(4452),r(3997),r(5084),r(2596),r(5721),r(4954),r(4123),r(3377),r(2230),r(5344),r(1660),r(4610),r(3669),r(4810),r(3325),r(7024),r(8172),r(5205);var i=r(2046);e.exports=i.Symbol},1730:(e,t,r)=>{"use strict";r(9363),r(3643),r(7057),r(4954);var i=r(560);e.exports=i.f("iterator")},1661:(e,t,r)=>{"use strict";r(8537),r(3669);var i=r(560);e.exports=i.f("toPrimitive")},3042:(e,t,r)=>{"use strict";e.exports=r(9604)},9604:(e,t,r)=>{"use strict";r(6038);var i=r(1829);e.exports=i},4997:(e,t,r)=>{"use strict";var i=r(6040);e.exports=i},2321:(e,t,r)=>{"use strict";var i=r(7264);r(3939),r(1785),r(1697),r(4664),r(3422),r(36),r(8703),r(6878),r(9671),r(359),e.exports=i},2231:(e,t,r)=>{"use strict";var i=r(9692);e.exports=i},9280:(e,t,r)=>{"use strict";var i=r(5663);e.exports=i},2159:(e,t,r)=>{"use strict";var i=r(2250),n=r(4640),a=TypeError;e.exports=function(e){if(i(e))return e;throw new a(n(e)+" is not a function")}},43:(e,t,r)=>{"use strict";var i=r(4018),n=String,a=TypeError;e.exports=function(e){if(i(e))return e;throw new a("Can't set "+n(e)+" as a prototype")}},2156:e=>{"use strict";e.exports=function(){}},9596:(e,t,r)=>{"use strict";var i=r(8280),n=TypeError;e.exports=function(e,t){if(i(t,e))return e;throw new n("Incorrect invocation")}},6624:(e,t,r)=>{"use strict";var i=r(6285),n=String,a=TypeError;e.exports=function(e){if(i(e))return e;throw new a(n(e)+" is not an object")}},1229:(e,t,r)=>{"use strict";var i=r(8311),n=r(3930),a=r(9298),s=r(6818),o=r(7812),l=r(5468),c=r(575),d=r(5543),u=r(300),h=r(3448),_=Array;e.exports=function(e){var t=a(e),r=l(this),f=arguments.length,p=f>1?arguments[1]:void 0,m=void 0!==p;m&&(p=i(p,f>2?arguments[2]:void 0));var g,v,y,b,w,S,E=h(t),M=0;if(!E||this===_&&o(E))for(g=c(t),v=r?new this(g):_(g);g>M;M++)S=m?p(t[M],M):t[M],d(v,M,S);else for(v=r?new this:[],w=(b=u(t,E)).next;!(y=n(w,b)).done;M++)S=m?s(b,p,[y.value,M],!0):y.value,d(v,M,S);return v.length=M,v}},4436:(e,t,r)=>{"use strict";var i=r(7374),n=r(4849),a=r(575),s=function(e){return function(t,r,s){var o=i(t),l=a(o);if(0===l)return!e&&-1;var c,d=n(s,l);if(e&&r!=r){for(;l>d;)if((c=o[d++])!=c)return!0}else for(;l>d;d++)if((e||d in o)&&o[d]===r)return e||d||0;return!e&&-1}};e.exports={includes:s(!0),indexOf:s(!1)}},726:(e,t,r)=>{"use strict";var i=r(8311),n=r(1907),a=r(6946),s=r(9298),o=r(575),l=r(6968),c=n([].push),d=function(e){var t=1===e,r=2===e,n=3===e,d=4===e,u=6===e,h=7===e,_=5===e||u;return function(f,p,m,g){for(var v,y,b=s(f),w=a(b),S=o(w),E=i(p,m),M=0,R=g||l,T=t?R(f,S):r||h?R(f,0):void 0;S>M;M++)if((_||M in w)&&(y=E(v=w[M],M,b),e))if(t)T[M]=y;else if(y)switch(e){case 3:return!0;case 5:return v;case 6:return M;case 2:c(T,v)}else switch(e){case 4:return!1;case 7:c(T,v)}return u?-1:n||d?d:T}};e.exports={forEach:d(0),map:d(1),filter:d(2),some:d(3),every:d(4),find:d(5),findIndex:d(6),filterReject:d(7)}},7171:(e,t,r)=>{"use strict";var i=r(8828),n=r(6264),a=r(798),s=n("species");e.exports=function(e){return a>=51||!i((function(){var t=[];return(t.constructor={})[s]=function(){return{foo:1}},1!==t[e](Boolean).foo}))}},3427:(e,t,r)=>{"use strict";var i=r(1907);e.exports=i([].slice)},4321:(e,t,r)=>{"use strict";var i=r(3427),n=Math.floor,a=function(e,t){var r=e.length;if(r<8)for(var s,o,l=1;l<r;){for(o=l,s=e[l];o&&t(e[o-1],s)>0;)e[o]=e[--o];o!==l++&&(e[o]=s)}else for(var c=n(r/2),d=a(i(e,0,c),t),u=a(i(e,c),t),h=d.length,_=u.length,f=0,p=0;f<h||p<_;)e[f+p]=f<h&&p<_?t(d[f],u[p])<=0?d[f++]:u[p++]:f<h?d[f++]:u[p++];return e};e.exports=a},4010:(e,t,r)=>{"use strict";var i=r(1793),n=r(5468),a=r(6285),s=r(6264)("species"),o=Array;e.exports=function(e){var t;return i(e)&&(t=e.constructor,(n(t)&&(t===o||i(t.prototype))||a(t)&&null===(t=t[s]))&&(t=void 0)),void 0===t?o:t}},6968:(e,t,r)=>{"use strict";var i=r(4010);e.exports=function(e,t){return new(i(e))(0===t?0:t)}},6818:(e,t,r)=>{"use strict";var i=r(6624),n=r(154);e.exports=function(e,t,r,a){try{return a?t(i(r)[0],r[1]):t(r)}catch(t){n(e,"throw",t)}}},5807:(e,t,r)=>{"use strict";var i=r(1907),n=i({}.toString),a=i("".slice);e.exports=function(e){return a(n(e),8,-1)}},3948:(e,t,r)=>{"use strict";var i=r(2623),n=r(2250),a=r(5807),s=r(6264)("toStringTag"),o=Object,l="Arguments"===a(function(){return arguments}());e.exports=i?a:function(e){var t,r,i;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(r=function(e,t){try{return e[t]}catch(e){}}(t=o(e),s))?r:l?a(t):"Object"===(i=a(t))&&n(t.callee)?"Arguments":i}},7382:(e,t,r)=>{"use strict";var i=r(8828);e.exports=!i((function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype}))},9550:e=>{"use strict";e.exports=function(e,t){return{value:e,done:t}}},1626:(e,t,r)=>{"use strict";var i=r(9447),n=r(4284),a=r(5817);e.exports=i?function(e,t,r){return n.f(e,t,a(1,r))}:function(e,t,r){return e[t]=r,e}},5817:e=>{"use strict";e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},5543:(e,t,r)=>{"use strict";var i=r(9447),n=r(4284),a=r(5817);e.exports=function(e,t,r){i?n.f(e,t,a(0,r)):e[t]=r}},9251:(e,t,r)=>{"use strict";var i=r(4284);e.exports=function(e,t,r){return i.f(e,t,r)}},8055:(e,t,r)=>{"use strict";var i=r(1626);e.exports=function(e,t,r,n){return n&&n.enumerable?e[t]=r:i(e,t,r),e}},2802:(e,t,r)=>{"use strict";var i=r(8055);e.exports=function(e,t,r){for(var n in t)r&&r.unsafe&&e[n]?e[n]=t[n]:i(e,n,t[n],r);return e}},2532:(e,t,r)=>{"use strict";var i=r(5951),n=Object.defineProperty;e.exports=function(e,t){try{n(i,e,{value:t,configurable:!0,writable:!0})}catch(r){i[e]=t}return t}},9447:(e,t,r)=>{"use strict";var i=r(8828);e.exports=!i((function(){return 7!==Object.defineProperty({},1,{get:function(){return 7}})[1]}))},9552:(e,t,r)=>{"use strict";var i=r(5951),n=r(6285),a=i.document,s=n(a)&&n(a.createElement);e.exports=function(e){return s?a.createElement(e):{}}},8024:e=>{"use strict";var t=TypeError;e.exports=function(e){if(e>9007199254740991)throw t("Maximum allowed index exceeded");return e}},9287:e=>{"use strict";e.exports={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0}},376:e=>{"use strict";e.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},6794:(e,t,r)=>{"use strict";var i=r(5951).navigator,n=i&&i.userAgent;e.exports=n?String(n):""},798:(e,t,r)=>{"use strict";var i,n,a=r(5951),s=r(6794),o=a.process,l=a.Deno,c=o&&o.versions||l&&l.version,d=c&&c.v8;d&&(n=(i=d.split("."))[0]>0&&i[0]<4?1:+(i[0]+i[1])),!n&&s&&(!(i=s.match(/Edge\/(\d+)/))||i[1]>=74)&&(i=s.match(/Chrome\/(\d+)/))&&(n=+i[1]),e.exports=n},1091:(e,t,r)=>{"use strict";var i=r(5951),n=r(6024),a=r(2361),s=r(2250),o=r(3846).f,l=r(7463),c=r(2046),d=r(8311),u=r(1626),h=r(9724);r(6128);var _=function(e){var t=function(r,i,a){if(this instanceof t){switch(arguments.length){case 0:return new e;case 1:return new e(r);case 2:return new e(r,i)}return new e(r,i,a)}return n(e,this,arguments)};return t.prototype=e.prototype,t};e.exports=function(e,t){var r,n,f,p,m,g,v,y,b,w=e.target,S=e.global,E=e.stat,M=e.proto,R=S?i:E?i[w]:i[w]&&i[w].prototype,T=S?c:c[w]||u(c,w,{})[w],x=T.prototype;for(p in t)n=!(r=l(S?p:w+(E?".":"#")+p,e.forced))&&R&&h(R,p),g=T[p],n&&(v=e.dontCallGetSet?(b=o(R,p))&&b.value:R[p]),m=n&&v?v:t[p],(r||M||typeof g!=typeof m)&&(y=e.bind&&n?d(m,i):e.wrap&&n?_(m):M&&s(m)?a(m):m,(e.sham||m&&m.sham||g&&g.sham)&&u(y,"sham",!0),u(T,p,y),M&&(h(c,f=w+"Prototype")||u(c,f,{}),u(c[f],p,m),e.real&&x&&(r||!x[p])&&u(x,p,m)))}},8828:e=>{"use strict";e.exports=function(e){try{return!!e()}catch(e){return!0}}},6024:(e,t,r)=>{"use strict";var i=r(1505),n=Function.prototype,a=n.apply,s=n.call;e.exports="object"==typeof Reflect&&Reflect.apply||(i?s.bind(a):function(){return s.apply(a,arguments)})},8311:(e,t,r)=>{"use strict";var i=r(2361),n=r(2159),a=r(1505),s=i(i.bind);e.exports=function(e,t){return n(e),void 0===t?e:a?s(e,t):function(){return e.apply(t,arguments)}}},1505:(e,t,r)=>{"use strict";var i=r(8828);e.exports=!i((function(){var e=function(){}.bind();return"function"!=typeof e||e.hasOwnProperty("prototype")}))},3930:(e,t,r)=>{"use strict";var i=r(1505),n=Function.prototype.call;e.exports=i?n.bind(n):function(){return n.apply(n,arguments)}},6833:(e,t,r)=>{"use strict";var i=r(9447),n=r(9724),a=Function.prototype,s=i&&Object.getOwnPropertyDescriptor,o=n(a,"name"),l=o&&"something"===function(){}.name,c=o&&(!i||i&&s(a,"name").configurable);e.exports={EXISTS:o,PROPER:l,CONFIGURABLE:c}},1871:(e,t,r)=>{"use strict";var i=r(1907),n=r(2159);e.exports=function(e,t,r){try{return i(n(Object.getOwnPropertyDescriptor(e,t)[r]))}catch(e){}}},2361:(e,t,r)=>{"use strict";var i=r(5807),n=r(1907);e.exports=function(e){if("Function"===i(e))return n(e)}},1907:(e,t,r)=>{"use strict";var i=r(1505),n=Function.prototype,a=n.call,s=i&&n.bind.bind(a,a);e.exports=i?s:function(e){return function(){return a.apply(e,arguments)}}},1747:(e,t,r)=>{"use strict";var i=r(5951),n=r(2046);e.exports=function(e,t){var r=n[e+"Prototype"],a=r&&r[t];if(a)return a;var s=i[e],o=s&&s.prototype;return o&&o[t]}},5582:(e,t,r)=>{"use strict";var i=r(2046),n=r(5951),a=r(2250),s=function(e){return a(e)?e:void 0};e.exports=function(e,t){return arguments.length<2?s(i[e])||s(n[e]):i[e]&&i[e][t]||n[e]&&n[e][t]}},3448:(e,t,r)=>{"use strict";var i=r(3948),n=r(9367),a=r(7136),s=r(3742),o=r(6264)("iterator");e.exports=function(e){if(!a(e))return n(e,o)||n(e,"@@iterator")||s[i(e)]}},300:(e,t,r)=>{"use strict";var i=r(3930),n=r(2159),a=r(6624),s=r(4640),o=r(3448),l=TypeError;e.exports=function(e,t){var r=arguments.length<2?o(e):t;if(n(r))return a(i(r,e));throw new l(s(e)+" is not iterable")}},6656:(e,t,r)=>{"use strict";var i=r(1907),n=r(1793),a=r(2250),s=r(5807),o=r(160),l=i([].push);e.exports=function(e){if(a(e))return e;if(n(e)){for(var t=e.length,r=[],i=0;i<t;i++){var c=e[i];"string"==typeof c?l(r,c):"number"!=typeof c&&"Number"!==s(c)&&"String"!==s(c)||l(r,o(c))}var d=r.length,u=!0;return function(e,t){if(u)return u=!1,t;if(n(this))return t;for(var i=0;i<d;i++)if(r[i]===e)return t}}}},9367:(e,t,r)=>{"use strict";var i=r(2159),n=r(7136);e.exports=function(e,t){var r=e[t];return n(r)?void 0:i(r)}},7703:(e,t,r)=>{"use strict";var i=r(1907),n=r(9298),a=Math.floor,s=i("".charAt),o=i("".replace),l=i("".slice),c=/\$([$&'`]|\d{1,2}|<[^>]*>)/g,d=/\$([$&'`]|\d{1,2})/g;e.exports=function(e,t,r,i,u,h){var _=r+e.length,f=i.length,p=d;return void 0!==u&&(u=n(u),p=c),o(h,p,(function(n,o){var c;switch(s(o,0)){case"$":return"$";case"&":return e;case"`":return l(t,0,r);case"'":return l(t,_);case"<":c=u[l(o,1,-1)];break;default:var d=+o;if(0===d)return n;if(d>f){var h=a(d/10);return 0===h?n:h<=f?void 0===i[h-1]?s(o,1):i[h-1]+s(o,1):n}c=i[d-1]}return void 0===c?"":c}))}},5951:function(e,t,r){"use strict";var i=function(e){return e&&e.Math===Math&&e};e.exports=i("object"==typeof globalThis&&globalThis)||i("object"==typeof window&&window)||i("object"==typeof self&&self)||i("object"==typeof r.g&&r.g)||i("object"==typeof this&&this)||function(){return this}()||Function("return this")()},9724:(e,t,r)=>{"use strict";var i=r(1907),n=r(9298),a=i({}.hasOwnProperty);e.exports=Object.hasOwn||function(e,t){return a(n(e),t)}},8530:e=>{"use strict";e.exports={}},2416:(e,t,r)=>{"use strict";var i=r(5582);e.exports=i("document","documentElement")},3648:(e,t,r)=>{"use strict";var i=r(9447),n=r(8828),a=r(9552);e.exports=!i&&!n((function(){return 7!==Object.defineProperty(a("div"),"a",{get:function(){return 7}}).a}))},6946:(e,t,r)=>{"use strict";var i=r(1907),n=r(8828),a=r(5807),s=Object,o=i("".split);e.exports=n((function(){return!s("z").propertyIsEnumerable(0)}))?function(e){return"String"===a(e)?o(e,""):s(e)}:s},2647:(e,t,r)=>{"use strict";var i=r(1907),n=r(2250),a=r(6128),s=i(Function.toString);n(a.inspectSource)||(a.inspectSource=function(e){return s(e)}),e.exports=a.inspectSource},4932:(e,t,r)=>{"use strict";var i,n,a,s=r(551),o=r(5951),l=r(6285),c=r(1626),d=r(9724),u=r(6128),h=r(2522),_=r(8530),f="Object already initialized",p=o.TypeError,m=o.WeakMap;if(s||u.state){var g=u.state||(u.state=new m);g.get=g.get,g.has=g.has,g.set=g.set,i=function(e,t){if(g.has(e))throw new p(f);return t.facade=e,g.set(e,t),t},n=function(e){return g.get(e)||{}},a=function(e){return g.has(e)}}else{var v=h("state");_[v]=!0,i=function(e,t){if(d(e,v))throw new p(f);return t.facade=e,c(e,v,t),t},n=function(e){return d(e,v)?e[v]:{}},a=function(e){return d(e,v)}}e.exports={set:i,get:n,has:a,enforce:function(e){return a(e)?n(e):i(e,{})},getterFor:function(e){return function(t){var r;if(!l(t)||(r=n(t)).type!==e)throw new p("Incompatible receiver, "+e+" required");return r}}}},7812:(e,t,r)=>{"use strict";var i=r(6264),n=r(3742),a=i("iterator"),s=Array.prototype;e.exports=function(e){return void 0!==e&&(n.Array===e||s[a]===e)}},1793:(e,t,r)=>{"use strict";var i=r(5807);e.exports=Array.isArray||function(e){return"Array"===i(e)}},2250:e=>{"use strict";var t="object"==typeof document&&document.all;e.exports=void 0===t&&void 0!==t?function(e){return"function"==typeof e||e===t}:function(e){return"function"==typeof e}},5468:(e,t,r)=>{"use strict";var i=r(1907),n=r(8828),a=r(2250),s=r(3948),o=r(5582),l=r(2647),c=function(){},d=o("Reflect","construct"),u=/^\s*(?:class|function)\b/,h=i(u.exec),_=!u.test(c),f=function(e){if(!a(e))return!1;try{return d(c,[],e),!0}catch(e){return!1}},p=function(e){if(!a(e))return!1;switch(s(e)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return _||!!h(u,l(e))}catch(e){return!0}};p.sham=!0,e.exports=!d||n((function(){var e;return f(f.call)||!f(Object)||!f((function(){e=!0}))||e}))?p:f},7463:(e,t,r)=>{"use strict";var i=r(8828),n=r(2250),a=/#|\.prototype\./,s=function(e,t){var r=l[o(e)];return r===d||r!==c&&(n(t)?i(t):!!t)},o=s.normalize=function(e){return String(e).replace(a,".").toLowerCase()},l=s.data={},c=s.NATIVE="N",d=s.POLYFILL="P";e.exports=s},7136:e=>{"use strict";e.exports=function(e){return null==e}},6285:(e,t,r)=>{"use strict";var i=r(2250);e.exports=function(e){return"object"==typeof e?null!==e:i(e)}},4018:(e,t,r)=>{"use strict";var i=r(6285);e.exports=function(e){return i(e)||null===e}},7376:e=>{"use strict";e.exports=!0},2087:(e,t,r)=>{"use strict";var i=r(6285),n=r(5807),a=r(6264)("match");e.exports=function(e){var t;return i(e)&&(void 0!==(t=e[a])?!!t:"RegExp"===n(e))}},5594:(e,t,r)=>{"use strict";var i=r(5582),n=r(2250),a=r(8280),s=r(1175),o=Object;e.exports=s?function(e){return"symbol"==typeof e}:function(e){var t=i("Symbol");return n(t)&&a(t.prototype,o(e))}},154:(e,t,r)=>{"use strict";var i=r(3930),n=r(6624),a=r(9367);e.exports=function(e,t,r){var s,o;n(e);try{if(!(s=a(e,"return"))){if("throw"===t)throw r;return r}s=i(s,e)}catch(e){o=!0,s=e}if("throw"===t)throw r;if(o)throw s;return n(s),r}},7181:(e,t,r)=>{"use strict";var i=r(5116).IteratorPrototype,n=r(8075),a=r(5817),s=r(4840),o=r(3742),l=function(){return this};e.exports=function(e,t,r,c){var d=t+" Iterator";return e.prototype=n(i,{next:a(+!c,r)}),s(e,d,!1,!0),o[d]=l,e}},183:(e,t,r)=>{"use strict";var i=r(1091),n=r(3930),a=r(7376),s=r(6833),o=r(2250),l=r(7181),c=r(5972),d=r(9192),u=r(4840),h=r(1626),_=r(8055),f=r(6264),p=r(3742),m=r(5116),g=s.PROPER,v=s.CONFIGURABLE,y=m.IteratorPrototype,b=m.BUGGY_SAFARI_ITERATORS,w=f("iterator"),S="keys",E="values",M="entries",R=function(){return this};e.exports=function(e,t,r,s,f,m,T){l(r,t,s);var x,C,A,F=function(e){if(e===f&&I)return I;if(!b&&e&&e in L)return L[e];switch(e){case S:case E:case M:return function(){return new r(this,e)}}return function(){return new r(this)}},k=t+" Iterator",P=!1,L=e.prototype,D=L[w]||L["@@iterator"]||f&&L[f],I=!b&&D||F(f),O="Array"===t&&L.entries||D;if(O&&(x=c(O.call(new e)))!==Object.prototype&&x.next&&(a||c(x)===y||(d?d(x,y):o(x[w])||_(x,w,R)),u(x,k,!0,!0),a&&(p[k]=R)),g&&f===E&&D&&D.name!==E&&(!a&&v?h(L,"name",E):(P=!0,I=function(){return n(D,this)})),f)if(C={values:F(E),keys:m?I:F(S),entries:F(M)},T)for(A in C)(b||P||!(A in L))&&_(L,A,C[A]);else i({target:t,proto:!0,forced:b||P},C);return a&&!T||L[w]===I||_(L,w,I,{name:f}),p[t]=I,C}},5116:(e,t,r)=>{"use strict";var i,n,a,s=r(8828),o=r(2250),l=r(6285),c=r(8075),d=r(5972),u=r(8055),h=r(6264),_=r(7376),f=h("iterator"),p=!1;[].keys&&("next"in(a=[].keys())?(n=d(d(a)))!==Object.prototype&&(i=n):p=!0),!l(i)||s((function(){var e={};return i[f].call(e)!==e}))?i={}:_&&(i=c(i)),o(i[f])||u(i,f,(function(){return this})),e.exports={IteratorPrototype:i,BUGGY_SAFARI_ITERATORS:p}},3742:e=>{"use strict";e.exports={}},575:(e,t,r)=>{"use strict";var i=r(3121);e.exports=function(e){return i(e.length)}},1176:e=>{"use strict";var t=Math.ceil,r=Math.floor;e.exports=Math.trunc||function(e){var i=+e;return(i>0?r:t)(i)}},9538:(e,t,r)=>{"use strict";var i=r(9447),n=r(1907),a=r(3930),s=r(8828),o=r(2875),l=r(7170),c=r(2574),d=r(9298),u=r(6946),h=Object.assign,_=Object.defineProperty,f=n([].concat);e.exports=!h||s((function(){if(i&&1!==h({b:1},h(_({},"a",{enumerable:!0,get:function(){_(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var e={},t={},r=Symbol("assign detection"),n="abcdefghijklmnopqrst";return e[r]=7,n.split("").forEach((function(e){t[e]=e})),7!==h({},e)[r]||o(h({},t)).join("")!==n}))?function(e,t){for(var r=d(e),n=arguments.length,s=1,h=l.f,_=c.f;n>s;)for(var p,m=u(arguments[s++]),g=h?f(o(m),h(m)):o(m),v=g.length,y=0;v>y;)p=g[y++],i&&!a(_,m,p)||(r[p]=m[p]);return r}:h},8075:(e,t,r)=>{"use strict";var i,n=r(6624),a=r(2220),s=r(376),o=r(8530),l=r(2416),c=r(9552),d=r(2522),u="prototype",h="script",_=d("IE_PROTO"),f=function(){},p=function(e){return"<"+h+">"+e+"</"+h+">"},m=function(e){e.write(p("")),e.close();var t=e.parentWindow.Object;return e=null,t},g=function(){try{i=new ActiveXObject("htmlfile")}catch(e){}var e,t,r;g="undefined"!=typeof document?document.domain&&i?m(i):(t=c("iframe"),r="java"+h+":",t.style.display="none",l.appendChild(t),t.src=String(r),(e=t.contentWindow.document).open(),e.write(p("document.F=Object")),e.close(),e.F):m(i);for(var n=s.length;n--;)delete g[u][s[n]];return g()};o[_]=!0,e.exports=Object.create||function(e,t){var r;return null!==e?(f[u]=n(e),r=new f,f[u]=null,r[_]=e):r=g(),void 0===t?r:a.f(r,t)}},2220:(e,t,r)=>{"use strict";var i=r(9447),n=r(8661),a=r(4284),s=r(6624),o=r(7374),l=r(2875);t.f=i&&!n?Object.defineProperties:function(e,t){s(e);for(var r,i=o(t),n=l(t),c=n.length,d=0;c>d;)a.f(e,r=n[d++],i[r]);return e}},4284:(e,t,r)=>{"use strict";var i=r(9447),n=r(3648),a=r(8661),s=r(6624),o=r(470),l=TypeError,c=Object.defineProperty,d=Object.getOwnPropertyDescriptor,u="enumerable",h="configurable",_="writable";t.f=i?a?function(e,t,r){if(s(e),t=o(t),s(r),"function"==typeof e&&"prototype"===t&&"value"in r&&_ in r&&!r[_]){var i=d(e,t);i&&i[_]&&(e[t]=r.value,r={configurable:h in r?r[h]:i[h],enumerable:u in r?r[u]:i[u],writable:!1})}return c(e,t,r)}:c:function(e,t,r){if(s(e),t=o(t),s(r),n)try{return c(e,t,r)}catch(e){}if("get"in r||"set"in r)throw new l("Accessors not supported");return"value"in r&&(e[t]=r.value),e}},3846:(e,t,r)=>{"use strict";var i=r(9447),n=r(3930),a=r(2574),s=r(5817),o=r(7374),l=r(470),c=r(9724),d=r(3648),u=Object.getOwnPropertyDescriptor;t.f=i?u:function(e,t){if(e=o(e),t=l(t),d)try{return u(e,t)}catch(e){}if(c(e,t))return s(!n(a.f,e,t),e[t])}},5407:(e,t,r)=>{"use strict";var i=r(5807),n=r(7374),a=r(4443).f,s=r(3427),o="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];e.exports.f=function(e){return o&&"Window"===i(e)?function(e){try{return a(e)}catch(e){return s(o)}}(e):a(n(e))}},4443:(e,t,r)=>{"use strict";var i=r(3045),n=r(376).concat("length","prototype");t.f=Object.getOwnPropertyNames||function(e){return i(e,n)}},7170:(e,t)=>{"use strict";t.f=Object.getOwnPropertySymbols},5972:(e,t,r)=>{"use strict";var i=r(9724),n=r(2250),a=r(9298),s=r(2522),o=r(7382),l=s("IE_PROTO"),c=Object,d=c.prototype;e.exports=o?c.getPrototypeOf:function(e){var t=a(e);if(i(t,l))return t[l];var r=t.constructor;return n(r)&&t instanceof r?r.prototype:t instanceof c?d:null}},8280:(e,t,r)=>{"use strict";var i=r(1907);e.exports=i({}.isPrototypeOf)},3045:(e,t,r)=>{"use strict";var i=r(1907),n=r(9724),a=r(7374),s=r(4436).indexOf,o=r(8530),l=i([].push);e.exports=function(e,t){var r,i=a(e),c=0,d=[];for(r in i)!n(o,r)&&n(i,r)&&l(d,r);for(;t.length>c;)n(i,r=t[c++])&&(~s(d,r)||l(d,r));return d}},2875:(e,t,r)=>{"use strict";var i=r(3045),n=r(376);e.exports=Object.keys||function(e){return i(e,n)}},2574:(e,t)=>{"use strict";var r={}.propertyIsEnumerable,i=Object.getOwnPropertyDescriptor,n=i&&!r.call({1:2},1);t.f=n?function(e){var t=i(this,e);return!!t&&t.enumerable}:r},9192:(e,t,r)=>{"use strict";var i=r(1871),n=r(6285),a=r(4239),s=r(43);e.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var e,t=!1,r={};try{(e=i(Object.prototype,"__proto__","set"))(r,[]),t=r instanceof Array}catch(e){}return function(r,i){return a(r),s(i),n(r)?(t?e(r,i):r.__proto__=i,r):r}}():void 0)},4878:(e,t,r)=>{"use strict";var i=r(2623),n=r(3948);e.exports=i?{}.toString:function(){return"[object "+n(this)+"]"}},581:(e,t,r)=>{"use strict";var i=r(3930),n=r(2250),a=r(6285),s=TypeError;e.exports=function(e,t){var r,o;if("string"===t&&n(r=e.toString)&&!a(o=i(r,e)))return o;if(n(r=e.valueOf)&&!a(o=i(r,e)))return o;if("string"!==t&&n(r=e.toString)&&!a(o=i(r,e)))return o;throw new s("Can't convert object to primitive value")}},2046:e=>{"use strict";e.exports={}},5606:(e,t,r)=>{"use strict";var i=r(6624);e.exports=function(){var e=i(this),t="";return e.hasIndices&&(t+="d"),e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),e.dotAll&&(t+="s"),e.unicode&&(t+="u"),e.unicodeSets&&(t+="v"),e.sticky&&(t+="y"),t}},663:(e,t,r)=>{"use strict";var i=r(3930),n=r(9724),a=r(8280),s=r(5606),o=RegExp.prototype;e.exports=function(e){var t=e.flags;return void 0!==t||"flags"in o||n(e,"flags")||!a(o,e)?t:i(s,e)}},4239:(e,t,r)=>{"use strict";var i=r(7136),n=TypeError;e.exports=function(e){if(i(e))throw new n("Can't call method on "+e);return e}},2098:(e,t,r)=>{"use strict";var i=r(5951),n=r(9447),a=Object.getOwnPropertyDescriptor;e.exports=function(e){if(!n)return i[e];var t=a(i,e);return t&&t.value}},4840:(e,t,r)=>{"use strict";var i=r(2623),n=r(4284).f,a=r(1626),s=r(9724),o=r(4878),l=r(6264)("toStringTag");e.exports=function(e,t,r,c){var d=r?e:e&&e.prototype;d&&(s(d,l)||n(d,l,{configurable:!0,value:t}),c&&!i&&a(d,"toString",o))}},2522:(e,t,r)=>{"use strict";var i=r(5816),n=r(6499),a=i("keys");e.exports=function(e){return a[e]||(a[e]=n(e))}},6128:(e,t,r)=>{"use strict";var i=r(7376),n=r(5951),a=r(2532),s="__core-js_shared__",o=e.exports=n[s]||a(s,{});(o.versions||(o.versions=[])).push({version:"3.39.0",mode:i?"pure":"global",copyright:"© 2014-2024 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.39.0/LICENSE",source:"https://github.com/zloirock/core-js"})},5816:(e,t,r)=>{"use strict";var i=r(6128);e.exports=function(e,t){return i[e]||(i[e]=t||{})}},1470:(e,t,r)=>{"use strict";var i=r(1907),n=r(5482),a=r(160),s=r(4239),o=i("".charAt),l=i("".charCodeAt),c=i("".slice),d=function(e){return function(t,r){var i,d,u=a(s(t)),h=n(r),_=u.length;return h<0||h>=_?e?"":void 0:(i=l(u,h))<55296||i>56319||h+1===_||(d=l(u,h+1))<56320||d>57343?e?o(u,h):i:e?c(u,h,h+2):d-56320+(i-55296<<10)+65536}};e.exports={codeAt:d(!1),charAt:d(!0)}},9156:(e,t,r)=>{"use strict";var i=r(1907),n=2147483647,a=/[^\0-\u007E]/,s=/[.\u3002\uFF0E\uFF61]/g,o="Overflow: input needs wider integers to process",l=RangeError,c=i(s.exec),d=Math.floor,u=String.fromCharCode,h=i("".charCodeAt),_=i([].join),f=i([].push),p=i("".replace),m=i("".split),g=i("".toLowerCase),v=function(e){return e+22+75*(e<26)},y=function(e,t,r){var i=0;for(e=r?d(e/700):e>>1,e+=d(e/t);e>455;)e=d(e/35),i+=36;return d(i+36*e/(e+38))},b=function(e){var t=[];e=function(e){for(var t=[],r=0,i=e.length;r<i;){var n=h(e,r++);if(n>=55296&&n<=56319&&r<i){var a=h(e,r++);56320==(64512&a)?f(t,((1023&n)<<10)+(1023&a)+65536):(f(t,n),r--)}else f(t,n)}return t}(e);var r,i,a=e.length,s=128,c=0,p=72;for(r=0;r<e.length;r++)(i=e[r])<128&&f(t,u(i));var m=t.length,g=m;for(m&&f(t,"-");g<a;){var b=n;for(r=0;r<e.length;r++)(i=e[r])>=s&&i<b&&(b=i);var w=g+1;if(b-s>d((n-c)/w))throw new l(o);for(c+=(b-s)*w,s=b,r=0;r<e.length;r++){if((i=e[r])<s&&++c>n)throw new l(o);if(i===s){for(var S=c,E=36;;){var M=E<=p?1:E>=p+26?26:E-p;if(S<M)break;var R=S-M,T=36-M;f(t,u(v(M+R%T))),S=d(R/T),E+=36}f(t,u(v(S))),p=y(c,w,g===m),c=0,g++}}c++,s++}return _(t,"")};e.exports=function(e){var t,r,i=[],n=m(p(g(e),s,"."),".");for(t=0;t<n.length;t++)r=n[t],f(i,c(a,r)?"xn--"+b(r):r);return _(i,".")}},5819:(e,t,r)=>{"use strict";var i=r(6833).PROPER,n=r(8828),a=r(6395);e.exports=function(e){return n((function(){return!!a[e]()||"
"!=="
"[e]()||i&&a[e].name!==e}))}},5993:(e,t,r)=>{"use strict";var i=r(1907),n=r(4239),a=r(160),s=r(6395),o=i("".replace),l=RegExp("^["+s+"]+"),c=RegExp("(^|[^"+s+"])["+s+"]+$"),d=function(e){return function(t){var r=a(n(t));return 1&e&&(r=o(r,l,"")),2&e&&(r=o(r,c,"$1")),r}};e.exports={start:d(1),end:d(2),trim:d(3)}},9846:(e,t,r)=>{"use strict";var i=r(798),n=r(8828),a=r(5951).String;e.exports=!!Object.getOwnPropertySymbols&&!n((function(){var e=Symbol("symbol detection");return!a(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&i&&i<41}))},3467:(e,t,r)=>{"use strict";var i=r(3930),n=r(5582),a=r(6264),s=r(8055);e.exports=function(){var e=n("Symbol"),t=e&&e.prototype,r=t&&t.valueOf,o=a("toPrimitive");t&&!t[o]&&s(t,o,(function(e){return i(r,this)}),{arity:1})}},2595:(e,t,r)=>{"use strict";var i=r(5582),n=r(1907),a=i("Symbol"),s=a.keyFor,o=n(a.prototype.valueOf);e.exports=a.isRegisteredSymbol||function(e){try{return void 0!==s(o(e))}catch(e){return!1}}},9197:(e,t,r)=>{"use strict";for(var i=r(5816),n=r(5582),a=r(1907),s=r(5594),o=r(6264),l=n("Symbol"),c=l.isWellKnownSymbol,d=n("Object","getOwnPropertyNames"),u=a(l.prototype.valueOf),h=i("wks"),_=0,f=d(l),p=f.length;_<p;_++)try{var m=f[_];s(l[m])&&o(m)}catch(e){}e.exports=function(e){if(c&&c(e))return!0;try{for(var t=u(e),r=0,i=d(h),n=i.length;r<n;r++)if(h[i[r]]==t)return!0}catch(e){}return!1}},4411:(e,t,r)=>{"use strict";var i=r(9846);e.exports=i&&!!Symbol.for&&!!Symbol.keyFor},4849:(e,t,r)=>{"use strict";var i=r(5482),n=Math.max,a=Math.min;e.exports=function(e,t){var r=i(e);return r<0?n(r+t,0):a(r,t)}},7374:(e,t,r)=>{"use strict";var i=r(6946),n=r(4239);e.exports=function(e){return i(n(e))}},5482:(e,t,r)=>{"use strict";var i=r(1176);e.exports=function(e){var t=+e;return t!=t||0===t?0:i(t)}},3121:(e,t,r)=>{"use strict";var i=r(5482),n=Math.min;e.exports=function(e){var t=i(e);return t>0?n(t,9007199254740991):0}},9298:(e,t,r)=>{"use strict";var i=r(4239),n=Object;e.exports=function(e){return n(i(e))}},6028:(e,t,r)=>{"use strict";var i=r(3930),n=r(6285),a=r(5594),s=r(9367),o=r(581),l=r(6264),c=TypeError,d=l("toPrimitive");e.exports=function(e,t){if(!n(e)||a(e))return e;var r,l=s(e,d);if(l){if(void 0===t&&(t="default"),r=i(l,e,t),!n(r)||a(r))return r;throw new c("Can't convert object to primitive value")}return void 0===t&&(t="number"),o(e,t)}},470:(e,t,r)=>{"use strict";var i=r(6028),n=r(5594);e.exports=function(e){var t=i(e,"string");return n(t)?t:t+""}},2623:(e,t,r)=>{"use strict";var i={};i[r(6264)("toStringTag")]="z",e.exports="[object z]"===String(i)},160:(e,t,r)=>{"use strict";var i=r(3948),n=String;e.exports=function(e){if("Symbol"===i(e))throw new TypeError("Cannot convert a Symbol value to a string");return n(e)}},4640:e=>{"use strict";var t=String;e.exports=function(e){try{return t(e)}catch(e){return"Object"}}},6499:(e,t,r)=>{"use strict";var i=r(1907),n=0,a=Math.random(),s=i(1..toString);e.exports=function(e){return"Symbol("+(void 0===e?"":e)+")_"+s(++n+a,36)}},4791:(e,t,r)=>{"use strict";var i=r(8828),n=r(6264),a=r(9447),s=r(7376),o=n("iterator");e.exports=!i((function(){var e=new URL("b?a=1&b=2&c=3","https://a"),t=e.searchParams,r=new URLSearchParams("a=1&a=2&b=3"),i="";return e.pathname="c%20d",t.forEach((function(e,r){t.delete("b"),i+=r+e})),r.delete("a",2),r.delete("b",void 0),s&&(!e.toJSON||!r.has("a",1)||r.has("a",2)||!r.has("a",void 0)||r.has("b"))||!t.size&&(s||!a)||!t.sort||"https://a/c%20d?a=1&c=3"!==e.href||"3"!==t.get("c")||"a=1"!==String(new URLSearchParams("?a=1"))||!t[o]||"a"!==new URL("https://a@b").username||"b"!==new URLSearchParams(new URLSearchParams("a=b")).get("a")||"xn--e1aybc"!==new URL("https://тест").host||"#%D0%B1"!==new URL("https://a#б").hash||"a1c3"!==i||"x"!==new URL("https://x",void 0).host}))},1175:(e,t,r)=>{"use strict";var i=r(9846);e.exports=i&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},8661:(e,t,r)=>{"use strict";var i=r(9447),n=r(8828);e.exports=i&&n((function(){return 42!==Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype}))},4787:e=>{"use strict";var t=TypeError;e.exports=function(e,r){if(e<r)throw new t("Not enough arguments");return e}},551:(e,t,r)=>{"use strict";var i=r(5951),n=r(2250),a=i.WeakMap;e.exports=n(a)&&/native code/.test(String(a))},366:(e,t,r)=>{"use strict";var i=r(2046),n=r(9724),a=r(560),s=r(4284).f;e.exports=function(e){var t=i.Symbol||(i.Symbol={});n(t,e)||s(t,e,{value:a.f(e)})}},560:(e,t,r)=>{"use strict";var i=r(6264);t.f=i},6264:(e,t,r)=>{"use strict";var i=r(5951),n=r(5816),a=r(9724),s=r(6499),o=r(9846),l=r(1175),c=i.Symbol,d=n("wks"),u=l?c.for||c:c&&c.withoutSetter||s;e.exports=function(e){return a(d,e)||(d[e]=o&&a(c,e)?c[e]:u("Symbol."+e)),d[e]}},6395:e=>{"use strict";e.exports="\t\n\v\f\r \u2028\u2029\ufeff"},8545:(e,t,r)=>{"use strict";var i=r(1091),n=r(8828),a=r(1793),s=r(6285),o=r(9298),l=r(575),c=r(8024),d=r(5543),u=r(6968),h=r(7171),_=r(6264),f=r(798),p=_("isConcatSpreadable"),m=f>=51||!n((function(){var e=[];return e[p]=!1,e.concat()[0]!==e})),g=function(e){if(!s(e))return!1;var t=e[p];return void 0!==t?!!t:a(e)};i({target:"Array",proto:!0,arity:1,forced:!m||!h("concat")},{concat:function(e){var t,r,i,n,a,s=o(this),h=u(s,0),_=0;for(t=-1,i=arguments.length;t<i;t++)if(g(a=-1===t?s:arguments[t]))for(n=l(a),c(_+n),r=0;r<n;r++,_++)r in a&&d(h,_,a[r]);else c(_+1),d(h,_++,a);return h.length=_,h}})},9363:(e,t,r)=>{"use strict";var i=r(7374),n=r(2156),a=r(3742),s=r(4932),o=r(4284).f,l=r(183),c=r(9550),d=r(7376),u=r(9447),h="Array Iterator",_=s.set,f=s.getterFor(h);e.exports=l(Array,"Array",(function(e,t){_(this,{type:h,target:i(e),index:0,kind:t})}),(function(){var e=f(this),t=e.target,r=e.index++;if(!t||r>=t.length)return e.target=null,c(void 0,!0);switch(e.kind){case"keys":return c(r,!1);case"values":return c(t[r],!1)}return c([r,t[r]],!1)}),"values");var p=a.Arguments=a.Array;if(n("keys"),n("values"),n("entries"),!d&&u&&"values"!==p.name)try{o(p,"name",{value:"values"})}catch(e){}},8537:()=>{},9721:(e,t,r)=>{"use strict";var i=r(1091),n=r(5582),a=r(6024),s=r(3930),o=r(1907),l=r(8828),c=r(2250),d=r(5594),u=r(3427),h=r(6656),_=r(9846),f=String,p=n("JSON","stringify"),m=o(/./.exec),g=o("".charAt),v=o("".charCodeAt),y=o("".replace),b=o(1..toString),w=/[\uD800-\uDFFF]/g,S=/^[\uD800-\uDBFF]$/,E=/^[\uDC00-\uDFFF]$/,M=!_||l((function(){var e=n("Symbol")("stringify detection");return"[null]"!==p([e])||"{}"!==p({a:e})||"{}"!==p(Object(e))})),R=l((function(){return'"\\udf06\\ud834"'!==p("\udf06\ud834")||'"\\udead"'!==p("\udead")})),T=function(e,t){var r=u(arguments),i=h(t);if(c(i)||void 0!==e&&!d(e))return r[1]=function(e,t){if(c(i)&&(t=s(i,this,f(e),t)),!d(t))return t},a(p,null,r)},x=function(e,t,r){var i=g(r,t-1),n=g(r,t+1);return m(S,e)&&!m(E,n)||m(E,e)&&!m(S,i)?"\\u"+b(v(e,0),16):e};p&&i({target:"JSON",stat:!0,arity:3,forced:M||R},{stringify:function(e,t,r){var i=u(arguments),n=a(M?T:p,null,i);return R&&"string"==typeof n?y(n,w,x):n}})},7024:(e,t,r)=>{"use strict";var i=r(5951);r(4840)(i.JSON,"JSON",!0)},8172:()=>{},6750:(e,t,r)=>{"use strict";var i=r(1091),n=r(9447),a=r(4284).f;i({target:"Object",stat:!0,forced:Object.defineProperty!==a,sham:!n},{defineProperty:a})},5264:(e,t,r)=>{"use strict";var i=r(1091),n=r(9846),a=r(8828),s=r(7170),o=r(9298);i({target:"Object",stat:!0,forced:!n||a((function(){s.f(1)}))},{getOwnPropertySymbols:function(e){var t=s.f;return t?t(o(e)):[]}})},3643:()=>{},5205:()=>{},1398:()=>{},1074:(e,t,r)=>{"use strict";var i=r(1091),n=r(1907),a=r(4849),s=RangeError,o=String.fromCharCode,l=String.fromCodePoint,c=n([].join);i({target:"String",stat:!0,arity:1,forced:!!l&&1!==l.length},{fromCodePoint:function(e){for(var t,r=[],i=arguments.length,n=0;i>n;){if(t=+arguments[n++],a(t,1114111)!==t)throw new s(t+" is not a valid code point");r[n]=t<65536?o(t):o(55296+((t-=65536)>>10),t%1024+56320)}return c(r,"")}})},7057:(e,t,r)=>{"use strict";var i=r(1470).charAt,n=r(160),a=r(4932),s=r(183),o=r(9550),l="String Iterator",c=a.set,d=a.getterFor(l);s(String,"String",(function(e){c(this,{type:l,string:n(e),index:0})}),(function(){var e,t=d(this),r=t.string,n=t.index;return n>=r.length?o(void 0,!0):(e=i(r,n),t.index+=e.length,o(e,!1))}))},929:(e,t,r)=>{"use strict";var i=r(1091),n=r(3930),a=r(1907),s=r(4239),o=r(2250),l=r(7136),c=r(2087),d=r(160),u=r(9367),h=r(663),_=r(7703),f=r(6264),p=r(7376),m=f("replace"),g=TypeError,v=a("".indexOf),y=a("".replace),b=a("".slice),w=Math.max;i({target:"String",proto:!0},{replaceAll:function(e,t){var r,i,a,f,S,E,M,R,T,x,C=s(this),A=0,F="";if(!l(e)){if((r=c(e))&&(i=d(s(h(e))),!~v(i,"g")))throw new g("`.replaceAll` does not allow non-global regexes");if(a=u(e,m))return n(a,e,C,t);if(p&&r)return y(d(C),e,t)}for(f=d(C),S=d(e),(E=o(t))||(t=d(t)),M=S.length,R=w(1,M),T=v(f,S);-1!==T;)x=E?d(t(S,T,f)):_(S,f,T,[],void 0,t),F+=b(f,A,T)+x,A=T+M,T=T+R>f.length?-1:v(f,S,T+R);return A<f.length&&(F+=b(f,A)),F}})},1995:()=>{},727:(e,t,r)=>{"use strict";var i=r(1091),n=r(5993).trim;i({target:"String",proto:!0,forced:r(5819)("trim")},{trim:function(){return n(this)}})},3997:(e,t,r)=>{"use strict";r(366)("asyncIterator")},3674:(e,t,r)=>{"use strict";var i=r(1091),n=r(5951),a=r(3930),s=r(1907),o=r(7376),l=r(9447),c=r(9846),d=r(8828),u=r(9724),h=r(8280),_=r(6624),f=r(7374),p=r(470),m=r(160),g=r(5817),v=r(8075),y=r(2875),b=r(4443),w=r(5407),S=r(7170),E=r(3846),M=r(4284),R=r(2220),T=r(2574),x=r(8055),C=r(9251),A=r(5816),F=r(2522),k=r(8530),P=r(6499),L=r(6264),D=r(560),I=r(366),O=r(3467),U=r(4840),V=r(4932),W=r(726).forEach,B=F("hidden"),N="Symbol",G="prototype",j=V.set,H=V.getterFor(N),z=Object[G],q=n.Symbol,Y=q&&q[G],X=n.RangeError,K=n.TypeError,Q=n.QObject,$=E.f,J=M.f,Z=w.f,ee=T.f,te=s([].push),re=A("symbols"),ie=A("op-symbols"),ne=A("wks"),ae=!Q||!Q[G]||!Q[G].findChild,se=function(e,t,r){var i=$(z,t);i&&delete z[t],J(e,t,r),i&&e!==z&&J(z,t,i)},oe=l&&d((function(){return 7!==v(J({},"a",{get:function(){return J(this,"a",{value:7}).a}})).a}))?se:J,le=function(e,t){var r=re[e]=v(Y);return j(r,{type:N,tag:e,description:t}),l||(r.description=t),r},ce=function(e,t,r){e===z&&ce(ie,t,r),_(e);var i=p(t);return _(r),u(re,i)?(r.enumerable?(u(e,B)&&e[B][i]&&(e[B][i]=!1),r=v(r,{enumerable:g(0,!1)})):(u(e,B)||J(e,B,g(1,v(null))),e[B][i]=!0),oe(e,i,r)):J(e,i,r)},de=function(e,t){_(e);var r=f(t),i=y(r).concat(fe(r));return W(i,(function(t){l&&!a(ue,r,t)||ce(e,t,r[t])})),e},ue=function(e){var t=p(e),r=a(ee,this,t);return!(this===z&&u(re,t)&&!u(ie,t))&&(!(r||!u(this,t)||!u(re,t)||u(this,B)&&this[B][t])||r)},he=function(e,t){var r=f(e),i=p(t);if(r!==z||!u(re,i)||u(ie,i)){var n=$(r,i);return!n||!u(re,i)||u(r,B)&&r[B][i]||(n.enumerable=!0),n}},_e=function(e){var t=Z(f(e)),r=[];return W(t,(function(e){u(re,e)||u(k,e)||te(r,e)})),r},fe=function(e){var t=e===z,r=Z(t?ie:f(e)),i=[];return W(r,(function(e){!u(re,e)||t&&!u(z,e)||te(i,re[e])})),i};c||(x(Y=(q=function(){if(h(Y,this))throw new K("Symbol is not a constructor");var e=arguments.length&&void 0!==arguments[0]?m(arguments[0]):void 0,t=P(e),r=function(e){var i=void 0===this?n:this;i===z&&a(r,ie,e),u(i,B)&&u(i[B],t)&&(i[B][t]=!1);var s=g(1,e);try{oe(i,t,s)}catch(e){if(!(e instanceof X))throw e;se(i,t,s)}};return l&&ae&&oe(z,t,{configurable:!0,set:r}),le(t,e)})[G],"toString",(function(){return H(this).tag})),x(q,"withoutSetter",(function(e){return le(P(e),e)})),T.f=ue,M.f=ce,R.f=de,E.f=he,b.f=w.f=_e,S.f=fe,D.f=function(e){return le(L(e),e)},l&&(C(Y,"description",{configurable:!0,get:function(){return H(this).description}}),o||x(z,"propertyIsEnumerable",ue,{unsafe:!0}))),i({global:!0,constructor:!0,wrap:!0,forced:!c,sham:!c},{Symbol:q}),W(y(ne),(function(e){I(e)})),i({target:N,stat:!0,forced:!c},{useSetter:function(){ae=!0},useSimple:function(){ae=!1}}),i({target:"Object",stat:!0,forced:!c,sham:!l},{create:function(e,t){return void 0===t?v(e):de(v(e),t)},defineProperty:ce,defineProperties:de,getOwnPropertyDescriptor:he}),i({target:"Object",stat:!0,forced:!c},{getOwnPropertyNames:_e}),O(),U(q,N),k[B]=!0},5084:()=>{},3313:(e,t,r)=>{"use strict";var i=r(1091),n=r(5582),a=r(9724),s=r(160),o=r(5816),l=r(4411),c=o("string-to-symbol-registry"),d=o("symbol-to-string-registry");i({target:"Symbol",stat:!0,forced:!l},{for:function(e){var t=s(e);if(a(c,t))return c[t];var r=n("Symbol")(t);return c[t]=r,d[r]=t,r}})},2596:(e,t,r)=>{"use strict";r(366)("hasInstance")},5721:(e,t,r)=>{"use strict";r(366)("isConcatSpreadable")},4954:(e,t,r)=>{"use strict";r(366)("iterator")},4452:(e,t,r)=>{"use strict";r(3674),r(3313),r(751),r(9721),r(5264)},751:(e,t,r)=>{"use strict";var i=r(1091),n=r(9724),a=r(5594),s=r(4640),o=r(5816),l=r(4411),c=o("symbol-to-string-registry");i({target:"Symbol",stat:!0,forced:!l},{keyFor:function(e){if(!a(e))throw new TypeError(s(e)+" is not a symbol");if(n(c,e))return c[e]}})},3377:(e,t,r)=>{"use strict";r(366)("matchAll")},4123:(e,t,r)=>{"use strict";r(366)("match")},2230:(e,t,r)=>{"use strict";r(366)("replace")},5344:(e,t,r)=>{"use strict";r(366)("search")},1660:(e,t,r)=>{"use strict";r(366)("species")},4610:(e,t,r)=>{"use strict";r(366)("split")},3669:(e,t,r)=>{"use strict";var i=r(366),n=r(3467);i("toPrimitive"),n()},4810:(e,t,r)=>{"use strict";var i=r(5582),n=r(366),a=r(4840);n("toStringTag"),a(i("Symbol"),"Symbol")},3325:(e,t,r)=>{"use strict";r(366)("unscopables")},768:(e,t,r)=>{"use strict";var i=r(6264),n=r(4284).f,a=i("metadata"),s=Function.prototype;void 0===s[a]&&n(s,a,{value:null})},6038:(e,t,r)=>{"use strict";r(929)},8549:(e,t,r)=>{"use strict";r(366)("asyncDispose")},1697:(e,t,r)=>{"use strict";r(366)("customMatcher")},7152:(e,t,r)=>{"use strict";r(366)("dispose")},3939:(e,t,r)=>{"use strict";r(1091)({target:"Symbol",stat:!0},{isRegisteredSymbol:r(2595)})},3422:(e,t,r)=>{"use strict";r(1091)({target:"Symbol",stat:!0,name:"isRegisteredSymbol"},{isRegistered:r(2595)})},1785:(e,t,r)=>{"use strict";r(1091)({target:"Symbol",stat:!0,forced:!0},{isWellKnownSymbol:r(9197)})},36:(e,t,r)=>{"use strict";r(1091)({target:"Symbol",stat:!0,name:"isWellKnownSymbol",forced:!0},{isWellKnown:r(9197)})},8703:(e,t,r)=>{"use strict";r(366)("matcher")},6878:(e,t,r)=>{"use strict";r(366)("metadataKey")},1372:(e,t,r)=>{"use strict";r(366)("metadata")},4664:(e,t,r)=>{"use strict";r(366)("observable")},9671:(e,t,r)=>{"use strict";r(366)("patternMatch")},359:(e,t,r)=>{"use strict";r(366)("replaceAll")},2560:(e,t,r)=>{"use strict";r(9363);var i=r(9287),n=r(5951),a=r(4840),s=r(3742);for(var o in i)a(n[o],o),s[o]=s.Array},7105:(e,t,r)=>{"use strict";r(9363),r(1074);var i=r(1091),n=r(5951),a=r(2098),s=r(5582),o=r(3930),l=r(1907),c=r(9447),d=r(4791),u=r(8055),h=r(9251),_=r(2802),f=r(4840),p=r(7181),m=r(4932),g=r(9596),v=r(2250),y=r(9724),b=r(8311),w=r(3948),S=r(6624),E=r(6285),M=r(160),R=r(8075),T=r(5817),x=r(300),C=r(3448),A=r(9550),F=r(4787),k=r(6264),P=r(4321),L=k("iterator"),D="URLSearchParams",I=D+"Iterator",O=m.set,U=m.getterFor(D),V=m.getterFor(I),W=a("fetch"),B=a("Request"),N=a("Headers"),G=B&&B.prototype,j=N&&N.prototype,H=n.TypeError,z=n.encodeURIComponent,q=String.fromCharCode,Y=s("String","fromCodePoint"),X=parseInt,K=l("".charAt),Q=l([].join),$=l([].push),J=l("".replace),Z=l([].shift),ee=l([].splice),te=l("".split),re=l("".slice),ie=l(/./.exec),ne=/\+/g,ae=/^[0-9a-f]+$/i,se=function(e,t){var r=re(e,t,t+2);return ie(ae,r)?X(r,16):NaN},oe=function(e){for(var t=0,r=128;r>0&&e&r;r>>=1)t++;return t},le=function(e){var t=null;switch(e.length){case 1:t=e[0];break;case 2:t=(31&e[0])<<6|63&e[1];break;case 3:t=(15&e[0])<<12|(63&e[1])<<6|63&e[2];break;case 4:t=(7&e[0])<<18|(63&e[1])<<12|(63&e[2])<<6|63&e[3]}return t>1114111?null:t},ce=function(e){for(var t=(e=J(e,ne," ")).length,r="",i=0;i<t;){var n=K(e,i);if("%"===n){if("%"===K(e,i+1)||i+3>t){r+="%",i++;continue}var a=se(e,i+1);if(a!=a){r+=n,i++;continue}i+=2;var s=oe(a);if(0===s)n=q(a);else{if(1===s||s>4){r+="�",i++;continue}for(var o=[a],l=1;l<s&&!(3+ ++i>t||"%"!==K(e,i));){var c=se(e,i+1);if(c!=c){i+=3;break}if(c>191||c<128)break;$(o,c),i+=2,l++}if(o.length!==s){r+="�";continue}var d=le(o);null===d?r+="�":n=Y(d)}}r+=n,i++}return r},de=/[!'()~]|%20/g,ue={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"},he=function(e){return ue[e]},_e=function(e){return J(z(e),de,he)},fe=p((function(e,t){O(this,{type:I,target:U(e).entries,index:0,kind:t})}),D,(function(){var e=V(this),t=e.target,r=e.index++;if(!t||r>=t.length)return e.target=null,A(void 0,!0);var i=t[r];switch(e.kind){case"keys":return A(i.key,!1);case"values":return A(i.value,!1)}return A([i.key,i.value],!1)}),!0),pe=function(e){this.entries=[],this.url=null,void 0!==e&&(E(e)?this.parseObject(e):this.parseQuery("string"==typeof e?"?"===K(e,0)?re(e,1):e:M(e)))};pe.prototype={type:D,bindURL:function(e){this.url=e,this.update()},parseObject:function(e){var t,r,i,n,a,s,l,c=this.entries,d=C(e);if(d)for(r=(t=x(e,d)).next;!(i=o(r,t)).done;){if(a=(n=x(S(i.value))).next,(s=o(a,n)).done||(l=o(a,n)).done||!o(a,n).done)throw new H("Expected sequence with length 2");$(c,{key:M(s.value),value:M(l.value)})}else for(var u in e)y(e,u)&&$(c,{key:u,value:M(e[u])})},parseQuery:function(e){if(e)for(var t,r,i=this.entries,n=te(e,"&"),a=0;a<n.length;)(t=n[a++]).length&&(r=te(t,"="),$(i,{key:ce(Z(r)),value:ce(Q(r,"="))}))},serialize:function(){for(var e,t=this.entries,r=[],i=0;i<t.length;)e=t[i++],$(r,_e(e.key)+"="+_e(e.value));return Q(r,"&")},update:function(){this.entries.length=0,this.parseQuery(this.url.query)},updateURL:function(){this.url&&this.url.update()}};var me=function(){g(this,ge);var e=O(this,new pe(arguments.length>0?arguments[0]:void 0));c||(this.size=e.entries.length)},ge=me.prototype;if(_(ge,{append:function(e,t){var r=U(this);F(arguments.length,2),$(r.entries,{key:M(e),value:M(t)}),c||this.length++,r.updateURL()},delete:function(e){for(var t=U(this),r=F(arguments.length,1),i=t.entries,n=M(e),a=r<2?void 0:arguments[1],s=void 0===a?a:M(a),o=0;o<i.length;){var l=i[o];if(l.key!==n||void 0!==s&&l.value!==s)o++;else if(ee(i,o,1),void 0!==s)break}c||(this.size=i.length),t.updateURL()},get:function(e){var t=U(this).entries;F(arguments.length,1);for(var r=M(e),i=0;i<t.length;i++)if(t[i].key===r)return t[i].value;return null},getAll:function(e){var t=U(this).entries;F(arguments.length,1);for(var r=M(e),i=[],n=0;n<t.length;n++)t[n].key===r&&$(i,t[n].value);return i},has:function(e){for(var t=U(this).entries,r=F(arguments.length,1),i=M(e),n=r<2?void 0:arguments[1],a=void 0===n?n:M(n),s=0;s<t.length;){var o=t[s++];if(o.key===i&&(void 0===a||o.value===a))return!0}return!1},set:function(e,t){var r=U(this);F(arguments.length,1);for(var i,n=r.entries,a=!1,s=M(e),o=M(t),l=0;l<n.length;l++)(i=n[l]).key===s&&(a?ee(n,l--,1):(a=!0,i.value=o));a||$(n,{key:s,value:o}),c||(this.size=n.length),r.updateURL()},sort:function(){var e=U(this);P(e.entries,(function(e,t){return e.key>t.key?1:-1})),e.updateURL()},forEach:function(e){for(var t,r=U(this).entries,i=b(e,arguments.length>1?arguments[1]:void 0),n=0;n<r.length;)i((t=r[n++]).value,t.key,this)},keys:function(){return new fe(this,"keys")},values:function(){return new fe(this,"values")},entries:function(){return new fe(this,"entries")}},{enumerable:!0}),u(ge,L,ge.entries,{name:"entries"}),u(ge,"toString",(function(){return U(this).serialize()}),{enumerable:!0}),c&&h(ge,"size",{get:function(){return U(this).entries.length},configurable:!0,enumerable:!0}),f(me,D),i({global:!0,constructor:!0,forced:!d},{URLSearchParams:me}),!d&&v(N)){var ve=l(j.has),ye=l(j.set),be=function(e){if(E(e)){var t,r=e.body;if(w(r)===D)return t=e.headers?new N(e.headers):new N,ve(t,"content-type")||ye(t,"content-type","application/x-www-form-urlencoded;charset=UTF-8"),R(e,{body:T(0,M(r)),headers:T(0,t)})}return e};if(v(W)&&i({global:!0,enumerable:!0,dontCallGetSet:!0,forced:!0},{fetch:function(e){return W(e,arguments.length>1?be(arguments[1]):{})}}),v(B)){var we=function(e){return g(this,G),new B(e,arguments.length>1?be(arguments[1]):{})};G.constructor=we,we.prototype=G,i({global:!0,constructor:!0,dontCallGetSet:!0,forced:!0},{Request:we})}}e.exports={URLSearchParams:me,getState:U}},5042:()=>{},7649:()=>{},6299:(e,t,r)=>{"use strict";r(7105)},3604:()=>{},8669:(e,t,r)=>{"use strict";var i=r(1091),n=r(5582),a=r(8828),s=r(4787),o=r(160),l=r(4791),c=n("URL"),d=l&&a((function(){c.canParse()})),u=a((function(){return 1!==c.canParse.length}));i({target:"URL",stat:!0,forced:!d||u},{canParse:function(e){var t=s(arguments.length,1),r=o(e),i=t<2||void 0===arguments[1]?void 0:o(arguments[1]);try{return!!new c(r,i)}catch(e){return!1}}})},6909:(e,t,r)=>{"use strict";r(7057);var i,n=r(1091),a=r(9447),s=r(4791),o=r(5951),l=r(8311),c=r(1907),d=r(8055),u=r(9251),h=r(9596),_=r(9724),f=r(9538),p=r(1229),m=r(3427),g=r(1470).codeAt,v=r(9156),y=r(160),b=r(4840),w=r(4787),S=r(7105),E=r(4932),M=E.set,R=E.getterFor("URL"),T=S.URLSearchParams,x=S.getState,C=o.URL,A=o.TypeError,F=o.parseInt,k=Math.floor,P=Math.pow,L=c("".charAt),D=c(/./.exec),I=c([].join),O=c(1..toString),U=c([].pop),V=c([].push),W=c("".replace),B=c([].shift),N=c("".split),G=c("".slice),j=c("".toLowerCase),H=c([].unshift),z="Invalid scheme",q="Invalid host",Y="Invalid port",X=/[a-z]/i,K=/[\d+-.a-z]/i,Q=/\d/,$=/^0x/i,J=/^[0-7]+$/,Z=/^\d+$/,ee=/^[\da-f]+$/i,te=/[\0\t\n\r #%/:<>?@[\\\]^|]/,re=/[\0\t\n\r #/:<>?@[\\\]^|]/,ie=/^[\u0000-\u0020]+/,ne=/(^|[^\u0000-\u0020])[\u0000-\u0020]+$/,ae=/[\t\n\r]/g,se=function(e){var t,r,i,n;if("number"==typeof e){for(t=[],r=0;r<4;r++)H(t,e%256),e=k(e/256);return I(t,".")}if("object"==typeof e){for(t="",i=function(e){for(var t=null,r=1,i=null,n=0,a=0;a<8;a++)0!==e[a]?(n>r&&(t=i,r=n),i=null,n=0):(null===i&&(i=a),++n);return n>r?i:t}(e),r=0;r<8;r++)n&&0===e[r]||(n&&(n=!1),i===r?(t+=r?":":"::",n=!0):(t+=O(e[r],16),r<7&&(t+=":")));return"["+t+"]"}return e},oe={},le=f({},oe,{" ":1,'"':1,"<":1,">":1,"`":1}),ce=f({},le,{"#":1,"?":1,"{":1,"}":1}),de=f({},ce,{"/":1,":":1,";":1,"=":1,"@":1,"[":1,"\\":1,"]":1,"^":1,"|":1}),ue=function(e,t){var r=g(e,0);return r>32&&r<127&&!_(t,e)?e:encodeURIComponent(e)},he={ftp:21,file:null,http:80,https:443,ws:80,wss:443},_e=function(e,t){var r;return 2===e.length&&D(X,L(e,0))&&(":"===(r=L(e,1))||!t&&"|"===r)},fe=function(e){var t;return e.length>1&&_e(G(e,0,2))&&(2===e.length||"/"===(t=L(e,2))||"\\"===t||"?"===t||"#"===t)},pe=function(e){return"."===e||"%2e"===j(e)},me={},ge={},ve={},ye={},be={},we={},Se={},Ee={},Me={},Re={},Te={},xe={},Ce={},Ae={},Fe={},ke={},Pe={},Le={},De={},Ie={},Oe={},Ue=function(e,t,r){var i,n,a,s=y(e);if(t){if(n=this.parse(s))throw new A(n);this.searchParams=null}else{if(void 0!==r&&(i=new Ue(r,!0)),n=this.parse(s,null,i))throw new A(n);(a=x(new T)).bindURL(this),this.searchParams=a}};Ue.prototype={type:"URL",parse:function(e,t,r){var n,a,s,o,l,c=this,d=t||me,u=0,h="",f=!1,g=!1,v=!1;for(e=y(e),t||(c.scheme="",c.username="",c.password="",c.host=null,c.port=null,c.path=[],c.query=null,c.fragment=null,c.cannotBeABaseURL=!1,e=W(e,ie,""),e=W(e,ne,"$1")),e=W(e,ae,""),n=p(e);u<=n.length;){switch(a=n[u],d){case me:if(!a||!D(X,a)){if(t)return z;d=ve;continue}h+=j(a),d=ge;break;case ge:if(a&&(D(K,a)||"+"===a||"-"===a||"."===a))h+=j(a);else{if(":"!==a){if(t)return z;h="",d=ve,u=0;continue}if(t&&(c.isSpecial()!==_(he,h)||"file"===h&&(c.includesCredentials()||null!==c.port)||"file"===c.scheme&&!c.host))return;if(c.scheme=h,t)return void(c.isSpecial()&&he[c.scheme]===c.port&&(c.port=null));h="","file"===c.scheme?d=Ae:c.isSpecial()&&r&&r.scheme===c.scheme?d=ye:c.isSpecial()?d=Ee:"/"===n[u+1]?(d=be,u++):(c.cannotBeABaseURL=!0,V(c.path,""),d=De)}break;case ve:if(!r||r.cannotBeABaseURL&&"#"!==a)return z;if(r.cannotBeABaseURL&&"#"===a){c.scheme=r.scheme,c.path=m(r.path),c.query=r.query,c.fragment="",c.cannotBeABaseURL=!0,d=Oe;break}d="file"===r.scheme?Ae:we;continue;case ye:if("/"!==a||"/"!==n[u+1]){d=we;continue}d=Me,u++;break;case be:if("/"===a){d=Re;break}d=Le;continue;case we:if(c.scheme=r.scheme,a===i)c.username=r.username,c.password=r.password,c.host=r.host,c.port=r.port,c.path=m(r.path),c.query=r.query;else if("/"===a||"\\"===a&&c.isSpecial())d=Se;else if("?"===a)c.username=r.username,c.password=r.password,c.host=r.host,c.port=r.port,c.path=m(r.path),c.query="",d=Ie;else{if("#"!==a){c.username=r.username,c.password=r.password,c.host=r.host,c.port=r.port,c.path=m(r.path),c.path.length--,d=Le;continue}c.username=r.username,c.password=r.password,c.host=r.host,c.port=r.port,c.path=m(r.path),c.query=r.query,c.fragment="",d=Oe}break;case Se:if(!c.isSpecial()||"/"!==a&&"\\"!==a){if("/"!==a){c.username=r.username,c.password=r.password,c.host=r.host,c.port=r.port,d=Le;continue}d=Re}else d=Me;break;case Ee:if(d=Me,"/"!==a||"/"!==L(h,u+1))continue;u++;break;case Me:if("/"!==a&&"\\"!==a){d=Re;continue}break;case Re:if("@"===a){f&&(h="%40"+h),f=!0,s=p(h);for(var b=0;b<s.length;b++){var w=s[b];if(":"!==w||v){var S=ue(w,de);v?c.password+=S:c.username+=S}else v=!0}h=""}else if(a===i||"/"===a||"?"===a||"#"===a||"\\"===a&&c.isSpecial()){if(f&&""===h)return"Invalid authority";u-=p(h).length+1,h="",d=Te}else h+=a;break;case Te:case xe:if(t&&"file"===c.scheme){d=ke;continue}if(":"!==a||g){if(a===i||"/"===a||"?"===a||"#"===a||"\\"===a&&c.isSpecial()){if(c.isSpecial()&&""===h)return q;if(t&&""===h&&(c.includesCredentials()||null!==c.port))return;if(o=c.parseHost(h))return o;if(h="",d=Pe,t)return;continue}"["===a?g=!0:"]"===a&&(g=!1),h+=a}else{if(""===h)return q;if(o=c.parseHost(h))return o;if(h="",d=Ce,t===xe)return}break;case Ce:if(!D(Q,a)){if(a===i||"/"===a||"?"===a||"#"===a||"\\"===a&&c.isSpecial()||t){if(""!==h){var E=F(h,10);if(E>65535)return Y;c.port=c.isSpecial()&&E===he[c.scheme]?null:E,h=""}if(t)return;d=Pe;continue}return Y}h+=a;break;case Ae:if(c.scheme="file","/"===a||"\\"===a)d=Fe;else{if(!r||"file"!==r.scheme){d=Le;continue}switch(a){case i:c.host=r.host,c.path=m(r.path),c.query=r.query;break;case"?":c.host=r.host,c.path=m(r.path),c.query="",d=Ie;break;case"#":c.host=r.host,c.path=m(r.path),c.query=r.query,c.fragment="",d=Oe;break;default:fe(I(m(n,u),""))||(c.host=r.host,c.path=m(r.path),c.shortenPath()),d=Le;continue}}break;case Fe:if("/"===a||"\\"===a){d=ke;break}r&&"file"===r.scheme&&!fe(I(m(n,u),""))&&(_e(r.path[0],!0)?V(c.path,r.path[0]):c.host=r.host),d=Le;continue;case ke:if(a===i||"/"===a||"\\"===a||"?"===a||"#"===a){if(!t&&_e(h))d=Le;else if(""===h){if(c.host="",t)return;d=Pe}else{if(o=c.parseHost(h))return o;if("localhost"===c.host&&(c.host=""),t)return;h="",d=Pe}continue}h+=a;break;case Pe:if(c.isSpecial()){if(d=Le,"/"!==a&&"\\"!==a)continue}else if(t||"?"!==a)if(t||"#"!==a){if(a!==i&&(d=Le,"/"!==a))continue}else c.fragment="",d=Oe;else c.query="",d=Ie;break;case Le:if(a===i||"/"===a||"\\"===a&&c.isSpecial()||!t&&("?"===a||"#"===a)){if(".."===(l=j(l=h))||"%2e."===l||".%2e"===l||"%2e%2e"===l?(c.shortenPath(),"/"===a||"\\"===a&&c.isSpecial()||V(c.path,"")):pe(h)?"/"===a||"\\"===a&&c.isSpecial()||V(c.path,""):("file"===c.scheme&&!c.path.length&&_e(h)&&(c.host&&(c.host=""),h=L(h,0)+":"),V(c.path,h)),h="","file"===c.scheme&&(a===i||"?"===a||"#"===a))for(;c.path.length>1&&""===c.path[0];)B(c.path);"?"===a?(c.query="",d=Ie):"#"===a&&(c.fragment="",d=Oe)}else h+=ue(a,ce);break;case De:"?"===a?(c.query="",d=Ie):"#"===a?(c.fragment="",d=Oe):a!==i&&(c.path[0]+=ue(a,oe));break;case Ie:t||"#"!==a?a!==i&&("'"===a&&c.isSpecial()?c.query+="%27":c.query+="#"===a?"%23":ue(a,oe)):(c.fragment="",d=Oe);break;case Oe:a!==i&&(c.fragment+=ue(a,le))}u++}},parseHost:function(e){var t,r,i;if("["===L(e,0)){if("]"!==L(e,e.length-1))return q;if(t=function(e){var t,r,i,n,a,s,o,l=[0,0,0,0,0,0,0,0],c=0,d=null,u=0,h=function(){return L(e,u)};if(":"===h()){if(":"!==L(e,1))return;u+=2,d=++c}for(;h();){if(8===c)return;if(":"!==h()){for(t=r=0;r<4&&D(ee,h());)t=16*t+F(h(),16),u++,r++;if("."===h()){if(0===r)return;if(u-=r,c>6)return;for(i=0;h();){if(n=null,i>0){if(!("."===h()&&i<4))return;u++}if(!D(Q,h()))return;for(;D(Q,h());){if(a=F(h(),10),null===n)n=a;else{if(0===n)return;n=10*n+a}if(n>255)return;u++}l[c]=256*l[c]+n,2!=++i&&4!==i||c++}if(4!==i)return;break}if(":"===h()){if(u++,!h())return}else if(h())return;l[c++]=t}else{if(null!==d)return;u++,d=++c}}if(null!==d)for(s=c-d,c=7;0!==c&&s>0;)o=l[c],l[c--]=l[d+s-1],l[d+--s]=o;else if(8!==c)return;return l}(G(e,1,-1)),!t)return q;this.host=t}else if(this.isSpecial()){if(e=v(e),D(te,e))return q;if(t=function(e){var t,r,i,n,a,s,o,l=N(e,".");if(l.length&&""===l[l.length-1]&&l.length--,(t=l.length)>4)return e;for(r=[],i=0;i<t;i++){if(""===(n=l[i]))return e;if(a=10,n.length>1&&"0"===L(n,0)&&(a=D($,n)?16:8,n=G(n,8===a?1:2)),""===n)s=0;else{if(!D(10===a?Z:8===a?J:ee,n))return e;s=F(n,a)}V(r,s)}for(i=0;i<t;i++)if(s=r[i],i===t-1){if(s>=P(256,5-t))return null}else if(s>255)return null;for(o=U(r),i=0;i<r.length;i++)o+=r[i]*P(256,3-i);return o}(e),null===t)return q;this.host=t}else{if(D(re,e))return q;for(t="",r=p(e),i=0;i<r.length;i++)t+=ue(r[i],oe);this.host=t}},cannotHaveUsernamePasswordPort:function(){return!this.host||this.cannotBeABaseURL||"file"===this.scheme},includesCredentials:function(){return""!==this.username||""!==this.password},isSpecial:function(){return _(he,this.scheme)},shortenPath:function(){var e=this.path,t=e.length;!t||"file"===this.scheme&&1===t&&_e(e[0],!0)||e.length--},serialize:function(){var e=this,t=e.scheme,r=e.username,i=e.password,n=e.host,a=e.port,s=e.path,o=e.query,l=e.fragment,c=t+":";return null!==n?(c+="//",e.includesCredentials()&&(c+=r+(i?":"+i:"")+"@"),c+=se(n),null!==a&&(c+=":"+a)):"file"===t&&(c+="//"),c+=e.cannotBeABaseURL?s[0]:s.length?"/"+I(s,"/"):"",null!==o&&(c+="?"+o),null!==l&&(c+="#"+l),c},setHref:function(e){var t=this.parse(e);if(t)throw new A(t);this.searchParams.update()},getOrigin:function(){var e=this.scheme,t=this.port;if("blob"===e)try{return new Ve(e.path[0]).origin}catch(e){return"null"}return"file"!==e&&this.isSpecial()?e+"://"+se(this.host)+(null!==t?":"+t:""):"null"},getProtocol:function(){return this.scheme+":"},setProtocol:function(e){this.parse(y(e)+":",me)},getUsername:function(){return this.username},setUsername:function(e){var t=p(y(e));if(!this.cannotHaveUsernamePasswordPort()){this.username="";for(var r=0;r<t.length;r++)this.username+=ue(t[r],de)}},getPassword:function(){return this.password},setPassword:function(e){var t=p(y(e));if(!this.cannotHaveUsernamePasswordPort()){this.password="";for(var r=0;r<t.length;r++)this.password+=ue(t[r],de)}},getHost:function(){var e=this.host,t=this.port;return null===e?"":null===t?se(e):se(e)+":"+t},setHost:function(e){this.cannotBeABaseURL||this.parse(e,Te)},getHostname:function(){var e=this.host;return null===e?"":se(e)},setHostname:function(e){this.cannotBeABaseURL||this.parse(e,xe)},getPort:function(){var e=this.port;return null===e?"":y(e)},setPort:function(e){this.cannotHaveUsernamePasswordPort()||(""===(e=y(e))?this.port=null:this.parse(e,Ce))},getPathname:function(){var e=this.path;return this.cannotBeABaseURL?e[0]:e.length?"/"+I(e,"/"):""},setPathname:function(e){this.cannotBeABaseURL||(this.path=[],this.parse(e,Pe))},getSearch:function(){var e=this.query;return e?"?"+e:""},setSearch:function(e){""===(e=y(e))?this.query=null:("?"===L(e,0)&&(e=G(e,1)),this.query="",this.parse(e,Ie)),this.searchParams.update()},getSearchParams:function(){return this.searchParams.facade},getHash:function(){var e=this.fragment;return e?"#"+e:""},setHash:function(e){""!==(e=y(e))?("#"===L(e,0)&&(e=G(e,1)),this.fragment="",this.parse(e,Oe)):this.fragment=null},update:function(){this.query=this.searchParams.serialize()||null}};var Ve=function(e){var t=h(this,We),r=w(arguments.length,1)>1?arguments[1]:void 0,i=M(t,new Ue(e,!1,r));a||(t.href=i.serialize(),t.origin=i.getOrigin(),t.protocol=i.getProtocol(),t.username=i.getUsername(),t.password=i.getPassword(),t.host=i.getHost(),t.hostname=i.getHostname(),t.port=i.getPort(),t.pathname=i.getPathname(),t.search=i.getSearch(),t.searchParams=i.getSearchParams(),t.hash=i.getHash())},We=Ve.prototype,Be=function(e,t){return{get:function(){return R(this)[e]()},set:t&&function(e){return R(this)[t](e)},configurable:!0,enumerable:!0}};if(a&&(u(We,"href",Be("serialize","setHref")),u(We,"origin",Be("getOrigin")),u(We,"protocol",Be("getProtocol","setProtocol")),u(We,"username",Be("getUsername","setUsername")),u(We,"password",Be("getPassword","setPassword")),u(We,"host",Be("getHost","setHost")),u(We,"hostname",Be("getHostname","setHostname")),u(We,"port",Be("getPort","setPort")),u(We,"pathname",Be("getPathname","setPathname")),u(We,"search",Be("getSearch","setSearch")),u(We,"searchParams",Be("getSearchParams")),u(We,"hash",Be("getHash","setHash"))),d(We,"toJSON",(function(){return R(this).serialize()}),{enumerable:!0}),d(We,"toString",(function(){return R(this).serialize()}),{enumerable:!0}),C){var Ne=C.createObjectURL,Ge=C.revokeObjectURL;Ne&&d(Ve,"createObjectURL",l(Ne,C)),Ge&&d(Ve,"revokeObjectURL",l(Ge,C))}b(Ve,"URL"),n({global:!0,constructor:!0,forced:!s,sham:!a},{URL:Ve})},3487:(e,t,r)=>{"use strict";r(6909)},8670:(e,t,r)=>{"use strict";var i=r(1091),n=r(5582),a=r(4787),s=r(160),o=r(4791),l=n("URL");i({target:"URL",stat:!0,forced:!o},{parse:function(e){var t=a(arguments.length,1),r=s(e),i=t<2||void 0===arguments[1]?void 0:s(arguments[1]);try{return new l(r,i)}catch(e){return null}}})},4783:()=>{},2222:(e,t,r)=>{"use strict";var i=r(6823);e.exports=i},4598:(e,t,r)=>{"use strict";var i=r(1042);e.exports=i},8251:(e,t,r)=>{"use strict";var i=r(1926);e.exports=i},4139:(e,t,r)=>{"use strict";var i=r(3842);r(2560),e.exports=i},7045:(e,t,r)=>{"use strict";var i=r(1730);r(2560),e.exports=i},70:(e,t,r)=>{"use strict";var i=r(1661);e.exports=i},9792:(e,t,r)=>{"use strict";var i=r(6908);e.exports=i},9076:(e,t,r)=>{"use strict";r(6299),r(5042),r(7649),r(3604);var i=r(2046);e.exports=i.URLSearchParams},6908:(e,t,r)=>{"use strict";r(9076),r(3487),r(8669),r(8670),r(4783);var i=r(2046);e.exports=i.URL}},t={};function r(i){var n=t[i];if(void 0!==n)return n.exports;var a=t[i]={exports:{}};return e[i].call(a.exports,a,a.exports,r),a.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var i in t)r.o(t,i)&&!r.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{"use strict";var e={};r.r(e),r.d(e,{APP_Troubleshoting_Info:()=>kl,Before_Create_Thread:()=>bo,BigLog_js:()=>Id,CloseVideoEncoder_js:()=>Fc,Crop_Mask_Bg_16V9:()=>Vc,Exit_Thread:()=>vo,GetCscThreadNum:()=>cl,GetEncThreadNum:()=>dl,GetEncoderState_js:()=>Tc,GetLogLevel_js:()=>qc,GetWebCodecsEncoderFallbackFlag_js:()=>al,GetWebCodecsEncoderL1T2Flag_js:()=>nl,Get_Mix_Context_Data_And_Draw:()=>Bc,Get_Mix_Display_Data_And_Draw:()=>Yc,Get_Mixed_VB_Data_and_Draw:()=>fd,InitVideoEncoder_js:()=>xc,IsSupportMultiThread:()=>Zo,IsSupportMultiThreadForWebcodec:()=>tl,JsMediaSDK_Log:()=>yn,LOG_OUT:()=>Pl,LimitWebCodecsDecoderTo360_js:()=>ol,LimitWebCodecsEncoderTo360_js:()=>sl,MCMMonitor_Video_LOG:()=>wd,Open_Video_WebSocket_Connect:()=>ro,Put_Decoded_Video_Buffer:()=>Bl,SAVE_IV:()=>Il,Set_Mask_Bg_Image:()=>Mc,SubScribeUpdateVideo:()=>no,Update_Mask_Texture:()=>Uc,Update_Video_Hd_Info:()=>Od,UserAgentIsTesla_js:()=>ll,UserWebCodecController_js:()=>Jd,Utf8ArrayToStr:()=>Dl,VideoEncodeInit:()=>nc,VideoEncoderConfigure_js:()=>Cc,VideoEncoder_js:()=>Ac,WebCodecsEncoderFail_js:()=>Ed,calculateframeCaptureInterval:()=>Rd,change_capture_resolution:()=>gl,checkWebCodecWhitelist_js:()=>$d,decode_callback:()=>Al,frame_callback:()=>xl,freeWasmMemory:()=>Ul,getGraphicName:()=>rl,getNTPBaseTime:()=>Td,getVendorName:()=>il,getWasmMemory:()=>Ol,hardcodecpunumber:()=>el,js_info_from_wcl:()=>vl,js_info_from_wcl_thread:()=>Rl,js_info_from_wcl_video_data:()=>Sl,media_data_transport_type_monitor:()=>bl,network_quality_callback:()=>bd,on_psl_mix_share_info_changed:()=>wl,prepareJSFile:()=>ed,prepareModelFile:()=>Jc,processed_capture_data_callback:()=>El,qos_monitor:()=>vd,recalculateFps:()=>Md,receiver_stats_log:()=>hl,reportSenderNTPTime:()=>xd,responseVideoQosData:()=>gd,send_data:()=>Fl,sender_stats_log:()=>ul,setCurrentThreadSsrc_js:()=>kc,vbLoadingTimer:()=>wo,video_process_capture:()=>rc,video_statistics_monitor:()=>yd,video_websocket_on_close:()=>pl,video_websocket_on_command:()=>ml,video_websocket_on_open:()=>ao,videocodec_create_helpthread:()=>yo,videoencode_create_helpthread:()=>go,wcl_trace_log:()=>Ll});var t=r(6984),i=r.n(t);const n=9,a=18,s=20,o=21,l=24,c=31,d=35,u=47,h=56,_=61,f=66.5,p=67,m=71,g=76,v=105,y=106,b=107,w=108,S=121,E=127,M=128,R=133,T=135,x=137,C=140,A=141,F=178,k=179,P=183,L=184,D=185,I=186,O=187,U=189,V=193,W=196,B=197,N=-8,G=-9,j=-26,H=-28,z=-137,q=49,Y=79,X="VIDEO_QOS_DATA",K="EXPOSE_VB_FRAME",Q="MEDIASDK_CACHE_INFO",$=new class{constructor(){this._highFrequencyLogs={},this.fixVersion="",this.cacheLogStack=[],this.isFlushing=!1}setInstance(e,t){this._instance=e,this.fixVersion=t}getMessageFromErrorOrEvent(e,t){let r=e;return t instanceof ErrorEvent?(t.filename&&(r+=` File: ${t.filename}`),(t.lineno||t.colno)&&(r+=` Line: ${t.lineno}:${t.colno}`),t.message&&(r+=` Message: ${t.message}`),t.error&&(r+=`\nStack: ${t.error.stack}`)):t instanceof Error?(t.message&&(r+=` Message: ${t.message}`),t.stack&&(r+=` Stack: ${t.stack}`),t.name&&(r+=` Name: ${t.name}`),t.constraint&&(r+=` Constraint: ${t.constraint}`)):t instanceof CloseEvent?(t.code&&(r+=` Code: ${t.code}`),t.reason&&(r+=` Reason: ${t.reason}`),r+=` wasClean: ${t.wasClean}`):t instanceof DOMException?(t.message&&(r+=` Message: ${t.message}`),t.name&&(r+=` Name: ${t.name}`)):r+=t?t.toString():"",r}_addCacheLog(e,t){this.cacheLogStack.length<100&&this.cacheLogStack.push({type:e,message:t})}flushCacheLog(){if(this._instance&&this.cacheLogStack.length>0&&!this.isFlushing){this.isFlushing=!0;let e="";this.cacheLogStack.forEach((t=>{let{type:r,message:{message:i="",tags:n=[]}}=t;const a=i?`${n.join("|")}:${i}|----|`:"";switch(r){case"log":this._log(i,[...n,Q]);break;case"warn":case"error":case"severityerror":case"directReport":e+=a}})),e&&this._directReport(e,[Q]),this.cacheLogStack=[],this.isFlushing=!1}}log(e,t=[]){this._instance?(this.flushCacheLog(),this._log(e,t)):this._addCacheLog("log",{message:e,tags:t})}warn(e,t=null,r=[]){e=this.getMessageFromErrorOrEvent(e,t),this._instance?(this.flushCacheLog(),this._warn(e,r)):this._addCacheLog("warn",{message:e,tags:r})}error(e,t=null,r=[]){var i;e=this.getMessageFromErrorOrEvent(e,t),this._highFrequencyLogs[e]?this._highFrequencyLogs[e]+=1:this._highFrequencyLogs[e]=1,!((i=this._highFrequencyLogs[e])&i-1)&&(this._instance?(this.flushCacheLog(),this._error(e,r)):this._addCacheLog("error",{message:e,tags:r}))}severityerror(e,t=[]){this._instance?(this.flushCacheLog(),this._severityerror(JSON.stringify(e),t)):this._addCacheLog("severityerror",{message:JSON.stringify(e),tags:t})}directReport(e,t=["MEDIASDK_INFO"]){var r;this._instance?(this.flushCacheLog(),null===(r=this._directReport)||void 0===r||r.call(this,e,t)):this._addCacheLog("directReport",{message:e,tags:t})}_log(e,t=[]){this._instance&&this._instance.log(e,t)}_warn(e,t=[]){this._instance&&this._instance.warn(e,t)}_error(e,t=[]){this._instance&&this._instance.error(e,[this.fixVersion,...t])}_severityerror(e,t=[]){this._instance&&this._instance.error(e,t)}_directReport(e,t=[]){var r,i;this._instance&&(null===(i=(r=this._instance).directReport)||void 0===i||i.call(r,{msg:e},t))}clearHighFrequencyLogs(){this._highFrequencyLogs={}}};new Error;const J=new Map;function Z(e,t="|"){return e?e.toString().replaceAll(/[,,]/g,t):""}const ee="function"!=typeof importScripts;function te(e){postMessage({status:d,data:e})}function re(e,t=null){ee?$.error(e,t):ie(e,t)}function ie(e,t=null){var r,i;if(t instanceof Error||t instanceof ErrorEvent){const n=t;e+=" Code: "+(null==n?void 0:n.code)+" Message: "+(null==t?void 0:t.message)+" Stack: "+(null!==(i=null===(r=null==n?void 0:n.error)||void 0===r?void 0:r.stack)&&void 0!==i?i:null==n?void 0:n.stack),t=null}postMessage({status:_,errorMessage:e,errorEvent:t})}function ne(e){postMessage({status:_,errorMessage:e,level:"low"})}function ae(e){ee?function(e,t){if(!function(e){const t=performance.now();return(!J.has(e)||t-J.get(e)>5e3)&&(J.set(e,t),!0)}(e))return;let r;try{r=Z("object"==typeof t?JSON.stringify(t):t)}catch(e){r=Z(t)}$.error(`NotifyUIError,event=${e},data=${r}`)}(-51,e):postMessage({status:-27,where:e})}function se(){return self.GROWABLE_HEAP_I8?self.GROWABLE_HEAP_I8():Module.HEAP8}function oe(){return self.GROWABLE_HEAP_U8?self.GROWABLE_HEAP_U8():Module.HEAPU8}function le(){return self.GROWABLE_HEAP_U32?self.GROWABLE_HEAP_U32():Module.HEAPU32}function ce(){return self.GROWABLE_HEAP_F32?self.GROWABLE_HEAP_F32():Module.HEAPF32}function de(e){postMessage({status:j,canvasId:e,replaceCanvas:!1})}function ue(e){postMessage({status:H,canvasId:e})}function he(){let e=this;this.promise=new Promise((function(t,r){e.reject=r,e.resolve=t}))}function _e(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(r){t=null==e?void 0:e.getContext("2d")}return t||ie("get2DContextFromCanvas return null"),t}class fe{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 r=0;r<e;r++)this.uint8Map[r]=new Uint8Array(t),this.availableIndex.push(r),this.avaiableIndexMap[r]=!0}increaseBufferSize(e){let t=this.bytesPerElement+e;this.bytesPerElement=t;for(let e=0;e<this.capacity;e++){let r=this.uint8Map[e],i=new Uint8Array(t);i.set(r,0),this.uint8Map[e]=i}}getCapacity(){return this.capacity}get(){if(this.availableIndex.length>0){let e=this.availableIndex.shift();return this.avaiableIndexMap[e]=!1,new Promise(((t,r)=>{t({index:e,uint8s:this.uint8Map[e]})}))}{let e=new he;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){!0!==this.avaiableIndexMap[e]&&(this.avaiableIndexMap[e]=!0,this.availableIndex.push(e),this.deferedList.length>0)&&this.deferedList.shift().resolve(this.get())}}class pe{constructor(e){this.sharedBufferList=e}storeFlexible(e,t){let r=e.byteLength-this.sharedBufferList.bytesPerElement;if(r>0){let e=Math.floor(.1*this.sharedBufferList.bytesPerElement),i=r>e?r:e;if(i+this.sharedBufferList.bytesPerElement>t)return Promise.reject("too big, more than maxBytesPerElement");this.sharedBufferList.increaseBufferSize(i)}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}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){ie("Error in YuvWrap.recycle: ".concat(e))}}}const me=["","MOZ_","OP_","WEBKIT_"];function ge(e,t){for(var r=0;r<me.length;++r){var i=me[r]+t,n=e.getExtension(i);if(n)return n}}const ve=new Map,ye=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 r=this.ssrcInfoMap.get(e);if(0===r.frames?r.firstTime=t:r.lastTime=t,r.frames+=1,r.frames>2&&r.frames%5==0&&r.lastTime-r.firstTime>=1e3){const t=Math.floor(1e3/((r.lastTime-r.firstTime)/(r.frames-1)));r.fps!==t&&(this._notifyFPS(e,t),r.fps=t),r.firstTime=r.lastTime,r.frames=1}}_removeZeroFPS(){let e=Date.now();this.ssrcInfoMap.forEach(((t,r)=>{const i=this.ssrcInfoMap.get(r);i&&i.lastTime&&e-i.lastTime>2e3&&(this.ssrcInfoMap.delete(r),this._notifyFPS(r,0))}))}_notifyFPS(e,t){postMessage({status:66.6,data:{ssrc:e,fps:t}})}_checkIfNewFrameComing(){this.timer&&(clearTimeout(this.timer),this.timer=null),this.timer=setTimeout((()=>{this._removeZeroFPS(),this.timer=null}),2500)}},be=new class{constructor(){this.ssrcInfoMap=new Map,this.timer=null}updateSSRCInfo(e,t){this.ssrcInfoMap.has(e)||this.ssrcInfoMap.set(e,{timeList:[],lastTime:0,fps:0}),this._calculateFPS(e,t),this._removeZeroFPS(),this._checkIfNewFrameComing()}_calculateFPS(e,t){const r=this.ssrcInfoMap.get(e);if(r.timeList.push(t),r.lastTime=t,r.timeList.length>2){const t=r.timeList[0],i=r.timeList[r.timeList.length-1];if(i-t>=1e3){const n=Math.floor(1e3/((i-t)/(r.timeList.length-1)));r.fps!==n&&(this._notifyFPS(e,n),r.fps=n),r.timeList=[]}}r.timeList.length>30&&(r.timeList=r.timeList.slice(r.timeList.length-30))}_removeZeroFPS(){this.ssrcInfoMap.forEach(((e,t)=>{const r=this.ssrcInfoMap.get(t);r&&Date.now()-r.lastTime>2e3&&(this.ssrcInfoMap.delete(t),this._notifyFPS(t,0))}))}_notifyFPS(e,t){postMessage({status:66.6,data:{ssrc:e,fps:t}})}_checkIfNewFrameComing(){this.timer&&(clearTimeout(this.timer),this.timer=null),this.timer=setTimeout((()=>{this._removeZeroFPS(),this.timer=null}),2500)}};function we(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,i=arguments.length>3&&void 0!==arguments[3]&&arguments[3];const{r_w:n,r_h:a,rotation:s,ssrc:o}=e;let l=1==s||3==s,c=l?a:n,d=l?n:a;const u=o>>10<<10,h=function(e,t){const r=e*t;return r<36864?0:r<129600?1:r<36e4?2:r<144e4?3:4}(c,d);if(!ve.get(u)||ve.get(u).width!==c||ve.get(u).height!==d){const e={width:c,height:d,ssrc:u,quality:h};ve.set(u,e),r?r(e):postMessage({status:f,data:e})}t&&(i?be:ye).updateSSRCInfo(u,Date.now())}function Se(e){return e&&"undefined"!=typeof atob?Uint8Array.from(atob(e),(e=>e.charCodeAt(0))):null}const Ee=function(e,t,r,i){let n=arguments.length>4&&void 0!==arguments[4]?arguments[4]:void 0;const a=i.width,s=i.height,o=a*s,l=o/4,c=t*r,d=c/4,u=t*i.y+i.x,h=t*i.y/4+i.x/2;let _;_=n?new Uint8Array(n,0,o+2*l):new Uint8Array(o+2*l);const f=e.buffer,p=e.byteOffset;if(t==i.width){const e=new Uint8Array(f,p+u,o);_.set(e,0);const t=new Uint8Array(f,p+c+h,l);_.set(t,o);const r=new Uint8Array(f,p+c+d+h,l);_.set(r,o+l)}else{let e=0,r=p+u;for(let i=0;i<s;i++){const i=new Uint8Array(f,r,a);_.set(i,e),e+=a,r+=t}let i=a/2,n=t/2,m=s/2;e=o,r=p+c+u;for(let t=0;t<m;t++){const t=new Uint8Array(f,r,i);_.set(t,e),e+=i,r+=n}e=o+l,r=p+c+d+h;for(let t=0;t<m;t++){const t=new Uint8Array(f,r,i);_.set(t,e),e+=i,r+=n}}return _};function Me(e,t){postMessage({status:o,data:"".concat(e,":").concat(t)})}function Re(){return(navigator.hardwareConcurrency||0)<4}let Te=null,xe=null;function Ce(e,t,r,i){const n=((e,t,r)=>{let i=1==r||3==r;return(i?t:e)>=1920&&(i?e:t)>=1080})(t,r,i);return xe===e&&Te===n||(xe=e,Te=n,postMessage({status:A,data:n})),n}function Ae(){const e=self.wasmMemory;(!e||!e.buffer||0===e.buffer.byteLength)&&postMessage({status:-36})}const Fe=1e3,ke=5,Pe=43,Le=44,De=45,Ie=10,Oe=11,Ue=-1,Ve=0,We=1,Be=3,Ne={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},Ge=30,je=24,He=20,ze=15,qe=8294400,Ye={DESKTOP:0,MOBILE:1,ANDROID:2,IPHONE:3},Xe=(new Map([["useinbandfec",1],["maxaveragebitrate",48e3],["maxplaybackrate",24e3],["sprop-maxcapturerate",24e3],["sprop-stereo",null],["stereo",null]]),new Map([["useinbandfec",null],["maxaveragebitrate",96e3],["maxplaybackrate",48e3],["sprop-maxcapturerate",48e3],["sprop-stereo",1],["stereo",1]]),new Map([["useinbandfec",null],["maxaveragebitrate",96e3],["maxplaybackrate",48e3],["sprop-maxcapturerate",48e3],["sprop-stereo",1],["stereo",1]]),new Map([["useinbandfec",null],["maxaveragebitrate",128e3],["maxplaybackrate",48e3],["sprop-maxcapturerate",48e3],["sprop-stereo",1],["stereo",1]]),new Map([["useinbandfec",null],["maxaveragebitrate",128e3],["maxplaybackrate",48e3],["sprop-maxcapturerate",48e3],["sprop-stereo",1],["stereo",1]]),new Map([["useinbandfec",null],["maxaveragebitrate",96e3],["maxplaybackrate",48e3],["sprop-maxcapturerate",48e3]]),new Map([["useinbandfec",1],["maxaveragebitrate",64e3],["maxplaybackrate",24e3],["sprop-maxcapturerate",24e3],["sprop-stereo",null],["stereo",null]]),new Map([["stereo",1]]),0),Ke={WASM_INIT_ERROR:1,BITSTREAM_ERROR:2,WEBCODEC_ERROR:3,WEBCODEC_TIMEOUT_ERROR:4,WEBCODEC_RETRY:5};var Qe=r(4997),$e=r(2321),Je=r(2231);function Ze(e){return Ze="function"==typeof $e&&"symbol"==typeof Je?function(e){return typeof e}:function(e){return e&&"function"==typeof $e&&e.constructor===$e&&e!==$e.prototype?"symbol":typeof e},Ze(e)}var et=r(9280);function tt(e,t,r){return(t=function(e){var t=function(e){if("object"!=Ze(e)||!e)return e;var t=e[et];if(void 0!==t){var r=t.call(e,"string");if("object"!=Ze(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Ze(t)?t:t+""}(t))in e?Qe(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const rt=["intel","nvidia","apple","amd","qualcomm","arm"],it=.005,nt=class{_drawWatermarkWithShadow(e){let{ctx:t,textPos:r,opacity:i,name:n}=e;t.fillStyle="rgba(0, 0, 0, ".concat(i,")"),t.fillText(n,r.x,r.y),t.fillStyle="rgba(255, 255, 255, ".concat(i,")"),t.fillText(n,r.x+1,r.y+1)}_getTransformInfo(e){let t,{canvas:r,position:i}=e;if(1===i)t={x:r.width/2,y:0,rateRadio:0,maxWidth:r.width};else if(2===i)t={x:r.width/2,y:r.height,rateRadio:0,maxWidth:r.width};else if(4===i)t={x:0,y:r.height/2,rateRadio:Math.PI/2,maxWidth:r.height};else if(8===i)t={x:r.width,y:r.height/2,rateRadio:-Math.PI/2,maxWidth:r.height};else{const e=-21*Math.PI/180;t={x:r.width/2,y:r.height/2,rateRadio:e,maxWidth:Math.min(r.width/Math.cos(e),-r.height/Math.sin(e))}}return t.maxWidth>100&&(t.maxWidth-=50),t}_calcTextPos(e){let{position:t,ctx:r,name:i,textWidth:n}=e;const a=this._getPaddingWidth({ctx:r,position:t,name:i});return 1===t?{x:-n.width/2,y:a}:2===t||4===t||8===t?{x:-n.width/2,y:-a}:{x:-n.width/2,y:r.measureText(i[0]).width/2}}_getPaddingWidth(e){let{ctx:t,position:r,name:i}=e;return[1,2,4,8].includes(r)?32:t.measureText(i[0]).width}_setBaseLine(e){let{ctx:t,position:r}=e;t.textBaseline=1===r?"top":2===r||4===r||8===r?"bottom":"middle"}Get_WaterMarkRGBA(e){let{canvas:t,name:r,width:i,height:n,opacity:a=.15,position:s,convertToDataUrl:o=!1,transferToImage:l=!1}=e;if(!r||!i||!n)return;a=a||.15,i*=1,n*=1,t.width=i,t.height=n;let c=this._getTransformInfo({canvas:t,position:s});var d=t.getContext("2d");let u;if(d.clearRect(0,0,t.width,t.height),d.translate(c.x,c.y),d.rotate(c.rateRadio),this._setBaseLine({ctx:d,position:s}),d.lineWidth=1,d.imageSmoothingEnabled=!0,1==r.length){const e=c.maxWidth/r.length;d.font=e+"px 'Segoe UI'",u=d.measureText(r)}else{let e=16;for(d.font=e+"px 'Segoe UI'",u=d.measureText(r);u.width<c.maxWidth-2*this._getPaddingWidth({ctx:d,position:s,name:r});)e+=1,d.font=e+"px 'Segoe UI'",u=d.measureText(r);if(u.width>c.maxWidth-2*this._getPaddingWidth({ctx:d,position:s,name:r}))if(e>16)e-=1,d.font=e+"px 'Segoe UI'",u=d.measureText(r);else{const e=r;for(;r.length>5&&u.width>c.maxWidth-2*this._getPaddingWidth({ctx:d,position:s,name:r+"..."});)r=r.slice(0,r.length-1),u=d.measureText(r+"...");e!==r&&(r+="...")}}const h=this._calcTextPos({position:s,ctx:d,name:r,textWidth:u});var _;if(this._drawWatermarkWithShadow({ctx:d,name:r,opacity:a,textPos:h}),o)_=t.toDataURL();else if(l)_=t.transferToImageBitmap();else{var f=d.getImageData(0,0,d.canvas.width,d.canvas.height);_=new Uint8Array(f.data.buffer)}return d.rotate(-c.rateRadio),d.translate(-c.x,-c.y),_}Get_Repeated_WaterMarkRGBA(e){let{canvas:t,name:r,width:i,height:n,opacity:a=.15,position:s,convertToDataUrl:o=!1,transferToImage:l=!1}=e;if(!r||!i||!n)return;a=a||.15,i*=1,n*=1,t.width=i,t.height=n;const c=t.getContext("2d");c.clearRect(0,0,t.width,t.height),c.translate(i/2,n/2),c.rotate(-21*Math.PI/180),c.imageSmoothingEnabled=!0,c.font="".concat(32,"px 'Segoe UI'"),c.textBaseline="top";const d=c.measureText(r),u=.37*d.width;let h,_=0,f=-n;do{let e=_%2==0?u-i:-i;do{c.fillStyle="rgba(0, 0, 0, ".concat(a,")"),c.fillText(r,e,f),c.fillStyle="rgba(255, 255, 255, ".concat(a,")"),c.fillText(r,e+1,f+1),e+=d.width+u}while(e<i);f+=32+u,_++}while(f<n);if(o)h=t.toDataURL();else if(l)h=t.transferToImageBitmap();else{const e=c.getImageData(0,0,c.canvas.width,c.canvas.height);h=new Uint8Array(e.data.buffer)}return c.rotate(21*Math.PI/180),c.translate(-i/2,-n/2),h}};function at(){this.a=[],this.b=0,this.residue=null}at.prototype.getLength=function(){return this.a.length-this.b},at.prototype.isEmpty=function(){return 0==this.a.length},at.prototype.enqueue=function(e){this.a.push(e)},at.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},at.prototype.peek=function(){return 0<this.a.length?this.a[this.b]:void 0},at.prototype.clear=function(){this.a=[],this.b=0};const st=at;function ot(){this.ssrcQueueMap=new Map,ot.prototype.AddQueue=function(e){var t=new st;return this.ssrcQueueMap.set(e,t),t},ot.prototype.DeleteQueue=function(e){this.ssrcQueueMap.delete(e)},ot.prototype.GetQueue=function(e){return this.ssrcQueueMap.get(e)},ot.prototype.GetQueueData=function(e){return this.ssrcQueueMap.get(e).dequeue()},ot.prototype.PutQueueData=function(e,t){this.ssrcQueueMap.get(e).enqueue(t)},ot.prototype.GetQueueLength=function(e){var t=this.ssrcQueueMap.get(e);return null!==t?t.getLength():0}}var lt=function(){this.frames=0,this.ntp=new st};lt.prototype={UpdateVideoInfo:function(e){this.frames++,this.ntp.getLength()>30&&this.ntp.dequeue(),this.ntp.enqueue(e)},GetVideoFpsInfo:function(){var e=this.ntp.getLength();if(!(e<5)){for(var t=0,r=0,i=0,n=0,a=0;a<e;a++){var s=this.ntp.dequeue();0==s&&0==i?r++:0!=s?(n=0,0==i&&(i=s),t=s):0!=i&&t!=i&&0==s&&n++}return 0==t||t==i?0:e-r-n-1!=0?(t-i)/(e-r-n-1):0}}};var ct=function(){this.ssrcInfoMap=new Map};function dt(){this.ssrcQueueMap=new Map,this.ssrcInfo=new ct,dt.prototype.AddQueue=function(e){var t=new st;return this.ssrcQueueMap.set(e,t),t},dt.prototype.DeleteQueue=function(e){this.ssrcQueueMap.delete(e)},dt.prototype.GetQueue=function(e){return this.ssrcQueueMap.get(e)},dt.prototype.ClearQueue=function(){this.ssrcQueueMap.clear()},dt.prototype.GetQueueData=function(e){return this.ssrcQueueMap.get(e).dequeue()},dt.prototype.PutQueueData=function(e,t){this.ssrcQueueMap.get(e).enqueue(t)},dt.prototype.GetQueueLength=function(e){var t=this.ssrcQueueMap.get(e);return t?t.getLength():0},dt.prototype.UpdateInfo=function(e,t){this.ssrcInfo.UpdateSSRCInfo(e,t)},dt.prototype.GetFpsInfo=function(e){return this.ssrcInfo.GetSSRCFpsInfo(e)}}function ut(e){let{sessionid:t}=e;this.sessionid=t||0,this.map=new Map,this.VideoQueueMGR=new dt}ct.prototype={UpdateSSRCInfo:function(e,t){var r=this.ssrcInfoMap.get(e);r||(r=new lt,this.ssrcInfoMap.set(e,r)),r.UpdateVideoInfo(t)},GetSSRCFpsInfo:function(e){var t=this.ssrcInfoMap.get(e);return t?t.GetVideoFpsInfo():0}},function(){function e(e){let{sessionid:t}=e;this.map=new Map,this.AudioQueueMGR=new ot,this.timemap=new Map,this.sessionid=t||0}e.prototype.Add=function(e,t){this.map.set(e,t),this.AudioQueueMGR.AddQueue(e)},e.prototype.Clear=function(){this.map.clear()},e.prototype.Keys=function(){return this.map.keys()},e.prototype.UpdateSSRCTimeMap=function(e){this.timemap=e},e.prototype.GetSSRCTimeMap=function(e){return this.timemap?this.timemap.get(e):null}}(),ut.prototype.Add=function(e,t){this.map.set(e,t)},ut.prototype.Clear=function(){this.map.clear()},ut.prototype.Keys=function(){return this.map.keys()};var ht=function(){this.frames=0,this.ntp=new st};ht.prototype={UpdateSharingInfo:function(e){this.frames++,this.ntp.getLength()>30&&this.ntp.dequeue(),this.ntp.enqueue(e)},GetSharingFpsInfo:function(){var e=this.ntp.getLength();if(!(e<5)){for(var t=0,r=0,i=0,n=0,a=0;a<e;a++){var s=this.ntp.dequeue();0==s&&0==i?r++:0!=s?(n=0,0==i&&(i=s),t=s):0!=i&&t!=i&&0==s&&n++}return 0==t||t==i?0:e-r-n-1!=0?(t-i)/(e-r-n-1):0}}};var _t=function(){this.ssrcInfoMap=new Map};function ft(){this.ssrcQueueMap=new Map,this.ssrcInfo=new _t,ft.prototype.AddQueue=function(e){var t=new st;return this.ssrcQueueMap.set(e,t),t},ft.prototype.DeleteQueue=function(e){this.ssrcQueueMap.delete(e)},ft.prototype.GetQueue=function(e){return this.ssrcQueueMap.get(e)},ft.prototype.ClearQueue=function(){this.ssrcQueueMap.clear()},ft.prototype.GetQueueData=function(e){return this.ssrcQueueMap.get(e).dequeue()},ft.prototype.PutQueueData=function(e,t){this.ssrcQueueMap.get(e).enqueue(t)},ft.prototype.GetQueueLength=function(e){var t=this.ssrcQueueMap.get(e);return t?t.getLength():0},ft.prototype.UpdateInfo=function(e,t){this.ssrcInfo.UpdateSSRCInfo(e,t)},ft.prototype.GetFpsInfo=function(e){return this.ssrcInfo.GetSSRCFpsInfo(e)}}function pt(e){let{sessionid:t}=e;this.map=new Map,this.sQueue=new st,this.SharingQueueMGR=new ft,this.sessionid=t||0}function mt(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,i)}return r}function gt(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?mt(Object(r),!0).forEach((function(t){tt(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):mt(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}_t.prototype={UpdateSSRCInfo:function(e,t){var r=this.ssrcInfoMap.get(e);r||(r=new ht,this.ssrcInfoMap.set(e,r)),r.UpdateSharingInfo(t)},GetSSRCFpsInfo:function(e){var t=this.ssrcInfoMap.get(e);return t?t.GetSharingFpsInfo():0}},pt.prototype.Clear=function(){this.map.clear()},pt.prototype.Keys=function(){return this.map.keys()},pt.prototype.Add=function(e,t){this.map.set(e,t)},pt.prototype.Get=function(e){return this.map.get(e)},pt.prototype.PutData=function(e){e&&this.sQueue&&this.sQueue.enqueue(e)},pt.prototype.GetData=function(){if(this.sQueue)return this.sQueue.dequeue()},pt.prototype.ClearBuffer=function(){this.sQueue&&(this.sQueue=new st)};const vt=function(e,t){let r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:16/9;if(!e||!t)return null;const i=(arguments.length>2&&void 0!==arguments[2]?arguments[2]:0)||0,n=(arguments.length>3&&void 0!==arguments[3]?arguments[3]:0)||0;if(e/t>r){const a=t*r;return{width:a,height:t,left:Math.round((e-a)/2)+i,top:0+n}}{const a=e/r;return{width:e,height:a,left:0+i,top:Math.round((t-a)/2)+n}}};function yt(e,t,r){function i(e,t){return Math.min("px"===e.unit?e.value/t:e.value/100,.5)}return{radius_lb_x:i(e.topLeft.x,t),radius_lb_y:i(e.topLeft.y,r),radius_lt_x:i(e.bottomLeft.x,t),radius_lt_y:i(e.bottomLeft.y,r),radius_rb_x:i(e.topRight.x,t),radius_rb_y:i(e.topRight.y,r),radius_rt_x:i(e.bottomRight.x,t),radius_rt_y:i(e.bottomRight.y,r)}}const bt={radius_lb_x:0,radius_lb_y:0,radius_lt_x:0,radius_lt_y:0,radius_rb_x:0,radius_rb_y:0,radius_rt_x:0,radius_rt_y:0};function wt(e){this.Notify_APPUI=e.Notify_APPUI,this.isSupportOffscreenCanvas=e.isSupportOffscreenCanvas,this.jsMediaEngine=e.jsMediaEngine,this.threadNumbs=e.videodecodethreadnumb,this.globalTracingLogger=e.globalTracingLogger,this.monitorLoggerFn=e.monitorLoggerFn,this.renderManager=e.renderManager,this.isLSSPlayer=e.isLSSPlayer,this.waterMarkCanvas=null,this.videoRenderLevel=10,this.videoRenderLevelCount=1,this.renderPeriodTotal=100,this.renderPeriodCount=0,this.renderPeriodTotalFps=0,this.renderPeriodFpsCount=0,this.lastRenderAudioTimeStamp=0,this.videoBufEmptyCount=0,this.videoBufCount=0,this.videoRenderMaxLevel=15,this.timestamp=0,this.audioPlayTime=0,this.videoTimestamp=0,this.videoWaterMarkName="",this.isCreateVideoWaterMark=!1,this.isWaterMarkRepeatedEnable=!1,this.waterMarkOpacity=.15,this.currentactive=0,this.audioPlaySsrc=0,this.currentVideoHeight=0,this.currentVideoWidth=0,this.videoRenderArray=[],this.WaterMarkRGBA=new nt,this.vMonitorCount=0,this.videoQueue=new dt,this.timestart=0,this.rendingFlag=!0,this.rAFID=0,this.rAFIDBack=null,this.prevRequestAnimationTimestap=0,this.retryRequestAnimationStep=2,this.ssrcDisplayMap=new Map,this.ssrcHaddataMap=new Map,this.zoneLastRenderedMap=new Map,this.ssrcCurrentRenderingMap=new Map,this.pauseSet=new Set,this.canvasToLocalDisplay=new Map,this.canvasIdSet=new Set,this.selfvideossrc=0,this.localVideoPtr=0,this.sabBuffer=0,this.localvideossrc=0,this.encodedVideoSharedArrayBufferUint8Array=null,this.encodedVideoSharedArrayBufferUint16Array=null,this.encodedVideoSharedArrayWasmMemory=null,this.startCaptureVideo=!1,this.clearColor=new Uint8Array(4),this.videorendercanvas=null,this.keyrender=null,this.renderIndex=0,this.activeSpeakssrc=0,this.renderMode=0,this.intervalHandle,this.croppingParams={top:0,left:0,height:1,width:1},this.coordinate={x:0,y:0,width:640,height:360},this.bWebglContextLostProtectingMap=new Map,this.ismirror=!1,this.firstFrameMap=new Map,this.lfTimeStamp=0,this.activeFps=0,this.lastActiveSSRC=0,this.disableOriginalRatio=!1,this.onStopDrawCallback=e.onStopDrawCallback,this.onReStoreCallback=e.onReStoreCallback,this.videoRenderWGLFSTOP=!1}wt.prototype.clearUseridRender=function(e,t,r,i){let n=e[0],a=n.display;if(a)if(!i&&a.setWatermarkFlag(0),this.renderMode)a.clearCanvas(t);else{let e=n.ssrc;if(!a||!t)return;this.croppingParams.top=0,this.croppingParams.left=0,this.croppingParams.height=1,this.croppingParams.width=1,this.clearColor[0]=255*t.R,this.clearColor[1]=255*t.G,this.clearColor[2]=255*t.B,this.clearColor[3]=255*t.A;const i=this.renderManager.getRendererProvider().isWebGLRendererType(),s=this.renderManager.getRendererProvider().isWebGL2RendererType(),o=this.renderManager.getRendererProvider().isWebGPURendererType();if(i||s){let e=this.canvasToLocalDisplay.get(n.canvas);if(!e)return;e.setVideoMode(Ve),e.colorRange=0,e.setFillMode(1,1),e.setRoundedCornerRadius(bt),e.updateSelfVideoTextures(1,1,this.clearColor,this.croppingParams,!0),void 0===r&&((r={}).x=n.x,r.y=n.y,r.width=n.width,r.height=n.height),e.drawSelfVideo(r,!0)}else if(o){if(!a)return;a.setVideoMode(Ve),a.setColorRange(0),a.setFillMode(1,1),a.setRoundedCornerRadius(bt),a.updateSelfVideoTextures(1,1,this.clearColor,this.croppingParams,!0),void 0===r&&((r={}).x=n.x,r.y=n.y,r.width=n.width,r.height=n.height),a.drawSelfVideo(r,!0)}let l=this;this.ssrcDisplayMap.forEach((function(t,r){let n,a;l.selfvideossrc&&r==l.Get_Logical_SSrc(l.selfvideossrc)&&(n=!0),r==l.Get_Logical_SSrc(e)&&(a=!0),t.forEach((e=>{if(!e.haddata||a)return;let t=e.display;l.coordinate.x=e.x,l.coordinate.y=e.y,l.coordinate.width=e.width,l.coordinate.height=e.height,t&&(!a||i&&s?t.getVideoMode()!=Ue&&(-1==[Ve,Be].indexOf(t.getVideoMode())&&n?t.drawSelfVideo(l.coordinate,!1,l.ismirror):n?t.drawRemoteVideo(l.coordinate,l.ismirror):t.drawRemoteVideo(l.coordinate)):(t.drawSelfVideo(l.coordinate,!0),this.isLSSPlayer&&l.firstFrameMap.get(e.ssrc)&&l.firstFrameMap.delete(e.ssrc)))}))})),this.renderManager.renderFor(1)}},wt.prototype.Set_Render_Array_rAF=function(e){if(this.videoRenderArray=e,this.ssrcDisplayMap.clear(),this.ssrcHaddataMap.clear(),this.videoRenderArray.length>0)for(let e=0;e<this.videoRenderArray.length;e++){let t=this.ssrcDisplayMap.get(this.Get_Logical_SSrc(this.videoRenderArray[e].ssrc));t?t.push(this.videoRenderArray[e]):(t=[],t.push(this.videoRenderArray[e]),this.ssrcDisplayMap.set(this.Get_Logical_SSrc(this.videoRenderArray[e].ssrc),t),this.ssrcHaddataMap.set(this.Get_Logical_SSrc(this.videoRenderArray[e].ssrc),!1))}},wt.prototype.Set_Render_Array=function(e,t){this.renderMode?this.Set_Render_Array_IntervalMode(e,t):this.Set_Render_Array_rAF(e)},wt.prototype.ClearQueue=function(){this.videoQueue&&this.videoQueue.ClearQueue(),this.currentVideoHeight=0,this.currentVideoWidth=0},wt.prototype.Put_Video_Into_Buffer=function(e){if(this.videoQueue){var t=this.videoQueue.GetQueue(e.ssrc);if(t||(t=this.videoQueue.AddQueue(e.ssrc)),t.enqueue(e),this.videoQueue&&this.videoQueue.ssrcInfo){var r=e.ssrc>>10;this.videoQueue.ssrcInfo.UpdateSSRCInfo(r,e.ntptime)}for(var i=this.videoQueue.GetQueueLength(e.ssrc)-10;i>=0;)i--}},wt.prototype.Update_RemoteVideo_Texture=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,n=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null,a=arguments.length>5&&void 0!==arguments[5]&&arguments[5];if(this.Check_Request_Animation(),t)if(e&&r){let t=this.Get_Logical_SSrc(r),s=this.FindVideoRenderListFromMap(r);if(!s.length)return void this.renderManager.destroyUnusedVideoFrame(e);let o=this,l=a&&(1==i||3==i);this.ssrcHaddataMap.set(t,!0),n?(this.croppingParams.top=n.y,this.croppingParams.left=n.x,this.croppingParams.height=n.height,this.croppingParams.width=n.width):(this.croppingParams.top=e.visibleRect?0:e.cropTop,this.croppingParams.left=e.visibleRect?0:e.cropLeft,this.croppingParams.height=e.visibleRect?e.visibleRect.height:e.cropHeight,this.croppingParams.width=e.visibleRect?e.visibleRect.width:e.cropWidth);let{width:c,height:d}=e.visibleRect||{};if(c&&d||(d=this.croppingParams.height,c=this.croppingParams.width),l){let e=d;d=c,c=e,e=this.croppingParams.height,this.croppingParams.height=this.croppingParams.width,this.croppingParams.width=e}a&&(i=0),this.canvasIdSet.clear(),s&&s.forEach((t=>{t.haddata=!0;let r=t.display;o.coordinate.x=t.x,o.coordinate.y=t.y,o.coordinate.width=t.width,o.coordinate.height=t.height;let n=!(r&&r.reuse&&t.rendercanvasID&&this.canvasIdSet.has(t.rendercanvasID));r&&(r.setVideoMode(Ve),o.Should_Update_Watermark(r,t.width,t.height,t.width,t.height)&&o.Update_Display_Watermark(r,t.width,t.height,t.width,t.height),e&&r.updateRemoteVideoTexturesImageBitmap(c,d,e,o.croppingParams,i,n),this.canvasIdSet.add(t.rendercanvasID))}))}else this.renderManager.destroyUnusedVideoFrame(e);else{if(e&&e.ssrc){let t=this.Get_Logical_SSrc(e.ssrc);if(this.isLSSPlayer&&this.pauseSet.has(t+" "+e.zone))return;let r,i=this.FindVideoRenderListFromMap(e.ssrc);if(!i.length)return e.yuvdataptr&&Module._free(e.yuvdataptr),void this.renderManager.destroyUnusedVideoFrame(e);let n=!1,a=this;this.ssrcHaddataMap.set(t,!0);let s=e;this.croppingParams.top=s.r_y,this.croppingParams.left=s.r_x,this.croppingParams.height=s.r_h,this.croppingParams.width=s.r_w,r=s,r.enableMultiDecodeVideoWithoutSAB?r.yuvdata=r.data:r.yuvdata=oe().subarray(r.yuvdataptr,r.yuvdataptr+r.yuvlength),!r.yuvdata.length||r.yuvdata.length!=r.width*r.height*3/2||this.croppingParams.top<0||this.croppingParams.left<0||this.croppingParams.left+this.croppingParams.width>r.width||this.croppingParams.top+this.croppingParams.height>r.height||i&&(this.canvasIdSet.clear(),i.forEach((e=>{e.haddata=!0;let i=e.display;a.coordinate.x=e.x,a.coordinate.y=e.y,a.coordinate.width=e.width,a.coordinate.height=e.height;let s=!(i&&i.reuse&&e.rendercanvasID&&this.canvasIdSet.has(e.rendercanvasID));i&&(i.setVideoMode(We),this.Should_Update_Watermark(i,e.width,e.height,e.width,e.height)&&this.Update_Display_Watermark(i,e.width,e.height,e.width,e.height),r&&(this.isLSSPlayer&&this.ssrcCurrentRenderingMap.set(t,r),i.updateRemoteVideoTextures(r.width,r.height,a.croppingParams,r.yuvdata,r.rotation,r.yuv_limited,a.coordinate,n,s)),this.canvasIdSet.add(e.rendercanvasID))})))}else this.renderManager.destroyUnusedVideoFrame(e);e.yuvdataptr&&Module._free(e.yuvdataptr)}},wt.prototype.Set_Cropping_Mode=function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.disableOriginalRatio=!!e},wt.prototype.Update_Cropping_Params=function(){if(this.disableOriginalRatio){const e=vt(this.croppingParams.width,this.croppingParams.height,this.croppingParams.left,this.croppingParams.top);e&&(this.croppingParams=gt(gt({},this.croppingParams),e))}},wt.prototype.Update_SelfVideo_Texture=function(e,t,r,i){let n=arguments.length>4&&void 0!==arguments[4]?arguments[4]:Ve,a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0,s=arguments.length>6&&void 0!==arguments[6]?arguments[6]:0;if(a?(this.croppingParams.top=a.top,this.croppingParams.left=a.left,this.croppingParams.width=a.width,this.croppingParams.height=a.height):(this.croppingParams.top=0,this.croppingParams.left=0,this.croppingParams.height=t,this.croppingParams.width=e),this.renderMode){let a=0;this.canvasIdSet.clear();const o=this.FindVideoRenderList(i);for(;a<o.length;a++){this.coordinate.x=o[a].x,this.coordinate.y=o[a].y,this.coordinate.width=o[a].width,this.coordinate.height=o[a].height,this.Update_Cropping_Params(),o[a].display.setVideoMode(n);const{display:i,width:l,height:c}=o[a];this.Should_Update_Watermark(i,l,c,l,c)&&this.Update_Display_Watermark(i,l,c,l,c);let d=!(i&&i.reuse&&o[a].rendercanvasID&&this.canvasIdSet.has(o[a].rendercanvasID));-1!==[Ve,Be].indexOf(n)?(o[a].display.updateSelfVideoTextures(e,t,r,this.croppingParams,d,s),o[a].enableMultiDecodeVideoWithoutSAB?o[a].firstFrame=!0:o[a].display.drawSelfVideo(this.coordinate,!1,this.ismirror)):(o[a].display.updateRemoteVideoTextures(e,t,this.croppingParams,r,s,0,this.coordinate,!1,d),o[a].enableMultiDecodeVideoWithoutSAB?o[a].firstFrame=!0:o[a].display.drawRemoteVideo(this.coordinate,this.ismirror)),this.canvasIdSet.add(o[a].rendercanvasID)}this.renderManager.renderFor(1)}else if(r&&i){let a=this.FindVideoRenderListFromMap(i);this.ssrcHaddataMap.set(i,!0);let o=this;a.length&&(this.canvasIdSet.clear(),a.forEach((i=>{i.haddata=!0,o.coordinate.x=i.x,o.coordinate.y=i.y,o.coordinate.width=i.width,o.coordinate.height=i.height,o.Update_Cropping_Params();let a=i.display,l=!(a&&a.reuse&&i.rendercanvasID&&this.canvasIdSet.has(i.rendercanvasID));a&&(a.setVideoMode(n),o.Should_Update_Watermark(a,i.width,i.height,i.width,i.height)&&o.Update_Display_Watermark(a,i.width,i.height,i.width,i.height),-1!==[Ve,Be].indexOf(n)?a.updateSelfVideoTextures(e,t,r,o.croppingParams,l,s):a.updateRemoteVideoTextures(e,t,o.croppingParams,r,s,!0,o.coordinate,!1,l),this.canvasIdSet.add(i.rendercanvasID))})),this.renderManager.renderFor(1))}},wt.prototype.Draw_Send_Video_Img=function(e,t,r,i){let n=arguments.length>4&&void 0!==arguments[4]?arguments[4]:Ve,a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0;this.Update_SelfVideo_Texture(t,r,e,i,n,a)},wt.prototype.setMirrorMyVideoOption=function(e){this.ismirror=e},wt.prototype.Start_Draw=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:10;return this.rendingFlag=!0,this.renderMode=e,e?t?(this.intervalHandle=setInterval(this.JsMediaSDK_VideoRender_interval.bind(this),t),this.intervalHandle):null:(function(e){if(e)Rt=e}(this),this.Start_Request_Animation_Frame())},wt.prototype.Stop_Draw=function(){this.rendingFlag=!1,this.renderMode?clearInterval(this.intervalHandle):this.Stop_Request_Animation_Frame()},wt.prototype.contextLostCallback=function(e){let t=e.currentTarget.canvasId;Et&&de(t),e.preventDefault()},wt.prototype.contextRestoredCallback=function(e){let t=e.currentTarget,r=t.canvasId,i=t.callback;this.Restored_From_Context_Lost(t,t,r,this.Log_Error.bind(this),i),this.onReStoreCallback&&this.onReStoreCallback(this),Et&&ue(r)},wt.prototype.webGLContextLostProtect=function(e,t,r){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;t&&t!==e&&(t.contextLostHandler&&t.removeEventListener("webglcontextlost",t.contextLostHandler),t.contextRestoredHandler&&t.removeEventListener("webglcontextrestored",t.contextRestoredHandler)),e&&!this.bWebglContextLostProtectingMap.get(e)&&(e.canvasId=r,e.callback=i,this.renderMode||((t=this.bWebglContextLostProtectingMap.get(r))&&(t.removeEventListener("webglcontextlost",t.contextLostHandler),t.removeEventListener("webglcontextrestored",t.contextRestoredHandler)),this.bWebglContextLostProtectingMap.set(r,e),e.contextLostHandler=this.contextLostCallback.bind(this),e.contextRestoredHandler=this.contextRestoredCallback.bind(this),e.addEventListener("webglcontextlost",e.contextLostHandler,{capture:!1}),e.addEventListener("webglcontextrestored",e.contextRestoredHandler,{capture:!1})))},wt.prototype._Replace_Video_Render_Array_From_Context_LOST=function(e){let{canvas:t,oldCanvas:r,newDisplayMap:i}=e;for(let e=0;e<this.videoRenderArray.length;e++)if(this.videoRenderArray[e].canvas===r||this.videoRenderArray[e].canvas===t){r!==t&&(this.videoRenderArray[e].canvas=t);const a=this.videoRenderArray[e].display.getFillMode();var n;this.videoRenderArray[e].display=i?i.get(this.videoRenderArray[e].display.getTextureIndex()):this._Create_WebGL_Canvas({videoRenderArrayIndex:e,canvas:t,canvasId:this.videoRenderArray[e].rendercanvasID}),a&&this.videoRenderArray[e].display&&this.videoRenderArray[e].display.setFillMode(a,this.videoRenderArray[e].display.getFillModeForResolution()),this.videoRenderArray[e].borderRadius&&(null===(n=this.videoRenderArray[e].display)||void 0===n||n.setRoundedCornerRadius(this.videoRenderArray[e].borderRadius))}},wt.prototype.Restored_From_Context_Lost=function(e,t,r,i){let n=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null;if(this.renderMode)this._Replace_Video_Render_Array_From_Context_LOST({canvas:e,oldCanvas:t});else{const a=this.renderManager.onRestoredFromContextLost(r,e,t,this.threadNumbs,i,this.canvasToLocalDisplay);a&&(this.ssrcDisplayMap.forEach(((r,i)=>{r.forEach((r=>{if(r.haddata=!1,r.canvas===t){t!==e&&(r.canvas=e);let i=r.display;r.display=a.get(i.getTextureIndex())}}))})),this._Replace_Video_Render_Array_From_Context_LOST({canvas:e,oldCanvas:t,newDisplayMap:a}),null==n||n({canvas:e,oldCanvas:t,newDisplayMap:a}),this.rendingFlag&&this.Start_Request_Animation_Frame())}},wt.prototype.Replace_Canvas=function(e,t){let r=null;this.bWebglContextLostProtectingMap.forEach(((e,i)=>{i===t&&(r=e)})),r!=e&&(this.bWebglContextLostProtectingMap.delete(t),this.webGLContextLostProtect(e,r,t),this.Restored_From_Context_Lost(e,r,t,this.Log_Error.bind(this))),this.isSupportOffscreenCanvas&&(this.waterMarkCanvas||this.videorendercanvas)&&(this.waterMarkCanvas=this.videorendercanvas=new OffscreenCanvas(640,360))},wt.prototype.Get_Display=function(e,t,r){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;const n=this.renderManager.getRendererProvider().isWebGLRendererType(),a=this.renderManager.getRendererProvider().isWebGL2RendererType();return(n||a)&&this.webGLContextLostProtect(e,null,t,i),this.renderManager.getVideoRenderDisplay(e,t,this.threadNumbs,this.Log_Error.bind(this),this.canvasToLocalDisplay)},wt.prototype.GiveBack_Display=function(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=e[0];r&&r.display&&this.renderManager.recycleRenderDisplay(r.canvas,r.display,t)},wt.prototype.Get_Logical_SSrc=function(e){return e?e>>10<<10:-1},wt.prototype.Set_LocalVideo_Ptr=function(e){e&&(this.localVideoPtr=e)},wt.prototype.Set_LocalVideo_Buffer=function(e){e&&(this.encodedVideoSharedArrayWasmMemory=e,this.sabBuffer=e.buffer,this.encodedVideoSharedArrayBufferUint8Array=new Uint8Array(this.sabBuffer),this.encodedVideoSharedArrayBufferUint16Array=new Uint16Array(this.sabBuffer))},wt.prototype.Set_LocalVideo_SSRC=function(e){e&&(this.localvideossrc=e,this.selfvideossrc=e)},wt.prototype.Draw_LocalVideo=function(){if(this.localVideoPtr&&this.sabBuffer&&this.localvideossrc){this.encodedVideoSharedArrayWasmMemory&&this.encodedVideoSharedArrayWasmMemory.buffer!=this.sabBuffer&&(this.encodedVideoSharedArrayBufferUint8Array=new Uint8Array(this.encodedVideoSharedArrayWasmMemory.buffer),this.encodedVideoSharedArrayBufferUint16Array=new Uint16Array(this.encodedVideoSharedArrayWasmMemory.buffer),this.sabBuffer=this.encodedVideoSharedArrayWasmMemory.buffer);let e=Atomics.load(this.encodedVideoSharedArrayBufferUint8Array,this.localVideoPtr),t=Atomics.load(this.encodedVideoSharedArrayBufferUint8Array,this.localVideoPtr+1),r=!0;if(e==t&&(r=!1),e-t==1&&(e=(e+1)%5),r){let t=0,r=this.encodedVideoSharedArrayBufferUint16Array[this.localVideoPtr/2+(4+(qe+4+8+2)*e)/2],i=this.encodedVideoSharedArrayBufferUint16Array[this.localVideoPtr/2+(4+(qe+4+8+2)*e+2)/2],n=this.encodedVideoSharedArrayBufferUint16Array[this.localVideoPtr/2+(4+(qe+4+8+2)*e+4)/2],a=this.encodedVideoSharedArrayBufferUint16Array[this.localVideoPtr/2+(4+(qe+4+8+2)*e+6)/2],s=this.encodedVideoSharedArrayBufferUint16Array[this.localVideoPtr/2+(4+(qe+4+8+2)*e+8)/2],o=this.encodedVideoSharedArrayBufferUint16Array[this.localVideoPtr/2+(4+(qe+4+8+2)*e+10)/2],l=this.encodedVideoSharedArrayBufferUint16Array[this.localVideoPtr/2+(4+(qe+4+8+2)*e+12)/2],c=255&l,d=l>>8&255;t=c&&c!==Be?r*i*3/2:r*i*4,this.croppingParams.top=n,this.croppingParams.left=a,this.croppingParams.height=o,this.croppingParams.width=s;let u=this.encodedVideoSharedArrayBufferUint8Array.subarray(this.localVideoPtr+4+(qe+4+8+2)*e+4+8+2,this.localVideoPtr+4+(qe+4+8+2)*e+4+8+2+t);this.Update_SelfVideo_Texture(r,i,u,this.Get_Logical_SSrc(this.localvideossrc),c,this.croppingParams,d),Atomics.store(this.encodedVideoSharedArrayBufferUint8Array,this.localVideoPtr,(e+1)%5)}}},wt.prototype.Update_LocalVideo=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=this.localvideossrc;if(this.renderMode){let n=0,a=0,s=!1,o=this.FindVideoRenderList(i),l=r&&(1==t||3==t);for(;a<o.length;a++){s=!0;let i=e;this.croppingParams.top=i.visibleRect?0:i.cropTop,this.croppingParams.left=i.visibleRect?0:i.cropLeft,this.croppingParams.height=i.visibleRect?l?i.visibleRect.width:i.visibleRect.height:i.cropHeight,this.croppingParams.width=i.visibleRect?l?i.visibleRect.height:i.visibleRect.width:i.cropWidth,this.coordinate.x=o[a].x,this.coordinate.y=o[a].y,this.coordinate.width=o[a].width,this.coordinate.height=o[a].height,this.Update_Cropping_Params(),o[a].display.setVideoMode(n);const{display:c,width:d,height:u}=o[a];0!=d&&0!=u&&(this.Should_Update_Watermark(c,d,u,d,u)&&this.Update_Display_Watermark(c,d,u,d,u),-1!==[Ve,Be].indexOf(n)&&(o[a].display.updateRemoteVideoTexturesImageBitmap(this.croppingParams.width,this.croppingParams.height,i,this.croppingParams,r?0:t),o[a].enableMultiDecodeVideoWithoutSAB?o[a].firstFrame=!0:o[a].display.drawSelfVideo(this.coordinate,!1,this.ismirror)))}s||this.renderManager.destroyUnusedVideoFrame(e)}else this.Update_RemoteVideo_Texture(e,!0,i,t,null,r)},wt.prototype.Set_Capture_Video_Flag=function(e){this.startCaptureVideo=e},wt.prototype.Get_Capture_Video_Flag=function(){return this.startCaptureVideo},wt.prototype.FindVideoRender=function(e){if(!e)return null;for(let t=0;t<this.videoRenderArray.length;t++)if(this.videoRenderArray[t].ssrc&&this.videoRenderArray[t].ssrc>>10==e>>10)return this.videoRenderArray[t];return null},wt.prototype.FindVideoRenderList=function(e){let t=this.isActiveSeakerSsrc(e),r=this.FindVideoRender(1),i=[e>>10];t&&r&&i.push(0);let n=[];for(let e=0;e<this.videoRenderArray.length;e++)this.videoRenderArray[e].ssrc&&i.includes(this.videoRenderArray[e].ssrc>>10)&&n.push(this.videoRenderArray[e]);return n},wt.prototype.FindVideoRenderListFromMap=function(e){let t=this.isActiveSeakerSsrc(e),r=[...this.ssrcDisplayMap.get(this.Get_Logical_SSrc(e))||[]];if(t){let e=this.ssrcDisplayMap.get(this.Get_Logical_SSrc(1))||[];r.push(...e)}return r},wt.prototype.JsMediaSDK_VideoRender_interval=function(){this.startCaptureVideo&&this.Draw_LocalVideo();let e=this.FindVideoRender(1),t=this.FindVideoRender(this.activeSpeakssrc);if(0!=this.videoRenderArray.length){for(let i=0;i<this.videoRenderArray.length;i++){const n=this.videoRenderArray[i];if(this.isLSSPlayer&&this.pauseSet.has(n.ssrc+" "+n.zone))return;const{display:a,canvas:s,enableMultiDecodeVideoWithoutSAB:o,ssrc:l,isMyself:c}=n;var r=null;if(n==e&&t)continue;let d=l;n!=e||t||(d=this.activeSpeakssrc);let u=[n];if(n==t&&e&&u.push(e),this.isActiveSsrcVideo(d)){let e=Date.now();if(this.jsMediaEngine){let e=this.jsMediaEngine.Get_Video_SSRC_Latest_Time();this.timestamp=e.currentSSRCTime,this.audioPlayTime=e.audioPlayTime}this.calPacingTime(e),e-this.timestart<this.pacingTime&&e-this.timestart>0||(r=this.Get_Decoded_Video_Frame(this.Get_Logical_SSrc(d)),this.timestart=e)}else r=this.Get_Decoded_Video_Frame(this.Get_Logical_SSrc(d));if(r){let e;this.isActiveSsrcVideo(d)&&(this.videoTimestamp=r.ntptime),e=r.yuvdata instanceof pe?r.yuvdata.yuvdata:r.yuvdata,this.croppingParams.top=r.r_y,this.croppingParams.left=r.r_x,this.croppingParams.height=r.r_h,this.croppingParams.width=r.r_w;const t=r.width>r.height&&(1===r.rotation||3===r.rotation)||r.width<r.height&&1!==r.rotation&&3!==r.rotation,i=t?r.height:r.width,n=t?r.width:r.height,{width:a,height:c}=s;if(this.currentVideoHeight==this.croppingParams.height&&this.currentVideoWidth==this.croppingParams.width||(this.Notify_APPUI?this.Notify_APPUI(3,{width:this.croppingParams.width,height:this.croppingParams.height}):postMessage({status:50,width:this.croppingParams.width,height:this.croppingParams.height}),this.currentVideoHeight=this.croppingParams.height,this.currentVideoWidth=this.croppingParams.width),e.length==r.width*r.height*3/2&&r.r_x>=0&&r.r_y>=0&&r.r_x+r.r_w<=r.width&&r.r_y+r.r_h<=r.height){8400==this.vMonitorCount&&(this.jsMediaEngine?this.jsMediaEngine.Send_Render_Monitor_Log("VDGLM"):postMessage({status:51,data:"VDGLW"}),this.vMonitorCount=0),this.vMonitorCount++;let t=this;u.forEach((s=>{s.display&&(t.Should_Update_Watermark(s.display,i,n,a,c)&&t.Update_Display_Watermark(s.display,i,n,a,c),o?s.display&&(s.display.setVideoMode(We),this.isLSSPlayer&&this.ssrcCurrentRenderingMap.set(l,r),s.display.updateRemoteVideoTextures(r.width,r.height,t.croppingParams,e,r.rotation,r.yuv_limited,s),s.firstFrame=!0):(s.display.setVideoMode(We),this.isLSSPlayer&&this.ssrcCurrentRenderingMap.set(l,r),s.display.drawNextOutputPictureFrame(r.width,r.height,t.croppingParams,e,r.rotation,r.yuv_limited,s)))}))}else this.Log_Error("Invalid YUV data: ".concat(r.r_x," ").concat(r.r_y," ").concat(r.r_w," ").concat(r.r_h," ").concat(r.width," ").concat(r.height));r.yuvdata instanceof pe&&r.yuvdata.recycle()}o&&u.forEach((e=>{if(o&&e.firstFrame){const{x:t,y:r,width:i,height:n}=e,a={x:t,y:r,width:i,height:n};if(c)e.display.drawSelfVideo(a);else{if(this.isLSSPlayer){this.firstFrameMap.get(e.ssrc)||(this.firstFrameMap.set(e.ssrc,!0),this.Notify_APPUI?this.Notify_APPUI(1190,{ssrc:e.ssrc,params:e.display.croppingParams}):postMessage({status:"FIRST_FRAME",ssrc:e.ssrc,params:e.display.croppingParams}));const t=this.ssrcCurrentRenderingMap.get(e.ssrc);e.display.drawRemoteVideo(a),t&&this.zoneLastRenderedMap.set(e.ssrc+" "+e.zone,t)}e.display.drawRemoteVideo(a)}}}))}this.renderManager.renderFor(1)}},wt.prototype.Get_Decoded_Video_Frame=function(e){if(this.videoQueue){var t=this.videoQueue.GetQueue(e);return t?t.dequeue():null}},wt.prototype.Set_SSRC_Latest_Time_Stamp=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;this.timestamp!==e&&"number"==typeof e&&e&&(this.timestamp=e,this.audioPlaySsrc=t,this.audioPlayTime=Date.now())},wt.prototype.Get_Decoded_Video_Buffer_Length=function(e){return this.videoQueue?this.videoQueue.GetQueueLength(e):0},wt.prototype.Get_SSRC_VIDEO_FPS=function(e){if(e>>=10,this.videoQueue&&this.videoQueue.ssrcInfo){var t=this.videoQueue.ssrcInfo.GetSSRCFpsInfo(e);if(t)return Math.round(t)}return 0},wt.prototype.Change_Current_SSRC=function(e){this.currentactive=e,this.ClearQueue()},wt.prototype.Set_Render_Array_IntervalMode=function(e,t){if(this.videoRenderArray=e,this.isLSSPlayer&&this.ssrcDisplayMap.clear(),this.renderMode&&this.videoRenderArray.length>0)for(let e=0;e<this.videoRenderArray.length;e++){const n=this.videoRenderArray[e];var r;if(t){if(!n.display){if(n.enableMultiDecodeVideoWithoutSAB=t,n.display=this.Get_Display(n.canvas,n.canvas.id),n.display&&n.display.setFillMode(n.fillMode,n.fillModeForResolution),this.isLSSPlayer){let e=this.ssrcDisplayMap.get(this.Get_Logical_SSrc(n.ssrc));e||(e=[]),e.push(n),this.ssrcDisplayMap.set(this.Get_Logical_SSrc(n.ssrc),e)}var i;n.borderRadius&&(null===(i=n.display)||void 0===i||i.setRoundedCornerRadius(n.borderRadius))}}else this.renderManager.getRendererProvider().isWebGPURendererType()?n.display=this.Get_Display(n.canvas,n.rendercanvasID):n.display=this._Create_WebGL_Canvas({videoRenderArrayIndex:e,canvas:n.canvas,canvasId:n.rendercanvasID}),n.borderRadius&&(null===(r=n.display)||void 0===r||r.setRoundedCornerRadius(n.borderRadius)),this.webGLContextLostProtect(n.canvas,void 0,n.rendercanvasID)}},wt.prototype._Create_WebGL_Canvas=function(e){let{videoRenderArrayIndex:t,canvas:r,canvasId:i}=e;const n={forceNoGL:void 0,contextOptions:{webglcontextlostCallback:this.webglcontextlostCallback.bind(this),webglcontextrestoredCallback:this.webglcontextrestoredCallback.bind(this),params:{videoRenderArrayIndex:t,canvas:r,canvasId:i}},webGLResources:void 0,initMask:!1};return this.renderManager.createWebGLVideoRenderDisplay(r,i,0,n)},wt.prototype.webglcontextlostCallback=function(e,t){let{canvas:r,canvasId:i}=t;e.preventDefault()},wt.prototype.webglcontextrestoredCallback=function(e,t){var r,i;let{videoRenderArrayIndex:n,canvas:a,canvasId:s}=t;var o;(!this.videoRenderArray||n>=(null===(r=this.videoRenderArray)||void 0===r?void 0:r.length))&&this.Log_Error("videoRenderArray:".concat(this.videoRenderArray,", length:").concat(null===(o=this.videoRenderArray)||void 0===o?void 0:o.length)),this.renderMode&&n<(null===(i=this.videoRenderArray)||void 0===i?void 0:i.length)&&(this.videoRenderArray[n].display=this._Create_WebGL_Canvas({videoRenderArrayIndex:n,canvas:a,canvasId:s}),this.Set_Render_Array(this.videoRenderArray))},wt.prototype.ClearQueue=function(){try{let e=this.videoQueue.ssrcQueueMap;for(let[t,r]of e)for(;!r.isEmpty();){let e=r.dequeue();e.yuvdata&&e.yuvdata instanceof pe&&e.yuvdata.recycle()}}catch(e){this.Log_Error("Exception during VideoRender.ClearQueue",e)}this.videoQueue&&this.videoQueue.ClearQueue(),this.currentVideoHeight=0,this.currentVideoWidth=0},wt.prototype.Set_WaterMark_Info=function(e){let{waterMarkCanvas:t,isCreateVideoWaterMark:r,videoWaterMarkName:i,watermarkOpacity:n,watermarkRepeated:a,watermarkPosition:s}=e;this.waterMarkCanvas=t||this.videorendercanvas,this.isCreateVideoWaterMark=r,this.videoWaterMarkName=i,void 0!==a&&(this.isWaterMarkRepeatedEnable=!!a),void 0!==n&&(this.waterMarkOpacity=n),void 0!==s&&(this.watermarkPosition=s)},wt.prototype.Set_WaterMark_Flag=function(e){if(this.videoRenderArray.length>0)for(let t=0;t<this.videoRenderArray.length;t++){const{display:r}=this.videoRenderArray[t];r.setWatermarkFlag(e?1:0)}},wt.prototype.Should_Watermark_Repeated=function(e,t){return this.isWaterMarkRepeatedEnable&&e>306&&t>202};const St=function(e,t){if(e<640&&e){const r=640/e;e=640,t=Math.round(t*r)}return{width:e,height:t}};wt.prototype.Update_Display_Watermark=function(e,t,r,i,n){const a=this.Should_Watermark_Repeated(i,n);this.waterMarkCanvas||this.videorendercanvas||(this.videorendercanvas=this.isSupportOffscreenCanvas?new OffscreenCanvas(640,360):null);const s=i<512||n<288?16:this.watermarkPosition,o=this.waterMarkCanvas||this.videorendercanvas;if("function"==typeof OffscreenCanvas&&o instanceof OffscreenCanvas&&OffscreenCanvasRenderingContext2D&&!OffscreenCanvasRenderingContext2D.prototype.measureText)return;const l=St(t,r);t=l.width,r=l.height;const c=a?this.WaterMarkRGBA.Get_Repeated_WaterMarkRGBA({canvas:o,name:this.videoWaterMarkName,width:t,height:r,opacity:this.waterMarkOpacity,position:s}):this.WaterMarkRGBA.Get_WaterMarkRGBA({canvas:o,name:this.videoWaterMarkName,width:t,height:r,opacity:this.waterMarkOpacity,position:s});e.updateWatermark(t,r,c)},wt.prototype.Should_Update_Watermark=function(e,t,r,i,n){if(!this.isCreateVideoWaterMark)return!1;let a=!1;const s=St(t,r);s.width===e.getWatermarkWidth()&&s.height===e.getWatermarkHeight()||(a=!0);const o=this.Should_Watermark_Repeated(i,n);e.isSetWatermark()||(a=!0),o!==e.isWatermarkRepeated()&&(a=!0,e.setWatermarkRepeated(o)),this.waterMarkOpacity&&this.waterMarkOpacity!==e.getWatermarkOpacity()&&(a=!0,e.setWatermarkOpacity(this.waterMarkOpacity),this.waterMarkOpacity=e.getWatermarkOpacity());const l=t<512||r<288?16:this.watermarkPosition;return l!==e.getWatermarkPosition()&&(a=!0,e.setWatermarkPosition(l),this.watermarkPosition=e.getWatermarkPosition()),a},wt.prototype.calCulateActiveFps=function(e){this.activeFps&&e>=this.lfTimeStamp?this.activeFps=500/(e-this.lfTimeStamp)+this.activeFps/2:this.lfTimeStamp&&(this.activeFps=1e3/(e-this.lfTimeStamp))},wt.prototype.Put_Video_Data_Queue=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:30;if(this.videoQueue){var r=this.videoQueue.GetQueue(e.ssrc);if(r||(r=this.videoQueue.AddQueue(e.ssrc)),r.enqueue(e),(this.Get_Logical_SSrc(this.currentactive)==this.Get_Logical_SSrc(e.ssrc)||this.Get_Logical_SSrc(this.audioPlaySsrc)==this.Get_Logical_SSrc(e.ssrc))&&(this.lfTimeStamp&&this.calCulateActiveFps(e.ntptime),this.lfTimeStamp=e.ntptime),this.lastActiveSSRC!=e.ssrc&&(this.lfTimeStamp=0,this.activeFps=0),this.lastActiveSSRC=e.ssrc,this.videoQueue&&this.videoQueue.ssrcInfo){var i=e.ssrc>>10;this.videoQueue.ssrcInfo.UpdateSSRCInfo(i,e.ntptime)}for(var n=this.videoQueue.GetQueueLength(e.ssrc)-t;n>=0;){let t=this.Get_Decoded_Video_Frame(e.ssrc);t.yuvdata instanceof pe&&t.yuvdata.recycle(),n--}}else e.yuvdata&&e.yuvdata instanceof pe&&e.yuvdata.recycle()},wt.prototype.Clear_OffScreenCanvas=function(e){e.contextLostHandler&&(e.removeEventListener("webglcontextlost",e.contextLostHandler),e.contextLostHandler=null),e.contextRestoredHandler&&(e.removeEventListener("webglcontextrestored",e.contextRestoredHandler),e.contextRestoredHandler=null),e.width=1,e.height=1},wt.prototype.Zoom_Render=function(e){},wt.prototype.Decode_Ssrc=function(e){return this.ssrcDisplayMap.has(this.Get_Logical_SSrc(e))||this.Get_Logical_SSrc(e)==this.Get_Logical_SSrc(this.selfvideossrc)};const Et="undefined"==typeof window;function Mt(e){let t=Date.now(),r=Rt;if(t-Tt<30&&t-Tt>0)r.Start_Request_Animation_Frame(e);else if(Tt=t,r.rendingFlag){try{r.startCaptureVideo&&r.localVideoPtr&&r.Draw_LocalVideo(),r.ssrcDisplayMap.forEach((function(e,i){if(i!=r.Get_Logical_SSrc(1)||!r.ssrcDisplayMap.has(r.Get_Logical_SSrc(r.activeSpeakssrc)))if(i==r.Get_Logical_SSrc(1)&&(i=r.activeSpeakssrc),r.isActiveSsrcVideo(i))if(r.calPacingTime(t),t-r.timestart<r.pacingTime);else{r.timestart=t;let e=r.Get_Decoded_Video_Frame(r.Get_Logical_SSrc(i));e&&(r.Update_RemoteVideo_Texture(e),r.videoTimestamp=e.ntptime)}else{let e=r.Get_Decoded_Video_Frame(r.Get_Logical_SSrc(i));e&&r.Update_RemoteVideo_Texture(e)}})),r._render()}catch(e){r.Log_Error("Exception while rendering video",e)}r.Start_Request_Animation_Frame(e)}else r.rAFID&&r.Stop_Request_Animation_Frame()}var Rt;wt.prototype.Check_Request_Animation=function(){Et&&this.rendingFlag&&this.prevRequestAnimationTimestap&&performance.now()-this.prevRequestAnimationTimestap>2e3&&!this.rAFIDBack&&(postMessage({status:o,data:"WCL_M,RCIF"}),this.rAFID&&(cancelAnimationFrame(this.rAFID),this.rAFID=0),this.rAFIDBack=setInterval(Mt.bind(null,!0),30))},wt.prototype.Start_Request_Animation_Frame=function(e,t){if(!e&&this.rAFIDBack&&this.Stop_Request_Animation_Frame_Backup(),!this.rAFIDBack)return t||(this.retryRequestAnimationStep=2),this.prevRequestAnimationTimestap=performance.now(),this.rAFID=requestAnimationFrame(Mt),this.rAFID},wt.prototype.Stop_Request_Animation_Frame_Backup=function(){this.rAFIDBack&&(clearInterval(this.rAFIDBack),this.rAFIDBack=null)},wt.prototype.Stop_Request_Animation_Frame=function(){this.rAFID&&cancelAnimationFrame(this.rAFID),this.rAFID=0,this.prevRequestAnimationTimestap=0,this.retryRequestAnimationStep=2,this.Stop_Request_Animation_Frame_Backup()},wt.prototype.Add_Pause=function(e){this.pauseSet.add(e.ssrc+" "+e.zone)},wt.prototype.Remove_Pause=function(e){const t=e.ssrc+" "+e.zone;this.pauseSet.has(t)&&this.pauseSet.delete(t)},wt.prototype.Zoom_Render_Paused=function(e){if(this.pauseSet.has(e.ssrc+" "+e.zone)&&this.zoneLastRenderedMap.get(e.ssrc+" "+e.zone)){let t=this.ssrcDisplayMap.get(this.Get_Logical_SSrc(e.ssrc));t[0].x=e.x,t[0].y=e.y,t[0].width=e.width,t[0].height=e.height}this.Draw_Last_Frame()},wt.prototype.Draw_Last_Frame=function(){for(const e of this.pauseSet.values()){const[t]=e.split(" "),r=this.zoneLastRenderedMap.get(e);if(r){let e=this.ssrcDisplayMap.get(this.Get_Logical_SSrc(t));const i=e&&e[0]&&e[0].display||null;if(i){const t=e[0];i.setVideoMode(We),this.Should_Update_Watermark(i,t.width,t.height,t.width,t.height)&&this.Update_Display_Watermark(i,t.width,t.height,t.width,t.height),i.updateRemoteVideoTextures(r.width,r.height,{top:r.r_y,left:r.r_x,height:r.r_h,width:r.r_w},r.yuvdata,r.rotation,r.yuv_limited,t),i.drawRemoteVideo({x:e[0].x,y:e[0].y,width:e[0].width,height:e[0].height})}}}},wt.prototype.Log_Error=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;this.globalTracingLogger?this.globalTracingLogger.error(e,t):ie(e,t)},wt.prototype._render=function(){let e=this;e.ssrcDisplayMap.forEach((function(t,r){const i=e.isSelfVideo(r);t.forEach((t=>{var r;let n=t.display;if(n&&(null!==(r=n.isAvaiable)&&void 0!==r&&r.call(n)||setTimeout((()=>{var e;null===(e=n.restoreContext)||void 0===e||e.call(n)}),5),t.haddata&&n.getVideoMode()!=Ue))if(e.coordinate.x=t.x,e.coordinate.y=t.y,e.coordinate.width=t.width,e.coordinate.height=t.height,i&&-1!==[Ve,Be].indexOf(n.getVideoMode()))n.drawSelfVideo(e.coordinate,!1,e.ismirror);else if(i)n.drawRemoteVideo(e.coordinate,e.ismirror);else{if(e.isLSSPlayer){e.firstFrameMap.get(t.ssrc)||(e.firstFrameMap.set(t.ssrc,!0),e.Notify_APPUI?e.Notify_APPUI(1190,{ssrc:t.ssrc,params:t.display.croppingParams}):postMessage({status:"FIRST_FRAME",ssrc:t.ssrc,params:t.display.croppingParams}));const r=e.ssrcCurrentRenderingMap.get(t.ssrc);r&&e.zoneLastRenderedMap.set(t.ssrc+" "+t.zone,r)}n.drawRemoteVideo(e.coordinate)}}))})),e.renderManager.renderFor(1)},wt.prototype._singleRender=function(){let e=this;this.videoRenderArray.forEach((t=>{const{x:r,y:i,width:n,ssrc:a,height:s,enableMultiDecodeVideoWithoutSAB:o}=t,l=t.display,c=e.isSelfVideo(a),d={x:r,y:i,width:n,height:s};o?c?l.drawSelfVideo(d):l.drawRemoteVideo(d):l.drawNextOutputPictureFrame(l.getTextureWidth(),l.getTextureHeight(),l.getCroppingParams(),null,l.getRotation(),void 0,d,!1)}))},wt.prototype.calPacingTime=function(e){if(this.pacingTime=30,this.activeFps>=1&&this.activeFps<=40&&(this.pacingTime=1e3/this.activeFps),this.timestamp&&this.videoTimestamp){let t=this.timestamp+e-this.audioPlayTime,r=this.videoTimestamp+this.pacingTime-t,i=this.currentactive?this.currentactive:this.audioPlaySsrc,n=this.videoQueue.GetQueueLength(this.Get_Logical_SSrc(i));r>65&&r<1e4&&n>=1&&(this.pacingTime=1.5*this.pacingTime),r<-65&&(this.pacingTime=1*this.pacingTime/2)}else this.timestamp||(this.pacingTime>150?this.pacingTime=1*this.pacingTime/2:this.pacingTime=this.pacingTime-10)},wt.prototype.getRenderManager=function(){return this.renderManager},wt.prototype.cleanup=function(e,t){let r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];this.renderManager.cleanup(e,t,r)},wt.prototype.setActiveSpeakerSsrc=function(e){this.activeSpeakssrc=e},wt.prototype.getActiveSpeakerSsrc=function(e){return this.activeSpeakssrc},wt.prototype.isActiveSeakerSsrc=function(e){return this.activeSpeakssrc&&this.activeSpeakssrc>>10==e>>10},wt.prototype.isActiveSsrcVideo=function(e){let t=e>>10;return t==this.currentactive>>10||t==this.audioPlaySsrc>>10},wt.prototype.clearDraw=function(e){e&&(this.clearColor[0]=255*e.R,this.clearColor[1]=255*e.G,this.clearColor[2]=255*e.B,this.clearColor[3]=255*e.A)},wt.prototype.isSelfVideo=function(e){return!!this.selfvideossrc&&(this.Get_Logical_SSrc(e)==this.Get_Logical_SSrc(this.selfvideossrc)||this.isActiveSeakerSsrc(this.selfvideossrc)&&!(e>>10))},wt.prototype.reDraw=function(){this.renderMode?this._singleRender():this._render()},wt.prototype.getUserIdVideo=function(e){let t=null,r=1==e||this.isActiveSeakerSsrc(e);for(let i=0;i<this.videoRenderArray.length;i++){const n=this.videoRenderArray[i];if(n.ssrc>>10==e>>10||r&&1==n.ssrc){const{width:e,height:r}=n;(!t||e*r>t.width*t.height)&&(t=n)}}if(!t||!t.display)return null;const i=t.canvas,n=t.rendercanvasID;let a=t.display.getTextureWidth(),s=t.display.getTextureHeight(),o=t.display.getRotation(),l=t.display.getViewPosition();if(1==o||3==o){let e=a;a=s,s=e}const{x:c,y:d,width:u,height:h}=t;let _=u,f=h,p=Math.floor(u*l[1]),m=Math.floor(h*l[0]);_=u-2*p,f=h-2*m;let g=i.height-h-d+m,v=c+p;return s=Math.floor(Math.min(f,s)),a=Math.floor(s*_/f),{canvasId:n,canvas:i,options:{x:v,y:g,width:_,height:f,displayWidth:a,displayHeight:s}}};var Tt=0;const xt=wt,Ct={VIDEO_ENCODE:"0",VIDEO_DECODE:"1",AUDIO_ENCODE:"2",AUDIO_DECODE:"3",SHARING_ENCODE:"4",SHARING_DECODE:"5",WORKER_SERVICE:"6",COMMON:"7",NET:"net",MESH:"mesh"};(()=>{const e={};for(const t in Ct)e[Ct[t]]="WCL_"+t})(),Ct.AUDIO_ENCODE,Ct.AUDIO_DECODE,Ct.VIDEO_ENCODE,Ct.VIDEO_DECODE,Ct.SHARING_ENCODE,Ct.SHARING_DECODE,Ct.NET,Ct.MESH;class At{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,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",i=arguments.length>3&&void 0!==arguments[3]&&arguments[3],n=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:e.byteLength,s=arguments.length>6?arguments[6]:void 0;this.offset=n,this._BYTES_PER_ELEMENT=t,this.capacity=(a-8)/t,this.usableCapacity=this.capacity-1,this.buf=e,this.write_ptr=new Uint32Array(this.buf,n,1),this.read_ptr=new Uint32Array(this.buf,n+4,1),this.storageUint8sByteOffset=n+8,this.storageUint8s=new Uint8Array(this.buf,this.storageUint8sByteOffset,a-8),this.byteLength=a,this.label=r,this.usingOneElementBuffer=i,s&&(this.wasmMemory=s),i&&(this.oneElementBuffer=new ArrayBuffer(t)),this.repushhander=0,this.repushlogcount=0,this.monitorpace=0}checkBuffer(){this.wasmMemory&&this.wasmMemory.buffer!=this.buf&&(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],r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;for(this.dataBuffer||(this.dataBuffer=new st);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&&($.warn("Cached data in SAB reached critical value, will be cleared"),this.dataBuffer.clear(),r&&r("vqslclear")),i>0&&r){let e=performance.now();(!this.monitorpace||e-this.monitorpace>2e4)&&(this.monitorpace=e,r&&r("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 r=0;e.forEach((e=>{this.storageUint8s.set(e,t*this._BYTES_PER_ELEMENT+8+4+r),r+=e.byteLength})),new Uint32Array(this.buf,this.offset+t*this._BYTES_PER_ELEMENT+8,1)[0]=r;let i=(t+1)%this.capacity;return Atomics.store(this.write_ptr,0,i),!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 r=(t+1)%this.capacity;return Atomics.store(this.write_ptr,0,r),!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 r,i,n,a=new Uint32Array(this.buf,this.offset+t*this._BYTES_PER_ELEMENT+8,1);if(e){r=this.oneElementBuffer?new Uint8Array(this.oneElementBuffer,0,a[0]):new Uint8Array(a[0]);let e=new Uint8Array(this.storageUint8s.buffer,t*this._BYTES_PER_ELEMENT+8+4+this.storageUint8sByteOffset,r.byteLength);r.set(e,0)}else r=this.storageUint8s.subarray(t*this._BYTES_PER_ELEMENT+8+4,t*this._BYTES_PER_ELEMENT+8+4+a[0]),i=t*this._BYTES_PER_ELEMENT+8+4+this.storageUint8sByteOffset,n=t*this._BYTES_PER_ELEMENT+8+4+a[0]+this.storageUint8sByteOffset;return e&&Atomics.store(this.read_ptr,0,(t+1)%this.capacity),e?r:{bCopyData:e,uint8s:r,begin:i,end:n}}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 Ft{constructor(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:50,n=arguments.length>4&&void 0!==arguments[4]?arguments[4]:80;if(!(e instanceof At))throw new Error("RingBuffer required");this.rb=e,this.dataCallback=t,this.interval=null,this.requestID=null,this.timeout_call=r,this.tick_lasted_time=0,this.timeoutMS=i,this.maxCount=n}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))}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 kt{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),r={};this.keysList.forEach(((t,i)=>{r[t]=e[i]})),r[this.timeStampKey]=Number(t.getBigUint64(0,!0));let i,n=Number(t.getBigUint64(8,!0)),a=new Uint8Array(this.objUint8s.buffer,this.begin+40+8+8,n);return this.bCopyData,i=a,r.data=i,r}obj2buffer(){let e=new Uint8Array(56),t=this.keysList,r=new Uint32Array(e.buffer,0,9),i=new DataView(e.buffer,40,16);return t.forEach(((e,t)=>{r[t]=this.obj[e]})),i.setBigUint64(0,BigInt(this.obj[this.timeStampKey]),!0),i.setBigUint64(8,BigInt(this.yuvUint8s.byteLength),!0),[e,this.yuvUint8s]}}function Pt(e){return e[0]<<24|e[1]<<16|e[2]<<8|e[3]}const Lt=function(e){return 21==e[4]&&0==e[13]},Dt=function(e){return 104==e[0]||16!=e[4]&&1!=e[5]?Pt(e.slice(19,23)):Pt(e.slice(15,19))},It=function(e){return 103==e[0]};class Ot{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 r=this;this._timeoutid=setTimeout((()=>{r._report(),r._timeoutid=0}),this.interval_report_time)}}var Ut=function(e){let t=e||{};this._report_interval=t.interval||3e4,this._customer_callback=t.report_call,this._group_interval=t.group_interval||1e3,this._tag=t.tag||"WCL_M,V",this.last_capture_time=0,this._init_report_interval=t._report_interval<1e4?t._report_interval:1e4,this.threshold=200,this._enabled=!1,this.capture_fps=0,this.capture_fps_history=[],this.capture_total_fps=0,this.capture_timeout_report=new Ot({interval:this._report_interval,tag:this._tag+"CAPTUREDEL",reportcallback:this._capture_timeout_report.bind(this)}),this.close_frames=0,this.close_frames_history=[],this.close_total_frames=0,this.capture_ticket_count=0,this.ref_counts=0,this.unref_counts=0,this._interval_id=0,this._timeout_id=0,this._last_update_time=0};Ut.prototype._capture_timeout_report=function(e,t,r,i){if(this._customer_callback){let n="".concat(t,",").concat(r,",").concat(i);this._customer_callback(e,n)}},Ut.prototype._report=function(){if(!this._customer_callback)return;let e=(new Date).getTime(),t="".concat(this.capture_fps_history.length,"-").concat(this.capture_fps_history.join("|")),r="".concat(this.close_frames_history.length,"-").concat(this.close_frames_history.join("|")),i="".concat(e,"-").concat(this.capture_ticket_count,"-").concat(this.capture_total_fps,"-").concat(this.ref_counts,"-").concat(t),n="".concat(e,"-").concat(this.close_total_frames,"-").concat(this.unref_counts,"-").concat(r);this._customer_callback(this._tag+"CAPTURE",i),this._customer_callback(this._tag+"FCLOSE",n)},Ut.prototype._timeout_report=function(){this._timeout_id=0,this._report()},Ut.prototype._group=function(){this.capture_fps_history.push(this.capture_fps),this.close_frames_history.push(this.close_frames),this.capture_fps=0,this.close_frames=0;let e=performance.now();e>=this._last_update_time+this._init_report_interval&&(this._report(),this.capture_fps_history=[],this.close_frames_history=[],this._last_update_time=e,this._init_report_interval<this._report_interval&&(this._init_report_interval+=5e3,this._init_report_interval>this._report_interval&&(this._init_report_interval=this._report_interval)))},Ut.prototype.closeSample=function(){this.close_frames++,this.close_total_frames++},Ut.prototype.setCloseTotalFrames=function(e){this.close_total_frames=e},Ut.prototype.captureTicket=function(){this._enabled&&this.capture_ticket_count++},Ut.prototype.captureSample=function(){if(!this._enabled)return;this.capture_fps++,this.capture_total_fps++;let e=performance.now();if(this.last_capture_time){let t=e-this.last_capture_time;t>this.threshold&&this.capture_timeout_report.timeoutReport(t,e)}this.last_capture_time=e},Ut.prototype.ref=function(){this.ref_counts++},Ut.prototype.unref=function(){this.unref_counts++},Ut.prototype.start=function(){this._enabled||(0!=this._last_update_time&&(clearTimeout(this._last_update_time),this._last_update_time=0,this._report()),this.capture_fps=0,this.capture_fps_history=[],this.capture_total_fps=0,this.close_frames=0,this.close_frames_history=[],this.close_total_frames=0,this.capture_ticket_count=0,this._last_update_time=performance.now(),this._interval_id=setInterval(this._group.bind(this),this._group_interval),this._enabled=!0)},Ut.prototype.stop=function(){this._enabled&&(this._enabled=!1,this._interval_id&&clearInterval(this._interval_id),this._interval_id=0,(this.close_frames>0||this.capture_fps>0||this.capture_fps_history.length>0||this.close_frames_history>0)&&(this._timeout_id=setTimeout(this._timeout_report.bind(this),3e3)))};const Vt=e=>btoa(String.fromCharCode(...new Uint8Array(e)));class Wt{constructor(e){tt(this,"process",(async()=>{if(this.processList.length){const e=this.processList.splice(0,30),t=await this.encryptData(this.mergeBuffer(e));this.writeLog(Vt(t)),this.writeLog(this.EOL)}requestAnimationFrame(this.process)})),this.textEncoder=new TextEncoder,this.textDecoder=new TextDecoder,this.EOL=this.textEncoder.encode("\n"),this.processList=[],this.writeLog=e,this.key=null,this.initEncryptPromise=this.initEncrypt()}addLogData(e,t){if(!e||!t)return;const r=this.textEncoder.encode(e);this.processList.push(r),this.processList.push(t),this.processList.push(this.EOL)}async initEncrypt(){this.key=await crypto.subtle.generateKey({name:"AES-GCM",length:256},!0,["encrypt","decrypt"]),this.iv=crypto.getRandomValues(new Uint8Array(12));const e=new Uint8Array(await crypto.subtle.exportKey("raw",this.key)),t=new Uint8Array([0]);this.writeLog("v"),this.writeLog(this.EOL),this.writeLog(Vt(t.buffer)),this.writeLog(this.EOL);const r=[e,this.iv];this.writeLog("h"),this.writeLog(this.EOL),this.writeLog(Vt(this.mergeBuffer(r).buffer)),this.writeLog(this.EOL),this.startProcess()}mergeBuffer(e){const t=e.reduce(((e,t)=>e+t.length),0),r=new Uint8Array(t);let i=0;for(const t of e)r.set(t,i),i+=t.length;return r}async encryptData(e){return await this.initEncryptPromise,await crypto.subtle.encrypt({name:"AES-GCM",iv:this.iv},this.key,e)}startProcess(){requestAnimationFrame(this.process)}}class Bt{constructor(e){this.port=null,this.cache=[],this.stopCache=!1,e&&(this.logProcesser=new Wt(this.writeLog.bind(this)))}readyForLog(){}sendLog(e){}writeLog(e){this.readyForLog()?(this.stopCache||(this.cache.forEach((e=>this.sendLog(e))),this.clearCache()),this.sendLog(e)):this.stopCache||this.cache.push(e)}clearCache(){this.stopCache=!0,this.cache=[]}getTime(){const e=new Date;return e.getHours()+":"+e.getMinutes()+":"+e.getSeconds()+":"+e.getMilliseconds()}getLogData(e,t,r){if(t){var i=new Uint8Array(r?t+1:t),n=se().subarray(e+0,e+t);return i.set(n,0,t),r&&(i[t]=10),i}return e.data}writeWasmLog(e,t){const r=this.getTime(),i=this.getLogData(e,t);this.logProcesser?this.logProcesser.addLogData(r,i):(this.writeLog(r),this.writeLog(i),this.writeLog("\n"))}}class Nt extends Bt{constructor(){super(!0),this.port=null,this.ready=!1}init(){let e=0;const t=r=>{"local_log_port"===r.data.command?this.port||(this.port=r.data.data):"local_log_ready"===r.data.command&&(this.ready=!0,self.removeEventListener("message",t),clearTimeout(e),this.stopCache||(this.cache.forEach((e=>this.sendLog(e))),this.clearCache()))};self.addEventListener("message",t),e=setTimeout((()=>{self.removeEventListener("message",t),this.clearCache()}),6e4)}readyForLog(){return!!this.port&&this.ready}sendLog(e){this.port.postMessage(e)}}let Gt;const jt=()=>Gt,Ht=function(e,t=""){if(e)return;const r=new Error(t);jt().tracing.Log_Error(`Assert: ${t}`,r)},zt=function(e){const t=new Error(e);jt().tracing.Log_Error(`AssertWithFailed: ${e}`,t)};function qt(e,t){const r=Math.pow(10,t);return Math.floor(e*r)/r}function Yt(e,t){const r=Math.pow(10,t);return Math.ceil(e*r)/r}const Xt={NO_CONFIG:0,FALLBACK_TO_TAG_RENDERER_ON_CHROME:1,FALLBACK_TO_TAG_RENDERER_ON_SAFARI:2,FALLBACK_TO_TAG_RENDERER_ON_FIREFOX:4,LOWER_PERFORMANCE_DEVICE:8},Kt={NO_CONFIG:0,TAG_RENDERER_ON_CHROME:1,TAG_RENDERER_ON_SAFARI:2,TAG_RENDERER_ON_FIREFOX:4},Qt=new class{constructor(){tt(this,"_platformDesc",{supportGraphicsAcceleration:!1,supportVideoFrame:!1,supportMediaStreamTrackGenerator:!1,supportTransferableStream:!1,supportDrawWatermark:!1,supportVideoFrameInWorker:!1,supportVideoTrackGeneratorInWorker:!1,supportOffscreenCanvasInWorker:!1,supportImageBitmapRenderingInWorker:!1,supportTransferableTrackAcrossWork:!1,supportsRequestAnimationFrameInWork:!1}),tt(this,"_inferedDesc",{supportVideoTagRenderer:!1}),tt(this,"_analyzing_promise",null),tt(this,"_main_analyzed",!1),tt(this,"_remote_analyzed",!1),tt(this,"_analyzedPromise",void 0),tt(this,"_resolveAnalyzedPromise",void 0),this._analyzedPromise=new Promise(((e,t)=>{this._resolveAnalyzedPromise=e}))}init(e){this._platformDesc=e.platform,this._inferedDesc=e.infered,this._main_analyzed=!0,this._remote_analyzed=!0,this._resolveAnalyzedPromise(this._remote_analyzed)}desc(){return{platform:this._platformDesc,infered:this._inferedDesc}}analyzed(){return this._remote_analyzed}analyzedPromise(){return this._analyzedPromise}_analyzeInferredCapabilites(){this._inferedDesc.supportVideoTagRenderer=this._platformDesc.supportVideoFrame&&this._platformDesc.supportVideoFrameInWorker&&(!0===this._platformDesc.supportMediaStreamTrackGenerator&&!0===this._platformDesc.supportTransferableStream||!0===this._platformDesc.supportVideoTrackGeneratorInWorker)}analyze(e){if(this._analyzing_promise)return this._analyzing_promise;const t=e.analyzeMainCapabilites();return Object.assign(this._platformDesc,t),this._main_analyzed=!0,this._analyzing_promise=new Promise(((t,r)=>{e.analyzeRemoteCapabilities().then((e=>{Object.assign(this._platformDesc,e),this._analyzeInferredCapabilites(),this._remote_analyzed=!0,this._resolveAnalyzedPromise(this._remote_analyzed),t(!0)})).catch((e=>{this._resolveAnalyzedPromise(this._remote_analyzed),t(!1)}))})),this._analyzing_promise}supportGraphicsAcceleration(){return Ht(this._main_analyzed),this._platformDesc.supportGraphicsAcceleration}supportTransferableStream(){return Ht(this._main_analyzed),this._platformDesc.supportTransferableStream}supportDrawWatermark(){return Ht(this._main_analyzed),this._platformDesc.supportDrawWatermark}supportVideoTagRenderer(){return!!this._remote_analyzed&&this._inferedDesc.supportVideoTagRenderer}supportMediaStreamTrackGenerator(){return Ht(this._main_analyzed),this._platformDesc.supportMediaStreamTrackGenerator}supportVideoTrackGeneratorInWorker(){return!!this._remote_analyzed&&this._platformDesc.supportVideoTrackGeneratorInWorker}supportTransferableTrackAcrossWork(){return!!this._remote_analyzed&&this._platformDesc.supportTransferableTrackAcrossWork}supportsRequestAnimationFrameInWork(){return!!this._remote_analyzed&&this._platformDesc.supportsRequestAnimationFrameInWork}supportMediaStreamTrackProcessor(){return!!this._remote_analyzed&&this._platformDesc.supportMediaStreamTrackProcessor}};var $t=r(1265),Jt=r.n($t);const Zt=new class{constructor(){tt(this,"_info",void 0),this._info={browser:{brand:"",version:"",isBlink:!1,isWebkit:!1},sysinfo:{osType:"",os:"",osVersion:""},gpuinfo:{vendor:"",renderInfo:"",isAstcSupported:!1,isWebGLContextInvalid:!1},browserVersionInfo:{ie:"",edge:"",firefox:"",opera:"",chrome:"",safari:""},isLowerPerformanceDevice:!1,isSwiftShader:!1,isMacIntelSafari:!1},this._derived={gpuArchitecture:"unknown",normalizedOS:"",normalizedBrowser:""},this._updateDerivedInfo()}init(e){this._info=e,this._updateDerivedInfo()}info(){return this._info}browserInfo(){return this._info.browser}browserVersionInfo(){return this._info.browserVersionInfo}browserName(){var e;return null===(e=this._info.browser.brand)||void 0===e?void 0:e.toLocaleLowerCase()}isChrome(){var e;return"chrome"===(null===(e=this._info.browser.brand)||void 0===e?void 0:e.toLocaleLowerCase())}isSafari(){var e;return"safari"===(null===(e=this._info.browser.brand)||void 0===e?void 0:e.toLocaleLowerCase())}isFirefox(){var e;return"firefox"===(null===(e=this._info.browser.brand)||void 0===e?void 0:e.toLocaleLowerCase())}isEdge(){var e;return"edge"===(null===(e=this._info.browser.brand)||void 0===e?void 0:e.toLocaleLowerCase())}isBlink(){return this._info.browser.isBlink}isWebkit(){return this._info.browser.isWebkit}isLowerPerformanceDevice(){return!!this._info.isLowerPerformanceDevice}_updateDerivedInfo(){this._derived.normalizedOS=this._computeNormalizedOS(),this._derived.normalizedBrowser=this._computeNormalizedBrowser(),this._derived.gpuArchitecture=this._computeGPUArchitecture()}_computeGPUArchitecture(){var e,t;const r=(null===(e=this._info.gpuinfo)||void 0===e?void 0:e.vendor)||"",i=(null===(t=this._info.gpuinfo)||void 0===t?void 0:t.renderInfo)||"",n=r.toLowerCase(),a=i.toLowerCase(),s=e=>n.includes(e)||a.includes(e);if(this.isSafari())return this._info.isMacIntelSafari?"intel":"apple";if(s("intel"))return"intel";if(s("nvidia")||s("geforce"))return"nvidia";if(s("amd")||s("radeon")||s("ati"))return"amd";if(s("apple")||s("m1")||s("m2")||s("m3"))return"apple";if(s("qualcomm")||s("adreno"))return"qualcomm";if(s("mediatek")||s("mtk"))return"mediatek";if(s("mali"))return"mali";if(s("arm"))return"arm";if(n){var o;const e=Jt()(o=n.replace(/[^a-z0-9]+/g," ")).call(o).split(" ")[0];if(e)return e.toLowerCase()}return"unknown"}_computeNormalizedOS(){var e;const t=(null===(e=this._info.sysinfo)||void 0===e||null===(e=e.os)||void 0===e?void 0:e.toLowerCase())||"";return"ios"===t?"ios":t.includes("android")?"android":t.includes("chrome os")||t.includes("chromium os")?"chromeos":t.includes("mac")?"mac":t.includes("win")?"win":t.includes("linux")?"linux":t}_computeNormalizedBrowser(){var e,t;return(null===(e=this._info.browser)||void 0===e||null===(e=e.brand)||void 0===e||null===(t=e.toLocaleLowerCase)||void 0===t?void 0:t.call(e))||""}isOnWhitelist(e){if(!Array.isArray(e)||0===e.length)return!1;const t=this._derived.gpuArchitecture,r=this._derived.normalizedOS,i=this._derived.normalizedBrowser,n=!!this._info.isLowerPerformanceDevice,a=!!this._info.isSwiftShader;return e.some((e=>{var s;if("string"!=typeof e)return!1;const o=Jt()(e).call(e).toLowerCase();if("low-device"===o)return n;if("swift-shader"===o)return a;const[l,c,d]=o.split("/");if(!l||!c)return!1;const u=Jt()(l).call(l),h=Jt()(c).call(c),_=Jt()(s=d||"").call(s);return!(u&&u!==t||h&&!r.includes(h)&&!h.includes(r)||_&&_!==i)}))}},er=new class{constructor(){tt(this,"_desc",{blockConfig:void 0,defaultRendererType:1,isEnableCanvasCtxOptionsOpt:!1,isEnableFallbackToTagRender:!1,isEnableWasmTagRenderer:!1,safariYuvPaddingFixVer:void 0,chromeYuvLeftTopPaddingFixVer:void 0,disableVideoTagOnEdge:void 0,preferredUseSsrcStream:void 0,canUseSsrcStream:void 0,isUseSsrcStream:!1,shouldCropWasmFrameOnPosMismatch:void 0,shouldCropWasmFrameOnSizeMismatchOnly:void 0,avStreamMode:void 0,baseScriptUrl:"",cssPixelScale:1,isVideoHasWaterMark:!1,isSharingHasWaterMark:!1,videoWatermarkInfo:void 0,sharingWatermarkInfo:void 0}),tt(this,"_configDone",!1),tt(this,"_configDonePromise",void 0),tt(this,"_resolveConfigDonePromise",void 0),this._configDonePromise=new Promise(((e,t)=>{this._resolveConfigDonePromise=e}))}_tryResetDerivedConfigIfNeeded(){this._configDone&&(this._desc.canUseSsrcStream=void 0,this._desc.shouldCropWasmFrameOnPosMismatch=void 0,this._desc.shouldCropWasmFrameOnSizeMismatchOnly=void 0)}init(e){this._desc=e,this._configDone=!0}setBlockConfig(e){if(!e)return;this._desc.blockConfig=e;const t=e.safariYuvPaddingFixVer;t&&this.setSafariYuvPaddingFixVer(t);const r=e.chromeYuvLeftTopPaddingFixVer;r&&this.setChromeYuvLeftTopPaddingFixVer(r);const i=e.disableVideoTagOnEdge;"true"===i&&this.setDisableVideoTagOnEdge(i)}configDone(){return this._configDone}configDonePromise(){return this._configDonePromise}markConfigDone(){this._configDone=!0,this._resolveConfigDonePromise(!0)}desc(){return this._desc}preferredUseSsrcStream(){var e;return void 0!==this._desc.preferredUseSsrcStream?!!this._desc.preferredUseSsrcStream:this.canUseSsrcStream()?(this._desc.preferredUseSsrcStream=Zt.isOnWhitelist((null===(e=this._desc.blockConfig)||void 0===e?void 0:e.SsrcStreamPreferredWhitelist)||[]),this._desc.preferredUseSsrcStream):(this._desc.preferredUseSsrcStream=!1,!1)}defaultRendererType(){return this._desc.defaultRendererType}setDefaultRendererType(e){this._desc.defaultRendererType=e,this._tryResetDerivedConfigIfNeeded()}isEnableCanvasCtxOptionsOpt(){return this._desc.isEnableCanvasCtxOptionsOpt}setIsEnableCanvasCtxOptionsOpt(e){this._desc.isEnableCanvasCtxOptionsOpt=e,this._tryResetDerivedConfigIfNeeded()}isEnableWasmTagRenderer(){return this._desc.isEnableWasmTagRenderer}setWasmTagRendererFlags(e){let t=!1;Zt.isBlink()?(t=!!(e&Kt.TAG_RENDERER_ON_CHROME),Zt.isEdge()&&this._desc.disableVideoTagOnEdge&&(t=!1)):Zt.isWebkit()?t=!!(e&Kt.TAG_RENDERER_ON_SAFARI):Zt.isFirefox()&&(t=!!(e&Kt.TAG_RENDERER_ON_FIREFOX)),this._desc.isEnableWasmTagRenderer=t,this._tryResetDerivedConfigIfNeeded()}isEnableFallbackToTagRender(){return this._desc.isEnableFallbackToTagRender}setFallbackToTagRenderFlags(e){let t=!1;Zt.isBlink()?t=!!(e&Xt.FALLBACK_TO_TAG_RENDERER_ON_CHROME):Zt.isWebkit()?t=!!(e&Xt.FALLBACK_TO_TAG_RENDERER_ON_SAFARI):Zt.isFirefox()&&(t=!!(e&Xt.FALLBACK_TO_TAG_RENDERER_ON_FIREFOX)),t||Zt.isLowerPerformanceDevice()&&(t=!!(e&Xt.LOWER_PERFORMANCE_DEVICE)),this._desc.isEnableFallbackToTagRender=t,this._tryResetDerivedConfigIfNeeded()}canUseSsrcStream(){return!!this._configDone&&(void 0!==this._desc.canUseSsrcStream?this._desc.canUseSsrcStream:Qt.supportVideoTagRenderer()?Qt.supportGraphicsAcceleration()&&!Zt.isLowerPerformanceDevice()||!this.isEnableFallbackToTagRender()?this.isEnableWasmTagRenderer()?(this._desc.canUseSsrcStream=!0,this._desc.canUseSsrcStream):(this._desc.canUseSsrcStream=!1,!1):(this._desc.canUseSsrcStream=!0,this._desc.canUseSsrcStream):(this._desc.canUseSsrcStream=!1,!1))}isUseSsrcStream(){return this._desc.isUseSsrcStream}setIsUseSsrcStream(e){this._desc.isUseSsrcStream=e}setSafariYuvPaddingFixVer(e){"[object String]"===Object.prototype.toString.call(e)&&(this._desc.safariYuvPaddingFixVer=e)}setChromeYuvLeftTopPaddingFixVer(e){"[object String]"===Object.prototype.toString.call(e)&&(this._desc.chromeYuvLeftTopPaddingFixVer=e)}setDisableVideoTagOnEdge(e){this._desc.disableVideoTagOnEdge=e}_versionGreaterThan(e,t){const r=t.toString().split("."),i=e.toString().split("."),n=r.length,a=i.length,s=Math.min(n,a);for(let e=0;e<s;e++){const t=parseInt(r[e],10),n=parseInt(i[e],10);if(t!==n)return n>t}return a>=n}_logWasmFrameOnPosMismatch(e){jt().tracing.Log_DT("[vtagq] WasmFrameOnPosMismatch: ".concat(e?"Crop":"No Crop"))}shouldCropWasmFrameOnPosMismatch(){return!!this._configDone&&(void 0!==this._desc.shouldCropWasmFrameOnPosMismatch?this._desc.shouldCropWasmFrameOnPosMismatch:this.isUseSsrcStream()?(this._desc.shouldCropWasmFrameOnPosMismatch=!0,Zt.isChrome()?this._desc.chromeYuvLeftTopPaddingFixVer&&this._versionGreaterThan(Zt.browserVersionInfo().chrome,this._desc.chromeYuvLeftTopPaddingFixVer)&&(this._desc.shouldCropWasmFrameOnPosMismatch=!1):Zt.isSafari()&&this._desc.safariYuvPaddingFixVer&&this._versionGreaterThan(Zt.browserVersionInfo().safari,this._desc.safariYuvPaddingFixVer)&&(this._desc.shouldCropWasmFrameOnPosMismatch=!1),this._logWasmFrameOnPosMismatch(this._desc.shouldCropWasmFrameOnPosMismatch),this._desc.shouldCropWasmFrameOnPosMismatch):(this._desc.shouldCropWasmFrameOnPosMismatch=!1,this._logWasmFrameOnPosMismatch(!1),!1))}_logWasmFrameOnSizeMismatch(e){jt().tracing.Log_DT("[vtagq] WasmFrameOnSizeMismatch: ".concat(e?"Crop":"No Crop"))}shouldCropWasmFrameOnSizeMismatchOnly(){return!!this._configDone&&(void 0!==this._desc.shouldCropWasmFrameOnSizeMismatchOnly?this._desc.shouldCropWasmFrameOnSizeMismatchOnly:this.isUseSsrcStream()&&Zt.isWebkit()?(Zt.isSafari()&&this._desc.safariYuvPaddingFixVer&&this._versionGreaterThan(Zt.browserVersionInfo().safari,this._desc.safariYuvPaddingFixVer)?this._desc.shouldCropWasmFrameOnSizeMismatchOnly=!1:this._desc.shouldCropWasmFrameOnSizeMismatchOnly=!0,this._logWasmFrameOnSizeMismatch(this._desc.shouldCropWasmFrameOnSizeMismatchOnly),this._desc.shouldCropWasmFrameOnSizeMismatchOnly):(this._desc.shouldCropWasmFrameOnSizeMismatchOnly=!1,this._logWasmFrameOnSizeMismatch(!1),!1))}shouldCropWasmFrame(e,t,r){return!!this._configDone&&(e!=r.width||t!=r.height)&&(er.shouldCropWasmFrameOnSizeMismatchOnly()||er.shouldCropWasmFrameOnPosMismatch()&&(0!=r.x||0!=r.y))}getAVStreamMode(){return this._configDone?(void 0!==this._desc.avStreamMode||(Qt.supportTransferableStream()?this._desc.avStreamMode="writable-stream":Qt.supportTransferableTrackAcrossWork()?this._desc.avStreamMode="track":this._desc.avStreamMode="none"),this._desc.avStreamMode):"none"}getBaseScriptUrl(){return this._desc.baseScriptUrl}setBaseScriptUrl(e){this._desc.baseScriptUrl=e}getCssPixelScale(){return this._desc.cssPixelScale}setCssPixelScale(e){this._desc.cssPixelScale=e}isVideoHasWaterMark(){return this._desc.isVideoHasWaterMark}setIsVideoHasWaterMark(e){this._desc.isVideoHasWaterMark=e,this._tryResetDerivedConfigIfNeeded()}isSharingHasWaterMark(){return this._desc.isSharingHasWaterMark}setIsSharingHasWaterMark(e){this._desc.isSharingHasWaterMark=e,this._tryResetDerivedConfigIfNeeded()}getVideoWatermarkInfo(){return this._desc.videoWatermarkInfo}setVideoWatermarkInfo(e){this._desc.videoWatermarkInfo=e}getSharingWatermarkInfo(){return this._desc.sharingWatermarkInfo}setSharingWatermarkInfo(e){this._desc.sharingWatermarkInfo=e}},tr={mgr:null,config:er,capabilities:Qt,userAgent:Zt,tracing:{add_monitor(e){te(e)},globaltracing_error(e,t=null){ie(e,t)},Log_Error(e,t=null){re(e,t)},Log_DT(e){var t;t=e,ee?$.directReport(t):ne(t)}},graphics:{create_webgl_context_failed_monitor(e){ae(e)},calculateUVCoord:(e,t,r,i)=>function(e,t,r,i){if(!e||!t||!r)return null;const n=t.width/t.height;let a=t.width,s=t.height;if(t.width>e.width||t.height>e.height){const r=e.width/t.width,i=e.height/t.height,n=Math.min(r,i);a*=n,s*=n}let o=0,l=0;e.width/e.height>n?(l=Math.floor(e.height/s)*s,o=Math.floor(l*n/a)*a,o>e.width&&(o=Math.floor(e.width/a)*a,l=Math.floor(o/n/s)*s)):(o=Math.floor(e.width/a)*a,l=Math.floor(o/n/s)*s,l>e.height&&(l=Math.floor(e.height/s)*s,o=Math.floor(l*n/a)*a));let c=0,d=0,u=0,h=0,_={x:d,y:c,w:u,h};0==i?(c=1-(c+(s-1)/e.height),d=t.left/e.width,h=1-t.top/e.height,u=d+a/e.width,_.x=d,_.y=1-h,_.w=u,_.h=1-c):1==i?(d=1-(c+(s-1)/e.height),u=1-t.top/e.height,c=t.left/e.width,h=d+a/e.width):2==i?(c=t.top/e.height,d=t.left/e.width,h=c+(s-1)/e.height,u=d+a/e.width):3==i&&(d=t.top/e.height,u=c+(s-1)/e.height,c=t.left/e.width,h=d+a/e.width);let f=[],p=[{x:u,y:h},{x:u,y:c},{x:d,y:c},{x:u,y:h},{x:d,y:h},{x:d,y:c}];for(let e=0;e<p.length;++e){let t={u:p[e].x,v:p[e].y};f.push(t)}let m=[];for(let e=0;e<f.length;++e){let t=f[e];m.push(t.u),m.push(t.v)}return{uvCoords:m,uvRect:_}}(e,t,r,i),calculateUVCoordsForMultiView:(e,t,r,i,n,a)=>function(e,t,r,i,n,a){let s=0,o=0,l=0,c=0,d={x:o,y:s,w:l,h:c};if(e){const e=1==n||3==n?t.height/t.width:t.width/t.height,a=i.left||0,d=i.top||0;if(i.width/i.height>e){const t=i.height*e;s=d/r.height,o=(Math.round((i.width-t)/2)+a)/r.width,c=s+(i.height-1)/r.height,l=o+t/r.width}else{const t=i.width/e;s=(Math.round((i.height-t)/2)+d)/r.height,o=a/r.width,c=s+(t-1)/r.height,l=o+i.width/r.width}0==n?(s=1-(s+(i.height-1)/r.height),o=i.left/r.width,c=1-i.top/r.height,l=o+i.width/r.width):1==n?(o=1-(s+(i.height-1)/r.height),l=1-i.top/r.height,s=i.left/r.width,c=o+i.width/r.width):2==n?(s=i.top/r.height,o=i.left/r.width,c=s+(i.height-1)/r.height,l=o+i.width/r.width):3==n&&(o=i.top/r.height,l=s+(i.height-1)/r.height,s=i.left/r.width,c=o+i.width/r.width)}else{const e=i.width/i.height;let t=i.width,a=i.height;if(i.width>r.width||i.height>r.height){const e=r.width/i.width,n=r.height/i.height,s=Math.min(e,n);t*=s,a*=s}let u=0,h=0;r.width/r.height>e?(h=Math.floor(r.height/a)*a,u=Math.floor(h*e/t)*t,u>r.width&&(u=Math.floor(r.width/t)*t,h=Math.floor(u/e/a)*a)):(u=Math.floor(r.width/t)*t,h=Math.floor(u/e/a)*a,h>r.height&&(h=Math.floor(r.height/a)*a,u=Math.floor(h*e/t)*t)),0==n?(s=1-(s+(a-1)/r.height),o=i.left/r.width,c=1-i.top/r.height,l=o+t/r.width,d.x=o,d.y=1-c,d.w=l,d.h=1-s,i.height>i.width&&(o=Yt(o,2),l=qt(l,2))):1==n?(o=1-(s+(a-1)/r.height),l=1-i.top/r.height,s=i.left/r.width,c=o+t/r.width):2==n?(s=i.top/r.height,o=i.left/r.width,c=s+(a-1)/r.height,l=o+t/r.width):3==n&&(o=i.top/r.height,l=s+(a-1)/r.height,s=i.left/r.width,c=o+t/r.width)}let u=[],h=[{x:l,y:c},{x:l,y:s},{x:o,y:s},{x:l,y:c},{x:o,y:c},{x:o,y:s}];for(let e=0;e<h.length;++e){let t=null;if(a){let r=-1*Math.abs(h[e].x);h[e].x=r,t={u:h[e].x+1,v:h[e].y}}else t={u:h[e].x,v:h[e].y};u.push(t)}let _=[];for(let e=0;e<u.length;++e){let t=u[e];_.push(t.u),_.push(t.v)}return{uvCoords:_,uvRect:d}}(e,t,r,i,n,a),calculateRenderRect:(e,t)=>function(e,t){let r=0,i=0,n=0,a=0;const s=t.width/t.height;return e.width/e.height>s?(i=e.height,r=i*s,n=(e.width-r)/2,a=0):(r=e.width,i=r/s,n=0,a=(e.height-i)/2),r<=e.canvas.width&&(n=(e.canvas.width-r)/2),i<=e.canvas.height&&(a=(e.canvas.height-i)/2),{x:n,y:a,width:r,height:i}}(e,t),evalCroppingRect:(e,t)=>function(e,t){if(!e||null==t)throw new Error("evalCroppingRect() invalid parameters!");return 1===t||3===t?{top:e.top,left:e.left,width:e.height,height:e.width}:e}(e,t)},assertion:{assert(e,t=""){Ht(e,t)},assertWithFailed(e){zt(e)},abstractMethod(){!function(){const e=new Error("call abstract method!");jt().tracing.Log_Error("AbstractMethod!",e)}()},unreachable(){!function(){const e=new Error("Unreachable code reached!");jt().tracing.Log_Error("Unreachable!",e)}()}}},rr=new class{constructor(){this.moduleCache=new Map,globalThis.__dyn_modules__={}}loadModuleFromBlob(e,t,r){if(this.moduleCache.has(e))return this.moduleCache.get(e);this.moduleCache.set(e,void 0);try{let i;const n=URL.createObjectURL(t);return Ht("function"==typeof importScripts),importScripts(n),i=globalThis.__dyn_modules__[e],i&&"function"==typeof i.init&&(i.init(tr,r),this.moduleCache.set(e,i)),i}catch(t){re(`[DynModuleMgr] loadModuleFromBlob Error: ${e}`,t)}}getModule(e){return this.moduleCache.get(e)||void 0}};function ir(e,t,r){nr(e,t),t.set(e,r)}function nr(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function ar(e,t,r){return e.set(or(e,t),r),r}function sr(e,t){return e.get(or(e,t))}function or(e,t,r){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:r;throw new TypeError("Private element is not present on this object")}var lr=new WeakMap,cr=new WeakMap,dr=new WeakMap,ur=new WeakMap,hr=new WeakSet;function _r(){return!0}function fr(){if(sr(dr,this)){let e={};return e.architecture=sr(dr,this).architecture,e.vendor=sr(dr,this).vendor,e}return null}async function pr(){if(!navigator.gpu)return ar(lr,this,1),!1;const e=await navigator.gpu.requestAdapter();return e?await e.requestDevice()?("function"==typeof e.requestAdapterInfo?(ar(dr,this,await e.requestAdapterInfo()),sr(dr,this)&&console.log("adapter info: ".concat(sr(dr,this).architecture,", ").concat(sr(dr,this).vendor))):"info"in e&&ar(dr,this,e.info),ar(lr,this,0),!0):(ar(lr,this,3),!1):(ar(lr,this,2),!1)}function mr(e){if(!e)return!1;const t=e.vendor;return-1!==rt.indexOf(t)}function gr(e,t,r){return vr.produce(e,t,r)}class vr{static produce(e,t,r){let i=null;return 2===e&&(i=rr.getModule("webgpu_renderer_dynmod").exports.createWebGPURenderer(t,r)),i}}const yr=class{constructor(){var e;nr(this,e=hr),e.add(this),ir(this,lr,0),ir(this,cr,1),ir(this,dr,null),ir(this,ur,new Map)}async evaluate(e){if(ar(cr,this,1),!or(hr,this,_r).call(this))return sr(cr,this);if(!e.allowedOnTargetPlatforms)return sr(cr,this);if(!e.allowedOnTargetBrowsers)return sr(cr,this);if(!await or(hr,this,pr).call(this))return sr(cr,this);const t=or(hr,this,fr).call(this);if(!or(hr,this,mr).call(this,t))return sr(cr,this);let r=new OffscreenCanvas(1,1);return r.getContext("webgpu")?(r=null,ar(cr,this,2),sr(cr,this)):(r=null,sr(cr,this))}acquireRenderer(e,t){let r=null;return arguments.length>2&&void 0!==arguments[2]&&arguments[2]&&sr(ur,this).clear(),sr(ur,this).has(e)&&(r=sr(ur,this).get(e),r&&(e&&(r.setCanvas(e),r.initialize(e)),t&&r.setDevice(t.acquireGPUDevice()))),null==r&&(r=or(hr,this,gr).call(this,sr(cr,this),e,t),r&&sr(ur,this).set(e,r)),r}rendererReinitialize(){if(sr(ur,this))for(const[e,t]of sr(ur,this))t&&t.initialize(e)}rendererUnconfigureGPUContext(){if(sr(ur,this))for(const[e,t]of sr(ur,this))t&&t.unconfigureGPUContext()}getRendererType(){return sr(cr,this)}loadRenderModuleFromBlob(e,t){t&&(2===e?rr.loadModuleFromBlob("webgpu_renderer_dynmod",t):zt("Invalid render module for ".concat(e)))}setRendererType(e){ar(cr,this,e)}isWebGPURendererType(){return 2===sr(cr,this)}isWebGLRendererType(){return 1===sr(cr,this)}isWebGL2RendererType(){return 3===sr(cr,this)}cleanup(){for(const[e,t]of sr(ur,this))t&&t.cleanup();sr(ur,this).clear()}};function br(e,t,r){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:r;throw new TypeError("Private element is not present on this object")}var wr=new WeakSet;function Sr(e){e.forEach((e=>{e.consumePendingGPUEvents()}))}function Er(e){return!e||0==e.length||-1==e.findIndex((e=>!!e&&(!!e.getTextureLayerByZIndex(0)&&e.isRenderingStateReady())))}const Mr=class{constructor(){var e,t;(function(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")})(e=this,t=wr),t.add(e)}render(e,t){e?e.isGPUDeviceReady()?t&&0!=t.length?(br(wr,this,Sr).call(this,t),br(wr,this,Er).call(this,t)||e.render(t)):te("WGPU RendererController_render() displays are not available!"):te("WGPU RendererController_render() GPU device is not ready!"):te("WGPU RendererController_render() renderer is not attached!")}};function Rr(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,i)}return r}function Tr(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Rr(Object(r),!0).forEach((function(t){tt(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Rr(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}let xr=new Map,Cr=[];function Ar(e){e.preventDefault()}function Fr(e,t,r,i,n,a,s){let o=arguments.length>7&&void 0!==arguments[7]&&arguments[7];this.canvasElement=e,this.canvasID=t,this.contextOptions=n,this.textureindex=r||0,this.initmask=!!s,this.isEnableCanvasAlphaChannel=o,Fr.prototype.ROTATION_CLOCK0=0,Fr.prototype.ROTATION_CLOCK90=1,Fr.prototype.ROTATION_CLOCK180=2,Fr.prototype.ROTATION_CLOCK270=3,this.webGLResources=a,a||(this.initContextGL(),this.contextGL&&(this.webGLContextLostProtect(),this.contextGL.isContextLost()&&this.restoreContext())),this.webglVertexPos=[0,0,0,0],this.webglTexturePos=[0,0,0,0],this.vertexPos=[0,0,0,0],this.texturePos=[0,0,0,0],this.reinit(a);var l=new ArrayBuffer(4);this.dummpyCursor=new Uint8Array(l),this.dummpyWaterMark=new Uint8Array(l),this.cursorWidth=0,this.cursorHeight=0,this.hasCursor=0,this.lastcursorSyncId=-1,this.hasWaterMark=0,this.watermarkOpacity=.15,this.watermarkWidth=0,this.watermarkHeight=0,this.isMultiView=!1,this.hasWholeFrame=0,this.croppingParams={},this.croppingParams.top=0,this.croppingParams.left=0,this.croppingParams.width=0,this.croppingParams.height=0,this.textureWidth=0,this.textureHeight=0,this.viewWidth=0,this.viewHeight=0,this.picRotation=-1,this.bgColor=[0,0,0],this.cx=0,this.cy=0,this.cw=0,this.ch=0,this.colorRange=-1,this.videoMode=Ue,this.rotation=this.ROTATION_CLOCK0,this.fillMode=0,this.fillModeForResolution=0,this.viewPostion=null,this.enable_rounded_corner=0,this.radius_lt_x=0,this.radius_lt_y=0,this.radius_lb_x=0,this.radius_lb_y=0,this.radius_rt_x=0,this.radius_rt_y=0,this.radius_rb_x=0,this.radius_rb_y=0,this.aa_width=it,this.viewport_rect=null}Fr.prototype.isLocalDisplay=function(){return 0==this.textureindex},Fr.prototype.reinit=function(e){if(this.webGLResources=e,!this.contextGL||this.contextGL.isContextLost()||this.contextGL.glInitSucceed||this.webGLResources){if(this.webGLResources&&this.webGLResources.contextgl&&!this.webGLResources.contextgl.isContextLost()){this.contextGL=this.webGLResources.contextgl,this.shaderProgram=this.webGLResources.program,this.vertexPosBuffer=this.webGLResources.vBuffer,this.texturePosBuffer=this.webGLResources.tBuffer,this.webglTexturePos=this.webGLResources.webglTexturePos,this.webglVertexPos=this.webGLResources.webglVertexPos,this.initTextures(!1);let e=this.contextGL.getError();this.contextGL.glInitSucceed=e!=this.contextGL.NO_ERROR&&e!=this.contextGL.CONTEXT_LOST_WEBGL?0:1}}else{this.initProgram(),this.initmask?this.initTextures(!1):this.initTextures(!0),this.initBuffers();let e=this.contextGL.getError();this.contextGL.glInitSucceed=e!=this.contextGL.NO_ERROR&&e!=this.contextGL.CONTEXT_LOST_WEBGL?0:1}},Fr.prototype.webGLContextLostSimulate=function(){const e=ge(this.contextGL,"WEBGL_lose_context");null==e||e.loseContext()},Fr.prototype.restoreContext=function(){if(this.contextGL)try{var e,t;null!==(e=this.canvasElement)&&void 0!==e&&e.loseContextExtension&&!this.canvasElement.restoreTimeoutId&&this.contextGL.isContextLost()&&(this.canvasElement.restoreTimeoutId=setTimeout((()=>{this.canvasElement.reportcontextloss||(this.canvasElement.reportcontextloss=!0,ae("WebGLRestoreTimeout")),this.canvasElement.restoreTimeoutId=0}),1500),null===(t=this.canvasElement)||void 0===t||t.loseContextExtension.restoreContext())}catch(e){re("webgl restoreContext exception",e)}},Fr.prototype.webgGLContextLostCallback=function(e){ne("webglcontextlost event: canvas listener size=".concat(Cr.length,", canvas id: ").concat(this.canvasID,", , ids:").concat(Cr.join())),e.preventDefault(),this.contextGL.glInitSucceed=0,this.contextOptions&&this.contextOptions.webglcontextlostCallback&&this.contextOptions.webglcontextlostCallback(e,this.contextOptions.params)},Fr.prototype.removeEventListener=function(e,t){if(e&&t){e.restoreTimeoutId&&(clearTimeout(e.restoreTimeoutId),e.restoreTimeoutId=void 0),e.removeEventListener("webglcontextlost",t.contextLostHandler),e.removeEventListener("webglcontextrestored",t.contextRestoredHandler);const r=Cr.indexOf(this.canvasID);Cr.splice(r,1),xr.delete(e)}},Fr.prototype.webGLContextRestoredCallback=function(e){var t,r;ne("webglcontextrestored event from canvas id: ".concat(this.canvasID)),this.canvasElement.restoreTimeoutId&&(clearTimeout(this.canvasElement.restoreTimeoutId),this.canvasElement.restoreTimeoutId=void 0),this.webglVertexPos=[0,0,0,0],this.webglTexturePos=[0,0,0,0],this.reinit(),null===(t=this.contextOptions)||void 0===t||null===(r=t.webglcontextrestoredCallback)||void 0===r||r.call(t,e,this.contextOptions.params)},Fr.prototype.webGLContextLostProtect=function(){this.canvasElement&&!this.canvasElement.loseContextExtension&&(this.canvasElement.loseContextExtension=ge(this.contextGL,"WEBGL_lose_context"));let e=this.canvasElement,t=xr.get(e);t&&this.removeEventListener(e,t),xr.set(e,this),this.contextLostHandler=this.webgGLContextLostCallback.bind(this),this.contextRestoredHandler=this.webGLContextRestoredCallback.bind(this),e.addEventListener("webglcontextlost",this.contextLostHandler,{capture:!1}),e.addEventListener("webglcontextrestored",this.contextRestoredHandler,{capture:!1}),-1===Cr.indexOf(this.canvasID)&&(Cr.push(this.canvasID),Cr.length>4&&ne("webglcanvas listener size=".concat(Cr.length,", ids:").concat(Cr.join())))},Fr.prototype.isWebGL=function(){return this.contextGL},Fr.prototype.isAvaiable=function(){return this.contextGL&&!this.contextGL.isContextLost()&&this.contextGL.glInitSucceed},Fr.prototype.initContextGL=function(){for(var e,t,r,i=this.canvasElement,n=null,a=["webgl","experimental-webgl","moz-webgl","webkit-3d"],s=0;!n&&s<a.length;){var o=a[s];try{if(jt().config.isEnableCanvasCtxOptionsOpt()){let e={depth:!1,stencil:!1,antialias:!1,alpha:this.isEnableCanvasAlphaChannel};if(this.contextOptions){let t=Tr(Tr({},this.contextOptions),e);n=i.getContext(o,t)}else n=i.getContext(o,e)}else n=this.contextOptions?i.getContext(o,this.contextOptions):i.getContext(o)}catch(e){n=null}n&&"function"==typeof n.getParameter||(n=null),++s}if(this.contextGL=n,!n||n.isContextLost())return re("Failed when trying to get WebGLContext on canvas(".concat(null===(e=this.canvasElement)||void 0===e?void 0:e.width,",").concat(null===(t=this.canvasElement)||void 0===t?void 0:t.height,"), gl=").concat(n,", lost=").concat(null===(r=n)||void 0===r?void 0:r.isContextLost())),void ae("InitWebGLFail");n.glInitSucceed=0},Fr.prototype.initProgram=function(){var e=this.contextGL,t=e.createShader(e.VERTEX_SHADER);e.shaderSource(t,"\n attribute vec4 vertexPos;\n attribute vec4 texturePos;\n attribute vec4 masktexturePos;\n varying vec2 textureCoord;\n varying vec2 masktextureCoord;\n\n void main() {\n gl_Position = vertexPos;\n textureCoord = texturePos.xy;\n masktextureCoord = masktexturePos.xy;\n }\n "),e.compileShader(t),e.getShaderParameter(t,e.COMPILE_STATUS)||e.isContextLost()||ne("webgl Vertex shader failed to compile: "+e.getShaderInfoLog(t));var r=e.createShader(e.FRAGMENT_SHADER);e.shaderSource(r,"\n precision highp float;\n varying highp vec2 textureCoord;\n varying highp vec2 masktextureCoord;\n\n uniform sampler2D ySampler;\n uniform sampler2D uSampler;\n uniform sampler2D vSampler;\n uniform sampler2D cursorSampler;\n uniform sampler2D waterMarkSampler;\n uniform sampler2D previewVideoSampler;\n uniform sampler2D maskSampler;\n\n uniform vec4 cursorInfo;\n uniform int onlyRGBA;\n uniform int bgraMode;\n uniform int colorRange;\n uniform int waterMarkFlag;\n uniform int cursorFlag;\n uniform int yuvmode;\n\n const int MAX_ELLIPSE_COUNT = 10;\n uniform int maskFlag; // 0: mask disabled; 1: mask enabled;\n uniform int maskMode; // 0: static mask; 1: dynamic mask;\n uniform vec4 uEllipses[MAX_ELLIPSE_COUNT]; // each ellipse contains (cx, cy, rx, ry) 4-coords\n uniform int uEllipseCount; // how many ellipses will draw\n\n // rounded corner feature in gl shader\n uniform float u_enable_rounded_corner;\n uniform float u_radius_lt_x;\n uniform float u_radius_lt_y;\n uniform float u_radius_lb_x;\n uniform float u_radius_lb_y;\n uniform float u_radius_rt_x;\n uniform float u_radius_rt_y;\n uniform float u_radius_rb_x;\n uniform float u_radius_rb_y;\n uniform float u_aa_width;\n uniform vec4 u_viewport_rect;\n\n const mat4 YUV2RGB_L = mat4(\n 1.1643828125, 0, 1.59602734375, -0.87078515625,\n 1.1643828125, -0.39176171875, -0.81296875, 0.52959375,\n 1.1643828125, 2.017234375, 0, -1.081390625,\n 0, 0, 0, 1\n );\n\n const mat4 YUV2RGB_F = mat4(\n 1.0, 0, 1.402, -0.701,\n 1.0, -0.34413, -0.71414, 0.529135,\n 1.0, 1.772, 0, -0.886,\n 0, 0, 0, 1\n );\n\n void main(void) {\n vec4 c;\n if (waterMarkFlag != 1) {\n if (onlyRGBA == 0) {\n highp float y = texture2D(ySampler, textureCoord).r;\n highp float u;\n highp float v;\n\n if (yuvmode == 1) {\n u = texture2D(uSampler, textureCoord).r;\n v = texture2D(vSampler, textureCoord).r;\n } else {\n u = texture2D(uSampler, textureCoord).r;\n v = texture2D(uSampler, textureCoord).a;\n }\n\n if (colorRange == 0) {\n c = vec4(y, u, v, 1) * YUV2RGB_L;\n } else {\n c = vec4(y, u, v, 1) * YUV2RGB_F;\n }\n\n if (cursorFlag == 1) {\n if (cursorInfo.z > 0.0 &&\n textureCoord.x >= cursorInfo.x &&\n textureCoord.y >= cursorInfo.y &&\n textureCoord.x < cursorInfo.x + cursorInfo.z &&\n textureCoord.y < cursorInfo.y + cursorInfo.w) {\n\n vec2 cursorCoord = textureCoord - cursorInfo.xy;\n cursorCoord /= cursorInfo.zw;\n vec4 cursor = texture2D(cursorSampler, cursorCoord);\n c = c * (1.0 - cursor.a) + cursor * cursor.a;\n }\n }\n } else {\n c = texture2D(previewVideoSampler, textureCoord);\n if (bgraMode == 1) {\n c = vec4(c.b, c.g, c.r, c.a);\n }\n }\n } else {\n c = texture2D(waterMarkSampler, textureCoord);\n if (c.r == 0.0 && c.g == 0.0 && c.b == 0.0) {\n c.a = 0.0;\n }\n }\n\n if (maskFlag == 1 && waterMarkFlag != 1) {\n vec4 mask = texture2D(maskSampler, masktextureCoord);\n if (maskMode == 0) {\n // -- handle static mask --\n if (mask.r != 0.0 || mask.g != 0.0 || mask.b != 0.0) {\n c = mask * mask.a + c * (1.0 - mask.a);\n }\n } else if (maskMode == 1) {\n // -- handle dynamic mask --\n bool inEllipse = false; // variable for checking whether the pixel to be drawn hits ellipse\n for (int i = 0; i < MAX_ELLIPSE_COUNT; i++) {\n if (i > uEllipseCount) break;\n\n vec2 ellipseCenter = uEllipses[i].xy;\n vec2 ellipseRadii = uEllipses[i].zw;\n vec2 ellipsePos = masktextureCoord - ellipseCenter;\n\n float ellipseEq = (ellipsePos.x * ellipsePos.x) / (ellipseRadii.x * ellipseRadii.x) +\n (ellipsePos.y * ellipsePos.y) / (ellipseRadii.y * ellipseRadii.y);\n if (ellipseEq <= 1.0) {\n // the pixel in the ellipse range\n inEllipse = true;\n break;\n }\n }\n\n if (inEllipse) {\n c = mask * mask.a + c * (1.0 - mask.a);\n }\n }\n }\n\n if (waterMarkFlag != 1) {\n c.a = 1.0;\n }\n\n if (u_enable_rounded_corner < 0.5) {\n gl_FragColor = c;\n return;\n }\n\n // step 1: viewport coordinate mapping\n // convert the fragment coordinate(canvas coordinate) to the viewport coordinate\n // for example, a viewport={x: 100, y: 100, w: 200, h: 160}, a fragCoord.xy={x:120, y: 120}\n // we can get the pos={x: 20, y: 20}\n vec2 pos = gl_FragCoord.xy - u_viewport_rect.xy;\n vec2 viewportSize = u_viewport_rect.zw;\n\n // convert the normalized radius to pixel value\n float r_lt_x = u_radius_lt_x * viewportSize.x;\n float r_lt_y = u_radius_lt_y * viewportSize.y;\n float r_rt_x = u_radius_rt_x * viewportSize.x;\n float r_rt_y = u_radius_rt_y * viewportSize.y;\n float r_lb_x = u_radius_lb_x * viewportSize.x;\n float r_lb_y = u_radius_lb_y * viewportSize.y;\n float r_rb_x = u_radius_rb_x * viewportSize.x;\n float r_rb_y = u_radius_rb_y * viewportSize.y;\n\n // step 2: calculate the rounded corner mask (as alpha)\n float alpha = 1.0;\n\n // --- calculation of the left-top corner ---\n // Condition: if (pos.x < r_lt_x && pos.y < r_lt_y)\n float in_lt = (1.0 - step(r_lt_x, pos.x)) * (1.0 - step(r_lt_y, pos.y));\n // the circle center of the left-top corner in pixel coordinate\n vec2 center_lt = vec2(r_lt_x, r_lt_y);\n // calculate and normalize the distance between the fragment and the center\n vec2 diff_lt = (pos - center_lt) / vec2(r_lt_x, r_lt_y);\n float normDist_lt = length(diff_lt);\n // smoothstep function is used to calculate the alpha value\n float mask_lt = 1.0 - smoothstep(1.0 - u_aa_width, 1.0, normDist_lt);\n float final_lt = mix(1.0, mask_lt, in_lt);\n\n // --- calculation of the right-top corner ---\n float in_rt = (1.0 - step(r_rt_x, viewportSize.x - pos.x)) * (1.0 - step(r_rt_y, pos.y));\n vec2 center_rt = vec2(viewportSize.x - r_rt_x, r_rt_y);\n vec2 diff_rt = (pos - center_rt) / vec2(r_rt_x, r_rt_y);\n float normDist_rt = length(diff_rt);\n float mask_rt = 1.0 - smoothstep(1.0 - u_aa_width, 1.0, normDist_rt);\n float final_rt = mix(1.0, mask_rt, in_rt);\n\n // --- calculation of the left-bottom corner ---\n float in_lb = (1.0 - step(r_lb_x, pos.x)) * (1.0 - step(r_lb_y, viewportSize.y - pos.y));\n vec2 center_lb = vec2(r_lb_x, viewportSize.y - r_lb_y);\n vec2 diff_lb = (pos - center_lb) / vec2(r_lb_x, r_lb_y);\n float normDist_lb = length(diff_lb);\n float mask_lb = 1.0 - smoothstep(1.0 - u_aa_width, 1.0, normDist_lb);\n float final_lb = mix(1.0, mask_lb, in_lb);\n\n // --- calculation of the right-bottom corner ---\n float in_rb = (1.0 - step(r_rb_x, viewportSize.x - pos.x)) * (1.0 - step(r_rb_y, viewportSize.y - pos.y));\n vec2 center_rb = vec2(viewportSize.x - r_rb_x, viewportSize.y - r_rb_y);\n vec2 diff_rb = (pos - center_rb) / vec2(r_rb_x, r_rb_y);\n float normDist_rb = length(diff_rb);\n float mask_rb = 1.0 - smoothstep(1.0 - u_aa_width, 1.0, normDist_rb);\n float final_rb = mix(1.0, mask_rb, in_rb);\n\n // Get the minimum value from the four corners (to ensure that if any corner requires transparency it is applied)\n float finalAlpha = min(min(final_lt, final_rt), min(final_lb, final_rb));\n\n // Final output color\n gl_FragColor = vec4(c.rgb, c.a * finalAlpha);\n }\n"),e.compileShader(r),e.getShaderParameter(r,e.COMPILE_STATUS)||e.isContextLost()||ne("webgl Fragment shader failed to compile: "+e.getShaderInfoLog(r));var i=e.createProgram();e.attachShader(i,t),e.attachShader(i,r),e.linkProgram(i),e.getProgramParameter(i,e.LINK_STATUS)||e.isContextLost()||ne("webgl Program failed to compile: "+e.getProgramInfoLog(i)),e.useProgram(i),this.shaderProgram=i},Fr.prototype.initBuffers=function(){var e=this.contextGL,t=this.shaderProgram,r=e.createBuffer();e.bindBuffer(e.ARRAY_BUFFER,r),e.bufferData(e.ARRAY_BUFFER,new Float32Array([1,1,-1,1,1,-1,-1,-1,1,1,-1,1,1,-1,-1,-1]),e.STATIC_DRAW);var i=e.getAttribLocation(t,"vertexPos");e.enableVertexAttribArray(i),e.vertexAttribPointer(i,2,e.FLOAT,!1,0,0),this.vertexPosBuffer=r;var n=e.createBuffer();e.bindBuffer(e.ARRAY_BUFFER,n),e.bufferData(e.ARRAY_BUFFER,new Float32Array([1,0,0,0,1,1,0,1,1,0,0,0,1,1,0,1]),e.STATIC_DRAW);var a=e.getAttribLocation(t,"texturePos");if(e.enableVertexAttribArray(a),e.vertexAttribPointer(a,2,e.FLOAT,!1,0,0),this.initmask&&!this.masktexturePosBuffer){var s=e.createBuffer();e.bindBuffer(e.ARRAY_BUFFER,s),e.bufferData(e.ARRAY_BUFFER,new Float32Array([1,0,0,0,1,1,0,1]),e.STATIC_DRAW);var o=e.getAttribLocation(t,"masktexturePos");e.enableVertexAttribArray(o),e.vertexAttribPointer(o,2,e.FLOAT,!1,0,0),this.masktexturePosBuffer=s}this.texturePosBuffer=n},Fr.prototype.initTextures=function(e){var t=this.contextGL,r=this.shaderProgram;t.pixelStorei(t.UNPACK_ALIGNMENT,1);var i=this.initTexture();this.yTextureRef=i,this.oyTextureRef=i;var n=this.initTexture();this.uTextureRef=n,this.ouTextureRef=n;var a=this.initTexture();this.vTextureRef=a,this.ovTextureRef=a,e&&this.BindTextures(We),this.waterMarkTextureRef=this.initTexture();var s=t.getUniformLocation(r,"waterMarkSampler");t.uniform1i(s,5),this.waterMarkSamplerRef=s;var o=this.initTexture(),l=t.getUniformLocation(r,"cursorSampler");if(t.uniform1i(l,4),this.cursorTextureRef=o,this.cursorSamplerRef=l,this.cursorInfoRef=t.getUniformLocation(r,"cursorInfo"),this.initmask){t.pixelStorei(t.UNPACK_FLIP_Y_WEBGL,1);var c=this.initTexture(),d=t.getUniformLocation(r,"maskSampler");t.uniform1i(d,4),this.maskTextureRef=c}this.colorRangeRef=t.getUniformLocation(r,"colorRange"),this.onlyRGBARef=t.getUniformLocation(r,"onlyRGBA"),this.bgraModeRef=t.getUniformLocation(r,"bgraMode"),this.waterMarkFlagRef=t.getUniformLocation(r,"waterMarkFlag"),this.maskFlagRef=t.getUniformLocation(r,"maskFlag"),this.cursorFlagRef=t.getUniformLocation(r,"cursorFlag"),this.yuvmodeRef=t.getUniformLocation(r,"yuvmode"),this.ul_enable_rounded_corner=t.getUniformLocation(r,"u_enable_rounded_corner"),this.ul_radius_lt_x=t.getUniformLocation(r,"u_radius_lt_x"),this.ul_radius_lt_y=t.getUniformLocation(r,"u_radius_lt_y"),this.ul_radius_lb_x=t.getUniformLocation(r,"u_radius_lb_x"),this.ul_radius_lb_y=t.getUniformLocation(r,"u_radius_lb_y"),this.ul_radius_rt_x=t.getUniformLocation(r,"u_radius_rt_x"),this.ul_radius_rt_y=t.getUniformLocation(r,"u_radius_rt_y"),this.ul_radius_rb_x=t.getUniformLocation(r,"u_radius_rb_x"),this.ul_radius_rb_y=t.getUniformLocation(r,"u_radius_rb_y"),this.ul_aa_width=t.getUniformLocation(r,"u_aa_width"),this.ul_viewport_rect=t.getUniformLocation(r,"u_viewport_rect")},Fr.prototype.BindTextures=function(e){var t=this.contextGL,r=this.shaderProgram;if(t.pixelStorei(t.UNPACK_ALIGNMENT,1),t.activeTexture(t.TEXTURE0+0),t.bindTexture(t.TEXTURE_2D,this.yTextureRef),t.activeTexture(t.TEXTURE0+1),t.bindTexture(t.TEXTURE_2D,this.uTextureRef),t.activeTexture(t.TEXTURE0+2),t.bindTexture(t.TEXTURE_2D,this.vTextureRef),e==We){let e=t.getUniformLocation(r,"ySampler");t.uniform1i(e,0);let i=t.getUniformLocation(r,"uSampler");t.uniform1i(i,1);let n=t.getUniformLocation(r,"vSampler");t.uniform1i(n,2)}else if(this.isRGBAMode(e)){let e=t.getUniformLocation(r,"previewVideoSampler");t.uniform1i(e,0);let i=t.getUniformLocation(r,"ySampler");t.uniform1i(i,0);let n=t.getUniformLocation(r,"uSampler");t.uniform1i(n,0);let a=t.getUniformLocation(r,"vSampler");t.uniform1i(a,0)}else if(2==e){let e=t.getUniformLocation(r,"ySampler");t.uniform1i(e,0);let i=t.getUniformLocation(r,"uSampler");t.uniform1i(i,1);let n=t.getUniformLocation(r,"vSampler");t.uniform1i(n,0)}let i=t.getUniformLocation(r,"previewVideoSampler");t.uniform1i(i,0);let n=t.getUniformLocation(r,"maskSampler");this.initmask?(t.activeTexture(t.TEXTURE0+4),t.bindTexture(t.TEXTURE_2D,this.maskTextureRef),t.uniform1i(n,4)):t.uniform1i(n,0);let a=t.getUniformLocation(r,"cursorSampler");t.uniform1i(a,0);let s=t.getUniformLocation(this.shaderProgram,"waterMarkSampler");t.uniform1i(s,5)},Fr.prototype.initTexture=function(){var e=this.contextGL,t=e.createTexture();return e.bindTexture(e.TEXTURE_2D,t),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),e.bindTexture(e.TEXTURE_2D,null),t},Fr.prototype.clearDisplay=function(){var e=this.contextGL;e&&(e.clearColor(0,0,0,0),e.clear(e.COLOR_BUFFER_BIT))},Fr.prototype.cleanup=function(){let e=this.canvasElement,t=xr.get(e);if(t&&this.removeEventListener(e,t),e.defaultContextLostHandler||(e.defaultContextLostHandler=Ar,e.addEventListener("webglcontextlost",Ar,{capture:!1})),this.cleanupRoundedCornerRadius(),this.isAvaiable()){var r=this.contextGL;r.deleteProgram(this.program),r.activeTexture(r.TEXTURE0),r.bindTexture(r.TEXTURE_2D,null),r.activeTexture(r.TEXTURE1),r.bindTexture(r.TEXTURE_2D,null),r.activeTexture(r.TEXTURE2),r.bindTexture(r.TEXTURE_2D,null),r.activeTexture(r.TEXTURE3),r.bindTexture(r.TEXTURE_2D,null),r.activeTexture(r.TEXTURE4),r.bindTexture(r.TEXTURE_2D,null),r.activeTexture(r.TEXTURE5),r.bindTexture(r.TEXTURE_2D,null),r.bindBuffer(r.ARRAY_BUFFER,null),r.deleteTexture(this.yTextureRef),r.deleteTexture(this.uTextureRef),r.deleteTexture(this.vTextureRef),r.deleteTexture(this.cursorTextureRef),r.deleteTexture(this.waterMarkTextureRef),r.deleteBuffer(this.vertexPosBuffer),r.deleteBuffer(this.texturePosBuffer),this.maskTextureRef&&r.deleteTexture(this.maskTextureRef),this.masktexturePosBuffer&&r.deleteBuffer(this.masktexturePosBuffer),r.glInitSucceed=0}},Fr.prototype.updataVertexInfoForSharing=function(){const[e,t,r,i]=this.vertexPos,n=this.webglVertexPos[0],a=this.webglVertexPos[3];if(e!=n||a!=i){this.webglVertexPos[0]=e,this.webglVertexPos[1]=t,this.webglVertexPos[2]=r,this.webglVertexPos[3]=i;var s=new Float32Array([r,t,e,t,r,i,e,i,1,1,-1,1,1,-1,-1,-1]),o=this.contextGL;o.bindBuffer(o.ARRAY_BUFFER,this.vertexPosBuffer),o.bufferData(o.ARRAY_BUFFER,s,o.DYNAMIC_DRAW)}},Fr.prototype.updateTextureInfoForSharing=function(){const[e,t,r,i]=this.texturePos,n=this.webglTexturePos[0],a=this.webglTexturePos[3];if(e!=n||a!=i){this.webglTexturePos[0]=e,this.webglTexturePos[1]=t,this.webglTexturePos[2]=r,this.webglTexturePos[3]=i;var s=new Float32Array([r,t,e,t,r,i,e,i,1,0,0,0,1,1,0,1]),o=this.contextGL;o.bindBuffer(o.ARRAY_BUFFER,this.texturePosBuffer),o.bufferData(o.ARRAY_BUFFER,s,o.DYNAMIC_DRAW)}},Fr.prototype.updateVertexInfoForMultiView=function(e,t,r,i,n){var a,s,o,l,c=this.contextGL;if(this.isUseFillMode({width:r,height:i,rotation:n}))a=0,s=0,o=1,l=1;else{var d=n==this.ROTATION_CLOCK90||n==this.ROTATION_CLOCK270?i:r,u=n==this.ROTATION_CLOCK90||n==this.ROTATION_CLOCK270?r:i,h=d/u*t;h>e?(a=0,o=1,l=1-(s=(t-u/d*e)/2/t)):(s=0,l=1,o=1-(a=(e-h)/2/e))}a=2*a-1,o=2*o-1,s=1-2*s,l=1-2*l;var _=new Float32Array([o,s,a,s,o,l,a,l,1,1,-1,1,1,-1,-1,-1]);this.viewPostion=_,c.bindBuffer(c.ARRAY_BUFFER,this.vertexPosBuffer),c.bufferData(c.ARRAY_BUFFER,_,c.DYNAMIC_DRAW)},Fr.prototype.getViewPosition=function(){let e=[0,0,1,1];if(!this.viewPostion)return e;const t=this.viewPostion[0],r=this.viewPostion[1],i=this.viewPostion[2],n=this.viewPostion[5];return e[0]=(1-r)/2,e[1]=(1+i)/2,e[2]=(1-n)/2,e[3]=(1+t)/2,e},Fr.prototype.updateTextureInfoForMultiView=function(e,t,r,i,n,a,s){var o,l,c,d,u=this.contextGL;if(this.isUseFillMode({width:r.width,height:r.height,rotation:i})){const n=i==this.ROTATION_CLOCK90||i==this.ROTATION_CLOCK270?s/a:a/s,u=r.left||0,h=r.top||0;if(r.width/r.height>n){const i=r.height*n;o=h/t,l=(Math.round((r.width-i)/2)+u)/e,c=(h+r.height)/t,d=l+i/e}else{const i=r.width/n;c=(o=(Math.round((r.height-i)/2)+h)/t)+i/t,d=(l=u/e)+r.width/e}}else o=Yt(r.top/t,2),l=Yt(r.left/e,2),c=qt((r.top+r.height)/t,2),d=qt((r.width+r.left)/e,2);var h=[l,o,d,o,d,c,l,c];i==this.ROTATION_CLOCK90&&(h.unshift(h[6],h[7]),h=h.slice(0,8)),i==this.ROTATION_CLOCK180&&(h.unshift(h[4],h[5],h[6],h[7]),h=h.slice(0,8)),i==this.ROTATION_CLOCK270&&(h.push(h[0],h[1]),h=h.slice(2,10));var _=h[0],f=h[1];if(h[0]=h[2],h[1]=h[3],h[2]=_,h[3]=f,n)if(i==this.ROTATION_CLOCK90||i==this.ROTATION_CLOCK270){let e=h[1];h[1]=h[3],h[3]=e,e=h[5],h[5]=h[7],h[7]=e}else h[0]=1-h[0],h[2]=1-h[2],h[4]=1-h[4],h[6]=1-h[6];var p=new Float32Array([...h,1,0,0,0,1,1,0,1]);u.bindBuffer(u.ARRAY_BUFFER,this.texturePosBuffer),u.bufferData(u.ARRAY_BUFFER,p,u.DYNAMIC_DRAW)},Fr.prototype.drawNextOutputPictureFrame=function(e,t,r,i,n){let a=!(arguments.length>5&&void 0!==arguments[5])||arguments[5],s=arguments.length>6?arguments[6]:void 0,o=!(arguments.length>7&&void 0!==arguments[7])||arguments[7];if(!this.isAvaiable())return;var l=this.contextGL,c=this.yTextureRef,d=this.uTextureRef,u=this.vTextureRef;l.enable(l.BLEND),l.blendFunc(l.SRC_ALPHA,l.ONE_MINUS_SRC_ALPHA),n=n||this.ROTATION_CLOCK0;var h=(r=r||{top:0,left:0,width:e,height:t}).width!=this.croppingParams.width||r.height!=this.croppingParams.height,_=(r.top!=this.croppingParams.top||(r.left,this.croppingParams.left),s.width!=this.viewWidth||s.height!=this.viewHeight),f=(e!=this.textureWidth||this.textureHeight,n!=this.picRotation);(h||_||f)&&function(e,t,r,i,n){let a=n.width,s=n.height;var o,l,c,d,u=i==e.ROTATION_CLOCK90||i==e.ROTATION_CLOCK270?r:t,h=i==e.ROTATION_CLOCK90||i==e.ROTATION_CLOCK270?t:r,_=u/h*s;_>a?(o=0,c=1,d=1-(l=(s-h/u*a)/2/s)):(l=0,d=1,c=1-(o=(a-_)/2/a)),o=parseFloat((2*o-1).toFixed(3)),c=parseFloat((2*c-1).toFixed(3)),l=parseFloat((1-2*l).toFixed(3)),d=parseFloat((1-2*d).toFixed(3)),e.vertexPos=[o,l,c,d]}(this,r.width,r.height,n,s),this.updataVertexInfoForSharing(),function(e,t,r,i,n){var a=i.top/r,s=i.left/t,o=(i.top+i.height)/r,l=(i.left+i.width)/t,c=[s,a,l,a,l,o,s,o];n==e.ROTATION_CLOCK90&&(c.unshift(c[6],c[7]),c=c.slice(0,8)),n==e.ROTATION_CLOCK180&&(c.unshift(c[4],c[5],c[6],c[7]),c=c.slice(0,8)),n==e.ROTATION_CLOCK270&&(c.push(c[0],c[1]),c=c.slice(2));var d=c[0],u=c[1];c[0]=c[2],c[1]=c[3],c[2]=d,c[3]=u;var h=new Float32Array([...c,1,0,0,0,1,1,0,1]),_=e.contextGL;_.bindBuffer(_.ARRAY_BUFFER,e.texturePosBuffer),_.bufferData(_.ARRAY_BUFFER,h,_.DYNAMIC_DRAW)}(this,e,t,r,n);let p=a?0:1;p!=this.colorRange&&(l.uniform1i(this.colorRangeRef,p),this.colorRange=p),l.viewport(s.x,s.y,s.width,s.height),this.viewport_rect||(this.viewport_rect=new Float32Array(4)),this.viewport_rect.set([s.x,s.y,s.width,s.height],0),l.uniform4fv(this.ul_viewport_rect,this.viewport_rect),l.uniform1i(this.onlyRGBARef,0),l.uniform1i(this.yuvmodeRef,We),Object.assign(this.croppingParams,r),this.textureWidth=e,this.textureHeight=t,this.picRotation=n,this.viewWidth=s.width,this.viewHeight=s.height;var m=i,g=e*t;if(l.activeTexture(l.TEXTURE0),l.bindTexture(l.TEXTURE_2D,c),o){var v=m.subarray(0,g);l.texImage2D(l.TEXTURE_2D,0,l.LUMINANCE,e,t,0,l.LUMINANCE,l.UNSIGNED_BYTE,v)}var y=e/2*t/2;if(l.activeTexture(l.TEXTURE1),l.bindTexture(l.TEXTURE_2D,d),o){var b=m.subarray(g,g+y);l.texImage2D(l.TEXTURE_2D,0,l.LUMINANCE,e/2,t/2,0,l.LUMINANCE,l.UNSIGNED_BYTE,b)}var w=y;if(l.activeTexture(l.TEXTURE2),l.bindTexture(l.TEXTURE_2D,u),o){var S=m.subarray(g+y,g+y+w);l.texImage2D(l.TEXTURE_2D,0,l.LUMINANCE,e/2,t/2,0,l.LUMINANCE,l.UNSIGNED_BYTE,S)}l.activeTexture(l.TEXTURE0+4),l.bindTexture(l.TEXTURE_2D,this.cursorTextureRef),this.hasCursor?l.uniform1i(this.cursorFlagRef,1):o&&l.texImage2D(l.TEXTURE_2D,0,l.RGBA,1,1,0,l.RGBA,l.UNSIGNED_BYTE,this.dummpyCursor),l.uniform4f(this.cursorInfoRef,this.cx,this.cy,this.cw,this.ch),this.render(),this.hasWholeFrame=1},Fr.prototype.updateCursor=function(e,t,r,i){if(this.isAvaiable()){var n=this.contextGL;e<=0||t<=0||!r||r.length!=e*t*4||i!=this.lastcursorSyncId&&(this.lastcursorSyncId=i,n.activeTexture(n.TEXTURE0+4),n.bindTexture(n.TEXTURE_2D,this.cursorTextureRef),n.texImage2D(n.TEXTURE_2D,0,n.RGBA,e,t,0,n.RGBA,n.UNSIGNED_BYTE,r),this.cursorWidth=e,this.cursorHeight=t,this.hasCursor=1)}},Fr.prototype.updateCursorPosInfo=function(e,t,r,i,n){if(e&&this.hasCursor){let e=t/this.croppingParams.width,a=r/this.croppingParams.height,s=i/this.croppingParams.width,o=n/this.croppingParams.height;this.cx=e,this.cy=a,this.cw=s,this.ch=o}else this.cx=0,this.cy=0,this.cw=0,this.ch=0},Fr.prototype.isHasWholeFrame=function(){return this.hasWholeFrame},Fr.prototype.updateWatermark=function(e,t,r){if(this.isAvaiable()){var i=this.contextGL;e<=0||t<=0||!r||r.length!=e*t*4||(this.hasWaterMark=1,this.watermarkWidth=e,this.watermarkHeight=t,i.activeTexture(i.TEXTURE0+5),i.bindTexture(i.TEXTURE_2D,this.waterMarkTextureRef),i.texImage2D(i.TEXTURE_2D,0,i.RGBA,this.watermarkWidth,this.watermarkHeight,0,i.RGBA,i.UNSIGNED_BYTE,r))}},Fr.prototype.drawWatermark=function(){if(this.isAvaiable()){var e=this.contextGL;this.isSetWatermark()&&this.watermarkWidth&&this.watermarkHeight&&(e.uniform1i(this.waterMarkFlagRef,1),e.activeTexture(e.TEXTURE0+5),e.bindTexture(e.TEXTURE_2D,this.waterMarkTextureRef),e.enable(e.BLEND),e.blendFunc(e.SRC_ALPHA,e.ONE_MINUS_SRC_ALPHA),e.drawArrays(e.TRIANGLE_STRIP,4,4))}},Fr.prototype.drawRoundedCorner=function(){if(this.isAvaiable()){var e=this.contextGL;e.enable(e.BLEND),e.blendFunc(e.SRC_ALPHA,e.ONE_MINUS_SRC_ALPHA),e.uniform1f(this.ul_enable_rounded_corner,this.enable_rounded_corner),e.uniform1f(this.ul_radius_lt_x,this.radius_lt_x),e.uniform1f(this.ul_radius_lt_y,this.radius_lt_y),e.uniform1f(this.ul_radius_lb_x,this.radius_lb_x),e.uniform1f(this.ul_radius_lb_y,this.radius_lb_y),e.uniform1f(this.ul_radius_rt_x,this.radius_rt_x),e.uniform1f(this.ul_radius_rt_y,this.radius_rt_y),e.uniform1f(this.ul_radius_rb_x,this.radius_rb_x),e.uniform1f(this.ul_radius_rb_y,this.radius_rb_y),e.uniform1f(this.ul_aa_width,this.aa_width)}},Fr.prototype.cleanupRoundedCornerRadius=function(){this.enable_rounded_corner=0,this.radius_lt_x=0,this.radius_lt_y=0,this.radius_lb_x=0,this.radius_lb_y=0,this.radius_rt_x=0,this.radius_rt_y=0,this.radius_rb_x=0,this.radius_rb_y=0,this.aa_width=it,this.viewport_rect=null},Fr.prototype.render=function(){if(this.isAvaiable()){var e=this.contextGL;this.drawRoundedCorner(),e.uniform1i(this.waterMarkFlagRef,0),e.drawArrays(e.TRIANGLE_STRIP,0,4),this.drawWatermark()}},Fr.prototype.clear=function(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.hasCursor=0,this.watermarkHeight=0,this.watermarkWidth=0,this.watermarkRepeated=!1,this.hasWholeFrame=0,this.lastcursorSyncId=-1,this.cleanupRoundedCornerRadius(),e&&this.clearCanvas({R:0,G:0,B:0,A:0})},Fr.prototype.clearCanvas=function(e){if(this.cleanupRoundedCornerRadius(),this.isAvaiable()){var t=this.contextGL;e?t.clearColor(e.R,e.G,e.B,e.A):t.clearColor(this.bgColor[0],this.bgColor[1],this.bgColor[2],255),t.clear(t.COLOR_BUFFER_BIT)}},Fr.prototype.isRGBAMode=function(e){return-1!==[Ve,Be].indexOf(e)},Fr.prototype.updateRemoteVideoTextures=function(e,t,r,i,n){let a=!(arguments.length>5&&void 0!==arguments[5])||arguments[5],s=arguments.length>6?arguments[6]:void 0,o=!(arguments.length>8&&void 0!==arguments[8])||arguments[8];if(!this.isAvaiable())return;var l=this.contextGL,c=this.yTextureRef,d=this.uTextureRef,u=this.vTextureRef;l.enable(l.BLEND),l.blendFunc(l.SRC_ALPHA,l.ONE_MINUS_SRC_ALPHA);const h=this.isRGBAMode(this.videoMode);if(e<=0||t<=0||!i||!i.length||i.length!=e*t*3/2&&!h||r&&(r.top<0||r.left<0||r.left+r.width>e||r.top+r.height>t))return!1;let _=a?0:1;if(this.colorRange=_,this.rotation=n,Object.assign(this.croppingParams,r),this.textureWidth=e,this.textureHeight=t,this.viewWidth=s.width,this.viewHeight=s.height,!o)return;if(l.bindTexture(l.TEXTURE_2D,c),h)return void l.texImage2D(l.TEXTURE_2D,0,l.RGBA,e,t,0,l.RGBA,l.UNSIGNED_BYTE,i);var f=i,p=e*t,m=f.subarray(0,p);l.texImage2D(l.TEXTURE_2D,0,l.LUMINANCE,e,t,0,l.LUMINANCE,l.UNSIGNED_BYTE,m);let g=0,v=0;this.videoMode==We?(g=e/2*t/2,v=g):2==this.videoMode&&(g=e*t/2,v=0);var y=f.subarray(p,p+g);if(l.bindTexture(l.TEXTURE_2D,d),v){l.texImage2D(l.TEXTURE_2D,0,l.LUMINANCE,e/2,t/2,0,l.LUMINANCE,l.UNSIGNED_BYTE,y);var b=f.subarray(p+g,p+g+v);l.bindTexture(l.TEXTURE_2D,u),l.texImage2D(l.TEXTURE_2D,0,l.LUMINANCE,e/2,t/2,0,l.LUMINANCE,l.UNSIGNED_BYTE,b)}else l.texImage2D(l.TEXTURE_2D,0,l.LUMINANCE_ALPHA,e/2,t/2,0,l.LUMINANCE_ALPHA,l.UNSIGNED_BYTE,y);return!0},Fr.prototype.updateRemoteVideoTexturesImageBitmap=function(e,t,r,i,n){let a=!(arguments.length>5&&void 0!==arguments[5])||arguments[5];if(e<=0||t<=0||!r)return;if(!this.isAvaiable())return;var s=this.contextGL;if(this.textureWidth=e,this.textureHeight=t,Number.isNaN(n)||(this.rotation=n),Object.assign(this.croppingParams,i),!a)return;s.bindTexture(s.TEXTURE_2D,this.yTextureRef);const o=s.RGBA,l=s.RGBA,c=s.UNSIGNED_BYTE;s.texImage2D(s.TEXTURE_2D,0,o,l,c,r)},Fr.prototype.updateSelfMaskImage=function(e,t,r){if(!(e<=0||t<=0)&&r&&r.length==e*t*4&&this.isAvaiable()){var i=this.contextGL;i.bindTexture(i.TEXTURE_2D,this.maskTextureRef),i.texImage2D(i.TEXTURE_2D,0,i.RGBA,e,t,0,i.RGBA,i.UNSIGNED_BYTE,r)}},Fr.prototype.VideoFlip=function(){if(this.isAvaiable()){var e=this.contextGL;e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,1)}},Fr.prototype.drawRemoteVideo=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!this.isAvaiable())return;var r=this.contextGL;let i=this.isRGBAMode(this.videoMode)?1:0;r.uniform1i(this.colorRangeRef,this.colorRange),this.setUniformFlag(i,this.hasCursor,this.videoMode),this.initmask&&r.uniform1i(this.maskFlagRef,1),this.updateTextureInfoForMultiView(this.textureWidth,this.textureHeight,this.croppingParams,this.rotation,t,e.width,e.height),r.viewport(e.x,e.y,e.width,e.height),this.viewport_rect||(this.viewport_rect=new Float32Array(4)),this.viewport_rect.set([e.x,e.y,e.width,e.height],0),r.uniform4fv(this.ul_viewport_rect,this.viewport_rect),this.updateVertexInfoForMultiView(e.width,e.height,this.croppingParams.width,this.croppingParams.height,this.rotation),this.BindTextures(this.videoMode),r.enable(r.BLEND),r.blendFunc(r.SRC_ALPHA,r.ONE_MINUS_SRC_ALPHA),this.render()},Fr.prototype.readPixelsSyncRequest=function(e,t,r,i){if(this.isAvaiable()){var n,a=this.contextGL;return this.destination&&this.destination.length==r*i*4||(this.destination=new Uint8Array(r*i*4)),n=this.destination,a.flush(),a.readPixels(e,t,r,i,a.RGBA,a.UNSIGNED_BYTE,n),n}},Fr.prototype.updateSelfVideoTextures=function(e,t,r,i){let n=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0;if(!(e<=0||t<=0)&&r&&r.length%4==0&&this.isAvaiable()){var s=this.contextGL;this.textureWidth=e,this.textureHeight=t,this.rotation=a,Object.assign(this.croppingParams,i),n&&(s.bindTexture(s.TEXTURE_2D,this.yTextureRef),s.texImage2D(s.TEXTURE_2D,0,s.RGBA,e,t,0,s.RGBA,s.UNSIGNED_BYTE,r))}},Fr.prototype.drawSelfVideo=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(this.isAvaiable()){var i=this.contextGL;this.setUniformFlag(1,this.hasCursor,this.videoMode),this.updateTextureInfoForMultiView(this.textureWidth,this.textureHeight,this.croppingParams,this.rotation,r,e.width,e.height),i.viewport(e.x,e.y,e.width,e.height),this.viewport_rect||(this.viewport_rect=new Float32Array(4)),this.viewport_rect.set([e.x,e.y,e.width,e.height],0),i.uniform4fv(this.ul_viewport_rect,this.viewport_rect),t?(i.enable(i.BLEND),i.blendFunc(i.ZERO,i.ZERO),this.updateVertexInfoForMultiView(e.width,e.height,e.width,e.height,this.ROTATION_CLOCK0)):(i.enable(i.BLEND),i.blendFunc(i.SRC_ALPHA,i.ONE_MINUS_SRC_ALPHA),this.updateVertexInfoForMultiView(e.width,e.height,this.croppingParams.width,this.croppingParams.height,this.rotation)),this.BindTextures(Ve),this.render()}},Fr.prototype.isSetWatermark=function(){return this.hasWaterMark},Fr.prototype.setWatermarkFlag=function(e){this.hasWaterMark=e,e||(this.setWatermarkRepeated(!1),this.setWatermarkOpacity(),this.setWatermarkPosition(16))},Fr.prototype.setUniformFlag=function(e,t,r){if(this.isAvaiable()){var i=this.contextGL;i.uniform1i(this.onlyRGBARef,e),i.uniform1i(this.bgraModeRef,e&&r===Be?1:0),i.uniform1i(this.cursorFlagRef,t),e||i.uniform1i(this.yuvmodeRef,r)}},Fr.prototype.setVideoMode=function(e){this.videoMode=e},Fr.prototype.getVideoMode=function(e){return this.videoMode},Fr.prototype.setWatermarkRepeated=function(e){this.watermarkRepeated=e},Fr.prototype.isWatermarkRepeated=function(){return!!this.watermarkRepeated},Fr.prototype.setWatermarkOpacity=function(e){this.watermarkOpacity=e||.15},Fr.prototype.getWatermarkOpacity=function(){return this.watermarkOpacity},Fr.prototype.setWatermarkPosition=function(e){this.watermarkPosition=e||16},Fr.prototype.getWatermarkPosition=function(){return this.watermarkPosition},Fr.prototype.setMultiView=function(e){return this.isMultiView=e},Fr.prototype.getRepeatedWatermarkUniformValue=function(){return this.isMultiView?30:7},Fr.prototype.getRepeatedWatermarkTextureValue=function(e){return this.isMultiView?e.TEXTURE30:e.TEXTURE7},Fr.prototype.setFillMode=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;this.fillMode=e,this.fillModeForResolution=t},Fr.prototype.getFillMode=function(){return this.fillMode},Fr.prototype.getFillModeForResolution=function(){return this.fillModeForResolution},Fr.prototype.getTextureIndex=function(){return this.textureindex},Fr.prototype.getTextureWidth=function(){return this.textureWidth},Fr.prototype.getTextureHeight=function(){return this.textureHeight},Fr.prototype.getRotation=function(){return this.rotation},Fr.prototype.getCroppingParams=function(){return this.croppingParams},Fr.prototype.getIndex=function(){return this.textureindex},Fr.prototype.getWatermarkWidth=function(){return this.watermarkWidth},Fr.prototype.getWatermarkHeight=function(){return this.watermarkHeight},Fr.prototype.getWatermarkOpacity=function(){return this.watermarkOpacity},Fr.prototype.getAttachedCanvas=function(){return this.canvasElement},Fr.prototype.getCanvasId=function(){return this.canvasID},Fr.prototype.resizeCanvasTo=function(e,t){this.contextGL.canvas.width=e,this.contextGL.canvas.height=t},Fr.prototype.isUseFillMode=function(e){let{width:t,height:r,rotation:i}=e;if(!this.fillMode)return!1;if(!this.fillModeForResolution)return!0;if(!t||!r)return!1;const n=i===this.ROTATION_CLOCK90||i==this.ROTATION_CLOCK270?r/t:t/r;return(Array.isArray(this.fillModeForResolution)?this.fillModeForResolution:[this.fillModeForResolution]).some((e=>Math.abs(n-e)<.01))},Fr.prototype.setRoundedCornerRadius=function(e){e?(this.radius_lt_x=e.radius_lt_x,this.radius_lt_y=e.radius_lt_y,this.radius_lb_x=e.radius_lb_x,this.radius_lb_y=e.radius_lb_y,this.radius_rt_x=e.radius_rt_x,this.radius_rt_y=e.radius_rt_y,this.radius_rb_x=e.radius_rb_x,this.radius_rb_y=e.radius_rb_y,0===this.radius_lt_x&&0===this.radius_lt_y&&0===this.radius_lb_x&&0===this.radius_lb_y&&0===this.radius_rt_x&&0===this.radius_rt_y&&0===this.radius_rb_x&&0===this.radius_rb_y?this.enable_rounded_corner=0:this.enable_rounded_corner=1):this.enable_rounded_corner=0},Fr.prototype.setAntialiasWidth=function(e){(e<=0||e>=1)&&(e=it),this.aa_width=e};const kr=Fr;class Pr{getVideoRenderDisplay(e,t,r,i,n){throw new Error("getVideoRenderDisplay() should be implemented by subclass.")}getRenderDisplay(e,t,r){throw new Error("getRenderDisplay() should be implemented by subclass.")}createVideoRenderDisplay(e,t,r){throw new Error("createVideoRenderDisplay() should be implemented by subclass.")}}function Lr(e,t,r){(function(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")})(e,t),t.set(e,r)}function Dr(e,t){return e.get(Or(e,t))}function Ir(e,t,r){return e.set(Or(e,t),r),r}function Or(e,t,r){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:r;throw new TypeError("Private element is not present on this object")}var Ur=new WeakMap,Vr=new WeakMap;class Wr extends Pr{constructor(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];super(),Lr(this,Ur,new Map),Lr(this,Vr,!1),Ir(Vr,this,e)}setCanvasAlphaChannelEnability(e){Ir(Vr,this,e)}createVideoRenderDisplay(e,t,r){let i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null,n=null,a=null,s=null,o=!1;return i&&(n=i.forceNoGL,a=i.contextOptions,s=i.webGLResources,o=i.initMask),new kr(e,t,r,n,a,s,o,Dr(Vr,this))}getVideoRenderDisplay(e,t,r,i){let n=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null,a=Dr(Ur,this).get(e);if(!a){let i=[];a=[i,[]],Dr(Ur,this).set(e,a);let s=new kr(e,t,0,void 0,void 0,void 0,void 0,Dr(Vr,this));s.setMultiView(!0),n&&n.set(e,s);let o=1;for(;o<=r;o++){const r=new kr(e,t,o,void 0,void 0,{program:s.shaderProgram,contextgl:s.contextGL,vBuffer:s.vertexPosBuffer,tBuffer:s.texturePosBuffer,waterMarkTextureRef:s.waterMarkTextureRef,repeatedWaterMarkTextureRef:s.repeatedWaterMarkTextureRef},void 0,Dr(Vr,this));r.setMultiView(!0),i.push(r)}}let s,o=Dr(Ur,this).get(e),l=o[0],c=o[1];if(o&&l[0]&&(s=l.pop(),c.push(s)),!s){const e=o?"".concat(o.length):"undefined",t=l?"".concat(l.length):"undefined";i("No Display obtained from VideoRender.Get_Display. canvasRenderArray:".concat(e," unusedRenderArray:").concat(t))}return s}onWebglContextLostForMulti(e,t){const{canvas:r}=t;let i=Dr(Ur,this).get(r);var[n,a,s]=i;[...n,...a].forEach((e=>e.clear()))}onRestoredFromLostForMulti(e,t){if(!t)return;const{canvas:r}=t;let i=Dr(Ur,this).get(r);var[n,a,s]=i;const o=[...n,...a];let l=o.find((e=>e.isLocalDisplay()));l.webglVertexPos=[0,0,0,0],l.webglTexturePos=[0,0,0,0],s.args={program:l.shaderProgram,contextgl:l.contextGL,vBuffer:l.vertexPosBuffer,tBuffer:l.texturePosBuffer,webglVertexPos:l.webglVertexPos,webglTexturePos:l.webglTexturePos},o.forEach((e=>{e!=l&&e.reinit(s.args)}))}getRenderDisplay(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,i=Dr(Ur,this).get(e);if(!i){let n=[],a={canvasId:t,size:1,args:{}};i=[n,[],a],Dr(Ur,this).set(e,i);const s={webglcontextlostCallback:this.onWebglContextLostForMulti.bind(this),webglcontextrestoredCallback:this.onRestoredFromLostForMulti.bind(this),params:{canvas:e,rendercanvasID:t}};let o=new kr(e,t,0,void 0,s,void 0,void 0,Dr(Vr,this));r&&r.set(e,o),n.push(o),a.args={program:o.shaderProgram,contextgl:o.contextGL,vBuffer:o.vertexPosBuffer,tBuffer:o.texturePosBuffer,webglVertexPos:o.webglVertexPos,webglTexturePos:o.webglTexturePos}}if(!i[0].length){const r=new kr(e,t,i[2].size,void 0,void 0,i[2].args,void 0,Dr(Vr,this));i[2].size++,i[0].push(r)}let n=i[0].pop();return i[1].push(n),n}recycleRenderDisplay(e,t,r){t.setWatermarkFlag(0),t.setVideoMode(Ue),t.clear(r);let i=Dr(Ur,this).get(e);if(i){let e=i[0],r=i[1];r&&r.some((function(e,i){if(e===t)return r.splice(i,1),!0})),e.push(t)}}onRestoredFromContextLost(e,t,r,i,n){let a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:null,s=Dr(Ur,this).get(r);(!s||s.length<2)&&n("canvasRenderArray:".concat(s,", length:").concat(null==s?void 0:s.length));let o=a.get(t);if(o){o.reinit();for(let e=0;e<(null==s?void 0:s.length);e++)s[e].forEach((e=>{null==e||e.reinit({program:o.shaderProgram,contextgl:o.contextGL,vBuffer:o.vertexPosBuffer,tBuffer:o.texturePosBuffer,waterMarkTextureRef:o.waterMarkTextureRef,repeatedWaterMarkTextureRef:o.repeatedWaterMarkTextureRef})}));return r!==t&&(Dr(Ur,this).delete(r),Dr(Ur,this).set(t,s),a&&(a.delete(r),a.set(t,o))),null}}getRenderDisplayMap(){return Dr(Ur,this)}cleanup(e,t){var r;null==t||null===(r=t.cleanup)||void 0===r||r.call(t,null);for(const[e,t]of Dr(Ur,this)){const e=t[0],r=t[1];for(const t of e)t.cleanup();for(const e of r)e.cleanup()}Ir(Ur,this,new Map)}cleanupByCanvas(e){if(Dr(Ur,this).get(e)){let t=Dr(Ur,this).get(e);if(t){let r=t[0],i=t[1];i.forEach((function(e){var t;null==e||null===(t=e.cleanup)||void 0===t||t.call(e)})),r.forEach((function(e){var t;null==e||null===(t=e.cleanup)||void 0===t||t.call(e)})),r=[],i=[],Dr(Ur,this).delete(e)}}else{var t,r;null===(t=e.display)||void 0===t||null===(r=t.cleanup)||void 0===r||r.call(t)}}}function Br(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,i)}return r}function Nr(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Br(Object(r),!0).forEach((function(t){tt(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Br(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}let Gr=new Map,jr=[];function Hr(e){e.preventDefault()}function zr(e,t,r,i,n,a,s){let o=arguments.length>7&&void 0!==arguments[7]&&arguments[7];this.canvasElement=e,this.canvasID=t,this.contextOptions=n,this.textureindex=r||0,this.initmask=!!s,this.isEnableCanvasAlphaChannel=o,zr.prototype.ROTATION_CLOCK0=0,zr.prototype.ROTATION_CLOCK90=1,zr.prototype.ROTATION_CLOCK180=2,zr.prototype.ROTATION_CLOCK270=3,this.webGLResources=a,a||(this.initContextGL(),this.contextGL&&(this.webGLContextLostProtect(),this.contextGL.isContextLost()&&this.restoreContext())),this.webglVertexPos=[0,0,0,0],this.webglTexturePos=[0,0,0,0],this.vertexPos=[0,0,0,0],this.texturePos=[0,0,0,0],this.reinit(a);var l=new ArrayBuffer(4);this.dummpyCursor=new Uint8Array(l),this.dummpyWaterMark=new Uint8Array(l),this.cursorWidth=0,this.cursorHeight=0,this.hasCursor=0,this.lastcursorSyncId=-1,this.hasWaterMark=0,this.watermarkOpacity=.15,this.watermarkData=null,this.watermarkWidth=0,this.watermarkHeight=0,this.isMultiView=!1,this.hasWholeFrame=0,this.croppingParams={},this.croppingParams.top=0,this.croppingParams.left=0,this.croppingParams.width=0,this.croppingParams.height=0,this.textureWidth=0,this.textureHeight=0,this.viewWidth=0,this.viewHeight=0,this.picRotation=-1,this.bgColor=[0,0,0],this.cx=0,this.cy=0,this.cw=0,this.ch=0,this.colorRange=-1,this.videoMode=Ue,this.rotation=this.ROTATION_CLOCK0,this.fillMode=0,this.fillModeForResolution=0,this.viewPostion=null,this.enable_rounded_corner=0,this.radius_lt_x=0,this.radius_lt_y=0,this.radius_lb_x=0,this.radius_lb_y=0,this.radius_rt_x=0,this.radius_rt_y=0,this.radius_rb_x=0,this.radius_rb_y=0,this.aa_width=it,this.uv_rect=null}zr.prototype.isLocalDisplay=function(){return 0==this.textureindex},zr.prototype.reinit=function(e){if(this.webGLResources=e,!this.contextGL||this.contextGL.isContextLost()||this.contextGL.glInitSucceed||this.webGLResources){if(this.webGLResources&&this.webGLResources.contextgl&&!this.webGLResources.contextgl.isContextLost()){this.contextGL=this.webGLResources.contextgl,this.shaderProgram=this.webGLResources.program,this.vertexPosBuffer=this.webGLResources.vBuffer,this.texturePosBuffer=this.webGLResources.tBuffer,this.webglTexturePos=this.webGLResources.webglTexturePos,this.webglVertexPos=this.webGLResources.webglVertexPos,this.initTextures(!1);let e=this.contextGL.getError();this.contextGL.glInitSucceed=e!=this.contextGL.NO_ERROR&&e!=this.contextGL.CONTEXT_LOST_WEBGL?0:1}}else{this.initProgram(),this.initmask?this.initTextures(!1):this.initTextures(!0),this.initBuffers();let e=this.contextGL.getError();this.contextGL.glInitSucceed=e!=this.contextGL.NO_ERROR&&e!=this.contextGL.CONTEXT_LOST_WEBGL?0:1}},zr.prototype.webGLContextLostSimulate=function(){let e="undefined"==typeof window?self:window;e.webGLEXTSimulate=e.webGLEXTSimulate||[],e.webGLEXTSimulate.push(ge(this.contextGL,"WEBGL_lose_context"))},zr.prototype.restoreContext=function(){if(this.contextGL)try{var e;null!==(e=this.canvasElement)&&void 0!==e&&e.loseContextExtension&&!this.canvasElement.restoreTimeoutId&&this.contextGL.isContextLost()&&(this.canvasElement.restoreTimeoutId=setTimeout((()=>{this.canvasElement.reportcontextloss||(this.canvasElement.reportcontextloss=!0,ae("WebGL2RestoreTimeout")),this.canvasElement.restoreTimeoutId=0}),1500),this.canvasElement.loseContextExtension.restoreContext())}catch(e){re("webgl restoreContext exception2",e)}},zr.prototype.webgGLContextLostCallback=function(e){ne("webglcontextlost2 event: canvas listener size=".concat(jr.length,", canvas id: ").concat(this.canvasID,", , ids:").concat(jr.join())),e.preventDefault(),this.contextGL.glInitSucceed=0,this.contextOptions&&this.contextOptions.webglcontextlostCallback&&this.contextOptions.webglcontextlostCallback(e,this.contextOptions.params)},zr.prototype.removeEventListener=function(e,t){if(e&&t){e.restoreTimeoutId&&(clearTimeout(e.restoreTimeoutId),e.restoreTimeoutId=void 0),e.removeEventListener("webglcontextlost",t.contextLostHandler),e.removeEventListener("webglcontextrestored",t.contextRestoredHandler);const r=jr.indexOf(this.canvasID);jr.splice(r,1),Gr.delete(e)}},zr.prototype.webGLContextRestoredCallback=function(e){var t,r;ne("webglcontextrestored2 event from canvas id: ".concat(this.canvasID)),this.canvasElement.restoreTimeoutId&&(clearTimeout(this.canvasElement.restoreTimeoutId),this.canvasElement.restoreTimeoutId=void 0),this.webglVertexPos=[0,0,0,0],this.webglTexturePos=[0,0,0,0],this.reinit(),null===(t=this.contextOptions)||void 0===t||null===(r=t.webglcontextrestoredCallback)||void 0===r||r.call(t,e,this.contextOptions.params)},zr.prototype.webGLContextLostProtect=function(){this.canvasElement&&!this.canvasElement.loseContextExtension&&(this.canvasElement.loseContextExtension=ge(this.contextGL,"WEBGL_lose_context"));let e=this.canvasElement,t=Gr.get(e);t&&this.removeEventListener(e,t),Gr.set(e,this),this.contextLostHandler=this.webgGLContextLostCallback.bind(this),this.contextRestoredHandler=this.webGLContextRestoredCallback.bind(this),e.addEventListener("webglcontextlost",this.contextLostHandler,{capture:!1}),e.addEventListener("webglcontextrestored",this.contextRestoredHandler,{capture:!1}),-1===jr.indexOf(this.canvasID)&&(jr.push(this.canvasID),jr.length>4&&ne("webgl2canvas listener size=".concat(jr.length,", ids:").concat(jr.join())))},zr.prototype.isWebGL2=function(){return this.contextGL},zr.prototype.isAvaiable=function(){return this.contextGL&&!this.contextGL.isContextLost()&&this.contextGL.glInitSucceed},zr.prototype.initContextGL=function(){for(var e,t,r,i=this.canvasElement,n=null,a=["webgl2"],s=0;!n&&s<a.length;){var o=a[s];try{if(jt().config.isEnableCanvasCtxOptionsOpt()){let e={depth:!1,stencil:!1,antialias:!1,alpha:this.isEnableCanvasAlphaChannel};if(this.contextOptions){let t=Nr(Nr({},this.contextOptions),e);n=i.getContext(o,t)}else n=i.getContext(o,e)}else n=this.contextOptions?i.getContext(o,this.contextOptions):i.getContext(o)}catch(e){n=null}n&&"function"==typeof n.getParameter||(n=null),++s}if(this.contextGL=n,!n||n.isContextLost())return re("Failed when trying to get WebGLContext2 on canvas(".concat(null===(e=this.canvasElement)||void 0===e?void 0:e.width,",").concat(null===(t=this.canvasElement)||void 0===t?void 0:t.height,"), gl=").concat(n,", lost=").concat(null===(r=n)||void 0===r?void 0:r.isContextLost())),void ae("initWebGL2Fail");n.glInitSucceed=0},zr.prototype.initProgram=function(){var e=this.contextGL,t=e.createShader(e.VERTEX_SHADER);e.shaderSource(t,"#version 300 es\n in vec4 vertexPos;\n in vec4 texturePos;\n in vec4 masktexturePos;\n out vec2 textureCoord;\n out vec2 masktextureCoord;\n\n void main() {\n gl_Position = vertexPos;\n textureCoord = texturePos.xy;\n masktextureCoord = masktexturePos.xy;\n }\n "),e.compileShader(t),e.getShaderParameter(t,e.COMPILE_STATUS)||e.isContextLost()||ne("webgl2 Vertex shader failed to compile: "+e.getShaderInfoLog(t));var r=e.createShader(e.FRAGMENT_SHADER);e.shaderSource(r,"#version 300 es\n precision highp float;\n\n in highp vec2 textureCoord;\n in highp vec2 masktextureCoord;\n uniform sampler2D ySampler;\n uniform sampler2D uSampler;\n uniform sampler2D vSampler;\n uniform sampler2D cursorSampler;\n uniform sampler2D waterMarkSampler;\n uniform sampler2D previewVideoSampler;\n uniform sampler2D maskSampler;\n uniform vec4 cursorInfo;\n uniform int onlyRGBA;\n uniform int bgraMode;\n uniform int colorRange;\n uniform int waterMarkFlag;\n uniform int cursorFlag;\n uniform int maskFlag;\n uniform int yuvmode;\n\n // rounded corner feature in gl shader\n uniform float u_enable_rounded_corner;\n uniform float u_radius_lt_x;\n uniform float u_radius_lt_y;\n uniform float u_radius_lb_x;\n uniform float u_radius_lb_y;\n uniform float u_radius_rt_x;\n uniform float u_radius_rt_y;\n uniform float u_radius_rb_x;\n uniform float u_radius_rb_y;\n uniform float u_aa_width;\n uniform vec4 u_viewport_rect;\n\n const mat4 YUV2RGB_L = mat4(\n 1.1643828125, 0, 1.59602734375, -.87078515625,\n 1.1643828125, -.39176171875, -.81296875, .52959375,\n 1.1643828125, 2.017234375, 0, -1.081390625,\n 0, 0, 0, 1\n );\n\n const mat4 YUV2RGB_F = mat4(\n 1.0, 0, 1.402, -.701,\n 1.0, -.34413, -.71414, .529135,\n 1.0, 1.772, 0, -.886,\n 0, 0, 0, 1\n );\n\n out vec4 outputColor;\n\n void main(void) {\n vec4 c;\n if (waterMarkFlag != 1) {\n if (onlyRGBA == 0) {\n highp float y = texture(ySampler, textureCoord).r;\n highp float u;\n highp float v;\n if (yuvmode == 1) {\n u = texture(uSampler, textureCoord).r;\n v = texture(vSampler, textureCoord).r;\n } else {\n u = texture(uSampler, textureCoord).r;\n v = texture(uSampler, textureCoord).a;\n }\n\n if (colorRange == 0) {\n c = vec4(y, u, v, 1) * YUV2RGB_L;\n } else {\n c = vec4(y, u, v, 1) * YUV2RGB_F;\n }\n\n if (cursorFlag == 1) {\n if (cursorInfo.z > 0.0 && textureCoord.x >= cursorInfo.x && textureCoord.y >= cursorInfo.y &&\n textureCoord.x < cursorInfo.x+cursorInfo.z && textureCoord.y < cursorInfo.y+cursorInfo.w) {\n vec2 cursorCoord = textureCoord - cursorInfo.xy;\n cursorCoord /= cursorInfo.zw;\n vec4 cursor = texture(cursorSampler, cursorCoord);\n c = c*(1.0-cursor.a) + cursor*cursor.a;\n }\n }\n } else {\n c = texture(previewVideoSampler, textureCoord);\n if (bgraMode == 1) {\n c = vec4(c.b, c.g, c.r, c.a);\n }\n }\n }\n\n if (waterMarkFlag == 1) {\n c = texture(waterMarkSampler, textureCoord);\n if (c.r == 0.0 && c.g == 0.0 && c.b == 0.0) {\n c.a = 0.0;\n }\n }\n\n if (maskFlag == 1 && waterMarkFlag != 1) {\n vec4 mask = texture(maskSampler, masktextureCoord);\n if (mask.r != 0.0 || mask.g != 0.0 || mask.b != 0.0) {\n c = mask * mask.a + c * (1.0 - mask.a);\n }\n }\n\n if (waterMarkFlag != 1) {\n c.a = 1.0;\n }\n\n if (u_enable_rounded_corner < 0.5) {\n outputColor = c;\n return;\n }\n\n // step 1: viewport coordinate mapping\n // convert the fragment coordinate(canvas coordinate) to the viewport coordinate\n // for example, a viewport={x: 100, y: 100, w: 200, h: 160}, a fragCoord.xy={x:120, y: 120}\n // we can get the pos={x: 20, y: 20}\n vec2 pos = gl_FragCoord.xy - u_viewport_rect.xy;\n vec2 viewportSize = u_viewport_rect.zw;\n\n // convert the normalized radius to pixel value\n float r_lt_x = u_radius_lt_x * viewportSize.x;\n float r_lt_y = u_radius_lt_y * viewportSize.y;\n float r_rt_x = u_radius_rt_x * viewportSize.x;\n float r_rt_y = u_radius_rt_y * viewportSize.y;\n float r_lb_x = u_radius_lb_x * viewportSize.x;\n float r_lb_y = u_radius_lb_y * viewportSize.y;\n float r_rb_x = u_radius_rb_x * viewportSize.x;\n float r_rb_y = u_radius_rb_y * viewportSize.y;\n\n // step 2: calculate the rounded corner mask (as alpha)\n float alpha = 1.0;\n\n // --- calculation of the left-top corner ---\n // Condition: if (pos.x < r_lt_x && pos.y < r_lt_y)\n float in_lt = (1.0 - step(r_lt_x, pos.x)) * (1.0 - step(r_lt_y, pos.y));\n // the circle center of the left-top corner in pixel coordinate\n vec2 center_lt = vec2(r_lt_x, r_lt_y);\n // calculate and normalize the distance between the fragment and the center\n vec2 diff_lt = (pos - center_lt) / vec2(r_lt_x, r_lt_y);\n float normDist_lt = length(diff_lt);\n // smoothstep function is used to calculate the alpha value\n float mask_lt = 1.0 - smoothstep(1.0 - u_aa_width, 1.0, normDist_lt);\n float final_lt = mix(1.0, mask_lt, in_lt);\n\n // --- calculation of the right-top corner ---\n float in_rt = (1.0 - step(r_rt_x, viewportSize.x - pos.x)) * (1.0 - step(r_rt_y, pos.y));\n vec2 center_rt = vec2(viewportSize.x - r_rt_x, r_rt_y);\n vec2 diff_rt = (pos - center_rt) / vec2(r_rt_x, r_rt_y);\n float normDist_rt = length(diff_rt);\n float mask_rt = 1.0 - smoothstep(1.0 - u_aa_width, 1.0, normDist_rt);\n float final_rt = mix(1.0, mask_rt, in_rt);\n\n // --- calculation of the left-bottom corner ---\n float in_lb = (1.0 - step(r_lb_x, pos.x)) * (1.0 - step(r_lb_y, viewportSize.y - pos.y));\n vec2 center_lb = vec2(r_lb_x, viewportSize.y - r_lb_y);\n vec2 diff_lb = (pos - center_lb) / vec2(r_lb_x, r_lb_y);\n float normDist_lb = length(diff_lb);\n float mask_lb = 1.0 - smoothstep(1.0 - u_aa_width, 1.0, normDist_lb);\n float final_lb = mix(1.0, mask_lb, in_lb);\n\n // --- calculation of the right-bottom corner ---\n float in_rb = (1.0 - step(r_rb_x, viewportSize.x - pos.x)) * (1.0 - step(r_rb_y, viewportSize.y - pos.y));\n vec2 center_rb = vec2(viewportSize.x - r_rb_x, viewportSize.y - r_rb_y);\n vec2 diff_rb = (pos - center_rb) / vec2(r_rb_x, r_rb_y);\n float normDist_rb = length(diff_rb);\n float mask_rb = 1.0 - smoothstep(1.0 - u_aa_width, 1.0, normDist_rb);\n float final_rb = mix(1.0, mask_rb, in_rb);\n\n // step 3: Get the minimum value from the four corners (to ensure that if any corner requires transparency it is applied)\n float finalAlpha = min(min(final_lt, final_rt), min(final_lb, final_rb));\n\n // step 4: Final output color\n outputColor = vec4(c.rgb, c.a * finalAlpha);\n }\n "),e.compileShader(r),e.getShaderParameter(r,e.COMPILE_STATUS)||e.isContextLost()||ne("webgl2 Fragment shader failed to compile: "+e.getShaderInfoLog(r));var i=e.createProgram();e.attachShader(i,t),e.attachShader(i,r),e.linkProgram(i),e.getProgramParameter(i,e.LINK_STATUS)||e.isContextLost()||ne("webgl2 Program failed to compile: "+e.getProgramInfoLog(i)),e.useProgram(i),this.shaderProgram=i},zr.prototype.initBuffers=function(){var e=this.contextGL,t=this.shaderProgram,r=e.createBuffer();e.bindBuffer(e.ARRAY_BUFFER,r),e.bufferData(e.ARRAY_BUFFER,new Float32Array([1,1,-1,1,1,-1,-1,-1,1,1,-1,1,1,-1,-1,-1]),e.STATIC_DRAW);var i=e.getAttribLocation(t,"vertexPos");e.enableVertexAttribArray(i),e.vertexAttribPointer(i,2,e.FLOAT,!1,0,0),this.vertexPosBuffer=r;var n=e.createBuffer();e.bindBuffer(e.ARRAY_BUFFER,n),e.bufferData(e.ARRAY_BUFFER,new Float32Array([1,0,0,0,1,1,0,1,1,0,0,0,1,1,0,1]),e.STATIC_DRAW);var a=e.getAttribLocation(t,"texturePos");if(e.enableVertexAttribArray(a),e.vertexAttribPointer(a,2,e.FLOAT,!1,0,0),this.initmask&&!this.masktexturePosBuffer){var s=e.createBuffer();e.bindBuffer(e.ARRAY_BUFFER,s),e.bufferData(e.ARRAY_BUFFER,new Float32Array([1,0,0,0,1,1,0,1]),e.STATIC_DRAW);var o=e.getAttribLocation(t,"masktexturePos");e.enableVertexAttribArray(o),e.vertexAttribPointer(o,2,e.FLOAT,!1,0,0),this.masktexturePosBuffer=s}this.texturePosBuffer=n},zr.prototype.initTextures=function(e){var t=this.contextGL,r=this.shaderProgram;t.pixelStorei(t.UNPACK_ALIGNMENT,1);var i=this.initTexture();this.yTextureRef=i,this.oyTextureRef=i;var n=this.initTexture();this.uTextureRef=n,this.ouTextureRef=n;var a=this.initTexture();this.vTextureRef=a,this.ovTextureRef=a,e&&this.BindTextures(We),this.waterMarkTextureRef=this.initTexture();var s=t.getUniformLocation(r,"waterMarkSampler");t.uniform1i(s,5),this.waterMarkSamplerRef=s;var o=this.initTexture(),l=t.getUniformLocation(r,"cursorSampler");if(t.uniform1i(l,4),this.cursorTextureRef=o,this.cursorSamplerRef=l,this.cursorInfoRef=t.getUniformLocation(r,"cursorInfo"),this.initmask){t.pixelStorei(t.UNPACK_FLIP_Y_WEBGL,1);var c=this.initTexture(),d=t.getUniformLocation(r,"maskSampler");t.uniform1i(d,4),this.maskTextureRef=c}this.colorRangeRef=t.getUniformLocation(r,"colorRange"),this.onlyRGBARef=t.getUniformLocation(r,"onlyRGBA"),this.bgraModeRef=t.getUniformLocation(r,"bgraMode"),this.waterMarkFlagRef=t.getUniformLocation(r,"waterMarkFlag"),this.maskFlagRef=t.getUniformLocation(r,"maskFlag"),this.cursorFlagRef=t.getUniformLocation(r,"cursorFlag"),this.yuvmodeRef=t.getUniformLocation(r,"yuvmode"),this.ul_enable_rounded_corner=t.getUniformLocation(r,"u_enable_rounded_corner"),this.ul_radius_lt_x=t.getUniformLocation(r,"u_radius_lt_x"),this.ul_radius_lt_y=t.getUniformLocation(r,"u_radius_lt_y"),this.ul_radius_lb_x=t.getUniformLocation(r,"u_radius_lb_x"),this.ul_radius_lb_y=t.getUniformLocation(r,"u_radius_lb_y"),this.ul_radius_rt_x=t.getUniformLocation(r,"u_radius_rt_x"),this.ul_radius_rt_y=t.getUniformLocation(r,"u_radius_rt_y"),this.ul_radius_rb_x=t.getUniformLocation(r,"u_radius_rb_x"),this.ul_radius_rb_y=t.getUniformLocation(r,"u_radius_rb_y"),this.ul_aa_width=t.getUniformLocation(r,"u_aa_width"),this.ul_viewport_rect=t.getUniformLocation(r,"u_viewport_rect")},zr.prototype.BindTextures=function(e){var t=this.contextGL,r=this.shaderProgram;if(t.pixelStorei(t.UNPACK_ALIGNMENT,1),t.activeTexture(t.TEXTURE0+0),t.bindTexture(t.TEXTURE_2D,this.yTextureRef),t.activeTexture(t.TEXTURE0+1),t.bindTexture(t.TEXTURE_2D,this.uTextureRef),t.activeTexture(t.TEXTURE0+2),t.bindTexture(t.TEXTURE_2D,this.vTextureRef),e==We){let e=t.getUniformLocation(r,"ySampler");t.uniform1i(e,0);let i=t.getUniformLocation(r,"uSampler");t.uniform1i(i,1);let n=t.getUniformLocation(r,"vSampler");t.uniform1i(n,2)}else if(this.isRGBAMode(e)){let e=t.getUniformLocation(r,"previewVideoSampler");t.uniform1i(e,0);let i=t.getUniformLocation(r,"ySampler");t.uniform1i(i,0);let n=t.getUniformLocation(r,"uSampler");t.uniform1i(n,0);let a=t.getUniformLocation(r,"vSampler");t.uniform1i(a,0)}else if(2==e){let e=t.getUniformLocation(r,"ySampler");t.uniform1i(e,0);let i=t.getUniformLocation(r,"uSampler");t.uniform1i(i,1);let n=t.getUniformLocation(r,"vSampler");t.uniform1i(n,0)}let i=t.getUniformLocation(r,"previewVideoSampler");t.uniform1i(i,0);let n=t.getUniformLocation(r,"maskSampler");this.initmask?(t.activeTexture(t.TEXTURE0+4),t.bindTexture(t.TEXTURE_2D,this.maskTextureRef),t.uniform1i(n,4)):t.uniform1i(n,0);let a=t.getUniformLocation(r,"cursorSampler");t.uniform1i(a,0);let s=t.getUniformLocation(this.shaderProgram,"waterMarkSampler");t.uniform1i(s,5)},zr.prototype.initTexture=function(){var e=this.contextGL,t=e.createTexture();return e.bindTexture(e.TEXTURE_2D,t),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),e.bindTexture(e.TEXTURE_2D,null),t},zr.prototype.clearDisplay=function(){var e=this.contextGL;e&&(e.clearColor(0,0,0,0),e.clear(e.COLOR_BUFFER_BIT))},zr.prototype.cleanup=function(){let e=this.canvasElement,t=Gr.get(e);if(t&&this.removeEventListener(e,t),e.defaultContextLostHandler||(e.defaultContextLostHandler=Hr,e.addEventListener("webglcontextlost",Hr,{capture:!1})),this.cleanupRoundedCornerRadius(),this.isAvaiable()){var r=this.contextGL;r.deleteProgram(this.program),r.activeTexture(r.TEXTURE0),r.bindTexture(r.TEXTURE_2D,null),r.activeTexture(r.TEXTURE1),r.bindTexture(r.TEXTURE_2D,null),r.activeTexture(r.TEXTURE2),r.bindTexture(r.TEXTURE_2D,null),r.activeTexture(r.TEXTURE3),r.bindTexture(r.TEXTURE_2D,null),r.activeTexture(r.TEXTURE4),r.bindTexture(r.TEXTURE_2D,null),r.activeTexture(r.TEXTURE5),r.bindTexture(r.TEXTURE_2D,null),r.deleteTexture(this.yTextureRef),r.deleteTexture(this.uTextureRef),r.deleteTexture(this.vTextureRef),r.deleteTexture(this.cursorTextureRef),r.deleteTexture(this.waterMarkTextureRef),r.bindBuffer(r.ARRAY_BUFFER,null),r.deleteBuffer(this.vertexPosBuffer),r.deleteBuffer(this.texturePosBuffer),this.maskTextureRef&&r.deleteTexture(this.maskTextureRef),this.masktexturePosBuffer&&r.deleteBuffer(this.masktexturePosBuffer),r.glInitSucceed=0}},zr.prototype.updateVertexInfoForSharing=function(){const[e,t,r,i]=this.vertexPos,n=this.webglVertexPos[0],a=this.webglVertexPos[3];if(e!=n||a!=i){this.webglVertexPos[0]=e,this.webglVertexPos[1]=t,this.webglVertexPos[2]=r,this.webglVertexPos[3]=i;var s=new Float32Array([r,t,e,t,r,i,e,i,1,1,-1,1,1,-1,-1,-1]),o=this.contextGL;o.bindBuffer(o.ARRAY_BUFFER,this.vertexPosBuffer),o.bufferData(o.ARRAY_BUFFER,s,o.DYNAMIC_DRAW)}},zr.prototype.updateTextureInfoForSharing=function(){const[e,t,r,i]=this.texturePos,n=this.webglTexturePos[0],a=this.webglTexturePos[3];if(e!=n||a!=i){this.webglTexturePos[0]=e,this.webglTexturePos[1]=t,this.webglTexturePos[2]=r,this.webglTexturePos[3]=i;var s=new Float32Array([r,t,e,t,r,i,e,i,1,0,0,0,1,1,0,1]),o=this.contextGL;o.bindBuffer(o.ARRAY_BUFFER,this.texturePosBuffer),o.bufferData(o.ARRAY_BUFFER,s,o.DYNAMIC_DRAW)}},zr.prototype.updateVertexInfoForMultiView=function(e,t,r,i,n){var a,s,o,l,c=this.contextGL;if(this.isUseFillMode({width:r,height:i,rotation:n}))a=0,s=0,o=1,l=1;else{var d=n==this.ROTATION_CLOCK90||n==this.ROTATION_CLOCK270?i:r,u=n==this.ROTATION_CLOCK90||n==this.ROTATION_CLOCK270?r:i,h=d/u*t;h>e?(a=0,o=1,l=1-(s=(t-u/d*e)/2/t)):(s=0,l=1,o=1-(a=(e-h)/2/e))}a=2*a-1,o=2*o-1,s=1-2*s,l=1-2*l;var _=new Float32Array([o,s,a,s,o,l,a,l,1,1,-1,1,1,-1,-1,-1]);this.viewPostion=_,c.bindBuffer(c.ARRAY_BUFFER,this.vertexPosBuffer),c.bufferData(c.ARRAY_BUFFER,_,c.DYNAMIC_DRAW)},zr.prototype.updateTextureInfoForMultiView=function(e,t,r,i,n,a,s){var o,l,c,d,u=this.contextGL;if(this.isUseFillMode({width:r.width,height:r.height,rotation:i})){const n=i==this.ROTATION_CLOCK90||i==this.ROTATION_CLOCK270?s/a:a/s,u=r.left||0,h=r.top||0;if(r.width/r.height>n){const i=r.height*n;o=h/t,l=(Math.round((r.width-i)/2)+u)/e,c=(h+r.height)/t,d=l+i/e}else{const i=r.width/n;c=(o=(Math.round((r.height-i)/2)+h)/t)+i/t,d=(l=u/e)+r.width/e}}else o=Yt(r.top/t,2),l=Yt(r.left/e,2),c=qt((r.top+r.height)/t,2),d=qt((r.width+r.left)/e,2);var h=[l,o,d,o,d,c,l,c];i==this.ROTATION_CLOCK90&&(h.unshift(h[6],h[7]),h=h.slice(0,8)),i==this.ROTATION_CLOCK180&&(h.unshift(h[4],h[5],h[6],h[7]),h=h.slice(0,8)),i==this.ROTATION_CLOCK270&&(h.push(h[0],h[1]),h=h.slice(2,10));var _=h[0],f=h[1];if(h[0]=h[2],h[1]=h[3],h[2]=_,h[3]=f,n)if(i==this.ROTATION_CLOCK90||i==this.ROTATION_CLOCK270){let e=h[1];h[1]=h[3],h[3]=e,e=h[5],h[5]=h[7],h[7]=e}else h[0]=1-h[0],h[2]=1-h[2],h[4]=1-h[4],h[6]=1-h[6];var p=new Float32Array([...h,1,0,0,0,1,1,0,1]);u.bindBuffer(u.ARRAY_BUFFER,this.texturePosBuffer),u.bufferData(u.ARRAY_BUFFER,p,u.DYNAMIC_DRAW)},zr.prototype.getViewPosition=function(){let e=[0,0,1,1];if(!this.viewPostion)return e;const t=this.viewPostion[0],r=this.viewPostion[1],i=this.viewPostion[2],n=this.viewPostion[5];return e[0]=(1-r)/2,e[1]=(1+i)/2,e[2]=(1-n)/2,e[3]=(1+t)/2,e},zr.prototype.drawNextOutputPictureFrame=function(e,t,r,i,n){let a=!(arguments.length>5&&void 0!==arguments[5])||arguments[5],s=arguments.length>6?arguments[6]:void 0,o=!(arguments.length>7&&void 0!==arguments[7])||arguments[7];if(!this.isAvaiable())return;var l=this.contextGL,c=this.yTextureRef,d=this.uTextureRef,u=this.vTextureRef;l.enable(l.BLEND),l.blendFunc(l.SRC_ALPHA,l.ONE_MINUS_SRC_ALPHA),n=n||this.ROTATION_CLOCK0;var h=(r=r||{top:0,left:0,width:e,height:t}).width!=this.croppingParams.width||r.height!=this.croppingParams.height,_=(r.top!=this.croppingParams.top||(r.left,this.croppingParams.left),s.width!=this.viewWidth||s.height!=this.viewHeight),f=(e!=this.textureWidth||this.textureHeight,n!=this.picRotation);(h||_||f)&&function(e,t,r,i,n){e.contextGL;let a=n.width,s=n.height;var o,l,c,d,u=i==e.ROTATION_CLOCK90||i==e.ROTATION_CLOCK270?r:t,h=i==e.ROTATION_CLOCK90||i==e.ROTATION_CLOCK270?t:r,_=u/h*s;_>a?(o=0,c=1,d=1-(l=(s-h/u*a)/2/s)):(l=0,d=1,c=1-(o=(a-_)/2/a)),o=parseFloat((2*o-1).toFixed(3)),c=parseFloat((2*c-1).toFixed(3)),l=parseFloat((1-2*l).toFixed(3)),d=parseFloat((1-2*d).toFixed(3)),e.vertexPos=[o,l,c,d]}(this,r.width,r.height,n,s),this.updateVertexInfoForSharing(),function(e,t,r,i,n){var a=i.top/r,s=i.left/t,o=(i.height+i.top)/r,l=(i.left+i.width)/t,c=[s,a,l,a,l,o,s,o];n==e.ROTATION_CLOCK90&&(c.unshift(c[6],c[7]),c=c.slice(0,8)),n==e.ROTATION_CLOCK180&&(c.unshift(c[4],c[5],c[6],c[7]),c=c.slice(0,8)),n==e.ROTATION_CLOCK270&&(c.push(c[0],c[1]),c=c.slice(2));var d=c[0],u=c[1];c[0]=c[2],c[1]=c[3],c[2]=d,c[3]=u;var h=new Float32Array([...c,1,0,0,0,1,1,0,1]),_=e.contextGL;_.bindBuffer(_.ARRAY_BUFFER,e.texturePosBuffer),_.bufferData(_.ARRAY_BUFFER,h,_.DYNAMIC_DRAW)}(this,e,t,r,n);let p=a?0:1;p!=this.colorRange&&(l.uniform1i(this.colorRangeRef,p),this.colorRange=p),l.viewport(s.x,s.y,s.width,s.height),this.viewport_rect||(this.viewport_rect=new Float32Array(4)),this.viewport_rect.set([s.x,s.y,s.width,s.height],0),l.uniform4fv(this.ul_viewport_rect,this.viewport_rect),l.uniform1i(this.onlyRGBARef,0),l.uniform1i(this.yuvmodeRef,We),Object.assign(this.croppingParams,r),this.textureWidth=e,this.textureHeight=t,this.picRotation=n,this.viewWidth=s.width,this.viewHeight=s.height;var m=i,g=e*t;if(l.activeTexture(l.TEXTURE0),l.bindTexture(l.TEXTURE_2D,c),o){var v=m.subarray(0,g);l.texImage2D(l.TEXTURE_2D,0,l.LUMINANCE,e,t,0,l.LUMINANCE,l.UNSIGNED_BYTE,v)}var y=e/2*t/2;if(l.activeTexture(l.TEXTURE1),l.bindTexture(l.TEXTURE_2D,d),o){var b=m.subarray(g,g+y);l.texImage2D(l.TEXTURE_2D,0,l.LUMINANCE,e/2,t/2,0,l.LUMINANCE,l.UNSIGNED_BYTE,b)}var w=y;if(l.activeTexture(l.TEXTURE2),l.bindTexture(l.TEXTURE_2D,u),o){var S=m.subarray(g+y,g+y+w);l.texImage2D(l.TEXTURE_2D,0,l.LUMINANCE,e/2,t/2,0,l.LUMINANCE,l.UNSIGNED_BYTE,S)}l.activeTexture(l.TEXTURE0+4),l.bindTexture(l.TEXTURE_2D,this.cursorTextureRef),l.uniform1i(this.cursorSamplerRef,4),this.hasCursor?l.uniform1i(this.cursorFlagRef,1):o&&l.texImage2D(l.TEXTURE_2D,0,l.RGBA,1,1,0,l.RGBA,l.UNSIGNED_BYTE,this.dummpyCursor),l.uniform4f(this.cursorInfoRef,this.cx,this.cy,this.cw,this.ch),this.render(),this.hasWholeFrame=1},zr.prototype.updateCursor=function(e,t,r,i){if(this.isAvaiable()){var n=this.contextGL;e<=0||t<=0||!r||r.length!=e*t*4||i!=this.lastcursorSyncId&&(this.lastcursorSyncId=i,n.activeTexture(n.TEXTURE0+4),n.bindTexture(n.TEXTURE_2D,this.cursorTextureRef),n.texImage2D(n.TEXTURE_2D,0,n.RGBA,e,t,0,n.RGBA,n.UNSIGNED_BYTE,r),this.cursorWidth=e,this.cursorHeight=t,this.hasCursor=1)}},zr.prototype.updateCursorPosInfo=function(e,t,r,i,n){if(e&&this.hasCursor){let e=t/this.croppingParams.width,a=r/this.croppingParams.height,s=i/this.croppingParams.width,o=n/this.croppingParams.height;this.cx=e,this.cy=a,this.cw=s,this.ch=o}else this.cx=0,this.cy=0,this.cw=0,this.ch=0},zr.prototype.isHasWholeFrame=function(){return this.hasWholeFrame},zr.prototype.updateWatermark=function(e,t,r){if(this.isAvaiable()){var i=this.contextGL;e<=0||t<=0||!r||r.length!=e*t*4||(this.hasWaterMark=1,this.watermarkWidth=e,this.watermarkHeight=t,i.activeTexture(i.TEXTURE0+5),i.bindTexture(i.TEXTURE_2D,this.waterMarkTextureRef),i.texImage2D(i.TEXTURE_2D,0,i.RGBA,this.watermarkWidth,this.watermarkHeight,0,i.RGBA,i.UNSIGNED_BYTE,r))}},zr.prototype.drawWatermark=function(){if(this.isAvaiable()){var e=this.contextGL;this.isSetWatermark()&&this.watermarkWidth&&this.watermarkHeight&&(e.uniform1i(this.waterMarkFlagRef,1),e.activeTexture(e.TEXTURE0+5),e.bindTexture(e.TEXTURE_2D,this.waterMarkTextureRef),e.enable(e.BLEND),e.blendFunc(e.SRC_ALPHA,e.ONE_MINUS_SRC_ALPHA),e.drawArrays(e.TRIANGLE_STRIP,4,4))}},zr.prototype.drawRoundedCorner=function(){if(this.isAvaiable()){var e=this.contextGL;e.enable(e.BLEND),e.blendFunc(e.SRC_ALPHA,e.ONE_MINUS_SRC_ALPHA),e.uniform1f(this.ul_enable_rounded_corner,this.enable_rounded_corner),e.uniform1f(this.ul_radius_lt_x,this.radius_lt_x),e.uniform1f(this.ul_radius_lt_y,this.radius_lt_y),e.uniform1f(this.ul_radius_lb_x,this.radius_lb_x),e.uniform1f(this.ul_radius_lb_y,this.radius_lb_y),e.uniform1f(this.ul_radius_rt_x,this.radius_rt_x),e.uniform1f(this.ul_radius_rt_y,this.radius_rt_y),e.uniform1f(this.ul_radius_rb_x,this.radius_rb_x),e.uniform1f(this.ul_radius_rb_y,this.radius_rb_y),e.uniform1f(this.ul_aa_width,this.aa_width)}},zr.prototype.cleanupRoundedCornerRadius=function(){this.enable_rounded_corner=0,this.radius_lt_x=0,this.radius_lt_y=0,this.radius_lb_x=0,this.radius_lb_y=0,this.radius_rt_x=0,this.radius_rt_y=0,this.radius_rb_x=0,this.radius_rb_y=0,this.aa_width=it,this.viewport_rect=null},zr.prototype.render=function(){if(this.isAvaiable()){var e=this.contextGL;this.drawRoundedCorner(),e.uniform1i(this.waterMarkFlagRef,0),e.drawArrays(e.TRIANGLE_STRIP,0,4),this.drawWatermark()}},zr.prototype.clear=function(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.hasCursor=0,this.watermarkHeight=0,this.watermarkWidth=0,this.watermarkRepeated=!1,this.hasWholeFrame=0,this.lastcursorSyncId=-1,this.cleanupRoundedCornerRadius(),e&&this.clearCanvas({R:0,G:0,B:0,A:0})},zr.prototype.clearCanvas=function(e){if(this.cleanupRoundedCornerRadius(),this.isAvaiable()){var t=this.contextGL;e?t.clearColor(e.R,e.G,e.B,e.A):t.clearColor(this.bgColor[0],this.bgColor[1],this.bgColor[2],255),t.clear(t.COLOR_BUFFER_BIT)}},zr.prototype.isRGBAMode=function(e){return-1!==[Ve,Be].indexOf(e)},zr.prototype.updateRemoteVideoTextures=function(e,t,r,i,n){let a=!(arguments.length>5&&void 0!==arguments[5])||arguments[5],s=arguments.length>6?arguments[6]:void 0,o=!(arguments.length>8&&void 0!==arguments[8])||arguments[8];if(!this.isAvaiable())return;var l=this.contextGL,c=this.yTextureRef,d=this.uTextureRef,u=this.vTextureRef;l.enable(l.BLEND),l.blendFunc(l.SRC_ALPHA,l.ONE_MINUS_SRC_ALPHA);const h=this.isRGBAMode(this.videoMode);if(e<=0||t<=0||!i||!i.length||i.length!=e*t*3/2&&!h||r&&(r.top<0||r.left<0||r.left+r.width>e||r.top+r.height>t))return!1;let _=a?0:1;if(this.colorRange=_,this.rotation=n,Object.assign(this.croppingParams,r),this.textureWidth=e,this.textureHeight=t,this.viewWidth=s.width,this.viewHeight=s.height,!o)return;if(l.bindTexture(l.TEXTURE_2D,c),h)return void l.texImage2D(l.TEXTURE_2D,0,l.RGBA,e,t,0,l.RGBA,l.UNSIGNED_BYTE,i);var f=i,p=e*t,m=f.subarray(0,p);l.texImage2D(l.TEXTURE_2D,0,l.LUMINANCE,e,t,0,l.LUMINANCE,l.UNSIGNED_BYTE,m);let g=0,v=0;this.videoMode==We?(g=e/2*t/2,v=g):2==this.videoMode&&(g=e*t/2,v=0);var y=f.subarray(p,p+g);if(l.bindTexture(l.TEXTURE_2D,d),v){l.texImage2D(l.TEXTURE_2D,0,l.LUMINANCE,e/2,t/2,0,l.LUMINANCE,l.UNSIGNED_BYTE,y);var b=f.subarray(p+g,p+g+v);l.bindTexture(l.TEXTURE_2D,u),l.texImage2D(l.TEXTURE_2D,0,l.LUMINANCE,e/2,t/2,0,l.LUMINANCE,l.UNSIGNED_BYTE,b)}else l.texImage2D(l.TEXTURE_2D,0,l.LUMINANCE_ALPHA,e/2,t/2,0,l.LUMINANCE_ALPHA,l.UNSIGNED_BYTE,y);return!0},zr.prototype.updateRemoteVideoTexturesImageBitmap=function(e,t,r,i,n){let a=!(arguments.length>5&&void 0!==arguments[5])||arguments[5];if(e<=0||t<=0||!r)return;if(!this.isAvaiable())return;var s=this.contextGL;if(this.textureWidth=e,this.textureHeight=t,Number.isNaN(n)||(this.rotation=n),Object.assign(this.croppingParams,i),!a)return;s.bindTexture(s.TEXTURE_2D,this.yTextureRef);const o=s.RGBA,l=s.RGBA,c=s.UNSIGNED_BYTE;s.texImage2D(s.TEXTURE_2D,0,o,l,c,r)},zr.prototype.updateSelfMaskImage=function(e,t,r){if(!(e<=0||t<=0)&&r&&r.length==e*t*4&&this.isAvaiable()){var i=this.contextGL;i.bindTexture(i.TEXTURE_2D,this.maskTextureRef),i.texImage2D(i.TEXTURE_2D,0,i.RGBA,e,t,0,i.RGBA,i.UNSIGNED_BYTE,r)}},zr.prototype.VideoFlip=function(){if(this.isAvaiable()){var e=this.contextGL;e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,1)}},zr.prototype.drawRemoteVideo=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!this.isAvaiable())return;var r=this.contextGL;let i=this.isRGBAMode(this.videoMode)?1:0;r.uniform1i(this.colorRangeRef,this.colorRange),this.setUniformFlag(i,this.hasCursor,this.videoMode),this.initmask&&r.uniform1i(this.maskFlagRef,1),this.updateTextureInfoForMultiView(this.textureWidth,this.textureHeight,this.croppingParams,this.rotation,t,e.width,e.height),r.viewport(e.x,e.y,e.width,e.height),this.viewport_rect||(this.viewport_rect=new Float32Array(4)),this.viewport_rect.set([e.x,e.y,e.width,e.height],0),r.uniform4fv(this.ul_viewport_rect,this.viewport_rect),this.updateVertexInfoForMultiView(e.width,e.height,this.croppingParams.width,this.croppingParams.height,this.rotation),this.BindTextures(this.videoMode),r.enable(r.BLEND),r.blendFunc(r.SRC_ALPHA,r.ONE_MINUS_SRC_ALPHA),this.render()},zr.prototype.readPixelsSyncRequest=function(e,t,r,i){if(this.isAvaiable()){var n,a=this.contextGL;return this.destination&&this.destination.length==r*i*4||(this.destination=new Uint8Array(r*i*4)),n=this.destination,a.flush(),a.readPixels(e,t,r,i,a.RGBA,a.UNSIGNED_BYTE,n),n}},zr.prototype.updateSelfVideoTextures=function(e,t,r,i){let n=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0;if(!(e<=0||t<=0)&&r&&r.length%4==0&&this.isAvaiable()){var s=this.contextGL;this.textureWidth=e,this.textureHeight=t,this.rotation=a,Object.assign(this.croppingParams,i),n&&(s.bindTexture(s.TEXTURE_2D,this.yTextureRef),s.texImage2D(s.TEXTURE_2D,0,s.RGBA,e,t,0,s.RGBA,s.UNSIGNED_BYTE,r))}},zr.prototype.drawSelfVideo=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(this.isAvaiable()){var i=this.contextGL;this.setUniformFlag(1,this.hasCursor,this.videoMode),this.updateTextureInfoForMultiView(this.textureWidth,this.textureHeight,this.croppingParams,this.rotation,r,e.width,e.height),i.viewport(e.x,e.y,e.width,e.height),this.viewport_rect||(this.viewport_rect=new Float32Array(4)),this.viewport_rect.set([e.x,e.y,e.width,e.height],0),i.uniform4fv(this.ul_viewport_rect,this.viewport_rect),t?(i.enable(i.BLEND),i.blendFunc(i.ZERO,i.ZERO),this.updateVertexInfoForMultiView(e.width,e.height,e.width,e.height,this.ROTATION_CLOCK0)):(i.enable(i.BLEND),i.blendFunc(i.SRC_ALPHA,i.ONE_MINUS_SRC_ALPHA),this.updateVertexInfoForMultiView(e.width,e.height,this.croppingParams.width,this.croppingParams.height,this.rotation)),this.BindTextures(Ve),this.render()}},zr.prototype.isSetWatermark=function(){return this.hasWaterMark},zr.prototype.setWatermarkFlag=function(e){this.hasWaterMark=e,e||(this.setWatermarkRepeated(!1),this.setWatermarkOpacity(),this.setWatermarkPosition(16))},zr.prototype.setUniformFlag=function(e,t,r){if(this.isAvaiable()){var i=this.contextGL;i.uniform1i(this.onlyRGBARef,e),i.uniform1i(this.bgraModeRef,e&&r===Be?1:0),i.uniform1i(this.cursorFlagRef,t),e||i.uniform1i(this.yuvmodeRef,r)}},zr.prototype.setVideoMode=function(e){this.videoMode=e},zr.prototype.getVideoMode=function(e){return this.videoMode},zr.prototype.setWatermarkRepeated=function(e){this.watermarkRepeated=e},zr.prototype.isWatermarkRepeated=function(){return!!this.watermarkRepeated},zr.prototype.setWatermarkOpacity=function(e){this.watermarkOpacity=e||.15},zr.prototype.getWatermarkOpacity=function(){return this.watermarkOpacity},zr.prototype.setWatermarkPosition=function(e){this.watermarkPosition=e||16},zr.prototype.getWatermarkPosition=function(){return this.watermarkPosition},zr.prototype.setMultiView=function(e){return this.isMultiView=e},zr.prototype.getRepeatedWatermarkUniformValue=function(){return this.isMultiView?30:7},zr.prototype.getRepeatedWatermarkTextureValue=function(e){return this.isMultiView?e.TEXTURE30:e.TEXTURE7},zr.prototype.setFillMode=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;this.fillMode=e,this.fillModeForResolution=t},zr.prototype.getFillMode=function(){return this.fillMode},zr.prototype.getFillModeForResolution=function(){return this.fillModeForResolution},zr.prototype.getTextureIndex=function(){return this.textureindex},zr.prototype.getIndex=function(){return this.textureindex},zr.prototype.getWatermarkWidth=function(){return this.watermarkWidth},zr.prototype.getWatermarkHeight=function(){return this.watermarkHeight},zr.prototype.getTextureWidth=function(){return this.textureWidth},zr.prototype.getTextureHeight=function(){return this.textureHeight},zr.prototype.getRotation=function(){return this.rotation},zr.prototype.getCroppingParams=function(){return this.croppingParams},zr.prototype.getWatermarkOpacity=function(){return this.watermarkOpacity},zr.prototype.getAttachedCanvas=function(){return this.canvasElement},zr.prototype.getCanvasId=function(){return this.canvasID},zr.prototype.resizeCanvasTo=function(e,t){this.contextGL.canvas.width=e,this.contextGL.canvas.height=t},zr.prototype.isUseFillMode=function(e){let{width:t,height:r,rotation:i}=e;if(!this.fillMode)return!1;if(!this.fillModeForResolution)return!0;if(!t||!r)return!1;const n=i===this.ROTATION_CLOCK90||i==this.ROTATION_CLOCK270?r/t:t/r;return(Array.isArray(this.fillModeForResolution)?this.fillModeForResolution:[this.fillModeForResolution]).some((e=>Math.abs(n-e)<.01))},zr.prototype.setRoundedCornerRadius=function(e){e?(this.radius_lt_x=e.radius_lt_x,this.radius_lt_y=e.radius_lt_y,this.radius_lb_x=e.radius_lb_x,this.radius_lb_y=e.radius_lb_y,this.radius_rt_x=e.radius_rt_x,this.radius_rt_y=e.radius_rt_y,this.radius_rb_x=e.radius_rb_x,this.radius_rb_y=e.radius_rb_y,0===this.radius_lt_x&&0===this.radius_lt_y&&0===this.radius_lb_x&&0===this.radius_lb_y&&0===this.radius_rt_x&&0===this.radius_rt_y&&0===this.radius_rb_x&&0===this.radius_rb_y?this.enable_rounded_corner=0:this.enable_rounded_corner=1):this.enable_rounded_corner=0},zr.prototype.setAntialiasWidth=function(e){(e<=0||e>=1)&&(e=it),this.aa_width=e};const qr=zr;function Yr(e,t,r){(function(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")})(e,t),t.set(e,r)}function Xr(e,t){return e.get(Qr(e,t))}function Kr(e,t,r){return e.set(Qr(e,t),r),r}function Qr(e,t,r){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:r;throw new TypeError("Private element is not present on this object")}var $r=new WeakMap,Jr=new WeakMap;class Zr extends Pr{constructor(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];super(),Yr(this,$r,new Map),Yr(this,Jr,!1),Kr(Jr,this,e)}setCanvasAlphaChannelEnability(e){Kr(Jr,this,e)}createVideoRenderDisplay(e,t,r){let i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null,n=null,a=null,s=null,o=!1;return i&&(n=i.forceNoGL,a=i.contextOptions,s=i.webGLResources,o=i.initMask),new qr(e,t,r,n,a,s,o,Xr(Jr,this))}getVideoRenderDisplay(e,t,r,i){let n=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null,a=Xr($r,this).get(e);if(!a){let i=[];a=[i,[]],Xr($r,this).set(e,a);let s=new qr(e,t,0,void 0,void 0,void 0,void 0,Xr(Jr,this));s.setMultiView(!0),n&&n.set(e,s);let o=1;for(;o<=r;o++){const r=new qr(e,t,o,void 0,void 0,{program:s.shaderProgram,contextgl:s.contextGL,vBuffer:s.vertexPosBuffer,tBuffer:s.texturePosBuffer,waterMarkTextureRef:s.waterMarkTextureRef,repeatedWaterMarkTextureRef:s.repeatedWaterMarkTextureRef},void 0,void 0,Xr(Jr,this));r.setMultiView(!0),i.push(r)}}let s,o=Xr($r,this).get(e),l=o[0],c=o[1];if(o&&l[0]&&(s=l.pop(),c.push(s)),!s){const e=o?"".concat(o.length):"undefined",t=l?"".concat(l.length):"undefined";i("No Display obtained from VideoRender.Get_Display. canvasRenderArray:".concat(e," unusedRenderArray:").concat(t))}return s}onWebglContextLostForMulti(e,t){const{canvas:r}=t;let i=Xr($r,this).get(r);var[n,a,s]=i;[...n,...a].forEach((e=>e.clear()))}onRestoredFromLostForMulti(e,t){if(!t)return;const{canvas:r}=t;let i=Xr($r,this).get(r);var[n,a,s]=i;const o=[...n,...a];let l=o.find((e=>e.isLocalDisplay()));l.webglVertexPos=[0,0,0,0],l.webglTexturePos=[0,0,0,0],s.args={program:l.shaderProgram,contextgl:l.contextGL,vBuffer:l.vertexPosBuffer,tBuffer:l.texturePosBuffer,webglVertexPos:l.webglVertexPos,webglTexturePos:l.webglTexturePos},o.forEach((e=>{e!=l&&e.reinit(s.args)}))}getRenderDisplay(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,i=Xr($r,this).get(e);if(!i){let n=[],a={canvasId:t,size:1,args:{}};i=[n,[],a],Xr($r,this).set(e,i);const s={webglcontextlostCallback:this.onWebglContextLostForMulti.bind(this),webglcontextrestoredCallback:this.onRestoredFromLostForMulti.bind(this),params:{canvas:e,rendercanvasID:t}};let o=new qr(e,t,0,void 0,s,void 0,void 0,Xr(Jr,this));r&&r.set(e,o),n.push(o),a.args={program:o.shaderProgram,contextgl:o.contextGL,vBuffer:o.vertexPosBuffer,tBuffer:o.texturePosBuffer,webglVertexPos:o.webglVertexPos,webglTexturePos:o.webglTexturePos}}if(!i[0].length){const r=new qr(e,t,i[2].size,void 0,void 0,i[2].args,void 0,Xr(Jr,this));i[2].size++,i[0].push(r)}let n=i[0].pop();return i[1].push(n),n}recycleRenderDisplay(e,t,r){t.setWatermarkFlag(0),t.setVideoMode(Ue),t.clear(r);let i=Xr($r,this).get(e);if(i){let e=i[0],r=i[1];r&&r.some((function(e,i){if(e===t)return r.splice(i,1),!0})),e.push(t)}}onRestoredFromContextLost(e,t,r,i,n){let a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:null,s=Xr($r,this).get(r);(!s||s.length<2)&&n("canvasRenderArray:".concat(s,", length:").concat(null==s?void 0:s.length));let o=a.get(t);if(o){o.reinit();for(let e=0;e<(null==s?void 0:s.length);e++)s[e].forEach((e=>{null==e||e.reinit({program:o.shaderProgram,contextgl:o.contextGL,vBuffer:o.vertexPosBuffer,tBuffer:o.texturePosBuffer,waterMarkTextureRef:o.waterMarkTextureRef,repeatedWaterMarkTextureRef:o.repeatedWaterMarkTextureRef})}));return r!==t&&(Xr($r,this).delete(r),Xr($r,this).set(t,s),a&&(a.delete(r),a.set(t,o))),null}}getRenderDisplayMap(){return Xr($r,this)}cleanup(e,t){var r;null==t||null===(r=t.cleanup)||void 0===r||r.call(t);for(const[e,t]of Xr($r,this)){const e=t[0],r=t[1];for(const t of e)t.cleanup();for(const e of r)e.cleanup()}Kr($r,this,new Map)}cleanupByCanvas(e){if(Xr($r,this).get(e)){let t=Xr($r,this).get(e);if(t){let r=t[0],i=t[1];i.forEach((function(e){var t;null==e||null===(t=e.cleanup)||void 0===t||t.call(e)})),r.forEach((function(e){var t;null==e||null===(t=e.cleanup)||void 0===t||t.call(e)})),r=[],i=[],Xr($r,this).delete(e)}}else{var t,r;null===(t=e.display)||void 0===t||null===(r=t.cleanup)||void 0===r||r.call(t)}}}function ei(e,t,r){(function(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")})(e,t),t.set(e,r)}function ti(e,t){return e.get(ii(e,t))}function ri(e,t,r){return e.set(ii(e,t),r),r}function ii(e,t,r){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:r;throw new TypeError("Private element is not present on this object")}var ni=new WeakMap,ai=new WeakMap,si=new WeakMap,oi=new WeakMap,li=new WeakMap;const ci=class{constructor(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];ei(this,ni,null),ei(this,ai,null),ei(this,si,null),ei(this,oi,null),ei(this,li,!1),ri(li,this,e)}setGPUResourceMgrGetter(e){ri(oi,this,e)}isEnableCanvasAlphaChannel(){return ti(li,this)}setCanvasAlphaChannelEnability(e){ri(li,this,e),ti(ni,this)&&ti(ni,this).setCanvasAlphaChannelEnability(e),ti(ai,this)&&ti(ai,this).setCanvasAlphaChannelEnability(e)}getWebGLRenderDisplayMgr(){return ti(ni,this)||(ri(ni,this,new Wr(ti(li,this))),te("[Render] getWebGLRenderDisplayMgr")),ti(ni,this)}getWebGL2RenderDisplayMgr(){return ti(ai,this)||ri(ai,this,new Zr(ti(li,this))),ti(ai,this)}getWebGPURenderDisplayMgr(){if(!ti(si,this)){const e=rr.getModule("webgpu_renderer_dynmod");ri(si,this,e.exports.createWebGPURenderDisplayMgr()),ti(si,this).setGPUResourceMgrGetter(ti(oi,this).call(this,2))}return ti(si,this)}getRenderDisplayMgr(e){switch(e){case 1:return this.getWebGLRenderDisplayMgr();case 3:return this.getWebGL2RenderDisplayMgr();case 2:return this.getWebGPURenderDisplayMgr();case 4:return zt("VIDEO_TAG has no RenderDisplayMgr!"),null;default:return null}}getVideoRenderDisplay(e,t,r,i,n){let a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:null,s=arguments.length>6&&void 0!==arguments[6]?arguments[6]:null,o=this.getRenderDisplayMgr(e).getVideoRenderDisplay(t,r,i,n,s);return o&&2===e&&(o.addRenderer(a),o.attachCanvas(t,r),o.setGPUResMgr(ti(oi,this).call(this,e))),o}getRenderDisplay(e,t,r){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,n=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null,a=this.getRenderDisplayMgr(e).getRenderDisplay(t,r,n);return a&&2===e&&(a.addRenderer(i),a.attachCanvas(t,r),a.setGPUResMgr(ti(oi,this).call(this,e))),a}createVideoRenderDisplay(e,t,r,i){let n=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null,a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:null,s=this.getRenderDisplayMgr(e).createVideoRenderDisplay(t,r,i,n,a);return s&&2===e&&(s.addRenderer(n),s.attachCanvas(t,r),s.setGPUResMgr(ti(oi,this).call(this,e))),s}recycleRenderDisplay(e,t,r,i){let n=!(arguments.length>4&&void 0!==arguments[4])||arguments[4];switch(e){case 2:ti(si,this)&&ti(si,this).recycleRenderDisplay(r,i,n);break;case 1:ti(ni,this)&&ti(ni,this).recycleRenderDisplay(t,r,n);break;case 3:ti(ai,this)&&ti(ai,this).recycleRenderDisplay(t,r,n);break;case 4:zt("VIDEO_TAG has no display")}}collectInUseRenderDisplays(e,t){let r=null;return 2===e&&ti(si,this)&&(r=ti(si,this).collectInUseRenderDisplays(t)),r}collectInUseRenderDisplaysByCanvas(e,t,r){let i=null;return 2===e&&ti(si,this)&&(i=ti(si,this).collectInUseRenderDisplaysByCanvas(t,r)),i}getRenderDisplayMap(e,t){if(1===e){if(ti(ni,this))return ti(ni,this).getRenderDisplayMap()}else if(2===e){if(ti(si,this))return ti(si,this).getRenderDisplayMap(t)}else if(3===e&&ti(ai,this))return ti(ai,this).getRenderDisplayMap(t);return null}onRestoredFromContextLost(e,t,r,i,n){let a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:null;return ti(ni,this)?ti(ni,this).onRestoredFromContextLost(e,t,r,i,n,a):ti(ai,this)?ti(ai,this).onRestoredFromContextLost(e,t,r,i,n,a):null}cleanup(e,t){let r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];null!==ti(ni,this)&&ti(ni,this).cleanup(e,t),ti(ai,this)&&ti(ai,this).cleanup(e,t),null!==ti(si,this)&&ti(si,this).cleanup(t,r)}cleanupByCanvas(e){null!==ti(ni,this)&&ti(ni,this).cleanupByCanvas(e),null!==ti(ai,this)&&ti(ai,this).cleanupByCanvas(e),null!==ti(si,this)&&ti(si,this).cleanupByCanvas(e)}};function di(e,t,r){(function(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")})(e,t),t.set(e,r)}function ui(e,t){return e.get(_i(e,t))}function hi(e,t,r){return e.set(_i(e,t),r),r}function _i(e,t,r){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:r;throw new TypeError("Private element is not present on this object")}var fi=new WeakMap,pi=new WeakMap,mi=new WeakMap,gi=new WeakMap,vi=new WeakMap;var yi=r(7201),bi=r.n(yi);function wi(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 Ot({tag:"jitter",interval:3e4,reportcallback:this._qos_report_timeout.bind(this)}),this._qos_report_samples=[],this._cureen_qos_report=0}wi.prototype._qos_report_timeout=function(e,t,r,i){if(this._customer_callback){let n="".concat(e,",").concat(t,",").concat(r,",").concat(i);this._customer_callback(this._tag+"TimeOut",n)}},wi.prototype._report=function(){let e=(new Date).getTime(),t="".concat(e,"-").concat(this._samples.length,"-").concat(this._samples),r="".concat(e,"-").concat(this._qos_report_samples.length,"-").concat(this._qos_report_samples);t=bi()(t).call(t,",","|"),r=bi()(r).call(r,",","|"),this._customer_callback?(this._customer_callback(this._tag,t),this._enable_advanced&&this._customer_callback(this._tag+"QOS",r)):console.error("tag:".concat(this._tag,",").concat(t))},wi.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=[])},wi.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)},wi.prototype.stop=function(){this._enable&&(clearInterval(this._interval_id),this._interval_id=0,this._enable=!1)},wi.prototype.sample=function(e){if(this._enable&&(this._current_count++,this._enable_advanced)){if(Lt(e))return void this._cureen_qos_report++;if(It(e)){let t=Dt(e),r=performance.now();if(this._lasted_qos_ts){let e=r-this._lasted_sys_ts-(t-this._lasted_qos_ts);e>30&&this._qos_report.timeoutReport(e,r)}this._lasted_qos_ts=t,this._lasted_sys_ts=r,this._lasted_data=e}}};class Si{constructor(e,t){this.sendsize=0,this.dropsize=0,this.presamples={sendsize:0,drop:0,time:0,size:0,nosendcount:0,dckbps:0,updatetime:0,smoothsend:0},this.channel=t,this.id=0,this.wraper=e,this.overusetime=0}send(e){this.sendsize+=e}drop(e){this.dropsize+=e}setbuffer(e){const t=performance.now(),{sendsize:r,drop:i,size:n,time:a}=this.presamples,s=t-a,o=this.sendsize-r,l=this.dropsize-i,c=e-n;if(s>150&&o>5e3){const r=100*l/o,i=8e3*(o-l-c)/(s*(this.presamples.nosendcount+1)),n=8e3*o/s,a=8e3*(e+l+Math.max(c/2,0)),d=0==i?5e3:a/i;if(0==i?this.presamples.nosendcount++:(this.presamples.nosendcount=0,this.presamples.dckbps=i),0==this.presamples.smoothsend)this.presamples.smoothsend=n;else{const e=.5;this.presamples.smoothsend=e*this.presamples.smoothsend+n*(1-e)}r>10&&e>16384||s<500&&d>500?0==this.overusetime?this.overusetime=Math.min(250,s)/2:this.overusetime+=Math.min(250,s):e<16384&&d<100&&(this.overusetime=0);const u=i||this.presamples.dckbps/(this.presamples.nosendcount+1),h=u/this.presamples.smoothsend;if(this.overusetime>700&&h<.75&&t>this.presamples.updatetime+3e3){const e={status:1,dckbps:u,sendkbps:this.presamples.smoothsend,overusetime:this.overusetime,nosendcount:this.presamples.nosendcount};this.wraper._onbadnet(e),this.presamples.updatetime=t}this.presamples.sendsize=this.sendsize,this.presamples.drop=this.dropsize,this.presamples.size=e,this.presamples.time=t}}start(){this.id||(this.presamples.time=performance.now(),this.id=setInterval((()=>{let e=this.channel.bufferedAmount;this.setbuffer(e)}),100))}stop(){this.id&&(clearInterval(this.id),this.id=0)}}class Ei{constructor(e,t,r,i,n,a){this.id=e,this.tag=n||"",this.type=t,this.datachannel=r,this._recv_statistic=null,this.onmessageFn=()=>{},this.disconnectedFn=null,this.connectedFn=null,this._status=Ei.UNINIT,this.target_thread=i,this.transfered=!1,this._listener=null,this.transportlists=[],this._send_statistic=null,this.report_monitor_func=()=>{},this.bsuppend=!1,this.mgr=a,this.bufferIncreaseCount=0,this.lastBufferedAmount=0,this.highWaterMarkCount=0,this.sendcount=0,this.sendStatic=null,this.enableSendStatic=!1,this.onnetbadFn=e=>{}}isReady(){return this._status===Ei.CONNECTED}isTransfered(){return!!this.transfered}send(e){if(this.enableSendStatic){if(this.sendcount++,this.sendStatic.send(e.length),this.datachannel.bufferedAmount>65536)return void this.sendStatic.drop(e.length);if(this.datachannel.bufferedAmount>32768&&(this.sendcount%5==0||21==e[4]&&1==e[1]&&51==e[13]))return void this.sendStatic.drop(e.length)}this.datachannel.send(e),this._send_statistic.sample(!1)}open(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(this.target_thread)try{var t;return this.target_thread.postMessage({command:134,id:this.id,type:this.type,channel:this.datachannel,transportlists:this.transportlists,tag:this.tag},[this.datachannel]),this.transfered=!0,this.datachannel=null,void(null===(t=this.mgr)||void 0===t||t.addRTCChannel(this))}catch(e){this.target_thread=null}this._addEventListener(e)}close(){var e;null===(e=this.mgr)||void 0===e||e.removeRTCChannel(this);let t=this.disconnectedFn;this.transfered&&this.target_thread&&this.target_thread.postMessage({command:135,id:this.id,type:this.type}),this._status!=Ei.DISCONNECT&&this._clear(),this._status=Ei.DISCONNECT,null==t||t()}onmessage(e){this.onmessageFn=e}onopen(e){this.connectedFn=e}onclose(e){this.disconnectedFn=e}onerror(e){this.errorFn=e}onbadnet(e){this.onnetbadFn=e||(e=>{})}_onbadnet(e){this.onnetbadFn(e)}_addEventListener(e){this.datachannel.onmessage=e?this._onmessage2.bind(this):this._onmessage.bind(this),this.datachannel.onopen=this._onopen.bind(this),this.datachannel.onclose=this._onclose.bind(this),this.datachannel.onclosing=this._onclose.bind(this),this.datachannel.onerror=this._onerror.bind(this),"open"==this.datachannel.readyState&&this._status==Ei.UNINIT&&this._onopen()}_onmessage2(e){this._status==Ei.UNINIT&&this._onopen(),this._recv_statistic.sample(!1),this.onmessageFn(e)}_onmessage(e){this._recv_statistic.sample(!1),this.onmessageFn(e)}_onopen(e){let t=this._status;if(this._status=Ei.CONNECTED,!this.transfered){const e=this.report_monitor_func;if(!this._send_statistic){const t=this.tag?this.tag+"_SEND":3==this.type?"VDCS":"ADCS";this._send_statistic=new wi({tag:t,report_call:e})}if(!this._recv_statistic){const t=this.tag?this.tag+"_RECV":3==this.type?"VDCR":"ADCR";this._recv_statistic=new wi({tag:t,report_call:e})}this._send_statistic.start(),this._recv_statistic.start(),this.enableSendStatic=3==this.type,this.sendStatic=new Si(this,this.datachannel),this.enableSendStatic&&this.sendStatic.start()}var r;t!=Ei.CONNECTED&&(null===(r=this.connectedFn)||void 0===r||r.call(this))}_onerror(e){var t;null===(t=this.errorFn)||void 0===t||t.call(this,e),this._onclose(e)}_onclose(e){let t=this._status;this._status=Ei.DISCONNECT;let r=this.disconnectedFn;this._clear(),t!=Ei.DISCONNECT&&(null==r||r())}_clear(){var e,t,r;!this.transfered&&this.datachannel&&(this.datachannel.onmessage=null,this.datachannel.onopen=null,this.datachannel.onclose=null,this.datachannel.onclosing=null,this.datachannel.onerror=null),this.onmessageFn=null,this.connectedFn=null,this.disconnectedFn=null,this.errorFn=null;let i=this.datachannel;this.datachannel=null,null===(e=this._send_statistic)||void 0===e||e.stop(),null===(t=this._recv_statistic)||void 0===t||t.stop(),null===(r=this.sendStatic)||void 0===r||r.stop(),null==i||i.close()}mesagelistener(e){let t=e.data;if(t&&t.id==this.id)switch(t.cmd){case 126:this._onclose();break;case 124:this._onopen();break;case 125:this._onerror(t.ev);break;case o:this.report_monitor_func(t.tag,t.data)}}}tt(Ei,"UNINIT",0),tt(Ei,"CONNECTED",1),tt(Ei,"DISCONNECT",2);function Mi(e,t,r){if(!e)return;let i=ki.dataTransportMgr;i.type===Ri.THREAD_MAIN?(i.setSabBuffer(e,t,r),e.remote.postMessage({cmd:T,transportId:e.id,sender:r,reciver:t})):(e.setSabBuffer(t,r),i.mainThread.postMessage({cmd:T,transportId:e.id,sender:r,reciver:t}))}class Ri{constructor(e){let t=e||{};this.type=t.type||Ri.THREAD_MAIN,this.refs={},this.transportlists=[],this.mainThread=t.remote,this.subthreadlistner=null,this.transportListeners=[],this.onRemoteTransportFn=()=>{}}_onrecvmainthreadlistener(e){let{cmd:t,transportId:r,data:i}=e.data,n=this.transportlists.find((e=>e.id===r));if(n||t==R)switch(t){case R:this.addRemoteTransport(e.data,null);break;case 136:n.setMsgPort(i||new Pi);break;case T:n.setSabBuffer(e.data.sender,e.data.reciver);break;case 132:n.remote=null,this.removeTransport(n)}}_onrecvsubthreadlistener(e,t){let{cmd:r,transportId:i}=t.data,n=this.transportlists.find((e=>e.id===i));switch(r){case R:this.addRemoteTransport(t.data,e);break;case T:this.setSabBufferInfo(n,t.data.sender,t.data.reciver);break;case 132:n.remote==e&&(n.remote=null),this.removeTransport(n)}}createTransport(e){this.transportlists.push(e),setTimeout((()=>{this.transportListeners.forEach((t=>{t.TransportListChange(e,!0)}))}),0)}transportIsExit(e){return-1!=this.transportlists.indexOf(e)}closeTransport(e){let t=this.transportlists.indexOf(e);return-1!=t&&(this.transportlists.splice(t,1),setTimeout((()=>{this.transportListeners.forEach((t=>{t.TransportListChange(e,!1)}))}),0),!0)}createRemoteTransportRPC(e,t){let r={cmd:R,transportType:e.type,transportId:e.id};e.portInfo?(r.port=e.portInfo,t.postMessage(r,[e.portInfo])):t.postMessage(r)}closeRemoteTransportRPC(e,t){t.postMessage({cmd:132,transportType:e.type,transportId:e.id})}setRemoteTransportSABBUfferRPC(e,t){var r,i,n,a;(null!==(r=e.sabInfo)&&void 0!==r&&r.sender||null!==(i=e.sabInfo)&&void 0!==i&&i.reciver)&&t.postMessage({cmd:T,transportId:e.id,sender:null===(n=e.sabInfo)||void 0===n?void 0:n.sender,reciver:null===(a=e.sabInfo)||void 0===a?void 0:a.reciver})}addRemoteTransport(e,t){let{transportId:r,port:i,transportType:n}=e,a=this.createMsgSocketTransport(n,r);var s;a.id=r,a.remote=t,a.portInfo=i,i?a.setMsgPort(a.portInfo):this.bindMessageChannel(a),i&&(null===(s=this.onRemoteTransportFn)||void 0===s||s.call(this,a))}removeTransport(e){-1!=this.transportlists.indexOf(e)&&(this.closeTransport(e),e.close(),e.remote&&this.closeRemoteTransportRPC(e,e.remote),this.closeTransportForTargetThread(e))}createMsgSocketTransport(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=null;return r=new ki({mgr:this,sock:new Ai,type:e,local:!0,id:t}),r}bindMessageChannel(e){if(this.type!=Ri.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:136,transportId:e.id,data:t.port2},[t.port2])}setSabBufferInfo(e,t,r){this.type==Ri.THREAD_MAIN&&(e.sabInfo||(e.sabInfo={}),r&&(r.useCopy=!0),t&&(t.useCopy=!0),e.sabInfo={sender:t,reciver:r},0!=e.target_thread&&(1!=e.target_thread?this.setRemoteTransportSABBUfferRPC(e,e.target_thread):e.setSabBuffer(t,r)))}removeTransportByRemote(e){let t=[];for(let r=0;r<this.transportlists.length;r++){let i=this.transportlists[r];i.remote===e&&t.push(i)}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){for(let t in this.transportlists){let r=this.transportlists[t],i=1==r.target_thread;if(r.type==e&&i)return r}return null}addTransportListChangeListener(e){-1==this.transportListeners.indexOf(e)&&this.transportListeners.push(e)}remoteTransportListChangeListener(e){let t=this.transportListeners.indexOf(e);-1!=t&&this.transportListeners.splice(t,1)}checkTransport(e){this.transportlists.forEach((t=>{if(!e.transportlists.includes(t.type))return;let r=e.target_thread||1;this.addTransportForTargetThread(t,r)}))}checkTransportForThread(){setTimeout((()=>{this.transportlists.forEach((e=>{this.transportListeners.forEach((t=>{t.TransportListChange(e,!0)}))}))}),0)}addTransportForTargetThread(e,t){const r=t;var i,n,a,s;e.target_thread!=r&&0!=r&&(this.type==Ri.THREAD_MAIN&&0!=e.target_thread&&e.target_thread!=r&&(this.closeTransportForTargetThread(e),this.bindMessageChannel(e)),e.target_thread=r,1!=r?(this.createRemoteTransportRPC(e,r),this.setRemoteTransportSABBUfferRPC(e,r)):(e.portInfo&&e.setMsgPort(e.portInfo),(null!==(i=e.sabInfo)&&void 0!==i&&i.sender||null!==(n=e.sabInfo)&&void 0!==n&&n.reciver)&&e.setSabBuffer(null===(a=e.sabInfo)||void 0===a?void 0:a.sender,null===(s=e.sabInfo)||void 0===s?void 0:s.reciver)))}closeTransportForTargetThread(e){0!=e.target_thread&&1!=e.target_thread&&this.type==Ri.THREAD_MAIN&&this.closeRemoteTransportRPC(e,e.target_thread),e.target_thread=0}}tt(Ri,"THREAD_MAIN",1),tt(Ri,"THREAD_SUB",2);const Ti={AUDIO_ENCODE:4,AUDIO_DECODE:5,MAUDIO_DECODE:7,SHARE_ENCODE:8,SHARE_DECODE:9,MSHARE_DECODE:11,VIDEO_ENCODE:12,VIDEO_DECODE:13,AUDIO_NETRTC:64,VIDEO_NETRTC:128,MESH_NETRTC:256,CUSTOME_TYPE:1<<31,MESHBRIDGEAUDIO:1<<31|1,MESHBRIDGE:1<<31|2},xi=e=>{};class Ci{constructor(){this.onmessage=xi,this.status=Ci.CLOSED,this.onopen=xi,this.onclose=xi,this.onwer=null}send(e){}delete(){this.onmessage=xi,this.onopen=xi,this.onclose=xi,this.close()}sendVideo(e,t){}sendWasm(e){}sendCommand(e){}open(){this.status=Ci.OPEN,this.onopen()}close(){this.status=Ci.CLOSED,this.onclose()}isReady(){return!1}}tt(Ci,"OPEN",1),tt(Ci,"CLOSED",2);class Ai extends Ci{constructor(){super({}),this.sab={},this.port=null,this.onmessage=xi,this.sender=xi,this.videoSender=xi,this.reciver=xi,this.wasmSender=xi,this.oncommand=e=>{}}sendCommand(e){var t;null===(t=this.port)||void 0===t||t.postMessage({cmd:130,data:e})}send(e){this.sender(e)}sendVideo(e,t){this.videoSender(e,t)}sendWasm(e){this.wasmSender(e)}delete(){try{var e,t;this.onmessage=xi,this.sender=xi,this.videoSender=xi,this.reciver=xi,this.wasmSender=xi;let{consumer:r}=(null===(e=this.sab)||void 0===e?void 0:e.reciver)||{};null==r||r.setDataCallback(xi),null==r||r.cancelConsume(),this.sab={},this.port&&(this.port.onmessage=xi),null===(t=this.port)||void 0===t||t.close()}catch(e){}}open(){this.status!=Ci.OPEN||this.onopen()}close(){this.status=Ci.CLOSED,this.delete(),this.onclose()}_onmessage(e){let{cmd:t,data:r}=e.data;switch(t){case M:this.reciver();break;case E:this.onmessage(r,0);break;case 129:this.status=r,this.status==Ci.OPEN?this.onopen():this.onclose();break;case 130:this.oncommand(r)}}createSendAndReceive(){if(!this.port)return;let{sender:e,reciver:t}=this.sab,{sabqueue:r,interval:i}=e||{};r?i?(this.sender=e=>{r.enqueue(e)},this.wasmSender=e=>{r.enqueue(e)},this.videoSender=(e,t)=>{if(!r.enqueueSafe([e,t],!1)){let i=new Uint8Array(t.length+e.length);i.set(e,0),i.set(t,e.length),r.enqueueSafe(i)}}):(this.sender=e=>{r.enqueue(e),this.port.postMessage({cmd:M})},this.wasmSender=e=>{r.enqueue(e),this.port.postMessage({cmd:M})},this.videoSender=(e,t)=>{if(!r.enqueueSafe([e,t],!1)){let i=new Uint8Array(t.length+e.length);i.set(e,0),i.set(t,e.length),r.enqueueSafe(i)}this.port.postMessage({cmd:M})}):(this.sender=e=>{this.port.postMessage({cmd:E,data:e},[e.buffer])},this.wasmSender=e=>{let t=new Uint8Array(e.length);t.set(e,0),this.port.postMessage({cmd:E,data:t},[t.buffer])},this.videoSender=(e,t)=>{let r=new Uint8Array(t.length+e.length);r.set(e,0),r.set(t,e.length),this.port.postMessage({cmd:E,data:r},[r.buffer])});let{sabqueue:n,consumer:a,useCopy:s,interval:o,offset:l}=t||{};if(a&&(a.cancelConsume(),a=null),n){const e=s?e=>{this.onmessage(e,0)}:l?e=>{this.onmessage(e.uint8s,e.begin)}:e=>{this.onmessage(e.uint8s,0)};let r=null,i=ki.dataTransportMgr.monitorlogfn;if(o&&i){var c;let e=new Ot({tag:"WCL_M,VDRB"+(null===(c=this.onwer)||void 0===c?void 0:c.type),interval:1e4,reportcallback:Li});r=e.timeoutReport.bind(e)}a=new Ft(n,e,r),t.consumer=a,o?a.consume(o,s):this.reciver=()=>{a.consumeAll(s)}}}setMsgPort(e){e!=this.port&&(this.port&&(this.port.onmessage=xi,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:r,interval:i,offset:n,length:a,useOneElement:s}=e,o=new At(n>0?t.buffer:t,void 0,void 0,!!s,n,a,n>0?t:null);this.sab.sender={sabqueue:o,interval:i,useCopy:r,offset:n}}if(null!=t&&t.sab){var r;let{sab:e,useCopy:i,interval:n,offset:a,length:s,useOneElement:o}=t,l=new At(a>0?e.buffer:e,void 0,void 0,!!o,a,s,a>0?e:null),{consumer:c}=(null===(r=this.sab)||void 0===r?void 0:r.reciver)||{};c&&(c.cancelConsume(),this.sab.reciver.consumer=null,this.sab.reciver.sabqueue=null),this.sab.reciver={sabqueue:l,interval:n,useCopy:i,offset:a}}this.createSendAndReceive()}setStatus(e){this.port?this.status!=e&&(this.status=e,this.port.postMessage({cmd:129,data:e})):console.error("MsgQueueSocket not initialized")}}class Fi{constructor(){}TransportListChange(e,t){}}class ki{constructor(e){this.onmessage=xi,this.onopen=xi,this.onclose=xi,this.oncommand=xi,this.type=e.type,this.id=e.id||Math.floor(performance.now())<<10|e.type,this.sock=e.sock||new Ci,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.oncommand=this._oncommand.bind(this),this.sock.onwer=this,this.remote=e.remote,this.sabInfo=null,this.portInfo=null,this.target_thread=0,this.local=!!e.local,this.args=e.args,this._create()}_create(){let e=ki.dataTransportMgr;e.createTransport(this),!this.local&&e&&e.mainThread&&e.type==Ri.THREAD_SUB&&e.createRemoteTransportRPC(this,e.mainThread)}_close(){let e=ki.dataTransportMgr;const t=e.transportIsExit(this);!this.local&&t&&e.type==Ri.THREAD_SUB&&e.closeRemoteTransportRPC(this,e.mainThread),t&&e.closeTransport(this)}_oncommand(e){this.oncommand(e)}_onmessage(e,t){this.onmessage(e,t)}_onclose(){this.onclose()}_onopen(){this.onopen()}isReady(){return!0}send(e){this.sock.send(e)}sendCommand(e){this.sock.sendCommand(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 Ai))throw new Error("tansport sock is not a MsgQueueSocket");this.sock.setMsgPort(e)}setSabBuffer(e,t){if(!(this.sock instanceof Ai))throw new Error("tansport sock is not a MsgQueueSocket");this.sock.setSabBuffer(e,t)}setStatus(e){this.sock instanceof Ai&&this.sock.setStatus(e)}}tt(ki,"UDP",0),tt(ki,"TCP",1),tt(ki,"RLB_UDP",2),tt(ki,"dataTransportMgr",null);class Pi{constructor(e){this.sock=null,this.onmessage=xi}isReady(){return!1}send(){}sendVideo(){}sendCommand(){}setStatus(e){}}function Li(e,t,r,i){var n;null===(n=Ri.monitorlogfn)||void 0===n||n.call(Ri,e,"".concat(t,",").concat(r,",").concat(i))}class Di extends Fi{constructor(){super()}TransportListChange(e,t){}TransportStatus(e,t,r){}DataChannelStatus(e,t){}}class Ii extends Fi{constructor(e){super(),this.transportMap={},this.type=e.type,this.mgr=e,this.channellists=[],this.channelListeners=[]}addDataChannel(e){if(e instanceof Ei){if(-1==this.channellists.findIndex((t=>t==e))){this.channellists.push(e);try{this.mgr.checkTransport(e)}catch(e){console.error("addDataChannel error",e)}this.channelListeners.forEach((t=>{t.DataChannelStatus(e,!0)}))}}else console.error("channel must be a DataChannelWrapper")}TransportListChange(e,t){let r=this.getChannelByTransportType(e.type);if(t&&null!=r&&r.isReady()){let t=r.target_thread||1;this.mgr.addTransportForTargetThread(e,t)}t||this.mgr.closeTransportForTargetThread(e),r&&this.channelListeners.forEach((i=>{i.TransportStatus(e,r,t)})),this.channelListeners.forEach((r=>{r.TransportListChange(e,t)}))}removeDataChannel(e){if(!(e instanceof Ei))return void console.error("channel must be a DataChannelWrapper");let t=this.channellists.indexOf(e);-1!==t&&this.channellists.splice(t,1),this.channelListeners.forEach((t=>{t.DataChannelStatus(e,!1)}))}addMediaChannelController(e){e instanceof Di?-1==this.channelListeners.findIndex((t=>t==e))&&this.channelListeners.push(e):console.error("controller must be a MediaChannelController")}rmMediaChannelController(e){let t=this.channelListeners.findIndex((t=>t==e));-1!=t&&this.channelListeners.splice(t,1)}getChannelByTransportType(e){for(let t=0;t<this.channellists.length;t++){let r=this.channellists[t];if(r.isReady()&&r.transportlists.includes(e))return r}return null}reinit(){let e=this.channellists;this.channellists=[],e.forEach((e=>{e.isReady()&&(e.close(),this.channelListeners.forEach((t=>{t.DataChannelStatus(e,!1)})))}))}}tt(Ii,"target",null);class Oi{constructor(){this._interval=-1,this.monitorworkers={},this.timeoutcallbackfn=(e,t)=>{}}setTimeoutCallback(e){this.timeoutcallbackfn=e}registerWorker(e,t){if(e in this.monitorworkers){let t=this.monitorworkers[e];t.worker.removeEventListener("message",t.listener),delete this.monitorworkers[e]}let r={id:e,worker:t},i=this._recvheartbeat.bind(this,r);r.listener=i,r.lastedtimestamp=Date.now(),r.timeoutcount=0,r.worker.addEventListener("message",r.listener),this.monitorworkers[e]=r}unRegisterWorker(e){if(!(e in this.monitorworkers))return;let t=this.monitorworkers[e];delete this.monitorworkers[e],t.worker.removeEventListener("message",t.listener)}_recvheartbeat(e,t){let r=t.data;r.cmd===x&&(e.lastedtimestamp=r.timestamp,e.timeoutcount=0)}start(e){const t="undefined"!=typeof DedicatedWorkerGlobalScope&&e&&e instanceof DedicatedWorkerGlobalScope;if(-1!=this._interval)return;if(t)return void(this._interval=setInterval((()=>{e.postMessage({cmd:x,timestamp:Date.now()})}),Oi.INTREVAL_TIME_MS));const r=()=>{this._interval=setTimeout((()=>{r();let e=Oi.instance,t=Object.keys(e.monitorworkers),i=Date.now();t.forEach((t=>{let r=e.monitorworkers[t];r.timeoutcount>5?i-r.lastedtimestamp>Oi.HEART_TIMEOUT_MS&&(e.timeoutcallbackfn(r.id,i-r.lastedtimestamp),r.lastedtimestamp=i):(r.timeoutcount++,r.worker.postMessage({command:138}))}))}),Oi.INTREVAL_TIME_MS)};r()}close(){try{this._interval&&clearTimeout(this._interval),this._interval=-1,Object.keys(this.monitorworkers).forEach((e=>{let t=this.monitorworkers[e];delete this.monitorworkers[e],t.worker.removeEventListener("message",t.listener)}))}catch(e){}}}var Ui,Vi,Wi,Bi,Ni,Gi,ji,Hi,zi;tt(Oi,"INTREVAL_TIME_MS",3e3),tt(Oi,"HEART_TIMEOUT_MS",15e3),tt(Oi,"MAX_HEART_TIMEOUT_MS",3e4),tt(Oi,"instance",null),function(e){e.ADD_VIDEO_PORT="add_video_port",e.ADD_SHADOW_PORT="add_shadow_port",e.ADD_VIDEO_PROCESSOR="add_video_processor",e.PROCESSOR_READY="processor_ready",e.PROCESSOR_ERROR="processor_error"}(Ui||(Ui={})),function(e){e.ADD_SHARE_PORT="add_share_port",e.ADD_SHADOW_PORT="add_shadow_port",e.ADD_SHARE_PROCESSOR="add_share_processor",e.ADD_SHARE_ENCODE_PORT="add_share_encode_port",e.PROCESSOR_READY="processor_ready",e.PROCESSOR_ERROR="processor_error"}(Vi||(Vi={})),(zi=Wi||(Wi={})).INIT_PROCESSOR="init_processor",zi.UNINIT_PROCESSOR="uninit_processor",zi.INIT_OUTPUT_CANVAS="init_output_canvas",zi.OUTPUT_WRITABLE_STREAM="output_writable_stream",zi.INPUT_READABLE_STREAM="input_readable_stream",zi.FRAME_DATA="frame_data",zi.START_REQUEST_FRAME="start_request_frame",zi.STOP_REQUEST_FRAME="stop_request_frame",zi.REQUEST_FRAME="request_frame",zi.FRAME_CALLBACK="frame_callback",zi.RESOLUTION_CHANGE="RESOLUTION_CHANGE",zi.PROCESSOR_WORKER_ERROR="PROCESSOR_WORKER_ERROR",zi.PROCESSOR_STOP_COMPLETE="PROCESSOR_STOP_COMPLETE",Bi||(Bi={});class qi{constructor(e,t,r){this.port=e,this.name=t,this.VideoFrameNeeded=r}setStream(e){const t=e.getVideoTracks()[0],r=t.getSettings(),{frameRate:i=24}=r;this.trackProcessor=new MediaStreamTrackProcessor({track:t});const n=this.trackProcessor.readable;this.port.postMessage({cmd:Wi.INPUT_READABLE_STREAM,frameRate:Math.min(i,24),readableStream:n,processorName:this.name},[n]),this.port.postMessage({cmd:Wi.START_REQUEST_FRAME,frameRate:i,processorName:this.name,VideoFrameNeeded:this.VideoFrameNeeded})}removeStream(){this.port.postMessage({cmd:Wi.STOP_REQUEST_FRAME,processorName:this.name})}destroy(){this.removeStream()}}class Yi{constructor(e,t,r=!1,i=!1){this.port=e,this.name=t,this.isIOSDevice=r,this.VideoFrameNeeded=i,this.onMessage=e=>{if(e.data.cmd===Wi.REQUEST_FRAME&&this.captureVideoEleLoaded){let e=this.captureVideoEle.videoWidth,t=this.captureVideoEle.videoHeight;if(e<=0||t<=0)return;this.isIOSDevice&&(this.captureCanvasEle.width=e,this.captureCanvasEle.height=t,this.captureCanvasEleCtx.drawImage(this.captureVideoEle,0,0,e,t));const r=new VideoFrame(this.isIOSDevice?this.captureCanvasEle:this.captureVideoEle,{timestamp:1e3*performance.now()});this.port.postMessage({cmd:Wi.FRAME_DATA,frame:r,processorName:this.name}),r.close()}},this.port.addEventListener("message",this.onMessage)}createCaptureVideoElement(e){this.captureVideoEle=document.querySelector("#video-processor-video"),this.captureVideoEle||(this.captureVideoEle=document.createElement("video"),this.captureVideoEle.autoplay=!0,this.captureVideoEle.playsInline=!0,this.captureVideoEle.id="video-processor-video",this.captureVideoEle.style.position="fixed",this.captureVideoEle.style.width="1px",this.captureVideoEle.style.height="1px",this.captureVideoEle.style.bottom="0px",this.captureVideoEle.style.right="0px",this.captureVideoEle.muted=!0,document.body.appendChild(this.captureVideoEle)),this.isIOSDevice&&!this.captureCanvasEle&&(this.captureCanvasEle=document.createElement("canvas"),this.captureCanvasEleCtx=this.captureCanvasEle.getContext("2d")),this.captureVideoEle.srcObject=e,this.captureVideoEle.addEventListener("loadedmetadata",(()=>{this.captureVideoEleLoaded=!0})),this.captureVideoEle.play()}setStream(e){const t=e.getVideoTracks()[0].getSettings(),{frameRate:r=24}=t;this.createCaptureVideoElement(e),this.port.postMessage({cmd:Wi.START_REQUEST_FRAME,frameRate:Math.min(r,24),processorName:this.name,VideoFrameNeeded:this.VideoFrameNeeded})}removeStream(){this.port.postMessage({cmd:Wi.STOP_REQUEST_FRAME,processorName:this.name})}destroy(){this.port.removeEventListener("message",this.onMessage)}}class Xi{constructor(e,t){this.trackGenerator=new MediaStreamTrackGenerator({kind:"video"});const r=this.trackGenerator.writable;e.postMessage({cmd:Wi.OUTPUT_WRITABLE_STREAM,writableStream:r,processorName:t},[r]),this.stream=new MediaStream([this.trackGenerator])}getStream(){return this.stream}}class Ki{constructor(e,t,r){this.canvas=document.createElement("canvas"),this.canvas.width=1,this.canvas.height=1,this.stream=this.canvas.captureStream(24),r?r.canCanvasAsOffscreenAfterCaptureStream?this.offScreenCanvas=this.canvas.transferControlToOffscreen():this.offScreenCanvas=null:this.offScreenCanvas=this.canvas.transferControlToOffscreen()}getOutputCanvas(){return this.offScreenCanvas}getStream(){return this.stream}getStreamingCanvas(){return this.canvas}}class Qi{constructor(e,t,r=!1,i=!1){this.processorName=e,this.port=t,this.isIOSDevice=r,this.VideoFrameNeeded=i,this.frameCallback=null,this.callback=null,this.onMessage=e=>{var t,r;e.data.cmd===Wi.FRAME_CALLBACK?null===(t=this.frameCallback)||void 0===t||t.call(this,e.data.frame):null===(r=this.callback)||void 0===r||r.call(this,e.data.cmd,e.data.data)},this.port.start(),this.port.addEventListener("message",this.onMessage);const n=this.getOutPutCanvas();n?this.port.postMessage({cmd:Wi.INIT_OUTPUT_CANVAS,canvas:n,processorName:e},[n]):this.port.postMessage({cmd:Wi.INIT_OUTPUT_CANVAS,processorName:e})}init(){this.port.postMessage({cmd:Wi.INIT_PROCESSOR,processorName:this.processorName})}addCallback(e){this.callback=e}removeCallback(){this.callback=null}uninit(){this.port.postMessage({cmd:Wi.UNINIT_PROCESSOR,processorName:this.processorName}),this.port.removeEventListener("message",this.onMessage)}getOutPutCanvas(){return null}getStream(){throw new Error("Method not implemented.")}setStream(e){throw new Error("Method not implemented.")}removeStream(){}onFrame(e){throw new Error("Method not implemented.")}addFrameCallback(e){throw new Error("Method not implemented.")}removeFrameCallback(){}}class $i extends Qi{constructor(e,t){super(e,t),this.processorName=e,this.port=t}onFrame(e){this.port.postMessage({cmd:Wi.FRAME_DATA,frame:e,processorName:this.processorName})}addFrameCallback(e){this.frameCallback=e}removeFrameCallback(){this.frameCallback=null}}class Ji extends Qi{constructor(e,t,r,i){super(e,t,r,i),this.processorName=e,this.port=t,this.isIOSDevice=r,this.VideoFrameNeeded=i,this.initGenerator()}initGenerator(){this.originGenerator||(this.originGenerator="function"==typeof MediaStreamTrackProcessor?new qi(this.port,this.processorName,this.VideoFrameNeeded):new Yi(this.port,this.processorName,this.isIOSDevice,this.VideoFrameNeeded)),this.targetGenerator||(this.targetGenerator="function"==typeof MediaStreamTrackGenerator?new Xi(this.port,this.processorName):new Ki(this.port,this.processorName))}uninit(){var e,t,r,i;null===(t=null===(e=this.originGenerator)||void 0===e?void 0:e.destroy)||void 0===t||t.call(e),null===(i=null===(r=this.targetGenerator)||void 0===r?void 0:r.destroy)||void 0===i||i.call(r),super.uninit()}getOutPutCanvas(){var e,t;return this.initGenerator(),null===(t=(e=this.targetGenerator).getOutputCanvas)||void 0===t?void 0:t.call(e)}getStream(){return this.targetGenerator.getStream()}setStream(e){this.originGenerator.setStream(e)}removeStream(){this.originGenerator.removeStream()}addFrameCallback(e){this.frameCallback=e}}class Zi{static hasProcessor(){return this.videoProcessorAgentMap.size>0}static hasMediaStreamFrameProcessor(){return[...this.videoProcessorAgentMap.values()].some((e=>e instanceof Ji))}static addFrameCallback(e,t){this.frameCallbackMap.set(e,t),this.getProcessor(e)&&this.getProcessor(e).addFrameCallback(t)}static addCallback(e,t){this.callbackMap.set(e,t),this.getProcessor(e)&&this.getProcessor(e).addCallback(t)}static onFrame(e){for(const t of this.videoProcessorAgentMap.values())t.onFrame(e)}static getStream(){return[...this.videoProcessorAgentMap.values()].pop().getStream()}static setStream(e){for(const t of this.videoProcessorAgentMap.values())t.setStream(e)}static removeStream(){for(const e of this.videoProcessorAgentMap.values())e.removeStream()}static getProcessor(e){return this.videoProcessorAgentMap.get(e)}static startProcessor(e,t){t.init();const r=this.frameCallbackMap.get(e);r&&t.addFrameCallback(r);const i=this.callbackMap.get(e);i&&t.addCallback(i),this.videoProcessorAgentMap.set(e,t)}static stopProcessor(e){const t=this.getProcessor(e);t&&(t.removeFrameCallback(),t.removeCallback(),this.frameCallbackMap.delete(e),this.callbackMap.delete(e),t.removeStream(),t.uninit()),this.videoProcessorAgentMap.delete(e)}static resetProcessorManager(){for(const e of this.videoProcessorAgentMap.keys())this.stopProcessor(e)}}Zi.videoProcessorAgentMap=new Map,Zi.frameCallbackMap=new Map,Zi.callbackMap=new Map;class en{constructor(e,t,r,i){var n;this.url=e,this.onopen=()=>{},this.onclose=()=>{},this.oncommand=()=>{},this.transportopened=!1,this.websockClosed=!1,this.dataTransport=(n=t,new ki({sock:new Ai,type:n,local:!1,userArgs:undefined})),this.dataTransport.onopen=this._dataTransportOpen.bind(this),this.dataTransport.onclose=this._dataTransportClose.bind(this),this.dataTransport.oncommand=this._dataTransportCommand.bind(this),this.websocketopen=!1,this.senderSab=null,this.reciverSab=null,this.webtransporturl=null,this.disabletcp=!!r,this.isLSSPlayer=!!i}_dataTransportCommand(e){let{cmd:t}=e;182!=t||this.websockClosed||(this.websocketopen=!0,this.onopen()),t==P&&this.onclose(),this.oncommand(e)}_dataTransportOpen(){this.transportopened=!0,this.disabletcp&&this.onopen();{const e=this.isLSSPlayer,t={cmd:175,data:this.disabletcp,isLSSPlayer:e};this.dataTransport.sendCommand(t)}const e={cmd:180,data:this.url};this.url&&!this.disabletcp&&this.dataTransport.sendCommand(e);const t={cmd:176,data:this.webtransporturl};this.webtransporturl&&this.dataTransport.sendCommand(t),(this.senderSab||this.reciverSab)&&Mi(this.dataTransport,this.senderSab,this.reciverSab)}_dataTransportClose(){this.transportopened=!1}resetURL(e){this.websockClosed=!1;let t=this.url;this.url=e;const r={cmd:180,data:this.url};this.transportopened&&this.url&&t!=this.url&&this.dataTransport.sendCommand(r)}resetWebrTransportUrl(e){let t=this.webtransporturl;this.webtransporturl=e;const r={cmd:176,data:e};this.transportopened&&this.webtransporturl&&t!=this.webtransporturl&&this.dataTransport.sendCommand(r)}closeWebsocket(){let e=this.url;this.websockClosed=!0,this.url=null;const t={cmd:181,data:this.url};this.transportopened&&e&&this.dataTransport.sendCommand(t)}closeWebTransport(){let e=this.webtransporturl;this.webtransporturl=null;const t={cmd:177,data:e};this.transportopened&&e&&this.dataTransport.sendCommand(t)}isReady(){return this.websocketopen||this.disabletcp&&this.transportopened}setOnMessage(e){this.dataTransport.onmessage=e}sendWasm(e){this.dataTransport.sendWasmData(e)}send(e){this.dataTransport.send(e)}sendVideo(e,t){this.dataTransport.sendVideo(e,t)}sendCommand(e){this.transportopened&&this.dataTransport.sendCommand(e)}close(){this.dataTransport&&(this.dataTransport.onopen=()=>{},this.dataTransport.onclose=()=>{},this.dataTransport.oncommand=()=>{},this.dataTransport.sendCommand({cmd:181}),this.dataTransport.sendCommand({cmd:177}),this.dataTransport.close())}setSabBuffer(e,t){this.senderSab=e,this.reciverSab=t,this.transportopened&&Mi(this.dataTransport,e,t)}sendCmdData(e){const t={cmd:198,data:new Uint8Array(e)};this.dataTransport.sendCommand(t)}}!function(e){e[e.Unknow=0]="Unknow",e[e.MediaCommand=1]="MediaCommand",e[e.P2PControl=2]="P2PControl",e[e.MeshControl=3]="MeshControl"}(Ni||(Ni={})),function(e){e[e.normal=0]="normal",e[e.child=1]="child",e[e.parent=2]="parent",e[e.invalid=31]="invalid"}(Gi||(Gi={})),function(e){e[e.bridge=0]="bridge",e[e.setRole=1]="setRole",e[e.connectTestParams=2]="connectTestParams",e[e.reportConnectedSet=3]="reportConnectedSet",e[e.notifyChildParentLeave=4]="notifyChildParentLeave",e[e.notifyParentChildLeave=5]="notifyParentChildLeave",e[e.availableParents=6]="availableParents",e[e.updateNodeStatus=7]="updateNodeStatus",e[e.joinSuccess=8]="joinSuccess",e[e.kickChild=9]="kickChild",e[e.leaveParent=10]="leaveParent",e[e.subscriptionMap=11]="subscriptionMap",e[e.channelopt=12]="channelopt",e[e.joinSuccessConfirm=13]="joinSuccessConfirm",e[e.registerMeshNode=14]="registerMeshNode",e[e.meshAllowTalk=15]="meshAllowTalk",e[e.statInfo=16]="statInfo",e[e.adapt=17]="adapt",e[e.refershConnectParams=18]="refershConnectParams",e[e.joinConnectedSetConfirm=19]="joinConnectedSetConfirm",e[e.registerMeshNodeResult=20]="registerMeshNodeResult",e[e.meshSigType=21]="meshSigType",e[e.meshSigKey=22]="meshSigKey",e[e.mediaAccess=23]="mediaAccess",e[e.unknown=1e3]="unknown"}(ji||(ji={})),function(e){e[e.Unknow=0]="Unknow",e[e.Offer=1]="Offer",e[e.Answer=2]="Answer"}(Hi||(Hi={}));var tn=Object.defineProperty,rn=(e,t,r)=>((e,t,r)=>t in e?tn(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r);const nn=new class{constructor(){rn(this,"_enabled",!1),rn(this,"_reportLog",(()=>{})),rn(this,"_cacheName",""),rn(this,"_enableLocalDebugLog",!1),rn(this,"_resourcePath","")}get enabled(){return this._enabled}set enabled(e){this._enabled=e}get reportLog(){return this._reportLog}set reportLog(e){this._reportLog=e}get cacheName(){return this._cacheName}set cacheName(e){this._cacheName=e}get enableLocalDebugLog(){return this._enableLocalDebugLog}set enableLocalDebugLog(e){this._enableLocalDebugLog=e}get resourcePath(){return this._resourcePath}set resourcePath(e){this._resourcePath=e}},an=(...e)=>{if(!nn.enableLocalDebugLog)return;const t=e[0];console.log(`FWB | ${t} -`,...e.slice(1))},sn=e=>{let t=`/${e.fileName}`;e.hash&&(t=`/${e.fileName}/${e.hash}`);const r=[];return e.cdnPath&&r.push(`v=${e.cdnPath}`),e.timestamp&&r.push(`t=${e.timestamp}`),r.length>0?`${t}?${r.join("&")}`:t},on=()=>nn.cacheName,ln=e=>"function"==typeof e,cn=void 0!==self.caches&&void 0!==self.Cache&&!!(ln(self.caches.open)&&ln(self.caches.delete)&&ln(self.Cache.prototype.match)&&ln(self.Cache.prototype.put)&&ln(self.Cache.prototype.delete)&&ln(self.Cache.prototype.keys)),dn=e=>new Promise((t=>setTimeout(t,e))),un=(e,t,r)=>Number.isInteger(null==r?void 0:r.maxRetries)&&(null==r?void 0:r.maxRetries)>1?(async(e,t,r)=>{let i;const n=null==r?void 0:r.maxRetries,a=(null==r?void 0:r.delayMs)??-1;for(let r=0;r<n;r++)try{const r=await self.fetch(e,t);if(!r.ok)throw new Error(`Fetch resource error: ${r.status}`);return r}catch(e){if(i=e,"AbortError"===(null==e?void 0:e.name))break;r<n-1&&a>=0&&await dn(a)}throw i})(e,t,r):self.fetch(e,t),hn=async({cdnPath:e,fileName:t,hash:r,size:i,fetchOptions:n,fetchCustomOptions:a})=>{try{const n=await(async(e,t)=>(async e=>{const t=await caches.open(on()),r=new URL(e,self.location.origin),i=await t.match(r,{ignoreSearch:!0});if(!i)throw new Error("Not Found");return i})(sn({fileName:e,hash:t})))(t,r),a=n.url||"",s=a.slice(0,a.length-t.length-1);return an(`/${e}/${t}`,"get file from cache"),nn.reportLog({isHitCache:!0,isCrossRelease:s!==e,fileName:t,hash:r,size:i}),n}catch{try{const s=await(async({cdnPath:e,fileName:t,hash:r,fetchOptions:i,fetchCustomOptions:n})=>{const a=`${e}/${t}`,s=await un(a,i,n),o=sn({cdnPath:e,fileName:t,hash:r,timestamp:Date.now()});try{await(async(e,t)=>{try{const r=await caches.open(on()),i=new URL(e,self.location.origin);await r.put(i,t.clone())}catch(e){console.error("Failed to save to cache",e)}})(o,s)}catch(r){an(`/${e}/${t}`,"save to cache failed",r)}return s})({cdnPath:e,fileName:t,hash:r,fetchOptions:n,fetchCustomOptions:a});return an(`/${e}/${t}`,"get file from network"),nn.reportLog({isHitCache:!1,isCrossRelease:!1,fileName:t,hash:r,size:i,cachedVersion:""}),s}catch(r){throw an(`/${e}/${t}`,"get file from network - Failed"),r}}},_n={},fn=async(e,t)=>{_n[e]||(_n[e]={}),an(`/${e}/${t}`,"start to get manifest");let r=_n[e].manifest;return r?(an(`/${e}/${t}`,"get manifest from memory"),{manifest:r}):(r=await(async(e,t)=>{const r=_n[e];if(null==r?void 0:r.manifest)return r.manifest;const i=await(async(e,t)=>{const r=`${e}/manifest.json`,i=_n[e];let n=null==i?void 0:i.ongoingPromise;return n?(an(`/${e}/${t}`,"fetchManifest","existing fetch pending"),n):(n=fetch(r,{headers:{Accept:"application/json"}}).then((async r=>{if(an(`/${e}/${t}`,"fetchManifest","get response",r.status),_n[e].lastResponseStatus=r.status,!r.ok)throw r;const i=await r.json();return _n[e].manifest=i,an(`/${e}/${t}`,"fetchManifest","success"),i})).finally((()=>{_n[e].ongoingPromise=void 0})),_n[e].ongoingPromise=n,an(`/${e}/${t}`,"fetchManifest","send request"),n)})(e,t);return i})(e,t),an(`/${e}/${t}`,"get manifest from network"),{manifest:r})},pn=async(e,t,r)=>{const i=((e,t)=>{if(!e.startsWith(t))return null;t.endsWith("/")&&(t=t.slice(0,-1));const r=e.slice(t.length+1);return r?{cdnPath:t,fileName:r}:null})(new URL(e.toString()).href,nn.resourcePath);if(!i)return un(e,t,r);const{cdnPath:n,fileName:a}=i;an(`/${n}/${a}`,"get file request");let s=null;try{const{manifest:e}=await fn(n,a);s=e,an(`/${n}/${a}`,"get manifest success")}catch{return an(`/${n}/${a}`,"get manifest failed => fallback to browser"),un(e,t,r)}const o=null==s?void 0:s[a];return(null==o?void 0:o.hash)?hn({cdnPath:n,fileName:a,hash:o.hash,size:o.size,fetchOptions:t,fetchCustomOptions:r}):un(e,t,r)};let mn;self.setTimeout((async()=>{const e=on(),t=await caches.open(e);let r=[];try{r=await t.keys()}catch{return}const i=new Map;for(const e of r){const t=new URL(e.url),r=t.searchParams.get("t");if(!r)continue;const n=parseInt(r,10);if(isNaN(n))continue;const a=t.pathname.split("/").slice(0,-1).join("/");a&&(i.has(a)||i.set(a,[]),i.get(a).push({request:e,timestamp:n}))}for(const[e,r]of i){if(r.sort(((e,t)=>t.timestamp-e.timestamp)),r.length<=1)continue;let e=r.slice(2);r[0].timestamp-r[1].timestamp>5184e6&&(e=r.slice(1));for(const r of e){try{await t.delete(r.request)}catch{continue}an(`delete from cache: ${r.request.url}`)}}}),6e4);const gn=(e,t)=>mn&&"function"==typeof mn?mn(e,t):(console.log("initializeFetchWithCache not initialized: ",e),fetch(e,t));var vn=function(e,t,r,i){return new(r||(r=Promise))((function(n,a){function s(e){try{l(i.next(e))}catch(e){a(e)}}function o(e){try{l(i.throw(e))}catch(e){a(e)}}function l(e){var t;e.done?n(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,o)}l((i=i.apply(e,t||[])).next())}))};function yn(e){console.log(e)}self.wasmSuccessEvent=7,self.wasmFailEvent=-7,self.downloadAndInstantiateWebAssembly=async function(e,t){try{const r=await new Promise(((e,t)=>{const r=i=>{let n=i.data;"DOWNLOAD_WASM_FROM_MAIN_THREAD_OK"===n.command?(te("DE"),self.removeEventListener("message",r),e(n.data)):"DOWNLOAD_WASM_FROM_MAIN_THREAD_FAILED"===n.command&&(self.removeEventListener("message",r),t(new Error("Failed to download WASM file: ".concat(wasmUrl," from main thread"))))};self.addEventListener("message",r),te("DS"),postMessage({status:30,url:wasmUrl})}));let i=await WebAssembly.instantiate(r,e);i.instance?(self.wasmModuleToShare=i.module,t(i.instance)):(self.wasmModuleToShare=r,t(i))}catch(e){te("IF"),ie("E:H Failed to download and instantiate WASM file: ".concat(wasmUrl),e)}},self.addEventListener("unhandledrejection",(e=>{ie("Unhandled rejection in video worker: ".concat(JSON.stringify(e.reason)),e.reason instanceof Error?e.reason:null),Ae()})),self.addEventListener("error",(e=>{ie("Unhandled exception in video worker",e),Ae()}));var bn=new st;const wn=new class{constructor(e){di(this,fi,""),di(this,pi,new yr),di(this,mi,new ci),di(this,gi,new Mr),di(this,vi,null),hi(fi,this,e),ui(mi,this).setGPUResourceMgrGetter((()=>this.getWebGPUResMgr()))}isEnableCanvasAlphaChannel(){return ui(mi,this).isEnableCanvasAlphaChannel()}setCanvasAlphaChannelEnability(e){ui(mi,this).setCanvasAlphaChannelEnability(e)}async evalRendererType(e){const t=await ui(pi,this).evaluate(e);console.log("[RenderManager] rendererType is ".concat(t))}getVideoRenderDisplay(e,t,r,i){let n=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null;const a=ui(pi,this).getRendererType(),s=ui(pi,this).acquireRenderer(e,this.getWebGPUResMgr(a));return ui(mi,this).getVideoRenderDisplay(a,e,t,r,i,s,n)}getRenderDisplay(e,t,r,i){let n=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null;const a=ui(pi,this).getRendererType(),s=ui(pi,this).acquireRenderer(e,ui(vi,this));return ui(mi,this).getRenderDisplay(a,e,t,s,n)}createWebGLVideoRenderDisplay(e,t,r){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;return ui(pi,this).isWebGL2RendererType()?ui(mi,this).getWebGL2RenderDisplayMgr().createVideoRenderDisplay(e,t,r,null,i):ui(pi,this).isWebGLRendererType()?ui(mi,this).getWebGLRenderDisplayMgr().createVideoRenderDisplay(e,t,r,null,i):(zt("Can not create webgl display!!"),null)}createVideoRenderDisplay(e,t,r){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;const n=ui(pi,this).getRendererType(),a=ui(pi,this).acquireRenderer(e,this.getWebGPUResMgr(n));return ui(mi,this).createVideoRenderDisplay(n,e,t,r,a,i)}recycleRenderDisplay(e,t,r){const i=ui(pi,this).getRendererType();ui(mi,this).recycleRenderDisplay(i,e,t,this.getWebGPUResMgr(i),r)}renderFor(e){if(ui(pi,this).isWebGPURendererType()){const t=ui(pi,this).getRendererType(),r=ui(mi,this).collectInUseRenderDisplays(t,e);r&&r.forEach((e=>{const r=ui(pi,this).acquireRenderer(e.canvas,this.getWebGPUResMgr(t));ui(gi,this).render(r,e.renderDisplays)}))}}renderWith(e){if(ui(pi,this).isWebGPURendererType()){const t=e.getAttachedCanvas();if(t){const r=ui(pi,this).getRendererType(),i=ui(pi,this).acquireRenderer(t,this.getWebGPUResMgr(r)),n=[];n.push(e),ui(gi,this).render(i,n)}}}getRenderDisplayMap(e){const t=ui(pi,this).getRendererType();return ui(mi,this).getRenderDisplayMap(t,e)}onRestoredFromContextLost(e,t,r,i,n){let a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:null;return ui(pi,this).isWebGLRendererType()||ui(pi,this).isWebGL2RendererType()?ui(mi,this).onRestoredFromContextLost(e,t,r,i,n,a):null}destroyUnusedVideoFrame(e){"undefined"!=typeof VideoFrame&&e instanceof VideoFrame&&ui(pi,this).isWebGPURendererType()&&e.close()}getRendererProvider(){return ui(pi,this)}getRenderDisplayManager(){return ui(mi,this)}getWebGPUResMgr(e){if(ui(vi,this))return ui(vi,this);if(2===e){const e=rr.getModule("webgpu_renderer_dynmod");hi(vi,this,e.exports.createWebGPUResManager()),ui(vi,this).addRendererProviderModule(ui(pi,this)),ui(vi,this).setLabel(ui(fi,this))}return ui(vi,this)}cleanup(e,t){let r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];ui(pi,this)&&ui(pi,this).cleanup(),ui(mi,this)&&ui(mi,this).cleanup(e,t,r),r||ui(vi,this)&&ui(vi,this).cleanup()}clearOffscreenCanvas(e){ui(mi,this)&&ui(mi,this).cleanupByCanvas(e)}}("video");var Sn=!1;let En=1,Mn=!1;var Rn,Tn,xn,Cn,An,Fn,kn,Pn,Ln,Dn,In,On,Un,Vn,Wn,Bn,Nn,Gn,jn=!0;let Hn;var zn,qn,Yn,Xn,Kn,Qn,$n,Jn,Zn,ea,ta,ra,ia,na,aa,sa,oa,la,ca,da,ua,ha,_a,fa,pa,ma=!1,ga=0,va=0,ya=!1,ba=!1,wa=!1,Sa=new class{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.checkInterval=0,this.hasRTPPackets=!1,this.callBackEvent=e,this.subforme=!1,this.lastsubformetime=0,this.videoType=t,this.paused=!1,this.isVbEnabled=!1,this.isVideoCaptured=!1,this.hasWasmMemoryError=!1}startCheck(){this.checkInterval&&(clearInterval(this.checkInterval),this.hasRTPPackets=!1,this.subforme=!1,this.paused=!1),this.checkInterval=setInterval((()=>{if((this.videoType&&this.subforme||!this.videoType)&&!this.hasRTPPackets&&!this.paused){let e=!1;this.videoType&&this.isVbEnabled&&this.isVideoCaptured&&!this.hasWasmMemoryError&&(e=!0),performance.now()-this.lastsubformetime>2e4&&postMessage({status:this.callBackEvent,videoType:this.videoType,subforme:this.subforme,hasRTPPackets:this.hasRTPPackets,vberror:e})}this.hasRTPPackets=!1,this.isVideoCaptured=!1}),3e4)}stopCheck(){this.checkInterval&&clearInterval(this.checkInterval),this.checkSharingInterval=0,this.subforme=!1,this.paused=!1}setRtpPackets(){this.hasRTPPackets=!0}setSubForMe(e){let t=e>=0;this.subforme!==t&&(this.subforme=t,this.lastsubformetime=performance.now())}setVBFlag(e){this.isVbEnabled=e}setVideoCaptured(e){this.isVideoCaptured=e}setWasmMemoryError(e){this.hasWasmMemoryError=e}setPaused(e){e||(this.lastsubformetime=performance.now()),this.paused=e,this.hasRTPPackets=!1}}(-130,!0),Ea=!1,Ma=!1;let Ra=-1;var Ta,xa=!1,Ca=!1,Aa=!1,Fa=null,ka=!1,Pa=!1,La=0,Da=5;self.onWasmModuleReady=()=>{Tn=Module.cwrap("_Video_Init","number",["number","number","number","number","number","number","number","boolean","boolean","boolean","number","boolean","boolean","boolean","boolean"]),xn=Module.cwrap("_Video_UnInit","number",["number"]),Module.cwrap("_Video_Decode","number",["number","array","number"]),Cn=Module.cwrap("_Video_Encode","number",["number","number","number","number","number","number","number","boolean","number","number","boolean","number"]),An=Module.cwrap("_Video_Encode_YUV","number",["number","number","number","number","number","number","number","number","number","number","number","number","number","boolean","number","number","boolean","number"]),Fn=Module.cwrap("_Video_Try_Analysis","number",["number","array","number"]),oa=Module.cwrap("_set_video_network_info","number",["number","number","number","number","number","number","number","number","number"]),aa=Module.cwrap("_set_video_fec_info","number",["number","number","number","number"]),na=Module.cwrap("_set_video_bandwidth_alloc","number",["number","number","number","number"]),sa=Module.cwrap("_set_video_retran_info","number",["number","number","boolean","boolean","number"]),kn=Module.cwrap("_Video_Websocket_Speed","number",["number","number","number"]),Pn=Module.cwrap("_Video_Start_Encode","number",["number","number","number","number","number"]),Ln=Module.cwrap("_Video_Stop_Encode","number",["number"]),Dn=Module.cwrap("_Video_Update_Format","number",["number","number","number","number","number"]),Module.cwrap("_rotate_video","number",["number","number"]),Module.cwrap("_Video_VirtualBackground_Special_Action","number",["number","number","number","number","number","number","number"]),Hn=Module.cwrap("_Request_Video_Qos_Data","number",["number"]),In=Module.cwrap("_Video_Set_Data_Encryption","number",["number","number"]),On=Module.cwrap("_Add_Video_Cooker_info","number",["number","number","number","number"]),Un=Module.cwrap("_Remove_Video_Cooker_Info","number",["number","number"]),Vn=Module.cwrap("_Get_Video_Meat_Weight","number",["number","number"]),Wn=Module.cwrap("_Set_Max_Receiving_Channel_Num","number",["number","number"]),Bn=Module.cwrap("_update_sync_time","number",["number","number","number"]),Nn=Module.cwrap("_release_video_receiving_channel","number",["number","number"]),Gn=Module.cwrap("_change_hw_status","number",["number","boolean"]),Module.cwrap("_Change_Connect_Type","number",["number","number"]),zn=Module.cwrap("_update_video_uplink_bandwidth_limitation_by_server","number",["number","number"]),qn=Module.cwrap("_create_vb_thread","number",[]),Yn=Module.cwrap("_create_vb_no_sab_thread","number",[]),Xn=Module.cwrap("_signal_vb_thread_bg","number",["number","number","number","number"]),Kn=Module.cwrap("_signal_vb_thread_blur","number",["number","number"]),Qn=Module.cwrap("_signal_vb_thread_video_yuv","number",["number","number","number","number","number","number","number","number","number","number","number","number","number","number","number","number"]),$n=Module.cwrap("_signal_vb_thread_video_rgba","number",["number","number","number","number","number","number","number","number"]),Jn=Module.cwrap("_update_video_cropping_mode","number",["number","number"]),Zn=Module.cwrap("_Video_Try_Analysis","number",["number","number","number"]),ca=Module.cwrap("_collect_video_monitor_info","number",["number","boolean"]),da=Module.cwrap("_signal_vb_thread_close","number",[]),pa=Module.cwrap("_Create_HW_Encode","number",[]),ea=Module.cwrap("_set_mmr_signature_info","number",["number","number","array","number"]),ta=Module.cwrap("_set_singature_info","number",["number","number","number"]),ra=Module.cwrap("_set_meeting_uuid_for_signature","number",["number","number","string","number"]),ia=Module.cwrap("_update_signagure_verify_action","number",["number","number","boolean"]),fa=Module.cwrap("_set_video_statistics_flag","number",["number","boolean"]),Module._malloc=function(){let e=Module.asm.malloc.apply(null,arguments);return e||ya||(ya=!0,te("MEMERR:VIDEO-".concat(is,"-").concat(wasmMemory.buffer.byteLength,"-").concat(arguments[0])),ie("memry malloc error",new Error("memry malloc error VIDEO-".concat(is,"-").concat(wasmMemory.buffer.byteLength,"-").concat(arguments[0])))),e},void 0!==_malloc&&(_malloc=Module._malloc)};var Ia=null,Oa=0,Ua=null,Va=!1,Wa=!1,Ba=!1,Na=!1,Ga=!1,ja=null,Ha=0,za=0,qa=0,Ya=null;var Xa,Ka,Qa,$a,Ja,Za,es,ts,rs,is=!1,ns=!1,as=!1,ss=!1,os=!1,ls=!1,cs=null,ds=null,us=null,hs=null,_s=null,fs=null,ps=0,ms=new Map,gs=null,vs=new Map,ys=null,bs=[],ws=!1,Ss=!1,Es="",Ms=!1,Rs={ssrc:null,firstflag:!1},Ts=1,xs=0,Cs=2,As=!1,Fs=new class{constructor(){this.readStream=null,this.reader=null,this.streamProcessor=null,this.videotrack=null,this.rotation=0,this.videotag=!1,this.isSafari=!1}setReadStream(e){this.closeReadStream(),e&&(this.rotation=0,this.videotag=!1,this.readStream=e,this.reader=e.getReader(),this.isSafari=!1)}closeReadStream(){try{var e;null===(e=this.videotrack)||void 0===e||e.stop(),this.videotag||(this.reader&&this.reader.releaseLock&&this.reader.releaseLock(),this.readStream&&this.readStream.cancel&&this.readStream.cancel())}catch(e){}finally{this.reader=null,this.readStream=null,this.streamProcessor=null,this.videotrack=null}}createReadStream(e,t){this.closeReadStream(),this.rotation=t,this.videotag=!0,this.isSafari=!0,e&&(this.videotrack=e,this.streamProcessor=new MediaStreamTrackProcessor({track:e}),this.readStream=this.streamProcessor.readable,this.reader=this.readStream.getReader())}setRotation(e){this.isSafari&&this.videotrack&&(this.rotation=e)}async read(){let{done:e,value:t}=await this.reader.read();return{done:e,value:t,rotation:this.rotation,videotag:this.videotag}}},ks=!1,Ps=!1,Ls=!1,Ds=!1,Is=!1,Os=!1,Us=new Map,Vs=navigator.hardwareConcurrency?navigator.hardwareConcurrency:4,Ws=Ge,Bs=31,Ns=0,Gs={rgba_x:0,rgba_y:0,rgba_stride:0},js=!1;self.isPreviewMode=!1;var Hs={qosIntervalId:0,renderFlag:!1,monitorPanelFlag:!1,messageIndex:0,panelpollingInterval:0},zs={videoStatisticsFlag:!1},qs=!0;let Ys;var Xs=!1,Ks=0,Qs=!1;function $s(e,t,r,i){Me(e,"".concat(t,",").concat(r,",").concat(i))}var Js=new Ot({tag:"WCL_M,VMERR",interval:1e4,reportcallback:$s}),Zs=new Ot({tag:"WCL_M,DISCARD",interval:15e3,reportcallback:$s}),eo=new Ut({report_call:Me});const to=new class{constructor(){this.intervalTimer=null}start(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:30;this.stop(),this.intervalTimer=setInterval(e,t)}stop(){this.intervalTimer&&(clearInterval(this.intervalTimer),this.intervalTimer=null)}};function ro(e,t,r,i,n,a){if(isPreviewMode&&!a)return null;const s=Ad==Ct.VIDEO_ENCODE?Ti.VIDEO_ENCODE:Ti.VIDEO_DECODE;var o=new en(e,s,ka&&!Pa,ka);return o.setOnMessage(r),o.onopen=t,o.onclose=n,o.oncommand=i,o}function io(){var e;if(!is&&null!==(e=Ua)&&void 0!==e&&e.isReady()&&Go==Ye.IPHONE){let e=new Uint8Array(8);e[0]=139,Ua.send(e)}}function no(e){Ra=e,Sa.setSubForMe(e)}function ao(e,t){if(io(),postMessage({status:n}),ts){const e={cmd:V,data:ts};Ua.sendCommand(e)}is&&ma&&au(Ne.SESSION_TYPE_VIDEO,!0)}var so,oo,lo,co=!1,uo=!1,ho={threadCreatedFlag:!1};ho.threadPoolBufferMGR=new Map,ho.needReloaddHelpThread=!1,ho.SSrcWaitForThread=[],ho.initParseThread=!1,ho.unusedworkerarray=[],ho.countThread=3,ho.totalNumbofParseThread=3,ho.newworker=0,ho.totalthread=0,ho.preusedcount=0,ho.realusedcount=0,ho.zombiethreadssrc=0,ho.videodecodethreadnumb=1,ho.isSupportMultiThread=!1,ho.isSupportOffscreenCanvas=!1,ho.isVideoCodecHelpThreadWorker=null,ho.isEnableVideoDecodeHardWareThread=!1;var _o=1,fo=1280,po=!1,mo={isTeslaMode:!1};function go(){jo.nextWorker=jo.threadarray.shift()}function vo(e){(e=e>>10<<10)&&ho.threadPoolBufferMGR.get(e)&&ho.threadPoolBufferMGR.delete(e)}function yo(){}function bo(e){e=e>>10<<10;let t=ho.threadPoolBufferMGR.get(e);return t?t.threadState!=De||0==ho.unusedworkerarray.length?-1:0:-1}const wo=(()=>{let e=null,t=null;return{inited:!1,start(){this.inited=!0,this.clear(),e=setTimeout((()=>{Qc||postMessage({status:"VBPredictAbout3s"})}),3e3),t=setTimeout((()=>{Qc||postMessage({status:"VBPredictAbout10s",isVBPredictIn5s:!0})}),1e4)},clear(){clearTimeout(e),clearTimeout(t),e=null,t=null}}})();const So=()=>"undefined"!=typeof PThread,Eo=function(e,t){e.onmessage=r=>{if(!ba){var i=r.data,n=i.cmd;if(e.pthread_ptr&&(PThread.currentProxiedOperationCallerThread=e.pthread_ptr),i.targetThread&&i.targetThread!=_pthread_self()){var a=PThread.pthreads[i.targetThread];return a?a.postMessage(i,i.transferList):ie('Internal error! Worker sent a message "'+n+'" to target pthread '+i.targetThread+", but that thread no longer exists!"),void(So&&(PThread.currentProxiedOperationCallerThread=void 0))}if("processProxyingQueue"===n)executeNotifiedProxyingQueue(i.queue);else if("spawnThread"===n)spawnThread(i);else if("cleanupThread"===n)cleanupThread(i.thread);else if("killThread"===n)killThread(i.thread);else if("cancelThread"===n)cancelThread(i.thread);else if("loaded"===n)e.loaded=!0,t&&t(e),e.runPthread&&e.runPthread();else if("size"==n)Module.decode_callback&&Module.decode_callback(r.data.ssrc,r.data.size);else if("decoded"==n)Module.put_data&&Module.put_data(r.data);else if("js_info_from_wcl"==n)Module.js_info_from_wcl_thread&&Module.js_info_from_wcl_thread(r.data);else if("wcl_trace_log"==n)Module.wcl_trace_log&&Module.wcl_trace_log(r.data);else if("on_psl_mix_share_info_changed"===n){let e=r.data.shared_source_id,t=r.data.rect_x_norm,i=r.data.rect_y_norm,n=r.data.rect_cx_norm,a=r.data.rect_cy_norm;Module.on_psl_mix_share_info_changed(e,t,i,n,a)}else if("js_info_from_wcl_video_data"===n){let e=r.data.ssrc,t=r.data.data,i=r.data.is_sent_by_data;Module.js_info_from_wcl_video_data(e,t,0,void 0,void 0,i,!0)}else if("change_capture_resolution"==n)Module.change_capture_resolution&&Module.change_capture_resolution(r.data.type);else if("APP_Troubleshoting_Info"==n)Module.APP_Troubleshoting_Info&&Module.APP_Troubleshoting_Info(r.data.data,r.data.len);else if("SAVE_IV"==n){let e=r.data.ptr,t=r.data.len;Module.SAVE_IV(e,t)}else if("processed_capture_data_callback"==n){let e=r.data.ssrc,t=r.data.data,i=r.data.len_of_data,n=r.data.format_width,a=r.data.format_height,s=r.data.valid_x,o=r.data.valid_y,l=r.data.valid_width,c=r.data.valid_height,d=r.data.yuv_limited;Module.processed_capture_data_callback(e,t,i,n,a,s,o,l,c,d)}else if("modelReady"===n)Xc=performance.now(),wo.start();else if("vbInitializeFailed"===n)postMessage({status:"vbInitializeFailed"});else if("addMonitorLog"===n)te(i.log);else if("vbPredictDone"===n)Qc=!0,Kc=performance.now()-Xc,jo.nextWorker=jo.vbThreadWorker,jo.nextWorker.postMessage({cmd:"vb"}),qn(),jo.vbThreadCreatedFlag=!0,jo.nextWorker=null,postMessage({status:"VBPredictDone",predictCostTime:Kc}),ic&&(Is||rd({data:cc}));else if("VideoEncodeInit"===r.data.cmd){let e=r.data.id,t=r.data.context;Module.codecMRG.initEncodeWebCodec(e,t)}else if("VideoEncodeConfigure"===r.data.cmd){let e=r.data.Width,t=r.data.Height,i=r.data.id,n=r.data.Bitrate,a=r.data.Framerate;Module.codecMRG.configEncodeWebCodec(i,n,a,e,t)}else if("VideoEncode"===r.data.cmd){let e=r.data.videoFrameId,t=r.data.dataLength,i=r.data.id,n=r.data.NewIDR,a=r.data.rawData;Module.codecMRG.encodeVideoFrame(i,e,n,a,t)}else if("decoded_webcodec"===r.data.cmd){const{id:e,data:t,frameIndex:i,ssrc:n}=r.data||{};Module.codecMRG.put_data({id:e,ssrc:n,data:t,frameIndex:i})}else if("decoded_webcodec_render"===r.data.cmd){const{id:e,ssrc:t,iFrameNum:i,rotation:n,rendering_x:a,rendering_y:s,rendering_width:o,rendering_height:l,format_width:c,format_height:d}=r.data||{};Module.codecMRG.render({id:e,iFrameNum:i,ssrc:t,rotation:n,x:a,y:s,vwidth:o,vheight:l,format_width:c,format_height:d})}else if("print"===n)out("Thread "+i.threadId+": "+i.text);else if("printErr"===n)err("Thread "+i.threadId+": "+i.text);else if("alert"===n)alert("Thread "+i.threadId+": "+i.text);else if("setimmediate"===i.target)e.postMessage(i);else if("callHandler"===n)Module[i.handler](...i.args);else if("tCrashed"==r.data.cmd){let e="WCL_M,"+r.data.data.toString();postMessage({status:o,data:e})}else if("MCM_VIDEO_LOG"==r.data.cmd){let e=r.data;Module.MCMMonitor_Video_LOG(e.data)}else"video_un_ref"==r.data.cmd?eo.unref():"WCES"==r.data.cmd?ne("webcodec encode start, config ".concat(Oo)):"THWEC"==r.data.cmd?postMessage({status:109,type:0}):"WCEF"==r.data.cmd?Ed(r.data.data,r.data.code,r.data.retry,r.data.subCode,r.data.inHWThread):"TFJSWLF"==r.data.cmd?te("TFJSWLF"):"globalTracingError"===r.data.cmd?ie("Error from pthread worker: ".concat(r.data.data),r.data.error):"GlobalTracingDT"===r.data.cmd?ne("message from pthread worker: ".concat(r.data.data)):"WCDF"==r.data.cmd?(ie("E:H webcodec decode failed ".concat(r.data.data)),eu(!1,r.data.data),te("WCDF:".concat(r.data.data))):"vb-fin"==r.data.cmd||(-35==r.data.cmd?(Sa.setWasmMemoryError(!0),postMessage(r.data)):"webcodecperformance"==r.data.cmd?postMessage({status:123,data:r.data}):n==x||n&&err("worker sent an unknown command "+n));So()&&(PThread.currentProxiedOperationCallerThread=void 0)}};var r=[];for(var i of["onExit","onAbort","print","printErr"])Object.prototype.hasOwnProperty.call(Module,i)&&r.push(i);So()?e.postMessage({cmd:"load",urlOrBlob:Module.mainScriptUrlOrBlob||_scriptDir,wasmMemory,wasmModule:self.wasmModuleToShare,handlers:r,isTeslaMode:!!mo.isTeslaMode,is360penablehwenc:!!Lo,is360penablehwdec:!!Do,isAndroid:!0,encAdditionalConfig:Io,encAddConIdx:Oo,supportHWEncRetry:Uo,encRetryConIdx:Vo,encRetryConfig:Wo}):e.postMessage({cmd:"load",isSingleThreadVBWorker:e.isSingleThreadVBWorker})};function Mo(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];PThread.loadWasmModuleToWorker=Eo,e?(PThread.getNewWorker=function(){return jo.nextWorker},PThread.returnWorkerToPool=function(e){var t=e.pthread_ptr;delete PThread.pthreads[t],e.pthread_ptr=0,__emscripten_thread_free_data(t),jo.threadarray.push(e),PThread.runningWorkers.splice(PThread.runningWorkers.indexOf(e),1)}):(PThread.getNewWorker=function(){let e;return ho.newworker?(e=ho.newworker,ho.newworker=0):e=ho.unusedworkerarray.shift(),e?ho.realusedcount++:ie("get video decode worker thread is null"),e},PThread.returnWorkerToPool=function(e){if(e!=ho.isVideoCodecHelpThreadWorker){var t=e.pthread_ptr;delete PThread.pthreads[t],e.pthread_ptr=0,__emscripten_thread_free_data(t),ho.realusedcount--,setTimeout((()=>{ko(e,!1)}),0),PThread.runningWorkers.splice(PThread.runningWorkers.indexOf(e),1)}else ie("video decode codec help thread worker was released")})}function Ro(e){return e?e>>10<<10:-1}function To(e){let{canvas:t,oldCanvas:r,newDisplayMap:i}=e;for(let e=0;e<bs.length;e++)if(bs[e].canvas===r||bs[e].canvas===t){r!==t&&(bs[e].canvas=t);const n=bs[e].display.getFillMode();bs[e].display=i?i.get(bs[e].display.getTextureIndex()):this._Create_WebGL_Canvas({videoRenderArrayIndex:e,canvas:t,canvasId:bs[e].rendercanvasID}),n&&bs[e].display&&bs[e].display.setFillMode(n,bs[e].display.getFillModeForResolution()),bs[e].borderRadius&&bs[e].display&&bs[e].display.setRoundedCornerRadius(bs[e].borderRadius)}}function xo(e){ho.threadPoolBufferMGR.set(ho.zombiethreadssrc,{pduBuffer:new st,threadState:Pe,threadnumb:1,workerArray:[]}),ho.threadPoolBufferMGR.get(ho.zombiethreadssrc).threadState=e?Le:De}function Co(e,t,r,i){let n=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0;if(t)if(r.threadState===Le){let e=new Uint8Array(t);r.pduBuffer.enqueue(e)}else{let a=r.pduBuffer.dequeue();for(;a;)i(e,a,a.length),a=r.pduBuffer.dequeue();n?Zn(e,n,t.length):i(e,t,t.length)}else{let t=r.pduBuffer.dequeue();for(;t;)i(e,t,t.length),t=r.pduBuffer.dequeue()}}function Ao(e,t){e.threadState=Le,ho.SSrcWaitForThread.push(t),e.isCreateWorkers=!0;let r=e.threadnumb;for(let e=0;e<r;e++)ho.preusedcount<ho.totalthread?ko(null,!1):ho.totalthread<_o&&(PThread.allocateUnusedWorker(),PThread.loadWasmModuleToWorker(PThread.unusedWorkers[ho.totalthread],ko),ho.preusedcount++,ho.totalthread=ho.totalthread+1)}function Fo(e){return er.isUseSsrcStream()?bs.filter((t=>Xd.ssrcEquals(t.ssrc,e))).length>0:!!ys&&ys.Decode_Ssrc(e)}function ko(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(ho.SSrcWaitForThread.length&&ho.SSrcWaitForThread[0]===ho.zombiethreadssrc&&!ho.isVideoCodecHelpThreadWorker){let t=ho.threadPoolBufferMGR.get(ho.zombiethreadssrc);return t.threadnumb=t.threadnumb-1,e&&e.postMessage({cmd:"webcodec",decHAOption:Cd}),ho.isVideoCodecHelpThreadWorker=e,ho.newworker=e,void pa()}!function(e,t){if(e&&!e.msc&&ho.isVideoCodecHelpThreadWorker){let r=new MessageChannel;e.msc=!0,e.postMessage({cmd:"vdmsc1"},[r.port1]),t.postMessage({cmd:"vdmsc2"},[r.port2])}}(e,ho.isVideoCodecHelpThreadWorker),e&&-1==ho.unusedworkerarray.indexOf(e)&&ho.unusedworkerarray.push(e);let r=!1;for(;ho.SSrcWaitForThread.length;){let e=ho.SSrcWaitForThread[0];if(!(e===ho.zombiethreadssrc||Fo(e)||Rs.ssrc&&e==Rs.ssrc>>10<<10)){ho.SSrcWaitForThread.shift(),ho.threadPoolBufferMGR.delete(e);continue}let i=ho.threadPoolBufferMGR.get(e);i&&(i.threadnumb=i.threadnumb-1,t||ho.preusedcount++,r=!0,i.threadnumb||(ho.SSrcWaitForThread.shift(),i.threadState=De,Ia?Co(Ia,null,i,Fn):console.error("<<< ExecutePdu video handle is null")));break}!r&&t&&ho.preusedcount--}function Po(e,t,r){let i,n,a,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;if(!ba&&Gd()&&(is||++va%2400==0&&postMessage({status:o,data:"WCL_M,RTCPVN"+va}),t&&r&&e)){if(uo&&2==e[0]&&e.length>15){if(n=e[12]<<24|e[13]<<16|e[14]<<8|e[15],!Fo(n)&&!Ud(n))return;if(n=n>>10<<10,i=ho.threadPoolBufferMGR.get(n),bl(),i)a=ho.threadPoolBufferMGR.get(n);else{if(a={},a.isCreateWorkers=!1,a.threadState=Pe,a.pduBuffer=new st,!ho.initParseThread){let e=ho.threadPoolBufferMGR.get(ho.zombiethreadssrc);e.threadnumb=ho.totalNumbofParseThread,Mo(!1),Ao(e,ho.zombiethreadssrc),ho.initParseThread=!0}a.threadnumb=1,a.workerArray=[],ho.threadPoolBufferMGR.set(n>>10<<10,a),Cl.set(n>>10<<10,2),Ao(a,n)}}else n=ho.zombiethreadssrc,a=ho.threadPoolBufferMGR.get(n);Co(t,e,a,r,s)}}var Lo=!1,Do=!1;let Io={},Oo=0,Uo=!1,Vo=0,Wo={};var Bo=!1,No=!0,Go=Ye.DESKTOP,jo={},Ho=!1;jo.encodeThreadCreatedFlag=!1,jo.codecThreadCreatedFlag=!1,jo.threadPoolBufferMGR=new Map,jo.waitingThread=[],jo.vbThreadWorker=null,jo.vbReadySetSpecialActionTrue=!1,jo.threadState=Pe,jo.isEnableVideoEncodeHardWareThread=!1,jo.isSupportVirtualBackground=!1,jo.enableVBWasmBackend=!1,jo.videoencodethreadnumb=1,jo.videoencodethreadmaxnumb=1,jo.nextWorker=null,jo.loadedThreadCount=0,jo.vbThreadCreatedFlag=!1,jo.Signal_Encode_Thread={status:Pe,handle:null,initwebcodecflag:!1,latestflag:!1},jo.threadarray=[];class zo{constructor(e){this.workerJsUrl=e,this.worker=null,this.videoRenderObj=null,this.currentUserSsrc=0,this.vbDataQueueCounter=0}setCurrentUserSsrc(e){this.currentUserSsrc=e}generateVideoRenderObj(){this.videoRenderObj||(this.videoRenderObj=new xt({Notify_APPUI:null,isSupportOffscreenCanvas:!0,jsMediaEngine:null,videodecodethreadnumb:1,renderManager:wn,isLSSPlayer:ka}),this.videoRenderObj.setMirrorMyVideoOption(ks),nd&&this.videoRenderObj.Change_Current_SSRC(nd),jl&&this.videoRenderObj.Set_LocalVideo_Buffer(jl),Gl&&this.videoRenderObj.Set_LocalVideo_Ptr(Gl))}setMirrorMyVideoOption(e){this.videoRenderObj&&this.videoRenderObj.setMirrorMyVideoOption(e)}replace_Canvas(e,t){this.videoRenderObj&&this.videoRenderObj.Replace_Canvas(e,t)}render(e){let{width:t,height:r,croppingParams:i,ptr:n,mode:a}=e;const s=a&&a!==Be?t*r*3/2:t*r*4,o="number"==typeof n?oe().subarray(n,n+s):n;this.videoRenderObj&&this.videoRenderObj.Update_SelfVideo_Texture(t,r,o,Ro(this.currentUserSsrc),a,i)}createVBThread(e){this.workerJsUrl&&(this.worker=new Worker(this.workerJsUrl),this.worker.addEventListener("message",(e=>{30===e.data.status?this.postMessage({command:"DOWNLOAD_WASM_FROM_MAIN_THREAD_OK",data:self.wasmModuleToShare}):7===e.data.status?this.postMessage({cmd:"loadWasmSuccess"}):"vb-fin"==e.data.cmd&&this.updateVBDataQueueCounter(!1)})),this.worker.addEventListener("error",(e=>{ie("Error from VB thread",e)})),this.worker.isSingleThreadVBWorker=!0,Eo(this.worker,e),this.generateVideoRenderObj())}hasSubWorker(){return!!this.worker}postMessage(e){if(this.worker){if("vbYuv"===e.cmd||"vbRgba"===e.cmd){if(!this.canTransferVBData(!0))return;this.updateVBDataQueueCounter(!0)}this.worker.postMessage(e)}}updateVBDataQueueCounter(){arguments.length>0&&void 0!==arguments[0]&&arguments[0]?this.vbDataQueueCounter++:this.vbDataQueueCounter>0&&this.vbDataQueueCounter--}canTransferVBData(e){return this.hasSubWorker()&&(!e||this.vbDataQueueCounter<=2)}}let qo=null;class Yo{constructor(){this.initWasmSuccess=!1,this.tfjsUrl=null,this.modelArtifacts={},this.model=null,this.initTfSuccess=!1,this.IOhandle={load:()=>this.modelArtifacts,save:()=>{}},this.afnModel,this.afnModelArtifacts={},this.afnIOHandle={load:()=>this.afnModelArtifacts,save:()=>{}},this.baseModel,this.baseModelArtifacts={},this.baseIOHandle={load:()=>this.baseModelArtifacts,save:()=>{}},this.dualModelOKCount=0,this.tfLoad=!1,this.tfInitPromise=null,this.enableVBWasmBackend=0,self.addEventListener("message",this.handleMessageFromEncodeWorker.bind(this)),self.execute=this.execute.bind(this),self.execute_afn=this.execute_afn.bind(this),self.execute_base=this.execute_base.bind(this)}initTf(e){if(!this.tfLoad){if("string"==typeof e)importScripts(e);else{var t=i().createObjectURL(e);importScripts(t),i().revokeObjectURL(t)}this.tfLoad=!0,this.tfInitPromise=tf.setBackend("webgl").then((e=>{if(!e)return Promise.reject("init tf fail 1")})).catch((()=>{if(!this.enableVBWasmBackend)return postMessage({cmd:"vbInitializeFailed"}),Promise.reject("init tf fail 2");const t=e.substr(0,e.lastIndexOf("/")+1);return importScripts(t+"tf-backend-wasm.min.js"),tf.wasm.setWasmPaths(t),tf.setBackend("wasm").then((e=>{if(!e)return postMessage({cmd:"vbInitializeFailed"}),Promise.reject("init tf fail 3")}),(()=>(postMessage({cmd:"vbInitializeFailed"}),Promise.reject("init tf fail 4"))))}))}}handleMessageFromEncodeWorker(e){switch(e.data.cmd){case"load":break;case"loadWasmSuccess":this.initWasmSuccess=!0,this.checkVBThreadReady();break;case"vbObj0":{this.tfjsUrl=e.data.tfjsUrl;let t=e.data.modelJSON;if(this.modelArtifacts.modelTopology=t.modelTopology,this.modelArtifacts.format=t.format,this.modelArtifacts.generatedBy=t.generatedBy,this.modelArtifacts.convertedBy=t.convertedBy,t.weightsManifest)for(let e=0;e<t.weightsManifest.length;e++)this.modelArtifacts.weightSpecs=t.weightsManifest[e].weights;t.trainingConfig&&(this.modelArtifacts.trainingConfig=t.trainingConfig),t.userDefinedMetadata&&(this.modelArtifacts.userDefinedMetadata=t.userDefinedMetadata),this.modelArtifacts.weightData=e.data.weightData,this.initTf(this.tfjsUrl),this.tfInitPromise.then((()=>{postMessage({cmd:"addMonitorLog",log:"TFBE-"+tf.getBackend()}),tf.loadGraphModel(this.IOhandle).then((e=>{this.model=e,postMessage({cmd:"modelReady"});var t=new Float32Array(110592),r=tf.tensor4d(t,[1,144,256,3],"float32");this.model.predict(r),this.initTfSuccess=!0,this.checkVBThreadReady()}))}));break}case"vbObj1":this.tfjsUrl=e.data.tfjsUrl;var t=e.data.modelJSON;if(this.afnModelArtifacts.modelTopology=t.modelTopology,this.afnModelArtifacts.format=t.format,this.afnModelArtifacts.generatedBy=t.generatedBy,this.afnModelArtifacts.convertedBy=t.convertedBy,t.weightsManifest)for(var r=0;r<t.weightsManifest.length;r++)this.afnModelArtifacts.weightSpecs=t.weightsManifest[r].weights;t.trainingConfig&&(this.afnModelArtifacts.trainingConfig=t.trainingConfig),t.userDefinedMetadata&&(this.afnModelArtifacts.userDefinedMetadata=t.userDefinedMetadata),this.afnModelArtifacts.weightData=e.data.weightData,this.initTf(this.tfjsUrl),this.tfInitPromise.then((()=>{postMessage({cmd:"addMonitorLog",log:"TFBE-"+tf.getBackend()}),tf.loadGraphModel(this.afnIOHandle).then((e=>{this.afnModel=e,0==this.dualModelOKCount&&postMessage({cmd:"modelReady"});var t=new Float32Array(110592),r=new Float32Array(110592),i=new Float32Array(36864),n=tf.tensor4d(t,[1,144,256,3],"float32"),a=tf.tensor4d(r,[1,144,256,3],"float32"),s=tf.tensor4d(i,[1,144,256,1],"float32");this.afnModel.predict([n,a,s]),this.dualModelOKCount++,2==this.dualModelOKCount&&(this.initTfSuccess=!0,this.checkVBThreadReady())}))}));break;case"vbObj2":{this.tfjsUrl=e.data.tfjsUrl;let t=e.data.modelJSON;if(this.baseModelArtifacts.modelTopology=t.modelTopology,this.baseModelArtifacts.format=t.format,this.baseModelArtifacts.generatedBy=t.generatedBy,this.baseModelArtifacts.convertedBy=t.convertedBy,t.weightsManifest)for(let e=0;e<t.weightsManifest.length;e++)this.baseModelArtifacts.weightSpecs=t.weightsManifest[e].weights;t.trainingConfig&&(this.baseModelArtifacts.trainingConfig=t.trainingConfig),t.userDefinedMetadata&&(this.baseModelArtifacts.userDefinedMetadata=t.userDefinedMetadata),this.baseModelArtifacts.weightData=e.data.weightData,this.initTf(this.tfjsUrl),this.tfInitPromise.then((()=>{tf.loadGraphModel(this.baseIOHandle).then((e=>{this.baseModel=e,0==this.dualModelOKCount&&postMessage({cmd:"modelReady"});var t=new Float32Array(110592),r=tf.tensor4d(t,[1,144,256,3],"float32");this.baseModel.predict(r),this.dualModelOKCount++,2==this.dualModelOKCount&&(this.initTfSuccess=!0,this.checkVBThreadReady())}))}));break}case"vbBg":if(e.data.data){const{length:t,width:r,height:i}=e.data;td.sendBg(e.data.data,t,r,i)}break;case"vbBlur":td.sendBlur();break;case"vbYuv":if(e.data.data){const{length:t,width:r,height:i,yDataLength:n,uDataLength:a,vDataLength:s,yStride:o,uStride:l,vStride:c,xOffset:d,yOffset:u,dataFormat:h}=e.data,_=Ol(e.data.data);td.sendYuvData(_,t,r,i,n,a,s,o,l,c,d,u,h)}break;case"vbRgba":if(e.data.data){const{length:t,width:r,height:i,rgbaStride:n,xOffset:a,yOffset:s,dataFormat:o}=e.data,l=Ol(e.data.data);td.sendRgbaData(l,t,r,i,n,a,s,o)}break;case"vbFlag":this.enableVBWasmBackend=e.data.enableVBWasmBackend;break;default:console.warn("unknown message in single thread vb worker:",e.data.cmd)}}checkVBThreadReady(){this.initWasmSuccess&&this.initTfSuccess&&(postMessage({cmd:"vbPredictDone"}),Yn())}execute(e,t,r,i){if(this.model)try{const i=new Float32Array(oe().buffer,e,t),n=tf.tensor4d(i,[1,144,256,3],"float32"),a=this.model.predict(n),s=Float32Array.from(a.as1D(36864).arraySync());return ce().set(s,r>>2),n.dispose(),a.dispose(),0}catch(r){return ie("Error in SingleThreadVBWorker.execute: ".concat(e,", ").concat(t,", ").concat(input_data),r),-1}}execute_base(e,t,r,i){if(this.baseModel){try{tf.tidy((()=>{var n,a,s=new Float32Array(wasmMemory.buffer,e,t),o=tf.tensor4d(s,[1,144,256,3],"float32"),l=this.baseModel.predict(o);1==l[0].size?(n=Float32Array.from(l[0].as1D(36864).arraySync()),a=Float32Array.from(l[1].as1D(1).arraySync())):(n=Float32Array.from(l[1].as1D(36864).arraySync()),a=Float32Array.from(l[0].as1D(1).arraySync()));let c=new Float32Array(wasmMemory.buffer);c.set(a,r>>2),c.set(n,i>>2)}))}catch(r){return ie("Error in SingleThreadVBWorker.execute: ".concat(r,", ").concat(e,", ").concat(t,", ").concat(input_data)),-1}return 0}}execute_afn(e,t,r,i,n){if(this.afnModel){try{tf.tidy((()=>{var a=new Float32Array(oe().buffer,e,i),s=new Float32Array(oe().buffer,t,i),o=new Float32Array(oe().buffer,r,i/3),l=tf.tensor4d(a,[1,144,256,3],"float32"),c=tf.tensor4d(s,[1,144,256,3],"float32"),d=tf.tensor4d(o,[1,144,256,1],"float32"),u=this.afnModel.predict([l,c,d]);const h=Float32Array.from(u.as1D(36864).arraySync());ce().set(h,n>>2)}))}catch(e){return ie("Error in SingleThreadVBWorker.execute: ".concat(e,", ").concat(input_buffer,", ").concat(i,", ").concat(input_data)),-1}return 0}}}let Xo=null;function Ko(e,t,r){let i=jo.threadPoolBufferMGR.get(e);if(i)i.threadState==De&&(postMessage({status:8}),Qc&&postMessage({status:"VBPredictDone",predictCostTime:0}));else{jo.threadPoolBufferMGR.set(e,{threadState:Pe,workerArray:[],threadnumb:t});var n=jo.threadPoolBufferMGR.get(e);if(n.threadState==Pe){n.threadState=Le,jo.waitingThread.push(e);for(let e=0;e<t;e++)if(So()){PThread.allocateUnusedWorker();let e=PThread.unusedWorkers.pop();PThread.loadWasmModuleToWorker(e,(e=>{e.postMessage({cmd:"vbFlag",enableVBWasmBackend:r}),Jo(e)}))}else qo&&qo.createVBThread((e=>{e.postMessage({cmd:"vbFlag",enableVBWasmBackend:r}),Jo(e)}))}}}!function(){if(!So()){const e=t=>{"load"===t.data.cmd&&t.data.isSingleThreadVBWorker&&(Xo=new Yo,postMessage({cmd:"loaded"}),self.removeEventListener("message",e))};self.addEventListener("message",e)}}();const Qo=($o=null,async e=>{$o||($o=new Promise(((e,t)=>{if(!co)return void e(!0);jo.threadState=Le;let r=jo.videoencodethreadnumb;jo.Signal_Encode_Thread.status=Le,r+=7;for(var i=0;i<r;i++){PThread.allocateUnusedWorker();let t=PThread.unusedWorkers.pop();PThread.loadWasmModuleToWorker(t,(function(t){jo.loadedThreadCount++,1==jo.loadedThreadCount?jo.threadarray.push(t):jo.isEnableVideoEncodeHardWareThread&&2==jo.loadedThreadCount?(jo.Signal_Encode_Thread.status=De,jo.Signal_Encode_Thread.handle=t,__Create_HW_Encode&&(jo.nextWorker=t,t.postMessage({cmd:"webcodec"}),__Create_HW_Encode(),jo.nextWorker=null),Ia&&Gn(Ia,jo.Signal_Encode_Thread.latestflag)):jo.threadarray.push(t),jo.loadedThreadCount==r&&(te("ECWS"),jo.threadState=De,e(!0))}))}}))),await $o,nc(e)});var $o;function Jo(e){let t=jo.waitingThread[0];if(void 0!==t){let r=jo.threadPoolBufferMGR.get(t);r&&(r.threadnumb=r.threadnumb-1,r.workerArray.push(e),r.threadnumb||(jo.waitingThread.shift(),r.threadState=De,"VB"==t&&(postMessage({status:8}),jo.vbThreadWorker=e,Zc(0),Zc(1),Zc(2))))}}function Zo(){return co?1:0}function el(){return navigator.hardwareConcurrency||1}function tl(){return ho.videodecodethreadnumb>1&&ho.isEnableVideoDecodeHardWareThread?1:0}function rl(){return ua}function il(){return ha}function nl(){return En}function al(){return!Mn}function sl(){return!!Lo}function ol(){return!!Do}function ll(){return!!mo.isTeslaMode}function cl(){return 1}function dl(){return 8}function ul(e,t,r,i,n,a,s,o,l,c,d,u,h,_,f){postMessage({nodeId:e,timestamp:t,roundTripTime:r,jitter:i,frameWidthInput:n,frameHeightInput:a,frameWidthSent:s,frameHeightSent:o,frameRateInput:l,framesPerSecond:c,bytesSent:d,packetsSent:u,totalPacketSendDelay:h,totalEncodeTime:_,framesEncoded:f,cmd:202,status:202,kind:"video",type:"outbound-rtp",isSharing:!1})}function hl(e,t,r,i,n,a,s,o,l,c,d,u,h,_,f){postMessage({nodeId:e,timestamp:t,rtt:r,jitter:i,frameWidth:n,frameHeight:a,framesPerSecond:s,bytesReceived:o,packetsLost:l,packetsReceived:c,estimatedPlayoutTimestamp:d,totalDecodeTime:u,framesDecoded:h,jitterBufferDelay:_,jitterBufferEmittedCount:f,cmd:203,kind:"video",status:203,type:"inbound-rtp",isSharing:!1})}const _l=(()=>{let e;return{updateKey:t=>{if(t&&(e=t),Ia&&e){let t=new Uint8Array(44);t[0]=102,t[4]=2,t[8]=32,t.set(e,12,e.length),Fn(Ia,t,t.length)}}}})();function fl(e,t){e.length<4||102==e[0]?102==e[0]&&Xs&&_l.updateKey(e.subarray(12)):is?function(e,t){const r=e[0];(16==r||142==r)&&e.length>5&&(Ma!=e[4]&&(Ma=!!e[4]),ja=e),Gd()&&Ia&&(t?Zn(Ia,t,e.length,!1):Fn(Ia,e,e.length,!1))}(e,t):Po(e,Ia,Fn)}function pl(e,t){postMessage({status:w}),yn("video_websocket_on_close")}function ml(e){const{cmd:t}=e;switch(t){case L:{const{rtt:t,jitter:r,avg_loss:i,max_loss:n,bandwidth:a,rate:s,lost_packet_num:o,issend:l}=e;Ia&&oa(Ia,l,t,r,i,n,a,s,o);break}case D:{const{type:t,payload_type:r,issend:i}=e;Ia&&aa(Ia,i,t,r);break}case O:{const{retran:t,retran_switched:r,lostrate:i,issend:n}=e;Ia&&sa(Ia,n,t,r,i);break}case I:{const{bandwidth:t,lostrate:r,issend:i}=e;Ia&&na(Ia,i,t,r);break}case U:ns=e.data,function(){let e=ns||as;Ia&&e!=ss&&te("VQOS-S-"+(e?1:0)+"-"+(ns?1:0)+"-"+(as?1:0)),ss=e}();break;case W:{const{type:t,networkLevel:r,bwLevel:i}=e;postMessage({status:S,isUplink:0===t,networkLevel:r,bwLevel:i});break}case P:postMessage({status:G}),ie("NetWork is Bad, Don't to reconnect the serer!");break;case F:postMessage({status:v}),as=!0;break;case k:postMessage({status:y}),as=!1;break;case q:{let t=e.data;postMessage({status:q,data:t},[t.buffer])}}}function gl(e){if(e==Oe&&Bo&&1280!==Ha){if(Go==Ye.DESKTOP&&Re())return;if(postMessage({status:m,width:1280,height:720}),Go==Ye.IPHONE){let e=He;e=Md(e),to.start(rc,1e3/e)}else if(Go==Ye.ANDROID){let e=ze;e=Md(e),to.start(rc,1e3/e)}eo.start()}else e==Ie&&postMessage({status:m,width:640,height:360})}function vl(e,t,r){let i=se().subarray(t+0,t+r),n=new Uint8Array(r);n.set(i,0,r),ka?12!==n[0]?postMessage({status:Y,data:n},[n.buffer]):postMessage({status:q,data:n},[n.buffer]):Ua.send(n)}var yl=0;function bl(){as&&1!==yl?(yl=1,postMessage({status:b,type:yl})):ns&&!as&&2!==yl?(yl=2,postMessage({status:b,type:yl})):ns||as||3===yl||(yl=3,postMessage({status:b,type:yl}))}function wl(e,t,r,i,n){Qs=!!e,postMessage({status:C,data:{shared_source_id:e,rect_x_norm:t,rect_y_norm:r,rect_cx_norm:i,rect_cy_norm:n}})}function Sl(e,t,r,i,n,a,s){if(2==i&&Sa.setRtpPackets(),!isPreviewMode)if(s)Ua.send(t);else{const e=se().subarray(t+0,t+r);let a=new Uint8Array(4);a[0]=i,a[1]=n,Ua.sendVideo(a,e)}}function El(e,t,r,i,n,a,s,o,l,c){if(!t)return;if(Xo){const d=oe().subarray(t,t+r);let u=new Uint8Array(r);return u.set(d,0,r),postMessage({cmd:"processed_capture_data_callback",ssrc:e,data:u,len_of_data:r,format_width:i,format_height:n,valid_x:a,valid_y:s,valid_width:o,valid_height:l,yuv_limited:c}),u=null,void(t&&Module._free(t))}const d="number"==typeof t;if(!os&&!bc&&!Ds)return void(d&&(t&&Module._free(t),fs&&Atomics.store(fs,0,0)));if(Ha!=o||za!=l)return d&&t&&Module._free(t),void Zs.timeoutReport(0,0);if(!Os)return void(d&&t&&Module._free(t));let u,h;if(d)Kl=Atomics.load(_s,0),Xl=Atomics.load(_s,1),Yl=us+4+(qe+4+8+2)*Xl+4+8,u=oe().subarray(t+0,t+r),oe().subarray(Yl,Yl+r).set(u,0,r),fs[2+(qe+4+8+2)*Xl/2]=i,fs[2+((qe+4+8+2)*Xl+2)/2]=n,fs[2+((qe+4+8+2)*Xl+4)/2]=s,fs[2+((qe+4+8+2)*Xl+6)/2]=a,fs[2+((qe+4+8+2)*Xl+8)/2]=o,fs[2+((qe+4+8+2)*Xl+10)/2]=l,fs[2+((qe+4+8+2)*Xl+12)/2]=Cs-1;else if(os)if(u=t,er.isUseSsrcStream()&&!po)h=new VideoFrame(u,{format:"I420",timestamp:1e3*performance.now(),duration:0,codedWidth:i,codedHeight:n,visibleRect:{left:a,top:s,width:o,height:l}}),Ql(h);else{Yl=Ol(u);let e={width:i,height:n,croppingParams:{top:s,left:a,width:o,height:l},ptr:t,data:0,mode:Cs-1,yuv:We,ssrc:ts,rotation:xs,cmd:"SVIEW"};var _;qs?(e.data=u,e.ptr=0,null===(_=oo)||void 0===_||_.postMessage(e)):qo.render(e)}let f=i*n,p=i*n/4,m=i*n/4,g=i,v=i/2,y=i/2,b=a,w=s;2!=Ts&&(Ts=2,cd());let S=Hl();(S||_a&&self.VideoFrame||po||er.isUseSsrcStream())&&(h=new VideoFrame(u,{format:"I420",timestamp:1e3*performance.now(),duration:0,codedWidth:i,codedHeight:n,visibleRect:{left:a,top:s,width:o,height:l}}),_a&&postMessage({status:K,frame:h}),S&&(eo.captureSample(),zl(h),eo.closeSample()),po&&Ql(h)),h&&h.close(),An(Ia,Yl,f,Yl+f,p,Yl+f+p,m,g,v,y,b,w,Ts,S,0,ql++,Ea,xs),d&&(Atomics.store(_s,1,(Xl+1)%Da),_s[2]=Cs-1),Ds&&Za&&!er.isUseSsrcStream()&&fd(i,n,u,{top:s,left:a,width:o,height:l},Cs-1,xs),d?t&&Module._free(t):(u=null,Ul(Yl))}let Ml=null;function Rl(e){let t=e.data;ka?12!==t[0]?postMessage({status:Y,data:t},[t.buffer]):postMessage({status:q,data:t},[t.buffer]):Ua.send(t)}const Tl=function(){let e=!1;return(t,r,i)=>{!e&&t&&r&&i&&(e=!0,postMessage({status:"FIRST_VIDEO_FRAME"}))}}();function xl(e,t,r,i,n,a,s,o,c,d,u,h){try{var _=oe().subarray(e+0,e+t),f=se().subarray(r,r+8),p=new Uint8Array(8);p.set(f,0,8);var m=0;for(let e=0;e<8;e++)m+=p[e]*Math.pow(256,e);var g=i>>10<<10,v=n,y=a;if(Tl(g,Ha=v,za=y),Ks&&Qs&&g===Ks&&Ce(g,c,d,u),Vl&&we({ssrc:i,r_w:c,r_h:d,rotation:u},Wl,void 0,ka),Ud(i)&&!Rs.firstflag&&(postMessage({status:"NewActiveSpeakerFirstframeCallback",ssrc:Rs.ssrc}),Rs.firstflag=!0),er.isUseSsrcStream()){let e=_;er.shouldCropWasmFrame(n,a,{x:s,y:o,width:c,height:d})&&(e=Ee(_,n,a,{x:s,y:o,width:c,height:d}),v=c,y=d,s=0,o=0),Yd.pushRemoteVideoData(i,e,"I420",v,y,{left:s,top:o,width:c,height:d},{rotation:u})}else if(Ss){if(!ws)return;if(jn){const e=new Uint8Array(_.length);e.set(_,0,_.length);let t={cmd:"decoded",yuvdataptr:0,yuvdata:e,yuvlength:_.length,data:e,ntptime:m,ssrc:g,width:v,height:y,r_y:o,r_x:s,r_h:d,r_w:c,rotation:u,yuv_limited:h,enableMultiDecodeVideoWithoutSAB:jn};return void ys.Put_Video_Data_Queue(t)}Ml||(Ml=new fe(10,32e5));let e=new pe(Ml);if(e.storeSync(_)){let t={yuvdata:e,ntptime:m,ssrc:g,width:v,height:y,r_x:s,r_y:o,r_w:c,r_h:d,rotation:u,yuv_limited:h};ys&&ys.Put_Video_Data_Queue(t,8)}}else if(self.videoDecodeFrameBackSABRingBuffer){let e=new kt;e.setOBJ({data:_,video_timestamp:m,video_ssrc:g,video_width:v,video_height:y,rendering_x:s,rendering_y:o,rendering_w:c,rendering_h:d,rotation:u,yuv_limited:h}),self.videoDecodeFrameBackSABRingBuffer.enqueue(e.obj2buffer()),postMessage({status:l})}else{const e=new Uint8Array(t);e.set(_,0,t),postMessage({status:0,data:e,video_timestamp:m,video_ssrc:g,video_width:v,video_height:y,rendering_x:s,rendering_y:o,rendering_w:c,rendering_h:d,rotation:u,yuv_limited:h},[e.buffer])}}catch(e){Js.timeoutReport(0,0)}}var Cl=new Map;function Al(e,t){Re()&&Zd>=4&&t>2&&(t=2),Cl.set(e>>10<<10,t);let r=Array.from(Cl.values()),i=Math.max.apply(null,r);qa!==i&&(qa=i,postMessage({status:a,ssrc:e,size:qa}))}function Fl(e,t){var r=new Uint8Array(t),i=se().subarray(e+0,e+t);r.set(i,0,t),Ua.send(r)}function kl(e,t){var r=new Uint8Array(t),i=se().subarray(e+0,e+t);r.set(i,0,t),postMessage({status:c,data:Dl(r)})}function Pl(e,t){Ya&&Ya.writeWasmLog(e,t)}function Ll(e,t){Ya&&Ya.writeWasmLog(e,t)}function Dl(e){var t,r,i,n,a,s;for(t="",i=e.length,r=0;r<i;)switch((n=e[r++])>>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:t+=String.fromCharCode(n);break;case 12:case 13:a=e[r++],t+=String.fromCharCode((31&n)<<6|63&a);break;case 14:a=e[r++],s=e[r++],t+=String.fromCharCode((15&n)<<12|(63&a)<<6|63&s)}return t}function Il(e,t){rs||(rs=setInterval((function(){Ia&&Vn(Ia)}),6e4));let r=new Uint8Array(t),i=se().subarray(e+0,e+t);r.set(i,0,t),postMessage({status:h,data:r})}function Ol(e){if(!e)return 0;let t=Module._malloc(e.length);return oe().subarray(t,t+e.length).set(e,0,e.length),t}function Ul(e){e&&Module._free(e)}new st;let Vl=!1,Wl=!0;function Bl(e){if(!ws)return Module._free(e.yuvdataptr),void(e.yuvdataptr=null);if(Tl(e.ssrc,e.width,e.height),Ks&&Qs&&e.ssrc===Ks&&Ce(e.ssrc,e.r_w,e.r_h,e.rotation),Vl&&we(e,Wl,void 0,ka),Ud(e.ssrc)&&!Rs.firstflag&&(postMessage({status:"NewActiveSpeakerFirstframeCallback",ssrc:Rs.ssrc}),Rs.firstflag=!0),er.isUseSsrcStream()){let t;t=e.enableMultiDecodeVideoWithoutSAB?e.data:oe().subarray(e.yuvdataptr,e.yuvdataptr+e.yuvlength);let r=e.width,i=e.height,n=e.r_x,a=e.r_y;er.shouldCropWasmFrame(e.width,e.height,{left:e.r_x,top:e.r_y,width:e.r_w,height:e.r_h})&&(t=Ee(t,e.width,e.height,{left:e.r_x,top:e.r_y,width:e.r_w,height:e.r_h}),r=e.r_w,i=e.r_h,n=0,a=0),Yd.pushRemoteVideoData(e.ssrc,t,"I420",r,i,{left:n,top:a,width:e.r_w,height:e.r_h},{rotation:e.rotation}),e.yuvdataptr&&Module._free(e.yuvdataptr)}else ys&&ys.Update_RemoteVideo_Texture(e)}var Nl,Gl=null,jl=null;function Hl(){return Ha>=fo&&jo.Signal_Encode_Thread.status==De}function zl(e){jo.Signal_Encode_Thread.handle&&(jo.Signal_Encode_Thread.handle.postMessage({cmd:"videoframe",data:e}),eo.ref())}var ql=0;let Yl,Xl,Kl;function Ql(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];var r;er.isUseSsrcStream()?Yd.pushLocalVideoFrame(e,{rotation:xs,isRotationInFrame:t,mirror:ks}):null===(r=oo)||void 0===r||r.postMessage({cmd:"SVIEW",rotation:xs,mode:1,data:e,fromVideoTag:t})}async function $l(e){!function(e){us||(ho.isSupportMultiThread?((Ba||Na||Ga||Go==Ye.ANDROID)&&self.VideoFrame&&e.frame instanceof VideoFrame&&(Da=1,po=!0),ps=4+qe*Da+12*Da+2*Da,us=Module._malloc(ps),_s=oe().subarray(us,us+ps),fs=(self.GROWABLE_HEAP_U16?self.GROWABLE_HEAP_U16():Module.HEAPU16).subarray(us/2,(us+ps)/2),Atomics.store(fs,0,0),po||postMessage({status:u,data:us,wasmMemory})):(ps=qe,us=Module._malloc(ps)))}(e);let t,r,i,n=null,a=null,s=0,l=0,c=0,d=0,h=0,_=0,f=0,p=0,m=0,g=0,v=0,y=0;if(function(){let e=Hl(),t=Ho&&Ma&&Ra>1&&po&&!Is&&!Os&&!bc&&!Ds&&e&&jo.Signal_Encode_Thread.latestflag;if(t!=Ea){let r="WCL_M,UEP|abOption:".concat(Ho,"|dualCall:").concat(Ma,"|mask:").concat(Is,"|vb:").concat(Os,"|setting:").concat(bc||Ds,"|webcodec:").concat(e&&jo.Signal_Encode_Thread.latestflag,"|video:").concat(po,"|maxSubVideo:").concat(Ra,"|optCopyFrame:").concat(t);postMessage({status:o,data:r}),ne(r),Ea=t}}(),Os){let e=qe;t=Module._malloc(e),Vs<8&&Ws>ze&&(Ws=ze,to.start(rc,1e3/Ws))}else ho.isSupportMultiThread?(Kl=Atomics.load(_s,0),Xl=Atomics.load(_s,1),(Xl+1)%Da==Kl?(hs||(po?hs=us+4+4+8+2:(ps=qe,hs=Module._malloc(ps))),Yl=hs):Yl=us+4+(qe+4+8+2)*Xl+4+8+2,r=0):Yl=us,t=Yl;if(!po||Os||Is||Ql(e.frame,Na),Sa.setVideoCaptured(!0),e.frame&&e.format&&(2==e.format||4==e.format)){if(i=e.frame,p=i.visibleRect?i.visibleRect.width:i.cropWidth,m=i.visibleRect?i.visibleRect.height:i.cropHeight,g=i.visibleRect?i.visibleRect.left:i.cropLeft,v=i.visibleRect?i.visibleRect.top:i.cropTop,p!==Ha||m!==za)return i.close(),void eo.closeSample();l=p,s=m,c=l/2,d=l/2,h=p*m,_=p*m/4,f=p*m/4,y=p*m*3/2,r=y,g=0,v=0;let o={top:v,left:g,width:p,height:m};if(Is&&wa){let t,r=dd(o.width);if(As)t=Bc(i,o,Yl,r),eo.captureSample();else{if(4==e.format){let e=p*m*5/2;oc&&a&&a.length==e||(oc&&Module._free(oc),oc=Module._malloc(e))}else wc&&wc.length==y||(wc=new Uint8Array(y));if(4==e.format){let e=p*m*5/2;a=oe().subarray(oc,oc+e),await i.copyTo(a),wc=new Uint8Array(a.buffer,oc,y)}else await i.copyTo(wc);t=Yc(l,s,wc,Yl,o,2,r),eo.captureSample()}if(Os||1==Ts||(Ts=1,cd()),os){let e=Hl();e&&zl(t),Cn(Ia,Yl,pc,4*Gs.rgba_stride,Gs.rgba_x,Gs.rgba_y,Ts,e,0,ql++,Ea,xs)}po&&t&&Ql(t),t&&(t.close(),eo.closeSample()),No=!0,l=Ha,s=za,p=Ha,m=za,g=0,v=0}else{if(!Ea)if(2==e.format)n=oe().subarray(t,t+y),await i.copyTo(n);else{let e=p*m*5/2;n=oe().subarray(t,t+e),await i.copyTo(n)}if(Os||2==Ts||(Ts=2,cd()),ud(i,o,l,s,Ts,t,y),!Is&&Os)td.sendYuvData(t,0,Ha,za,h,_,_,l,c,c,g,v,2);else{let e=Hl();e&&zl(i),An(Ia,t,h,t+h,_,t+h+_,f,l,c,d,g,v,Ts,e,0,ql++,Ea,xs)}No=!0}}else if(e.frame&&e.format&&3==e.format){if(i=e.frame,p=i.visibleRect?i.visibleRect.width:i.cropWidth,m=i.visibleRect?i.visibleRect.height:i.cropHeight,g=i.visibleRect?i.visibleRect.left:i.cropLeft,v=i.visibleRect?i.visibleRect.top:i.cropTop,p!==Ha||m!==za)return i.close(),void eo.closeSample();l=p,s=m,c=l,h=p*m,_=p*m/2,y=p*m*3/2,r=y,g=0,v=0;let a={top:v,left:g,width:p,height:m};if(Is&&wa){let e,t=dd(a.width);if(As?(e=Bc(i,a,Yl,t),eo.captureSample()):(wc&&wc.length==y||(wc=new Uint8Array(y)),i.copyTo(wc),e=Yc(l,s,wc,Yl,a,3,t),eo.captureSample()),Os||1==Ts||(Ts=1,cd()),os){let t=Hl();t&&zl(e),Cn(Ia,Yl,pc,4*Gs.rgba_stride,Gs.rgba_x,Gs.rgba_y,Ts,t,0,ql++,Ea,xs)}po&&e&&Ql(e),e&&(e.close(),eo.closeSample()),No=!0,l=Ha,s=za,p=Ha,m=za,g=0,v=0}else{if(Ea||(n=oe().subarray(t,t+y),await i.copyTo(n)),Os||3==Ts||(Ts=3,cd()),ud(i,a,l,s,3,t,y),!Is&&Os)td.sendYuvData(t,0,Ha,za,h,_,_,l,c,c,g,v,3);else{let e=Hl();e&&zl(i),An(Ia,t,h,t+h,_,t+h,_,l,c,c,g,v,Ts,e,0,ql++,Ea,xs)}No=!0}}else if(e.frame&&e.format&&(5==e.format||1==e.format)){if(i=e.frame,p=i.visibleRect?i.visibleRect.width:i.cropWidth,m=i.visibleRect?i.visibleRect.height:i.cropHeight,g=i.visibleRect?i.visibleRect.left:i.cropLeft,v=i.visibleRect?i.visibleRect.top:i.cropTop,p!==Ha||m!==za)return i.close(),void eo.closeSample();y=p*m*4,r=y,l=p,s=m,g=0,v=0;let n=5==e.format?4:1,a={top:v,left:g,width:p,height:m};if(Is){let e,r=dd(a.width);if(As?(e=Bc(i,a,t,r),eo.captureSample()):(wc&&wc.length==y||(wc=new Uint8Array(y)),await i.copyTo(wc),e=Yc(l,s,wc,t,a,n,r),eo.captureSample()),Os||1==Ts||(Ts=1,cd()),os){let r=Hl();r&&zl(e),Cn(Ia,t,y,4*Gs.rgba_stride,Gs.rgba_x,Gs.rgba_y,Ts,r,0,ql++,Ea,xs)}po&&e&&Ql(e),e&&(e.close(),eo.closeSample()),No=!0,l=Ha,s=za,p=Ha,m=za,g=0,v=0}else{if(!Ea){const e=oe().subarray(t,t+y);await i.copyTo(e)}if(Os||Ts==n||(Ts=n,cd()),ud(i,a,l,s,n,t,y),!Is&&Os)td.sendRgbaData(t,y,Ha,za,4*Gs.rgba_stride,Gs.rgba_x,Gs.rgba_y,n);else{let e=Hl();e&&zl(i),Cn(Ia,t,y,4*Gs.rgba_stride,Gs.rgba_x,Gs.rgba_y,Ts,e,0,ql++,Ea,xs)}No=!0}}else{Os||1==Ts||(Ts=1,cd()),ad&&(jo.isEnableVideoEncodeHardWareThread&&(jo.Signal_Encode_Thread.latestflag=!1,Gn(Ia,!1)),ad=!1),l=Ha,s=za,p=Ha,m=za,g=0,v=0;let i=oe().subarray(t,t+e.length);r=e.length,pc=e.length,i.set(e,0,r),Os?td.sendRgbaData(t,pc,l,s,4*Gs.rgba_stride,Gs.rgba_x,Gs.rgba_y,1):Ia&&Cn(Ia,t,pc,4*Gs.rgba_stride,Gs.rgba_x,Gs.rgba_y,1,!1,0,ql++,Ea,xs)}if(!Os)if(er.isUseSsrcStream()&&!po){const t=!!i&&Na;1!=Ts||i||(i=new VideoFrame(e,{format:"RGBA",timestamp:1e3*performance.now(),duration:0,codedWidth:l,codedHeight:s,visibleRect:{left:g,top:v,width:p,height:m}})),Ql(i,t)}else{if(ho.isSupportMultiThread)Yl!=hs&&(fs[2+(qe+4+8+2)*Xl/2]=l,fs[2+((qe+4+8+2)*Xl+2)/2]=s,fs[2+((qe+4+8+2)*Xl+4)/2]=v,fs[2+((qe+4+8+2)*Xl+6)/2]=g,fs[2+((qe+4+8+2)*Xl+8)/2]=p,fs[2+((qe+4+8+2)*Xl+10)/2]=m,fs[2+((qe+4+8+2)*Xl+12)/2]=Ts-1|xs<<8,Atomics.store(_s,1,(Xl+1)%Da),_s[2]=Ts-1);else if(qo){let r={width:l,height:s,croppingParams:{top:v,left:g,width:p,height:m},ptr:t,mode:Ts-1,ssrc:ts,cmd:"SVIEW",data:null,rotation:xs,fromVideoTag:!1};var b;1!=Ts||i?(r.data=i,r.fromVideoTag=Na,r.mode=1):r.data=e,qs?null===(b=oo)||void 0===b||b.postMessage(r):(r.mode=Ts-1,qo.render(r))}if(Ds&&Za){let e={top:v,left:g,width:p,height:m};fd(l,s,new Uint8Array(oe().subarray(Yl,Yl+r)),e,Ts-1,xs)}}i&&(i.close(),eo.closeSample())}let Jl=0;const Zl=20;function ec(e){return Go==Ye.ANDROID&&e.displayWidth<e.displayHeight?(Fa||(Fa=new OffscreenCanvas(1,1)),xs=3,function(e,t){const r=t.getContext("2d");let i=e.displayHeight,n=e.displayWidth;ls&&!Ca||(e.displayHeight>640||e.displayWidth>640)&&(i/=2,n/=2),t.width===i&&t.height===n||(t.width=i,t.height=n,r.setTransform(0,1,-1,0,t.width,0)),r.drawImage(e,0,0,n,i)}(e,Fa),e.close(),e=new VideoFrame(Fa,{timestamp:1e3*performance.now()})):Fa&&Fa.width>1&&(Fa.width=1,Fa.height=1),e}async function tc(e){let{done:t,value:r,processed:i,rotation:n}=e;if(t)return void(r&&r.close());if(Zi.hasProcessor()&&!i&&!Os)return No=!0,Zi.onFrame(r),void r.close();xs=n,eo.captureSample();let a,s=ec(r);if("undefined"==s||null==s||null==s.format||"undefined"==s.format)return ie("video frame reader read null frame"),void s.close();if(s.format&&"I420"==s.format)a={frame:s,format:2};else if(s.format&&"NV12"==s.format)a={frame:s,format:3};else if(s.format&&"I420A"==s.format)a={frame:s,format:4};else if("BGRA"==(null==s?void 0:s.format))a={frame:s,format:5};else if("RGBA"==(null==s?void 0:s.format))a={frame:s,format:1};else if(s.format)return ie("Frame format ".concat(s.format," is not supported")),Ls||(Ls=!0,postMessage({status:g,format:s.format})),void s.close();let o=s.visibleRect?s.visibleRect.width:s.cropWidth,l=s.visibleRect?s.visibleRect.height:s.cropHeight;"BGRA"==s.format||"I420A"===s.format||a.format,Ha===o&&za===l||(Ha=o,za=l,Gs.rgba_stride=o,Gs.rgba_x=0,Gs.rgba_y=0,cd(),postMessage({status:p,width:Ha,height:za})),await $l(a)}function rc(){let e=performance.now();if(!(e-Jl<Zl)){for(Jl=e,++ga%1440==0&&postMessage({status:o,data:"WCL_M,VCTN"+ga}),eo.captureTicket();bn.getLength()>2;){let e=bn.dequeue();e&&e.frame?(e.frame.close(),eo.closeSample()):$a||!Ba&&null!=e&&e.data&&postMessage({data:e.data},[e.data.buffer])}if(co&&(jo.isSupportVirtualBackground&&cc&&!Is&&!jo.vbThreadCreatedFlag||jo.threadState==Pe)){let e=bn.dequeue();e&&e.frame?(e.frame.close(),eo.closeSample()):Ja||(ou(0),!Ba&&null!=e&&e.data&&postMessage({status:z,data:e.data},[e.data.buffer]))}else{if(!xa&&$a&&Fs.reader&&No)No=!1,Fs.read().then(tc).catch((e=>{ie("Error trying to process video frame",e),No=!0}));else{const e=bn.dequeue();e&&(xs=e.orientation);var t=null==e?void 0:e.data;if(t){const{stride:r,x:i,y:n,frame_width:a,frame_height:s}=e;Gs.rgba_stride==r&&Gs.rgba_x==i&&Gs.rgba_y==n||(Gs.rgba_stride=r,Gs.rgba_x=i,Gs.rgba_y=n),a==Ha&&s==za||(Ha=a,za=s,cd()),eo.captureSample(),Sa.setVideoCaptured(!0),$l(t)}else e&&(eo.captureSample(),Sa.setVideoCaptured(!0),$l(e))}0!=ms.size||$a||xa||Ja||(ou(0),!Ba&&t&&t.length&&postMessage({status:z,data:t},[t.buffer]))}}}var ic=!1;function nc(e){if(!Ia||Oa!=e.ssid&&e.ssid){if(Ia&&(xn(Ia),Ia=null),Ia=Tn(e.ssid,e.mtu_size,Xa,Ka,0,0,jo.videoencodethreadmaxnumb,jo.isEnableVideoEncodeHardWareThread,is,!1,Ns,!1,js,er.shouldCropWasmFrameOnPosMismatch(),er.shouldCropWasmFrameOnSizeMismatchOnly()),ad=jo.isEnableVideoEncodeHardWareThread,!Ia)return void postMessage({status:N});if(Oa=e.ssid,_l.updateKey(),Vn(Ia),es){let e=Module._malloc(es.length);oe().subarray(e,e+es.length).set(es,0,es.length),On(Ia,ts,e,es.length),Module._free(e)}ja&&Fn(Ia,ja,ja.length),In(Ia,Wa?1:0),Ha=e.width,za=e.height,Gs.rgba_stride=e.width,ic=!0,Pn(Ia,e.width,e.height,e.fps,Ts),ld(),ns?kn(Ia,16e5,1):kn(Ia,2e6,0),os=!0,fa(Ia,Va)}Sa.startCheck(),os=!0,$a||ou(0),Go!=Ye.IPHONE&&Go!=Ye.ANDROID||(Ws=Ge),Ws=Md(Ws),te("HCIW=".concat(Vs)),to.start(rc,1e3/Ws),eo.start()}var ac,sc,oc,lc=null,cc=null,dc=null,uc=null,hc={vcanvas:null,mcanvas:null},_c=null,fc=null,pc=0,mc=0,gc=0,vc=0,yc={dx:0,dy:0,dWidth:0,dHeight:0},bc=!1,wc=null,Sc=new Uint8Array(4),Ec={sx:0,sy:0,sw:0,sh:0};function Mc(e){"BgImage"==e.imagename?cc=e.data:"MaskImage"==e.imagename&&(lc=e.data,yc=Object.assign(yc,e.maskCoordinate),Ha=Ha||e.width,za=za||e.height,Gs.rgba_stride=Ha),Uc(yc,Ha,za)}class Rc{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;this.id=e,this.decodeInputIndex=1,this.context=null,this.decodeOutputIndex=0,this.videoFrameBuffer=[]}destory(){this.videoFrameBuffer.forEach((e=>e.videoFrame.close())),this.videoFrameBuffer=[]}getFrameIdData(e){let t=0;return this.videoFrameBuffer.some(((r,i)=>{if(r.frameIndex<e)r.videoFrame.close();else if(r.frameIndex===e)return t=r.videoFrame,this.videoFrameBuffer.splice(0,i+1),!0;return!1})),t}putFrameIdData(e,t){this.videoFrameBuffer.push({videoFrame:e,frameIndex:t})}deleteOneFrame(){if(this.videoFrameBuffer.length){let e=this.videoFrameBuffer.shift();if(e)return e.videoFrame.close(),1}return 0}getVideoFrameNumbers(){return this.videoFrameBuffer.length}}function Tc(){return 1}function xc(e,t){return jo.Signal_Encode_Thread.handle&&jo.Signal_Encode_Thread.handle.postMessage({cmd:"VideoEncodeInit",id:e,context:t}),0}function Cc(e,t,r,i,n,a){return jo.Signal_Encode_Thread.handle&&jo.Signal_Encode_Thread.handle.postMessage({cmd:"VideoEncodeConfigure",id:e,Bitrate:t,Framerate:r,Width:i,Height:n,buffer:a}),0}function Ac(e,t,r,i,n,a){return jo.Signal_Encode_Thread.handle&&jo.Signal_Encode_Thread.handle.postMessage({cmd:"VideoEncode",id:e,videoFrameId:t,NewIDR:r,rawData:i,dataLength:n,timeout:a}),0}function Fc(){jo.Signal_Encode_Thread.handle&&jo.Signal_Encode_Thread.handle.postMessage({cmd:"CloseVideoEncode"})}function kc(e){Ys=e}var Pc,Lc,Dc,Ic,Oc=new class{constructor(){this.decodeCodecHandles=new Map,this.ssrcToMap=new Map,this.totalVideoFrameNumbers=0,this.activeIds=[],this.usingVideoFrameList=[],this.videowebcodecencodestate=1}_checkUnusefulId(e,t){if(this.ssrcToMap.has(e)&&this.ssrcToMap.get(e)!==t){const r=this.decodeCodecHandles.get(t);r&&(r.destory(),this._deleteActiveId(t)),this.ssrcToMap.delete(e)}this.ssrcToMap.has(e)||this.ssrcToMap.set(e,t)}_getTotalVideoFrameNumbers(){let e=0;for(let t of this.decodeCodecHandles.keys()){let r=this.decodeCodecHandles.get(t);r&&(e+=r.getVideoFrameNumbers())}return e}_setActiveIds(e){this._deleteActiveId(e),this.activeIds.unshift(e),this.activeIds.length>9&&this.activeIds.splice(9,this.activeIds.length-9)}_deleteActiveId(e){this.activeIds.some(((t,r)=>{if(t===e)return this.activeIds.splice(r,1),!0}))}render(e){let{id:t,iFrameNum:r,ssrc:i,rotation:n,x:a,y:s,vwidth:o,vheight:l,format_width:c,format_height:d}=e;i=Ro(i),t=i,this._checkUnusefulId(i,t);const u=this.decodeCodecHandles.get(i);if(!u)return;this._setActiveIds(t);let h=u.getFrameIdData(r);if(h){if(this.totalVideoFrameNumbers=this._getTotalVideoFrameNumbers(),ys){const{displayWidth:e,displayHeight:t}=h;Tl(i,e,t),Ks&&Qs&&i===Ks&&Ce(i,e,t,n),Vl&&we({ssrc:i,r_w:e,r_h:t,rotation:n},Wl,void 0,ka),Ud(i)&&!Rs.firstflag&&(postMessage({status:"NewActiveSpeakerFirstframeCallback",ssrc:Rs.ssrc}),Rs.firstflag=!0);let r=c==h.codedWidth?{x:a,y:s,width:o,height:l}:null;ys.Update_RemoteVideo_Texture(h,!0,i,n,r)}er.isUseSsrcStream()&&Yd.pushRemoteVideoFrame(i,h,{rotation:n}),(wn.getRendererProvider().isWebGLRendererType()||wn.getRendererProvider().isWebGL2RendererType()||er.isUseSsrcStream())&&h.close()}}closeFrame(e){try{const t=this.usingVideoFrameList.indexOf(e);-1!==t&&this.usingVideoFrameList.splice(t,1),e.close&&e.close()}catch(e){ie("Error when closing a video frame",e)}}_checkMaxVideoFrameNumbers(e){if(this.totalVideoFrameNumbers>9-this.usingVideoFrameList.length)for(let e=this.activeIds.length-1;e>=0;e--){const t=this.activeIds[e],r=this.decodeCodecHandles.get(t);if(r||this._deleteActiveId(),r.getVideoFrameNumbers()>1){r.deleteOneFrame(),this.totalVideoFrameNumbers=this._getTotalVideoFrameNumbers();break}}if(this.totalVideoFrameNumbers>9-this.usingVideoFrameList.length){const t=this.decodeCodecHandles.get(e);t&&(t.deleteOneFrame(),this.totalVideoFrameNumbers=this._getTotalVideoFrameNumbers())}}put_data(e){let{id:t,ssrc:r,data:i,frameIndex:n}=e;if(r=Ro(r),!Fo(r)&&Ro(null==Rs?void 0:Rs.ssrc)!==r)return void i.close();let a=this.decodeCodecHandles.get(r);a?t!=a.id&&(a.destory(),a.id=t):(a=new Rc(t),this.decodeCodecHandles.set(r,a)),a.putFrameIdData(i,n),this.totalVideoFrameNumbers++,this._checkMaxVideoFrameNumbers(r)}clearAll(){for(let e of this.decodeCodecHandles.keys()){const t=this.decodeCodecHandles.get(e);t&&t.destory()}this.decodeCodecHandles.clear(),this.ssrcToMap.clear(),this.activeIds=[]}clear(e){const t=this.decodeCodecHandles.get(e);t&&(t.destory(),this.decodeCodecHandles.delete(e));const r=this.ssrcToMap.get(e);r&&(this.ssrcToMap.delete(e),this._deleteActiveId(r))}};function Uc(e,t,r){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;try{"object"==typeof t&&t.ideal&&(t=t.ideal),"object"==typeof r&&r.ideal&&(r=r.ideal),dc&&uc||(dc=new OffscreenCanvas(t,r),uc=_e(dc)),dc.width==t&&dc.height==r||(dc.width=t,dc.height=r)}catch(e){ie("Update_Mask_Texture, width=$".concat(JSON.stringify(t),", height=").concat(JSON.stringify(r),". "),e),t=dc.width,r=dc.height}if(uc.clearRect(0,0,t,r),ac=null,lc&&cc&&"blur"!==cc){if(e.dWidth>0&&e.dHeight>0&&gc>0&&vc>0&&t>0&&r>0){let i=e.dx/(gc/t),n=e.dy/(vc/r),a=e.dWidth/(gc/t),s=e.dHeight/(vc/r);uc.drawImage(lc,i,n,a,s)}let n,a,s,o;if(uc.globalCompositeOperation="source-out",Vc(),n=Ec.sx,a=Ec.sy,s=Ec.sw,o=Ec.sh,uc.drawImage(cc,n,a,s,o,0,0,t,r),i){let e=uc.getImageData(0,0,t,r);ac=new Uint8Array(e.data.buffer),i.updateSelfMaskImage(t,r,ac)}}else i&&(ac=Sc,i.updateSelfMaskImage(1,1,ac))}function Vc(){let e,t,r,i=0,n=16/9,a=cc.width,s=cc.height;n*s>=a?(r=a,i=a/n,e=0,t=(s-i)/2):(r=s*n,i=s,e=(a-r)/2,t=0),Ec.sx=e,Ec.sy=t,Ec.sw=r,Ec.sh=i}function Wc(e,t,r){if(!Us.get(sc)||!Us.get(sc).canvas)return;let i=t||e.width,n=r||e.height;Us.get(sc).display||(Us.get(sc).display=Us.get(sc).canvas.getContext("2d"));const a=mc?vt(i,n,void 0,void 0,Us.get(sc).canvas.width/Us.get(sc).canvas.height):id?vt(i,n):null;ks?(Ps||(Us.get(sc).display.scale(-1,1),Ps=!0),Us.get(sc).display.clearRect(0-Us.get(sc).canvas.width,0,Us.get(sc).canvas.width,Us.get(sc).canvas.height),Us.get(sc).display.drawImage(e,...a?[a.left,a.top,a.width,a.height]:[],0-Us.get(sc).canvas.width,0,Us.get(sc).canvas.width,Us.get(sc).canvas.height)):(Ps&&(Us.get(sc).display.setTransform(1,0,0,1,0,0),Ps=!1),Us.get(sc).display.clearRect(0,0,Us.get(sc).canvas.width,Us.get(sc).canvas.height),Us.get(sc).display.drawImage(e,...a?[a.left,a.top,a.width,a.height]:[],0,0,Us.get(sc).canvas.width,Us.get(sc).canvas.height))}function Bc(e,t,r){let i=arguments.length>3&&void 0!==arguments[3]&&arguments[3],n=t.width,a=t.height;if(wa&&(hc.mcanvas&&_c||(hc.mcanvas=new OffscreenCanvas(n,a),_c=_e(hc.mcanvas)),hc.mcanvas.width==n&&hc.mcanvas.height==a||(hc.mcanvas.width=n,hc.mcanvas.height=a),_c.clearRect(0,0,n,a),_c.drawImage(e,0,0,n,a),dc?_c.drawImage(dc,0,0,n,a):Uc(yc,n,a)),Us.get(sc)&&Us.get(sc).canvas&&(wa?Wc(hc.mcanvas):Wc(e,n,a)),wa){let e=_c.getImageData(0,0,n,a),t=new Uint8Array(e.data.buffer);return oe().subarray(r,r+t.length).set(t,0,t.length),pc=t.length,i?new VideoFrame(hc.mcanvas,{timestamp:1e3*performance.now()}):null}}function Nc(){}function Gc(){var e,t;if(fc){if(!1===(null===(e=(t=fc).isAvaiable)||void 0===e?void 0:e.call(t))){var r,i;null===(r=(i=fc).restoreContext)||void 0===r||r.call(i)}}else{const e={forceNoGL:void 0,contextOptions:{webglcontextlostCallback:Nc,webglcontextrestoredCallback:jc},webGLResources:void 0,initMask:!0};fc=wn.createWebGLVideoRenderDisplay(hc.vcanvas,"MixMask",0,e)}}function jc(){fc=null,Gc()}function Hc(e,t){let{canvas:r,rendercanvasID:i}=t;de(i)}function zc(e,t){let{canvas:r,rendercanvasID:i}=t;ue(i)}function qc(){return 1}function Yc(e,t,r,i,n,a){let s,o=arguments.length>6&&void 0!==arguments[6]&&arguments[6],l=n.width,c=n.height;if(wa){var d;if(hc.vcanvas||(hc.vcanvas=new OffscreenCanvas(l,c)),null===(d=fc)||void 0===d||!d.isAvaiable())return void Gc();hc.vcanvas.width==l&&hc.vcanvas.height==c||(hc.vcanvas.width=l,hc.vcanvas.height=c),fc.setVideoMode(a-1),ac?fc.updateSelfMaskImage(l,c,ac):Uc(yc,l,c,fc);let i={x:0,y:0,width:l,height:c};fc.updateRemoteVideoTextures(e,t,n,r,0,!0,i,!1),fc.drawRemoteVideo(i),s=fc.readPixelsSyncRequest(0,0,l,c)}else s=r;let u=Us.get(sc)?Us.get(sc).canvas:null;if(u){!function(e,t){var r,i;if(Us.get(t).display){if(!1===(null===(r=(i=Us.get(t).display).isAvaiable)||void 0===r?void 0:r.call(i))){var n,a;null===(n=(a=Us.get(t).display).restoreContext)||void 0===n||n.call(a)}}else{const r={forceNoGL:void 0,contextOptions:{webglcontextlostCallback:Hc,webglcontextrestoredCallback:zc,params:{canvas:e,rendercanvasID:t}},webGLResources:void 0,initMask:!1};Us.get(t).display=wn.createVideoRenderDisplay(e,t,0,r)}Us.get(t).display.setFillMode(mc)}(u,sc);let i=u?Us.get(sc).display:null,o={left:0,top:0,width:l,height:c},d={x:0,y:0,width:u.width,height:u.height};wa?(i.setVideoMode(0),i.updateSelfVideoTextures(l,c,s,o),i.drawSelfVideo(d,!1,ks)):(i.setVideoMode(a-1),i.updateRemoteVideoTextures(e,t,n,r,0,!0,d,!1),i.drawRemoteVideo(d,ks)),wn.renderWith(i)}return wa&&(oe().subarray(i,i+s.length).set(s,0,s.length),pc=s.length),o?wa?new VideoFrame(s,{format:"RGBA",timestamp:1e3*performance.now(),codedWidth:l,codedHeight:c}):void 0:null}var Xc,Kc,Qc=!1,$c=(new Object,[{dataReady:!1,configReady:!1,modelArtifacts:new Object,modelJSON:null},{dataReady:!1,configReady:!1,modelArtifacts:new Object,modelJSON:null},{dataReady:!1,configReady:!1,modelArtifacts:new Object,modelJSON:null}]);async function Jc(e,t){if(!$c[t].dataReady||!$c[t].configReady){if($c[t].dataReady=!0,$c[t].modelJSON=JSON.parse(e.json),$c[t].modelArtifacts.modelTopology=$c[t].modelJSON.modelTopology,$c[t].modelArtifacts.format=$c[t].modelJSON.format,$c[t].modelArtifacts.generatedBy=$c[t].modelJSON.generatedBy,$c[t].modelArtifacts.convertedBy=$c[t].modelJSON.convertedBy,null!=$c[t].modelJSON.weightsManifest)for(const e of $c[t].modelJSON.weightsManifest)$c[t].modelArtifacts.weightSpecs=e.weights;null!=$c[t].modelJSON.trainingConfig&&($c[t].modelArtifacts.trainingConfig=$c[t].modelJSON.trainingConfig),null!=$c[t].modelJSON.userDefinedMetadata&&($c[t].modelArtifacts.userDefinedMetadata=$c[t].modelJSON.userDefinedMetadata),$c[t].configReady=!0,$c[t].modelArtifacts.weightData=e.bin,Lc&&Zc(t)}}function Zc(e){$c[e].dataReady&&$c[e].configReady&&Lc&&jo&&!jo.vbThreadCreatedFlag&&jo.vbThreadWorker&&(jo.vbThreadWorker.postMessage({cmd:"vbObj"+e,tfjsUrl:Dc,modelJSON:$c[e].modelJSON,weightData:$c[e].modelArtifacts.weightData,vbBaseUrl:Ic}),$c[e].modelArtifacts.weightData=null,$c[e].modelJSON=null)}async function ed(e){if(Lc)return;Ic=e.substr(0,e.lastIndexOf("/")+1);const t=await function(e){return vn(this,void 0,void 0,(function*(){const t=yield gn(e);return yield t.blob()}))}(e);Dc=t,Lc=!0,Zc(0),Zc(1),Zc(2)}const td={sendBg:function(e,t,r,i){let n=new Uint8Array(e);if(So()||Xo){let e=Ol(n);Xn(e,t,r,i)}else qo&&qo.canTransferVBData()?qo.postMessage({cmd:"vbBg",data:n,length:t,width:r,height:i}):n=null},sendBlur:function(){So()||Xo?Kn(0,0):qo&&qo.canTransferVBData()&&qo.postMessage({cmd:"vbBlur"})},sendYuvData:function(e,t,r,i,n,a,s,o,l,c,d,u,h){const _=3===h?n+a:n+a+s,f=e+n,p=3===h?f:f+a;if(So()||Xo)return Qn(e,t,r,i,e,n,f,a,p,s,o,l,c,d,u,h),void(Xo&&postMessage({cmd:"vb-fin"}));if(qo&&qo.canTransferVBData(!0)){let f=oe().subarray(e,e+_),p=new Uint8Array(_);p.set(f,0,_),qo.postMessage({cmd:"vbYuv",data:p,length:t,width:r,height:i,yDataLength:n,uDataLength:a,vDataLength:s,yStride:o,uStride:l,vStride:c,xOffset:d,yOffset:u,dataFormat:h}),p=null}Ul(e)},sendRgbaData:function(e,t,r,i,n,a,s,o){if(So()||Xo)return $n(e,t,r,i,n,a,s,o),void(Xo&&postMessage({cmd:"vb-fin"}));if(qo&&qo.canTransferVBData(!0)){let l=oe().subarray(e,e+t),c=new Uint8Array(t);c.set(l,0,t),qo.postMessage({cmd:"vbRgba",data:c,length:t,width:r,height:i,rgbaStride:n,xOffset:a,yOffset:s,dataFormat:o})}Ul(e)}};function rd(e){if(e.data){if("blur"==(cc=e.data))td.sendBlur();else{let e,t,r,i,n,a;Vc(),e=Ec.sx,t=Ec.sy,r=Ec.sw,i=Ec.sh,r>1280?(n=1280,a=720):(n=r,a=i),Pc||(Pc=new OffscreenCanvas(n,a)),Pc.width=n,Pc.height=a;let s=Pc.getContext("2d");s.drawImage(cc,e,t,r,i,0,0,Pc.width,Pc.height);let o=s.getImageData(0,0,Pc.width,Pc.height);td.sendBg(o.data,o.data.length,Pc.width,Pc.height)}Os=!0,Sa.setVBFlag(!0)}else cc=null,Os=!1,Sa.setVBFlag(!1)}let id=!1;var nd,ad=!1,sd=!0,od=!1;function ld(){if(!Ia)return;let e=Lo||ll(),t=Ha,r=za,i=function(e,t){return e&&t?Math.abs(e/t-4/3)<.01?2:Math.abs(e/t-16/9)<.01?3:1:1}(t,r),n=function(e,t,r,i,n){if(!n&&!i||1==e)return!1;let a=i&&t>=640,s=n&&t>=1280;return 2!=e||640==t&&480==r?a||s:((a||s)&&re("ratio is 4:3 but wencodec not supported width: ".concat(t,", height: ").concat(r)),!1)}(i,t,r,sd&&e&&ls,sd&&ls);id&&(3==i||od||(od=!0,ne("disable original ratio ".concat(t," x ").concat(r))),n=n&&3==i,i=3),Jn(Ia,i),jo.isEnableVideoEncodeHardWareThread&&(ad=n,jo.Signal_Encode_Thread.latestflag=n&&sd,Gn(Ia,jo.Signal_Encode_Thread.latestflag))}function cd(){Ia&&(Dn(Ia,Ha,za,Ws,Ts),ld())}function dd(e){return po||e>=fo&&jo.Signal_Encode_Thread.status==De}function ud(e,t,r,i,n,a,s){Is&&(As?Bc(e,t,0,!1):Yc(r,i,oe().subarray(a,a+s),0,t,n,!1))}function hd(e,t){let{canvas:r,rendercanvasID:i}=t;de(i)}function _d(e,t){let{canvas:r,rendercanvasID:i}=t;ue(i)}function fd(e,t,r,i,n){var a,s;let o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0;if(!Us.get(Za)||!Us.get(Za).canvas)return;if(function(e,t){var r,i;if(Us.get(t).display){if(!1===(null===(r=(i=Us.get(t).display).isAvaiable)||void 0===r?void 0:r.call(i))){var n,a;null===(n=(a=Us.get(t).display).restoreContext)||void 0===n||n.call(a)}}else{const r={forceNoGL:void 0,contextOptions:{preserveDrawingBuffer:!1,webglcontextlostCallback:hd,webglcontextrestoredCallback:_d,params:{canvas:e,rendercanvasID:t}},webGLResources:void 0,initMask:!1};Us.get(t).display=wn.createVideoRenderDisplay(e,t,0,r)}Us.get(t).display.setFillMode(mc)}(Us.get(Za).canvas,Za),null===(a=Us.get(Za).display)||void 0===a||null===(s=a.isAvaiable)||void 0===s||!s.call(a))return;let l={x:0,y:0,width:Us.get(Za).canvas.width,height:Us.get(Za).canvas.height};Us.get(Za).display.setVideoMode(n);const c=id?vt(i.width,i.height):null,d=Us.get(Za).display;n===Ve?d.updateSelfVideoTextures(e,t,r,i,!0,o):d.updateRemoteVideoTextures(e,t,c||i,r,o,!0,l,!1),d.drawRemoteVideo(l,ks),wn.renderWith(d)}function pd(){if(bn)for(;bn.getLength()>0;){let e=bn.dequeue();e.frame&&e.frame.close()}bn=new st}function md(){if(Us.size>4){let e=Array.from(Us.keys());ie("settingRenderCanvas set more than 4 canvas, size=".concat(Us.size,", ids:").concat(e.join()))}}function gd(e,t,r,i,n,a,s,o,l){Hs.monitorPanelFlag&&postMessage({status:X,data:{width:e,height:t,fps:r,rtt:i,jitter:n,avg_loss:a,max_loss:s,bandwidth:o,rate:l}}),is||!Hs.renderFlag||Hs.messageIndex++%ke==0||Hs.monitorPanelFlag}function vd(){const e=()=>{Ia&&Hn(Ia)};if(Hs.qosIntervalId&&clearInterval(Hs.qosIntervalId),Hs.monitorPanelFlag||Hs.renderFlag){if(Hs.monitorPanelFlag)return void(Hs.qosIntervalId=setInterval(e,Hs.panelpollingInterval||Fe));if(Hs.renderFlag)return void(Hs.qosIntervalId=setInterval(e,ke*Fe))}}function yd(e){Ia&&fa(Ia,e),Va=e}function bd(e,t,r){postMessage({status:S,isUplink:0===e,networkLevel:t,bwLevel:r})}function wd(e,t){var r=oe().subarray(e+0,e+t);postMessage({status:o,data:Dl(r)})}function Sd(e){switch(e.status){case 0:ws&&ys&&ys.Set_SSRC_Latest_Time_Stamp(e.data);break;case 1:if(Ia){let t=Module._malloc(e.data.length);oe().subarray(t,t+e.data.length).set(e.data),Bn(Ia,t,e.data.length),Module._free(t);let r=new Uint32Array(e.data.buffer),i=null;for(let t=0;t<e.data.length/16;t++)if(512&r[4*t]){i=r.subarray(4*t,4*t+4);break}if(!i)return;if(ho.isSupportOffscreenCanvas&&lo){let e=232.8*i[1]/1e9+1e3*i[2];lo.postMessage(e)}}break;case 2:ws&&ys&&e.data&&ys.Set_SSRC_Latest_Time_Stamp(e.data,e.ssrc),ho.isSupportOffscreenCanvas&&lo&&e.sdata&&lo.postMessage(e.sdata)}}function Ed(e,t){let r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,n=arguments.length>4&&void 0!==arguments[4]&&arguments[4];if(ie("E:H webcodec encode failed code ".concat(t," ").concat(e,", config ").concat(Oo,", retry ").concat(r,", subCode ").concat(i,", inHWThread=").concat(n)),n||(r=(t===Ke.WEBCODEC_RETRY||t===Ke.WEBCODEC_TIMEOUT_ERROR)&&Uo&&Oo<Vo,r&&postMessage({cmd:"webcodecRetry",id:e,errCode:t})),r){Oo=Vo,Io=Wo,Mn=!1;try{let e=JSON.stringify(Io);En=e.includes("L1T2")?1:0}catch(e){}te("WCEF-retry=".concat(!Mn,"|code=").concat(t,"|id=").concat(e,"|subCode=").concat(i,"|l1t2=").concat(En,"|inHWThread=").concat(n))}else if(eu(!0,e,t),te("WCEF-code=".concat(t,"|id=").concat(e,"|subCode=").concat(i,"|l1t2=").concat(En,"|inHWThread=").concat(n)),Ca=!0,!Aa&&(Go==Ye.IPHONE||Go==Ye.ANDROID)){let e=je;to.start(rc,1e3/e),Rd(e)}}function Md(e){let t=e;return Aa||Go!=Ye.IPHONE&&Go!=Ye.ANDROID||(t=ls&&!Ca?Ge:je),Rd(t),t}function Rd(e){(e>30||e<0)&&(e=Ge),Bs=Math.floor(1e3/e)-3}function Td(){return Rn}function xd(e,t){te("TO: ".concat(Rn,", CT ").concat(performance.now(),", NT: ").concat(e>>>0,", ").concat(t>>>0))}var Cd,Ad=-1;self.addEventListener("message",(async function(e){var t=e.data;let r=e.data;switch(t.command){case"start_video_processor":Zi.addFrameCallback(r.name,(e=>{tc({done:!1,value:e,processed:!0,rotation:0})})),Zi.startProcessor(r.name,new $i(r.name,Ta));break;case"stop_video_processor":Zi.stopProcessor(r.name);break;case"processor_message_port":Ta=t.data;break;case 136:Ad=r.workerType;break;case 1:try{if(f={enabled:!!r.enableFetchWithCache,reportLog(e){ne("FetchCache: ".concat(JSON.stringify(e)))},resourcePath:r.mediaSDKCDNPath},p=Object.assign({enabled:!0,cacheName:"zm-media",reportLog(e){console.log("FetchCache",e)}},f),nn.enabled=p.enabled??!1,nn.reportLog=p.reportLog??an,nn.cacheName=p.cacheName??"zm-media",nn.enableLocalDebugLog=p.enableLocalDebugLog??!1,nn.resourcePath=p.resourcePath,mn=cn&&nn.enabled&&nn.resourcePath?pn:un,te("STARTMEDIA:".concat(function(e){let t=e.confId,r=!!e.isPreviewMode?1:0;return r|=Gd()?2:0,"".concat(t,":").concat(r)}(r))),r.pslVideoId&&(Ks=r.pslVideoId),ka=!!r.isLSSPlayer,Pa=!!r.enableTCP,isPreviewMode&&!r.isPreviewMode&&(Ia&&xn(Ia),Ia=null,wo.inited&&(wo.clear(),wo.start()),Is=!1),isPreviewMode=!!r.isPreviewMode,r.MaskFlag&&(wa=!0),function(e){let t=e;if(Rn=e.currentTime-performance.now(),t._id,ua=e.graphicalname,ha=e.vendorname,is=t.sendvideo,Ns=t.uplimit?t.uplimit:0,Go=e.platformType,Ba=!!t.isChromeOrEdge,Na=!!t.isArmSafari,Ga=!!t.isFirefox,Qa=t.mtu_size,t.isSafari,Xa=t.meetingnumb+"",Ka=t.meetingid,jn=!!t.enableMultiDecodeVideoWithoutSAB,Sn=e.isWebCodecDecoderOnWhitelist,Xs=e.isVDIWebview,Gt=tr,Zt.init(e.renderUserAgentInfo),Qt.init(e.renderCapabilitiesDesc),er.init(e.renderConfigDesc),4===e.rendererType){er.setIsUseSsrcStream(!0);const t=rr.loadModuleFromBlob("wasm_ssrc_stream_service_dynmod",e.wasmSsrcStreamServiceDynmodBlob);qd=t,Xd=qd.exports.getSsrcManager(),Yd=qd.exports.getWasmSsrcStreamPublisher(),qd.exports.setRegistryServicePort(e.registryServicePort),qd.exports.exposeService(is?"local":"remote|default")}if(jn?(is||!t.isSupportMultiThread?ho.videodecodethreadnumb=1:(ho.videodecodethreadnumb=25,jn=!1),t.IsRenderInWorker||(qs=!1)):(qs=!1,ho.videodecodethreadnumb=t.videodecodethreadnumb),t.isSupportMultiThread&&nu.isSupportOffScreenCanvasWebgl()||(ho.videodecodethreadnumb=1),ho.isSupportMultiThread=t.isSupportMultiThread,ho.isSupportOffscreenCanvas=t.isSupportOffscreenCanvas&&nu.isSupportOffScreenCanvasWebgl(),mo.isTeslaMode=e.isTeslaMode,ts=t.confId,js=Go==Ye.IPHONE||Go==Ye.ANDROID,is){Lo=e.is360penablehwenc,Bo=e.enable720p,Ho=!!e.enableOptCopyFrame,fo=Lo?640:1280,ho.videodecodethreadnumb=1,jo.isSupportVirtualBackground=t.isSupportVirtualBackground,jo.enableVBWasmBackend=t.enableVBWasmBackend,jo.videoencodethreadmaxnumb=e.videoencodethreadnumb,ls=e.initWebCodecFlag,jo.Signal_Encode_Thread.initwebcodecflag=ls,jo.Signal_Encode_Thread.latestflag=ls,jo.isEnableVideoEncodeHardWareThread=e.isSupportWebCodecEnocde,jo.videoencodethreadnumb=e.isSupportWebCodecEnocde?2:1,Io=e.hwEncAdditionalConfig,Oo=e.hwEncAddConIdx,Uo=e.supportHWEncRetry,Vo=e.hwEncRetryConIdx,Wo=e.hwEncRetryConfig,Mn=e.supportHWEncRetry&&e.hwEncAddConIdx<e.hwEncRetryConIdx;try{let e=JSON.stringify(Io);En=e.includes("L1T2")?1:0}catch(e){}}else uo=ho.videodecodethreadnumb>1&&t.isSupportMultiThread&&nu.isSupportOffScreenCanvasWebgl(),Do=e.is360penablehwdec,ls=!!(t.isenablehw&&ho.videodecodethreadnumb>1),ho.isEnableVideoDecodeHardWareThread=t.isEnableVideoDecodeHardWareThread,ho.isEnableVideoDecodeHardWareThread||(ho.totalNumbofParseThread=3,ls=!1),_o=ho.videodecodethreadnumb>1?ho.videodecodethreadnumb+3:1,e.isPreviewMode||io()}(r),Qd||(function(e){var t;Ya||null===(t=Ya=function(){let e=!1;try{e=!1}catch(e){}return e?new Nt:null}())||void 0===t||t.init({workerType:e})}(is?Ct.VIDEO_ENCODE:Ct.VIDEO_DECODE),Module.wcl_trace_log=Ll,Module.codecMRG=Oc,Module.MCMMonitor_Video_LOG=wd,Module.put_data=Bl,Module.js_info_from_wcl_thread=Rl,Module.decode_callback=Al,Module.on_psl_mix_share_info_changed=wl,Module.js_info_from_wcl_video_data=Sl,Module.change_capture_resolution=gl,Module.APP_Troubleshoting_Info=kl,Module.SAVE_IV=Il,Module.processed_capture_data_callback=El,Qd=!0),Kd||(is?(xo(!1),jo.videoencodethreadmaxnumb>1&&(Mo(!0),co="function"==typeof Worker)):xo(!!uo),Kd=!0),isPreviewMode){!function(e){postMessage({status:27}),is&&jo.isSupportVirtualBackground?is&&jo.isSupportVirtualBackground&&Ko("VB",1,jo.enableVBWasmBackend):postMessage({status:8}),Hd(e),zd(e)}(r);break}if(ts){var i;const e={cmd:V,data:ts};null===(i=Ua)||void 0===i||i.sendCommand(e)}Gd()||(Nd=!1,te("RSTHOLD")),la||(la=setInterval((()=>{Gd()&&ma&&Ia&&ca(Ia,!!is)}),1e3)),zd(r),Hd(r),is?jo.isSupportVirtualBackground?jo.isSupportVirtualBackground&&Ko("VB",1,jo.enableVBWasmBackend):postMessage({status:8}):(Cd=r.decHAOption,te("decHAOption:".concat(Cd)),jd()),setTimeout((()=>{const e=ns||as;ne("VIDEO_NETWORK_".concat(is?"SEND":"RECV",":").concat(e))}),3e4)}catch(e){postMessage({status:N}),ie("Error in startMedia",e)}break;case 5:su(t.websocket_ip_address,!0);break;case 3:var n;null===(n=Ua)||void 0===n||n.closeWebsocket();break;case 6:var a;null===(a=Ua)||void 0===a||a.resetWebrTransportUrl(t.webtransportURL);break;case 4:var s;null===(s=Ua)||void 0===s||s.closeWebTransport();break;case"failover":su(t.websocket_ip_address,!1);break;case 2:ba=!0,is&&da(),Ua&&(Ua.close(),Ua=null),rs&&(clearInterval(rs),rs=null),Sa.stopCheck(),Ia&&(Ln(Ia),xn(Ia)),close(),function(){try{const e=!1;ys&&bs.length?bs.forEach((t=>{ys.cleanup(t.canvas,t.display,e)})):wn.cleanup(null,null,e)}catch(e){console.error("Video cleanup:",e)}}();break;case"encodeVideoFrame":bn.enqueue(t);break;case"startVideoEncode":if(te("startVideoEncode:".concat(!!is)),void 0!==t.disableOriginalRatio&&(id=!!t.disableOriginalRatio),er.isUseSsrcStream()&&Xd.setLocalVideoSsrc(t.ssid),!is)return void(ys&&(ys.Set_Capture_Video_Flag(!0),ys.Set_LocalVideo_SSRC(t.ssid),ys.Set_Cropping_Mode(!!id)));qo&&qo.setCurrentUserSsrc(t.ssid),ma=!0,No=!0,$a=!!t.isSupportMediaStreamTrackProcessor,As=!!t.isSupport2DCanvasDrawFrame,Ja=!!t.isSupportVideoFrame,Rd(Ws=t.fps||Ws),Ws!=Ge&&(Aa=!0),Qo(t),au(Ne.SESSION_TYPE_VIDEO,!0);break;case"releaseStream":Fs.closeReadStream();break;case"frameStream":Fs.setReadStream(t.data);break;case"DOWNLOAD_JSON_FROM_MAIN_THREAD_OK":if("js"==t.type){ed(t.data);break}Jc(t.data,t.index);break;case"updateVideoPara":Ia&&(pd(),Ha=t.width,za=t.height,Gs.rgba_stride=t.width,Gs.rgba_x=0,Gs.rgba_y=0,cd());break;case"stopVideoEncode":if(te("stopVideoEncode:".concat(!!is)),is)ma=!1,os=!1,bc||(fc&&fc.clearDisplay(),_c&&_c.clearRect(0,0,hc.mcanvas.width,hc.mcanvas.height)),Ds||(Us.get(Za)&&Us.get(Za).display&&Us.get(Za).display.clearDisplay(),Za=null),bc||Ds||(clearInterval(rs),rs=null,to.stop(),eo.stop(),Sa.stopCheck(),fs&&Atomics.store(fs,0,0),pd());else if(ys)return void ys.Set_Capture_Video_Flag(!1);break;case"ENCRYPT":Ia&&(Wa=t.encrypt,In(Ia,Wa?1:0));break;case"SOCKET_RECONNECT":self.IS_DISABLE_SOCKET_RECONNECT=!0===r.disable;break;case 7:!function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;var r;(r=e instanceof Uint8Array?e:new Uint8Array(e)).length<4||0==r[0]||(Ia?Po(r,Ia,Fn,t):console.log("video handle is not ready!",r[0]))}(t.data);break;case"OfflineCanvas":t.canvasname&&t.canvas.getContext("2d")&&ms.set(t.canvasname,t.canvas.getContext("2d"));break;case"mirrorMyVideo":ks=t.isMirrorMyVideo,!is&&t.isSupportOffscreenCanvas?ys&&ys.setMirrorMyVideoOption(ks):qo&&qo.setMirrorMyVideoOption(ks);break;case"yuvVideoFrame":{let r=t.data;if(!r)return eo.captureSample(),void ou(Bs);if(Zi.hasProcessor()&&!Os)return Zi.onFrame(r),r.close(),void ou(Bs);let i=t.rotation||0;xs=Ga&&Go===Ye.ANDROID?0:i;let n=performance.now();try{if(r=ec(r),r.format&&"I420"==r.format)bn.enqueue({frame:r,format:2,rotation:i});else if(r.format&&"NV12"==r.format)bn.enqueue({frame:r,format:3,rotation:i});else if(r.format&&"I420A"==r.format)bn.enqueue({frame:r,format:4,rotation:i});else if(r.format&&"BGRA"==r.format)bn.enqueue({frame:r,format:5,rotation:i});else if(r.format&&"RGBA"==r.format)bn.enqueue({frame:r,format:1,rotation:i});else if(r.format)return ie("Frame format ".concat(r.format," is not supported")),Ls||(Ls=!0,postMessage({status:g,format:r.format})),void r.close();let e=r.visibleRect?r.visibleRect.width:r.cropWidth,t=r.visibleRect?r.visibleRect.height:r.cropHeight;Ha===e&&za===t||(Ha=e,za=t,Gs.rgba_stride=e,Gs.rgba_x=0,Gs.rgba_y=0,xs=i,cd());let n=bn.dequeue();eo.captureSample(),await $l(n)}catch(e){ie("video process exception")}let a=performance.now(),s=Bs-(a-n);s<=0&&(s=0),ou(s)}break;case"VideoPlayStatus":ws=t.data.isVideoPlayWork;break;case"startvideointerval":$a=!!t.isSupportMediaStreamTrackProcessor,As=!!t.isSupport2DCanvasDrawFrame,Ds=!!t.isVBSettingOn,Ja=!!t.isSupportVideoFrame,bc=!!t.isMaskSettingOn,No=!0,Rd(Ws=t.fps||Ws),Qo(t);break;case"StartVBSetting":Ds=!0,bc=!1,Is=!1,pd(),t.isSwitch&&fs&&Atomics.store(fs,0,0),to.start(rc,1e3/Ws),eo.start();break;case"VBOfflineCanvas":if(t.canvas){let e=Us.get(t.rendercanvasID);e&&wn.cleanup(e.canvas,e.display);let r=null;(wn.getRendererProvider().isWebGLRendererType()||wn.getRendererProvider().isWebGL2RendererType())&&(r={forceNoGL:void 0,contextOptions:{preserveDrawingBuffer:!1,webglcontextlostCallback:hd,webglcontextrestoredCallback:_d,params:{canvas:t.canvas,rendercanvasID:t.rendercanvasID}},webGLResources:void 0,initMask:!1});const i=wn.createVideoRenderDisplay(t.canvas,t.rendercanvasID,0,r);Us.set(t.rendercanvasID,{canvas:t.canvas,id:t.rendercanvasID,display:i}),md()}Za=t.rendercanvasID;break;case"MaskOfflineCanvas":if(t.canvas){let e=Us.get(t.rendercanvasID);e&&wn.cleanup(e.canvas,e.display),Us.set(t.rendercanvasID,{canvas:t.canvas,id:t.rendercanvasID,display:null}),md()}sc=t.rendercanvasID,gc=Us.get(t.rendercanvasID).canvas.width,vc=Us.get(t.rendercanvasID).canvas.height;break;case"vbbgimagebitmap":rd(t);break;case"addExtVbReceiver":_a=!0;break;case"removeExtVbReceiver":_a=!1;break;case"finishVBSetting":fs&&Atomics.store(fs,0,0),Us.get(Za)&&Us.get(Za).display&&Us.get(Za).display.clearDisplay(),Za=null,Ds=!1,os||bc||(clearInterval(rs),rs=null,fc&&fc.clearDisplay(),_c&&_c.clearRect(0,0,hc.mcanvas.width,hc.mcanvas.height),self.resizeCanvas&&self.resizeCanvas());break;case"WORKER_BOLB_URL":t.blobUrl&&!So()&&(qo=new zo(t.blobUrl));break;case"StartMaskSetting":bc=!0,Ds=!1,Os=!1,Is=!!t.enabled,mc=t.fillMode?1:0,Us.get(sc)&&Us.get(sc).display&&Us.get(sc).display.setFillMode&&Us.get(sc).display.setFillMode(mc),t.isSwitch&&(Uc(yc,Ha,za),fs&&Atomics.store(fs,0,0));break;case"update_setting_canvas_size":Us.get(t.rendercanvasID)&&Us.get(t.rendercanvasID).canvas&&(t.rendercanvasID===sc||t.rendercanvasID===Za)&&(Us.get(t.rendercanvasID).canvas.width=t.width,Us.get(t.rendercanvasID).canvas.height=t.height);break;case"maskandbgimagebitmap":bc=!0,Mc(t);break;case"finishMaskSetting":fs&&Atomics.store(fs,0,0),Us.get(sc)&&Us.get(sc).display&&Us.get(sc).canvas&&(As?(Us.get(sc).display.setTransform(1,0,0,1,0,0),Us.get(sc).display.clearRect(0,0,Us.get(sc).canvas.width,Us.get(sc).canvas.height)):Us.get(sc).display.clearDisplay()),sc=null,bc=!1,Ps=!1,cc||(Is=!1),os||Ds||(fc&&fc.clearDisplay(),_c&&_c.clearRect(0,0,hc.mcanvas.width,hc.mcanvas.height),to.stop(),eo.stop(),pd());break;case"healthCheck":if(t.type===Xe)switch(t.op){case 0:to.stop(),eo.stop(),Sa.setPaused(!0);break;case 1:to.start(rc,1e3/Ws),eo.start(),Sa.setPaused(!1);break;case 2:to.stop(),eo.stop(),Sa.stopCheck()}break;case"renderOfflineCanvas":{const e=is?qo.videoRenderObj:ys;if(t.canvas)vs.get(t.rendercanvasID)&&Bd(e,t.rendercanvasID),vs.set(t.rendercanvasID,{canvas:t.canvas});else{let e=vs.get(t.rendercanvasID);e&&(t.canvas=e.canvas)}var o;if(ka&&ys&&ys.Remove_Pause(t),ws=!0,Ss=!0,er.isUseSsrcStream()||(Es=t.waterMarkText,Ms=t.isCreateVideoWaterMark,e.Set_WaterMark_Info({waterMarkCanvas:!1,isCreateVideoWaterMark:Ms,videoWaterMarkName:Es,watermarkOpacity:t.watermarkOpacity,watermarkRepeated:t.watermarkRepeated,watermarkPosition:t.watermarkPosition}),kd(e)),te("OFFRENDER:".concat(t.ssrc)),1!=t.ssrc||Rs.ssrc||(er.isUseSsrcStream()?Rs.ssrc=Xd.getActiveSpeakerSsrc():Rs.ssrc=null===(o=ys)||void 0===o?void 0:o.getActiveSpeakerSsrc()),bs.length)for(let e=0;e<bs.length;e++)if(bs[e].ssrc==t.ssrc&&bs[e].zone==t.zone)return void te("SAME:".concat(t.ssrc));if(bs.push(t),!er.isUseSsrcStream()){if((jn||ho.videodecodethreadnumb>1)&&(t.display=e.Get_Display(t.canvas,t.rendercanvasID,t.ssrc,To),t.display&&t.display.setFillMode(t.fillMode,t.fillModeForResolution)),t.borderRadius){var l;const e=yt(t.borderRadius,t.width,t.height);t.borderRadius=e,null===(l=t.display)||void 0===l||l.setRoundedCornerRadius(e)}bs.length>0&&e.Set_Render_Array(bs)}ma=!0,Hs.renderFlag||is||1==bs.length&&e.Get_Capture_Video_Flag()||(Hs.renderFlag=!0,vd())}break;case 128:Bd(ys,t.rendercanvasID);break;case 153:{var c;let e=null===(c=t.data)||void 0===c?void 0:c.ssrc;if(!e||Rs.ssrc==e)break;var d;Vd(Rs.ssrc),Rs.ssrc=e,Rs.firstflag=!1,ws=!0,er.isUseSsrcStream()?Xd.setActiveSpeakerSsrc(e):null===(d=ys)||void 0===d||d.setActiveSpeakerSsrc(e)}break;case"cancelNewActiveSpeakerSsrcBefreCallback":Vd(t.ssrc),Rs.ssrc==t.ssrc&&(Rs.ssrc=null,Rs.firstflag=!1),0==bs.length&&(ws=!1);break;case"CHANGE_CURRENT_ACTIVE_SSRC":nd=t.ssrc,ys&&ys.Change_Current_SSRC(t.ssrc);break;case"stopVideoRender":{if(t.MFlag)return void(ma=!1);Ms=!1,Es="";const e=is?qo.videoRenderObj:ys;let r=vs.get(t.canvas);if(bs.length&&(r||er.isUseSsrcStream()))for(let r=0;r<bs.length;r++)if(bs[r].ssrc==t.ssrc&&bs[r].zone==t.zone)if(ka){if(t.doNotClean)ys.Add_Pause(t),ys.Draw_Last_Frame();else{let e=bs.splice(r,1);ys.clearUseridRender(e,t.RGBA),ys.Set_Render_Array(bs,jn),ys.GiveBack_Display(e)}Hs.renderFlag&&!is&&(1==bs.length&&ys.Get_Capture_Video_Flag()||0==bs.length)&&(Hs.renderFlag=!1,vd())}else Wd(e,bs.splice(r,1),t.RGBA)}break;case"removeVideoPlay":if(gs){let e=is?qo.videoRenderObj:ys;e&&Pd(e),gs=null,ws=!1}break;case"decodeVideoPortWithAudio":t.port.onmessage=function(e){Sd(e.data)};break;case"audioDecodeTime":Sd(t);break;case 129:{let e=r.data.userNodeList;e&&e.forEach((e=>{let t=parseInt(e.userid);if(e.bremove)return void(Ia&&Un(Ia,t));let r=e.sn;if(16!=r.length&&32!=r.length)return;let i=Ol(r);if(Ia){let e=!1;is&&ts!=t||(e=!0),e&&On(Ia,t,i,r.length)}is&&ts==t&&(es=r),Ul(i)}));break}case 149:{let e=r.data.interval,t=Go==Ye.DESKTOP?10:20;if(ho.isSupportMultiThread){const r=601508;if(null==cs){if(null==(cs=Module._malloc(r)))return void console.log("malloc failed");Atomics.store(le().subarray(cs/4,cs/4+r),0,0),Atomics.store(le().subarray(cs/4,cs/4+r),1,0)}ru.sender={sab:wasmMemory,length:r,offset:cs,useCopy:!1,useOneElement:!1,interval:e?t:0}}else{let i=r.data.data.buffer,n=0,a=r.data.data.length;ru.sender={sab:i,length:a,offset:n,useCopy:!1,useOneElement:!1,interval:e?t:0}}Ua&&Ua.setSabBuffer(ru.sender,null);break}case 11:Hs.monitorPanelFlag=r.data.enable,Hs.panelpollingInterval=r.data.pollingInterval,vd();break;case 160:r.data.isVideo&&(zs.videoStatisticsFlag=r.data.enable,yd(zs.videoStatisticsFlag));break;case 150:{let e=Go==Ye.DESKTOP?10:20;if(ho.isSupportMultiThread){const t=601508;if(null==ds){if(null==(ds=Module._malloc(t)))return void console.log("malloc failed");Atomics.store(le().subarray(ds/4,ds/4+t),0,0),Atomics.store(le().subarray(ds/4,ds/4+t),1,0)}ru.reciver={sab:wasmMemory,offset:ds,length:t,interval:e,useCopy:!1,useOneElement:!1}}else{let t=r.data.buffer,i=r.data.offset,n=r.data.length;ru.reciver={sab:t,offset:i,length:n,interval:e,useCopy:!1,useOneElement:!1}}Ua&&Ua.setSabBuffer(null,ru.reciver);break}case"VIDEO_DECODE_FRAME_BACK_SAB":{let e=r.data.buffer,t=r.data.bytesPerEle;self.videoDecodeFrameBackSABRingBuffer=new At(e,t);break}case"decodeVideoPort":so&&so.close(),(so=e.ports[0]).onmessage=function(e){if("SVIEW"!=e.data.cmd);else if(e.data.mode&&!e.data.yuv){var t,r;null!==(t=e.data)&&void 0!==t&&t.data&&(null===(r=ys)||void 0===r||r.Update_LocalVideo(e.data.data,e.data.rotation,!!e.data.fromVideoTag),(wn.getRendererProvider().isWebGLRendererType()||wn.getRendererProvider().isWebGL2RendererType()||er.isUseSsrcStream())&&e.data.data.close())}else{let t=e.data;ys.Update_SelfVideo_Texture(t.width,t.height,t.data,t.ssrc,t.mode,t.croppingParams)}};break;case"encodeVideoPort":oo&&(oo.close(),oo=null),oo=e.ports[0];break;case"vsport":lo&&(lo.close(),lo=null),lo=e.ports[0];break;case"update_canvas_size":{let e=vs.get(r.rendercanvasID);e?(e.canvas.width=r.width,e.canvas.height=r.height):te("USNC:".concat(r.rendercanvasID))}break;case"encodedimagebitmapwasmptr":Gl=r.data,jl=r.wasmMemory,ys&&(ys.Set_LocalVideo_Buffer(jl),ys.Set_LocalVideo_Ptr(Gl));break;case"zoomrender":if(t.isPaused&&ys&&ys.Zoom_Render_Paused(t),bs.length){let e=vs.get(t.canvas);for(let r=0;e&&r<bs.length;r++)if(bs[r].ssrc==t.ssrc&&bs[r].zone==t.zone){var u=[bs[r]];let e={};const i=wn.getRendererProvider().isWebGLRendererType(),n=wn.getRendererProvider().isWebGL2RendererType();if((i||n)&&(e.x=bs[r].x,e.y=bs[r].y,e.width=bs[r].width,e.height=bs[r].height),bs[r].x=t.x,bs[r].y=t.y,bs[r].width=t.width,bs[r].height=t.height,t.borderRadius){var h;const e=yt(t.borderRadius,t.width,t.height);bs[r].borderRadius=e,null===(h=bs[r].display)||void 0===h||h.setRoundedCornerRadius(e)}ys&&(ys.clearUseridRender(u,t.RGBA,e,t.isPaused),ys.Zoom_Render(bs[r]));break}}break;case"update_border_radius":if(bs.length&&t.borderRadius)for(let e=0;e<bs.length;e++)if(bs[e].ssrc==t.ssrc&&bs[e].zone==t.zone){if(t.borderRadius){var _;const r=yt(t.borderRadius,bs[e].width,bs[e].height);bs[e].borderRadius=r,null===(_=bs[e].display)||void 0===_||_.setRoundedCornerRadius(r)}break}break;case"hwstatus":Ia&&(is&&jo.isEnableVideoEncodeHardWareThread||ho.videodecodethreadnumb>1&&ho.isEnableVideoDecodeHardWareThread)&&ls!=t.enable&&(ls=t.enable,is&&jo.Signal_Encode_Thread.status==De?(jo.Signal_Encode_Thread.latestflag=sd&&ls,Gn(Ia,jo.Signal_Encode_Thread.latestflag)):is||Gn(Ia,sd&&ls));break;case"videohd":Bo=t.videohd;break;case"SWITCH_WATER_MARK_FLAG":er.isUseSsrcStream()&&(er.setIsVideoHasWaterMark(r.isCreateSharingWaterMark),er.setVideoWatermarkInfo({name:r.videoWaterMarkName,opacity:r.watermarkOpacity,repeated:r.watermarkRepeated,position:r.watermarkPosition})),ys&&(Ms=r.isCreateVideoWaterMark,Es=r.videoWaterMarkName||"",Ms||ys.Set_WaterMark_Flag(!1),ys.Set_WaterMark_Info({waterMarkCanvas:!1,isCreateVideoWaterMark:Ms,videoWaterMarkName:Es,watermarkOpacity:r.watermarkOpacity,watermarkRepeated:r.watermarkRepeated,watermarkPosition:r.watermarkPosition}));break;case"startsharingencode":Ns/=2,Ia&&zn(Ia,Ns);break;case"stopsharingencode":Ns*=2,Ia&&zn(Ia,Ns);break;case 127:{const{canvas:e,canvasId:t}=r.data||{};if(e)t&&t===sc?(Us.set(sc,{canvas:e,id:sc,display:null}),sc=t,gc=Us.get(sc).canvas.width,vc=Us.get(sc).canvas.height):is?qo&&(qo.replace_Canvas(e,t),vs.get(t)&&vs.set(t,{canvas:e})):bs.length>0&&(ys.Replace_Canvas(e,t),vs.get(t)&&vs.set(t,{canvas:e}));else if(is){if(hc.mcanvas&&_c){const{width:e,height:t}=hc.mcanvas;hc.mcanvas=new OffscreenCanvas(e,t),_c=hc.mcanvas.getContext("2d")}if(dc){const{width:e,height:t}=dc;dc=new OffscreenCanvas(e,t),uc=dc.getContext("2d"),Uc(yc,Ha,za)}if(Pc){const{width:e,height:t}=Pc;Pc=new OffscreenCanvas(e,t)}Us.get(sc)&&Us.get(sc).canvas&&de(sc)}break}case"ENABLE_VIDEO_OBSERVER":Vl=!!r.data,Wl=!!r.enablefps;break;case 156:if(Xs)return;_l.updateKey(r.data.KK);break;case"RenderInMain":ma=!0;break;case 130:{let e=r.data||{},t=!!e.hold;te("HOLD:".concat(t,":").concat(e.userid,":").concat(e.reinit)),t?function(e){if(Nd)return;if(ts&&e.userid&&e.userid>>10!=ts>>10)return void te("HOLDINVALID");if(Nd=!0,!Ia)return;if(is?(ma=!1,os=!1,bc||(fc&&fc.clearDisplay(),_c&&_c.clearRect(0,0,hc.mcanvas.width,hc.mcanvas.height)),Ds||(Us.get(Za)&&Us.get(Za).display&&Us.get(Za).display.clearDisplay(),Za=null),bc||Ds||(clearInterval(rs),rs=null,to.stop(),eo.stop(),fs&&Atomics.store(fs,0,0),pd())):ys&&ys.Set_Capture_Video_Flag(!1),au(Ne.SESSION_TYPE_VIDEO,!1),is){const e=qo.videoRenderObj;if(e){let t=e.clearColor.map((e=>e/255));for(;bs.length;)Wd(e,[bs.shift()],t)}}else vs.forEach(((e,t)=>{Bd(ys,t)}));es=null,ja=null;let t=Ia;Ia=null,t&&xn(t)}(e):(m=e,Nd&&(Nd=!1,null!=m&&m.reinit&&(ts=m.userid,ja=null,is?jo.isSupportVirtualBackground?Ko("VB",1,jo.enableVBWasmBackend):postMessage({status:8}):jd())));break}case 133:!function(e){let t=e.content_type,r=e.cmd,i=e.type;"PDU"==t&&(r=Se(r),2==i&&fl(r,0))}(r.data);break;case 137:(xa=r.flag)||$a||!Ja||ou(Bs);break;case 138:self.postMessage({cmd:x,timestamp:Date.now()});break;case 12:Fs.createReadStream(r.data,r.orientation);break;case 139:{const{ssrc:e,type:t,id:i}=r;!function(e,t,r,i){let n={id:i,status:138,success:!1};try{const{canvasId:r,options:i}=(null==e?void 0:e.getUserIdVideo(t))||{};n.success=!!r,n.data={canvasId:r,options:i},postMessage(n)}catch(e){postMessage(n)}}(is?qo.videoRenderObj:ys,e,0,i);break}case 1147:if(Ia){const e=r.data;Fn(Ia,e,e.length)}break;case 144:(Fd=r.data)!=Gi.child&&ia(Ia,3,!1);break;case 147:{const{type:e,meetinguuid:t,mmrsigkey:i}=r,n=2==e||1==e;if(Fd==Gi.child&&Ia&&n){if(ra(Ia,3,t,t.length),2==e){let e=Se(i);ea(Ia,3,e,e.length)}ta(Ia,3,e),ia(Ia,3,n)}else Ia&&ia(Ia,3,!1);break}case 148:Fs.setRotation(r.data);break;case 158:Ks=r.data;break;case 159:Ks=0}var f,p,m}));var Fd=0;function kd(e){if(!Nl&&e){Nl=!0;let t=e.Start_Draw.bind(e);gs=jn||ho.videodecodethreadnumb>1?t(0):t(1,30),ws=!0}}function Pd(e){Nl&&(Nl=!1,e.Stop_Draw.bind(e)(),gs=null,e.ClearQueue(),e.Set_WaterMark_Info({waterMarkCanvas:!1,isCreateVideoWaterMark:Ms,videoWaterMarkName:Es}),ws=!1)}function Ld(e){te("WGLFSTOPRAF"),e&&(e.videoRenderWGLFSTOP=!0,Pd(e))}function Dd(e){te("WGLRESTORE"),e&&e.videoRenderWGLFSTOP&&(kd(e),e.videoRenderWGLFSTOP=!1)}function Id(){return!1}function Od(e){}function Ud(e){return Rs.ssrc&&Ro(Rs.ssrc)==Ro(e)}function Vd(e){if(e=e>>10<<10,ys&&e&&!Fo(e)){let t=ho.threadPoolBufferMGR.get(e);if((null==t?void 0:t.threadState)==De)Nn(Ia,e),ho.preusedcount--;else if((null==t?void 0:t.threadState)==Le){let t=ho.SSrcWaitForThread.findIndex((t=>t>>10==e>>10));t>=0&&ho.SSrcWaitForThread.splice(t,1)}vo(e),Oc&&(Oc.clear(e),Cl.delete(e))}}function Wd(e,t,r){if(!e)return;er.isUseSsrcStream()||(e.clearUseridRender(t,r),e.GiveBack_Display(t,0==bs.length),e.Set_Render_Array(bs));let i=t[0].ssrc;Rs.ssrc>>10!=i>>10&&1!=i&&Vd(i),Rs.ssrc&&Rs.ssrc>>10==i>>10&&!Fo(1)&&Vd(i),1!=i||Fo(1)||(Vd(Rs.ssrc),i=Rs.ssrc,Rs.ssrc=0),ma=!!bs.length,0==bs.length&&(Oc&&Oc.clearAll(),Pd(e)),Hs.renderFlag&&!is&&(1==bs.length&&bs[0].ssrc>>10==ts>>10||0==bs.length)&&(Hs.renderFlag=!1,vd())}function Bd(e,t){let r=vs.get(t)||Us.get(t);if(e&&r&&null!=bs&&bs.length){let r=e.clearColor.map((e=>e/255));for(let i=0;i<bs.length;)if(bs[i].rendercanvasID==t){let t=bs.splice(i,1);try{Wd(e,t,r)}catch(e){ie("StopUserVideo has error: ",e)}}else i++}r&&wn.clearOffscreenCanvas(r),e&&r&&e.Clear_OffScreenCanvas(r.canvas),r&&(vs.delete(t),Us.delete(t))}var Nd=!1;function Gd(){return!Nd}function jd(){Gd()&&(Ia&&Oa==ts||(Ia&&(xn(Ia),Ia=null),Ia=Tn(ts,Qa,Xa,Ka,0,0,ho.videodecodethreadnumb,ls,is,!1,Ns,!1,!1,!1,er.shouldCropWasmFrameOnPosMismatch(),er.shouldCropWasmFrameOnSizeMismatchOnly()),Oa=ts),Ia?(_l.updateKey(),ho.videodecodethreadnumb>1&&Wn(Ia,ho.videodecodethreadnumb),postMessage({status:8})):postMessage({status:N}))}function Hd(e){var t;su(e.websocket_ip_address),e.webtransportURL&&(null===(t=Ua)||void 0===t||t.resetWebrTransportUrl(e.webtransportURL))}function zd(e){wn.getRendererProvider().setRendererType(e.rendererType),e.rendererDynModBlob&&wn.getRendererProvider().loadRenderModuleFromBlob(e.rendererType,e.rendererDynModBlob),wn.setCanvasAlphaChannelEnability(e.isEnableCanvasAlphaChannel),wn.getRendererProvider().isWebGPURendererType()&&wn.getWebGPUResMgr(2).initialize(),is||ho.isSupportOffscreenCanvas&&(ys||((ys=new xt({Notify_APPUI:null,isSupportOffscreenCanvas:!0,jsMediaEngine:null,videodecodethreadnumb:jn?25:ho.videodecodethreadnumb,onStopDrawCallback:Ld,onReStoreCallback:Dd,renderManager:wn,isLSSPlayer:ka})).setMirrorMyVideoOption(ks),nd&&ys.Change_Current_SSRC(nd),jl&&ys.Set_LocalVideo_Buffer(jl),Gl&&ys.Set_LocalVideo_Ptr(Gl),null!=Rs&&Rs.ssrc&&(er.isUseSsrcStream()?Xd.setActiveSpeakerSsrc(Rs.ssrc):ys.setActiveSpeakerSsrc(Rs.ssrc))))}let qd,Yd,Xd;var Kd=!1,Qd=!1;function $d(){if(!tl())return-1;if(ll())return 0;if("function"!=typeof OffscreenCanvas)return-1;var e=rl(),t=il();return e&&t&&Sn?0:-1}function Jd(){return!0}let Zd=0;function eu(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=e?jo.Signal_Encode_Thread.handle:ho.isVideoCodecHelpThreadWorker;if(i&&i.postMessage({cmd:"webcodecfailed",encode:e,id:t,code:r}),e)return sd=!1,jo.Signal_Encode_Thread.latestflag=!1,void(Ia&&Gn(Ia,!1));Zd++,Zd>=4&&(sd=!1,Ia&&Gn(Ia,!1),Re()&&postMessage({status:a,size:2}))}var tu,ru={};!function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;try{const t="undefined"!=typeof DedicatedWorkerGlobalScope;if(ki.dataTransportMgr)return;let r=new Ri({type:t?Ri.THREAD_SUB:Ri.THREAD_MAIN,remote:t?self:null});ki.dataTransportMgr=r,r.monitorlogfn=e,Ii.target||(Ii.target=new Ii(r),r.addTransportListChangeListener(Ii.target)),t&&self.addEventListener("message",r._onrecvmainthreadlistener.bind(r))}catch(e){console.error("<<<< InitDataTransportModule",e)}}(Me),tu=self,Oi.instance||(Oi.instance=new Oi),Oi.instance.start(tu);let iu=function(){let e=0;try{const t="function"==typeof MediaStreamTrack,r="function"==typeof MediaStreamTrackProcessor,i="function"==typeof VideoTrackGenerator;if(e|="function"==typeof OffscreenCanvas?1:0,e|=r&&t?4:0,e|=i&&t?8:0,1&e){let t=new OffscreenCanvas(1,1),r=t.getContext("webgl");e|=null!=r?2:0,r=null,t=null}}catch(e){}return e}();var nu=new class{constructor(e){this.featurebit=e}isSupportOffScreenCanvas(){return 1&this.featurebit}isSupportOffScreenCanvasWebgl(){return 2&this.featurebit}isSupportMediaTrackProcessor(){return 4&this.featurebit}}(iu);function au(e,t){const r={cmd:B,appid:e,enable:t};3==e&&Ua.sendCommand(r)}function su(e,t){var r,i;(ka&&!Pa&&postMessage({status:n}),e)&&(e=ka?null===(r=e)||void 0===r?void 0:r.replace("&mode=5","").replace("/wc",""):e,te("WSURL:".concat(isPreviewMode&&!t,":").concat(e.replace(/(\/media\/)\d+/,"$1".concat("meetingNumber")))),Ua?(Ua.url&&Ua.url!=e&&ie("video websocket cid changed"),Ua.resetURL(e)):(Ua=ro(e,ao,fl,ml,pl,t),(ru.sender||ru.reciver)&&(null===(i=Ua)||void 0===i||i.setSabBuffer(ru.sender,ru.reciver))))}function ou(e){La&&(clearTimeout(La),La=0),La=setTimeout((()=>{xa||postMessage({status:s}),La=0}),e)}self.postMessage({status:139,data:iu}),Object.keys(e).forEach((t=>self[t]=e[t]))})()})(),self.__wasmCodeDataEndFlag=1,(Module=void 0!==Module?Module:{}).locateFile=function(e){if(e.endsWith("wasm"))return wasmUrl},Module.instantiateWasm=function(e,t){return self.downloadAndInstantiateWebAssembly(e,t),{}},isZoomWasm32Bit&&(Module.wasmMemory=new WebAssembly.Memory({initial:(nonsabVB,1024),maximum:nonsabVB?1024:4096})),Module.onRuntimeInitialized=function(){postMessage({status:wasmSuccessEvent}),self.onWasmModuleReady()},Module.onAbort=function(e){postMessage({status:wasmFailEvent,data:e})};var read_,readAsync,readBinary,setWindowTitle,Module=void 0!==Module?Module:{},moduleOverrides=Object.assign({},Module),arguments_=[],thisProgram="./this.program",quit_=(e,t)=>{throw t},ENVIRONMENT_IS_WEB="object"==typeof window,ENVIRONMENT_IS_WORKER="function"==typeof importScripts,ENVIRONMENT_IS_NODE="object"==typeof process&&"object"==typeof process.versions&&"string"==typeof process.versions.node,scriptDirectory="";function locateFile(e){return Module.locateFile?Module.locateFile(e,scriptDirectory):scriptDirectory+e}(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER)&&(ENVIRONMENT_IS_WORKER?scriptDirectory=self.location.href:"undefined"!=typeof document&&document.currentScript&&(scriptDirectory=document.currentScript.src),scriptDirectory=0!==scriptDirectory.indexOf("blob:")?scriptDirectory.substr(0,scriptDirectory.replace(/[?#].*/,"").lastIndexOf("/")+1):"",read_=e=>{var t=new XMLHttpRequest;return t.open("GET",e,!1),t.send(null),t.responseText},ENVIRONMENT_IS_WORKER&&(readBinary=e=>{var t=new XMLHttpRequest;return t.open("GET",e,!1),t.responseType="arraybuffer",t.send(null),new Uint8Array(t.response)}),readAsync=(e,t,r)=>{var i=new XMLHttpRequest;i.open("GET",e,!0),i.responseType="arraybuffer",i.onload=()=>{200==i.status||0==i.status&&i.response?t(i.response):r()},i.onerror=r,i.send(null)},setWindowTitle=e=>document.title=e);var out=Module.print||console.log.bind(console),err=Module.printErr||console.warn.bind(console);Object.assign(Module,moduleOverrides),moduleOverrides=null,Module.arguments&&(arguments_=Module.arguments),Module.thisProgram&&(thisProgram=Module.thisProgram),Module.quit&&(quit_=Module.quit);var wasmBinary,POINTER_SIZE=4;Module.wasmBinary&&(wasmBinary=Module.wasmBinary);var wasmMemory,noExitRuntime=Module.noExitRuntime||!0;"object"!=typeof WebAssembly&&abort("no native wasm support detected");var EXITSTATUS,ABORT=!1;function assert(e,t){e||abort(t)}var buffer,HEAP8,HEAPU8,HEAP16,HEAPU16,HEAP32,HEAPU32,HEAPF32,HEAPF64,UTF8Decoder="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;function UTF8ArrayToString(e,t,r){for(var i=t+r,n=t;e[n]&&!(n>=i);)++n;if(n-t>16&&e.buffer&&UTF8Decoder)return UTF8Decoder.decode(e.subarray(t,n));for(var a="";t<n;){var s=e[t++];if(128&s){var o=63&e[t++];if(192!=(224&s)){var l=63&e[t++];if((s=224==(240&s)?(15&s)<<12|o<<6|l:(7&s)<<18|o<<12|l<<6|63&e[t++])<65536)a+=String.fromCharCode(s);else{var c=s-65536;a+=String.fromCharCode(55296|c>>10,56320|1023&c)}}else a+=String.fromCharCode((31&s)<<6|o)}else a+=String.fromCharCode(s)}return a}function UTF8ToString(e,t){return e?UTF8ArrayToString(HEAPU8,e,t):""}function stringToUTF8Array(e,t,r,i){if(!(i>0))return 0;for(var n=r,a=r+i-1,s=0;s<e.length;++s){var o=e.charCodeAt(s);if(o>=55296&&o<=57343&&(o=65536+((1023&o)<<10)|1023&e.charCodeAt(++s)),o<=127){if(r>=a)break;t[r++]=o}else if(o<=2047){if(r+1>=a)break;t[r++]=192|o>>6,t[r++]=128|63&o}else if(o<=65535){if(r+2>=a)break;t[r++]=224|o>>12,t[r++]=128|o>>6&63,t[r++]=128|63&o}else{if(r+3>=a)break;t[r++]=240|o>>18,t[r++]=128|o>>12&63,t[r++]=128|o>>6&63,t[r++]=128|63&o}}return t[r]=0,r-n}function stringToUTF8(e,t,r){return stringToUTF8Array(e,HEAPU8,t,r)}function lengthBytesUTF8(e){for(var t=0,r=0;r<e.length;++r){var i=e.charCodeAt(r);i<=127?t++:i<=2047?t+=2:i>=55296&&i<=57343?(t+=4,++r):t+=3}return t}function updateGlobalBufferAndViews(e){buffer=e,Module.HEAP8=HEAP8=new Int8Array(e),Module.HEAP16=HEAP16=new Int16Array(e),Module.HEAP32=HEAP32=new Int32Array(e),Module.HEAPU8=HEAPU8=new Uint8Array(e),Module.HEAPU16=HEAPU16=new Uint16Array(e),Module.HEAPU32=HEAPU32=new Uint32Array(e),Module.HEAPF32=HEAPF32=new Float32Array(e),Module.HEAPF64=HEAPF64=new Float64Array(e)}var wasmTable,INITIAL_MEMORY=Module.INITIAL_MEMORY||37748736;(wasmMemory=Module.wasmMemory?Module.wasmMemory:new WebAssembly.Memory({initial:INITIAL_MEMORY/65536,maximum:32768}))&&(buffer=wasmMemory.buffer),INITIAL_MEMORY=buffer.byteLength,updateGlobalBufferAndViews(buffer);var __ATPRERUN__=[],__ATINIT__=[],__ATPOSTRUN__=[],runtimeInitialized=!1;function keepRuntimeAlive(){return noExitRuntime}function preRun(){if(Module.preRun)for("function"==typeof Module.preRun&&(Module.preRun=[Module.preRun]);Module.preRun.length;)addOnPreRun(Module.preRun.shift());callRuntimeCallbacks(__ATPRERUN__)}function initRuntime(){runtimeInitialized=!0,Module.noFSInit||FS.init.initialized||FS.init(),FS.ignorePermissions=!1,TTY.init(),PIPEFS.root=FS.mount(PIPEFS,{},null),callRuntimeCallbacks(__ATINIT__)}function postRun(){if(Module.postRun)for("function"==typeof Module.postRun&&(Module.postRun=[Module.postRun]);Module.postRun.length;)addOnPostRun(Module.postRun.shift());callRuntimeCallbacks(__ATPOSTRUN__)}function addOnPreRun(e){__ATPRERUN__.unshift(e)}function addOnInit(e){__ATINIT__.unshift(e)}function addOnPostRun(e){__ATPOSTRUN__.unshift(e)}var runDependencies=0,runDependencyWatcher=null,dependenciesFulfilled=null;function getUniqueRunDependency(e){return e}function addRunDependency(e){runDependencies++,Module.monitorRunDependencies&&Module.monitorRunDependencies(runDependencies)}function removeRunDependency(e){if(runDependencies--,Module.monitorRunDependencies&&Module.monitorRunDependencies(runDependencies),0==runDependencies&&(null!==runDependencyWatcher&&(clearInterval(runDependencyWatcher),runDependencyWatcher=null),dependenciesFulfilled)){var t=dependenciesFulfilled;dependenciesFulfilled=null,t()}}function abort(e){throw Module.onAbort&&Module.onAbort(e),err(e="Aborted("+e+")"),ABORT=!0,EXITSTATUS=1,e+=". Build with -sASSERTIONS for more info.",new WebAssembly.RuntimeError(e)}var wasmBinaryFile,tempDouble,tempI64,dataURIPrefix="data:application/octet-stream;base64,";function isDataURI(e){return e.startsWith(dataURIPrefix)}function isFileURI(e){return e.startsWith("file://")}function getBinary(e){try{if(e==wasmBinaryFile&&wasmBinary)return new Uint8Array(wasmBinary);if(readBinary)return readBinary(e);throw"both async and sync fetching of the wasm failed"}catch(e){abort(e)}}function getBinaryPromise(){if(!wasmBinary&&(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER)){if("function"==typeof fetch&&!isFileURI(wasmBinaryFile))return fetch(wasmBinaryFile,{credentials:"same-origin"}).then((function(e){if(!e.ok)throw"failed to load wasm binary file at '"+wasmBinaryFile+"'";return e.arrayBuffer()})).catch((function(){return getBinary(wasmBinaryFile)}));if(readAsync)return new Promise((function(e,t){readAsync(wasmBinaryFile,(function(t){e(new Uint8Array(t))}),t)}))}return Promise.resolve().then((function(){return getBinary(wasmBinaryFile)}))}function createWasm(){var e={env:asmLibraryArg,wasi_snapshot_preview1:asmLibraryArg};function t(e,t){var r=e.exports;Module.asm=r,wasmTable=Module.asm.__indirect_function_table,addOnInit(Module.asm.__wasm_call_ctors),removeRunDependency("wasm-instantiate")}function r(e){t(e.instance)}function i(t){return getBinaryPromise().then((function(t){return WebAssembly.instantiate(t,e)})).then((function(e){return e})).then(t,(function(e){err("failed to asynchronously prepare wasm: "+e),abort(e)}))}if(addRunDependency("wasm-instantiate"),Module.instantiateWasm)try{return Module.instantiateWasm(e,t)}catch(e){return err("Module.instantiateWasm callback failed with error: "+e),!1}return wasmBinary||"function"!=typeof WebAssembly.instantiateStreaming||isDataURI(wasmBinaryFile)||isFileURI(wasmBinaryFile)||"function"!=typeof fetch?i(r):fetch(wasmBinaryFile,{credentials:"same-origin"}).then((function(t){return WebAssembly.instantiateStreaming(t,e).then(r,(function(e){return err("wasm streaming compile failed: "+e),err("falling back to ArrayBuffer instantiation"),i(r)}))})),{}}isDataURI(wasmBinaryFile="video.simd.wasm")||(wasmBinaryFile=locateFile(wasmBinaryFile));var ASM_CONSTS={554464:e=>{console.log("Video Version: ",e)},554501:(e,t,r)=>{js_info_from_wcl(e,t,r)},554535:e=>{change_capture_resolution(e)},554570:(e,t,r,i,n,a,s,o,l,c)=>{processed_capture_data_callback(e,t,r,i,n,a,s,o,l,c)},554647:(e,t,r,i,n,a,s,o,l,c,d,u)=>{frame_callback(e,t,r,i,n,a,s,o,l,c,d,u)},554717:(e,t,r,i,n,a,s,o,l,c,d,u)=>{frame_callback_webcodec(e,t,r,i,n,a,s,o,l,c,d,u)},554796:(e,t)=>{decode_callback(e,t)},554825:(e,t,r)=>{js_info_from_wcl(e,t,r)},554859:(e,t)=>{video_rtp_data(e,t)},554884:(e,t,r)=>{video_rtcp_data(e,t,r)},554914:(e,t,r,i,n,a)=>{js_info_from_wcl_video_data(e,t,r,i,n,a)},554971:e=>{Exit_Thread(e)},554989:e=>Before_Create_Thread(e),555026:e=>Before_Create_Thread(e),555063:(e,t)=>{APP_Troubleshoting_Info(e,t)},555097:(e,t,r)=>{network_quality_callback(e,t,r)},555137:(e,t)=>{MCMMonitor_Video_LOG(e,t)},555167:(e,t,r,i,n,a,s,o,l,c,d,u,h,_,f)=>{sender_stats_log(e,t,r,i,n,a,s,o,l,c,d,u,h,_,f)},555257:(e,t,r,i,n,a,s,o,l,c,d,u,h,_,f)=>{receiver_stats_log(e,t,r,i,n,a,s,o,l,c,d,u,h,_,f)},555349:e=>{SubScribeUpdateVideo(e)},555377:(e,t)=>{send_data(e,t)},555400:e=>{SubScribeUpdateVideo(e)},555428:(e,t,r,i,n,a,s,o,l,c)=>{responseVideoQosData(e,t,r,i,n,a,s,o,l,c)},555489:(e,t)=>{SAVE_IV(e,t)},555507:()=>Date.now(),555530:()=>getNTPBaseTime(),555559:()=>performance.now(),555589:(e,t)=>{reportSenderNTPTime(e,t)},555622:(e,t)=>{Update_Required_Bandwidth(e,t)},555658:e=>{Update_Video_Hd_Info(e)},555686:(e,t,r,i,n)=>{on_psl_mix_share_info_changed(e,t,r,i,n)},555738:e=>{console.log("Sharing Version: ",e)},555777:(e,t)=>{share_rtp_data(e,t)},555802:(e,t,r)=>{SAVE_IV(e,t,r)},555824:(e,t,r)=>{share_rtp_raw_data(e,t,r)},555857:(e,t,r,i)=>{share_rtcp_data(e,t,r,i)},555890:(e,t,r,i)=>{share_rtcp_raw_data(e,t,r,i)},555927:(e,t,r,i)=>{share_mouse_data(e,t,r,i)},555962:(e,t,r)=>{share_mouse_raw_data(e,t,r)},555997:(e,t,r)=>{APP_Troubleshoting_Info(e,t,r)},556035:(e,t,r,i)=>{decode_callback(e,t,r,i)},556072:(e,t,r)=>{on_keyframe_request(e,t,r)},556109:(e,t,r)=>{on_keyframe_request_ex(e,t,r)},556149:(e,t,r,i,n,a,s,o,l,c,d,u,h,_)=>{frame_callback_video_mode(e,t,r,i,n,a,s,o,l,c,d,u,h,_)},556240:(e,t,r,i,n,a,s,o,l,c,d,u)=>{frame_callback_mouse_video_mode(e,t,r,i,n,a,s,o,l,c,d,u)},556327:(e,t)=>{MCMMonitor_Sharing_LOG(e,t)},556359:(e,t,r,i,n,a,s)=>{Send_Out_Qos(e,t,r,i,n,a,s)},556404:e=>{SubScribeUpdateSharing(e)},556434:e=>{SubScribeUpdateSharing(e)},556464:e=>{Update_WebSokcet_Speed(e)},556496:(e,t,r,i,n,a,s,o,l,c)=>{responseSharingQosData(e,t,r,i,n,a,s,o,l,c)},556559:(e,t)=>{SAVE_IV(e,t)},556577:e=>{console.error("tjDecompressHeader3 error %d ",e)},556630:e=>{console.error("tjDecompress2 error %d ",e)},556677:(e,t)=>{on_share_encode_start(e,t)},556709:(e,t)=>{on_share_encode_start(e,t)},556741:(e,t,r,i)=>{sharing_decode_channel_change(e,t,r,i)},556788:(e,t,r,i)=>{sharing_decode_channel_change(e,t,r,i)},556835:(e,t)=>{Update_Required_Bandwidth(e,t)},556871:(e,t,r)=>{Send_Wb_Rtp_Packet(e,t,r)},556902:(e,t)=>{Recieve_Wb_Packet(e,t)},556929:(e,t)=>{COMMIT_PRINT(e,t)},556951:()=>Module.getRandomValue(),556987:()=>{if(void 0===Module.getRandomValue)try{var e="object"==typeof window?window:self,t=void 0!==e.crypto?e.crypto:e.msCrypto,r=function(){var e=new Uint32Array(1);return t.getRandomValues(e),e[0]>>>0};r(),Module.getRandomValue=r}catch(e){try{var i=require("crypto"),n=function(){var e=i.randomBytes(4);return(e[0]<<24|e[1]<<16|e[2]<<8|e[3])>>>0};n(),Module.getRandomValue=n}catch(e){throw"No secure random number generator found"}}},557709:()=>{videoencode_create_helpthread()},557744:(e,t)=>{LOG_OUT(e,t)},557765:(e,t)=>{wcl_trace_log(e,t)}};function ExitStatus(e){this.name="ExitStatus",this.message="Program terminated with exit("+e+")",this.status=e}function callRuntimeCallbacks(e){for(;e.length>0;)e.shift()(Module)}function withStackSave(e){var t=stackSave(),r=e();return stackRestore(t),r}function demangle(e){return demangle.recursionGuard=1+(0|demangle.recursionGuard),demangle.recursionGuard>1?e:withStackSave((function(){try{var t=e;t.startsWith("__Z")&&(t=t.substr(1));var r=lengthBytesUTF8(t)+1,i=stackAlloc(r);stringToUTF8(t,i,r);var n=stackAlloc(4),a=___cxa_demangle(i,0,0,n);if(0===HEAP32[n>>2]&&a)return UTF8ToString(a)}catch(e){}finally{_free(a),demangle.recursionGuard<2&&--demangle.recursionGuard}return e}))}function jsStackTrace(){var e=new Error;if(!e.stack){try{throw new Error}catch(t){e=t}if(!e.stack)return"(no stack trace available)"}return e.stack.toString()}function demangleAll(e){return e.replace(/\b_Z[\w\d_]+/g,(function(e){var t=demangle(e);return e===t?e:t+" ["+e+"]"}))}function _AdapterWhiteListCheck(){return checkWebCodecWhitelist_js()}function _CloseVideoEncoder(e){CloseVideoEncoder_js(e)}function _CreateGltPlatform(){err("missing function: CreateGltPlatform"),abort(-1)}function _DestroyGltPlatform(){err("missing function: DestroyGltPlatform"),abort(-1)}function _GetEncoderState(e){return GetEncoderState_js(e)}function _GetLogLevel(){return GetLogLevel_js()}function _GetWebCodecsEncoderFallbackFlag(){return GetWebCodecsEncoderFallbackFlag_js()}function _GetWebCodecsEncoderL1T2Flag(){return GetWebCodecsEncoderL1T2Flag_js()}function _InitVideoDecoder(e,t){return InitVideoDecoder_js(e,t)}function _InitVideoEncoder(e,t){return InitVideoEncoder_js(e,t)}function _LimitWebCodecsDecoderTo360(){return LimitWebCodecsDecoderTo360_js()}function _LimitWebCodecsEncoderTo360(){return LimitWebCodecsEncoderTo360_js()}function _Set_Share_Mode(e){return Set_Share_Mode_js(e)}function _UserAgentIsTesla(){return UserAgentIsTesla_js()}function _VideoDecoder(e,t,r,i,n){return VideoDecoder_js(e,t,r,i,n)}function _VideoDecoderConfigure(e,t,r,i,n){return VideoDecoderConfigure_js(e,t,r,i,n)}function _VideoEncoderConfigure(e,t,r,i,n,a){return VideoEncoderConfigure_js(e,t,r,i,n,a)}function _WebCodecsDecoderFail(e){WebCodecsDecoderFail_js(e)}function _WebCodecsEncoderFail(e,t){WebCodecsEncoderFail_js(e,t)}function _WebCodecsVideoEncoder(e,t,r,i,n,a){return VideoEncoder_js(e,t,r,i,n,a)}function __ZN11cpt_generic6thread4joinEv(){err("missing function: _ZN11cpt_generic6thread4joinEv"),abort(-1)}function __ZN11cpt_generic6threadD1Ev(){err("missing function: _ZN11cpt_generic6threadD1Ev"),abort(-1)}function __ZN5Nydus16CWCLWallRenderer14CreateInstanceEPvRKNS_9NydusRectEPPNS_13IWallRendererE(){err("missing function: _ZN5Nydus16CWCLWallRenderer14CreateInstanceEPvRKNS_9NydusRectEPPNS_13IWallRendererE"),abort(-1)}function ___assert_fail(e,t,r,i){abort("Assertion failed: "+UTF8ToString(e)+", at: "+[t?UTF8ToString(t):"unknown filename",r,i?UTF8ToString(i):"unknown function"])}function ___cxa_allocate_exception(e){return _malloc(e+24)+24}var exceptionCaught=[];function exception_addRef(e){e.add_ref()}var uncaughtExceptionCount=0;function ___cxa_begin_catch(e){var t=new ExceptionInfo(e);return t.get_caught()||(t.set_caught(!0),uncaughtExceptionCount--),t.set_rethrown(!1),exceptionCaught.push(t),exception_addRef(t),t.get_exception_ptr()}var exceptionLast=0;function ExceptionInfo(e){this.excPtr=e,this.ptr=e-24,this.set_type=function(e){HEAPU32[this.ptr+4>>2]=e},this.get_type=function(){return HEAPU32[this.ptr+4>>2]},this.set_destructor=function(e){HEAPU32[this.ptr+8>>2]=e},this.get_destructor=function(){return HEAPU32[this.ptr+8>>2]},this.set_refcount=function(e){HEAP32[this.ptr>>2]=e},this.set_caught=function(e){e=e?1:0,HEAP8[this.ptr+12|0]=e},this.get_caught=function(){return 0!=HEAP8[this.ptr+12|0]},this.set_rethrown=function(e){e=e?1:0,HEAP8[this.ptr+13|0]=e},this.get_rethrown=function(){return 0!=HEAP8[this.ptr+13|0]},this.init=function(e,t){this.set_adjusted_ptr(0),this.set_type(e),this.set_destructor(t),this.set_refcount(0),this.set_caught(!1),this.set_rethrown(!1)},this.add_ref=function(){var e=HEAP32[this.ptr>>2];HEAP32[this.ptr>>2]=e+1},this.release_ref=function(){var e=HEAP32[this.ptr>>2];return HEAP32[this.ptr>>2]=e-1,1===e},this.set_adjusted_ptr=function(e){HEAPU32[this.ptr+16>>2]=e},this.get_adjusted_ptr=function(){return HEAPU32[this.ptr+16>>2]},this.get_exception_ptr=function(){if(___cxa_is_pointer_type(this.get_type()))return HEAPU32[this.excPtr>>2];var e=this.get_adjusted_ptr();return 0!==e?e:this.excPtr}}function ___cxa_free_exception(e){return _free(new ExceptionInfo(e).ptr)}var wasmTableMirror=[];function getWasmTableEntry(e){var t=wasmTableMirror[e];return t||(e>=wasmTableMirror.length&&(wasmTableMirror.length=e+1),wasmTableMirror[e]=t=wasmTable.get(e)),t}function exception_decRef(e){if(e.release_ref()&&!e.get_rethrown()){var t=e.get_destructor();t&&getWasmTableEntry(t)(e.excPtr),___cxa_free_exception(e.excPtr)}}function ___cxa_end_catch(){_setThrew(0),exception_decRef(exceptionCaught.pop()),exceptionLast=0}function ___resumeException(e){throw exceptionLast||(exceptionLast=e),e}function ___cxa_find_matching_catch_2(){var e=exceptionLast;if(!e)return setTempRet0(0),0;var t=new ExceptionInfo(e);t.set_adjusted_ptr(e);var r=t.get_type();if(!r)return setTempRet0(0),e;for(var i=0;i<arguments.length;i++){var n=arguments[i];if(0===n||n===r)break;var a=t.ptr+16;if(___cxa_can_catch(n,r,a))return setTempRet0(n),e}return setTempRet0(r),e}function ___cxa_find_matching_catch_3(){var e=exceptionLast;if(!e)return setTempRet0(0),0;var t=new ExceptionInfo(e);t.set_adjusted_ptr(e);var r=t.get_type();if(!r)return setTempRet0(0),e;for(var i=0;i<arguments.length;i++){var n=arguments[i];if(0===n||n===r)break;var a=t.ptr+16;if(___cxa_can_catch(n,r,a))return setTempRet0(n),e}return setTempRet0(r),e}function ___cxa_find_matching_catch_4(){var e=exceptionLast;if(!e)return setTempRet0(0),0;var t=new ExceptionInfo(e);t.set_adjusted_ptr(e);var r=t.get_type();if(!r)return setTempRet0(0),e;for(var i=0;i<arguments.length;i++){var n=arguments[i];if(0===n||n===r)break;var a=t.ptr+16;if(___cxa_can_catch(n,r,a))return setTempRet0(n),e}return setTempRet0(r),e}function ___cxa_rethrow(){var e=exceptionCaught.pop();e||abort("no exception to throw");var t=e.excPtr;throw e.get_rethrown()||(exceptionCaught.push(e),e.set_rethrown(!0),e.set_caught(!1),uncaughtExceptionCount++),exceptionLast=t,t}function ___cxa_throw(e,t,r){throw new ExceptionInfo(e).init(t,r),exceptionLast=e,uncaughtExceptionCount++,e}function ___cxa_uncaught_exceptions(){return uncaughtExceptionCount}function ___stack_chk_fail(){err("missing function: __stack_chk_fail"),abort(-1)}function setErrNo(e){return HEAP32[___errno_location()>>2]=e,e}var PATH={isAbs:e=>"/"===e.charAt(0),splitPath:e=>/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/.exec(e).slice(1),normalizeArray:(e,t)=>{for(var r=0,i=e.length-1;i>=0;i--){var n=e[i];"."===n?e.splice(i,1):".."===n?(e.splice(i,1),r++):r&&(e.splice(i,1),r--)}if(t)for(;r;r--)e.unshift("..");return e},normalize:e=>{var t=PATH.isAbs(e),r="/"===e.substr(-1);return(e=PATH.normalizeArray(e.split("/").filter((e=>!!e)),!t).join("/"))||t||(e="."),e&&r&&(e+="/"),(t?"/":"")+e},dirname:e=>{var t=PATH.splitPath(e),r=t[0],i=t[1];return r||i?(i&&(i=i.substr(0,i.length-1)),r+i):"."},basename:e=>{if("/"===e)return"/";var t=(e=(e=PATH.normalize(e)).replace(/\/$/,"")).lastIndexOf("/");return-1===t?e:e.substr(t+1)},join:function(){var e=Array.prototype.slice.call(arguments);return PATH.normalize(e.join("/"))},join2:(e,t)=>PATH.normalize(e+"/"+t)};function getRandomDevice(){if("object"==typeof crypto&&"function"==typeof crypto.getRandomValues){var e=new Uint8Array(1);return()=>(crypto.getRandomValues(e),e[0])}return()=>abort("randomDevice")}var PATH_FS={resolve:function(){for(var e="",t=!1,r=arguments.length-1;r>=-1&&!t;r--){var i=r>=0?arguments[r]:FS.cwd();if("string"!=typeof i)throw new TypeError("Arguments to path.resolve must be strings");if(!i)return"";e=i+"/"+e,t=PATH.isAbs(i)}return(t?"/":"")+(e=PATH.normalizeArray(e.split("/").filter((e=>!!e)),!t).join("/"))||"."},relative:(e,t)=>{function r(e){for(var t=0;t<e.length&&""===e[t];t++);for(var r=e.length-1;r>=0&&""===e[r];r--);return t>r?[]:e.slice(t,r-t+1)}e=PATH_FS.resolve(e).substr(1),t=PATH_FS.resolve(t).substr(1);for(var i=r(e.split("/")),n=r(t.split("/")),a=Math.min(i.length,n.length),s=a,o=0;o<a;o++)if(i[o]!==n[o]){s=o;break}var l=[];for(o=s;o<i.length;o++)l.push("..");return(l=l.concat(n.slice(s))).join("/")}};function intArrayFromString(e,t,r){var i=r>0?r:lengthBytesUTF8(e)+1,n=new Array(i),a=stringToUTF8Array(e,n,0,n.length);return t&&(n.length=a),n}var TTY={ttys:[],init:function(){},shutdown:function(){},register:function(e,t){TTY.ttys[e]={input:[],output:[],ops:t},FS.registerDevice(e,TTY.stream_ops)},stream_ops:{open:function(e){var t=TTY.ttys[e.node.rdev];if(!t)throw new FS.ErrnoError(43);e.tty=t,e.seekable=!1},close:function(e){e.tty.ops.fsync(e.tty)},fsync:function(e){e.tty.ops.fsync(e.tty)},read:function(e,t,r,i,n){if(!e.tty||!e.tty.ops.get_char)throw new FS.ErrnoError(60);for(var a=0,s=0;s<i;s++){var o;try{o=e.tty.ops.get_char(e.tty)}catch(e){throw new FS.ErrnoError(29)}if(void 0===o&&0===a)throw new FS.ErrnoError(6);if(null==o)break;a++,t[r+s]=o}return a&&(e.node.timestamp=Date.now()),a},write:function(e,t,r,i,n){if(!e.tty||!e.tty.ops.put_char)throw new FS.ErrnoError(60);try{for(var a=0;a<i;a++)e.tty.ops.put_char(e.tty,t[r+a])}catch(e){throw new FS.ErrnoError(29)}return i&&(e.node.timestamp=Date.now()),a}},default_tty_ops:{get_char:function(e){if(!e.input.length){var t=null;if("undefined"!=typeof window&&"function"==typeof window.prompt?null!==(t=window.prompt("Input: "))&&(t+="\n"):"function"==typeof readline&&null!==(t=readline())&&(t+="\n"),!t)return null;e.input=intArrayFromString(t,!0)}return e.input.shift()},put_char:function(e,t){null===t||10===t?(out(UTF8ArrayToString(e.output,0)),e.output=[]):0!=t&&e.output.push(t)},fsync:function(e){e.output&&e.output.length>0&&(out(UTF8ArrayToString(e.output,0)),e.output=[])}},default_tty1_ops:{put_char:function(e,t){null===t||10===t?(err(UTF8ArrayToString(e.output,0)),e.output=[]):0!=t&&e.output.push(t)},fsync:function(e){e.output&&e.output.length>0&&(err(UTF8ArrayToString(e.output,0)),e.output=[])}}};function zeroMemory(e,t){return HEAPU8.fill(0,e,e+t),e}function alignMemory(e,t){return Math.ceil(e/t)*t}function mmapAlloc(e){e=alignMemory(e,65536);var t=_emscripten_builtin_memalign(65536,e);return t?zeroMemory(t,e):0}var MEMFS={ops_table:null,mount:function(e){return MEMFS.createNode(null,"/",16895,0)},createNode:function(e,t,r,i){if(FS.isBlkdev(r)||FS.isFIFO(r))throw new FS.ErrnoError(63);MEMFS.ops_table||(MEMFS.ops_table={dir:{node:{getattr:MEMFS.node_ops.getattr,setattr:MEMFS.node_ops.setattr,lookup:MEMFS.node_ops.lookup,mknod:MEMFS.node_ops.mknod,rename:MEMFS.node_ops.rename,unlink:MEMFS.node_ops.unlink,rmdir:MEMFS.node_ops.rmdir,readdir:MEMFS.node_ops.readdir,symlink:MEMFS.node_ops.symlink},stream:{llseek:MEMFS.stream_ops.llseek}},file:{node:{getattr:MEMFS.node_ops.getattr,setattr:MEMFS.node_ops.setattr},stream:{llseek:MEMFS.stream_ops.llseek,read:MEMFS.stream_ops.read,write:MEMFS.stream_ops.write,allocate:MEMFS.stream_ops.allocate,mmap:MEMFS.stream_ops.mmap,msync:MEMFS.stream_ops.msync}},link:{node:{getattr:MEMFS.node_ops.getattr,setattr:MEMFS.node_ops.setattr,readlink:MEMFS.node_ops.readlink},stream:{}},chrdev:{node:{getattr:MEMFS.node_ops.getattr,setattr:MEMFS.node_ops.setattr},stream:FS.chrdev_stream_ops}});var n=FS.createNode(e,t,r,i);return FS.isDir(n.mode)?(n.node_ops=MEMFS.ops_table.dir.node,n.stream_ops=MEMFS.ops_table.dir.stream,n.contents={}):FS.isFile(n.mode)?(n.node_ops=MEMFS.ops_table.file.node,n.stream_ops=MEMFS.ops_table.file.stream,n.usedBytes=0,n.contents=null):FS.isLink(n.mode)?(n.node_ops=MEMFS.ops_table.link.node,n.stream_ops=MEMFS.ops_table.link.stream):FS.isChrdev(n.mode)&&(n.node_ops=MEMFS.ops_table.chrdev.node,n.stream_ops=MEMFS.ops_table.chrdev.stream),n.timestamp=Date.now(),e&&(e.contents[t]=n,e.timestamp=n.timestamp),n},getFileDataAsTypedArray:function(e){return e.contents?e.contents.subarray?e.contents.subarray(0,e.usedBytes):new Uint8Array(e.contents):new Uint8Array(0)},expandFileStorage:function(e,t){var r=e.contents?e.contents.length:0;if(!(r>=t)){t=Math.max(t,r*(r<1048576?2:1.125)>>>0),0!=r&&(t=Math.max(t,256));var i=e.contents;e.contents=new Uint8Array(t),e.usedBytes>0&&e.contents.set(i.subarray(0,e.usedBytes),0)}},resizeFileStorage:function(e,t){if(e.usedBytes!=t)if(0==t)e.contents=null,e.usedBytes=0;else{var r=e.contents;e.contents=new Uint8Array(t),r&&e.contents.set(r.subarray(0,Math.min(t,e.usedBytes))),e.usedBytes=t}},node_ops:{getattr:function(e){var t={};return t.dev=FS.isChrdev(e.mode)?e.id:1,t.ino=e.id,t.mode=e.mode,t.nlink=1,t.uid=0,t.gid=0,t.rdev=e.rdev,FS.isDir(e.mode)?t.size=4096:FS.isFile(e.mode)?t.size=e.usedBytes:FS.isLink(e.mode)?t.size=e.link.length:t.size=0,t.atime=new Date(e.timestamp),t.mtime=new Date(e.timestamp),t.ctime=new Date(e.timestamp),t.blksize=4096,t.blocks=Math.ceil(t.size/t.blksize),t},setattr:function(e,t){void 0!==t.mode&&(e.mode=t.mode),void 0!==t.timestamp&&(e.timestamp=t.timestamp),void 0!==t.size&&MEMFS.resizeFileStorage(e,t.size)},lookup:function(e,t){throw FS.genericErrors[44]},mknod:function(e,t,r,i){return MEMFS.createNode(e,t,r,i)},rename:function(e,t,r){if(FS.isDir(e.mode)){var i;try{i=FS.lookupNode(t,r)}catch(e){}if(i)for(var n in i.contents)throw new FS.ErrnoError(55)}delete e.parent.contents[e.name],e.parent.timestamp=Date.now(),e.name=r,t.contents[r]=e,t.timestamp=e.parent.timestamp,e.parent=t},unlink:function(e,t){delete e.contents[t],e.timestamp=Date.now()},rmdir:function(e,t){var r=FS.lookupNode(e,t);for(var i in r.contents)throw new FS.ErrnoError(55);delete e.contents[t],e.timestamp=Date.now()},readdir:function(e){var t=[".",".."];for(var r in e.contents)e.contents.hasOwnProperty(r)&&t.push(r);return t},symlink:function(e,t,r){var i=MEMFS.createNode(e,t,41471,0);return i.link=r,i},readlink:function(e){if(!FS.isLink(e.mode))throw new FS.ErrnoError(28);return e.link}},stream_ops:{read:function(e,t,r,i,n){var a=e.node.contents;if(n>=e.node.usedBytes)return 0;var s=Math.min(e.node.usedBytes-n,i);if(s>8&&a.subarray)t.set(a.subarray(n,n+s),r);else for(var o=0;o<s;o++)t[r+o]=a[n+o];return s},write:function(e,t,r,i,n,a){if(t.buffer===HEAP8.buffer&&(a=!1),!i)return 0;var s=e.node;if(s.timestamp=Date.now(),t.subarray&&(!s.contents||s.contents.subarray)){if(a)return s.contents=t.subarray(r,r+i),s.usedBytes=i,i;if(0===s.usedBytes&&0===n)return s.contents=t.slice(r,r+i),s.usedBytes=i,i;if(n+i<=s.usedBytes)return s.contents.set(t.subarray(r,r+i),n),i}if(MEMFS.expandFileStorage(s,n+i),s.contents.subarray&&t.subarray)s.contents.set(t.subarray(r,r+i),n);else for(var o=0;o<i;o++)s.contents[n+o]=t[r+o];return s.usedBytes=Math.max(s.usedBytes,n+i),i},llseek:function(e,t,r){var i=t;if(1===r?i+=e.position:2===r&&FS.isFile(e.node.mode)&&(i+=e.node.usedBytes),i<0)throw new FS.ErrnoError(28);return i},allocate:function(e,t,r){MEMFS.expandFileStorage(e.node,t+r),e.node.usedBytes=Math.max(e.node.usedBytes,t+r)},mmap:function(e,t,r,i,n){if(!FS.isFile(e.node.mode))throw new FS.ErrnoError(43);var a,s,o=e.node.contents;if(2&n||o.buffer!==buffer){if((r>0||r+t<o.length)&&(o=o.subarray?o.subarray(r,r+t):Array.prototype.slice.call(o,r,r+t)),s=!0,!(a=mmapAlloc(t)))throw new FS.ErrnoError(48);HEAP8.set(o,a)}else s=!1,a=o.byteOffset;return{ptr:a,allocated:s}},msync:function(e,t,r,i,n){return MEMFS.stream_ops.write(e,t,0,i,r,!1),0}}};function asyncLoad(e,t,r,i){var n=i?"":getUniqueRunDependency("al "+e);readAsync(e,(r=>{assert(r,'Loading data file "'+e+'" failed (no arrayBuffer).'),t(new Uint8Array(r)),n&&removeRunDependency(n)}),(t=>{if(!r)throw'Loading data file "'+e+'" failed.';r()})),n&&addRunDependency(n)}var FS={root:null,mounts:[],devices:{},streams:[],nextInode:1,nameTable:null,currentPath:"/",initialized:!1,ignorePermissions:!0,ErrnoError:null,genericErrors:{},filesystems:null,syncFSRequests:0,lookupPath:(e,t={})=>{if(!(e=PATH_FS.resolve(e)))return{path:"",node:null};if((t=Object.assign({follow_mount:!0,recurse_count:0},t)).recurse_count>8)throw new FS.ErrnoError(32);for(var r=e.split("/").filter((e=>!!e)),i=FS.root,n="/",a=0;a<r.length;a++){var s=a===r.length-1;if(s&&t.parent)break;if(i=FS.lookupNode(i,r[a]),n=PATH.join2(n,r[a]),FS.isMountpoint(i)&&(!s||s&&t.follow_mount)&&(i=i.mounted.root),!s||t.follow)for(var o=0;FS.isLink(i.mode);){var l=FS.readlink(n);if(n=PATH_FS.resolve(PATH.dirname(n),l),i=FS.lookupPath(n,{recurse_count:t.recurse_count+1}).node,o++>40)throw new FS.ErrnoError(32)}}return{path:n,node:i}},getPath:e=>{for(var t;;){if(FS.isRoot(e)){var r=e.mount.mountpoint;return t?"/"!==r[r.length-1]?r+"/"+t:r+t:r}t=t?e.name+"/"+t:e.name,e=e.parent}},hashName:(e,t)=>{for(var r=0,i=0;i<t.length;i++)r=(r<<5)-r+t.charCodeAt(i)|0;return(e+r>>>0)%FS.nameTable.length},hashAddNode:e=>{var t=FS.hashName(e.parent.id,e.name);e.name_next=FS.nameTable[t],FS.nameTable[t]=e},hashRemoveNode:e=>{var t=FS.hashName(e.parent.id,e.name);if(FS.nameTable[t]===e)FS.nameTable[t]=e.name_next;else for(var r=FS.nameTable[t];r;){if(r.name_next===e){r.name_next=e.name_next;break}r=r.name_next}},lookupNode:(e,t)=>{var r=FS.mayLookup(e);if(r)throw new FS.ErrnoError(r,e);for(var i=FS.hashName(e.id,t),n=FS.nameTable[i];n;n=n.name_next){var a=n.name;if(n.parent.id===e.id&&a===t)return n}return FS.lookup(e,t)},createNode:(e,t,r,i)=>{var n=new FS.FSNode(e,t,r,i);return FS.hashAddNode(n),n},destroyNode:e=>{FS.hashRemoveNode(e)},isRoot:e=>e===e.parent,isMountpoint:e=>!!e.mounted,isFile:e=>32768==(61440&e),isDir:e=>16384==(61440&e),isLink:e=>40960==(61440&e),isChrdev:e=>8192==(61440&e),isBlkdev:e=>24576==(61440&e),isFIFO:e=>4096==(61440&e),isSocket:e=>!(49152&~e),flagModes:{r:0,"r+":2,w:577,"w+":578,a:1089,"a+":1090},modeStringToFlags:e=>{var t=FS.flagModes[e];if(void 0===t)throw new Error("Unknown file open mode: "+e);return t},flagsToPermissionString:e=>{var t=["r","w","rw"][3&e];return 512&e&&(t+="w"),t},nodePermissions:(e,t)=>FS.ignorePermissions||(!t.includes("r")||292&e.mode)&&(!t.includes("w")||146&e.mode)&&(!t.includes("x")||73&e.mode)?0:2,mayLookup:e=>FS.nodePermissions(e,"x")||(e.node_ops.lookup?0:2),mayCreate:(e,t)=>{try{return FS.lookupNode(e,t),20}catch(e){}return FS.nodePermissions(e,"wx")},mayDelete:(e,t,r)=>{var i;try{i=FS.lookupNode(e,t)}catch(e){return e.errno}var n=FS.nodePermissions(e,"wx");if(n)return n;if(r){if(!FS.isDir(i.mode))return 54;if(FS.isRoot(i)||FS.getPath(i)===FS.cwd())return 10}else if(FS.isDir(i.mode))return 31;return 0},mayOpen:(e,t)=>e?FS.isLink(e.mode)?32:FS.isDir(e.mode)&&("r"!==FS.flagsToPermissionString(t)||512&t)?31:FS.nodePermissions(e,FS.flagsToPermissionString(t)):44,MAX_OPEN_FDS:4096,nextfd:(e=0,t=FS.MAX_OPEN_FDS)=>{for(var r=e;r<=t;r++)if(!FS.streams[r])return r;throw new FS.ErrnoError(33)},getStream:e=>FS.streams[e],createStream:(e,t,r)=>{FS.FSStream||(FS.FSStream=function(){this.shared={}},FS.FSStream.prototype={},Object.defineProperties(FS.FSStream.prototype,{object:{get:function(){return this.node},set:function(e){this.node=e}},isRead:{get:function(){return 1!=(2097155&this.flags)}},isWrite:{get:function(){return!!(2097155&this.flags)}},isAppend:{get:function(){return 1024&this.flags}},flags:{get:function(){return this.shared.flags},set:function(e){this.shared.flags=e}},position:{get:function(){return this.shared.position},set:function(e){this.shared.position=e}}})),e=Object.assign(new FS.FSStream,e);var i=FS.nextfd(t,r);return e.fd=i,FS.streams[i]=e,e},closeStream:e=>{FS.streams[e]=null},chrdev_stream_ops:{open:e=>{var t=FS.getDevice(e.node.rdev);e.stream_ops=t.stream_ops,e.stream_ops.open&&e.stream_ops.open(e)},llseek:()=>{throw new FS.ErrnoError(70)}},major:e=>e>>8,minor:e=>255&e,makedev:(e,t)=>e<<8|t,registerDevice:(e,t)=>{FS.devices[e]={stream_ops:t}},getDevice:e=>FS.devices[e],getMounts:e=>{for(var t=[],r=[e];r.length;){var i=r.pop();t.push(i),r.push.apply(r,i.mounts)}return t},syncfs:(e,t)=>{"function"==typeof e&&(t=e,e=!1),FS.syncFSRequests++,FS.syncFSRequests>1&&err("warning: "+FS.syncFSRequests+" FS.syncfs operations in flight at once, probably just doing extra work");var r=FS.getMounts(FS.root.mount),i=0;function n(e){return FS.syncFSRequests--,t(e)}function a(e){if(e)return a.errored?void 0:(a.errored=!0,n(e));++i>=r.length&&n(null)}r.forEach((t=>{if(!t.type.syncfs)return a(null);t.type.syncfs(t,e,a)}))},mount:(e,t,r)=>{var i,n="/"===r,a=!r;if(n&&FS.root)throw new FS.ErrnoError(10);if(!n&&!a){var s=FS.lookupPath(r,{follow_mount:!1});if(r=s.path,i=s.node,FS.isMountpoint(i))throw new FS.ErrnoError(10);if(!FS.isDir(i.mode))throw new FS.ErrnoError(54)}var o={type:e,opts:t,mountpoint:r,mounts:[]},l=e.mount(o);return l.mount=o,o.root=l,n?FS.root=l:i&&(i.mounted=o,i.mount&&i.mount.mounts.push(o)),l},unmount:e=>{var t=FS.lookupPath(e,{follow_mount:!1});if(!FS.isMountpoint(t.node))throw new FS.ErrnoError(28);var r=t.node,i=r.mounted,n=FS.getMounts(i);Object.keys(FS.nameTable).forEach((e=>{for(var t=FS.nameTable[e];t;){var r=t.name_next;n.includes(t.mount)&&FS.destroyNode(t),t=r}})),r.mounted=null;var a=r.mount.mounts.indexOf(i);r.mount.mounts.splice(a,1)},lookup:(e,t)=>e.node_ops.lookup(e,t),mknod:(e,t,r)=>{var i=FS.lookupPath(e,{parent:!0}).node,n=PATH.basename(e);if(!n||"."===n||".."===n)throw new FS.ErrnoError(28);var a=FS.mayCreate(i,n);if(a)throw new FS.ErrnoError(a);if(!i.node_ops.mknod)throw new FS.ErrnoError(63);return i.node_ops.mknod(i,n,t,r)},create:(e,t)=>(t=void 0!==t?t:438,t&=4095,t|=32768,FS.mknod(e,t,0)),mkdir:(e,t)=>(t=void 0!==t?t:511,t&=1023,t|=16384,FS.mknod(e,t,0)),mkdirTree:(e,t)=>{for(var r=e.split("/"),i="",n=0;n<r.length;++n)if(r[n]){i+="/"+r[n];try{FS.mkdir(i,t)}catch(e){if(20!=e.errno)throw e}}},mkdev:(e,t,r)=>(void 0===r&&(r=t,t=438),t|=8192,FS.mknod(e,t,r)),symlink:(e,t)=>{if(!PATH_FS.resolve(e))throw new FS.ErrnoError(44);var r=FS.lookupPath(t,{parent:!0}).node;if(!r)throw new FS.ErrnoError(44);var i=PATH.basename(t),n=FS.mayCreate(r,i);if(n)throw new FS.ErrnoError(n);if(!r.node_ops.symlink)throw new FS.ErrnoError(63);return r.node_ops.symlink(r,i,e)},rename:(e,t)=>{var r,i,n=PATH.dirname(e),a=PATH.dirname(t),s=PATH.basename(e),o=PATH.basename(t);if(r=FS.lookupPath(e,{parent:!0}).node,i=FS.lookupPath(t,{parent:!0}).node,!r||!i)throw new FS.ErrnoError(44);if(r.mount!==i.mount)throw new FS.ErrnoError(75);var l,c=FS.lookupNode(r,s),d=PATH_FS.relative(e,a);if("."!==d.charAt(0))throw new FS.ErrnoError(28);if("."!==(d=PATH_FS.relative(t,n)).charAt(0))throw new FS.ErrnoError(55);try{l=FS.lookupNode(i,o)}catch(e){}if(c!==l){var u=FS.isDir(c.mode),h=FS.mayDelete(r,s,u);if(h)throw new FS.ErrnoError(h);if(h=l?FS.mayDelete(i,o,u):FS.mayCreate(i,o))throw new FS.ErrnoError(h);if(!r.node_ops.rename)throw new FS.ErrnoError(63);if(FS.isMountpoint(c)||l&&FS.isMountpoint(l))throw new FS.ErrnoError(10);if(i!==r&&(h=FS.nodePermissions(r,"w")))throw new FS.ErrnoError(h);FS.hashRemoveNode(c);try{r.node_ops.rename(c,i,o)}catch(e){throw e}finally{FS.hashAddNode(c)}}},rmdir:e=>{var t=FS.lookupPath(e,{parent:!0}).node,r=PATH.basename(e),i=FS.lookupNode(t,r),n=FS.mayDelete(t,r,!0);if(n)throw new FS.ErrnoError(n);if(!t.node_ops.rmdir)throw new FS.ErrnoError(63);if(FS.isMountpoint(i))throw new FS.ErrnoError(10);t.node_ops.rmdir(t,r),FS.destroyNode(i)},readdir:e=>{var t=FS.lookupPath(e,{follow:!0}).node;if(!t.node_ops.readdir)throw new FS.ErrnoError(54);return t.node_ops.readdir(t)},unlink:e=>{var t=FS.lookupPath(e,{parent:!0}).node;if(!t)throw new FS.ErrnoError(44);var r=PATH.basename(e),i=FS.lookupNode(t,r),n=FS.mayDelete(t,r,!1);if(n)throw new FS.ErrnoError(n);if(!t.node_ops.unlink)throw new FS.ErrnoError(63);if(FS.isMountpoint(i))throw new FS.ErrnoError(10);t.node_ops.unlink(t,r),FS.destroyNode(i)},readlink:e=>{var t=FS.lookupPath(e).node;if(!t)throw new FS.ErrnoError(44);if(!t.node_ops.readlink)throw new FS.ErrnoError(28);return PATH_FS.resolve(FS.getPath(t.parent),t.node_ops.readlink(t))},stat:(e,t)=>{var r=FS.lookupPath(e,{follow:!t}).node;if(!r)throw new FS.ErrnoError(44);if(!r.node_ops.getattr)throw new FS.ErrnoError(63);return r.node_ops.getattr(r)},lstat:e=>FS.stat(e,!0),chmod:(e,t,r)=>{var i;if(!(i="string"==typeof e?FS.lookupPath(e,{follow:!r}).node:e).node_ops.setattr)throw new FS.ErrnoError(63);i.node_ops.setattr(i,{mode:4095&t|-4096&i.mode,timestamp:Date.now()})},lchmod:(e,t)=>{FS.chmod(e,t,!0)},fchmod:(e,t)=>{var r=FS.getStream(e);if(!r)throw new FS.ErrnoError(8);FS.chmod(r.node,t)},chown:(e,t,r,i)=>{var n;if(!(n="string"==typeof e?FS.lookupPath(e,{follow:!i}).node:e).node_ops.setattr)throw new FS.ErrnoError(63);n.node_ops.setattr(n,{timestamp:Date.now()})},lchown:(e,t,r)=>{FS.chown(e,t,r,!0)},fchown:(e,t,r)=>{var i=FS.getStream(e);if(!i)throw new FS.ErrnoError(8);FS.chown(i.node,t,r)},truncate:(e,t)=>{if(t<0)throw new FS.ErrnoError(28);var r;if(!(r="string"==typeof e?FS.lookupPath(e,{follow:!0}).node:e).node_ops.setattr)throw new FS.ErrnoError(63);if(FS.isDir(r.mode))throw new FS.ErrnoError(31);if(!FS.isFile(r.mode))throw new FS.ErrnoError(28);var i=FS.nodePermissions(r,"w");if(i)throw new FS.ErrnoError(i);r.node_ops.setattr(r,{size:t,timestamp:Date.now()})},ftruncate:(e,t)=>{var r=FS.getStream(e);if(!r)throw new FS.ErrnoError(8);if(!(2097155&r.flags))throw new FS.ErrnoError(28);FS.truncate(r.node,t)},utime:(e,t,r)=>{var i=FS.lookupPath(e,{follow:!0}).node;i.node_ops.setattr(i,{timestamp:Math.max(t,r)})},open:(e,t,r)=>{if(""===e)throw new FS.ErrnoError(44);var i;if(r=void 0===r?438:r,r=64&(t="string"==typeof t?FS.modeStringToFlags(t):t)?4095&r|32768:0,"object"==typeof e)i=e;else{e=PATH.normalize(e);try{i=FS.lookupPath(e,{follow:!(131072&t)}).node}catch(e){}}var n=!1;if(64&t)if(i){if(128&t)throw new FS.ErrnoError(20)}else i=FS.mknod(e,r,0),n=!0;if(!i)throw new FS.ErrnoError(44);if(FS.isChrdev(i.mode)&&(t&=-513),65536&t&&!FS.isDir(i.mode))throw new FS.ErrnoError(54);if(!n){var a=FS.mayOpen(i,t);if(a)throw new FS.ErrnoError(a)}512&t&&!n&&FS.truncate(i,0),t&=-131713;var s=FS.createStream({node:i,path:FS.getPath(i),flags:t,seekable:!0,position:0,stream_ops:i.stream_ops,ungotten:[],error:!1});return s.stream_ops.open&&s.stream_ops.open(s),!Module.logReadFiles||1&t||(FS.readFiles||(FS.readFiles={}),e in FS.readFiles||(FS.readFiles[e]=1)),s},close:e=>{if(FS.isClosed(e))throw new FS.ErrnoError(8);e.getdents&&(e.getdents=null);try{e.stream_ops.close&&e.stream_ops.close(e)}catch(e){throw e}finally{FS.closeStream(e.fd)}e.fd=null},isClosed:e=>null===e.fd,llseek:(e,t,r)=>{if(FS.isClosed(e))throw new FS.ErrnoError(8);if(!e.seekable||!e.stream_ops.llseek)throw new FS.ErrnoError(70);if(0!=r&&1!=r&&2!=r)throw new FS.ErrnoError(28);return e.position=e.stream_ops.llseek(e,t,r),e.ungotten=[],e.position},read:(e,t,r,i,n)=>{if(i<0||n<0)throw new FS.ErrnoError(28);if(FS.isClosed(e))throw new FS.ErrnoError(8);if(1==(2097155&e.flags))throw new FS.ErrnoError(8);if(FS.isDir(e.node.mode))throw new FS.ErrnoError(31);if(!e.stream_ops.read)throw new FS.ErrnoError(28);var a=void 0!==n;if(a){if(!e.seekable)throw new FS.ErrnoError(70)}else n=e.position;var s=e.stream_ops.read(e,t,r,i,n);return a||(e.position+=s),s},write:(e,t,r,i,n,a)=>{if(i<0||n<0)throw new FS.ErrnoError(28);if(FS.isClosed(e))throw new FS.ErrnoError(8);if(!(2097155&e.flags))throw new FS.ErrnoError(8);if(FS.isDir(e.node.mode))throw new FS.ErrnoError(31);if(!e.stream_ops.write)throw new FS.ErrnoError(28);e.seekable&&1024&e.flags&&FS.llseek(e,0,2);var s=void 0!==n;if(s){if(!e.seekable)throw new FS.ErrnoError(70)}else n=e.position;var o=e.stream_ops.write(e,t,r,i,n,a);return s||(e.position+=o),o},allocate:(e,t,r)=>{if(FS.isClosed(e))throw new FS.ErrnoError(8);if(t<0||r<=0)throw new FS.ErrnoError(28);if(!(2097155&e.flags))throw new FS.ErrnoError(8);if(!FS.isFile(e.node.mode)&&!FS.isDir(e.node.mode))throw new FS.ErrnoError(43);if(!e.stream_ops.allocate)throw new FS.ErrnoError(138);e.stream_ops.allocate(e,t,r)},mmap:(e,t,r,i,n)=>{if(2&i&&!(2&n)&&2!=(2097155&e.flags))throw new FS.ErrnoError(2);if(1==(2097155&e.flags))throw new FS.ErrnoError(2);if(!e.stream_ops.mmap)throw new FS.ErrnoError(43);return e.stream_ops.mmap(e,t,r,i,n)},msync:(e,t,r,i,n)=>e.stream_ops.msync?e.stream_ops.msync(e,t,r,i,n):0,munmap:e=>0,ioctl:(e,t,r)=>{if(!e.stream_ops.ioctl)throw new FS.ErrnoError(59);return e.stream_ops.ioctl(e,t,r)},readFile:(e,t={})=>{if(t.flags=t.flags||0,t.encoding=t.encoding||"binary","utf8"!==t.encoding&&"binary"!==t.encoding)throw new Error('Invalid encoding type "'+t.encoding+'"');var r,i=FS.open(e,t.flags),n=FS.stat(e).size,a=new Uint8Array(n);return FS.read(i,a,0,n,0),"utf8"===t.encoding?r=UTF8ArrayToString(a,0):"binary"===t.encoding&&(r=a),FS.close(i),r},writeFile:(e,t,r={})=>{r.flags=r.flags||577;var i=FS.open(e,r.flags,r.mode);if("string"==typeof t){var n=new Uint8Array(lengthBytesUTF8(t)+1),a=stringToUTF8Array(t,n,0,n.length);FS.write(i,n,0,a,void 0,r.canOwn)}else{if(!ArrayBuffer.isView(t))throw new Error("Unsupported data type");FS.write(i,t,0,t.byteLength,void 0,r.canOwn)}FS.close(i)},cwd:()=>FS.currentPath,chdir:e=>{var t=FS.lookupPath(e,{follow:!0});if(null===t.node)throw new FS.ErrnoError(44);if(!FS.isDir(t.node.mode))throw new FS.ErrnoError(54);var r=FS.nodePermissions(t.node,"x");if(r)throw new FS.ErrnoError(r);FS.currentPath=t.path},createDefaultDirectories:()=>{FS.mkdir("/tmp"),FS.mkdir("/home"),FS.mkdir("/home/web_user")},createDefaultDevices:()=>{FS.mkdir("/dev"),FS.registerDevice(FS.makedev(1,3),{read:()=>0,write:(e,t,r,i,n)=>i}),FS.mkdev("/dev/null",FS.makedev(1,3)),TTY.register(FS.makedev(5,0),TTY.default_tty_ops),TTY.register(FS.makedev(6,0),TTY.default_tty1_ops),FS.mkdev("/dev/tty",FS.makedev(5,0)),FS.mkdev("/dev/tty1",FS.makedev(6,0));var e=getRandomDevice();FS.createDevice("/dev","random",e),FS.createDevice("/dev","urandom",e),FS.mkdir("/dev/shm"),FS.mkdir("/dev/shm/tmp")},createSpecialDirectories:()=>{FS.mkdir("/proc");var e=FS.mkdir("/proc/self");FS.mkdir("/proc/self/fd"),FS.mount({mount:()=>{var t=FS.createNode(e,"fd",16895,73);return t.node_ops={lookup:(e,t)=>{var r=+t,i=FS.getStream(r);if(!i)throw new FS.ErrnoError(8);var n={parent:null,mount:{mountpoint:"fake"},node_ops:{readlink:()=>i.path}};return n.parent=n,n}},t}},{},"/proc/self/fd")},createStandardStreams:()=>{Module.stdin?FS.createDevice("/dev","stdin",Module.stdin):FS.symlink("/dev/tty","/dev/stdin"),Module.stdout?FS.createDevice("/dev","stdout",null,Module.stdout):FS.symlink("/dev/tty","/dev/stdout"),Module.stderr?FS.createDevice("/dev","stderr",null,Module.stderr):FS.symlink("/dev/tty1","/dev/stderr"),FS.open("/dev/stdin",0),FS.open("/dev/stdout",1),FS.open("/dev/stderr",1)},ensureErrnoError:()=>{FS.ErrnoError||(FS.ErrnoError=function(e,t){this.node=t,this.setErrno=function(e){this.errno=e},this.setErrno(e),this.message="FS error"},FS.ErrnoError.prototype=new Error,FS.ErrnoError.prototype.constructor=FS.ErrnoError,[44].forEach((e=>{FS.genericErrors[e]=new FS.ErrnoError(e),FS.genericErrors[e].stack="<generic error, no stack>"})))},staticInit:()=>{FS.ensureErrnoError(),FS.nameTable=new Array(4096),FS.mount(MEMFS,{},"/"),FS.createDefaultDirectories(),FS.createDefaultDevices(),FS.createSpecialDirectories(),FS.filesystems={MEMFS}},init:(e,t,r)=>{FS.init.initialized=!0,FS.ensureErrnoError(),Module.stdin=e||Module.stdin,Module.stdout=t||Module.stdout,Module.stderr=r||Module.stderr,FS.createStandardStreams()},quit:()=>{FS.init.initialized=!1;for(var e=0;e<FS.streams.length;e++){var t=FS.streams[e];t&&FS.close(t)}},getMode:(e,t)=>{var r=0;return e&&(r|=365),t&&(r|=146),r},findObject:(e,t)=>{var r=FS.analyzePath(e,t);return r.exists?r.object:null},analyzePath:(e,t)=>{try{e=(i=FS.lookupPath(e,{follow:!t})).path}catch(e){}var r={isRoot:!1,exists:!1,error:0,name:null,path:null,object:null,parentExists:!1,parentPath:null,parentObject:null};try{var i=FS.lookupPath(e,{parent:!0});r.parentExists=!0,r.parentPath=i.path,r.parentObject=i.node,r.name=PATH.basename(e),i=FS.lookupPath(e,{follow:!t}),r.exists=!0,r.path=i.path,r.object=i.node,r.name=i.node.name,r.isRoot="/"===i.path}catch(e){r.error=e.errno}return r},createPath:(e,t,r,i)=>{e="string"==typeof e?e:FS.getPath(e);for(var n=t.split("/").reverse();n.length;){var a=n.pop();if(a){var s=PATH.join2(e,a);try{FS.mkdir(s)}catch(e){}e=s}}return s},createFile:(e,t,r,i,n)=>{var a=PATH.join2("string"==typeof e?e:FS.getPath(e),t),s=FS.getMode(i,n);return FS.create(a,s)},createDataFile:(e,t,r,i,n,a)=>{var s=t;e&&(e="string"==typeof e?e:FS.getPath(e),s=t?PATH.join2(e,t):e);var o=FS.getMode(i,n),l=FS.create(s,o);if(r){if("string"==typeof r){for(var c=new Array(r.length),d=0,u=r.length;d<u;++d)c[d]=r.charCodeAt(d);r=c}FS.chmod(l,146|o);var h=FS.open(l,577);FS.write(h,r,0,r.length,0,a),FS.close(h),FS.chmod(l,o)}return l},createDevice:(e,t,r,i)=>{var n=PATH.join2("string"==typeof e?e:FS.getPath(e),t),a=FS.getMode(!!r,!!i);FS.createDevice.major||(FS.createDevice.major=64);var s=FS.makedev(FS.createDevice.major++,0);return FS.registerDevice(s,{open:e=>{e.seekable=!1},close:e=>{i&&i.buffer&&i.buffer.length&&i(10)},read:(e,t,i,n,a)=>{for(var s=0,o=0;o<n;o++){var l;try{l=r()}catch(e){throw new FS.ErrnoError(29)}if(void 0===l&&0===s)throw new FS.ErrnoError(6);if(null==l)break;s++,t[i+o]=l}return s&&(e.node.timestamp=Date.now()),s},write:(e,t,r,n,a)=>{for(var s=0;s<n;s++)try{i(t[r+s])}catch(e){throw new FS.ErrnoError(29)}return n&&(e.node.timestamp=Date.now()),s}}),FS.mkdev(n,a,s)},forceLoadFile:e=>{if(e.isDevice||e.isFolder||e.link||e.contents)return!0;if("undefined"!=typeof XMLHttpRequest)throw new Error("Lazy loading should have been performed (contents set) in createLazyFile, but it was not. Lazy loading only works in web workers. Use --embed-file or --preload-file in emcc on the main thread.");if(!read_)throw new Error("Cannot load without read() or XMLHttpRequest.");try{e.contents=intArrayFromString(read_(e.url),!0),e.usedBytes=e.contents.length}catch(e){throw new FS.ErrnoError(29)}},createLazyFile:(e,t,r,i,n)=>{function a(){this.lengthKnown=!1,this.chunks=[]}if(a.prototype.get=function(e){if(!(e>this.length-1||e<0)){var t=e%this.chunkSize,r=e/this.chunkSize|0;return this.getter(r)[t]}},a.prototype.setDataGetter=function(e){this.getter=e},a.prototype.cacheLength=function(){var e=new XMLHttpRequest;if(e.open("HEAD",r,!1),e.send(null),!(e.status>=200&&e.status<300||304===e.status))throw new Error("Couldn't load "+r+". Status: "+e.status);var t,i=Number(e.getResponseHeader("Content-length")),n=(t=e.getResponseHeader("Accept-Ranges"))&&"bytes"===t,a=(t=e.getResponseHeader("Content-Encoding"))&&"gzip"===t,s=1048576;n||(s=i);var o=this;o.setDataGetter((e=>{var t=e*s,n=(e+1)*s-1;if(n=Math.min(n,i-1),void 0===o.chunks[e]&&(o.chunks[e]=((e,t)=>{if(e>t)throw new Error("invalid range ("+e+", "+t+") or no bytes requested!");if(t>i-1)throw new Error("only "+i+" bytes available! programmer error!");var n=new XMLHttpRequest;if(n.open("GET",r,!1),i!==s&&n.setRequestHeader("Range","bytes="+e+"-"+t),n.responseType="arraybuffer",n.overrideMimeType&&n.overrideMimeType("text/plain; charset=x-user-defined"),n.send(null),!(n.status>=200&&n.status<300||304===n.status))throw new Error("Couldn't load "+r+". Status: "+n.status);return void 0!==n.response?new Uint8Array(n.response||[]):intArrayFromString(n.responseText||"",!0)})(t,n)),void 0===o.chunks[e])throw new Error("doXHR failed!");return o.chunks[e]})),!a&&i||(s=i=1,i=this.getter(0).length,s=i,out("LazyFiles on gzip forces download of the whole file when length is accessed")),this._length=i,this._chunkSize=s,this.lengthKnown=!0},"undefined"!=typeof XMLHttpRequest){if(!ENVIRONMENT_IS_WORKER)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var s=new a;Object.defineProperties(s,{length:{get:function(){return this.lengthKnown||this.cacheLength(),this._length}},chunkSize:{get:function(){return this.lengthKnown||this.cacheLength(),this._chunkSize}}});var o={isDevice:!1,contents:s}}else o={isDevice:!1,url:r};var l=FS.createFile(e,t,o,i,n);o.contents?l.contents=o.contents:o.url&&(l.contents=null,l.url=o.url),Object.defineProperties(l,{usedBytes:{get:function(){return this.contents.length}}});var c={};function d(e,t,r,i,n){var a=e.node.contents;if(n>=a.length)return 0;var s=Math.min(a.length-n,i);if(a.slice)for(var o=0;o<s;o++)t[r+o]=a[n+o];else for(o=0;o<s;o++)t[r+o]=a.get(n+o);return s}return Object.keys(l.stream_ops).forEach((e=>{var t=l.stream_ops[e];c[e]=function(){return FS.forceLoadFile(l),t.apply(null,arguments)}})),c.read=(e,t,r,i,n)=>(FS.forceLoadFile(l),d(e,t,r,i,n)),c.mmap=(e,t,r,i,n)=>{FS.forceLoadFile(l);var a=mmapAlloc(t);if(!a)throw new FS.ErrnoError(48);return d(e,HEAP8,a,t,r),{ptr:a,allocated:!0}},l.stream_ops=c,l},createPreloadedFile:(e,t,r,i,n,a,s,o,l,c)=>{var d=t?PATH_FS.resolve(PATH.join2(e,t)):e,u=getUniqueRunDependency("cp "+d);function h(r){function h(r){c&&c(),o||FS.createDataFile(e,t,r,i,n,l),a&&a(),removeRunDependency(u)}Browser.handledByPreloadPlugin(r,d,h,(()=>{s&&s(),removeRunDependency(u)}))||h(r)}addRunDependency(u),"string"==typeof r?asyncLoad(r,(e=>h(e)),s):h(r)},indexedDB:()=>window.indexedDB||window.mozIndexedDB||window.webkitIndexedDB||window.msIndexedDB,DB_NAME:()=>"EM_FS_"+window.location.pathname,DB_VERSION:20,DB_STORE_NAME:"FILE_DATA",saveFilesToDB:(e,t,r)=>{t=t||(()=>{}),r=r||(()=>{});var i=FS.indexedDB();try{var n=i.open(FS.DB_NAME(),FS.DB_VERSION)}catch(e){return r(e)}n.onupgradeneeded=()=>{out("creating db"),n.result.createObjectStore(FS.DB_STORE_NAME)},n.onsuccess=()=>{var i=n.result.transaction([FS.DB_STORE_NAME],"readwrite"),a=i.objectStore(FS.DB_STORE_NAME),s=0,o=0,l=e.length;function c(){0==o?t():r()}e.forEach((e=>{var t=a.put(FS.analyzePath(e).object.contents,e);t.onsuccess=()=>{++s+o==l&&c()},t.onerror=()=>{o++,s+o==l&&c()}})),i.onerror=r},n.onerror=r},loadFilesFromDB:(e,t,r)=>{t=t||(()=>{}),r=r||(()=>{});var i=FS.indexedDB();try{var n=i.open(FS.DB_NAME(),FS.DB_VERSION)}catch(e){return r(e)}n.onupgradeneeded=r,n.onsuccess=()=>{var i=n.result;try{var a=i.transaction([FS.DB_STORE_NAME],"readonly")}catch(e){return void r(e)}var s=a.objectStore(FS.DB_STORE_NAME),o=0,l=0,c=e.length;function d(){0==l?t():r()}e.forEach((e=>{var t=s.get(e);t.onsuccess=()=>{FS.analyzePath(e).exists&&FS.unlink(e),FS.createDataFile(PATH.dirname(e),PATH.basename(e),t.result,!0,!0,!0),++o+l==c&&d()},t.onerror=()=>{l++,o+l==c&&d()}})),a.onerror=r},n.onerror=r}},SYSCALLS={DEFAULT_POLLMASK:5,calculateAt:function(e,t,r){if(PATH.isAbs(t))return t;var i;if(i=-100===e?FS.cwd():SYSCALLS.getStreamFromFD(e).path,0==t.length){if(!r)throw new FS.ErrnoError(44);return i}return PATH.join2(i,t)},doStat:function(e,t,r){try{var i=e(t)}catch(e){if(e&&e.node&&PATH.normalize(t)!==PATH.normalize(FS.getPath(e.node)))return-54;throw e}return HEAP32[r>>2]=i.dev,HEAP32[r+8>>2]=i.ino,HEAP32[r+12>>2]=i.mode,HEAPU32[r+16>>2]=i.nlink,HEAP32[r+20>>2]=i.uid,HEAP32[r+24>>2]=i.gid,HEAP32[r+28>>2]=i.rdev,tempI64=[i.size>>>0,(tempDouble=i.size,+Math.abs(tempDouble)>=1?tempDouble>0?(0|Math.min(+Math.floor(tempDouble/4294967296),4294967295))>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[r+40>>2]=tempI64[0],HEAP32[r+44>>2]=tempI64[1],HEAP32[r+48>>2]=4096,HEAP32[r+52>>2]=i.blocks,tempI64=[Math.floor(i.atime.getTime()/1e3)>>>0,(tempDouble=Math.floor(i.atime.getTime()/1e3),+Math.abs(tempDouble)>=1?tempDouble>0?(0|Math.min(+Math.floor(tempDouble/4294967296),4294967295))>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[r+56>>2]=tempI64[0],HEAP32[r+60>>2]=tempI64[1],HEAPU32[r+64>>2]=0,tempI64=[Math.floor(i.mtime.getTime()/1e3)>>>0,(tempDouble=Math.floor(i.mtime.getTime()/1e3),+Math.abs(tempDouble)>=1?tempDouble>0?(0|Math.min(+Math.floor(tempDouble/4294967296),4294967295))>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[r+72>>2]=tempI64[0],HEAP32[r+76>>2]=tempI64[1],HEAPU32[r+80>>2]=0,tempI64=[Math.floor(i.ctime.getTime()/1e3)>>>0,(tempDouble=Math.floor(i.ctime.getTime()/1e3),+Math.abs(tempDouble)>=1?tempDouble>0?(0|Math.min(+Math.floor(tempDouble/4294967296),4294967295))>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[r+88>>2]=tempI64[0],HEAP32[r+92>>2]=tempI64[1],HEAPU32[r+96>>2]=0,tempI64=[i.ino>>>0,(tempDouble=i.ino,+Math.abs(tempDouble)>=1?tempDouble>0?(0|Math.min(+Math.floor(tempDouble/4294967296),4294967295))>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[r+104>>2]=tempI64[0],HEAP32[r+108>>2]=tempI64[1],0},doMsync:function(e,t,r,i,n){if(!FS.isFile(t.node.mode))throw new FS.ErrnoError(43);if(2&i)return 0;var a=HEAPU8.slice(e,e+r);FS.msync(t,a,n,r,i)},varargs:void 0,get:function(){return SYSCALLS.varargs+=4,HEAP32[SYSCALLS.varargs-4>>2]},getStr:function(e){return UTF8ToString(e)},getStreamFromFD:function(e){var t=FS.getStream(e);if(!t)throw new FS.ErrnoError(8);return t}};function ___syscall_fcntl64(e,t,r){SYSCALLS.varargs=r;try{var i=SYSCALLS.getStreamFromFD(e);switch(t){case 0:return(n=SYSCALLS.get())<0?-28:FS.createStream(i,n).fd;case 1:case 2:case 6:case 7:return 0;case 3:return i.flags;case 4:var n=SYSCALLS.get();return i.flags|=n,0;case 5:return n=SYSCALLS.get(),HEAP16[n+0>>1]=2,0;case 16:case 8:default:return-28;case 9:return setErrNo(28),-1}}catch(e){if(void 0===FS||!(e instanceof FS.ErrnoError))throw e;return-e.errno}}function ___syscall_fstat64(e,t){try{var r=SYSCALLS.getStreamFromFD(e);return SYSCALLS.doStat(FS.stat,r.path,t)}catch(e){if(void 0===FS||!(e instanceof FS.ErrnoError))throw e;return-e.errno}}function ___syscall_getcwd(e,t){try{if(0===t)return-28;var r=FS.cwd(),i=lengthBytesUTF8(r)+1;return t<i?-68:(stringToUTF8(r,e,t),i)}catch(e){if(void 0===FS||!(e instanceof FS.ErrnoError))throw e;return-e.errno}}function ___syscall_getdents64(e,t,r){try{var i=SYSCALLS.getStreamFromFD(e);i.getdents||(i.getdents=FS.readdir(i.path));for(var n=280,a=0,s=FS.llseek(i,0,1),o=Math.floor(s/n);o<i.getdents.length&&a+n<=r;){var l,c,d=i.getdents[o];if("."===d)l=i.node.id,c=4;else if(".."===d)l=FS.lookupPath(i.path,{parent:!0}).node.id,c=4;else{var u=FS.lookupNode(i.node,d);l=u.id,c=FS.isChrdev(u.mode)?2:FS.isDir(u.mode)?4:FS.isLink(u.mode)?10:8}tempI64=[l>>>0,(tempDouble=l,+Math.abs(tempDouble)>=1?tempDouble>0?(0|Math.min(+Math.floor(tempDouble/4294967296),4294967295))>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[t+a>>2]=tempI64[0],HEAP32[t+a+4>>2]=tempI64[1],tempI64=[(o+1)*n>>>0,(tempDouble=(o+1)*n,+Math.abs(tempDouble)>=1?tempDouble>0?(0|Math.min(+Math.floor(tempDouble/4294967296),4294967295))>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[t+a+8>>2]=tempI64[0],HEAP32[t+a+12>>2]=tempI64[1],HEAP16[t+a+16>>1]=280,HEAP8[t+a+18|0]=c,stringToUTF8(d,t+a+19,256),a+=n,o+=1}return FS.llseek(i,o*n,0),a}catch(e){if(void 0===FS||!(e instanceof FS.ErrnoError))throw e;return-e.errno}}function ___syscall_ioctl(e,t,r){SYSCALLS.varargs=r;try{var i=SYSCALLS.getStreamFromFD(e);switch(t){case 21509:case 21505:case 21510:case 21511:case 21512:case 21506:case 21507:case 21508:case 21523:case 21524:return i.tty?0:-59;case 21519:if(!i.tty)return-59;var n=SYSCALLS.get();return HEAP32[n>>2]=0,0;case 21520:return i.tty?-28:-59;case 21531:return n=SYSCALLS.get(),FS.ioctl(i,t,n);default:return-28}}catch(e){if(void 0===FS||!(e instanceof FS.ErrnoError))throw e;return-e.errno}}function ___syscall_lstat64(e,t){try{return e=SYSCALLS.getStr(e),SYSCALLS.doStat(FS.lstat,e,t)}catch(e){if(void 0===FS||!(e instanceof FS.ErrnoError))throw e;return-e.errno}}function ___syscall_mkdirat(e,t,r){try{return t=SYSCALLS.getStr(t),t=SYSCALLS.calculateAt(e,t),"/"===(t=PATH.normalize(t))[t.length-1]&&(t=t.substr(0,t.length-1)),FS.mkdir(t,r,0),0}catch(e){if(void 0===FS||!(e instanceof FS.ErrnoError))throw e;return-e.errno}}function ___syscall_newfstatat(e,t,r,i){try{t=SYSCALLS.getStr(t);var n=256&i,a=4096&i;return i&=-6401,t=SYSCALLS.calculateAt(e,t,a),SYSCALLS.doStat(n?FS.lstat:FS.stat,t,r)}catch(e){if(void 0===FS||!(e instanceof FS.ErrnoError))throw e;return-e.errno}}function ___syscall_openat(e,t,r,i){SYSCALLS.varargs=i;try{t=SYSCALLS.getStr(t),t=SYSCALLS.calculateAt(e,t);var n=i?SYSCALLS.get():0;return FS.open(t,r,n).fd}catch(e){if(void 0===FS||!(e instanceof FS.ErrnoError))throw e;return-e.errno}}var PIPEFS={BUCKET_BUFFER_SIZE:8192,mount:function(e){return FS.createNode(null,"/",16895,0)},createPipe:function(){var e={buckets:[],refcnt:2};e.buckets.push({buffer:new Uint8Array(PIPEFS.BUCKET_BUFFER_SIZE),offset:0,roffset:0});var t=PIPEFS.nextname(),r=PIPEFS.nextname(),i=FS.createNode(PIPEFS.root,t,4096,0),n=FS.createNode(PIPEFS.root,r,4096,0);i.pipe=e,n.pipe=e;var a=FS.createStream({path:t,node:i,flags:0,seekable:!1,stream_ops:PIPEFS.stream_ops});i.stream=a;var s=FS.createStream({path:r,node:n,flags:1,seekable:!1,stream_ops:PIPEFS.stream_ops});return n.stream=s,{readable_fd:a.fd,writable_fd:s.fd}},stream_ops:{poll:function(e){var t=e.node.pipe;if(1==(2097155&e.flags))return 260;if(t.buckets.length>0)for(var r=0;r<t.buckets.length;r++){var i=t.buckets[r];if(i.offset-i.roffset>0)return 65}return 0},ioctl:function(e,t,r){return 28},fsync:function(e){return 28},read:function(e,t,r,i,n){for(var a=e.node.pipe,s=0,o=0;o<a.buckets.length;o++){var l=a.buckets[o];s+=l.offset-l.roffset}assert(t instanceof ArrayBuffer||ArrayBuffer.isView(t));var c=t.subarray(r,r+i);if(i<=0)return 0;if(0==s)throw new FS.ErrnoError(6);var d=Math.min(s,i),u=d,h=0;for(o=0;o<a.buckets.length;o++){var _=a.buckets[o],f=_.offset-_.roffset;if(d<=f){var p=_.buffer.subarray(_.roffset,_.offset);d<f?(p=p.subarray(0,d),_.roffset+=d):h++,c.set(p);break}p=_.buffer.subarray(_.roffset,_.offset),c.set(p),c=c.subarray(p.byteLength),d-=p.byteLength,h++}return h&&h==a.buckets.length&&(h--,a.buckets[h].offset=0,a.buckets[h].roffset=0),a.buckets.splice(0,h),u},write:function(e,t,r,i,n){var a=e.node.pipe;assert(t instanceof ArrayBuffer||ArrayBuffer.isView(t));var s=t.subarray(r,r+i),o=s.byteLength;if(o<=0)return 0;var l=null;0==a.buckets.length?(l={buffer:new Uint8Array(PIPEFS.BUCKET_BUFFER_SIZE),offset:0,roffset:0},a.buckets.push(l)):l=a.buckets[a.buckets.length-1],assert(l.offset<=PIPEFS.BUCKET_BUFFER_SIZE);var c=PIPEFS.BUCKET_BUFFER_SIZE-l.offset;if(c>=o)return l.buffer.set(s,l.offset),l.offset+=o,o;c>0&&(l.buffer.set(s.subarray(0,c),l.offset),l.offset+=c,s=s.subarray(c,s.byteLength));for(var d=s.byteLength/PIPEFS.BUCKET_BUFFER_SIZE|0,u=s.byteLength%PIPEFS.BUCKET_BUFFER_SIZE,h=0;h<d;h++){var _={buffer:new Uint8Array(PIPEFS.BUCKET_BUFFER_SIZE),offset:PIPEFS.BUCKET_BUFFER_SIZE,roffset:0};a.buckets.push(_),_.buffer.set(s.subarray(0,PIPEFS.BUCKET_BUFFER_SIZE)),s=s.subarray(PIPEFS.BUCKET_BUFFER_SIZE,s.byteLength)}return u>0&&(_={buffer:new Uint8Array(PIPEFS.BUCKET_BUFFER_SIZE),offset:s.byteLength,roffset:0},a.buckets.push(_),_.buffer.set(s)),o},close:function(e){var t=e.node.pipe;t.refcnt--,0===t.refcnt&&(t.buckets=null)}},nextname:function(){return PIPEFS.nextname.current||(PIPEFS.nextname.current=0),"pipe["+PIPEFS.nextname.current+++"]"}};function ___syscall_pipe(e){try{if(0==e)throw new FS.ErrnoError(21);var t=PIPEFS.createPipe();return HEAP32[e>>2]=t.readable_fd,HEAP32[e+4>>2]=t.writable_fd,0}catch(e){if(void 0===FS||!(e instanceof FS.ErrnoError))throw e;return-e.errno}}function ___syscall_poll(e,t,r){try{for(var i=0,n=0;n<t;n++){var a=e+8*n,s=HEAP32[a>>2],o=HEAP16[a+4>>1],l=32,c=FS.getStream(s);c&&(l=SYSCALLS.DEFAULT_POLLMASK,c.stream_ops.poll&&(l=c.stream_ops.poll(c))),(l&=24|o)&&i++,HEAP16[a+6>>1]=l}return i}catch(e){if(void 0===FS||!(e instanceof FS.ErrnoError))throw e;return-e.errno}}function ___syscall_stat64(e,t){try{return e=SYSCALLS.getStr(e),SYSCALLS.doStat(FS.stat,e,t)}catch(e){if(void 0===FS||!(e instanceof FS.ErrnoError))throw e;return-e.errno}}var nowIsMonotonic=!0;function __emscripten_get_now_is_monotonic(){return nowIsMonotonic}function __emscripten_throw_longjmp(){throw 1/0}function readI53FromI64(e){return HEAPU32[e>>2]+4294967296*HEAP32[e+4>>2]}function __gmtime_js(e,t){var r=new Date(1e3*readI53FromI64(e));HEAP32[t>>2]=r.getUTCSeconds(),HEAP32[t+4>>2]=r.getUTCMinutes(),HEAP32[t+8>>2]=r.getUTCHours(),HEAP32[t+12>>2]=r.getUTCDate(),HEAP32[t+16>>2]=r.getUTCMonth(),HEAP32[t+20>>2]=r.getUTCFullYear()-1900,HEAP32[t+24>>2]=r.getUTCDay();var i=Date.UTC(r.getUTCFullYear(),0,1,0,0,0,0),n=(r.getTime()-i)/864e5|0;HEAP32[t+28>>2]=n}function __isLeapYear(e){return e%4==0&&(e%100!=0||e%400==0)}var __MONTH_DAYS_LEAP_CUMULATIVE=[0,31,60,91,121,152,182,213,244,274,305,335],__MONTH_DAYS_REGULAR_CUMULATIVE=[0,31,59,90,120,151,181,212,243,273,304,334];function __yday_from_date(e){return(__isLeapYear(e.getFullYear())?__MONTH_DAYS_LEAP_CUMULATIVE:__MONTH_DAYS_REGULAR_CUMULATIVE)[e.getMonth()]+e.getDate()-1}function __localtime_js(e,t){var r=new Date(1e3*readI53FromI64(e));HEAP32[t>>2]=r.getSeconds(),HEAP32[t+4>>2]=r.getMinutes(),HEAP32[t+8>>2]=r.getHours(),HEAP32[t+12>>2]=r.getDate(),HEAP32[t+16>>2]=r.getMonth(),HEAP32[t+20>>2]=r.getFullYear()-1900,HEAP32[t+24>>2]=r.getDay();var i=0|__yday_from_date(r);HEAP32[t+28>>2]=i,HEAP32[t+36>>2]=-60*r.getTimezoneOffset();var n=new Date(r.getFullYear(),0,1),a=new Date(r.getFullYear(),6,1).getTimezoneOffset(),s=n.getTimezoneOffset(),o=0|(a!=s&&r.getTimezoneOffset()==Math.min(s,a));HEAP32[t+32>>2]=o}function __munmap_js(e,t,r,i,n,a){try{var s=SYSCALLS.getStreamFromFD(n);2&r&&SYSCALLS.doMsync(e,s,t,i,a),FS.munmap(s)}catch(e){if(void 0===FS||!(e instanceof FS.ErrnoError))throw e;return-e.errno}}function allocateUTF8(e){var t=lengthBytesUTF8(e)+1,r=_malloc(t);return r&&stringToUTF8Array(e,HEAP8,r,t),r}function __tzset_js(e,t,r){var i=(new Date).getFullYear(),n=new Date(i,0,1),a=new Date(i,6,1),s=n.getTimezoneOffset(),o=a.getTimezoneOffset(),l=Math.max(s,o);function c(e){var t=e.toTimeString().match(/\(([A-Za-z ]+)\)$/);return t?t[1]:"GMT"}HEAPU32[e>>2]=60*l,HEAP32[t>>2]=Number(s!=o);var d=c(n),u=c(a),h=allocateUTF8(d),_=allocateUTF8(u);o<s?(HEAPU32[r>>2]=h,HEAPU32[r+4>>2]=_):(HEAPU32[r>>2]=_,HEAPU32[r+4>>2]=h)}function _abort(){abort("")}var _emscripten_get_now,readEmAsmArgsArray=[];function readEmAsmArgs(e,t){var r;for(readEmAsmArgsArray.length=0,t>>=2;r=HEAPU8[e++];)t+=105!=r&t,readEmAsmArgsArray.push(105==r?HEAP32[t]:HEAPF64[t++>>1]),++t;return readEmAsmArgsArray}function runEmAsmFunction(e,t,r){var i=readEmAsmArgs(t,r);return ASM_CONSTS[e].apply(null,i)}function _emscripten_asm_const_double(e,t,r){return runEmAsmFunction(e,t,r)}function _emscripten_asm_const_int(e,t,r){return runEmAsmFunction(e,t,r)}function runMainThreadEmAsm(e,t,r,i){var n=readEmAsmArgs(t,r);return ASM_CONSTS[e].apply(null,n)}function _emscripten_asm_const_int_sync_on_main_thread(e,t,r){return runMainThreadEmAsm(e,t,r,1)}function _emscripten_date_now(){return Date.now()}function getHeapMax(){return 2147483648}function _emscripten_get_heap_max(){return getHeapMax()}function _emscripten_memcpy_big(e,t,r){HEAPU8.copyWithin(e,t,t+r)}function emscripten_realloc_buffer(e){try{return wasmMemory.grow(e-buffer.byteLength+65535>>>16),updateGlobalBufferAndViews(wasmMemory.buffer),1}catch(e){postMessage({status:-35,cmd:-35})}}function _emscripten_resize_heap(e){var t=HEAPU8.length;e>>>=0;var r,i=getHeapMax();if(e>i)return!1;for(var n=1;n<=4;n*=2){var a=t*(1+.2/n);if(a=Math.min(a,e+100663296),emscripten_realloc_buffer(Math.min(i,(r=Math.max(e,a))+(65536-r%65536)%65536)))return!0}return!1}_emscripten_get_now=()=>performance.now();var ENV={};function getExecutableName(){return thisProgram||"./this.program"}function getEnvStrings(){if(!getEnvStrings.strings){var e={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:("object"==typeof navigator&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",_:getExecutableName()};for(var t in ENV)void 0===ENV[t]?delete e[t]:e[t]=ENV[t];var r=[];for(var t in e)r.push(t+"="+e[t]);getEnvStrings.strings=r}return getEnvStrings.strings}function writeAsciiToMemory(e,t,r){for(var i=0;i<e.length;++i)HEAP8[0|t++]=e.charCodeAt(i);r||(HEAP8[0|t]=0)}function _environ_get(e,t){var r=0;return getEnvStrings().forEach((function(i,n){var a=t+r;HEAPU32[e+4*n>>2]=a,writeAsciiToMemory(i,a),r+=i.length+1})),0}function _environ_sizes_get(e,t){var r=getEnvStrings();HEAPU32[e>>2]=r.length;var i=0;return r.forEach((function(e){i+=e.length+1})),HEAPU32[t>>2]=i,0}function _proc_exit(e){EXITSTATUS=e,keepRuntimeAlive()||(Module.onExit&&Module.onExit(e),ABORT=!0),quit_(e,new ExitStatus(e))}function exitJS(e,t){EXITSTATUS=e,_proc_exit(e)}var _exit=exitJS;function _fd_close(e){try{var t=SYSCALLS.getStreamFromFD(e);return FS.close(t),0}catch(e){if(void 0===FS||!(e instanceof FS.ErrnoError))throw e;return e.errno}}function doReadv(e,t,r,i){for(var n=0,a=0;a<r;a++){var s=HEAPU32[t>>2],o=HEAPU32[t+4>>2];t+=8;var l=FS.read(e,HEAP8,s,o,i);if(l<0)return-1;if(n+=l,l<o)break}return n}function _fd_read(e,t,r,i){try{var n=doReadv(SYSCALLS.getStreamFromFD(e),t,r);return HEAPU32[i>>2]=n,0}catch(e){if(void 0===FS||!(e instanceof FS.ErrnoError))throw e;return e.errno}}function convertI32PairToI53Checked(e,t){return t+2097152>>>0<4194305-!!e?(e>>>0)+4294967296*t:NaN}function _fd_seek(e,t,r,i,n){try{var a=convertI32PairToI53Checked(t,r);if(isNaN(a))return 61;var s=SYSCALLS.getStreamFromFD(e);return FS.llseek(s,a,i),tempI64=[s.position>>>0,(tempDouble=s.position,+Math.abs(tempDouble)>=1?tempDouble>0?(0|Math.min(+Math.floor(tempDouble/4294967296),4294967295))>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[n>>2]=tempI64[0],HEAP32[n+4>>2]=tempI64[1],s.getdents&&0===a&&0===i&&(s.getdents=null),0}catch(e){if(void 0===FS||!(e instanceof FS.ErrnoError))throw e;return e.errno}}function doWritev(e,t,r,i){for(var n=0,a=0;a<r;a++){var s=HEAPU32[t>>2],o=HEAPU32[t+4>>2];t+=8;var l=FS.write(e,HEAP8,s,o,i);if(l<0)return-1;n+=l}return n}function _fd_write(e,t,r,i){try{var n=doWritev(SYSCALLS.getStreamFromFD(e),t,r);return HEAPU32[i>>2]=n,0}catch(e){if(void 0===FS||!(e instanceof FS.ErrnoError))throw e;return e.errno}}function _llvm_eh_typeid_for(e){return e}function _setCurrentThreadSsrc(e){setCurrentThreadSsrc_js(e)}function __arraySum(e,t){for(var r=0,i=0;i<=t;r+=e[i++]);return r}var __MONTH_DAYS_LEAP=[31,29,31,30,31,30,31,31,30,31,30,31],__MONTH_DAYS_REGULAR=[31,28,31,30,31,30,31,31,30,31,30,31];function __addDays(e,t){for(var r=new Date(e.getTime());t>0;){var i=__isLeapYear(r.getFullYear()),n=r.getMonth(),a=(i?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR)[n];if(!(t>a-r.getDate()))return r.setDate(r.getDate()+t),r;t-=a-r.getDate()+1,r.setDate(1),n<11?r.setMonth(n+1):(r.setMonth(0),r.setFullYear(r.getFullYear()+1))}return r}function writeArrayToMemory(e,t){HEAP8.set(e,t)}function _strftime(e,t,r,i){var n=HEAP32[i+40>>2],a={tm_sec:HEAP32[i>>2],tm_min:HEAP32[i+4>>2],tm_hour:HEAP32[i+8>>2],tm_mday:HEAP32[i+12>>2],tm_mon:HEAP32[i+16>>2],tm_year:HEAP32[i+20>>2],tm_wday:HEAP32[i+24>>2],tm_yday:HEAP32[i+28>>2],tm_isdst:HEAP32[i+32>>2],tm_gmtoff:HEAP32[i+36>>2],tm_zone:n?UTF8ToString(n):""},s=UTF8ToString(r),o={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"};for(var l in o)s=s.replace(new RegExp(l,"g"),o[l]);var c=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],d=["January","February","March","April","May","June","July","August","September","October","November","December"];function u(e,t,r){for(var i="number"==typeof e?e.toString():e||"";i.length<t;)i=r[0]+i;return i}function h(e,t){return u(e,t,"0")}function _(e,t){function r(e){return e<0?-1:e>0?1:0}var i;return 0===(i=r(e.getFullYear()-t.getFullYear()))&&0===(i=r(e.getMonth()-t.getMonth()))&&(i=r(e.getDate()-t.getDate())),i}function f(e){switch(e.getDay()){case 0:return new Date(e.getFullYear()-1,11,29);case 1:return e;case 2:return new Date(e.getFullYear(),0,3);case 3:return new Date(e.getFullYear(),0,2);case 4:return new Date(e.getFullYear(),0,1);case 5:return new Date(e.getFullYear()-1,11,31);case 6:return new Date(e.getFullYear()-1,11,30)}}function p(e){var t=__addDays(new Date(e.tm_year+1900,0,1),e.tm_yday),r=new Date(t.getFullYear(),0,4),i=new Date(t.getFullYear()+1,0,4),n=f(r),a=f(i);return _(n,t)<=0?_(a,t)<=0?t.getFullYear()+1:t.getFullYear():t.getFullYear()-1}var m={"%a":function(e){return c[e.tm_wday].substring(0,3)},"%A":function(e){return c[e.tm_wday]},"%b":function(e){return d[e.tm_mon].substring(0,3)},"%B":function(e){return d[e.tm_mon]},"%C":function(e){return h((e.tm_year+1900)/100|0,2)},"%d":function(e){return h(e.tm_mday,2)},"%e":function(e){return u(e.tm_mday,2," ")},"%g":function(e){return p(e).toString().substring(2)},"%G":function(e){return p(e)},"%H":function(e){return h(e.tm_hour,2)},"%I":function(e){var t=e.tm_hour;return 0==t?t=12:t>12&&(t-=12),h(t,2)},"%j":function(e){return h(e.tm_mday+__arraySum(__isLeapYear(e.tm_year+1900)?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR,e.tm_mon-1),3)},"%m":function(e){return h(e.tm_mon+1,2)},"%M":function(e){return h(e.tm_min,2)},"%n":function(){return"\n"},"%p":function(e){return e.tm_hour>=0&&e.tm_hour<12?"AM":"PM"},"%S":function(e){return h(e.tm_sec,2)},"%t":function(){return"\t"},"%u":function(e){return e.tm_wday||7},"%U":function(e){var t=e.tm_yday+7-e.tm_wday;return h(Math.floor(t/7),2)},"%V":function(e){var t=Math.floor((e.tm_yday+7-(e.tm_wday+6)%7)/7);if((e.tm_wday+371-e.tm_yday-2)%7<=2&&t++,t){if(53==t){var r=(e.tm_wday+371-e.tm_yday)%7;4==r||3==r&&__isLeapYear(e.tm_year)||(t=1)}}else{t=52;var i=(e.tm_wday+7-e.tm_yday-1)%7;(4==i||5==i&&__isLeapYear(e.tm_year%400-1))&&t++}return h(t,2)},"%w":function(e){return e.tm_wday},"%W":function(e){var t=e.tm_yday+7-(e.tm_wday+6)%7;return h(Math.floor(t/7),2)},"%y":function(e){return(e.tm_year+1900).toString().substring(2)},"%Y":function(e){return e.tm_year+1900},"%z":function(e){var t=e.tm_gmtoff,r=t>=0;return t=(t=Math.abs(t)/60)/60*100+t%60,(r?"+":"-")+String("0000"+t).slice(-4)},"%Z":function(e){return e.tm_zone},"%%":function(){return"%"}};for(var l in s=s.replace(/%%/g,"\0\0"),m)s.includes(l)&&(s=s.replace(new RegExp(l,"g"),m[l](a)));var g=intArrayFromString(s=s.replace(/\0\0/g,"%"),!1);return g.length>t?0:(writeArrayToMemory(g,e),g.length-1)}function _strftime_l(e,t,r,i,n){return _strftime(e,t,r,i)}function _zlt_tfjs_execute_afn(e,t,r,i,n){return execute_afn(e,t,r,i,n)}function _zlt_tfjs_execute_base_cls(e,t,r,i){return execute_base(e,t,r,i)}async function _zlt_tfjs_init(){}function _zoom_wcl_get_cpu_num(){return hardcodecpunumber()}function _zoom_wcl_get_csc_thread_num(){return 1}function _zoom_wcl_support_multi_thread(){return IsSupportMultiThread()}function getCFunc(e){return Module["_"+e]}function ccall(e,t,r,i,n){var a={string:e=>{var t=0;if(null!=e&&0!==e){var r=1+(e.length<<2);stringToUTF8(e,t=stackAlloc(r),r)}return t},array:e=>{var t=stackAlloc(e.length);return writeArrayToMemory(e,t),t}},s=getCFunc(e),o=[],l=0;if(i)for(var c=0;c<i.length;c++){var d=a[r[c]];d?(0===l&&(l=stackSave()),o[c]=d(i[c])):o[c]=i[c]}var u=s.apply(null,o);return function(e){return 0!==l&&stackRestore(l),function(e){return"string"===t?UTF8ToString(e):"boolean"===t?Boolean(e):e}(e)}(u)}function cwrap(e,t,r,i){var n=(r=r||[]).every((e=>"number"===e||"boolean"===e));return"string"!==t&&n&&!i?getCFunc(e):function(){return ccall(e,t,r,arguments,i)}}var FSNode=function(e,t,r,i){e||(e=this),this.parent=e,this.mount=e.mount,this.mounted=null,this.id=FS.nextInode++,this.name=t,this.mode=r,this.node_ops={},this.stream_ops={},this.rdev=i},readMode=365,writeMode=146;Object.defineProperties(FSNode.prototype,{read:{get:function(){return(this.mode&readMode)===readMode},set:function(e){e?this.mode|=readMode:this.mode&=~readMode}},write:{get:function(){return(this.mode&writeMode)===writeMode},set:function(e){e?this.mode|=writeMode:this.mode&=~writeMode}},isFolder:{get:function(){return FS.isDir(this.mode)}},isDevice:{get:function(){return FS.isChrdev(this.mode)}}}),FS.FSNode=FSNode,FS.staticInit();var calledRun,asmLibraryArg={AdapterWhiteListCheck:_AdapterWhiteListCheck,CloseVideoEncoder:_CloseVideoEncoder,CreateGltPlatform:_CreateGltPlatform,DestroyGltPlatform:_DestroyGltPlatform,GetEncoderState:_GetEncoderState,GetLogLevel:_GetLogLevel,GetWebCodecsEncoderFallbackFlag:_GetWebCodecsEncoderFallbackFlag,GetWebCodecsEncoderL1T2Flag:_GetWebCodecsEncoderL1T2Flag,InitVideoDecoder:_InitVideoDecoder,InitVideoEncoder:_InitVideoEncoder,LimitWebCodecsDecoderTo360:_LimitWebCodecsDecoderTo360,LimitWebCodecsEncoderTo360:_LimitWebCodecsEncoderTo360,Set_Share_Mode:_Set_Share_Mode,UserAgentIsTesla:_UserAgentIsTesla,VideoDecoder:_VideoDecoder,VideoDecoderConfigure:_VideoDecoderConfigure,VideoEncoderConfigure:_VideoEncoderConfigure,WebCodecsDecoderFail:_WebCodecsDecoderFail,WebCodecsEncoderFail:_WebCodecsEncoderFail,WebCodecsVideoEncoder:_WebCodecsVideoEncoder,_ZN11cpt_generic6thread4joinEv:__ZN11cpt_generic6thread4joinEv,_ZN11cpt_generic6threadD1Ev:__ZN11cpt_generic6threadD1Ev,_ZN5Nydus16CWCLWallRenderer14CreateInstanceEPvRKNS_9NydusRectEPPNS_13IWallRendererE:__ZN5Nydus16CWCLWallRenderer14CreateInstanceEPvRKNS_9NydusRectEPPNS_13IWallRendererE,__assert_fail:___assert_fail,__cxa_allocate_exception:___cxa_allocate_exception,__cxa_begin_catch:___cxa_begin_catch,__cxa_end_catch:___cxa_end_catch,__cxa_find_matching_catch_2:___cxa_find_matching_catch_2,__cxa_find_matching_catch_3:___cxa_find_matching_catch_3,__cxa_find_matching_catch_4:___cxa_find_matching_catch_4,__cxa_free_exception:___cxa_free_exception,__cxa_rethrow:___cxa_rethrow,__cxa_throw:___cxa_throw,__cxa_uncaught_exceptions:___cxa_uncaught_exceptions,__resumeException:___resumeException,__stack_chk_fail:___stack_chk_fail,__syscall_fcntl64:___syscall_fcntl64,__syscall_fstat64:___syscall_fstat64,__syscall_getcwd:___syscall_getcwd,__syscall_getdents64:___syscall_getdents64,__syscall_ioctl:___syscall_ioctl,__syscall_lstat64:___syscall_lstat64,__syscall_mkdirat:___syscall_mkdirat,__syscall_newfstatat:___syscall_newfstatat,__syscall_openat:___syscall_openat,__syscall_pipe:___syscall_pipe,__syscall_poll:___syscall_poll,__syscall_stat64:___syscall_stat64,_emscripten_get_now_is_monotonic:__emscripten_get_now_is_monotonic,_emscripten_throw_longjmp:__emscripten_throw_longjmp,_gmtime_js:__gmtime_js,_localtime_js:__localtime_js,_munmap_js:__munmap_js,_tzset_js:__tzset_js,abort:_abort,emscripten_asm_const_double:_emscripten_asm_const_double,emscripten_asm_const_int:_emscripten_asm_const_int,emscripten_asm_const_int_sync_on_main_thread:_emscripten_asm_const_int_sync_on_main_thread,emscripten_date_now:_emscripten_date_now,emscripten_get_heap_max:_emscripten_get_heap_max,emscripten_get_now:_emscripten_get_now,emscripten_memcpy_big:_emscripten_memcpy_big,emscripten_resize_heap:_emscripten_resize_heap,environ_get:_environ_get,environ_sizes_get:_environ_sizes_get,exit:_exit,fd_close:_fd_close,fd_read:_fd_read,fd_seek:_fd_seek,fd_write:_fd_write,invoke_diii,invoke_fiii,invoke_i,invoke_ii,invoke_iii,invoke_iiii,invoke_iiiii,invoke_iiiiii,invoke_iiiiiii,invoke_iiiiiiii,invoke_iiiiiiiiiii,invoke_iiiiiiiiiiii,invoke_iiiiiiiiiiiii,invoke_jiiii,invoke_v,invoke_vi,invoke_vii,invoke_viii,invoke_viiii,invoke_viiiiiii,invoke_viiiiiiiiii,invoke_viiiiiiiiiiiiiii,invoke_viiiij,invoke_viijii,invoke_vij,llvm_eh_typeid_for:_llvm_eh_typeid_for,memory:wasmMemory,setCurrentThreadSsrc:_setCurrentThreadSsrc,strftime:_strftime,strftime_l:_strftime_l,zlt_tfjs_execute_afn:_zlt_tfjs_execute_afn,zlt_tfjs_execute_base_cls:_zlt_tfjs_execute_base_cls,zlt_tfjs_init:_zlt_tfjs_init,zoom_wcl_get_cpu_num:_zoom_wcl_get_cpu_num,zoom_wcl_get_csc_thread_num:_zoom_wcl_get_csc_thread_num,zoom_wcl_support_multi_thread:_zoom_wcl_support_multi_thread},asm=createWasm(),___wasm_call_ctors=Module.___wasm_call_ctors=function(){return(___wasm_call_ctors=Module.___wasm_call_ctors=Module.asm.__wasm_call_ctors).apply(null,arguments)},_malloc=Module._malloc=function(){return(_malloc=Module._malloc=Module.asm.malloc).apply(null,arguments)},__Video_Init=Module.__Video_Init=function(){return(__Video_Init=Module.__Video_Init=Module.asm._Video_Init).apply(null,arguments)},__Video_UnInit=Module.__Video_UnInit=function(){return(__Video_UnInit=Module.__Video_UnInit=Module.asm._Video_UnInit).apply(null,arguments)},__Video_Decode=Module.__Video_Decode=function(){return(__Video_Decode=Module.__Video_Decode=Module.asm._Video_Decode).apply(null,arguments)},__Change_Connect_Type=Module.__Change_Connect_Type=function(){return(__Change_Connect_Type=Module.__Change_Connect_Type=Module.asm._Change_Connect_Type).apply(null,arguments)},__Smooth_Send_For_Qos=Module.__Smooth_Send_For_Qos=function(){return(__Smooth_Send_For_Qos=Module.__Smooth_Send_For_Qos=Module.asm._Smooth_Send_For_Qos).apply(null,arguments)},__Video_Try_Analysis=Module.__Video_Try_Analysis=function(){return(__Video_Try_Analysis=Module.__Video_Try_Analysis=Module.asm._Video_Try_Analysis).apply(null,arguments)},_free=Module._free=function(){return(_free=Module._free=Module.asm.free).apply(null,arguments)},__Video_Encode=Module.__Video_Encode=function(){return(__Video_Encode=Module.__Video_Encode=Module.asm._Video_Encode).apply(null,arguments)},__rotate_video=Module.__rotate_video=function(){return(__rotate_video=Module.__rotate_video=Module.asm._rotate_video).apply(null,arguments)},__Video_Encode_YUV=Module.__Video_Encode_YUV=function(){return(__Video_Encode_YUV=Module.__Video_Encode_YUV=Module.asm._Video_Encode_YUV).apply(null,arguments)},__Video_VirtualBackground_Special_Action=Module.__Video_VirtualBackground_Special_Action=function(){return(__Video_VirtualBackground_Special_Action=Module.__Video_VirtualBackground_Special_Action=Module.asm._Video_VirtualBackground_Special_Action).apply(null,arguments)},__Qos_Sender_Send_Data_In_Main_Thread=Module.__Qos_Sender_Send_Data_In_Main_Thread=function(){return(__Qos_Sender_Send_Data_In_Main_Thread=Module.__Qos_Sender_Send_Data_In_Main_Thread=Module.asm._Qos_Sender_Send_Data_In_Main_Thread).apply(null,arguments)},__Video_Websocket_Speed=Module.__Video_Websocket_Speed=function(){return(__Video_Websocket_Speed=Module.__Video_Websocket_Speed=Module.asm._Video_Websocket_Speed).apply(null,arguments)},__Video_Start_Encode=Module.__Video_Start_Encode=function(){return(__Video_Start_Encode=Module.__Video_Start_Encode=Module.asm._Video_Start_Encode).apply(null,arguments)},__Video_Stop_Encode=Module.__Video_Stop_Encode=function(){return(__Video_Stop_Encode=Module.__Video_Stop_Encode=Module.asm._Video_Stop_Encode).apply(null,arguments)},__Request_Video_Qos_Data=Module.__Request_Video_Qos_Data=function(){return(__Request_Video_Qos_Data=Module.__Request_Video_Qos_Data=Module.asm._Request_Video_Qos_Data).apply(null,arguments)},__Video_Update_Format=Module.__Video_Update_Format=function(){return(__Video_Update_Format=Module.__Video_Update_Format=Module.asm._Video_Update_Format).apply(null,arguments)},__Video_Set_Data_Encryption=Module.__Video_Set_Data_Encryption=function(){return(__Video_Set_Data_Encryption=Module.__Video_Set_Data_Encryption=Module.asm._Video_Set_Data_Encryption).apply(null,arguments)},__Add_Video_Cooker_info=Module.__Add_Video_Cooker_info=function(){return(__Add_Video_Cooker_info=Module.__Add_Video_Cooker_info=Module.asm._Add_Video_Cooker_info).apply(null,arguments)},__Remove_Video_Cooker_Info=Module.__Remove_Video_Cooker_Info=function(){return(__Remove_Video_Cooker_Info=Module.__Remove_Video_Cooker_Info=Module.asm._Remove_Video_Cooker_Info).apply(null,arguments)},__Get_Video_Meat_Weight=Module.__Get_Video_Meat_Weight=function(){return(__Get_Video_Meat_Weight=Module.__Get_Video_Meat_Weight=Module.asm._Get_Video_Meat_Weight).apply(null,arguments)},__Set_Max_Receiving_Channel_Num=Module.__Set_Max_Receiving_Channel_Num=function(){return(__Set_Max_Receiving_Channel_Num=Module.__Set_Max_Receiving_Channel_Num=Module.asm._Set_Max_Receiving_Channel_Num).apply(null,arguments)},__update_sync_time=Module.__update_sync_time=function(){return(__update_sync_time=Module.__update_sync_time=Module.asm._update_sync_time).apply(null,arguments)},__release_video_receiving_channel=Module.__release_video_receiving_channel=function(){return(__release_video_receiving_channel=Module.__release_video_receiving_channel=Module.asm._release_video_receiving_channel).apply(null,arguments)},__change_hw_status=Module.__change_hw_status=function(){return(__change_hw_status=Module.__change_hw_status=Module.asm._change_hw_status).apply(null,arguments)},__update_video_uplink_bandwidth_limitation_by_server=Module.__update_video_uplink_bandwidth_limitation_by_server=function(){return(__update_video_uplink_bandwidth_limitation_by_server=Module.__update_video_uplink_bandwidth_limitation_by_server=Module.asm._update_video_uplink_bandwidth_limitation_by_server).apply(null,arguments)},__create_vb_thread=Module.__create_vb_thread=function(){return(__create_vb_thread=Module.__create_vb_thread=Module.asm._create_vb_thread).apply(null,arguments)},__create_vb_no_sab_thread=Module.__create_vb_no_sab_thread=function(){return(__create_vb_no_sab_thread=Module.__create_vb_no_sab_thread=Module.asm._create_vb_no_sab_thread).apply(null,arguments)},__signal_vb_thread_blur=Module.__signal_vb_thread_blur=function(){return(__signal_vb_thread_blur=Module.__signal_vb_thread_blur=Module.asm._signal_vb_thread_blur).apply(null,arguments)},__signal_vb_thread_bg=Module.__signal_vb_thread_bg=function(){return(__signal_vb_thread_bg=Module.__signal_vb_thread_bg=Module.asm._signal_vb_thread_bg).apply(null,arguments)},__signal_vb_thread_video_yuv=Module.__signal_vb_thread_video_yuv=function(){return(__signal_vb_thread_video_yuv=Module.__signal_vb_thread_video_yuv=Module.asm._signal_vb_thread_video_yuv).apply(null,arguments)},__signal_vb_thread_video_rgba=Module.__signal_vb_thread_video_rgba=function(){return(__signal_vb_thread_video_rgba=Module.__signal_vb_thread_video_rgba=Module.asm._signal_vb_thread_video_rgba).apply(null,arguments)},__signal_vb_thread_close=Module.__signal_vb_thread_close=function(){return(__signal_vb_thread_close=Module.__signal_vb_thread_close=Module.asm._signal_vb_thread_close).apply(null,arguments)},__update_video_cropping_mode=Module.__update_video_cropping_mode=function(){return(__update_video_cropping_mode=Module.__update_video_cropping_mode=Module.asm._update_video_cropping_mode).apply(null,arguments)},__collect_video_monitor_info=Module.__collect_video_monitor_info=function(){return(__collect_video_monitor_info=Module.__collect_video_monitor_info=Module.asm._collect_video_monitor_info).apply(null,arguments)},__request_nack_t_periodically_for_qos=Module.__request_nack_t_periodically_for_qos=function(){return(__request_nack_t_periodically_for_qos=Module.__request_nack_t_periodically_for_qos=Module.asm._request_nack_t_periodically_for_qos).apply(null,arguments)},__set_video_network_info=Module.__set_video_network_info=function(){return(__set_video_network_info=Module.__set_video_network_info=Module.asm._set_video_network_info).apply(null,arguments)},__set_video_fec_info=Module.__set_video_fec_info=function(){return(__set_video_fec_info=Module.__set_video_fec_info=Module.asm._set_video_fec_info).apply(null,arguments)},__set_video_retran_info=Module.__set_video_retran_info=function(){return(__set_video_retran_info=Module.__set_video_retran_info=Module.asm._set_video_retran_info).apply(null,arguments)},__set_video_bandwidth_alloc=Module.__set_video_bandwidth_alloc=function(){return(__set_video_bandwidth_alloc=Module.__set_video_bandwidth_alloc=Module.asm._set_video_bandwidth_alloc).apply(null,arguments)},__set_video_statistics_flag=Module.__set_video_statistics_flag=function(){return(__set_video_statistics_flag=Module.__set_video_statistics_flag=Module.asm._set_video_statistics_flag).apply(null,arguments)},__Sharing_Encode_Init=Module.__Sharing_Encode_Init=function(){return(__Sharing_Encode_Init=Module.__Sharing_Encode_Init=Module.asm._Sharing_Encode_Init).apply(null,arguments)},__Sharing_Encode_Try_Analysis=Module.__Sharing_Encode_Try_Analysis=function(){return(__Sharing_Encode_Try_Analysis=Module.__Sharing_Encode_Try_Analysis=Module.asm._Sharing_Encode_Try_Analysis).apply(null,arguments)},__Sharing_Encode_Uninit=Module.__Sharing_Encode_Uninit=function(){return(__Sharing_Encode_Uninit=Module.__Sharing_Encode_Uninit=Module.asm._Sharing_Encode_Uninit).apply(null,arguments)},__Sharing_Encode=Module.__Sharing_Encode=function(){return(__Sharing_Encode=Module.__Sharing_Encode=Module.asm._Sharing_Encode).apply(null,arguments)},__Sharing_Encode_Mouse_Data=Module.__Sharing_Encode_Mouse_Data=function(){return(__Sharing_Encode_Mouse_Data=Module.__Sharing_Encode_Mouse_Data=Module.asm._Sharing_Encode_Mouse_Data).apply(null,arguments)},__Request_Sharing_Qos_Data=Module.__Request_Sharing_Qos_Data=function(){return(__Request_Sharing_Qos_Data=Module.__Request_Sharing_Qos_Data=Module.asm._Request_Sharing_Qos_Data).apply(null,arguments)},__Sharing_Set_Data_Encryption=Module.__Sharing_Set_Data_Encryption=function(){return(__Sharing_Set_Data_Encryption=Module.__Sharing_Set_Data_Encryption=Module.asm._Sharing_Set_Data_Encryption).apply(null,arguments)},__Sharing_Pause_Encode=Module.__Sharing_Pause_Encode=function(){return(__Sharing_Pause_Encode=Module.__Sharing_Pause_Encode=Module.asm._Sharing_Pause_Encode).apply(null,arguments)},__Sharing_Resume_Encode=Module.__Sharing_Resume_Encode=function(){return(__Sharing_Resume_Encode=Module.__Sharing_Resume_Encode=Module.asm._Sharing_Resume_Encode).apply(null,arguments)},__Sharing_Stop_Encode=Module.__Sharing_Stop_Encode=function(){return(__Sharing_Stop_Encode=Module.__Sharing_Stop_Encode=Module.asm._Sharing_Stop_Encode).apply(null,arguments)},__Sharing_Websocket_Speed=Module.__Sharing_Websocket_Speed=function(){return(__Sharing_Websocket_Speed=Module.__Sharing_Websocket_Speed=Module.asm._Sharing_Websocket_Speed).apply(null,arguments)},__Add_Sharing_Cooker_info=Module.__Add_Sharing_Cooker_info=function(){return(__Add_Sharing_Cooker_info=Module.__Add_Sharing_Cooker_info=Module.asm._Add_Sharing_Cooker_info).apply(null,arguments)},__Remove_Sharing_Cooker_Info=Module.__Remove_Sharing_Cooker_Info=function(){return(__Remove_Sharing_Cooker_Info=Module.__Remove_Sharing_Cooker_Info=Module.asm._Remove_Sharing_Cooker_Info).apply(null,arguments)},__Get_Sharing_Meat_Weight=Module.__Get_Sharing_Meat_Weight=function(){return(__Get_Sharing_Meat_Weight=Module.__Get_Sharing_Meat_Weight=Module.asm._Get_Sharing_Meat_Weight).apply(null,arguments)},__Set_Sharing_Encryption_Key_Directly=Module.__Set_Sharing_Encryption_Key_Directly=function(){return(__Set_Sharing_Encryption_Key_Directly=Module.__Set_Sharing_Encryption_Key_Directly=Module.asm._Set_Sharing_Encryption_Key_Directly).apply(null,arguments)},__Add_Roster_Info_Directly=Module.__Add_Roster_Info_Directly=function(){return(__Add_Roster_Info_Directly=Module.__Add_Roster_Info_Directly=Module.asm._Add_Roster_Info_Directly).apply(null,arguments)},__Add_Rev_Channel=Module.__Add_Rev_Channel=function(){return(__Add_Rev_Channel=Module.__Add_Rev_Channel=Module.asm._Add_Rev_Channel).apply(null,arguments)},__Remove_Rev_Channel=Module.__Remove_Rev_Channel=function(){return(__Remove_Rev_Channel=Module.__Remove_Rev_Channel=Module.asm._Remove_Rev_Channel).apply(null,arguments)},__update_sharing_uplink_bandwidth_limitation_by_server=Module.__update_sharing_uplink_bandwidth_limitation_by_server=function(){return(__update_sharing_uplink_bandwidth_limitation_by_server=Module.__update_sharing_uplink_bandwidth_limitation_by_server=Module.asm._update_sharing_uplink_bandwidth_limitation_by_server).apply(null,arguments)},__collect_sharing_monitor_info=Module.__collect_sharing_monitor_info=function(){return(__collect_sharing_monitor_info=Module.__collect_sharing_monitor_info=Module.asm._collect_sharing_monitor_info).apply(null,arguments)},__set_sharing_statistics_flag=Module.__set_sharing_statistics_flag=function(){return(__set_sharing_statistics_flag=Module.__set_sharing_statistics_flag=Module.asm._set_sharing_statistics_flag).apply(null,arguments)},__set_annotation_action=Module.__set_annotation_action=function(){return(__set_annotation_action=Module.__set_annotation_action=Module.asm._set_annotation_action).apply(null,arguments)},__request_nack_t_periodically_for_sharing_qos=Module.__request_nack_t_periodically_for_sharing_qos=function(){return(__request_nack_t_periodically_for_sharing_qos=Module.__request_nack_t_periodically_for_sharing_qos=Module.asm._request_nack_t_periodically_for_sharing_qos).apply(null,arguments)},__Change_Connect_Type_For_Sharing=Module.__Change_Connect_Type_For_Sharing=function(){return(__Change_Connect_Type_For_Sharing=Module.__Change_Connect_Type_For_Sharing=Module.asm._Change_Connect_Type_For_Sharing).apply(null,arguments)},__Jpeg_Init=Module.__Jpeg_Init=function(){return(__Jpeg_Init=Module.__Jpeg_Init=Module.asm._Jpeg_Init).apply(null,arguments)},__Jpeg_Uninit=Module.__Jpeg_Uninit=function(){return(__Jpeg_Uninit=Module.__Jpeg_Uninit=Module.asm._Jpeg_Uninit).apply(null,arguments)},__Jpeg_HeardInfo=Module.__Jpeg_HeardInfo=function(){return(__Jpeg_HeardInfo=Module.__Jpeg_HeardInfo=Module.asm._Jpeg_HeardInfo).apply(null,arguments)},__Jpeg_Decode=Module.__Jpeg_Decode=function(){return(__Jpeg_Decode=Module.__Jpeg_Decode=Module.asm._Jpeg_Decode).apply(null,arguments)},__set_sharing_network_info=Module.__set_sharing_network_info=function(){return(__set_sharing_network_info=Module.__set_sharing_network_info=Module.asm._set_sharing_network_info).apply(null,arguments)},__set_sharing_fec_info=Module.__set_sharing_fec_info=function(){return(__set_sharing_fec_info=Module.__set_sharing_fec_info=Module.asm._set_sharing_fec_info).apply(null,arguments)},__set_sharing_retran_info=Module.__set_sharing_retran_info=function(){return(__set_sharing_retran_info=Module.__set_sharing_retran_info=Module.asm._set_sharing_retran_info).apply(null,arguments)},__set_sharing_bandwidth_alloc=Module.__set_sharing_bandwidth_alloc=function(){return(__set_sharing_bandwidth_alloc=Module.__set_sharing_bandwidth_alloc=Module.asm._set_sharing_bandwidth_alloc).apply(null,arguments)},__set_mmr_signature_info=Module.__set_mmr_signature_info=function(){return(__set_mmr_signature_info=Module.__set_mmr_signature_info=Module.asm._set_mmr_signature_info).apply(null,arguments)},__set_singature_info=Module.__set_singature_info=function(){return(__set_singature_info=Module.__set_singature_info=Module.asm._set_singature_info).apply(null,arguments)},__set_meeting_uuid_for_signature=Module.__set_meeting_uuid_for_signature=function(){return(__set_meeting_uuid_for_signature=Module.__set_meeting_uuid_for_signature=Module.asm._set_meeting_uuid_for_signature).apply(null,arguments)},__update_signagure_verify_action=Module.__update_signagure_verify_action=function(){return(__update_signagure_verify_action=Module.__update_signagure_verify_action=Module.asm._update_signagure_verify_action).apply(null,arguments)},_GIT_COMMIT_VERSION=Module._GIT_COMMIT_VERSION=function(){return(_GIT_COMMIT_VERSION=Module._GIT_COMMIT_VERSION=Module.asm.GIT_COMMIT_VERSION).apply(null,arguments)},getTempRet0=Module.getTempRet0=function(){return(getTempRet0=Module.getTempRet0=Module.asm.getTempRet0).apply(null,arguments)},___errno_location=Module.___errno_location=function(){return(___errno_location=Module.___errno_location=Module.asm.__errno_location).apply(null,arguments)},_htonl=Module._htonl=function(){return(_htonl=Module._htonl=Module.asm.htonl).apply(null,arguments)},_ntohs=Module._ntohs=function(){return(_ntohs=Module._ntohs=Module.asm.ntohs).apply(null,arguments)},_htons=Module._htons=function(){return(_htons=Module._htons=Module.asm.htons).apply(null,arguments)},_OnVideoFrameOutputCallback=Module._OnVideoFrameOutputCallback=function(){return(_OnVideoFrameOutputCallback=Module._OnVideoFrameOutputCallback=Module.asm.OnVideoFrameOutputCallback).apply(null,arguments)},_OnEncodedVideoChunkOutputCallback=Module._OnEncodedVideoChunkOutputCallback=function(){return(_OnEncodedVideoChunkOutputCallback=Module._OnEncodedVideoChunkOutputCallback=Module.asm.OnEncodedVideoChunkOutputCallback).apply(null,arguments)},_saveSetjmp=Module._saveSetjmp=function(){return(_saveSetjmp=Module._saveSetjmp=Module.asm.saveSetjmp).apply(null,arguments)},setTempRet0=Module.setTempRet0=function(){return(setTempRet0=Module.setTempRet0=Module.asm.setTempRet0).apply(null,arguments)},_emscripten_builtin_memalign=Module._emscripten_builtin_memalign=function(){return(_emscripten_builtin_memalign=Module._emscripten_builtin_memalign=Module.asm.emscripten_builtin_memalign).apply(null,arguments)},_setThrew=Module._setThrew=function(){return(_setThrew=Module._setThrew=Module.asm.setThrew).apply(null,arguments)},stackSave=Module.stackSave=function(){return(stackSave=Module.stackSave=Module.asm.stackSave).apply(null,arguments)},stackRestore=Module.stackRestore=function(){return(stackRestore=Module.stackRestore=Module.asm.stackRestore).apply(null,arguments)},stackAlloc=Module.stackAlloc=function(){return(stackAlloc=Module.stackAlloc=Module.asm.stackAlloc).apply(null,arguments)},___cxa_demangle=Module.___cxa_demangle=function(){return(___cxa_demangle=Module.___cxa_demangle=Module.asm.__cxa_demangle).apply(null,arguments)},___cxa_can_catch=Module.___cxa_can_catch=function(){return(___cxa_can_catch=Module.___cxa_can_catch=Module.asm.__cxa_can_catch).apply(null,arguments)},___cxa_is_pointer_type=Module.___cxa_is_pointer_type=function(){return(___cxa_is_pointer_type=Module.___cxa_is_pointer_type=Module.asm.__cxa_is_pointer_type).apply(null,arguments)},dynCall_iijiiiiiiiiiiii=Module.dynCall_iijiiiiiiiiiiii=function(){return(dynCall_iijiiiiiiiiiiii=Module.dynCall_iijiiiiiiiiiiii=Module.asm.dynCall_iijiiiiiiiiiiii).apply(null,arguments)},dynCall_iijiiiiiiiiii=Module.dynCall_iijiiiiiiiiii=function(){return(dynCall_iijiiiiiiiiii=Module.dynCall_iijiiiiiiiiii=Module.asm.dynCall_iijiiiiiiiiii).apply(null,arguments)},dynCall_iij=Module.dynCall_iij=function(){return(dynCall_iij=Module.dynCall_iij=Module.asm.dynCall_iij).apply(null,arguments)},dynCall_iijii=Module.dynCall_iijii=function(){return(dynCall_iijii=Module.dynCall_iijii=Module.asm.dynCall_iijii).apply(null,arguments)},dynCall_iiijiji=Module.dynCall_iiijiji=function(){return(dynCall_iiijiji=Module.dynCall_iiijiji=Module.asm.dynCall_iiijiji).apply(null,arguments)},dynCall_iiijiii=Module.dynCall_iiijiii=function(){return(dynCall_iiijiii=Module.dynCall_iiijiii=Module.asm.dynCall_iiijiii).apply(null,arguments)},dynCall_iiiji=Module.dynCall_iiiji=function(){return(dynCall_iiiji=Module.dynCall_iiiji=Module.asm.dynCall_iiiji).apply(null,arguments)},dynCall_iiij=Module.dynCall_iiij=function(){return(dynCall_iiij=Module.dynCall_iiij=Module.asm.dynCall_iiij).apply(null,arguments)},dynCall_vij=Module.dynCall_vij=function(){return(dynCall_vij=Module.dynCall_vij=Module.asm.dynCall_vij).apply(null,arguments)},dynCall_viiiij=Module.dynCall_viiiij=function(){return(dynCall_viiiij=Module.dynCall_viiiij=Module.asm.dynCall_viiiij).apply(null,arguments)},dynCall_viiijii=Module.dynCall_viiijii=function(){return(dynCall_viiijii=Module.dynCall_viiijii=Module.asm.dynCall_viiijii).apply(null,arguments)},dynCall_iiijii=Module.dynCall_iiijii=function(){return(dynCall_iiijii=Module.dynCall_iiijii=Module.asm.dynCall_iiijii).apply(null,arguments)},dynCall_iiiiiiiiij=Module.dynCall_iiiiiiiiij=function(){return(dynCall_iiiiiiiiij=Module.dynCall_iiiiiiiiij=Module.asm.dynCall_iiiiiiiiij).apply(null,arguments)},dynCall_iiiiiijiji=Module.dynCall_iiiiiijiji=function(){return(dynCall_iiiiiijiji=Module.dynCall_iiiiiijiji=Module.asm.dynCall_iiiiiijiji).apply(null,arguments)},dynCall_iiiiiiiiiiiij=Module.dynCall_iiiiiiiiiiiij=function(){return(dynCall_iiiiiiiiiiiij=Module.dynCall_iiiiiiiiiiiij=Module.asm.dynCall_iiiiiiiiiiiij).apply(null,arguments)},dynCall_viiiiiij=Module.dynCall_viiiiiij=function(){return(dynCall_viiiiiij=Module.dynCall_viiiiiij=Module.asm.dynCall_viiiiiij).apply(null,arguments)},dynCall_viji=Module.dynCall_viji=function(){return(dynCall_viji=Module.dynCall_viji=Module.asm.dynCall_viji).apply(null,arguments)},dynCall_iiiiiiji=Module.dynCall_iiiiiiji=function(){return(dynCall_iiiiiiji=Module.dynCall_iiiiiiji=Module.asm.dynCall_iiiiiiji).apply(null,arguments)},dynCall_iiiiijiji=Module.dynCall_iiiiijiji=function(){return(dynCall_iiiiijiji=Module.dynCall_iiiiijiji=Module.asm.dynCall_iiiiijiji).apply(null,arguments)},dynCall_iiiiiiiiiiij=Module.dynCall_iiiiiiiiiiij=function(){return(dynCall_iiiiiiiiiiij=Module.dynCall_iiiiiiiiiiij=Module.asm.dynCall_iiiiiiiiiiij).apply(null,arguments)},dynCall_iiiiiiiij=Module.dynCall_iiiiiiiij=function(){return(dynCall_iiiiiiiij=Module.dynCall_iiiiiiiij=Module.asm.dynCall_iiiiiiiij).apply(null,arguments)},dynCall_iiji=Module.dynCall_iiji=function(){return(dynCall_iiji=Module.dynCall_iiji=Module.asm.dynCall_iiji).apply(null,arguments)},dynCall_ji=Module.dynCall_ji=function(){return(dynCall_ji=Module.dynCall_ji=Module.asm.dynCall_ji).apply(null,arguments)},dynCall_jiiiiii=Module.dynCall_jiiiiii=function(){return(dynCall_jiiiiii=Module.dynCall_jiiiiii=Module.asm.dynCall_jiiiiii).apply(null,arguments)},dynCall_jiji=Module.dynCall_jiji=function(){return(dynCall_jiji=Module.dynCall_jiji=Module.asm.dynCall_jiji).apply(null,arguments)},dynCall_viijii=Module.dynCall_viijii=function(){return(dynCall_viijii=Module.dynCall_viijii=Module.asm.dynCall_viijii).apply(null,arguments)},dynCall_jiiii=Module.dynCall_jiiii=function(){return(dynCall_jiiii=Module.dynCall_jiiii=Module.asm.dynCall_jiiii).apply(null,arguments)},dynCall_iiiiij=Module.dynCall_iiiiij=function(){return(dynCall_iiiiij=Module.dynCall_iiiiij=Module.asm.dynCall_iiiiij).apply(null,arguments)},dynCall_iiiiijj=Module.dynCall_iiiiijj=function(){return(dynCall_iiiiijj=Module.dynCall_iiiiijj=Module.asm.dynCall_iiiiijj).apply(null,arguments)},dynCall_iiiiiijj=Module.dynCall_iiiiiijj=function(){return(dynCall_iiiiiijj=Module.dynCall_iiiiiijj=Module.asm.dynCall_iiiiiijj).apply(null,arguments)};function invoke_vii(e,t,r){var i=stackSave();try{getWasmTableEntry(e)(t,r)}catch(e){if(stackRestore(i),e!==e+0)throw e;_setThrew(1,0)}}function invoke_iiiii(e,t,r,i,n){var a=stackSave();try{return getWasmTableEntry(e)(t,r,i,n)}catch(e){if(stackRestore(a),e!==e+0)throw e;_setThrew(1,0)}}function invoke_iiii(e,t,r,i){var n=stackSave();try{return getWasmTableEntry(e)(t,r,i)}catch(e){if(stackRestore(n),e!==e+0)throw e;_setThrew(1,0)}}function invoke_iii(e,t,r){var i=stackSave();try{return getWasmTableEntry(e)(t,r)}catch(e){if(stackRestore(i),e!==e+0)throw e;_setThrew(1,0)}}function invoke_ii(e,t){var r=stackSave();try{return getWasmTableEntry(e)(t)}catch(e){if(stackRestore(r),e!==e+0)throw e;_setThrew(1,0)}}function invoke_viiii(e,t,r,i,n){var a=stackSave();try{getWasmTableEntry(e)(t,r,i,n)}catch(e){if(stackRestore(a),e!==e+0)throw e;_setThrew(1,0)}}function invoke_vi(e,t){var r=stackSave();try{getWasmTableEntry(e)(t)}catch(e){if(stackRestore(r),e!==e+0)throw e;_setThrew(1,0)}}function invoke_v(e){var t=stackSave();try{getWasmTableEntry(e)()}catch(e){if(stackRestore(t),e!==e+0)throw e;_setThrew(1,0)}}function invoke_viii(e,t,r,i){var n=stackSave();try{getWasmTableEntry(e)(t,r,i)}catch(e){if(stackRestore(n),e!==e+0)throw e;_setThrew(1,0)}}function invoke_iiiiiii(e,t,r,i,n,a,s){var o=stackSave();try{return getWasmTableEntry(e)(t,r,i,n,a,s)}catch(e){if(stackRestore(o),e!==e+0)throw e;_setThrew(1,0)}}function invoke_iiiiii(e,t,r,i,n,a){var s=stackSave();try{return getWasmTableEntry(e)(t,r,i,n,a)}catch(e){if(stackRestore(s),e!==e+0)throw e;_setThrew(1,0)}}function invoke_i(e){var t=stackSave();try{return getWasmTableEntry(e)()}catch(e){if(stackRestore(t),e!==e+0)throw e;_setThrew(1,0)}}function invoke_iiiiiiii(e,t,r,i,n,a,s,o){var l=stackSave();try{return getWasmTableEntry(e)(t,r,i,n,a,s,o)}catch(e){if(stackRestore(l),e!==e+0)throw e;_setThrew(1,0)}}function invoke_viiiiiii(e,t,r,i,n,a,s,o){var l=stackSave();try{getWasmTableEntry(e)(t,r,i,n,a,s,o)}catch(e){if(stackRestore(l),e!==e+0)throw e;_setThrew(1,0)}}function invoke_iiiiiiiiiii(e,t,r,i,n,a,s,o,l,c,d){var u=stackSave();try{return getWasmTableEntry(e)(t,r,i,n,a,s,o,l,c,d)}catch(e){if(stackRestore(u),e!==e+0)throw e;_setThrew(1,0)}}function invoke_iiiiiiiiiiiii(e,t,r,i,n,a,s,o,l,c,d,u,h){var _=stackSave();try{return getWasmTableEntry(e)(t,r,i,n,a,s,o,l,c,d,u,h)}catch(e){if(stackRestore(_),e!==e+0)throw e;_setThrew(1,0)}}function invoke_fiii(e,t,r,i){var n=stackSave();try{return getWasmTableEntry(e)(t,r,i)}catch(e){if(stackRestore(n),e!==e+0)throw e;_setThrew(1,0)}}function invoke_diii(e,t,r,i){var n=stackSave();try{return getWasmTableEntry(e)(t,r,i)}catch(e){if(stackRestore(n),e!==e+0)throw e;_setThrew(1,0)}}function invoke_iiiiiiiiiiii(e,t,r,i,n,a,s,o,l,c,d,u){var h=stackSave();try{return getWasmTableEntry(e)(t,r,i,n,a,s,o,l,c,d,u)}catch(e){if(stackRestore(h),e!==e+0)throw e;_setThrew(1,0)}}function invoke_viiiiiiiiii(e,t,r,i,n,a,s,o,l,c,d){var u=stackSave();try{getWasmTableEntry(e)(t,r,i,n,a,s,o,l,c,d)}catch(e){if(stackRestore(u),e!==e+0)throw e;_setThrew(1,0)}}function invoke_viiiiiiiiiiiiiii(e,t,r,i,n,a,s,o,l,c,d,u,h,_,f,p){var m=stackSave();try{getWasmTableEntry(e)(t,r,i,n,a,s,o,l,c,d,u,h,_,f,p)}catch(e){if(stackRestore(m),e!==e+0)throw e;_setThrew(1,0)}}function invoke_vij(e,t,r,i){var n=stackSave();try{dynCall_vij(e,t,r,i)}catch(e){if(stackRestore(n),e!==e+0)throw e;_setThrew(1,0)}}function invoke_viiiij(e,t,r,i,n,a,s){var o=stackSave();try{dynCall_viiiij(e,t,r,i,n,a,s)}catch(e){if(stackRestore(o),e!==e+0)throw e;_setThrew(1,0)}}function invoke_viijii(e,t,r,i,n,a,s){var o=stackSave();try{dynCall_viijii(e,t,r,i,n,a,s)}catch(e){if(stackRestore(o),e!==e+0)throw e;_setThrew(1,0)}}function invoke_jiiii(e,t,r,i,n){var a=stackSave();try{return dynCall_jiiii(e,t,r,i,n)}catch(e){if(stackRestore(a),e!==e+0)throw e;_setThrew(1,0)}}function run(e){function t(){calledRun||(calledRun=!0,Module.calledRun=!0,ABORT||(initRuntime(),Module.onRuntimeInitialized&&Module.onRuntimeInitialized(),postRun()))}e=e||arguments_,runDependencies>0||(preRun(),runDependencies>0||(Module.setStatus?(Module.setStatus("Running..."),setTimeout((function(){setTimeout((function(){Module.setStatus("")}),1),t()}),1)):t()))}if(Module.cwrap=cwrap,dependenciesFulfilled=function e(){calledRun||run(),calledRun||(dependenciesFulfilled=e)},Module.preInit)for("function"==typeof Module.preInit&&(Module.preInit=[Module.preInit]);Module.preInit.length>0;)Module.preInit.pop()();run();
|
|
2
|
+
//# sourceMappingURL=https://d1cdksi819e9z7.cloudfront.net/sourcemap/video_simd.min.js-17821b49e028126b7f9e.map
|