trtc-sdk-v5 5.9.0-beta.3 → 5.9.0-wasm.1
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/av_processing.wasm +0 -0
- package/index.d.ts +1 -15
- package/package.json +1 -1
- package/plugins/cdn-streaming/cdn-streaming.esm.js +1 -1
- package/plugins/cdn-streaming/cdn-streaming.iife.js +1 -1
- package/plugins/cdn-streaming/package.json +1 -1
- package/plugins/cross-room/cross-room.esm.js +1 -1
- package/plugins/cross-room/cross-room.iife.js +1 -1
- package/plugins/cross-room/package.json +1 -1
- package/plugins/custom-encryption/custom-encryption.esm.d.ts +34 -0
- package/plugins/custom-encryption/custom-encryption.esm.js +36 -0
- package/plugins/custom-encryption/custom-encryption.iife.js +36 -0
- package/plugins/custom-encryption/package.json +7 -0
- package/plugins/device-detector/device-detector.esm.js +5 -5
- package/plugins/device-detector/device-detector.iife.js +5 -5
- package/plugins/device-detector/package.json +1 -1
- package/plugins/video-decoder/package.json +1 -1
- package/plugins/video-decoder/video-decoder.esm.js +38 -38
- package/plugins/video-decoder/video-decoder.iife.js +38 -38
- package/plugins/video-effect/basic-beauty/basic-beauty.esm.js +2 -2
- package/plugins/video-effect/basic-beauty/basic-beauty.iife.js +2 -2
- package/plugins/video-effect/basic-beauty/package.json +1 -1
- package/plugins/video-effect/beauty/beauty.esm.js +35 -35
- package/plugins/video-effect/beauty/beauty.iife.js +35 -35
- package/plugins/video-effect/beauty/package.json +1 -1
- package/plugins/video-effect/virtual-background/package.json +1 -1
- package/plugins/video-effect/virtual-background/virtual-background.esm.js +10 -10
- package/plugins/video-effect/virtual-background/virtual-background.iife.js +12 -12
- package/plugins/video-effect/watermark/package.json +1 -1
- package/plugins/video-effect/watermark/watermark.esm.js +1 -1
- package/plugins/video-effect/watermark/watermark.iife.js +1 -1
- package/trtc.esm.js +64 -41
- package/trtc.js +1 -1
- package/worker.js +17 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
"use strict";var DeviceDetector=(()=>{var xs=Object.create;var se=Object.defineProperty,Ts=Object.defineProperties,ys=Object.getOwnPropertyDescriptor,Us=Object.getOwnPropertyDescriptors,Rs=Object.getOwnPropertyNames,Mi=Object.getOwnPropertySymbols,Ds=Object.getPrototypeOf,wi=Object.prototype.hasOwnProperty,bs=Object.prototype.propertyIsEnumerable;var lt=(t,e,i)=>e in t?se(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i,j=(t,e)=>{for(var i in e||(e={}))wi.call(e,i)&<(t,i,e[i]);if(Mi)for(var i of Mi(e))bs.call(e,i)&<(t,i,e[i]);return t},H=(t,e)=>Ts(t,Us(e));var a=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),ks=(t,e)=>{for(var i in e)se(t,i,{get:e[i],enumerable:!0})},xi=(t,e,i,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let V of Rs(e))!wi.call(t,V)&&V!==i&&se(t,V,{get:()=>e[V],enumerable:!(r=ys(e,V))||r.enumerable});return t};var Ns=(t,e,i)=>(i=t!=null?xs(Ds(t)):{},xi(e||!t||!t.__esModule?se(i,"default",{value:t,enumerable:!0}):i,t)),Bs=t=>xi(se({},"__esModule",{value:!0}),t);var h=(t,e,i)=>lt(t,typeof e!="symbol"?e+"":e,i);var C=a((pt,Ti)=>{"use strict";var Ae=function(t){return t&&t.Math===Math&&t};Ti.exports=Ae(typeof globalThis=="object"&&globalThis)||Ae(typeof window=="object"&&window)||Ae(typeof self=="object"&&self)||Ae(typeof global=="object"&&global)||Ae(typeof pt=="object"&&pt)||function(){return this}()||Function("return this")()});var D=a((cq,yi)=>{"use strict";yi.exports=function(t){try{return!!t()}catch(e){return!0}}});var B=a((lq,Ui)=>{"use strict";var Os=D();Ui.exports=!Os(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!==7})});var dt=a((pq,Ri)=>{"use strict";var Qs=D();Ri.exports=!Qs(function(){var t=function(){}.bind();return typeof t!="function"||t.hasOwnProperty("prototype")})});var Te=a((dq,Di)=>{"use strict";var Fs=dt(),xe=Function.prototype.call;Di.exports=Fs?xe.bind(xe):function(){return xe.apply(xe,arguments)}});var Bi=a(Ni=>{"use strict";var bi={}.propertyIsEnumerable,ki=Object.getOwnPropertyDescriptor,Ls=ki&&!bi.call({1:2},1);Ni.f=Ls?function(e){var i=ki(this,e);return!!i&&i.enumerable}:bi});var ht=a((uq,Oi)=>{"use strict";Oi.exports=function(t,e){return{enumerable:!(t&1),configurable:!(t&2),writable:!(t&4),value:e}}});var R=a((gq,Li)=>{"use strict";var Qi=dt(),Fi=Function.prototype,ut=Fi.call,Ks=Qi&&Fi.bind.bind(ut,ut);Li.exports=Qi?Ks:function(t){return function(){return ut.apply(t,arguments)}}});var Yi=a((mq,Gi)=>{"use strict";var Ki=R(),Gs=Ki({}.toString),Ys=Ki("".slice);Gi.exports=function(t){return Ys(Gs(t),8,-1)}});var Zi=a((fq,Wi)=>{"use strict";var Ws=R(),Zs=D(),Ps=Yi(),gt=Object,Js=Ws("".split);Wi.exports=Zs(function(){return!gt("z").propertyIsEnumerable(0)})?function(t){return Ps(t)==="String"?Js(t,""):gt(t)}:gt});var mt=a((Sq,Pi)=>{"use strict";Pi.exports=function(t){return t==null}});var ft=a((Iq,Ji)=>{"use strict";var zs=mt(),js=TypeError;Ji.exports=function(t){if(zs(t))throw new js("Can't call method on "+t);return t}});var ye=a((Eq,zi)=>{"use strict";var Hs=Zi(),Xs=ft();zi.exports=function(t){return Hs(Xs(t))}});var T=a((vq,ji)=>{"use strict";var St=typeof document=="object"&&document.all;ji.exports=typeof St=="undefined"&&St!==void 0?function(t){return typeof t=="function"||t===St}:function(t){return typeof t=="function"}});var X=a((Cq,Hi)=>{"use strict";var _s=T();Hi.exports=function(t){return typeof t=="object"?t!==null:_s(t)}});var Et=a((Mq,Xi)=>{"use strict";var It=C(),$s=T(),eA=function(t){return $s(t)?t:void 0};Xi.exports=function(t,e){return arguments.length<2?eA(It[t]):It[t]&&It[t][e]}});var $i=a((wq,_i)=>{"use strict";var tA=R();_i.exports=tA({}.isPrototypeOf)});var rr=a((xq,ir)=>{"use strict";var iA=C(),er=iA.navigator,tr=er&&er.userAgent;ir.exports=tr?String(tr):""});var qr=a((Tq,ar)=>{"use strict";var nr=C(),vt=rr(),Vr=nr.process,or=nr.Deno,sr=Vr&&Vr.versions||or&&or.version,Ar=sr&&sr.v8,y,Ue;Ar&&(y=Ar.split("."),Ue=y[0]>0&&y[0]<4?1:+(y[0]+y[1]));!Ue&&vt&&(y=vt.match(/Edge\/(\d+)/),(!y||y[1]>=74)&&(y=vt.match(/Chrome\/(\d+)/),y&&(Ue=+y[1])));ar.exports=Ue});var Ct=a((yq,lr)=>{"use strict";var cr=qr(),rA=D(),VA=C(),oA=VA.String;lr.exports=!!Object.getOwnPropertySymbols&&!rA(function(){var t=Symbol("symbol detection");return!oA(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&&cr&&cr<41})});var Mt=a((Uq,pr)=>{"use strict";var sA=Ct();pr.exports=sA&&!Symbol.sham&&typeof Symbol.iterator=="symbol"});var wt=a((Rq,dr)=>{"use strict";var AA=Et(),nA=T(),aA=$i(),qA=Mt(),cA=Object;dr.exports=qA?function(t){return typeof t=="symbol"}:function(t){var e=AA("Symbol");return nA(e)&&aA(e.prototype,cA(t))}});var ur=a((Dq,hr)=>{"use strict";var lA=String;hr.exports=function(t){try{return lA(t)}catch(e){return"Object"}}});var mr=a((bq,gr)=>{"use strict";var pA=T(),dA=ur(),hA=TypeError;gr.exports=function(t){if(pA(t))return t;throw new hA(dA(t)+" is not a function")}});var Sr=a((kq,fr)=>{"use strict";var uA=mr(),gA=mt();fr.exports=function(t,e){var i=t[e];return gA(i)?void 0:uA(i)}});var Er=a((Nq,Ir)=>{"use strict";var xt=Te(),Tt=T(),yt=X(),mA=TypeError;Ir.exports=function(t,e){var i,r;if(e==="string"&&Tt(i=t.toString)&&!yt(r=xt(i,t))||Tt(i=t.valueOf)&&!yt(r=xt(i,t))||e!=="string"&&Tt(i=t.toString)&&!yt(r=xt(i,t)))return r;throw new mA("Can't convert object to primitive value")}});var Cr=a((Bq,vr)=>{"use strict";vr.exports=!1});var Re=a((Oq,wr)=>{"use strict";var Mr=C(),fA=Object.defineProperty;wr.exports=function(t,e){try{fA(Mr,t,{value:e,configurable:!0,writable:!0})}catch(i){Mr[t]=e}return e}});var De=a((Qq,yr)=>{"use strict";var SA=Cr(),IA=C(),EA=Re(),xr="__core-js_shared__",Tr=yr.exports=IA[xr]||EA(xr,{});(Tr.versions||(Tr.versions=[])).push({version:"3.38.1",mode:SA?"pure":"global",copyright:"\xA9 2014-2024 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.38.1/LICENSE",source:"https://github.com/zloirock/core-js"})});var Ut=a((Fq,Rr)=>{"use strict";var Ur=De();Rr.exports=function(t,e){return Ur[t]||(Ur[t]=e||{})}});var br=a((Lq,Dr)=>{"use strict";var vA=ft(),CA=Object;Dr.exports=function(t){return CA(vA(t))}});var O=a((Kq,kr)=>{"use strict";var MA=R(),wA=br(),xA=MA({}.hasOwnProperty);kr.exports=Object.hasOwn||function(e,i){return xA(wA(e),i)}});var Rt=a((Gq,Nr)=>{"use strict";var TA=R(),yA=0,UA=Math.random(),RA=TA(1 .toString);Nr.exports=function(t){return"Symbol("+(t===void 0?"":t)+")_"+RA(++yA+UA,36)}});var Qr=a((Yq,Or)=>{"use strict";var DA=C(),bA=Ut(),Br=O(),kA=Rt(),NA=Ct(),BA=Mt(),_=DA.Symbol,Dt=bA("wks"),OA=BA?_.for||_:_&&_.withoutSetter||kA;Or.exports=function(t){return Br(Dt,t)||(Dt[t]=NA&&Br(_,t)?_[t]:OA("Symbol."+t)),Dt[t]}});var Gr=a((Wq,Kr)=>{"use strict";var QA=Te(),Fr=X(),Lr=wt(),FA=Sr(),LA=Er(),KA=Qr(),GA=TypeError,YA=KA("toPrimitive");Kr.exports=function(t,e){if(!Fr(t)||Lr(t))return t;var i=FA(t,YA),r;if(i){if(e===void 0&&(e="default"),r=QA(i,t,e),!Fr(r)||Lr(r))return r;throw new GA("Can't convert object to primitive value")}return e===void 0&&(e="number"),LA(t,e)}});var bt=a((Zq,Yr)=>{"use strict";var WA=Gr(),ZA=wt();Yr.exports=function(t){var e=WA(t,"string");return ZA(e)?e:e+""}});var Pr=a((Pq,Zr)=>{"use strict";var PA=C(),Wr=X(),kt=PA.document,JA=Wr(kt)&&Wr(kt.createElement);Zr.exports=function(t){return JA?kt.createElement(t):{}}});var Nt=a((Jq,Jr)=>{"use strict";var zA=B(),jA=D(),HA=Pr();Jr.exports=!zA&&!jA(function(){return Object.defineProperty(HA("div"),"a",{get:function(){return 7}}).a!==7})});var Bt=a(jr=>{"use strict";var XA=B(),_A=Te(),$A=Bi(),en=ht(),tn=ye(),rn=bt(),Vn=O(),on=Nt(),zr=Object.getOwnPropertyDescriptor;jr.f=XA?zr:function(e,i){if(e=tn(e),i=rn(i),on)try{return zr(e,i)}catch(r){}if(Vn(e,i))return en(!_A($A.f,e,i),e[i])}});var Xr=a((jq,Hr)=>{"use strict";var sn=B(),An=D();Hr.exports=sn&&An(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!==42})});var Ot=a((Hq,_r)=>{"use strict";var nn=X(),an=String,qn=TypeError;_r.exports=function(t){if(nn(t))return t;throw new qn(an(t)+" is not an object")}});var ke=a(eV=>{"use strict";var cn=B(),ln=Nt(),pn=Xr(),be=Ot(),$r=bt(),dn=TypeError,Qt=Object.defineProperty,hn=Object.getOwnPropertyDescriptor,Ft="enumerable",Lt="configurable",Kt="writable";eV.f=cn?pn?function(e,i,r){if(be(e),i=$r(i),be(r),typeof e=="function"&&i==="prototype"&&"value"in r&&Kt in r&&!r[Kt]){var V=hn(e,i);V&&V[Kt]&&(e[i]=r.value,r={configurable:Lt in r?r[Lt]:V[Lt],enumerable:Ft in r?r[Ft]:V[Ft],writable:!1})}return Qt(e,i,r)}:Qt:function(e,i,r){if(be(e),i=$r(i),be(r),ln)try{return Qt(e,i,r)}catch(V){}if("get"in r||"set"in r)throw new dn("Accessors not supported");return"value"in r&&(e[i]=r.value),e}});var Gt=a((_q,tV)=>{"use strict";var un=B(),gn=ke(),mn=ht();tV.exports=un?function(t,e,i){return gn.f(t,e,mn(1,i))}:function(t,e,i){return t[e]=i,t}});var VV=a(($q,rV)=>{"use strict";var Yt=B(),fn=O(),iV=Function.prototype,Sn=Yt&&Object.getOwnPropertyDescriptor,Wt=fn(iV,"name"),In=Wt&&function(){}.name==="something",En=Wt&&(!Yt||Yt&&Sn(iV,"name").configurable);rV.exports={EXISTS:Wt,PROPER:In,CONFIGURABLE:En}});var sV=a((ec,oV)=>{"use strict";var vn=R(),Cn=T(),Zt=De(),Mn=vn(Function.toString);Cn(Zt.inspectSource)||(Zt.inspectSource=function(t){return Mn(t)});oV.exports=Zt.inspectSource});var aV=a((tc,nV)=>{"use strict";var wn=C(),xn=T(),AV=wn.WeakMap;nV.exports=xn(AV)&&/native code/.test(String(AV))});var lV=a((ic,cV)=>{"use strict";var Tn=Ut(),yn=Rt(),qV=Tn("keys");cV.exports=function(t){return qV[t]||(qV[t]=yn(t))}});var Pt=a((rc,pV)=>{"use strict";pV.exports={}});var gV=a((Vc,uV)=>{"use strict";var Un=aV(),hV=C(),Rn=X(),Dn=Gt(),Jt=O(),zt=De(),bn=lV(),kn=Pt(),dV="Object already initialized",jt=hV.TypeError,Nn=hV.WeakMap,Ne,ne,Be,Bn=function(t){return Be(t)?ne(t):Ne(t,{})},On=function(t){return function(e){var i;if(!Rn(e)||(i=ne(e)).type!==t)throw new jt("Incompatible receiver, "+t+" required");return i}};Un||zt.state?(U=zt.state||(zt.state=new Nn),U.get=U.get,U.has=U.has,U.set=U.set,Ne=function(t,e){if(U.has(t))throw new jt(dV);return e.facade=t,U.set(t,e),e},ne=function(t){return U.get(t)||{}},Be=function(t){return U.has(t)}):(K=bn("state"),kn[K]=!0,Ne=function(t,e){if(Jt(t,K))throw new jt(dV);return e.facade=t,Dn(t,K,e),e},ne=function(t){return Jt(t,K)?t[K]:{}},Be=function(t){return Jt(t,K)});var U,K;uV.exports={set:Ne,get:ne,has:Be,enforce:Bn,getterFor:On}});var IV=a((oc,SV)=>{"use strict";var Xt=R(),Qn=D(),Fn=T(),Oe=O(),Ht=B(),Ln=VV().CONFIGURABLE,Kn=sV(),fV=gV(),Gn=fV.enforce,Yn=fV.get,mV=String,Qe=Object.defineProperty,Wn=Xt("".slice),Zn=Xt("".replace),Pn=Xt([].join),Jn=Ht&&!Qn(function(){return Qe(function(){},"length",{value:8}).length!==8}),zn=String(String).split("String"),jn=SV.exports=function(t,e,i){Wn(mV(e),0,7)==="Symbol("&&(e="["+Zn(mV(e),/^Symbol\(([^)]*)\).*$/,"$1")+"]"),i&&i.getter&&(e="get "+e),i&&i.setter&&(e="set "+e),(!Oe(t,"name")||Ln&&t.name!==e)&&(Ht?Qe(t,"name",{value:e,configurable:!0}):t.name=e),Jn&&i&&Oe(i,"arity")&&t.length!==i.arity&&Qe(t,"length",{value:i.arity});try{i&&Oe(i,"constructor")&&i.constructor?Ht&&Qe(t,"prototype",{writable:!1}):t.prototype&&(t.prototype=void 0)}catch(V){}var r=Gn(t);return Oe(r,"source")||(r.source=Pn(zn,typeof e=="string"?e:"")),t};Function.prototype.toString=jn(function(){return Fn(this)&&Yn(this).source||Kn(this)},"toString")});var vV=a((sc,EV)=>{"use strict";var Hn=T(),Xn=ke(),_n=IV(),$n=Re();EV.exports=function(t,e,i,r){r||(r={});var V=r.enumerable,o=r.name!==void 0?r.name:e;if(Hn(i)&&_n(i,o,r),r.global)V?t[e]=i:$n(e,i);else{try{r.unsafe?t[e]&&(V=!0):delete t[e]}catch(s){}V?t[e]=i:Xn.f(t,e,{value:i,enumerable:!1,configurable:!r.nonConfigurable,writable:!r.nonWritable})}return t}});var MV=a((Ac,CV)=>{"use strict";var ea=Math.ceil,ta=Math.floor;CV.exports=Math.trunc||function(e){var i=+e;return(i>0?ta:ea)(i)}});var _t=a((nc,wV)=>{"use strict";var ia=MV();wV.exports=function(t){var e=+t;return e!==e||e===0?0:ia(e)}});var TV=a((ac,xV)=>{"use strict";var ra=_t(),Va=Math.max,oa=Math.min;xV.exports=function(t,e){var i=ra(t);return i<0?Va(i+e,0):oa(i,e)}});var UV=a((qc,yV)=>{"use strict";var sa=_t(),Aa=Math.min;yV.exports=function(t){var e=sa(t);return e>0?Aa(e,9007199254740991):0}});var DV=a((cc,RV)=>{"use strict";var na=UV();RV.exports=function(t){return na(t.length)}});var NV=a((lc,kV)=>{"use strict";var aa=ye(),qa=TV(),ca=DV(),bV=function(t){return function(e,i,r){var V=aa(e),o=ca(V);if(o===0)return!t&&-1;var s=qa(r,o),A;if(t&&i!==i){for(;o>s;)if(A=V[s++],A!==A)return!0}else for(;o>s;s++)if((t||s in V)&&V[s]===i)return t||s||0;return!t&&-1}};kV.exports={includes:bV(!0),indexOf:bV(!1)}});var QV=a((pc,OV)=>{"use strict";var la=R(),$t=O(),pa=ye(),da=NV().indexOf,ha=Pt(),BV=la([].push);OV.exports=function(t,e){var i=pa(t),r=0,V=[],o;for(o in i)!$t(ha,o)&&$t(i,o)&&BV(V,o);for(;e.length>r;)$t(i,o=e[r++])&&(~da(V,o)||BV(V,o));return V}});var LV=a((dc,FV)=>{"use strict";FV.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]});var GV=a(KV=>{"use strict";var ua=QV(),ga=LV(),ma=ga.concat("length","prototype");KV.f=Object.getOwnPropertyNames||function(e){return ua(e,ma)}});var WV=a(YV=>{"use strict";YV.f=Object.getOwnPropertySymbols});var PV=a((gc,ZV)=>{"use strict";var fa=Et(),Sa=R(),Ia=GV(),Ea=WV(),va=Ot(),Ca=Sa([].concat);ZV.exports=fa("Reflect","ownKeys")||function(e){var i=Ia.f(va(e)),r=Ea.f;return r?Ca(i,r(e)):i}});var jV=a((mc,zV)=>{"use strict";var JV=O(),Ma=PV(),wa=Bt(),xa=ke();zV.exports=function(t,e,i){for(var r=Ma(e),V=xa.f,o=wa.f,s=0;s<r.length;s++){var A=r[s];!JV(t,A)&&!(i&&JV(i,A))&&V(t,A,o(e,A))}}});var XV=a((fc,HV)=>{"use strict";var Ta=D(),ya=T(),Ua=/#|\.prototype\./,ae=function(t,e){var i=Da[Ra(t)];return i===ka?!0:i===ba?!1:ya(e)?Ta(e):!!e},Ra=ae.normalize=function(t){return String(t).replace(Ua,".").toLowerCase()},Da=ae.data={},ba=ae.NATIVE="N",ka=ae.POLYFILL="P";HV.exports=ae});var $V=a((Sc,_V)=>{"use strict";var Fe=C(),Na=Bt().f,Ba=Gt(),Oa=vV(),Qa=Re(),Fa=jV(),La=XV();_V.exports=function(t,e){var i=t.target,r=t.global,V=t.stat,o,s,A,n,d,l;if(r?s=Fe:V?s=Fe[i]||Qa(i,{}):s=Fe[i]&&Fe[i].prototype,s)for(A in e){if(d=e[A],t.dontCallGetSet?(l=Na(s,A),n=l&&l.value):n=s[A],o=La(r?A:i+(V?".":"#")+A,t.forced),!o&&n!==void 0){if(typeof d==typeof n)continue;Fa(d,n)}(t.sham||n&&n.sham)&&Ba(d,"sham",!0),Oa(s,A,d,t)}}});var eo=a(()=>{"use strict";var Ka=$V(),ei=C();Ka({global:!0,forced:ei.globalThis!==ei},{globalThis:ei})});var io=a((vc,to)=>{"use strict";eo();to.exports=C()});var aq={};ks(aq,{DeviceDetector:()=>qt,default:()=>nq});var hd=Ns(io(),1);function ro(t){return{name:"DeviceDetectorOptions",type:"object",required:!1,allowEmpty:!1,properties:{networkDetect:{required:!1,type:"object",properties:{sdkAppId:{required:!0,type:"number"},userId:{required:!0,type:"string"},userSig:{required:!0,type:"string"},downlinkUserId:{required:!1,type:"string"},downlinkUserSig:{required:!1,type:"string"},roomId:{required:!1,type:"number"}},async validate(e,i,r,V){let{RtcError:o,ErrorCode:s,ErrorCodeDictionary:A}=t.errorModule;if(!e)return;let{sdkAppId:n,userId:d,userSig:l,downlinkUserId:u,downlinkUserSig:g,roomId:p}=e;p=p||8080;let w=t.TRTC.create(),N=t.TRTC.create();await w.enterRoom({roomId:p,sdkAppId:n,userId:d,userSig:l}),await w.exitRoom(),w.destroy(),u&&g&&(await N.enterRoom({roomId:p,sdkAppId:n,userId:u,userSig:g}),await N.exitRoom(),N.destroy())}},cameraDetect:{required:!1,type:"object",properties:{mirror:{required:!1,type:"boolean"}}}}}}function ti(t){return{name:"StopDeviceDetectorOptions",required:!1}}var Le=globalThis,Ge=Le.ShadowRoot&&(Le.ShadyCSS===void 0||Le.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,oo=Symbol(),Vo=new WeakMap,Ke=class{constructor(e,i,r){if(this._$cssResult$=!0,r!==oo)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=i}get styleSheet(){let e=this.o,i=this.t;if(Ge&&e===void 0){let r=i!==void 0&&i.length===1;r&&(e=Vo.get(i)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),r&&Vo.set(i,e))}return e}toString(){return this.cssText}},so=t=>new Ke(typeof t=="string"?t:t+"",void 0,oo);var ii=(t,e)=>{if(Ge)t.adoptedStyleSheets=e.map(i=>i instanceof CSSStyleSheet?i:i.styleSheet);else for(let i of e){let r=document.createElement("style"),V=Le.litNonce;V!==void 0&&r.setAttribute("nonce",V),r.textContent=i.cssText,t.appendChild(r)}},Ye=Ge?t=>t:t=>t instanceof CSSStyleSheet?(e=>{let i="";for(let r of e.cssRules)i+=r.cssText;return so(i)})(t):t;var{is:Ga,defineProperty:Ya,getOwnPropertyDescriptor:Wa,getOwnPropertyNames:Za,getOwnPropertySymbols:Pa,getPrototypeOf:Ja}=Object,Q=globalThis,Ao=Q.trustedTypes,za=Ao?Ao.emptyScript:"",ri=Q.reactiveElementPolyfillSupport,qe=(t,e)=>t,Vi={toAttribute(t,e){switch(e){case Boolean:t=t?za:null;break;case Object:case Array:t=t==null?t:JSON.stringify(t)}return t},fromAttribute(t,e){let i=t;switch(e){case Boolean:i=t!==null;break;case Number:i=t===null?null:Number(t);break;case Object:case Array:try{i=JSON.parse(t)}catch(r){i=null}}return i}},lo=(t,e)=>!Ga(t,e),no={attribute:!0,type:String,converter:Vi,reflect:!1,hasChanged:lo},ao,qo;(ao=Symbol.metadata)!=null||(Symbol.metadata=Symbol("metadata")),(qo=Q.litPropertyMetadata)!=null||(Q.litPropertyMetadata=new WeakMap);var b=class extends HTMLElement{static addInitializer(e){var i;this._$Ei(),((i=this.l)!=null?i:this.l=[]).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,i=no){if(i.state&&(i.attribute=!1),this._$Ei(),this.elementProperties.set(e,i),!i.noAccessor){let r=Symbol(),V=this.getPropertyDescriptor(e,r,i);V!==void 0&&Ya(this.prototype,e,V)}}static getPropertyDescriptor(e,i,r){var s;let{get:V,set:o}=(s=Wa(this.prototype,e))!=null?s:{get(){return this[i]},set(A){this[i]=A}};return{get(){return V==null?void 0:V.call(this)},set(A){let n=V==null?void 0:V.call(this);o.call(this,A),this.requestUpdate(e,n,r)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){var i;return(i=this.elementProperties.get(e))!=null?i:no}static _$Ei(){if(this.hasOwnProperty(qe("elementProperties")))return;let e=Ja(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(qe("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(qe("properties"))){let i=this.properties,r=[...Za(i),...Pa(i)];for(let V of r)this.createProperty(V,i[V])}let e=this[Symbol.metadata];if(e!==null){let i=litPropertyMetadata.get(e);if(i!==void 0)for(let[r,V]of i)this.elementProperties.set(r,V)}this._$Eh=new Map;for(let[i,r]of this.elementProperties){let V=this._$Eu(i,r);V!==void 0&&this._$Eh.set(V,i)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){let i=[];if(Array.isArray(e)){let r=new Set(e.flat(1/0).reverse());for(let V of r)i.unshift(Ye(V))}else e!==void 0&&i.push(Ye(e));return i}static _$Eu(e,i){let r=i.attribute;return r===!1?void 0:typeof r=="string"?r:typeof e=="string"?e.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){var e;this._$ES=new Promise(i=>this.enableUpdating=i),this._$AL=new Map,this._$E_(),this.requestUpdate(),(e=this.constructor.l)==null||e.forEach(i=>i(this))}addController(e){var i,r;((i=this._$EO)!=null?i:this._$EO=new Set).add(e),this.renderRoot!==void 0&&this.isConnected&&((r=e.hostConnected)==null||r.call(e))}removeController(e){var i;(i=this._$EO)==null||i.delete(e)}_$E_(){let e=new Map,i=this.constructor.elementProperties;for(let r of i.keys())this.hasOwnProperty(r)&&(e.set(r,this[r]),delete this[r]);e.size>0&&(this._$Ep=e)}createRenderRoot(){var i;let e=(i=this.shadowRoot)!=null?i:this.attachShadow(this.constructor.shadowRootOptions);return ii(e,this.constructor.elementStyles),e}connectedCallback(){var e,i;(e=this.renderRoot)!=null||(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(i=this._$EO)==null||i.forEach(r=>{var V;return(V=r.hostConnected)==null?void 0:V.call(r)})}enableUpdating(e){}disconnectedCallback(){var e;(e=this._$EO)==null||e.forEach(i=>{var r;return(r=i.hostDisconnected)==null?void 0:r.call(i)})}attributeChangedCallback(e,i,r){this._$AK(e,r)}_$EC(e,i){var o;let r=this.constructor.elementProperties.get(e),V=this.constructor._$Eu(e,r);if(V!==void 0&&r.reflect===!0){let s=(((o=r.converter)==null?void 0:o.toAttribute)!==void 0?r.converter:Vi).toAttribute(i,r.type);this._$Em=e,s==null?this.removeAttribute(V):this.setAttribute(V,s),this._$Em=null}}_$AK(e,i){var o;let r=this.constructor,V=r._$Eh.get(e);if(V!==void 0&&this._$Em!==V){let s=r.getPropertyOptions(V),A=typeof s.converter=="function"?{fromAttribute:s.converter}:((o=s.converter)==null?void 0:o.fromAttribute)!==void 0?s.converter:Vi;this._$Em=V,this[V]=A.fromAttribute(i,s.type),this._$Em=null}}requestUpdate(e,i,r){var V;if(e!==void 0){if(r!=null||(r=this.constructor.getPropertyOptions(e)),!((V=r.hasChanged)!=null?V:lo)(this[e],i))return;this.P(e,i,r)}this.isUpdatePending===!1&&(this._$ES=this._$ET())}P(e,i,r){var V;this._$AL.has(e)||this._$AL.set(e,i),r.reflect===!0&&this._$Em!==e&&((V=this._$Ej)!=null?V:this._$Ej=new Set).add(e)}async _$ET(){this.isUpdatePending=!0;try{await this._$ES}catch(i){Promise.reject(i)}let e=this.scheduleUpdate();return e!=null&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var r,V;if(!this.isUpdatePending)return;if(!this.hasUpdated){if((r=this.renderRoot)!=null||(this.renderRoot=this.createRenderRoot()),this._$Ep){for(let[s,A]of this._$Ep)this[s]=A;this._$Ep=void 0}let o=this.constructor.elementProperties;if(o.size>0)for(let[s,A]of o)A.wrapped!==!0||this._$AL.has(s)||this[s]===void 0||this.P(s,this[s],A)}let e=!1,i=this._$AL;try{e=this.shouldUpdate(i),e?(this.willUpdate(i),(V=this._$EO)==null||V.forEach(o=>{var s;return(s=o.hostUpdate)==null?void 0:s.call(o)}),this.update(i)):this._$EU()}catch(o){throw e=!1,this._$EU(),o}e&&this._$AE(i)}willUpdate(e){}_$AE(e){var i;(i=this._$EO)==null||i.forEach(r=>{var V;return(V=r.hostUpdated)==null?void 0:V.call(r)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(e){return!0}update(e){this._$Ej&&(this._$Ej=this._$Ej.forEach(i=>this._$EC(i,this[i]))),this._$EU()}updated(e){}firstUpdated(e){}},co;b.elementStyles=[],b.shadowRootOptions={mode:"open"},b[qe("elementProperties")]=new Map,b[qe("finalized")]=new Map,ri==null||ri({ReactiveElement:b}),((co=Q.reactiveElementVersions)!=null?co:Q.reactiveElementVersions=[]).push("2.0.4");var le=globalThis,We=le.trustedTypes,po=We?We.createPolicy("lit-html",{createHTML:t=>t}):void 0,Io="$lit$",F=`lit$${Math.random().toFixed(9).slice(2)}$`,Eo="?"+F,ja=`<${Eo}>`,W=document,pe=()=>W.createComment(""),de=t=>t===null||typeof t!="object"&&typeof t!="function",li=Array.isArray,Ha=t=>li(t)||typeof(t==null?void 0:t[Symbol.iterator])=="function",oi=`[
|
|
1
|
+
"use strict";var DeviceDetector=(()=>{var xs=Object.create;var se=Object.defineProperty,Ts=Object.defineProperties,ys=Object.getOwnPropertyDescriptor,Us=Object.getOwnPropertyDescriptors,Rs=Object.getOwnPropertyNames,Mi=Object.getOwnPropertySymbols,Ds=Object.getPrototypeOf,wi=Object.prototype.hasOwnProperty,bs=Object.prototype.propertyIsEnumerable;var lt=(t,e,i)=>e in t?se(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i,j=(t,e)=>{for(var i in e||(e={}))wi.call(e,i)&<(t,i,e[i]);if(Mi)for(var i of Mi(e))bs.call(e,i)&<(t,i,e[i]);return t},H=(t,e)=>Ts(t,Us(e));var a=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),ks=(t,e)=>{for(var i in e)se(t,i,{get:e[i],enumerable:!0})},xi=(t,e,i,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let V of Rs(e))!wi.call(t,V)&&V!==i&&se(t,V,{get:()=>e[V],enumerable:!(r=ys(e,V))||r.enumerable});return t};var Ns=(t,e,i)=>(i=t!=null?xs(Ds(t)):{},xi(e||!t||!t.__esModule?se(i,"default",{value:t,enumerable:!0}):i,t)),Bs=t=>xi(se({},"__esModule",{value:!0}),t);var h=(t,e,i)=>(lt(t,typeof e!="symbol"?e+"":e,i),i);var C=a((pt,Ti)=>{"use strict";var Ae=function(t){return t&&t.Math===Math&&t};Ti.exports=Ae(typeof globalThis=="object"&&globalThis)||Ae(typeof window=="object"&&window)||Ae(typeof self=="object"&&self)||Ae(typeof global=="object"&&global)||Ae(typeof pt=="object"&&pt)||function(){return this}()||Function("return this")()});var D=a((cq,yi)=>{"use strict";yi.exports=function(t){try{return!!t()}catch(e){return!0}}});var B=a((lq,Ui)=>{"use strict";var Os=D();Ui.exports=!Os(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!==7})});var dt=a((pq,Ri)=>{"use strict";var Qs=D();Ri.exports=!Qs(function(){var t=function(){}.bind();return typeof t!="function"||t.hasOwnProperty("prototype")})});var Te=a((dq,Di)=>{"use strict";var Fs=dt(),xe=Function.prototype.call;Di.exports=Fs?xe.bind(xe):function(){return xe.apply(xe,arguments)}});var Bi=a(Ni=>{"use strict";var bi={}.propertyIsEnumerable,ki=Object.getOwnPropertyDescriptor,Ls=ki&&!bi.call({1:2},1);Ni.f=Ls?function(e){var i=ki(this,e);return!!i&&i.enumerable}:bi});var ht=a((uq,Oi)=>{"use strict";Oi.exports=function(t,e){return{enumerable:!(t&1),configurable:!(t&2),writable:!(t&4),value:e}}});var R=a((gq,Li)=>{"use strict";var Qi=dt(),Fi=Function.prototype,ut=Fi.call,Ks=Qi&&Fi.bind.bind(ut,ut);Li.exports=Qi?Ks:function(t){return function(){return ut.apply(t,arguments)}}});var Yi=a((mq,Gi)=>{"use strict";var Ki=R(),Gs=Ki({}.toString),Ys=Ki("".slice);Gi.exports=function(t){return Ys(Gs(t),8,-1)}});var Zi=a((fq,Wi)=>{"use strict";var Ws=R(),Zs=D(),Ps=Yi(),gt=Object,Js=Ws("".split);Wi.exports=Zs(function(){return!gt("z").propertyIsEnumerable(0)})?function(t){return Ps(t)==="String"?Js(t,""):gt(t)}:gt});var mt=a((Sq,Pi)=>{"use strict";Pi.exports=function(t){return t==null}});var ft=a((Iq,Ji)=>{"use strict";var zs=mt(),js=TypeError;Ji.exports=function(t){if(zs(t))throw new js("Can't call method on "+t);return t}});var ye=a((Eq,zi)=>{"use strict";var Hs=Zi(),Xs=ft();zi.exports=function(t){return Hs(Xs(t))}});var T=a((vq,ji)=>{"use strict";var St=typeof document=="object"&&document.all;ji.exports=typeof St=="undefined"&&St!==void 0?function(t){return typeof t=="function"||t===St}:function(t){return typeof t=="function"}});var X=a((Cq,Hi)=>{"use strict";var _s=T();Hi.exports=function(t){return typeof t=="object"?t!==null:_s(t)}});var Et=a((Mq,Xi)=>{"use strict";var It=C(),$s=T(),eA=function(t){return $s(t)?t:void 0};Xi.exports=function(t,e){return arguments.length<2?eA(It[t]):It[t]&&It[t][e]}});var $i=a((wq,_i)=>{"use strict";var tA=R();_i.exports=tA({}.isPrototypeOf)});var rr=a((xq,ir)=>{"use strict";var iA=C(),er=iA.navigator,tr=er&&er.userAgent;ir.exports=tr?String(tr):""});var qr=a((Tq,ar)=>{"use strict";var nr=C(),vt=rr(),Vr=nr.process,or=nr.Deno,sr=Vr&&Vr.versions||or&&or.version,Ar=sr&&sr.v8,y,Ue;Ar&&(y=Ar.split("."),Ue=y[0]>0&&y[0]<4?1:+(y[0]+y[1]));!Ue&&vt&&(y=vt.match(/Edge\/(\d+)/),(!y||y[1]>=74)&&(y=vt.match(/Chrome\/(\d+)/),y&&(Ue=+y[1])));ar.exports=Ue});var Ct=a((yq,lr)=>{"use strict";var cr=qr(),rA=D(),VA=C(),oA=VA.String;lr.exports=!!Object.getOwnPropertySymbols&&!rA(function(){var t=Symbol("symbol detection");return!oA(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&&cr&&cr<41})});var Mt=a((Uq,pr)=>{"use strict";var sA=Ct();pr.exports=sA&&!Symbol.sham&&typeof Symbol.iterator=="symbol"});var wt=a((Rq,dr)=>{"use strict";var AA=Et(),nA=T(),aA=$i(),qA=Mt(),cA=Object;dr.exports=qA?function(t){return typeof t=="symbol"}:function(t){var e=AA("Symbol");return nA(e)&&aA(e.prototype,cA(t))}});var ur=a((Dq,hr)=>{"use strict";var lA=String;hr.exports=function(t){try{return lA(t)}catch(e){return"Object"}}});var mr=a((bq,gr)=>{"use strict";var pA=T(),dA=ur(),hA=TypeError;gr.exports=function(t){if(pA(t))return t;throw new hA(dA(t)+" is not a function")}});var Sr=a((kq,fr)=>{"use strict";var uA=mr(),gA=mt();fr.exports=function(t,e){var i=t[e];return gA(i)?void 0:uA(i)}});var Er=a((Nq,Ir)=>{"use strict";var xt=Te(),Tt=T(),yt=X(),mA=TypeError;Ir.exports=function(t,e){var i,r;if(e==="string"&&Tt(i=t.toString)&&!yt(r=xt(i,t))||Tt(i=t.valueOf)&&!yt(r=xt(i,t))||e!=="string"&&Tt(i=t.toString)&&!yt(r=xt(i,t)))return r;throw new mA("Can't convert object to primitive value")}});var Cr=a((Bq,vr)=>{"use strict";vr.exports=!1});var Re=a((Oq,wr)=>{"use strict";var Mr=C(),fA=Object.defineProperty;wr.exports=function(t,e){try{fA(Mr,t,{value:e,configurable:!0,writable:!0})}catch(i){Mr[t]=e}return e}});var De=a((Qq,yr)=>{"use strict";var SA=Cr(),IA=C(),EA=Re(),xr="__core-js_shared__",Tr=yr.exports=IA[xr]||EA(xr,{});(Tr.versions||(Tr.versions=[])).push({version:"3.38.1",mode:SA?"pure":"global",copyright:"\xA9 2014-2024 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.38.1/LICENSE",source:"https://github.com/zloirock/core-js"})});var Ut=a((Fq,Rr)=>{"use strict";var Ur=De();Rr.exports=function(t,e){return Ur[t]||(Ur[t]=e||{})}});var br=a((Lq,Dr)=>{"use strict";var vA=ft(),CA=Object;Dr.exports=function(t){return CA(vA(t))}});var O=a((Kq,kr)=>{"use strict";var MA=R(),wA=br(),xA=MA({}.hasOwnProperty);kr.exports=Object.hasOwn||function(e,i){return xA(wA(e),i)}});var Rt=a((Gq,Nr)=>{"use strict";var TA=R(),yA=0,UA=Math.random(),RA=TA(1 .toString);Nr.exports=function(t){return"Symbol("+(t===void 0?"":t)+")_"+RA(++yA+UA,36)}});var Qr=a((Yq,Or)=>{"use strict";var DA=C(),bA=Ut(),Br=O(),kA=Rt(),NA=Ct(),BA=Mt(),_=DA.Symbol,Dt=bA("wks"),OA=BA?_.for||_:_&&_.withoutSetter||kA;Or.exports=function(t){return Br(Dt,t)||(Dt[t]=NA&&Br(_,t)?_[t]:OA("Symbol."+t)),Dt[t]}});var Gr=a((Wq,Kr)=>{"use strict";var QA=Te(),Fr=X(),Lr=wt(),FA=Sr(),LA=Er(),KA=Qr(),GA=TypeError,YA=KA("toPrimitive");Kr.exports=function(t,e){if(!Fr(t)||Lr(t))return t;var i=FA(t,YA),r;if(i){if(e===void 0&&(e="default"),r=QA(i,t,e),!Fr(r)||Lr(r))return r;throw new GA("Can't convert object to primitive value")}return e===void 0&&(e="number"),LA(t,e)}});var bt=a((Zq,Yr)=>{"use strict";var WA=Gr(),ZA=wt();Yr.exports=function(t){var e=WA(t,"string");return ZA(e)?e:e+""}});var Pr=a((Pq,Zr)=>{"use strict";var PA=C(),Wr=X(),kt=PA.document,JA=Wr(kt)&&Wr(kt.createElement);Zr.exports=function(t){return JA?kt.createElement(t):{}}});var Nt=a((Jq,Jr)=>{"use strict";var zA=B(),jA=D(),HA=Pr();Jr.exports=!zA&&!jA(function(){return Object.defineProperty(HA("div"),"a",{get:function(){return 7}}).a!==7})});var Bt=a(jr=>{"use strict";var XA=B(),_A=Te(),$A=Bi(),en=ht(),tn=ye(),rn=bt(),Vn=O(),on=Nt(),zr=Object.getOwnPropertyDescriptor;jr.f=XA?zr:function(e,i){if(e=tn(e),i=rn(i),on)try{return zr(e,i)}catch(r){}if(Vn(e,i))return en(!_A($A.f,e,i),e[i])}});var Xr=a((jq,Hr)=>{"use strict";var sn=B(),An=D();Hr.exports=sn&&An(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!==42})});var Ot=a((Hq,_r)=>{"use strict";var nn=X(),an=String,qn=TypeError;_r.exports=function(t){if(nn(t))return t;throw new qn(an(t)+" is not an object")}});var ke=a(eV=>{"use strict";var cn=B(),ln=Nt(),pn=Xr(),be=Ot(),$r=bt(),dn=TypeError,Qt=Object.defineProperty,hn=Object.getOwnPropertyDescriptor,Ft="enumerable",Lt="configurable",Kt="writable";eV.f=cn?pn?function(e,i,r){if(be(e),i=$r(i),be(r),typeof e=="function"&&i==="prototype"&&"value"in r&&Kt in r&&!r[Kt]){var V=hn(e,i);V&&V[Kt]&&(e[i]=r.value,r={configurable:Lt in r?r[Lt]:V[Lt],enumerable:Ft in r?r[Ft]:V[Ft],writable:!1})}return Qt(e,i,r)}:Qt:function(e,i,r){if(be(e),i=$r(i),be(r),ln)try{return Qt(e,i,r)}catch(V){}if("get"in r||"set"in r)throw new dn("Accessors not supported");return"value"in r&&(e[i]=r.value),e}});var Gt=a((_q,tV)=>{"use strict";var un=B(),gn=ke(),mn=ht();tV.exports=un?function(t,e,i){return gn.f(t,e,mn(1,i))}:function(t,e,i){return t[e]=i,t}});var VV=a(($q,rV)=>{"use strict";var Yt=B(),fn=O(),iV=Function.prototype,Sn=Yt&&Object.getOwnPropertyDescriptor,Wt=fn(iV,"name"),In=Wt&&function(){}.name==="something",En=Wt&&(!Yt||Yt&&Sn(iV,"name").configurable);rV.exports={EXISTS:Wt,PROPER:In,CONFIGURABLE:En}});var sV=a((ec,oV)=>{"use strict";var vn=R(),Cn=T(),Zt=De(),Mn=vn(Function.toString);Cn(Zt.inspectSource)||(Zt.inspectSource=function(t){return Mn(t)});oV.exports=Zt.inspectSource});var aV=a((tc,nV)=>{"use strict";var wn=C(),xn=T(),AV=wn.WeakMap;nV.exports=xn(AV)&&/native code/.test(String(AV))});var lV=a((ic,cV)=>{"use strict";var Tn=Ut(),yn=Rt(),qV=Tn("keys");cV.exports=function(t){return qV[t]||(qV[t]=yn(t))}});var Pt=a((rc,pV)=>{"use strict";pV.exports={}});var gV=a((Vc,uV)=>{"use strict";var Un=aV(),hV=C(),Rn=X(),Dn=Gt(),Jt=O(),zt=De(),bn=lV(),kn=Pt(),dV="Object already initialized",jt=hV.TypeError,Nn=hV.WeakMap,Ne,ne,Be,Bn=function(t){return Be(t)?ne(t):Ne(t,{})},On=function(t){return function(e){var i;if(!Rn(e)||(i=ne(e)).type!==t)throw new jt("Incompatible receiver, "+t+" required");return i}};Un||zt.state?(U=zt.state||(zt.state=new Nn),U.get=U.get,U.has=U.has,U.set=U.set,Ne=function(t,e){if(U.has(t))throw new jt(dV);return e.facade=t,U.set(t,e),e},ne=function(t){return U.get(t)||{}},Be=function(t){return U.has(t)}):(K=bn("state"),kn[K]=!0,Ne=function(t,e){if(Jt(t,K))throw new jt(dV);return e.facade=t,Dn(t,K,e),e},ne=function(t){return Jt(t,K)?t[K]:{}},Be=function(t){return Jt(t,K)});var U,K;uV.exports={set:Ne,get:ne,has:Be,enforce:Bn,getterFor:On}});var IV=a((oc,SV)=>{"use strict";var Xt=R(),Qn=D(),Fn=T(),Oe=O(),Ht=B(),Ln=VV().CONFIGURABLE,Kn=sV(),fV=gV(),Gn=fV.enforce,Yn=fV.get,mV=String,Qe=Object.defineProperty,Wn=Xt("".slice),Zn=Xt("".replace),Pn=Xt([].join),Jn=Ht&&!Qn(function(){return Qe(function(){},"length",{value:8}).length!==8}),zn=String(String).split("String"),jn=SV.exports=function(t,e,i){Wn(mV(e),0,7)==="Symbol("&&(e="["+Zn(mV(e),/^Symbol\(([^)]*)\).*$/,"$1")+"]"),i&&i.getter&&(e="get "+e),i&&i.setter&&(e="set "+e),(!Oe(t,"name")||Ln&&t.name!==e)&&(Ht?Qe(t,"name",{value:e,configurable:!0}):t.name=e),Jn&&i&&Oe(i,"arity")&&t.length!==i.arity&&Qe(t,"length",{value:i.arity});try{i&&Oe(i,"constructor")&&i.constructor?Ht&&Qe(t,"prototype",{writable:!1}):t.prototype&&(t.prototype=void 0)}catch(V){}var r=Gn(t);return Oe(r,"source")||(r.source=Pn(zn,typeof e=="string"?e:"")),t};Function.prototype.toString=jn(function(){return Fn(this)&&Yn(this).source||Kn(this)},"toString")});var vV=a((sc,EV)=>{"use strict";var Hn=T(),Xn=ke(),_n=IV(),$n=Re();EV.exports=function(t,e,i,r){r||(r={});var V=r.enumerable,o=r.name!==void 0?r.name:e;if(Hn(i)&&_n(i,o,r),r.global)V?t[e]=i:$n(e,i);else{try{r.unsafe?t[e]&&(V=!0):delete t[e]}catch(s){}V?t[e]=i:Xn.f(t,e,{value:i,enumerable:!1,configurable:!r.nonConfigurable,writable:!r.nonWritable})}return t}});var MV=a((Ac,CV)=>{"use strict";var ea=Math.ceil,ta=Math.floor;CV.exports=Math.trunc||function(e){var i=+e;return(i>0?ta:ea)(i)}});var _t=a((nc,wV)=>{"use strict";var ia=MV();wV.exports=function(t){var e=+t;return e!==e||e===0?0:ia(e)}});var TV=a((ac,xV)=>{"use strict";var ra=_t(),Va=Math.max,oa=Math.min;xV.exports=function(t,e){var i=ra(t);return i<0?Va(i+e,0):oa(i,e)}});var UV=a((qc,yV)=>{"use strict";var sa=_t(),Aa=Math.min;yV.exports=function(t){var e=sa(t);return e>0?Aa(e,9007199254740991):0}});var DV=a((cc,RV)=>{"use strict";var na=UV();RV.exports=function(t){return na(t.length)}});var NV=a((lc,kV)=>{"use strict";var aa=ye(),qa=TV(),ca=DV(),bV=function(t){return function(e,i,r){var V=aa(e),o=ca(V);if(o===0)return!t&&-1;var s=qa(r,o),A;if(t&&i!==i){for(;o>s;)if(A=V[s++],A!==A)return!0}else for(;o>s;s++)if((t||s in V)&&V[s]===i)return t||s||0;return!t&&-1}};kV.exports={includes:bV(!0),indexOf:bV(!1)}});var QV=a((pc,OV)=>{"use strict";var la=R(),$t=O(),pa=ye(),da=NV().indexOf,ha=Pt(),BV=la([].push);OV.exports=function(t,e){var i=pa(t),r=0,V=[],o;for(o in i)!$t(ha,o)&&$t(i,o)&&BV(V,o);for(;e.length>r;)$t(i,o=e[r++])&&(~da(V,o)||BV(V,o));return V}});var LV=a((dc,FV)=>{"use strict";FV.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]});var GV=a(KV=>{"use strict";var ua=QV(),ga=LV(),ma=ga.concat("length","prototype");KV.f=Object.getOwnPropertyNames||function(e){return ua(e,ma)}});var WV=a(YV=>{"use strict";YV.f=Object.getOwnPropertySymbols});var PV=a((gc,ZV)=>{"use strict";var fa=Et(),Sa=R(),Ia=GV(),Ea=WV(),va=Ot(),Ca=Sa([].concat);ZV.exports=fa("Reflect","ownKeys")||function(e){var i=Ia.f(va(e)),r=Ea.f;return r?Ca(i,r(e)):i}});var jV=a((mc,zV)=>{"use strict";var JV=O(),Ma=PV(),wa=Bt(),xa=ke();zV.exports=function(t,e,i){for(var r=Ma(e),V=xa.f,o=wa.f,s=0;s<r.length;s++){var A=r[s];!JV(t,A)&&!(i&&JV(i,A))&&V(t,A,o(e,A))}}});var XV=a((fc,HV)=>{"use strict";var Ta=D(),ya=T(),Ua=/#|\.prototype\./,ae=function(t,e){var i=Da[Ra(t)];return i===ka?!0:i===ba?!1:ya(e)?Ta(e):!!e},Ra=ae.normalize=function(t){return String(t).replace(Ua,".").toLowerCase()},Da=ae.data={},ba=ae.NATIVE="N",ka=ae.POLYFILL="P";HV.exports=ae});var $V=a((Sc,_V)=>{"use strict";var Fe=C(),Na=Bt().f,Ba=Gt(),Oa=vV(),Qa=Re(),Fa=jV(),La=XV();_V.exports=function(t,e){var i=t.target,r=t.global,V=t.stat,o,s,A,n,d,l;if(r?s=Fe:V?s=Fe[i]||Qa(i,{}):s=Fe[i]&&Fe[i].prototype,s)for(A in e){if(d=e[A],t.dontCallGetSet?(l=Na(s,A),n=l&&l.value):n=s[A],o=La(r?A:i+(V?".":"#")+A,t.forced),!o&&n!==void 0){if(typeof d==typeof n)continue;Fa(d,n)}(t.sham||n&&n.sham)&&Ba(d,"sham",!0),Oa(s,A,d,t)}}});var eo=a(()=>{"use strict";var Ka=$V(),ei=C();Ka({global:!0,forced:ei.globalThis!==ei},{globalThis:ei})});var io=a((vc,to)=>{"use strict";eo();to.exports=C()});var aq={};ks(aq,{DeviceDetector:()=>qt,default:()=>nq});var hd=Ns(io(),1);function ro(t){return{name:"DeviceDetectorOptions",type:"object",required:!1,allowEmpty:!1,properties:{networkDetect:{required:!1,type:"object",properties:{sdkAppId:{required:!0,type:"number"},userId:{required:!0,type:"string"},userSig:{required:!0,type:"string"},downlinkUserId:{required:!1,type:"string"},downlinkUserSig:{required:!1,type:"string"},roomId:{required:!1,type:"number"}},async validate(e,i,r,V){let{RtcError:o,ErrorCode:s,ErrorCodeDictionary:A}=t.errorModule;if(!e)return;let{sdkAppId:n,userId:d,userSig:l,downlinkUserId:u,downlinkUserSig:g,roomId:p}=e;p=p||8080;let w=t.TRTC.create(),N=t.TRTC.create();await w.enterRoom({roomId:p,sdkAppId:n,userId:d,userSig:l}),await w.exitRoom(),w.destroy(),u&&g&&(await N.enterRoom({roomId:p,sdkAppId:n,userId:u,userSig:g}),await N.exitRoom(),N.destroy())}},cameraDetect:{required:!1,type:"object",properties:{mirror:{required:!1,type:"boolean"}}}}}}function ti(t){return{name:"StopDeviceDetectorOptions",required:!1}}var Le=globalThis,Ge=Le.ShadowRoot&&(Le.ShadyCSS===void 0||Le.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,oo=Symbol(),Vo=new WeakMap,Ke=class{constructor(e,i,r){if(this._$cssResult$=!0,r!==oo)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=i}get styleSheet(){let e=this.o,i=this.t;if(Ge&&e===void 0){let r=i!==void 0&&i.length===1;r&&(e=Vo.get(i)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),r&&Vo.set(i,e))}return e}toString(){return this.cssText}},so=t=>new Ke(typeof t=="string"?t:t+"",void 0,oo);var ii=(t,e)=>{if(Ge)t.adoptedStyleSheets=e.map(i=>i instanceof CSSStyleSheet?i:i.styleSheet);else for(let i of e){let r=document.createElement("style"),V=Le.litNonce;V!==void 0&&r.setAttribute("nonce",V),r.textContent=i.cssText,t.appendChild(r)}},Ye=Ge?t=>t:t=>t instanceof CSSStyleSheet?(e=>{let i="";for(let r of e.cssRules)i+=r.cssText;return so(i)})(t):t;var{is:Ga,defineProperty:Ya,getOwnPropertyDescriptor:Wa,getOwnPropertyNames:Za,getOwnPropertySymbols:Pa,getPrototypeOf:Ja}=Object,Q=globalThis,Ao=Q.trustedTypes,za=Ao?Ao.emptyScript:"",ri=Q.reactiveElementPolyfillSupport,qe=(t,e)=>t,Vi={toAttribute(t,e){switch(e){case Boolean:t=t?za:null;break;case Object:case Array:t=t==null?t:JSON.stringify(t)}return t},fromAttribute(t,e){let i=t;switch(e){case Boolean:i=t!==null;break;case Number:i=t===null?null:Number(t);break;case Object:case Array:try{i=JSON.parse(t)}catch(r){i=null}}return i}},lo=(t,e)=>!Ga(t,e),no={attribute:!0,type:String,converter:Vi,reflect:!1,hasChanged:lo},ao,qo;(ao=Symbol.metadata)!=null||(Symbol.metadata=Symbol("metadata")),(qo=Q.litPropertyMetadata)!=null||(Q.litPropertyMetadata=new WeakMap);var b=class extends HTMLElement{static addInitializer(e){var i;this._$Ei(),((i=this.l)!=null?i:this.l=[]).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,i=no){if(i.state&&(i.attribute=!1),this._$Ei(),this.elementProperties.set(e,i),!i.noAccessor){let r=Symbol(),V=this.getPropertyDescriptor(e,r,i);V!==void 0&&Ya(this.prototype,e,V)}}static getPropertyDescriptor(e,i,r){var s;let{get:V,set:o}=(s=Wa(this.prototype,e))!=null?s:{get(){return this[i]},set(A){this[i]=A}};return{get(){return V==null?void 0:V.call(this)},set(A){let n=V==null?void 0:V.call(this);o.call(this,A),this.requestUpdate(e,n,r)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){var i;return(i=this.elementProperties.get(e))!=null?i:no}static _$Ei(){if(this.hasOwnProperty(qe("elementProperties")))return;let e=Ja(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(qe("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(qe("properties"))){let i=this.properties,r=[...Za(i),...Pa(i)];for(let V of r)this.createProperty(V,i[V])}let e=this[Symbol.metadata];if(e!==null){let i=litPropertyMetadata.get(e);if(i!==void 0)for(let[r,V]of i)this.elementProperties.set(r,V)}this._$Eh=new Map;for(let[i,r]of this.elementProperties){let V=this._$Eu(i,r);V!==void 0&&this._$Eh.set(V,i)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){let i=[];if(Array.isArray(e)){let r=new Set(e.flat(1/0).reverse());for(let V of r)i.unshift(Ye(V))}else e!==void 0&&i.push(Ye(e));return i}static _$Eu(e,i){let r=i.attribute;return r===!1?void 0:typeof r=="string"?r:typeof e=="string"?e.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){var e;this._$ES=new Promise(i=>this.enableUpdating=i),this._$AL=new Map,this._$E_(),this.requestUpdate(),(e=this.constructor.l)==null||e.forEach(i=>i(this))}addController(e){var i,r;((i=this._$EO)!=null?i:this._$EO=new Set).add(e),this.renderRoot!==void 0&&this.isConnected&&((r=e.hostConnected)==null||r.call(e))}removeController(e){var i;(i=this._$EO)==null||i.delete(e)}_$E_(){let e=new Map,i=this.constructor.elementProperties;for(let r of i.keys())this.hasOwnProperty(r)&&(e.set(r,this[r]),delete this[r]);e.size>0&&(this._$Ep=e)}createRenderRoot(){var i;let e=(i=this.shadowRoot)!=null?i:this.attachShadow(this.constructor.shadowRootOptions);return ii(e,this.constructor.elementStyles),e}connectedCallback(){var e,i;(e=this.renderRoot)!=null||(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(i=this._$EO)==null||i.forEach(r=>{var V;return(V=r.hostConnected)==null?void 0:V.call(r)})}enableUpdating(e){}disconnectedCallback(){var e;(e=this._$EO)==null||e.forEach(i=>{var r;return(r=i.hostDisconnected)==null?void 0:r.call(i)})}attributeChangedCallback(e,i,r){this._$AK(e,r)}_$EC(e,i){var o;let r=this.constructor.elementProperties.get(e),V=this.constructor._$Eu(e,r);if(V!==void 0&&r.reflect===!0){let s=(((o=r.converter)==null?void 0:o.toAttribute)!==void 0?r.converter:Vi).toAttribute(i,r.type);this._$Em=e,s==null?this.removeAttribute(V):this.setAttribute(V,s),this._$Em=null}}_$AK(e,i){var o;let r=this.constructor,V=r._$Eh.get(e);if(V!==void 0&&this._$Em!==V){let s=r.getPropertyOptions(V),A=typeof s.converter=="function"?{fromAttribute:s.converter}:((o=s.converter)==null?void 0:o.fromAttribute)!==void 0?s.converter:Vi;this._$Em=V,this[V]=A.fromAttribute(i,s.type),this._$Em=null}}requestUpdate(e,i,r){var V;if(e!==void 0){if(r!=null||(r=this.constructor.getPropertyOptions(e)),!((V=r.hasChanged)!=null?V:lo)(this[e],i))return;this.P(e,i,r)}this.isUpdatePending===!1&&(this._$ES=this._$ET())}P(e,i,r){var V;this._$AL.has(e)||this._$AL.set(e,i),r.reflect===!0&&this._$Em!==e&&((V=this._$Ej)!=null?V:this._$Ej=new Set).add(e)}async _$ET(){this.isUpdatePending=!0;try{await this._$ES}catch(i){Promise.reject(i)}let e=this.scheduleUpdate();return e!=null&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var r,V;if(!this.isUpdatePending)return;if(!this.hasUpdated){if((r=this.renderRoot)!=null||(this.renderRoot=this.createRenderRoot()),this._$Ep){for(let[s,A]of this._$Ep)this[s]=A;this._$Ep=void 0}let o=this.constructor.elementProperties;if(o.size>0)for(let[s,A]of o)A.wrapped!==!0||this._$AL.has(s)||this[s]===void 0||this.P(s,this[s],A)}let e=!1,i=this._$AL;try{e=this.shouldUpdate(i),e?(this.willUpdate(i),(V=this._$EO)==null||V.forEach(o=>{var s;return(s=o.hostUpdate)==null?void 0:s.call(o)}),this.update(i)):this._$EU()}catch(o){throw e=!1,this._$EU(),o}e&&this._$AE(i)}willUpdate(e){}_$AE(e){var i;(i=this._$EO)==null||i.forEach(r=>{var V;return(V=r.hostUpdated)==null?void 0:V.call(r)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(e){return!0}update(e){this._$Ej&&(this._$Ej=this._$Ej.forEach(i=>this._$EC(i,this[i]))),this._$EU()}updated(e){}firstUpdated(e){}},co;b.elementStyles=[],b.shadowRootOptions={mode:"open"},b[qe("elementProperties")]=new Map,b[qe("finalized")]=new Map,ri==null||ri({ReactiveElement:b}),((co=Q.reactiveElementVersions)!=null?co:Q.reactiveElementVersions=[]).push("2.0.4");var le=globalThis,We=le.trustedTypes,po=We?We.createPolicy("lit-html",{createHTML:t=>t}):void 0,Io="$lit$",F=`lit$${Math.random().toFixed(9).slice(2)}$`,Eo="?"+F,ja=`<${Eo}>`,W=document,pe=()=>W.createComment(""),de=t=>t===null||typeof t!="object"&&typeof t!="function",li=Array.isArray,Ha=t=>li(t)||typeof(t==null?void 0:t[Symbol.iterator])=="function",oi=`[
|
|
2
2
|
\f\r]`,ce=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,ho=/-->/g,uo=/>/g,G=RegExp(`>|${oi}(?:([^\\s"'>=/]+)(${oi}*=${oi}*(?:[^
|
|
3
|
-
\f\r"'\`<>=]|("|')|))|$)`,"g"),go=/'/g,mo=/"/g,vo=/^(?:script|style|textarea|title)$/i,pi=t=>(e,...i)=>({_$litType$:t,strings:e,values:i}),c=pi(1),kc=pi(2),Nc=pi(3),Z=Symbol.for("lit-noChange"),I=Symbol.for("lit-nothing"),fo=new WeakMap,Y=W.createTreeWalker(W,129);function Co(t,e){if(!li(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return po!==void 0?po.createHTML(e):e}var Xa=(t,e)=>{let i=t.length-1,r=[],V,o=e===2?"<svg>":e===3?"<math>":"",s=ce;for(let A=0;A<i;A++){let n=t[A],d,l,u=-1,g=0;for(;g<n.length&&(s.lastIndex=g,l=s.exec(n),l!==null);)g=s.lastIndex,s===ce?l[1]==="!--"?s=ho:l[1]!==void 0?s=uo:l[2]!==void 0?(vo.test(l[2])&&(V=RegExp("</"+l[2],"g")),s=G):l[3]!==void 0&&(s=G):s===G?l[0]===">"?(s=V!=null?V:ce,u=-1):l[1]===void 0?u=-2:(u=s.lastIndex-l[2].length,d=l[1],s=l[3]===void 0?G:l[3]==='"'?mo:go):s===mo||s===go?s=G:s===ho||s===uo?s=ce:(s=G,V=void 0);let p=s===G&&t[A+1].startsWith("/>")?" ":"";o+=s===ce?n+ja:u>=0?(r.push(d),n.slice(0,u)+Io+n.slice(u)+F+p):n+F+(u===-2?A:p)}return[Co(t,o+(t[i]||"<?>")+(e===2?"</svg>":e===3?"</math>":"")),r]},he=class t{constructor({strings:e,_$litType$:i},r){let V;this.parts=[];let o=0,s=0,A=e.length-1,n=this.parts,[d,l]=Xa(e,i);if(this.el=t.createElement(d,r),Y.currentNode=this.el.content,i===2||i===3){let u=this.el.content.firstChild;u.replaceWith(...u.childNodes)}for(;(V=Y.nextNode())!==null&&n.length<A;){if(V.nodeType===1){if(V.hasAttributes())for(let u of V.getAttributeNames())if(u.endsWith(Io)){let g=l[s++],p=V.getAttribute(u).split(F),w=/([.?@])?(.*)/.exec(g);n.push({type:1,index:o,name:w[2],strings:p,ctor:w[1]==="."?ni:w[1]==="?"?ai:w[1]==="@"?qi:ee}),V.removeAttribute(u)}else u.startsWith(F)&&(n.push({type:6,index:o}),V.removeAttribute(u));if(vo.test(V.tagName)){let u=V.textContent.split(F),g=u.length-1;if(g>0){V.textContent=We?We.emptyScript:"";for(let p=0;p<g;p++)V.append(u[p],pe()),Y.nextNode(),n.push({type:2,index:++o});V.append(u[g],pe())}}}else if(V.nodeType===8)if(V.data===Eo)n.push({type:2,index:o});else{let u=-1;for(;(u=V.data.indexOf(F,u+1))!==-1;)n.push({type:7,index:o}),u+=F.length-1}o++}}static createElement(e,i){let r=W.createElement("template");return r.innerHTML=e,r}};function $(t,e,i=t,r){var s,A,n;if(e===Z)return e;let V=r!==void 0?(s=i.
|
|
3
|
+
\f\r"'\`<>=]|("|')|))|$)`,"g"),go=/'/g,mo=/"/g,vo=/^(?:script|style|textarea|title)$/i,pi=t=>(e,...i)=>({_$litType$:t,strings:e,values:i}),c=pi(1),kc=pi(2),Nc=pi(3),Z=Symbol.for("lit-noChange"),I=Symbol.for("lit-nothing"),fo=new WeakMap,Y=W.createTreeWalker(W,129);function Co(t,e){if(!li(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return po!==void 0?po.createHTML(e):e}var Xa=(t,e)=>{let i=t.length-1,r=[],V,o=e===2?"<svg>":e===3?"<math>":"",s=ce;for(let A=0;A<i;A++){let n=t[A],d,l,u=-1,g=0;for(;g<n.length&&(s.lastIndex=g,l=s.exec(n),l!==null);)g=s.lastIndex,s===ce?l[1]==="!--"?s=ho:l[1]!==void 0?s=uo:l[2]!==void 0?(vo.test(l[2])&&(V=RegExp("</"+l[2],"g")),s=G):l[3]!==void 0&&(s=G):s===G?l[0]===">"?(s=V!=null?V:ce,u=-1):l[1]===void 0?u=-2:(u=s.lastIndex-l[2].length,d=l[1],s=l[3]===void 0?G:l[3]==='"'?mo:go):s===mo||s===go?s=G:s===ho||s===uo?s=ce:(s=G,V=void 0);let p=s===G&&t[A+1].startsWith("/>")?" ":"";o+=s===ce?n+ja:u>=0?(r.push(d),n.slice(0,u)+Io+n.slice(u)+F+p):n+F+(u===-2?A:p)}return[Co(t,o+(t[i]||"<?>")+(e===2?"</svg>":e===3?"</math>":"")),r]},he=class t{constructor({strings:e,_$litType$:i},r){let V;this.parts=[];let o=0,s=0,A=e.length-1,n=this.parts,[d,l]=Xa(e,i);if(this.el=t.createElement(d,r),Y.currentNode=this.el.content,i===2||i===3){let u=this.el.content.firstChild;u.replaceWith(...u.childNodes)}for(;(V=Y.nextNode())!==null&&n.length<A;){if(V.nodeType===1){if(V.hasAttributes())for(let u of V.getAttributeNames())if(u.endsWith(Io)){let g=l[s++],p=V.getAttribute(u).split(F),w=/([.?@])?(.*)/.exec(g);n.push({type:1,index:o,name:w[2],strings:p,ctor:w[1]==="."?ni:w[1]==="?"?ai:w[1]==="@"?qi:ee}),V.removeAttribute(u)}else u.startsWith(F)&&(n.push({type:6,index:o}),V.removeAttribute(u));if(vo.test(V.tagName)){let u=V.textContent.split(F),g=u.length-1;if(g>0){V.textContent=We?We.emptyScript:"";for(let p=0;p<g;p++)V.append(u[p],pe()),Y.nextNode(),n.push({type:2,index:++o});V.append(u[g],pe())}}}else if(V.nodeType===8)if(V.data===Eo)n.push({type:2,index:o});else{let u=-1;for(;(u=V.data.indexOf(F,u+1))!==-1;)n.push({type:7,index:o}),u+=F.length-1}o++}}static createElement(e,i){let r=W.createElement("template");return r.innerHTML=e,r}};function $(t,e,i=t,r){var s,A,n;if(e===Z)return e;let V=r!==void 0?(s=i.o)==null?void 0:s[r]:i.l,o=de(e)?void 0:e._$litDirective$;return(V==null?void 0:V.constructor)!==o&&((A=V==null?void 0:V._$AO)==null||A.call(V,!1),o===void 0?V=void 0:(V=new o(t),V._$AT(t,i,r)),r!==void 0?((n=i.o)!=null?n:i.o=[])[r]=V:i.l=V),V!==void 0&&(e=$(t,V._$AS(t,e.values),V,r)),e}var Ai=class{constructor(e,i){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=i}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){var d;let{el:{content:i},parts:r}=this._$AD,V=((d=e==null?void 0:e.creationScope)!=null?d:W).importNode(i,!0);Y.currentNode=V;let o=Y.nextNode(),s=0,A=0,n=r[0];for(;n!==void 0;){if(s===n.index){let l;n.type===2?l=new ue(o,o.nextSibling,this,e):n.type===1?l=new n.ctor(o,n.name,n.strings,this,e):n.type===6&&(l=new ci(o,this,e)),this._$AV.push(l),n=r[++A]}s!==(n==null?void 0:n.index)&&(o=Y.nextNode(),s++)}return Y.currentNode=W,V}p(e){let i=0;for(let r of this._$AV)r!==void 0&&(r.strings!==void 0?(r._$AI(e,r,i),i+=r.strings.length-2):r._$AI(e[i])),i++}},ue=class t{get _$AU(){var e,i;return(i=(e=this._$AM)==null?void 0:e._$AU)!=null?i:this.v}constructor(e,i,r,V){var o;this.type=2,this._$AH=I,this._$AN=void 0,this._$AA=e,this._$AB=i,this._$AM=r,this.options=V,this.v=(o=V==null?void 0:V.isConnected)!=null?o:!0}get parentNode(){let e=this._$AA.parentNode,i=this._$AM;return i!==void 0&&(e==null?void 0:e.nodeType)===11&&(e=i.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,i=this){e=$(this,e,i),de(e)?e===I||e==null||e===""?(this._$AH!==I&&this._$AR(),this._$AH=I):e!==this._$AH&&e!==Z&&this._(e):e._$litType$!==void 0?this.$(e):e.nodeType!==void 0?this.T(e):Ha(e)?this.k(e):this._(e)}O(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}T(e){this._$AH!==e&&(this._$AR(),this._$AH=this.O(e))}_(e){this._$AH!==I&&de(this._$AH)?this._$AA.nextSibling.data=e:this.T(W.createTextNode(e)),this._$AH=e}$(e){var o;let{values:i,_$litType$:r}=e,V=typeof r=="number"?this._$AC(e):(r.el===void 0&&(r.el=he.createElement(Co(r.h,r.h[0]),this.options)),r);if(((o=this._$AH)==null?void 0:o._$AD)===V)this._$AH.p(i);else{let s=new Ai(V,this),A=s.u(this.options);s.p(i),this.T(A),this._$AH=s}}_$AC(e){let i=fo.get(e.strings);return i===void 0&&fo.set(e.strings,i=new he(e)),i}k(e){li(this._$AH)||(this._$AH=[],this._$AR());let i=this._$AH,r,V=0;for(let o of e)V===i.length?i.push(r=new t(this.O(pe()),this.O(pe()),this,this.options)):r=i[V],r._$AI(o),V++;V<i.length&&(this._$AR(r&&r._$AB.nextSibling,V),i.length=V)}_$AR(e=this._$AA.nextSibling,i){var r;for((r=this._$AP)==null?void 0:r.call(this,!1,!0,i);e&&e!==this._$AB;){let V=e.nextSibling;e.remove(),e=V}}setConnected(e){var i;this._$AM===void 0&&(this.v=e,(i=this._$AP)==null||i.call(this,e))}},ee=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,i,r,V,o){this.type=1,this._$AH=I,this._$AN=void 0,this.element=e,this.name=i,this._$AM=V,this.options=o,r.length>2||r[0]!==""||r[1]!==""?(this._$AH=Array(r.length-1).fill(new String),this.strings=r):this._$AH=I}_$AI(e,i=this,r,V){let o=this.strings,s=!1;if(o===void 0)e=$(this,e,i,0),s=!de(e)||e!==this._$AH&&e!==Z,s&&(this._$AH=e);else{let A=e,n,d;for(e=o[0],n=0;n<o.length-1;n++)d=$(this,A[r+n],i,n),d===Z&&(d=this._$AH[n]),s||(s=!de(d)||d!==this._$AH[n]),d===I?e=I:e!==I&&(e+=(d!=null?d:"")+o[n+1]),this._$AH[n]=d}s&&!V&&this.j(e)}j(e){e===I?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e!=null?e:"")}},ni=class extends ee{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===I?void 0:e}},ai=class extends ee{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==I)}},qi=class extends ee{constructor(e,i,r,V,o){super(e,i,r,V,o),this.type=5}_$AI(e,i=this){var s;if((e=(s=$(this,e,i,0))!=null?s:I)===Z)return;let r=this._$AH,V=e===I&&r!==I||e.capture!==r.capture||e.once!==r.once||e.passive!==r.passive,o=e!==I&&(r===I||V);V&&this.element.removeEventListener(this.name,this,r),o&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){var i,r;typeof this._$AH=="function"?this._$AH.call((r=(i=this.options)==null?void 0:i.host)!=null?r:this.element,e):this._$AH.handleEvent(e)}},ci=class{constructor(e,i,r){this.element=e,this.type=6,this._$AN=void 0,this._$AM=i,this.options=r}get _$AU(){return this._$AM._$AU}_$AI(e){$(this,e)}};var si=le.litHtmlPolyfillSupport,So;si==null||si(he,ue),((So=le.litHtmlVersions)!=null?So:le.litHtmlVersions=[]).push("3.2.0");var Mo=(t,e,i)=>{var o,s;let r=(o=i==null?void 0:i.renderBefore)!=null?o:e,V=r._$litPart$;if(V===void 0){let A=(s=i==null?void 0:i.renderBefore)!=null?s:null;r._$litPart$=V=new ue(e.insertBefore(pe(),A),A,void 0,i!=null?i:{})}return V._$AI(t),V};var f=class extends b{constructor(){super(...arguments),this.renderOptions={host:this},this.o=void 0}createRenderRoot(){var i,r;let e=super.createRenderRoot();return(r=(i=this.renderOptions).renderBefore)!=null||(i.renderBefore=e.firstChild),e}update(e){let i=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this.o=Mo(i,this.renderRoot,this.renderOptions)}connectedCallback(){var e;super.connectedCallback(),(e=this.o)==null||e.setConnected(!0)}disconnectedCallback(){var e;super.disconnectedCallback(),(e=this.o)==null||e.setConnected(!1)}render(){return Z}},wo;f._$litElement$=!0,f.finalized=!0,(wo=globalThis.litElementHydrateSupport)==null||wo.call(globalThis,{LitElement:f});var di=globalThis.litElementPolyfillSupport;di==null||di({LitElement:f});var xo;((xo=globalThis.litElementVersions)!=null?xo:globalThis.litElementVersions=[]).push("4.1.0");var ge=class extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(this.createTemplate()),this.buttonEle=this.shadowRoot.querySelector("button")}createTemplate(){let e=document.createElement("template");return e.innerHTML=`
|
|
4
4
|
<style>
|
|
5
5
|
.button {
|
|
6
6
|
padding: 6px 16px;
|
|
@@ -1137,7 +1137,7 @@
|
|
|
1137
1137
|
bottom: 36px;
|
|
1138
1138
|
}
|
|
1139
1139
|
}
|
|
1140
|
-
`,v=_a;var q=window.navigator&&window.navigator.userAgent||"",To=/AppleWebKit\/([\d.]+)/i.exec(q),$a=To?parseFloat(To.pop()||"0"):null,yo=/iPad/i.test(q),hi=/iPhone/i.test(q)&&!yo,eq=/iPod/i.test(q),Ze=hi||yo||eq,Xc=Ze&&function(){let t=q.match(/OS (\d+)_/i);return t&&t[1]?t[1]:null}(),te=/Android/i.test(q),Uo=te&&function(){let t=q.match(/Android (\d+)(?:\.(\d+))?(?:\.(\d+))*/i);if(!t)return null;let e=t[1]&&parseFloat(t[1]),i=t[2]&&parseFloat(t[2]);return e&&i?parseFloat(`${t[1]}.${t[2]}`):e||null}(),_c=te&&/webkit/i.test(q)&&Uo<2.3,$c=te&&Uo<5&&$a<537,ie=/Firefox/i.test(q),me=ie&&function(){let t=q.match(/Firefox\/(\d+)/);return t&&t[1]?parseFloat(t[1]):null}(),re=/Edge\//i.test(q),Ro=re&&function(){let t=q.match(/Edge\/(\d+)/i);if(t&&t[1])return t[1]}(),Ve=/Edg\//i.test(q),fe=Ve&&function(){let t=q.match(/Edg\/(\d+)/);return t&&t[1]?parseFloat(t[1]):null}(),Pe=/SogouMobileBrowser\//i.test(q),Do=Pe&&function(){let t=q.match(/SogouMobileBrowser\/(\d+)/);return t&&t[1]?parseFloat(t[1]):null}(),Je=/MetaSr\s/i.test(q),bo=Je&&function(){let t=q.match(/MetaSr(\s\d+(\.\d+)+)/);return t&&t[1]?parseFloat(t[1]):null}(),k=/TBS\/\d+/i.test(q),ko=k&&function(){let t=q.match(/TBS\/(\d+)/i);if(t&&t[1])return t[1]}(),ze=/XWEB\/\d+/i.test(q),No=ze&&function(){let t=q.match(/XWEB\/(\d+)/i);if(t&&t[1])return t[1]}(),el=/MSIE\s8\.0/.test(q),tq=/MSIE\/\d+/i.test(q),tl=tq&&function(){let t=/MSIE\s(\d+)\.\d/.exec(q),e=t&&parseFloat(t[1]);return!e&&/Trident\/7.0/i.test(q)&&/rv:11.0/.test(q)&&(e=11),e}(),il=/windowswechat/i.test(q),ui=/(micromessenger|webbrowser)/i.test(q),Bo=ui&&function(){let t=q.match(/MicroMessenger\/(\d+)/i);if(t&&t[1])return t[1]}(),je=!k&&/MQQBrowser\/\d+/i.test(q)&&/COVC\/\d+/i.test(q),He=!k&&/MQQBrowser\/\d+/i.test(q)&&!/COVC\/\d+/i.test(q),gi=(He||je)&&function(){let t=q.match(/ MQQBrowser\/([\d.]+)/);return t&&t[1]?t[1]:null}(),Xe=!k&&/ QQBrowser\/\d+/i.test(q),Oo=Xe&&function(){let t=q.match(/ QQBrowser\/([\d.]+)/);return t&&t[1]?t[1]:null}(),_e=!k&&/QQBrowserLite\/\d+/i.test(q),Qo=_e&&function(){let t=q.match(/QQBrowserLite\/([\d.]+)/);return t&&t[1]?t[1]:null}(),$e=!k&&/MQBHD\/\d+/i.test(q),Fo=$e&&function(){let t=q.match(/MQBHD\/([\d.]+)/);return t&&t[1]?t[1]:null}(),Lo=/Windows/i.test(q),Ko=!Ze&&/MAC OS X/i.test(q),Go=!te&&/Linux/i.test(q),rl=/MicroMessenger/i.test(q),Yo=/UCBrowser/i.test(q),Vl=/Electron/i.test(q),et=/MiuiBrowser/i.test(q),Wo=et&&function(){let t=q.match(/MiuiBrowser\/([\d.]+)/);return t&&t[1]?t[1]:null}(),tt=/HuaweiBrowser/i.test(q),Zo=tt&&function(){let t=q.match(/HuaweiBrowser\/([\d.]+)/);return t&&t[1]?t[1]:null}(),it=/SamsungBrowser/i.test(q),Po=it&&function(){let t=q.match(/SamsungBrowser\/([\d.]+)/);return t&&t[1]?t[1]:null}(),rt=/HeyTapBrowser/i.test(q),Jo=rt&&function(){let t=q.match(/HeyTapBrowser\/([\d.]+)/);return t&&t[1]?t[1]:null}(),Vt=/VivoBrowser/i.test(q),zo=Vt&&function(){let t=q.match(/VivoBrowser\/([\d.]+)/);return t&&t[1]?t[1]:null}(),iq=/Chrome/i.test(q),P=!re&&!Je&&!Pe&&!k&&!ze&&!Ve&&!Xe&&!et&&!tt&&!it&&!rt&&!Vt&&/Chrome/i.test(q),ol=P&&function(){let t=q.match(/Chrome\/(\d+)/);return t&&t[1]?parseFloat(t[1]):null}(),mi=P&&function(){let t=q.match(/Chrome\/([\d.]+)/);return t&&t[1]?t[1]:null}(),ot=!iq&&!He&&!je&&!_e&&!$e&&/Safari/i.test(q);var fi=ot&&function(){let t=q.match(/Version\/([\d.]+)/);return t&&t[1]?t[1]:null}(),sl=P?`Chrome/${mi}`:ot?`Safari/${fi}`:"NotSupportedBrowser",jo=location.protocol==="file:"||location.hostname==="localhost"||/^\d+\.\d+\.\d+\.\d+$/.test(location.hostname);var Ho=new Map([[te,"Android"],[Ze,"iOS"],[Lo,"Windows"],[Ko,"MacOS"],[Go,"Linux"]]),_o=()=>{let t="unknown";return Ho.get(!0)&&(t=Ho.get(!0)),t},Xo=new Map([[ie,["Firefox",me]],[Ve,["Edg",fe]],[P,["Chrome",mi]],[ot,["Safari",fi]],[k,["TBS",ko]],[ze,["XWEB",No]],[ui&&hi,["WeChat",Bo]],[Xe,["QQ(Win)",Oo]],[He,["QQ(Mobile)",gi]],[je,["QQ(Mobile X5)",gi]],[_e,["QQ(Mac)",Qo]],[$e,["QQ(iPad)",Fo]],[et,["MI",Wo]],[tt,["HW",Zo]],[it,["Samsung",Po]],[rt,["OPPO",Jo]],[Vt,["VIVO",zo]],[re,["EDGE",Ro]],[Pe,["SogouMobile",Do]],[Je,["Sogou",bo]]]),$o=()=>{let t="unknown",e="unknown";return Xo.get(!0)&&([t,e]=Xo.get(!0)),{name:t,version:e}},es=navigator.userAgent,ts=()=>{let t;if(screen.width){let e=screen.width?screen.width*window.devicePixelRatio:"",i=screen.height?screen.height*window.devicePixelRatio:"";t={width:e,height:i}}return t},is=()=>{var t;return(t=window.navigator)==null?void 0:t.hardwareConcurrency},rs=navigator.language||navigator.userLanguage||navigator.browserLanguage||navigator.systemLanguage||"en";var Vs=()=>{var t;return!!((t=navigator.mediaDevices)!=null&&t.getDisplayMedia)},os=()=>{let t={isSupported:!1},e=["AudioContext","webkitAudioContext","mozAudioContext","msAudioContext"];for(let i=0;i<e.length;i++)if(e[i]in window){t.isSupported=!0;break}return t.isSupported},ss=()=>"WebSocket"in window&&window.WebSocket.CLOSING===2,As=()=>Yo||re||Ve&&typeof fe=="number"&&fe<80?!1:!(ie&&me&&me<56),ns=()=>["RTCPeerConnection","webkitRTCPeerConnection","RTCIceGatherer"].filter(e=>e in window).length>0,as=()=>{let t=!1;return["captureStream","mozCaptureStream","webkitCaptureStream"].forEach(e=>{typeof document=="undefined"||typeof document.createElement!="function"||!t&&e in document.createElement("canvas")&&(t=!0)}),t},qs=()=>{let t=!1;return["captureStream","mozCaptureStream","webkitCaptureStream"].forEach(e=>{typeof document=="undefined"||typeof document.createElement!="function"||!t&&e in document.createElement("video")&&(t=!0)}),t},cs=()=>{let t=!1;return ie&&typeof window.mozRTCPeerConnection!="undefined"?"getSenders"in window.mozRTCPeerConnection.prototype&&(t=!0):P&&typeof window.webkitRTCPeerConnection!="undefined"&&"getSenders"in window.webkitRTCPeerConnection.prototype&&(t=!0),t},ls=()=>typeof MediaStreamTrack!="undefined"&&"applyConstraints"in MediaStreamTrack.prototype;var{toString:al}=Object.prototype;var ps=t=>typeof t=="undefined";var Ii,Ei,M=()=>Ii,x=()=>Ei,ds=t=>{Ii=t},hs=t=>{Ei=t},us=()=>{Ii=null,Ei=null};var rq=function(){let t=x();return ps(navigator.mediaDevices)?(t&&t.error("navigator.mediaDevices is not supported on your browser"),!0):!1},Vq=function(){let t=x();return location.protocol==="http:"&&!jo?(t&&t.error("you should use https"),!0):!1},gs=()=>{if(!navigator.mediaDevices)return!1;let t=["getUserMedia","enumerateDevices"];return t.filter(e=>e in navigator.mediaDevices).length===t.length},J=async t=>{if(Vq()||rq())return[];let e=!1,i=!1,r=!1,V=!1,o=!1,s=[],A=[],n=[],d={},l;return t&&(l=await navigator.mediaDevices.getUserMedia(t)),(await navigator.mediaDevices.enumerateDevices()).forEach(g=>{let p={};for(let E in g)try{typeof g[E]!="function"&&(p[E]=g[E])}catch(oe){}let w=p.deviceId||"",N=p.label||"",z=p.kind||"";d[w+N+z]||(p.kind==="audio"&&(p.kind="audioinput"),p.kind==="video"&&(p.kind="videoinput"),p.deviceId||(p.deviceId=p.id),p.label?(p.kind==="videoinput"&&!V&&(V=!0),p.kind==="audioinput"&&!o&&(o=!0)):p.kind==="videoinput"?p.label=`Camera ${n.length+1}`:p.kind==="audioinput"?p.label=`Microphone ${s.length+1}`:p.kind==="audiooutput"?p.label=`Speaker ${A.length+1}`:p.label="Please invoke getUserMedia once.",p.kind==="audioinput"&&(e=!0,s.indexOf(p)===-1&&s.push(p)),p.kind==="audiooutput"&&(i=!0,A.indexOf(p)===-1&&A.push(p)),p.kind==="videoinput"&&(r=!0,n.indexOf(p)===-1&&n.push(p)),d[p.deviceId+p.label+p.kind]=p,l==null||l.getTracks().forEach(E=>E.stop()))}),{hasWebCamPermission:V,hasMicrophonePermission:o,cameras:n,speakers:A,microphones:s}};async function ms(t){return{cameraList:(await J({video:!0,audio:!1})).cameras}}var fs=async t=>({microphoneList:(await J({video:!1,audio:!0})).microphones});async function Ss(){return(await J({video:!1,audio:!0})).speakers}var Is=async()=>{let t={sdp:"",type:"offer"},e=!1,i=!1;try{let r=new RTCPeerConnection,V=document.createElement("canvas");V.getContext("2d");let o=V.captureStream(0);return r.addTrack(o.getVideoTracks()[0],o),t=await r.createOffer(),t&&t.sdp&&(t.sdp.toLowerCase().indexOf("h264")!==-1&&(e=!0),t.sdp.toLowerCase().indexOf("vp8")!==-1&&(i=!0)),r.close(),{isH264EncodeSupported:e,isVp8EncodeSupported:i}}catch(r){return{isH264EncodeSupported:!1,isVp8EncodeSupported:!1}}},Es=async()=>{let t={sdp:"",type:"offer"},e=!1,i=!1;try{let r=new RTCPeerConnection;return t=await r.createOffer({offerToReceiveAudio:!0,offerToReceiveVideo:!0}),t&&t.sdp&&(t.sdp.toLowerCase().indexOf("h264")!==-1&&(e=!0),t.sdp.toLowerCase().indexOf("vp8")!==-1&&(i=!0)),r.close(),{isH264DecodeSupported:e,isVp8DecodeSupported:i}}catch(r){return{isH264DecodeSupported:!1,isVp8DecodeSupported:!1}}};async function vi(){return new Promise(async(t,e)=>{try{let z=function(){clearInterval(w),clearInterval(o),clearTimeout(N),A.close(),n.close(),s.getTracks().forEach(E=>E.stop())};var i=z;let r=document.createElement("canvas"),V=r.getContext("2d");r.width=640,r.height=480;let o=setInterval(()=>{V&&V.fillText("test",0,0)},33),s=r.captureStream(15),A=new RTCPeerConnection({}),n=new RTCPeerConnection({});A.addEventListener("icecandidate",E=>{n.addIceCandidate(E.candidate)}),n.addEventListener("icecandidate",E=>{A.addIceCandidate(E.candidate)});let d=RTCRtpSender.getCapabilities("video"),u=(d?d.codecs:[]).find(E=>E.mimeType==="video/H264");A.addTransceiver(s.getVideoTracks()[0],{direction:"sendonly",streams:[s],sendEncodings:[{maxBitrate:500*1e3}]}),n.addTransceiver("video",{direction:"recvonly"}),u&&A.getTransceivers()[0].setCodecPreferences([u].filter(E=>E!==void 0));let g=await A.createOffer();await A.setLocalDescription(g),await n.setRemoteDescription(g);let p=await n.createAnswer();await n.setLocalDescription(p),await A.setRemoteDescription(p);let w=-1,N=-1;N=setTimeout(()=>{z(),t(!1)},30*1e3),w=setInterval(async()=>{(await A.getStats()).forEach(oe=>{oe.type==="outbound-rtp"&&oe.mediaType==="video"&&(typeof oe.encoderImplementation=="undefined"&&(z(),e(new Error("your browser does not support to detect HW acceleration enabled."))),oe.encoderImplementation==="ExternalEncoder"&&(z(),t(!0)))})},500)}catch(r){e(r)}})}var oq={system:null,APISupported:null,devices:null,codecsSupported:null,report:null,networkInfo:null,TRTCInitDone:!1,mirror:!1,async getReportAsync(){return this.getSystem(),this.getAPISupported(),await this.getCodecAsync(),await this.getDevicesAsync(),this.report={system:this.system,APISupported:this.APISupported,codecsSupported:this.codecsSupported,devices:this.devices},this.report},async isTRTCSupported(){await this.getReportAsync();let{isWebRTCSupported:t,isUserMediaSupported:e,isWebSocketSupported:i}=this.APISupported;if(!t)return{result:!1,reason:"you browser does not support WebRTC."};if(!i)return{result:!1,reason:"you browser does not support WebSocket."};if(!e)return{result:!1,reason:"you browser does not support getUserMedia."};let{isH264EncodeSupported:r,isVp8EncodeSupported:V,isH264DecodeSupported:o,isVp8DecodeSupported:s}=this.codecsSupported;return!r&&!V?{result:!1,reason:`isH264EncodeSupported: ${r} isVp8EncodeSupported: ${V} `}:!o&&!s?{result:!1,reason:`isH264DecodeSupported: ${o} isVp8DecodeSupported: ${s} `}:As()?{result:!0}:{result:!1,reason:"your browser does not qualify, it is recommended to use Chrome and firefox."}},async getCodecAsync(){let{isH264EncodeSupported:t,isVp8EncodeSupported:e}=await Is(),{isH264DecodeSupported:i,isVp8DecodeSupported:r}=await Es();return this.codecsSupported={isH264EncodeSupported:t,isVp8EncodeSupported:e,isH264DecodeSupported:i,isVp8DecodeSupported:r},this.codecsSupported},async getDevicesAsync(){let{hasWebCamPermission:t,hasMicrophonePermission:e,cameras:i,microphones:r,speakers:V}=await J();return this.devices={cameras:i,microphones:r,speakers:V||[],hasWebCamPermission:t,hasMicrophonePermission:e},this.devices},getSystem(){return this.system={UA:es,OS:_o(),browser:$o(),displayResolution:ts(),hardwareConcurrency:is(),language:rs},this.system},getAPISupported(){return this.APISupported={isUserMediaSupported:gs(),isWebRTCSupported:ns(),isWebSocketSupported:ss(),isWebAudioSupported:os(),isScreenCaptureAPISupported:Vs(),isCanvasCapturingSupported:as(),isVideoCapturingSupported:qs(),isRTPSenderReplaceTracksSupported:cs(),isApplyConstraintsSupported:ls()},this.APISupported},async isHardWareAccelerationEnabled(){return await vi()}},m=oq;function vs(){let t=`https://web.sdk.qcloud.com/trtc/electron/download/resources/media/TestSpeaker.mp3?t=${new Date().getTime()}`,e=3e3;return Promise.race([fetch(t,{mode:"cors"}),new Promise((i,r)=>setTimeout(()=>r(!1),e))]).then(i=>{if(!i.ok)throw new Error("\u7F51\u7EDC\u9519\u8BEF");return!0}).catch(()=>!1)}var Cs={0:"\u672A\u77E5",1:"\u6781\u4F73",2:"\u8F83\u597D",3:"\u4E00\u822C",4:"\u5DEE",5:"\u6781\u5DEE",6:"\u65AD\u5F00"},Ms={0:"Unknown",1:"Excellent",2:"Good",3:"Average",4:"Poor",5:"Very Poor",6:"Disconnected"},Ci=t=>{let i=(navigator.language||navigator.userLanguage||navigator.browserLanguage||navigator.systemLanguage||"en").indexOf("zh")>-1,r=x();switch(r.error("getUserMedia error",t),t.name){case"NotReadableError":i?r.error("\u6682\u65F6\u65E0\u6CD5\u8BBF\u95EE\u6444\u50CF\u5934/\u9EA6\u514B\u98CE\uFF0C\u8BF7\u786E\u4FDD\u7CFB\u7EDF\u6388\u4E88\u5F53\u524D\u6D4F\u89C8\u5668\u6444\u50CF\u5934/\u9EA6\u514B\u98CE\u6743\u9650\uFF0C\u5E76\u4E14\u6CA1\u6709\u5176\u4ED6\u5E94\u7528\u5360\u7528\u6444\u50CF\u5934/\u9EA6\u514B\u98CE"):r.error("Cannot access camera/microphone temporarily. Please make sure the system has granted the current browser permission to access the camera/microphone and no other application is using the camera/microphone");return;case"NotAllowedError":i?r.error("\u7528\u6237/\u7CFB\u7EDF\u5DF2\u62D2\u7EDD\u6388\u6743\u8BBF\u95EE\u6444\u50CF\u5934\u6216\u9EA6\u514B\u98CE"):r.error("User/system has denied access to camera/microphone");return;case"NotFoundError":i?r.error("\u627E\u4E0D\u5230\u6444\u50CF\u5934\u6216\u9EA6\u514B\u98CE\u8BBE\u5907"):r.error("Cannot find camera or microphone device");return;case"OverConstrainedError":i?r.error("\u91C7\u96C6\u5C5E\u6027\u8BBE\u7F6E\u9519\u8BEF\uFF0C\u5982\u679C\u60A8\u6307\u5B9A\u4E86 cameraId/microphoneId\uFF0C\u8BF7\u786E\u4FDD\u5B83\u4EEC\u662F\u4E00\u4E2A\u6709\u6548\u7684\u975E\u7A7A\u5B57\u7B26\u4E32"):r.error("Capture attribute setting error. If you specified cameraId/microphoneId, please make sure they are valid non-empty strings");return;default:i?r.error("\u521D\u59CB\u5316\u672C\u5730\u6D41\u65F6\u9047\u5230\u672A\u77E5\u9519\u8BEF, \u8BF7\u91CD\u8BD5"):r.error("Unknown error encountered when initializing local stream, please try again");return}};var S=class S extends f{constructor(){super(),this.progress=0,this.remindAnimation=!1;let e=navigator.language||navigator.userLanguage||navigator.browserLanguage||navigator.systemLanguage||"en";this.isChinese=e.indexOf("zh")>-1,this.showConnectResult=!1,this.connectResult={info:this.isChinese?"\u8FDE\u63A5\u51FA\u9519\uFF0C\u8BF7\u91CD\u8BD5":"Connection error, please try again",success:!1,remind:this.isMobile?this.isChinese?S.mobileFailAttention:S.mobileFailAttentionEng:this.isChinese?S.deviceFailAttention:S.deviceFailAttentionEng},this.envresult=m.getSystem(),this.isMobile=this.envresult.OS==="iOS"||this.envresult.OS==="Android",this.isFirefoxOrSafariOrIOS=this.envresult.browser.name==="Firefox"||this.envresult.OS==="iOS"||this.envresult.browser.name==="Safari",this.deviceState={},this.showRemind=!1,this.startTime=new Date().getTime(),this.attachShadow({mode:"open"})}render(){return c`
|
|
1140
|
+
`,v=_a;var q=window.navigator&&window.navigator.userAgent||"",To=/AppleWebKit\/([\d.]+)/i.exec(q),$a=To?parseFloat(To.pop()||"0"):null,yo=/iPad/i.test(q),hi=/iPhone/i.test(q)&&!yo,eq=/iPod/i.test(q),Ze=hi||yo||eq,Xc=Ze&&function(){let t=q.match(/OS (\d+)_/i);return t&&t[1]?t[1]:null}(),te=/Android/i.test(q),Uo=te&&function(){let t=q.match(/Android (\d+)(?:\.(\d+))?(?:\.(\d+))*/i);if(!t)return null;let e=t[1]&&parseFloat(t[1]),i=t[2]&&parseFloat(t[2]);return e&&i?parseFloat(`${t[1]}.${t[2]}`):e||null}(),_c=te&&/webkit/i.test(q)&&Uo<2.3,$c=te&&Uo<5&&$a<537,ie=/Firefox/i.test(q),me=ie&&function(){let t=q.match(/Firefox\/(\d+)/);return t&&t[1]?parseFloat(t[1]):null}(),re=/Edge\//i.test(q),Ro=re&&function(){let t=q.match(/Edge\/(\d+)/i);if(t&&t[1])return t[1]}(),Ve=/Edg\//i.test(q),fe=Ve&&function(){let t=q.match(/Edg\/(\d+)/);return t&&t[1]?parseFloat(t[1]):null}(),Pe=/SogouMobileBrowser\//i.test(q),Do=Pe&&function(){let t=q.match(/SogouMobileBrowser\/(\d+)/);return t&&t[1]?parseFloat(t[1]):null}(),Je=/MetaSr\s/i.test(q),bo=Je&&function(){let t=q.match(/MetaSr(\s\d+(\.\d+)+)/);return t&&t[1]?parseFloat(t[1]):null}(),k=/TBS\/\d+/i.test(q),ko=k&&function(){let t=q.match(/TBS\/(\d+)/i);if(t&&t[1])return t[1]}(),ze=/XWEB\/\d+/i.test(q),No=ze&&function(){let t=q.match(/XWEB\/(\d+)/i);if(t&&t[1])return t[1]}(),el=/MSIE\s8\.0/.test(q),tq=/MSIE\/\d+/i.test(q),tl=tq&&function(){let t=/MSIE\s(\d+)\.\d/.exec(q),e=t&&parseFloat(t[1]);return!e&&/Trident\/7.0/i.test(q)&&/rv:11.0/.test(q)&&(e=11),e}(),il=/windowswechat/i.test(q),ui=/(micromessenger|webbrowser)/i.test(q),Bo=ui&&function(){let t=q.match(/MicroMessenger\/(\d+)/i);if(t&&t[1])return t[1]}(),je=!k&&/MQQBrowser\/\d+/i.test(q)&&/COVC\/\d+/i.test(q),He=!k&&/MQQBrowser\/\d+/i.test(q)&&!/COVC\/\d+/i.test(q),gi=(He||je)&&function(){let t=q.match(/ MQQBrowser\/([\d.]+)/);return t&&t[1]?t[1]:null}(),Xe=!k&&/ QQBrowser\/\d+/i.test(q),Oo=Xe&&function(){let t=q.match(/ QQBrowser\/([\d.]+)/);return t&&t[1]?t[1]:null}(),_e=!k&&/QQBrowserLite\/\d+/i.test(q),Qo=_e&&function(){let t=q.match(/QQBrowserLite\/([\d.]+)/);return t&&t[1]?t[1]:null}(),$e=!k&&/MQBHD\/\d+/i.test(q),Fo=$e&&function(){let t=q.match(/MQBHD\/([\d.]+)/);return t&&t[1]?t[1]:null}(),Lo=/Windows/i.test(q),Ko=!Ze&&/MAC OS X/i.test(q),Go=!te&&/Linux/i.test(q),rl=/MicroMessenger/i.test(q),Yo=/UCBrowser/i.test(q),Vl=/Electron/i.test(q),et=/MiuiBrowser/i.test(q),Wo=et&&function(){let t=q.match(/MiuiBrowser\/([\d.]+)/);return t&&t[1]?t[1]:null}(),tt=/HuaweiBrowser/i.test(q),Zo=tt&&function(){let t=q.match(/HuaweiBrowser\/([\d.]+)/);return t&&t[1]?t[1]:null}(),it=/SamsungBrowser/i.test(q),Po=it&&function(){let t=q.match(/SamsungBrowser\/([\d.]+)/);return t&&t[1]?t[1]:null}(),rt=/HeyTapBrowser/i.test(q),Jo=rt&&function(){let t=q.match(/HeyTapBrowser\/([\d.]+)/);return t&&t[1]?t[1]:null}(),Vt=/VivoBrowser/i.test(q),zo=Vt&&function(){let t=q.match(/VivoBrowser\/([\d.]+)/);return t&&t[1]?t[1]:null}(),iq=/Chrome/i.test(q),P=!re&&!Je&&!Pe&&!k&&!ze&&!Ve&&!Xe&&!et&&!tt&&!it&&!rt&&!Vt&&/Chrome/i.test(q),ol=P&&function(){let t=q.match(/Chrome\/(\d+)/);return t&&t[1]?parseFloat(t[1]):null}(),mi=P&&function(){let t=q.match(/Chrome\/([\d.]+)/);return t&&t[1]?t[1]:null}(),ot=!iq&&!He&&!je&&!_e&&!$e&&/Safari/i.test(q);var fi=ot&&function(){let t=q.match(/Version\/([\d.]+)/);return t&&t[1]?t[1]:null}(),sl=P?`Chrome/${mi}`:ot?`Safari/${fi}`:"NotSupportedBrowser",jo=location.protocol==="file:"||location.hostname==="localhost"||/^\d+\.\d+\.\d+\.\d+$/.test(location.hostname);var Ho=new Map([[te,"Android"],[Ze,"iOS"],[Lo,"Windows"],[Ko,"MacOS"],[Go,"Linux"]]),_o=()=>{let t="unknown";return Ho.get(!0)&&(t=Ho.get(!0)),t},Xo=new Map([[ie,["Firefox",me]],[Ve,["Edg",fe]],[P,["Chrome",mi]],[ot,["Safari",fi]],[k,["TBS",ko]],[ze,["XWEB",No]],[ui&&hi,["WeChat",Bo]],[Xe,["QQ(Win)",Oo]],[He,["QQ(Mobile)",gi]],[je,["QQ(Mobile X5)",gi]],[_e,["QQ(Mac)",Qo]],[$e,["QQ(iPad)",Fo]],[et,["MI",Wo]],[tt,["HW",Zo]],[it,["Samsung",Po]],[rt,["OPPO",Jo]],[Vt,["VIVO",zo]],[re,["EDGE",Ro]],[Pe,["SogouMobile",Do]],[Je,["Sogou",bo]]]),$o=()=>{let t="unknown",e="unknown";return Xo.get(!0)&&([t,e]=Xo.get(!0)),{name:t,version:e}},es=navigator.userAgent,ts=()=>{let t;if(screen.width){let e=screen.width?screen.width*window.devicePixelRatio:"",i=screen.height?screen.height*window.devicePixelRatio:"";t={width:e,height:i}}return t},is=()=>{var t;return(t=window.navigator)==null?void 0:t.hardwareConcurrency},rs=navigator.language||navigator.userLanguage||navigator.browserLanguage||navigator.systemLanguage||"en";var Vs=()=>{var t;return!!((t=navigator.mediaDevices)!=null&&t.getDisplayMedia)},os=()=>{let t={isSupported:!1},e=["AudioContext","webkitAudioContext","mozAudioContext","msAudioContext"];for(let i=0;i<e.length;i++)if(e[i]in window){t.isSupported=!0;break}return t.isSupported},ss=()=>"WebSocket"in window&&window.WebSocket.CLOSING===2,As=()=>Yo||re||Ve&&typeof fe=="number"&&fe<80?!1:!(ie&&me&&me<56),ns=()=>["RTCPeerConnection","webkitRTCPeerConnection","RTCIceGatherer"].filter(e=>e in window).length>0,as=()=>{let t=!1;return["captureStream","mozCaptureStream","webkitCaptureStream"].forEach(e=>{typeof document=="undefined"||typeof document.createElement!="function"||!t&&e in document.createElement("canvas")&&(t=!0)}),t},qs=()=>{let t=!1;return["captureStream","mozCaptureStream","webkitCaptureStream"].forEach(e=>{typeof document=="undefined"||typeof document.createElement!="function"||!t&&e in document.createElement("video")&&(t=!0)}),t},cs=()=>{let t=!1;return ie&&typeof window.mozRTCPeerConnection!="undefined"?"getSenders"in window.mozRTCPeerConnection.prototype&&(t=!0):P&&typeof window.webkitRTCPeerConnection!="undefined"&&"getSenders"in window.webkitRTCPeerConnection.prototype&&(t=!0),t},ls=()=>typeof MediaStreamTrack!="undefined"&&"applyConstraints"in MediaStreamTrack.prototype;var{toString:al}=Object.prototype;var ps=t=>typeof t=="undefined";var Ii,Ei,M=()=>Ii,x=()=>Ei,ds=t=>{Ii=t},hs=t=>{Ei=t},us=()=>{Ii=null,Ei=null};var rq=function(){let t=x();return ps(navigator.mediaDevices)?(t&&t.error("navigator.mediaDevices is not supported on your browser"),!0):!1},Vq=function(){let t=x();return location.protocol==="http:"&&!jo?(t&&t.error("you should use https"),!0):!1},gs=()=>{if(!navigator.mediaDevices)return!1;let t=["getUserMedia","enumerateDevices"];return t.filter(e=>e in navigator.mediaDevices).length===t.length},J=async t=>{if(Vq()||rq())return[];let e=!1,i=!1,r=!1,V=!1,o=!1,s=[],A=[],n=[],d={},l;return t&&(l=await navigator.mediaDevices.getUserMedia(t)),(await navigator.mediaDevices.enumerateDevices()).forEach(g=>{let p={};for(let E in g)try{typeof g[E]!="function"&&(p[E]=g[E])}catch(oe){}let w=p.deviceId||"",N=p.label||"",z=p.kind||"";d[w+N+z]||(p.kind==="audio"&&(p.kind="audioinput"),p.kind==="video"&&(p.kind="videoinput"),p.deviceId||(p.deviceId=p.id),p.label?(p.kind==="videoinput"&&!V&&(V=!0),p.kind==="audioinput"&&!o&&(o=!0)):p.kind==="videoinput"?p.label=`Camera ${n.length+1}`:p.kind==="audioinput"?p.label=`Microphone ${s.length+1}`:p.kind==="audiooutput"?p.label=`Speaker ${A.length+1}`:p.label="Please invoke getUserMedia once.",p.kind==="audioinput"&&(e=!0,s.indexOf(p)===-1&&s.push(p)),p.kind==="audiooutput"&&(i=!0,A.indexOf(p)===-1&&A.push(p)),p.kind==="videoinput"&&(r=!0,n.indexOf(p)===-1&&n.push(p)),d[p.deviceId+p.label+p.kind]=p,l==null||l.getTracks().forEach(E=>E.stop()))}),{hasWebCamPermission:V,hasMicrophonePermission:o,cameras:n,speakers:A,microphones:s}};async function ms(t){return{cameraList:(await J({video:!0,audio:!1})).cameras}}var fs=async t=>({microphoneList:(await J({video:!1,audio:!0})).microphones});async function Ss(){return(await J({video:!1,audio:!0})).speakers}var Is=async()=>{let t={sdp:"",type:"offer"},e=!1,i=!1;try{let r=new RTCPeerConnection,V=document.createElement("canvas");V.getContext("2d");let o=V.captureStream(0);return r.addTrack(o.getVideoTracks()[0],o),t=await r.createOffer(),t&&t.sdp&&(t.sdp.toLowerCase().indexOf("h264")!==-1&&(e=!0),t.sdp.toLowerCase().indexOf("vp8")!==-1&&(i=!0)),r.close(),{isH264EncodeSupported:e,isVp8EncodeSupported:i}}catch(r){return{isH264EncodeSupported:!1,isVp8EncodeSupported:!1}}},Es=async()=>{let t={sdp:"",type:"offer"},e=!1,i=!1;try{let r=new RTCPeerConnection;return t=await r.createOffer({offerToReceiveAudio:!0,offerToReceiveVideo:!0}),t&&t.sdp&&(t.sdp.toLowerCase().indexOf("h264")!==-1&&(e=!0),t.sdp.toLowerCase().indexOf("vp8")!==-1&&(i=!0)),r.close(),{isH264DecodeSupported:e,isVp8DecodeSupported:i}}catch(r){return{isH264DecodeSupported:!1,isVp8DecodeSupported:!1}}};async function vi(){return new Promise(async(t,e)=>{try{let z=function(){clearInterval(w),clearInterval(o),clearTimeout(N),A.close(),n.close(),s.getTracks().forEach(E=>E.stop())};var i=z;let r=document.createElement("canvas"),V=r.getContext("2d");r.width=640,r.height=480;let o=setInterval(()=>{V&&V.fillText("test",0,0)},33),s=r.captureStream(15),A=new RTCPeerConnection({}),n=new RTCPeerConnection({});A.addEventListener("icecandidate",E=>{n.addIceCandidate(E.candidate)}),n.addEventListener("icecandidate",E=>{A.addIceCandidate(E.candidate)});let d=RTCRtpSender.getCapabilities("video"),u=(d?d.codecs:[]).find(E=>E.mimeType==="video/H264");A.addTransceiver(s.getVideoTracks()[0],{direction:"sendonly",streams:[s],sendEncodings:[{maxBitrate:500*1e3}]}),n.addTransceiver("video",{direction:"recvonly"}),u&&A.getTransceivers()[0].setCodecPreferences([u].filter(E=>E!==void 0));let g=await A.createOffer();await A.setLocalDescription(g),await n.setRemoteDescription(g);let p=await n.createAnswer();await n.setLocalDescription(p),await A.setRemoteDescription(p);let w=-1,N=-1;N=setTimeout(()=>{z(),t(!1)},30*1e3),w=setInterval(async()=>{(await A.getStats()).forEach(oe=>{oe.type==="outbound-rtp"&&oe.mediaType==="video"&&(typeof oe.encoderImplementation=="undefined"&&(z(),e(new Error("your browser does not support to detect HW acceleration enabled."))),oe.encoderImplementation==="ExternalEncoder"&&(z(),t(!0)))})},500)}catch(r){e(r)}})}var oq={system:null,APISupported:null,devices:null,codecsSupported:null,report:null,networkInfo:null,TRTCInitDone:!1,mirror:!1,async getReportAsync(){return this.getSystem(),this.getAPISupported(),await this.getCodecAsync(),await this.getDevicesAsync(),this.report={system:this.system,APISupported:this.APISupported,codecsSupported:this.codecsSupported,devices:this.devices},this.report},async isTRTCSupported(){await this.getReportAsync();let{isWebRTCSupported:t,isUserMediaSupported:e,isWebSocketSupported:i}=this.APISupported;if(!t)return{result:!1,reason:"you browser does not support WebRTC."};if(!i)return{result:!1,reason:"you browser does not support WebSocket."};if(!e)return{result:!1,reason:"you browser does not support getUserMedia."};let{isH264EncodeSupported:r,isVp8EncodeSupported:V,isH264DecodeSupported:o,isVp8DecodeSupported:s}=this.codecsSupported;return!r&&!V?{result:!1,reason:`isH264EncodeSupported: ${r} isVp8EncodeSupported: ${V} `}:!o&&!s?{result:!1,reason:`isH264DecodeSupported: ${o} isVp8DecodeSupported: ${s} `}:As()?{result:!0}:{result:!1,reason:"your browser does not qualify, it is recommended to use Chrome and firefox."}},async getCodecAsync(){let{isH264EncodeSupported:t,isVp8EncodeSupported:e}=await Is(),{isH264DecodeSupported:i,isVp8DecodeSupported:r}=await Es();return this.codecsSupported={isH264EncodeSupported:t,isVp8EncodeSupported:e,isH264DecodeSupported:i,isVp8DecodeSupported:r},this.codecsSupported},async getDevicesAsync(){let{hasWebCamPermission:t,hasMicrophonePermission:e,cameras:i,microphones:r,speakers:V}=await J();return this.devices={cameras:i,microphones:r,speakers:V||[],hasWebCamPermission:t,hasMicrophonePermission:e},this.devices},getSystem(){return this.system={UA:es,OS:_o(),browser:$o(),displayResolution:ts(),hardwareConcurrency:is(),language:rs},this.system},getAPISupported(){return this.APISupported={isUserMediaSupported:gs(),isWebRTCSupported:ns(),isWebSocketSupported:ss(),isWebAudioSupported:os(),isScreenCaptureAPISupported:Vs(),isCanvasCapturingSupported:as(),isVideoCapturingSupported:qs(),isRTPSenderReplaceTracksSupported:cs(),isApplyConstraintsSupported:ls()},this.APISupported},async isHardWareAccelerationEnabled(){return await vi()}},m=oq;function vs(){let t=`https://web.sdk.qcloud.com/trtc/electron/download/resources/media/TestSpeaker.mp3?t=${new Date().getTime()}`,e=3e3;return Promise.race([fetch(t,{mode:"cors"}),new Promise((i,r)=>setTimeout(()=>r(!1),e))]).then(i=>{if(!i.ok)throw new Error("\u7F51\u7EDC\u9519\u8BEF");return!0}).catch(()=>!1)}var Cs={0:"\u672A\u77E5",1:"\u6781\u4F73",2:"\u8F83\u597D",3:"\u4E00\u822C",4:"\u5DEE",5:"\u6781\u5DEE",6:"\u65AD\u5F00"},Ms={0:"Unknown",1:"Excellent",2:"Good",3:"Average",4:"Poor",5:"Very Poor",6:"Disconnected"},Ci=t=>{let i=(navigator.language||navigator.userLanguage||navigator.browserLanguage||navigator.systemLanguage||"en").indexOf("zh")>-1,r=x();switch(r.error("getUserMedia error",t),t.name){case"NotReadableError":i?r.error("\u6682\u65F6\u65E0\u6CD5\u8BBF\u95EE\u6444\u50CF\u5934/\u9EA6\u514B\u98CE\uFF0C\u8BF7\u786E\u4FDD\u7CFB\u7EDF\u6388\u4E88\u5F53\u524D\u6D4F\u89C8\u5668\u6444\u50CF\u5934/\u9EA6\u514B\u98CE\u6743\u9650\uFF0C\u5E76\u4E14\u6CA1\u6709\u5176\u4ED6\u5E94\u7528\u5360\u7528\u6444\u50CF\u5934/\u9EA6\u514B\u98CE"):r.error("Cannot access camera/microphone temporarily. Please make sure the system has granted the current browser permission to access the camera/microphone and no other application is using the camera/microphone");return;case"NotAllowedError":i?r.error("\u7528\u6237/\u7CFB\u7EDF\u5DF2\u62D2\u7EDD\u6388\u6743\u8BBF\u95EE\u6444\u50CF\u5934\u6216\u9EA6\u514B\u98CE"):r.error("User/system has denied access to camera/microphone");return;case"NotFoundError":i?r.error("\u627E\u4E0D\u5230\u6444\u50CF\u5934\u6216\u9EA6\u514B\u98CE\u8BBE\u5907"):r.error("Cannot find camera or microphone device");return;case"OverConstrainedError":i?r.error("\u91C7\u96C6\u5C5E\u6027\u8BBE\u7F6E\u9519\u8BEF\uFF0C\u5982\u679C\u60A8\u6307\u5B9A\u4E86 cameraId/microphoneId\uFF0C\u8BF7\u786E\u4FDD\u5B83\u4EEC\u662F\u4E00\u4E2A\u6709\u6548\u7684\u975E\u7A7A\u5B57\u7B26\u4E32"):r.error("Capture attribute setting error. If you specified cameraId/microphoneId, please make sure they are valid non-empty strings");return;default:i?r.error("\u521D\u59CB\u5316\u672C\u5730\u6D41\u65F6\u9047\u5230\u672A\u77E5\u9519\u8BEF, \u8BF7\u91CD\u8BD5"):r.error("Unknown error encountered when initializing local stream, please try again");return}};var S=class S extends f{constructor(){super(),this.progress=0,this.remindAnimation=!1;let e=navigator.language||navigator.userLanguage||navigator.browserLanguage||navigator.systemLanguage||"en";this.isChinese=e.indexOf("zh")>-1,this.showConnectResult=!1,this.connectResult={info:this.isChinese?"\u8FDE\u63A5\u51FA\u9519\uFF0C\u8BF7\u91CD\u8BD5":"Connection error, please try again",success:!1,remind:this.isMobile?this.isChinese?S.mobileFailAttention:S.mobileFailAttentionEng:this.isChinese?S.deviceFailAttention:S.deviceFailAttentionEng},this.envresult=m.getSystem(),this.isMobile=this.envresult.OS==="iOS"||this.envresult.OS==="Android",this.isFirefoxOrIOS=this.envresult.browser.name==="Firefox"||this.envresult.OS==="iOS",this.deviceState={},this.showRemind=!1,this.startTime=new Date().getTime(),this.attachShadow({mode:"open"})}render(){return c`
|
|
1141
1141
|
<style>${v}</style>
|
|
1142
1142
|
<div class="device-connect">
|
|
1143
1143
|
<div class="testing-title">${this.isChinese?"\u8BBE\u5907\u8FDE\u63A5":"Device Connection"}</div>
|
|
@@ -1196,7 +1196,7 @@
|
|
|
1196
1196
|
</div>
|
|
1197
1197
|
`}setShowRemind(e){this.showRemind=e,this.requestUpdate()}firstUpdated(){this.getDeviceConnectResult(),this.stepNameList=JSON.parse(this.getAttribute("stepnamelist")),this.judgeList(this.stepNameList);let e=this.shadowRoot.querySelector(".testing-prepare-info");e.innerHTML=this.prepareInfo()}updated(){this.showRemind&&(this.shadowRoot.querySelector(".connect-attention-info").innerHTML=this.connectResult.remind)}hasCameraDetect(){return this.stepNameList.indexOf("camera")>=0}hasMicrophoneDetect(){return this.stepNameList.indexOf("microphone")>=0}hasSpeakerDetect(){return this.stepNameList.indexOf("speaker")>=0}hasNetworkDetect(){return this.stepNameList.indexOf("network")>=0}showReconnectButton(){let{deviceState:e}=this;return this.showConnectResult&&!(e.hasCameraConnect&&e.hasMicrophoneConnect&&e.hasSpeakerConnect&&e.hasNetworkConnect)}showStartDetectButton(){let{deviceState:e}=this;return this.showConnectResult&&e.hasCameraConnect&&e.hasMicrophoneConnect&&e.hasSpeakerConnect&&e.hasNetworkConnect}handler(e){let i=this.shadowRoot.querySelector(".inner-progress");e||(this.progressInterval&&clearInterval(this.progressInterval),this.progressInterval=setInterval(()=>{if(this.progress+=10,i.style.transform=`translateX(${this.progress}%)`,this.progress===100){this.progress=0,i.style.transform="translateX(0%)";let r=new CustomEvent("remind-changed",{detail:this.remindAnimation});this.dispatchEvent(r),setTimeout(()=>{this.remindAnimation&&this.isMobile&&(this.isChinese?alert(S.mobileFailAttention.replace(/<br>/g,`
|
|
1198
1198
|
`)):alert(S.mobileFailAttentionEng.replace(/<br>/g,`
|
|
1199
|
-
`)))},200),this.showConnectResult=!0,this.setAttribute("showconnectresult",this.showConnectResult),clearInterval(this.progressInterval)}},150))}prepareInfo(){return this.isChinese?`\u8BBE\u5907\u68C0\u6D4B\u524D\u8BF7\u786E\u8BA4\u8BBE\u5907\u8FDE\u63A5\u4E86${this.hasCameraDetect()?"\u6444\u50CF\u5934":""}${this.hasMicrophoneDetect()?"\u3001\u9EA6\u514B\u98CE":""}${this.hasSpeakerDetect()?"\u3001\u626C\u58F0\u5668":""}${this.hasNetworkDetect()?"\u548C\u7F51\u7EDC":""}`:`Make sure the device is connected before testing the device ${this.hasCameraDetect()?"camera":""}${this.hasMicrophoneDetect()?", microphone":""}${this.hasSpeakerDetect()?", speaker":""}${this.hasNetworkDetect()?" and network":""}`}judgeList(e){let i=this.shadowRoot.querySelector(".camerasvg"),r=this.shadowRoot.querySelector(".microphonesvg"),V=this.shadowRoot.querySelector(".speakersvg"),o=this.shadowRoot.querySelector(".networksvg");e.indexOf("camera")>=0?i.style.display="block":i.style.display="none",e.indexOf("microphone")>=0?r.style.display="block":r.style.display="none",e.indexOf("speaker")>=0?V.style.display="block":V.style.display="none",e.indexOf("network")>=0?o.style.display="block":o.style.display="none"}async getDeviceConnectResult(){let e=[],i=[],r=[];try{let{cameras:l,speakers:u,microphones:g}=await J();e=l,i=g,r=u}catch(l){}let V=e.length>0,o=i.length>0,s=this.hasSpeakerDetect()?this.isFirefoxOrSafariOrIOS||r.length>0:!0,A=this.hasNetworkDetect()?await vs():!0,n={hasCameraDevice:V,hasMicrophoneDevice:o,hasSpeakerDevice:s,hasNetworkConnect:A,hasCameraConnect:!1,hasMicrophoneConnect:!1,hasSpeakerConnect:s};this.deviceState=n,this.remindAnimation=!1,this.connectResult=this.getDeviceConnectInfo(n);let d=[];V&&d.push(new Promise((l,u)=>{navigator.mediaDevices.getUserMedia({video:!0,audio:!1}).then(g=>{this.remindAnimation=!1,n=H(j({},n),{hasCameraConnect:!0}),this.deviceState=n,this.connectResult=this.getDeviceConnectInfo(n),g.getTracks()[0].stop(),l()}).catch(g=>{Ci(g),l()})})),o&&d.push(new Promise((l,u)=>{navigator.mediaDevices.getUserMedia({video:!1,audio:!0}).then(g=>{this.remindAnimation=!1,n=H(j({},n),{hasMicrophoneConnect:o}),this.deviceState=n,this.connectResult=this.getDeviceConnectInfo(n),g.getTracks()[0].stop(),l()}).catch(g=>{Ci(g),l()})})),await Promise.all(d),this.handler(this.showConnectResult)}getDeviceConnectInfo(e){this.remindAnimation=!1;let i="\u8FDE\u63A5\u51FA\u9519\uFF0C\u8BF7\u91CD\u8BD5";return this.isChinese||(i="Connection error, please try again"),e.hasCameraConnect&&e.hasMicrophoneConnect&&e.hasSpeakerConnect&&e.hasNetworkConnect?(this.isChinese?i=this.hasNetworkDetect?"\u8BBE\u5907\u53CA\u7F51\u7EDC\u8FDE\u63A5\u6210\u529F\uFF0C\u8BF7\u5F00\u59CB\u8BBE\u5907\u68C0\u6D4B":"\u8BBE\u5907\u8FDE\u63A5\u6210\u529F\uFF0C\u8BF7\u5F00\u59CB\u8BBE\u5907\u68C0\u6D4B":i=this.hasNetworkDetect?"Device and network connection are successful, start device detection":"Device connection successful, start device detection",{info:i,success:!0}):e.hasCameraDevice&&e.hasMicrophoneDevice&&e.hasSpeakerDevice?e.hasCameraConnect&&e.hasMicrophoneConnect?e.hasNetworkConnect?{info:i,success:!1}:(this.isChinese?i="\u7F51\u7EDC\u8FDE\u63A5\u5931\u8D25\uFF0C\u8BF7\u68C0\u67E5\u7F51\u7EDC\u8FDE\u63A5":i="Network connection failed, please check network connection",{info:i,success:!1,remind:this.isChinese?S.networkFailAttention:S.networkFailAttentionEng}):(this.isChinese?i=e.hasNetworkConnect?"\u8BF7\u5141\u8BB8\u6D4F\u89C8\u5668\u53CA\u7F51\u9875\u8BBF\u95EE\u6444\u50CF\u5934/\u9EA6\u514B\u98CE\u8BBE\u5907":"\u8BF7\u5141\u8BB8\u6D4F\u89C8\u5668\u53CA\u7F51\u9875\u8BBF\u95EE\u6444\u50CF\u5934/\u9EA6\u514B\u98CE\u8BBE\u5907\uFF0C\u5E76\u68C0\u67E5\u7F51\u7EDC\u8FDE\u63A5":i=e.hasNetworkConnect?"Please allow browser and web access to camera/microphone devices":"Please allow browser and web access to camera/microphone devices, and check the network connection",this.remindAnimation=!0,{info:i,success:!1,remind:this.isMobile?this.isChinese?S.mobileFailAttention:S.mobileFailAttentionEng:this.isChinese?S.deviceFailAttention:S.deviceFailAttentionEng}):(this.isChinese?i=`\u68C0\u6D4B\u5230${e.hasCameraDevice?"":"\u3010\u6444\u50CF\u5934\u3011"}${e.hasMicrophoneDevice?"":"\u3010\u9EA6\u514B\u98CE\u3011"}${e.hasSpeakerDevice?"":"\u3010\u626C\u58F0\u5668\u3011"}\u8BBE\u5907\u4E0D\u5B58\u5728\uFF0C\u8BF7\u68C0\u67E5\u8BBE\u5907\u8FDE\u63A5`:i=`No ${e.hasCameraDevice?"":"\u3010camera\u3011"}${e.hasMicrophoneDevice?"":"\u3010microphone\u3011"}${e.hasSpeakerDevice?"":"\u3010speaker\u3011"} device detected, please check the device connection`,{info:i,success:!1})}handleReset(){this.progress=0,this.showConnectResult=!1,this.setAttribute("showconnectresult",this.showConnectResult)}async attributeChangedCallback(e,i,r){if(e==="showconnectresult"){if(r==="true"){let V=this.shadowRoot.querySelector(".camerasvg"),o=this.shadowRoot.querySelector(".microphonesvg"),s=this.shadowRoot.querySelector(".speakersvg"),A=this.shadowRoot.querySelector(".networksvg"),n=this.shadowRoot.querySelector(".outer-progress"),d=this.shadowRoot.querySelector("trtc-custom-button");if(this.deviceState.hasCameraConnect?(V.classList.remove("connect-fail"),V.classList.add("connect-success")):V.classList.add("connect-fail"),this.deviceState.hasMicrophoneConnect?(o.classList.remove("connect-fail"),o.classList.add("connect-success")):o.classList.add("connect-fail"),this.deviceState.hasSpeakerConnect?(s.classList.add("connect-success"),s.classList.remove("connect-fail")):s.classList.add("connect-fail"),this.deviceState.hasNetworkConnect?(A.classList.add("connect-success"),A.classList.remove("connect-fail")):A.classList.add("connect-fail"),this.showReconnectButton()&&(d.setAttribute("type","outlined"),this.isChinese?d.innerHTML="\u91CD\u65B0\u8FDE\u63A5":d.innerHTML="Reconnect",d.addEventListener("click",()=>{this.remindAnimation=!1;let l=new CustomEvent("remind-changed",{detail:this.remindAnimation});this.dispatchEvent(l);let u=new Date().getTime(),g=M();g&&g.kvStatManager.addFailedEvent({key:591704,error:u-this.startTime}),this.handleReset()})),this.showStartDetectButton()&&(d.setAttribute("type","contained"),this.setAttribute("connectstage",1),this.isChinese?d.innerHTML="\u5F00\u59CB\u68C0\u6D4B":d.innerHTML="Start detection"),this.showConnectResult){n.style.display="none",this.shadowRoot.querySelector(".gray-text").style.display="none";let l=this.shadowRoot.querySelector(".result");l.style.display="block",this.connectResult.success===!0?l.classList.add("green-text"):(l.classList.add("red-text"),this.connectResult.remind&&(this.shadowRoot.querySelector(".error-connect").style.display="inline-block")),l.querySelector("span").innerHTML=this.connectResult.info}}else if(r==="false"){let V=this.shadowRoot.querySelector(".camerasvg"),o=this.shadowRoot.querySelector(".microphonesvg"),s=this.shadowRoot.querySelector(".speakersvg"),A=this.shadowRoot.querySelector(".networksvg"),n=this.shadowRoot.querySelector(".outer-progress"),d=this.shadowRoot.querySelector("trtc-custom-button");n.style.display="block",this.shadowRoot.querySelector(".result").classList.remove("green-text"),this.shadowRoot.querySelector(".result").classList.remove("red-text"),V.classList.remove("connect-fail"),V.classList.remove("connect-success"),o.classList.remove("connect-fail"),o.classList.remove("connect-success"),s.classList.remove("connect-fail"),s.classList.remove("connect-success"),A.classList.remove("connect-fail"),A.classList.remove("connect-success"),d.setAttribute("type","disabled"),this.isChinese?d.innerHTML="\u5F00\u59CB\u68C0\u6D4B":d.innerHTML="Start detection",this.getDeviceConnectResult(),this.shadowRoot.querySelector(".gray-text").style.display="block";let l=this.shadowRoot.querySelector(".result");l.style.display="none",this.shadowRoot.querySelector(".error-connect").style.display="none"}}}};h(S,"observedAttributes",["stepnamelist","showconnectresult"]),h(S,"properties",{showRemind:{type:Boolean},constTime:{type:Number}}),h(S,"deviceFailAttention","1. \u82E5\u6D4F\u89C8\u5668\u5F39\u51FA\u63D0\u793A\uFF0C\u8BF7\u9009\u62E9\u201C\u5141\u8BB8\u201D<br>2. \u82E5\u6740\u6BD2\u8F6F\u4EF6\u5F39\u51FA\u63D0\u793A\uFF0C\u8BF7\u9009\u62E9\u201C\u5141\u8BB8\u201D<br>3. \u68C0\u67E5\u7CFB\u7EDF\u8BBE\u7F6E\uFF0C\u5141\u8BB8\u6D4F\u89C8\u5668\u8BBF\u95EE\u6444\u50CF\u5934\u53CA\u9EA6\u514B\u98CE<br>4. \u68C0\u67E5\u6D4F\u89C8\u5668\u8BBE\u7F6E\uFF0C\u5141\u8BB8\u7F51\u9875\u8BBF\u95EE\u6444\u50CF\u5934\u53CA\u9EA6\u514B\u98CE<br>5. \u68C0\u67E5\u6444\u50CF\u5934/\u9EA6\u514B\u98CE\u662F\u5426\u6B63\u786E\u8FDE\u63A5\u5E76\u5F00\u542F<br>6. \u5C1D\u8BD5\u91CD\u65B0\u8FDE\u63A5\u6444\u50CF\u5934/\u9EA6\u514B\u98CE<br>7. \u5C1D\u8BD5\u91CD\u542F\u8BBE\u5907\u540E\u91CD\u65B0\u68C0\u6D4B"),h(S,"deviceFailAttentionEng",'1. If the browser prompts, select "Allow"<br>2. If the antivirus software prompts, select "Allow"<br>3. Check system settings to allow camera and microphone<br>4. Check browser settings to allow camera and microphone<br>5. Check camera/microphone turned on<br>6. Try reconnecting the camera/microphone<br>7. Try restarting the device and retesting'),h(S,"mobileFailAttention","1. \u524D\u5F80\u624B\u673A\u8BBE\u7F6E,\u6253\u5F00\u672C\u5E94\u7528\u7684\u76F8\u673A\u548C\u9EA6\u514B\u98CE\u6743\u9650<br>2. \u91CD\u65B0\u5237\u65B0\u672C\u9875\u5E76\u5141\u8BB8\u76F8\u673A\u548C\u9EA6\u514B\u98CE\u6743\u9650<br>"),h(S,"mobileFailAttentionEng","1. Go to your phone Settings to allow camera and microphone permissions for this app <br>2. Refresh this page and allow camera and microphone permissions <br>"),h(S,"networkFailAttention","1. \u8BF7\u68C0\u67E5\u8BBE\u5907\u662F\u5426\u8054\u7F51<br>2. \u8BF7\u5237\u65B0\u7F51\u9875\u540E\u518D\u6B21\u68C0\u6D4B<br>3. \u8BF7\u5C1D\u8BD5\u66F4\u6362\u7F51\u7EDC\u540E\u518D\u6B21\u68C0\u6D4B"),h(S,"networkFailAttentionEng","1. Check if the device is connected to the network<br>2. Refresh the page and test again<br>3. Try again after changing the network");var st=S;customElements.get("trtc-device-connect")||customElements.define("trtc-device-connect",st);var Se=class extends f{constructor(){super(),this.deviceList=[],this.activeDevice={},this.activeDeviceId="",this.attachShadow({mode:"open"})}async getDeviceListData(){var r;let e=await ws(this.deviceType),i=e.map(V=>V.deviceId);this.deviceList=e,this.choseDevice&&i.indexOf(this.choseDevice.deviceId)>=0?(this.activeDevice=e.find(V=>V.deviceId===this.choseDevice.deviceId),this.activeDeviceId=this.choseDevice.deviceId):(this.activeDevice=e[0],this.activeDeviceId=(r=e[0])==null?void 0:r.deviceId),this.onChange(this.activeDevice),this.requestUpdate()}async firstUpdated(){await this.getDeviceListData(),navigator.mediaDevices.addEventListener("devicechange",async()=>{let e=await ws(this.deviceType);this.deviceList=e,e[0].deviceId!==this.activeDeviceId&&(this.activeDevice=e[0],this.activeDeviceId=e[0].deviceId,this.onChange(this.activeDevice)),this.requestUpdate()})}disconnectedCallback(){this.remove()}handleChange(e){let i=e.target.value,r=M();r&&r.kvStatManager.addEnum({key:591713,value:1});let V=this.deviceList.find(o=>o.deviceId===i);this.activeDevice=V,this.activeDeviceId=i,this.onChange(this.activeDevice),this.requestUpdate()}render(){return c`
|
|
1199
|
+
`)))},200),this.showConnectResult=!0,this.setAttribute("showconnectresult",this.showConnectResult),clearInterval(this.progressInterval)}},150))}prepareInfo(){return this.isChinese?`\u8BBE\u5907\u68C0\u6D4B\u524D\u8BF7\u786E\u8BA4\u8BBE\u5907\u8FDE\u63A5\u4E86${this.hasCameraDetect()?"\u6444\u50CF\u5934":""}${this.hasMicrophoneDetect()?"\u3001\u9EA6\u514B\u98CE":""}${this.hasSpeakerDetect()?"\u3001\u626C\u58F0\u5668":""}${this.hasNetworkDetect()?"\u548C\u7F51\u7EDC":""}`:`Make sure the device is connected before testing the device ${this.hasCameraDetect()?"camera":""}${this.hasMicrophoneDetect()?", microphone":""}${this.hasSpeakerDetect()?", speaker":""}${this.hasNetworkDetect()?" and network":""}`}judgeList(e){let i=this.shadowRoot.querySelector(".camerasvg"),r=this.shadowRoot.querySelector(".microphonesvg"),V=this.shadowRoot.querySelector(".speakersvg"),o=this.shadowRoot.querySelector(".networksvg");e.indexOf("camera")>=0?i.style.display="block":i.style.display="none",e.indexOf("microphone")>=0?r.style.display="block":r.style.display="none",e.indexOf("speaker")>=0?V.style.display="block":V.style.display="none",e.indexOf("network")>=0?o.style.display="block":o.style.display="none"}async getDeviceConnectResult(){let e=[],i=[],r=[];try{let{cameras:l,speakers:u,microphones:g}=await J();e=l,i=g,r=u}catch(l){}let V=e.length>0,o=i.length>0,s=this.hasSpeakerDetect()?this.isFirefoxOrIOS||r.length>0:!0,A=this.hasNetworkDetect()?await vs():!0,n={hasCameraDevice:V,hasMicrophoneDevice:o,hasSpeakerDevice:s,hasNetworkConnect:A,hasCameraConnect:!1,hasMicrophoneConnect:!1,hasSpeakerConnect:s};this.deviceState=n,this.remindAnimation=!1,this.connectResult=this.getDeviceConnectInfo(n);let d=[];V&&d.push(new Promise((l,u)=>{navigator.mediaDevices.getUserMedia({video:!0,audio:!1}).then(g=>{this.remindAnimation=!1,n=H(j({},n),{hasCameraConnect:!0}),this.deviceState=n,this.connectResult=this.getDeviceConnectInfo(n),g.getTracks()[0].stop(),l()}).catch(g=>{Ci(g),l()})})),o&&d.push(new Promise((l,u)=>{navigator.mediaDevices.getUserMedia({video:!1,audio:!0}).then(g=>{this.remindAnimation=!1,n=H(j({},n),{hasMicrophoneConnect:o}),this.deviceState=n,this.connectResult=this.getDeviceConnectInfo(n),g.getTracks()[0].stop(),l()}).catch(g=>{Ci(g),l()})})),await Promise.all(d),this.handler(this.showConnectResult)}getDeviceConnectInfo(e){this.remindAnimation=!1;let i="\u8FDE\u63A5\u51FA\u9519\uFF0C\u8BF7\u91CD\u8BD5";return this.isChinese||(i="Connection error, please try again"),e.hasCameraConnect&&e.hasMicrophoneConnect&&e.hasSpeakerConnect&&e.hasNetworkConnect?(this.isChinese?i=this.hasNetworkDetect?"\u8BBE\u5907\u53CA\u7F51\u7EDC\u8FDE\u63A5\u6210\u529F\uFF0C\u8BF7\u5F00\u59CB\u8BBE\u5907\u68C0\u6D4B":"\u8BBE\u5907\u8FDE\u63A5\u6210\u529F\uFF0C\u8BF7\u5F00\u59CB\u8BBE\u5907\u68C0\u6D4B":i=this.hasNetworkDetect?"Device and network connection are successful, start device detection":"Device connection successful, start device detection",{info:i,success:!0}):e.hasCameraDevice&&e.hasMicrophoneDevice&&e.hasSpeakerDevice?e.hasCameraConnect&&e.hasMicrophoneConnect?e.hasNetworkConnect?{info:i,success:!1}:(this.isChinese?i="\u7F51\u7EDC\u8FDE\u63A5\u5931\u8D25\uFF0C\u8BF7\u68C0\u67E5\u7F51\u7EDC\u8FDE\u63A5":i="Network connection failed, please check network connection",{info:i,success:!1,remind:this.isChinese?S.networkFailAttention:S.networkFailAttentionEng}):(this.isChinese?i=e.hasNetworkConnect?"\u8BF7\u5141\u8BB8\u6D4F\u89C8\u5668\u53CA\u7F51\u9875\u8BBF\u95EE\u6444\u50CF\u5934/\u9EA6\u514B\u98CE\u8BBE\u5907":"\u8BF7\u5141\u8BB8\u6D4F\u89C8\u5668\u53CA\u7F51\u9875\u8BBF\u95EE\u6444\u50CF\u5934/\u9EA6\u514B\u98CE\u8BBE\u5907\uFF0C\u5E76\u68C0\u67E5\u7F51\u7EDC\u8FDE\u63A5":i=e.hasNetworkConnect?"Please allow browser and web access to camera/microphone devices":"Please allow browser and web access to camera/microphone devices, and check the network connection",this.remindAnimation=!0,{info:i,success:!1,remind:this.isMobile?this.isChinese?S.mobileFailAttention:S.mobileFailAttentionEng:this.isChinese?S.deviceFailAttention:S.deviceFailAttentionEng}):(this.isChinese?i=`\u68C0\u6D4B\u5230${e.hasCameraDevice?"":"\u3010\u6444\u50CF\u5934\u3011"}${e.hasMicrophoneDevice?"":"\u3010\u9EA6\u514B\u98CE\u3011"}${e.hasSpeakerDevice?"":"\u3010\u626C\u58F0\u5668\u3011"}\u8BBE\u5907\u4E0D\u5B58\u5728\uFF0C\u8BF7\u68C0\u67E5\u8BBE\u5907\u8FDE\u63A5`:i=`No ${e.hasCameraDevice?"":"\u3010camera\u3011"}${e.hasMicrophoneDevice?"":"\u3010microphone\u3011"}${e.hasSpeakerDevice?"":"\u3010speaker\u3011"} device detected, please check the device connection`,{info:i,success:!1})}handleReset(){this.progress=0,this.showConnectResult=!1,this.setAttribute("showconnectresult",this.showConnectResult)}async attributeChangedCallback(e,i,r){if(e==="showconnectresult"){if(r==="true"){let V=this.shadowRoot.querySelector(".camerasvg"),o=this.shadowRoot.querySelector(".microphonesvg"),s=this.shadowRoot.querySelector(".speakersvg"),A=this.shadowRoot.querySelector(".networksvg"),n=this.shadowRoot.querySelector(".outer-progress"),d=this.shadowRoot.querySelector("trtc-custom-button");if(this.deviceState.hasCameraConnect?(V.classList.remove("connect-fail"),V.classList.add("connect-success")):V.classList.add("connect-fail"),this.deviceState.hasMicrophoneConnect?(o.classList.remove("connect-fail"),o.classList.add("connect-success")):o.classList.add("connect-fail"),this.deviceState.hasSpeakerConnect?(s.classList.add("connect-success"),s.classList.remove("connect-fail")):s.classList.add("connect-fail"),this.deviceState.hasNetworkConnect?(A.classList.add("connect-success"),A.classList.remove("connect-fail")):A.classList.add("connect-fail"),this.showReconnectButton()&&(d.setAttribute("type","outlined"),this.isChinese?d.innerHTML="\u91CD\u65B0\u8FDE\u63A5":d.innerHTML="Reconnect",d.addEventListener("click",()=>{this.remindAnimation=!1;let l=new CustomEvent("remind-changed",{detail:this.remindAnimation});this.dispatchEvent(l);let u=new Date().getTime(),g=M();g&&g.kvStatManager.addFailedEvent({key:591704,error:u-this.startTime}),this.handleReset()})),this.showStartDetectButton()&&(d.setAttribute("type","contained"),this.setAttribute("connectstage",1),this.isChinese?d.innerHTML="\u5F00\u59CB\u68C0\u6D4B":d.innerHTML="Start detection"),this.showConnectResult){n.style.display="none",this.shadowRoot.querySelector(".gray-text").style.display="none";let l=this.shadowRoot.querySelector(".result");l.style.display="block",this.connectResult.success===!0?l.classList.add("green-text"):(l.classList.add("red-text"),this.connectResult.remind&&(this.shadowRoot.querySelector(".error-connect").style.display="inline-block")),l.querySelector("span").innerHTML=this.connectResult.info}}else if(r==="false"){let V=this.shadowRoot.querySelector(".camerasvg"),o=this.shadowRoot.querySelector(".microphonesvg"),s=this.shadowRoot.querySelector(".speakersvg"),A=this.shadowRoot.querySelector(".networksvg"),n=this.shadowRoot.querySelector(".outer-progress"),d=this.shadowRoot.querySelector("trtc-custom-button");n.style.display="block",this.shadowRoot.querySelector(".result").classList.remove("green-text"),this.shadowRoot.querySelector(".result").classList.remove("red-text"),V.classList.remove("connect-fail"),V.classList.remove("connect-success"),o.classList.remove("connect-fail"),o.classList.remove("connect-success"),s.classList.remove("connect-fail"),s.classList.remove("connect-success"),A.classList.remove("connect-fail"),A.classList.remove("connect-success"),d.setAttribute("type","disabled"),this.isChinese?d.innerHTML="\u5F00\u59CB\u68C0\u6D4B":d.innerHTML="Start detection",this.getDeviceConnectResult(),this.shadowRoot.querySelector(".gray-text").style.display="block";let l=this.shadowRoot.querySelector(".result");l.style.display="none",this.shadowRoot.querySelector(".error-connect").style.display="none"}}}};h(S,"observedAttributes",["stepnamelist","showconnectresult"]),h(S,"properties",{showRemind:{type:Boolean},constTime:{type:Number}}),h(S,"deviceFailAttention","1. \u82E5\u6D4F\u89C8\u5668\u5F39\u51FA\u63D0\u793A\uFF0C\u8BF7\u9009\u62E9\u201C\u5141\u8BB8\u201D<br>2. \u82E5\u6740\u6BD2\u8F6F\u4EF6\u5F39\u51FA\u63D0\u793A\uFF0C\u8BF7\u9009\u62E9\u201C\u5141\u8BB8\u201D<br>3. \u68C0\u67E5\u7CFB\u7EDF\u8BBE\u7F6E\uFF0C\u5141\u8BB8\u6D4F\u89C8\u5668\u8BBF\u95EE\u6444\u50CF\u5934\u53CA\u9EA6\u514B\u98CE<br>4. \u68C0\u67E5\u6D4F\u89C8\u5668\u8BBE\u7F6E\uFF0C\u5141\u8BB8\u7F51\u9875\u8BBF\u95EE\u6444\u50CF\u5934\u53CA\u9EA6\u514B\u98CE<br>5. \u68C0\u67E5\u6444\u50CF\u5934/\u9EA6\u514B\u98CE\u662F\u5426\u6B63\u786E\u8FDE\u63A5\u5E76\u5F00\u542F<br>6. \u5C1D\u8BD5\u91CD\u65B0\u8FDE\u63A5\u6444\u50CF\u5934/\u9EA6\u514B\u98CE<br>7. \u5C1D\u8BD5\u91CD\u542F\u8BBE\u5907\u540E\u91CD\u65B0\u68C0\u6D4B"),h(S,"deviceFailAttentionEng",'1. If the browser prompts, select "Allow"<br>2. If the antivirus software prompts, select "Allow"<br>3. Check system settings to allow camera and microphone<br>4. Check browser settings to allow camera and microphone<br>5. Check camera/microphone turned on<br>6. Try reconnecting the camera/microphone<br>7. Try restarting the device and retesting'),h(S,"mobileFailAttention","1. \u524D\u5F80\u624B\u673A\u8BBE\u7F6E,\u6253\u5F00\u672C\u5E94\u7528\u7684\u76F8\u673A\u548C\u9EA6\u514B\u98CE\u6743\u9650<br>2. \u91CD\u65B0\u5237\u65B0\u672C\u9875\u5E76\u5141\u8BB8\u76F8\u673A\u548C\u9EA6\u514B\u98CE\u6743\u9650<br>"),h(S,"mobileFailAttentionEng","1. Go to your phone Settings to allow camera and microphone permissions for this app <br>2. Refresh this page and allow camera and microphone permissions <br>"),h(S,"networkFailAttention","1. \u8BF7\u68C0\u67E5\u8BBE\u5907\u662F\u5426\u8054\u7F51<br>2. \u8BF7\u5237\u65B0\u7F51\u9875\u540E\u518D\u6B21\u68C0\u6D4B<br>3. \u8BF7\u5C1D\u8BD5\u66F4\u6362\u7F51\u7EDC\u540E\u518D\u6B21\u68C0\u6D4B"),h(S,"networkFailAttentionEng","1. Check if the device is connected to the network<br>2. Refresh the page and test again<br>3. Try again after changing the network");var st=S;customElements.get("trtc-device-connect")||customElements.define("trtc-device-connect",st);var Se=class extends f{constructor(){super(),this.deviceList=[],this.activeDevice={},this.activeDeviceId="",this.attachShadow({mode:"open"})}async getDeviceListData(){let e=await ws(this.deviceType),i=e.map(r=>r.deviceId);this.deviceList=e,this.choseDevice&&i.indexOf(this.choseDevice.deviceId)>=0?(this.activeDevice=e.find(r=>r.deviceId===this.choseDevice.deviceId),this.activeDeviceId=this.choseDevice.deviceId):(this.activeDevice=e[0],this.activeDeviceId=e[0].deviceId),this.onChange(this.activeDevice),this.requestUpdate()}async firstUpdated(){await this.getDeviceListData(),navigator.mediaDevices.addEventListener("devicechange",async()=>{let e=await ws(this.deviceType);this.deviceList=e,e[0].deviceId!==this.activeDeviceId&&(this.activeDevice=e[0],this.activeDeviceId=e[0].deviceId,this.onChange(this.activeDevice)),this.requestUpdate()})}disconnectedCallback(){this.remove()}handleChange(e){let i=e.target.value,r=M();r&&r.kvStatManager.addEnum({key:591713,value:1});let V=this.deviceList.find(o=>o.deviceId===i);this.activeDevice=V,this.activeDeviceId=i,this.onChange(this.activeDevice),this.requestUpdate()}render(){return c`
|
|
1200
1200
|
<style>${v}</style>
|
|
1201
1201
|
<div>
|
|
1202
1202
|
<select class="device-select" value=${this.activeDeviceId} @change=${this.handleChange}>
|
|
@@ -1249,7 +1249,7 @@
|
|
|
1249
1249
|
</div>
|
|
1250
1250
|
</div>
|
|
1251
1251
|
</div>
|
|
1252
|
-
`:c``}};h(Ee,"properties",{activeDetector:{type:String},handleComplete:{type:Function},constructTime:{type:Number}});customElements.get("trtc-mic-detector")||customElements.define("trtc-mic-detector",Ee);var ve=class extends f{constructor(){super();h(this,"handleSpeakerChange",async i=>{var o,s;
|
|
1252
|
+
`:c``}};h(Ee,"properties",{activeDetector:{type:String},handleComplete:{type:Function},constructTime:{type:Number}});customElements.get("trtc-mic-detector")||customElements.define("trtc-mic-detector",Ee);var ve=class extends f{constructor(){super();h(this,"handleSpeakerChange",async i=>{var o,s;this.choseDevice=i;let{deviceId:r,label:V}=i;this.audioPlayer&&r&&await((s=(o=this.audioPlayer).setSinkId)==null?void 0:s.call(o,r)),this.audioPlayer.src=this.audioUrl,this.speakerLabel=V,this.device=i});this.audioPlayer=null,this.currentDetector="speaker",this.speakerLabel="",this.audioUrl="",this.choseDevice=null;let i=navigator.language||navigator.userLanguage||navigator.browserLanguage||navigator.systemLanguage||"en";this.isChinese=i.indexOf("zh")>-1,this.attachShadow({mode:"open"}),this.core=M(),this.log=x()}firstUpdated(){}updated(i){i.has("activeDetector")&&(this.activeDetector===this.currentDetector&&(this.audioPlayer=this.shadowRoot.getElementById("audio-player")),i.get("activeDetector")===this.currentDetector&&(this.audioPlayer&&!this.audioPlayer.paused&&this.audioPlayer.pause(),this.audioPlayer&&(this.audioPlayer.currentTime=0)))}handleError(){this.log&&this.log.warn("SpeakerFail",this.device);let i=new Date().getTime();this.core&&this.core.kvStatManager.addFailedEvent({key:591710,error:i-this.constructTime}),this.handleComplete("error",this.speakerLabel,!1,this.device)}handleSuccess(){this.handleComplete("success",this.speakerLabel,!0,this.device);let i=new Date().getTime();this.core&&this.core.kvStatManager.addSuccessEvent({key:591709,cost:i-this.constructTime})}disconnectedCallback(){this.core=null,this.log=null,this.remove()}render(){return this.activeDetector===this.currentDetector?c`
|
|
1253
1253
|
<style>${v}</style>
|
|
1254
1254
|
<div class="testing-body">
|
|
1255
1255
|
<div class="device-list">
|