(function(A){function e(e){for(var o,i,r=e[0],n=e[1],g=e[2],c=0,I=[];co;o++)e.push(arguments[o]);(A!=t.id||t.id+"_nacl_module"!=t.module.id)&&console.error("Mixed player id"),t.m.debug&&console.log("Player: "+t.id+" cmd=["+e.join("] ")),t.module.postMessage(e)},t.module.offsetTop,t.m.versionapp="unknown",t.m.debug=t.options.debug||t.player.hasAttribute("debug")||!1,t.m.autostart=t.player.hasAttribute("autostart"),t.m.is_opened=!1,t.m.latency=1e4,t.m.controls=!0,t.m.avsync=t.options.avsync||!1,t.m.vxgReadyState=0,t.m.autohide=t.options.autohide||2e3,t.m.lastErrorCode=-1,t.m.lastErrorDecoder=0,t.m.autoreconnect=t.options.autoreconnect||0,t.m.connection_timeout=t.options.connection_timeout||0,t.m.connection_udp=t.options.connection_udp||0,t.m.isCustomDigitalZoom=t.options.custom_digital_zoom||!1,t.currentZoom=10,t.m.snapshotFile="",t.m.snapshotPTS="-1",t.m.PTSVideo="-1",t.m.PTSAudio="-1",vxgplayer.initVolumeControls(t,!1),t.m.debug&&console.log("Player "+t.id+" - init new player"),t.set_controls_opacity=function(A){i.style.opacity=A,a.style.opacity=A,s.style.opacity=A},t.set_controls_display=function(A){i.style.display=A,1==t.m.isCustomDigitalZoom?(a.style.display="none",s.style.display="none"):(a.style.display=A,s.style.display=10==t.currentZoom?"none":"")},0==t.m.isCustomDigitalZoom&&(s.style.display=10==t.currentZoom?"none":""),t.player.hasAttribute("custom-digital-zoom")&&(t.m.isCustomDigitalZoom=!0,a.style.display="none",s.style.display="none"),t.player.hasAttribute("controls")||(t.m.controls=!1,t.set_controls_display("none")),t.options.controls&&1==t.options.controls&&(t.m.controls=!0,t.set_controls_display("")),t.m.avsync=t.player.hasAttribute("avsync"),t.m.aspectRatio=t.player.hasAttribute("aspect-ratio")||t.player.hasAttribute("aspect-ratio-mode")?1:0,t.player.hasAttribute("autohide")?t.m.autohide=1e3*parseInt(t.player.getAttribute("autohide"),10):t.options.autohide&&(t.m.autohide=1e3*t.options.autohide),t.timeout=void 0,t.loadSettings=function(){t.m.debug&&console.log("Player "+t.id+" - loadSettings"),t.player.hasAttribute("useragent-prefix")?t.module.command("setuseragent",t.player.getAttribute("useragent-prefix")+" "+navigator.userAgent):t.options.useragent_prefix&&t.module.command("setuseragent",t.options.useragent_prefix+" "+navigator.userAgent),t.module=document.getElementById(t.id+"_nacl_module"),t.module.command=function(){for(var e=[],o=0;arguments.length>o;o++)e.push(arguments[o]);(A!=t.id||t.id+"_nacl_module"!=t.module.id)&&console.error("Mixed player id"),t.m.debug&&console.log("Player: "+t.id+" cmd=["+e.join("] ")),t.module.postMessage(e)},t.module.offsetTop,t.module.command("setversion",window.vxgplayer.version),(t.player.hasAttribute("auto-reconnect")||t.options.autoreconnect)&&(t.m.autoreconnect=1,t.module.command("setautoreconnect","1")),t.player.hasAttribute("connection-timeout")&&(t.m.connection_timeout=parseInt(t.player.getAttribute("connection-timeout"),10)),0!=t.options.connection_timeout&&t.module.command("setconnection_timeout",""+t.m.connection_timeout),(t.player.hasAttribute("connection-udp")||t.m.connection_udp)&&(t.m.connection_udp=1,t.module.command("setconnection_udp","1")),t.m.avsync=t.player.hasAttribute("avsync"),t.m.aspectRatio=t.player.hasAttribute("aspect-ratio")||t.player.hasAttribute("aspect-ratio-mode")?1:0,t.player.hasAttribute("aspect-ratio-mode")?t.m.aspectRatio=parseInt(t.player.getAttribute("aspect-ratio-mode"),10):t.options.aspect_ratio_mode&&(t.m.aspectRatio=t.options.aspect_ratio_mode),t.m.aspectRatioMode=0!=t.m.aspectRatio?t.m.aspectRatio:1,t.module.command("setaspectratio",""+t.m.aspectRatio),t.module.command("setavsync",t.m.avsync?"1":"0"),t.player.hasAttribute("latency")?(t.m.latency=parseInt(t.player.getAttribute("latency"),10),t.module.command("setlatency",""+t.m.latency)):t.options.latency&&(t.m.latency=t.options.latency,t.module.command("setlatency",""+t.m.latency)),window.vxgplayer.initVolumeControls(t,!0),t.player.hasAttribute("autohide")?t.m.autohide=1e3*parseInt(t.player.getAttribute("autohide"),10):t.options.autohide&&(t.m.autohide=1e3*t.options.autohide)},t.moduleDidLoad=function(){t.m.debug&&console.log("Player "+t.id+" - moduleDidLoad"),t.loadSettings(),"https:"==window.location.protocol?t.connectToApp():t.module.command("startwebsclient",vxgplayer.webserverport)},t.playerDidLoad=function(){t.m.debug&&console.log("Player "+t.id+" - playerDidLoad"),C.style.display="none",t.onReadyStateCallback?(t.m.is_opened=!1,t.onReadyStateCallback()):t.src(t.m.url)},t.connectToApp=function(){t.m.debug&&console.log("Player "+t.id+" connectToApp"),t.m.port=chrome.runtime.connect("hncknjnnbahamgpjoafdebabmoamcnni"),t.m.debug&&console.log("Player "+t.id+" connected port="+t.m.port),t.m.portName=""+(new Date).getTime(),t.m.port.onDisconnect.addListener((function(){t.m.debug&&console.log("disconnected portName="+t.m.portName),t.module.command("stopnativeclient","@"+t.m.portName),t.m.port=void 0})),t.m.debug&&console.log("connected portName="+t.m.portName),t.m.port.onMessage.addListener((function(A){void 0!=A&&void 0==A.id&&void 0!=A[0]&&"@"==A[0].charAt(0)?void 0==t.module.postMessage?t.m.port.disconnect():t.module.postMessage(A):void 0!=A&&"getversionapp"==A.cmd?0==A.data.indexOf("VERSION_APP")?(t.m.versionapp=A.data.split(" ")[1],t.m.debug&&console.log("Player "+t.id+" =VERSION_APP "+t.m.versionapp),t.module.command("setappversion",t.m.versionapp),t.module.command("startnativeclient","@"+t.m.portName),t.playerDidLoad()):console.log("Player "+t.id+" Invalid VERSION_APP msg.data="+A.data):console.log("Player "+t.id+"getversionapp unknown msg=",A)})),t.m.port.postMessage({id:""+t.m.portName,cmd:"getversionapp",data:""})},t.showerror=function(A){C.style.display="none",E.style.display="inline-block",Q.style.display="inline-block",Q.innerHTML=A},t.hideerror=function(){E.style.display="none",Q.style.display="none"},t.readyState=function(){return t.m.vxgReadyState},t.onReadyStateChange=function(A){t.onReadyStateCallback=A},t.ready=t.onReadyStateChange,t.onStateChange=function(A){t.onStateChangeCallback=A},t.onBandwidthError=function(A){t.m.handlerBandwidthError=A},t.onError=function(A){t.m.handlerError=A},t.handleMessage=function(e){if(t.m.debug&&console.log("Player "+t.id+" handleMessage: "+e.data),void 0!=e&&void 0!=e.data)if(void 0!=e.data[0]&&"@"==e.data[0].charAt(0))void 0!=t.m.port&&t.m.port.postMessage(e.data);else if(0==e.data.indexOf("PLAYER_INITED"))t.moduleDidLoad();else if(0==e.data.indexOf("PLAYER_INIT_ERR")){switch(str="PLAYER_INIT_ERR ",err=parseInt(e.data.split(" ")[1],10),err_type=65535&err>>16,console.log("err_type="+err_type),err_type){case 4:str+="Init audio output error ";break;case 2:str+="Init video decoder error ";break;default:str+="Init D3D error "}str+=""+err,vxgplayer.showInitFailed(A,str)}else if(0==e.data.indexOf("VERSION_APP"))t.m.versionapp=e.data.split(" ")[1],t.m.debug&&console.log("=VERSION_APP "+t.m.versionapp),t.playerDidLoad();else if(0==e.data.indexOf("PTS_VIDEO"))t.m.PTSVideo=e.data.split(" ")[1];else if(0==e.data.indexOf("PTS_AUDIO"))t.m.PTSAudio=e.data.split(" ")[1];else if(0==e.data.indexOf("TAKE_SNAPSHOT"))snap_status=e.data.split(" ")[1],snap_pts=e.data.split(" ")[2],console.log("TAKE_SNAPSHOT snap_status="+snap_status+" snap_pts="+snap_pts),0!=snap_status.indexOf("ERROR")&&(t.m.snapshotFile=snap_status,void 0!=snap_pts&&(t.m.snapshotPTS=snap_pts),window.requestFileSystem=window.requestFileSystem||window.webkitRequestFileSystem,window.requestFileSystem(window.TEMPORARY,1,(function(A){A.root.getFile(t.m.snapshotFile,{create:!1},(function(A){var e=document.createElement("a");e.setAttribute("href",A.toURL()),-1==t.m.snapshotPTS?e.setAttribute("download","snapshot.jpg"):e.setAttribute("download","snapshot_"+t.m.snapshotPTS+".jpg"),e.style.display="none",document.body.appendChild(e),e.click(),document.body.removeChild(e)}),(function(){console.error("[VXGPLAYER] TAKE_SNAPSHOT fs.root.getFile FAILED")}))}),(function(){console.error("[VXGPLAYER] TAKE_SNAPSHOT requestFileSystem window.TEMPORARY FAILED")})));else if("MEDIA_ERR_URL"==e.data)t.showerror("Problem with URL"),t.m.lastErrorCode=0,t.m.handlerError&&t.m.handlerError(t);else if(0==e.data.indexOf("MEDIA_ERR_NETWORK"))t.showerror("Problem with network"),t.m.lastErrorCode=1,t.m.handlerError&&t.m.handlerError(t);else if(0==e.data.indexOf("MEDIA_ERR_SOURCE"))t.showerror("Problem with source"),t.m.lastErrorCode=2,t.m.handlerError&&t.m.handlerError(t);else if(0==e.data.indexOf("MEDIA_ERR_CARRIER"))t.showerror("Problem with carrier"),t.m.lastErrorCode=3,t.m.handlerError&&t.m.handlerError(t);else if(0==e.data.indexOf("MEDIA_ERR_AUDIO"))t.showerror("Problem with audio"),t.m.lastErrorCode=4,t.m.handlerError&&t.m.handlerError(t);else if(0==e.data.indexOf("MEDIA_ERR_VIDEO"))t.showerror("Problem with video"),t.m.lastErrorCode=5,t.m.handlerError&&t.m.handlerError(t);else if(0==e.data.indexOf("MEDIA_ERR_AUTHENTICATION"))t.showerror("Problem with authentification"),t.m.lastErrorCode=6,t.m.handlerError&&t.m.handlerError(t);else if(0==e.data.indexOf("MEDIA_ERR_BANDWIDTH"))t.m.lastErrorCode=7,t.m.handlerError&&t.m.handlerError(t),t.m.handlerBandwidthError&&t.m.handlerBandwidthError(t);else if(0==e.data.indexOf("MEDIA_ERR_EOF"))t.showerror("End of File"),t.m.lastErrorCode=8,t.m.handlerError&&t.m.handlerError(t);else if(0==e.data.indexOf("MEDIA_ERR_DECODER")){var o=e.data.split(" ");t.m.lastErrorDecoder=o.length>1?parseInt(o[1],10):0,t.m.debug&&console.log("Decoder resumed"),t.m.lastErrorCode=0==t.m.lastErrorDecoder?-1:9,t.m.handlerError&&t.m.handlerError(t)}else 0==e.data.indexOf("PLAYER_CONNECTING")?(t.m.vxgReadyState=1,C.style.display="inline-block",I.style.display="none",t.onStateChangeCallback&&t.onStateChangeCallback(t.m.vxgReadyState)):0==e.data.indexOf("PLAYER_PLAYING")?(t.m.vxgReadyState=2,r.style.display="none",g.style.display="inline-block",n.style.display="inline-block",I.style.display="inline-block",t.hideerror(),C.style.display="none",t.onStateChangeCallback&&t.onStateChangeCallback(t.m.vxgReadyState)):0==e.data.indexOf("PLAYER_STOPPING")?(t.m.vxgReadyState=3,r.style.display="none",g.style.display="none",n.style.display="none",I.style.display="none"):0==e.data.indexOf("PLAYER_STOPPED")?(t.m.vxgReadyState=0,r.style.display="inline-block",g.style.display="none",n.style.display="none",I.style.display="none",t.onStateChangeCallback&&t.onStateChangeCallback(t.m.vxgReadyState)):0==e.data.indexOf("PLAYER_PAUSED")&&(t.m.vxgReadyState=4,r.style.display="inline-block",g.style.display="inline-block",n.style.display="none",t.onStateChangeCallback&&t.onStateChangeCallback(t.m.vxgReadyState))},t.handleError=function(){C.style.display="none",E.style.display="block",console.error("ERROR"),t.showerror("Unknown error")},t.handleCrash=function(){C.style.display="none",E.style.display="block",t.showerror("Crashed")},t.restartTimeout=function(){return 0>=t.m.autohide?void t.set_controls_opacity("0"):(t.set_controls_opacity("0.7"),clearTimeout(t.timeout),void(t.timeout=setTimeout((function(){t.set_controls_opacity("0")}),t.m.autohide)))},t.player.addEventListener("mousemove",(function(){t.restartTimeout()}),!0),t.restartTimeout(),t.module.addEventListener("message",t.handleMessage,!0),t.module.addEventListener("error",t.handleError,!0),t.module.addEventListener("crash",t.handleCrash,!0),void 0!==window.attachListeners&&window.attachListeners(),t.error=function(){return t.m.lastErrorCode},t.errorDecoder=function(){return t.m.lastErrorDecoder},t.controls=function(A){return void 0==A?t.m.controls:void(1==A?(t.set_controls_display(""),t.m.controls=!0):0==A&&(t.set_controls_display("none"),t.m.controls=!1))},t.debug=function(A){return void 0==A?t.m.debug:void(t.m.debug=A)},t.play=function(){return t.hideerror(),t.m.debug&&console.log("self.play self.m.url="+t.m.url+" self.m.is_opened="+t.m.is_opened),1>t.m.url.length?void console.log("invalid url"):(t.m.is_opened||(t.m.is_opened=!0,t.module.command("open",t.m.url)),r.style.display="none",4!=t.m.vxgReadyState&&(C.style.display="inline-block"),t.module.command("play","0"),void t.applyVolume())},t.stop=function(){t.module.command("stop","0"),C.style.display="none"},t.pause=function(){t.module.command("pause","0"),C.style.display="none"},t.autohide=function(A){return A?void(t.m.autohide=1e3*A):t.m.autohide/1e3},t.autoreconnect=function(A){return void 0==A?t.m.autoreconnect:(t.m.autoreconnect=parseInt(A,10),void t.module.command("setautoreconnect",""+t.m.autoreconnect))},t.latency=function(A){return A?(t.m.latency=parseInt(A,10),void t.module.command("setlatency",""+A)):t.m.latency},t.connection_timeout=function(A){return A?(t.m.connection_timeout=parseInt(A,10),void t.module.command("setconnection_timeout",""+A)):t.m.connection_timeout},t.connection_udp=function(A){return A?(t.m.connection_udp=parseInt(A,10),void t.module.command("setconnection_udp",""+A)):t.m.connection_udp},t.aspectRatio=function(A){return void 0==A?!!t.m.aspectRatio:(t.m.aspectRatio=A?t.m.aspectRatioMode:0,void t.module.command("setaspectratio",""+t.m.aspectRatio))},t.aspectRatioMode=function(A){return void 0==A?t.m.aspectRatioMode:(t.m.aspectRatioMode=A>0?A:t.m.aspectRatioMode,t.m.aspectRatio=A,void t.module.command("setaspectratio",""+t.m.aspectRatio))},t.avsync=function(A){return void 0==A?t.m.avsync:(t.m.avsync=A,void t.module.command("setavsync",t.m.avsync?"1":"0"))},t.isPlaying=function(){return 2==t.m.vxgReadyState},t.versionPLG=function(){return window.vxgplayer.version},t.versionAPP=function(){return t.m.versionapp},t.size=function(A,e){if(!A||!e)return{width:t.playerWidth,height:t.playerHeight};if(Number.isInteger(A)&&Number.isInteger(e)){var o=parseInt(A,10),i=parseInt(e,10);t.playerWidth=t.playerWidth!=o?o:t.playerWidth,t.playerHeight=t.playerHeight!=i?i:t.playerHeight,t.player.style.width=A+"px",t.player.style.height=e+"px"}else t.player.style.width=A,t.player.style.height=e},t.changedFullscreen=function(){console.log("changedFullscreen"),document.webkitIsFullScreen?(t.size("100%","100%"),console.log("changedFullscreen -> fullscreen")):(t.size(t.playerWidth+"px",t.playerHeight+"px"),console.log("changedFullscreen -> NOT fullscreen"))},document.addEventListener&&(document.addEventListener("webkitfullscreenchange",t.changedFullscreen,!1),document.addEventListener("mozfullscreenchange",t.changedFullscreen,!1),document.addEventListener("fullscreenchange",t.changedFullscreen,!1),document.addEventListener("MSFullscreenChange",t.changedFullscreen,!1)),t.fullscreen=function(){console.log("fullscreen: clicked"),1==document.webkitIsFullScreen?document.webkitCancelFullScreen():t.player.requestFullscreen?t.player.requestFullscreen():t.player.webkitRequestFullscreen?t.player.webkitRequestFullscreen():t.player.mozRequestFullscreen&&t.player.mozRequestFullScreen()},t.takescreenshot=function(){t.module.command("take_snapshot","1"),d.style.display="block",setTimeout((function(){d.style.display=""}),5e3)},t.getScreenshotPTS=function(){return t.m.snapshotPTS},t.getPTSVideo=function(){return t.m.PTSVideo},t.getPTSAudio=function(){return t.m.PTSAudio},t.src=function(A){return void 0==A?t.m.url:(t.m.url=A,console.log("Player "+t.id+" src="+t.m.url+" autostart="+t.m.autostart+" is_opened="+t.m.is_opened),void(t.m.url.length>0&&t.m.autostart?(t.m.is_opened=!0,t.module.command("open",A)):(t.m.is_opened=!1,t.stop())))},t.dispose=function(){t.player.innerHTML="",delete window.vxgplayer.players[t.id]},t.custom_digital_zoom=function(A){return void 0==A?t.m.isCustomDigitalZoom:void(0==t.m.isCustomDigitalZoom&&1==A?(t.m.isCustomDigitalZoom=!0,t.setCustomDigitalZoom(100,0,0),t.set_controls_display("")):1==t.m.isCustomDigitalZoom&&0==A&&(t.m.isCustomDigitalZoom=!1,t.set_controls_display(""),t.setNewZoom(10)))},t.setCustomDigitalZoom=function(A,e,o){if(A!==parseInt(A,10)||e!==parseInt(e,10)||o!==parseInt(o,10))throw"[VXGPLAYER] setDigitalZoom / Some values is not integer";if(100>A||A>500)throw"[VXGPLAYER] setDigitalZoom / Parameter Ratio must be 100..500";if(1!=t.m.isCustomDigitalZoom)throw"[VXGPLAYER] setDigitalZoom / Please enable custom digital zoom";t.module.style.transform="scale("+A/100+")",s.style.display="none";var i=t.size(),a=e-i.width/2,r=o-i.height/2,n=i.width*(100/A),g=i.height*(100/A),c=Math.floor(-100*(a+n/2)/n),I=Math.floor(-100*(r+g/2)/g);t.module.style.left=c+"%",t.module.style.top=I+"%"},t.setNewZoom=function(A){A>=30&&(A=30),10>=A&&(A=10),t.currentZoom!=A&&(t.currentZoom=A,t.module.style.transform="scale("+t.currentZoom/10+")",u.style.transform="scale("+10/t.currentZoom+")",B.className=B.className.replace(/zoom\d+x/g,"zoom"+Math.ceil(t.currentZoom)+"x"),s.style.display=10==t.currentZoom?"none":"",t.module.style.left="",t.module.style.top="",u.style.left="",u.style.top="")},t.zoomUp=function(){t.setNewZoom(t.currentZoom+5)},t.zoomDown=function(){t.setNewZoom(t.currentZoom-5)},t.zoomProgressDownBool=!1,t.zoomProgressDown=function(){t.zoomProgressDownBool=!0},t.zoomProgressMove=function(A){if(1==t.zoomProgressDownBool){var e=A.pageY-vxgplayer.getAbsolutePosition(A.currentTarget).y,o=B.offsetHeight,i=o/5;e=10*(Math.floor((o-e)/i)/2+1),t.setNewZoom(e)}},t.zoomProgressLeave=function(){t.zoomProgressDownBool=!1},t.zoomProgressUp=function(A){if(1==t.zoomProgressDownBool){var e=A.pageY-vxgplayer.getAbsolutePosition(A.currentTarget).y,o=B.offsetHeight,i=o/5;e=10*(Math.floor((o-e)/i)/2+1),t.setNewZoom(e)}t.zoomProgressDownBool=!1},t.zoomCursorDownBool=!1,t.zoomCursorX=0,t.zoomCursorY=0,t.zoomCursorWidth=160,t.zoomCursorHeight=120,t.zoomControlsWidth=0,t.zoomControlsHeight=0,t.zoomCursorDown=function(A){t.zoomCursorX=A.pageX,t.zoomCursorY=A.pageY,t.zoomCursorWidth=u.offsetWidth,t.zoomCursorHeight=u.offsetHeight,t.zoomControlsWidth=s.offsetWidth,t.zoomControlsHeight=s.offsetHeight,t.zoomCursorDownBool=!0},t.zoomCursorUp=function(){console.log("zoomCursorUp"),t.zoomCursorDownBool=!1},t.zoomCursorMove=function(A){if(1==t.zoomCursorDownBool){var e=t.zoomCursorX-A.pageX,o=t.zoomCursorY-A.pageY;t.zoomCursorX=A.pageX,t.zoomCursorY=A.pageY;var i=u.offsetLeft-e,a=u.offsetTop-o,s=t.zoomControlsWidth-t.zoomCursorWidth*(10/t.currentZoom),r=t.zoomControlsHeight-t.zoomCursorHeight*(10/t.currentZoom),n=-1*s/2,g=s/2,c=-1*r/2,I=r/2;n>i&&(i=n),c>a&&(a=c),i>=g&&(i=g),a>=I&&(a=I),u.style.left=i+"px",u.style.top=a+"px";var d=t.currentZoom/10-1,l=Math.floor(-100*i/s*d),h=Math.floor(-100*a/r*d);t.module.style.left=l+"%",t.module.style.top=h+"%"}},t.setNewZoom=function(A){A>=30&&(A=30),10>=A&&(A=10),t.currentZoom!=A&&(t.currentZoom=A,t.module.style.transform="scale("+t.currentZoom/10+")",u.style.transform="scale("+10/t.currentZoom+")",B.className=B.className.replace(/zoom\d+x/g,"zoom"+Math.ceil(t.currentZoom)+"x"),s.style.display=10==t.currentZoom?"none":"",t.module.style.left="",t.module.style.top="",u.style.left="",u.style.top="")},t.zoomUp=function(){t.setNewZoom(t.currentZoom+5)},t.zoomDown=function(){t.setNewZoom(t.currentZoom-5)},t.zoomProgressDownBool=!1,t.zoomProgressDown=function(){t.zoomProgressDownBool=!0},t.zoomProgressMove=function(A){if(1==t.zoomProgressDownBool){var e=A.pageY-vxgplayer.getAbsolutePosition(A.currentTarget).y,o=B.offsetHeight,i=o/5;e=10*(Math.floor((o-e)/i)/2+1),t.setNewZoom(e)}},t.zoomProgressLeave=function(){t.zoomProgressDownBool=!1},t.zoomProgressUp=function(A){if(1==t.zoomProgressDownBool){var e=A.pageY-vxgplayer.getAbsolutePosition(A.currentTarget).y,o=B.offsetHeight,i=o/5;e=10*(Math.floor((o-e)/i)/2+1),t.setNewZoom(e)}t.zoomProgressDownBool=!1},t.zoomCursorDownBool=!1,t.zoomCursorX=0,t.zoomCursorY=0,t.zoomCursorWidth=160,t.zoomCursorHeight=120,t.zoomControlsWidth=0,t.zoomControlsHeight=0,t.zoomCursorDown=function(A){t.zoomCursorX=A.pageX,t.zoomCursorY=A.pageY,t.zoomCursorWidth=u.offsetWidth,t.zoomCursorHeight=u.offsetHeight,t.zoomControlsWidth=s.offsetWidth,t.zoomControlsHeight=s.offsetHeight,t.zoomCursorDownBool=!0},t.zoomCursorUp=function(){console.log("zoomCursorUp"),t.zoomCursorDownBool=!1},t.zoomCursorMove=function(A){if(1==t.zoomCursorDownBool){var e=t.zoomCursorX-A.pageX,o=t.zoomCursorY-A.pageY;t.zoomCursorX=A.pageX,t.zoomCursorY=A.pageY;var i=u.offsetLeft-e,a=u.offsetTop-o,s=t.zoomControlsWidth-t.zoomCursorWidth*(10/t.currentZoom),r=t.zoomControlsHeight-t.zoomCursorHeight*(10/t.currentZoom),n=-1*s/2,g=s/2,c=-1*r/2,I=r/2;n>i&&(i=n),c>a&&(a=c),i>=g&&(i=g),a>=I&&(a=I),u.style.left=i+"px",u.style.top=a+"px";var d=t.currentZoom/10-1,l=Math.floor(-100*i/s*d),h=Math.floor(-100*a/r*d);t.module.style.left=l+"%",t.module.style.top=h+"%"}},r.onclick=t.play,n.onclick=t.pause,g.onclick=t.stop,c.onclick=t.fullscreen,I.onclick=t.takescreenshot,l.onclick=t.zoomUp,h.onclick=t.zoomDown,u.addEventListener("mousedown",t.zoomCursorDown,!1),u.addEventListener("mousemove",t.zoomCursorMove,!1),u.addEventListener("mouseleave",t.zoomCursorUp,!1),u.addEventListener("mouseup",t.zoomCursorUp,!1),B.addEventListener("mousedown",t.zoomProgressDown,!1),B.addEventListener("mousemove",t.zoomProgressMove,!1),B.addEventListener("mouseleave",t.zoomProgressLeave,!1),B.addEventListener("mouseup",t.zoomProgressUp,!1)}(A,e)}return window.vxgplayer.players[A]}console.error(" Player with "+A+" did not found")},window.vxgplayer.webserverport="8778",window.vxgplayer.isFrame=function(){try{return window.self!==window.top}catch(A){return!0}},window.vxgplayer.browserSupportsPluginPnacl=function(){return void 0!==navigator.mimeTypes["application/x-pnacl"]&&void 0!==navigator.mimeTypes["application/vxg_media_player"]},window.vxgplayer.showGlobalErrorMessage=function(A,e){var t=document.getElementById(A),o=640,i=480;return o=parseInt(t.width,10)||o,i=parseInt(t.height,10)||i,t.style.width=o+"px",t.style.height=i+"px",void(t.innerHTML=e)},window.vxgplayer.showNotInstalled=function(A){vxgplayer.showGlobalErrorMessage(A,'
\t
')},window.vxgplayer.showAvailableInChrome=function(A){vxgplayer.showGlobalErrorMessage(A,'
\t
')},window.vxgplayer.showWebSocketFailed=function(A){vxgplayer.showGlobalErrorMessage(A,'
\t
Could not connect to plugin (WebSocket Error). Please try restart your browser.\t
')},window.vxgplayer.showNotInstalledInIncognitoMode=function(A){vxgplayer.showGlobalErrorMessage(A,'
\t
You have opened this page in incognito mode. Please open it in a regular tab, install the plugin and then come back.\t

Also you can install VXG Media Player from webstore in regular tab.\t
')},window.vxgplayer.showNotStartedInIncognitoMode=function(A){vxgplayer.showGlobalErrorMessage(A,'
\t
You have opened this page in incognito mode. Please open it in a regular tab and then come back.\t
')},window.vxgplayer.startPlayerInNewTab=function(){console.log("start player");var A="menubar=yes,location=yes,resizable=yes,scrollbars=yes,status=yes",e=window.open("https://www.videoexpertsgroup.com/player_start/","_blank",A);setTimeout((function(){e.close(),location.reload()}),1e3)},window.vxgplayer.showNotStartedInIFrame=function(A){vxgplayer.showGlobalErrorMessage(A,'
\t
You have opened this page in frame.
Please click on this link for start Chrome App (VXG Media Player).\t
')},window.vxgplayer.showInitFailed=function(A,e){vxgplayer.showGlobalErrorMessage(A,'
\t
Chrome plugin init error. Try to update Video/Audio drivers. '+e+"\t
")},window.vxgplayer.Promise=function(){this.done=function(A){return this.done_callback=A,this.completed&&this.done_callback(this.err),this},this.fail=function(A){return this.fail_callback=A,this.completed&&this.fail_callback(this.err),this},this.resolve=function(A){this.completed||(this.result=A,this.done_callback(A)),this.completed=!0},this.reject=function(A){this.completed||(this.err=A,this.fail_callback(A)),this.completed=!0}},window.vxgplayer.checkWebSocket=function(){var A=new vxgplayer.Promise;return setTimeout((function(){var e=new WebSocket("ws://127.0.0.1:"+vxgplayer.webserverport+"/");e.onerror=function(){A.reject()},e.onmessage=function(A){console.log(A)},e.onopen=function(){e.close(),A.resolve()}}),6e4),A},window.vxgplayer.getAbsolutePosition=function(A){var e={x:A.offsetLeft,y:A.offsetTop};if(A.offsetParent){var t=vxgplayer.getAbsolutePosition(A.offsetParent);e.x+=t.x,e.y+=t.y}return e},window.vxgplayer.initOptions=function(A,e){A.options=e||{},A.m={},A.m.url=A.player.getAttribute("url")||A.options.url||"";var t="media_player.nmf",o="pnacl/Release/media_player.nmf";A.m.nmf_path=A.player.getAttribute("nmf-path")||A.options.nmf_path||t,A.m.nmf_src=A.player.getAttribute("nmf-src")||A.options.nmf_src||o,A.m.autostart_parameter=A.player.hasAttribute("autostart")?"1":"0",A.m.audio_parameter=A.player.hasAttribute("audio")&&0==parseInt(A.player.getAttribute("audio",10))?"0":"1",A.m.mute_parameter=A.player.hasAttribute("mute")&&1==parseInt(A.player.getAttribute("mute",10))?"1":"0"},window.vxgplayer.generateEmbededElement=function(A){return''},window.vxgplayer.initVolumeControls=function(A,e){A.m.volume=A.options.volume||.7;var t=A.player.getElementsByClassName("vxgplayer-volume-mute")[0],o=A.player.getElementsByClassName("vxgplayer-volume-down")[0],i=A.player.getElementsByClassName("vxgplayer-volume-progress")[0],a=A.player.getElementsByClassName("vxgplayer-volume-up")[0];A.player.hasAttribute("volume")?(A.m.volume=parseFloat(A.player.getAttribute("volume")),A.m.volume=Math.ceil(10*A.m.volume)/10,e&&A.module.command("setvolume",A.m.volume.toFixed(1))):A.options.volume&&console.warn("TODO volume"),A.m.mute=A.options.mute||0==A.m.volume||"1"==A.m.mute_parameter,A.m.mute&&(o.style.display="none",i.style.display="none",a.style.display="none"),i.className=i.className.replace(/vol\d+/g,"vol"+Math.ceil(10*A.m.volume)),A.isMute=function(){return A.m.mute},A.applyVolume=function(){A.isMute()?(o.style.display="none",i.style.display="none",a.style.display="none",i.className=i.className.replace(/vol\d+/g,"vol0")):(o.style.display="inline-block",i.style.display="inline-block",a.style.display="inline-block",i.className=i.className.replace(/vol\d+/g,"vol"+Math.floor(10*A.m.volume))),A.module.command("setvolume",A.m.mute?"0":""+A.m.volume.toFixed(1))},A.mute=function(){A.restartTimeout(),A.m.mute=!A.m.mute,A.applyVolume()},A.volume=function(e){return void 0==e?A.m.volume:(e=e>1?1:e,e=0>e?0:e,A.m.volume=Math.ceil(10*e)/10,void A.applyVolume())},A.volup=function(){A.restartTimeout(),10>Math.round(10*A.m.volume)&&(A.m.volume=A.m.volume+.1,A.applyVolume())},A.voldown=function(){A.restartTimeout(),Math.round(10*A.m.volume)>0&&(A.m.volume=A.m.volume-.1,A.applyVolume())},t.onclick=A.mute,o.onclick=A.voldown,a.onclick=A.volup},document.addEventListener("DOMContentLoaded",(function(){console.log("vxgplayer isFrame: "+window.vxgplayer.isFrame()),console.log("vxgplayer browserSupportsPluginPnacl: "+window.vxgplayer.browserSupportsPluginPnacl());for(var A=document.getElementsByClassName("vxgplayer"),e=0;A.length>e;e++)A[e].id?vxgplayer(A[e].id):console.error("Player has not id",A[e])}))},"2a8b":function(A,e,t){"use strict";t.r(e),e["default"]={getplcStatus:{method:"GET",url:"/plc/plcStatus",name:"获取PLC状态"},getRealTimeList:{method:"POST",url:"/realTime",name:"获取实时监控列表"},getHistoryList:{method:"POST",url:"/order/list",name:"获取历史监控列表"},realTimeLychee:{method:"GET",url:"/realTime/lychee",name:"获取荔枝的ip"},getStreetList:{method:"POST",url:"/street/page",name:"获取巷道列表"},addStreet:{method:"POST",url:"/street",name:"新增巷道"},editStreet:{method:"PUT",url:"/street",name:"编辑巷道"},getCameraList:{method:"POST",url:"/camera/page",name:"获取球机列表"},addCamera:{method:"POST",url:"/camera",name:"新增球机"},editCamera:{method:"PUT",url:"/camera",name:"编辑球机"},getChannel:{method:"POST",url:"/lychee/stream/push",name:"获取channel字符集"},getCameraIoList:{method:"POST",url:"/camera/config/page",name:"球机IO配置分页列表"},addCameraIo:{method:"POST",url:"/camera/config",name:"球机IO指令配置新增"},editCameraIo:{method:"PUT",url:"/camera/config",name:"球机IO指令配置编辑"},writeInCameraIoptz:{method:"POST",url:"/camera/io/ptz",name:"球机IO指令写入/覆盖(调同一个接口)"},cameraIoToPtz:{method:"POST",url:"/camera/io/toPtz",name:"转至球机IO配置点"},warnList:{url:"/warn/list",name:"plc未连接数量",method:"POST"},disPlcList:{url:"/plc/disPlc",name:"plc未连接列表",method:"GET"},categoryList:{url:"/category/page",name:"分类列表",method:"POST"},getCategoryList:{url:"/category/list",name:"分类列表",method:"GET"},addCategory:{url:"/category",name:"新增分类",method:"POST"},editCategory:{url:"/category",name:"编辑分类",method:"PUT"},getStockList:{url:"/stock/list",name:"获取盘点列表",method:"GET"},getStreetDetail:{url:"/street",name:"获取巷道详情",method:"GET"},getStockInfo:{url:"/stock/info",name:"复核页面的核对信息",method:"POST"},exportStock:{url:"/stock/export",name:"导出所有巷道",method:"GET"},stockCheckCorrect:{url:"/stock/checkCorrect",name:"人工复核正确",method:"POST"},stockCheckByMan:{url:"/stock/checkByMan",name:"人工复核",method:"POST"},getStockpage:{url:"/stock/page",name:"库存列表",method:"POST"},categoryExportModel:{url:"/category/export/model",name:"品规模板下载",method:"GET"},stockExportModel:{url:"/stock/export/model",name:"库存模板下载",method:"GET"}}},"2f7f":function(A,e,t){"use strict";t.r(e);var o=function(){var A=this,e=A.$createElement,t=A._self._c||e;return t("a-layout-sider",{class:["aside",A.collapsed?"merge":""],attrs:{theme:"dark",trigger:null,collapsible:""},model:{value:A.collapsed,callback:function(e){A.collapsed=e},expression:"collapsed"}},[t("div",{staticClass:"logo"},[t("span",{staticClass:"logo-title"},[A._v("垛机视觉系统")])]),t("a-menu",{attrs:{selectedKeys:A.selectedKeys,openKeys:A.openKeys,mode:"inline",theme:"dark","inline-collapsed":A.aside_collapsed},on:{"update:openKeys":function(e){A.openKeys=e},"update:open-keys":function(e){A.openKeys=e},click:A.clickMenu}},[A._l(A.routes,(function(e){return[e.meta.unfold?t("aside-item",{key:e.name,attrs:{menuInfo:e}}):t("a-menu-item",{key:e.name},[t("a-icon",{attrs:{type:e.meta.icon}}),t("span",[A._v(A._s(e.meta.name))])],1)]}))],2)],1)},i=[],a=(t("4de4"),t("c975"),t("45fc"),t("b0c0"),t("2ca0"),t("5530")),s=t("2f62"),r={name:"AsideMenu",computed:Object(a["a"])(Object(a["a"])({},Object(s["d"])(["aside_collapsed","userInfo"])),Object(s["b"])(["getAside_collapsed"])),watch:{$route:function(){console.log("123"),this.setRoute()},getAside_collapsed:function(A){console.log(A),this.collapsed=A}},data:function(){return{collapsed:this.$store.state.aside_collapsed,selectedKeys:[],openKeys:[],routes:[]}},methods:{clickMenu:function(A){this.$router.push({name:A.key},(function(A){}),(function(A){}))},setRoute:function(){var A=this,e=[];if(this.userInfo.id){e=this.$router.options.routes[0].children.filter((function(e){if(A.userInfo.permissionList.some((function(A){return A.rights===e.name&&e.name.indexOf("center")<0&&A.rights===e.name&&e.name.indexOf("ioTable")<0&&A.rights===e.name&&e.name.indexOf("realTimeMonitoringModel")<0&&A.rights===e.name&&e.name.indexOf("plcStatus")<0&&A.rights===e.name&&e.name.indexOf("cameraManageModel")<0&&A.rights===e.name&&e.name.indexOf("checkOperation")<0})))return e}));var t=function e(t){for(var o=function(o){var i=A.userInfo.permissionList.some((function(A){return t[o].name===A.rights}));t[o].meta.auth=i,t[o].children&&t[o].children.length>0&&e(t[o].children)},i=0;i3?this.selectedKeys=[this.$route.matched[2].name]:this.selectedKeys=[this.$route.matched[this.$route.matched.length-1].name]:this.selectedKeys=[this.$route.matched[1].name],console.log("selectedKeys",this.selectedKeys),this.$route.matched[1].meta.unfold?this.openKeys.push(this.$route.matched[1].name):this.openKeys=[""],this.$forceUpdate()}},mounted:function(){var A=this;this.$nextTick((function(){A.setRoute()}))}},n=r,g=(t("017d"),t("2877")),c=Object(g["a"])(n,o,i,!1,null,null,null);e["default"]=c.exports},"34ab":function(A,e,t){"use strict";t.r(e);var o=function(){var A=this,e=A.$createElement,t=A._self._c||e;return t("div",{staticClass:"wrap"},[A.$route.meta.name?t("div",{staticClass:"wrap-title"},[t("span",{staticClass:"wrap-title-text"},[A._t("title",[A._v(A._s(A.title))])],2)]):A._e(),t("router-view",{staticClass:"table"}),t("div",{staticClass:"wrap-footer bg-white"},[A._t("footer")],2)],1)},i=[],a=(t("b0c0"),{name:"PageContent",data:function(){return{title:"",footerStyle:!1}},watch:{$route:function(A){this.title=A.meta.title||A.meta.name}},computed:{},mounted:function(){this.title=this.$route.meta.title||this.$route.meta.name}}),s=a,r=(t("5187"),t("2877")),n=Object(r["a"])(s,o,i,!1,null,null,null);e["default"]=n.exports},"3caf":function(A,e,t){"use strict";var o=t("55f7"),i=t.n(o);i.a},"40d1":function(A,e,t){"use strict";var o=t("9642"),i=t.n(o);i.a},4678:function(A,e,t){var o={"./af":"2bfb","./af.js":"2bfb","./ar":"8e73","./ar-dz":"a356","./ar-dz.js":"a356","./ar-kw":"423e","./ar-kw.js":"423e","./ar-ly":"1cfd","./ar-ly.js":"1cfd","./ar-ma":"0a84","./ar-ma.js":"0a84","./ar-sa":"8230","./ar-sa.js":"8230","./ar-tn":"6d83","./ar-tn.js":"6d83","./ar.js":"8e73","./az":"485c","./az.js":"485c","./be":"1fc1","./be.js":"1fc1","./bg":"84aa","./bg.js":"84aa","./bm":"a7fa","./bm.js":"a7fa","./bn":"9043","./bn.js":"9043","./bo":"d26a","./bo.js":"d26a","./br":"6887","./br.js":"6887","./bs":"2554","./bs.js":"2554","./ca":"d716","./ca.js":"d716","./cs":"3c0d","./cs.js":"3c0d","./cv":"03ec","./cv.js":"03ec","./cy":"9797","./cy.js":"9797","./da":"0f14","./da.js":"0f14","./de":"b469","./de-at":"b3eb","./de-at.js":"b3eb","./de-ch":"bb71","./de-ch.js":"bb71","./de.js":"b469","./dv":"598a","./dv.js":"598a","./el":"8d47","./el.js":"8d47","./en-au":"0e6b","./en-au.js":"0e6b","./en-ca":"3886","./en-ca.js":"3886","./en-gb":"39a6","./en-gb.js":"39a6","./en-ie":"e1d3","./en-ie.js":"e1d3","./en-il":"7333","./en-il.js":"7333","./en-in":"ec2e","./en-in.js":"ec2e","./en-nz":"6f50","./en-nz.js":"6f50","./en-sg":"b7e9","./en-sg.js":"b7e9","./eo":"65db","./eo.js":"65db","./es":"898b","./es-do":"0a3c","./es-do.js":"0a3c","./es-us":"55c9","./es-us.js":"55c9","./es.js":"898b","./et":"ec18","./et.js":"ec18","./eu":"0ff2","./eu.js":"0ff2","./fa":"8df4","./fa.js":"8df4","./fi":"81e9","./fi.js":"81e9","./fil":"d69a","./fil.js":"d69a","./fo":"0721","./fo.js":"0721","./fr":"9f26","./fr-ca":"d9f8","./fr-ca.js":"d9f8","./fr-ch":"0e49","./fr-ch.js":"0e49","./fr.js":"9f26","./fy":"7118","./fy.js":"7118","./ga":"5120","./ga.js":"5120","./gd":"f6b4","./gd.js":"f6b4","./gl":"8840","./gl.js":"8840","./gom-deva":"aaf2","./gom-deva.js":"aaf2","./gom-latn":"0caa","./gom-latn.js":"0caa","./gu":"e0c5","./gu.js":"e0c5","./he":"c7aa","./he.js":"c7aa","./hi":"dc4d","./hi.js":"dc4d","./hr":"4ba9","./hr.js":"4ba9","./hu":"5b14","./hu.js":"5b14","./hy-am":"d6b6","./hy-am.js":"d6b6","./id":"5038","./id.js":"5038","./is":"0558","./is.js":"0558","./it":"6e98","./it-ch":"6f12","./it-ch.js":"6f12","./it.js":"6e98","./ja":"079e","./ja.js":"079e","./jv":"b540","./jv.js":"b540","./ka":"201b","./ka.js":"201b","./kk":"6d79","./kk.js":"6d79","./km":"e81d","./km.js":"e81d","./kn":"3e92","./kn.js":"3e92","./ko":"22f8","./ko.js":"22f8","./ku":"2421","./ku.js":"2421","./ky":"9609","./ky.js":"9609","./lb":"440c","./lb.js":"440c","./lo":"b29d","./lo.js":"b29d","./lt":"26f9","./lt.js":"26f9","./lv":"b97c","./lv.js":"b97c","./me":"293c","./me.js":"293c","./mi":"688b","./mi.js":"688b","./mk":"6909","./mk.js":"6909","./ml":"02fb","./ml.js":"02fb","./mn":"958b","./mn.js":"958b","./mr":"39bd","./mr.js":"39bd","./ms":"ebe4","./ms-my":"6403","./ms-my.js":"6403","./ms.js":"ebe4","./mt":"1b45","./mt.js":"1b45","./my":"8689","./my.js":"8689","./nb":"6ce3","./nb.js":"6ce3","./ne":"3a39","./ne.js":"3a39","./nl":"facd","./nl-be":"db29","./nl-be.js":"db29","./nl.js":"facd","./nn":"b84c","./nn.js":"b84c","./oc-lnc":"167b","./oc-lnc.js":"167b","./pa-in":"f3ff","./pa-in.js":"f3ff","./pl":"8d57","./pl.js":"8d57","./pt":"f260","./pt-br":"d2d4","./pt-br.js":"d2d4","./pt.js":"f260","./ro":"972c","./ro.js":"972c","./ru":"957c","./ru.js":"957c","./sd":"6784","./sd.js":"6784","./se":"ffff","./se.js":"ffff","./si":"eda5","./si.js":"eda5","./sk":"7be6","./sk.js":"7be6","./sl":"8155","./sl.js":"8155","./sq":"c8f3","./sq.js":"c8f3","./sr":"cf1e","./sr-cyrl":"13e9","./sr-cyrl.js":"13e9","./sr.js":"cf1e","./ss":"52bd","./ss.js":"52bd","./sv":"5fbd","./sv.js":"5fbd","./sw":"74dc","./sw.js":"74dc","./ta":"3de5","./ta.js":"3de5","./te":"5cbb","./te.js":"5cbb","./tet":"576c","./tet.js":"576c","./tg":"3b1b","./tg.js":"3b1b","./th":"10e8","./th.js":"10e8","./tk":"5aff","./tk.js":"5aff","./tl-ph":"0f38","./tl-ph.js":"0f38","./tlh":"cf75","./tlh.js":"cf75","./tr":"0e81","./tr.js":"0e81","./tzl":"cf51","./tzl.js":"cf51","./tzm":"c109","./tzm-latn":"b53d","./tzm-latn.js":"b53d","./tzm.js":"c109","./ug-cn":"6117","./ug-cn.js":"6117","./uk":"ada2","./uk.js":"ada2","./ur":"5294","./ur.js":"5294","./uz":"2e8c","./uz-latn":"010e","./uz-latn.js":"010e","./uz.js":"2e8c","./vi":"2921","./vi.js":"2921","./x-pseudo":"fd7e","./x-pseudo.js":"fd7e","./yo":"7f33","./yo.js":"7f33","./zh-cn":"5c3a","./zh-cn.js":"5c3a","./zh-hk":"49ab","./zh-hk.js":"49ab","./zh-mo":"3a6c","./zh-mo.js":"3a6c","./zh-tw":"90ea","./zh-tw.js":"90ea"};function i(A){var e=a(A);return t(e)}function a(A){if(!t.o(o,A)){var e=new Error("Cannot find module '"+A+"'");throw e.code="MODULE_NOT_FOUND",e}return o[A]}i.keys=function(){return Object.keys(o)},i.resolve=a,A.exports=i,i.id="4678"},5187:function(A,e,t){"use strict";var o=t("dc4b"),i=t.n(o);i.a},5491:function(A,e,t){var o={"./AsideMenu.vue":"2f7f","./Breadcrumb.vue":"5670","./PageContent.vue":"34ab","./PageHeader.vue":"d8dc"};function i(A){var e=a(A);return t(e)}function a(A){if(!t.o(o,A)){var e=new Error("Cannot find module '"+A+"'");throw e.code="MODULE_NOT_FOUND",e}return o[A]}i.keys=function(){return Object.keys(o)},i.resolve=a,A.exports=i,i.id="5491"},"55f7":function(A,e,t){},5670:function(A,e,t){"use strict";t.r(e);var o=function(){var A=this,e=A.$createElement,t=A._self._c||e;return t("a-breadcrumb",{staticClass:"breadcrumb"},A._l(A.breadList,(function(e,o){return t("a-breadcrumb-item",{key:e.name},[e.name!=A.name&&1!=o?t("router-link",{attrs:{to:{path:""===e.path?"/":e.path}}},[A._v(A._s(e.meta.name))]):t("span",[A._v(A._s(e.meta.name))])],1)})),1)},i=[],a=(t("4160"),t("b0c0"),t("159b"),{name:"Breadcrumb",data:function(){return{name:"",breadList:[]}},created:function(){this.getBreadcrumb()},methods:{getBreadcrumb:function(){var A=this;this.breadList=[],this.name=this.$route.name,console.log(this.$route.matched),this.$route.matched.forEach((function(e){A.breadList.push(e)}))}},watch:{$route:function(){this.getBreadcrumb()}}}),s=a,r=(t("3caf"),t("2877")),n=Object(r["a"])(s,o,i,!1,null,"6a6f0769",null);e["default"]=n.exports},"568d":function(A,e,t){var o={"./aside-item.vue":"b94e","./content-view.vue":"69f1","./reset-search.vue":"0359"};function i(A){var e=a(A);return t(e)}function a(A){if(!t.o(o,A)){var e=new Error("Cannot find module '"+A+"'");throw e.code="MODULE_NOT_FOUND",e}return o[A]}i.keys=function(){return Object.keys(o)},i.resolve=a,A.exports=i,i.id="568d"},"56d7":function(A,e,t){"use strict";t.r(e);t("e260"),t("e6cf"),t("cca6"),t("a79df");var o=t("2b0e"),i=function(){var A=this,e=A.$createElement,t=A._self._c||e;return t("a-config-provider",{attrs:{locale:A.locale}},[t("div",{attrs:{id:"app"}},[A.isRouterAlive?t("router-view"):A._e()],1)])},a=[],s=(t("45fc"),t("677e")),r=t.n(s),n=t("c1df"),g=t.n(n);t("5c3a");g.a.locale("zh-cn");var c={name:"App",data:function(){return{isRouterAlive:!0,locale:r.a}},provide:function(){return{reload:this.reload}},methods:{reload:function(){this.isRouterAlive=!1,this.$nextTick((function(){this.isRouterAlive=!0}))}},mounted:function(){var A=this;window.onmessage=function(e){if(e.data.id)if(sessionStorage.setItem("postMessage",e.data.id),e.data.userInfo&&e.data.userInfo.id){if(e.data.userInfo.permissionList.some((function(A){return"duojiSystem"===A.rights}))){var t=A.$utils.translateDataToTree(e.data.userInfo.permissionList,"duojiSystem");e.data.userInfo.permissionList=A.$utils.treeToArray(t)}else e.data.userInfo.permissionList=[];localStorage.setItem("userInfo",JSON.stringify(e.data.userInfo))}else localStorage.clear()}}},I=c,d=(t("5c0b"),t("2877")),l=Object(d["a"])(I,i,a,!1,null,null,null),h=l.exports,B=(t("d3b7"),t("8c4f"));o["default"].use(B["a"]);var u=B["a"].prototype.push;B["a"].prototype.push=function(A){return u.call(this,A).catch((function(A){return A}))};var C=[{path:"/",redirect:{name:"realTimeMonitoring"},component:function(){return t.e("chunk-7a7b9f54").then(t.bind(null,"1e4b"))},children:[{path:"realTimeMonitoring",name:"realTimeMonitoring",meta:{icon:"desktop",name:"实时视频流"},component:function(){return t.e("chunk-08e1a871").then(t.bind(null,"d7ad"))}},{path:"realTimeMonitoring/model",name:"realTimeMonitoringModel",meta:{name:"实时视频流(全屏)"},component:function(){return Promise.all([t.e("chunk-7140b3ea"),t.e("chunk-08bf0385")]).then(t.bind(null,"5949"))}},{path:"historyMonitoring",name:"historyMonitoring",meta:{icon:"line-chart",name:"历史数据"},component:function(){return t.e("chunk-57349b0e").then(t.bind(null,"2bf9"))}},{path:"alarmVideos",name:"alarmVideos",meta:{icon:"alert",name:"告警视频"},component:function(){return t.e("chunk-5475037c").then(t.bind(null,"e525"))}},{path:"alarmLog",name:"alarmLog",meta:{icon:"exception",name:"告警日志"},component:function(){return t.e("chunk-6536ddf4").then(t.bind(null,"f9bc"))}},{path:"checkManage",name:"checkManage",meta:{icon:"form",name:"盘点管理"},component:function(){return t.e("chunk-46abd976").then(t.bind(null,"1b63"))}},{path:"checkOperation",name:"checkOperation",meta:{name:"盘点操作"},component:function(){return t.e("chunk-253cbc40").then(t.bind(null,"02d3"))}},{path:"roadwayManage",name:"roadwayManage",meta:{icon:"build",name:"巷道管理"},component:function(){return t.e("chunk-b81b9e6a").then(t.bind(null,"dff9"))}},{path:"cameraManage",name:"cameraManage",meta:{icon:"video-camera",name:"球机管理"},component:function(){return Promise.all([t.e("chunk-7140b3ea"),t.e("chunk-086d150f"),t.e("chunk-3e32aa3f")]).then(t.bind(null,"9543"))}},{path:"cameraManage/model",name:"cameraManageModel",meta:{name:"球机管理测试or配置"},component:function(){return Promise.all([t.e("chunk-7140b3ea"),t.e("chunk-086d150f")]).then(t.bind(null,"9545"))}},{path:"productSpecManage",name:"productSpecManage",meta:{icon:"pushpin",name:"品规管理"},component:function(){return t.e("chunk-375b73bd").then(t.bind(null,"98e8"))}},{path:"repertoryManage",name:"repertoryManage",meta:{icon:"wallet",name:"库存管理"},component:function(){return t.e("chunk-60716892").then(t.bind(null,"0b85"))}},{path:"cameraManage/ioTable",name:"ioTable",meta:{name:"IO表配置"},component:function(){return t.e("chunk-42a25b44").then(t.bind(null,"4999"))}},{path:"center",name:"center",meta:{name:"个人中心"},component:function(){return t.e("chunk-0275c83d").then(t.bind(null,"97b0"))}},{path:"plcStatus",name:"plcStatus",meta:{name:"PLC状态"},component:function(){return t.e("chunk-34c17386").then(t.bind(null,"7433"))}}]},{path:"/login",name:"login",component:function(){return t.e("chunk-23f89511").then(t.bind(null,"dd7b"))}},{path:"/guide",name:"guide",component:function(){return t.e("chunk-1d4ca763").then(t.bind(null,"1761"))}},{path:"*",name:"404",component:function(){return t.e("chunk-2d0e95df").then(t.bind(null,"8cdb"))}}],E=new B["a"]({routes:C});E.beforeEach((function(A,e,t){t()}));var Q=E,p=t("2f62");o["default"].use(p["a"]);var m=new p["a"].Store({state:{aside_collapsed:!1,userInfo:JSON.parse(localStorage.getItem("userInfo")||"{}")},getters:{getAside_collapsed:function(A){return A.aside_collapsed}},mutations:{setState:function(A,e){for(var t in e)A[t]=e[t]},aside_collapsed:function(A,e){A.aside_collapsed=e}},actions:{},modules:{}}),f=(t("380f"),t("f64c")),y=(t("05db"),t("fa07")),w=(t("b846"),t("a071")),b=(t("4bbf"),t("59a5")),D=(t("7a59"),t("39ab")),v=(t("519e"),t("0bb7")),k=(t("ee33"),t("a79d")),S=(t("153b"),t("9571")),M=(t("3e86"),t("7571")),R=(t("9e39"),t("f933")),F=(t("564f"),t("768f")),G=(t("02cf"),t("9839")),q=(t("1815"),t("e32c")),x=(t("50ac"),t("9a63")),N=(t("8b88"),t("681b")),T=(t("04f3"),t("ed3b")),L=(t("5e72"),t("3779")),J=(t("2c24"),t("d865")),U=(t("805a"),t("0c63")),P=(t("48e3"),t("2fc4")),_=(t("e1f5"),t("5efb")),H=(t("c721"),t("3af3")),O=(t("b6e5"),t("55f1")),Y=(t("9967"),t("de1b")),j=(t("0723"),t("0020")),K=(t("1c85"),t("ccb9")),W=(t("a106"),t("09d9")),z=(t("a71a"),t("b558")),Z=(t("5b61"),t("4df5")),X=(t("d2a2"),t("98c5"));o["default"].use(X["a"]),o["default"].use(Z["b"]),o["default"].use(z["a"]),o["default"].use(W["a"]),o["default"].use(K["a"]),o["default"].use(j["a"]),o["default"].use(Y["a"]),o["default"].use(O["a"]),o["default"].use(H["a"]),o["default"].use(_["a"]),o["default"].use(P["a"]),o["default"].use(U["a"]),o["default"].use(J["a"]),o["default"].use(L["a"]),o["default"].use(T["a"]),o["default"].use(N["a"]),o["default"].use(x["a"]),o["default"].use(q["a"]),o["default"].use(G["b"]),o["default"].use(F["a"]),o["default"].use(R["a"]),o["default"].use(M["a"]),o["default"].use(S["a"]),o["default"].use(k["a"]),o["default"].use(v["a"]),o["default"].use(D["a"]),o["default"].use(b["a"]),o["default"].use(w["a"]),o["default"].use(y["a"]),o["default"].prototype.$message=f["a"],o["default"].prototype.$info=T["a"].info,o["default"].prototype.$success=T["a"].success,o["default"].prototype.$confirm=T["a"].confirm,o["default"].prototype.$error=T["a"].error;t("d81d"),t("b0c0"),t("ddb0");var V=t("568d");V.keys().map((function(A){var e=V(A).default;return o["default"].component(e.name,e)}));var $=t("5491");$.keys().map((function(A){var e=$(A).default;return o["default"].component(e.name,e)}));t("4de4"),t("7db0"),t("4160"),t("a434"),t("ac1f"),t("25f0"),t("3ca3"),t("5319"),t("1276"),t("159b"),t("2b3d");var AA={format:function(A){var e=parseInt(A/864e5),t=parseInt(A%864e5/36e5),o=parseInt(A%36e5/6e4),i=A%6e4/1e3;return e+" 天 "+t+" 小时 "+o+" 分钟 "+i+" 秒 "},timerFormat:function(){var A=new Date,e=A.getFullYear(),t=A.getMonth()+1,o=A.getDate(),i=A.getHours()<10?"0"+A.getHours():A.getHours(),a=A.getMinutes()<10?"0"+A.getMinutes():A.getMinutes(),s=A.getSeconds()<10?"0"+A.getSeconds():A.getSeconds();return e+"年"+t+"月"+o+"日 "+i+":"+a+":"+s},computedStrLen:function(A){for(var e=0,t=0;t=1&&o<=126||65376<=o&&o<=65439?e++:e+=2}return e},deepClone:function(A){var e,t=this.getType(A);if("array"===t)e=[];else{if("object"!==t)return A;e={}}if("array"===t)for(var o=0,i=A.length;o1&&void 0!==arguments[1]?arguments[1]:[];return A.forEach((function(A){var o=A.children;if(o&&(delete A.children,o.length))return t.push(A),e.treeToArray(o,t);t.push(A)})),t},translateDataToTree:function(A,e){var t=A.filter((function(A){return 0===A.parentId})),o=A.filter((function(A){return 0!==A.parentId})),i=function A(e,t){e&&e.forEach((function(e){t&&t.forEach((function(o,i){if(o.parentId===e.id){var a=JSON.parse(JSON.stringify(t));a.splice(i,1),e.children&&e.children.length?e.children.push(o):e.children=[o],A([o],a)}}))}))};return i(t,o),t=t.filter((function(A){return A.rights===e})),t&&t.length&&t[0].children}},eA=(t("c975"),t("b64b"),t("466d"),t("5530")),tA=(t("07ac"),t("841c"),t("bc3a")),oA=t.n(tA),iA=oA.a.create({baseURL:"/api",timeout:6e4,headers:{"Content-Type":"application/json;charset=UTF-8"},withCredentials:!0});window.once=0;var aA=["/stock/export","/category/export/model","/stock/export/model"];iA.interceptors.request.use((function(A){var e=A;console.log(e);var t=/\{(.+?)\}/g;return t.test(e.url)&&(e.url=e.url.replace(t,Object.values(e.path)[0])),localStorage.getItem("userInfo")&&(e.headers.token=JSON.parse(localStorage.getItem("userInfo")).token),aA.indexOf(A.url)>-1&&(A.responseType="blob"),e}),(function(A){return Promise.reject(A)})),iA.interceptors.response.use((function(A){if(aA.some((function(e){return A.config.url.indexOf(e)>-1})))return A.data;var e=A.data;return 200!==e.code&&0!==e.code?(o["default"].prototype.$message.error(e.message),401===e.code&&(0!=window.once||location.search||(o["default"].prototype.$message.error(e.message),o["default"].prototype.$axios({url:"/app/userCenter",method:"GET"}).then((function(A){window.open(A.data.url+"?redirect="+location.origin,"_self")})).catch((function(A){}))),++window.once),Promise.reject(e.message)):e}),(function(A){return Promise.reject(A)})),o["default"].prototype.$axios=iA;var sA=iA,rA=function(A){var e=A;return Object.keys(e).forEach((function(A){var t=Object(eA["a"])({},e[A]);e[A]=function(A){return sA(Object(eA["a"])({method:t.method,url:t.url},A))}})),e},nA=t("739d"),gA={};function cA(A){var e=/-([a-z])/g;return A.replace(e,(function(A,e){return e.toUpperCase()}))}nA.keys().map((function(A){var e=cA(A.match(/.*\/.*\/(.*\..*)/)[1]).indexOf(".js"),t=cA(A.match(/.*\/.*\/(.*\..*)/)[1]).substring(0,e);return gA[t]=nA(A).default,console.log("moduleApis ",gA),rA(gA[t])}));var IA=gA,dA=(t("edd9"),t("23cb9"),t("5c6c7"),t("6db4")),lA=(t("14d3"),t("0808"),t("6944")),hA=t.n(lA),BA=t("f0e2");t("fda2");o["default"].config.productionTip=!1,o["default"].prototype.$utils=AA,o["default"].prototype.$api=IA,o["default"].component("happy-scroll",dA["HappyScroll"]),o["default"].use(hA.a),o["default"].prototype.$video=BA["a"],new o["default"]({router:Q,store:m,render:function(A){return A(h)}}).$mount("#app")},"5c0b":function(A,e,t){"use strict";var o=t("9c0c"),i=t.n(o);i.a},"5c6c7":function(A,e,t){},"69f1":function(A,e,t){"use strict";t.r(e);var o=function(){var A=this,e=A.$createElement,t=A._self._c||e;return t("div",{staticClass:"wrap"},[A.$route.meta.name?t("div",{staticClass:"wrap-title"},[t("span",{staticClass:"wrap-title-text"},[A._t("title",[A._v(A._s(A.title))])],2)]):A._e(),t("div",{staticClass:"wrap-header"},[A._t("header"),A._t("button")],2),t("div",{staticClass:"wrap-cont"},[t("div",{staticClass:"wrap-cont-cover"},[t("div",{staticClass:"wrap-container"},[A._t("default")],2)])]),t("div",{staticClass:"wrap-footer bg-white"},[A._t("footer")],2)])},i=[],a=(t("b0c0"),{name:"content-view",data:function(){return{title:"",footerStyle:!1}},watch:{$route:function(A){this.title=A.meta.title||A.meta.name}},computed:{},mounted:function(){this.title=this.$route.meta.title||this.$route.meta.name}}),s=a,r=(t("40d1"),t("2877")),n=Object(r["a"])(s,o,i,!1,null,null,null);e["default"]=n.exports},"739d":function(A,e,t){var o={"./http/http-api.js":"2a8b"};function i(A){var e=a(A);return t(e)}function a(A){if(!t.o(o,A)){var e=new Error("Cannot find module '"+A+"'");throw e.code="MODULE_NOT_FOUND",e}return o[A]}i.keys=function(){return Object.keys(o)},i.resolve=a,A.exports=i,i.id="739d"},9642:function(A,e,t){},"9c0c":function(A,e,t){},b94e:function(A,e,t){"use strict";t.r(e);var o=function(A,e){var t=e._c;return t("a-sub-menu",e._g({key:e.data.attrs.menuInfo.name},e.listeners),[t("span",{attrs:{slot:"title"},slot:"title"},[t("a-icon",{attrs:{type:e.data.attrs.menuInfo.meta.icon}}),t("span",[e._v(e._s(e.data.attrs.menuInfo.meta.name))])],1),e._l(e.data.attrs.menuInfo.children,(function(A){return[A.meta.unfold?e._e():t("a-menu-item",{key:A.name},[t("span",[e._v(e._s(A.meta.name))])]),A.meta.unfold?t("aside-item",{key:A.name,attrs:{menuInfo:A}}):e._e()]}))],2)},i=[],a={name:"aside-item",components:{},data:function(){return{}},methods:{},mounted:function(){}},s=a,r=t("2877"),n=Object(r["a"])(s,o,i,!0,null,null,null);e["default"]=n.exports},d8dc:function(A,e,t){"use strict";t.r(e);var o=function(){var A=this,e=A.$createElement,t=A._self._c||e;return t("div",{class:["header",A.collapsed?"collapsed-header":""]},[t("div",{staticClass:"header-left"},[t("a-layout-header",{staticStyle:{background:"#fff",padding:"0"}},[t("a-icon",{staticClass:"trigger",attrs:{type:A.collapsed?"menu-unfold":"menu-fold"},on:{click:A.collapsedFlag}})],1)],1),t("div",{staticClass:"header-right"},[t("div",{staticClass:"header-top-right-circle",on:{click:function(e){A.visible=!A.visible}}}),t("a-badge",{attrs:{count:A.count},on:{click:A.openPlc}},[t("a-icon",{staticStyle:{"font-size":"20px",cursor:"pointer"},attrs:{type:"bell"}})],1),t("a-popover",{attrs:{id:"popover",placement:"bottom",trigger:"click"},model:{value:A.visible,callback:function(e){A.visible=e},expression:"visible"}},[t("a",{staticStyle:{margin:"0 10px"},attrs:{href:"javascript:;"}},[A._v(" "+A._s(A.userInfo.name?A.userInfo.name:"userName")+" ")]),t("div",{staticClass:"flex flex-column",style:{"min-width":"78px"},attrs:{slot:"content"},slot:"content"},[t("a",{staticClass:"block mb16",attrs:{href:"javascript:;"},on:{click:function(e){A.visible=!1,A.$router.push({name:"center"})}}},[A._v("个人中心")]),t("a",{attrs:{href:"javascript:;"},on:{click:A.logout}},[A._v("退出登录")])])])],1)])},i=[],a=t("5530"),s=t("2f62"),r={name:"PageHeader",computed:Object(a["a"])(Object(a["a"])({},Object(s["d"])(["aside_collapsed","userInfo"])),Object(s["b"])(["getAside_collapsed"])),watch:{getAside_collapsed:function(A){console.log(A),this.collapsed=A}},data:function(){return{visible:!1,collapsed:!1,count:0}},mounted:function(){this.getplcStatus();var A=this;setInterval((function(){A.getplcStatus()}),5e3)},methods:Object(a["a"])(Object(a["a"])({},Object(s["c"])(["setState"])),{},{logout:function(){this.visible=!1,localStorage.clear(),sessionStorage.clear(),this.$axios({url:"/app/userCenter",method:"GET"}).then((function(A){window.open(A.data.url+"?action=logout","_self")})).catch((function(A){}))},collapsedFlag:function(){this.collapsed=!this.collapsed,this.$store.commit("aside_collapsed",this.collapsed)},getplcStatus:function(){var A=this;this.$axios({url:"/plc/plcStatus",method:"GET"}).then((function(e){200==e.code&&(A.count=e.data)})).catch((function(A){console.log(A)}))},openPlc:function(){this.$router.push({name:"plcStatus"})}})},n=r,g=(t("f016"),t("2877")),c=Object(g["a"])(n,o,i,!1,null,null,null);e["default"]=c.exports},dc4b:function(A,e,t){},edd9:function(A,e,t){t("a874"),t("cb29"),t("a15b"),t("d3b7"),t("ac1f"),t("466d"),t("cfc3"),t("fd87"),t("8b09"),t("143c"),t("5cc6"),t("8a59"),t("84c3"),t("fb2c"),t("9a8c"),t("a975"),t("735e"),t("c1ac"),t("d139"),t("3a7b"),t("d5d6"),t("82f8"),t("e91f"),t("60bd"),t("5f96"),t("3280"),t("3fcc"),t("ca91"),t("25a1"),t("cd26"),t("3c5d"),t("2954"),t("649e"),t("219c"),t("170b"),t("b39a"),t("72f7");var o=t("7037");window.JSMpeg={Player:null,VideoElement:null,BitBuffer:null,Source:{},Demuxer:{},Decoder:{},Renderer:{},AudioOutput:{},Now:function(){return window.performance?window.performance.now()/1e3:Date.now()/1e3},CreateVideoElements:function(){for(var A=document.querySelectorAll(".jsmpeg"),e=0;e',A.UNMUTE_BUTTON='',A}(),JSMpeg.Player=function(){"use strict";var A=function(A,e){if(this.options=e||{},e.source?(this.source=new e.source(A,e),e.streaming=!!this.source.streaming):A.match(/^wss?:\/\//)?(this.source=new JSMpeg.Source.WebSocket(A,e),e.streaming=!0):!1!==e.progressive?(this.source=new JSMpeg.Source.AjaxProgressive(A,e),e.streaming=!1):(this.source=new JSMpeg.Source.Ajax(A,e),e.streaming=!1),this.maxAudioLag=e.maxAudioLag||.25,this.loop=!1!==e.loop,this.autoplay=!!e.autoplay||e.streaming,this.demuxer=new JSMpeg.Demuxer.TS(e),this.source.connect(this.demuxer),!e.disableWebAssembly&&JSMpeg.WASMModule.IsSupported()&&(this.wasmModule=JSMpeg.WASMModule.GetModule(),e.wasmModule=this.wasmModule),!1!==e.video&&(this.video=e.wasmModule?new JSMpeg.Decoder.MPEG1VideoWASM(e):new JSMpeg.Decoder.MPEG1Video(e),this.renderer=!e.disableGl&&JSMpeg.Renderer.WebGL.IsSupported()?new JSMpeg.Renderer.WebGL(e):new JSMpeg.Renderer.Canvas2D(e),this.demuxer.connect(JSMpeg.Demuxer.TS.STREAM.VIDEO_1,this.video),this.video.connect(this.renderer)),!1!==e.audio&&JSMpeg.AudioOutput.WebAudio.IsSupported()&&(this.audio=e.wasmModule?new JSMpeg.Decoder.MP2AudioWASM(e):new JSMpeg.Decoder.MP2Audio(e),this.audioOut=new JSMpeg.AudioOutput.WebAudio(e),this.demuxer.connect(JSMpeg.Demuxer.TS.STREAM.AUDIO_1,this.audio),this.audio.connect(this.audioOut)),Object.defineProperty(this,"currentTime",{get:this.getCurrentTime,set:this.setCurrentTime}),Object.defineProperty(this,"volume",{get:this.getVolume,set:this.setVolume}),this.paused=!0,this.unpauseOnShow=!1,!1!==e.pauseWhenHidden&&document.addEventListener("visibilitychange",this.showHide.bind(this)),this.wasmModule)if(this.wasmModule.ready)this.startLoading();else if(JSMpeg.WASM_BINARY_INLINED){var t=JSMpeg.Base64ToArrayBuffer(JSMpeg.WASM_BINARY_INLINED);this.wasmModule.loadFromBuffer(t,this.startLoading.bind(this))}else this.wasmModule.loadFromFile("jsmpeg.wasm",this.startLoading.bind(this));else this.startLoading()};return A.prototype.startLoading=function(){this.source.start(),this.autoplay&&this.play()},A.prototype.showHide=function(A){"hidden"===document.visibilityState?(this.unpauseOnShow=this.wantsToPlay,this.pause()):this.unpauseOnShow&&this.play()},A.prototype.play=function(A){this.animationId||(this.animationId=requestAnimationFrame(this.update.bind(this)),this.wantsToPlay=!0,this.paused=!1)},A.prototype.pause=function(A){this.paused||(cancelAnimationFrame(this.animationId),this.animationId=null,this.wantsToPlay=!1,this.isPlaying=!1,this.paused=!0,this.audio&&this.audio.canPlay&&(this.audioOut.stop(),this.seek(this.currentTime)),this.options.onPause&&this.options.onPause(this))},A.prototype.getVolume=function(){return this.audioOut?this.audioOut.volume:0},A.prototype.setVolume=function(A){this.audioOut&&(this.audioOut.volume=A)},A.prototype.stop=function(A){this.pause(),this.seek(0),this.video&&!1!==this.options.decodeFirstFrame&&this.video.decode()},A.prototype.destroy=function(){this.pause(),this.source.destroy(),this.video&&this.video.destroy(),this.renderer&&this.renderer.destroy(),this.audio&&this.audio.destroy(),this.audioOut&&this.audioOut.destroy()},A.prototype.seek=function(A){var e=this.audio&&this.audio.canPlay?this.audio.startTime:this.video.startTime;this.video&&this.video.seek(A+e),this.audio&&this.audio.seek(A+e),this.startTime=JSMpeg.Now()-A},A.prototype.getCurrentTime=function(){return this.audio&&this.audio.canPlay?this.audio.currentTime-this.audio.startTime:this.video.currentTime-this.video.startTime},A.prototype.setCurrentTime=function(A){this.seek(A)},A.prototype.update=function(){this.animationId=requestAnimationFrame(this.update.bind(this)),this.source.established?(this.isPlaying||(this.isPlaying=!0,this.startTime=JSMpeg.Now()-this.currentTime,this.options.onPlay&&this.options.onPlay(this)),this.options.streaming?this.updateForStreaming():this.updateForStaticFile()):this.renderer&&this.renderer.renderProgress(this.source.progress)},A.prototype.updateForStreaming=function(){if(this.video&&this.video.decode(),this.audio){var A=!1;do{this.audioOut.enqueuedTime>this.maxAudioLag&&(this.audioOut.resetEnqueuedTime(),this.audioOut.enabled=!1),A=this.audio.decode()}while(A);this.audioOut.enabled=!0}},A.prototype.nextFrame=function(){return!(!this.source.established||!this.video)&&this.video.decode()},A.prototype.updateForStaticFile=function(){var A=!1,e=0;if(this.audio&&this.audio.canPlay){while(!A&&this.audio.decodedTime-this.audio.currentTime<.25)A=!this.audio.decode();this.video&&this.video.currentTime0&&(o>2*i&&(this.startTime+=o),A=!this.video.decode()),e=this.demuxer.currentTime-t}this.source.resume(e),A&&this.source.completed?this.loop?this.seek(0):(this.pause(),this.options.onEnded&&this.options.onEnded(this)):A&&this.options.onStalled&&this.options.onStalled(this)},A}(),JSMpeg.BitBuffer=function(){"use strict";var A=function A(e,t){"object"===o(e)?(this.bytes=e instanceof Uint8Array?e:new Uint8Array(e),this.byteLength=this.bytes.length):(this.bytes=new Uint8Array(e||1048576),this.byteLength=0),this.mode=t||A.MODE.EXPAND,this.index=0};return A.prototype.resize=function(A){var e=new Uint8Array(A);0!==this.byteLength&&(this.byteLength=Math.min(this.byteLength,A),e.set(this.bytes,0,this.byteLength)),this.bytes=e,this.index=Math.min(this.index,this.byteLength<<3)},A.prototype.evict=function(A){var e=this.index>>3,t=this.bytes.length-this.byteLength;if(this.index===this.byteLength<<3||A>t+e)return this.byteLength=0,void(this.index=0);0!==e&&(this.bytes.copyWithin?this.bytes.copyWithin(0,e,this.byteLength):this.bytes.set(this.bytes.subarray(e,this.byteLength)),this.byteLength=this.byteLength-e,this.index-=e<<3)},A.prototype.write=function(e){var t="object"===o(e[0]),i=0,a=this.bytes.length-this.byteLength;if(t){i=0;for(var s=0;sa)if(this.mode===A.MODE.EXPAND){var r=Math.max(2*this.bytes.length,i-a);this.resize(r)}else this.evict(i);if(t)for(s=0;s>3;A>3;return A>=this.byteLength||0==this.bytes[A]&&0==this.bytes[A+1]&&1==this.bytes[A+2]},A.prototype.peek=function(A){var e=this.index,t=0;while(A){var o=this.bytes[e>>3],i=8-(7&e),a=i>8-a;t=t<>s,e+=a,A-=a}return t},A.prototype.read=function(A){var e=this.peek(A);return this.index+=A,e},A.prototype.skip=function(A){return this.index+=A},A.prototype.rewind=function(A){this.index=Math.max(this.index-A,0)},A.prototype.has=function(A){return(this.byteLength<<3)-this.index>=A},A.MODE={EVICT:1,EXPAND:2},A}(),JSMpeg.Source.Ajax=function(){"use strict";var A=function(A,e){this.url=A,this.destination=null,this.request=null,this.streaming=!1,this.completed=!1,this.established=!1,this.progress=0,this.onEstablishedCallback=e.onSourceEstablished,this.onCompletedCallback=e.onSourceCompleted};return A.prototype.connect=function(A){this.destination=A},A.prototype.start=function(){this.request=new XMLHttpRequest,this.request.onreadystatechange=function(){this.request.readyState===this.request.DONE&&200===this.request.status&&this.onLoad(this.request.response)}.bind(this),this.request.onprogress=this.onProgress.bind(this),this.request.open("GET",this.url),this.request.responseType="arraybuffer",this.request.send()},A.prototype.resume=function(A){},A.prototype.destroy=function(){this.request.abort()},A.prototype.onProgress=function(A){this.progress=A.loaded/A.total},A.prototype.onLoad=function(A){this.established=!0,this.completed=!0,this.progress=1,this.onEstablishedCallback&&this.onEstablishedCallback(this),this.onCompletedCallback&&this.onCompletedCallback(this),this.destination&&this.destination.write(A)},A}(),JSMpeg.Source.Fetch=function(){"use strict";var A=function(A,e){this.url=A,this.destination=null,this.request=null,this.streaming=!0,this.completed=!1,this.established=!1,this.progress=0,this.aborted=!1,this.onEstablishedCallback=e.onSourceEstablished,this.onCompletedCallback=e.onSourceCompleted};return A.prototype.connect=function(A){this.destination=A},A.prototype.start=function(){var A={method:"GET",headers:new Headers,cache:"default"};self.fetch(this.url,A).then(function(A){if(A.ok&&A.status>=200&&A.status<=299)return this.progress=1,this.established=!0,this.pump(A.body.getReader())}.bind(this)).catch((function(A){throw A}))},A.prototype.pump=function(A){return A.read().then(function(e){if(!e.done)return this.aborted?A.cancel():(this.destination&&this.destination.write(e.value.buffer),this.pump(A));this.completed=!0}.bind(this)).catch((function(A){throw A}))},A.prototype.resume=function(A){},A.prototype.abort=function(){this.aborted=!0},A}(),JSMpeg.Source.AjaxProgressive=function(){"use strict";var A=function(A,e){this.url=A,this.destination=null,this.request=null,this.streaming=!1,this.completed=!1,this.established=!1,this.progress=0,this.fileSize=0,this.loadedSize=0,this.chunkSize=e.chunkSize||1048576,this.isLoading=!1,this.loadStartTime=0,this.throttled=!1!==e.throttled,this.aborted=!1,this.onEstablishedCallback=e.onSourceEstablished,this.onCompletedCallback=e.onSourceCompleted};return A.prototype.connect=function(A){this.destination=A},A.prototype.start=function(){this.request=new XMLHttpRequest,this.request.onreadystatechange=function(){this.request.readyState===this.request.DONE&&(this.fileSize=parseInt(this.request.getResponseHeader("Content-Length")),this.loadNextChunk())}.bind(this),this.request.onprogress=this.onProgress.bind(this),this.request.open("HEAD",this.url),this.request.send()},A.prototype.resume=function(A){if(!this.isLoading&&this.throttled){var e=8*this.loadTime+2;e>A&&this.loadNextChunk()}},A.prototype.destroy=function(){this.request.abort(),this.aborted=!0},A.prototype.loadNextChunk=function(){var A=this.loadedSize,e=Math.min(this.loadedSize+this.chunkSize-1,this.fileSize-1);if(A>=this.fileSize||this.aborted)return this.completed=!0,void(this.onCompletedCallback&&this.onCompletedCallback(this));this.isLoading=!0,this.loadStartTime=JSMpeg.Now(),this.request=new XMLHttpRequest,this.request.onreadystatechange=function(){this.request.readyState===this.request.DONE&&this.request.status>=200&&this.request.status<300?this.onChunkLoad(this.request.response):this.request.readyState===this.request.DONE&&this.loadFails++<3&&this.loadNextChunk()}.bind(this),0===A&&(this.request.onprogress=this.onProgress.bind(this)),this.request.open("GET",this.url+"?"+A+"-"+e),this.request.setRequestHeader("Range","bytes="+A+"-"+e),this.request.responseType="arraybuffer",this.request.send()},A.prototype.onProgress=function(A){this.progress=A.loaded/A.total},A.prototype.onChunkLoad=function(A){var e=!this.established;this.established=!0,this.progress=1,this.loadedSize+=A.byteLength,this.loadFails=0,this.isLoading=!1,e&&this.onEstablishedCallback&&this.onEstablishedCallback(this),this.destination&&this.destination.write(A),this.loadTime=JSMpeg.Now()-this.loadStartTime,this.throttled||this.loadNextChunk()},A}(),JSMpeg.Source.WebSocket=function(){"use strict";var A=function(A,e){this.url=A,this.options=e,this.socket=null,this.streaming=!0,this.callbacks={connect:[],data:[]},this.destination=null,this.reconnectInterval=void 0!==e.reconnectInterval?e.reconnectInterval:5,this.shouldAttemptReconnect=!!this.reconnectInterval,this.completed=!1,this.established=!1,this.progress=0,this.reconnectTimeoutId=0,this.onEstablishedCallback=e.onSourceEstablished,this.onCompletedCallback=e.onSourceCompleted};return A.prototype.connect=function(A){this.destination=A},A.prototype.destroy=function(){clearTimeout(this.reconnectTimeoutId),this.shouldAttemptReconnect=!1,this.socket.close()},A.prototype.start=function(){this.shouldAttemptReconnect=!!this.reconnectInterval,this.progress=0,this.established=!1,this.socket=new WebSocket(this.url,this.options.protocols||null),this.socket.binaryType="arraybuffer",this.socket.onmessage=this.onMessage.bind(this),this.socket.onopen=this.onOpen.bind(this),this.socket.onerror=this.onClose.bind(this),this.socket.onclose=this.onClose.bind(this)},A.prototype.resume=function(A){},A.prototype.onOpen=function(){this.progress=1},A.prototype.onClose=function(){this.shouldAttemptReconnect&&(clearTimeout(this.reconnectTimeoutId),this.reconnectTimeoutId=setTimeout(function(){this.start()}.bind(this),1e3*this.reconnectInterval))},A.prototype.onMessage=function(A){var e=!this.established;this.established=!0,e&&this.onEstablishedCallback&&this.onEstablishedCallback(this),this.destination&&this.destination.write(A.data)},A}(),JSMpeg.Demuxer.TS=function(){"use strict";var A=function(A){this.bits=null,this.leftoverBytes=null,this.guessVideoFrameEnd=!0,this.pidsToStreamIds={},this.pesPacketInfo={},this.startTime=0,this.currentTime=0};return A.prototype.connect=function(A,e){this.pesPacketInfo[A]={destination:e,currentLength:0,totalLength:0,pts:0,buffers:[]}},A.prototype.write=function(A){if(this.leftoverBytes){var e=A.byteLength+this.leftoverBytes.byteLength;this.bits=new JSMpeg.BitBuffer(e),this.bits.write([this.leftoverBytes,A])}else this.bits=new JSMpeg.BitBuffer(A);while(this.bits.has(1504)&&this.parsePacket());var t=this.bits.byteLength-(this.bits.index>>3);this.leftoverBytes=t>0?this.bits.bytes.subarray(this.bits.index>>3):null},A.prototype.parsePacket=function(){if(71!==this.bits.read(8)&&!this.resync())return!1;var A=187+(this.bits.index>>3),e=(this.bits.read(1),this.bits.read(1)),t=(this.bits.read(1),this.bits.read(13)),o=(this.bits.read(2),this.bits.read(2)),i=(this.bits.read(4),this.pidsToStreamIds[t]);if(e&&i){var a=this.pesPacketInfo[i];a&&a.currentLength&&this.packetComplete(a)}if(1&o){if(2&o){var s=this.bits.read(8);this.bits.skip(s<<3)}if(e&&this.bits.nextBytesAreStartCode()){this.bits.skip(24),i=this.bits.read(8),this.pidsToStreamIds[t]=i;var r=this.bits.read(16);this.bits.skip(8);var n=this.bits.read(2);this.bits.skip(6);var g=this.bits.read(8),c=this.bits.index+(g<<3);a=this.pesPacketInfo[i];if(a){var I=0;if(2&n){this.bits.skip(4);var d=this.bits.read(3);this.bits.skip(1);var l=this.bits.read(15);this.bits.skip(1);var h=this.bits.read(15);this.bits.skip(1),I=(1073741824*d+32768*l+h)/9e4,this.currentTime=I,-1===this.startTime&&(this.startTime=I)}var B=r?r-g-3:0;this.packetStart(a,I,B)}this.bits.index=c}if(i){a=this.pesPacketInfo[i];if(a){var u=this.bits.index>>3,C=this.packetAddData(a,u,A),E=!e&&2&o;(C||this.guessVideoFrameEnd&&E)&&this.packetComplete(a)}}}return this.bits.index=A<<3,!0},A.prototype.resync=function(){if(!this.bits.has(9024))return!1;for(var A=this.bits.index>>3,e=0;e<187;e++)if(71===this.bits.bytes[A+e]){for(var t=!0,o=1;o<5;o++)if(71!==this.bits.bytes[A+e+188*o]){t=!1;break}if(t)return this.bits.index=A+e+1<<3,!0}return console.warn("JSMpeg: Possible garbage data. Skipping."),this.bits.skip(1496),!1},A.prototype.packetStart=function(A,e,t){A.totalLength=t,A.currentLength=0,A.pts=e},A.prototype.packetAddData=function(A,e,t){A.buffers.push(this.bits.bytes.subarray(e,t)),A.currentLength+=t-e;var o=0!==A.totalLength&&A.currentLength>=A.totalLength;return o},A.prototype.packetComplete=function(A){A.destination.write(A.pts,A.buffers),A.totalLength=0,A.currentLength=0,A.buffers=[]},A.STREAM={PACK_HEADER:186,SYSTEM_HEADER:187,PROGRAM_MAP:188,PRIVATE_1:189,PADDING:190,PRIVATE_2:191,AUDIO_1:192,VIDEO_1:224,DIRECTORY:255},A}(),JSMpeg.Decoder.Base=function(){"use strict";var A=function(A){this.destination=null,this.canPlay=!1,this.collectTimestamps=!A.streaming,this.bytesWritten=0,this.timestamps=[],this.timestampIndex=0,this.startTime=0,this.decodedTime=0,Object.defineProperty(this,"currentTime",{get:this.getCurrentTime})};return A.prototype.destroy=function(){},A.prototype.connect=function(A){this.destination=A},A.prototype.bufferGetIndex=function(){return this.bits.index},A.prototype.bufferSetIndex=function(A){this.bits.index=A},A.prototype.bufferWrite=function(A){return this.bits.write(A)},A.prototype.write=function(A,e){this.collectTimestamps&&(0===this.timestamps.length&&(this.startTime=A,this.decodedTime=A),this.timestamps.push({index:this.bytesWritten<<3,time:A})),this.bytesWritten+=this.bufferWrite(e),this.canPlay=!0},A.prototype.seek=function(A){if(this.collectTimestamps){this.timestampIndex=0;for(var e=0;eA)break;this.timestampIndex=e}var t=this.timestamps[this.timestampIndex];t?(this.bufferSetIndex(t.index),this.decodedTime=t.time):(this.bufferSetIndex(0),this.decodedTime=this.startTime)}},A.prototype.decode=function(){this.advanceDecodedTime(0)},A.prototype.advanceDecodedTime=function(A){if(this.collectTimestamps){for(var e=-1,t=this.bufferGetIndex(),o=this.timestampIndex;ot)break;e=o}if(-1!==e&&e!==this.timestampIndex)return this.timestampIndex=e,void(this.decodedTime=this.timestamps[this.timestampIndex].time)}this.decodedTime+=A},A.prototype.getCurrentTime=function(){return this.decodedTime},A}(),JSMpeg.Decoder.MPEG1Video=function(){"use strict";var A=function(A){JSMpeg.Decoder.Base.call(this,A),this.onDecodeCallback=A.onVideoDecode;var e=A.videoBufferSize||524288,t=A.streaming?JSMpeg.BitBuffer.MODE.EVICT:JSMpeg.BitBuffer.MODE.EXPAND;this.bits=new JSMpeg.BitBuffer(e,t),this.customIntraQuantMatrix=new Uint8Array(64),this.customNonIntraQuantMatrix=new Uint8Array(64),this.blockData=new Int32Array(64),this.currentFrame=0,this.decodeFirstFrame=!1!==A.decodeFirstFrame};return A.prototype=Object.create(JSMpeg.Decoder.Base.prototype),A.prototype.constructor=A,A.prototype.write=function(e,t){if(JSMpeg.Decoder.Base.prototype.write.call(this,e,t),!this.hasSequenceHeader){if(-1===this.bits.findStartCode(A.START.SEQUENCE))return!1;this.decodeSequenceHeader(),this.decodeFirstFrame&&this.decode()}},A.prototype.decode=function(){var e=JSMpeg.Now();if(!this.hasSequenceHeader)return!1;if(-1===this.bits.findStartCode(A.START.PICTURE)){this.bits.byteLength,this.bits.index;return!1}this.decodePicture(),this.advanceDecodedTime(1/this.frameRate);var t=JSMpeg.Now()-e;return this.onDecodeCallback&&this.onDecodeCallback(this,t),!0},A.prototype.readHuffman=function(A){var e=0;do{e=A[e+this.bits.read(1)]}while(e>=0&&0!==A[e]);return A[e+2]},A.prototype.frameRate=30,A.prototype.decodeSequenceHeader=function(){var e=this.bits.read(12),t=this.bits.read(12);if(this.bits.skip(4),this.frameRate=A.PICTURE_RATE[this.bits.read(4)],this.bits.skip(30),e===this.width&&t===this.height||(this.width=e,this.height=t,this.initBuffers(),this.destination&&this.destination.resize(e,t)),this.bits.read(1)){for(var o=0;o<64;o++)this.customIntraQuantMatrix[A.ZIG_ZAG[o]]=this.bits.read(8);this.intraQuantMatrix=this.customIntraQuantMatrix}if(this.bits.read(1)){for(o=0;o<64;o++){var i=A.ZIG_ZAG[o];this.customNonIntraQuantMatrix[i]=this.bits.read(8)}this.nonIntraQuantMatrix=this.customNonIntraQuantMatrix}this.hasSequenceHeader=!0},A.prototype.initBuffers=function(){this.intraQuantMatrix=A.DEFAULT_INTRA_QUANT_MATRIX,this.nonIntraQuantMatrix=A.DEFAULT_NON_INTRA_QUANT_MATRIX,this.mbWidth=this.width+15>>4,this.mbHeight=this.height+15>>4,this.mbSize=this.mbWidth*this.mbHeight,this.codedWidth=this.mbWidth<<4,this.codedHeight=this.mbHeight<<4,this.codedSize=this.codedWidth*this.codedHeight,this.halfWidth=this.mbWidth<<3,this.halfHeight=this.mbHeight<<3,this.currentY=new Uint8ClampedArray(this.codedSize),this.currentY32=new Uint32Array(this.currentY.buffer),this.currentCr=new Uint8ClampedArray(this.codedSize>>2),this.currentCr32=new Uint32Array(this.currentCr.buffer),this.currentCb=new Uint8ClampedArray(this.codedSize>>2),this.currentCb32=new Uint32Array(this.currentCb.buffer),this.forwardY=new Uint8ClampedArray(this.codedSize),this.forwardY32=new Uint32Array(this.forwardY.buffer),this.forwardCr=new Uint8ClampedArray(this.codedSize>>2),this.forwardCr32=new Uint32Array(this.forwardCr.buffer),this.forwardCb=new Uint8ClampedArray(this.codedSize>>2),this.forwardCb32=new Uint32Array(this.forwardCb.buffer)},A.prototype.currentY=null,A.prototype.currentCr=null,A.prototype.currentCb=null,A.prototype.pictureType=0,A.prototype.forwardY=null,A.prototype.forwardCr=null,A.prototype.forwardCb=null,A.prototype.fullPelForward=!1,A.prototype.forwardFCode=0,A.prototype.forwardRSize=0,A.prototype.forwardF=0,A.prototype.decodePicture=function(e){if(this.currentFrame++,this.bits.skip(10),this.pictureType=this.bits.read(3),this.bits.skip(16),!(this.pictureType<=0||this.pictureType>=A.PICTURE_TYPE.B)){if(this.pictureType===A.PICTURE_TYPE.PREDICTIVE){if(this.fullPelForward=this.bits.read(1),this.forwardFCode=this.bits.read(3),0===this.forwardFCode)return;this.forwardRSize=this.forwardFCode-1,this.forwardF=1<=A.START.SLICE_FIRST&&t<=A.START.SLICE_LAST)this.decodeSlice(255&t),t=this.bits.findNextStartCode();if(-1!==t&&this.bits.rewind(32),this.destination&&this.destination.render(this.currentY,this.currentCr,this.currentCb,!0),this.pictureType===A.PICTURE_TYPE.INTRA||this.pictureType===A.PICTURE_TYPE.PREDICTIVE){var o=this.forwardY,i=this.forwardY32,a=this.forwardCr,s=this.forwardCr32,r=this.forwardCb,n=this.forwardCb32;this.forwardY=this.currentY,this.forwardY32=this.currentY32,this.forwardCr=this.currentCr,this.forwardCr32=this.currentCr32,this.forwardCb=this.currentCb,this.forwardCb32=this.currentCb32,this.currentY=o,this.currentY32=i,this.currentCr=a,this.currentCr32=s,this.currentCb=r,this.currentCb32=n}}},A.prototype.quantizerScale=0,A.prototype.sliceBegin=!1,A.prototype.decodeSlice=function(A){this.sliceBegin=!0,this.macroblockAddress=(A-1)*this.mbWidth-1,this.motionFwH=this.motionFwHPrev=0,this.motionFwV=this.motionFwVPrev=0,this.dcPredictorY=128,this.dcPredictorCr=128,this.dcPredictorCb=128,this.quantizerScale=this.bits.read(5);while(this.bits.read(1))this.bits.skip(8);do{this.decodeMacroblock()}while(!this.bits.nextBytesAreStartCode())},A.prototype.macroblockAddress=0,A.prototype.mbRow=0,A.prototype.mbCol=0,A.prototype.macroblockType=0,A.prototype.macroblockIntra=!1,A.prototype.macroblockMotFw=!1,A.prototype.motionFwH=0,A.prototype.motionFwV=0,A.prototype.motionFwHPrev=0,A.prototype.motionFwVPrev=0,A.prototype.decodeMacroblock=function(){var e=0,t=this.readHuffman(A.MACROBLOCK_ADDRESS_INCREMENT);while(34===t)t=this.readHuffman(A.MACROBLOCK_ADDRESS_INCREMENT);while(35===t)e+=33,t=this.readHuffman(A.MACROBLOCK_ADDRESS_INCREMENT);if(e+=t,this.sliceBegin)this.sliceBegin=!1,this.macroblockAddress+=e;else{if(this.macroblockAddress+e>=this.mbSize)return;e>1&&(this.dcPredictorY=128,this.dcPredictorCr=128,this.dcPredictorCb=128,this.pictureType===A.PICTURE_TYPE.PREDICTIVE&&(this.motionFwH=this.motionFwHPrev=0,this.motionFwV=this.motionFwVPrev=0));while(e>1)this.macroblockAddress++,this.mbRow=this.macroblockAddress/this.mbWidth|0,this.mbCol=this.macroblockAddress%this.mbWidth,this.copyMacroblock(this.motionFwH,this.motionFwV,this.forwardY,this.forwardCr,this.forwardCb),e--;this.macroblockAddress++}this.mbRow=this.macroblockAddress/this.mbWidth|0,this.mbCol=this.macroblockAddress%this.mbWidth;var o=A.MACROBLOCK_TYPE[this.pictureType];this.macroblockType=this.readHuffman(o),this.macroblockIntra=1&this.macroblockType,this.macroblockMotFw=8&this.macroblockType,0!==(16&this.macroblockType)&&(this.quantizerScale=this.bits.read(5)),this.macroblockIntra?(this.motionFwH=this.motionFwHPrev=0,this.motionFwV=this.motionFwVPrev=0):(this.dcPredictorY=128,this.dcPredictorCr=128,this.dcPredictorCb=128,this.decodeMotionVectors(),this.copyMacroblock(this.motionFwH,this.motionFwV,this.forwardY,this.forwardCr,this.forwardCb));for(var i=0!==(2&this.macroblockType)?this.readHuffman(A.CODE_BLOCK_PATTERN):this.macroblockIntra?63:0,a=0,s=32;a<6;a++)0!==(i&s)&&this.decodeBlock(a),s>>=1},A.prototype.decodeMotionVectors=function(){var e,t,o=0;this.macroblockMotFw?(e=this.readHuffman(A.MOTION),0!==e&&1!==this.forwardF?(o=this.bits.read(this.forwardRSize),t=(Math.abs(e)-1<(this.forwardF<<4)-1?this.motionFwHPrev-=this.forwardF<<5:this.motionFwHPrev<-this.forwardF<<4&&(this.motionFwHPrev+=this.forwardF<<5),this.motionFwH=this.motionFwHPrev,this.fullPelForward&&(this.motionFwH<<=1),e=this.readHuffman(A.MOTION),0!==e&&1!==this.forwardF?(o=this.bits.read(this.forwardRSize),t=(Math.abs(e)-1<(this.forwardF<<4)-1?this.motionFwVPrev-=this.forwardF<<5:this.motionFwVPrev<-this.forwardF<<4&&(this.motionFwVPrev+=this.forwardF<<5),this.motionFwV=this.motionFwVPrev,this.fullPelForward&&(this.motionFwV<<=1)):this.pictureType===A.PICTURE_TYPE.PREDICTIVE&&(this.motionFwH=this.motionFwHPrev=0,this.motionFwV=this.motionFwVPrev=0)},A.prototype.copyMacroblock=function(A,e,t,o,i){var a,s,r,n,g,c,I,d,l,h,B,u,C,E,Q,p,m,f,y,w=this.currentY32,b=this.currentCb32,D=this.currentCr32;if(a=this.codedWidth,s=a-16,r=A>>1,n=e>>1,g=1===(1&A),c=1===(1&e),I=((this.mbRow<<4)+n)*a+(this.mbCol<<4)+r,d=this.mbRow*a+this.mbCol<<2,l=d+(a<<2),g)if(c)while(d>2&255,B=t[I]+t[I+a],I++,C|=B+u+2<<6&65280,u=t[I]+t[I+a],I++,C|=B+u+2<<14&16711680,B=t[I]+t[I+a],I++,C|=B+u+2<<22&4278190080,w[d++]=C;d+=s>>2,I+=s-1}else while(d>1&255,B=t[I++],C|=B+u+1<<7&65280,u=t[I++],C|=B+u+1<<15&16711680,B=t[I++],C|=B+u+1<<23&4278190080,w[d++]=C;d+=s>>2,I+=s-1}else if(c)while(d>1&255,I++,C|=t[I]+t[I+a]+1<<7&65280,I++,C|=t[I]+t[I+a]+1<<15&16711680,I++,C|=t[I]+t[I+a]+1<<23&4278190080,I++,w[d++]=C;d+=s>>2,I+=s}else while(d>2,I+=s}if(a=this.halfWidth,s=a-8,r=A/2>>1,n=e/2>>1,g=1===(A/2&1),c=1===(e/2&1),I=((this.mbRow<<3)+n)*a+(this.mbCol<<3)+r,d=this.mbRow*a+this.mbCol<<1,l=d+(a<<1),g)if(c)while(d>2&255,y=m+f+2>>2&255,E=o[I]+o[I+a],m=i[I]+i[I+a],I++,p|=E+Q+2<<6&65280,y|=m+f+2<<6&65280,Q=o[I]+o[I+a],f=i[I]+i[I+a],I++,p|=E+Q+2<<14&16711680,y|=m+f+2<<14&16711680,E=o[I]+o[I+a],m=i[I]+i[I+a],I++,p|=E+Q+2<<22&4278190080,y|=m+f+2<<22&4278190080,D[d]=p,b[d]=y,d++;d+=s>>2,I+=s-1}else while(d>1&255,y=m+f+1>>1&255,E=o[I],m=i[I++],p|=E+Q+1<<7&65280,y|=m+f+1<<7&65280,Q=o[I],f=i[I++],p|=E+Q+1<<15&16711680,y|=m+f+1<<15&16711680,E=o[I],m=i[I++],p|=E+Q+1<<23&4278190080,y|=m+f+1<<23&4278190080,D[d]=p,b[d]=y,d++;d+=s>>2,I+=s-1}else if(c)while(d>1&255,y=i[I]+i[I+a]+1>>1&255,I++,p|=o[I]+o[I+a]+1<<7&65280,y|=i[I]+i[I+a]+1<<7&65280,I++,p|=o[I]+o[I+a]+1<<15&16711680,y|=i[I]+i[I+a]+1<<15&16711680,I++,p|=o[I]+o[I+a]+1<<23&4278190080,y|=i[I]+i[I+a]+1<<23&4278190080,I++,D[d]=p,b[d]=y,d++;d+=s>>2,I+=s}else while(d>2,I+=s}},A.prototype.dcPredictorY=0,A.prototype.dcPredictorCr=0,A.prototype.dcPredictorCb=0,A.prototype.blockData=null,A.prototype.decodeBlock=function(e){var t,o=0;if(this.macroblockIntra){var i,a;if(e<4?(i=this.dcPredictorY,a=this.readHuffman(A.DCT_DC_SIZE_LUMINANCE)):(i=4===e?this.dcPredictorCr:this.dcPredictorCb,a=this.readHuffman(A.DCT_DC_SIZE_CHROMINANCE)),a>0){var s=this.bits.read(a);this.blockData[0]=0!==(s&1<0&&0===this.bits.read(1))break;65535===d?(I=this.bits.read(6),c=this.bits.read(8),0===c?c=this.bits.read(8):128===c?c=this.bits.read(8)-256:c>128&&(c-=256)):(I=d>>8,c=255&d,this.bits.read(1)&&(c=-c)),o+=I;var l=A.ZIG_ZAG[o];o++,c<<=1,this.macroblockIntra||(c+=c<0?-1:1),c=c*this.quantizerScale*t[l]>>4,0===(1&c)&&(c-=c>0?1:-1),c>2047?c=2047:c<-2048&&(c=-2048),this.blockData[l]=c*A.PREMULTIPLIER_MATRIX[l]}e<4?(r=this.currentY,g=this.codedWidth-8,n=this.mbRow*this.codedWidth+this.mbCol<<4,0!==(1&e)&&(n+=8),0!==(2&e)&&(n+=this.codedWidth<<3)):(r=4===e?this.currentCb:this.currentCr,g=(this.codedWidth>>1)-8,n=(this.mbRow*this.codedWidth<<2)+(this.mbCol<<3)),this.macroblockIntra?1===o?(A.CopyValueToDestination(this.blockData[0]+128>>8,r,n,g),this.blockData[0]=0):(A.IDCT(this.blockData),A.CopyBlockToDestination(this.blockData,r,n,g),JSMpeg.Fill(this.blockData,0)):1===o?(A.AddValueToDestination(this.blockData[0]+128>>8,r,n,g),this.blockData[0]=0):(A.IDCT(this.blockData),A.AddBlockToDestination(this.blockData,r,n,g),JSMpeg.Fill(this.blockData,0)),o=0},A.CopyBlockToDestination=function(A,e,t,o){for(var i=0;i<64;i+=8,t+=o+8)e[t+0]=A[i+0],e[t+1]=A[i+1],e[t+2]=A[i+2],e[t+3]=A[i+3],e[t+4]=A[i+4],e[t+5]=A[i+5],e[t+6]=A[i+6],e[t+7]=A[i+7]},A.AddBlockToDestination=function(A,e,t,o){for(var i=0;i<64;i+=8,t+=o+8)e[t+0]+=A[i+0],e[t+1]+=A[i+1],e[t+2]+=A[i+2],e[t+3]+=A[i+3],e[t+4]+=A[i+4],e[t+5]+=A[i+5],e[t+6]+=A[i+6],e[t+7]+=A[i+7]},A.CopyValueToDestination=function(A,e,t,o){for(var i=0;i<64;i+=8,t+=o+8)e[t+0]=A,e[t+1]=A,e[t+2]=A,e[t+3]=A,e[t+4]=A,e[t+5]=A,e[t+6]=A,e[t+7]=A},A.AddValueToDestination=function(A,e,t,o){for(var i=0;i<64;i+=8,t+=o+8)e[t+0]+=A,e[t+1]+=A,e[t+2]+=A,e[t+3]+=A,e[t+4]+=A,e[t+5]+=A,e[t+6]+=A,e[t+7]+=A},A.IDCT=function(A){for(var e,t,o,i,a,s,r,n,g,c,I,d,l,h,B,u,C,E,Q=0;Q<8;++Q)e=A[32+Q],t=A[16+Q]+A[48+Q],o=A[40+Q]-A[24+Q],s=A[8+Q]+A[56+Q],r=A[24+Q]+A[40+Q],i=A[8+Q]-A[56+Q],a=s+r,n=A[0+Q],l=(473*i-196*o+128>>8)-a,g=l-(362*(s-r)+128>>8),c=n-e,I=(362*(A[16+Q]-A[48+Q])+128>>8)-t,d=n+e,h=c+I,B=d+t,u=c-I,C=d-t,E=-g-(473*o+196*i+128>>8),A[0+Q]=a+B,A[8+Q]=l+h,A[16+Q]=u-g,A[24+Q]=C-E,A[32+Q]=C+E,A[40+Q]=g+u,A[48+Q]=h-l,A[56+Q]=B-a;for(Q=0;Q<64;Q+=8)e=A[4+Q],t=A[2+Q]+A[6+Q],o=A[5+Q]-A[3+Q],s=A[1+Q]+A[7+Q],r=A[3+Q]+A[5+Q],i=A[1+Q]-A[7+Q],a=s+r,n=A[0+Q],l=(473*i-196*o+128>>8)-a,g=l-(362*(s-r)+128>>8),c=n-e,I=(362*(A[2+Q]-A[6+Q])+128>>8)-t,d=n+e,h=c+I,B=d+t,u=c-I,C=d-t,E=-g-(473*o+196*i+128>>8),A[0+Q]=a+B+128>>8,A[1+Q]=l+h+128>>8,A[2+Q]=u-g+128>>8,A[3+Q]=C-E+128>>8,A[4+Q]=C+E+128>>8,A[5+Q]=g+u+128>>8,A[6+Q]=h-l+128>>8,A[7+Q]=B-a+128>>8},A.PICTURE_RATE=[0,23.976,24,25,29.97,30,50,59.94,60,0,0,0,0,0,0,0],A.ZIG_ZAG=new Uint8Array([0,1,8,16,9,2,3,10,17,24,32,25,18,11,4,5,12,19,26,33,40,48,41,34,27,20,13,6,7,14,21,28,35,42,49,56,57,50,43,36,29,22,15,23,30,37,44,51,58,59,52,45,38,31,39,46,53,60,61,54,47,55,62,63]),A.DEFAULT_INTRA_QUANT_MATRIX=new Uint8Array([8,16,19,22,26,27,29,34,16,16,22,24,27,29,34,37,19,22,26,27,29,34,34,38,22,22,26,27,29,34,37,40,22,26,27,29,32,35,40,48,26,27,29,32,35,40,48,58,26,27,29,34,38,46,56,69,27,29,35,38,46,56,69,83]),A.DEFAULT_NON_INTRA_QUANT_MATRIX=new Uint8Array([16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16]),A.PREMULTIPLIER_MATRIX=new Uint8Array([32,44,42,38,32,25,17,9,44,62,58,52,44,35,24,12,42,58,55,49,42,33,23,12,38,52,49,44,38,30,20,10,32,44,42,38,32,25,17,9,25,35,33,30,25,20,14,7,17,24,23,20,17,14,9,5,9,12,12,10,9,7,5,2]),A.MACROBLOCK_ADDRESS_INCREMENT=new Int16Array([3,6,0,9,12,0,0,0,1,15,18,0,21,24,0,27,30,0,33,36,0,0,0,3,0,0,2,39,42,0,45,48,0,0,0,5,0,0,4,51,54,0,57,60,0,0,0,7,0,0,6,63,66,0,69,72,0,75,78,0,81,84,0,-1,87,0,-1,90,0,93,96,0,99,102,0,105,108,0,111,114,0,0,0,9,0,0,8,117,120,0,123,126,0,129,132,0,135,138,0,0,0,15,0,0,14,0,0,13,0,0,12,0,0,11,0,0,10,141,-1,0,-1,144,0,147,150,0,153,156,0,159,162,0,165,168,0,171,174,0,177,180,0,183,-1,0,-1,186,0,189,192,0,195,198,0,201,204,0,207,210,0,213,216,0,219,222,0,0,0,21,0,0,20,0,0,19,0,0,18,0,0,17,0,0,16,0,0,35,0,0,34,0,0,33,0,0,32,0,0,31,0,0,30,0,0,29,0,0,28,0,0,27,0,0,26,0,0,25,0,0,24,0,0,23,0,0,22]),A.MACROBLOCK_TYPE_INTRA=new Int8Array([3,6,0,-1,9,0,0,0,1,0,0,17]),A.MACROBLOCK_TYPE_PREDICTIVE=new Int8Array([3,6,0,9,12,0,0,0,10,15,18,0,0,0,2,21,24,0,0,0,8,27,30,0,33,36,0,-1,39,0,0,0,18,0,0,26,0,0,1,0,0,17]),A.MACROBLOCK_TYPE_B=new Int8Array([3,6,0,9,15,0,12,18,0,24,21,0,0,0,12,27,30,0,0,0,14,39,42,0,36,33,0,0,0,4,0,0,6,54,48,0,45,51,0,0,0,8,0,0,10,-1,57,0,0,0,1,60,63,0,0,0,30,0,0,17,0,0,22,0,0,26]),A.MACROBLOCK_TYPE=[null,A.MACROBLOCK_TYPE_INTRA,A.MACROBLOCK_TYPE_PREDICTIVE,A.MACROBLOCK_TYPE_B],A.CODE_BLOCK_PATTERN=new Int16Array([6,3,0,9,18,0,12,15,0,24,33,0,36,39,0,27,21,0,30,42,0,60,57,0,54,48,0,69,51,0,81,75,0,63,84,0,45,66,0,72,78,0,0,0,60,105,120,0,132,144,0,114,108,0,126,141,0,87,93,0,117,96,0,0,0,32,135,138,0,99,123,0,129,102,0,0,0,4,90,111,0,0,0,8,0,0,16,0,0,44,150,168,0,0,0,28,0,0,52,0,0,62,183,177,0,156,180,0,0,0,1,165,162,0,0,0,61,0,0,56,171,174,0,0,0,2,0,0,40,153,186,0,0,0,48,192,189,0,147,159,0,0,0,20,0,0,12,240,249,0,0,0,63,231,225,0,195,219,0,252,198,0,0,0,24,0,0,36,0,0,3,207,261,0,243,237,0,204,213,0,210,234,0,201,228,0,216,222,0,258,255,0,264,246,0,-1,282,0,285,291,0,0,0,33,0,0,9,318,330,0,306,348,0,0,0,5,0,0,10,279,267,0,0,0,6,0,0,18,0,0,17,0,0,34,339,357,0,309,312,0,270,276,0,327,321,0,351,354,0,303,297,0,294,288,0,300,273,0,342,345,0,315,324,0,336,333,0,363,375,0,0,0,41,0,0,14,0,0,21,372,366,0,360,369,0,0,0,11,0,0,19,0,0,7,0,0,35,0,0,13,0,0,50,0,0,49,0,0,58,0,0,37,0,0,25,0,0,45,0,0,57,0,0,26,0,0,29,0,0,38,0,0,53,0,0,23,0,0,43,0,0,46,0,0,42,0,0,22,0,0,54,0,0,51,0,0,15,0,0,30,0,0,39,0,0,47,0,0,55,0,0,27,0,0,59,0,0,31]),A.MOTION=new Int16Array([3,6,0,12,9,0,0,0,0,18,15,0,24,21,0,0,0,-1,0,0,1,27,30,0,36,33,0,0,0,2,0,0,-2,42,45,0,48,39,0,60,54,0,0,0,3,0,0,-3,51,57,0,-1,69,0,81,75,0,78,63,0,72,66,0,96,84,0,87,93,0,-1,99,0,108,105,0,0,0,-4,90,102,0,0,0,4,0,0,-7,0,0,5,111,123,0,0,0,-5,0,0,7,114,120,0,126,117,0,0,0,-6,0,0,6,153,162,0,150,147,0,135,138,0,156,141,0,129,159,0,132,144,0,0,0,10,0,0,9,0,0,8,0,0,-8,171,198,0,0,0,-9,180,192,0,168,183,0,165,186,0,174,189,0,0,0,-10,177,195,0,0,0,12,0,0,16,0,0,13,0,0,14,0,0,11,0,0,15,0,0,-16,0,0,-12,0,0,-14,0,0,-15,0,0,-11,0,0,-13]),A.DCT_DC_SIZE_LUMINANCE=new Int8Array([6,3,0,18,15,0,9,12,0,0,0,1,0,0,2,27,24,0,21,30,0,0,0,0,36,33,0,0,0,4,0,0,3,39,42,0,0,0,5,0,0,6,48,45,0,51,-1,0,0,0,7,0,0,8]),A.DCT_DC_SIZE_CHROMINANCE=new Int8Array([6,3,0,12,9,0,18,15,0,24,21,0,0,0,2,0,0,1,0,0,0,30,27,0,0,0,3,36,33,0,0,0,4,42,39,0,0,0,5,48,45,0,0,0,6,51,-1,0,0,0,7,0,0,8]),A.DCT_COEFF=new Int32Array([3,6,0,12,9,0,0,0,1,21,24,0,18,15,0,39,27,0,33,30,0,42,36,0,0,0,257,60,66,0,54,63,0,48,57,0,0,0,513,51,45,0,0,0,2,0,0,3,81,75,0,87,93,0,72,78,0,96,90,0,0,0,1025,69,84,0,0,0,769,0,0,258,0,0,1793,0,0,65535,0,0,1537,111,108,0,0,0,1281,105,102,0,117,114,0,99,126,0,120,123,0,156,150,0,162,159,0,144,147,0,129,135,0,138,132,0,0,0,2049,0,0,4,0,0,514,0,0,2305,153,141,0,165,171,0,180,168,0,177,174,0,183,186,0,0,0,2561,0,0,3329,0,0,6,0,0,259,0,0,5,0,0,770,0,0,2817,0,0,3073,228,225,0,201,210,0,219,213,0,234,222,0,216,231,0,207,192,0,204,189,0,198,195,0,243,261,0,273,240,0,246,237,0,249,258,0,279,276,0,252,255,0,270,282,0,264,267,0,0,0,515,0,0,260,0,0,7,0,0,1026,0,0,1282,0,0,4097,0,0,3841,0,0,3585,315,321,0,333,342,0,312,291,0,375,357,0,288,294,0,-1,369,0,285,303,0,318,363,0,297,306,0,339,309,0,336,348,0,330,300,0,372,345,0,351,366,0,327,354,0,360,324,0,381,408,0,417,420,0,390,378,0,435,438,0,384,387,0,0,0,2050,396,402,0,465,462,0,0,0,8,411,399,0,429,432,0,453,414,0,426,423,0,0,0,10,0,0,9,0,0,11,0,0,5377,0,0,1538,0,0,771,0,0,5121,0,0,1794,0,0,4353,0,0,4609,0,0,4865,444,456,0,0,0,1027,459,450,0,0,0,261,393,405,0,0,0,516,447,441,0,516,519,0,486,474,0,510,483,0,504,498,0,471,537,0,507,501,0,522,513,0,534,531,0,468,477,0,492,495,0,549,546,0,525,528,0,0,0,263,0,0,2562,0,0,2306,0,0,5633,0,0,5889,0,0,6401,0,0,6145,0,0,1283,0,0,772,0,0,13,0,0,12,0,0,14,0,0,15,0,0,517,0,0,6657,0,0,262,540,543,0,480,489,0,588,597,0,0,0,27,609,555,0,606,603,0,0,0,19,0,0,22,591,621,0,0,0,18,573,576,0,564,570,0,0,0,20,552,582,0,0,0,21,558,579,0,0,0,23,612,594,0,0,0,25,0,0,24,600,615,0,0,0,31,0,0,30,0,0,28,0,0,29,0,0,26,0,0,17,0,0,16,567,618,0,561,585,0,654,633,0,0,0,37,645,648,0,0,0,36,630,636,0,0,0,34,639,627,0,663,666,0,657,624,0,651,642,0,669,660,0,0,0,35,0,0,267,0,0,40,0,0,268,0,0,266,0,0,32,0,0,264,0,0,265,0,0,38,0,0,269,0,0,270,0,0,33,0,0,39,0,0,7937,0,0,6913,0,0,7681,0,0,4098,0,0,7425,0,0,7169,0,0,271,0,0,274,0,0,273,0,0,272,0,0,1539,0,0,2818,0,0,3586,0,0,3330,0,0,3074,0,0,3842]),A.PICTURE_TYPE={INTRA:1,PREDICTIVE:2,B:3},A.START={SEQUENCE:179,SLICE_FIRST:1,SLICE_LAST:175,PICTURE:0,EXTENSION:181,USER_DATA:178},A}(),JSMpeg.Decoder.MPEG1VideoWASM=function(){"use strict";var A=function(A){JSMpeg.Decoder.Base.call(this,A),this.onDecodeCallback=A.onVideoDecode,this.module=A.wasmModule,this.bufferSize=A.videoBufferSize||524288,this.bufferMode=A.streaming?JSMpeg.BitBuffer.MODE.EVICT:JSMpeg.BitBuffer.MODE.EXPAND,this.decodeFirstFrame=!1!==A.decodeFirstFrame,this.hasSequenceHeader=!1};return A.prototype=Object.create(JSMpeg.Decoder.Base.prototype),A.prototype.constructor=A,A.prototype.initializeWasmDecoder=function(){this.module.instance?(this.instance=this.module.instance,this.functions=this.module.instance.exports,this.decoder=this.functions._mpeg1_decoder_create(this.bufferSize,this.bufferMode)):console.warn("JSMpeg: WASM module not compiled yet")},A.prototype.destroy=function(){this.decoder&&this.functions._mpeg1_decoder_destroy(this.decoder)},A.prototype.bufferGetIndex=function(){if(this.decoder)return this.functions._mpeg1_decoder_get_index(this.decoder)},A.prototype.bufferSetIndex=function(A){this.decoder&&this.functions._mpeg1_decoder_set_index(this.decoder,A)},A.prototype.bufferWrite=function(A){this.decoder||this.initializeWasmDecoder();for(var e=0,t=0;t>2)),r=this.instance.heapU8.subarray(i,i+(this.codedSize>>2));this.destination.render(a,s,r,!1)}this.advanceDecodedTime(1/this.frameRate);var n=JSMpeg.Now()-A;return this.onDecodeCallback&&this.onDecodeCallback(this,n),!0},A}(),JSMpeg.Decoder.MP2Audio=function(){"use strict";var A=function A(e){JSMpeg.Decoder.Base.call(this,e),this.onDecodeCallback=e.onAudioDecode;var t=e.audioBufferSize||131072,o=e.streaming?JSMpeg.BitBuffer.MODE.EVICT:JSMpeg.BitBuffer.MODE.EXPAND;this.bits=new JSMpeg.BitBuffer(t,o),this.left=new Float32Array(1152),this.right=new Float32Array(1152),this.sampleRate=44100,this.D=new Float32Array(1024),this.D.set(A.SYNTHESIS_WINDOW,0),this.D.set(A.SYNTHESIS_WINDOW,512),this.V=[new Float32Array(1024),new Float32Array(1024)],this.U=new Int32Array(32),this.VPos=0,this.allocation=[new Array(32),new Array(32)],this.scaleFactorInfo=[new Uint8Array(32),new Uint8Array(32)],this.scaleFactor=[new Array(32),new Array(32)],this.sample=[new Array(32),new Array(32)];for(var i=0;i<2;i++)for(var a=0;a<32;a++)this.scaleFactor[i][a]=[0,0,0],this.sample[i][a]=[0,0,0]};return A.prototype=Object.create(JSMpeg.Decoder.Base.prototype),A.prototype.constructor=A,A.prototype.decode=function(){var A=JSMpeg.Now(),e=this.bits.index>>3;if(e>=this.bits.byteLength)return!1;var t=this.decodeFrame(this.left,this.right);if(this.bits.index=e+t<<3,!t)return!1;this.destination&&this.destination.play(this.sampleRate,this.left,this.right),this.advanceDecodedTime(this.left.length/this.sampleRate);var o=JSMpeg.Now()-A;return this.onDecodeCallback&&this.onDecodeCallback(this,o),!0},A.prototype.getCurrentTime=function(){var A=this.destination?this.destination.enqueuedTime:0;return this.decodedTime-A},A.prototype.decodeFrame=function(e,t){var o=this.bits.read(11),i=this.bits.read(2),a=this.bits.read(2),s=!this.bits.read(1);if(o!==A.FRAME_SYNC||i!==A.VERSION.MPEG_1||a!==A.LAYER.II)return 0;var r=this.bits.read(4)-1;if(r>13)return 0;var n=this.bits.read(2),g=A.SAMPLE_RATE[n];if(3===n)return 0;i===A.VERSION.MPEG_2&&(n+=4,r+=14);var c=this.bits.read(1),I=(this.bits.read(1),this.bits.read(2)),d=0;I===A.MODE.JOINT_STEREO?d=this.bits.read(2)+1<<2:(this.bits.skip(2),d=I===A.MODE.MONO?0:32),this.bits.skip(4),s&&this.bits.skip(16);var l=A.BIT_RATE[r],h=(g=A.SAMPLE_RATE[n],144e3*l/g+c|0),B=0,u=0;if(i===A.VERSION.MPEG_2)B=2,u=30;else{var C=I===A.MODE.MONO?0:1,E=A.QUANT_LUT_STEP_1[C][r];B=A.QUANT_LUT_STEP_2[E][n],u=63&B,B>>=6}d>u&&(d=u);for(var Q=0;Q>1),k=this.VPos%128>>1;while(k<1024){for(var S=0;S<32;++S)this.U[S]+=this.D[v++]*this.V[m][k++];k+=96,v+=32}k=1120-k,v-=480;while(k<1024){for(S=0;S<32;++S)this.U[S]+=this.D[v++]*this.V[m][k++];k+=96,v+=32}for(var M=0===m?e:t,R=0;R<32;R++)M[y+R]=this.U[R]/2147418112}y+=32}}return this.sampleRate=g,h},A.prototype.readAllocation=function(e,t){var o=A.QUANT_LUT_STEP_3[t][e],i=A.QUANT_LUT_STEP4[15&o][this.bits.read(o>>4)];return i?A.QUANT_TAB[i-1]:0},A.prototype.readSamples=function(e,t,o){var i=this.allocation[e][t],a=this.scaleFactor[e][t][o],s=this.sample[e][t],r=0;if(i){if(63===a)a=0;else{var n=a/3|0;a=A.SCALEFACTOR_BASE[a%3]+(1<>1)>>n}var g=i.levels;i.group?(r=this.bits.read(i.bits),s[0]=r%g,r=r/g|0,s[1]=r%g,s[2]=r/g|0):(s[0]=this.bits.read(i.bits),s[1]=this.bits.read(i.bits),s[2]=this.bits.read(i.bits));var c=65536/(g+1)|0;g=(g+1>>1)-1,r=(g-s[0])*c,s[0]=r*(a>>12)+(r*(4095&a)+2048>>12)>>12,r=(g-s[1])*c,s[1]=r*(a>>12)+(r*(4095&a)+2048>>12)>>12,r=(g-s[2])*c,s[2]=r*(a>>12)+(r*(4095&a)+2048>>12)>>12}else s[0]=s[1]=s[2]=0},A.MatrixTransform=function(A,e,t,o){var i,a,s,r,n,g,c,I,d,l,h,B,u,C,E,Q,p,m,f,y,w,b,D,v,k,S,M,R,F,G,q,x,N;i=A[0][e]+A[31][e],a=.500602998235*(A[0][e]-A[31][e]),s=A[1][e]+A[30][e],r=.505470959898*(A[1][e]-A[30][e]),n=A[2][e]+A[29][e],g=.515447309923*(A[2][e]-A[29][e]),c=A[3][e]+A[28][e],I=.53104259109*(A[3][e]-A[28][e]),d=A[4][e]+A[27][e],l=.553103896034*(A[4][e]-A[27][e]),h=A[5][e]+A[26][e],B=.582934968206*(A[5][e]-A[26][e]),u=A[6][e]+A[25][e],C=.622504123036*(A[6][e]-A[25][e]),E=A[7][e]+A[24][e],Q=.674808341455*(A[7][e]-A[24][e]),p=A[8][e]+A[23][e],m=.744536271002*(A[8][e]-A[23][e]),f=A[9][e]+A[22][e],y=.839349645416*(A[9][e]-A[22][e]),w=A[10][e]+A[21][e],b=.972568237862*(A[10][e]-A[21][e]),D=A[11][e]+A[20][e],v=1.16943993343*(A[11][e]-A[20][e]),k=A[12][e]+A[19][e],S=1.48416461631*(A[12][e]-A[19][e]),M=A[13][e]+A[18][e],R=2.05778100995*(A[13][e]-A[18][e]),F=A[14][e]+A[17][e],G=3.40760841847*(A[14][e]-A[17][e]),q=A[15][e]+A[16][e],x=10.1900081235*(A[15][e]-A[16][e]),N=i+q,q=.502419286188*(i-q),i=s+F,F=.52249861494*(s-F),s=n+M,M=.566944034816*(n-M),n=c+k,k=.64682178336*(c-k),c=d+D,D=.788154623451*(d-D),d=h+w,w=1.06067768599*(h-w),h=u+f,f=1.72244709824*(u-f),u=E+p,p=5.10114861869*(E-p),E=N+u,u=.509795579104*(N-u),N=i+h,i=.601344886935*(i-h),h=s+d,d=.899976223136*(s-d),s=n+c,c=2.56291544774*(n-c),n=E+s,E=.541196100146*(E-s),s=N+h,h=1.30656296488*(N-h),N=n+s,n=.707106781187*(n-s),s=E+h,E=.707106781187*(E-h),s+=E,h=u+c,u=.541196100146*(u-c),c=i+d,d=1.30656296488*(i-d),i=h+c,c=.707106781187*(h-c),h=u+d,u=.707106781187*(u-d),h+=u,i+=h,h+=c,c+=u,d=q+p,q=.509795579104*(q-p),p=F+f,F=.601344886935*(F-f),f=M+w,w=.899976223136*(M-w),M=k+D,D=2.56291544774*(k-D),k=d+M,d=.541196100146*(d-M),M=p+f,f=1.30656296488*(p-f),p=k+M,M=.707106781187*(k-M),k=d+f,f=.707106781187*(d-f),k+=f,d=q+D,q=.541196100146*(q-D),D=F+w,w=1.30656296488*(F-w),F=d+D,D=.707106781187*(d-D),d=q+w,q=.707106781187*(q-w),d+=q,F+=d,d+=D,D+=q,p+=F,F+=k,k+=d,d+=M,M+=D,D+=f,f+=q,w=a+x,a=.502419286188*(a-x),x=r+G,r=.52249861494*(r-G),G=g+R,R=.566944034816*(g-R),g=I+S,I=.64682178336*(I-S),S=l+v,l=.788154623451*(l-v),v=B+b,b=1.06067768599*(B-b),B=C+y,y=1.72244709824*(C-y),C=Q+m,Q=5.10114861869*(Q-m),m=w+C,C=.509795579104*(w-C),w=x+B,x=.601344886935*(x-B),B=G+v,v=.899976223136*(G-v),G=g+S,S=2.56291544774*(g-S),g=m+G,m=.541196100146*(m-G),G=w+B,B=1.30656296488*(w-B),w=g+G,G=.707106781187*(g-G),g=m+B,B=.707106781187*(m-B),g+=B,m=C+S,S=.541196100146*(C-S),C=x+v,v=1.30656296488*(x-v),x=m+C,C=.707106781187*(m-C),m=S+v,v=.707106781187*(S-v),m+=v,x+=m,m+=C,S=C+v,C=a+Q,a=.509795579104*(a-Q),Q=r+y,r=.601344886935*(r-y),y=R+b,b=.899976223136*(R-b),R=I+l,l=2.56291544774*(I-l),I=C+R,C=.541196100146*(C-R),R=Q+y,y=1.30656296488*(Q-y),Q=I+R,R=.707106781187*(I-R),I=C+y,y=.707106781187*(C-y),I+=y,C=a+l,a=.541196100146*(a-l),l=r+b,b=1.30656296488*(r-b),r=C+l,l=.707106781187*(C-l),C=a+b,a=.707106781187*(a-b),C+=a,r+=C,C+=l,l+=a,Q+=r,r+=I,I+=C,C+=R,R+=l,l+=y,y+=a,w+=Q,Q+=x,x+=r,r+=g,g+=I,I+=m,m+=C,C+=G,G+=R,R+=S,S+=l,l+=B,B+=y,y+=v,v+=a,t[o+48]=-N,t[o+49]=t[o+47]=-w,t[o+50]=t[o+46]=-p,t[o+51]=t[o+45]=-Q,t[o+52]=t[o+44]=-i,t[o+53]=t[o+43]=-x,t[o+54]=t[o+42]=-F,t[o+55]=t[o+41]=-r,t[o+56]=t[o+40]=-s,t[o+57]=t[o+39]=-g,t[o+58]=t[o+38]=-k,t[o+59]=t[o+37]=-I,t[o+60]=t[o+36]=-h,t[o+61]=t[o+35]=-m,t[o+62]=t[o+34]=-d,t[o+63]=t[o+33]=-C,t[o+32]=-n,t[o+0]=n,t[o+31]=-G,t[o+1]=G,t[o+30]=-M,t[o+2]=M,t[o+29]=-R,t[o+3]=R,t[o+28]=-c,t[o+4]=c,t[o+27]=-S,t[o+5]=S,t[o+26]=-D,t[o+6]=D,t[o+25]=-l,t[o+7]=l,t[o+24]=-E,t[o+8]=E,t[o+23]=-B,t[o+9]=B,t[o+22]=-f,t[o+10]=f,t[o+21]=-y,t[o+11]=y,t[o+20]=-u,t[o+12]=u,t[o+19]=-v,t[o+13]=v,t[o+18]=-q,t[o+14]=q,t[o+17]=-a,t[o+15]=a,t[o+16]=0},A.FRAME_SYNC=2047,A.VERSION={MPEG_2_5:0,MPEG_2:2,MPEG_1:3},A.LAYER={III:1,II:2,I:3},A.MODE={STEREO:0,JOINT_STEREO:1,DUAL_CHANNEL:2,MONO:3},A.SAMPLE_RATE=new Uint16Array([44100,48e3,32e3,0,22050,24e3,16e3,0]),A.BIT_RATE=new Uint16Array([32,48,56,64,80,96,112,128,160,192,224,256,320,384,8,16,24,32,40,48,56,64,80,96,112,128,144,160]),A.SCALEFACTOR_BASE=new Uint32Array([33554432,26632170,21137968]),A.SYNTHESIS_WINDOW=new Float32Array([0,-.5,-.5,-.5,-.5,-.5,-.5,-1,-1,-1,-1,-1.5,-1.5,-2,-2,-2.5,-2.5,-3,-3.5,-3.5,-4,-4.5,-5,-5.5,-6.5,-7,-8,-8.5,-9.5,-10.5,-12,-13,-14.5,-15.5,-17.5,-19,-20.5,-22.5,-24.5,-26.5,-29,-31.5,-34,-36.5,-39.5,-42.5,-45.5,-48.5,-52,-55.5,-58.5,-62.5,-66,-69.5,-73.5,-77,-80.5,-84.5,-88,-91.5,-95,-98,-101,-104,106.5,109,111,112.5,113.5,114,114,113.5,112,110.5,107.5,104,100,94.5,88.5,81.5,73,63.5,53,41.5,28.5,14.5,-1,-18,-36,-55.5,-76.5,-98.5,-122,-147,-173.5,-200.5,-229.5,-259.5,-290.5,-322.5,-355.5,-389.5,-424,-459.5,-495.5,-532,-568.5,-605,-641.5,-678,-714,-749,-783.5,-817,-849,-879.5,-908.5,-935,-959.5,-981,-1000.5,-1016,-1028.5,-1037.5,-1042.5,-1043.5,-1040,-1031.5,1018.5,1e3,976,946.5,911,869.5,822,767.5,707,640,565.5,485,397,302.5,201,92.5,-22.5,-144,-272.5,-407,-547.5,-694,-846,-1003,-1165,-1331.5,-1502,-1675.5,-1852.5,-2031.5,-2212.5,-2394,-2576.5,-2758.5,-2939.5,-3118.5,-3294.5,-3467.5,-3635.5,-3798.5,-3955,-4104.5,-4245.5,-4377.5,-4499,-4609.5,-4708,-4792.5,-4863.5,-4919,-4958,-4979.5,-4983,-4967.5,-4931.5,-4875,-4796,-4694.5,-4569.5,-4420,-4246,-4046,-3820,-3567,3287,2979.5,2644,2280.5,1888,1467.5,1018.5,541,35,-499,-1061,-1650,-2266.5,-2909,-3577,-4270,-4987.5,-5727.5,-6490,-7274,-8077.5,-8899.5,-9739,-10594.5,-11464.5,-12347,-13241,-14144.5,-15056,-15973.5,-16895.5,-17820,-18744.5,-19668,-20588,-21503,-22410.5,-23308.5,-24195,-25068.5,-25926.5,-26767,-27589,-28389,-29166.5,-29919,-30644.5,-31342,-32009.5,-32645,-33247,-33814.5,-34346,-34839.5,-35295,-35710,-36084.5,-36417.5,-36707.5,-36954,-37156.5,-37315,-37428,-37496,37519,37496,37428,37315,37156.5,36954,36707.5,36417.5,36084.5,35710,35295,34839.5,34346,33814.5,33247,32645,32009.5,31342,30644.5,29919,29166.5,28389,27589,26767,25926.5,25068.5,24195,23308.5,22410.5,21503,20588,19668,18744.5,17820,16895.5,15973.5,15056,14144.5,13241,12347,11464.5,10594.5,9739,8899.5,8077.5,7274,6490,5727.5,4987.5,4270,3577,2909,2266.5,1650,1061,499,-35,-541,-1018.5,-1467.5,-1888,-2280.5,-2644,-2979.5,3287,3567,3820,4046,4246,4420,4569.5,4694.5,4796,4875,4931.5,4967.5,4983,4979.5,4958,4919,4863.5,4792.5,4708,4609.5,4499,4377.5,4245.5,4104.5,3955,3798.5,3635.5,3467.5,3294.5,3118.5,2939.5,2758.5,2576.5,2394,2212.5,2031.5,1852.5,1675.5,1502,1331.5,1165,1003,846,694,547.5,407,272.5,144,22.5,-92.5,-201,-302.5,-397,-485,-565.5,-640,-707,-767.5,-822,-869.5,-911,-946.5,-976,-1e3,1018.5,1031.5,1040,1043.5,1042.5,1037.5,1028.5,1016,1000.5,981,959.5,935,908.5,879.5,849,817,783.5,749,714,678,641.5,605,568.5,532,495.5,459.5,424,389.5,355.5,322.5,290.5,259.5,229.5,200.5,173.5,147,122,98.5,76.5,55.5,36,18,1,-14.5,-28.5,-41.5,-53,-63.5,-73,-81.5,-88.5,-94.5,-100,-104,-107.5,-110.5,-112,-113.5,-114,-114,-113.5,-112.5,-111,-109,106.5,104,101,98,95,91.5,88,84.5,80.5,77,73.5,69.5,66,62.5,58.5,55.5,52,48.5,45.5,42.5,39.5,36.5,34,31.5,29,26.5,24.5,22.5,20.5,19,17.5,15.5,14.5,13,12,10.5,9.5,8.5,8,7,6.5,5.5,5,4.5,4,3.5,3.5,3,2.5,2.5,2,2,1.5,1.5,1,1,1,1,.5,.5,.5,.5,.5,.5]),A.QUANT_LUT_STEP_1=[[0,0,1,1,1,2,2,2,2,2,2,2,2,2],[0,0,0,0,0,0,1,1,1,2,2,2,2,2]],A.QUANT_TAB={A:91,B:94,C:8,D:12},A.QUANT_LUT_STEP_2=[[A.QUANT_TAB.C,A.QUANT_TAB.C,A.QUANT_TAB.D],[A.QUANT_TAB.A,A.QUANT_TAB.A,A.QUANT_TAB.A],[A.QUANT_TAB.B,A.QUANT_TAB.A,A.QUANT_TAB.B]],A.QUANT_LUT_STEP_3=[[68,68,52,52,52,52,52,52,52,52,52,52],[67,67,67,66,66,66,66,66,66,66,66,49,49,49,49,49,49,49,49,49,49,49,49,32,32,32,32,32,32,32],[69,69,69,69,52,52,52,52,52,52,52,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36,36]],A.QUANT_LUT_STEP4=[[0,1,2,17],[0,1,2,3,4,5,6,17],[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,17],[0,1,3,5,6,7,8,9,10,11,12,13,14,15,16,17],[0,1,2,4,5,6,7,8,9,10,11,12,13,14,15,17],[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15]],A.QUANT_TAB=[{levels:3,group:1,bits:5},{levels:5,group:1,bits:7},{levels:7,group:0,bits:3},{levels:9,group:1,bits:10},{levels:15,group:0,bits:4},{levels:31,group:0,bits:5},{levels:63,group:0,bits:6},{levels:127,group:0,bits:7},{levels:255,group:0,bits:8},{levels:511,group:0,bits:9},{levels:1023,group:0,bits:10},{levels:2047,group:0,bits:11},{levels:4095,group:0,bits:12},{levels:8191,group:0,bits:13},{levels:16383,group:0,bits:14},{levels:32767,group:0,bits:15},{levels:65535,group:0,bits:16}],A}(),JSMpeg.Decoder.MP2AudioWASM=function(){"use strict";var A=function(A){JSMpeg.Decoder.Base.call(this,A),this.onDecodeCallback=A.onAudioDecode,this.module=A.wasmModule,this.bufferSize=A.audioBufferSize||131072,this.bufferMode=A.streaming?JSMpeg.BitBuffer.MODE.EVICT:JSMpeg.BitBuffer.MODE.EXPAND,this.sampleRate=0};return A.prototype=Object.create(JSMpeg.Decoder.Base.prototype),A.prototype.constructor=A,A.prototype.initializeWasmDecoder=function(){this.module.instance?(this.instance=this.module.instance,this.functions=this.module.instance.exports,this.decoder=this.functions._mp2_decoder_create(this.bufferSize,this.bufferMode)):console.warn("JSMpeg: WASM module not compiled yet")},A.prototype.destroy=function(){this.decoder&&this.functions._mp2_decoder_destroy(this.decoder)},A.prototype.bufferGetIndex=function(){if(this.decoder)return this.functions._mp2_decoder_get_index(this.decoder)},A.prototype.bufferSetIndex=function(A){this.decoder&&this.functions._mp2_decoder_set_index(this.decoder,A)},A.prototype.bufferWrite=function(A){this.decoder||this.initializeWasmDecoder();for(var e=0,t=0;t>4<<4;this.gl.viewport(0,0,t,this.height)},A.prototype.createTexture=function(A,e){var t=this.gl,o=t.createTexture();return t.bindTexture(t.TEXTURE_2D,o),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),t.uniform1i(t.getUniformLocation(this.program,e),A),o},A.prototype.createProgram=function(A,e){var t=this.gl,o=t.createProgram();return t.attachShader(o,this.compileShader(t.VERTEX_SHADER,A)),t.attachShader(o,this.compileShader(t.FRAGMENT_SHADER,e)),t.linkProgram(o),t.useProgram(o),o},A.prototype.compileShader=function(A,e){var t=this.gl,o=t.createShader(A);if(t.shaderSource(o,e),t.compileShader(o),!t.getShaderParameter(o,t.COMPILE_STATUS))throw new Error(t.getShaderInfoLog(o));return o},A.prototype.allowsClampedTextureData=function(){var A=this.gl,e=A.createTexture();return A.bindTexture(A.TEXTURE_2D,e),A.texImage2D(A.TEXTURE_2D,0,A.LUMINANCE,1,1,0,A.LUMINANCE,A.UNSIGNED_BYTE,new Uint8ClampedArray([0])),0===A.getError()},A.prototype.renderProgress=function(A){var e=this.gl;e.useProgram(this.loadingProgram);var t=e.getUniformLocation(this.loadingProgram,"progress");e.uniform1f(t,A),e.drawArrays(e.TRIANGLE_STRIP,0,4)},A.prototype.render=function(A,e,t,o){if(this.enabled){var i=this.gl,a=this.width+15>>4<<4,s=this.height,r=a>>1,n=s>>1;o&&this.shouldCreateUnclampedViews&&(A=new Uint8Array(A.buffer),e=new Uint8Array(e.buffer),t=new Uint8Array(t.buffer)),i.useProgram(this.program),this.updateTexture(i.TEXTURE0,this.textureY,a,s,A),this.updateTexture(i.TEXTURE1,this.textureCb,r,n,e),this.updateTexture(i.TEXTURE2,this.textureCr,r,n,t),i.drawArrays(i.TRIANGLE_STRIP,0,4)}},A.prototype.updateTexture=function(A,e,t,o,i){var a=this.gl;a.activeTexture(A),a.bindTexture(a.TEXTURE_2D,e),this.hasTextureData[A]?a.texSubImage2D(a.TEXTURE_2D,0,0,0,t,o,a.LUMINANCE,a.UNSIGNED_BYTE,i):(this.hasTextureData[A]=!0,a.texImage2D(a.TEXTURE_2D,0,a.LUMINANCE,t,o,0,a.LUMINANCE,a.UNSIGNED_BYTE,i))},A.prototype.deleteTexture=function(A,e){var t=this.gl;t.activeTexture(A),t.bindTexture(t.TEXTURE_2D,null),t.deleteTexture(e)},A.IsSupported=function(){try{if(!window.WebGLRenderingContext)return!1;var A=document.createElement("canvas");return!(!A.getContext("webgl")&&!A.getContext("experimental-webgl"))}catch(err){return!1}},A.SHADER={FRAGMENT_YCRCB_TO_RGBA:["precision mediump float;","uniform sampler2D textureY;","uniform sampler2D textureCb;","uniform sampler2D textureCr;","varying vec2 texCoord;","mat4 rec601 = mat4(","1.16438, 0.00000, 1.59603, -0.87079,","1.16438, -0.39176, -0.81297, 0.52959,","1.16438, 2.01723, 0.00000, -1.08139,","0, 0, 0, 1",");","void main() {","float y = texture2D(textureY, texCoord).r;","float cb = texture2D(textureCb, texCoord).r;","float cr = texture2D(textureCr, texCoord).r;","gl_FragColor = vec4(y, cr, cb, 1.0) * rec601;","}"].join("\n"),FRAGMENT_LOADING:["precision mediump float;","uniform float progress;","varying vec2 texCoord;","void main() {","float c = ceil(progress-(1.0-texCoord.y));","gl_FragColor = vec4(c,c,c,1);","}"].join("\n"),VERTEX_IDENTITY:["attribute vec2 vertex;","varying vec2 texCoord;","void main() {","texCoord = vertex;","gl_Position = vec4((vertex * 2.0 - 1.0) * vec2(1, -1), 0.0, 1.0);","}"].join("\n")},A}(),JSMpeg.Renderer.Canvas2D=function(){"use strict";var A=function(A){this.canvas=A.canvas||document.createElement("canvas"),this.width=this.canvas.width,this.height=this.canvas.height,this.enabled=!0,this.context=this.canvas.getContext("2d")};return A.prototype.destroy=function(){},A.prototype.resize=function(A,e){this.width=0|A,this.height=0|e,this.canvas.width=this.width,this.canvas.height=this.height,this.imageData=this.context.getImageData(0,0,this.width,this.height),JSMpeg.Fill(this.imageData.data,255)},A.prototype.renderProgress=function(A){var e=this.canvas.width,t=this.canvas.height,o=this.context;o.fillStyle="#222",o.fillRect(0,0,e,t),o.fillStyle="#fff",o.fillRect(0,t-t*A,e,t*A)},A.prototype.render=function(A,e,t){this.YCbCrToRGBA(A,e,t,this.imageData.data),this.context.putImageData(this.imageData,0,0)},A.prototype.YCbCrToRGBA=function(A,e,t,o){if(this.enabled)for(var i,a,s,r,n,g=this.width+15>>4<<4,c=g>>1,I=0,d=g,l=g+(g-this.width),h=0,B=c-(this.width>>1),u=0,C=4*this.width,E=4*this.width,Q=this.width>>1,p=this.height>>1,m=0;m>8)-179,r=(88*a>>8)-44+(183*i>>8)-91,n=a+(198*a>>8)-227;var y=A[I++],w=A[I++];o[u]=y+s,o[u+1]=y-r,o[u+2]=y+n,o[u+4]=w+s,o[u+5]=w-r,o[u+6]=w+n,u+=8;var b=A[d++],D=A[d++];o[C]=b+s,o[C+1]=b-r,o[C+2]=b+n,o[C+4]=D+s,o[C+5]=D-r,o[C+6]=D+n,C+=8}I+=l,d+=l,u+=E,C+=E,h+=B}},A}(),JSMpeg.AudioOutput.WebAudio=function(){"use strict";var A=function A(e){this.context=A.CachedContext=A.CachedContext||new(window.AudioContext||window.webkitAudioContext),this.gain=this.context.createGain(),this.destination=this.gain,this.gain.connect(this.context.destination),this.context._connections=(this.context._connections||0)+1,this.startTime=0,this.buffer=null,this.wallclockStartTime=0,this.volume=1,this.enabled=!0,this.unlocked=!A.NeedsUnlocking(),Object.defineProperty(this,"enqueuedTime",{get:this.getEnqueuedTime})};return A.prototype.destroy=function(){this.gain.disconnect(),this.context._connections--,0===this.context._connections&&(this.context.close(),A.CachedContext=null)},A.prototype.play=function(A,e,t){if(this.enabled){if(!this.unlocked){var o=JSMpeg.Now();return this.wallclockStartTimethis.memory.buffer.byteLength){var t=this.brk-this.memory.buffer.byteLength,o=Math.ceil(t/this.pageSize);this.memory.grow(o),this.createHeapViews()}return e},A.prototype.c_abort=function(A){console.warn("JSMPeg: WASM abort",arguments)},A.prototype.c_assertFail=function(A){console.warn("JSMPeg: WASM ___assert_fail",arguments)},A.prototype.readDylinkSection=function(A){var e=new Uint8Array(A),t=0,o=function(){var A=0,o=1;while(1){var i=e[t++];if(A+=(127&i)*o,o*=128,!(128&i))return A}},i=function(A){for(var o=0;o