=d.getTime()&&i.getTime()<=c.getTime()){var C=o.substring(a+3,a+11);s=60*parseInt(C.split(":")[0],10)+parseInt(C.split(":")[1],10)}}else if(i.getTime()>=d.getTime()||i.getTime()<=c.getTime()){C=o.substring(a+3,a+11);s=60*parseInt(C.split(":")[0],10)+parseInt(C.split(":")[1],10)}}var T=o.match(/\D+([+-])(\d+):(\d+):(\d+)/);if(5==T.length){var D=(new Date).getTimezoneOffset(),w=60*parseInt(T[2])+parseInt(T[3]);w="+"===T[1]?w:-w,iDeviceMinusLocalTime=60*(D-w+s)*1e3}e.iDeviceMinusLocalTime=iDeviceMinusLocalTime,t(iDeviceMinusLocalTime)}},error:()=>{n()}};c.I_SendHTTPRequest(e.szDeviceIdentify,a.CGI.time,r)}))},q.prototype.getAnalogChannelInfo=function(e,n){return new Promise((function(r,i){var o={};d.extend(o,n),d.extend(o,{success:function(i){var o=[];o.push("");var s=t.$XML(i).find("VideoInputChannel",!0);e.iAnalogChannelNum=s.length;for(var a=0,c=s.length;a"),o.push(""+t.$XML(u).find("id").eq(0).text()+""),o.push(""+t.$XML(u).find("inputPort").eq(0).text()+""),o.push(""+d.escape(t.$XML(u).find("name").eq(0).text())+""),o.push(""+t.$XML(u).find("videoFormat").eq(0).text()+""),o.push("")}o.push("");var l=d.loadXML(o.join(""));n.success&&n.success(l),r(l)},error:function(e){n.error&&n.error(e),i(e)}}),c.I_SendHTTPRequest(e.szDeviceIdentify,a.CGI.getAnalogChannelInfo,o)}))},q.prototype.getDigitalChannel=function(e,n){return new Promise((function(r,i){var o={};d.extend(o,n),d.extend(o,{success:function(e){var i=[];i.push("");for(var o=t.$XML(e).find("InputProxyChannel",!0),s=0,a=o.length;s"),i.push(""+t.$XML(c).find("id").eq(0).text()+""),i.push(""+d.escape(t.$XML(c).find("name").eq(0).text())+""),i.push("")}i.push("");var u=d.loadXML(i.join(""));n.success&&n.success(u),r(u)},error:function(e){n.error&&n.error(e),i(e)}}),c.I_SendHTTPRequest(e.szDeviceIdentify,a.CGI.getDigitalChannel,o)}))},q.prototype.getDigitalChannelInfo=function(e,n){return new Promise((async(r,i)=>{var o=null,s={};try{o=await a.getDigitalChannel(e,{})}catch(e){i(e)}for(var u=t.$XML(o).find("InputProxyChannel",!0),l=0,p=u.length;l");for(var o=t.$XML(e).find("InputProxyChannelStatus",!0),a=0,c=o.length;a"),i.push(""+l+""),i.push(""),i.push(""+t.$XML(u).find("proxyProtocol").eq(0).text()+""),i.push(""+t.$XML(u).find("addressingFormatType").eq(0).text()+""),i.push(""+t.$XML(u).find("ipAddress").eq(0).text()+""),i.push(""+t.$XML(u).find("managePortNo").eq(0).text()+""),i.push(""+t.$XML(u).find("srcInputPort").eq(0).text()+""),i.push(""+d.escape(t.$XML(u).find("userName").eq(0).text())+""),i.push(""+t.$XML(u).find("streamType").eq(0).text()+""),i.push(""+t.$XML(u).find("online").eq(0).text()+""),i.push(""+d.escape(s[l])+""),i.push(""),i.push("")}i.push("");var p=d.loadXML(i.join(""));n.success&&n.success(p),r(p)},error:function(e){n.error&&n.error(e),i(e)}}),c.I_SendHTTPRequest(e.szDeviceIdentify,a.CGI.getDigitalChannelInfo,P)}))},q.prototype.getZeroChannelInfo=function(e,t){return c.I_SendHTTPRequest(e.szDeviceIdentify,this.CGI.getZeroChannelInfo,t)},q.prototype.getStreamChannels=function(e,t){if(0!=e.iAnalogChannelNum)d.formatString(this.CGI.getStreamChannels.analog,e.szHttpProtocol,e.szIP,e.iCGIPort);else d.formatString(this.CGI.getStreamChannels.digital,e.szHttpProtocol,e.szIP,e.iCGIPort);let n;return n=0!=e.iAnalogChannelNum?this.CGI.getStreamChannels.analog:this.CGI.getStreamChannels.digital,c.I_SendHTTPRequest(e.szDeviceIdentify,n,t)},q.prototype.getPPPoEStatus=function(e,t){return c.I_SendHTTPRequest(e.szDeviceIdentify,this.CGI.getPPPoEStatus,t)},q.prototype.getUPnPPortStatus=function(e,t){return c.I_SendHTTPRequest(e.szDeviceIdentify,this.CGI.getUPnPPortStatus,t)},q.prototype.getNetworkBond=function(e,t){return c.I_SendHTTPRequest(e.szDeviceIdentify,this.CGI.getNetworkBond,t)},q.prototype.getNetworkInterface=function(e,t){return c.I_SendHTTPRequest(e.szDeviceIdentify,this.CGI.getNetworkInterface,t)},q.prototype.getPortInfo=function(e,t){return c.I_SendHTTPRequest(e.szDeviceIdentify,this.CGI.getPortInfo,t)},q.prototype.startRealPlay=function(e,t){return new Promise((async function(r,i){var o=100*t.iChannelID+t.iStreamType,a="",c=d.delPort(e.szIP),l=e.iRtspPort;t.iPort&&(l=t.iPort),a=t.bZeroChannel?d.formatString(e.oProtocolInc.CGI.startRealPlay.zeroChannels,c,l):d.formatString(e.oProtocolInc.CGI.startRealPlay.channels,c,l,o);await n.JS_SetSecretKey(0,u.secretKey,1),console.log(11111,a),n.JS_Play(a,{auth:e.szAuth,userInfo:e.szAuth},t.iWndIndex,"","",t.bFlag).then((()=>{var n;(n=new A).iIndex=t.iWndIndex,n.szIP=e.szIP,n.iCGIPort=e.iCGIPort,n.szDeviceIdentify=e.szDeviceIdentify,n.iChannelID=t.iChannelID,n.iPlayStatus=1,s.push(n),r()}),(()=>{i()}))}))},q.prototype.startPlay=function(e,t){return new Promise((async function(r,i){n.JS_Play(t.szUrl,{auth:e.szAuth,userInfo:e.szAuth},t.iWndIndex,t.startTime,t.endTime,!0).then((()=>{var n;(n=new A).iIndex=t.iWndIndex,n.szIP=e.szIP,n.szDeviceIdentify=e.szDeviceIdentify,n.iPlayStatus=2,s.push(n),r()}),(()=>{i()}))}))},q.prototype.startVoiceTalk=function(e,t){var r=d.formatString(this.CGI.startVoiceTalk.open,e.szHttpProtocol,e.szIP,e.iCGIPort,t),i=d.formatString(this.CGI.startVoiceTalk.close,e.szHttpProtocol,e.szIP,e.iCGIPort,t),o=d.formatString(this.CGI.startVoiceTalk.audioData,e.szHttpProtocol,e.szIP,e.iCGIPort,t);return n.JS_StartTalk(r,i,o,e.szAuth,e.iAudioType,e.m_iAudioBitRate,e.m_iAudioSamplingRate,e.m_iSoundChan,e.m_iDeviceAudioSoundChan)},q.prototype.audioPlay=function(e){return n.JS_AudioPlay(e.szUrl,e.szAuth,-1,-1,!0,e.iAudioType)},q.prototype.ptzAutoControl=function(e,t,n,r){return new Promise(((i,o)=>{var s=n.iChannelID;r.iPTZSpeed=r.iPTZSpeed<7?15*r.iPTZSpeed:100,t&&(r.iPTZSpeed=0);var u={type:"PUT",url:s<=e.iAnalogChannelNum?d.formatString(a.CGI.ptzAutoControl.analog,e.szHttpProtocol,e.szIP,e.iCGIPort,n.iChannelID):d.formatString(a.CGI.ptzAutoControl.digital,e.szHttpProtocol,e.szIP,e.iCGIPort,n.iChannelID),data:""+r.iPTZSpeed+"",success:null,error:null};d.extend(u,r),d.extend(u,{success:function(){n.bPTZAuto=!n.bPTZAuto,r.success&&r.success(),i()},error:function(e){r.error&&r.error(e),o(e)}}),c.I_SendHTTPRequest(e.szDeviceIdentify,"",u)}))},q.prototype.ptzControl=function(e,t,n,r){var i=n.iChannelID;n.bPTZAuto&&this.ptzAutoControl(e,!0,n,{iPTZSpeed:0}),r.iPTZSpeed=t?0:r.iPTZSpeed<7?15*r.iPTZSpeed:100;var o=[{},{pan:0,tilt:r.iPTZSpeed},{pan:0,tilt:-r.iPTZSpeed},{pan:-r.iPTZSpeed,tilt:0},{pan:r.iPTZSpeed,tilt:0},{pan:-r.iPTZSpeed,tilt:r.iPTZSpeed},{pan:-r.iPTZSpeed,tilt:-r.iPTZSpeed},{pan:r.iPTZSpeed,tilt:r.iPTZSpeed},{pan:r.iPTZSpeed,tilt:-r.iPTZSpeed},{},{speed:r.iPTZSpeed},{speed:-r.iPTZSpeed},{speed:r.iPTZSpeed},{speed:-r.iPTZSpeed},{speed:r.iPTZSpeed},{speed:-r.iPTZSpeed}],s="",a={};switch(r.iPTZIndex){case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:a=this.CGI.ptzControl,s=""+o[r.iPTZIndex].pan+""+o[r.iPTZIndex].tilt+"";break;case 10:case 11:a=this.CGI.ptzControl,s=""+o[r.iPTZIndex].speed+"";break;case 12:case 13:a=this.CGI.ptzFocus,s=""+o[r.iPTZIndex].speed+"";break;case 14:case 15:a=this.CGI.ptzIris,s=""+o[r.iPTZIndex].speed+"";break;default:return}var u={type:"PUT",url:i<=e.iAnalogChannelNum?d.formatString(a.analog,e.szHttpProtocol,e.szIP,e.iCGIPort,n.iChannelID):d.formatString(a.digital,e.szHttpProtocol,e.szIP,e.iCGIPort,n.iChannelID),data:s,success:null,error:null};return d.extend(u,r),c.I_SendHTTPRequest(e.szDeviceIdentify,"",u)},q.prototype.setPreset=function(e,t,n){var r="",i="";r=t.iChannelID<=e.iAnalogChannelNum?d.formatString(this.CGI.setPreset.analog,e.szHttpProtocol,e.szIP,e.iCGIPort,t.iChannelID,n.iPresetID):d.formatString(this.CGI.setPreset.digital,e.szHttpProtocol,e.szIP,e.iCGIPort,t.iChannelID,n.iPresetID),i="",i+="",i+=""+n.iPresetID+"",e.szDeviceType!=p&&(i+="Preset"+n.iPresetID+"");var o={type:"PUT",url:r,data:i+="",success:null,error:null};return d.extend(o,n),c.I_SendHTTPRequest(e.szDeviceIdentify,"",o)},q.prototype.goPreset=function(e,t,n){var r={type:"PUT",url:t.iChannelID<=e.iAnalogChannelNum?d.formatString(this.CGI.goPreset.analog,e.szHttpProtocol,e.szIP,e.iCGIPort,t.iChannelID,n.iPresetID):d.formatString(this.CGI.goPreset.digital,e.szHttpProtocol,e.szIP,e.iCGIPort,t.iChannelID,n.iPresetID),success:null,error:null};return d.extend(r,n),c.I_SendHTTPRequest(e.szDeviceIdentify,"",r)},q.prototype.recordSearch=function(e,n){return new Promise(((r,i)=>{var o,s,u=n.iChannelID,l=n.iStreamType,p=n.szStartTime.replace(" ","T")+"Z",h=n.szEndTime.replace(" ","T")+"Z";o=d.formatString(a.CGI.recordSearch,e.szHttpProtocol,e.szIP,e.iCGIPort),s=""+new B+""+(100*u+l)+""+p+""+h+"50"+n.iSearchPos+"//metadata.ISAPI.org/VideoMotion";new R;var f={type:"POST",url:o,data:s,success:null,error:null};d.extend(f,n),d.extend(f,{success:function(e){var i=[];i.push(""),i.push(""+t.$XML(e).find("responseStatus").eq(0).text()+""),i.push(""+t.$XML(e).find("responseStatusStrg").eq(0).text()+""),i.push(""+t.$XML(e).find("numOfMatches").eq(0).text()+""),i.push("");for(var o=t.$XML(e).find("searchMatchItem",!0),s=0,a=o.length;s"),i.push(""+t.$XML(c).find("trackID").eq(0).text()+""),i.push(""+t.$XML(c).find("startTime").eq(0).text()+""),i.push(""+t.$XML(c).find("endTime").eq(0).text()+""),i.push(""+d.escape(t.$XML(c).find("playbackURI").eq(0).text())+""),i.push(""+t.$XML(c).find("metadataDescriptor").eq(0).text().split("/")[1]+""),i.push(""),console.log(d.escape(t.$XML(c).find("playbackURI").eq(0).text()))}i.push(""),i.push(""),e=d.loadXML(i.join("")),n.success&&n.success(e),r(e)},error:function(e){n.error&&n.error(e),i(e)}}),c.I_SendHTTPRequest(e.szDeviceIdentify,"",f)}))},q.prototype.startPlayback=function(e,t){return new Promise((async function(r,i){var o,a=t.iWndIndex,c=t.szStartTime,u=t.szEndTime,l=d.delPort(e.szIP),p=e.iRtspPort;if(t.iPort&&(p=t.iPort),o=d.formatString(t.cgi,l,p,t.iChannelID),!d.isUndefined(t.oTransCodeParam)){var h=function(e){var t={TransFrameRate:"",TransResolution:"",TransBitrate:""};if(d.extend(t,e),""==t.TransFrameRate||""==t.TransResolution||""==t.TransBitrate)return"";var n=[];return n.push(""),n.push(""),n.push(""+t.TransFrameRate+""),n.push(""+t.TransResolution+""),n.push(""+t.TransBitrate+""),n.push(""),n.join("")}(t.oTransCodeParam);if(""==h)return-1;n.JS_SetTrsPlayBackParam(a,h)}n.JS_Play(o,{auth:e.szAuth,userInfo:e.szAuth},a,c,u,t.bFlag).then((()=>{var n;(n=new A).iIndex=a,n.szIP=e.szIP,n.iCGIPort=e.iCGIPort,n.szDeviceIdentify=e.szDeviceIdentify,n.iChannelID=t.iChannelID,n.iPlayStatus=2,s.push(n),r()}),(()=>{i()}))}))},q.prototype.reversePlayback=function(e,t){return new Promise((function(r,i){var o=t.iWndIndex,a=t.szStartTime,c=t.szEndTime,u=d.delPort(e.szIP),l=e.iRtspPort;t.iPort&&(l=t.iPort);var p=d.formatString(t.cgi,u,l,t.iChannelID);n.JS_ReversePlay(p,{auth:e.szAuth,userInfo:e.szAuth},o,a,c).then((()=>{var n=new A;n.iIndex=o,n.szIP=e.szIP,n.iCGIPort=e.iCGIPort,n.szDeviceIdentify=e.szDeviceIdentify,n.iChannelID=t.iChannelID,n.iPlayStatus=5,s.push(n),r()}),(()=>{i()}))}))},q.prototype.startDownloadRecord=function(e,t){var r=d.formatString(this.CGI.startDownloadRecord,e.szHttpProtocol,e.szIP,e.iCGIPort),i=""+d.escape(t.szPlaybackURI)+"";return n.JS_StartAsyncDownload(r,e.szAuth,t.szFileName,i,t.bDateDir)},q.prototype.exportDeviceConfig=function(e){var t=d.formatString(this.CGI.downloaddeviceConfig,e.szHttpProtocol,e.szIP,e.iCGIPort);return n.JS_DownloadFile(t,e.szAuth,"",0)},q.prototype.importDeviceConfig=function(e,t){var r=d.formatString(this.CGI.uploaddeviceConfig,e.szHttpProtocol,e.szIP,e.iCGIPort);return n.JS_StartAsynUpload(r,"",e.szAuth,t.szFileName,0)},q.prototype.restart=function(e,t){var n={type:"PUT",success:null,error:null};return d.extend(n,t),c.I_SendHTTPRequest(e.szDeviceIdentify,this.CGI.restart,n)},q.prototype.restore=function(e,t,n){var r={type:"PUT",url:d.formatString(this.CGI.restore,e.szHttpProtocol,e.szIP,e.iCGIPort,t),success:null,error:null};return c.I_SendHTTPRequest(e.szDeviceIdentify,"",r)},q.prototype.startUpgrade=function(e,t){var r=d.formatString(this.CGI.startUpgrade.upgrade,e.szHttpProtocol,e.szIP,e.iCGIPort);d.formatString(this.CGI.startUpgrade.status,e.szHttpProtocol,e.szIP,e.iCGIPort);return n.JS_StartUpgrade(r,"",e.szAuth,t)},q.prototype.set3DZoom=function(e,t,n,r){var i="";i=t.iChannelID<=e.iAnalogChannelNum?d.formatString(this.CGI.set3DZoom.analog,e.szHttpProtocol,e.szIP,e.iCGIPort,t.iChannelID):d.formatString(this.CGI.set3DZoom.digital,e.szHttpProtocol,e.szIP,e.iCGIPort,t.iChannelID),0!==n[0][0]||0!==n[0][1]||0===n[2][0]&&0===n[2][1]||(n[0][0]=n[2][0],n[0][1]=n[2][1]);var o=""+parseInt(255*n[0][0],10)+""+(255-parseInt(255*n[0][1],10))+""+parseInt(255*n[2][0],10)+""+(255-parseInt(255*n[2][1],10))+"",s=(new R,{type:"PUT",url:i,data:o,success:null,error:null});return d.extend(s,r),c.I_SendHTTPRequest(e.szDeviceIdentify,"",s)},q.prototype.getSDKCapa=function(e,t){return c.I_SendHTTPRequest(e.szDeviceIdentify,this.CGI.SDKCapabilities,t)},q.prototype.deviceCapturePic=function(e,t,n,r){t=100*t+1;var i,o=d.formatString(this.CGI.deviceCapture.channels,e.szHttpProtocol,e.szIP,e.iCGIPort,t),s=[];d.isInt(r.iResolutionWidth)&&s.push("videoResolutionWidth="+r.iResolutionWidth),d.isInt(r.iResolutionHeight)&&s.push("videoResolutionHeight="+r.iResolutionHeight),s.length>0&&(o+="?"+s.join("&"));return i=function(e,t){return $("body").append(''),$("#jsplugin_download_li").trigger("click"),$("#jsplugin_download_a").remove(),0}(o,n),i},q.prototype.digestLogin=function(e,t,n,r,i,o,s){var a="";a=2==t?"https://":"http://";var u={type:"GET",url:d.formatString(this.CGI.login,a,e,n),auth:s?d.Base64.encode(r+":"+i):d.Base64.encode(":"+r+":"+i),success:null,error:null},l=e+"_"+n;return d.extend(u,o),c.I_SendHTTPRequest(l,"",u)},q.prototype.getSystemCapa=function(e,t){return c.I_SendHTTPRequest(e.szDeviceIdentify,this.CGI.systemCapabilities,t)},L=this,(W=function(e){this.elems=[],this.length=0,this.length=this.elems.push(e)}).prototype.find=function(e,t){var n=this.elems[this.length-1]?this.elems[this.length-1].getElementsByTagName(e):[];return this.length=this.elems.push(n),t?n:this},W.prototype.eq=function(e,t){var n=this.elems[this.length-1].length,r=null;return n>0&&e0&&t[1].indexOf("trident")>-1&&(t[1]="msie");var n={};return n[t[1]]=!0,n.version=t[2],n},G.prototype.loadXML=function(e){if(null==e||""==e)return null;var t=null;window.DOMParser?t=(new DOMParser).parseFromString(e,"text/xml"):((t=new ActiveXObject("Microsoft.XMLDOM")).async=!1,t.loadXML(e));return t},G.prototype.toXMLStr=function(e){var t="";try{t=(new XMLSerializer).serializeToString(e)}catch(n){try{t=e.xml}catch(e){return""}}return-1==t.indexOf(""+t),t},G.prototype.escape=function(e){return e?e.replace(/&/g,"&").replace(//g,">"):e},G.prototype.dateFormat=function(e,t){var n={"M+":e.getMonth()+1,"d+":e.getDate(),"h+":e.getHours(),"m+":e.getMinutes(),"s+":e.getSeconds(),"q+":Math.floor((e.getMonth()+3)/3),S:e.getMilliseconds()};for(var r in/(y+)/.test(t)&&(t=t.replace(RegExp.$1,(e.getFullYear()+"").substr(4-RegExp.$1.length))),n)new RegExp("("+r+")").test(t)&&(t=t.replace(RegExp.$1,1==RegExp.$1.length?n[r]:("00"+n[r]).substr((""+n[r]).length)));return t},G.prototype.Base64={_keyStr:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",encode:function(e){var t,n,r,i,o,s,a,d="",c=0;for(e=G.prototype.Base64._utf8_encode(e);c>2,o=(3&t)<<4|(n=e.charCodeAt(c++))>>4,s=(15&n)<<2|(r=e.charCodeAt(c++))>>6,a=63&r,isNaN(n)?s=a=64:isNaN(r)&&(a=64),d=d+this._keyStr.charAt(i)+this._keyStr.charAt(o)+this._keyStr.charAt(s)+this._keyStr.charAt(a);return d},decode:function(e){var t,n,r,i,o,s,a="",d=0;for(e=e.replace(/[^A-Za-z0-9\+\/\=]/g,"");d>4,n=(15&i)<<4|(o=this._keyStr.indexOf(e.charAt(d++)))>>2,r=(3&o)<<6|(s=this._keyStr.indexOf(e.charAt(d++))),a+=String.fromCharCode(t),64!=o&&(a+=String.fromCharCode(n)),64!=s&&(a+=String.fromCharCode(r));return a=G.prototype.Base64._utf8_decode(a)},_utf8_encode:function(e){e=e.replace(/\r\n/g,"\n");for(var t="",n=0;n127&&r<2048?(t+=String.fromCharCode(r>>6|192),t+=String.fromCharCode(63&r|128)):(t+=String.fromCharCode(r>>12|224),t+=String.fromCharCode(r>>6&63|128),t+=String.fromCharCode(63&r|128))}return t},_utf8_decode:function(e){for(var t="",n=0,r=c1=c2=0;n191&&r<224?(c2=e.charCodeAt(n+1),t+=String.fromCharCode((31&r)<<6|63&c2),n+=2):(c2=e.charCodeAt(n+1),c3=e.charCodeAt(n+2),t+=String.fromCharCode((15&r)<<12|(63&c2)<<6|63&c3),n+=3);return t}},G.prototype.createEventScript=function(e,t,n){var r=document.createElement("script");r.htmlFor=e,r.event=t,r.innerHTML=n,document.body.parentNode.appendChild(r)},G.prototype.isInt=function(e){return/^\d+$/.test(e)},G.prototype.getDirName=function(){var t="";if(""!==e.szBasePath)t=e.szBasePath;else{var n=/[^?#]*\//,r=document.getElementById("videonode");if(r)t=r.src.match(n)[0];else{for(var i=document.scripts,o=0,s=i.length;o-1){r=i[o];break}r&&(t=r.src.match(n)[0])}}return t},G.prototype.loadScript=function(e,t){var n=document.createElement("script");n.type="text/javascript",n.onload=function(){t()},n.src=e,document.getElementsByTagName("head")[0].appendChild(n)},G.prototype.cookie=function(e,t,n){if(arguments.length>1&&(null===t||"object"!=typeof t)){if(n=this.extend({},n),null===t&&(n.expires=-1),"number"==typeof n.expires){var r=n.expires,i=n.expires=new Date;i.setDate(i.getDate()+r)}return document.cookie=[encodeURIComponent(e),"=",n.raw?String(t):encodeURIComponent(String(t)),n.expires?"; expires="+n.expires.toUTCString():"",n.path?"; path="+n.path:"; path=/",n.domain?"; domain="+n.domain:"",n.secure?"; secure":""].join("")}var o,s=(n=t||{}).raw?function(e){return e}:decodeURIComponent;return(o=new RegExp("(?:^|; )"+encodeURIComponent(e)+"=([^;]*)").exec(document.cookie))?s(o[1]):null},G.prototype.isUndefined=function(e){return void 0===e},G.prototype.isObject=function(e){return"[object Object]"===Object.prototype.toString.call(e)},G.prototype.delPort=function(e){var t=e.indexOf(":");return t>-1?e.substring(0,t):e},G.prototype.formatString=function(){for(var e=arguments[0],t=1;t/g,">"):""},G.prototype.formatPolygonXmlToJson=function(e){var t,n=this.loadXML(e),r=[],i=[],o=[],s=[],a=[];function d(e){var t=parseInt(e,10).toString(16);return(t="0"+t).substring(t.length-2)}return $(n).find("SnapPolygon").each((function(){var e=parseInt($(this).find("EditType, editType").text(),10)||0,n="true"===$(this).find("isClosed").text(),c=parseInt($(this).find("polygonType").text(),10),u=parseFloat($(this).find("showSquare").text())||0,l=$(this).find("tips").text()||$(this).find("Tips").text(),p=parseInt($(this).find("tipsPos").text(),10)||0,h="true"===$(this).find("showWH").text(),f="#"+d($(this).find("r").text())+d($(this).find("g").text())+d($(this).find("b").text()),I=parseInt($(this).find("PointNumMax").text(),10)-1,P=parseInt($(this).find("MinClosed").text(),10)-1,m=parseInt($(this).find("id").text(),10),g=parseInt($(this).find("RedrawMode").text(),10)||0;0===$(this).find("pointList").find("point").length?1===c?s.push({id:m,tips:l,drawColor:f,translucent:.1,maxShapeSupport:1,maxPointSupport:I,minPointSupport:P,showWH:h,redrawMode:g}):0===c&&a.push({id:m,tips:l,drawColor:f,translucent:.1,widthHeightRate:u,maxShapeSupport:1,type:1,redrawMode:g,tipsPos:p}):(i=[],$(this).find("pointList").find("point").each((function(){i.push([parseFloat($(this).find("x").text()),parseFloat($(this).find("y").text())])})),t={id:m,editType:e,points:i,closed:n,tips:l,drawColor:f,maxPointSupport:I,minPointSupport:P,translucent:.1,redrawMode:g},1===c?(t.showWH=h,r.push(t)):0===c&&(t.widthHeightRate=u,t.type=1,t.tipsPos=p,o.push(t)))})),{aRect:o,aPolygon:r,aAddRect:a,aAddPolygon:s}},G.prototype.formatPolygonJsonToXml=function(e){function t(e){var t=e.toLowerCase();if(t&&/^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/.test(t)){var n;if(4===t.length){var r="#";for(n=1;n<4;n+=1)r+=t.slice(n,n+1).concat(t.slice(n,n+1));t=r}var i=[];for(n=1;n<7;n+=2)i.push(parseInt("0x"+t.slice(n,n+2),16));return i}return[0,0,0]}var n=e[0],r=e[1],i="";return $.each(n,(function(e,n){var r=[0,0,0];r=n.drawColor?t(n.drawColor):t("#FF0000"),i+="",i+=""+n.id+"",n.tips?i+=""+n.tips+"":i+="",i+=""+n.closed.toString()+"",i+=""+r[0]+""+r[1]+""+r[2]+"",i+="1",i+=""+(n.pointNumMax?n.pointNumMax:10)+"",i+=""+(n.minClosed?n.minClosed:4)+"",i+="",$.each(n.points,(function(e,t){i+=""+t[0]+""+t[1]+""})),i+="",i+=""})),$.each(r,(function(e,n){var r=[0,0,0];r=n.drawColor?t(n.drawColor):t("#FF0000"),i+="",i+=""+n.id+"",i+=""+r[0]+""+r[1]+""+r[2]+"",i+="0",n.tips?i+=""+n.tips+"":i+="",void 0!==n.closed&&null!==n.closed?i+=""+n.closed.toString()+"":i+="true",i+="";var o=[];if(n.points.length){var s=2,a=-1,d=2,c=-1;$.each(n.points,(function(){s>this[0]&&(s=this[0]),d>this[1]&&(d=this[1]),a"+t[0]+""+t[1]+""})),i+="",i+=""})),i+=""},G.prototype.convertToUTCTime=function(e,t){void 0===t&&(t="yyyy-MM-dd hh:mm:ss"),e=e.replace("T"," ").replace("Z","");var n=new Date(Date.parse(e.replace(/-/g,"/")));return n=(n=this.utcDateFormat(n,t)).replace(" ","T")},G.prototype.utcDateFormat=function(e,t){var n={"M+":e.getUTCMonth()+1,"d+":e.getUTCDate(),"h+":e.getUTCHours(),"m+":e.getUTCMinutes(),"s+":e.getUTCSeconds(),"q+":Math.floor((e.getUTCMonth()+3)/3),S:e.getUTCMilliseconds()};for(var r in/(y+)/.test(t)&&(t=t.replace(RegExp.$1,(e.getUTCFullYear()+"").substr(4-RegExp.$1.length))),n)new RegExp("("+r+")").test(t)&&(t=t.replace(RegExp.$1,1==RegExp.$1.length?n[r]:("00"+n[r]).substr((""+n[r]).length)));return t},G.prototype.convertToLocalTime=function(e,t){void 0===t&&(t=0);var n=(e=e.replace("T"," ").replace("Z","")).split(" ")[0].split("-"),r=parseInt(n[0],10),i=parseInt(n[1],10)-1,o=parseInt(n[2],10),s=e.split(" ")[1].split(":"),a=parseInt(s[0],10),d=parseInt(s[1],10),c=parseInt(s[2],10),u=new Date(Date.UTC(r,i,o,a,d,c));return u.setTime(u.getTime()+t),this.dateFormat(u,"yyyy-MM-dd hh:mm:ss").replace(" ","T")+"Z"},B.prototype.valueOf=function(){return this.id},B.prototype.toString=function(){return this.id},B.prototype.createUUID=function(){var e=new Date(1582,10,15,0,0,0,0),t=(new Date).getTime()-e.getTime(),n="-";return B.getIntegerBits(t,0,31)+n+B.getIntegerBits(t,32,47)+n+(B.getIntegerBits(t,48,59)+"1")+n+B.getIntegerBits(B.rand(4095),0,7)+B.getIntegerBits(B.rand(4095),0,7)+n+(B.getIntegerBits(B.rand(8191),0,7)+B.getIntegerBits(B.rand(8191),8,15)+B.getIntegerBits(B.rand(8191),0,7)+B.getIntegerBits(B.rand(8191),8,15)+B.getIntegerBits(B.rand(8191),0,15))},B.getIntegerBits=function(e,t,n){var r=B.returnBase(e,16),i=new Array,o="",s=0;for(s=0;s=t)r=this.returnBase(i,t)+n[o];else r=n[i]+n[o]}return r},B.rand=function(e){return Math.floor(Math.random()*e)},a=new q,d=new G,this}(),t=window.WebVideoCtrl=e;t.version="3.3.0"}}(),"object"==typeof exports&&"undefined"!=typeof module||("function"==typeof define&&define.amd?define((function(){return WebVideoCtrl})):"function"==typeof define&&define.cmd&&define((function(e,t,n){n.exports=WebVideoCtrl})));