ezuikit-js 8.1.5 → 8.1.7
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/CHANGELOG.md +22 -0
- package/README.md +7 -0
- package/ezuikit.js +25 -17
- package/index.esm.js +5 -5
- package/index.js +3 -3
- package/package.json +2 -2
package/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*
|
|
2
2
|
*
|
|
3
|
-
* ezuikit.js v8.1.
|
|
4
|
-
* Copyright (c) 2025-
|
|
3
|
+
* ezuikit.js v8.1.6
|
|
4
|
+
* Copyright (c) 2025-2-13 Ezviz-OpenBiz
|
|
5
5
|
* Released under ISC the License.
|
|
6
6
|
*
|
|
7
7
|
*/
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
|
37
37
|
OTHER DEALINGS IN THE SOFTWARE.
|
|
38
38
|
*/
|
|
39
|
-
Se.sessions={},Se.isExtensionEnabled=function(){if(navigator.mediaDevices&&navigator.mediaDevices.getDisplayMedia)return!0;if(window.navigator.userAgent.match("Chrome")){var e=parseInt(window.navigator.userAgent.match(/Chrome\/(.*) /)[1],10),t=33;return window.navigator.userAgent.match("Linux")&&(t=35),e>=26&&e<=t||Se.extension.isInstalled()}return!0};var ye={extensionId:"hapfgfdkleiggjjpfpenajgdnfckjpaj",isInstalled:function(){return null!==document.querySelector("#janus-extension-installed")},getScreen:function(e){var t=window.setTimeout((function(){var t=new Error("NavigatorUserMediaError");return t.name='The required Chrome extension is not installed: click <a href="#">here</a> to install it. (NOTE: this will need you to refresh the page)',e(t)}),1e3);this.cache[t]=e,window.postMessage({type:"janusGetScreen",id:t},"*")},init:function(){var e={};this.cache=e,window.addEventListener("message",(function(t){if(t.origin==window.location.origin)if("janusGotScreen"==t.data.type&&e[t.data.id]){var n=e[t.data.id];if(delete e[t.data.id],""===t.data.sourceId){var i=new Error("NavigatorUserMediaError");i.name="You cancelled the request for permission, giving up...",n(i)}else n(null,t.data.sourceId)}else"janusGetScreenPending"==t.data.type&&(console.log("clearing ",t.data.id),window.clearTimeout(t.data.id))}))}};function Se(e){if(void 0===Se.initDone)return e.error("Library not initialized"),{};if(!Se.isWebrtcSupported())return e.error("WebRTC not supported by this browser"),{};if(Se.log("Library initialized: "+Se.initDone),(e=e||{}).success="function"==typeof e.success?e.success:Se.noop,e.error="function"==typeof e.error?e.error:Se.noop,e.destroyed="function"==typeof e.destroyed?e.destroyed:Se.noop,null===e.server||void 0===e.server)return e.error("Invalid server url"),{};var t=!1,n=null,i={},o=null,a=null,r=0,s=e.server;Se.isArray(s)?(Se.log("Multiple servers provided ("+s.length+"), will use the first that works"),s=null,a=e.server,Se.debug(a)):0===s.indexOf("ws")?(t=!0,Se.log("Using WebSockets to contact Janus: "+s)):(t=!1,Se.log("Using REST API to contact Janus: "+s));var l=e.iceServers;null==l&&(l=[{urls:"stun:stun.l.google.com:19302"}]);var d=e.iceTransportPolicy,u=e.bundlePolicy,m=e.ipv6;null==m&&(m=!1);var h=!1;void 0!==e.withCredentials&&null!==e.withCredentials&&(h=!0===e.withCredentials);var p=10;void 0!==e.max_poll_events&&null!==e.max_poll_events&&(p=e.max_poll_events),p<1&&(p=1);var g=null;void 0!==e.token&&null!==e.token&&(g=e.token);var f=null;void 0!==e.apisecret&&null!==e.apisecret&&(f=e.apisecret),this.destroyOnUnload=!0,void 0!==e.destroyOnUnload&&null!==e.destroyOnUnload&&(this.destroyOnUnload=!0===e.destroyOnUnload);var v=25e3;void 0!==e.keepAlivePeriod&&null!==e.keepAlivePeriod&&(v=e.keepAlivePeriod),isNaN(v)&&(v=25e3);var S=6e4;function _(e){var t={high:9e5,medium:3e5,low:1e5};return null!=e&&(e.high&&(t.high=e.high),e.medium&&(t.medium=e.medium),e.low&&(t.low=e.low)),t}void 0!==e.longPollTimeout&&null!==e.longPollTimeout&&(S=e.longPollTimeout),isNaN(S)&&(S=6e4);var w=!1,T=null,E={},P=this,k=0,C={};function I(){if(null!=T)if(Se.debug("Long poll..."),w){var t=s+"/"+T+"?rid="+(new Date).getTime();null!=p&&(t=t+"&maxev="+p),null!=g&&(t=t+"&token="+encodeURIComponent(g)),null!=f&&(t=t+"&apisecret="+encodeURIComponent(f)),Se.httpAPICall(t,{verb:"GET",withCredentials:h,success:x,timeout:S,error:function(t,n){if(Se.error(t+":",n),++k>3)return w=!1,void e.error("Lost connection to the server (is it down?)");I()}})}else Se.warn("Is the server down? (connected=false)")}function x(e,i){if(k=0,t||null==T||!0===i||I(),t||!Se.isArray(e))if("keepalive"!==e.rtcgw)if("ack"!==e.rtcgw)if("success"!==e.rtcgw)if("trickle"===e.rtcgw){if(null==(c=e.sender))return void Se.warn("Missing sender...");if(null==(d=E[c]))return void Se.debug("This handle is not attached to this session");var o=e.candidate;Se.debug("Got a trickled candidate on session "+T),Se.debug(o);var a=d.webrtcStuff;a.pc&&a.remoteSdp?(Se.debug("Adding remote candidate:",o),o&&!0!==o.completed?a.pc.addIceCandidate(o):a.pc.addIceCandidate(Se.endOfCandidates)):(Se.debug("We didn't do setRemoteDescription (trickle got here before the offer?), caching candidate"),a.candidates||(a.candidates=[]),a.candidates.push(o),Se.debug(a.candidates))}else{if("webrtcup"===e.rtcgw)return Se.debug("Got a webrtcup event on session "+T),Se.debug(e),null==(c=e.sender)?void Se.warn("Missing sender..."):null==(d=E[c])?void Se.debug("This handle is not attached to this session"):void d.webrtcState(!0);if("hangup"===e.rtcgw){if(Se.debug("Got a hangup event on session "+T),Se.debug(e),null==(c=e.sender))return void Se.warn("Missing sender...");if(null==(d=E[c]))return void Se.debug("This handle is not attached to this session");d.webrtcState(!1,e.reason),d.hangup()}else if("detached"===e.rtcgw){if(Se.debug("Got a detached event on session "+T),Se.debug(e),null==(c=e.sender))return void Se.warn("Missing sender...");if(null==(d=E[c]))return;d.detached=!0,d.ondetached(),d.detach()}else if("media"===e.rtcgw){if(Se.debug("Got a media event on session "+T),Se.debug(e),null==(c=e.sender))return void Se.warn("Missing sender...");if(null==(d=E[c]))return void Se.debug("This handle is not attached to this session");d.mediaState(e.type,e.receiving)}else if("slowlink"===e.rtcgw){if(Se.debug("Got a slowlink event on session "+T),Se.debug(e),null==(c=e.sender))return void Se.warn("Missing sender...");if(null==(d=E[c]))return void Se.debug("This handle is not attached to this session");d.slowLink(e.uplink,e.lost)}else{if("error"===e.rtcgw){var r,s;if(Se.error("Ooops: "+e.error.code+" "+e.error.reason),Se.debug(e),null!=(r=e.transaction))null!=(s=C[r])&&s(e),delete C[r];return}if("event"===e.rtcgw){var c;if(Se.debug("Got a plugin event on session "+T),Se.debug(e),null==(c=e.sender))return void Se.warn("Missing sender...");var l=e.plugindata;if(null==l)return void Se.warn("Missing plugindata...");Se.debug(" -- Event is coming from "+c+" ("+l.plugin+")");var d,u=l.data;if(Se.debug(u),null==(d=E[c]))return void Se.warn("This handle is not attached to this session");var m=e.jsep;null!=m&&(Se.debug("Handling SDP as well..."),Se.debug(m));var h=d.onmessage;null!=h?(Se.debug("Notifying application..."),h(u,m)):Se.debug("No provided notification callback")}else{if("timeout"===e.rtcgw)return Se.error("Timeout on session "+T),Se.debug(e),void(t&&n.close(3504,"Gateway timeout"));Se.warn("Unknown message/event '"+e.rtcgw+"' on session "+T),Se.debug(e)}}}else Se.debug("Got a success on session "+T),Se.debug(e),null!=(r=e.transaction)&&(null!=(s=C[r])&&s(e),delete C[r]);else Se.debug("Got an ack on session "+T),Se.debug(e),null!=(r=e.transaction)&&(null!=(s=C[r])&&s(e),delete C[r]);else Se.vdebug("Got a keepalive on session "+T);else for(var p=0;p<e.length;p++)x(e[p],!0)}function j(){if(null!==s&&t&&w){o=setTimeout(j,v);var e={rtcgw:"keepalive",session_id:T,transaction:Se.randomString(12)};null!=g&&(e.token=g),null!=f&&(e.apisecret=f),n.send(JSON.stringify(e))}}function A(c){var l=Se.randomString(12),d={rtcgw:"create",transaction:l,token:window.EZUIKit.opt.stream,device:window.EZUIKit.opt.deviceSerial,channel:window.EZUIKit.opt.channelNo,authBizType:"TALK"};if(c.reconnect&&(w=!1,d.rtcgw="claim",d.session_id=T,n&&(n.onopen=null,n.onerror=null,n.onclose=null,o&&(clearTimeout(o),o=null))),null!=g&&(d.token=g),null!=f&&(d.apisecret=f),null===s&&Se.isArray(a)&&(0===(s=a[r]).indexOf("ws")?(t=!0,Se.log("Server #"+(r+1)+": trying WebSockets to contact Janus ("+s+")")):(t=!1,Se.log("Server #"+(r+1)+": trying REST API to contact Janus ("+s+")"))),t)for(var u in n=Se.newWebSocket(s,"rtcgw-protocol"),i={error:function(){if(Se.error("Error connecting to the Janus WebSockets server... "+s),Se.isArray(a)&&!c.reconnect)return++r==a.length?void c.error("Error connecting to any of the provided Janus servers: Is the server down?"):(s=null,void setTimeout((function(){A(c)}),200));c.error("Error connecting to the Janus WebSockets server: Is the server down?")},open:function(){C[l]=function(e){if(Se.debug(e),"success"!==e.rtcgw)return Se.error("Ooops: "+e.error.code+" "+e.error.reason),void c.error(e.error.reason);o=setTimeout(j,v),w=!0,T=e.session_id?e.session_id:e.data.id,c.reconnect?Se.log("Claimed session: "+T):Se.log("Created session: "+T),Se.sessions[T]=P,c.success()},n.send(JSON.stringify(d))},message:function(e){x(JSON.parse(e.data))},close:function(){null!==s&&w&&(w=!1,e.error("Lost connection to the server (is it down?)"))}})n.addEventListener(u,i[u]);else Se.httpAPICall(s,{verb:"POST",withCredentials:h,body:d,success:function(e){if(Se.debug(e),"success"!==e.rtcgw)return Se.error("Ooops: "+e.error.code+" "+e.error.reason),void c.error(e.error.reason);w=!0,T=e.session_id?e.session_id:e.data.id,c.reconnect?Se.log("Claimed session: "+T):Se.log("Created session: "+T),Se.sessions[T]=P,I(),c.success()},error:function(e,t){if(Se.error(e+":",t),Se.isArray(a)&&!c.reconnect)return++r==a.length?void c.error("Error connecting to any of the provided Janus servers: Is the server down?"):(s=null,void setTimeout((function(){A(c)}),200));""===t?c.error(e+": Is the server down?"):c.error(e+": "+t)}})}function D(e,i){if((i=i||{}).success="function"==typeof i.success?i.success:Se.noop,i.error="function"==typeof i.error?i.error:Se.noop,!w)return Se.warn("Is the server down? (connected=false)"),void i.error("Is the server down? (connected=false)");var o=E[e];if(null==o||null===o.webrtcStuff||void 0===o.webrtcStuff)return Se.warn("Invalid handle"),void i.error("Invalid handle");var a=i.message,r=i.jsep,c=Se.randomString(12),l={rtcgw:"message",body:a,transaction:c};if(null!==o.token&&void 0!==o.token&&(l.token=o.token),null!=f&&(l.apisecret=f),null!=r&&(l.jsep=r),Se.debug("Sending message to plugin (handle="+e+"):"),Se.debug(l),t)return l.session_id=T,l.handle_id=e,C[c]=function(e){if(Se.debug("Message sent!"),Se.debug(e),"success"===e.rtcgw){var t=e.plugindata;if(null==t)return Se.warn("Request succeeded, but missing plugindata..."),void i.success();Se.log("Synchronous transaction successful ("+t.plugin+")");var n=t.data;return Se.debug(n),void i.success(n)}"ack"===e.rtcgw?i.success():void 0!==e.error&&null!==e.error?(Se.error("Ooops: "+e.error.code+" "+e.error.reason),i.error(e.error.code+" "+e.error.reason)):(Se.error("Unknown error"),i.error("Unknown error"))},void n.send(JSON.stringify(l));Se.httpAPICall(s+"/"+T+"/"+e,{verb:"POST",withCredentials:h,body:l,success:function(e){if(Se.debug("Message sent!"),Se.debug(e),"success"===e.rtcgw){var t=e.plugindata;if(null==t)return Se.warn("Request succeeded, but missing plugindata..."),void i.success();Se.log("Synchronous transaction successful ("+t.plugin+")");var n=t.data;return Se.debug(n),void i.success(n)}"ack"===e.rtcgw?i.success():void 0!==e.error&&null!==e.error?(Se.error("Ooops: "+e.error.code+" "+e.error.reason),i.error(e.error.code+" "+e.error.reason)):(Se.error("Unknown error"),i.error("Unknown error"))},error:function(e,t){Se.error(e+":",t),i.error(e+": "+t)}})}function R(e,i){if(w){var o=E[e];if(null!=o&&null!==o.webrtcStuff&&void 0!==o.webrtcStuff){var a={rtcgw:"trickle",candidate:i,transaction:Se.randomString(12)};if(null!==o.token&&void 0!==o.token&&(a.token=o.token),null!=f&&(a.apisecret=f),Se.vdebug("Sending trickle candidate (handle="+e+"):"),Se.vdebug(a),t)return a.session_id=T,a.handle_id=e,void n.send(JSON.stringify(a));Se.httpAPICall(s+"/"+T+"/"+e,{verb:"POST",withCredentials:h,body:a,success:function(e){Se.vdebug("Candidate sent!"),Se.vdebug(e),"ack"===e.rtcgw||Se.error("Ooops: "+e.error.code+" "+e.error.reason)},error:function(e,t){Se.error(e+":",t)}})}else Se.warn("Invalid handle")}else Se.warn("Is the server down? (connected=false)")}function L(e,t,n,i){var o=E[e];if(null!=o&&null!==o.webrtcStuff&&void 0!==o.webrtcStuff){var a=o.webrtcStuff,r=function(e){Se.log("Received state change on data channel:",e);var t=e.target.label,n=a.dataChannel[t]?a.dataChannel[t].readyState:"null";if(Se.log("State change on <"+t+"> data channel: "+n),"open"===n){if(a.dataChannel[t].pending&&a.dataChannel[t].pending.length>0){for(var i in Se.log("Sending pending messages on <"+t+">:",a.dataChannel[t].pending.length),a.dataChannel[t].pending){var r=a.dataChannel[t].pending[i];Se.log("Sending string on data channel <"+t+">: "+r),a.dataChannel[t].send(r)}a.dataChannel[t].pending=[]}o.ondataopen(t)}};a.dataChannel[t]=n||a.pc.createDataChannel(t,{ordered:!1}),a.dataChannel[t].onmessage=function(e){Se.log("Received message on data channel:",e);var t=e.target.label;o.ondata(e.data,t)},a.dataChannel[t].onopen=r,a.dataChannel[t].onclose=r,a.dataChannel[t].onerror=function(e){Se.error("Got error on data channel:",e)},a.dataChannel[t].pending=[],i&&a.dataChannel[t].pending.push(i)}else Se.warn("Invalid handle")}function B(e,t){(t=t||{}).success="function"==typeof t.success?t.success:Se.noop,t.error="function"==typeof t.error?t.error:Se.noop;var n=E[e];if(null==n||null===n.webrtcStuff||void 0===n.webrtcStuff)return Se.warn("Invalid handle"),void t.error("Invalid handle");var i=n.webrtcStuff,o=t.text;if(null==o)return Se.warn("Invalid text"),void t.error("Invalid text");var a=t.label?t.label:Se.dataChanDefaultLabel;return i.dataChannel[a]?"open"!==i.dataChannel[a].readyState?(i.dataChannel[a].pending.push(o),void t.success()):(Se.log("Sending string on data channel <"+a+">: "+o),i.dataChannel[a].send(o),void t.success()):(L(e,a,!1,o),void t.success())}function M(e,t){(t=t||{}).success="function"==typeof t.success?t.success:Se.noop,t.error="function"==typeof t.error?t.error:Se.noop;var n=E[e];if(null==n||null===n.webrtcStuff||void 0===n.webrtcStuff)return Se.warn("Invalid handle"),void t.error("Invalid handle");var i=n.webrtcStuff;if(null===i.dtmfSender||void 0===i.dtmfSender){if(void 0!==i.pc&&null!==i.pc){var o=i.pc.getSenders().find((function(e){return e.track&&"audio"===e.track.kind}));if(!o)return Se.warn("Invalid DTMF configuration (no audio track)"),void t.error("Invalid DTMF configuration (no audio track)");i.dtmfSender=o.dtmf,i.dtmfSender&&(Se.log("Created DTMF Sender"),i.dtmfSender.ontonechange=function(e){Se.debug("Sent DTMF tone: "+e.tone)})}if(null===i.dtmfSender||void 0===i.dtmfSender)return Se.warn("Invalid DTMF configuration"),void t.error("Invalid DTMF configuration")}var a=t.dtmf;if(null==a)return Se.warn("Invalid DTMF parameters"),void t.error("Invalid DTMF parameters");var r=a.tones;if(null==r)return Se.warn("Invalid DTMF string"),void t.error("Invalid DTMF string");var s=a.duration;null==s&&(s=500);var c=a.gap;null==c&&(c=50),Se.debug("Sending DTMF string "+r+" (duration "+s+"ms, gap "+c+"ms)"),i.dtmfSender.insertDTMF(r,s,c),t.success()}function O(e,i){(i=i||{}).success="function"==typeof i.success?i.success:Se.noop,i.error="function"==typeof i.error?i.error:Se.noop;var o=!0;void 0!==i.asyncRequest&&null!==i.asyncRequest&&(o=!0===i.asyncRequest);var a=!0;void 0!==i.noRequest&&null!==i.noRequest&&(a=!0===i.noRequest),Se.log("Destroying handle "+e+" (async="+o+")"),Y(e);var r=E[e];if(null==r||r.detached)return delete E[e],void i.success();if(a)return delete E[e],void i.success();if(!w)return Se.warn("Is the server down? (connected=false)"),void i.error("Is the server down? (connected=false)");var c={rtcgw:"detach",transaction:Se.randomString(12)};if(null!==r.token&&void 0!==r.token&&(c.token=r.token),null!=f&&(c.apisecret=f),t)return c.session_id=T,c.handle_id=e,n.send(JSON.stringify(c)),delete E[e],void i.success();Se.httpAPICall(s+"/"+T+"/"+e,{verb:"POST",async:o,withCredentials:h,body:c,success:function(t){Se.log("Destroyed handle:"),Se.debug(t),"success"!==t.rtcgw&&Se.error("Ooops: "+t.error.code+" "+t.error.reason),delete E[e],i.success()},error:function(t,n){Se.error(t+":",n),delete E[e],i.success()}})}function z(e,t,n,i,o){return N.apply(this,arguments)}function N(){var e;return e=y().mark((function e(t,n,i,o,a){var r,s,c,h,p,g,f,v,S,w,T,P,k,C,I,x,j,A,D,B,M,O,z,N,F,U,Z;return y().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!=(r=E[t])&&null!==r.webrtcStuff&&void 0!==r.webrtcStuff){e.next=5;break}return Se.warn("Invalid handle"),o.error("Invalid handle"),e.abrupt("return");case 5:if(s=r.webrtcStuff,Se.debug("streamsDone:",a),a&&(Se.debug(" -- Audio tracks:",a.getAudioTracks()),Se.debug(" -- Video tracks:",a.getVideoTracks())),c=!1,s.myStream&&i.update&&!s.streamExternal){e.next=14;break}s.myStream=a,c=!0,e.next=66;break;case 14:if(!((!i.update&&X(i)||i.update&&(i.addAudio||i.replaceAudio))&&a.getAudioTracks()&&a.getAudioTracks().length)){e.next=45;break}if(s.myStream.addTrack(a.getAudioTracks()[0]),!Se.unifiedPlan){e.next=43;break}if(Se.log((i.replaceAudio?"Replacing":"Adding")+" audio track:",a.getAudioTracks()[0]),h=null,!((p=s.pc.getTransceivers())&&p.length>0)){e.next=30;break}e.t0=y().keys(p);case 22:if((e.t1=e.t0()).done){e.next=30;break}if(g=e.t1.value,!((f=p[g]).sender&&f.sender.track&&"audio"===f.sender.track.kind||f.receiver&&f.receiver.track&&"audio"===f.receiver.track.kind)){e.next=28;break}return h=f,e.abrupt("break",30);case 28:e.next=22;break;case 30:return v=null,e.prev=31,e.next=34,o.customizeStream(a);case 34:v=e.sent,e.next=40;break;case 37:e.prev=37,e.t2=e.catch(31),o.error(e.t2);case 40:h&&h.sender?h.sender.replaceTrack((null===(S=v)||void 0===S||null===(w=S.getAudioTracks)||void 0===w||null===(T=w.call(S))||void 0===T?void 0:T[0])||a.getAudioTracks()[0]):s.pc.addTrack((null===(P=v)||void 0===P||null===(k=P.getAudioTracks)||void 0===k||null===(C=k.call(P))||void 0===C?void 0:C[0])||a.getAudioTracks()[0],v||a),e.next=45;break;case 43:Se.log((i.replaceAudio?"Replacing":"Adding")+" audio track:",a.getAudioTracks()[0]),s.pc.addTrack(a.getAudioTracks()[0],a);case 45:if(!((!i.update&&$(i)||i.update&&(i.addVideo||i.replaceVideo))&&a.getVideoTracks()&&a.getVideoTracks().length)){e.next=66;break}if(s.myStream.addTrack(a.getVideoTracks()[0]),!Se.unifiedPlan){e.next=64;break}if(Se.log((i.replaceVideo?"Replacing":"Adding")+" video track:",a.getVideoTracks()[0]),I=null,!((p=s.pc.getTransceivers())&&p.length>0)){e.next=61;break}e.t3=y().keys(p);case 53:if((e.t4=e.t3()).done){e.next=61;break}if(g=e.t4.value,!((f=p[g]).sender&&f.sender.track&&"video"===f.sender.track.kind||f.receiver&&f.receiver.track&&"video"===f.receiver.track.kind)){e.next=59;break}return I=f,e.abrupt("break",61);case 59:e.next=53;break;case 61:I&&I.sender?I.sender.replaceTrack(a.getVideoTracks()[0]):s.pc.addTrack(a.getVideoTracks()[0],a),e.next=66;break;case 64:Se.log((i.replaceVideo?"Replacing":"Adding")+" video track:",a.getVideoTracks()[0]),s.pc.addTrack(a.getVideoTracks()[0],a);case 66:if(!s.pc){if(x={iceServers:l,iceTransportPolicy:d,bundlePolicy:u},"chrome"===Se.webRTCAdapter.browserDetails.browser&&(x.sdpSemantics=Se.webRTCAdapter.browserDetails.version<72?"plan-b":"unified-plan"),j={optional:[{DtlsSrtpKeyAgreement:!0}]},!0===m&&j.optional.push({googIPv6:!0}),o.rtcConstraints&&"object"===b(o.rtcConstraints))for(g in Se.debug("Adding custom PeerConnection constraints:",o.rtcConstraints),o.rtcConstraints)j.optional.push(o.rtcConstraints[g]);"edge"===Se.webRTCAdapter.browserDetails.browser&&(x.bundlePolicy="max-bundle"),Se.log("Creating PeerConnection"),Se.debug(j),s.pc=new RTCPeerConnection(x,j),Se.debug(s.pc),s.pc.getStats&&(s.volume={},s.bitrate.value="0 kbits/sec"),Se.log("Preparing local SDP and gathering candidates (trickle="+s.trickle+")"),s.pc.oniceconnectionstatechange=function(e){s.pc&&r.iceState(s.pc.iceConnectionState)},s.pc.onicecandidate=function(e){if(null==e.candidate||"edge"===Se.webRTCAdapter.browserDetails.browser&&e.candidate.candidate.indexOf("endOfCandidates")>0)Se.log("End of candidates."),s.iceDone=!0,!0===s.trickle?R(t,{completed:!0}):G(t,o);else{var n={candidate:e.candidate.candidate,sdpMid:e.candidate.sdpMid,sdpMLineIndex:e.candidate.sdpMLineIndex};!0===s.trickle&&R(t,n)}},s.pc.ontrack=function(e){Se.log("Handling Remote Track"),Se.debug(e),e.streams&&(s.remoteStream=e.streams[0],r.onremotestream(s.remoteStream),e.track.onended||(Se.log("Adding onended callback to track:",e.track),e.track.onended=function(e){Se.log("Remote track muted/removed:",e),s.remoteStream&&(s.remoteStream.removeTrack(e.target),r.onremotestream(s.remoteStream))},e.track.onmute=e.track.onended,e.track.onunmute=function(e){try{s.remoteStream.addTrack(e.target),r.onremotestream(s.remoteStream)}catch(e){Se.error(e)}}))}}if(!c||null==a){e.next=96;break}Se.log("Adding local stream"),A=!0===o.simulcast2,D=a.getTracks(),B=0;case 72:if(!(B<D.length)){e.next=96;break}if(M=D[B],A){e.next=92;break}if("audio"!==M.kind){e.next=89;break}return U=null,e.prev=77,e.next=80,o.customizeStream(a);case 80:U=e.sent,e.next=86;break;case 83:e.prev=83,e.t5=e.catch(77),o.error(e.t5);case 86:s.pc.addTrack((null===(O=U)||void 0===O||null===(z=(N=O).getAudioTracks)||void 0===z||null===(F=z.call(N))||void 0===F?void 0:F[0])||M,U||a),e.next=90;break;case 89:s.pc.addTrack(M,a);case 90:e.next=93;break;case 92:"audio"===M.kind?s.pc.addTrack(M,a):(Se.log("Enabling rid-based simulcasting:",M),Z=_(o.simulcastMaxBitrates),s.pc.addTransceiver(M,{direction:"sendrecv",streams:[a],sendEncodings:[{rid:"h",active:!0,maxBitrate:Z.high},{rid:"m",active:!0,maxBitrate:Z.medium,scaleResolutionDownBy:2},{rid:"l",active:!0,maxBitrate:Z.low,scaleResolutionDownBy:4}]}));case 93:B++,e.next=72;break;case 96:te(i)&&!s.dataChannel[Se.dataChanDefaultLabel]&&(Se.log("Creating data channel"),L(t,Se.dataChanDefaultLabel,!1),s.pc.ondatachannel=function(e){Se.log("Data channel created by Janus:",e),L(t,e.channel.label,e.channel)}),s.myStream&&r.onlocalstream(s.myStream),null==n?V(t,i,o):s.pc.setRemoteDescription(n).then((function(){if(Se.log("Remote description accepted!"),s.remoteSdp=n.sdp,s.candidates&&s.candidates.length>0){for(var e=0;e<s.candidates.length;e++){var a=s.candidates[e];Se.debug("Adding remote candidate:",a),a&&!0!==a.completed?s.pc.addIceCandidate(a):s.pc.addIceCandidate(Se.endOfCandidates)}s.candidates=[]}H(t,i,o)}),o.error);case 99:case"end":return e.stop()}}),e,null,[[31,37],[77,83]])})),N=function(){var t=this,n=arguments;return new Promise((function(i,o){var a=e.apply(t,n);function r(e){c(a,i,o,r,s,"next",e)}function s(e){c(a,i,o,r,s,"throw",e)}r(void 0)}))},N.apply(this,arguments)}function F(e,t,n){(n=n||{}).success="function"==typeof n.success?n.success:Se.noop,n.error="function"==typeof n.error?n.error:J,n.customizeStream="function"==typeof n.customizeStream?n.customizeStream:Se.noop;var i=n.jsep;if(t&&i)return Se.error("Provided a JSEP to a createOffer"),void n.error("Provided a JSEP to a createOffer");if(!(t||i&&i.type&&i.sdp))return Se.error("A valid JSEP is required for createAnswer"),void n.error("A valid JSEP is required for createAnswer");n.media=n.media||{audio:!0,video:!0};var o=n.media,a=E[e];if(null==a||null===a.webrtcStuff||void 0===a.webrtcStuff)return Se.warn("Invalid handle"),void n.error("Invalid handle");var r,s=a.webrtcStuff;if(s.trickle=(r=n.trickle,Se.debug("isTrickleEnabled:",r),null==r||!0===r),void 0===s.pc||null===s.pc)o.update=!1,o.keepAudio=!1,o.keepVideo=!1;else if(void 0!==s.pc&&null!==s.pc){if(Se.log("Updating existing media session"),o.update=!0,null!==n.stream&&void 0!==n.stream)n.stream!==s.myStream&&Se.log("Renegotiation involves a new external stream");else{if(o.addAudio){if(o.keepAudio=!1,o.replaceAudio=!1,o.removeAudio=!1,o.audioSend=!0,s.myStream&&s.myStream.getAudioTracks()&&s.myStream.getAudioTracks().length)return Se.error("Can't add audio stream, there already is one"),void n.error("Can't add audio stream, there already is one")}else o.removeAudio?(o.keepAudio=!1,o.replaceAudio=!1,o.addAudio=!1,o.audioSend=!1):o.replaceAudio&&(o.keepAudio=!1,o.addAudio=!1,o.removeAudio=!1,o.audioSend=!0);if(null===s.myStream||void 0===s.myStream?(o.replaceAudio&&(o.keepAudio=!1,o.replaceAudio=!1,o.addAudio=!0,o.audioSend=!0),X(o)&&(o.keepAudio=!1,o.addAudio=!0)):null===s.myStream.getAudioTracks()||void 0===s.myStream.getAudioTracks()||0===s.myStream.getAudioTracks().length?(o.replaceAudio&&(o.keepAudio=!1,o.replaceAudio=!1,o.addAudio=!0,o.audioSend=!0),X(o)&&(o.keepVideo=!1,o.addAudio=!0)):!X(o)||o.removeAudio||o.replaceAudio||(o.keepAudio=!0),o.addVideo){if(o.keepVideo=!1,o.replaceVideo=!1,o.removeVideo=!1,o.videoSend=!0,s.myStream&&s.myStream.getVideoTracks()&&s.myStream.getVideoTracks().length)return Se.error("Can't add video stream, there already is one"),void n.error("Can't add video stream, there already is one")}else o.removeVideo?(o.keepVideo=!1,o.replaceVideo=!1,o.addVideo=!1,o.videoSend=!1):o.replaceVideo&&(o.keepVideo=!1,o.addVideo=!1,o.removeVideo=!1,o.videoSend=!0);null===s.myStream||void 0===s.myStream||null===s.myStream.getVideoTracks()||void 0===s.myStream.getVideoTracks()||0===s.myStream.getVideoTracks().length?(o.replaceVideo&&(o.keepVideo=!1,o.replaceVideo=!1,o.addVideo=!0,o.videoSend=!0),$(o)&&(o.keepVideo=!1,o.addVideo=!0)):!$(o)||o.removeVideo||o.replaceVideo||(o.keepVideo=!0),o.addData&&(o.data=!0)}if(X(o)&&o.keepAudio&&$(o)&&o.keepVideo)return a.consentDialog(!1),void z(e,i,o,n,s.myStream)}if(o.update&&!s.streamExternal){if(o.removeAudio||o.replaceAudio){if(s.myStream&&s.myStream.getAudioTracks()&&s.myStream.getAudioTracks().length){var c=s.myStream.getAudioTracks()[0];Se.log("Removing audio track:",c),s.myStream.removeTrack(c);try{c.stop()}catch(e){}}if(s.pc.getSenders()&&s.pc.getSenders().length){var l=!0;if(o.replaceAudio&&Se.unifiedPlan&&(l=!1),l)for(var d in s.pc.getSenders()){(c=s.pc.getSenders()[d])&&c.track&&"audio"===c.track.kind&&(Se.log("Removing audio sender:",c),s.pc.removeTrack(c))}}}if(o.removeVideo||o.replaceVideo){if(s.myStream&&s.myStream.getVideoTracks()&&s.myStream.getVideoTracks().length){c=s.myStream.getVideoTracks()[0];Se.log("Removing video track:",c),s.myStream.removeTrack(c);try{c.stop()}catch(e){}}if(s.pc.getSenders()&&s.pc.getSenders().length){var u=!0;if(o.replaceVideo&&Se.unifiedPlan&&(u=!1),u)for(var d in s.pc.getSenders()){(c=s.pc.getSenders()[d])&&c.track&&"video"===c.track.kind&&(Se.log("Removing video sender:",c),s.pc.removeTrack(c))}}}}if(null!==n.stream&&void 0!==n.stream){var m=n.stream;if(Se.log("MediaStream provided by the application"),Se.debug(m),o.update&&s.myStream&&s.myStream!==n.stream&&!s.streamExternal){try{var h=s.myStream.getTracks();for(var p in h){var g=h[p];Se.log(g),null!=g&&g.stop()}}catch(e){}s.myStream=null}return s.streamExternal=!0,a.consentDialog(!1),void z(e,i,o,n,m)}if(X(o)||$(o)){if(!Se.isGetUserMediaAvailable())return void n.error("getUserMedia not available");var f={mandatory:{},optional:[]};a.consentDialog(!0);var v=X(o);!0===v&&null!=o&&null!=o&&"object"===b(o.audio)&&(v=o.audio);var y=$(o);if(!0===y&&null!=o&&null!=o){var S=!0===n.simulcast,_=!0===n.simulcast2;if(!S&&!_||i||void 0!==o.video&&!1!==o.video||(o.video="hires"),o.video&&"screen"!=o.video&&"window"!=o.video)if("object"===b(o.video))y=o.video;else{var w=0,T=0;"lowres"===o.video?(T=240,w=320):"lowres-16:9"===o.video?(T=180,w=320):"hires"===o.video||"hires-16:9"===o.video||"hdres"===o.video?(T=720,w=1280):"fhdres"===o.video?(T=1080,w=1920):"4kres"===o.video?(T=2160,w=3840):"stdres"===o.video?(T=480,w=640):"stdres-16:9"===o.video?(T=360,w=640):(Se.log("Default video setting is stdres 4:3"),T=480,w=640),Se.log("Adding media constraint:",o.video),y={height:{ideal:T},width:{ideal:w}},Se.log("Adding video constraint:",y)}else if("screen"===o.video||"window"===o.video){var P=function(t,r){a.consentDialog(!1),t?n.error(t):z(e,i,o,n,r)},k=function(e,t,n){Se.log("Adding media constraint (screen capture)"),Se.debug(e),navigator.mediaDevices.getUserMedia(e).then((function(e){n?navigator.mediaDevices.getUserMedia({audio:!0,video:!1}).then((function(n){e.addTrack(n.getAudioTracks()[0]),t(null,e)})):t(null,e)})).catch((function(e){a.consentDialog(!1),t(e)}))};if(o.screenshareFrameRate||(o.screenshareFrameRate=3),navigator.mediaDevices&&navigator.mediaDevices.getDisplayMedia)return void navigator.mediaDevices.getDisplayMedia({video:!0}).then((function(t){a.consentDialog(!1),X(o)&&!o.keepAudio?navigator.mediaDevices.getUserMedia({audio:!0,video:!1}).then((function(a){t.addTrack(a.getAudioTracks()[0]),z(e,i,o,n,t)})):z(e,i,o,n,t)}),(function(e){a.consentDialog(!1),n.error(e)}));if("chrome"===Se.webRTCAdapter.browserDetails.browser){var C=Se.webRTCAdapter.browserDetails.version,I=33;window.navigator.userAgent.match("Linux")&&(I=35),C>=26&&C<=I?(f={video:{mandatory:{googLeakyBucket:!0,maxWidth:window.screen.width,maxHeight:window.screen.height,minFrameRate:o.screenshareFrameRate,maxFrameRate:o.screenshareFrameRate,chromeMediaSource:"screen"}},audio:X(o)&&!o.keepAudio},k(f,P)):Se.extension.getScreen((function(e,t){if(e)return a.consentDialog(!1),n.error(e);(f={audio:!1,video:{mandatory:{chromeMediaSource:"desktop",maxWidth:window.screen.width,maxHeight:window.screen.height,minFrameRate:o.screenshareFrameRate,maxFrameRate:o.screenshareFrameRate},optional:[{googLeakyBucket:!0},{googTemporalLayeredScreencast:!0}]}}).video.mandatory.chromeMediaSourceId=t,k(f,P,X(o)&&!o.keepAudio)}))}else if("firefox"===Se.webRTCAdapter.browserDetails.browser){if(!(Se.webRTCAdapter.browserDetails.version>=33)){var x=new Error("NavigatorUserMediaError");return x.name="Your version of Firefox does not support screen sharing, please install Firefox 33 (or more recent versions)",a.consentDialog(!1),void n.error(x)}f={video:{mozMediaSource:o.video,mediaSource:o.video},audio:X(o)&&!o.keepAudio},k(f,(function(e,t){if(P(e,t),!e)var n=t.currentTime,i=window.setInterval((function(){t||window.clearInterval(i),t.currentTime==n&&(window.clearInterval(i),t.onended&&t.onended()),n=t.currentTime}),500)}))}return}}null!=o&&"screen"===o.video||navigator.mediaDevices.enumerateDevices().then((function(t){var r=t.some((function(e){return"audioinput"===e.kind})),s=function(e){if(Se.debug("isScreenSendEnabled:",e),null==e)return!1;if("object"!==b(e.video)||"object"!==b(e.video.mandatory))return!1;var t=e.video.mandatory;if(t.chromeMediaSource)return"desktop"===t.chromeMediaSource||"screen"===t.chromeMediaSource;if(t.mozMediaSource)return"window"===t.mozMediaSource||"screen"===t.mozMediaSource;if(t.mediaSource)return"window"===t.mediaSource||"screen"===t.mediaSource;return!1}(o)||t.some((function(e){return"videoinput"===e.kind})),c=X(o),l=$(o),d=function(e){return Se.debug("isAudioSendRequired:",e),null!=e&&(!1!==e.audio&&!1!==e.audioSend&&(void 0!==e.failIfNoAudio&&null!==e.failIfNoAudio&&!0===e.failIfNoAudio))}(o),u=function(e){return Se.debug("isVideoSendRequired:",e),null!=e&&(!1!==e.video&&!1!==e.videoSend&&(void 0!==e.failIfNoVideo&&null!==e.failIfNoVideo&&!0===e.failIfNoVideo))}(o);if(c||l||d||u){var h=!!c&&r,p=!!l&&s;if(!h&&!p)return a.consentDialog(!1),n.error("No capture device found"),!1;if(!h&&d)return a.consentDialog(!1),n.error("Audio capture is required, but no capture device found"),!1;if(!p&&u)return a.consentDialog(!1),n.error("Video capture is required, but no capture device found"),!1}var g={audio:!(!r||o.keepAudio)&&v,video:!(!s||o.keepVideo)&&y};Se.debug("getUserMedia constraints",g),g.audio||g.video?navigator.mediaDevices.getUserMedia(g).then((function(t){a.consentDialog(!1),z(e,i,o,n,t)})).catch((function(e){a.consentDialog(!1),n.error({code:e.code,name:e.name,message:e.message})})):(a.consentDialog(!1),z(e,i,o,n,m))})).catch((function(e){a.consentDialog(!1),n.error("enumerateDevices error",e)}))}else z(e,i,o,n)}function U(e,t){(t=t||{}).success="function"==typeof t.success?t.success:Se.noop,t.error="function"==typeof t.error?t.error:J;var n=t.jsep,i=E[e];if(null==i||null===i.webrtcStuff||void 0===i.webrtcStuff)return Se.warn("Invalid handle"),void t.error("Invalid handle");var o=i.webrtcStuff;if(null!=n){if(null===o.pc)return Se.warn("Wait, no PeerConnection?? if this is an answer, use createAnswer and not handleRemoteJsep"),void t.error("No PeerConnection: if this is an answer, use createAnswer and not handleRemoteJsep");o.pc.setRemoteDescription(n).then((function(){if(Se.log("Remote description accepted!"),o.remoteSdp=n.sdp,o.candidates&&o.candidates.length>0){for(var e=0;e<o.candidates.length;e++){var i=o.candidates[e];Se.debug("Adding remote candidate:",i),i&&!0!==i.completed?o.pc.addIceCandidate(i):o.pc.addIceCandidate(Se.endOfCandidates)}o.candidates=[]}t.success()}),t.error)}else t.error("Invalid JSEP")}function V(e,t,n){(n=n||{}).success="function"==typeof n.success?n.success:Se.noop,n.error="function"==typeof n.error?n.error:Se.noop,n.customizeSdp="function"==typeof n.customizeSdp?n.customizeSdp:Se.noop;var i=E[e];if(null==i||null===i.webrtcStuff||void 0===i.webrtcStuff)return Se.warn("Invalid handle"),void n.error("Invalid handle");var o=i.webrtcStuff,a=!0===n.simulcast;a?Se.log("Creating offer (iceDone="+o.iceDone+", simulcast="+a+")"):Se.log("Creating offer (iceDone="+o.iceDone+")");var r={};if(Se.unifiedPlan){var s=null,c=null,l=o.pc.getTransceivers();if(l&&l.length>0)for(var d in l){var u=l[d];u.sender&&u.sender.track&&"audio"===u.sender.track.kind||u.receiver&&u.receiver.track&&"audio"===u.receiver.track.kind?s||(s=u):(u.sender&&u.sender.track&&"video"===u.sender.track.kind||u.receiver&&u.receiver.track&&"video"===u.receiver.track.kind)&&(c||(c=u))}var m=X(t),h=Q(t);m||h?m&&h?s&&(s.setDirection?s.setDirection("sendrecv"):s.direction="sendrecv",Se.log("Setting audio transceiver to sendrecv:",s)):m&&!h?s&&(s.setDirection?s.setDirection("sendonly"):s.direction="sendonly",Se.log("Setting audio transceiver to sendonly:",s)):!m&&h&&(s?(s.setDirection?s.setDirection("recvonly"):s.direction="recvonly",Se.log("Setting audio transceiver to recvonly:",s)):(s=o.pc.addTransceiver("audio",{direction:"recvonly"}),Se.log("Adding recvonly audio transceiver:",s))):t.removeAudio&&s&&(s.setDirection?s.setDirection("inactive"):s.direction="inactive",Se.log("Setting audio transceiver to inactive:",s));var p=$(t),g=ee(t);p||g?p&&g?c&&(c.setDirection?c.setDirection("sendrecv"):c.direction="sendrecv",Se.log("Setting video transceiver to sendrecv:",c)):p&&!g?c&&(c.setDirection?c.setDirection("sendonly"):c.direction="sendonly",Se.log("Setting video transceiver to sendonly:",c)):!p&&g&&(c?(c.setDirection?c.setDirection("recvonly"):c.direction="recvonly",Se.log("Setting video transceiver to recvonly:",c)):(c=o.pc.addTransceiver("video",{direction:"recvonly"}),Se.log("Adding recvonly video transceiver:",c))):t.removeVideo&&c&&(c.setDirection?c.setDirection("inactive"):c.direction="inactive",Se.log("Setting video transceiver to inactive:",c))}else r.offerToReceiveAudio=Q(t),r.offerToReceiveVideo=ee(t);!0===n.iceRestart&&(r.iceRestart=!0),Se.debug(r);var f=$(t);if(f&&a&&"firefox"===Se.webRTCAdapter.browserDetails.browser){Se.log("Enabling Simulcasting for Firefox (RID)");var v=o.pc.getSenders().find((function(e){return"video"==e.track.kind}));if(v){var y=v.getParameters();y||(y={});var S=_(n.simulcastMaxBitrates);y.encodings=[{rid:"h",active:!0,maxBitrate:S.high},{rid:"m",active:!0,maxBitrate:S.medium,scaleResolutionDownBy:2},{rid:"l",active:!0,maxBitrate:S.low,scaleResolutionDownBy:4}],v.setParameters(y)}}o.pc.createOffer(r).then((function(e){Se.debug(e);var t={type:e.type,sdp:e.sdp};n.customizeSdp(t),e.sdp=t.sdp,Se.log("Setting local description"),f&&a&&("chrome"===Se.webRTCAdapter.browserDetails.browser||"safari"===Se.webRTCAdapter.browserDetails.browser?(Se.log("Enabling Simulcasting for Chrome (SDP munging)"),e.sdp=function(e){for(var t=e.split("\r\n"),n=!1,i=[-1],o=[-1],a=null,r=null,s=null,c=null,l=-1,d=0;d<t.length;d++){if(m=t[d].match(/m=(\w+) */)){if("video"===m[1]){if(!(i[0]<0)){l=d;break}n=!0}else if(i[0]>-1){l=d;break}}else if(n){var u=t[d].match(/a=ssrc-group:FID (\d+) (\d+)/);if(u)i[0]=u[1],o[0]=u[2],t.splice(d,1),d--;else{if(i[0]){if((p=t[d].match("a=ssrc:"+i[0]+" cname:(.+)"))&&(a=p[1]),(p=t[d].match("a=ssrc:"+i[0]+" msid:(.+)"))&&(r=p[1]),(p=t[d].match("a=ssrc:"+i[0]+" mslabel:(.+)"))&&(s=p[1]),(p=t[d].match("a=ssrc:"+i[0]+" label:(.+)"))&&(c=p[1]),0===t[d].indexOf("a=ssrc:"+o[0])){t.splice(d,1),d--;continue}if(0===t[d].indexOf("a=ssrc:"+i[0])){t.splice(d,1),d--;continue}}0!=t[d].length||(t.splice(d,1),d--)}}}if(i[0]<0){l=-1,n=!1;for(d=0;d<t.length;d++){var m;if(m=t[d].match(/m=(\w+) */)){if("video"===m[1]){if(!(i[0]<0)){l=d;break}n=!0}else if(i[0]>-1){l=d;break}}else if(n){if(i[0]<0){var h=t[d].match(/a=ssrc:(\d+)/);if(h){i[0]=h[1],t.splice(d,1),d--;continue}}else{var p;if((p=t[d].match("a=ssrc:"+i[0]+" cname:(.+)"))&&(a=p[1]),(p=t[d].match("a=ssrc:"+i[0]+" msid:(.+)"))&&(r=p[1]),(p=t[d].match("a=ssrc:"+i[0]+" mslabel:(.+)"))&&(s=p[1]),(p=t[d].match("a=ssrc:"+i[0]+" label:(.+)"))&&(c=p[1]),0===t[d].indexOf("a=ssrc:"+o[0])){t.splice(d,1),d--;continue}if(0===t[d].indexOf("a=ssrc:"+i[0])){t.splice(d,1),d--;continue}}0!=t[d].length||(t.splice(d,1),d--)}}}if(i[0]<0)return Se.warn("Couldn't find the video SSRC, simulcasting NOT enabled"),e;l<0&&(l=t.length);i[1]=Math.floor(4294967295*Math.random()),i[2]=Math.floor(4294967295*Math.random()),o[1]=Math.floor(4294967295*Math.random()),o[2]=Math.floor(4294967295*Math.random());for(d=0;d<i.length;d++)a&&(t.splice(l,0,"a=ssrc:"+i[d]+" cname:"+a),l++),r&&(t.splice(l,0,"a=ssrc:"+i[d]+" msid:"+r),l++),s&&(t.splice(l,0,"a=ssrc:"+i[d]+" mslabel:"+s),l++),c&&(t.splice(l,0,"a=ssrc:"+i[d]+" label:"+c),l++),a&&(t.splice(l,0,"a=ssrc:"+o[d]+" cname:"+a),l++),r&&(t.splice(l,0,"a=ssrc:"+o[d]+" msid:"+r),l++),s&&(t.splice(l,0,"a=ssrc:"+o[d]+" mslabel:"+s),l++),c&&(t.splice(l,0,"a=ssrc:"+o[d]+" label:"+c),l++);t.splice(l,0,"a=ssrc-group:FID "+i[2]+" "+o[2]),t.splice(l,0,"a=ssrc-group:FID "+i[1]+" "+o[1]),t.splice(l,0,"a=ssrc-group:FID "+i[0]+" "+o[0]),t.splice(l,0,"a=ssrc-group:SIM "+i[0]+" "+i[1]+" "+i[2]),(e=t.join("\r\n")).endsWith("\r\n")||(e+="\r\n");return e}(e.sdp)):"firefox"!==Se.webRTCAdapter.browserDetails.browser&&Se.warn("simulcast=true, but this is not Chrome nor Firefox, ignoring")),o.mySdp=e.sdp,o.pc.setLocalDescription(e).catch(n.error),o.mediaConstraints=r,o.iceDone||o.trickle?(Se.log("Offer ready"),Se.debug(n),n.success(e)):Se.log("Waiting for all candidates...")}),n.error)}function H(e,t,n){(n=n||{}).success="function"==typeof n.success?n.success:Se.noop,n.error="function"==typeof n.error?n.error:Se.noop,n.customizeSdp="function"==typeof n.customizeSdp?n.customizeSdp:Se.noop;var i=E[e];if(null==i||null===i.webrtcStuff||void 0===i.webrtcStuff)return Se.warn("Invalid handle"),void n.error("Invalid handle");var o=i.webrtcStuff,a=!0===n.simulcast;a?Se.log("Creating answer (iceDone="+o.iceDone+", simulcast="+a+")"):Se.log("Creating answer (iceDone="+o.iceDone+")");var r=null;if(Se.unifiedPlan){r={};var s=null,c=null,l=o.pc.getTransceivers();if(l&&l.length>0)for(var d in l){var u=l[d];u.sender&&u.sender.track&&"audio"===u.sender.track.kind||u.receiver&&u.receiver.track&&"audio"===u.receiver.track.kind?s||(s=u):(u.sender&&u.sender.track&&"video"===u.sender.track.kind||u.receiver&&u.receiver.track&&"video"===u.receiver.track.kind)&&(c||(c=u))}var m=X(t),h=Q(t);if(m||h){if(m&&h){if(s)try{s.setDirection?s.setDirection("sendrecv"):s.direction="sendrecv",Se.log("Setting audio transceiver to sendrecv:",s)}catch(e){Se.error(e)}}else if(m&&!h)try{s&&(s.setDirection?s.setDirection("sendonly"):s.direction="sendonly",Se.log("Setting audio transceiver to sendonly:",s))}catch(e){Se.error(e)}else if(!m&&h)if(s)try{s.setDirection?s.setDirection("recvonly"):s.direction="recvonly",Se.log("Setting audio transceiver to recvonly:",s)}catch(e){Se.error(e)}else s=o.pc.addTransceiver("audio",{direction:"recvonly"}),Se.log("Adding recvonly audio transceiver:",s)}else if(t.removeAudio&&s)try{s.setDirection?s.setDirection("inactive"):s.direction="inactive",Se.log("Setting audio transceiver to inactive:",s)}catch(e){Se.error(e)}var p=$(t),g=ee(t);if(p||g){if(p&&g){if(c)try{c.setDirection?c.setDirection("sendrecv"):c.direction="sendrecv",Se.log("Setting video transceiver to sendrecv:",c)}catch(e){Se.error(e)}}else if(p&&!g){if(c)try{c.setDirection?c.setDirection("sendonly"):c.direction="sendonly",Se.log("Setting video transceiver to sendonly:",c)}catch(e){Se.error(e)}}else if(!p&&g)if(c)try{c.setDirection?c.setDirection("recvonly"):c.direction="recvonly",Se.log("Setting video transceiver to recvonly:",c)}catch(e){Se.error(e)}else c=o.pc.addTransceiver("video",{direction:"recvonly"}),Se.log("Adding recvonly video transceiver:",c)}else if(t.removeVideo&&c)try{c.setDirection?c.setDirection("inactive"):c.direction="inactive",Se.log("Setting video transceiver to inactive:",c)}catch(e){Se.error(e)}}else r="firefox"==Se.webRTCAdapter.browserDetails.browser||"edge"==Se.webRTCAdapter.browserDetails.browser?{offerToReceiveAudio:Q(t),offerToReceiveVideo:ee(t)}:{mandatory:{OfferToReceiveAudio:Q(t),OfferToReceiveVideo:ee(t)}};Se.debug(r);var f=$(t);if(f&&a&&"firefox"===Se.webRTCAdapter.browserDetails.browser){Se.log("Enabling Simulcasting for Firefox (RID)");var v=o.pc.getSenders()[1];Se.log(v);var y=v.getParameters();Se.log(y);var S=_(n.simulcastMaxBitrates);v.setParameters({encodings:[{rid:"high",active:!0,priority:"high",maxBitrate:S.high},{rid:"medium",active:!0,priority:"medium",maxBitrate:S.medium},{rid:"low",active:!0,priority:"low",maxBitrate:S.low}]})}o.pc.createAnswer(r).then((function(e){Se.debug(e);var t={type:e.type,sdp:e.sdp};n.customizeSdp(t),e.sdp=t.sdp,Se.log("Setting local description"),f&&a&&("chrome"===Se.webRTCAdapter.browserDetails.browser?Se.warn("simulcast=true, but this is an answer, and video breaks in Chrome if we enable it"):"firefox"!==Se.webRTCAdapter.browserDetails.browser&&Se.warn("simulcast=true, but this is not Chrome nor Firefox, ignoring")),o.mySdp=e.sdp,o.pc.setLocalDescription(e).catch(n.error),o.mediaConstraints=r,o.iceDone||o.trickle?n.success(e):Se.log("Waiting for all candidates...")}),n.error)}function G(e,t){(t=t||{}).success="function"==typeof t.success?t.success:Se.noop,t.error="function"==typeof t.error?t.error:Se.noop;var n=E[e];if(null!=n&&null!==n.webrtcStuff&&void 0!==n.webrtcStuff){var i=n.webrtcStuff;Se.log("Sending offer/answer SDP..."),null!==i.mySdp&&void 0!==i.mySdp?(i.mySdp={type:i.pc.localDescription.type,sdp:i.pc.localDescription.sdp},!1===i.trickle&&(i.mySdp.trickle=!1),Se.debug(t),i.sdpSent=!0,t.success(i.mySdp)):Se.warn("Local SDP instance is invalid, not sending anything...")}else Se.warn("Invalid handle, not sending anything")}function Z(e,t){var n=E[e];if(null==n||null===n.webrtcStuff||void 0===n.webrtcStuff)return Se.warn("Invalid handle"),0;var i=t?"remote":"local",o=n.webrtcStuff;return o.volume[i]||(o.volume[i]={value:0}),o.pc.getStats&&"chrome"===Se.webRTCAdapter.browserDetails.browser?!t||null!==o.remoteStream&&void 0!==o.remoteStream?t||null!==o.myStream&&void 0!==o.myStream?null===o.volume[i].timer||void 0===o.volume[i].timer?(Se.log("Starting "+i+" volume monitor"),o.volume[i].timer=setInterval((function(){o.pc.getStats((function(e){for(var n=e.result(),a=0;a<n.length;a++){var r=n[a];"ssrc"==r.type&&(t&&r.stat("audioOutputLevel")?o.volume[i].value=parseInt(r.stat("audioOutputLevel")):!t&&r.stat("audioInputLevel")&&(o.volume[i].value=parseInt(r.stat("audioInputLevel"))))}}))}),200),0):o.volume[i].value:(Se.warn("Local stream unavailable"),0):(Se.warn("Remote stream unavailable"),0):(Se.warn("Getting the "+i+" volume unsupported by browser"),0)}function W(e,t){var n=E[e];if(null==n||null===n.webrtcStuff||void 0===n.webrtcStuff)return Se.warn("Invalid handle"),!0;var i=n.webrtcStuff;return null===i.pc||void 0===i.pc?(Se.warn("Invalid PeerConnection"),!0):void 0===i.myStream||null===i.myStream?(Se.warn("Invalid local MediaStream"),!0):t?null===i.myStream.getVideoTracks()||void 0===i.myStream.getVideoTracks()||0===i.myStream.getVideoTracks().length?(Se.warn("No video track"),!0):!i.myStream.getVideoTracks()[0].enabled:null===i.myStream.getAudioTracks()||void 0===i.myStream.getAudioTracks()||0===i.myStream.getAudioTracks().length?(Se.warn("No audio track"),!0):!i.myStream.getAudioTracks()[0].enabled}function q(e,t,n){var i=E[e];if(null==i||null===i.webrtcStuff||void 0===i.webrtcStuff)return Se.warn("Invalid handle"),!1;var o=i.webrtcStuff;return null===o.pc||void 0===o.pc?(Se.warn("Invalid PeerConnection"),!1):void 0===o.myStream||null===o.myStream?(Se.warn("Invalid local MediaStream"),!1):t?null===o.myStream.getVideoTracks()||void 0===o.myStream.getVideoTracks()||0===o.myStream.getVideoTracks().length?(Se.warn("No video track"),!1):(o.myStream.getVideoTracks()[0].enabled=!n,!0):null===o.myStream.getAudioTracks()||void 0===o.myStream.getAudioTracks()||0===o.myStream.getAudioTracks().length?(Se.warn("No audio track"),!1):(o.myStream.getAudioTracks()[0].enabled=!n,!0)}function K(e){var t=E[e];if(null==t||null===t.webrtcStuff||void 0===t.webrtcStuff)return Se.warn("Invalid handle"),"Invalid handle";var n=t.webrtcStuff;return null===n.pc||void 0===n.pc?"Invalid PeerConnection":n.pc.getStats?null===n.bitrate.timer||void 0===n.bitrate.timer?(Se.log("Starting bitrate timer (via getStats)"),n.bitrate.timer=setInterval((function(){n.pc.getStats().then((function(e){e.forEach((function(e){if(e){var t=!1;if(("video"===e.mediaType||e.id.toLowerCase().indexOf("video")>-1)&&"inbound-rtp"===e.type&&e.id.indexOf("rtcp")<0?t=!0:"ssrc"!=e.type||!e.bytesReceived||"VP8"!==e.googCodecName&&""!==e.googCodecName||(t=!0),t)if(n.bitrate.bsnow=e.bytesReceived,n.bitrate.tsnow=e.timestamp,null===n.bitrate.bsbefore||null===n.bitrate.tsbefore)n.bitrate.bsbefore=n.bitrate.bsnow,n.bitrate.tsbefore=n.bitrate.tsnow;else{var i=n.bitrate.tsnow-n.bitrate.tsbefore;"safari"==Se.webRTCAdapter.browserDetails.browser&&(i/=1e3);var o=Math.round(8*(n.bitrate.bsnow-n.bitrate.bsbefore)/i);"safari"===Se.webRTCAdapter.browserDetails.browser&&(o=parseInt(o/1e3)),n.bitrate.value=o+" kbits/sec",n.bitrate.bsbefore=n.bitrate.bsnow,n.bitrate.tsbefore=n.bitrate.tsnow}}}))}))}),1e3),"0 kbits/sec"):n.bitrate.value:(Se.warn("Getting the video bitrate unsupported by browser"),"Feature unsupported by browser")}function J(e){Se.error("WebRTC error:",e)}function Y(e,i){Se.log("Cleaning WebRTC stuff");var o=E[e];if(null!=o){var a=o.webrtcStuff;if(null!=a){if(!0===i){var r={rtcgw:"hangup",transaction:Se.randomString(12)};null!==o.token&&void 0!==o.token&&(r.token=o.token),null!=f&&(r.apisecret=f),Se.debug("Sending hangup request (handle="+e+"):"),Se.debug(r),t?(r.session_id=T,r.handle_id=e,n.send(JSON.stringify(r))):Se.httpAPICall(s+"/"+T+"/"+e,{verb:"POST",withCredentials:h,body:r})}a.remoteStream=null,a.volume&&(a.volume.local&&a.volume.local.timer&&clearInterval(a.volume.local.timer),a.volume.remote&&a.volume.remote.timer&&clearInterval(a.volume.remote.timer)),a.volume={},a.bitrate.timer&&clearInterval(a.bitrate.timer),a.bitrate.timer=null,a.bitrate.bsnow=null,a.bitrate.bsbefore=null,a.bitrate.tsnow=null,a.bitrate.tsbefore=null,a.bitrate.value=null;try{if(!a.streamExternal&&null!==a.myStream&&void 0!==a.myStream){Se.log("Stopping local stream tracks");var c=a.myStream.getTracks();for(var l in c){var d=c[l];Se.log(d),null!=d&&d.stop()}}}catch(e){}a.streamExternal=!1,a.myStream=null;try{a.pc.close()}catch(e){}a.pc=null,a.candidates=null,a.mySdp=null,a.remoteSdp=null,a.iceDone=!1,a.dataChannel={},a.dtmfSender=null}o.oncleanup()}}function X(e){return Se.debug("isAudioSendEnabled:",e),null==e||!1!==e.audio&&(void 0===e.audioSend||null===e.audioSend||!0===e.audioSend)}function Q(e){return Se.debug("isAudioRecvEnabled:",e),null==e||!1!==e.audio&&(void 0===e.audioRecv||null===e.audioRecv||!0===e.audioRecv)}function $(e){return Se.debug("isVideoSendEnabled:",e),null==e||!1!==e.video&&(void 0===e.videoSend||null===e.videoSend||!0===e.videoSend)}function ee(e){return Se.debug("isVideoRecvEnabled:",e),null==e||!1!==e.video&&(void 0===e.videoRecv||null===e.videoRecv||!0===e.videoRecv)}function te(e){return Se.debug("isDataEnabled:",e),"edge"==Se.webRTCAdapter.browserDetails.browser?(Se.warn("Edge doesn't support data channels yet"),!1):null!=e&&!0===e.data}A(e),this.getServer=function(){return s},this.isConnected=function(){return w},this.reconnect=function(e){(e=e||{}).success="function"==typeof e.success?e.success:Se.noop,e.error="function"==typeof e.error?e.error:Se.noop,e.reconnect=!0,A(e)},this.getSessionId=function(){return T},this.destroy=function(a){!function(a){a=a||{},a.success="function"==typeof a.success?a.success:Se.noop;var r=!0;void 0!==a.asyncRequest&&null!==a.asyncRequest&&(r=!0===a.asyncRequest);var c=!0;void 0!==a.notifyDestroyed&&null!==a.notifyDestroyed&&(c=!0===a.notifyDestroyed);var l=!1;void 0!==a.cleanupHandles&&null!==a.cleanupHandles&&(l=!0===a.cleanupHandles);if(Se.log("Destroying session "+T+" (async="+r+")"),!w)return Se.warn("Is the server down? (connected=false)"),void a.success();if(null==T)return Se.warn("No session to destroy"),a.success(),void(c&&e.destroyed());if(l)for(var d in E)O(d,{noRequest:!0});var u={rtcgw:"destroy",transaction:Se.randomString(12)};null!=g&&(u.token=g);null!=f&&(u.apisecret=f);if(t){u.session_id=T;var m=function(){for(var e in i)n.removeEventListener(e,i[e]);n.removeEventListener("message",p),n.removeEventListener("error",v),o&&clearTimeout(o),n.close()},p=function(t){var n=JSON.parse(t.data);n.session_id==u.session_id&&n.transaction==u.transaction&&(m(),a.success(),c&&e.destroyed())},v=function(t){m(),a.error("Failed to destroy the server: Is the server down?"),c&&e.destroyed()};return n.addEventListener("message",p),n.addEventListener("error",v),void n.send(JSON.stringify(u))}Se.httpAPICall(s+"/"+T,{verb:"POST",async:r,withCredentials:h,body:u,success:function(t){Se.log("Destroyed session:"),Se.debug(t),T=null,w=!1,"success"!==t.rtcgw&&Se.error("Ooops: "+t.error.code+" "+t.error.reason),a.success(),c&&e.destroyed()},error:function(t,n){Se.error(t+":",n),T=null,w=!1,a.success(),c&&e.destroyed()}})}(a)},this.attach=function(e){!function(e){if(e=e||{},e.success="function"==typeof e.success?e.success:Se.noop,e.error="function"==typeof e.error?e.error:Se.noop,e.consentDialog="function"==typeof e.consentDialog?e.consentDialog:Se.noop,e.iceState="function"==typeof e.iceState?e.iceState:Se.noop,e.mediaState="function"==typeof e.mediaState?e.mediaState:Se.noop,e.webrtcState="function"==typeof e.webrtcState?e.webrtcState:Se.noop,e.slowLink="function"==typeof e.slowLink?e.slowLink:Se.noop,e.onmessage="function"==typeof e.onmessage?e.onmessage:Se.noop,e.onlocalstream="function"==typeof e.onlocalstream?e.onlocalstream:Se.noop,e.onremotestream="function"==typeof e.onremotestream?e.onremotestream:Se.noop,e.ondata="function"==typeof e.ondata?e.ondata:Se.noop,e.ondataopen="function"==typeof e.ondataopen?e.ondataopen:Se.noop,e.oncleanup="function"==typeof e.oncleanup?e.oncleanup:Se.noop,e.ondetached="function"==typeof e.ondetached?e.ondetached:Se.noop,!w)return Se.warn("Is the server down? (connected=false)"),void e.error("Is the server down? (connected=false)");var i=e.plugin;if(null==i)return Se.error("Invalid plugin"),void e.error("Invalid plugin");var o=e.opaqueId,a=e.token?e.token:g,r=Se.randomString(12),c={rtcgw:"attach",plugin:i,opaque_id:o,transaction:r};null!=a&&(c.token=a);null!=f&&(c.apisecret=f);if(t)return C[r]=function(t){if(Se.debug(t),"success"!==t.rtcgw)return Se.error("Ooops: "+t.error.code+" "+t.error.reason),void e.error("Ooops: "+t.error.code+" "+t.error.reason);var n=t.data.id;Se.log("Created handle: "+n);var o={session:P,plugin:i,id:n,token:a,detached:!1,webrtcStuff:{started:!1,myStream:null,streamExternal:!1,remoteStream:null,mySdp:null,mediaConstraints:null,pc:null,dataChannel:{},dtmfSender:null,trickle:!0,iceDone:!1,volume:{value:null,timer:null},bitrate:{value:null,bsnow:null,bsbefore:null,tsnow:null,tsbefore:null,timer:null}},getId:function(){return n},getPlugin:function(){return i},getVolume:function(){return Z(n,!0)},getRemoteVolume:function(){return Z(n,!0)},getLocalVolume:function(){return Z(n,!1)},isAudioMuted:function(){return W(n,!1)},muteAudio:function(){return q(n,!1,!0)},unmuteAudio:function(){return q(n,!1,!1)},isVideoMuted:function(){return W(n,!0)},muteVideo:function(){return q(n,!0,!0)},unmuteVideo:function(){return q(n,!0,!1)},getBitrate:function(){return K(n)},send:function(e){D(n,e)},data:function(e){B(n,e)},dtmf:function(e){M(n,e)},consentDialog:e.consentDialog,iceState:e.iceState,mediaState:e.mediaState,webrtcState:e.webrtcState,slowLink:e.slowLink,onmessage:e.onmessage,createOffer:function(e){F(n,!0,e)},createAnswer:function(e){F(n,!1,e)},handleRemoteJsep:function(e){U(n,e)},onlocalstream:e.onlocalstream,onremotestream:e.onremotestream,ondata:e.ondata,ondataopen:e.ondataopen,oncleanup:e.oncleanup,ondetached:e.ondetached,hangup:function(e){Y(n,!0===e)},detach:function(e){O(n,e)}};E[n]=o,e.success(o)},c.session_id=T,void n.send(JSON.stringify(c));Se.httpAPICall(s+"/"+T,{verb:"POST",withCredentials:h,body:c,success:function(t){if(Se.debug(t),"success"!==t.rtcgw)return Se.error("Ooops: "+t.error.code+" "+t.error.reason),void e.error("Ooops: "+t.error.code+" "+t.error.reason);var n=t.data.id;Se.log("Created handle: "+n);var o={session:P,plugin:i,id:n,token:a,detached:!1,webrtcStuff:{started:!1,myStream:null,streamExternal:!1,remoteStream:null,mySdp:null,mediaConstraints:null,pc:null,dataChannel:{},dtmfSender:null,trickle:!0,iceDone:!1,volume:{value:null,timer:null},bitrate:{value:null,bsnow:null,bsbefore:null,tsnow:null,tsbefore:null,timer:null}},getId:function(){return n},getPlugin:function(){return i},getVolume:function(){return Z(n,!0)},getRemoteVolume:function(){return Z(n,!0)},getLocalVolume:function(){return Z(n,!1)},isAudioMuted:function(){return W(n,!1)},muteAudio:function(){return q(n,!1,!0)},unmuteAudio:function(){return q(n,!1,!1)},isVideoMuted:function(){return W(n,!0)},muteVideo:function(){return q(n,!0,!0)},unmuteVideo:function(){return q(n,!0,!1)},getBitrate:function(){return K(n)},send:function(e){D(n,e)},data:function(e){B(n,e)},dtmf:function(e){M(n,e)},consentDialog:e.consentDialog,iceState:e.iceState,mediaState:e.mediaState,webrtcState:e.webrtcState,slowLink:e.slowLink,onmessage:e.onmessage,createOffer:function(e){F(n,!0,e)},createAnswer:function(e){F(n,!1,e)},handleRemoteJsep:function(e){U(n,e)},onlocalstream:e.onlocalstream,onremotestream:e.onremotestream,ondata:e.ondata,ondataopen:e.ondataopen,oncleanup:e.oncleanup,ondetached:e.ondetached,hangup:function(e){Y(n,!0===e)},detach:function(e){O(n,e)}};E[n]=o,e.success(o)},error:function(e,t){Se.error(e+":",t)}})}(e)}}Se.useDefaultDependencies=function(e){var t=e&&e.fetch||fetch,n=e&&e.Promise||Promise,i=e&&e.WebSocket||WebSocket;return{newWebSocket:function(e,t){return new i(e,t)},extension:e&&e.extension||ye,isArray:function(e){return Array.isArray(e)},webRTCAdapter:e&&e.adapter||window.adapter,httpAPICall:function(e,i){var o={method:i.verb,headers:{Accept:"application/json, text/plain, */*"},cache:"no-cache"};"POST"===i.verb&&(o.headers["Content-Type"]="application/json"),void 0!==i.withCredentials&&(o.credentials=!0===i.withCredentials?"include":i.withCredentials?i.withCredentials:"omit"),void 0!==i.body&&(o.body=JSON.stringify(i.body));var a=t(e,o).catch((function(e){return n.reject({message:"Probably a network error, is the server down?",error:e})}));if(void 0!==i.timeout){var r=new n((function(e,t){var n=setTimeout((function(){return clearTimeout(n),t({message:"Request timed out",timeout:i.timeout})}),i.timeout)}));a=n.race([a,r])}return a.then((function(e){return e.ok?b(i.success)===b(Se.noop)?e.json().then((function(e){i.success(e)})).catch((function(t){return n.reject({message:"Failed to parse response body",error:t,response:e})})):void 0:n.reject({message:"API call failed",response:e})})).catch((function(e){b(i.error)===b(Se.noop)&&i.error(e.message||"<< internal error >>",e)})),a}}},Se.useOldDependencies=function(e){var t=e&&e.jQuery||jQuery,n=e&&e.WebSocket||WebSocket;return{newWebSocket:function(e,t){return new n(e,t)},isArray:function(e){return t.isArray(e)},extension:e&&e.extension||ye,webRTCAdapter:e&&e.adapter||adapter,httpAPICall:function(e,n){var i=void 0!==n.body?{contentType:"application/json",data:JSON.stringify(n.body)}:{},o=void 0!==n.withCredentials?{xhrFields:{withCredentials:n.withCredentials}}:{};return t.ajax(t.extend(i,o,{url:e,type:n.verb,cache:!1,dataType:"json",async:n.async,timeout:n.timeout,success:function(e){b(n.success)===b(Se.noop)&&n.success(e)},error:function(e,t,i){b(n.error)===b(Se.noop)&&n.error(t,i)}}))}}},Se.noop=function(){},Se.dataChanDefaultLabel="JanusDataChannel",Se.endOfCandidates=null,Se.init=function(e){if((e=e||{}).callback="function"==typeof e.callback?e.callback:Se.noop,!0===Se.initDone)e.callback();else{if("undefined"!=typeof console&&void 0!==console.log||(console={log:function(){}}),Se.trace=Se.noop,Se.debug=Se.noop,Se.vdebug=Se.noop,Se.log=Se.noop,Se.warn=Se.noop,Se.error=Se.noop,!0===e.debug||"all"===e.debug)Se.trace=console.trace.bind(console),Se.debug=console.debug.bind(console),Se.vdebug=console.debug.bind(console),Se.log=console.log.bind(console),Se.warn=console.warn.bind(console),Se.error=console.error.bind(console);else if(Array.isArray(e.debug))for(var t in e.debug){var n=e.debug[t];switch(n){case"trace":Se.trace=console.trace.bind(console);break;case"debug":Se.debug=console.debug.bind(console);break;case"vdebug":Se.vdebug=console.debug.bind(console);break;case"log":Se.log=console.log.bind(console);break;case"warn":Se.warn=console.warn.bind(console);break;case"error":Se.error=console.error.bind(console);break;default:console.error("Unknown debugging option '"+n+"' (supported: 'trace', 'debug', 'vdebug', 'log', warn', 'error')")}}var i=e.dependencies||Se.useDefaultDependencies();Se.isArray=i.isArray,Se.webRTCAdapter=i.webRTCAdapter,Se.httpAPICall=i.httpAPICall,Se.newWebSocket=i.newWebSocket,Se.extension=i.extension,Se.extension.init(),Se.listDevices=function(e,t){e="function"==typeof e?e:Se.noop,null==t&&(t={audio:!0,video:!0}),Se.isGetUserMediaAvailable()?navigator.mediaDevices.getUserMedia(t).then((function(t){navigator.mediaDevices.enumerateDevices().then((function(n){Se.debug(n),e(n);try{var i=t.getTracks();for(var o in i){var a=i[o];null!=a&&a.stop()}}catch(e){}}))})).catch((function(t){Se.error(t),e([])})):(Se.warn("navigator.mediaDevices unavailable"),e([]))},Se.attachMediaStream=function(e,t){"chrome"===Se.webRTCAdapter.browserDetails.browser?Se.webRTCAdapter.browserDetails.version>=52?e.srcObject=t:Se.error("Error attaching stream to element"):e.srcObject=t},Se.reattachMediaStream=function(e,t){"chrome"===Se.webRTCAdapter.browserDetails.browser?Se.webRTCAdapter.browserDetails.version>=52?e.srcObject=t.srcObject:void 0!==e.src?e.src=t.src:Se.error("Error reattaching stream to element"):e.srcObject=t.srcObject};var o=["iPad","iPhone","iPod"].indexOf(navigator.platform)>=0?"pagehide":"beforeunload",a=window["on"+o];if(window.addEventListener(o,(function(e){for(var t in Se.log("Closing window"),Se.sessions)null!==Se.sessions[t]&&void 0!==Se.sessions[t]&&Se.sessions[t].destroyOnUnload&&(Se.log("Destroying session "+t),Se.sessions[t].destroy({asyncRequest:!1,notifyDestroyed:!1}));a&&"function"==typeof a&&a()})),Se.safariVp8=!1,"safari"===Se.webRTCAdapter.browserDetails.browser&&Se.webRTCAdapter.browserDetails.version>=605)if(RTCRtpSender&&RTCRtpSender.getCapabilities&&RTCRtpSender.getCapabilities("video")&&RTCRtpSender.getCapabilities("video").codecs&&RTCRtpSender.getCapabilities("video").codecs.length){for(var t in RTCRtpSender.getCapabilities("video").codecs){var r=RTCRtpSender.getCapabilities("video").codecs[t];if(r&&r.mimeType&&"video/vp8"===r.mimeType.toLowerCase()){Se.safariVp8=!0;break}}Se.safariVp8?Se.log("This version of Safari supports VP8"):Se.warn("This version of Safari does NOT support VP8: if you're using a Technology Preview, try enabling the 'WebRTC VP8 codec' setting in the 'Experimental Features' Develop menu")}else{var s=new RTCPeerConnection({},{});s.createOffer({offerToReceiveVideo:!0}).then((function(e){Se.safariVp8=-1!==e.sdp.indexOf("VP8"),Se.safariVp8?Se.log("This version of Safari supports VP8"):Se.warn("This version of Safari does NOT support VP8: if you're using a Technology Preview, try enabling the 'WebRTC VP8 codec' setting in the 'Experimental Features' Develop menu"),s.close(),s=null}))}if(Se.unifiedPlan=!1,"firefox"===Se.webRTCAdapter.browserDetails.browser&&Se.webRTCAdapter.browserDetails.version>=59)Se.unifiedPlan=!0;else if("chrome"===Se.webRTCAdapter.browserDetails.browser&&Se.webRTCAdapter.browserDetails.version<72)Se.unifiedPlan=!1;else if("undefined"==typeof RTCRtpTransceiver||"currentDirection"in RTCRtpTransceiver.prototype){var c=new RTCPeerConnection;try{c.addTransceiver("audio"),Se.unifiedPlan=!0}catch(e){}c.close()}else Se.unifiedPlan=!1;Se.initDone=!0,e.callback()}},Se.isWebrtcSupported=function(){return void 0!==window.RTCPeerConnection&&null!==window.RTCPeerConnection},Se.isGetUserMediaAvailable=function(){return void 0!==navigator.mediaDevices&&null!==navigator.mediaDevices&&void 0!==navigator.mediaDevices.getUserMedia&&null!==navigator.mediaDevices.getUserMedia},Se.randomString=function(e){for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",n="",i=0;i<e;i++){var o=Math.floor(62*Math.random());n+=t.substring(o,o+1)}return n},window.Janus_Talk=Se;var _e=window.Janus_Talk,be=null,we=null,Te="tts-"+Janus_Talk.randomString(12),Ee=null;_e.init({debug:"all",callback:function(){window.stopTalk=function(){be.destroy()},window.startTalk=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.customizeStream,n=void 0===t?null:t,i=e.audio,o=void 0===i||i;_e.isWebrtcSupported()?be=new _e({server:window.EZUIKit.opt.rtcUrl,success:function(){be.attach({plugin:"rtcgw.plugin.tts",opaqueId:Te,success:function(e){we=window.tts=e,_e.log("Plugin attached! ("+we.getPlugin()+", id="+we.getId()+")");var t=window.EZUIKit.opt.talkLink;console.log("ttsUlr",t);var i={request:"start",url:t,codec:"opus",dir:"sendrecv",audio_debug:1,url_version:"1"};"gb28181"===window.EZUIKit.opt.talkType&&(i.devProto="gb28181"),_e.debug("Trying a createOffer too (audio/video sendrecv)"),we.createOffer({media:{audio:o||!0,video:!1,data:!1},simulcast:!1,simulcast2:!1,customizeStream:n,success:function(e){_e.debug("Got SDP!"),_e.debug(e),we.send({message:i,jsep:e}),void 0!==window.EZUIKit.handleTalkSuccess&&window.EZUIKit.handleTalkSuccess()},error:function(e){_e.error("WebRTC error:",e),void 0!==window.EZUIKit.handleTalkError&&window.EZUIKit.handleTalkError(e)}})},error:function(e){console.error(" -- Error attaching plugin...",e),bootbox.alert("Error attaching plugin... "+e),"undefined"!==window.EZUIKit.handleTalkError&&window.EZUIKit.handleTalkError(e)},consentDialog:function(e){_e.debug("Consent dialog should be "+(e?"on":"off")+" now")},iceState:function(e){_e.log("ICE state changed to "+e)},mediaState:function(e,t){_e.log("Janus "+(t?"started":"stopped")+" receiving our "+e)},webrtcState:function(e){_e.log("Janus says our WebRTC PeerConnection is "+(e?"up":"down")+" now")},slowLink:function(e,t){_e.warn("Janus reports problems "+(e?"sending":"receiving")+" packets on this PeerConnection ("+t+" lost packets)")},onmessage:function(e,t){_e.debug(" ::: Got a message :::"),_e.debug(e),null!=t&&(_e.debug("Handling SDP as well..."),_e.debug(t),we.handleRemoteJsep({jsep:t}));var n=e.result;if(null!=n){if("done"===n)return bootbox.alert("The TTS Test is over"),null!=Ee&&Ee.stop(),void(Ee=null);"msg"===n&&void 0!==window.EZUIKit.handleTalkMessage&&window.EZUIKit.handleTalkMessage(e),"slow_link"===n.status&&toastr.warning("Janus apparently missed many packets we sent, maybe we should reduce the bitrate","Packet loss?",{timeOut:2e3})}},onlocalstream:function(e){_e.debug(" ::: Got a local stream :::"),_e.debug(e),_e.attachMediaStream(document.getElementById("myaudio"),e),"completed"!==we.webrtcStuff.pc.iceConnectionState&&"connected"!==we.webrtcStuff.pc.iceConnectionState&&(null==Ee?document.getElementById("audioright"):Ee.spin());var t=e.getAudioTracks();null==t||t.length},onremotestream:function(e){_e.debug(" ::: Got a remote stream :::"),_e.debug(e),_e.attachMediaStream(document.getElementById("peeraudio"),e);var t=e.getAudioTracks();null==t||0===t.length||document.getElementById("peeraudio").play()},ondataopen:function(e){_e.log("The DataChannel is available!")},ondata:function(e){_e.debug("We got data from the DataChannel! "+e)},oncleanup:function(){_e.log(" ::: Got a cleanup notification :::"),null!=Ee&&Ee.stop(),Ee=null}})},error:function(e){_e.error(e),"undefined"!==window.EZUIKit.handleTalkError&&window.EZUIKit.handleTalkError(e)},destroyed:function(){}}):bootbox.alert("No WebRTC support... ")}}});var Pe=function(){return m((function e(t){var n=this;l(this,e),this.jSPlugin=t,this.pluginStatus=new U(this,this.jSPlugin.params.id),this.talkChannelNo=t.talkChannelNo,this.gainNode=null,this.volumeGain=null,this.volumeChangeInterval=null,this.microphoneId=null;var i=document.createElement("div");i.id="audioleft";var o=document.createElement("audio");o.id="myaudio",o.muted=!0,o.setAttribute("autoplay",!0),o.setAttribute("controls",!0),i.appendChild(o),i.style="display:none;";var a=document.createElement("div");a.id="audioright",a.style="display:none;";var r=document.createElement("audio");r.id="peeraudio",r.setAttribute("autoplay",!0),r.setAttribute("controls",!0),a.appendChild(r),window.EZUIKit.handleTalkError=function(e){console.log("talk err",e),void 0!==n.jSPlugin.handleTalkError&&n.jSPlugin.handleTalkError(e)},window.EZUIKit.handleTalkSuccess=function(e){console.log("talk success",e),void 0!==n.jSPlugin.handleTalkSuccess&&n.jSPlugin.handleTalkSuccess(e)},window.EZUIKit.opt={rtcUrl:"",talkLink:"",ttsUrl:"",stream:"",deviceSerial:A(this.jSPlugin.url).deviceSerial,channelNo:A(this.jSPlugin.url).channelNo},this.audioLeft=i,this.audioRight=a,document.body.appendChild(i),document.body.appendChild(a)}),[{key:"toString",value:function(){return"".concat(this.coreX,"-").concat(this.coreY)}},{key:"destroy",value:function(){document.body.removeChild(this.audioLeft),document.body.removeChild(this.audioRight)}},{key:"startTalk",value:function(e){var t=this,n=this;new Promise((function(e,n){t.jSPlugin.capacity&&t.jSPlugin.capacity.support_switch_talkmode&&"1"==t.jSPlugin.capacity.support_switch_talkmode?fetch(t.jSPlugin.env.domain+"/api/service/device/talkMode"+"?deviceSerial=".concat(A(t.jSPlugin.url).deviceSerial),{method:"GET",headers:{accessToken:t.jSPlugin.accessToken||t.jSPlugin.token.deviceToken.global}}).then((function(e){return e.json()})).then((function(n){n.meta&&200==n.meta.code?n.data&&n.data.valueInfo&&0==n.data.valueInfo.mode?fetch(t.jSPlugin.env.domain+"/api/v3/device/talkMode"+"?deviceSerial=".concat(A(t.jSPlugin.url).deviceSerial,"&channelNo=").concat(A(t.jSPlugin.url).channelNo,"&mode=1"),{method:"PUT",headers:{accessToken:t.jSPlugin.accessToken||t.jSPlugin.token.deviceToken.video}}).then((function(e){return e.json()})).then((function(t){t.meta&&200==t.meta.code?e():e({code:-1,msg:"对讲模式切换失败",res:t})})).catch((function(t){e({code:-1,msg:"对讲模式切换失败",res:t})})):e():e({code:-1,msg:"获取当前对讲模式失败",res:n})})).catch((function(t){e({code:-1,msg:"获取当前对讲模式失败",res:t})})):e({code:-1,msg:"当前设备不支持对讲模式切换"})})).then((function(i){if(t.jSPlugin.capacity&&t.jSPlugin.capacity.support_talk&&(!t.jSPlugin.capacity||"3"!==t.jSPlugin.capacity.support_talk&&"1"!==t.jSPlugin.capacity.support_talk))return"function"==typeof t.jSPlugin.params.handleError&&(t.pluginStatus.loadingSetText({text:"设备不支持对讲",color:"red",delayClear:2e3}),t.jSPlugin.params.handleError({msg:"设备不支持对讲",retcode:-1e3,id:t.jSPlugin.params.id,type:"handleError"})),console.log("设备不支持对讲"),!1;var o=new FormData;if(o.append("accessToken",t.jSPlugin.accessToken||t.jSPlugin.token.deviceToken.video),o.append("deviceSerial",A(t.jSPlugin.url).deviceSerial),o.append("channelNo",t.jSPlugin.channelNo||"0"),t.jSPlugin.params.extraParams&&t.jSPlugin.params.extraParams.talkParams&&"object"===b(t.jSPlugin.params.extraParams.talkParams))for(var a in t.jSPlugin.params.extraParams.talkParams)data.append(a,t.jSPlugin.params.extraParams.talkParams[a]);fetch(t.jSPlugin.env.domain+"/api/lapp/live/talk/url",{method:"POST",body:o}).then((function(e){return e.json()})).then((function(i){if(200==i.code){var o=i.data;if(o){var a=o.rtcUrl;if(-1===a.indexOf("ws")&&(a=a.replace("https","wss").replace("rtcgw","rtcgw-ws")),window.EZUIKit.opt.rtcUrl=a,window.EZUIKit.opt.ttsUrl="tts://"+o.ttsUrl,t.jSPlugin.params.extraParams&&t.jSPlugin.params.extraParams.ttsParams)if("string"==typeof t.jSPlugin.params.extraParams.ttsParams)window.EZUIKit.opt.ttsUrl+="&"+t.jSPlugin.params.extraParams.ttsParams;else if("object"===b(t.jSPlugin.params.extraParams.ttsParams))for(var r in t.jSPlugin.params.extraParams.ttsParams)window.EZUIKit.opt.ttsUrl+="&"+r+"="+t.jSPlugin.params.extraParams.ttsParams[r];window.EZUIKit.opt.deviceSerial=A(t.jSPlugin.url).deviceSerial,window.EZUIKit.opt.channelNo=t.talkChannelNo||"0";var s="talk?dev="+window.EZUIKit.opt.deviceSerial+"&chann="+window.EZUIKit.opt.channelNo+"&encodetype=2";window.EZUIKit.opt.talkLink=window.EZUIKit.opt.ttsUrl.split("?")[0]+"/"+s,o.ttsUrl.indexOf("gb28181")>-1&&(window.EZUIKit.opt.talkType="gb28181"),e&&e(o.ttsUrl.indexOf("gb28181")>-1||-1!==window.EZUIKit.opt.deviceSerial.indexOf(":")),window.EZUIKit.opt.stream=t.jSPlugin.accessToken?o.stream:t.jSPlugin.token.streamToken.talk,window.startTalk({customizeStream:n._customizeStream.bind(n),audio:!t.microphoneId||{deviceId:t.microphoneId}}),t.observeVolumeChange(),t.jSPlugin.eventEmitter&&t.jSPlugin.eventEmitter.emit("startTalk",{eventType:"startTalk",code:0,target:t,msg:"开启对讲"})}}else console.log(i.code,t.jSPlugin.i18n.t("38"+i.code)),t.pluginStatus.loadingSetText({text:i.msg||t.jSPlugin.i18n.t("38"+i.code),color:"red",delayClear:2e3}),t.jSPlugin.eventEmitter&&t.jSPlugin.eventEmitter.emit("startTalk",{eventType:"startTalk",code:-1,target:t,msg:i.msg||t.jSPlugin.i18n.t("38"+i.code)}),"function"==typeof t.jSPlugin.params.handleError&&t.jSPlugin.params.handleError({msg:i.msg||t.jSPlugin.i18n.t("38"+i.code),retcode:i.code,id:t.jSPlugin.params.id,type:"handleError"})})).catch((function(e){console.log("err",e)}))})).catch((function(e){console.log("对讲开启失败:",e)}))}},{key:"stopTalk",value:function(){var e=this;try{window.stopTalk()}catch(e){console.log("stopTalk error:",e)}this.gainNode=null,clearInterval(this.volumeChangeInterval),this.volumeChangeInterval=null,this.jSPlugin.eventEmitter&&(setTimeout((function(){e.jSPlugin.eventEmitter.emit("volumeChange",{eventType:"volumeChange",code:0,target:e,data:0,msg:"音量变化"})}),200),this.jSPlugin.eventEmitter.emit("stopTalk",{eventType:"stopTalk",code:0,target:this,msg:"结束对讲"})),document.getElementById("myaudio")&&document.getElementById("myaudio").srcObject&&document.getElementById("myaudio").srcObject.getTracks()[0].stop()}},{key:"changeTalkChannelNo",value:function(e){window.EZUIKit.opt&&window.EZUIKit.opt.channelNo&&(this.talkChannelNo=e,window.EZUIKit.opt.channelNo=e)}},{key:"_customizeStream",value:function(e){var t=this;return new Promise((function(n,i){var o,a=new window.AudioContext;t.gainNode=a.createGain();var r=a.createMediaStreamSource(e);t.gainNode.gain.value=null!==(o=t.volumeGain)&&void 0!==o?o:1;var s=a.createMediaStreamDestination();r.connect(t.gainNode),t.gainNode.connect(s),n(s.stream)}))}},{key:"setVolumeGain",value:function(e){var t=["",null].includes(e)?1:Number(e);return"number"==typeof t&&t>=0?(this.volumeGain=Math.min(t,10),this.gainNode&&(this.gainNode.gain.value=this.volumeGain),{code:0,msg:"成功",res:null}):{code:-1,msg:"参数格式有误",res:null}}},{key:"observeVolumeChange",value:function(){var e=this,t=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).interval,n=void 0===t?100:t;this.volumeChangeInterval&&(clearInterval(volumeChangeInterval),volumeChangeInterval=null),this.volumeChangeInterval=setInterval((function(){var t,n,i,o,a;null===(t=window.tts)||void 0===t||null===(n=t.webrtcStuff)||void 0===n||null===(i=n.pc)||void 0===i||null===(o=i.getStats)||void 0===o||null===(a=o.call(i))||void 0===a||a.then((function(t){t.forEach((function(t){var n,i;"media-source"===t.type&&(null===(n=e.jSPlugin)||void 0===n||null===(i=n.eventEmitter)||void 0===i||i.emit("volumeChange",{eventType:"volumeChange",code:0,target:e,data:t.audioLevel,msg:"音量变化"}))}))}))}),n)}},{key:"getMicrophonePermission",value:function(){return new Promise((function(e,t){navigator.mediaDevices.getUserMedia({audio:!0}).then((function(t){t.getTracks().forEach((function(e){e.stop()})),e({code:0,msg:"成功",res:null})})).catch((function(t){e({code:-1,msg:"获取麦克风权限失败",res:t})}))}))}},{key:"getMicrophonesList",value:function(){return new Promise((function(e,t){navigator.mediaDevices?navigator.mediaDevices.enumerateDevices().then((function(t){var n=[];t.map((function(e){"audioinput"==e.kind&&n.push(e)})),e({code:0,msg:"成功",res:n})})):e({code:-1,msg:"未查询到相关设备",res:null})}))}},{key:"setProfile",value:function(e){var t=this,n=e.microphoneId;n!==this.microphoneId&&(this.microphoneId=n,this.gainNode&&(window.stopTalk(),setTimeout((function(){window.startTalk({customizeStream:t._customizeStream.bind(t),audio:!t.microphoneId||{deviceId:t.microphoneId}})}),200)))}}])}(),ke=function(){function e(t){var n=this;l(this,e),this.jSPlugin=t,this.pluginStatus=new U(this,this.jSPlugin.id),e._instanceStyle();var i=document.createElement("div");i.className="mobile-ez-ptz-container",i.id="mobile-ez-ptz-container";var o=window.innerHeight;i.style="display:inline-block;width: ".concat(this.jSPlugin.width,"px;text-align:center;height: ").concat(o-this.jSPlugin.height-5,"px");var a=document.createElement("div");a.className="live-ptz-title",a.id="live-ptz-title",a.innerHTML=this.jSPlugin.i18n.t("BTN_PTZ"),document.getElementById("live-ptz-title")||i.appendChild(a);var r=document.createElement("div");r.className="live-ptz-intro",r.id="live-ptz-intro",r.innerHTML=this.jSPlugin.i18n.t("MOBILE_PTZ_TIPS"),document.getElementById("live-ptz-intro")||i.appendChild(r);var s=document.createElement("div");s.id="mobile-ez-ptz-item",s.className="mobile-ez-ptz-wrap",s.innerHTML='\n <div class="mobile-ez-ptz-container" id="mobile-ez-ptz-container">\n <div class="ez-ptz-main center"></div>\n <div class="mobile-ez-ptz-icon top default"></div>\n <div class="mobile-ez-ptz-icon left default"></div>\n <div class="mobile-ez-ptz-icon bottom default"></div>\n <div class="mobile-ez-ptz-icon right default"></div>\n </div>\n ',document.getElementById("mobile-ez-ptz-item")||i.appendChild(s),x(i,document.getElementById("".concat(this.jSPlugin.id,"-wrap"))),document.getElementById("mobile-ez-ptz-item").ontouchstart=function(e){e.preventDefault(),console.log("触摸开始"),n._handlePtzTouch(e,"start")},document.getElementById("mobile-ez-ptz-item").ontouchend=function(e){e.preventDefault(),console.log("触摸结束",e),n._handlePtzTouch(e,"stop")},document.getElementById("mobile-ez-ptz-item").onmousedown=function(e){e.preventDefault(),console.log("触摸开始"),n._handlePtzTouch(e,"start")},document.getElementById("mobile-ez-ptz-item").onmouseup=function(e){e.preventDefault(),console.log("触摸结束",e),n._handlePtzTouch(e,"stop")}}return m(e,[{key:"show",value:function(){document.getElementById("mobile-ez-ptz-container").style="display: inline-block"}},{key:"hide",value:function(){document.getElementById("mobile-ez-ptz-container").style="display: none"}},{key:"_handlePtzTouch",value:function(e,t){var n=this,i=document.getElementById("mobile-ez-ptz-item").getBoundingClientRect(),o=i.left+130,a=i.top+130,r=(e.x||e.changedTouches[0].clientX)-o,s=(e.y||e.changedTouches[0].clientY)-a,c=0,l=this.jSPlugin.env.domain+"/api/lapp/device/ptz/start",d=this.jSPlugin.accessToken||this.jSPlugin.token.deviceToken.video;Math.abs(r)>Math.abs(s)?r>0?(c=3,document.getElementsByClassName("mobile-ez-ptz-icon")[3].className=document.getElementsByClassName("mobile-ez-ptz-icon")[3].className.replace("default","active")):(c=2,document.getElementsByClassName("mobile-ez-ptz-icon")[1].className=document.getElementsByClassName("mobile-ez-ptz-icon")[1].className.replace("default","active")):s>0?(c=1,document.getElementsByClassName("mobile-ez-ptz-icon")[2].className=document.getElementsByClassName("mobile-ez-ptz-icon")[2].className.replace("default","active")):(c=0,document.getElementsByClassName("mobile-ez-ptz-icon")[0].className=document.getElementsByClassName("mobile-ez-ptz-icon")[0].className.replace("default","active")),document.getElementById("mobile-ez-ptz-item").style="background-image:linear-gradient(".concat(0===c?180:1===c?0:2===c?90:270,"deg, #c0ddf1 0%, rgba(100,143,252,0.00) 50%)"),"stop"===t&&(l=this.jSPlugin.env.domain+"/api/lapp/device/ptz/stop",d=this.jSPlugin.accessToken||this.jSPlugin.token.deviceToken.video,document.getElementById("mobile-ez-ptz-item").style="",document.getElementsByClassName("mobile-ez-ptz-icon")[3].className=document.getElementsByClassName("mobile-ez-ptz-icon")[3].className.replace("active","default"),document.getElementsByClassName("mobile-ez-ptz-icon")[1].className=document.getElementsByClassName("mobile-ez-ptz-icon")[1].className.replace("active","default"),document.getElementsByClassName("mobile-ez-ptz-icon")[2].className=document.getElementsByClassName("mobile-ez-ptz-icon")[2].className.replace("active","default"),document.getElementsByClassName("mobile-ez-ptz-icon")[0].className=document.getElementsByClassName("mobile-ez-ptz-icon")[0].className.replace("active","default"));var u=new FormData;u.append("deviceSerial",A(this.jSPlugin.url).deviceSerial),u.append("channelNo",A(this.jSPlugin.url).channelNo),u.append("speed",1),u.append("direction",c),u.append("accessToken",d),fetch(l,{method:"POST",body:u}).then((function(e){return e.json()})).then((function(e){if(200==e.code);else{console.log(e.code,n.jSPlugin.i18n.t("38"+e.code));var t=n.jSPlugin.i18n.t("38"+e.code)||e.msg;n.pluginStatus.loadingSetText({text:t,color:"red",delayClear:2e3}),60005!=e.code&&60002!=e.code&&60003!=e.code&&60004!=e.code||(document.getElementById("mobile-ez-ptz-item").style="background-image:linear-gradient(".concat(0===c?180:1===c?0:2===c?90:270,"deg, #f45656 0%, rgba(100,143,252,0.00) 50%)"))}})).catch((function(e){console.log("云台调用异常",e)}))}}],[{key:"_instanceStyle",value:function(){e._STYLE||(e._STYLE=document.createElement("style"),e._STYLE.innerHTML="\n body{\n padding: 0;\n margin: 0;\n }\n #mobile-ez-ptz-container {\n display: inline-block;\n width: 375px;\n text-align: center;\n }\n .live-ptz-title{\n height: 25px;\n font-size: 18px;\n color: #2c2c2c;\n text-align: center;\n font-weight: 700;\n margin: 24px 0 12px;\n }\n .live-ptz-intro {\n margin-bottom: 24px;\n color: #aaaaaa;\n }\n .mobile-ez-ptz-wrap {\n background-image: linear-gradient(180deg, #f6f8ff 0%, #ededed6b 50%)\n }\n #mobile-ez-ptz-container .mobile-ez-ptz-container {\n position: relative;\n width: 260px;\n height: 260px;\n background: rgba(255, 255, 255, 0.80);\n border: 1px solid rgba(255, 255, 255, 0.80);\n border-radius: 100%;\n cursor: pointer;\n overflow: hidden;\n margin: auto;\n }\n\n #mobile-ez-ptz-container .mobile-ez-ptz-container .mobile-ez-ptz-icon.top {\n width: 0;\n height: 0;\n border-left: 6px solid transparent;\n border-right: 6px solid transparent;\n border-bottom: 6px solid #aaaaaa;\n position: absolute;\n display: inline-block;\n left: calc(50% - 6px);\n top: 10px;\n }\n\n #mobile-ez-ptz-container .mobile-ez-ptz-container .mobile-ez-ptz-icon.top.active {\n border-bottom-color: #1890FF;\n }\n\n #mobile-ez-ptz-container .mobile-ez-ptz-container .mobile-ez-ptz-icon.bottom {\n width: 0;\n height: 0;\n border-left: 6px solid transparent;\n border-right: 6px solid transparent;\n border-top: 6px solid #aaaaaa;\n position: absolute;\n display: inline-block;\n left: calc(50% - 6px);\n bottom: 10px;\n }\n\n #mobile-ez-ptz-container .mobile-ez-ptz-container .mobile-ez-ptz-icon.bottom.active {\n border-top-color: #1890FF;\n\n }\n\n #mobile-ez-ptz-container .mobile-ez-ptz-container .mobile-ez-ptz-icon.right {\n width: 0;\n height: 0;\n border-top: 6px solid transparent;\n border-bottom: 6px solid transparent;\n border-left: 6px solid #aaaaaa;\n position: absolute;\n display: inline-block;\n top: calc(50% - 6px);\n right: 10px;\n }\n\n #mobile-ez-ptz-container .mobile-ez-ptz-container .mobile-ez-ptz-icon.right.active {\n border-left-color: #1890FF;\n\n }\n\n #mobile-ez-ptz-container .mobile-ez-ptz-container .mobile-ez-ptz-icon.left {\n width: 0;\n height: 0;\n border-top: 6px solid transparent;\n border-bottom: 6px solid transparent;\n border-right: 6px solid #aaaaaa;\n position: absolute;\n display: inline-block;\n top: calc(50% - 6px);\n left: 10px;\n }\n\n #mobile-ez-ptz-container .mobile-ez-ptz-container .mobile-ez-ptz-icon.left.active {\n border-right-color: #1890FF;\n\n }\n\n #mobile-ez-ptz-container .mobile-ez-ptz-container .ez-ptz-main.center {\n width: 52px;\n height: 52px;\n background: #FFFFFF;\n border: 2px solid #eee;\n border-radius: 100%;\n top: calc(50% - 26px);\n left: calc(50% - 26px);\n position: absolute;\n /* box-shadow: 0px -39px 40px 6px #1890ff; */\n }\n\n #mobile-ez-ptz-container .mobile-ez-ptz-wrap {\n display: inline-block;\n padding: 24px 24px;\n border-radius: 100%;\n overflow: hidden;\n }\n\n #mobile-ez-ptz-container .ez-ptz-close {\n position: absolute;\n color: #FFFFFF;\n top: 0;\n right: 0px;\n }",document.getElementsByTagName("head")[0].appendChild(e._STYLE))}}])}();p(ke,"_STYLE",void 0);var Ce={header:{color:"#FFFFFF",backgroundColor:"rgba(0,0,0,0.8)",activeColor:"#1890FF",btnList:[{btnKey:"c1cbc1d4e86d49a0981f54beea95280a-f7896c8942c9476fb439370dd974f1c0-header-0",iconId:"deviceID",part:"left",defaultActive:0,isrender:0,themeId:"f7896c8942c9476fb439370dd974f1c0"},{btnKey:"c1cbc1d4e86d49a0981f54beea95280a-f7896c8942c9476fb439370dd974f1c0-header-1",iconId:"deviceName",part:"left",defaultActive:0,isrender:0,themeId:"f7896c8942c9476fb439370dd974f1c0"},{btnKey:"c1cbc1d4e86d49a0981f54beea95280a-f7896c8942c9476fb439370dd974f1c0-header-2",iconId:"cloudRec",part:"right",defaultActive:0,isrender:0,themeId:"f7896c8942c9476fb439370dd974f1c0"},{btnKey:"c1cbc1d4e86d49a0981f54beea95280a-f7896c8942c9476fb439370dd974f1c0-header-3",iconId:"rec",part:"right",defaultActive:0,isrender:0,themeId:"f7896c8942c9476fb439370dd974f1c0"}]},footer:{color:"#FFFFFF",backgroundColor:"rgb(0 0 0 / 0%)",activeColor:"#1890FF",btnList:[{btnKey:"c1cbc1d4e86d49a0981f54beea95280a-f7896c8942c9476fb439370dd974f1c0-footer-0",iconId:"play",part:"left",defaultActive:1,isrender:0,themeId:"f7896c8942c9476fb439370dd974f1c0"},{btnKey:"c1cbc1d4e86d49a0981f54beea95280a-f7896c8942c9476fb439370dd974f1c0-footer-1",iconId:"capturePicture",part:"left",defaultActive:0,isrender:0,themeId:"f7896c8942c9476fb439370dd974f1c0"},{btnKey:"c1cbc1d4e86d49a0981f54beea95280a-f7896c8942c9476fb439370dd974f1c0-footer-2",iconId:"sound",part:"left",defaultActive:0,isrender:0,themeId:"f7896c8942c9476fb439370dd974f1c0"},{btnKey:"c1cbc1d4e86d49a0981f54beea95280a-f7896c8942c9476fb439370dd974f1c0-footer-3",iconId:"pantile",part:"left",defaultActive:0,isrender:0,themeId:"f7896c8942c9476fb439370dd974f1c0"},{btnKey:"c1cbc1d4e86d49a0981f54beea95280a-f7896c8942c9476fb439370dd974f1c0-footer-4",iconId:"recordvideo",part:"left",defaultActive:0,isrender:0,themeId:"f7896c8942c9476fb439370dd974f1c0"},{btnKey:"c1cbc1d4e86d49a0981f54beea95280a-f7896c8942c9476fb439370dd974f1c0-footer-5",iconId:"talk",part:"left",defaultActive:0,isrender:0,themeId:"f7896c8942c9476fb439370dd974f1c0"},{btnKey:"c1cbc1d4e86d49a0981f54beea95280a-f7896c8942c9476fb439370dd974f1c0-footer-6",iconId:"hd",part:"right",defaultActive:0,isrender:0,themeId:"f7896c8942c9476fb439370dd974f1c0"},{btnKey:"c1cbc1d4e86d49a0981f54beea95280a-f7896c8942c9476fb439370dd974f1c0-footer-7",iconId:"webExpend",part:"right",defaultActive:0,isrender:0,themeId:"f7896c8942c9476fb439370dd974f1c0"},{btnKey:"c1cbc1d4e86d49a0981f54beea95280a-f7896c8942c9476fb439370dd974f1c0-footer-8",iconId:"expend",part:"right",defaultActive:0,isrender:0,themeId:"f7896c8942c9476fb439370dd974f1c0"}]}},Ie={data:{header:{color:"#FFFFFF",backgroundColor:"rgba(0,0,0,0.8)",activeColor:"#1890FF",btnList:[{iconId:"deviceID",part:"left",defaultActive:0,isrender:1},{iconId:"deviceName",part:"left",defaultActive:0,isrender:1},{iconId:"cloudRec",part:"right",defaultActive:0,isrender:0},{iconId:"rec",part:"right",defaultActive:0,isrender:0}]},footer:{color:"#FFFFFF",backgroundColor:"rgba(0,0,0,0.8)",activeColor:"#1890FF",btnList:[{iconId:"play",part:"left",defaultActive:1,isrender:1},{iconId:"capturePicture",part:"left",defaultActive:0,isrender:1},{iconId:"sound",part:"left",defaultActive:1,isrender:1},{iconId:"pantile",part:"left",defaultActive:0,isrender:1},{iconId:"recordvideo",part:"left",defaultActive:0,isrender:1},{iconId:"talk",part:"left",defaultActive:0,isrender:1},{iconId:"zoom",part:"left",defaultActive:0,isrender:1},{iconId:"hd",part:"right",defaultActive:0,isrender:1},{iconId:"webExpend",part:"right",defaultActive:0,isrender:0},{iconId:"expend",part:"right",defaultActive:0,isrender:1}]}}},xe={data:{header:{color:"#FFFFFF",backgroundColor:"rgba(0,0,0,0.8)",activeColor:"#1890FF",btnList:[{iconId:"deviceID",part:"left",defaultActive:0,isrender:1},{iconId:"deviceName",part:"left",defaultActive:0,isrender:1},{iconId:"cloudRec",part:"right",defaultActive:0,isrender:1},{iconId:"rec",part:"right",defaultActive:0,isrender:1}]},footer:{color:"#FFFFFF",backgroundColor:"rgba(0,0,0,0.8)",activeColor:"#1890FF",btnList:[{iconId:"play",part:"left",defaultActive:1,isrender:1},{iconId:"capturePicture",part:"left",defaultActive:0,isrender:1},{iconId:"sound",part:"left",defaultActive:1,isrender:1},{iconId:"pantile",part:"left",defaultActive:0,isrender:0},{iconId:"recordvideo",part:"left",defaultActive:0,isrender:1},{iconId:"talk",part:"left",defaultActive:0,isrender:0},{iconId:"zoom",part:"left",defaultActive:0,isrender:1},{iconId:"speed",part:"right",defaultActive:0,isrender:1},{iconId:"hd",part:"right",defaultActive:0,isrender:0},{iconId:"webExpend",part:"right",defaultActive:0,isrender:0},{iconId:"expend",part:"right",defaultActive:0,isrender:1}]}}},je={data:{header:{color:"#FFFFFF",backgroundColor:"rgba(0,0,0,0.8)",activeColor:"#1890FF",btnList:[{btnKey:"c1cbc1d4e86d49a0981f54beea95280a-f7896c8942c9476fb439370dd974f1c0-header-0",iconId:"deviceID",part:"left",defaultActive:0,isrender:1},{btnKey:"c1cbc1d4e86d49a0981f54beea95280a-f7896c8942c9476fb439370dd974f1c0-header-1",iconId:"deviceName",part:"left",defaultActive:0,isrender:1},{btnKey:"c1cbc1d4e86d49a0981f54beea95280a-f7896c8942c9476fb439370dd974f1c0-header-2",iconId:"cloudRec",part:"right",defaultActive:0,isrender:0},{btnKey:"c1cbc1d4e86d49a0981f54beea95280a-f7896c8942c9476fb439370dd974f1c0-header-3",iconId:"rec",part:"right",defaultActive:0,isrender:0}]},footer:{color:"#FFFFFF",backgroundColor:"rgba(0,0,0,0.8)",activeColor:"#1890FF",btnList:[{iconId:"play",part:"left",defaultActive:1,isrender:1},{iconId:"capturePicture",part:"left",defaultActive:0,isrender:1},{iconId:"sound",part:"left",defaultActive:1,isrender:1},{iconId:"pantile",part:"left",defaultActive:0,isrender:1},{iconId:"recordvideo",part:"left",defaultActive:0,isrender:1},{iconId:"talk",part:"left",defaultActive:0,isrender:1},{iconId:"zoom",part:"left",defaultActive:0,isrender:1},{iconId:"speed",part:"right",defaultActive:0,isrender:0},{iconId:"hd",part:"right",defaultActive:0,isrender:1},{iconId:"webExpend",part:"right",defaultActive:0,isrender:1},{iconId:"expend",part:"right",defaultActive:0,isrender:1}]}}},Ae={data:{header:{color:"#FFFFFF",backgroundColor:"rgba(0,0,0,0.8)",activeColor:"#1890FF",btnList:[{btnKey:"c1cbc1d4e86d49a0981f54beea95280a-f7896c8942c9476fb439370dd974f1c0-header-0",iconId:"deviceID",part:"left",defaultActive:0,isrender:1},{btnKey:"c1cbc1d4e86d49a0981f54beea95280a-f7896c8942c9476fb439370dd974f1c0-header-1",iconId:"deviceName",part:"left",defaultActive:0,isrender:1},{btnKey:"c1cbc1d4e86d49a0981f54beea95280a-f7896c8942c9476fb439370dd974f1c0-header-2",iconId:"cloudRec",part:"right",defaultActive:0,isrender:0},{btnKey:"c1cbc1d4e86d49a0981f54beea95280a-f7896c8942c9476fb439370dd974f1c0-header-3",iconId:"rec",part:"right",defaultActive:0,isrender:0}]},footer:{color:"#FFFFFF",backgroundColor:"rgba(0,0,0,0.8)",activeColor:"#1890FF",btnList:[{iconId:"play",part:"left",defaultActive:1,isrender:1},{iconId:"talk",part:"left",defaultActive:0,isrender:1},{iconId:"sound",part:"left",defaultActive:1,isrender:1},{iconId:"capturePicture",part:"left",defaultActive:0,isrender:1},{iconId:"recordvideo",part:"left",defaultActive:0,isrender:1},{iconId:"pantile",part:"left",defaultActive:0,isrender:0},{iconId:"zoom",part:"left",defaultActive:0,isrender:1},{iconId:"hd",part:"right",defaultActive:0,isrender:1},{iconId:"webExpend",part:"right",defaultActive:0,isrender:0},{iconId:"expend",part:"right",defaultActive:0,isrender:1}]}}},De={data:{header:{color:"#FFFFFF",backgroundColor:"rgba(0,0,0,0.8)",activeColor:"#1890FF",btnList:[{iconId:"deviceID",part:"left",defaultActive:0,isrender:0},{iconId:"deviceName",part:"left",defaultActive:0,isrender:0},{iconId:"cloudRec",part:"right",defaultActive:0,isrender:0},{iconId:"rec",part:"right",defaultActive:0,isrender:0}]},footer:{color:"#FFFFFF",backgroundColor:"#000000",activeColor:"#1890FF",btnList:[{iconId:"play",part:"left",defaultActive:1,isrender:0},{iconId:"capturePicture",part:"left",defaultActive:0,isrender:0},{iconId:"sound",part:"left",defaultActive:1,isrender:0},{iconId:"pantile",part:"left",defaultActive:0,isrender:0},{iconId:"recordvideo",part:"left",defaultActive:0,isrender:0},{iconId:"talk",part:"left",defaultActive:0,isrender:0},{iconId:"zoom",part:"left",defaultActive:0,isrender:0},{iconId:"hd",part:"right",defaultActive:0,isrender:0},{iconId:"webExpend",part:"right",defaultActive:0,isrender:0},{iconId:"expend",part:"right",defaultActive:0,isrender:0}]}}},Re={data:{header:{color:"#FFFFFF",backgroundColor:"rgba(0,0,0,0.8)",activeColor:"#1890FF",btnList:[{iconId:"deviceID",part:"left",defaultActive:0,isrender:1},{iconId:"deviceName",part:"left",defaultActive:0,isrender:1},{iconId:"cloudRec",part:"right",defaultActive:0,isrender:0},{iconId:"rec",part:"right",defaultActive:0,isrender:0}]},footer:{color:"#FFFFFF",backgroundColor:"rgba(0,0,0,0.8)",activeColor:"#1890FF",btnList:[{iconId:"play",part:"left",defaultActive:1,isrender:1},{iconId:"capturePicture",part:"left",defaultActive:0,isrender:0},{iconId:"talk",part:"left",defaultActive:0,isrender:1},{iconId:"sound",part:"left",defaultActive:1,isrender:1},{iconId:"pantile",part:"left",defaultActive:0,isrender:0},{iconId:"recordvideo",part:"left",defaultActive:0,isrender:0},{iconId:"hd",part:"right",defaultActive:0,isrender:0},{iconId:"zoom",part:"left",defaultActive:0,isrender:0},{iconId:"webExpend",part:"right",defaultActive:0,isrender:0},{iconId:"expend",part:"right",defaultActive:0,isrender:1}]}}},Le={data:{header:{color:"#FFFFFF",backgroundColor:"rgba(0,0,0,0.8)",activeColor:"#1890FF",btnList:[{iconId:"deviceID",part:"left",defaultActive:0,isrender:1},{iconId:"deviceName",part:"left",defaultActive:0,isrender:1},{iconId:"cloudRec",part:"right",defaultActive:0,isrender:1},{iconId:"cloudRecord",part:"right",defaultActive:0,isrender:1},{iconId:"rec",part:"right",defaultActive:0,isrender:1}]},footer:{color:"#FFFFFF",backgroundColor:"rgba(0,0,0,0.8)",activeColor:"#1890FF",btnList:[{iconId:"play",part:"left",defaultActive:1,isrender:1},{iconId:"capturePicture",part:"left",defaultActive:0,isrender:1},{iconId:"sound",part:"left",defaultActive:1,isrender:1},{iconId:"pantile",part:"left",defaultActive:0,isrender:0},{iconId:"recordvideo",part:"left",defaultActive:0,isrender:1},{iconId:"zoom",part:"left",defaultActive:0,isrender:1},{iconId:"speed",part:"right",defaultActive:0,isrender:1},{iconId:"hd",part:"right",defaultActive:0,isrender:0},{iconId:"webExpend",part:"right",defaultActive:0,isrender:1},{iconId:"expend",part:"right",defaultActive:0,isrender:1}]}}},Be={data:{header:{color:"#FFFFFF",backgroundColor:"rgba(0,0,0,0.8)",activeColor:"#1890FF",btnList:[{iconId:"deviceID",part:"left",defaultActive:0,isrender:0},{iconId:"deviceName",part:"left",defaultActive:0,isrender:0},{iconId:"cloudRec",part:"right",defaultActive:0,isrender:0},{iconId:"rec",part:"right",defaultActive:0,isrender:0}]},footer:{color:"#FFFFFF",backgroundColor:"#00000080",activeColor:"#1890FF",btnList:[{iconId:"play",part:"left",defaultActive:1,isrender:0},{iconId:"capturePicture",part:"left",defaultActive:0,isrender:0},{iconId:"sound",part:"left",defaultActive:1,isrender:0},{iconId:"pantile",part:"left",defaultActive:0,isrender:0},{iconId:"recordvideo",part:"left",defaultActive:0,isrender:0},{iconId:"talk",part:"left",defaultActive:0,isrender:0},{iconId:"zoom",part:"left",defaultActive:0,isrender:0},{iconId:"speed",part:"right",defaultActive:0,isrender:0},{iconId:"hd",part:"right",defaultActive:0,isrender:0},{iconId:"webExpend",part:"right",defaultActive:0,isrender:0},{iconId:"expend",part:"right",defaultActive:0,isrender:0}]}}},Me=[{autoFocus:5,createTime:"2021-06-14T08:04:37.000Z",themeId:"pcLive",themeIntro:"PC直播全量版",themeName:"PC直播全量版",themeType:"webLive",updateTime:"2021-06-14T08:04:37.000Z",label:"官方",labelPic:"https://resource.eziot.com/group1/M00/00/8A/CtwQEmLr_DmANlElAAA-xyivSaw030.png",poster:"https://resource.eziot.com/group1/M00/00/89/CtwQEmLl8r-AZU7wAAETKlvgerU237.png",header:je.data.header,footer:je.data.footer},{autoFocus:5,createTime:"2021-06-14T08:04:37.000Z",themeId:"security",themeIntro:"PC直播安防版",themeName:"PC直播安防版",themeType:"webLive",updateTime:"2021-06-14T08:04:37.000Z",label:"官方",labelPic:"https://resource.eziot.com/group1/M00/00/8A/CtwQEmLr_DmANlElAAA-xyivSaw030.png",poster:"https://resource.eziot.com/group1/M00/00/89/CtwQEmLl8r-AZU7wAAETKlvgerU237.png",header:Ae.data.header,footer:Ae.data.footer},{autoFocus:5,createTime:"2021-06-14T08:04:37.000Z",themeId:"voice",themeIntro:"PC直播语音版",themeName:"PC直播语音版",themeType:"webLive",updateTime:"2021-06-14T08:04:37.000Z",label:"官方",labelPic:"https://resource.eziot.com/group1/M00/00/8A/CtwQEmLr_DmANlElAAA-xyivSaw030.png",poster:"https://resource.eziot.com/group1/M00/00/89/CtwQEmLl8r-AZU7wAAETKlvgerU237.png",header:Re.data.header,footer:Re.data.footer},{autoFocus:5,createTime:"2021-06-14T08:04:37.000Z",themeId:"simple",themeIntro:"PC直播极简版",themeName:"PC直播极简版",themeType:"webLive",updateTime:"2021-06-14T08:04:37.000Z",label:"官方",labelPic:"https://resource.eziot.com/group1/M00/00/8A/CtwQEmLr_DmANlElAAA-xyivSaw030.png",poster:"",header:De.data.header,footer:De.data.footer},{autoFocus:5,createTime:"2021-06-14T08:04:37.000Z",themeId:"pcRec",themeIntro:"PC回放全量版",themeName:"PC回放全量版",themeType:"webRec",updateTime:"2021-06-14T08:04:37.000Z",label:"官方",labelPic:"https://resource.eziot.com/group1/M00/00/8A/CtwQEmLr_DmANlElAAA-xyivSaw030.png",poster:"https://resource.eziot.com/group1/M00/00/89/CtwQEmLl8r-AZU7wAAETKlvgerU237.png",header:Le.data.header,footer:Le.data.footer},{autoFocus:5,createTime:"2021-06-14T08:04:37.000Z",themeId:"mobileLive",themeIntro:"Mobile直播全量版",themeName:"Mobile直播全量版",themeType:"mobileLive",updateTime:"2021-06-14T08:04:37.000Z",label:"官方",labelPic:"https://resource.eziot.com/group1/M00/00/8A/CtwQEmLr_GmAL5IhAABZs1vUK0s564.png",poster:"https://resource.eziot.com/group1/M00/00/89/CtwQEmLl8r-AZU7wAAETKlvgerU237.png",header:Ie.data.header,footer:Ie.data.footer},{autoFocus:5,createTime:"2021-06-14T08:04:37.000Z",themeId:"mobileRec",themeIntro:"Mobile回放全量版",themeName:"Mobile回放全量版",themeType:"mobileRec",updateTime:"2021-06-14T08:04:37.000Z",label:"官方",labelPic:"https://resource.eziot.com/group1/M00/00/8A/CtwQEmLr_GmAL5IhAABZs1vUK0s564.png",poster:"https://resource.eziot.com/group1/M00/00/89/CtwQEmLl8r-AZU7wAAETKlvgerU237.png",header:xe.data.header,footer:xe.data.footer},{autoFocus:0,createTime:"2021-06-14T08:04:37.000Z",themeId:"miniRec",themeIntro:"Mobile回放全量版",themeName:"Mobile回放全量版",themeType:"mobileRec",updateTime:"2021-06-14T08:04:37.000Z",label:"官方",labelPic:"https://resource.eziot.com/group1/M00/00/8A/CtwQEmLr_GmAL5IhAABZs1vUK0s564.png",poster:"",header:Be.data.header,footer:Be.data.footer}],Oe=function(){return m((function e(t){var n=this;l(this,e),this.jSPlugin=t,this.enableZoom=!1,this.videoWidth=1920,this.videoHeight=1080,this.currentScale=1,this.currentPosition={left:0,top:0,right:1920,bottom:1080},this.info={},this.clientRect=document.getElementById(t.id).getBoundingClientRect(),this.DOM=document.getElementById(t.id);var i=document.createElement("div");i.id="".concat(t.id,"-zoom-container");var o=document.getElementById("".concat(t.id,"-audioControls")),a=48;o&&(a=o.offsetHeight);var r=t.isMobile?"\n -webkit-transform: scale(0.8);\n -moz-transform: scale(0.8);\n -ms-transform: scale(0.8);\n transform: scale(0.8);\n transform-origin: left bottom;":"";i.style="position: absolute;\n display:none;\n left: 12px;\n bottom: ".concat(t.isMobile?"".concat(a+6,"px"):"80px",";\n ").concat(r,"\n ");var s='\n <div\n style="display: inline-flex;justify-content: space-between;flex-direction: column;width: 36px;height: 160px;background:rgba(0,0,0,0.60);border-radius: 2px;align-items: center;">\n <div id="'.concat(this.jSPlugin.id,'-scale-value" style="font-size: 12px;color:#FFFFFF;margin:10px 0; user-select: none;">2.0X</div>\n <div style="width: 20px;height: 20px;margin-bottom:4px;" id="').concat(this.jSPlugin.id,'-addScale">\n <?xml version="1.0" encoding="utf-8"?>\n <svg version="1.1" fill="#FFFFFF" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"\n viewBox="0 0 20 20" style="enable-background:new 0 0 20 20;" xml:space="preserve">\n <title>').concat(this.jSPlugin.i18n.t("ZOOM_ADD"),'</title>\n <g>\n <rect class="st0" width="20" height="20" fill="none"/>\n </g>\n <g>\n <path class="st1" d="M10,3.8c3.5,0,6.2,2.8,6.2,6.2s-2.8,6.2-6.2,6.2S3.8,13.5,3.8,10S6.5,3.8,10,3.8z M10,5c-2.8,0-5,2.2-5,5\n s2.2,5,5,5s5-2.2,5-5S12.8,5,10,5z"/>\n </g>\n <g>\n <path class="st2" d="M12.5,10.7h-5c-0.3,0-0.6-0.3-0.6-0.6s0.3-0.6,0.6-0.6h5c0.3,0,0.6,0.3,0.6,0.6S12.8,10.7,12.5,10.7z"/>\n </g>\n <g>\n <path class="st2" d="M10,13.2c-0.3,0-0.6-0.3-0.6-0.6v-5c0-0.3,0.3-0.6,0.6-0.6s0.6,0.3,0.6,0.6v5C10.6,12.9,10.3,13.2,10,13.2z"/>\n </g>\n </svg>\n </div>\n <div style="\n position: relative;\n width: 2px;\n height: 64px;\n border-radius: 2px;\n background: rgba(255,255,255,0.75);\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: flex-end;">\n <div class="scale-body-line-dot" id="').concat(this.jSPlugin.id,'-scale-body-line-dot" style="width: 6px;\n height: 6px;\n background: #FFFFFF;\n border-radius: 100%;\n position: absolute;\n border: 1px solid #407AFF;"></div>\n <div id="').concat(this.jSPlugin.id,'-line-dot" style="width: 2px;\n height: 0%;\n border-radius: 2px;\n background: #407AFF;\n bottom: 0;"></div>\n </div>\n <div style="width: 20px;height: 20px;margin: 4px 0 10px;" id="').concat(this.jSPlugin.id,'-subScale">\n <?xml version="1.0" encoding="utf-8"?>\n <svg fill="#FFFFFF" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"\n viewBox="0 0 20 20" style="enable-background:new 0 0 20 20;" xml:space="preserve">\n <title>').concat(this.jSPlugin.i18n.t("ZOOM_SUB"),'</title>\n <g>\n <rect class="st0" width="20" height="20" fill="none"/>\n </g>\n <g>\n <path class="st1" d="M10,3.8c3.5,0,6.2,2.8,6.2,6.2s-2.8,6.2-6.2,6.2S3.8,13.5,3.8,10S6.5,3.8,10,3.8z M10,5c-2.8,0-5,2.2-5,5\n s2.2,5,5,5s5-2.2,5-5S12.8,5,10,5z"/>\n </g>\n <g>\n <path class="st2" d="M12.5,10.7h-5c-0.3,0-0.6-0.3-0.6-0.6s0.3-0.6,0.6-0.6h5c0.3,0,0.6,0.3,0.6,0.6S12.8,10.7,12.5,10.7z"/>\n </g>\n </svg>\n </div>\n </div>\n ');i.innerHTML=s,document.getElementById("".concat(t.id,"-audioControls-left"))&&(document.getElementById("".concat(t.id,"-audioControls-left")).parentNode.appendChild(i),document.getElementById("".concat(t.id,"-addScale")).onclick=function(){n.addScale()},document.getElementById("".concat(t.id,"-subScale")).onclick=function(){n.subScale()}),this._event()}),[{key:"_event",value:function(){var e=this,t=setInterval((function(){var n=document.getElementById("".concat(e.jSPlugin.id,"-container-0"));clearInterval(t),e.jSPlugin.isMobile?n&&(n.addEventListener("touchstart",(function(t){return e.onTouchstart(t)})),n.addEventListener("touchend",(function(t){return e.onTouchend(t)}))):n&&(n.addEventListener("mousedown",(function(t){return e.onMouseDown(t)})),n.addEventListener("mouseup",(function(t){return e.onMouseUp(t)})))}),100)}},{key:"onMouseDown",value:function(e){if(1===this.currentScale)return!1;this.moveX=e.clientX,this.moveY=e.clientY}},{key:"onMouseUp",value:function(e){var t=this.currentPosition;if(1===this.currentScale)return!1;t.left=t.left-(e.clientX-this.moveX),t.top=t.top-(e.clientY-this.moveY),this.doScale()}},{key:"onTouchstart",value:function(e){if(1===this.currentScale)return!1;if(this.jSPlugin.use3DZoom||1===this.currentScale)return!1;if(!this.jSPlugin.beforeMobileZoomVerify())return!1;if(!this.inited){var t=this.jSPlugin.jSPlugin._JSPlayM4_GetFrameInfo(0);this.videoWidth=t.width,this.videoHeight=t.height,this.currentPosition.left=0,this.currentPosition.top=0,this.isMobileFullScreen?(this.currentPosition.right=t.height,this.currentPosition.bottom=t.width):(this.currentPosition.right=t.width,this.currentPosition.bottom=t.height),this.inited=!0}var n=e.touches[0];if(n){var i={clientX:0,clientY:0};i.clientX=n.clientX,i.clientY=n.clientY,this.point1=i}}},{key:"onTouchend",value:function(e){var t=this,n=this.currentPosition;if(1===this.currentScale)return!1;var i=e.changedTouches[0];this.isMobileFullScreen?(n.left=n.left-(i.clientY-t.point1.clientY),n.top=n.top+(i.clientX-t.point1.clientX)):(n.left=n.left-(i.clientX-t.point1.clientX),n.top=n.top-(i.clientY-t.point1.clientY)),t.doScale()}},{key:"renderDot",value:function(){var e=this.currentScale;document.getElementById("".concat(this.jSPlugin.id,"-scale-value"))&&(document.getElementById("".concat(this.jSPlugin.id,"-scale-value")).innerHTML="".concat(e,".0X")),document.getElementById("".concat(this.jSPlugin.id,"-line-dot"))&&(document.getElementById("".concat(this.jSPlugin.id,"-line-dot")).style.height="".concat((e-1)/7*100,"%")),document.getElementById("".concat(this.jSPlugin.id,"-scale-body-line-dot"))&&(document.getElementById("".concat(this.jSPlugin.id,"-scale-body-line-dot")).style.bottom="calc(".concat((e-1)/7*100,"% - 3px)"))}},{key:"getTopMostElement",value:function(e,t,n){var i=e?e.getBoundingClientRect():null,o=t?t.getBoundingClientRect():null,a=n?n.getBoundingClientRect():null;if(!i&&!o&&!a)return null;if(!i)return o.top<a.top?t:n;if(!o)return i.top<a.top?e:n;if(!a)return i.top<o.top?e:t;var r=[i.top,o.top,a.top],s=Math.max.apply(Math,r);return i.top===s?e:o.top===s?t:n}},{key:"handleFullscreen",value:function(e,t,n){this.clientRect={width:t,height:n}}},{key:"startZoom",value:function(){try{if(document.getElementById("".concat(this.jSPlugin.id,"-zoom-container"))&&(document.getElementById("".concat(this.jSPlugin.id,"-zoom-container")).style.display="block"),this.dpr="v1-soft"==this.jSPlugin.decodeEngine?1:this.jSPlugin.dpr,this.jSPlugin.jSPlugin)try{var e=this.jSPlugin.jSPlugin._JSPlayM4_GetFrameInfo(0);this.info=Object.assign({},e),this.videoWidth=(e.width||this.jSPlugin.width)*this.dpr,this.videoHeight=(e.height||this.jSPlugin.height)*this.dpr,this.currentPosition.right=e.width*this.dpr,this.currentPosition.bottom=e.height*this.dpr,this.jSPlugin.jSPlugin.bEZoom=!0}catch(e){}this.jSPlugin.eventEmitter&&this.jSPlugin.eventEmitter.emit("startZoom",{eventType:"startZoom",code:0,target:this,msg:"开启电子放大"}),this.renderDot(),this.enableZoom=!0}catch(e){this.jSPlugin.eventEmitter&&this.jSPlugin.eventEmitter.emit("startZoom",{eventType:"startZoom",code:-1,target:this,msg:e||"开启电子放大失败"})}}},{key:"stopZoom",value:function(){try{this._resetZoom(),this.jSPlugin.eventEmitter&&this.jSPlugin.eventEmitter.emit("stopZoom",{eventType:"stopZoom",code:0,target:this,msg:"关闭电子放大"}),document.getElementById("".concat(this.jSPlugin.id,"-zoom-container"))&&(document.getElementById("".concat(this.jSPlugin.id,"-zoom-container")).style.display="none")}catch(e){this.jSPlugin.eventEmitter&&this.jSPlugin.eventEmitter.emit("stopZoom",{eventType:"stopZoom",code:-1,target:this,msg:e||"关闭电子放大失败"})}}},{key:"_resetZoom",value:function(){this.currentScale=1,this.currentPosition.left=0,this.currentPosition.top=0,this.currentPosition.right=this.videoWidth,this.currentPosition.bottom=this.videoHeight,this._JSPlayM4_SetDisplayRegion(0,this.videoWidth,0,this.videoHeight,!1),this.renderDot(),this.enableZoom=!1}},{key:"doScale",value:function(){var e=this.currentPosition,t=this.currentScale,n=this.jSPlugin.jSPlugin._JSPlayM4_GetFrameInfo(0);if(console.log("info::",n),n.width!=this.info.width){var i=parseFloat(n.width/this.info.width);e.left=e.left*i*(i>1?1.25:.75),e.right=e.right*i*(i>1?1.25:.75),this.info.width=n.width,this.videoWidth=n.width*(i>1.25?1:.75)*this.dpr}if(n.height!=this.info.height){var o=parseFloat(n.height/this.info.height);e.top=e.top*o*(o>1?1.25:.75),e.bottom=e.bottom*o*(o>1?1.25:.75),this.info.height=n.height,this.videoHeight=n.height*(o>1?1.25:.75)*this.dpr}e.left=e.left+.5*(e.right-e.left-this.videoWidth/t),e.left<=0?e.left=0:e.left>this.videoWidth-this.videoWidth/t&&(e.left=this.videoWidth-this.videoWidth/t),e.right=e.left+this.videoWidth/t,e.top=e.top+.5*(e.bottom-e.top-this.videoHeight/t),e.top<=0?e.top=0:e.top>this.videoHeight-this.videoHeight/t&&(e.top=this.videoHeight-this.videoHeight/t),e.bottom=e.top+this.videoHeight/t,e.left=parseInt(e.left,10),e.right=parseInt(e.right,10),e.top=parseInt(e.top,10),e.bottom=parseInt(e.bottom,10);try{e.left<e.right&&e.top<e.bottom&&e.bottom<=this.videoHeight&&e.right<=this.videoWidth&&this._JSPlayM4_SetDisplayRegion(e.left,e.right,e.top,e.bottom,1!=t,this.isMobileFullScreen)}catch(e){console.log(e)}this.renderDot()}},{key:"addScale",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;return this.jSPlugin.eventEmitter&&this.jSPlugin.eventEmitter.emit("zoomAdd",{eventType:"zoomAdd",code:1,target:this,msg:"执行放大"}),this.currentScale>=8?(this.jSPlugin.Message&&this.jSPlugin.Message.default(this.jSPlugin.i18n.t("ZOOM_ADD_MAX"),document.getElementById("".concat(this.jSPlugin.id))),!1):(this.currentScale=this.currentScale+e,this.currentScale>8?(console.log("超出最大倍率"),this.jSPlugin.Message&&this.jSPlugin.Message.default(this.jSPlugin.i18n.t("ZOOM_LIMIT_MAX"),document.getElementById("".concat(this.jSPlugin.id))),!1):void this.doScale())}},{key:"subScale",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;return this.jSPlugin.eventEmitter&&this.jSPlugin.eventEmitter.emit("zoomSub",{eventType:"zoomSub",code:1,target:this,msg:"执行缩小"}),this.currentScale<=1?(this.jSPlugin.Message&&this.jSPlugin.Message.default(this.jSPlugin.i18n.t("ZOOM_SUB_MIN"),document.getElementById("".concat(this.jSPlugin.id))),!1):(this.currentScale=this.currentScale-e,this.currentScale<1?(this.jSPlugin.Message&&this.jSPlugin.Message.default(this.jSPlugin.i18n.t("ZOOM_LIMIT_MIN"),document.getElementById("".concat(this.jSPlugin.id))),!1):void this.doScale())}},{key:"_JSPlayM4_SetDisplayRegion",value:function(e,t,n,i,o){this.jSPlugin&&this.jSPlugin.jSPlugin&&(console.log("%c计算后,","color: red;",this.videoWidth,this.videoHeight,e,t,n,i,this.currentScale),this.jSPlugin.jSPlugin._JSPlayM4_SetDisplayRegion(e,t,n,i,o,this.isMobileFullScreen))}},{key:"isMobileFullScreen",get:function(){return!!(L()&&this.jSPlugin.Theme&&this.jSPlugin.Theme.decoderState&&this.jSPlugin.Theme.decoderState.state.expend)}}])}(),ze=[{videoLevel:1,streamTypeIn:2,type:"compatible"},{videoLevel:2,streamTypeIn:1,type:"compatible"}],Ne={0:"VIDEO_LEVEL_FLUENT",1:"VIDEO_LEVEL_SATNDARD",2:"VIDEO_LEVEL_HEIGH",3:"VIDEO_LEVEL_SPUER",4:"VIDEO_LEVEL_EXTREME",5:"VIDEO_LEVEL_3K",6:"VIDEO_LEVEL_4k"},Fe="8.1.5",Ue=function(e,t,n,i){var o="".concat(e.env.domain,"/api/service/media/template/getDetail?accessToken=").concat(e.accessToken||e.token.httpToken.url,"&id=").concat(t);fetch(o,{method:"GET"}).then((function(e){return e.json()})).then((function(e){var t;(t=e).meta&&n(t)})).catch((function(e){var t;t=e,console.log(t),i(t)}))},Ve=function(e){var t="".concat(e.env.domain,"/api/service/device/capacity/video/quality?accessToken=").concat(e.accessToken||e.token.deviceToken.video,"&deviceSerial=").concat(e.deviceSerial,"&channelNo=").concat(e.channelNo),n=[];return fetch(t,{method:"GET",headers:{clientType:"ezuikit",sdkVersion:Fe}}).then((function(e){return e.json()})).then((function(e){return(e.meta&&200===e.meta.code&&e.data&&e.data.length>0?e.data:ze).map((function(e){n.push({name:Ne[e.videoLevel],level:e.videoLevel,streamTypeIn:e.streamTypeIn,type:e.type})})),n})).catch((function(){return ze.map((function(e){n.push({name:Ne[e.videoLevel],level:e.videoLevel,streamTypeIn:e.streamTypeIn,type:"compatible"})})),n}))},He=function(e,t){var n="".concat(e.env.domain,"/api/v3/device/setVideoLevel?accessToken=").concat(e.accessToken||e.token.deviceToken.video," "),i=new FormData;return i.append("videoLevel",parseInt(t)),fetch(n,{method:"POST",headers:{accessToken:e.accessToken||e.token.deviceToken.video,deviceSerial:e.deviceSerial,localIndex:e.channelNo},body:i}).then((function(e){return e.json()})).then((function(e){return e}))},Ge=function(e,t){var n=new FormData;return Object.keys(t).map((function(e){n.append(e,t[e])})),fetch(e.env.domain+"/api/service/media/stream/server/info?version=2.0&protocol=4",{method:"GET",headers:{deviceSerial:t.deviceSerial,accessToken:t.accessToken,localIndex:t.localIndex}}).then((function(e){return e.json()})).then((function(t){if(t.meta&&200==t.meta.code){var n=JSON.parse(localStorage.getItem("ezuikit_addressList")),i=function(t){var i=e.deviceSerial+"_"+e.channelNo,o=new Date;n[i]=[{domain:t.domain,port:t.port,expire:new Date(o.setHours(o.getHours()+12)).Format("yyyyMMddThhmmssZ")}],Array.isArray(t.backups)&&t.backups.map((function(e){n[i].push({domain:e.domain,port:e.port,expire:new Date(o.setHours(o.getHours()+12)).Format("yyyyMMddThhmmssZ")})})),localStorage.setItem("ezuikit_addressList",JSON.stringify(n))};if(t.data&&Array.isArray(n[e.deviceSerial+"_"+e.channelNo])){var o=Array.isArray(t.data.backups)?S(t.data.backups):[];o.push({domain:t.data.domain,port:t.data.port}),(!function(e,t){if(e.length!==t.length)return!1;for(var n=S(e).sort((function(e,t){return e.domain>t.domain?1:-1})),i=S(t).sort((function(e,t){return e.domain>t.domain?1:-1})),o=0;o<n.length;o++)if(n[o].domain!==i[o].domain)return!1;return!0}(n[e.deviceSerial+"_"+e.channelNo],o)||n[e.deviceSerial+"_"+e.channelNo][0].expire<=(new Date).Format("yyyyMMddThhmmssZ"))&&i(t.data)}e.maxReloadTime=n[e.deviceSerial+"_"+e.channelNo].length}return t}))},Ze=function(e){var t="";return Object.keys(e).map((function(n,i){t+="".concat(n,":").concat(e[n]).concat(i<Object.keys(e).length-1?";":"")})),t},We=500,qe=function(){return m((function e(t){var n=this;l(this,e),this.jSPlugin=t,this.isNeedRenderHeader=!1,this.isNeedRenderFooter=!1,this.autoFocus=0,this.autoFocusTimer=null,this.recordTimer=null,this.nextRate=1,this.showHD=!1,this.themeInited=!1;var o=re.getGlobalState();if(this.decoderState={state:{play:!1,pauseDate:null,sound:!o.sound&&!!t.audio,recordvideo:!1,recordCount:"00:00",talk:!1,zoom:!1,pantile:!1,speed:!1,expend:!1,webExpend:!1,cloudRec:"cloud.rec"===A(t.url).type,rec:"rec"===A(t.url).type,type:A(t.url).type}},this.allowZoom=!this.jSPlugin.use3DZoom,this.zoomDisable=!1,this.pluginStatus=new U(this,this.jSPlugin.params.id),this.inited=!1,this.isMobile=L(),void 0!==t.isMobile&&(this.isMobile=t.isMobile),this.pauseTime=null,this.themeData=Ce,this.jSPlugin.themeId)switch(this.jSPlugin.themeId){case"pcLive":case"pcRec":case"mobileLive":case"mobileRec":case"security":case"voice":case"simple":case"miniRec":var a=i.find(Me,(function(e){return e.themeId===n.jSPlugin.themeId}));a&&(this.themeData=a),this.initThemeData();break;case"themeData":this.themeData=this.jSPlugin.params.themeData,this.initThemeData();break;default:this.fetchThemeData(this.jSPlugin.themeId)}this.jSPlugin.Talk||(this.jSPlugin.Talk=new Pe(this.jSPlugin)),P("".concat(this.jSPlugin.staticPath,"/speed/speed.css")),P("".concat(this.jSPlugin.staticPath,"/css/theme.css")),this._fullscreenchange=null,this._fullScreenChangeEvent()}),[{key:"fetchThemeData",value:function(e){var t=this;Ue(this.jSPlugin,e,(function(e){0==e.meta.code&&e.data?(t.themeData=e.data,e.data.header&&(t.themeData.header=e.data.header,t.themeData.header.btnList=t.themeData.header.btnList.sort((function(e,t){return e.btnKey.split("-")[3]-t.btnKey.split("-")[3]}))),e.data.footer&&(t.themeData.footer=e.data.footer,t.themeData.footer.btnList=t.themeData.footer.btnList.sort((function(e,t){return e.btnKey.split("-")[3]-t.btnKey.split("-")[3]}))),e.data.themeType&&("live"===A(t.jSPlugin.url).type?-1===e.data.themeType.toLowerCase().indexOf("live")&&console.error("当前模板类型".concat(e.data.themeType,"与播放类型").concat(A(t.jSPlugin.url).type,"不对应,请检查模板类型")):-1===e.data.themeType.toLowerCase().indexOf("rec")&&console.error("当前模板类型".concat(e.data.themeType,"与播放类型").concat(A(t.jSPlugin.url).type,"不对应,请检查模板类型"))),t.initThemeData(),t.renderThemeData()):console.log("模板获取失败:",e)}),(function(e){console.log("模板获取失败:",e),t.renderThemeData()}))}},{key:"changeTheme",value:function(e){var t=this;if("string"==typeof e)switch(this.jSPlugin.themeId=e,this.jSPlugin.themeId){case"pcLive":case"pcRec":case"mobileLive":case"mobileRec":case"security":case"voice":case"simple":case"miniRec":var n=i.find(Me,(function(e){return e.themeId===t.jSPlugin.themeId}));n&&(this.themeData=n),this.initThemeData();break;default:this.fetchThemeData(e)}else"object"===b(e)&&(this.themeData=e,this.initThemeData());this.jSPlugin&&this.jSPlugin.handleThemeChange&&this.jSPlugin.handleThemeChange(e)}},{key:"renderThemeData",value:function(){var e=this,t=this.themeData,n=t.header,o=t.footer;if(this.isNeedRenderHeader&&n&&(document.getElementById("".concat(this.jSPlugin.id,"-headControl")).style.background=n.backgroundColor.replace("-diy",""),document.getElementById("".concat(this.jSPlugin.id,"-headControl")).style.color=n.color.replace("-diy",""),n.btnList.map((function(t,n){t.isrender&&e.setDecoderState(p({},t.iconId,e.decoderState.state[t.iconId]))}))),this.isNeedRenderFooter&&o)document.getElementById("".concat(this.jSPlugin.id,"-audioControls")).style.background=o.backgroundColor.replace("-diy",""),document.getElementById("".concat(this.jSPlugin.id,"-audioControls")).style.color=o.color.replace("-diy",""),this.jSPlugin.params.extraBtn&&(o.btnList=[].concat(S(o.btnList),S(this.jSPlugin.params.extraBtn))),o.btnList.map((function(t,n){if(t.isrender&&e.setDecoderState(p({},t.iconId,e.decoderState.state[t.iconId])),"play"===t.iconId&&t.defaultActive&&!e.themeInited&&e.jSPlugin.autoplay)var i=setInterval((function(){window.EZUIKit[e.jSPlugin.id].state.EZUIKitPlayer.init&&(clearInterval(i),e.themeInited=!0)}),50)})),this.themeData.autoFocus>0&&(this.autoFocus=parseInt(this.themeData.autoFocus),this.startAutoFocus(),document.getElementById("".concat(this.jSPlugin.id,"-wrap")).addEventListener("click",(function(){document.getElementById("".concat(e.jSPlugin.id,"-audioControls"))&&(document.getElementById("".concat(e.jSPlugin.id,"-audioControls")).style.opacity=1,document.getElementById("".concat(e.jSPlugin.id,"-audioControls")).style.pointerEvents="all"),document.getElementById("".concat(e.jSPlugin.id,"-headControl"))&&(document.getElementById("".concat(e.jSPlugin.id,"-headControl")).style.opacity=1,document.getElementById("".concat(e.jSPlugin.id,"-headControl")).style.pointerEvents="all"),e.startAutoFocus()}))),this.setDecoderState({cloudRec:"cloud.rec"===A(this.jSPlugin.url).type,rec:"rec"===A(this.jSPlugin.url).type,type:A(this.jSPlugin.url).type});else if(!this.themeInited)var a=setInterval((function(){window.EZUIKit[e.jSPlugin.id].state.EZUIKitPlayer.init&&e.jSPlugin.autoplay&&(clearInterval(a),e.themeInited=!0)}),50);i.findIndex(this.themeData.footer.btnList,(function(e){return"zoom"===e.iconId&&e.isrender>0}))>=0&&(this.isMobile&&!this.jSPlugin.use3DZoom&&(this.jSPlugin.beforeMobileZoomVerify=function(){return!!e.decoderState.state.play}),this.jSPlugin.Zoom=new Oe(this.jSPlugin))}},{key:"setDecoderState",value:function(e){var t=this,n=this.themeData,i=n.header,o=n.footer;Object.keys(e).map((function(n,a){var r="#FFFFFF",s="#FFFFFF";switch(-1===i.btnList.findIndex((function(e){return e.iconId===n}))?(r=o.color.replace("-diy",""),s=o.activeColor.replace("-diy","")):(r=i.color.replace("-diy",""),s=o.activeColor.replace("-diy","")),n){case"play":e[n]?document.getElementById("".concat(t.jSPlugin.id,"-play"))&&(document.getElementById("".concat(t.jSPlugin.id,"-play-content")).children[0].children[0].style="display:inline-block",document.getElementById("".concat(t.jSPlugin.id,"-play-content")).children[0].children[1].style="display:none",document.getElementById("".concat(t.jSPlugin.id,"-play")).className=e[n]?"active":"",document.getElementById("".concat(t.jSPlugin.id,"-play-content")).childNodes[0].children[0].style.fill=e[n]?s:r):document.getElementById("".concat(t.jSPlugin.id,"-play"))&&(document.getElementById("".concat(t.jSPlugin.id,"-play-content")).children[0].children[1].style="display:inline-block",document.getElementById("".concat(t.jSPlugin.id,"-play-content")).children[0].children[0].style="display:none",document.getElementById("".concat(t.jSPlugin.id,"-play")).className=e[n]?"active":"",document.getElementById("".concat(t.jSPlugin.id,"-play-content")).childNodes[0].children[1].style.fill=e[n]?s:r);break;case"sound":document.getElementById("".concat(t.jSPlugin.id,"-sound"))&&(e[n]?(document.getElementById("".concat(t.jSPlugin.id,"-sound-content")).children[0].children[1].style="display:inline-block",document.getElementById("".concat(t.jSPlugin.id,"-sound-content")).children[0].children[0].style="display:none",document.getElementById("".concat(t.jSPlugin.id,"-sound")).className=e[n]?"active":"",document.getElementById("".concat(t.jSPlugin.id,"-sound-content")).childNodes[0].children[1].style.fill=e[n]?s:r):(document.getElementById("".concat(t.jSPlugin.id,"-sound-content")).children[0].children[0].style="display:inline-block",document.getElementById("".concat(t.jSPlugin.id,"-sound-content")).children[0].children[1].style="display:none",document.getElementById("".concat(t.jSPlugin.id,"-sound")).className=e[n]?"active":"",document.getElementById("".concat(t.jSPlugin.id,"-sound-content")).childNodes[0].children[0].style.fill=e[n]?s:r));break;case"recordvideo":document.getElementById("".concat(t.jSPlugin.id,"-recordvideo"))&&(document.getElementById("".concat(t.jSPlugin.id,"-recordvideo")).className=e[n]?"active":"",document.getElementById("".concat(t.jSPlugin.id,"-recordvideo-content")).childNodes[0].style.fill=e[n]?s:r,e[n]?t.countTime("add",0):t.countTime("destroy",0));break;case"talk":document.getElementById("".concat(t.jSPlugin.id,"-talk"))&&(document.getElementById("".concat(t.jSPlugin.id,"-talk")).className=e[n]?"active":"",document.getElementById("".concat(t.jSPlugin.id,"-talk-content")).childNodes[1].style.fill=e[n]?s:r);break;case"zoom":document.getElementById("".concat(t.jSPlugin.id,"-zoom"))&&(document.getElementById("".concat(t.jSPlugin.id,"-zoom")).className=e[n]?"active":"",document.getElementById("".concat(t.jSPlugin.id,"-zoom-content")).childNodes[1].style.fill=e[n]?s:r);break;case"pantile":document.getElementById("".concat(t.jSPlugin.id,"-pantile"))&&(document.getElementById("".concat(t.jSPlugin.id,"-pantile")).className=e[n]?"active":"",document.getElementById("".concat(t.jSPlugin.id,"-pantile-content")).childNodes[0].style.fill=e[n]?s:r);break;case"webExpend":e[n]?(document.getElementById("".concat(t.jSPlugin.id,"-webExpend"))&&(document.getElementById("".concat(t.jSPlugin.id,"-webExpend-content")).children[0].children[1].style="display:inline-block",document.getElementById("".concat(t.jSPlugin.id,"-webExpend-content")).children[0].children[0].style="display:none"),document.getElementById("".concat(t.jSPlugin.id,"-expend"))&&(document.getElementById("".concat(t.jSPlugin.id,"-expend")).className="disabled")):(document.getElementById("".concat(t.jSPlugin.id,"-webExpend"))&&(document.getElementById("".concat(t.jSPlugin.id,"-webExpend-content")).children[0].children[0].style="display:inline-block",document.getElementById("".concat(t.jSPlugin.id,"-webExpend-content")).children[0].children[1].style="display:none"),document.getElementById("".concat(t.jSPlugin.id,"-expend"))&&(document.getElementById("".concat(t.jSPlugin.id,"-expend")).className="")),document.getElementById("".concat(t.jSPlugin.id,"-webExpend"))&&(document.getElementById("".concat(t.jSPlugin.id,"-webExpend")).className=e[n]?"active":"",document.getElementById("".concat(t.jSPlugin.id,"-webExpend-content")).childNodes[0].childNodes[0].style.fill=e[n]?s:r,document.getElementById("".concat(t.jSPlugin.id,"-webExpend-content")).childNodes[0].childNodes[1].style.fill=e[n]?s:r);break;case"capturePicture":document.getElementById("".concat(t.jSPlugin.id,"-capturePicture"))&&(document.getElementById("".concat(t.jSPlugin.id,"-capturePicture")).className=e[n]?"active":"",document.getElementById("".concat(t.jSPlugin.id,"-capturePicture-content")).childNodes[0].style.fill=e[n]?s:r);break;case"expend":e[n]?(document.getElementById("".concat(t.jSPlugin.id,"-expend"))&&(document.getElementById("".concat(t.jSPlugin.id,"-expend-content")).children[0].children[1].style="display:inline-block",document.getElementById("".concat(t.jSPlugin.id,"-expend-content")).children[0].children[0].style="display:none"),document.getElementById("".concat(t.jSPlugin.id,"-webExpend"))&&(document.getElementById("".concat(t.jSPlugin.id,"-webExpend")).className="disabled")):(document.getElementById("".concat(t.jSPlugin.id,"-expend"))&&(document.getElementById("".concat(t.jSPlugin.id,"-expend-content")).children[0].children[0].style="display:inline-block",document.getElementById("".concat(t.jSPlugin.id,"-expend-content")).children[0].children[1].style="display:none"),document.getElementById("".concat(t.jSPlugin.id,"-webExpend"))&&(document.getElementById("".concat(t.jSPlugin.id,"-webExpend")).className="")),document.getElementById("".concat(t.jSPlugin.id,"-expend"))&&(document.getElementById("".concat(t.jSPlugin.id,"-expend")).className=e[n]?"active":"",document.getElementById("".concat(t.jSPlugin.id,"-expend-content")).childNodes[0].childNodes[0].style.fill=e[n]?s:r,document.getElementById("".concat(t.jSPlugin.id,"-expend-content")).childNodes[0].childNodes[1].style.fill=e[n]?s:r);break;case"hd":break;case"speed":if(document.getElementById("".concat(t.jSPlugin.id,"-speed"))){var c=document.getElementById("".concat(t.jSPlugin.id,"-speed-content")).children[1].children[0];"not-allowed"!==c.style.cursor&&(c.style.color=e[n]?s:r,c.style.borderColor=e[n]?s:r)}document.getElementById("".concat(t.jSPlugin.id,"-select-mask"))&&(t.isMobile&&e[n]?document.getElementById("".concat(t.jSPlugin.id,"-select-mask")).style.display="block":document.getElementById("".concat(t.jSPlugin.id,"-select-mask")).style.display="none");break;case"cloudRec":document.getElementById("".concat(t.jSPlugin.id,"-cloudRec"))&&(document.getElementById("".concat(t.jSPlugin.id,"-cloudRec")).className=e[n]?"active":"",document.getElementById("".concat(t.jSPlugin.id,"-cloudRec-content")).children[0].children[0].style.fill=e[n]?s:r),document.getElementById("".concat(t.jSPlugin.id,"-rec"))&&(document.getElementById("".concat(t.jSPlugin.id,"-rec")).className=e[n]?"active":"",document.getElementById("".concat(t.jSPlugin.id,"-rec-content")).children[0].children[0].style.fill=e[n]?r:s);break;case"cloudRecord":var l=document.getElementById("".concat(t.jSPlugin.id,"-cloudRecord"));l&&(l.className=e[n]?"active":"",document.getElementById("".concat(t.jSPlugin.id,"-cloudRecord-content")).children[0].children[0].style.fill=e[n]?s:r),document.getElementById("".concat(t.jSPlugin.id,"-rec"))&&(document.getElementById("".concat(t.jSPlugin.id,"-rec")).className=e[n]?"active":"",document.getElementById("".concat(t.jSPlugin.id,"-rec-content")).children[0].children[0].style.fill=e[n]?r:s);break;case"rec":document.getElementById("".concat(t.jSPlugin.id,"-cloudRec"))&&(document.getElementById("".concat(t.jSPlugin.id,"-cloudRec")).className=e[n]?"active":"",document.getElementById("".concat(t.jSPlugin.id,"-cloudRec-content")).children[0].children[0].style.fill=e[n]?r:s),document.getElementById("".concat(t.jSPlugin.id,"-cloudRecord"))&&(document.getElementById("".concat(t.jSPlugin.id,"-cloudRecord")).className=e[n]?"active":"",document.getElementById("".concat(t.jSPlugin.id,"-cloudRecord-content")).children[0].children[0].style.fill=e[n]?r:s),document.getElementById("".concat(t.jSPlugin.id,"-rec"))&&(document.getElementById("".concat(t.jSPlugin.id,"-rec")).className=e[n]?"active":"",document.getElementById("".concat(t.jSPlugin.id,"-rec-content")).children[0].children[0].style.fill=e[n]?s:r)}t.decoderState.state=Object.assign(t.decoderState.state,e)}))}},{key:"startAutoFocus",value:function(){var e=this,t=this.autoFocus;this.autoFocusTimer&&clearTimeout(this.autoFocusTimer),this.autoFocusTimer=setTimeout((function(){document.getElementById("".concat(e.jSPlugin.id,"-audioControls"))&&(document.getElementById("".concat(e.jSPlugin.id,"-audioControls")).style.opacity=0,document.getElementById("".concat(e.jSPlugin.id,"-audioControls")).style.pointerEvents="none"),document.getElementById("".concat(e.jSPlugin.id,"-headControl"))&&(document.getElementById("".concat(e.jSPlugin.id,"-headControl")).style.opacity=0,document.getElementById("".concat(e.jSPlugin.id,"-headControl")).style.pointerEvents="none")}),1e3*t)}},{key:"stopAutoFocus",value:function(){document.getElementById("".concat(this.jSPlugin.id,"-audioControls"))&&(document.getElementById("".concat(this.jSPlugin.id,"-audioControls")).style.opacity=1,document.getElementById("".concat(this.jSPlugin.id,"-audioControls")).style.pointerEvents="all"),document.getElementById("".concat(this.jSPlugin.id,"-headControl"))&&(document.getElementById("".concat(this.jSPlugin.id,"-headControl")).style.opacity=1,document.getElementById("".concat(this.jSPlugin.id,"-headControl")).style.pointerEvents="all"),this.autoFocusTimer&&clearTimeout(this.autoFocusTimer)}},{key:"hideFooter",value:function(){document.getElementById("".concat(this.jSPlugin.id,"-ez-iframe-footer-container"))&&(document.getElementById("".concat(this.jSPlugin.id,"-ez-iframe-footer-container")).style.display="none")}},{key:"showFooter",value:function(){document.getElementById("".concat(this.jSPlugin.id,"-ez-iframe-footer-container"))&&(document.getElementById("".concat(this.jSPlugin.id,"-ez-iframe-footer-container")).style.display="block")}},{key:"toString",value:function(){return"".concat(this.coreX,"-").concat(this.coreY)}},{key:"renderFooter",value:function(e,t){var n=this.matchBtn(e),i=document.createElement("div");i.className="theme-icon-item",i.innerHTML="".concat('<span id="'.concat(this.jSPlugin.id,"-").concat(n.id,'" style="position:relative;">')+'<div id="'.concat(this.jSPlugin.id,"-").concat(n.id,'-content" title="').concat(n.title,'" style="height:').concat(this.jSPlugin.width>We?48:32,'px;display: flex;align-items: center;position:relative;">')).concat(n.domString,"</div>")+"</span>",i.onclick=function(e){n.onclick(e)},n.onmouseenter&&(i.onmouseenter=function(e){n.onmouseenter(e)}),n.onmouseleave&&(i.onmouseleave=function(e){n.onmouseleave(e)}),"left"===t?document.getElementById("".concat(this.jSPlugin.id,"-audioControls")).childNodes[0].appendChild(i):document.getElementById("".concat(this.jSPlugin.id,"-audioControls")).childNodes[1].appendChild(i)}},{key:"renderHeader",value:function(e,t){var n=this.matchBtn(e),i=document.createElement("div");i.className="theme-icon-item",i.style="max-width:50%;",i.innerHTML="".concat('<span id="'.concat(this.jSPlugin.id,"-").concat(n.id,'" style="position:relative;";>')+'<span id="'.concat(this.jSPlugin.id,"-").concat(n.id,'-content" title="').concat(n.title,'" style="display:inline-block;height:').concat(this.width>We?48:32,'px;">')).concat(n.domString,"</span>")+"</span>",i.onclick=function(e){n.onclick(e)},"left"===t?document.getElementById("".concat(this.jSPlugin.id,"-headControl")).childNodes[0].appendChild(i):document.getElementById("".concat(this.jSPlugin.id,"-headControl")).childNodes[1].appendChild(i)}},{key:"countTime",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this;if(!document.getElementById(this.jSPlugin.id+"time-area")){var i=document.createElement("div");i.id=this.jSPlugin.id+"time-area",i.className="time-area",i.innerHTML='<span class="dot"></span><span class="value">00:00</span>',document.getElementById("".concat(this.jSPlugin.id,"-ez-iframe-footer-container"))&&document.getElementById("".concat(this.jSPlugin.id,"-ez-iframe-footer-container")).appendChild(i)}if(this.countTimer&&clearInterval(this.countTimer),"add"===e){var o=t;document.getElementById(n.jSPlugin.id+"time-area").style.display="flex",this.countTimer=setInterval((function(){++o,document.getElementById(n.jSPlugin.id+"time-area").children[1].innerHTML=function(e){var t=parseInt(e),n=0,i=0,o="00",a="00",r="00";t>59&&(n=parseInt(t/60),t=parseInt(t%60),n>59&&(i=parseInt(n/60),n=parseInt(n%60)));return o=parseInt(t)>9?parseInt(t):"0"+parseInt(t),a=parseInt(n)>9?parseInt(n):"0"+parseInt(n),r=parseInt(i)>9?parseInt(i):"0"+parseInt(i),i>0?r+":"+a+":"+o:n>0?a+":"+o:"00:"+o}(o)}),1e3)}else"destroy"===e&&(this.countTimer&&clearInterval(this.countTimer),this.countTimer=void 0,document.getElementById(n.jSPlugin.id+"time-area")&&(document.getElementById(n.jSPlugin.id+"time-area").children[1].innerHTML="00:00",document.getElementById(n.jSPlugin.id+"time-area").style.display="none"))}},{key:"setDisabled",value:function(e){var t=this.decoderState.state,n=t.sound,i=t.expend,o=e?"cursor: not-allowed; color: gray; fill: gray; ":"cursor: default";null!=document.getElementById("".concat(this.jSPlugin.id,n?"-sound-icon":"-nosound-icon"))&&document.getElementById("".concat(this.jSPlugin.id,n?"-sound-icon":"-nosound-icon")).setAttribute("style",e?"cursor: not-allowed; color: gray; fill: gray;":"cursor: default"),null!=document.getElementById("".concat(this.jSPlugin.id,"-recordvideo-icon"))&&document.getElementById("".concat(this.jSPlugin.id,"-recordvideo-icon")).setAttribute("style",o),null!=document.getElementById("".concat(this.jSPlugin.id,"-capturePicture-icon"))&&document.getElementById("".concat(this.jSPlugin.id,"-capturePicture-icon")).setAttribute("style",o),null!=document.getElementById("".concat(this.jSPlugin.id,"-talk-icon"))&&document.getElementById("".concat(this.jSPlugin.id,"-talk-icon")).setAttribute("style",o),null!=document.getElementById("".concat(this.jSPlugin.id,i?"-unexpend-icon":"-expend-icon"))&&document.getElementById("".concat(this.jSPlugin.id,i?"-unexpend-icon":"-expend-icon")).setAttribute("style",o),this.allowZoom||null!=document.getElementById("".concat(this.jSPlugin.id,"-zoom-icon"))&&document.getElementById("".concat(this.jSPlugin.id,"-zoom-icon")).setAttribute("style",o),document.getElementById("".concat(this.jSPlugin.id,"-pantile-icon"))&&"none"!=document.getElementById("".concat(this.jSPlugin.id,"-pantile-icon")).style.display&&document.getElementById("".concat(this.jSPlugin.id,"-pantile-icon")).setAttribute("style",o);var a=document.getElementsByClassName("".concat(this.jSPlugin.id,"-select-quality-btn"));if(a.length)for(var r=0;r<a.length;r++)e?(a[r].style.cursor="not-allowed",a[r].style.color="gray",a[r].style.fill="gray"):(a[r].style.cursor="default",a[r].style.fill="",a[r].style.color="");null!=document.getElementById("".concat(this.jSPlugin.id,"-speed-text"))&&document.getElementById("".concat(this.jSPlugin.id,"-speed-text")).setAttribute("style",document.getElementById("".concat(this.jSPlugin.id,"-speed-text")).getAttribute("style")+";"+(e?"cursor: not-allowed; color: gray; border-color: gray;":"cursor: default; color: #ffffff;border-color: #ffffff;")),this.zoomDisable=this.jSPlugin.use3DZoom&&e}},{key:"matchBtn",value:function(e){var t=this,n=this.themeData,o=n.header,a=n.footer,r={title:"",id:"",domString:"",color:"#FFFFFF",activeColor:"#FFFFFF",onclick:function(){},onmoveleft:function(){},onmoveright:function(){},onremove:function(){}};-1===o.btnList.findIndex((function(t){return t.iconId===e}))?(r.color=a.color,r.backgroundColor=a.backgroundColor,r.activeColor=a.activeColor):(r.color=o.color,r.backgroundColor=o.backgroundColor,r.activeColor=o.activeColor);var s=this.jSPlugin._isCloudRecord&&-1!==this.jSPlugin.url.indexOf("cloud.rec"),c=this.isMobile?45:32;switch(e){case"play":r.title=this.jSPlugin.i18n.t("BTN_PLAY"),r.id=e,r.domString='<div style="height: 100%">'+'<svg id="'.concat(this.jSPlugin.id+"-play-icon",'" class="theme-icon-item-icon" style="display:none" width="').concat(this.jSPlugin.width>We?48:32,'" height="').concat(this.jSPlugin.width>We?48:32,'" fill="').concat(r.color,'" viewBox="-6 -6 32 32">\n <path d="M10.5,1.7c-4.9,0-8.8,4-8.8,8.8s4,8.8,8.8,8.8s8.8-4,8.8-8.8S15.4,1.7,10.5,1.7z M10.5,2.7\n c4.3,0,7.8,3.5,7.8,7.8s-3.5,7.8-7.8,7.8s-7.8-3.5-7.8-7.8S6.2,2.7,10.5,2.7z"/>\n <path class="st2" d="M8.7,8C9,8,9.3,8.3,9.3,8.6v3.8C9.3,12.7,9,13,8.7,13C8.3,13,8,12.7,8,12.4V8.6C8,8.3,8.3,8,8.7,8z"/>\n <path id="Rectangle-Copy-10" class="st2" d="M12.8,8c0.3,0,0.6,0.3,0.6,0.6v3.8c0,0.3-0.3,0.6-0.6,0.6c-0.3,0-0.6-0.3-0.6-0.6V8.6\n C12.2,8.3,12.5,8,12.8,8z"/>\n </svg>')+'<svg id="'.concat(this.jSPlugin.id+"-stop-icon",'" class="theme-icon-item-icon" fill="').concat(r.color,'" version="1.1" xmlns="http://www.w3.org/2000/svg" width="').concat(this.jSPlugin.width>We?48:32,'" height="').concat(this.jSPlugin.width>We?48:32,'" viewBox="-6 -6 32 32">')+'<path d="M13,9.8L10.1,8C9.9,7.9,9.7,7.9,9.5,7.9c-0.6,0-1,0.4-1,1v3.7c0,0.2,0.1,0.4,0.2,0.5c0.3,0.5,0.9,0.6,1.4,0.3 l2.9-1.8c0.1-0.1,0.2-0.2,0.3-0.3C13.6,10.7,13.4,10.1,13,9.8z" /><path d="M10.5,1.9c-4.9,0-8.8,4-8.8,8.8c0,4.9,4,8.8,8.8,8.8s8.8-4,8.8-8.8C19.4,5.8,15.4,1.9,10.5,1.9z M10.5,18.5 c-4.3,0-7.8-3.5-7.8-7.8s3.5-7.8,7.8-7.8c4.3,0,7.8,3.5,7.8,7.8S14.9,18.5,10.5,18.5z" /></svg></div>',r.onclick=function(){var e=t.decoderState.state,n=e.play,i=e.rec,o=e.cloudRec,a=e.recordvideo,r=e.pantile,s=e.expend,c=e.zoom,l=e.talk,d=e.sound,u=re.getGlobalState(),m=re.getInstance(t.jSPlugin.id);window.recTimer&&Array.isArray(window.recTimer[t.jSPlugin.id])&&(window.recTimer[t.jSPlugin.id].map((function(e){clearInterval(e)})),window.recTimer[t.jSPlugin.id]=[]),n?(i||o?(t.Rec&&t.Rec.unSyncTimeLine(),t.jSPlugin.pause().then((function(){t.setDecoderState({play:!n}),t.setDisabled(n)}))):(t.jSPlugin.stop((function(){}),!0).then((function(){t.setDecoderState({play:!n}),t.setDisabled(n)})),c&&(t.setDecoderState({zoom:!1}),t.jSPlugin.Zoom.stopZoom(),t.jSPlugin.close3DZoom()),l&&(t.setDecoderState({talk:!1}),document.getElementById("".concat(t.jSPlugin.id,"-volume-column"))&&(document.getElementById("".concat(t.jSPlugin.id,"-volume-column")).style.display="none"),t.jSPlugin.Talk.stopTalk(),u.talk&&re.setGlobalState({talk:!1}),m.getState().talk&&m.setState({talk:!1}))),a&&t.setDecoderState({recordvideo:!1}),d&&(t.jSPlugin.closeSound(),t.setDecoderState({sound:!1}),m.setState({sound:!0}))):(i||o?(t.Rec&&t.Rec.syncTimeLine(),t.jSPlugin.resume().then((function(){t.setDisabled(n),t.setDecoderState({play:!n,expend:s})}))):t.jSPlugin.play().then((function(){t.setDisabled(n),t.setDecoderState({play:!n,expend:s})})),t.jSPlugin.use3DZoom&&t.resetMobileZoomStatus()),t.jSPlugin.use3DZoom?(t.setDecoderState({zoom:!1}),t.allowZoom=!1):t.allowZoom=i||o,r&&t.Ptz&&(t.Ptz.hide(),t.setDecoderState({pantile:!1})),document.getElementById("".concat(t.jSPlugin.id,"-speedSelect"))&&(document.getElementById("".concat(t.jSPlugin.id,"-speedSelect")).style.display="none"),t.setDecoderState({speed:!1})};break;case"sound":r.title=this.jSPlugin.i18n.t("BTN_SOUND"),r.id=e,r.domString='<span style="height: 100%">'+'<svg class="theme-icon-item-icon" id="'.concat(this.jSPlugin.id,'-nosound-icon" style="display:none" fill="').concat(r.color,'" version="1.1" xmlns="http://www.w3.org/2000/svg" width="').concat(this.jSPlugin.width>We?48:32,'" height="').concat(this.jSPlugin.width>We?48:32,'" viewBox="-6 -6 32 32">\n <path d="M8.5,4.2c0.8-0.7,2.1-0.2,2.2,0.9l0,0.1v10c0,1.1-1.2,1.7-2.1,1.1l-0.1-0.1l-3.3-2.8C5,13.2,5,12.9,5.1,12.7 c0.2-0.2,0.4-0.2,0.6-0.1l0.1,0.1l3.3,2.8c0.2,0.2,0.5,0.1,0.5-0.2l0-0.1v-10c0-0.3-0.3-0.4-0.5-0.3L9.2,5L5.9,7.8 C5.6,7.9,5.3,7.9,5.1,7.7C5,7.5,5,7.3,5.1,7.1L5.2,7L8.5,4.2z"/>\n <path d="M5.5,6.9C5.8,6.9,6,7.1,6,7.4c0,0.2-0.2,0.4-0.4,0.5l-0.1,0h-2C3.4,7.9,3.3,8,3.2,8.2l0,0.1v4 c0,0.2,0.1,0.3,0.3,0.3l0.1,0h2C5.8,12.5,6,12.7,6,13c0,0.2-0.2,0.4-0.4,0.5l-0.1,0h-2c-0.7,0-1.3-0.5-1.3-1.2l0-0.1v-4 c0-0.7,0.5-1.3,1.2-1.3l0.1,0H5.5z"/>\n <path d="M17.4,7.9c0.2-0.2,0.5-0.2,0.7,0c0.2,0.2,0.2,0.4,0.1,0.6l-0.1,0.1l-3.8,3.8c-0.2,0.2-0.5,0.2-0.7,0 c-0.2-0.2-0.2-0.4-0.1-0.6l0.1-0.1L17.4,7.9z"/>\n <path d="M13.7,7.9c0.2-0.2,0.4-0.2,0.6-0.1l0.1,0.1l3.8,3.8c0.2,0.2,0.2,0.5,0,0.7c-0.2,0.2-0.4,0.2-0.6,0.1l-0.1-0.1 l-3.7-3.8C13.5,8.4,13.5,8.1,13.7,7.9z"/>\n </svg>')+'<svg class="theme-icon-item-icon" id="'.concat(this.jSPlugin.id,'-sound-icon" style="display:inline-block" width="').concat(this.jSPlugin.width>We?48:32,'" height="').concat(this.jSPlugin.width>We?48:32,'" fill="').concat(r.color,'" viewBox="-6 -6 32 32">\n <path d="M13.2,7.1c0.1-0.2,0.5-0.3,0.7-0.2c1.1,0.7,1.9,2.2,1.9,3.7c0,1.6-0.7,3-1.9,3.7\n c-0.2,0.1-0.5,0.1-0.7-0.2c-0.1-0.2-0.1-0.5,0.2-0.7c0.8-0.5,1.4-1.6,1.4-2.9c0-1.3-0.6-2.4-1.4-2.9C13.1,7.6,13,7.3,13.2,7.1z"/>\n <path d="M15.7,4.5c0.2-0.2,0.5-0.2,0.7-0.1C18,5.8,19,8.2,19,10.7c0,2.5-1,4.8-2.7,6.3\n c-0.2,0.2-0.5,0.2-0.7-0.1c-0.2-0.2-0.2-0.5,0.1-0.7c1.4-1.2,2.3-3.3,2.3-5.5c0-2.2-0.9-4.3-2.3-5.5C15.5,5,15.5,4.7,15.7,4.5z"/>\n <path d="M8.5,4.7c0.8-0.7,2.1-0.2,2.2,0.9l0,0.1v10c0,1.1-1.2,1.7-2.1,1.1l-0.1-0.1l-3.3-2.8\n C5,13.7,5,13.4,5.1,13.2c0.2-0.2,0.4-0.2,0.6-0.1l0.1,0.1l3.3,2.8c0.2,0.2,0.5,0.1,0.5-0.2l0-0.1v-10c0-0.3-0.3-0.4-0.5-0.3l-0.1,0\n L5.9,8.3C5.6,8.4,5.3,8.4,5.1,8.2C5,8,5,7.7,5.1,7.6l0.1-0.1L8.5,4.7z"/>\n <path d="M5.5,7.4C5.8,7.4,6,7.6,6,7.9c0,0.2-0.2,0.4-0.4,0.5l-0.1,0h-2c-0.2,0-0.3,0.1-0.3,0.3l0,0.1v4\n c0,0.2,0.1,0.3,0.3,0.3l0.1,0h2C5.8,13,6,13.2,6,13.5c0,0.2-0.2,0.4-0.4,0.5l-0.1,0h-2c-0.7,0-1.3-0.5-1.3-1.2l0-0.1v-4\n c0-0.7,0.5-1.3,1.2-1.3l0.1,0H5.5z"/>\n </svg>')+"</span>",r.onclick=function(){var e=t.decoderState.state,n=e.play,i=e.sound,o=e.talk,a=e.pantile;n&&!o&&(i?(t.jSPlugin.closeSound(),t.setDecoderState({sound:!1})):t.jSPlugin.openSound(),a&&t.Ptz&&(t.Ptz.hide(),t.setDecoderState({pantile:!1})))};break;case"recordvideo":if(s)break;r.title=this.jSPlugin.i18n.t("BTN_RECORDVIDEO"),r.id=e,r.domString='<svg id="'.concat(this.jSPlugin.id,'-recordvideo-icon" class="theme-icon-item-icon" fill="').concat(r.color,'" version="1.1" xmlns="http://www.w3.org/2000/svg" width="').concat(this.jSPlugin.width>We?48:32,'" height="').concat(this.jSPlugin.width>We?48:32,'" viewBox="-6 -6 32 32">')+'<path d="M11.6,5.3H4.7c-1.4,0-2.5,1.1-2.5,2.5v5.9c0,1.4,1.1,2.5,2.5,2.5h6.9c1.4,0,2.5-1.1,2.5-2.5V7.7 C14.1,6.4,13,5.3,11.6,5.3z M4.7,6.3h6.9c0.8,0,1.5,0.7,1.5,1.5v5.9c0,0.8-0.7,1.5-1.5,1.5H4.7c-0.8,0-1.5-0.7-1.5-1.5V7.7 C3.3,6.9,3.9,6.3,4.7,6.3z" /><path d="M16.6,6.7c0.9-0.8,2.3-0.1,2.4,1l0,0.1v5.7c0,1.2-1.3,1.9-2.3,1.2l-0.1-0.1L13.3,12 c-0.2-0.2-0.2-0.5-0.1-0.7c0.2-0.2,0.4-0.2,0.6-0.1l0.1,0.1l3.3,2.7c0.3,0.2,0.7,0.1,0.8-0.3l0-0.1V7.8c0-0.4-0.4-0.6-0.7-0.4 l-0.1,0l-3.3,2.7c-0.2,0.2-0.5,0.1-0.7-0.1c-0.2-0.2-0.1-0.5,0-0.6l0.1-0.1L16.6,6.7z" /></svg>',r.onclick=function(){var e=t.decoderState.state,n=e.play,i=e.recordvideo;n&&(i?(t.jSPlugin.stopSave(),t.setDecoderState({recordvideo:!1})):(t.jSPlugin.startSave("".concat((new Date).getTime())),t.setDecoderState({recordvideo:!0})))};break;case"capturePicture":r.title=this.jSPlugin.i18n.t("BTN_CAPTURE"),r.id=e,r.domString='<svg id="'.concat(this.jSPlugin.id,'-capturePicture-icon" class="theme-icon-item-icon" fill="').concat(r.color,'" version="1.1" xmlns="http://www.w3.org/2000/svg" width="').concat(this.jSPlugin.width>We?48:32,'" height="').concat(this.jSPlugin.width>We?48:32,'" viewBox="-6 -6 32 32">')+'<path d="M10.8,7.7c-2,0-3.7,1.6-3.7,3.7S8.7,15,10.8,15c2,0,3.7-1.6,3.7-3.7S12.8,7.7,10.8,7.7z M10.8,8.7c1.5,0,2.7,1.2,2.7,2.7S12.2,14,10.8,14c-1.5,0-2.7-1.2-2.7-2.7S9.3,8.7,10.8,8.7z" /><path d="M8.6,3.7l-0.1,0C8,3.7,7.7,4,7.5,4.3l-1,1.7l-1.3,0C4,6.1,3.1,7,3.1,8.2v7.1 c0,1.2,0.9,2.1,2.1,2.1h11.1c1.2,0,2.1-0.9,2.1-2.1V8.2l0-0.1c-0.1-1.1-1-1.9-2.1-1.9l-1.3,0l-1.1-1.8c-0.2-0.4-0.7-0.6-1.1-0.6H8.6 z M8.6,4.7h4.2c0.1,0,0.2,0.1,0.3,0.1l1.2,2c0.1,0.2,0.3,0.2,0.4,0.2h1.6c0.6,0,1.1,0.5,1.1,1.1v7.1c0,0.6-0.5,1.1-1.1,1.1H5.1 c-0.6,0-1.1-0.5-1.1-1.1V8.2c0-0.6,0.5-1.1,1.1-1.1h1.6c0.2,0,0.3-0.1,0.4-0.2l1.2-2C8.4,4.7,8.5,4.7,8.6,4.7z" /></svg>',r.onclick=function(){t.decoderState.state.play?t.jSPlugin.capturePicture("".concat((new Date).getTime()),(function(){}),t.jSPlugin.download):console.log("视频未播放,无法截图")};break;case"talk":if(s)break;r.title=this.jSPlugin.i18n.t("BTN_TALK"),r.id=e,r.domString='<div style="height: '.concat(this.jSPlugin.width>We?15:10,"px; width: ").concat(this.jSPlugin.width>We?8:5,"px; position: absolute; left: ").concat(this.jSPlugin.width>We?20:13,"px; top: ").concat(this.jSPlugin.width>We?14:9,'px; border-radius: 50%; overflow:hidden;">')+'<div id="'.concat(this.jSPlugin.id,'-volume-column" style="height: 0; width: 100%; position: absolute; background: #00cc66; left: 0; bottom: 0; display: none;"></div>')+"</div>"+'<svg id="'.concat(this.jSPlugin.id,'-talk-icon" class="theme-icon-item-icon" fill="').concat(r.color,'" version="1.1" xmlns="http://www.w3.org/2000/svg" width="').concat(this.jSPlugin.width>We?48:32,'" height="').concat(this.jSPlugin.width>We?48:32,'" viewBox="-6 -6 32 32">')+'<path d="M10.1,2.7C8.5,2.7,7.2,4,7.2,5.6v5.2c0,1.6,1.3,2.9,2.9,2.9l0.2,0c1.5-0.1,2.7-1.4,2.7-2.9V5.6\tC13,4,11.7,2.7,10.1,2.7z M10.1,3.7c1.1,0,1.9,0.9,1.9,1.9v5.2c0,1-0.8,1.8-1.8,1.9l-0.1,0c-1,0-1.9-0.9-1.9-1.9V5.6 C8.2,4.5,9,3.7,10.1,3.7z" /><path d="M15.1,8.5c0.2,0,0.4,0.2,0.5,0.4l0,0.1v1.7c0,3-2.5,5.5-5.5,5.5c-3,0-5.4-2.3-5.5-5.3l0-0.2V9 c0-0.3,0.2-0.5,0.5-0.5c0.2,0,0.4,0.2,0.5,0.4l0,0.1v1.7c0,2.5,2,4.5,4.5,4.5c2.4,0,4.4-1.9,4.5-4.3l0-0.2V9 C14.6,8.7,14.8,8.5,15.1,8.5z" /><path d="M13.5,17.7c0.3,0,0.5,0.2,0.5,0.5c0,0.2-0.2,0.4-0.4,0.5l-0.1,0h-7c-0.3,0-0.5-0.2-0.5-0.5 c0-0.2,0.2-0.4,0.4-0.5l0.1,0H13.5z" /><path d="M10.1,15.2c0.2,0,0.4,0.2,0.5,0.4l0,0.1v2.5c0,0.3-0.2,0.5-0.5,0.5c-0.2,0-0.4-0.2-0.5-0.4l0-0.1 v-2.5C9.6,15.4,9.8,15.2,10.1,15.2z" /></svg>',this.jSPlugin.eventEmitter.on("volumeChange",(function(e){var n=e.data;document.getElementById("".concat(t.jSPlugin.id,"-volume-column"))&&(document.getElementById("".concat(t.jSPlugin.id,"-volume-column")).style.height="".concat(100*n,"%"))})),r.onclick=function(){var e=t.decoderState.state,n=e.talk,o=e.sound,a=e.play,r=re.getGlobalState(),s=re.getInstance(t.jSPlugin.id);if(a)if(n){t.setDecoderState({talk:!1}),document.getElementById("".concat(t.jSPlugin.id,"-volume-column"))&&(document.getElementById("".concat(t.jSPlugin.id,"-volume-column")).style.display="none"),t.jSPlugin.Talk.stopTalk();var c=i.findIndex(t.themeData.footer.btnList,(function(e){return"sound"===e.iconId&&1===e.isrender&&1===e.defaultActive}))>-1;t.themeData&&c&&t.jSPlugin.openSound(),r.talk&&re.setGlobalState({talk:!1}),s.getState().talk&&s.setState({talk:!1})}else{if(r.talk)return console.warn("当前已经有设备正在对讲"),void(t.jSPlugin.eventEmitter&&t.jSPlugin.eventEmitter.emit("startTalk",{eventType:"startTalk",code:430005,target:t,msg:"当前已经有设备正在对讲"}));t.setDecoderState({talk:!0}),document.getElementById("".concat(t.jSPlugin.id,"-volume-column")).style.display="block",t.jSPlugin.Talk.startTalk((function(e){o&&!e&&(t.jSPlugin.closeSound(),t.setDecoderState({sound:!1})),re.setGlobalState({talk:!0}),s.setState({talk:!0})}))}};break;case"zoom":if(s)break;r.title=this.jSPlugin.use3DZoom?this.jSPlugin.i18n.t("BTN_3D_ZOOM"):this.jSPlugin.i18n.t("BTN_ZOOM"),r.id=e,r.domString="<div></div>"+'<svg id="'.concat(this.jSPlugin.id,'-zoom-icon" class="theme-icon-item-icon" fill="').concat(r.color,'" version="1.1" id="图层_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"\n width="').concat(this.jSPlugin.width>We?48:32,'" height="').concat(this.jSPlugin.width>We?48:32,'" viewBox="5 -6 5 32" style="enable-background:new 0 0 20 20.1;" xml:space="preserve">\n <path class="st1" d="M8.8,2.6c3.5,0,6.2,2.8,6.2,6.2s-2.8,6.2-6.2,6.2s-6.2-2.8-6.2-6.2S5.3,2.6,8.8,2.6z M8.8,3.9\n c-2.8,0-5,2.2-5,5s2.2,5,5,5s5-2.2,5-5S11.5,3.9,8.8,3.9z M12.7,12.7l3.9,3.9"/>\n <path class="st2" d="M11.2,9.5h-5c-0.3,0-0.6-0.3-0.6-0.6s0.3-0.6,0.6-0.6h5c0.3,0,0.6,0.3,0.6,0.6S11.6,9.5,11.2,9.5z"/>\n <path class="st2" d="M8.7,12c-0.3,0-0.6-0.3-0.6-0.6v-5c0-0.3,0.3-0.6,0.6-0.6s0.6,0.3,0.6,0.6v5C9.3,11.8,9.1,12,8.7,12z"/>\n <path class="st2" d="M16.9,17.6c-0.1,0-0.3-0.1-0.4-0.2l-3.9-3.9c-0.2-0.2-0.2-0.6,0-0.8s0.6-0.2,0.8,0l3.9,3.9\n c0.2,0.2,0.2,0.6,0,0.8C17.2,17.5,17,17.6,16.9,17.6z"/>\n </svg>'),r.onclick=function(){var e=t.decoderState.state,n=e.zoom,i=e.play,o=e.rec,a=e.cloudRec;if(t.jSPlugin.use3DZoom){if(!i)return!1;n?t.jSPlugin.close3DZoom():t.jSPlugin.enable3DZoom()}else{if(t.zoomDisable||!o&&!a&&!i)return!1;n?t.jSPlugin.Zoom.stopZoom():t.jSPlugin.Zoom.startZoom()}t.setDecoderState({zoom:!n})};break;case"pantile":if(s)break;r.title=this.jSPlugin.i18n.t("BTN_PTZ"),r.id=e,r.domString='<svg id="'.concat(this.jSPlugin.id,'-pantile-icon" style="').concat(this.isMobile?this.decoderState.state.expend?"display:block;":"display:none;":"display:block;",'" class="theme-icon-item-icon" fill="').concat(r.color,'" version="1.1" xmlns="http://www.w3.org/2000/svg" width="').concat(this.jSPlugin.width>We?48:32,'" height="').concat(this.jSPlugin.width>We?48:32,'" viewBox="-6 -6 32 32">')+'<path d="M10.2,7.8c1.6,0,2.9,1.3,2.9,2.9s-1.3,2.9-2.9,2.9s-2.9-1.3-2.9-2.9S8.5,7.8,10.2,7.8z M10.2,8.8c-1.1,0-1.9,0.9-1.9,1.9s0.9,1.9,1.9,1.9s1.9-0.9,1.9-1.9S11.2,8.8,10.2,8.8z" /><path d="M8.8,3.5c0.7-0.6,1.8-0.6,2.5-0.1l0.1,0.1l1.4,1.1c0.2,0.2,0.3,0.5,0.1,0.7 c-0.2,0.2-0.4,0.2-0.6,0.1l-0.1,0l-1.4-1.1C10.5,3.9,10,3.9,9.6,4.2L9.4,4.3L8,5.4C7.8,5.5,7.5,5.5,7.3,5.3c-0.2-0.2-0.1-0.5,0-0.6 l0.1-0.1L8.8,3.5z" /><path d="M2.5,12.3c-0.6-0.7-0.6-1.8-0.1-2.5l0.1-0.1l1.1-1.4c0.2-0.2,0.5-0.3,0.7-0.1 c0.2,0.2,0.2,0.4,0.1,0.6l0,0.1l-1.1,1.4C3,10.6,3,11.1,3.2,11.5l0.1,0.1L4.4,13c0.2,0.2,0.1,0.5-0.1,0.7c-0.2,0.2-0.5,0.1-0.6,0 l-0.1-0.1L2.5,12.3z" /><path d="M17.7,12.3c0.6-0.7,0.6-1.8,0.1-2.5l-0.1-0.1l-1.1-1.4c-0.2-0.2-0.5-0.3-0.7-0.1 c-0.2,0.2-0.2,0.4-0.1,0.6l0,0.1l1.1,1.4c0.3,0.4,0.3,0.9,0.1,1.3l-0.1,0.1L15.8,13c-0.2,0.2-0.1,0.5,0.1,0.7c0.2,0.2,0.5,0.1,0.6,0 l0.1-0.1L17.7,12.3z" /><path d="M8.8,18.2c0.7,0.6,1.8,0.6,2.5,0.1l0.1-0.1l1.4-1.1c0.2-0.2,0.3-0.5,0.1-0.7 c-0.2-0.2-0.4-0.2-0.6-0.1l-0.1,0l-1.4,1.1c-0.4,0.3-0.9,0.3-1.3,0.1l-0.1-0.1L8,16.3c-0.2-0.2-0.5-0.1-0.7,0.1 c-0.2,0.2-0.1,0.5,0,0.6l0.1,0.1L8.8,18.2z" /></svg>',r.onclick=function(){var e=t.decoderState.state,n=e.play,i=e.pantile,o=e.expend;if(n)if(i)t.Ptz.hide(),t.setDecoderState({pantile:!1});else{if(t.isMobile&&!o)return console.log("移动端,非全屏状态不展示云台"),!1;t.Ptz.show(),t.setDecoderState({pantile:!0})}};break;case"expend":r.title=this.jSPlugin.i18n.t("BTN_EXPEND"),r.id=e,r.domString='<span><svg id="'.concat(this.jSPlugin.id,'-expend-icon" class="theme-icon-item-icon" fill="').concat(r.color,'" version="1.1" xmlns="http://www.w3.org/2000/svg" width="').concat(this.jSPlugin.width>We?48:32,'" height="').concat(this.jSPlugin.width>We?48:32,'" viewBox="-6 -6 32 32">')+'<path d="M3.4,7.6c-0.3,0-0.5-0.2-0.5-0.5V5.3c0-1.2,1-2.3,2.2-2.3h1.8c0.3,0,0.5,0.2,0.5,0.5S7.2,4.1,6.9,4.1H5.2 c-0.7,0-1.2,0.6-1.2,1.3v1.8C3.9,7.4,3.7,7.6,3.4,7.6z" /><path d="M6.9,18.1H5.2c-1.2,0-2.2-1-2.2-2.2v-1.8c0-0.3,0.2-0.5,0.5-0.5s0.5,0.2,0.5,0.5v1.8c0,0.7,0.6,1.2,1.2,1.2 h1.8c0.3,0,0.5,0.2,0.5,0.5S7.2,18.1,6.9,18.1z" /><path d="M15.7,18.1h-1.8c-0.3,0-0.5-0.2-0.5-0.5s0.2-0.5,0.5-0.5h1.8c0.7,0,1.2-0.6,1.2-1.2v-1.8 c0-0.3,0.2-0.5,0.5-0.5s0.5,0.2,0.5,0.5v1.8C17.9,17.1,16.9,18.1,15.7,18.1z" /><path d="M17.4,7.6c-0.3,0-0.5-0.2-0.5-0.5V5.3c0-0.7-0.6-1.3-1.2-1.3h-1.8c-0.3,0-0.5-0.2-0.5-0.5s0.2-0.5,0.5-0.5h1.8 c1.2,0,2.2,1,2.2,2.3v1.8C17.9,7.4,17.7,7.6,17.4,7.6z" /></svg>'+'<svg id="'.concat(this.jSPlugin.id,'-unexpend-icon" class="theme-icon-item-icon" style="display:none" width="').concat(this.jSPlugin.width>We?48:32,'" height="').concat(this.jSPlugin.width>We?48:32,'" fill="').concat(r.color,'" viewBox="-6 -6 32 32">\n <path class="st1" d="M5.7,8.1H3.9c-0.3,0-0.6-0.2-0.6-0.6S3.6,7,3.9,7h1.9c0.7,0,1.3-0.6,1.3-1.3V3.8c0-0.3,0.2-0.6,0.6-0.6\n s0.6,0.2,0.6,0.6v1.9C8.2,7,7.1,8.1,5.7,8.1z"/>\n <path class="st1" d="M7.6,17.7c-0.3,0-0.6-0.2-0.6-0.6v-1.9c0-0.7-0.6-1.3-1.3-1.3H3.9c-0.3,0-0.6-0.2-0.6-0.6s0.2-0.6,0.6-0.6h1.9\n c1.3,0,2.4,1.1,2.4,2.4v1.9C8.2,17.5,7.9,17.7,7.6,17.7z"/>\n <path class="st1" d="M13.4,17.7c-0.3,0-0.6-0.2-0.6-0.6v-1.9c0-1.3,1.1-2.4,2.4-2.4h1.9c0.3,0,0.6,0.2,0.6,0.6S17.5,14,17.2,14\n h-1.9c-0.7,0-1.3,0.6-1.3,1.3v1.9C14,17.5,13.8,17.7,13.4,17.7z"/>\n <path class="st1" d="M17.2,8.1h-1.9c-1.3,0-2.4-1.1-2.4-2.4V3.8c0-0.3,0.2-0.6,0.6-0.6S14,3.5,14,3.8v1.9C14,6.4,14.6,7,15.3,7h1.9\n c0.3,0,0.6,0.2,0.6,0.6S17.5,8.1,17.2,8.1z"/>\n </svg>\n </span>'),r.onclick=function(){var e=t.decoderState.state,n=e.expend,i=e.pantile;if(e.play)if(n)if(t.isMobile){var o=t._extendHeadeTimeLinrHight(!0);document.getElementById("".concat(t.jSPlugin.id,"-ez-iframe-footer-container"))&&(document.getElementById("".concat(t.jSPlugin.id,"-ez-iframe-footer-container")).style.marginTop="-32px"),document.getElementById("".concat(t.jSPlugin.id,"-select-speed"))&&(document.getElementById("".concat(t.jSPlugin.id,"-select-speed")).style.background="#ffffff"),function(e,t,n){var i="";i+="width:"+t+"px;",i+="height:"+n+"px;",i+="-webkit-transform: none; transform: none;",i+="-webkit-transform-origin: 0 0;",i+="transform-origin: 0 0;",i+="position: relative;",e.style.cssText=i}(document.getElementById("".concat(t.jSPlugin.id,"-wrap")),t.jSPlugin.width,t.jSPlugin.height),console.log("[mobile cancelMobileFullScreen]"),document.getElementById("".concat(t.jSPlugin.id,"-wrap")).classList.remove("ezuikit-player-wrap-mobile-fullscreen"),t.jSPlugin.jSPlugin.JS_Resize(t.jSPlugin.width,t.jSPlugin.height-o),i&&t.Ptz&&(t.Ptz.hide(),t.setDecoderState({pantile:!1})),t.jSPlugin.fullScreenWidth=t.jSPlugin.width,t.jSPlugin.fullScreenHeight=t.jSPlugin.height,t.jSPlugin.Zoom&&t.jSPlugin.Zoom.handleFullscreen&&t.jSPlugin.Zoom.handleFullscreen(!n,t.jSPlugin.width,t.jSPlugin.height),document.getElementById("".concat(t.jSPlugin.id,"-pantile-icon"))&&(document.getElementById("".concat(t.jSPlugin.id,"-pantile-icon")).style.display="none"),document.getElementById("".concat(t.jSPlugin.id,"-hdSelect"))&&(document.getElementById("".concat(t.jSPlugin.id,"-hdSelect")).style.bottom="calc(constant(safe-area-inset-bottom) + 100px)",document.getElementById("".concat(t.jSPlugin.id,"-hdSelect")).style.bottom="calc(env(safe-area-inset-bottom) + 100px)",document.getElementById("".concat(t.jSPlugin.id,"-hdSelect")).style.height=45*t.jSPlugin.videoLevelList.length+"px"),t.setDecoderState({expend:!1})}else t.jSPlugin.exitFullscreen();else if(t.isMobile){var a=t._extendHeadeTimeLinrHight(!0);j(document.getElementById("".concat(t.jSPlugin.id,"-wrap"))),document.getElementById("".concat(t.jSPlugin.id,"-wrap")).classList.add("ezuikit-player-wrap-mobile-fullscreen"),console.log("[mobile requestMobileFullScreen]");var r=document.documentElement.clientWidth,s=document.documentElement.clientHeight;document.getElementById("".concat(t.jSPlugin.id))&&(document.getElementById("".concat(t.jSPlugin.id)).style["backface-visibility"]="hidden"),document.getElementById("".concat(t.jSPlugin.id,"-select-speed"))&&(document.getElementById("".concat(t.jSPlugin.id,"-select-speed")).style.background="none"),t.jSPlugin.jSPlugin.JS_Resize(s,r-a,!0),t.jSPlugin.fullScreenWidth=s,t.jSPlugin.fullScreenHeight=r-a,t.jSPlugin.Zoom&&t.jSPlugin.Zoom.handleFullscreen&&t.jSPlugin.Zoom.handleFullscreen(!n,s,r-a),document.getElementById("".concat(t.jSPlugin.id,"-pantile-icon"))&&(document.getElementById("".concat(t.jSPlugin.id,"-pantile-icon")).style.display="block"),document.getElementById("".concat(t.jSPlugin.id,"-hdSelect"))&&(document.getElementById("".concat(t.jSPlugin.id,"-hdSelect")).style.bottom=0,document.getElementById("".concat(t.jSPlugin.id,"-hdSelect")).style.height="100%"),t.setDecoderState({expend:!0})}else t.jSPlugin.fullscreen()};break;case"webExpend":if(s)break;r.title=this.jSPlugin.i18n.t("BTN_WEBEXPEND"),r.id=e,r.domString='<span><svg id="'.concat(this.jSPlugin.id,'-webExpend-icon" class="theme-icon-item-icon" fill="').concat(r.color,'" version="1.1" xmlns="http://www.w3.org/2000/svg" width="').concat(this.jSPlugin.width>We?48:32,'" height="').concat(this.jSPlugin.width>We?48:32,'" viewBox="-6 -6 32 32">')+'<path d="M3.1,7.6c-0.3,0-0.5-0.2-0.5-0.5V5.3c0-1.2,1-2.3,2.2-2.3h1.8c0.3,0,0.5,0.2,0.5,0.5S6.8,4.1,6.6,4.1H4.8 c-0.7,0-1.2,0.6-1.2,1.3v1.8C3.6,7.4,3.3,7.6,3.1,7.6z" /><path d="M15.3,18.1h-1.8c-0.3,0-0.5-0.2-0.5-0.5s0.2-0.5,0.5-0.5h1.8c0.7,0,1.2-0.6,1.2-1.2v-1.8 c0-0.3,0.2-0.5,0.5-0.5s0.5,0.2,0.5,0.5v1.8C17.6,17.1,16.6,18.1,15.3,18.1z" /><circle class="st2" cx="10.2" cy="10.4" r="1.1"/></svg>'+'<svg class="theme-icon-item-icon" fill="'.concat(r.color,'" style="display:none;" version="1.1" xmlns="http://www.w3.org/2000/svg" width="').concat(this.jSPlugin.width>We?48:32,'" height="').concat(this.jSPlugin.width>We?48:32,'" viewBox="-6 -6 32 32">\n <path class="st1" d="M5.4,8.1H3.5C3.2,8.1,3,7.9,3,7.6s0.2-0.5,0.5-0.5h1.9c0.8,0,1.4-0.6,1.4-1.4V3.8c0-0.3,0.2-0.5,0.5-0.5\n s0.5,0.2,0.5,0.5v1.9C7.7,7,6.7,8.1,5.4,8.1z"/>\n <path class="st1" d="M13.1,17.7c-0.3,0-0.5-0.2-0.5-0.5v-1.9c0-1.3,1.1-2.4,2.4-2.4h1.9c0.3,0,0.5,0.2,0.5,0.5s-0.2,0.5-0.5,0.5H15\n c-0.8,0-1.4,0.6-1.4,1.4v1.9C13.6,17.4,13.4,17.7,13.1,17.7z"/>\n <circle class="st2" cx="10.2" cy="10.4" r="1.1"/>\n ')+"</svg></span>",r.onclick=function(){var e=t.decoderState.state,n=e.webExpend;if(e.expend)return console.log("正在全局全屏"),!1;window.recTimer&&Array.isArray(window.recTimer[t.jSPlugin.id])&&(window.recTimer[t.jSPlugin.id].map((function(e){clearInterval(e)})),window.recTimer[t.jSPlugin.id]=[]),n?t.jSPlugin.exitBrowserFullscreen():t.jSPlugin.browserFullscreen(),t.jSPlugin.Theme.Rec&&setTimeout((function(){t.jSPlugin.Theme.Rec.recAutoSize()}),100)};break;case"hd":if(s)break;var l="".concat(this.jSPlugin.id,"-select-quality"),d="".concat(l,"-item");r.title=this.jSPlugin.i18n.t("BTN_HD"),r.id=e;var u="",m="";return this.jSPlugin.videoLevelList.findIndex((function(e){return e.level==t.jSPlugin.videoLevel}))>-1?this.jSPlugin.videoLevelList.map((function(e){u+='<li class="selectOption default '.concat(d,'" style="height: ').concat(c,"px;text-align: center;line-height: ").concat(c,'px;list-style: none;cursor: pointer;" name="option" data-type="').concat(e.level,'" id="').concat(l,"_").concat(e.level,'">').concat(t.jSPlugin.i18n.t(Ne[e.level]),"</li>"),e.level==t.jSPlugin.videoLevel&&(m+=t._videoLevelIcon(t.jSPlugin.id,l,t.jSPlugin.width,We,e))})):this.jSPlugin.videoLevelList.map((function(e,n){0===n&&(m+=t._videoLevelIcon(t.jSPlugin.id,l,t.jSPlugin.width,We,e)),u+='<li class="selectOption default '.concat(d,'" style="height: ').concat(c,"px;text-align: center;line-height: ").concat(c,'px;list-style: none;cursor: pointer;" name="option" data-type="').concat(e.level,'" id="').concat(l,"_").concat(e.level,'">').concat(t.jSPlugin.i18n.t(Ne[e.level]),"</li>")})),u+='<li class="selectOption cancel" style="background: #ffffff;'.concat(this.isMobile?"":"display:none;",'" name="option" id="').concat(this.jSPlugin.id,'-select-speed">').concat(this.jSPlugin.i18n.t("SPEED_CANCEL"),"</li>"),m+='<span class=\'speed-select-mask\' style="display:none;height: 100vh;" id="'.concat(this.jSPlugin.id,'-select-hd-mask"></span>'),r.domString='<ul id="'.concat(this.jSPlugin.id,'-hdSelect" class="hd speed-select ').concat(this.isMobile?"mobile":"",'" style="display:none;bottom: calc(constant(safe-area-inset-bottom) + ').concat(this.isMobile?"100px":"50px",") !important;bottom: calc(env(safe-area-inset-bottom) + ").concat(this.isMobile?"100px":"50px",") !important;height: ").concat(this.jSPlugin.videoLevelList.length*c,'px">\n ').concat(u,'\n </ul>\n <span id="').concat(this.jSPlugin.id,'-hdSelect-icon-warp" style="user-select: none;">\n ').concat(m,"\n </span>"),r.onclick=function(e){var n=t.decoderState.state,i=n.expend,o=n.recordvideo,a=n.play,r=n.zoom,s=n.pantile,c=n.sound,d=n.talk;if(e.stopPropagation(),a){var u=e.target.id,m=e.target.getAttribute("data-type");if(0===u.indexOf(l)){if(t.jSPlugin.videoLevel+""!==m){if(d){var h=re.getGlobalState(),p=re.getInstance(t.jSPlugin.id);t.setDecoderState({talk:!1}),document.getElementById("".concat(t.jSPlugin.id,"-volume-column"))&&(document.getElementById("".concat(t.jSPlugin.id,"-volume-column")).style.display="none"),t.jSPlugin.Talk.stopTalk(),h.talk&&re.setGlobalState({talk:!1}),p.getState().talk&&p.setState({talk:!1})}var g=t.jSPlugin.videoLevelList.find((function(e){return e.level+""===m}));!g||g.streamTypeIn===t.jSPlugin.streamTypeIn&&g.level+""==t.jSPlugin.videoLevel+""||(t.jSPlugin.changeVideoLevel(g).then((function(e){c&&t.jSPlugin.openSound()})),r&&(t.jSPlugin.Zoom.stopZoom(),t.setDecoderState({zoom:!1})))}t.resetMobileZoomStatus(),o&&t.setDecoderState({recordvideo:!1})}t.showHD=!t.showHD,document.getElementById("".concat(t.jSPlugin.id,"-hdSelect"))&&(document.getElementById("".concat(t.jSPlugin.id,"-hdSelect")).style.display="none"===document.getElementById("".concat(t.jSPlugin.id,"-hdSelect")).style.display?"block":"none",t.isMobile&&(document.getElementById("".concat(t.jSPlugin.id,"-select-hd-mask")).style.display="none"===document.getElementById("".concat(t.jSPlugin.id,"-select-hd-mask")).style.display?"block":"none"),t.themeData.autoFocus>0&&("none"===document.getElementById("".concat(t.jSPlugin.id,"-hdSelect")).style.display?t.startAutoFocus():t.stopAutoFocus())),t.isMobile&&i&&t.showHD?document.getElementById("".concat(t.jSPlugin.id,"-hdSelect")).className="hd speed-select mobile expend":document.getElementById("".concat(t.jSPlugin.id,"-hdSelect")).className=t.isMobile?"hd speed-select mobile":"speed-select",s&&t.Ptz&&(t.Ptz.hide(),t.setDecoderState({pantile:!1}))}},r;case"speed":if(s)break;r.title=this.jSPlugin.i18n.t("BTN_SPEED"),r.id=e,r.domString='<ul id="'.concat(this.jSPlugin.id,'-speedSelect" class="speed speed-select ').concat(this.isMobile?"mobile":"",'" style="display:none;bottom: calc(constant(safe-area-inset-bottom) + ').concat(this.isMobile?"100px":"50px",") !important;bottom: calc(env(safe-area-inset-bottom) + ").concat(this.isMobile?"100px":"50px",') !important;">')+'<li class="selectOption default" style="height: '.concat(c,"px;text-align: center;line-height: ").concat(c,'px;list-style: none;cursor: pointer;font-size: 13px;" name="option" id="').concat(this.jSPlugin.id,'-select-speed4">4').concat(this.jSPlugin.i18n.t("SPEED_RATE"),"</li>")+'<li class="selectOption default" style="height: '.concat(c,"px;text-align: center;line-height: ").concat(c,'px;list-style: none;cursor: pointer;font-size: 13px;" name="option" id="').concat(this.jSPlugin.id,'-select-speed2">2').concat(this.jSPlugin.i18n.t("SPEED_RATE"),"</li>")+'<li class="selectOption active" style="height: '.concat(c,"px;text-align: center;line-height: ").concat(c,'px;list-style: none;cursor: pointer;font-size: 13px;" name="option" id="').concat(this.jSPlugin.id,'-select-speed1">1').concat(this.jSPlugin.i18n.t("SPEED_RATE"),"</li>")+'<li class="selectOption default" style="height: '.concat(c,"px;text-align: center;line-height: ").concat(c,'px;list-style: none;cursor: pointer;font-size: 13px;" name="option" id="').concat(this.jSPlugin.id,'-select-speed05">0.5').concat(this.jSPlugin.i18n.t("SPEED_RATE"),"</li>")+'<li class="selectOption cancel" style="'.concat(this.isMobile?"":"display:none;",'" name="option" id="').concat(this.jSPlugin.id,'-select-speed">').concat(this.jSPlugin.i18n.t("SPEED_CANCEL"),"</li>")+"</ul>"+'<span>\n <div style="font-size: 12px;\n vertical-align: bottom;\n display: inline-flex;\n padding: 0px 7px;\n width: 48px;\n line-height: 24px;\n justify-content: center;\n border: 1px solid '.concat(r.color,';\n text-align: center;border-radius: 12.5px; user-select: none;"\n id="').concat(this.jSPlugin.id,'-speed-text"\n >').concat(1===this.nextRate?this.jSPlugin.i18n.t("SPEED"):"".concat(this.nextRate).concat(this.jSPlugin.i18n.t("SPEED_RATE")).replace("3","0.5"),"</div>\n ")+'<span class=\'speed-select-mask\' style="display:none;height: 100vh;" id="'.concat(this.jSPlugin.id,'-select-mask"></span>')+"</span>",r.onclick=function(e){var n=t.decoderState.state,i=n.speed,o=n.expend,a=n.play;if(e.stopPropagation(),!a)return!1;if(!i&&t.isMobile&&(document.getElementById("".concat(t.jSPlugin.id,"-speedSelect")).className=o?"speed speed-select mobile expend":"speed speed-select mobile"),t.isMobile&&(o?(document.getElementById("".concat(t.jSPlugin.id,"-speedSelect")).style.bottom="constant(safe-area-inset-bottom)",document.getElementById("".concat(t.jSPlugin.id,"-speedSelect")).style.bottom="env(safe-area-inset-bottom)"):(document.getElementById("".concat(t.jSPlugin.id,"-speedSelect")).style.bottom="calc(constant(safe-area-inset-bottom) + 100px)",document.getElementById("".concat(t.jSPlugin.id,"-speedSelect")).style.bottom="calc(env(safe-area-inset-bottom) + 100px)")),t.nextRate=1,e.target.id)switch(e.target.id){case"".concat(t.jSPlugin.id,"-select-speed1"):t.nextRate=1,t.jSPlugin.jSPlugin.JS_Speed(t.nextRate),t.changeRecSpeed(1),t.jSPlugin.speed=1,t.setDecoderState({speed:!i});break;case"".concat(t.jSPlugin.id,"-select-speed2"):t.nextRate=2,t.jSPlugin.jSPlugin.JS_Speed(t.nextRate),t.changeRecSpeed(2),t.jSPlugin.speed=2,t.setDecoderState({speed:!i});break;case"".concat(t.jSPlugin.id,"-select-speed4"):t.nextRate=4,t.jSPlugin.jSPlugin.JS_Speed(t.nextRate),t.changeRecSpeed(4),t.jSPlugin.speed=4,t.setDecoderState({speed:!i});break;case"".concat(t.jSPlugin.id,"-select-speed05"):t.nextRate=3,t.jSPlugin.jSPlugin.JS_Speed(t.nextRate),t.changeRecSpeed(.5),t.jSPlugin.speed=.5,t.setDecoderState({speed:!i});break;default:t.isMobile?t.setDecoderState({speed:!i}):t.setDecoderState({speed:!0})}t.isMobile&&e.target.id==="".concat(t.jSPlugin.id,"-speed-text")?document.getElementById("".concat(t.jSPlugin.id,"-speedSelect")).style.display="block":document.getElementById("".concat(t.jSPlugin.id,"-speedSelect"))&&(document.getElementById("".concat(t.jSPlugin.id,"-speedSelect")).style.display="none"===document.getElementById("".concat(t.jSPlugin.id,"-speedSelect")).style.display?"block":"none"),t.setDecoderState({speed:!i}),t.themeData.autoFocus>0&&("none"===document.getElementById("".concat(t.jSPlugin.id,"-speedSelect")).style.display?t.startAutoFocus():t.stopAutoFocus())};break;case"deviceName":r.title=this.jSPlugin.i18n.t("DEVICE_NAME"),r.id=e,r.domString="<span>".concat(this.jSPlugin.i18n.t("DEVICE_NAME"),"</span>"),r.onclick=function(){};break;case"deviceID":r.title=this.jSPlugin.i18n.t("DEVICE_ID"),r.id=e,r.domString="<span>".concat(this.jSPlugin.i18n.t("DEVICE_ID"),"</span>"),r.onclick=function(){};break;case"cloudRec":if(this.jSPlugin._isCloudRecord)break;r.title=this.jSPlugin.i18n.t("BTN_CLOUDREC"),r.id=e,r.domString='\n <span>\n <svg class="theme-icon-item-icon" fill="'.concat(r.color,'" version="1.1" xmlns="http://www.w3.org/2000/svg" width="').concat(this.jSPlugin.width>We?48:32,'" height="').concat(this.jSPlugin.width>We?48:32,'" viewBox="-10 0 40 15">\n\t<path d="M9.5,13.1c-0.3,0-0.5-0.2-0.5-0.5V8.8c0-0.3,0.2-0.5,0.5-0.5S10,8.5,10,8.8v3.8C10,12.8,9.8,13.1,9.5,13.1z"/>\n\t<path d="M7.6,10.6c-0.1,0-0.3-0.1-0.4-0.2C7,10.2,7,9.9,7.3,9.7l1.9-1.7c0.2-0.2,0.5-0.2,0.7,0l1.8,1.7\n\t\tc0.2,0.2,0.2,0.5,0,0.7c-0.2,0.2-0.5,0.2-0.7,0L9.5,9.1l-1.6,1.4C7.8,10.6,7.7,10.6,7.6,10.6z"/>\n\t<path d="M13.2,15.7H5.6c-2.1-0.1-3.8-1.8-3.8-3.9c0-1.8,1.3-3.4,3-3.8c0.4-2.2,2.3-3.9,4.6-3.9c2.3,0,4.2,1.7,4.6,3.8\n\t\tc1.8,0.4,3.1,1.9,3.1,3.8C17.1,13.9,15.4,15.7,13.2,15.7z M5.6,14.7h7.6c1.6,0,2.9-1.3,2.9-2.9c0-1.5-1.1-2.7-2.6-2.9l-0.4,0l0-0.4\n\t\tc-0.2-1.9-1.7-3.3-3.6-3.3C7.5,5.1,6,6.6,5.8,8.5l0,0.4l-0.4,0c-1.4,0.2-2.5,1.4-2.5,2.9C2.8,13.3,4.1,14.6,5.6,14.7z"/>\n </svg>\n </span>\n '),r.onclick=function(){var e=t.decoderState.state.sound;t.setDecoderState({type:"cloud.rec",cloudRec:!0,rec:!1}),t.jSPlugin.eventEmitter.emit("recTypeChange",{eventType:"recTypeChange",code:0,data:{type:"cloud"}}),t.jSPlugin.changePlayUrl({type:"cloud.rec"},(function(){var e=I("begin",t.jSPlugin.url)||(new Date).Format("yyyyMMdd");t.Rec.renderRec("".concat(e.slice(0,4),"-").concat(e.slice(4,6),"-").concat(e.slice(6,8))),t.decoderState.state.zoom&&(t.setDecoderState({zoom:!1}),t.jSPlugin.Zoom.stopZoom(),t.jSPlugin.close3DZoom()),t.Rec&&t.Rec.syncTimeLine()}),!1).then((function(){e&&t.jSPlugin.openSound()}))};break;case"cloudRecord":if(!this.jSPlugin._isCloudRecord)break;r.title=this.jSPlugin.i18n.t("BTN_CLOUDRECORD"),r.id=e,r.domString='<span style="font-size: 24px; width: 48px; display: inline-block; text-align: center;line-height: 56px;"> \n<svg class="theme-icon-item-icon" fill="'.concat(r.color,'" version="1.1" height="1em" viewBox="0 0 48 49">\n<g transform="translate(3.000000, 10.000000)">\n\t<g><path d="M38.1,24.2c-0.8,0-1.6-0.2-2.3-0.6L31,20.9l1.5-2.6l4.8,2.7c0.3,0.1,0.5,0.2,0.8,0.2c1,0,1.8-0.8,1.8-1.8V9.6\n\t\t\tc0-0.3-0.1-0.5-0.2-0.8c-0.2-0.4-0.6-0.8-1-0.9c-0.4-0.2-0.9-0.1-1.3,0.1l-5,2.4l-1.3-2.7l5-2.4c1.1-0.5,2.4-0.6,3.6-0.2\n\t\t\tc1.2,0.4,2.2,1.3,2.7,2.5c0.3,0.6,0.4,1.3,0.4,2v9.8C42.8,22,40.7,24.2,38.1,24.2z"/>\n\t</g>\n\t<g><path d="M27.7,30H4.9c-3.5,0-6.4-2.9-6.4-6.4V5.4C-1.5,1.9,1.4-1,4.9-1h22.8c3.5,0,6.4,2.9,6.4,6.4v18.1\n\t\t\tC34.1,27.1,31.2,30,27.7,30z M4.9,2C3,2,1.5,3.5,1.5,5.4v18.1C1.5,25.5,3,27,4.9,27h22.8c1.9,0,3.4-1.5,3.4-3.4V5.4\n\t\t\tc0-1.9-1.5-3.4-3.4-3.4H4.9z"/>\n\t</g><g><path d="M12.1,7.1c0.9,0,1.6,0.7,1.6,1.5c0,0.8-0.6,1.4-1.4,1.5l-0.2,0H8.9c-0.9,0-1.6-0.7-1.6-1.5\n\t\t\tc0-0.8,0.6-1.4,1.4-1.5l0.2,0H12.1z"/></g></g></svg></span>'),r.onclick=function(){var e=t.decoderState.state.sound;t.setDecoderState({type:"cloud.rec",cloudRec:!0,rec:!1}),t.jSPlugin.eventEmitter.emit("recTypeChange",{eventType:"recTypeChange",code:0,data:{type:"cloudRecord"}}),t.jSPlugin.url.replace(/rec\??|cloud.rec\??/,"cloud.rec?busType=7"),t.jSPlugin.changePlayUrl({type:"cloud.rec"},(function(){t.jSPlugin._isCloudRecord&&t.changeTheme("pcRec");var e=I("begin",t.jSPlugin.url)||(new Date).Format("yyyyMMdd");t.Rec.renderRec("".concat(e.slice(0,4),"-").concat(e.slice(4,6),"-").concat(e.slice(6,8))),t.decoderState.state.zoom&&(t.setDecoderState({zoom:!1}),t.jSPlugin.Zoom.stopZoom(),t.jSPlugin.close3DZoom()),t.Rec&&t.Rec.syncTimeLine()}),!1).then((function(){e&&t.jSPlugin.openSound()}))};break;case"rec":r.title=this.jSPlugin.i18n.t("BTN_REC"),r.id=e,r.domString='\n <span>\n <svg class="theme-icon-item-icon" fill='.concat(r.color,' version="1.1" xmlns="http://www.w3.org/2000/svg" width="').concat(this.jSPlugin.width>We?48:32,'" height="').concat(this.jSPlugin.width>We?48:32,'" viewBox="0 0 40 15">\n <path d="M13,16.3H5.5c-1.1,0-2-0.9-2-2V3.8c0-1.1,0.9-2,2-2h5.4c0.5,0,1,0.2,1.4,0.6l2.1,2.1C14.8,4.8,15,5.3,15,5.9\n v8.4C15,15.4,14.1,16.3,13,16.3z M5.5,2.8c-0.6,0-1,0.4-1,1v10.5c0,0.6,0.4,1,1,1H13c0.6,0,1-0.4,1-1V5.9c0-0.3-0.1-0.5-0.3-0.7\n L11.6,3c-0.2-0.2-0.4-0.3-0.7-0.3H5.5z"/>\n<path d="M6.3,7.3C6,7.3,5.8,7,5.8,6.8V4.5C5.8,4.2,6,4,6.3,4s0.5,0.2,0.5,0.5v2.2C6.8,7,6.6,7.3,6.3,7.3z"/>\n<path d="M8.5,7.3C8.3,7.3,8,7,8,6.8V4.5C8,4.2,8.3,4,8.5,4S9,4.2,9,4.5v2.2C9,7,8.8,7.3,8.5,7.3z"/>\n<path d="M10.8,7.3c-0.3,0-0.5-0.2-0.5-0.5V4.5c0-0.3,0.2-0.5,0.5-0.5s0.5,0.2,0.5,0.5v2.2C11.3,7,11.1,7.3,10.8,7.3z"\n />\n </svg>\n </span>\n '),r.onclick=function(){var e=t.decoderState.state.sound;t.setDecoderState({type:"rec",cloudRec:!1,rec:!0}),t.jSPlugin.eventEmitter.emit("recTypeChange",{eventType:"recTypeChange",code:0,data:{type:"local"}}),t.jSPlugin.changePlayUrl({type:"rec"},(function(){t.jSPlugin._isCloudRecord&&t.changeTheme("pcRec");var e=I("begin",t.jSPlugin.url)||(new Date).Format("yyyyMMdd");t.Rec.renderRec("".concat(e.slice(0,4),"-").concat(e.slice(4,6),"-").concat(e.slice(6,8))),t.decoderState.state.zoom&&(t.setDecoderState({zoom:!1}),t.jSPlugin.Zoom.stopZoom(),t.jSPlugin.close3DZoom()),t.Rec&&t.Rec.syncTimeLine()}),!1).then((function(){e&&t.jSPlugin.openSound()}))}}return r}},{key:"_videoLevelIcon",value:function(e,t,n,i,o){return'\n <span id="'.concat(e,'-videoLevel-icon" class="theme-icon-item-icon ').concat(t,"-btn\" data-type='").concat(o.level,"' style=\"display: inline-block;min-width: 48px;height: ").concat(n>i?48:32,"px;line-height: ").concat(n>i?48:30,'px;text-align: center;">\n ').concat(this.jSPlugin.i18n.t(Ne[o.level]),"\n </span>\n ")}},{key:"_fullScreenChangeEvent",value:function(){var e=this,t=document.getElementById("".concat(this.jSPlugin.id,"-wrap")),i=document.getElementById("".concat(this.jSPlugin.id)),o=this;this._fullscreenchange=function(n){var a=o.decoderState.state.zoom;n.target===i?e.jSPlugin.isCurrentFullscreen?o.setDecoderState({expend:!0,webExpend:!1}):(o.setDecoderState({expend:!1,webExpend:!1}),a&&o.jSPlugin.use3DZoom&&o.jSPlugin.enable3DZoom()):n.target===t&&(e.jSPlugin.isCurrentBrowserFullscreen?o.setDecoderState({webExpend:!0}):o.setDecoderState({webExpend:!1})),o.Rec&&window.randomNum==o.jSPlugin.randomNum&&setTimeout((function(){o.Rec.recAutoSize((function(){if(o.jSPlugin.Zoom.currentScale>1){var e=o.jSPlugin.Zoom.currentScale;o.jSPlugin.Zoom.stopZoom(),setTimeout((function(){o.jSPlugin.Zoom.startZoom(),o.jSPlugin.Zoom.currentScale=e,o.jSPlugin.Zoom.doScale(e)}),200)}}))}),100),document.getElementById("".concat(o.jSPlugin.id,"-hdSelect"))&&(document.getElementById("".concat(o.jSPlugin.id,"-hdSelect")).style.display="none"),document.getElementById("".concat(o.jSPlugin.id,"-speedSelect"))&&(document.getElementById("".concat(o.jSPlugin.id,"-speedSelect")).style.display="none"),o.isMobile&&(document.getElementById("".concat(o.jSPlugin.id,"-select-hd-mask"))&&(document.getElementById("".concat(o.jSPlugin.id,"-select-hd-mask")).style.display="none"),document.getElementById("".concat(o.jSPlugin.id,"-select-mask"))&&(document.getElementById("".concat(o.jSPlugin.id,"-select-mask")).style.display="none")),o.themeData.autoFocus>0&&o.startAutoFocus(),e.setDecoderState({speed:!1})},n.isEnabled&&n.on("change",this._fullscreenchange)}},{key:"changeRecSpeed",value:function(e){var t=this,n=function(e){if(!document.getElementById("".concat(t.jSPlugin.id,"-speedSelect")))return!1;document.getElementById("".concat(t.jSPlugin.id,"-speedSelect")).childNodes[0].className=document.getElementById("".concat(t.jSPlugin.id,"-speedSelect")).childNodes[0].className.replace("active","default"),document.getElementById("".concat(t.jSPlugin.id,"-speedSelect")).childNodes[1].className=document.getElementById("".concat(t.jSPlugin.id,"-speedSelect")).childNodes[1].className.replace("active","default"),document.getElementById("".concat(t.jSPlugin.id,"-speedSelect")).childNodes[2].className=document.getElementById("".concat(t.jSPlugin.id,"-speedSelect")).childNodes[2].className.replace("active","default"),document.getElementById("".concat(t.jSPlugin.id,"-speedSelect")).childNodes[3].className=document.getElementById("".concat(t.jSPlugin.id,"-speedSelect")).childNodes[3].className.replace("active","default"),document.getElementById("".concat(t.jSPlugin.id,"-speedSelect")).childNodes[e].className=document.getElementById("".concat(t.jSPlugin.id,"-speedSelect")).childNodes[e].className.replace("default","active")},i="1";switch(e){case 1:n(2),i=this.jSPlugin.i18n.t("SPEED");break;case 2:n(1),i="".concat(e).concat(this.jSPlugin.i18n.t("SPEED_RATE"));break;case 4:n(0),i="".concat(e).concat(this.jSPlugin.i18n.t("SPEED_RATE"));break;case.5:n(3),i="".concat(e).concat(this.jSPlugin.i18n.t("SPEED_RATE"));break;default:n(2),i="".concat(e).concat(this.jSPlugin.i18n.t("SPEED_RATE"))}document.getElementById("".concat(this.jSPlugin.id,"-speed-text"))&&(document.getElementById("".concat(this.jSPlugin.id,"-speed-text")).innerHTML=i)}},{key:"initThemeData",value:function(){var e=this,t=this.themeData,n=t.header,o=t.footer,a=this.jSPlugin.id;if(this.header=me,this.footer=he,this.isNeedRenderHeader=i.findIndex(n.btnList,(function(e){return e.isrender>0}))>=0&&"miniRec"!=this.jSPlugin.id,this.isMobile&&(this.isNeedRenderHeader=i.findIndex(n.btnList,(function(e){return e.isrender>0&&"deviceID"===e.iconId||e.isrender>0&&"deviceName"===e.iconId}))>=0&&"miniRec"!=this.jSPlugin.id),this.isNeedRenderFooter=i.findIndex(o.btnList,(function(e){return e.isrender>0}))>=0&&"miniRec"!=this.jSPlugin.id,this.isNeedRenderTimeLine=i.findIndex(n.btnList,(function(e){return"cloudRec"===e.iconId&&1===e.isrender||"rec"===e.iconId&&1===e.isrender}))>=0&&!this.jSPlugin.disabledTimeLine&&"miniRec"!=this.jSPlugin.id,["date-switch-container-wrap","rec-type-container-wrap","mobile-rec-wrap","mobile-ez-ptz-container"].forEach((function(e,t){document.getElementById(e)&&document.getElementById(e).parentElement.removeChild(document.getElementById(e))})),this.isNeedRenderHeader){if(document.getElementById("".concat(this.jSPlugin.id,"-headControl")))document.getElementById("".concat(this.jSPlugin.id,"-headControl")).innerHTML="<div id='".concat(this.jSPlugin.id,"-headControl-left' style='display:flex;width: calc(100% - 100px);'></div><div id='").concat(this.jSPlugin.id,"-headControl-right' style='display:flex'></div>");else{var r=document.createElement("div");r.setAttribute("id","".concat(this.jSPlugin.id,"-headControl")),r.setAttribute("class","header-controls"),r.innerHTML="<div id='".concat(this.jSPlugin.id,"-headControl-left' class=\"header-controls-left\" style='display:flex;width:calc(100% - 100px);overflow:hidden;'></div><div id='").concat(this.jSPlugin.id,"-headControl-right' class=\"header-controls-right\" style='display:flex;'></div>");var s={height:this.jSPlugin.width>We?"48px":"32px","line-height":this.jSPlugin.width>We?"48px":"32px",display:"flex","justify-content":"space-between",top:0,left:0,right:0,"z-index":999,"background-color":"rgba(0,0,0,.8)",color:"#FFFFFF",width:"100%",position:"absolute"};r.style=Ze(s),document.getElementById("".concat(a,"-wrap")).insertBefore(r,document.getElementById(a))}var c=document.getElementById("".concat(a,"-wrap")).classList.contains("ezuikit-player-wrap-mobile-fullscreen");!document.getElementById("".concat(this.jSPlugin.id,"-headControl"))||this.jSPlugin._isCurrentBrowserFullscreen||c||this.jSPlugin.jSPlugin.JS_Resize(this.jSPlugin.width,this.jSPlugin.height-this._extendHeadeTimeLinrHight(!1),!0)}else document.getElementById("".concat(this.jSPlugin.id,"-headControl"))&&document.getElementById("".concat(this.jSPlugin.id,"-headControl")).parentElement.removeChild(document.getElementById("".concat(this.jSPlugin.id,"-headControl"))),!document.getElementById("".concat(this.jSPlugin.id,"-headControl"))||this.jSPlugin._isCurrentBrowserFullscreen||isMobileFullscreen||this.jSPlugin.jSPlugin.JS_Resize(this.jSPlugin.width,this.jSPlugin.height-this._extendHeadeTimeLinrHight(!1),!0);if(this.isNeedRenderFooter)if(document.getElementById("".concat(this.jSPlugin.id,"-ez-iframe-footer-container")))document.getElementById("".concat(this.jSPlugin.id,"-ez-iframe-footer-container"))&&(document.getElementById("".concat(this.jSPlugin.id,"-ez-iframe-footer-container")).style.marginTop="-".concat(this.jSPlugin.width>We?48:32,"px"),document.getElementById("".concat(this.jSPlugin.id,"-ez-iframe-footer-container")).innerHTML='<div id="'.concat(this.jSPlugin.id,'-audioControls" class="footer-controls" style=\'display:flex;justify-content: space-between;height: ').concat(this.jSPlugin.width>We?48:32,"px;width:100%;'><div id='").concat(this.jSPlugin.id,"-audioControls-left' class=\"footer-controls-left\" style='display:flex'></div><div id='").concat(this.jSPlugin.id,"-audioControls-right' class=\"footer-controls-right\" style='display:flex'></div></div>"));else{var l=document.createElement("div");l.setAttribute("id","".concat(this.jSPlugin.id,"-ez-iframe-footer-container")),l.setAttribute("class","ez-iframe-footer-container");var d={"min-height":this.jSPlugin.width>We?"48px":"32px","max-height":this.jSPlugin.width>We?"96px":"80px",position:"relative","margin-top":this.jSPlugin.width>We?"-48px":"-32px",display:"flex","flex-wrap":"wrap","justify-content":"space-between","z-index":999,top:0,color:"#FFFFFF",width:"100%"};l.style=Ze(d),l.innerHTML='<div id="'.concat(this.jSPlugin.id,'-audioControls" class="footer-controls" style=\'display:flex;height:').concat(this.jSPlugin.width>We?48:32,"px;justify-content: space-between;width:100%;z-index:999;position: relative;'><div id='").concat(this.jSPlugin.id,"-audioControls-left' class=\"footer-controls-left\" style='display:flex;'></div><div id='").concat(this.jSPlugin.id,"-audioControls-right' class=\"footer-controls-right\" style='display:flex'></div></div>"),x(l,document.getElementById(a))}else document.getElementById("".concat(this.jSPlugin.id,"-ez-iframe-footer-container"))&&document.getElementById("".concat(this.jSPlugin.id,"-ez-iframe-footer-container")).parentElement.removeChild(document.getElementById("".concat(this.jSPlugin.id,"-ez-iframe-footer-container")));if(this.isNeedRenderHeader&&document.getElementById("".concat(this.jSPlugin.id,"-headControl"))){document.getElementById("".concat(this.jSPlugin.id,"-headControl")).style.background=n.backgroundColor,document.getElementById("".concat(this.jSPlugin.id,"-headControl")).style.color=n.color;var u,m=h(n.btnList);try{for(m.s();!(u=m.n()).done;){var p=u.value;if(p.isrender)try{this.renderHeader(p.iconId,p.part)}catch(e){}}}catch(e){m.e(e)}finally{m.f()}}if(this.isNeedRenderFooter&&document.getElementById("".concat(this.jSPlugin.id,"-audioControls"))){document.getElementById("".concat(this.jSPlugin.id,"-audioControls")).style.background=o.backgroundColor,document.getElementById("".concat(this.jSPlugin.id,"-audioControls")).style.color=o.color;var g,f=h(o.btnList);try{for(f.s();!(g=f.n()).done;){var v=g.value;if(v.isrender)try{this.renderFooter(v.iconId,v.part)}catch(e){}}}catch(e){f.e(e)}finally{f.f()}}if(this.isNeedRenderTimeLine)if(this.isMobile)document.getElementById("".concat(this.jSPlugin.id,"-headControl-right"))&&(document.getElementById("".concat(this.jSPlugin.id,"-headControl-right")).style.display="none"),this.Rec?this.Rec.recInit():this.Rec=new ce(this.jSPlugin,this.changeRecSpeed,this.resetMobileZoomStatus);else{this.Rec?this.Rec.recInit():(this.jSPlugin.decoderState=this.decoderState,this.jSPlugin.setDecoderState=this.setDecoderState,this.Rec=new fe(this.jSPlugin));var y=setInterval((function(){window.EZUIKit[e.jSPlugin.id].state.EZUIKitPlayer.init&&clearInterval(y)}),50)}if(i.findIndex(this.themeData.footer.btnList,(function(e){return"pantile"===e.iconId&&1===e.isrender}))>=0&&!this.jSPlugin.disabledPTZ&&(this.isMobile&&(this.MobilePtz=new ke(this.jSPlugin)),this.Ptz=new V(this.jSPlugin)),this.themeData.poster){this.jSPlugin.poster=this.themeData.poster;var S=setInterval((function(){window.EZUIKit[e.jSPlugin.id].state.EZUIKitPlayer.init&&(clearInterval(S),e.jSPlugin.setPoster(e.themeData.poster))}),50)}this.inited=!0,this.jSPlugin.deviceInfo&&(document.getElementById("".concat(this.jSPlugin.id,"-deviceName-content"))&&(document.getElementById("".concat(this.jSPlugin.id,"-deviceName-content")).style.maxWidth="100%",document.getElementById("".concat(this.jSPlugin.id,"-deviceName-content")).style.overflow="hidden",document.getElementById("".concat(this.jSPlugin.id,"-deviceName-content")).style.textOverflow="ellipsis",document.getElementById("".concat(this.jSPlugin.id,"-deviceName-content")).style.whiteSpace="nowrap",document.getElementById("".concat(this.jSPlugin.id,"-deviceName-content")).innerHTML=this.jSPlugin.deviceInfo.deviceName||""),document.getElementById("".concat(this.jSPlugin.id,"-deviceID-content"))&&(document.getElementById("".concat(this.jSPlugin.id,"-deviceID-content")).style.maxWidth="100%",document.getElementById("".concat(this.jSPlugin.id,"-deviceID-content")).style.overflow="hidden",document.getElementById("".concat(this.jSPlugin.id,"-deviceID-content")).style.textOverflow="ellipsis",document.getElementById("".concat(this.jSPlugin.id,"-deviceID-content")).style.whiteSpace="nowrap",document.getElementById("".concat(this.jSPlugin.id,"-deviceID-content")).innerHTML=A(this.jSPlugin.url).deviceSerial||"")),this.renderThemeData()}},{key:"resetMobileZoomStatus",value:function(){if(this.isMobile){var e=document.getElementById("".concat(this.jSPlugin.id,"-zoom-container"));e&&e.style&&"none"!=e.style.display&&(e.style.display="none"),this.jSPlugin.jSPlugin.Zoom&&this.jSPlugin.jSPlugin.Zoom.resetZoom()}}},{key:"webExpend",value:function(){var e=this.decoderState.state;e.webExpend;var t=e.expend;return!!e.play&&(t?(console.log("正在全局全屏"),!1):void this.jSPlugin.browserFullscreen())}},{key:"expend",value:function(){var e=this.decoderState.state,t=e.webExpend;return!!e.play&&(t?(console.log("正在网站全屏"),!1):void(this.isMobile?(j(document.getElementById("".concat(this.jSPlugin.id,"-wrap"))),document.documentElement.clientWidth,document.documentElement.clientHeight,document.getElementById("".concat(this.jSPlugin.id)).style["backface-visibility"]="hidden"):this.jSPlugin.fullscreen()))}},{key:"_extendHeadeTimeLinrHight",value:function(e){var t=0,n=document.getElementById("".concat(this.jSPlugin.id,"-canvas-container"));return n&&!e&&(t=parseInt(window.getComputedStyle(n).height,10)),t}},{key:"disabledFECBtn",value:function(){var e=["".concat(this.jSPlugin.id,"-capturePicture"),"".concat(this.jSPlugin.id,"-capturePicture-content"),"".concat(this.jSPlugin.id,"-capturePicture-icon"),"".concat(this.jSPlugin.id,"-recordvideo"),"".concat(this.jSPlugin.id,"-recordvideo-content"),"".concat(this.jSPlugin.id,"-recordvideo-icon"),"".concat(this.jSPlugin.id,"-zoom"),"".concat(this.jSPlugin.id,"-zoom-content"),"".concat(this.jSPlugin.id,"-zoom-icon")],t=document.getElementById("".concat(this.jSPlugin.id,"-wrap"));if(this.jSPlugin.use3DZoom?this.jSPlugin.close3DZoom():this.jSPlugin.Zoom.stopZoom(),this.setDecoderState({zoom:!1}),t){var n,i=h(e);try{for(i.s();!(n=i.n()).done;){var o=n.value,a=t.querySelector("#".concat(o));a&&(a.style.display="none")}}catch(e){i.e(e)}finally{i.f()}}}},{key:"resumeFECBtn",value:function(){var e=["".concat(this.jSPlugin.id,"-capturePicture"),"".concat(this.jSPlugin.id,"-capturePicture-content"),"".concat(this.jSPlugin.id,"-capturePicture-icon"),"".concat(this.jSPlugin.id,"-recordvideo"),"".concat(this.jSPlugin.id,"-recordvideo-content"),"".concat(this.jSPlugin.id,"-recordvideo-icon"),"".concat(this.jSPlugin.id,"-zoom"),"".concat(this.jSPlugin.id,"-zoom-content"),"".concat(this.jSPlugin.id,"-zoom-icon")],t=document.getElementById("".concat(this.jSPlugin.id,"-wrap"));if(t){var n,i=h(e);try{for(i.s();!(n=i.n()).done;){var o=n.value,a=t.querySelector("#".concat(o));a&&(a.style.display="")}}catch(e){i.e(e)}finally{i.f()}}}},{key:"destroy",value:function(){var e=document.getElementById("".concat(this.jSPlugin.id,"-headControl"));this.Rec&&this.Rec.destroy&&this.Rec.destroy(),this.Ptz&&this.Ptz.destroy&&this.Ptz.destroy(),e&&(e.innerHTML="");var t=document.getElementById("".concat(this.jSPlugin.id,"-ez-iframe-footer-container"));this._removeElement(t);var i=document.getElementById("".concat(this.jSPlugin.id,"-ez-ptz-item"));this._removeElement(i);var o=document.getElementById("mobile-ez-ptz-container");this._removeElement(o);var a=document.getElementById("date-switch-container-wrap");this._removeElement(a);var r=document.getElementById("rec-type-container-wrap");this._removeElement(r);var s=document.getElementById("mobile-rec-wrap");this._removeElement(s),n.isEnabled&&this._fullscreenchange&&n.off("change",this._fullscreenchange),re.listInstances().length<=1&&(k("".concat(this.jSPlugin.staticPath,"/speed/speed.css")),k("".concat(this.jSPlugin.staticPath,"/css/theme.css")))}},{key:"_removeElement",value:function(e){e&&e.parentNode&&e.parentNode.removeChild(e)}}])}(),Ke=function(){return m((function e(t){l(this,e),this.url=t.url||"",this.method=t.method||"POST",this.headers=t.headers||{},this.body=t.body||{},this.onBeforeUpload=t.onBeforeUpload||function(){},this.onUploadProgress=t.onUploadProgress||function(){},this.onUploadComplete=t.onUploadComplete||function(){},this.controller=new AbortController}),[{key:"upload",value:function(){var e=this;this.onBeforeUpload(this.body);var t={method:this.method,headers:this.headers,signal:this.controller.signal,body:this.body};fetch(this.url,t).then((function(e){return e.json()})).then((function(t){e.onUploadComplete({body:e.body,response:t})})).catch((function(e){"AbortError"===e.name?console.log("上传被取消"):console.error("Error:",e)})),t.body&&"FormData"==t.body.constructor.name&&"signal"in t&&t.signal.addEventListener("progress",(function(t){t.lengthComputable&&e.onUploadProgress(f(f({},e.body),{},{progress:t.loaded/t.total}))}))}},{key:"cancel",value:function(){this.controller.abort()}}])}(),Je=function(){return m((function e(t,n){l(this,e),this.jSPlugin=t,this.isMobile=n,this.timer=null,this.initToastCustom()}),[{key:"initToastCustom",value:function(){document.getElementById("".concat(this.jSPlugin.id,"-wrap-Toast-custom"))?document.getElementById("".concat(this.jSPlugin.id,"-wrap-Toast-custom")).style.display="none":this.randerToast()}},{key:"randerToast",value:function(){var e=this.jSPlugin.width,t=1;t=this.isMobile?e/375||1:e/1024||1;var n=document.getElementById("".concat(this.jSPlugin.id,"-wrap")),i=document.createElement("div");i.style="display:none;position:absolute;top:0;width: 100%;align-items: center;justify-content: center;",i.id="".concat(this.jSPlugin.id,"-wrap-Toast-custom"),this.isMobile?i.innerHTML='<div id="'.concat(this.jSPlugin.id,'-wrap-Toast-custom-content" \n style="padding: ').concat(12*t,"px ").concat(20*t,"px;font-size: ").concat(16*t,"px;line-height:").concat(16*t,"px;border-radius: ").concat(8*t,"px;margin-top: ").concat(667*t*.53,'px;\n background-color: rgba(0,0,0,0.8);color:rgba(255,255,255,0.90);box-sizing: border-box;z-index: 999;">\n </div>\n '):i.innerHTML='<div id="'.concat(this.jSPlugin.id,'-wrap-Toast-custom-content" \n style="padding: ').concat(20*t,"px ").concat(32*t,"px;font-size: ").concat(24*t,"px;line-height:").concat(24*t,"px;border-radius: ").concat(12*t,"px;margin-top: ").concat(36*t,'px;\n background-color: rgba(0,0,0,0.7);color:rgba(255,255,255,0.90);box-sizing: border-box;z-index: 999;">\n </div>\n '),n.insertBefore(i,document.getElementById(this.jSPlugin.id))}},{key:"initToastContent",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2e3;console.log("content----------------",e),this.timer=null,document.getElementById("".concat(this.jSPlugin.id,"-wrap-Toast-custom"))?(document.getElementById("".concat(this.jSPlugin.id,"-wrap-Toast-custom")).style.display="flex",document.getElementById("".concat(this.jSPlugin.id,"-wrap-Toast-custom-content")).innerText=e||"",this.timer=setTimeout((function(){document.getElementById("".concat(t.jSPlugin.id,"-wrap"))&&document.getElementById("".concat(t.jSPlugin.id,"-wrap-Toast-custom"))&&document.getElementById("".concat(t.jSPlugin.id,"-wrap")).removeChild(document.getElementById("".concat(t.jSPlugin.id,"-wrap-Toast-custom")))}),n)):(this.randerToast(),this.initToastContent(e))}}])}(),Ye=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"GET",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=arguments.length>3?arguments[3]:void 0,o=arguments.length>4?arguments[4]:void 0,a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{},r={"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},s="";r=Object.assign(r,a);var c=new Headers;Object.keys(r).map((function(e){c.append(e,r[e])})),r=c,Object.keys(Object.assign({},n)).forEach((function(e){var t=n[e];"string"==typeof n[e]&&(t=n[e].replace("%","%25")),void 0!==n[e]&&(s+="&".concat(e,"=").concat(encodeURIComponent(t)))})),s.length>0&&(s=-1!==["GET","PUT","DELETE"].indexOf(t.toUpperCase())?"?".concat(s.slice(1)):s.slice(1));var l=e+(-1!==["GET","PUT","DELETE"].indexOf(t.toUpperCase())?s:""),d={headers:r,method:t};"POST"===t&&(d.body=s),"POST"===t&&a&&"application/json"===a["Content-Type"]&&(d.body=JSON.stringify(n)),"GET"===t&&(-1===l.indexOf("?")?l+="?_r=".concat(Math.random()):l+="&_r=".concat(Math.random())),fetch(l,d).then((function(e){var t=e.headers.get("content-type");return t&&-1!==t.indexOf("application/json")?e.json():e.text()})).then((function(e){i&&i(e)})).catch((function(e){o&&o(e)}))},Xe=function(e,t,n){var i=new FormData;i.append("deviceSerial",A(e.url).deviceSerial),i.append("cmd","open"),fetch("".concat(domain,"/api/v3/device/acs/remote/door?accessToken=").concat(e.accessToken||e.token.deviceToken.globalAll),{method:"POST",body:i}).then((function(e){return e.json()})).then((function(e){console.log("get theme data",e),t(e)})).catch((function(e){n(e)}))},Qe=function(e,t,n){var i={accessToken:e.accessToken||e.token.httpToken.url,pageStart:0,pageSize:4,default:!0,voiceName:"轻应用语音文件"},o="".concat(e.env.domain,"/api/lapp/voice/query");Ye(o,"POST",i,(function(e){console.log(e),t(e)}),(function(e){console.log(e),n(e)}),{"Content-Type":"application/x-www-form-urlencoded"})},$e=function(e,t,n,i){var o="".concat(e.env.domain,"/api/lapp/voice/send"),a=new FormData;a.append("deviceSerial",A(e.url).deviceSerial),a.append("accessToken",e.accessToken||e.token.deviceToken.video),a.append("channelNo",A(e.url).channelNo||1),a.append("fileUrl",t),fetch(o,{method:"POST",body:a}).then((function(e){return e.json()})).then((function(e){!function(e){console.log(e),n(e)}(e)})).catch((function(e){var t;t=e,console.log(t),i(t)}))},et=function(){return m((function e(t,n){l(this,e),this.jSPlugin=t,this.videoWidth=t.width,this.switchFooter=n,this.sendLoadingStats=!1,this.toastCustom=new Je(t,!1),this.quickReplyList=["你好,请将快递放在门口","你好,稍等","你好,请将快递放入小区快递柜","你好,请将外卖放在门口"],this.initQuickReply()}),[{key:"initQuickReply",value:function(){document.getElementById("pc-quickReply-back")||this.renderQuickReply(),document.getElementById("pc-quickReply-back-item-0")||this.getQuickReplyList()}},{key:"renderQuickReply",value:function(){var e=this,t=this.videoWidth/1024||1,n=document.createElement("div");n.style="width:100%;",n.innerHTML='<div style="width:100%;display:flex;flex-direction:row;align-items: center;">\n <div id="pc-quickReply-back" style="display: flex;align-items: center;margin: 0 '.concat(8*t,"px 0 ").concat(16*t,'px;cursor: pointer;">\n <div style="height: ').concat(32*t,'px;">\n <svg width="').concat(32*t,'px" height="').concat(32*t,'px" viewBox="0 0 32 32" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n <title>返回</title>\n <defs>\n <filter id="filter-1">\n <feColorMatrix in="SourceGraphic" type="matrix" values="0 0 0 0 1.000000 0 0 0 0 1.000000 0 0 0 0 1.000000 0 0 0 1.000000 0"></feColorMatrix>\n </filter>\n </defs>\n <g id="控件" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n <g id="快速回复loading" transform="translate(-16.000000, -497.000000)">\n <g id="返回" transform="translate(0.000000, 425.000000)" filter="url(#filter-1)">\n <g transform="translate(16.000000, 72.000000)">\n <rect id="Rectangle" x="0" y="0" width="32" height="32"></rect>\n <path d="M12.5,7.5 C13.2988404,7.5 13.9518304,8.12445998 13.9974537,8.91186361 L14,9 L14,21.5 L26.5,21.5 C27.2988404,21.5 27.9518304,22.12446 27.9974537,22.9118636 L28,23 C28,23.7988404 27.37554,24.4518304 26.5881364,24.4974537 L26.5,24.5 L12.5,24.5 C11.7011596,24.5 11.0481696,23.87554 11.0025463,23.0881364 L11,23 L11,9 C11,8.17157288 11.6715729,7.5 12.5,7.5 Z" id="Path" fill="#FFFFFF" fill-rule="nonzero" transform="translate(19.500000, 16.000000) rotate(45.000000) translate(-19.500000, -16.000000) "></path>\n </g>\n </g>\n </g>\n </g>\n </svg>\n </div>\n <span style="font-size: ').concat(24*t,'px;">返回</span>\n </div>\n <div id="pc-quickReply-content" style="display: block;width:calc(100% - ').concat(160*t,"px);margin: 0 ").concat(24*t,'px;"></div>\n <div id="pc-quickReply-loading" style="display: none;width:calc(100% - ').concat(160*t,"px);margin: 0 ").concat(24*t,'px;"></div>\n <div id="pc-quickReply-loaderror" style="display: none;width:calc(100% - ').concat(160*t,"px);margin: 0 ").concat(24*t,'px;"></div>\n </div>'),document.getElementById("".concat(this.jSPlugin.id,"-audioControls-quickReply")).appendChild(n),document.getElementById("pc-quickReply-back").onclick=function(){e.switchFooter("onBell")}}},{key:"matchQuickReplyBtn",value:function(){var e=this,t=this.videoWidth/1024||1,n=document.getElementById("pc-quickReply-content");this.quickReplyList&&this.quickReplyList.length>0&&this.quickReplyList.forEach((function(i,o){var a=document.createElement("div");a.id="pc-quickReply-back-item-".concat(o),a.style="margin: ".concat(8*t,"px 0 ").concat(8*t,"px ").concat(8*t,"px;cursor: pointer;\n padding: 0 ").concat(20*t,"px;min-height: ").concat(64*t,"px;width:calc(50% - ").concat(16*t,"px);\n display: inline-block;background: rgba(0,0,0,0.70);border-radius: 8px;text-align: center;\n box-sizing: border-box;font-size:").concat(24*t,"px;color: rgba(255,255,255,0.90);"),a.innerHTML='<div id="pc-quickReply-back-item-box-'.concat(o,'">\n <span id="pc-quickReply-name-').concat(o,'" style="line-height: ').concat(64*t,'px;">').concat(i.voiceName,"</span>\n </div>"),a.onclick=function(){e.sendLoadingStats||(console.log("item:"+i),e.sendQuickReply(i,o))},n.appendChild(a)}))}},{key:"setBtnCheckLoading",value:function(e,t){var n=this.videoWidth/1024||1;if(t>-1){document.getElementById("pc-quickReply-back-item-".concat(t));var i=document.getElementById("pc-quickReply-back-item-box-".concat(t)),o=document.getElementById("pc-quickReply-name-".concat(t));if(1==e){var a=document.getElementById("pc-quickReply-icon-loading-".concat(t));a&&o&&i.removeChild(a)}else if(o){var r=document.createElement("span");r.id="pc-quickReply-icon-loading-".concat(t),r.style="vertical-align: middle;margin-right:".concat(16*n,"px;"),r.innerHTML='<svg width="'.concat(30*n,'" height="').concat(30*n,'" t="1567069979438" class="loading" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2399"><path d="M538.5344 266.4448a133.12 133.12 0 1 1 133.12-133.12 133.4272 133.4272 0 0 1-133.12 133.12zM255.0144 372.1984a121.6768 121.6768 0 1 1 121.6768-121.6768 121.856 121.856 0 0 1-121.6768 121.6768zM134.72 647.424a107.3664 107.3664 0 1 1 107.3664-107.264A107.52 107.52 0 0 1 134.72 647.424z m120.32 272.4608a90.9824 90.9824 0 1 1 90.9824-90.9824A91.1616 91.1616 0 0 1 255.04 919.8848zM538.5344 1024a79.36 79.36 0 1 1 79.36-79.36 79.36 79.36 0 0 1-79.36 79.36z m287.6928-134.144a64.1792 64.1792 0 1 1 64.1792-64.1792 64.3584 64.3584 0 0 1-64.1792 64.1792z m117.76-296.704a52.6336 52.6336 0 1 1 52.6592-52.6336 52.608 52.608 0 0 1-52.6336 52.6336z m-158.72-338.7136a40.96 40.96 0 1 1 12.0064 28.8512 40.5248 40.5248 0 0 1-12.0064-28.8512z" fill="#ffffff" p-id="2400"></path></svg>'),i.insertBefore(r,o)}}}},{key:"getQuickReplyList",value:function(){var e=this;console.log("getQuickReplyList"),this.madeLoadingDom(0);Qe(this.jSPlugin,(function(t){if(t&&200==t.code){var n=t.data||[],i=[];t.data.forEach((function(e,t){i=e.voiceName.split("_"),n[t].voiceName=i[1]})),e.quickReplyList=n,setTimeout((function(){e.madeLoadingDom(2)}),500)}else e.madeLoadingDom(1)}),(function(t){console.log(t),e.madeLoadingDom(1)}))}},{key:"madeLoadingDom",value:function(e){var t=this,n=this.videoWidth/1024||1;if(0==e){if(document.getElementById("pc-quickReply-content").style.display="none",document.getElementById("pc-quickReply-loaderror").style.display="none",document.getElementById("pc-quickReply-loading").style.display="block",!document.getElementById("pc-quickReply-loading-box")){var i=document.createElement("div");i.id="pc-quickReply-loading-box",i.style="width: 100%;display: flex;align-items: center;justify-content: center;flex-direction: column;",i.innerHTML='<div class="" style="heigth:'.concat(40*n,'px">\n <svg width="').concat(40*n,'" height="').concat(40*n,'" t="1567069979438" class="loading" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2399"><path d="M538.5344 266.4448a133.12 133.12 0 1 1 133.12-133.12 133.4272 133.4272 0 0 1-133.12 133.12zM255.0144 372.1984a121.6768 121.6768 0 1 1 121.6768-121.6768 121.856 121.856 0 0 1-121.6768 121.6768zM134.72 647.424a107.3664 107.3664 0 1 1 107.3664-107.264A107.52 107.52 0 0 1 134.72 647.424z m120.32 272.4608a90.9824 90.9824 0 1 1 90.9824-90.9824A91.1616 91.1616 0 0 1 255.04 919.8848zM538.5344 1024a79.36 79.36 0 1 1 79.36-79.36 79.36 79.36 0 0 1-79.36 79.36z m287.6928-134.144a64.1792 64.1792 0 1 1 64.1792-64.1792 64.3584 64.3584 0 0 1-64.1792 64.1792z m117.76-296.704a52.6336 52.6336 0 1 1 52.6592-52.6336 52.608 52.608 0 0 1-52.6336 52.6336z m-158.72-338.7136a40.96 40.96 0 1 1 12.0064 28.8512 40.5248 40.5248 0 0 1-12.0064-28.8512z" fill="#ffffff" p-id="2400"></path></svg>\n </div>\n <div style="font-size: ').concat(28*n,"px;margin-top:").concat(10*n,"px;line-height:").concat(36*n,'px;">加载中…</div>'),document.getElementById("pc-quickReply-loading").appendChild(i)}}else if(1==e){if(document.getElementById("pc-quickReply-content").style.display="none",document.getElementById("pc-quickReply-loading").style.display="none",document.getElementById("pc-quickReply-loaderror").style.display="block",!document.getElementById("pc-quickReply-loaderror-box")){var o=document.createElement("div");o.id="pc-quickReply-loaderror-box",o.style="width: 100%;display: flex;align-items: center;justify-content: center;flex-direction: column;",o.innerHTML='<div style="font-size: '.concat(28*n,'px;color: rgba(255,255,255,0.90);">快速回复加载失败</div>\n <div id="pc-quickReply-loaderror-reload" style="font-size: ').concat(24*n,"px;margin-top:").concat(16*n,'px;color: rgba(100,143,252,0.90);cursor: pointer;">重新加载</div>'),document.getElementById("pc-quickReply-loaderror").appendChild(o),document.getElementById("pc-quickReply-loaderror-reload").onclick=function(){t.getQuickReplyList()}}}else document.getElementById("pc-quickReply-loading").style.display="none",document.getElementById("pc-quickReply-loaderror").style.display="none",document.getElementById("pc-quickReply-content").style.display="block",this.matchQuickReplyBtn()}},{key:"sendQuickReply",value:function(e,t){var n=this;this.sendLoadingStats=!0,this.setBtnCheckLoading(0,t);$e(this.jSPlugin,e.fileUrl,(function(e){n.sendLoadingStats=!1,n.setBtnCheckLoading(1,t),e&&200==e.code?n.toastCustom.initToastContent("快捷回复成功"):n.toastCustom.initToastContent("快捷回复失败,请重试"),n.switchFooter("onBell")}),(function(e){console.log(e),n.sendLoadingStats=!1,n.setBtnCheckLoading(1,t),n.toastCustom.initToastContent("快捷回复失败,请重试"),n.switchFooter("onBell")}))}}])}(),tt=function(){return m((function e(t,n){l(this,e),this.jSPlugin=t,this.videoWidth=t.width,this.switchFooter=n,this.toastCustom=new Je(t,!1),this.lockStatus=!1,this.initRemoteUnlock()}),[{key:"initRemoteUnlock",value:function(){document.getElementById("pc-remoteUnlock-back")?this.madeSlideEvent():this.renderRemoteUnlock()}},{key:"renderRemoteUnlock",value:function(){var e=this,t=this.videoWidth/1024||1,n=document.createElement("div");n.style="width:100%;",n.id="pc-remoteUnlock-box",n.innerHTML='<div style="width:100%;display:flex;flex-direction:row;align-items: center;">\n <div id="pc-remoteUnlock-back" style="display: flex;align-items: center;margin: 0 '.concat(8*t,"px 0 ").concat(16*t,'px;cursor: pointer;">\n <div style="height: ').concat(32*t,'px;">\n <svg width="').concat(32*t,'px" height="').concat(32*t,'px" viewBox="0 0 32 32" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n <title>返回</title>\n <defs>\n <filter id="filter-1">\n <feColorMatrix in="SourceGraphic" type="matrix" values="0 0 0 0 1.000000 0 0 0 0 1.000000 0 0 0 0 1.000000 0 0 0 1.000000 0"></feColorMatrix>\n </filter>\n </defs>\n <g id="控件" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n <g id="快速回复loading" transform="translate(-16.000000, -497.000000)">\n <g id="返回" transform="translate(0.000000, 425.000000)" filter="url(#filter-1)">\n <g transform="translate(16.000000, 72.000000)">\n <rect id="Rectangle" x="0" y="0" width="32" height="32"></rect>\n <path d="M12.5,7.5 C13.2988404,7.5 13.9518304,8.12445998 13.9974537,8.91186361 L14,9 L14,21.5 L26.5,21.5 C27.2988404,21.5 27.9518304,22.12446 27.9974537,22.9118636 L28,23 C28,23.7988404 27.37554,24.4518304 26.5881364,24.4974537 L26.5,24.5 L12.5,24.5 C11.7011596,24.5 11.0481696,23.87554 11.0025463,23.0881364 L11,23 L11,9 C11,8.17157288 11.6715729,7.5 12.5,7.5 Z" id="Path" fill="#FFFFFF" fill-rule="nonzero" transform="translate(19.500000, 16.000000) rotate(45.000000) translate(-19.500000, -16.000000) "></path>\n </g>\n </g>\n </g>\n </g>\n </svg>\n </div>\n <span style="font-size: ').concat(24*t,'px;user-select: none;">返回</span>\n </div>\n <div id="pc-remoteUnlock-content" style="display: block;width:calc(100% - ').concat(160*t,"px);margin: 0 ").concat(24*t,'px;"></div>\n </div>'),document.getElementById("".concat(this.jSPlugin.id,"-audioControls-remoteUnlock")).appendChild(n),document.getElementById("pc-remoteUnlock-back").onclick=function(){e.goback()},this.renderRemoteUnlockSlide()}},{key:"renderRemoteUnlockSlide",value:function(){var e=this.videoWidth/1024||1,t=document.getElementById("pc-remoteUnlock-content"),n=document.createElement("div");n.id="pc-remoteUnlock-content-slide",n.style="width: 100%;display: flex;justify-content: center;cursor: pointer;",n.innerHTML='<div id="pc-remoteUnlock-slide-box" style="width: '.concat(400*e,"px;line-height: ").concat(80*e,"px;height: ").concat(80*e,"px;border: 1px solid rgba(255,255,255,1);border-radius: ").concat(40*e,'px;position: relative;text-align: center;">\n <div id="pc-remoteUnlock-slide-bgColor" style="border-radius: ').concat(40*e,"px;width: ").concat(64*e,"px;height: ").concat(80*e,'px;position: absolute;left: 0;top: 0;"></div>\n <div id="pc-remoteUnlock-slide-tips" style="height: ').concat(80*e,"px;line-height: ").concat(80*e,"px;font-size: ").concat(24*e,"px;border-radius: ").concat(40*e,'px;position: absolute;text-align: center;user-select: none;color: rgba(255,255,255,0.90);width: 100%;">右滑开锁</div>\n <div id="pc-remoteUnlock-slide-ball" style="top: ').concat(8*e,"px;left: ").concat(8*e,"px;width: ").concat(64*e,"px;height: ").concat(64*e,'px;background: #598FFF;position: absolute;text-align: center;border-radius:50%;display: flex;align-items: center;justify-content: center;">\n <svg id="slide-ball-start" style="display: inline;" width="').concat(36*e,'px" height="').concat(36*e,'px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n <title></title>\n <g id="icon/箭头向右" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n <rect id="矩形" fill="#000000" fill-rule="nonzero" opacity="0" x="0" y="0" width="24" height="24"></rect>\n <path d="M14.2841136,6.3689007 L19.9432338,12.0287579 L14.2863796,17.6856122 L12.8580239,16.2572565 L16.114,12.9999007 L4.00000001,13 L4.00000001,11 L16.058,10.9999007 L12.8557579,7.79725638 L14.2841136,6.3689007 Z" id="形状结合" fill="#FFFFFF" fill-rule="nonzero"></path>\n </g>\n </svg>\n <svg id="slide-ball-end" style="display: none;" width="').concat(36*e,'" height="').concat(36*e,'" t="1567069979438" class="loading" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2399"><path d="M538.5344 266.4448a133.12 133.12 0 1 1 133.12-133.12 133.4272 133.4272 0 0 1-133.12 133.12zM255.0144 372.1984a121.6768 121.6768 0 1 1 121.6768-121.6768 121.856 121.856 0 0 1-121.6768 121.6768zM134.72 647.424a107.3664 107.3664 0 1 1 107.3664-107.264A107.52 107.52 0 0 1 134.72 647.424z m120.32 272.4608a90.9824 90.9824 0 1 1 90.9824-90.9824A91.1616 91.1616 0 0 1 255.04 919.8848zM538.5344 1024a79.36 79.36 0 1 1 79.36-79.36 79.36 79.36 0 0 1-79.36 79.36z m287.6928-134.144a64.1792 64.1792 0 1 1 64.1792-64.1792 64.3584 64.3584 0 0 1-64.1792 64.1792z m117.76-296.704a52.6336 52.6336 0 1 1 52.6592-52.6336 52.608 52.608 0 0 1-52.6336 52.6336z m-158.72-338.7136a40.96 40.96 0 1 1 12.0064 28.8512 40.5248 40.5248 0 0 1-12.0064-28.8512z" fill="#598FFF" p-id="2400"></path></svg>\n \n </div>\n </div>'),t.appendChild(n),this.madeSlideEvent()}},{key:"getOffsetLeft",value:function(e){var t=0;do{t+=e.offsetLeft,e=e.parentNode}while(e.parentNode);return t}},{key:"madeSlideEvent",value:function(){var e=this.videoWidth/1024||1,t=document.getElementById("".concat(this.jSPlugin.id)),n=this.getOffsetLeft(t),i=document.getElementById("pc-remoteUnlock-slide-box"),o=document.getElementById("pc-remoteUnlock-slide-bgColor"),a=document.getElementById("pc-remoteUnlock-slide-tips"),r=document.getElementById("pc-remoteUnlock-slide-ball"),s=this;r.onmousedown=function(t){var c=(t=t||window.event).offsetX;r.style.transition="",o.style.transition="",document.onmouseup=function(){console.log("--------------onmouseup"),s.lockStatus||(o.style.width="0px",r.style.left=8*e+"px",r.style.transition="left 0.6s linear",o.style.transition="width 0.6s linear"),document.onmouseup=null,document.onmousemove=null},document.onmousemove=function(t){t=t||window.event;console.log("videoDom",n);var l=t.pageX-i.offsetLeft-c-n,d=i.clientWidth-r.clientWidth-8*e;l<=0&&(l=0),l>=d&&(l=d),r.style.left=l+"px",l!=d||s.lockStatus||s.lockStatus||(s.lockStatus=!0,document.getElementById("slide-ball-start").style.display="none",document.getElementById("slide-ball-end").style.display="inline",o.style.width=i.clientWidth+"px",o.style.backgroundColor="#598FFF",i.style.border="0",r.style.backgroundColor="#ffffff",a.textContent="正在开锁",r.onmousedown=null,document.onmousemove=null,s.sendRemoteUnlockApi())}}}},{key:"resetRemoteUnlockSlide",value:function(){var e=document.getElementById("pc-remoteUnlock-box"),t=document.getElementById("".concat(this.jSPlugin.id,"-audioControls-remoteUnlock"));e&&t&&t.removeChild(e)}},{key:"sendRemoteUnlockApi",value:function(){var e=this;console.log("下发远程开锁");Xe(this.jSPlugin,(function(t){t&&200==t.code?e.toastCustom.initToastContent("开锁成功"):e.toastCustom.initToastContent("开锁失败,请重试"),e.goback()}),(function(t){console.log(t),e.toastCustom.initToastContent("开锁失败,请重试"),e.goback()}))}},{key:"goback",value:function(){this.switchFooter("onCall"),this.resetRemoteUnlockSlide()}}])}(),nt={customConfig:{defaultMicro:0,defaultPlay:0,maxTalkTime:0,bellPoster:0,maxBellTime:0},header:{onBell:{color:"#2c2c2c",backgroundColor:"#00000000 linear-gradient(180deg, rgba(0,0,0,0.65) 0%, rgba(0,0,0,0.00) 100%)",activeColor:"#1890FF",autoFocus:0,btnList:[{btnKey:"c1cbc1d4e86d49a0981f54beea95280a-4412dc7a9f7b471a9a3e9a8fb625c793-header-0",iconId:"ringStatus",part:"left",defaultActive:0,isrender:1,color:"#ffffff",themeId:"4412dc7a9f7b471a9a3e9a8fb625c793"},{btnKey:"c1cbc1d4e86d49a0981f54beea95280a-4412dc7a9f7b471a9a3e9a8fb625c793-header-1",iconId:"deviceCategory",part:"left",defaultActive:0,isrender:1,color:"#ffffff",themeId:"4412dc7a9f7b471a9a3e9a8fb625c793"}]},onCall:{color:"#2c2c2c",backgroundColor:"#00000000",activeColor:"#1890FF",autoFocus:5,btnList:[{btnKey:"c1cbc1d4e86d49a0981f54beea95280a-4412dc7a9f7b471a9a3e9a8fb625c793-header-0",iconId:"callStatus",part:"left",defaultActive:0,isrender:1,color:"#ffffff",themeId:"4412dc7a9f7b471a9a3e9a8fb625c793"},{btnKey:"c1cbc1d4e86d49a0981f54beea95280a-4412dc7a9f7b471a9a3e9a8fb625c793-header-1",iconId:"deviceCategory",part:"left",defaultActive:0,isrender:1,color:"#ffffff",themeId:"4412dc7a9f7b471a9a3e9a8fb625c793"}]}},footer:{onBell:{color:"#ffffff",backgroundColor:"#00000000",activeColor:"#1890FF",autoFocus:5,btnList:[{btnKey:"c1cbc1d4e86d49a0981f54beea95280a-4412dc7a9f7b471a9a3e9a8fb625c793-footer-0",iconId:"quickReply",part:"left",defaultActive:1,isrender:1,themeId:"4412dc7a9f7b471a9a3e9a8fb625c793",backgroundColor:"#cccccc"},{btnKey:"c1cbc1d4e86d49a0981f54beea95280a-4412dc7a9f7b471a9a3e9a8fb625c793-footer-1",iconId:"rejection",part:"left",defaultActive:0,isrender:1,color:"#2C2C2C",themeId:"4412dc7a9f7b471a9a3e9a8fb625c793",backgroundColor:"#cccccc"},{btnKey:"c1cbc1d4e86d49a0981f54beea95280a-4412dc7a9f7b471a9a3e9a8fb625c793-footer-2",iconId:"answer",part:"left",defaultActive:0,isrender:1,themeId:"4412dc7a9f7b471a9a3e9a8fb625c793",backgroundColor:"#cccccc"},{btnKey:"c1cbc1d4e86d49a0981f54beea95280a-4412dc7a9f7b471a9a3e9a8fb625c793-footer-3",iconId:"remoteUnlock",part:"left",defaultActive:0,isrender:1,themeId:"4412dc7a9f7b471a9a3e9a8fb625c793",backgroundColor:"#cccccc"}]},onCall:{color:"#2c2c2c",backgroundColor:"rgba(0,0,0,0.8)",activeColor:"#1890FF",autoFocus:5,btnList:[{btnKey:"c1cbc1d4e86d49a0981f54beea95280a-4412dc7a9f7b471a9a3e9a8fb625c793-footer-0",iconId:"mute",part:"left",defaultActive:1,isrender:1,themeId:"4412dc7a9f7b471a9a3e9a8fb625c793",backgroundColor:"#cccccc"},{btnKey:"c1cbc1d4e86d49a0981f54beea95280a-4412dc7a9f7b471a9a3e9a8fb625c793-footer-1",iconId:"hangUp",part:"left",defaultActive:0,isrender:1,themeId:"4412dc7a9f7b471a9a3e9a8fb625c793",backgroundColor:"#cccccc"},{btnKey:"c1cbc1d4e86d49a0981f54beea95280a-4412dc7a9f7b471a9a3e9a8fb625c793-footer-2",iconId:"remoteUnlock",part:"left",defaultActive:0,isrender:1,themeId:"4412dc7a9f7b471a9a3e9a8fb625c793",backgroundColor:"#cccccc"}]}}};function it(e){var t=new ee,n=new FormData;for(var i in e)n.append(i,e[i]);return t.fetch("/api/lapp/device/info",{method:"POST",body:n})}var ot=function(e){var t="";return Object.keys(e).map((function(n,i){t+="".concat(n,":").concat(e[n]).concat(i<Object.keys(e).length-1?";":"")})),t},at=function(){return m((function e(t,n,i,o){var a=this;l(this,e),p(this,"autoPlayRing",(function(){console.log("autoPlayRing");var e=document.getElementById("bellring-audio");e&&(e.muted=!1,e.src="https://resource.eziot.com/group2/M00/00/8F/CtwQFmPbWnOAGuT5AAHZihhCJEM230.mp3",e.paused&&e.play()),window.removeEventListener("click",a.autoPlayRing)})),p(this,"muteCommon",(function(e){var t=a.decoderState.state,n=t.talk,i=t.sound;n?(console.log("结束对讲"),a.setDecoderState({talk:!1,mute:!0},e.backgroundColor),a.jSPlugin.Talk.stopTalk(),i||a.jSPlugin.openSound()):(a.setDecoderState({talk:!1,mute:!0},e.backgroundColor),i||a.jSPlugin.openSound())})),p(this,"switchCallStatus",(function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=a.themeData,i=n.header,o=n.footer,r=null;if("onCall"==e){console.log("接听"),a.bellStatus="onCall",a.switchFooter("onCall"),o[a.bellStatus].btnList.map((function(e,t){e.isrender&&a.renderFooter(e.iconId,e),"mute"==e.iconId&&(r=e)})),i[a.bellStatus].btnList.map((function(e,t){e.isrender&&a.renderHeader(e.iconId,e)}));var s=document.getElementById("".concat(a.jSPlugin.id,"-header-onBell"));s&&s.parentElement.removeChild(s),1==a.themeData.customConfig.bellPoster&&document.getElementById("bellring-icon")&&document.getElementById("".concat(a.jSPlugin.id,"-wrap")).removeChild(document.getElementById("bellring-icon")),0==a.themeData.customConfig.defaultMicro&&r?a.muteCommon(r):a.setDecoderState({mute:!1},r.backgroundColor),a.removeBellRing()}else console.log("响铃"),a.bellStatus="onBell",a.jSPlugin.Theme.changeTheme(a.themeData,t)})),this.jSPlugin=t,this.videoWidth=t.width,this.videoHeight=t.height,this.themeData=n,this.setDecoderState=i,this.decoderState=o,this.isNeedRenderHeader=!1,this.isNeedRenderFooter=!1,this.autoFocus=0,this.autoFocusTimer=null,this.bellStatus="onBell",this.recordTimer=null,this.nextRate=1,this.themeInited=!1,this.inited=!1,this.activeThemeStatus=!0,this.activeThemeStatusTxt="模板未激活",this.toastCustom=new Je(t,!1)}),[{key:"initBellRing",value:function(){var e=this,t=this.decoderState.state,n=t.play,i=t.isEditing;t.rejection;var o=this.videoWidth/1024;this.maxBellTime=1e3*this.themeData.customConfig.maxBellTime;var a=document.getElementById("bellring"),r=document.getElementById("bellring-audio");if(!a&&!r){if(this.jSPlugin.isNeedBellRing){var s=document.createElement("div");s.id="bellring",s.innerHTML='<div>\n <audio id="bellring-audio" loop autoplay>\n <source src="https://resource.eziot.com/group2/M00/00/8F/CtwQFmPbWnOAGuT5AAHZihhCJEM230.mp3" type="audio/mpeg">\n </audio>\n </div>',document.getElementById("".concat(this.jSPlugin.id,"-wrap")).appendChild(s)}if(1!=this.themeData.customConfig.bellPoster||i)document.getElementById("bellring-icon")&&document.getElementById("".concat(this.jSPlugin.id,"-wrap")).removeChild(document.getElementById("bellring-icon"));else{var c=(this.videoHeight-180*o)/2,l=document.createElement("div");l.id="bellring-icon",l.style="position: absolute;pointer-events: none;background: none;width: 100%;\n position: absolute;top: ".concat(c,"px;display: flex;align-items: center;justify-content: center;"),l.innerHTML='<div style="width: '.concat(180*o,"px;height: ").concat(180*o,'px;display: flex;align-items: center;justify-content: center;border: 1px solid rgba(255,255,255,0.2);border-radius: 50%;">\n <div style="width: ').concat(100*o,"px;height: ").concat(100*o,'px;display: flex;align-items: center;justify-content: center;border: 1px solid rgba(255,255,255,0.3);border-radius: 50%;">\n <svg width="').concat(40*o,'px" height="').concat(40*o,'px" viewBox="0 0 40 40" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n <title>icon/响铃</title>\n <g id="icon/响铃" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n <polygon id="Path" points="0 0 40.0000002 0 40.0000002 40.0000002 0 40.0000002"></polygon>\n <path d="M20.0000001,4.25000002 C22.0363461,4.25000002 23.698175,5.84879552 23.8000507,7.8591997 L23.8050001,8.05500003 L23.805316,8.99953253 C27.1874196,9.97041766 29.6921839,13.0354462 29.80936,16.723731 L29.80936,16.723731 L29.8133335,16.9800001 L29.8133335,21.6416668 C29.8133335,22.3259481 30.0858837,22.9835569 30.5703302,23.4680033 L30.5703302,23.4680033 L31.6386635,24.5363367 C32.338953,25.2366262 32.760721,26.1675592 32.8273086,27.1785295 L32.8273086,27.1785295 L32.8350001,27.4233334 C32.8350001,29.577547 31.0892137,31.3233335 28.9350001,31.3233335 L28.9350001,31.3233335 L24.5666667,31.323 L24.5650266,31.3951531 C24.4527075,33.8194458 22.4520933,35.7500001 20.0000001,35.7500001 C17.5482065,35.7500001 15.5473098,33.8197367 15.4349743,31.3967059 L15.4326667,31.323 L11.0666667,31.3233335 C9.06159524,31.3233335 7.39851917,29.8069287 7.18810198,27.8229374 L7.17194359,27.6230185 L7.1666667,27.4233334 C7.1666667,26.3411154 7.59733134,25.3020086 8.36300328,24.5363367 L8.36300328,24.5363367 L9.43133662,23.4680033 C9.91578309,22.9835569 10.1883334,22.3259481 10.1883334,21.6416668 L10.1883334,21.6416668 L10.1883334,16.9800001 C10.1883334,13.1909619 12.7263704,9.99530436 16.1948593,8.99965364 L16.1950001,8.05500003 C16.1950001,5.95360729 17.8979654,4.25000002 20.0000001,4.25000002 Z M23.0656667,31.323 L16.9336667,31.323 L16.9352114,31.3619281 C17.0285826,32.9723844 18.3649772,34.2500001 20.0000001,34.2500001 C21.6352227,34.2500001 22.9714318,32.9721919 23.0647896,31.3604131 L23.0656667,31.323 Z M21.5116668,10.1783334 L18.4900001,10.1783334 C14.7336124,10.1783334 11.6883334,13.2231481 11.6883334,16.9800001 L11.6883334,16.9800001 L11.6883334,21.6416668 C11.6883334,22.7238848 11.2576687,23.7629916 10.4919968,24.5286635 L10.4919968,24.5286635 L9.42366346,25.5969969 C8.93921698,26.0814433 8.6666667,26.7390521 8.66637526,27.402427 L8.66637526,27.402427 L8.67048222,27.560237 C8.74130967,28.8268108 9.79171396,29.8233335 11.0666667,29.8233335 L11.0666667,29.8233335 L23.7906939,29.8222289 C23.8004164,29.8218553 23.8101862,29.8216668 23.8200001,29.8216668 L23.8486667,29.823 L28.9350001,29.8233335 C30.2055455,29.8233335 31.2450456,28.8367727 31.329826,27.609522 L31.3354106,27.4481422 L31.3293607,27.2529336 C31.2880301,26.6292837 31.0210852,26.0400787 30.5780034,25.5969969 L30.5780034,25.5969969 L29.50967,24.5286635 C28.7439981,23.7629916 28.3133335,22.7238848 28.3133335,21.6416668 L28.3133335,21.6416668 L28.3134279,16.9919039 L28.3098332,16.759466 C28.1934023,13.0970787 25.1864454,10.1783334 21.5116668,10.1783334 L21.5116668,10.1783334 Z M20.0000001,5.75000002 C18.7795808,5.75000002 17.7813801,6.69770708 17.7003155,7.89717688 L17.6950001,8.05500003 L17.6952875,8.7158769 C17.9568453,8.69103758 18.2219393,8.67833337 18.4900001,8.67833337 L18.4900001,8.67833337 L21.5116668,8.67833337 C21.7792577,8.67833337 22.0439466,8.69101238 22.3051575,8.71580951 L22.3050001,8.05500003 C22.3050001,6.7819079 21.273481,5.75000002 20.0000001,5.75000002 Z" id="形状结合" fill="#FFFFFF" fill-rule="nonzero"></path>\n </g>\n </svg>\n </div>\n </div>'),document.getElementById("".concat(this.jSPlugin.id,"-wrap")).appendChild(l),n&&"onBell"==this.bellStatus&&this.jSPlugin.pause()}setTimeout((function(){var t=e.decoderState.state,n=t.isEditing,i=t.rejection;"onBell"!=e.bellStatus||i||(e.removeBellRing(),n||e.answerOvertime())}),this.maxBellTime)}}},{key:"removeBellRing",value:function(){document.getElementById("bellring")&&document.getElementById("".concat(this.jSPlugin.id,"-wrap")).removeChild(document.getElementById("bellring")),document.getElementById("bellring-icon")&&document.getElementById("".concat(this.jSPlugin.id,"-wrap")).removeChild(document.getElementById("bellring-icon"))}},{key:"matchBtn",value:function(e,t){var n=this,i=this.themeData,o=i.header,a=i.footer,r=this.decoderState.state,s=r.mute,c=r.rejection,l={title:"",id:"",domString:"",color:"#FFFFFF",activeColor:"#FFFFFF",onclick:function(){},onmoveleft:function(){},onmoveright:function(){},onremove:function(){}};-1===o[this.bellStatus].btnList.findIndex((function(t){return t.iconId===e}))?(l.color=a[this.bellStatus].color,l.backgroundColor=a[this.bellStatus].backgroundColor,l.activeColor=a[this.bellStatus].activeColor):(l.color=o[this.bellStatus].color,l.backgroundColor=o[this.bellStatus].backgroundColor,l.activeColor=o[this.bellStatus].activeColor);var d=this.videoWidth/6;this.videoWidth;var u=this.videoWidth/1024||1;switch(e){case"ringStatus":return l.title=this.activeThemeStatus?"有人按门铃":this.activeThemeStatusTxt,l.id=e,l.domString='<span id="header-onBell-ringStatus" style="color:'.concat(t.color||"#FFFFFF",";font-size: ").concat(32*u,'px;display: block;text-align: left;font-weight: 500;" >').concat(this.activeThemeStatus?"有人按门铃":this.activeThemeStatusTxt,"</span>"),l.onclick=function(){},l;case"deviceCategory":return l.title="设备名称",l.id=e,l.domString='<span id="header-onBell-deviceCategory" \n style="\n color:'.concat(t.color||"#FFFFFF",";\n font-size: ").concat(24*u,"px;\n padding-top: ").concat(16*u,'px;\n display: block;\n max-width: 100%;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n text-align: left;\n ">').concat(this.deviceInfoData&&this.deviceInfoData.deviceName||"设备名称","</span>"),l.onclick=function(){},l;case"callStatus":return l.title="通话中",l.id=e,l.domString='<span id="header-onCall-ringStatus" style="color:'.concat(t.color||"#FFFFFF",";font-size: ").concat(32*u,'px;display: block;text-align: left;" >通话中</span>'),l.onclick=function(){},l;case"deviceCategory":return l.title="设备名称",l.id=e,l.domString='<span id="header-onCall-deviceCategory"\n style="color:'.concat(t.color||"#FFFFFF",";\n font-size: ").concat(24*u,"px;\n padding-top: ").concat(16*u,'px;\n display: block;\n max-width: 100%;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n text-align: left;\n ">').concat(this.deviceInfoData&&this.deviceInfoData.deviceName||"设备名称","</span>"),l.onclick=function(){},l;case"rejection":return l.title="拒绝",l.id=e,l.domString='<div style="width: '.concat(.7*d,'px;display: flex;flex-direction: column;align-items: center;">\n <div style="width:').concat(.5*d,"px;height: ").concat(.5*d,"px;border-radius: 50%;background: ").concat(c?"#CCCCCC":t.backgroundColor,';display: flex;align-items: center;justify-content: center;" >\n <svg width="').concat(.3*d,'px" height="').concat(.3*d,'px" viewBox="0 0 36 36" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n <title>拒绝</title>\n <g id="icon/拒绝" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n <rect id="Rectangle" x="0" y="0" width="36" height="36"></rect>\n <path d="M16.0428281,19.9522968 C13.5228132,17.435123 11.1135994,14.5173605 12.2699084,13.3638925 C13.9205608,11.7132401 15.3581341,10.6961428 12.4346895,7.05675259 C9.50840386,3.41452132 7.55659974,6.21011849 5.95708632,7.80963191 C4.11324225,9.65631703 5.86049048,16.5345088 12.6591328,23.3359922 C19.4577751,30.1346345 26.3388079,31.8847238 28.1854931,30.0380386 C29.7850065,28.4385252 32.5806036,26.4895622 28.9412134,23.5632765 C25.3018232,20.6369909 24.2847259,22.0745642 22.6340735,23.7280576 C21.4777645,24.8786845 18.5628431,22.4694707 16.0428281,19.9522968 Z" id="路径" fill="#FFFFFF" fill-rule="nonzero" transform="translate(17.997936, 17.998157) rotate(135.000000) translate(-17.997936, -17.998157) "></path>\n </g>\n </svg>\n </div>\n <div style="margin-top: ').concat(.1*d,'px;user-select: none;">拒绝</div>\n </div>'),l.onclick=function(){var e=n.decoderState.state,t=e.play,i=e.isEditing,o=e.rejection;if(i||o)return!1;console.log("拒绝"),t&&n.jSPlugin.stop(),n.removeBellRing(),n.setDecoderState({play:!1,rejection:!0}),n.rejectionStatusDispose(),"function"==typeof n.jSPlugin.hangUpCallback&&n.jSPlugin.hangUpCallback("rejection")},l;case"quickReply":return l.title="快捷回复",l.id=e,l.domString='<div style="width: '.concat(.7*d,'px;display: flex;flex-direction: column;align-items: center;">\n <div style="width: ').concat(.5*d,"px;height: ").concat(.5*d,"px;border-radius: 50%;background: ").concat(c?"#CCCCCC":t.backgroundColor,';display: flex;align-items: center;justify-content: center;" >\n <svg width="').concat(.3*d,'px" height="').concat(.3*d,'px" viewBox="0 0 36 36" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n <title>快捷回复</title>\n <g id="icon/web快捷回复" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n <rect id="Rectangle" x="0" y="0" width="36" height="36"></rect>\n <path d="M17.4723401,6.00464509 C24.1317208,5.8200623 29.613145,11.1601938 29.613145,17.806299 C29.613145,19.5506656 29.2343807,21.2437888 28.5133012,22.7904909 L28.638,22.51 L29.9802796,28.9334997 C30.0980856,29.4978889 29.6719785,30.0050773 29.131395,30.0271186 L29.0218792,30.0249315 L28.9025577,30.0074816 L22.488349,28.6446207 L22.3501503,28.7067675 C21.0679643,29.242563 19.6940914,29.5480927 18.2793303,29.6038407 L18.2793303,29.6038407 L17.8062986,29.6131454 C11.1610025,29.6131454 5.820073,24.1313212 6.00464384,17.4723718 C6.17540866,11.3038211 11.3038207,6.17540904 17.4723401,6.00464509 Z M17.8062986,16.2974446 C16.9707372,16.2974446 16.2926003,16.9755814 16.2926003,17.8111428 C16.2926003,18.6467043 16.9707372,19.3248411 17.8062986,19.3248411 C18.64186,19.3248411 19.3199969,18.6467043 19.3199969,17.8111428 C19.3199969,16.9755814 18.64186,16.2974446 17.8062986,16.2974446 Z M12.9624642,16.2974446 C12.1269027,16.2974446 11.4487659,16.9755814 11.4487659,17.8111428 C11.4487659,18.6467043 12.1269027,19.3248411 12.9624642,19.3248411 C13.7980256,19.3248411 14.4761624,18.6467043 14.4761624,17.8111428 C14.4761624,16.9755814 13.7980256,16.2974446 12.9624642,16.2974446 Z M22.650133,16.2974446 C21.8145716,16.2974446 21.1364348,16.9755814 21.1364348,17.8111428 C21.1364348,18.6467043 21.8145716,19.3248411 22.650133,19.3248411 C23.4856945,19.3248411 24.1638313,18.6467043 24.1638313,17.8111428 C24.1638313,16.9755814 23.4856945,16.2974446 22.650133,16.2974446 Z" id="形状结合" fill="#FFFFFF" fill-rule="nonzero"></path>\n </g>\n </svg>\n </div>\n <div style="margin-top: ').concat(.1*d,'px;user-select: none;">快捷回复</div>\n </div>'),l.onclick=function(){if(n.decoderState.state.rejection)return!1;console.log("快捷回复"),n.switchFooter("quickReply"),n.quickReplyEle=new et(n.jSPlugin,n.switchFooter)},l;case"answer":return l.title="接听",l.id=e,l.domString='<div style="width: '.concat(.7*d,'px;display: flex;flex-direction: column;align-items: center;">\n <div style="width: ').concat(.5*d,"px;height: ").concat(.5*d,"px;border-radius: 50%;background: ").concat(c?"#CCCCCC":t.backgroundColor,';display: flex;align-items: center;justify-content: center;" >\n <svg width="').concat(.3*d,'px" height="').concat(.3*d,'px" viewBox="0 0 36 36" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n <title>接听</title>\n <g id="icon/接听" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n <rect id="Rectangle" x="0" y="0" width="36" height="36"></rect>\n <path d="M15.7728281,19.6822968 C13.2528132,17.165123 10.8435994,14.2473605 11.9999084,13.0938925 C13.6505608,11.4432401 15.0881341,10.4261428 12.1646895,6.78675259 C9.23840386,3.14452132 7.28659974,5.94011849 5.68708632,7.53963191 C3.84324225,9.38631703 5.59049048,16.2645088 12.3891328,23.0659922 C19.1877751,29.8646345 26.0688079,31.6147238 27.9154931,29.7680386 C29.5150065,28.1685252 32.3106036,26.2195622 28.6712134,23.2932765 C25.0318232,20.3669909 24.0147259,21.8045642 22.3640735,23.4580576 C21.2077645,24.6086845 18.2928431,22.1994707 15.7728281,19.6822968 Z" id="路径" fill="#FFFFFF" fill-rule="nonzero" transform="translate(17.727936, 17.728157) rotate(-360.000000) translate(-17.727936, -17.728157) "></path>\n </g>\n </svg>\n </div>\n <div style="margin-top: ').concat(.1*d,'px;user-select: none;">接听</div>\n </div>'),l.onclick=function(){var e=n,i=n.decoderState.state,r=i.play,s=i.isEditing,c=i.talk,l=i.sound,d=i.rejection;if(s||d)return!1;console.log("接听"),n.jSPlugin.pluginStatus.loadingClear(),r||(n.jSPlugin.pluginStatus.loadingStart(n.jSPlugin.id),n.jSPlugin.pluginStatus.loadingSetText({text:"视频加载中"}),n.jSPlugin.play(),n.setDecoderState({play:!r})),c||1!=n.themeData.customConfig.defaultMicro||(n.setDecoderState({talk:!0,mute:!1}),l&&n.jSPlugin.closeSound(),n.jSPlugin.Talk.startTalk()),n.setDecoderState({sound:!1}),n.bellStatus="onCall",n.switchFooter("onCall"),a[n.bellStatus].btnList.map((function(e,t){e.isrender&&n.renderFooter(e.iconId,e)})),o[n.bellStatus].btnList.map((function(e,t){e.isrender&&n.renderHeader(e.iconId,e)}));var u=document.getElementById("".concat(n.jSPlugin.id,"-header-onBell"));u&&u.parentElement.removeChild(u),1==n.themeData.customConfig.bellPoster&&(document.getElementById("bellring-icon")&&document.getElementById("".concat(n.jSPlugin.id,"-wrap")).removeChild(document.getElementById("bellring-icon")),n.jSPlugin.setPoster("")),0==n.themeData.customConfig.defaultMicro&&(n.muteCommon(t),n.jSPlugin.openSound()),n.removeBellRing(),n.maxTalkTime=1e3*n.themeData.customConfig.maxTalkTime*60,setTimeout((function(){c&&(console.log("结束对讲"),e.setDecoderState({talk:!1}),e.jSPlugin.Talk.stopTalk()),r&&(e.jSPlugin.stop(),e.setDecoderState({play:!r})),n.rejectionStatusDispose(),n.remoteUnlockEle&&n.remoteUnlockEle.goback(),"function"==typeof n.jSPlugin.hangUpCallback&&n.jSPlugin.hangUpCallback("hangUp")}),n.maxTalkTime)},l;case"remoteUnlock":return l.title="远程开锁",l.id=e,l.domString='<div style="width: '.concat(.7*d,'px;display: flex;flex-direction: column;align-items: center;">\n <div style="width: ').concat(.5*d,"px;height: ").concat(.5*d,"px;border-radius: 50%;background: ").concat(c?"#CCCCCC":t.backgroundColor,';display: flex;align-items: center;justify-content: center;" >\n <svg width="').concat(.3*d,'px" height="').concat(.3*d,'px" viewBox="0 0 36 36" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n <title>开锁</title>\n <g id="icon/开锁" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n <rect id="Rectangle" x="0" y="0" width="36" height="36"></rect>\n <path d="M18,4 C21.3137085,4 24,6.6862915 24,10 L24,10 L24,19.787 L29.5,19.7875 C30.0522847,19.7875 30.5,20.2352153 30.5,20.7875 C30.5,21.3397847 30.0522847,21.7875 29.5,21.7875 L24,21.787 L24,26 C24,29.2383969 21.4344251,31.8775718 18.2249383,31.9958615 L18,32 C14.6862915,32 12,29.3137085 12,26 L12,26 L12,10 C12,6.6862915 14.6862915,4 18,4 Z M18,6 C15.790861,6 14,7.790861 14,10 L14,10 L14,26 C14,28.209139 15.790861,30 18,30 C20.209139,30 22,28.209139 22,26 L22,26 L22,21.787 L18.5,21.7875 C17.9477153,21.7875 17.5,21.3397847 17.5,20.7875 C17.5,20.2352153 17.9477153,19.7875 18.5,19.7875 L22,19.787 L22,10 C22,7.85780461 20.3160315,6.10892112 18.1996403,6.00489531 Z" id="形状结合" fill="#FFFFFF" fill-rule="nonzero"></path>\n </g>\n </svg>\n </div>\n <div style="margin-top: ').concat(.1*d,'px;user-select: none;">远程开锁</div>\n </div>'),l.onclick=function(){var e=n.decoderState.state,t=e.isEditing,i=e.rejection;if(t||"onBell"==n.bellStatus||i)return!1;console.log("远程开锁"),n.switchFooter("remoteUnlock"),n.remoteUnlockEle=new tt(n.jSPlugin,n.switchFooter)},l;case"mute":return l.title="静音",l.id=e,l.domString='<div style="width: '.concat(.7*d,'px;display: flex;flex-direction: column;align-items: center;">\n <div id="').concat(this.jSPlugin.id,'-icon-mute" style="width: ').concat(.5*d,"px;height: ").concat(.5*d,"px;border-radius: 50%;border: 1px solid ").concat(c?"#CCCCCC":t.backgroundColor,";background: ").concat(c&&s?"#cccccc":"#ffffff",';display: flex;align-items: center;justify-content: center;" >\n <svg width="').concat(.3*d,'px" height="').concat(.3*d,'px" viewBox="0 0 36 36" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n <title>静音</title>\n <g id="icon/静音" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n <rect id="Rectangle" x="0" y="0" width="36" height="36"></rect>\n <path id="icon-mute-path" d="M29.2988305,7.56559704 C29.8540627,8.1086468 29.8980234,8.97727504 29.4240597,9.57172938 L29.3223594,9.6867869 L22.585,16.574 L22.5859243,26.0592702 C22.5859243,26.9500521 21.8638029,27.6721735 20.973021,27.6721735 C20.6007147,27.6721735 20.2398727,27.5433734 19.9517149,27.3076254 L15.583,23.733 L10.4341733,28.9987008 C9.85492024,29.5909486 8.9052312,29.6014828 8.31298346,29.0222298 C7.75775121,28.47918 7.71379057,27.6105518 8.18775419,27.0160974 L8.28945454,26.9010399 L27.1776406,7.58912597 C27.7568937,6.99687823 28.7065827,6.98634397 29.2988305,7.56559704 Z M22.2503608,7.16816759 C22.4679282,7.45036017 22.5859243,7.79665625 22.5859243,8.15298221 L22.585,9.899 L10.778,21.971 L9.47580645,21.9713498 C7.69424274,21.9713498 6.25,20.5271071 6.25,18.7455434 L6.25,15.65293 C6.25,13.8713663 7.69424274,12.4271235 9.47580645,12.4271235 L12.787,12.427 L19.9882064,6.87564241 C20.6936617,6.33174431 21.7064627,6.46271229 22.2503608,7.16816759 Z" id="形状结合" fill="').concat(s?"#ffffff":c?"#cccccc":t.backgroundColor,'"></path>\n </g>\n </svg>\n </div>\n <div style="margin-top: ').concat(.1*d,'px;user-select: none;">静音</div>\n </div>'),l.onclick=function(){var e=n.decoderState.state,i=e.talk,o=e.sound;if(e.play,e.rejection)return!1;console.log("静音"),i?(console.log("结束对讲"),n.setDecoderState({talk:!1,mute:!0},t.backgroundColor),n.jSPlugin.Talk.stopTalk(),n.jSPlugin.openSound()):(console.log("开始对讲"),n.setDecoderState({talk:!0,mute:!1},t.backgroundColor),o&&(n.jSPlugin.closeSound(),n.setDecoderState({sound:!1})),n.jSPlugin.Talk.startTalk())},l;case"hangUp":return l.title="挂断",l.id=e,l.domString='<div style="width: '.concat(.7*d,'px;display: flex;flex-direction: column;align-items: center;">\n <div style="width:').concat(.5*d,"px;height: ").concat(.5*d,"px;border-radius: 50%;background: ").concat(c?"#CCCCCC":t.backgroundColor,';display: flex;align-items: center;justify-content: center;" >\n <svg width="').concat(.3*d,'px" height="').concat(.3*d,'px" viewBox="0 0 36 36" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n <title>挂断</title>\n <g id="icon/挂断" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n <rect id="Rectangle" x="0" y="0" width="36" height="36"></rect>\n <path d="M16.0428281,19.9522968 C13.5228132,17.435123 11.1135994,14.5173605 12.2699084,13.3638925 C13.9205608,11.7132401 15.3581341,10.6961428 12.4346895,7.05675259 C9.50840386,3.41452132 7.55659974,6.21011849 5.95708632,7.80963191 C4.11324225,9.65631703 5.86049048,16.5345088 12.6591328,23.3359922 C19.4577751,30.1346345 26.3388079,31.8847238 28.1854931,30.0380386 C29.7850065,28.4385252 32.5806036,26.4895622 28.9412134,23.5632765 C25.3018232,20.6369909 24.2847259,22.0745642 22.6340735,23.7280576 C21.4777645,24.8786845 18.5628431,22.4694707 16.0428281,19.9522968 Z" id="路径" fill="#FFFFFF" fill-rule="nonzero" transform="translate(17.997936, 17.998157) rotate(135.000000) translate(-17.997936, -17.998157) "></path>\n </g>\n </svg>\n </div>\n <div style="margin-top: ').concat(.1*d,'px;">挂断</div>\n </div>'),l.onclick=function(){var e=n.decoderState.state,t=e.talk,i=e.play,o=e.sound;if(e.rejection)return!1;t&&(console.log("结束对讲"),n.setDecoderState({talk:!1}),n.jSPlugin.Talk.stopTalk()),i&&(n.jSPlugin.stop(),n.setDecoderState({play:!i})),o&&(n.jSPlugin.closeSound(),n.setDecoderState({sound:!1})),(i||t)&&(console.log("挂断"),n.removeBellRing(),n.rejectionStatusDispose(),"function"==typeof n.jSPlugin.hangUpCallback&&n.jSPlugin.hangUpCallback("hangUp"))},l;default:return l}}},{key:"answerOvertime",value:function(){this.toastCustom.initToastContent("应答超时");var e=this.decoderState.state.play;console.log("应答超时"),e&&this.jSPlugin.stop(),this.setDecoderState({play:!1,rejection:!0}),this.rejectionStatusDispose(),this.switchFooter("onBell"),"function"==typeof this.jSPlugin.hangUpCallback&&this.jSPlugin.hangUpCallback("rejection")}},{key:"rejectionStatusDispose",value:function(){var e=this,t=this.themeData.footer,n=document.getElementById("".concat(this.jSPlugin.id,"-audioControls")),i=document.getElementById("".concat(this.jSPlugin.id,"-audioControls-onCall")),o=document.getElementById("header-".concat(this.bellStatus,"-ringStatus"));"onBell"==this.bellStatus?(n.innerHTML="",n.style.color="#ffffff"):(i.innerHTML="",i.style.color="#ffffff"),console.log("rejectionStatusDispose"),this.setDecoderState({rejection:!0}),t[this.bellStatus].btnList.map((function(t,n){t.isrender&&e.renderFooter(t.iconId,t)})),o.innerText="通话已结束",this.jSPlugin.pluginStatus.loadingClear(),this.jSPlugin.pluginStatus.loadingSetTextWithBtn({text:"通话已结束",color:"white",isMobile:!1,type:2})}},{key:"userNoDevice",value:function(){var e=this;this.removeBellRing(),this.setDecoderState({rejection:!0});var t=this.themeData.footer,n=document.getElementById("".concat(this.jSPlugin.id,"-audioControls")),i=document.getElementById("".concat(this.jSPlugin.id,"-audioControls-onCall"));"onBell"==this.bellStatus?(n.innerHTML="",n.style.color="#ffffff"):(i.innerHTML="",i.style.color="#ffffff"),console.log("userNoDevice"),this.setDecoderState({rejection:!0}),t[this.bellStatus].btnList.map((function(t,n){t.isrender&&e.renderFooter(t.iconId,t)})),this.jSPlugin.pluginStatus.loadingClear(),this.jSPlugin.pluginStatus.loadingSetTextWithBtn({text:"该用户不拥有该设备",color:"white",isMobile:!1,type:2})}},{key:"renderHeader",value:function(e,t){var n=this,i=this.videoWidth/1024||1,o=this.matchBtn(e,t);if(document.getElementById("".concat(this.jSPlugin.id,"-header-").concat(this.bellStatus,"-content"))){var a=document.createElement("span");a.innerHTML="".concat(o.domString),document.getElementById("".concat(this.jSPlugin.id,"-header-").concat(this.bellStatus,"-content")).appendChild(a)}else{var r=document.createElement("div");r.id="".concat(this.jSPlugin.id,"-header-").concat(this.bellStatus),r.style="max-width:50%;position:relative;",r.innerHTML='<span id="'.concat(this.jSPlugin.id,"-header-").concat(this.bellStatus,'-content" style="display:inline-block;height:auto;padding-top: ').concat(32*i,'px;";>\n ').concat(o.domString,"\n </span>"),r.onclick=function(e){if(n.decoderState.state.isEditing||!n.activeThemeStatus)return!1;o.onclick(e)},document.getElementById("".concat(this.jSPlugin.id,"-headControl")).childNodes[0].appendChild(r)}}},{key:"renderFooter",value:function(e,t){var n=this,i=this.decoderState.state.mute;if(console.log("-------------renderFooter"),"remoteUnlock"==e&&this.jSPlugin.capacity&&(!this.jSPlugin.capacity.support_unlock||0==this.jSPlugin.capacity.support_unlock))return!1;var o=this.matchBtn(e,t),a=this.videoWidth/6,r=document.createElement("div");r.className="theme-icon-item",this.jSPlugin.isWebConsole?r.style="padding:0 ".concat(.1*a,"px;"):r.style="padding:0 ".concat(.1*a,"px;cursor: pointer;"),r.innerHTML="".concat('<span id="'.concat(this.jSPlugin.id,"-").concat(o.id,'" style="position:relative;">')+'<div id="'.concat(this.jSPlugin.id,"-").concat(o.id,'-content" title="').concat(o.title,'" style="display: flex;align-items: center;position:relative;">')).concat(o.domString,"</div>")+"</span>",r.onclick=function(e){if(n.decoderState.state.isEditing||!n.activeThemeStatus)return!1;o.onclick(e)},o.onmouseenter&&(r.onmouseenter=function(e){if(n.decoderState.state.isEditing||!n.activeThemeStatus)return!1;o.onmouseenter(e)}),o.onmouseleave&&(r.onmouseleave=function(e){if(n.decoderState.state.isEditing||!n.activeThemeStatus)return!1;o.onmouseleave(e)});var s=this.videoWidth/597,c=document.createElement("span");c.className="icon-move left",c.innerHTML='<span id="'.concat(this.jSPlugin.id,"-").concat(o.id,'-left" title="左移" style="display: inline-block;border-radius: 2px;overflow: hidden;position: absolute;top: calc(50% - ').concat(35*s,"px); width: ").concat(10*s,"px; height: ").concat(40*s,'px;cursor: pointer;">\n <svg width="100%" height="100%" viewBox="0 0 10 40" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n <title></title>\n <g id="呼叫模板-控制台" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n <g id="H5呼叫模板" transform="translate(-614.000000, -5024.000000)">\n <g id="编组-28" transform="translate(421.000000, 4484.000000)">\n <g id="编组-9" transform="translate(23.000000, 522.000000)">\n <g id="编组" transform="translate(170.000000, 0.000000)">\n <g id="箭头左" transform="translate(0.000000, 18.000000)">\n <rect id="矩形" fill="#595959" x="0" y="0" width="10" height="40" rx="2"></rect>\n <g id="1.通用/2.Icon图标/Common/Fill/Left" transform="translate(1.000000, 15.000000)" fill="#FFFFFF">\n <path d="M3.88411064,2.46093277 L7.81658983,7.1799078 C7.99337187,7.39204625 7.96470984,7.7073286 7.75257139,7.88411064 C7.66271389,7.95899189 7.54944745,8 7.43247919,8 L-0.432479194,8 C-0.708621569,8 -0.932479194,7.77614237 -0.932479194,7.5 C-0.932479194,7.38303175 -0.891471084,7.2697653 -0.816589833,7.1799078 L3.11588936,2.46093277 C3.2926714,2.24879432 3.60795375,2.22013229 3.8200922,2.39691433 C3.84332373,2.41627394 3.86475103,2.43770124 3.88411064,2.46093277 Z" id="三角形" transform="translate(3.500000, 5.000000) scale(-1, -1) rotate(-270.000000) translate(-3.500000, -5.000000) "></path>\n </g>\n </g>\n </g>\n </g>\n </g>\n </g>\n </g>\n </svg>\n </span>'),c.onclick=function(){n.editIcon(o.id,"left","footer")},r.appendChild(c);var l=document.createElement("span");if(l.className="icon-move right",l.innerHTML='<span id="'.concat(this.jSPlugin.id,"-").concat(o.id,'-right" class="ezuikit-theme-icon" title="右移" style="display: inline-block;border-radius: 2px;overflow: hidden;position: absolute;top: calc(50% - ').concat(35*s,"px);left: ").concat(20*s+.5*a,"px; width: ").concat(10*s,"px; height: ").concat(40*s,'px;cursor: pointer;">\n <svg width="100%" height="100%" viewBox="0 0 10 40" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n <title></title>\n <g id="呼叫模板-控制台" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n <g id="H5呼叫模板" transform="translate(-684.000000, -5024.000000)">\n <g id="编组-28" transform="translate(421.000000, 4484.000000)">\n <g id="编组-9" transform="translate(23.000000, 522.000000)">\n <g id="编组" transform="translate(170.000000, 0.000000)">\n <g id="箭头右" transform="translate(70.000000, 18.000000)">\n <rect id="矩形" fill="#595959" x="0" y="0" width="10" height="40" rx="2"></rect>\n <g id="1.通用/2.Icon图标/Common/Fill/Left" transform="translate(5.500000, 20.000000) scale(-1, 1) translate(-5.500000, -20.000000) translate(2.000000, 15.000000)" fill="#FFFFFF">\n <path d="M3.88411064,2.46093277 L7.81658983,7.1799078 C7.99337187,7.39204625 7.96470984,7.7073286 7.75257139,7.88411064 C7.66271389,7.95899189 7.54944745,8 7.43247919,8 L-0.432479194,8 C-0.708621569,8 -0.932479194,7.77614237 -0.932479194,7.5 C-0.932479194,7.38303175 -0.891471084,7.2697653 -0.816589833,7.1799078 L3.11588936,2.46093277 C3.2926714,2.24879432 3.60795375,2.22013229 3.8200922,2.39691433 C3.84332373,2.41627394 3.86475103,2.43770124 3.88411064,2.46093277 Z" id="三角形" transform="translate(3.500000, 5.000000) scale(-1, -1) rotate(-270.000000) translate(-3.500000, -5.000000) "></path>\n </g>\n </g>\n </g>\n </g>\n </g>\n </g>\n </g>\n </svg>\n </span>'),l.onclick=function(){n.editIcon(o.id,"right","footer")},r.appendChild(l),"answer"==e||"rejection"==e||"hangUp"==e);else{var d=document.createElement("span");d.className="icon-move close",d.innerHTML='<span id="'.concat(o.id,'-remove" class="ezuikit-theme-icon" title="移除" style="position: absolute;top: ').concat(-15*s-1,"px;left: ").concat(20*s+.5*a-4.5*s,'px;cursor: pointer;">\n <svg width="').concat(18*s,'" height="').concat(18*s,'" viewBox="0 0 18 18" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n <title></title>\n <g id="呼叫模板-控制台" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n <g id="H5呼叫模板" transform="translate(-680.000000, -5006.000000)">\n <g id="编组-28" transform="translate(421.000000, 4484.000000)">\n <g id="编组-9" transform="translate(23.000000, 522.000000)">\n <g id="编组" transform="translate(170.000000, 0.000000)">\n <g id="关闭1" transform="translate(66.000000, 0.000000)">\n <rect id="矩形" fill-rule="nonzero" x="0" y="0" width="18" height="18"></rect>\n <path d="M9,1.125 C4.65117188,1.125 1.125,4.65117188 1.125,9 C1.125,13.3488281 4.65117188,16.875 9,16.875 C13.3488281,16.875 16.875,13.3488281 16.875,9 C16.875,4.65117188 13.3488281,1.125 9,1.125 Z M11.9074219,11.9917969 L10.7472656,11.9865234 L9,9.90351562 L7.25449219,11.9847656 L6.09257813,11.9900391 C6.01523438,11.9900391 5.95195313,11.9285156 5.95195313,11.8494141 C5.95195313,11.8160156 5.96425781,11.784375 5.98535156,11.7580078 L8.27226563,9.03339844 L5.98535156,6.31054687 C5.96425781,6.28417969 5.95195313,6.25253906 5.95195313,6.21914062 C5.95195313,6.14179687 6.01523438,6.07851562 6.09257813,6.07851562 L7.25449219,6.08378906 L9,8.16679687 L10.7455078,6.08554688 L11.9056641,6.08027344 C11.9830078,6.08027344 12.0462891,6.14179687 12.0462891,6.22089844 C12.0462891,6.25429687 12.0339844,6.2859375 12.0128906,6.31230469 L9.72949219,9.03515625 L12.0146484,11.7597656 C12.0357422,11.7861328 12.0480469,11.8177734 12.0480469,11.8511719 C12.0480469,11.9285156 11.9847656,11.9917969 11.9074219,11.9917969 Z" id="形状" fill="#595959"></path>\n </g>\n </g>\n </g>\n </g>\n </g>\n </g>\n </svg>\n </span>'),d.onclick=function(){n.editIcon(o.id,"delete","footer")},r.appendChild(d)}"onCall"==this.bellStatus?document.getElementById("".concat(this.jSPlugin.id,"-audioControls-onCall")).appendChild(r):document.getElementById("".concat(this.jSPlugin.id,"-audioControls")).appendChild(r),this.decoderState.state.isEditing&&"mute"==e&&"onCall"==this.bellStatus&&(0!=this.themeData.customConfig.defaultMicro||i?this.setDecoderState({mute:!1},t.backgroundColor):this.setDecoderState({mute:!0},t.backgroundColor))}},{key:"switchFooter",value:function(e){var t={};switch(this.themeData&&(t=this.themeData.footer),e){case"onBell":document.getElementById("".concat(this.jSPlugin.id,"-audioControls-quickReply"))&&(document.getElementById("".concat(this.jSPlugin.id,"-audioControls-quickReply")).style.display="none"),document.getElementById("".concat(this.jSPlugin.id,"-audioControls-onCall"))?"none"==document.getElementById("".concat(this.jSPlugin.id,"-audioControls-onCall")).style.display&&(document.getElementById("".concat(this.jSPlugin.id,"-audioControls")).style.display="flex"):document.getElementById("".concat(this.jSPlugin.id,"-audioControls")).style.display="flex";break;case"onCall":document.getElementById("".concat(this.jSPlugin.id,"-audioControls-remoteUnlock")).style.display="none",document.getElementById("".concat(this.jSPlugin.id,"-audioControls")).style.display="none",document.getElementById("".concat(this.jSPlugin.id,"-audioControls-onCall")).style.display="flex",this.themeData&&(document.getElementById("".concat(this.jSPlugin.id,"-audioControls-onCall")).style.color=t[this.bellStatus].color);break;case"quickReply":document.getElementById("".concat(this.jSPlugin.id,"-audioControls-quickReply")).style.display="flex",document.getElementById("".concat(this.jSPlugin.id,"-audioControls")).style.display="none";break;case"remoteUnlock":document.getElementById("".concat(this.jSPlugin.id,"-audioControls-onCall")).style.display="none",document.getElementById("".concat(this.jSPlugin.id,"-audioControls")).style.display="none",document.getElementById("".concat(this.jSPlugin.id,"-audioControls-remoteUnlock")).style.display="flex"}}},{key:"initThemeData",value:function(){var e=this;console.log("-------------initThemeData");var t=this.decoderState.state.isEditing,n=this.themeData,o=n.header,a=n.footer,r=this.jSPlugin.id,s=this.videoWidth/1024;if(this.isNeedRenderHeader=i.findIndex(o[this.bellStatus].btnList,(function(e){return e.isrender>0}))>=0,this.isNeedRenderFooter=i.findIndex(a[this.bellStatus].btnList,(function(e){return e.isrender>0}))>=0,this.isNeedRenderHeader)if(document.getElementById("".concat(this.jSPlugin.id,"-headControl")))document.getElementById("".concat(this.jSPlugin.id,"-headControl")).innerHTML="<div id='".concat(this.jSPlugin.id,"-headControl-left' style='display:flex;width: calc(100% - 100px);padding-left: 3%;'></div><div id='").concat(this.jSPlugin.id,"-headControl-right' style='display:flex'></div>");else{var c=document.createElement("div");c.setAttribute("id","".concat(this.jSPlugin.id,"-headControl")),c.setAttribute("class","header-controls"),c.innerHTML="<div id='".concat(this.jSPlugin.id,"-headControl-left' class=\"header-controls-left\" style='display:flex;width:calc(100% - 100px);overflow:hidden;padding-left: 3%;'></div><div id='").concat(this.jSPlugin.id,"-headControl-right' class=\"header-controls-right\" style='display:flex;'></div>"),console.log(this.jSPlugin.height);var l=.2*this.jSPlugin.height+"px",d={height:l,display:"flex","justify-content":"space-between",top:0,"z-index":999,color:"#FFFFFF",width:"100%",position:"relative","margin-bottom":"-"+l,"align-items":"center",background:"transparent linear-gradient(180deg, rgba(0,0,0,0.65) 0%, rgba(0,0,0,0.00) 100%)"};c.style=ot(d),document.getElementById("".concat(r,"-wrap")).insertBefore(c,document.getElementById(r));var u=setInterval((function(){window.EZUIKit[e.jSPlugin.id].state.EZUIKitPlayer.init&&clearInterval(u)}),50)}else document.getElementById("".concat(this.jSPlugin.id,"-headControl"))&&document.getElementById("".concat(this.jSPlugin.id,"-headControl")).parentElement.removeChild(document.getElementById("".concat(this.jSPlugin.id,"-headControl")));var m=.3*this.jSPlugin.height;if(this.isNeedRenderFooter)if(document.getElementById("".concat(this.jSPlugin.id,"-ez-iframe-footer-container")))document.getElementById("".concat(this.jSPlugin.id,"-ez-iframe-footer-container"))&&(document.getElementById("".concat(this.jSPlugin.id,"-ez-iframe-footer-container")).style.marginTop="-".concat(m,"px"),"onCall"==this.bellStatus?document.getElementById("".concat(this.jSPlugin.id,"-ez-iframe-footer-container")).innerHTML='\n <div id="'.concat(this.jSPlugin.id,'-audioControls" class="footer-controls" style=\'display:none;justify-content: space-around;padding: 0 4%;width:100%;\'></div>\n <div id="').concat(this.jSPlugin.id,'-audioControls-onCall" class="footer-controls" style=\'display:flex;justify-content: space-around;padding: 0 4%;width:100%;z-index:999;position: relative;\'></div>\n <div id="').concat(this.jSPlugin.id,'-audioControls-quickReply" class="footer-controls" style=\'display:none;justify-content: center;width:100%;z-index:999;position: relative;\'></div>\n <div id="').concat(this.jSPlugin.id,'-audioControls-remoteUnlock" class="footer-controls" style=\'display:none;justify-content: center;width:100%;z-index:999;position: relative;\'></div>\n '):document.getElementById("".concat(this.jSPlugin.id,"-ez-iframe-footer-container")).innerHTML='\n <div id="'.concat(this.jSPlugin.id,'-audioControls" class="footer-controls" style=\'display:flex;justify-content: space-around;padding: 0 4%;width:100%;\'></div>\n <div id="').concat(this.jSPlugin.id,'-audioControls-onCall" class="footer-controls" style=\'display:none;justify-content: space-around;padding: 0 4%;width:100%;z-index:999;position: relative;\'></div>\n <div id="').concat(this.jSPlugin.id,'-audioControls-quickReply" class="footer-controls" style=\'display:none;justify-content: center;width:100%;z-index:999;position: relative;\'></div>\n <div id="').concat(this.jSPlugin.id,'-audioControls-remoteUnlock" class="footer-controls" style=\'display:none;justify-content: center;width:100%;z-index:999;position: relative;\'></div>\n '));else{var h=document.createElement("div");h.setAttribute("id","".concat(this.jSPlugin.id,"-ez-iframe-footer-container")),h.setAttribute("class","ez-iframe-footer-container");var p={"min-height":m+"px","max-height":m+"px",position:"relative","margin-top":"-"+m+"px",display:"flex","flex-wrap":"wrap","justify-content":"space-between","z-index":999,top:0,color:"#FFFFFF",width:"100%","align-items":"center","background-image":"linear-gradient(180deg, rgba(0,0,0,0.00) 0%, rgba(0,0,0,0.60) 100%)","font-size":24*s+"px"};h.style=ot(p),h.innerHTML='\n <div id="'.concat(this.jSPlugin.id,'-audioControls" class="footer-controls" style=\'display:flex;justify-content: space-around;padding: 0 4%;width:100%;z-index:999;position: relative;\'></div>\n <div id="').concat(this.jSPlugin.id,'-audioControls-onCall" class="footer-controls" style=\'display:none;justify-content: space-around;padding: 0 4%;width:100%;z-index:999;position: relative;\'></div>\n <div id="').concat(this.jSPlugin.id,'-audioControls-quickReply" class="footer-controls" style=\'display:none;justify-content: center;width:100%;z-index:999;position: relative;\'></div>\n <div id="').concat(this.jSPlugin.id,'-audioControls-remoteUnlock" class="footer-controls" style=\'display:none;justify-content: center;width:100%;z-index:999;position: relative;\'></div>\n '),x(h,document.getElementById(r))}else document.getElementById("".concat(this.jSPlugin.id,"-ez-iframe-footer-container"))&&document.getElementById("".concat(this.jSPlugin.id,"-ez-iframe-footer-container")).parentElement.removeChild(document.getElementById("".concat(this.jSPlugin.id,"-ez-iframe-footer-container")));if(this.isNeedRenderHeader&&document.getElementById("".concat(this.jSPlugin.id,"-headControl"))&&(document.getElementById("".concat(this.jSPlugin.id,"-headControl")).style.background=o[this.bellStatus].backgroundColor,document.getElementById("".concat(this.jSPlugin.id,"-headControl")).style.color=o[this.bellStatus].color,o[this.bellStatus].btnList.map((function(t,n){t.isrender&&e.renderHeader(t.iconId,t)}))),this.isNeedRenderFooter&&document.getElementById("".concat(this.jSPlugin.id,"-audioControls"))&&(document.getElementById("".concat(this.jSPlugin.id,"-audioControls")).style.background=a[this.bellStatus].backgroundColor,document.getElementById("".concat(this.jSPlugin.id,"-audioControls")).style.color=a[this.bellStatus].color,a[this.bellStatus].btnList.map((function(t,n){t.isrender&&e.renderFooter(t.iconId,t)}))),1==this.themeData.customConfig.bellPoster&&!t){this.jSPlugin.poster="https://resource.eziot.com/group1/M00/00/B8/CtwQEmPbGh2AVJB-ABDcYtyw5gk899.svg";var g=setInterval((function(){window.EZUIKit[e.jSPlugin.id].state.EZUIKitPlayer.init&&(clearInterval(g),e.jSPlugin.setPoster(e.jSPlugin.poster))}),50)}this.activeThemeStatus&&(this.initBellRing(),window.addEventListener("click",this.autoPlayRing)),this.inited=!0,this.getCallDeviceInfo()}},{key:"renderThemeData",value:function(){var e=this,t=this.decoderState.state.isEditing,n=this.themeData,i=n.header,o=n.footer;if(this.isNeedRenderHeader&&i&&(document.getElementById("".concat(this.jSPlugin.id,"-headControl")).style.background=i[this.bellStatus].backgroundColor.replace("-diy",""),document.getElementById("".concat(this.jSPlugin.id,"-headControl")).style.color=i[this.bellStatus].color.replace("-diy",""),i[this.bellStatus].btnList.map((function(t,n){t.isrender&&e.setDecoderState(p({},t.iconId,e.decoderState.state[t.iconId]))}))),this.isNeedRenderFooter&&o)document.getElementById("".concat(this.jSPlugin.id,"-audioControls")).style.background=o[this.bellStatus].backgroundColor.replace("-diy",""),document.getElementById("".concat(this.jSPlugin.id,"-audioControls")).style.color=o[this.bellStatus].color.replace("-diy",""),document.getElementById("".concat(this.jSPlugin.id,"-audioControls-onCall")).style.color=o[this.bellStatus].color.replace("-diy",""),o[this.bellStatus].btnList.map((function(n,i){if(n.isrender&&e.setDecoderState(p({},n.iconId,e.decoderState.state[n.iconId])),0==i&&!e.themeInited&&e.activeThemeStatus)var o=setInterval((function(){window.EZUIKit[e.jSPlugin.id].state.EZUIKitPlayer.init&&(clearInterval(o),1!=e.themeData.customConfig.bellPoster||t?e.jSPlugin.play():e.jSPlugin.pluginStatus.loadingClear(),e.themeInited=!0)}),50)})),-1!==this.jSPlugin.url.indexOf("hd.live")&&this.setDecoderState({hd:!0}),this.themeData.autoFocus>0&&(this.autoFocus=parseInt(this.themeData.autoFocus),this.startAutoFocus(),document.getElementById("".concat(this.jSPlugin.id,"-wrap")).addEventListener("click",(function(){e.stopAutoFocus()}))),this.setDecoderState({cloudRec:"cloud.rec"===A(this.jSPlugin.url).type,rec:"rec"===A(this.jSPlugin.url).type,type:A(this.jSPlugin.url).type});else if(!this.themeInited&&this.activeThemeStatus)var a=setInterval((function(){window.EZUIKit[e.jSPlugin.id].state.EZUIKitPlayer.init&&(clearInterval(a),e.themeData&&e.themeData.customConfig&&1==e.themeData.customConfig.bellPoster&&!t?e.jSPlugin.pluginStatus.loadingClear():e.jSPlugin.play(),e.themeInited=!0)}),50);var r=setInterval((function(){window.EZUIKit[e.jSPlugin.id].state.EZUIKitPlayer.init&&(clearInterval(r),e.jSPlugin.reSize(e.jSPlugin.params.width,e.jSPlugin.params.height))}),50)}},{key:"setThemeData",value:function(e,t){this.themeData=e,"onCall"==t&&(this.bellStatus="onCall")}},{key:"startAutoFocus",value:function(){var e=this,t=this.autoFocus;this.autoFocusTimer&&clearTimeout(this.autoFocusTimer),this.autoFocusTimer=setTimeout((function(){document.getElementById("".concat(e.jSPlugin.id,"-audioControls"))&&(document.getElementById("".concat(e.jSPlugin.id,"-audioControls")).style.opacity=0,document.getElementById("".concat(e.jSPlugin.id,"-audioControls")).style.pointerEvents="none")}),1e3*t)}},{key:"stopAutoFocus",value:function(){document.getElementById("".concat(this.jSPlugin.id,"-audioControls"))&&(document.getElementById("".concat(this.jSPlugin.id,"-audioControls")).style.opacity=1,document.getElementById("".concat(this.jSPlugin.id,"-audioControls")).style.pointerEvents="all"),this.autoFocusTimer&&clearTimeout(this.autoFocusTimer),this.startAutoFocus()}},{key:"editIcon",value:function(e,t,n){console.log("编辑组件",e,t,n);var o=this.themeData;console.log("themeData",this.themeData);var a=this.themeData[n][this.bellStatus].btnList,r=i.findIndex(a,(function(t){return t.iconId===e})),s=a[r];switch(t){case"delete":a[r].isrender=0;break;case"right":for(var c=-1,l=r+1;l<a.length;l++)if(a[l].part===a[r].part&&1==a[l].isrender){c=l;break}-1!==c&&(a[r]=a[c],a[c]=s);break;case"left":for(var d=-1,u=r-1;u>=0;u--)if(a[u].part===a[r].part&&1==a[u].isrender){d=u;break}-1!==d&&(a[r]=a[d],a[d]=s)}console.log("new btnList",a),o[n][this.bellStatus].btnList=a,this.jSPlugin.Theme.changeTheme(o)}},{key:"countTime",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this;if(!document.getElementById(this.jSPlugin.id+"time-area")){var i=document.createElement("div");i.id=this.jSPlugin.id+"time-area",i.className="time-area",i.innerHTML='<span class="dot"></span><span class="value">00:00</span>',document.getElementById("".concat(this.jSPlugin.id,"-ez-iframe-footer-container"))&&document.getElementById("".concat(this.jSPlugin.id,"-ez-iframe-footer-container")).appendChild(i)}if(this.countTimer&&clearInterval(this.countTimer),"add"===e){var o=t;document.getElementById(n.jSPlugin.id+"time-area").style.display="flex",this.countTimer=setInterval((function(){++o,document.getElementById(n.jSPlugin.id+"time-area").children[1].innerHTML=function(e){var t=parseInt(e),n=0,i=0,o="00",a="00",r="00";t>59&&(n=parseInt(t/60),t=parseInt(t%60),n>59&&(i=parseInt(n/60),n=parseInt(n%60)));return o=parseInt(t)>9?parseInt(t):"0"+parseInt(t),a=parseInt(n)>9?parseInt(n):"0"+parseInt(n),r=parseInt(i)>9?parseInt(i):"0"+parseInt(i),i>0?r+":"+a+":"+o:n>0?a+":"+o:"00:"+o}(o)}),1e3)}else"destroy"===e&&(this.countTimer&&clearInterval(this.countTimer),this.countTimer=void 0,document.getElementById(n.jSPlugin.id+"time-area")&&(document.getElementById(n.jSPlugin.id+"time-area").children[1].innerHTML="00:00",document.getElementById(n.jSPlugin.id+"time-area").style.display="none"))}},{key:"editStart",value:function(e){console.log("----------editStart2");var t=document.getElementById("".concat(this.jSPlugin.id,"-audioControls")),n=document.getElementById("".concat(this.jSPlugin.id,"-audioControls-onCall"));document.getElementById("".concat(this.jSPlugin.id,"-headControl")),t&&t.setAttribute("class","footer-controls themeEditing"),n&&n.setAttribute("class","footer-controls themeEditing"),this.setDecoderState({isEditing:!0})}},{key:"editEnd",value:function(e){console.log("----------editEnd2");var t=document.getElementById("".concat(this.jSPlugin.id,"-audioControls")),n=document.getElementById("".concat(this.jSPlugin.id,"-headControl")),i=document.getElementById("".concat(this.jSPlugin.id,"-audioControls-onCall"));n&&n.setAttribute("class","header-controls"),t&&t.setAttribute("class","footer-controls"),i&&i.setAttribute("class","footer-controls")}},{key:"fetchThemeData",value:function(e){var t=this;Ue(this.jSPlugin,e,(function(e){0==e.meta.code&&e.data?(t.activeThemeStatus=!0,t.themeData=e.data,e.data.header&&(t.themeData.header=e.data.header,t.themeData.header[t.bellStatus].btnList=t.themeData.header[t.bellStatus].btnList.sort((function(e,t){return e.btnKey.split("-")[3]-t.btnKey.split("-")[3]}))),e.data.footer&&(t.themeData.footer=e.data.footer,t.themeData.footer[t.bellStatus].btnList=t.themeData.footer[t.bellStatus].btnList.sort((function(e,t){return e.btnKey.split("-")[3]-t.btnKey.split("-")[3]}))),t.jSPlugin.capacity?(t.initThemeData(),t.renderThemeData()):setTimeout((function(){t.initThemeData(),t.renderThemeData()}),300)):(t.activeThemeStatus=!1,t.jSPlugin.pluginStatus.loadingClear(),t.setDecoderState({rejection:!0}),"111021"==e.meta.code?(t.jSPlugin.pluginStatus.loadingSetText({text:"无效的模板id",color:"#fff"}),t.activeThemeStatusTxt="无效的模板id"):"111023"==e.meta.code?(t.jSPlugin.pluginStatus.loadingSetText({text:"您的试用特权已到期,需前往轻应用控制台购买后使用。",color:"#fff"}),t.activeThemeStatusTxt="试用特权已到期"):(t.jSPlugin.pluginStatus.loadingSetText({text:"模板未激活,请先在开放平台轻应用控制台购买模板",color:"#fff"}),t.activeThemeStatusTxt="模板未激活"),t.themeData=nt,t.initThemeData(),t.renderThemeData())}),(function(){t.renderThemeData()}))}},{key:"getCallDeviceInfo",value:function(){var e=this;this.videoWidth,it({accessToken:this.jSPlugin.accessToken||this.jSPlugin.token.deviceToken.video,deviceSerial:A(this.jSPlugin.url).deviceSerial}).then((function(t){console.log("---------getCallDeviceInfo"),e.deviceInfoData=t.data,t.data.isEncrypt&&setTimeout((function(){e.jSPlugin.pluginStatus.loadingClear(),e.jSPlugin.pluginStatus.loadingSetText({text:"视频已加密",color:"#fff"})}),500),document.getElementById("header-".concat(e.bellStatus,"-deviceCategory"))&&(document.getElementById("header-".concat(e.bellStatus,"-deviceCategory")).innerText=""+t.data.deviceName)})).catch((function(t){20018!=t.code||e.jSPlugin.isWebConsole||e.userNoDevice(),console.log("获取设备信息失败",t)}))}},{key:"setHeaderText",value:function(e){var t=this.videoWidth/1024||1;document.getElementById("".concat(this.jSPlugin.id,"-deviceCategory-content"))&&(document.getElementById("".concat(this.jSPlugin.id,"-deviceCategory-content")).innerHTML='<span style="font-size: '.concat(32*t,'px;display: block">').concat(e,'</span><span style="font-size: ').concat(24*t,"px;padding-top: ").concat(16*t,'px;display: block;">').concat(this.deviceInfoData&&this.deviceInfoData.deviceName||"","</span>"))}}])}(),rt=function(){return m((function e(t,n,i){l(this,e),this.jSPlugin=t,this.videoWidth=i,this.switchFooter=n,this.toastCustom=new Je(t,!0),this.sendLoadingStats=!1,this.quickReplyList=["你好,请将快递放在门口","你好,稍等","你好,请将快递放入小区快递柜","你好,请将外卖放在门口"],this.popupCustom=new H(t,366),document.getElementById("mobile-quickReply-list")||(this.popupCustom.initPopupContent("快捷回复",this.renderQuickReply()),this.initQuickReply())}),[{key:"initQuickReply",value:function(){document.getElementById("mobile-quickReply-list-item-0")||this.getQuickReplyList()}},{key:"renderQuickReply",value:function(){document.documentElement.clientWidth;var e=document.createElement("div");return e.style="width:100%;",e.id="mobile-quickReply-list",e.innerHTML='<div id="mobile-quickReply-content" style="display: block;width:100%;margin-bottom: 36px;"></div>\n <div id="mobile-quickReply-loading" style="display: none;width:100%;"></div>\n <div id="mobile-quickReply-loaderror" style="display: none;width:100%;"></div>',e}},{key:"matchQuickReplyBtn",value:function(){var e=this,t=this.videoWidth/375||1,n=document.getElementById("mobile-quickReply-content");this.quickReplyList&&this.quickReplyList.length>0&&this.quickReplyList.forEach((function(i,o){var a=document.createElement("div");a.id="mobile-quickReply-list-item-".concat(o),a.style="margin: ".concat(14*t,"px 0;\n padding: ").concat(12*t,"px ").concat(15*t,"px;min-height: ").concat(50*t,"px;width:100%;\n background: #ffffff;border-radius: ").concat(25*t,"px;display: flex;align-items: center;\n box-sizing: border-box;font-size:").concat(16*t,"px;color: #2c2c2c;"),a.innerHTML='\n <svg id="mobile-quickReply-icon-'.concat(o,'" width="').concat(24*t,'px" height="').concat(24*t,'px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n <title>icon/快捷回复播放</title>\n <g id="icon/快捷回复播放" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n <rect id="Rectangle" x="0" y="0" width="24" height="24"></rect>\n <path d="M18.9877488,4.36609064 C21.024173,6.11256041 22.2495,8.93566941 22.2495,12.0024 C22.2495,15.066006 21.0272636,17.8857191 18.9943957,19.6331539 C18.6802816,19.9031635 18.2067557,19.8674098 17.9367461,19.5532957 C17.6667365,19.2391816 17.7024902,18.7656557 18.0166043,18.4956461 C19.708691,17.0411437 20.7495,14.6399857 20.7495,12.0024 C20.7495,9.36223947 19.7060688,6.95821183 18.0112512,5.50470936 C17.6968304,5.23505702 17.6605383,4.76157212 17.9301906,4.44715124 C18.199843,4.13273036 18.6733279,4.09643829 18.9877488,4.36609064 Z M12.2442357,5.87579772 L12.2496,6.0179 L12.2496,17.9819 C12.2496,19.4241617 10.6173522,20.2281184 9.48072691,19.4058312 L9.36879527,19.318145 L5.5996,16.1243865 L3.4996,16.1249 C2.581479,16.1249 1.8284129,15.4182283 1.75540159,14.518493 L1.7496,14.3749 L1.7496,9.6249 C1.7496,8.70699712 2.45696726,7.95373471 3.35611134,7.88070323 L3.4996,7.8749 L5.5996,7.8743865 L9.36863059,4.68279453 C10.4692948,3.74976994 12.1377395,4.4768074 12.2442357,5.87579772 Z M10.3952894,5.79039368 L10.338321,5.82721597 L6.35932099,9.19721597 C6.33078024,9.2209397 6.30781291,9.23786997 6.28390041,9.25347262 L6.35932099,9.19721597 C6.32908972,9.22282023 6.29742069,9.24561685 6.26463127,9.26563212 C6.24087088,9.28012218 6.21634729,9.29327785 6.19105714,9.30506452 C6.18413632,9.30829747 6.1773583,9.31133066 6.1705483,9.31425704 C6.10964585,9.34044144 6.04445985,9.35881628 5.97637056,9.36805338 C5.95756973,9.37054904 5.94148484,9.37214804 5.92538001,9.37322799 L5.8746,9.3749 L3.4996,9.3749 C3.38149734,9.3749 3.28218291,9.45734262 3.25621762,9.56766695 L3.2496,9.6249 L3.2496,14.3749 C3.2496,14.4934644 3.33170357,14.592449 3.44222164,14.6183106 L3.4996,14.6249 L5.8746,14.6249 L5.92192315,14.6263483 C5.93923255,14.627429 5.95652113,14.629109 5.97375563,14.6313909 L5.8746,14.6249 C5.9789469,14.6249 6.0783167,14.6462095 6.168595,14.6847142 C6.18010037,14.6895946 6.19235048,14.695194 6.2044823,14.7011451 C6.22547728,14.7114805 6.24528995,14.7223727 6.26453263,14.7341072 C6.266314,14.735195 6.26795143,14.7362034 6.26958602,14.7372187 L6.28086895,14.7443598 C6.30587317,14.7605037 6.32985559,14.7780945 6.3526978,14.7970136 L6.35940473,14.802655 L10.3380567,18.1733603 C10.4825575,18.2956302 10.695338,18.2179271 10.7408386,18.0492187 L10.7496,17.9819 L10.7496,6.0179 C10.7496,5.82820058 10.5532313,5.71607381 10.3952894,5.79039368 Z M15.9361636,7.38657032 C17.3580982,8.28109203 18.2498,10.0509458 18.2498,12.0044 C18.2498,13.9607796 17.3563865,15.7307985 15.9326223,16.6154437 C15.5807928,16.8340503 15.1183629,16.7260519 14.8997563,16.3742223 C14.6811497,16.0223928 14.7891481,15.5599629 15.1409777,15.3413563 C16.1036696,14.7431949 16.7498,13.4630899 16.7498,12.0044 C16.7498,10.5466827 16.103548,9.26399865 15.1374364,8.65622968 C14.7868297,8.43566726 14.6814079,7.97264316 14.9019703,7.62203641 C15.1225327,7.27142966 15.5855568,7.1660079 15.9361636,7.38657032 Z" id="形状结合" fill="#2C2C2C" fill-rule="nonzero"></path>\n </g>\n </svg>\n <span id="mobile-quickReply-name-').concat(o,'" style="padding-left: 5px;">').concat(i.voiceName,"</span>"),a.onclick=function(){console.log("item:"+i),e.sendLoadingStats||(e.setBtnCheckStatus(o),e.sendQuickReply(i))},n.appendChild(a)}))}},{key:"setBtnCheckStatus",value:function(e){var t=this,n="";this.quickReplyList.forEach((function(i,o){n=document.getElementById("mobile-quickReply-list-item-".concat(o)),o==e?(n.style.background="#F4F6FC",n.style.color="#648FFC",t.setBtnCheckLoding(0,o)):(n.style.background="#ffffff",n.style.color="#2c2c2c")}))}},{key:"setBtnCheckLoding",value:function(e,t){console.log(t);var n=this.videoWidth/375||1;if(t>-1){var i=document.getElementById("mobile-quickReply-list-item-".concat(t)),o=document.getElementById("mobile-quickReply-name-".concat(t)),a=document.getElementById("mobile-quickReply-icon-".concat(t));if(1==e){if(document.getElementById("mobile-quickReply-icon-loading-".concat(t))&&o){var r=document.createElement("span");r.id="mobile-quickReply-icon-".concat(t),r.style="height:".concat(24*n,"px;"),r.innerHTML='\n <svg width="'.concat(24*n,'px" height="').concat(24*n,'px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n <title>icon/快捷回复播放</title>\n <g id="icon/快捷回复播放" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n <rect id="Rectangle" x="0" y="0" width="24" height="24"></rect>\n <path d="M18.9877488,4.36609064 C21.024173,6.11256041 22.2495,8.93566941 22.2495,12.0024 C22.2495,15.066006 21.0272636,17.8857191 18.9943957,19.6331539 C18.6802816,19.9031635 18.2067557,19.8674098 17.9367461,19.5532957 C17.6667365,19.2391816 17.7024902,18.7656557 18.0166043,18.4956461 C19.708691,17.0411437 20.7495,14.6399857 20.7495,12.0024 C20.7495,9.36223947 19.7060688,6.95821183 18.0112512,5.50470936 C17.6968304,5.23505702 17.6605383,4.76157212 17.9301906,4.44715124 C18.199843,4.13273036 18.6733279,4.09643829 18.9877488,4.36609064 Z M12.2442357,5.87579772 L12.2496,6.0179 L12.2496,17.9819 C12.2496,19.4241617 10.6173522,20.2281184 9.48072691,19.4058312 L9.36879527,19.318145 L5.5996,16.1243865 L3.4996,16.1249 C2.581479,16.1249 1.8284129,15.4182283 1.75540159,14.518493 L1.7496,14.3749 L1.7496,9.6249 C1.7496,8.70699712 2.45696726,7.95373471 3.35611134,7.88070323 L3.4996,7.8749 L5.5996,7.8743865 L9.36863059,4.68279453 C10.4692948,3.74976994 12.1377395,4.4768074 12.2442357,5.87579772 Z M10.3952894,5.79039368 L10.338321,5.82721597 L6.35932099,9.19721597 C6.33078024,9.2209397 6.30781291,9.23786997 6.28390041,9.25347262 L6.35932099,9.19721597 C6.32908972,9.22282023 6.29742069,9.24561685 6.26463127,9.26563212 C6.24087088,9.28012218 6.21634729,9.29327785 6.19105714,9.30506452 C6.18413632,9.30829747 6.1773583,9.31133066 6.1705483,9.31425704 C6.10964585,9.34044144 6.04445985,9.35881628 5.97637056,9.36805338 C5.95756973,9.37054904 5.94148484,9.37214804 5.92538001,9.37322799 L5.8746,9.3749 L3.4996,9.3749 C3.38149734,9.3749 3.28218291,9.45734262 3.25621762,9.56766695 L3.2496,9.6249 L3.2496,14.3749 C3.2496,14.4934644 3.33170357,14.592449 3.44222164,14.6183106 L3.4996,14.6249 L5.8746,14.6249 L5.92192315,14.6263483 C5.93923255,14.627429 5.95652113,14.629109 5.97375563,14.6313909 L5.8746,14.6249 C5.9789469,14.6249 6.0783167,14.6462095 6.168595,14.6847142 C6.18010037,14.6895946 6.19235048,14.695194 6.2044823,14.7011451 C6.22547728,14.7114805 6.24528995,14.7223727 6.26453263,14.7341072 C6.266314,14.735195 6.26795143,14.7362034 6.26958602,14.7372187 L6.28086895,14.7443598 C6.30587317,14.7605037 6.32985559,14.7780945 6.3526978,14.7970136 L6.35940473,14.802655 L10.3380567,18.1733603 C10.4825575,18.2956302 10.695338,18.2179271 10.7408386,18.0492187 L10.7496,17.9819 L10.7496,6.0179 C10.7496,5.82820058 10.5532313,5.71607381 10.3952894,5.79039368 Z M15.9361636,7.38657032 C17.3580982,8.28109203 18.2498,10.0509458 18.2498,12.0044 C18.2498,13.9607796 17.3563865,15.7307985 15.9326223,16.6154437 C15.5807928,16.8340503 15.1183629,16.7260519 14.8997563,16.3742223 C14.6811497,16.0223928 14.7891481,15.5599629 15.1409777,15.3413563 C16.1036696,14.7431949 16.7498,13.4630899 16.7498,12.0044 C16.7498,10.5466827 16.103548,9.26399865 15.1374364,8.65622968 C14.7868297,8.43566726 14.6814079,7.97264316 14.9019703,7.62203641 C15.1225327,7.27142966 15.5855568,7.1660079 15.9361636,7.38657032 Z" id="形状结合" fill="#2C2C2C" fill-rule="nonzero"></path>\n </g>\n </svg>\n '),i.insertBefore(r,o)}}else if(a&&o){i.removeChild(a);var s=document.createElement("span");s.id="mobile-quickReply-icon-loading-".concat(t),s.style="height:".concat(20*n,"px;width: ").concat(24*n,"px;"),s.innerHTML='<svg width="'.concat(20*n,'" height="').concat(20*n,'" t="1567069979438" class="loading" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2399"><path d="M538.5344 266.4448a133.12 133.12 0 1 1 133.12-133.12 133.4272 133.4272 0 0 1-133.12 133.12zM255.0144 372.1984a121.6768 121.6768 0 1 1 121.6768-121.6768 121.856 121.856 0 0 1-121.6768 121.6768zM134.72 647.424a107.3664 107.3664 0 1 1 107.3664-107.264A107.52 107.52 0 0 1 134.72 647.424z m120.32 272.4608a90.9824 90.9824 0 1 1 90.9824-90.9824A91.1616 91.1616 0 0 1 255.04 919.8848zM538.5344 1024a79.36 79.36 0 1 1 79.36-79.36 79.36 79.36 0 0 1-79.36 79.36z m287.6928-134.144a64.1792 64.1792 0 1 1 64.1792-64.1792 64.3584 64.3584 0 0 1-64.1792 64.1792z m117.76-296.704a52.6336 52.6336 0 1 1 52.6592-52.6336 52.608 52.608 0 0 1-52.6336 52.6336z m-158.72-338.7136a40.96 40.96 0 1 1 12.0064 28.8512 40.5248 40.5248 0 0 1-12.0064-28.8512z" fill="#666666" p-id="2400"></path></svg>'),i.insertBefore(s,o)}}}},{key:"getQuickReplyList",value:function(){var e=this;console.log("getQuickReplyList"),this.madeLoadingDom(0);Qe(this.jSPlugin,(function(t){if(t&&200==t.code){var n=t.data||[],i=[];t.data.forEach((function(e,t){i=e.voiceName.split("_"),n[t].voiceName=i[1]})),e.quickReplyList=n,setTimeout((function(){e.madeLoadingDom(2)}),500)}else e.madeLoadingDom(1)}),(function(t){console.log(t),e.madeLoadingDom(1)}))}},{key:"madeLoadingDom",value:function(e){var t=this,n=this.videoWidth/375||1;if(0==e){if(document.getElementById("mobile-quickReply-content").style.display="none",document.getElementById("mobile-quickReply-loaderror").style.display="none",document.getElementById("mobile-quickReply-loading").style.display="block",!document.getElementById("mobile-quickReply-loading-box")){var i=document.createElement("div");i.id="mobile-quickReply-loading-box",i.style="width: 100%;display: flex;align-items: center;justify-content: center;flex-direction: row;",i.innerHTML='<div class="" style="heigth:'.concat(20*n,'px">\n <svg width="').concat(20*n,'" height="').concat(20*n,'" t="1567069979438" class="loading" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2399"><path d="M538.5344 266.4448a133.12 133.12 0 1 1 133.12-133.12 133.4272 133.4272 0 0 1-133.12 133.12zM255.0144 372.1984a121.6768 121.6768 0 1 1 121.6768-121.6768 121.856 121.856 0 0 1-121.6768 121.6768zM134.72 647.424a107.3664 107.3664 0 1 1 107.3664-107.264A107.52 107.52 0 0 1 134.72 647.424z m120.32 272.4608a90.9824 90.9824 0 1 1 90.9824-90.9824A91.1616 91.1616 0 0 1 255.04 919.8848zM538.5344 1024a79.36 79.36 0 1 1 79.36-79.36 79.36 79.36 0 0 1-79.36 79.36z m287.6928-134.144a64.1792 64.1792 0 1 1 64.1792-64.1792 64.3584 64.3584 0 0 1-64.1792 64.1792z m117.76-296.704a52.6336 52.6336 0 1 1 52.6592-52.6336 52.608 52.608 0 0 1-52.6336 52.6336z m-158.72-338.7136a40.96 40.96 0 1 1 12.0064 28.8512 40.5248 40.5248 0 0 1-12.0064-28.8512z" fill="#666666" p-id="2400"></path></svg> \n </div>\n <div style="font-size: ').concat(16*n,"px;margin-left:",10,'px;color:#666666;">正在加载,请稍候</div>'),document.getElementById("mobile-quickReply-loading").appendChild(i)}}else if(1==e){if(document.getElementById("mobile-quickReply-content").style.display="none",document.getElementById("mobile-quickReply-loading").style.display="none",document.getElementById("mobile-quickReply-loaderror").style.display="block",!document.getElementById("mobile-quickReply-loaderror-box")){var o=document.createElement("div");o.id="mobile-quickReply-loaderror-box",o.style="width: 100%;display: flex;align-items: center;justify-content: center;flex-direction: column;",o.innerHTML='<div style="">\n <img style="width:'.concat(186*n,"px;height:").concat(120*n,'px;" src="https://resource.eziot.com/group1/M00/00/B8/CtwQEmPZ34KAAStrAAA0pZ5cGTw167.png" />\n </div>\n <div style="font-size: ').concat(16*n,'px;color: #666666;">\n <span>加载失败 </span>\n <span id="mobile-quickReply-loaderror-reload" \n style="color: #648FFC;-webkit-tap-highlight-color: transparent;">点击重试</span>\n </div>'),document.getElementById("mobile-quickReply-loaderror").appendChild(o),document.getElementById("mobile-quickReply-loaderror-reload").onclick=function(){t.getQuickReplyList()}}}else document.getElementById("mobile-quickReply-loading").style.display="none",document.getElementById("mobile-quickReply-loaderror").style.display="none",document.getElementById("mobile-quickReply-content").style.display="block",this.matchQuickReplyBtn()}},{key:"sendQuickReply",value:function(e){var t=this;this.sendLoadingStats=!0;$e(this.jSPlugin,e.fileUrl,(function(e){t.sendLoadingStats=!1,e&&200==e.code?t.toastCustom.initToastContent("快捷回复成功"):t.toastCustom.initToastContent("快捷回复失败,请重试"),t.popupCustom.closePopupCustom()}),(function(e){console.log(e),t.sendLoadingStats=!1,t.toastCustom.initToastContent("快捷回复失败,请重试"),t.popupCustom.closePopupCustom()}))}},{key:"closeQuickReplyEle",value:function(){this.popupCustom.closePopupCustom()}}])}(),st=function(){return m((function e(t,n,i){l(this,e),this.jSPlugin=t,this.videoWidth=i,this.switchFooter=n,this.toastCustom=new Je(t,!0),this.lockStatus=!1,this.popupCustom=new H(t,265),this.popupCustom.initPopupContent("远程开锁",this.renderRemoteUnlock()),this.renderRemoteUnlockSlide()}),[{key:"initRemoteUnlock",value:function(){document.getElementById("mobile-remoteUnlock-content")?this.madeSlideEvent():this.renderRemoteUnlock()}},{key:"renderRemoteUnlock",value:function(){var e=this.videoWidth/1024||1,t=document.createElement("div");return t.style="width:100%;",t.id="mobile-remoteUnlock-box",t.innerHTML='<div style="width:100%;display:flex;flex-direction:row;align-items: center;">\n <div id="mobile-remoteUnlock-content" style="display: block;width:calc(100% - '.concat(160*e,"px);margin: 0 ").concat(24*e,'px;"></div>\n </div>'),t}},{key:"renderRemoteUnlockSlide",value:function(){var e=this.videoWidth/375||1,t=document.getElementById("mobile-remoteUnlock-content"),n=document.createElement("div");n.id="mobile-remoteUnlock-content-slide",n.style="width: 100%;display: flex;justify-content: center;padding: 0 ".concat(15*e,"px"),n.innerHTML='<div id="mobile-remoteUnlock-slide-box" style="width: 100%;line-height: '.concat(60*e,"px;height: ").concat(60*e,"px;border: 1px solid rgba(100,143,252,1);border-radius: ").concat(30*e,'px;position: relative;text-align: center;">\n <div id="mobile-remoteUnlock-slide-bgColor" style="border-radius: ').concat(30*e,"px;width: ").concat(44*e,"px;height: ").concat(60*e,'px;position: absolute;left: 0;top: 0;"></div>\n <div id="mobile-remoteUnlock-slide-tips" style="height: ').concat(60*e,"px;line-height: ").concat(60*e,"px;font-size: ").concat(14*e,"px;border-radius: ").concat(30*e,'px;position: absolute;text-align: center;user-select: none;color: #666666;width: 100%;">右滑开锁</div>\n <div id="mobile-remoteUnlock-slide-ball" style="top: ').concat(8*e,"px;left: ").concat(8*e,"px;width: ").concat(44*e,"px;height: ").concat(44*e,'px;background: #598FFF;position: absolute;text-align: center;border-radius:50%;display:flex;align-items: center;justify-content: center;">\n <svg id="slide-ball-start" style="display: inline;" width="').concat(24*e,'px" height="').concat(24*e,'px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n <title>icon/箭头向右</title>\n <g id="icon/箭头向右" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n <rect id="矩形" fill="#000000" fill-rule="nonzero" opacity="0" x="0" y="0" width="24" height="24"></rect>\n <path d="M14.2841136,6.3689007 L19.9432338,12.0287579 L14.2863796,17.6856122 L12.8580239,16.2572565 L16.114,12.9999007 L4.00000001,13 L4.00000001,11 L16.058,10.9999007 L12.8557579,7.79725638 L14.2841136,6.3689007 Z" id="形状结合" fill="#FFFFFF" fill-rule="nonzero"></path>\n </g>\n </svg>\n <svg id="slide-ball-end" style="display: none;" width="').concat(20*e,'" height="').concat(20*e,'" t="1567069979438" class="loading" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2399"><path d="M538.5344 266.4448a133.12 133.12 0 1 1 133.12-133.12 133.4272 133.4272 0 0 1-133.12 133.12zM255.0144 372.1984a121.6768 121.6768 0 1 1 121.6768-121.6768 121.856 121.856 0 0 1-121.6768 121.6768zM134.72 647.424a107.3664 107.3664 0 1 1 107.3664-107.264A107.52 107.52 0 0 1 134.72 647.424z m120.32 272.4608a90.9824 90.9824 0 1 1 90.9824-90.9824A91.1616 91.1616 0 0 1 255.04 919.8848zM538.5344 1024a79.36 79.36 0 1 1 79.36-79.36 79.36 79.36 0 0 1-79.36 79.36z m287.6928-134.144a64.1792 64.1792 0 1 1 64.1792-64.1792 64.3584 64.3584 0 0 1-64.1792 64.1792z m117.76-296.704a52.6336 52.6336 0 1 1 52.6592-52.6336 52.608 52.608 0 0 1-52.6336 52.6336z m-158.72-338.7136a40.96 40.96 0 1 1 12.0064 28.8512 40.5248 40.5248 0 0 1-12.0064-28.8512z" fill="#648ffc" p-id="2400"></path></svg>\n </div>\n </div>'),t.appendChild(n),this.madeSlideEvent()}},{key:"madeSlideEvent",value:function(){var e=this.videoWidth/375||1,t=document.getElementById("mobile-remoteUnlock-slide-box"),n=document.getElementById("mobile-remoteUnlock-slide-bgColor"),i=document.getElementById("mobile-remoteUnlock-slide-tips"),o=document.getElementById("mobile-remoteUnlock-slide-ball"),a=this;o.ontouchstart=function(r){console.log("ontouchstart");var s=(r=r||window.event).touches[0].pageX;o.style.transition="",n.style.transition="",document.ontouchmove=function(r){var c=(r=r||window.event).touches[0].pageX-t.offsetLeft-s,l=t.clientWidth-o.clientWidth-8*e;c<=0&&(c=0),c>=l&&(c=l),o.style.left=c+"px",c!=l||a.lockStatus||(a.lockStatus=!0,document.getElementById("slide-ball-start").style.display="none",document.getElementById("slide-ball-end").style.display="inline",n.style.width=t.clientWidth+"px",n.style.backgroundColor="#598FFF",t.style.border="0",o.style.backgroundColor="#ffffff",i.textContent="正在开锁",i.style.color="#ffffff",o.ontouchstart=null,a.sendRemoteUnlockApi())},document.ontouchend=function(){a.lockStatus||(n.style.width="0px",o.style.left=8*e+"px",o.style.transition="left 0.6s linear",n.style.transition="width 0.6s linear"),document.ontouchend=null,document.ontouchmove=null}}}},{key:"resetRemoteUnlockSlide",value:function(){var e=this.videoWidth/1024||1;this.lockStatus=!1;var t=document.getElementById("mobile-remoteUnlock-slide-box"),n=document.getElementById("mobile-remoteUnlock-slide-bgColor"),i=document.getElementById("mobile-remoteUnlock-slide-tips"),o=document.getElementById("mobile-remoteUnlock-slide-ball");n.style.width="0px",o.style.left=8*e+"px",i.textContent="右滑开锁",i.style.color="#666666",document.getElementById("slide-ball-start").style.display="inline",document.getElementById("slide-ball-end").style.display="none",n.style.backgroundColor="#FFFFFF",t.style.border="1px solid rgba(255,255,255,1)",o.style.backgroundColor="#598FFF"}},{key:"sendRemoteUnlockApi",value:function(){var e=this;console.log("下发远程开锁");Xe(this.jSPlugin,(function(t){t&&200==t.code?e.toastCustom.initToastContent("开锁成功"):e.toastCustom.initToastContent("开锁失败,请重试"),e.popupCustom.closePopupCustom()}),(function(t){console.log(t),e.toastCustom.initToastContent("开锁失败,请重试"),e.popupCustom.closePopupCustom()}))}},{key:"closeRemoteUnlock",value:function(){this.popupCustom.closePopupCustom()}}])}(),ct={customConfig:{defaultMicro:0,defaultPlay:0,maxTalkTime:0,bellPoster:0,maxBellTime:0},header:{onBell:{color:"#2c2c2c",backgroundColor:"#00000000 linear-gradient(180deg, rgba(0,0,0,0.65) 0%, rgba(0,0,0,0.00) 100%)",activeColor:"#1890FF",autoFocus:0,btnList:[{btnKey:"c1cbc1d4e86d49a0981f54beea95280a-4412dc7a9f7b471a9a3e9a8fb625c793-header-0",iconId:"ringStatus",part:"left",defaultActive:0,isrender:1,color:"#2c2c2c",themeId:"4412dc7a9f7b471a9a3e9a8fb625c793"},{btnKey:"c1cbc1d4e86d49a0981f54beea95280a-4412dc7a9f7b471a9a3e9a8fb625c793-header-1",iconId:"deviceCategory",part:"left",defaultActive:0,isrender:1,color:"#2c2c2c",themeId:"4412dc7a9f7b471a9a3e9a8fb625c793"}]},onCall:{color:"#2c2c2c",backgroundColor:"#00000000",activeColor:"#1890FF",autoFocus:5,btnList:[{btnKey:"c1cbc1d4e86d49a0981f54beea95280a-4412dc7a9f7b471a9a3e9a8fb625c793-header-0",iconId:"callStatus",part:"left",defaultActive:0,isrender:1,color:"#2c2c2c",themeId:"4412dc7a9f7b471a9a3e9a8fb625c793"},{btnKey:"c1cbc1d4e86d49a0981f54beea95280a-4412dc7a9f7b471a9a3e9a8fb625c793-header-1",iconId:"deviceCategory",part:"left",defaultActive:0,isrender:1,color:"#2c2c2c",themeId:"4412dc7a9f7b471a9a3e9a8fb625c793"}]}},footer:{onBell:{color:"#2c2c2c",backgroundColor:"#00000000",activeColor:"#1890FF",autoFocus:5,btnList:[{btnKey:"c1cbc1d4e86d49a0981f54beea95280a-4412dc7a9f7b471a9a3e9a8fb625c793-footer-0",iconId:"quickReply",part:"left",defaultActive:1,isrender:1,themeId:"4412dc7a9f7b471a9a3e9a8fb625c793",backgroundColor:"#cccccc"},{btnKey:"c1cbc1d4e86d49a0981f54beea95280a-4412dc7a9f7b471a9a3e9a8fb625c793-footer-1",iconId:"rejection",part:"left",defaultActive:0,isrender:1,color:"#2C2C2C",themeId:"4412dc7a9f7b471a9a3e9a8fb625c793",backgroundColor:"#cccccc"},{btnKey:"c1cbc1d4e86d49a0981f54beea95280a-4412dc7a9f7b471a9a3e9a8fb625c793-footer-2",iconId:"answer",part:"left",defaultActive:0,isrender:1,themeId:"4412dc7a9f7b471a9a3e9a8fb625c793",backgroundColor:"#cccccc"},{btnKey:"c1cbc1d4e86d49a0981f54beea95280a-4412dc7a9f7b471a9a3e9a8fb625c793-footer-3",iconId:"remoteUnlock",part:"left",defaultActive:0,isrender:1,themeId:"4412dc7a9f7b471a9a3e9a8fb625c793",backgroundColor:"#cccccc"}]},onCall:{color:"#2c2c2c",backgroundColor:"#00000080",activeColor:"#1890FF",autoFocus:5,btnList:[{btnKey:"c1cbc1d4e86d49a0981f54beea95280a-4412dc7a9f7b471a9a3e9a8fb625c793-footer-0",iconId:"mute",part:"left",defaultActive:1,isrender:1,themeId:"4412dc7a9f7b471a9a3e9a8fb625c793",backgroundColor:"#cccccc"},{btnKey:"c1cbc1d4e86d49a0981f54beea95280a-4412dc7a9f7b471a9a3e9a8fb625c793-footer-1",iconId:"hangUp",part:"left",defaultActive:0,isrender:1,themeId:"4412dc7a9f7b471a9a3e9a8fb625c793",backgroundColor:"#cccccc"},{btnKey:"c1cbc1d4e86d49a0981f54beea95280a-4412dc7a9f7b471a9a3e9a8fb625c793-footer-2",iconId:"remoteUnlock",part:"left",defaultActive:0,isrender:1,themeId:"4412dc7a9f7b471a9a3e9a8fb625c793",backgroundColor:"#cccccc"}]}}},lt=function(e){var t="";return Object.keys(e).map((function(n,i){t+="".concat(n,":").concat(e[n]).concat(i<Object.keys(e).length-1?";":"")})),t},dt=function(){return m((function e(t,n,i,o){var a=this;l(this,e),p(this,"switchCallStatus",(function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=a.themeData,i=n.header,o=n.footer,r=null;if("onCall"==e){console.log("接听"),a.bellStatus="onCall",a.switchFooter("onCall"),o[a.bellStatus].btnList.map((function(e,t){e.isrender&&a.renderFooter(e.iconId,e),"mute"==e.iconId&&(r=e)})),i[a.bellStatus].btnList.map((function(e,t){e.isrender&&a.renderHeader(e.iconId,e)}));var s=document.getElementById("".concat(a.jSPlugin.id,"-header-onBell"));s&&s.parentElement.removeChild(s),1==a.themeData.customConfig.bellPoster&&document.getElementById("bellring-icon")&&document.getElementById("".concat(a.jSPlugin.id,"-wrap")).removeChild(document.getElementById("bellring-icon")),0==a.themeData.customConfig.defaultMicro&&r?a.muteCommon(r):a.setDecoderState({mute:!1},r.backgroundColor),a.removeBellRing(),a.miniRecCloseClick()}else console.log("响铃"),a.bellStatus="onBell",a.jSPlugin.Theme.changeTheme(a.themeData,t)})),p(this,"muteCommon",(function(e){var t=a.decoderState.state,n=t.talk,i=t.sound;n?(console.log("结束对讲"),a.setDecoderState({talk:!1,mute:!0},e.backgroundColor),a.jSPlugin.Talk.stopTalk(),i||a.jSPlugin.openSound()):(a.setDecoderState({talk:!1,mute:!0},e.backgroundColor),i||a.jSPlugin.openSound())})),p(this,"autoPlayRing",(function(){console.log("autoPlayRing");var e=document.getElementById("bellring-audio");e&&(e.muted=!1,e.src="https://resource.eziot.com/group2/M00/00/8F/CtwQFmPbWnOAGuT5AAHZihhCJEM230.mp3",e.paused&&e.play()),a.checkIsAppleDevice()||!1?window.removeEventListener("touchstart",a.autoPlayRing):window.removeEventListener("click",a.autoPlayRing)})),this.jSPlugin=t,this.videoWidth=t.width,this.videoHeight=t.height,this.themeData=n,this.setDecoderState=i,this.decoderState=o,this.isNeedRenderHeader=!1,this.isNeedRenderFooter=!1,this.autoFocus=0,this.autoFocusTimer=null,this.bellStatus="onBell",this.recordTimer=null,this.nextRate=1,this.themeInited=!1,this.inited=!1,this.miniRecStatus="rec",this.activeThemeStatus=!0,this.activeThemeStatusTxt="模板未激活",this.miniRecNum=0,this.toastCustom=new Je(t,!0)}),[{key:"initBellRing",value:function(){var e=this,t=this.decoderState.state,n=t.play,i=t.isEditing,o=this.videoWidth,a=o/375;this.maxBellTime=1e3*this.themeData.customConfig.maxBellTime;var r=document.getElementById("bellring"),s=document.getElementById("bellring-audio");if(!r&&!s){if(this.jSPlugin.isNeedBellRing){var c=document.createElement("div");c.id="bellring",c.innerHTML='<div>\n <audio id="bellring-audio" loop autoplay>\n <source src="https://resource.eziot.com/group2/M00/00/8F/CtwQFmPbWnOAGuT5AAHZihhCJEM230.mp3" type="audio/mpeg">\n </audio>\n </div>',document.getElementById("".concat(this.jSPlugin.id,"-wrap")).appendChild(c)}if(1!=this.themeData.customConfig.bellPoster||i)document.getElementById("bellring-icon")&&document.getElementById("".concat(this.jSPlugin.id,"-wrap")).removeChild(document.getElementById("bellring-icon"));else{var l=1.8*o,d=6;document.getElementById("".concat(this.jSPlugin.id,"-headControl"))&&(d=document.getElementById("".concat(this.jSPlugin.id,"-headControl")).offsetHeight+.1*l+6);var u=d+(this.videoHeight-130*a)/2,m=document.createElement("div");m.id="bellring-icon",m.style="position: absolute;pointer-events: none;background: none;width: 100%;\n position: absolute;top: ".concat(u,"px;display: flex;align-items: center;justify-content: center;"),m.innerHTML='<div style="width: '.concat(130*a,"px;height: ").concat(130*a,'px;display: flex;align-items: center;justify-content: center;border: 1px solid rgba(255,255,255,0.2);border-radius: 50%;">\n <div style="width: ').concat(80*a,"px;height: ").concat(80*a,'px;display: flex;align-items: center;justify-content: center;border: 1px solid rgba(255,255,255,0.3);border-radius: 50%;">\n <svg width="').concat(40*a,'px" height="').concat(40*a,'px" viewBox="0 0 40 40" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n <title>icon/响铃</title>\n <g id="icon/响铃" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n <polygon id="Path" points="0 0 40.0000002 0 40.0000002 40.0000002 0 40.0000002"></polygon>\n <path d="M20.0000001,4.25000002 C22.0363461,4.25000002 23.698175,5.84879552 23.8000507,7.8591997 L23.8050001,8.05500003 L23.805316,8.99953253 C27.1874196,9.97041766 29.6921839,13.0354462 29.80936,16.723731 L29.80936,16.723731 L29.8133335,16.9800001 L29.8133335,21.6416668 C29.8133335,22.3259481 30.0858837,22.9835569 30.5703302,23.4680033 L30.5703302,23.4680033 L31.6386635,24.5363367 C32.338953,25.2366262 32.760721,26.1675592 32.8273086,27.1785295 L32.8273086,27.1785295 L32.8350001,27.4233334 C32.8350001,29.577547 31.0892137,31.3233335 28.9350001,31.3233335 L28.9350001,31.3233335 L24.5666667,31.323 L24.5650266,31.3951531 C24.4527075,33.8194458 22.4520933,35.7500001 20.0000001,35.7500001 C17.5482065,35.7500001 15.5473098,33.8197367 15.4349743,31.3967059 L15.4326667,31.323 L11.0666667,31.3233335 C9.06159524,31.3233335 7.39851917,29.8069287 7.18810198,27.8229374 L7.17194359,27.6230185 L7.1666667,27.4233334 C7.1666667,26.3411154 7.59733134,25.3020086 8.36300328,24.5363367 L8.36300328,24.5363367 L9.43133662,23.4680033 C9.91578309,22.9835569 10.1883334,22.3259481 10.1883334,21.6416668 L10.1883334,21.6416668 L10.1883334,16.9800001 C10.1883334,13.1909619 12.7263704,9.99530436 16.1948593,8.99965364 L16.1950001,8.05500003 C16.1950001,5.95360729 17.8979654,4.25000002 20.0000001,4.25000002 Z M23.0656667,31.323 L16.9336667,31.323 L16.9352114,31.3619281 C17.0285826,32.9723844 18.3649772,34.2500001 20.0000001,34.2500001 C21.6352227,34.2500001 22.9714318,32.9721919 23.0647896,31.3604131 L23.0656667,31.323 Z M21.5116668,10.1783334 L18.4900001,10.1783334 C14.7336124,10.1783334 11.6883334,13.2231481 11.6883334,16.9800001 L11.6883334,16.9800001 L11.6883334,21.6416668 C11.6883334,22.7238848 11.2576687,23.7629916 10.4919968,24.5286635 L10.4919968,24.5286635 L9.42366346,25.5969969 C8.93921698,26.0814433 8.6666667,26.7390521 8.66637526,27.402427 L8.66637526,27.402427 L8.67048222,27.560237 C8.74130967,28.8268108 9.79171396,29.8233335 11.0666667,29.8233335 L11.0666667,29.8233335 L23.7906939,29.8222289 C23.8004164,29.8218553 23.8101862,29.8216668 23.8200001,29.8216668 L23.8486667,29.823 L28.9350001,29.8233335 C30.2055455,29.8233335 31.2450456,28.8367727 31.329826,27.609522 L31.3354106,27.4481422 L31.3293607,27.2529336 C31.2880301,26.6292837 31.0210852,26.0400787 30.5780034,25.5969969 L30.5780034,25.5969969 L29.50967,24.5286635 C28.7439981,23.7629916 28.3133335,22.7238848 28.3133335,21.6416668 L28.3133335,21.6416668 L28.3134279,16.9919039 L28.3098332,16.759466 C28.1934023,13.0970787 25.1864454,10.1783334 21.5116668,10.1783334 L21.5116668,10.1783334 Z M20.0000001,5.75000002 C18.7795808,5.75000002 17.7813801,6.69770708 17.7003155,7.89717688 L17.6950001,8.05500003 L17.6952875,8.7158769 C17.9568453,8.69103758 18.2219393,8.67833337 18.4900001,8.67833337 L18.4900001,8.67833337 L21.5116668,8.67833337 C21.7792577,8.67833337 22.0439466,8.69101238 22.3051575,8.71580951 L22.3050001,8.05500003 C22.3050001,6.7819079 21.273481,5.75000002 20.0000001,5.75000002 Z" id="形状结合" fill="#FFFFFF" fill-rule="nonzero"></path>\n </g>\n </svg>\n </div>\n </div>'),document.getElementById("".concat(this.jSPlugin.id,"-wrap")).appendChild(m),n&&"onBell"==this.bellStatus&&this.jSPlugin.pause()}setTimeout((function(){var t=e.decoderState.state,n=t.isEditing,i=t.rejection;"onBell"!=e.bellStatus||i||(e.removeBellRing(),n||e.answerOvertime())}),this.maxBellTime)}}},{key:"removeBellRing",value:function(){document.getElementById("bellring")&&document.getElementById("".concat(this.jSPlugin.id,"-wrap")).removeChild(document.getElementById("bellring")),document.getElementById("bellring-icon")&&document.getElementById("".concat(this.jSPlugin.id,"-wrap")).removeChild(document.getElementById("bellring-icon"))}},{key:"getMiniCallTimeUrl",value:function(){if(console.log("--------------getMiniCallTimeUrl"),-1!==this.jSPlugin.url.indexOf("hd.live")?this.recUrl=this.jSPlugin.url.replace("hd.live","rec"):this.recUrl=this.jSPlugin.url.replace("live","rec"),this.jSPlugin.callTime){var e=parseInt(this.jSPlugin.callTime),t=e+5e3,n=new Date(e-1e4).Format("yyyyMMddhhmmss"),i=new Date(t).Format("yyyyMMddhhmmss");this.recUrl="".concat(this.recUrl,"?begin=").concat(n,"&end=").concat(i),console.log("recurl="+this.recUrl)}}},{key:"initMiniRec",value:function(){var e=this,t=this,n=this.videoWidth,i=n/375,o=1.8*n,a=6;document.getElementById("".concat(this.jSPlugin.id,"-headControl"))&&(a=document.getElementById("".concat(this.jSPlugin.id,"-headControl")).offsetHeight+.1*o+6);var r=a+this.videoHeight+10*i;if(console.log(a),document.getElementById("miniRecbox"))document.getElementById("miniRecbox")&&document.getElementById("".concat(this.jSPlugin.id,"-wrap")).removeChild(document.getElementById("miniRecbox")),document.getElementById("miniClose")&&document.getElementById("".concat(this.jSPlugin.id,"-wrap")).removeChild(document.getElementById("miniClose")),this.initMiniRec();else{var s=document.createElement("div");s.id="miniRecbox",s.style="-webkit-border-radius: 8px;border-radius: 8px;overflow: hidden;position: absolute;top: ".concat(r,"px;right: ").concat(9*i,"px;"),s.innerHTML='<div id="miniRec"></div>',document.getElementById("".concat(this.jSPlugin.id,"-wrap")).appendChild(s),this.getMiniCallTimeUrl();var c={domain:W};this.miniRecPlayer=new zt({id:"miniRec",width:160*i,height:90*i,template:"miniRec",url:this.recUrl,token:this.jSPlugin.token,handleError:function(n){console.log("小窗口handleError------------",n),n&&6701==n.retcode?(e.miniRecNum=e.miniRecNum+1,console.log("小窗口miniRecNum-----------------",e.miniRecNum),e.miniRecNum<5?t.miniRecPlayer.changePlayUrl({type:"miniRec"}):(console.log("小窗口------------------已播放5次,关闭小窗口"),t.miniRecCloseClick())):(console.log("小窗口------------------播放失败,关闭小窗口"),t.miniRecCloseClick())},env:this.jSPlugin.env||c});var l=document.createElement("div");l.id="miniClose",l.style="position: absolute;top: ".concat(r+8,"px;right: ").concat(16*i,"px;"),l.innerHTML='<div id="miniClose-btn" style="width: '.concat(24*i,"px;height: ").concat(24*i,'px;display: flex;align-items: center;justify-content: center;border-radius: 50%;background: rgba(0,0,0,0.1);">\n <svg width="').concat(24*i,'px" height="').concat(24*i,'px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n <title>close</title>\n <g id="icon/close" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n <g id="common/Close/Dark">\n <rect id="Rectangle" x="0" y="0" width="24" height="24"></rect>\n <path d="M18.1871843,5.81281566 C18.4556698,6.08130112 18.4780436,6.50270075 18.2543057,6.7966719 L18.1871843,6.87347584 L13.0611458,12.0001458 L18.1871843,17.1265242 C18.4800776,17.4194174 18.4800776,17.8942911 18.1871843,18.1871843 C17.9186989,18.4556698 17.4972993,18.4780436 17.2033281,18.2543057 L17.1265242,18.1871843 L12.0001458,13.0611458 L6.87347584,18.1871843 C6.58058262,18.4800776 6.10570888,18.4800776 5.81281566,18.1871843 C5.54433021,17.9186989 5.52195643,17.4972993 5.7456943,17.2033281 L5.81281566,17.1265242 L10.9391458,12.0001458 L5.81281566,6.87347584 C5.51992245,6.58058262 5.51992245,6.10570888 5.81281566,5.81281566 C6.08130112,5.54433021 6.50270075,5.52195643 6.7966719,5.7456943 L6.87347584,5.81281566 L12.0001458,10.9391458 L17.1265242,5.81281566 C17.4194174,5.51992245 17.8942911,5.51992245 18.1871843,5.81281566 Z" id="形状结合" fill="#fff" fill-rule="nonzero"></path>\n </g>\n </g>\n </svg>\n </div>'),document.getElementById("".concat(this.jSPlugin.id,"-wrap")).appendChild(l),document.getElementById("miniClose-btn").onclick=function(){t.miniRecCloseClick()}}}},{key:"initMiniImageRec",value:function(){console.log("initMiniImageRec");var e=this.videoWidth/375,t=6;document.getElementById("".concat(this.jSPlugin.id,"-headControl"))&&(t=document.getElementById("".concat(this.jSPlugin.id,"-headControl")).offsetHeight+26);var n=t+this.videoHeight+10*e;if(document.getElementById("miniRecbox"))document.getElementById("miniRecbox").style.top=n+"px",document.getElementById("miniClose").style.top=n+8+"px";else{var i=document.createElement("div");i.id="miniRecbox",i.style="-webkit-border-radius: 8px;border-radius: 8px;overflow: hidden;position: absolute;\n top: ".concat(n,"px;\n right: ").concat(9*e,"px;\n user-select: none;\n "),i.innerHTML='<div id="miniRec" style="width: '.concat(160*e,"px;height: ").concat(90*e,'px;display: flex;align-items: center;justify-content: center;">\n <embed id="miniRec-embed" style="z-index: 3;position: absolute;width: ').concat(160*e,"px;height: ").concat(90*e,'px;" type="image/svg+xml" src="https://resource.eziot.com/group1/M00/00/B8/CtwQEmPbGh2AVJB-ABDcYtyw5gk899.svg" />\n <div style="color: #FFFFFF;font-size: 12px;z-index: 4;">示意小窗位置</div>\n </div>'),document.getElementById("".concat(this.jSPlugin.id,"-wrap")).appendChild(i);var o=document.createElement("div");o.id="miniClose",o.style="z-index: 4;position: absolute;top: ".concat(n+8,"px;right: ").concat(16*e,"px;"),o.innerHTML='<div id="miniClose-btn" style="width: '.concat(24*e,"px;height: ").concat(24*e,'px;display: flex;align-items: center;justify-content: center;border-radius: 50%;">\n <svg width="').concat(24*e,'px" height="').concat(24*e,'px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n <title>close</title>\n <g id="icon/close" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n <g id="common/Close/Dark">\n <rect id="Rectangle" x="0" y="0" width="24" height="24"></rect>\n <path d="M18.1871843,5.81281566 C18.4556698,6.08130112 18.4780436,6.50270075 18.2543057,6.7966719 L18.1871843,6.87347584 L13.0611458,12.0001458 L18.1871843,17.1265242 C18.4800776,17.4194174 18.4800776,17.8942911 18.1871843,18.1871843 C17.9186989,18.4556698 17.4972993,18.4780436 17.2033281,18.2543057 L17.1265242,18.1871843 L12.0001458,13.0611458 L6.87347584,18.1871843 C6.58058262,18.4800776 6.10570888,18.4800776 5.81281566,18.1871843 C5.54433021,17.9186989 5.52195643,17.4972993 5.7456943,17.2033281 L5.81281566,17.1265242 L10.9391458,12.0001458 L5.81281566,6.87347584 C5.51992245,6.58058262 5.51992245,6.10570888 5.81281566,5.81281566 C6.08130112,5.54433021 6.50270075,5.52195643 6.7966719,5.7456943 L6.87347584,5.81281566 L12.0001458,10.9391458 L17.1265242,5.81281566 C17.4194174,5.51992245 17.8942911,5.51992245 18.1871843,5.81281566 Z" id="形状结合" fill="#fff" fill-rule="nonzero"></path>\n </g>\n </g>\n </svg>\n </div>'),document.getElementById("".concat(this.jSPlugin.id,"-wrap")).appendChild(o),document.getElementById("miniClose-btn").onclick=function(){}}}},{key:"miniRecCloseClick",value:function(){document.getElementById("miniRecbox")&&(console.log("---------------------miniRecCloseClick"),"rec"==this.miniRecStatus&&(this.miniRecPlayer&&this.miniRecPlayer.stop(),document.getElementById("".concat(this.jSPlugin.id,"-wrap")).removeChild(document.getElementById("miniClose")),document.getElementById("".concat(this.jSPlugin.id,"-wrap")).removeChild(document.getElementById("miniRecbox"))))}},{key:"miniRecSwitchClick",value:function(){console.log("---------------小窗口切换");var e=this.decoderState.state.isEditing,t=this.videoWidth,n=t/375,i=1.8*t,o=6;document.getElementById("".concat(this.jSPlugin.id,"-headControl"))&&(o=document.getElementById("".concat(this.jSPlugin.id,"-headControl")).offsetHeight+.1*i+6),console.log("headerHeight-------",o);var a=o+this.videoHeight+10*n;if(console.log("videoTop-------",a),"rec"==this.miniRecStatus){this.miniRecStatus="live",e?(document.getElementById("miniRec-embed").style.width=this.jSPlugin.width+"px",document.getElementById("miniRec-embed").style.height=this.jSPlugin.height+"px",document.getElementById("miniRec").style.width=this.jSPlugin.width+"px",document.getElementById("miniRec").style.height=this.jSPlugin.height+"px"):this.miniRecPlayer.reSize(this.jSPlugin.width,this.jSPlugin.height),this.jSPlugin.reSize(160*n,90*n);var r=this.videoHeight+10*n,s=.2*i-90*n-10*n;document.getElementById("".concat(this.jSPlugin.id,"-wrap")).style.width=this.videoWidth+"px",document.getElementById("".concat(this.jSPlugin.id)).style.marginTop=r+"px",document.getElementById("".concat(this.jSPlugin.id)).style.marginLeft=t-160*n-9+"px",document.getElementById("".concat(this.jSPlugin.id)).style.overflow="hidden",document.getElementById("".concat(this.jSPlugin.id)).style.borderRadius="8px",document.getElementById("miniRecbox").style.top=o+"px",document.getElementById("miniRecbox").style.left="0",document.getElementById("miniRecbox").style.right="0",document.getElementById("miniRecbox").style.borderRadius="0px",document.getElementById("".concat(this.jSPlugin.id,"-ez-iframe-footer-container")).style.marginTop=s+"px"}else console.log(this.jSPlugin.width),this.miniRecStatus="rec",e?(document.getElementById("miniRec-embed").style.width=160*n+"px",document.getElementById("miniRec-embed").style.height=90*n+"px",document.getElementById("miniRec").style.width=160*n+"px",document.getElementById("miniRec").style.height=90*n+"px"):this.miniRecPlayer.reSize(160*n,90*n),this.jSPlugin.reSize(this.videoWidth,this.videoHeight),document.getElementById("".concat(this.jSPlugin.id,"-wrap")).style.width=this.videoWidth+NaN,document.getElementById("".concat(this.jSPlugin.id)).style.marginTop="0",document.getElementById("".concat(this.jSPlugin.id)).style.marginLeft="0",document.getElementById("".concat(this.jSPlugin.id)).style.overflow="hidden",document.getElementById("".concat(this.jSPlugin.id)).style.borderRadius="0px",document.getElementById("miniRecbox").style.top=a+"px",document.getElementById("miniRecbox").style.right="9px",document.getElementById("miniRecbox").style.left="auto",document.getElementById("miniRecbox").style.borderRadius="8px",document.getElementById("".concat(this.jSPlugin.id,"-ez-iframe-footer-container")).style.marginTop=.2*i+"px"}},{key:"matchBtn",value:function(e,t){var n=this,i=this.themeData,o=i.header,a=i.footer,r=this.decoderState.state,s=r.mute,c=r.rejection;document.documentElement.clientHeight;var l=this.videoWidth/375,d=this.videoWidth/375||1,u={title:"",id:"",domString:"",color:"#FFFFFF",activeColor:"#FFFFFF",onclick:function(){},onmoveleft:function(){},onmoveright:function(){},onremove:function(){}};-1===o[this.bellStatus].btnList.findIndex((function(t){return t.iconId===e}))?(u.color=a[this.bellStatus].color,u.backgroundColor=a[this.bellStatus].backgroundColor,u.activeColor=a[this.bellStatus].activeColor):(u.color=o[this.bellStatus].color,u.backgroundColor=o[this.bellStatus].backgroundColor,u.activeColor=o[this.bellStatus].activeColor);var m=this.videoWidth/4;switch(e){case"ringStatus":return u.title=this.activeThemeStatus?"有人按门铃":this.activeThemeStatusTxt,u.id=e,u.domString='<span id="header-onBell-ringStatus" style="color:'.concat(t.color||"#2C2C2C",";font-size: ").concat(24*d,'px;display: block;font-weight: 600;" >').concat(this.activeThemeStatus?"有人按门铃":this.activeThemeStatusTxt,"</span>"),u.onclick=function(){},u;case"deviceCategory":return u.title="设备名称",u.id=e,u.domString='<span id="header-onBell-deviceCategory" \n style="color:'.concat(t.color||"#2C2C2C",";\n font-size: ").concat(14*d,"px;\n padding-top: ").concat(5*d,'px;\n display: block;\n max-width: 100%;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n ">').concat(this.deviceInfoData&&this.deviceInfoData.deviceName||"设备名称","</span>"),u.onclick=function(){},u;case"callStatus":return u.title="通话中",u.id=e,u.domString='<span id="header-onCall-ringStatus" style="color:'.concat(t.color||"#2C2C2C",";font-size: ").concat(24*d,'px;display: block;font-weight: 600;" >通话中</span>'),u.onclick=function(){},u;case"deviceCategory":return u.title="设备名称",u.id=e,u.domString='<span id="header-onCall-deviceCategory" \n style="color:'.concat(t.color||"#2C2C2C",";\n font-size: ").concat(14*d,"px;\n padding-top: ").concat(5*d,'px;\n display: block;\n max-width: 100%;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n ">').concat(this.deviceInfoData&&this.deviceInfoData.deviceName||"设备名称","</span>"),u.onclick=function(){},u;case"rejection":return u.title="拒绝",u.id=e,u.domString='<div style="width: '.concat(.66*m,'px;display: flex;flex-direction: column;align-items: center;">\n <div style="width:').concat(.66*m,"px;height: ").concat(.66*m,"px;border-radius: 50%;background: ").concat(c?"#CCCCCC":t.backgroundColor,';display: flex;align-items: center;justify-content: center;" >\n <svg width="').concat(.4*m,'px" height="').concat(.4*m,'px" viewBox="0 0 36 36" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n <title>拒绝</title>\n <g id="icon/拒绝" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n <rect id="Rectangle" x="0" y="0" width="36" height="36"></rect>\n <path d="M16.0428281,19.9522968 C13.5228132,17.435123 11.1135994,14.5173605 12.2699084,13.3638925 C13.9205608,11.7132401 15.3581341,10.6961428 12.4346895,7.05675259 C9.50840386,3.41452132 7.55659974,6.21011849 5.95708632,7.80963191 C4.11324225,9.65631703 5.86049048,16.5345088 12.6591328,23.3359922 C19.4577751,30.1346345 26.3388079,31.8847238 28.1854931,30.0380386 C29.7850065,28.4385252 32.5806036,26.4895622 28.9412134,23.5632765 C25.3018232,20.6369909 24.2847259,22.0745642 22.6340735,23.7280576 C21.4777645,24.8786845 18.5628431,22.4694707 16.0428281,19.9522968 Z" id="路径" fill="#FFFFFF" fill-rule="nonzero" transform="translate(17.997936, 17.998157) rotate(135.000000) translate(-17.997936, -17.998157) "></path>\n </g>\n </svg>\n </div>\n <div style="margin-top: ').concat(.1*m,'px;user-select: none;">拒绝</div>\n </div>'),u.onclick=function(){var e=n,t=n.decoderState.state,i=t.play,o=t.isEditing,a=t.rejection;if(o||a)return!1;console.log("拒绝"),i&&n.jSPlugin.stop(),n.removeBellRing(),n.setDecoderState({play:!1,rejection:!0}),e.miniRecCloseClick(),n.rejectionStatusDispose(),"function"==typeof n.jSPlugin.hangUpCallback&&n.jSPlugin.hangUpCallback("rejection")},u;case"quickReply":return u.title="快捷回复",u.id=e,u.domString='<div id="'.concat(this.jSPlugin.id,'-btn-quickReply" style="width: ').concat(126*l,"px;height: ").concat(40*l,"px;color:").concat(c?"rgba(44,44,44,0.5)":u.color,';background: #F8F8F8;border-radius: 20px;display: flex;flex-direction: row;align-items: center;justify-content: center;-webkit-tap-highlight-color:transparent;">\n <div>\n <svg width="').concat(24*l,'px" height="').concat(24*l,'px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n <title>快捷回复</title>\n <g id="icon/H5快捷回复" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n <rect id="Rectangle" x="0" y="0" width="24" height="24"></rect>\n <path d="M10.7238197,2.25008794 C16.2230834,2.09766093 20.7496,6.50749909 20.7496,11.9958 C20.7496,13.4362841 20.4368194,14.8344518 19.8413577,16.1117061 L19.9440524,15.8792521 L21.0527769,21.184554 C21.1496277,21.6485507 20.8013031,22.0657304 20.3577211,22.0873894 L20.2613374,22.0858497 L20.1628027,22.0714397 L14.866,20.946 L14.7518767,20.9973203 C13.6930577,21.439776 12.5585243,21.69208 11.3902258,21.7381162 L11.3902258,21.7381162 L10.9996,21.7458 C5.51196728,21.7458 1.10147008,17.2189531 1.25388722,11.7200456 C1.39490345,6.62610538 5.62990538,2.39110345 10.7238197,2.25008794 Z M11.0183931,3.74628651 L10.7653544,3.74951278 C6.46729462,3.86849655 2.87229655,7.46349462 2.75331206,11.7615803 C2.62431432,16.4155628 6.35610614,20.2458 10.9996,20.2458 C12.2165433,20.2458 13.3936843,19.9831552 14.4692454,19.4827855 C14.6166569,19.4142071 14.7823612,19.395387 14.9413973,19.4291603 L14.9413973,19.4291603 L19.349,20.365 L18.4274231,15.948046 C18.4026128,15.8291836 18.4071487,15.7066932 18.4398273,15.5909727 L18.4398273,15.5909727 L18.4818423,15.4778939 C18.9851908,14.3982208 19.2496,13.216279 19.2496,11.9958 C19.2496,7.35166383 15.4197191,3.62050444 10.7653544,3.74951278 Z M10.9996,10.7498 C11.6896,10.7498 12.2496,11.3098 12.2496,11.9998 C12.2496,12.6898 11.6896,13.2498 10.9996,13.2498 C10.3096,13.2498 9.7496,12.6898 9.7496,11.9998 C9.7496,11.3098 10.3096,10.7498 10.9996,10.7498 Z M6.9996,10.7498 C7.6896,10.7498 8.2496,11.3098 8.2496,11.9998 C8.2496,12.6898 7.6896,13.2498 6.9996,13.2498 C6.3096,13.2498 5.7496,12.6898 5.7496,11.9998 C5.7496,11.3098 6.3096,10.7498 6.9996,10.7498 Z M14.9996,10.7498 C15.6896,10.7498 16.2496,11.3098 16.2496,11.9998 C16.2496,12.6898 15.6896,13.2498 14.9996,13.2498 C14.3096,13.2498 13.7496,12.6898 13.7496,11.9998 C13.7496,11.3098 14.3096,10.7498 14.9996,10.7498 Z" id="形状结合" fill="').concat(c?"rgba(44,44,44,0.5)":"#2c2c2c",'" fill-rule="nonzero"></path>\n </g>\n </svg>\n </div>\n <div style="margin-left: 5px;user-select: none;font-size:14px">快捷回复<div>\n </div>'),u.onclick=function(){var e=n.decoderState.state,t=e.isEditing,i=e.rejection;if(t||i)return!1;console.log("快捷回复"),n.switchFooter("quickReply"),n.quickReplyEle=new rt(n.jSPlugin,n.switchFooter,n.videoWidth)},u;case"answer":return u.title="接听",u.id=e,u.domString='<div style="width: '.concat(.66*m,'px;display: flex;flex-direction: column;align-items: center;">\n <div style="width: ').concat(.66*m,"px;height: ").concat(.66*m,"px;border-radius: 50%;background: ").concat(c?"#CCCCCC":t.backgroundColor,';display: flex;align-items: center;justify-content: center;" >\n <svg width="').concat(.4*m,'px" height="').concat(.4*m,'px" viewBox="0 0 36 36" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n <title>接听</title>\n <g id="icon/接听" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n <rect id="Rectangle" x="0" y="0" width="36" height="36"></rect>\n <path d="M15.7728281,19.6822968 C13.2528132,17.165123 10.8435994,14.2473605 11.9999084,13.0938925 C13.6505608,11.4432401 15.0881341,10.4261428 12.1646895,6.78675259 C9.23840386,3.14452132 7.28659974,5.94011849 5.68708632,7.53963191 C3.84324225,9.38631703 5.59049048,16.2645088 12.3891328,23.0659922 C19.1877751,29.8646345 26.0688079,31.6147238 27.9154931,29.7680386 C29.5150065,28.1685252 32.3106036,26.2195622 28.6712134,23.2932765 C25.0318232,20.3669909 24.0147259,21.8045642 22.3640735,23.4580576 C21.2077645,24.6086845 18.2928431,22.1994707 15.7728281,19.6822968 Z" id="路径" fill="#FFFFFF" fill-rule="nonzero" transform="translate(17.727936, 17.728157) rotate(-360.000000) translate(-17.727936, -17.728157) "></path>\n </g>\n </svg>\n </div>\n <div style="margin-top: ').concat(.1*m,'px;user-select: none;">接听</div>\n </div>'),u.onclick=function(){var e=n,i=n.decoderState.state,r=i.play,s=i.isEditing,c=i.talk,l=i.sound,d=i.rejection;if(s||d)return!1;console.log("接听"),n.jSPlugin.pluginStatus.loadingClear(),n.bellStatus="onCall",n.switchFooter("onCall"),a[n.bellStatus].btnList.map((function(e,t){e.isrender&&n.renderFooter(e.iconId,e)})),o[n.bellStatus].btnList.map((function(e,t){e.isrender&&n.renderHeader(e.iconId,e)}));var u=document.getElementById("".concat(n.jSPlugin.id,"-header-onBell"));u&&u.parentElement.removeChild(u),1==n.themeData.customConfig.bellPoster&&(document.getElementById("bellring-icon")&&document.getElementById("".concat(n.jSPlugin.id,"-wrap")).removeChild(document.getElementById("bellring-icon")),n.jSPlugin.setPoster("")),n.removeBellRing(),n.miniRecCloseClick(),r||(n.jSPlugin.pluginStatus.loadingStart(n.jSPlugin.id),n.jSPlugin.pluginStatus.loadingSetText({text:"视频加载中"}),n.jSPlugin.play(),n.setDecoderState({play:!r})),c||1!=n.themeData.customConfig.defaultMicro||(n.setDecoderState({talk:!0,mute:!1}),l&&n.jSPlugin.closeSound(),n.jSPlugin.Talk.startTalk()),n.setDecoderState({sound:!1}),0==n.themeData.customConfig.defaultMicro&&(n.muteCommon(t),n.jSPlugin.openSound()),n.maxTalkTime=1e3*n.themeData.customConfig.maxTalkTime*60,setTimeout((function(){c&&(console.log("结束对讲"),e.setDecoderState({talk:!1}),e.jSPlugin.Talk.stopTalk()),r&&(e.jSPlugin.stop(),e.setDecoderState({play:!r})),n.rejectionStatusDispose(),n.remoteUnlockEle&&n.remoteUnlockEle.closeRemoteUnlock(),"function"==typeof n.jSPlugin.hangUpCallback&&n.jSPlugin.hangUpCallback("hangUp")}),n.maxTalkTime)},u;case"remoteUnlock":return u.title="远程开锁",u.id=e,u.domString='<div style="width: '.concat(.66*m,'px;display: flex;flex-direction: column;align-items: center;">\n <div style="width: ').concat(.66*m,"px;height: ").concat(.66*m,"px;border-radius: 50%;background: ").concat(c?"#CCCCCC":t.backgroundColor,';display: flex;align-items: center;justify-content: center;" >\n <svg width="').concat(.4*m,'px" height="').concat(.4*m,'px" viewBox="0 0 36 36" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n <title>开锁</title>\n <g id="icon/开锁" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n <rect id="Rectangle" x="0" y="0" width="36" height="36"></rect>\n <path d="M18,4 C21.3137085,4 24,6.6862915 24,10 L24,10 L24,19.787 L29.5,19.7875 C30.0522847,19.7875 30.5,20.2352153 30.5,20.7875 C30.5,21.3397847 30.0522847,21.7875 29.5,21.7875 L24,21.787 L24,26 C24,29.2383969 21.4344251,31.8775718 18.2249383,31.9958615 L18,32 C14.6862915,32 12,29.3137085 12,26 L12,26 L12,10 C12,6.6862915 14.6862915,4 18,4 Z M18,6 C15.790861,6 14,7.790861 14,10 L14,10 L14,26 C14,28.209139 15.790861,30 18,30 C20.209139,30 22,28.209139 22,26 L22,26 L22,21.787 L18.5,21.7875 C17.9477153,21.7875 17.5,21.3397847 17.5,20.7875 C17.5,20.2352153 17.9477153,19.7875 18.5,19.7875 L22,19.787 L22,10 C22,7.85780461 20.3160315,6.10892112 18.1996403,6.00489531 Z" id="形状结合" fill="#FFFFFF" fill-rule="nonzero"></path>\n </g>\n </svg>\n </div>\n <div style="margin-top: ').concat(.1*m,'px;user-select: none;">远程开锁</div>\n </div>'),u.onclick=function(){var e=n.decoderState.state,t=e.isEditing;e.play;var i=e.rejection;if(t||"onBell"==n.bellStatus||i)return!1;console.log("远程开锁"),n.switchFooter("remoteUnlock"),n.remoteUnlockEle=new st(n.jSPlugin,n.switchFooter,n.videoWidth)},u;case"mute":return u.title="静音",u.id=e,u.domString='<div style="width: '.concat(.66*m,'px;display: flex;flex-direction: column;align-items: center;">\n <div id="').concat(this.jSPlugin.id,'-icon-mute" style="width: ').concat(.66*m,"px;height: ").concat(.66*m,"px;border-radius: 50%;border: 1px solid ").concat(c?"#cccccc":t.backgroundColor,";background: ").concat(c&&s?"#cccccc":"#ffffff",';display: flex;align-items: center;justify-content: center;" >\n <svg width="').concat(.4*m,'px" height="').concat(.4*m,'px" viewBox="0 0 36 36" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n <title>icon/静音</title>\n <g id="icon/静音" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n <rect id="Rectangle" x="0" y="0" width="36" height="36"></rect>\n <path id="icon-mute-path" d="M29.2988305,7.56559704 C29.8540627,8.1086468 29.8980234,8.97727504 29.4240597,9.57172938 L29.3223594,9.6867869 L22.585,16.574 L22.5859243,26.0592702 C22.5859243,26.9500521 21.8638029,27.6721735 20.973021,27.6721735 C20.6007147,27.6721735 20.2398727,27.5433734 19.9517149,27.3076254 L15.583,23.733 L10.4341733,28.9987008 C9.85492024,29.5909486 8.9052312,29.6014828 8.31298346,29.0222298 C7.75775121,28.47918 7.71379057,27.6105518 8.18775419,27.0160974 L8.28945454,26.9010399 L27.1776406,7.58912597 C27.7568937,6.99687823 28.7065827,6.98634397 29.2988305,7.56559704 Z M22.2503608,7.16816759 C22.4679282,7.45036017 22.5859243,7.79665625 22.5859243,8.15298221 L22.585,9.899 L10.778,21.971 L9.47580645,21.9713498 C7.69424274,21.9713498 6.25,20.5271071 6.25,18.7455434 L6.25,15.65293 C6.25,13.8713663 7.69424274,12.4271235 9.47580645,12.4271235 L12.787,12.427 L19.9882064,6.87564241 C20.6936617,6.33174431 21.7064627,6.46271229 22.2503608,7.16816759 Z" id="形状结合" fill="').concat(s?"#ffffff":c?"#cccccc":t.backgroundColor,'"></path>\n </g>\n </svg>\n </div>\n <div style="margin-top: ').concat(.1*m,'px;user-select: none;">静音</div>\n </div>'),u.onclick=function(){var e=n.decoderState.state,i=e.talk,o=e.sound;if(e.play,e.rejection)return!1;console.log("静音"),i?(console.log("结束对讲"),n.setDecoderState({talk:!1,mute:!0},t.backgroundColor),n.jSPlugin.Talk.stopTalk(),n.jSPlugin.openSound()):(console.log("开始对讲"),n.setDecoderState({talk:!0,mute:!1},t.backgroundColor),o&&(n.jSPlugin.closeSound(),n.setDecoderState({sound:!1})),n.jSPlugin.Talk.startTalk())},u;case"hangUp":return u.title="挂断",u.id=e,u.domString='<div style="width: '.concat(.66*m,'px;display: flex;flex-direction: column;align-items: center;">\n <div style="width:').concat(.66*m,"px;height: ").concat(.66*m,"px;border-radius: 50%;background: ").concat(c?"#CCCCCC":t.backgroundColor,';display: flex;align-items: center;justify-content: center;" >\n <svg width="').concat(.4*m,'px" height="').concat(.4*m,'px" viewBox="0 0 36 36" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n <title>挂断</title>\n <g id="icon/挂断" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n <rect id="Rectangle" x="0" y="0" width="36" height="36"></rect>\n <path d="M16.0428281,19.9522968 C13.5228132,17.435123 11.1135994,14.5173605 12.2699084,13.3638925 C13.9205608,11.7132401 15.3581341,10.6961428 12.4346895,7.05675259 C9.50840386,3.41452132 7.55659974,6.21011849 5.95708632,7.80963191 C4.11324225,9.65631703 5.86049048,16.5345088 12.6591328,23.3359922 C19.4577751,30.1346345 26.3388079,31.8847238 28.1854931,30.0380386 C29.7850065,28.4385252 32.5806036,26.4895622 28.9412134,23.5632765 C25.3018232,20.6369909 24.2847259,22.0745642 22.6340735,23.7280576 C21.4777645,24.8786845 18.5628431,22.4694707 16.0428281,19.9522968 Z" id="路径" fill="#FFFFFF" fill-rule="nonzero" transform="translate(17.997936, 17.998157) rotate(135.000000) translate(-17.997936, -17.998157) "></path>\n </g>\n </svg>\n </div>\n <div style="margin-top: ').concat(.1*m,'px;user-select: none;">挂断</div>\n </div>'),u.onclick=function(){var e=n,t=n.decoderState.state,i=t.talk,o=t.play;if(t.rejection)return!1;i&&(console.log("结束对讲"),n.setDecoderState({talk:!1}),n.jSPlugin.Talk.stopTalk()),o&&(n.jSPlugin.stop(),n.setDecoderState({play:!o})),(o||i)&&(e.miniRecCloseClick(),console.log("挂断"),n.rejectionStatusDispose(),"function"==typeof n.jSPlugin.hangUpCallback&&n.jSPlugin.hangUpCallback("hangUp"))},u;default:return u}}},{key:"answerOvertime",value:function(){this.toastCustom.initToastContent("应答超时");var e=this.decoderState.state.play;console.log("应答超时"),e&&this.jSPlugin.stop(),this.setDecoderState({play:!1,rejection:!0}),this.miniRecCloseClick(),this.rejectionStatusDispose(),this.quickReplyEle&&this.quickReplyEle.closeQuickReplyEle(),"function"==typeof this.jSPlugin.hangUpCallback&&this.jSPlugin.hangUpCallback("rejection")}},{key:"rejectionStatusDispose",value:function(){var e=this,t=this.themeData.footer,n=document.getElementById("".concat(this.jSPlugin.id,"-audioControls")),i=document.getElementById("".concat(this.jSPlugin.id,"-audioControls-onCall")),o=document.getElementById("".concat(this.jSPlugin.id,"-audioControls-quickReplyBtn")),a=document.getElementById("header-".concat(this.bellStatus,"-ringStatus"));"onBell"==this.bellStatus?(n.innerHTML="",o.innerHTML="",n.style.color="#2C2C2C"):(i.innerHTML="",i.style.color="#2C2C2C"),console.log("rejectionStatusDispose"),this.setDecoderState({rejection:!0}),t[this.bellStatus].btnList.map((function(t,n){t.isrender&&e.renderFooter(t.iconId,t)})),a.innerText="通话已结束",this.jSPlugin.pluginStatus.loadingClear(),this.jSPlugin.pluginStatus.loadingSetTextWithBtn({text:"通话已结束",color:"white",isMobile:!0,type:2})}},{key:"userNoDevice",value:function(){var e=this;this.removeBellRing(),this.setDecoderState({rejection:!0});var t=this.themeData.footer,n=document.getElementById("".concat(this.jSPlugin.id,"-audioControls")),i=document.getElementById("".concat(this.jSPlugin.id,"-audioControls-onCall")),o=document.getElementById("".concat(this.jSPlugin.id,"-audioControls-quickReplyBtn"));"onBell"==this.bellStatus?(n.innerHTML="",o.innerHTML="",n.style.color="#2C2C2C"):(i.innerHTML="",i.style.color="#2C2C2C"),console.log("userNoDevice"),this.setDecoderState({rejection:!0}),t[this.bellStatus].btnList.map((function(t,n){t.isrender&&e.renderFooter(t.iconId,t)})),this.jSPlugin.pluginStatus.loadingClear(),this.jSPlugin.pluginStatus.loadingSetTextWithBtn({text:"该用户不拥有该设备",color:"white",isMobile:!0,type:2})}},{key:"renderHeader",value:function(e,t){var n=this,i=this.matchBtn(e,t);if(document.getElementById("".concat(this.jSPlugin.id,"-header-").concat(this.bellStatus,"-content"))){var o=document.createElement("span");o.innerHTML="".concat(i.domString),document.getElementById("".concat(this.jSPlugin.id,"-header-").concat(this.bellStatus,"-content")).appendChild(o)}else{var a=document.createElement("div");a.id="".concat(this.jSPlugin.id,"-header-").concat(this.bellStatus),a.style="max-width:50%;position:relative;",a.innerHTML='<span id="'.concat(this.jSPlugin.id,"-header-").concat(this.bellStatus,'-content" style="display:inline-block;height:auto;";>\n ').concat(i.domString,"\n </span>"),a.onclick=function(e){if(n.decoderState.state.isEditing)return!1;i.onclick(e)},document.getElementById("".concat(this.jSPlugin.id,"-headControl")).childNodes[0].appendChild(a)}}},{key:"renderFooter",value:function(e,t){var n=this,i=this.decoderState.state.mute;if("remoteUnlock"==e&&this.jSPlugin.capacity&&(!this.jSPlugin.capacity.support_unlock||0==this.jSPlugin.capacity.support_unlock))return!1;var o=this.matchBtn(e,t),a=this.videoWidth/4,r=document.createElement("div");if(r.className="theme-icon-item","quickReply"!==o.id&&(r.style="width:".concat(.66*a,"px;padding:0 ").concat(.12*a,"px;box-sizing: content-box;-webkit-tap-highlight-color:transparent;")),r.innerHTML="".concat('<span id="'.concat(this.jSPlugin.id,"-").concat(o.id,'" style="position:relative;">')+'<div id="'.concat(this.jSPlugin.id,"-").concat(o.id,'-content" title="').concat(o.title,'" style="display: flex;align-items: center;position:relative;">')).concat(o.domString,"</div>")+"</span>",r.onclick=function(e){if(n.decoderState.state.isEditing||!n.activeThemeStatus)return!1;o.onclick(e)},o.onmouseenter&&(r.onmouseenter=function(e){if(n.decoderState.state.isEditing||!n.activeThemeStatus)return!1;o.onmouseenter(e)}),o.onmouseleave&&(r.onmouseleave=function(e){if(n.decoderState.state.isEditing||!n.activeThemeStatus)return!1;o.onmouseleave(e)}),"quickReply"!=e){var s=document.createElement("span");s.className="icon-move left",s.innerHTML='<span id="'.concat(this.jSPlugin.id,"-").concat(o.id,'-left" title="左移" style="height: 40px;position: absolute;top: calc(50% - 33px);left: 1px;display: inline-block;border-radius: 2px;overflow: hidden;cursor: pointer;">\n <svg width="10px" height="40px" viewBox="0 0 10 40" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n <title></title>\n <g id="呼叫模板-控制台" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n <g id="H5呼叫模板" transform="translate(-614.000000, -5024.000000)">\n <g id="编组-28" transform="translate(421.000000, 4484.000000)">\n <g id="编组-9" transform="translate(23.000000, 522.000000)">\n <g id="编组" transform="translate(170.000000, 0.000000)">\n <g id="箭头左" transform="translate(0.000000, 18.000000)">\n <rect id="矩形" fill="#595959" x="0" y="0" width="10" height="40" rx="2"></rect>\n <g id="1.通用/2.Icon图标/Common/Fill/Left" transform="translate(1.000000, 15.000000)" fill="#FFFFFF">\n <path d="M3.88411064,2.46093277 L7.81658983,7.1799078 C7.99337187,7.39204625 7.96470984,7.7073286 7.75257139,7.88411064 C7.66271389,7.95899189 7.54944745,8 7.43247919,8 L-0.432479194,8 C-0.708621569,8 -0.932479194,7.77614237 -0.932479194,7.5 C-0.932479194,7.38303175 -0.891471084,7.2697653 -0.816589833,7.1799078 L3.11588936,2.46093277 C3.2926714,2.24879432 3.60795375,2.22013229 3.8200922,2.39691433 C3.84332373,2.41627394 3.86475103,2.43770124 3.88411064,2.46093277 Z" id="三角形" transform="translate(3.500000, 5.000000) scale(-1, -1) rotate(-270.000000) translate(-3.500000, -5.000000) "></path>\n </g>\n </g>\n </g>\n </g>\n </g>\n </g>\n </g>\n </svg>\n </span>'),s.onclick=function(){n.editIcon(o.id,"left","footer")},r.appendChild(s);var c=document.createElement("span");c.className="icon-move right",c.innerHTML='<span id="'.concat(this.jSPlugin.id,"-").concat(o.id,'-right" class="ezuikit-theme-icon" title="右移" style="height: 40px;position: absolute;top: calc(50% - 33px);left: calc(100% - 11px);display: inline-block;border-radius: 2px;overflow: hidden;cursor: pointer;">\n <svg width="10px" height="40px" viewBox="0 0 10 40" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n <title></title>\n <g id="呼叫模板-控制台" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n <g id="H5呼叫模板" transform="translate(-684.000000, -5024.000000)">\n <g id="编组-28" transform="translate(421.000000, 4484.000000)">\n <g id="编组-9" transform="translate(23.000000, 522.000000)">\n <g id="编组" transform="translate(170.000000, 0.000000)">\n <g id="箭头右" transform="translate(70.000000, 18.000000)">\n <rect id="矩形" fill="#595959" x="0" y="0" width="10" height="40" rx="2"></rect>\n <g id="1.通用/2.Icon图标/Common/Fill/Left" transform="translate(5.500000, 20.000000) scale(-1, 1) translate(-5.500000, -20.000000) translate(2.000000, 15.000000)" fill="#FFFFFF">\n <path d="M3.88411064,2.46093277 L7.81658983,7.1799078 C7.99337187,7.39204625 7.96470984,7.7073286 7.75257139,7.88411064 C7.66271389,7.95899189 7.54944745,8 7.43247919,8 L-0.432479194,8 C-0.708621569,8 -0.932479194,7.77614237 -0.932479194,7.5 C-0.932479194,7.38303175 -0.891471084,7.2697653 -0.816589833,7.1799078 L3.11588936,2.46093277 C3.2926714,2.24879432 3.60795375,2.22013229 3.8200922,2.39691433 C3.84332373,2.41627394 3.86475103,2.43770124 3.88411064,2.46093277 Z" id="三角形" transform="translate(3.500000, 5.000000) scale(-1, -1) rotate(-270.000000) translate(-3.500000, -5.000000) "></path>\n </g>\n </g>\n </g>\n </g>\n </g>\n </g>\n </g>\n </svg>\n </span>'),c.onclick=function(){n.editIcon(o.id,"right","footer")},r.appendChild(c)}if("answer"==e||"rejection"==e||"hangUp"==e);else{var l=document.createElement("span");l.className="icon-move close",l.innerHTML='<span id="'.concat(o.id,'-remove" class="ezuikit-theme-icon" title="移除" style="position: absolute;top: -6px;right: -2px;cursor: pointer;">\n <svg width="16px" height="16px" viewBox="0 0 18 18" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n <title></title>\n <g id="呼叫模板-控制台" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n <g id="H5呼叫模板" transform="translate(-680.000000, -5006.000000)">\n <g id="编组-28" transform="translate(421.000000, 4484.000000)">\n <g id="编组-9" transform="translate(23.000000, 522.000000)">\n <g id="编组" transform="translate(170.000000, 0.000000)">\n <g id="关闭1" transform="translate(66.000000, 0.000000)">\n <rect id="矩形" fill-rule="nonzero" x="0" y="0" width="18" height="18"></rect>\n <path d="M9,1.125 C4.65117188,1.125 1.125,4.65117188 1.125,9 C1.125,13.3488281 4.65117188,16.875 9,16.875 C13.3488281,16.875 16.875,13.3488281 16.875,9 C16.875,4.65117188 13.3488281,1.125 9,1.125 Z M11.9074219,11.9917969 L10.7472656,11.9865234 L9,9.90351562 L7.25449219,11.9847656 L6.09257813,11.9900391 C6.01523438,11.9900391 5.95195313,11.9285156 5.95195313,11.8494141 C5.95195313,11.8160156 5.96425781,11.784375 5.98535156,11.7580078 L8.27226563,9.03339844 L5.98535156,6.31054687 C5.96425781,6.28417969 5.95195313,6.25253906 5.95195313,6.21914062 C5.95195313,6.14179687 6.01523438,6.07851562 6.09257813,6.07851562 L7.25449219,6.08378906 L9,8.16679687 L10.7455078,6.08554688 L11.9056641,6.08027344 C11.9830078,6.08027344 12.0462891,6.14179687 12.0462891,6.22089844 C12.0462891,6.25429687 12.0339844,6.2859375 12.0128906,6.31230469 L9.72949219,9.03515625 L12.0146484,11.7597656 C12.0357422,11.7861328 12.0480469,11.8177734 12.0480469,11.8511719 C12.0480469,11.9285156 11.9847656,11.9917969 11.9074219,11.9917969 Z" id="形状" fill="#595959"></path>\n </g>\n </g>\n </g>\n </g>\n </g>\n </g>\n </svg>\n </span>'),l.onclick=function(){n.editIcon(o.id,"delete","footer")},r.appendChild(l)}"onCall"==this.bellStatus?document.getElementById("".concat(this.jSPlugin.id,"-audioControls-onCall")).appendChild(r):(document.getElementById("".concat(this.jSPlugin.id,"-audioControls")).appendChild(r),"quickReply"===o.id&&document.getElementById("".concat(this.jSPlugin.id,"-audioControls-quickReplyBtn")).appendChild(r)),this.decoderState.state.isEditing&&"mute"==e&&"onCall"==this.bellStatus&&(0!=this.themeData.customConfig.defaultMicro||i?this.setDecoderState({mute:!1},t.backgroundColor):this.setDecoderState({mute:!0},t.backgroundColor))}},{key:"switchFooter",value:function(e){var t=this.themeData.footer;switch(e){case"onBell":document.getElementById("".concat(this.jSPlugin.id,"-audioControls-onCall"))?"none"==document.getElementById("".concat(this.jSPlugin.id,"-audioControls-onCall")).style.display&&(document.getElementById("".concat(this.jSPlugin.id,"-audioControls")).style.display="flex",document.getElementById("".concat(this.jSPlugin.id,"-audioControls-quickReplyBtn")).style.display="flex",document.getElementById("".concat(this.jSPlugin.id,"-btn-quickReply")).style.display="flex"):(document.getElementById("".concat(this.jSPlugin.id,"-audioControls")).style.display="flex",document.getElementById("".concat(this.jSPlugin.id,"-audioControls-quickReplyBtn")).style.display="flex",document.getElementById("".concat(this.jSPlugin.id,"-btn-quickReply")).style.display="flex");break;case"onCall":document.getElementById("".concat(this.jSPlugin.id,"-audioControls")).style.display="none",document.getElementById("".concat(this.jSPlugin.id,"-btn-quickReply")).style.display="none",document.getElementById("".concat(this.jSPlugin.id,"-audioControls-onCall")).style.display="flex",this.themeData&&(document.getElementById("".concat(this.jSPlugin.id,"-audioControls-onCall")).style.color=t[this.bellStatus].color)}}},{key:"initThemeData",value:function(){var e=this;console.log("-------------initThemeData");var t=this.themeData,n=t.header,o=t.footer,a=this.decoderState.state.isEditing,r=this.videoWidth,s=r/375,c=1.8*r,l=this.jSPlugin.id;if(this.isNeedRenderHeader=i.findIndex(n[this.bellStatus].btnList,(function(e){return e.isrender>0}))>=0,this.isNeedRenderFooter=i.findIndex(o[this.bellStatus].btnList,(function(e){return e.isrender>0}))>=0,this.isNeedRenderHeader)if(document.getElementById("".concat(this.jSPlugin.id,"-headControl")))document.getElementById("".concat(this.jSPlugin.id,"-headControl")).innerHTML="<div id='".concat(this.jSPlugin.id,"-headControl-left' style='display:flex;width:100%;overflow:hidden;justify-content: center;'></div>");else{var d=document.createElement("div");d.setAttribute("id","".concat(this.jSPlugin.id,"-headControl")),d.setAttribute("class","header-controls"),d.innerHTML="<div id='".concat(this.jSPlugin.id,"-headControl-left' class=\"header-controls-left\" style='display:flex;width:100%;overflow:hidden;justify-content: center;'></div>"),console.log(this.jSPlugin.height),this.jSPlugin.height;var u=p(p({display:"flex","justify-content":"space-between",top:0,"z-index":999,color:"#FFFFFF",width:"100%",position:"relative","margin-bottom":.1*c+"px","align-items":"center","text-align":"center","font-size":"24ox"},"color","#2c2c2c"),"margin-top","6px");d.style=lt(u),document.getElementById("".concat(l,"-wrap")).insertBefore(d,document.getElementById(l));var m=setInterval((function(){window.EZUIKit[e.jSPlugin.id].state.EZUIKitPlayer.init&&clearInterval(m)}),50)}else document.getElementById("".concat(this.jSPlugin.id,"-headControl"))&&document.getElementById("".concat(this.jSPlugin.id,"-headControl")).parentElement.removeChild(document.getElementById("".concat(this.jSPlugin.id,"-headControl")));if(this.jSPlugin.height,this.isNeedRenderFooter)if(document.getElementById("".concat(this.jSPlugin.id,"-ez-iframe-footer-container")))document.getElementById("".concat(this.jSPlugin.id,"-ez-iframe-footer-container"))&&(document.getElementById("".concat(this.jSPlugin.id,"-ez-iframe-footer-container")).style.marginTop="".concat(.2*c,"px"),"onCall"==this.bellStatus?document.getElementById("".concat(this.jSPlugin.id,"-ez-iframe-footer-container")).innerHTML='\n <div id="'.concat(this.jSPlugin.id,'-audioControls-quickReplyBtn" class="footer-controls" style=\'min-height: ').concat(40*s,"px;margin-bottom: ").concat(40*s,"px;display:flex;justify-content: center;width:100%;z-index:999;position: relative;'></div>\n <div id=\"").concat(this.jSPlugin.id,'-audioControls" class="footer-controls" style=\'display:none;justify-content: space-around;padding: 0 8%;width:100%;z-index:999;position: relative;\'></div>\n <div id="').concat(this.jSPlugin.id,'-audioControls-onCall" class="footer-controls" style=\'display:flex;justify-content: space-around;padding: 0 8%;width:100%;z-index:999;position: relative;\'></div>\n <div id="').concat(this.jSPlugin.id,'-audioControls-quickReply" class="footer-controls" style=\'display:none;justify-content: center;width:100%;z-index:999;position: relative;\'></div>\n <div id="').concat(this.jSPlugin.id,'-audioControls-remoteUnlock" class="footer-controls" style=\'display:none;justify-content: center;width:100%;z-index:999;position: relative;\'></div>\n '):document.getElementById("".concat(this.jSPlugin.id,"-ez-iframe-footer-container")).innerHTML='\n <div id="'.concat(this.jSPlugin.id,'-audioControls-quickReplyBtn" class="footer-controls" style=\'min-height: ').concat(40*s,"px;margin-bottom: ").concat(40*s,"px;display:flex;justify-content: center;width:100%;z-index:999;position: relative;'></div>\n <div id=\"").concat(this.jSPlugin.id,'-audioControls" class="footer-controls" style=\'display:flex;justify-content: space-around;padding: 0 8%;width:100%;z-index:999;position: relative;\'></div>\n <div id="').concat(this.jSPlugin.id,'-audioControls-onCall" class="footer-controls" style=\'display:none;justify-content: space-around;padding: 0 8%;width:100%;z-index:999;position: relative;\'></div>\n <div id="').concat(this.jSPlugin.id,'-audioControls-quickReply" class="footer-controls" style=\'display:none;justify-content: center;width:100%;z-index:999;position: relative;\'></div>\n <div id="').concat(this.jSPlugin.id,'-audioControls-remoteUnlock" class="footer-controls" style=\'display:none;justify-content: center;width:100%;z-index:999;position: relative;\'></div>\n '));else{var h=document.createElement("div");h.setAttribute("id","".concat(this.jSPlugin.id,"-ez-iframe-footer-container")),h.setAttribute("class","ez-iframe-footer-container");var g={position:"relative","margin-top":.2*c+"px",display:"flex","flex-wrap":"wrap","justify-content":"space-between","z-index":999,top:0,color:"#FFFFFF",width:"100%","align-items":"center","font-size":"12px"};h.style=lt(g),h.innerHTML='\n <div id="'.concat(this.jSPlugin.id,'-audioControls-quickReplyBtn" class="footer-controls" style=\'min-height: ').concat(40*s,"px;margin-bottom: ").concat(40*s,"px;display:flex;justify-content: center;width:100%;z-index:999;position: relative;'></div>\n <div id=\"").concat(this.jSPlugin.id,'-audioControls" class="footer-controls" style=\'display:flex;justify-content: space-around;padding: 0 8%;width:100%;z-index:999;position: relative;\'></div>\n <div id="').concat(this.jSPlugin.id,'-audioControls-onCall" class="footer-controls" style=\'display:none;justify-content: space-around;padding: 0 8%;width:100%;z-index:999;position: relative;\'></div>\n <div id="').concat(this.jSPlugin.id,'-audioControls-quickReply" class="footer-controls" style=\'display:none;justify-content: center;width:100%;z-index:999;position: relative;\'></div>\n <div id="').concat(this.jSPlugin.id,'-audioControls-remoteUnlock" class="footer-controls" style=\'display:none;justify-content: center;width:100%;z-index:999;position: relative;\'></div>\n '),x(h,document.getElementById(l))}else document.getElementById("".concat(this.jSPlugin.id,"-ez-iframe-footer-container"))&&document.getElementById("".concat(this.jSPlugin.id,"-ez-iframe-footer-container")).parentElement.removeChild(document.getElementById("".concat(this.jSPlugin.id,"-ez-iframe-footer-container")));if(this.isNeedRenderHeader&&document.getElementById("".concat(this.jSPlugin.id,"-headControl"))&&n[this.bellStatus].btnList.map((function(t,n){t.isrender&&e.renderHeader(t.iconId,t)})),this.isNeedRenderFooter&&document.getElementById("".concat(this.jSPlugin.id,"-audioControls"))&&(document.getElementById("".concat(this.jSPlugin.id,"-audioControls")).style.background=o[this.bellStatus].backgroundColor,document.getElementById("".concat(this.jSPlugin.id,"-audioControls")).style.color=o[this.bellStatus].color,o[this.bellStatus].btnList.map((function(t,n){t.isrender&&e.renderFooter(t.iconId,t)}))),1!=this.themeData.customConfig.bellPoster||a)this.jSPlugin.setPoster("");else{this.jSPlugin.poster="https://resource.eziot.com/group1/M00/00/B8/CtwQEmPbGh2AVJB-ABDcYtyw5gk899.svg";var f=setInterval((function(){window.EZUIKit[e.jSPlugin.id].state.EZUIKitPlayer.init&&(clearInterval(f),e.jSPlugin.setPoster(e.jSPlugin.poster))}),50)}this.activeThemeStatus&&(this.initBellRing(),this.checkIsAppleDevice()||!1?window.addEventListener("touchstart",this.autoPlayRing):window.addEventListener("click",this.autoPlayRing));this.inited=!0,this.getCallDeviceInfo()}},{key:"checkIsAppleDevice",value:function(){var e=navigator.userAgent,t=!!e.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/),n=e.indexOf("iPad")>-1,i=e.indexOf("iPhone")>-1||e.indexOf("Mac")>-1;return!!(t||n||i)}},{key:"renderThemeData",value:function(){var e=this,t=this.themeData,n=t.header,i=t.footer,o=this.decoderState.state.isEditing;if(this.isNeedRenderHeader&&n&&(document.getElementById("".concat(this.jSPlugin.id,"-headControl")).style.color=n[this.bellStatus].color.replace("-diy",""),n[this.bellStatus].btnList.map((function(t,n){t.isrender&&e.setDecoderState(p({},t.iconId,e.decoderState.state[t.iconId]))}))),this.isNeedRenderFooter&&i)document.getElementById("".concat(this.jSPlugin.id,"-audioControls")).style.background=i[this.bellStatus].backgroundColor.replace("-diy",""),document.getElementById("".concat(this.jSPlugin.id,"-audioControls")).style.color=i[this.bellStatus].color.replace("-diy",""),document.getElementById("".concat(this.jSPlugin.id,"-audioControls-onCall")).style.color=i[this.bellStatus].color.replace("-diy",""),i[this.bellStatus].btnList.map((function(t,n){if(t.isrender&&e.setDecoderState(p({},t.iconId,e.decoderState.state[t.iconId])),console.log("-------------activeThemeStatus"),0==n&&!e.themeInited&&e.activeThemeStatus)var i=setInterval((function(){window.EZUIKit[e.jSPlugin.id].state.EZUIKitPlayer.init&&(clearInterval(i),1!=e.themeData.customConfig.bellPoster||o?e.jSPlugin.play():e.jSPlugin.pluginStatus.loadingClear(),e.themeInited=!0)}),50)})),-1!==this.jSPlugin.url.indexOf("hd.live")&&this.setDecoderState({hd:!0}),this.themeData.autoFocus>0&&(this.autoFocus=parseInt(this.themeData.autoFocus),this.startAutoFocus(),document.getElementById("".concat(this.jSPlugin.id,"-wrap")).addEventListener("click",(function(){e.stopAutoFocus()}))),this.setDecoderState({cloudRec:"cloud.rec"===A(this.jSPlugin.url).type,rec:"rec"===A(this.jSPlugin.url).type,type:A(this.jSPlugin.url).type});else if(!this.themeInited&&this.activeThemeStatus)var a=setInterval((function(){window.EZUIKit[e.jSPlugin.id].state.EZUIKitPlayer.init&&(clearInterval(a),e.themeData&&e.themeData.customConfig&&1==e.themeData.customConfig.bellPoster&&!o?e.jSPlugin.pluginStatus.loadingClear():e.jSPlugin.play(),e.themeInited=!0)}),50);var r=setInterval((function(){window.EZUIKit[e.jSPlugin.id].state.EZUIKitPlayer.init&&(clearInterval(r),e.jSPlugin.reSize(e.jSPlugin.params.width,e.jSPlugin.params.height))}),50);o||this.jSPlugin.isWebConsole?1==this.themeData.customConfig.miniWinRec?this.initMiniImageRec():this.miniRecCloseClick():setTimeout((function(){"onBell"==e.bellStatus&&e.jSPlugin.capacity&&1==e.jSPlugin.capacity.support_doorcall_playback&&(console.log("小窗口initMiniRec-------------设备能力集成功"),1==e.themeData.customConfig.miniWinRec&&(console.log("小窗口initMiniRec---------------画中画设置已开启"),(!e.deviceInfoData||e.deviceInfoData&&!e.deviceInfoData.isEncrypt)&&(console.log("小窗口initMiniRec---------------设备未加密"),e.miniRecNum=0,e.initMiniRec())))}),1e3)}},{key:"setThemeData",value:function(e,t){this.themeData=e,"onCall"==t&&(this.bellStatus="onCall")}},{key:"startAutoFocus",value:function(){var e=this,t=this.autoFocus;this.autoFocusTimer&&clearTimeout(this.autoFocusTimer),this.autoFocusTimer=setTimeout((function(){document.getElementById("".concat(e.jSPlugin.id,"-audioControls"))&&(document.getElementById("".concat(e.jSPlugin.id,"-audioControls")).style.opacity=0,document.getElementById("".concat(e.jSPlugin.id,"-audioControls")).style.pointerEvents="none")}),1e3*t)}},{key:"stopAutoFocus",value:function(){document.getElementById("".concat(this.jSPlugin.id,"-audioControls"))&&(document.getElementById("".concat(this.jSPlugin.id,"-audioControls")).style.opacity=1,document.getElementById("".concat(this.jSPlugin.id,"-audioControls")).style.pointerEvents="all"),this.autoFocusTimer&&clearTimeout(this.autoFocusTimer),this.startAutoFocus()}},{key:"editIcon",value:function(e,t,n){console.log("编辑组件",e,t,n);var o=this.themeData;console.log("themeData",this.themeData);var a=this.themeData[n][this.bellStatus].btnList,r=i.findIndex(a,(function(t){return t.iconId===e})),s=a[r];switch(t){case"delete":a[r].isrender=0;break;case"right":for(var c=-1,l=r+1;l<a.length;l++)if(a[l].part===a[r].part&&1==a[l].isrender){c=l;break}-1!==c&&(a[r]=a[c],a[c]=s);break;case"left":for(var d=-1,u=r-1;u>=0;u--)if(a[u].part===a[r].part&&1==a[u].isrender){d=u;break}-1!==d&&(a[r]=a[d],a[d]=s)}console.log("new btnList",a),o[n][this.bellStatus].btnList=a,this.jSPlugin.Theme.changeTheme(o)}},{key:"countTime",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this;if(!document.getElementById(this.jSPlugin.id+"time-area")){var i=document.createElement("div");i.id=this.jSPlugin.id+"time-area",i.className="time-area",i.innerHTML='<span class="dot"></span><span class="value">00:00</span>',document.getElementById("".concat(this.jSPlugin.id,"-ez-iframe-footer-container"))&&document.getElementById("".concat(this.jSPlugin.id,"-ez-iframe-footer-container")).appendChild(i)}if(this.countTimer&&clearInterval(this.countTimer),"add"===e){var o=t;document.getElementById(n.jSPlugin.id+"time-area").style.display="flex",this.countTimer=setInterval((function(){++o,document.getElementById(n.jSPlugin.id+"time-area").children[1].innerHTML=function(e){var t=parseInt(e),n=0,i=0,o="00",a="00",r="00";t>59&&(n=parseInt(t/60),t=parseInt(t%60),n>59&&(i=parseInt(n/60),n=parseInt(n%60)));return o=parseInt(t)>9?parseInt(t):"0"+parseInt(t),a=parseInt(n)>9?parseInt(n):"0"+parseInt(n),r=parseInt(i)>9?parseInt(i):"0"+parseInt(i),i>0?r+":"+a+":"+o:n>0?a+":"+o:"00:"+o}(o)}),1e3)}else"destroy"===e&&(this.countTimer&&clearInterval(this.countTimer),this.countTimer=void 0,document.getElementById(n.jSPlugin.id+"time-area")&&(document.getElementById(n.jSPlugin.id+"time-area").children[1].innerHTML="00:00",document.getElementById(n.jSPlugin.id+"time-area").style.display="none"))}},{key:"editStart",value:function(e){console.log("----------editStart1");var t=document.getElementById("".concat(this.jSPlugin.id,"-audioControls")),n=document.getElementById("".concat(this.jSPlugin.id,"-audioControls-onCall"));document.getElementById("".concat(this.jSPlugin.id,"-headControl")),t&&t.setAttribute("class","footer-controls themeEditing"),n&&n.setAttribute("class","footer-controls themeEditing"),this.setDecoderState({isEditing:!0})}},{key:"editEnd",value:function(e){console.log("----------editEnd1");var t=document.getElementById("".concat(this.jSPlugin.id,"-audioControls")),n=document.getElementById("".concat(this.jSPlugin.id,"-headControl")),i=document.getElementById("".concat(this.jSPlugin.id,"-audioControls-onCall"));n&&n.setAttribute("class","header-controls"),t&&t.setAttribute("class","footer-controls"),i&&i.setAttribute("class","footer-controls")}},{key:"fetchThemeData",value:function(e){var t=this;switch(this.jSPlugin.themeId){case"pcLive":case"pcRec":case"mobileLive":case"mobileRec":case"miniRec":break;default:Ue(this.jSPlugin,e,(function(e){0==e.meta.code&&e.data?(t.activeThemeStatus=!0,t.themeData=e.data,e.data.header&&(t.themeData.header=e.data.header,t.themeData.header[t.bellStatus].btnList=t.themeData.header[t.bellStatus].btnList.sort((function(e,t){return e.btnKey.split("-")[3]-t.btnKey.split("-")[3]}))),e.data.footer&&(t.themeData.footer=e.data.footer,t.themeData.footer[t.bellStatus].btnList=t.themeData.footer[t.bellStatus].btnList.sort((function(e,t){return e.btnKey.split("-")[3]-t.btnKey.split("-")[3]}))),t.jSPlugin.capacity?(t.initThemeData(),t.renderThemeData()):setTimeout((function(){t.initThemeData(),t.renderThemeData()}),300)):(t.activeThemeStatus=!1,t.jSPlugin.pluginStatus.loadingClear(),t.setDecoderState({rejection:!0}),"111021"==e.meta.code?(t.jSPlugin.pluginStatus.loadingSetText({text:"无效的模板id",color:"#fff",type:1}),t.activeThemeStatusTxt="无效的模板id"):"111023"==e.meta.code?(t.jSPlugin.pluginStatus.loadingSetText({text:"您的试用特权已到期,需前往轻应用控制台购买后使用。",color:"#fff",type:1}),t.activeThemeStatusTxt="试用特权已到期"):(t.jSPlugin.pluginStatus.loadingSetText({text:"模板未激活,请先在开放平台轻应用控制台购买模板",color:"#fff",type:1}),t.activeThemeStatusTxt="模板未激活"),t.themeData=ct,t.initThemeData(),t.renderThemeData())}),(function(){t.renderThemeData()}))}}},{key:"getCallDeviceInfo",value:function(){var e=this;this.videoWidth,it({accessToken:this.jSPlugin.accessToken||this.jSPlugin.token.deviceToken.video,deviceSerial:A(this.jSPlugin.url).deviceSerial}).then((function(t){t.data&&(e.deviceInfoData=t.data,t.data.isEncrypt&&(console.log("小窗口miniRecCloseClick------------设备已加密"),e.miniRecCloseClick(),setTimeout((function(){e.jSPlugin.pluginStatus.loadingClear(),e.jSPlugin.pluginStatus.loadingSetText({text:"视频已加密",color:"#fff"})}),1e3)),document.getElementById("header-".concat(e.bellStatus,"-deviceCategory"))&&(document.getElementById("header-".concat(e.bellStatus,"-deviceCategory")).innerText=""+t.data.deviceName))})).catch((function(t){console.log("获取设备信息失败",t),20018!=t.code||e.jSPlugin.isWebConsole||e.userNoDevice()}))}},{key:"setHeaderText",value:function(e){console.log("setHeaderText");var t=this.videoWidth/375||1;document.getElementById("".concat(this.jSPlugin.id,"-deviceCategory-content"))&&(document.getElementById("".concat(this.jSPlugin.id,"-deviceCategory-content")).innerHTML='<span style="font-size: '.concat(24*t,'px;display: block">').concat(e,'</span><span style="font-size: ').concat(14*t,"px;padding-top: ").concat(5*t,'px;display: block;">').concat(this.deviceInfoData&&this.deviceInfoData.category||"","</span>"))}}])}(),ut=function(){return m((function e(t){if(l(this,e),this.jSPlugin=t,this.videoWidth=t.width,this.autoFocus=0,this.autoFocusTimer=null,this.decoderState={state:{isEditing:!1,play:!1,sound:!1,recordvideo:!1,recordCount:"00:00",talk:!1,mute:!1,rejection:!1,cloudRec:"cloud.rec"===A(t.url).type,rec:"rec"===A(t.url).type,type:A(t.url).type}},console.log("matchEzopenUrl(jSPlugin.url)",A(t.url),this.decoderState.state),this.isMobile=navigator.userAgent.match(/(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i),void 0!==t.isMobile&&(this.isMobile=t.isMobile),this.themeData={},"themeData"==this.jSPlugin.themeId&&(this.themeData=this.jSPlugin.params.themeData),this.jSPlugin.themeId)if(this.isMobile?this.call=new dt(this.jSPlugin,this.themeData,this.setDecoderState,this.decoderState):this.call=new at(this.jSPlugin,this.themeData,this.setDecoderState,this.decoderState),"themeData"===this.jSPlugin.themeId)this.themeData=this.jSPlugin.params.themeData,this.call.initThemeData(),this.call.renderThemeData();else this.call.fetchThemeData(this.jSPlugin.themeId);this.jSPlugin.Talk||(this.jSPlugin.Talk=new Pe(this.jSPlugin)),P("".concat(this.jSPlugin.staticPath,"/speed/speed.css")),P("".concat(this.jSPlugin.staticPath,"/css/theme.css"))}),[{key:"changeTheme",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"onBell";if("string"==typeof e)switch(this.jSPlugin.themeId=e,this.jSPlugin.themeId){case"pcLive":case"mobileCall":case"webCall":this.call.initThemeData(),this.call.renderThemeData();break;default:this.call.fetchThemeData(e)}else"object"===b(e)&&(this.themeData=e,this.call.setThemeData(e,n),this.call.initThemeData(),this.call.renderThemeData(),this.decoderState.state.isEditing&&t&&this.call.editStart());this.jSPlugin&&this.jSPlugin.handleThemeChange&&this.jSPlugin.handleThemeChange(e)}},{key:"setDecoderState",value:function(e,t){var n=this,i=this.themeData;i.header,i.footer,Object.keys(e).map((function(i){if("mute"===i)document.getElementById("".concat(n.jSPlugin.id,"-icon-mute"))&&(console.log("mute"),e[i]?(document.getElementById("".concat(n.jSPlugin.id,"-icon-mute")).style.background=t,document.getElementById("".concat(n.jSPlugin.id,"-icon-mute")).style.border=" 1px solid ".concat(t),document.getElementById("icon-mute-path").style.fill="#ffffff"):(document.getElementById("".concat(n.jSPlugin.id,"-icon-mute")).style.background="#ffffff",document.getElementById("".concat(n.jSPlugin.id,"-icon-mute")).style.border="1px solid ".concat(t),document.getElementById("icon-mute-path").style.fill=t));n.decoderState.state=Object.assign(n.decoderState.state,e)}))}},{key:"startAutoFocus",value:function(){var e=this,t=this.autoFocus;this.autoFocusTimer&&clearTimeout(this.autoFocusTimer),this.autoFocusTimer=setTimeout((function(){document.getElementById("".concat(e.jSPlugin.id,"-audioControls"))&&(document.getElementById("".concat(e.jSPlugin.id,"-audioControls")).style.opacity=0,document.getElementById("".concat(e.jSPlugin.id,"-audioControls")).style.pointerEvents="none")}),1e3*t)}},{key:"stopAutoFocus",value:function(){document.getElementById("".concat(this.jSPlugin.id,"-audioControls"))&&(document.getElementById("".concat(this.jSPlugin.id,"-audioControls")).style.opacity=1,document.getElementById("".concat(this.jSPlugin.id,"-audioControls")).style.pointerEvents="all"),this.autoFocusTimer&&clearTimeout(this.autoFocusTimer),this.startAutoFocus()}},{key:"toString",value:function(){return"".concat(this.coreX,"-").concat(this.coreY)}},{key:"editIcon",value:function(e,t,n){console.log("编辑组件",e,t,n);var o=this.themeData;console.log("themeData",this.themeData);var a=this.themeData[n].btnList,r=i.findIndex(a,(function(t){return t.iconId===e})),s=a[r];switch(t){case"delete":if("rec"===e){if(-1===i.findIndex(a,(function(e){return"cloudRec"===e.iconId&&1==e.isrender})))return this.jSPlugin.Message&&this.jSPlugin.Message.default("必须选中一种存储介质"),!1}else if("cloudRec"===e&&-1===i.findIndex(a,(function(e){return"rec"===e.iconId&&1==e.isrender})))return this.jSPlugin.Message&&this.jSPlugin.Message.default("必须选中一种存储介质"),!1;a[r].isrender=0;break;case"right":for(var c=-1,l=r+1;l<a.length;l++)if(a[l].part===a[r].part&&1==a[l].isrender){c=l;break}-1!==c&&(a[r]=a[c],a[c]=s);break;case"left":for(var d=-1,u=r-1;u>=0;u--)if(a[u].part===a[r].part&&1==a[u].isrender){d=u;break}-1!==d&&(a[r]=a[d],a[d]=s)}console.log("new btnList",a),o[n].btnList=a,this.changeTheme(o)}},{key:"countTime",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this;if(!document.getElementById(this.jSPlugin.id+"time-area")){var i=document.createElement("div");i.id=this.jSPlugin.id+"time-area",i.className="time-area",i.innerHTML='<span class="dot"></span><span class="value">00:00</span>',document.getElementById("".concat(this.jSPlugin.id,"-ez-iframe-footer-container"))&&document.getElementById("".concat(this.jSPlugin.id,"-ez-iframe-footer-container")).appendChild(i)}if(this.countTimer&&clearInterval(this.countTimer),"add"===e){var o=t;document.getElementById(n.jSPlugin.id+"time-area").style.display="flex",this.countTimer=setInterval((function(){++o,document.getElementById(n.jSPlugin.id+"time-area").children[1].innerHTML=function(e){var t=parseInt(e),n=0,i=0,o="00",a="00",r="00";t>59&&(n=parseInt(t/60),t=parseInt(t%60),n>59&&(i=parseInt(n/60),n=parseInt(n%60)));return o=parseInt(t)>9?parseInt(t):"0"+parseInt(t),a=parseInt(n)>9?parseInt(n):"0"+parseInt(n),r=parseInt(i)>9?parseInt(i):"0"+parseInt(i),i>0?r+":"+a+":"+o:n>0?a+":"+o:"00:"+o}(o)}),1e3)}else"destroy"===e&&(this.countTimer&&clearInterval(this.countTimer),this.countTimer=void 0,document.getElementById(n.jSPlugin.id+"time-area")&&(document.getElementById(n.jSPlugin.id+"time-area").children[1].innerHTML="00:00",document.getElementById(n.jSPlugin.id+"time-area").style.display="none"))}},{key:"editStart",value:function(e){var t=document.getElementById("".concat(this.jSPlugin.id,"-audioControls")),n=document.getElementById("".concat(this.jSPlugin.id,"-audioControls-onCall")),i=document.getElementById("".concat(this.jSPlugin.id,"-headControl"));i&&i.setAttribute("class","header-controls themeEditing"),t&&t.setAttribute("class","footer-controls themeEditing"),n&&n.setAttribute("class","footer-controls themeEditing"),this.setDecoderState({isEditing:!0})}},{key:"editEnd",value:function(e){var t=document.getElementById("".concat(this.jSPlugin.id,"-audioControls")),n=document.getElementById("".concat(this.jSPlugin.id,"-headControl"));n&&n.setAttribute("class","header-controls"),t&&t.setAttribute("class","footer-controls"),this.setDecoderState({isEditing:!1})}},{key:"setDisabled",value:function(e){}},{key:"getDeviceInfo",value:function(){var e=this,t=this.videoWidth/1024||1;it({accessToken:this.jSPlugin.accessToken||this.jSPlugin.token.deviceToken.video,deviceSerial:A(this.jSPlugin.url).deviceSerial}).then((function(n){200==n.code&&n.data&&document.getElementById("".concat(e.jSPlugin.id,"-deviceCategory-content"))&&(document.getElementById("".concat(e.jSPlugin.id,"-deviceCategory-content")).style.maxWidth="100%",document.getElementById("".concat(e.jSPlugin.id,"-deviceCategory-content")).style.overflow="hidden",document.getElementById("".concat(e.jSPlugin.id,"-deviceCategory-content")).style.textOverflow="ellipsis",document.getElementById("".concat(e.jSPlugin.id,"-deviceCategory-content")).style.whiteSpace="nowrap",document.getElementById("".concat(e.jSPlugin.id,"-deviceCategory-content")).innerHTML='<span style="font-size: '.concat(32*t,'px;display: block">有人按门铃</span><span style="font-size: ').concat(24*t,"px;padding-top: ").concat(16*t,'px;display: block;">').concat(n.data.category,"</span>"))})).catch((function(e){console.log("获取设备信息失败",e)}))}}])}(),mt=function(){return m((function e(t){l(this,e),this.jSPlugin=t;var n=window["EZUIKIT_TIMER_INTERVAL_".concat(t.id)];n&&Object.keys(n).length>0&&this.resetTimer(),window["EZUIKIT_TIMER_INTERVAL_".concat(t.id)]={}}),[{key:"createInterval",value:function(e,t,n){window["EZUIKIT_TIMER_INTERVAL_".concat(this.jSPlugin.id)][e]=setInterval(t,n)}},{key:"clearTimer",value:function(e){var t=window["EZUIKIT_TIMER_INTERVAL_".concat(this.jSPlugin.id)];t[e]&&(clearInterval(t[e]),delete t[e])}},{key:"resetTimer",value:function(){var e=window["EZUIKIT_TIMER_INTERVAL_".concat(this.jSPlugin.id)];for(var t in e)clearInterval(e[t]),delete e[t]}}])}(),ht=m((function e(t){var n=this;l(this,e),p(this,"initMap",(function(){var e=n,t=n.videoWidth,i=n.videoHeight;if(document.getElementById("".concat(n.jSPlugin.id,"-miniRecbox")))document.getElementById("".concat(n.jSPlugin.id,"-wrap")).removeChild(document.getElementById("".concat(n.jSPlugin.id,"-miniRecbox"))),n.initMap();else{var o=document.createElement("div");o.id="".concat(n.jSPlugin.id,"-miniRecbox"),o.style=";position: absolute; bottom:96px;right:".concat(n.jSPlugin.inspectVideoWidth,"px;"),o.innerHTML='<div id="'.concat(n.jSPlugin.id,'-mapbox" style="\n width: ').concat(.3333*t,"px;\n height: ").concat(.3333*i,'px;\n "></div>'),document.getElementById("".concat(n.jSPlugin.id,"-wrap")).insertBefore(o,document.getElementById("".concat(n.jSPlugin.id,"-ez-iframe-footer-container"))),e.map=e.loadMap("".concat(n.jSPlugin.id,"-mapbox"))}return e.map})),p(this,"loadMap",(function(e){var t=new BMapGL.Map(e);return t.centerAndZoom(new BMapGL.Point(116.297611,40.047363),15),t.enableScrollWheelZoom(!0),t})),p(this,"createCircle",(function(e,t,i,o){var a=new BMapGL.Point(e,t),r=new BMapGL.Marker(a,{title:o});if(n.map.addOverlay(r),0!=i){var s=new BMapGL.Circle(new BMapGL.Point(e,t),i,{strokeColor:"#ff4d4f",strokeWeight:4,strokeOpacity:1,strokeStyle:"dashed",fillOpacity:0});n.map.addOverlay(s)}})),p(this,"createInspectPoints",(function(e){e.map((function(e){n.createCircle(e.longitude,e.latitude,e.radius,e.inspectPointName)}))})),p(this,"createPolygon",(function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"#407AFF",i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"solid",o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:4,a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1,r=arguments.length>5&&void 0!==arguments[5]?arguments[5]:"407AFF",s=arguments.length>6&&void 0!==arguments[6]?arguments[6]:0,c=[];e.split(";").map((function(e){var t=e.split(",");c.push(new BMapGL.Point(t[0],t[1]))})),n.inspectRange=new BMapGL.Polygon(c,{strokeColor:t,strokeWeight:o,strokeOpacity:a,strokeStyle:i,fillOpacity:s,fillColor:r}),n.map.addOverlay(n.inspectRange)})),p(this,"createTrack",(function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"#18C796",o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"solid",a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:4,r=arguments.length>5&&void 0!==arguments[5]?arguments[5]:1,s=arguments.length>6&&void 0!==arguments[6]?arguments[6]:0,c=arguments.length>7&&void 0!==arguments[7]?arguments[7]:0,l=arguments.length>8&&void 0!==arguments[8]?arguments[8]:500,d=arguments.length>9&&void 0!==arguments[9]?arguments[9]:0,u=arguments.length>10&&void 0!==arguments[10]&&arguments[10],m=[];if(e.map((function(e){var t=!1;n.currentTrack.length>0&&n.currentTrack.map((function(n){n.longitude===e.longitude&&n.latitude===e.latitude&&n.reportTime===e.reportTime&&(t=!0)})),t||(0==m.length&&n.currentTrack.length>0&&m.push(new BMapGL.Point(n.currentTrack[n.currentTrack.length-1].longitude,n.currentTrack[n.currentTrack.length-1].latitude)),m.push(new BMapGL.Point(e.longitude,e.latitude)))})),0!=m.length){var h=new BMapGL.Polyline(m,{strokeColor:i,strokeWeight:a,strokeOpacity:r,strokeStyle:o,fillOpacity:s});if(t?(n.map.addOverlay(h),n.map.centerAndZoom(m[m.length-1],15)):(n.trackAni=new BMapGLLib.TrackAnimation(n.map,h,{overallView:u,tilt:c,duration:l,delay:d}),n.trackAni.start()),n.currentTrack=e,n.currentTrack.length>0&&n.currentTrack.length>0){var p=new BMapGL.Point(n.currentTrack[0].longitude,n.currentTrack[0].latitude);if(n.startPoint=new BMapGL.Marker(p,{icon:new BMapGL.Icon("".concat(n.jSPlugin.staticPath,"/imgs/start.png"),new BMapGL.Size(32,47)),offset:new BMapGL.Size(0,-17)}),n.map.addOverlay(n.startPoint),1==n.currentTrack.length)return;var g=new BMapGL.Point(n.currentTrack[n.currentTrack.length-1].longitude,n.currentTrack[n.currentTrack.length-1].latitude);n.endPoint&&n.map.removeOverlay(n.endPoint),setTimeout((function(){n.endPoint=new BMapGL.Marker(g,{icon:new BMapGL.Icon("".concat(n.jSPlugin.staticPath,"/imgs/end.png"),new BMapGL.Size(30,30))}),n.map.addOverlay(n.endPoint)}),t?0:l)}}})),p(this,"centerToTrack",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:15;n.currentTrack.length>0&&(1==n.currentTrack.length?n.map.centerAndZoom(new BMapGL.Point(n.currentTrack[0].longitude,n.currentTrack[0].latitude),e):n.map.centerAndZoom(new BMapGL.Point(n.currentTrack[n.currentTrack.length-1].longitude,n.currentTrack[n.currentTrack.length-1].latitude),e))})),this.jSPlugin=t,this.videoWidth=t.width,this.videoHeight=t.height,this.toastCustom=new Je(t,!1),this.currentTrack=[],this.startPoint=null,this.endPoint=null,this.trackAni=null,this.inspectRange=null,this.map=this.initMap()})),pt=m((function e(t){var n=this;l(this,e),p(this,"init",(function(){var e=n;if(n.videoWidth,n.videoHeight,document.getElementById("".concat(n.jSPlugin.id,"-inspect-global-box")))document.getElementById("".concat(n.jSPlugin.id,"-inspect-global-box"))&&document.getElementById("".concat(n.jSPlugin.id,"-wrap")).removeChild(document.getElementById("".concat(n.jSPlugin.id,"-inspect-global-box"))),e.init();else{var t=document.createElement("div");t.id="".concat(n.jSPlugin.id,"-inspect-global-box"),t.style=";position: absolute; left:0; top: 0; width: 100%; height: 100%; z-index: 10000; background: #fff;",t.innerHTML='<div id="'.concat(n.jSPlugin.id,'-inspect-loading-box" style="\n overflow: auto;\n box-sizing: border-box;\n font-size: 14px;\n color: #595959;\n line-height: 24px;\n font-weight: bold;\n width: 100%;\n display: flex;\n align-items: center;\n justify-content: center;\n height: 100%;\n ">\n <div>\n <div style="text-align:center;"><div type="default" class="ezuikit-spin ezuikit-spin-spinning"><span class="ezuikit-spin-dot ezuikit-spin-dot-spin ezuikit-spin-dot-default"><i class="ezuikit-spin-dot-item"></i><i class="ezuikit-spin-dot-item"></i><i class="ezuikit-spin-dot-item"></i><i class="ezuikit-spin-dot-item"></i></span></div></div>\n <div style="color: #595959; font-size:14px; font-weight: 400; text-align: center;">加载中…</div>\n </div></div>\n '),document.getElementById("".concat(n.jSPlugin.id,"-wrap")).appendChild(t)}})),p(this,"deviceErrorInfo",(function(e,t){var i=Object.assign({tips:"",refreshBtn:"",refreshShow:!1},e);if(document.getElementById("".concat(n.jSPlugin.id,"-no-inspect-box")))document.getElementById("".concat(n.jSPlugin.id,"-no-inspect-box"))&&document.getElementById("".concat(n.jSPlugin.id,"-inspect-global-box")).removeChild(document.getElementById("".concat(n.jSPlugin.id,"-no-inspect-box"))),n.deviceErrorInfo(e,t);else{n.videoHeight;var o=document.createElement("div");o.id="".concat(n.jSPlugin.id,"-no-inspect-box"),o.style="width:100%;height:100%; background: #ffffff; display: flex; justify-content: center; align-items: center",o.innerHTML='<div style="\n overflow: auto;\n box-sizing: border-box;\n font-size: 14px;\n color: #595959;\n text-align: center;\n ">\n <div style="text-align:center; height: 21px;">\n <svg t="1689074472491" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="7172" xmlns:xlink="http://www.w3.org/1999/xlink" width="21" height="21"><path d="M512 64a448 448 0 1 0 0 896A448 448 0 0 0 512 64z m-32 232c0-4.416 3.584-8 8-8h48c4.416 0 8 3.584 8 8v272A8 8 0 0 1 536 576h-48a8 8 0 0 1-8-8v-272zM512 736A48 48 0 1 1 512 640a48 48 0 0 1 0 96z" fill="#FF4D4F" p-id="7173"></path></svg>\n </div>\n <div style="color: #595959; font-size:14px; margin: 5px 0 16px;font-weight: 400; text-align: center;">'.concat(i.tips,'</div>\n <button id="').concat(n.jSPlugin.id,'-inspect-device-status-refresh" style="display: ').concat(i.refreshShow?"block":"none",'; width: 80px; margin: 0 auto;" type="button" class="ezuikit-btn ezuikit-btn-primary"><span>').concat(i.refreshBtn,"</span></button>\n </div>\n "),document.getElementById("".concat(n.jSPlugin.id,"-inspect-global-box")).appendChild(o),document.getElementById("".concat(n.jSPlugin.id,"-inspect-device-status-refresh")).addEventListener("click",(function(){t&&t()}))}})),p(this,"globalContainerToggle",(function(e,t){document.getElementById(e)&&(document.getElementById(e).style.display=t?"flex":"none")})),this.jSPlugin=t,this.videoWidth=t.width,this.videoHeight=t.height,this.toastCustom=new Je(t,!1),this.init()})),gt=function(){return m((function e(t){l(this,e),this.timer=null;var n={wrapNode:document.body,time:2e3,content:"",type:"info",center:!1,top:8};this.params=f(f({},n),t),this.init()}),[{key:"init",value:function(){var e=this;this.timer=null;var t=this.params,n=t.wrapNode,i=t.content,o=t.time,a=t.type,r=t.center,s=t.top;this.wrapNode=n;var c=document.createElement("div");c.setAttribute("class","ezuikit-message"),r?c.setAttribute("style","top: 50%; transform: translateY(-50%);"):c.setAttribute("style","top: ".concat(s||0,"px;")),this.wrapNode.appendChild(c),this.initMessageContent(a,i,c),0!==o&&(this.timer=setTimeout((function(){e.wrapNode.removeChild(c)}),o||2e3))}},{key:"initMessageContent",value:function(e,t,n){var i=document.createElement("div");i.setAttribute("class","ezuikit-message-notice"),i.innerHTML='\n\t\t\t<div class="ezuikit-message-notice-content">\n\t\t\t\t<div class="ezuikit-message-custom-content ezuikit-message-'.concat(e,'">\n\t\t\t\t\t<span role="img" aria-label="check-circle" class="ezdicon ezdicon-check-circle">\n\t\t\t\t\t\t').concat("warning"===e?'<svg fill="currentColor" t="1691567271942" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="1em" height="1em"><path d="M512 64a448 448 0 1 0 0 896A448 448 0 0 0 512 64z m-32 232c0-4.416 3.584-8 8-8h48c4.416 0 8 3.584 8 8v272A8 8 0 0 1 536 576h-48a8 8 0 0 1-8-8v-272zM512 736A48 48 0 1 1 512 640a48 48 0 0 1 0 96z"></path></svg>':"","\n\t\t\t\t\t\t").concat("info"===e?'<svg fill="currentColor" t="1691567317943" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="1em" height="1em"><path d="M512 64a448 448 0 1 0 0 896A448 448 0 0 0 512 64z m32 664a8 8 0 0 1-8 8h-48a8 8 0 0 1-8-8v-272c0-4.416 3.584-8 8-8h48c4.416 0 8 3.584 8 8v272zM512 384a48 48 0 1 1 0-96A48 48 0 0 1 512 384z"></path></svg>':"","\n\t\t\t\t\t\t").concat("error"===e?'<svg fill="currentColor" t="1691567308585" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="1em" height="1em"><path d="M512 64a448 448 0 1 0 0 896A448 448 0 0 0 512 64z m165.376 618.24l-65.92-0.32L512 563.392l-99.328 118.4-66.048 0.32a7.936 7.936 0 0 1-8-8c0-1.92 0.64-3.712 1.92-5.184L470.528 513.92 340.48 359.04a8 8 0 0 1 6.08-13.184l66.112 0.256L512 464.576l99.328-118.4 65.92-0.256c4.48 0 8.064 3.456 8.064 8a8.32 8.32 0 0 1-1.92 5.12l-129.92 154.944 130.048 155.008a8 8 0 0 1-6.08 13.184z"></path></svg>':"","\n\t\t\t\t\t\t").concat("success"===e?'<svg fill="currentColor" viewBox="64 64 896 896" focusable="false" data-icon="check-circle" width="1em" height="1em" aria-hidden="true"><path d="M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm193.5 301.7l-210.6 292a31.8 31.8 0 01-51.7 0L318.5 484.9c-3.8-5.3 0-12.7 6.5-12.7h46.9c10.2 0 19.9 4.9 25.9 13.3l71.2 98.8 157.2-218c6-8.3 15.6-13.3 25.9-13.3H699c6.5 0 10.3 7.4 6.5 12.7z"></path></svg>':"","\n\t\t\t\t\t</span>\n\t\t\t\t\t<span>").concat(t,"</span>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t"),n.appendChild(i)}}])}(),ft=function(){return m((function e(t){l(this,e),this.params=f(f({},{id:"",width:"100%",height:"100%",preview:!0,showIcon:!0,src:"",alt:"",fallback:"https://img.ys7.com/group32/M00/81/9D/CtxIA2HnrGyADm_jAAAFfWjIDJs811.png"}),t),this.id=Math.random().toString(36).substr(2),this.init()}),[{key:"init",value:function(){var e=this.params,t=e.id,n=e.width,i=e.height,o=e.preview;if(document.getElementById(t)){var a=document.createElement("div");a.setAttribute("class","ezuikit-image"),a.setAttribute("style","width:".concat(n,";height:").concat(i,";")),document.getElementById(t).appendChild(a),this.initImage(a),o&&this.initPreview(a)}}},{key:"previewImg",value:function(){var e=this.params,t=e.src,n=e.alt,i=e.fallback,o=document.createElement("div");o.setAttribute("id",this.id+"-preview"),o.setAttribute("class","ezuikit-image-preview"),o.innerHTML='\n\t\t\t<div class="ezuikit-image-preview-mask"></div>\n\t\t\t<div class="ezuikit-image-preview-img-wrapper">\n\t\t\t\t<div class="ezuikit-image-preview-operations" id="'.concat(this.id,'-ezuikit-image-preview-operations">\n\t\t\t\t\t<div class="ezuikit-image-preview-operations-operation">\n\t\t\t\t\t\t<span role="img" aria-label="close" class="anticon anticon-close ezuikit-image-preview-operations-icon">\n\t\t\t\t\t\t\t<svg viewBox="64 64 896 896" focusable="false" data-icon="close" width="1em" height="1em" fill="currentColor" aria-hidden="true"><path d="M563.8 512l262.5-312.9c4.4-5.2.7-13.1-6.1-13.1h-79.8c-4.7 0-9.2 2.1-12.3 5.7L511.6 449.8 295.1 191.7c-3-3.6-7.5-5.7-12.3-5.7H203c-6.8 0-10.5 7.9-6.1 13.1L459.4 512 196.9 824.9A7.95 7.95 0 00203 838h79.8c4.7 0 9.2-2.1 12.3-5.7l216.5-258.1 216.5 258.1c3 3.6 7.5 5.7 12.3 5.7h79.8c6.8 0 10.5-7.9 6.1-13.1L563.8 512z"></path></svg>\n\t\t\t\t\t\t</span>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t\t<div class="ezuikit-image-preview-wrap">\n\t\t\t\t\t<div class="ezuikit-image-preview-img-main"></div>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t');var a=document.createElement("img");a.setAttribute("class","ezuikit-image-preview-img"),a.setAttribute("alt",n),a.setAttribute("src",t),a.addEventListener("error",(function(){a.setAttribute("src",i)})),document.body.appendChild(o),o.querySelector(".ezuikit-image-preview-img-main").appendChild(a),document.getElementById(this.id+"-ezuikit-image-preview-operations").addEventListener("click",(function(){document.body.removeChild(o)}))}},{key:"initImage",value:function(e){var t=this.params,n=t.src,i=t.alt,o=t.fallback,a=document.createElement("img");a.setAttribute("class","ezuikit-image-img"),a.setAttribute("alt",i),a.setAttribute("src",n),a.addEventListener("error",(function(){a.setAttribute("src",o)})),e.appendChild(a)}},{key:"initPreview",value:function(e){var t=this,n=this.params.showIcon,i=document.createElement("div");i.setAttribute("class","ezuikit-image-mask"),n&&(i.innerHTML='\n\t\t\t\t<div class="ezuikit-image-mask-info">\n\t\t\t\t\t<span class="ezuikit-image-anticon-eye">\n\t\t\t\t\t\t<svg viewBox="64 64 896 896" focusable="false" data-icon="eye" width="1em" height="1em" aria-hidden="true"><path d="M942.2 486.2C847.4 286.5 704.1 186 512 186c-192.2 0-335.4 100.5-430.2 300.3a60.3 60.3 0 000 51.5C176.6 737.5 319.9 838 512 838c192.2 0 335.4-100.5 430.2-300.3 7.7-16.2 7.7-35 0-51.5zM512 766c-161.3 0-279.4-81.8-362.7-254C232.6 339.8 350.7 258 512 258c161.3 0 279.4 81.8 362.7 254C791.5 684.2 673.4 766 512 766zm-4-430c-97.2 0-176 78.8-176 176s78.8 176 176 176 176-78.8 176-176-78.8-176-176-176zm0 288c-61.9 0-112-50.1-112-112s50.1-112 112-112 112 50.1 112 112-50.1 112-112 112z"></path></svg>\n\t\t\t\t\t\t预览\n\t\t\t\t\t</span>\n\t\t\t\t</div>\n\t\t\t\t'),e.appendChild(i),e.onclick=function(){t.previewImg()}}}])}(),vt=function(){return m((function e(t){l(this,e),this.params=f(f({},{id:"",parentNodeId:"",title:"",content:"",placement:"top",cancelText:"取消",arrowPointAtCenter:!1,okText:"确定",onCancel:function(){},onConfirm:function(){}}),t),this.initState=!1,this.init(t)}),[{key:"init",value:function(){var e=this,t=this.params,n=t.id,i=t.content,o=t.placement,a=t.title,r=document.getElementById(n);if(r){var s=document.createElement("div");if(s.setAttribute("id",n+"-popover"),s.setAttribute("class","ezuikit-popover"),s.setAttribute("style","display:none;"),s.innerHTML='\n\t\t\t\t\t<div class="ezuikit-popover-arrow">\n\t\t\t\t\t\t<span class="ezuikit-popover-arrow-content"></span>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class="ezuikit-popover-inner">\n\t\t\t\t\t\t'.concat(a?'<div class="ezuikit-popover-title">'.concat(a,"</div>"):"",'\n\t\t\t\t\t\t<div class="ezuikit-popover-inner-content">').concat(i,"</div>\n\t\t\t\t\t</div>\n\t\t\t\t"),!document.getElementById(n+"-popover")){var c=document.body;this.params.parentNodeId&&(c=document.getElementById(this.params.parentNodeId)),c.appendChild(s),this.renderPopover(s,r,o)}document.body.addEventListener("click",(function(t){e.addEventListenerFn(t)}))}}},{key:"addEventListenerFn",value:function(e){var t=this.params.id,n=document.getElementById(t),i=document.getElementById(t+"-popover");n&&e.target!==n&&!n.contains(e.target)&&i&&e.target!==i&&!i.contains(e.target)&&this.hidePopover()}},{key:"hidePopover",value:function(){var e=this.params.id,t=document.getElementById(e+"-popover");t&&document.body.removeChild(t)}},{key:"renderPopover",value:function(e,t,n,i,o){e.style.display="block";var a=t.getBoundingClientRect(),r=a.top,s=a.left,c=a.width,l=a.height,d=e.getBoundingClientRect(),u=d.width,m=d.height;i&&(u=i),o&&(m=o);var h=document.body;this.params.parentNodeId&&(h=document.getElementById(this.params.parentNodeId));var p=this.params.arrowPointAtCenter,g=0,f=0,v=e.getElementsByClassName("ezuikit-popover-arrow")[0],y=v.getBoundingClientRect(),S=y.width,_=y.height;if(p){var b=0,w=0;switch(n){case"top":default:b=u/2,w=m;break;case"bottom":b=u/2,w=0;break;case"left":b=u,w=m/2;break;case"right":b=0,w=m/2;break;case"topLeft":b=(c-S)/2,w=m;break;case"topRight":b=u-(c+S)/2,w=m;break;case"bottomLeft":b=(c-S)/2,w=0;break;case"bottomRight":b=u-(c+S)/2,w=0;break;case"leftTop":b=u,w=(l-_)/2;break;case"leftBottom":b=u,w=m-(l+_)/2;break;case"rightTop":b=0,w=(l-10)/2;break;case"rightBottom":b=0,w=m-(l+_)/2}v.style.left=b+"px",v.style.top=w+"px"}switch(n){case"top":g=-(m+_),f=(c-u)/2,e.setAttribute("class","ezuikit-popover ezuikit-popover-placement-top");break;case"bottom":g=l-_/2,f=(c-u)/2,e.setAttribute("class","ezuikit-popover ezuikit-popover-placement-bottom");break;case"left":g=(l-m)/2,f=-(u+S/2),e.setAttribute("class","ezuikit-popover ezuikit-popover-placement-left");break;case"right":g=(l-m)/2,f=c-S/2,e.setAttribute("class","ezuikit-popover ezuikit-popover-placement-right");break;case"topLeft":g=-(m+_),f=0,e.setAttribute("class","ezuikit-popover ezuikit-popover-placement-topLeft");break;case"topRight":g=-(m+_),f=c-u,e.setAttribute("class","ezuikit-popover ezuikit-popover-placement-topRight");break;case"bottomLeft":g=l-_/2,f=0,e.setAttribute("class","ezuikit-popover ezuikit-popover-placement-bottomLeft");break;case"bottomRight":g=l-_/2,f=c-u,e.setAttribute("class","ezuikit-popover ezuikit-popover-placement-bottomRight");break;case"leftTop":g=0,f=-(u+S/2),e.setAttribute("class","ezuikit-popover ezuikit-popover-placement-leftTop");break;case"leftBottom":g=l-m,f=-(u+S/2),e.setAttribute("class","ezuikit-popover ezuikit-popover-placement-leftBottom");break;case"rightTop":g=0,f=c-S/2,e.setAttribute("class","ezuikit-popover ezuikit-popover-placement-rightTop");break;case"rightBottom":g=l-m,f=c-S/2,e.setAttribute("class","ezuikit-popover ezuikit-popover-placement-rightBottom");break;default:g=-m,f=(c-u)/2,e.setAttribute("class","ezuikit-popover ezuikit-popover-placement-top")}var T=document.documentElement.scrollTop||document.body.scrollTop,E=document.documentElement.scrollLeft||document.body.scrollLeft;e.style.top=r+T+g+"px",e.style.left=s+E+f+"px";var P=e.getBoundingClientRect(),k=h===document.body?{left:0,top:0,right:window.innerWidth,bottom:window.innerHeight}:h.getBoundingClientRect(),C=n;P.left<k.left&&(C=(C=C.replace("Right","Left")).replace("right","left")),P.right>k.right&&(C=(C=C.replace("Left","Right")).replace("left","right")),P.top<k.top&&(C=(C=C.replace("Top","Bottom")).replace("top","bottom")),P.bottom>k.bottom&&(C=(C=C.replace("Bottom","Top")).replace("bottom","top")),C!==n&&this.renderPopover(e,t,C,u,m)}}])}(),yt=function(){return m((function e(t){l(this,e),this.params=f(f({},{id:"",content:"",placement:"top",cancelText:"取消",arrowPointAtCenter:!1,okText:"确定",onCancel:function(){},onConfirm:function(){}}),t),this.PopconfirmDom=null,this.init(t)}),[{key:"init",value:function(){var e=this,t=this.params,n=t.content,i=t.cancelText,o=t.okText,a=t.onCancel,r=t.onConfirm,s=document.createElement("div");s.innerHTML='\n <div class="ezuikit-confirm">\n <div class="ezuikit-confirm-content">\n\t\t\t\t\t<span class="ezuikit-confirm-icon">\n \t<svg fill="currentColor" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="24" height="24"><path d="M512 64a448 448 0 1 0 0 896A448 448 0 0 0 512 64z m-32 232c0-4.416 3.584-8 8-8h48c4.416 0 8 3.584 8 8v272A8 8 0 0 1 536 576h-48a8 8 0 0 1-8-8v-272zM512 736A48 48 0 1 1 512 640a48 48 0 0 1 0 96z"></path></svg>\n </span>\n\t\t\t\t\t<span class="ezuikit-confirm-content-label">'.concat(n,'</span>\n </div>\n <div class="ezuikit-popover-buttons"></div>\n </div>\n ');var c=document.createElement("button");c.className="ezuikit-btn ezuikit-cancel-btn",c.innerText=i;var l=document.createElement("button");return l.className="ezuikit-btn ezuikit-ok-btn ezuikit-btn-primary",l.innerText=o,s.querySelector(".ezuikit-popover-buttons").appendChild(c),s.querySelector(".ezuikit-popover-buttons").appendChild(l),this.PopconfirmDom=new vt(f(f({},this.params),{},{content:s.innerHTML})),document.getElementById("".concat(this.params.id,"-popover")).querySelector(".ezuikit-cancel-btn")&&(document.getElementById("".concat(this.params.id,"-popover")).querySelector(".ezuikit-cancel-btn").onclick=function(){a?a():e.hide()}),document.getElementById("".concat(this.params.id,"-popover")).querySelector(".ezuikit-ok-btn")&&(document.getElementById("".concat(this.params.id,"-popover")).querySelector(".ezuikit-ok-btn").onclick=function(){r?r():e.hide()}),this.PopconfirmDom}},{key:"hide",value:function(){this.PopconfirmDom.hidePopover()}}])}(),St=function(){return m((function e(t){l(this,e),this.params=f(f({},{id:"",width:"100%",height:"100%",preview:!0,poster:"",fallback:"https://img.ys7.com/group32/M00/81/9D/CtxIA2HnrGyADm_jAAAFfWjIDJs811.png",src:""}),t),this.id=Math.random().toString(36).substr(2),this.init()}),[{key:"init",value:function(){var e=this.params,t=e.id,n=e.width,i=e.height,o=e.preview;if(document.getElementById(t)){var a=document.createElement("div");a.setAttribute("class","ezuikit-video"),a.setAttribute("style","width:".concat(n,";height:").concat(i,";")),document.getElementById(t).appendChild(a),this.initVideo(a),o&&this.initPreview(a)}}},{key:"previewVideo",value:function(){var e=this.params.src,t=document.createElement("div");t.setAttribute("id",this.id+"-preview"),t.setAttribute("class","ezuikit-image-video"),t.innerHTML='\n\t\t\t<div class="ezuikit-video-preview-mask"></div>\n\t\t\t<div class="ezuikit-video-preview-img-wrapper">\n\t\t\t\t<div class="ezuikit-video-preview-operations" id="'.concat(this.id,'-ezuikit-video-preview-operations">\n\t\t\t\t\t<div class="ezuikit-video-preview-operations-operation">\n\t\t\t\t\t\t<span role="img" aria-label="close" class="anticon anticon-close ezuikit-video-preview-operations-icon">\n\t\t\t\t\t\t\t<svg viewBox="64 64 896 896" focusable="false" data-icon="close" width="1em" height="1em" fill="currentColor" aria-hidden="true"><path d="M563.8 512l262.5-312.9c4.4-5.2.7-13.1-6.1-13.1h-79.8c-4.7 0-9.2 2.1-12.3 5.7L511.6 449.8 295.1 191.7c-3-3.6-7.5-5.7-12.3-5.7H203c-6.8 0-10.5 7.9-6.1 13.1L459.4 512 196.9 824.9A7.95 7.95 0 00203 838h79.8c4.7 0 9.2-2.1 12.3-5.7l216.5-258.1 216.5 258.1c3 3.6 7.5 5.7 12.3 5.7h79.8c6.8 0 10.5-7.9 6.1-13.1L563.8 512z"></path></svg>\n\t\t\t\t\t\t</span>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t\t<div class="ezuikit-video-preview-wrap">\n\t\t\t\t\t<div class="ezuikit-video-preview-img-wrapper">\n\t\t\t\t\t\t<video\n\t\t\t\t\t\t\tclass="ezuikit-video-preview-img custom-controls"\n\t\t\t\t\t\t\tsrc="').concat(e,'"\n\t\t\t\t\t\t\tautoplay \n\t\t\t\t\t\t\tcontrols \n\t\t\t\t\t\t\tcontrolslist="nodownload noremoteplayback noplaybackrate"\n\t\t\t\t\t\t\tdisablePictureInPicture\n\t\t\t\t\t\t\tdisableRemotePlayback\n\t\t\t\t\t\t/>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t'),document.body.appendChild(t),document.getElementById(this.id+"-ezuikit-video-preview-operations").addEventListener("click",(function(){document.body.removeChild(t)}))}},{key:"initVideo",value:function(e){var t=this.params,n=t.poster,i=t.fallback,o=document.createElement("img");o.setAttribute("class","ezuikit-video-img"),o.setAttribute("src",n),o.addEventListener("error",(function(){o.setAttribute("src",i)})),e.appendChild(o)}},{key:"initPreview",value:function(e){var t=this,n=document.createElement("div");n.setAttribute("class","ezuikit-video-mask"),n.innerHTML='\n\t\t\t<div class="ezuikit-video-mask-info">\n\t\t\t\t<span class="ezuikit-video-anticon-eye">\n\t\t\t\t\t<svg width="28" height="28" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 28 28" style="enable-background:new 0 0 28 28;" xml:space="preserve">\n\t\t\t\t\t<circle cx="14" cy="14" r="14" style="opacity:0.7;fill-rule:evenodd;clip-rule:evenodd;enable-background:new;"/>\n\t\t\t\t\t<path style="fill-rule:evenodd;clip-rule:evenodd;fill:#FFFFFF;" d="M18.3,15.2l-5.3,3.3c-0.7,0.4-1.6,0.2-2.1-0.5c-0.1-0.2-0.2-0.5-0.2-0.8v-6.6\n\t\t\t\t\t\tc0-0.8,0.7-1.5,1.5-1.5c0.3,0,0.6,0.1,0.8,0.2l5.3,3.3c0.7,0.4,0.9,1.4,0.5,2.1C18.6,14.9,18.4,15,18.3,15.2z"/>\n\t\t\t\t\t</svg>\n\t\t\t\t</span>\n\t\t\t</div>\n\t\t\t',e.appendChild(n),e.onclick=function(){t.previewVideo()}}}])}(),_t=function(e,t,n,i){var o={accessToken:e.accessToken||e.token.httpToken.url,inspectRecordId:t,page:0},a="".concat(e.env.domain,"/api/service/devicekit/bodycamera/device/trace");Ye(a,"GET",o,(function(e){n&&n(e)}),(function(e){i&&i(e)}),{"Content-Type":"application/x-www-form-urlencoded"})},bt=function(e,t,n,i){var o={accessToken:e.accessToken||e.token.deviceToken.video,deviceSerial:A(e.url).deviceSerial,validateCode:A(e.url).validCode,channelNo:A(e.url).channelNo,evidenceFileType:t},a="".concat(e.env.domain,"/api/service/devicekit/common/file/evidence");Ye(a,"POST",o,(function(e){n&&n(e)}),(function(e){i&&i(e)}),{"Content-Type":"application/x-www-form-urlencoded"})},wt=function(e,t,n,i){var o={accessToken:e.accessToken||e.token.httpToken.url,taskId:t},a="".concat(e.env.domain,"/api/service/devicekit/opencloud/task/info");Ye(a,"GET",o,(function(e){n&&n(e)}),(function(e){i&&i(e)}),{"Content-Type":"application/x-www-form-urlencoded"})};var Tt=function(){return m((function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2?arguments[2]:void 0,o=arguments.length>3?arguments[3]:void 0,a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:function(){};l(this,e),this.jSPlugin=t,this.currentEventInfo=n,this.inspectInfo=t.Theme.inspect.inspectInfo,this.type=o,this.timer=i,this.startTime=1e3,this.videoRecordingStatus=!0,this.saveSuccessCallback=a,this.init()}),[{key:"init",value:function(){this.renderEventDetail(),this.eventDetailDomEvent()}},{key:"show",value:function(){document.getElementById("".concat(this.jSPlugin.id,"-inspect-event-detail-wrap")).setAttribute("class","inspect-event-detail-wrap show")}},{key:"hide",value:function(){document.getElementById("".concat(this.jSPlugin.id,"-inspect-event-detail-wrap")).setAttribute("class","inspect-event-detail-wrap"),document.getElementById("".concat(this.jSPlugin.id,"-inspect-event-detail-box")).innerHTML=""}},{key:"validationEventTag",value:function(){return 0==document.getElementById("".concat(this.jSPlugin.id,"-event-tag")).value.length?(document.getElementById("".concat(this.jSPlugin.id,"-event-tag-error")).style.display="block",document.getElementById("".concat(this.jSPlugin.id,"-event-tag-error")).innerHTML="请输入事件标签",document.getElementById("".concat(this.jSPlugin.id,"-event-tag")).setAttribute("class","ezuikit-input input-has-error"),!1):(document.getElementById("".concat(this.jSPlugin.id,"-event-tag-error")).style.display="none",document.getElementById("".concat(this.jSPlugin.id,"-event-tag")).setAttribute("class","ezuikit-input"),!0)}},{key:"renderVideo",value:function(e,t,n){var i=this;if(document.getElementById("".concat(this.jSPlugin.id,"-inspectEventDetail-videoPreview")).innerHTML="",1===e||2===e){if(document.getElementById("".concat(this.jSPlugin.id,"-inspectEventDetail-videoPreview")).innerHTML='\n <div class="video-stroage-exceptional-status-tips-wrap" style="background:url('.concat(this.jSPlugin.staticPath,'/imgs/bg.svg) no-repeat 100%/cover">\n <div class="video-stroage-exceptional-status-icon">\n <div type="default" class="ezuikit-spin ezuikit-spin-sm ezuikit-spin-spinning ezuikit-spin-dot-white"><span class="ezuikit-spin-dot ezuikit-spin-dot-spin ezuikit-spin-dot-default"><i class="ezuikit-spin-dot-item"></i><i class="ezuikit-spin-dot-item"></i><i class="ezuikit-spin-dot-item"></i><i class="ezuikit-spin-dot-item"></i></span></div>\n </div>\n <span class="video-stroage-exceptional-status-tips">视频正在存储中…</span>\n </div>\n '),1!==this.type){var o=this.currentEventInfo.evidenceId;this.timer.clearTimer("videoRecordingStatusTimer"),this.timer.createInterval("videoRecordingStatusTimer",(function(){wt(i.jSPlugin,o,(function(e){if(e.meta&&200===e.meta.code){var t=e.data,n=t.taskStatus,o=t.fileUrl,a=t.videoCoverPic||"".concat(i.jSPlugin.staticPath,"/imgs/bg.svg");i.renderVideo(n,a,o)}}))}),1e3)}}else 4===e||5===e||6===e||7===e?(document.getElementById("".concat(this.jSPlugin.id,"-inspectEventDetail-videoPreview")).innerHTML='\n <div class="video-stroage-exceptional-status-tips-wrap video-stroage-exceptional-status-tips-error" style="background:url('.concat(this.jSPlugin.staticPath,'/imgs/bg.svg) no-repeat 100%/cover">\n <div class="video-stroage-exceptional-status-icon">\n <svg fill="currentColor" t="1691567317943" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="1em" height="1em"><path d="M512 64a448 448 0 1 0 0 896A448 448 0 0 0 512 64z m32 664a8 8 0 0 1-8 8h-48a8 8 0 0 1-8-8v-272c0-4.416 3.584-8 8-8h48c4.416 0 8 3.584 8 8v272zM512 384a48 48 0 1 1 0-96A48 48 0 0 1 512 384z"></path></svg>\n </div>\n <span class="video-stroage-exceptional-status-tips">视频存储失败</span>\n </div>\n '),this.timer.clearTimer("videoRecordingStatusTimer")):0!==e&&3!==e||(new St({id:"".concat(this.jSPlugin.id,"-inspectEventDetail-videoPreview"),poster:t,fallback:"".concat(this.jSPlugin.staticPath,"/imgs/bg.svg"),src:n}),this.timer.clearTimer("videoRecordingStatusTimer"))}},{key:"renderEventDetail",value:function(){var e=this,t=this.currentEventInfo,n=t.evidenceFileType,i=t.fileUrl,o=t.taskStatus,a=t.videoCoverPic,r=document.createElement("div");r.setAttribute("class","inspectEventDetail");var s="";if(s=1===n?a||"".concat(this.jSPlugin.staticPath,"/imgs/bg.svg"):i||"".concat(this.jSPlugin.staticPath,"/imgs/bg.svg"),r.innerHTML='\n <div class="inspectEventDetail-header">\n <div class="inspectEventDetail-back" id="'.concat(this.jSPlugin.id,'-inspectEventDetail-back">\n <svg viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" width="16" height="16" xmlns:xlink="http://www.w3.org/1999/xlink"><path d="M605.888 137.344a6.4 6.4 0 0 1 1.472 4.032l0.64 70.784a6.4 6.4 0 0 1-2.368 5.056L281.6 480H876.8v64H279.744l325.376 264a6.4 6.4 0 0 1 2.368 4.928l0.128 69.632a6.4 6.4 0 0 1-10.432 4.992l-422.016-342.4a42.24 42.24 0 0 1-7.04-57.344l3.264-3.904 3.776-3.456 421.76-344a6.4 6.4 0 0 1 8.96 0.896z"></path></svg>\n </div>\n <div class="inspectEventDetail-type">').concat(1===this.type?"编辑":"").concat(0===n?"图片存证":"视频存证",'</div>\n </div>\n <div class="inspectEventDetail-content" style="\n height: ').concat(document.getElementById("".concat(this.jSPlugin.id,"-wrap")).clientHeight-58-158,'px;\n overflow: auto;\n ">\n ').concat(0===n?'<div class="inspectEventDetail-content-img-box">\n <p class="inspectEventDetail-content-img-tips" style="display: '.concat(1==this.type?"none":"blcok",';">图片已取证,请填写存证信息:</p>\n <div class="inspectEventDetail-content-img-detail" id="').concat(this.jSPlugin.id,'-inspectEventDetail-picUrl"></div>\n </div>'):'<div class="inspectEventDetail-content-video-box">\n <div\n id="'.concat(this.jSPlugin.id,'-inspectEventDetail-content-video-timer"\n class="inspectEventDetail-content-video-timer"\n style="display: ').concat(1==this.type?"none":"flex",';"\n >\n <div class="video-recording-time-wrap">\n <svg fill="currentColor" width="10" height="10" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 10 10" style="enable-background:new 0 0 10 10;" xml:space="preserve"><circle class="st0" cx="5" cy="5" r="3"/><path class="st1" d="M5,10c-2.8,0-5-2.2-5-5c0-2.8,2.2-5,5-5s5,2.2,5,5C10,7.8,7.8,10,5,10z M5,0.5c-2.5,0-4.5,2-4.5,4.5c0,2.5,2,4.5,4.5,4.5s4.5-2,4.5-4.5C9.5,2.5,7.5,0.5,5,0.5z"/></svg>\n <div id="').concat(this.jSPlugin.id,'-video-recording-time" class="video-recording-time">00:00:00</div>\n </div>\n <button id="').concat(this.jSPlugin.id,'-video-recording-stop-btn" class="inspectEventDetail-stop-btn ezuikit-btn">\n <span style="display:none" class="ezuikit-btn-loading-icon" style=""><span role="img" aria-label="loading" class="anticon anticon-loading anticon-spin"><svg viewBox="0 0 1024 1024" focusable="false" data-icon="loading" width="1em" height="1em" fill="currentColor" aria-hidden="true"><path d="M988 548c-19.9 0-36-16.1-36-36 0-59.4-11.6-117-34.6-171.3a440.45 440.45 0 00-94.3-139.9 437.71 437.71 0 00-139.9-94.3C629 83.6 571.4 72 512 72c-19.9 0-36-16.1-36-36s16.1-36 36-36c69.1 0 136.2 13.5 199.3 40.3C772.3 66 827 103 874 150c47 47 83.9 101.8 109.7 162.7 26.7 63.1 40.2 130.2 40.2 199.3.1 19.9-16 36-35.9 36z"></path></svg></span></span>\n 停止录制\n </button>\n </div>\n <div id="').concat(this.jSPlugin.id,'-inspectEventDetail-content-video-info" class="inspectEventDetail-content-video-info" style="display: ').concat(1==this.type?"block":"none",';">\n <p class="inspectEventDetail-content-video-tips" style="display: ').concat(1==this.type?"none":"blcok",';">视频已取证:</p>\n <div class="inspectEventDetail-content-video-detail" id="').concat(this.jSPlugin.id,'-inspectEventDetail-videoPreview"></div>\n </div>\n </div>'),'\n <div class="inspectEventDetail-content-info">\n <div class="inspectEventDetail-content-info-item">\n <div class="inspectEventDetail-content-info-item-title">事件时间:</div>\n <div id="').concat(this.jSPlugin.id,'-inspectEventDetail-content-info-time" class="inspectEventDetail-content-info-item-value"></div>\n </div>\n <div class="inspectEventDetail-content-info-item">\n <div class="inspectEventDetail-content-info-item-title">存证人员:</div>\n <div class="inspectEventDetail-content-info-item-value">\n ').concat(1===this.type?this.currentEventInfo.depositaryOfficer?"null"===this.currentEventInfo.depositaryOfficer?"-":this.currentEventInfo.depositaryOfficer:"-":this.inspectInfo.inspectPerson?"null"===this.inspectInfo.inspectPerson?"-":this.inspectInfo.inspectPerson:"-",'\n </div>\n </div>\n <div class="inspectEventDetail-content-info-item">\n <div class="inspectEventDetail-content-info-item-title inspectEventDetail-content-info-item-title-required">事件标签:</div>\n <div class="ezuikit-form-item-control-input">\n <div class="ezuikit-form-item-control-input-content">\n <input\n id="').concat(this.jSPlugin.id,'-event-tag"\n maxlength="32"\n type="text"\n autocomplete="off"\n id="control-ref_note"\n class="ezuikit-input"\n placeholder="请输入事件标签"\n value="').concat(1===this.type&&this.currentEventInfo.eventType||"",'"\n />\n </div>\n <div class="ezuikit-form-item-explain ezuikit-form-item-explain-connected">\n <div id="').concat(this.jSPlugin.id,'-event-tag-error" class="ezuikit-form-item-explain-error" style="display: none">请输入事件标签</div>\n </div>\n </div>\n </div>\n <div class="inspectEventDetail-content-info-item">\n <div class="inspectEventDetail-content-info-item-title">事件备注:</div>\n <div class="ezuikit-input-textarea ezuikit-input-textarea-show-count" data-count="').concat(1===this.type&&this.currentEventInfo.eventRemark?this.currentEventInfo.eventRemark.length:0,' / 100">\n <textarea\n id="').concat(this.jSPlugin.id,'-event-remark"\n maxlength="100"\n class="ezuikit-input"\n maxlength="100"\n placeholder="请输入事件备注"\n autocomplete="off"\n >').concat(1===this.type&&this.currentEventInfo.eventRemark||"",'</textarea>\n </div>\n </div>\n </div>\n </div>\n <div class="inspectEventDetail-footer">\n <button id="').concat(this.jSPlugin.id,'-event-cancel" class="inspectEventDetail-footer-btn ezuikit-btn">取消</button>\n <button id="').concat(this.jSPlugin.id,'-event-ok" class="inspectEventDetail-footer-btn ezuikit-btn ezuikit-btn-primary">保存</button>\n </div>\n '),document.getElementById("".concat(this.jSPlugin.id,"-inspect-event-detail-box")).appendChild(r),1===this.type?document.getElementById("".concat(this.jSPlugin.id,"-inspectEventDetail-content-info-time")).innerHTML="".concat(1===n?this.currentEventInfo.eventBeginTime+" ~ "+this.currentEventInfo.eventEndTime:this.currentEventInfo.eventTime):(document.getElementById("".concat(this.jSPlugin.id,"-inspectEventDetail-content-info-time")).innerHTML="".concat((new Date).Format("yyyy-MM-dd hh:mm:ss")).concat(1===n?" ~ -":""),1===n&&document.getElementById("".concat(this.jSPlugin.id,"-video-recording-time"))&&this.videoRecordingStatus&&(0===this.type&&document.getElementById("".concat(this.jSPlugin.id,"-event-ok")).setAttribute("disabled","disabled"),this.timer.createInterval("videoRecordingTimer",(function(){var t,n,i,o;e.startTime&&(document.getElementById("".concat(e.jSPlugin.id,"-video-recording-time")).innerHTML=(t=e.startTime,n=parseInt(t%864e5/36e5),i=parseInt(t%36e5/6e4),o=parseInt(t%6e4/1e3),(n<10?"0".concat(n):n)+":"+(i<10?"0".concat(i):i)+":"+(o<10?"0".concat(o):o))),e.startTime+=1e3,e.startTime>e.jSPlugin.inspectRecordingDuration&&(document.getElementById("".concat(e.jSPlugin.id,"-video-recording-stop-btn")).click(),e.timer&&e.timer.clearTimer("videoRecordingTimer"))}),1e3))),1===n){var c=this.currentEventInfo&&this.currentEventInfo.fileUrl;this.renderVideo(o,s,c)}else new ft({id:"".concat(this.jSPlugin.id,"-inspectEventDetail-picUrl"),src:s,fallback:"".concat(this.jSPlugin.staticPath,"/imgs/fallback.svg"),showIcon:!1});this.show()}},{key:"eventDetailDomEvent",value:function(){var e=this,t=this.currentEventInfo,n=t.evidenceFileType,i=t.evidenceId;document.getElementById("".concat(this.jSPlugin.id,"-event-cancel")).addEventListener("click",(function(t){e.cancelPopover=new yt({id:"".concat(e.jSPlugin.id,"-event-cancel"),content:"确定要取消吗?".concat(1===e.type?"取消后编辑的内容将不会保存。":"取消后对应存证也将删除。"),placement:"topRight",arrowPointAtCenter:!0,onCancel:function(){e.cancelPopover.hide()},onConfirm:function(){1===n&&(e.videoRecordingStatus&&0===e.type&&(e.timer&&e.timer.clearTimer("videoRecordingTimer"),e.startTime=1e3,document.getElementById("".concat(e.jSPlugin.id,"-video-recording-stop-btn")).click()),e.timer.clearTimer("videoRecordingStatusTimer")),e.cancelPopover.hide(),e.hide()}})})),document.getElementById("".concat(this.jSPlugin.id,"-event-ok")).addEventListener("click",(function(){if(e.validationEventTag()){var t=e.currentEventInfo,n=t.evidenceFileType,i=t.evidenceId,o=e.inspectInfo,a=o.inspectRecordId,r=o.inspectPerson,s=document.getElementById("".concat(e.jSPlugin.id,"-inspectEventDetail-content-info-time")).innerHTML,c={inspectRecordId:a,depositaryOfficer:r,evidenceFileId:i,evidenceFileType:n,eventType:document.getElementById("".concat(e.jSPlugin.id,"-event-tag")).value,eventRemark:document.getElementById("".concat(e.jSPlugin.id,"-event-remark")).value};1===n&&(c.eventBeginTime=s.split("~")[0].trim(),c.eventEndTime=s.split("~")[1].trim(),e.timer.clearTimer("videoRecordingStatusTimer")),0===n&&(c.eventTime=s),1===e.type&&(c.inspectEventId=e.currentEventInfo.inspectEventId,delete c.depositaryOfficer,delete c.eventTime,delete c.eventBeginTime,delete c.eventEndTime,delete c.evidenceFileId,delete c.evidenceFileType,function(e,t,n,i){var o={accessToken:e.accessToken||e.token.httpToken.url,inspectRecordId:"",inspectEventId:"",eventType:"",eventRemark:""},a=Object.assign(o,t),r="".concat(e.env.domain,"/api/service/devicekit/bodycamera/inspect/event/update");Ye(r,"POST",a,(function(e){n&&n(e)}),(function(e){i&&i(e)}),{"Content-Type":"application/x-www-form-urlencoded"})}(e.jSPlugin,c,(function(t){t.meta&&200===t.meta.code?(e.hide(),e.saveSuccessCallback&&e.saveSuccessCallback({eventType:c.eventType,eventRemark:c.eventRemark})):new gt({type:"error",content:"保存失败,".concat(t.meta&&t.meta.message||"请稍后重试!"),wrapNode:document.getElementById("".concat(e.jSPlugin.id,"-inspect-event-box")),top:40})}),(function(){new gt({type:"error",content:"保存失败,请稍后重试!",wrapNode:document.getElementById("".concat(e.jSPlugin.id,"-inspect-event-box")),top:40})}))),0===e.type&&function(e,t,n,i){var o={accessToken:e.accessToken||e.token.httpToken.url,inspectRecordId:"",eventType:"",evidenceFileId:"",eventTime:"",eventBeginTime:"",eventEndTime:"",depositaryOfficer:"",eventRemark:"",evidenceFileType:""},a=Object.assign(o,t),r="".concat(e.env.domain,"/api/service/devicekit/bodycamera/inspect/event");Ye(r,"POST",a,(function(e){n&&n(e)}),(function(e){i&&i(e)}),{"Content-Type":"application/x-www-form-urlencoded"})}(e.jSPlugin,c,(function(t){t.meta&&200===t.meta.code?(e.hide(),e.saveSuccessCallback&&e.saveSuccessCallback()):new gt({type:"error",content:"保存失败,".concat(t.meta&&t.meta.message||"请稍后重试!"),wrapNode:document.getElementById("".concat(e.jSPlugin.id,"-inspect-event-box")),top:40})}),(function(){new gt({type:"error",content:"保存失败,请稍后重试!",wrapNode:document.getElementById("".concat(e.jSPlugin.id,"-inspect-event-box")),top:40})}))}})),document.getElementById("".concat(this.jSPlugin.id,"-inspectEventDetail-back")).addEventListener("click",(function(){e.backPopover=new yt({id:"".concat(e.jSPlugin.id,"-inspectEventDetail-back"),content:"确定要返回吗?".concat(1===e.type?"返回后编辑的内容将不会保存。":"返回后对应存证也将删除。"),placement:"bottomRight",arrowPointAtCenter:!0,onCancel:function(){e.backPopover.hide()},onConfirm:function(){1===n&&(e.videoRecordingStatus&&0===e.type&&(e.timer&&e.timer.clearTimer("videoRecordingTimer"),e.startTime=1e3,document.getElementById("".concat(e.jSPlugin.id,"-video-recording-stop-btn")).click()),e.timer.clearTimer("videoRecordingStatusTimer")),e.backPopover.hide(),e.hide()}})})),document.getElementById("".concat(this.jSPlugin.id,"-video-recording-stop-btn"))&&document.getElementById("".concat(this.jSPlugin.id,"-video-recording-stop-btn")).addEventListener("click",(function(){document.getElementById("".concat(e.jSPlugin.id,"-video-recording-stop-btn")).setAttribute("class","inspectEventDetail-stop-btn ezuikit-btn ezuikit-btn-loading"),document.getElementById("".concat(e.jSPlugin.id,"-video-recording-stop-btn")).querySelector(".ezuikit-btn-loading-icon").style.display="inline-block",function(e,t,n,i){var o={accessToken:e.accessToken||e.token.httpToken.url,taskId:t},a="".concat(e.env.domain,"/api/v3/open/cloud/video/frame/stop");Ye(a,"POST",o,(function(e){n&&n(e)}),(function(e){i&&i(e)}),{"Content-Type":"application/x-www-form-urlencoded"})}(e.jSPlugin,i,(function(t){document.getElementById("".concat(e.jSPlugin.id,"-video-recording-stop-btn"))&&(document.getElementById("".concat(e.jSPlugin.id,"-video-recording-stop-btn")).setAttribute("class","inspectEventDetail-stop-btn ezuikit-btn"),document.getElementById("".concat(e.jSPlugin.id,"-video-recording-stop-btn")).querySelector(".ezuikit-btn-loading-icon").style.display="none"),t.meta&&200===t.meta.code?wt(e.jSPlugin,i,(function(t){if(t.meta&&200===t.meta.code){var n=t.data,i=n.taskStatus,o=n.fileUrl,a=n.videoCoverPic;e.timer&&e.timer.clearTimer("videoRecordingTimer");var r=a||"".concat(e.jSPlugin.staticPath,"/imgs/bg.svg");e.renderVideo(i,r,o),document.getElementById("".concat(e.jSPlugin.id,"-inspectEventDetail-content-video-info")).style.display="block",document.getElementById("".concat(e.jSPlugin.id,"-inspectEventDetail-content-video-timer")).style.display="none";var s=document.getElementById("".concat(e.jSPlugin.id,"-inspectEventDetail-content-info-time")).innerHTML;document.getElementById("".concat(e.jSPlugin.id,"-inspectEventDetail-content-info-time")).innerHTML="".concat(s.split("~")[0]," ~ ").concat((new Date).Format("yyyy-MM-dd hh:mm:ss")),e.videoRecordingStatus=!1,document.getElementById("".concat(e.jSPlugin.id,"-event-ok")).removeAttribute("disabled")}})):new gt({type:"error",content:"停止录制失败,请稍后重试!",wrapNode:document.getElementById("".concat(e.jSPlugin.id,"-inspect-event-box")),top:40})}),(function(){document.getElementById("".concat(e.jSPlugin.id,"-video-recording-stop-btn"))&&(document.getElementById("".concat(e.jSPlugin.id,"-video-recording-stop-btn")).setAttribute("class","inspectEventDetail-stop-btn ezuikit-btn"),document.getElementById("".concat(e.jSPlugin.id,"-video-recording-stop-btn")).querySelector(".ezuikit-btn-loading-icon").style.display="none"),new gt({type:"error",content:"停止录制失败,请稍后重试!",wrapNode:document.getElementById("".concat(e.jSPlugin.id,"-inspect-event-box")),top:40})}))})),document.getElementById("".concat(this.jSPlugin.id,"-event-tag")).addEventListener("input",(function(){e.validationEventTag()})),document.getElementById("".concat(this.jSPlugin.id,"-event-remark")).addEventListener("input",(function(e){var t=e.target.value;e.target.parentNode.setAttribute("data-count","".concat(t.length," / 100"))})),document.getElementById("".concat(this.jSPlugin.id,"-event-remark")).addEventListener("focus",(function(e){e.target.parentNode.setAttribute("class","ezuikit-input-textarea ezuikit-input-textarea-show-count ezuikit-input-textarea-focus")})),document.getElementById("".concat(this.jSPlugin.id,"-event-remark")).addEventListener("blur",(function(e){e.target.parentNode.setAttribute("class","ezuikit-input-textarea ezuikit-input-textarea-show-count")}))}}])}(),Et=function(){return m((function e(t,n,i){var o=this;l(this,e),p(this,"hideDelEConfirm",(function(){for(var e=0;e<o.delEConfirmList.length;e++)o.delEConfirmList[e].hide()})),p(this,"initRender",(function(){var e=o;if(document.getElementById("".concat(o.jSPlugin.id,"-inspect-event-box")))document.getElementById("".concat(o.jSPlugin.id,"-inspect-event-box"))&&document.getElementById("".concat(o.jSPlugin.id,"-wrap")).removeChild(document.getElementById("".concat(o.jSPlugin.id,"-inspect-event-box"))),e.initRender();else{var t=document.createElement("div");t.id="".concat(o.jSPlugin.id,"-inspect-event-box"),t.setAttribute("class","inspect-event-box");var n=0;document.getElementById("".concat(o.jSPlugin.id,"-inspectInfoControl"))&&(n=document.getElementById("".concat(o.jSPlugin.id,"-inspectInfoControl")).clientHeight),t.style="background: #fff;position: absolute;right: 0;bottom: 0; top:".concat(n,"px;"),t.innerHTML='\n <div id="'.concat(o.jSPlugin.id,'-inspect-event-list-box" style="\n width: 290px;\n height: 100%;\n overflow: hidden;\n padding: 0;\n box-sizing: border-box;\n ">\n <h1 style="\n font-size: 16px;\n color: #262626;\n line-height: 24px;\n font-weight: bold;\n margin: 16px 16px 0;\n ">巡检事件</h1>\n <div id="').concat(o.jSPlugin.id,'-inspect-event-btn-wrap" style="\n display: flex;\n align-items: center;\n justify-content: space-between;\n padding: 16px 16px;\n ">\n <div>\n <button\n id="').concat(o.jSPlugin.id,'-inspect-event-img"\n style="min-width: 88px; margin: 0 auto;"\n type="button"\n class="ezuikit-btn ezuikit-btn-primary"\n >\n <span style="display:none" class="ezuikit-btn-loading-icon" style=""><span role="img" aria-label="loading" class="anticon anticon-loading anticon-spin"><svg viewBox="0 0 1024 1024" focusable="false" data-icon="loading" width="1em" height="1em" fill="currentColor" aria-hidden="true"><path d="M988 548c-19.9 0-36-16.1-36-36 0-59.4-11.6-117-34.6-171.3a440.45 440.45 0 00-94.3-139.9 437.71 437.71 0 00-139.9-94.3C629 83.6 571.4 72 512 72c-19.9 0-36-16.1-36-36s16.1-36 36-36c69.1 0 136.2 13.5 199.3 40.3C772.3 66 827 103 874 150c47 47 83.9 101.8 109.7 162.7 26.7 63.1 40.2 130.2 40.2 199.3.1 19.9-16 36-35.9 36z"></path></svg></span></span>\n 图片存证\n </button>\n <button\n id="').concat(o.jSPlugin.id,'-inspect-event-video"\n style="min-width: 88px; margin: 0 auto;"\n type="button"\n class="ezuikit-btn ezuikit-btn-primary"\n >\n <span style="display:none" class="ezuikit-btn-loading-icon" style=""><span role="img" aria-label="loading" class="anticon anticon-loading anticon-spin"><svg viewBox="0 0 1024 1024" focusable="false" data-icon="loading" width="1em" height="1em" fill="currentColor" aria-hidden="true"><path d="M988 548c-19.9 0-36-16.1-36-36 0-59.4-11.6-117-34.6-171.3a440.45 440.45 0 00-94.3-139.9 437.71 437.71 0 00-139.9-94.3C629 83.6 571.4 72 512 72c-19.9 0-36-16.1-36-36s16.1-36 36-36c69.1 0 136.2 13.5 199.3 40.3C772.3 66 827 103 874 150c47 47 83.9 101.8 109.7 162.7 26.7 63.1 40.2 130.2 40.2 199.3.1 19.9-16 36-35.9 36z"></path></svg></span></span>\n 视频存证</button>\n </div>\n <div id="').concat(o.jSPlugin.id,'-inspect-event-list-refresh" style="\n width: 17px;\n height: 32px;\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: center;\n ">\n <svg viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" width="13" height="13" xmlns:xlink="http://www.w3.org/1999/xlink">\n <path fill="currentColor" d="M960 416V192l-73.056 73.056a447.712 447.712 0 0 0-373.6-201.088C265.92 63.968 65.312 264.544 65.312 512S265.92 960.032 513.344 960.032a448.064 448.064 0 0 0 415.232-279.488 38.368 38.368 0 1 0-71.136-28.896 371.36 371.36 0 0 1-344.096 231.584C308.32 883.232 142.112 717.024 142.112 512S308.32 140.768 513.344 140.768c132.448 0 251.936 70.08 318.016 179.84L736 416h224z"></path>\n </svg>\n </div>\n </div>\n <div\n id="').concat(o.jSPlugin.id,'-inspect-loading"\n class="inspect-loading"\n style="\n height: calc(100% - 104px);\n position: absolute; bottom: 0; right: 0;background: #fff; bottom: 0; right: 0; z-index: 99; width: 100%; align-items: center; justify-content: center;\n display: ').concat(o.listLoading?"flex":"none",'\n ">\n <div type="default" class="ezuikit-spin ezuikit-spin-spinning"><span class="ezuikit-spin-dot ezuikit-spin-dot-spin ezuikit-spin-dot-default"><i class="ezuikit-spin-dot-item"></i><i class="ezuikit-spin-dot-item"></i><i class="ezuikit-spin-dot-item"></i><i class="ezuikit-spin-dot-item"></i></span></div>\n </div>\n <div id="').concat(o.jSPlugin.id,'-inspect-event-list-nodata-wrap" style="\n display: none;\n height: calc(100% - 104px);\n text-align: center;overflow: auto;\n "> \n <img style="width: 85px;height: 85px; margin: 120px auto 0;" src="').concat(o.jSPlugin.staticPath,'/imgs/empty.png" />\n <p style="font-size: 14px;color: #595959;text-align: center;line-height: 22px;margin: 0;">暂无事件</p>\n </div>\n <div class="inspect-event-list-wrap" id="').concat(o.jSPlugin.id,'-inspect-event-list-wrap"\n style="display: none; height: calc(100% - 104px); overflow-x: hidden; overflow-y: auto; padding-top: 4px; box-sizing: border-box; ">\n <div id="').concat(o.jSPlugin.id,'-inspect-event-list-wrap-main"></div>\n <div id="').concat(o.jSPlugin.id,'-inspect-event-list-more-loading" style="display: none;align-items: center;justify-content: center;" class="inspect-event-list-more-loading">\n <div type="default" class="ezuikit-spin ezuikit-spin-spinning"><span class="ezuikit-spin-dot ezuikit-spin-dot-spin ezuikit-spin-dot-default"><i class="ezuikit-spin-dot-item"></i><i class="ezuikit-spin-dot-item"></i><i class="ezuikit-spin-dot-item"></i><i class="ezuikit-spin-dot-item"></i></span></div>\n </div>\n </div>\n </div>\n <div id="').concat(o.jSPlugin.id,'-inspect-event-detail-wrap" class="inspect-event-detail-wrap" style="\n height: 100%;\n ">\n <h1 style="\n font-size: 16px;\n color: #262626;\n line-height: 24px;\n font-weight: bold;\n margin: 16px 16px 0;\n ">巡检事件</h1>\n <div id="').concat(o.jSPlugin.id,'-inspect-event-detail-box"></div>\n </div>\n '),document.getElementById("".concat(o.jSPlugin.id,"-wrap")).appendChild(t),o.jSPlugin.Theme.decoderState.state.play?o.enableEvidenceBtn():o.disableEvidenceBtn(),document.getElementById("".concat(o.jSPlugin.id,"-inspect-event-img")).onclick=function(){o.listLoading||o.startEvidence||(o.startEvidence=!0,o.hideDelEConfirm(),document.getElementById("".concat(o.jSPlugin.id,"-inspect-event-img")).setAttribute("class","ezuikit-btn ezuikit-btn-primary ezuikit-btn-loading"),document.getElementById("".concat(o.jSPlugin.id,"-inspect-event-img")).querySelector(".ezuikit-btn-loading-icon").style.display="inline-block",bt(o.jSPlugin,0,(function(e){o.startEvidence=!1,document.getElementById("".concat(o.jSPlugin.id,"-inspect-event-img")).setAttribute("class","ezuikit-btn ezuikit-btn-primary"),document.getElementById("".concat(o.jSPlugin.id,"-inspect-event-img")).querySelector(".ezuikit-btn-loading-icon").style.display="none",e.meta&&200===e.meta.code?new Tt(o.jSPlugin,e.data,o.timer,0,(function(){o.initEvent(),new gt({type:"success",content:"保存成功",wrapNode:document.getElementById("".concat(o.jSPlugin.id,"-inspect-event-box")),top:40})})):new gt({type:"error",content:"图片存证失败,".concat(e.meta&&e.meta.message||"请稍后重试!"),wrapNode:document.getElementById("".concat(o.jSPlugin.id,"-inspect-event-box")),top:40})}),(function(){o.startEvidence=!1,document.getElementById("".concat(o.jSPlugin.id,"-inspect-event-img")).setAttribute("class","ezuikit-btn ezuikit-btn-primary"),document.getElementById("".concat(o.jSPlugin.id,"-inspect-event-img")).querySelector(".ezuikit-btn-loading-icon").style.display="none",new gt({type:"error",content:"图片存证失败,请稍后重试!",wrapNode:document.getElementById("".concat(o.jSPlugin.id,"-inspect-event-box")),top:40})})))},document.getElementById("".concat(o.jSPlugin.id,"-inspect-event-video")).onclick=function(){o.listLoading||o.startEvidence||(o.startEvidence=!0,o.hideDelEConfirm(),document.getElementById("".concat(o.jSPlugin.id,"-inspect-event-video")).setAttribute("class","ezuikit-btn ezuikit-btn-primary ezuikit-btn-loading"),document.getElementById("".concat(o.jSPlugin.id,"-inspect-event-video")).querySelector(".ezuikit-btn-loading-icon").style.display="inline-block",bt(o.jSPlugin,1,(function(e){o.startEvidence=!1,document.getElementById("".concat(o.jSPlugin.id,"-inspect-event-video")).setAttribute("class","ezuikit-btn ezuikit-btn-primary"),document.getElementById("".concat(o.jSPlugin.id,"-inspect-event-video")).querySelector(".ezuikit-btn-loading-icon").style.display="none",e.meta&&200===e.meta.code?new Tt(o.jSPlugin,e.data,o.timer,0,(function(){o.initEvent(),new gt({type:"success",content:"保存成功",wrapNode:document.getElementById("".concat(o.jSPlugin.id,"-inspect-event-box")),top:40})})):new gt({type:"error",content:"视频存证失败,".concat(e.meta&&e.meta.message||"请稍后重试!"),wrapNode:document.getElementById("".concat(o.jSPlugin.id,"-inspect-event-box")),top:40})}),(function(){o.startEvidence=!1,document.getElementById("".concat(o.jSPlugin.id,"-inspect-event-video")).setAttribute("class","ezuikit-btn ezuikit-btn-primary"),document.getElementById("".concat(o.jSPlugin.id,"-inspect-event-video")).querySelector(".ezuikit-btn-loading-icon").style.display="none",new gt({type:"error",content:"视频存证失败,请稍后重试!",wrapNode:document.getElementById("".concat(o.jSPlugin.id,"-inspect-event-box")),top:40})})))},document.getElementById("".concat(o.jSPlugin.id,"-inspect-event-list-refresh")).onclick=function(){o.listLoading||o.startEvidence||(o.hideDelEConfirm(),document.getElementById("".concat(o.jSPlugin.id,"-inspect-loading")).style.display="block",document.getElementById("".concat(o.jSPlugin.id,"-inspect-event-list-wrap")).style.display="none",document.getElementById("".concat(o.jSPlugin.id,"-inspect-event-list-nodata-wrap")).style.display="none",e.initEvent())}}})),p(this,"renderList",(function(e){document.getElementById("".concat(o.jSPlugin.id,"-inspect-loading")).style.display="none";var t=e.data||[];if(t.length>0){document.getElementById("".concat(o.jSPlugin.id,"-inspect-event-list-wrap")).style.display="block",document.getElementById("".concat(o.jSPlugin.id,"-inspect-event-list-nodata-wrap")).style.display="none";for(var n=function(){var n=document.createElement("div");n.setAttribute("class","inspect-event-item");var a=t[i];n.setAttribute("id","".concat(o.jSPlugin.id,"-inspect-event-item-").concat(a.inspectEventId)),n.innerHTML="",document.getElementById("".concat(o.jSPlugin.id,"-inspect-event-list-wrap-main")).appendChild(n);var r,s=document.createElement("div");s.setAttribute("class","inspect-event-item-header-wrap"),1==a.evidenceFileType&&(r="".concat(a.eventBeginTime.split(" ")[1],"~").concat(a.eventEndTime.split(" ")[1])),0==a.evidenceFileType&&(r="".concat(a.eventTime.split(" ")[1]));var c="";1===a.evidenceFileType&&(1===a.taskStatus||2===a.taskStatus?c="storage":4===a.taskStatus||5===a.taskStatus||6===a.taskStatus||7===a.taskStatus?c="storage-error":0!==a.taskStatus&&3!==a.taskStatus||(c="storage-success")),s.innerHTML='\n <div class="inspect-event-item-header '.concat(c,'">\n <div class="inspect-event-item-header-left">\n <span class="inspect-event-item-status-wrap">\n <span class="inspect-event-item-status"></span>\n </span>\n <svg fill="currentColor" style="display: ').concat(1===a.evidenceFileType?"block":"none",'" width="16" height="16" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"\n\t viewBox="0 0 14 12" style="enable-background:new 0 0 14 12;" xml:space="preserve">\n <path d="M1,12c-0.6,0-1-0.4-1-1V1c0-0.6,0.4-1,1-1h12c0.6,0,1,0.4,1,1v10c0,0.6-0.4,1-1,1H1z M1,11h1.6l0-3.5H1V11z\n M10.5,1h-7v10h7V1z M13,7.5h-1.6l0,3.5H13V7.5z M6.1,4.2l2.3,1.2c0.4,0.2,0.4,0.6,0,0.8L8.1,6.3l-2,1c-0.2,0.1-0.4,0-0.4-0.2V4.4\n C5.7,4.2,5.9,4.1,6.1,4.2z M13,6.6V4.9h-1.6v1.8H13z M1,6.6h1.6V4.9H1V6.6z M13,4V1h-1.6l0,3H13z M2.6,1H1v3h1.6L2.6,1z"/>\n </svg>\n <svg fill="currentColor" style="display: ').concat(1===a.evidenceFileType?"none":"block",'" width="16" height="16" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"\n viewBox="0 0 14 12" style="enable-background:new 0 0 14 12;" xml:space="preserve">\n <path class="st0" d="M13,0c0.6,0,1,0.4,1,1v10c0,0.6-0.4,1-1,1H1c-0.6,0-1-0.4-1-1V1c0-0.6,0.4-1,1-1H13z M10.4,6.2L5.6,9.8L3.8,8\n L1,10v1h12V9L10.4,6.2z M13,1H1v7.8l2.9-2.1l1.8,1.8l4.9-3.6L13,7.5V1z M5.5,2C6.3,2,7,2.7,7,3.5S6.3,5,5.5,5S4,4.3,4,3.5\n S4.7,2,5.5,2z M5.5,3C5.2,3,5,3.2,5,3.5S5.2,4,5.5,4S6,3.8,6,3.5S5.8,3,5.5,3z"/>\n </svg>\n <span class="inspect-event-item-time">').concat(r||"-",'</span>\n </div>\n <div class="inspect-event-item-header-right">\n <span class="inspect-event-item-header-toggle">\n <svg fill="currentColor" class="inspect-event-item-header-toggle-up" style="display: none;" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="16" height="16"><path d="M218.496 645.312l46.464 44.032 247.616-261.568 246.4 261.504 46.528-43.904-292.8-310.72z"></path></svg> \n <svg fill="currentColor" class="inspect-event-item-header-toggle-down" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="16" height="16"><path d="M218.496 378.688l46.464-44.032 247.616 261.568 246.4-261.504 46.528 43.904-292.8 310.72z"></path></svg>\n </span>\n </div>\n </div>\n '),n.appendChild(s),s.onclick=function(e){"none"===s.querySelector(".inspect-event-item-header-toggle-up").style.display?(s.querySelector(".inspect-event-item-header-toggle-up").style.display="block",s.querySelector(".inspect-event-item-header-toggle-down").style.display="none",n.querySelector(".inspect-event-item-body").style.display="block"):(s.querySelector(".inspect-event-item-header-toggle-up").style.display="none",s.querySelector(".inspect-event-item-header-toggle-down").style.display="block",n.querySelector(".inspect-event-item-body").style.display="none")};var l=document.createElement("div");l.setAttribute("class","inspect-event-item-body"),l.style.display="none";var d=(1===a.evidenceFileType?a.videoCoverPic:a.fileUrl)||"".concat(o.jSPlugin.staticPath,"/imgs/bg.svg");l.innerHTML='\n <div class="inspect-event-item-img" id="'.concat(o.jSPlugin.id,"-inspect-view-").concat(a.inspectEventId,'"></div>\n <div class="inspect-event-item-body-info">\n <div class="inspect-event-item-body-info-tag">\n <span class="inspect-event-item-body-info-tag-label" title="').concat(a.eventType,'">').concat(a.eventType,"</span>\n </div>\n </div>\n "),n.appendChild(l),1==a.evidenceFileType&&(1===a.taskStatus||2===a.taskStatus?document.getElementById("".concat(o.jSPlugin.id,"-inspect-view-").concat(a.inspectEventId)).innerHTML='\n <div class="video-stroage-exceptional-status-tips-wrap" style="background:url('.concat(o.jSPlugin.staticPath,'/imgs/bg.svg) no-repeat 100%/cover">\n <div class="video-stroage-exceptional-status-icon">\n <div type="default" class="ezuikit-spin ezuikit-spin-sm ezuikit-spin-spinning ezuikit-spin-dot-white"><span class="ezuikit-spin-dot ezuikit-spin-dot-spin ezuikit-spin-dot-default"><i class="ezuikit-spin-dot-item"></i><i class="ezuikit-spin-dot-item"></i><i class="ezuikit-spin-dot-item"></i><i class="ezuikit-spin-dot-item"></i></span></div>\n </div>\n <span class="video-stroage-exceptional-status-tips">视频正在存储中…</span>\n </div>\n '):4===a.taskStatus?document.getElementById("".concat(o.jSPlugin.id,"-inspect-view-").concat(a.inspectEventId)).innerHTML='\n <div class="video-stroage-exceptional-status-tips-wrap video-stroage-exceptional-status-tips-error" style="background:url('.concat(o.jSPlugin.staticPath,'/imgs/bg.svg) no-repeat 100%/cover">\n <div class="video-stroage-exceptional-status-icon">\n <svg fill="currentColor" t="1691567317943" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="1em" height="1em"><path d="M512 64a448 448 0 1 0 0 896A448 448 0 0 0 512 64z m32 664a8 8 0 0 1-8 8h-48a8 8 0 0 1-8-8v-272c0-4.416 3.584-8 8-8h48c4.416 0 8 3.584 8 8v272zM512 384a48 48 0 1 1 0-96A48 48 0 0 1 512 384z"></path></svg>\n </div>\n <span class="video-stroage-exceptional-status-tips">视频存储失败</span>\n </div>\n '):0!==a.taskStatus&&3!==a.taskStatus||new St({id:"".concat(o.jSPlugin.id,"-inspect-view-").concat(a.inspectEventId),src:a.fileUrl,poster:d,fallback:"".concat(o.jSPlugin.staticPath,"/imgs/bg.svg")})),0==a.evidenceFileType&&new ft({id:"".concat(o.jSPlugin.id,"-inspect-view-").concat(a.inspectEventId),src:d,fallback:"".concat(o.jSPlugin.staticPath,"/imgs/bg.svg"),showIcon:!1});var u=document.createElement("div");u.setAttribute("class","inspect-event-item-body-info-opr");var m=document.createElement("span");m.setAttribute("class","inspect-event-item-body-info-opr-icon"),m.innerHTML='\n <svg fill="currentColor" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="16" height="16"><path d="M612.992 121.984a64 64 0 0 1 90.496 0l153.92 153.92a64 64 0 0 1 0 90.496l-435.2 435.2a96 96 0 0 1-23.04 17.024l525.312-0.128v64H175.808v-2.304a64 64 0 0 1-66.496-77.632l43.776-199.296a96 96 0 0 1 25.92-47.296zM523.072 302.4l-298.88 298.88a32 32 0 0 0-8.576 15.744l-43.776 199.296 190.848-51.712a32 32 0 0 0 14.272-8.256l300.032-300.032-153.92-153.92z m135.168-135.168L568.32 257.088l153.92 153.984 89.92-89.92-153.92-153.92z"></path></svg>\n ',u.appendChild(m);var h=document.createElement("span");h.setAttribute("class","inspect-event-item-body-info-opr-icon"),h.id="".concat(o.jSPlugin.id,"-inspect-event-del-").concat(a.inspectEventId),h.innerHTML=' \n <svg fill="currentColor" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="16" height="16"><path d="M128 320V256h767.872v64H832v512a64 64 0 0 1-64 64H256a64 64 0 0 1-64-64V320H128z m640 0H256v512h512V320zM464 432v256h-64v-256h64z m160 0v256h-64v-256h64zM704 128v64H320V128h384z"></path></svg>\n ',u.appendChild(h),m.onclick=function(e){o.startEvidence||new Tt(o.jSPlugin,a,o.timer,1,(function(e){new gt({type:"success",content:"保存成功",wrapNode:document.getElementById("".concat(o.jSPlugin.id,"-inspect-event-box")),top:40}),a=Object.assign(a,e),document.getElementById("".concat(o.jSPlugin.id,"-inspect-event-item-").concat(a.inspectEventId)).querySelector(".inspect-event-item-body-info-tag-label").innerHTML=a.eventType,document.getElementById("".concat(o.jSPlugin.id,"-inspect-event-item-").concat(a.inspectEventId)).querySelector(".inspect-event-item-body-info-tag-label").setAttribute("title",a.eventType)}))},h.onclick=function(e){o.startEvidence||(o.delE=new yt({id:"".concat(o.jSPlugin.id,"-inspect-event-del-").concat(a.inspectEventId),content:"确定要删除该事件吗?",placement:"topRight",arrowPointAtCenter:!0,onCancel:function(){o.delE.hide()},onConfirm:function(){!function(e,t,n,i){var o={accessToken:e.accessToken||e.token.httpToken.url,inspectEventId:""},a=Object.assign(o,t),r="".concat(e.env.domain,"/api/service/devicekit/bodycamera/inspect/event/delete");Ye(r,"POST",a,(function(e){n&&n(e)}),(function(e){i&&i(e)}),{"Content-Type":"application/x-www-form-urlencoded"})}(o.jSPlugin,{inspectEventId:a.inspectEventId},(function(e){e.meta&&200===e.meta.code?(o.delE.hide(),o.initEvent(),setTimeout((function(){new gt({type:"success",content:"删除成功",wrapNode:document.getElementById("".concat(o.jSPlugin.id,"-inspect-event-box")),top:40})}),10)):new gt({type:"error",content:"删除失败,".concat(e.meta&&e.meta.message||"请稍后重试!"),wrapNode:document.getElementById("".concat(o.jSPlugin.id,"-inspect-event-box")),top:40})}),(function(){new gt({type:"error",content:"删除失败,请稍后重试!",wrapNode:document.getElementById("".concat(o.jSPlugin.id,"-inspect-event-box")),top:40})}))}}),o.delEConfirmList.push(o.delE))},n.querySelector(".inspect-event-item-body-info").appendChild(u),document.getElementById("".concat(o.jSPlugin.id,"-inspect-event-list-wrap")).onscroll=function(t){var n=t.target;o.hideDelEConfirm(),n.scrollTop+n.offsetHeight>=n.scrollHeight-48&&!o.listLoading&&(e.start+1)*e.size<e.total&&o.initEvent(e.start+1)}},i=0;i<t.length;i++)n()}else document.getElementById("".concat(o.jSPlugin.id,"-inspect-event-list-wrap")).style.display="none",document.getElementById("".concat(o.jSPlugin.id,"-inspect-event-list-nodata-wrap")).style.display="block"})),this.jSPlugin=t,this.videoWidth=t.width,this.inspectRecordId=n,this.timer=i,this.listLoading=!1,this.startEvidence=!1,this.delEConfirmList=[],this.videoHeight=document.getElementById("".concat(t.id,"-wrap")).clientHeight-document.getElementById("".concat(t.id,"-inspectInfoControl")).clientHeight||t.height,this.initEvent()}),[{key:"initEvent",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:30,i=this;i.listLoading=!0,0===t?i.initRender(t):document.getElementById("".concat(this.jSPlugin.id,"-inspect-event-list-more-loading")).style.display="flex";var o=function(t){new gt({type:"error",content:t.meta&&t.meta.message||"列表获取失败,请稍后重试!",wrapNode:document.getElementById("".concat(e.jSPlugin.id,"-inspect-event-box")),top:40}),i.renderList({})};i.inspectRecordId?function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:30,o=arguments.length>4?arguments[4]:void 0,a=arguments.length>5?arguments[5]:void 0,r={accessToken:e.accessToken||e.token.httpToken.url,inspectRecordId:t,pageStart:n,pageSize:i},s="".concat(e.env.domain,"/api/service/devicekit/bodycamera/inspect/event/page");Ye(s,"GET",r,(function(e){o&&o(e)}),(function(e){a&&a(e)}),{"Content-Type":"application/x-www-form-urlencoded"})}(i.jSPlugin,i.inspectRecordId,t,n,(function(t){i.listLoading=!1,document.getElementById("".concat(e.jSPlugin.id,"-inspect-event-list-more-loading")).style.display="none",t.meta&&200===t.meta.code?i.renderList(t.data||{}):o(t)}),(function(t){i.listLoading=!1,document.getElementById("".concat(e.jSPlugin.id,"-inspect-event-list-more-loading")).style.display="none",o(t)})):(i.listLoading=!1,document.getElementById("".concat(this.jSPlugin.id,"-inspect-event-list-more-loading")).style.display="none",i.renderList({}))}},{key:"disableEvidenceBtn",value:function(){document.getElementById("".concat(this.jSPlugin.id,"-inspect-event-img")).setAttribute("disabled","disabled"),document.getElementById("".concat(this.jSPlugin.id,"-inspect-event-video")).setAttribute("disabled","disabled")}},{key:"enableEvidenceBtn",value:function(){document.getElementById("".concat(this.jSPlugin.id,"-inspect-event-img")).removeAttribute("disabled"),document.getElementById("".concat(this.jSPlugin.id,"-inspect-event-video")).removeAttribute("disabled")}}])}(),Pt=function(){return m((function e(t,n,o,a,r){var s=this;l(this,e),p(this,"createLocationControl",(function(){var e=s;function t(){this.defaultAnchor=BMAP_ANCHOR_BOTTOM_LEFT,this.defaultOffset=new BMapGL.Size(40,105)}return t.prototype=new BMapGL.Control,t.prototype.initialize=function(t){var n=document.createElement("div");return n.style.cssText="width: 26px;height: 26px;display: flex;align-items: center;justify-content: center; box-shadow: 1px 2px 1px rgb(0 0 0 / 15%); background: #fff; cursor: pointer;",n.id="".concat(e.jSPlugin.id,"-location-btn"),n.innerHTML='<svg fill="#3385ff" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" width="20" height="20" xmlns:xlink="http://www.w3.org/1999/xlink">\n <path d="M510.976716 128.626761c-211.205756 0-382.401119 171.195363-382.401119 382.401119s171.195363 382.401119 382.401119 382.401119S893.377836 722.131308 893.377836 510.925552 722.182472 128.626761 510.976716 128.626761zM736.508444 736.45728c-29.265914 29.265914-63.443589 52.289797-101.407415 68.355351-29.265914 12.381733-59.964425 20.158689-91.481563 23.433197L543.619466 704.019187l-63.443589 0 0 124.431298c-32.233437-3.069851-63.443589-10.949136-93.323474-23.535525-37.963825-16.065554-72.039173-39.089437-101.407415-68.355351-29.265914-29.265914-52.289797-63.443589-68.355351-101.407415-12.381733-29.265914-20.158689-59.964425-23.433197-91.481563l126.273209 0 0-63.443589L193.554112 480.227041c3.069851-32.233437 10.949136-63.443589 23.535525-93.323474 16.065554-37.963825 39.089437-72.039173 68.355351-101.407415 29.265914-29.265914 63.443589-52.289797 101.407415-68.355351 29.879884-12.58639 61.090037-20.465674 93.323474-23.535525l0 125.863895 63.443589 0L543.619466 193.707605c31.517138 3.172179 62.215649 11.051464 91.481563 23.433197 37.963825 16.065554 72.039173 39.089437 101.407415 68.355351 29.265914 29.265914 52.289797 63.443589 68.355351 101.407415 12.58639 29.879884 20.465674 61.090037 23.535525 93.323474L703.251724 480.227041l0 63.443589 125.045268 0c-3.172179 31.517138-11.051464 62.215649-23.433197 91.481563C788.798241 673.01369 765.876686 707.089038 736.508444 736.45728z" p-id="1506"></path><path d="M516.093135 415.248526c-56.280604 0-100.793445 43.489557-100.793445 99.770161s44.512841 101.816728 100.793445 101.816728S616.886579 571.29929 616.886579 515.018687 572.373738 415.248526 516.093135 415.248526z" p-id="1507"></path>\n </svg>',n.onclick=function(t){setTimeout((function(){e.inspectMapWin.centerToTrack(18)}),100)},t.getContainer().appendChild(n),n},new t})),p(this,"initSwithcBtn",(function(){var e=document.createElement("div");e.id="".concat(s.jSPlugin.id,"-miniSwitch"),e.style="cursor: pointer;position: absolute; bottom: 106px; right: ".concat(s.jSPlugin.inspectVideoWidth+10,"px; z-index: 999;"),e.innerHTML="<div id='".concat(s.jSPlugin.id,'-miniSwitch-btn\' style="width: 32px;height: 32px;display: flex;align-items: center;justify-content: center;border-radius: 50%;background: rgba(0,0,0,0.70);">\n <svg width="20px" height="20px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n <title>大小窗切换</title>\n <g id="icon/大小窗切换" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n <rect id="矩形" x="0" y="0" width="24" height="24"></rect>\n <path d="M16,3.25 C17.5187831,3.25 18.75,4.48121694 18.75,6 L18.75,6 L18.75,6.644 L19.095177,6.64456257 C20.6299163,6.64456257 21.9388658,7.64624846 22.0337198,8.99291851 L22.0392202,9.14979714 L22.0392202,17.639328 C22.0392202,19.0115638 20.7871129,20.0640733 19.2712041,20.1401546 L19.095177,20.1445626 L8.48326347,20.1445626 C6.94852423,20.1445626 5.63957467,19.1428767 5.54472071,17.7962066 L5.53922025,17.639328 L5.539,16.75 L5,16.75 C3.53746816,16.75 2.34159572,15.6082954 2.25501879,14.1675223 L2.25,14 L2.25,6 C2.25,4.48121694 3.48121694,3.25 5,3.25 L5,3.25 Z M18.75,14 C18.75,15.5187831 17.5187831,16.75 16,16.75 L16,16.75 L7.039,16.75 L7.03922025,17.639328 C7.03922025,18.1209822 7.57916546,18.5830417 8.33031492,18.6389177 L8.48326347,18.6445626 L19.095177,18.6445626 C19.873026,18.6445626 20.4615868,18.2126064 20.5321184,17.735283 L20.5392202,17.639328 L20.5392202,9.14979714 C20.5392202,8.66814298 19.999275,8.20608342 19.2481256,8.15020744 L19.095177,8.14456257 L18.75,8.144 Z M16,4.75 L5,4.75 C4.30964406,4.75 3.75,5.30964406 3.75,6 L3.75,6 L3.75,14 C3.75,14.6903559 4.30964406,15.25 5,15.25 L5,15.25 L16,15.25 C16.6903559,15.25 17.25,14.6903559 17.25,14 L17.25,14 L17.25,8.144 L17.2422027,8.14456257 L17.2422027,6.64456257 L17.25,6.644 L17.25,6 C17.25,5.35279131 16.7581253,4.8204661 16.1278052,4.75645361 L16,4.75 Z" id="形状结合" fill="#FFFFFF" fill-rule="nonzero"></path>\n </g>\n </svg>\n </div>'),document.getElementById("".concat(s.jSPlugin.id,"-wrap")).appendChild(e),document.getElementById("".concat(s.jSPlugin.id,"-miniSwitch-btn")).onclick=function(){i.throttle((function(){return s.miniRecSwitchClick()}),1e3)()}})),p(this,"initMiniWinToggleBtn",(function(){var e=.3333*s.videoWidth,t=.3333*s.videoHeight,n=document.createElement("div");n.id="".concat(s.jSPlugin.id,"-miniToggle"),n.style="cursor: pointer;position: absolute; bottom: ".concat(t/2+96-30,"px; right: ").concat(s.jSPlugin.inspectVideoWidth+e,"px; z-index: 999; height:60px; box-sizing: border-box; padding-top: 20px; text-align: center; width:20px; overflow: hidden; background: #000000; border-radius: 2px 0px 0px 2px; opacity: 0.7;"),n.innerHTML="<div id='".concat(s.jSPlugin.id,"-miniToggle-btn'>\n <svg id=\"").concat(s.jSPlugin.id,'-min-win-close-icon" style="display: inline-block" width="20px" height="20px" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="10867" xmlns:xlink="http://www.w3.org/1999/xlink">\n <path d="M378.688 217.856l-44.032 46.464 261.568 247.616-261.504 246.4 43.904 46.528 310.72-292.8z" fill="#ffffff" p-id="10868"></path>\n </svg>\n <svg id="').concat(s.jSPlugin.id,'-min-win-open-icon" style="display: none" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="10671" xmlns:xlink="http://www.w3.org/1999/xlink" width="20" height="20">\n <path d="M645.312 217.856l44.032 46.464-261.568 247.616 261.504 246.4-43.904 46.528-310.72-292.8z" fill="#ffffff" p-id="10672"></path>\n </svg>\n </div>'),document.getElementById("".concat(s.jSPlugin.id,"-wrap")).appendChild(n),document.getElementById("".concat(s.jSPlugin.id,"-miniToggle")).onclick=function(){s.miniWinToggleClick()}})),p(this,"init",(function(){s.initSwithcBtn(),s.initMiniWinToggleBtn()})),p(this,"setStyleListByIds",(function(e){e.map((function(e){var t=document.getElementById(e.id);t&&Object.keys(e.styleList).map((function(n){t.style[n]=e.styleList[n]}))}))})),this.jSPlugin=t,this.inspectMode=n,this.inspectMapWin=o,this.changeInspectMode=a,this.videoWidth=t.width,this.videoHeight=t.height,this.minWinStatus="open",this.decoderState=r,this.ZoomControl=new BMapGL.ZoomControl({anchor:BMAP_ANCHOR_BOTTOM_LEFT,offset:new BMapGL.Size(40,50)}),this.LocationControl=this.createLocationControl(),this.NavigationControl3D=new BMapGL.NavigationControl3D({anchor:BMAP_ANCHOR_BOTTOM_LEFT,offset:new BMapGL.Size(28,105)}),this.init()}),[{key:"miniWinToggleClick",value:function(){var e=.3333*this.jSPlugin.width;"open"===this.minWinStatus?(this.setStyleListByIds([{id:"video"===this.inspectMode?"".concat(this.jSPlugin.id,"-mapbox"):"".concat(this.jSPlugin.id),styleList:{width:"0px"}},{id:"".concat(this.jSPlugin.id,"-miniSwitch"),styleList:{display:"none"}},{id:"".concat(this.jSPlugin.id,"-miniToggle"),styleList:{right:"".concat(this.jSPlugin.inspectVideoWidth,"px")}},{id:"".concat(this.jSPlugin.id,"-min-win-close-icon"),styleList:{display:"none"}},{id:"".concat(this.jSPlugin.id,"-min-win-open-icon"),styleList:{display:"inline-block"}}]),this.minWinStatus="close"):(this.setStyleListByIds([{id:"video"===this.inspectMode?"".concat(this.jSPlugin.id,"-mapbox"):"".concat(this.jSPlugin.id),styleList:{width:e+"px"}},{id:"".concat(this.jSPlugin.id,"-miniSwitch"),styleList:{display:"block"}},{id:"".concat(this.jSPlugin.id,"-miniToggle"),styleList:{right:"".concat(this.jSPlugin.inspectVideoWidth+e,"px")}},{id:"".concat(this.jSPlugin.id,"-min-win-close-icon"),styleList:{display:"inline-block"}},{id:"".concat(this.jSPlugin.id,"-min-win-open-icon"),styleList:{display:"none"}}]),this.minWinStatus="open")}},{key:"miniRecSwitchClick",value:function(){var e=this,t=.3333*this.jSPlugin.width,n=.3333*this.jSPlugin.height;"video"===this.inspectMode?(this.jSPlugin.Zoom&&this.jSPlugin.Zoom.stopZoom(),this.setStyleListByIds([{id:"".concat(this.jSPlugin.id,"-mapbox"),styleList:{width:this.jSPlugin.width+"px",height:this.jSPlugin.height+"px",marginBottom:"-40px"}},{id:"".concat(this.jSPlugin.id,"-ez-iframe-footer-container"),styleList:{top:this.jSPlugin.height+"px"}},{id:"".concat(this.jSPlugin.id),styleList:{position:"absolute",zIndex:"100",bottom:"96px",right:"".concat(this.jSPlugin.inspectVideoWidth,"px"),overflow:"hidden"}}]),this.jSPlugin.Theme.inspect.reSizeVideo(t,n),this.inspectMode="map",this.changeInspectMode("map"),this.inspectMapWin.map.addControl(this.NavigationControl3D),this.inspectMapWin.map.addControl(this.LocationControl),this.inspectMapWin.map.addControl(this.ZoomControl),this.inspectMapWin.map.addOverlay(this.inspectMapWin.inspectRange),document.getElementById("".concat(this.jSPlugin.id,"-loading-item-btn-wrap"))&&this.setStyleListByIds([{id:"".concat(this.jSPlugin.id,"-loading-item-btn"),styleList:{display:"none"}},{id:"".concat(this.jSPlugin.id,"-loading-item-btn-svg"),styleList:{display:"block"}},{id:"".concat(this.jSPlugin.id,"-loading-item-btn-wrap"),styleList:{border:"none",width:"32px",height:"14px"}}]),setTimeout((function(){e.inspectMapWin.centerToTrack(18)}),100)):(this.setStyleListByIds([{id:"".concat(this.jSPlugin.id,"-mapbox"),styleList:{width:t+"px",height:n+"px",marginBottom:"0"}},{id:"".concat(this.jSPlugin.id,"-ez-iframe-footer-container"),styleList:{top:"0px"}},{id:"".concat(this.jSPlugin.id),styleList:{position:"relative",zIndex:"0",bottom:"0",right:"0"}}]),this.jSPlugin.Theme.inspect.reSizeVideo(this.jSPlugin.width,this.jSPlugin.height),this.inspectMode="video",this.changeInspectMode("video"),this.inspectMapWin.map.removeControl(this.ZoomControl),this.inspectMapWin.map.removeControl(this.NavigationControl3D),this.inspectMapWin.map.removeControl(this.LocationControl),this.inspectMapWin.map.removeOverlay(this.inspectMapWin.inspectRange),document.getElementById("".concat(this.jSPlugin.id,"-loading-item-btn-wrap"))&&this.setStyleListByIds([{id:"".concat(this.jSPlugin.id,"-loading-item-btn"),styleList:{display:"block"}},{id:"".concat(this.jSPlugin.id,"-loading-item-btn-svg"),styleList:{display:"none"}},{id:"".concat(this.jSPlugin.id,"-loading-item-btn-wrap"),styleList:{border:"1px solid rgb(255, 255, 255)",width:"80px",height:"32px",color:"#fff","text-align":"center","line-height":"32px","font-size":"14px"}}]),setTimeout((function(){e.inspectMapWin.centerToTrack()}),100),this.jSPlugin.Zoom&&this.decoderState.state.play&&this.jSPlugin.Zoom.startZoom()),this.setStyleListByIds([{id:"".concat(this.jSPlugin.id,"-wrap"),styleList:{width:this.jSPlugin.width+this.jSPlugin.inspectVideoWidth+"px",height:this.jSPlugin.height+this.jSPlugin.inspectVideoHeight+"px"}}])}}])}(),kt={customConfig:{defaultMicro:0,defaultPlay:0,maxTalkTime:0,bellPoster:0,maxBellTime:0,inspectInfo:{color:"#000000",backgroundColor:"#ffffff",activeColor:"#1890FF",btnList:[{btnKey:"inspectName",iconId:"inspectName",part:"left",defaultActive:0,isrender:1,color:"#262626"},{btnKey:"inspectBeginTime",iconId:"inspectBeginTime",part:"left",defaultActive:0,isrender:1,color:"#262626"},{btnKey:"inspectPerson",iconId:"inspectPerson",part:"right",defaultActive:0,isrender:1,color:"#262626"}]}},header:{color:"#2c2c2c",backgroundColor:"rgba(0,0,0,0.8)",activeColor:"#1890FF",btnList:[{btnKey:"deviceName",iconId:"deviceName",part:"left",defaultActive:0,isrender:1,color:"#ffffff"},{btnKey:"inspectTime",iconId:"inspectTime",part:"left",defaultActive:0,isrender:1,color:"#ffffff"},{btnKey:"signalType",iconId:"signalType",part:"right",defaultActive:0,isrender:1,color:"#ffffff"},{btnKey:"batteryStatus",iconId:"batteryStatus",part:"right",defaultActive:0,isrender:1,color:"#ffffff"}]},footer:{color:"#ffffff",backgroundColor:"#000000",activeColor:"blue",btnList:[{btnKey:"talk",iconId:"talk",part:"left",defaultActive:1,isrender:1,backgroundColor:"#cccccc"},{btnKey:"sound",iconId:"sound",part:"left",defaultActive:1,isrender:1,backgroundColor:"#cccccc"}]}},Ct=function(e){var t="";return Object.keys(e).map((function(n,i){t+="".concat(n,":").concat(e[n]).concat(i<Object.keys(e).length-1?";":"")})),t};var It=500,xt=function(){return m((function e(t,n,i,o,a,r,s){l(this,e),this.jSPlugin=t,this.videoWidth=t.width,this.videoHeight=t.height,this.themeData=n,this.setDecoderState=i,this.decoderState=o,this.isNeedRenderInspectInfo=!1,this.isNeedRenderHeader=!1,this.isNeedRenderFooter=!1,this.inspectMode=a,this.changeInspectMode=r,this.themeInited=!1,this.inspectRecordId=null,this.inspectInfo={},this.activeThemeStatus=!0,this.activeThemeStatusTxt="模板未激活",this.globalContainer=new pt(this.jSPlugin),this.toastCustom=new Je(t,!1),this.InspectEvent=null,this.timer=s}),[{key:"renderSignalType",value:function(e){return e?"WIFI"===e.toUpperCase()?'<span><svg t="1688983236732" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" width="16" height="16" xmlns:xlink="http://www.w3.org/1999/xlink">\n <path d="M0 352.832l93.12 98.752c231.296-245.44 606.464-245.44 837.76 0L1024 352.832C741.44 53.056 283.008 53.056 0 352.832z m372.352 395.008L512 896l139.648-148.16c-76.8-81.92-202.048-81.92-279.296 0zM186.24 550.4l93.12 98.752c128.448-136.32 336.96-136.32 465.408 0L837.824 550.4c-179.648-190.592-471.488-190.592-651.648 0z" fill="#ffffff" p-id="1530"></path>\n </svg></span>':"<span>".concat(e,"</span>"):null}},{key:"renderBatteryStatus",value:function(e){return e&&0!=e?'\n <div style="\n display: flex;\n align-items: center;\n position: relative;\n ">\n <span style="\n margin-right: 3px; \n color: '.concat(e<=20?"#FF4D4F":"#FFFFFF",'\n ">').concat(e,'%</span>\n <div style="\n position: absolute;\n right: 6px;\n height: 8px;\n width: 15px;\n ">\n <div style="\n width: ').concat(e,"%;\n height: 100%;\n background: ").concat(e<=20?"#FF4D4F":"#FFFFFF",'\n "></div>\n </div>\n <svg viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" width="24" height="32" xmlns:xlink="http://www.w3.org/1999/xlink">\n <path fill="').concat(e<=20?"#FF4D4F":"#FFFFFF",'" d="M128 213.333333l640 0q52.992 0 90.496 37.504t37.504 90.496q52.992 0 90.496 37.504t37.504 90.496l0 85.333333q0 52.992-37.504 90.496t-90.496 37.504q0 52.992-37.504 90.496t-90.496 37.504l-640 0q-52.992 0-90.496-37.504t-37.504-90.496l0-341.333333q0-52.992 37.504-90.496t90.496-37.504zM768 298.666667l-640 0q-17.664 0-30.165333 12.501333t-12.501333 30.165333l0 341.333333q0 17.664 12.501333 30.165333t30.165333 12.501333l640 0q17.664 0 30.165333-12.501333t12.501333-30.165333l0-341.333333q0-17.664-12.501333-30.165333t-30.165333-12.501333zM896 426.666667l0 170.666667q17.664 0 30.165333-12.501333t12.501333-30.165333l0-85.333333q0-17.664-12.501333-30.165333t-30.165333-12.501333z"></path>\n </svg>\n </div>\n '):null}},{key:"renderInspectTime",value:function(e){if(!e)return null;var t,n,i,o,a=e.split(" "),r=a[0].split("-"),s=a[1].split(":"),c=new Date(r[0],r[1]-1,r[2],s[0],s[1],s[2]),l=(new Date).getTime()-new Date(c).getTime();return'\n <span style="\n display: inline-block;\n width:8px;\n height:8px;\n border-radius: 100%;\n background: #FF4D4F;\n margin-right: 4px;\n "></span>\n '.concat((t=l,n=parseInt(t%864e5/36e5),i=parseInt(t%36e5/6e4),o=parseInt(t%6e4/1e3),(n<10?"0".concat(n):n)+":"+(i<10?"0".concat(i):i)+":"+(o<10?"0".concat(o):o)),"\n ")}},{key:"matchBtn",value:function(e,t){var n=this,o=this.themeData,a=o.customConfig,r=o.header,s=o.footer,c=a.inspectInfo,l={title:"",id:"",domString:"",color:"#FFFFFF",activeColor:"#FFFFFF",onclick:function(){},onmoveleft:function(){},onmoveright:function(){},onremove:function(){}},d=c.btnList.findIndex((function(t){return t.iconId===e}));switch(-1!==d?(l.color=c.color,l.backgroundColor=c.backgroundColor,l.activeColor=c.activeColor):-1!==(d=r.btnList.findIndex((function(t){return t.iconId===e})))?(l.color=r.color,l.backgroundColor=r.backgroundColor,l.activeColor=r.activeColor):(l.color=s.color,l.backgroundColor=s.backgroundColor,l.activeColor=s.activeColor),e){case"inspectName":return l.title="巡检名称",l.id=e,l.domString='<span id="'.concat(this.jSPlugin.id,'-inspectInfo-inspectName" \n style="\n color:').concat(t.color||"#262626",';\n font-size: 18px;\n text-align: left;\n font-weight: bold;\n padding: 0 16px;\n ">巡检名称</span>'),l.onclick=function(){},l;case"inspectBeginTime":return l.title="巡检开始时间",l.id=e,l.domString='<span id="'.concat(this.jSPlugin.id,'-inspectInfo-inspectBeginTime" \n style="\n color:').concat(t.color||"#FFFFFF",';\n font-size: 14px;\n text-align: left;\n padding-left: 16px;\n border-left: 1px solid #d9d9d9;\n line-height: 16px;\n margin-top: 1px;\n ">巡检开始时间:-</span>'),l.onclick=function(){},l;case"inspectPerson":return l.title="本地巡检员",l.id=e,l.domString='<span id="'.concat(this.jSPlugin.id,'-inspectInfo-inspectPerson" \n style="\n color:').concat(t.color||"#FFFFFF",';\n font-size: 14px;\n display: block;\n max-width: 100%;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n text-align: left;\n padding-right: 16px;\n ">本地巡检员:-</span>'),l.onclick=function(){},l;case"deviceName":return l.title="设备名称",l.id=e,l.domString='<span id="'.concat(this.jSPlugin.id,'-header-deviceName" \n style="\n color:').concat(t.color||"#FFFFFF",";\n font-size: 16px;\n display: block;\n max-width: ").concat(.33*this.jSPlugin.width,'px;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n text-align: left;\n ">设备名称</span>'),l.onclick=function(){},l;case"inspectTime":return l.title="巡检时长",l.id=e,l.domString='<span id="'.concat(this.jSPlugin.id,'-header-inspectTime-wrap" \n style="\n color:').concat(t.color||"#FFFFFF",';\n font-size: 14px;\n display: flex;\n max-width: 100%;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n text-align: left;\n margin-left: 32px;\n ">巡检时长:<span id="').concat(this.jSPlugin.id,'-header-inspectTime" style="display: flex; align-items: center;">-</span></span>'),l.onclick=function(){},l;case"signalType":return l.title="信号类型",l.id=e,l.domString='<span id="'.concat(this.jSPlugin.id,'-header-signalType" \n style="\n color:').concat(t.color||"#FFFFFF",';\n font-size: 14px;\n display: block;\n max-width: 100%;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n text-align: left;\n "></span>'),l.onclick=function(){},l;case"batteryStatus":return l.title="设备电量",l.id=e,l.domString='<span id="'.concat(this.jSPlugin.id,'-header-batteryStatus" \n style="\n color:').concat(t.color||"#FFFFFF",';\n font-size: 14px;\n display: flex;\n max-width: 100%;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n text-align: left;\n margin-left: 12px;\n align-items: center;\n "></span>'),l.onclick=function(){},l;case"talk":return l.title="对讲",l.id=e,l.domString="<div></div>"+'<svg id="'.concat(this.jSPlugin.id,'-talk-icon" class="theme-icon-item-icon" fill="').concat(l.color,'" version="1.1" xmlns="http://www.w3.org/2000/svg" width="').concat(this.jSPlugin.width>It?48:32,'" height="').concat(this.jSPlugin.width>It?48:32,'" viewBox="-6 -6 32 32">')+'<path d="M10.1,2.7C8.5,2.7,7.2,4,7.2,5.6v5.2c0,1.6,1.3,2.9,2.9,2.9l0.2,0c1.5-0.1,2.7-1.4,2.7-2.9V5.6\tC13,4,11.7,2.7,10.1,2.7z M10.1,3.7c1.1,0,1.9,0.9,1.9,1.9v5.2c0,1-0.8,1.8-1.8,1.9l-0.1,0c-1,0-1.9-0.9-1.9-1.9V5.6 C8.2,4.5,9,3.7,10.1,3.7z" /><path d="M15.1,8.5c0.2,0,0.4,0.2,0.5,0.4l0,0.1v1.7c0,3-2.5,5.5-5.5,5.5c-3,0-5.4-2.3-5.5-5.3l0-0.2V9 c0-0.3,0.2-0.5,0.5-0.5c0.2,0,0.4,0.2,0.5,0.4l0,0.1v1.7c0,2.5,2,4.5,4.5,4.5c2.4,0,4.4-1.9,4.5-4.3l0-0.2V9 C14.6,8.7,14.8,8.5,15.1,8.5z" /><path d="M13.5,17.7c0.3,0,0.5,0.2,0.5,0.5c0,0.2-0.2,0.4-0.4,0.5l-0.1,0h-7c-0.3,0-0.5-0.2-0.5-0.5 c0-0.2,0.2-0.4,0.4-0.5l0.1,0H13.5z" /><path d="M10.1,15.2c0.2,0,0.4,0.2,0.5,0.4l0,0.1v2.5c0,0.3-0.2,0.5-0.5,0.5c-0.2,0-0.4-0.2-0.5-0.4l0-0.1 v-2.5C9.6,15.4,9.8,15.2,10.1,15.2z" />'+'</svg><span id="'.concat(this.jSPlugin.id,'-talk-label" style="margin-left: -3px">对讲</span>'),l.onclick=function(){var e=n.decoderState.state,t=e.talk,o=e.sound;if(e.play)if(t){console.log("结束对讲"),n.setDecoderState({talk:!1}),n.jSPlugin.Talk.stopTalk();var a=i.findIndex(n.themeData.footer.btnList,(function(e){return"sound"===e.iconId&&1===e.isrender&&1===e.defaultActive}))>-1;n.themeData&&a&&n.jSPlugin.openSound()}else console.log("开始对讲"),n.setDecoderState({talk:!0}),n.jSPlugin.Talk.startTalk((function(e){o&&!e&&(n.jSPlugin.closeSound(),n.setDecoderState({sound:!1}))}))},l;case"sound":return l.title="音量",l.id=e,l.domString='<span style="height: 100%">'+'<svg class="theme-icon-item-icon" id="'.concat(this.jSPlugin.id,'-nosound-icon" style="display:none" fill="').concat(l.color,'" version="1.1" xmlns="http://www.w3.org/2000/svg" width="').concat(this.jSPlugin.width>It?48:32,'" height="').concat(this.jSPlugin.width>It?48:32,'" viewBox="-6 -7 32 31">\n <path d="M8.5,4.2c0.8-0.7,2.1-0.2,2.2,0.9l0,0.1v10c0,1.1-1.2,1.7-2.1,1.1l-0.1-0.1l-3.3-2.8C5,13.2,5,12.9,5.1,12.7 c0.2-0.2,0.4-0.2,0.6-0.1l0.1,0.1l3.3,2.8c0.2,0.2,0.5,0.1,0.5-0.2l0-0.1v-10c0-0.3-0.3-0.4-0.5-0.3L9.2,5L5.9,7.8 C5.6,7.9,5.3,7.9,5.1,7.7C5,7.5,5,7.3,5.1,7.1L5.2,7L8.5,4.2z"/>\n <path d="M5.5,6.9C5.8,6.9,6,7.1,6,7.4c0,0.2-0.2,0.4-0.4,0.5l-0.1,0h-2C3.4,7.9,3.3,8,3.2,8.2l0,0.1v4 c0,0.2,0.1,0.3,0.3,0.3l0.1,0h2C5.8,12.5,6,12.7,6,13c0,0.2-0.2,0.4-0.4,0.5l-0.1,0h-2c-0.7,0-1.3-0.5-1.3-1.2l0-0.1v-4 c0-0.7,0.5-1.3,1.2-1.3l0.1,0H5.5z"/>\n <path d="M17.4,7.9c0.2-0.2,0.5-0.2,0.7,0c0.2,0.2,0.2,0.4,0.1,0.6l-0.1,0.1l-3.8,3.8c-0.2,0.2-0.5,0.2-0.7,0 c-0.2-0.2-0.2-0.4-0.1-0.6l0.1-0.1L17.4,7.9z"/>\n <path d="M13.7,7.9c0.2-0.2,0.4-0.2,0.6-0.1l0.1,0.1l3.8,3.8c0.2,0.2,0.2,0.5,0,0.7c-0.2,0.2-0.4,0.2-0.6,0.1l-0.1-0.1 l-3.7-3.8C13.5,8.4,13.5,8.1,13.7,7.9z"/>\n </svg>')+'<svg class="theme-icon-item-icon" id="'.concat(this.jSPlugin.id,'-sound-icon" style="display:inline-block" width="').concat(this.jSPlugin.width>It?48:32,'" height="').concat(this.jSPlugin.width>It?48:32,'" fill="').concat(l.color,'" viewBox="-6 -7 32 32">\n <path d="M13.2,7.1c0.1-0.2,0.5-0.3,0.7-0.2c1.1,0.7,1.9,2.2,1.9,3.7c0,1.6-0.7,3-1.9,3.7\n c-0.2,0.1-0.5,0.1-0.7-0.2c-0.1-0.2-0.1-0.5,0.2-0.7c0.8-0.5,1.4-1.6,1.4-2.9c0-1.3-0.6-2.4-1.4-2.9C13.1,7.6,13,7.3,13.2,7.1z"/>\n <path d="M15.7,4.5c0.2-0.2,0.5-0.2,0.7-0.1C18,5.8,19,8.2,19,10.7c0,2.5-1,4.8-2.7,6.3\n c-0.2,0.2-0.5,0.2-0.7-0.1c-0.2-0.2-0.2-0.5,0.1-0.7c1.4-1.2,2.3-3.3,2.3-5.5c0-2.2-0.9-4.3-2.3-5.5C15.5,5,15.5,4.7,15.7,4.5z"/>\n <path id="Stroke-5" class="st1" d="M8.5,4.7c0.8-0.7,2.1-0.2,2.2,0.9l0,0.1v10c0,1.1-1.2,1.7-2.1,1.1l-0.1-0.1l-3.3-2.8\n C5,13.7,5,13.4,5.1,13.2c0.2-0.2,0.4-0.2,0.6-0.1l0.1,0.1l3.3,2.8c0.2,0.2,0.5,0.1,0.5-0.2l0-0.1v-10c0-0.3-0.3-0.4-0.5-0.3l-0.1,0\n L5.9,8.3C5.6,8.4,5.3,8.4,5.1,8.2C5,8,5,7.7,5.1,7.6l0.1-0.1L8.5,4.7z"/>\n <path d="M5.5,7.4C5.8,7.4,6,7.6,6,7.9c0,0.2-0.2,0.4-0.4,0.5l-0.1,0h-2c-0.2,0-0.3,0.1-0.3,0.3l0,0.1v4\n c0,0.2,0.1,0.3,0.3,0.3l0.1,0h2C5.8,13,6,13.2,6,13.5c0,0.2-0.2,0.4-0.4,0.5l-0.1,0h-2c-0.7,0-1.3-0.5-1.3-1.2l0-0.1v-4\n c0-0.7,0.5-1.3,1.2-1.3l0.1,0H5.5z"/>\n </svg>')+'</span><span id="'.concat(this.jSPlugin.id,'-sound-label" style="margin-left: -3px; color: ').concat(l.color,'">音量</span>'),l.onclick=function(){var e=n.decoderState.state,t=e.play,i=e.sound,o=e.talk;t&&!o&&(i?(n.jSPlugin.closeSound(),n.setDecoderState({sound:!1})):n.jSPlugin.openSound())},l;default:return l}}},{key:"renderInspectInfo",value:function(e,t){var n=this.matchBtn(e,t),i=document.createElement("sapn");i.innerHTML="".concat(n.domString),"left"===t.part?document.getElementById("".concat(this.jSPlugin.id,"-inspectInfoControl-left")).appendChild(i):document.getElementById("".concat(this.jSPlugin.id,"-inspectInfoControl-right")).appendChild(i)}},{key:"renderHeader",value:function(e,t){var n=this.matchBtn(e,t),i=document.createElement("span");i.className="".concat(this.jSPlugin.id,"-header-content"),i.style="display: flex; align-items: center; ",i.innerHTML="\n ".concat(n.domString,"\n "),"left"===t.part?document.getElementById("".concat(this.jSPlugin.id,"-headControl-left")).appendChild(i):document.getElementById("".concat(this.jSPlugin.id,"-headControl-right")).appendChild(i)}},{key:"renderFooter",value:function(e,t){var n=this,i=this.matchBtn(e,t),o=this.videoWidth/6,a=document.createElement("div");a.className="theme-icon-item",this.jSPlugin.isWebConsole?a.style="padding:0 ".concat(.1*o,"px;"):a.style="padding:0 ".concat(.1*o,"px;cursor: pointer;"),a.innerHTML="".concat('<span id="'.concat(this.jSPlugin.id,"-").concat(i.id,'" style="position:relative;">')+'<div id="'.concat(this.jSPlugin.id,"-").concat(i.id,'-content" title="').concat(i.title,'" style="display: flex;align-items: center;position:relative;">')).concat(i.domString,"</div>")+"</span>",a.onclick=function(e){if(n.decoderState.state.isEditing||!n.activeThemeStatus)return!1;i.onclick(e)},i.onmouseenter&&(a.onmouseenter=function(e){if(n.decoderState.state.isEditing||!n.activeThemeStatus)return!1;i.onmouseenter(e)}),i.onmouseleave&&(a.onmouseleave=function(e){if(n.decoderState.state.isEditing||!n.activeThemeStatus)return!1;i.onmouseleave(e)}),document.getElementById("".concat(this.jSPlugin.id,"-audioControls")).appendChild(a)}},{key:"initThemeData",value:function(){var e=this,t=this.themeData,n=t.customConfig,o=t.header,a=t.footer,r=n.inspectInfo,s=this.jSPlugin.id;if(this.isNeedRenderInspectInfo=i.findIndex(r.btnList,(function(e){return e.isrender>0}))>=0,this.isNeedRenderHeader=i.findIndex(o.btnList,(function(e){return e.isrender>0}))>=0,this.isNeedRenderFooter=i.findIndex(a.btnList,(function(e){return e.isrender>0}))>=0,this.isNeedRenderInspectInfo)if(document.getElementById("".concat(this.jSPlugin.id,"-inspectInfoControl")))document.getElementById("".concat(this.jSPlugin.id,"-inspectInfoControl")).innerHTML="<div id='".concat(this.jSPlugin.id,"-inspectInfoControl-left' style='display:flex;'></div><div id='").concat(this.jSPlugin.id,"-inspectInfoControl-right' style='display:flex'></div>");else{var c=document.createElement("div");c.setAttribute("id","".concat(this.jSPlugin.id,"-inspectInfoControl")),c.setAttribute("class","inspectInfo-controls"),c.innerHTML="<div id='".concat(this.jSPlugin.id,"-inspectInfoControl-left' class=\"inspectInfo-controls-left\" style='display:flex;overflow:hidden;'></div><div id='").concat(this.jSPlugin.id,"-inspectInfoControl-right' class=\"inspectInfo-controls-right\" style='display:flex;'></div>");var l={height:"58px",display:"flex","justify-content":"space-between",top:0,"z-index":999,color:"#000000",width:"".concat(this.jSPlugin.width+290,"px"),position:"relative","align-items":"center",background:"#ffffff","border-bottom":"1px solid #D9D9D9","box-sizing":"border-box"};c.style=Ct(l),document.getElementById("".concat(s,"-wrap")).insertBefore(c,document.getElementById(this.jSPlugin.id));var d=setInterval((function(){window.EZUIKit[e.jSPlugin.id].state.EZUIKitPlayer.init&&clearInterval(d)}),50)}else document.getElementById("".concat(this.jSPlugin.id,"-inspectInfoControl"))&&document.getElementById("".concat(this.jSPlugin.id,"-inspectInfoControl")).parentElement.removeChild(document.getElementById("".concat(this.jSPlugin.id,"-inspectInfoControl")));if(this.isNeedRenderHeader)if(document.getElementById("".concat(this.jSPlugin.id,"-headControl")))document.getElementById("".concat(this.jSPlugin.id,"-headControl")).innerHTML="<div id='".concat(this.jSPlugin.id,"-headControl-left' style='display:flex;'></div><div id='").concat(this.jSPlugin.id,"-headControl-right' style='display:flex'></div>");else{var u=document.createElement("div");u.setAttribute("id","".concat(this.jSPlugin.id,"-headControl")),u.setAttribute("class","header-controls"),u.innerHTML="<div id='".concat(this.jSPlugin.id,"-headControl-left' class=\"header-controls-left\" style='display:flex; max-width: 70%; align-items: center; overflow: hidder;'></div><div id='").concat(this.jSPlugin.id,"-headControl-right' class=\"header-controls-right\" style='display:flex; align-items: center;'></div>");var m={height:"56px",display:"flex","justify-content":"space-between",top:0,"z-index":999,color:"#FFFFFF",width:this.jSPlugin.width+"px",padding:"0 16px","box-sizing":"border-box",position:"relative","align-items":"center",background:"#000000"};u.style=Ct(m),document.getElementById("".concat(s,"-wrap")).insertBefore(u,document.getElementById(s));var h=setInterval((function(){window.EZUIKit[e.jSPlugin.id].state.EZUIKitPlayer.init&&clearInterval(h)}),50)}else document.getElementById("".concat(this.jSPlugin.id,"-headControl"))&&document.getElementById("".concat(this.jSPlugin.id,"-headControl")).parentElement.removeChild(document.getElementById("".concat(this.jSPlugin.id,"-headControl")));if(this.isNeedRenderFooter)if(document.getElementById("".concat(this.jSPlugin.id,"-ez-iframe-footer-container")))document.getElementById("".concat(this.jSPlugin.id,"-ez-iframe-footer-container"))&&(document.getElementById("".concat(this.jSPlugin.id,"-ez-iframe-footer-container")).style.marginTop="-".concat("56px","px"));else{var p=document.createElement("div");p.setAttribute("id","".concat(this.jSPlugin.id,"-ez-iframe-footer-container")),p.setAttribute("class","ez-iframe-footer-container");var g={position:"relative",display:"flex",height:"56px","flex-wrap":"wrap","justify-content":"center","z-index":999,top:0,color:"#FFFFFF",width:this.jSPlugin.width+"px","align-items":"center","background-color":"#000000","font-size":"14px"};p.style=Ct(g),p.innerHTML='\n <div id="'.concat(this.jSPlugin.id,"-audioControls\" class=\"footer-controls\" style='display:flex;justify-content: center;padding: 0 4%;width:100%;z-index:999;position: relative;'>\n <div id='").concat(this.jSPlugin.id,"-audioControls-left' class=\"footer-controls-left\" style='display:flex;margin-lefacti'></div><div id='").concat(this.jSPlugin.id,"-audioControls-right' class=\"footer-controls-right\" style='display:flex'></div>\n </div>\n "),x(p,document.getElementById(s))}else document.getElementById("".concat(this.jSPlugin.id,"-ez-iframe-footer-container"))&&document.getElementById("".concat(this.jSPlugin.id,"-ez-iframe-footer-container")).parentElement.removeChild(document.getElementById("".concat(this.jSPlugin.id,"-ez-iframe-footer-container")));this.isNeedRenderInspectInfo&&document.getElementById("".concat(this.jSPlugin.id,"-inspectInfoControl"))&&(document.getElementById("".concat(this.jSPlugin.id,"-inspectInfoControl")).style.background=r.backgroundColor,document.getElementById("".concat(this.jSPlugin.id,"-inspectInfoControl")).style.color=r.color,r.btnList.map((function(t,n){t.isrender&&e.renderInspectInfo(t.iconId,t)}))),this.isNeedRenderHeader&&document.getElementById("".concat(this.jSPlugin.id,"-headControl"))&&(document.getElementById("".concat(this.jSPlugin.id,"-headControl")).style.background=o.backgroundColor,document.getElementById("".concat(this.jSPlugin.id,"-headControl")).style.color=o.color,o.btnList.map((function(t,n){t.isrender&&e.renderHeader(t.iconId,t)}))),this.isNeedRenderFooter&&document.getElementById("".concat(this.jSPlugin.id,"-audioControls"))&&(document.getElementById("".concat(this.jSPlugin.id,"-audioControls")).style.background=a.backgroundColor,document.getElementById("".concat(this.jSPlugin.id,"-audioControls")).style.color=a.color,a.btnList.map((function(t,n){t.isrender&&e.renderFooter(t.iconId,t)}))),this.inspectMapWin=new ht(this.jSPlugin),this.inspectSmallWin=new Pt(this.jSPlugin,this.inspectMode,this.inspectMapWin,this.changeInspectMode,this.decoderState)}},{key:"renderThemeData",value:function(){var e=this,t=this.decoderState.state.isEditing,n=this.themeData,i=n.inspectInfo,o=n.header,a=n.footer;if(this.isNeedRenderInspectInfo&&i&&(document.getElementById("".concat(this.jSPlugin.id,"-inspectInfoControl")).style.background=i.backgroundColor.replace("-diy",""),document.getElementById("".concat(this.jSPlugin.id,"-inspectInfoControl")).style.color=i.color.replace("-diy",""),i.btnList.map((function(t,n){t.isrender&&e.setDecoderState(p({},t.iconId,e.decoderState.state[t.iconId]))}))),this.isNeedRenderHeader&&o&&(document.getElementById("".concat(this.jSPlugin.id,"-headControl")).style.background=o.backgroundColor.replace("-diy",""),document.getElementById("".concat(this.jSPlugin.id,"-headControl")).style.color=o.color.replace("-diy",""),o.btnList&&o.btnList.map((function(t,n){t.isrender&&e.setDecoderState(p({},t.iconId,e.decoderState.state[t.iconId]))}))),this.isNeedRenderFooter&&a)document.getElementById("".concat(this.jSPlugin.id,"-audioControls")).style.background=a.backgroundColor.replace("-diy",""),document.getElementById("".concat(this.jSPlugin.id,"-audioControls")).style.color=a.color.replace("-diy",""),a.btnList.map((function(n,i){if(n.isrender&&e.setDecoderState(p({},n.iconId,e.decoderState.state[n.iconId])),0==i&&!e.themeInited&&e.activeThemeStatus)var o=setInterval((function(){window.EZUIKit[e.jSPlugin.id].state.EZUIKitPlayer.init&&(clearInterval(o),1!=e.themeData.customConfig.bellPoster||t?e.jSPlugin.play():e.jSPlugin.pluginStatus.loadingClear(),e.themeInited=!0)}),50)})),this.setDecoderState({cloudRec:"cloud.rec"===A(this.jSPlugin.url).type,rec:"rec"===A(this.jSPlugin.url).type,type:A(this.jSPlugin.url).type});else if(!this.themeInited&&this.activeThemeStatus)var r=setInterval((function(){window.EZUIKit[e.jSPlugin.id].state.EZUIKitPlayer.init&&(clearInterval(r),e.themeData&&e.themeData.customConfig&&1==e.themeData.customConfig.bellPoster&&!t?e.jSPlugin.pluginStatus.loadingClear():e.jSPlugin.play(),e.themeInited=!0)}),50);var s=setInterval((function(){window.EZUIKit[e.jSPlugin.id].state.EZUIKitPlayer.init&&(clearInterval(s),e.reSizeVideo(e.videoWidth,e.videoHeight))}),50);this.jSPlugin.Zoom||(this.jSPlugin.Zoom=new Oe(this.jSPlugin)),this.getInspectDevInfo(this.jSPlugin,!0,!1)}},{key:"getInspectRecord",value:function(){var e=this;!function(e,t,n){var i={accessToken:e.accessToken||e.token.deviceToken.video,deviceSerial:A(e.url).deviceSerial},o="".concat(e.env.domain,"/api/service/devicekit/bodycamera/inspect/detail/latest");Ye(o,"GET",i,(function(e){t&&t(e)}),(function(e){n&&n(e)}),{"Content-Type":"application/x-www-form-urlencoded"})}(this.jSPlugin,(function(t){if(200==t.meta.code&&t.data){var n=t.data;n.inspectRange&&e.inspectMapWin.createPolygon(n.inspectRange,"#407AFF","dashed",4,1,"#407AFF",.08),n.inspectPoints&&n.inspectPoints.length>0&&e.inspectMapWin.createInspectPoints(n.inspectPoints),"video"===e.inspectMode&&e.inspectMapWin.map.removeOverlay(e.inspectMapWin.inspectRange),document.getElementById("".concat(e.jSPlugin.id,"-inspectInfo-inspectName"))&&n.inspectName&&(document.getElementById("".concat(e.jSPlugin.id,"-inspectInfo-inspectName")).innerText=""+n.inspectName),document.getElementById("".concat(e.jSPlugin.id,"-inspectInfo-inspectBeginTime"))&&n.beginTime&&(document.getElementById("".concat(e.jSPlugin.id,"-inspectInfo-inspectBeginTime")).innerText="巡检开始时间:"+n.beginTime),document.getElementById("".concat(e.jSPlugin.id,"-header-inspectTime"))&&e.timer.createInterval("InspectTimer",(function(){document.getElementById("".concat(e.jSPlugin.id,"-header-inspectTime")).innerHTML=e.renderInspectTime(n.beginTime)}),1e3),document.getElementById("".concat(e.jSPlugin.id,"-inspectInfo-inspectPerson"))&&n.inspectPerson&&(document.getElementById("".concat(e.jSPlugin.id,"-inspectInfo-inspectPerson")).innerText="本地巡检员:"+n.inspectPerson),e.inspectInfo=n,n.inspectRecordId&&_t(e.jSPlugin,n.inspectRecordId,(function(t){200==t.meta.code&&t.data&&(e.inspectMapWin.createTrack(t.data,!0),e.timer.createInterval("TraceTimer",(function(){n.inspectRecordId&&_t(e.jSPlugin,n.inspectRecordId,(function(t){200==t.meta.code&&t.data&&e.inspectMapWin.createTrack(t.data,!1)}),(function(){}))}),5e3))}),(function(){})),e.InspectEvent=new Et(e.jSPlugin,n.inspectRecordId,e.timer)}else e.InspectEvent=new Et(e.jSPlugin,null,e.timer)}),(function(e){}))}},{key:"getInspectDevInfo",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];!function(e,t,n){var i={accessToken:e.accessToken||e.token.deviceToken.video,deviceSerial:A(e.url).deviceSerial},o="".concat(e.env.domain,"/api/service/devicekit/bodycamera");Ye(o,"GET",i,(function(e){t&&t(e)}),(function(e){n&&n(e)}),{"Content-Type":"application/x-www-form-urlencoded"})}(e,(function(o){o.meta&&200==o.meta.code&&o.data?1===o.data.status?(i&&!t.decoderState.state.play&&(t.jSPlugin.pluginStatus.loadingStart(t.jSPlugin.id),t.jSPlugin.pluginStatus.loadingSetText({text:"视频加载中"}),t.jSPlugin.play()),t.globalContainer.globalContainerToggle("".concat(t.jSPlugin.id,"-inspect-global-box"),!1),document.getElementById("".concat(t.jSPlugin.id,"-header-deviceName"))&&(document.getElementById("".concat(t.jSPlugin.id,"-header-deviceName")).innerText="".concat(o.data.deviceName,"(").concat(o.data.deviceSerial,")"),document.getElementById("".concat(t.jSPlugin.id,"-header-deviceName")).setAttribute("title","".concat(o.data.deviceName,"(").concat(o.data.deviceSerial,")"))),document.getElementById("".concat(t.jSPlugin.id,"-header-signalType"))&&(document.getElementById("".concat(t.jSPlugin.id,"-header-signalType")).innerHTML=t.renderSignalType(o.data.signalType)),document.getElementById("".concat(t.jSPlugin.id,"-header-batteryStatus"))&&(document.getElementById("".concat(t.jSPlugin.id,"-header-batteryStatus")).innerHTML=t.renderBatteryStatus(o.data.batteryStatus)),t.timer.createInterval("InspectDevInfoTimer",(function(){t.getInspectDevInfo(e,!1,!1)}),3e5),n&&t.getInspectRecord()):(t.globalContainer.globalContainerToggle("".concat(t.jSPlugin.id,"-inspect-loading-box"),!1),t.jSPlugin.stop(),t.globalContainer.deviceErrorInfo({tips:"当前设备未在巡检中",refreshBtn:"刷新",refreshShow:!0},(function(){t.globalContainer.globalContainerToggle("".concat(t.jSPlugin.id,"-no-inspect-box"),!1),t.globalContainer.globalContainerToggle("".concat(t.jSPlugin.id,"-inspect-loading-box"),!0),t.getInspectDevInfo(e,!0,!0)}))):(t.globalContainer.globalContainerToggle("".concat(t.jSPlugin.id,"-inspect-loading-box"),!1),t.jSPlugin.stop(),t.globalContainer.deviceErrorInfo({tips:o.meta.message,refreshShow:!1}))}),(function(){t.globalContainer.globalContainerToggle("".concat(t.jSPlugin.id,"-inspect-global-box"),!1)}))}},{key:"fetchThemeData",value:function(e){var t=this;Ue(this.jSPlugin,e,(function(e){if(0!==e.meta.code||!e.data)return t.activeThemeStatus=!1,t.jSPlugin.pluginStatus.loadingClear(),"111021"==e.meta.code?(t.globalContainer.globalContainerToggle("".concat(t.jSPlugin.id,"-inspect-loading-box"),!1),t.jSPlugin.stop(),t.globalContainer.deviceErrorInfo({tips:"无效的模板id",refreshBtn:"刷新",refreshShow:!1}),void(t.activeThemeStatusTxt="无效的模板id")):"111023"==e.meta.code?(t.globalContainer.globalContainerToggle("".concat(t.jSPlugin.id,"-inspect-loading-box"),!1),t.jSPlugin.stop(),t.globalContainer.deviceErrorInfo({tips:"您的试用特权已到期,需前往轻应用控制台购买后使用。",refreshBtn:"刷新",refreshShow:!1}),void(t.activeThemeStatusTxt="试用特权已到期")):(t.globalContainer.globalContainerToggle("".concat(t.jSPlugin.id,"-inspect-loading-box"),!1),t.jSPlugin.stop(),t.globalContainer.deviceErrorInfo({tips:"模板未激活,请先在开放平台轻应用控制台购买模板",refreshBtn:"刷新",refreshShow:!1}),void(t.activeThemeStatusTxt="模板未激活"));t.activeThemeStatus=!0,t.themeData=e.data,t.jSPlugin.capacity?(t.initThemeData(),t.renderThemeData()):setTimeout((function(){t.initThemeData(),t.renderThemeData()}),300)}),(function(){t.themeData=kt,t.themeData.header&&(t.themeData.header.btnList=t.themeData.header.btnList.sort((function(e,t){return e.btnKey.split("-")[3]-t.btnKey.split("-")[3]}))),t.themeData.footer&&(t.themeData.footer.btnList=t.themeData.footer.btnList.sort((function(e,t){return e.btnKey.split("-")[3]-t.btnKey.split("-")[3]}))),t.initThemeData(),t.renderThemeData()}))}},{key:"reSizeVideo",value:function(e,t){if(document.getElementById("".concat(this.jSPlugin.id)).style.width=e+"px",document.getElementById("".concat(this.jSPlugin.id)).style.height=t+"px",this.jSPlugin&&this.jSPlugin.bPlay)this.jSPlugin.JS_Resize(e,t);else{document.getElementById("".concat(this.jSPlugin.id,"-player"))&&(document.getElementById("".concat(this.jSPlugin.id,"-player")).width=e,document.getElementById("".concat(this.jSPlugin.id,"-player")).height=t,document.getElementById("".concat(this.jSPlugin.id,"-player")).style.width=e+"px",document.getElementById("".concat(this.jSPlugin.id,"-player")).style.height=t+"px",document.getElementById("".concat(this.jSPlugin.id,"-container-0")).style.height=t+"px");var n=1;if(document.getElementById("".concat(this.jSPlugin.id,"canvas0")))navigator.userAgent.match(/(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i)&&(n=2),document.getElementById("".concat(this.jSPlugin.id,"canvas0")).style.width=e*n+"px",document.getElementById("".concat(this.jSPlugin.id,"canvas0")).style.height=t*n+"px",document.getElementById("".concat(this.jSPlugin.id,"canvas0")).width=e*n,document.getElementById("".concat(this.jSPlugin.id,"canvas0")).height=t*n,document.getElementById("".concat(this.jSPlugin.id,"canvas0")).parentNode.style.width=e*n+"px",document.getElementById("".concat(this.jSPlugin.id,"canvas0")).parentNode.style.height=t*n+"px",document.getElementById("".concat(this.jSPlugin.id,"canvas_draw0")).height=t*n}}},{key:"reSize",value:function(e,t){var n=.3333*e,i=.3333*t;document.getElementById("".concat(this.jSPlugin.id,"-inspectInfoControl"))&&(document.getElementById("".concat(this.jSPlugin.id,"-inspectInfoControl")).style.width=e+this.jSPlugin.inspectVideoWidth+"px"),document.getElementById("".concat(this.jSPlugin.id,"-headControl"))&&(document.getElementById("".concat(this.jSPlugin.id,"-headControl")).style.width=e+"px"),document.getElementById("".concat(this.jSPlugin.id,"-headControl"))&&(document.getElementById("".concat(this.jSPlugin.id,"-ez-iframe-footer-container")).style.width=e+"px"),"video"===this.jSPlugin.Theme.inspectMode?(this.reSizeVideo(e,t),document.getElementById("".concat(this.jSPlugin.id,"-headControl"))&&(document.getElementById("".concat(this.jSPlugin.id,"-ez-iframe-footer-container")).style.top=0),document.getElementById("".concat(this.jSPlugin.id,"-mapbox")).style.width=n+"px",document.getElementById("".concat(this.jSPlugin.id,"-mapbox")).style.height=i+"px"):(document.getElementById("".concat(this.jSPlugin.id,"-headControl"))&&(document.getElementById("".concat(this.jSPlugin.id,"-ez-iframe-footer-container")).style.top=t+"px"),this.reSizeVideo(n,i),document.getElementById("".concat(this.jSPlugin.id,"-mapbox")).style.width=e+"px",document.getElementById("".concat(this.jSPlugin.id,"-mapbox")).style.height=t+"px"),document.getElementById("".concat(this.jSPlugin.id,"-miniToggle")).style.bottom=i/2+96-30+"px",document.getElementById("".concat(this.jSPlugin.id,"-miniToggle")).style.right=this.jSPlugin.inspectVideoWidth+n+"px"}}])}(),jt=function(){return m((function e(t){var n=this;if(l(this,e),p(this,"changeInspectMode",(function(e){n.inspectMode=e})),this.jSPlugin=t,this.videoWidth=t.width,this.videoHeight=t.height,this.inspectMode="video",this.autoFocus=0,this.decoderState={state:{isEditing:!1,play:!1,sound:!1,recordvideo:!1,recordCount:"00:00",talk:!1,mute:!1,cloudRec:"cloud.rec"===A(t.url).type,rec:"rec"===A(t.url).type,type:A(t.url).type}},this.isMobile=navigator.userAgent.match(/(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i),void 0!==t.isMobile&&(this.isMobile=t.isMobile),this.themeData=kt,"themeData"==this.jSPlugin.themeId&&(this.themeData=this.jSPlugin.params.themeData),this.timer||(this.timer=new mt(t)),this.jSPlugin.themeId)if(this.isMobile||(this.inspect=new xt(this.jSPlugin,this.themeData,this.setDecoderState,this.decoderState,this.inspectMode,this.changeInspectMode,this.timer)),"themeData"===this.jSPlugin.themeId)this.themeData=this.jSPlugin.params.themeData,this.inspect.initThemeData(),this.inspect.renderThemeData();else this.inspect.fetchThemeData(this.jSPlugin.themeId);this.jSPlugin.Talk||(this.jSPlugin.Talk=new Pe(this.jSPlugin)),P("".concat(this.jSPlugin.staticPath,"/css/theme.css")),P("".concat(this.jSPlugin.staticPath,"/css/component.css")),P("".concat(this.jSPlugin.staticPath,"/css/inspectTheme.css"))}),[{key:"setDecoderState",value:function(e,t){var n=this,i="#FFFFFF",o="#1890FF";Object.keys(e).map((function(t){switch(t){case"talk":document.getElementById("".concat(n.jSPlugin.id,"-talk"))&&(document.getElementById("".concat(n.jSPlugin.id,"-talk")).className=e[t]?"active":"",document.getElementById("".concat(n.jSPlugin.id,"-talk-content")).childNodes[1].style.fill=e[t]?o:i,document.getElementById("".concat(n.jSPlugin.id,"-talk-content")).childNodes[2].style.color=e[t]?o:i);break;case"sound":document.getElementById("".concat(n.jSPlugin.id,"-sound"))&&(e[t]?(document.getElementById("".concat(n.jSPlugin.id,"-sound-content")).children[0].children[1].style="display:inline-block",document.getElementById("".concat(n.jSPlugin.id,"-sound-content")).children[0].children[0].style="display:none",document.getElementById("".concat(n.jSPlugin.id,"-sound")).className=e[t]?"active":"",document.getElementById("".concat(n.jSPlugin.id,"-sound-content")).childNodes[0].children[1].style.fill=e[t]?o:i,document.getElementById("".concat(n.jSPlugin.id,"-sound-label")).style.color=e[t]?o:i):(document.getElementById("".concat(n.jSPlugin.id,"-sound-content")).children[0].children[0].style="display:inline-block",document.getElementById("".concat(n.jSPlugin.id,"-sound-content")).children[0].children[1].style="display:none",document.getElementById("".concat(n.jSPlugin.id,"-sound")).className=e[t]?"active":"",document.getElementById("".concat(n.jSPlugin.id,"-sound-label")).style.color=e[t]?o:i))}n.decoderState.state=Object.assign(n.decoderState.state,e)}))}},{key:"setDisabled",value:function(e){var t=this.decoderState.state,n=t.sound;t.hd,null!=document.getElementById("".concat(this.jSPlugin.id,n?"-sound-icon":"-nosound-icon"))&&document.getElementById("".concat(this.jSPlugin.id,n?"-sound-icon":"-nosound-icon")).setAttribute("style",e?"cursor: not-allowed;fill: gray":"cursor: default"),null!=document.getElementById("".concat(this.jSPlugin.id,"-sound-label"))&&document.getElementById("".concat(this.jSPlugin.id,"-sound-label")).setAttribute("style",e?"cursor: not-allowed; color: gray":"cursor: default"),null!=document.getElementById("".concat(this.jSPlugin.id,"-talk-icon"))&&document.getElementById("".concat(this.jSPlugin.id,"-talk-icon")).setAttribute("style",e?"cursor: not-allowed;fill: gray":"cursor: default"),null!=document.getElementById("".concat(this.jSPlugin.id,"-talk-label"))&&document.getElementById("".concat(this.jSPlugin.id,"-talk-label")).setAttribute("style",e?"cursor: not-allowed; color: gray":"cursor: default")}},{key:"inspectEnding",value:function(){var e=document.createElement("div");e.id="".concat(this.jSPlugin.id,"-inspect-ending-box"),e.style="width:100%; position: absolute; z-index: 10000; top:58px; bottom:0; left:0; background: #ffffff;",e.innerHTML='<div style="\n overflow: auto;\n box-sizing: border-box;\n font-size: 14px;\n color: #595959;\n text-align: center;\n display: flex;\n align-items: center;\n justify-content: center;\n height: 100%;\n ">\n <div>\n <div style="text-align:center; height: 21px;">\n <svg t="1689074472491" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="7172" xmlns:xlink="http://www.w3.org/1999/xlink" width="21" height="21"><path d="M512 64a448 448 0 1 0 0 896A448 448 0 0 0 512 64z m-32 232c0-4.416 3.584-8 8-8h48c4.416 0 8 3.584 8 8v272A8 8 0 0 1 536 576h-48a8 8 0 0 1-8-8v-272zM512 736A48 48 0 1 1 512 640a48 48 0 0 1 0 96z" fill="#FF4D4F" p-id="7173"></path></svg>\n </div>\n <div style="color: #595959; font-size:14px; margin: 5px 0 16px;font-weight: 400; text-align: center;">巡检已结束</div>\n </div>\n </div>\n ',document.getElementById("".concat(this.jSPlugin.id,"-wrap")).appendChild(e),this.jSPlugin.Zoom&&this.jSPlugin.Zoom.stopZoom()}}])}(),At=function(){return m((function e(){l(this,e),this.events={}}),[{key:"on",value:function(e,t){e&&t&&(this.events[e]=this.events[e]||[],this.events[e].push(t))}},{key:"emit",value:function(e,t){e&&this.events[e]&&this.events[e].forEach((function(e){return e(t)}))}},{key:"off",value:function(e,t){e&&t&&this.events[e]&&this.events[e].splice(this.events[e].indexOf(t),1)}},{key:"once",value:function(e,t){var n=this;this.on(e,(function i(){var o=Array.prototype.slice.call(arguments);t.apply(null,o),n.off(e,i)}))}},{key:"removeAllListener",value:function(){this.events={}}}])}();function Dt(e){document.getElementById("".concat(e,"-player"))&&document.getElementById("".concat(e,"-container-0")).removeChild(document.getElementById("".concat(e,"-player")))}var Rt=function(e,t){if(void 0===e)return t.themeData?{templateType:"themeData",templateId:"themeData"}:{templateType:"local",templateId:""};if("string"==typeof e){if(32===e.length)return{templateType:"remote",templateId:e};if(-1!==["theme","standard"].indexOf(e))return"simple"===e&&void 0===t.header&&void 0===t.footer?{templateType:"local",templateId:""}:{templateType:"iframe",templateId:e};if(-1!==["pcLive","pcRec","mobileLive","mobileRec","noData","security","voice","simple","mobileCall","miniRec"].indexOf(e))return-1!=t.url.indexOf("rec")&&"simple"!=t.template&&"miniRec"!=t.id?{templateType:"local",templateId:L()?"mobileRec":"pcRec"}:{templateType:"local",templateId:e};if(t&&t.isCall)return{templateType:"invalid",templateId:e}}},Lt=function(){var e=window.navigator.userAgent.toLowerCase(),t=(/version.*safari/.test(e),/chrome/.test(e));/gecko/.test(e)&&/webkit/.test(e);if(L())return!1;if(t){return function(){for(var e=window.navigator.userAgent.split(" "),t="",n=0;n<e.length;n++)/chrome/i.test(e[n])&&(t=e[n]);return!!t&&Number(t.split("/")[1].split(".")[0])}()>91&&!!window.SharedArrayBuffer}return!1};var Bt=function(e){if(console.log("err",e),e&&e.retcode)return String(e.retcode);if(e&&e.code){var t=String(e.code);return"1".concat(t.padStart(5,"0"))}if(e&&e.errorCode){var n=String(e.errorCode);return"39".concat(n.padStart(4,"0"))}return"400001"};function Mt(){var e,t={},n=navigator.userAgent.toLowerCase();if((e=n.match(/rv:([\d.]+)\) like gecko/))||(e=n.match(/msie ([\d\.]+)/))?t.ie=e[1]:(e=n.match(/edge\/([\d\.]+)/))?t.edge=e[1]:(e=n.match(/firefox\/([\d\.]+)/))?t.firefox=e[1]:(e=n.match(/(?:opera|opr).([\d\.]+)/))?t.opera=e[1]:(e=n.match(/chrome\/([\d\.]+)/))?t.chrome=e[1]:(e=n.match(/version\/([\d\.]+).*safari/))&&(t.safari=e[1]),t.chrome){var i=t.chrome,o=i.indexOf(".");return Number(i.substring(0,o))}return t.ie?console.info("%c1>your browser is IE ,it does not support play without plugin","color: red"):t.safari?console.info("%c1>your browser is safari ,it does not support softV2.0 or hard decode","color: red"):t.firefox?console.info("%c1>your browser is Firefox ,it only support soft decode","color: red"):console.info("%c1>your browser does not support play without plugin","color: red"),-1}function Ot(e){return Mt()>=94?(e&&e(!0),!0):(e&&e(!1),!1)}var zt=function(){function i(a){var r=this;l(this,i),p(this,"_isCloudRecord",!1),p(this,"_controllers",[]),p(this,"_handleRealUrl",(function(e){var t=JSON.parse(localStorage.getItem("ezuikit_addressList"));return Array.isArray(t[r.deviceSerial+"_"+r.channelNo])&&t[r.deviceSerial+"_"+r.channelNo].map((function(t){t.wsUrl=e.replace(/(wss:\/\/)([^\/:]+)(:\d+)/,"$1".concat(t.domain,":").concat(t.port))})),localStorage.setItem("ezuikit_addressList",JSON.stringify(t)),Array.isArray(t[r.deviceSerial+"_"+r.channelNo])&&t[r.deviceSerial+"_"+r.channelNo].length>0?t[r.deviceSerial+"_"+r.channelNo][0].wsUrl:e})),i._instanceStyle(),this.isStoping=!1;var s,c,d=a.autoplay,u=void 0===d||d;if(this.params=a,this.autoplay=u,this.talkChannelNo=a.talkChannelNo||null,this.eventEmitter=new At,this.timeZone=0,this.ptzSpeed=a.ptzSpeed||2,this.download=void 0===a.download||a.download,this.recordRes={},this.disableRenderPrivateData=void 0===a.disableRenderPrivateData||a.disableRenderPrivateData,this.ptzSpeedOptions={slow:1,mid:2,fast:3},window.EZUIKit[a.id]={state:{EZUIKitPlayer:{init:window.EZUIKit[a.id]&&window.EZUIKit[a.id].state&&window.EZUIKit[a.id].state.EZUIKitPlayer.init||!1,themeInit:window.EZUIKit[a.id]&&window.EZUIKit[a.id].state&&window.EZUIKit[a.id].state.EZUIKitPlayer.themeInit||!1,talkInit:window.EZUIKit[a.id]&&window.EZUIKit[a.id].state&&window.EZUIKit[a.id].state.EZUIKitPlayer.talkInit||!1}}},!this.params.id)throw new Error("id param is required!");if(!document.getElementById(this.params.id))throw new Error("#".concat(this.params.id," node does not exist"));this.appKey="test",this.dataReport=!1!==a.dataReport,this.reportHTTP=!0===a.reportHTTP,this.monitorReport=!0,this.dataReport?this.reportHTTP?this.monitorReport=!0:"https:"!==window.location.protocol||(s=window.location.hostname,4===(c=s.split(".").map((function(e){return!Number.isNaN(e)}))).length&&c.every(Boolean))?this.monitorReport=!1:this.monitorReport=!0:this.monitorReport=!1,new ee(this.params.env?this.params.env.domain:null),this.id=a.id,this.width=a.width,this.height=a.height,this.fullScreenWidth=0,this.fullScreenHeight=0,this.isCall=a.isCall||!1,this.isWebConsole=a.isWebConsole||!1,this.callTime=a.callTime||null,this.hangUpCallback=a.hangUpCallback||null,this.isNeedBellRing=!1!==a.isNeedBellRing,this.url=a.url,this.accessToken=a.accessToken,this.deviceSerial=A(a.url).deviceSerial,this.channelNo=A(a.url).channelNo,this.themeId=Rt(a.template,a).templateId,this.themeId=Rt(a.template,a).templateId?Rt(a.template,a).templateId:"simple",this.id=a.id,this.audio=!0,this.audioOnly=!0,this.poster=a.poster,this.speed=1,this.disabledTimeLine=!1,this.disabledPTZ=!1,this.capacity=null,this.playTimer=null,this.env={domain:W},this.isMobile=L(),this.support3DZoom=!1,this.use3DZoom=!1,this.is3DZooming=!1,this.useHardDev=void 0!==a.useHardDev&&a.useHardDev,this.host="open.ys7.com",this._isCloudRecord=a.isCloudRecord,this._spaceId=a.isCloudRecord?I("spaceId",this.url):void 0,this.waterMark_JSPlugin=!1,this.useSeek=a.useSeek,this.dpr=a.dpr||1,this.decoderType=a.decoderType||"auto",this.videoLevelList=[],this.videoLevel=1,this.streamTypeIn=1,this.language=a.language||"zh",this.languageList=a.languageList||["zh","en"],-1===this.languageList.indexOf(this.language)&&(console.warn("语言【".concat(this.language,"】暂不支持,已切换至中文")),this.language="zh"),this.i18n=new t({zh:de,en:ue}),this.i18n.switchTranslation(this.language||"zh"),this.token=a.token||{},this.deviceInfo={},this.quality=a.quality,document.getElementById("".concat(this.id))&&void 0===this.initDOM&&(this.initDOM=document.getElementById("".concat(this.id)).cloneNode(!0)),this._isCurrentFullscreen=!1,this._isCurrentBrowserFullscreen=!1,this.isInspect=a.isInspect||!1,this.inspectRecordingDuration=a.inspectRecordingDuration||144e5,this.inspectVideoWidth=a.inspectVideoWidth||290,this.inspectVideoHeight=a.inspectVideoHeight||170,this._FECCorrectType=null,this._FECSplitIds="",this.initSuccessTime=0,this.initTime=0,this.gotWsUrlTime=0,this.startGetWsUrlTime=0,this.appearFirstFrameTime=0,this.openStreamTime=0,this.maxReloadTime=0,this.reloadCodeBalckList=a.reloadCodeBalckList||[5402,5406,5411,5507,5546,9048,9049,5451,5558],document.getElementById("".concat(this.id,"-wrap"))&&this.initDOM&&(document.getElementById("".concat(this.id,"-wrap")).parentNode.appendChild(this.initDOM),document.getElementById("".concat(this.id,"-wrap")).parentNode.removeChild(document.getElementById("".concat(this.id,"-wrap"))),delete this.initDOM),this.staticPath="https://openstatic.ys7.com/ezuikit_js/v8.1.5/ezuikit_static";var m,h,g=!this.useHardDev&&Lt()||this.useHardDev&&!Ot()&&(h=!1,!void(Mt()>=107&&window.VideoDecoder?VideoDecoder.isConfigSupported({codec:"hvc1.1.6.L123.00",hardwareAcceleration:"prefer-hardware"}).then((function(e){e.supported?(h=!0,m&&m({bSupHardDecHEVC:h})):m&&m({bSupHardDecHEVC:h})})):m&&m({bSupHardDecHEVC:h})))&&Lt()||this.useHardDev&&(Ot()||this.isSupHardDecHEVC()||Lt());this.isV3=g,"string"==typeof a.staticPath&&(a.staticPath.startsWith("http")?this.staticPath=a.staticPath:this.staticPath=e.getStaticPath(a.staticPath)),void 0!==a.audio&&(this.audio=a.audio),void 0!==a.audioOnly&&(this.audioOnly=a.audioOnly),void 0!==a.env&&(this.env=Object.assign(this.env,a.env)),void 0!==a.host&&(this.host=a.host),void 0!==a.isMobile&&(this.isMobile=a.isMobile),void 0!==a.disabledTimeLine&&(this.disabledTimeLine=a.disabledTimeLine),void 0!==a.disabledPTZ&&(this.disabledPTZ=a.disabledPTZ);var v=JSON.parse(localStorage.getItem("ezuikit_addressList"))||{};v[this.deviceSerial+"_"+this.channelNo]||(v=f(f({},v),{},p({},this.deviceSerial+"_"+this.channelNo,[])),localStorage.setItem("ezuikit_addressList",JSON.stringify(v)));!function(){var e=r;r.pluginStatus=new U(r,r.id),r.videoInitTime=Date.now(),r.videoPlayState=1,window.monitorExtendsInfo={protocol:"ezopen",url:r.url,serial:r.deviceSerial,no:r.channelNo,env:r.env.domain,type:A(r.url).type};var t=Object.assign({},a);(function(e,t){var n=[];return Object.keys(t).map((function(e){n.push("".concat(e,"=").concat(t[e]))})),fetch(e.env.domain+"/api/service/appKey/get?".concat(n.join("&")),{method:"GET"}).then((function(e){return e.json()})).then((function(e){return e}))})(r,{checkToken:r.accessToken||r.token.deviceToken.video,sn:r.deviceSerial,cno:r.channelNo}).then((function(e){e.data&&(r.appKey=e.data.appKey)})),r._autoSwitchByQuality().finally((function(){r.initEZUIKitPlayer(a).finally((function(){var n=Date.now();Ge(e,{deviceSerial:e.deviceSerial,localIndex:e.channelNo,accessToken:e.accessToken||e.token.deviceToken.video}).then((function(e){})).finally((function(i){r.autoplay?r._getRealUrlPromise(a.url).then((function(e){var i=Date.now();if(r.monitorReport&&window.ezuikitMonitor.report({action:1,logInfo:{pluginVersion:g?"v3":"v1",params:t},appKey:r.appKey}),e){var o=Date.now();r._pluginPlay(e,(function(){if(1===r.videoPlayState||4===r.videoPlayState){r.videoPlayState=2;var e=Date.now();r.monitorReport&&window.ezuikitMonitor.report({action:2,logInfo:{pluginVersion:r.isV3?"v3":"v1",loadTime:e-r.videoInitTime,loadTimeDesc:{initTime:r.initTime,stopTime:0,getWsTime:i-n,createWsTime:e-o}},appKey:r.appKey,loadTime:e-r.videoInitTime,initTime:r.initTime,getWsTime:i-n,createWsTime:e-o})}r.audio&&setTimeout((function(){r.openSound()}),100)}),(function(e){if(1===r.videoPlayState||4===r.videoPlayState){r.videoPlayState=3;var t=Date.now();r.monitorReport&&window.ezuikitMonitor.report({action:3,logInfo:{pluginVersion:r.isV3?"v3":"v1",loadTime:t-r.videoInitTime,err:e},errorCode:Bt(e),appKey:r.appKey,loadTime:t-r.videoInitTime})}r.Theme&&r.Theme.setDisabled(!0),r.isInspect?(r.pluginStatus.loadingSetTextWithBtn({mask:!0,maskStyle:"url(".concat(r.staticPath,"/imgs/bg.svg) no-repeat 100%/cover"),text:e&&e.msg,btnName:r.i18n.t("BTN_RETRY"),type:1}),r.Theme.jSPlugin.Zoom&&r.Theme.jSPlugin.Zoom.stopZoom(),r.Theme&&r.Theme.inspect&&r.Theme.inspect.InspectEvent&&r.Theme.inspect.InspectEvent.disableEvidenceBtn()):r.pluginStatus.loadingSetText({text:e&&e.msg||r.i18n.t("GET_PLAYURL_FAILED"),color:"red"})}))}else console.log("promise of one",e);window.EZUIKit[a.id].state.EZUIKitPlayer.init=!0,document.getElementById("".concat(a.id,"canvas_draw0"))&&(document.getElementById("".concat(a.id,"canvas_draw0")).style.border="none")})).catch((function(t){if(1===e.videoPlayState||4===e.videoPlayState){e.videoPlayState=3;var n=Date.now();e.monitorReport&&window.ezuikitMonitor.report({action:3,logInfo:{pluginVersion:e.isV3?"v3":"v1",loadTime:n-e.videoInitTime,err:t},errorCode:Bt(t),appKey:e.appKey,loadTime:n-e.videoInitTime})}e.Theme&&e.Theme.setDisabled(!0),e.isInspect?(e.pluginStatus.loadingSetTextWithBtn({mask:!0,maskStyle:"url(".concat(e.staticPath,"/imgs/bg.svg) no-repeat 100%/cover"),text:t&&t.msg,btnName:e.i18n.t("BTN_RETRY"),type:1}),e.Theme.jSPlugin.Zoom&&e.Theme.jSPlugin.Zoom.stopZoom(),e.Theme&&e.Theme.inspect&&e.Theme.inspect.InspectEvent&&e.Theme.inspect.InspectEvent.disableEvidenceBtn()):e.pluginStatus.loadingSetText({text:t&&t.msg||e.i18n.t("GET_PLAYURL_FAILED"),color:"red"})})):(window.EZUIKit[a.id].state.EZUIKitPlayer.init=!0,document.getElementById("".concat(a.id,"canvas_draw0"))&&(document.getElementById("".concat(a.id,"canvas_draw0")).style.border="none"))}))}))})),r.getDeviceCapacity(),re.createInstance(r.id,{rejection:!1,play:!1,pantile:!1,recordvideo:!1,talk:!1,expend:!1,webExpend:!1,zoom:!1,sound:!1,isEditing:!1,rec:!1,cloudRec:!1}),r.initSuccessTime=(new Date).getTime(),a.plugin&&-1!==a.plugin.indexOf("talk")&&(r.Talk=new Pe(r),window.EZUIKit[a.id].state.EZUIKitPlayer.talkInit=!0)}(),this.play=o((function(e){return r._play(e)}),500,!0),this.resume=o((function(e){return r._resume(e)}),500,!0),this.changePlayUrl=o((function(e,t,n){return r._changePlayUrl(e,t,n)}),500),window.addEventListener("beforeunload",(function(){console.log("退出页面,停止视频流"),re.removeInstance(r.id),r.stop()})),this._controllers=[],n.isEnabled&&(this._fullscreenChangeEvent=this._fullscreenChangeEvent.bind(this),n.on("change",this._fullscreenChangeEvent))}return m(i,[{key:"initEZUIKitPlayer",value:function(e){var t=this,n=e.id,i=e.width,o=void 0===i?600:i,r=e.height,s=void 0===r?400:r;if(!e.width||!e.height){var c=document.getElementById(n).getBoundingClientRect();!e.width&&c.width>0&&(o=c.width),!e.height&&c.height>0&&(s=c.height)}if(!document.getElementById("".concat(n,"-wrap"))){var l=document.createElement("div");l.id="".concat(n,"-wrap"),l.style="display:inline-block;width:".concat(o,"px;position:relative;vertical-align: bottom;"),document.getElementById(n).parentNode.insertBefore(l,document.getElementById(n)),document.getElementById(n).parentNode.removeChild(document.getElementById(n)),this.isInspect&&(l.style.height="".concat(s,"px"),this.width-=this.inspectVideoWidth,this.height-=this.inspectVideoHeight,o=this.width,s=this.height),l.innerHTML="<div id=".concat(n,"></div>"),document.getElementById(n).style="display:inline-block;width:".concat(o,"px;height:").concat(s,"px;"),document.getElementById(n).style.verticalAlign="top",this._$containerResizeEvent()}window.recTimer&&Array.isArray(window.recTimer[n])&&(window.recTimer[n].map((function(e){clearInterval(e)})),window.recTimer[n]=[]);var d=new le(this,n);this.Message=d;var u=new Promise((function(i,r){var c=t;t.randomNum=Math.random(),window.randomNum=t.randomNum;var l=new a({szId:n,iType:2,width:o,height:s,iMaxSplit:1,iCurrentSplit:1,szBasePath:"",staticPath:t.staticPath,isCloudRecord:t._isCloudRecord,env:t.env,oStyle:{border:"none",background:"#000000"},decoderType:t.params.decoderType,autoPlay:!1,dpr:t.params.dpr,url:t.params.url,debugDownloadData:t.params.debugDownloadData,disableRenderPrivateData:t.disableRenderPrivateData});t.pluginStatus.loadingStart(n),t.isCall||t.isInspect?t.pluginStatus.loadingSetText({text:t.i18n.t("VIDEO_LOADING")}):"miniRec"==t.themeId?t.pluginStatus.loadingSetText({text:""}):t.pluginStatus.loadingSetText({text:t.i18n.t("INIT_FINSHED")});var d=!1;l.EventCallback={openStreamCallback:function(){t.openStreamTime=(new Date).getTime(),d=!1},getStreamHeaderCallback:function(){t.getStreamHeaderTime=(new Date).getTime(),d=!1},getVideoStreamCallback:function(){t.getVideoStreamTime=(new Date).getTime(),t.isCall&&t.Theme&&t.Theme.decoderState&&t.Theme.decoderState.state.rejection&&t.stop((function(){t.pluginStatus.loadingClear(),t.pluginStatus.loadingSetTextWithBtn({text:t.i18n.t("CALL_END"),color:"white",isMobile:t.isMobile,type:2})})),t.isInspect&&t.Theme.decoderState.state.play&&("map"!==t.Theme.inspectMode&&t.Theme.jSPlugin.Zoom&&setTimeout((function(){t.Theme.jSPlugin.Zoom.startZoom()}),1e3),t.Theme&&t.Theme.inspect&&t.Theme.inspect.InspectEvent&&t.Theme.inspect.InspectEvent.enableEvidenceBtn())},firstFrameCallback:function(e){switch(e){case 0:t.decodeEngine="v3-soft";break;case 1:t.decodeEngine="v3-hard";break;case 2:t.decodeEngine="v1-soft"}console.log("final decodeEngine is :",t.decodeEngine);var n=JSON.parse(localStorage.getItem("ezuikit_addressList"));Array.isArray(n[c.deviceSerial+"_"+c.channelNo])&&(t.maxReloadTime=n[c.deviceSerial+"_"+c.channelNo].length)},appearFirstFrameCallback:function(){t.pluginStatus.loadingClear(),t.appearFirstFrameTime=(new Date).getTime(),document.getElementById("".concat(t.id,"-player"))&&(document.getElementById("".concat(t.id,"-player")).style.display="block"),"function"==typeof t.params.handleFirstFrameDisplay&&t.params.handleFirstFrameDisplay({retcode:0,id:t.params.id,type:"handleFirstFrameDisplay"}),"function"==typeof t.params.handleSuccess&&t.params.handleSuccess({retcode:0,id:t.params.id,type:"handleSuccess"})},averageStreamSuccessCallback:function(){t.Zoom=new Oe(t),t.averageStreamSuccessTime=t.initSuccessTime-t.initTime+(t.gotWsUrlTime-t.startGetWsUrlTime)+(t.appearFirstFrameTime-t.openStreamTime)},loadEventHandler:function(){},zoomEventResponse:function(){},windowEventSelect:function(e){},pluginErrorHandler:function(e,n,i){if(!(t.isCall&&t.Theme&&t.Theme.decoderState&&t.Theme.decoderState.state.rejection))if(1003===n)t.Theme&&t.Theme.setDecoderState({play:!1}),l.bPlay||(t.isCall?t.pluginStatus.loadingSetTextWithBtn({text:t.i18n.t("DISCONNECT"),color:"white",btnName:t.isMobile?t.i18n.t("BTN_RETRY"):t.i18n.t("BTN_RELOAD"),isMobile:t.isMobile,type:t.isCall?1:2}):t.isInspect&&(t.pluginStatus.loadingSetTextWithBtn({mask:!0,text:t.i18n.t("DISCONNECT"),btnName:t.i18n.t("BTN_RETRY"),type:1}),t.Theme.jSPlugin.Zoom&&t.Theme.jSPlugin.Zoom.stopZoom(),t.Theme&&t.Theme.inspect&&t.Theme.inspect.InspectEvent&&t.Theme.inspect.InspectEvent.disableEvidenceBtn()));else if(1!=i.errorCode){var o=function(){var e=Date.now();1===t.videoPlayState||4===t.videoPlayState?(t.videoPlayState=3,t.monitorReport&&window.ezuikitMonitor.report({action:3,logInfo:{pluginVersion:t.isV3?"v3":"v1",err:i,loadTime:e-t.videoInitTime},errorCode:Bt(i),appKey:t.appKey,loadTime:e-t.videoInitTime})):2===t.videoPlayState&&(t.videoPlayState=5,t.monitorReport&&window.ezuikitMonitor.report({action:5,logInfo:{pluginVersion:t.isV3?"v3":"v1",err:i,loadTime:e-t.videoInitTime},errorCode:Bt(i),appKey:t.appKey,loadTime:e-t.videoInitTime}));var n=t.i18n.t("DISCONNECT");n=t.i18n.t("39"+i.errorCode),t.Theme&&t.Theme.setDecoderState({play:!1}),t.pluginStatus.setPlayStatus({play:!1}),t.pluginStatus.loadingClear(),t.isCall?t.pluginStatus.loadingSetTextWithBtn({text:n,color:"white",btnName:t.isMobile?t.i18n.t("BTN_RETRY"):t.i18n.t("BTN_RELOAD"),isMobile:t.isMobile}):t.isInspect?(t.Theme.jSPlugin.Zoom&&t.Theme.jSPlugin.Zoom.stopZoom(),t.pluginStatus.loadingSetTextWithBtn({mask:!0,text:n,btnName:t.i18n.t("BTN_RETRY"),type:1}),t.Theme&&t.Theme.inspect&&t.Theme.inspect.InspectEvent&&t.Theme.inspect.InspectEvent.disableEvidenceBtn()):t.pluginStatus.loadingSetText({text:n,color:"red"}),"function"==typeof t.params.handleError&&t.params.handleError({msg:n,retcode:i.errorCode,id:t.params.id,type:"handleError"})};t.reloadCodeBalckList.indexOf(i.errorCode)>-1?o():t._reload(i).catch((function(e){o()}))}else t.pluginStatus.loadingClear(),t.Theme&&t.Theme.setDisabled(!1)},windowEventOver:function(e){},windowEventOut:function(e){},windowEventUp:function(e){},windowFullCcreenChange:function(e){},firstFrameDisplay:function(e,t,n){l.JS_SetCanFullScreen(!1)},performanceLack:function(){},mouseEvent:function(e,t,n){},setRunTimeInfoCallBack:function(n){var i=n.pstRuntimeInfo;if(5===i.nErrorCode)if(c.isInspect){c.pluginStatus.loadingClear(),c.Theme.jSPlugin.Zoom&&c.Theme.jSPlugin.Zoom.stopZoom(),(o=document.getElementById("".concat(t.id,"-loading-item-txt")))&&o.textContent===t.i18n.t("DEVICE_ENCRYPTED")||c.pluginStatus.loadingSetTextWithBtn({mask:!0,maskStyle:"url(".concat(t.staticPath,"/imgs/bg.svg) no-repeat 100%/cover"),text:t.i18n.t("DEVICE_ENCRYPTED"),color:"white",btnName:t.i18n.t("BTN_RETRY"),type:1})}else{var o=document.getElementById("".concat(t.id,"-loading-item-txt"));t.Theme.decoderState&&t.Theme.decoderState.state.play&&(null===o||-1===o.innerHTML.indexOf("设备已加密"))&&(c.pluginStatus.loadingClear(),c.pluginStatus.loadingSetText({text:t.i18n.t("DEVICE_ENCRYPTED"),color:"red"}))}if(!d&&9!==i.nErrorCode){var a=function(t){var n=I("begin",c.url);"function"==typeof e.handleError&&e.handleError({retcode:r,data:f(f({},s),{},{time:Number.isNaN(t)||void 0===t?n||(new Date).Format("yyyyMMdd")+"000000":new Date(t).Format("yyyyMMddhhmmss")}),id:c.params.id,type:"handleRunTimeInfoError"})};Dt(t.id);var r=-1,s=i;t._tempSeekTime?a(t._tempSeekTime.getTime()):t.getOSDTime().then((function(e){a(Number.isNaN(e.data)?void 0:1e3*e.data)})),setTimeout((function(){t.jSPlugin.JS_Stop(0),t.Theme&&t.Theme.setDecoderState({play:!1,sound:!1,recordvideo:!1,talk:!1,zoom:!1,capturePicture:!1})}),1e3)}d=!0},setAdditionDataCallBack:function(t){"function"==typeof e.handleAdditionData&&e.handleAdditionData({retcode:0,data:t,id:e.id,type:"handleAdditionData"})}},void 0!==e.handleTalkSuccess&&(t.handleTalkSuccess=e.handleTalkSuccess),void 0!==e.handleTalkError&&(t.handleTalkError=e.handleTalkError),t.jSPlugin=l,l.player.event.on("initializing",(function(e){var n,o;c.url.indexOf(".live")>-1?(n=c,o="".concat(n.env.domain,"/api/lapp/device/camera/list?accessToken=").concat(n.accessToken||n.token.deviceToken.video,"&deviceSerial=").concat(n.deviceSerial," "),fetch(o,{method:"POST",headers:{clientType:"ezuikit",sdkVersion:Fe}}).then((function(e){return e.json()})).then((function(e){return e})).catch((function(e){return e}))).then((function(e){if(200==e.code){if(Array.isArray(e.data)&&e.data.length>0){var n=e.data.findIndex((function(e){return e.channelNo==c.channelNo})),o=e.data[n];Ve(c).then((function(e){c.videoLevelList=e,"compatible"===e[0].type?t.url.indexOf(".hd.live")>0?(c.videoLevel=e[1].level,c.streamTypeIn=e[1].streamTypeIn):t.url.indexOf(".live")>0&&(c.videoLevel=e[0].level,c.streamTypeIn=e[0].streamTypeIn):e.map((function(e){e.level==o.videoLevel&&(c.videoLevel=e.level,c.streamTypeIn=e.streamTypeIn)}))})).catch((function(e){})).finally((function(){c._initTheme(),i({meta:{retcode:200,msg:c.i18n.t("client.init.INIT_SUCCESS")}})}))}}else c._initTheme(),i({meta:{retcode:200,msg:c.i18n.t("client.init.INIT_SUCCESS")}})})).catch((function(e){c._initTheme(),i({meta:{retcode:200,msg:c.i18n.t("client.init.INIT_SUCCESS")}})})):(t._initTheme(),i({meta:{retcode:200,msg:c.i18n.t("client.init.INIT_SUCCESS")}}))}))}));return u}},{key:"_reload",value:function(e){var t=this;return new Promise((function(n,i){try{var o=JSON.parse(localStorage.getItem("ezuikit_addressList"));if(Array.isArray(o[t.deviceSerial+"_"+t.channelNo])&&o[t.deviceSerial+"_"+t.channelNo].length>0){t.maxReloadTime-=1;var a=o[t.deviceSerial+"_"+t.channelNo].shift();if(o[t.deviceSerial+"_"+t.channelNo].push(a),localStorage.setItem("ezuikit_addressList",JSON.stringify(o)),t.maxReloadTime>0){console.log("使用备用机房地址"),t.monitorReport&&window.ezuikitMonitor.report({action:6,logInfo:{pluginVersion:t.isV3?"v3":"v1",wsUrl:t.wsUrl,error:e},appKey:t.appKey});var r=new URL(o[t.deviceSerial+"_"+t.channelNo][0].wsUrl);t.url.indexOf("rec")>-1&&t.getOSDTime().then((function(e){r.searchParams.set("begin",new Date(1e3*e.data).Format("yyyyMMddThhmmssZ"))})),t.stop((function(){}),!0).then((function(e){t._pluginPlay(r.toString(),(function(){console.log("备用机房地址取流成功"),t.monitorReport&&window.ezuikitMonitor.report({action:7,logInfo:{pluginVersion:t.isV3?"v3":"v1",wsUrl:o[t.deviceSerial+"_"+t.channelNo][0].wsUrl,reloadRes:{code:1,msg:"发起重试成功"}},appKey:t.appKey}),re.getInstance(t.id).getState().sound&&setTimeout((function(){t.openSound(),t.Theme.setDecoderState({sound:!0})}),2e3),n({code:1,msg:"发起重试成功"})}),(function(e){}))})).catch((function(e){console.log("备用机房地址取流失败 -1"),t.monitorReport&&window.ezuikitMonitor.report({action:8,logInfo:{pluginVersion:t.isV3?"v3":"v1",wsUrl:o[t.deviceSerial+"_"+t.channelNo][0].wsUrl,reloadRes:{code:-1,msg:"发起重试失败",stopError:e}},appKey:t.appKey})}))}else console.log("备用机房地址取流失败 -2"),t.monitorReport&&window.ezuikitMonitor.report({action:8,logInfo:{pluginVersion:t.isV3?"v3":"v1",reloadRes:{code:-2,msg:"所有备用机房地址取流失败"}},appKey:t.appKey}),i({code:-2,msg:"所有备用机房地址取流失败"})}else console.log("备用机房地址取流失败 -2"),t.monitorReport&&window.ezuikitMonitor.report({action:8,logInfo:{pluginVersion:t.isV3?"v3":"v1",reloadRes:{code:-2,msg:"无可用的备用机房地址"}},appKey:t.appKey}),i({code:-2,msg:"无可用的备用机房地址"})}catch(e){console.log("备用机房地址取流失败",e),t.monitorReport&&window.ezuikitMonitor.report({action:8,logInfo:{pluginVersion:t.isV3?"v3":"v1",reloadRes:{code:-2,msg:"备用机房地址重试失败",error:e}},appKey:t.appKey}),i({code:-2,msg:"备用机房地址重试失败"})}}))}},{key:"_initTheme",value:function(){var e=this;e.initTime=(new Date).getTime()-e.videoInitTime,e.themeId&&(1==e.params.isCall?e.Theme=new ut(e,params.id):1==e.params.isInspect?e.Theme=new jt(e):e.Theme=new qe(e,e.params.id),window.EZUIKit[e.params.id].state.EZUIKitPlayer.themeInit=!0,"function"==typeof e.params.handleThemeChange&&(e.handleThemeChange=e.params.handleThemeChange))}},{key:"_getRealUrlPromise",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=this;this.startGetWsTime=Date.now(),this.startGetWsUrlTime=(new Date).getTime();var o=this.env.domain;this.env&&(o=this.env.domain);var a=function(a,c){var l="",d="",u="",m={ezopen:e,isFlv:!1,userAgent:window.navigator.userAgent,isHttp:!1,needStreamToken:i.accessToken?1:0,accessToken:i.accessToken||i.token.deviceToken.video};if(t.params.extraParams&&t.params.extraParams.ezopenParams&&"object"===b(t.params.extraParams.ezopenParams))for(var h in t.params.extraParams.ezopenParams)m[h]=t.params.extraParams.ezopenParams[h];var p=new AbortController;t._controllers.push(p),function(e,t,n){var i=new FormData;return Object.keys(t).map((function(e){i.append(e,t[e])})),fetch(e.env.domain+"/api/lapp/live/url/ezopen",{method:"POST",signal:n,body:i,headers:{clientType:"ezuikit",sdkVersion:Fe}}).then((function(e){return e.json()})).then((function(e){return e}))}(t,m,p.signal).then((function(m){if(200==m.code||0==m.retcode){m.ext&&m.ext.token?(l+=m.data,u=i.accessToken?m.ext.token:t.token.streamToken[m.data.indexOf("live")>-1||m.data.indexOf("cloud")>-1?"live":"rec"],d=m.data):m.data&&("string"==typeof m.data?(l+=m.data,u=t.token.streamToken[m.data.indexOf("live")>-1||m.data.indexOf("cloud")>-1?"live":"rec"],d=m.data):(l+=m.data.url,u=i.accessToken?m.data.token:t.token.streamToken[m.data.indexOf("live")>-1||m.data.indexOf("cloud")>-1?"live":"rec"],d=m.data.url));var h=-1!==e.indexOf("live")?"live":"playback",p=I("checkCode",l="live"===h?l+"&ssn="+u+"&auth=1&biz=4&cln=100":l+"&ssn="+u+"&auth=1&cln=100");if(p&&(void 0!==t.jSPlugin.decoderVersion&&"2.0"===t.jSPlugin.decoderVersion?t.validateCode=p:(t.validateCode=p,t.jSPlugin.JS_SetSecretKey(0,p))),t.params.extraParams&&t.params.extraParams.wsParams)if("string"==typeof t.params.extraParams.wsParams)l+="&"+t.params.extraParams.wsParams;else if("object"===b(t.params.extraParams.wsParams))for(var g in t.params.extraParams.wsParams)l+="&"+g+"="+t.params.extraParams.wsParams[g];if(-1!==l.indexOf("playback")){var v,y,S=I("begin",e)||I("begin",d),_=I("end",e)||I("end",d);if(""===I("timeZone",e)||n)e.indexOf("timeZone=")>-1&&(l=l.replace("timeZone=","timeZone=0"));else{var w=parseInt(I("timeZone",e));w<24&&w>-24?i.timeZone=w:(i.timeZone=0,console.warn("timeZone时区参数错误,取值范围为-23~23"))}if(S?(v=r(S,"000000",n?0:i.timeZone),l=l.replace("&begin="+I("begin",d),""),l+="&begin="+v):(v=oe((B=(new Date).Format("yyyyMMdd")+"000000",M=parseInt(B.substring(0,4),10),O=parseInt(B.substring(4,6),10)-1,z=parseInt(B.substring(6,8),10),N=parseInt(B.substring(8,10),10),F=parseInt(B.substring(10,12),10),U=parseInt(B.substring(12,14),10),new Date(M,O,z,N,F,U)),n?0:i.timeZone).Format("yyyyMMddThhmmssZ"),l=l+"&begin="+v),_?(y=r(_,"235959",n?0:i.timeZone),l=l.replace("&end="+I("end",d),"")):y=S?r(r(S,"000000",n?0:i.timeZone).substr(0,8),"235959"):oe(new Date,n?0:i.timeZone).Format("yyyyMMdd")+"T235959Z",v.slice(0,8)!==y.slice(0,8)&&(y=v.slice(0,8)+y.slice(8)),l=l+"&end="+y,I("stream",d)||(l=l.replace("stream","&stream")),i._isCloudRecord&&-1!==e.indexOf(".cloud")&&"7"===I("busType",i.url)){var T=s(I("begin",l)),E=s(I("end",l)),P=I("serial",l),k=I("chn",l),C={accessToken:t.accessToken||t.token.deviceToken.global,deviceSerial:P,channelNo:k,startTime:T,endTime:E,spaceId:t._spaceId},x=[];ne(i,C).then((function(e){!function(e){if(e.data&&e.data&&e.data.length>0){x=x.concat(e.data);var t=JSON.stringify(function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];function n(e){var n={};return t.forEach((function(t){n[t]=e[t]})),n.istorageVersion&&(n.iStorageVersion=n.istorageVersion,delete n.istorageVersion),n}return e.reduce((function(e,t,i){return 0===i?(e.push(n(t)),e):(e[e.length-1].downloadPath===t.downloadPath?e[e.length-1].endTime=t.endTime:e.push(n(t)),e)}),[])}(x,["downloadPath","ownerId","istorageVersion","spaceId","startTime","endTime","videoType","busType"])).replace("\\","");l+="&recSlice="+t.replace("\\","")+"&r="+Math.random(),a(i._handleRealUrl(l))}else c({retcode:"420004",msg:i.i18n.t("NO_CLOUD_RECORD")})}(e)})).catch((function(e){c({retcode:"420004",msg:i.i18n.t("NO_CLOUD_RECORD")})}))}else if(-1!==e.indexOf(".cloud")&&"7"!==I("busType",t.url)){T=s(I("begin",l)),E=s(I("end",l)),P=I("serial",l),k=I("chn",l);var j=o+"/api/lapp/video/by/time",A={accessToken:t.accessToken||t.token.deviceToken.video,recType:1,deviceSerial:P,channelNo:k,startTime:T,endTime:E,version:"2.0"};R(j,"POST",A,"",(function(e){if(200==e.code){var t=[];if(e.data&&e.data.files&&e.data.files.length>0){var n=e.data.files,o=(new Date).getTime();if(e.data.isAll){t=d(n);var r=JSON.stringify(t).replace("\\","");l+="&recSlice="+r.replace("\\","")+"&r="+Math.random(),a(i._handleRealUrl(l))}else{var s=function(){A.startTime=o,R(j,"POST",A,"",(function(e){if(e.data&&e.data.files&&e.data.files.length>0)if(0==e.data.isAll)e.data.files&&(n=n.concat(e.data.files)),o=e.data.nextFileTime>0?e.data.nextFileTime:(new Date).getTime(),s();else{t=d(n);var r=JSON.stringify(t).replace("\\","");l+="&recSlice="+r.replace("\\","")+"&r="+Math.random(),a(i._handleRealUrl(l))}else{t=d(n);r=JSON.stringify(t).replace("\\","");l+="&recSlice="+r.replace("\\","")+"&r="+Math.random(),a(i._handleRealUrl(l))}}))};s()}}else c({retcode:"420003",msg:i.i18n.t("NO_RECORD")})}else c({retcode:"420003",msg:i.i18n.t("NO_RECORD")});function d(e){var t=[];return e.forEach((function(e,n){0==t.length||e.downloadPath!==t[t.length-1].downloadPath?t.push({downloadPath:e.downloadPath,ownerId:e.ownerId,iStorageVersion:e.iStorageVersion,videoType:e.videoType,iPlaySpeed:0,startTime:e.startTime,endTime:e.endTime}):t[t.length-1].endTime=e.endTime})),t}}))}else a(i._handleRealUrl(l))}else a(i._handleRealUrl(l))}else{var D=JSON.parse(localStorage.getItem("ezuikit_addressList")),L=D?D[i.deviceSerial+"_"+i.channelNo]:[];L.length>0&&L[0].wsUrl&&"10002"!=m.code?a(L[0].wsUrl):("fail"!==m.type?(t.Theme&&(t.Theme.setDisabled(!0),t.Theme.setDecoderState({play:!1})),t.pluginStatus.setPlayStatus({play:!1}),t.pluginStatus.loadingClear(),t.isInspect?(t.Theme.jSPlugin.Zoom&&t.Theme.jSPlugin.Zoom.stopZoom(),t.pluginStatus.loadingSetTextWithBtn({mask:!0,maskStyle:"url(".concat(t.staticPath,"/imgs/bg.svg) no-repeat 100%/cover"),text:m.msg,color:"white",btnName:t.i18n.t("BTN_RETRY"),type:1}),t.Theme&&t.Theme.inspect&&t.Theme.inspect.InspectEvent&&t.Theme.inspect.InspectEvent.disableEvidenceBtn()):t.pluginStatus.loadingSetText({text:m.msg,color:"red"}),setTimeout((function(){Dt(t.id)}),200),c(f(f({},m),{},{type:"fail",retcode:m.code}))):c(f(f({},m),{},{type:"fail"})),t.params.handleError&&t.params.handleError(f(f({},m),{},{retcode:m.code})))}var B,M,O,z,N,F,U})).catch((function(e){var t=JSON.parse(localStorage.getItem("ezuikit_addressList")),n=t?t[i.deviceSerial+"_"+i.channelNo]:[];n.length>0&&n[0].wsUrl?a(n[0].wsUrl):(console.error(e),c({retcode:"400002",type:"fail",msg:e}))}))};return new Promise((function(e,t){return a(e,t)}));function r(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;(n<=-24||n>=24)&&(n=0);if(/^[0-9]{8}T[0-9]{6}Z$/.test(e))e=e.replace("T","").replace("Z","");else{if(!/[0-9]{8,14}/.test(e))throw new Error("回放时间格式有误,请确认");var i=6-(14-e.length),o=t.length;e+=t.substring(i,o)}var a=60*n*60*1e3,r=function(e){"object"!==b(e)&&(e=new Date(e));var t=e.getFullYear(),n=(e.getMonth()+1).toString().padStart(2,"0"),i=e.getDate().toString().padStart(2,"0"),o=e.getHours().toString().padStart(2,"0"),a=e.getMinutes().toString().padStart(2,"0"),r=e.getSeconds().toString().padStart(2,"0");return"".concat(t).concat(n).concat(i).concat(o).concat(a).concat(r)}(new Date(parseInt(e.slice(0,4)),parseInt(e.slice(4,6))-1,parseInt(e.slice(6,8)),parseInt(e.slice(8,10)),parseInt(e.slice(10,12)),parseInt(e.slice(12,14))).getTime()+a);return r.slice(0,8)+"T"+r.slice(8)+"Z"}function s(e){var t=e.slice(0,4),n=e.slice(4,6),i=e.slice(6,8),o=e.slice(9,11),a=e.slice(11,13),r=e.slice(13,15);return new Date((t+"-"+n+"-"+i+" "+o+":"+a+":"+r).replace(/-/g,"/")).getTime()}}},{key:"_autoSwitchByQuality",value:function(){var e=this;return["0","1","2","3","4","5","6","pp","qp"].includes(this.quality+"")&&this.url.indexOf(".live")>-1?Ve(this).then((function(t){if(t.findIndex((function(e){return"compatible"===e.type}))>=0)return Promise.resolve();var n={};return(n="pp"===e.quality?t[0]:"qp"===e.quality?t[t.length-1]:t.find((function(t){return t.level===+e.quality&&"compatible"!==t.type})))?He(e,n.level):void 0})):Promise.resolve()}},{key:"_pluginPlay",value:function(e,t,n){var i=this,o=this;if(console.log("取流地址: ",e),!e)return!1;(function(e,t){var n=new FormData;return Object.keys(t).map((function(e){n.append(e,t[e])})),fetch(e.env.domain+"/api/lapp/device/info",{method:"POST",body:n}).then((function(e){return e.json()})).then((function(e){return e}))})(this,{accessToken:this.accessToken||this.token.deviceToken.global,deviceSerial:A(this.url).deviceSerial}).then((function(e){e.data&&(o.deviceInfo=e.data,document.getElementById("".concat(o.id,"-deviceName-content"))&&(document.getElementById("".concat(o.id,"-deviceName-content")).innerHTML=o.deviceInfo.deviceName||""))})).finally((function(){if(void 0!==i.deviceInfo.status&&1!==i.deviceInfo.status&&i.url.indexOf("live")>-1)return i.pluginStatus.loadingClear(),i.Theme&&i.Theme.setDisabled(!0),i.pluginStatus.loadingSetText({text:i.i18n.t("395404"),color:"red"}),"function"==typeof i.params.handleError&&i.params.handleError({msg:i.i18n.t("395404"),retcode:5404,id:i.params.id,type:"handleError"}),n({msg:i.i18n.t("395404"),retcode:"395404"}),!1;function a(e){var t=e.split("?")[0].replace("/live","").replace("/playback",""),n=(-1===e.indexOf("/live")?-1!==e.indexOf("cloudplayback")?"/cloudplayback?":"/playback?":"/live?")+e.split("?")[1];return{websocketConnectUrl:t,websocketStreamingParam:n=n.replace("stream=2",-1!==n.indexOf("/playback")?"stream=1":"stream=".concat(o.streamTypeIn))}}var r=a(e).websocketConnectUrl;i.env&&i.env.wsUrl&&(r=i.env.wsUrl),i.wsUrl=r,i.doCreateWsTime=Date.now(),i.gotWsUrlTime=(new Date).getTime();var s={playURL:a(e).websocketStreamingParam+"&stream="+i.streamTypeIn};i.isStoping=!1,i.jSPlugin&&i.jSPlugin.JS_Play(r,s,0).then((function(){i.isStoping||(i.validateCode&&void 0!==i.jSPlugin.decoderVersion&&"2.0"===i.jSPlugin.decoderVersion&&i.jSPlugin.JS_SetSecretKey(0,i.validateCode),i.pluginStatus.setPlayStatus({play:!0,loading:!1}),i.Theme&&i.Theme.setDecoderState({play:!0}),t(s))}),(function(e){var t=i.i18n.t("PLAY_FAILED"),o=-1;if(i.jSPlugin&&i.jSPlugin.bPlay)return!1;e&&e.errorCode&&(i.Theme&&i.Theme.setDisabled(!0),t=i.i18n.t("39"+e.errorCode),o=e.errorCode),i.isCall?i.Theme&&i.Theme.decoderState&&i.Theme.decoderState.state.rejection||(i.pluginStatus.loadingClear(),i.pluginStatus.loadingSetTextWithBtn({text:t,color:"white",btnName:i.isMobile?i.i18n.t("BTN_RETRY"):i.i18n.t("BTN_RELOAD"),isMobile:i.isMobile})):(i.pluginStatus.loadingClear(),i.isInspect?(i.Theme.jSPlugin.Zoom&&i.Theme.jSPlugin.Zoom.stopZoom(),5404===o?document.getElementById("".concat(i.id,"-no - inspect - box"))||i.Theme&&i.Theme.inspectEnding():i.pluginStatus.loadingSetTextWithBtn({mask:!0,text:t,color:"white",btnName:i.i18n.t("BTN_RETRY"),type:1}),i.Theme&&i.Theme.inspect&&i.Theme.inspect.InspectEvent&&i.Theme.inspect.InspectEvent.disableEvidenceBtn()):i._destroy||i.pluginStatus.loadingSetText({text:t,color:"red"})),n({msg:t,retcode:o})}))}))}},{key:"_play",value:function(e){var t=this;this.pluginStatus.setPlayStatus({play:!1,loading:!0}),this.playStartTime=(new Date).getTime(),e&&!e.unSaveUrl&&("string"==typeof e&&(this.url=e),"string"==typeof e.url&&(this.url=e.url),"string"==typeof A(this.url).deviceSerial&&(this.deviceSerial=A(this.url).deviceSerial),"string"==typeof A(this.url).channelNo&&(this.channelNo=A(this.url).channelNo));var n=new Promise((function(n,i){t.isStoping=!0,t.jSPlugin.JS_Stop(e&&e.showPoster?e.showPoster:0).then((function(){Dt(t.id),t.stopTime=Date.now(),t._getRealUrlPromise(e&&e.url?e.url:t.url,e&&!!e.url).then((function(e){t._pluginPlay(e,(function(e){t.eventEmitter&&t.eventEmitter.emit("play",{eventType:"play",code:0,target:t,msg:t.i18n.t("PLAY_SUCCESS")}),setTimeout((function(){t.pluginStatus.loadingClear(),t.isCall&&t.Theme&&t.Theme.decoderState&&t.Theme.decoderState.state.rejection&&t.stop((function(){t.pluginStatus.loadingClear(),t.pluginStatus.loadingSetTextWithBtn({text:t.i18n.t("CALL_END"),color:"white",isMobile:t.isMobile,type:2})}))}),500),t.jSPlugin&&t._FECSplitIds&&t._FECCorrectType&&t.jSPlugin.JS_FECCorrectType(t._FECCorrectType,t._FECSplitIds),t.waterMark_JSPlugin&&t.setWaterMarkFont(t.waterMark_JSPlugin);var i=re.getGlobalState();re.getInstance(t.id).getState().sound&&!1===i.sound&&setTimeout((function(){t.openSound(),t.Theme.setDecoderState({sound:!0})}),500),n(!0)}),(function(){return i(!1)}))})).catch((function(e){var n=e.msg?e.msg:t.i18n.t("PLAY_FAILED");t.Theme&&t.Theme.setDisabled(!0),t.isCall?t.Theme&&t.Theme.decoderState&&t.Theme.decoderState.state.rejection?e&&20018==e.code?t.pluginStatus.loadingSetTextWithBtn({text:t.i18n.t("USER_DO_NOT_OWN_DEVICE"),color:"white",isMobile:t.isMobile,type:2}):t.pluginStatus.loadingSetTextWithBtn({text:t.i18n.t("CALL_END"),color:"white",isMobile:t.isMobile,type:2}):e&&20018==e.code?(t.pluginStatus.loadingSetTextWithBtn({text:t.i18n.t("USER_DO_NOT_OWN_DEVICE"),color:"white",isMobile:t.isMobile,type:2}),!t.isWebConsole&&t.Theme&&t.Theme.call&&t.Theme.userNoDevice()):t.pluginStatus.loadingSetTextWithBtn({text:n,color:"white",btnName:t.isMobile?t.i18n.t("BTN_RETRY"):t.i18n.t("BTN_RELOAD"),isMobile:t.isMobile}):t.isInspect?(t.Theme.jSPlugin.Zoom&&t.Theme.jSPlugin.Zoom.stopZoom(),t.pluginStatus.loadingSetTextWithBtn({mask:!0,maskStyle:"url(".concat(t.staticPath,"/imgs/bg.svg) no-repeat 100%/cover"),text:n,color:"white",btnName:t.i18n.t("BTN_RETRY"),type:1}),t.Theme&&t.Theme.inspect&&t.Theme.inspect.InspectEvent&&t.Theme.inspect.InspectEvent.disableEvidenceBtn()):(console.error("播放失败,请检查设备及客户端网络",e),t.pluginStatus.loadingSetText({text:n,color:"red"})),"function"==typeof t.params.handleError&&t.params.handleError({retcode:e.oError?e.oError.errorCode:e.code||-1,msg:n,id:t.params.id,type:"handleError"}),t.eventEmitter&&t.eventEmitter.emit("play",{eventType:"play",code:e.oError?e.oError.errorCode:e.code||-1,target:t,msg:e.msg?e.msg:t.i18n.t("PLAY_FAILED")}),i({retcode:e.oError?e.oError.errorCode:e.code||-1,msg:n,id:t.params.id,type:"handleError"})}))}))}));return n}},{key:"stop",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:function(){},n=arguments.length>1?arguments[1]:void 0;return this._abortFetch(),this.pluginStatus.setPlayStatus({loading:!0}),this.reSetTheme(),this.jSPlugin.JS_Stop(n).then((function(){e.pluginStatus.setPlayStatus({play:!1,loading:!1}),e.Theme&&e.Theme.setDecoderState({play:!1}),e.eventEmitter&&e.eventEmitter.emit("stop",{eventType:"stop",code:0,target:e,msg:e.i18n.t("STOP_SUCCESS")}),t()}))}},{key:"changeVideoLevel",value:function(e){var t,n=this;return"object"===b(e)?this.videoLevelList.map((function(n){n.level===e.level&&(t=n)})):this.videoLevelList.map((function(n){n.level===e&&(t=n)})),void 0===t?(console.log(this.i18n.t("VIDEO_LEVEL_NOT_SUPPORT")+":"+e),void(this.eventEmitter&&this.eventEmitter.emit("changeVideoLevel",{eventType:"changeVideoLevel",code:-2,target:this,data:e,msg:this.i18n.t("VIDEO_LEVEL_NOT_SUPPORT")+":"+e}))):(this.videoLevel=t.level,this.streamTypeIn=t.streamTypeIn,new Promise((function(t,i){He(n,n.videoLevel).then((function(o){document.getElementById("".concat(n.id,"-videoLevel-icon"))&&(document.getElementById("".concat(n.id,"-videoLevel-icon")).innerHTML=n.i18n.t(Ne[n.videoLevel]),document.getElementById("".concat(n.id,"-videoLevel-icon")).dataset.type=n.videoLevel),n.changePlayUrl({url:n.url},(function(){}),!1).then((function(i){n.eventEmitter&&n.eventEmitter.emit("changeVideoLevel",{eventType:"changeVideoLevel",code:0,target:n,data:e,msg:n.i18n.t("CHANGE_VIDEO_LEVEL")}),t(i)})).catch((function(t){console.log("清晰度切换失败:",t),n.eventEmitter&&n.eventEmitter.emit("changeVideoLevel",{eventType:"changeVideoLevel",code:-1,target:n,data:e,msg:n.i18n.t("CHANGE_VIDEO_LEVEL_FAIL")}),i(o)}))})).catch((function(i){console.log("清晰度切换失败:",i),n.url.indexOf(".hd.live")>=0?n.url=n.url.replace(".hd.live",".live"):n.url.indexOf(".live")>=0&&(n.url=n.url.replace(".live",".hd.live")),n.changePlayUrl({url:n.url},(function(){}),!1).then((function(){document.getElementById("".concat(n.id,"-videoLevel-icon"))&&(document.getElementById("".concat(n.id,"-videoLevel-icon")).innerHTML=n.i18n.t(Ne[n.videoLevel]),document.getElementById("".concat(n.id,"-videoLevel-icon")).dataset.type=n.videoLevel),t(res)})),n.eventEmitter&&n.eventEmitter.emit("changeVideoLevel",{eventType:"changeVideoLevel",code:-1,target:n,data:e,msg:n.i18n.t("CHANGE_VIDEO_LEVEL_FAIL")})}))})))}},{key:"reSetTheme",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this.Theme&&this.Theme.Ptz&&this.Theme.decoderState.state.pantile&&(this.Theme.setDecoderState({pantile:!1}),this.Theme.Ptz.hide()),this.Theme&&this.Theme.decoderState.state.recordvideo&&this.Theme.setDecoderState({recordvideo:!1}),e.indexOf("zoom")>-1&&(this.use3DZoom?(this.is3DZooming=!1,this.close3DZoom()):(this.Zoom&&this.Zoom.currentScale>1&&this.Zoom.stopZoom(),this.Theme&&this.Theme.setDecoderState({zoom:!1}))),this.Theme&&this.Theme.decoderState.state.talk&&(this.stopTalk(),this.Theme.setDecoderState({talk:!1})),this.Theme&&this.Theme.Rec&&!this.Theme.isMobile&&this.Theme.Rec.datepickerHide(),this.Theme&&this.Theme.Rec&&(this.Theme.changeRecSpeed(1),this.Theme.nextRate=1,this.speed=1,this.Theme.setDecoderState({speed:!1})),this.eventEmitter&&this.eventEmitter.emit("reSetTheme",{eventType:"reSetTheme",code:0,target:this,msg:this.i18n.t("RESET_THEME")})}},{key:"_changePlayUrl",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){},i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],o=this;this.Theme&&(this.Theme.setDecoderState({play:!1}),this.Theme.setDisabled(!0)),setTimeout((function(){t.pluginStatus.loadingClear(),t.pluginStatus.loadingStart(t.id),t.pluginStatus.loadingSetText({text:t.i18n.t("LOADING")})}),100),this.reSetTheme(["zoom"]);var a=this.url,r=this._spaceId,s=this._isCloudRecord,c=function(e,t){if(t.url)return t.url;var n=e.split("/")[4].split(".")[e.split("/")[4].split(".").length-1].split("?")[0];"rec"===n&&-1!==e.indexOf(".cloud.rec")&&(n="cloud.rec");t.type&&(n="miniRec"==t.type?"rec":t.type);var i=e.split("/")[3];t.deviceSerial&&(i=t.deviceSerial);var a=e.split("/")[4].split(".")[0];t.channelNo&&(a=t.channelNo);var c=2===e.split("/")[2].split("@").length?e.split("/")[2].split("@")[0]:"";void 0!==t.validCode&&(c=t.validCode);var l="ezopen://".concat(c?"".concat(c,"@"):"").concat(o.host,"/").concat(i,"/").concat(a,".").concat(n);if(""!==I("timeZone",e)){var d=parseInt(I("timeZone",e));d<24&&d>-24?o.timeZone=d:(o.timeZone=0,console.warn("timeZone时区参数错误,取值范围为-23~23"))}if("live"===n)return l;l="ezopen://".concat(c?"".concat(c,"@"):"").concat(o.host,"/").concat(i,"/").concat(a,".").concat(n),t.begin&&t.end?l+="?begin=".concat(t.begin,"&end=").concat(t.end):t.begin?l+="?begin=".concat(t.begin):I("begin",e)&&I("end",e)?l+="?begin=".concat(I("begin",e),"&end=").concat(I("end",e)):I("begin",e)&&(l+="?begin=".concat(I("begin",e)));s&&-1!==l.indexOf("cloud.rec")&&(l+="".concat(-1!==l.indexOf("?")?"&":"?","busType=7").concat(r?"&spaceId=".concat(r):""));return l}(a,e);if(this.url=c,this.deviceSerial=e.deviceSerial||A(this.url).deviceSerial||this.deviceSerial,this.channelNo=e.channelNo||A(this.url).channelNo||this.channelNo,this.accessToken=e.accessToken||this.accessToken,this.token=e.token||this.token,this.videoInitTime=Date.now(),this.videoPlayState=1,e.url){var l=JSON.parse(localStorage.getItem("ezuikit_addressList"))||{};l[this.deviceSerial+"_"+this.channelNo]||(l=f(f({},l),{},p({},this.deviceSerial+"_"+this.channelNo,[])),localStorage.setItem("ezuikit_addressList",JSON.stringify(l))),Ge(this,{deviceSerial:this.deviceSerial,localIndex:this.channelNo,accessToken:this.accessToken||this.token.deviceToken.video})}window.monitorExtendsInfo={protocol:"ezopen",url:this.url,serial:this.deviceSerial,no:this.channelNo,env:this.env.domain,type:A(this.url).type};var d=Object.assign({},o.params);return this.monitorReport&&window.ezuikitMonitor.report({action:4,logInfo:{pluginVersion:this.isV3?"v3":"v1",type:A(this.url).type,params:d},appKey:this.appKey}),this.jSPlugin.player&&(this.jSPlugin.player.playbackRate=1,this.jSPlugin.player._playbackRate=1),this.getDeviceCapacity({deviceSerial:this.deviceSerial,accessToken:this.accessToken||this.token.deviceToken.video}),n(),new Promise((function(n,o){var a={url:c};return e.token&&(a.token=e.token),e.accessToken&&(a.accessToken=e.accessToken),t.play(a).then((function(){i&&(e.type?t.Theme&&("rec"==e.type||"cloud.rec"==e.type?t.Theme.changeTheme(t.isMobile?"mobileRec":"pcRec"):"miniRec"==e.type?t.Theme.changeTheme("miniRec"):(t.Theme.changeTheme(t.isMobile?"mobileLive":"pcLive"),t.Theme.Rec&&t.Theme.Rec.unSyncTimeLine())):t.Theme&&(t.url.indexOf(".rec")>-1?t.Theme.changeTheme(t.isMobile?"mobileRec":"pcRec"):(t.isCall?t.Theme.changeTheme(t.isMobile?"mobileCall":"webCall"):t.Theme.changeTheme(t.themeId),t.Theme.Rec&&t.Theme.Rec.unSyncTimeLine()))),e&&e.begin&&e.deviceSerial&&t.Theme&&t.Theme.Rec.setDatepickerDate(e.begin),t.Theme&&(t.Theme.setDisabled(!1),t.Theme.Zoom&&t.Theme.Zoom.stopZoom()),t.eventEmitter&&t.eventEmitter.emit("changePlayUrl",{eventType:"changePlayUrl",code:0,target:t,msg:t.i18n.t("CHANGE_PLAYURL_SUCCESS")}),n(c)})).catch((function(e){o(c),t.eventEmitter&&t.eventEmitter.emit("changePlayUrl",{eventType:"changePlayUrl",code:-1,target:t,msg:e&&e.msg?e.msg:t.i18n.t("CHANGE_PLAYURL_FAILED")}),e&&e.msg&&(t.pluginStatus.loadingClear(),t.isInspect?(t.Theme.jSPlugin.Zoom&&t.Theme.jSPlugin.Zoom.stopZoom(),t.pluginStatus.loadingSetTextWithBtn({mask:!0,maskStyle:"url(".concat(t.staticPath,"/imgs/bg.svg) no-repeat 100%/cover"),text:e.msg,color:"white",btnName:t.i18n.t("BTN_RETRY"),type:1}),t.Theme&&t.Theme.inspect&&t.Theme.inspect.InspectEvent&&t.Theme.inspect.InspectEvent.disableEvidenceBtn()):t.pluginStatus.loadingSetText({text:e.msg,color:"red"}))}))}))}},{key:"getOSDTime",value:function(){var e=this;return new Promise((function(t,n){e.jSPlugin.JS_GetOSDTime(0).then((function(n){e.eventEmitter&&e.eventEmitter.emit("getOSDTime",{eventType:"getOSDTime",code:0,target:e,data:n,msg:e.i18n.t("GET_OSD_TIME")}),t({code:0,retcode:0,data:n}),"function"==typeof e.params.getOSDTimeCallBack&&e.params.getOSDTimeCallBack({id:e.id,type:"getOSDTime",code:0,data:n})})).catch((function(t){e.eventEmitter&&e.eventEmitter.emit("getOSDTime",{eventType:"getOSDTime",code:-1,target:e,msg:t||e.i18n.t("GET_OSD_TIME")}),n({code:-1,retcode:-1,data:t}),"function"==typeof e.params.getOSDTimeCallBack&&e.params.getOSDTimeCallBack({id:e.id,type:"getOSDTime",code:-1,data:-1})}))}))}},{key:"capturePicture",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=arguments.length>2?arguments[2]:void 0,o=this.jSPlugin.JS_CapturePicture(0,e||(new Date).getTime(),"JPEG",n,void 0!==i?i:this.download);if(C(o))return new Promise((function(n,i){o.then((function(i){"function"==typeof t.params.capturePictureCallBack&&t.params.capturePictureCallBack({id:t.id,type:"capturePicture",code:0});var o={id:t.id,code:0,data:i.data,type:"handleCapturePicture"};t.eventEmitter&&t.eventEmitter.emit("capturePicture",{eventType:"capturePicture",code:0,target:t,data:i.data,msg:t.i18n.t("CAPTURE_SUCCESS")}),"function"==typeof t.params.handleCapturePicture&&t.params.handleCapturePicture(o),t._isCloudRecord&&-1!==t.url.indexOf(".cloud")&&"7"===I("busType",t.url)&&fetch(t.env.domain+"/api/service/cloud/upload/url"+"?fileName=".concat(e,"&fileType=pic&expireDays=-1&urlExpireTime=1&bizType=ezuikit&accessToken=").concat(t.accessToken||t.token.httpToken.url),{method:"GET"}).then((function(e){return e.json()})).then((function(e){if(e.data&&e.data[0]){var n=new FormData;Object.keys(e.data[0].fields).map((function(t){n.append(t,e.data[0].fields[t])}));for(var o=atob(i.data.base64.split(",")[1]),a=[],r=0;r<o.length;r++)a.push(o.charCodeAt(r));var s=new Blob([new Uint8Array(a)],{type:"image/jpeg"});n.append("file",s,"image.jpeg"),new Ke({url:e.data[0].url,method:"POST",body:n,headers:{accessToken:t.accessToken||t.token.httpToken.url},onUploadComplete:function(e){e.response&&e.response.meta&&200==e.response.meta.code&&console.log("".concat(i.data.fileName," 上传至云存储完成"))}}).upload()}else console.log("云录制文件上传地址获取失败1:",e.meta.message)})).catch((function(e){console.log("云录制文件上传地址获取失败2:",e),console.log(JSON.stringify(e))})),n(o)}),(function(e){"function"==typeof t.params.capturePictureCallBack&&t.params.capturePictureCallBack({id:t.id,type:"capturePicture",code:-1}),t.eventEmitter&&t.eventEmitter.emit("capturePicture",{eventType:"capturePicture",code:-1,target:t,msg:e||t.i18n.t("CAPTURE_FAILED")});var n=Object.assign({id:t.id,type:"handleCapturePicture",code:-1},e);"function"==typeof t.params.handleCapturePicture&&t.params.handleCapturePicture(n),i(n)}))}))}},{key:"startSave",value:function(e,t){var n=this,i=this.jSPlugin.JS_StartSave(e,(function(e,t){n.recordRes={url:e,file:t}}),t||this.validateCode),o=this;return C(i)?(i.then((function(){"function"==typeof o.params.startSaveCallBack&&o.params.startSaveCallBack({id:o.id,type:"startSave",code:0}),o.eventEmitter&&o.eventEmitter.emit("startSave",{eventType:"startSave",code:0,target:o,msg:n.i18n.t("START_RECORD_SUCCESS")})})).catch((function(e){o.eventEmitter&&o.eventEmitter.emit("startSave",{eventType:"startSave",code:-1,target:o,msg:n.i18n.t("START_RECORD_FAILED")}),"function"==typeof o.params.startSaveCallBack&&o.params.startSaveCallBack({id:o.id,type:"startSave",code:-1})})),i):(this.Theme&&this.Theme.setDecoderState({recordvideo:!0}),new Promise((function(e){e(i)})))}},{key:"stopSave",value:function(){var e=this,t=this.jSPlugin.JS_StopSave(0),n=this;return C(t)?(t.then((function(){setTimeout((function(){n.eventEmitter&&n.eventEmitter.emit("stopSave",{eventType:"stopSave",code:0,target:n,data:e.recordRes,msg:e.i18n.t("STOP_RECORD_SUCCESS")}),"function"==typeof n.params.stopSaveCallBack&&n.params.stopSaveCallBack({id:n.id,type:"stopSave",data:e.recordRes,code:0}),e.recordRes={}}),200)})).catch((function(){n.eventEmitter&&n.eventEmitter.emit("stopSave",{eventType:"stopSave",code:-1,target:n,msg:e.i18n.t("STOP_RECORD_FAILED")}),"function"==typeof n.params.stopSaveCallBack&&n.params.stopSaveCallBack({id:n.id,type:"stopSave",code:-1}),e.recordRes={}})),t):(this.Theme&&this.Theme.setDecoderState({recordvideo:!1}),new Promise((function(e){e(t)})))}},{key:"openSound",value:function(){var e=this,t=re.getGlobalState(),n=re.getInstance(this.id);if((t.sound&&!1===n.getState().sound||t.talk&&!1===n.getState().talk)&&this.audioOnly)return this.eventEmitter&&this.eventEmitter.emit("openSound",{eventType:"openSound",code:460001,target:this,msg:this.i18n.t("SOUND_OPENED")}),new Promise((function(e,t){t("当前已经有画面正在播放声音")}));var i=this.jSPlugin.JS_OpenSound(0);return this.eventEmitter&&this.eventEmitter.emit("openSound",{eventType:"openSound",code:i,target:this,msg:this.i18n.t("OPEN_SOUND")}),this.Theme&&this.Theme.setDecoderState({sound:!0}),"function"==typeof this.params.openSoundCallBack&&this.params.openSoundCallBack({id:this.id,type:"openSound",code:i}),re.setGlobalState({sound:!0}),n.setState({sound:!0}),Array.isArray(re.listInstances())&&this.audioOnly&&re.listInstances().map((function(t){t.state.sound&&t.id!=e.id&&re.getInstance(t.id).setState({sound:!1})})),C(i)?i:new Promise((function(e){e(i)}))}},{key:"closeSound",value:function(){var e=this.jSPlugin.JS_CloseSound(0);return this.eventEmitter&&this.eventEmitter.emit("closeSound",{eventType:"closeSound",code:e,target:this,msg:this.i18n.t("CLOSE_SOUND")}),C(e)?e:(this.Theme&&this.Theme.setDecoderState({sound:!1}),"function"==typeof this.params.closeSoundCallBack&&this.params.closeSoundCallBack({id:this.id,type:"closeSound",code:e}),re.getInstance(this.id).setState({sound:!1}),re.setGlobalState({sound:!1}),new Promise((function(t){t(e)})))}},{key:"enableZoom",value:function(){var e=this.jSPlugin.JS_EnableZoom(0);return this.eventEmitter&&this.eventEmitter.emit("startZoom",{eventType:"startZoom",code:e,target:this,msg:this.i18n.t("START_ZOOM")}),C(e)?e:new Promise((function(t){t(e)}))}},{key:"closeZoom",value:function(){var e=this.jSPlugin.JS_DisableZoom(0);return this.eventEmitter&&this.eventEmitter.emit("closeZoom",{eventType:"closeZoom",code:e,target:this,msg:this.i18n.t("CLOSE_ZOOM")}),C(e)?e:new Promise((function(t){t(e)}))}},{key:"zoomAdd",value:function(e){this.Zoom&&this.Zoom.addScale(e)}},{key:"zoomSub",value:function(e){this.Zoom&&this.Zoom.subScale(e)}},{key:"enable3DZoom",value:function(){var e=this;if(!e.use3DZoom)return new Promise((function(t,n){e.eventEmitter&&e.eventEmitter.emit("enable3DZoom",{eventType:"enable3DZoom",code:-1,target:e,msg:e.i18n.t("3D_ZOOM_DISABLE")}),n({code:-1,msg:e.i18n.t("3D_ZOOM_DISABLE")})}));if(e.is3DZooming)return new Promise((function(t,n){e.eventEmitter&&e.eventEmitter.emit("enable3DZoom",{eventType:"enable3DZoom",code:-1,target:e,msg:e.i18n.t("3D_ZOOM_ACTIVED")}),n({code:-1,msg:e.i18n.t("3D_ZOOM_ACTIVED")})}));if(e.isMobile||(e.Zoom&&e.Zoom.stopZoom(),e.Theme&&e.Theme.setDecoderState({zoom:!1})),e.support3DZoom){e.is3DZooming=!0,e.Theme&&e.Theme.setDecoderState({zoom:!0}),document.getElementById("".concat(e.id,"-zoom-content"))&&(document.getElementById("".concat(e.id,"-zoom-content")).title=e.i18n.t("3D_ZOOM"));var t=e.jSPlugin.JS_Enable3DZoom(0,(function(t){var n=e.Theme&&e.Theme.decoderState.state.expend&&e.isMobile?e.fullScreenWidth:e.width,i=e.Theme&&e.Theme.decoderState.state.expend&&e.isMobile?e.fullScreenHeight:e.height,o=function(e,t){if(!e||!e.startPos||!e.endPos)return-1;var n=e.startPos[0],i=e.startPos[1],o=e.endPos[0],a=e.endPos[1];return t?o>n&&a<i?1:o<n&&a>i?0:-1:o>n&&a>i?1:o<n&&a<i?0:-1}(t,e.Theme&&e.Theme.decoderState.state.expend);if(o>-1)try{var a=function(e,t,n){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:5;if(!(e&&t&&n&&n.startPos&&n.endPos))return-1;var o=n.startPos[0],a=n.startPos[1],r=n.endPos[0],s=n.endPos[1],c=Math.abs(r-o),l=Math.abs(s-a),d=parseInt((o+r)/2),u=parseInt((a+s)/2),m=Math.round(e*t/(c*l));return{startPointX:parseInt(o/e*256),startPointY:parseInt(a/t*256),endPointX:parseInt(r/e*256),endPointY:parseInt(s/t*256),zoomRate:m>i?i:m,targetCenterX:d,targetCenterY:u,targetWidth:c,targetHeight:l}}(n,i,t,e.capacity&&e.capacity.support_zoomOut_maxTime?e.capacity.support_zoomOut_maxTime:5),r=e.env.domain+"/api/v3/das/device/3d/zoom?accessToken=".concat(e.accessToken||e.token.deviceToken.video,"&deviceSerial=").concat(A(e.url).deviceSerial,"&channelNo=").concat(A(e.url).channelNo,"&command=").concat(0==o?9:8,"&zoomTimes=").concat(a.zoomRate,"&startPointX=").concat(a.startPointX,"&startPointY=").concat(a.startPointY,"&endPointX=").concat(a.endPointX,"&endPointY=").concat(a.endPointY,"&length=").concat(parseInt(i),"&width=").concat(parseInt(n),"&midPointX=").concat(a.targetCenterX,"&midPointY=").concat(a.targetCenterY,"&lengthX=").concat(a.targetWidth,"&lengthY=").concat(a.targetHeight);fetch(r,{method:"POST"}).then((function(e){return e.json()})).then((function(t){200!=t.code&&e.pluginStatus.loadingSetText({text:t.msg,color:"red",delayClear:2e3})})).catch((function(t){e.pluginStatus.loadingSetText({text:e.i18n.t("3D_ZOOM_FAILED"),color:"red",delayClear:2e3})}))}catch(t){e.pluginStatus.loadingSetText({text:e.i18n.t("3D_ZOOM_FAILED"),color:"red",delayClear:2e3})}}));return e.Zoom=new Oe(e),e.eventEmitter&&e.eventEmitter.emit("enable3DZoom",{eventType:"enable3DZoom",code:t,target:e,msg:e.i18n.t("START_3D_ZOOM")}),C(t)?t:new Promise((function(e){e(t)}))}return e.is3DZooming=!1,document.getElementById("".concat(e.id,"-zoom-content"))&&(document.getElementById("".concat(e.id,"-zoom-content")).title=e.i18n.t("ZOOM")),new Promise((function(t,n){e.eventEmitter&&e.eventEmitter.emit("enable3DZoom",{eventType:"enable3DZoom",code:-1,target:e,msg:e.i18n.t("DEVICE_NOT_SUPPORT_3D_ZOOM")}),n({code:-1,msg:e.i18n.t("DEVICE_NOT_SUPPORT_3D_ZOOM")})}))}},{key:"close3DZoom",value:function(){var e=this;if(!e.use3DZoom)return new Promise((function(t,n){e.eventEmitter&&e.eventEmitter.emit("close3DZoom",{eventType:"close3DZoom",code:-1,target:e,msg:e.i18n.t("3D_ZOOM_NOT_ACTIVED")})}));if(e.is3DZooming){e.Theme&&e.Theme.setDecoderState({zoom:!1});var t=e.jSPlugin.JS_Disable3DZoom(0);return e.Zoom=new Oe(e),e.is3DZooming=!1,e.eventEmitter&&e.eventEmitter.emit("close3DZoom",{eventType:"close3DZoom",code:t,target:e,msg:e.i18n.t("CLOSE_3D_ZOOM")}),C(t)?t:new Promise((function(e){e(t)}))}return new Promise((function(t,n){e.eventEmitter&&e.eventEmitter.emit("close3DZoom",{eventType:"close3DZoom",code:-1,target:e,msg:e.i18n.t("3D_ZOOM_CLOSED")}),n({code:-1,msg:e.i18n.t("3D_ZOOM_CLOSED")})}))}},{key:"changeZoomType",value:function(e){var t=this;if(e&&this.capacity&&!this.support3DZoom)return this.eventEmitter&&this.eventEmitter.emit("changeZoomType",{eventType:"changeZoomType",code:-1,target:this,msg:this.i18n.t("DEVICE_NOT_SUPPORT_3D_ZOOM")}),{code:-1,msg:this.i18n.t("DEVICE_NOT_SUPPORT_3D_ZOOM")};this.is3DZooming?this.close3DZoom():this.Theme&&this.Theme.decoderState.state.zoom&&this.Zoom&&this.Zoom.stopZoom(),this.Theme&&this.Theme.setDecoderState({zoom:!1}),this.use3DZoom=e,this.Zoom=new Oe(this),setTimeout((function(){e?document.getElementById("".concat(t.id,"-zoom-content"))&&(document.getElementById("".concat(t.id,"-zoom-content")).title=t.i18n.t("3D_ZOOM")):document.getElementById("".concat(t.id,"-zoom-content"))&&(document.getElementById("".concat(t.id,"-zoom-content")).title=t.i18n.t("ZOOM")),t.isMobile&&e&&t.enable3DZoom(),t.eventEmitter&&t.eventEmitter.emit("changeZoomType",{eventType:"changeZoomType",code:0,target:t,msg:t.i18n.t("CHANGE_ZOOM_TYPE")})}),500)}},{key:"setPoster",value:function(e){Lt()?document.getElementById("".concat(this.id))&&(document.getElementById("".concat(this.id)).style.backgroundImage="url(".concat(e,")"),document.getElementById("".concat(this.id)).style.backgroundSize="100% 100%"):document.getElementById("".concat(this.id,"-player"))&&(document.getElementById("".concat(this.id,"-player")).style.backgroundImage="url(".concat(e,")"),document.getElementById("".concat(this.id,"-player")).style.backgroundSize="cover"),this.eventEmitter&&this.eventEmitter.emit("setPoster",{eventType:"setPoster",code:0,target:this,msg:this.i18n.t("SET_POSTER")})}},{key:"reSize",value:function(e,t){var n,i,o=0;(this.params.height=t,this.params.width=e,this.Theme&&this.Theme.isNeedRenderTimeLine&&!this.isMobile&&document.getElementById("".concat(this.id,"-canvas-container")))&&(o=parseInt(null===(i=document.getElementById("".concat(this.id,"-canvas-container")))||void 0===i?void 0:i.clientHeight,10));if(n=t-o,this._isCurrentBrowserFullscreen||(this.width=e,this.height=t),document.getElementById("".concat(this.id,"-wrap")).style="width:".concat(e,"px;position:relative;display:inline-block;vertical-align: bottom;"),document.getElementById("".concat(this.id)).style.width=e+"px",document.getElementById("".concat(this.id)).style.height=n+"px",this.jSPlugin&&this.jSPlugin.bPlay)this.jSPlugin&&(this.jSPlugin.iHeight=t,this.jSPlugin.iWidth=e);else{var a=1;if(document.getElementById("".concat(this.id,"canvas0")))navigator.userAgent.match(/(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i)&&(a=2),document.getElementById("".concat(this.id,"canvas0")).style.width=e*a+"px",document.getElementById("".concat(this.id,"canvas0")).style.height=t*a+"px",document.getElementById("".concat(this.id,"canvas0")).width=e*a,document.getElementById("".concat(this.id,"canvas0")).height=t*a,document.getElementById("".concat(this.id,"canvas0")).parentNode.style.width=e*a+"px",document.getElementById("".concat(this.id,"canvas0")).parentNode.style.height=t*a+"px",document.getElementById("".concat(this.id,"canvas_draw0")).height=t*a;this.jSPlugin&&(this.jSPlugin.iHeight=t*a,this.jSPlugin.iWidth=e*a)}this.Theme&&this.Theme.Rec&&this.Theme.Rec.recAutoSize&&!this._isCurrentFullscreen&&this.Theme.Rec.recAutoSize(),this.Theme&&this.isInspect&&(document.getElementById("".concat(this.id,"-wrap")).style="width:".concat(e,"px; height:").concat(t,"px;position:relative;display:inline-block;vertical-align: bottom;"),this.width-=this.inspectVideoWidth,this.height-=this.inspectVideoHeight,e=this.width,t=this.height,this.width=e,this.height=t,this.Theme.inspect.reSize(e,t)),this.eventEmitter&&(this.eventEmitter.emit("reSize",{eventType:"reSize",code:0,target:this,msg:this.i18n.t("RESIZE")}),this.eventEmitter.emit("resize",{eventType:"resize",code:0,target:this,msg:this.i18n.t("RESIZE")}))}},{key:"resize",value:function(e,t){this.reSize(e,t)}},{key:"fast",value:function(e){var t=this,n=this.speed;if(e){var i=this.jSPlugin.JS_Speed(e);this.Theme&&(this.Theme.changeRecSpeed(e),this.Theme.nextRate=e)}else{if(1===n)n=2;else{if(2!==n)return console.log("当前已经是最大播放倍数"),"function"==typeof this.params.handleError&&this.params.handleError({msg:this.i18n.t("MAX_SPEED_LIMIT"),retcode:1003,id:this.id,type:"handleError"}),new Promise((function(e,i){t.speed=n,i({code:-1,data:{speed:n,result:t.i18n.t("MAX_SPEED_LIMIT")}})}));n=4}i=this.jSPlugin.JS_Speed(n);this.Theme&&(this.Theme.changeRecSpeed(n),this.Theme.nextRate=n)}return new Promise((function(e){t.speed=n,t.eventEmitter&&t.eventEmitter.emit("fast",{eventType:"fast",code:0,data:n,target:t,msg:t.i18n.t("SPEED")}),e({code:0,data:{speed:n,result:i}})}))}},{key:"slow",value:function(){var e=this,t=this.speed;if(4===t)t=2;else{if(2!==t)return console.log("当前已经是最小播放倍数"),"function"==typeof this.params.handleError&&this.params.handleError({msg:this.i18n.t("MIN_SPEED_LIMIT"),retcode:1003,id:this.id,type:"handleError"}),new Promise((function(n,i){e.speed=t,i({code:-1,data:{speed:t,result:e.i18n.t("MIN_SPEED_LIMIT")}})}));t=1}var n=this.jSPlugin.JS_Speed(t);return new Promise((function(i){e.speed=t,e.eventEmitter&&e.eventEmitter.emit("slow",{eventType:"slow",code:0,data:t,target:e,msg:e.i18n.t("SPEED")}),i({code:0,data:{speed:t,result:n}})}))}},{key:"seek",value:function(e,t){var n=this.url,i=(I("begin",n)||(new Date).Format("yyyyMMdd")).substr(0,8);if(t=o(i,"235959"),6===e.length)e=o(i,e);else{if(16!==e.length)return"function"==typeof this.params.handleError&&(this.eventEmitter&&this.eventEmitter.emit("seek",{eventType:"seek",code:-2,target:this,msg:this.i18n.t("SEEK_TIMEFORMAT_ERROR")}),this.params.handleError({msg:this.i18n.t("SEEK_TIMEFORMAT_ERROR"),retcode:-1,id:this.id,type:"handleError"})),!1;if(e.substr(0,8)!==i)return"function"==typeof this.params.handleError&&(this.eventEmitter&&this.eventEmitter.emit("seek",{eventType:"seek",code:-1,target:this,msg:this.i18n.t("SEEK_CANNOT_CROSS_DAYS")}),this.params.handleError({msg:this.i18n.t("SEEK_CANNOT_CROSS_DAYS"),retcode:-1,id:this.id,type:"handleError"})),!1}function o(e,t){if(/^[0-9]{8}T[0-9]{6}Z$/.test(e))return e;if(/[0-9]{8,14}/.test(e)){var n=6-(14-e.length),i=t.length,o=e+t.substring(n,i);return o.slice(0,8)+"T"+o.slice(8)+"Z"}throw new Error(this.i18n.t("TIMEFORMAT_ERROR"))}var a=this.jSPlugin.JS_Seek(0,e,t);return C(a)?a:new Promise((function(e){e(a)}))}},{key:"fullScreen",value:function(){this.fullscreen()}},{key:"fullscreen",value:function(){var e=this;return this._isCurrentFullscreen?Promise.resolve():(this._isCurrentFullscreen=!0,this._isCurrentBrowserFullscreen?Promise.resolve().then((function(){e._isCurrentBrowserFullscreen&&e._fullscreenChangeEvent({target:document.getElementById("".concat(e.id,"-wrap"))})})):this.browserFullscreen())}},{key:"_fullscreenChangeEvent",value:function(e){var t=document.getElementById("".concat(this.id,"-wrap"));if(this._isCurrentBrowserFullscreen=n.element===t,e.target===t){var i,o;if(this._isCurrentBrowserFullscreen)t.classList.add("ezuikit-player-wrap-web-fullscreen"),this._isCurrentFullscreen&&t.classList.add("ezuikit-player-wrap-fullscreen"),this.resize(window.screen.width||window.screen.availWidth,window.screen.height||window.screen.availHeight),null===(o=this.eventEmitter)||void 0===o||o.emit("fullscreen"),this.eventEmitter&&this.eventEmitter.emit(this._isCurrentFullscreen?"fullscreen":"browserFullscreen",{eventType:this._isCurrentFullscreen?"fullscreen":"browserFullscreen",code:0,target:this,msg:this._isCurrentFullscreen?this.i18n.t("FULLSCREEN_EXIT"):this.i18n.t("WEB_FULLSCREEN")});else t.classList.remove("ezuikit-player-wrap-web-fullscreen","ezuikit-player-wrap-fullscreen"),this._isCurrentFullscreen=!1,this.resize(this.width,this.height),this.eventEmitter&&this.eventEmitter.emit("exitFullscreen",{eventType:"exitFullscreen",code:0,target:this,msg:this.i18n.t("WEB_FULLSCREEN_EXIT")});null===(i=this.eventEmitter)||void 0===i||i.emit("fullscreenChange",{eventType:"fullscreenChange",code:0,target:this,data:{isCurrentFullscreen:this._isCurrentFullscreen,isCurrentBrowserFullscreen:this._isCurrentBrowserFullscreen}})}}},{key:"cancelFullScreen",value:function(){this.exitFullscreen()}},{key:"exitFullscreen",value:function(){return n.isEnabled?n.exit():Promise.resolve()}},{key:"startTalk",value:function(){this.Talk.startTalk()}},{key:"stopTalk",value:function(){this.Talk.stopTalk(),this.Theme&&this.Theme.decoderState.state.talk&&this.Theme.setDecoderState({talk:!1});var e=re.getGlobalState(),t=re.getInstance(this.id);e.talk&&re.setGlobalState({talk:!1}),t.getState().talk&&t.setState({talk:!1})}},{key:"setVolumeGain",value:function(e){return this.Talk.setVolumeGain(e)}},{key:"getMicrophonePermission",value:function(){return this.Talk.getMicrophonePermission()}},{key:"getMicrophonesList",value:function(){return this.Talk.getMicrophonesList()}},{key:"setProfile",value:function(e){this.Talk.setProfile(e)}},{key:"destroy",value:function(){this._destroy=!0;var e=re.getInstance(this.id);e&&(e.getState().sound&&this.closeSound(),e.getState().talk&&(this.stopTalk(),e.setState({talk:!1}),re.setGlobalState({talk:!1}))),n.isEnabled&&(n.off("change",this._fullscreenChangeEvent),this._fullscreenChangeEvent=null);var t=document.getElementById("".concat(this.id,"-wrap"));if(this._resizeObserver&&t){try{this._resizeObserver.unobserve(t)}catch(e){}this._resizeObserver=null}this.Theme&&(this.Theme.decoderState.state.play&&this.stop(),"function"==typeof this.Theme.destroy&&this.Theme.destroy(),this.Theme=null,window.EZUIKit[this.params.id].state.EZUIKitPlayer.themeInit=!1),this.pluginStatus&&"function"==typeof this.pluginStatus.destroy&&this.pluginStatus.destroy(),this.Talk&&"function"==typeof this.Talk.destroy&&this.Talk.destroy(),window.recTimer&&Array.isArray(window.recTimer)&&(window.recTimer[this.id].map((function(e){clearInterval(e)})),window.recTimer[this.id]=[]),this.recTimer&&clearInterval(this.recTimer),this._abortFetch();var o=this.jSPlugin.JS_DestroyWorker(0);if(re&&this.id&&re.removeInstance(this.id),re&&0===re.listInstances().length){if(i._STYLE){var a=document.getElementById(i._STYLE.id);a&&document.getElementsByTagName("head")[0].removeChild(a),i._STYLE=null}if(U._STYLE){var r=document.getElementById(U._STYLE.id);r&&document.getElementsByTagName("head")[0].removeChild(r),U._STYLE=null}if(V._STYLE){var s=document.getElementById(V._STYLE.id);s&&document.getElementsByTagName("head")[0].removeChild(s),V._STYLE=null}if(H._STYLE){var c=document.getElementById(H._STYLE.id);c&&document.getElementsByTagName("head")[0].removeChild(c),H._STYLE=null}if(ce._STYLE){var l=document.getElementById(ce._STYLE.id);l&&document.getElementsByTagName("head")[0].removeChild(l),ce._STYLE=null}}return this.eventEmitter&&this.eventEmitter.emit("destroy",{eventType:"destroy",code:0,target:this,msg:this.i18n.t("DESTROY")}),this.jSPlugin=null,document.getElementById("".concat(this.id,"-wrap"))&&this.initDOM&&(document.getElementById("".concat(this.id,"-wrap")).parentNode.appendChild(this.initDOM),document.getElementById("".concat(this.id,"-wrap")).parentNode.removeChild(document.getElementById("".concat(this.id,"-wrap"))),delete this.initDOM),C(o)?o:new Promise((function(e){e(o)}))}},{key:"getDeviceCapacity",value:function(e){var t=this,n=this.env.domain;this.capacity={},this.env&&(n=this.env.domain);var i=n+"/api/lapp/device/capacity",o=e||{accessToken:this.accessToken||this.token.deviceToken.video,deviceSerial:A(this.url).deviceSerial};R(i,"POST",o,"",(function(e){if(t.support3DZoom=!1,document.getElementById("".concat(t.id,"-zoom-content"))&&(document.getElementById("".concat(t.id,"-zoom-content")).title=t.i18n.t("ZOOM")),200==e.code&&e.data){if(t.capacity=e.data,t.isMobile&&t.isCall&&(!t.capacity.support_doorcall_playback||1!=t.capacity.support_doorcall_playback)){if(t.isWebConsole)return;setTimeout((function(){document.getElementById("".concat(t.jSPlugin.id,"-wrap"))&&document.getElementById("miniRecbox")&&(document.getElementById("".concat(t.jSPlugin.id,"-wrap")).removeChild(document.getElementById("miniClose")),document.getElementById("".concat(t.jSPlugin.id,"-wrap")).removeChild(document.getElementById("miniRecbox")))}),1500)}t.capacity&&"1"==t.capacity.support_3d_position&&t.url.indexOf(".live")>-1&&(t.support3DZoom=!0,t.params.use3DZoom&&(t.use3DZoom=!0,document.getElementById("".concat(t.id,"-zoom-content"))&&(document.getElementById("".concat(t.id,"-zoom-content")).title=t.i18n.t("3D_ZOOM")))),t.eventEmitter&&t.eventEmitter.emit("getDeviceCapacity",{eventType:"getDeviceCapacity",code:0,data:e,target:t,msg:t.i18n.t("GET_CAPACITY")})}}))}},{key:"pause",value:function(e){var t=this;return new Promise((function(n,i){t.jSPlugin.JS_CloseSound(0),t.jSPlugin.JS_Pause(0,e).then((function(e){t.eventEmitter&&t.eventEmitter.emit("pause",{eventType:"pause",code:0,target:t,msg:t.i18n.t("PAUSE")}),t.Theme&&t.Theme.setDecoderState({play:!1,pauseDate:e.pauseDate}),n()})).catch((function(e){t.eventEmitter&&t.eventEmitter.emit("pause",{eventType:"pause",code:-1,target:t,msg:e||t.i18n.t("PAUSE_FAILED")}),i(e)}))}))}},{key:"_resume",value:function(e){var t=this;return new Promise((function(n,i){t.pluginStatus.setPlayStatus({play:!1,loading:!0}),t.validateCode&&""!=t.validateCode&&t.jSPlugin.JS_SetSecretKey(0,t.validateCode),t.jSPlugin.JS_Resume(e).then((function(e){setTimeout((function(){-1!==t.url.indexOf(".rec")&&1!=t.speed&&t.jSPlugin.JS_Speed(t.speed)}),500),t.Theme&&(t.Theme.setDecoderState({play:!0}),t.fast(t.speed));var i=re.getGlobalState();re.getInstance(t.id).getState().sound&&!1===i.sound&&setTimeout((function(){t.openSound()}),500),t.eventEmitter&&t.eventEmitter.emit("resume",{eventType:"resume",code:0,target:t,msg:t.i18n.t("RESUME")}),n(e)})).catch((function(e){t.eventEmitter&&t.eventEmitter.emit("resume",{eventType:"resume",code:-1,target:t,msg:e||t.i18n.t("RESUME_FAILED")}),i(e)}))}))}},{key:"getVideoLevelList",value:function(){return this.eventEmitter&&this.eventEmitter.emit("getVideoLevelList",{eventType:"getVideoLevelList",code:0,data:this.videoLevelList,target:this,msg:this.i18n.t("GET_VIDEO_LEVEL_LIST")}),this.videoLevelList}},{key:"getVideoLevel",value:function(){return this.eventEmitter&&this.eventEmitter.emit("getVideoLevel",{eventType:"getVideoLevel",code:0,data:this.videoLevel,target:this,msg:this.i18n.t("GET_VIDEO_LEVEL_LIST")}),this.videoLevel}},{key:"getPtzStatus",value:function(){if(this.Theme)return this.eventEmitter&&this.eventEmitter.emit("getPtzStatus",{eventType:"getPtzStatus",code:0,data:!!this.Theme&&this.Theme.Ptz.showPtz,target:this,msg:this.i18n.t("GET_PTZ_STATUS")}),this.Theme.Ptz.showPtz;this.eventEmitter&&this.eventEmitter.emit("getPtzStatus",{eventType:"getPtzStatus",code:-1,data:!!this.Theme&&this.Theme.Ptz.showPtz,target:this,msg:this.i18n.t("GET_PTZ_STATUS_FAILED")})}},{key:"openPtz",value:function(){return this.Theme?this.isMobile&&this.Theme&&!this.Theme.decoderState.state.expend?(this.eventEmitter&&this.eventEmitter.emit("openPtz",{eventType:"openPtz",code:-1,target:this,msg:this.i18n.t("MOBILE_HIDE_PTZ")}),!1):(this.Theme.setDecoderState({pantile:!0}),void this.Theme.Ptz.show()):(this.eventEmitter&&this.eventEmitter.emit("openPtz",{eventType:"openPtz",code:-1,target:this,msg:this.i18n.t("OPTION_PTZ_FAILED")}),{code:-1,msg:this.i18n.t("OPTION_PTZ_FAILED")})}},{key:"closePtz",value:function(){if(!this.Theme)return this.eventEmitter&&this.eventEmitter.emit("closePtz",{eventType:"closePtz",code:-1,target:this,msg:this.i18n.t("OPTION_PTZ_FAILED")}),{code:-1,msg:this.i18n.t("OPTION_PTZ_FAILED")};this.Theme.setDecoderState({pantile:!1}),this.Theme.Ptz.hide()}},{key:"isCurrentBrowserFullscreen",get:function(){return this._isCurrentBrowserFullscreen}},{key:"browserFullscreen",value:function(){var e=document.getElementById("".concat(this.id,"-wrap"));return e&&n.isEnabled?n.request(e):Promise.resolve()}},{key:"exitBrowserFullscreen",value:function(){return this.exitFullscreen()}},{key:"getPlayRate",value:function(){return this.eventEmitter&&this.eventEmitter.emit("getPlayRate",{eventType:"getPlayRate",code:0,data:this.speed,target:this,msg:this.i18n.t("GET_SPEED")}),this.speed}},{key:"setMirrorFlip",value:function(e){return"number"!=typeof e?(this.eventEmitter&&this.eventEmitter.emit("setMirrorFlip",{eventType:"setMirrorFlip",code:-1,target:this,msg:this.i18n.t("MIRROR_TYPE_ERROR")}),Promise.reject({code:-1,msg:this.i18n.t("MIRROR_TYPE_ERROR")})):(this.eventEmitter&&this.eventEmitter.emit("setMirrorFlip",{eventType:"setMirrorFlip",code:0,target:this,msg:this.i18n.t("MIRROR")}),function(e,t,n,i){return new Promise((function(o,a){R("".concat(e.env.domain,"/api/lapp/device/ptz/mirror"),"POST",{accessToken:e.accessToken||e.token.deviceToken.video,deviceSerial:t,channelNo:n,command:i},"",o)}))}(this,this.deviceSerial,this.channelNo,e))}},{key:"setFECCorrectType",value:function(e,t){var n=this;if(!this.capacity||this.capacity&&"1"!==this.capacity.support_fisheye_mode)return this.eventEmitter&&this.eventEmitter.emit("setFECCorrectType",{eventType:"setFECCorrectType",code:-1,target:this,msg:this.i18n.t("FEC.DEVICE_NOT_SUPPORT")}),Promise.reject({code:-1,msg:this.i18n.t("FEC.DEVICE_NOT_SUPPORT")});if(!window.SharedArrayBuffer||(this.jSPlugin.isHardH264||this.jSPlugin.isHardH265)&&this.jSPlugin.useHardDev)return this.eventEmitter&&this.eventEmitter.emit("setFECCorrectType",{eventType:"setFECCorrectType",code:-1,target:this,msg:this.i18n.t("FEC.FEC_SUPPORT_VERSION")}),Promise.reject({code:-1,msg:this.i18n.t("FEC.FEC_SUPPORT_VERSION")});var i=(1===e.place?X:3===e.place?Y:[]).find((function(t){return t.type===e.type&&t.place===e.place}));return i?i.split>0&&void 0===b(t)?(this.eventEmitter&&this.eventEmitter.emit("setFECCorrectType",{eventType:"setFECCorrectType",code:-1,target:this,msg:this.i18n.t("FEC.NO_CANVAS_ID")}),Promise.reject({code:-1,msg:this.i18n.t("FEC.NO_CANVAS_ID")})):(this.jSPlugin.FECSplitIds=t,this.jSPlugin.correctType=i,this._FECCorrectType=i,this._FECSplitIds=t,this.stop().then((function(){return n.play().then((function(e){return 1===i.place&&0===i.correctType||3===i.place&&0===i.correctType?n.Theme.resumeFECBtn():n.Theme.disabledFECBtn(),n.eventEmitter&&n.eventEmitter.emit("setFECCorrectType",{eventType:"setFECCorrectType",code:0,target:n,msg:n.i18n.t("FEC.CHANGE_FEC_TYPE")}),e}))}))):(this.eventEmitter&&this.eventEmitter.emit("setFECCorrectType",{eventType:"setFECCorrectType",code:-1,target:this,msg:this.i18n.t("FEC.TYPE_NOT_SUPPORT")}),Promise.reject({code:-1,msg:this.i18n.t("FEC.TYPE_NOT_SUPPORT")}))}},{key:"setFEC3DViewParam",value:function(e){return!this._FECCorrectType||(this.jSPlugin.isHardH264||this.jSPlugin.isHardH265)&&this.jSPlugin.useHardDev?(this.eventEmitter&&this.eventEmitter.emit("setFEC3DViewParam",{eventType:"setFEC3DViewParam",code:-1,target:this,msg:this.i18n.t("FEC.FEC_SUPPORT_VERSION")}),Promise.reject({code:-1,msg:this.i18n.t("FEC.FEC_SUPPORT_VERSION")})):this.jSPlugin.FEC_Set3DViewParam&&this._FECCorrectType&&(3===this._FECCorrectType.place&&this._FECCorrectType.correctType===K||1===this._FECCorrectType.place&&this._FECCorrectType.correctType===J)?(this.eventEmitter&&this.eventEmitter.emit("setFEC3DViewParam",{eventType:"setFEC3DViewParam",code:0,target:this,msg:this.i18n.t("FEC.SET_FEC_PARAMS")}),this.jSPlugin.FEC_Set3DViewParam(e)):(this.eventEmitter&&this.eventEmitter.emit("setFEC3DViewParam",{eventType:"setFEC3DViewParam",code:-1,target:this,msg:this.i18n.t("FEC.SET_FEC_PARAMS_FAILED")}),Promise.reject({code:-1,msg:this.i18n.t("FEC.SET_FEC_PARAMS_FAILED")}))}},{key:"getFEC3DViewParam",value:function(e){return!this._FECCorrectType||(this.jSPlugin.isHardH264||this.jSPlugin.isHardH265)&&this.jSPlugin.useHardDev?(this.eventEmitter&&this.eventEmitter.emit("getFEC3DViewParam",{eventType:"getFEC3DViewParam",code:-1,target:this,msg:this.i18n.t("FEC.GET_FEC_PARAMS_SUPPORT_VERSION")}),Promise.reject({code:-1,msg:this.i18n.t("FEC.GET_FEC_PARAMS_SUPPORT_VERSION")})):this.jSPlugin.FEC_Set3DViewParam&&this._FECCorrectType&&(3===this._FECCorrectType.place&&this._FECCorrectType.correctType===K||1===this._FECCorrectType.place&&this._FECCorrectType.correctType===J)?(this.eventEmitter&&this.eventEmitter.emit("getFEC3DViewParam",{eventType:"getFEC3DViewParam",code:0,target:this,data:this.jSPlugin.FEC_Get3DViewParam(e),msg:this.i18n.t("FEC.SET_FEC_PARAMS")}),this.jSPlugin.FEC_Get3DViewParam(e)):(this.eventEmitter&&this.eventEmitter.emit("getFEC3DViewParam",{eventType:"getFEC3DViewParam",code:-1,target:this,msg:this.i18n.t("FEC.SET_FEC_PARAMS_FAILED")}),Promise.reject({code:-1,msg:this.i18n.t("FEC.SET_FEC_PARAMS_FAILED")}))}},{key:"setWaterMarkFont",value:function(e){return this.eventEmitter&&this.eventEmitter.emit("setWaterMarkFont",{eventType:"setWaterMarkFont",code:0,target:this,msg:this.i18n.t("SET_WATERMARK")}),this.waterMark_JSPlugin=e,this.jSPlugin.JS_SetWaterMarkFont(e)}},{key:"changeTheme",value:function(e){this.Theme&&this.Theme.changeTheme(e)}},{key:"_abortFetch",value:function(){this._controllers.forEach((function(e){e.abort()})),this._controllers=[]}},{key:"isCurrentFullscreen",get:function(){return this._isCurrentFullscreen}},{key:"_$containerResizeEvent",value:function(){try{var e=document.getElementById("".concat(this.id,"-wrap"));this._resizeObserver=new ResizeObserver((function(e){var t,n=h(e);try{for(n.s();!(t=n.n()).done;){var i=t.value,o=i.contentRect;o.left,o.top,o.width,o.height;i.target}}catch(e){n.e(e)}finally{n.f()}})),e&&this._resizeObserver.observe(e)}catch(e){}}}],[{key:"_instanceStyle",value:function(){i._STYLE||(i._STYLE=document.createElement("style"),i._STYLE.id="ezuikit-player-wrap-fullscreen",i._STYLE.innerHTML="\n .ezuikit-player-wrap-web-fullscreen {}\n .ezuikit-player-wrap-fullscreen .header-controls{ display: none!important}\n .ezuikit-player-wrap-fullscreen .ez-iframe-footer-container { display: none!important}\n .ezuikit-player-wrap-fullscreen .ezuikit-time-line-control{ display: none!important}\n .ezuikit-player-wrap-fullscreen .timeline-controls{ display: none!important}\n ",document.getElementsByTagName("head")[0].appendChild(i._STYLE))}}])}();p(zt,"_STYLE",void 0),p(zt,"LOCALES",{zh:de,en:ue}),zt.prototype.tokenSchema={streamToken:{live:{actionType:"PREVIEW",resourceCategory:"global"},rec:{actionType:"PLAYBACK",resourceCategory:"global"},talk:{actionType:"TALK",resourceCategory:"global"}},deviceToken:{video:{action:"*",resourceCategory:"video"},global:{action:"*",resourceCategory:"global"}},httpToken:{url:{urlPattern:"/**"}}},zt.prototype.deepCheck=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;if(n<0)return{};var i={};for(var o in e)if(void 0!==e[o]&&void 0===t[o])i[o]=e[o];else if("object"===b(e[o])&&!Array.isArray(e[o])){var a=zt.prototype.deepCheck(e[o],t[o],n-1);Object.keys(a).length>0&&(i[o]=a)}return i},zt.prototype.checkToken=function(e){return zt.prototype.deepCheck(zt.prototype.tokenSchema,e)};var Nt=null;function Ft(e){e.responseMsg.eventName,console.log(e.responseMsg)}function Ut(){Nt.JS_SetWindowControlCallback({cbIntegrationCallBack:Ft}),Nt.JS_StartService("window",{dllPath:"./chain/cloudTransform.dll"}).then((function(){Nt.JS_CreateWnd("playWnd",900,500).then((function(){console.log("JS_CreateWnd success")}))}))}function Vt(){console.log("cbConnectError"),Nt=null,console.error("确认本地进程是否已安装并开启成功!")}function Ht(e){console.log("cbConnectClose"),Nt=null}var Gt=new WeakSet,Zt=function(){return m((function e(t){var n=this;l(this,e),d(this,Gt),p(this,"changeModel",(function(e,t){var i=n;n.switchVideo=parseInt(e),Nt&&Nt.JS_RequestInterface({funcName:"ChangeModel",arguments:encodeURI(JSON.stringify({model:e}))}).then((function(n){0==e?i.play({deviceSerial:t.deviceSerial,channelNo:t.channelNo,validateCode:t.validateCode}):i.play({deviceSerial:t.deviceSerial,channelNo:t.channelNo,validateCode:t.validateCode,startTime:t.startTime,endTime:t.endTime})}))})),p(this,"init",(function(e){var t=n;if(e.appKey&&e.accessToken){void 0!==e.appKey&&(n.appKey=e.appKey),void 0!==e.accessToken&&(n.accessToken=e.accessToken),void 0!==e.platformId&&(n.platformId=e.platformId);var i=p(p(p(p(p(p(p(p({layout:+t.layout,userName:"",waterMark:""},"waterMark","1"),"iWndType",0),"intelligenceEnable",1),"isRecord",1),"isSetPos",1),"motionDetectEnable",0),"playBackAlarmOverlyingEnable",0),"response",{code:0,message:null,data:{appKey:e.appKey,ezvizToken:e.accessToken,videoLevel:0,logLevel:3,showMainTool:1,showSubTool:1,waterMark:"1",userName:"openteam",platformId:e.platformId}});console.log("初始化入参",i),window.ezuikitMonitor.report({protocol:"hd",appKey:e.appKey,action:1,logInfo:{argumentsPram:i}}),Nt.JS_RequestInterface({funcName:"Init",arguments:encodeURI(JSON.stringify(i))}).then((function(e){console.log(e.responseMsg),t.showTips(!0,"视频初始化成功!")}))}else t.showTips(!1,"请输入appkey和token")})),p(this,"play",(function(e){var t=n;if(e.deviceSerial&&e.channelNo){void 0!==e.deviceSerial&&(n.deviceSerial=e.deviceSerial),void 0!==e.channelNo&&(n.channelNo=e.channelNo),void 0!==e.startTime&&e.startTime&&(n.startTime=e.startTime+" 00:00:00"),void 0!==e.endTime&&e.endTime&&(n.endTime=e.endTime+" 23:59:59"),void 0!==e.validateCode&&e.validateCode&&(n.validateCode=e.validateCode);var i={response:{code:0,message:null,data:{deviceSerial:e.deviceSerial,channelCode:e.channelNo,channelNo:+e.channelNo,codeIsEncrypt:0,validateCode:e.validateCode,deviceClass:t.deviceClass,deviceType:"10222",channelId:"2222222222",channelName:"channelNameTest",storeName:"storeName",storeId:"storeid",startTime:n.startTime,endTime:n.endTime}}};"1"===t.deviceClass?(i.response.data.channelCode=t.channelNo,i.response.data.platformId=t.platformId):i.response.data.channelNo=+t.channelNo,1===n.switchVideo&&(n.startTime&&(i.response.data.startTime=n.startTime),n.endTime&&(i.response.data.endTime=n.endTime)),console.log("预览/回放入参",i),Nt.JS_RequestInterface({funcName:0===n.switchVideo?"StartPreview":"StartPlayback",arguments:encodeURI(JSON.stringify(i))}).then((function(e){console.log(e.responseMsg),t.showTips(!0,"预览/回放成功!")})).catch((function(e){console.log("开始播放:",e)}))}})),p(this,"showCBInfo",(function(e){n.callbackMessage=n.callbackMessage+JSON.stringify(e)+"\n\n",console.log(n.callbackMessage)})),p(this,"showTips",(function(e,t){})),p(this,"hideVideo",(function(){Nt.JS_HideWnd()})),p(this,"showVideo",(function(){Nt.JS_ShowWnd()})),p(this,"GetLayout",(function(){Nt.JS_RequestInterface({funcName:"GetLayout",arguments:encodeURI(JSON.stringify({response:{code:0,message:null,data:null}}))}).then((function(e){console.log(JSON.stringify(e.responseMsg)),console.log(e.responseMsg)}))})),p(this,"capturePicture",(function(e){Nt.JS_RequestInterface({funcName:"CaptureJPGEx",arguments:encodeURI(JSON.stringify({response:{code:0,message:null,data:null}}))}).then((function(e){console.log(JSON.stringify(e.responseMsg)),console.log(e.responseMsg)}))})),p(this,"stop",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:-1;Nt.JS_RequestInterface({funcName:"StopPlay",arguments:encodeURI(JSON.stringify({response:{code:0,message:null,data:{wndId:parseInt(e)}}}))}).then((function(e){console.log(JSON.stringify(e.responseMsg)),console.log(e.responseMsg)}))})),p(this,"setLayout",(function(e){var t=parseInt(e);isNaN(t)||0==t||t>=13?console.log("不支持实际布局大于16的窗口数"):(n.layout=t,Nt.JS_RequestInterface({funcName:"SetLayout",arguments:encodeURI(JSON.stringify({response:{code:0,message:null,data:{layout:t}}}))}).then((function(e){console.log(JSON.stringify(e.responseMsg)),console.log(e.responseMsg)})))})),p(this,"setSoundVolumn",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:-1,t=arguments.length>1?arguments[1]:void 0;Nt.JS_RequestInterface({funcName:"SoundVolumn",arguments:encodeURI(JSON.stringify({response:{code:0,message:null,data:{wndId:parseInt(e),volumn:parseInt(t)}}}))}).then((function(e){console.log(JSON.stringify(e.responseMsg)),console.log(e.responseMsg)}))})),p(this,"testMute",(function(){var e=parseInt(prompt("请输入窗口ID"));Nt.JS_RequestInterface({funcName:"MuteOnOff",arguments:encodeURI(JSON.stringify({response:{code:0,message:null,data:{wndId:e}}}))}).then((function(e){console.log(JSON.stringify(e.responseMsg)),console.log(e.responseMsg)}))})),p(this,"testSelectWnd",(function(){var e=parseInt(prompt("请输入窗口ID"));Nt.JS_RequestInterface({funcName:"SelectPlayWnd",arguments:encodeURI(JSON.stringify({response:{code:0,message:null,data:{wndId:e}}}))}).then((function(e){console.log(JSON.stringify(e.responseMsg)),console.log(e.responseMsg)}))})),p(this,"setVideoLevel",(function(e,t){Nt.JS_RequestInterface({funcName:"SetVideoLevel",arguments:encodeURI(JSON.stringify({response:{code:0,message:null,data:{wndId:1==n.switchVideo?0:parseInt(e),level:parseInt(t,10)}}}))}).then((function(e){console.log(JSON.stringify(e.responseMsg)),console.log(e.responseMsg)}))})),p(this,"startTalk",(function(e){Nt.JS_RequestInterface({funcName:"StartTalk",arguments:encodeURI(JSON.stringify({response:{code:0,message:null,data:{wndId:parseInt(e)}}}))}).then((function(e){console.log(JSON.stringify(e.responseMsg)),console.log(e.responseMsg)}))})),p(this,"stopTalk",(function(e){Nt.JS_RequestInterface({funcName:"StopTalk",arguments:encodeURI(JSON.stringify({response:{code:0,message:null,data:{wndId:parseInt(e)}}}))}).then((function(e){console.log(JSON.stringify(e.responseMsg)),console.log(e.responseMsg)}))})),p(this,"startSave",(function(e){Nt.JS_RequestInterface({funcName:"StartRecord",arguments:encodeURI(JSON.stringify({response:{code:0,message:null,data:{wndId:parseInt(e)}}}))}).then((function(e){console.log(JSON.stringify(e.responseMsg)),console.log(e.responseMsg)}))})),p(this,"stopSave",(function(e){Nt.JS_RequestInterface({funcName:"StopRecord",arguments:encodeURI(JSON.stringify({response:{code:0,message:null,data:{wndId:parseInt(e)}}}))}).then((function(e){console.log(JSON.stringify(e.responseMsg)),console.log(e.responseMsg)}))})),this.appKey="b9a3ad6e8026410095d8252169fa430a",this.accessToken="at.2vtum8873rrcwbrv431qb6pn94dkbv23-8dw2twn355-1u3x014-wrthellzk",this.deviceSerial="C33368372",this.channelNo="1",this.validateCode="",this.deviceClass="0",this.platformId="",this.startTime="",this.endTime="",this.layout=2,this.switchVideo=0,this.tips="调用成功",this.successTip=!1,this.tipsShow=!1,Nt=function(e,t,n,i){return new WebControl({szPluginContainer:e,iServicePortStart:14510,iServicePortEnd:14519,cbConnectSuccess:t,cbConnectError:n,cbConnectClose:i})}("playWnd",Ut,Vt,Ht),function(e,t,n){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:n;throw new TypeError("Private element is not present on this object")}(Gt,this,Wt).call(this)}),[{key:"alarmMsg",value:function(){var e={request:{body:{alarmTypes:[10800,0,0,0,0],channelId:"066dde0465dd4abaab6afe355baf9d0b",endTime:"1621007999000",startTime:"1620921600000"},callBack:"GetAlarmMsgOrders",majorKey:"",method:"POST",storeId:"",url:"/videoplugin/message/getMessageByTypes"},response:{code:0,message:null,data:[{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620921217e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620920678e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620920586e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620919513e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620919483e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620919333e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620918913e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620918616e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620918305e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620917858e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620917658e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620917244e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620917064e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620916994e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620916668e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620916571e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620916529e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620916343e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620916081e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620915825e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620915676e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620915531e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620915394e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620915197e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620914971e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620914644e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620914533e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620914457e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620914376e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620914284e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620913973e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620913431e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620912834e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620912771e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620912354e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620912275e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620912093e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620912024e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:162091189e4},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620911839e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620911807e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:162091176e4},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620911682e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:162091127e4},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620911184e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620910982e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620910931e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620910851e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620910781e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620910727e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620910677e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620910647e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620910588e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620910544e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620910484e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:162091041e4},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:162091035e4},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620910278e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620910217e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620910124e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620909976e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620909939e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620909847e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620909817e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620909736e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620909664e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620909605e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620909575e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620909346e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620909247e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620909216e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620909149e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:162090912e4},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620909028e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620908999e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620908969e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620908909e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:162090888e4},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620908835e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:162090875e4},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:162090872e4},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620908652e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620908612e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620908582e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620908552e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620908456e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620908426e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620908299e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620908268e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:162090805e4},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620907918e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620907758e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620907625e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620907386e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620907292e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620907127e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620906864e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620906828e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620906797e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620906747e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620906717e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620906632e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620906501e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620906412e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620906368e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620906329e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620906142e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620906112e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620906013e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620905946e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620905823e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620905697e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620905622e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620905571e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620905541e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620905511e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620905481e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620905442e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620905412e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620905382e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620905352e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620905322e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620905262e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620905196e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:162090515e4},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620904994e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620904931e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620904813e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:162090473e4},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:16209047e5},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620904618e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620904286e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620904173e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620904143e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620904112e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620904053e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620904023e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620903854e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620903789e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620903723e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620903643e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620903612e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620903573e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620903505e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620903383e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620903329e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620903299e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620903268e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:16209032e5},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620903149e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:162090312e4},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620902977e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:162090286e4},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:162090277e4},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620902639e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620902609e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620902517e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620902373e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:162090232e4},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620902253e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620902198e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620902132e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:162090194e4},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:162090185e4},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620901789e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620901746e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620901685e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620901638e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:162090152e4},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620901489e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620901424e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620901271e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620901233e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620901157e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620900915e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620900834e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620900774e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620900744e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:162090065e4},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:162090044e4},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620900409e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620900175e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620900134e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620900069e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620900016e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620899976e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620899908e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620899879e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620899826e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620899756e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620899599e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620899559e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620899467e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620899406e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620899265e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620899211e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:162089914e4},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:162089911e4},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:162089905e4},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620898991e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620898926e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620898834e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620898785e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620898746e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620898697e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620898666e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620898507e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620898293e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620898248e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620898218e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620898157e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620898088e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:162089802e4},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:162089796e4},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:162089785e4},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620897807e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620897771e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620897719e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:162089769e4},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:162089763e4},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:16208976e5},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:162089757e4},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:162089754e4},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620897475e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620897412e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620897369e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620897339e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620897279e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620897237e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620897207e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620897172e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620897142e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620897112e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620897024e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620896985e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620896874e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620896843e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620896814e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620896783e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620896736e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620896621e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620896478e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620896447e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620896358e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620896307e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620896277e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620896247e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620896214e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:162089604e4},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620895953e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620895921e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620895868e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:162089577e4},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620895704e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:162089559e4},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620895559e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:162089548e4},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620895442e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620895377e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620895347e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620895293e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620895171e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620895136e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620895017e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620894926e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620894896e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620894864e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620894834e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620894738e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620894599e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620894539e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620894426e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620894359e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620894297e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620894213e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620894183e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620894051e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620893964e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620893934e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620893843e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620893754e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620893676e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620893606e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:162089353e4},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620893452e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620893423e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620893357e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620893288e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620893143e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620893051e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620893006e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620892904e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620892824e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620892764e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620892541e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620892479e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620892412e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620892311e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620892281e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620892209e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620892063e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620891991e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620891931e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:162089187e4},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:162089181e4},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620891708e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620891655e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620891585e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620891531e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620891501e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620891401e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620891297e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620891257e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620891216e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620891178e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620891128e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620891033e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620890973e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:162089094e4},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620890879e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620890794e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620890714e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620890616e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620890586e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620890469e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620890414e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620890346e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620890288e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620890179e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620890108e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620890041e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620890011e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620889937e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620889719e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620889635e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620889481e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620889451e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620889317e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620889227e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620889139e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620889034e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620888973e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620888902e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620888837e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620888767e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620888737e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620888706e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620888633e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620888571e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620888413e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620888353e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620888323e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620888249e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620888162e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620888e6},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620887859e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620887776e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620887734e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620887692e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620887619e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620887501e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620887355e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:162088732e4},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620887289e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620887126e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620887066e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620887034e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:162088697e4},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620886884e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620886804e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620886728e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620886609e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620886538e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620886478e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620886396e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620886334e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620886246e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620886111e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620886011e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620885956e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620885894e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620885696e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620885514e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620885484e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620885414e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620885383e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620885341e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620885306e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620885276e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620885216e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620885186e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620885114e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620885037e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620885006e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620884975e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620884945e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620884911e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620884851e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:162088478e4},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620884696e3}],success:!0}};console.log(e),Nt.JS_RequestInterface({funcName:"TransFunctionResult",arguments:encodeURI(JSON.stringify(e))})}}])}();function Wt(){window.onscroll=function(){null!=Nt&&Nt.JS_Resize(900,500)},window.onresize=function(){null!=Nt&&Nt.JS_Resize(900,500)},window.onunload=function(){try{Nt.JS_HideWnd(),null!=Nt&&(Nt.JS_DestroyWnd().then((function(){console.log("JS_DestroyWnd")}),(function(){})),Nt.JS_StopService("window").then((function(){Nt.JS_Disconnect().then((function(){console.log("JS_Disconnect")}),(function(){}))})))}catch(e){console.error(e)}},window.onpagehide=function(){try{Nt.JS_HideWnd()}catch(e){console.error(e)}}}
|
|
39
|
+
Se.sessions={},Se.isExtensionEnabled=function(){if(navigator.mediaDevices&&navigator.mediaDevices.getDisplayMedia)return!0;if(window.navigator.userAgent.match("Chrome")){var e=parseInt(window.navigator.userAgent.match(/Chrome\/(.*) /)[1],10),t=33;return window.navigator.userAgent.match("Linux")&&(t=35),e>=26&&e<=t||Se.extension.isInstalled()}return!0};var ye={extensionId:"hapfgfdkleiggjjpfpenajgdnfckjpaj",isInstalled:function(){return null!==document.querySelector("#janus-extension-installed")},getScreen:function(e){var t=window.setTimeout((function(){var t=new Error("NavigatorUserMediaError");return t.name='The required Chrome extension is not installed: click <a href="#">here</a> to install it. (NOTE: this will need you to refresh the page)',e(t)}),1e3);this.cache[t]=e,window.postMessage({type:"janusGetScreen",id:t},"*")},init:function(){var e={};this.cache=e,window.addEventListener("message",(function(t){if(t.origin==window.location.origin)if("janusGotScreen"==t.data.type&&e[t.data.id]){var n=e[t.data.id];if(delete e[t.data.id],""===t.data.sourceId){var i=new Error("NavigatorUserMediaError");i.name="You cancelled the request for permission, giving up...",n(i)}else n(null,t.data.sourceId)}else"janusGetScreenPending"==t.data.type&&(console.log("clearing ",t.data.id),window.clearTimeout(t.data.id))}))}};function Se(e){if(void 0===Se.initDone)return e.error("Library not initialized"),{};if(!Se.isWebrtcSupported())return e.error("WebRTC not supported by this browser"),{};if(Se.log("Library initialized: "+Se.initDone),(e=e||{}).success="function"==typeof e.success?e.success:Se.noop,e.error="function"==typeof e.error?e.error:Se.noop,e.destroyed="function"==typeof e.destroyed?e.destroyed:Se.noop,null===e.server||void 0===e.server)return e.error("Invalid server url"),{};var t=!1,n=null,i={},o=null,a=null,r=0,s=e.server;Se.isArray(s)?(Se.log("Multiple servers provided ("+s.length+"), will use the first that works"),s=null,a=e.server,Se.debug(a)):0===s.indexOf("ws")?(t=!0,Se.log("Using WebSockets to contact Janus: "+s)):(t=!1,Se.log("Using REST API to contact Janus: "+s));var l=e.iceServers;null==l&&(l=[{urls:"stun:stun.l.google.com:19302"}]);var d=e.iceTransportPolicy,u=e.bundlePolicy,m=e.ipv6;null==m&&(m=!1);var h=!1;void 0!==e.withCredentials&&null!==e.withCredentials&&(h=!0===e.withCredentials);var p=10;void 0!==e.max_poll_events&&null!==e.max_poll_events&&(p=e.max_poll_events),p<1&&(p=1);var g=null;void 0!==e.token&&null!==e.token&&(g=e.token);var f=null;void 0!==e.apisecret&&null!==e.apisecret&&(f=e.apisecret),this.destroyOnUnload=!0,void 0!==e.destroyOnUnload&&null!==e.destroyOnUnload&&(this.destroyOnUnload=!0===e.destroyOnUnload);var v=25e3;void 0!==e.keepAlivePeriod&&null!==e.keepAlivePeriod&&(v=e.keepAlivePeriod),isNaN(v)&&(v=25e3);var S=6e4;function _(e){var t={high:9e5,medium:3e5,low:1e5};return null!=e&&(e.high&&(t.high=e.high),e.medium&&(t.medium=e.medium),e.low&&(t.low=e.low)),t}void 0!==e.longPollTimeout&&null!==e.longPollTimeout&&(S=e.longPollTimeout),isNaN(S)&&(S=6e4);var w=!1,T=null,E={},P=this,k=0,C={};function I(){if(null!=T)if(Se.debug("Long poll..."),w){var t=s+"/"+T+"?rid="+(new Date).getTime();null!=p&&(t=t+"&maxev="+p),null!=g&&(t=t+"&token="+encodeURIComponent(g)),null!=f&&(t=t+"&apisecret="+encodeURIComponent(f)),Se.httpAPICall(t,{verb:"GET",withCredentials:h,success:x,timeout:S,error:function(t,n){if(Se.error(t+":",n),++k>3)return w=!1,void e.error("Lost connection to the server (is it down?)");I()}})}else Se.warn("Is the server down? (connected=false)")}function x(e,i){if(k=0,t||null==T||!0===i||I(),t||!Se.isArray(e))if("keepalive"!==e.rtcgw)if("ack"!==e.rtcgw)if("success"!==e.rtcgw)if("trickle"===e.rtcgw){if(null==(c=e.sender))return void Se.warn("Missing sender...");if(null==(d=E[c]))return void Se.debug("This handle is not attached to this session");var o=e.candidate;Se.debug("Got a trickled candidate on session "+T),Se.debug(o);var a=d.webrtcStuff;a.pc&&a.remoteSdp?(Se.debug("Adding remote candidate:",o),o&&!0!==o.completed?a.pc.addIceCandidate(o):a.pc.addIceCandidate(Se.endOfCandidates)):(Se.debug("We didn't do setRemoteDescription (trickle got here before the offer?), caching candidate"),a.candidates||(a.candidates=[]),a.candidates.push(o),Se.debug(a.candidates))}else{if("webrtcup"===e.rtcgw)return Se.debug("Got a webrtcup event on session "+T),Se.debug(e),null==(c=e.sender)?void Se.warn("Missing sender..."):null==(d=E[c])?void Se.debug("This handle is not attached to this session"):void d.webrtcState(!0);if("hangup"===e.rtcgw){if(Se.debug("Got a hangup event on session "+T),Se.debug(e),null==(c=e.sender))return void Se.warn("Missing sender...");if(null==(d=E[c]))return void Se.debug("This handle is not attached to this session");d.webrtcState(!1,e.reason),d.hangup()}else if("detached"===e.rtcgw){if(Se.debug("Got a detached event on session "+T),Se.debug(e),null==(c=e.sender))return void Se.warn("Missing sender...");if(null==(d=E[c]))return;d.detached=!0,d.ondetached(),d.detach()}else if("media"===e.rtcgw){if(Se.debug("Got a media event on session "+T),Se.debug(e),null==(c=e.sender))return void Se.warn("Missing sender...");if(null==(d=E[c]))return void Se.debug("This handle is not attached to this session");d.mediaState(e.type,e.receiving)}else if("slowlink"===e.rtcgw){if(Se.debug("Got a slowlink event on session "+T),Se.debug(e),null==(c=e.sender))return void Se.warn("Missing sender...");if(null==(d=E[c]))return void Se.debug("This handle is not attached to this session");d.slowLink(e.uplink,e.lost)}else{if("error"===e.rtcgw){var r,s;if(Se.error("Ooops: "+e.error.code+" "+e.error.reason),Se.debug(e),null!=(r=e.transaction))null!=(s=C[r])&&s(e),delete C[r];return}if("event"===e.rtcgw){var c;if(Se.debug("Got a plugin event on session "+T),Se.debug(e),null==(c=e.sender))return void Se.warn("Missing sender...");var l=e.plugindata;if(null==l)return void Se.warn("Missing plugindata...");Se.debug(" -- Event is coming from "+c+" ("+l.plugin+")");var d,u=l.data;if(Se.debug(u),null==(d=E[c]))return void Se.warn("This handle is not attached to this session");var m=e.jsep;null!=m&&(Se.debug("Handling SDP as well..."),Se.debug(m));var h=d.onmessage;null!=h?(Se.debug("Notifying application..."),h(u,m)):Se.debug("No provided notification callback")}else{if("timeout"===e.rtcgw)return Se.error("Timeout on session "+T),Se.debug(e),void(t&&n.close(3504,"Gateway timeout"));Se.warn("Unknown message/event '"+e.rtcgw+"' on session "+T),Se.debug(e)}}}else Se.debug("Got a success on session "+T),Se.debug(e),null!=(r=e.transaction)&&(null!=(s=C[r])&&s(e),delete C[r]);else Se.debug("Got an ack on session "+T),Se.debug(e),null!=(r=e.transaction)&&(null!=(s=C[r])&&s(e),delete C[r]);else Se.vdebug("Got a keepalive on session "+T);else for(var p=0;p<e.length;p++)x(e[p],!0)}function j(){if(null!==s&&t&&w){o=setTimeout(j,v);var e={rtcgw:"keepalive",session_id:T,transaction:Se.randomString(12)};null!=g&&(e.token=g),null!=f&&(e.apisecret=f),n.send(JSON.stringify(e))}}function A(c){var l=Se.randomString(12),d={rtcgw:"create",transaction:l,token:window.EZUIKit.opt.stream,device:window.EZUIKit.opt.deviceSerial,channel:window.EZUIKit.opt.channelNo,authBizType:"TALK"};if(c.reconnect&&(w=!1,d.rtcgw="claim",d.session_id=T,n&&(n.onopen=null,n.onerror=null,n.onclose=null,o&&(clearTimeout(o),o=null))),null!=g&&(d.token=g),null!=f&&(d.apisecret=f),null===s&&Se.isArray(a)&&(0===(s=a[r]).indexOf("ws")?(t=!0,Se.log("Server #"+(r+1)+": trying WebSockets to contact Janus ("+s+")")):(t=!1,Se.log("Server #"+(r+1)+": trying REST API to contact Janus ("+s+")"))),t)for(var u in n=Se.newWebSocket(s,"rtcgw-protocol"),i={error:function(){if(Se.error("Error connecting to the Janus WebSockets server... "+s),Se.isArray(a)&&!c.reconnect)return++r==a.length?void c.error("Error connecting to any of the provided Janus servers: Is the server down?"):(s=null,void setTimeout((function(){A(c)}),200));c.error("Error connecting to the Janus WebSockets server: Is the server down?")},open:function(){C[l]=function(e){if(Se.debug(e),"success"!==e.rtcgw)return Se.error("Ooops: "+e.error.code+" "+e.error.reason),void c.error(e.error.reason);o=setTimeout(j,v),w=!0,T=e.session_id?e.session_id:e.data.id,c.reconnect?Se.log("Claimed session: "+T):Se.log("Created session: "+T),Se.sessions[T]=P,c.success()},n.send(JSON.stringify(d))},message:function(e){x(JSON.parse(e.data))},close:function(){null!==s&&w&&(w=!1,e.error("Lost connection to the server (is it down?)"))}})n.addEventListener(u,i[u]);else Se.httpAPICall(s,{verb:"POST",withCredentials:h,body:d,success:function(e){if(Se.debug(e),"success"!==e.rtcgw)return Se.error("Ooops: "+e.error.code+" "+e.error.reason),void c.error(e.error.reason);w=!0,T=e.session_id?e.session_id:e.data.id,c.reconnect?Se.log("Claimed session: "+T):Se.log("Created session: "+T),Se.sessions[T]=P,I(),c.success()},error:function(e,t){if(Se.error(e+":",t),Se.isArray(a)&&!c.reconnect)return++r==a.length?void c.error("Error connecting to any of the provided Janus servers: Is the server down?"):(s=null,void setTimeout((function(){A(c)}),200));""===t?c.error(e+": Is the server down?"):c.error(e+": "+t)}})}function D(e,i){if((i=i||{}).success="function"==typeof i.success?i.success:Se.noop,i.error="function"==typeof i.error?i.error:Se.noop,!w)return Se.warn("Is the server down? (connected=false)"),void i.error("Is the server down? (connected=false)");var o=E[e];if(null==o||null===o.webrtcStuff||void 0===o.webrtcStuff)return Se.warn("Invalid handle"),void i.error("Invalid handle");var a=i.message,r=i.jsep,c=Se.randomString(12),l={rtcgw:"message",body:a,transaction:c};if(null!==o.token&&void 0!==o.token&&(l.token=o.token),null!=f&&(l.apisecret=f),null!=r&&(l.jsep=r),Se.debug("Sending message to plugin (handle="+e+"):"),Se.debug(l),t)return l.session_id=T,l.handle_id=e,C[c]=function(e){if(Se.debug("Message sent!"),Se.debug(e),"success"===e.rtcgw){var t=e.plugindata;if(null==t)return Se.warn("Request succeeded, but missing plugindata..."),void i.success();Se.log("Synchronous transaction successful ("+t.plugin+")");var n=t.data;return Se.debug(n),void i.success(n)}"ack"===e.rtcgw?i.success():void 0!==e.error&&null!==e.error?(Se.error("Ooops: "+e.error.code+" "+e.error.reason),i.error(e.error.code+" "+e.error.reason)):(Se.error("Unknown error"),i.error("Unknown error"))},void n.send(JSON.stringify(l));Se.httpAPICall(s+"/"+T+"/"+e,{verb:"POST",withCredentials:h,body:l,success:function(e){if(Se.debug("Message sent!"),Se.debug(e),"success"===e.rtcgw){var t=e.plugindata;if(null==t)return Se.warn("Request succeeded, but missing plugindata..."),void i.success();Se.log("Synchronous transaction successful ("+t.plugin+")");var n=t.data;return Se.debug(n),void i.success(n)}"ack"===e.rtcgw?i.success():void 0!==e.error&&null!==e.error?(Se.error("Ooops: "+e.error.code+" "+e.error.reason),i.error(e.error.code+" "+e.error.reason)):(Se.error("Unknown error"),i.error("Unknown error"))},error:function(e,t){Se.error(e+":",t),i.error(e+": "+t)}})}function R(e,i){if(w){var o=E[e];if(null!=o&&null!==o.webrtcStuff&&void 0!==o.webrtcStuff){var a={rtcgw:"trickle",candidate:i,transaction:Se.randomString(12)};if(null!==o.token&&void 0!==o.token&&(a.token=o.token),null!=f&&(a.apisecret=f),Se.vdebug("Sending trickle candidate (handle="+e+"):"),Se.vdebug(a),t)return a.session_id=T,a.handle_id=e,void n.send(JSON.stringify(a));Se.httpAPICall(s+"/"+T+"/"+e,{verb:"POST",withCredentials:h,body:a,success:function(e){Se.vdebug("Candidate sent!"),Se.vdebug(e),"ack"===e.rtcgw||Se.error("Ooops: "+e.error.code+" "+e.error.reason)},error:function(e,t){Se.error(e+":",t)}})}else Se.warn("Invalid handle")}else Se.warn("Is the server down? (connected=false)")}function L(e,t,n,i){var o=E[e];if(null!=o&&null!==o.webrtcStuff&&void 0!==o.webrtcStuff){var a=o.webrtcStuff,r=function(e){Se.log("Received state change on data channel:",e);var t=e.target.label,n=a.dataChannel[t]?a.dataChannel[t].readyState:"null";if(Se.log("State change on <"+t+"> data channel: "+n),"open"===n){if(a.dataChannel[t].pending&&a.dataChannel[t].pending.length>0){for(var i in Se.log("Sending pending messages on <"+t+">:",a.dataChannel[t].pending.length),a.dataChannel[t].pending){var r=a.dataChannel[t].pending[i];Se.log("Sending string on data channel <"+t+">: "+r),a.dataChannel[t].send(r)}a.dataChannel[t].pending=[]}o.ondataopen(t)}};a.dataChannel[t]=n||a.pc.createDataChannel(t,{ordered:!1}),a.dataChannel[t].onmessage=function(e){Se.log("Received message on data channel:",e);var t=e.target.label;o.ondata(e.data,t)},a.dataChannel[t].onopen=r,a.dataChannel[t].onclose=r,a.dataChannel[t].onerror=function(e){Se.error("Got error on data channel:",e)},a.dataChannel[t].pending=[],i&&a.dataChannel[t].pending.push(i)}else Se.warn("Invalid handle")}function B(e,t){(t=t||{}).success="function"==typeof t.success?t.success:Se.noop,t.error="function"==typeof t.error?t.error:Se.noop;var n=E[e];if(null==n||null===n.webrtcStuff||void 0===n.webrtcStuff)return Se.warn("Invalid handle"),void t.error("Invalid handle");var i=n.webrtcStuff,o=t.text;if(null==o)return Se.warn("Invalid text"),void t.error("Invalid text");var a=t.label?t.label:Se.dataChanDefaultLabel;return i.dataChannel[a]?"open"!==i.dataChannel[a].readyState?(i.dataChannel[a].pending.push(o),void t.success()):(Se.log("Sending string on data channel <"+a+">: "+o),i.dataChannel[a].send(o),void t.success()):(L(e,a,!1,o),void t.success())}function M(e,t){(t=t||{}).success="function"==typeof t.success?t.success:Se.noop,t.error="function"==typeof t.error?t.error:Se.noop;var n=E[e];if(null==n||null===n.webrtcStuff||void 0===n.webrtcStuff)return Se.warn("Invalid handle"),void t.error("Invalid handle");var i=n.webrtcStuff;if(null===i.dtmfSender||void 0===i.dtmfSender){if(void 0!==i.pc&&null!==i.pc){var o=i.pc.getSenders().find((function(e){return e.track&&"audio"===e.track.kind}));if(!o)return Se.warn("Invalid DTMF configuration (no audio track)"),void t.error("Invalid DTMF configuration (no audio track)");i.dtmfSender=o.dtmf,i.dtmfSender&&(Se.log("Created DTMF Sender"),i.dtmfSender.ontonechange=function(e){Se.debug("Sent DTMF tone: "+e.tone)})}if(null===i.dtmfSender||void 0===i.dtmfSender)return Se.warn("Invalid DTMF configuration"),void t.error("Invalid DTMF configuration")}var a=t.dtmf;if(null==a)return Se.warn("Invalid DTMF parameters"),void t.error("Invalid DTMF parameters");var r=a.tones;if(null==r)return Se.warn("Invalid DTMF string"),void t.error("Invalid DTMF string");var s=a.duration;null==s&&(s=500);var c=a.gap;null==c&&(c=50),Se.debug("Sending DTMF string "+r+" (duration "+s+"ms, gap "+c+"ms)"),i.dtmfSender.insertDTMF(r,s,c),t.success()}function O(e,i){(i=i||{}).success="function"==typeof i.success?i.success:Se.noop,i.error="function"==typeof i.error?i.error:Se.noop;var o=!0;void 0!==i.asyncRequest&&null!==i.asyncRequest&&(o=!0===i.asyncRequest);var a=!0;void 0!==i.noRequest&&null!==i.noRequest&&(a=!0===i.noRequest),Se.log("Destroying handle "+e+" (async="+o+")"),Y(e);var r=E[e];if(null==r||r.detached)return delete E[e],void i.success();if(a)return delete E[e],void i.success();if(!w)return Se.warn("Is the server down? (connected=false)"),void i.error("Is the server down? (connected=false)");var c={rtcgw:"detach",transaction:Se.randomString(12)};if(null!==r.token&&void 0!==r.token&&(c.token=r.token),null!=f&&(c.apisecret=f),t)return c.session_id=T,c.handle_id=e,n.send(JSON.stringify(c)),delete E[e],void i.success();Se.httpAPICall(s+"/"+T+"/"+e,{verb:"POST",async:o,withCredentials:h,body:c,success:function(t){Se.log("Destroyed handle:"),Se.debug(t),"success"!==t.rtcgw&&Se.error("Ooops: "+t.error.code+" "+t.error.reason),delete E[e],i.success()},error:function(t,n){Se.error(t+":",n),delete E[e],i.success()}})}function z(e,t,n,i,o){return N.apply(this,arguments)}function N(){var e;return e=y().mark((function e(t,n,i,o,a){var r,s,c,h,p,g,f,v,S,w,T,P,k,C,I,x,j,A,D,B,M,O,z,N,F,U,Z;return y().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!=(r=E[t])&&null!==r.webrtcStuff&&void 0!==r.webrtcStuff){e.next=5;break}return Se.warn("Invalid handle"),o.error("Invalid handle"),e.abrupt("return");case 5:if(s=r.webrtcStuff,Se.debug("streamsDone:",a),a&&(Se.debug(" -- Audio tracks:",a.getAudioTracks()),Se.debug(" -- Video tracks:",a.getVideoTracks())),c=!1,s.myStream&&i.update&&!s.streamExternal){e.next=14;break}s.myStream=a,c=!0,e.next=66;break;case 14:if(!((!i.update&&X(i)||i.update&&(i.addAudio||i.replaceAudio))&&a.getAudioTracks()&&a.getAudioTracks().length)){e.next=45;break}if(s.myStream.addTrack(a.getAudioTracks()[0]),!Se.unifiedPlan){e.next=43;break}if(Se.log((i.replaceAudio?"Replacing":"Adding")+" audio track:",a.getAudioTracks()[0]),h=null,!((p=s.pc.getTransceivers())&&p.length>0)){e.next=30;break}e.t0=y().keys(p);case 22:if((e.t1=e.t0()).done){e.next=30;break}if(g=e.t1.value,!((f=p[g]).sender&&f.sender.track&&"audio"===f.sender.track.kind||f.receiver&&f.receiver.track&&"audio"===f.receiver.track.kind)){e.next=28;break}return h=f,e.abrupt("break",30);case 28:e.next=22;break;case 30:return v=null,e.prev=31,e.next=34,o.customizeStream(a);case 34:v=e.sent,e.next=40;break;case 37:e.prev=37,e.t2=e.catch(31),o.error(e.t2);case 40:h&&h.sender?h.sender.replaceTrack((null===(S=v)||void 0===S||null===(w=S.getAudioTracks)||void 0===w||null===(T=w.call(S))||void 0===T?void 0:T[0])||a.getAudioTracks()[0]):s.pc.addTrack((null===(P=v)||void 0===P||null===(k=P.getAudioTracks)||void 0===k||null===(C=k.call(P))||void 0===C?void 0:C[0])||a.getAudioTracks()[0],v||a),e.next=45;break;case 43:Se.log((i.replaceAudio?"Replacing":"Adding")+" audio track:",a.getAudioTracks()[0]),s.pc.addTrack(a.getAudioTracks()[0],a);case 45:if(!((!i.update&&$(i)||i.update&&(i.addVideo||i.replaceVideo))&&a.getVideoTracks()&&a.getVideoTracks().length)){e.next=66;break}if(s.myStream.addTrack(a.getVideoTracks()[0]),!Se.unifiedPlan){e.next=64;break}if(Se.log((i.replaceVideo?"Replacing":"Adding")+" video track:",a.getVideoTracks()[0]),I=null,!((p=s.pc.getTransceivers())&&p.length>0)){e.next=61;break}e.t3=y().keys(p);case 53:if((e.t4=e.t3()).done){e.next=61;break}if(g=e.t4.value,!((f=p[g]).sender&&f.sender.track&&"video"===f.sender.track.kind||f.receiver&&f.receiver.track&&"video"===f.receiver.track.kind)){e.next=59;break}return I=f,e.abrupt("break",61);case 59:e.next=53;break;case 61:I&&I.sender?I.sender.replaceTrack(a.getVideoTracks()[0]):s.pc.addTrack(a.getVideoTracks()[0],a),e.next=66;break;case 64:Se.log((i.replaceVideo?"Replacing":"Adding")+" video track:",a.getVideoTracks()[0]),s.pc.addTrack(a.getVideoTracks()[0],a);case 66:if(!s.pc){if(x={iceServers:l,iceTransportPolicy:d,bundlePolicy:u},"chrome"===Se.webRTCAdapter.browserDetails.browser&&(x.sdpSemantics=Se.webRTCAdapter.browserDetails.version<72?"plan-b":"unified-plan"),j={optional:[{DtlsSrtpKeyAgreement:!0}]},!0===m&&j.optional.push({googIPv6:!0}),o.rtcConstraints&&"object"===b(o.rtcConstraints))for(g in Se.debug("Adding custom PeerConnection constraints:",o.rtcConstraints),o.rtcConstraints)j.optional.push(o.rtcConstraints[g]);"edge"===Se.webRTCAdapter.browserDetails.browser&&(x.bundlePolicy="max-bundle"),Se.log("Creating PeerConnection"),Se.debug(j),s.pc=new RTCPeerConnection(x,j),Se.debug(s.pc),s.pc.getStats&&(s.volume={},s.bitrate.value="0 kbits/sec"),Se.log("Preparing local SDP and gathering candidates (trickle="+s.trickle+")"),s.pc.oniceconnectionstatechange=function(e){s.pc&&r.iceState(s.pc.iceConnectionState)},s.pc.onicecandidate=function(e){if(null==e.candidate||"edge"===Se.webRTCAdapter.browserDetails.browser&&e.candidate.candidate.indexOf("endOfCandidates")>0)Se.log("End of candidates."),s.iceDone=!0,!0===s.trickle?R(t,{completed:!0}):G(t,o);else{var n={candidate:e.candidate.candidate,sdpMid:e.candidate.sdpMid,sdpMLineIndex:e.candidate.sdpMLineIndex};!0===s.trickle&&R(t,n)}},s.pc.ontrack=function(e){Se.log("Handling Remote Track"),Se.debug(e),e.streams&&(s.remoteStream=e.streams[0],r.onremotestream(s.remoteStream),e.track.onended||(Se.log("Adding onended callback to track:",e.track),e.track.onended=function(e){Se.log("Remote track muted/removed:",e),s.remoteStream&&(s.remoteStream.removeTrack(e.target),r.onremotestream(s.remoteStream))},e.track.onmute=e.track.onended,e.track.onunmute=function(e){try{s.remoteStream.addTrack(e.target),r.onremotestream(s.remoteStream)}catch(e){Se.error(e)}}))}}if(!c||null==a){e.next=96;break}Se.log("Adding local stream"),A=!0===o.simulcast2,D=a.getTracks(),B=0;case 72:if(!(B<D.length)){e.next=96;break}if(M=D[B],A){e.next=92;break}if("audio"!==M.kind){e.next=89;break}return U=null,e.prev=77,e.next=80,o.customizeStream(a);case 80:U=e.sent,e.next=86;break;case 83:e.prev=83,e.t5=e.catch(77),o.error(e.t5);case 86:s.pc.addTrack((null===(O=U)||void 0===O||null===(z=(N=O).getAudioTracks)||void 0===z||null===(F=z.call(N))||void 0===F?void 0:F[0])||M,U||a),e.next=90;break;case 89:s.pc.addTrack(M,a);case 90:e.next=93;break;case 92:"audio"===M.kind?s.pc.addTrack(M,a):(Se.log("Enabling rid-based simulcasting:",M),Z=_(o.simulcastMaxBitrates),s.pc.addTransceiver(M,{direction:"sendrecv",streams:[a],sendEncodings:[{rid:"h",active:!0,maxBitrate:Z.high},{rid:"m",active:!0,maxBitrate:Z.medium,scaleResolutionDownBy:2},{rid:"l",active:!0,maxBitrate:Z.low,scaleResolutionDownBy:4}]}));case 93:B++,e.next=72;break;case 96:te(i)&&!s.dataChannel[Se.dataChanDefaultLabel]&&(Se.log("Creating data channel"),L(t,Se.dataChanDefaultLabel,!1),s.pc.ondatachannel=function(e){Se.log("Data channel created by Janus:",e),L(t,e.channel.label,e.channel)}),s.myStream&&r.onlocalstream(s.myStream),null==n?V(t,i,o):s.pc.setRemoteDescription(n).then((function(){if(Se.log("Remote description accepted!"),s.remoteSdp=n.sdp,s.candidates&&s.candidates.length>0){for(var e=0;e<s.candidates.length;e++){var a=s.candidates[e];Se.debug("Adding remote candidate:",a),a&&!0!==a.completed?s.pc.addIceCandidate(a):s.pc.addIceCandidate(Se.endOfCandidates)}s.candidates=[]}H(t,i,o)}),o.error);case 99:case"end":return e.stop()}}),e,null,[[31,37],[77,83]])})),N=function(){var t=this,n=arguments;return new Promise((function(i,o){var a=e.apply(t,n);function r(e){c(a,i,o,r,s,"next",e)}function s(e){c(a,i,o,r,s,"throw",e)}r(void 0)}))},N.apply(this,arguments)}function F(e,t,n){(n=n||{}).success="function"==typeof n.success?n.success:Se.noop,n.error="function"==typeof n.error?n.error:J,n.customizeStream="function"==typeof n.customizeStream?n.customizeStream:Se.noop;var i=n.jsep;if(t&&i)return Se.error("Provided a JSEP to a createOffer"),void n.error("Provided a JSEP to a createOffer");if(!(t||i&&i.type&&i.sdp))return Se.error("A valid JSEP is required for createAnswer"),void n.error("A valid JSEP is required for createAnswer");n.media=n.media||{audio:!0,video:!0};var o=n.media,a=E[e];if(null==a||null===a.webrtcStuff||void 0===a.webrtcStuff)return Se.warn("Invalid handle"),void n.error("Invalid handle");var r,s=a.webrtcStuff;if(s.trickle=(r=n.trickle,Se.debug("isTrickleEnabled:",r),null==r||!0===r),void 0===s.pc||null===s.pc)o.update=!1,o.keepAudio=!1,o.keepVideo=!1;else if(void 0!==s.pc&&null!==s.pc){if(Se.log("Updating existing media session"),o.update=!0,null!==n.stream&&void 0!==n.stream)n.stream!==s.myStream&&Se.log("Renegotiation involves a new external stream");else{if(o.addAudio){if(o.keepAudio=!1,o.replaceAudio=!1,o.removeAudio=!1,o.audioSend=!0,s.myStream&&s.myStream.getAudioTracks()&&s.myStream.getAudioTracks().length)return Se.error("Can't add audio stream, there already is one"),void n.error("Can't add audio stream, there already is one")}else o.removeAudio?(o.keepAudio=!1,o.replaceAudio=!1,o.addAudio=!1,o.audioSend=!1):o.replaceAudio&&(o.keepAudio=!1,o.addAudio=!1,o.removeAudio=!1,o.audioSend=!0);if(null===s.myStream||void 0===s.myStream?(o.replaceAudio&&(o.keepAudio=!1,o.replaceAudio=!1,o.addAudio=!0,o.audioSend=!0),X(o)&&(o.keepAudio=!1,o.addAudio=!0)):null===s.myStream.getAudioTracks()||void 0===s.myStream.getAudioTracks()||0===s.myStream.getAudioTracks().length?(o.replaceAudio&&(o.keepAudio=!1,o.replaceAudio=!1,o.addAudio=!0,o.audioSend=!0),X(o)&&(o.keepVideo=!1,o.addAudio=!0)):!X(o)||o.removeAudio||o.replaceAudio||(o.keepAudio=!0),o.addVideo){if(o.keepVideo=!1,o.replaceVideo=!1,o.removeVideo=!1,o.videoSend=!0,s.myStream&&s.myStream.getVideoTracks()&&s.myStream.getVideoTracks().length)return Se.error("Can't add video stream, there already is one"),void n.error("Can't add video stream, there already is one")}else o.removeVideo?(o.keepVideo=!1,o.replaceVideo=!1,o.addVideo=!1,o.videoSend=!1):o.replaceVideo&&(o.keepVideo=!1,o.addVideo=!1,o.removeVideo=!1,o.videoSend=!0);null===s.myStream||void 0===s.myStream||null===s.myStream.getVideoTracks()||void 0===s.myStream.getVideoTracks()||0===s.myStream.getVideoTracks().length?(o.replaceVideo&&(o.keepVideo=!1,o.replaceVideo=!1,o.addVideo=!0,o.videoSend=!0),$(o)&&(o.keepVideo=!1,o.addVideo=!0)):!$(o)||o.removeVideo||o.replaceVideo||(o.keepVideo=!0),o.addData&&(o.data=!0)}if(X(o)&&o.keepAudio&&$(o)&&o.keepVideo)return a.consentDialog(!1),void z(e,i,o,n,s.myStream)}if(o.update&&!s.streamExternal){if(o.removeAudio||o.replaceAudio){if(s.myStream&&s.myStream.getAudioTracks()&&s.myStream.getAudioTracks().length){var c=s.myStream.getAudioTracks()[0];Se.log("Removing audio track:",c),s.myStream.removeTrack(c);try{c.stop()}catch(e){}}if(s.pc.getSenders()&&s.pc.getSenders().length){var l=!0;if(o.replaceAudio&&Se.unifiedPlan&&(l=!1),l)for(var d in s.pc.getSenders()){(c=s.pc.getSenders()[d])&&c.track&&"audio"===c.track.kind&&(Se.log("Removing audio sender:",c),s.pc.removeTrack(c))}}}if(o.removeVideo||o.replaceVideo){if(s.myStream&&s.myStream.getVideoTracks()&&s.myStream.getVideoTracks().length){c=s.myStream.getVideoTracks()[0];Se.log("Removing video track:",c),s.myStream.removeTrack(c);try{c.stop()}catch(e){}}if(s.pc.getSenders()&&s.pc.getSenders().length){var u=!0;if(o.replaceVideo&&Se.unifiedPlan&&(u=!1),u)for(var d in s.pc.getSenders()){(c=s.pc.getSenders()[d])&&c.track&&"video"===c.track.kind&&(Se.log("Removing video sender:",c),s.pc.removeTrack(c))}}}}if(null!==n.stream&&void 0!==n.stream){var m=n.stream;if(Se.log("MediaStream provided by the application"),Se.debug(m),o.update&&s.myStream&&s.myStream!==n.stream&&!s.streamExternal){try{var h=s.myStream.getTracks();for(var p in h){var g=h[p];Se.log(g),null!=g&&g.stop()}}catch(e){}s.myStream=null}return s.streamExternal=!0,a.consentDialog(!1),void z(e,i,o,n,m)}if(X(o)||$(o)){if(!Se.isGetUserMediaAvailable())return void n.error("getUserMedia not available");var f={mandatory:{},optional:[]};a.consentDialog(!0);var v=X(o);!0===v&&null!=o&&null!=o&&"object"===b(o.audio)&&(v=o.audio);var y=$(o);if(!0===y&&null!=o&&null!=o){var S=!0===n.simulcast,_=!0===n.simulcast2;if(!S&&!_||i||void 0!==o.video&&!1!==o.video||(o.video="hires"),o.video&&"screen"!=o.video&&"window"!=o.video)if("object"===b(o.video))y=o.video;else{var w=0,T=0;"lowres"===o.video?(T=240,w=320):"lowres-16:9"===o.video?(T=180,w=320):"hires"===o.video||"hires-16:9"===o.video||"hdres"===o.video?(T=720,w=1280):"fhdres"===o.video?(T=1080,w=1920):"4kres"===o.video?(T=2160,w=3840):"stdres"===o.video?(T=480,w=640):"stdres-16:9"===o.video?(T=360,w=640):(Se.log("Default video setting is stdres 4:3"),T=480,w=640),Se.log("Adding media constraint:",o.video),y={height:{ideal:T},width:{ideal:w}},Se.log("Adding video constraint:",y)}else if("screen"===o.video||"window"===o.video){var P=function(t,r){a.consentDialog(!1),t?n.error(t):z(e,i,o,n,r)},k=function(e,t,n){Se.log("Adding media constraint (screen capture)"),Se.debug(e),navigator.mediaDevices.getUserMedia(e).then((function(e){n?navigator.mediaDevices.getUserMedia({audio:!0,video:!1}).then((function(n){e.addTrack(n.getAudioTracks()[0]),t(null,e)})):t(null,e)})).catch((function(e){a.consentDialog(!1),t(e)}))};if(o.screenshareFrameRate||(o.screenshareFrameRate=3),navigator.mediaDevices&&navigator.mediaDevices.getDisplayMedia)return void navigator.mediaDevices.getDisplayMedia({video:!0}).then((function(t){a.consentDialog(!1),X(o)&&!o.keepAudio?navigator.mediaDevices.getUserMedia({audio:!0,video:!1}).then((function(a){t.addTrack(a.getAudioTracks()[0]),z(e,i,o,n,t)})):z(e,i,o,n,t)}),(function(e){a.consentDialog(!1),n.error(e)}));if("chrome"===Se.webRTCAdapter.browserDetails.browser){var C=Se.webRTCAdapter.browserDetails.version,I=33;window.navigator.userAgent.match("Linux")&&(I=35),C>=26&&C<=I?(f={video:{mandatory:{googLeakyBucket:!0,maxWidth:window.screen.width,maxHeight:window.screen.height,minFrameRate:o.screenshareFrameRate,maxFrameRate:o.screenshareFrameRate,chromeMediaSource:"screen"}},audio:X(o)&&!o.keepAudio},k(f,P)):Se.extension.getScreen((function(e,t){if(e)return a.consentDialog(!1),n.error(e);(f={audio:!1,video:{mandatory:{chromeMediaSource:"desktop",maxWidth:window.screen.width,maxHeight:window.screen.height,minFrameRate:o.screenshareFrameRate,maxFrameRate:o.screenshareFrameRate},optional:[{googLeakyBucket:!0},{googTemporalLayeredScreencast:!0}]}}).video.mandatory.chromeMediaSourceId=t,k(f,P,X(o)&&!o.keepAudio)}))}else if("firefox"===Se.webRTCAdapter.browserDetails.browser){if(!(Se.webRTCAdapter.browserDetails.version>=33)){var x=new Error("NavigatorUserMediaError");return x.name="Your version of Firefox does not support screen sharing, please install Firefox 33 (or more recent versions)",a.consentDialog(!1),void n.error(x)}f={video:{mozMediaSource:o.video,mediaSource:o.video},audio:X(o)&&!o.keepAudio},k(f,(function(e,t){if(P(e,t),!e)var n=t.currentTime,i=window.setInterval((function(){t||window.clearInterval(i),t.currentTime==n&&(window.clearInterval(i),t.onended&&t.onended()),n=t.currentTime}),500)}))}return}}null!=o&&"screen"===o.video||navigator.mediaDevices.enumerateDevices().then((function(t){var r=t.some((function(e){return"audioinput"===e.kind})),s=function(e){if(Se.debug("isScreenSendEnabled:",e),null==e)return!1;if("object"!==b(e.video)||"object"!==b(e.video.mandatory))return!1;var t=e.video.mandatory;if(t.chromeMediaSource)return"desktop"===t.chromeMediaSource||"screen"===t.chromeMediaSource;if(t.mozMediaSource)return"window"===t.mozMediaSource||"screen"===t.mozMediaSource;if(t.mediaSource)return"window"===t.mediaSource||"screen"===t.mediaSource;return!1}(o)||t.some((function(e){return"videoinput"===e.kind})),c=X(o),l=$(o),d=function(e){return Se.debug("isAudioSendRequired:",e),null!=e&&(!1!==e.audio&&!1!==e.audioSend&&(void 0!==e.failIfNoAudio&&null!==e.failIfNoAudio&&!0===e.failIfNoAudio))}(o),u=function(e){return Se.debug("isVideoSendRequired:",e),null!=e&&(!1!==e.video&&!1!==e.videoSend&&(void 0!==e.failIfNoVideo&&null!==e.failIfNoVideo&&!0===e.failIfNoVideo))}(o);if(c||l||d||u){var h=!!c&&r,p=!!l&&s;if(!h&&!p)return a.consentDialog(!1),n.error("No capture device found"),!1;if(!h&&d)return a.consentDialog(!1),n.error("Audio capture is required, but no capture device found"),!1;if(!p&&u)return a.consentDialog(!1),n.error("Video capture is required, but no capture device found"),!1}var g={audio:!(!r||o.keepAudio)&&v,video:!(!s||o.keepVideo)&&y};Se.debug("getUserMedia constraints",g),g.audio||g.video?navigator.mediaDevices.getUserMedia(g).then((function(t){a.consentDialog(!1),z(e,i,o,n,t)})).catch((function(e){a.consentDialog(!1),n.error({code:e.code,name:e.name,message:e.message})})):(a.consentDialog(!1),z(e,i,o,n,m))})).catch((function(e){a.consentDialog(!1),n.error("enumerateDevices error",e)}))}else z(e,i,o,n)}function U(e,t){(t=t||{}).success="function"==typeof t.success?t.success:Se.noop,t.error="function"==typeof t.error?t.error:J;var n=t.jsep,i=E[e];if(null==i||null===i.webrtcStuff||void 0===i.webrtcStuff)return Se.warn("Invalid handle"),void t.error("Invalid handle");var o=i.webrtcStuff;if(null!=n){if(null===o.pc)return Se.warn("Wait, no PeerConnection?? if this is an answer, use createAnswer and not handleRemoteJsep"),void t.error("No PeerConnection: if this is an answer, use createAnswer and not handleRemoteJsep");o.pc.setRemoteDescription(n).then((function(){if(Se.log("Remote description accepted!"),o.remoteSdp=n.sdp,o.candidates&&o.candidates.length>0){for(var e=0;e<o.candidates.length;e++){var i=o.candidates[e];Se.debug("Adding remote candidate:",i),i&&!0!==i.completed?o.pc.addIceCandidate(i):o.pc.addIceCandidate(Se.endOfCandidates)}o.candidates=[]}t.success()}),t.error)}else t.error("Invalid JSEP")}function V(e,t,n){(n=n||{}).success="function"==typeof n.success?n.success:Se.noop,n.error="function"==typeof n.error?n.error:Se.noop,n.customizeSdp="function"==typeof n.customizeSdp?n.customizeSdp:Se.noop;var i=E[e];if(null==i||null===i.webrtcStuff||void 0===i.webrtcStuff)return Se.warn("Invalid handle"),void n.error("Invalid handle");var o=i.webrtcStuff,a=!0===n.simulcast;a?Se.log("Creating offer (iceDone="+o.iceDone+", simulcast="+a+")"):Se.log("Creating offer (iceDone="+o.iceDone+")");var r={};if(Se.unifiedPlan){var s=null,c=null,l=o.pc.getTransceivers();if(l&&l.length>0)for(var d in l){var u=l[d];u.sender&&u.sender.track&&"audio"===u.sender.track.kind||u.receiver&&u.receiver.track&&"audio"===u.receiver.track.kind?s||(s=u):(u.sender&&u.sender.track&&"video"===u.sender.track.kind||u.receiver&&u.receiver.track&&"video"===u.receiver.track.kind)&&(c||(c=u))}var m=X(t),h=Q(t);m||h?m&&h?s&&(s.setDirection?s.setDirection("sendrecv"):s.direction="sendrecv",Se.log("Setting audio transceiver to sendrecv:",s)):m&&!h?s&&(s.setDirection?s.setDirection("sendonly"):s.direction="sendonly",Se.log("Setting audio transceiver to sendonly:",s)):!m&&h&&(s?(s.setDirection?s.setDirection("recvonly"):s.direction="recvonly",Se.log("Setting audio transceiver to recvonly:",s)):(s=o.pc.addTransceiver("audio",{direction:"recvonly"}),Se.log("Adding recvonly audio transceiver:",s))):t.removeAudio&&s&&(s.setDirection?s.setDirection("inactive"):s.direction="inactive",Se.log("Setting audio transceiver to inactive:",s));var p=$(t),g=ee(t);p||g?p&&g?c&&(c.setDirection?c.setDirection("sendrecv"):c.direction="sendrecv",Se.log("Setting video transceiver to sendrecv:",c)):p&&!g?c&&(c.setDirection?c.setDirection("sendonly"):c.direction="sendonly",Se.log("Setting video transceiver to sendonly:",c)):!p&&g&&(c?(c.setDirection?c.setDirection("recvonly"):c.direction="recvonly",Se.log("Setting video transceiver to recvonly:",c)):(c=o.pc.addTransceiver("video",{direction:"recvonly"}),Se.log("Adding recvonly video transceiver:",c))):t.removeVideo&&c&&(c.setDirection?c.setDirection("inactive"):c.direction="inactive",Se.log("Setting video transceiver to inactive:",c))}else r.offerToReceiveAudio=Q(t),r.offerToReceiveVideo=ee(t);!0===n.iceRestart&&(r.iceRestart=!0),Se.debug(r);var f=$(t);if(f&&a&&"firefox"===Se.webRTCAdapter.browserDetails.browser){Se.log("Enabling Simulcasting for Firefox (RID)");var v=o.pc.getSenders().find((function(e){return"video"==e.track.kind}));if(v){var y=v.getParameters();y||(y={});var S=_(n.simulcastMaxBitrates);y.encodings=[{rid:"h",active:!0,maxBitrate:S.high},{rid:"m",active:!0,maxBitrate:S.medium,scaleResolutionDownBy:2},{rid:"l",active:!0,maxBitrate:S.low,scaleResolutionDownBy:4}],v.setParameters(y)}}o.pc.createOffer(r).then((function(e){Se.debug(e);var t={type:e.type,sdp:e.sdp};n.customizeSdp(t),e.sdp=t.sdp,Se.log("Setting local description"),f&&a&&("chrome"===Se.webRTCAdapter.browserDetails.browser||"safari"===Se.webRTCAdapter.browserDetails.browser?(Se.log("Enabling Simulcasting for Chrome (SDP munging)"),e.sdp=function(e){for(var t=e.split("\r\n"),n=!1,i=[-1],o=[-1],a=null,r=null,s=null,c=null,l=-1,d=0;d<t.length;d++){if(m=t[d].match(/m=(\w+) */)){if("video"===m[1]){if(!(i[0]<0)){l=d;break}n=!0}else if(i[0]>-1){l=d;break}}else if(n){var u=t[d].match(/a=ssrc-group:FID (\d+) (\d+)/);if(u)i[0]=u[1],o[0]=u[2],t.splice(d,1),d--;else{if(i[0]){if((p=t[d].match("a=ssrc:"+i[0]+" cname:(.+)"))&&(a=p[1]),(p=t[d].match("a=ssrc:"+i[0]+" msid:(.+)"))&&(r=p[1]),(p=t[d].match("a=ssrc:"+i[0]+" mslabel:(.+)"))&&(s=p[1]),(p=t[d].match("a=ssrc:"+i[0]+" label:(.+)"))&&(c=p[1]),0===t[d].indexOf("a=ssrc:"+o[0])){t.splice(d,1),d--;continue}if(0===t[d].indexOf("a=ssrc:"+i[0])){t.splice(d,1),d--;continue}}0!=t[d].length||(t.splice(d,1),d--)}}}if(i[0]<0){l=-1,n=!1;for(d=0;d<t.length;d++){var m;if(m=t[d].match(/m=(\w+) */)){if("video"===m[1]){if(!(i[0]<0)){l=d;break}n=!0}else if(i[0]>-1){l=d;break}}else if(n){if(i[0]<0){var h=t[d].match(/a=ssrc:(\d+)/);if(h){i[0]=h[1],t.splice(d,1),d--;continue}}else{var p;if((p=t[d].match("a=ssrc:"+i[0]+" cname:(.+)"))&&(a=p[1]),(p=t[d].match("a=ssrc:"+i[0]+" msid:(.+)"))&&(r=p[1]),(p=t[d].match("a=ssrc:"+i[0]+" mslabel:(.+)"))&&(s=p[1]),(p=t[d].match("a=ssrc:"+i[0]+" label:(.+)"))&&(c=p[1]),0===t[d].indexOf("a=ssrc:"+o[0])){t.splice(d,1),d--;continue}if(0===t[d].indexOf("a=ssrc:"+i[0])){t.splice(d,1),d--;continue}}0!=t[d].length||(t.splice(d,1),d--)}}}if(i[0]<0)return Se.warn("Couldn't find the video SSRC, simulcasting NOT enabled"),e;l<0&&(l=t.length);i[1]=Math.floor(4294967295*Math.random()),i[2]=Math.floor(4294967295*Math.random()),o[1]=Math.floor(4294967295*Math.random()),o[2]=Math.floor(4294967295*Math.random());for(d=0;d<i.length;d++)a&&(t.splice(l,0,"a=ssrc:"+i[d]+" cname:"+a),l++),r&&(t.splice(l,0,"a=ssrc:"+i[d]+" msid:"+r),l++),s&&(t.splice(l,0,"a=ssrc:"+i[d]+" mslabel:"+s),l++),c&&(t.splice(l,0,"a=ssrc:"+i[d]+" label:"+c),l++),a&&(t.splice(l,0,"a=ssrc:"+o[d]+" cname:"+a),l++),r&&(t.splice(l,0,"a=ssrc:"+o[d]+" msid:"+r),l++),s&&(t.splice(l,0,"a=ssrc:"+o[d]+" mslabel:"+s),l++),c&&(t.splice(l,0,"a=ssrc:"+o[d]+" label:"+c),l++);t.splice(l,0,"a=ssrc-group:FID "+i[2]+" "+o[2]),t.splice(l,0,"a=ssrc-group:FID "+i[1]+" "+o[1]),t.splice(l,0,"a=ssrc-group:FID "+i[0]+" "+o[0]),t.splice(l,0,"a=ssrc-group:SIM "+i[0]+" "+i[1]+" "+i[2]),(e=t.join("\r\n")).endsWith("\r\n")||(e+="\r\n");return e}(e.sdp)):"firefox"!==Se.webRTCAdapter.browserDetails.browser&&Se.warn("simulcast=true, but this is not Chrome nor Firefox, ignoring")),o.mySdp=e.sdp,o.pc.setLocalDescription(e).catch(n.error),o.mediaConstraints=r,o.iceDone||o.trickle?(Se.log("Offer ready"),Se.debug(n),n.success(e)):Se.log("Waiting for all candidates...")}),n.error)}function H(e,t,n){(n=n||{}).success="function"==typeof n.success?n.success:Se.noop,n.error="function"==typeof n.error?n.error:Se.noop,n.customizeSdp="function"==typeof n.customizeSdp?n.customizeSdp:Se.noop;var i=E[e];if(null==i||null===i.webrtcStuff||void 0===i.webrtcStuff)return Se.warn("Invalid handle"),void n.error("Invalid handle");var o=i.webrtcStuff,a=!0===n.simulcast;a?Se.log("Creating answer (iceDone="+o.iceDone+", simulcast="+a+")"):Se.log("Creating answer (iceDone="+o.iceDone+")");var r=null;if(Se.unifiedPlan){r={};var s=null,c=null,l=o.pc.getTransceivers();if(l&&l.length>0)for(var d in l){var u=l[d];u.sender&&u.sender.track&&"audio"===u.sender.track.kind||u.receiver&&u.receiver.track&&"audio"===u.receiver.track.kind?s||(s=u):(u.sender&&u.sender.track&&"video"===u.sender.track.kind||u.receiver&&u.receiver.track&&"video"===u.receiver.track.kind)&&(c||(c=u))}var m=X(t),h=Q(t);if(m||h){if(m&&h){if(s)try{s.setDirection?s.setDirection("sendrecv"):s.direction="sendrecv",Se.log("Setting audio transceiver to sendrecv:",s)}catch(e){Se.error(e)}}else if(m&&!h)try{s&&(s.setDirection?s.setDirection("sendonly"):s.direction="sendonly",Se.log("Setting audio transceiver to sendonly:",s))}catch(e){Se.error(e)}else if(!m&&h)if(s)try{s.setDirection?s.setDirection("recvonly"):s.direction="recvonly",Se.log("Setting audio transceiver to recvonly:",s)}catch(e){Se.error(e)}else s=o.pc.addTransceiver("audio",{direction:"recvonly"}),Se.log("Adding recvonly audio transceiver:",s)}else if(t.removeAudio&&s)try{s.setDirection?s.setDirection("inactive"):s.direction="inactive",Se.log("Setting audio transceiver to inactive:",s)}catch(e){Se.error(e)}var p=$(t),g=ee(t);if(p||g){if(p&&g){if(c)try{c.setDirection?c.setDirection("sendrecv"):c.direction="sendrecv",Se.log("Setting video transceiver to sendrecv:",c)}catch(e){Se.error(e)}}else if(p&&!g){if(c)try{c.setDirection?c.setDirection("sendonly"):c.direction="sendonly",Se.log("Setting video transceiver to sendonly:",c)}catch(e){Se.error(e)}}else if(!p&&g)if(c)try{c.setDirection?c.setDirection("recvonly"):c.direction="recvonly",Se.log("Setting video transceiver to recvonly:",c)}catch(e){Se.error(e)}else c=o.pc.addTransceiver("video",{direction:"recvonly"}),Se.log("Adding recvonly video transceiver:",c)}else if(t.removeVideo&&c)try{c.setDirection?c.setDirection("inactive"):c.direction="inactive",Se.log("Setting video transceiver to inactive:",c)}catch(e){Se.error(e)}}else r="firefox"==Se.webRTCAdapter.browserDetails.browser||"edge"==Se.webRTCAdapter.browserDetails.browser?{offerToReceiveAudio:Q(t),offerToReceiveVideo:ee(t)}:{mandatory:{OfferToReceiveAudio:Q(t),OfferToReceiveVideo:ee(t)}};Se.debug(r);var f=$(t);if(f&&a&&"firefox"===Se.webRTCAdapter.browserDetails.browser){Se.log("Enabling Simulcasting for Firefox (RID)");var v=o.pc.getSenders()[1];Se.log(v);var y=v.getParameters();Se.log(y);var S=_(n.simulcastMaxBitrates);v.setParameters({encodings:[{rid:"high",active:!0,priority:"high",maxBitrate:S.high},{rid:"medium",active:!0,priority:"medium",maxBitrate:S.medium},{rid:"low",active:!0,priority:"low",maxBitrate:S.low}]})}o.pc.createAnswer(r).then((function(e){Se.debug(e);var t={type:e.type,sdp:e.sdp};n.customizeSdp(t),e.sdp=t.sdp,Se.log("Setting local description"),f&&a&&("chrome"===Se.webRTCAdapter.browserDetails.browser?Se.warn("simulcast=true, but this is an answer, and video breaks in Chrome if we enable it"):"firefox"!==Se.webRTCAdapter.browserDetails.browser&&Se.warn("simulcast=true, but this is not Chrome nor Firefox, ignoring")),o.mySdp=e.sdp,o.pc.setLocalDescription(e).catch(n.error),o.mediaConstraints=r,o.iceDone||o.trickle?n.success(e):Se.log("Waiting for all candidates...")}),n.error)}function G(e,t){(t=t||{}).success="function"==typeof t.success?t.success:Se.noop,t.error="function"==typeof t.error?t.error:Se.noop;var n=E[e];if(null!=n&&null!==n.webrtcStuff&&void 0!==n.webrtcStuff){var i=n.webrtcStuff;Se.log("Sending offer/answer SDP..."),null!==i.mySdp&&void 0!==i.mySdp?(i.mySdp={type:i.pc.localDescription.type,sdp:i.pc.localDescription.sdp},!1===i.trickle&&(i.mySdp.trickle=!1),Se.debug(t),i.sdpSent=!0,t.success(i.mySdp)):Se.warn("Local SDP instance is invalid, not sending anything...")}else Se.warn("Invalid handle, not sending anything")}function Z(e,t){var n=E[e];if(null==n||null===n.webrtcStuff||void 0===n.webrtcStuff)return Se.warn("Invalid handle"),0;var i=t?"remote":"local",o=n.webrtcStuff;return o.volume[i]||(o.volume[i]={value:0}),o.pc.getStats&&"chrome"===Se.webRTCAdapter.browserDetails.browser?!t||null!==o.remoteStream&&void 0!==o.remoteStream?t||null!==o.myStream&&void 0!==o.myStream?null===o.volume[i].timer||void 0===o.volume[i].timer?(Se.log("Starting "+i+" volume monitor"),o.volume[i].timer=setInterval((function(){o.pc.getStats((function(e){for(var n=e.result(),a=0;a<n.length;a++){var r=n[a];"ssrc"==r.type&&(t&&r.stat("audioOutputLevel")?o.volume[i].value=parseInt(r.stat("audioOutputLevel")):!t&&r.stat("audioInputLevel")&&(o.volume[i].value=parseInt(r.stat("audioInputLevel"))))}}))}),200),0):o.volume[i].value:(Se.warn("Local stream unavailable"),0):(Se.warn("Remote stream unavailable"),0):(Se.warn("Getting the "+i+" volume unsupported by browser"),0)}function W(e,t){var n=E[e];if(null==n||null===n.webrtcStuff||void 0===n.webrtcStuff)return Se.warn("Invalid handle"),!0;var i=n.webrtcStuff;return null===i.pc||void 0===i.pc?(Se.warn("Invalid PeerConnection"),!0):void 0===i.myStream||null===i.myStream?(Se.warn("Invalid local MediaStream"),!0):t?null===i.myStream.getVideoTracks()||void 0===i.myStream.getVideoTracks()||0===i.myStream.getVideoTracks().length?(Se.warn("No video track"),!0):!i.myStream.getVideoTracks()[0].enabled:null===i.myStream.getAudioTracks()||void 0===i.myStream.getAudioTracks()||0===i.myStream.getAudioTracks().length?(Se.warn("No audio track"),!0):!i.myStream.getAudioTracks()[0].enabled}function q(e,t,n){var i=E[e];if(null==i||null===i.webrtcStuff||void 0===i.webrtcStuff)return Se.warn("Invalid handle"),!1;var o=i.webrtcStuff;return null===o.pc||void 0===o.pc?(Se.warn("Invalid PeerConnection"),!1):void 0===o.myStream||null===o.myStream?(Se.warn("Invalid local MediaStream"),!1):t?null===o.myStream.getVideoTracks()||void 0===o.myStream.getVideoTracks()||0===o.myStream.getVideoTracks().length?(Se.warn("No video track"),!1):(o.myStream.getVideoTracks()[0].enabled=!n,!0):null===o.myStream.getAudioTracks()||void 0===o.myStream.getAudioTracks()||0===o.myStream.getAudioTracks().length?(Se.warn("No audio track"),!1):(o.myStream.getAudioTracks()[0].enabled=!n,!0)}function K(e){var t=E[e];if(null==t||null===t.webrtcStuff||void 0===t.webrtcStuff)return Se.warn("Invalid handle"),"Invalid handle";var n=t.webrtcStuff;return null===n.pc||void 0===n.pc?"Invalid PeerConnection":n.pc.getStats?null===n.bitrate.timer||void 0===n.bitrate.timer?(Se.log("Starting bitrate timer (via getStats)"),n.bitrate.timer=setInterval((function(){n.pc.getStats().then((function(e){e.forEach((function(e){if(e){var t=!1;if(("video"===e.mediaType||e.id.toLowerCase().indexOf("video")>-1)&&"inbound-rtp"===e.type&&e.id.indexOf("rtcp")<0?t=!0:"ssrc"!=e.type||!e.bytesReceived||"VP8"!==e.googCodecName&&""!==e.googCodecName||(t=!0),t)if(n.bitrate.bsnow=e.bytesReceived,n.bitrate.tsnow=e.timestamp,null===n.bitrate.bsbefore||null===n.bitrate.tsbefore)n.bitrate.bsbefore=n.bitrate.bsnow,n.bitrate.tsbefore=n.bitrate.tsnow;else{var i=n.bitrate.tsnow-n.bitrate.tsbefore;"safari"==Se.webRTCAdapter.browserDetails.browser&&(i/=1e3);var o=Math.round(8*(n.bitrate.bsnow-n.bitrate.bsbefore)/i);"safari"===Se.webRTCAdapter.browserDetails.browser&&(o=parseInt(o/1e3)),n.bitrate.value=o+" kbits/sec",n.bitrate.bsbefore=n.bitrate.bsnow,n.bitrate.tsbefore=n.bitrate.tsnow}}}))}))}),1e3),"0 kbits/sec"):n.bitrate.value:(Se.warn("Getting the video bitrate unsupported by browser"),"Feature unsupported by browser")}function J(e){Se.error("WebRTC error:",e)}function Y(e,i){Se.log("Cleaning WebRTC stuff");var o=E[e];if(null!=o){var a=o.webrtcStuff;if(null!=a){if(!0===i){var r={rtcgw:"hangup",transaction:Se.randomString(12)};null!==o.token&&void 0!==o.token&&(r.token=o.token),null!=f&&(r.apisecret=f),Se.debug("Sending hangup request (handle="+e+"):"),Se.debug(r),t?(r.session_id=T,r.handle_id=e,n.send(JSON.stringify(r))):Se.httpAPICall(s+"/"+T+"/"+e,{verb:"POST",withCredentials:h,body:r})}a.remoteStream=null,a.volume&&(a.volume.local&&a.volume.local.timer&&clearInterval(a.volume.local.timer),a.volume.remote&&a.volume.remote.timer&&clearInterval(a.volume.remote.timer)),a.volume={},a.bitrate.timer&&clearInterval(a.bitrate.timer),a.bitrate.timer=null,a.bitrate.bsnow=null,a.bitrate.bsbefore=null,a.bitrate.tsnow=null,a.bitrate.tsbefore=null,a.bitrate.value=null;try{if(!a.streamExternal&&null!==a.myStream&&void 0!==a.myStream){Se.log("Stopping local stream tracks");var c=a.myStream.getTracks();for(var l in c){var d=c[l];Se.log(d),null!=d&&d.stop()}}}catch(e){}a.streamExternal=!1,a.myStream=null;try{a.pc.close()}catch(e){}a.pc=null,a.candidates=null,a.mySdp=null,a.remoteSdp=null,a.iceDone=!1,a.dataChannel={},a.dtmfSender=null}o.oncleanup()}}function X(e){return Se.debug("isAudioSendEnabled:",e),null==e||!1!==e.audio&&(void 0===e.audioSend||null===e.audioSend||!0===e.audioSend)}function Q(e){return Se.debug("isAudioRecvEnabled:",e),null==e||!1!==e.audio&&(void 0===e.audioRecv||null===e.audioRecv||!0===e.audioRecv)}function $(e){return Se.debug("isVideoSendEnabled:",e),null==e||!1!==e.video&&(void 0===e.videoSend||null===e.videoSend||!0===e.videoSend)}function ee(e){return Se.debug("isVideoRecvEnabled:",e),null==e||!1!==e.video&&(void 0===e.videoRecv||null===e.videoRecv||!0===e.videoRecv)}function te(e){return Se.debug("isDataEnabled:",e),"edge"==Se.webRTCAdapter.browserDetails.browser?(Se.warn("Edge doesn't support data channels yet"),!1):null!=e&&!0===e.data}A(e),this.getServer=function(){return s},this.isConnected=function(){return w},this.reconnect=function(e){(e=e||{}).success="function"==typeof e.success?e.success:Se.noop,e.error="function"==typeof e.error?e.error:Se.noop,e.reconnect=!0,A(e)},this.getSessionId=function(){return T},this.destroy=function(a){!function(a){a=a||{},a.success="function"==typeof a.success?a.success:Se.noop;var r=!0;void 0!==a.asyncRequest&&null!==a.asyncRequest&&(r=!0===a.asyncRequest);var c=!0;void 0!==a.notifyDestroyed&&null!==a.notifyDestroyed&&(c=!0===a.notifyDestroyed);var l=!1;void 0!==a.cleanupHandles&&null!==a.cleanupHandles&&(l=!0===a.cleanupHandles);if(Se.log("Destroying session "+T+" (async="+r+")"),!w)return Se.warn("Is the server down? (connected=false)"),void a.success();if(null==T)return Se.warn("No session to destroy"),a.success(),void(c&&e.destroyed());if(l)for(var d in E)O(d,{noRequest:!0});var u={rtcgw:"destroy",transaction:Se.randomString(12)};null!=g&&(u.token=g);null!=f&&(u.apisecret=f);if(t){u.session_id=T;var m=function(){for(var e in i)n.removeEventListener(e,i[e]);n.removeEventListener("message",p),n.removeEventListener("error",v),o&&clearTimeout(o),n.close()},p=function(t){var n=JSON.parse(t.data);n.session_id==u.session_id&&n.transaction==u.transaction&&(m(),a.success(),c&&e.destroyed())},v=function(t){m(),a.error("Failed to destroy the server: Is the server down?"),c&&e.destroyed()};return n.addEventListener("message",p),n.addEventListener("error",v),void n.send(JSON.stringify(u))}Se.httpAPICall(s+"/"+T,{verb:"POST",async:r,withCredentials:h,body:u,success:function(t){Se.log("Destroyed session:"),Se.debug(t),T=null,w=!1,"success"!==t.rtcgw&&Se.error("Ooops: "+t.error.code+" "+t.error.reason),a.success(),c&&e.destroyed()},error:function(t,n){Se.error(t+":",n),T=null,w=!1,a.success(),c&&e.destroyed()}})}(a)},this.attach=function(e){!function(e){if(e=e||{},e.success="function"==typeof e.success?e.success:Se.noop,e.error="function"==typeof e.error?e.error:Se.noop,e.consentDialog="function"==typeof e.consentDialog?e.consentDialog:Se.noop,e.iceState="function"==typeof e.iceState?e.iceState:Se.noop,e.mediaState="function"==typeof e.mediaState?e.mediaState:Se.noop,e.webrtcState="function"==typeof e.webrtcState?e.webrtcState:Se.noop,e.slowLink="function"==typeof e.slowLink?e.slowLink:Se.noop,e.onmessage="function"==typeof e.onmessage?e.onmessage:Se.noop,e.onlocalstream="function"==typeof e.onlocalstream?e.onlocalstream:Se.noop,e.onremotestream="function"==typeof e.onremotestream?e.onremotestream:Se.noop,e.ondata="function"==typeof e.ondata?e.ondata:Se.noop,e.ondataopen="function"==typeof e.ondataopen?e.ondataopen:Se.noop,e.oncleanup="function"==typeof e.oncleanup?e.oncleanup:Se.noop,e.ondetached="function"==typeof e.ondetached?e.ondetached:Se.noop,!w)return Se.warn("Is the server down? (connected=false)"),void e.error("Is the server down? (connected=false)");var i=e.plugin;if(null==i)return Se.error("Invalid plugin"),void e.error("Invalid plugin");var o=e.opaqueId,a=e.token?e.token:g,r=Se.randomString(12),c={rtcgw:"attach",plugin:i,opaque_id:o,transaction:r};null!=a&&(c.token=a);null!=f&&(c.apisecret=f);if(t)return C[r]=function(t){if(Se.debug(t),"success"!==t.rtcgw)return Se.error("Ooops: "+t.error.code+" "+t.error.reason),void e.error("Ooops: "+t.error.code+" "+t.error.reason);var n=t.data.id;Se.log("Created handle: "+n);var o={session:P,plugin:i,id:n,token:a,detached:!1,webrtcStuff:{started:!1,myStream:null,streamExternal:!1,remoteStream:null,mySdp:null,mediaConstraints:null,pc:null,dataChannel:{},dtmfSender:null,trickle:!0,iceDone:!1,volume:{value:null,timer:null},bitrate:{value:null,bsnow:null,bsbefore:null,tsnow:null,tsbefore:null,timer:null}},getId:function(){return n},getPlugin:function(){return i},getVolume:function(){return Z(n,!0)},getRemoteVolume:function(){return Z(n,!0)},getLocalVolume:function(){return Z(n,!1)},isAudioMuted:function(){return W(n,!1)},muteAudio:function(){return q(n,!1,!0)},unmuteAudio:function(){return q(n,!1,!1)},isVideoMuted:function(){return W(n,!0)},muteVideo:function(){return q(n,!0,!0)},unmuteVideo:function(){return q(n,!0,!1)},getBitrate:function(){return K(n)},send:function(e){D(n,e)},data:function(e){B(n,e)},dtmf:function(e){M(n,e)},consentDialog:e.consentDialog,iceState:e.iceState,mediaState:e.mediaState,webrtcState:e.webrtcState,slowLink:e.slowLink,onmessage:e.onmessage,createOffer:function(e){F(n,!0,e)},createAnswer:function(e){F(n,!1,e)},handleRemoteJsep:function(e){U(n,e)},onlocalstream:e.onlocalstream,onremotestream:e.onremotestream,ondata:e.ondata,ondataopen:e.ondataopen,oncleanup:e.oncleanup,ondetached:e.ondetached,hangup:function(e){Y(n,!0===e)},detach:function(e){O(n,e)}};E[n]=o,e.success(o)},c.session_id=T,void n.send(JSON.stringify(c));Se.httpAPICall(s+"/"+T,{verb:"POST",withCredentials:h,body:c,success:function(t){if(Se.debug(t),"success"!==t.rtcgw)return Se.error("Ooops: "+t.error.code+" "+t.error.reason),void e.error("Ooops: "+t.error.code+" "+t.error.reason);var n=t.data.id;Se.log("Created handle: "+n);var o={session:P,plugin:i,id:n,token:a,detached:!1,webrtcStuff:{started:!1,myStream:null,streamExternal:!1,remoteStream:null,mySdp:null,mediaConstraints:null,pc:null,dataChannel:{},dtmfSender:null,trickle:!0,iceDone:!1,volume:{value:null,timer:null},bitrate:{value:null,bsnow:null,bsbefore:null,tsnow:null,tsbefore:null,timer:null}},getId:function(){return n},getPlugin:function(){return i},getVolume:function(){return Z(n,!0)},getRemoteVolume:function(){return Z(n,!0)},getLocalVolume:function(){return Z(n,!1)},isAudioMuted:function(){return W(n,!1)},muteAudio:function(){return q(n,!1,!0)},unmuteAudio:function(){return q(n,!1,!1)},isVideoMuted:function(){return W(n,!0)},muteVideo:function(){return q(n,!0,!0)},unmuteVideo:function(){return q(n,!0,!1)},getBitrate:function(){return K(n)},send:function(e){D(n,e)},data:function(e){B(n,e)},dtmf:function(e){M(n,e)},consentDialog:e.consentDialog,iceState:e.iceState,mediaState:e.mediaState,webrtcState:e.webrtcState,slowLink:e.slowLink,onmessage:e.onmessage,createOffer:function(e){F(n,!0,e)},createAnswer:function(e){F(n,!1,e)},handleRemoteJsep:function(e){U(n,e)},onlocalstream:e.onlocalstream,onremotestream:e.onremotestream,ondata:e.ondata,ondataopen:e.ondataopen,oncleanup:e.oncleanup,ondetached:e.ondetached,hangup:function(e){Y(n,!0===e)},detach:function(e){O(n,e)}};E[n]=o,e.success(o)},error:function(e,t){Se.error(e+":",t)}})}(e)}}Se.useDefaultDependencies=function(e){var t=e&&e.fetch||fetch,n=e&&e.Promise||Promise,i=e&&e.WebSocket||WebSocket;return{newWebSocket:function(e,t){return new i(e,t)},extension:e&&e.extension||ye,isArray:function(e){return Array.isArray(e)},webRTCAdapter:e&&e.adapter||window.adapter,httpAPICall:function(e,i){var o={method:i.verb,headers:{Accept:"application/json, text/plain, */*"},cache:"no-cache"};"POST"===i.verb&&(o.headers["Content-Type"]="application/json"),void 0!==i.withCredentials&&(o.credentials=!0===i.withCredentials?"include":i.withCredentials?i.withCredentials:"omit"),void 0!==i.body&&(o.body=JSON.stringify(i.body));var a=t(e,o).catch((function(e){return n.reject({message:"Probably a network error, is the server down?",error:e})}));if(void 0!==i.timeout){var r=new n((function(e,t){var n=setTimeout((function(){return clearTimeout(n),t({message:"Request timed out",timeout:i.timeout})}),i.timeout)}));a=n.race([a,r])}return a.then((function(e){return e.ok?b(i.success)===b(Se.noop)?e.json().then((function(e){i.success(e)})).catch((function(t){return n.reject({message:"Failed to parse response body",error:t,response:e})})):void 0:n.reject({message:"API call failed",response:e})})).catch((function(e){b(i.error)===b(Se.noop)&&i.error(e.message||"<< internal error >>",e)})),a}}},Se.useOldDependencies=function(e){var t=e&&e.jQuery||jQuery,n=e&&e.WebSocket||WebSocket;return{newWebSocket:function(e,t){return new n(e,t)},isArray:function(e){return t.isArray(e)},extension:e&&e.extension||ye,webRTCAdapter:e&&e.adapter||adapter,httpAPICall:function(e,n){var i=void 0!==n.body?{contentType:"application/json",data:JSON.stringify(n.body)}:{},o=void 0!==n.withCredentials?{xhrFields:{withCredentials:n.withCredentials}}:{};return t.ajax(t.extend(i,o,{url:e,type:n.verb,cache:!1,dataType:"json",async:n.async,timeout:n.timeout,success:function(e){b(n.success)===b(Se.noop)&&n.success(e)},error:function(e,t,i){b(n.error)===b(Se.noop)&&n.error(t,i)}}))}}},Se.noop=function(){},Se.dataChanDefaultLabel="JanusDataChannel",Se.endOfCandidates=null,Se.init=function(e){if((e=e||{}).callback="function"==typeof e.callback?e.callback:Se.noop,!0===Se.initDone)e.callback();else{if("undefined"!=typeof console&&void 0!==console.log||(console={log:function(){}}),Se.trace=Se.noop,Se.debug=Se.noop,Se.vdebug=Se.noop,Se.log=Se.noop,Se.warn=Se.noop,Se.error=Se.noop,!0===e.debug||"all"===e.debug)Se.trace=console.trace.bind(console),Se.debug=console.debug.bind(console),Se.vdebug=console.debug.bind(console),Se.log=console.log.bind(console),Se.warn=console.warn.bind(console),Se.error=console.error.bind(console);else if(Array.isArray(e.debug))for(var t in e.debug){var n=e.debug[t];switch(n){case"trace":Se.trace=console.trace.bind(console);break;case"debug":Se.debug=console.debug.bind(console);break;case"vdebug":Se.vdebug=console.debug.bind(console);break;case"log":Se.log=console.log.bind(console);break;case"warn":Se.warn=console.warn.bind(console);break;case"error":Se.error=console.error.bind(console);break;default:console.error("Unknown debugging option '"+n+"' (supported: 'trace', 'debug', 'vdebug', 'log', warn', 'error')")}}var i=e.dependencies||Se.useDefaultDependencies();Se.isArray=i.isArray,Se.webRTCAdapter=i.webRTCAdapter,Se.httpAPICall=i.httpAPICall,Se.newWebSocket=i.newWebSocket,Se.extension=i.extension,Se.extension.init(),Se.listDevices=function(e,t){e="function"==typeof e?e:Se.noop,null==t&&(t={audio:!0,video:!0}),Se.isGetUserMediaAvailable()?navigator.mediaDevices.getUserMedia(t).then((function(t){navigator.mediaDevices.enumerateDevices().then((function(n){Se.debug(n),e(n);try{var i=t.getTracks();for(var o in i){var a=i[o];null!=a&&a.stop()}}catch(e){}}))})).catch((function(t){Se.error(t),e([])})):(Se.warn("navigator.mediaDevices unavailable"),e([]))},Se.attachMediaStream=function(e,t){"chrome"===Se.webRTCAdapter.browserDetails.browser?Se.webRTCAdapter.browserDetails.version>=52?e.srcObject=t:Se.error("Error attaching stream to element"):e.srcObject=t},Se.reattachMediaStream=function(e,t){"chrome"===Se.webRTCAdapter.browserDetails.browser?Se.webRTCAdapter.browserDetails.version>=52?e.srcObject=t.srcObject:void 0!==e.src?e.src=t.src:Se.error("Error reattaching stream to element"):e.srcObject=t.srcObject};var o=["iPad","iPhone","iPod"].indexOf(navigator.platform)>=0?"pagehide":"beforeunload",a=window["on"+o];if(window.addEventListener(o,(function(e){for(var t in Se.log("Closing window"),Se.sessions)null!==Se.sessions[t]&&void 0!==Se.sessions[t]&&Se.sessions[t].destroyOnUnload&&(Se.log("Destroying session "+t),Se.sessions[t].destroy({asyncRequest:!1,notifyDestroyed:!1}));a&&"function"==typeof a&&a()})),Se.safariVp8=!1,"safari"===Se.webRTCAdapter.browserDetails.browser&&Se.webRTCAdapter.browserDetails.version>=605)if(RTCRtpSender&&RTCRtpSender.getCapabilities&&RTCRtpSender.getCapabilities("video")&&RTCRtpSender.getCapabilities("video").codecs&&RTCRtpSender.getCapabilities("video").codecs.length){for(var t in RTCRtpSender.getCapabilities("video").codecs){var r=RTCRtpSender.getCapabilities("video").codecs[t];if(r&&r.mimeType&&"video/vp8"===r.mimeType.toLowerCase()){Se.safariVp8=!0;break}}Se.safariVp8?Se.log("This version of Safari supports VP8"):Se.warn("This version of Safari does NOT support VP8: if you're using a Technology Preview, try enabling the 'WebRTC VP8 codec' setting in the 'Experimental Features' Develop menu")}else{var s=new RTCPeerConnection({},{});s.createOffer({offerToReceiveVideo:!0}).then((function(e){Se.safariVp8=-1!==e.sdp.indexOf("VP8"),Se.safariVp8?Se.log("This version of Safari supports VP8"):Se.warn("This version of Safari does NOT support VP8: if you're using a Technology Preview, try enabling the 'WebRTC VP8 codec' setting in the 'Experimental Features' Develop menu"),s.close(),s=null}))}if(Se.unifiedPlan=!1,"firefox"===Se.webRTCAdapter.browserDetails.browser&&Se.webRTCAdapter.browserDetails.version>=59)Se.unifiedPlan=!0;else if("chrome"===Se.webRTCAdapter.browserDetails.browser&&Se.webRTCAdapter.browserDetails.version<72)Se.unifiedPlan=!1;else if("undefined"==typeof RTCRtpTransceiver||"currentDirection"in RTCRtpTransceiver.prototype){var c=new RTCPeerConnection;try{c.addTransceiver("audio"),Se.unifiedPlan=!0}catch(e){}c.close()}else Se.unifiedPlan=!1;Se.initDone=!0,e.callback()}},Se.isWebrtcSupported=function(){return void 0!==window.RTCPeerConnection&&null!==window.RTCPeerConnection},Se.isGetUserMediaAvailable=function(){return void 0!==navigator.mediaDevices&&null!==navigator.mediaDevices&&void 0!==navigator.mediaDevices.getUserMedia&&null!==navigator.mediaDevices.getUserMedia},Se.randomString=function(e){for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",n="",i=0;i<e;i++){var o=Math.floor(62*Math.random());n+=t.substring(o,o+1)}return n},window.Janus_Talk=Se;var _e=window.Janus_Talk,be=null,we=null,Te="tts-"+Janus_Talk.randomString(12),Ee=null;_e.init({debug:"all",callback:function(){window.stopTalk=function(){be.destroy()},window.startTalk=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.customizeStream,n=void 0===t?null:t,i=e.audio,o=void 0===i||i;_e.isWebrtcSupported()?be=new _e({server:window.EZUIKit.opt.rtcUrl,success:function(){be.attach({plugin:"rtcgw.plugin.tts",opaqueId:Te,success:function(e){we=window.tts=e,_e.log("Plugin attached! ("+we.getPlugin()+", id="+we.getId()+")");var t=window.EZUIKit.opt.talkLink;console.log("ttsUlr",t);var i={request:"start",url:t,codec:"opus",dir:"sendrecv",audio_debug:1,url_version:"1"};"gb28181"===window.EZUIKit.opt.talkType&&(i.devProto="gb28181"),_e.debug("Trying a createOffer too (audio/video sendrecv)"),we.createOffer({media:{audio:o||!0,video:!1,data:!1},simulcast:!1,simulcast2:!1,customizeStream:n,success:function(e){_e.debug("Got SDP!"),_e.debug(e),we.send({message:i,jsep:e}),void 0!==window.EZUIKit.handleTalkSuccess&&window.EZUIKit.handleTalkSuccess()},error:function(e){_e.error("WebRTC error:",e),void 0!==window.EZUIKit.handleTalkError&&window.EZUIKit.handleTalkError(e)}})},error:function(e){console.error(" -- Error attaching plugin...",e),bootbox.alert("Error attaching plugin... "+e),"undefined"!==window.EZUIKit.handleTalkError&&window.EZUIKit.handleTalkError(e)},consentDialog:function(e){_e.debug("Consent dialog should be "+(e?"on":"off")+" now")},iceState:function(e){_e.log("ICE state changed to "+e)},mediaState:function(e,t){_e.log("Janus "+(t?"started":"stopped")+" receiving our "+e)},webrtcState:function(e){_e.log("Janus says our WebRTC PeerConnection is "+(e?"up":"down")+" now")},slowLink:function(e,t){_e.warn("Janus reports problems "+(e?"sending":"receiving")+" packets on this PeerConnection ("+t+" lost packets)")},onmessage:function(e,t){_e.debug(" ::: Got a message :::"),_e.debug(e),null!=t&&(_e.debug("Handling SDP as well..."),_e.debug(t),we.handleRemoteJsep({jsep:t}));var n=e.result;if(null!=n){if("done"===n)return bootbox.alert("The TTS Test is over"),null!=Ee&&Ee.stop(),void(Ee=null);"msg"===n&&void 0!==window.EZUIKit.handleTalkMessage&&window.EZUIKit.handleTalkMessage(e),"slow_link"===n.status&&toastr.warning("Janus apparently missed many packets we sent, maybe we should reduce the bitrate","Packet loss?",{timeOut:2e3})}},onlocalstream:function(e){_e.debug(" ::: Got a local stream :::"),_e.debug(e),_e.attachMediaStream(document.getElementById("myaudio"),e),"completed"!==we.webrtcStuff.pc.iceConnectionState&&"connected"!==we.webrtcStuff.pc.iceConnectionState&&(null==Ee?document.getElementById("audioright"):Ee.spin());var t=e.getAudioTracks();null==t||t.length},onremotestream:function(e){_e.debug(" ::: Got a remote stream :::"),_e.debug(e),_e.attachMediaStream(document.getElementById("peeraudio"),e);var t=e.getAudioTracks();null==t||0===t.length||document.getElementById("peeraudio").play()},ondataopen:function(e){_e.log("The DataChannel is available!")},ondata:function(e){_e.debug("We got data from the DataChannel! "+e)},oncleanup:function(){_e.log(" ::: Got a cleanup notification :::"),null!=Ee&&Ee.stop(),Ee=null}})},error:function(e){_e.error(e),"undefined"!==window.EZUIKit.handleTalkError&&window.EZUIKit.handleTalkError(e)},destroyed:function(){}}):bootbox.alert("No WebRTC support... ")}}});var Pe=function(){return m((function e(t){var n=this;l(this,e),this.jSPlugin=t,this.pluginStatus=new U(this,this.jSPlugin.params.id),this.talkChannelNo=t.talkChannelNo,this.gainNode=null,this.volumeGain=null,this.volumeChangeInterval=null,this.microphoneId=null;var i=document.createElement("div");i.id="audioleft";var o=document.createElement("audio");o.id="myaudio",o.muted=!0,o.setAttribute("autoplay",!0),o.setAttribute("controls",!0),i.appendChild(o),i.style="display:none;";var a=document.createElement("div");a.id="audioright",a.style="display:none;";var r=document.createElement("audio");r.id="peeraudio",r.setAttribute("autoplay",!0),r.setAttribute("controls",!0),a.appendChild(r),window.EZUIKit.handleTalkError=function(e){console.log("talk err",e),void 0!==n.jSPlugin.handleTalkError&&n.jSPlugin.handleTalkError(e)},window.EZUIKit.handleTalkSuccess=function(e){console.log("talk success",e),void 0!==n.jSPlugin.handleTalkSuccess&&n.jSPlugin.handleTalkSuccess(e)},window.EZUIKit.opt={rtcUrl:"",talkLink:"",ttsUrl:"",stream:"",deviceSerial:A(this.jSPlugin.url).deviceSerial,channelNo:A(this.jSPlugin.url).channelNo},this.audioLeft=i,this.audioRight=a,document.body.appendChild(i),document.body.appendChild(a)}),[{key:"toString",value:function(){return"".concat(this.coreX,"-").concat(this.coreY)}},{key:"destroy",value:function(){document.body.removeChild(this.audioLeft),document.body.removeChild(this.audioRight)}},{key:"startTalk",value:function(e){var t=this,n=this;new Promise((function(e,n){t.jSPlugin.capacity&&t.jSPlugin.capacity.support_switch_talkmode&&"1"==t.jSPlugin.capacity.support_switch_talkmode?fetch(t.jSPlugin.env.domain+"/api/service/device/talkMode"+"?deviceSerial=".concat(A(t.jSPlugin.url).deviceSerial),{method:"GET",headers:{accessToken:t.jSPlugin.accessToken||t.jSPlugin.token.deviceToken.global}}).then((function(e){return e.json()})).then((function(n){n.meta&&200==n.meta.code?n.data&&n.data.valueInfo&&0==n.data.valueInfo.mode?fetch(t.jSPlugin.env.domain+"/api/v3/device/talkMode"+"?deviceSerial=".concat(A(t.jSPlugin.url).deviceSerial,"&channelNo=").concat(A(t.jSPlugin.url).channelNo,"&mode=1"),{method:"PUT",headers:{accessToken:t.jSPlugin.accessToken||t.jSPlugin.token.deviceToken.video}}).then((function(e){return e.json()})).then((function(t){t.meta&&200==t.meta.code?e():e({code:-1,msg:"对讲模式切换失败",res:t})})).catch((function(t){e({code:-1,msg:"对讲模式切换失败",res:t})})):e():e({code:-1,msg:"获取当前对讲模式失败",res:n})})).catch((function(t){e({code:-1,msg:"获取当前对讲模式失败",res:t})})):e({code:-1,msg:"当前设备不支持对讲模式切换"})})).then((function(i){if(t.jSPlugin.capacity&&t.jSPlugin.capacity.support_talk&&(!t.jSPlugin.capacity||"3"!==t.jSPlugin.capacity.support_talk&&"1"!==t.jSPlugin.capacity.support_talk))return"function"==typeof t.jSPlugin.params.handleError&&(t.pluginStatus.loadingSetText({text:"设备不支持对讲",color:"red",delayClear:2e3}),t.jSPlugin.params.handleError({msg:"设备不支持对讲",retcode:-1e3,id:t.jSPlugin.params.id,type:"handleError"})),console.log("设备不支持对讲"),!1;var o=new FormData;if(o.append("accessToken",t.jSPlugin.accessToken||t.jSPlugin.token.deviceToken.video),o.append("deviceSerial",A(t.jSPlugin.url).deviceSerial),o.append("channelNo",t.jSPlugin.channelNo||"0"),t.jSPlugin.params.extraParams&&t.jSPlugin.params.extraParams.talkParams&&"object"===b(t.jSPlugin.params.extraParams.talkParams))for(var a in t.jSPlugin.params.extraParams.talkParams)data.append(a,t.jSPlugin.params.extraParams.talkParams[a]);fetch(t.jSPlugin.env.domain+"/api/lapp/live/talk/url",{method:"POST",body:o}).then((function(e){return e.json()})).then((function(i){if(200==i.code){var o=i.data;if(o){var a=o.rtcUrl;if(-1===a.indexOf("ws")&&(a=a.replace("https","wss").replace("rtcgw","rtcgw-ws")),window.EZUIKit.opt.rtcUrl=a,window.EZUIKit.opt.ttsUrl="tts://"+o.ttsUrl,t.jSPlugin.params.extraParams&&t.jSPlugin.params.extraParams.ttsParams)if("string"==typeof t.jSPlugin.params.extraParams.ttsParams)window.EZUIKit.opt.ttsUrl+="&"+t.jSPlugin.params.extraParams.ttsParams;else if("object"===b(t.jSPlugin.params.extraParams.ttsParams))for(var r in t.jSPlugin.params.extraParams.ttsParams)window.EZUIKit.opt.ttsUrl+="&"+r+"="+t.jSPlugin.params.extraParams.ttsParams[r];window.EZUIKit.opt.deviceSerial=A(t.jSPlugin.url).deviceSerial,window.EZUIKit.opt.channelNo=t.talkChannelNo||"0";var s="talk?dev="+window.EZUIKit.opt.deviceSerial+"&chann="+window.EZUIKit.opt.channelNo+"&encodetype=2";window.EZUIKit.opt.talkLink=window.EZUIKit.opt.ttsUrl.split("?")[0]+"/"+s,o.ttsUrl.indexOf("gb28181")>-1&&(window.EZUIKit.opt.talkType="gb28181"),e&&e(o.ttsUrl.indexOf("gb28181")>-1||-1!==window.EZUIKit.opt.deviceSerial.indexOf(":")),window.EZUIKit.opt.stream=t.jSPlugin.accessToken?o.stream:t.jSPlugin.token.streamToken.talk,window.startTalk({customizeStream:n._customizeStream.bind(n),audio:!t.microphoneId||{deviceId:t.microphoneId}}),t.observeVolumeChange(),t.jSPlugin.eventEmitter&&t.jSPlugin.eventEmitter.emit("startTalk",{eventType:"startTalk",code:0,target:t,msg:"开启对讲"})}}else console.log(i.code,t.jSPlugin.i18n.t("38"+i.code)),t.pluginStatus.loadingSetText({text:i.msg||t.jSPlugin.i18n.t("38"+i.code),color:"red",delayClear:2e3}),t.jSPlugin.eventEmitter&&t.jSPlugin.eventEmitter.emit("startTalk",{eventType:"startTalk",code:-1,target:t,msg:i.msg||t.jSPlugin.i18n.t("38"+i.code)}),"function"==typeof t.jSPlugin.params.handleError&&t.jSPlugin.params.handleError({msg:i.msg||t.jSPlugin.i18n.t("38"+i.code),retcode:i.code,id:t.jSPlugin.params.id,type:"handleError"})})).catch((function(e){console.log("err",e)}))})).catch((function(e){console.log("对讲开启失败:",e)}))}},{key:"stopTalk",value:function(){var e=this;try{window.stopTalk()}catch(e){console.log("stopTalk error:",e)}this.gainNode=null,clearInterval(this.volumeChangeInterval),this.volumeChangeInterval=null,this.jSPlugin.eventEmitter&&(setTimeout((function(){e.jSPlugin.eventEmitter.emit("volumeChange",{eventType:"volumeChange",code:0,target:e,data:0,msg:"音量变化"})}),200),this.jSPlugin.eventEmitter.emit("stopTalk",{eventType:"stopTalk",code:0,target:this,msg:"结束对讲"})),document.getElementById("myaudio")&&document.getElementById("myaudio").srcObject&&document.getElementById("myaudio").srcObject.getTracks()[0].stop()}},{key:"changeTalkChannelNo",value:function(e){window.EZUIKit.opt&&window.EZUIKit.opt.channelNo&&(this.talkChannelNo=e,window.EZUIKit.opt.channelNo=e)}},{key:"_customizeStream",value:function(e){var t=this;return new Promise((function(n,i){var o,a=new window.AudioContext;t.gainNode=a.createGain();var r=a.createMediaStreamSource(e);t.gainNode.gain.value=null!==(o=t.volumeGain)&&void 0!==o?o:1;var s=a.createMediaStreamDestination();r.connect(t.gainNode),t.gainNode.connect(s),n(s.stream)}))}},{key:"setVolumeGain",value:function(e){var t=["",null].includes(e)?1:Number(e);return"number"==typeof t&&t>=0?(this.volumeGain=Math.min(t,10),this.gainNode&&(this.gainNode.gain.value=this.volumeGain),{code:0,msg:"成功",res:null}):{code:-1,msg:"参数格式有误",res:null}}},{key:"observeVolumeChange",value:function(){var e=this,t=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).interval,n=void 0===t?100:t;this.volumeChangeInterval&&(clearInterval(volumeChangeInterval),volumeChangeInterval=null),this.volumeChangeInterval=setInterval((function(){var t,n,i,o,a;null===(t=window.tts)||void 0===t||null===(n=t.webrtcStuff)||void 0===n||null===(i=n.pc)||void 0===i||null===(o=i.getStats)||void 0===o||null===(a=o.call(i))||void 0===a||a.then((function(t){t.forEach((function(t){var n,i;"media-source"===t.type&&(null===(n=e.jSPlugin)||void 0===n||null===(i=n.eventEmitter)||void 0===i||i.emit("volumeChange",{eventType:"volumeChange",code:0,target:e,data:t.audioLevel,msg:"音量变化"}))}))}))}),n)}},{key:"getMicrophonePermission",value:function(){return new Promise((function(e,t){navigator.mediaDevices.getUserMedia({audio:!0}).then((function(t){t.getTracks().forEach((function(e){e.stop()})),e({code:0,msg:"成功",res:null})})).catch((function(t){e({code:-1,msg:"获取麦克风权限失败",res:t})}))}))}},{key:"getMicrophonesList",value:function(){return new Promise((function(e,t){navigator.mediaDevices?navigator.mediaDevices.enumerateDevices().then((function(t){var n=[];t.map((function(e){"audioinput"==e.kind&&n.push(e)})),e({code:0,msg:"成功",res:n})})):e({code:-1,msg:"未查询到相关设备",res:null})}))}},{key:"setProfile",value:function(e){var t=this,n=e.microphoneId;n!==this.microphoneId&&(this.microphoneId=n,this.gainNode&&(window.stopTalk(),setTimeout((function(){window.startTalk({customizeStream:t._customizeStream.bind(t),audio:!t.microphoneId||{deviceId:t.microphoneId}})}),200)))}}])}(),ke=function(){function e(t){var n=this;l(this,e),this.jSPlugin=t,this.pluginStatus=new U(this,this.jSPlugin.id),e._instanceStyle();var i=document.createElement("div");i.className="mobile-ez-ptz-container",i.id="mobile-ez-ptz-container";var o=window.innerHeight;i.style="display:inline-block;width: ".concat(this.jSPlugin.width,"px;text-align:center;height: ").concat(o-this.jSPlugin.height-5,"px");var a=document.createElement("div");a.className="live-ptz-title",a.id="live-ptz-title",a.innerHTML=this.jSPlugin.i18n.t("BTN_PTZ"),document.getElementById("live-ptz-title")||i.appendChild(a);var r=document.createElement("div");r.className="live-ptz-intro",r.id="live-ptz-intro",r.innerHTML=this.jSPlugin.i18n.t("MOBILE_PTZ_TIPS"),document.getElementById("live-ptz-intro")||i.appendChild(r);var s=document.createElement("div");s.id="mobile-ez-ptz-item",s.className="mobile-ez-ptz-wrap",s.innerHTML='\n <div class="mobile-ez-ptz-container" id="mobile-ez-ptz-container">\n <div class="ez-ptz-main center"></div>\n <div class="mobile-ez-ptz-icon top default"></div>\n <div class="mobile-ez-ptz-icon left default"></div>\n <div class="mobile-ez-ptz-icon bottom default"></div>\n <div class="mobile-ez-ptz-icon right default"></div>\n </div>\n ',document.getElementById("mobile-ez-ptz-item")||i.appendChild(s),x(i,document.getElementById("".concat(this.jSPlugin.id,"-wrap"))),document.getElementById("mobile-ez-ptz-item").ontouchstart=function(e){e.preventDefault(),console.log("触摸开始"),n._handlePtzTouch(e,"start")},document.getElementById("mobile-ez-ptz-item").ontouchend=function(e){e.preventDefault(),console.log("触摸结束",e),n._handlePtzTouch(e,"stop")},document.getElementById("mobile-ez-ptz-item").onmousedown=function(e){e.preventDefault(),console.log("触摸开始"),n._handlePtzTouch(e,"start")},document.getElementById("mobile-ez-ptz-item").onmouseup=function(e){e.preventDefault(),console.log("触摸结束",e),n._handlePtzTouch(e,"stop")}}return m(e,[{key:"show",value:function(){document.getElementById("mobile-ez-ptz-container").style="display: inline-block"}},{key:"hide",value:function(){document.getElementById("mobile-ez-ptz-container").style="display: none"}},{key:"_handlePtzTouch",value:function(e,t){var n=this,i=document.getElementById("mobile-ez-ptz-item").getBoundingClientRect(),o=i.left+130,a=i.top+130,r=(e.x||e.changedTouches[0].clientX)-o,s=(e.y||e.changedTouches[0].clientY)-a,c=0,l=this.jSPlugin.env.domain+"/api/lapp/device/ptz/start",d=this.jSPlugin.accessToken||this.jSPlugin.token.deviceToken.video;Math.abs(r)>Math.abs(s)?r>0?(c=3,document.getElementsByClassName("mobile-ez-ptz-icon")[3].className=document.getElementsByClassName("mobile-ez-ptz-icon")[3].className.replace("default","active")):(c=2,document.getElementsByClassName("mobile-ez-ptz-icon")[1].className=document.getElementsByClassName("mobile-ez-ptz-icon")[1].className.replace("default","active")):s>0?(c=1,document.getElementsByClassName("mobile-ez-ptz-icon")[2].className=document.getElementsByClassName("mobile-ez-ptz-icon")[2].className.replace("default","active")):(c=0,document.getElementsByClassName("mobile-ez-ptz-icon")[0].className=document.getElementsByClassName("mobile-ez-ptz-icon")[0].className.replace("default","active")),document.getElementById("mobile-ez-ptz-item").style="background-image:linear-gradient(".concat(0===c?180:1===c?0:2===c?90:270,"deg, #c0ddf1 0%, rgba(100,143,252,0.00) 50%)"),"stop"===t&&(l=this.jSPlugin.env.domain+"/api/lapp/device/ptz/stop",d=this.jSPlugin.accessToken||this.jSPlugin.token.deviceToken.video,document.getElementById("mobile-ez-ptz-item").style="",document.getElementsByClassName("mobile-ez-ptz-icon")[3].className=document.getElementsByClassName("mobile-ez-ptz-icon")[3].className.replace("active","default"),document.getElementsByClassName("mobile-ez-ptz-icon")[1].className=document.getElementsByClassName("mobile-ez-ptz-icon")[1].className.replace("active","default"),document.getElementsByClassName("mobile-ez-ptz-icon")[2].className=document.getElementsByClassName("mobile-ez-ptz-icon")[2].className.replace("active","default"),document.getElementsByClassName("mobile-ez-ptz-icon")[0].className=document.getElementsByClassName("mobile-ez-ptz-icon")[0].className.replace("active","default"));var u=new FormData;u.append("deviceSerial",A(this.jSPlugin.url).deviceSerial),u.append("channelNo",A(this.jSPlugin.url).channelNo),u.append("speed",1),u.append("direction",c),u.append("accessToken",d),fetch(l,{method:"POST",body:u}).then((function(e){return e.json()})).then((function(e){if(200==e.code);else{console.log(e.code,n.jSPlugin.i18n.t("38"+e.code));var t=n.jSPlugin.i18n.t("38"+e.code)||e.msg;n.pluginStatus.loadingSetText({text:t,color:"red",delayClear:2e3}),60005!=e.code&&60002!=e.code&&60003!=e.code&&60004!=e.code||(document.getElementById("mobile-ez-ptz-item").style="background-image:linear-gradient(".concat(0===c?180:1===c?0:2===c?90:270,"deg, #f45656 0%, rgba(100,143,252,0.00) 50%)"))}})).catch((function(e){console.log("云台调用异常",e)}))}}],[{key:"_instanceStyle",value:function(){e._STYLE||(e._STYLE=document.createElement("style"),e._STYLE.innerHTML="\n body{\n padding: 0;\n margin: 0;\n }\n #mobile-ez-ptz-container {\n display: inline-block;\n width: 375px;\n text-align: center;\n }\n .live-ptz-title{\n height: 25px;\n font-size: 18px;\n color: #2c2c2c;\n text-align: center;\n font-weight: 700;\n margin: 24px 0 12px;\n }\n .live-ptz-intro {\n margin-bottom: 24px;\n color: #aaaaaa;\n }\n .mobile-ez-ptz-wrap {\n background-image: linear-gradient(180deg, #f6f8ff 0%, #ededed6b 50%)\n }\n #mobile-ez-ptz-container .mobile-ez-ptz-container {\n position: relative;\n width: 260px;\n height: 260px;\n background: rgba(255, 255, 255, 0.80);\n border: 1px solid rgba(255, 255, 255, 0.80);\n border-radius: 100%;\n cursor: pointer;\n overflow: hidden;\n margin: auto;\n }\n\n #mobile-ez-ptz-container .mobile-ez-ptz-container .mobile-ez-ptz-icon.top {\n width: 0;\n height: 0;\n border-left: 6px solid transparent;\n border-right: 6px solid transparent;\n border-bottom: 6px solid #aaaaaa;\n position: absolute;\n display: inline-block;\n left: calc(50% - 6px);\n top: 10px;\n }\n\n #mobile-ez-ptz-container .mobile-ez-ptz-container .mobile-ez-ptz-icon.top.active {\n border-bottom-color: #1890FF;\n }\n\n #mobile-ez-ptz-container .mobile-ez-ptz-container .mobile-ez-ptz-icon.bottom {\n width: 0;\n height: 0;\n border-left: 6px solid transparent;\n border-right: 6px solid transparent;\n border-top: 6px solid #aaaaaa;\n position: absolute;\n display: inline-block;\n left: calc(50% - 6px);\n bottom: 10px;\n }\n\n #mobile-ez-ptz-container .mobile-ez-ptz-container .mobile-ez-ptz-icon.bottom.active {\n border-top-color: #1890FF;\n\n }\n\n #mobile-ez-ptz-container .mobile-ez-ptz-container .mobile-ez-ptz-icon.right {\n width: 0;\n height: 0;\n border-top: 6px solid transparent;\n border-bottom: 6px solid transparent;\n border-left: 6px solid #aaaaaa;\n position: absolute;\n display: inline-block;\n top: calc(50% - 6px);\n right: 10px;\n }\n\n #mobile-ez-ptz-container .mobile-ez-ptz-container .mobile-ez-ptz-icon.right.active {\n border-left-color: #1890FF;\n\n }\n\n #mobile-ez-ptz-container .mobile-ez-ptz-container .mobile-ez-ptz-icon.left {\n width: 0;\n height: 0;\n border-top: 6px solid transparent;\n border-bottom: 6px solid transparent;\n border-right: 6px solid #aaaaaa;\n position: absolute;\n display: inline-block;\n top: calc(50% - 6px);\n left: 10px;\n }\n\n #mobile-ez-ptz-container .mobile-ez-ptz-container .mobile-ez-ptz-icon.left.active {\n border-right-color: #1890FF;\n\n }\n\n #mobile-ez-ptz-container .mobile-ez-ptz-container .ez-ptz-main.center {\n width: 52px;\n height: 52px;\n background: #FFFFFF;\n border: 2px solid #eee;\n border-radius: 100%;\n top: calc(50% - 26px);\n left: calc(50% - 26px);\n position: absolute;\n /* box-shadow: 0px -39px 40px 6px #1890ff; */\n }\n\n #mobile-ez-ptz-container .mobile-ez-ptz-wrap {\n display: inline-block;\n padding: 24px 24px;\n border-radius: 100%;\n overflow: hidden;\n }\n\n #mobile-ez-ptz-container .ez-ptz-close {\n position: absolute;\n color: #FFFFFF;\n top: 0;\n right: 0px;\n }",document.getElementsByTagName("head")[0].appendChild(e._STYLE))}}])}();p(ke,"_STYLE",void 0);var Ce={header:{color:"#FFFFFF",backgroundColor:"rgba(0,0,0,0.8)",activeColor:"#1890FF",btnList:[{btnKey:"c1cbc1d4e86d49a0981f54beea95280a-f7896c8942c9476fb439370dd974f1c0-header-0",iconId:"deviceID",part:"left",defaultActive:0,isrender:0,themeId:"f7896c8942c9476fb439370dd974f1c0"},{btnKey:"c1cbc1d4e86d49a0981f54beea95280a-f7896c8942c9476fb439370dd974f1c0-header-1",iconId:"deviceName",part:"left",defaultActive:0,isrender:0,themeId:"f7896c8942c9476fb439370dd974f1c0"},{btnKey:"c1cbc1d4e86d49a0981f54beea95280a-f7896c8942c9476fb439370dd974f1c0-header-2",iconId:"cloudRec",part:"right",defaultActive:0,isrender:0,themeId:"f7896c8942c9476fb439370dd974f1c0"},{btnKey:"c1cbc1d4e86d49a0981f54beea95280a-f7896c8942c9476fb439370dd974f1c0-header-3",iconId:"rec",part:"right",defaultActive:0,isrender:0,themeId:"f7896c8942c9476fb439370dd974f1c0"}]},footer:{color:"#FFFFFF",backgroundColor:"rgb(0 0 0 / 0%)",activeColor:"#1890FF",btnList:[{btnKey:"c1cbc1d4e86d49a0981f54beea95280a-f7896c8942c9476fb439370dd974f1c0-footer-0",iconId:"play",part:"left",defaultActive:1,isrender:0,themeId:"f7896c8942c9476fb439370dd974f1c0"},{btnKey:"c1cbc1d4e86d49a0981f54beea95280a-f7896c8942c9476fb439370dd974f1c0-footer-1",iconId:"capturePicture",part:"left",defaultActive:0,isrender:0,themeId:"f7896c8942c9476fb439370dd974f1c0"},{btnKey:"c1cbc1d4e86d49a0981f54beea95280a-f7896c8942c9476fb439370dd974f1c0-footer-2",iconId:"sound",part:"left",defaultActive:0,isrender:0,themeId:"f7896c8942c9476fb439370dd974f1c0"},{btnKey:"c1cbc1d4e86d49a0981f54beea95280a-f7896c8942c9476fb439370dd974f1c0-footer-3",iconId:"pantile",part:"left",defaultActive:0,isrender:0,themeId:"f7896c8942c9476fb439370dd974f1c0"},{btnKey:"c1cbc1d4e86d49a0981f54beea95280a-f7896c8942c9476fb439370dd974f1c0-footer-4",iconId:"recordvideo",part:"left",defaultActive:0,isrender:0,themeId:"f7896c8942c9476fb439370dd974f1c0"},{btnKey:"c1cbc1d4e86d49a0981f54beea95280a-f7896c8942c9476fb439370dd974f1c0-footer-5",iconId:"talk",part:"left",defaultActive:0,isrender:0,themeId:"f7896c8942c9476fb439370dd974f1c0"},{btnKey:"c1cbc1d4e86d49a0981f54beea95280a-f7896c8942c9476fb439370dd974f1c0-footer-6",iconId:"hd",part:"right",defaultActive:0,isrender:0,themeId:"f7896c8942c9476fb439370dd974f1c0"},{btnKey:"c1cbc1d4e86d49a0981f54beea95280a-f7896c8942c9476fb439370dd974f1c0-footer-7",iconId:"webExpend",part:"right",defaultActive:0,isrender:0,themeId:"f7896c8942c9476fb439370dd974f1c0"},{btnKey:"c1cbc1d4e86d49a0981f54beea95280a-f7896c8942c9476fb439370dd974f1c0-footer-8",iconId:"expend",part:"right",defaultActive:0,isrender:0,themeId:"f7896c8942c9476fb439370dd974f1c0"}]}},Ie={data:{header:{color:"#FFFFFF",backgroundColor:"rgba(0,0,0,0.8)",activeColor:"#1890FF",btnList:[{iconId:"deviceID",part:"left",defaultActive:0,isrender:1},{iconId:"deviceName",part:"left",defaultActive:0,isrender:1},{iconId:"cloudRec",part:"right",defaultActive:0,isrender:0},{iconId:"rec",part:"right",defaultActive:0,isrender:0}]},footer:{color:"#FFFFFF",backgroundColor:"rgba(0,0,0,0.8)",activeColor:"#1890FF",btnList:[{iconId:"play",part:"left",defaultActive:1,isrender:1},{iconId:"capturePicture",part:"left",defaultActive:0,isrender:1},{iconId:"sound",part:"left",defaultActive:1,isrender:1},{iconId:"pantile",part:"left",defaultActive:0,isrender:1},{iconId:"recordvideo",part:"left",defaultActive:0,isrender:1},{iconId:"talk",part:"left",defaultActive:0,isrender:1},{iconId:"zoom",part:"left",defaultActive:0,isrender:1},{iconId:"hd",part:"right",defaultActive:0,isrender:1},{iconId:"webExpend",part:"right",defaultActive:0,isrender:0},{iconId:"expend",part:"right",defaultActive:0,isrender:1}]}}},xe={data:{header:{color:"#FFFFFF",backgroundColor:"rgba(0,0,0,0.8)",activeColor:"#1890FF",btnList:[{iconId:"deviceID",part:"left",defaultActive:0,isrender:1},{iconId:"deviceName",part:"left",defaultActive:0,isrender:1},{iconId:"cloudRec",part:"right",defaultActive:0,isrender:1},{iconId:"rec",part:"right",defaultActive:0,isrender:1}]},footer:{color:"#FFFFFF",backgroundColor:"rgba(0,0,0,0.8)",activeColor:"#1890FF",btnList:[{iconId:"play",part:"left",defaultActive:1,isrender:1},{iconId:"capturePicture",part:"left",defaultActive:0,isrender:1},{iconId:"sound",part:"left",defaultActive:1,isrender:1},{iconId:"pantile",part:"left",defaultActive:0,isrender:0},{iconId:"recordvideo",part:"left",defaultActive:0,isrender:1},{iconId:"talk",part:"left",defaultActive:0,isrender:0},{iconId:"zoom",part:"left",defaultActive:0,isrender:1},{iconId:"speed",part:"right",defaultActive:0,isrender:1},{iconId:"hd",part:"right",defaultActive:0,isrender:0},{iconId:"webExpend",part:"right",defaultActive:0,isrender:0},{iconId:"expend",part:"right",defaultActive:0,isrender:1}]}}},je={data:{header:{color:"#FFFFFF",backgroundColor:"rgba(0,0,0,0.8)",activeColor:"#1890FF",btnList:[{btnKey:"c1cbc1d4e86d49a0981f54beea95280a-f7896c8942c9476fb439370dd974f1c0-header-0",iconId:"deviceID",part:"left",defaultActive:0,isrender:1},{btnKey:"c1cbc1d4e86d49a0981f54beea95280a-f7896c8942c9476fb439370dd974f1c0-header-1",iconId:"deviceName",part:"left",defaultActive:0,isrender:1},{btnKey:"c1cbc1d4e86d49a0981f54beea95280a-f7896c8942c9476fb439370dd974f1c0-header-2",iconId:"cloudRec",part:"right",defaultActive:0,isrender:0},{btnKey:"c1cbc1d4e86d49a0981f54beea95280a-f7896c8942c9476fb439370dd974f1c0-header-3",iconId:"rec",part:"right",defaultActive:0,isrender:0}]},footer:{color:"#FFFFFF",backgroundColor:"rgba(0,0,0,0.8)",activeColor:"#1890FF",btnList:[{iconId:"play",part:"left",defaultActive:1,isrender:1},{iconId:"capturePicture",part:"left",defaultActive:0,isrender:1},{iconId:"sound",part:"left",defaultActive:1,isrender:1},{iconId:"pantile",part:"left",defaultActive:0,isrender:1},{iconId:"recordvideo",part:"left",defaultActive:0,isrender:1},{iconId:"talk",part:"left",defaultActive:0,isrender:1},{iconId:"zoom",part:"left",defaultActive:0,isrender:1},{iconId:"speed",part:"right",defaultActive:0,isrender:0},{iconId:"hd",part:"right",defaultActive:0,isrender:1},{iconId:"webExpend",part:"right",defaultActive:0,isrender:1},{iconId:"expend",part:"right",defaultActive:0,isrender:1}]}}},Ae={data:{header:{color:"#FFFFFF",backgroundColor:"rgba(0,0,0,0.8)",activeColor:"#1890FF",btnList:[{btnKey:"c1cbc1d4e86d49a0981f54beea95280a-f7896c8942c9476fb439370dd974f1c0-header-0",iconId:"deviceID",part:"left",defaultActive:0,isrender:1},{btnKey:"c1cbc1d4e86d49a0981f54beea95280a-f7896c8942c9476fb439370dd974f1c0-header-1",iconId:"deviceName",part:"left",defaultActive:0,isrender:1},{btnKey:"c1cbc1d4e86d49a0981f54beea95280a-f7896c8942c9476fb439370dd974f1c0-header-2",iconId:"cloudRec",part:"right",defaultActive:0,isrender:0},{btnKey:"c1cbc1d4e86d49a0981f54beea95280a-f7896c8942c9476fb439370dd974f1c0-header-3",iconId:"rec",part:"right",defaultActive:0,isrender:0}]},footer:{color:"#FFFFFF",backgroundColor:"rgba(0,0,0,0.8)",activeColor:"#1890FF",btnList:[{iconId:"play",part:"left",defaultActive:1,isrender:1},{iconId:"talk",part:"left",defaultActive:0,isrender:1},{iconId:"sound",part:"left",defaultActive:1,isrender:1},{iconId:"capturePicture",part:"left",defaultActive:0,isrender:1},{iconId:"recordvideo",part:"left",defaultActive:0,isrender:1},{iconId:"pantile",part:"left",defaultActive:0,isrender:0},{iconId:"zoom",part:"left",defaultActive:0,isrender:1},{iconId:"hd",part:"right",defaultActive:0,isrender:1},{iconId:"webExpend",part:"right",defaultActive:0,isrender:0},{iconId:"expend",part:"right",defaultActive:0,isrender:1}]}}},De={data:{header:{color:"#FFFFFF",backgroundColor:"rgba(0,0,0,0.8)",activeColor:"#1890FF",btnList:[{iconId:"deviceID",part:"left",defaultActive:0,isrender:0},{iconId:"deviceName",part:"left",defaultActive:0,isrender:0},{iconId:"cloudRec",part:"right",defaultActive:0,isrender:0},{iconId:"rec",part:"right",defaultActive:0,isrender:0}]},footer:{color:"#FFFFFF",backgroundColor:"#000000",activeColor:"#1890FF",btnList:[{iconId:"play",part:"left",defaultActive:1,isrender:0},{iconId:"capturePicture",part:"left",defaultActive:0,isrender:0},{iconId:"sound",part:"left",defaultActive:1,isrender:0},{iconId:"pantile",part:"left",defaultActive:0,isrender:0},{iconId:"recordvideo",part:"left",defaultActive:0,isrender:0},{iconId:"talk",part:"left",defaultActive:0,isrender:0},{iconId:"zoom",part:"left",defaultActive:0,isrender:0},{iconId:"hd",part:"right",defaultActive:0,isrender:0},{iconId:"webExpend",part:"right",defaultActive:0,isrender:0},{iconId:"expend",part:"right",defaultActive:0,isrender:0}]}}},Re={data:{header:{color:"#FFFFFF",backgroundColor:"rgba(0,0,0,0.8)",activeColor:"#1890FF",btnList:[{iconId:"deviceID",part:"left",defaultActive:0,isrender:1},{iconId:"deviceName",part:"left",defaultActive:0,isrender:1},{iconId:"cloudRec",part:"right",defaultActive:0,isrender:0},{iconId:"rec",part:"right",defaultActive:0,isrender:0}]},footer:{color:"#FFFFFF",backgroundColor:"rgba(0,0,0,0.8)",activeColor:"#1890FF",btnList:[{iconId:"play",part:"left",defaultActive:1,isrender:1},{iconId:"capturePicture",part:"left",defaultActive:0,isrender:0},{iconId:"talk",part:"left",defaultActive:0,isrender:1},{iconId:"sound",part:"left",defaultActive:1,isrender:1},{iconId:"pantile",part:"left",defaultActive:0,isrender:0},{iconId:"recordvideo",part:"left",defaultActive:0,isrender:0},{iconId:"hd",part:"right",defaultActive:0,isrender:0},{iconId:"zoom",part:"left",defaultActive:0,isrender:0},{iconId:"webExpend",part:"right",defaultActive:0,isrender:0},{iconId:"expend",part:"right",defaultActive:0,isrender:1}]}}},Le={data:{header:{color:"#FFFFFF",backgroundColor:"rgba(0,0,0,0.8)",activeColor:"#1890FF",btnList:[{iconId:"deviceID",part:"left",defaultActive:0,isrender:1},{iconId:"deviceName",part:"left",defaultActive:0,isrender:1},{iconId:"cloudRec",part:"right",defaultActive:0,isrender:1},{iconId:"cloudRecord",part:"right",defaultActive:0,isrender:1},{iconId:"rec",part:"right",defaultActive:0,isrender:1}]},footer:{color:"#FFFFFF",backgroundColor:"rgba(0,0,0,0.8)",activeColor:"#1890FF",btnList:[{iconId:"play",part:"left",defaultActive:1,isrender:1},{iconId:"capturePicture",part:"left",defaultActive:0,isrender:1},{iconId:"sound",part:"left",defaultActive:1,isrender:1},{iconId:"pantile",part:"left",defaultActive:0,isrender:0},{iconId:"recordvideo",part:"left",defaultActive:0,isrender:1},{iconId:"zoom",part:"left",defaultActive:0,isrender:1},{iconId:"speed",part:"right",defaultActive:0,isrender:1},{iconId:"hd",part:"right",defaultActive:0,isrender:0},{iconId:"webExpend",part:"right",defaultActive:0,isrender:1},{iconId:"expend",part:"right",defaultActive:0,isrender:1}]}}},Be={data:{header:{color:"#FFFFFF",backgroundColor:"rgba(0,0,0,0.8)",activeColor:"#1890FF",btnList:[{iconId:"deviceID",part:"left",defaultActive:0,isrender:0},{iconId:"deviceName",part:"left",defaultActive:0,isrender:0},{iconId:"cloudRec",part:"right",defaultActive:0,isrender:0},{iconId:"rec",part:"right",defaultActive:0,isrender:0}]},footer:{color:"#FFFFFF",backgroundColor:"#00000080",activeColor:"#1890FF",btnList:[{iconId:"play",part:"left",defaultActive:1,isrender:0},{iconId:"capturePicture",part:"left",defaultActive:0,isrender:0},{iconId:"sound",part:"left",defaultActive:1,isrender:0},{iconId:"pantile",part:"left",defaultActive:0,isrender:0},{iconId:"recordvideo",part:"left",defaultActive:0,isrender:0},{iconId:"talk",part:"left",defaultActive:0,isrender:0},{iconId:"zoom",part:"left",defaultActive:0,isrender:0},{iconId:"speed",part:"right",defaultActive:0,isrender:0},{iconId:"hd",part:"right",defaultActive:0,isrender:0},{iconId:"webExpend",part:"right",defaultActive:0,isrender:0},{iconId:"expend",part:"right",defaultActive:0,isrender:0}]}}},Me=[{autoFocus:5,createTime:"2021-06-14T08:04:37.000Z",themeId:"pcLive",themeIntro:"PC直播全量版",themeName:"PC直播全量版",themeType:"webLive",updateTime:"2021-06-14T08:04:37.000Z",label:"官方",labelPic:"https://resource.eziot.com/group1/M00/00/8A/CtwQEmLr_DmANlElAAA-xyivSaw030.png",poster:"https://resource.eziot.com/group1/M00/00/89/CtwQEmLl8r-AZU7wAAETKlvgerU237.png",header:je.data.header,footer:je.data.footer},{autoFocus:5,createTime:"2021-06-14T08:04:37.000Z",themeId:"security",themeIntro:"PC直播安防版",themeName:"PC直播安防版",themeType:"webLive",updateTime:"2021-06-14T08:04:37.000Z",label:"官方",labelPic:"https://resource.eziot.com/group1/M00/00/8A/CtwQEmLr_DmANlElAAA-xyivSaw030.png",poster:"https://resource.eziot.com/group1/M00/00/89/CtwQEmLl8r-AZU7wAAETKlvgerU237.png",header:Ae.data.header,footer:Ae.data.footer},{autoFocus:5,createTime:"2021-06-14T08:04:37.000Z",themeId:"voice",themeIntro:"PC直播语音版",themeName:"PC直播语音版",themeType:"webLive",updateTime:"2021-06-14T08:04:37.000Z",label:"官方",labelPic:"https://resource.eziot.com/group1/M00/00/8A/CtwQEmLr_DmANlElAAA-xyivSaw030.png",poster:"https://resource.eziot.com/group1/M00/00/89/CtwQEmLl8r-AZU7wAAETKlvgerU237.png",header:Re.data.header,footer:Re.data.footer},{autoFocus:5,createTime:"2021-06-14T08:04:37.000Z",themeId:"simple",themeIntro:"PC直播极简版",themeName:"PC直播极简版",themeType:"webLive",updateTime:"2021-06-14T08:04:37.000Z",label:"官方",labelPic:"https://resource.eziot.com/group1/M00/00/8A/CtwQEmLr_DmANlElAAA-xyivSaw030.png",poster:"",header:De.data.header,footer:De.data.footer},{autoFocus:5,createTime:"2021-06-14T08:04:37.000Z",themeId:"pcRec",themeIntro:"PC回放全量版",themeName:"PC回放全量版",themeType:"webRec",updateTime:"2021-06-14T08:04:37.000Z",label:"官方",labelPic:"https://resource.eziot.com/group1/M00/00/8A/CtwQEmLr_DmANlElAAA-xyivSaw030.png",poster:"https://resource.eziot.com/group1/M00/00/89/CtwQEmLl8r-AZU7wAAETKlvgerU237.png",header:Le.data.header,footer:Le.data.footer},{autoFocus:5,createTime:"2021-06-14T08:04:37.000Z",themeId:"mobileLive",themeIntro:"Mobile直播全量版",themeName:"Mobile直播全量版",themeType:"mobileLive",updateTime:"2021-06-14T08:04:37.000Z",label:"官方",labelPic:"https://resource.eziot.com/group1/M00/00/8A/CtwQEmLr_GmAL5IhAABZs1vUK0s564.png",poster:"https://resource.eziot.com/group1/M00/00/89/CtwQEmLl8r-AZU7wAAETKlvgerU237.png",header:Ie.data.header,footer:Ie.data.footer},{autoFocus:5,createTime:"2021-06-14T08:04:37.000Z",themeId:"mobileRec",themeIntro:"Mobile回放全量版",themeName:"Mobile回放全量版",themeType:"mobileRec",updateTime:"2021-06-14T08:04:37.000Z",label:"官方",labelPic:"https://resource.eziot.com/group1/M00/00/8A/CtwQEmLr_GmAL5IhAABZs1vUK0s564.png",poster:"https://resource.eziot.com/group1/M00/00/89/CtwQEmLl8r-AZU7wAAETKlvgerU237.png",header:xe.data.header,footer:xe.data.footer},{autoFocus:0,createTime:"2021-06-14T08:04:37.000Z",themeId:"miniRec",themeIntro:"Mobile回放全量版",themeName:"Mobile回放全量版",themeType:"mobileRec",updateTime:"2021-06-14T08:04:37.000Z",label:"官方",labelPic:"https://resource.eziot.com/group1/M00/00/8A/CtwQEmLr_GmAL5IhAABZs1vUK0s564.png",poster:"",header:Be.data.header,footer:Be.data.footer}],Oe=function(){return m((function e(t){var n=this;l(this,e),this.jSPlugin=t,this.enableZoom=!1,this.videoWidth=1920,this.videoHeight=1080,this.currentScale=1,this.currentPosition={left:0,top:0,right:1920,bottom:1080},this.info={},this.clientRect=document.getElementById(t.id).getBoundingClientRect(),this.DOM=document.getElementById(t.id);var i=document.createElement("div");i.id="".concat(t.id,"-zoom-container");var o=document.getElementById("".concat(t.id,"-audioControls")),a=48;o&&(a=o.offsetHeight);var r=t.isMobile?"\n -webkit-transform: scale(0.8);\n -moz-transform: scale(0.8);\n -ms-transform: scale(0.8);\n transform: scale(0.8);\n transform-origin: left bottom;":"";i.style="position: absolute;\n display:none;\n left: 12px;\n bottom: ".concat(t.isMobile?"".concat(a+6,"px"):"80px",";\n ").concat(r,"\n ");var s='\n <div\n style="display: inline-flex;justify-content: space-between;flex-direction: column;width: 36px;height: 160px;background:rgba(0,0,0,0.60);border-radius: 2px;align-items: center;">\n <div id="'.concat(this.jSPlugin.id,'-scale-value" style="font-size: 12px;color:#FFFFFF;margin:10px 0; user-select: none;">2.0X</div>\n <div style="width: 20px;height: 20px;margin-bottom:4px;" id="').concat(this.jSPlugin.id,'-addScale">\n <?xml version="1.0" encoding="utf-8"?>\n <svg version="1.1" fill="#FFFFFF" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"\n viewBox="0 0 20 20" style="enable-background:new 0 0 20 20;" xml:space="preserve">\n <title>').concat(this.jSPlugin.i18n.t("ZOOM_ADD"),'</title>\n <g>\n <rect class="st0" width="20" height="20" fill="none"/>\n </g>\n <g>\n <path class="st1" d="M10,3.8c3.5,0,6.2,2.8,6.2,6.2s-2.8,6.2-6.2,6.2S3.8,13.5,3.8,10S6.5,3.8,10,3.8z M10,5c-2.8,0-5,2.2-5,5\n s2.2,5,5,5s5-2.2,5-5S12.8,5,10,5z"/>\n </g>\n <g>\n <path class="st2" d="M12.5,10.7h-5c-0.3,0-0.6-0.3-0.6-0.6s0.3-0.6,0.6-0.6h5c0.3,0,0.6,0.3,0.6,0.6S12.8,10.7,12.5,10.7z"/>\n </g>\n <g>\n <path class="st2" d="M10,13.2c-0.3,0-0.6-0.3-0.6-0.6v-5c0-0.3,0.3-0.6,0.6-0.6s0.6,0.3,0.6,0.6v5C10.6,12.9,10.3,13.2,10,13.2z"/>\n </g>\n </svg>\n </div>\n <div style="\n position: relative;\n width: 2px;\n height: 64px;\n border-radius: 2px;\n background: rgba(255,255,255,0.75);\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: flex-end;">\n <div class="scale-body-line-dot" id="').concat(this.jSPlugin.id,'-scale-body-line-dot" style="width: 6px;\n height: 6px;\n background: #FFFFFF;\n border-radius: 100%;\n position: absolute;\n border: 1px solid #407AFF;"></div>\n <div id="').concat(this.jSPlugin.id,'-line-dot" style="width: 2px;\n height: 0%;\n border-radius: 2px;\n background: #407AFF;\n bottom: 0;"></div>\n </div>\n <div style="width: 20px;height: 20px;margin: 4px 0 10px;" id="').concat(this.jSPlugin.id,'-subScale">\n <?xml version="1.0" encoding="utf-8"?>\n <svg fill="#FFFFFF" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"\n viewBox="0 0 20 20" style="enable-background:new 0 0 20 20;" xml:space="preserve">\n <title>').concat(this.jSPlugin.i18n.t("ZOOM_SUB"),'</title>\n <g>\n <rect class="st0" width="20" height="20" fill="none"/>\n </g>\n <g>\n <path class="st1" d="M10,3.8c3.5,0,6.2,2.8,6.2,6.2s-2.8,6.2-6.2,6.2S3.8,13.5,3.8,10S6.5,3.8,10,3.8z M10,5c-2.8,0-5,2.2-5,5\n s2.2,5,5,5s5-2.2,5-5S12.8,5,10,5z"/>\n </g>\n <g>\n <path class="st2" d="M12.5,10.7h-5c-0.3,0-0.6-0.3-0.6-0.6s0.3-0.6,0.6-0.6h5c0.3,0,0.6,0.3,0.6,0.6S12.8,10.7,12.5,10.7z"/>\n </g>\n </svg>\n </div>\n </div>\n ');i.innerHTML=s,document.getElementById("".concat(t.id,"-audioControls-left"))&&(document.getElementById("".concat(t.id,"-audioControls-left")).parentNode.appendChild(i),document.getElementById("".concat(t.id,"-addScale")).onclick=function(){n.addScale()},document.getElementById("".concat(t.id,"-subScale")).onclick=function(){n.subScale()}),this._event()}),[{key:"_event",value:function(){var e=this,t=setInterval((function(){var n=document.getElementById("".concat(e.jSPlugin.id,"-container-0"));clearInterval(t),e.jSPlugin.isMobile?n&&(n.addEventListener("touchstart",(function(t){return e.onTouchstart(t)})),n.addEventListener("touchend",(function(t){return e.onTouchend(t)}))):n&&(n.addEventListener("mousedown",(function(t){return e.onMouseDown(t)})),n.addEventListener("mouseup",(function(t){return e.onMouseUp(t)})))}),100)}},{key:"onMouseDown",value:function(e){if(1===this.currentScale)return!1;this.moveX=e.clientX,this.moveY=e.clientY}},{key:"onMouseUp",value:function(e){var t=this.currentPosition;if(1===this.currentScale)return!1;t.left=t.left-(e.clientX-this.moveX),t.top=t.top-(e.clientY-this.moveY),this.doScale()}},{key:"onTouchstart",value:function(e){if(1===this.currentScale)return!1;if(this.jSPlugin.use3DZoom||1===this.currentScale)return!1;if(!this.jSPlugin.beforeMobileZoomVerify())return!1;if(!this.inited){var t=this.jSPlugin.jSPlugin._JSPlayM4_GetFrameInfo(0);this.videoWidth=t.width,this.videoHeight=t.height,this.currentPosition.left=0,this.currentPosition.top=0,this.isMobileFullScreen?(this.currentPosition.right=t.height,this.currentPosition.bottom=t.width):(this.currentPosition.right=t.width,this.currentPosition.bottom=t.height),this.inited=!0}var n=e.touches[0];if(n){var i={clientX:0,clientY:0};i.clientX=n.clientX,i.clientY=n.clientY,this.point1=i}}},{key:"onTouchend",value:function(e){var t=this,n=this.currentPosition;if(1===this.currentScale)return!1;var i=e.changedTouches[0];this.isMobileFullScreen?(n.left=n.left-(i.clientY-t.point1.clientY),n.top=n.top+(i.clientX-t.point1.clientX)):(n.left=n.left-(i.clientX-t.point1.clientX),n.top=n.top-(i.clientY-t.point1.clientY)),t.doScale()}},{key:"renderDot",value:function(){var e=this.currentScale;document.getElementById("".concat(this.jSPlugin.id,"-scale-value"))&&(document.getElementById("".concat(this.jSPlugin.id,"-scale-value")).innerHTML="".concat(e,".0X")),document.getElementById("".concat(this.jSPlugin.id,"-line-dot"))&&(document.getElementById("".concat(this.jSPlugin.id,"-line-dot")).style.height="".concat((e-1)/7*100,"%")),document.getElementById("".concat(this.jSPlugin.id,"-scale-body-line-dot"))&&(document.getElementById("".concat(this.jSPlugin.id,"-scale-body-line-dot")).style.bottom="calc(".concat((e-1)/7*100,"% - 3px)"))}},{key:"getTopMostElement",value:function(e,t,n){var i=e?e.getBoundingClientRect():null,o=t?t.getBoundingClientRect():null,a=n?n.getBoundingClientRect():null;if(!i&&!o&&!a)return null;if(!i)return o.top<a.top?t:n;if(!o)return i.top<a.top?e:n;if(!a)return i.top<o.top?e:t;var r=[i.top,o.top,a.top],s=Math.max.apply(Math,r);return i.top===s?e:o.top===s?t:n}},{key:"handleFullscreen",value:function(e,t,n){this.clientRect={width:t,height:n}}},{key:"startZoom",value:function(){try{if(document.getElementById("".concat(this.jSPlugin.id,"-zoom-container"))&&(document.getElementById("".concat(this.jSPlugin.id,"-zoom-container")).style.display="block"),this.dpr="v1-soft"==this.jSPlugin.decodeEngine?1:this.jSPlugin.dpr,this.jSPlugin.jSPlugin)try{var e=this.jSPlugin.jSPlugin._JSPlayM4_GetFrameInfo(0);this.info=Object.assign({},e),this.videoWidth=(e.width||this.jSPlugin.width)*this.dpr,this.videoHeight=(e.height||this.jSPlugin.height)*this.dpr,this.currentPosition.right=e.width*this.dpr,this.currentPosition.bottom=e.height*this.dpr,this.jSPlugin.jSPlugin.bEZoom=!0}catch(e){}this.jSPlugin.eventEmitter&&this.jSPlugin.eventEmitter.emit("startZoom",{eventType:"startZoom",code:0,target:this,msg:"开启电子放大"}),this.renderDot(),this.enableZoom=!0}catch(e){this.jSPlugin.eventEmitter&&this.jSPlugin.eventEmitter.emit("startZoom",{eventType:"startZoom",code:-1,target:this,msg:e||"开启电子放大失败"})}}},{key:"stopZoom",value:function(){try{this._resetZoom(),this.jSPlugin.eventEmitter&&this.jSPlugin.eventEmitter.emit("stopZoom",{eventType:"stopZoom",code:0,target:this,msg:"关闭电子放大"}),document.getElementById("".concat(this.jSPlugin.id,"-zoom-container"))&&(document.getElementById("".concat(this.jSPlugin.id,"-zoom-container")).style.display="none")}catch(e){this.jSPlugin.eventEmitter&&this.jSPlugin.eventEmitter.emit("stopZoom",{eventType:"stopZoom",code:-1,target:this,msg:e||"关闭电子放大失败"})}}},{key:"_resetZoom",value:function(){this.currentScale=1,this.currentPosition.left=0,this.currentPosition.top=0,this.currentPosition.right=this.videoWidth,this.currentPosition.bottom=this.videoHeight,this._JSPlayM4_SetDisplayRegion(0,this.videoWidth,0,this.videoHeight,!1),this.renderDot(),this.enableZoom=!1}},{key:"doScale",value:function(){var e=this.currentPosition,t=this.currentScale,n=this.jSPlugin.jSPlugin._JSPlayM4_GetFrameInfo(0);if(console.log("info::",n),n.width!=this.info.width){var i=parseFloat(n.width/this.info.width);e.left=e.left*i*(i>1?1.25:.75),e.right=e.right*i*(i>1?1.25:.75),this.info.width=n.width,this.videoWidth=n.width*(i>1.25?1:.75)*this.dpr}if(n.height!=this.info.height){var o=parseFloat(n.height/this.info.height);e.top=e.top*o*(o>1?1.25:.75),e.bottom=e.bottom*o*(o>1?1.25:.75),this.info.height=n.height,this.videoHeight=n.height*(o>1?1.25:.75)*this.dpr}e.left=e.left+.5*(e.right-e.left-this.videoWidth/t),e.left<=0?e.left=0:e.left>this.videoWidth-this.videoWidth/t&&(e.left=this.videoWidth-this.videoWidth/t),e.right=e.left+this.videoWidth/t,e.top=e.top+.5*(e.bottom-e.top-this.videoHeight/t),e.top<=0?e.top=0:e.top>this.videoHeight-this.videoHeight/t&&(e.top=this.videoHeight-this.videoHeight/t),e.bottom=e.top+this.videoHeight/t,e.left=parseInt(e.left,10),e.right=parseInt(e.right,10),e.top=parseInt(e.top,10),e.bottom=parseInt(e.bottom,10);try{e.left<e.right&&e.top<e.bottom&&e.bottom<=this.videoHeight&&e.right<=this.videoWidth&&this._JSPlayM4_SetDisplayRegion(e.left,e.right,e.top,e.bottom,1!=t,this.isMobileFullScreen)}catch(e){console.log(e)}this.renderDot()}},{key:"addScale",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;return this.jSPlugin.eventEmitter&&this.jSPlugin.eventEmitter.emit("zoomAdd",{eventType:"zoomAdd",code:1,target:this,msg:"执行放大"}),this.currentScale>=8?(this.jSPlugin.Message&&this.jSPlugin.Message.default(this.jSPlugin.i18n.t("ZOOM_ADD_MAX"),document.getElementById("".concat(this.jSPlugin.id))),!1):(this.currentScale=this.currentScale+e,this.currentScale>8?(console.log("超出最大倍率"),this.jSPlugin.Message&&this.jSPlugin.Message.default(this.jSPlugin.i18n.t("ZOOM_LIMIT_MAX"),document.getElementById("".concat(this.jSPlugin.id))),!1):void this.doScale())}},{key:"subScale",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;return this.jSPlugin.eventEmitter&&this.jSPlugin.eventEmitter.emit("zoomSub",{eventType:"zoomSub",code:1,target:this,msg:"执行缩小"}),this.currentScale<=1?(this.jSPlugin.Message&&this.jSPlugin.Message.default(this.jSPlugin.i18n.t("ZOOM_SUB_MIN"),document.getElementById("".concat(this.jSPlugin.id))),!1):(this.currentScale=this.currentScale-e,this.currentScale<1?(this.jSPlugin.Message&&this.jSPlugin.Message.default(this.jSPlugin.i18n.t("ZOOM_LIMIT_MIN"),document.getElementById("".concat(this.jSPlugin.id))),!1):void this.doScale())}},{key:"_JSPlayM4_SetDisplayRegion",value:function(e,t,n,i,o){this.jSPlugin&&this.jSPlugin.jSPlugin&&(console.log("%c计算后,","color: red;",this.videoWidth,this.videoHeight,e,t,n,i,this.currentScale),this.jSPlugin.jSPlugin._JSPlayM4_SetDisplayRegion(e,t,n,i,o,this.isMobileFullScreen))}},{key:"isMobileFullScreen",get:function(){return!!(L()&&this.jSPlugin.Theme&&this.jSPlugin.Theme.decoderState&&this.jSPlugin.Theme.decoderState.state.expend)}}])}(),ze=[{videoLevel:1,streamTypeIn:2,type:"compatible"},{videoLevel:2,streamTypeIn:1,type:"compatible"}],Ne={0:"VIDEO_LEVEL_FLUENT",1:"VIDEO_LEVEL_SATNDARD",2:"VIDEO_LEVEL_HEIGH",3:"VIDEO_LEVEL_SPUER",4:"VIDEO_LEVEL_EXTREME",5:"VIDEO_LEVEL_3K",6:"VIDEO_LEVEL_4k"},Fe="8.1.6",Ue=function(e,t,n,i){var o="".concat(e.env.domain,"/api/service/media/template/getDetail?accessToken=").concat(e.accessToken||e.token.httpToken.url,"&id=").concat(t);fetch(o,{method:"GET"}).then((function(e){return e.json()})).then((function(e){var t;(t=e).meta&&n(t)})).catch((function(e){var t;t=e,console.log(t),i(t)}))},Ve=function(e){var t="".concat(e.env.domain,"/api/service/device/capacity/video/quality?accessToken=").concat(e.accessToken||e.token.deviceToken.video,"&deviceSerial=").concat(e.deviceSerial,"&channelNo=").concat(e.channelNo),n=[];return fetch(t,{method:"GET",headers:{clientType:"ezuikit",sdkVersion:Fe}}).then((function(e){return e.json()})).then((function(e){return(e.meta&&200===e.meta.code&&e.data&&e.data.length>0?e.data:ze).map((function(e){n.push({name:Ne[e.videoLevel],level:e.videoLevel,streamTypeIn:e.streamTypeIn,type:e.type})})),n})).catch((function(){return ze.map((function(e){n.push({name:Ne[e.videoLevel],level:e.videoLevel,streamTypeIn:e.streamTypeIn,type:"compatible"})})),n}))},He=function(e,t){var n="".concat(e.env.domain,"/api/v3/device/setVideoLevel?accessToken=").concat(e.accessToken||e.token.deviceToken.video," "),i=new FormData;return i.append("videoLevel",parseInt(t)),fetch(n,{method:"POST",headers:{accessToken:e.accessToken||e.token.deviceToken.video,deviceSerial:e.deviceSerial,localIndex:e.channelNo},body:i}).then((function(e){return e.json()})).then((function(e){return e}))},Ge=function(e,t){var n=new FormData;return Object.keys(t).map((function(e){n.append(e,t[e])})),fetch(e.env.domain+"/api/service/media/stream/server/info?version=2.0&protocol=4",{method:"GET",headers:{deviceSerial:t.deviceSerial,accessToken:t.accessToken,localIndex:t.localIndex}}).then((function(e){return e.json()})).then((function(t){if(t.meta&&200==t.meta.code){var n=JSON.parse(localStorage.getItem("ezuikit_addressList")),i=function(t){var i=e.deviceSerial+"_"+e.channelNo,o=new Date;n[i]=[{domain:t.domain,port:t.port,expire:new Date(o.setHours(o.getHours()+12)).Format("yyyyMMddThhmmssZ")}],Array.isArray(t.backups)&&t.backups.map((function(e){n[i].push({domain:e.domain,port:e.port,expire:new Date(o.setHours(o.getHours()+12)).Format("yyyyMMddThhmmssZ")})})),localStorage.setItem("ezuikit_addressList",JSON.stringify(n))};if(t.data&&Array.isArray(n[e.deviceSerial+"_"+e.channelNo])){var o=Array.isArray(t.data.backups)?S(t.data.backups):[];o.push({domain:t.data.domain,port:t.data.port}),(!function(e,t){if(e.length!==t.length)return!1;for(var n=S(e).sort((function(e,t){return e.domain>t.domain?1:-1})),i=S(t).sort((function(e,t){return e.domain>t.domain?1:-1})),o=0;o<n.length;o++)if(n[o].domain!==i[o].domain)return!1;return!0}(n[e.deviceSerial+"_"+e.channelNo],o)||n[e.deviceSerial+"_"+e.channelNo][0].expire<=(new Date).Format("yyyyMMddThhmmssZ"))&&i(t.data)}e.maxReloadTime=n[e.deviceSerial+"_"+e.channelNo].length}return t}))},Ze=function(e){var t="";return Object.keys(e).map((function(n,i){t+="".concat(n,":").concat(e[n]).concat(i<Object.keys(e).length-1?";":"")})),t},We=500,qe=function(){return m((function e(t){var n=this;l(this,e),this.jSPlugin=t,this.isNeedRenderHeader=!1,this.isNeedRenderFooter=!1,this.autoFocus=0,this.autoFocusTimer=null,this.recordTimer=null,this.nextRate=1,this.showHD=!1,this.themeInited=!1;var o=re.getGlobalState();if(this.decoderState={state:{play:!1,pauseDate:null,sound:!o.sound&&!!t.audio,recordvideo:!1,recordCount:"00:00",talk:!1,zoom:!1,pantile:!1,speed:!1,expend:!1,webExpend:!1,cloudRec:"cloud.rec"===A(t.url).type,rec:"rec"===A(t.url).type,type:A(t.url).type}},this.allowZoom=!this.jSPlugin.use3DZoom,this.zoomDisable=!1,this.pluginStatus=new U(this,this.jSPlugin.params.id),this.inited=!1,this.isMobile=L(),void 0!==t.isMobile&&(this.isMobile=t.isMobile),this.pauseTime=null,this.themeData=Ce,this.jSPlugin.themeId)switch(this.jSPlugin.themeId){case"pcLive":case"pcRec":case"mobileLive":case"mobileRec":case"security":case"voice":case"simple":case"miniRec":var a=i.find(Me,(function(e){return e.themeId===n.jSPlugin.themeId}));a&&(this.themeData=a),this.initThemeData();break;case"themeData":this.themeData=this.jSPlugin.params.themeData,this.initThemeData();break;default:this.fetchThemeData(this.jSPlugin.themeId)}this.jSPlugin.Talk||(this.jSPlugin.Talk=new Pe(this.jSPlugin)),P("".concat(this.jSPlugin.staticPath,"/speed/speed.css")),P("".concat(this.jSPlugin.staticPath,"/css/theme.css")),this._fullscreenchange=null,this._fullScreenChangeEvent()}),[{key:"fetchThemeData",value:function(e){var t=this;Ue(this.jSPlugin,e,(function(e){0==e.meta.code&&e.data?(t.themeData=e.data,e.data.header&&(t.themeData.header=e.data.header,t.themeData.header.btnList=t.themeData.header.btnList.sort((function(e,t){return e.btnKey.split("-")[3]-t.btnKey.split("-")[3]}))),e.data.footer&&(t.themeData.footer=e.data.footer,t.themeData.footer.btnList=t.themeData.footer.btnList.sort((function(e,t){return e.btnKey.split("-")[3]-t.btnKey.split("-")[3]}))),e.data.themeType&&("live"===A(t.jSPlugin.url).type?-1===e.data.themeType.toLowerCase().indexOf("live")&&console.error("当前模板类型".concat(e.data.themeType,"与播放类型").concat(A(t.jSPlugin.url).type,"不对应,请检查模板类型")):-1===e.data.themeType.toLowerCase().indexOf("rec")&&console.error("当前模板类型".concat(e.data.themeType,"与播放类型").concat(A(t.jSPlugin.url).type,"不对应,请检查模板类型"))),t.initThemeData(),t.renderThemeData()):console.log("模板获取失败:",e)}),(function(e){console.log("模板获取失败:",e),t.renderThemeData()}))}},{key:"changeTheme",value:function(e){var t=this;if("string"==typeof e)switch(this.jSPlugin.themeId=e,this.jSPlugin.themeId){case"pcLive":case"pcRec":case"mobileLive":case"mobileRec":case"security":case"voice":case"simple":case"miniRec":var n=i.find(Me,(function(e){return e.themeId===t.jSPlugin.themeId}));n&&(this.themeData=n),this.initThemeData();break;default:this.fetchThemeData(e)}else"object"===b(e)&&(this.themeData=e,this.initThemeData());this.jSPlugin&&this.jSPlugin.handleThemeChange&&this.jSPlugin.handleThemeChange(e)}},{key:"renderThemeData",value:function(){var e=this,t=this.themeData,n=t.header,o=t.footer;if(this.isNeedRenderHeader&&n&&(document.getElementById("".concat(this.jSPlugin.id,"-headControl")).style.background=n.backgroundColor.replace("-diy",""),document.getElementById("".concat(this.jSPlugin.id,"-headControl")).style.color=n.color.replace("-diy",""),n.btnList.map((function(t,n){t.isrender&&e.setDecoderState(p({},t.iconId,e.decoderState.state[t.iconId]))}))),this.isNeedRenderFooter&&o)document.getElementById("".concat(this.jSPlugin.id,"-audioControls")).style.background=o.backgroundColor.replace("-diy",""),document.getElementById("".concat(this.jSPlugin.id,"-audioControls")).style.color=o.color.replace("-diy",""),this.jSPlugin.params.extraBtn&&(o.btnList=[].concat(S(o.btnList),S(this.jSPlugin.params.extraBtn))),o.btnList.map((function(t,n){if(t.isrender&&e.setDecoderState(p({},t.iconId,e.decoderState.state[t.iconId])),"play"===t.iconId&&t.defaultActive&&!e.themeInited&&e.jSPlugin.autoplay)var i=setInterval((function(){window.EZUIKit[e.jSPlugin.id].state.EZUIKitPlayer.init&&(clearInterval(i),e.themeInited=!0)}),50)})),this.themeData.autoFocus>0&&(this.autoFocus=parseInt(this.themeData.autoFocus),this.startAutoFocus(),document.getElementById("".concat(this.jSPlugin.id,"-wrap")).addEventListener("click",(function(){document.getElementById("".concat(e.jSPlugin.id,"-audioControls"))&&(document.getElementById("".concat(e.jSPlugin.id,"-audioControls")).style.opacity=1,document.getElementById("".concat(e.jSPlugin.id,"-audioControls")).style.pointerEvents="all"),document.getElementById("".concat(e.jSPlugin.id,"-headControl"))&&(document.getElementById("".concat(e.jSPlugin.id,"-headControl")).style.opacity=1,document.getElementById("".concat(e.jSPlugin.id,"-headControl")).style.pointerEvents="all"),e.startAutoFocus()}))),this.setDecoderState({cloudRec:"cloud.rec"===A(this.jSPlugin.url).type,rec:"rec"===A(this.jSPlugin.url).type,type:A(this.jSPlugin.url).type});else if(!this.themeInited)var a=setInterval((function(){window.EZUIKit[e.jSPlugin.id].state.EZUIKitPlayer.init&&e.jSPlugin.autoplay&&(clearInterval(a),e.themeInited=!0)}),50);i.findIndex(this.themeData.footer.btnList,(function(e){return"zoom"===e.iconId&&e.isrender>0}))>=0&&(this.isMobile&&!this.jSPlugin.use3DZoom&&(this.jSPlugin.beforeMobileZoomVerify=function(){return!!e.decoderState.state.play}),this.jSPlugin.Zoom=new Oe(this.jSPlugin))}},{key:"setDecoderState",value:function(e){var t=this,n=this.themeData,i=n.header,o=n.footer;Object.keys(e).map((function(n,a){var r="#FFFFFF",s="#FFFFFF";switch(-1===i.btnList.findIndex((function(e){return e.iconId===n}))?(r=o.color.replace("-diy",""),s=o.activeColor.replace("-diy","")):(r=i.color.replace("-diy",""),s=o.activeColor.replace("-diy","")),n){case"play":e[n]?document.getElementById("".concat(t.jSPlugin.id,"-play"))&&(document.getElementById("".concat(t.jSPlugin.id,"-play-content")).children[0].children[0].style="display:inline-block",document.getElementById("".concat(t.jSPlugin.id,"-play-content")).children[0].children[1].style="display:none",document.getElementById("".concat(t.jSPlugin.id,"-play")).className=e[n]?"active":"",document.getElementById("".concat(t.jSPlugin.id,"-play-content")).childNodes[0].children[0].style.fill=e[n]?s:r):document.getElementById("".concat(t.jSPlugin.id,"-play"))&&(document.getElementById("".concat(t.jSPlugin.id,"-play-content")).children[0].children[1].style="display:inline-block",document.getElementById("".concat(t.jSPlugin.id,"-play-content")).children[0].children[0].style="display:none",document.getElementById("".concat(t.jSPlugin.id,"-play")).className=e[n]?"active":"",document.getElementById("".concat(t.jSPlugin.id,"-play-content")).childNodes[0].children[1].style.fill=e[n]?s:r);break;case"sound":document.getElementById("".concat(t.jSPlugin.id,"-sound"))&&(e[n]?(document.getElementById("".concat(t.jSPlugin.id,"-sound-content")).children[0].children[1].style="display:inline-block",document.getElementById("".concat(t.jSPlugin.id,"-sound-content")).children[0].children[0].style="display:none",document.getElementById("".concat(t.jSPlugin.id,"-sound")).className=e[n]?"active":"",document.getElementById("".concat(t.jSPlugin.id,"-sound-content")).childNodes[0].children[1].style.fill=e[n]?s:r):(document.getElementById("".concat(t.jSPlugin.id,"-sound-content")).children[0].children[0].style="display:inline-block",document.getElementById("".concat(t.jSPlugin.id,"-sound-content")).children[0].children[1].style="display:none",document.getElementById("".concat(t.jSPlugin.id,"-sound")).className=e[n]?"active":"",document.getElementById("".concat(t.jSPlugin.id,"-sound-content")).childNodes[0].children[0].style.fill=e[n]?s:r));break;case"recordvideo":document.getElementById("".concat(t.jSPlugin.id,"-recordvideo"))&&(document.getElementById("".concat(t.jSPlugin.id,"-recordvideo")).className=e[n]?"active":"",document.getElementById("".concat(t.jSPlugin.id,"-recordvideo-content")).childNodes[0].style.fill=e[n]?s:r,e[n]?t.countTime("add",0):t.countTime("destroy",0));break;case"talk":document.getElementById("".concat(t.jSPlugin.id,"-talk"))&&(document.getElementById("".concat(t.jSPlugin.id,"-talk")).className=e[n]?"active":"",document.getElementById("".concat(t.jSPlugin.id,"-talk-content")).childNodes[1].style.fill=e[n]?s:r);break;case"zoom":document.getElementById("".concat(t.jSPlugin.id,"-zoom"))&&(document.getElementById("".concat(t.jSPlugin.id,"-zoom")).className=e[n]?"active":"",document.getElementById("".concat(t.jSPlugin.id,"-zoom-content")).childNodes[1].style.fill=e[n]?s:r);break;case"pantile":document.getElementById("".concat(t.jSPlugin.id,"-pantile"))&&(document.getElementById("".concat(t.jSPlugin.id,"-pantile")).className=e[n]?"active":"",document.getElementById("".concat(t.jSPlugin.id,"-pantile-content")).childNodes[0].style.fill=e[n]?s:r);break;case"webExpend":e[n]?(document.getElementById("".concat(t.jSPlugin.id,"-webExpend"))&&(document.getElementById("".concat(t.jSPlugin.id,"-webExpend-content")).children[0].children[1].style="display:inline-block",document.getElementById("".concat(t.jSPlugin.id,"-webExpend-content")).children[0].children[0].style="display:none"),document.getElementById("".concat(t.jSPlugin.id,"-expend"))&&(document.getElementById("".concat(t.jSPlugin.id,"-expend")).className="disabled")):(document.getElementById("".concat(t.jSPlugin.id,"-webExpend"))&&(document.getElementById("".concat(t.jSPlugin.id,"-webExpend-content")).children[0].children[0].style="display:inline-block",document.getElementById("".concat(t.jSPlugin.id,"-webExpend-content")).children[0].children[1].style="display:none"),document.getElementById("".concat(t.jSPlugin.id,"-expend"))&&(document.getElementById("".concat(t.jSPlugin.id,"-expend")).className="")),document.getElementById("".concat(t.jSPlugin.id,"-webExpend"))&&(document.getElementById("".concat(t.jSPlugin.id,"-webExpend")).className=e[n]?"active":"",document.getElementById("".concat(t.jSPlugin.id,"-webExpend-content")).childNodes[0].childNodes[0].style.fill=e[n]?s:r,document.getElementById("".concat(t.jSPlugin.id,"-webExpend-content")).childNodes[0].childNodes[1].style.fill=e[n]?s:r);break;case"capturePicture":document.getElementById("".concat(t.jSPlugin.id,"-capturePicture"))&&(document.getElementById("".concat(t.jSPlugin.id,"-capturePicture")).className=e[n]?"active":"",document.getElementById("".concat(t.jSPlugin.id,"-capturePicture-content")).childNodes[0].style.fill=e[n]?s:r);break;case"expend":e[n]?(document.getElementById("".concat(t.jSPlugin.id,"-expend"))&&(document.getElementById("".concat(t.jSPlugin.id,"-expend-content")).children[0].children[1].style="display:inline-block",document.getElementById("".concat(t.jSPlugin.id,"-expend-content")).children[0].children[0].style="display:none"),document.getElementById("".concat(t.jSPlugin.id,"-webExpend"))&&(document.getElementById("".concat(t.jSPlugin.id,"-webExpend")).className="disabled")):(document.getElementById("".concat(t.jSPlugin.id,"-expend"))&&(document.getElementById("".concat(t.jSPlugin.id,"-expend-content")).children[0].children[0].style="display:inline-block",document.getElementById("".concat(t.jSPlugin.id,"-expend-content")).children[0].children[1].style="display:none"),document.getElementById("".concat(t.jSPlugin.id,"-webExpend"))&&(document.getElementById("".concat(t.jSPlugin.id,"-webExpend")).className="")),document.getElementById("".concat(t.jSPlugin.id,"-expend"))&&(document.getElementById("".concat(t.jSPlugin.id,"-expend")).className=e[n]?"active":"",document.getElementById("".concat(t.jSPlugin.id,"-expend-content")).childNodes[0].childNodes[0].style.fill=e[n]?s:r,document.getElementById("".concat(t.jSPlugin.id,"-expend-content")).childNodes[0].childNodes[1].style.fill=e[n]?s:r);break;case"hd":break;case"speed":if(document.getElementById("".concat(t.jSPlugin.id,"-speed"))){var c=document.getElementById("".concat(t.jSPlugin.id,"-speed-content")).children[1].children[0];"not-allowed"!==c.style.cursor&&(c.style.color=e[n]?s:r,c.style.borderColor=e[n]?s:r)}document.getElementById("".concat(t.jSPlugin.id,"-select-mask"))&&(t.isMobile&&e[n]?document.getElementById("".concat(t.jSPlugin.id,"-select-mask")).style.display="block":document.getElementById("".concat(t.jSPlugin.id,"-select-mask")).style.display="none");break;case"cloudRec":document.getElementById("".concat(t.jSPlugin.id,"-cloudRec"))&&(document.getElementById("".concat(t.jSPlugin.id,"-cloudRec")).className=e[n]?"active":"",document.getElementById("".concat(t.jSPlugin.id,"-cloudRec-content")).children[0].children[0].style.fill=e[n]?s:r),document.getElementById("".concat(t.jSPlugin.id,"-rec"))&&(document.getElementById("".concat(t.jSPlugin.id,"-rec")).className=e[n]?"active":"",document.getElementById("".concat(t.jSPlugin.id,"-rec-content")).children[0].children[0].style.fill=e[n]?r:s);break;case"cloudRecord":var l=document.getElementById("".concat(t.jSPlugin.id,"-cloudRecord"));l&&(l.className=e[n]?"active":"",document.getElementById("".concat(t.jSPlugin.id,"-cloudRecord-content")).children[0].children[0].style.fill=e[n]?s:r),document.getElementById("".concat(t.jSPlugin.id,"-rec"))&&(document.getElementById("".concat(t.jSPlugin.id,"-rec")).className=e[n]?"active":"",document.getElementById("".concat(t.jSPlugin.id,"-rec-content")).children[0].children[0].style.fill=e[n]?r:s);break;case"rec":document.getElementById("".concat(t.jSPlugin.id,"-cloudRec"))&&(document.getElementById("".concat(t.jSPlugin.id,"-cloudRec")).className=e[n]?"active":"",document.getElementById("".concat(t.jSPlugin.id,"-cloudRec-content")).children[0].children[0].style.fill=e[n]?r:s),document.getElementById("".concat(t.jSPlugin.id,"-cloudRecord"))&&(document.getElementById("".concat(t.jSPlugin.id,"-cloudRecord")).className=e[n]?"active":"",document.getElementById("".concat(t.jSPlugin.id,"-cloudRecord-content")).children[0].children[0].style.fill=e[n]?r:s),document.getElementById("".concat(t.jSPlugin.id,"-rec"))&&(document.getElementById("".concat(t.jSPlugin.id,"-rec")).className=e[n]?"active":"",document.getElementById("".concat(t.jSPlugin.id,"-rec-content")).children[0].children[0].style.fill=e[n]?s:r)}t.decoderState.state=Object.assign(t.decoderState.state,e)}))}},{key:"startAutoFocus",value:function(){var e=this,t=this.autoFocus;this.autoFocusTimer&&clearTimeout(this.autoFocusTimer),this.autoFocusTimer=setTimeout((function(){document.getElementById("".concat(e.jSPlugin.id,"-audioControls"))&&(document.getElementById("".concat(e.jSPlugin.id,"-audioControls")).style.opacity=0,document.getElementById("".concat(e.jSPlugin.id,"-audioControls")).style.pointerEvents="none"),document.getElementById("".concat(e.jSPlugin.id,"-headControl"))&&(document.getElementById("".concat(e.jSPlugin.id,"-headControl")).style.opacity=0,document.getElementById("".concat(e.jSPlugin.id,"-headControl")).style.pointerEvents="none")}),1e3*t)}},{key:"stopAutoFocus",value:function(){document.getElementById("".concat(this.jSPlugin.id,"-audioControls"))&&(document.getElementById("".concat(this.jSPlugin.id,"-audioControls")).style.opacity=1,document.getElementById("".concat(this.jSPlugin.id,"-audioControls")).style.pointerEvents="all"),document.getElementById("".concat(this.jSPlugin.id,"-headControl"))&&(document.getElementById("".concat(this.jSPlugin.id,"-headControl")).style.opacity=1,document.getElementById("".concat(this.jSPlugin.id,"-headControl")).style.pointerEvents="all"),this.autoFocusTimer&&clearTimeout(this.autoFocusTimer)}},{key:"hideFooter",value:function(){document.getElementById("".concat(this.jSPlugin.id,"-ez-iframe-footer-container"))&&(document.getElementById("".concat(this.jSPlugin.id,"-ez-iframe-footer-container")).style.display="none")}},{key:"showFooter",value:function(){document.getElementById("".concat(this.jSPlugin.id,"-ez-iframe-footer-container"))&&(document.getElementById("".concat(this.jSPlugin.id,"-ez-iframe-footer-container")).style.display="block")}},{key:"toString",value:function(){return"".concat(this.coreX,"-").concat(this.coreY)}},{key:"renderFooter",value:function(e,t){var n=this.matchBtn(e),i=document.createElement("div");i.className="theme-icon-item",i.innerHTML="".concat('<span id="'.concat(this.jSPlugin.id,"-").concat(n.id,'" style="position:relative;">')+'<div id="'.concat(this.jSPlugin.id,"-").concat(n.id,'-content" title="').concat(n.title,'" style="height:').concat(this.jSPlugin.width>We?48:32,'px;display: flex;align-items: center;position:relative;">')).concat(n.domString,"</div>")+"</span>",i.onclick=function(e){n.onclick(e)},n.onmouseenter&&(i.onmouseenter=function(e){n.onmouseenter(e)}),n.onmouseleave&&(i.onmouseleave=function(e){n.onmouseleave(e)}),"left"===t?document.getElementById("".concat(this.jSPlugin.id,"-audioControls")).childNodes[0].appendChild(i):document.getElementById("".concat(this.jSPlugin.id,"-audioControls")).childNodes[1].appendChild(i)}},{key:"renderHeader",value:function(e,t){var n=this.matchBtn(e),i=document.createElement("div");i.className="theme-icon-item",i.style="max-width:50%;",i.innerHTML="".concat('<span id="'.concat(this.jSPlugin.id,"-").concat(n.id,'" style="position:relative;";>')+'<span id="'.concat(this.jSPlugin.id,"-").concat(n.id,'-content" title="').concat(n.title,'" style="display:inline-block;height:').concat(this.width>We?48:32,'px;">')).concat(n.domString,"</span>")+"</span>",i.onclick=function(e){n.onclick(e)},"left"===t?document.getElementById("".concat(this.jSPlugin.id,"-headControl")).childNodes[0].appendChild(i):document.getElementById("".concat(this.jSPlugin.id,"-headControl")).childNodes[1].appendChild(i)}},{key:"countTime",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this;if(!document.getElementById(this.jSPlugin.id+"time-area")){var i=document.createElement("div");i.id=this.jSPlugin.id+"time-area",i.className="time-area",i.innerHTML='<span class="dot"></span><span class="value">00:00</span>',document.getElementById("".concat(this.jSPlugin.id,"-ez-iframe-footer-container"))&&document.getElementById("".concat(this.jSPlugin.id,"-ez-iframe-footer-container")).appendChild(i)}if(this.countTimer&&clearInterval(this.countTimer),"add"===e){var o=t;document.getElementById(n.jSPlugin.id+"time-area").style.display="flex",this.countTimer=setInterval((function(){++o,document.getElementById(n.jSPlugin.id+"time-area").children[1].innerHTML=function(e){var t=parseInt(e),n=0,i=0,o="00",a="00",r="00";t>59&&(n=parseInt(t/60),t=parseInt(t%60),n>59&&(i=parseInt(n/60),n=parseInt(n%60)));return o=parseInt(t)>9?parseInt(t):"0"+parseInt(t),a=parseInt(n)>9?parseInt(n):"0"+parseInt(n),r=parseInt(i)>9?parseInt(i):"0"+parseInt(i),i>0?r+":"+a+":"+o:n>0?a+":"+o:"00:"+o}(o)}),1e3)}else"destroy"===e&&(this.countTimer&&clearInterval(this.countTimer),this.countTimer=void 0,document.getElementById(n.jSPlugin.id+"time-area")&&(document.getElementById(n.jSPlugin.id+"time-area").children[1].innerHTML="00:00",document.getElementById(n.jSPlugin.id+"time-area").style.display="none"))}},{key:"setDisabled",value:function(e){var t=this.decoderState.state,n=t.sound,i=t.expend,o=e?"cursor: not-allowed; color: gray; fill: gray; ":"cursor: default";null!=document.getElementById("".concat(this.jSPlugin.id,n?"-sound-icon":"-nosound-icon"))&&document.getElementById("".concat(this.jSPlugin.id,n?"-sound-icon":"-nosound-icon")).setAttribute("style",e?"cursor: not-allowed; color: gray; fill: gray;":"cursor: default"),null!=document.getElementById("".concat(this.jSPlugin.id,"-recordvideo-icon"))&&document.getElementById("".concat(this.jSPlugin.id,"-recordvideo-icon")).setAttribute("style",o),null!=document.getElementById("".concat(this.jSPlugin.id,"-capturePicture-icon"))&&document.getElementById("".concat(this.jSPlugin.id,"-capturePicture-icon")).setAttribute("style",o),null!=document.getElementById("".concat(this.jSPlugin.id,"-talk-icon"))&&document.getElementById("".concat(this.jSPlugin.id,"-talk-icon")).setAttribute("style",o),null!=document.getElementById("".concat(this.jSPlugin.id,i?"-unexpend-icon":"-expend-icon"))&&document.getElementById("".concat(this.jSPlugin.id,i?"-unexpend-icon":"-expend-icon")).setAttribute("style",o),this.allowZoom||null!=document.getElementById("".concat(this.jSPlugin.id,"-zoom-icon"))&&document.getElementById("".concat(this.jSPlugin.id,"-zoom-icon")).setAttribute("style",o),document.getElementById("".concat(this.jSPlugin.id,"-pantile-icon"))&&"none"!=document.getElementById("".concat(this.jSPlugin.id,"-pantile-icon")).style.display&&document.getElementById("".concat(this.jSPlugin.id,"-pantile-icon")).setAttribute("style",o);var a=document.getElementsByClassName("".concat(this.jSPlugin.id,"-select-quality-btn"));if(a.length)for(var r=0;r<a.length;r++)e?(a[r].style.cursor="not-allowed",a[r].style.color="gray",a[r].style.fill="gray"):(a[r].style.cursor="default",a[r].style.fill="",a[r].style.color="");null!=document.getElementById("".concat(this.jSPlugin.id,"-speed-text"))&&document.getElementById("".concat(this.jSPlugin.id,"-speed-text")).setAttribute("style",document.getElementById("".concat(this.jSPlugin.id,"-speed-text")).getAttribute("style")+";"+(e?"cursor: not-allowed; color: gray; border-color: gray;":"cursor: default; color: #ffffff;border-color: #ffffff;")),this.zoomDisable=this.jSPlugin.use3DZoom&&e}},{key:"matchBtn",value:function(e){var t=this,n=this.themeData,o=n.header,a=n.footer,r={title:"",id:"",domString:"",color:"#FFFFFF",activeColor:"#FFFFFF",onclick:function(){},onmoveleft:function(){},onmoveright:function(){},onremove:function(){}};-1===o.btnList.findIndex((function(t){return t.iconId===e}))?(r.color=a.color,r.backgroundColor=a.backgroundColor,r.activeColor=a.activeColor):(r.color=o.color,r.backgroundColor=o.backgroundColor,r.activeColor=o.activeColor);var s=this.jSPlugin._isCloudRecord&&-1!==this.jSPlugin.url.indexOf("cloud.rec"),c=this.isMobile?45:32;switch(e){case"play":r.title=this.jSPlugin.i18n.t("BTN_PLAY"),r.id=e,r.domString='<div style="height: 100%">'+'<svg id="'.concat(this.jSPlugin.id+"-play-icon",'" class="theme-icon-item-icon" style="display:none" width="').concat(this.jSPlugin.width>We?48:32,'" height="').concat(this.jSPlugin.width>We?48:32,'" fill="').concat(r.color,'" viewBox="-6 -6 32 32">\n <path d="M10.5,1.7c-4.9,0-8.8,4-8.8,8.8s4,8.8,8.8,8.8s8.8-4,8.8-8.8S15.4,1.7,10.5,1.7z M10.5,2.7\n c4.3,0,7.8,3.5,7.8,7.8s-3.5,7.8-7.8,7.8s-7.8-3.5-7.8-7.8S6.2,2.7,10.5,2.7z"/>\n <path class="st2" d="M8.7,8C9,8,9.3,8.3,9.3,8.6v3.8C9.3,12.7,9,13,8.7,13C8.3,13,8,12.7,8,12.4V8.6C8,8.3,8.3,8,8.7,8z"/>\n <path id="Rectangle-Copy-10" class="st2" d="M12.8,8c0.3,0,0.6,0.3,0.6,0.6v3.8c0,0.3-0.3,0.6-0.6,0.6c-0.3,0-0.6-0.3-0.6-0.6V8.6\n C12.2,8.3,12.5,8,12.8,8z"/>\n </svg>')+'<svg id="'.concat(this.jSPlugin.id+"-stop-icon",'" class="theme-icon-item-icon" fill="').concat(r.color,'" version="1.1" xmlns="http://www.w3.org/2000/svg" width="').concat(this.jSPlugin.width>We?48:32,'" height="').concat(this.jSPlugin.width>We?48:32,'" viewBox="-6 -6 32 32">')+'<path d="M13,9.8L10.1,8C9.9,7.9,9.7,7.9,9.5,7.9c-0.6,0-1,0.4-1,1v3.7c0,0.2,0.1,0.4,0.2,0.5c0.3,0.5,0.9,0.6,1.4,0.3 l2.9-1.8c0.1-0.1,0.2-0.2,0.3-0.3C13.6,10.7,13.4,10.1,13,9.8z" /><path d="M10.5,1.9c-4.9,0-8.8,4-8.8,8.8c0,4.9,4,8.8,8.8,8.8s8.8-4,8.8-8.8C19.4,5.8,15.4,1.9,10.5,1.9z M10.5,18.5 c-4.3,0-7.8-3.5-7.8-7.8s3.5-7.8,7.8-7.8c4.3,0,7.8,3.5,7.8,7.8S14.9,18.5,10.5,18.5z" /></svg></div>',r.onclick=function(){var e=t.decoderState.state,n=e.play,i=e.rec,o=e.cloudRec,a=e.recordvideo,r=e.pantile,s=e.expend,c=e.zoom,l=e.talk,d=e.sound,u=re.getGlobalState(),m=re.getInstance(t.jSPlugin.id);window.recTimer&&Array.isArray(window.recTimer[t.jSPlugin.id])&&(window.recTimer[t.jSPlugin.id].map((function(e){clearInterval(e)})),window.recTimer[t.jSPlugin.id]=[]),n?(i||o?(t.Rec&&t.Rec.unSyncTimeLine(),t.jSPlugin.pause().then((function(){t.setDecoderState({play:!n}),t.setDisabled(n)}))):(t.jSPlugin.stop((function(){}),!0).then((function(){t.setDecoderState({play:!n}),t.setDisabled(n)})),c&&(t.setDecoderState({zoom:!1}),t.jSPlugin.Zoom.stopZoom(),t.jSPlugin.close3DZoom()),l&&(t.setDecoderState({talk:!1}),document.getElementById("".concat(t.jSPlugin.id,"-volume-column"))&&(document.getElementById("".concat(t.jSPlugin.id,"-volume-column")).style.display="none"),t.jSPlugin.Talk.stopTalk(),u.talk&&re.setGlobalState({talk:!1}),m.getState().talk&&m.setState({talk:!1}))),a&&t.setDecoderState({recordvideo:!1}),d&&(t.jSPlugin.closeSound(),t.setDecoderState({sound:!1}),m.setState({sound:!0}))):(i||o?(t.Rec&&t.Rec.syncTimeLine(),t.jSPlugin.resume().then((function(){t.setDisabled(n),t.setDecoderState({play:!n,expend:s})}))):t.jSPlugin.play().then((function(){t.setDisabled(n),t.setDecoderState({play:!n,expend:s})})),t.jSPlugin.use3DZoom&&t.resetMobileZoomStatus()),t.jSPlugin.use3DZoom?(t.setDecoderState({zoom:!1}),t.allowZoom=!1):t.allowZoom=i||o,r&&t.Ptz&&(t.Ptz.hide(),t.setDecoderState({pantile:!1})),document.getElementById("".concat(t.jSPlugin.id,"-speedSelect"))&&(document.getElementById("".concat(t.jSPlugin.id,"-speedSelect")).style.display="none"),t.setDecoderState({speed:!1})};break;case"sound":r.title=this.jSPlugin.i18n.t("BTN_SOUND"),r.id=e,r.domString='<span style="height: 100%">'+'<svg class="theme-icon-item-icon" id="'.concat(this.jSPlugin.id,'-nosound-icon" style="display:none" fill="').concat(r.color,'" version="1.1" xmlns="http://www.w3.org/2000/svg" width="').concat(this.jSPlugin.width>We?48:32,'" height="').concat(this.jSPlugin.width>We?48:32,'" viewBox="-6 -6 32 32">\n <path d="M8.5,4.2c0.8-0.7,2.1-0.2,2.2,0.9l0,0.1v10c0,1.1-1.2,1.7-2.1,1.1l-0.1-0.1l-3.3-2.8C5,13.2,5,12.9,5.1,12.7 c0.2-0.2,0.4-0.2,0.6-0.1l0.1,0.1l3.3,2.8c0.2,0.2,0.5,0.1,0.5-0.2l0-0.1v-10c0-0.3-0.3-0.4-0.5-0.3L9.2,5L5.9,7.8 C5.6,7.9,5.3,7.9,5.1,7.7C5,7.5,5,7.3,5.1,7.1L5.2,7L8.5,4.2z"/>\n <path d="M5.5,6.9C5.8,6.9,6,7.1,6,7.4c0,0.2-0.2,0.4-0.4,0.5l-0.1,0h-2C3.4,7.9,3.3,8,3.2,8.2l0,0.1v4 c0,0.2,0.1,0.3,0.3,0.3l0.1,0h2C5.8,12.5,6,12.7,6,13c0,0.2-0.2,0.4-0.4,0.5l-0.1,0h-2c-0.7,0-1.3-0.5-1.3-1.2l0-0.1v-4 c0-0.7,0.5-1.3,1.2-1.3l0.1,0H5.5z"/>\n <path d="M17.4,7.9c0.2-0.2,0.5-0.2,0.7,0c0.2,0.2,0.2,0.4,0.1,0.6l-0.1,0.1l-3.8,3.8c-0.2,0.2-0.5,0.2-0.7,0 c-0.2-0.2-0.2-0.4-0.1-0.6l0.1-0.1L17.4,7.9z"/>\n <path d="M13.7,7.9c0.2-0.2,0.4-0.2,0.6-0.1l0.1,0.1l3.8,3.8c0.2,0.2,0.2,0.5,0,0.7c-0.2,0.2-0.4,0.2-0.6,0.1l-0.1-0.1 l-3.7-3.8C13.5,8.4,13.5,8.1,13.7,7.9z"/>\n </svg>')+'<svg class="theme-icon-item-icon" id="'.concat(this.jSPlugin.id,'-sound-icon" style="display:inline-block" width="').concat(this.jSPlugin.width>We?48:32,'" height="').concat(this.jSPlugin.width>We?48:32,'" fill="').concat(r.color,'" viewBox="-6 -6 32 32">\n <path d="M13.2,7.1c0.1-0.2,0.5-0.3,0.7-0.2c1.1,0.7,1.9,2.2,1.9,3.7c0,1.6-0.7,3-1.9,3.7\n c-0.2,0.1-0.5,0.1-0.7-0.2c-0.1-0.2-0.1-0.5,0.2-0.7c0.8-0.5,1.4-1.6,1.4-2.9c0-1.3-0.6-2.4-1.4-2.9C13.1,7.6,13,7.3,13.2,7.1z"/>\n <path d="M15.7,4.5c0.2-0.2,0.5-0.2,0.7-0.1C18,5.8,19,8.2,19,10.7c0,2.5-1,4.8-2.7,6.3\n c-0.2,0.2-0.5,0.2-0.7-0.1c-0.2-0.2-0.2-0.5,0.1-0.7c1.4-1.2,2.3-3.3,2.3-5.5c0-2.2-0.9-4.3-2.3-5.5C15.5,5,15.5,4.7,15.7,4.5z"/>\n <path d="M8.5,4.7c0.8-0.7,2.1-0.2,2.2,0.9l0,0.1v10c0,1.1-1.2,1.7-2.1,1.1l-0.1-0.1l-3.3-2.8\n C5,13.7,5,13.4,5.1,13.2c0.2-0.2,0.4-0.2,0.6-0.1l0.1,0.1l3.3,2.8c0.2,0.2,0.5,0.1,0.5-0.2l0-0.1v-10c0-0.3-0.3-0.4-0.5-0.3l-0.1,0\n L5.9,8.3C5.6,8.4,5.3,8.4,5.1,8.2C5,8,5,7.7,5.1,7.6l0.1-0.1L8.5,4.7z"/>\n <path d="M5.5,7.4C5.8,7.4,6,7.6,6,7.9c0,0.2-0.2,0.4-0.4,0.5l-0.1,0h-2c-0.2,0-0.3,0.1-0.3,0.3l0,0.1v4\n c0,0.2,0.1,0.3,0.3,0.3l0.1,0h2C5.8,13,6,13.2,6,13.5c0,0.2-0.2,0.4-0.4,0.5l-0.1,0h-2c-0.7,0-1.3-0.5-1.3-1.2l0-0.1v-4\n c0-0.7,0.5-1.3,1.2-1.3l0.1,0H5.5z"/>\n </svg>')+"</span>",r.onclick=function(){var e=t.decoderState.state,n=e.play,i=e.sound,o=e.talk,a=e.pantile;n&&!o&&(i?(t.jSPlugin.closeSound(),t.setDecoderState({sound:!1})):t.jSPlugin.openSound(),a&&t.Ptz&&(t.Ptz.hide(),t.setDecoderState({pantile:!1})))};break;case"recordvideo":if(s)break;r.title=this.jSPlugin.i18n.t("BTN_RECORDVIDEO"),r.id=e,r.domString='<svg id="'.concat(this.jSPlugin.id,'-recordvideo-icon" class="theme-icon-item-icon" fill="').concat(r.color,'" version="1.1" xmlns="http://www.w3.org/2000/svg" width="').concat(this.jSPlugin.width>We?48:32,'" height="').concat(this.jSPlugin.width>We?48:32,'" viewBox="-6 -6 32 32">')+'<path d="M11.6,5.3H4.7c-1.4,0-2.5,1.1-2.5,2.5v5.9c0,1.4,1.1,2.5,2.5,2.5h6.9c1.4,0,2.5-1.1,2.5-2.5V7.7 C14.1,6.4,13,5.3,11.6,5.3z M4.7,6.3h6.9c0.8,0,1.5,0.7,1.5,1.5v5.9c0,0.8-0.7,1.5-1.5,1.5H4.7c-0.8,0-1.5-0.7-1.5-1.5V7.7 C3.3,6.9,3.9,6.3,4.7,6.3z" /><path d="M16.6,6.7c0.9-0.8,2.3-0.1,2.4,1l0,0.1v5.7c0,1.2-1.3,1.9-2.3,1.2l-0.1-0.1L13.3,12 c-0.2-0.2-0.2-0.5-0.1-0.7c0.2-0.2,0.4-0.2,0.6-0.1l0.1,0.1l3.3,2.7c0.3,0.2,0.7,0.1,0.8-0.3l0-0.1V7.8c0-0.4-0.4-0.6-0.7-0.4 l-0.1,0l-3.3,2.7c-0.2,0.2-0.5,0.1-0.7-0.1c-0.2-0.2-0.1-0.5,0-0.6l0.1-0.1L16.6,6.7z" /></svg>',r.onclick=function(){var e=t.decoderState.state,n=e.play,i=e.recordvideo;n&&(i?(t.jSPlugin.stopSave(t.jSPlugin.downloadRecord),t.setDecoderState({recordvideo:!1})):(t.jSPlugin.startSave("".concat((new Date).getTime())),t.setDecoderState({recordvideo:!0})))};break;case"capturePicture":r.title=this.jSPlugin.i18n.t("BTN_CAPTURE"),r.id=e,r.domString='<svg id="'.concat(this.jSPlugin.id,'-capturePicture-icon" class="theme-icon-item-icon" fill="').concat(r.color,'" version="1.1" xmlns="http://www.w3.org/2000/svg" width="').concat(this.jSPlugin.width>We?48:32,'" height="').concat(this.jSPlugin.width>We?48:32,'" viewBox="-6 -6 32 32">')+'<path d="M10.8,7.7c-2,0-3.7,1.6-3.7,3.7S8.7,15,10.8,15c2,0,3.7-1.6,3.7-3.7S12.8,7.7,10.8,7.7z M10.8,8.7c1.5,0,2.7,1.2,2.7,2.7S12.2,14,10.8,14c-1.5,0-2.7-1.2-2.7-2.7S9.3,8.7,10.8,8.7z" /><path d="M8.6,3.7l-0.1,0C8,3.7,7.7,4,7.5,4.3l-1,1.7l-1.3,0C4,6.1,3.1,7,3.1,8.2v7.1 c0,1.2,0.9,2.1,2.1,2.1h11.1c1.2,0,2.1-0.9,2.1-2.1V8.2l0-0.1c-0.1-1.1-1-1.9-2.1-1.9l-1.3,0l-1.1-1.8c-0.2-0.4-0.7-0.6-1.1-0.6H8.6 z M8.6,4.7h4.2c0.1,0,0.2,0.1,0.3,0.1l1.2,2c0.1,0.2,0.3,0.2,0.4,0.2h1.6c0.6,0,1.1,0.5,1.1,1.1v7.1c0,0.6-0.5,1.1-1.1,1.1H5.1 c-0.6,0-1.1-0.5-1.1-1.1V8.2c0-0.6,0.5-1.1,1.1-1.1h1.6c0.2,0,0.3-0.1,0.4-0.2l1.2-2C8.4,4.7,8.5,4.7,8.6,4.7z" /></svg>',r.onclick=function(){t.decoderState.state.play?t.jSPlugin.capturePicture("".concat((new Date).getTime()),(function(){}),t.jSPlugin.download):console.log("视频未播放,无法截图")};break;case"talk":if(s)break;r.title=this.jSPlugin.i18n.t("BTN_TALK"),r.id=e,r.domString='<div style="height: '.concat(this.jSPlugin.width>We?15:10,"px; width: ").concat(this.jSPlugin.width>We?8:5,"px; position: absolute; left: ").concat(this.jSPlugin.width>We?20:13,"px; top: ").concat(this.jSPlugin.width>We?14:9,'px; border-radius: 50%; overflow:hidden;">')+'<div id="'.concat(this.jSPlugin.id,'-volume-column" style="height: 0; width: 100%; position: absolute; background: #00cc66; left: 0; bottom: 0; display: none;"></div>')+"</div>"+'<svg id="'.concat(this.jSPlugin.id,'-talk-icon" class="theme-icon-item-icon" fill="').concat(r.color,'" version="1.1" xmlns="http://www.w3.org/2000/svg" width="').concat(this.jSPlugin.width>We?48:32,'" height="').concat(this.jSPlugin.width>We?48:32,'" viewBox="-6 -6 32 32">')+'<path d="M10.1,2.7C8.5,2.7,7.2,4,7.2,5.6v5.2c0,1.6,1.3,2.9,2.9,2.9l0.2,0c1.5-0.1,2.7-1.4,2.7-2.9V5.6\tC13,4,11.7,2.7,10.1,2.7z M10.1,3.7c1.1,0,1.9,0.9,1.9,1.9v5.2c0,1-0.8,1.8-1.8,1.9l-0.1,0c-1,0-1.9-0.9-1.9-1.9V5.6 C8.2,4.5,9,3.7,10.1,3.7z" /><path d="M15.1,8.5c0.2,0,0.4,0.2,0.5,0.4l0,0.1v1.7c0,3-2.5,5.5-5.5,5.5c-3,0-5.4-2.3-5.5-5.3l0-0.2V9 c0-0.3,0.2-0.5,0.5-0.5c0.2,0,0.4,0.2,0.5,0.4l0,0.1v1.7c0,2.5,2,4.5,4.5,4.5c2.4,0,4.4-1.9,4.5-4.3l0-0.2V9 C14.6,8.7,14.8,8.5,15.1,8.5z" /><path d="M13.5,17.7c0.3,0,0.5,0.2,0.5,0.5c0,0.2-0.2,0.4-0.4,0.5l-0.1,0h-7c-0.3,0-0.5-0.2-0.5-0.5 c0-0.2,0.2-0.4,0.4-0.5l0.1,0H13.5z" /><path d="M10.1,15.2c0.2,0,0.4,0.2,0.5,0.4l0,0.1v2.5c0,0.3-0.2,0.5-0.5,0.5c-0.2,0-0.4-0.2-0.5-0.4l0-0.1 v-2.5C9.6,15.4,9.8,15.2,10.1,15.2z" /></svg>',this.jSPlugin.eventEmitter.on("volumeChange",(function(e){var n=e.data;document.getElementById("".concat(t.jSPlugin.id,"-volume-column"))&&(document.getElementById("".concat(t.jSPlugin.id,"-volume-column")).style.height="".concat(100*n,"%"))})),r.onclick=function(){var e=t.decoderState.state,n=e.talk,o=e.sound,a=e.play,r=re.getGlobalState(),s=re.getInstance(t.jSPlugin.id);if(a)if(n){t.setDecoderState({talk:!1}),document.getElementById("".concat(t.jSPlugin.id,"-volume-column"))&&(document.getElementById("".concat(t.jSPlugin.id,"-volume-column")).style.display="none"),t.jSPlugin.Talk.stopTalk();var c=i.findIndex(t.themeData.footer.btnList,(function(e){return"sound"===e.iconId&&1===e.isrender&&1===e.defaultActive}))>-1;t.themeData&&c&&t.jSPlugin.openSound(),r.talk&&re.setGlobalState({talk:!1}),s.getState().talk&&s.setState({talk:!1})}else{if(r.talk)return console.warn("当前已经有设备正在对讲"),void(t.jSPlugin.eventEmitter&&t.jSPlugin.eventEmitter.emit("startTalk",{eventType:"startTalk",code:430005,target:t,msg:"当前已经有设备正在对讲"}));t.setDecoderState({talk:!0}),document.getElementById("".concat(t.jSPlugin.id,"-volume-column")).style.display="block",t.jSPlugin.Talk.startTalk((function(e){o&&!e&&(t.jSPlugin.closeSound(),t.setDecoderState({sound:!1})),re.setGlobalState({talk:!0}),s.setState({talk:!0})}))}};break;case"zoom":if(s)break;r.title=this.jSPlugin.use3DZoom?this.jSPlugin.i18n.t("BTN_3D_ZOOM"):this.jSPlugin.i18n.t("BTN_ZOOM"),r.id=e,r.domString="<div></div>"+'<svg id="'.concat(this.jSPlugin.id,'-zoom-icon" class="theme-icon-item-icon" fill="').concat(r.color,'" version="1.1" id="图层_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"\n width="').concat(this.jSPlugin.width>We?48:32,'" height="').concat(this.jSPlugin.width>We?48:32,'" viewBox="5 -6 5 32" style="enable-background:new 0 0 20 20.1;" xml:space="preserve">\n <path class="st1" d="M8.8,2.6c3.5,0,6.2,2.8,6.2,6.2s-2.8,6.2-6.2,6.2s-6.2-2.8-6.2-6.2S5.3,2.6,8.8,2.6z M8.8,3.9\n c-2.8,0-5,2.2-5,5s2.2,5,5,5s5-2.2,5-5S11.5,3.9,8.8,3.9z M12.7,12.7l3.9,3.9"/>\n <path class="st2" d="M11.2,9.5h-5c-0.3,0-0.6-0.3-0.6-0.6s0.3-0.6,0.6-0.6h5c0.3,0,0.6,0.3,0.6,0.6S11.6,9.5,11.2,9.5z"/>\n <path class="st2" d="M8.7,12c-0.3,0-0.6-0.3-0.6-0.6v-5c0-0.3,0.3-0.6,0.6-0.6s0.6,0.3,0.6,0.6v5C9.3,11.8,9.1,12,8.7,12z"/>\n <path class="st2" d="M16.9,17.6c-0.1,0-0.3-0.1-0.4-0.2l-3.9-3.9c-0.2-0.2-0.2-0.6,0-0.8s0.6-0.2,0.8,0l3.9,3.9\n c0.2,0.2,0.2,0.6,0,0.8C17.2,17.5,17,17.6,16.9,17.6z"/>\n </svg>'),r.onclick=function(){var e=t.decoderState.state,n=e.zoom,i=e.play,o=e.rec,a=e.cloudRec;if(t.jSPlugin.use3DZoom){if(!i)return!1;n?t.jSPlugin.close3DZoom():t.jSPlugin.enable3DZoom()}else{if(t.zoomDisable||!o&&!a&&!i)return!1;n?t.jSPlugin.Zoom.stopZoom():t.jSPlugin.Zoom.startZoom()}t.setDecoderState({zoom:!n})};break;case"pantile":if(s)break;r.title=this.jSPlugin.i18n.t("BTN_PTZ"),r.id=e,r.domString='<svg id="'.concat(this.jSPlugin.id,'-pantile-icon" style="').concat(this.isMobile?this.decoderState.state.expend?"display:block;":"display:none;":"display:block;",'" class="theme-icon-item-icon" fill="').concat(r.color,'" version="1.1" xmlns="http://www.w3.org/2000/svg" width="').concat(this.jSPlugin.width>We?48:32,'" height="').concat(this.jSPlugin.width>We?48:32,'" viewBox="-6 -6 32 32">')+'<path d="M10.2,7.8c1.6,0,2.9,1.3,2.9,2.9s-1.3,2.9-2.9,2.9s-2.9-1.3-2.9-2.9S8.5,7.8,10.2,7.8z M10.2,8.8c-1.1,0-1.9,0.9-1.9,1.9s0.9,1.9,1.9,1.9s1.9-0.9,1.9-1.9S11.2,8.8,10.2,8.8z" /><path d="M8.8,3.5c0.7-0.6,1.8-0.6,2.5-0.1l0.1,0.1l1.4,1.1c0.2,0.2,0.3,0.5,0.1,0.7 c-0.2,0.2-0.4,0.2-0.6,0.1l-0.1,0l-1.4-1.1C10.5,3.9,10,3.9,9.6,4.2L9.4,4.3L8,5.4C7.8,5.5,7.5,5.5,7.3,5.3c-0.2-0.2-0.1-0.5,0-0.6 l0.1-0.1L8.8,3.5z" /><path d="M2.5,12.3c-0.6-0.7-0.6-1.8-0.1-2.5l0.1-0.1l1.1-1.4c0.2-0.2,0.5-0.3,0.7-0.1 c0.2,0.2,0.2,0.4,0.1,0.6l0,0.1l-1.1,1.4C3,10.6,3,11.1,3.2,11.5l0.1,0.1L4.4,13c0.2,0.2,0.1,0.5-0.1,0.7c-0.2,0.2-0.5,0.1-0.6,0 l-0.1-0.1L2.5,12.3z" /><path d="M17.7,12.3c0.6-0.7,0.6-1.8,0.1-2.5l-0.1-0.1l-1.1-1.4c-0.2-0.2-0.5-0.3-0.7-0.1 c-0.2,0.2-0.2,0.4-0.1,0.6l0,0.1l1.1,1.4c0.3,0.4,0.3,0.9,0.1,1.3l-0.1,0.1L15.8,13c-0.2,0.2-0.1,0.5,0.1,0.7c0.2,0.2,0.5,0.1,0.6,0 l0.1-0.1L17.7,12.3z" /><path d="M8.8,18.2c0.7,0.6,1.8,0.6,2.5,0.1l0.1-0.1l1.4-1.1c0.2-0.2,0.3-0.5,0.1-0.7 c-0.2-0.2-0.4-0.2-0.6-0.1l-0.1,0l-1.4,1.1c-0.4,0.3-0.9,0.3-1.3,0.1l-0.1-0.1L8,16.3c-0.2-0.2-0.5-0.1-0.7,0.1 c-0.2,0.2-0.1,0.5,0,0.6l0.1,0.1L8.8,18.2z" /></svg>',r.onclick=function(){var e=t.decoderState.state,n=e.play,i=e.pantile,o=e.expend;if(n)if(i)t.Ptz.hide(),t.setDecoderState({pantile:!1});else{if(t.isMobile&&!o)return console.log("移动端,非全屏状态不展示云台"),!1;t.Ptz.show(),t.setDecoderState({pantile:!0})}};break;case"expend":r.title=this.jSPlugin.i18n.t("BTN_EXPEND"),r.id=e,r.domString='<span><svg id="'.concat(this.jSPlugin.id,'-expend-icon" class="theme-icon-item-icon" fill="').concat(r.color,'" version="1.1" xmlns="http://www.w3.org/2000/svg" width="').concat(this.jSPlugin.width>We?48:32,'" height="').concat(this.jSPlugin.width>We?48:32,'" viewBox="-6 -6 32 32">')+'<path d="M3.4,7.6c-0.3,0-0.5-0.2-0.5-0.5V5.3c0-1.2,1-2.3,2.2-2.3h1.8c0.3,0,0.5,0.2,0.5,0.5S7.2,4.1,6.9,4.1H5.2 c-0.7,0-1.2,0.6-1.2,1.3v1.8C3.9,7.4,3.7,7.6,3.4,7.6z" /><path d="M6.9,18.1H5.2c-1.2,0-2.2-1-2.2-2.2v-1.8c0-0.3,0.2-0.5,0.5-0.5s0.5,0.2,0.5,0.5v1.8c0,0.7,0.6,1.2,1.2,1.2 h1.8c0.3,0,0.5,0.2,0.5,0.5S7.2,18.1,6.9,18.1z" /><path d="M15.7,18.1h-1.8c-0.3,0-0.5-0.2-0.5-0.5s0.2-0.5,0.5-0.5h1.8c0.7,0,1.2-0.6,1.2-1.2v-1.8 c0-0.3,0.2-0.5,0.5-0.5s0.5,0.2,0.5,0.5v1.8C17.9,17.1,16.9,18.1,15.7,18.1z" /><path d="M17.4,7.6c-0.3,0-0.5-0.2-0.5-0.5V5.3c0-0.7-0.6-1.3-1.2-1.3h-1.8c-0.3,0-0.5-0.2-0.5-0.5s0.2-0.5,0.5-0.5h1.8 c1.2,0,2.2,1,2.2,2.3v1.8C17.9,7.4,17.7,7.6,17.4,7.6z" /></svg>'+'<svg id="'.concat(this.jSPlugin.id,'-unexpend-icon" class="theme-icon-item-icon" style="display:none" width="').concat(this.jSPlugin.width>We?48:32,'" height="').concat(this.jSPlugin.width>We?48:32,'" fill="').concat(r.color,'" viewBox="-6 -6 32 32">\n <path class="st1" d="M5.7,8.1H3.9c-0.3,0-0.6-0.2-0.6-0.6S3.6,7,3.9,7h1.9c0.7,0,1.3-0.6,1.3-1.3V3.8c0-0.3,0.2-0.6,0.6-0.6\n s0.6,0.2,0.6,0.6v1.9C8.2,7,7.1,8.1,5.7,8.1z"/>\n <path class="st1" d="M7.6,17.7c-0.3,0-0.6-0.2-0.6-0.6v-1.9c0-0.7-0.6-1.3-1.3-1.3H3.9c-0.3,0-0.6-0.2-0.6-0.6s0.2-0.6,0.6-0.6h1.9\n c1.3,0,2.4,1.1,2.4,2.4v1.9C8.2,17.5,7.9,17.7,7.6,17.7z"/>\n <path class="st1" d="M13.4,17.7c-0.3,0-0.6-0.2-0.6-0.6v-1.9c0-1.3,1.1-2.4,2.4-2.4h1.9c0.3,0,0.6,0.2,0.6,0.6S17.5,14,17.2,14\n h-1.9c-0.7,0-1.3,0.6-1.3,1.3v1.9C14,17.5,13.8,17.7,13.4,17.7z"/>\n <path class="st1" d="M17.2,8.1h-1.9c-1.3,0-2.4-1.1-2.4-2.4V3.8c0-0.3,0.2-0.6,0.6-0.6S14,3.5,14,3.8v1.9C14,6.4,14.6,7,15.3,7h1.9\n c0.3,0,0.6,0.2,0.6,0.6S17.5,8.1,17.2,8.1z"/>\n </svg>\n </span>'),r.onclick=function(){var e=t.decoderState.state,n=e.expend,i=e.pantile;if(e.play)if(n)if(t.isMobile){var o=t._extendHeadeTimeLinrHight(!0);document.getElementById("".concat(t.jSPlugin.id,"-ez-iframe-footer-container"))&&(document.getElementById("".concat(t.jSPlugin.id,"-ez-iframe-footer-container")).style.marginTop="-32px"),document.getElementById("".concat(t.jSPlugin.id,"-select-speed"))&&(document.getElementById("".concat(t.jSPlugin.id,"-select-speed")).style.background="#ffffff"),function(e,t,n){var i="";i+="width:"+t+"px;",i+="height:"+n+"px;",i+="-webkit-transform: none; transform: none;",i+="-webkit-transform-origin: 0 0;",i+="transform-origin: 0 0;",i+="position: relative;",e.style.cssText=i}(document.getElementById("".concat(t.jSPlugin.id,"-wrap")),t.jSPlugin.width,t.jSPlugin.height),console.log("[mobile cancelMobileFullScreen]"),document.getElementById("".concat(t.jSPlugin.id,"-wrap")).classList.remove("ezuikit-player-wrap-mobile-fullscreen"),t.jSPlugin.jSPlugin.JS_Resize(t.jSPlugin.width,t.jSPlugin.height-o),i&&t.Ptz&&(t.Ptz.hide(),t.setDecoderState({pantile:!1})),t.jSPlugin.fullScreenWidth=t.jSPlugin.width,t.jSPlugin.fullScreenHeight=t.jSPlugin.height,t.jSPlugin.Zoom&&t.jSPlugin.Zoom.handleFullscreen&&t.jSPlugin.Zoom.handleFullscreen(!n,t.jSPlugin.width,t.jSPlugin.height),document.getElementById("".concat(t.jSPlugin.id,"-pantile-icon"))&&(document.getElementById("".concat(t.jSPlugin.id,"-pantile-icon")).style.display="none"),document.getElementById("".concat(t.jSPlugin.id,"-hdSelect"))&&(document.getElementById("".concat(t.jSPlugin.id,"-hdSelect")).style.bottom="calc(constant(safe-area-inset-bottom) + 100px)",document.getElementById("".concat(t.jSPlugin.id,"-hdSelect")).style.bottom="calc(env(safe-area-inset-bottom) + 100px)",document.getElementById("".concat(t.jSPlugin.id,"-hdSelect")).style.height=45*t.jSPlugin.videoLevelList.length+"px"),t.setDecoderState({expend:!1})}else t.jSPlugin.exitFullscreen();else if(t.isMobile){var a=t._extendHeadeTimeLinrHight(!0);j(document.getElementById("".concat(t.jSPlugin.id,"-wrap"))),document.getElementById("".concat(t.jSPlugin.id,"-wrap")).classList.add("ezuikit-player-wrap-mobile-fullscreen"),console.log("[mobile requestMobileFullScreen]");var r=document.documentElement.clientWidth,s=document.documentElement.clientHeight;document.getElementById("".concat(t.jSPlugin.id))&&(document.getElementById("".concat(t.jSPlugin.id)).style["backface-visibility"]="hidden"),document.getElementById("".concat(t.jSPlugin.id,"-select-speed"))&&(document.getElementById("".concat(t.jSPlugin.id,"-select-speed")).style.background="none"),t.jSPlugin.jSPlugin.JS_Resize(s,r-a,!0),t.jSPlugin.fullScreenWidth=s,t.jSPlugin.fullScreenHeight=r-a,t.jSPlugin.Zoom&&t.jSPlugin.Zoom.handleFullscreen&&t.jSPlugin.Zoom.handleFullscreen(!n,s,r-a),document.getElementById("".concat(t.jSPlugin.id,"-pantile-icon"))&&(document.getElementById("".concat(t.jSPlugin.id,"-pantile-icon")).style.display="block"),document.getElementById("".concat(t.jSPlugin.id,"-hdSelect"))&&(document.getElementById("".concat(t.jSPlugin.id,"-hdSelect")).style.bottom=0,document.getElementById("".concat(t.jSPlugin.id,"-hdSelect")).style.height="100%"),t.setDecoderState({expend:!0})}else t.jSPlugin.fullscreen()};break;case"webExpend":if(s)break;r.title=this.jSPlugin.i18n.t("BTN_WEBEXPEND"),r.id=e,r.domString='<span><svg id="'.concat(this.jSPlugin.id,'-webExpend-icon" class="theme-icon-item-icon" fill="').concat(r.color,'" version="1.1" xmlns="http://www.w3.org/2000/svg" width="').concat(this.jSPlugin.width>We?48:32,'" height="').concat(this.jSPlugin.width>We?48:32,'" viewBox="-6 -6 32 32">')+'<path d="M3.1,7.6c-0.3,0-0.5-0.2-0.5-0.5V5.3c0-1.2,1-2.3,2.2-2.3h1.8c0.3,0,0.5,0.2,0.5,0.5S6.8,4.1,6.6,4.1H4.8 c-0.7,0-1.2,0.6-1.2,1.3v1.8C3.6,7.4,3.3,7.6,3.1,7.6z" /><path d="M15.3,18.1h-1.8c-0.3,0-0.5-0.2-0.5-0.5s0.2-0.5,0.5-0.5h1.8c0.7,0,1.2-0.6,1.2-1.2v-1.8 c0-0.3,0.2-0.5,0.5-0.5s0.5,0.2,0.5,0.5v1.8C17.6,17.1,16.6,18.1,15.3,18.1z" /><circle class="st2" cx="10.2" cy="10.4" r="1.1"/></svg>'+'<svg class="theme-icon-item-icon" fill="'.concat(r.color,'" style="display:none;" version="1.1" xmlns="http://www.w3.org/2000/svg" width="').concat(this.jSPlugin.width>We?48:32,'" height="').concat(this.jSPlugin.width>We?48:32,'" viewBox="-6 -6 32 32">\n <path class="st1" d="M5.4,8.1H3.5C3.2,8.1,3,7.9,3,7.6s0.2-0.5,0.5-0.5h1.9c0.8,0,1.4-0.6,1.4-1.4V3.8c0-0.3,0.2-0.5,0.5-0.5\n s0.5,0.2,0.5,0.5v1.9C7.7,7,6.7,8.1,5.4,8.1z"/>\n <path class="st1" d="M13.1,17.7c-0.3,0-0.5-0.2-0.5-0.5v-1.9c0-1.3,1.1-2.4,2.4-2.4h1.9c0.3,0,0.5,0.2,0.5,0.5s-0.2,0.5-0.5,0.5H15\n c-0.8,0-1.4,0.6-1.4,1.4v1.9C13.6,17.4,13.4,17.7,13.1,17.7z"/>\n <circle class="st2" cx="10.2" cy="10.4" r="1.1"/>\n ')+"</svg></span>",r.onclick=function(){var e=t.decoderState.state,n=e.webExpend;if(e.expend)return console.log("正在全局全屏"),!1;window.recTimer&&Array.isArray(window.recTimer[t.jSPlugin.id])&&(window.recTimer[t.jSPlugin.id].map((function(e){clearInterval(e)})),window.recTimer[t.jSPlugin.id]=[]),n?t.jSPlugin.exitBrowserFullscreen():t.jSPlugin.browserFullscreen(),t.jSPlugin.Theme.Rec&&setTimeout((function(){t.jSPlugin.Theme.Rec.recAutoSize()}),100)};break;case"hd":if(s)break;var l="".concat(this.jSPlugin.id,"-select-quality"),d="".concat(l,"-item");r.title=this.jSPlugin.i18n.t("BTN_HD"),r.id=e;var u="",m="";return this.jSPlugin.videoLevelList.findIndex((function(e){return e.level==t.jSPlugin.videoLevel}))>-1?this.jSPlugin.videoLevelList.map((function(e){u+='<li class="selectOption default '.concat(d,'" style="height: ').concat(c,"px;text-align: center;line-height: ").concat(c,'px;list-style: none;cursor: pointer;" name="option" data-type="').concat(e.level,'" id="').concat(l,"_").concat(e.level,'">').concat(t.jSPlugin.i18n.t(Ne[e.level]),"</li>"),e.level==t.jSPlugin.videoLevel&&(m+=t._videoLevelIcon(t.jSPlugin.id,l,t.jSPlugin.width,We,e))})):this.jSPlugin.videoLevelList.map((function(e,n){0===n&&(m+=t._videoLevelIcon(t.jSPlugin.id,l,t.jSPlugin.width,We,e)),u+='<li class="selectOption default '.concat(d,'" style="height: ').concat(c,"px;text-align: center;line-height: ").concat(c,'px;list-style: none;cursor: pointer;" name="option" data-type="').concat(e.level,'" id="').concat(l,"_").concat(e.level,'">').concat(t.jSPlugin.i18n.t(Ne[e.level]),"</li>")})),u+='<li class="selectOption cancel" style="background: #ffffff;'.concat(this.isMobile?"":"display:none;",'" name="option" id="').concat(this.jSPlugin.id,'-select-speed">').concat(this.jSPlugin.i18n.t("SPEED_CANCEL"),"</li>"),m+='<span class=\'speed-select-mask\' style="display:none;height: 100vh;" id="'.concat(this.jSPlugin.id,'-select-hd-mask"></span>'),r.domString='<ul id="'.concat(this.jSPlugin.id,'-hdSelect" class="hd speed-select ').concat(this.isMobile?"mobile":"",'" style="display:none;bottom: calc(constant(safe-area-inset-bottom) + ').concat(this.isMobile?"100px":"50px",") !important;bottom: calc(env(safe-area-inset-bottom) + ").concat(this.isMobile?"100px":"50px",") !important;height: ").concat(this.jSPlugin.videoLevelList.length*c,'px">\n ').concat(u,'\n </ul>\n <span id="').concat(this.jSPlugin.id,'-hdSelect-icon-warp" style="user-select: none;">\n ').concat(m,"\n </span>"),r.onclick=function(e){var n=t.decoderState.state,i=n.expend,o=n.recordvideo,a=n.play,r=n.zoom,s=n.pantile,c=n.sound,d=n.talk;if(e.stopPropagation(),a){var u=e.target.id,m=e.target.getAttribute("data-type");if(0===u.indexOf(l)){if(t.jSPlugin.videoLevel+""!==m){if(d){var h=re.getGlobalState(),p=re.getInstance(t.jSPlugin.id);t.setDecoderState({talk:!1}),document.getElementById("".concat(t.jSPlugin.id,"-volume-column"))&&(document.getElementById("".concat(t.jSPlugin.id,"-volume-column")).style.display="none"),t.jSPlugin.Talk.stopTalk(),h.talk&&re.setGlobalState({talk:!1}),p.getState().talk&&p.setState({talk:!1})}var g=t.jSPlugin.videoLevelList.find((function(e){return e.level+""===m}));!g||g.streamTypeIn===t.jSPlugin.streamTypeIn&&g.level+""==t.jSPlugin.videoLevel+""||(t.jSPlugin.changeVideoLevel(g).then((function(e){c&&t.jSPlugin.openSound()})),r&&(t.jSPlugin.Zoom.stopZoom(),t.setDecoderState({zoom:!1})))}t.resetMobileZoomStatus(),o&&t.setDecoderState({recordvideo:!1})}t.showHD=!t.showHD,document.getElementById("".concat(t.jSPlugin.id,"-hdSelect"))&&(document.getElementById("".concat(t.jSPlugin.id,"-hdSelect")).style.display="none"===document.getElementById("".concat(t.jSPlugin.id,"-hdSelect")).style.display?"block":"none",t.isMobile&&(document.getElementById("".concat(t.jSPlugin.id,"-select-hd-mask")).style.display="none"===document.getElementById("".concat(t.jSPlugin.id,"-select-hd-mask")).style.display?"block":"none"),t.themeData.autoFocus>0&&("none"===document.getElementById("".concat(t.jSPlugin.id,"-hdSelect")).style.display?t.startAutoFocus():t.stopAutoFocus())),t.isMobile&&i&&t.showHD?document.getElementById("".concat(t.jSPlugin.id,"-hdSelect")).className="hd speed-select mobile expend":document.getElementById("".concat(t.jSPlugin.id,"-hdSelect")).className=t.isMobile?"hd speed-select mobile":"speed-select",s&&t.Ptz&&(t.Ptz.hide(),t.setDecoderState({pantile:!1}))}},r;case"speed":if(s)break;r.title=this.jSPlugin.i18n.t("BTN_SPEED"),r.id=e,r.domString='<ul id="'.concat(this.jSPlugin.id,'-speedSelect" class="speed speed-select ').concat(this.isMobile?"mobile":"",'" style="display:none;bottom: calc(constant(safe-area-inset-bottom) + ').concat(this.isMobile?"100px":"50px",") !important;bottom: calc(env(safe-area-inset-bottom) + ").concat(this.isMobile?"100px":"50px",') !important;">')+'<li class="selectOption default" style="height: '.concat(c,"px;text-align: center;line-height: ").concat(c,'px;list-style: none;cursor: pointer;font-size: 13px;" name="option" id="').concat(this.jSPlugin.id,'-select-speed4">4').concat(this.jSPlugin.i18n.t("SPEED_RATE"),"</li>")+'<li class="selectOption default" style="height: '.concat(c,"px;text-align: center;line-height: ").concat(c,'px;list-style: none;cursor: pointer;font-size: 13px;" name="option" id="').concat(this.jSPlugin.id,'-select-speed2">2').concat(this.jSPlugin.i18n.t("SPEED_RATE"),"</li>")+'<li class="selectOption active" style="height: '.concat(c,"px;text-align: center;line-height: ").concat(c,'px;list-style: none;cursor: pointer;font-size: 13px;" name="option" id="').concat(this.jSPlugin.id,'-select-speed1">1').concat(this.jSPlugin.i18n.t("SPEED_RATE"),"</li>")+'<li class="selectOption default" style="height: '.concat(c,"px;text-align: center;line-height: ").concat(c,'px;list-style: none;cursor: pointer;font-size: 13px;" name="option" id="').concat(this.jSPlugin.id,'-select-speed05">0.5').concat(this.jSPlugin.i18n.t("SPEED_RATE"),"</li>")+'<li class="selectOption cancel" style="'.concat(this.isMobile?"":"display:none;",'" name="option" id="').concat(this.jSPlugin.id,'-select-speed">').concat(this.jSPlugin.i18n.t("SPEED_CANCEL"),"</li>")+"</ul>"+'<span>\n <div style="font-size: 12px;\n vertical-align: bottom;\n display: inline-flex;\n padding: 0px 7px;\n width: 48px;\n line-height: 24px;\n justify-content: center;\n border: 1px solid '.concat(r.color,';\n text-align: center;border-radius: 12.5px; user-select: none;"\n id="').concat(this.jSPlugin.id,'-speed-text"\n >').concat(1===this.nextRate?this.jSPlugin.i18n.t("SPEED"):"".concat(this.nextRate).concat(this.jSPlugin.i18n.t("SPEED_RATE")).replace("3","0.5"),"</div>\n ")+'<span class=\'speed-select-mask\' style="display:none;height: 100vh;" id="'.concat(this.jSPlugin.id,'-select-mask"></span>')+"</span>",r.onclick=function(e){var n=t.decoderState.state,i=n.speed,o=n.expend,a=n.play;if(e.stopPropagation(),!a)return!1;if(!i&&t.isMobile&&(document.getElementById("".concat(t.jSPlugin.id,"-speedSelect")).className=o?"speed speed-select mobile expend":"speed speed-select mobile"),t.isMobile&&(o?(document.getElementById("".concat(t.jSPlugin.id,"-speedSelect")).style.bottom="constant(safe-area-inset-bottom)",document.getElementById("".concat(t.jSPlugin.id,"-speedSelect")).style.bottom="env(safe-area-inset-bottom)"):(document.getElementById("".concat(t.jSPlugin.id,"-speedSelect")).style.bottom="calc(constant(safe-area-inset-bottom) + 100px)",document.getElementById("".concat(t.jSPlugin.id,"-speedSelect")).style.bottom="calc(env(safe-area-inset-bottom) + 100px)")),t.nextRate=1,e.target.id)switch(e.target.id){case"".concat(t.jSPlugin.id,"-select-speed1"):t.nextRate=1,t.jSPlugin.jSPlugin.JS_Speed(t.nextRate),t.changeRecSpeed(1),t.jSPlugin.speed=1,t.setDecoderState({speed:!i});break;case"".concat(t.jSPlugin.id,"-select-speed2"):t.nextRate=2,t.jSPlugin.jSPlugin.JS_Speed(t.nextRate),t.changeRecSpeed(2),t.jSPlugin.speed=2,t.setDecoderState({speed:!i});break;case"".concat(t.jSPlugin.id,"-select-speed4"):t.nextRate=4,t.jSPlugin.jSPlugin.JS_Speed(t.nextRate),t.changeRecSpeed(4),t.jSPlugin.speed=4,t.setDecoderState({speed:!i});break;case"".concat(t.jSPlugin.id,"-select-speed05"):t.nextRate=3,t.jSPlugin.jSPlugin.JS_Speed(t.nextRate),t.changeRecSpeed(.5),t.jSPlugin.speed=.5,t.setDecoderState({speed:!i});break;default:t.isMobile?t.setDecoderState({speed:!i}):t.setDecoderState({speed:!0})}t.isMobile&&e.target.id==="".concat(t.jSPlugin.id,"-speed-text")?document.getElementById("".concat(t.jSPlugin.id,"-speedSelect")).style.display="block":document.getElementById("".concat(t.jSPlugin.id,"-speedSelect"))&&(document.getElementById("".concat(t.jSPlugin.id,"-speedSelect")).style.display="none"===document.getElementById("".concat(t.jSPlugin.id,"-speedSelect")).style.display?"block":"none"),t.setDecoderState({speed:!i}),t.themeData.autoFocus>0&&("none"===document.getElementById("".concat(t.jSPlugin.id,"-speedSelect")).style.display?t.startAutoFocus():t.stopAutoFocus())};break;case"deviceName":r.title=this.jSPlugin.i18n.t("DEVICE_NAME"),r.id=e,r.domString="<span>".concat(this.jSPlugin.i18n.t("DEVICE_NAME"),"</span>"),r.onclick=function(){};break;case"deviceID":r.title=this.jSPlugin.i18n.t("DEVICE_ID"),r.id=e,r.domString="<span>".concat(this.jSPlugin.i18n.t("DEVICE_ID"),"</span>"),r.onclick=function(){};break;case"cloudRec":if(this.jSPlugin._isCloudRecord)break;r.title=this.jSPlugin.i18n.t("BTN_CLOUDREC"),r.id=e,r.domString='\n <span>\n <svg class="theme-icon-item-icon" fill="'.concat(r.color,'" version="1.1" xmlns="http://www.w3.org/2000/svg" width="').concat(this.jSPlugin.width>We?48:32,'" height="').concat(this.jSPlugin.width>We?48:32,'" viewBox="-10 0 40 15">\n\t<path d="M9.5,13.1c-0.3,0-0.5-0.2-0.5-0.5V8.8c0-0.3,0.2-0.5,0.5-0.5S10,8.5,10,8.8v3.8C10,12.8,9.8,13.1,9.5,13.1z"/>\n\t<path d="M7.6,10.6c-0.1,0-0.3-0.1-0.4-0.2C7,10.2,7,9.9,7.3,9.7l1.9-1.7c0.2-0.2,0.5-0.2,0.7,0l1.8,1.7\n\t\tc0.2,0.2,0.2,0.5,0,0.7c-0.2,0.2-0.5,0.2-0.7,0L9.5,9.1l-1.6,1.4C7.8,10.6,7.7,10.6,7.6,10.6z"/>\n\t<path d="M13.2,15.7H5.6c-2.1-0.1-3.8-1.8-3.8-3.9c0-1.8,1.3-3.4,3-3.8c0.4-2.2,2.3-3.9,4.6-3.9c2.3,0,4.2,1.7,4.6,3.8\n\t\tc1.8,0.4,3.1,1.9,3.1,3.8C17.1,13.9,15.4,15.7,13.2,15.7z M5.6,14.7h7.6c1.6,0,2.9-1.3,2.9-2.9c0-1.5-1.1-2.7-2.6-2.9l-0.4,0l0-0.4\n\t\tc-0.2-1.9-1.7-3.3-3.6-3.3C7.5,5.1,6,6.6,5.8,8.5l0,0.4l-0.4,0c-1.4,0.2-2.5,1.4-2.5,2.9C2.8,13.3,4.1,14.6,5.6,14.7z"/>\n </svg>\n </span>\n '),r.onclick=function(){var e=t.decoderState.state.sound;t.setDecoderState({type:"cloud.rec",cloudRec:!0,rec:!1}),t.jSPlugin.eventEmitter.emit("recTypeChange",{eventType:"recTypeChange",code:0,data:{type:"cloud"}}),t.jSPlugin.changePlayUrl({type:"cloud.rec"},(function(){var e=I("begin",t.jSPlugin.url)||(new Date).Format("yyyyMMdd");t.Rec.renderRec("".concat(e.slice(0,4),"-").concat(e.slice(4,6),"-").concat(e.slice(6,8))),t.decoderState.state.zoom&&(t.setDecoderState({zoom:!1}),t.jSPlugin.Zoom.stopZoom(),t.jSPlugin.close3DZoom()),t.Rec&&t.Rec.syncTimeLine()}),!1).then((function(){e&&t.jSPlugin.openSound()}))};break;case"cloudRecord":if(!this.jSPlugin._isCloudRecord)break;r.title=this.jSPlugin.i18n.t("BTN_CLOUDRECORD"),r.id=e,r.domString='<span style="font-size: 24px; width: 48px; display: inline-block; text-align: center;line-height: 56px;"> \n<svg class="theme-icon-item-icon" fill="'.concat(r.color,'" version="1.1" height="1em" viewBox="0 0 48 49">\n<g transform="translate(3.000000, 10.000000)">\n\t<g><path d="M38.1,24.2c-0.8,0-1.6-0.2-2.3-0.6L31,20.9l1.5-2.6l4.8,2.7c0.3,0.1,0.5,0.2,0.8,0.2c1,0,1.8-0.8,1.8-1.8V9.6\n\t\t\tc0-0.3-0.1-0.5-0.2-0.8c-0.2-0.4-0.6-0.8-1-0.9c-0.4-0.2-0.9-0.1-1.3,0.1l-5,2.4l-1.3-2.7l5-2.4c1.1-0.5,2.4-0.6,3.6-0.2\n\t\t\tc1.2,0.4,2.2,1.3,2.7,2.5c0.3,0.6,0.4,1.3,0.4,2v9.8C42.8,22,40.7,24.2,38.1,24.2z"/>\n\t</g>\n\t<g><path d="M27.7,30H4.9c-3.5,0-6.4-2.9-6.4-6.4V5.4C-1.5,1.9,1.4-1,4.9-1h22.8c3.5,0,6.4,2.9,6.4,6.4v18.1\n\t\t\tC34.1,27.1,31.2,30,27.7,30z M4.9,2C3,2,1.5,3.5,1.5,5.4v18.1C1.5,25.5,3,27,4.9,27h22.8c1.9,0,3.4-1.5,3.4-3.4V5.4\n\t\t\tc0-1.9-1.5-3.4-3.4-3.4H4.9z"/>\n\t</g><g><path d="M12.1,7.1c0.9,0,1.6,0.7,1.6,1.5c0,0.8-0.6,1.4-1.4,1.5l-0.2,0H8.9c-0.9,0-1.6-0.7-1.6-1.5\n\t\t\tc0-0.8,0.6-1.4,1.4-1.5l0.2,0H12.1z"/></g></g></svg></span>'),r.onclick=function(){var e=t.decoderState.state.sound;t.setDecoderState({type:"cloud.rec",cloudRec:!0,rec:!1}),t.jSPlugin.eventEmitter.emit("recTypeChange",{eventType:"recTypeChange",code:0,data:{type:"cloudRecord"}}),t.jSPlugin.url.replace(/rec\??|cloud.rec\??/,"cloud.rec?busType=7"),t.jSPlugin.changePlayUrl({type:"cloud.rec"},(function(){t.jSPlugin._isCloudRecord&&t.changeTheme("pcRec");var e=I("begin",t.jSPlugin.url)||(new Date).Format("yyyyMMdd");t.Rec.renderRec("".concat(e.slice(0,4),"-").concat(e.slice(4,6),"-").concat(e.slice(6,8))),t.decoderState.state.zoom&&(t.setDecoderState({zoom:!1}),t.jSPlugin.Zoom.stopZoom(),t.jSPlugin.close3DZoom()),t.Rec&&t.Rec.syncTimeLine()}),!1).then((function(){e&&t.jSPlugin.openSound()}))};break;case"rec":r.title=this.jSPlugin.i18n.t("BTN_REC"),r.id=e,r.domString='\n <span>\n <svg class="theme-icon-item-icon" fill='.concat(r.color,' version="1.1" xmlns="http://www.w3.org/2000/svg" width="').concat(this.jSPlugin.width>We?48:32,'" height="').concat(this.jSPlugin.width>We?48:32,'" viewBox="0 0 40 15">\n <path d="M13,16.3H5.5c-1.1,0-2-0.9-2-2V3.8c0-1.1,0.9-2,2-2h5.4c0.5,0,1,0.2,1.4,0.6l2.1,2.1C14.8,4.8,15,5.3,15,5.9\n v8.4C15,15.4,14.1,16.3,13,16.3z M5.5,2.8c-0.6,0-1,0.4-1,1v10.5c0,0.6,0.4,1,1,1H13c0.6,0,1-0.4,1-1V5.9c0-0.3-0.1-0.5-0.3-0.7\n L11.6,3c-0.2-0.2-0.4-0.3-0.7-0.3H5.5z"/>\n<path d="M6.3,7.3C6,7.3,5.8,7,5.8,6.8V4.5C5.8,4.2,6,4,6.3,4s0.5,0.2,0.5,0.5v2.2C6.8,7,6.6,7.3,6.3,7.3z"/>\n<path d="M8.5,7.3C8.3,7.3,8,7,8,6.8V4.5C8,4.2,8.3,4,8.5,4S9,4.2,9,4.5v2.2C9,7,8.8,7.3,8.5,7.3z"/>\n<path d="M10.8,7.3c-0.3,0-0.5-0.2-0.5-0.5V4.5c0-0.3,0.2-0.5,0.5-0.5s0.5,0.2,0.5,0.5v2.2C11.3,7,11.1,7.3,10.8,7.3z"\n />\n </svg>\n </span>\n '),r.onclick=function(){var e=t.decoderState.state.sound;t.setDecoderState({type:"rec",cloudRec:!1,rec:!0}),t.jSPlugin.eventEmitter.emit("recTypeChange",{eventType:"recTypeChange",code:0,data:{type:"local"}}),t.jSPlugin.changePlayUrl({type:"rec"},(function(){t.jSPlugin._isCloudRecord&&t.changeTheme("pcRec");var e=I("begin",t.jSPlugin.url)||(new Date).Format("yyyyMMdd");t.Rec.renderRec("".concat(e.slice(0,4),"-").concat(e.slice(4,6),"-").concat(e.slice(6,8))),t.decoderState.state.zoom&&(t.setDecoderState({zoom:!1}),t.jSPlugin.Zoom.stopZoom(),t.jSPlugin.close3DZoom()),t.Rec&&t.Rec.syncTimeLine()}),!1).then((function(){e&&t.jSPlugin.openSound()}))}}return r}},{key:"_videoLevelIcon",value:function(e,t,n,i,o){return'\n <span id="'.concat(e,'-videoLevel-icon" class="theme-icon-item-icon ').concat(t,"-btn\" data-type='").concat(o.level,"' style=\"display: inline-block;min-width: 48px;height: ").concat(n>i?48:32,"px;line-height: ").concat(n>i?48:30,'px;text-align: center;">\n ').concat(this.jSPlugin.i18n.t(Ne[o.level]),"\n </span>\n ")}},{key:"_fullScreenChangeEvent",value:function(){var e=this,t=document.getElementById("".concat(this.jSPlugin.id,"-wrap")),i=document.getElementById("".concat(this.jSPlugin.id)),o=this;this._fullscreenchange=function(n){var a=o.decoderState.state.zoom;n.target===i?e.jSPlugin.isCurrentFullscreen?o.setDecoderState({expend:!0,webExpend:!1}):(o.setDecoderState({expend:!1,webExpend:!1}),a&&o.jSPlugin.use3DZoom&&o.jSPlugin.enable3DZoom()):n.target===t&&(e.jSPlugin.isCurrentBrowserFullscreen?o.setDecoderState({webExpend:!0}):o.setDecoderState({webExpend:!1})),o.Rec&&window.randomNum==o.jSPlugin.randomNum&&setTimeout((function(){o.Rec.recAutoSize((function(){if(o.jSPlugin.Zoom.currentScale>1){var e=o.jSPlugin.Zoom.currentScale;o.jSPlugin.Zoom.stopZoom(),setTimeout((function(){o.jSPlugin.Zoom.startZoom(),o.jSPlugin.Zoom.currentScale=e,o.jSPlugin.Zoom.doScale(e)}),200)}}))}),100),document.getElementById("".concat(o.jSPlugin.id,"-hdSelect"))&&(document.getElementById("".concat(o.jSPlugin.id,"-hdSelect")).style.display="none"),document.getElementById("".concat(o.jSPlugin.id,"-speedSelect"))&&(document.getElementById("".concat(o.jSPlugin.id,"-speedSelect")).style.display="none"),o.isMobile&&(document.getElementById("".concat(o.jSPlugin.id,"-select-hd-mask"))&&(document.getElementById("".concat(o.jSPlugin.id,"-select-hd-mask")).style.display="none"),document.getElementById("".concat(o.jSPlugin.id,"-select-mask"))&&(document.getElementById("".concat(o.jSPlugin.id,"-select-mask")).style.display="none")),o.themeData.autoFocus>0&&o.startAutoFocus(),e.setDecoderState({speed:!1})},n.isEnabled&&n.on("change",this._fullscreenchange)}},{key:"changeRecSpeed",value:function(e){var t=this,n=function(e){if(!document.getElementById("".concat(t.jSPlugin.id,"-speedSelect")))return!1;document.getElementById("".concat(t.jSPlugin.id,"-speedSelect")).childNodes[0].className=document.getElementById("".concat(t.jSPlugin.id,"-speedSelect")).childNodes[0].className.replace("active","default"),document.getElementById("".concat(t.jSPlugin.id,"-speedSelect")).childNodes[1].className=document.getElementById("".concat(t.jSPlugin.id,"-speedSelect")).childNodes[1].className.replace("active","default"),document.getElementById("".concat(t.jSPlugin.id,"-speedSelect")).childNodes[2].className=document.getElementById("".concat(t.jSPlugin.id,"-speedSelect")).childNodes[2].className.replace("active","default"),document.getElementById("".concat(t.jSPlugin.id,"-speedSelect")).childNodes[3].className=document.getElementById("".concat(t.jSPlugin.id,"-speedSelect")).childNodes[3].className.replace("active","default"),document.getElementById("".concat(t.jSPlugin.id,"-speedSelect")).childNodes[e].className=document.getElementById("".concat(t.jSPlugin.id,"-speedSelect")).childNodes[e].className.replace("default","active")},i="1";switch(e){case 1:n(2),i=this.jSPlugin.i18n.t("SPEED");break;case 2:n(1),i="".concat(e).concat(this.jSPlugin.i18n.t("SPEED_RATE"));break;case 4:n(0),i="".concat(e).concat(this.jSPlugin.i18n.t("SPEED_RATE"));break;case.5:n(3),i="".concat(e).concat(this.jSPlugin.i18n.t("SPEED_RATE"));break;default:n(2),i="".concat(e).concat(this.jSPlugin.i18n.t("SPEED_RATE"))}document.getElementById("".concat(this.jSPlugin.id,"-speed-text"))&&(document.getElementById("".concat(this.jSPlugin.id,"-speed-text")).innerHTML=i)}},{key:"initThemeData",value:function(){var e=this,t=this.themeData,n=t.header,o=t.footer,a=this.jSPlugin.id;if(this.header=me,this.footer=he,this.isNeedRenderHeader=i.findIndex(n.btnList,(function(e){return e.isrender>0}))>=0&&"miniRec"!=this.jSPlugin.id,this.isMobile&&(this.isNeedRenderHeader=i.findIndex(n.btnList,(function(e){return e.isrender>0&&"deviceID"===e.iconId||e.isrender>0&&"deviceName"===e.iconId}))>=0&&"miniRec"!=this.jSPlugin.id),this.isNeedRenderFooter=i.findIndex(o.btnList,(function(e){return e.isrender>0}))>=0&&"miniRec"!=this.jSPlugin.id,this.isNeedRenderTimeLine=i.findIndex(n.btnList,(function(e){return"cloudRec"===e.iconId&&1===e.isrender||"rec"===e.iconId&&1===e.isrender}))>=0&&!this.jSPlugin.disabledTimeLine&&"miniRec"!=this.jSPlugin.id,["date-switch-container-wrap","rec-type-container-wrap","mobile-rec-wrap","mobile-ez-ptz-container"].forEach((function(e,t){document.getElementById(e)&&document.getElementById(e).parentElement.removeChild(document.getElementById(e))})),this.isNeedRenderHeader){if(document.getElementById("".concat(this.jSPlugin.id,"-headControl")))document.getElementById("".concat(this.jSPlugin.id,"-headControl")).innerHTML="<div id='".concat(this.jSPlugin.id,"-headControl-left' style='display:flex;width: calc(100% - 100px);'></div><div id='").concat(this.jSPlugin.id,"-headControl-right' style='display:flex'></div>");else{var r=document.createElement("div");r.setAttribute("id","".concat(this.jSPlugin.id,"-headControl")),r.setAttribute("class","header-controls"),r.innerHTML="<div id='".concat(this.jSPlugin.id,"-headControl-left' class=\"header-controls-left\" style='display:flex;width:calc(100% - 100px);overflow:hidden;'></div><div id='").concat(this.jSPlugin.id,"-headControl-right' class=\"header-controls-right\" style='display:flex;'></div>");var s={height:this.jSPlugin.width>We?"48px":"32px","line-height":this.jSPlugin.width>We?"48px":"32px",display:"flex","justify-content":"space-between",top:0,left:0,right:0,"z-index":999,"background-color":"rgba(0,0,0,.8)",color:"#FFFFFF",width:"100%",position:"absolute"};r.style=Ze(s),document.getElementById("".concat(a,"-wrap")).insertBefore(r,document.getElementById(a))}var c=document.getElementById("".concat(a,"-wrap")).classList.contains("ezuikit-player-wrap-mobile-fullscreen");!document.getElementById("".concat(this.jSPlugin.id,"-headControl"))||this.jSPlugin._isCurrentBrowserFullscreen||c||this.jSPlugin.jSPlugin.JS_Resize(this.jSPlugin.width,this.jSPlugin.height-this._extendHeadeTimeLinrHight(!1),!0)}else document.getElementById("".concat(this.jSPlugin.id,"-headControl"))&&document.getElementById("".concat(this.jSPlugin.id,"-headControl")).parentElement.removeChild(document.getElementById("".concat(this.jSPlugin.id,"-headControl"))),!document.getElementById("".concat(this.jSPlugin.id,"-headControl"))||this.jSPlugin._isCurrentBrowserFullscreen||isMobileFullscreen||this.jSPlugin.jSPlugin.JS_Resize(this.jSPlugin.width,this.jSPlugin.height-this._extendHeadeTimeLinrHight(!1),!0);if(this.isNeedRenderFooter)if(document.getElementById("".concat(this.jSPlugin.id,"-ez-iframe-footer-container")))document.getElementById("".concat(this.jSPlugin.id,"-ez-iframe-footer-container"))&&(document.getElementById("".concat(this.jSPlugin.id,"-ez-iframe-footer-container")).style.marginTop="-".concat(this.jSPlugin.width>We?48:32,"px"),document.getElementById("".concat(this.jSPlugin.id,"-ez-iframe-footer-container")).innerHTML='<div id="'.concat(this.jSPlugin.id,'-audioControls" class="footer-controls" style=\'display:flex;justify-content: space-between;height: ').concat(this.jSPlugin.width>We?48:32,"px;width:100%;'><div id='").concat(this.jSPlugin.id,"-audioControls-left' class=\"footer-controls-left\" style='display:flex'></div><div id='").concat(this.jSPlugin.id,"-audioControls-right' class=\"footer-controls-right\" style='display:flex'></div></div>"));else{var l=document.createElement("div");l.setAttribute("id","".concat(this.jSPlugin.id,"-ez-iframe-footer-container")),l.setAttribute("class","ez-iframe-footer-container");var d={"min-height":this.jSPlugin.width>We?"48px":"32px","max-height":this.jSPlugin.width>We?"96px":"80px",position:"relative","margin-top":this.jSPlugin.width>We?"-48px":"-32px",display:"flex","flex-wrap":"wrap","justify-content":"space-between","z-index":999,top:0,color:"#FFFFFF",width:"100%"};l.style=Ze(d),l.innerHTML='<div id="'.concat(this.jSPlugin.id,'-audioControls" class="footer-controls" style=\'display:flex;height:').concat(this.jSPlugin.width>We?48:32,"px;justify-content: space-between;width:100%;z-index:999;position: relative;'><div id='").concat(this.jSPlugin.id,"-audioControls-left' class=\"footer-controls-left\" style='display:flex;'></div><div id='").concat(this.jSPlugin.id,"-audioControls-right' class=\"footer-controls-right\" style='display:flex'></div></div>"),x(l,document.getElementById(a))}else document.getElementById("".concat(this.jSPlugin.id,"-ez-iframe-footer-container"))&&document.getElementById("".concat(this.jSPlugin.id,"-ez-iframe-footer-container")).parentElement.removeChild(document.getElementById("".concat(this.jSPlugin.id,"-ez-iframe-footer-container")));if(this.isNeedRenderHeader&&document.getElementById("".concat(this.jSPlugin.id,"-headControl"))){document.getElementById("".concat(this.jSPlugin.id,"-headControl")).style.background=n.backgroundColor,document.getElementById("".concat(this.jSPlugin.id,"-headControl")).style.color=n.color;var u,m=h(n.btnList);try{for(m.s();!(u=m.n()).done;){var p=u.value;if(p.isrender)try{this.renderHeader(p.iconId,p.part)}catch(e){}}}catch(e){m.e(e)}finally{m.f()}}if(this.isNeedRenderFooter&&document.getElementById("".concat(this.jSPlugin.id,"-audioControls"))){document.getElementById("".concat(this.jSPlugin.id,"-audioControls")).style.background=o.backgroundColor,document.getElementById("".concat(this.jSPlugin.id,"-audioControls")).style.color=o.color;var g,f=h(o.btnList);try{for(f.s();!(g=f.n()).done;){var v=g.value;if(v.isrender)try{this.renderFooter(v.iconId,v.part)}catch(e){}}}catch(e){f.e(e)}finally{f.f()}}if(this.isNeedRenderTimeLine)if(this.isMobile)document.getElementById("".concat(this.jSPlugin.id,"-headControl-right"))&&(document.getElementById("".concat(this.jSPlugin.id,"-headControl-right")).style.display="none"),this.Rec?this.Rec.recInit():this.Rec=new ce(this.jSPlugin,this.changeRecSpeed,this.resetMobileZoomStatus);else{this.Rec?this.Rec.recInit():(this.jSPlugin.decoderState=this.decoderState,this.jSPlugin.setDecoderState=this.setDecoderState,this.Rec=new fe(this.jSPlugin));var y=setInterval((function(){window.EZUIKit[e.jSPlugin.id].state.EZUIKitPlayer.init&&clearInterval(y)}),50)}if(i.findIndex(this.themeData.footer.btnList,(function(e){return"pantile"===e.iconId&&1===e.isrender}))>=0&&!this.jSPlugin.disabledPTZ&&(this.isMobile&&(this.MobilePtz=new ke(this.jSPlugin)),this.Ptz=new V(this.jSPlugin)),this.themeData.poster){this.jSPlugin.poster=this.themeData.poster;var S=setInterval((function(){window.EZUIKit[e.jSPlugin.id].state.EZUIKitPlayer.init&&(clearInterval(S),e.jSPlugin.setPoster(e.themeData.poster))}),50)}this.inited=!0,this.jSPlugin.deviceInfo&&(document.getElementById("".concat(this.jSPlugin.id,"-deviceName-content"))&&(document.getElementById("".concat(this.jSPlugin.id,"-deviceName-content")).style.maxWidth="100%",document.getElementById("".concat(this.jSPlugin.id,"-deviceName-content")).style.overflow="hidden",document.getElementById("".concat(this.jSPlugin.id,"-deviceName-content")).style.textOverflow="ellipsis",document.getElementById("".concat(this.jSPlugin.id,"-deviceName-content")).style.whiteSpace="nowrap",document.getElementById("".concat(this.jSPlugin.id,"-deviceName-content")).innerHTML=this.jSPlugin.deviceInfo.deviceName||""),document.getElementById("".concat(this.jSPlugin.id,"-deviceID-content"))&&(document.getElementById("".concat(this.jSPlugin.id,"-deviceID-content")).style.maxWidth="100%",document.getElementById("".concat(this.jSPlugin.id,"-deviceID-content")).style.overflow="hidden",document.getElementById("".concat(this.jSPlugin.id,"-deviceID-content")).style.textOverflow="ellipsis",document.getElementById("".concat(this.jSPlugin.id,"-deviceID-content")).style.whiteSpace="nowrap",document.getElementById("".concat(this.jSPlugin.id,"-deviceID-content")).innerHTML=A(this.jSPlugin.url).deviceSerial||"")),this.renderThemeData()}},{key:"resetMobileZoomStatus",value:function(){if(this.isMobile){var e=document.getElementById("".concat(this.jSPlugin.id,"-zoom-container"));e&&e.style&&"none"!=e.style.display&&(e.style.display="none"),this.jSPlugin.jSPlugin.Zoom&&this.jSPlugin.jSPlugin.Zoom.resetZoom()}}},{key:"webExpend",value:function(){var e=this.decoderState.state;e.webExpend;var t=e.expend;return!!e.play&&(t?(console.log("正在全局全屏"),!1):void this.jSPlugin.browserFullscreen())}},{key:"expend",value:function(){var e=this.decoderState.state,t=e.webExpend;return!!e.play&&(t?(console.log("正在网站全屏"),!1):void(this.isMobile?(j(document.getElementById("".concat(this.jSPlugin.id,"-wrap"))),document.documentElement.clientWidth,document.documentElement.clientHeight,document.getElementById("".concat(this.jSPlugin.id)).style["backface-visibility"]="hidden"):this.jSPlugin.fullscreen()))}},{key:"_extendHeadeTimeLinrHight",value:function(e){var t=0,n=document.getElementById("".concat(this.jSPlugin.id,"-canvas-container"));return n&&!e&&(t=parseInt(window.getComputedStyle(n).height,10)),t}},{key:"disabledFECBtn",value:function(){var e=["".concat(this.jSPlugin.id,"-capturePicture"),"".concat(this.jSPlugin.id,"-capturePicture-content"),"".concat(this.jSPlugin.id,"-capturePicture-icon"),"".concat(this.jSPlugin.id,"-recordvideo"),"".concat(this.jSPlugin.id,"-recordvideo-content"),"".concat(this.jSPlugin.id,"-recordvideo-icon"),"".concat(this.jSPlugin.id,"-zoom"),"".concat(this.jSPlugin.id,"-zoom-content"),"".concat(this.jSPlugin.id,"-zoom-icon")],t=document.getElementById("".concat(this.jSPlugin.id,"-wrap"));if(this.jSPlugin.use3DZoom?this.jSPlugin.close3DZoom():this.jSPlugin.Zoom.stopZoom(),this.setDecoderState({zoom:!1}),t){var n,i=h(e);try{for(i.s();!(n=i.n()).done;){var o=n.value,a=t.querySelector("#".concat(o));a&&(a.style.display="none")}}catch(e){i.e(e)}finally{i.f()}}}},{key:"resumeFECBtn",value:function(){var e=["".concat(this.jSPlugin.id,"-capturePicture"),"".concat(this.jSPlugin.id,"-capturePicture-content"),"".concat(this.jSPlugin.id,"-capturePicture-icon"),"".concat(this.jSPlugin.id,"-recordvideo"),"".concat(this.jSPlugin.id,"-recordvideo-content"),"".concat(this.jSPlugin.id,"-recordvideo-icon"),"".concat(this.jSPlugin.id,"-zoom"),"".concat(this.jSPlugin.id,"-zoom-content"),"".concat(this.jSPlugin.id,"-zoom-icon")],t=document.getElementById("".concat(this.jSPlugin.id,"-wrap"));if(t){var n,i=h(e);try{for(i.s();!(n=i.n()).done;){var o=n.value,a=t.querySelector("#".concat(o));a&&(a.style.display="")}}catch(e){i.e(e)}finally{i.f()}}}},{key:"destroy",value:function(){var e=document.getElementById("".concat(this.jSPlugin.id,"-headControl"));this.Rec&&this.Rec.destroy&&this.Rec.destroy(),this.Ptz&&this.Ptz.destroy&&this.Ptz.destroy(),e&&(e.innerHTML="");var t=document.getElementById("".concat(this.jSPlugin.id,"-ez-iframe-footer-container"));this._removeElement(t);var i=document.getElementById("".concat(this.jSPlugin.id,"-ez-ptz-item"));this._removeElement(i);var o=document.getElementById("mobile-ez-ptz-container");this._removeElement(o);var a=document.getElementById("date-switch-container-wrap");this._removeElement(a);var r=document.getElementById("rec-type-container-wrap");this._removeElement(r);var s=document.getElementById("mobile-rec-wrap");this._removeElement(s),n.isEnabled&&this._fullscreenchange&&n.off("change",this._fullscreenchange),re.listInstances().length<=1&&(k("".concat(this.jSPlugin.staticPath,"/speed/speed.css")),k("".concat(this.jSPlugin.staticPath,"/css/theme.css")))}},{key:"_removeElement",value:function(e){e&&e.parentNode&&e.parentNode.removeChild(e)}}])}(),Ke=function(){return m((function e(t){l(this,e),this.url=t.url||"",this.method=t.method||"POST",this.headers=t.headers||{},this.body=t.body||{},this.onBeforeUpload=t.onBeforeUpload||function(){},this.onUploadProgress=t.onUploadProgress||function(){},this.onUploadComplete=t.onUploadComplete||function(){},this.controller=new AbortController}),[{key:"upload",value:function(){var e=this;this.onBeforeUpload(this.body);var t={method:this.method,headers:this.headers,signal:this.controller.signal,body:this.body};fetch(this.url,t).then((function(e){return e.json()})).then((function(t){e.onUploadComplete({body:e.body,response:t})})).catch((function(e){"AbortError"===e.name?console.log("上传被取消"):console.error("Error:",e)})),t.body&&"FormData"==t.body.constructor.name&&"signal"in t&&t.signal.addEventListener("progress",(function(t){t.lengthComputable&&e.onUploadProgress(f(f({},e.body),{},{progress:t.loaded/t.total}))}))}},{key:"cancel",value:function(){this.controller.abort()}}])}(),Je=function(){return m((function e(t,n){l(this,e),this.jSPlugin=t,this.isMobile=n,this.timer=null,this.initToastCustom()}),[{key:"initToastCustom",value:function(){document.getElementById("".concat(this.jSPlugin.id,"-wrap-Toast-custom"))?document.getElementById("".concat(this.jSPlugin.id,"-wrap-Toast-custom")).style.display="none":this.randerToast()}},{key:"randerToast",value:function(){var e=this.jSPlugin.width,t=1;t=this.isMobile?e/375||1:e/1024||1;var n=document.getElementById("".concat(this.jSPlugin.id,"-wrap")),i=document.createElement("div");i.style="display:none;position:absolute;top:0;width: 100%;align-items: center;justify-content: center;",i.id="".concat(this.jSPlugin.id,"-wrap-Toast-custom"),this.isMobile?i.innerHTML='<div id="'.concat(this.jSPlugin.id,'-wrap-Toast-custom-content" \n style="padding: ').concat(12*t,"px ").concat(20*t,"px;font-size: ").concat(16*t,"px;line-height:").concat(16*t,"px;border-radius: ").concat(8*t,"px;margin-top: ").concat(667*t*.53,'px;\n background-color: rgba(0,0,0,0.8);color:rgba(255,255,255,0.90);box-sizing: border-box;z-index: 999;">\n </div>\n '):i.innerHTML='<div id="'.concat(this.jSPlugin.id,'-wrap-Toast-custom-content" \n style="padding: ').concat(20*t,"px ").concat(32*t,"px;font-size: ").concat(24*t,"px;line-height:").concat(24*t,"px;border-radius: ").concat(12*t,"px;margin-top: ").concat(36*t,'px;\n background-color: rgba(0,0,0,0.7);color:rgba(255,255,255,0.90);box-sizing: border-box;z-index: 999;">\n </div>\n '),n.insertBefore(i,document.getElementById(this.jSPlugin.id))}},{key:"initToastContent",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2e3;console.log("content----------------",e),this.timer=null,document.getElementById("".concat(this.jSPlugin.id,"-wrap-Toast-custom"))?(document.getElementById("".concat(this.jSPlugin.id,"-wrap-Toast-custom")).style.display="flex",document.getElementById("".concat(this.jSPlugin.id,"-wrap-Toast-custom-content")).innerText=e||"",this.timer=setTimeout((function(){document.getElementById("".concat(t.jSPlugin.id,"-wrap"))&&document.getElementById("".concat(t.jSPlugin.id,"-wrap-Toast-custom"))&&document.getElementById("".concat(t.jSPlugin.id,"-wrap")).removeChild(document.getElementById("".concat(t.jSPlugin.id,"-wrap-Toast-custom")))}),n)):(this.randerToast(),this.initToastContent(e))}}])}(),Ye=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"GET",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=arguments.length>3?arguments[3]:void 0,o=arguments.length>4?arguments[4]:void 0,a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{},r={"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},s="";r=Object.assign(r,a);var c=new Headers;Object.keys(r).map((function(e){c.append(e,r[e])})),r=c,Object.keys(Object.assign({},n)).forEach((function(e){var t=n[e];"string"==typeof n[e]&&(t=n[e].replace("%","%25")),void 0!==n[e]&&(s+="&".concat(e,"=").concat(encodeURIComponent(t)))})),s.length>0&&(s=-1!==["GET","PUT","DELETE"].indexOf(t.toUpperCase())?"?".concat(s.slice(1)):s.slice(1));var l=e+(-1!==["GET","PUT","DELETE"].indexOf(t.toUpperCase())?s:""),d={headers:r,method:t};"POST"===t&&(d.body=s),"POST"===t&&a&&"application/json"===a["Content-Type"]&&(d.body=JSON.stringify(n)),"GET"===t&&(-1===l.indexOf("?")?l+="?_r=".concat(Math.random()):l+="&_r=".concat(Math.random())),fetch(l,d).then((function(e){var t=e.headers.get("content-type");return t&&-1!==t.indexOf("application/json")?e.json():e.text()})).then((function(e){i&&i(e)})).catch((function(e){o&&o(e)}))},Xe=function(e,t,n){var i=new FormData;i.append("deviceSerial",A(e.url).deviceSerial),i.append("cmd","open"),fetch("".concat(domain,"/api/v3/device/acs/remote/door?accessToken=").concat(e.accessToken||e.token.deviceToken.globalAll),{method:"POST",body:i}).then((function(e){return e.json()})).then((function(e){console.log("get theme data",e),t(e)})).catch((function(e){n(e)}))},Qe=function(e,t,n){var i={accessToken:e.accessToken||e.token.httpToken.url,pageStart:0,pageSize:4,default:!0,voiceName:"轻应用语音文件"},o="".concat(e.env.domain,"/api/lapp/voice/query");Ye(o,"POST",i,(function(e){console.log(e),t(e)}),(function(e){console.log(e),n(e)}),{"Content-Type":"application/x-www-form-urlencoded"})},$e=function(e,t,n,i){var o="".concat(e.env.domain,"/api/lapp/voice/send"),a=new FormData;a.append("deviceSerial",A(e.url).deviceSerial),a.append("accessToken",e.accessToken||e.token.deviceToken.video),a.append("channelNo",A(e.url).channelNo||1),a.append("fileUrl",t),fetch(o,{method:"POST",body:a}).then((function(e){return e.json()})).then((function(e){!function(e){console.log(e),n(e)}(e)})).catch((function(e){var t;t=e,console.log(t),i(t)}))},et=function(){return m((function e(t,n){l(this,e),this.jSPlugin=t,this.videoWidth=t.width,this.switchFooter=n,this.sendLoadingStats=!1,this.toastCustom=new Je(t,!1),this.quickReplyList=["你好,请将快递放在门口","你好,稍等","你好,请将快递放入小区快递柜","你好,请将外卖放在门口"],this.initQuickReply()}),[{key:"initQuickReply",value:function(){document.getElementById("pc-quickReply-back")||this.renderQuickReply(),document.getElementById("pc-quickReply-back-item-0")||this.getQuickReplyList()}},{key:"renderQuickReply",value:function(){var e=this,t=this.videoWidth/1024||1,n=document.createElement("div");n.style="width:100%;",n.innerHTML='<div style="width:100%;display:flex;flex-direction:row;align-items: center;">\n <div id="pc-quickReply-back" style="display: flex;align-items: center;margin: 0 '.concat(8*t,"px 0 ").concat(16*t,'px;cursor: pointer;">\n <div style="height: ').concat(32*t,'px;">\n <svg width="').concat(32*t,'px" height="').concat(32*t,'px" viewBox="0 0 32 32" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n <title>返回</title>\n <defs>\n <filter id="filter-1">\n <feColorMatrix in="SourceGraphic" type="matrix" values="0 0 0 0 1.000000 0 0 0 0 1.000000 0 0 0 0 1.000000 0 0 0 1.000000 0"></feColorMatrix>\n </filter>\n </defs>\n <g id="控件" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n <g id="快速回复loading" transform="translate(-16.000000, -497.000000)">\n <g id="返回" transform="translate(0.000000, 425.000000)" filter="url(#filter-1)">\n <g transform="translate(16.000000, 72.000000)">\n <rect id="Rectangle" x="0" y="0" width="32" height="32"></rect>\n <path d="M12.5,7.5 C13.2988404,7.5 13.9518304,8.12445998 13.9974537,8.91186361 L14,9 L14,21.5 L26.5,21.5 C27.2988404,21.5 27.9518304,22.12446 27.9974537,22.9118636 L28,23 C28,23.7988404 27.37554,24.4518304 26.5881364,24.4974537 L26.5,24.5 L12.5,24.5 C11.7011596,24.5 11.0481696,23.87554 11.0025463,23.0881364 L11,23 L11,9 C11,8.17157288 11.6715729,7.5 12.5,7.5 Z" id="Path" fill="#FFFFFF" fill-rule="nonzero" transform="translate(19.500000, 16.000000) rotate(45.000000) translate(-19.500000, -16.000000) "></path>\n </g>\n </g>\n </g>\n </g>\n </svg>\n </div>\n <span style="font-size: ').concat(24*t,'px;">返回</span>\n </div>\n <div id="pc-quickReply-content" style="display: block;width:calc(100% - ').concat(160*t,"px);margin: 0 ").concat(24*t,'px;"></div>\n <div id="pc-quickReply-loading" style="display: none;width:calc(100% - ').concat(160*t,"px);margin: 0 ").concat(24*t,'px;"></div>\n <div id="pc-quickReply-loaderror" style="display: none;width:calc(100% - ').concat(160*t,"px);margin: 0 ").concat(24*t,'px;"></div>\n </div>'),document.getElementById("".concat(this.jSPlugin.id,"-audioControls-quickReply")).appendChild(n),document.getElementById("pc-quickReply-back").onclick=function(){e.switchFooter("onBell")}}},{key:"matchQuickReplyBtn",value:function(){var e=this,t=this.videoWidth/1024||1,n=document.getElementById("pc-quickReply-content");this.quickReplyList&&this.quickReplyList.length>0&&this.quickReplyList.forEach((function(i,o){var a=document.createElement("div");a.id="pc-quickReply-back-item-".concat(o),a.style="margin: ".concat(8*t,"px 0 ").concat(8*t,"px ").concat(8*t,"px;cursor: pointer;\n padding: 0 ").concat(20*t,"px;min-height: ").concat(64*t,"px;width:calc(50% - ").concat(16*t,"px);\n display: inline-block;background: rgba(0,0,0,0.70);border-radius: 8px;text-align: center;\n box-sizing: border-box;font-size:").concat(24*t,"px;color: rgba(255,255,255,0.90);"),a.innerHTML='<div id="pc-quickReply-back-item-box-'.concat(o,'">\n <span id="pc-quickReply-name-').concat(o,'" style="line-height: ').concat(64*t,'px;">').concat(i.voiceName,"</span>\n </div>"),a.onclick=function(){e.sendLoadingStats||(console.log("item:"+i),e.sendQuickReply(i,o))},n.appendChild(a)}))}},{key:"setBtnCheckLoading",value:function(e,t){var n=this.videoWidth/1024||1;if(t>-1){document.getElementById("pc-quickReply-back-item-".concat(t));var i=document.getElementById("pc-quickReply-back-item-box-".concat(t)),o=document.getElementById("pc-quickReply-name-".concat(t));if(1==e){var a=document.getElementById("pc-quickReply-icon-loading-".concat(t));a&&o&&i.removeChild(a)}else if(o){var r=document.createElement("span");r.id="pc-quickReply-icon-loading-".concat(t),r.style="vertical-align: middle;margin-right:".concat(16*n,"px;"),r.innerHTML='<svg width="'.concat(30*n,'" height="').concat(30*n,'" t="1567069979438" class="loading" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2399"><path d="M538.5344 266.4448a133.12 133.12 0 1 1 133.12-133.12 133.4272 133.4272 0 0 1-133.12 133.12zM255.0144 372.1984a121.6768 121.6768 0 1 1 121.6768-121.6768 121.856 121.856 0 0 1-121.6768 121.6768zM134.72 647.424a107.3664 107.3664 0 1 1 107.3664-107.264A107.52 107.52 0 0 1 134.72 647.424z m120.32 272.4608a90.9824 90.9824 0 1 1 90.9824-90.9824A91.1616 91.1616 0 0 1 255.04 919.8848zM538.5344 1024a79.36 79.36 0 1 1 79.36-79.36 79.36 79.36 0 0 1-79.36 79.36z m287.6928-134.144a64.1792 64.1792 0 1 1 64.1792-64.1792 64.3584 64.3584 0 0 1-64.1792 64.1792z m117.76-296.704a52.6336 52.6336 0 1 1 52.6592-52.6336 52.608 52.608 0 0 1-52.6336 52.6336z m-158.72-338.7136a40.96 40.96 0 1 1 12.0064 28.8512 40.5248 40.5248 0 0 1-12.0064-28.8512z" fill="#ffffff" p-id="2400"></path></svg>'),i.insertBefore(r,o)}}}},{key:"getQuickReplyList",value:function(){var e=this;console.log("getQuickReplyList"),this.madeLoadingDom(0);Qe(this.jSPlugin,(function(t){if(t&&200==t.code){var n=t.data||[],i=[];t.data.forEach((function(e,t){i=e.voiceName.split("_"),n[t].voiceName=i[1]})),e.quickReplyList=n,setTimeout((function(){e.madeLoadingDom(2)}),500)}else e.madeLoadingDom(1)}),(function(t){console.log(t),e.madeLoadingDom(1)}))}},{key:"madeLoadingDom",value:function(e){var t=this,n=this.videoWidth/1024||1;if(0==e){if(document.getElementById("pc-quickReply-content").style.display="none",document.getElementById("pc-quickReply-loaderror").style.display="none",document.getElementById("pc-quickReply-loading").style.display="block",!document.getElementById("pc-quickReply-loading-box")){var i=document.createElement("div");i.id="pc-quickReply-loading-box",i.style="width: 100%;display: flex;align-items: center;justify-content: center;flex-direction: column;",i.innerHTML='<div class="" style="heigth:'.concat(40*n,'px">\n <svg width="').concat(40*n,'" height="').concat(40*n,'" t="1567069979438" class="loading" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2399"><path d="M538.5344 266.4448a133.12 133.12 0 1 1 133.12-133.12 133.4272 133.4272 0 0 1-133.12 133.12zM255.0144 372.1984a121.6768 121.6768 0 1 1 121.6768-121.6768 121.856 121.856 0 0 1-121.6768 121.6768zM134.72 647.424a107.3664 107.3664 0 1 1 107.3664-107.264A107.52 107.52 0 0 1 134.72 647.424z m120.32 272.4608a90.9824 90.9824 0 1 1 90.9824-90.9824A91.1616 91.1616 0 0 1 255.04 919.8848zM538.5344 1024a79.36 79.36 0 1 1 79.36-79.36 79.36 79.36 0 0 1-79.36 79.36z m287.6928-134.144a64.1792 64.1792 0 1 1 64.1792-64.1792 64.3584 64.3584 0 0 1-64.1792 64.1792z m117.76-296.704a52.6336 52.6336 0 1 1 52.6592-52.6336 52.608 52.608 0 0 1-52.6336 52.6336z m-158.72-338.7136a40.96 40.96 0 1 1 12.0064 28.8512 40.5248 40.5248 0 0 1-12.0064-28.8512z" fill="#ffffff" p-id="2400"></path></svg>\n </div>\n <div style="font-size: ').concat(28*n,"px;margin-top:").concat(10*n,"px;line-height:").concat(36*n,'px;">加载中…</div>'),document.getElementById("pc-quickReply-loading").appendChild(i)}}else if(1==e){if(document.getElementById("pc-quickReply-content").style.display="none",document.getElementById("pc-quickReply-loading").style.display="none",document.getElementById("pc-quickReply-loaderror").style.display="block",!document.getElementById("pc-quickReply-loaderror-box")){var o=document.createElement("div");o.id="pc-quickReply-loaderror-box",o.style="width: 100%;display: flex;align-items: center;justify-content: center;flex-direction: column;",o.innerHTML='<div style="font-size: '.concat(28*n,'px;color: rgba(255,255,255,0.90);">快速回复加载失败</div>\n <div id="pc-quickReply-loaderror-reload" style="font-size: ').concat(24*n,"px;margin-top:").concat(16*n,'px;color: rgba(100,143,252,0.90);cursor: pointer;">重新加载</div>'),document.getElementById("pc-quickReply-loaderror").appendChild(o),document.getElementById("pc-quickReply-loaderror-reload").onclick=function(){t.getQuickReplyList()}}}else document.getElementById("pc-quickReply-loading").style.display="none",document.getElementById("pc-quickReply-loaderror").style.display="none",document.getElementById("pc-quickReply-content").style.display="block",this.matchQuickReplyBtn()}},{key:"sendQuickReply",value:function(e,t){var n=this;this.sendLoadingStats=!0,this.setBtnCheckLoading(0,t);$e(this.jSPlugin,e.fileUrl,(function(e){n.sendLoadingStats=!1,n.setBtnCheckLoading(1,t),e&&200==e.code?n.toastCustom.initToastContent("快捷回复成功"):n.toastCustom.initToastContent("快捷回复失败,请重试"),n.switchFooter("onBell")}),(function(e){console.log(e),n.sendLoadingStats=!1,n.setBtnCheckLoading(1,t),n.toastCustom.initToastContent("快捷回复失败,请重试"),n.switchFooter("onBell")}))}}])}(),tt=function(){return m((function e(t,n){l(this,e),this.jSPlugin=t,this.videoWidth=t.width,this.switchFooter=n,this.toastCustom=new Je(t,!1),this.lockStatus=!1,this.initRemoteUnlock()}),[{key:"initRemoteUnlock",value:function(){document.getElementById("pc-remoteUnlock-back")?this.madeSlideEvent():this.renderRemoteUnlock()}},{key:"renderRemoteUnlock",value:function(){var e=this,t=this.videoWidth/1024||1,n=document.createElement("div");n.style="width:100%;",n.id="pc-remoteUnlock-box",n.innerHTML='<div style="width:100%;display:flex;flex-direction:row;align-items: center;">\n <div id="pc-remoteUnlock-back" style="display: flex;align-items: center;margin: 0 '.concat(8*t,"px 0 ").concat(16*t,'px;cursor: pointer;">\n <div style="height: ').concat(32*t,'px;">\n <svg width="').concat(32*t,'px" height="').concat(32*t,'px" viewBox="0 0 32 32" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n <title>返回</title>\n <defs>\n <filter id="filter-1">\n <feColorMatrix in="SourceGraphic" type="matrix" values="0 0 0 0 1.000000 0 0 0 0 1.000000 0 0 0 0 1.000000 0 0 0 1.000000 0"></feColorMatrix>\n </filter>\n </defs>\n <g id="控件" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n <g id="快速回复loading" transform="translate(-16.000000, -497.000000)">\n <g id="返回" transform="translate(0.000000, 425.000000)" filter="url(#filter-1)">\n <g transform="translate(16.000000, 72.000000)">\n <rect id="Rectangle" x="0" y="0" width="32" height="32"></rect>\n <path d="M12.5,7.5 C13.2988404,7.5 13.9518304,8.12445998 13.9974537,8.91186361 L14,9 L14,21.5 L26.5,21.5 C27.2988404,21.5 27.9518304,22.12446 27.9974537,22.9118636 L28,23 C28,23.7988404 27.37554,24.4518304 26.5881364,24.4974537 L26.5,24.5 L12.5,24.5 C11.7011596,24.5 11.0481696,23.87554 11.0025463,23.0881364 L11,23 L11,9 C11,8.17157288 11.6715729,7.5 12.5,7.5 Z" id="Path" fill="#FFFFFF" fill-rule="nonzero" transform="translate(19.500000, 16.000000) rotate(45.000000) translate(-19.500000, -16.000000) "></path>\n </g>\n </g>\n </g>\n </g>\n </svg>\n </div>\n <span style="font-size: ').concat(24*t,'px;user-select: none;">返回</span>\n </div>\n <div id="pc-remoteUnlock-content" style="display: block;width:calc(100% - ').concat(160*t,"px);margin: 0 ").concat(24*t,'px;"></div>\n </div>'),document.getElementById("".concat(this.jSPlugin.id,"-audioControls-remoteUnlock")).appendChild(n),document.getElementById("pc-remoteUnlock-back").onclick=function(){e.goback()},this.renderRemoteUnlockSlide()}},{key:"renderRemoteUnlockSlide",value:function(){var e=this.videoWidth/1024||1,t=document.getElementById("pc-remoteUnlock-content"),n=document.createElement("div");n.id="pc-remoteUnlock-content-slide",n.style="width: 100%;display: flex;justify-content: center;cursor: pointer;",n.innerHTML='<div id="pc-remoteUnlock-slide-box" style="width: '.concat(400*e,"px;line-height: ").concat(80*e,"px;height: ").concat(80*e,"px;border: 1px solid rgba(255,255,255,1);border-radius: ").concat(40*e,'px;position: relative;text-align: center;">\n <div id="pc-remoteUnlock-slide-bgColor" style="border-radius: ').concat(40*e,"px;width: ").concat(64*e,"px;height: ").concat(80*e,'px;position: absolute;left: 0;top: 0;"></div>\n <div id="pc-remoteUnlock-slide-tips" style="height: ').concat(80*e,"px;line-height: ").concat(80*e,"px;font-size: ").concat(24*e,"px;border-radius: ").concat(40*e,'px;position: absolute;text-align: center;user-select: none;color: rgba(255,255,255,0.90);width: 100%;">右滑开锁</div>\n <div id="pc-remoteUnlock-slide-ball" style="top: ').concat(8*e,"px;left: ").concat(8*e,"px;width: ").concat(64*e,"px;height: ").concat(64*e,'px;background: #598FFF;position: absolute;text-align: center;border-radius:50%;display: flex;align-items: center;justify-content: center;">\n <svg id="slide-ball-start" style="display: inline;" width="').concat(36*e,'px" height="').concat(36*e,'px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n <title></title>\n <g id="icon/箭头向右" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n <rect id="矩形" fill="#000000" fill-rule="nonzero" opacity="0" x="0" y="0" width="24" height="24"></rect>\n <path d="M14.2841136,6.3689007 L19.9432338,12.0287579 L14.2863796,17.6856122 L12.8580239,16.2572565 L16.114,12.9999007 L4.00000001,13 L4.00000001,11 L16.058,10.9999007 L12.8557579,7.79725638 L14.2841136,6.3689007 Z" id="形状结合" fill="#FFFFFF" fill-rule="nonzero"></path>\n </g>\n </svg>\n <svg id="slide-ball-end" style="display: none;" width="').concat(36*e,'" height="').concat(36*e,'" t="1567069979438" class="loading" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2399"><path d="M538.5344 266.4448a133.12 133.12 0 1 1 133.12-133.12 133.4272 133.4272 0 0 1-133.12 133.12zM255.0144 372.1984a121.6768 121.6768 0 1 1 121.6768-121.6768 121.856 121.856 0 0 1-121.6768 121.6768zM134.72 647.424a107.3664 107.3664 0 1 1 107.3664-107.264A107.52 107.52 0 0 1 134.72 647.424z m120.32 272.4608a90.9824 90.9824 0 1 1 90.9824-90.9824A91.1616 91.1616 0 0 1 255.04 919.8848zM538.5344 1024a79.36 79.36 0 1 1 79.36-79.36 79.36 79.36 0 0 1-79.36 79.36z m287.6928-134.144a64.1792 64.1792 0 1 1 64.1792-64.1792 64.3584 64.3584 0 0 1-64.1792 64.1792z m117.76-296.704a52.6336 52.6336 0 1 1 52.6592-52.6336 52.608 52.608 0 0 1-52.6336 52.6336z m-158.72-338.7136a40.96 40.96 0 1 1 12.0064 28.8512 40.5248 40.5248 0 0 1-12.0064-28.8512z" fill="#598FFF" p-id="2400"></path></svg>\n \n </div>\n </div>'),t.appendChild(n),this.madeSlideEvent()}},{key:"getOffsetLeft",value:function(e){var t=0;do{t+=e.offsetLeft,e=e.parentNode}while(e.parentNode);return t}},{key:"madeSlideEvent",value:function(){var e=this.videoWidth/1024||1,t=document.getElementById("".concat(this.jSPlugin.id)),n=this.getOffsetLeft(t),i=document.getElementById("pc-remoteUnlock-slide-box"),o=document.getElementById("pc-remoteUnlock-slide-bgColor"),a=document.getElementById("pc-remoteUnlock-slide-tips"),r=document.getElementById("pc-remoteUnlock-slide-ball"),s=this;r.onmousedown=function(t){var c=(t=t||window.event).offsetX;r.style.transition="",o.style.transition="",document.onmouseup=function(){console.log("--------------onmouseup"),s.lockStatus||(o.style.width="0px",r.style.left=8*e+"px",r.style.transition="left 0.6s linear",o.style.transition="width 0.6s linear"),document.onmouseup=null,document.onmousemove=null},document.onmousemove=function(t){t=t||window.event;console.log("videoDom",n);var l=t.pageX-i.offsetLeft-c-n,d=i.clientWidth-r.clientWidth-8*e;l<=0&&(l=0),l>=d&&(l=d),r.style.left=l+"px",l!=d||s.lockStatus||s.lockStatus||(s.lockStatus=!0,document.getElementById("slide-ball-start").style.display="none",document.getElementById("slide-ball-end").style.display="inline",o.style.width=i.clientWidth+"px",o.style.backgroundColor="#598FFF",i.style.border="0",r.style.backgroundColor="#ffffff",a.textContent="正在开锁",r.onmousedown=null,document.onmousemove=null,s.sendRemoteUnlockApi())}}}},{key:"resetRemoteUnlockSlide",value:function(){var e=document.getElementById("pc-remoteUnlock-box"),t=document.getElementById("".concat(this.jSPlugin.id,"-audioControls-remoteUnlock"));e&&t&&t.removeChild(e)}},{key:"sendRemoteUnlockApi",value:function(){var e=this;console.log("下发远程开锁");Xe(this.jSPlugin,(function(t){t&&200==t.code?e.toastCustom.initToastContent("开锁成功"):e.toastCustom.initToastContent("开锁失败,请重试"),e.goback()}),(function(t){console.log(t),e.toastCustom.initToastContent("开锁失败,请重试"),e.goback()}))}},{key:"goback",value:function(){this.switchFooter("onCall"),this.resetRemoteUnlockSlide()}}])}(),nt={customConfig:{defaultMicro:0,defaultPlay:0,maxTalkTime:0,bellPoster:0,maxBellTime:0},header:{onBell:{color:"#2c2c2c",backgroundColor:"#00000000 linear-gradient(180deg, rgba(0,0,0,0.65) 0%, rgba(0,0,0,0.00) 100%)",activeColor:"#1890FF",autoFocus:0,btnList:[{btnKey:"c1cbc1d4e86d49a0981f54beea95280a-4412dc7a9f7b471a9a3e9a8fb625c793-header-0",iconId:"ringStatus",part:"left",defaultActive:0,isrender:1,color:"#ffffff",themeId:"4412dc7a9f7b471a9a3e9a8fb625c793"},{btnKey:"c1cbc1d4e86d49a0981f54beea95280a-4412dc7a9f7b471a9a3e9a8fb625c793-header-1",iconId:"deviceCategory",part:"left",defaultActive:0,isrender:1,color:"#ffffff",themeId:"4412dc7a9f7b471a9a3e9a8fb625c793"}]},onCall:{color:"#2c2c2c",backgroundColor:"#00000000",activeColor:"#1890FF",autoFocus:5,btnList:[{btnKey:"c1cbc1d4e86d49a0981f54beea95280a-4412dc7a9f7b471a9a3e9a8fb625c793-header-0",iconId:"callStatus",part:"left",defaultActive:0,isrender:1,color:"#ffffff",themeId:"4412dc7a9f7b471a9a3e9a8fb625c793"},{btnKey:"c1cbc1d4e86d49a0981f54beea95280a-4412dc7a9f7b471a9a3e9a8fb625c793-header-1",iconId:"deviceCategory",part:"left",defaultActive:0,isrender:1,color:"#ffffff",themeId:"4412dc7a9f7b471a9a3e9a8fb625c793"}]}},footer:{onBell:{color:"#ffffff",backgroundColor:"#00000000",activeColor:"#1890FF",autoFocus:5,btnList:[{btnKey:"c1cbc1d4e86d49a0981f54beea95280a-4412dc7a9f7b471a9a3e9a8fb625c793-footer-0",iconId:"quickReply",part:"left",defaultActive:1,isrender:1,themeId:"4412dc7a9f7b471a9a3e9a8fb625c793",backgroundColor:"#cccccc"},{btnKey:"c1cbc1d4e86d49a0981f54beea95280a-4412dc7a9f7b471a9a3e9a8fb625c793-footer-1",iconId:"rejection",part:"left",defaultActive:0,isrender:1,color:"#2C2C2C",themeId:"4412dc7a9f7b471a9a3e9a8fb625c793",backgroundColor:"#cccccc"},{btnKey:"c1cbc1d4e86d49a0981f54beea95280a-4412dc7a9f7b471a9a3e9a8fb625c793-footer-2",iconId:"answer",part:"left",defaultActive:0,isrender:1,themeId:"4412dc7a9f7b471a9a3e9a8fb625c793",backgroundColor:"#cccccc"},{btnKey:"c1cbc1d4e86d49a0981f54beea95280a-4412dc7a9f7b471a9a3e9a8fb625c793-footer-3",iconId:"remoteUnlock",part:"left",defaultActive:0,isrender:1,themeId:"4412dc7a9f7b471a9a3e9a8fb625c793",backgroundColor:"#cccccc"}]},onCall:{color:"#2c2c2c",backgroundColor:"rgba(0,0,0,0.8)",activeColor:"#1890FF",autoFocus:5,btnList:[{btnKey:"c1cbc1d4e86d49a0981f54beea95280a-4412dc7a9f7b471a9a3e9a8fb625c793-footer-0",iconId:"mute",part:"left",defaultActive:1,isrender:1,themeId:"4412dc7a9f7b471a9a3e9a8fb625c793",backgroundColor:"#cccccc"},{btnKey:"c1cbc1d4e86d49a0981f54beea95280a-4412dc7a9f7b471a9a3e9a8fb625c793-footer-1",iconId:"hangUp",part:"left",defaultActive:0,isrender:1,themeId:"4412dc7a9f7b471a9a3e9a8fb625c793",backgroundColor:"#cccccc"},{btnKey:"c1cbc1d4e86d49a0981f54beea95280a-4412dc7a9f7b471a9a3e9a8fb625c793-footer-2",iconId:"remoteUnlock",part:"left",defaultActive:0,isrender:1,themeId:"4412dc7a9f7b471a9a3e9a8fb625c793",backgroundColor:"#cccccc"}]}}};function it(e){var t=new ee,n=new FormData;for(var i in e)n.append(i,e[i]);return t.fetch("/api/lapp/device/info",{method:"POST",body:n})}var ot=function(e){var t="";return Object.keys(e).map((function(n,i){t+="".concat(n,":").concat(e[n]).concat(i<Object.keys(e).length-1?";":"")})),t},at=function(){return m((function e(t,n,i,o){var a=this;l(this,e),p(this,"autoPlayRing",(function(){console.log("autoPlayRing");var e=document.getElementById("bellring-audio");e&&(e.muted=!1,e.src="https://resource.eziot.com/group2/M00/00/8F/CtwQFmPbWnOAGuT5AAHZihhCJEM230.mp3",e.paused&&e.play()),window.removeEventListener("click",a.autoPlayRing)})),p(this,"muteCommon",(function(e){var t=a.decoderState.state,n=t.talk,i=t.sound;n?(console.log("结束对讲"),a.setDecoderState({talk:!1,mute:!0},e.backgroundColor),a.jSPlugin.Talk.stopTalk(),i||a.jSPlugin.openSound()):(a.setDecoderState({talk:!1,mute:!0},e.backgroundColor),i||a.jSPlugin.openSound())})),p(this,"switchCallStatus",(function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=a.themeData,i=n.header,o=n.footer,r=null;if("onCall"==e){console.log("接听"),a.bellStatus="onCall",a.switchFooter("onCall"),o[a.bellStatus].btnList.map((function(e,t){e.isrender&&a.renderFooter(e.iconId,e),"mute"==e.iconId&&(r=e)})),i[a.bellStatus].btnList.map((function(e,t){e.isrender&&a.renderHeader(e.iconId,e)}));var s=document.getElementById("".concat(a.jSPlugin.id,"-header-onBell"));s&&s.parentElement.removeChild(s),1==a.themeData.customConfig.bellPoster&&document.getElementById("bellring-icon")&&document.getElementById("".concat(a.jSPlugin.id,"-wrap")).removeChild(document.getElementById("bellring-icon")),0==a.themeData.customConfig.defaultMicro&&r?a.muteCommon(r):a.setDecoderState({mute:!1},r.backgroundColor),a.removeBellRing()}else console.log("响铃"),a.bellStatus="onBell",a.jSPlugin.Theme.changeTheme(a.themeData,t)})),this.jSPlugin=t,this.videoWidth=t.width,this.videoHeight=t.height,this.themeData=n,this.setDecoderState=i,this.decoderState=o,this.isNeedRenderHeader=!1,this.isNeedRenderFooter=!1,this.autoFocus=0,this.autoFocusTimer=null,this.bellStatus="onBell",this.recordTimer=null,this.nextRate=1,this.themeInited=!1,this.inited=!1,this.activeThemeStatus=!0,this.activeThemeStatusTxt="模板未激活",this.toastCustom=new Je(t,!1)}),[{key:"initBellRing",value:function(){var e=this,t=this.decoderState.state,n=t.play,i=t.isEditing;t.rejection;var o=this.videoWidth/1024;this.maxBellTime=1e3*this.themeData.customConfig.maxBellTime;var a=document.getElementById("bellring"),r=document.getElementById("bellring-audio");if(!a&&!r){if(this.jSPlugin.isNeedBellRing){var s=document.createElement("div");s.id="bellring",s.innerHTML='<div>\n <audio id="bellring-audio" loop autoplay>\n <source src="https://resource.eziot.com/group2/M00/00/8F/CtwQFmPbWnOAGuT5AAHZihhCJEM230.mp3" type="audio/mpeg">\n </audio>\n </div>',document.getElementById("".concat(this.jSPlugin.id,"-wrap")).appendChild(s)}if(1!=this.themeData.customConfig.bellPoster||i)document.getElementById("bellring-icon")&&document.getElementById("".concat(this.jSPlugin.id,"-wrap")).removeChild(document.getElementById("bellring-icon"));else{var c=(this.videoHeight-180*o)/2,l=document.createElement("div");l.id="bellring-icon",l.style="position: absolute;pointer-events: none;background: none;width: 100%;\n position: absolute;top: ".concat(c,"px;display: flex;align-items: center;justify-content: center;"),l.innerHTML='<div style="width: '.concat(180*o,"px;height: ").concat(180*o,'px;display: flex;align-items: center;justify-content: center;border: 1px solid rgba(255,255,255,0.2);border-radius: 50%;">\n <div style="width: ').concat(100*o,"px;height: ").concat(100*o,'px;display: flex;align-items: center;justify-content: center;border: 1px solid rgba(255,255,255,0.3);border-radius: 50%;">\n <svg width="').concat(40*o,'px" height="').concat(40*o,'px" viewBox="0 0 40 40" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n <title>icon/响铃</title>\n <g id="icon/响铃" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n <polygon id="Path" points="0 0 40.0000002 0 40.0000002 40.0000002 0 40.0000002"></polygon>\n <path d="M20.0000001,4.25000002 C22.0363461,4.25000002 23.698175,5.84879552 23.8000507,7.8591997 L23.8050001,8.05500003 L23.805316,8.99953253 C27.1874196,9.97041766 29.6921839,13.0354462 29.80936,16.723731 L29.80936,16.723731 L29.8133335,16.9800001 L29.8133335,21.6416668 C29.8133335,22.3259481 30.0858837,22.9835569 30.5703302,23.4680033 L30.5703302,23.4680033 L31.6386635,24.5363367 C32.338953,25.2366262 32.760721,26.1675592 32.8273086,27.1785295 L32.8273086,27.1785295 L32.8350001,27.4233334 C32.8350001,29.577547 31.0892137,31.3233335 28.9350001,31.3233335 L28.9350001,31.3233335 L24.5666667,31.323 L24.5650266,31.3951531 C24.4527075,33.8194458 22.4520933,35.7500001 20.0000001,35.7500001 C17.5482065,35.7500001 15.5473098,33.8197367 15.4349743,31.3967059 L15.4326667,31.323 L11.0666667,31.3233335 C9.06159524,31.3233335 7.39851917,29.8069287 7.18810198,27.8229374 L7.17194359,27.6230185 L7.1666667,27.4233334 C7.1666667,26.3411154 7.59733134,25.3020086 8.36300328,24.5363367 L8.36300328,24.5363367 L9.43133662,23.4680033 C9.91578309,22.9835569 10.1883334,22.3259481 10.1883334,21.6416668 L10.1883334,21.6416668 L10.1883334,16.9800001 C10.1883334,13.1909619 12.7263704,9.99530436 16.1948593,8.99965364 L16.1950001,8.05500003 C16.1950001,5.95360729 17.8979654,4.25000002 20.0000001,4.25000002 Z M23.0656667,31.323 L16.9336667,31.323 L16.9352114,31.3619281 C17.0285826,32.9723844 18.3649772,34.2500001 20.0000001,34.2500001 C21.6352227,34.2500001 22.9714318,32.9721919 23.0647896,31.3604131 L23.0656667,31.323 Z M21.5116668,10.1783334 L18.4900001,10.1783334 C14.7336124,10.1783334 11.6883334,13.2231481 11.6883334,16.9800001 L11.6883334,16.9800001 L11.6883334,21.6416668 C11.6883334,22.7238848 11.2576687,23.7629916 10.4919968,24.5286635 L10.4919968,24.5286635 L9.42366346,25.5969969 C8.93921698,26.0814433 8.6666667,26.7390521 8.66637526,27.402427 L8.66637526,27.402427 L8.67048222,27.560237 C8.74130967,28.8268108 9.79171396,29.8233335 11.0666667,29.8233335 L11.0666667,29.8233335 L23.7906939,29.8222289 C23.8004164,29.8218553 23.8101862,29.8216668 23.8200001,29.8216668 L23.8486667,29.823 L28.9350001,29.8233335 C30.2055455,29.8233335 31.2450456,28.8367727 31.329826,27.609522 L31.3354106,27.4481422 L31.3293607,27.2529336 C31.2880301,26.6292837 31.0210852,26.0400787 30.5780034,25.5969969 L30.5780034,25.5969969 L29.50967,24.5286635 C28.7439981,23.7629916 28.3133335,22.7238848 28.3133335,21.6416668 L28.3133335,21.6416668 L28.3134279,16.9919039 L28.3098332,16.759466 C28.1934023,13.0970787 25.1864454,10.1783334 21.5116668,10.1783334 L21.5116668,10.1783334 Z M20.0000001,5.75000002 C18.7795808,5.75000002 17.7813801,6.69770708 17.7003155,7.89717688 L17.6950001,8.05500003 L17.6952875,8.7158769 C17.9568453,8.69103758 18.2219393,8.67833337 18.4900001,8.67833337 L18.4900001,8.67833337 L21.5116668,8.67833337 C21.7792577,8.67833337 22.0439466,8.69101238 22.3051575,8.71580951 L22.3050001,8.05500003 C22.3050001,6.7819079 21.273481,5.75000002 20.0000001,5.75000002 Z" id="形状结合" fill="#FFFFFF" fill-rule="nonzero"></path>\n </g>\n </svg>\n </div>\n </div>'),document.getElementById("".concat(this.jSPlugin.id,"-wrap")).appendChild(l),n&&"onBell"==this.bellStatus&&this.jSPlugin.pause()}setTimeout((function(){var t=e.decoderState.state,n=t.isEditing,i=t.rejection;"onBell"!=e.bellStatus||i||(e.removeBellRing(),n||e.answerOvertime())}),this.maxBellTime)}}},{key:"removeBellRing",value:function(){document.getElementById("bellring")&&document.getElementById("".concat(this.jSPlugin.id,"-wrap")).removeChild(document.getElementById("bellring")),document.getElementById("bellring-icon")&&document.getElementById("".concat(this.jSPlugin.id,"-wrap")).removeChild(document.getElementById("bellring-icon"))}},{key:"matchBtn",value:function(e,t){var n=this,i=this.themeData,o=i.header,a=i.footer,r=this.decoderState.state,s=r.mute,c=r.rejection,l={title:"",id:"",domString:"",color:"#FFFFFF",activeColor:"#FFFFFF",onclick:function(){},onmoveleft:function(){},onmoveright:function(){},onremove:function(){}};-1===o[this.bellStatus].btnList.findIndex((function(t){return t.iconId===e}))?(l.color=a[this.bellStatus].color,l.backgroundColor=a[this.bellStatus].backgroundColor,l.activeColor=a[this.bellStatus].activeColor):(l.color=o[this.bellStatus].color,l.backgroundColor=o[this.bellStatus].backgroundColor,l.activeColor=o[this.bellStatus].activeColor);var d=this.videoWidth/6;this.videoWidth;var u=this.videoWidth/1024||1;switch(e){case"ringStatus":return l.title=this.activeThemeStatus?"有人按门铃":this.activeThemeStatusTxt,l.id=e,l.domString='<span id="header-onBell-ringStatus" style="color:'.concat(t.color||"#FFFFFF",";font-size: ").concat(32*u,'px;display: block;text-align: left;font-weight: 500;" >').concat(this.activeThemeStatus?"有人按门铃":this.activeThemeStatusTxt,"</span>"),l.onclick=function(){},l;case"deviceCategory":return l.title="设备名称",l.id=e,l.domString='<span id="header-onBell-deviceCategory" \n style="\n color:'.concat(t.color||"#FFFFFF",";\n font-size: ").concat(24*u,"px;\n padding-top: ").concat(16*u,'px;\n display: block;\n max-width: 100%;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n text-align: left;\n ">').concat(this.deviceInfoData&&this.deviceInfoData.deviceName||"设备名称","</span>"),l.onclick=function(){},l;case"callStatus":return l.title="通话中",l.id=e,l.domString='<span id="header-onCall-ringStatus" style="color:'.concat(t.color||"#FFFFFF",";font-size: ").concat(32*u,'px;display: block;text-align: left;" >通话中</span>'),l.onclick=function(){},l;case"deviceCategory":return l.title="设备名称",l.id=e,l.domString='<span id="header-onCall-deviceCategory"\n style="color:'.concat(t.color||"#FFFFFF",";\n font-size: ").concat(24*u,"px;\n padding-top: ").concat(16*u,'px;\n display: block;\n max-width: 100%;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n text-align: left;\n ">').concat(this.deviceInfoData&&this.deviceInfoData.deviceName||"设备名称","</span>"),l.onclick=function(){},l;case"rejection":return l.title="拒绝",l.id=e,l.domString='<div style="width: '.concat(.7*d,'px;display: flex;flex-direction: column;align-items: center;">\n <div style="width:').concat(.5*d,"px;height: ").concat(.5*d,"px;border-radius: 50%;background: ").concat(c?"#CCCCCC":t.backgroundColor,';display: flex;align-items: center;justify-content: center;" >\n <svg width="').concat(.3*d,'px" height="').concat(.3*d,'px" viewBox="0 0 36 36" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n <title>拒绝</title>\n <g id="icon/拒绝" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n <rect id="Rectangle" x="0" y="0" width="36" height="36"></rect>\n <path d="M16.0428281,19.9522968 C13.5228132,17.435123 11.1135994,14.5173605 12.2699084,13.3638925 C13.9205608,11.7132401 15.3581341,10.6961428 12.4346895,7.05675259 C9.50840386,3.41452132 7.55659974,6.21011849 5.95708632,7.80963191 C4.11324225,9.65631703 5.86049048,16.5345088 12.6591328,23.3359922 C19.4577751,30.1346345 26.3388079,31.8847238 28.1854931,30.0380386 C29.7850065,28.4385252 32.5806036,26.4895622 28.9412134,23.5632765 C25.3018232,20.6369909 24.2847259,22.0745642 22.6340735,23.7280576 C21.4777645,24.8786845 18.5628431,22.4694707 16.0428281,19.9522968 Z" id="路径" fill="#FFFFFF" fill-rule="nonzero" transform="translate(17.997936, 17.998157) rotate(135.000000) translate(-17.997936, -17.998157) "></path>\n </g>\n </svg>\n </div>\n <div style="margin-top: ').concat(.1*d,'px;user-select: none;">拒绝</div>\n </div>'),l.onclick=function(){var e=n.decoderState.state,t=e.play,i=e.isEditing,o=e.rejection;if(i||o)return!1;console.log("拒绝"),t&&n.jSPlugin.stop(),n.removeBellRing(),n.setDecoderState({play:!1,rejection:!0}),n.rejectionStatusDispose(),"function"==typeof n.jSPlugin.hangUpCallback&&n.jSPlugin.hangUpCallback("rejection")},l;case"quickReply":return l.title="快捷回复",l.id=e,l.domString='<div style="width: '.concat(.7*d,'px;display: flex;flex-direction: column;align-items: center;">\n <div style="width: ').concat(.5*d,"px;height: ").concat(.5*d,"px;border-radius: 50%;background: ").concat(c?"#CCCCCC":t.backgroundColor,';display: flex;align-items: center;justify-content: center;" >\n <svg width="').concat(.3*d,'px" height="').concat(.3*d,'px" viewBox="0 0 36 36" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n <title>快捷回复</title>\n <g id="icon/web快捷回复" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n <rect id="Rectangle" x="0" y="0" width="36" height="36"></rect>\n <path d="M17.4723401,6.00464509 C24.1317208,5.8200623 29.613145,11.1601938 29.613145,17.806299 C29.613145,19.5506656 29.2343807,21.2437888 28.5133012,22.7904909 L28.638,22.51 L29.9802796,28.9334997 C30.0980856,29.4978889 29.6719785,30.0050773 29.131395,30.0271186 L29.0218792,30.0249315 L28.9025577,30.0074816 L22.488349,28.6446207 L22.3501503,28.7067675 C21.0679643,29.242563 19.6940914,29.5480927 18.2793303,29.6038407 L18.2793303,29.6038407 L17.8062986,29.6131454 C11.1610025,29.6131454 5.820073,24.1313212 6.00464384,17.4723718 C6.17540866,11.3038211 11.3038207,6.17540904 17.4723401,6.00464509 Z M17.8062986,16.2974446 C16.9707372,16.2974446 16.2926003,16.9755814 16.2926003,17.8111428 C16.2926003,18.6467043 16.9707372,19.3248411 17.8062986,19.3248411 C18.64186,19.3248411 19.3199969,18.6467043 19.3199969,17.8111428 C19.3199969,16.9755814 18.64186,16.2974446 17.8062986,16.2974446 Z M12.9624642,16.2974446 C12.1269027,16.2974446 11.4487659,16.9755814 11.4487659,17.8111428 C11.4487659,18.6467043 12.1269027,19.3248411 12.9624642,19.3248411 C13.7980256,19.3248411 14.4761624,18.6467043 14.4761624,17.8111428 C14.4761624,16.9755814 13.7980256,16.2974446 12.9624642,16.2974446 Z M22.650133,16.2974446 C21.8145716,16.2974446 21.1364348,16.9755814 21.1364348,17.8111428 C21.1364348,18.6467043 21.8145716,19.3248411 22.650133,19.3248411 C23.4856945,19.3248411 24.1638313,18.6467043 24.1638313,17.8111428 C24.1638313,16.9755814 23.4856945,16.2974446 22.650133,16.2974446 Z" id="形状结合" fill="#FFFFFF" fill-rule="nonzero"></path>\n </g>\n </svg>\n </div>\n <div style="margin-top: ').concat(.1*d,'px;user-select: none;">快捷回复</div>\n </div>'),l.onclick=function(){if(n.decoderState.state.rejection)return!1;console.log("快捷回复"),n.switchFooter("quickReply"),n.quickReplyEle=new et(n.jSPlugin,n.switchFooter)},l;case"answer":return l.title="接听",l.id=e,l.domString='<div style="width: '.concat(.7*d,'px;display: flex;flex-direction: column;align-items: center;">\n <div style="width: ').concat(.5*d,"px;height: ").concat(.5*d,"px;border-radius: 50%;background: ").concat(c?"#CCCCCC":t.backgroundColor,';display: flex;align-items: center;justify-content: center;" >\n <svg width="').concat(.3*d,'px" height="').concat(.3*d,'px" viewBox="0 0 36 36" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n <title>接听</title>\n <g id="icon/接听" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n <rect id="Rectangle" x="0" y="0" width="36" height="36"></rect>\n <path d="M15.7728281,19.6822968 C13.2528132,17.165123 10.8435994,14.2473605 11.9999084,13.0938925 C13.6505608,11.4432401 15.0881341,10.4261428 12.1646895,6.78675259 C9.23840386,3.14452132 7.28659974,5.94011849 5.68708632,7.53963191 C3.84324225,9.38631703 5.59049048,16.2645088 12.3891328,23.0659922 C19.1877751,29.8646345 26.0688079,31.6147238 27.9154931,29.7680386 C29.5150065,28.1685252 32.3106036,26.2195622 28.6712134,23.2932765 C25.0318232,20.3669909 24.0147259,21.8045642 22.3640735,23.4580576 C21.2077645,24.6086845 18.2928431,22.1994707 15.7728281,19.6822968 Z" id="路径" fill="#FFFFFF" fill-rule="nonzero" transform="translate(17.727936, 17.728157) rotate(-360.000000) translate(-17.727936, -17.728157) "></path>\n </g>\n </svg>\n </div>\n <div style="margin-top: ').concat(.1*d,'px;user-select: none;">接听</div>\n </div>'),l.onclick=function(){var e=n,i=n.decoderState.state,r=i.play,s=i.isEditing,c=i.talk,l=i.sound,d=i.rejection;if(s||d)return!1;console.log("接听"),n.jSPlugin.pluginStatus.loadingClear(),r||(n.jSPlugin.pluginStatus.loadingStart(n.jSPlugin.id),n.jSPlugin.pluginStatus.loadingSetText({text:"视频加载中"}),n.jSPlugin.play(),n.setDecoderState({play:!r})),c||1!=n.themeData.customConfig.defaultMicro||(n.setDecoderState({talk:!0,mute:!1}),l&&n.jSPlugin.closeSound(),n.jSPlugin.Talk.startTalk()),n.setDecoderState({sound:!1}),n.bellStatus="onCall",n.switchFooter("onCall"),a[n.bellStatus].btnList.map((function(e,t){e.isrender&&n.renderFooter(e.iconId,e)})),o[n.bellStatus].btnList.map((function(e,t){e.isrender&&n.renderHeader(e.iconId,e)}));var u=document.getElementById("".concat(n.jSPlugin.id,"-header-onBell"));u&&u.parentElement.removeChild(u),1==n.themeData.customConfig.bellPoster&&(document.getElementById("bellring-icon")&&document.getElementById("".concat(n.jSPlugin.id,"-wrap")).removeChild(document.getElementById("bellring-icon")),n.jSPlugin.setPoster("")),0==n.themeData.customConfig.defaultMicro&&(n.muteCommon(t),n.jSPlugin.openSound()),n.removeBellRing(),n.maxTalkTime=1e3*n.themeData.customConfig.maxTalkTime*60,setTimeout((function(){c&&(console.log("结束对讲"),e.setDecoderState({talk:!1}),e.jSPlugin.Talk.stopTalk()),r&&(e.jSPlugin.stop(),e.setDecoderState({play:!r})),n.rejectionStatusDispose(),n.remoteUnlockEle&&n.remoteUnlockEle.goback(),"function"==typeof n.jSPlugin.hangUpCallback&&n.jSPlugin.hangUpCallback("hangUp")}),n.maxTalkTime)},l;case"remoteUnlock":return l.title="远程开锁",l.id=e,l.domString='<div style="width: '.concat(.7*d,'px;display: flex;flex-direction: column;align-items: center;">\n <div style="width: ').concat(.5*d,"px;height: ").concat(.5*d,"px;border-radius: 50%;background: ").concat(c?"#CCCCCC":t.backgroundColor,';display: flex;align-items: center;justify-content: center;" >\n <svg width="').concat(.3*d,'px" height="').concat(.3*d,'px" viewBox="0 0 36 36" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n <title>开锁</title>\n <g id="icon/开锁" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n <rect id="Rectangle" x="0" y="0" width="36" height="36"></rect>\n <path d="M18,4 C21.3137085,4 24,6.6862915 24,10 L24,10 L24,19.787 L29.5,19.7875 C30.0522847,19.7875 30.5,20.2352153 30.5,20.7875 C30.5,21.3397847 30.0522847,21.7875 29.5,21.7875 L24,21.787 L24,26 C24,29.2383969 21.4344251,31.8775718 18.2249383,31.9958615 L18,32 C14.6862915,32 12,29.3137085 12,26 L12,26 L12,10 C12,6.6862915 14.6862915,4 18,4 Z M18,6 C15.790861,6 14,7.790861 14,10 L14,10 L14,26 C14,28.209139 15.790861,30 18,30 C20.209139,30 22,28.209139 22,26 L22,26 L22,21.787 L18.5,21.7875 C17.9477153,21.7875 17.5,21.3397847 17.5,20.7875 C17.5,20.2352153 17.9477153,19.7875 18.5,19.7875 L22,19.787 L22,10 C22,7.85780461 20.3160315,6.10892112 18.1996403,6.00489531 Z" id="形状结合" fill="#FFFFFF" fill-rule="nonzero"></path>\n </g>\n </svg>\n </div>\n <div style="margin-top: ').concat(.1*d,'px;user-select: none;">远程开锁</div>\n </div>'),l.onclick=function(){var e=n.decoderState.state,t=e.isEditing,i=e.rejection;if(t||"onBell"==n.bellStatus||i)return!1;console.log("远程开锁"),n.switchFooter("remoteUnlock"),n.remoteUnlockEle=new tt(n.jSPlugin,n.switchFooter)},l;case"mute":return l.title="静音",l.id=e,l.domString='<div style="width: '.concat(.7*d,'px;display: flex;flex-direction: column;align-items: center;">\n <div id="').concat(this.jSPlugin.id,'-icon-mute" style="width: ').concat(.5*d,"px;height: ").concat(.5*d,"px;border-radius: 50%;border: 1px solid ").concat(c?"#CCCCCC":t.backgroundColor,";background: ").concat(c&&s?"#cccccc":"#ffffff",';display: flex;align-items: center;justify-content: center;" >\n <svg width="').concat(.3*d,'px" height="').concat(.3*d,'px" viewBox="0 0 36 36" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n <title>静音</title>\n <g id="icon/静音" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n <rect id="Rectangle" x="0" y="0" width="36" height="36"></rect>\n <path id="icon-mute-path" d="M29.2988305,7.56559704 C29.8540627,8.1086468 29.8980234,8.97727504 29.4240597,9.57172938 L29.3223594,9.6867869 L22.585,16.574 L22.5859243,26.0592702 C22.5859243,26.9500521 21.8638029,27.6721735 20.973021,27.6721735 C20.6007147,27.6721735 20.2398727,27.5433734 19.9517149,27.3076254 L15.583,23.733 L10.4341733,28.9987008 C9.85492024,29.5909486 8.9052312,29.6014828 8.31298346,29.0222298 C7.75775121,28.47918 7.71379057,27.6105518 8.18775419,27.0160974 L8.28945454,26.9010399 L27.1776406,7.58912597 C27.7568937,6.99687823 28.7065827,6.98634397 29.2988305,7.56559704 Z M22.2503608,7.16816759 C22.4679282,7.45036017 22.5859243,7.79665625 22.5859243,8.15298221 L22.585,9.899 L10.778,21.971 L9.47580645,21.9713498 C7.69424274,21.9713498 6.25,20.5271071 6.25,18.7455434 L6.25,15.65293 C6.25,13.8713663 7.69424274,12.4271235 9.47580645,12.4271235 L12.787,12.427 L19.9882064,6.87564241 C20.6936617,6.33174431 21.7064627,6.46271229 22.2503608,7.16816759 Z" id="形状结合" fill="').concat(s?"#ffffff":c?"#cccccc":t.backgroundColor,'"></path>\n </g>\n </svg>\n </div>\n <div style="margin-top: ').concat(.1*d,'px;user-select: none;">静音</div>\n </div>'),l.onclick=function(){var e=n.decoderState.state,i=e.talk,o=e.sound;if(e.play,e.rejection)return!1;console.log("静音"),i?(console.log("结束对讲"),n.setDecoderState({talk:!1,mute:!0},t.backgroundColor),n.jSPlugin.Talk.stopTalk(),n.jSPlugin.openSound()):(console.log("开始对讲"),n.setDecoderState({talk:!0,mute:!1},t.backgroundColor),o&&(n.jSPlugin.closeSound(),n.setDecoderState({sound:!1})),n.jSPlugin.Talk.startTalk())},l;case"hangUp":return l.title="挂断",l.id=e,l.domString='<div style="width: '.concat(.7*d,'px;display: flex;flex-direction: column;align-items: center;">\n <div style="width:').concat(.5*d,"px;height: ").concat(.5*d,"px;border-radius: 50%;background: ").concat(c?"#CCCCCC":t.backgroundColor,';display: flex;align-items: center;justify-content: center;" >\n <svg width="').concat(.3*d,'px" height="').concat(.3*d,'px" viewBox="0 0 36 36" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n <title>挂断</title>\n <g id="icon/挂断" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n <rect id="Rectangle" x="0" y="0" width="36" height="36"></rect>\n <path d="M16.0428281,19.9522968 C13.5228132,17.435123 11.1135994,14.5173605 12.2699084,13.3638925 C13.9205608,11.7132401 15.3581341,10.6961428 12.4346895,7.05675259 C9.50840386,3.41452132 7.55659974,6.21011849 5.95708632,7.80963191 C4.11324225,9.65631703 5.86049048,16.5345088 12.6591328,23.3359922 C19.4577751,30.1346345 26.3388079,31.8847238 28.1854931,30.0380386 C29.7850065,28.4385252 32.5806036,26.4895622 28.9412134,23.5632765 C25.3018232,20.6369909 24.2847259,22.0745642 22.6340735,23.7280576 C21.4777645,24.8786845 18.5628431,22.4694707 16.0428281,19.9522968 Z" id="路径" fill="#FFFFFF" fill-rule="nonzero" transform="translate(17.997936, 17.998157) rotate(135.000000) translate(-17.997936, -17.998157) "></path>\n </g>\n </svg>\n </div>\n <div style="margin-top: ').concat(.1*d,'px;">挂断</div>\n </div>'),l.onclick=function(){var e=n.decoderState.state,t=e.talk,i=e.play,o=e.sound;if(e.rejection)return!1;t&&(console.log("结束对讲"),n.setDecoderState({talk:!1}),n.jSPlugin.Talk.stopTalk()),i&&(n.jSPlugin.stop(),n.setDecoderState({play:!i})),o&&(n.jSPlugin.closeSound(),n.setDecoderState({sound:!1})),(i||t)&&(console.log("挂断"),n.removeBellRing(),n.rejectionStatusDispose(),"function"==typeof n.jSPlugin.hangUpCallback&&n.jSPlugin.hangUpCallback("hangUp"))},l;default:return l}}},{key:"answerOvertime",value:function(){this.toastCustom.initToastContent("应答超时");var e=this.decoderState.state.play;console.log("应答超时"),e&&this.jSPlugin.stop(),this.setDecoderState({play:!1,rejection:!0}),this.rejectionStatusDispose(),this.switchFooter("onBell"),"function"==typeof this.jSPlugin.hangUpCallback&&this.jSPlugin.hangUpCallback("rejection")}},{key:"rejectionStatusDispose",value:function(){var e=this,t=this.themeData.footer,n=document.getElementById("".concat(this.jSPlugin.id,"-audioControls")),i=document.getElementById("".concat(this.jSPlugin.id,"-audioControls-onCall")),o=document.getElementById("header-".concat(this.bellStatus,"-ringStatus"));"onBell"==this.bellStatus?(n.innerHTML="",n.style.color="#ffffff"):(i.innerHTML="",i.style.color="#ffffff"),console.log("rejectionStatusDispose"),this.setDecoderState({rejection:!0}),t[this.bellStatus].btnList.map((function(t,n){t.isrender&&e.renderFooter(t.iconId,t)})),o.innerText="通话已结束",this.jSPlugin.pluginStatus.loadingClear(),this.jSPlugin.pluginStatus.loadingSetTextWithBtn({text:"通话已结束",color:"white",isMobile:!1,type:2})}},{key:"userNoDevice",value:function(){var e=this;this.removeBellRing(),this.setDecoderState({rejection:!0});var t=this.themeData.footer,n=document.getElementById("".concat(this.jSPlugin.id,"-audioControls")),i=document.getElementById("".concat(this.jSPlugin.id,"-audioControls-onCall"));"onBell"==this.bellStatus?(n.innerHTML="",n.style.color="#ffffff"):(i.innerHTML="",i.style.color="#ffffff"),console.log("userNoDevice"),this.setDecoderState({rejection:!0}),t[this.bellStatus].btnList.map((function(t,n){t.isrender&&e.renderFooter(t.iconId,t)})),this.jSPlugin.pluginStatus.loadingClear(),this.jSPlugin.pluginStatus.loadingSetTextWithBtn({text:"该用户不拥有该设备",color:"white",isMobile:!1,type:2})}},{key:"renderHeader",value:function(e,t){var n=this,i=this.videoWidth/1024||1,o=this.matchBtn(e,t);if(document.getElementById("".concat(this.jSPlugin.id,"-header-").concat(this.bellStatus,"-content"))){var a=document.createElement("span");a.innerHTML="".concat(o.domString),document.getElementById("".concat(this.jSPlugin.id,"-header-").concat(this.bellStatus,"-content")).appendChild(a)}else{var r=document.createElement("div");r.id="".concat(this.jSPlugin.id,"-header-").concat(this.bellStatus),r.style="max-width:50%;position:relative;",r.innerHTML='<span id="'.concat(this.jSPlugin.id,"-header-").concat(this.bellStatus,'-content" style="display:inline-block;height:auto;padding-top: ').concat(32*i,'px;";>\n ').concat(o.domString,"\n </span>"),r.onclick=function(e){if(n.decoderState.state.isEditing||!n.activeThemeStatus)return!1;o.onclick(e)},document.getElementById("".concat(this.jSPlugin.id,"-headControl")).childNodes[0].appendChild(r)}}},{key:"renderFooter",value:function(e,t){var n=this,i=this.decoderState.state.mute;if(console.log("-------------renderFooter"),"remoteUnlock"==e&&this.jSPlugin.capacity&&(!this.jSPlugin.capacity.support_unlock||0==this.jSPlugin.capacity.support_unlock))return!1;var o=this.matchBtn(e,t),a=this.videoWidth/6,r=document.createElement("div");r.className="theme-icon-item",this.jSPlugin.isWebConsole?r.style="padding:0 ".concat(.1*a,"px;"):r.style="padding:0 ".concat(.1*a,"px;cursor: pointer;"),r.innerHTML="".concat('<span id="'.concat(this.jSPlugin.id,"-").concat(o.id,'" style="position:relative;">')+'<div id="'.concat(this.jSPlugin.id,"-").concat(o.id,'-content" title="').concat(o.title,'" style="display: flex;align-items: center;position:relative;">')).concat(o.domString,"</div>")+"</span>",r.onclick=function(e){if(n.decoderState.state.isEditing||!n.activeThemeStatus)return!1;o.onclick(e)},o.onmouseenter&&(r.onmouseenter=function(e){if(n.decoderState.state.isEditing||!n.activeThemeStatus)return!1;o.onmouseenter(e)}),o.onmouseleave&&(r.onmouseleave=function(e){if(n.decoderState.state.isEditing||!n.activeThemeStatus)return!1;o.onmouseleave(e)});var s=this.videoWidth/597,c=document.createElement("span");c.className="icon-move left",c.innerHTML='<span id="'.concat(this.jSPlugin.id,"-").concat(o.id,'-left" title="左移" style="display: inline-block;border-radius: 2px;overflow: hidden;position: absolute;top: calc(50% - ').concat(35*s,"px); width: ").concat(10*s,"px; height: ").concat(40*s,'px;cursor: pointer;">\n <svg width="100%" height="100%" viewBox="0 0 10 40" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n <title></title>\n <g id="呼叫模板-控制台" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n <g id="H5呼叫模板" transform="translate(-614.000000, -5024.000000)">\n <g id="编组-28" transform="translate(421.000000, 4484.000000)">\n <g id="编组-9" transform="translate(23.000000, 522.000000)">\n <g id="编组" transform="translate(170.000000, 0.000000)">\n <g id="箭头左" transform="translate(0.000000, 18.000000)">\n <rect id="矩形" fill="#595959" x="0" y="0" width="10" height="40" rx="2"></rect>\n <g id="1.通用/2.Icon图标/Common/Fill/Left" transform="translate(1.000000, 15.000000)" fill="#FFFFFF">\n <path d="M3.88411064,2.46093277 L7.81658983,7.1799078 C7.99337187,7.39204625 7.96470984,7.7073286 7.75257139,7.88411064 C7.66271389,7.95899189 7.54944745,8 7.43247919,8 L-0.432479194,8 C-0.708621569,8 -0.932479194,7.77614237 -0.932479194,7.5 C-0.932479194,7.38303175 -0.891471084,7.2697653 -0.816589833,7.1799078 L3.11588936,2.46093277 C3.2926714,2.24879432 3.60795375,2.22013229 3.8200922,2.39691433 C3.84332373,2.41627394 3.86475103,2.43770124 3.88411064,2.46093277 Z" id="三角形" transform="translate(3.500000, 5.000000) scale(-1, -1) rotate(-270.000000) translate(-3.500000, -5.000000) "></path>\n </g>\n </g>\n </g>\n </g>\n </g>\n </g>\n </g>\n </svg>\n </span>'),c.onclick=function(){n.editIcon(o.id,"left","footer")},r.appendChild(c);var l=document.createElement("span");if(l.className="icon-move right",l.innerHTML='<span id="'.concat(this.jSPlugin.id,"-").concat(o.id,'-right" class="ezuikit-theme-icon" title="右移" style="display: inline-block;border-radius: 2px;overflow: hidden;position: absolute;top: calc(50% - ').concat(35*s,"px);left: ").concat(20*s+.5*a,"px; width: ").concat(10*s,"px; height: ").concat(40*s,'px;cursor: pointer;">\n <svg width="100%" height="100%" viewBox="0 0 10 40" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n <title></title>\n <g id="呼叫模板-控制台" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n <g id="H5呼叫模板" transform="translate(-684.000000, -5024.000000)">\n <g id="编组-28" transform="translate(421.000000, 4484.000000)">\n <g id="编组-9" transform="translate(23.000000, 522.000000)">\n <g id="编组" transform="translate(170.000000, 0.000000)">\n <g id="箭头右" transform="translate(70.000000, 18.000000)">\n <rect id="矩形" fill="#595959" x="0" y="0" width="10" height="40" rx="2"></rect>\n <g id="1.通用/2.Icon图标/Common/Fill/Left" transform="translate(5.500000, 20.000000) scale(-1, 1) translate(-5.500000, -20.000000) translate(2.000000, 15.000000)" fill="#FFFFFF">\n <path d="M3.88411064,2.46093277 L7.81658983,7.1799078 C7.99337187,7.39204625 7.96470984,7.7073286 7.75257139,7.88411064 C7.66271389,7.95899189 7.54944745,8 7.43247919,8 L-0.432479194,8 C-0.708621569,8 -0.932479194,7.77614237 -0.932479194,7.5 C-0.932479194,7.38303175 -0.891471084,7.2697653 -0.816589833,7.1799078 L3.11588936,2.46093277 C3.2926714,2.24879432 3.60795375,2.22013229 3.8200922,2.39691433 C3.84332373,2.41627394 3.86475103,2.43770124 3.88411064,2.46093277 Z" id="三角形" transform="translate(3.500000, 5.000000) scale(-1, -1) rotate(-270.000000) translate(-3.500000, -5.000000) "></path>\n </g>\n </g>\n </g>\n </g>\n </g>\n </g>\n </g>\n </svg>\n </span>'),l.onclick=function(){n.editIcon(o.id,"right","footer")},r.appendChild(l),"answer"==e||"rejection"==e||"hangUp"==e);else{var d=document.createElement("span");d.className="icon-move close",d.innerHTML='<span id="'.concat(o.id,'-remove" class="ezuikit-theme-icon" title="移除" style="position: absolute;top: ').concat(-15*s-1,"px;left: ").concat(20*s+.5*a-4.5*s,'px;cursor: pointer;">\n <svg width="').concat(18*s,'" height="').concat(18*s,'" viewBox="0 0 18 18" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n <title></title>\n <g id="呼叫模板-控制台" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n <g id="H5呼叫模板" transform="translate(-680.000000, -5006.000000)">\n <g id="编组-28" transform="translate(421.000000, 4484.000000)">\n <g id="编组-9" transform="translate(23.000000, 522.000000)">\n <g id="编组" transform="translate(170.000000, 0.000000)">\n <g id="关闭1" transform="translate(66.000000, 0.000000)">\n <rect id="矩形" fill-rule="nonzero" x="0" y="0" width="18" height="18"></rect>\n <path d="M9,1.125 C4.65117188,1.125 1.125,4.65117188 1.125,9 C1.125,13.3488281 4.65117188,16.875 9,16.875 C13.3488281,16.875 16.875,13.3488281 16.875,9 C16.875,4.65117188 13.3488281,1.125 9,1.125 Z M11.9074219,11.9917969 L10.7472656,11.9865234 L9,9.90351562 L7.25449219,11.9847656 L6.09257813,11.9900391 C6.01523438,11.9900391 5.95195313,11.9285156 5.95195313,11.8494141 C5.95195313,11.8160156 5.96425781,11.784375 5.98535156,11.7580078 L8.27226563,9.03339844 L5.98535156,6.31054687 C5.96425781,6.28417969 5.95195313,6.25253906 5.95195313,6.21914062 C5.95195313,6.14179687 6.01523438,6.07851562 6.09257813,6.07851562 L7.25449219,6.08378906 L9,8.16679687 L10.7455078,6.08554688 L11.9056641,6.08027344 C11.9830078,6.08027344 12.0462891,6.14179687 12.0462891,6.22089844 C12.0462891,6.25429687 12.0339844,6.2859375 12.0128906,6.31230469 L9.72949219,9.03515625 L12.0146484,11.7597656 C12.0357422,11.7861328 12.0480469,11.8177734 12.0480469,11.8511719 C12.0480469,11.9285156 11.9847656,11.9917969 11.9074219,11.9917969 Z" id="形状" fill="#595959"></path>\n </g>\n </g>\n </g>\n </g>\n </g>\n </g>\n </svg>\n </span>'),d.onclick=function(){n.editIcon(o.id,"delete","footer")},r.appendChild(d)}"onCall"==this.bellStatus?document.getElementById("".concat(this.jSPlugin.id,"-audioControls-onCall")).appendChild(r):document.getElementById("".concat(this.jSPlugin.id,"-audioControls")).appendChild(r),this.decoderState.state.isEditing&&"mute"==e&&"onCall"==this.bellStatus&&(0!=this.themeData.customConfig.defaultMicro||i?this.setDecoderState({mute:!1},t.backgroundColor):this.setDecoderState({mute:!0},t.backgroundColor))}},{key:"switchFooter",value:function(e){var t={};switch(this.themeData&&(t=this.themeData.footer),e){case"onBell":document.getElementById("".concat(this.jSPlugin.id,"-audioControls-quickReply"))&&(document.getElementById("".concat(this.jSPlugin.id,"-audioControls-quickReply")).style.display="none"),document.getElementById("".concat(this.jSPlugin.id,"-audioControls-onCall"))?"none"==document.getElementById("".concat(this.jSPlugin.id,"-audioControls-onCall")).style.display&&(document.getElementById("".concat(this.jSPlugin.id,"-audioControls")).style.display="flex"):document.getElementById("".concat(this.jSPlugin.id,"-audioControls")).style.display="flex";break;case"onCall":document.getElementById("".concat(this.jSPlugin.id,"-audioControls-remoteUnlock")).style.display="none",document.getElementById("".concat(this.jSPlugin.id,"-audioControls")).style.display="none",document.getElementById("".concat(this.jSPlugin.id,"-audioControls-onCall")).style.display="flex",this.themeData&&(document.getElementById("".concat(this.jSPlugin.id,"-audioControls-onCall")).style.color=t[this.bellStatus].color);break;case"quickReply":document.getElementById("".concat(this.jSPlugin.id,"-audioControls-quickReply")).style.display="flex",document.getElementById("".concat(this.jSPlugin.id,"-audioControls")).style.display="none";break;case"remoteUnlock":document.getElementById("".concat(this.jSPlugin.id,"-audioControls-onCall")).style.display="none",document.getElementById("".concat(this.jSPlugin.id,"-audioControls")).style.display="none",document.getElementById("".concat(this.jSPlugin.id,"-audioControls-remoteUnlock")).style.display="flex"}}},{key:"initThemeData",value:function(){var e=this;console.log("-------------initThemeData");var t=this.decoderState.state.isEditing,n=this.themeData,o=n.header,a=n.footer,r=this.jSPlugin.id,s=this.videoWidth/1024;if(this.isNeedRenderHeader=i.findIndex(o[this.bellStatus].btnList,(function(e){return e.isrender>0}))>=0,this.isNeedRenderFooter=i.findIndex(a[this.bellStatus].btnList,(function(e){return e.isrender>0}))>=0,this.isNeedRenderHeader)if(document.getElementById("".concat(this.jSPlugin.id,"-headControl")))document.getElementById("".concat(this.jSPlugin.id,"-headControl")).innerHTML="<div id='".concat(this.jSPlugin.id,"-headControl-left' style='display:flex;width: calc(100% - 100px);padding-left: 3%;'></div><div id='").concat(this.jSPlugin.id,"-headControl-right' style='display:flex'></div>");else{var c=document.createElement("div");c.setAttribute("id","".concat(this.jSPlugin.id,"-headControl")),c.setAttribute("class","header-controls"),c.innerHTML="<div id='".concat(this.jSPlugin.id,"-headControl-left' class=\"header-controls-left\" style='display:flex;width:calc(100% - 100px);overflow:hidden;padding-left: 3%;'></div><div id='").concat(this.jSPlugin.id,"-headControl-right' class=\"header-controls-right\" style='display:flex;'></div>"),console.log(this.jSPlugin.height);var l=.2*this.jSPlugin.height+"px",d={height:l,display:"flex","justify-content":"space-between",top:0,"z-index":999,color:"#FFFFFF",width:"100%",position:"relative","margin-bottom":"-"+l,"align-items":"center",background:"transparent linear-gradient(180deg, rgba(0,0,0,0.65) 0%, rgba(0,0,0,0.00) 100%)"};c.style=ot(d),document.getElementById("".concat(r,"-wrap")).insertBefore(c,document.getElementById(r));var u=setInterval((function(){window.EZUIKit[e.jSPlugin.id].state.EZUIKitPlayer.init&&clearInterval(u)}),50)}else document.getElementById("".concat(this.jSPlugin.id,"-headControl"))&&document.getElementById("".concat(this.jSPlugin.id,"-headControl")).parentElement.removeChild(document.getElementById("".concat(this.jSPlugin.id,"-headControl")));var m=.3*this.jSPlugin.height;if(this.isNeedRenderFooter)if(document.getElementById("".concat(this.jSPlugin.id,"-ez-iframe-footer-container")))document.getElementById("".concat(this.jSPlugin.id,"-ez-iframe-footer-container"))&&(document.getElementById("".concat(this.jSPlugin.id,"-ez-iframe-footer-container")).style.marginTop="-".concat(m,"px"),"onCall"==this.bellStatus?document.getElementById("".concat(this.jSPlugin.id,"-ez-iframe-footer-container")).innerHTML='\n <div id="'.concat(this.jSPlugin.id,'-audioControls" class="footer-controls" style=\'display:none;justify-content: space-around;padding: 0 4%;width:100%;\'></div>\n <div id="').concat(this.jSPlugin.id,'-audioControls-onCall" class="footer-controls" style=\'display:flex;justify-content: space-around;padding: 0 4%;width:100%;z-index:999;position: relative;\'></div>\n <div id="').concat(this.jSPlugin.id,'-audioControls-quickReply" class="footer-controls" style=\'display:none;justify-content: center;width:100%;z-index:999;position: relative;\'></div>\n <div id="').concat(this.jSPlugin.id,'-audioControls-remoteUnlock" class="footer-controls" style=\'display:none;justify-content: center;width:100%;z-index:999;position: relative;\'></div>\n '):document.getElementById("".concat(this.jSPlugin.id,"-ez-iframe-footer-container")).innerHTML='\n <div id="'.concat(this.jSPlugin.id,'-audioControls" class="footer-controls" style=\'display:flex;justify-content: space-around;padding: 0 4%;width:100%;\'></div>\n <div id="').concat(this.jSPlugin.id,'-audioControls-onCall" class="footer-controls" style=\'display:none;justify-content: space-around;padding: 0 4%;width:100%;z-index:999;position: relative;\'></div>\n <div id="').concat(this.jSPlugin.id,'-audioControls-quickReply" class="footer-controls" style=\'display:none;justify-content: center;width:100%;z-index:999;position: relative;\'></div>\n <div id="').concat(this.jSPlugin.id,'-audioControls-remoteUnlock" class="footer-controls" style=\'display:none;justify-content: center;width:100%;z-index:999;position: relative;\'></div>\n '));else{var h=document.createElement("div");h.setAttribute("id","".concat(this.jSPlugin.id,"-ez-iframe-footer-container")),h.setAttribute("class","ez-iframe-footer-container");var p={"min-height":m+"px","max-height":m+"px",position:"relative","margin-top":"-"+m+"px",display:"flex","flex-wrap":"wrap","justify-content":"space-between","z-index":999,top:0,color:"#FFFFFF",width:"100%","align-items":"center","background-image":"linear-gradient(180deg, rgba(0,0,0,0.00) 0%, rgba(0,0,0,0.60) 100%)","font-size":24*s+"px"};h.style=ot(p),h.innerHTML='\n <div id="'.concat(this.jSPlugin.id,'-audioControls" class="footer-controls" style=\'display:flex;justify-content: space-around;padding: 0 4%;width:100%;z-index:999;position: relative;\'></div>\n <div id="').concat(this.jSPlugin.id,'-audioControls-onCall" class="footer-controls" style=\'display:none;justify-content: space-around;padding: 0 4%;width:100%;z-index:999;position: relative;\'></div>\n <div id="').concat(this.jSPlugin.id,'-audioControls-quickReply" class="footer-controls" style=\'display:none;justify-content: center;width:100%;z-index:999;position: relative;\'></div>\n <div id="').concat(this.jSPlugin.id,'-audioControls-remoteUnlock" class="footer-controls" style=\'display:none;justify-content: center;width:100%;z-index:999;position: relative;\'></div>\n '),x(h,document.getElementById(r))}else document.getElementById("".concat(this.jSPlugin.id,"-ez-iframe-footer-container"))&&document.getElementById("".concat(this.jSPlugin.id,"-ez-iframe-footer-container")).parentElement.removeChild(document.getElementById("".concat(this.jSPlugin.id,"-ez-iframe-footer-container")));if(this.isNeedRenderHeader&&document.getElementById("".concat(this.jSPlugin.id,"-headControl"))&&(document.getElementById("".concat(this.jSPlugin.id,"-headControl")).style.background=o[this.bellStatus].backgroundColor,document.getElementById("".concat(this.jSPlugin.id,"-headControl")).style.color=o[this.bellStatus].color,o[this.bellStatus].btnList.map((function(t,n){t.isrender&&e.renderHeader(t.iconId,t)}))),this.isNeedRenderFooter&&document.getElementById("".concat(this.jSPlugin.id,"-audioControls"))&&(document.getElementById("".concat(this.jSPlugin.id,"-audioControls")).style.background=a[this.bellStatus].backgroundColor,document.getElementById("".concat(this.jSPlugin.id,"-audioControls")).style.color=a[this.bellStatus].color,a[this.bellStatus].btnList.map((function(t,n){t.isrender&&e.renderFooter(t.iconId,t)}))),1==this.themeData.customConfig.bellPoster&&!t){this.jSPlugin.poster="https://resource.eziot.com/group1/M00/00/B8/CtwQEmPbGh2AVJB-ABDcYtyw5gk899.svg";var g=setInterval((function(){window.EZUIKit[e.jSPlugin.id].state.EZUIKitPlayer.init&&(clearInterval(g),e.jSPlugin.setPoster(e.jSPlugin.poster))}),50)}this.activeThemeStatus&&(this.initBellRing(),window.addEventListener("click",this.autoPlayRing)),this.inited=!0,this.getCallDeviceInfo()}},{key:"renderThemeData",value:function(){var e=this,t=this.decoderState.state.isEditing,n=this.themeData,i=n.header,o=n.footer;if(this.isNeedRenderHeader&&i&&(document.getElementById("".concat(this.jSPlugin.id,"-headControl")).style.background=i[this.bellStatus].backgroundColor.replace("-diy",""),document.getElementById("".concat(this.jSPlugin.id,"-headControl")).style.color=i[this.bellStatus].color.replace("-diy",""),i[this.bellStatus].btnList.map((function(t,n){t.isrender&&e.setDecoderState(p({},t.iconId,e.decoderState.state[t.iconId]))}))),this.isNeedRenderFooter&&o)document.getElementById("".concat(this.jSPlugin.id,"-audioControls")).style.background=o[this.bellStatus].backgroundColor.replace("-diy",""),document.getElementById("".concat(this.jSPlugin.id,"-audioControls")).style.color=o[this.bellStatus].color.replace("-diy",""),document.getElementById("".concat(this.jSPlugin.id,"-audioControls-onCall")).style.color=o[this.bellStatus].color.replace("-diy",""),o[this.bellStatus].btnList.map((function(n,i){if(n.isrender&&e.setDecoderState(p({},n.iconId,e.decoderState.state[n.iconId])),0==i&&!e.themeInited&&e.activeThemeStatus)var o=setInterval((function(){window.EZUIKit[e.jSPlugin.id].state.EZUIKitPlayer.init&&(clearInterval(o),1!=e.themeData.customConfig.bellPoster||t?e.jSPlugin.play():e.jSPlugin.pluginStatus.loadingClear(),e.themeInited=!0)}),50)})),-1!==this.jSPlugin.url.indexOf("hd.live")&&this.setDecoderState({hd:!0}),this.themeData.autoFocus>0&&(this.autoFocus=parseInt(this.themeData.autoFocus),this.startAutoFocus(),document.getElementById("".concat(this.jSPlugin.id,"-wrap")).addEventListener("click",(function(){e.stopAutoFocus()}))),this.setDecoderState({cloudRec:"cloud.rec"===A(this.jSPlugin.url).type,rec:"rec"===A(this.jSPlugin.url).type,type:A(this.jSPlugin.url).type});else if(!this.themeInited&&this.activeThemeStatus)var a=setInterval((function(){window.EZUIKit[e.jSPlugin.id].state.EZUIKitPlayer.init&&(clearInterval(a),e.themeData&&e.themeData.customConfig&&1==e.themeData.customConfig.bellPoster&&!t?e.jSPlugin.pluginStatus.loadingClear():e.jSPlugin.play(),e.themeInited=!0)}),50);var r=setInterval((function(){window.EZUIKit[e.jSPlugin.id].state.EZUIKitPlayer.init&&(clearInterval(r),e.jSPlugin.reSize(e.jSPlugin.params.width,e.jSPlugin.params.height))}),50)}},{key:"setThemeData",value:function(e,t){this.themeData=e,"onCall"==t&&(this.bellStatus="onCall")}},{key:"startAutoFocus",value:function(){var e=this,t=this.autoFocus;this.autoFocusTimer&&clearTimeout(this.autoFocusTimer),this.autoFocusTimer=setTimeout((function(){document.getElementById("".concat(e.jSPlugin.id,"-audioControls"))&&(document.getElementById("".concat(e.jSPlugin.id,"-audioControls")).style.opacity=0,document.getElementById("".concat(e.jSPlugin.id,"-audioControls")).style.pointerEvents="none")}),1e3*t)}},{key:"stopAutoFocus",value:function(){document.getElementById("".concat(this.jSPlugin.id,"-audioControls"))&&(document.getElementById("".concat(this.jSPlugin.id,"-audioControls")).style.opacity=1,document.getElementById("".concat(this.jSPlugin.id,"-audioControls")).style.pointerEvents="all"),this.autoFocusTimer&&clearTimeout(this.autoFocusTimer),this.startAutoFocus()}},{key:"editIcon",value:function(e,t,n){console.log("编辑组件",e,t,n);var o=this.themeData;console.log("themeData",this.themeData);var a=this.themeData[n][this.bellStatus].btnList,r=i.findIndex(a,(function(t){return t.iconId===e})),s=a[r];switch(t){case"delete":a[r].isrender=0;break;case"right":for(var c=-1,l=r+1;l<a.length;l++)if(a[l].part===a[r].part&&1==a[l].isrender){c=l;break}-1!==c&&(a[r]=a[c],a[c]=s);break;case"left":for(var d=-1,u=r-1;u>=0;u--)if(a[u].part===a[r].part&&1==a[u].isrender){d=u;break}-1!==d&&(a[r]=a[d],a[d]=s)}console.log("new btnList",a),o[n][this.bellStatus].btnList=a,this.jSPlugin.Theme.changeTheme(o)}},{key:"countTime",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this;if(!document.getElementById(this.jSPlugin.id+"time-area")){var i=document.createElement("div");i.id=this.jSPlugin.id+"time-area",i.className="time-area",i.innerHTML='<span class="dot"></span><span class="value">00:00</span>',document.getElementById("".concat(this.jSPlugin.id,"-ez-iframe-footer-container"))&&document.getElementById("".concat(this.jSPlugin.id,"-ez-iframe-footer-container")).appendChild(i)}if(this.countTimer&&clearInterval(this.countTimer),"add"===e){var o=t;document.getElementById(n.jSPlugin.id+"time-area").style.display="flex",this.countTimer=setInterval((function(){++o,document.getElementById(n.jSPlugin.id+"time-area").children[1].innerHTML=function(e){var t=parseInt(e),n=0,i=0,o="00",a="00",r="00";t>59&&(n=parseInt(t/60),t=parseInt(t%60),n>59&&(i=parseInt(n/60),n=parseInt(n%60)));return o=parseInt(t)>9?parseInt(t):"0"+parseInt(t),a=parseInt(n)>9?parseInt(n):"0"+parseInt(n),r=parseInt(i)>9?parseInt(i):"0"+parseInt(i),i>0?r+":"+a+":"+o:n>0?a+":"+o:"00:"+o}(o)}),1e3)}else"destroy"===e&&(this.countTimer&&clearInterval(this.countTimer),this.countTimer=void 0,document.getElementById(n.jSPlugin.id+"time-area")&&(document.getElementById(n.jSPlugin.id+"time-area").children[1].innerHTML="00:00",document.getElementById(n.jSPlugin.id+"time-area").style.display="none"))}},{key:"editStart",value:function(e){console.log("----------editStart2");var t=document.getElementById("".concat(this.jSPlugin.id,"-audioControls")),n=document.getElementById("".concat(this.jSPlugin.id,"-audioControls-onCall"));document.getElementById("".concat(this.jSPlugin.id,"-headControl")),t&&t.setAttribute("class","footer-controls themeEditing"),n&&n.setAttribute("class","footer-controls themeEditing"),this.setDecoderState({isEditing:!0})}},{key:"editEnd",value:function(e){console.log("----------editEnd2");var t=document.getElementById("".concat(this.jSPlugin.id,"-audioControls")),n=document.getElementById("".concat(this.jSPlugin.id,"-headControl")),i=document.getElementById("".concat(this.jSPlugin.id,"-audioControls-onCall"));n&&n.setAttribute("class","header-controls"),t&&t.setAttribute("class","footer-controls"),i&&i.setAttribute("class","footer-controls")}},{key:"fetchThemeData",value:function(e){var t=this;Ue(this.jSPlugin,e,(function(e){0==e.meta.code&&e.data?(t.activeThemeStatus=!0,t.themeData=e.data,e.data.header&&(t.themeData.header=e.data.header,t.themeData.header[t.bellStatus].btnList=t.themeData.header[t.bellStatus].btnList.sort((function(e,t){return e.btnKey.split("-")[3]-t.btnKey.split("-")[3]}))),e.data.footer&&(t.themeData.footer=e.data.footer,t.themeData.footer[t.bellStatus].btnList=t.themeData.footer[t.bellStatus].btnList.sort((function(e,t){return e.btnKey.split("-")[3]-t.btnKey.split("-")[3]}))),t.jSPlugin.capacity?(t.initThemeData(),t.renderThemeData()):setTimeout((function(){t.initThemeData(),t.renderThemeData()}),300)):(t.activeThemeStatus=!1,t.jSPlugin.pluginStatus.loadingClear(),t.setDecoderState({rejection:!0}),"111021"==e.meta.code?(t.jSPlugin.pluginStatus.loadingSetText({text:"无效的模板id",color:"#fff"}),t.activeThemeStatusTxt="无效的模板id"):"111023"==e.meta.code?(t.jSPlugin.pluginStatus.loadingSetText({text:"您的试用特权已到期,需前往轻应用控制台购买后使用。",color:"#fff"}),t.activeThemeStatusTxt="试用特权已到期"):(t.jSPlugin.pluginStatus.loadingSetText({text:"模板未激活,请先在开放平台轻应用控制台购买模板",color:"#fff"}),t.activeThemeStatusTxt="模板未激活"),t.themeData=nt,t.initThemeData(),t.renderThemeData())}),(function(){t.renderThemeData()}))}},{key:"getCallDeviceInfo",value:function(){var e=this;this.videoWidth,it({accessToken:this.jSPlugin.accessToken||this.jSPlugin.token.deviceToken.video,deviceSerial:A(this.jSPlugin.url).deviceSerial}).then((function(t){console.log("---------getCallDeviceInfo"),e.deviceInfoData=t.data,t.data.isEncrypt&&setTimeout((function(){e.jSPlugin.pluginStatus.loadingClear(),e.jSPlugin.pluginStatus.loadingSetText({text:"视频已加密",color:"#fff"})}),500),document.getElementById("header-".concat(e.bellStatus,"-deviceCategory"))&&(document.getElementById("header-".concat(e.bellStatus,"-deviceCategory")).innerText=""+t.data.deviceName)})).catch((function(t){20018!=t.code||e.jSPlugin.isWebConsole||e.userNoDevice(),console.log("获取设备信息失败",t)}))}},{key:"setHeaderText",value:function(e){var t=this.videoWidth/1024||1;document.getElementById("".concat(this.jSPlugin.id,"-deviceCategory-content"))&&(document.getElementById("".concat(this.jSPlugin.id,"-deviceCategory-content")).innerHTML='<span style="font-size: '.concat(32*t,'px;display: block">').concat(e,'</span><span style="font-size: ').concat(24*t,"px;padding-top: ").concat(16*t,'px;display: block;">').concat(this.deviceInfoData&&this.deviceInfoData.deviceName||"","</span>"))}}])}(),rt=function(){return m((function e(t,n,i){l(this,e),this.jSPlugin=t,this.videoWidth=i,this.switchFooter=n,this.toastCustom=new Je(t,!0),this.sendLoadingStats=!1,this.quickReplyList=["你好,请将快递放在门口","你好,稍等","你好,请将快递放入小区快递柜","你好,请将外卖放在门口"],this.popupCustom=new H(t,366),document.getElementById("mobile-quickReply-list")||(this.popupCustom.initPopupContent("快捷回复",this.renderQuickReply()),this.initQuickReply())}),[{key:"initQuickReply",value:function(){document.getElementById("mobile-quickReply-list-item-0")||this.getQuickReplyList()}},{key:"renderQuickReply",value:function(){document.documentElement.clientWidth;var e=document.createElement("div");return e.style="width:100%;",e.id="mobile-quickReply-list",e.innerHTML='<div id="mobile-quickReply-content" style="display: block;width:100%;margin-bottom: 36px;"></div>\n <div id="mobile-quickReply-loading" style="display: none;width:100%;"></div>\n <div id="mobile-quickReply-loaderror" style="display: none;width:100%;"></div>',e}},{key:"matchQuickReplyBtn",value:function(){var e=this,t=this.videoWidth/375||1,n=document.getElementById("mobile-quickReply-content");this.quickReplyList&&this.quickReplyList.length>0&&this.quickReplyList.forEach((function(i,o){var a=document.createElement("div");a.id="mobile-quickReply-list-item-".concat(o),a.style="margin: ".concat(14*t,"px 0;\n padding: ").concat(12*t,"px ").concat(15*t,"px;min-height: ").concat(50*t,"px;width:100%;\n background: #ffffff;border-radius: ").concat(25*t,"px;display: flex;align-items: center;\n box-sizing: border-box;font-size:").concat(16*t,"px;color: #2c2c2c;"),a.innerHTML='\n <svg id="mobile-quickReply-icon-'.concat(o,'" width="').concat(24*t,'px" height="').concat(24*t,'px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n <title>icon/快捷回复播放</title>\n <g id="icon/快捷回复播放" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n <rect id="Rectangle" x="0" y="0" width="24" height="24"></rect>\n <path d="M18.9877488,4.36609064 C21.024173,6.11256041 22.2495,8.93566941 22.2495,12.0024 C22.2495,15.066006 21.0272636,17.8857191 18.9943957,19.6331539 C18.6802816,19.9031635 18.2067557,19.8674098 17.9367461,19.5532957 C17.6667365,19.2391816 17.7024902,18.7656557 18.0166043,18.4956461 C19.708691,17.0411437 20.7495,14.6399857 20.7495,12.0024 C20.7495,9.36223947 19.7060688,6.95821183 18.0112512,5.50470936 C17.6968304,5.23505702 17.6605383,4.76157212 17.9301906,4.44715124 C18.199843,4.13273036 18.6733279,4.09643829 18.9877488,4.36609064 Z M12.2442357,5.87579772 L12.2496,6.0179 L12.2496,17.9819 C12.2496,19.4241617 10.6173522,20.2281184 9.48072691,19.4058312 L9.36879527,19.318145 L5.5996,16.1243865 L3.4996,16.1249 C2.581479,16.1249 1.8284129,15.4182283 1.75540159,14.518493 L1.7496,14.3749 L1.7496,9.6249 C1.7496,8.70699712 2.45696726,7.95373471 3.35611134,7.88070323 L3.4996,7.8749 L5.5996,7.8743865 L9.36863059,4.68279453 C10.4692948,3.74976994 12.1377395,4.4768074 12.2442357,5.87579772 Z M10.3952894,5.79039368 L10.338321,5.82721597 L6.35932099,9.19721597 C6.33078024,9.2209397 6.30781291,9.23786997 6.28390041,9.25347262 L6.35932099,9.19721597 C6.32908972,9.22282023 6.29742069,9.24561685 6.26463127,9.26563212 C6.24087088,9.28012218 6.21634729,9.29327785 6.19105714,9.30506452 C6.18413632,9.30829747 6.1773583,9.31133066 6.1705483,9.31425704 C6.10964585,9.34044144 6.04445985,9.35881628 5.97637056,9.36805338 C5.95756973,9.37054904 5.94148484,9.37214804 5.92538001,9.37322799 L5.8746,9.3749 L3.4996,9.3749 C3.38149734,9.3749 3.28218291,9.45734262 3.25621762,9.56766695 L3.2496,9.6249 L3.2496,14.3749 C3.2496,14.4934644 3.33170357,14.592449 3.44222164,14.6183106 L3.4996,14.6249 L5.8746,14.6249 L5.92192315,14.6263483 C5.93923255,14.627429 5.95652113,14.629109 5.97375563,14.6313909 L5.8746,14.6249 C5.9789469,14.6249 6.0783167,14.6462095 6.168595,14.6847142 C6.18010037,14.6895946 6.19235048,14.695194 6.2044823,14.7011451 C6.22547728,14.7114805 6.24528995,14.7223727 6.26453263,14.7341072 C6.266314,14.735195 6.26795143,14.7362034 6.26958602,14.7372187 L6.28086895,14.7443598 C6.30587317,14.7605037 6.32985559,14.7780945 6.3526978,14.7970136 L6.35940473,14.802655 L10.3380567,18.1733603 C10.4825575,18.2956302 10.695338,18.2179271 10.7408386,18.0492187 L10.7496,17.9819 L10.7496,6.0179 C10.7496,5.82820058 10.5532313,5.71607381 10.3952894,5.79039368 Z M15.9361636,7.38657032 C17.3580982,8.28109203 18.2498,10.0509458 18.2498,12.0044 C18.2498,13.9607796 17.3563865,15.7307985 15.9326223,16.6154437 C15.5807928,16.8340503 15.1183629,16.7260519 14.8997563,16.3742223 C14.6811497,16.0223928 14.7891481,15.5599629 15.1409777,15.3413563 C16.1036696,14.7431949 16.7498,13.4630899 16.7498,12.0044 C16.7498,10.5466827 16.103548,9.26399865 15.1374364,8.65622968 C14.7868297,8.43566726 14.6814079,7.97264316 14.9019703,7.62203641 C15.1225327,7.27142966 15.5855568,7.1660079 15.9361636,7.38657032 Z" id="形状结合" fill="#2C2C2C" fill-rule="nonzero"></path>\n </g>\n </svg>\n <span id="mobile-quickReply-name-').concat(o,'" style="padding-left: 5px;">').concat(i.voiceName,"</span>"),a.onclick=function(){console.log("item:"+i),e.sendLoadingStats||(e.setBtnCheckStatus(o),e.sendQuickReply(i))},n.appendChild(a)}))}},{key:"setBtnCheckStatus",value:function(e){var t=this,n="";this.quickReplyList.forEach((function(i,o){n=document.getElementById("mobile-quickReply-list-item-".concat(o)),o==e?(n.style.background="#F4F6FC",n.style.color="#648FFC",t.setBtnCheckLoding(0,o)):(n.style.background="#ffffff",n.style.color="#2c2c2c")}))}},{key:"setBtnCheckLoding",value:function(e,t){console.log(t);var n=this.videoWidth/375||1;if(t>-1){var i=document.getElementById("mobile-quickReply-list-item-".concat(t)),o=document.getElementById("mobile-quickReply-name-".concat(t)),a=document.getElementById("mobile-quickReply-icon-".concat(t));if(1==e){if(document.getElementById("mobile-quickReply-icon-loading-".concat(t))&&o){var r=document.createElement("span");r.id="mobile-quickReply-icon-".concat(t),r.style="height:".concat(24*n,"px;"),r.innerHTML='\n <svg width="'.concat(24*n,'px" height="').concat(24*n,'px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n <title>icon/快捷回复播放</title>\n <g id="icon/快捷回复播放" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n <rect id="Rectangle" x="0" y="0" width="24" height="24"></rect>\n <path d="M18.9877488,4.36609064 C21.024173,6.11256041 22.2495,8.93566941 22.2495,12.0024 C22.2495,15.066006 21.0272636,17.8857191 18.9943957,19.6331539 C18.6802816,19.9031635 18.2067557,19.8674098 17.9367461,19.5532957 C17.6667365,19.2391816 17.7024902,18.7656557 18.0166043,18.4956461 C19.708691,17.0411437 20.7495,14.6399857 20.7495,12.0024 C20.7495,9.36223947 19.7060688,6.95821183 18.0112512,5.50470936 C17.6968304,5.23505702 17.6605383,4.76157212 17.9301906,4.44715124 C18.199843,4.13273036 18.6733279,4.09643829 18.9877488,4.36609064 Z M12.2442357,5.87579772 L12.2496,6.0179 L12.2496,17.9819 C12.2496,19.4241617 10.6173522,20.2281184 9.48072691,19.4058312 L9.36879527,19.318145 L5.5996,16.1243865 L3.4996,16.1249 C2.581479,16.1249 1.8284129,15.4182283 1.75540159,14.518493 L1.7496,14.3749 L1.7496,9.6249 C1.7496,8.70699712 2.45696726,7.95373471 3.35611134,7.88070323 L3.4996,7.8749 L5.5996,7.8743865 L9.36863059,4.68279453 C10.4692948,3.74976994 12.1377395,4.4768074 12.2442357,5.87579772 Z M10.3952894,5.79039368 L10.338321,5.82721597 L6.35932099,9.19721597 C6.33078024,9.2209397 6.30781291,9.23786997 6.28390041,9.25347262 L6.35932099,9.19721597 C6.32908972,9.22282023 6.29742069,9.24561685 6.26463127,9.26563212 C6.24087088,9.28012218 6.21634729,9.29327785 6.19105714,9.30506452 C6.18413632,9.30829747 6.1773583,9.31133066 6.1705483,9.31425704 C6.10964585,9.34044144 6.04445985,9.35881628 5.97637056,9.36805338 C5.95756973,9.37054904 5.94148484,9.37214804 5.92538001,9.37322799 L5.8746,9.3749 L3.4996,9.3749 C3.38149734,9.3749 3.28218291,9.45734262 3.25621762,9.56766695 L3.2496,9.6249 L3.2496,14.3749 C3.2496,14.4934644 3.33170357,14.592449 3.44222164,14.6183106 L3.4996,14.6249 L5.8746,14.6249 L5.92192315,14.6263483 C5.93923255,14.627429 5.95652113,14.629109 5.97375563,14.6313909 L5.8746,14.6249 C5.9789469,14.6249 6.0783167,14.6462095 6.168595,14.6847142 C6.18010037,14.6895946 6.19235048,14.695194 6.2044823,14.7011451 C6.22547728,14.7114805 6.24528995,14.7223727 6.26453263,14.7341072 C6.266314,14.735195 6.26795143,14.7362034 6.26958602,14.7372187 L6.28086895,14.7443598 C6.30587317,14.7605037 6.32985559,14.7780945 6.3526978,14.7970136 L6.35940473,14.802655 L10.3380567,18.1733603 C10.4825575,18.2956302 10.695338,18.2179271 10.7408386,18.0492187 L10.7496,17.9819 L10.7496,6.0179 C10.7496,5.82820058 10.5532313,5.71607381 10.3952894,5.79039368 Z M15.9361636,7.38657032 C17.3580982,8.28109203 18.2498,10.0509458 18.2498,12.0044 C18.2498,13.9607796 17.3563865,15.7307985 15.9326223,16.6154437 C15.5807928,16.8340503 15.1183629,16.7260519 14.8997563,16.3742223 C14.6811497,16.0223928 14.7891481,15.5599629 15.1409777,15.3413563 C16.1036696,14.7431949 16.7498,13.4630899 16.7498,12.0044 C16.7498,10.5466827 16.103548,9.26399865 15.1374364,8.65622968 C14.7868297,8.43566726 14.6814079,7.97264316 14.9019703,7.62203641 C15.1225327,7.27142966 15.5855568,7.1660079 15.9361636,7.38657032 Z" id="形状结合" fill="#2C2C2C" fill-rule="nonzero"></path>\n </g>\n </svg>\n '),i.insertBefore(r,o)}}else if(a&&o){i.removeChild(a);var s=document.createElement("span");s.id="mobile-quickReply-icon-loading-".concat(t),s.style="height:".concat(20*n,"px;width: ").concat(24*n,"px;"),s.innerHTML='<svg width="'.concat(20*n,'" height="').concat(20*n,'" t="1567069979438" class="loading" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2399"><path d="M538.5344 266.4448a133.12 133.12 0 1 1 133.12-133.12 133.4272 133.4272 0 0 1-133.12 133.12zM255.0144 372.1984a121.6768 121.6768 0 1 1 121.6768-121.6768 121.856 121.856 0 0 1-121.6768 121.6768zM134.72 647.424a107.3664 107.3664 0 1 1 107.3664-107.264A107.52 107.52 0 0 1 134.72 647.424z m120.32 272.4608a90.9824 90.9824 0 1 1 90.9824-90.9824A91.1616 91.1616 0 0 1 255.04 919.8848zM538.5344 1024a79.36 79.36 0 1 1 79.36-79.36 79.36 79.36 0 0 1-79.36 79.36z m287.6928-134.144a64.1792 64.1792 0 1 1 64.1792-64.1792 64.3584 64.3584 0 0 1-64.1792 64.1792z m117.76-296.704a52.6336 52.6336 0 1 1 52.6592-52.6336 52.608 52.608 0 0 1-52.6336 52.6336z m-158.72-338.7136a40.96 40.96 0 1 1 12.0064 28.8512 40.5248 40.5248 0 0 1-12.0064-28.8512z" fill="#666666" p-id="2400"></path></svg>'),i.insertBefore(s,o)}}}},{key:"getQuickReplyList",value:function(){var e=this;console.log("getQuickReplyList"),this.madeLoadingDom(0);Qe(this.jSPlugin,(function(t){if(t&&200==t.code){var n=t.data||[],i=[];t.data.forEach((function(e,t){i=e.voiceName.split("_"),n[t].voiceName=i[1]})),e.quickReplyList=n,setTimeout((function(){e.madeLoadingDom(2)}),500)}else e.madeLoadingDom(1)}),(function(t){console.log(t),e.madeLoadingDom(1)}))}},{key:"madeLoadingDom",value:function(e){var t=this,n=this.videoWidth/375||1;if(0==e){if(document.getElementById("mobile-quickReply-content").style.display="none",document.getElementById("mobile-quickReply-loaderror").style.display="none",document.getElementById("mobile-quickReply-loading").style.display="block",!document.getElementById("mobile-quickReply-loading-box")){var i=document.createElement("div");i.id="mobile-quickReply-loading-box",i.style="width: 100%;display: flex;align-items: center;justify-content: center;flex-direction: row;",i.innerHTML='<div class="" style="heigth:'.concat(20*n,'px">\n <svg width="').concat(20*n,'" height="').concat(20*n,'" t="1567069979438" class="loading" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2399"><path d="M538.5344 266.4448a133.12 133.12 0 1 1 133.12-133.12 133.4272 133.4272 0 0 1-133.12 133.12zM255.0144 372.1984a121.6768 121.6768 0 1 1 121.6768-121.6768 121.856 121.856 0 0 1-121.6768 121.6768zM134.72 647.424a107.3664 107.3664 0 1 1 107.3664-107.264A107.52 107.52 0 0 1 134.72 647.424z m120.32 272.4608a90.9824 90.9824 0 1 1 90.9824-90.9824A91.1616 91.1616 0 0 1 255.04 919.8848zM538.5344 1024a79.36 79.36 0 1 1 79.36-79.36 79.36 79.36 0 0 1-79.36 79.36z m287.6928-134.144a64.1792 64.1792 0 1 1 64.1792-64.1792 64.3584 64.3584 0 0 1-64.1792 64.1792z m117.76-296.704a52.6336 52.6336 0 1 1 52.6592-52.6336 52.608 52.608 0 0 1-52.6336 52.6336z m-158.72-338.7136a40.96 40.96 0 1 1 12.0064 28.8512 40.5248 40.5248 0 0 1-12.0064-28.8512z" fill="#666666" p-id="2400"></path></svg> \n </div>\n <div style="font-size: ').concat(16*n,"px;margin-left:",10,'px;color:#666666;">正在加载,请稍候</div>'),document.getElementById("mobile-quickReply-loading").appendChild(i)}}else if(1==e){if(document.getElementById("mobile-quickReply-content").style.display="none",document.getElementById("mobile-quickReply-loading").style.display="none",document.getElementById("mobile-quickReply-loaderror").style.display="block",!document.getElementById("mobile-quickReply-loaderror-box")){var o=document.createElement("div");o.id="mobile-quickReply-loaderror-box",o.style="width: 100%;display: flex;align-items: center;justify-content: center;flex-direction: column;",o.innerHTML='<div style="">\n <img style="width:'.concat(186*n,"px;height:").concat(120*n,'px;" src="https://resource.eziot.com/group1/M00/00/B8/CtwQEmPZ34KAAStrAAA0pZ5cGTw167.png" />\n </div>\n <div style="font-size: ').concat(16*n,'px;color: #666666;">\n <span>加载失败 </span>\n <span id="mobile-quickReply-loaderror-reload" \n style="color: #648FFC;-webkit-tap-highlight-color: transparent;">点击重试</span>\n </div>'),document.getElementById("mobile-quickReply-loaderror").appendChild(o),document.getElementById("mobile-quickReply-loaderror-reload").onclick=function(){t.getQuickReplyList()}}}else document.getElementById("mobile-quickReply-loading").style.display="none",document.getElementById("mobile-quickReply-loaderror").style.display="none",document.getElementById("mobile-quickReply-content").style.display="block",this.matchQuickReplyBtn()}},{key:"sendQuickReply",value:function(e){var t=this;this.sendLoadingStats=!0;$e(this.jSPlugin,e.fileUrl,(function(e){t.sendLoadingStats=!1,e&&200==e.code?t.toastCustom.initToastContent("快捷回复成功"):t.toastCustom.initToastContent("快捷回复失败,请重试"),t.popupCustom.closePopupCustom()}),(function(e){console.log(e),t.sendLoadingStats=!1,t.toastCustom.initToastContent("快捷回复失败,请重试"),t.popupCustom.closePopupCustom()}))}},{key:"closeQuickReplyEle",value:function(){this.popupCustom.closePopupCustom()}}])}(),st=function(){return m((function e(t,n,i){l(this,e),this.jSPlugin=t,this.videoWidth=i,this.switchFooter=n,this.toastCustom=new Je(t,!0),this.lockStatus=!1,this.popupCustom=new H(t,265),this.popupCustom.initPopupContent("远程开锁",this.renderRemoteUnlock()),this.renderRemoteUnlockSlide()}),[{key:"initRemoteUnlock",value:function(){document.getElementById("mobile-remoteUnlock-content")?this.madeSlideEvent():this.renderRemoteUnlock()}},{key:"renderRemoteUnlock",value:function(){var e=this.videoWidth/1024||1,t=document.createElement("div");return t.style="width:100%;",t.id="mobile-remoteUnlock-box",t.innerHTML='<div style="width:100%;display:flex;flex-direction:row;align-items: center;">\n <div id="mobile-remoteUnlock-content" style="display: block;width:calc(100% - '.concat(160*e,"px);margin: 0 ").concat(24*e,'px;"></div>\n </div>'),t}},{key:"renderRemoteUnlockSlide",value:function(){var e=this.videoWidth/375||1,t=document.getElementById("mobile-remoteUnlock-content"),n=document.createElement("div");n.id="mobile-remoteUnlock-content-slide",n.style="width: 100%;display: flex;justify-content: center;padding: 0 ".concat(15*e,"px"),n.innerHTML='<div id="mobile-remoteUnlock-slide-box" style="width: 100%;line-height: '.concat(60*e,"px;height: ").concat(60*e,"px;border: 1px solid rgba(100,143,252,1);border-radius: ").concat(30*e,'px;position: relative;text-align: center;">\n <div id="mobile-remoteUnlock-slide-bgColor" style="border-radius: ').concat(30*e,"px;width: ").concat(44*e,"px;height: ").concat(60*e,'px;position: absolute;left: 0;top: 0;"></div>\n <div id="mobile-remoteUnlock-slide-tips" style="height: ').concat(60*e,"px;line-height: ").concat(60*e,"px;font-size: ").concat(14*e,"px;border-radius: ").concat(30*e,'px;position: absolute;text-align: center;user-select: none;color: #666666;width: 100%;">右滑开锁</div>\n <div id="mobile-remoteUnlock-slide-ball" style="top: ').concat(8*e,"px;left: ").concat(8*e,"px;width: ").concat(44*e,"px;height: ").concat(44*e,'px;background: #598FFF;position: absolute;text-align: center;border-radius:50%;display:flex;align-items: center;justify-content: center;">\n <svg id="slide-ball-start" style="display: inline;" width="').concat(24*e,'px" height="').concat(24*e,'px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n <title>icon/箭头向右</title>\n <g id="icon/箭头向右" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n <rect id="矩形" fill="#000000" fill-rule="nonzero" opacity="0" x="0" y="0" width="24" height="24"></rect>\n <path d="M14.2841136,6.3689007 L19.9432338,12.0287579 L14.2863796,17.6856122 L12.8580239,16.2572565 L16.114,12.9999007 L4.00000001,13 L4.00000001,11 L16.058,10.9999007 L12.8557579,7.79725638 L14.2841136,6.3689007 Z" id="形状结合" fill="#FFFFFF" fill-rule="nonzero"></path>\n </g>\n </svg>\n <svg id="slide-ball-end" style="display: none;" width="').concat(20*e,'" height="').concat(20*e,'" t="1567069979438" class="loading" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2399"><path d="M538.5344 266.4448a133.12 133.12 0 1 1 133.12-133.12 133.4272 133.4272 0 0 1-133.12 133.12zM255.0144 372.1984a121.6768 121.6768 0 1 1 121.6768-121.6768 121.856 121.856 0 0 1-121.6768 121.6768zM134.72 647.424a107.3664 107.3664 0 1 1 107.3664-107.264A107.52 107.52 0 0 1 134.72 647.424z m120.32 272.4608a90.9824 90.9824 0 1 1 90.9824-90.9824A91.1616 91.1616 0 0 1 255.04 919.8848zM538.5344 1024a79.36 79.36 0 1 1 79.36-79.36 79.36 79.36 0 0 1-79.36 79.36z m287.6928-134.144a64.1792 64.1792 0 1 1 64.1792-64.1792 64.3584 64.3584 0 0 1-64.1792 64.1792z m117.76-296.704a52.6336 52.6336 0 1 1 52.6592-52.6336 52.608 52.608 0 0 1-52.6336 52.6336z m-158.72-338.7136a40.96 40.96 0 1 1 12.0064 28.8512 40.5248 40.5248 0 0 1-12.0064-28.8512z" fill="#648ffc" p-id="2400"></path></svg>\n </div>\n </div>'),t.appendChild(n),this.madeSlideEvent()}},{key:"madeSlideEvent",value:function(){var e=this.videoWidth/375||1,t=document.getElementById("mobile-remoteUnlock-slide-box"),n=document.getElementById("mobile-remoteUnlock-slide-bgColor"),i=document.getElementById("mobile-remoteUnlock-slide-tips"),o=document.getElementById("mobile-remoteUnlock-slide-ball"),a=this;o.ontouchstart=function(r){console.log("ontouchstart");var s=(r=r||window.event).touches[0].pageX;o.style.transition="",n.style.transition="",document.ontouchmove=function(r){var c=(r=r||window.event).touches[0].pageX-t.offsetLeft-s,l=t.clientWidth-o.clientWidth-8*e;c<=0&&(c=0),c>=l&&(c=l),o.style.left=c+"px",c!=l||a.lockStatus||(a.lockStatus=!0,document.getElementById("slide-ball-start").style.display="none",document.getElementById("slide-ball-end").style.display="inline",n.style.width=t.clientWidth+"px",n.style.backgroundColor="#598FFF",t.style.border="0",o.style.backgroundColor="#ffffff",i.textContent="正在开锁",i.style.color="#ffffff",o.ontouchstart=null,a.sendRemoteUnlockApi())},document.ontouchend=function(){a.lockStatus||(n.style.width="0px",o.style.left=8*e+"px",o.style.transition="left 0.6s linear",n.style.transition="width 0.6s linear"),document.ontouchend=null,document.ontouchmove=null}}}},{key:"resetRemoteUnlockSlide",value:function(){var e=this.videoWidth/1024||1;this.lockStatus=!1;var t=document.getElementById("mobile-remoteUnlock-slide-box"),n=document.getElementById("mobile-remoteUnlock-slide-bgColor"),i=document.getElementById("mobile-remoteUnlock-slide-tips"),o=document.getElementById("mobile-remoteUnlock-slide-ball");n.style.width="0px",o.style.left=8*e+"px",i.textContent="右滑开锁",i.style.color="#666666",document.getElementById("slide-ball-start").style.display="inline",document.getElementById("slide-ball-end").style.display="none",n.style.backgroundColor="#FFFFFF",t.style.border="1px solid rgba(255,255,255,1)",o.style.backgroundColor="#598FFF"}},{key:"sendRemoteUnlockApi",value:function(){var e=this;console.log("下发远程开锁");Xe(this.jSPlugin,(function(t){t&&200==t.code?e.toastCustom.initToastContent("开锁成功"):e.toastCustom.initToastContent("开锁失败,请重试"),e.popupCustom.closePopupCustom()}),(function(t){console.log(t),e.toastCustom.initToastContent("开锁失败,请重试"),e.popupCustom.closePopupCustom()}))}},{key:"closeRemoteUnlock",value:function(){this.popupCustom.closePopupCustom()}}])}(),ct={customConfig:{defaultMicro:0,defaultPlay:0,maxTalkTime:0,bellPoster:0,maxBellTime:0},header:{onBell:{color:"#2c2c2c",backgroundColor:"#00000000 linear-gradient(180deg, rgba(0,0,0,0.65) 0%, rgba(0,0,0,0.00) 100%)",activeColor:"#1890FF",autoFocus:0,btnList:[{btnKey:"c1cbc1d4e86d49a0981f54beea95280a-4412dc7a9f7b471a9a3e9a8fb625c793-header-0",iconId:"ringStatus",part:"left",defaultActive:0,isrender:1,color:"#2c2c2c",themeId:"4412dc7a9f7b471a9a3e9a8fb625c793"},{btnKey:"c1cbc1d4e86d49a0981f54beea95280a-4412dc7a9f7b471a9a3e9a8fb625c793-header-1",iconId:"deviceCategory",part:"left",defaultActive:0,isrender:1,color:"#2c2c2c",themeId:"4412dc7a9f7b471a9a3e9a8fb625c793"}]},onCall:{color:"#2c2c2c",backgroundColor:"#00000000",activeColor:"#1890FF",autoFocus:5,btnList:[{btnKey:"c1cbc1d4e86d49a0981f54beea95280a-4412dc7a9f7b471a9a3e9a8fb625c793-header-0",iconId:"callStatus",part:"left",defaultActive:0,isrender:1,color:"#2c2c2c",themeId:"4412dc7a9f7b471a9a3e9a8fb625c793"},{btnKey:"c1cbc1d4e86d49a0981f54beea95280a-4412dc7a9f7b471a9a3e9a8fb625c793-header-1",iconId:"deviceCategory",part:"left",defaultActive:0,isrender:1,color:"#2c2c2c",themeId:"4412dc7a9f7b471a9a3e9a8fb625c793"}]}},footer:{onBell:{color:"#2c2c2c",backgroundColor:"#00000000",activeColor:"#1890FF",autoFocus:5,btnList:[{btnKey:"c1cbc1d4e86d49a0981f54beea95280a-4412dc7a9f7b471a9a3e9a8fb625c793-footer-0",iconId:"quickReply",part:"left",defaultActive:1,isrender:1,themeId:"4412dc7a9f7b471a9a3e9a8fb625c793",backgroundColor:"#cccccc"},{btnKey:"c1cbc1d4e86d49a0981f54beea95280a-4412dc7a9f7b471a9a3e9a8fb625c793-footer-1",iconId:"rejection",part:"left",defaultActive:0,isrender:1,color:"#2C2C2C",themeId:"4412dc7a9f7b471a9a3e9a8fb625c793",backgroundColor:"#cccccc"},{btnKey:"c1cbc1d4e86d49a0981f54beea95280a-4412dc7a9f7b471a9a3e9a8fb625c793-footer-2",iconId:"answer",part:"left",defaultActive:0,isrender:1,themeId:"4412dc7a9f7b471a9a3e9a8fb625c793",backgroundColor:"#cccccc"},{btnKey:"c1cbc1d4e86d49a0981f54beea95280a-4412dc7a9f7b471a9a3e9a8fb625c793-footer-3",iconId:"remoteUnlock",part:"left",defaultActive:0,isrender:1,themeId:"4412dc7a9f7b471a9a3e9a8fb625c793",backgroundColor:"#cccccc"}]},onCall:{color:"#2c2c2c",backgroundColor:"#00000080",activeColor:"#1890FF",autoFocus:5,btnList:[{btnKey:"c1cbc1d4e86d49a0981f54beea95280a-4412dc7a9f7b471a9a3e9a8fb625c793-footer-0",iconId:"mute",part:"left",defaultActive:1,isrender:1,themeId:"4412dc7a9f7b471a9a3e9a8fb625c793",backgroundColor:"#cccccc"},{btnKey:"c1cbc1d4e86d49a0981f54beea95280a-4412dc7a9f7b471a9a3e9a8fb625c793-footer-1",iconId:"hangUp",part:"left",defaultActive:0,isrender:1,themeId:"4412dc7a9f7b471a9a3e9a8fb625c793",backgroundColor:"#cccccc"},{btnKey:"c1cbc1d4e86d49a0981f54beea95280a-4412dc7a9f7b471a9a3e9a8fb625c793-footer-2",iconId:"remoteUnlock",part:"left",defaultActive:0,isrender:1,themeId:"4412dc7a9f7b471a9a3e9a8fb625c793",backgroundColor:"#cccccc"}]}}},lt=function(e){var t="";return Object.keys(e).map((function(n,i){t+="".concat(n,":").concat(e[n]).concat(i<Object.keys(e).length-1?";":"")})),t},dt=function(){return m((function e(t,n,i,o){var a=this;l(this,e),p(this,"switchCallStatus",(function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=a.themeData,i=n.header,o=n.footer,r=null;if("onCall"==e){console.log("接听"),a.bellStatus="onCall",a.switchFooter("onCall"),o[a.bellStatus].btnList.map((function(e,t){e.isrender&&a.renderFooter(e.iconId,e),"mute"==e.iconId&&(r=e)})),i[a.bellStatus].btnList.map((function(e,t){e.isrender&&a.renderHeader(e.iconId,e)}));var s=document.getElementById("".concat(a.jSPlugin.id,"-header-onBell"));s&&s.parentElement.removeChild(s),1==a.themeData.customConfig.bellPoster&&document.getElementById("bellring-icon")&&document.getElementById("".concat(a.jSPlugin.id,"-wrap")).removeChild(document.getElementById("bellring-icon")),0==a.themeData.customConfig.defaultMicro&&r?a.muteCommon(r):a.setDecoderState({mute:!1},r.backgroundColor),a.removeBellRing(),a.miniRecCloseClick()}else console.log("响铃"),a.bellStatus="onBell",a.jSPlugin.Theme.changeTheme(a.themeData,t)})),p(this,"muteCommon",(function(e){var t=a.decoderState.state,n=t.talk,i=t.sound;n?(console.log("结束对讲"),a.setDecoderState({talk:!1,mute:!0},e.backgroundColor),a.jSPlugin.Talk.stopTalk(),i||a.jSPlugin.openSound()):(a.setDecoderState({talk:!1,mute:!0},e.backgroundColor),i||a.jSPlugin.openSound())})),p(this,"autoPlayRing",(function(){console.log("autoPlayRing");var e=document.getElementById("bellring-audio");e&&(e.muted=!1,e.src="https://resource.eziot.com/group2/M00/00/8F/CtwQFmPbWnOAGuT5AAHZihhCJEM230.mp3",e.paused&&e.play()),a.checkIsAppleDevice()||!1?window.removeEventListener("touchstart",a.autoPlayRing):window.removeEventListener("click",a.autoPlayRing)})),this.jSPlugin=t,this.videoWidth=t.width,this.videoHeight=t.height,this.themeData=n,this.setDecoderState=i,this.decoderState=o,this.isNeedRenderHeader=!1,this.isNeedRenderFooter=!1,this.autoFocus=0,this.autoFocusTimer=null,this.bellStatus="onBell",this.recordTimer=null,this.nextRate=1,this.themeInited=!1,this.inited=!1,this.miniRecStatus="rec",this.activeThemeStatus=!0,this.activeThemeStatusTxt="模板未激活",this.miniRecNum=0,this.toastCustom=new Je(t,!0)}),[{key:"initBellRing",value:function(){var e=this,t=this.decoderState.state,n=t.play,i=t.isEditing,o=this.videoWidth,a=o/375;this.maxBellTime=1e3*this.themeData.customConfig.maxBellTime;var r=document.getElementById("bellring"),s=document.getElementById("bellring-audio");if(!r&&!s){if(this.jSPlugin.isNeedBellRing){var c=document.createElement("div");c.id="bellring",c.innerHTML='<div>\n <audio id="bellring-audio" loop autoplay>\n <source src="https://resource.eziot.com/group2/M00/00/8F/CtwQFmPbWnOAGuT5AAHZihhCJEM230.mp3" type="audio/mpeg">\n </audio>\n </div>',document.getElementById("".concat(this.jSPlugin.id,"-wrap")).appendChild(c)}if(1!=this.themeData.customConfig.bellPoster||i)document.getElementById("bellring-icon")&&document.getElementById("".concat(this.jSPlugin.id,"-wrap")).removeChild(document.getElementById("bellring-icon"));else{var l=1.8*o,d=6;document.getElementById("".concat(this.jSPlugin.id,"-headControl"))&&(d=document.getElementById("".concat(this.jSPlugin.id,"-headControl")).offsetHeight+.1*l+6);var u=d+(this.videoHeight-130*a)/2,m=document.createElement("div");m.id="bellring-icon",m.style="position: absolute;pointer-events: none;background: none;width: 100%;\n position: absolute;top: ".concat(u,"px;display: flex;align-items: center;justify-content: center;"),m.innerHTML='<div style="width: '.concat(130*a,"px;height: ").concat(130*a,'px;display: flex;align-items: center;justify-content: center;border: 1px solid rgba(255,255,255,0.2);border-radius: 50%;">\n <div style="width: ').concat(80*a,"px;height: ").concat(80*a,'px;display: flex;align-items: center;justify-content: center;border: 1px solid rgba(255,255,255,0.3);border-radius: 50%;">\n <svg width="').concat(40*a,'px" height="').concat(40*a,'px" viewBox="0 0 40 40" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n <title>icon/响铃</title>\n <g id="icon/响铃" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n <polygon id="Path" points="0 0 40.0000002 0 40.0000002 40.0000002 0 40.0000002"></polygon>\n <path d="M20.0000001,4.25000002 C22.0363461,4.25000002 23.698175,5.84879552 23.8000507,7.8591997 L23.8050001,8.05500003 L23.805316,8.99953253 C27.1874196,9.97041766 29.6921839,13.0354462 29.80936,16.723731 L29.80936,16.723731 L29.8133335,16.9800001 L29.8133335,21.6416668 C29.8133335,22.3259481 30.0858837,22.9835569 30.5703302,23.4680033 L30.5703302,23.4680033 L31.6386635,24.5363367 C32.338953,25.2366262 32.760721,26.1675592 32.8273086,27.1785295 L32.8273086,27.1785295 L32.8350001,27.4233334 C32.8350001,29.577547 31.0892137,31.3233335 28.9350001,31.3233335 L28.9350001,31.3233335 L24.5666667,31.323 L24.5650266,31.3951531 C24.4527075,33.8194458 22.4520933,35.7500001 20.0000001,35.7500001 C17.5482065,35.7500001 15.5473098,33.8197367 15.4349743,31.3967059 L15.4326667,31.323 L11.0666667,31.3233335 C9.06159524,31.3233335 7.39851917,29.8069287 7.18810198,27.8229374 L7.17194359,27.6230185 L7.1666667,27.4233334 C7.1666667,26.3411154 7.59733134,25.3020086 8.36300328,24.5363367 L8.36300328,24.5363367 L9.43133662,23.4680033 C9.91578309,22.9835569 10.1883334,22.3259481 10.1883334,21.6416668 L10.1883334,21.6416668 L10.1883334,16.9800001 C10.1883334,13.1909619 12.7263704,9.99530436 16.1948593,8.99965364 L16.1950001,8.05500003 C16.1950001,5.95360729 17.8979654,4.25000002 20.0000001,4.25000002 Z M23.0656667,31.323 L16.9336667,31.323 L16.9352114,31.3619281 C17.0285826,32.9723844 18.3649772,34.2500001 20.0000001,34.2500001 C21.6352227,34.2500001 22.9714318,32.9721919 23.0647896,31.3604131 L23.0656667,31.323 Z M21.5116668,10.1783334 L18.4900001,10.1783334 C14.7336124,10.1783334 11.6883334,13.2231481 11.6883334,16.9800001 L11.6883334,16.9800001 L11.6883334,21.6416668 C11.6883334,22.7238848 11.2576687,23.7629916 10.4919968,24.5286635 L10.4919968,24.5286635 L9.42366346,25.5969969 C8.93921698,26.0814433 8.6666667,26.7390521 8.66637526,27.402427 L8.66637526,27.402427 L8.67048222,27.560237 C8.74130967,28.8268108 9.79171396,29.8233335 11.0666667,29.8233335 L11.0666667,29.8233335 L23.7906939,29.8222289 C23.8004164,29.8218553 23.8101862,29.8216668 23.8200001,29.8216668 L23.8486667,29.823 L28.9350001,29.8233335 C30.2055455,29.8233335 31.2450456,28.8367727 31.329826,27.609522 L31.3354106,27.4481422 L31.3293607,27.2529336 C31.2880301,26.6292837 31.0210852,26.0400787 30.5780034,25.5969969 L30.5780034,25.5969969 L29.50967,24.5286635 C28.7439981,23.7629916 28.3133335,22.7238848 28.3133335,21.6416668 L28.3133335,21.6416668 L28.3134279,16.9919039 L28.3098332,16.759466 C28.1934023,13.0970787 25.1864454,10.1783334 21.5116668,10.1783334 L21.5116668,10.1783334 Z M20.0000001,5.75000002 C18.7795808,5.75000002 17.7813801,6.69770708 17.7003155,7.89717688 L17.6950001,8.05500003 L17.6952875,8.7158769 C17.9568453,8.69103758 18.2219393,8.67833337 18.4900001,8.67833337 L18.4900001,8.67833337 L21.5116668,8.67833337 C21.7792577,8.67833337 22.0439466,8.69101238 22.3051575,8.71580951 L22.3050001,8.05500003 C22.3050001,6.7819079 21.273481,5.75000002 20.0000001,5.75000002 Z" id="形状结合" fill="#FFFFFF" fill-rule="nonzero"></path>\n </g>\n </svg>\n </div>\n </div>'),document.getElementById("".concat(this.jSPlugin.id,"-wrap")).appendChild(m),n&&"onBell"==this.bellStatus&&this.jSPlugin.pause()}setTimeout((function(){var t=e.decoderState.state,n=t.isEditing,i=t.rejection;"onBell"!=e.bellStatus||i||(e.removeBellRing(),n||e.answerOvertime())}),this.maxBellTime)}}},{key:"removeBellRing",value:function(){document.getElementById("bellring")&&document.getElementById("".concat(this.jSPlugin.id,"-wrap")).removeChild(document.getElementById("bellring")),document.getElementById("bellring-icon")&&document.getElementById("".concat(this.jSPlugin.id,"-wrap")).removeChild(document.getElementById("bellring-icon"))}},{key:"getMiniCallTimeUrl",value:function(){if(console.log("--------------getMiniCallTimeUrl"),-1!==this.jSPlugin.url.indexOf("hd.live")?this.recUrl=this.jSPlugin.url.replace("hd.live","rec"):this.recUrl=this.jSPlugin.url.replace("live","rec"),this.jSPlugin.callTime){var e=parseInt(this.jSPlugin.callTime),t=e+5e3,n=new Date(e-1e4).Format("yyyyMMddhhmmss"),i=new Date(t).Format("yyyyMMddhhmmss");this.recUrl="".concat(this.recUrl,"?begin=").concat(n,"&end=").concat(i),console.log("recurl="+this.recUrl)}}},{key:"initMiniRec",value:function(){var e=this,t=this,n=this.videoWidth,i=n/375,o=1.8*n,a=6;document.getElementById("".concat(this.jSPlugin.id,"-headControl"))&&(a=document.getElementById("".concat(this.jSPlugin.id,"-headControl")).offsetHeight+.1*o+6);var r=a+this.videoHeight+10*i;if(console.log(a),document.getElementById("miniRecbox"))document.getElementById("miniRecbox")&&document.getElementById("".concat(this.jSPlugin.id,"-wrap")).removeChild(document.getElementById("miniRecbox")),document.getElementById("miniClose")&&document.getElementById("".concat(this.jSPlugin.id,"-wrap")).removeChild(document.getElementById("miniClose")),this.initMiniRec();else{var s=document.createElement("div");s.id="miniRecbox",s.style="-webkit-border-radius: 8px;border-radius: 8px;overflow: hidden;position: absolute;top: ".concat(r,"px;right: ").concat(9*i,"px;"),s.innerHTML='<div id="miniRec"></div>',document.getElementById("".concat(this.jSPlugin.id,"-wrap")).appendChild(s),this.getMiniCallTimeUrl();var c={domain:W};this.miniRecPlayer=new zt({id:"miniRec",width:160*i,height:90*i,template:"miniRec",url:this.recUrl,token:this.jSPlugin.token,handleError:function(n){console.log("小窗口handleError------------",n),n&&6701==n.retcode?(e.miniRecNum=e.miniRecNum+1,console.log("小窗口miniRecNum-----------------",e.miniRecNum),e.miniRecNum<5?t.miniRecPlayer.changePlayUrl({type:"miniRec"}):(console.log("小窗口------------------已播放5次,关闭小窗口"),t.miniRecCloseClick())):(console.log("小窗口------------------播放失败,关闭小窗口"),t.miniRecCloseClick())},env:this.jSPlugin.env||c});var l=document.createElement("div");l.id="miniClose",l.style="position: absolute;top: ".concat(r+8,"px;right: ").concat(16*i,"px;"),l.innerHTML='<div id="miniClose-btn" style="width: '.concat(24*i,"px;height: ").concat(24*i,'px;display: flex;align-items: center;justify-content: center;border-radius: 50%;background: rgba(0,0,0,0.1);">\n <svg width="').concat(24*i,'px" height="').concat(24*i,'px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n <title>close</title>\n <g id="icon/close" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n <g id="common/Close/Dark">\n <rect id="Rectangle" x="0" y="0" width="24" height="24"></rect>\n <path d="M18.1871843,5.81281566 C18.4556698,6.08130112 18.4780436,6.50270075 18.2543057,6.7966719 L18.1871843,6.87347584 L13.0611458,12.0001458 L18.1871843,17.1265242 C18.4800776,17.4194174 18.4800776,17.8942911 18.1871843,18.1871843 C17.9186989,18.4556698 17.4972993,18.4780436 17.2033281,18.2543057 L17.1265242,18.1871843 L12.0001458,13.0611458 L6.87347584,18.1871843 C6.58058262,18.4800776 6.10570888,18.4800776 5.81281566,18.1871843 C5.54433021,17.9186989 5.52195643,17.4972993 5.7456943,17.2033281 L5.81281566,17.1265242 L10.9391458,12.0001458 L5.81281566,6.87347584 C5.51992245,6.58058262 5.51992245,6.10570888 5.81281566,5.81281566 C6.08130112,5.54433021 6.50270075,5.52195643 6.7966719,5.7456943 L6.87347584,5.81281566 L12.0001458,10.9391458 L17.1265242,5.81281566 C17.4194174,5.51992245 17.8942911,5.51992245 18.1871843,5.81281566 Z" id="形状结合" fill="#fff" fill-rule="nonzero"></path>\n </g>\n </g>\n </svg>\n </div>'),document.getElementById("".concat(this.jSPlugin.id,"-wrap")).appendChild(l),document.getElementById("miniClose-btn").onclick=function(){t.miniRecCloseClick()}}}},{key:"initMiniImageRec",value:function(){console.log("initMiniImageRec");var e=this.videoWidth/375,t=6;document.getElementById("".concat(this.jSPlugin.id,"-headControl"))&&(t=document.getElementById("".concat(this.jSPlugin.id,"-headControl")).offsetHeight+26);var n=t+this.videoHeight+10*e;if(document.getElementById("miniRecbox"))document.getElementById("miniRecbox").style.top=n+"px",document.getElementById("miniClose").style.top=n+8+"px";else{var i=document.createElement("div");i.id="miniRecbox",i.style="-webkit-border-radius: 8px;border-radius: 8px;overflow: hidden;position: absolute;\n top: ".concat(n,"px;\n right: ").concat(9*e,"px;\n user-select: none;\n "),i.innerHTML='<div id="miniRec" style="width: '.concat(160*e,"px;height: ").concat(90*e,'px;display: flex;align-items: center;justify-content: center;">\n <embed id="miniRec-embed" style="z-index: 3;position: absolute;width: ').concat(160*e,"px;height: ").concat(90*e,'px;" type="image/svg+xml" src="https://resource.eziot.com/group1/M00/00/B8/CtwQEmPbGh2AVJB-ABDcYtyw5gk899.svg" />\n <div style="color: #FFFFFF;font-size: 12px;z-index: 4;">示意小窗位置</div>\n </div>'),document.getElementById("".concat(this.jSPlugin.id,"-wrap")).appendChild(i);var o=document.createElement("div");o.id="miniClose",o.style="z-index: 4;position: absolute;top: ".concat(n+8,"px;right: ").concat(16*e,"px;"),o.innerHTML='<div id="miniClose-btn" style="width: '.concat(24*e,"px;height: ").concat(24*e,'px;display: flex;align-items: center;justify-content: center;border-radius: 50%;">\n <svg width="').concat(24*e,'px" height="').concat(24*e,'px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n <title>close</title>\n <g id="icon/close" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n <g id="common/Close/Dark">\n <rect id="Rectangle" x="0" y="0" width="24" height="24"></rect>\n <path d="M18.1871843,5.81281566 C18.4556698,6.08130112 18.4780436,6.50270075 18.2543057,6.7966719 L18.1871843,6.87347584 L13.0611458,12.0001458 L18.1871843,17.1265242 C18.4800776,17.4194174 18.4800776,17.8942911 18.1871843,18.1871843 C17.9186989,18.4556698 17.4972993,18.4780436 17.2033281,18.2543057 L17.1265242,18.1871843 L12.0001458,13.0611458 L6.87347584,18.1871843 C6.58058262,18.4800776 6.10570888,18.4800776 5.81281566,18.1871843 C5.54433021,17.9186989 5.52195643,17.4972993 5.7456943,17.2033281 L5.81281566,17.1265242 L10.9391458,12.0001458 L5.81281566,6.87347584 C5.51992245,6.58058262 5.51992245,6.10570888 5.81281566,5.81281566 C6.08130112,5.54433021 6.50270075,5.52195643 6.7966719,5.7456943 L6.87347584,5.81281566 L12.0001458,10.9391458 L17.1265242,5.81281566 C17.4194174,5.51992245 17.8942911,5.51992245 18.1871843,5.81281566 Z" id="形状结合" fill="#fff" fill-rule="nonzero"></path>\n </g>\n </g>\n </svg>\n </div>'),document.getElementById("".concat(this.jSPlugin.id,"-wrap")).appendChild(o),document.getElementById("miniClose-btn").onclick=function(){}}}},{key:"miniRecCloseClick",value:function(){document.getElementById("miniRecbox")&&(console.log("---------------------miniRecCloseClick"),"rec"==this.miniRecStatus&&(this.miniRecPlayer&&this.miniRecPlayer.stop(),document.getElementById("".concat(this.jSPlugin.id,"-wrap")).removeChild(document.getElementById("miniClose")),document.getElementById("".concat(this.jSPlugin.id,"-wrap")).removeChild(document.getElementById("miniRecbox"))))}},{key:"miniRecSwitchClick",value:function(){console.log("---------------小窗口切换");var e=this.decoderState.state.isEditing,t=this.videoWidth,n=t/375,i=1.8*t,o=6;document.getElementById("".concat(this.jSPlugin.id,"-headControl"))&&(o=document.getElementById("".concat(this.jSPlugin.id,"-headControl")).offsetHeight+.1*i+6),console.log("headerHeight-------",o);var a=o+this.videoHeight+10*n;if(console.log("videoTop-------",a),"rec"==this.miniRecStatus){this.miniRecStatus="live",e?(document.getElementById("miniRec-embed").style.width=this.jSPlugin.width+"px",document.getElementById("miniRec-embed").style.height=this.jSPlugin.height+"px",document.getElementById("miniRec").style.width=this.jSPlugin.width+"px",document.getElementById("miniRec").style.height=this.jSPlugin.height+"px"):this.miniRecPlayer.reSize(this.jSPlugin.width,this.jSPlugin.height),this.jSPlugin.reSize(160*n,90*n);var r=this.videoHeight+10*n,s=.2*i-90*n-10*n;document.getElementById("".concat(this.jSPlugin.id,"-wrap")).style.width=this.videoWidth+"px",document.getElementById("".concat(this.jSPlugin.id)).style.marginTop=r+"px",document.getElementById("".concat(this.jSPlugin.id)).style.marginLeft=t-160*n-9+"px",document.getElementById("".concat(this.jSPlugin.id)).style.overflow="hidden",document.getElementById("".concat(this.jSPlugin.id)).style.borderRadius="8px",document.getElementById("miniRecbox").style.top=o+"px",document.getElementById("miniRecbox").style.left="0",document.getElementById("miniRecbox").style.right="0",document.getElementById("miniRecbox").style.borderRadius="0px",document.getElementById("".concat(this.jSPlugin.id,"-ez-iframe-footer-container")).style.marginTop=s+"px"}else console.log(this.jSPlugin.width),this.miniRecStatus="rec",e?(document.getElementById("miniRec-embed").style.width=160*n+"px",document.getElementById("miniRec-embed").style.height=90*n+"px",document.getElementById("miniRec").style.width=160*n+"px",document.getElementById("miniRec").style.height=90*n+"px"):this.miniRecPlayer.reSize(160*n,90*n),this.jSPlugin.reSize(this.videoWidth,this.videoHeight),document.getElementById("".concat(this.jSPlugin.id,"-wrap")).style.width=this.videoWidth+NaN,document.getElementById("".concat(this.jSPlugin.id)).style.marginTop="0",document.getElementById("".concat(this.jSPlugin.id)).style.marginLeft="0",document.getElementById("".concat(this.jSPlugin.id)).style.overflow="hidden",document.getElementById("".concat(this.jSPlugin.id)).style.borderRadius="0px",document.getElementById("miniRecbox").style.top=a+"px",document.getElementById("miniRecbox").style.right="9px",document.getElementById("miniRecbox").style.left="auto",document.getElementById("miniRecbox").style.borderRadius="8px",document.getElementById("".concat(this.jSPlugin.id,"-ez-iframe-footer-container")).style.marginTop=.2*i+"px"}},{key:"matchBtn",value:function(e,t){var n=this,i=this.themeData,o=i.header,a=i.footer,r=this.decoderState.state,s=r.mute,c=r.rejection;document.documentElement.clientHeight;var l=this.videoWidth/375,d=this.videoWidth/375||1,u={title:"",id:"",domString:"",color:"#FFFFFF",activeColor:"#FFFFFF",onclick:function(){},onmoveleft:function(){},onmoveright:function(){},onremove:function(){}};-1===o[this.bellStatus].btnList.findIndex((function(t){return t.iconId===e}))?(u.color=a[this.bellStatus].color,u.backgroundColor=a[this.bellStatus].backgroundColor,u.activeColor=a[this.bellStatus].activeColor):(u.color=o[this.bellStatus].color,u.backgroundColor=o[this.bellStatus].backgroundColor,u.activeColor=o[this.bellStatus].activeColor);var m=this.videoWidth/4;switch(e){case"ringStatus":return u.title=this.activeThemeStatus?"有人按门铃":this.activeThemeStatusTxt,u.id=e,u.domString='<span id="header-onBell-ringStatus" style="color:'.concat(t.color||"#2C2C2C",";font-size: ").concat(24*d,'px;display: block;font-weight: 600;" >').concat(this.activeThemeStatus?"有人按门铃":this.activeThemeStatusTxt,"</span>"),u.onclick=function(){},u;case"deviceCategory":return u.title="设备名称",u.id=e,u.domString='<span id="header-onBell-deviceCategory" \n style="color:'.concat(t.color||"#2C2C2C",";\n font-size: ").concat(14*d,"px;\n padding-top: ").concat(5*d,'px;\n display: block;\n max-width: 100%;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n ">').concat(this.deviceInfoData&&this.deviceInfoData.deviceName||"设备名称","</span>"),u.onclick=function(){},u;case"callStatus":return u.title="通话中",u.id=e,u.domString='<span id="header-onCall-ringStatus" style="color:'.concat(t.color||"#2C2C2C",";font-size: ").concat(24*d,'px;display: block;font-weight: 600;" >通话中</span>'),u.onclick=function(){},u;case"deviceCategory":return u.title="设备名称",u.id=e,u.domString='<span id="header-onCall-deviceCategory" \n style="color:'.concat(t.color||"#2C2C2C",";\n font-size: ").concat(14*d,"px;\n padding-top: ").concat(5*d,'px;\n display: block;\n max-width: 100%;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n ">').concat(this.deviceInfoData&&this.deviceInfoData.deviceName||"设备名称","</span>"),u.onclick=function(){},u;case"rejection":return u.title="拒绝",u.id=e,u.domString='<div style="width: '.concat(.66*m,'px;display: flex;flex-direction: column;align-items: center;">\n <div style="width:').concat(.66*m,"px;height: ").concat(.66*m,"px;border-radius: 50%;background: ").concat(c?"#CCCCCC":t.backgroundColor,';display: flex;align-items: center;justify-content: center;" >\n <svg width="').concat(.4*m,'px" height="').concat(.4*m,'px" viewBox="0 0 36 36" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n <title>拒绝</title>\n <g id="icon/拒绝" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n <rect id="Rectangle" x="0" y="0" width="36" height="36"></rect>\n <path d="M16.0428281,19.9522968 C13.5228132,17.435123 11.1135994,14.5173605 12.2699084,13.3638925 C13.9205608,11.7132401 15.3581341,10.6961428 12.4346895,7.05675259 C9.50840386,3.41452132 7.55659974,6.21011849 5.95708632,7.80963191 C4.11324225,9.65631703 5.86049048,16.5345088 12.6591328,23.3359922 C19.4577751,30.1346345 26.3388079,31.8847238 28.1854931,30.0380386 C29.7850065,28.4385252 32.5806036,26.4895622 28.9412134,23.5632765 C25.3018232,20.6369909 24.2847259,22.0745642 22.6340735,23.7280576 C21.4777645,24.8786845 18.5628431,22.4694707 16.0428281,19.9522968 Z" id="路径" fill="#FFFFFF" fill-rule="nonzero" transform="translate(17.997936, 17.998157) rotate(135.000000) translate(-17.997936, -17.998157) "></path>\n </g>\n </svg>\n </div>\n <div style="margin-top: ').concat(.1*m,'px;user-select: none;">拒绝</div>\n </div>'),u.onclick=function(){var e=n,t=n.decoderState.state,i=t.play,o=t.isEditing,a=t.rejection;if(o||a)return!1;console.log("拒绝"),i&&n.jSPlugin.stop(),n.removeBellRing(),n.setDecoderState({play:!1,rejection:!0}),e.miniRecCloseClick(),n.rejectionStatusDispose(),"function"==typeof n.jSPlugin.hangUpCallback&&n.jSPlugin.hangUpCallback("rejection")},u;case"quickReply":return u.title="快捷回复",u.id=e,u.domString='<div id="'.concat(this.jSPlugin.id,'-btn-quickReply" style="width: ').concat(126*l,"px;height: ").concat(40*l,"px;color:").concat(c?"rgba(44,44,44,0.5)":u.color,';background: #F8F8F8;border-radius: 20px;display: flex;flex-direction: row;align-items: center;justify-content: center;-webkit-tap-highlight-color:transparent;">\n <div>\n <svg width="').concat(24*l,'px" height="').concat(24*l,'px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n <title>快捷回复</title>\n <g id="icon/H5快捷回复" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n <rect id="Rectangle" x="0" y="0" width="24" height="24"></rect>\n <path d="M10.7238197,2.25008794 C16.2230834,2.09766093 20.7496,6.50749909 20.7496,11.9958 C20.7496,13.4362841 20.4368194,14.8344518 19.8413577,16.1117061 L19.9440524,15.8792521 L21.0527769,21.184554 C21.1496277,21.6485507 20.8013031,22.0657304 20.3577211,22.0873894 L20.2613374,22.0858497 L20.1628027,22.0714397 L14.866,20.946 L14.7518767,20.9973203 C13.6930577,21.439776 12.5585243,21.69208 11.3902258,21.7381162 L11.3902258,21.7381162 L10.9996,21.7458 C5.51196728,21.7458 1.10147008,17.2189531 1.25388722,11.7200456 C1.39490345,6.62610538 5.62990538,2.39110345 10.7238197,2.25008794 Z M11.0183931,3.74628651 L10.7653544,3.74951278 C6.46729462,3.86849655 2.87229655,7.46349462 2.75331206,11.7615803 C2.62431432,16.4155628 6.35610614,20.2458 10.9996,20.2458 C12.2165433,20.2458 13.3936843,19.9831552 14.4692454,19.4827855 C14.6166569,19.4142071 14.7823612,19.395387 14.9413973,19.4291603 L14.9413973,19.4291603 L19.349,20.365 L18.4274231,15.948046 C18.4026128,15.8291836 18.4071487,15.7066932 18.4398273,15.5909727 L18.4398273,15.5909727 L18.4818423,15.4778939 C18.9851908,14.3982208 19.2496,13.216279 19.2496,11.9958 C19.2496,7.35166383 15.4197191,3.62050444 10.7653544,3.74951278 Z M10.9996,10.7498 C11.6896,10.7498 12.2496,11.3098 12.2496,11.9998 C12.2496,12.6898 11.6896,13.2498 10.9996,13.2498 C10.3096,13.2498 9.7496,12.6898 9.7496,11.9998 C9.7496,11.3098 10.3096,10.7498 10.9996,10.7498 Z M6.9996,10.7498 C7.6896,10.7498 8.2496,11.3098 8.2496,11.9998 C8.2496,12.6898 7.6896,13.2498 6.9996,13.2498 C6.3096,13.2498 5.7496,12.6898 5.7496,11.9998 C5.7496,11.3098 6.3096,10.7498 6.9996,10.7498 Z M14.9996,10.7498 C15.6896,10.7498 16.2496,11.3098 16.2496,11.9998 C16.2496,12.6898 15.6896,13.2498 14.9996,13.2498 C14.3096,13.2498 13.7496,12.6898 13.7496,11.9998 C13.7496,11.3098 14.3096,10.7498 14.9996,10.7498 Z" id="形状结合" fill="').concat(c?"rgba(44,44,44,0.5)":"#2c2c2c",'" fill-rule="nonzero"></path>\n </g>\n </svg>\n </div>\n <div style="margin-left: 5px;user-select: none;font-size:14px">快捷回复<div>\n </div>'),u.onclick=function(){var e=n.decoderState.state,t=e.isEditing,i=e.rejection;if(t||i)return!1;console.log("快捷回复"),n.switchFooter("quickReply"),n.quickReplyEle=new rt(n.jSPlugin,n.switchFooter,n.videoWidth)},u;case"answer":return u.title="接听",u.id=e,u.domString='<div style="width: '.concat(.66*m,'px;display: flex;flex-direction: column;align-items: center;">\n <div style="width: ').concat(.66*m,"px;height: ").concat(.66*m,"px;border-radius: 50%;background: ").concat(c?"#CCCCCC":t.backgroundColor,';display: flex;align-items: center;justify-content: center;" >\n <svg width="').concat(.4*m,'px" height="').concat(.4*m,'px" viewBox="0 0 36 36" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n <title>接听</title>\n <g id="icon/接听" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n <rect id="Rectangle" x="0" y="0" width="36" height="36"></rect>\n <path d="M15.7728281,19.6822968 C13.2528132,17.165123 10.8435994,14.2473605 11.9999084,13.0938925 C13.6505608,11.4432401 15.0881341,10.4261428 12.1646895,6.78675259 C9.23840386,3.14452132 7.28659974,5.94011849 5.68708632,7.53963191 C3.84324225,9.38631703 5.59049048,16.2645088 12.3891328,23.0659922 C19.1877751,29.8646345 26.0688079,31.6147238 27.9154931,29.7680386 C29.5150065,28.1685252 32.3106036,26.2195622 28.6712134,23.2932765 C25.0318232,20.3669909 24.0147259,21.8045642 22.3640735,23.4580576 C21.2077645,24.6086845 18.2928431,22.1994707 15.7728281,19.6822968 Z" id="路径" fill="#FFFFFF" fill-rule="nonzero" transform="translate(17.727936, 17.728157) rotate(-360.000000) translate(-17.727936, -17.728157) "></path>\n </g>\n </svg>\n </div>\n <div style="margin-top: ').concat(.1*m,'px;user-select: none;">接听</div>\n </div>'),u.onclick=function(){var e=n,i=n.decoderState.state,r=i.play,s=i.isEditing,c=i.talk,l=i.sound,d=i.rejection;if(s||d)return!1;console.log("接听"),n.jSPlugin.pluginStatus.loadingClear(),n.bellStatus="onCall",n.switchFooter("onCall"),a[n.bellStatus].btnList.map((function(e,t){e.isrender&&n.renderFooter(e.iconId,e)})),o[n.bellStatus].btnList.map((function(e,t){e.isrender&&n.renderHeader(e.iconId,e)}));var u=document.getElementById("".concat(n.jSPlugin.id,"-header-onBell"));u&&u.parentElement.removeChild(u),1==n.themeData.customConfig.bellPoster&&(document.getElementById("bellring-icon")&&document.getElementById("".concat(n.jSPlugin.id,"-wrap")).removeChild(document.getElementById("bellring-icon")),n.jSPlugin.setPoster("")),n.removeBellRing(),n.miniRecCloseClick(),r||(n.jSPlugin.pluginStatus.loadingStart(n.jSPlugin.id),n.jSPlugin.pluginStatus.loadingSetText({text:"视频加载中"}),n.jSPlugin.play(),n.setDecoderState({play:!r})),c||1!=n.themeData.customConfig.defaultMicro||(n.setDecoderState({talk:!0,mute:!1}),l&&n.jSPlugin.closeSound(),n.jSPlugin.Talk.startTalk()),n.setDecoderState({sound:!1}),0==n.themeData.customConfig.defaultMicro&&(n.muteCommon(t),n.jSPlugin.openSound()),n.maxTalkTime=1e3*n.themeData.customConfig.maxTalkTime*60,setTimeout((function(){c&&(console.log("结束对讲"),e.setDecoderState({talk:!1}),e.jSPlugin.Talk.stopTalk()),r&&(e.jSPlugin.stop(),e.setDecoderState({play:!r})),n.rejectionStatusDispose(),n.remoteUnlockEle&&n.remoteUnlockEle.closeRemoteUnlock(),"function"==typeof n.jSPlugin.hangUpCallback&&n.jSPlugin.hangUpCallback("hangUp")}),n.maxTalkTime)},u;case"remoteUnlock":return u.title="远程开锁",u.id=e,u.domString='<div style="width: '.concat(.66*m,'px;display: flex;flex-direction: column;align-items: center;">\n <div style="width: ').concat(.66*m,"px;height: ").concat(.66*m,"px;border-radius: 50%;background: ").concat(c?"#CCCCCC":t.backgroundColor,';display: flex;align-items: center;justify-content: center;" >\n <svg width="').concat(.4*m,'px" height="').concat(.4*m,'px" viewBox="0 0 36 36" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n <title>开锁</title>\n <g id="icon/开锁" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n <rect id="Rectangle" x="0" y="0" width="36" height="36"></rect>\n <path d="M18,4 C21.3137085,4 24,6.6862915 24,10 L24,10 L24,19.787 L29.5,19.7875 C30.0522847,19.7875 30.5,20.2352153 30.5,20.7875 C30.5,21.3397847 30.0522847,21.7875 29.5,21.7875 L24,21.787 L24,26 C24,29.2383969 21.4344251,31.8775718 18.2249383,31.9958615 L18,32 C14.6862915,32 12,29.3137085 12,26 L12,26 L12,10 C12,6.6862915 14.6862915,4 18,4 Z M18,6 C15.790861,6 14,7.790861 14,10 L14,10 L14,26 C14,28.209139 15.790861,30 18,30 C20.209139,30 22,28.209139 22,26 L22,26 L22,21.787 L18.5,21.7875 C17.9477153,21.7875 17.5,21.3397847 17.5,20.7875 C17.5,20.2352153 17.9477153,19.7875 18.5,19.7875 L22,19.787 L22,10 C22,7.85780461 20.3160315,6.10892112 18.1996403,6.00489531 Z" id="形状结合" fill="#FFFFFF" fill-rule="nonzero"></path>\n </g>\n </svg>\n </div>\n <div style="margin-top: ').concat(.1*m,'px;user-select: none;">远程开锁</div>\n </div>'),u.onclick=function(){var e=n.decoderState.state,t=e.isEditing;e.play;var i=e.rejection;if(t||"onBell"==n.bellStatus||i)return!1;console.log("远程开锁"),n.switchFooter("remoteUnlock"),n.remoteUnlockEle=new st(n.jSPlugin,n.switchFooter,n.videoWidth)},u;case"mute":return u.title="静音",u.id=e,u.domString='<div style="width: '.concat(.66*m,'px;display: flex;flex-direction: column;align-items: center;">\n <div id="').concat(this.jSPlugin.id,'-icon-mute" style="width: ').concat(.66*m,"px;height: ").concat(.66*m,"px;border-radius: 50%;border: 1px solid ").concat(c?"#cccccc":t.backgroundColor,";background: ").concat(c&&s?"#cccccc":"#ffffff",';display: flex;align-items: center;justify-content: center;" >\n <svg width="').concat(.4*m,'px" height="').concat(.4*m,'px" viewBox="0 0 36 36" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n <title>icon/静音</title>\n <g id="icon/静音" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n <rect id="Rectangle" x="0" y="0" width="36" height="36"></rect>\n <path id="icon-mute-path" d="M29.2988305,7.56559704 C29.8540627,8.1086468 29.8980234,8.97727504 29.4240597,9.57172938 L29.3223594,9.6867869 L22.585,16.574 L22.5859243,26.0592702 C22.5859243,26.9500521 21.8638029,27.6721735 20.973021,27.6721735 C20.6007147,27.6721735 20.2398727,27.5433734 19.9517149,27.3076254 L15.583,23.733 L10.4341733,28.9987008 C9.85492024,29.5909486 8.9052312,29.6014828 8.31298346,29.0222298 C7.75775121,28.47918 7.71379057,27.6105518 8.18775419,27.0160974 L8.28945454,26.9010399 L27.1776406,7.58912597 C27.7568937,6.99687823 28.7065827,6.98634397 29.2988305,7.56559704 Z M22.2503608,7.16816759 C22.4679282,7.45036017 22.5859243,7.79665625 22.5859243,8.15298221 L22.585,9.899 L10.778,21.971 L9.47580645,21.9713498 C7.69424274,21.9713498 6.25,20.5271071 6.25,18.7455434 L6.25,15.65293 C6.25,13.8713663 7.69424274,12.4271235 9.47580645,12.4271235 L12.787,12.427 L19.9882064,6.87564241 C20.6936617,6.33174431 21.7064627,6.46271229 22.2503608,7.16816759 Z" id="形状结合" fill="').concat(s?"#ffffff":c?"#cccccc":t.backgroundColor,'"></path>\n </g>\n </svg>\n </div>\n <div style="margin-top: ').concat(.1*m,'px;user-select: none;">静音</div>\n </div>'),u.onclick=function(){var e=n.decoderState.state,i=e.talk,o=e.sound;if(e.play,e.rejection)return!1;console.log("静音"),i?(console.log("结束对讲"),n.setDecoderState({talk:!1,mute:!0},t.backgroundColor),n.jSPlugin.Talk.stopTalk(),n.jSPlugin.openSound()):(console.log("开始对讲"),n.setDecoderState({talk:!0,mute:!1},t.backgroundColor),o&&(n.jSPlugin.closeSound(),n.setDecoderState({sound:!1})),n.jSPlugin.Talk.startTalk())},u;case"hangUp":return u.title="挂断",u.id=e,u.domString='<div style="width: '.concat(.66*m,'px;display: flex;flex-direction: column;align-items: center;">\n <div style="width:').concat(.66*m,"px;height: ").concat(.66*m,"px;border-radius: 50%;background: ").concat(c?"#CCCCCC":t.backgroundColor,';display: flex;align-items: center;justify-content: center;" >\n <svg width="').concat(.4*m,'px" height="').concat(.4*m,'px" viewBox="0 0 36 36" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n <title>挂断</title>\n <g id="icon/挂断" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n <rect id="Rectangle" x="0" y="0" width="36" height="36"></rect>\n <path d="M16.0428281,19.9522968 C13.5228132,17.435123 11.1135994,14.5173605 12.2699084,13.3638925 C13.9205608,11.7132401 15.3581341,10.6961428 12.4346895,7.05675259 C9.50840386,3.41452132 7.55659974,6.21011849 5.95708632,7.80963191 C4.11324225,9.65631703 5.86049048,16.5345088 12.6591328,23.3359922 C19.4577751,30.1346345 26.3388079,31.8847238 28.1854931,30.0380386 C29.7850065,28.4385252 32.5806036,26.4895622 28.9412134,23.5632765 C25.3018232,20.6369909 24.2847259,22.0745642 22.6340735,23.7280576 C21.4777645,24.8786845 18.5628431,22.4694707 16.0428281,19.9522968 Z" id="路径" fill="#FFFFFF" fill-rule="nonzero" transform="translate(17.997936, 17.998157) rotate(135.000000) translate(-17.997936, -17.998157) "></path>\n </g>\n </svg>\n </div>\n <div style="margin-top: ').concat(.1*m,'px;user-select: none;">挂断</div>\n </div>'),u.onclick=function(){var e=n,t=n.decoderState.state,i=t.talk,o=t.play;if(t.rejection)return!1;i&&(console.log("结束对讲"),n.setDecoderState({talk:!1}),n.jSPlugin.Talk.stopTalk()),o&&(n.jSPlugin.stop(),n.setDecoderState({play:!o})),(o||i)&&(e.miniRecCloseClick(),console.log("挂断"),n.rejectionStatusDispose(),"function"==typeof n.jSPlugin.hangUpCallback&&n.jSPlugin.hangUpCallback("hangUp"))},u;default:return u}}},{key:"answerOvertime",value:function(){this.toastCustom.initToastContent("应答超时");var e=this.decoderState.state.play;console.log("应答超时"),e&&this.jSPlugin.stop(),this.setDecoderState({play:!1,rejection:!0}),this.miniRecCloseClick(),this.rejectionStatusDispose(),this.quickReplyEle&&this.quickReplyEle.closeQuickReplyEle(),"function"==typeof this.jSPlugin.hangUpCallback&&this.jSPlugin.hangUpCallback("rejection")}},{key:"rejectionStatusDispose",value:function(){var e=this,t=this.themeData.footer,n=document.getElementById("".concat(this.jSPlugin.id,"-audioControls")),i=document.getElementById("".concat(this.jSPlugin.id,"-audioControls-onCall")),o=document.getElementById("".concat(this.jSPlugin.id,"-audioControls-quickReplyBtn")),a=document.getElementById("header-".concat(this.bellStatus,"-ringStatus"));"onBell"==this.bellStatus?(n.innerHTML="",o.innerHTML="",n.style.color="#2C2C2C"):(i.innerHTML="",i.style.color="#2C2C2C"),console.log("rejectionStatusDispose"),this.setDecoderState({rejection:!0}),t[this.bellStatus].btnList.map((function(t,n){t.isrender&&e.renderFooter(t.iconId,t)})),a.innerText="通话已结束",this.jSPlugin.pluginStatus.loadingClear(),this.jSPlugin.pluginStatus.loadingSetTextWithBtn({text:"通话已结束",color:"white",isMobile:!0,type:2})}},{key:"userNoDevice",value:function(){var e=this;this.removeBellRing(),this.setDecoderState({rejection:!0});var t=this.themeData.footer,n=document.getElementById("".concat(this.jSPlugin.id,"-audioControls")),i=document.getElementById("".concat(this.jSPlugin.id,"-audioControls-onCall")),o=document.getElementById("".concat(this.jSPlugin.id,"-audioControls-quickReplyBtn"));"onBell"==this.bellStatus?(n.innerHTML="",o.innerHTML="",n.style.color="#2C2C2C"):(i.innerHTML="",i.style.color="#2C2C2C"),console.log("userNoDevice"),this.setDecoderState({rejection:!0}),t[this.bellStatus].btnList.map((function(t,n){t.isrender&&e.renderFooter(t.iconId,t)})),this.jSPlugin.pluginStatus.loadingClear(),this.jSPlugin.pluginStatus.loadingSetTextWithBtn({text:"该用户不拥有该设备",color:"white",isMobile:!0,type:2})}},{key:"renderHeader",value:function(e,t){var n=this,i=this.matchBtn(e,t);if(document.getElementById("".concat(this.jSPlugin.id,"-header-").concat(this.bellStatus,"-content"))){var o=document.createElement("span");o.innerHTML="".concat(i.domString),document.getElementById("".concat(this.jSPlugin.id,"-header-").concat(this.bellStatus,"-content")).appendChild(o)}else{var a=document.createElement("div");a.id="".concat(this.jSPlugin.id,"-header-").concat(this.bellStatus),a.style="max-width:50%;position:relative;",a.innerHTML='<span id="'.concat(this.jSPlugin.id,"-header-").concat(this.bellStatus,'-content" style="display:inline-block;height:auto;";>\n ').concat(i.domString,"\n </span>"),a.onclick=function(e){if(n.decoderState.state.isEditing)return!1;i.onclick(e)},document.getElementById("".concat(this.jSPlugin.id,"-headControl")).childNodes[0].appendChild(a)}}},{key:"renderFooter",value:function(e,t){var n=this,i=this.decoderState.state.mute;if("remoteUnlock"==e&&this.jSPlugin.capacity&&(!this.jSPlugin.capacity.support_unlock||0==this.jSPlugin.capacity.support_unlock))return!1;var o=this.matchBtn(e,t),a=this.videoWidth/4,r=document.createElement("div");if(r.className="theme-icon-item","quickReply"!==o.id&&(r.style="width:".concat(.66*a,"px;padding:0 ").concat(.12*a,"px;box-sizing: content-box;-webkit-tap-highlight-color:transparent;")),r.innerHTML="".concat('<span id="'.concat(this.jSPlugin.id,"-").concat(o.id,'" style="position:relative;">')+'<div id="'.concat(this.jSPlugin.id,"-").concat(o.id,'-content" title="').concat(o.title,'" style="display: flex;align-items: center;position:relative;">')).concat(o.domString,"</div>")+"</span>",r.onclick=function(e){if(n.decoderState.state.isEditing||!n.activeThemeStatus)return!1;o.onclick(e)},o.onmouseenter&&(r.onmouseenter=function(e){if(n.decoderState.state.isEditing||!n.activeThemeStatus)return!1;o.onmouseenter(e)}),o.onmouseleave&&(r.onmouseleave=function(e){if(n.decoderState.state.isEditing||!n.activeThemeStatus)return!1;o.onmouseleave(e)}),"quickReply"!=e){var s=document.createElement("span");s.className="icon-move left",s.innerHTML='<span id="'.concat(this.jSPlugin.id,"-").concat(o.id,'-left" title="左移" style="height: 40px;position: absolute;top: calc(50% - 33px);left: 1px;display: inline-block;border-radius: 2px;overflow: hidden;cursor: pointer;">\n <svg width="10px" height="40px" viewBox="0 0 10 40" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n <title></title>\n <g id="呼叫模板-控制台" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n <g id="H5呼叫模板" transform="translate(-614.000000, -5024.000000)">\n <g id="编组-28" transform="translate(421.000000, 4484.000000)">\n <g id="编组-9" transform="translate(23.000000, 522.000000)">\n <g id="编组" transform="translate(170.000000, 0.000000)">\n <g id="箭头左" transform="translate(0.000000, 18.000000)">\n <rect id="矩形" fill="#595959" x="0" y="0" width="10" height="40" rx="2"></rect>\n <g id="1.通用/2.Icon图标/Common/Fill/Left" transform="translate(1.000000, 15.000000)" fill="#FFFFFF">\n <path d="M3.88411064,2.46093277 L7.81658983,7.1799078 C7.99337187,7.39204625 7.96470984,7.7073286 7.75257139,7.88411064 C7.66271389,7.95899189 7.54944745,8 7.43247919,8 L-0.432479194,8 C-0.708621569,8 -0.932479194,7.77614237 -0.932479194,7.5 C-0.932479194,7.38303175 -0.891471084,7.2697653 -0.816589833,7.1799078 L3.11588936,2.46093277 C3.2926714,2.24879432 3.60795375,2.22013229 3.8200922,2.39691433 C3.84332373,2.41627394 3.86475103,2.43770124 3.88411064,2.46093277 Z" id="三角形" transform="translate(3.500000, 5.000000) scale(-1, -1) rotate(-270.000000) translate(-3.500000, -5.000000) "></path>\n </g>\n </g>\n </g>\n </g>\n </g>\n </g>\n </g>\n </svg>\n </span>'),s.onclick=function(){n.editIcon(o.id,"left","footer")},r.appendChild(s);var c=document.createElement("span");c.className="icon-move right",c.innerHTML='<span id="'.concat(this.jSPlugin.id,"-").concat(o.id,'-right" class="ezuikit-theme-icon" title="右移" style="height: 40px;position: absolute;top: calc(50% - 33px);left: calc(100% - 11px);display: inline-block;border-radius: 2px;overflow: hidden;cursor: pointer;">\n <svg width="10px" height="40px" viewBox="0 0 10 40" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n <title></title>\n <g id="呼叫模板-控制台" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n <g id="H5呼叫模板" transform="translate(-684.000000, -5024.000000)">\n <g id="编组-28" transform="translate(421.000000, 4484.000000)">\n <g id="编组-9" transform="translate(23.000000, 522.000000)">\n <g id="编组" transform="translate(170.000000, 0.000000)">\n <g id="箭头右" transform="translate(70.000000, 18.000000)">\n <rect id="矩形" fill="#595959" x="0" y="0" width="10" height="40" rx="2"></rect>\n <g id="1.通用/2.Icon图标/Common/Fill/Left" transform="translate(5.500000, 20.000000) scale(-1, 1) translate(-5.500000, -20.000000) translate(2.000000, 15.000000)" fill="#FFFFFF">\n <path d="M3.88411064,2.46093277 L7.81658983,7.1799078 C7.99337187,7.39204625 7.96470984,7.7073286 7.75257139,7.88411064 C7.66271389,7.95899189 7.54944745,8 7.43247919,8 L-0.432479194,8 C-0.708621569,8 -0.932479194,7.77614237 -0.932479194,7.5 C-0.932479194,7.38303175 -0.891471084,7.2697653 -0.816589833,7.1799078 L3.11588936,2.46093277 C3.2926714,2.24879432 3.60795375,2.22013229 3.8200922,2.39691433 C3.84332373,2.41627394 3.86475103,2.43770124 3.88411064,2.46093277 Z" id="三角形" transform="translate(3.500000, 5.000000) scale(-1, -1) rotate(-270.000000) translate(-3.500000, -5.000000) "></path>\n </g>\n </g>\n </g>\n </g>\n </g>\n </g>\n </g>\n </svg>\n </span>'),c.onclick=function(){n.editIcon(o.id,"right","footer")},r.appendChild(c)}if("answer"==e||"rejection"==e||"hangUp"==e);else{var l=document.createElement("span");l.className="icon-move close",l.innerHTML='<span id="'.concat(o.id,'-remove" class="ezuikit-theme-icon" title="移除" style="position: absolute;top: -6px;right: -2px;cursor: pointer;">\n <svg width="16px" height="16px" viewBox="0 0 18 18" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n <title></title>\n <g id="呼叫模板-控制台" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n <g id="H5呼叫模板" transform="translate(-680.000000, -5006.000000)">\n <g id="编组-28" transform="translate(421.000000, 4484.000000)">\n <g id="编组-9" transform="translate(23.000000, 522.000000)">\n <g id="编组" transform="translate(170.000000, 0.000000)">\n <g id="关闭1" transform="translate(66.000000, 0.000000)">\n <rect id="矩形" fill-rule="nonzero" x="0" y="0" width="18" height="18"></rect>\n <path d="M9,1.125 C4.65117188,1.125 1.125,4.65117188 1.125,9 C1.125,13.3488281 4.65117188,16.875 9,16.875 C13.3488281,16.875 16.875,13.3488281 16.875,9 C16.875,4.65117188 13.3488281,1.125 9,1.125 Z M11.9074219,11.9917969 L10.7472656,11.9865234 L9,9.90351562 L7.25449219,11.9847656 L6.09257813,11.9900391 C6.01523438,11.9900391 5.95195313,11.9285156 5.95195313,11.8494141 C5.95195313,11.8160156 5.96425781,11.784375 5.98535156,11.7580078 L8.27226563,9.03339844 L5.98535156,6.31054687 C5.96425781,6.28417969 5.95195313,6.25253906 5.95195313,6.21914062 C5.95195313,6.14179687 6.01523438,6.07851562 6.09257813,6.07851562 L7.25449219,6.08378906 L9,8.16679687 L10.7455078,6.08554688 L11.9056641,6.08027344 C11.9830078,6.08027344 12.0462891,6.14179687 12.0462891,6.22089844 C12.0462891,6.25429687 12.0339844,6.2859375 12.0128906,6.31230469 L9.72949219,9.03515625 L12.0146484,11.7597656 C12.0357422,11.7861328 12.0480469,11.8177734 12.0480469,11.8511719 C12.0480469,11.9285156 11.9847656,11.9917969 11.9074219,11.9917969 Z" id="形状" fill="#595959"></path>\n </g>\n </g>\n </g>\n </g>\n </g>\n </g>\n </svg>\n </span>'),l.onclick=function(){n.editIcon(o.id,"delete","footer")},r.appendChild(l)}"onCall"==this.bellStatus?document.getElementById("".concat(this.jSPlugin.id,"-audioControls-onCall")).appendChild(r):(document.getElementById("".concat(this.jSPlugin.id,"-audioControls")).appendChild(r),"quickReply"===o.id&&document.getElementById("".concat(this.jSPlugin.id,"-audioControls-quickReplyBtn")).appendChild(r)),this.decoderState.state.isEditing&&"mute"==e&&"onCall"==this.bellStatus&&(0!=this.themeData.customConfig.defaultMicro||i?this.setDecoderState({mute:!1},t.backgroundColor):this.setDecoderState({mute:!0},t.backgroundColor))}},{key:"switchFooter",value:function(e){var t=this.themeData.footer;switch(e){case"onBell":document.getElementById("".concat(this.jSPlugin.id,"-audioControls-onCall"))?"none"==document.getElementById("".concat(this.jSPlugin.id,"-audioControls-onCall")).style.display&&(document.getElementById("".concat(this.jSPlugin.id,"-audioControls")).style.display="flex",document.getElementById("".concat(this.jSPlugin.id,"-audioControls-quickReplyBtn")).style.display="flex",document.getElementById("".concat(this.jSPlugin.id,"-btn-quickReply")).style.display="flex"):(document.getElementById("".concat(this.jSPlugin.id,"-audioControls")).style.display="flex",document.getElementById("".concat(this.jSPlugin.id,"-audioControls-quickReplyBtn")).style.display="flex",document.getElementById("".concat(this.jSPlugin.id,"-btn-quickReply")).style.display="flex");break;case"onCall":document.getElementById("".concat(this.jSPlugin.id,"-audioControls")).style.display="none",document.getElementById("".concat(this.jSPlugin.id,"-btn-quickReply")).style.display="none",document.getElementById("".concat(this.jSPlugin.id,"-audioControls-onCall")).style.display="flex",this.themeData&&(document.getElementById("".concat(this.jSPlugin.id,"-audioControls-onCall")).style.color=t[this.bellStatus].color)}}},{key:"initThemeData",value:function(){var e=this;console.log("-------------initThemeData");var t=this.themeData,n=t.header,o=t.footer,a=this.decoderState.state.isEditing,r=this.videoWidth,s=r/375,c=1.8*r,l=this.jSPlugin.id;if(this.isNeedRenderHeader=i.findIndex(n[this.bellStatus].btnList,(function(e){return e.isrender>0}))>=0,this.isNeedRenderFooter=i.findIndex(o[this.bellStatus].btnList,(function(e){return e.isrender>0}))>=0,this.isNeedRenderHeader)if(document.getElementById("".concat(this.jSPlugin.id,"-headControl")))document.getElementById("".concat(this.jSPlugin.id,"-headControl")).innerHTML="<div id='".concat(this.jSPlugin.id,"-headControl-left' style='display:flex;width:100%;overflow:hidden;justify-content: center;'></div>");else{var d=document.createElement("div");d.setAttribute("id","".concat(this.jSPlugin.id,"-headControl")),d.setAttribute("class","header-controls"),d.innerHTML="<div id='".concat(this.jSPlugin.id,"-headControl-left' class=\"header-controls-left\" style='display:flex;width:100%;overflow:hidden;justify-content: center;'></div>"),console.log(this.jSPlugin.height),this.jSPlugin.height;var u=p(p({display:"flex","justify-content":"space-between",top:0,"z-index":999,color:"#FFFFFF",width:"100%",position:"relative","margin-bottom":.1*c+"px","align-items":"center","text-align":"center","font-size":"24ox"},"color","#2c2c2c"),"margin-top","6px");d.style=lt(u),document.getElementById("".concat(l,"-wrap")).insertBefore(d,document.getElementById(l));var m=setInterval((function(){window.EZUIKit[e.jSPlugin.id].state.EZUIKitPlayer.init&&clearInterval(m)}),50)}else document.getElementById("".concat(this.jSPlugin.id,"-headControl"))&&document.getElementById("".concat(this.jSPlugin.id,"-headControl")).parentElement.removeChild(document.getElementById("".concat(this.jSPlugin.id,"-headControl")));if(this.jSPlugin.height,this.isNeedRenderFooter)if(document.getElementById("".concat(this.jSPlugin.id,"-ez-iframe-footer-container")))document.getElementById("".concat(this.jSPlugin.id,"-ez-iframe-footer-container"))&&(document.getElementById("".concat(this.jSPlugin.id,"-ez-iframe-footer-container")).style.marginTop="".concat(.2*c,"px"),"onCall"==this.bellStatus?document.getElementById("".concat(this.jSPlugin.id,"-ez-iframe-footer-container")).innerHTML='\n <div id="'.concat(this.jSPlugin.id,'-audioControls-quickReplyBtn" class="footer-controls" style=\'min-height: ').concat(40*s,"px;margin-bottom: ").concat(40*s,"px;display:flex;justify-content: center;width:100%;z-index:999;position: relative;'></div>\n <div id=\"").concat(this.jSPlugin.id,'-audioControls" class="footer-controls" style=\'display:none;justify-content: space-around;padding: 0 8%;width:100%;z-index:999;position: relative;\'></div>\n <div id="').concat(this.jSPlugin.id,'-audioControls-onCall" class="footer-controls" style=\'display:flex;justify-content: space-around;padding: 0 8%;width:100%;z-index:999;position: relative;\'></div>\n <div id="').concat(this.jSPlugin.id,'-audioControls-quickReply" class="footer-controls" style=\'display:none;justify-content: center;width:100%;z-index:999;position: relative;\'></div>\n <div id="').concat(this.jSPlugin.id,'-audioControls-remoteUnlock" class="footer-controls" style=\'display:none;justify-content: center;width:100%;z-index:999;position: relative;\'></div>\n '):document.getElementById("".concat(this.jSPlugin.id,"-ez-iframe-footer-container")).innerHTML='\n <div id="'.concat(this.jSPlugin.id,'-audioControls-quickReplyBtn" class="footer-controls" style=\'min-height: ').concat(40*s,"px;margin-bottom: ").concat(40*s,"px;display:flex;justify-content: center;width:100%;z-index:999;position: relative;'></div>\n <div id=\"").concat(this.jSPlugin.id,'-audioControls" class="footer-controls" style=\'display:flex;justify-content: space-around;padding: 0 8%;width:100%;z-index:999;position: relative;\'></div>\n <div id="').concat(this.jSPlugin.id,'-audioControls-onCall" class="footer-controls" style=\'display:none;justify-content: space-around;padding: 0 8%;width:100%;z-index:999;position: relative;\'></div>\n <div id="').concat(this.jSPlugin.id,'-audioControls-quickReply" class="footer-controls" style=\'display:none;justify-content: center;width:100%;z-index:999;position: relative;\'></div>\n <div id="').concat(this.jSPlugin.id,'-audioControls-remoteUnlock" class="footer-controls" style=\'display:none;justify-content: center;width:100%;z-index:999;position: relative;\'></div>\n '));else{var h=document.createElement("div");h.setAttribute("id","".concat(this.jSPlugin.id,"-ez-iframe-footer-container")),h.setAttribute("class","ez-iframe-footer-container");var g={position:"relative","margin-top":.2*c+"px",display:"flex","flex-wrap":"wrap","justify-content":"space-between","z-index":999,top:0,color:"#FFFFFF",width:"100%","align-items":"center","font-size":"12px"};h.style=lt(g),h.innerHTML='\n <div id="'.concat(this.jSPlugin.id,'-audioControls-quickReplyBtn" class="footer-controls" style=\'min-height: ').concat(40*s,"px;margin-bottom: ").concat(40*s,"px;display:flex;justify-content: center;width:100%;z-index:999;position: relative;'></div>\n <div id=\"").concat(this.jSPlugin.id,'-audioControls" class="footer-controls" style=\'display:flex;justify-content: space-around;padding: 0 8%;width:100%;z-index:999;position: relative;\'></div>\n <div id="').concat(this.jSPlugin.id,'-audioControls-onCall" class="footer-controls" style=\'display:none;justify-content: space-around;padding: 0 8%;width:100%;z-index:999;position: relative;\'></div>\n <div id="').concat(this.jSPlugin.id,'-audioControls-quickReply" class="footer-controls" style=\'display:none;justify-content: center;width:100%;z-index:999;position: relative;\'></div>\n <div id="').concat(this.jSPlugin.id,'-audioControls-remoteUnlock" class="footer-controls" style=\'display:none;justify-content: center;width:100%;z-index:999;position: relative;\'></div>\n '),x(h,document.getElementById(l))}else document.getElementById("".concat(this.jSPlugin.id,"-ez-iframe-footer-container"))&&document.getElementById("".concat(this.jSPlugin.id,"-ez-iframe-footer-container")).parentElement.removeChild(document.getElementById("".concat(this.jSPlugin.id,"-ez-iframe-footer-container")));if(this.isNeedRenderHeader&&document.getElementById("".concat(this.jSPlugin.id,"-headControl"))&&n[this.bellStatus].btnList.map((function(t,n){t.isrender&&e.renderHeader(t.iconId,t)})),this.isNeedRenderFooter&&document.getElementById("".concat(this.jSPlugin.id,"-audioControls"))&&(document.getElementById("".concat(this.jSPlugin.id,"-audioControls")).style.background=o[this.bellStatus].backgroundColor,document.getElementById("".concat(this.jSPlugin.id,"-audioControls")).style.color=o[this.bellStatus].color,o[this.bellStatus].btnList.map((function(t,n){t.isrender&&e.renderFooter(t.iconId,t)}))),1!=this.themeData.customConfig.bellPoster||a)this.jSPlugin.setPoster("");else{this.jSPlugin.poster="https://resource.eziot.com/group1/M00/00/B8/CtwQEmPbGh2AVJB-ABDcYtyw5gk899.svg";var f=setInterval((function(){window.EZUIKit[e.jSPlugin.id].state.EZUIKitPlayer.init&&(clearInterval(f),e.jSPlugin.setPoster(e.jSPlugin.poster))}),50)}this.activeThemeStatus&&(this.initBellRing(),this.checkIsAppleDevice()||!1?window.addEventListener("touchstart",this.autoPlayRing):window.addEventListener("click",this.autoPlayRing));this.inited=!0,this.getCallDeviceInfo()}},{key:"checkIsAppleDevice",value:function(){var e=navigator.userAgent,t=!!e.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/),n=e.indexOf("iPad")>-1,i=e.indexOf("iPhone")>-1||e.indexOf("Mac")>-1;return!!(t||n||i)}},{key:"renderThemeData",value:function(){var e=this,t=this.themeData,n=t.header,i=t.footer,o=this.decoderState.state.isEditing;if(this.isNeedRenderHeader&&n&&(document.getElementById("".concat(this.jSPlugin.id,"-headControl")).style.color=n[this.bellStatus].color.replace("-diy",""),n[this.bellStatus].btnList.map((function(t,n){t.isrender&&e.setDecoderState(p({},t.iconId,e.decoderState.state[t.iconId]))}))),this.isNeedRenderFooter&&i)document.getElementById("".concat(this.jSPlugin.id,"-audioControls")).style.background=i[this.bellStatus].backgroundColor.replace("-diy",""),document.getElementById("".concat(this.jSPlugin.id,"-audioControls")).style.color=i[this.bellStatus].color.replace("-diy",""),document.getElementById("".concat(this.jSPlugin.id,"-audioControls-onCall")).style.color=i[this.bellStatus].color.replace("-diy",""),i[this.bellStatus].btnList.map((function(t,n){if(t.isrender&&e.setDecoderState(p({},t.iconId,e.decoderState.state[t.iconId])),console.log("-------------activeThemeStatus"),0==n&&!e.themeInited&&e.activeThemeStatus)var i=setInterval((function(){window.EZUIKit[e.jSPlugin.id].state.EZUIKitPlayer.init&&(clearInterval(i),1!=e.themeData.customConfig.bellPoster||o?e.jSPlugin.play():e.jSPlugin.pluginStatus.loadingClear(),e.themeInited=!0)}),50)})),-1!==this.jSPlugin.url.indexOf("hd.live")&&this.setDecoderState({hd:!0}),this.themeData.autoFocus>0&&(this.autoFocus=parseInt(this.themeData.autoFocus),this.startAutoFocus(),document.getElementById("".concat(this.jSPlugin.id,"-wrap")).addEventListener("click",(function(){e.stopAutoFocus()}))),this.setDecoderState({cloudRec:"cloud.rec"===A(this.jSPlugin.url).type,rec:"rec"===A(this.jSPlugin.url).type,type:A(this.jSPlugin.url).type});else if(!this.themeInited&&this.activeThemeStatus)var a=setInterval((function(){window.EZUIKit[e.jSPlugin.id].state.EZUIKitPlayer.init&&(clearInterval(a),e.themeData&&e.themeData.customConfig&&1==e.themeData.customConfig.bellPoster&&!o?e.jSPlugin.pluginStatus.loadingClear():e.jSPlugin.play(),e.themeInited=!0)}),50);var r=setInterval((function(){window.EZUIKit[e.jSPlugin.id].state.EZUIKitPlayer.init&&(clearInterval(r),e.jSPlugin.reSize(e.jSPlugin.params.width,e.jSPlugin.params.height))}),50);o||this.jSPlugin.isWebConsole?1==this.themeData.customConfig.miniWinRec?this.initMiniImageRec():this.miniRecCloseClick():setTimeout((function(){"onBell"==e.bellStatus&&e.jSPlugin.capacity&&1==e.jSPlugin.capacity.support_doorcall_playback&&(console.log("小窗口initMiniRec-------------设备能力集成功"),1==e.themeData.customConfig.miniWinRec&&(console.log("小窗口initMiniRec---------------画中画设置已开启"),(!e.deviceInfoData||e.deviceInfoData&&!e.deviceInfoData.isEncrypt)&&(console.log("小窗口initMiniRec---------------设备未加密"),e.miniRecNum=0,e.initMiniRec())))}),1e3)}},{key:"setThemeData",value:function(e,t){this.themeData=e,"onCall"==t&&(this.bellStatus="onCall")}},{key:"startAutoFocus",value:function(){var e=this,t=this.autoFocus;this.autoFocusTimer&&clearTimeout(this.autoFocusTimer),this.autoFocusTimer=setTimeout((function(){document.getElementById("".concat(e.jSPlugin.id,"-audioControls"))&&(document.getElementById("".concat(e.jSPlugin.id,"-audioControls")).style.opacity=0,document.getElementById("".concat(e.jSPlugin.id,"-audioControls")).style.pointerEvents="none")}),1e3*t)}},{key:"stopAutoFocus",value:function(){document.getElementById("".concat(this.jSPlugin.id,"-audioControls"))&&(document.getElementById("".concat(this.jSPlugin.id,"-audioControls")).style.opacity=1,document.getElementById("".concat(this.jSPlugin.id,"-audioControls")).style.pointerEvents="all"),this.autoFocusTimer&&clearTimeout(this.autoFocusTimer),this.startAutoFocus()}},{key:"editIcon",value:function(e,t,n){console.log("编辑组件",e,t,n);var o=this.themeData;console.log("themeData",this.themeData);var a=this.themeData[n][this.bellStatus].btnList,r=i.findIndex(a,(function(t){return t.iconId===e})),s=a[r];switch(t){case"delete":a[r].isrender=0;break;case"right":for(var c=-1,l=r+1;l<a.length;l++)if(a[l].part===a[r].part&&1==a[l].isrender){c=l;break}-1!==c&&(a[r]=a[c],a[c]=s);break;case"left":for(var d=-1,u=r-1;u>=0;u--)if(a[u].part===a[r].part&&1==a[u].isrender){d=u;break}-1!==d&&(a[r]=a[d],a[d]=s)}console.log("new btnList",a),o[n][this.bellStatus].btnList=a,this.jSPlugin.Theme.changeTheme(o)}},{key:"countTime",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this;if(!document.getElementById(this.jSPlugin.id+"time-area")){var i=document.createElement("div");i.id=this.jSPlugin.id+"time-area",i.className="time-area",i.innerHTML='<span class="dot"></span><span class="value">00:00</span>',document.getElementById("".concat(this.jSPlugin.id,"-ez-iframe-footer-container"))&&document.getElementById("".concat(this.jSPlugin.id,"-ez-iframe-footer-container")).appendChild(i)}if(this.countTimer&&clearInterval(this.countTimer),"add"===e){var o=t;document.getElementById(n.jSPlugin.id+"time-area").style.display="flex",this.countTimer=setInterval((function(){++o,document.getElementById(n.jSPlugin.id+"time-area").children[1].innerHTML=function(e){var t=parseInt(e),n=0,i=0,o="00",a="00",r="00";t>59&&(n=parseInt(t/60),t=parseInt(t%60),n>59&&(i=parseInt(n/60),n=parseInt(n%60)));return o=parseInt(t)>9?parseInt(t):"0"+parseInt(t),a=parseInt(n)>9?parseInt(n):"0"+parseInt(n),r=parseInt(i)>9?parseInt(i):"0"+parseInt(i),i>0?r+":"+a+":"+o:n>0?a+":"+o:"00:"+o}(o)}),1e3)}else"destroy"===e&&(this.countTimer&&clearInterval(this.countTimer),this.countTimer=void 0,document.getElementById(n.jSPlugin.id+"time-area")&&(document.getElementById(n.jSPlugin.id+"time-area").children[1].innerHTML="00:00",document.getElementById(n.jSPlugin.id+"time-area").style.display="none"))}},{key:"editStart",value:function(e){console.log("----------editStart1");var t=document.getElementById("".concat(this.jSPlugin.id,"-audioControls")),n=document.getElementById("".concat(this.jSPlugin.id,"-audioControls-onCall"));document.getElementById("".concat(this.jSPlugin.id,"-headControl")),t&&t.setAttribute("class","footer-controls themeEditing"),n&&n.setAttribute("class","footer-controls themeEditing"),this.setDecoderState({isEditing:!0})}},{key:"editEnd",value:function(e){console.log("----------editEnd1");var t=document.getElementById("".concat(this.jSPlugin.id,"-audioControls")),n=document.getElementById("".concat(this.jSPlugin.id,"-headControl")),i=document.getElementById("".concat(this.jSPlugin.id,"-audioControls-onCall"));n&&n.setAttribute("class","header-controls"),t&&t.setAttribute("class","footer-controls"),i&&i.setAttribute("class","footer-controls")}},{key:"fetchThemeData",value:function(e){var t=this;switch(this.jSPlugin.themeId){case"pcLive":case"pcRec":case"mobileLive":case"mobileRec":case"miniRec":break;default:Ue(this.jSPlugin,e,(function(e){0==e.meta.code&&e.data?(t.activeThemeStatus=!0,t.themeData=e.data,e.data.header&&(t.themeData.header=e.data.header,t.themeData.header[t.bellStatus].btnList=t.themeData.header[t.bellStatus].btnList.sort((function(e,t){return e.btnKey.split("-")[3]-t.btnKey.split("-")[3]}))),e.data.footer&&(t.themeData.footer=e.data.footer,t.themeData.footer[t.bellStatus].btnList=t.themeData.footer[t.bellStatus].btnList.sort((function(e,t){return e.btnKey.split("-")[3]-t.btnKey.split("-")[3]}))),t.jSPlugin.capacity?(t.initThemeData(),t.renderThemeData()):setTimeout((function(){t.initThemeData(),t.renderThemeData()}),300)):(t.activeThemeStatus=!1,t.jSPlugin.pluginStatus.loadingClear(),t.setDecoderState({rejection:!0}),"111021"==e.meta.code?(t.jSPlugin.pluginStatus.loadingSetText({text:"无效的模板id",color:"#fff",type:1}),t.activeThemeStatusTxt="无效的模板id"):"111023"==e.meta.code?(t.jSPlugin.pluginStatus.loadingSetText({text:"您的试用特权已到期,需前往轻应用控制台购买后使用。",color:"#fff",type:1}),t.activeThemeStatusTxt="试用特权已到期"):(t.jSPlugin.pluginStatus.loadingSetText({text:"模板未激活,请先在开放平台轻应用控制台购买模板",color:"#fff",type:1}),t.activeThemeStatusTxt="模板未激活"),t.themeData=ct,t.initThemeData(),t.renderThemeData())}),(function(){t.renderThemeData()}))}}},{key:"getCallDeviceInfo",value:function(){var e=this;this.videoWidth,it({accessToken:this.jSPlugin.accessToken||this.jSPlugin.token.deviceToken.video,deviceSerial:A(this.jSPlugin.url).deviceSerial}).then((function(t){t.data&&(e.deviceInfoData=t.data,t.data.isEncrypt&&(console.log("小窗口miniRecCloseClick------------设备已加密"),e.miniRecCloseClick(),setTimeout((function(){e.jSPlugin.pluginStatus.loadingClear(),e.jSPlugin.pluginStatus.loadingSetText({text:"视频已加密",color:"#fff"})}),1e3)),document.getElementById("header-".concat(e.bellStatus,"-deviceCategory"))&&(document.getElementById("header-".concat(e.bellStatus,"-deviceCategory")).innerText=""+t.data.deviceName))})).catch((function(t){console.log("获取设备信息失败",t),20018!=t.code||e.jSPlugin.isWebConsole||e.userNoDevice()}))}},{key:"setHeaderText",value:function(e){console.log("setHeaderText");var t=this.videoWidth/375||1;document.getElementById("".concat(this.jSPlugin.id,"-deviceCategory-content"))&&(document.getElementById("".concat(this.jSPlugin.id,"-deviceCategory-content")).innerHTML='<span style="font-size: '.concat(24*t,'px;display: block">').concat(e,'</span><span style="font-size: ').concat(14*t,"px;padding-top: ").concat(5*t,'px;display: block;">').concat(this.deviceInfoData&&this.deviceInfoData.category||"","</span>"))}}])}(),ut=function(){return m((function e(t){if(l(this,e),this.jSPlugin=t,this.videoWidth=t.width,this.autoFocus=0,this.autoFocusTimer=null,this.decoderState={state:{isEditing:!1,play:!1,sound:!1,recordvideo:!1,recordCount:"00:00",talk:!1,mute:!1,rejection:!1,cloudRec:"cloud.rec"===A(t.url).type,rec:"rec"===A(t.url).type,type:A(t.url).type}},console.log("matchEzopenUrl(jSPlugin.url)",A(t.url),this.decoderState.state),this.isMobile=navigator.userAgent.match(/(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i),void 0!==t.isMobile&&(this.isMobile=t.isMobile),this.themeData={},"themeData"==this.jSPlugin.themeId&&(this.themeData=this.jSPlugin.params.themeData),this.jSPlugin.themeId)if(this.isMobile?this.call=new dt(this.jSPlugin,this.themeData,this.setDecoderState,this.decoderState):this.call=new at(this.jSPlugin,this.themeData,this.setDecoderState,this.decoderState),"themeData"===this.jSPlugin.themeId)this.themeData=this.jSPlugin.params.themeData,this.call.initThemeData(),this.call.renderThemeData();else this.call.fetchThemeData(this.jSPlugin.themeId);this.jSPlugin.Talk||(this.jSPlugin.Talk=new Pe(this.jSPlugin)),P("".concat(this.jSPlugin.staticPath,"/speed/speed.css")),P("".concat(this.jSPlugin.staticPath,"/css/theme.css"))}),[{key:"changeTheme",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"onBell";if("string"==typeof e)switch(this.jSPlugin.themeId=e,this.jSPlugin.themeId){case"pcLive":case"mobileCall":case"webCall":this.call.initThemeData(),this.call.renderThemeData();break;default:this.call.fetchThemeData(e)}else"object"===b(e)&&(this.themeData=e,this.call.setThemeData(e,n),this.call.initThemeData(),this.call.renderThemeData(),this.decoderState.state.isEditing&&t&&this.call.editStart());this.jSPlugin&&this.jSPlugin.handleThemeChange&&this.jSPlugin.handleThemeChange(e)}},{key:"setDecoderState",value:function(e,t){var n=this,i=this.themeData;i.header,i.footer,Object.keys(e).map((function(i){if("mute"===i)document.getElementById("".concat(n.jSPlugin.id,"-icon-mute"))&&(console.log("mute"),e[i]?(document.getElementById("".concat(n.jSPlugin.id,"-icon-mute")).style.background=t,document.getElementById("".concat(n.jSPlugin.id,"-icon-mute")).style.border=" 1px solid ".concat(t),document.getElementById("icon-mute-path").style.fill="#ffffff"):(document.getElementById("".concat(n.jSPlugin.id,"-icon-mute")).style.background="#ffffff",document.getElementById("".concat(n.jSPlugin.id,"-icon-mute")).style.border="1px solid ".concat(t),document.getElementById("icon-mute-path").style.fill=t));n.decoderState.state=Object.assign(n.decoderState.state,e)}))}},{key:"startAutoFocus",value:function(){var e=this,t=this.autoFocus;this.autoFocusTimer&&clearTimeout(this.autoFocusTimer),this.autoFocusTimer=setTimeout((function(){document.getElementById("".concat(e.jSPlugin.id,"-audioControls"))&&(document.getElementById("".concat(e.jSPlugin.id,"-audioControls")).style.opacity=0,document.getElementById("".concat(e.jSPlugin.id,"-audioControls")).style.pointerEvents="none")}),1e3*t)}},{key:"stopAutoFocus",value:function(){document.getElementById("".concat(this.jSPlugin.id,"-audioControls"))&&(document.getElementById("".concat(this.jSPlugin.id,"-audioControls")).style.opacity=1,document.getElementById("".concat(this.jSPlugin.id,"-audioControls")).style.pointerEvents="all"),this.autoFocusTimer&&clearTimeout(this.autoFocusTimer),this.startAutoFocus()}},{key:"toString",value:function(){return"".concat(this.coreX,"-").concat(this.coreY)}},{key:"editIcon",value:function(e,t,n){console.log("编辑组件",e,t,n);var o=this.themeData;console.log("themeData",this.themeData);var a=this.themeData[n].btnList,r=i.findIndex(a,(function(t){return t.iconId===e})),s=a[r];switch(t){case"delete":if("rec"===e){if(-1===i.findIndex(a,(function(e){return"cloudRec"===e.iconId&&1==e.isrender})))return this.jSPlugin.Message&&this.jSPlugin.Message.default("必须选中一种存储介质"),!1}else if("cloudRec"===e&&-1===i.findIndex(a,(function(e){return"rec"===e.iconId&&1==e.isrender})))return this.jSPlugin.Message&&this.jSPlugin.Message.default("必须选中一种存储介质"),!1;a[r].isrender=0;break;case"right":for(var c=-1,l=r+1;l<a.length;l++)if(a[l].part===a[r].part&&1==a[l].isrender){c=l;break}-1!==c&&(a[r]=a[c],a[c]=s);break;case"left":for(var d=-1,u=r-1;u>=0;u--)if(a[u].part===a[r].part&&1==a[u].isrender){d=u;break}-1!==d&&(a[r]=a[d],a[d]=s)}console.log("new btnList",a),o[n].btnList=a,this.changeTheme(o)}},{key:"countTime",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this;if(!document.getElementById(this.jSPlugin.id+"time-area")){var i=document.createElement("div");i.id=this.jSPlugin.id+"time-area",i.className="time-area",i.innerHTML='<span class="dot"></span><span class="value">00:00</span>',document.getElementById("".concat(this.jSPlugin.id,"-ez-iframe-footer-container"))&&document.getElementById("".concat(this.jSPlugin.id,"-ez-iframe-footer-container")).appendChild(i)}if(this.countTimer&&clearInterval(this.countTimer),"add"===e){var o=t;document.getElementById(n.jSPlugin.id+"time-area").style.display="flex",this.countTimer=setInterval((function(){++o,document.getElementById(n.jSPlugin.id+"time-area").children[1].innerHTML=function(e){var t=parseInt(e),n=0,i=0,o="00",a="00",r="00";t>59&&(n=parseInt(t/60),t=parseInt(t%60),n>59&&(i=parseInt(n/60),n=parseInt(n%60)));return o=parseInt(t)>9?parseInt(t):"0"+parseInt(t),a=parseInt(n)>9?parseInt(n):"0"+parseInt(n),r=parseInt(i)>9?parseInt(i):"0"+parseInt(i),i>0?r+":"+a+":"+o:n>0?a+":"+o:"00:"+o}(o)}),1e3)}else"destroy"===e&&(this.countTimer&&clearInterval(this.countTimer),this.countTimer=void 0,document.getElementById(n.jSPlugin.id+"time-area")&&(document.getElementById(n.jSPlugin.id+"time-area").children[1].innerHTML="00:00",document.getElementById(n.jSPlugin.id+"time-area").style.display="none"))}},{key:"editStart",value:function(e){var t=document.getElementById("".concat(this.jSPlugin.id,"-audioControls")),n=document.getElementById("".concat(this.jSPlugin.id,"-audioControls-onCall")),i=document.getElementById("".concat(this.jSPlugin.id,"-headControl"));i&&i.setAttribute("class","header-controls themeEditing"),t&&t.setAttribute("class","footer-controls themeEditing"),n&&n.setAttribute("class","footer-controls themeEditing"),this.setDecoderState({isEditing:!0})}},{key:"editEnd",value:function(e){var t=document.getElementById("".concat(this.jSPlugin.id,"-audioControls")),n=document.getElementById("".concat(this.jSPlugin.id,"-headControl"));n&&n.setAttribute("class","header-controls"),t&&t.setAttribute("class","footer-controls"),this.setDecoderState({isEditing:!1})}},{key:"setDisabled",value:function(e){}},{key:"getDeviceInfo",value:function(){var e=this,t=this.videoWidth/1024||1;it({accessToken:this.jSPlugin.accessToken||this.jSPlugin.token.deviceToken.video,deviceSerial:A(this.jSPlugin.url).deviceSerial}).then((function(n){200==n.code&&n.data&&document.getElementById("".concat(e.jSPlugin.id,"-deviceCategory-content"))&&(document.getElementById("".concat(e.jSPlugin.id,"-deviceCategory-content")).style.maxWidth="100%",document.getElementById("".concat(e.jSPlugin.id,"-deviceCategory-content")).style.overflow="hidden",document.getElementById("".concat(e.jSPlugin.id,"-deviceCategory-content")).style.textOverflow="ellipsis",document.getElementById("".concat(e.jSPlugin.id,"-deviceCategory-content")).style.whiteSpace="nowrap",document.getElementById("".concat(e.jSPlugin.id,"-deviceCategory-content")).innerHTML='<span style="font-size: '.concat(32*t,'px;display: block">有人按门铃</span><span style="font-size: ').concat(24*t,"px;padding-top: ").concat(16*t,'px;display: block;">').concat(n.data.category,"</span>"))})).catch((function(e){console.log("获取设备信息失败",e)}))}}])}(),mt=function(){return m((function e(t){l(this,e),this.jSPlugin=t;var n=window["EZUIKIT_TIMER_INTERVAL_".concat(t.id)];n&&Object.keys(n).length>0&&this.resetTimer(),window["EZUIKIT_TIMER_INTERVAL_".concat(t.id)]={}}),[{key:"createInterval",value:function(e,t,n){window["EZUIKIT_TIMER_INTERVAL_".concat(this.jSPlugin.id)][e]=setInterval(t,n)}},{key:"clearTimer",value:function(e){var t=window["EZUIKIT_TIMER_INTERVAL_".concat(this.jSPlugin.id)];t[e]&&(clearInterval(t[e]),delete t[e])}},{key:"resetTimer",value:function(){var e=window["EZUIKIT_TIMER_INTERVAL_".concat(this.jSPlugin.id)];for(var t in e)clearInterval(e[t]),delete e[t]}}])}(),ht=m((function e(t){var n=this;l(this,e),p(this,"initMap",(function(){var e=n,t=n.videoWidth,i=n.videoHeight;if(document.getElementById("".concat(n.jSPlugin.id,"-miniRecbox")))document.getElementById("".concat(n.jSPlugin.id,"-wrap")).removeChild(document.getElementById("".concat(n.jSPlugin.id,"-miniRecbox"))),n.initMap();else{var o=document.createElement("div");o.id="".concat(n.jSPlugin.id,"-miniRecbox"),o.style=";position: absolute; bottom:96px;right:".concat(n.jSPlugin.inspectVideoWidth,"px;"),o.innerHTML='<div id="'.concat(n.jSPlugin.id,'-mapbox" style="\n width: ').concat(.3333*t,"px;\n height: ").concat(.3333*i,'px;\n "></div>'),document.getElementById("".concat(n.jSPlugin.id,"-wrap")).insertBefore(o,document.getElementById("".concat(n.jSPlugin.id,"-ez-iframe-footer-container"))),e.map=e.loadMap("".concat(n.jSPlugin.id,"-mapbox"))}return e.map})),p(this,"loadMap",(function(e){var t=new BMapGL.Map(e);return t.centerAndZoom(new BMapGL.Point(116.297611,40.047363),15),t.enableScrollWheelZoom(!0),t})),p(this,"createCircle",(function(e,t,i,o){var a=new BMapGL.Point(e,t),r=new BMapGL.Marker(a,{title:o});if(n.map.addOverlay(r),0!=i){var s=new BMapGL.Circle(new BMapGL.Point(e,t),i,{strokeColor:"#ff4d4f",strokeWeight:4,strokeOpacity:1,strokeStyle:"dashed",fillOpacity:0});n.map.addOverlay(s)}})),p(this,"createInspectPoints",(function(e){e.map((function(e){n.createCircle(e.longitude,e.latitude,e.radius,e.inspectPointName)}))})),p(this,"createPolygon",(function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"#407AFF",i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"solid",o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:4,a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1,r=arguments.length>5&&void 0!==arguments[5]?arguments[5]:"407AFF",s=arguments.length>6&&void 0!==arguments[6]?arguments[6]:0,c=[];e.split(";").map((function(e){var t=e.split(",");c.push(new BMapGL.Point(t[0],t[1]))})),n.inspectRange=new BMapGL.Polygon(c,{strokeColor:t,strokeWeight:o,strokeOpacity:a,strokeStyle:i,fillOpacity:s,fillColor:r}),n.map.addOverlay(n.inspectRange)})),p(this,"createTrack",(function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"#18C796",o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"solid",a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:4,r=arguments.length>5&&void 0!==arguments[5]?arguments[5]:1,s=arguments.length>6&&void 0!==arguments[6]?arguments[6]:0,c=arguments.length>7&&void 0!==arguments[7]?arguments[7]:0,l=arguments.length>8&&void 0!==arguments[8]?arguments[8]:500,d=arguments.length>9&&void 0!==arguments[9]?arguments[9]:0,u=arguments.length>10&&void 0!==arguments[10]&&arguments[10],m=[];if(e.map((function(e){var t=!1;n.currentTrack.length>0&&n.currentTrack.map((function(n){n.longitude===e.longitude&&n.latitude===e.latitude&&n.reportTime===e.reportTime&&(t=!0)})),t||(0==m.length&&n.currentTrack.length>0&&m.push(new BMapGL.Point(n.currentTrack[n.currentTrack.length-1].longitude,n.currentTrack[n.currentTrack.length-1].latitude)),m.push(new BMapGL.Point(e.longitude,e.latitude)))})),0!=m.length){var h=new BMapGL.Polyline(m,{strokeColor:i,strokeWeight:a,strokeOpacity:r,strokeStyle:o,fillOpacity:s});if(t?(n.map.addOverlay(h),n.map.centerAndZoom(m[m.length-1],15)):(n.trackAni=new BMapGLLib.TrackAnimation(n.map,h,{overallView:u,tilt:c,duration:l,delay:d}),n.trackAni.start()),n.currentTrack=e,n.currentTrack.length>0&&n.currentTrack.length>0){var p=new BMapGL.Point(n.currentTrack[0].longitude,n.currentTrack[0].latitude);if(n.startPoint=new BMapGL.Marker(p,{icon:new BMapGL.Icon("".concat(n.jSPlugin.staticPath,"/imgs/start.png"),new BMapGL.Size(32,47)),offset:new BMapGL.Size(0,-17)}),n.map.addOverlay(n.startPoint),1==n.currentTrack.length)return;var g=new BMapGL.Point(n.currentTrack[n.currentTrack.length-1].longitude,n.currentTrack[n.currentTrack.length-1].latitude);n.endPoint&&n.map.removeOverlay(n.endPoint),setTimeout((function(){n.endPoint=new BMapGL.Marker(g,{icon:new BMapGL.Icon("".concat(n.jSPlugin.staticPath,"/imgs/end.png"),new BMapGL.Size(30,30))}),n.map.addOverlay(n.endPoint)}),t?0:l)}}})),p(this,"centerToTrack",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:15;n.currentTrack.length>0&&(1==n.currentTrack.length?n.map.centerAndZoom(new BMapGL.Point(n.currentTrack[0].longitude,n.currentTrack[0].latitude),e):n.map.centerAndZoom(new BMapGL.Point(n.currentTrack[n.currentTrack.length-1].longitude,n.currentTrack[n.currentTrack.length-1].latitude),e))})),this.jSPlugin=t,this.videoWidth=t.width,this.videoHeight=t.height,this.toastCustom=new Je(t,!1),this.currentTrack=[],this.startPoint=null,this.endPoint=null,this.trackAni=null,this.inspectRange=null,this.map=this.initMap()})),pt=m((function e(t){var n=this;l(this,e),p(this,"init",(function(){var e=n;if(n.videoWidth,n.videoHeight,document.getElementById("".concat(n.jSPlugin.id,"-inspect-global-box")))document.getElementById("".concat(n.jSPlugin.id,"-inspect-global-box"))&&document.getElementById("".concat(n.jSPlugin.id,"-wrap")).removeChild(document.getElementById("".concat(n.jSPlugin.id,"-inspect-global-box"))),e.init();else{var t=document.createElement("div");t.id="".concat(n.jSPlugin.id,"-inspect-global-box"),t.style=";position: absolute; left:0; top: 0; width: 100%; height: 100%; z-index: 10000; background: #fff;",t.innerHTML='<div id="'.concat(n.jSPlugin.id,'-inspect-loading-box" style="\n overflow: auto;\n box-sizing: border-box;\n font-size: 14px;\n color: #595959;\n line-height: 24px;\n font-weight: bold;\n width: 100%;\n display: flex;\n align-items: center;\n justify-content: center;\n height: 100%;\n ">\n <div>\n <div style="text-align:center;"><div type="default" class="ezuikit-spin ezuikit-spin-spinning"><span class="ezuikit-spin-dot ezuikit-spin-dot-spin ezuikit-spin-dot-default"><i class="ezuikit-spin-dot-item"></i><i class="ezuikit-spin-dot-item"></i><i class="ezuikit-spin-dot-item"></i><i class="ezuikit-spin-dot-item"></i></span></div></div>\n <div style="color: #595959; font-size:14px; font-weight: 400; text-align: center;">加载中…</div>\n </div></div>\n '),document.getElementById("".concat(n.jSPlugin.id,"-wrap")).appendChild(t)}})),p(this,"deviceErrorInfo",(function(e,t){var i=Object.assign({tips:"",refreshBtn:"",refreshShow:!1},e);if(document.getElementById("".concat(n.jSPlugin.id,"-no-inspect-box")))document.getElementById("".concat(n.jSPlugin.id,"-no-inspect-box"))&&document.getElementById("".concat(n.jSPlugin.id,"-inspect-global-box")).removeChild(document.getElementById("".concat(n.jSPlugin.id,"-no-inspect-box"))),n.deviceErrorInfo(e,t);else{n.videoHeight;var o=document.createElement("div");o.id="".concat(n.jSPlugin.id,"-no-inspect-box"),o.style="width:100%;height:100%; background: #ffffff; display: flex; justify-content: center; align-items: center",o.innerHTML='<div style="\n overflow: auto;\n box-sizing: border-box;\n font-size: 14px;\n color: #595959;\n text-align: center;\n ">\n <div style="text-align:center; height: 21px;">\n <svg t="1689074472491" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="7172" xmlns:xlink="http://www.w3.org/1999/xlink" width="21" height="21"><path d="M512 64a448 448 0 1 0 0 896A448 448 0 0 0 512 64z m-32 232c0-4.416 3.584-8 8-8h48c4.416 0 8 3.584 8 8v272A8 8 0 0 1 536 576h-48a8 8 0 0 1-8-8v-272zM512 736A48 48 0 1 1 512 640a48 48 0 0 1 0 96z" fill="#FF4D4F" p-id="7173"></path></svg>\n </div>\n <div style="color: #595959; font-size:14px; margin: 5px 0 16px;font-weight: 400; text-align: center;">'.concat(i.tips,'</div>\n <button id="').concat(n.jSPlugin.id,'-inspect-device-status-refresh" style="display: ').concat(i.refreshShow?"block":"none",'; width: 80px; margin: 0 auto;" type="button" class="ezuikit-btn ezuikit-btn-primary"><span>').concat(i.refreshBtn,"</span></button>\n </div>\n "),document.getElementById("".concat(n.jSPlugin.id,"-inspect-global-box")).appendChild(o),document.getElementById("".concat(n.jSPlugin.id,"-inspect-device-status-refresh")).addEventListener("click",(function(){t&&t()}))}})),p(this,"globalContainerToggle",(function(e,t){document.getElementById(e)&&(document.getElementById(e).style.display=t?"flex":"none")})),this.jSPlugin=t,this.videoWidth=t.width,this.videoHeight=t.height,this.toastCustom=new Je(t,!1),this.init()})),gt=function(){return m((function e(t){l(this,e),this.timer=null;var n={wrapNode:document.body,time:2e3,content:"",type:"info",center:!1,top:8};this.params=f(f({},n),t),this.init()}),[{key:"init",value:function(){var e=this;this.timer=null;var t=this.params,n=t.wrapNode,i=t.content,o=t.time,a=t.type,r=t.center,s=t.top;this.wrapNode=n;var c=document.createElement("div");c.setAttribute("class","ezuikit-message"),r?c.setAttribute("style","top: 50%; transform: translateY(-50%);"):c.setAttribute("style","top: ".concat(s||0,"px;")),this.wrapNode.appendChild(c),this.initMessageContent(a,i,c),0!==o&&(this.timer=setTimeout((function(){e.wrapNode.removeChild(c)}),o||2e3))}},{key:"initMessageContent",value:function(e,t,n){var i=document.createElement("div");i.setAttribute("class","ezuikit-message-notice"),i.innerHTML='\n\t\t\t<div class="ezuikit-message-notice-content">\n\t\t\t\t<div class="ezuikit-message-custom-content ezuikit-message-'.concat(e,'">\n\t\t\t\t\t<span role="img" aria-label="check-circle" class="ezdicon ezdicon-check-circle">\n\t\t\t\t\t\t').concat("warning"===e?'<svg fill="currentColor" t="1691567271942" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="1em" height="1em"><path d="M512 64a448 448 0 1 0 0 896A448 448 0 0 0 512 64z m-32 232c0-4.416 3.584-8 8-8h48c4.416 0 8 3.584 8 8v272A8 8 0 0 1 536 576h-48a8 8 0 0 1-8-8v-272zM512 736A48 48 0 1 1 512 640a48 48 0 0 1 0 96z"></path></svg>':"","\n\t\t\t\t\t\t").concat("info"===e?'<svg fill="currentColor" t="1691567317943" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="1em" height="1em"><path d="M512 64a448 448 0 1 0 0 896A448 448 0 0 0 512 64z m32 664a8 8 0 0 1-8 8h-48a8 8 0 0 1-8-8v-272c0-4.416 3.584-8 8-8h48c4.416 0 8 3.584 8 8v272zM512 384a48 48 0 1 1 0-96A48 48 0 0 1 512 384z"></path></svg>':"","\n\t\t\t\t\t\t").concat("error"===e?'<svg fill="currentColor" t="1691567308585" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="1em" height="1em"><path d="M512 64a448 448 0 1 0 0 896A448 448 0 0 0 512 64z m165.376 618.24l-65.92-0.32L512 563.392l-99.328 118.4-66.048 0.32a7.936 7.936 0 0 1-8-8c0-1.92 0.64-3.712 1.92-5.184L470.528 513.92 340.48 359.04a8 8 0 0 1 6.08-13.184l66.112 0.256L512 464.576l99.328-118.4 65.92-0.256c4.48 0 8.064 3.456 8.064 8a8.32 8.32 0 0 1-1.92 5.12l-129.92 154.944 130.048 155.008a8 8 0 0 1-6.08 13.184z"></path></svg>':"","\n\t\t\t\t\t\t").concat("success"===e?'<svg fill="currentColor" viewBox="64 64 896 896" focusable="false" data-icon="check-circle" width="1em" height="1em" aria-hidden="true"><path d="M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm193.5 301.7l-210.6 292a31.8 31.8 0 01-51.7 0L318.5 484.9c-3.8-5.3 0-12.7 6.5-12.7h46.9c10.2 0 19.9 4.9 25.9 13.3l71.2 98.8 157.2-218c6-8.3 15.6-13.3 25.9-13.3H699c6.5 0 10.3 7.4 6.5 12.7z"></path></svg>':"","\n\t\t\t\t\t</span>\n\t\t\t\t\t<span>").concat(t,"</span>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t"),n.appendChild(i)}}])}(),ft=function(){return m((function e(t){l(this,e),this.params=f(f({},{id:"",width:"100%",height:"100%",preview:!0,showIcon:!0,src:"",alt:"",fallback:"https://img.ys7.com/group32/M00/81/9D/CtxIA2HnrGyADm_jAAAFfWjIDJs811.png"}),t),this.id=Math.random().toString(36).substr(2),this.init()}),[{key:"init",value:function(){var e=this.params,t=e.id,n=e.width,i=e.height,o=e.preview;if(document.getElementById(t)){var a=document.createElement("div");a.setAttribute("class","ezuikit-image"),a.setAttribute("style","width:".concat(n,";height:").concat(i,";")),document.getElementById(t).appendChild(a),this.initImage(a),o&&this.initPreview(a)}}},{key:"previewImg",value:function(){var e=this.params,t=e.src,n=e.alt,i=e.fallback,o=document.createElement("div");o.setAttribute("id",this.id+"-preview"),o.setAttribute("class","ezuikit-image-preview"),o.innerHTML='\n\t\t\t<div class="ezuikit-image-preview-mask"></div>\n\t\t\t<div class="ezuikit-image-preview-img-wrapper">\n\t\t\t\t<div class="ezuikit-image-preview-operations" id="'.concat(this.id,'-ezuikit-image-preview-operations">\n\t\t\t\t\t<div class="ezuikit-image-preview-operations-operation">\n\t\t\t\t\t\t<span role="img" aria-label="close" class="anticon anticon-close ezuikit-image-preview-operations-icon">\n\t\t\t\t\t\t\t<svg viewBox="64 64 896 896" focusable="false" data-icon="close" width="1em" height="1em" fill="currentColor" aria-hidden="true"><path d="M563.8 512l262.5-312.9c4.4-5.2.7-13.1-6.1-13.1h-79.8c-4.7 0-9.2 2.1-12.3 5.7L511.6 449.8 295.1 191.7c-3-3.6-7.5-5.7-12.3-5.7H203c-6.8 0-10.5 7.9-6.1 13.1L459.4 512 196.9 824.9A7.95 7.95 0 00203 838h79.8c4.7 0 9.2-2.1 12.3-5.7l216.5-258.1 216.5 258.1c3 3.6 7.5 5.7 12.3 5.7h79.8c6.8 0 10.5-7.9 6.1-13.1L563.8 512z"></path></svg>\n\t\t\t\t\t\t</span>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t\t<div class="ezuikit-image-preview-wrap">\n\t\t\t\t\t<div class="ezuikit-image-preview-img-main"></div>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t');var a=document.createElement("img");a.setAttribute("class","ezuikit-image-preview-img"),a.setAttribute("alt",n),a.setAttribute("src",t),a.addEventListener("error",(function(){a.setAttribute("src",i)})),document.body.appendChild(o),o.querySelector(".ezuikit-image-preview-img-main").appendChild(a),document.getElementById(this.id+"-ezuikit-image-preview-operations").addEventListener("click",(function(){document.body.removeChild(o)}))}},{key:"initImage",value:function(e){var t=this.params,n=t.src,i=t.alt,o=t.fallback,a=document.createElement("img");a.setAttribute("class","ezuikit-image-img"),a.setAttribute("alt",i),a.setAttribute("src",n),a.addEventListener("error",(function(){a.setAttribute("src",o)})),e.appendChild(a)}},{key:"initPreview",value:function(e){var t=this,n=this.params.showIcon,i=document.createElement("div");i.setAttribute("class","ezuikit-image-mask"),n&&(i.innerHTML='\n\t\t\t\t<div class="ezuikit-image-mask-info">\n\t\t\t\t\t<span class="ezuikit-image-anticon-eye">\n\t\t\t\t\t\t<svg viewBox="64 64 896 896" focusable="false" data-icon="eye" width="1em" height="1em" aria-hidden="true"><path d="M942.2 486.2C847.4 286.5 704.1 186 512 186c-192.2 0-335.4 100.5-430.2 300.3a60.3 60.3 0 000 51.5C176.6 737.5 319.9 838 512 838c192.2 0 335.4-100.5 430.2-300.3 7.7-16.2 7.7-35 0-51.5zM512 766c-161.3 0-279.4-81.8-362.7-254C232.6 339.8 350.7 258 512 258c161.3 0 279.4 81.8 362.7 254C791.5 684.2 673.4 766 512 766zm-4-430c-97.2 0-176 78.8-176 176s78.8 176 176 176 176-78.8 176-176-78.8-176-176-176zm0 288c-61.9 0-112-50.1-112-112s50.1-112 112-112 112 50.1 112 112-50.1 112-112 112z"></path></svg>\n\t\t\t\t\t\t预览\n\t\t\t\t\t</span>\n\t\t\t\t</div>\n\t\t\t\t'),e.appendChild(i),e.onclick=function(){t.previewImg()}}}])}(),vt=function(){return m((function e(t){l(this,e),this.params=f(f({},{id:"",parentNodeId:"",title:"",content:"",placement:"top",cancelText:"取消",arrowPointAtCenter:!1,okText:"确定",onCancel:function(){},onConfirm:function(){}}),t),this.initState=!1,this.init(t)}),[{key:"init",value:function(){var e=this,t=this.params,n=t.id,i=t.content,o=t.placement,a=t.title,r=document.getElementById(n);if(r){var s=document.createElement("div");if(s.setAttribute("id",n+"-popover"),s.setAttribute("class","ezuikit-popover"),s.setAttribute("style","display:none;"),s.innerHTML='\n\t\t\t\t\t<div class="ezuikit-popover-arrow">\n\t\t\t\t\t\t<span class="ezuikit-popover-arrow-content"></span>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class="ezuikit-popover-inner">\n\t\t\t\t\t\t'.concat(a?'<div class="ezuikit-popover-title">'.concat(a,"</div>"):"",'\n\t\t\t\t\t\t<div class="ezuikit-popover-inner-content">').concat(i,"</div>\n\t\t\t\t\t</div>\n\t\t\t\t"),!document.getElementById(n+"-popover")){var c=document.body;this.params.parentNodeId&&(c=document.getElementById(this.params.parentNodeId)),c.appendChild(s),this.renderPopover(s,r,o)}document.body.addEventListener("click",(function(t){e.addEventListenerFn(t)}))}}},{key:"addEventListenerFn",value:function(e){var t=this.params.id,n=document.getElementById(t),i=document.getElementById(t+"-popover");n&&e.target!==n&&!n.contains(e.target)&&i&&e.target!==i&&!i.contains(e.target)&&this.hidePopover()}},{key:"hidePopover",value:function(){var e=this.params.id,t=document.getElementById(e+"-popover");t&&document.body.removeChild(t)}},{key:"renderPopover",value:function(e,t,n,i,o){e.style.display="block";var a=t.getBoundingClientRect(),r=a.top,s=a.left,c=a.width,l=a.height,d=e.getBoundingClientRect(),u=d.width,m=d.height;i&&(u=i),o&&(m=o);var h=document.body;this.params.parentNodeId&&(h=document.getElementById(this.params.parentNodeId));var p=this.params.arrowPointAtCenter,g=0,f=0,v=e.getElementsByClassName("ezuikit-popover-arrow")[0],y=v.getBoundingClientRect(),S=y.width,_=y.height;if(p){var b=0,w=0;switch(n){case"top":default:b=u/2,w=m;break;case"bottom":b=u/2,w=0;break;case"left":b=u,w=m/2;break;case"right":b=0,w=m/2;break;case"topLeft":b=(c-S)/2,w=m;break;case"topRight":b=u-(c+S)/2,w=m;break;case"bottomLeft":b=(c-S)/2,w=0;break;case"bottomRight":b=u-(c+S)/2,w=0;break;case"leftTop":b=u,w=(l-_)/2;break;case"leftBottom":b=u,w=m-(l+_)/2;break;case"rightTop":b=0,w=(l-10)/2;break;case"rightBottom":b=0,w=m-(l+_)/2}v.style.left=b+"px",v.style.top=w+"px"}switch(n){case"top":g=-(m+_),f=(c-u)/2,e.setAttribute("class","ezuikit-popover ezuikit-popover-placement-top");break;case"bottom":g=l-_/2,f=(c-u)/2,e.setAttribute("class","ezuikit-popover ezuikit-popover-placement-bottom");break;case"left":g=(l-m)/2,f=-(u+S/2),e.setAttribute("class","ezuikit-popover ezuikit-popover-placement-left");break;case"right":g=(l-m)/2,f=c-S/2,e.setAttribute("class","ezuikit-popover ezuikit-popover-placement-right");break;case"topLeft":g=-(m+_),f=0,e.setAttribute("class","ezuikit-popover ezuikit-popover-placement-topLeft");break;case"topRight":g=-(m+_),f=c-u,e.setAttribute("class","ezuikit-popover ezuikit-popover-placement-topRight");break;case"bottomLeft":g=l-_/2,f=0,e.setAttribute("class","ezuikit-popover ezuikit-popover-placement-bottomLeft");break;case"bottomRight":g=l-_/2,f=c-u,e.setAttribute("class","ezuikit-popover ezuikit-popover-placement-bottomRight");break;case"leftTop":g=0,f=-(u+S/2),e.setAttribute("class","ezuikit-popover ezuikit-popover-placement-leftTop");break;case"leftBottom":g=l-m,f=-(u+S/2),e.setAttribute("class","ezuikit-popover ezuikit-popover-placement-leftBottom");break;case"rightTop":g=0,f=c-S/2,e.setAttribute("class","ezuikit-popover ezuikit-popover-placement-rightTop");break;case"rightBottom":g=l-m,f=c-S/2,e.setAttribute("class","ezuikit-popover ezuikit-popover-placement-rightBottom");break;default:g=-m,f=(c-u)/2,e.setAttribute("class","ezuikit-popover ezuikit-popover-placement-top")}var T=document.documentElement.scrollTop||document.body.scrollTop,E=document.documentElement.scrollLeft||document.body.scrollLeft;e.style.top=r+T+g+"px",e.style.left=s+E+f+"px";var P=e.getBoundingClientRect(),k=h===document.body?{left:0,top:0,right:window.innerWidth,bottom:window.innerHeight}:h.getBoundingClientRect(),C=n;P.left<k.left&&(C=(C=C.replace("Right","Left")).replace("right","left")),P.right>k.right&&(C=(C=C.replace("Left","Right")).replace("left","right")),P.top<k.top&&(C=(C=C.replace("Top","Bottom")).replace("top","bottom")),P.bottom>k.bottom&&(C=(C=C.replace("Bottom","Top")).replace("bottom","top")),C!==n&&this.renderPopover(e,t,C,u,m)}}])}(),yt=function(){return m((function e(t){l(this,e),this.params=f(f({},{id:"",content:"",placement:"top",cancelText:"取消",arrowPointAtCenter:!1,okText:"确定",onCancel:function(){},onConfirm:function(){}}),t),this.PopconfirmDom=null,this.init(t)}),[{key:"init",value:function(){var e=this,t=this.params,n=t.content,i=t.cancelText,o=t.okText,a=t.onCancel,r=t.onConfirm,s=document.createElement("div");s.innerHTML='\n <div class="ezuikit-confirm">\n <div class="ezuikit-confirm-content">\n\t\t\t\t\t<span class="ezuikit-confirm-icon">\n \t<svg fill="currentColor" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="24" height="24"><path d="M512 64a448 448 0 1 0 0 896A448 448 0 0 0 512 64z m-32 232c0-4.416 3.584-8 8-8h48c4.416 0 8 3.584 8 8v272A8 8 0 0 1 536 576h-48a8 8 0 0 1-8-8v-272zM512 736A48 48 0 1 1 512 640a48 48 0 0 1 0 96z"></path></svg>\n </span>\n\t\t\t\t\t<span class="ezuikit-confirm-content-label">'.concat(n,'</span>\n </div>\n <div class="ezuikit-popover-buttons"></div>\n </div>\n ');var c=document.createElement("button");c.className="ezuikit-btn ezuikit-cancel-btn",c.innerText=i;var l=document.createElement("button");return l.className="ezuikit-btn ezuikit-ok-btn ezuikit-btn-primary",l.innerText=o,s.querySelector(".ezuikit-popover-buttons").appendChild(c),s.querySelector(".ezuikit-popover-buttons").appendChild(l),this.PopconfirmDom=new vt(f(f({},this.params),{},{content:s.innerHTML})),document.getElementById("".concat(this.params.id,"-popover")).querySelector(".ezuikit-cancel-btn")&&(document.getElementById("".concat(this.params.id,"-popover")).querySelector(".ezuikit-cancel-btn").onclick=function(){a?a():e.hide()}),document.getElementById("".concat(this.params.id,"-popover")).querySelector(".ezuikit-ok-btn")&&(document.getElementById("".concat(this.params.id,"-popover")).querySelector(".ezuikit-ok-btn").onclick=function(){r?r():e.hide()}),this.PopconfirmDom}},{key:"hide",value:function(){this.PopconfirmDom.hidePopover()}}])}(),St=function(){return m((function e(t){l(this,e),this.params=f(f({},{id:"",width:"100%",height:"100%",preview:!0,poster:"",fallback:"https://img.ys7.com/group32/M00/81/9D/CtxIA2HnrGyADm_jAAAFfWjIDJs811.png",src:""}),t),this.id=Math.random().toString(36).substr(2),this.init()}),[{key:"init",value:function(){var e=this.params,t=e.id,n=e.width,i=e.height,o=e.preview;if(document.getElementById(t)){var a=document.createElement("div");a.setAttribute("class","ezuikit-video"),a.setAttribute("style","width:".concat(n,";height:").concat(i,";")),document.getElementById(t).appendChild(a),this.initVideo(a),o&&this.initPreview(a)}}},{key:"previewVideo",value:function(){var e=this.params.src,t=document.createElement("div");t.setAttribute("id",this.id+"-preview"),t.setAttribute("class","ezuikit-image-video"),t.innerHTML='\n\t\t\t<div class="ezuikit-video-preview-mask"></div>\n\t\t\t<div class="ezuikit-video-preview-img-wrapper">\n\t\t\t\t<div class="ezuikit-video-preview-operations" id="'.concat(this.id,'-ezuikit-video-preview-operations">\n\t\t\t\t\t<div class="ezuikit-video-preview-operations-operation">\n\t\t\t\t\t\t<span role="img" aria-label="close" class="anticon anticon-close ezuikit-video-preview-operations-icon">\n\t\t\t\t\t\t\t<svg viewBox="64 64 896 896" focusable="false" data-icon="close" width="1em" height="1em" fill="currentColor" aria-hidden="true"><path d="M563.8 512l262.5-312.9c4.4-5.2.7-13.1-6.1-13.1h-79.8c-4.7 0-9.2 2.1-12.3 5.7L511.6 449.8 295.1 191.7c-3-3.6-7.5-5.7-12.3-5.7H203c-6.8 0-10.5 7.9-6.1 13.1L459.4 512 196.9 824.9A7.95 7.95 0 00203 838h79.8c4.7 0 9.2-2.1 12.3-5.7l216.5-258.1 216.5 258.1c3 3.6 7.5 5.7 12.3 5.7h79.8c6.8 0 10.5-7.9 6.1-13.1L563.8 512z"></path></svg>\n\t\t\t\t\t\t</span>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t\t<div class="ezuikit-video-preview-wrap">\n\t\t\t\t\t<div class="ezuikit-video-preview-img-wrapper">\n\t\t\t\t\t\t<video\n\t\t\t\t\t\t\tclass="ezuikit-video-preview-img custom-controls"\n\t\t\t\t\t\t\tsrc="').concat(e,'"\n\t\t\t\t\t\t\tautoplay \n\t\t\t\t\t\t\tcontrols \n\t\t\t\t\t\t\tcontrolslist="nodownload noremoteplayback noplaybackrate"\n\t\t\t\t\t\t\tdisablePictureInPicture\n\t\t\t\t\t\t\tdisableRemotePlayback\n\t\t\t\t\t\t/>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t'),document.body.appendChild(t),document.getElementById(this.id+"-ezuikit-video-preview-operations").addEventListener("click",(function(){document.body.removeChild(t)}))}},{key:"initVideo",value:function(e){var t=this.params,n=t.poster,i=t.fallback,o=document.createElement("img");o.setAttribute("class","ezuikit-video-img"),o.setAttribute("src",n),o.addEventListener("error",(function(){o.setAttribute("src",i)})),e.appendChild(o)}},{key:"initPreview",value:function(e){var t=this,n=document.createElement("div");n.setAttribute("class","ezuikit-video-mask"),n.innerHTML='\n\t\t\t<div class="ezuikit-video-mask-info">\n\t\t\t\t<span class="ezuikit-video-anticon-eye">\n\t\t\t\t\t<svg width="28" height="28" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 28 28" style="enable-background:new 0 0 28 28;" xml:space="preserve">\n\t\t\t\t\t<circle cx="14" cy="14" r="14" style="opacity:0.7;fill-rule:evenodd;clip-rule:evenodd;enable-background:new;"/>\n\t\t\t\t\t<path style="fill-rule:evenodd;clip-rule:evenodd;fill:#FFFFFF;" d="M18.3,15.2l-5.3,3.3c-0.7,0.4-1.6,0.2-2.1-0.5c-0.1-0.2-0.2-0.5-0.2-0.8v-6.6\n\t\t\t\t\t\tc0-0.8,0.7-1.5,1.5-1.5c0.3,0,0.6,0.1,0.8,0.2l5.3,3.3c0.7,0.4,0.9,1.4,0.5,2.1C18.6,14.9,18.4,15,18.3,15.2z"/>\n\t\t\t\t\t</svg>\n\t\t\t\t</span>\n\t\t\t</div>\n\t\t\t',e.appendChild(n),e.onclick=function(){t.previewVideo()}}}])}(),_t=function(e,t,n,i){var o={accessToken:e.accessToken||e.token.httpToken.url,inspectRecordId:t,page:0},a="".concat(e.env.domain,"/api/service/devicekit/bodycamera/device/trace");Ye(a,"GET",o,(function(e){n&&n(e)}),(function(e){i&&i(e)}),{"Content-Type":"application/x-www-form-urlencoded"})},bt=function(e,t,n,i){var o={accessToken:e.accessToken||e.token.deviceToken.video,deviceSerial:A(e.url).deviceSerial,validateCode:A(e.url).validCode,channelNo:A(e.url).channelNo,evidenceFileType:t},a="".concat(e.env.domain,"/api/service/devicekit/common/file/evidence");Ye(a,"POST",o,(function(e){n&&n(e)}),(function(e){i&&i(e)}),{"Content-Type":"application/x-www-form-urlencoded"})},wt=function(e,t,n,i){var o={accessToken:e.accessToken||e.token.httpToken.url,taskId:t},a="".concat(e.env.domain,"/api/service/devicekit/opencloud/task/info");Ye(a,"GET",o,(function(e){n&&n(e)}),(function(e){i&&i(e)}),{"Content-Type":"application/x-www-form-urlencoded"})};var Tt=function(){return m((function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2?arguments[2]:void 0,o=arguments.length>3?arguments[3]:void 0,a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:function(){};l(this,e),this.jSPlugin=t,this.currentEventInfo=n,this.inspectInfo=t.Theme.inspect.inspectInfo,this.type=o,this.timer=i,this.startTime=1e3,this.videoRecordingStatus=!0,this.saveSuccessCallback=a,this.init()}),[{key:"init",value:function(){this.renderEventDetail(),this.eventDetailDomEvent()}},{key:"show",value:function(){document.getElementById("".concat(this.jSPlugin.id,"-inspect-event-detail-wrap")).setAttribute("class","inspect-event-detail-wrap show")}},{key:"hide",value:function(){document.getElementById("".concat(this.jSPlugin.id,"-inspect-event-detail-wrap")).setAttribute("class","inspect-event-detail-wrap"),document.getElementById("".concat(this.jSPlugin.id,"-inspect-event-detail-box")).innerHTML=""}},{key:"validationEventTag",value:function(){return 0==document.getElementById("".concat(this.jSPlugin.id,"-event-tag")).value.length?(document.getElementById("".concat(this.jSPlugin.id,"-event-tag-error")).style.display="block",document.getElementById("".concat(this.jSPlugin.id,"-event-tag-error")).innerHTML="请输入事件标签",document.getElementById("".concat(this.jSPlugin.id,"-event-tag")).setAttribute("class","ezuikit-input input-has-error"),!1):(document.getElementById("".concat(this.jSPlugin.id,"-event-tag-error")).style.display="none",document.getElementById("".concat(this.jSPlugin.id,"-event-tag")).setAttribute("class","ezuikit-input"),!0)}},{key:"renderVideo",value:function(e,t,n){var i=this;if(document.getElementById("".concat(this.jSPlugin.id,"-inspectEventDetail-videoPreview")).innerHTML="",1===e||2===e){if(document.getElementById("".concat(this.jSPlugin.id,"-inspectEventDetail-videoPreview")).innerHTML='\n <div class="video-stroage-exceptional-status-tips-wrap" style="background:url('.concat(this.jSPlugin.staticPath,'/imgs/bg.svg) no-repeat 100%/cover">\n <div class="video-stroage-exceptional-status-icon">\n <div type="default" class="ezuikit-spin ezuikit-spin-sm ezuikit-spin-spinning ezuikit-spin-dot-white"><span class="ezuikit-spin-dot ezuikit-spin-dot-spin ezuikit-spin-dot-default"><i class="ezuikit-spin-dot-item"></i><i class="ezuikit-spin-dot-item"></i><i class="ezuikit-spin-dot-item"></i><i class="ezuikit-spin-dot-item"></i></span></div>\n </div>\n <span class="video-stroage-exceptional-status-tips">视频正在存储中…</span>\n </div>\n '),1!==this.type){var o=this.currentEventInfo.evidenceId;this.timer.clearTimer("videoRecordingStatusTimer"),this.timer.createInterval("videoRecordingStatusTimer",(function(){wt(i.jSPlugin,o,(function(e){if(e.meta&&200===e.meta.code){var t=e.data,n=t.taskStatus,o=t.fileUrl,a=t.videoCoverPic||"".concat(i.jSPlugin.staticPath,"/imgs/bg.svg");i.renderVideo(n,a,o)}}))}),1e3)}}else 4===e||5===e||6===e||7===e?(document.getElementById("".concat(this.jSPlugin.id,"-inspectEventDetail-videoPreview")).innerHTML='\n <div class="video-stroage-exceptional-status-tips-wrap video-stroage-exceptional-status-tips-error" style="background:url('.concat(this.jSPlugin.staticPath,'/imgs/bg.svg) no-repeat 100%/cover">\n <div class="video-stroage-exceptional-status-icon">\n <svg fill="currentColor" t="1691567317943" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="1em" height="1em"><path d="M512 64a448 448 0 1 0 0 896A448 448 0 0 0 512 64z m32 664a8 8 0 0 1-8 8h-48a8 8 0 0 1-8-8v-272c0-4.416 3.584-8 8-8h48c4.416 0 8 3.584 8 8v272zM512 384a48 48 0 1 1 0-96A48 48 0 0 1 512 384z"></path></svg>\n </div>\n <span class="video-stroage-exceptional-status-tips">视频存储失败</span>\n </div>\n '),this.timer.clearTimer("videoRecordingStatusTimer")):0!==e&&3!==e||(new St({id:"".concat(this.jSPlugin.id,"-inspectEventDetail-videoPreview"),poster:t,fallback:"".concat(this.jSPlugin.staticPath,"/imgs/bg.svg"),src:n}),this.timer.clearTimer("videoRecordingStatusTimer"))}},{key:"renderEventDetail",value:function(){var e=this,t=this.currentEventInfo,n=t.evidenceFileType,i=t.fileUrl,o=t.taskStatus,a=t.videoCoverPic,r=document.createElement("div");r.setAttribute("class","inspectEventDetail");var s="";if(s=1===n?a||"".concat(this.jSPlugin.staticPath,"/imgs/bg.svg"):i||"".concat(this.jSPlugin.staticPath,"/imgs/bg.svg"),r.innerHTML='\n <div class="inspectEventDetail-header">\n <div class="inspectEventDetail-back" id="'.concat(this.jSPlugin.id,'-inspectEventDetail-back">\n <svg viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" width="16" height="16" xmlns:xlink="http://www.w3.org/1999/xlink"><path d="M605.888 137.344a6.4 6.4 0 0 1 1.472 4.032l0.64 70.784a6.4 6.4 0 0 1-2.368 5.056L281.6 480H876.8v64H279.744l325.376 264a6.4 6.4 0 0 1 2.368 4.928l0.128 69.632a6.4 6.4 0 0 1-10.432 4.992l-422.016-342.4a42.24 42.24 0 0 1-7.04-57.344l3.264-3.904 3.776-3.456 421.76-344a6.4 6.4 0 0 1 8.96 0.896z"></path></svg>\n </div>\n <div class="inspectEventDetail-type">').concat(1===this.type?"编辑":"").concat(0===n?"图片存证":"视频存证",'</div>\n </div>\n <div class="inspectEventDetail-content" style="\n height: ').concat(document.getElementById("".concat(this.jSPlugin.id,"-wrap")).clientHeight-58-158,'px;\n overflow: auto;\n ">\n ').concat(0===n?'<div class="inspectEventDetail-content-img-box">\n <p class="inspectEventDetail-content-img-tips" style="display: '.concat(1==this.type?"none":"blcok",';">图片已取证,请填写存证信息:</p>\n <div class="inspectEventDetail-content-img-detail" id="').concat(this.jSPlugin.id,'-inspectEventDetail-picUrl"></div>\n </div>'):'<div class="inspectEventDetail-content-video-box">\n <div\n id="'.concat(this.jSPlugin.id,'-inspectEventDetail-content-video-timer"\n class="inspectEventDetail-content-video-timer"\n style="display: ').concat(1==this.type?"none":"flex",';"\n >\n <div class="video-recording-time-wrap">\n <svg fill="currentColor" width="10" height="10" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 10 10" style="enable-background:new 0 0 10 10;" xml:space="preserve"><circle class="st0" cx="5" cy="5" r="3"/><path class="st1" d="M5,10c-2.8,0-5-2.2-5-5c0-2.8,2.2-5,5-5s5,2.2,5,5C10,7.8,7.8,10,5,10z M5,0.5c-2.5,0-4.5,2-4.5,4.5c0,2.5,2,4.5,4.5,4.5s4.5-2,4.5-4.5C9.5,2.5,7.5,0.5,5,0.5z"/></svg>\n <div id="').concat(this.jSPlugin.id,'-video-recording-time" class="video-recording-time">00:00:00</div>\n </div>\n <button id="').concat(this.jSPlugin.id,'-video-recording-stop-btn" class="inspectEventDetail-stop-btn ezuikit-btn">\n <span style="display:none" class="ezuikit-btn-loading-icon" style=""><span role="img" aria-label="loading" class="anticon anticon-loading anticon-spin"><svg viewBox="0 0 1024 1024" focusable="false" data-icon="loading" width="1em" height="1em" fill="currentColor" aria-hidden="true"><path d="M988 548c-19.9 0-36-16.1-36-36 0-59.4-11.6-117-34.6-171.3a440.45 440.45 0 00-94.3-139.9 437.71 437.71 0 00-139.9-94.3C629 83.6 571.4 72 512 72c-19.9 0-36-16.1-36-36s16.1-36 36-36c69.1 0 136.2 13.5 199.3 40.3C772.3 66 827 103 874 150c47 47 83.9 101.8 109.7 162.7 26.7 63.1 40.2 130.2 40.2 199.3.1 19.9-16 36-35.9 36z"></path></svg></span></span>\n 停止录制\n </button>\n </div>\n <div id="').concat(this.jSPlugin.id,'-inspectEventDetail-content-video-info" class="inspectEventDetail-content-video-info" style="display: ').concat(1==this.type?"block":"none",';">\n <p class="inspectEventDetail-content-video-tips" style="display: ').concat(1==this.type?"none":"blcok",';">视频已取证:</p>\n <div class="inspectEventDetail-content-video-detail" id="').concat(this.jSPlugin.id,'-inspectEventDetail-videoPreview"></div>\n </div>\n </div>'),'\n <div class="inspectEventDetail-content-info">\n <div class="inspectEventDetail-content-info-item">\n <div class="inspectEventDetail-content-info-item-title">事件时间:</div>\n <div id="').concat(this.jSPlugin.id,'-inspectEventDetail-content-info-time" class="inspectEventDetail-content-info-item-value"></div>\n </div>\n <div class="inspectEventDetail-content-info-item">\n <div class="inspectEventDetail-content-info-item-title">存证人员:</div>\n <div class="inspectEventDetail-content-info-item-value">\n ').concat(1===this.type?this.currentEventInfo.depositaryOfficer?"null"===this.currentEventInfo.depositaryOfficer?"-":this.currentEventInfo.depositaryOfficer:"-":this.inspectInfo.inspectPerson?"null"===this.inspectInfo.inspectPerson?"-":this.inspectInfo.inspectPerson:"-",'\n </div>\n </div>\n <div class="inspectEventDetail-content-info-item">\n <div class="inspectEventDetail-content-info-item-title inspectEventDetail-content-info-item-title-required">事件标签:</div>\n <div class="ezuikit-form-item-control-input">\n <div class="ezuikit-form-item-control-input-content">\n <input\n id="').concat(this.jSPlugin.id,'-event-tag"\n maxlength="32"\n type="text"\n autocomplete="off"\n id="control-ref_note"\n class="ezuikit-input"\n placeholder="请输入事件标签"\n value="').concat(1===this.type&&this.currentEventInfo.eventType||"",'"\n />\n </div>\n <div class="ezuikit-form-item-explain ezuikit-form-item-explain-connected">\n <div id="').concat(this.jSPlugin.id,'-event-tag-error" class="ezuikit-form-item-explain-error" style="display: none">请输入事件标签</div>\n </div>\n </div>\n </div>\n <div class="inspectEventDetail-content-info-item">\n <div class="inspectEventDetail-content-info-item-title">事件备注:</div>\n <div class="ezuikit-input-textarea ezuikit-input-textarea-show-count" data-count="').concat(1===this.type&&this.currentEventInfo.eventRemark?this.currentEventInfo.eventRemark.length:0,' / 100">\n <textarea\n id="').concat(this.jSPlugin.id,'-event-remark"\n maxlength="100"\n class="ezuikit-input"\n maxlength="100"\n placeholder="请输入事件备注"\n autocomplete="off"\n >').concat(1===this.type&&this.currentEventInfo.eventRemark||"",'</textarea>\n </div>\n </div>\n </div>\n </div>\n <div class="inspectEventDetail-footer">\n <button id="').concat(this.jSPlugin.id,'-event-cancel" class="inspectEventDetail-footer-btn ezuikit-btn">取消</button>\n <button id="').concat(this.jSPlugin.id,'-event-ok" class="inspectEventDetail-footer-btn ezuikit-btn ezuikit-btn-primary">保存</button>\n </div>\n '),document.getElementById("".concat(this.jSPlugin.id,"-inspect-event-detail-box")).appendChild(r),1===this.type?document.getElementById("".concat(this.jSPlugin.id,"-inspectEventDetail-content-info-time")).innerHTML="".concat(1===n?this.currentEventInfo.eventBeginTime+" ~ "+this.currentEventInfo.eventEndTime:this.currentEventInfo.eventTime):(document.getElementById("".concat(this.jSPlugin.id,"-inspectEventDetail-content-info-time")).innerHTML="".concat((new Date).Format("yyyy-MM-dd hh:mm:ss")).concat(1===n?" ~ -":""),1===n&&document.getElementById("".concat(this.jSPlugin.id,"-video-recording-time"))&&this.videoRecordingStatus&&(0===this.type&&document.getElementById("".concat(this.jSPlugin.id,"-event-ok")).setAttribute("disabled","disabled"),this.timer.createInterval("videoRecordingTimer",(function(){var t,n,i,o;e.startTime&&(document.getElementById("".concat(e.jSPlugin.id,"-video-recording-time")).innerHTML=(t=e.startTime,n=parseInt(t%864e5/36e5),i=parseInt(t%36e5/6e4),o=parseInt(t%6e4/1e3),(n<10?"0".concat(n):n)+":"+(i<10?"0".concat(i):i)+":"+(o<10?"0".concat(o):o))),e.startTime+=1e3,e.startTime>e.jSPlugin.inspectRecordingDuration&&(document.getElementById("".concat(e.jSPlugin.id,"-video-recording-stop-btn")).click(),e.timer&&e.timer.clearTimer("videoRecordingTimer"))}),1e3))),1===n){var c=this.currentEventInfo&&this.currentEventInfo.fileUrl;this.renderVideo(o,s,c)}else new ft({id:"".concat(this.jSPlugin.id,"-inspectEventDetail-picUrl"),src:s,fallback:"".concat(this.jSPlugin.staticPath,"/imgs/fallback.svg"),showIcon:!1});this.show()}},{key:"eventDetailDomEvent",value:function(){var e=this,t=this.currentEventInfo,n=t.evidenceFileType,i=t.evidenceId;document.getElementById("".concat(this.jSPlugin.id,"-event-cancel")).addEventListener("click",(function(t){e.cancelPopover=new yt({id:"".concat(e.jSPlugin.id,"-event-cancel"),content:"确定要取消吗?".concat(1===e.type?"取消后编辑的内容将不会保存。":"取消后对应存证也将删除。"),placement:"topRight",arrowPointAtCenter:!0,onCancel:function(){e.cancelPopover.hide()},onConfirm:function(){1===n&&(e.videoRecordingStatus&&0===e.type&&(e.timer&&e.timer.clearTimer("videoRecordingTimer"),e.startTime=1e3,document.getElementById("".concat(e.jSPlugin.id,"-video-recording-stop-btn")).click()),e.timer.clearTimer("videoRecordingStatusTimer")),e.cancelPopover.hide(),e.hide()}})})),document.getElementById("".concat(this.jSPlugin.id,"-event-ok")).addEventListener("click",(function(){if(e.validationEventTag()){var t=e.currentEventInfo,n=t.evidenceFileType,i=t.evidenceId,o=e.inspectInfo,a=o.inspectRecordId,r=o.inspectPerson,s=document.getElementById("".concat(e.jSPlugin.id,"-inspectEventDetail-content-info-time")).innerHTML,c={inspectRecordId:a,depositaryOfficer:r,evidenceFileId:i,evidenceFileType:n,eventType:document.getElementById("".concat(e.jSPlugin.id,"-event-tag")).value,eventRemark:document.getElementById("".concat(e.jSPlugin.id,"-event-remark")).value};1===n&&(c.eventBeginTime=s.split("~")[0].trim(),c.eventEndTime=s.split("~")[1].trim(),e.timer.clearTimer("videoRecordingStatusTimer")),0===n&&(c.eventTime=s),1===e.type&&(c.inspectEventId=e.currentEventInfo.inspectEventId,delete c.depositaryOfficer,delete c.eventTime,delete c.eventBeginTime,delete c.eventEndTime,delete c.evidenceFileId,delete c.evidenceFileType,function(e,t,n,i){var o={accessToken:e.accessToken||e.token.httpToken.url,inspectRecordId:"",inspectEventId:"",eventType:"",eventRemark:""},a=Object.assign(o,t),r="".concat(e.env.domain,"/api/service/devicekit/bodycamera/inspect/event/update");Ye(r,"POST",a,(function(e){n&&n(e)}),(function(e){i&&i(e)}),{"Content-Type":"application/x-www-form-urlencoded"})}(e.jSPlugin,c,(function(t){t.meta&&200===t.meta.code?(e.hide(),e.saveSuccessCallback&&e.saveSuccessCallback({eventType:c.eventType,eventRemark:c.eventRemark})):new gt({type:"error",content:"保存失败,".concat(t.meta&&t.meta.message||"请稍后重试!"),wrapNode:document.getElementById("".concat(e.jSPlugin.id,"-inspect-event-box")),top:40})}),(function(){new gt({type:"error",content:"保存失败,请稍后重试!",wrapNode:document.getElementById("".concat(e.jSPlugin.id,"-inspect-event-box")),top:40})}))),0===e.type&&function(e,t,n,i){var o={accessToken:e.accessToken||e.token.httpToken.url,inspectRecordId:"",eventType:"",evidenceFileId:"",eventTime:"",eventBeginTime:"",eventEndTime:"",depositaryOfficer:"",eventRemark:"",evidenceFileType:""},a=Object.assign(o,t),r="".concat(e.env.domain,"/api/service/devicekit/bodycamera/inspect/event");Ye(r,"POST",a,(function(e){n&&n(e)}),(function(e){i&&i(e)}),{"Content-Type":"application/x-www-form-urlencoded"})}(e.jSPlugin,c,(function(t){t.meta&&200===t.meta.code?(e.hide(),e.saveSuccessCallback&&e.saveSuccessCallback()):new gt({type:"error",content:"保存失败,".concat(t.meta&&t.meta.message||"请稍后重试!"),wrapNode:document.getElementById("".concat(e.jSPlugin.id,"-inspect-event-box")),top:40})}),(function(){new gt({type:"error",content:"保存失败,请稍后重试!",wrapNode:document.getElementById("".concat(e.jSPlugin.id,"-inspect-event-box")),top:40})}))}})),document.getElementById("".concat(this.jSPlugin.id,"-inspectEventDetail-back")).addEventListener("click",(function(){e.backPopover=new yt({id:"".concat(e.jSPlugin.id,"-inspectEventDetail-back"),content:"确定要返回吗?".concat(1===e.type?"返回后编辑的内容将不会保存。":"返回后对应存证也将删除。"),placement:"bottomRight",arrowPointAtCenter:!0,onCancel:function(){e.backPopover.hide()},onConfirm:function(){1===n&&(e.videoRecordingStatus&&0===e.type&&(e.timer&&e.timer.clearTimer("videoRecordingTimer"),e.startTime=1e3,document.getElementById("".concat(e.jSPlugin.id,"-video-recording-stop-btn")).click()),e.timer.clearTimer("videoRecordingStatusTimer")),e.backPopover.hide(),e.hide()}})})),document.getElementById("".concat(this.jSPlugin.id,"-video-recording-stop-btn"))&&document.getElementById("".concat(this.jSPlugin.id,"-video-recording-stop-btn")).addEventListener("click",(function(){document.getElementById("".concat(e.jSPlugin.id,"-video-recording-stop-btn")).setAttribute("class","inspectEventDetail-stop-btn ezuikit-btn ezuikit-btn-loading"),document.getElementById("".concat(e.jSPlugin.id,"-video-recording-stop-btn")).querySelector(".ezuikit-btn-loading-icon").style.display="inline-block",function(e,t,n,i){var o={accessToken:e.accessToken||e.token.httpToken.url,taskId:t},a="".concat(e.env.domain,"/api/v3/open/cloud/video/frame/stop");Ye(a,"POST",o,(function(e){n&&n(e)}),(function(e){i&&i(e)}),{"Content-Type":"application/x-www-form-urlencoded"})}(e.jSPlugin,i,(function(t){document.getElementById("".concat(e.jSPlugin.id,"-video-recording-stop-btn"))&&(document.getElementById("".concat(e.jSPlugin.id,"-video-recording-stop-btn")).setAttribute("class","inspectEventDetail-stop-btn ezuikit-btn"),document.getElementById("".concat(e.jSPlugin.id,"-video-recording-stop-btn")).querySelector(".ezuikit-btn-loading-icon").style.display="none"),t.meta&&200===t.meta.code?wt(e.jSPlugin,i,(function(t){if(t.meta&&200===t.meta.code){var n=t.data,i=n.taskStatus,o=n.fileUrl,a=n.videoCoverPic;e.timer&&e.timer.clearTimer("videoRecordingTimer");var r=a||"".concat(e.jSPlugin.staticPath,"/imgs/bg.svg");e.renderVideo(i,r,o),document.getElementById("".concat(e.jSPlugin.id,"-inspectEventDetail-content-video-info")).style.display="block",document.getElementById("".concat(e.jSPlugin.id,"-inspectEventDetail-content-video-timer")).style.display="none";var s=document.getElementById("".concat(e.jSPlugin.id,"-inspectEventDetail-content-info-time")).innerHTML;document.getElementById("".concat(e.jSPlugin.id,"-inspectEventDetail-content-info-time")).innerHTML="".concat(s.split("~")[0]," ~ ").concat((new Date).Format("yyyy-MM-dd hh:mm:ss")),e.videoRecordingStatus=!1,document.getElementById("".concat(e.jSPlugin.id,"-event-ok")).removeAttribute("disabled")}})):new gt({type:"error",content:"停止录制失败,请稍后重试!",wrapNode:document.getElementById("".concat(e.jSPlugin.id,"-inspect-event-box")),top:40})}),(function(){document.getElementById("".concat(e.jSPlugin.id,"-video-recording-stop-btn"))&&(document.getElementById("".concat(e.jSPlugin.id,"-video-recording-stop-btn")).setAttribute("class","inspectEventDetail-stop-btn ezuikit-btn"),document.getElementById("".concat(e.jSPlugin.id,"-video-recording-stop-btn")).querySelector(".ezuikit-btn-loading-icon").style.display="none"),new gt({type:"error",content:"停止录制失败,请稍后重试!",wrapNode:document.getElementById("".concat(e.jSPlugin.id,"-inspect-event-box")),top:40})}))})),document.getElementById("".concat(this.jSPlugin.id,"-event-tag")).addEventListener("input",(function(){e.validationEventTag()})),document.getElementById("".concat(this.jSPlugin.id,"-event-remark")).addEventListener("input",(function(e){var t=e.target.value;e.target.parentNode.setAttribute("data-count","".concat(t.length," / 100"))})),document.getElementById("".concat(this.jSPlugin.id,"-event-remark")).addEventListener("focus",(function(e){e.target.parentNode.setAttribute("class","ezuikit-input-textarea ezuikit-input-textarea-show-count ezuikit-input-textarea-focus")})),document.getElementById("".concat(this.jSPlugin.id,"-event-remark")).addEventListener("blur",(function(e){e.target.parentNode.setAttribute("class","ezuikit-input-textarea ezuikit-input-textarea-show-count")}))}}])}(),Et=function(){return m((function e(t,n,i){var o=this;l(this,e),p(this,"hideDelEConfirm",(function(){for(var e=0;e<o.delEConfirmList.length;e++)o.delEConfirmList[e].hide()})),p(this,"initRender",(function(){var e=o;if(document.getElementById("".concat(o.jSPlugin.id,"-inspect-event-box")))document.getElementById("".concat(o.jSPlugin.id,"-inspect-event-box"))&&document.getElementById("".concat(o.jSPlugin.id,"-wrap")).removeChild(document.getElementById("".concat(o.jSPlugin.id,"-inspect-event-box"))),e.initRender();else{var t=document.createElement("div");t.id="".concat(o.jSPlugin.id,"-inspect-event-box"),t.setAttribute("class","inspect-event-box");var n=0;document.getElementById("".concat(o.jSPlugin.id,"-inspectInfoControl"))&&(n=document.getElementById("".concat(o.jSPlugin.id,"-inspectInfoControl")).clientHeight),t.style="background: #fff;position: absolute;right: 0;bottom: 0; top:".concat(n,"px;"),t.innerHTML='\n <div id="'.concat(o.jSPlugin.id,'-inspect-event-list-box" style="\n width: 290px;\n height: 100%;\n overflow: hidden;\n padding: 0;\n box-sizing: border-box;\n ">\n <h1 style="\n font-size: 16px;\n color: #262626;\n line-height: 24px;\n font-weight: bold;\n margin: 16px 16px 0;\n ">巡检事件</h1>\n <div id="').concat(o.jSPlugin.id,'-inspect-event-btn-wrap" style="\n display: flex;\n align-items: center;\n justify-content: space-between;\n padding: 16px 16px;\n ">\n <div>\n <button\n id="').concat(o.jSPlugin.id,'-inspect-event-img"\n style="min-width: 88px; margin: 0 auto;"\n type="button"\n class="ezuikit-btn ezuikit-btn-primary"\n >\n <span style="display:none" class="ezuikit-btn-loading-icon" style=""><span role="img" aria-label="loading" class="anticon anticon-loading anticon-spin"><svg viewBox="0 0 1024 1024" focusable="false" data-icon="loading" width="1em" height="1em" fill="currentColor" aria-hidden="true"><path d="M988 548c-19.9 0-36-16.1-36-36 0-59.4-11.6-117-34.6-171.3a440.45 440.45 0 00-94.3-139.9 437.71 437.71 0 00-139.9-94.3C629 83.6 571.4 72 512 72c-19.9 0-36-16.1-36-36s16.1-36 36-36c69.1 0 136.2 13.5 199.3 40.3C772.3 66 827 103 874 150c47 47 83.9 101.8 109.7 162.7 26.7 63.1 40.2 130.2 40.2 199.3.1 19.9-16 36-35.9 36z"></path></svg></span></span>\n 图片存证\n </button>\n <button\n id="').concat(o.jSPlugin.id,'-inspect-event-video"\n style="min-width: 88px; margin: 0 auto;"\n type="button"\n class="ezuikit-btn ezuikit-btn-primary"\n >\n <span style="display:none" class="ezuikit-btn-loading-icon" style=""><span role="img" aria-label="loading" class="anticon anticon-loading anticon-spin"><svg viewBox="0 0 1024 1024" focusable="false" data-icon="loading" width="1em" height="1em" fill="currentColor" aria-hidden="true"><path d="M988 548c-19.9 0-36-16.1-36-36 0-59.4-11.6-117-34.6-171.3a440.45 440.45 0 00-94.3-139.9 437.71 437.71 0 00-139.9-94.3C629 83.6 571.4 72 512 72c-19.9 0-36-16.1-36-36s16.1-36 36-36c69.1 0 136.2 13.5 199.3 40.3C772.3 66 827 103 874 150c47 47 83.9 101.8 109.7 162.7 26.7 63.1 40.2 130.2 40.2 199.3.1 19.9-16 36-35.9 36z"></path></svg></span></span>\n 视频存证</button>\n </div>\n <div id="').concat(o.jSPlugin.id,'-inspect-event-list-refresh" style="\n width: 17px;\n height: 32px;\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: center;\n ">\n <svg viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" width="13" height="13" xmlns:xlink="http://www.w3.org/1999/xlink">\n <path fill="currentColor" d="M960 416V192l-73.056 73.056a447.712 447.712 0 0 0-373.6-201.088C265.92 63.968 65.312 264.544 65.312 512S265.92 960.032 513.344 960.032a448.064 448.064 0 0 0 415.232-279.488 38.368 38.368 0 1 0-71.136-28.896 371.36 371.36 0 0 1-344.096 231.584C308.32 883.232 142.112 717.024 142.112 512S308.32 140.768 513.344 140.768c132.448 0 251.936 70.08 318.016 179.84L736 416h224z"></path>\n </svg>\n </div>\n </div>\n <div\n id="').concat(o.jSPlugin.id,'-inspect-loading"\n class="inspect-loading"\n style="\n height: calc(100% - 104px);\n position: absolute; bottom: 0; right: 0;background: #fff; bottom: 0; right: 0; z-index: 99; width: 100%; align-items: center; justify-content: center;\n display: ').concat(o.listLoading?"flex":"none",'\n ">\n <div type="default" class="ezuikit-spin ezuikit-spin-spinning"><span class="ezuikit-spin-dot ezuikit-spin-dot-spin ezuikit-spin-dot-default"><i class="ezuikit-spin-dot-item"></i><i class="ezuikit-spin-dot-item"></i><i class="ezuikit-spin-dot-item"></i><i class="ezuikit-spin-dot-item"></i></span></div>\n </div>\n <div id="').concat(o.jSPlugin.id,'-inspect-event-list-nodata-wrap" style="\n display: none;\n height: calc(100% - 104px);\n text-align: center;overflow: auto;\n "> \n <img style="width: 85px;height: 85px; margin: 120px auto 0;" src="').concat(o.jSPlugin.staticPath,'/imgs/empty.png" />\n <p style="font-size: 14px;color: #595959;text-align: center;line-height: 22px;margin: 0;">暂无事件</p>\n </div>\n <div class="inspect-event-list-wrap" id="').concat(o.jSPlugin.id,'-inspect-event-list-wrap"\n style="display: none; height: calc(100% - 104px); overflow-x: hidden; overflow-y: auto; padding-top: 4px; box-sizing: border-box; ">\n <div id="').concat(o.jSPlugin.id,'-inspect-event-list-wrap-main"></div>\n <div id="').concat(o.jSPlugin.id,'-inspect-event-list-more-loading" style="display: none;align-items: center;justify-content: center;" class="inspect-event-list-more-loading">\n <div type="default" class="ezuikit-spin ezuikit-spin-spinning"><span class="ezuikit-spin-dot ezuikit-spin-dot-spin ezuikit-spin-dot-default"><i class="ezuikit-spin-dot-item"></i><i class="ezuikit-spin-dot-item"></i><i class="ezuikit-spin-dot-item"></i><i class="ezuikit-spin-dot-item"></i></span></div>\n </div>\n </div>\n </div>\n <div id="').concat(o.jSPlugin.id,'-inspect-event-detail-wrap" class="inspect-event-detail-wrap" style="\n height: 100%;\n ">\n <h1 style="\n font-size: 16px;\n color: #262626;\n line-height: 24px;\n font-weight: bold;\n margin: 16px 16px 0;\n ">巡检事件</h1>\n <div id="').concat(o.jSPlugin.id,'-inspect-event-detail-box"></div>\n </div>\n '),document.getElementById("".concat(o.jSPlugin.id,"-wrap")).appendChild(t),o.jSPlugin.Theme.decoderState.state.play?o.enableEvidenceBtn():o.disableEvidenceBtn(),document.getElementById("".concat(o.jSPlugin.id,"-inspect-event-img")).onclick=function(){o.listLoading||o.startEvidence||(o.startEvidence=!0,o.hideDelEConfirm(),document.getElementById("".concat(o.jSPlugin.id,"-inspect-event-img")).setAttribute("class","ezuikit-btn ezuikit-btn-primary ezuikit-btn-loading"),document.getElementById("".concat(o.jSPlugin.id,"-inspect-event-img")).querySelector(".ezuikit-btn-loading-icon").style.display="inline-block",bt(o.jSPlugin,0,(function(e){o.startEvidence=!1,document.getElementById("".concat(o.jSPlugin.id,"-inspect-event-img")).setAttribute("class","ezuikit-btn ezuikit-btn-primary"),document.getElementById("".concat(o.jSPlugin.id,"-inspect-event-img")).querySelector(".ezuikit-btn-loading-icon").style.display="none",e.meta&&200===e.meta.code?new Tt(o.jSPlugin,e.data,o.timer,0,(function(){o.initEvent(),new gt({type:"success",content:"保存成功",wrapNode:document.getElementById("".concat(o.jSPlugin.id,"-inspect-event-box")),top:40})})):new gt({type:"error",content:"图片存证失败,".concat(e.meta&&e.meta.message||"请稍后重试!"),wrapNode:document.getElementById("".concat(o.jSPlugin.id,"-inspect-event-box")),top:40})}),(function(){o.startEvidence=!1,document.getElementById("".concat(o.jSPlugin.id,"-inspect-event-img")).setAttribute("class","ezuikit-btn ezuikit-btn-primary"),document.getElementById("".concat(o.jSPlugin.id,"-inspect-event-img")).querySelector(".ezuikit-btn-loading-icon").style.display="none",new gt({type:"error",content:"图片存证失败,请稍后重试!",wrapNode:document.getElementById("".concat(o.jSPlugin.id,"-inspect-event-box")),top:40})})))},document.getElementById("".concat(o.jSPlugin.id,"-inspect-event-video")).onclick=function(){o.listLoading||o.startEvidence||(o.startEvidence=!0,o.hideDelEConfirm(),document.getElementById("".concat(o.jSPlugin.id,"-inspect-event-video")).setAttribute("class","ezuikit-btn ezuikit-btn-primary ezuikit-btn-loading"),document.getElementById("".concat(o.jSPlugin.id,"-inspect-event-video")).querySelector(".ezuikit-btn-loading-icon").style.display="inline-block",bt(o.jSPlugin,1,(function(e){o.startEvidence=!1,document.getElementById("".concat(o.jSPlugin.id,"-inspect-event-video")).setAttribute("class","ezuikit-btn ezuikit-btn-primary"),document.getElementById("".concat(o.jSPlugin.id,"-inspect-event-video")).querySelector(".ezuikit-btn-loading-icon").style.display="none",e.meta&&200===e.meta.code?new Tt(o.jSPlugin,e.data,o.timer,0,(function(){o.initEvent(),new gt({type:"success",content:"保存成功",wrapNode:document.getElementById("".concat(o.jSPlugin.id,"-inspect-event-box")),top:40})})):new gt({type:"error",content:"视频存证失败,".concat(e.meta&&e.meta.message||"请稍后重试!"),wrapNode:document.getElementById("".concat(o.jSPlugin.id,"-inspect-event-box")),top:40})}),(function(){o.startEvidence=!1,document.getElementById("".concat(o.jSPlugin.id,"-inspect-event-video")).setAttribute("class","ezuikit-btn ezuikit-btn-primary"),document.getElementById("".concat(o.jSPlugin.id,"-inspect-event-video")).querySelector(".ezuikit-btn-loading-icon").style.display="none",new gt({type:"error",content:"视频存证失败,请稍后重试!",wrapNode:document.getElementById("".concat(o.jSPlugin.id,"-inspect-event-box")),top:40})})))},document.getElementById("".concat(o.jSPlugin.id,"-inspect-event-list-refresh")).onclick=function(){o.listLoading||o.startEvidence||(o.hideDelEConfirm(),document.getElementById("".concat(o.jSPlugin.id,"-inspect-loading")).style.display="block",document.getElementById("".concat(o.jSPlugin.id,"-inspect-event-list-wrap")).style.display="none",document.getElementById("".concat(o.jSPlugin.id,"-inspect-event-list-nodata-wrap")).style.display="none",e.initEvent())}}})),p(this,"renderList",(function(e){document.getElementById("".concat(o.jSPlugin.id,"-inspect-loading")).style.display="none";var t=e.data||[];if(t.length>0){document.getElementById("".concat(o.jSPlugin.id,"-inspect-event-list-wrap")).style.display="block",document.getElementById("".concat(o.jSPlugin.id,"-inspect-event-list-nodata-wrap")).style.display="none";for(var n=function(){var n=document.createElement("div");n.setAttribute("class","inspect-event-item");var a=t[i];n.setAttribute("id","".concat(o.jSPlugin.id,"-inspect-event-item-").concat(a.inspectEventId)),n.innerHTML="",document.getElementById("".concat(o.jSPlugin.id,"-inspect-event-list-wrap-main")).appendChild(n);var r,s=document.createElement("div");s.setAttribute("class","inspect-event-item-header-wrap"),1==a.evidenceFileType&&(r="".concat(a.eventBeginTime.split(" ")[1],"~").concat(a.eventEndTime.split(" ")[1])),0==a.evidenceFileType&&(r="".concat(a.eventTime.split(" ")[1]));var c="";1===a.evidenceFileType&&(1===a.taskStatus||2===a.taskStatus?c="storage":4===a.taskStatus||5===a.taskStatus||6===a.taskStatus||7===a.taskStatus?c="storage-error":0!==a.taskStatus&&3!==a.taskStatus||(c="storage-success")),s.innerHTML='\n <div class="inspect-event-item-header '.concat(c,'">\n <div class="inspect-event-item-header-left">\n <span class="inspect-event-item-status-wrap">\n <span class="inspect-event-item-status"></span>\n </span>\n <svg fill="currentColor" style="display: ').concat(1===a.evidenceFileType?"block":"none",'" width="16" height="16" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"\n\t viewBox="0 0 14 12" style="enable-background:new 0 0 14 12;" xml:space="preserve">\n <path d="M1,12c-0.6,0-1-0.4-1-1V1c0-0.6,0.4-1,1-1h12c0.6,0,1,0.4,1,1v10c0,0.6-0.4,1-1,1H1z M1,11h1.6l0-3.5H1V11z\n M10.5,1h-7v10h7V1z M13,7.5h-1.6l0,3.5H13V7.5z M6.1,4.2l2.3,1.2c0.4,0.2,0.4,0.6,0,0.8L8.1,6.3l-2,1c-0.2,0.1-0.4,0-0.4-0.2V4.4\n C5.7,4.2,5.9,4.1,6.1,4.2z M13,6.6V4.9h-1.6v1.8H13z M1,6.6h1.6V4.9H1V6.6z M13,4V1h-1.6l0,3H13z M2.6,1H1v3h1.6L2.6,1z"/>\n </svg>\n <svg fill="currentColor" style="display: ').concat(1===a.evidenceFileType?"none":"block",'" width="16" height="16" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"\n viewBox="0 0 14 12" style="enable-background:new 0 0 14 12;" xml:space="preserve">\n <path class="st0" d="M13,0c0.6,0,1,0.4,1,1v10c0,0.6-0.4,1-1,1H1c-0.6,0-1-0.4-1-1V1c0-0.6,0.4-1,1-1H13z M10.4,6.2L5.6,9.8L3.8,8\n L1,10v1h12V9L10.4,6.2z M13,1H1v7.8l2.9-2.1l1.8,1.8l4.9-3.6L13,7.5V1z M5.5,2C6.3,2,7,2.7,7,3.5S6.3,5,5.5,5S4,4.3,4,3.5\n S4.7,2,5.5,2z M5.5,3C5.2,3,5,3.2,5,3.5S5.2,4,5.5,4S6,3.8,6,3.5S5.8,3,5.5,3z"/>\n </svg>\n <span class="inspect-event-item-time">').concat(r||"-",'</span>\n </div>\n <div class="inspect-event-item-header-right">\n <span class="inspect-event-item-header-toggle">\n <svg fill="currentColor" class="inspect-event-item-header-toggle-up" style="display: none;" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="16" height="16"><path d="M218.496 645.312l46.464 44.032 247.616-261.568 246.4 261.504 46.528-43.904-292.8-310.72z"></path></svg> \n <svg fill="currentColor" class="inspect-event-item-header-toggle-down" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="16" height="16"><path d="M218.496 378.688l46.464-44.032 247.616 261.568 246.4-261.504 46.528 43.904-292.8 310.72z"></path></svg>\n </span>\n </div>\n </div>\n '),n.appendChild(s),s.onclick=function(e){"none"===s.querySelector(".inspect-event-item-header-toggle-up").style.display?(s.querySelector(".inspect-event-item-header-toggle-up").style.display="block",s.querySelector(".inspect-event-item-header-toggle-down").style.display="none",n.querySelector(".inspect-event-item-body").style.display="block"):(s.querySelector(".inspect-event-item-header-toggle-up").style.display="none",s.querySelector(".inspect-event-item-header-toggle-down").style.display="block",n.querySelector(".inspect-event-item-body").style.display="none")};var l=document.createElement("div");l.setAttribute("class","inspect-event-item-body"),l.style.display="none";var d=(1===a.evidenceFileType?a.videoCoverPic:a.fileUrl)||"".concat(o.jSPlugin.staticPath,"/imgs/bg.svg");l.innerHTML='\n <div class="inspect-event-item-img" id="'.concat(o.jSPlugin.id,"-inspect-view-").concat(a.inspectEventId,'"></div>\n <div class="inspect-event-item-body-info">\n <div class="inspect-event-item-body-info-tag">\n <span class="inspect-event-item-body-info-tag-label" title="').concat(a.eventType,'">').concat(a.eventType,"</span>\n </div>\n </div>\n "),n.appendChild(l),1==a.evidenceFileType&&(1===a.taskStatus||2===a.taskStatus?document.getElementById("".concat(o.jSPlugin.id,"-inspect-view-").concat(a.inspectEventId)).innerHTML='\n <div class="video-stroage-exceptional-status-tips-wrap" style="background:url('.concat(o.jSPlugin.staticPath,'/imgs/bg.svg) no-repeat 100%/cover">\n <div class="video-stroage-exceptional-status-icon">\n <div type="default" class="ezuikit-spin ezuikit-spin-sm ezuikit-spin-spinning ezuikit-spin-dot-white"><span class="ezuikit-spin-dot ezuikit-spin-dot-spin ezuikit-spin-dot-default"><i class="ezuikit-spin-dot-item"></i><i class="ezuikit-spin-dot-item"></i><i class="ezuikit-spin-dot-item"></i><i class="ezuikit-spin-dot-item"></i></span></div>\n </div>\n <span class="video-stroage-exceptional-status-tips">视频正在存储中…</span>\n </div>\n '):4===a.taskStatus?document.getElementById("".concat(o.jSPlugin.id,"-inspect-view-").concat(a.inspectEventId)).innerHTML='\n <div class="video-stroage-exceptional-status-tips-wrap video-stroage-exceptional-status-tips-error" style="background:url('.concat(o.jSPlugin.staticPath,'/imgs/bg.svg) no-repeat 100%/cover">\n <div class="video-stroage-exceptional-status-icon">\n <svg fill="currentColor" t="1691567317943" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="1em" height="1em"><path d="M512 64a448 448 0 1 0 0 896A448 448 0 0 0 512 64z m32 664a8 8 0 0 1-8 8h-48a8 8 0 0 1-8-8v-272c0-4.416 3.584-8 8-8h48c4.416 0 8 3.584 8 8v272zM512 384a48 48 0 1 1 0-96A48 48 0 0 1 512 384z"></path></svg>\n </div>\n <span class="video-stroage-exceptional-status-tips">视频存储失败</span>\n </div>\n '):0!==a.taskStatus&&3!==a.taskStatus||new St({id:"".concat(o.jSPlugin.id,"-inspect-view-").concat(a.inspectEventId),src:a.fileUrl,poster:d,fallback:"".concat(o.jSPlugin.staticPath,"/imgs/bg.svg")})),0==a.evidenceFileType&&new ft({id:"".concat(o.jSPlugin.id,"-inspect-view-").concat(a.inspectEventId),src:d,fallback:"".concat(o.jSPlugin.staticPath,"/imgs/bg.svg"),showIcon:!1});var u=document.createElement("div");u.setAttribute("class","inspect-event-item-body-info-opr");var m=document.createElement("span");m.setAttribute("class","inspect-event-item-body-info-opr-icon"),m.innerHTML='\n <svg fill="currentColor" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="16" height="16"><path d="M612.992 121.984a64 64 0 0 1 90.496 0l153.92 153.92a64 64 0 0 1 0 90.496l-435.2 435.2a96 96 0 0 1-23.04 17.024l525.312-0.128v64H175.808v-2.304a64 64 0 0 1-66.496-77.632l43.776-199.296a96 96 0 0 1 25.92-47.296zM523.072 302.4l-298.88 298.88a32 32 0 0 0-8.576 15.744l-43.776 199.296 190.848-51.712a32 32 0 0 0 14.272-8.256l300.032-300.032-153.92-153.92z m135.168-135.168L568.32 257.088l153.92 153.984 89.92-89.92-153.92-153.92z"></path></svg>\n ',u.appendChild(m);var h=document.createElement("span");h.setAttribute("class","inspect-event-item-body-info-opr-icon"),h.id="".concat(o.jSPlugin.id,"-inspect-event-del-").concat(a.inspectEventId),h.innerHTML=' \n <svg fill="currentColor" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="16" height="16"><path d="M128 320V256h767.872v64H832v512a64 64 0 0 1-64 64H256a64 64 0 0 1-64-64V320H128z m640 0H256v512h512V320zM464 432v256h-64v-256h64z m160 0v256h-64v-256h64zM704 128v64H320V128h384z"></path></svg>\n ',u.appendChild(h),m.onclick=function(e){o.startEvidence||new Tt(o.jSPlugin,a,o.timer,1,(function(e){new gt({type:"success",content:"保存成功",wrapNode:document.getElementById("".concat(o.jSPlugin.id,"-inspect-event-box")),top:40}),a=Object.assign(a,e),document.getElementById("".concat(o.jSPlugin.id,"-inspect-event-item-").concat(a.inspectEventId)).querySelector(".inspect-event-item-body-info-tag-label").innerHTML=a.eventType,document.getElementById("".concat(o.jSPlugin.id,"-inspect-event-item-").concat(a.inspectEventId)).querySelector(".inspect-event-item-body-info-tag-label").setAttribute("title",a.eventType)}))},h.onclick=function(e){o.startEvidence||(o.delE=new yt({id:"".concat(o.jSPlugin.id,"-inspect-event-del-").concat(a.inspectEventId),content:"确定要删除该事件吗?",placement:"topRight",arrowPointAtCenter:!0,onCancel:function(){o.delE.hide()},onConfirm:function(){!function(e,t,n,i){var o={accessToken:e.accessToken||e.token.httpToken.url,inspectEventId:""},a=Object.assign(o,t),r="".concat(e.env.domain,"/api/service/devicekit/bodycamera/inspect/event/delete");Ye(r,"POST",a,(function(e){n&&n(e)}),(function(e){i&&i(e)}),{"Content-Type":"application/x-www-form-urlencoded"})}(o.jSPlugin,{inspectEventId:a.inspectEventId},(function(e){e.meta&&200===e.meta.code?(o.delE.hide(),o.initEvent(),setTimeout((function(){new gt({type:"success",content:"删除成功",wrapNode:document.getElementById("".concat(o.jSPlugin.id,"-inspect-event-box")),top:40})}),10)):new gt({type:"error",content:"删除失败,".concat(e.meta&&e.meta.message||"请稍后重试!"),wrapNode:document.getElementById("".concat(o.jSPlugin.id,"-inspect-event-box")),top:40})}),(function(){new gt({type:"error",content:"删除失败,请稍后重试!",wrapNode:document.getElementById("".concat(o.jSPlugin.id,"-inspect-event-box")),top:40})}))}}),o.delEConfirmList.push(o.delE))},n.querySelector(".inspect-event-item-body-info").appendChild(u),document.getElementById("".concat(o.jSPlugin.id,"-inspect-event-list-wrap")).onscroll=function(t){var n=t.target;o.hideDelEConfirm(),n.scrollTop+n.offsetHeight>=n.scrollHeight-48&&!o.listLoading&&(e.start+1)*e.size<e.total&&o.initEvent(e.start+1)}},i=0;i<t.length;i++)n()}else document.getElementById("".concat(o.jSPlugin.id,"-inspect-event-list-wrap")).style.display="none",document.getElementById("".concat(o.jSPlugin.id,"-inspect-event-list-nodata-wrap")).style.display="block"})),this.jSPlugin=t,this.videoWidth=t.width,this.inspectRecordId=n,this.timer=i,this.listLoading=!1,this.startEvidence=!1,this.delEConfirmList=[],this.videoHeight=document.getElementById("".concat(t.id,"-wrap")).clientHeight-document.getElementById("".concat(t.id,"-inspectInfoControl")).clientHeight||t.height,this.initEvent()}),[{key:"initEvent",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:30,i=this;i.listLoading=!0,0===t?i.initRender(t):document.getElementById("".concat(this.jSPlugin.id,"-inspect-event-list-more-loading")).style.display="flex";var o=function(t){new gt({type:"error",content:t.meta&&t.meta.message||"列表获取失败,请稍后重试!",wrapNode:document.getElementById("".concat(e.jSPlugin.id,"-inspect-event-box")),top:40}),i.renderList({})};i.inspectRecordId?function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:30,o=arguments.length>4?arguments[4]:void 0,a=arguments.length>5?arguments[5]:void 0,r={accessToken:e.accessToken||e.token.httpToken.url,inspectRecordId:t,pageStart:n,pageSize:i},s="".concat(e.env.domain,"/api/service/devicekit/bodycamera/inspect/event/page");Ye(s,"GET",r,(function(e){o&&o(e)}),(function(e){a&&a(e)}),{"Content-Type":"application/x-www-form-urlencoded"})}(i.jSPlugin,i.inspectRecordId,t,n,(function(t){i.listLoading=!1,document.getElementById("".concat(e.jSPlugin.id,"-inspect-event-list-more-loading")).style.display="none",t.meta&&200===t.meta.code?i.renderList(t.data||{}):o(t)}),(function(t){i.listLoading=!1,document.getElementById("".concat(e.jSPlugin.id,"-inspect-event-list-more-loading")).style.display="none",o(t)})):(i.listLoading=!1,document.getElementById("".concat(this.jSPlugin.id,"-inspect-event-list-more-loading")).style.display="none",i.renderList({}))}},{key:"disableEvidenceBtn",value:function(){document.getElementById("".concat(this.jSPlugin.id,"-inspect-event-img")).setAttribute("disabled","disabled"),document.getElementById("".concat(this.jSPlugin.id,"-inspect-event-video")).setAttribute("disabled","disabled")}},{key:"enableEvidenceBtn",value:function(){document.getElementById("".concat(this.jSPlugin.id,"-inspect-event-img")).removeAttribute("disabled"),document.getElementById("".concat(this.jSPlugin.id,"-inspect-event-video")).removeAttribute("disabled")}}])}(),Pt=function(){return m((function e(t,n,o,a,r){var s=this;l(this,e),p(this,"createLocationControl",(function(){var e=s;function t(){this.defaultAnchor=BMAP_ANCHOR_BOTTOM_LEFT,this.defaultOffset=new BMapGL.Size(40,105)}return t.prototype=new BMapGL.Control,t.prototype.initialize=function(t){var n=document.createElement("div");return n.style.cssText="width: 26px;height: 26px;display: flex;align-items: center;justify-content: center; box-shadow: 1px 2px 1px rgb(0 0 0 / 15%); background: #fff; cursor: pointer;",n.id="".concat(e.jSPlugin.id,"-location-btn"),n.innerHTML='<svg fill="#3385ff" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" width="20" height="20" xmlns:xlink="http://www.w3.org/1999/xlink">\n <path d="M510.976716 128.626761c-211.205756 0-382.401119 171.195363-382.401119 382.401119s171.195363 382.401119 382.401119 382.401119S893.377836 722.131308 893.377836 510.925552 722.182472 128.626761 510.976716 128.626761zM736.508444 736.45728c-29.265914 29.265914-63.443589 52.289797-101.407415 68.355351-29.265914 12.381733-59.964425 20.158689-91.481563 23.433197L543.619466 704.019187l-63.443589 0 0 124.431298c-32.233437-3.069851-63.443589-10.949136-93.323474-23.535525-37.963825-16.065554-72.039173-39.089437-101.407415-68.355351-29.265914-29.265914-52.289797-63.443589-68.355351-101.407415-12.381733-29.265914-20.158689-59.964425-23.433197-91.481563l126.273209 0 0-63.443589L193.554112 480.227041c3.069851-32.233437 10.949136-63.443589 23.535525-93.323474 16.065554-37.963825 39.089437-72.039173 68.355351-101.407415 29.265914-29.265914 63.443589-52.289797 101.407415-68.355351 29.879884-12.58639 61.090037-20.465674 93.323474-23.535525l0 125.863895 63.443589 0L543.619466 193.707605c31.517138 3.172179 62.215649 11.051464 91.481563 23.433197 37.963825 16.065554 72.039173 39.089437 101.407415 68.355351 29.265914 29.265914 52.289797 63.443589 68.355351 101.407415 12.58639 29.879884 20.465674 61.090037 23.535525 93.323474L703.251724 480.227041l0 63.443589 125.045268 0c-3.172179 31.517138-11.051464 62.215649-23.433197 91.481563C788.798241 673.01369 765.876686 707.089038 736.508444 736.45728z" p-id="1506"></path><path d="M516.093135 415.248526c-56.280604 0-100.793445 43.489557-100.793445 99.770161s44.512841 101.816728 100.793445 101.816728S616.886579 571.29929 616.886579 515.018687 572.373738 415.248526 516.093135 415.248526z" p-id="1507"></path>\n </svg>',n.onclick=function(t){setTimeout((function(){e.inspectMapWin.centerToTrack(18)}),100)},t.getContainer().appendChild(n),n},new t})),p(this,"initSwithcBtn",(function(){var e=document.createElement("div");e.id="".concat(s.jSPlugin.id,"-miniSwitch"),e.style="cursor: pointer;position: absolute; bottom: 106px; right: ".concat(s.jSPlugin.inspectVideoWidth+10,"px; z-index: 999;"),e.innerHTML="<div id='".concat(s.jSPlugin.id,'-miniSwitch-btn\' style="width: 32px;height: 32px;display: flex;align-items: center;justify-content: center;border-radius: 50%;background: rgba(0,0,0,0.70);">\n <svg width="20px" height="20px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n <title>大小窗切换</title>\n <g id="icon/大小窗切换" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n <rect id="矩形" x="0" y="0" width="24" height="24"></rect>\n <path d="M16,3.25 C17.5187831,3.25 18.75,4.48121694 18.75,6 L18.75,6 L18.75,6.644 L19.095177,6.64456257 C20.6299163,6.64456257 21.9388658,7.64624846 22.0337198,8.99291851 L22.0392202,9.14979714 L22.0392202,17.639328 C22.0392202,19.0115638 20.7871129,20.0640733 19.2712041,20.1401546 L19.095177,20.1445626 L8.48326347,20.1445626 C6.94852423,20.1445626 5.63957467,19.1428767 5.54472071,17.7962066 L5.53922025,17.639328 L5.539,16.75 L5,16.75 C3.53746816,16.75 2.34159572,15.6082954 2.25501879,14.1675223 L2.25,14 L2.25,6 C2.25,4.48121694 3.48121694,3.25 5,3.25 L5,3.25 Z M18.75,14 C18.75,15.5187831 17.5187831,16.75 16,16.75 L16,16.75 L7.039,16.75 L7.03922025,17.639328 C7.03922025,18.1209822 7.57916546,18.5830417 8.33031492,18.6389177 L8.48326347,18.6445626 L19.095177,18.6445626 C19.873026,18.6445626 20.4615868,18.2126064 20.5321184,17.735283 L20.5392202,17.639328 L20.5392202,9.14979714 C20.5392202,8.66814298 19.999275,8.20608342 19.2481256,8.15020744 L19.095177,8.14456257 L18.75,8.144 Z M16,4.75 L5,4.75 C4.30964406,4.75 3.75,5.30964406 3.75,6 L3.75,6 L3.75,14 C3.75,14.6903559 4.30964406,15.25 5,15.25 L5,15.25 L16,15.25 C16.6903559,15.25 17.25,14.6903559 17.25,14 L17.25,14 L17.25,8.144 L17.2422027,8.14456257 L17.2422027,6.64456257 L17.25,6.644 L17.25,6 C17.25,5.35279131 16.7581253,4.8204661 16.1278052,4.75645361 L16,4.75 Z" id="形状结合" fill="#FFFFFF" fill-rule="nonzero"></path>\n </g>\n </svg>\n </div>'),document.getElementById("".concat(s.jSPlugin.id,"-wrap")).appendChild(e),document.getElementById("".concat(s.jSPlugin.id,"-miniSwitch-btn")).onclick=function(){i.throttle((function(){return s.miniRecSwitchClick()}),1e3)()}})),p(this,"initMiniWinToggleBtn",(function(){var e=.3333*s.videoWidth,t=.3333*s.videoHeight,n=document.createElement("div");n.id="".concat(s.jSPlugin.id,"-miniToggle"),n.style="cursor: pointer;position: absolute; bottom: ".concat(t/2+96-30,"px; right: ").concat(s.jSPlugin.inspectVideoWidth+e,"px; z-index: 999; height:60px; box-sizing: border-box; padding-top: 20px; text-align: center; width:20px; overflow: hidden; background: #000000; border-radius: 2px 0px 0px 2px; opacity: 0.7;"),n.innerHTML="<div id='".concat(s.jSPlugin.id,"-miniToggle-btn'>\n <svg id=\"").concat(s.jSPlugin.id,'-min-win-close-icon" style="display: inline-block" width="20px" height="20px" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="10867" xmlns:xlink="http://www.w3.org/1999/xlink">\n <path d="M378.688 217.856l-44.032 46.464 261.568 247.616-261.504 246.4 43.904 46.528 310.72-292.8z" fill="#ffffff" p-id="10868"></path>\n </svg>\n <svg id="').concat(s.jSPlugin.id,'-min-win-open-icon" style="display: none" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="10671" xmlns:xlink="http://www.w3.org/1999/xlink" width="20" height="20">\n <path d="M645.312 217.856l44.032 46.464-261.568 247.616 261.504 246.4-43.904 46.528-310.72-292.8z" fill="#ffffff" p-id="10672"></path>\n </svg>\n </div>'),document.getElementById("".concat(s.jSPlugin.id,"-wrap")).appendChild(n),document.getElementById("".concat(s.jSPlugin.id,"-miniToggle")).onclick=function(){s.miniWinToggleClick()}})),p(this,"init",(function(){s.initSwithcBtn(),s.initMiniWinToggleBtn()})),p(this,"setStyleListByIds",(function(e){e.map((function(e){var t=document.getElementById(e.id);t&&Object.keys(e.styleList).map((function(n){t.style[n]=e.styleList[n]}))}))})),this.jSPlugin=t,this.inspectMode=n,this.inspectMapWin=o,this.changeInspectMode=a,this.videoWidth=t.width,this.videoHeight=t.height,this.minWinStatus="open",this.decoderState=r,this.ZoomControl=new BMapGL.ZoomControl({anchor:BMAP_ANCHOR_BOTTOM_LEFT,offset:new BMapGL.Size(40,50)}),this.LocationControl=this.createLocationControl(),this.NavigationControl3D=new BMapGL.NavigationControl3D({anchor:BMAP_ANCHOR_BOTTOM_LEFT,offset:new BMapGL.Size(28,105)}),this.init()}),[{key:"miniWinToggleClick",value:function(){var e=.3333*this.jSPlugin.width;"open"===this.minWinStatus?(this.setStyleListByIds([{id:"video"===this.inspectMode?"".concat(this.jSPlugin.id,"-mapbox"):"".concat(this.jSPlugin.id),styleList:{width:"0px"}},{id:"".concat(this.jSPlugin.id,"-miniSwitch"),styleList:{display:"none"}},{id:"".concat(this.jSPlugin.id,"-miniToggle"),styleList:{right:"".concat(this.jSPlugin.inspectVideoWidth,"px")}},{id:"".concat(this.jSPlugin.id,"-min-win-close-icon"),styleList:{display:"none"}},{id:"".concat(this.jSPlugin.id,"-min-win-open-icon"),styleList:{display:"inline-block"}}]),this.minWinStatus="close"):(this.setStyleListByIds([{id:"video"===this.inspectMode?"".concat(this.jSPlugin.id,"-mapbox"):"".concat(this.jSPlugin.id),styleList:{width:e+"px"}},{id:"".concat(this.jSPlugin.id,"-miniSwitch"),styleList:{display:"block"}},{id:"".concat(this.jSPlugin.id,"-miniToggle"),styleList:{right:"".concat(this.jSPlugin.inspectVideoWidth+e,"px")}},{id:"".concat(this.jSPlugin.id,"-min-win-close-icon"),styleList:{display:"inline-block"}},{id:"".concat(this.jSPlugin.id,"-min-win-open-icon"),styleList:{display:"none"}}]),this.minWinStatus="open")}},{key:"miniRecSwitchClick",value:function(){var e=this,t=.3333*this.jSPlugin.width,n=.3333*this.jSPlugin.height;"video"===this.inspectMode?(this.jSPlugin.Zoom&&this.jSPlugin.Zoom.stopZoom(),this.setStyleListByIds([{id:"".concat(this.jSPlugin.id,"-mapbox"),styleList:{width:this.jSPlugin.width+"px",height:this.jSPlugin.height+"px",marginBottom:"-40px"}},{id:"".concat(this.jSPlugin.id,"-ez-iframe-footer-container"),styleList:{top:this.jSPlugin.height+"px"}},{id:"".concat(this.jSPlugin.id),styleList:{position:"absolute",zIndex:"100",bottom:"96px",right:"".concat(this.jSPlugin.inspectVideoWidth,"px"),overflow:"hidden"}}]),this.jSPlugin.Theme.inspect.reSizeVideo(t,n),this.inspectMode="map",this.changeInspectMode("map"),this.inspectMapWin.map.addControl(this.NavigationControl3D),this.inspectMapWin.map.addControl(this.LocationControl),this.inspectMapWin.map.addControl(this.ZoomControl),this.inspectMapWin.map.addOverlay(this.inspectMapWin.inspectRange),document.getElementById("".concat(this.jSPlugin.id,"-loading-item-btn-wrap"))&&this.setStyleListByIds([{id:"".concat(this.jSPlugin.id,"-loading-item-btn"),styleList:{display:"none"}},{id:"".concat(this.jSPlugin.id,"-loading-item-btn-svg"),styleList:{display:"block"}},{id:"".concat(this.jSPlugin.id,"-loading-item-btn-wrap"),styleList:{border:"none",width:"32px",height:"14px"}}]),setTimeout((function(){e.inspectMapWin.centerToTrack(18)}),100)):(this.setStyleListByIds([{id:"".concat(this.jSPlugin.id,"-mapbox"),styleList:{width:t+"px",height:n+"px",marginBottom:"0"}},{id:"".concat(this.jSPlugin.id,"-ez-iframe-footer-container"),styleList:{top:"0px"}},{id:"".concat(this.jSPlugin.id),styleList:{position:"relative",zIndex:"0",bottom:"0",right:"0"}}]),this.jSPlugin.Theme.inspect.reSizeVideo(this.jSPlugin.width,this.jSPlugin.height),this.inspectMode="video",this.changeInspectMode("video"),this.inspectMapWin.map.removeControl(this.ZoomControl),this.inspectMapWin.map.removeControl(this.NavigationControl3D),this.inspectMapWin.map.removeControl(this.LocationControl),this.inspectMapWin.map.removeOverlay(this.inspectMapWin.inspectRange),document.getElementById("".concat(this.jSPlugin.id,"-loading-item-btn-wrap"))&&this.setStyleListByIds([{id:"".concat(this.jSPlugin.id,"-loading-item-btn"),styleList:{display:"block"}},{id:"".concat(this.jSPlugin.id,"-loading-item-btn-svg"),styleList:{display:"none"}},{id:"".concat(this.jSPlugin.id,"-loading-item-btn-wrap"),styleList:{border:"1px solid rgb(255, 255, 255)",width:"80px",height:"32px",color:"#fff","text-align":"center","line-height":"32px","font-size":"14px"}}]),setTimeout((function(){e.inspectMapWin.centerToTrack()}),100),this.jSPlugin.Zoom&&this.decoderState.state.play&&this.jSPlugin.Zoom.startZoom()),this.setStyleListByIds([{id:"".concat(this.jSPlugin.id,"-wrap"),styleList:{width:this.jSPlugin.width+this.jSPlugin.inspectVideoWidth+"px",height:this.jSPlugin.height+this.jSPlugin.inspectVideoHeight+"px"}}])}}])}(),kt={customConfig:{defaultMicro:0,defaultPlay:0,maxTalkTime:0,bellPoster:0,maxBellTime:0,inspectInfo:{color:"#000000",backgroundColor:"#ffffff",activeColor:"#1890FF",btnList:[{btnKey:"inspectName",iconId:"inspectName",part:"left",defaultActive:0,isrender:1,color:"#262626"},{btnKey:"inspectBeginTime",iconId:"inspectBeginTime",part:"left",defaultActive:0,isrender:1,color:"#262626"},{btnKey:"inspectPerson",iconId:"inspectPerson",part:"right",defaultActive:0,isrender:1,color:"#262626"}]}},header:{color:"#2c2c2c",backgroundColor:"rgba(0,0,0,0.8)",activeColor:"#1890FF",btnList:[{btnKey:"deviceName",iconId:"deviceName",part:"left",defaultActive:0,isrender:1,color:"#ffffff"},{btnKey:"inspectTime",iconId:"inspectTime",part:"left",defaultActive:0,isrender:1,color:"#ffffff"},{btnKey:"signalType",iconId:"signalType",part:"right",defaultActive:0,isrender:1,color:"#ffffff"},{btnKey:"batteryStatus",iconId:"batteryStatus",part:"right",defaultActive:0,isrender:1,color:"#ffffff"}]},footer:{color:"#ffffff",backgroundColor:"#000000",activeColor:"blue",btnList:[{btnKey:"talk",iconId:"talk",part:"left",defaultActive:1,isrender:1,backgroundColor:"#cccccc"},{btnKey:"sound",iconId:"sound",part:"left",defaultActive:1,isrender:1,backgroundColor:"#cccccc"}]}},Ct=function(e){var t="";return Object.keys(e).map((function(n,i){t+="".concat(n,":").concat(e[n]).concat(i<Object.keys(e).length-1?";":"")})),t};var It=500,xt=function(){return m((function e(t,n,i,o,a,r,s){l(this,e),this.jSPlugin=t,this.videoWidth=t.width,this.videoHeight=t.height,this.themeData=n,this.setDecoderState=i,this.decoderState=o,this.isNeedRenderInspectInfo=!1,this.isNeedRenderHeader=!1,this.isNeedRenderFooter=!1,this.inspectMode=a,this.changeInspectMode=r,this.themeInited=!1,this.inspectRecordId=null,this.inspectInfo={},this.activeThemeStatus=!0,this.activeThemeStatusTxt="模板未激活",this.globalContainer=new pt(this.jSPlugin),this.toastCustom=new Je(t,!1),this.InspectEvent=null,this.timer=s}),[{key:"renderSignalType",value:function(e){return e?"WIFI"===e.toUpperCase()?'<span><svg t="1688983236732" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" width="16" height="16" xmlns:xlink="http://www.w3.org/1999/xlink">\n <path d="M0 352.832l93.12 98.752c231.296-245.44 606.464-245.44 837.76 0L1024 352.832C741.44 53.056 283.008 53.056 0 352.832z m372.352 395.008L512 896l139.648-148.16c-76.8-81.92-202.048-81.92-279.296 0zM186.24 550.4l93.12 98.752c128.448-136.32 336.96-136.32 465.408 0L837.824 550.4c-179.648-190.592-471.488-190.592-651.648 0z" fill="#ffffff" p-id="1530"></path>\n </svg></span>':"<span>".concat(e,"</span>"):null}},{key:"renderBatteryStatus",value:function(e){return e&&0!=e?'\n <div style="\n display: flex;\n align-items: center;\n position: relative;\n ">\n <span style="\n margin-right: 3px; \n color: '.concat(e<=20?"#FF4D4F":"#FFFFFF",'\n ">').concat(e,'%</span>\n <div style="\n position: absolute;\n right: 6px;\n height: 8px;\n width: 15px;\n ">\n <div style="\n width: ').concat(e,"%;\n height: 100%;\n background: ").concat(e<=20?"#FF4D4F":"#FFFFFF",'\n "></div>\n </div>\n <svg viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" width="24" height="32" xmlns:xlink="http://www.w3.org/1999/xlink">\n <path fill="').concat(e<=20?"#FF4D4F":"#FFFFFF",'" d="M128 213.333333l640 0q52.992 0 90.496 37.504t37.504 90.496q52.992 0 90.496 37.504t37.504 90.496l0 85.333333q0 52.992-37.504 90.496t-90.496 37.504q0 52.992-37.504 90.496t-90.496 37.504l-640 0q-52.992 0-90.496-37.504t-37.504-90.496l0-341.333333q0-52.992 37.504-90.496t90.496-37.504zM768 298.666667l-640 0q-17.664 0-30.165333 12.501333t-12.501333 30.165333l0 341.333333q0 17.664 12.501333 30.165333t30.165333 12.501333l640 0q17.664 0 30.165333-12.501333t12.501333-30.165333l0-341.333333q0-17.664-12.501333-30.165333t-30.165333-12.501333zM896 426.666667l0 170.666667q17.664 0 30.165333-12.501333t12.501333-30.165333l0-85.333333q0-17.664-12.501333-30.165333t-30.165333-12.501333z"></path>\n </svg>\n </div>\n '):null}},{key:"renderInspectTime",value:function(e){if(!e)return null;var t,n,i,o,a=e.split(" "),r=a[0].split("-"),s=a[1].split(":"),c=new Date(r[0],r[1]-1,r[2],s[0],s[1],s[2]),l=(new Date).getTime()-new Date(c).getTime();return'\n <span style="\n display: inline-block;\n width:8px;\n height:8px;\n border-radius: 100%;\n background: #FF4D4F;\n margin-right: 4px;\n "></span>\n '.concat((t=l,n=parseInt(t%864e5/36e5),i=parseInt(t%36e5/6e4),o=parseInt(t%6e4/1e3),(n<10?"0".concat(n):n)+":"+(i<10?"0".concat(i):i)+":"+(o<10?"0".concat(o):o)),"\n ")}},{key:"matchBtn",value:function(e,t){var n=this,o=this.themeData,a=o.customConfig,r=o.header,s=o.footer,c=a.inspectInfo,l={title:"",id:"",domString:"",color:"#FFFFFF",activeColor:"#FFFFFF",onclick:function(){},onmoveleft:function(){},onmoveright:function(){},onremove:function(){}},d=c.btnList.findIndex((function(t){return t.iconId===e}));switch(-1!==d?(l.color=c.color,l.backgroundColor=c.backgroundColor,l.activeColor=c.activeColor):-1!==(d=r.btnList.findIndex((function(t){return t.iconId===e})))?(l.color=r.color,l.backgroundColor=r.backgroundColor,l.activeColor=r.activeColor):(l.color=s.color,l.backgroundColor=s.backgroundColor,l.activeColor=s.activeColor),e){case"inspectName":return l.title="巡检名称",l.id=e,l.domString='<span id="'.concat(this.jSPlugin.id,'-inspectInfo-inspectName" \n style="\n color:').concat(t.color||"#262626",';\n font-size: 18px;\n text-align: left;\n font-weight: bold;\n padding: 0 16px;\n ">巡检名称</span>'),l.onclick=function(){},l;case"inspectBeginTime":return l.title="巡检开始时间",l.id=e,l.domString='<span id="'.concat(this.jSPlugin.id,'-inspectInfo-inspectBeginTime" \n style="\n color:').concat(t.color||"#FFFFFF",';\n font-size: 14px;\n text-align: left;\n padding-left: 16px;\n border-left: 1px solid #d9d9d9;\n line-height: 16px;\n margin-top: 1px;\n ">巡检开始时间:-</span>'),l.onclick=function(){},l;case"inspectPerson":return l.title="本地巡检员",l.id=e,l.domString='<span id="'.concat(this.jSPlugin.id,'-inspectInfo-inspectPerson" \n style="\n color:').concat(t.color||"#FFFFFF",';\n font-size: 14px;\n display: block;\n max-width: 100%;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n text-align: left;\n padding-right: 16px;\n ">本地巡检员:-</span>'),l.onclick=function(){},l;case"deviceName":return l.title="设备名称",l.id=e,l.domString='<span id="'.concat(this.jSPlugin.id,'-header-deviceName" \n style="\n color:').concat(t.color||"#FFFFFF",";\n font-size: 16px;\n display: block;\n max-width: ").concat(.33*this.jSPlugin.width,'px;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n text-align: left;\n ">设备名称</span>'),l.onclick=function(){},l;case"inspectTime":return l.title="巡检时长",l.id=e,l.domString='<span id="'.concat(this.jSPlugin.id,'-header-inspectTime-wrap" \n style="\n color:').concat(t.color||"#FFFFFF",';\n font-size: 14px;\n display: flex;\n max-width: 100%;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n text-align: left;\n margin-left: 32px;\n ">巡检时长:<span id="').concat(this.jSPlugin.id,'-header-inspectTime" style="display: flex; align-items: center;">-</span></span>'),l.onclick=function(){},l;case"signalType":return l.title="信号类型",l.id=e,l.domString='<span id="'.concat(this.jSPlugin.id,'-header-signalType" \n style="\n color:').concat(t.color||"#FFFFFF",';\n font-size: 14px;\n display: block;\n max-width: 100%;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n text-align: left;\n "></span>'),l.onclick=function(){},l;case"batteryStatus":return l.title="设备电量",l.id=e,l.domString='<span id="'.concat(this.jSPlugin.id,'-header-batteryStatus" \n style="\n color:').concat(t.color||"#FFFFFF",';\n font-size: 14px;\n display: flex;\n max-width: 100%;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n text-align: left;\n margin-left: 12px;\n align-items: center;\n "></span>'),l.onclick=function(){},l;case"talk":return l.title="对讲",l.id=e,l.domString="<div></div>"+'<svg id="'.concat(this.jSPlugin.id,'-talk-icon" class="theme-icon-item-icon" fill="').concat(l.color,'" version="1.1" xmlns="http://www.w3.org/2000/svg" width="').concat(this.jSPlugin.width>It?48:32,'" height="').concat(this.jSPlugin.width>It?48:32,'" viewBox="-6 -6 32 32">')+'<path d="M10.1,2.7C8.5,2.7,7.2,4,7.2,5.6v5.2c0,1.6,1.3,2.9,2.9,2.9l0.2,0c1.5-0.1,2.7-1.4,2.7-2.9V5.6\tC13,4,11.7,2.7,10.1,2.7z M10.1,3.7c1.1,0,1.9,0.9,1.9,1.9v5.2c0,1-0.8,1.8-1.8,1.9l-0.1,0c-1,0-1.9-0.9-1.9-1.9V5.6 C8.2,4.5,9,3.7,10.1,3.7z" /><path d="M15.1,8.5c0.2,0,0.4,0.2,0.5,0.4l0,0.1v1.7c0,3-2.5,5.5-5.5,5.5c-3,0-5.4-2.3-5.5-5.3l0-0.2V9 c0-0.3,0.2-0.5,0.5-0.5c0.2,0,0.4,0.2,0.5,0.4l0,0.1v1.7c0,2.5,2,4.5,4.5,4.5c2.4,0,4.4-1.9,4.5-4.3l0-0.2V9 C14.6,8.7,14.8,8.5,15.1,8.5z" /><path d="M13.5,17.7c0.3,0,0.5,0.2,0.5,0.5c0,0.2-0.2,0.4-0.4,0.5l-0.1,0h-7c-0.3,0-0.5-0.2-0.5-0.5 c0-0.2,0.2-0.4,0.4-0.5l0.1,0H13.5z" /><path d="M10.1,15.2c0.2,0,0.4,0.2,0.5,0.4l0,0.1v2.5c0,0.3-0.2,0.5-0.5,0.5c-0.2,0-0.4-0.2-0.5-0.4l0-0.1 v-2.5C9.6,15.4,9.8,15.2,10.1,15.2z" />'+'</svg><span id="'.concat(this.jSPlugin.id,'-talk-label" style="margin-left: -3px">对讲</span>'),l.onclick=function(){var e=n.decoderState.state,t=e.talk,o=e.sound;if(e.play)if(t){console.log("结束对讲"),n.setDecoderState({talk:!1}),n.jSPlugin.Talk.stopTalk();var a=i.findIndex(n.themeData.footer.btnList,(function(e){return"sound"===e.iconId&&1===e.isrender&&1===e.defaultActive}))>-1;n.themeData&&a&&n.jSPlugin.openSound()}else console.log("开始对讲"),n.setDecoderState({talk:!0}),n.jSPlugin.Talk.startTalk((function(e){o&&!e&&(n.jSPlugin.closeSound(),n.setDecoderState({sound:!1}))}))},l;case"sound":return l.title="音量",l.id=e,l.domString='<span style="height: 100%">'+'<svg class="theme-icon-item-icon" id="'.concat(this.jSPlugin.id,'-nosound-icon" style="display:none" fill="').concat(l.color,'" version="1.1" xmlns="http://www.w3.org/2000/svg" width="').concat(this.jSPlugin.width>It?48:32,'" height="').concat(this.jSPlugin.width>It?48:32,'" viewBox="-6 -7 32 31">\n <path d="M8.5,4.2c0.8-0.7,2.1-0.2,2.2,0.9l0,0.1v10c0,1.1-1.2,1.7-2.1,1.1l-0.1-0.1l-3.3-2.8C5,13.2,5,12.9,5.1,12.7 c0.2-0.2,0.4-0.2,0.6-0.1l0.1,0.1l3.3,2.8c0.2,0.2,0.5,0.1,0.5-0.2l0-0.1v-10c0-0.3-0.3-0.4-0.5-0.3L9.2,5L5.9,7.8 C5.6,7.9,5.3,7.9,5.1,7.7C5,7.5,5,7.3,5.1,7.1L5.2,7L8.5,4.2z"/>\n <path d="M5.5,6.9C5.8,6.9,6,7.1,6,7.4c0,0.2-0.2,0.4-0.4,0.5l-0.1,0h-2C3.4,7.9,3.3,8,3.2,8.2l0,0.1v4 c0,0.2,0.1,0.3,0.3,0.3l0.1,0h2C5.8,12.5,6,12.7,6,13c0,0.2-0.2,0.4-0.4,0.5l-0.1,0h-2c-0.7,0-1.3-0.5-1.3-1.2l0-0.1v-4 c0-0.7,0.5-1.3,1.2-1.3l0.1,0H5.5z"/>\n <path d="M17.4,7.9c0.2-0.2,0.5-0.2,0.7,0c0.2,0.2,0.2,0.4,0.1,0.6l-0.1,0.1l-3.8,3.8c-0.2,0.2-0.5,0.2-0.7,0 c-0.2-0.2-0.2-0.4-0.1-0.6l0.1-0.1L17.4,7.9z"/>\n <path d="M13.7,7.9c0.2-0.2,0.4-0.2,0.6-0.1l0.1,0.1l3.8,3.8c0.2,0.2,0.2,0.5,0,0.7c-0.2,0.2-0.4,0.2-0.6,0.1l-0.1-0.1 l-3.7-3.8C13.5,8.4,13.5,8.1,13.7,7.9z"/>\n </svg>')+'<svg class="theme-icon-item-icon" id="'.concat(this.jSPlugin.id,'-sound-icon" style="display:inline-block" width="').concat(this.jSPlugin.width>It?48:32,'" height="').concat(this.jSPlugin.width>It?48:32,'" fill="').concat(l.color,'" viewBox="-6 -7 32 32">\n <path d="M13.2,7.1c0.1-0.2,0.5-0.3,0.7-0.2c1.1,0.7,1.9,2.2,1.9,3.7c0,1.6-0.7,3-1.9,3.7\n c-0.2,0.1-0.5,0.1-0.7-0.2c-0.1-0.2-0.1-0.5,0.2-0.7c0.8-0.5,1.4-1.6,1.4-2.9c0-1.3-0.6-2.4-1.4-2.9C13.1,7.6,13,7.3,13.2,7.1z"/>\n <path d="M15.7,4.5c0.2-0.2,0.5-0.2,0.7-0.1C18,5.8,19,8.2,19,10.7c0,2.5-1,4.8-2.7,6.3\n c-0.2,0.2-0.5,0.2-0.7-0.1c-0.2-0.2-0.2-0.5,0.1-0.7c1.4-1.2,2.3-3.3,2.3-5.5c0-2.2-0.9-4.3-2.3-5.5C15.5,5,15.5,4.7,15.7,4.5z"/>\n <path id="Stroke-5" class="st1" d="M8.5,4.7c0.8-0.7,2.1-0.2,2.2,0.9l0,0.1v10c0,1.1-1.2,1.7-2.1,1.1l-0.1-0.1l-3.3-2.8\n C5,13.7,5,13.4,5.1,13.2c0.2-0.2,0.4-0.2,0.6-0.1l0.1,0.1l3.3,2.8c0.2,0.2,0.5,0.1,0.5-0.2l0-0.1v-10c0-0.3-0.3-0.4-0.5-0.3l-0.1,0\n L5.9,8.3C5.6,8.4,5.3,8.4,5.1,8.2C5,8,5,7.7,5.1,7.6l0.1-0.1L8.5,4.7z"/>\n <path d="M5.5,7.4C5.8,7.4,6,7.6,6,7.9c0,0.2-0.2,0.4-0.4,0.5l-0.1,0h-2c-0.2,0-0.3,0.1-0.3,0.3l0,0.1v4\n c0,0.2,0.1,0.3,0.3,0.3l0.1,0h2C5.8,13,6,13.2,6,13.5c0,0.2-0.2,0.4-0.4,0.5l-0.1,0h-2c-0.7,0-1.3-0.5-1.3-1.2l0-0.1v-4\n c0-0.7,0.5-1.3,1.2-1.3l0.1,0H5.5z"/>\n </svg>')+'</span><span id="'.concat(this.jSPlugin.id,'-sound-label" style="margin-left: -3px; color: ').concat(l.color,'">音量</span>'),l.onclick=function(){var e=n.decoderState.state,t=e.play,i=e.sound,o=e.talk;t&&!o&&(i?(n.jSPlugin.closeSound(),n.setDecoderState({sound:!1})):n.jSPlugin.openSound())},l;default:return l}}},{key:"renderInspectInfo",value:function(e,t){var n=this.matchBtn(e,t),i=document.createElement("sapn");i.innerHTML="".concat(n.domString),"left"===t.part?document.getElementById("".concat(this.jSPlugin.id,"-inspectInfoControl-left")).appendChild(i):document.getElementById("".concat(this.jSPlugin.id,"-inspectInfoControl-right")).appendChild(i)}},{key:"renderHeader",value:function(e,t){var n=this.matchBtn(e,t),i=document.createElement("span");i.className="".concat(this.jSPlugin.id,"-header-content"),i.style="display: flex; align-items: center; ",i.innerHTML="\n ".concat(n.domString,"\n "),"left"===t.part?document.getElementById("".concat(this.jSPlugin.id,"-headControl-left")).appendChild(i):document.getElementById("".concat(this.jSPlugin.id,"-headControl-right")).appendChild(i)}},{key:"renderFooter",value:function(e,t){var n=this,i=this.matchBtn(e,t),o=this.videoWidth/6,a=document.createElement("div");a.className="theme-icon-item",this.jSPlugin.isWebConsole?a.style="padding:0 ".concat(.1*o,"px;"):a.style="padding:0 ".concat(.1*o,"px;cursor: pointer;"),a.innerHTML="".concat('<span id="'.concat(this.jSPlugin.id,"-").concat(i.id,'" style="position:relative;">')+'<div id="'.concat(this.jSPlugin.id,"-").concat(i.id,'-content" title="').concat(i.title,'" style="display: flex;align-items: center;position:relative;">')).concat(i.domString,"</div>")+"</span>",a.onclick=function(e){if(n.decoderState.state.isEditing||!n.activeThemeStatus)return!1;i.onclick(e)},i.onmouseenter&&(a.onmouseenter=function(e){if(n.decoderState.state.isEditing||!n.activeThemeStatus)return!1;i.onmouseenter(e)}),i.onmouseleave&&(a.onmouseleave=function(e){if(n.decoderState.state.isEditing||!n.activeThemeStatus)return!1;i.onmouseleave(e)}),document.getElementById("".concat(this.jSPlugin.id,"-audioControls")).appendChild(a)}},{key:"initThemeData",value:function(){var e=this,t=this.themeData,n=t.customConfig,o=t.header,a=t.footer,r=n.inspectInfo,s=this.jSPlugin.id;if(this.isNeedRenderInspectInfo=i.findIndex(r.btnList,(function(e){return e.isrender>0}))>=0,this.isNeedRenderHeader=i.findIndex(o.btnList,(function(e){return e.isrender>0}))>=0,this.isNeedRenderFooter=i.findIndex(a.btnList,(function(e){return e.isrender>0}))>=0,this.isNeedRenderInspectInfo)if(document.getElementById("".concat(this.jSPlugin.id,"-inspectInfoControl")))document.getElementById("".concat(this.jSPlugin.id,"-inspectInfoControl")).innerHTML="<div id='".concat(this.jSPlugin.id,"-inspectInfoControl-left' style='display:flex;'></div><div id='").concat(this.jSPlugin.id,"-inspectInfoControl-right' style='display:flex'></div>");else{var c=document.createElement("div");c.setAttribute("id","".concat(this.jSPlugin.id,"-inspectInfoControl")),c.setAttribute("class","inspectInfo-controls"),c.innerHTML="<div id='".concat(this.jSPlugin.id,"-inspectInfoControl-left' class=\"inspectInfo-controls-left\" style='display:flex;overflow:hidden;'></div><div id='").concat(this.jSPlugin.id,"-inspectInfoControl-right' class=\"inspectInfo-controls-right\" style='display:flex;'></div>");var l={height:"58px",display:"flex","justify-content":"space-between",top:0,"z-index":999,color:"#000000",width:"".concat(this.jSPlugin.width+290,"px"),position:"relative","align-items":"center",background:"#ffffff","border-bottom":"1px solid #D9D9D9","box-sizing":"border-box"};c.style=Ct(l),document.getElementById("".concat(s,"-wrap")).insertBefore(c,document.getElementById(this.jSPlugin.id));var d=setInterval((function(){window.EZUIKit[e.jSPlugin.id].state.EZUIKitPlayer.init&&clearInterval(d)}),50)}else document.getElementById("".concat(this.jSPlugin.id,"-inspectInfoControl"))&&document.getElementById("".concat(this.jSPlugin.id,"-inspectInfoControl")).parentElement.removeChild(document.getElementById("".concat(this.jSPlugin.id,"-inspectInfoControl")));if(this.isNeedRenderHeader)if(document.getElementById("".concat(this.jSPlugin.id,"-headControl")))document.getElementById("".concat(this.jSPlugin.id,"-headControl")).innerHTML="<div id='".concat(this.jSPlugin.id,"-headControl-left' style='display:flex;'></div><div id='").concat(this.jSPlugin.id,"-headControl-right' style='display:flex'></div>");else{var u=document.createElement("div");u.setAttribute("id","".concat(this.jSPlugin.id,"-headControl")),u.setAttribute("class","header-controls"),u.innerHTML="<div id='".concat(this.jSPlugin.id,"-headControl-left' class=\"header-controls-left\" style='display:flex; max-width: 70%; align-items: center; overflow: hidder;'></div><div id='").concat(this.jSPlugin.id,"-headControl-right' class=\"header-controls-right\" style='display:flex; align-items: center;'></div>");var m={height:"56px",display:"flex","justify-content":"space-between",top:0,"z-index":999,color:"#FFFFFF",width:this.jSPlugin.width+"px",padding:"0 16px","box-sizing":"border-box",position:"relative","align-items":"center",background:"#000000"};u.style=Ct(m),document.getElementById("".concat(s,"-wrap")).insertBefore(u,document.getElementById(s));var h=setInterval((function(){window.EZUIKit[e.jSPlugin.id].state.EZUIKitPlayer.init&&clearInterval(h)}),50)}else document.getElementById("".concat(this.jSPlugin.id,"-headControl"))&&document.getElementById("".concat(this.jSPlugin.id,"-headControl")).parentElement.removeChild(document.getElementById("".concat(this.jSPlugin.id,"-headControl")));if(this.isNeedRenderFooter)if(document.getElementById("".concat(this.jSPlugin.id,"-ez-iframe-footer-container")))document.getElementById("".concat(this.jSPlugin.id,"-ez-iframe-footer-container"))&&(document.getElementById("".concat(this.jSPlugin.id,"-ez-iframe-footer-container")).style.marginTop="-".concat("56px","px"));else{var p=document.createElement("div");p.setAttribute("id","".concat(this.jSPlugin.id,"-ez-iframe-footer-container")),p.setAttribute("class","ez-iframe-footer-container");var g={position:"relative",display:"flex",height:"56px","flex-wrap":"wrap","justify-content":"center","z-index":999,top:0,color:"#FFFFFF",width:this.jSPlugin.width+"px","align-items":"center","background-color":"#000000","font-size":"14px"};p.style=Ct(g),p.innerHTML='\n <div id="'.concat(this.jSPlugin.id,"-audioControls\" class=\"footer-controls\" style='display:flex;justify-content: center;padding: 0 4%;width:100%;z-index:999;position: relative;'>\n <div id='").concat(this.jSPlugin.id,"-audioControls-left' class=\"footer-controls-left\" style='display:flex;margin-lefacti'></div><div id='").concat(this.jSPlugin.id,"-audioControls-right' class=\"footer-controls-right\" style='display:flex'></div>\n </div>\n "),x(p,document.getElementById(s))}else document.getElementById("".concat(this.jSPlugin.id,"-ez-iframe-footer-container"))&&document.getElementById("".concat(this.jSPlugin.id,"-ez-iframe-footer-container")).parentElement.removeChild(document.getElementById("".concat(this.jSPlugin.id,"-ez-iframe-footer-container")));this.isNeedRenderInspectInfo&&document.getElementById("".concat(this.jSPlugin.id,"-inspectInfoControl"))&&(document.getElementById("".concat(this.jSPlugin.id,"-inspectInfoControl")).style.background=r.backgroundColor,document.getElementById("".concat(this.jSPlugin.id,"-inspectInfoControl")).style.color=r.color,r.btnList.map((function(t,n){t.isrender&&e.renderInspectInfo(t.iconId,t)}))),this.isNeedRenderHeader&&document.getElementById("".concat(this.jSPlugin.id,"-headControl"))&&(document.getElementById("".concat(this.jSPlugin.id,"-headControl")).style.background=o.backgroundColor,document.getElementById("".concat(this.jSPlugin.id,"-headControl")).style.color=o.color,o.btnList.map((function(t,n){t.isrender&&e.renderHeader(t.iconId,t)}))),this.isNeedRenderFooter&&document.getElementById("".concat(this.jSPlugin.id,"-audioControls"))&&(document.getElementById("".concat(this.jSPlugin.id,"-audioControls")).style.background=a.backgroundColor,document.getElementById("".concat(this.jSPlugin.id,"-audioControls")).style.color=a.color,a.btnList.map((function(t,n){t.isrender&&e.renderFooter(t.iconId,t)}))),this.inspectMapWin=new ht(this.jSPlugin),this.inspectSmallWin=new Pt(this.jSPlugin,this.inspectMode,this.inspectMapWin,this.changeInspectMode,this.decoderState)}},{key:"renderThemeData",value:function(){var e=this,t=this.decoderState.state.isEditing,n=this.themeData,i=n.inspectInfo,o=n.header,a=n.footer;if(this.isNeedRenderInspectInfo&&i&&(document.getElementById("".concat(this.jSPlugin.id,"-inspectInfoControl")).style.background=i.backgroundColor.replace("-diy",""),document.getElementById("".concat(this.jSPlugin.id,"-inspectInfoControl")).style.color=i.color.replace("-diy",""),i.btnList.map((function(t,n){t.isrender&&e.setDecoderState(p({},t.iconId,e.decoderState.state[t.iconId]))}))),this.isNeedRenderHeader&&o&&(document.getElementById("".concat(this.jSPlugin.id,"-headControl")).style.background=o.backgroundColor.replace("-diy",""),document.getElementById("".concat(this.jSPlugin.id,"-headControl")).style.color=o.color.replace("-diy",""),o.btnList&&o.btnList.map((function(t,n){t.isrender&&e.setDecoderState(p({},t.iconId,e.decoderState.state[t.iconId]))}))),this.isNeedRenderFooter&&a)document.getElementById("".concat(this.jSPlugin.id,"-audioControls")).style.background=a.backgroundColor.replace("-diy",""),document.getElementById("".concat(this.jSPlugin.id,"-audioControls")).style.color=a.color.replace("-diy",""),a.btnList.map((function(n,i){if(n.isrender&&e.setDecoderState(p({},n.iconId,e.decoderState.state[n.iconId])),0==i&&!e.themeInited&&e.activeThemeStatus)var o=setInterval((function(){window.EZUIKit[e.jSPlugin.id].state.EZUIKitPlayer.init&&(clearInterval(o),1!=e.themeData.customConfig.bellPoster||t?e.jSPlugin.play():e.jSPlugin.pluginStatus.loadingClear(),e.themeInited=!0)}),50)})),this.setDecoderState({cloudRec:"cloud.rec"===A(this.jSPlugin.url).type,rec:"rec"===A(this.jSPlugin.url).type,type:A(this.jSPlugin.url).type});else if(!this.themeInited&&this.activeThemeStatus)var r=setInterval((function(){window.EZUIKit[e.jSPlugin.id].state.EZUIKitPlayer.init&&(clearInterval(r),e.themeData&&e.themeData.customConfig&&1==e.themeData.customConfig.bellPoster&&!t?e.jSPlugin.pluginStatus.loadingClear():e.jSPlugin.play(),e.themeInited=!0)}),50);var s=setInterval((function(){window.EZUIKit[e.jSPlugin.id].state.EZUIKitPlayer.init&&(clearInterval(s),e.reSizeVideo(e.videoWidth,e.videoHeight))}),50);this.jSPlugin.Zoom||(this.jSPlugin.Zoom=new Oe(this.jSPlugin)),this.getInspectDevInfo(this.jSPlugin,!0,!1)}},{key:"getInspectRecord",value:function(){var e=this;!function(e,t,n){var i={accessToken:e.accessToken||e.token.deviceToken.video,deviceSerial:A(e.url).deviceSerial},o="".concat(e.env.domain,"/api/service/devicekit/bodycamera/inspect/detail/latest");Ye(o,"GET",i,(function(e){t&&t(e)}),(function(e){n&&n(e)}),{"Content-Type":"application/x-www-form-urlencoded"})}(this.jSPlugin,(function(t){if(200==t.meta.code&&t.data){var n=t.data;n.inspectRange&&e.inspectMapWin.createPolygon(n.inspectRange,"#407AFF","dashed",4,1,"#407AFF",.08),n.inspectPoints&&n.inspectPoints.length>0&&e.inspectMapWin.createInspectPoints(n.inspectPoints),"video"===e.inspectMode&&e.inspectMapWin.map.removeOverlay(e.inspectMapWin.inspectRange),document.getElementById("".concat(e.jSPlugin.id,"-inspectInfo-inspectName"))&&n.inspectName&&(document.getElementById("".concat(e.jSPlugin.id,"-inspectInfo-inspectName")).innerText=""+n.inspectName),document.getElementById("".concat(e.jSPlugin.id,"-inspectInfo-inspectBeginTime"))&&n.beginTime&&(document.getElementById("".concat(e.jSPlugin.id,"-inspectInfo-inspectBeginTime")).innerText="巡检开始时间:"+n.beginTime),document.getElementById("".concat(e.jSPlugin.id,"-header-inspectTime"))&&e.timer.createInterval("InspectTimer",(function(){document.getElementById("".concat(e.jSPlugin.id,"-header-inspectTime")).innerHTML=e.renderInspectTime(n.beginTime)}),1e3),document.getElementById("".concat(e.jSPlugin.id,"-inspectInfo-inspectPerson"))&&n.inspectPerson&&(document.getElementById("".concat(e.jSPlugin.id,"-inspectInfo-inspectPerson")).innerText="本地巡检员:"+n.inspectPerson),e.inspectInfo=n,n.inspectRecordId&&_t(e.jSPlugin,n.inspectRecordId,(function(t){200==t.meta.code&&t.data&&(e.inspectMapWin.createTrack(t.data,!0),e.timer.createInterval("TraceTimer",(function(){n.inspectRecordId&&_t(e.jSPlugin,n.inspectRecordId,(function(t){200==t.meta.code&&t.data&&e.inspectMapWin.createTrack(t.data,!1)}),(function(){}))}),5e3))}),(function(){})),e.InspectEvent=new Et(e.jSPlugin,n.inspectRecordId,e.timer)}else e.InspectEvent=new Et(e.jSPlugin,null,e.timer)}),(function(e){}))}},{key:"getInspectDevInfo",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];!function(e,t,n){var i={accessToken:e.accessToken||e.token.deviceToken.video,deviceSerial:A(e.url).deviceSerial},o="".concat(e.env.domain,"/api/service/devicekit/bodycamera");Ye(o,"GET",i,(function(e){t&&t(e)}),(function(e){n&&n(e)}),{"Content-Type":"application/x-www-form-urlencoded"})}(e,(function(o){o.meta&&200==o.meta.code&&o.data?1===o.data.status?(i&&!t.decoderState.state.play&&(t.jSPlugin.pluginStatus.loadingStart(t.jSPlugin.id),t.jSPlugin.pluginStatus.loadingSetText({text:"视频加载中"}),t.jSPlugin.play()),t.globalContainer.globalContainerToggle("".concat(t.jSPlugin.id,"-inspect-global-box"),!1),document.getElementById("".concat(t.jSPlugin.id,"-header-deviceName"))&&(document.getElementById("".concat(t.jSPlugin.id,"-header-deviceName")).innerText="".concat(o.data.deviceName,"(").concat(o.data.deviceSerial,")"),document.getElementById("".concat(t.jSPlugin.id,"-header-deviceName")).setAttribute("title","".concat(o.data.deviceName,"(").concat(o.data.deviceSerial,")"))),document.getElementById("".concat(t.jSPlugin.id,"-header-signalType"))&&(document.getElementById("".concat(t.jSPlugin.id,"-header-signalType")).innerHTML=t.renderSignalType(o.data.signalType)),document.getElementById("".concat(t.jSPlugin.id,"-header-batteryStatus"))&&(document.getElementById("".concat(t.jSPlugin.id,"-header-batteryStatus")).innerHTML=t.renderBatteryStatus(o.data.batteryStatus)),t.timer.createInterval("InspectDevInfoTimer",(function(){t.getInspectDevInfo(e,!1,!1)}),3e5),n&&t.getInspectRecord()):(t.globalContainer.globalContainerToggle("".concat(t.jSPlugin.id,"-inspect-loading-box"),!1),t.jSPlugin.stop(),t.globalContainer.deviceErrorInfo({tips:"当前设备未在巡检中",refreshBtn:"刷新",refreshShow:!0},(function(){t.globalContainer.globalContainerToggle("".concat(t.jSPlugin.id,"-no-inspect-box"),!1),t.globalContainer.globalContainerToggle("".concat(t.jSPlugin.id,"-inspect-loading-box"),!0),t.getInspectDevInfo(e,!0,!0)}))):(t.globalContainer.globalContainerToggle("".concat(t.jSPlugin.id,"-inspect-loading-box"),!1),t.jSPlugin.stop(),t.globalContainer.deviceErrorInfo({tips:o.meta.message,refreshShow:!1}))}),(function(){t.globalContainer.globalContainerToggle("".concat(t.jSPlugin.id,"-inspect-global-box"),!1)}))}},{key:"fetchThemeData",value:function(e){var t=this;Ue(this.jSPlugin,e,(function(e){if(0!==e.meta.code||!e.data)return t.activeThemeStatus=!1,t.jSPlugin.pluginStatus.loadingClear(),"111021"==e.meta.code?(t.globalContainer.globalContainerToggle("".concat(t.jSPlugin.id,"-inspect-loading-box"),!1),t.jSPlugin.stop(),t.globalContainer.deviceErrorInfo({tips:"无效的模板id",refreshBtn:"刷新",refreshShow:!1}),void(t.activeThemeStatusTxt="无效的模板id")):"111023"==e.meta.code?(t.globalContainer.globalContainerToggle("".concat(t.jSPlugin.id,"-inspect-loading-box"),!1),t.jSPlugin.stop(),t.globalContainer.deviceErrorInfo({tips:"您的试用特权已到期,需前往轻应用控制台购买后使用。",refreshBtn:"刷新",refreshShow:!1}),void(t.activeThemeStatusTxt="试用特权已到期")):(t.globalContainer.globalContainerToggle("".concat(t.jSPlugin.id,"-inspect-loading-box"),!1),t.jSPlugin.stop(),t.globalContainer.deviceErrorInfo({tips:"模板未激活,请先在开放平台轻应用控制台购买模板",refreshBtn:"刷新",refreshShow:!1}),void(t.activeThemeStatusTxt="模板未激活"));t.activeThemeStatus=!0,t.themeData=e.data,t.jSPlugin.capacity?(t.initThemeData(),t.renderThemeData()):setTimeout((function(){t.initThemeData(),t.renderThemeData()}),300)}),(function(){t.themeData=kt,t.themeData.header&&(t.themeData.header.btnList=t.themeData.header.btnList.sort((function(e,t){return e.btnKey.split("-")[3]-t.btnKey.split("-")[3]}))),t.themeData.footer&&(t.themeData.footer.btnList=t.themeData.footer.btnList.sort((function(e,t){return e.btnKey.split("-")[3]-t.btnKey.split("-")[3]}))),t.initThemeData(),t.renderThemeData()}))}},{key:"reSizeVideo",value:function(e,t){if(document.getElementById("".concat(this.jSPlugin.id)).style.width=e+"px",document.getElementById("".concat(this.jSPlugin.id)).style.height=t+"px",this.jSPlugin&&this.jSPlugin.bPlay)this.jSPlugin.JS_Resize(e,t);else{document.getElementById("".concat(this.jSPlugin.id,"-player"))&&(document.getElementById("".concat(this.jSPlugin.id,"-player")).width=e,document.getElementById("".concat(this.jSPlugin.id,"-player")).height=t,document.getElementById("".concat(this.jSPlugin.id,"-player")).style.width=e+"px",document.getElementById("".concat(this.jSPlugin.id,"-player")).style.height=t+"px",document.getElementById("".concat(this.jSPlugin.id,"-container-0")).style.height=t+"px");var n=1;if(document.getElementById("".concat(this.jSPlugin.id,"canvas0")))navigator.userAgent.match(/(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i)&&(n=2),document.getElementById("".concat(this.jSPlugin.id,"canvas0")).style.width=e*n+"px",document.getElementById("".concat(this.jSPlugin.id,"canvas0")).style.height=t*n+"px",document.getElementById("".concat(this.jSPlugin.id,"canvas0")).width=e*n,document.getElementById("".concat(this.jSPlugin.id,"canvas0")).height=t*n,document.getElementById("".concat(this.jSPlugin.id,"canvas0")).parentNode.style.width=e*n+"px",document.getElementById("".concat(this.jSPlugin.id,"canvas0")).parentNode.style.height=t*n+"px",document.getElementById("".concat(this.jSPlugin.id,"canvas_draw0")).height=t*n}}},{key:"reSize",value:function(e,t){var n=.3333*e,i=.3333*t;document.getElementById("".concat(this.jSPlugin.id,"-inspectInfoControl"))&&(document.getElementById("".concat(this.jSPlugin.id,"-inspectInfoControl")).style.width=e+this.jSPlugin.inspectVideoWidth+"px"),document.getElementById("".concat(this.jSPlugin.id,"-headControl"))&&(document.getElementById("".concat(this.jSPlugin.id,"-headControl")).style.width=e+"px"),document.getElementById("".concat(this.jSPlugin.id,"-headControl"))&&(document.getElementById("".concat(this.jSPlugin.id,"-ez-iframe-footer-container")).style.width=e+"px"),"video"===this.jSPlugin.Theme.inspectMode?(this.reSizeVideo(e,t),document.getElementById("".concat(this.jSPlugin.id,"-headControl"))&&(document.getElementById("".concat(this.jSPlugin.id,"-ez-iframe-footer-container")).style.top=0),document.getElementById("".concat(this.jSPlugin.id,"-mapbox")).style.width=n+"px",document.getElementById("".concat(this.jSPlugin.id,"-mapbox")).style.height=i+"px"):(document.getElementById("".concat(this.jSPlugin.id,"-headControl"))&&(document.getElementById("".concat(this.jSPlugin.id,"-ez-iframe-footer-container")).style.top=t+"px"),this.reSizeVideo(n,i),document.getElementById("".concat(this.jSPlugin.id,"-mapbox")).style.width=e+"px",document.getElementById("".concat(this.jSPlugin.id,"-mapbox")).style.height=t+"px"),document.getElementById("".concat(this.jSPlugin.id,"-miniToggle")).style.bottom=i/2+96-30+"px",document.getElementById("".concat(this.jSPlugin.id,"-miniToggle")).style.right=this.jSPlugin.inspectVideoWidth+n+"px"}}])}(),jt=function(){return m((function e(t){var n=this;if(l(this,e),p(this,"changeInspectMode",(function(e){n.inspectMode=e})),this.jSPlugin=t,this.videoWidth=t.width,this.videoHeight=t.height,this.inspectMode="video",this.autoFocus=0,this.decoderState={state:{isEditing:!1,play:!1,sound:!1,recordvideo:!1,recordCount:"00:00",talk:!1,mute:!1,cloudRec:"cloud.rec"===A(t.url).type,rec:"rec"===A(t.url).type,type:A(t.url).type}},this.isMobile=navigator.userAgent.match(/(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i),void 0!==t.isMobile&&(this.isMobile=t.isMobile),this.themeData=kt,"themeData"==this.jSPlugin.themeId&&(this.themeData=this.jSPlugin.params.themeData),this.timer||(this.timer=new mt(t)),this.jSPlugin.themeId)if(this.isMobile||(this.inspect=new xt(this.jSPlugin,this.themeData,this.setDecoderState,this.decoderState,this.inspectMode,this.changeInspectMode,this.timer)),"themeData"===this.jSPlugin.themeId)this.themeData=this.jSPlugin.params.themeData,this.inspect.initThemeData(),this.inspect.renderThemeData();else this.inspect.fetchThemeData(this.jSPlugin.themeId);this.jSPlugin.Talk||(this.jSPlugin.Talk=new Pe(this.jSPlugin)),P("".concat(this.jSPlugin.staticPath,"/css/theme.css")),P("".concat(this.jSPlugin.staticPath,"/css/component.css")),P("".concat(this.jSPlugin.staticPath,"/css/inspectTheme.css"))}),[{key:"setDecoderState",value:function(e,t){var n=this,i="#FFFFFF",o="#1890FF";Object.keys(e).map((function(t){switch(t){case"talk":document.getElementById("".concat(n.jSPlugin.id,"-talk"))&&(document.getElementById("".concat(n.jSPlugin.id,"-talk")).className=e[t]?"active":"",document.getElementById("".concat(n.jSPlugin.id,"-talk-content")).childNodes[1].style.fill=e[t]?o:i,document.getElementById("".concat(n.jSPlugin.id,"-talk-content")).childNodes[2].style.color=e[t]?o:i);break;case"sound":document.getElementById("".concat(n.jSPlugin.id,"-sound"))&&(e[t]?(document.getElementById("".concat(n.jSPlugin.id,"-sound-content")).children[0].children[1].style="display:inline-block",document.getElementById("".concat(n.jSPlugin.id,"-sound-content")).children[0].children[0].style="display:none",document.getElementById("".concat(n.jSPlugin.id,"-sound")).className=e[t]?"active":"",document.getElementById("".concat(n.jSPlugin.id,"-sound-content")).childNodes[0].children[1].style.fill=e[t]?o:i,document.getElementById("".concat(n.jSPlugin.id,"-sound-label")).style.color=e[t]?o:i):(document.getElementById("".concat(n.jSPlugin.id,"-sound-content")).children[0].children[0].style="display:inline-block",document.getElementById("".concat(n.jSPlugin.id,"-sound-content")).children[0].children[1].style="display:none",document.getElementById("".concat(n.jSPlugin.id,"-sound")).className=e[t]?"active":"",document.getElementById("".concat(n.jSPlugin.id,"-sound-label")).style.color=e[t]?o:i))}n.decoderState.state=Object.assign(n.decoderState.state,e)}))}},{key:"setDisabled",value:function(e){var t=this.decoderState.state,n=t.sound;t.hd,null!=document.getElementById("".concat(this.jSPlugin.id,n?"-sound-icon":"-nosound-icon"))&&document.getElementById("".concat(this.jSPlugin.id,n?"-sound-icon":"-nosound-icon")).setAttribute("style",e?"cursor: not-allowed;fill: gray":"cursor: default"),null!=document.getElementById("".concat(this.jSPlugin.id,"-sound-label"))&&document.getElementById("".concat(this.jSPlugin.id,"-sound-label")).setAttribute("style",e?"cursor: not-allowed; color: gray":"cursor: default"),null!=document.getElementById("".concat(this.jSPlugin.id,"-talk-icon"))&&document.getElementById("".concat(this.jSPlugin.id,"-talk-icon")).setAttribute("style",e?"cursor: not-allowed;fill: gray":"cursor: default"),null!=document.getElementById("".concat(this.jSPlugin.id,"-talk-label"))&&document.getElementById("".concat(this.jSPlugin.id,"-talk-label")).setAttribute("style",e?"cursor: not-allowed; color: gray":"cursor: default")}},{key:"inspectEnding",value:function(){var e=document.createElement("div");e.id="".concat(this.jSPlugin.id,"-inspect-ending-box"),e.style="width:100%; position: absolute; z-index: 10000; top:58px; bottom:0; left:0; background: #ffffff;",e.innerHTML='<div style="\n overflow: auto;\n box-sizing: border-box;\n font-size: 14px;\n color: #595959;\n text-align: center;\n display: flex;\n align-items: center;\n justify-content: center;\n height: 100%;\n ">\n <div>\n <div style="text-align:center; height: 21px;">\n <svg t="1689074472491" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="7172" xmlns:xlink="http://www.w3.org/1999/xlink" width="21" height="21"><path d="M512 64a448 448 0 1 0 0 896A448 448 0 0 0 512 64z m-32 232c0-4.416 3.584-8 8-8h48c4.416 0 8 3.584 8 8v272A8 8 0 0 1 536 576h-48a8 8 0 0 1-8-8v-272zM512 736A48 48 0 1 1 512 640a48 48 0 0 1 0 96z" fill="#FF4D4F" p-id="7173"></path></svg>\n </div>\n <div style="color: #595959; font-size:14px; margin: 5px 0 16px;font-weight: 400; text-align: center;">巡检已结束</div>\n </div>\n </div>\n ',document.getElementById("".concat(this.jSPlugin.id,"-wrap")).appendChild(e),this.jSPlugin.Zoom&&this.jSPlugin.Zoom.stopZoom()}}])}(),At=function(){return m((function e(){l(this,e),this.events={}}),[{key:"on",value:function(e,t){e&&t&&(this.events[e]=this.events[e]||[],this.events[e].push(t))}},{key:"emit",value:function(e,t){e&&this.events[e]&&this.events[e].forEach((function(e){return e(t)}))}},{key:"off",value:function(e,t){e&&t&&this.events[e]&&this.events[e].splice(this.events[e].indexOf(t),1)}},{key:"once",value:function(e,t){var n=this;this.on(e,(function i(){var o=Array.prototype.slice.call(arguments);t.apply(null,o),n.off(e,i)}))}},{key:"removeAllListener",value:function(){this.events={}}}])}();function Dt(e){document.getElementById("".concat(e,"-player"))&&document.getElementById("".concat(e,"-container-0")).removeChild(document.getElementById("".concat(e,"-player")))}var Rt=function(e,t){if(void 0===e)return t.themeData?{templateType:"themeData",templateId:"themeData"}:{templateType:"local",templateId:""};if("string"==typeof e){if(32===e.length)return{templateType:"remote",templateId:e};if(-1!==["theme","standard"].indexOf(e))return"simple"===e&&void 0===t.header&&void 0===t.footer?{templateType:"local",templateId:""}:{templateType:"iframe",templateId:e};if(-1!==["pcLive","pcRec","mobileLive","mobileRec","noData","security","voice","simple","mobileCall","miniRec"].indexOf(e))return-1!=t.url.indexOf("rec")&&"simple"!=t.template&&"miniRec"!=t.id?{templateType:"local",templateId:L()?"mobileRec":"pcRec"}:{templateType:"local",templateId:e};if(t&&t.isCall)return{templateType:"invalid",templateId:e}}},Lt=function(){var e=window.navigator.userAgent.toLowerCase(),t=(/version.*safari/.test(e),/chrome/.test(e));/gecko/.test(e)&&/webkit/.test(e);if(L())return!1;if(t){return function(){for(var e=window.navigator.userAgent.split(" "),t="",n=0;n<e.length;n++)/chrome/i.test(e[n])&&(t=e[n]);return!!t&&Number(t.split("/")[1].split(".")[0])}()>91&&!!window.SharedArrayBuffer}return!1};var Bt=function(e){if(console.log("err",e),e&&e.retcode)return String(e.retcode);if(e&&e.code){var t=String(e.code);return"1".concat(t.padStart(5,"0"))}if(e&&e.errorCode){var n=String(e.errorCode);return"39".concat(n.padStart(4,"0"))}return"400001"};function Mt(){var e,t={},n=navigator.userAgent.toLowerCase();if((e=n.match(/rv:([\d.]+)\) like gecko/))||(e=n.match(/msie ([\d\.]+)/))?t.ie=e[1]:(e=n.match(/edge\/([\d\.]+)/))?t.edge=e[1]:(e=n.match(/firefox\/([\d\.]+)/))?t.firefox=e[1]:(e=n.match(/(?:opera|opr).([\d\.]+)/))?t.opera=e[1]:(e=n.match(/chrome\/([\d\.]+)/))?t.chrome=e[1]:(e=n.match(/version\/([\d\.]+).*safari/))&&(t.safari=e[1]),t.chrome){var i=t.chrome,o=i.indexOf(".");return Number(i.substring(0,o))}return t.ie?console.info("%c1>your browser is IE ,it does not support play without plugin","color: red"):t.safari?console.info("%c1>your browser is safari ,it does not support softV2.0 or hard decode","color: red"):t.firefox?console.info("%c1>your browser is Firefox ,it only support soft decode","color: red"):console.info("%c1>your browser does not support play without plugin","color: red"),-1}function Ot(e){return Mt()>=94?(e&&e(!0),!0):(e&&e(!1),!1)}var zt=function(){function i(a){var r=this;l(this,i),p(this,"_isCloudRecord",!1),p(this,"_controllers",[]),p(this,"_handleRealUrl",(function(e){var t=JSON.parse(localStorage.getItem("ezuikit_addressList"));return Array.isArray(t[r.deviceSerial+"_"+r.channelNo])&&t[r.deviceSerial+"_"+r.channelNo].map((function(t){t.wsUrl=e.replace(/(wss:\/\/)([^\/:]+)(:\d+)/,"$1".concat(t.domain,":").concat(t.port))})),localStorage.setItem("ezuikit_addressList",JSON.stringify(t)),Array.isArray(t[r.deviceSerial+"_"+r.channelNo])&&t[r.deviceSerial+"_"+r.channelNo].length>0?t[r.deviceSerial+"_"+r.channelNo][0].wsUrl:e})),i._instanceStyle(),this.isStoping=!1;var s,c,d=a.autoplay,u=void 0===d||d;if(this.params=a,this.autoplay=u,this.talkChannelNo=a.talkChannelNo||null,this.eventEmitter=new At,this.timeZone=0,this.ptzSpeed=a.ptzSpeed||2,this.download=void 0===a.download||a.download,this.downloadRecord=void 0===a.downloadRecord||a.downloadRecord,this.recordRes={},this.disableRenderPrivateData=void 0===a.disableRenderPrivateData||a.disableRenderPrivateData,this.ptzSpeedOptions={slow:1,mid:2,fast:3},window.EZUIKit[a.id]={state:{EZUIKitPlayer:{init:window.EZUIKit[a.id]&&window.EZUIKit[a.id].state&&window.EZUIKit[a.id].state.EZUIKitPlayer.init||!1,themeInit:window.EZUIKit[a.id]&&window.EZUIKit[a.id].state&&window.EZUIKit[a.id].state.EZUIKitPlayer.themeInit||!1,talkInit:window.EZUIKit[a.id]&&window.EZUIKit[a.id].state&&window.EZUIKit[a.id].state.EZUIKitPlayer.talkInit||!1}}},!this.params.id)throw new Error("id param is required!");if(!document.getElementById(this.params.id))throw new Error("#".concat(this.params.id," node does not exist"));this.appKey="test",this.dataReport=!1!==a.dataReport,this.reportHTTP=!0===a.reportHTTP,this.monitorReport=!0,this.dataReport?this.reportHTTP?this.monitorReport=!0:"https:"!==window.location.protocol||(s=window.location.hostname,4===(c=s.split(".").map((function(e){return!Number.isNaN(e)}))).length&&c.every(Boolean))?this.monitorReport=!1:this.monitorReport=!0:this.monitorReport=!1,new ee(this.params.env?this.params.env.domain:null),this.id=a.id,this.width=a.width,this.height=a.height,this.fullScreenWidth=0,this.fullScreenHeight=0,this.isCall=a.isCall||!1,this.isWebConsole=a.isWebConsole||!1,this.callTime=a.callTime||null,this.hangUpCallback=a.hangUpCallback||null,this.isNeedBellRing=!1!==a.isNeedBellRing,this.url=a.url,this.accessToken=a.accessToken,this.deviceSerial=A(a.url).deviceSerial,this.channelNo=A(a.url).channelNo,this.themeId=Rt(a.template,a).templateId,this.themeId=Rt(a.template,a).templateId?Rt(a.template,a).templateId:"simple",this.id=a.id,this.audio=!0,this.audioOnly=!0,this.poster=a.poster,this.speed=1,this.disabledTimeLine=!1,this.disabledPTZ=!1,this.capacity=null,this.playTimer=null,this.env={domain:W},this.isMobile=L(),this.support3DZoom=!1,this.use3DZoom=!1,this.is3DZooming=!1,this.useHardDev=void 0!==a.useHardDev&&a.useHardDev,this.host="open.ys7.com",this._isCloudRecord=a.isCloudRecord,this._spaceId=a.isCloudRecord?I("spaceId",this.url):void 0,this.waterMark_JSPlugin=!1,this.useSeek=a.useSeek,this.dpr=a.dpr||1,this.decoderType=a.decoderType||"auto",this.videoLevelList=[],this.videoLevel=1,this.streamTypeIn=1,this.language=a.language||"zh",this.languageList=a.languageList||["zh","en"],-1===this.languageList.indexOf(this.language)&&(console.warn("语言【".concat(this.language,"】暂不支持,已切换至中文")),this.language="zh"),this.i18n=new t({zh:de,en:ue}),this.i18n.switchTranslation(this.language||"zh"),this.token=a.token||{},this.deviceInfo={},this.quality=a.quality,document.getElementById("".concat(this.id))&&void 0===this.initDOM&&(this.initDOM=document.getElementById("".concat(this.id)).cloneNode(!0)),this._isCurrentFullscreen=!1,this._isCurrentBrowserFullscreen=!1,this.isInspect=a.isInspect||!1,this.inspectRecordingDuration=a.inspectRecordingDuration||144e5,this.inspectVideoWidth=a.inspectVideoWidth||290,this.inspectVideoHeight=a.inspectVideoHeight||170,this._FECCorrectType=null,this._FECSplitIds="",this.initSuccessTime=0,this.initTime=0,this.gotWsUrlTime=0,this.startGetWsUrlTime=0,this.appearFirstFrameTime=0,this.openStreamTime=0,this.maxReloadTime=0,this.maxAddressAccount=a.maxAddressAccount||1e3,this.reloadCodeBalckList=a.reloadCodeBalckList||[5402,5406,5411,5507,5546,9048,9049,5451,5558],document.getElementById("".concat(this.id,"-wrap"))&&this.initDOM&&(document.getElementById("".concat(this.id,"-wrap")).parentNode.appendChild(this.initDOM),document.getElementById("".concat(this.id,"-wrap")).parentNode.removeChild(document.getElementById("".concat(this.id,"-wrap"))),delete this.initDOM),this.staticPath="https://openstatic.ys7.com/ezuikit_js/v8.1.6/ezuikit_static";var m,h,g=!this.useHardDev&&Lt()||this.useHardDev&&!Ot()&&(h=!1,!void(Mt()>=107&&window.VideoDecoder?VideoDecoder.isConfigSupported({codec:"hvc1.1.6.L123.00",hardwareAcceleration:"prefer-hardware"}).then((function(e){e.supported?(h=!0,m&&m({bSupHardDecHEVC:h})):m&&m({bSupHardDecHEVC:h})})):m&&m({bSupHardDecHEVC:h})))&&Lt()||this.useHardDev&&(Ot()||this.isSupHardDecHEVC()||Lt());this.isV3=g,"string"==typeof a.staticPath&&(a.staticPath.startsWith("http")?this.staticPath=a.staticPath:this.staticPath=e.getStaticPath(a.staticPath)),void 0!==a.audio&&(this.audio=a.audio),void 0!==a.audioOnly&&(this.audioOnly=a.audioOnly),void 0!==a.env&&(this.env=Object.assign(this.env,a.env)),void 0!==a.host&&(this.host=a.host),void 0!==a.isMobile&&(this.isMobile=a.isMobile),void 0!==a.disabledTimeLine&&(this.disabledTimeLine=a.disabledTimeLine),void 0!==a.disabledPTZ&&(this.disabledPTZ=a.disabledPTZ);var v=JSON.parse(localStorage.getItem("ezuikit_addressList"))||{},y=Object.keys(v);y.length>this.maxAddressAccount&&y.map((function(e,t){t<y.length&&t>y.length-r.maxAddressAccount||delete v[e]})),v[this.deviceSerial+"_"+this.channelNo]||(v=f(f({},v),{},p({},this.deviceSerial+"_"+this.channelNo,[])),localStorage.setItem("ezuikit_addressList",JSON.stringify(v))),localStorage.getItem("ezuikit_reloadAddressList")&&localStorage.removeItem("ezuikit_reloadAddressList");!function(){var e=r;r.pluginStatus=new U(r,r.id),r.videoInitTime=Date.now(),r.videoPlayState=1,window.monitorExtendsInfo={protocol:"ezopen",url:r.url,serial:r.deviceSerial,no:r.channelNo,env:r.env.domain,type:A(r.url).type};var t=Object.assign({},a);(function(e,t){var n=[];return Object.keys(t).map((function(e){n.push("".concat(e,"=").concat(t[e]))})),fetch(e.env.domain+"/api/service/appKey/get?".concat(n.join("&")),{method:"GET"}).then((function(e){return e.json()})).then((function(e){return e}))})(r,{checkToken:r.accessToken||r.token.deviceToken.video,sn:r.deviceSerial,cno:r.channelNo}).then((function(e){e.data&&(r.appKey=e.data.appKey)})),r._autoSwitchByQuality().finally((function(){r.initEZUIKitPlayer(a).finally((function(){var n=Date.now();Ge(e,{deviceSerial:e.deviceSerial,localIndex:e.channelNo,accessToken:e.accessToken||e.token.deviceToken.video}).then((function(e){})).finally((function(i){r.autoplay?r._getRealUrlPromise(a.url).then((function(e){var i=Date.now();if(r.monitorReport&&window.ezuikitMonitor.report({action:1,logInfo:{pluginVersion:g?"v3":"v1",params:t},appKey:r.appKey}),e){var o=Date.now();r._pluginPlay(e,(function(){if(1===r.videoPlayState||4===r.videoPlayState){r.videoPlayState=2;var e=Date.now();r.monitorReport&&window.ezuikitMonitor.report({action:2,logInfo:{pluginVersion:r.isV3?"v3":"v1",loadTime:e-r.videoInitTime,loadTimeDesc:{initTime:r.initTime,stopTime:0,getWsTime:i-n,createWsTime:e-o}},appKey:r.appKey,loadTime:e-r.videoInitTime,initTime:r.initTime,getWsTime:i-n,createWsTime:e-o})}r.audio&&setTimeout((function(){r.openSound()}),100)}),(function(e){if(1===r.videoPlayState||4===r.videoPlayState){r.videoPlayState=3;var t=Date.now();r.monitorReport&&window.ezuikitMonitor.report({action:3,logInfo:{pluginVersion:r.isV3?"v3":"v1",loadTime:t-r.videoInitTime,err:e},errorCode:Bt(e),appKey:r.appKey,loadTime:t-r.videoInitTime})}r.Theme&&r.Theme.setDisabled(!0),r.isInspect?(r.pluginStatus.loadingSetTextWithBtn({mask:!0,maskStyle:"url(".concat(r.staticPath,"/imgs/bg.svg) no-repeat 100%/cover"),text:e&&e.msg,btnName:r.i18n.t("BTN_RETRY"),type:1}),r.Theme.jSPlugin.Zoom&&r.Theme.jSPlugin.Zoom.stopZoom(),r.Theme&&r.Theme.inspect&&r.Theme.inspect.InspectEvent&&r.Theme.inspect.InspectEvent.disableEvidenceBtn()):r.pluginStatus.loadingSetText({text:e&&e.msg||r.i18n.t("GET_PLAYURL_FAILED"),color:"red"})}))}else console.log("promise of one",e);window.EZUIKit[a.id].state.EZUIKitPlayer.init=!0,document.getElementById("".concat(a.id,"canvas_draw0"))&&(document.getElementById("".concat(a.id,"canvas_draw0")).style.border="none")})).catch((function(t){if(1===e.videoPlayState||4===e.videoPlayState){e.videoPlayState=3;var n=Date.now();e.monitorReport&&window.ezuikitMonitor.report({action:3,logInfo:{pluginVersion:e.isV3?"v3":"v1",loadTime:n-e.videoInitTime,err:t},errorCode:Bt(t),appKey:e.appKey,loadTime:n-e.videoInitTime})}e.Theme&&e.Theme.setDisabled(!0),e.isInspect?(e.pluginStatus.loadingSetTextWithBtn({mask:!0,maskStyle:"url(".concat(e.staticPath,"/imgs/bg.svg) no-repeat 100%/cover"),text:t&&t.msg,btnName:e.i18n.t("BTN_RETRY"),type:1}),e.Theme.jSPlugin.Zoom&&e.Theme.jSPlugin.Zoom.stopZoom(),e.Theme&&e.Theme.inspect&&e.Theme.inspect.InspectEvent&&e.Theme.inspect.InspectEvent.disableEvidenceBtn()):e.pluginStatus.loadingSetText({text:t&&t.msg||e.i18n.t("GET_PLAYURL_FAILED"),color:"red"})})):(window.EZUIKit[a.id].state.EZUIKitPlayer.init=!0,document.getElementById("".concat(a.id,"canvas_draw0"))&&(document.getElementById("".concat(a.id,"canvas_draw0")).style.border="none"))}))}))})),r.getDeviceCapacity(),re.createInstance(r.id,{rejection:!1,play:!1,pantile:!1,recordvideo:!1,talk:!1,expend:!1,webExpend:!1,zoom:!1,sound:!1,isEditing:!1,rec:!1,cloudRec:!1}),r.initSuccessTime=(new Date).getTime(),a.plugin&&-1!==a.plugin.indexOf("talk")&&(r.Talk=new Pe(r),window.EZUIKit[a.id].state.EZUIKitPlayer.talkInit=!0)}(),this.play=o((function(e){return r._play(e)}),500,!0),this.resume=o((function(e){return r._resume(e)}),500,!0),this.changePlayUrl=o((function(e,t,n){return r._changePlayUrl(e,t,n)}),500),window.addEventListener("beforeunload",(function(){console.log("退出页面,停止视频流"),re.removeInstance(r.id),r.stop()})),this._controllers=[],n.isEnabled&&(this._fullscreenChangeEvent=this._fullscreenChangeEvent.bind(this),n.on("change",this._fullscreenChangeEvent))}return m(i,[{key:"initEZUIKitPlayer",value:function(e){var t=this,n=e.id,i=e.width,o=void 0===i?600:i,r=e.height,s=void 0===r?400:r;if(!e.width||!e.height){var c=document.getElementById(n).getBoundingClientRect();!e.width&&c.width>0&&(o=c.width),!e.height&&c.height>0&&(s=c.height)}if(!document.getElementById("".concat(n,"-wrap"))){var l=document.createElement("div");l.id="".concat(n,"-wrap"),l.style="display:inline-block;width:".concat(o,"px;position:relative;vertical-align: bottom;"),document.getElementById(n).parentNode.insertBefore(l,document.getElementById(n)),document.getElementById(n).parentNode.removeChild(document.getElementById(n)),this.isInspect&&(l.style.height="".concat(s,"px"),this.width-=this.inspectVideoWidth,this.height-=this.inspectVideoHeight,o=this.width,s=this.height),l.innerHTML="<div id=".concat(n,"></div>"),document.getElementById(n).style="display:inline-block;width:".concat(o,"px;height:").concat(s,"px;"),document.getElementById(n).style.verticalAlign="top",this._$containerResizeEvent()}window.recTimer&&Array.isArray(window.recTimer[n])&&(window.recTimer[n].map((function(e){clearInterval(e)})),window.recTimer[n]=[]);var d=new le(this,n);this.Message=d;var u=new Promise((function(i,r){var c=t;t.randomNum=Math.random(),window.randomNum=t.randomNum;var l=new a({szId:n,iType:2,width:o,height:s,iMaxSplit:1,iCurrentSplit:1,szBasePath:"",staticPath:t.staticPath,isCloudRecord:t._isCloudRecord,downloadRecord:t.downloadRecord,env:t.env,oStyle:{border:"none",background:"#000000"},decoderType:t.params.decoderType,decodeEngine:void 0!==t.params.decodeEngine?t.params.decodeEngine:1,autoPlay:!1,dpr:t.params.dpr,url:t.params.url,debugDownloadData:t.params.debugDownloadData,disableRenderPrivateData:t.disableRenderPrivateData});t.pluginStatus.loadingStart(n),t.isCall||t.isInspect?t.pluginStatus.loadingSetText({text:t.i18n.t("VIDEO_LOADING")}):"miniRec"==t.themeId?t.pluginStatus.loadingSetText({text:""}):t.pluginStatus.loadingSetText({text:t.i18n.t("INIT_FINSHED")});var d=!1;l.EventCallback={openStreamCallback:function(){t.openStreamTime=(new Date).getTime(),d=!1},getStreamHeaderCallback:function(){t.getStreamHeaderTime=(new Date).getTime(),d=!1},getVideoStreamCallback:function(){t.getVideoStreamTime=(new Date).getTime(),t.isCall&&t.Theme&&t.Theme.decoderState&&t.Theme.decoderState.state.rejection&&t.stop((function(){t.pluginStatus.loadingClear(),t.pluginStatus.loadingSetTextWithBtn({text:t.i18n.t("CALL_END"),color:"white",isMobile:t.isMobile,type:2})})),t.isInspect&&t.Theme.decoderState.state.play&&("map"!==t.Theme.inspectMode&&t.Theme.jSPlugin.Zoom&&setTimeout((function(){t.Theme.jSPlugin.Zoom.startZoom()}),1e3),t.Theme&&t.Theme.inspect&&t.Theme.inspect.InspectEvent&&t.Theme.inspect.InspectEvent.enableEvidenceBtn())},firstFrameCallback:function(e){switch(e){case 0:t.decodeEngine="v3-soft";break;case 1:t.decodeEngine="v3-hard";break;case 2:t.decodeEngine="v1-soft"}console.log("final decodeEngine is :",t.decodeEngine);var n=JSON.parse(localStorage.getItem("ezuikit_addressList"));Array.isArray(n[c.deviceSerial+"_"+c.channelNo])&&(t.maxReloadTime=n[c.deviceSerial+"_"+c.channelNo].length)},appearFirstFrameCallback:function(){t.pluginStatus.loadingClear(),t.appearFirstFrameTime=(new Date).getTime(),document.getElementById("".concat(t.id,"-player"))&&(document.getElementById("".concat(t.id,"-player")).style.display="block"),"function"==typeof t.params.handleFirstFrameDisplay&&t.params.handleFirstFrameDisplay({retcode:0,id:t.params.id,type:"handleFirstFrameDisplay"}),"function"==typeof t.params.handleSuccess&&t.params.handleSuccess({retcode:0,id:t.params.id,type:"handleSuccess"})},averageStreamSuccessCallback:function(){t.Zoom=new Oe(t),t.averageStreamSuccessTime=t.initSuccessTime-t.initTime+(t.gotWsUrlTime-t.startGetWsUrlTime)+(t.appearFirstFrameTime-t.openStreamTime)},loadEventHandler:function(){},zoomEventResponse:function(){},windowEventSelect:function(e){},pluginErrorHandler:function(e,n,i){if(!(t.isCall&&t.Theme&&t.Theme.decoderState&&t.Theme.decoderState.state.rejection))if(1003===n)t.Theme&&t.Theme.setDecoderState({play:!1}),l.bPlay||(t.isCall?t.pluginStatus.loadingSetTextWithBtn({text:t.i18n.t("DISCONNECT"),color:"white",btnName:t.isMobile?t.i18n.t("BTN_RETRY"):t.i18n.t("BTN_RELOAD"),isMobile:t.isMobile,type:t.isCall?1:2}):t.isInspect&&(t.pluginStatus.loadingSetTextWithBtn({mask:!0,text:t.i18n.t("DISCONNECT"),btnName:t.i18n.t("BTN_RETRY"),type:1}),t.Theme.jSPlugin.Zoom&&t.Theme.jSPlugin.Zoom.stopZoom(),t.Theme&&t.Theme.inspect&&t.Theme.inspect.InspectEvent&&t.Theme.inspect.InspectEvent.disableEvidenceBtn()));else if(1!=i.errorCode){var o=function(){var e=Date.now();1===t.videoPlayState||4===t.videoPlayState?(t.videoPlayState=3,t.monitorReport&&window.ezuikitMonitor.report({action:3,logInfo:{pluginVersion:t.isV3?"v3":"v1",err:i,loadTime:e-t.videoInitTime},errorCode:Bt(i),appKey:t.appKey,loadTime:e-t.videoInitTime})):2===t.videoPlayState&&(t.videoPlayState=5,t.monitorReport&&window.ezuikitMonitor.report({action:5,logInfo:{pluginVersion:t.isV3?"v3":"v1",err:i,loadTime:e-t.videoInitTime},errorCode:Bt(i),appKey:t.appKey,loadTime:e-t.videoInitTime}));var n=t.i18n.t("DISCONNECT");n=t.i18n.t("39"+i.errorCode),t.Theme&&t.Theme.setDecoderState({play:!1}),t.pluginStatus.setPlayStatus({play:!1}),t.pluginStatus.loadingClear(),t.isCall?t.pluginStatus.loadingSetTextWithBtn({text:n,color:"white",btnName:t.isMobile?t.i18n.t("BTN_RETRY"):t.i18n.t("BTN_RELOAD"),isMobile:t.isMobile}):t.isInspect?(t.Theme.jSPlugin.Zoom&&t.Theme.jSPlugin.Zoom.stopZoom(),t.pluginStatus.loadingSetTextWithBtn({mask:!0,text:n,btnName:t.i18n.t("BTN_RETRY"),type:1}),t.Theme&&t.Theme.inspect&&t.Theme.inspect.InspectEvent&&t.Theme.inspect.InspectEvent.disableEvidenceBtn()):t.pluginStatus.loadingSetText({text:n,color:"red"}),"function"==typeof t.params.handleError&&t.params.handleError({msg:n,retcode:i.errorCode,id:t.params.id,type:"handleError"})};t.reloadCodeBalckList.indexOf(i.errorCode)>-1?o():t._reload(i).catch((function(e){o()}))}else t.pluginStatus.loadingClear(),t.Theme&&t.Theme.setDisabled(!1)},windowEventOver:function(e){},windowEventOut:function(e){},windowEventUp:function(e){},windowFullCcreenChange:function(e){},firstFrameDisplay:function(e,t,n){l.JS_SetCanFullScreen(!1)},performanceLack:function(){},mouseEvent:function(e,t,n){},setRunTimeInfoCallBack:function(n){var i=n.pstRuntimeInfo;if(5===i.nErrorCode)if(c.isInspect){c.pluginStatus.loadingClear(),c.Theme.jSPlugin.Zoom&&c.Theme.jSPlugin.Zoom.stopZoom(),(o=document.getElementById("".concat(t.id,"-loading-item-txt")))&&o.textContent===t.i18n.t("DEVICE_ENCRYPTED")||c.pluginStatus.loadingSetTextWithBtn({mask:!0,maskStyle:"url(".concat(t.staticPath,"/imgs/bg.svg) no-repeat 100%/cover"),text:t.i18n.t("DEVICE_ENCRYPTED"),color:"white",btnName:t.i18n.t("BTN_RETRY"),type:1})}else{var o=document.getElementById("".concat(t.id,"-loading-item-txt"));t.Theme.decoderState&&t.Theme.decoderState.state.play&&(null===o||-1===o.innerHTML.indexOf("设备已加密"))&&(c.pluginStatus.loadingClear(),c.pluginStatus.loadingSetText({text:t.i18n.t("DEVICE_ENCRYPTED"),color:"red"}))}if(!d&&9!==i.nErrorCode){var a=function(t){var n=I("begin",c.url);"function"==typeof e.handleError&&e.handleError({retcode:r,data:f(f({},s),{},{time:Number.isNaN(t)||void 0===t?n||(new Date).Format("yyyyMMdd")+"000000":new Date(t).Format("yyyyMMddhhmmss")}),id:c.params.id,type:"handleRunTimeInfoError"})};Dt(t.id);var r=-1,s=i;t._tempSeekTime?a(t._tempSeekTime.getTime()):t.getOSDTime().then((function(e){a(Number.isNaN(e.data)?void 0:1e3*e.data)})),setTimeout((function(){t.jSPlugin.JS_Stop(0),t.Theme&&t.Theme.setDecoderState({play:!1,sound:!1,recordvideo:!1,talk:!1,zoom:!1,capturePicture:!1})}),1e3)}d=!0},setAdditionDataCallBack:function(t){"function"==typeof e.handleAdditionData&&e.handleAdditionData({retcode:0,data:t,id:e.id,type:"handleAdditionData"})}},void 0!==e.handleTalkSuccess&&(t.handleTalkSuccess=e.handleTalkSuccess),void 0!==e.handleTalkError&&(t.handleTalkError=e.handleTalkError),t.jSPlugin=l,l.player.event.on("initializing",(function(e){var n,o;c.url.indexOf(".live")>-1?(n=c,o="".concat(n.env.domain,"/api/lapp/device/camera/list?accessToken=").concat(n.accessToken||n.token.deviceToken.video,"&deviceSerial=").concat(n.deviceSerial," "),fetch(o,{method:"POST",headers:{clientType:"ezuikit",sdkVersion:Fe}}).then((function(e){return e.json()})).then((function(e){return e})).catch((function(e){return e}))).then((function(e){if(200==e.code){if(Array.isArray(e.data)&&e.data.length>0){var n=e.data.findIndex((function(e){return e.channelNo==c.channelNo})),o=e.data[n];Ve(c).then((function(e){c.videoLevelList=e,"compatible"===e[0].type?t.url.indexOf(".hd.live")>0?(c.videoLevel=e[1].level,c.streamTypeIn=e[1].streamTypeIn):t.url.indexOf(".live")>0&&(c.videoLevel=e[0].level,c.streamTypeIn=e[0].streamTypeIn):e.map((function(e){e.level==o.videoLevel&&(c.videoLevel=e.level,c.streamTypeIn=e.streamTypeIn)}))})).catch((function(e){})).finally((function(){c._initTheme(),i({meta:{retcode:200,msg:c.i18n.t("client.init.INIT_SUCCESS")}})}))}}else c._initTheme(),i({meta:{retcode:200,msg:c.i18n.t("client.init.INIT_SUCCESS")}})})).catch((function(e){c._initTheme(),i({meta:{retcode:200,msg:c.i18n.t("client.init.INIT_SUCCESS")}})})):(t._initTheme(),i({meta:{retcode:200,msg:c.i18n.t("client.init.INIT_SUCCESS")}}))}))}));return u}},{key:"_reload",value:function(e){var t=this;return new Promise((function(n,i){try{var o=JSON.parse(localStorage.getItem("ezuikit_addressList"));if(Array.isArray(o[t.deviceSerial+"_"+t.channelNo])&&o[t.deviceSerial+"_"+t.channelNo].length>0){t.maxReloadTime-=1;var a=o[t.deviceSerial+"_"+t.channelNo].shift();if(o[t.deviceSerial+"_"+t.channelNo].push(a),localStorage.setItem("ezuikit_addressList",JSON.stringify(o)),t.maxReloadTime>0){console.log("使用备用机房地址"),t.monitorReport&&window.ezuikitMonitor.report({action:6,logInfo:{pluginVersion:t.isV3?"v3":"v1",wsUrl:t.wsUrl,error:Bt(e)},appKey:t.appKey});var r=new URL(o[t.deviceSerial+"_"+t.channelNo][0].wsUrl);t.url.indexOf("rec")>-1&&t.getOSDTime().then((function(e){console.log("恢复回放时间点:",t.OSD),r.searchParams.set("begin",new Date(1e3*t.OSD).Format("yyyyMMddThhmmssZ"))}));var s=Date.now();t.stop((function(){}),!0).then((function(e){var i=Date.now();t._pluginPlay(r.toString(),(function(){if(console.log("备用机房地址取流成功"),t.monitorReport&&window.ezuikitMonitor.report({action:7,logInfo:{pluginVersion:t.isV3?"v3":"v1",wsUrl:o[t.deviceSerial+"_"+t.channelNo][0].wsUrl,reloadRes:{code:1,msg:"发起重试成功"}},appKey:t.appKey}),1===t.videoPlayState||4===t.videoPlayState){var e=Date.now();t.videoPlayState=2;var a=Date.now();t.monitorReport&&window.ezuikitMonitor.report({action:2,logInfo:{pluginVersion:t.isV3?"v3":"v1",loadTime:a-t.videoInitTime,loadTimeDesc:{initTime:t.initTime,stopTime:0,getWsTime:e-s,createWsTime:a-i}},appKey:t.appKey,loadTime:a-t.videoInitTime,initTime:t.initTime,getWsTime:e-s,createWsTime:a-i})}re.getInstance(t.id).getState().sound&&setTimeout((function(){t.openSound(),t.Theme.setDecoderState({sound:!0})}),2e3),n({code:1,msg:"发起重试成功"})}),(function(e){}))})).catch((function(e){console.log("备用机房地址取流失败 -1"),t.monitorReport&&window.ezuikitMonitor.report({action:8,logInfo:{pluginVersion:t.isV3?"v3":"v1",wsUrl:o[t.deviceSerial+"_"+t.channelNo][0].wsUrl,reloadRes:{code:-1,msg:"发起重试失败",stopError:e}},appKey:t.appKey}),i({code:-1,msg:"发起重试失败",stopError:e})}))}else console.log("备用机房地址取流失败 -2"),t.monitorReport&&window.ezuikitMonitor.report({action:8,logInfo:{pluginVersion:t.isV3?"v3":"v1",reloadRes:{code:-2,msg:"所有备用机房地址取流失败"}},appKey:t.appKey}),i({code:-2,msg:"所有备用机房地址取流失败"})}else console.log("备用机房地址取流失败 -2"),t.monitorReport&&window.ezuikitMonitor.report({action:8,logInfo:{pluginVersion:t.isV3?"v3":"v1",reloadRes:{code:-2,msg:"无可用的备用机房地址"}},appKey:t.appKey}),i({code:-2,msg:"无可用的备用机房地址"})}catch(e){console.log("备用机房地址取流失败",e),t.monitorReport&&window.ezuikitMonitor.report({action:8,logInfo:{pluginVersion:t.isV3?"v3":"v1",reloadRes:{code:-2,msg:"备用机房地址重试失败",error:e}},appKey:t.appKey}),i({code:-2,msg:"备用机房地址重试失败"})}}))}},{key:"_initTheme",value:function(){var e=this;e.initTime=(new Date).getTime()-e.videoInitTime,e.themeId&&(1==e.params.isCall?e.Theme=new ut(e,params.id):1==e.params.isInspect?e.Theme=new jt(e):e.Theme=new qe(e,e.params.id),window.EZUIKit[e.params.id].state.EZUIKitPlayer.themeInit=!0,"function"==typeof e.params.handleThemeChange&&(e.handleThemeChange=e.params.handleThemeChange))}},{key:"_getRealUrlPromise",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=this;this.startGetWsTime=Date.now(),this.startGetWsUrlTime=(new Date).getTime();var o=this.env.domain;this.env&&(o=this.env.domain);var a=function(a,c){var l="",d="",u="",m={ezopen:e,isFlv:!1,userAgent:window.navigator.userAgent,isHttp:!1,needStreamToken:i.accessToken?1:0,accessToken:i.accessToken||i.token.deviceToken.video};if(t.params.extraParams&&t.params.extraParams.ezopenParams&&"object"===b(t.params.extraParams.ezopenParams))for(var h in t.params.extraParams.ezopenParams)m[h]=t.params.extraParams.ezopenParams[h];var p=new AbortController;t._controllers.push(p),function(e,t,n){var i=new FormData;return Object.keys(t).map((function(e){i.append(e,t[e])})),fetch(e.env.domain+"/api/lapp/live/url/ezopen",{method:"POST",signal:n,body:i,headers:{clientType:"ezuikit",sdkVersion:Fe}}).then((function(e){return e.json()})).then((function(e){return e}))}(t,m,p.signal).then((function(m){if(200==m.code||0==m.retcode){m.ext&&m.ext.token?(l+=m.data,u=i.accessToken?m.ext.token:t.token.streamToken[m.data.indexOf("live")>-1||m.data.indexOf("cloud")>-1?"live":"rec"],d=m.data):m.data&&("string"==typeof m.data?(l+=m.data,u=t.token.streamToken[m.data.indexOf("live")>-1||m.data.indexOf("cloud")>-1?"live":"rec"],d=m.data):(l+=m.data.url,u=i.accessToken?m.data.token:t.token.streamToken[m.data.indexOf("live")>-1||m.data.indexOf("cloud")>-1?"live":"rec"],d=m.data.url));var h=-1!==e.indexOf("live")?"live":"playback",p=I("checkCode",l="live"===h?l+"&ssn="+u+"&auth=1&biz=4&cln=100":l+"&ssn="+u+"&auth=1&cln=100");if(p&&(void 0!==t.jSPlugin.decoderVersion&&"2.0"===t.jSPlugin.decoderVersion?t.validateCode=p:(t.validateCode=p,t.jSPlugin.JS_SetSecretKey(0,p))),t.params.extraParams&&t.params.extraParams.wsParams)if("string"==typeof t.params.extraParams.wsParams)l+="&"+t.params.extraParams.wsParams;else if("object"===b(t.params.extraParams.wsParams))for(var g in t.params.extraParams.wsParams)l+="&"+g+"="+t.params.extraParams.wsParams[g];if(-1!==l.indexOf("playback")){var v,y,S=I("begin",e)||I("begin",d),_=I("end",e)||I("end",d);if(""===I("timeZone",e)||n)e.indexOf("timeZone=")>-1&&(l=l.replace("timeZone=","timeZone=0"));else{var w=parseInt(I("timeZone",e));w<24&&w>-24?i.timeZone=w:(i.timeZone=0,console.warn("timeZone时区参数错误,取值范围为-23~23"))}if(S?(v=r(S,"000000",n?0:i.timeZone),l=l.replace("&begin="+I("begin",d),""),l+="&begin="+v):(v=oe((B=(new Date).Format("yyyyMMdd")+"000000",M=parseInt(B.substring(0,4),10),O=parseInt(B.substring(4,6),10)-1,z=parseInt(B.substring(6,8),10),N=parseInt(B.substring(8,10),10),F=parseInt(B.substring(10,12),10),U=parseInt(B.substring(12,14),10),new Date(M,O,z,N,F,U)),n?0:i.timeZone).Format("yyyyMMddThhmmssZ"),l=l+"&begin="+v),_?(y=r(_,"235959",n?0:i.timeZone),l=l.replace("&end="+I("end",d),"")):y=S?r(r(S,"000000",n?0:i.timeZone).substr(0,8),"235959"):oe(new Date,n?0:i.timeZone).Format("yyyyMMdd")+"T235959Z",v.slice(0,8)!==y.slice(0,8)&&(y=v.slice(0,8)+y.slice(8)),l=l+"&end="+y,I("stream",d)||(l=l.replace("stream","&stream")),i._isCloudRecord&&-1!==e.indexOf(".cloud")&&"7"===I("busType",i.url)){var T=s(I("begin",l)),E=s(I("end",l)),P=I("serial",l),k=I("chn",l),C={accessToken:t.accessToken||t.token.deviceToken.global,deviceSerial:P,channelNo:k,startTime:T,endTime:E,spaceId:t._spaceId},x=[];ne(i,C).then((function(e){!function(e){if(e.data&&e.data&&e.data.length>0){x=x.concat(e.data);var t=JSON.stringify(function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];function n(e){var n={};return t.forEach((function(t){n[t]=e[t]})),n.istorageVersion&&(n.iStorageVersion=n.istorageVersion,delete n.istorageVersion),n}return e.reduce((function(e,t,i){return 0===i?(e.push(n(t)),e):(e[e.length-1].downloadPath===t.downloadPath?e[e.length-1].endTime=t.endTime:e.push(n(t)),e)}),[])}(x,["downloadPath","ownerId","istorageVersion","spaceId","startTime","endTime","videoType","busType"])).replace("\\","");l+="&recSlice="+t.replace("\\","")+"&r="+Math.random(),a(i._handleRealUrl(l))}else c({retcode:"420004",msg:i.i18n.t("NO_CLOUD_RECORD")})}(e)})).catch((function(e){c({retcode:"420004",msg:i.i18n.t("NO_CLOUD_RECORD")})}))}else if(-1!==e.indexOf(".cloud")&&"7"!==I("busType",t.url)){T=s(I("begin",l)),E=s(I("end",l)),P=I("serial",l),k=I("chn",l);var j=o+"/api/lapp/video/by/time",A={accessToken:t.accessToken||t.token.deviceToken.video,recType:1,deviceSerial:P,channelNo:k,startTime:T,endTime:E,version:"2.0"};R(j,"POST",A,"",(function(e){if(200==e.code){var t=[];if(e.data&&e.data.files&&e.data.files.length>0){var n=e.data.files,o=(new Date).getTime();if(e.data.isAll){t=d(n);var r=JSON.stringify(t).replace("\\","");l+="&recSlice="+r.replace("\\","")+"&r="+Math.random(),a(i._handleRealUrl(l))}else{var s=function(){A.startTime=o,R(j,"POST",A,"",(function(e){if(e.data&&e.data.files&&e.data.files.length>0)if(0==e.data.isAll)e.data.files&&(n=n.concat(e.data.files)),o=e.data.nextFileTime>0?e.data.nextFileTime:(new Date).getTime(),s();else{t=d(n);var r=JSON.stringify(t).replace("\\","");l+="&recSlice="+r.replace("\\","")+"&r="+Math.random(),a(i._handleRealUrl(l))}else{t=d(n);r=JSON.stringify(t).replace("\\","");l+="&recSlice="+r.replace("\\","")+"&r="+Math.random(),a(i._handleRealUrl(l))}}))};s()}}else c({retcode:"420003",msg:i.i18n.t("NO_RECORD")})}else c({retcode:"420003",msg:i.i18n.t("NO_RECORD")});function d(e){var t=[];return e.forEach((function(e,n){0==t.length||e.downloadPath!==t[t.length-1].downloadPath?t.push({downloadPath:e.downloadPath,ownerId:e.ownerId,iStorageVersion:e.iStorageVersion,videoType:e.videoType,iPlaySpeed:0,startTime:e.startTime,endTime:e.endTime}):t[t.length-1].endTime=e.endTime})),t}}))}else a(i._handleRealUrl(l))}else a(i._handleRealUrl(l))}else{var D=JSON.parse(localStorage.getItem("ezuikit_addressList")),L=D?D[i.deviceSerial+"_"+i.channelNo]:[];L.length>0&&L[0].wsUrl&&"10002"!=m.code?a(L[0].wsUrl):("fail"!==m.type?(t.Theme&&(t.Theme.setDisabled(!0),t.Theme.setDecoderState({play:!1})),t.pluginStatus.setPlayStatus({play:!1}),t.pluginStatus.loadingClear(),t.isInspect?(t.Theme.jSPlugin.Zoom&&t.Theme.jSPlugin.Zoom.stopZoom(),t.pluginStatus.loadingSetTextWithBtn({mask:!0,maskStyle:"url(".concat(t.staticPath,"/imgs/bg.svg) no-repeat 100%/cover"),text:m.msg,color:"white",btnName:t.i18n.t("BTN_RETRY"),type:1}),t.Theme&&t.Theme.inspect&&t.Theme.inspect.InspectEvent&&t.Theme.inspect.InspectEvent.disableEvidenceBtn()):t.pluginStatus.loadingSetText({text:m.msg,color:"red"}),setTimeout((function(){Dt(t.id)}),200),c(f(f({},m),{},{type:"fail",retcode:m.code}))):c(f(f({},m),{},{type:"fail"})),t.params.handleError&&t.params.handleError(f(f({},m),{},{retcode:m.code})))}var B,M,O,z,N,F,U})).catch((function(e){var t=JSON.parse(localStorage.getItem("ezuikit_addressList")),n=t?t[i.deviceSerial+"_"+i.channelNo]:[];n.length>0&&n[0].wsUrl?a(n[0].wsUrl):(console.error(e),c({retcode:"400002",type:"fail",msg:e}))}))};return new Promise((function(e,t){return a(e,t)}));function r(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;(n<=-24||n>=24)&&(n=0);if(/^[0-9]{8}T[0-9]{6}Z$/.test(e))e=e.replace("T","").replace("Z","");else{if(!/[0-9]{8,14}/.test(e))throw new Error("回放时间格式有误,请确认");var i=6-(14-e.length),o=t.length;e+=t.substring(i,o)}var a=60*n*60*1e3,r=function(e){"object"!==b(e)&&(e=new Date(e));var t=e.getFullYear(),n=(e.getMonth()+1).toString().padStart(2,"0"),i=e.getDate().toString().padStart(2,"0"),o=e.getHours().toString().padStart(2,"0"),a=e.getMinutes().toString().padStart(2,"0"),r=e.getSeconds().toString().padStart(2,"0");return"".concat(t).concat(n).concat(i).concat(o).concat(a).concat(r)}(new Date(parseInt(e.slice(0,4)),parseInt(e.slice(4,6))-1,parseInt(e.slice(6,8)),parseInt(e.slice(8,10)),parseInt(e.slice(10,12)),parseInt(e.slice(12,14))).getTime()+a);return r.slice(0,8)+"T"+r.slice(8)+"Z"}function s(e){var t=e.slice(0,4),n=e.slice(4,6),i=e.slice(6,8),o=e.slice(9,11),a=e.slice(11,13),r=e.slice(13,15);return new Date((t+"-"+n+"-"+i+" "+o+":"+a+":"+r).replace(/-/g,"/")).getTime()}}},{key:"_autoSwitchByQuality",value:function(){var e=this;return["0","1","2","3","4","5","6","pp","qp"].includes(this.quality+"")&&this.url.indexOf(".live")>-1?Ve(this).then((function(t){if(t.findIndex((function(e){return"compatible"===e.type}))>=0)return Promise.resolve();var n={};return(n="pp"===e.quality?t[0]:"qp"===e.quality?t[t.length-1]:t.find((function(t){return t.level===+e.quality&&"compatible"!==t.type})))?He(e,n.level):void 0})):Promise.resolve()}},{key:"_pluginPlay",value:function(e,t,n){var i=this,o=this;if(console.log("取流地址: ",e),!e)return!1;(function(e,t){var n=new FormData;return Object.keys(t).map((function(e){n.append(e,t[e])})),fetch(e.env.domain+"/api/lapp/device/info",{method:"POST",body:n}).then((function(e){return e.json()})).then((function(e){return e}))})(this,{accessToken:this.accessToken||this.token.deviceToken.global,deviceSerial:A(this.url).deviceSerial}).then((function(e){e.data&&(o.deviceInfo=e.data,document.getElementById("".concat(o.id,"-deviceName-content"))&&(document.getElementById("".concat(o.id,"-deviceName-content")).innerHTML=o.deviceInfo.deviceName||""))})).finally((function(){if(void 0!==i.deviceInfo.status&&1!==i.deviceInfo.status&&i.url.indexOf("live")>-1)return i.pluginStatus.loadingClear(),i.Theme&&i.Theme.setDisabled(!0),i.pluginStatus.loadingSetText({text:i.i18n.t("395404"),color:"red"}),"function"==typeof i.params.handleError&&i.params.handleError({msg:i.i18n.t("395404"),retcode:5404,id:i.params.id,type:"handleError"}),n({msg:i.i18n.t("395404"),retcode:"395404"}),!1;function a(e){var t=e.split("?")[0].replace("/live","").replace("/playback",""),n=(-1===e.indexOf("/live")?-1!==e.indexOf("cloudplayback")?"/cloudplayback?":"/playback?":"/live?")+e.split("?")[1];return{websocketConnectUrl:t,websocketStreamingParam:n=n.replace("stream=2",-1!==n.indexOf("/playback")?"stream=1":"stream=".concat(o.streamTypeIn))}}var r=a(e).websocketConnectUrl;i.env&&i.env.wsUrl&&(r=i.env.wsUrl),i.wsUrl=r,i.doCreateWsTime=Date.now(),i.gotWsUrlTime=(new Date).getTime();var s={playURL:a(e).websocketStreamingParam+"&stream="+i.streamTypeIn};i.isStoping=!1,i.jSPlugin&&i.jSPlugin.JS_Play(r,s,0).then((function(){i.isStoping||(i.validateCode&&void 0!==i.jSPlugin.decoderVersion&&"2.0"===i.jSPlugin.decoderVersion&&i.jSPlugin.JS_SetSecretKey(0,i.validateCode),i.pluginStatus.setPlayStatus({play:!0,loading:!1}),i.Theme&&i.Theme.setDecoderState({play:!0}),t(s))}),(function(e){var t=i.i18n.t("PLAY_FAILED"),o=-1;if(i.jSPlugin&&i.jSPlugin.bPlay)return!1;e&&e.errorCode&&(i.Theme&&i.Theme.setDisabled(!0),t=i.i18n.t("39"+e.errorCode),o=e.errorCode),i.isCall?i.Theme&&i.Theme.decoderState&&i.Theme.decoderState.state.rejection||(i.pluginStatus.loadingClear(),i.pluginStatus.loadingSetTextWithBtn({text:t,color:"white",btnName:i.isMobile?i.i18n.t("BTN_RETRY"):i.i18n.t("BTN_RELOAD"),isMobile:i.isMobile})):(i.pluginStatus.loadingClear(),i.isInspect?(i.Theme.jSPlugin.Zoom&&i.Theme.jSPlugin.Zoom.stopZoom(),5404===o?document.getElementById("".concat(i.id,"-no - inspect - box"))||i.Theme&&i.Theme.inspectEnding():i.pluginStatus.loadingSetTextWithBtn({mask:!0,text:t,color:"white",btnName:i.i18n.t("BTN_RETRY"),type:1}),i.Theme&&i.Theme.inspect&&i.Theme.inspect.InspectEvent&&i.Theme.inspect.InspectEvent.disableEvidenceBtn()):i._destroy||i.pluginStatus.loadingSetText({text:t,color:"red"})),n({msg:t,retcode:o})}))}))}},{key:"_play",value:function(e){var t=this;this.pluginStatus.setPlayStatus({play:!1,loading:!0}),this.playStartTime=(new Date).getTime(),e&&!e.unSaveUrl&&("string"==typeof e&&(this.url=e),"string"==typeof e.url&&(this.url=e.url),"string"==typeof A(this.url).deviceSerial&&(this.deviceSerial=A(this.url).deviceSerial),"string"==typeof A(this.url).channelNo&&(this.channelNo=A(this.url).channelNo));var n=new Promise((function(n,i){t.isStoping=!0,t.jSPlugin.JS_Stop(e&&e.showPoster?e.showPoster:0).then((function(){Dt(t.id),t.stopTime=Date.now();var o=Date.now();t._getRealUrlPromise(e&&e.url?e.url:t.url,e&&!!e.url).then((function(e){var a=Date.now();t._pluginPlay(e,(function(e){if(t.eventEmitter&&t.eventEmitter.emit("play",{eventType:"play",code:0,target:t,msg:t.i18n.t("PLAY_SUCCESS")}),1===t.videoPlayState||4===t.videoPlayState){t.videoPlayState=2;var i=Date.now();t.monitorReport&&window.ezuikitMonitor.report({action:2,logInfo:{pluginVersion:t.isV3?"v3":"v1",loadTime:i-t.videoInitTime,loadTimeDesc:{stopTime:t.stopTime-t.playStartTime,getWsTime:a-o,createWsTime:i-a}},appKey:t.appKey,loadTime:i-t.videoInitTime,getWsTime:a-o,createWsTime:i-a})}setTimeout((function(){t.pluginStatus.loadingClear(),t.isCall&&t.Theme&&t.Theme.decoderState&&t.Theme.decoderState.state.rejection&&t.stop((function(){t.pluginStatus.loadingClear(),t.pluginStatus.loadingSetTextWithBtn({text:t.i18n.t("CALL_END"),color:"white",isMobile:t.isMobile,type:2})}))}),500),t.jSPlugin&&t._FECSplitIds&&t._FECCorrectType&&t.jSPlugin.JS_FECCorrectType(t._FECCorrectType,t._FECSplitIds),t.waterMark_JSPlugin&&t.setWaterMarkFont(t.waterMark_JSPlugin);var r=re.getGlobalState();re.getInstance(t.id).getState().sound&&!1===r.sound&&setTimeout((function(){t.openSound(),t.Theme.setDecoderState({sound:!0})}),500),n(!0)}),(function(){return i(!1)}))})).catch((function(e){var n=e.msg?e.msg:t.i18n.t("PLAY_FAILED");t.Theme&&t.Theme.setDisabled(!0),t.isCall?t.Theme&&t.Theme.decoderState&&t.Theme.decoderState.state.rejection?e&&20018==e.code?t.pluginStatus.loadingSetTextWithBtn({text:t.i18n.t("USER_DO_NOT_OWN_DEVICE"),color:"white",isMobile:t.isMobile,type:2}):t.pluginStatus.loadingSetTextWithBtn({text:t.i18n.t("CALL_END"),color:"white",isMobile:t.isMobile,type:2}):e&&20018==e.code?(t.pluginStatus.loadingSetTextWithBtn({text:t.i18n.t("USER_DO_NOT_OWN_DEVICE"),color:"white",isMobile:t.isMobile,type:2}),!t.isWebConsole&&t.Theme&&t.Theme.call&&t.Theme.userNoDevice()):t.pluginStatus.loadingSetTextWithBtn({text:n,color:"white",btnName:t.isMobile?t.i18n.t("BTN_RETRY"):t.i18n.t("BTN_RELOAD"),isMobile:t.isMobile}):t.isInspect?(t.Theme.jSPlugin.Zoom&&t.Theme.jSPlugin.Zoom.stopZoom(),t.pluginStatus.loadingSetTextWithBtn({mask:!0,maskStyle:"url(".concat(t.staticPath,"/imgs/bg.svg) no-repeat 100%/cover"),text:n,color:"white",btnName:t.i18n.t("BTN_RETRY"),type:1}),t.Theme&&t.Theme.inspect&&t.Theme.inspect.InspectEvent&&t.Theme.inspect.InspectEvent.disableEvidenceBtn()):(console.error("播放失败,请检查设备及客户端网络",e),t.pluginStatus.loadingSetText({text:n,color:"red"})),"function"==typeof t.params.handleError&&t.params.handleError({retcode:e.oError?e.oError.errorCode:e.code||-1,msg:n,id:t.params.id,type:"handleError"}),t.eventEmitter&&t.eventEmitter.emit("play",{eventType:"play",code:e.oError?e.oError.errorCode:e.code||-1,target:t,msg:e.msg?e.msg:t.i18n.t("PLAY_FAILED")}),i({retcode:e.oError?e.oError.errorCode:e.code||-1,msg:n,id:t.params.id,type:"handleError"})}))}))}));return n}},{key:"stop",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:function(){},n=arguments.length>1?arguments[1]:void 0;return this._abortFetch(),this.pluginStatus.setPlayStatus({loading:!0}),this.reSetTheme(),this.jSPlugin.JS_Stop(n).then((function(){e.pluginStatus.setPlayStatus({play:!1,loading:!1}),e.Theme&&e.Theme.setDecoderState({play:!1}),e.eventEmitter&&e.eventEmitter.emit("stop",{eventType:"stop",code:0,target:e,msg:e.i18n.t("STOP_SUCCESS")}),t()}))}},{key:"changeVideoLevel",value:function(e){var t,n=this;return"object"===b(e)?this.videoLevelList.map((function(n){n.level===e.level&&(t=n)})):this.videoLevelList.map((function(n){n.level===e&&(t=n)})),void 0===t?(console.log(this.i18n.t("VIDEO_LEVEL_NOT_SUPPORT")+":"+e),void(this.eventEmitter&&this.eventEmitter.emit("changeVideoLevel",{eventType:"changeVideoLevel",code:-2,target:this,data:e,msg:this.i18n.t("VIDEO_LEVEL_NOT_SUPPORT")+":"+e}))):(this.videoLevel=t.level,this.streamTypeIn=t.streamTypeIn,new Promise((function(t,i){He(n,n.videoLevel).then((function(o){document.getElementById("".concat(n.id,"-videoLevel-icon"))&&(document.getElementById("".concat(n.id,"-videoLevel-icon")).innerHTML=n.i18n.t(Ne[n.videoLevel]),document.getElementById("".concat(n.id,"-videoLevel-icon")).dataset.type=n.videoLevel),n.changePlayUrl({url:n.url},(function(){}),!1).then((function(i){n.eventEmitter&&n.eventEmitter.emit("changeVideoLevel",{eventType:"changeVideoLevel",code:0,target:n,data:e,msg:n.i18n.t("CHANGE_VIDEO_LEVEL")}),t(i)})).catch((function(t){console.log("清晰度切换失败:",t),n.eventEmitter&&n.eventEmitter.emit("changeVideoLevel",{eventType:"changeVideoLevel",code:-1,target:n,data:e,msg:n.i18n.t("CHANGE_VIDEO_LEVEL_FAIL")}),i(o)}))})).catch((function(i){console.log("清晰度切换失败:",i),n.url.indexOf(".hd.live")>=0?n.url=n.url.replace(".hd.live",".live"):n.url.indexOf(".live")>=0&&(n.url=n.url.replace(".live",".hd.live")),n.changePlayUrl({url:n.url},(function(){}),!1).then((function(){document.getElementById("".concat(n.id,"-videoLevel-icon"))&&(document.getElementById("".concat(n.id,"-videoLevel-icon")).innerHTML=n.i18n.t(Ne[n.videoLevel]),document.getElementById("".concat(n.id,"-videoLevel-icon")).dataset.type=n.videoLevel),t(res)})),n.eventEmitter&&n.eventEmitter.emit("changeVideoLevel",{eventType:"changeVideoLevel",code:-1,target:n,data:e,msg:n.i18n.t("CHANGE_VIDEO_LEVEL_FAIL")})}))})))}},{key:"reSetTheme",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this.Theme&&this.Theme.Ptz&&this.Theme.decoderState.state.pantile&&(this.Theme.setDecoderState({pantile:!1}),this.Theme.Ptz.hide()),this.Theme&&this.Theme.decoderState.state.recordvideo&&this.Theme.setDecoderState({recordvideo:!1}),e.indexOf("zoom")>-1&&(this.use3DZoom?(this.is3DZooming=!1,this.close3DZoom()):(this.Zoom&&this.Zoom.currentScale>1&&this.Zoom.stopZoom(),this.Theme&&this.Theme.setDecoderState({zoom:!1}))),this.Theme&&this.Theme.decoderState.state.talk&&(this.stopTalk(),this.Theme.setDecoderState({talk:!1})),this.Theme&&this.Theme.Rec&&!this.Theme.isMobile&&this.Theme.Rec.datepickerHide(),this.Theme&&this.Theme.Rec&&(this.Theme.changeRecSpeed(1),this.Theme.nextRate=1,this.speed=1,this.Theme.setDecoderState({speed:!1})),this.eventEmitter&&this.eventEmitter.emit("reSetTheme",{eventType:"reSetTheme",code:0,target:this,msg:this.i18n.t("RESET_THEME")})}},{key:"_changePlayUrl",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){},i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],o=this;this.Theme&&(this.Theme.setDecoderState({play:!1}),this.Theme.setDisabled(!0)),setTimeout((function(){t.pluginStatus.loadingClear(),t.pluginStatus.loadingStart(t.id),t.pluginStatus.loadingSetText({text:t.i18n.t("LOADING")})}),100),this.reSetTheme(["zoom"]);var a=this.url,r=this._spaceId,s=this._isCloudRecord,c=function(e,t){if(t.url)return t.url;var n=e.split("/")[4].split(".")[e.split("/")[4].split(".").length-1].split("?")[0];"rec"===n&&-1!==e.indexOf(".cloud.rec")&&(n="cloud.rec");t.type&&(n="miniRec"==t.type?"rec":t.type);var i=e.split("/")[3];t.deviceSerial&&(i=t.deviceSerial);var a=e.split("/")[4].split(".")[0];t.channelNo&&(a=t.channelNo);var c=2===e.split("/")[2].split("@").length?e.split("/")[2].split("@")[0]:"";void 0!==t.validCode&&(c=t.validCode);var l="ezopen://".concat(c?"".concat(c,"@"):"").concat(o.host,"/").concat(i,"/").concat(a,".").concat(n);if(""!==I("timeZone",e)){var d=parseInt(I("timeZone",e));d<24&&d>-24?o.timeZone=d:(o.timeZone=0,console.warn("timeZone时区参数错误,取值范围为-23~23"))}if("live"===n)return l;l="ezopen://".concat(c?"".concat(c,"@"):"").concat(o.host,"/").concat(i,"/").concat(a,".").concat(n),t.begin&&t.end?l+="?begin=".concat(t.begin,"&end=").concat(t.end):t.begin?l+="?begin=".concat(t.begin):I("begin",e)&&I("end",e)?l+="?begin=".concat(I("begin",e),"&end=").concat(I("end",e)):I("begin",e)&&(l+="?begin=".concat(I("begin",e)));s&&-1!==l.indexOf("cloud.rec")&&(l+="".concat(-1!==l.indexOf("?")?"&":"?","busType=7").concat(r?"&spaceId=".concat(r):""));return l}(a,e);if(this.url=c,this.deviceSerial=e.deviceSerial||A(this.url).deviceSerial||this.deviceSerial,this.channelNo=e.channelNo||A(this.url).channelNo||this.channelNo,this.accessToken=e.accessToken||this.accessToken,this.token=e.token||this.token,this.videoInitTime=Date.now(),this.videoPlayState=4,e.url){var l=JSON.parse(localStorage.getItem("ezuikit_addressList"))||{};l[this.deviceSerial+"_"+this.channelNo]||(l=f(f({},l),{},p({},this.deviceSerial+"_"+this.channelNo,[])),localStorage.setItem("ezuikit_addressList",JSON.stringify(l))),Ge(this,{deviceSerial:this.deviceSerial,localIndex:this.channelNo,accessToken:this.accessToken||this.token.deviceToken.video})}window.monitorExtendsInfo={protocol:"ezopen",url:this.url,serial:this.deviceSerial,no:this.channelNo,env:this.env.domain,type:A(this.url).type};var d=Object.assign({},o.params);return this.monitorReport&&window.ezuikitMonitor.report({action:4,logInfo:{pluginVersion:this.isV3?"v3":"v1",type:A(this.url).type,params:d},appKey:this.appKey}),this.jSPlugin.player&&(this.jSPlugin.player.playbackRate=1,this.jSPlugin.player._playbackRate=1),this.getDeviceCapacity({deviceSerial:this.deviceSerial,accessToken:this.accessToken||this.token.deviceToken.video}),n(),new Promise((function(n,o){var a={url:c};return e.token&&(a.token=e.token),e.accessToken&&(a.accessToken=e.accessToken),t.play(a).then((function(){i&&(e.type?t.Theme&&("rec"==e.type||"cloud.rec"==e.type?t.Theme.changeTheme(t.isMobile?"mobileRec":"pcRec"):"miniRec"==e.type?t.Theme.changeTheme("miniRec"):(t.Theme.changeTheme(t.isMobile?"mobileLive":"pcLive"),t.Theme.Rec&&t.Theme.Rec.unSyncTimeLine())):t.Theme&&(t.url.indexOf(".rec")>-1?t.Theme.changeTheme(t.isMobile?"mobileRec":"pcRec"):(t.isCall?t.Theme.changeTheme(t.isMobile?"mobileCall":"webCall"):t.Theme.changeTheme(t.themeId),t.Theme.Rec&&t.Theme.Rec.unSyncTimeLine()))),e&&e.begin&&e.deviceSerial&&t.Theme&&t.Theme.Rec.setDatepickerDate(e.begin),t.Theme&&(t.Theme.setDisabled(!1),t.Theme.Zoom&&t.Theme.Zoom.stopZoom()),t.eventEmitter&&t.eventEmitter.emit("changePlayUrl",{eventType:"changePlayUrl",code:0,target:t,msg:t.i18n.t("CHANGE_PLAYURL_SUCCESS")}),n(c)})).catch((function(e){o(c),t.eventEmitter&&t.eventEmitter.emit("changePlayUrl",{eventType:"changePlayUrl",code:-1,target:t,msg:e&&e.msg?e.msg:t.i18n.t("CHANGE_PLAYURL_FAILED")}),e&&e.msg&&(t.pluginStatus.loadingClear(),t.isInspect?(t.Theme.jSPlugin.Zoom&&t.Theme.jSPlugin.Zoom.stopZoom(),t.pluginStatus.loadingSetTextWithBtn({mask:!0,maskStyle:"url(".concat(t.staticPath,"/imgs/bg.svg) no-repeat 100%/cover"),text:e.msg,color:"white",btnName:t.i18n.t("BTN_RETRY"),type:1}),t.Theme&&t.Theme.inspect&&t.Theme.inspect.InspectEvent&&t.Theme.inspect.InspectEvent.disableEvidenceBtn()):t.pluginStatus.loadingSetText({text:e.msg,color:"red"}))}))}))}},{key:"getOSDTime",value:function(){var e=this;return new Promise((function(t,n){e.jSPlugin.JS_GetOSDTime(0).then((function(n){e.eventEmitter&&e.eventEmitter.emit("getOSDTime",{eventType:"getOSDTime",code:0,target:e,data:n,msg:e.i18n.t("GET_OSD_TIME")}),n&&n>0&&(e.OSD=n),t({code:0,retcode:0,data:n}),"function"==typeof e.params.getOSDTimeCallBack&&e.params.getOSDTimeCallBack({id:e.id,type:"getOSDTime",code:0,data:n})})).catch((function(t){e.eventEmitter&&e.eventEmitter.emit("getOSDTime",{eventType:"getOSDTime",code:-1,target:e,msg:t||e.i18n.t("GET_OSD_TIME")}),n({code:-1,retcode:-1,data:t}),"function"==typeof e.params.getOSDTimeCallBack&&e.params.getOSDTimeCallBack({id:e.id,type:"getOSDTime",code:-1,data:-1})}))}))}},{key:"capturePicture",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=arguments.length>2?arguments[2]:void 0,o=this.jSPlugin.JS_CapturePicture(0,e||(new Date).getTime(),"JPEG",n,void 0!==i?i:this.download);if(C(o))return new Promise((function(n,i){o.then((function(i){"function"==typeof t.params.capturePictureCallBack&&t.params.capturePictureCallBack({id:t.id,type:"capturePicture",code:0});var o={id:t.id,code:0,data:i.data,type:"handleCapturePicture"};t.eventEmitter&&t.eventEmitter.emit("capturePicture",{eventType:"capturePicture",code:0,target:t,data:i.data,msg:t.i18n.t("CAPTURE_SUCCESS")}),"function"==typeof t.params.handleCapturePicture&&t.params.handleCapturePicture(o),t._isCloudRecord&&-1!==t.url.indexOf(".cloud")&&"7"===I("busType",t.url)&&fetch(t.env.domain+"/api/service/cloud/upload/url"+"?fileName=".concat(e,"&fileType=pic&expireDays=-1&urlExpireTime=1&bizType=ezuikit&accessToken=").concat(t.accessToken||t.token.httpToken.url),{method:"GET"}).then((function(e){return e.json()})).then((function(e){if(e.data&&e.data[0]){var n=new FormData;Object.keys(e.data[0].fields).map((function(t){n.append(t,e.data[0].fields[t])}));for(var o=atob(i.data.base64.split(",")[1]),a=[],r=0;r<o.length;r++)a.push(o.charCodeAt(r));var s=new Blob([new Uint8Array(a)],{type:"image/jpeg"});n.append("file",s,"image.jpeg"),new Ke({url:e.data[0].url,method:"POST",body:n,headers:{accessToken:t.accessToken||t.token.httpToken.url},onUploadComplete:function(e){e.response&&e.response.meta&&200==e.response.meta.code&&console.log("".concat(i.data.fileName," 上传至云存储完成"))}}).upload()}else console.log("云录制文件上传地址获取失败1:",e.meta.message)})).catch((function(e){console.log("云录制文件上传地址获取失败2:",e),console.log(JSON.stringify(e))})),n(o)}),(function(e){"function"==typeof t.params.capturePictureCallBack&&t.params.capturePictureCallBack({id:t.id,type:"capturePicture",code:-1}),t.eventEmitter&&t.eventEmitter.emit("capturePicture",{eventType:"capturePicture",code:-1,target:t,msg:e||t.i18n.t("CAPTURE_FAILED")});var n=Object.assign({id:t.id,type:"handleCapturePicture",code:-1},e);"function"==typeof t.params.handleCapturePicture&&t.params.handleCapturePicture(n),i(n)}))}))}},{key:"startSave",value:function(e,t){var n=this,i=this.jSPlugin.JS_StartSave(e,(function(e,t){n.recordRes={url:e,file:t}}),t||this.validateCode),o=this;return C(i)?(i.then((function(){"function"==typeof o.params.startSaveCallBack&&o.params.startSaveCallBack({id:o.id,type:"startSave",code:0}),o.eventEmitter&&o.eventEmitter.emit("startSave",{eventType:"startSave",code:0,target:o,msg:n.i18n.t("START_RECORD_SUCCESS")})})).catch((function(e){o.eventEmitter&&o.eventEmitter.emit("startSave",{eventType:"startSave",code:-1,target:o,msg:n.i18n.t("START_RECORD_FAILED")}),"function"==typeof o.params.startSaveCallBack&&o.params.startSaveCallBack({id:o.id,type:"startSave",code:-1})})),i):(this.Theme&&this.Theme.setDecoderState({recordvideo:!0}),new Promise((function(e){e(i)})))}},{key:"stopSave",value:function(){var e=this,t=this.jSPlugin.JS_StopSave(),n=this;return C(t)?(t.then((function(){setTimeout((function(){n.eventEmitter&&n.eventEmitter.emit("stopSave",{eventType:"stopSave",code:0,target:n,data:e.recordRes,msg:e.i18n.t("STOP_RECORD_SUCCESS")}),"function"==typeof n.params.stopSaveCallBack&&n.params.stopSaveCallBack({id:n.id,type:"stopSave",data:e.recordRes,code:0}),e.recordRes={}}),200)})).catch((function(){n.eventEmitter&&n.eventEmitter.emit("stopSave",{eventType:"stopSave",code:-1,target:n,msg:e.i18n.t("STOP_RECORD_FAILED")}),"function"==typeof n.params.stopSaveCallBack&&n.params.stopSaveCallBack({id:n.id,type:"stopSave",code:-1}),e.recordRes={}})),t):(this.Theme&&this.Theme.setDecoderState({recordvideo:!1}),new Promise((function(e){e(t)})))}},{key:"openSound",value:function(){var e=this,t=re.getGlobalState(),n=re.getInstance(this.id);if((t.sound&&!1===n.getState().sound||t.talk&&!1===n.getState().talk)&&this.audioOnly)return this.eventEmitter&&this.eventEmitter.emit("openSound",{eventType:"openSound",code:460001,target:this,msg:this.i18n.t("SOUND_OPENED")}),new Promise((function(e,t){t("当前已经有画面正在播放声音")}));var i=this.jSPlugin.JS_OpenSound(0);return this.eventEmitter&&this.eventEmitter.emit("openSound",{eventType:"openSound",code:i,target:this,msg:this.i18n.t("OPEN_SOUND")}),this.Theme&&this.Theme.setDecoderState({sound:!0}),"function"==typeof this.params.openSoundCallBack&&this.params.openSoundCallBack({id:this.id,type:"openSound",code:i}),re.setGlobalState({sound:!0}),n.setState({sound:!0}),Array.isArray(re.listInstances())&&this.audioOnly&&re.listInstances().map((function(t){t.state.sound&&t.id!=e.id&&re.getInstance(t.id).setState({sound:!1})})),C(i)?i:new Promise((function(e){e(i)}))}},{key:"closeSound",value:function(){var e=this.jSPlugin.JS_CloseSound(0);return this.eventEmitter&&this.eventEmitter.emit("closeSound",{eventType:"closeSound",code:e,target:this,msg:this.i18n.t("CLOSE_SOUND")}),C(e)?e:(this.Theme&&this.Theme.setDecoderState({sound:!1}),"function"==typeof this.params.closeSoundCallBack&&this.params.closeSoundCallBack({id:this.id,type:"closeSound",code:e}),re.getInstance(this.id).setState({sound:!1}),re.setGlobalState({sound:!1}),new Promise((function(t){t(e)})))}},{key:"enableZoom",value:function(){var e=this.jSPlugin.JS_EnableZoom(0);return this.eventEmitter&&this.eventEmitter.emit("startZoom",{eventType:"startZoom",code:e,target:this,msg:this.i18n.t("START_ZOOM")}),C(e)?e:new Promise((function(t){t(e)}))}},{key:"closeZoom",value:function(){var e=this.jSPlugin.JS_DisableZoom(0);return this.eventEmitter&&this.eventEmitter.emit("closeZoom",{eventType:"closeZoom",code:e,target:this,msg:this.i18n.t("CLOSE_ZOOM")}),C(e)?e:new Promise((function(t){t(e)}))}},{key:"zoomAdd",value:function(e){this.Zoom&&this.Zoom.addScale(e)}},{key:"zoomSub",value:function(e){this.Zoom&&this.Zoom.subScale(e)}},{key:"enable3DZoom",value:function(){var e=this;if(!e.use3DZoom)return new Promise((function(t,n){e.eventEmitter&&e.eventEmitter.emit("enable3DZoom",{eventType:"enable3DZoom",code:-1,target:e,msg:e.i18n.t("3D_ZOOM_DISABLE")}),n({code:-1,msg:e.i18n.t("3D_ZOOM_DISABLE")})}));if(e.is3DZooming)return new Promise((function(t,n){e.eventEmitter&&e.eventEmitter.emit("enable3DZoom",{eventType:"enable3DZoom",code:-1,target:e,msg:e.i18n.t("3D_ZOOM_ACTIVED")}),n({code:-1,msg:e.i18n.t("3D_ZOOM_ACTIVED")})}));if(e.isMobile||(e.Zoom&&e.Zoom.stopZoom(),e.Theme&&e.Theme.setDecoderState({zoom:!1})),e.support3DZoom){e.is3DZooming=!0,e.Theme&&e.Theme.setDecoderState({zoom:!0}),document.getElementById("".concat(e.id,"-zoom-content"))&&(document.getElementById("".concat(e.id,"-zoom-content")).title=e.i18n.t("3D_ZOOM"));var t=e.jSPlugin.JS_Enable3DZoom(0,(function(t){var n=e.Theme&&e.Theme.decoderState.state.expend&&e.isMobile?e.fullScreenWidth:e.width,i=e.Theme&&e.Theme.decoderState.state.expend&&e.isMobile?e.fullScreenHeight:e.height,o=function(e,t){if(!e||!e.startPos||!e.endPos)return-1;var n=e.startPos[0],i=e.startPos[1],o=e.endPos[0],a=e.endPos[1];return t?o>n&&a<i?1:o<n&&a>i?0:-1:o>n&&a>i?1:o<n&&a<i?0:-1}(t,e.Theme&&e.Theme.decoderState.state.expend);if(o>-1)try{var a=function(e,t,n){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:5;if(!(e&&t&&n&&n.startPos&&n.endPos))return-1;var o=n.startPos[0],a=n.startPos[1],r=n.endPos[0],s=n.endPos[1],c=Math.abs(r-o),l=Math.abs(s-a),d=parseInt((o+r)/2),u=parseInt((a+s)/2),m=Math.round(e*t/(c*l));return{startPointX:parseInt(o/e*256),startPointY:parseInt(a/t*256),endPointX:parseInt(r/e*256),endPointY:parseInt(s/t*256),zoomRate:m>i?i:m,targetCenterX:d,targetCenterY:u,targetWidth:c,targetHeight:l}}(n,i,t,e.capacity&&e.capacity.support_zoomOut_maxTime?e.capacity.support_zoomOut_maxTime:5),r=e.env.domain+"/api/v3/das/device/3d/zoom?accessToken=".concat(e.accessToken||e.token.deviceToken.video,"&deviceSerial=").concat(A(e.url).deviceSerial,"&channelNo=").concat(A(e.url).channelNo,"&command=").concat(0==o?9:8,"&zoomTimes=").concat(a.zoomRate,"&startPointX=").concat(a.startPointX,"&startPointY=").concat(a.startPointY,"&endPointX=").concat(a.endPointX,"&endPointY=").concat(a.endPointY,"&length=").concat(parseInt(i),"&width=").concat(parseInt(n),"&midPointX=").concat(a.targetCenterX,"&midPointY=").concat(a.targetCenterY,"&lengthX=").concat(a.targetWidth,"&lengthY=").concat(a.targetHeight);fetch(r,{method:"POST"}).then((function(e){return e.json()})).then((function(t){200!=t.code&&e.pluginStatus.loadingSetText({text:t.msg,color:"red",delayClear:2e3})})).catch((function(t){e.pluginStatus.loadingSetText({text:e.i18n.t("3D_ZOOM_FAILED"),color:"red",delayClear:2e3})}))}catch(t){e.pluginStatus.loadingSetText({text:e.i18n.t("3D_ZOOM_FAILED"),color:"red",delayClear:2e3})}}));return e.Zoom=new Oe(e),e.eventEmitter&&e.eventEmitter.emit("enable3DZoom",{eventType:"enable3DZoom",code:t,target:e,msg:e.i18n.t("START_3D_ZOOM")}),C(t)?t:new Promise((function(e){e(t)}))}return e.is3DZooming=!1,document.getElementById("".concat(e.id,"-zoom-content"))&&(document.getElementById("".concat(e.id,"-zoom-content")).title=e.i18n.t("ZOOM")),new Promise((function(t,n){e.eventEmitter&&e.eventEmitter.emit("enable3DZoom",{eventType:"enable3DZoom",code:-1,target:e,msg:e.i18n.t("DEVICE_NOT_SUPPORT_3D_ZOOM")}),n({code:-1,msg:e.i18n.t("DEVICE_NOT_SUPPORT_3D_ZOOM")})}))}},{key:"close3DZoom",value:function(){var e=this;if(!e.use3DZoom)return new Promise((function(t,n){e.eventEmitter&&e.eventEmitter.emit("close3DZoom",{eventType:"close3DZoom",code:-1,target:e,msg:e.i18n.t("3D_ZOOM_NOT_ACTIVED")})}));if(e.is3DZooming){e.Theme&&e.Theme.setDecoderState({zoom:!1});var t=e.jSPlugin.JS_Disable3DZoom(0);return e.Zoom=new Oe(e),e.is3DZooming=!1,e.eventEmitter&&e.eventEmitter.emit("close3DZoom",{eventType:"close3DZoom",code:t,target:e,msg:e.i18n.t("CLOSE_3D_ZOOM")}),C(t)?t:new Promise((function(e){e(t)}))}return new Promise((function(t,n){e.eventEmitter&&e.eventEmitter.emit("close3DZoom",{eventType:"close3DZoom",code:-1,target:e,msg:e.i18n.t("3D_ZOOM_CLOSED")}),n({code:-1,msg:e.i18n.t("3D_ZOOM_CLOSED")})}))}},{key:"changeZoomType",value:function(e){var t=this;if(e&&this.capacity&&!this.support3DZoom)return this.eventEmitter&&this.eventEmitter.emit("changeZoomType",{eventType:"changeZoomType",code:-1,target:this,msg:this.i18n.t("DEVICE_NOT_SUPPORT_3D_ZOOM")}),{code:-1,msg:this.i18n.t("DEVICE_NOT_SUPPORT_3D_ZOOM")};this.is3DZooming?this.close3DZoom():this.Theme&&this.Theme.decoderState.state.zoom&&this.Zoom&&this.Zoom.stopZoom(),this.Theme&&this.Theme.setDecoderState({zoom:!1}),this.use3DZoom=e,this.Zoom=new Oe(this),setTimeout((function(){e?document.getElementById("".concat(t.id,"-zoom-content"))&&(document.getElementById("".concat(t.id,"-zoom-content")).title=t.i18n.t("3D_ZOOM")):document.getElementById("".concat(t.id,"-zoom-content"))&&(document.getElementById("".concat(t.id,"-zoom-content")).title=t.i18n.t("ZOOM")),t.isMobile&&e&&t.enable3DZoom(),t.eventEmitter&&t.eventEmitter.emit("changeZoomType",{eventType:"changeZoomType",code:0,target:t,msg:t.i18n.t("CHANGE_ZOOM_TYPE")})}),500)}},{key:"setPoster",value:function(e){Lt()?document.getElementById("".concat(this.id))&&(document.getElementById("".concat(this.id)).style.backgroundImage="url(".concat(e,")"),document.getElementById("".concat(this.id)).style.backgroundSize="100% 100%"):document.getElementById("".concat(this.id,"-player"))&&(document.getElementById("".concat(this.id,"-player")).style.backgroundImage="url(".concat(e,")"),document.getElementById("".concat(this.id,"-player")).style.backgroundSize="cover"),this.eventEmitter&&this.eventEmitter.emit("setPoster",{eventType:"setPoster",code:0,target:this,msg:this.i18n.t("SET_POSTER")})}},{key:"reSize",value:function(e,t){var n,i,o=0;(this.params.height=t,this.params.width=e,this.Theme&&this.Theme.isNeedRenderTimeLine&&!this.isMobile&&document.getElementById("".concat(this.id,"-canvas-container")))&&(o=parseInt(null===(i=document.getElementById("".concat(this.id,"-canvas-container")))||void 0===i?void 0:i.clientHeight,10));if(n=t-o,this._isCurrentBrowserFullscreen||(this.width=e,this.height=t),document.getElementById("".concat(this.id,"-wrap")).style="width:".concat(e,"px;position:relative;display:inline-block;vertical-align: bottom;"),document.getElementById("".concat(this.id)).style.width=e+"px",document.getElementById("".concat(this.id)).style.height=n+"px",this.jSPlugin&&this.jSPlugin.bPlay)this.jSPlugin&&(this.jSPlugin.iHeight=t,this.jSPlugin.iWidth=e);else{var a=1;if(document.getElementById("".concat(this.id,"canvas0")))navigator.userAgent.match(/(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i)&&(a=2),document.getElementById("".concat(this.id,"canvas0")).style.width=e*a+"px",document.getElementById("".concat(this.id,"canvas0")).style.height=t*a+"px",document.getElementById("".concat(this.id,"canvas0")).width=e*a,document.getElementById("".concat(this.id,"canvas0")).height=t*a,document.getElementById("".concat(this.id,"canvas0")).parentNode.style.width=e*a+"px",document.getElementById("".concat(this.id,"canvas0")).parentNode.style.height=t*a+"px",document.getElementById("".concat(this.id,"canvas_draw0")).height=t*a;this.jSPlugin&&(this.jSPlugin.iHeight=t*a,this.jSPlugin.iWidth=e*a)}this.Theme&&this.Theme.Rec&&this.Theme.Rec.recAutoSize&&!this._isCurrentFullscreen&&this.Theme.Rec.recAutoSize(),this.Theme&&this.isInspect&&(document.getElementById("".concat(this.id,"-wrap")).style="width:".concat(e,"px; height:").concat(t,"px;position:relative;display:inline-block;vertical-align: bottom;"),this.width-=this.inspectVideoWidth,this.height-=this.inspectVideoHeight,e=this.width,t=this.height,this.width=e,this.height=t,this.Theme.inspect.reSize(e,t)),this.eventEmitter&&(this.eventEmitter.emit("reSize",{eventType:"reSize",code:0,target:this,msg:this.i18n.t("RESIZE")}),this.eventEmitter.emit("resize",{eventType:"resize",code:0,target:this,msg:this.i18n.t("RESIZE")}))}},{key:"resize",value:function(e,t){this.reSize(e,t)}},{key:"fast",value:function(e){var t=this,n=this.speed;if(e){var i=this.jSPlugin.JS_Speed(e);this.Theme&&(this.Theme.changeRecSpeed(e),this.Theme.nextRate=e)}else{if(1===n)n=2;else{if(2!==n)return console.log("当前已经是最大播放倍数"),"function"==typeof this.params.handleError&&this.params.handleError({msg:this.i18n.t("MAX_SPEED_LIMIT"),retcode:1003,id:this.id,type:"handleError"}),new Promise((function(e,i){t.speed=n,i({code:-1,data:{speed:n,result:t.i18n.t("MAX_SPEED_LIMIT")}})}));n=4}i=this.jSPlugin.JS_Speed(n);this.Theme&&(this.Theme.changeRecSpeed(n),this.Theme.nextRate=n)}return new Promise((function(e){t.speed=n,t.eventEmitter&&t.eventEmitter.emit("fast",{eventType:"fast",code:0,data:n,target:t,msg:t.i18n.t("SPEED")}),e({code:0,data:{speed:n,result:i}})}))}},{key:"slow",value:function(){var e=this,t=this.speed;if(4===t)t=2;else{if(2!==t)return console.log("当前已经是最小播放倍数"),"function"==typeof this.params.handleError&&this.params.handleError({msg:this.i18n.t("MIN_SPEED_LIMIT"),retcode:1003,id:this.id,type:"handleError"}),new Promise((function(n,i){e.speed=t,i({code:-1,data:{speed:t,result:e.i18n.t("MIN_SPEED_LIMIT")}})}));t=1}var n=this.jSPlugin.JS_Speed(t);return new Promise((function(i){e.speed=t,e.eventEmitter&&e.eventEmitter.emit("slow",{eventType:"slow",code:0,data:t,target:e,msg:e.i18n.t("SPEED")}),i({code:0,data:{speed:t,result:n}})}))}},{key:"seek",value:function(e,t){var n=this.url,i=(I("begin",n)||(new Date).Format("yyyyMMdd")).substr(0,8);if(t=o(i,"235959"),6===e.length)e=o(i,e);else{if(16!==e.length)return"function"==typeof this.params.handleError&&(this.eventEmitter&&this.eventEmitter.emit("seek",{eventType:"seek",code:-2,target:this,msg:this.i18n.t("SEEK_TIMEFORMAT_ERROR")}),this.params.handleError({msg:this.i18n.t("SEEK_TIMEFORMAT_ERROR"),retcode:-1,id:this.id,type:"handleError"})),!1;if(e.substr(0,8)!==i)return"function"==typeof this.params.handleError&&(this.eventEmitter&&this.eventEmitter.emit("seek",{eventType:"seek",code:-1,target:this,msg:this.i18n.t("SEEK_CANNOT_CROSS_DAYS")}),this.params.handleError({msg:this.i18n.t("SEEK_CANNOT_CROSS_DAYS"),retcode:-1,id:this.id,type:"handleError"})),!1}function o(e,t){if(/^[0-9]{8}T[0-9]{6}Z$/.test(e))return e;if(/[0-9]{8,14}/.test(e)){var n=6-(14-e.length),i=t.length,o=e+t.substring(n,i);return o.slice(0,8)+"T"+o.slice(8)+"Z"}throw new Error(this.i18n.t("TIMEFORMAT_ERROR"))}var a=this.jSPlugin.JS_Seek(0,e,t);return C(a)?a:new Promise((function(e){e(a)}))}},{key:"fullScreen",value:function(){this.fullscreen()}},{key:"fullscreen",value:function(){var e=this;return this._isCurrentFullscreen?Promise.resolve():(this._isCurrentFullscreen=!0,this._isCurrentBrowserFullscreen?Promise.resolve().then((function(){e._isCurrentBrowserFullscreen&&e._fullscreenChangeEvent({target:document.getElementById("".concat(e.id,"-wrap"))})})):this.browserFullscreen())}},{key:"_fullscreenChangeEvent",value:function(e){var t=document.getElementById("".concat(this.id,"-wrap"));if(this._isCurrentBrowserFullscreen=n.element===t,e.target===t){var i,o;if(this._isCurrentBrowserFullscreen)t.classList.add("ezuikit-player-wrap-web-fullscreen"),this._isCurrentFullscreen&&t.classList.add("ezuikit-player-wrap-fullscreen"),this.resize(window.screen.width||window.screen.availWidth,window.screen.height||window.screen.availHeight),null===(o=this.eventEmitter)||void 0===o||o.emit("fullscreen"),this.eventEmitter&&this.eventEmitter.emit(this._isCurrentFullscreen?"fullscreen":"browserFullscreen",{eventType:this._isCurrentFullscreen?"fullscreen":"browserFullscreen",code:0,target:this,msg:this._isCurrentFullscreen?this.i18n.t("FULLSCREEN_EXIT"):this.i18n.t("WEB_FULLSCREEN")});else t.classList.remove("ezuikit-player-wrap-web-fullscreen","ezuikit-player-wrap-fullscreen"),this._isCurrentFullscreen=!1,this.resize(this.width,this.height),this.eventEmitter&&this.eventEmitter.emit("exitFullscreen",{eventType:"exitFullscreen",code:0,target:this,msg:this.i18n.t("WEB_FULLSCREEN_EXIT")});null===(i=this.eventEmitter)||void 0===i||i.emit("fullscreenChange",{eventType:"fullscreenChange",code:0,target:this,data:{isCurrentFullscreen:this._isCurrentFullscreen,isCurrentBrowserFullscreen:this._isCurrentBrowserFullscreen}})}}},{key:"cancelFullScreen",value:function(){this.exitFullscreen()}},{key:"exitFullscreen",value:function(){return n.isEnabled?n.exit():Promise.resolve()}},{key:"startTalk",value:function(){this.Talk.startTalk()}},{key:"stopTalk",value:function(){this.Talk.stopTalk(),this.Theme&&this.Theme.decoderState.state.talk&&this.Theme.setDecoderState({talk:!1});var e=re.getGlobalState(),t=re.getInstance(this.id);e.talk&&re.setGlobalState({talk:!1}),t.getState().talk&&t.setState({talk:!1})}},{key:"setVolumeGain",value:function(e){return this.Talk.setVolumeGain(e)}},{key:"getMicrophonePermission",value:function(){return this.Talk.getMicrophonePermission()}},{key:"getMicrophonesList",value:function(){return this.Talk.getMicrophonesList()}},{key:"setProfile",value:function(e){this.Talk.setProfile(e)}},{key:"destroy",value:function(){this._destroy=!0;var e=re.getInstance(this.id);e&&(e.getState().sound&&this.closeSound(),e.getState().talk&&(this.stopTalk(),e.setState({talk:!1}),re.setGlobalState({talk:!1}))),n.isEnabled&&(n.off("change",this._fullscreenChangeEvent),this._fullscreenChangeEvent=null);var t=document.getElementById("".concat(this.id,"-wrap"));if(this._resizeObserver&&t){try{this._resizeObserver.unobserve(t)}catch(e){}this._resizeObserver=null}this.Theme&&(this.Theme.decoderState.state.play&&this.stop(),"function"==typeof this.Theme.destroy&&this.Theme.destroy(),this.Theme=null,window.EZUIKit[this.params.id].state.EZUIKitPlayer.themeInit=!1),this.pluginStatus&&"function"==typeof this.pluginStatus.destroy&&this.pluginStatus.destroy(),this.Talk&&"function"==typeof this.Talk.destroy&&this.Talk.destroy(),window.recTimer&&Array.isArray(window.recTimer)&&(window.recTimer[this.id].map((function(e){clearInterval(e)})),window.recTimer[this.id]=[]),this.recTimer&&clearInterval(this.recTimer),this._abortFetch();var o=this.jSPlugin.JS_DestroyWorker(0);if(re&&this.id&&re.removeInstance(this.id),re&&0===re.listInstances().length){if(i._STYLE){var a=document.getElementById(i._STYLE.id);a&&document.getElementsByTagName("head")[0].removeChild(a),i._STYLE=null}if(U._STYLE){var r=document.getElementById(U._STYLE.id);r&&document.getElementsByTagName("head")[0].removeChild(r),U._STYLE=null}if(V._STYLE){var s=document.getElementById(V._STYLE.id);s&&document.getElementsByTagName("head")[0].removeChild(s),V._STYLE=null}if(H._STYLE){var c=document.getElementById(H._STYLE.id);c&&document.getElementsByTagName("head")[0].removeChild(c),H._STYLE=null}if(ce._STYLE){var l=document.getElementById(ce._STYLE.id);l&&document.getElementsByTagName("head")[0].removeChild(l),ce._STYLE=null}}return this.eventEmitter&&this.eventEmitter.emit("destroy",{eventType:"destroy",code:0,target:this,msg:this.i18n.t("DESTROY")}),this.jSPlugin=null,document.getElementById("".concat(this.id,"-wrap"))&&this.initDOM&&(document.getElementById("".concat(this.id,"-wrap")).parentNode.appendChild(this.initDOM),document.getElementById("".concat(this.id,"-wrap")).parentNode.removeChild(document.getElementById("".concat(this.id,"-wrap"))),delete this.initDOM),C(o)?o:new Promise((function(e){e(o)}))}},{key:"getDeviceCapacity",value:function(e){var t=this,n=this.env.domain;this.capacity={},this.env&&(n=this.env.domain);var i=n+"/api/lapp/device/capacity",o=e||{accessToken:this.accessToken||this.token.deviceToken.video,deviceSerial:A(this.url).deviceSerial};R(i,"POST",o,"",(function(e){if(t.support3DZoom=!1,document.getElementById("".concat(t.id,"-zoom-content"))&&(document.getElementById("".concat(t.id,"-zoom-content")).title=t.i18n.t("ZOOM")),200==e.code&&e.data){if(t.capacity=e.data,t.isMobile&&t.isCall&&(!t.capacity.support_doorcall_playback||1!=t.capacity.support_doorcall_playback)){if(t.isWebConsole)return;setTimeout((function(){document.getElementById("".concat(t.jSPlugin.id,"-wrap"))&&document.getElementById("miniRecbox")&&(document.getElementById("".concat(t.jSPlugin.id,"-wrap")).removeChild(document.getElementById("miniClose")),document.getElementById("".concat(t.jSPlugin.id,"-wrap")).removeChild(document.getElementById("miniRecbox")))}),1500)}t.capacity&&"1"==t.capacity.support_3d_position&&t.url.indexOf(".live")>-1&&(t.support3DZoom=!0,t.params.use3DZoom&&(t.use3DZoom=!0,document.getElementById("".concat(t.id,"-zoom-content"))&&(document.getElementById("".concat(t.id,"-zoom-content")).title=t.i18n.t("3D_ZOOM")))),t.eventEmitter&&t.eventEmitter.emit("getDeviceCapacity",{eventType:"getDeviceCapacity",code:0,data:e,target:t,msg:t.i18n.t("GET_CAPACITY")})}}))}},{key:"pause",value:function(e){var t=this;return new Promise((function(n,i){t.jSPlugin.JS_CloseSound(0),t.jSPlugin.JS_Pause(0,e).then((function(e){t.eventEmitter&&t.eventEmitter.emit("pause",{eventType:"pause",code:0,target:t,msg:t.i18n.t("PAUSE")}),t.Theme&&t.Theme.setDecoderState({play:!1,pauseDate:e.pauseDate}),n()})).catch((function(e){t.eventEmitter&&t.eventEmitter.emit("pause",{eventType:"pause",code:-1,target:t,msg:e||t.i18n.t("PAUSE_FAILED")}),i(e)}))}))}},{key:"_resume",value:function(e){var t=this;return new Promise((function(n,i){t.pluginStatus.setPlayStatus({play:!1,loading:!0}),t.validateCode&&""!=t.validateCode&&t.jSPlugin.JS_SetSecretKey(0,t.validateCode),t.jSPlugin.JS_Resume(e).then((function(e){setTimeout((function(){-1!==t.url.indexOf(".rec")&&1!=t.speed&&t.jSPlugin.JS_Speed(t.speed)}),500),t.Theme&&(t.Theme.setDecoderState({play:!0}),t.fast(t.speed));var i=re.getGlobalState();re.getInstance(t.id).getState().sound&&!1===i.sound&&setTimeout((function(){t.openSound()}),500),t.eventEmitter&&t.eventEmitter.emit("resume",{eventType:"resume",code:0,target:t,msg:t.i18n.t("RESUME")}),n(e)})).catch((function(e){t.eventEmitter&&t.eventEmitter.emit("resume",{eventType:"resume",code:-1,target:t,msg:e||t.i18n.t("RESUME_FAILED")}),i(e)}))}))}},{key:"getVideoLevelList",value:function(){return this.eventEmitter&&this.eventEmitter.emit("getVideoLevelList",{eventType:"getVideoLevelList",code:0,data:this.videoLevelList,target:this,msg:this.i18n.t("GET_VIDEO_LEVEL_LIST")}),this.videoLevelList}},{key:"getVideoLevel",value:function(){return this.eventEmitter&&this.eventEmitter.emit("getVideoLevel",{eventType:"getVideoLevel",code:0,data:this.videoLevel,target:this,msg:this.i18n.t("GET_VIDEO_LEVEL_LIST")}),this.videoLevel}},{key:"getPtzStatus",value:function(){if(this.Theme)return this.eventEmitter&&this.eventEmitter.emit("getPtzStatus",{eventType:"getPtzStatus",code:0,data:!!this.Theme&&this.Theme.Ptz.showPtz,target:this,msg:this.i18n.t("GET_PTZ_STATUS")}),this.Theme.Ptz.showPtz;this.eventEmitter&&this.eventEmitter.emit("getPtzStatus",{eventType:"getPtzStatus",code:-1,data:!!this.Theme&&this.Theme.Ptz.showPtz,target:this,msg:this.i18n.t("GET_PTZ_STATUS_FAILED")})}},{key:"openPtz",value:function(){return this.Theme?this.isMobile&&this.Theme&&!this.Theme.decoderState.state.expend?(this.eventEmitter&&this.eventEmitter.emit("openPtz",{eventType:"openPtz",code:-1,target:this,msg:this.i18n.t("MOBILE_HIDE_PTZ")}),!1):(this.Theme.setDecoderState({pantile:!0}),void this.Theme.Ptz.show()):(this.eventEmitter&&this.eventEmitter.emit("openPtz",{eventType:"openPtz",code:-1,target:this,msg:this.i18n.t("OPTION_PTZ_FAILED")}),{code:-1,msg:this.i18n.t("OPTION_PTZ_FAILED")})}},{key:"closePtz",value:function(){if(!this.Theme)return this.eventEmitter&&this.eventEmitter.emit("closePtz",{eventType:"closePtz",code:-1,target:this,msg:this.i18n.t("OPTION_PTZ_FAILED")}),{code:-1,msg:this.i18n.t("OPTION_PTZ_FAILED")};this.Theme.setDecoderState({pantile:!1}),this.Theme.Ptz.hide()}},{key:"isCurrentBrowserFullscreen",get:function(){return this._isCurrentBrowserFullscreen}},{key:"browserFullscreen",value:function(){var e=document.getElementById("".concat(this.id,"-wrap"));return e&&n.isEnabled?n.request(e):Promise.resolve()}},{key:"exitBrowserFullscreen",value:function(){return this.exitFullscreen()}},{key:"getPlayRate",value:function(){return this.eventEmitter&&this.eventEmitter.emit("getPlayRate",{eventType:"getPlayRate",code:0,data:this.speed,target:this,msg:this.i18n.t("GET_SPEED")}),this.speed}},{key:"setMirrorFlip",value:function(e){return"number"!=typeof e?(this.eventEmitter&&this.eventEmitter.emit("setMirrorFlip",{eventType:"setMirrorFlip",code:-1,target:this,msg:this.i18n.t("MIRROR_TYPE_ERROR")}),Promise.reject({code:-1,msg:this.i18n.t("MIRROR_TYPE_ERROR")})):(this.eventEmitter&&this.eventEmitter.emit("setMirrorFlip",{eventType:"setMirrorFlip",code:0,target:this,msg:this.i18n.t("MIRROR")}),function(e,t,n,i){return new Promise((function(o,a){R("".concat(e.env.domain,"/api/lapp/device/ptz/mirror"),"POST",{accessToken:e.accessToken||e.token.deviceToken.video,deviceSerial:t,channelNo:n,command:i},"",o)}))}(this,this.deviceSerial,this.channelNo,e))}},{key:"setFECCorrectType",value:function(e,t){var n=this;if(!this.capacity||this.capacity&&"1"!==this.capacity.support_fisheye_mode)return this.eventEmitter&&this.eventEmitter.emit("setFECCorrectType",{eventType:"setFECCorrectType",code:-1,target:this,msg:this.i18n.t("FEC.DEVICE_NOT_SUPPORT")}),Promise.reject({code:-1,msg:this.i18n.t("FEC.DEVICE_NOT_SUPPORT")});if(!window.SharedArrayBuffer||(this.jSPlugin.isHardH264||this.jSPlugin.isHardH265)&&this.jSPlugin.useHardDev)return this.eventEmitter&&this.eventEmitter.emit("setFECCorrectType",{eventType:"setFECCorrectType",code:-1,target:this,msg:this.i18n.t("FEC.FEC_SUPPORT_VERSION")}),Promise.reject({code:-1,msg:this.i18n.t("FEC.FEC_SUPPORT_VERSION")});var i=(1===e.place?X:3===e.place?Y:[]).find((function(t){return t.type===e.type&&t.place===e.place}));return i?i.split>0&&void 0===b(t)?(this.eventEmitter&&this.eventEmitter.emit("setFECCorrectType",{eventType:"setFECCorrectType",code:-1,target:this,msg:this.i18n.t("FEC.NO_CANVAS_ID")}),Promise.reject({code:-1,msg:this.i18n.t("FEC.NO_CANVAS_ID")})):(this.jSPlugin.FECSplitIds=t,this.jSPlugin.correctType=i,this._FECCorrectType=i,this._FECSplitIds=t,this.stop().then((function(){return n.play().then((function(e){return 1===i.place&&0===i.correctType||3===i.place&&0===i.correctType?n.Theme.resumeFECBtn():n.Theme.disabledFECBtn(),n.eventEmitter&&n.eventEmitter.emit("setFECCorrectType",{eventType:"setFECCorrectType",code:0,target:n,msg:n.i18n.t("FEC.CHANGE_FEC_TYPE")}),e}))}))):(this.eventEmitter&&this.eventEmitter.emit("setFECCorrectType",{eventType:"setFECCorrectType",code:-1,target:this,msg:this.i18n.t("FEC.TYPE_NOT_SUPPORT")}),Promise.reject({code:-1,msg:this.i18n.t("FEC.TYPE_NOT_SUPPORT")}))}},{key:"setFEC3DViewParam",value:function(e){return!this._FECCorrectType||(this.jSPlugin.isHardH264||this.jSPlugin.isHardH265)&&this.jSPlugin.useHardDev?(this.eventEmitter&&this.eventEmitter.emit("setFEC3DViewParam",{eventType:"setFEC3DViewParam",code:-1,target:this,msg:this.i18n.t("FEC.FEC_SUPPORT_VERSION")}),Promise.reject({code:-1,msg:this.i18n.t("FEC.FEC_SUPPORT_VERSION")})):this.jSPlugin.FEC_Set3DViewParam&&this._FECCorrectType&&(3===this._FECCorrectType.place&&this._FECCorrectType.correctType===K||1===this._FECCorrectType.place&&this._FECCorrectType.correctType===J)?(this.eventEmitter&&this.eventEmitter.emit("setFEC3DViewParam",{eventType:"setFEC3DViewParam",code:0,target:this,msg:this.i18n.t("FEC.SET_FEC_PARAMS")}),this.jSPlugin.FEC_Set3DViewParam(e)):(this.eventEmitter&&this.eventEmitter.emit("setFEC3DViewParam",{eventType:"setFEC3DViewParam",code:-1,target:this,msg:this.i18n.t("FEC.SET_FEC_PARAMS_FAILED")}),Promise.reject({code:-1,msg:this.i18n.t("FEC.SET_FEC_PARAMS_FAILED")}))}},{key:"getFEC3DViewParam",value:function(e){return!this._FECCorrectType||(this.jSPlugin.isHardH264||this.jSPlugin.isHardH265)&&this.jSPlugin.useHardDev?(this.eventEmitter&&this.eventEmitter.emit("getFEC3DViewParam",{eventType:"getFEC3DViewParam",code:-1,target:this,msg:this.i18n.t("FEC.GET_FEC_PARAMS_SUPPORT_VERSION")}),Promise.reject({code:-1,msg:this.i18n.t("FEC.GET_FEC_PARAMS_SUPPORT_VERSION")})):this.jSPlugin.FEC_Set3DViewParam&&this._FECCorrectType&&(3===this._FECCorrectType.place&&this._FECCorrectType.correctType===K||1===this._FECCorrectType.place&&this._FECCorrectType.correctType===J)?(this.eventEmitter&&this.eventEmitter.emit("getFEC3DViewParam",{eventType:"getFEC3DViewParam",code:0,target:this,data:this.jSPlugin.FEC_Get3DViewParam(e),msg:this.i18n.t("FEC.SET_FEC_PARAMS")}),this.jSPlugin.FEC_Get3DViewParam(e)):(this.eventEmitter&&this.eventEmitter.emit("getFEC3DViewParam",{eventType:"getFEC3DViewParam",code:-1,target:this,msg:this.i18n.t("FEC.SET_FEC_PARAMS_FAILED")}),Promise.reject({code:-1,msg:this.i18n.t("FEC.SET_FEC_PARAMS_FAILED")}))}},{key:"setWaterMarkFont",value:function(e){return this.eventEmitter&&this.eventEmitter.emit("setWaterMarkFont",{eventType:"setWaterMarkFont",code:0,target:this,msg:this.i18n.t("SET_WATERMARK")}),this.waterMark_JSPlugin=e,this.jSPlugin.JS_SetWaterMarkFont(e)}},{key:"changeTheme",value:function(e){this.Theme&&this.Theme.changeTheme(e)}},{key:"_abortFetch",value:function(){this._controllers.forEach((function(e){e.abort()})),this._controllers=[]}},{key:"isCurrentFullscreen",get:function(){return this._isCurrentFullscreen}},{key:"_$containerResizeEvent",value:function(){try{var e=document.getElementById("".concat(this.id,"-wrap"));this._resizeObserver=new ResizeObserver((function(e){var t,n=h(e);try{for(n.s();!(t=n.n()).done;){var i=t.value,o=i.contentRect;o.left,o.top,o.width,o.height;i.target}}catch(e){n.e(e)}finally{n.f()}})),e&&this._resizeObserver.observe(e)}catch(e){}}}],[{key:"_instanceStyle",value:function(){i._STYLE||(i._STYLE=document.createElement("style"),i._STYLE.id="ezuikit-player-wrap-fullscreen",i._STYLE.innerHTML="\n .ezuikit-player-wrap-web-fullscreen {}\n .ezuikit-player-wrap-fullscreen .header-controls{ display: none!important}\n .ezuikit-player-wrap-fullscreen .ez-iframe-footer-container { display: none!important}\n .ezuikit-player-wrap-fullscreen .ezuikit-time-line-control{ display: none!important}\n .ezuikit-player-wrap-fullscreen .timeline-controls{ display: none!important}\n ",document.getElementsByTagName("head")[0].appendChild(i._STYLE))}}])}();p(zt,"_STYLE",void 0),p(zt,"LOCALES",{zh:de,en:ue}),zt.prototype.tokenSchema={streamToken:{live:{actionType:"PREVIEW",resourceCategory:"global"},rec:{actionType:"PLAYBACK",resourceCategory:"global"},talk:{actionType:"TALK",resourceCategory:"global"}},deviceToken:{video:{action:"*",resourceCategory:"video"},global:{action:"*",resourceCategory:"global"}},httpToken:{url:{urlPattern:"/**"}}},zt.prototype.deepCheck=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;if(n<0)return{};var i={};for(var o in e)if(void 0!==e[o]&&void 0===t[o])i[o]=e[o];else if("object"===b(e[o])&&!Array.isArray(e[o])){var a=zt.prototype.deepCheck(e[o],t[o],n-1);Object.keys(a).length>0&&(i[o]=a)}return i},zt.prototype.checkToken=function(e){return zt.prototype.deepCheck(zt.prototype.tokenSchema,e)};var Nt=null;function Ft(e){e.responseMsg.eventName,console.log(e.responseMsg)}function Ut(){Nt.JS_SetWindowControlCallback({cbIntegrationCallBack:Ft}),Nt.JS_StartService("window",{dllPath:"./chain/cloudTransform.dll"}).then((function(){Nt.JS_CreateWnd("playWnd",900,500).then((function(){console.log("JS_CreateWnd success")}))}))}function Vt(){console.log("cbConnectError"),Nt=null,console.error("确认本地进程是否已安装并开启成功!")}function Ht(e){console.log("cbConnectClose"),Nt=null}var Gt=new WeakSet,Zt=function(){return m((function e(t){var n=this;l(this,e),d(this,Gt),p(this,"changeModel",(function(e,t){var i=n;n.switchVideo=parseInt(e),Nt&&Nt.JS_RequestInterface({funcName:"ChangeModel",arguments:encodeURI(JSON.stringify({model:e}))}).then((function(n){0==e?i.play({deviceSerial:t.deviceSerial,channelNo:t.channelNo,validateCode:t.validateCode}):i.play({deviceSerial:t.deviceSerial,channelNo:t.channelNo,validateCode:t.validateCode,startTime:t.startTime,endTime:t.endTime})}))})),p(this,"init",(function(e){var t=n;if(e.appKey&&e.accessToken){void 0!==e.appKey&&(n.appKey=e.appKey),void 0!==e.accessToken&&(n.accessToken=e.accessToken),void 0!==e.platformId&&(n.platformId=e.platformId);var i=p(p(p(p(p(p(p(p({layout:+t.layout,userName:"",waterMark:""},"waterMark","1"),"iWndType",0),"intelligenceEnable",1),"isRecord",1),"isSetPos",1),"motionDetectEnable",0),"playBackAlarmOverlyingEnable",0),"response",{code:0,message:null,data:{appKey:e.appKey,ezvizToken:e.accessToken,videoLevel:0,logLevel:3,showMainTool:1,showSubTool:1,waterMark:"1",userName:"openteam",platformId:e.platformId}});console.log("初始化入参",i),window.ezuikitMonitor.report({protocol:"hd",appKey:e.appKey,action:1,logInfo:{argumentsPram:i}}),Nt.JS_RequestInterface({funcName:"Init",arguments:encodeURI(JSON.stringify(i))}).then((function(e){console.log(e.responseMsg),t.showTips(!0,"视频初始化成功!")}))}else t.showTips(!1,"请输入appkey和token")})),p(this,"play",(function(e){var t=n;if(e.deviceSerial&&e.channelNo){void 0!==e.deviceSerial&&(n.deviceSerial=e.deviceSerial),void 0!==e.channelNo&&(n.channelNo=e.channelNo),void 0!==e.startTime&&e.startTime&&(n.startTime=e.startTime+" 00:00:00"),void 0!==e.endTime&&e.endTime&&(n.endTime=e.endTime+" 23:59:59"),void 0!==e.validateCode&&e.validateCode&&(n.validateCode=e.validateCode);var i={response:{code:0,message:null,data:{deviceSerial:e.deviceSerial,channelCode:e.channelNo,channelNo:+e.channelNo,codeIsEncrypt:0,validateCode:e.validateCode,deviceClass:t.deviceClass,deviceType:"10222",channelId:"2222222222",channelName:"channelNameTest",storeName:"storeName",storeId:"storeid",startTime:n.startTime,endTime:n.endTime}}};"1"===t.deviceClass?(i.response.data.channelCode=t.channelNo,i.response.data.platformId=t.platformId):i.response.data.channelNo=+t.channelNo,1===n.switchVideo&&(n.startTime&&(i.response.data.startTime=n.startTime),n.endTime&&(i.response.data.endTime=n.endTime)),console.log("预览/回放入参",i),Nt.JS_RequestInterface({funcName:0===n.switchVideo?"StartPreview":"StartPlayback",arguments:encodeURI(JSON.stringify(i))}).then((function(e){console.log(e.responseMsg),t.showTips(!0,"预览/回放成功!")})).catch((function(e){console.log("开始播放:",e)}))}})),p(this,"showCBInfo",(function(e){n.callbackMessage=n.callbackMessage+JSON.stringify(e)+"\n\n",console.log(n.callbackMessage)})),p(this,"showTips",(function(e,t){})),p(this,"hideVideo",(function(){Nt.JS_HideWnd()})),p(this,"showVideo",(function(){Nt.JS_ShowWnd()})),p(this,"GetLayout",(function(){Nt.JS_RequestInterface({funcName:"GetLayout",arguments:encodeURI(JSON.stringify({response:{code:0,message:null,data:null}}))}).then((function(e){console.log(JSON.stringify(e.responseMsg)),console.log(e.responseMsg)}))})),p(this,"capturePicture",(function(e){Nt.JS_RequestInterface({funcName:"CaptureJPGEx",arguments:encodeURI(JSON.stringify({response:{code:0,message:null,data:null}}))}).then((function(e){console.log(JSON.stringify(e.responseMsg)),console.log(e.responseMsg)}))})),p(this,"stop",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:-1;Nt.JS_RequestInterface({funcName:"StopPlay",arguments:encodeURI(JSON.stringify({response:{code:0,message:null,data:{wndId:parseInt(e)}}}))}).then((function(e){console.log(JSON.stringify(e.responseMsg)),console.log(e.responseMsg)}))})),p(this,"setLayout",(function(e){var t=parseInt(e);isNaN(t)||0==t||t>=13?console.log("不支持实际布局大于16的窗口数"):(n.layout=t,Nt.JS_RequestInterface({funcName:"SetLayout",arguments:encodeURI(JSON.stringify({response:{code:0,message:null,data:{layout:t}}}))}).then((function(e){console.log(JSON.stringify(e.responseMsg)),console.log(e.responseMsg)})))})),p(this,"setSoundVolumn",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:-1,t=arguments.length>1?arguments[1]:void 0;Nt.JS_RequestInterface({funcName:"SoundVolumn",arguments:encodeURI(JSON.stringify({response:{code:0,message:null,data:{wndId:parseInt(e),volumn:parseInt(t)}}}))}).then((function(e){console.log(JSON.stringify(e.responseMsg)),console.log(e.responseMsg)}))})),p(this,"testMute",(function(){var e=parseInt(prompt("请输入窗口ID"));Nt.JS_RequestInterface({funcName:"MuteOnOff",arguments:encodeURI(JSON.stringify({response:{code:0,message:null,data:{wndId:e}}}))}).then((function(e){console.log(JSON.stringify(e.responseMsg)),console.log(e.responseMsg)}))})),p(this,"testSelectWnd",(function(){var e=parseInt(prompt("请输入窗口ID"));Nt.JS_RequestInterface({funcName:"SelectPlayWnd",arguments:encodeURI(JSON.stringify({response:{code:0,message:null,data:{wndId:e}}}))}).then((function(e){console.log(JSON.stringify(e.responseMsg)),console.log(e.responseMsg)}))})),p(this,"setVideoLevel",(function(e,t){Nt.JS_RequestInterface({funcName:"SetVideoLevel",arguments:encodeURI(JSON.stringify({response:{code:0,message:null,data:{wndId:1==n.switchVideo?0:parseInt(e),level:parseInt(t,10)}}}))}).then((function(e){console.log(JSON.stringify(e.responseMsg)),console.log(e.responseMsg)}))})),p(this,"startTalk",(function(e){Nt.JS_RequestInterface({funcName:"StartTalk",arguments:encodeURI(JSON.stringify({response:{code:0,message:null,data:{wndId:parseInt(e)}}}))}).then((function(e){console.log(JSON.stringify(e.responseMsg)),console.log(e.responseMsg)}))})),p(this,"stopTalk",(function(e){Nt.JS_RequestInterface({funcName:"StopTalk",arguments:encodeURI(JSON.stringify({response:{code:0,message:null,data:{wndId:parseInt(e)}}}))}).then((function(e){console.log(JSON.stringify(e.responseMsg)),console.log(e.responseMsg)}))})),p(this,"startSave",(function(e){Nt.JS_RequestInterface({funcName:"StartRecord",arguments:encodeURI(JSON.stringify({response:{code:0,message:null,data:{wndId:parseInt(e)}}}))}).then((function(e){console.log(JSON.stringify(e.responseMsg)),console.log(e.responseMsg)}))})),p(this,"stopSave",(function(e){Nt.JS_RequestInterface({funcName:"StopRecord",arguments:encodeURI(JSON.stringify({response:{code:0,message:null,data:{wndId:parseInt(e)}}}))}).then((function(e){console.log(JSON.stringify(e.responseMsg)),console.log(e.responseMsg)}))})),this.appKey="b9a3ad6e8026410095d8252169fa430a",this.accessToken="at.2vtum8873rrcwbrv431qb6pn94dkbv23-8dw2twn355-1u3x014-wrthellzk",this.deviceSerial="C33368372",this.channelNo="1",this.validateCode="",this.deviceClass="0",this.platformId="",this.startTime="",this.endTime="",this.layout=2,this.switchVideo=0,this.tips="调用成功",this.successTip=!1,this.tipsShow=!1,Nt=function(e,t,n,i){return new WebControl({szPluginContainer:e,iServicePortStart:14510,iServicePortEnd:14519,cbConnectSuccess:t,cbConnectError:n,cbConnectClose:i})}("playWnd",Ut,Vt,Ht),function(e,t,n){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:n;throw new TypeError("Private element is not present on this object")}(Gt,this,Wt).call(this)}),[{key:"alarmMsg",value:function(){var e={request:{body:{alarmTypes:[10800,0,0,0,0],channelId:"066dde0465dd4abaab6afe355baf9d0b",endTime:"1621007999000",startTime:"1620921600000"},callBack:"GetAlarmMsgOrders",majorKey:"",method:"POST",storeId:"",url:"/videoplugin/message/getMessageByTypes"},response:{code:0,message:null,data:[{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620921217e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620920678e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620920586e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620919513e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620919483e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620919333e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620918913e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620918616e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620918305e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620917858e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620917658e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620917244e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620917064e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620916994e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620916668e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620916571e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620916529e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620916343e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620916081e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620915825e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620915676e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620915531e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620915394e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620915197e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620914971e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620914644e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620914533e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620914457e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620914376e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620914284e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620913973e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620913431e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620912834e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620912771e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620912354e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620912275e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620912093e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620912024e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:162091189e4},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620911839e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620911807e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:162091176e4},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620911682e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:162091127e4},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620911184e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620910982e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620910931e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620910851e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620910781e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620910727e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620910677e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620910647e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620910588e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620910544e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620910484e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:162091041e4},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:162091035e4},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620910278e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620910217e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620910124e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620909976e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620909939e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620909847e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620909817e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620909736e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620909664e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620909605e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620909575e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620909346e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620909247e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620909216e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620909149e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:162090912e4},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620909028e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620908999e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620908969e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620908909e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:162090888e4},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620908835e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:162090875e4},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:162090872e4},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620908652e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620908612e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620908582e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620908552e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620908456e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620908426e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620908299e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620908268e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:162090805e4},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620907918e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620907758e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620907625e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620907386e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620907292e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620907127e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620906864e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620906828e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620906797e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620906747e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620906717e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620906632e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620906501e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620906412e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620906368e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620906329e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620906142e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620906112e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620906013e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620905946e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620905823e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620905697e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620905622e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620905571e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620905541e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620905511e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620905481e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620905442e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620905412e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620905382e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620905352e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620905322e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620905262e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620905196e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:162090515e4},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620904994e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620904931e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620904813e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:162090473e4},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:16209047e5},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620904618e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620904286e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620904173e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620904143e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620904112e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620904053e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620904023e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620903854e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620903789e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620903723e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620903643e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620903612e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620903573e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620903505e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620903383e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620903329e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620903299e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620903268e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:16209032e5},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620903149e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:162090312e4},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620902977e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:162090286e4},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:162090277e4},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620902639e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620902609e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620902517e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620902373e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:162090232e4},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620902253e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620902198e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620902132e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:162090194e4},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:162090185e4},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620901789e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620901746e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620901685e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620901638e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:162090152e4},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620901489e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620901424e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620901271e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620901233e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620901157e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620900915e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620900834e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620900774e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620900744e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:162090065e4},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:162090044e4},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620900409e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620900175e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620900134e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620900069e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620900016e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620899976e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620899908e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620899879e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620899826e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620899756e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620899599e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620899559e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620899467e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620899406e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620899265e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620899211e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:162089914e4},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:162089911e4},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:162089905e4},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620898991e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620898926e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620898834e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620898785e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620898746e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620898697e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620898666e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620898507e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620898293e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620898248e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620898218e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620898157e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620898088e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:162089802e4},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:162089796e4},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:162089785e4},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620897807e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620897771e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620897719e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:162089769e4},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:162089763e4},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:16208976e5},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:162089757e4},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:162089754e4},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620897475e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620897412e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620897369e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620897339e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620897279e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620897237e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620897207e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620897172e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620897142e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620897112e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620897024e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620896985e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620896874e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620896843e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620896814e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620896783e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620896736e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620896621e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620896478e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620896447e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620896358e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620896307e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620896277e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620896247e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620896214e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:162089604e4},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620895953e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620895921e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620895868e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:162089577e4},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620895704e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:162089559e4},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620895559e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:162089548e4},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620895442e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620895377e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620895347e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620895293e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620895171e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620895136e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620895017e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620894926e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620894896e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620894864e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620894834e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620894738e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620894599e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620894539e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620894426e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620894359e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620894297e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620894213e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620894183e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620894051e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620893964e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620893934e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620893843e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620893754e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620893676e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620893606e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:162089353e4},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620893452e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620893423e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620893357e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620893288e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620893143e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620893051e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620893006e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620892904e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620892824e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620892764e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620892541e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620892479e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620892412e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620892311e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620892281e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620892209e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620892063e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620891991e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620891931e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:162089187e4},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:162089181e4},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620891708e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620891655e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620891585e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620891531e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620891501e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620891401e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620891297e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620891257e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620891216e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620891178e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620891128e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620891033e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620890973e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:162089094e4},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620890879e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620890794e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620890714e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620890616e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620890586e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620890469e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620890414e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620890346e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620890288e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620890179e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620890108e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620890041e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620890011e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620889937e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620889719e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620889635e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620889481e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620889451e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620889317e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620889227e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620889139e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620889034e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620888973e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620888902e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620888837e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620888767e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620888737e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620888706e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620888633e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620888571e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620888413e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620888353e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620888323e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620888249e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620888162e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620888e6},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620887859e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620887776e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620887734e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620887692e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620887619e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620887501e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620887355e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:162088732e4},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620887289e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620887126e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620887066e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620887034e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:162088697e4},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620886884e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620886804e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620886728e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620886609e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620886538e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620886478e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620886396e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620886334e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620886246e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620886111e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620886011e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620885956e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620885894e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620885696e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620885514e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620885484e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620885414e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620885383e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620885341e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620885306e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620885276e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620885216e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620885186e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620885114e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620885037e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620885006e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620884975e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620884945e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620884911e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620884851e3},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:162088478e4},{alarmType:10800,alarmName:"移动侦测报警",alarmTime:1620884696e3}],success:!0}};console.log(e),Nt.JS_RequestInterface({funcName:"TransFunctionResult",arguments:encodeURI(JSON.stringify(e))})}}])}();function Wt(){window.onscroll=function(){null!=Nt&&Nt.JS_Resize(900,500)},window.onresize=function(){null!=Nt&&Nt.JS_Resize(900,500)},window.onunload=function(){try{Nt.JS_HideWnd(),null!=Nt&&(Nt.JS_DestroyWnd().then((function(){console.log("JS_DestroyWnd")}),(function(){})),Nt.JS_StopService("window").then((function(){Nt.JS_Disconnect().then((function(){console.log("JS_Disconnect")}),(function(){}))})))}catch(e){console.error(e)}},window.onpagehide=function(){try{Nt.JS_HideWnd()}catch(e){console.error(e)}}}
|
|
40
40
|
/*
|
|
41
41
|
The MIT License (MIT)
|
|
42
42
|
|