/* IPCamLive.com Player JavaScript Library v5.1.0 * http://ipcamlive.com/ * * Copyright (c) 2017 IPCamLive Inc. * * Example: * $(window).load(function() { * ipcamliveplayer.embed('mediadiv', '5464ada2be598'); * }); * * Params: * - HTML element ID * - Camera alias * * OR * * $(window).load(function() { * ipcamliveplayer.embed('mediadiv', '5464ada2be598', {autoplay: false, mute: false, disablefullscreen: false, disablevideofit: false, disableframecapture: false, timelapseplayerenabled: true, disabledownloadbutton: false}); * }); * *
* * NOTE: Do not forger to adjust the height based on the ASPECT RATIO of the video stream! * NOTE: When your DIV has been resized, you have to update IPCamLive player using ipcamliveplayer.resize() method! * * Required libraries: * jquery 1.9.0+ * */var VIDEO_LOGOPOS_TL="lefttop",VIDEO_LOGOPOS_TR="righttop",VIDEO_LOGOPOS_BL="leftbottom",VIDEO_LOGOPOS_BR="rightbottom",DO_NOT_USE_MSE_HLS_PLAYER=!1,DO_NOT_USE_MSE_WS_PLAYER=!0,NATIVE_TEST_WITH_MP4=!1,EMULATE_MOBILE_MODE=!1;1==EMULATE_MOBILE_MODE&&console.log("Emulate mobile device enabled! DO NOT RELEASE THIS!"); var iserverhost="http://player.ipcamlive.com/",ipcamlivehelper=new function(){this.addErrorText=function(b,a,c){c?$("#"+b).html('
'+ a+'
'):$("#"+b).html('
'+a+"
")};this.getPosByID=function(b){switch(b){case "TL":return VIDEO_LOGOPOS_TL;case "TR":return VIDEO_LOGOPOS_TR;case "BL":return VIDEO_LOGOPOS_BL;case "BR":return VIDEO_LOGOPOS_BR;default:return VIDEO_LOGOPOS_BL}};this.createTimeout=function(b,a){var c=setTimeout(b,a);return{cancel:function(){clearTimeout(c)}, trigger:function(){clearTimeout(c);return b()}}}},AABB={collide:function(b,a){b=b.getBoundingClientRect();a=a.getBoundingClientRect();return!(b.top>a.bottom||b.righta.right)},inside:function(b,a){b=b.getBoundingClientRect();a=a.getBoundingClientRect();return a.top<=b.top&&b.top<=a.bottom&&a.top<=b.bottom&&b.bottom<=a.bottom&&a.left<=b.left&&b.left<=a.right&&a.left<=b.right&&b.right<=a.right}},dependencyhelper=new function(){var b=window,a=document,c=navigator,d=[]; this.toInt=function(a){return parseInt(a,10)};this.detectFlashParams=function(){var e="undefined"!==typeof a.getElementById&&"undefined"!==typeof a.getElementsByTagName&&"undefined"!==typeof a.createElement,d=c.userAgent.toLowerCase(),p=c.platform.toLowerCase(),k=p?/win/.test(p):/win/.test(d);p=p?/mac/.test(p):/mac/.test(d);d=/webkit/.test(d)?parseFloat(d.replace(/^.*webkit\/(\d+(\.\d+)?).*$/,"$1")):!1;var q="Microsoft Internet Explorer"===c.appName,f=[0,0,0],h=null;if("undefined"!==typeof c.plugins&& "object"===typeof c.plugins["Shockwave Flash"])(h=c.plugins["Shockwave Flash"].description)&&"undefined"!==typeof c.mimeTypes&&c.mimeTypes["application/x-shockwave-flash"]&&c.mimeTypes["application/x-shockwave-flash"].enabledPlugin&&(plugin=!0,q=!1,h=h.replace(/^.*\s+(\S+\s+\S+$)/,"$1"),f[0]=this.toInt(h.replace(/^(.*)\..*$/,"$1")),f[1]=this.toInt(h.replace(/^.*\.(.*)\s.*$/,"$1")),f[2]=/[a-zA-Z]/.test(h)?this.toInt(h.replace(/^.*[a-zA-Z]+(.*)$/,"$1")):0);else if("undefined"!==typeof b.ActiveXObject)try{if(h= (new ActiveXObject("ShockwaveFlash.ShockwaveFlash")).GetVariable("$version"))q=!0,h=h.split(" ")[1].split(","),f=[this.toInt(h[0]),this.toInt(h[1]),this.toInt(h[2])]}catch(D){}return{w3:e,pv:f,wk:d,ie:q,win:k,mac:p}};this.hasFlashPlayerVersionLocal=function(a){a+="";var b=this.detectFlashParams().pv;a=a.split(".");a[0]=this.toInt(a[0]);a[1]=this.toInt(a[1])||0;a[2]=this.toInt(a[2])||0;return b[0]>a[0]||b[0]==a[0]&&b[1]>a[1]||b[0]==a[0]&&b[1]==a[1]&&b[2]>=a[2]?!0:!1};this.isAllCSSLoaded=function(){return 0=== d.length?!1:1===d[0].state};this.load_item=function(a,b,c){for(i=0;i=c[a-1].width&&b<=c[a].width?(b-c[a-1].width)/(c[a].width-c[a-1].width):0};this.calcWeightY=function(b,a,c){return b>=c[a-1].height&&b<=c[a].height?(b-c[a-1].height)/(c[a].height-c[a-1].height):0};this.selectLevelForPlayerSize=function(b,a,c){targetLevel=-1;for(i=0;i wX&&.2>wY&&--targetLevel):-1==targetLevel&&(targetLevel=c.length-1);browserhelper.log("\tDetect Level for size: "+b+"x"+a+"; Result: "+targetLevel);return targetLevel};this.selectLevelForScreenSize=function(b){return 0=b||c[i].height>=a)return i;return c.length-1}},captureFrameHelper=new function(){this.isSupported=function(){return/Edge/i.test(navigator.userAgent)||is.safari()?!1:browserhelper.isMobileBrowser()?!1:!0};this.fillDateStr=function(b){return 1');$("#"+a+"_connectingimg").hide();$("#"+a+"_connectingimg").on("load",function(){var b= $(this).width(),c=$(this).height(),f=$("#"+a).width();c=($("#"+a).height()-c)/2;b=(f-b)/2;$("#"+a+"_connectingimg").offset({top:c,left:b});$("#"+a+"_connectingimg").show()})},y=function(){var a="";try{a=window.location.hostname}catch(m){}return a},t=function(b){var m=y();setTimeout(function(){$.get(iserverhost+"player/getcamerastreamstate.php",{_:$.now(),token:h,alias:c,targetdomain:m,getstreaminfo:1},function(c){1==c.details.streamavailable?(r=c.details.streamid,p=c.details.address,k=p+"streams/"+ r+"/stream.m3u8",q=p+"streams/"+r+"/snapshot.jpg",e=c.details.servicetype,d.audioenabled=c.details.audioenabled,d.timelapseenabledoncamera=c.details.timelapseenabled,1==c.details.logoenabled&&(d.logo=iserverhost+"resources/logos/"+c.details.logofilename,d.logopos=ipcamlivehelper.getPosByID(c.details.logopos)),1==c.details.forceautostop&&(d.autostopaftersec="300"),1==c.details.blockautoplay&&(d.autoplay=0),"undefined"!=typeof c.streaminfo&&"undefined"!=typeof c.streaminfo.live&&3<=c.streaminfo.live.segmentcount? (d.levels=c.streaminfo.live.levels,C()):(w("buffering.gif"),z(b+45E3))):"undefined"!=typeof c.details.cameracannotbeembedded&&c.details.cameracannotbeembedded?"undefined"!=typeof c.details.tokenexpired&&c.details.tokenexpired?ipcamlivehelper.addErrorText(a,"Token expired. Please reload the page.",0):"undefined"!=typeof c.details.cameracannotbeembedded_nsp&&c.details.cameracannotbeembedded_nsp?ipcamlivehelper.addErrorText(a,"This camera cannot be embedded. Switch to Standard or Professional package for embedding.", 0):"undefined"!=typeof c.details.cameracannotbeembedded_itd&&c.details.cameracannotbeembedded_itd?ipcamlivehelper.addErrorText(a,"This camera cannot be embedded on this domain.",0):ipcamlivehelper.addErrorText(a,"This camera cannot be embedded.",0):1==c.details.operationtimewindowenabled&&1!=c.details.operationtimewindowactive?ipcamlivehelper.addErrorText(a,"Camera is currently turned off",1):(f+=1E3,fa-m.get_controlBarHeight()-h,1==y&&(g=m.get_controlBarTop()-e-h));$("#"+f+"_logo").offset({top:g,left:b});$("#"+f+"_logo").width(c).height(e);$("#"+f+"_logo").show();$("#"+f+"_logo").css("opacity",1)}}else browserhelper.log("Invalid logo params:"+b+"x"+a+", "+t+"x"+z),null==J&&(J=window.setTimeout(function(){J=null;d()},1E3))}}function e(){B&&B()}function r(){if(void 0==E||1==w||void 0==v)d();else{w=!0;v.append('');var a=$("#"+f+"_logo");a.css("opacity",0);a.css("pointer-events","none");a.on("load",function(){t=$(this).width();z=$(this).height();browserhelper.isMobileBrowser()&&(t/=A,z/=A);d(1)}).attr("src",a.attr("src"))}}function p(a){var b=$("#"+f+"_videoplayer");a.target==b[0]&&(r(),window.removeEventListener("playing",p))}function k(a,b,c){return a.hasOwnProperty(b)?a[b]:c}function q(r,n,q,t){h=n;f=r;D=q;if(n.hasOwnProperty("source")){r= browserhelper.isMobileBrowser();levels=void 0;forceMSEplayer=!1;n.hasOwnProperty("levels")&&(levels=n.levels);A=window.devicePixelRatio;1==r&&1');v=$("#"+f+"_ipc_ic");v.append("');$("#"+f+"_videoplayer").bind("play",function(){void 0!=G&&(I=setTimeout(function(){a()},1E3*G));null!=K&&K()});$("#"+f+"_videoplayer").bind("pause", function(){null!=I&&(clearTimeout(I),I=null);null!=H&&H()});$("#"+f).width();var B=$("#"+f).height();1==L?(l.playerType=ipc_html5_controls.PlayerTypeWS,F=new ipc_websocket_html5_controls,m=F.attachVideoPlayer(g,l,c)):browserhelper.isNativeHLSSupported()&&0==forceMSEplayer||1==q?0==browserhelper.isSafariMobile()?(l.playerType=ipc_html5_controls.PlayerTypeNative,m=new ipc_html5_controls,m.ipc_attachVideoControls(l),browserhelper.isInlineSupportedOnIPhone()&&(q=$("#"+f+"_videoplayer"),q.attr("playsinline", "true"))):(browserhelper.log("This is safari mobile, ui disabled."),q=$("#"+f+"_videoplayer"),q.attr("poster",l.posterURL),q.attr("controls","true")):(l.playerType=ipc_html5_controls.PlayerTypeMSE,F=new ipc_hls_html5_controls,m=F.attachVideoPlayer(g,l));void 0!=m&&(t&&m.set_autoStartAfterPlayerVisibleAgain(),m.set_onControlBarMove(function(a,b){C&&C(a,m.get_controlBarTop());a=$("#"+f+"_logo");if(0!=a.length){if(0==y)if(b=25/A,y=c+z>B-m.get_controlBarHeight()-b,1==y){var c=m.get_controlBarTop()-a.height()- b;a.offset({top:c})}else return;u!=VIDEO_LOGOPOS_TL&&u!=VIDEO_LOGOPOS_TR&&void 0!=a[0]&&(c=m.get_controlBarTop()-a.height()-25/A,$("#"+f+"_logo").offset({top:c}))}}));if(n.onControlsCreated)n.onControlsCreated(m)}}var f,h,D,g,E,u,w=!1,y=!1,t=0,z=0,x=!1,B,C,G,A,F,m,v,I=null,J=null,K=null,H=null,L=!1,N=!1;this.player=function(a,b,c){q(a,b,c,!0)};this.resize=function(){d()};this.setEvents=function(a,b){K=a;H=b};this.setOnControlBarUpdateEvent=function(a){C=a};this.setOnFitChangeEvent=function(a){B=a}; this.start=function(){m.doVisibilityChange(!0,0)};this.stop=function(){return m.doVisibilityChange(!1,0)};this.setSource=function(a,b,c){1==w&&($("#"+f+"_logo").remove(),z=t=0,w=y=!1);m.setSource(a,b,c)};this.getVideoPlayer=function(){return $("#"+f+"_videoplayer")};this.getServerAddress=function(){return h.address};this.getInnerContainerId=function(){return f+"_ipc_ic"};this.getControls=function(){return m};$(window).resize(function(){d()})} function iflashvideo(){function b(){q=!0;a()}function a(){if(0==q)dependencyhelper.load_js(iserverhost+"player/swfobject.js",b);else{var a=e.source,h="https:"===location.protocol?"skin_https.xml":"skin.xml";$("#"+d).width();$("#"+d).height();var k="MediaPlayer.swf";e.hasOwnProperty("hidelink")&&e.hidelink&&(k="MediaPlayer_DL.swf");var g="HLSPlugin.swf";e.hasOwnProperty("debug")&&e.debug&&(g="HLSPlugin_Debug.swf");a={src:a,autoPlay:"false",plugin_hls:iserverhost+"player/"+g,hls_fragmentloadmaxretry:"2", hls_live_flushurlcache:"true",skin:iserverhost+"player/"+h,javascriptCallbackFunction:"onJavaScriptBridgeCreated"};e.hasOwnProperty("poster")&&(a.poster=e.poster);e.hasOwnProperty("autoplay")&&(a.autoPlay=e.autoplay?"true":"false");e.hasOwnProperty("logo")&&(a.logo=e.logo);e.hasOwnProperty("logopos")&&(a.logoPosition=e.logopos);e.hasOwnProperty("autostopaftersec")&&(a.autoStopAfterSec=e.autostopaftersec);e.hasOwnProperty("mute")&&e.mute&&(a.muted="true");e.hasOwnProperty("hidelink")&&(a.hideLinksInContextMenu= e.hidelink);e.hasOwnProperty("debug")&&e.debug&&(a.hls_debug="true",a.hls_debug2="true");h="direct";is.firefox()&&e.hasOwnProperty("ffrendermode")&&e.ffrendermode&&(browserhelper.log("Firefox render mode set to: "+e.ffrendermode),"window"===e.ffrendermode||"transparent"===e.ffrendermode||"opaque"===e.ffrendermode||"gpu"===e.ffrendermode)&&(h=e.ffrendermode);$("#"+d).html('
');swfobject.embedSWF(iserverhost+"player/"+ k,"flashVideoPlayer","100%","100%","10.1.0","",a,{allowFullScreen:"true",wmode:h,allowScriptAccess:"always"},{id:"flashVideoPlayer",name:"flashVideoPlayer"});null==p&&("undefined"!==typeof document.hidden?(r="hidden",p="visibilitychange"):"undefined"!==typeof document.mozHidden?(r="mozHidden",p="mozvisibilitychange"):"undefined"!==typeof document.msHidden?(r="msHidden",p="msvisibilitychange"):"undefined"!==typeof document.webkitHidden&&(r="webkitHidden",p="webkitvisibilitychange"),"undefined"!==typeof document.addEventListener&& "undefined"!==typeof document[r]&&document.addEventListener(p,c,!1))}}function c(){null!=k&&(window.clearInterval(k),k=null);document[r]&&(k=window.setInterval(function(){browserhelper.log("STOP FLASH");window.clearInterval(k);k=null;swfobject.removeSWF("flashVideoPlayer");a()},1E4))}var d,e,r=null,p=null,k=null,q=!1;this.player=function(b,c){d=b;e=c;c.hasOwnProperty("source")&&a()};this.resize=function(){var a=$("#"+d).width(),b=$("#"+d).height();$("#"+d+"_videoplayer").width(a).height(b)};this.setEvents= function(a,b){};this.start=function(){};this.stop=function(){swfobject.removeSWF("flashVideoPlayer");a()}}; var $jscomp=$jscomp||{};$jscomp.scope={};$jscomp.findInternal=function(c,b,d){c instanceof String&&(c=String(c));for(var a=c.length,e=0;e')},createMenu:function(b,d){var a=d.className;c.each(d.theme.split(","),function(b,c){a+=" "+d.themePrefix+c});for(var e=c("
").click(function(){d.hide(); return!1}),f=c(""),k=c(""),g=c('
'),h=0;h').click(function(b){return a.isItemDisabled(this)?!1:e.onclick.call(a.target,this,a,b)}).hover(function(){e.hoverItem.call(this,a.isItemDisabled(this)?a.disabledItemHoverClassName:e.hoverClassName)},function(){e.hoverItemOut.call(this,a.isItemDisabled(this)?a.disabledItemHoverClassName:e.hoverClassName)}); b=c('
'+b+"
");d.append(b);return d},createSeparator:function(){return c('
')},isItemDisabled:function(b){return c(b).is("."+this.disabledItemClassName)},hoverItem:function(b){c(this).addClass(b)},hoverItemOut:function(b){c(this).removeClass(b)},createShadow:function(b){b.shadowObj=c('
').css({display:"none",position:"absolute",zIndex:9998,opacity:b.shadowOpacity, backgroundColor:b.shadowColor});c(b.appendTo).append(b.shadowObj)},showShadow:function(b,c,a){if(this.shadow)this.shadowObj.css({width:this.menu.width()+this.shadowWidthAdjust+"px",height:this.menu.height()+this.shadowHeightAdjust+"px",top:c+this.shadowOffsetY+"px",left:b+this.shadowOffsetX+"px"}).addClass(this.shadowClass)[this.showTransition](this.showSpeed)},beforeShow:function(){return!0},show:function(b,d){var a=this,e=d.pageX,f=d.pageY;a.target=b;!1!==a.beforeShow()&&(a.menuFunction&&(a.menu&& c(a.menu).remove(),a.menu=a.createMenu(a.menuFunction(a,b),a),a.menu.css({display:"none"}),c(a.appendTo).append(a.menu)),b=a.menu,e+=a.offsetX,f+=a.offsetY,e=a.getPosition(e,f,a,d),a.showShadow(e.x,e.y,d),a.useIframe&&b.find("iframe").css({width:b.width()+a.shadowOffsetX+a.shadowWidthAdjust,height:b.height()+a.shadowOffsetY+a.shadowHeightAdjust}),b.css({top:e.y+"px",left:e.x+"px",position:"absolute",zIndex:9999})[a.showTransition](a.showSpeed,a.showCallback?function(){a.showCallback.call(a)}:null), ipc_contextMenuShown=a.shown=!0,c(document).one("click",null,function(){a.hide()}))},getPosition:function(b,d,a,e){b+=a.offsetX;d+=a.offsetY;e=c(a.menu).height();var f=c(a.menu).width(),k=a.direction;if(a.constrainToScreen){var g=c(window),h=g.height();a=g.width();"down"==k&&d+e-g.scrollTop()>h&&(k="up");f=b+f-g.scrollLeft();f>a&&(b-=f-a)}"up"==k&&(d-=e);return{x:b,y:d}},hide:function(){var b=this;if(b.shown){b.iframe&&c(b.iframe).hide();if(b.menu)b.menu[b.hideTransition](b.hideSpeed,b.hideCallback? function(){b.hideCallback.call(b)}:null);if(b.shadow)b.shadowObj[b.hideTransition](b.hideSpeed)}ipc_contextMenuShown=b.shown=!1},destroy:function(){this.hide();this.shadow&&this.shadowObj.remove();this.menu&&this.menu.remove()}};c.fn.contextMenu=function(b,d){var a=c.contextMenu.create(b,d);this.each(function(){c(this).bind("contextmenu",function(b){a.show(this,b);return!1})});return a}})(jQuery); function ipc_hls_html5_controls(){function l(){0==dependencyhelper.isAllCSSLoaded()?setTimeout(l,100):Hls.isSupported()&&(a=new Hls({debug:!1,autoStartLoad:!1,liveSyncDurationCount:2,liveMaxLatencyDurationCount:3}),a.attachMedia(d[0]),a.on(Hls.Events.VIDEO_ERROR,function(a,c){if(null!=b.onHide)b.onHide()}),a.on(Hls.Events.FRAG_PARSING_ERROR,function(a,c){if(null!=b.onHide)b.onHide()}),a.on(Hls.Events.MANIFEST_PARSED,function(b,c){try{1c.length)){log="Player Size: ["+d.width()+" x "+d.height()+"]; Levels =";for(i=0;i')}else e=g(a,"progressDiv","progress"),ba(e,"bufferBar"),ba(e,"timeBar");e=g(a,"btmControl");p(e,"btnPlay",["btnPlay","controlBtn"],"Play/Pause video");if(0==c.disableFullScreen){var f= ca()?"Toggle full screen":"Full screen is unavailable";p(e,"btnFS",["btnFS","controlBtn"],f)}1==t&&p(e,"btnFit",["btnFit","controlBtn"],"Toggle video fit mode");0==c.disableDownloadButton&&p(e,"btnDownload",["btnDownload","controlBtn"],"Download timelapse video");1==c.snapShotEnabled&&p(e,"snapShot",["snapShot","controlBtn"],"Download snapshot image");1==c.enableReportButton&&p(e,"btnReport",["btnReport","controlBtn"],"Report inappropriate content");1==c.audioEnabled&&(f=g(e,"volume",void 0,"Change volume"), ba(f,"volumeBar"),p(e,"btnSound",["btnSound","controlBtn"],"Mute/Unmute sound"));1==c.isLiveMode?g(a,"liveText",void 0,void 0,"LIVE"):(g(a,"timeText",void 0,void 0,"0.0/0.0"),0==c.isMobile&&0==c.hideSpeedButton&&(g(a,"playbackBtn",void 0,"Change playback speed","1x"),Sa()));p(a,"hdIcon",["hdIcon","controlBtn"],"HD Stream");a=g(h,"loadingSpinnerContainer");g(a,"loadingSpinner");void 0!=c.title&&(a=g(h,"titleBar","control"),g(a,"titleText",void 0,void 0,c.title));c.isLiveMode||Ta();Ua(1);d.on("play", va);d.on("pause",da);if(c.isMobile)d.on("touchend",Q);else d.on("click",Q);d.on("ended",wa);d.on("canplay",xa);d.on("loadedmetadata",ya);d.on("playing",za);d.on("waiting",Aa);window.addEventListener("resize",u);Va();Wa();Xa();Ya();Za();$a();ab();c.isMobile||bb();c.isMobile&&c.isLiveMode&&(x=32,b("control").css("height",x+"px"));b("control").show().css({bottom:-x});y();void 0!=c.title&&(b("titleBar").show().css({top:0}),b("titleBar").css("height","40px"),b("titleBar").show());"undefined"!==typeof document.hidden? (z="hidden",v="visibilitychange"):"undefined"!==typeof document.mozHidden?(z="mozHidden",v="mozvisibilitychange"):"undefined"!==typeof document.msHidden?(z="msHidden",v="msvisibilitychange"):"undefined"!==typeof document.webkitHidden&&(z="webkitHidden",v="webkitvisibilitychange");"undefined"!==typeof document.addEventListener&&"undefined"!==typeof document[z]&&document.addEventListener(v,Ba,!1);1==d[0].autoplay&&""!=c.source?ea():1==c.playonscroll.playonscroll&&0==c.isMobile&&cb()}function Ca(){R(); null!=k&&(window.clearInterval(k),k=null);A();S();b("control").remove();b("bigPlay").remove();b("loadingSpinnerContainer").remove();b("playbackSpeedsDiv").remove();void 0!=c.title&&b("titleBar").remove();h.off("mousemove",Da);d.off("play",va);d.off("pause",da);c.isMobile?d.off("touchend",Q):d.off("click",Q);d.off("ended",wa);d.off("canplay",xa);d.off("loadedmetadata",ya);d.off("loadstart",db);d.off("playing",za);d.off("waiting",Aa);window.removeEventListener("resize",u);document.removeEventListener(v, Ba);null!=fa&&fa.destroy();B=!1;1==l&&(l=!1,Ea())}function cb(){$(window).scroll(function(){d.is(":in-viewport")?(S(),null==C&&d[0].paused&&(T=!1,D(!0,c.playonscroll.playonscrollstopdelay,c.playonscroll.playonscrolldelay))):(A(),null==E&&0==d[0].paused&&D(!1,c.playonscroll.playonscrollstopdelay,c.playonscroll.playonscrolldelay))})}function bb(){switch(c.playerType){case ipc_html5_controls.PlayerTypeNative:var a=1==c.hideLink?{"HTML5 Player (Native)":{disabled:!0}}:{"IPCamLive HTML5 Player (Native)":{disabled:!0}}; var e=[{"ipcamlive.com":function(a,e){window.open("https://ipcamlive.com")}},$.contextMenu.separator,a,{"Live Streaming for IP Cameras":{disabled:!0}},$.contextMenu.separator,{"Report inappropriate content":function(a,e){U()}}];break;case ipc_html5_controls.PlayerTypeMSE:a=1==c.hideLink?{"HTML5 Player (MSE)":{disabled:!0}}:{"IPCamLive HTML5 Player (MSE)":{disabled:!0}};e=[{"ipcamlive.com":function(a,e){window.open("https://ipcamlive.com")}},$.contextMenu.separator,a,{"Live Streaming for IP Cameras":{disabled:!0}}, $.contextMenu.separator,{"Report inappropriate content":function(a,e){U()}}];break;case ipc_html5_controls.PlayerTypeWS:a=1==c.hideLink?{"HTML5 Player (WebSocket)":{disabled:!0}}:{"IPCamLive HTML5 Player (WebSocket)":{disabled:!0}},e=[{"ipcamlive.com":function(a,e){window.open("https://ipcamlive.com")}},$.contextMenu.separator,a,{"Live Streaming for IP Cameras":{disabled:!0}},$.contextMenu.separator,{"Report inappropriate content":function(a,e){U()}}]}1==c.hideLink&&(e.shift(),e.shift());0==c.enableReportButton&& (e.pop(),e.pop());$(function(){fa=h.contextMenu(e,{theme:"vista"})})}function Sa(){for(var a=g(h,"playbackSpeedsDiv"),e=b("playbackBtn"),f=F.length-1;0<=f;f--)a.append('
'+F[f]+"x
"),b("pbBtn"+f).on("click",function(){var a=this.getAttribute("data-index");e.text(F[a]+"x");d[0].playbackRate=F[a];ha()});e.hover(function(){a.css("width",$(".playbacSpeedBtn").width()+"px");a.css("height",F.length*$(".playbacSpeedBtn").height()+ "px");var e=b("playbackBtn").position().left,c=b("control").position().top,d=b("playbackBtn").width(),f=a.width(),g=a.height();a.css("left",e+d/2-f/2+"px");a.css("top",c-g+"px");Fa()},function(){G=setTimeout(ha,50)});a.hover(function(){Fa()},function(){G=setTimeout(ha,50)})}function Da(){d[0].paused||q(3E3)}function ya(){u();setTimeout(Ga,150);c.isMobile||(h.hover(function(){d[0].paused||q(3E3)},function(){H||V(!1)}),h.on("mousemove",Da),b("control").hover(function(){I=!0},function(){I=!1}))}function va(){W= !0;b("btnPlay").addClass("paused");b("bigPlay")[0].style.opacity=1;b("bigPlay").hide();J=!1}function da(){0==J?(b("bigPlay").removeClass("bigPlaySelected"),b("bigPlay").show(),ia(),R()):J=!1}function xa(){}function wa(){b("btnPlay").removeClass("paused");d[0].pause()}function Q(a){a&&"select"!=a.target.localName&&a.preventDefault();void 0!=ja&&1==ja(this)||1==ipc_contextMenuShown||K()||(b("bigPlay").is(":visible")?b("bigPlay").click():c.isMobile?(d[0].paused&&d[0].play(),X?V(!1):q(3E3)):(J=!0,w(), q(3E3)))}function db(){w();q(3E3)}function za(){W=!0;u()}function Aa(){W=!1}function Xa(){b("bigPlay").on("click",function(a,e){K()&&void 0==e||(A(),1!=ipc_contextMenuShown&&(void 0!=c.onFirstPlay&&null!=c.onFirstPlay&&(c.onFirstPlay(),c.onFirstPlay=null),b("bigPlay").addClass("bigPlaySelected"),w(Ha),q(3E3)))});b("bigPlay").hover(function(){K()||b("bigPlay").addClass("bigPlaySelected")},function(){K()||b("bigPlay").removeClass("bigPlaySelected")});b("btnPlay").on("click",function(){K()||(J=!0,w())}); 1==ka?Ia():Ja();u()}function u(){if(0!=d[0].clientWidth){var a=.25*d[0].clientWidth;150a&&(a=30);var e=a/2.3;spin=b("loadingSpinnerContainer");spin.css("left",d[0].clientWidth/2-a/2+"px");spin.css("top",d[0].clientHeight/2-e/2+"px");spin.css("width",a+"px");spin.css("height",e+"px");120d[0].clientWidth? a.hide():a.show();y();null!=r&&r();1==t&&0==c.disableVideoFit&&(a=d[0].videoWidth,e=d[0].videoHeight,0==a&&(a=la),0==e&&(e=ma),0!=a||0!=a)&&(a/=e,.01Math.abs(a-d[0].clientWidth/d[0].clientHeight)?(0==B&&0==l&&na(),B=!0):(1==B&&1==l&&na(),B=!1))}}function ca(){return void 0!=document.webkitFullscreenEnabled?document.webkitFullscreenEnabled:void 0!=document.mozFullscreenEnabled?document.mozFullscreenEnabled:void 0!= document.msFullscreenEnabled?document.msFullscreenEnabled:void 0!=document.fullscreenEnabled?document.fullscreenEnabled:!0}function Ka(){ca()&&(document.webkitFullscreenElement||document.mozFullscreenElement||document.msFullscreenElement||document.fullscreenElement?b("btnFS").addClass("exitFS"):b("btnFS").removeClass("exitFS"))}function Va(){ca()?(Ka(),b("btnFS").click(function(){if($.isFunction(m[0].webkitRequestFullScreen))null==document.webkitFullscreenElement?m[0].webkitRequestFullScreen():document.webkitCancelFullScreen(); else if($.isFunction(m[0].mozRequestFullScreen))null==document.mozFullscreenElement?m[0].mozRequestFullScreen():document.mozCancelFullScreen();else if($.isFunction(m[0].msRequestFullscreen))null==document.msFullscreenElement?m[0].msRequestFullscreen():document.msExitFullscreen();else if($.isFunction(m[0].requestFullScreen))null==document.fullscreenElement?m[0].requestFullScreen():document.cancelFullScreen();else if($.isFunction(d[0].webkitEnterFullScreen))0==d[0].webkitDisplayingFullscreen?d[0].webkitEnterFullScreen(): d[0].webkitCancelFullScreen();else{alert("Your browsers doesn't support fullscreen");return}n();if(is.safari()&&c.onUpdate)c.onUpdate(0)}),document.addEventListener("fullscreenchange",Y),document.addEventListener("webkitfullscreenchange",Y),document.addEventListener("mozfullscreenchange",Y),document.addEventListener("MSFullscreenChange",Y)):(b("btnFS").removeClass("controlBtn"),b("btnFS").removeClass("btnFS"),b("btnFS").addClass("disabledFS"))}function Y(){Ka()}function ab(){var a=new Image;a.onload= function(){la=a.width;ma=a.height;browserhelper.log("PosterSize: "+la+"x"+ma);u();1==d[0].paused&&d[0].setAttribute("poster",c.posterURL)};a.src=c.posterURL}function Ea(){0!=t&&(l?(b("btnFit").addClass("exitFit"),d.css("object-fit","fill")):(b("btnFit").removeClass("exitFit"),d.css("object-fit","contain")))}function na(){0!=t&&(l=!l,Ea())}function Wa(){l=!1;0==t&&0==c.disableVideoFit?browserhelper.log("Video Fit not supported!"):(b("btnFit").hide(),b("btnFit").hide(),b("btnFit").click(function(){na(); n();if(c.onUpdate)c.onUpdate();if(c.onFitChange)c.onFitChange(l)}))}function Ya(){if(0!=c.snapShotEnabled){var a=b("snapShot");a.show();a.click(function(){n();captureFrameHelper.captureFrame(d[0],"SnapShot")})}}function Za(){if(0!=c.enableReportButton){var a=b("btnReport");a.show();a.click(function(){n();U()})}}function U(){void 0!=c.cameraAlias&&(console.log("Report inappropriate content: https://ipcamlive.com/reportabuse?alias="+c.cameraAlias),window.open("https://ipcamlive.com/reportabuse?alias="+ c.cameraAlias))}function $a(){if(1!=c.disableDownloadButton){var a=b("btnDownload");a.show();a.click(function(a){n();var e=d[0].src;a=document.createElement("a");var b="";void 0!=c.cameraAlias&&(b=c.cameraAlias);void 0!=L&&""!=L&&(""!=b&&(b+="_"),b+=L.toLowerCase());""==b&&(b="video");b+=".mp4";a.setAttribute("href",e);a.setAttribute("target","_blank");a.setAttribute("download",b);document.createEvent?(e=document.createEvent("MouseEvents"),e.initEvent("click",!0,!0),a.dispatchEvent(e)):a.click&&a.click()})}} function w(a){d[0].paused||d[0].ended?(b("btnPlay").addClass("paused"),void 0!=a&&0!=a||d[0].play(),ea()):(b("btnPlay").removeClass("paused"),d[0].pause(),R());c.isLiveMode&&(d[0].paused?b("liveText").text("PAUSED"):b("liveText").text("LIVE"))}function y(){var a=b("control");void 0!=a&&a.offset()&&(La=a.offset().top)}function q(a){X||(X=!0,b("control").stop().animate({bottom:0},{duration:500,step:function(a,b){y();null!=r&&r(a,b)}}),void 0!=c.title&&b("titleBar").stop().animate({top:0},{duration:500})); null!=k&&(window.clearInterval(k),k=null);0");return b(e)}function p(a,e,d,g){var f=' class="';for(i=0;i');return b(e)}function ba(a, b,d){void 0==d?a.append("'):a.append("')}function A(){null!=C&&(window.clearInterval(C),C=null)}function S(){null!=E&&(window.clearInterval(E),E=null)}function D(a,e,f){A();S();if(!c.isReembedAvailable||0!=c.isReembedAvailable())if(!a)T=d[0].paused,E=window.setInterval(function(){S();d[0].paused||(browserhelper.log("Stop playing due player is invisible."),w());if(0!=c.isLiveMode&& (1==d[0].autoplay&&d[0].removeAttribute("autoplay"),V(!0),da(),0==T&&c.onHide))c.onHide()},e);else if(qa&&d[0].paused&&0==T&&!browserhelper.isMobileBrowser())browserhelper.log("Start playing due player is visible again."),b("bigPlay").show(),b("bigPlay").fadeOut(f),C=window.setInterval(function(){A();b("bigPlay").trigger("click",["force"]);if(c.onShow)c.onShow(!0)},f);else if(qa&&d[0].paused&&c.onShow)c.onShow(!1)}function Ba(a){D("hidden"!==document.visibilityState,1E4,2E3)}function eb(){ua()}function Ua(a){b("volume").on("mousedown", function(a){H=!0;d[0].muted=!1;O(a.pageX);n()});$(document).on("mouseup",function(a){H&&(H=!1,O(a.pageX),n())});$(document).on("mousemove",function(a){H&&(O(a.pageX),n())});b("btnSound").click(function(){d[0].muted=!d[0].muted;b("btnSound").removeClass("sound").removeClass("sound2").addClass("muted");d[0].muted?b("volumeBar").css("width",0):O(0,d[0].volume);n()});O(0,a)}function O(a,c){var e=b("volume");a=c?100*c:100*(a-e.offset().left)/e.width();100a&&(a=0);b("volumeBar").css("width", a+"%");d[0].volume=a/100;0==d[0].volume?b("btnSound").removeClass("sound").removeClass("sound2").addClass("muted"):.5a&&(a=0);b("#timeBar").css("width",a+"%");d[0].currentTime=f*a/100}function Ga(){if(0!=d[0].buffered.length){var a=d[0].duration,c=d[0].buffered.end(0),f=100*c/a;b("bufferBar").css("width",f+"%");cMath.floor(a/60)?"0"+Math.floor(a/60):Math.floor(a/ 60);a=10>Math.floor(a-60*b)?"0"+Math.floor(a-60*b):Math.floor(a-60*b);return isNaN(b)||isNaN(a)?"":b+":"+a}function K(){return b("bigPlay").length?1>b("bigPlay")[0].style.opacity?!0:!1:!0}function Ia(){b("bigPlay")[0].style.opacity=.5}function Ja(){b("bigPlay").removeClass("bigPlaySelected");b("bigPlay")[0].style.opacity=1}var c=null,d=null,h=null,m=null,l=!1,J=!1,x=28,La=0,t=!0,fa=null,ka=!1,B=!1,P=!1,W=!1,L=void 0,Ha=!1,ja=void 0,la=0,ma=0,sa=0,ta=0,k=null,X=!1,I=!1,F=[.5,1,1.5,2],G=null,z=null, v=null,E=null,C=null,r=null,T=!1,qa=!1,aa=null,Z=!1,N=0,M=0,pa=!1,H=!1;this.ipc_attachVideoControls=function(a){c={};$.extend(c,a);a=browserhelper.isMobileBrowser();c.snapShotEnabled=c.snapshotEnabled&&captureFrameHelper.isSupported();c.audioEnabled=c.audioEnabled&&c.isLiveMode;c.disableDownloadButton=c.disableDownloadButton||a||1==c.isLiveMode;d=$("#"+c.videoTag);m=h=$("#"+c.videoContainerTag);pa=is.chrome()&&a&&57==parseInt(platform.version);1==pa&&browserhelper.log("Chrome 57 on mobile detected. Video.currentTime property is broken, use workaround."); dependencyhelper.preload_image(iserverhost+"player/html5player/images/bigPlay_S.png");dependencyhelper.load_css(iserverhost+"player/html5player/ipcamliveplayer.css",eb)};this.ipc_detachVideoControls=function(){Ca()};this.doPlay=function(){w(!1)};this.getClass=function(a){return a};this.hidePlay=function(){b("bigPlay").length?Ia():ka=!0};this.showPlay=function(){ka=!1;b("bigPlay").length&&Ja()};this.showLoadingSpinner=function(){ea()};this.get_video=function(){return d};this.get_isVideoFit=function(){return l}; this.get_controlBarTop=function(){y();return La};this.get_controlBarHeight=function(){return x};this.set_onControlBarMove=function(a){r=a};this.set_HDState=function(a){var c=b("hdIcon");1==a?c.show():c.hide()};this.set_showLiveResolution=function(a){if(0!=c.isLiveMode)if(1==a)d.on("timeupdate",function(){if(0==ta||1E3<=Date.now()-ta)ta=Date.now(),sa!=d[0].videoHeight&&(sa=d[0].videoHeight,b("liveText").text("LIVE ("+sa+"p)"))});else d.off("timeupdate")};this.set_doNotStartOnBigPlay=function(){Ha= !0};this.set_autoStartAfterPlayerVisibleAgain=function(){qa=!0};this.set_onFirstPlay=function(a){c.onFirstPlay=a};this.doVisibilityChange=function(a,b){if(a)return D(a,b,2E3),!0;if(d[0].paused)return!1;D(a,b,2E3);return!0};this.setSource=function(a,b,f){Ca();c.source=a;c.posterURL=b;ua();d[0].src=a;L=f};this.setSourceName=function(a){L=a};this.overrideFullscreenElement=function(a){m=a};this.setDiscardClickEvent=function(a){ja=a}}ipc_html5_controls.PlayerTypeNative=1; ipc_html5_controls.PlayerTypeMSE=2;ipc_html5_controls.PlayerTypeWS=3; (function(g,k){"function"===typeof define&&define.amd?define(function(){return g.is=k()}):"object"===typeof exports?module.exports=k():g.is=k()})(this,function(){function g(b){return function(){return!b.apply(null,l.call(arguments))}}function k(b){return function(){var c=l.call(arguments),e=c.length;1===e&&a.array(c[0])&&(c=c[0],e=c.length);for(var d=0;db||32===b):!1};a.equal=function(b,c){return a.all.number(b,c)?b===c&&1/b===1/c:a.all.string(b,c)||a.all.regexp(b,c)?""+b===""+c:a.all.boolean(b,c)?b===c:!1};a.equal.api=["not"];a.even=function(b){return a.number(b)&&0===b%2};a.odd=function(b){return a.number(b)&&1===b%2};a.positive=function(b){return a.number(b)&&0b};a.above=function(b,c){return a.all.number(b,c)&&b>c};a.above.api=["not"];a.under=function(b,c){return a.all.number(b,c)&&bc&&bc&&bb[c+1])return!1;return!0};(function(){var b=a,c;for(c in b)if(m.call(b,c)&&a.function(b[c]))for(var e=b[c].api|| ["not","all","any"],d=0;d").css({width:"100%"}),d.append(e),d=d.width()-e.width(),e.remove()),h.scrollBarWidth=d,p-=h.scrollBarWidth);c.tolerance=~~Math.round(parseFloat(c.tolerance));0>c.tolerance&&(c.tolerance=n+c.tolerance);return 0>= g||k>=p?m:m=c.tolerance?a<=c.tolerance&&l>=c.tolerance:0=J}},"es6","es3"); var htmlEditHelper=new function(){this.setContainerName=function(a){sourceContainerName=a};this.getID=function(a){return sourceContainerName+"_"+a};this.getElem=function(a){return $("#"+this.getID(a))};this.createDiv=function(a,c,d,e,f){a=""};this.createStyledDiv=function(a,c,d,e,f){a=""};this.htmlDiv=function(a,c,d,e,f){d=this.createDiv(a,c,d,e,f);a&&a.html(d);return this.getElem(c)};this.htmlStyledDiv=function(a,c,d,e,f){d=this.createStyledDiv(a,c,d,e,f);a&&a.html(d);return this.getElem(c)};this.appendDiv=function(a,c,d,e,f){d=this.createDiv(a,c,d,e,f);a&&a.append(d);return this.getElem(c)};this.appendStyledDiv=function(a,c,d,e,f){d=this.createStyledDiv(a,c,d,e,f);a&&a.append(d);return this.getElem(c)};this.openList= function(a,c,d){a="
    ";void 0!=d&&(a+=d);return a};this.closeList=function(a){return a+"
"};this.addListItem=function(a,c,d,e){var f=""+e+"")};this.addListSeparator=function(a,c,d){var e="")};this.splitList=function(a){a=a.split("\n");0b&&(0=b&&(b=Math.floor((a-b)*Q),0<=b&&bMath.abs(b-a)?g.animate({top:a},250):g.css("top",a)}wa();Z()}function za(){ca=!0;1==u&&y();l.hide();g.hide();setTimeout(function(){ca=!1;L();0!=e()&&1!=p||ba();0==v&&void 0!=l&&l.show()},500)}function ia(){0==p&&(u&&0==E&&y(),0==E&&ba())}function P(){za()}function ma(a,b){b=1==v?m:h;void 0!=b&&(a=b.getControls().get_controlBarHeight()+a,0==isNaN(a)&&(ta=a));Z()}function ha(a){a.overrideFullscreenElement(r);a.setDiscardClickEvent(Ja); var b=a.get_video();b.on("play",Aa);if(h&&a==h.getControls())b.on("loadedmetadata",Aa)}function Aa(){1==u&&y();e()&&aa()}function Ja(a){if(1==p&&u&&!E)return y(),!0;ba(1==p);return!1}function Ga(){1==p&&void 0!=N&&ra()}function Ea(){qa($(this),!1);xa(!0);ea&&(m.start(),ea=!1)}function ka(a){var b={};b.source=k[a].sourceDir+"video.mp4";b.poster=k[a].sourceDir+"snapshot.jpg";b.displayName=k[a].displayName;return b}function na(a,b,c){var d=k[a];void 0!=d&&(d=d.div,q&&q[0]==d[0]||(qa(d,0==b),v?xa(b): y(),R=Q=-1,F=k[a],l.hide(),F.isDaily?M.css("font-size","2em"):M.css("font-size","1.25em"),1==c&&(b=ka(a),h.setSource(b.source,b.poster,b.displayName)),Ha(k[a].sourceDir+"video.dat")))}function Da(a){na(a.target.getAttribute("data-index"),!0,!0)}function X(){v?(x&&x.hide(),D&&D.hide()):0==(void 0!=c&&""!=c&&0==d)&&(x&&x.show(),D&&D.show());E=!1}function Ia(){X()}function sa(){0!=p&&N&&(clearTimeout(N),N=void 0)}function ra(){0!=p&&(sa(),N=setTimeout(y,5E3))}function S(){U&&(clearTimeout(U),U=void 0)} function aa(){S();U=setTimeout(oa,3E3)}var p=browserhelper.isMobileBrowser(),v=!0,ea=!1,ya=void 0,ca=!1,O=!1,da=void 0,N=void 0,U=void 0,Ba=!1,Ca=!1,r=void 0,fa=void 0,V=void 0,A=void 0,m=void 0,w={},h=void 0,z={},C=void 0,B=void 0,ta=0,u=!1,g=void 0,E=!1,x=void 0,D=void 0,q=void 0,G=0,l=void 0,Y=void 0,M=void 0,Q=-1,R=-1,t=void 0,F=void 0,k=[],W=void 0,ja=a,H="",I="",T=!1,va=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||function(a){window.setTimeout(a, 100)}}();this.player=function(a,b){fa=a;htmlEditHelper.setContainerName(fa);r=htmlEditHelper.htmlStyledDiv($("#"+fa),"base","width:100%; height:100%; position:relative; overflow:hidden; background:#000");r.on("resize",L);void 0!=c&&void 0!=d&&1!=d||f(b);$.get(ja+"timelapselist.dat",{},function(a){0 Copyright 2010-2015 John-David Dalton Available under MIT license */ (function(){function A(c){c=String(c);return c.charAt(0).toUpperCase()+c.slice(1)}function I(c,n){var m=-1,f=c?c.length:0;if("number"==typeof f&&-1a?1:532>a?2:532.05>a?3:533>a?4:534.03>a?5:534.07>a?6:534.1>a?7:534.13>a?8:534.16>a?9:534.24>a?10:534.3>a?11:535.01>a?12:535.02>a?"13+":535.07>a?15: 535.11>a?16:535.19>a?17:536.05>a?18:536.1>a?19:537.01>a?20:537.11>a?"21+":537.13>a?23:537.18>a?24:537.24>a?25:537.36>a?26:"Blink"!=h?"27":"28")):(h&&(h[1]="like Safari"),a=(a=a[0],400>a?1:500>a?2:526>a?3:533>a?4:534>a?"4+":535>a?5:537>a?6:538>a?7:601>a?8:"8"));h&&(h[1]+=" "+(a+="number"==typeof a?".x":/[.+]/.test(a)?"":"+"));"Safari"==b&&(!e||45k.indexOf(p)&&g.push("on "+p);k&&g.push((/^on /.test(g[g.length-1])?"":"on ")+k);if(d){var P=(a=/ ([\d.+]+)$/.exec(d))&&"/"==d.charAt(d.length-a[0].length-1);d={architecture:32,family:a&&!P?d.replace(a[0],""):d,version:a?a[1]:null,toString:function(){var a=this.version;return this.family+(a&&!P?" "+a:"")+(64==this.architecture?" 64-bit":"")}}}(a=/\b(?:AMD|IA|Win|WOW|x86_|x)64\b/i.exec(G))&&!/\bi686\b/i.test(G)&&(d&&(d.architecture=64,d.family=d.family.replace(RegExp(" *"+a),"")),b&&(/\bWOW64\b/i.test(c)|| r&&/\w(?:86|32)$/.test(l.cpuClass||l.platform)&&!/\bWin64; x64\b/i.test(c))&&g.unshift("32-bit"));c||(c=null);f={};f.description=c;f.layout=h&&h[0];f.manufacturer=p;f.name=b;f.prerelease=H;f.product=k;f.ua=c;f.version=b&&e;f.os=d||{architecture:null,family:null,version:null,toString:function(){return"null"}};f.parse=y;f.toString=function(){return this.description||""};f.version&&g.unshift(e);f.name&&g.unshift(b);d&&b&&(d!=String(d).split(" ")[0]||d!=b.split(" ")[0]&&!k)&&g.push(k?"("+d+")":"on "+ d);g.length&&(f.description=g.join(" "));return f}var t={"function":!0,object:!0},D=t[typeof window]&&window||this,R=D,z=t[typeof exports]&&exports;t=t[typeof module]&&module&&!module.nodeType&&module;var l=z&&t&&"object"==typeof global&&global;!l||l.global!==l&&l.window!==l&&l.self!==l||(D=l);var J=Math.pow(2,53)-1,E=/\bOpera/,Q=this;l=Object.prototype;var K=l.hasOwnProperty,M=l.toString;"function"==typeof define&&"object"==typeof define.amd&&define.amd?define(function(){return y()}):z&&t?B(y(), function(c,l){z[l]=c}):D.platform=y()}).call(this); /* MIT */ var $jscomp=$jscomp||{};$jscomp.scope={};$jscomp.ASSUME_ES5=!1;$jscomp.ASSUME_NO_NATIVE_MAP=!1;$jscomp.ASSUME_NO_NATIVE_SET=!1;$jscomp.defineProperty=$jscomp.ASSUME_ES5||"function"==typeof Object.defineProperties?Object.defineProperty:function(a,c,f){a!=Array.prototype&&a!=Object.prototype&&(a[c]=f.value)};$jscomp.getGlobal=function(a){return"undefined"!=typeof window&&window===a?a:"undefined"!=typeof global&&null!=global?global:a};$jscomp.global=$jscomp.getGlobal(this);$jscomp.SYMBOL_PREFIX="jscomp_symbol_"; $jscomp.initSymbol=function(){$jscomp.initSymbol=function(){};$jscomp.global.Symbol||($jscomp.global.Symbol=$jscomp.Symbol)};$jscomp.Symbol=function(){var a=0;return function(c){return $jscomp.SYMBOL_PREFIX+(c||"")+a++}}(); $jscomp.initSymbolIterator=function(){$jscomp.initSymbol();var a=$jscomp.global.Symbol.iterator;a||(a=$jscomp.global.Symbol.iterator=$jscomp.global.Symbol("iterator"));"function"!=typeof Array.prototype[a]&&$jscomp.defineProperty(Array.prototype,a,{configurable:!0,writable:!0,value:function(){return $jscomp.arrayIterator(this)}});$jscomp.initSymbolIterator=function(){}};$jscomp.arrayIterator=function(a){var c=0;return $jscomp.iteratorPrototype(function(){return ca.y){var b=new Date(-1,a.m,a.d,a.H,a.M,a.S,a.L);b.setFullYear(a.y);return b}return new Date(a.y,a.m,a.d,a.H,a.M,a.S,a.L)}function u(a){if(0<=a.y&&100>a.y){var b=new Date(Date.UTC(-1,a.m,a.d,a.H,a.M,a.S,a.L));b.setUTCFullYear(a.y);return b}return new Date(Date.UTC(a.y, a.m,a.d,a.H,a.M,a.S,a.L))}function q(a){return{y:a,m:0,d:1,H:0,M:0,S:0,L:0}}function v(a){function b(a,b){return function(c){var d=[],g=-1,m=0,U=a.length,f,e;for(c instanceof Date||(c=new Date(+c));++gd.V||53=f)return-1;e=b.charCodeAt(g++);if(37===e){if(e=b.charAt(g++),e=V[e in J?b.charAt(g++):e],!e||0>(d=e(a,c,d)))return-1}else if(e!=c.charCodeAt(d++))return-1}return d}var h=a.dateTime,k=a.date,l=a.time,w=a.periods,x=a.days,y=a.shortDays,z=a.months,A= a.shortMonths,v=r(w),B=t(w),C=r(x),D=t(x),E=r(y),F=t(y),G=r(z),H=t(z),I=r(A),W=t(A),n={a:function(a){return y[a.getDay()]},A:function(a){return x[a.getDay()]},b:function(a){return A[a.getMonth()]},B:function(a){return z[a.getMonth()]},c:null,d:K,e:K,f:X,H:Y,I:Z,j:aa,L:L,m:ba,M:ca,p:function(a){return w[+(12<=a.getHours())]},Q:M,s:N,S:da,u:ea,U:fa,V:ha,w:ia,W:ja,x:null,X:null,y:ka,Y:la,Z:ma,"%":O},p={a:function(a){return y[a.getUTCDay()]},A:function(a){return x[a.getUTCDay()]},b:function(a){return A[a.getUTCMonth()]}, B:function(a){return z[a.getUTCMonth()]},c:null,d:P,e:P,f:na,H:oa,I:pa,j:qa,L:Q,m:ra,M:sa,p:function(a){return w[+(12<=a.getUTCHours())]},Q:M,s:N,S:ta,u:ua,U:va,V:wa,w:xa,W:ya,x:null,X:null,y:za,Y:Aa,Z:Ba,"%":O},V={a:function(a,b,c){return(b=E.exec(b.slice(c)))?(a.w=F[b[0].toLowerCase()],c+b[0].length):-1},A:function(a,b,c){return(b=C.exec(b.slice(c)))?(a.w=D[b[0].toLowerCase()],c+b[0].length):-1},b:function(a,b,c){return(b=I.exec(b.slice(c)))?(a.m=W[b[0].toLowerCase()],c+b[0].length):-1},B:function(a, b,c){return(b=G.exec(b.slice(c)))?(a.m=H[b[0].toLowerCase()],c+b[0].length):-1},c:function(a,b,c){return f(a,h,b,c)},d:R,e:R,f:Ca,H:S,I:S,j:Da,L:Ea,m:Fa,M:Ga,p:function(a,b,c){return(b=v.exec(b.slice(c)))?(a.p=B[b[0].toLowerCase()],c+b[0].length):-1},Q:Ha,s:Ia,S:Ja,u:Ka,U:La,V:Ma,w:Na,W:Oa,x:function(a,b,c){return f(a,k,b,c)},X:function(a,b,c){return f(a,l,b,c)},y:Pa,Y:Qa,Z:Ra,"%":Sa};n.x=b(k,n);n.X=b(l,n);n.c=b(h,n);p.x=b(k,p);p.X=b(l,p);p.c=b(h,p);return{format:function(a){var c=b(a+="",n);c.toString= function(){return a};return c},parse:function(a){var b=c(a+="",T);b.toString=function(){return a};return b},utcFormat:function(a){var c=b(a+="",p);c.toString=function(){return a};return c},utcParse:function(a){var b=c(a,u);b.toString=function(){return a};return b}}}function f(a,b,c){var e=0>a?"-":"";a=(e?-a:a)+"";var f=a.length;return e+(f