/*! (C) 2025 Microsoft Group of Companies. v1.5.1
This code contains portions of Video.js modified by AppNexus. Video.js is Copyright Brightcove, Inc. and Licensed under the Apache License, Version 2.0 (the “License”); you may not use Video.js except in compliance with the License. You may obtain a copy of the License at 
http://www.apache.org/licenses/LICENSE-2.0 
Unless required by applicable law or agreed in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. 
Apache License, Version 2.0
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files.
"Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions:
a. You must give any other recipients of the Work or Derivative Works a copy of this License; and
b. You must cause any modified files to carry prominent notices stating that You changed the files; and
c. You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and
d. If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. 

You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability.

This code contains portions of videojs-vast-plugin which is licensed under the MIT License.  
The MIT License (MIT)
Copyright (c) 2015 MailOnline
Permission is here by granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
var APNVideo_MobileVastPlayer=function(e){var t={};function n(i){if(t[i])return t[i].exports;var r=t[i]={exports:{},id:i,loaded:!1};return e[i].call(r.exports,r,r.exports,n),r.loaded=!0,r.exports}return n.m=e,n.c=t,n.p="",n(0)}([function(e,t,n){var i=[];function r(e,t){if(!e)return null;for(var n=0;n<i.length;n++)if(i[n].id===e)return t?i[n].cachePlayer?i[n].cachePlayer:null:i[n].player;return null}function o(e,t){if(!e)return null;for(var n=null,r=0;r<i.length;r++)if(i[r].id===e){if(t)return i[r].cachePlayer?null:(n=new d,i[r].cachePlayer=n,n);i[r].player&&i[r].player.stop(),i.splice(r,1);break}return n=new d,t?i.push({id:e,cachePlayer:n}):i.push({id:e,player:n}),n}var a=n(1),s=n(2),l=n(76),d=function(){function e(e){var t=n(98);t.setDebugLevel(t.TRACE_LEVEL_VERBOSE),t.logDebug(e,"Vast Video Player")}e("VERSION 1.4.15");var t,i,r,o,d={},c={},u=null,p=!1,h=3e3,f=null,v=!1,m=!1,g=null,y=!1,b=null,A=!1,w=0,T=function(t){e("VastPlayer > cbWhenQuartile "+t),f(t,{})},k=function(e,n){var i=e,r=n;if("AdHandler"===i&&"video_impression"===r)try{var o=new CustomEvent("outstream-impression");t.dispatchEvent(o)}catch(e){error(e)}for(var a=[{type:"AdHandler",name:"video_start",mappedEventName:"videoStart"},{type:"AdHandler",name:"rewind",mappedEventName:"videoRewind"},{type:"AdHandler",name:"video_fullscreen_enter",mappedEventName:"video-fullscreen-enter"},{type:"AdHandler",name:"video_fullscreen_exit",mappedEventName:"video-fullscreen-exit"},{type:"AdHandler",name:"video_impression",mappedEventName:"video-impression"},{type:"AdHandler",name:"ad-click",mappedEventName:"ad-click"}],s=0;s<a.length;s++)tok=a[s],tok.type===i&&tok.name===r&&f(tok.mappedEventName,{})},E=function(t){e("VastPlayer > cbWhenVideoComplete "+t),f(t,{})},S=function(t){e("VastPlayer > cbWhenSkipped "+t),f(t,{})},C=function(t){e("VastPlayer > cbWhenAudio "+t),f(t,{})},I=function(e){f(e,{})},_=function(t){e("VastPlayer > cbWhenFullScreen "+t),f(t,{})},P=function(n,r,o){e("VastPlayer > cbTerminate isError: "+n);var a="unknown";t&&(a=t.id.toString()),e("VastPlayer > cbTerminate:  bTerminated = "+m+", targetElement id = "+a),y=!1,m||(m=!0,r||j(),!o&&N()&&d.overlayPlayer&&j(),t&&(b&&(b.isPlayingVideo&&(e("VastPlayer > cbTerminate: pause ad"),b.pause()),t.style.height="1px",b.resizePlayer(1,1)),setTimeout((function(){t&&(t.innerHTML="",i.removeChild(t)),t=null}),2e3)),f&&n&&f("video-error",{}))},j=function(){document.exitFullscreen?document.exitFullscreen():document.webkitExitFullscreen?document.webkitExitFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.msExitFullscreen&&document.msExitFullscreen()},x=function(n){var i,r,a,s,l,c,u;i=n&&n.options&&n.options.video&&n.options.video.url?n.options.video.url:"",r=n&&n.options&&n.options.data&&n.options.data.vastDurationMsec?n.options.data.vastDurationMsec:0,a=n&&n.options&&n.options.finalVastXml?n.options.finalVastXml:"",s=n&&n.options&&n.options.finalVastUri?n.options.finalVastUri:"",l=n&&n.getFinalAspectRatio()?n.getFinalAspectRatio():"",c=n&&n.options&&n.options.video&&n.options.video.width?n.options.video.width:"",u=n&&n.options&&n.options.video&&n.options.video.height?n.options.video.height:"",m||(p=!0,b=n,e("VastPlayer > cbWhenReady in "+((new Date).getTime()-o)+" msecs"),f&&f("adReady",{creativeUrl:i,duration:r,vastXML:a,vastCreativeUrl:s,aspectRatio:l,width:c,height:u}),"click"===d.initialPlayback||d.cachePlayer||(N()&&d.overlayPlayer?d.forceAdInFullscreen?(A=!0,j()):(t&&(t.style.width="1px",t.style.height="1px"),P(!1,!0,!0)):b.play()))};function V(n){n.cbNotification=function(e,t){k(e,t)},e("Build Ad Player Callback"),m||(v?g?(g.options=r.init(g.options),r.buildPlayer(g.callbacks,g.options),g={options:n,callbacks:c}):y?(g={options:n,callbacks:c},f(t,{})):(n=r.init(n),r.buildPlayer(c,n),y=!0):(g=null,e("Building single player"),n=r.init(n),r.buildPlayer(c,n)))}function M(){d={},t=null,i=null,c={},r=Object.create(s),u&&clearTimeout(u),u=null,p=!1,h=3e3,f=null,v=!1,m=!1,g=null,y=!1,o=null}function N(){return document.fullscreenElement||document.webkitFullscreenElement||document.mozFullScreenElement||document.msFullscreenElement}function O(){var n,r;if(e("repositionPlayer: try reposion/resize overlay player"),d.cachePlayer||m)e("repositionPlayer: never reposition terminated or cache palyer");else if(!N()){n=i.offsetWidth,r=i.offsetHeight;var o=i.style.borderWidth;if(o&&o.length>0){var a=Number(o.substring(0,o.length-2));n-=2*a,r-=2*a}t.style.width=n+"px",t.style.height=r+"px";var s=R(i);e("repositionPlayer: targetDiv absolute posiotion ="+s.left+", "+s.top),t.style.left=s.left+"px",t.style.top=s.top+"px",e("repositionPlayer: size =  "+n+", "+r),d.overlayPlayer?b.resizePlayer(n,r):b.resizeVideo(null,!1,null)}}var D=null;function L(t){switch(e("Got notification: "+t),t){case"leaveFullscreen":j();break;default:e("Unknown player notification: "+t)}}function R(e){for(var t=0,n=0;e&&"BODY"!==e.tagName&&!isNaN(e.offsetLeft)&&!isNaN(e.offsetTop);){var i=document.defaultView.getComputedStyle(e,null).position;if(i&&""!==i&&"static"!==i)break;t+=e.offsetLeft-e.scrollLeft+e.clientLeft,n+=e.offsetTop-e.scrollTop+e.clientTop,e=e.offsetParent}return{left:t,top:n}}function U(e,t){if(!e.children)return t;for(var n,i,r=Math.max(t,(n=e,"auto"!==(i=document.defaultView.getComputedStyle(n,null).zIndex)?i:0)),o=0;o<e.children.length;o++){var a=e.children[o];r=Math.max(r,U(a,r))}return r}function B(){return/iphone/i.test(navigator.userAgent.toLowerCase())}function F(r,s,g){e("play function called"),p=!1,h=3e3,d.vpaidTimeout&&(h=d.vpaidTimeout),f=null,v=!1,m=!1,g&&(v=g),s&&(f=function(e,t){s({event:e,params:t=t||{}})}),B()&&(!0===d.showFullScreenButton?d.allowFullscreen=!0:d.allowFullscreen=!1),(B()||/ipad/i.test(navigator.userAgent.toLowerCase()))&&(d.enableInlineVideoForIos=!1),e("options before PlayerDefaultOption: ",JSON.stringify(d)),d=a(d),e("options after PlayerDefaultOption: ",JSON.stringify(d)),d.width=r.offsetWidth,d.height=r.offsetHeight;var y=r.style.borderWidth;if(y&&y.length>0){var b=Number(y.substring(0,y.length-2));d.width-=2*b,d.height-=2*b}d.playerHeight=d.height,function(){var t;try{t=function(){try{var e=navigator.platform,t=navigator.userAgent,n=navigator.appVersion;if(/iP(hone|od|ad)/.test(e)&&!/CriOS/.test(t)){var i=n.match(/OS (\d+)_(\d+)_?(\d+)?/);return[parseInt(i[1],10),parseInt(i[2],10),parseInt(i[3]||0,10)]}return[0,0,0]}catch(e){return[0,0,0]}}()[0]>=8&&!0===d.enableInlineVideoForIos}catch(t){e(t)}return t}()&&(d.playerHeight-=30),N()&&(d.fullscreenMode=!0),e("offsetWidth="+r.offsetWidth+", offsetHeight="+r.offsetHeight+", borderWidth="+r.style.borderWidth);var A=document.createElement("div");A.style.width=d.width+"px",d.fitInContainer?A.style.height=d.height+"px":d.cachePlayer&&d.overlayPlayer?A.style.height="1px":A.style.height=d.height+"px",A.style.backgroundColor="black",A.id=r.id+"_overlay_"+(new Date).getTime();var j=R(r);e("targetDiv absolute posiotion ="+j.left+", "+j.top),A.style.position="absolute",A.style.left=j.left+"px",A.style.top=j.top+"px",d.fitInContainer?A.style.zIndex=Math.max(100,U(r,0)+1):(w=Math.max(100,U(r,0)+1),d.cachePlayer&&d.overlayPlayer?A.style.zIndex=0:A.style.zIndex=w),r.appendChild(A),e("player container offsetLeft = "+A.offsetLeft+", offsetTop = "+A.offsetTop),t=A,i=r,o=(new Date).getTime(),e("timeToReady = "+h+", start time = "+o),u=setTimeout((function(){p||(P(!1),f&&f("Timed-out",{}))}),h);c.cbRenderVideo=function(t,n){e("VastPlayer > cbRenderVideo called");try{e("VastPlayer > cbRenderVideo options: ",JSON.stringify(n))}catch(e){}V(n)},c.cbWhenDestroy=P,c.cbWhenReady=x,c.cbWhenQuartile=T,c.cbWhenVideoComplete=E,c.cbWhenSkipped=S,c.cbWhenFullScreen=_,c.cbWhenAudio=C,c.cbWhenClickOpenUrl=I,c.cbCoreVideoEvent=k,d.playerNotification=L,d.overlayPlayer&&(d.hasOwnProperty("allowFullscreen")||(d.allowFullscreen=!1)),e("VP >> before options.initialAudio = "+d.initialAudio),"auto"===d.initialPlayback&&"on"===d.initialAudio&&(navigator.appVersion.indexOf("Mobile")>-1||navigator.appVersion.indexOf("Android")>-1)&&navigator.userAgent.indexOf("Chrome")>-1&&function(){var e=navigator.appVersion.indexOf("Chrome/");if(e>=0){var t=navigator.appVersion.substr(e+7);return(e=t.indexOf("."))>0?Number(t.substr(0,e)):0}return 0}()>=53&&(d.showMute=!0,d.showVolume=!0),e("VP >> after options.initialAudio = "+d.initialAudio);var M=n(100);d.msSkinCss?(e("VP >>  skinning request = "+d.msSkinCss),M.load(d.msSkinCss,(function(n,i){n||0===i.length?(e("VP >>  skinning failed with error "+n),d.useMsSkin=!1):(e("VP >>  applying skinning "),d.useMsSkin=!0,d.controlBarPosition="fixed",d.disableTopBar=!0,d.allowFullscreen=!1,d.showMute=!1,d.showVolume=!1,d.showProgressBar="both",d.customPlayerSkinCss=i),l(t,d,c)}),null,!1)):(d.useMsSkin=!1,l(t,d,c))}document.body.onresize&&(D=document.body.onresize),window.onresize=function(n){e("Resize event happend"),t&&b&&(A?(A=!1,d.fitInContainer&&(t.style.zIndex=w),setTimeout((function(){O(),"click"!==d.initialPlayback&&b.play()}),100)):O()),D&&D(n)},this.playVast=function(t,n,i,r,o){e("VP >> playVast function called playerId = "+this.vastPlayerId),P(!1,!0),M(),(d=n).vastXml=i,F(t,r,o)},this.playAdObject=function(t,n,i,r,o){e("VP >> playAdObject function called playerId = "+this.vastPlayerId+", cache mode = "+n.cachePlayer),P(!1,!0),M(),d=n,"string"==typeof i?d.vastXml=i:(d.useAdObj=!0,d.adObj=i),F(t,r,o)},this.stop=function(){u&&(clearTimeout(u),u=null),P(!1)},this.removeFromPage=function(){u&&(clearTimeout(u),u=null),m=!0,t&&(t.innerHTML="",i.removeChild(t),t=null)},this.play=function(){e("VP >> play function called playerId = "+this.vastPlayerId),b&&(d.cachePlayer=!1,N()&&d.overlayPlayer?d.forceAdInFullscreen?(A=!0,j()):P(!1,!0,!0):(t&&!1===d.fitInContainer&&(t.style.zIndex=w),O(),"click"!==d.initialPlayback&&b.play()))},this.sendPlay=function(){e("VP >> sendPlay function called playerID = "+this.vastPlayerId),b&&!b.isPlayingVideo&&b.play()},this.sendPause=function(){e("VP >> sendPause function called playerID = "+this.vastPlayerId),b&&b.isPlayingVideo&&b.pause()},this.sendMute=function(){e("VP >> sendMute function called playerID = "+this.vastPlayerId),b&&!b.isMuted&&b.mute()},this.sendUnMute=function(){e("VP >> sendUnMute function called playerID = "+this.vastPlayerId),b&&b.isMuted&&b.unmute()},this.handleFullscreen=function(e){b&&(e?i.requestFullscreen?i.requestFullscreen():i.webkitRequestFullscreen?i.webkitRequestFullscreen():i.mozRequestFullScreen?i.mozRequestFullScreen():i.msRequestFullscreen&&i.msRequestFullscreen():document.exitFullscreen?document.exitFullscreen():document.webkitExitFullscreen?document.webkitExitFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.msExitFullscreen&&document.msExitFullscreen())},this.vastPlayerId=(new Date).getTime(),this.isTerminated=function(){return m},this.getIsVideoPlaying=function(){return!(!b||!b.isPlayingVideo)},this.getCurrentPlayHeadTime=function(){var e=0;return r&&r.adVideoPlayer&&"function"==typeof r.adVideoPlayer.player&&(e=1e3*r.adVideoPlayer.player().currentTime(),e=parseInt&&"function"==typeof parseInt?parseInt(e):e),e}};e.exports={playAdObject:function(e,t,n,i,r){var a=o(t.targetElementId,t.cachePlayer);a&&a.playAdObject(e,t,n,i,r)},playVast:function(e,t,n,i,r){var a=o(t.targetElementId);a&&a.playVast(e,t,n,i,r)},loadAndPlayVast:function(e,t,i,r,a){n(100).load(i,(function(s,l){if(s||0===l.length){n(98).logDebug("Failed to load "+i,"Vast Video Player")}else{var d=o(t.targetElementId);d&&d.playVast(e,t,l,r,a)}}))},stop:function(e,t){var n=r(e.id,t);n&&n.stop()},removeFromPage:function(e){var t=r(e);t&&t.removeFromPage()},play:function(e,t){var n=function(e,t){if(!e)return null;for(var n=0;n<i.length;n++)if(i[n].id===e)return t&&i[n].cachePlayer&&(i[n].player=i[n].cachePlayer,delete i[n].cachePlayer),i[n].player;return null}(e,t);n&&n.play()},sendPlay:function(e){var t=r(e);t&&t.sendPlay()},sendPause:function(e){var t=r(e);t&&t.sendPause()},sendMute:function(e){var t=r(e);t&&t.sendMute()},sendUnMute:function(e){var t=r(e);t&&t.sendUnMute()},handleFullscreen:function(e,t){var n=r(e);n&&n.handleFullscreen(t)},getCurrentPlayHeadTime:function(e){var t=r(e);if(t)return t.getCurrentPlayHeadTime()},getIsVideoPlaying:function(e){var t=r(e);if(t)return t.getIsVideoPlaying()}}},function(e,t){e.exports=function(e){function t(e){return"object"==typeof e}function n(e){return null===e}var i=function e(i){var r,o,a;for(o=1;o<arguments.length;o++)for(a in r=arguments[o])r.hasOwnProperty(a)&&(t(i[a])&&!n(i[a])&&t(r[a])?i[a]=e({},i[a],r[a]):i[a]=r[a]);return i}({},{autoInitialSize:!1,initialPlayback:"click",initialAudio:"on",playOnMouseover:!1,audioOnMouseover:!1,skippable:{enabled:!0,videoThreshold:15,videoOffset:5,skipLocation:"top-left",skipText:"Video can be skipped in %%TIME%% seconds",skipButtonText:"SKIP"},adText:"Ad",showMute:!0,showVolume:!0,showProgressBar:!0,allowFullscreen:!1,topDividerColor:"0x606060",bottomDividerColor:"0x606060",topDividerWidth:1,bottomDividerWidth:1,enableInlineVideoForIos:!0,flash:{swf:"http://acdn.adnxs.com/video/static/player/flash/adplayer/1.1.16/AppnexusFlashPlayer.swf"},sideStream:{enabled:!1},forceAdInFullscreen:!0,data:{skipOffset:"",durationMsec:null,skipOffsetMsec:null,isVastVideoSkippable:!1,vastProgressEvent:{},vastDurationMsec:null,adIcons:null}},e||{});if(void 0!==i.playerTechnology&&0!==i.playerTechnology.length||(i.playerTechnology=["html5","flash"]),i.enableExplicitPause=!0,i.skippable&&i.skippable.enabled)try{i.skippable.hasOwnProperty("skipText")&&0===i.skippable.skipText.trim().length&&i.skippable.hasOwnProperty("skipButtonText")&&0===i.skippable.skipButtonText.trim().length&&(i.skippable.enabled=!1)}catch(e){}return i}},function(e,t,n){var i=n(3),r=n(9),o=n(65),a=n(66),s=n(64),l=n(11),d=l.DelayEventHandler,c=l.unique(),u=n(44),p=n(67),h=n(73),f="APNVideo_Player_"+((new Date).getTime()+Math.floor(1e4*Math.random())),v=n(12),m=function(e){v.debug("[PlayerManager_Main]",e)},g=function(e){v.error("[PlayerManager_Main]",e)},y=["AdPaused","AdVolumeChange"],b=["AdLoaded","AdStopped","AdSkippableStateChange","AdLinearChange","AdDurationChange","AdRemainingTimeChange","AdLog","AdError"],A={enforcePrivacy:!1,initialPlayback:"auto",initialAudio:"off",skippable:{enabled:!0,allowOverride:!1,videoThreshold:15,videoOffset:5,skipLocation:"top-left",skipText:"Video can be skipped in %%TIME%% seconds",skipButtonText:"SKIP"},adText:"Ad",showMute:!0,showVolume:!0,showProgressBar:!0,showPlayToggle:!0,showBigPlayButton:!0,allowFullscreen:!0,playerSkin:{customPlayerSkin:"",controlBarHeight:30,topDividerColor:"#606060",bottomDividerColor:"#606060",topDividerWidth:1,bottomDividerWidth:1,videoBackgroundColor:"#000000"},disableCollapse:{enabled:!1,replay:!1},endCard:{enabled:!1,clickable:!0,color:"",imageUrl:"",imageWidth:"",imageHeight:"",showCompanion:!0},enableInlineVideoForIos:!0,delayExpandUntilVPAIDInit:!1,delayExpandUntilVPAIDImpression:!1,vpaidTimeout:5e3,waterfallTimeout:3e4,waterfallSteps:-1,fixedSizePlayer:!0,disableTopBar:!1,sideStream:{enabled:!1,position:"bottom-right",xOffset:0,yOffset:0,space:"empty",dynamicBigPlayButtonOnSideStream:!0},sideStreamObject:{},preloadInlineAudioForIos:!1,controlBarPosition:"over",customPlayerSkinCss:"",customButton:{enabled:!1,url:"",altText:"",imageSrc:"",imgWidth:50,imgHeight:30},enableNativeInline:!1,androidDSOverride:!1,cbNotification:function(){},parentIframeIsModal:!1,learnMore:{enabled:!1,clickToPause:!0,text:"Learn More",separator:"-"},playerContextId:"anadvideoplayer",data:{skipOffset:"",durationMsec:null,skipOffsetMsec:null,isVastVideoSkippable:!1,vastProgressEvent:{},vastDurationMsec:null,adIcons:null},test:function(){}},w={externalNameOfVideoPlayer:f,videoPlayerObj:i,autoplayHandler:h,mobileSupport:h,customSkinning:u,options:{},adVideoPlayer:{},callbackForAdUnit:{},vpaidData:{},iframeVideoWrapper:{},isPlayingVideo:!1,isDoneInitialPlay:!1,isFullscreen:!1,heightOffset:0,explicitPaused:!1,aspectRatio:0,finalAspectRatio:0,videoObjectId:{},isViewable:!1,isSkipped:!1,isCompleted:!1,isMuted:!1,isExplicitMuted:!1,hasBeenUnmuted:!1,isChrome:navigator.userAgent.indexOf("Chrome")>-1,videojs_vpaid:o,overlayPlayer:!1,forceToSkip:!1,ExtendDefaultOption:a,delayEventHandler:null,pausedByViewability:!1,mutedByVisibility:!1,isReadyToExpandForMobile:!1,isAlreadyPlaingForVPAID:!1,isSideStreamActivated:!1,isExpanded:!0,isVideoCompleteInjected:!1,isFullscreenToggled:!1,toggleWindowFocus:!0,viewabilityTracking:null,isDoneFirstLoadStart:!1,startedReplay:!1,Utils:l,isAlreadyStart:!1,isEnded:!1,blockTrackingUserActivity:!1,videoId:"",divIdForVideo:"",pausedByAPI:!1,simidIntegratorObj:null,init:function(e){var t=a(A,e);return this.options=t,"boolean"==typeof this.options.disableCollapse&&(this.options.disableCollapse={enabled:this.options.disableCollapse,replay:!1}),this.delayEventHandler=new d,this.delayEventHandler.suppress(this.options.delayExpandUntilVPAIDImpression),this.delayEventHandler.start(),this.viewabilityTracking=new p,t},getValueFromPlayer:function(e){var t=0;try{"controlBar.height"===e&&this.adVideoPlayer&&this.adVideoPlayer.controlBar&&this.adVideoPlayer.controlBar.height&&"function"==typeof this.adVideoPlayer.controlBar.height&&"html5"===this.decidePlayer(this.options.requiredPlayer)&&(t=this.adVideoPlayer.controlBar.height())}catch(e){g(e)}return t},decidePlayer:function(){return"html5"},buildPlayer:function(e,t){var n=this;if(t.waterfallStepId&&m("CHECKING AUTOPLAY FOR WATERFALL STEP: "+t.waterfallStepId),"html5"===this.decidePlayer(t.requiredPlayer)&&this.autoplayHandler&&!t.overlayPlayer){var i;i=!h.isMobile()&&("on"===t.initialAudio||!0===t.audioOnMouseover),n.autoplayHandler.getAutoplayPolicy((function(i){var r=n.autoplayHandler.videoPolicy;switch(i){case r.allowAutoplay:break;case r.stopMediaWithSound:if(h.isMobile()&&"native"===t.adType&&t.vpaid&&n.isAlreadyPlaingForVPAID)break;"on"===t.initialAudio?("auto"!==t.initialPlayback&&"mouseover"!==t.initialPlayback||(t.initialAudio="off",t.audioOnMouseover=!1),!0===t.isWaterfall&&(t.adAttempt>0?(t.initialAudio="off",t.audioOnMouseover=!1):t.audioOnMouseover=!0)):"auto"!==t.initialPlayback&&"mouseover"!==t.initialPlayback||(t.audioOnMouseover=!1);break;case r.neverAutoplay:t.initialPlayback="click",t.isWaterfall&&(t.isWaterfall=!1,t.stopWaterfall=!0)}t.waterfallStepId&&m("BUILDING PLAYER FOR WATERFALL STEP: "+t.waterfallStepId),n.buildPlayerCallback(e,t)}),i)}else n.buildPlayerCallback(e,t)},buildPlayerCallback:function(e,t){this.callbackForAdUnit=e,t.hasOwnProperty("overlayPlayer")&&(this.overlayPlayer=t.overlayPlayer,t.hasOwnProperty("fullscreenMode")&&(t.allowFullscreen=!1)),this.options.targetElement&&!this.options.firstAdAttempted&&(this.options.targetElement.style.backgroundImage||(this.options.targetElement.style.visibility="hidden"));var n="APNVideo_Player_"+((new Date).getTime()+Math.floor(1e4*Math.random()));this.externalNameOfVideoPlayer=n,r(e,t,this)},getPlayerStatus:function(){},notifyPlayer:function(e,t){this.adVideoPlayer.handleAdUnitNotification({name:e,value:t})},load:function(){if("html5"===this.decidePlayer(this.options.requiredPlayer)){m("load video");try{this.adVideoPlayer&&void 0!==this.adVideoPlayer&&this.adVideoPlayer.load&&"function"==typeof this.adVideoPlayer.load&&(this.options.delayExpandUntilVPAIDImpression&&this.adVideoPlayer.player()&&this.adVideoPlayer.player().autoplay()&&this.adVideoPlayer.player().autoplay(!1),this.adVideoPlayer.load())}catch(e){g(e)}}},replay:function(){if(this.isEnded)if(!this.options.vpaid||"native"!==this.options.adType&&"preview"!==this.options.adType)this.dispatchEventToAdunit({name:"rewind"}),this.startedReplay=!0,this.isEnded=!1,this.explicitPlay(),this.adVideoPlayer.controlBar.playToggle&&this.adVideoPlayer.controlBar.playToggle.el()&&this.adVideoPlayer.controlBar.playToggle.el().style&&(this.adVideoPlayer.controlBar.playToggle.el().style["pointer-events"]=""),this.options.sideStream&&!0===this.options.sideStream.wasEnabled&&(this.options.sideStream.enabled=!0,delete this.options.sideStream.wasEnabled),this.options.endCard&&this.options.endCard.enabled&&(this.actualPlayByVideoJS(),l.isIos()||this.adVideoPlayer.bigPlayButton.show());else{this.dispatchEventToAdunit({name:"rewind"});var e=this.iframeVideoWrapper||document.getElementById(this.options.iframeVideoWrapperId);e&&e.parentNode.removeChild(e),navigator.userAgent.indexOf("Trident/7.0")>-1||l.isIos()?(this.isEnded=!1,this.dispatchEventToAdunit({name:"replay-vpaid"})):(this.dispatchEventToAdunit({name:"replay-vpaid"}),this.isEnded=!1),this.adVideoPlayer.controlBar.playToggle&&this.adVideoPlayer.controlBar.playToggle.el()&&this.adVideoPlayer.controlBar.playToggle.el().style&&(this.adVideoPlayer.controlBar.playToggle.el().style["pointer-events"]="")}},actualPlayByVideoJS:function(){this.adVideoPlayer.play(),this.options.vpaid&&this.adVideoPlayer.trigger("handleManualUserInActive")},play:function(){if(!0!==this.isEnded){var e=h.isMobile()&&h.iOSversion()[0]>=10&&!1===this.options.enableInlineVideoForIos;if(e&&!l.isIphone()&&"native"===this.options.adType&&(e=!1),e){var t=this;t.overlayPlayer?t.options.targetElement.style.overflow="":setTimeout((function(){t.options.targetElement.style.overflow=""}),t.options.expandTime)}if(this.isAlreadyPlaingForVPAID=!0,!this.isCompleted){if(m("play video"),this.isDoneInitialPlay?(this.decidePlayer(this.options.requiredPlayer),this.isPlayingVideo||this.dispatchEventToAdunit({name:"video_resume"})):this.options.vpaid||(this.dispatchEventToAdunit({name:"video_start"}),this.dispatchEventToAdunit({name:"video_impression"})),this.options.vpaid&&this.isIosInlineRequired()?this.isDoneInitialPlay?this.actualPlayByVideoJS():this.adVideoPlayer.trigger("play"):this.options.vpaid&&this.options.overlayPlayer&&h.isIOS()&&h.iOSversion()[0]<10&&!this.isDoneInitialPlay||this.options.vpaid&&this.options.overlayPlayer&&navigator.appVersion.indexOf("Android")>-1&&this.options.enableWaterfall&&!this.isDoneInitialPlay?this.adVideoPlayer.trigger("play"):this.actualPlayByVideoJS(),"native"===this.options.adType&&h.isMobile()){var n=this.adVideoPlayer.controlBar;setTimeout((function(){n.el_.style.opacity=1,n.el_.style.visibility="visible"}),500)}"html5"===this.decidePlayer(this.options.requiredPlayer)||(this.isPlayingVideo=!0),this.isDoneInitialPlay=!0,this.isEnded=!1}}else"preview"===this.options.adType&&this.options.onlyAudio&&this.replay()},resetVpaid:function(){this.dispatchEventToAdunit({name:"reset"})},pause:function(){this.isPlayingVideo&&(m("pause video"),this.adVideoPlayer.pause(),this.options.vpaid&&this.adVideoPlayer.trigger("handleManualUserActive"),this.isCompleted||this.isEnded||this.dispatchEventToAdunit({name:"video_pause"}))},explicitPause:function(){m("explicit pause video"),this.explicitPaused=!0,this.pause()},explicitPlay:function(){this.pausedByAPI||(m("explicit play video"),this.explicitPaused=!1,this.play())},mute:function(){this.isMuted||(m("mute audio"),this.adVideoPlayer.muted(!0),this.dispatchEventToAdunit({name:"video_mute"}),this.isMuted=!0)},explicitMute:function(){m("explicit mute video"),this.isExplicitMuted=!0,this.mute()},unmute:function(){!this.isExplicitMuted&&this.isMuted&&(m("unmute audio"),!0===this.adVideoPlayer.muted()&&this.adVideoPlayer.muted(!1),(this.isMuted||"off"===this.options.initialAudio)&&this.dispatchEventToAdunit({name:"video_unmute"}),this.isMuted=!1)},explicitUnmute:function(){this.isExplicitMuted=!1,this.unmute()},resizeVideoWithDimensions:function(e,t){(this.isEnded||this.isSkipped)&&1===e&&1===t&&(this.options.macroWidth=this.options.width,this.options.macroHeight=this.options.height),this.options.width=e,this.options.height=t,this.resizeVideo(this.aspectRatio)},destroy:function(e,t){if(this.isPlayingVideo=!1,this.adVideoPlayer.pause(),!1===this.isCompleted&&(!1===this.options.vpaid||!0===this.options.vpaid&&!1===this.isSkipped)&&this.dispatchEventToAdunit({name:"video_skip"}),"function"==typeof this.callbackForAdUnit.cbWhenSkipped&&this.callbackForAdUnit.cbWhenSkipped("video-skip"),this.isSkipped=!0,this.verificationManager&&this.verificationManager.destroy(),m("destroy"),"preview"===this.options.adType)return this.adVideoPlayer.currentTime(this.adVideoPlayer.duration()),void(this.options.vpaid?this.adVideoPlayer.trigger("customDestroy"):this.adVideoPlayer.trigger("ended"));"function"==typeof this.callbackForAdUnit.cbWhenDestroy&&(this.overlayPlayer?e&&t?this.callbackForAdUnit.cbWhenDestroy({type:1,code:900,message:t},!0,this.options):this.callbackForAdUnit.cbWhenDestroy(null,!0,this.options):e&&t?this.callbackForAdUnit.cbWhenDestroy({type:1,code:900,message:t},null,this.options):this.callbackForAdUnit.cbWhenDestroy(null,null,this.options))},destroyWithoutSkip:function(e,t,n,i){try{var r=this,o=function(){if(r.isPlayingVideo=!1,"native"===r.options.adType||"preview"===r.options.adType){if(r.options.iframeVideoWrapperId===r.options.iframeVideoWrapperIdPrevious)return;r.options.iframeVideoWrapperIdPrevious=r.options.iframeVideoWrapperId}903!=i&&r.adVideoPlayer&&r.adVideoPlayer.pause&&"function"==typeof r.adVideoPlayer.pause&&r.adVideoPlayer.pause(),r.verificationManager&&r.verificationManager.destroy(),m("destroy without skip: "+r.options.iframeVideoWrapperId);var o=i||900;"function"==typeof r.callbackForAdUnit.cbWhenDestroy&&(r.overlayPlayer?e&&t?(n&&(o=402),r.callbackForAdUnit.cbWhenDestroy({type:1,code:o,message:t},!0,r.options)):r.callbackForAdUnit.cbWhenDestroy(null,!0,r.options):e&&t?(n&&(o=402),r.callbackForAdUnit.cbWhenDestroy({type:1,code:o,message:t},null,r.options)):r.callbackForAdUnit.cbWhenDestroy(null,null,r.options))};r.options.disableCollapseForDelay&&r.options.disableCollapseForDelay>0?setTimeout(o,r.options.disableCollapseForDelay):o()}catch(e){g("failed to destroy/notify by "+e)}},getVideoObject:function(){return this.adVideoPlayer},handleOverlayNotification:function(e){m("Got overlay notification from player = "+e.name);var t=this,n={leaveFullscreen:function(){t.options.hasOwnProperty("playerNotification")&&t.options.playerNotification("leaveFullscreen")}}[e.name];n&&void 0!==n&&n()},notifyVpaidEvent:function(e,t){var n=this;if(!(n.options.delayExpandUntilVPAIDImpression&&n.delayEventHandler.isSuppress&&y.indexOf(e)>=0)){if("AdVolumeChange"===e)if("html5"===this.decidePlayer(this.options.requiredPlayer)){var i=n.adVideoPlayer.player().muted(),r=n.adVideoPlayer.player().volume();i?i&&(m("set VPAID AdVolumeChange video_mute"),this.dispatchEventToAdunit({name:"video_mute"})):r>0&&(m("set VPAID AdVolumeChange video_unmute"),this.dispatchEventToAdunit({name:"video_unmute"}))}b.indexOf(e)>=0||b.indexOf("vpaid."+e)>=0?n.notifyVpaidEvent_internal(e,t):n.delayEventHandler.push((function(){n.notifyVpaidEvent_internal(e,t)}))}},notifyVpaidEvent_internal:function(e,t){this.options.cbNotification&&this.options.cbNotification("VPAID",e,this.options.targetId,null,t?{vpaidEventData:t}:null),this.options.cbApnVastPlayer&&this.options.cbApnVastPlayer(e)},setChromeSize:function(){this.adVideoPlayer.width="0px",this.adVideoPlayer.height="0px",this.adVideoPlayer.style.width="0px",this.adVideoPlayer.style.height="0px",this.options.targetElement.style.visibility="visible"},click:function(e,t){if(this.isDoneInitialPlay){!1===this.isIosInlineRequired()&&(this.pause(),this.toggleWindowFocus=!1);var n=!1;if(this.options.useCustomOpenForClickthrough){var i=this.options.clickUrls[0];e&&(i=e),n=!0,this.dispatchEventToAdunit({name:"video_click_open_url",url:i})}else if(e)n=!0,window.open(e);else if(this.options.clickUrls&&this.options.clickUrls.length>0){n=!0;var r=this.options.clickUrls[this.options.clickUrls.length-1];window.open(r)}void 0!==t&&!0!==t||this.dispatchEventToAdunit({name:"ad-click",trackClick:n})}else this.play()},getRapamsAndExtensions:function(){var e=this.options.extensions&&this.options.extensions.length>0?"<Extensions>"+this.options.extensions+"</Extensions>":"";return{adParameters:this.options.adParameters,extensions:e}},handleViewability:function(e,t,n){var i=this.options&&this.options.viewability,r=e&&e.name?e.name:null;"fullscreenchange"!==r&&"video_fullscreen"!==r||(r=this.isFullscreen?"fullscreen":"exitFullscreen"),n||"video_duration"!==r||(this.isAlreadyStart=!0);r&&i&&(this.blockTrackingUserActivity&&("video_resume"===r||"video_pause"===r||"video_mute"===r||"video_unmute"===r)||(r===t?function(){var e;(!(e=this.adVideoPlayer&&this.adVideoPlayer.player&&"function"==typeof this.adVideoPlayer.player&&this.adVideoPlayer.player().duration())||void 0===e||e<=0)&&(e=-2),-2===e&&(this.options&&this.options.data&&this.options.data.vastDurationMsec?(!(e=this.options.data.vastDurationMsec/1e3)||null===e||e<=0)&&(e=-2):e=-2);var n=this.options.width,i=this.options.height;if(this.viewabilityTracking.init(this.options,e,n,i,t,function(){return this.isFullscreen}.bind(this),function(){return this.adVideoPlayer&&this.adVideoPlayer.player&&"function"==typeof this.adVideoPlayer.player?this.adVideoPlayer.player().volume():-1}.bind(this)),this.options.expandable)"video_start"===r&&this.viewabilityTracking.invokeEvent("expand"),!1===this.options.vpaid&&"loadstart"===r&&this.viewabilityTracking.invokeEvent("expand"),this.viewabilityTracking.invokeEvent(r);else{if(this.options.overlayPlayer&&l.isMobile()&&this.options.delayStartViewability)return;this.viewabilityTracking.invokeEvent(r)}}.apply(this):function(){this.viewabilityTracking&&this.viewabilityTracking.isReady&&("force_start_viewability"===r&&this.options.delayStartViewability?(this.options.delayStartViewability=!1,this.viewabilityTracking.invokeEvent("video_start")):this.viewabilityTracking.invokeEvent(r))}.apply(this)))},findPathForViewability:function(e){if("video_start",e&&e.name&&"video_start"===e.name){if(this.isDoneFirstLoadStart)return;this.isDoneFirstLoadStart=!0}this.handleViewability(e,"video_start",!0)},dispatchEventToAdunit:function(e,t){var n=this;if("video_start"===e.name){if(n.iframeVideoWrapper.contentDocument){var i=n.iframeVideoWrapper.contentDocument.getElementById(n.divIdForVideo),r=n.iframeVideoWrapper.contentDocument.getElementById(n.videoId);i.style.background=n.options.playerSkin.videoBackgroundColor,r.style.background=n.options.playerSkin.videoBackgroundColor,h.isIOS()&&n.isIosInlineRequired()&&(r.style.opacity=0)}navigator.appVersion.indexOf("Android")>-1&&n.options.hasOwnProperty("targetElementBackground")&&(n.options.targetElement.style.background="",delete n.options.targetElementBackground)}if(navigator.appVersion.indexOf("Android")>-1&&"expand"===e.name&&!n.options.hasOwnProperty("targetElementBackground")&&n.options.targetElement&&n.options.isWaterfall&&(n.options.targetElementBackground=n.options.targetElement.style.background,n.options.targetElement.style.background="#000000"),"video_complete"===e.name){if("preview"===n.options.adType&&n.isSkipped)return void("function"==typeof t&&t());void 0===e.obj&&(e.obj={}),e.obj.videoAdPending=this.options.disableCollapse.replay}if(this.findPathForViewability(e),"collapse"==e.name&&this.verificationManager&&n.verificationManager.dispatchEvent(e.name,e.data,"ad-collapse"),(!0===this.startedReplay||this.isEnded)&&!0===this.options.disableCollapse.replay)if(!1===this.startedReplay&&"rewind"===e.name);else{if("video_complete"===e.name&&"function"==typeof t)return void t();if("ad-click"!==e.name&&-1===e.name.indexOf("IconClick"))return void this.callbackForAdUnit.cbForHandlingDispatchedEvent(e,!0)}"video_skip"===e.name&&!1===c.pushAndCheck(this.options.targetElement.id+"_dispatchEventToAdunit",e.name)||"video_complete"===e.name&&!0===this.isVideoCompleteInjected&&!1===this.options.disableCollapse.replay||(e&&"video_time"!==e.name&&m("(push)"+e.name),this.delayEventHandler.push((function(){n.dispatchEventToAdunit_internal(e,t)})),"video_complete"===e.name&&(this.isVideoCompleteInjected=!0))},dispatchEventToAdunit_internal:function(e,t){if(!this.isCompleted||"video_complete"===e.name||"ad-click"===e.name||"video_skip"===e.name||this.startedReplay){var n=this;if(e&&"video_time"!==e.name&&m("invoke callback : "+JSON.stringify(e)),this.options.hasOwnProperty("overlayPlayer")&&this.options.hiddenControls&&(("firstplay"===e.name&&!this.options.vpaid||"video_impression"===e.name&&this.options.vpaid)&&(!l.isMobile()||"click"!==this.options.initialPlayback&&"mouseover"!==this.options.initialPlayback?h.isIOS()&&h.iOSversion()[0]<10&&"auto"===this.options.initialPlayback&&(this.adVideoPlayer.controlBar.el_.style.removeProperty("display"),delete this.options.hiddenControls):(this.adVideoPlayer.controlBar.el_.style.removeProperty("display"),delete this.options.hiddenControls)),"video_resume"===e.name&&this.options.vpaid&&l.isMobile()&&(this.adVideoPlayer.controlBar.el_.style.removeProperty("display"),delete this.options.hiddenControls)),this.callbackForAdUnit.cbForHandlingDispatchedEvent&&"video_time"!==e.name){if("video_pause"===e.name&&(this.isPlayingVideo=!1),"video_play"!==e.name&&"video_start"!==e.name&&"firstplay"!==e.name||(this.isPlayingVideo=!0,this.isDoneInitialPlay=!0),"video_fullscreen"===e.name)return void setTimeout((function(){e.fullscreenStatus=n.isFullscreen?"enter":"exit",n.callbackForAdUnit.cbForHandlingDispatchedEvent(e)}),1500);if("function"==typeof t&&t(),this.blockTrackingUserActivity&&("video_resume"===e.name||"video_pause"===e.name||"video_mute"===e.name||"video_unmute"===e.name)||(e.player=this,this.callbackForAdUnit.cbForHandlingDispatchedEvent(e)),this.verificationManager){var i=this.prepareOmidEventData(e);i.name&&(this.options.expandable&&"video_start"==e.name&&this.verificationManager.dispatchEvent(i.name,i.data,"ad-expand"),this.verificationManager.dispatchEvent(i.name,i.data,e.name))}}!0===this.options.vpaid&&"video_skip"===e.name&&(this.isSkipped=!0)}},resolveMacro:function(e){switch(e){case"MEDIAPLAYHEAD":return this.options.hasOwnProperty("mediaPlayhead")&&"number"==typeof this.options.mediaPlayhead?l.convertTimeSecondsToString(this.options.mediaPlayhead):-1;case"BREAKPOSITION":return this.options.breakPosition?this.options.breakPosition:-1;case"ADCOUNT":return 1;case"PLACEMENTTYPE":return this.options.overlayPlayer?1:this.options.expandable?3:-1;case"CLIENTUA":return this.options.clientUA&&!this.options.enforcePrivacy?this.options.clientUA:"unknown unknown";case"DEVICEIP":return-1;case"PLAYERCAPABILITIES":var t=[];return this.options.skippable&&this.options.skippable.enabled&&t.push("skip"),this.options.showMute&&t.push("mute"),"auto"===this.options.initialPlayback&&("on"===this.options.initialAudio?t.push("autoplay"):t.push("mautoplay")),this.options.allowFullscreen&&t.push("fullscreen"),t.push("icon"),t.join();case"CLICKTYPE":return this.options.clickUrls&&this.options.clickUrls[0]?1:this.options.learnMore.enabled?2:0;case"PLAYERSTATE":var n=[];return this.isMuted&&n.push("muted"),this.adVideoPlayer.isFullscreen&&"function"==typeof this.adVideoPlayer.isFullscreen&&this.adVideoPlayer.isFullscreen()&&n.push("fullscreen"),n.join();case"PLAYERSIZE":return 1===this.options.width&&1===this.options.height?this.options.macroWidth+","+this.options.macroHeight:this.options.width+","+this.options.height;case"ADPLAYHEAD":if(this.adVideoPlayer.currentTime&&"function"==typeof this.adVideoPlayer.currentTime){var i=this.adVideoPlayer.currentTime();return l.convertTimeSecondsToString(i)}return-1;case"ASSETURI":return this.options.video.url;case"PODSEQUENCE":return-1;case"LIMITADTRACKING":return 0;default:return-1}},prepareOmidEventData:function(e){var t={error:"sessionError",impression:"impression",video_impression:"impression",video_start:"start","video-first-quartile":"firstQuartile","video-mid":"midpoint","video-third-quartile":"thirdQuartile",video_complete:"complete",video_pause:"pause",video_resume:"resume","user-close":"skipped",video_skip:"skipped",video_skipped:"skipped",video_skip:"skipped","audio-mute":"volumeChange","audio-unmute":"volumeChange",video_mute:"volumeChange",video_unmute:"volumeChange",fullscreenchange:"playerStateChange",video_fullscreen:"playerStateChange","video-exit-fullscreen":"playerStateChange","ad-expand":"playerStateChange","ad-collapse":"playerStateChange","ad-click":"adUserInteraction","user-accept-invitation":"adUserInteraction"},n=t.hasOwnProperty(e.name)?t[e.name]:"",i={name:n},r=null;switch(n){case"sessionError":(r={}).errorType=e.code,r.message=e.message;break;case"start":r={},this.options.data.durationMsec?r.duration=this.options.data.durationMsec/1e3:this.adVideoPlayer&&this.adVideoPlayer.player&&"function"==typeof this.adVideoPlayer.player?r.duration=this.adVideoPlayer.player().duration()/1e3:r.duration=-2,this.adVideoPlayer&&this.adVideoPlayer.player&&"function"==typeof this.adVideoPlayer.player?r.videoPlayerVolume=this.adVideoPlayer.player().volume():r.videoPlayerVolume=-1;break;case"volumeChange":r={},"audio-mute"===e.name||"video_mute"===e.name?r.videoPlayerVolume=0:this.adVideoPlayer&&this.adVideoPlayer.player&&"function"==typeof this.adVideoPlayer.player?r.videoPlayerVolume=this.adVideoPlayer.player().volume():r.videoPlayerVolume=-1;break;case"playerStateChange":r={},"video-fullscreen"===e.name||"fullscreenchange"===e.name?r.state=this.isFullscreen?"fullscreen":"normal":"video-exit-fullscreen"===e.name?r.state="normal":"ad-collapse"===e.name?r.state="collapsed":r.state="normal";break;case"adUserInteraction":r={},"ad-click"===e.name?r.interactionType="click":r.interactionType="invitationAccept"}return r&&(i.data=r),i},resizeVideo:function(e,t,n){s.resizeVideo(e,t,this,n)},resizeVideoForSideStream:function(e,t,n){s.resizeVideoForSideStream(this,e,t,n)},isIosInlineRequired:function(){return this.autoplayHandler.isIosInlineRequired(this.options.enableInlineVideoForIos)},resizePlayer:function(e,t){s.resizePlayer(e,t,this)},getFinalSize:function(){return s.getFinalSize(this)},setVastAttribute:function(e){var t,n=this.options;t=e||(this.adVideoPlayer&&this.adVideoPlayer.player?this.adVideoPlayer.player().duration():0),n.data.durationMsec=null!==t?Math.round(1e3*t):0;var i=this.Utils.getMsecTime(n.data.skipOffset,n.data.durationMsec);n.data.skipOffset&&i>=0?(n.data.isVastVideoSkippable=!0,n.data.skipOffsetMsec=i):n.data.skipOffsetMsec=null;var r=n.data.vastProgressEvent;if(r&&"object"==typeof r)for(var o in r){var a=this.Utils.getMsecTime(o.replace(/progress_/g,""),n.data.durationMsec);r[o]=a}},disableTrackingUserActivity:function(e){this.blockTrackingUserActivity=e,this.adVideoPlayer&&this.adVideoPlayer.bigPlayButton&&(this.adVideoPlayer.bigPlayButton.el_.style.opacity=!0===e?0:1)},delayEventsTracking:function(e,t){this.callbackForAdUnit.cbDelayEventsTracking&&this.callbackForAdUnit.cbDelayEventsTracking(e,t)},notifyOverlayPlayerVideoPaused:function(){this.options.tmpActiveListener&&this.options.cbApnVastPlayer&&this.options.cbApnVastPlayer("apn-video-paused-by-device")},checkWhenVideoPausedByDevice:function(e){if(this.options.overlayPlayer&&this.options.cbApnVastPlayer&&this.iframeVideoWrapper&&this.iframeVideoWrapper.contentDocument){var t=null;if("string"==typeof this.videoObjectId)t=this.iframeVideoWrapper.contentDocument.getElementById(this.videoObjectId);else{var n=this.iframeVideoWrapper.contentDocument.getElementsByTagName("VIDEO");if(n&&n.length>0)for(var i=0;i<n.length;i++)if(n[i].src&&n[i].src.length>0){t=n[i];break}}if(t)return e?(this.options.tmpActiveListener=!0,t.addEventListener("pause",this.notifyOverlayPlayerVideoPaused.bind(this))):(delete this.options.tmpActiveListener,t.removeEventListener("pause",this.notifyOverlayPlayerVideoPaused.bind(this))),!0}return!0},forceStartViewability:function(){this.findPathForViewability({name:"force_start_viewability"})},log:m,debug:m,test:function(e,t){var n=this.options;if(n&&n.test&&n.test[e]&&"function"==typeof n.test[e]){var i=function(e){console.debug("%c"+e,"background: red; color: white")};try{n.test[e](t,(function(t,n){var r;t?(r="Unit Test ["+e+"] : "+(n=n+" Succeeded"||"Succeeded"),console.debug("%c"+r,"background: green; color: white")):i("Unit Test ["+e+"] : "+(n=n+" failed"||"Assertion failed"))}),(function(t){console.debug("%cUnit Test Log : ["+e+"] : "+t,"background: gray; color: white")}))}catch(e){i("unit test failed due to : "+e)}}},setFinalAspectRatio:function(e){this.finalAspectRatio=e},getFinalAspectRatio:function(){return this.finalAspectRatio}};e.exports=w,window[f]=w},function(module,exports,__webpack_require__){var __WEBPACK_AMD_DEFINE_ARRAY__,__WEBPACK_AMD_DEFINE_RESULT__;(function(module){var global_options;document.createElement("video"),document.createElement("audio"),document.createElement("track");var vjs=function(e,t,n){var i;if(global_options=t,"string"==typeof e){if(0===e.indexOf("#")&&(e=e.slice(1)),vjs.players[e])return t&&vjs.log.warn('Player "'+e+'" is already initialised. Options will not be applied.'),n&&vjs.players[e].ready(n),vjs.players[e];i=vjs.el(e)}else i=e;if(!i||!i.nodeName)throw new TypeError("The element or ID supplied is not valid. (videojs)");return i.player||new vjs.Player(i,t,n)},videojs=window.videojs_apn=vjs;function _handleMultipleEvents(e,t,n,i){vjs.arr.forEach(n,(function(n){e(t,n,i)}))}vjs.VERSION="GENERATED_FULL_VSN",vjs.options={techOrder:["html5"],html5:{},width:300,height:150,defaultVolume:0,playbackRates:[],inactivityTimeout:500,children:{mediaLoader:{},posterImage:{},loadingSpinner:{},textTrackDisplay:{},bigPlayButton:{},controlBar:{},errorDisplay:{},textTrackSettings:{}},language:document.getElementsByTagName("html")[0].getAttribute("lang")||navigator.languages&&navigator.languages[0]||navigator.userLanguage||navigator.language||"en",languages:{},notSupportedMessage:"No compatible source was found for this video."},vjs.addLanguage=function(e,t){return void 0!==vjs.options.languages[e]?vjs.options.languages[e]=vjs.util.mergeOptions(vjs.options.languages[e],t):vjs.options.languages[e]=t,vjs.options.languages},vjs.players={},
/*!
	 * Custom Universal Module Definition (UMD)
	 *
	 * Video.js will never be a non-browser lib so we can simplify UMD a bunch and
	 * still support requirejs and browserify. This also needs to be closure
	 * compiler compatible, so string keys are used.
	 */
__webpack_require__(5).amd?(__WEBPACK_AMD_DEFINE_ARRAY__=[],__WEBPACK_AMD_DEFINE_RESULT__=function(){return videojs}.apply(exports,__WEBPACK_AMD_DEFINE_ARRAY__),void 0===__WEBPACK_AMD_DEFINE_RESULT__||(module.exports=__WEBPACK_AMD_DEFINE_RESULT__)):module.exports=videojs,vjs.CoreObject=vjs.CoreObject=function(){},vjs.CoreObject.extend=function(e){var t,n;for(var i in t=(e=e||{}).init||e.init||this.prototype.init||this.prototype.init||function(){},((n=function(){t.apply(this,arguments)}).prototype=vjs.obj.create(this.prototype)).constructor=n,n.extend=vjs.CoreObject.extend,n.create=vjs.CoreObject.create,e)e.hasOwnProperty(i)&&(n.prototype[i]=e[i]);return n},vjs.CoreObject.create=function(){var e=vjs.obj.create(this.prototype);return this.apply(e,arguments),e},vjs.on=function(e,t,n){if(vjs.obj.isArray(t))return _handleMultipleEvents(vjs.on,e,t,n);var i=vjs.getData(e);i.handlers||(i.handlers={}),i.handlers[t]||(i.handlers[t]=[]),n.guid||(n.guid=vjs.guid++),i.handlers[t].push(n),i.dispatcher||(i.disabled=!1,i.dispatcher=function(t){if(!i.disabled){t=vjs.fixEvent(t);var n=i.handlers[t.type];if(n)for(var r=n.slice(0),o=0,a=r.length;o<a&&!t.isImmediatePropagationStopped();o++)r[o].call(e,t)}}),1==i.handlers[t].length&&(e.addEventListener?e.addEventListener(t,i.dispatcher,!1):e.attachEvent&&e.attachEvent("on"+t,i.dispatcher))},vjs.off=function(e,t,n){if(vjs.hasData(e)){var i=vjs.getData(e);if(i.handlers){if(vjs.obj.isArray(t))return _handleMultipleEvents(vjs.off,e,t,n);var r=function(t){i.handlers[t]=[],vjs.cleanUpEvents(e,t)};if(t){var o=i.handlers[t];if(o)if(n){if(n.guid)for(var a=0;a<o.length;a++)o[a].guid===n.guid&&o.splice(a--,1);vjs.cleanUpEvents(e,t)}else r(t)}else for(var s in i.handlers)r(s)}}},vjs.cleanUpEvents=function(e,t){var n=vjs.getData(e);0===n.handlers[t].length&&(delete n.handlers[t],e.removeEventListener?e.removeEventListener(t,n.dispatcher,!1):e.detachEvent&&e.detachEvent("on"+t,n.dispatcher)),vjs.isEmpty(n.handlers)&&(delete n.handlers,delete n.dispatcher,delete n.disabled),vjs.isEmpty(n)&&vjs.removeData(e)},vjs.fixEvent=function(e){function t(){return!0}function n(){return!1}if(!e||!e.isPropagationStopped){var i=e||window.event;for(var r in e={},i)"layerX"!==r&&"layerY"!==r&&"keyLocation"!==r&&("returnValue"==r&&i.preventDefault||(e[r]=i[r]));if(e.target||(e.target=e.srcElement||document),e.relatedTarget=e.fromElement===e.target?e.toElement:e.fromElement,e.preventDefault=function(){i.preventDefault&&i.preventDefault(),e.returnValue=!1,e.isDefaultPrevented=t,e.defaultPrevented=!0},e.isDefaultPrevented=n,e.defaultPrevented=!1,e.stopPropagation=function(){i.stopPropagation&&i.stopPropagation(),e.cancelBubble=!0,e.isPropagationStopped=t},e.isPropagationStopped=n,e.stopImmediatePropagation=function(){i.stopImmediatePropagation&&i.stopImmediatePropagation(),e.isImmediatePropagationStopped=t,e.stopPropagation()},e.isImmediatePropagationStopped=n,null!=e.clientX){var o=document.documentElement,a=document.body;e.pageX=e.clientX+(o&&o.scrollLeft||a&&a.scrollLeft||0)-(o&&o.clientLeft||a&&a.clientLeft||0),e.pageY=e.clientY+(o&&o.scrollTop||a&&a.scrollTop||0)-(o&&o.clientTop||a&&a.clientTop||0)}e.which=e.charCode||e.keyCode,null!=e.button&&(e.button=1&e.button?0:4&e.button?1:2&e.button?2:0)}return e},vjs.trigger=function(e,t){var n=vjs.hasData(e)?vjs.getData(e):{},i=e.parentNode||e.ownerDocument;if("string"==typeof t&&(t={type:t,target:e}),t=vjs.fixEvent(t),n.dispatcher&&n.dispatcher.call(e,t),i&&!t.isPropagationStopped()&&!1!==t.bubbles)vjs.trigger(i,t);else if(!i&&!t.defaultPrevented){var r=vjs.getData(t.target);t.target[t.type]&&(r.disabled=!0,"function"==typeof t.target[t.type]&&t.target[t.type](),r.disabled=!1)}return!t.defaultPrevented},vjs.one=function(e,t,n){if(vjs.obj.isArray(t))return _handleMultipleEvents(vjs.one,e,t,n);var i=function(){vjs.off(e,t,i),n.apply(this,arguments)};i.guid=n.guid=n.guid||vjs.guid++,vjs.on(e,t,i)};var hasOwnProp=Object.prototype.hasOwnProperty,cacheManager=__webpack_require__(6),track,major,minor,match,createTrackHelper,origSetSource,origDisposeSourceHandler,canPlayType,mpegurlRE,mp4RE,loadTrack,parseCues,indexOf;function _logType(e,t){}vjs.createEl=function(e,t){var n;return e=e||"div",t=t||{},n=document.createElement(e),vjs.obj.each(t,(function(e,t){-1!==e.indexOf("aria-")||"role"==e?n.setAttribute(e,t):n[e]=t})),n},vjs.capitalize=function(e){return e.charAt(0).toUpperCase()+e.slice(1)},vjs.obj={},vjs.obj.create=Object.create||function(e){function t(){}return t.prototype=e,new t},vjs.obj.each=function(e,t,n){for(var i in e)hasOwnProp.call(e,i)&&t.call(n||this,i,e[i])},vjs.obj.merge=function(e,t){if(!t)return e;for(var n in t)hasOwnProp.call(t,n)&&(e[n]=t[n]);return e},vjs.obj.deepMerge=function(e,t){var n,i,r;for(n in e=vjs.obj.copy(e),t)hasOwnProp.call(t,n)&&(i=e[n],r=t[n],vjs.obj.isPlain(i)&&vjs.obj.isPlain(r)?e[n]=vjs.obj.deepMerge(i,r):e[n]=t[n]);return e},vjs.obj.copy=function(e){return vjs.obj.merge({},e)},vjs.obj.isPlain=function(e){return!!e&&"object"==typeof e&&"[object Object]"===e.toString()&&e.constructor===Object},vjs.obj.isArray=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)},vjs.isNaN=function(e){return e!=e},vjs.bind=function(e,t,n){t.guid||(t.guid=vjs.guid++);var i=function(){return t.apply(e,arguments)};return i.guid=n?n+"_"+t.guid:t.guid,i},vjs.cache={},vjs.guid=1,vjs.expando="vdata"+(new Date).getTime(),vjs.getData=function(e){var t=e[vjs.expando];return t||(t=e[vjs.expando]=vjs.guid++),vjs.cache[t]||(vjs.cache[t]={}),vjs.cache[t]},vjs.hasData=function(e){var t=e[vjs.expando];return!(!t||vjs.isEmpty(vjs.cache[t]))},vjs.removeData=function(e){var t=e[vjs.expando];if(t){delete vjs.cache[t];try{delete e[vjs.expando]}catch(t){e.removeAttribute?e.removeAttribute(vjs.expando):e[vjs.expando]=null}}},vjs.isEmpty=function(e){for(var t in e)if(null!==e[t])return!1;return!0},vjs.hasClass=function(e,t){try{if(e)return-1!==(" "+e.className+" ").indexOf(" "+t+" ");vjs.log("Error in hasClass, element does not exist")}catch(e){vjs.log("Exception in hasClass",e)}},vjs.addClass=function(e,t){try{e&&!vjs.hasClass(e,t)?e.className=""===e.className?t:e.className+" "+t:vjs.log("Error in addClass, class or element doesn't exist")}catch(e){vjs.log("Exception in addClass",e)}},vjs.removeClass=function(e,t){var n,i;if(vjs.hasClass(e,t)){for(i=(n=e.className.split(" ")).length-1;i>=0;i--)n[i]===t&&n.splice(i,1);e.className=n.join(" ")}},vjs.TEST_VID=vjs.createEl("video"),track=document.createElement("track"),track.kind="captions",track.srclang="en",track.label="English",vjs.TEST_VID.appendChild(track),vjs.USER_AGENT=navigator.userAgent,vjs.IS_IPHONE=/iPhone/i.test(vjs.USER_AGENT),vjs.IS_IPAD=/iPad/i.test(vjs.USER_AGENT),vjs.IS_IPOD=/iPod/i.test(vjs.USER_AGENT),vjs.IS_IOS=vjs.IS_IPHONE||vjs.IS_IPAD||vjs.IS_IPOD,vjs.IOS_VERSION=function(){var e=vjs.USER_AGENT.match(/OS (\d+)_/i);if(e&&e[1])return e[1]}(),vjs.IS_ANDROID=/Android/i.test(vjs.USER_AGENT),vjs.ANDROID_VERSION=(match=vjs.USER_AGENT.match(/Android (\d+)(?:\.(\d+))?(?:\.(\d+))*/i),match?(major=match[1]&&parseFloat(match[1]),minor=match[2]&&parseFloat(match[2]),major&&minor?parseFloat(match[1]+"."+match[2]):major||null):null),vjs.IS_OLD_ANDROID=vjs.IS_ANDROID&&/webkit/i.test(vjs.USER_AGENT)&&vjs.ANDROID_VERSION<2.3,vjs.IS_FIREFOX=/Firefox/i.test(vjs.USER_AGENT),vjs.IS_CHROME=/Chrome/i.test(vjs.USER_AGENT),vjs.IS_IE8=/MSIE\s8\.0/.test(vjs.USER_AGENT),vjs.TOUCH_ENABLED=!!("ontouchstart"in window||window.DocumentTouch&&document instanceof window.DocumentTouch),vjs.BACKGROUND_SIZE_SUPPORTED="backgroundSize"in vjs.TEST_VID.style,vjs.setElementAttributes=function(e,t){vjs.obj.each(t,(function(t,n){null==n||!1===n?e.removeAttribute(t):e.setAttribute(t,!0===n?"":n)}))},vjs.getElementAttributes=function(e){var t,n,i,r,o;if(t={},n=",autoplay,controls,loop,muted,default,",e&&e.attributes&&e.attributes.length>0)for(var a=(i=e.attributes).length-1;a>=0;a--)r=i[a].name,o=i[a].value,"boolean"!=typeof e[r]&&-1===n.indexOf(","+r+",")||(o=null!==o),t[r]=o;return t},vjs.getComputedDimension=function(e,t){var n="";return document.defaultView&&document.defaultView.getComputedStyle?n=document.defaultView.getComputedStyle(e,"").getPropertyValue(t):e.currentStyle&&(n=e["client"+t.substr(0,1).toUpperCase()+t.substr(1)]+"px"),n},vjs.insertFirst=function(e,t){t.firstChild?t.insertBefore(e,t.firstChild):t.appendChild(e)},vjs.browser={},vjs.el=function(e){return 0===e.indexOf("#")&&(e=e.slice(1)),document.getElementById(e)},vjs.formatTime=function(e,t){t=t||e;var n=Math.floor(e%60),i=Math.floor(e/60%60),r=Math.floor(e/3600),o=Math.floor(t/60%60),a=Math.floor(t/3600);return(isNaN(e)||e===1/0)&&(r=i=n="-"),(r=r>0||a>0?r+":":"")+(i=((r||o>=10)&&i<10?"0"+i:i)+":")+(n=n<10?"0"+n:n)},vjs.blockTextSelection=function(){document.body.focus(),document.onselectstart=function(){return!1}},vjs.unblockTextSelection=function(){document.onselectstart=function(){return!0}},vjs.trim=function(e){return(e+"").replace(/^\s+|\s+$/g,"")},vjs.round=function(e,t){return t||(t=0),Math.round(e*Math.pow(10,t))/Math.pow(10,t)},vjs.createTimeRange=function(e,t){return void 0===e&&void 0===t?{length:0,start:function(){throw new Error("This TimeRanges object is empty")},end:function(){throw new Error("This TimeRanges object is empty")}}:{length:1,start:function(){return e},end:function(){return t}}},vjs.setVjsStorage=function(e,t){try{cacheManager.setGenericData(e,t)}catch(e){vjs.log("cacheManager Error (VideoJS)",e)}},vjs.getAbsoluteURL=function(e){return e.match(/^https?:\/\//)||(e=vjs.createEl("div",{innerHTML:'<a href="'+e+'">x</a>'}).firstChild.href),e},vjs.parseUrl=function(e){var t,n,i,r,o;r=["protocol","hostname","port","pathname","search","hash","host"],(i=""===(n=vjs.createEl("a",{href:e})).host&&"file:"!==n.protocol)&&((t=vjs.createEl("div")).innerHTML='<a href="'+e+'"></a>',n=t.firstChild,t.setAttribute("style","display:none; position:absolute;"),document.body.appendChild(t)),o={};for(var a=0;a<r.length;a++)o[r[a]]=n[r[a]];return"http:"===o.protocol&&(o.host=o.host.replace(/:80$/,"")),"https:"===o.protocol&&(o.host=o.host.replace(/:443$/,"")),i&&document.body.removeChild(t),o},vjs.log=function(){_logType(null,arguments)},vjs.log.history=[],vjs.log.error=function(){_logType("error",arguments)},vjs.log.warn=function(){_logType("warn",arguments)},vjs.findPosition=function(e){var t,n,i,r,o,a,s,l,d;return e.getBoundingClientRect&&e.parentNode&&(t=e.getBoundingClientRect()),t?(n=document.documentElement,i=document.body,r=n.clientLeft||i.clientLeft||0,o=window.pageXOffset||i.scrollLeft,a=t.left+o-r,s=n.clientTop||i.clientTop||0,l=window.pageYOffset||i.scrollTop,d=t.top+l-s,{left:vjs.round(a),top:vjs.round(d)}):{left:0,top:0}},vjs.arr={},vjs.arr.forEach=function(e,t,n){if(vjs.obj.isArray(e)&&t instanceof Function)for(var i=0,r=e.length;i<r;++i)t.call(n||vjs,e[i],i,e);return e},vjs.util={},vjs.util.mergeOptions=function(e,t){var n,i,r;for(n in e=vjs.obj.copy(e),t)t.hasOwnProperty(n)&&(i=e[n],r=t[n],vjs.obj.isPlain(i)&&vjs.obj.isPlain(r)?e[n]=vjs.util.mergeOptions(i,r):e[n]=t[n]);return e},vjs.EventEmitter=function(){},vjs.EventEmitter.prototype.allowedEvents_={},vjs.EventEmitter.prototype.on=function(e,t){var n=this.addEventListener;this.addEventListener=Function.prototype,vjs.on(this,e,t),this.addEventListener=n},vjs.EventEmitter.prototype.addEventListener=vjs.EventEmitter.prototype.on,vjs.EventEmitter.prototype.off=function(e,t){vjs.off(this,e,t)},vjs.EventEmitter.prototype.removeEventListener=vjs.EventEmitter.prototype.off,vjs.EventEmitter.prototype.one=function(e,t){vjs.one(this,e,t)},vjs.EventEmitter.prototype.trigger=function(e){var t=e.type||e;"string"==typeof e&&(e={type:t}),e=vjs.fixEvent(e),this.allowedEvents_[t]&&this["on"+t]&&this["on"+t](e),vjs.trigger(this,e)},vjs.EventEmitter.prototype.dispatchEvent=vjs.EventEmitter.prototype.trigger,vjs.Component=vjs.CoreObject.extend({init:function(e,t,n){this.player_=e,this.options_=vjs.obj.copy(this.options_),t=this.options(t),this.id_=t.id||t.el&&t.el.id,this.id_||(this.id_=(e.id&&e.id()||"no_player")+"_component_"+vjs.guid++),this.name_=t.name||null,this.el_=t.el||this.createEl(),this.children_=[],this.childIndex_={},this.childNameIndex_={},this.initChildren(),this.ready(n),!1!==t.reportTouchActivity&&this.enableTouchActivity()}}),vjs.Component.prototype.dispose=function(){if(this.trigger({type:"dispose",bubbles:!1}),this.children_)for(var e=this.children_.length-1;e>=0;e--)this.children_[e].dispose&&this.children_[e].dispose();this.children_=null,this.childIndex_=null,this.childNameIndex_=null,this.off(),this.el_.parentNode&&this.el_.parentNode.removeChild(this.el_),vjs.removeData(this.el_),this.el_=null},vjs.Component.prototype.player_=!0,vjs.Component.prototype.player=function(){return this.player_},vjs.Component.prototype.options_,vjs.Component.prototype.options=function(e){return void 0===e?this.options_:this.options_=vjs.util.mergeOptions(this.options_,e)},vjs.Component.prototype.el_,vjs.Component.prototype.createEl=function(e,t){return vjs.createEl(e,t)},vjs.Component.prototype.localize=function(e){var t=this.player_.language(),n=this.player_.languages();return n&&n[t]&&n[t][e]?n[t][e]:e},vjs.Component.prototype.el=function(){return this.el_},vjs.Component.prototype.contentEl_,vjs.Component.prototype.contentEl=function(){return this.contentEl_||this.el_},vjs.Component.prototype.id_,vjs.Component.prototype.id=function(){return this.id_},vjs.Component.prototype.name_,vjs.Component.prototype.name=function(){return this.name_},vjs.Component.prototype.children_,vjs.Component.prototype.children=function(){return this.children_},vjs.Component.prototype.childIndex_,vjs.Component.prototype.getChildById=function(e){return this.childIndex_[e]},vjs.Component.prototype.childNameIndex_,vjs.Component.prototype.getChild=function(e){return this.childNameIndex_[e]},vjs.Component.prototype.addChild=function(e,t){var n,i,r;return"string"==typeof e?(r=e,i=(t=t||{}).componentClass||vjs.capitalize(r),t.name=r,n=new window.videojs_apn[i](this.player_||this,t)):n=e,this.children_.push(n),"function"==typeof n.id&&(this.childIndex_[n.id()]=n),(r=r||n.name&&n.name())&&(this.childNameIndex_[r]=n),"function"==typeof n.el&&n.el()&&this.contentEl().appendChild(n.el()),n},vjs.Component.prototype.removeChild=function(e){if("string"==typeof e&&(e=this.getChild(e)),e&&this.children_){for(var t=!1,n=this.children_.length-1;n>=0;n--)if(this.children_[n]===e){t=!0,this.children_.splice(n,1);break}if(t){this.childIndex_[e.id()]=null,this.childNameIndex_[e.name()]=null;var i=e.el();i&&i.parentNode===this.contentEl()&&this.contentEl().removeChild(e.el())}}},vjs.Component.prototype.initChildren=function(){var e,t,n,i,r,o,a;if(n=(t=(e=this).options()).children)if(a=function(n,i){void 0!==t[n]&&(i=t[n]),!1!==i&&(e[n]=e.addChild(n,i))},vjs.obj.isArray(n))for(var s=0;s<n.length;s++)"string"==typeof(i=n[s])?(r=i,o={}):(r=i.name,o=i),a(r,o);else vjs.obj.each(n,a)},vjs.Component.prototype.buildCSSClass=function(){return""},vjs.Component.prototype.on=function(e,t,n){var i,r,o,a,s,l;return"string"==typeof e||vjs.obj.isArray(e)?vjs.on(this.el_,e,vjs.bind(this,t)):(i=e,r=t,o=vjs.bind(this,n),l=this,(a=function(){l.off(i,r,o)}).guid=o.guid,this.on("dispose",a),(s=function(){l.off("dispose",a)}).guid=o.guid,e.nodeName?(vjs.on(i,r,o),vjs.on(i,"dispose",s)):"function"==typeof e.on&&(i.on(r,o),i.on("dispose",s))),this},vjs.Component.prototype.off=function(e,t,n){var i,r,o;return!e||"string"==typeof e||vjs.obj.isArray(e)?vjs.off(this.el_,e,t):(i=e,r=t,o=vjs.bind(this,n),this.off("dispose",o),e.nodeName?(vjs.off(i,r,o),vjs.off(i,"dispose",o)):(i.off(r,o),i.off("dispose",o))),this},vjs.Component.prototype.one=function(e,t,n){var i,r,o,a,s;return"string"==typeof e||vjs.obj.isArray(e)?vjs.one(this.el_,e,vjs.bind(this,t)):(i=e,r=t,o=vjs.bind(this,n),a=this,(s=function(){a.off(i,r,s),o.apply(this,arguments)}).guid=o.guid,this.on(i,r,s)),this},vjs.Component.prototype.trigger=function(e){return vjs.trigger(this.el_,e),this},vjs.Component.prototype.isReady_,vjs.Component.prototype.isReadyOnInitFinish_=!0,vjs.Component.prototype.readyQueue_,vjs.Component.prototype.ready=function(e){return e&&(this.isReady_?e.call(this):(void 0===this.readyQueue_&&(this.readyQueue_=[]),this.readyQueue_.push(e))),this},vjs.Component.prototype.triggerReady=function(){this.isReady_=!0;var e=this.readyQueue_;if(e&&e.length>0){for(var t=0,n=e.length;t<n;t++)e[t].call(this);this.readyQueue_=[],this.trigger("ready")}},vjs.Component.prototype.hasClass=function(e){return vjs.hasClass(this.el_,e)},vjs.Component.prototype.addClass=function(e){return vjs.addClass(this.el_,e),this},vjs.Component.prototype.removeClass=function(e){return vjs.removeClass(this.el_,e),this},vjs.Component.prototype.show=function(){return this.removeClass("vjs-hidden"),this},vjs.Component.prototype.hide=function(){return this.addClass("vjs-hidden"),this},vjs.Component.prototype.lockShowing=function(){return this.addClass("vjs-lock-showing"),this},vjs.Component.prototype.unlockShowing=function(){return this.removeClass("vjs-lock-showing"),this},vjs.Component.prototype.disable=function(){this.hide(),this.show=function(){}},vjs.Component.prototype.width=function(e,t){return this.dimension("width",e,t)},vjs.Component.prototype.height=function(e,t){return this.dimension("height",e,t)},vjs.Component.prototype.dimensions=function(e,t){return this.width(e,!0).height(t)},vjs.Component.prototype.dimension=function(e,t,n){if(void 0!==t)return(null===t||vjs.isNaN(t))&&(t=0),-1!==(""+t).indexOf("%")||-1!==(""+t).indexOf("px")?this.el_.style[e]=t:this.el_.style[e]="auto"===t?"":t+"px",n||this.trigger("resize"),this;if(!this.el_)return 0;var i=this.el_.style[e],r=i.indexOf("px");return-1!==r?parseInt(i.slice(0,r),10):parseInt(this.el_["offset"+vjs.capitalize(e)],10)},vjs.Component.prototype.onResize,vjs.Component.prototype.emitTapEvents=function(){var e,t,n,i,r,o;e=0,t=null,this.on("touchstart",(function(i){1===i.touches.length&&(t=vjs.obj.copy(i.touches[0]),e=(new Date).getTime(),n=!0)})),this.on("touchmove",(function(e){e.touches.length>1?n=!1:t&&(r=e.touches[0].pageX-t.pageX,o=e.touches[0].pageY-t.pageY,Math.sqrt(r*r+o*o)>10&&(n=!1))})),i=function(){n=!1},this.on("touchleave",i),this.on("touchcancel",i),this.on("touchend",(function(i){t=null,!0===n&&(new Date).getTime()-e<200&&(i.preventDefault(),this.trigger("tap"))}))},vjs.Component.prototype.enableTouchActivity=function(){var e,t,n;this.player().reportUserActivity&&(e=vjs.bind(this.player(),this.player().reportUserActivity),this.on("touchstart",(function(){e(),this.clearInterval(t),t=this.setInterval(e,250)})),n=function(n){e(),this.clearInterval(t)},this.on("touchmove",e),this.on("touchend",n),this.on("touchcancel",n))},vjs.Component.prototype.setTimeout=function(e,t){e=vjs.bind(this,e);var n=setTimeout(e,t),i=function(){this.clearTimeout(n)};return i.guid="vjs-timeout-"+n,this.on("dispose",i),n},vjs.Component.prototype.clearTimeout=function(e){clearTimeout(e);var t=function(){};return t.guid="vjs-timeout-"+e,this.off("dispose",t),e},vjs.Component.prototype.setInterval=function(e,t){e=vjs.bind(this,e);var n=setInterval(e,t),i=function(){this.clearInterval(n)};return i.guid="vjs-interval-"+n,this.on("dispose",i),n},vjs.Component.prototype.clearInterval=function(e){clearInterval(e);var t=function(){};return t.guid="vjs-interval-"+e,this.off("dispose",t),e},vjs.Button=vjs.Component.extend({init:function(e,t){vjs.Component.call(this,e,t),this.emitTapEvents(),this.on("tap",this.onClick),this.on("click",this.onClick),this.on("focus",this.onFocus),this.on("blur",this.onBlur)}}),vjs.Button.prototype.createEl=function(e,t){var n;return t=vjs.obj.merge({className:this.buildCSSClass(),role:"button","aria-live":"polite",tabIndex:0},t),n=vjs.Component.prototype.createEl.call(this,e,t),t.innerHTML||(this.contentEl_=vjs.createEl("div",{className:"vjs-control-content"}),this.controlText_=vjs.createEl("span",{className:"vjs-control-text",innerHTML:this.localize(this.buttonText)||"Need Text"}),this.contentEl_.appendChild(this.controlText_),n.appendChild(this.contentEl_)),n},vjs.Button.prototype.buildCSSClass=function(){return"vjs-control "+vjs.Component.prototype.buildCSSClass.call(this)},vjs.Button.prototype.onClick=function(){},vjs.Button.prototype.onFocus=function(){vjs.on(document,"keydown",vjs.bind(this,this.onKeyPress))},vjs.Button.prototype.onKeyPress=function(e){32!=e.which&&13!=e.which||(e.preventDefault(),this.onClick())},vjs.Button.prototype.onBlur=function(){vjs.off(document,"keydown",vjs.bind(this,this.onKeyPress))},vjs.Slider=vjs.Component.extend({init:function(e,t){vjs.Component.call(this,e,t),this.bar=this.getChild(this.options_.barName),this.handle=this.getChild(this.options_.handleName),this.on("mousedown",this.onMouseDown),this.on("touchstart",this.onMouseDown),this.on("focus",this.onFocus),this.on("blur",this.onBlur),this.on("click",this.onClick),this.on(e,"controlsvisible",this.update),this.on(e,this.playerEvent,this.update)}}),vjs.Slider.prototype.createEl=function(e,t){return(t=t||{}).className=t.className+" vjs-slider",t=vjs.obj.merge({role:"slider","aria-valuenow":0,"aria-valuemin":0,"aria-valuemax":100,tabIndex:0},t),vjs.Component.prototype.createEl.call(this,e,t)},vjs.Slider.prototype.onMouseDown=function(e){e.preventDefault(),vjs.blockTextSelection(),this.addClass("vjs-sliding"),this.on(document,"mousemove",this.onMouseMove),this.on(document,"mouseup",this.onMouseUp),this.on(document,"touchmove",this.onMouseMove),this.on(document,"touchend",this.onMouseUp),this.onMouseMove(e)},vjs.Slider.prototype.onMouseMove=function(){},vjs.Slider.prototype.onMouseUp=function(){vjs.unblockTextSelection(),this.removeClass("vjs-sliding"),this.off(document,"mousemove",this.onMouseMove),this.off(document,"mouseup",this.onMouseUp),this.off(document,"touchmove",this.onMouseMove),this.off(document,"touchend",this.onMouseUp),this.update()},vjs.Slider.prototype.update=function(){if(this.el_){var e,t=this.getPercent(),n=this.handle,i=this.bar;if(("number"!=typeof t||t!=t||t<0||t===1/0)&&(t=0),e=t,n){var r=this.el_.offsetWidth,o=n.el().offsetWidth,a=o?o/r:0,s=t*(1-a);e=s+a/2,n.el().style.left=vjs.round(100*s,2)+"%"}i&&(i.el().style.width=vjs.round(100*e,2)+"%")}},vjs.Slider.prototype.calculateDistance=function(e){var t,n,i,r,o,a,s,l,d;if(t=this.el_,n=vjs.findPosition(t),o=a=t.offsetWidth,s=this.handle,this.options().vertical){if(r=n.top,d=e.changedTouches?e.changedTouches[0].pageY:e.pageY,s){var c=s.el().offsetHeight;r+=c/2,a-=c}return Math.max(0,Math.min(1,(r-d+a)/a))}if(i=n.left,l=e.changedTouches?e.changedTouches[0].pageX:e.pageX,s){var u=s.el().offsetWidth;i+=u/2,o-=u}return Math.max(0,Math.min(1,(l-i)/o))},vjs.Slider.prototype.onFocus=function(){this.on(document,"keydown",this.onKeyPress)},vjs.Slider.prototype.onKeyPress=function(e){37==e.which||40==e.which?(e.preventDefault(),this.stepBack()):38!=e.which&&39!=e.which||(e.preventDefault(),this.stepForward())},vjs.Slider.prototype.onBlur=function(){this.off(document,"keydown",this.onKeyPress)},vjs.Slider.prototype.onClick=function(e){e.stopImmediatePropagation(),e.preventDefault()},vjs.SliderHandle=vjs.Component.extend(),vjs.SliderHandle.prototype.defaultValue=0,vjs.SliderHandle.prototype.createEl=function(e,t){return(t=t||{}).className=t.className+" vjs-slider-handle",t=vjs.obj.merge({innerHTML:'<span class="vjs-control-text">'+this.defaultValue+"</span>"},t),vjs.Component.prototype.createEl.call(this,"div",t)},vjs.Menu=vjs.Component.extend(),vjs.Menu.prototype.addItem=function(e){this.addChild(e),e.on("click",vjs.bind(this,(function(){this.unlockShowing()})))},vjs.Menu.prototype.createEl=function(){var e=this.options().contentElType||"ul";this.contentEl_=vjs.createEl(e,{className:"vjs-menu-content"});var t=vjs.Component.prototype.createEl.call(this,"div",{append:this.contentEl_,className:"vjs-menu"});return t.appendChild(this.contentEl_),vjs.on(t,"click",(function(e){e.preventDefault(),e.stopImmediatePropagation()})),t},vjs.MenuItem=vjs.Button.extend({init:function(e,t){vjs.Button.call(this,e,t),this.selected(t.selected)}}),vjs.MenuItem.prototype.createEl=function(e,t){return vjs.Button.prototype.createEl.call(this,"li",vjs.obj.merge({className:"vjs-menu-item",innerHTML:this.localize(this.options_.label)},t))},vjs.MenuItem.prototype.onClick=function(){this.selected(!0)},vjs.MenuItem.prototype.selected=function(e){e?(this.addClass("vjs-selected"),this.el_.setAttribute("aria-selected",!0)):(this.removeClass("vjs-selected"),this.el_.setAttribute("aria-selected",!1))},vjs.MenuButton=vjs.Button.extend({init:function(e,t){vjs.Button.call(this,e,t),this.update(),this.on("keydown",this.onKeyPress),this.el_.setAttribute("aria-haspopup",!0),this.el_.setAttribute("role","button")}}),vjs.MenuButton.prototype.update=function(){var e=this.createMenu();this.menu&&this.removeChild(this.menu),this.menu=e,this.addChild(e),this.items&&0===this.items.length?this.hide():this.items&&this.items.length>1&&this.show()},vjs.MenuButton.prototype.buttonPressed_=!1,vjs.MenuButton.prototype.createMenu=function(){var e=new vjs.Menu(this.player_);if(this.options().title&&e.contentEl().appendChild(vjs.createEl("li",{className:"vjs-menu-title",innerHTML:vjs.capitalize(this.options().title),tabindex:-1})),this.items=this.createItems(),this.items)for(var t=0;t<this.items.length;t++)e.addItem(this.items[t]);return e},vjs.MenuButton.prototype.createItems=function(){},vjs.MenuButton.prototype.buildCSSClass=function(){return this.className+" vjs-menu-button "+vjs.Button.prototype.buildCSSClass.call(this)},vjs.MenuButton.prototype.onFocus=function(){},vjs.MenuButton.prototype.onBlur=function(){},vjs.MenuButton.prototype.onClick=function(){this.one("mouseout",vjs.bind(this,(function(){this.menu.unlockShowing(),this.el_.blur()}))),this.buttonPressed_?this.unpressButton():this.pressButton()},vjs.MenuButton.prototype.onKeyPress=function(e){32==e.which||13==e.which?(this.buttonPressed_?this.unpressButton():this.pressButton(),e.preventDefault()):27==e.which&&(this.buttonPressed_&&this.unpressButton(),e.preventDefault())},vjs.MenuButton.prototype.pressButton=function(){this.buttonPressed_=!0,this.menu.lockShowing(),this.el_.setAttribute("aria-pressed",!0),this.items&&this.items.length>0&&this.items[0].el().focus()},vjs.MenuButton.prototype.unpressButton=function(){this.buttonPressed_=!1,this.menu.unlockShowing(),this.el_.setAttribute("aria-pressed",!1)},vjs.MediaError=function(e){"number"==typeof e?this.code=e:"string"==typeof e?this.message=e:"object"==typeof e&&vjs.obj.merge(this,e),this.message||(this.message="")},vjs.MediaError.prototype.code=0,vjs.MediaError.prototype.message="",vjs.MediaError.prototype.status=null,vjs.MediaError.errorTypes=["MEDIA_ERR_CUSTOM","MEDIA_ERR_ABORTED","MEDIA_ERR_NETWORK","MEDIA_ERR_DECODE","MEDIA_ERR_SRC_NOT_SUPPORTED","MEDIA_ERR_ENCRYPTED"],vjs.MediaError.defaultMessages={1:"You aborted the video playback",2:"A network error caused the video download to fail part-way.",3:"The video playback was aborted due to a corruption problem or because the video used features your browser did not support.",4:"The video could not be loaded, either because the server or network failed or because the format is not supported.",5:"The video is encrypted and we do not have the keys to decrypt it."};for(var errNum=0;errNum<vjs.MediaError.errorTypes.length;errNum++)vjs.MediaError[vjs.MediaError.errorTypes[errNum]]=errNum,vjs.MediaError.prototype[vjs.MediaError.errorTypes[errNum]]=errNum;!function(){var e,t,n,i;for(vjs.browser.fullscreenAPI,t=(e=[["requestFullscreen","exitFullscreen","fullscreenElement","fullscreenEnabled","fullscreenchange","fullscreenerror"],["webkitRequestFullscreen","webkitExitFullscreen","webkitFullscreenElement","webkitFullscreenEnabled","webkitfullscreenchange","webkitfullscreenerror"],["webkitRequestFullScreen","webkitCancelFullScreen","webkitCurrentFullScreenElement","webkitCancelFullScreen","webkitfullscreenchange","webkitfullscreenerror"],["mozRequestFullScreen","mozCancelFullScreen","mozFullScreenElement","mozFullScreenEnabled","mozfullscreenchange","mozfullscreenerror"],["msRequestFullscreen","msExitFullscreen","msFullscreenElement","msFullscreenEnabled","MSFullscreenChange","MSFullscreenError"]])[0],i=0;i<e.length;i++)if(e[i][1]in document){n=e[i];break}if(n)for(vjs.browser.fullscreenAPI={},i=0;i<n.length;i++)vjs.browser.fullscreenAPI[t[i]]=n[i];document.addEventListener("MSFullscreenChange",(function(e){if(vjs.players)for(var t in vjs.players)t.indexOf("an_video_ad_player")>=0&&(vjs.players[t].trigger("fullscreenchange"),vjs.players[t].fsButtonClicked||(vjs.players[t].isFullscreen(!1),vjs.players[t].removeClass("vjs-fullscreen")),vjs.players[t].fsButtonClicked=!1)}))}(),vjs.Player=vjs.Component.extend({init:function(e,t,n){this.tag=e,e.id=e.id||"vjs_video_"+vjs.guid++,this.tagAttributes=e&&vjs.getElementAttributes(e),t=vjs.obj.merge(this.getTagSettings(e),t),this.language_=t.language||vjs.options.language,this.languages_=t.languages||vjs.options.languages,this.cache_={},this.poster_=t.poster||"",this.controls_=!!t.controls,e.controls=!1,t.reportTouchActivity=!1,this.isAudio("audio"===this.tag.nodeName.toLowerCase()),vjs.Component.call(this,this,t,n),this.controls()?this.addClass("vjs-controls-enabled"):this.addClass("vjs-controls-disabled"),this.isAudio()&&this.addClass("vjs-audio"),this.addClass("vjs-big-play-centered"),vjs.players[this.id_]=this,t.plugins&&vjs.obj.each(t.plugins,(function(e,t){this[e](t)}),this),this.listenForUserActivity()}}),vjs.Player.prototype.language_,vjs.Player.prototype.language=function(e){return void 0===e?this.language_:(this.language_=e,this)},vjs.Player.prototype.getMuteSettingsForIOS10=function(){return vjs.IS_IOS&&this.options_.enableNativeInline&&parseInt(vjs.IOS_VERSION)>9},vjs.Player.prototype.languages_,vjs.Player.prototype.languages=function(){return this.languages_},vjs.Player.prototype.options_=vjs.options,vjs.Player.prototype.dispose=function(){this.trigger("dispose"),this.off("dispose"),vjs.players[this.id_]=null,this.tag&&this.tag.player&&(this.tag.player=null),this.el_&&this.el_.player&&(this.el_.player=null),this.tech&&this.tech.dispose(),vjs.Component.prototype.dispose.call(this)},vjs.Player.prototype.getTagSettings=function(e){var t,n,i,r,o,a,s,l={sources:[],tracks:[]};if(null!==(n=(t=vjs.getElementAttributes(e))["data-setup"])&&vjs.obj.merge(t,vjs.JSON.parse(n||"{}")),vjs.obj.merge(l,t),e.hasChildNodes())for(a=0,s=(i=e.childNodes).length;a<s;a++)"source"===(o=(r=i[a]).nodeName.toLowerCase())?l.sources.push(vjs.getElementAttributes(r)):"track"===o&&l.tracks.push(vjs.getElementAttributes(r));return l},vjs.Player.prototype.createEl=function(){var e,t=this.el_=vjs.Component.prototype.createEl.call(this,"div"),n=this.tag;return n.removeAttribute("width"),n.removeAttribute("height"),e=vjs.getElementAttributes(n),vjs.obj.each(e,(function(n){"class"==n?t.className=e[n]:t.setAttribute(n,e[n])})),n.id+="_html5_api",n.className="vjs-tech",n.player=t.player=this,this.addClass("vjs-paused"),this.width(this.options_.width,!0),this.height(this.options_.height,!0),n.initNetworkState_=n.networkState,n.parentNode&&n.parentNode.insertBefore(t,n),vjs.insertFirst(n,t),this.el_=t,this.on("loadstart",this.onLoadStart),this.on("waiting",this.onWaiting),this.on(["canplay","canplaythrough","playing","ended"],this.onWaitEnd),this.on("seeking",this.onSeeking),this.on("seeked",this.onSeeked),this.on("ended",this.onEnded),this.on("play",this.onPlay),this.on("firstplay",this.onFirstPlay),this.on("pause",this.onPause),this.on("progress",this.onProgress),this.on("durationchange",this.onDurationChange),this.on("fullscreenchange",this.onFullscreenChange),t},vjs.Player.prototype.loadTech=function(e,t){this.tech&&this.unloadTech(),"Html5"!==e&&this.tag&&(vjs.Html5.disposeMediaElement(this.tag),this.tag=null),this.techName=e,this.isReady_=!1;var n=vjs.obj.merge({source:t,parentEl:this.el_},this.options_[e.toLowerCase()]);t&&(this.currentType_=t.type,t.src==this.cache_.src&&this.cache_.currentTime>0&&(n.startTime=this.cache_.currentTime),this.cache_.src=t.src),this.tech=new window.videojs_apn[e](this,n),this.tech.ready((function(){this.player_.triggerReady()}))},vjs.Player.prototype.unloadTech=function(){this.isReady_=!1,this.tech.dispose(),this.tech=!1},vjs.Player.prototype.onLoadStart=function(){this.removeClass("vjs-ended"),this.error(null),this.paused()?this.hasStarted(!1):this.trigger("firstplay")},vjs.Player.prototype.hasStarted_=!1,vjs.Player.prototype.hasStarted=function(e){return void 0!==e?(this.hasStarted_!==e&&(this.hasStarted_=e,e?(this.addClass("vjs-has-started"),this.trigger("firstplay")):this.removeClass("vjs-has-started")),this):this.hasStarted_},vjs.Player.prototype.onLoadedMetaData,vjs.Player.prototype.onLoadedData,vjs.Player.prototype.onLoadedAllData,vjs.Player.prototype.onPlay=function(){this.removeClass("vjs-ended"),this.removeClass("vjs-paused"),this.addClass("vjs-playing"),this.hasStarted(!0)},vjs.Player.prototype.onWaiting=function(){this.addClass("vjs-waiting")},vjs.Player.prototype.onWaitEnd=function(){this.removeClass("vjs-waiting")},vjs.Player.prototype.onSeeking=function(){this.addClass("vjs-seeking")},vjs.Player.prototype.onSeeked=function(){this.removeClass("vjs-seeking")},vjs.Player.prototype.onFirstPlay=function(){this.options_.starttime&&this.currentTime(this.options_.starttime),this.addClass("vjs-has-started")},vjs.Player.prototype.onPause=function(){this.removeClass("vjs-playing"),this.addClass("vjs-paused")},vjs.Player.prototype.onTimeUpdate,vjs.Player.prototype.onProgress=function(){1==this.bufferedPercent()&&this.trigger("loadedalldata")},vjs.Player.prototype.onEnded=function(){this.addClass("vjs-ended"),this.options_.loop?(this.currentTime(0),this.play()):this.paused()||this.pause()},vjs.Player.prototype.onDurationChange=function(){var e=this.techGet("duration");e&&(e<0&&(e=1/0),this.duration(e),e===1/0?this.addClass("vjs-live"):this.removeClass("vjs-live"))},vjs.Player.prototype.onVolumeChange,vjs.Player.prototype.onFullscreenChange=function(){this.isFullscreen()?this.addClass("vjs-fullscreen"):this.removeClass("vjs-fullscreen")},vjs.Player.prototype.onError,vjs.Player.prototype.cache_,vjs.Player.prototype.getCache=function(){return this.cache_},vjs.Player.prototype.techCall=function(e,t){if(this.tech&&!this.tech.isReady_)this.tech.ready((function(){this[e](t)}));else try{this.tech[e](t)}catch(e){throw vjs.log(e),e}},vjs.Player.prototype.techGet=function(e){if(this.tech&&this.tech.isReady_)try{return this.tech[e]()}catch(t){throw void 0===this.tech[e]?vjs.log("Video.js: "+e+" method not defined for "+this.techName+" playback technology.",t):"TypeError"==t.name?(vjs.log("Video.js: "+e+" unavailable on "+this.techName+" playback technology element.",t),this.tech.isReady_=!1):vjs.log(t),t}},vjs.Player.prototype.play=function(){return this.techCall("play"),this},vjs.Player.prototype.pause=function(){return this.techCall("pause"),this.trigger("apn-vpaid-pause"),this},vjs.Player.prototype.paused=function(){return!1!==this.techGet("paused")},vjs.Player.prototype.currentTime=function(e){return void 0!==e?(this.techCall("setCurrentTime",e),this):this.cache_.currentTime=this.techGet("currentTime")||0},vjs.Player.prototype.duration=function(e){return void 0!==e?(this.cache_.duration=parseFloat(e),this):(void 0===this.cache_.duration&&this.onDurationChange(),this.cache_.duration||0)},vjs.Player.prototype.remainingTime=function(){return this.duration()-this.currentTime()},vjs.Player.prototype.buffered=function(){var e=this.techGet("buffered");return e&&e.length||(e=vjs.createTimeRange(0,0)),e},vjs.Player.prototype.bufferedPercent=function(){var e,t,n=this.duration(),i=this.buffered(),r=0;if(!n)return 0;for(var o=0;o<i.length;o++)e=i.start(o),(t=i.end(o))>n&&(t=n),r+=t-e;return r/n},vjs.Player.prototype.bufferedEnd=function(){var e=this.buffered(),t=this.duration(),n=e.end(e.length-1);return n>t&&(n=t),n},vjs.Player.prototype.volume=function(e){var t;return void 0!==e?(t=Math.max(0,Math.min(1,parseFloat(e))),this.cache_.volume=t,this.techCall("setVolume",t),vjs.setVjsStorage("volume",t),this):(t=parseFloat(this.techGet("volume")),isNaN(t)?1:t)},vjs.Player.prototype.muted=function(e){return void 0!==e?(vjs.IS_IOS&&this.options_.enableInlineVideoForIos||this.techCall("setMuted",e),this):this.techGet("muted")||!1},vjs.Player.prototype.supportsFullScreen=function(){return this.techGet("supportsFullScreen")||!1},vjs.Player.prototype.isFullscreen_=!1,vjs.Player.prototype.isFullscreen=function(e){return void 0!==e?(this.isFullscreen_=!!e,this):this.isFullscreen_},vjs.Player.prototype.isFullScreen=function(e){return vjs.log.warn('player.isFullScreen() has been deprecated, use player.isFullscreen() with a lowercase "s")'),this.isFullscreen(e)},vjs.Player.prototype.requestFullscreen=function(){var e=vjs.browser.fullscreenAPI;return this.isFullscreen(!0),e?(vjs.on(document,e.fullscreenchange,vjs.bind(this,(function(t){this.isFullscreen(document[e.fullscreenElement])}))),this.el_[e.requestFullscreen]()):this.tech.supportsFullScreen()&&options.iOSAppFullScreenOverride?global_options.cbNotification("AdHandler","video_fullscreen_enter"):(this.enterFullWindow(),this.trigger("fullscreenchange")),this},vjs.Player.prototype.requestFullScreen=function(){return vjs.log.warn('player.requestFullScreen() has been deprecated, use player.requestFullscreen() with a lowercase "s")'),this.requestFullscreen()},vjs.Player.prototype.exitFullscreen=function(){var e=vjs.browser.fullscreenAPI;return this.isFullscreen(!1),e?document[e.exitFullscreen]():this.tech.supportsFullScreen()?options.iOSAppFullScreenOverride?global_options.cbNotification("AdHandler","video_fullscreen_exit"):(this.exitFullWindow(),this.trigger("fullscreenchange")):(this.exitFullWindow(),this.push("fullscreenchange")),this},vjs.Player.prototype.cancelFullScreen=function(){return vjs.log.warn("player.cancelFullScreen() has been deprecated, use player.exitFullscreen()"),this.exitFullscreen()},vjs.Player.prototype.enterFullWindow=function(){this.isFullWindow=!0,this.docOrigOverflow=document.documentElement.style.overflow,vjs.on(document,"keydown",vjs.bind(this,this.fullWindowOnEscKey)),document.documentElement.style.overflow="hidden",vjs.addClass(document.body,"vjs-full-window"),this.trigger("enterFullWindow")},vjs.Player.prototype.fullWindowOnEscKey=function(e){27===e.keyCode&&(!0===this.isFullscreen()?this.exitFullscreen():this.exitFullWindow())},vjs.Player.prototype.exitFullWindow=function(){this.isFullWindow=!1,vjs.off(document,"keydown",this.fullWindowOnEscKey),document.documentElement.style.overflow=this.docOrigOverflow,vjs.removeClass(document.body,"vjs-full-window"),this.trigger("exitFullWindow")},vjs.Player.prototype.selectSource=function(e){for(var t=0,n=this.options_.techOrder;t<n.length;t++){var i=vjs.capitalize(n[t]),r=window.videojs_apn[i];if(r){if(r.isSupported())for(var o=0,a=e;o<a.length;o++){var s=a[o];if(r.canPlaySource(s))return{source:s,tech:i}}}else vjs.log.error('The "'+i+'" tech is undefined. Skipped browser support check for that tech.')}return!1},vjs.Player.prototype.src=function(e){return void 0===e?this.techGet("src"):(vjs.obj.isArray(e)?this.sourceList_(e):"string"==typeof e?this.src({src:e}):e instanceof Object&&(e.type&&!window.videojs_apn[this.techName].canPlaySource(e)?this.sourceList_([e]):(this.cache_.src=e.src,this.currentType_=e.type||"",this.ready((function(){window.videojs_apn[this.techName].prototype.hasOwnProperty("setSource")?this.techCall("setSource",e):this.techCall("src",e.src),"auto"==this.options_.preload&&this.load(),this.options_.autoplay&&this.play()})))),this)},vjs.Player.prototype.sourceList_=function(e){var t=this.selectSource(e);t?t.tech===this.techName?this.src(t.source):this.loadTech(t.tech,t.source):(this.setTimeout((function(){this.error({code:4,message:this.localize(this.options().notSupportedMessage)})}),0),this.triggerReady())},vjs.Player.prototype.load=function(){return this.techCall("load"),this},vjs.Player.prototype.currentSrc=function(){return this.techGet("currentSrc")||this.cache_.src||""},vjs.Player.prototype.currentType=function(){return this.currentType_||""},vjs.Player.prototype.preload=function(e){return void 0!==e?(this.techCall("setPreload",e),this.options_.preload=e,this):this.techGet("preload")},vjs.Player.prototype.autoplay=function(e){return void 0!==e?(this.techCall("setAutoplay",e),this.options_.autoplay=e,this):this.techGet("autoplay",e)},vjs.Player.prototype.loop=function(e){return void 0!==e?(this.techCall("setLoop",e),this.options_.loop=e,this):this.techGet("loop")},vjs.Player.prototype.poster_,vjs.Player.prototype.poster=function(e){return void 0===e?this.poster_:(e||(e=""),this.poster_=e,this.techCall("setPoster",e),this.trigger("posterchange"),this)},vjs.Player.prototype.controls_,vjs.Player.prototype.controls=function(e){return void 0!==e?(e=!!e,this.controls_!==e&&(this.controls_=e,e?(this.removeClass("vjs-controls-disabled"),this.addClass("vjs-controls-enabled"),this.trigger("controlsenabled")):(this.removeClass("vjs-controls-enabled"),this.addClass("vjs-controls-disabled"),this.trigger("controlsdisabled"))),this):this.controls_},vjs.Player.prototype.usingNativeControls_,vjs.Player.prototype.usingNativeControls=function(e){return void 0!==e?(e=!!e,this.usingNativeControls_!==e&&(this.usingNativeControls_=e,e?(this.addClass("vjs-using-native-controls"),this.trigger("usingnativecontrols")):(this.removeClass("vjs-using-native-controls"),this.trigger("usingcustomcontrols"))),this):this.usingNativeControls_},vjs.Player.prototype.error_=null,vjs.Player.prototype.error=function(e){return void 0===e?this.error_:null===e?(this.error_=e,this.removeClass("vjs-error"),this):(e instanceof vjs.MediaError?this.error_=e:this.error_=new vjs.MediaError(e),this.trigger("error"),this.addClass("vjs-error"),vjs.log.error("(CODE:"+this.error_.code+" "+vjs.MediaError.errorTypes[this.error_.code]+")",this.error_.message,this.error_),this)},vjs.Player.prototype.ended=function(){return this.techGet("ended")},vjs.Player.prototype.seeking=function(){return this.techGet("seeking")},vjs.Player.prototype.seekable=function(){return this.techGet("seekable")},vjs.Player.prototype.userActivity_=!0,vjs.Player.prototype.reportUserActivity=function(e){this.userActivity_=!0},vjs.Player.prototype.userActive_=!0,vjs.Player.prototype.userActive=function(e){return void 0!==e?((e=!!e)!==this.userActive_&&(this.userActive_=e,e?(this.userActivity_=!0,this.removeClass("vjs-user-inactive"),this.addClass("vjs-user-active"),this.trigger("useractive")):(this.userActivity_=!1,this.tech&&this.tech.one("mousemove",(function(e){e.stopPropagation(),e.preventDefault()})),this.removeClass("vjs-user-active"),this.addClass("vjs-user-inactive"),this.trigger("userinactive"))),this):this.userActive_},vjs.Player.prototype.listenForUserActivity=function(){var e,t,n,i,r,o,a,s,l,d;e=vjs.bind(this,this.reportUserActivity),t=function(t){t.screenX==a&&t.screenY==s||(a=t.screenX,s=t.screenY,e())},l=function(t){if(t.screenX!=a||t.screenY!=s||void 0===a||void 0===s){if(Math.floor(t.screenX/100)===Math.floor(a/100))return;a=t.screenX,s=t.screenY,e()}},d=function(e){e.target&&e.target.getAttribute("class")&&e.target.getAttribute("class").indexOf("vjs-")>=0||(console.log("active:onmouseout:initialize"),a=void 0,s=void 0)},n=function(){e(),this.clearInterval(i),i=this.setInterval(e,250)},r=function(t){e(),this.clearInterval(i)},this.on("mousedown",n),this.on("mousemove",t),this.on("mouseup",r),this.on("mouseover",l),this.on("mouseout",d),this.on("keydown",e),this.on("keyup",e),this.setInterval((function(){if(this.userActivity_){this.userActivity_=!1,this.userActive(!0),this.clearTimeout(o);var e=this.options().inactivityTimeout;e>0&&(o=this.setTimeout((function(){this.userActivity_||this.userActive(!1)}),e))}}),250)},vjs.Player.prototype.playbackRate=function(e){return void 0!==e?(this.techCall("setPlaybackRate",e),this):this.tech&&this.tech.featuresPlaybackRate?this.techGet("playbackRate"):1},vjs.Player.prototype.isAudio_=!1,vjs.Player.prototype.isAudio=function(e){return void 0!==e?(this.isAudio_=!!e,this):this.isAudio_},vjs.Player.prototype.networkState=function(){return this.techGet("networkState")},vjs.Player.prototype.readyState=function(){return this.techGet("readyState")},vjs.Player.prototype.textTracks=function(){return this.tech&&this.tech.textTracks()},vjs.Player.prototype.remoteTextTracks=function(){return this.tech&&this.tech.remoteTextTracks()},vjs.Player.prototype.addTextTrack=function(e,t,n){return this.tech&&this.tech.addTextTrack(e,t,n)},vjs.Player.prototype.addRemoteTextTrack=function(e){return this.tech&&this.tech.addRemoteTextTrack(e)},vjs.Player.prototype.removeRemoteTextTrack=function(e){this.tech&&this.tech.removeRemoteTextTrack(e)},vjs.ControlBar=vjs.Component.extend(),vjs.ControlBar.prototype.options_={loadEvent:"play",children:{playToggle:{},currentTimeDisplay:{},timeDivider:{},durationDisplay:{},remainingTimeDisplay:{},progressControl:{},fullscreenToggle:{},volumeControl:{},muteToggle:{},playbackRateMenuButton:{}}},vjs.ControlBar.prototype.createEl=function(){return vjs.createEl("div",{className:"vjs-control-bar"})},vjs.LiveDisplay=vjs.Component.extend({init:function(e,t){vjs.Component.call(this,e,t)}}),vjs.LiveDisplay.prototype.createEl=function(){var e=vjs.Component.prototype.createEl.call(this,"div",{className:"vjs-live-controls vjs-control"});return this.contentEl_=vjs.createEl("div",{className:"vjs-live-display",innerHTML:'<span class="vjs-control-text">'+this.localize("Stream Type")+"</span>"+this.localize("LIVE"),"aria-live":"off"}),e.appendChild(this.contentEl_),e},vjs.PlayToggle=vjs.Button.extend({init:function(e,t){vjs.Button.call(this,e,t),this.on(e,"play",this.onPlay),this.on(e,"pause",this.onPause)}}),vjs.PlayToggle.prototype.buttonText="Play",vjs.PlayToggle.prototype.buildCSSClass=function(){return"vjs-play-control "+vjs.Button.prototype.buildCSSClass.call(this)},vjs.PlayToggle.prototype.onClick=function(){},vjs.PlayToggle.prototype.onPlay=function(){this.removeClass("vjs-paused"),this.addClass("vjs-playing"),this.el_.children[0].children[0].innerHTML=this.localize("Pause")},vjs.PlayToggle.prototype.onPause=function(){this.removeClass("vjs-playing"),this.addClass("vjs-paused"),this.el_.children[0].children[0].innerHTML=this.localize("Play")},vjs.CurrentTimeDisplay=vjs.Component.extend({init:function(e,t){vjs.Component.call(this,e,t),this.on(e,"timeupdate",this.updateContent)}}),vjs.CurrentTimeDisplay.prototype.createEl=function(){var e=vjs.Component.prototype.createEl.call(this,"div",{className:"vjs-current-time vjs-time-controls vjs-control"});return this.contentEl_=vjs.createEl("div",{className:"vjs-current-time-display",innerHTML:'<span class="vjs-control-text">Current Time </span>0:00',"aria-live":"off"}),e.appendChild(this.contentEl_),e},vjs.CurrentTimeDisplay.prototype.updateContent=function(){var e=this.player_.scrubbing?this.player_.getCache().currentTime:this.player_.currentTime();this.contentEl_.innerHTML='<span class="vjs-control-text">'+this.localize("Current Time")+"</span> "+vjs.formatTime(e,this.player_.duration())},vjs.DurationDisplay=vjs.Component.extend({init:function(e,t){vjs.Component.call(this,e,t),this.on(e,"timeupdate",this.updateContent),this.on(e,"loadedmetadata",this.updateContent)}}),vjs.DurationDisplay.prototype.createEl=function(){var e=vjs.Component.prototype.createEl.call(this,"div",{className:"vjs-duration vjs-time-controls vjs-control"});return this.contentEl_=vjs.createEl("div",{className:"vjs-duration-display",innerHTML:'<span class="vjs-control-text">'+this.localize("Duration Time")+"</span> 0:00","aria-live":"off"}),e.appendChild(this.contentEl_),e},vjs.DurationDisplay.prototype.updateContent=function(){var e=this.player_.duration();e&&(this.contentEl_.innerHTML='<span class="vjs-control-text">'+this.localize("Duration Time")+"</span> "+vjs.formatTime(e))},vjs.TimeDivider=vjs.Component.extend({init:function(e,t){vjs.Component.call(this,e,t)}}),vjs.TimeDivider.prototype.createEl=function(){return vjs.Component.prototype.createEl.call(this,"div",{className:"vjs-time-divider",innerHTML:"<div><span>/</span></div>"})},vjs.RemainingTimeDisplay=vjs.Component.extend({init:function(e,t){vjs.Component.call(this,e,t),this.on(e,"timeupdate",this.updateContent)}}),vjs.RemainingTimeDisplay.prototype.createEl=function(){var e=vjs.Component.prototype.createEl.call(this,"div",{className:"vjs-remaining-time vjs-time-controls vjs-control"});return this.contentEl_=vjs.createEl("div",{className:"vjs-remaining-time-display",innerHTML:'<span class="vjs-control-text">'+this.localize("Remaining Time")+"</span> -0:00","aria-live":"off"}),e.appendChild(this.contentEl_),e},vjs.RemainingTimeDisplay.prototype.updateContent=function(){this.player_.duration()&&(this.contentEl_.innerHTML='<span class="vjs-control-text">'+this.localize("Remaining Time")+"</span> -"+vjs.formatTime(this.player_.remainingTime()))},vjs.FullscreenToggle=vjs.Button.extend({init:function(e,t){vjs.Button.call(this,e,t)}}),vjs.FullscreenToggle.prototype.buttonText="Fullscreen",vjs.FullscreenToggle.prototype.buildCSSClass=function(){return"vjs-fullscreen-control "+vjs.Button.prototype.buildCSSClass.call(this)},vjs.FullscreenToggle.prototype.onClick=function(){this.player_.fsButtonClicked=!0,options.iOSAppFullScreenOverride?"touchend"===event.type&&this.toggleFullscreen():this.toggleFullscreen()},vjs.FullscreenToggle.prototype.toggleFullscreen=function(){this.player_.isFullscreen()?(this.player_.exitFullscreen(),this.controlText_.innerHTML=this.localize("Fullscreen")):(this.player_.requestFullscreen(),this.controlText_.innerHTML=this.localize("Non-Fullscreen"))},vjs.ProgressControl=vjs.Component.extend({init:function(e,t){vjs.Component.call(this,e,t)}}),vjs.ProgressControl.prototype.options_={children:{seekBar:{}}},vjs.ProgressControl.prototype.createEl=function(){return vjs.Component.prototype.createEl.call(this,"div",{className:"vjs-progress-control vjs-control"})},vjs.SeekBar=vjs.Slider.extend({init:function(e,t){vjs.Slider.call(this,e,t),this.on(e,"timeupdate",this.updateARIAAttributes),e.ready(vjs.bind(this,this.updateARIAAttributes))}}),vjs.SeekBar.prototype.options_={children:{loadProgressBar:{},playProgressBar:{},seekHandle:{}},barName:"playProgressBar",handleName:"seekHandle"},vjs.SeekBar.prototype.playerEvent="timeupdate",vjs.SeekBar.prototype.createEl=function(){return vjs.Slider.prototype.createEl.call(this,"div",{className:"vjs-progress-holder","aria-label":"video progress bar"})},vjs.SeekBar.prototype.updateARIAAttributes=function(){var e=this.player_.scrubbing?this.player_.getCache().currentTime:this.player_.currentTime();this.el_.setAttribute("aria-valuenow",vjs.round(100*this.getPercent(),2)),this.el_.setAttribute("aria-valuetext",vjs.formatTime(e,this.player_.duration()))},vjs.SeekBar.prototype.getPercent=function(){return this.player_.currentTime()/this.player_.duration()},vjs.LoadProgressBar=vjs.Component.extend({init:function(e,t){vjs.Component.call(this,e,t),this.on(e,"progress",this.update)}}),vjs.LoadProgressBar.prototype.createEl=function(){return vjs.Component.prototype.createEl.call(this,"div",{className:"vjs-load-progress",innerHTML:'<span class="vjs-control-text"><span>'+this.localize("Loaded")+"</span>: 0%</span>"})},vjs.LoadProgressBar.prototype.update=function(){var e,t,n,i,r=this.player_.buffered(),o=this.player_.duration(),a=this.player_.bufferedEnd(),s=this.el_.children,l=function(e,t){return 100*(e/t||0)+"%"};for(this.el_.style.width=l(a,o),e=0;e<r.length;e++)t=r.start(e),n=r.end(e),(i=s[e])||(i=this.el_.appendChild(vjs.createEl())),i.style.left=l(t,a),i.style.width=l(n-t,a);for(e=s.length;e>r.length;e--)this.el_.removeChild(s[e-1])},vjs.PlayProgressBar=vjs.Component.extend({init:function(e,t){vjs.Component.call(this,e,t)}}),vjs.PlayProgressBar.prototype.createEl=function(){return vjs.Component.prototype.createEl.call(this,"div",{className:"vjs-play-progress",innerHTML:'<span class="vjs-control-text"><span>'+this.localize("Progress")+"</span>: 0%</span>"})},vjs.SeekHandle=vjs.SliderHandle.extend({init:function(e,t){vjs.SliderHandle.call(this,e,t),this.on(e,"timeupdate",this.updateContent)}}),vjs.SeekHandle.prototype.defaultValue="00:00",vjs.SeekHandle.prototype.createEl=function(){return vjs.SliderHandle.prototype.createEl.call(this,"div",{className:"vjs-seek-handle","aria-live":"off"})},vjs.SeekHandle.prototype.updateContent=function(){var e=this.player_.scrubbing?this.player_.getCache().currentTime:this.player_.currentTime();this.el_.innerHTML='<span class="vjs-control-text">'+vjs.formatTime(e,this.player_.duration())+"</span>"},vjs.VolumeControl=vjs.Component.extend({init:function(e,t){vjs.Component.call(this,e,t),e.tech&&!1===e.tech.featuresVolumeControl&&this.addClass("vjs-hidden"),this.on(e,"loadstart",(function(){!1===e.tech.featuresVolumeControl?this.addClass("vjs-hidden"):this.removeClass("vjs-hidden")}))}}),vjs.VolumeControl.prototype.options_={children:{volumeBar:{}}},vjs.VolumeControl.prototype.createEl=function(){return vjs.Component.prototype.createEl.call(this,"div",{className:"vjs-volume-control vjs-control"})},vjs.VolumeBar=vjs.Slider.extend({init:function(e,t){vjs.Slider.call(this,e,t),this.on(e,"volumechange",this.updateARIAAttributes),e.ready(vjs.bind(this,this.updateARIAAttributes))}}),vjs.VolumeBar.prototype.updateARIAAttributes=function(){this.el_.setAttribute("aria-valuenow",vjs.round(100*this.player_.volume(),2)),this.el_.setAttribute("aria-valuetext",vjs.round(100*this.player_.volume(),2)+"%")},vjs.VolumeBar.prototype.options_={children:{volumeLevel:{},volumeHandle:{}},barName:"volumeLevel",handleName:"volumeHandle"},vjs.VolumeBar.prototype.playerEvent="volumechange",vjs.VolumeBar.prototype.createEl=function(){return vjs.Slider.prototype.createEl.call(this,"div",{className:"vjs-volume-bar","aria-label":"volume level"})},vjs.VolumeBar.prototype.onMouseMove=function(e){if(this.player_.muted(),global_options.hasOwnProperty("overlayPlayer"))e.srcElement&&"VIDEO"!=e.srcElement.tagName&&e.srcElement.className.indexOf("vjs")>=0?"VIDEO"!=e.srcElement.tagName&&e.srcElement.className&&e.srcElement.className.indexOf("vjs")>=0&&this.player_.volume(this.calculateDistance(e)):e.currentTarget&&"VIDEO"!=e.currentTarget.tagName&&e.currentTarget.className&&e.currentTarget.className.indexOf("vjs")>=0&&this.player_.volume(this.calculateDistance(e));else{var t=global_options.wcElement&&global_options.wcElement instanceof Element?global_options.wcElement.querySelector("#"+String(global_options.iframeVideoWrapperId)):document.getElementById(global_options.iframeVideoWrapperId),n=t&&t.contentWindow.document,i=n&&n.elementFromPoint(e.clientX,e.clientY);i&&"VIDEO"!=i.tagName&&i.className.indexOf("vjs")>=0&&this.player_.volume(this.calculateDistance(e))}},vjs.VolumeBar.prototype.getPercent=function(){return this.player_.muted()?0:this.player_.volume()},vjs.VolumeBar.prototype.stepForward=function(){this.player_.volume(this.player_.volume()+.1)},vjs.VolumeBar.prototype.stepBack=function(){this.player_.volume(this.player_.volume()-.1)},vjs.VolumeLevel=vjs.Component.extend({init:function(e,t){vjs.Component.call(this,e,t)}}),vjs.VolumeLevel.prototype.createEl=function(){return vjs.Component.prototype.createEl.call(this,"div",{className:"vjs-volume-level",innerHTML:'<span class="vjs-control-text"></span>'})},vjs.VolumeHandle=vjs.SliderHandle.extend(),vjs.VolumeHandle.prototype.defaultValue="00:00",vjs.VolumeHandle.prototype.createEl=function(){return vjs.SliderHandle.prototype.createEl.call(this,"div",{className:"vjs-volume-handle"})},vjs.MuteToggle=vjs.Button.extend({init:function(e,t){vjs.Button.call(this,e,t),this.on(e,"volumechange",this.update);var n=e.getMuteSettingsForIOS10();e.tech&&!1===e.tech.featuresVolumeControl&&!n&&this.addClass("vjs-hidden"),this.on(e,"loadstart",(function(){!1!==e.tech.featuresVolumeControl||n?this.removeClass("vjs-hidden"):this.addClass("vjs-hidden")}))}}),vjs.MuteToggle.prototype.createEl=function(){return vjs.Button.prototype.createEl.call(this,"div",{className:"vjs-mute-control vjs-control",innerHTML:'<div><span class="vjs-control-text">'+this.localize("Mute")+"</span></div>"})},vjs.MuteToggle.prototype.onClick=function(){if(this.player_.muted()){var e=this.player_.volume();0===e&&(e=.5,this.player_.volume(e))}this.player_.muted(!this.player_.muted())},vjs.MuteToggle.prototype.update=function(){var e=this.player_.volume(),t=3;if(0===e||this.player_.muted()?t=0:e<.33?t=1:e<.67&&(t=2),this.el_){this.player_.muted()?this.el_.children[0].children[0].innerHTML!=this.localize("Unmute")&&(this.el_.children[0].children[0].innerHTML=this.localize("Unmute")):this.el_.children[0].children[0].innerHTML!=this.localize("Mute")&&(this.el_.children[0].children[0].innerHTML=this.localize("Mute"));for(var n=0;n<4;n++)vjs.removeClass(this.el_,"vjs-vol-"+n);vjs.addClass(this.el_,"vjs-vol-"+t)}},vjs.VolumeMenuButton=vjs.MenuButton.extend({init:function(e,t){vjs.MenuButton.call(this,e,t),this.on(e,"volumechange",this.volumeUpdate),e.tech&&!1===e.tech.featuresVolumeControl&&this.addClass("vjs-hidden"),this.on(e,"loadstart",(function(){!1===e.tech.featuresVolumeControl?this.addClass("vjs-hidden"):this.removeClass("vjs-hidden")})),this.addClass("vjs-menu-button")}}),vjs.VolumeMenuButton.prototype.createMenu=function(){var e=new vjs.Menu(this.player_,{contentElType:"div"}),t=new vjs.VolumeBar(this.player_,this.options_.volumeBar);return t.on("focus",(function(){e.lockShowing()})),t.on("blur",(function(){e.unlockShowing()})),e.addChild(t),e},vjs.VolumeMenuButton.prototype.onClick=function(){vjs.MuteToggle.prototype.onClick.call(this),vjs.MenuButton.prototype.onClick.call(this)},vjs.VolumeMenuButton.prototype.createEl=function(){return vjs.Button.prototype.createEl.call(this,"div",{className:"vjs-volume-menu-button vjs-menu-button vjs-control",innerHTML:'<div><span class="vjs-control-text">'+this.localize("Mute")+"</span></div>"})},vjs.VolumeMenuButton.prototype.volumeUpdate=vjs.MuteToggle.prototype.update,vjs.PlaybackRateMenuButton=vjs.MenuButton.extend({init:function(e,t){vjs.MenuButton.call(this,e,t),this.updateVisibility(),this.updateLabel(),this.on(e,"loadstart",this.updateVisibility),this.on(e,"ratechange",this.updateLabel)}}),vjs.PlaybackRateMenuButton.prototype.buttonText="Playback Rate",vjs.PlaybackRateMenuButton.prototype.className="vjs-playback-rate",vjs.PlaybackRateMenuButton.prototype.createEl=function(){var e=vjs.MenuButton.prototype.createEl.call(this);return this.labelEl_=vjs.createEl("div",{className:"vjs-playback-rate-value",innerHTML:1}),e.appendChild(this.labelEl_),e},vjs.PlaybackRateMenuButton.prototype.createMenu=function(){var e=new vjs.Menu(this.player()),t=this.player().options().playbackRates;if(t)for(var n=t.length-1;n>=0;n--)e.addChild(new vjs.PlaybackRateMenuItem(this.player(),{rate:t[n]+"x"}));return e},vjs.PlaybackRateMenuButton.prototype.updateARIAAttributes=function(){this.el().setAttribute("aria-valuenow",this.player().playbackRate())},vjs.PlaybackRateMenuButton.prototype.onClick=function(){for(var e=this.player().playbackRate(),t=this.player().options().playbackRates,n=t[0],i=0;i<t.length;i++)if(t[i]>e){n=t[i];break}this.player().playbackRate(n)},vjs.PlaybackRateMenuButton.prototype.playbackRateSupported=function(){return this.player().tech&&this.player().tech.featuresPlaybackRate&&this.player().options().playbackRates&&this.player().options().playbackRates.length>0},vjs.PlaybackRateMenuButton.prototype.updateVisibility=function(){this.playbackRateSupported()?this.removeClass("vjs-hidden"):this.addClass("vjs-hidden")},vjs.PlaybackRateMenuButton.prototype.updateLabel=function(){this.playbackRateSupported()&&(this.labelEl_.innerHTML=this.player().playbackRate()+"x")},vjs.PlaybackRateMenuItem=vjs.MenuItem.extend({contentElType:"button",init:function(e,t){var n=this.label=t.rate,i=this.rate=parseFloat(n,10);t.label=n,t.selected=1===i,vjs.MenuItem.call(this,e,t),this.on(e,"ratechange",this.update)}}),vjs.PlaybackRateMenuItem.prototype.onClick=function(){vjs.MenuItem.prototype.onClick.call(this),this.player().playbackRate(this.rate)},vjs.PlaybackRateMenuItem.prototype.update=function(){this.selected(this.player().playbackRate()==this.rate)},vjs.PosterImage=vjs.Button.extend({init:function(e,t){vjs.Button.call(this,e,t),this.update(),e.on("posterchange",vjs.bind(this,this.update))}}),vjs.PosterImage.prototype.dispose=function(){this.player().off("posterchange",this.update),vjs.Button.prototype.dispose.call(this)},vjs.PosterImage.prototype.createEl=function(){var e=vjs.createEl("div",{className:"vjs-poster",tabIndex:-1});return vjs.BACKGROUND_SIZE_SUPPORTED||(this.fallbackImg_=vjs.createEl("img"),e.appendChild(this.fallbackImg_)),e},vjs.PosterImage.prototype.update=function(){var e=this.player().poster();this.setSrc(e),e?this.show():this.hide()},vjs.PosterImage.prototype.setSrc=function(e){var t;this.fallbackImg_?this.fallbackImg_.src=e:(t="",e&&(t='url("'+e+'")'),this.el_.style.backgroundImage=t)},vjs.PosterImage.prototype.onClick=function(){this.player_.play()},vjs.LoadingSpinner=vjs.Component.extend({init:function(e,t){vjs.Component.call(this,e,t)}}),vjs.LoadingSpinner.prototype.createEl=function(){return vjs.Component.prototype.createEl.call(this,"div",{className:"vjs-loading-spinner"})},vjs.BigPlayButton=vjs.Button.extend(),vjs.BigPlayButton.prototype.createEl=function(){return vjs.Button.prototype.createEl.call(this,"div",{className:"vjs-big-play-button",innerHTML:'<span aria-hidden="true"></span>',"aria-label":"play video"})},vjs.BigPlayButton.prototype.onClick=function(){},vjs.ErrorDisplay=vjs.Component.extend({init:function(e,t){vjs.Component.call(this,e,t),this.update(),this.on(e,"error",this.update)}}),vjs.ErrorDisplay.prototype.createEl=function(){var e=vjs.Component.prototype.createEl.call(this,"div",{});return this.contentEl_=vjs.createEl("div"),e.appendChild(this.contentEl_),e},vjs.ErrorDisplay.prototype.update=function(){this.player().error()&&(this.contentEl_.innerHTML=this.localize(this.player().error().message))},vjs.MediaTechController=vjs.Component.extend({init:function(e,t,n){(t=t||{}).reportTouchActivity=!1,vjs.Component.call(this,e,t,n),this.featuresProgressEvents||this.manualProgressOn(),this.featuresTimeupdateEvents||this.manualTimeUpdatesOn(),this.initControlsListeners(),this.initTextTrackListeners()}}),vjs.MediaTechController.prototype.initControlsListeners=function(){var e,t;e=this.player(),t=function(){e.controls()&&!e.usingNativeControls()&&this.addControlsListeners()},this.ready(t),this.on(e,"controlsenabled",t),this.on(e,"controlsdisabled",this.removeControlsListeners),this.ready((function(){this.networkState&&this.networkState()>0&&this.player().trigger("loadstart")}))},vjs.MediaTechController.prototype.addControlsListeners=function(){var e;this.on("mousedown",this.onClick),this.on("touchstart",(function(t){e=this.player_.userActive()})),this.on("touchmove",(function(t){e&&this.player().reportUserActivity()})),this.on("touchend",(function(e){e.preventDefault()})),this.emitTapEvents(),this.on("tap",this.onTap)},vjs.MediaTechController.prototype.removeControlsListeners=function(){this.off("tap"),this.off("touchstart"),this.off("touchmove"),this.off("touchleave"),this.off("touchcancel"),this.off("touchend"),this.off("click"),this.off("mousedown")},vjs.MediaTechController.prototype.onClick=function(e){0===e.button&&this.player().controls()&&(this.player().paused()?this.player().play():this.player().pause())},vjs.MediaTechController.prototype.onTap=function(){this.player().userActive(!this.player().userActive())},vjs.MediaTechController.prototype.manualProgressOn=function(){this.manualProgress=!0,this.trackProgress()},vjs.MediaTechController.prototype.manualProgressOff=function(){this.manualProgress=!1,this.stopTrackingProgress()},vjs.MediaTechController.prototype.trackProgress=function(){this.progressInterval=this.setInterval((function(){var e=this.player().bufferedPercent();this.bufferedPercent_!=e&&this.player().trigger("progress"),this.bufferedPercent_=e,1===e&&this.stopTrackingProgress()}),500)},vjs.MediaTechController.prototype.stopTrackingProgress=function(){this.clearInterval(this.progressInterval)},
/*! Time Tracking -------------------------------------------------------------- */
vjs.MediaTechController.prototype.manualTimeUpdatesOn=function(){var e=this.player_;this.manualTimeUpdates=!0,this.on(e,"play",this.trackCurrentTime),this.on(e,"pause",this.stopTrackingCurrentTime),this.one("timeupdate",(function(){this.featuresTimeupdateEvents=!0,this.manualTimeUpdatesOff()}))},vjs.MediaTechController.prototype.manualTimeUpdatesOff=function(){var e=this.player_;this.manualTimeUpdates=!1,this.stopTrackingCurrentTime(),this.off(e,"play",this.trackCurrentTime),this.off(e,"pause",this.stopTrackingCurrentTime)},vjs.MediaTechController.prototype.trackCurrentTime=function(){this.currentTimeInterval&&this.stopTrackingCurrentTime(),this.currentTimeInterval=this.setInterval((function(){this.player().trigger("timeupdate")}),250)},vjs.MediaTechController.prototype.stopTrackingCurrentTime=function(){this.clearInterval(this.currentTimeInterval),this.player().trigger("timeupdate")},vjs.MediaTechController.prototype.dispose=function(){this.manualProgress&&this.manualProgressOff(),this.manualTimeUpdates&&this.manualTimeUpdatesOff(),vjs.Component.prototype.dispose.call(this)},vjs.MediaTechController.prototype.setCurrentTime=function(){this.manualTimeUpdates&&this.player().trigger("timeupdate")},vjs.MediaTechController.prototype.initTextTrackListeners=function(){var e,t=this.player_,n=function(){var e=t.getChild("textTrackDisplay");e&&e.updateDisplay()};(e=this.textTracks())&&(e.addEventListener("removetrack",n),e.addEventListener("addtrack",n),this.on("dispose",vjs.bind(this,(function(){e.removeEventListener("removetrack",n),e.removeEventListener("addtrack",n)}))))},vjs.MediaTechController.prototype.emulateTextTracks=function(){var e,t,n=this.player_;window.WebVTT,(t=this.textTracks())&&(e=function(){var e,t,i;for((i=n.getChild("textTrackDisplay")).updateDisplay(),e=0;e<this.length;e++)(t=this[e]).removeEventListener("cuechange",vjs.bind(i,i.updateDisplay)),"showing"===t.mode&&t.addEventListener("cuechange",vjs.bind(i,i.updateDisplay))},t.addEventListener("change",e),this.on("dispose",vjs.bind(this,(function(){t.removeEventListener("change",e)}))))},vjs.MediaTechController.prototype.textTracks_,vjs.MediaTechController.prototype.textTracks=function(){return this.player_.textTracks_=this.player_.textTracks_||new vjs.TextTrackList,this.player_.textTracks_},vjs.MediaTechController.prototype.remoteTextTracks=function(){return this.player_.remoteTextTracks_=this.player_.remoteTextTracks_||new vjs.TextTrackList,this.player_.remoteTextTracks_},createTrackHelper=function(e,t,n,i,r){var o,a=e.textTracks();return(r=r||{}).kind=t,n&&(r.label=n),i&&(r.language=i),r.player=e.player_,o=new vjs.TextTrack(r),a.addTrack_(o),o},vjs.MediaTechController.prototype.addTextTrack=function(e,t,n){if(!e)throw new Error("TextTrack kind is required but was not provided");return createTrackHelper(this,e,t,n)},vjs.MediaTechController.prototype.addRemoteTextTrack=function(e){var t=createTrackHelper(this,e.kind,e.label,e.language,e);return this.remoteTextTracks().addTrack_(t),{track:t}},vjs.MediaTechController.prototype.removeRemoteTextTrack=function(e){this.textTracks().removeTrack_(e),this.remoteTextTracks().removeTrack_(e)},vjs.MediaTechController.prototype.setPoster=function(){},vjs.MediaTechController.prototype.featuresVolumeControl=!0,vjs.MediaTechController.prototype.featuresFullscreenResize=!1,vjs.MediaTechController.prototype.featuresPlaybackRate=!1,vjs.MediaTechController.prototype.featuresProgressEvents=!1,vjs.MediaTechController.prototype.featuresTimeupdateEvents=!1,vjs.MediaTechController.prototype.featuresNativeTextTracks=!1,vjs.MediaTechController.withSourceHandlers=function(e){e.registerSourceHandler=function(t,n){var i=e.sourceHandlers;i||(i=e.sourceHandlers=[]),void 0===n&&(n=i.length),i.splice(n,0,t)},e.selectSourceHandler=function(t){for(var n=e.sourceHandlers||[],i=0;i<n.length;i++)if(n[i].canHandleSource(t))return n[i];return null},e.canPlaySource=function(t){var n=e.selectSourceHandler(t);return n?n.canHandleSource(t):""},e.prototype.setSource=function(t){var n=e.selectSourceHandler(t);return n||(e.nativeSourceHandler?n=e.nativeSourceHandler:vjs.log.error("No source hander found for the current source.")),this.disposeSourceHandler(),this.off("dispose",this.disposeSourceHandler),this.currentSource_=t,this.sourceHandler_=n.handleSource(t,this),this.on("dispose",this.disposeSourceHandler),this},e.prototype.disposeSourceHandler=function(){this.sourceHandler_&&this.sourceHandler_.dispose&&this.sourceHandler_.dispose()}},vjs.media={},vjs.Html5=vjs.MediaTechController.extend({init:function(e,t,n){var i,r,o,a,s;!1!==t.nativeCaptions&&!1!==t.nativeTextTracks||(this.featuresNativeTextTracks=!1),vjs.MediaTechController.call(this,e,t,n),this.setupTriggers();var l=t.source;if(l&&(this.el_.currentSrc!==l.src||e.tag&&3===e.tag.initNetworkState_)&&this.setSource(l),this.el_.hasChildNodes()){for(r=(i=this.el_.childNodes).length,s=[];r--;)"track"===(a=i[r]).nodeName.toLowerCase()&&(this.featuresNativeTextTracks?this.remoteTextTracks().addTrack_(a.track):s.push(a));for(o=0;o<s.length;o++)this.el_.removeChild(s[o])}this.featuresNativeTextTracks&&this.on("loadstart",vjs.bind(this,this.hideCaptions)),vjs.TOUCH_ENABLED&&!0===e.options().nativeControlsForTouch&&this.useNativeControls(),e.ready((function(){this.src()&&this.tag&&this.options_.autoplay&&this.paused()&&(delete this.tag.poster,this.play())})),this.triggerReady()}}),vjs.Html5.prototype.dispose=function(){vjs.Html5.disposeMediaElement(this.el_),vjs.MediaTechController.prototype.dispose.call(this)},vjs.Html5.prototype.createEl=function(){var e,t,n,i,r,o=this.player_,a=o.tag;if(!a||!1===this.movingMediaElementInDOM){if(a?(r=a.cloneNode(!1),vjs.Html5.disposeMediaElement(a),a=r,o.tag=null):(a=vjs.createEl("video"),i=videojs.util.mergeOptions({},o.tagAttributes),vjs.TOUCH_ENABLED&&!0===o.options().nativeControlsForTouch||delete i.controls,vjs.setElementAttributes(a,vjs.obj.merge(i,{id:o.id()+"_html5_api",class:"vjs-tech"}))),a.player=o,o.options_.tracks)for(n=0;n<o.options_.tracks.length;n++)e=o.options_.tracks[n],(t=document.createElement("track")).kind=e.kind,t.label=e.label,t.srclang=e.srclang,t.src=e.src,"default"in e&&t.setAttribute("default","default"),a.appendChild(t);vjs.insertFirst(a,o.el())}var s=["autoplay","preload","loop","muted"];for(n=s.length-1;n>=0;n--){var l=s[n],d={};void 0!==o.options_[l]&&(d[l]=o.options_[l]),vjs.setElementAttributes(a,d)}return o.options_.enableNativeInline&&(a.setAttribute("playsinline",""),a.setAttribute("webkit-playsinline","")),a},vjs.Html5.prototype.hideCaptions=function(){for(var e,t=this.el_.querySelectorAll("track"),n=t.length,i={captions:1,subtitles:1};n--;)(e=t[n].track)&&e.kind in i&&!t[n].default&&(e.mode="disabled")},vjs.Html5.prototype.setupTriggers=function(){for(var e=vjs.Html5.Events.length-1;e>=0;e--)this.on(vjs.Html5.Events[e],this.eventHandler)},vjs.Html5.prototype.eventHandler=function(e){"error"==e.type&&this.error()?this.player().error(this.error().code):(e.bubbles=!1,this.player().trigger(e))},vjs.Html5.prototype.useNativeControls=function(){var e,t,n,i,r;e=this,t=this.player(),e.setControls(t.controls()),n=function(){e.setControls(!0)},i=function(){e.setControls(!1)},t.on("controlsenabled",n),t.on("controlsdisabled",i),r=function(){t.off("controlsenabled",n),t.off("controlsdisabled",i)},e.on("dispose",r),t.on("usingcustomcontrols",r),t.usingNativeControls(!0)},vjs.Html5.prototype.play=function(){this.el_.play()},vjs.Html5.prototype.pause=function(){this.el_.pause()},vjs.Html5.prototype.paused=function(){return this.el_.paused},vjs.Html5.prototype.currentTime=function(){return this.el_.currentTime||this.el_.currentTimeForOutstream||0},vjs.Html5.prototype.setCurrentTime=function(e){try{this.el_.currentTimeForOutstream=e,this.el_.currentTime=e}catch(e){vjs.log(e,"Video is not ready. (Video.js)")}},vjs.Html5.prototype.duration=function(){return this.el_.duration||0},vjs.Html5.prototype.buffered=function(){return this.el_.buffered},vjs.Html5.prototype.volume=function(){return this.el_.volume},vjs.Html5.prototype.setVolume=function(e){this.el_.volume=e},vjs.Html5.prototype.muted=function(){return this.el_.muted},vjs.Html5.prototype.setMuted=function(e){this.el_.muted=e},vjs.Html5.prototype.width=function(){return this.el_.offsetWidth},vjs.Html5.prototype.height=function(){return this.el_.offsetHeight},vjs.Html5.prototype.supportsFullScreen=function(){return!("function"!=typeof this.el_.webkitEnterFullScreen||!/Android/.test(vjs.USER_AGENT)&&/Chrome|Mac OS X 10.5/.test(vjs.USER_AGENT))},vjs.Html5.prototype.enterFullScreen=function(){var e=this.el_;"webkitDisplayingFullscreen"in e&&this.one("webkitbeginfullscreen",(function(){this.player_.isFullscreen(!0),this.one("webkitendfullscreen",(function(){this.player_.isFullscreen(!1),this.player_.trigger("fullscreenchange")})),this.player_.trigger("fullscreenchange")})),e.paused&&e.networkState<=e.HAVE_METADATA?(this.el_.play(),this.setTimeout((function(){e.pause(),e.webkitEnterFullScreen()}),0)):e.webkitEnterFullScreen()},vjs.Html5.prototype.exitFullScreen=function(){this.el_.webkitExitFullScreen()},vjs.Html5.prototype.returnOriginalIfBlobURI_=function(e,t){return t&&e&&/^blob\:/i.test(e)?t:e},vjs.Html5.prototype.src=function(e){var t=this.el_.src;if(void 0===e)return this.returnOriginalIfBlobURI_(t,this.source_);this.setSrc(e)},vjs.Html5.prototype.setSrc=function(e){this.el_.src=e},vjs.Html5.prototype.load=function(){this.el_.load()},vjs.Html5.prototype.currentSrc=function(){var e=this.el_.currentSrc;return this.currentSource_?this.returnOriginalIfBlobURI_(e,this.currentSource_.src):e},vjs.Html5.prototype.poster=function(){return this.el_.poster},vjs.Html5.prototype.setPoster=function(e){this.el_.poster=e},vjs.Html5.prototype.preload=function(){return this.el_.preload},vjs.Html5.prototype.setPreload=function(e){this.el_.preload=e},vjs.Html5.prototype.autoplay=function(){return this.el_.autoplay},vjs.Html5.prototype.setAutoplay=function(e){this.el_.autoplay=e},vjs.Html5.prototype.controls=function(){return this.el_.controls},vjs.Html5.prototype.setControls=function(e){this.el_.controls=!!e},vjs.Html5.prototype.loop=function(){return this.el_.loop},vjs.Html5.prototype.setLoop=function(e){this.el_.loop=e},vjs.Html5.prototype.error=function(){return this.el_.error},vjs.Html5.prototype.seeking=function(){return this.el_.seeking},vjs.Html5.prototype.seekable=function(){return this.el_.seekable},vjs.Html5.prototype.ended=function(){return this.el_.ended},vjs.Html5.prototype.defaultMuted=function(){return this.el_.defaultMuted},vjs.Html5.prototype.playbackRate=function(){return this.el_.playbackRate},vjs.Html5.prototype.setPlaybackRate=function(e){this.el_.playbackRate=e},vjs.Html5.prototype.networkState=function(){return this.el_.networkState},vjs.Html5.prototype.readyState=function(){return this.el_.readyState},vjs.Html5.prototype.textTracks=function(){return this.featuresNativeTextTracks?this.el_.textTracks:vjs.MediaTechController.prototype.textTracks.call(this)},vjs.Html5.prototype.addTextTrack=function(e,t,n){return this.featuresNativeTextTracks?this.el_.addTextTrack(e,t,n):vjs.MediaTechController.prototype.addTextTrack.call(this,e,t,n)},vjs.Html5.prototype.addRemoteTextTrack=function(e){if(!this.featuresNativeTextTracks)return vjs.MediaTechController.prototype.addRemoteTextTrack.call(this,e);var t=document.createElement("track");return(e=e||{}).kind&&(t.kind=e.kind),e.label&&(t.label=e.label),(e.language||e.srclang)&&(t.srclang=e.language||e.srclang),e.default&&(t.default=e.default),e.id&&(t.id=e.id),e.src&&(t.src=e.src),this.el().appendChild(t),"metadata"===t.track.kind?t.track.mode="hidden":t.track.mode="disabled",t.onload=function(){var e=t.track;t.readyState>=2&&("metadata"===e.kind&&"hidden"!==e.mode?e.mode="hidden":"metadata"!==e.kind&&"disabled"!==e.mode&&(e.mode="disabled"),t.onload=null)},this.remoteTextTracks().addTrack_(t.track),t},vjs.Html5.prototype.removeRemoteTextTrack=function(e){if(!this.featuresNativeTextTracks)return vjs.MediaTechController.prototype.removeRemoteTextTrack.call(this,e);var t,n;for(this.remoteTextTracks().removeTrack_(e),t=this.el().querySelectorAll("track"),n=0;n<t.length;n++)if(t[n]===e||t[n].track===e){t[n].parentNode.removeChild(t[n]);break}},vjs.Html5.isSupported=function(){try{vjs.TEST_VID.volume=.5}catch(e){return!1}return!!vjs.TEST_VID.canPlayType},vjs.MediaTechController.withSourceHandlers(vjs.Html5),origSetSource=vjs.Html5.prototype.setSource,origDisposeSourceHandler=vjs.Html5.prototype.disposeSourceHandler,vjs.Html5.prototype.setSource=function(e){var t=origSetSource.call(this,e);return this.source_=e.src,t},vjs.Html5.prototype.disposeSourceHandler=function(){return this.source_=void 0,origDisposeSourceHandler.call(this)},vjs.Html5.nativeSourceHandler={},vjs.Html5.nativeSourceHandler.canHandleSource=function(e){var t;function n(e){try{return vjs.TEST_VID.canPlayType(e)}catch(e){return""}}return e.type?n(e.type):e.src?n("video/"+((t=e.src.match(/\.([^.\/\?]+)(\?[^\/]+)?$/i))&&t[1])):""},vjs.Html5.nativeSourceHandler.handleSource=function(e,t){t.setSrc(e.src)},vjs.Html5.nativeSourceHandler.dispose=function(){},vjs.Html5.registerSourceHandler(vjs.Html5.nativeSourceHandler),vjs.Html5.canControlVolume=function(){var e=vjs.TEST_VID.volume;return vjs.TEST_VID.volume=e/2+.1,e!==vjs.TEST_VID.volume},vjs.Html5.canControlPlaybackRate=function(){var e=vjs.TEST_VID.playbackRate;return vjs.TEST_VID.playbackRate=e/2+.1,e!==vjs.TEST_VID.playbackRate},vjs.Html5.supportsNativeTextTracks=function(){var e;return(e=!!vjs.TEST_VID.textTracks)&&vjs.TEST_VID.textTracks.length>0&&(e="number"!=typeof vjs.TEST_VID.textTracks[0].mode),e&&vjs.IS_FIREFOX&&(e=!1),e},vjs.Html5.prototype.featuresVolumeControl=vjs.Html5.canControlVolume(),vjs.Html5.prototype.featuresPlaybackRate=vjs.Html5.canControlPlaybackRate(),vjs.Html5.prototype.movingMediaElementInDOM=!vjs.IS_IOS,vjs.Html5.prototype.featuresFullscreenResize=!0,vjs.Html5.prototype.featuresProgressEvents=!0,vjs.Html5.prototype.featuresNativeTextTracks=vjs.Html5.supportsNativeTextTracks(),mpegurlRE=/^application\/(?:x-|vnd\.apple\.)mpegurl/i,mp4RE=/^video\/mp4/i,vjs.Html5.patchCanPlayType=function(){vjs.ANDROID_VERSION>=4&&(canPlayType||(canPlayType=vjs.TEST_VID.constructor.prototype.canPlayType),vjs.TEST_VID.constructor.prototype.canPlayType=function(e){return e&&mpegurlRE.test(e)?"maybe":canPlayType.call(this,e)}),vjs.IS_OLD_ANDROID&&(canPlayType||(canPlayType=vjs.TEST_VID.constructor.prototype.canPlayType),vjs.TEST_VID.constructor.prototype.canPlayType=function(e){return e&&mp4RE.test(e)?"maybe":canPlayType.call(this,e)})},vjs.Html5.unpatchCanPlayType=function(){var e=vjs.TEST_VID.constructor.prototype.canPlayType;return vjs.TEST_VID.constructor.prototype.canPlayType=canPlayType,canPlayType=null,e},vjs.Html5.patchCanPlayType(),vjs.Html5.Events="loadstart,suspend,abort,error,emptied,stalled,loadedmetadata,loadeddata,canplay,canplaythrough,playing,waiting,seeking,seeked,ended,durationchange,timeupdate,progress,play,pause,ratechange,volumechange".split(","),vjs.Html5.disposeMediaElement=function(e){if(e){for(e.player=null,e.parentNode&&e.parentNode.removeChild(e);e.hasChildNodes();)e.removeChild(e.firstChild);e.removeAttribute("src"),"function"==typeof e.load&&function(){try{e.load()}catch(e){}}()}},vjs.MediaLoader=vjs.Component.extend({init:function(e,t,n){if(vjs.Component.call(this,e,t,n),e.options_.sources&&0!==e.options_.sources.length)e.src(e.options_.sources);else for(var i=0,r=e.options_.techOrder;i<r.length;i++){var o=vjs.capitalize(r[i]),a=window.videojs_apn[o];if(a&&a.isSupported()){e.loadTech(o);break}}}}),vjs.TextTrackMode={disabled:"disabled",hidden:"hidden",showing:"showing"},vjs.TextTrackKind={subtitles:"subtitles",captions:"captions",descriptions:"descriptions",chapters:"chapters",metadata:"metadata"},vjs.TextTrack=function(e){var t,n,i,r,o,a,s,l,d,c,u;if(!(e=e||{}).player)throw new Error("A player was not provided.");if(t=this,vjs.IS_IE8)for(u in t=document.createElement("custom"),vjs.TextTrack.prototype)t[u]=vjs.TextTrack.prototype[u];if(t.player_=e.player,i=vjs.TextTrackMode[e.mode]||"disabled",r=vjs.TextTrackKind[e.kind]||"subtitles",o=e.label||"",a=e.language||e.srclang||"",n=e.id||"vjs_text_track_"+vjs.guid++,"metadata"!==r&&"chapters"!==r||(i="hidden"),t.cues_=[],t.activeCues_=[],s=new vjs.TextTrackCueList(t.cues_),l=new vjs.TextTrackCueList(t.activeCues_),c=!1,d=vjs.bind(t,(function(){this.activeCues,c&&(this.trigger("cuechange"),c=!1)})),"disabled"!==i&&t.player_.on("timeupdate",d),Object.defineProperty(t,"kind",{get:function(){return r},set:Function.prototype}),Object.defineProperty(t,"label",{get:function(){return o},set:Function.prototype}),Object.defineProperty(t,"language",{get:function(){return a},set:Function.prototype}),Object.defineProperty(t,"id",{get:function(){return n},set:Function.prototype}),Object.defineProperty(t,"mode",{get:function(){return i},set:function(e){vjs.TextTrackMode[e]&&("showing"===(i=e)&&this.player_.on("timeupdate",d),this.trigger("modechange"))}}),Object.defineProperty(t,"cues",{get:function(){return this.loaded_?s:null},set:Function.prototype}),Object.defineProperty(t,"activeCues",{get:function(){var e,t,n,i,r;if(!this.loaded_)return null;if(0===this.cues.length)return l;for(i=this.player_.currentTime(),e=0,t=this.cues.length,n=[];e<t;e++)((r=this.cues[e]).startTime<=i&&r.endTime>=i||r.startTime===r.endTime&&r.startTime<=i&&r.startTime+.5>=i)&&n.push(r);if(c=!1,n.length!==this.activeCues_.length)c=!0;else for(e=0;e<n.length;e++)-1===indexOf.call(this.activeCues_,n[e])&&(c=!0);return this.activeCues_=n,l.setCues_(this.activeCues_),l},set:Function.prototype}),e.src?loadTrack(e.src,t):t.loaded_=!0,vjs.IS_IE8)return t},vjs.TextTrack.prototype=vjs.obj.create(vjs.EventEmitter.prototype),vjs.TextTrack.prototype.constructor=vjs.TextTrack,vjs.TextTrack.prototype.allowedEvents_={cuechange:"cuechange"},vjs.TextTrack.prototype.addCue=function(e){var t=this.player_.textTracks(),n=0;if(t)for(;n<t.length;n++)t[n]!==this&&t[n].removeCue(e);this.cues_.push(e),this.cues.setCues_(this.cues_)},vjs.TextTrack.prototype.removeCue=function(e){for(var t=0,n=this.cues_.length,i=!1;t<n;t++)this.cues_[t]===e&&(this.cues_.splice(t,1),i=!0);i&&this.cues.setCues_(this.cues_)},loadTrack=function(e,t){vjs.xhr(e,vjs.bind(this,(function(e,n,i){if(e)return vjs.log.error(e);t.loaded_=!0,parseCues(i,t)})))},parseCues=function(e,t){if("function"!=typeof window.WebVTT)return window.setTimeout((function(){parseCues(e,t)}),25);var n=new window.WebVTT.Parser(window,window.vttjs,window.WebVTT.StringDecoder());n.oncue=function(e){t.addCue(e)},n.onparsingerror=function(e){vjs.log.error(e)},n.parse(e),n.flush()},indexOf=function(e,t){var n;if(null==this)throw new TypeError('"this" is null or not defined');var i=Object(this),r=i.length>>>0;if(0===r)return-1;var o=+t||0;if(Math.abs(o)===1/0&&(o=0),o>=r)return-1;for(n=Math.max(o>=0?o:r-Math.abs(o),0);n<r;){if(n in i&&i[n]===e)return n;n++}return-1},vjs.TextTrackList=function(e){var t,n=this,i=0;if(vjs.IS_IE8)for(t in n=document.createElement("custom"),vjs.TextTrackList.prototype)n[t]=vjs.TextTrackList.prototype[t];for(e=e||[],n.tracks_=[],Object.defineProperty(n,"length",{get:function(){return this.tracks_.length}});i<e.length;i++)n.addTrack_(e[i]);if(vjs.IS_IE8)return n},vjs.TextTrackList.prototype=vjs.obj.create(vjs.EventEmitter.prototype),vjs.TextTrackList.prototype.constructor=vjs.TextTrackList,vjs.TextTrackList.prototype.allowedEvents_={change:"change",addtrack:"addtrack",removetrack:"removetrack"},function(){var e;for(e in vjs.TextTrackList.prototype.allowedEvents_)vjs.TextTrackList.prototype["on"+e]=null}(),vjs.TextTrackList.prototype.addTrack_=function(e){var t=this.tracks_.length;""+t in this||Object.defineProperty(this,t,{get:function(){return this.tracks_[t]}}),e.addEventListener("modechange",vjs.bind(this,(function(){this.trigger("change")}))),this.tracks_.push(e),this.trigger({type:"addtrack",track:e})},vjs.TextTrackList.prototype.removeTrack_=function(e){for(var t=0,n=this.length;t<n;t++)if(this[t]===e){this.tracks_.splice(t,1);break}this.trigger({type:"removetrack",track:e})},vjs.TextTrackList.prototype.getTrackById=function(e){for(var t,n=0,i=this.length,r=null;n<i;n++)if((t=this[n]).id===e){r=t;break}return r},vjs.TextTrackCueList=function(e){var t,n=this;if(vjs.IS_IE8)for(t in n=document.createElement("custom"),vjs.TextTrackCueList.prototype)n[t]=vjs.TextTrackCueList.prototype[t];if(vjs.TextTrackCueList.prototype.setCues_.call(n,e),Object.defineProperty(n,"length",{get:function(){return this.length_}}),vjs.IS_IE8)return n},vjs.TextTrackCueList.prototype.setCues_=function(e){var t,n=this.length||0,i=0,r=e.length;if(this.cues_=e,this.length_=e.length,t=function(e){""+e in this||Object.defineProperty(this,""+e,{get:function(){return this.cues_[e]}})},n<r)for(i=n;i<r;i++)t.call(this,i)},vjs.TextTrackCueList.prototype.getCueById=function(e){for(var t,n=0,i=this.length,r=null;n<i;n++)if((t=this[n]).id===e){r=t;break}return r},function(){"use strict";vjs.TextTrackDisplay=vjs.Component.extend({init:function(e,t,n){vjs.Component.call(this,e,t,n),e.on("loadstart",vjs.bind(this,this.toggleDisplay)),e.ready(vjs.bind(this,(function(){var t,n,i;if(e.tech&&e.tech.featuresNativeTextTracks)this.hide();else for(e.on("fullscreenchange",vjs.bind(this,this.updateDisplay)),n=e.options_.tracks||[],t=0;t<n.length;t++)i=n[t],this.player_.addRemoteTextTrack(i)})))}}),vjs.TextTrackDisplay.prototype.toggleDisplay=function(){this.player_.tech&&this.player_.tech.featuresNativeTextTracks?this.hide():this.show()},vjs.TextTrackDisplay.prototype.createEl=function(){return vjs.Component.prototype.createEl.call(this,"div",{className:"vjs-text-track-display"})},vjs.TextTrackDisplay.prototype.clearDisplay=function(){"function"==typeof window.WebVTT&&window.WebVTT.processCues(window,[],this.el_)};var e=function(e,t){return"rgba("+parseInt(e[1]+e[1],16)+","+parseInt(e[2]+e[2],16)+","+parseInt(e[3]+e[3],16)+","+t+")"},t={monospace:"monospace",sansSerif:"sans-serif",serif:"serif",monospaceSansSerif:'"Andale Mono", "Lucida Console", monospace',monospaceSerif:'"Courier New", monospace',proportionalSansSerif:"sans-serif",proportionalSerif:"serif",casual:'"Comic Sans MS", Impact, fantasy',script:'"Monotype Corsiva", cursive',smallcaps:'"Andale Mono", "Lucida Console", monospace, sans-serif'},n=function(e,t,n){try{e.style[t]=n}catch(e){}};vjs.TextTrackDisplay.prototype.updateDisplay=function(){var e,t=this.player_.textTracks(),n=0;if(this.clearDisplay(),t)for(;n<t.length;n++)"showing"===(e=t[n]).mode&&this.updateForTrack(e)},vjs.TextTrackDisplay.prototype.updateForTrack=function(i){if("function"==typeof window.WebVTT&&i.activeCues){for(var r,o,a=0,s=this.player_.textTrackSettings.getValues(),l=[];a<i.activeCues.length;a++)l.push(i.activeCues[a]);for(window.WebVTT.processCues(window,i.activeCues,this.el_),a=l.length;a--;)r=l[a].displayState,s.color&&(r.firstChild.style.color=s.color),s.textOpacity&&n(r.firstChild,"color",e(s.color||"#fff",s.textOpacity)),s.backgroundColor&&(r.firstChild.style.backgroundColor=s.backgroundColor),s.backgroundOpacity&&n(r.firstChild,"backgroundColor",e(s.backgroundColor||"#000",s.backgroundOpacity)),s.windowColor&&(s.windowOpacity?n(r,"backgroundColor",e(s.windowColor,s.windowOpacity)):r.style.backgroundColor=s.windowColor),s.edgeStyle&&("dropshadow"===s.edgeStyle?r.firstChild.style.textShadow="2px 2px 3px #222, 2px 2px 4px #222, 2px 2px 5px #222":"raised"===s.edgeStyle?r.firstChild.style.textShadow="1px 1px #222, 2px 2px #222, 3px 3px #222":"depressed"===s.edgeStyle?r.firstChild.style.textShadow="1px 1px #ccc, 0 1px #ccc, -1px -1px #222, 0 -1px #222":"uniform"===s.edgeStyle&&(r.firstChild.style.textShadow="0 0 4px #222, 0 0 4px #222, 0 0 4px #222, 0 0 4px #222")),s.fontPercent&&1!==s.fontPercent&&(o=window.parseFloat(r.style.fontSize),r.style.fontSize=o*s.fontPercent+"px",r.style.height="auto",r.style.top="auto",r.style.bottom="2px"),s.fontFamily&&"default"!==s.fontFamily&&("small-caps"===s.fontFamily?r.firstChild.style.fontVariant="small-caps":r.firstChild.style.fontFamily=t[s.fontFamily])}},vjs.TextTrackMenuItem=vjs.MenuItem.extend({init:function(e,t){var n,i,r=this.track=t.track,o=e.textTracks();o&&(n=vjs.bind(this,(function(){var e,t,n,i="showing"===this.track.mode;if(this instanceof vjs.OffTextTrackMenuItem)for(i=!0,t=0,n=o.length;t<n;t++)if((e=o[t]).kind===this.track.kind&&"showing"===e.mode){i=!1;break}this.selected(i)})),o.addEventListener("change",n),e.on("dispose",(function(){o.removeEventListener("change",n)}))),t.label=r.label||r.language||"Unknown",t.selected=r.default||"showing"===r.mode,vjs.MenuItem.call(this,e,t),o&&void 0===o.onchange&&this.on(["tap","click"],(function(){if("object"!=typeof window.Event)try{i=new window.Event("change")}catch(e){}i||(i=document.createEvent("Event")).initEvent("change",!0,!0),o.dispatchEvent(i)}))}}),vjs.TextTrackMenuItem.prototype.onClick=function(){var e,t=this.track.kind,n=this.player_.textTracks(),i=0;if(vjs.MenuItem.prototype.onClick.call(this),n)for(;i<n.length;i++)(e=n[i]).kind===t&&(e===this.track?e.mode="showing":e.mode="disabled")},vjs.OffTextTrackMenuItem=vjs.TextTrackMenuItem.extend({init:function(e,t){t.track={kind:t.kind,player:e,label:t.kind+" off",default:!1,mode:"disabled"},vjs.TextTrackMenuItem.call(this,e,t),this.selected(!0)}}),vjs.CaptionSettingsMenuItem=vjs.TextTrackMenuItem.extend({init:function(e,t){t.track={kind:t.kind,player:e,label:t.kind+" settings",default:!1,mode:"disabled"},vjs.TextTrackMenuItem.call(this,e,t),this.addClass("vjs-texttrack-settings")}}),vjs.CaptionSettingsMenuItem.prototype.onClick=function(){this.player().getChild("textTrackSettings").show()},vjs.TextTrackButton=vjs.MenuButton.extend({init:function(e,t){var n,i;vjs.MenuButton.call(this,e,t),n=this.player_.textTracks(),this.items.length<=1&&this.hide(),n&&(i=vjs.bind(this,this.update),n.addEventListener("removetrack",i),n.addEventListener("addtrack",i),this.player_.on("dispose",(function(){n.removeEventListener("removetrack",i),n.removeEventListener("addtrack",i)})))}}),vjs.TextTrackButton.prototype.createItems=function(){var e,t,n=[];if(!(this instanceof vjs.CaptionsButton)||this.player().tech&&this.player().tech.featuresNativeTextTracks||n.push(new vjs.CaptionSettingsMenuItem(this.player_,{kind:this.kind_})),n.push(new vjs.OffTextTrackMenuItem(this.player_,{kind:this.kind_})),!(t=this.player_.textTracks()))return n;for(var i=0;i<t.length;i++)(e=t[i]).kind===this.kind_&&n.push(new vjs.TextTrackMenuItem(this.player_,{track:e}));return n},vjs.CaptionsButton=vjs.TextTrackButton.extend({init:function(e,t,n){vjs.TextTrackButton.call(this,e,t,n),this.el_.setAttribute("aria-label","Captions Menu")}}),vjs.CaptionsButton.prototype.kind_="captions",vjs.CaptionsButton.prototype.buttonText="Captions",vjs.CaptionsButton.prototype.className="vjs-captions-button",vjs.CaptionsButton.prototype.update=function(){var e=2;vjs.TextTrackButton.prototype.update.call(this),this.player().tech&&this.player().tech.featuresNativeTextTracks&&(e=1),this.items&&this.items.length>e?this.show():this.hide()},vjs.SubtitlesButton=vjs.TextTrackButton.extend({init:function(e,t,n){vjs.TextTrackButton.call(this,e,t,n),this.el_.setAttribute("aria-label","Subtitles Menu")}}),vjs.SubtitlesButton.prototype.kind_="subtitles",vjs.SubtitlesButton.prototype.buttonText="Subtitles",vjs.SubtitlesButton.prototype.className="vjs-subtitles-button",vjs.ChaptersButton=vjs.TextTrackButton.extend({init:function(e,t,n){vjs.TextTrackButton.call(this,e,t,n),this.el_.setAttribute("aria-label","Chapters Menu")}}),vjs.ChaptersButton.prototype.kind_="chapters",vjs.ChaptersButton.prototype.buttonText="Chapters",vjs.ChaptersButton.prototype.className="vjs-chapters-button",vjs.ChaptersButton.prototype.createItems=function(){var e,t,n=[];if(!(t=this.player_.textTracks()))return n;for(var i=0;i<t.length;i++)(e=t[i]).kind===this.kind_&&n.push(new vjs.TextTrackMenuItem(this.player_,{track:e}));return n},vjs.ChaptersButton.prototype.createMenu=function(){for(var e,t,n=this.player_.textTracks()||[],i=0,r=n.length,o=this.items=[];i<r;i++)if((e=n[i]).kind==this.kind_){if(e.cues){t=e;break}e.mode="hidden",window.setTimeout(vjs.bind(this,(function(){this.createMenu()})),100)}var a=this.menu;if(void 0===a&&(a=new vjs.Menu(this.player_)).contentEl().appendChild(vjs.createEl("li",{className:"vjs-menu-title",innerHTML:vjs.capitalize(this.kind_),tabindex:-1})),t){var s,l,d=t.cues;for(i=0,r=d.length;i<r;i++)s=d[i],l=new vjs.ChaptersTrackMenuItem(this.player_,{track:t,cue:s}),o.push(l),a.addChild(l);this.addChild(a)}return this.items.length>0&&this.show(),a},vjs.ChaptersTrackMenuItem=vjs.MenuItem.extend({init:function(e,t){var n=this.track=t.track,i=this.cue=t.cue,r=e.currentTime();t.label=i.text,t.selected=i.startTime<=r&&r<i.endTime,vjs.MenuItem.call(this,e,t),n.addEventListener("cuechange",vjs.bind(this,this.update))}}),vjs.ChaptersTrackMenuItem.prototype.onClick=function(){vjs.MenuItem.prototype.onClick.call(this),this.player_.currentTime(this.cue.startTime),this.update(this.cue.startTime)},vjs.ChaptersTrackMenuItem.prototype.update=function(){var e=this.cue,t=this.player_.currentTime();this.selected(e.startTime<=t&&t<e.endTime)}}();var cacheManager=__webpack_require__(6);if(function(){"use strict";function e(e){var t;return e.selectedOptions?t=e.selectedOptions[0]:e.options&&(t=e.options[e.options.selectedIndex]),t.value}function t(e,t){var n;if(t){for(n=0;n<e.options.length&&e.options[n].value!==t;n++);e.selectedIndex=n}}vjs.TextTrackSettings=vjs.Component.extend({init:function(e,t){vjs.Component.call(this,e,t),this.hide(),vjs.on(this.el().querySelector(".vjs-done-button"),"click",vjs.bind(this,(function(){this.saveSettings(),this.hide()}))),vjs.on(this.el().querySelector(".vjs-default-button"),"click",vjs.bind(this,(function(){this.el().querySelector(".vjs-fg-color > select").selectedIndex=0,this.el().querySelector(".vjs-bg-color > select").selectedIndex=0,this.el().querySelector(".window-color > select").selectedIndex=0,this.el().querySelector(".vjs-text-opacity > select").selectedIndex=0,this.el().querySelector(".vjs-bg-opacity > select").selectedIndex=0,this.el().querySelector(".vjs-window-opacity > select").selectedIndex=0,this.el().querySelector(".vjs-edge-style select").selectedIndex=0,this.el().querySelector(".vjs-font-family select").selectedIndex=0,this.el().querySelector(".vjs-font-percent select").selectedIndex=2,this.updateDisplay()}))),vjs.on(this.el().querySelector(".vjs-fg-color > select"),"change",vjs.bind(this,this.updateDisplay)),vjs.on(this.el().querySelector(".vjs-bg-color > select"),"change",vjs.bind(this,this.updateDisplay)),vjs.on(this.el().querySelector(".window-color > select"),"change",vjs.bind(this,this.updateDisplay)),vjs.on(this.el().querySelector(".vjs-text-opacity > select"),"change",vjs.bind(this,this.updateDisplay)),vjs.on(this.el().querySelector(".vjs-bg-opacity > select"),"change",vjs.bind(this,this.updateDisplay)),vjs.on(this.el().querySelector(".vjs-window-opacity > select"),"change",vjs.bind(this,this.updateDisplay)),vjs.on(this.el().querySelector(".vjs-font-percent select"),"change",vjs.bind(this,this.updateDisplay)),vjs.on(this.el().querySelector(".vjs-edge-style select"),"change",vjs.bind(this,this.updateDisplay)),vjs.on(this.el().querySelector(".vjs-font-family select"),"change",vjs.bind(this,this.updateDisplay)),e.options().persistTextTrackSettings&&this.restoreSettings()}}),vjs.TextTrackSettings.prototype.createEl=function(){return vjs.Component.prototype.createEl.call(this,"div",{className:"vjs-caption-settings vjs-modal-overlay",innerHTML:'<div class="vjs-tracksettings"><div class="vjs-tracksettings-colors"><div class="vjs-fg-color vjs-tracksetting"><label class="vjs-label">Foreground</label><select><option value="">---</option><option value="#FFF">White</option><option value="#000">Black</option><option value="#F00">Red</option><option value="#0F0">Green</option><option value="#00F">Blue</option><option value="#FF0">Yellow</option><option value="#F0F">Magenta</option><option value="#0FF">Cyan</option></select><span class="vjs-text-opacity vjs-opacity"><select><option value="">---</option><option value="1">Opaque</option><option value="0.5">Semi-Opaque</option></select></span></div><div class="vjs-bg-color vjs-tracksetting"><label class="vjs-label">Background</label><select><option value="">---</option><option value="#FFF">White</option><option value="#000">Black</option><option value="#F00">Red</option><option value="#0F0">Green</option><option value="#00F">Blue</option><option value="#FF0">Yellow</option><option value="#F0F">Magenta</option><option value="#0FF">Cyan</option></select><span class="vjs-bg-opacity vjs-opacity"><select><option value="">---</option><option value="1">Opaque</option><option value="0.5">Semi-Transparent</option><option value="0">Transparent</option></select></span></div><div class="window-color vjs-tracksetting"><label class="vjs-label">Window</label><select><option value="">---</option><option value="#FFF">White</option><option value="#000">Black</option><option value="#F00">Red</option><option value="#0F0">Green</option><option value="#00F">Blue</option><option value="#FF0">Yellow</option><option value="#F0F">Magenta</option><option value="#0FF">Cyan</option></select><span class="vjs-window-opacity vjs-opacity"><select><option value="">---</option><option value="1">Opaque</option><option value="0.5">Semi-Transparent</option><option value="0">Transparent</option></select></span></div></div><div class="vjs-tracksettings-font"><div class="vjs-font-percent vjs-tracksetting"><label class="vjs-label">Font Size</label><select><option value="0.50">50%</option><option value="0.75">75%</option><option value="1.00" selected>100%</option><option value="1.25">125%</option><option value="1.50">150%</option><option value="1.75">175%</option><option value="2.00">200%</option><option value="3.00">300%</option><option value="4.00">400%</option></select></div><div class="vjs-edge-style vjs-tracksetting"><label class="vjs-label">Text Edge Style</label><select><option value="none">None</option><option value="raised">Raised</option><option value="depressed">Depressed</option><option value="uniform">Uniform</option><option value="dropshadow">Dropshadow</option></select></div><div class="vjs-font-family vjs-tracksetting"><label class="vjs-label">Font Family</label><select><option value="">Default</option><option value="monospaceSerif">Monospace Serif</option><option value="proportionalSerif">Proportional Serif</option><option value="monospaceSansSerif">Monospace Sans-Serif</option><option value="proportionalSansSerif">Proportional Sans-Serif</option><option value="casual">Casual</option><option value="script">Script</option><option value="small-caps">Small Caps</option></select></div></div></div><div class="vjs-tracksettings-controls"><button class="vjs-default-button">Defaults</button><button class="vjs-done-button">Done</button></div>'})},vjs.TextTrackSettings.prototype.getValues=function(){var t,n,i,r,o,a,s,l,d,c;for(c in r=e((t=this.el()).querySelector(".vjs-edge-style select")),o=e(t.querySelector(".vjs-font-family select")),a=e(t.querySelector(".vjs-fg-color > select")),i=e(t.querySelector(".vjs-text-opacity > select")),s=e(t.querySelector(".vjs-bg-color > select")),n=e(t.querySelector(".vjs-bg-opacity > select")),l=e(t.querySelector(".window-color > select")),d={backgroundOpacity:n,textOpacity:i,windowOpacity:e(t.querySelector(".vjs-window-opacity > select")),edgeStyle:r,fontFamily:o,color:a,backgroundColor:s,windowColor:l,fontPercent:window.parseFloat(e(t.querySelector(".vjs-font-percent > select")))})(""===d[c]||"none"===d[c]||"fontPercent"===c&&1===d[c])&&delete d[c];return d},vjs.TextTrackSettings.prototype.setValues=function(e){var n,i=this.el();t(i.querySelector(".vjs-edge-style select"),e.edgeStyle),t(i.querySelector(".vjs-font-family select"),e.fontFamily),t(i.querySelector(".vjs-fg-color > select"),e.color),t(i.querySelector(".vjs-text-opacity > select"),e.textOpacity),t(i.querySelector(".vjs-bg-color > select"),e.backgroundColor),t(i.querySelector(".vjs-bg-opacity > select"),e.backgroundOpacity),t(i.querySelector(".window-color > select"),e.windowColor),t(i.querySelector(".vjs-window-opacity > select"),e.windowOpacity),(n=e.fontPercent)&&(n=n.toFixed(2)),t(i.querySelector(".vjs-font-percent > select"),n)},vjs.TextTrackSettings.prototype.restoreSettings=function(){var e;try{e=JSON.parse(cacheManager.getGenericData("vjs-text-track-settings"))}catch(e){}e&&this.setValues(e)},vjs.TextTrackSettings.prototype.saveSettings=function(){var e;if(this.player_.options().persistTextTrackSettings){e=this.getValues();try{vjs.isEmpty(e)?cacheManager.deleteGenericData("vjs-text-track-settings"):cacheManager.setGenericData("vjs-text-track-settings",JSON.stringify(e))}catch(e){}}},vjs.TextTrackSettings.prototype.updateDisplay=function(){var e=this.player_.getChild("textTrackDisplay");e&&e.updateDisplay()}}(),vjs.JSON,void 0!==window.JSON&&"function"==typeof window.JSON.parse)vjs.JSON=window.JSON;else{vjs.JSON={};var cx=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g;vjs.JSON.parse=function(text,reviver){var j;function walk(e,t){var n,i,r=e[t];if(r&&"object"==typeof r)for(n in r)Object.prototype.hasOwnProperty.call(r,n)&&(void 0!==(i=walk(r,n))?r[n]=i:delete r[n]);return reviver.call(e,t,r)}if(text=String(text),cx.lastIndex=0,cx.test(text)&&(text=text.replace(cx,(function(e){return"\\u"+("0000"+e.charCodeAt(0).toString(16)).slice(-4)}))),/^[\],:{}\s]*$/.test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,"")))return j=eval("("+text+")"),"function"==typeof reviver?walk({"":j},""):j;throw new SyntaxError("JSON.parse(): invalid or malformed JSON data")}}vjs.autoSetup=function(){var e,t,n,i=document.getElementsByTagName("video"),r=document.getElementsByTagName("audio"),o=[];if(i&&i.length>0)for(t=0,n=i.length;t<n;t++)o.push(i[t]);if(r&&r.length>0)for(t=0,n=r.length;t<n;t++)o.push(r[t]);if(o&&o.length>0)for(t=0,n=o.length;t<n;t++){if(!(e=o[t])||!e.getAttribute){vjs.autoSetupTimeout(1);break}void 0===e.player&&null!==e.getAttribute("data-setup")&&videojs(e)}else vjs.windowLoaded||vjs.autoSetupTimeout(1)},vjs.autoSetupTimeout=function(e){setTimeout(vjs.autoSetup,e)},"complete"===document.readyState?vjs.windowLoaded=!0:vjs.one(window,"load",(function(){vjs.windowLoaded=!0})),vjs.autoSetupTimeout(1),vjs.plugin=function(e,t){vjs.Player.prototype[e]=t}}).call(exports,__webpack_require__(4)(module))},function(e,t){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children=[],e.webpackPolyfill=1),e}},function(e,t){e.exports=function(){throw new Error("define cannot be used indirect")}},function(e,t,n){var i=n(7),r=24e5,o={},a=2;function s(e,t,n){switch(a){case 0:case 1:break;default:case 2:!function(e,t){o&&(o[e]=t)}(e,t)}}function l(e){switch(a){case 0:case 1:return null;default:case 2:return function(e){if(o)return o[e]}(e)}}function d(e){switch(a){case 0:case 1:break;default:case 2:!function(e){o&&delete o[e]}(e)}}function c(e){return"apn_"+e}i.debug("Using Cache Method "+a,"Cache Manager"),e.exports={setGenericData:function(e,t){if(void 0!==e&&void 0!==t){e="___appnexus_video_cachemanager_generic_data___"+e;try{return s(e,t),!0}catch(e){}}return!1},getGenericData:function(e){if(void 0!==e)return l(e="___appnexus_video_cachemanager_generic_data___"+e)},deleteGenericData:function(e){void 0!==e&&d(e="___appnexus_video_cachemanager_generic_data___"+e)},forceStorageMethod:function(e){a=e,i.debug("Forced usage of cache method "+a,"Cache Manager")},addAd:function(e,t){e&&function(e,t){var n={};n.timestamp=(new Date).getTime(),n.ad=e;try{s(t,JSON.stringify(n))}catch(e){}}(e,c(t))},getAd:function(e){return function(e){var t,n=(new Date).getTime();try{var i=l(e);t=i&&JSON.parse(i),d(e)}catch(e){}return t&&t.timestamp&&t.timestamp>0&&n-t.timestamp<=r?t.ad:null}(c(e))},clearAd:function(e){!function(e){try{d(e)}catch(e){}}(c(e))},setTimeToLive:function(e){r=6e4*e},getNextAdToken:function(){return e=(t=l("___appnexus_video_cachemanager_ad_token___"))?parseInt(t):0,s("___appnexus_video_cachemanager_ad_token___",e+=1),e;var e,t}}},function(e,t,n){var i=n(8);function r(e){if(e)return e.responseXML?e.responseXML:e.responseText}e.exports={debug:function(){i.handleLogDebugLegacySupport.apply(this,arguments)},logDebug:function(){i.handleLogDebugLegacySupport.apply(this,arguments)},setDebugLevel:function(e){i.setDebugLevel(e)},isNotEmpty:function(e){var t=!1;return null!==e&&e&&(t=e.length>0),t},objectToString:function(e,t){var n="null";if(t=void 0!==t?t:0,null!==e){n="OBJ[";var i="";for(var r in e){var o=e[r];if("object"==typeof o)if(++t<9)try{o=this.objectToString(o)}catch(e){o="err:"+e}else o="err: max recursion hit";i.length>0&&(i+=","),i+=r+"="+o}n+=i,n+="]"}return n},getRandomString:function(){return Math.random().toString(36).substring(2)},traceVastFromXhr:function(e,t){try{if(e)if(Array.isArray(e)){if(e.length>0){var n=[];for(var o in e)n.push(e[o].responseURL);var a=e[e.length-1];if(a){var s=r(a),l=a.responseURL;i.info(t,"Tag load chain:",n,"\n","Final Tag URL: ",l,"\n","Final Tag: ",s)}}}else{var d=r(e);i.info(t,"Tag URL:",e.responseURL,"\n","Tag:",d)}}catch(e){}}}},function(e,t){var n=0,i=0,r=0,o=!1;function a(e,t){try{if(void 0!==e&&d(e)&&console){var n=o?"[XandrVideo":"[APN",i=function(e){switch(e){case 0:break;case 1:return"always";case 2:return"error";case 3:return"warn";case 4:return"info";case 5:return"log";case 6:return"debug";case 7:return"verbose"}}(e);if(console[i]||(n+="-"+i,i="log"),n+="]",n+="["+function(){var e="";try{var t=new Date;e=t.getHours()+":"+t.getMinutes()+":"+t.getSeconds()+"."+t.getMilliseconds()}catch(e){}return e}()+"]",t.splice(0,0,n),console[i].apply)console[i].apply(console,t);else{var r=Array.prototype.slice.apply(t).join("");console[i](r)}}}catch(e){}}function s(e){try{var t="";try{t=window.top.location.search}catch(e){try{t=window.location.search}catch(e){}}var n=new RegExp("[\\?&]"+e+"=([^&#]*)").exec(t);return null===n?"":decodeURIComponent(n[1].replace(/\+/g," "))}catch(e){return""}}function l(e){var t=0;try{if(void 0!==e){var n=parseInt(e);isNaN(n)?"boolean"==typeof e?t=e?6:0:"TRUE"===(e=e.toUpperCase())?t=6:"FALSE"===e&&(t=0):t=n}}catch(e){}return t}function d(e){return e<=n}e.exports={traceAtLevel:function(){try{if(arguments.length>0){var e=arguments[0],t=Array.prototype.slice.call(arguments,1);a.call(this,e,t)}}catch(e){}},always:function(){try{a.call(this,1,Array.prototype.slice.call(arguments))}catch(e){}},error:function(){try{a.call(this,2,Array.prototype.slice.call(arguments))}catch(e){}},log:function(){try{a.call(this,5,Array.prototype.slice.call(arguments))}catch(e){}},warn:function(){try{a.call(this,3,Array.prototype.slice.call(arguments))}catch(e){}},info:function(){try{a.call(this,4,Array.prototype.slice.call(arguments))}catch(e){}},debug:function(){try{a.call(this,6,Array.prototype.slice.call(arguments))}catch(e){}},verbose:function(){try{a.call(this,6,Array.prototype.slice.call(arguments))}catch(e){}},handleLogDebugLegacySupport:function(e,t){try{!function(e,t,n){try{var i="[APN-"+e+"-"+(new Date).toISOString()+"] ";null!==n&&n&&n.length>0&&(i+=n+">"),i+=t,d(e)&&console.log(i)}catch(t){d(e)&&console.log(t)}}(5,e,t)}catch(e){}},setDebugLevel:function(e){try{!function(e){try{r=l(e),n=Math.max(Math.max(i,r),n)}catch(e){}}(e)}catch(e){}},isTraceLevelActive:function(e){try{return d(e)}catch(e){return!1}},TRACE_LEVEL_ALWAYS:1,TRACE_LEVEL_ERROR:2,TRACE_LEVEL_WARN:3,TRACE_LEVEL_INFO:4,TRACE_LEVEL_LOG:5,TRACE_LEVEL_DEBUG:6,TRACE_LEVEL_VERBOSE:6},function(){try{var e=s("xdr_debug").toUpperCase();e&&e.length>0?(i=l(e),o=!0):i=l(s("ast_debug").toUpperCase()),n=Math.max(i,n)}catch(e){}}()},function(e,t,n){var i=n(10),r=n(55),o=n(63),a=n(64),s=n(11),l=n(12),d=function(e){l.verbose(e,"PlayerManager_BuildPlayer")};e.exports=function(e,t,n){d("buildPlayer");var l=t,c=n.isIosInlineRequired.bind(n),u=function(){return/iPad|iPhone|iPod/.test(navigator.appVersion)},p=function(e){return!!e.isFullscreen||!!(document.fullscreenElement||document.webkitFullscreenElement||document.mozFullScreenElement||document.msFullscreenElement)&&(!window.screenTop&&!window.screenY)};"off"===(l=function(e){switch(e.nativeControlsForTouch=!1,e.controls=!0,e.preload="auto",e.extensions||(e.extensions=""),a.setSizeForInitialRender(e),u()&&e.sideStream&&!1===e.sideStream.enabled&&(e.nonViewableBehavior="pause"),e.initialPlayback){case"auto":case"click":case"mouseover":e.autoplay=!1}e.hasOwnProperty("disableTopBar")||(e.disableTopBar=!1),(s.isAndroid()||c())&&(e.controlBarPosition="below");var t=e.endCard;if(t&&t.enabled&&!t.buttons&&(t.buttons=[],t.showDefaultButtons=!0,t.buttons.indexOf("replay")<0&&e.disableCollapse&&e.disableCollapse.replay&&t.buttons.push({type:"replay"}),t.buttons.indexOf("learnMore")<0&&e.learnMore&&e.learnMore.enabled)){var n={type:"learnMore"};e.learnMore.text&&(n.text=e.learnMore.text),t.buttons.push(n)}return e}(l)).initialAudio&&(n.isMuted=!0),l.useMsSkin&&(l.controlBarPosition="fixed"),n.options=l;var h=function(e,t){if(!0===l.playOnMouseover){e.addEventListener("mouseenter",(function(){!0===n.isDoneInitialPlay&&!n.explicitPaused&&n.isViewable&&!1===n.isPlayingVideo&&n.play()})),e.addEventListener("mouseleave",(function(){n.pause()}))}if(!1!==l.audioOnMouseover){var i,r=0;"number"==typeof l.audioOnMouseover&&(r=l.audioOnMouseover);var o=function(){!n.isFullscreen&&n.isDoneInitialPlay&&(clearTimeout(i),n.mute(),e.removeEventListener("mouseleave",o))};c()||(setInterval((function(){n&&n.isFullscreen&&o&&e&&e.removeEventListener("mouseleave",o)}),500),e.addEventListener("mouseenter",(function(){n.isFullscreen||!n.isDoneInitialPlay||n.mutedByViewability||(i=setTimeout((function(){n.unmute(),d("unmute by mouseover")}),r)),e.addEventListener("mouseleave",o,!1)}),!1))}var a,s;if(!l.autoInitialSize||(a=navigator.appVersion.indexOf("Mobile"),s=navigator.appVersion.indexOf("Android"),a>-1||s>-1)||window.addEventListener("resize",(function(){!0!==p(n)&&(!(!n.options.sideStreamObject||"function"!=typeof n.options.sideStreamObject.shouldNotResizeWhenSideStreamActivated)&&n.options.sideStreamObject.shouldNotResizeWhenSideStreamActivated()||l.targetElement&&l.targetElement.style&&l.targetElement.style.height&&0===Number(l.targetElement.style.height.replace("px",""))||setTimeout((function(){if(!0!==p(n)&&(l.disableCollapse.enabled||!n.isSkipped&&!n.isCompleted)){l.width=l.targetElement.offsetWidth||l.width;var e=/android/i.test(navigator.userAgent.toLowerCase());e?l.targetElement.style.webkitTransition="height 0s ease":l.targetElement.style.transition="height 0s ease",n.resizeVideo(-1),l.targetElement.style.height=l.height+"px";var t=document.getElementById(n.videoObjectId);t&&void 0!==typeof t&&(t.style.width=l.width,t.style.height=l.height),setTimeout((function(){var t,n=(t=l.expandTime)<0?0:t/1e3;n=n<=0?.001:n,e?l.targetElement.style.webkitTransition="height "+n+"s ease":l.targetElement.style.transition="height "+n+"s ease"}),500)}}),0))})),e.style.cursor="pointer",t&&void 0!==t){if(u()){var h=!1;t.ontouchmove=function(){h=!0},t.ontouchend=function(e){h?h=!1:f(e)}}else t.onclick=function(e){f(e)};var f=function(){if("html5"===n.decidePlayer(l.requiredPlayer)&&!l.vpaid){if(l.useMsSkin)return void n.click();!0===l.learnMore.enabled?!0===l.learnMore.clickToPause&&(n.isPlayingVideo?n.explicitPause():n.explicitPlay()):n.click()}}}var v=n.options&&n.options.playerSkin&&n.options.playerSkin.customPlayerSkin;u()&&n.overlayPlayer&&n.options&&!1===n.options.enableInlineVideoForIos&&v&&(n.adVideoPlayer.controlBar.fullscreenToggle.dispose(),n.adVideoPlayer.one("playing",(function(){n.adVideoPlayer.controlBar.el().style.display="none",setTimeout((function(){n.adVideoPlayer.controlBar.el().style.display="block"}),7e3)})))};switch(n.decidePlayer(l.requiredPlayer)){case"html5":c()?new r(n,h).start():new i(n,h).start()}o.sharedInstance().run(t)}},function(e,t,n){var i=n(11),r=n(12);e.exports=function(e,t){var o=this;this.options=e.options,this.an_video_ad_player_id="",this.an_video_ad_player_html5_api_id="",this.targetElement="",this.videojsOrigin=e.videoPlayerObj,this.dispatchEventToAdunit=e.dispatchEventToAdunit.bind(e),this.callbackForAdUnit=e.callbackForAdUnit,this.topChromeHeight=24,this.pendingFullscreenExit=!1,this.bigbuttonUnmuteTimeout=250,this.CONST_MESSAGE_GENERAL_ERROR="General error reported from HTML5 video player",this.adIndicatorTextContent=this.options.adText,this.readyForSkip=!1,this.floatingSkipButton=null,this.floatingAdSkipText=null,this.isIos=i.isIos,this.isAndroid=i.isAndroid,this.isMobile=i.isMobile,this.refreshVideoLookAndFeel=i.refreshVideoLookAndFeel,this.initializeIframeAndVideo=n(13)(o,e).init,this.UIController=n(19)(o,e,t).init,this.displayVolumeControls=n(54)(o).displayVolumeControls,this.start=function(){var t;t="WE ARE USING HTML5 PLAYER",r.info("Video Player: "+t);var n=(new Date).getTime()+Math.floor(1e4*Math.random());o.options.techOrder=["html5"],o.options.iframeVideoWrapperId="iframeVideoWrapper_"+n;var i="an_video_ad_player_"+n,a="an_video_ad_player_"+n+"_html5_api";o.an_video_ad_player_id=i,o.an_video_ad_player_html5_api_id=a,e.divIdForVideo=i,e.videoId=a,o.targetElement=o.options.targetElement,o.initializeIframeAndVideo(o.UIController)}}},function(e,t,n){var i=n(12),r=function(e){i.verbose(e,"PlayerManager_Utils")},o=function(){return/iphone/i.test(navigator.userAgent.toLowerCase())},a=function(){return o()||/ipad/i.test(navigator.userAgent.toLowerCase())},s=function(){return navigator.appVersion.indexOf("Mobile")>-1||navigator.appVersion.indexOf("Android")>-1},l=function(e){var t=!1;try{t=!isNaN(parseFloat(e))&&isFinite(e)}catch(e){r(e)}return t};e.exports={isPortrait:function(){return window.innerHeight>window.innerWidth},isIphone:o,isIos:a,isIpad:function(){return navigator.userAgent.toLowerCase().match(/mac/)&&navigator.maxTouchPoints&&navigator.maxTouchPoints>2},isAndroid:function(){return/android/i.test(navigator.userAgent.toLowerCase())},isMobile:s,getIOSVersion:function(){var e=navigator.userAgent.match(/OS (\d+)_/i);if(e&&e[1])return e[1]},refreshVideoLookAndFeel:function(e,t){!t.isSkipped&&t.isExpanded&&(e.autoInitialSize&&!e.shouldResizeVideoToFillMobileWebview&&(e.width=e.targetElement.offsetWidth),t.resizeVideo(-1,s()),e.targetElement.style.height=e.height+"px")},fireEvent:function(e,t){var n=document.createEvent("HTMLEvents");n.initEvent(t,!0,!0),n.eventName=t,e.dispatchEvent(n)},DelayEventHandler:function(){this.queue=[],this.id="",this.isSuppress=!1,this.isPaused=!1,this.isCompleted=!1;var e=!1;this.push=function(t){!1!==this.isSuppress||"function"!=typeof t?e?e=!1:!1===this.isPaused&&this.queue.push(t):t()},this.start=function(){r("delay event starts");var e=this,t=function(){if(!1===e.isSuppress){var n=e.queue.shift();n&&"function"==typeof n&&n()}setTimeout((function(){!1===e.isCompleted&&t()}),100)};t()},this.ImmediateStop=function(){this.isCompleted=!0},this.lazyTerminate=function(){var e=this;this.queue.push((function(){e.ImmediateStop()}))},this.suppress=function(e){this.isSuppress=e},this.clearQueue=function(){this.queue=[]},this.ignoreNextQueue=function(){e=!0}},isEmpty:function(e){return void 0===e||""===e||!1===e||null===e},unique:function(){var e={};return{pushAndCheck:function(t,n){var i=t+"_"+n;return!e[i]&&(e[i]=!0,!0)}}},getMsecTime:function(e,t){try{var n=e.indexOf("%");if(n>0){if(t&&t>0){var i=Number(e.substring(0,n));return i>=0&&i<=100?Math.round(t*(i/100)):-1}return-1}var o=(n=e.indexOf("."))>0?Number(e.substring(n+1).substr(0,3)):0;n>0&&(e=e.substring(0,n));var a=e.split(":");if(3===a.length){for(var s=0;s<a.length;s++){var d=a[s];if(d&&!1===l(d)||parseInt(d)<0)return-1}var c=1e3*(3600*Number(a[0])+60*Number(a[1])+Number(a[2]))+o;return t?c<=t?c:-1:c}return-1}catch(e){return r(e),-1}},isNumeric:l,makeIframeFlexbileSize:function(e){a()&&e.options.enableInlineVideoForIos&&setTimeout((function(){var t=e.iframeVideoWrapper?e.iframeVideoWrapper:document.getElementById(e.options.iframeVideoWrapperId);t.style.width="",t.style.height=""}),0)},isEmptyAndObject:function(e){if(null==e)return!0;if(0===e.length)return!0;if(""===e)return!0;if("object"!=typeof e)return!1;if(e.length>0)return!1;for(var t in e)if(e.hasOwnProperty(t))return!1;return!0},elementsOverlap:function(e,t){if(!(e&&t&&e.getBoundingClientRect&&t.getBoundingClientRect))return n="Utils.elementsOverlap expects two html elements",i.info(n,"PlayerManager_Utils"),!1;var n,r=e.getBoundingClientRect(),o=t.getBoundingClientRect();return!(r.right<o.left||r.left>o.right||r.bottom<o.top||r.top>o.bottom)},convertTimeSecondsToString:function(e){var t=1e3*e,n=parseInt(t%1e3),i=parseInt(t/1e3%60),r=parseInt(t/6e4%60),o=parseInt(t/36e5%24);return(o=o<10?"0"+o:o)+":"+(r=r<10?"0"+r:r)+":"+(i=i<10?"0"+i:i)+"."+(n=n<10?"00"+n:n<100?"0"+n:n)}}},function(e,t){var n=0,i=0,r=0,o=!1;function a(e,t){try{if(void 0!==e&&d(e)&&console){var n=o?"[XandrVideo":"[APN",i=function(e){switch(e){case 0:break;case 1:return"always";case 2:return"error";case 3:return"warn";case 4:return"info";case 5:return"log";case 6:return"debug";case 7:return"verbose"}}(e);if(console[i]||(n+="-"+i,i="log"),n+="]",n+="["+function(){var e="";try{var t=new Date;e=t.getHours()+":"+t.getMinutes()+":"+t.getSeconds()+"."+t.getMilliseconds()}catch(e){}return e}()+"]",t.splice(0,0,n),console[i].apply)console[i].apply(console,t);else{var r=Array.prototype.slice.apply(t).join("");console[i](r)}}}catch(e){}}function s(e){try{var t="";try{t=window.top.location.search}catch(e){try{t=window.location.search}catch(e){}}var n=new RegExp("[\\?&]"+e+"=([^&#]*)").exec(t);return null===n?"":decodeURIComponent(n[1].replace(/\+/g," "))}catch(e){return""}}function l(e){var t=0;try{if(void 0!==e){var n=parseInt(e);isNaN(n)?"boolean"==typeof e?t=e?6:0:"TRUE"===(e=e.toUpperCase())?t=6:"FALSE"===e&&(t=0):t=n}}catch(e){}return t}function d(e){return e<=n}e.exports={traceAtLevel:function(){try{if(arguments.length>0){var e=arguments[0],t=Array.prototype.slice.call(arguments,1);a.call(this,e,t)}}catch(e){}},always:function(){try{a.call(this,1,Array.prototype.slice.call(arguments))}catch(e){}},error:function(){try{a.call(this,2,Array.prototype.slice.call(arguments))}catch(e){}},log:function(){try{a.call(this,5,Array.prototype.slice.call(arguments))}catch(e){}},warn:function(){try{a.call(this,3,Array.prototype.slice.call(arguments))}catch(e){}},info:function(){try{a.call(this,4,Array.prototype.slice.call(arguments))}catch(e){}},debug:function(){try{a.call(this,6,Array.prototype.slice.call(arguments))}catch(e){}},verbose:function(){try{a.call(this,6,Array.prototype.slice.call(arguments))}catch(e){}},handleLogDebugLegacySupport:function(e,t){try{!function(e,t,n){try{var i="[APN-"+e+"-"+(new Date).toISOString()+"] ";null!==n&&n&&n.length>0&&(i+=n+">"),i+=t,d(e)&&console.log(i)}catch(t){d(e)&&console.log(t)}}(5,e,t)}catch(e){}},setDebugLevel:function(e){try{!function(e){try{r=l(e),n=Math.max(Math.max(i,r),n)}catch(e){}}(e)}catch(e){}},isTraceLevelActive:function(e){try{return d(e)}catch(e){return!1}},TRACE_LEVEL_ALWAYS:1,TRACE_LEVEL_ERROR:2,TRACE_LEVEL_WARN:3,TRACE_LEVEL_INFO:4,TRACE_LEVEL_LOG:5,TRACE_LEVEL_DEBUG:6,TRACE_LEVEL_VERBOSE:6},function(){try{var e=s("xdr_debug").toUpperCase();e&&e.length>0?(i=l(e),o=!0):i=l(s("ast_debug").toUpperCase()),n=Math.max(i,n)}catch(e){}}()},function(e,t,n){var i="[PlayerManager_InitializeElements]",r=n(12),o=n(14),a=function(e){r.verbose(i,e)},s=function(e){r.debug(i,e)},l=function(e){r.log(i,e)};e.exports=function(e,t){return{init:function(n){var i;l("init");var r=!1;if(t.autoplayHandler.isRequiredFakeAndroidAutoStart(e.options.initialPlayback,e.options.initialAudio,e.options.automatedTestingOnlyAndroidSkipTouchStart,!0)){a("Setting correct iframe for androids 'fake' autostart");for(var d=e.options.targetElement.getElementsByTagName("iframe"),c=0;c<d.length;c++){var u=d[c],p=t.autoplayHandler.APN_MOBILE_IFRAME_NAME;if(e.isAndroid()&&e.options.firstAdAttempted&&e.options.adAttempt&&(p=t.autoplayHandler.APN_MOBILE_IFRAME_NAME+"_Waterfall_"+e.options.adAttempt),u&&u.name&&u.name===p){r=!0,i=u;break}}}if(!r){if(e.options.fallbackNotFirstStep){var h=e.targetElement.getElementsByTagName("iframe");if(h&&h.length>0)for(var f=0;f<h.length;f++)e.targetElement.removeChild(h[f])}a("Creating new iframe if one is not already created."),(i=document.createElement("iframe")).src="about:blank","native"===e.options.adType&&e.options.banners&&e.options.banners.preShow&&(i.style.opacity=.01),e.targetElement.appendChild(i);i.contentWindow.document.open(),i.contentWindow.document.write("<html></html>"),i.contentWindow.document.close()}if(i){i.id=e.options.iframeVideoWrapperId,i.style.width=e.options.width+"px",i.style.height=e.options.height+"px",i.style.display="",r||s("Html5Player created new iframe: "+e.options.iframeVideoWrapperId),i.setAttribute("allowfullscreen","true"),i.setAttribute("webkitallowfullscreen","true"),i.setAttribute("mozallowfullscreen","true"),e.options.playerSkin&&e.options.playerSkin.controlBarColor&&i.contentWindow&&i.contentWindow.document&&i.contentWindow.document.body&&i.contentWindow.document.body.style&&(i.contentWindow.document.body.style.background=t.options.playerSkin.controlBarColor);var v=function(){var r=i.contentWindow.document,a=i.contentWindow.window;s("Creating and styling top chrome bar");var d,c=r.createElement("div");c.id="top_chrome",c.style.height=e.options.playerSkin&&"number"==typeof e.options.playerSkin.dividerHeight?e.topChromeHeight-e.options.playerSkin.dividerHeight+"px":e.topChromeHeight-1+"px",c.style.width=e.options.width+"px",c.style.marginRight="auto",c.style.marginLeft="auto",c.className="video-js vjs-default-skin",s("Generating and styling video object");var u=!1;if(t.autoplayHandler.isRequiredFakeAndroidAutoStart(e.options.initialPlayback,e.options.initialAudio,e.options.automatedTestingOnlyAndroidSkipTouchStart,!0)){var p=i.contentWindow[t.autoplayHandler.APN_MOBILE_VIDEO_PLACEMENT_ID];p&&(u=!0,d=p)}if(u||(d=r.createElement("video")),d.id=e.an_video_ad_player_id,d.className="video-js vjs-default-skin",d.style.marginRight="auto",d.style.marginLeft="auto",c.style["z-index"]=d.style["z-index"]+1,a.ReportingObserver&&function(e,t){function n(e){for(var n=0;n<e.length;n++)if(e[n].body&&"HeavyAdIntervention"===e[n].body.id){var i="Heavy Ad Intervention by browser detected.  Browser Message: "+e[n].body.message;l(i),t.destroyWithoutSkip(!0,i,null,903)}}var i=new e.ReportingObserver(n,{buffered:!0});i.observe(),e.addEventListener("unload",(function(){n(i.takeRecords())}))}(a,t),!1===e.options.vpaid){s("Generating source object");var h=r.createElement("source");h.type=e.options.video.type,h.src=e.options.videoUrl,e.options.vpaid||d.appendChild(h)}if(e.options.useMsSkin){s("Injecting required elements into iframe");var f=r.createElement("div");f.id="skip_Button_Wrapper",f.className="skipButtonWrapper vjs-hidden",r.body.appendChild(f)}if(s("Injecting required elements into iframe"),e.options.disableTopBar||(r.body.appendChild(c),"native"===e.options.adType&&(c.style.display="none")),r.body.appendChild(d),a.videojs=e.videojsOrigin,e.options.vpaid){var v=r.createElement("script");v.innerHTML=t.videojs_vpaid,r.head.appendChild(v)}e.options.verifications&&(t.verificationManager=new o(e.options.verifications,{parentDoc:r,videoElement:e.options.targetElement.parentElement,viewableImpression:e.options.viewableImpression,adServingId:e.options.adServingId,player:t}),t.verificationManager.init(),t.verificationManager.start()),r.body.style.margin="0px",r.body.style.overflow="hidden",n(i)},m=!1;navigator.userAgent.toLowerCase().indexOf("firefox")>-1&&!1===t.overlayPlayer?(i.onload=function(){v(),m=!0},setTimeout((function(){!1===m&&(a("destroying due to an error in firefox"),t.destroyWithoutSkip(!0,e.CONST_MESSAGE_GENERAL_ERROR,null,900))}),e.options.vpaidTimeout)):v()}else s("iframeVideoWrapper Doesn't exist.")}}}},function(e,t,n){n(15);var i=n(17),r=n(18),o=r.OmidSessionClient.AdSession,a=r.OmidSessionClient.Partner,s=r.OmidSessionClient.Context,l=r.OmidSessionClient.VerificationScriptResource,d=r.OmidSessionClient.AdEvents,c=r.OmidSessionClient.MediaEvents,u=r.OmidSessionClient.VastProperties,p="[PlayerManager_Verifications]",h=n(12);e.exports=function(e,t){var n,r,f,v=e,m=t,g=[],y=new i(e,t.player),b=function(e){h.debug(p,"OMID sessionObserver");try{if("sessionStart"===e.type){h.debug(p,"OMID sessionStart");const t="video",i="beginToRender";if("definedByJavaScript"===e.data.creativeType&&n.setCreativeType(t),"definedByJavaScript"===e.data.impressionType&&n.setImpressionType(i),""!==OMIDVideoEvents().position){const e=OMIDVideoEvents().isSkippable,t=0,n=OMIDVideoEvents().isAutoPlay,i=OMIDVideoEvents().position,o=new u(e,t,n,i);r.loaded(o)}r.impressionOccurred()}else"sessionError"===event.type?h.debug(p,"OMID sessionError"):"sessionFinish"===event.type&&h.debug(p,"OMID sessionFinish")}catch(e){h.debug(p,"Failed OMID sessionStart "+e)}};return{init:function(){h.debug(p,"init verifications");for(var e=0;e<v.length;e++){var t=v[e];if(t.jsResources)for(var i=0;i<t.jsResources.length;i++)try{if("OMID"===t.jsResources[i].framework.toUpperCase()){var u=t.vendor,A=t.verificationParameters,w=t.jsResources[i].url,T=new l(w,u,A);g.push(T),h.debug(p,"verification is OMID")}else y.trackEvent(t.vendor,"verificationNotExecuted",{REASON:2}),h.debug(p,"verification is not OMID")}catch(e){h.debug(p,"Failed OMID verification "+e),y.trackEvent(t.vendor,"verificationNotExecuted",{REASON:3})}}if(g.length>0)try{if(""!==getOMIDPartner().name&&""!==getOMIDPartner().version){var k=new a(getOMIDPartner().name,getOMIDPartner().version),E=new s(k,g);h.debug(p,"BuildTest::"+m.videoElement),n=new o(E),r=new d(n),f=new c(n),n.registerSessionObserver(b),E.setVideoElement(m.videoElement),h.debug(p,"OMID _adSession"),h.debug(p,n),h.debug(p,f)}}catch(e){h.debug(p,"Failed OMID registerSessionObserver "+e)}},start:function(){h.debug(p,"start verifications")},dispatchEvent:function(e,t){h.debug(p,"try to dispatch OMID event: "+e+", data: ",t);try{"start"===e?f.start(t.duration,t.videoPlayerVolume):"firstQuartile"===e?f.firstQuartile():"thirdQuartile"===e?f.thirdQuartile():"midpoint"===e?f.midpoint():"complete"===e?f.complete():"volumeChange"===e?f.volumeChange(t.videoPlayerVolume):"adUserInteraction"===e?f.adUserInteraction(t.interactionType):"resume"===e?f.resume():"pause"===e?f.pause():"playerStateChange"===e?f.playerStateChange(t.state):"skipped"===e&&f.skipped()}catch(e){h.debug(p,"Failed OMID Video Events "+e)}},destroy:function(){h.debug(p,"destroy verifications")}}}},function(e,t,n){var i=n(16),r="[PlayerManager_Verification_OMID]",o=n(12);e.exports=function(){var e,t=!1,n=null,a=[];return{start:function(r,o,a,s){(e=new r(o)).setCreativeType("video"),e.setImpressionType("beginToRender"),e.isSupported()&&(e.start(),t=!0,n=new i(e,a,s))},dispatchEvent:function(e,t,i){n?(a.length>0&&(a.forEach((function(t){var a;a="dispatch from cache OMID event "+e,o.debug(r,a),n.fireEvent(t.eventName,t.data,i)})),a=[]),o.debug(r,"dispatch OMID event "+e),n.fireEvent(e,t,i)):(o.debug(r,"save in cache OMID event "+e),a.push({event:e,data:t}))},destroy:function(){o.debug(r,"terminate OMID session"),t&&e.finish()}}}},function(e,t,n){var i=n(12);e.exports=function(e,t,n){var r=e,o=new t(e),a=new n(e),s=["loaded","impression"],l=["start","firstQuartile","midpoint","thirdQuartile","complete","pause","resume","bufferStart","bufferFinish","skipped","volumeChange","playerStateChange","adUserInteraction"];function d(e,t,n,i){switch(t){case"loaded":var r=new i(n.skippable,n.skipOffset,n.autoPlay,n.position);e.loaded(r);break;case"impression":e.impressionOccurred();break;case"start":e.start(n.duration,n.videoPlayerVolume);break;case"firstQuartile":e.firstQuartile();break;case"midpoint":e.midpoint();break;case"thirdQuartile":e.thirdQuartile();break;case"complete":e.complete();break;case"pause":e.pause();break;case"resume":e.resume();break;case"bufferStart":e.bufferStart();break;case"bufferFinish":e.bufferFinish();break;case"skipped":e.skipped();break;case"volumeChange":e.volumeChange(n.videoPlayerVolume);break;case"playerStateChange":e.playerStateChange(n.state);break;case"adUserInteraction":e.adUserInteraction(n.interactionType)}}return{fireEvent:function(e,t,n){s.includes(e)?r.registerSessionObserver(a=>{"sessionStart"===a.type?d(o,e,t,n):"sessionError"===a.type?i.debug("[PlayerManager_Verification_OMID]","OMID session error: "+JSON.stringify(a.data)):"sessionFinish"===a.type&&r.finish()}):l.includes(e)&&d(a,e,t)}}}},function(e,t,n){var i=n(12);e.exports=function(e,t){for(var n={},r=0;r<e.length;r++){var o=e[r].vendor;o&&(n[o]=e[r].trackingEvents)}function a(e,n){var i=e;if(n)for(var r in n)i=i.split("["+r.toUpperCase()+"]").join(encodeURIComponent(n[r]));return i=function(e){for(var n in l)if(e.indexOf("["+n+"]")>=0){var i=l[n];null===i&&(i=t?t.resolveMacro(n):-1),e=e.split("["+n+"]").join(encodeURIComponent(i))}return e}(i)}var s,l={TIMESTAMP:(new Date).toISOString(),MEDIAPLAYHEAD:null,BREAKPOSITION:null,ADCOUNT:null,TRANSACTIONID:(s=(new Date).getTime(),"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(e){var t=(s+16*Math.random())%16|0;return s=Math.floor(s/16),("x"===e?t:3&t|8).toString(16)}))),PLACEMENTTYPE:null,IFA:-1,IFATYPE:-1,CLIENTUA:null,DEVICEIP:null,LATLONG:-1,PAGEURL:function(){try{return top&&top.location&&top.location.href?top.location.href:-1}catch(e){return-1}}(),APPNAME:-1,APIFRAMEWORKS:"2,7",EXTENSIONS:-1,PLAYERCAPABILITIES:null,CLICKTYPE:null,PLAYERSTATE:null,PLAYERSIZE:null,ADPLAYHEAD:null,ASSETURI:null,PODSEQUENCE:null,CLICKPOS:-1,LIMITADTRACKING:null};return{trackEvent:function(e,t,r){(i.debug("[PlayerManager_Verification_Tracking]","track verification event: "+t),n&&n[e]&&n[e].hasOwnProperty(t))&&n[e][t].forEach((function(e){var t=a(e,r);(new Image).src=t}))}}}},function(e,t,n){(function(e){!function(e,t,n){if("object"==typeof n&&"string"!=typeof n.nodeName)t(e,n);else{n={};var i=["1.5.2-iab4528"];function r(e){for(var t in e)e.hasOwnProperty(t)&&(e[t]=r(e[t]));return Object.freeze(e)}for(var o in i.push("default"),t(e,n),n)n.hasOwnProperty(o)&&(null==Object.getOwnPropertyDescriptor(e,o)&&Object.defineProperty(e,o,{value:{}}),i.forEach((function(t){if(null==Object.getOwnPropertyDescriptor(e[o],t)){var i=r(n[o]);Object.defineProperty(e[o],t,{get:function(){return i},enumerable:!0})}})))}}(void 0===e?this:e,(function(t,n){var i=i||{};i.scope={},i.createTemplateTagFirstArg=function(e){return e.raw=e},i.createTemplateTagFirstArgWithRaw=function(e,t){return e.raw=t,e},i.arrayIteratorImpl=function(e){var t=0;return function(){return t<e.length?{done:!1,value:e[t++]}:{done:!0}}},i.arrayIterator=function(e){return{next:i.arrayIteratorImpl(e)}},i.makeIterator=function(e){var t="undefined"!=typeof Symbol&&Symbol.iterator&&e[Symbol.iterator];if(t)return t.call(e);if("number"==typeof e.length)return i.arrayIterator(e);throw Error(String(e)+" is not an iterable or ArrayLike")},i.arrayFromIterator=function(e){for(var t,n=[];!(t=e.next()).done;)n.push(t.value);return n},i.arrayFromIterable=function(e){return e instanceof Array?e:i.arrayFromIterator(i.makeIterator(e))},i.ASSUME_ES5=!1,i.ASSUME_NO_NATIVE_MAP=!1,i.ASSUME_NO_NATIVE_SET=!1,i.SIMPLE_FROUND_POLYFILL=!1,i.ISOLATE_POLYFILLS=!1,i.FORCE_POLYFILL_PROMISE=!1,i.FORCE_POLYFILL_PROMISE_WHEN_NO_UNHANDLED_REJECTION=!1,i.objectCreate=i.ASSUME_ES5||"function"==typeof Object.create?Object.create:function(e){var t=function(){};return t.prototype=e,new t},i.defineProperty=i.ASSUME_ES5||"function"==typeof Object.defineProperties?Object.defineProperty:function(e,t,n){return e==Array.prototype||e==Object.prototype||(e[t]=n.value),e},i.getGlobal=function(t){t=["object"==typeof globalThis&&globalThis,t,"object"==typeof window&&window,"object"==typeof self&&self,"object"==typeof e&&e];for(var n=0;n<t.length;++n){var i=t[n];if(i&&i.Math==Math)return i}throw Error("Cannot find global object")},i.global=i.getGlobal(this),i.IS_SYMBOL_NATIVE="function"==typeof Symbol&&"symbol"==typeof Symbol("x"),i.TRUST_ES6_POLYFILLS=!i.ISOLATE_POLYFILLS||i.IS_SYMBOL_NATIVE,i.polyfills={},i.propertyToPolyfillSymbol={},i.POLYFILL_PREFIX="$jscp$";i.polyfill=function(e,t,n,r){t&&(i.ISOLATE_POLYFILLS?i.polyfillIsolated(e,t,n,r):i.polyfillUnisolated(e,t,n,r))},i.polyfillUnisolated=function(e,t,n,r){for(n=i.global,e=e.split("."),r=0;r<e.length-1;r++){var o=e[r];if(!(o in n))return;n=n[o]}(t=t(r=n[e=e[e.length-1]]))!=r&&null!=t&&i.defineProperty(n,e,{configurable:!0,writable:!0,value:t})},i.polyfillIsolated=function(e,t,n,r){var o=e.split(".");e=1===o.length,r=o[0],r=!e&&r in i.polyfills?i.polyfills:i.global;for(var a=0;a<o.length-1;a++){var s=o[a];if(!(s in r))return;r=r[s]}o=o[o.length-1],null!=(t=t(n=i.IS_SYMBOL_NATIVE&&"es6"===n?r[o]:null))&&(e?i.defineProperty(i.polyfills,o,{configurable:!0,writable:!0,value:t}):t!==n&&(void 0===i.propertyToPolyfillSymbol[o]&&(n=1e9*Math.random()>>>0,i.propertyToPolyfillSymbol[o]=i.IS_SYMBOL_NATIVE?i.global.Symbol(o):i.POLYFILL_PREFIX+n+"$"+o),i.defineProperty(r,i.propertyToPolyfillSymbol[o],{configurable:!0,writable:!0,value:t})))},i.getConstructImplementation=function(){if(i.TRUST_ES6_POLYFILLS&&"undefined"!=typeof Reflect&&Reflect.construct){if(function(){function e(){}return new e,Reflect.construct(e,[],(function(){})),new e instanceof e}())return Reflect.construct;var e=Reflect.construct;return function(t,n,i){return t=e(t,n),i&&Reflect.setPrototypeOf(t,i.prototype),t}}return function(e,t,n){return void 0===n&&(n=e),n=i.objectCreate(n.prototype||Object.prototype),Function.prototype.apply.call(e,n,t)||n}},i.construct=i.getConstructImplementation(),i.underscoreProtoCanBeSet=function(){var e={};try{return e.__proto__={a:!0},e.a}catch(e){}return!1},i.setPrototypeOf=i.TRUST_ES6_POLYFILLS&&"function"==typeof Object.setPrototypeOf?Object.setPrototypeOf:i.underscoreProtoCanBeSet()?function(e,t){if(e.__proto__=t,e.__proto__!==t)throw new TypeError(e+" is not extensible");return e}:null,i.inherits=function(e,t){if(e.prototype=i.objectCreate(t.prototype),e.prototype.constructor=e,i.setPrototypeOf){var n=i.setPrototypeOf;n(e,t)}else for(n in t)if("prototype"!=n)if(Object.defineProperties){var r=Object.getOwnPropertyDescriptor(t,n);r&&Object.defineProperty(e,n,r)}else e[n]=t[n];e.superClass_=t.prototype},i.getRestArguments=function(){for(var e=Number(this),t=[],n=e;n<arguments.length;n++)t[n-e]=arguments[n];return t},i.polyfill("Reflect",(function(e){return e||{}}),"es6","es3"),i.polyfill("Reflect.construct",(function(e){return i.construct}),"es6","es3"),i.polyfill("Reflect.setPrototypeOf",(function(e){if(e)return e;if(i.setPrototypeOf){var t=i.setPrototypeOf;return function(e,n){try{return t(e,n),!0}catch(e){return!1}}}return null}),"es6","es5"),i.initSymbol=function(){},i.polyfill("Symbol",(function(e){if(e)return e;var t=function(e,t){this.$jscomp$symbol$id_=e,i.defineProperty(this,"description",{configurable:!0,writable:!0,value:t})};t.prototype.toString=function(){return this.$jscomp$symbol$id_};var n="jscomp_symbol_"+(1e9*Math.random()>>>0)+"_",r=0,o=function(e){if(this instanceof o)throw new TypeError("Symbol is not a constructor");return new t(n+(e||"")+"_"+r++,e)};return o}),"es6","es3"),i.polyfill("Symbol.iterator",(function(e){if(e)return e;e=Symbol("Symbol.iterator");for(var t="Array Int8Array Uint8Array Uint8ClampedArray Int16Array Uint16Array Int32Array Uint32Array Float32Array Float64Array".split(" "),n=0;n<t.length;n++){var r=i.global[t[n]];"function"==typeof r&&"function"!=typeof r.prototype[e]&&i.defineProperty(r.prototype,e,{configurable:!0,writable:!0,value:function(){return i.iteratorPrototype(i.arrayIteratorImpl(this))}})}return e}),"es6","es3"),i.iteratorPrototype=function(e){return(e={next:e})[Symbol.iterator]=function(){return this},e},i.iteratorFromArray=function(e,t){e instanceof String&&(e+="");var n=0,i=!1,r={next:function(){if(!i&&n<e.length){var r=n++;return{value:t(r,e[r]),done:!1}}return i=!0,{done:!0,value:void 0}}};return r[Symbol.iterator]=function(){return r},r},i.polyfill("Array.prototype.keys",(function(e){return e||function(){return i.iteratorFromArray(this,(function(e){return e}))}}),"es6","es3"),i.owns=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.polyfill("Object.values",(function(e){return e||function(e){var t,n=[];for(t in e)i.owns(e,t)&&n.push(e[t]);return n}}),"es8","es3"),i.checkEs6ConformanceViaProxy=function(){try{var e={},t=Object.create(new i.global.Proxy(e,{get:function(n,i,r){return n==e&&"q"==i&&r==t}}));return!0===t.q}catch(e){return!1}},i.USE_PROXY_FOR_ES6_CONFORMANCE_CHECKS=!1,i.ES6_CONFORMANCE=i.USE_PROXY_FOR_ES6_CONFORMANCE_CHECKS&&i.checkEs6ConformanceViaProxy(),i.polyfill("WeakMap",(function(e){function t(){}function n(e){var t=typeof e;return"object"===t&&null!==e||"function"===t}function r(e){if(!i.owns(e,a)){var n=new t;i.defineProperty(e,a,{value:n})}}function o(e){if(!i.ISOLATE_POLYFILLS){var n=Object[e];n&&(Object[e]=function(e){return e instanceof t?e:(Object.isExtensible(e)&&r(e),n(e))})}}if(i.USE_PROXY_FOR_ES6_CONFORMANCE_CHECKS){if(e&&i.ES6_CONFORMANCE)return e}else if(function(){if(!e||!Object.seal)return!1;try{var t=Object.seal({}),n=Object.seal({}),i=new e([[t,2],[n,3]]);return 2==i.get(t)&&3==i.get(n)&&(i.delete(t),i.set(n,4),!i.has(t)&&4==i.get(n))}catch(e){return!1}}())return e;var a="$jscomp_hidden_"+Math.random();o("freeze"),o("preventExtensions"),o("seal");var s=0,l=function(e){if(this.id_=(s+=Math.random()+1).toString(),e){e=i.makeIterator(e);for(var t;!(t=e.next()).done;)t=t.value,this.set(t[0],t[1])}};return l.prototype.set=function(e,t){if(!n(e))throw Error("Invalid WeakMap key");if(r(e),!i.owns(e,a))throw Error("WeakMap key fail: "+e);return e[a][this.id_]=t,this},l.prototype.get=function(e){return n(e)&&i.owns(e,a)?e[a][this.id_]:void 0},l.prototype.has=function(e){return n(e)&&i.owns(e,a)&&i.owns(e[a],this.id_)},l.prototype.delete=function(e){return!!(n(e)&&i.owns(e,a)&&i.owns(e[a],this.id_))&&delete e[a][this.id_]},l}),"es6","es3"),i.MapEntry=function(){},i.polyfill("Map",(function(e){if(i.USE_PROXY_FOR_ES6_CONFORMANCE_CHECKS){if(e&&i.ES6_CONFORMANCE)return e}else if(function(){if(i.ASSUME_NO_NATIVE_MAP||!e||"function"!=typeof e||!e.prototype.entries||"function"!=typeof Object.seal)return!1;try{var t=Object.seal({x:4}),n=new e(i.makeIterator([[t,"s"]]));if("s"!=n.get(t)||1!=n.size||n.get({x:4})||n.set({x:4},"t")!=n||2!=n.size)return!1;var r=n.entries(),o=r.next();return!o.done&&o.value[0]==t&&"s"==o.value[1]&&!((o=r.next()).done||4!=o.value[0].x||"t"!=o.value[1]||!r.next().done)}catch(e){return!1}}())return e;var t=new WeakMap,n=function(e){if(this.data_={},this.head_=a(),this.size=0,e){e=i.makeIterator(e);for(var t;!(t=e.next()).done;)t=t.value,this.set(t[0],t[1])}};n.prototype.set=function(e,t){var n=r(this,e=0===e?0:e);return n.list||(n.list=this.data_[n.id]=[]),n.entry?n.entry.value=t:(n.entry={next:this.head_,previous:this.head_.previous,head:this.head_,key:e,value:t},n.list.push(n.entry),this.head_.previous.next=n.entry,this.head_.previous=n.entry,this.size++),this},n.prototype.delete=function(e){return!(!(e=r(this,e)).entry||!e.list)&&(e.list.splice(e.index,1),e.list.length||delete this.data_[e.id],e.entry.previous.next=e.entry.next,e.entry.next.previous=e.entry.previous,e.entry.head=null,this.size--,!0)},n.prototype.clear=function(){this.data_={},this.head_=this.head_.previous=a(),this.size=0},n.prototype.has=function(e){return!!r(this,e).entry},n.prototype.get=function(e){return(e=r(this,e).entry)&&e.value},n.prototype.entries=function(){return o(this,(function(e){return[e.key,e.value]}))},n.prototype.keys=function(){return o(this,(function(e){return e.key}))},n.prototype.values=function(){return o(this,(function(e){return e.value}))},n.prototype.forEach=function(e,t){for(var n,i=this.entries();!(n=i.next()).done;)n=n.value,e.call(t,n[1],n[0],this)},n.prototype[Symbol.iterator]=n.prototype.entries;var r=function(e,n){var r=n&&typeof n;"object"==r||"function"==r?t.has(n)?r=t.get(n):(r=""+ ++s,t.set(n,r)):r="p_"+n;var o=e.data_[r];if(o&&i.owns(e.data_,r))for(e=0;e<o.length;e++){var a=o[e];if(n!=n&&a.key!=a.key||n===a.key)return{id:r,list:o,index:e,entry:a}}return{id:r,list:o,index:-1,entry:void 0}},o=function(e,t){var n=e.head_;return i.iteratorPrototype((function(){if(n){for(;n.head!=e.head_;)n=n.previous;for(;n.next!=n.head;)return n=n.next,{done:!1,value:t(n)};n=null}return{done:!0,value:void 0}}))},a=function(){var e={};return e.previous=e.next=e.head=e},s=0;return n}),"es6","es3");var r={AdEventType:{IMPRESSION:"impression",LOADED:"loaded",GEOMETRY_CHANGE:"geometryChange",SESSION_START:"sessionStart",SESSION_ERROR:"sessionError",SESSION_FINISH:"sessionFinish",MEDIA:"media",VIDEO:"video",START:"start",FIRST_QUARTILE:"firstQuartile",MIDPOINT:"midpoint",THIRD_QUARTILE:"thirdQuartile",COMPLETE:"complete",PAUSE:"pause",RESUME:"resume",BUFFER_START:"bufferStart",BUFFER_FINISH:"bufferFinish",SKIPPED:"skipped",VOLUME_CHANGE:"volumeChange",PLAYER_STATE_CHANGE:"playerStateChange",AD_USER_INTERACTION:"adUserInteraction",STATE_CHANGE:"stateChange"},MediaEventType:{LOADED:"loaded",START:"start",FIRST_QUARTILE:"firstQuartile",MIDPOINT:"midpoint",THIRD_QUARTILE:"thirdQuartile",COMPLETE:"complete",PAUSE:"pause",RESUME:"resume",BUFFER_START:"bufferStart",BUFFER_FINISH:"bufferFinish",SKIPPED:"skipped",VOLUME_CHANGE:"volumeChange",PLAYER_STATE_CHANGE:"playerStateChange",AD_USER_INTERACTION:"adUserInteraction"},ImpressionType:{DEFINED_BY_JAVASCRIPT:"definedByJavaScript",UNSPECIFIED:"unspecified",LOADED:"loaded",BEGIN_TO_RENDER:"beginToRender",ONE_PIXEL:"onePixel",VIEWABLE:"viewable",AUDIBLE:"audible",OTHER:"other"},ErrorType:{GENERIC:"generic",VIDEO:"video",MEDIA:"media"},AdSessionType:{NATIVE:"native",HTML:"html",JAVASCRIPT:"javascript"},EventOwner:{NATIVE:"native",JAVASCRIPT:"javascript",NONE:"none"},SessionOwner:{JAVASCRIPT:"javascript",NATIVE:"native"},AccessMode:{FULL:"full",DOMAIN:"domain",LIMITED:"limited"},AppState:{BACKGROUNDED:"backgrounded",FOREGROUNDED:"foregrounded"},DeviceLockState:{LOCKED:"locked",UNLOCKED:"unlocked"},Environment:{APP:"app",WEB:"web"},DeviceCategory:{CTV:"ctv",DESKTOP:"desktop",MOBILE:"mobile",OTHER:"other"},InteractionType:{CLICK:"click",INVITATION_ACCEPT:"invitationAccept"},CreativeType:{DEFINED_BY_JAVASCRIPT:"definedByJavaScript",HTML_DISPLAY:"htmlDisplay",NATIVE_DISPLAY:"nativeDisplay",VIDEO:"video",AUDIO:"audio"},MediaType:{DISPLAY:"display",VIDEO:"video"},Reason:{NOT_FOUND:"notFound",HIDDEN:"hidden",BACKGROUNDED:"backgrounded",PICTURE_IN_PICTURE:"pictureInPicture",DEVICE_LOCKED:"deviceLocked",VIEWPORT:"viewport",OBSTRUCTED:"obstructed",CLIPPED:"clipped",UNMEASURABLE:"unmeasurable",NO_WINDOW_FOCUS:"noWindowFocus",NO_OUTPUT_DEVICE:"noOutputDevice"},SupportedFeatures:{CONTAINER:"clid",VIDEO:"vlid"},VideoPosition:{PREROLL:"preroll",MIDROLL:"midroll",POSTROLL:"postroll",STANDALONE:"standalone"},VideoPlayerState:{MINIMIZED:"minimized",COLLAPSED:"collapsed",NORMAL:"normal",EXPANDED:"expanded",FULLSCREEN:"fullscreen"},NativeViewKeys:{X:"x",LEFT:"left",Y:"y",TOP:"top",WIDTH:"width",HEIGHT:"height",AD_SESSION_ID:"adSessionId",IS_FRIENDLY_OBSTRUCTION_FOR:"isFriendlyObstructionFor",CLIPS_TO_BOUNDS:"clipsToBounds",CHILD_VIEWS:"childViews",END_X:"endX",END_Y:"endY",OBSTRUCTIONS:"obstructions",OBSTRUCTION_CLASS:"obstructionClass",OBSTRUCTION_PURPOSE:"obstructionPurpose",OBSTRUCTION_REASON:"obstructionReason",PIXELS:"pixels",HAS_WINDOW_FOCUS:"hasWindowFocus"},MeasurementStateChangeSource:{CONTAINER:"container",CREATIVE:"creative"},ElementMarkup:{OMID_ELEMENT_CLASS_NAME:"omid-element"},CommunicationType:{NONE:"NONE",DIRECT:"DIRECT",POST_MESSAGE:"POST_MESSAGE"},OmidImplementer:{OMSDK:"omsdk"},MessageMethod:{IDENTIFY_SERVICE_WINDOW:"identifyServiceWindow"}},o=function(e,t,n,i){this.guid=e,this.method=t,this.version=n,this.args=i};o.isValidSerializedMessage=function(e){return!!e&&void 0!==e.omid_message_guid&&void 0!==e.omid_message_method&&void 0!==e.omid_message_version&&"string"==typeof e.omid_message_guid&&"string"==typeof e.omid_message_method&&"string"==typeof e.omid_message_version&&(void 0===e.omid_message_args||void 0!==e.omid_message_args)},o.deserialize=function(e){return new o(e.omid_message_guid,e.omid_message_method,e.omid_message_version,e.omid_message_args)},o.prototype.serialize=function(){var e={};return e.omid_message_guid=this.guid,e.omid_message_method=this.method,e.omid_message_version=this.version,e=e,void 0!==this.args&&(e.omid_message_args=this.args),e};var a=function(e){this.to=e,this.communicationType_=r.CommunicationType.NONE};a.prototype.sendMessage=function(e,t){},a.prototype.handleMessage=function(e,t){this.onMessage&&this.onMessage(e,t)},a.prototype.serialize=function(e){return JSON.stringify(e)},a.prototype.deserialize=function(e){return JSON.parse(e)},a.prototype.isDirectCommunication=function(){return this.communicationType_===r.CommunicationType.DIRECT},a.prototype.isCrossOrigin=function(){};var s={};function l(e,t){if(!t)throw Error("Value for "+e+" is undefined, null or blank.");if("string"!=typeof t&&!(t instanceof String))throw Error("Value for "+e+" is not a string.");if(""===t.trim())throw Error("Value for "+e+" is empty string.")}function d(e,t){if(null==t)throw Error("Value for "+e+" is undefined or null")}function c(e,t){if(null==t)throw Error(e+" must not be null or undefined.");if("number"!=typeof t||isNaN(t))throw Error("Value for "+e+" is not a number")}function u(e,t,n,i){if(c(e,t),t<n||t>i)throw Error("Value for "+e+" is outside the range ["+n+","+i+"]")}s.assertTruthyString=l,s.assertNotNullObject=d,s.assertNumber=c,s.assertNumberBetween=u,s.assertFunction=function(e,t){if(!t)throw Error(e+" must not be truthy.")},s.assertPositiveNumber=function(e,t){if(c(e,t),0>t)throw Error(e+" must be a positive number.")};function p(e,t){return e&&(e[t]||(e[t]={}))}function h(e,t,i){(i=void 0===i?void 0===n?null:n:i)&&((e=e.split(".")).slice(0,e.length-1).reduce(p,i)[e[e.length-1]]=t)}h("OmidSessionClient.Partner",(function(e,t){l("Partner.name",e),l("Partner.version",t),this.name=e,this.version=t}));var f=function(e,t,n,i){i=void 0===i?r.AccessMode.FULL:i,l("VerificationScriptResource.resourceUrl",e),this.resourceUrl=e,this.vendorKey=t,this.verificationParameters=n,this.accessMode=i};f.prototype.toJSON=function(){return{accessMode:this.accessMode,resourceUrl:this.resourceUrl,vendorKey:this.vendorKey,verificationParameters:this.verificationParameters}},h("OmidSessionClient.VerificationScriptResource",f);var v=function(e,t,n,i){n=void 0===n?null:n,i=void 0===i?null:i,d("Context.partner",e),this.partner=e,this.verificationScriptResources=t,this.videoElement=this.slotElement=null,this.contentUrl=n,this.customReferenceData=i,this.underEvaluation=!1,this.serviceWindow=null};v.prototype.setVideoElement=function(e){d("Context.videoElement",e),this.videoElement=e},v.prototype.setSlotElement=function(e){d("Context.slotElement",e),this.slotElement=e},v.prototype.setServiceWindow=function(e){d("Context.serviceWindow",e),this.serviceWindow=e},h("OmidSessionClient.Context",v);var m={};m.omidGlobal=function(){if(void 0!==t&&t)return t;if(void 0!==e&&e)return e;if("undefined"!=typeof window&&window)return window;if("undefined"!=typeof globalThis&&globalThis)return globalThis;var n=Function("return this")();if(n)return n;throw Error("Could not determine global object context.")}();var g="omidSessionInterface",y="adEvents",b="mediaEvents",A={sessionError:"reportError"},w=Object.keys(r.MediaEventType).map((function(e){return r.MediaEventType[e]})),T=["impressionOccurred"],k=function(e){e=void 0===e?m.omidGlobal:e,this.interfaceRoot_=e[g]};k.prototype.isSupported=function(){return null!=this.interfaceRoot_},k.prototype.sendMessage=function(e,t,n){if("registerSessionObserver"==e&&(n=[t]),A[e]&&(e=A[e]),t=this.interfaceRoot_,0<=T.indexOf(e)&&(t=t[y]),0<=w.indexOf(e)&&(t=t[b]),!(t=t[e]))throw Error("Unrecognized method name: "+e+".");t.apply(null,i.arrayFromIterable(n))};function E(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(e){var t=16*Math.random()|0;return e="y"===e?(3&t|8).toString(16):t.toString(16)}))}var S={};function C(){var e=i.getRestArguments.apply(0,arguments);I((function(){throw new(Function.prototype.bind.apply(Error,[null,"Could not complete the test successfully - "].concat(i.arrayFromIterable(e))))}),(function(){return console.error.apply(console,i.arrayFromIterable(e))}))}function I(e,t){"undefined"!=typeof jasmine&&jasmine?e():"undefined"!=typeof console&&console&&console.error&&t()}S.error=C,S.debug=function(){var e=i.getRestArguments.apply(0,arguments);I((function(){}),(function(){return console.error.apply(console,i.arrayFromIterable(e))}))};var _="1.5.2-iab4528",P={};function j(e){return/\d+\.\d+\.\d+(-.*)?/.test(e)}function x(e,t){e=e.split("-")[0].split("."),t=t.split("-")[0].split(".");for(var n=0;n<3;n++){var i=parseInt(e[n],10),r=parseInt(t[n],10);if(i>r)break;if(i<r)return!1}return!0}P.isValidVersion=j,P.versionGreaterOrEqual=x;var V={};function M(e,t){return j(e)&&x(e,"1.0.3")?t:JSON.stringify(t)}function N(e,t){return j(e)&&x(e,"1.0.3")?t||[]:t&&"string"==typeof t?JSON.parse(t):[]}V.serializeMessageArgs=M,V.deserializeMessageArgs=N;var O={},D="SessionService.",L="VerificationService.";function R(e){return F(e,D)}function U(e){return H(e,D)}function B(e){return H(e,L)}function F(e,t){return t+e}function H(e,t){return(e=e.match(new RegExp("^"+t+"(.*)")))&&e[1]}O.getPrefixedSessionServiceMethod=R,O.getPrefixedVerificationServiceMethod=function(e){return F(e,L)},O.getUnprefixedSessionServiceMethod=U,O.getUnprefixedVerificationServiceMethod=B,O.isPrefixedSessionServiceMethod=function(e){return null!=U(e)},O.isPrefixedVerificationServiceMethod=function(e){return null!=B(e)};var W={};function z(e){return null!=e&&void 0!==e.top&&null!=e.top}function q(e){if(e===m.omidGlobal)return!1;try{if(void 0===e.location.hostname)return!0;!function(e){""===e.x||e.x}(e)}catch(e){return!0}return!1}function G(e){return void 0===e&&"undefined"!=typeof window&&window&&(e=window),z(e)?e:m.omidGlobal}function J(e){return z(e)?e.top:m.omidGlobal}W.evaluatePageUrl=function(e){if(!z(e))return null;try{var t=e.top;return q(t)?null:t.location.href}catch(e){return null}},W.isCrossOrigin=q,W.removeDomElements=function(e){return e.type===r.AdEventType.SESSION_START&&(void 0!==e.data.context.videoElement&&(e.data.context.videoElement="Video Element ("+e.data.context.videoElement.id+")"),void 0!==e.data.context.slotElement&&(e.data.context.slotElement="Slot Element ("+e.data.context.slotElement.id+")")),e},W.resolveGlobalContext=G,W.resolveTopWindowContext=J,W.isTopWindowAccessible=function(e){try{return!!e.top.location.href}catch(e){return!1}};var X=function(e){a.call(this,e),this.communicationType_=r.CommunicationType.DIRECT,this.handleExportedMessage=X.prototype.handleExportedMessage.bind(this)};i.inherits(X,a),X.prototype.sendMessage=function(e,t){if(!(t=void 0===t?this.to:t))throw Error("Message destination must be defined at construction time or when sending the message.");t.handleExportedMessage(e.serialize(),this)},X.prototype.handleExportedMessage=function(e,t){o.isValidSerializedMessage(e)&&this.handleMessage(o.deserialize(e),t)},X.prototype.isCrossOrigin=function(){return!1};var Q=function(e,t){t=void 0===t?m.omidGlobal:t,a.call(this,t);var n=this;this.communicationType_=r.CommunicationType.POST_MESSAGE,e.addEventListener("message",(function(e){if("object"==typeof e.data){var t=e.data;o.isValidSerializedMessage(t)&&(t=o.deserialize(t),e.source&&n.handleMessage(t,e.source))}}))};i.inherits(Q,a),Q.isCompatibleContext=function(e){return!!(e&&e.addEventListener&&e.postMessage)},Q.prototype.sendMessage=function(e,t){if(!(t=void 0===t?this.to:t))throw Error("Message destination must be defined at construction time or when sending the message.");t.postMessage(e.serialize(),"*")},Q.prototype.isCrossOrigin=function(){return!this.to||q(this.to)};var Y={OMID_PRESENT_FRAME_NAME:"omid_v1_present",OMID_PRESENT_FRAME_NAME_WEB:"omid_v1_present_web",OMID_PRESENT_FRAME_NAME_APP:"omid_v1_present_app",getEnvironmentIframeName:function(e){var t={};return(t[r.Environment.APP]=Y.OMID_PRESENT_FRAME_NAME_APP,t[r.Environment.WEB]=Y.OMID_PRESENT_FRAME_NAME_WEB,t)[e]}};function K(e,t){try{return e.frames&&!!e.frames[t]}catch(e){return!1}}function $(e,t){e.document.write('<iframe style="display:none" id="'+t+'" name="'+t+'" sandbox></iframe>')}Y.isOmidPresent=function(e){return[Y.OMID_PRESENT_FRAME_NAME,Y.OMID_PRESENT_FRAME_NAME_WEB,Y.OMID_PRESENT_FRAME_NAME_APP].some((function(t){return K(e,t)}))},Y.getOmidEnvironment=function(e){for(var t=i.makeIterator(Object.values(r.Environment)),n=t.next();!n.done;n=t.next()){if(n=n.value,K(e,Y.getEnvironmentIframeName(n)))return n}return null},Y.declareOmidPresence=function(e,t){e.frames&&e.document&&![Y.OMID_PRESENT_FRAME_NAME,Y.OMID_PRESENT_FRAME_NAME_WEB,Y.OMID_PRESENT_FRAME_NAME_APP].some((function(t){return!!e.frames[t]}))&&(null==e.document.body&&Y.isMutationObserverAvailable_(e)?Y.registerMutationObserver_(e,t):(t=Y.getEnvironmentIframeName(t),e.document.body?(Y.appendPresenceIframe_(e,Y.OMID_PRESENT_FRAME_NAME),Y.appendPresenceIframe_(e,t)):($(e,Y.OMID_PRESENT_FRAME_NAME),$(e,t))))},Y.appendPresenceIframe_=function(e,t){var n=e.document.createElement("iframe");n.id=t,n.name=t,n.style.display="none",n.sandbox="",e.document.body.appendChild(n)},Y.isMutationObserverAvailable_=function(e){return"MutationObserver"in e},Y.registerMutationObserver_=function(e,t){var n=new MutationObserver((function(i){i.forEach((function(i){"BODY"===i.addedNodes[0].nodeName&&(i=Y.getEnvironmentIframeName(t),Y.appendPresenceIframe_(e,Y.OMID_PRESENT_FRAME_NAME),Y.appendPresenceIframe_(e,i),n.disconnect())}))}));n.observe(e.document.documentElement,{childList:!0})};var Z={},ee=["omid","v1_SessionServiceCommunication"],te=["omid","v1_VerificationServiceCommunication"],ne=["omidVerificationProperties","serviceWindow"];function ie(e,t){return t.reduce((function(e,t){return e&&e[t]}),e)}function re(e,t,n,i){if(!q(t))try{var r=ie(t,n);if(r)return new X(r)}catch(e){}return i(t)?new Q(e,t):null}function oe(e,t,n,r){for(var o=(t=i.makeIterator(t)).next();!o.done;o=t.next())if(o=re(e,o.value,n,r))return o;return null}function ae(e,t,n){n=void 0===n?Y.isOmidPresent:n;var i=[e,J(e)];return t&&i.unshift(t),oe(e,i,ee,n)}Z.startSessionServiceCommunication=ae,Z.startVerificationServiceCommunication=function(e,t){t=void 0===t?Y.isOmidPresent:t;var n=[],i=ie(e,ne);return i&&n.push(i),n.push(J(e)),oe(e,n,te,t)};var se=function(e,t,n){d("AdSession.context",e),this.adSessionId_=E(),this.context_=e,this.impressionOccurred_=!1;var i=this.context_.serviceWindow||void 0;this.communication_=t||ae(G(),i),this.sessionInterface_=n||new k,this.isSessionRunning_=this.hasMediaEvents_=this.hasAdEvents_=!1,this.impressionType_=this.creativeType_=null,this.creativeLoaded_=!1,this.callbackMap_={},this.communication_&&(this.communication_.onMessage=this.handleInternalMessage_.bind(this)),this.setClientInfo_(),this.injectVerificationScripts_(e.verificationScriptResources),this.sendSlotElement_(e.slotElement),this.sendVideoElement_(e.videoElement),this.sendContentUrl_(e.contentUrl),this.watchSessionEvents_()};se.prototype.getAdSessionId=function(){return this.adSessionId_},se.prototype.setCreativeType=function(e){if(e===r.CreativeType.DEFINED_BY_JAVASCRIPT)throw Error("Creative type cannot be redefined with value "+r.CreativeType.DEFINED_BY_JAVASCRIPT);if(this.impressionOccurred_)throw Error("Impression has already occurred");if(this.creativeLoaded_)throw Error("Creative has already loaded");if(this.creativeType_&&this.creativeType_!==r.CreativeType.DEFINED_BY_JAVASCRIPT)throw Error("Creative type cannot be redefined");if(void 0===this.creativeType_)throw Error("Native integration is using OMID 1.2 or earlier");this.sendOneWayMessage("setCreativeType",e,this.adSessionId_),this.creativeType_=e},se.prototype.setImpressionType=function(e){if(e===r.ImpressionType.DEFINED_BY_JAVASCRIPT)throw Error("Impression type cannot be redefined with value "+r.ImpressionType.DEFINED_BY_JAVASCRIPT);if(this.impressionOccurred_)throw Error("Impression has already occurred");if(this.creativeLoaded_)throw Error("Creative has already loaded");if(this.impressionType_&&this.impressionType_!==r.ImpressionType.DEFINED_BY_JAVASCRIPT)throw Error("Impression type cannot be redefined");if(void 0===this.impressionType_)throw Error("Native integration is using OMID 1.2 or earlier");this.sendOneWayMessage("setImpressionType",e,this.adSessionId_),this.impressionType_=e},se.prototype.isSupported=function(){return!!this.communication_||this.sessionInterface_.isSupported()},se.prototype.isSendingElementsSupported_=function(){return this.communication_?this.communication_.isDirectCommunication():this.sessionInterface_.isSupported()},se.prototype.registerSessionObserver=function(e){this.sendMessage("registerSessionObserver",e,this.adSessionId_)},se.prototype.start=function(){this.sendOneWayMessage("startSession",{customReferenceData:this.context_.customReferenceData,underEvaluation:this.context_.underEvaluation},this.adSessionId_)},se.prototype.finish=function(){this.sendOneWayMessage("finishSession",this.adSessionId_)},se.prototype.error=function(e,t){this.sendOneWayMessage("sessionError",e,t,this.adSessionId_)},se.prototype.registerAdEvents=function(){if(this.hasAdEvents_)throw Error("AdEvents already registered.");this.hasAdEvents_=!0,this.sendOneWayMessage("registerAdEvents",this.adSessionId_)},se.prototype.registerMediaEvents=function(){if(this.hasMediaEvents_)throw Error("MediaEvents already registered.");this.hasMediaEvents_=!0,this.sendOneWayMessage("registerMediaEvents",this.adSessionId_)},se.prototype.sendOneWayMessage=function(e){var t=i.getRestArguments.apply(1,arguments);this.sendMessage.apply(this,[e,null].concat(i.arrayFromIterable(t)))},se.prototype.sendMessage=function(e,t){var n=i.getRestArguments.apply(2,arguments);this.communication_?this.sendInternalMessage_(e,t,n):this.sessionInterface_.isSupported()&&this.sendInterfaceMessage_(e,t,n)},se.prototype.sendInternalMessage_=function(e,t,n){var i=E();t&&(this.callbackMap_[i]=t),e=new o(i,R(e),_,M(_,n)),this.communication_.sendMessage(e)},se.prototype.handleInternalMessage_=function(e,t){t=e.method;var n=e.guid;if(e=e.args,"response"===t&&this.callbackMap_[n]){var i=N(_,e);this.callbackMap_[n].apply(this,i)}"error"===t&&window.console&&C(e)},se.prototype.sendInterfaceMessage_=function(e,t,n){try{this.sessionInterface_.sendMessage(e,t,n)}catch(e){C("Failed to communicate with SessionInterface with error:"),C(e)}},se.prototype.assertSessionRunning=function(){if(!this.isSessionRunning_)throw Error("Session not started.")},se.prototype.impressionOccurred=function(){if(this.creativeType_===r.CreativeType.DEFINED_BY_JAVASCRIPT)throw Error("Creative type has not been redefined");if(this.impressionType_===r.ImpressionType.DEFINED_BY_JAVASCRIPT)throw Error("Impression type has not been redefined");this.impressionOccurred_=!0},se.prototype.creativeLoaded=function(){if(this.creativeType_===r.CreativeType.DEFINED_BY_JAVASCRIPT)throw Error("Creative type has not been redefined");if(this.impressionType_===r.ImpressionType.DEFINED_BY_JAVASCRIPT)throw Error("Impression type has not been redefined");this.creativeLoaded_=!0},se.prototype.setClientInfo_=function(){this.sendOneWayMessage("setClientInfo",_,this.context_.partner.name,this.context_.partner.version,this.adSessionId_)},se.prototype.injectVerificationScripts_=function(e){e&&(e=e.map((function(e){return e.toJSON()})),this.sendOneWayMessage("injectVerificationScriptResources",e,this.adSessionId_))},se.prototype.sendSlotElement_=function(e){this.sendElement_(e,"setSlotElement")},se.prototype.sendVideoElement_=function(e){this.sendElement_(e,"setVideoElement")},se.prototype.sendElement_=function(e,t){e&&(this.isSendingElementsSupported_()?this.sendOneWayMessage(t,e,this.adSessionId_):this.error(r.ErrorType.GENERIC,"Session Client "+t+" called when communication is cross-origin"))},se.prototype.sendContentUrl_=function(e){e&&this.sendOneWayMessage("setContentUrl",e,this.adSessionId_)},se.prototype.setElementBounds=function(e){d("AdSession.elementBounds",e),this.sendOneWayMessage("setElementBounds",e,this.adSessionId_)},se.prototype.watchSessionEvents_=function(){var e=this;this.registerSessionObserver((function(t){t.type===r.AdEventType.SESSION_START&&(e.isSessionRunning_=!0,e.creativeType_=t.data.creativeType,e.impressionType_=t.data.impressionType),t.type===r.AdEventType.SESSION_FINISH&&(e.isSessionRunning_=!1)}))},h("OmidSessionClient.AdSession",se);var le=function(e,t,n,i){this.isSkippable=e,this.skipOffset=t,this.isAutoPlay=n,this.position=i};le.prototype.toJSON=function(){return{isSkippable:this.isSkippable,skipOffset:this.skipOffset,isAutoPlay:this.isAutoPlay,position:this.position}};var de=function(e){d("AdEvents.adSession",e),this.adSessionId_=e.getAdSessionId();try{e.registerAdEvents(),this.adSession=e}catch(e){throw Error("AdSession already has an ad events instance registered")}};de.prototype.impressionOccurred=function(){this.adSession.assertSessionRunning(),this.adSession.impressionOccurred(),this.adSession.sendOneWayMessage("impressionOccurred",this.adSessionId_)},de.prototype.loaded=function(e){e=void 0===e?null:e,this.adSession.creativeLoaded(),e=e?e.toJSON():null,this.adSession.sendOneWayMessage("loaded",e,this.adSessionId_)},h("OmidSessionClient.AdEvents",de);var ce=function(e){d("MediaEvents.adSession",e),this.adSessionId_=e.getAdSessionId();try{e.registerMediaEvents(),this.adSession=e}catch(e){throw Error("AdSession already has a media events instance registered")}};ce.prototype.start=function(e,t){c("MediaEvents.start.duration",e),u("MediaEvents.start.mediaPlayerVolume",t,0,1),this.adSession.sendOneWayMessage("start",e,t,this.adSessionId_)},ce.prototype.firstQuartile=function(){this.adSession.sendOneWayMessage("firstQuartile",this.adSessionId_)},ce.prototype.midpoint=function(){this.adSession.sendOneWayMessage("midpoint",this.adSessionId_)},ce.prototype.thirdQuartile=function(){this.adSession.sendOneWayMessage("thirdQuartile",this.adSessionId_)},ce.prototype.complete=function(){this.adSession.sendOneWayMessage("complete",this.adSessionId_)},ce.prototype.pause=function(){this.adSession.sendOneWayMessage("pause",this.adSessionId_)},ce.prototype.resume=function(){this.adSession.sendOneWayMessage("resume",this.adSessionId_)},ce.prototype.bufferStart=function(){this.adSession.sendOneWayMessage("bufferStart",this.adSessionId_)},ce.prototype.bufferFinish=function(){this.adSession.sendOneWayMessage("bufferFinish",this.adSessionId_)},ce.prototype.skipped=function(){this.adSession.sendOneWayMessage("skipped",this.adSessionId_)},ce.prototype.volumeChange=function(e){u("MediaEvents.volumeChange.mediaPlayerVolume",e,0,1),this.adSession.sendOneWayMessage("volumeChange",e,this.adSessionId_)},ce.prototype.playerStateChange=function(e){d("MediaEvents.playerStateChange.playerState",e),this.adSession.sendOneWayMessage("playerStateChange",e,this.adSessionId_)},ce.prototype.adUserInteraction=function(e){d("MediaEvents.adUserInteraction.interactionType",e),this.adSession.sendOneWayMessage("adUserInteraction",e,this.adSessionId_)},h("OmidSessionClient.MediaEvents",ce);h("OmidSessionClient.OmidVersion",(function(e,t){l("OmidVersion.semanticVersion",e),l("OmidVersion.apiLevel",t)}));function ue(e){var t=G();new Q(t).onMessage=function(t,n){t.method===r.MessageMethod.IDENTIFY_SERVICE_WINDOW&&e(n)}}h("OmidSessionClient.listenForServiceWindow",ue),h("OmidSessionClient.VastProperties",le);var pe={VerificationVendorId:{OTHER:1,MOAT:2,DOUBLEVERIFY:3,INTEGRAL_AD_SCIENCE:4,PIXELATE:5,NIELSEN:6,COMSCORE:7,MEETRICS:8,GOOGLE:9}};function he(e){for(var t=i.makeIterator(fe.keys()),n=t.next();!n.done;n=t.next()){n=n.value;for(var r=i.makeIterator(fe.get(n)),o=r.next();!o.done;o=r.next())if(o.value.test(e))return n}return pe.VerificationVendorId.OTHER}var fe=new Map([[pe.VerificationVendorId.MOAT,[/^(https?:\/\/|\/\/)?[-a-zA-Z0-9.]+\.moatads\.com\/.*$/]],[pe.VerificationVendorId.DOUBLEVERIFY,[/^(https?:\/\/|\/\/)?[-a-zA-Z0-9.]+\.doubleverify\.com\/.*$/,/^(https?:\/\/|\/\/)?c\.[\w\-]+\.com\/vfw\/dv\/.*$/,/^(https?:\/\/|\/\/)?(www\.)?[\w]+\.tv\/r\/s\/d\/.*$/,/^(https?:\/\/|\/\/)?(\w\.?)+\.dv\.tech\/.*$/]],[pe.VerificationVendorId.INTEGRAL_AD_SCIENCE,[/^(https?:\/\/|\/\/)?[-a-zA-Z0-9.]+\.adsafeprotected\.com\/.*$/]],[pe.VerificationVendorId.PIXELATE,[/^https?:\/\/(q|cdn)\.adrta\.com\/s\/.*\/(aa|aanf)\.js.*$/,/^https:\/\/cdn\.rta247\.com\/s\/.*\/(aa|aanf)\.js.*$/]],[pe.VerificationVendorId.NIELSEN,[]],[pe.VerificationVendorId.COMSCORE,[/^(https?:\/\/|\/\/)?[-a-zA-Z0-9.]+\.voicefive\.com\/.*$/,/^(https?:\/\/|\/\/)?[-a-zA-Z0-9.]+\.measuread\.com\/.*$/,/^(https?:\/\/|\/\/)?[-a-zA-Z0-9.]+\.scorecardresearch\.com\/.*$/]],[pe.VerificationVendorId.MEETRICS,[/^(https?:\/\/|\/\/)?s418\.mxcdn\.net\/bb-serve\/omid-meetrics.*\.js$/]],[pe.VerificationVendorId.GOOGLE,[/^(https?:\/\/|\/\/)?pagead2\.googlesyndication\.com\/.*$/,/^(https?:\/\/|\/\/)?www\.googletagservices\.com\/.*$/]]]);h("OmidSessionClient.verificationVendorIdForScriptUrl",he),h("OmidSessionClient.VerificationVendorId",pe.VerificationVendorId),pe.verificationVendorIdForScriptUrl=he;var ve={};function me(e,t){return Math.abs(e-t)<.01}ve.roughlyEqual=me,ve.roughlyLessThan=function(e,t){return t-e>.01},ve.lessThanOrRoughlyEqual=function(e,t){return e<t||me(e,t)},ve.greaterThanOrRoughlyEqual=function(e,t){return e>t||me(e,t)};var ge={};function ye(e){if("object"==typeof e&&"object"==typeof e.webOSSystem)return e.webOSSystem}ge.getWebOSSystem=ye,ge.isWebOS=function(e){return"object"==typeof ye(e)};function be(e){if("object"==typeof e&&"object"==typeof e.tizen)return e.tizen}ge.getTizen=be,ge.isTizen=function(e){return"object"==typeof be(e)}}),t)}).call(t,function(){return this}())},function(e,t,n){var i=n(11),r=n(20),o=n(12);e.exports=function(e,t,a){return{init:function(s){var l;l="init",o.log("Video Player: "+l);var d=s.contentWindow.document.getElementById(e.an_video_ad_player_id);if(t.iframeVideoWrapper=s,e.options.vpaid)try{t.options.showVpaidIcons=!1,r(t)}catch(e){!function(e){o.error("Video Player: "+e)}(e)}else e.options.isWaterfall&&e.options.plugins&&(e.options.plugins=null);"autoWithFallbackPlay"===e.options.initialPlayback&&(e.options.autoplay=!0,e.options.muted=!0),e.videojsOrigin(d,e.options,(function(){n(22)(e,t).init(this,s,a),!1===e.options.vpaid&&this.src(e.options.videoUrl),n(51)(e,t).init(this,i,24)})),e.options.vpaid&&t&&t.adVideoPlayer&&t.adVideoPlayer.trigger&&t.adVideoPlayer.trigger("an.doneInitialize")}}}},function(e,t,n){var i=n(11),r=n(12),o=n(21),a=function(e,t){r.error("["+(new Date).toISOString()+"] "+e,t)},s=function(e){r.warn("JS VPAID: "+e)},l=function(e){r.info("JS VPAID: "+e)},d=function(e){r.log("JS VPAID: "+e)},c=function(e){r.debug("JS VPAID: "+e)},u=function(e){r.verbose("JS VPAID: "+e)};e.exports=function(e){var t=e.dispatchEventToAdunit.bind(e),n=e.options,r=e.videoPlayerObj,p=n.videoUrl,h=e.callbackForAdUnit,f=e.iframeVideoWrapper,v=!1,m=o().browser.name.toLowerCase();!i.isIos()&&!i.isAndroid()&&f&&n.overlayPlayer&&"auto"===n.initialPlayback&&("edge"===m||"ie"===m?f.style.visibility="hidden":f.style.display="none"),n.plugins={"ads-setup":{}},n.vpaidImpressionFired=!1,n.isWaterfall&&n.firstAdAttempted&&(n.delayExpandUntilVPAIDImpression||n.isExpanded)&&(n.delayExpandUntilVPAIDInit=!1),r.plugin("ads-setup",(function(r){c(r);var o=5e3;void 0!==n.vpaidTimeout&&(o=n.vpaidTimeout);var g={error:a,warn:s,info:l,log:d,debug:c,verbose:u},y=i.isIos()||i.isAndroid(),b=this;e.options.overlayPlayer&&e.resizeVideo();var A=b.vastClient({url:"",jsVpaidUrl:p,playAdAlways:!0,adCancelTimeout:o,adsEnabled:!0,adParameters:n.adParameters,clickUrl:n.clickUrls[0],delayExpandUntilVPAIDInit:n.delayExpandUntilVPAIDInit,terminateUnresponsiveVPAIDCreative:n.terminateUnresponsiveVPAIDCreative,disableControlsOnMouseover:y,initialAudio:n.initialAudio,loggerCallback:g,vpaidEventCallback:function(i,r){var o={AdImpression:"video_impression",AdVideoStart:"video_start",AdVideoFirstQuartile:"video-first-quartile",AdVideoMidpoint:"video-mid",AdVideoThirdQuartile:"video-third-quartile",AdVideoComplete:"video_complete",AdSkipped:"video_skip",AdClickThru:"ad-click"};"AdImpression"===i&&(n.vpaidImpressionFired=!0),"AdClickThru"===i?r&&r.playerHandles?r.hasOwnProperty("url")&&r.url&&r.url.length>0?e.click(r.url):e.click():t({name:"ad-click",trackClick:!0}):o[i]&&t({name:o[i]}),e.notifyVpaidEvent(i,r),"AdVideoComplete"===i&&e.adVideoPlayer.trigger("customDestroy")},delayExpandUntilVPAIDImpression:n.delayExpandUntilVPAIDImpression,vpaidEnvironmentVars:n.vpaidEnvironmentVars,overlayPlayer:n.overlayPlayer,mobileSDK:n.mobileSDK,initialPlayback:n.initialPlayback,controlBarPosition:n.controlBarPosition}),w=function(){if(e.options.overlayPlayer){var t=b,n=i.isAndroid()?1e3:500;setTimeout((function(){t.paused()&&t.tech&&t.tech.el()&&t.tech.el().src&&t.trigger("pause")}),n)}};if(b.on("reset",(function(){b.options().plugins["ads-setup"].adsEnabled?A.enable():A.disable()})),b.on("vast.adError",(function(t){if(!0!==v){v=!0,b.loadingSpinner.hide(),e.destroyWithoutSkip(!0,"VAST AdError reported from JS VPAID player",!1,901);var n=t.error;n&&n.message&&c("JS-VPAID Error (vast.adError)"+n.message)}})),b.on("vpaid.AdVideoStart",(function(){var t=e&&e.adVideoPlayer&&e.adVideoPlayer.player?e.adVideoPlayer.player().duration():0;if(e.test("VIDLA509",t),t&&t>0)e.setVastAttribute();else{var n=!1;b.one("loadedmetadata",(function(){if(n=!0,t=e&&e.adVideoPlayer&&e.adVideoPlayer.player?e.adVideoPlayer.player().duration():0,e.test("VIDLA509",t),t&&t>0)e.setVastAttribute();else{var i=e.options.data.vastDurationMsec;i=i&&i>0?Math.round(i/1e3):0,e.test("VIDLA509-2",i),e.setVastAttribute(i)}})),setTimeout((function(){if(!1===n){var t=e.options.data.vastDurationMsec;t=t&&t>0?Math.round(t/1e3):0,e.test("VIDLA509-2",t),e.setVastAttribute(t)}}),3e3)}})),b.on("vast.adTimeout",(function(){b.loadingSpinner.hide(),e.destroyWithoutSkip(!0,"VPAID AdError reported from JS VPAID player",!0,901)})),b.on("vpaid.AdError",(function(t){if(!0!==v){v=!0,b.loadingSpinner.hide(),e.destroyWithoutSkip(!0,"VPAID AdError reported from JS VPAID player",!1,901);var n=t.error;n&&n.message&&c("JS-VPAID Error (vpaid.AdError) "+n.message)}})),b.on("vast.adSkip",(function(){e.destroy(),c("vast.adSkip")})),b.on("vpaid.AdSkipped",(function(){e.destroy(),c("vpaid.AdSkipped")})),b.on("vpaid.AdIcons",(function(t){t&&t.hasOwnProperty("adIcons")&&t.adIcons||(e.options.showVpaidIcons=!0)})),b.on("vast.adsCancel",(function(){v||(v=!0,e.destroyWithoutSkip(),c("adsCancel"))})),b.on("vpaid.AdStopped",(function(){c("vpaid.AdStopped"),!0!==n.disableCollapse.replay?(b.loadingSpinner.hide(),b.controlBar.hide(),b.bigPlayButton.hide(),e.isCompleted||(n.disableCollapse.enabled||e.destroyWithoutSkip(),e.isCompleted=!0)):e.resetVpaid()})),b.one("vpaid.AdStarted",(function(){w(),f&&n.overlayPlayer&&("edge"===m||"ie"===m?f.style.visibility="visible":f.style.display="block"),b.loadingSpinner.hide()})),b.one("vpaid.AdImpression",(function(){w(),b.controlBar.show(),n.showBigPlayButton&&b.bigPlayButton.show()})),h.cbWhenReady){var T=function(){e.test("VIDLA509-1",""),c("callcbWhenReady (Impression, AdStarted are delivered"),e.isReadyToExpandForMobile=!0,b.tech.removeControlsListeners();var t=e.options.width/e.options.height;e.resizeVideo(t,i.isMobile()),n.isWaterfall&&n.firstAdAttempted&&n.delayExpandUntilVPAIDInit&&!n.isExpanded&&"auto"!==n.initialPlayback&&b.bigPlayButton.show(),"function"==typeof h.cbWhenReady&&h.cbWhenReady(e)},k=function(){n.delayExpandUntilVPAIDImpression?function(){var t=!1,n=b.volume(),r=!1,o=!1,a=!1,s=!1,l=function(){r&&o&&a&&!1===t&&(t=!0,setTimeout(T,500))};if(i.isIos()){b.on("timeupdate",(function(){b.player().currentTime()>0&&!1===s&&!1===e.isAlreadyPlaingForVPAID&&(s=!0,a=!0,b.pause(),l(),c("pause by timeupdate when delayExpandUntilVPAIDImpression is true"))}));var d=function(){b.player().currentTime()>0&&!1===s&&!1===e.isAlreadyPlaingForVPAID&&(s=!0,a=!0,b.pause(),l(),c("pause by timer when delayExpandUntilVPAIDImpression is true")),t||setTimeout(d,100)};setTimeout(d,100)}else b.one("vpaid.AdVideoStart",(function(){!1===e.isAlreadyPlaingForVPAID&&b.pause(),b.volume(n),a=!0,l()}));b.one("vpaid.AdStarted",(function(){r=!0,l()})),b.one("vpaid.AdImpression",(function(){o=!0,l()})),b.volume(0),e.delayEventHandler.ignoreNextQueue(),i.isIos()?(e.adVideoPlayer.trigger("play"),e.isDoneInitialPlay=!0):b.play()}():T()};n.isWaterfall&&n.firstAdAttempted?b.one("an.doneInitialize",k):n.delayExpandUntilVPAIDInit?b.one("an.readytogovpaid",k):b.one("an.doneInitialize",k)}}))}},function(e,t,n){n(12).always("UserAgentParser","Version 0.0.1");var i=function(e,t){var n="model",r="name",o="type",a="vendor",s="version",l="mobile",d="tablet",c={extend:function(e,t){var n={};for(var i in e)t[i]&&t[i].length%2==0?n[i]=t[i].concat(e[i]):n[i]=e[i];return n},has:function(e,t){return"string"==typeof e&&-1!==t.toLowerCase().indexOf(e.toLowerCase())},lowerize:function(e){return e.toLowerCase()},major:function(e){return"string"==typeof e?e.replace(/[^\d\.]/g,"").split(".")[0]:void 0},trim:function(e){return e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")}},u={rgx:function(){var e,t,n,i,r,o,a={},s=0,l=arguments;for(n=0;n<l[1].length;n++)a["object"==typeof(i=l[1][n])?i[0]:i]=void 0;for(;s<l.length&&!r;){var d=l[s],c=l[s+1];for(e=t=0;e<d.length&&!r;)if(r=d[e++].exec(this.getUA()))for(n=0;n<c.length;n++)o=r[++t],"object"==typeof(i=c[n])&&i.length>0?2===i.length?"function"==typeof i[1]?a[i[0]]=i[1].call(this,o):a[i[0]]=i[1]:3===i.length?"function"!=typeof i[1]||i[1].exec&&i[1].test?a[i[0]]=o?o.replace(i[1],i[2]):void 0:a[i[0]]=o?i[1].call(this,o,i[2]):void 0:4===i.length&&(a[i[0]]=o?i[3].call(this,o.replace(i[1],i[2])):void 0):a[i]=o||void 0;s+=2}return a},str:function(e,t){for(var n in t)if("object"==typeof t[n]&&t[n].length>0){for(var i=0;i<t[n].length;i++)if(c.has(t[n][i],e))return"?"===n?void 0:n}else if(c.has(t[n],e))return"?"===n?void 0:n;return e}},p={browser:{oldsafari:{version:{"1.0":"/8",1.2:"/1",1.3:"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"}}},device:{amazon:{model:{"Fire Phone":["SD","KF"]}},sprint:{model:{"Evo Shift 4G":"7373KT"},vendor:{HTC:"APA",Sprint:"Sprint"}}},os:{windows:{version:{XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0",7:"NT 6.1",8:"NT 6.2",8.1:"NT 6.3",10:["NT 6.4","NT 10.0"],RT:"ARM"}}}},h={browser:[[/(opera\smini)\/([\w\.-]+)/i,/(opera\s[mobiletab]+).+version\/([\w\.-]+)/i,/(opera).+version\/([\w\.]+)/i,/(opera)[\/\s]+([\w\.]+)/i],[r,s],[/(opios)[\/\s]+([\w\.]+)/i],[[r,"Opera Mini"],s],[/\s(opr)\/([\w\.]+)/i],[[r,"Opera"],s],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer)[\/\s]?([\w\.]+)*/i,/(avant\s|iemobile|slim|baidu)(?:browser)?[\/\s]?([\w\.]*)/i,/(?:ms|\()(ie)\s([\w\.]+)/i,/(rekonq)\/([\w\.]+)*/i,/(chromium|flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs)\/([\w\.-]+)/i],[r,s],[/(trident).+rv[:\s]([\w\.]+).+like\sgecko/i],[[r,"IE"],s],[/(edge)\/((\d+)?[\w\.]+)/i],[r,s],[/(yabrowser)\/([\w\.]+)/i],[[r,"Yandex"],s],[/(comodo_dragon)\/([\w\.]+)/i],[[r,/_/g," "],s],[/(micromessenger)\/([\w\.]+)/i],[[r,"WeChat"],s],[/xiaomi\/miuibrowser\/([\w\.]+)/i],[s,[r,"MIUI Browser"]],[/\swv\).+(chrome)\/([\w\.]+)/i],[[r,/(.+)/,"$1 WebView"],s],[/android.+samsungbrowser\/([\w\.]+)/i,/android.+version\/([\w\.]+)\s+(?:mobile\s?safari|safari)*/i],[s,[r,"Android Browser"]],[/(chrome|omniweb|arora|[tizenoka]{5}\s?browser)\/v?([\w\.]+)/i,/(qqbrowser)[\/\s]?([\w\.]+)/i],[r,s],[/(uc\s?browser)[\/\s]?([\w\.]+)/i,/ucweb.+(ucbrowser)[\/\s]?([\w\.]+)/i,/juc.+(ucweb)[\/\s]?([\w\.]+)/i],[[r,"UCBrowser"],s],[/(dolfin)\/([\w\.]+)/i],[[r,"Dolphin"],s],[/((?:android.+)crmo|crios)\/([\w\.]+)/i],[[r,"Chrome"],s],[/;fbav\/([\w\.]+);/i],[s,[r,"Facebook"]],[/fxios\/([\w\.-]+)/i],[s,[r,"Firefox"]],[/version\/([\w\.]+).+?mobile\/\w+\s(safari)/i],[s,[r,"Mobile Safari"]],[/version\/([\w\.]+).+?(mobile\s?safari|safari)/i],[s,r],[/webkit.+?(mobile\s?safari|safari)(\/[\w\.]+)/i],[r,[s,u.str,p.browser.oldsafari.version]],[/(konqueror)\/([\w\.]+)/i,/(webkit|khtml)\/([\w\.]+)/i],[r,s],[/(navigator|netscape)\/([\w\.-]+)/i],[[r,"Netscape"],s],[/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo\sbrowser|minimo|conkeror)[\/\s]?([\w\.\+]+)/i,/(firefox|seamonkey|k-meleon|icecat|iceape|firebird|phoenix)\/([\w\.-]+)/i,/(mozilla)\/([\w\.]+).+rv\:.+gecko\/\d+/i,/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|sleipnir)[\/\s]?([\w\.]+)/i,/(links)\s\(([\w\.]+)/i,/(gobrowser)\/?([\w\.]+)*/i,/(ice\s?browser)\/v?([\w\._]+)/i,/(mosaic)[\/\s]([\w\.]+)/i],[r,s]],device:[[/\((ipad|playbook);[\w\s\);-]+(rim|apple)/i],[n,a,[o,d]],[/applecoremedia\/[\w\.]+ \((ipad)/],[n,[a,"Apple"],[o,d]],[/(apple\s{0,1}tv)/i],[[n,"Apple TV"],[a,"Apple"]],[/(archos)\s(gamepad2?)/i,/(hp).+(touchpad)/i,/(hp).+(tablet)/i,/(kindle)\/([\w\.]+)/i,/\s(nook)[\w\s]+build\/(\w+)/i,/(dell)\s(strea[kpr\s\d]*[\dko])/i],[a,n,[o,d]],[/(kf[A-z]+)\sbuild\/[\w\.]+.*silk\//i],[n,[a,"Amazon"],[o,d]],[/(sd|kf)[0349hijorstuw]+\sbuild\/[\w\.]+.*silk\//i],[[n,u.str,p.device.amazon.model],[a,"Amazon"],[o,l]],[/\((ip[honed|\s\w*]+);.+(apple)/i],[n,a,[o,l]],[/\((ip[honed|\s\w*]+);/i],[n,[a,"Apple"],[o,l]],[/(blackberry)[\s-]?(\w+)/i,/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|huawei|meizu|motorola|polytron)[\s_-]?([\w-]+)*/i,/(hp)\s([\w\s]+\w)/i,/(asus)-?(\w+)/i],[a,n,[o,l]],[/\(bb10;\s(\w+)/i],[n,[a,"BlackBerry"],[o,l]],[/android.+(transfo[prime\s]{4,10}\s\w+|eeepc|slider\s\w+|nexus 7|padfone)/i],[n,[a,"Asus"],[o,d]],[/(sony)\s(tablet\s[ps])\sbuild\//i,/(sony)?(?:sgp.+)\sbuild\//i],[[a,"Sony"],[n,"Xperia Tablet"],[o,d]],[/(?:sony)?(?:(?:(?:c|d)\d{4})|(?:so[-l].+))\sbuild\//i],[[a,"Sony"],[n,"Xperia Phone"],[o,l]],[/\s(ouya)\s/i,/(nintendo)\s([wids3u]+)/i],[a,n,[o,"console"]],[/android.+;\s(shield)\sbuild/i],[n,[a,"Nvidia"],[o,"console"]],[/(playstation\s[34portablevi]+)/i],[n,[a,"Sony"],[o,"console"]],[/(sprint\s(\w+))/i],[[a,u.str,p.device.sprint.vendor],[n,u.str,p.device.sprint.model],[o,l]],[/(lenovo)\s?(S(?:5000|6000)+(?:[-][\w+]))/i],[a,n,[o,d]],[/(htc)[;_\s-]+([\w\s]+(?=\))|\w+)*/i,/(zte)-(\w+)*/i,/(alcatel|geeksphone|huawei|lenovo|nexian|panasonic|(?=;\s)sony)[_\s-]?([\w-]+)*/i],[a,[n,/_/g," "],[o,l]],[/(nexus\s9)/i],[n,[a,"HTC"],[o,d]],[/(nexus\s6p)/i],[n,[a,"Huawei"],[o,l]],[/(microsoft);\s(lumia[\s\w]+)/i],[a,n,[o,l]],[/[\s\(;](xbox(?:\sone)?)[\s\);]/i],[n,[a,"Microsoft"],[o,"console"]],[/(kin\.[onetw]{3})/i],[[n,/\./g," "],[a,"Microsoft"],[o,l]],[/\s(milestone|droid(?:[2-4x]|\s(?:bionic|x2|pro|razr))?(:?\s4g)?)[\w\s]+build\//i,/mot[\s-]?(\w+)*/i,/(XT\d{3,4}) build\//i,/(nexus\s6)/i],[n,[a,"Motorola"],[o,l]],[/android.+\s(mz60\d|xoom[\s2]{0,2})\sbuild\//i],[n,[a,"Motorola"],[o,d]],[/hbbtv\/\d+\.\d+\.\d+\s+\([\w\s]*;\s*(\w[^;]*);([^;]*)/i],[[a,c.trim],[n,c.trim],[o,"smarttv"]],[/hbbtv.+maple;(\d+)/i],[[n,/^/,"SmartTV"],[a,"Samsung"],[o,"smarttv"]],[/\(dtv[\);].+(aquos)/i],[n,[a,"Sharp"],[o,"smarttv"]],[/android.+((sch-i[89]0\d|shw-m380s|gt-p\d{4}|gt-n\d+|sgh-t8[56]9|nexus 10))/i,/((SM-T\w+))/i],[[a,"Samsung"],n,[o,d]],[/smart-tv.+(samsung)/i],[a,[o,"smarttv"],n],[/((s[cgp]h-\w+|gt-\w+|galaxy\snexus|sm-\w[\w\d]+))/i,/(sam[sung]*)[\s-]*(\w+-?[\w-]*)*/i,/sec-((sgh\w+))/i],[[a,"Samsung"],n,[o,l]],[/sie-(\w+)*/i],[n,[a,"Siemens"],[o,l]],[/(maemo|nokia).*(n900|lumia\s\d+)/i,/(nokia)[\s_-]?([\w-]+)*/i],[[a,"Nokia"],n,[o,l]],[/android\s3\.[\s\w;-]{10}(a\d{3})/i],[n,[a,"Acer"],[o,d]],[/android\s3\.[\s\w;-]{10}(lg?)-([06cv9]{3,4})/i],[[a,"LG"],n,[o,d]],[/(lg) netcast\.tv/i],[a,n,[o,"smarttv"]],[/(nexus\s[45])/i,/lg[e;\s\/-]+(\w+)*/i],[n,[a,"LG"],[o,l]],[/android.+(ideatab[a-z0-9\-\s]+)/i],[n,[a,"Lenovo"],[o,d]],[/linux;.+((jolla));/i],[a,n,[o,l]],[/((pebble))app\/[\d\.]+\s/i],[a,n,[o,"wearable"]],[/android.+;\s(glass)\s\d/i],[n,[a,"Google"],[o,"wearable"]],[/android.+;\s(pixel c)\s/i],[n,[a,"Google"],[o,d]],[/android.+;\s(pixel xl|pixel)\s/i],[n,[a,"Google"],[o,l]],[/android.+(\w+)\s+build\/hm\1/i,/android.+(hm[\s\-_]*note?[\s_]*(?:\d\w)?)\s+build/i,/android.+(mi[\s\-_]*(?:one|one[\s_]plus|note lte)?[\s_]*(?:\d\w)?)\s+build/i],[[n,/_/g," "],[a,"Xiaomi"],[o,l]],[/android.+a000(1)\s+build/i],[n,[a,"OnePlus"],[o,l]],[/\s(tablet)[;\/]/i,/\s(mobile)(?:[;\/]|\ssafari)/i],[[o,c.lowerize],a,n]],engine:[[/windows.+\sedge\/([\w\.]+)/i],[s,[r,"EdgeHTML"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m)\/([\w\.]+)/i,/(khtml|tasman|links)[\/\s]\(?([\w\.]+)/i,/(icab)[\/\s]([23]\.[\d\.]+)/i],[r,s],[/rv\:([\w\.]+).*(gecko)/i],[s,r]],os:[[/microsoft\s(windows)\s(vista|xp)/i],[r,s],[/(windows)\snt\s6\.2;\s(arm)/i,/(windows\sphone(?:\sos)*)[\s\/]?([\d\.\s]+\w)*/i,/(windows\smobile|windows)[\s\/]?([ntce\d\.\s]+\w)/i],[r,[s,u.str,p.os.windows.version]],[/(win(?=3|9|n)|win\s9x\s)([nt\d\.]+)/i],[[r,"Windows"],[s,u.str,p.os.windows.version]],[/\((bb)(10);/i],[[r,"BlackBerry"],s],[/(blackberry)\w*\/?([\w\.]+)*/i,/(tizen)[\/\s]([\w\.]+)/i,/(android|webos|palm\sos|qnx|bada|rim\stablet\sos|meego|contiki)[\/\s-]?([\w\.]+)*/i,/linux;.+(sailfish);/i],[r,s],[/(symbian\s?os|symbos|s60(?=;))[\/\s-]?([\w\.]+)*/i],[[r,"Symbian"],s],[/\((series40);/i],[r],[/mozilla.+\(mobile;.+gecko.+firefox/i],[[r,"Firefox OS"],s],[/(nintendo|playstation)\s([wids34portablevu]+)/i,/(mint)[\/\s\(]?(\w+)*/i,/(mageia|vectorlinux)[;\s]/i,/(joli|[kxln]?ubuntu|debian|[open]*suse|gentoo|(?=\s)arch|slackware|fedora|mandriva|centos|pclinuxos|redhat|zenwalk|linpus)[\/\s-]?(?!chrom)([\w\.-]+)*/i,/(hurd|linux)\s?([\w\.]+)*/i,/(gnu)\s?([\w\.]+)*/i],[r,s],[/(cros)\s[\w]+\s([\w\.]+\w)/i],[[r,"Chromium OS"],s],[/(sunos)\s?([\w\.]+\d)*/i],[[r,"Solaris"],s],[/\s([frentopc-]{0,4}bsd|dragonfly)\s?([\w\.]+)*/i],[r,s],[/(haiku)\s(\w+)/i],[r,s],[/(ip[honead]+)(?:.*os\s([\w]+)*\slike\smac|;\sopera)/i],[[r,"iOS"],[s,/_/g,"."]],[/(mac\sos\sx)\s?([\w\s\.]+\w)*/i,/(macintosh|mac(?=_powerpc)\s)/i],[[r,"Mac OS"],[s,/_/g,"."]],[/((?:open)?solaris)[\/\s-]?([\w\.]+)*/i,/(aix)\s((\d)(?=\.|\)|\s)[\w\.]*)*/i,/(plan\s9|minix|beos|os\/2|amigaos|morphos|risc\sos|openvms)/i,/(unix)\s?([\w\.]+)*/i],[r,s]]};if(!(this instanceof i))return new i(e,t).getResult();var f=e||(window&&window.navigator&&window.navigator.userAgent?window.navigator.userAgent:""),v=t?c.extend(h,t):h;return this.getBrowser=function(){var e=u.rgx.apply(this,v.browser);return e.major=c.major(e.version),e},this.getDevice=function(){return u.rgx.apply(this,v.device)},this.getEngine=function(){return u.rgx.apply(this,v.engine)},this.getOS=function(){return u.rgx.apply(this,v.os)},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice()}},this.getUA=function(){return f},this};e.exports=i},function(e,t,n){var i=n(12);e.exports=function(e,t){return{init:function(r,o,a){var s;s="init",i.debug("[PlayerManager_CustomizedVideoJS]",s),t.adVideoPlayer=r,e.options.nativeControlsForTouch=!1,e.options.customControlsOnMobile=!1,e.isMobile()?r.enableTouchActivity():r.userActive(!1),t.customSkinning.render(e,r,o.contentWindow.document,!1);var l=o.contentWindow.document.getElementById("top_chrome"),d=o.contentWindow.document.getElementById("skip_Button_Wrapper"),c=o.contentWindow.document.createElement("div"),u=e.options.learnMore.enabled;e.options.clickUrls[0]||(u=!1),u&&(e.options.useMsSkin?"top-right"!==e.options.learnMore.location&&"top-left"!==e.options.learnMore.location&&(e.options.learnMore.location="inline"):"top-right"===e.options.skippable.skipLocation?e.adIndicatorTextContent=e.options.learnMore.text+" "+e.options.learnMore.separator+" "+e.adIndicatorTextContent:e.adIndicatorTextContent+=" "+e.options.learnMore.separator+" "+e.options.learnMore.text),!e.options.useMsSkin||u&&"inline"===e.options.learnMore.location||(d.style["max-width"]="66%");var p=e.videojsOrigin.createEl("div",{role:"button",innerHTML:e.adIndicatorTextContent,className:"top-bar-text"}),h=e.options.wcElement&&e.options.wcElement instanceof Element?e.options.wcElement.querySelector("#"+String(e.options.iframeVideoWrapperId)):document.getElementById(e.options.iframeVideoWrapperId),f=h.contentWindow.document.getElementById(e.an_video_ad_player_id),v=h.contentWindow.document.getElementById(e.an_video_ad_player_html5_api_id);e.options.useMsSkin&&n(23)(e).init(r),n(30)(e,t).init(r),e.options.useMsSkin?n(31)(e,t).init(r,h.contentWindow.document,u):n(32)(e,t).init(r,o,c,p,u),n(33)(e,t).init(l,p,c,r,o,d),n(34)(e,t).init(r),n(43)(e,t).init(r),n(46)(e,t).init(r,p,c),n(47)(e).init(r),n(48)(e,t).init(),n(49)(e,t).init(r),n(50)(e,t).init(r),a(f,v)}}}},function(e,t,n){var i=n(12);e.exports=function(e){return{init:function(t){var r;r="init",i.debug("[PlayerManager_VolumePanel]",r);var o=t.player().controlBar;n(24)(e.videojsOrigin),n(25)(e.videojsOrigin),n(27)(e.videojsOrigin),n(28)(e.videojsOrigin),n(29)(e.videojsOrigin),o.addChild("volumePanel")}}}},function(e,t){e.exports=function(e){e.VolumeLevel=e.Component.extend({init:function(t,n){e.Component.call(this,t,n)}}),e.VolumeLevel.prototype.createEl=function(){var t=e.createEl("div",{className:"vjs-volume-level"});return t.appendChild(e.createEl("span",{className:"vjs-control-text"})),t}}},function(e,t,n){var i=n(26);e.exports=function(e){e.VolumeBar=e.Slider.extend({init:function(n,i){e.Slider.call(this,n,i),this.on("slideractive",(function(e){this.updateLastVolume_(e)})),this.on(n,"volumechange",(function(e){this.updateARIAAttributes(e)})),n.ready(e.bind(this,this.updateARIAAttributes)),this.onMouseMove=t.bind(this);var r=this;setTimeout((function(){r.update()}),500)}}),e.VolumeBar.prototype.createEl=function(){return e.Slider.prototype.createEl("div",{className:"vjs-volume-bar vjs-slider-bar vjs-slider-vertical"},{"aria-label":"Volume Level","aria-live":"polite"})},e.VolumeBar.prototype.handleMouseDown=function(t){i.isSingleLeftClick(t)&&e.Slider.prototype.handleMouseDown(t)},e.VolumeBar.prototype.update=function(){if(this.el_){var t,n=this.getPercent(),i=this.handle,r=this.bar;if(("number"!=typeof n||n!=n||n<0||n===1/0)&&(n=0),t=n,r){var o=this.el_.offsetHeight;if(0===o){var a=window.getComputedStyle(this.el_);console.log("****** compStyles: ",a),o=a.getPropertyValue("height")}if(o>0){r.el().style.height=e.round(100*t,2)+"%";var s=o*t;i.el().style.bottom=s-i.el().offsetHeight,i.el().style.left=-i.el().offsetHeight/2,i.el().style.top="auto"}}if(this.el_.parentElement&&this.el_.parentElement.children.length>0)for(var l=0;l<this.el_.parentElement.children.length;l++){var d=this.el_.parentElement.children[l];if("volumeText"===d.id){var c=e.round(100*t);d.innerHTML=c.toString();break}}}},e.VolumeBar.prototype.calculateDistance=function(e){return i.getPointerPosition(this.el_,e).y};var t=function(e){i.isSingleLeftClick(e)&&(this.checkMuted(),this.player_.volume(this.calculateDistance(e)))};e.VolumeBar.prototype.checkMuted=function(){this.player_.muted()&&this.player_.muted(!1)},e.VolumeBar.prototype.getPercent=function(){return this.player_.muted()?0:this.player_.volume()},e.VolumeBar.prototype.stepForward=function(){this.checkMuted(),this.player_.volume(this.player_.volume()+.1)},e.VolumeBar.prototype.stepBack=function(){this.checkMuted(),this.player_.volume(this.player_.volume()-.1)},e.VolumeBar.prototype.updateARIAAttributes=function(e){var t=this.player_.muted()?0:this.volumeAsPercentage_();this.el_.setAttribute("aria-valuenow",t),this.el_.setAttribute("aria-valuetext",t+"%")},e.VolumeBar.prototype.volumeAsPercentage_=function(){return Math.round(100*this.player_.volume())},e.VolumeBar.prototype.updateLastVolume_=function(){var e=this.player_.volume();this.one("sliderinactive",(function(){0===this.player_.volume()&&this.player_.lastVolume_(e)}))},e.VolumeBar.prototype.playerEvent="volumechange",e.VolumeBar.prototype.options_={children:{volumeLevel:{},volumeHandle:{}},barName:"volumeLevel",handleName:"volumeHandle",vertical:!0}}},function(e,t,n){var i=n(11),r=function(e,t){if(!e||!t)return"";if("function"==typeof window.getComputedStyle){var n;try{n=window.getComputedStyle(e)}catch(e){return""}return n?n.getPropertyValue(t)||n[t]:""}return""},o=function(e){if(!e||e&&!e.offsetParent)return{left:0,top:0,width:0,height:0};for(var t=e.offsetWidth,n=e.offsetHeight,i=0,r=0;e.offsetParent&&e!==document.fullscreenElement;)i+=e.offsetLeft,r+=e.offsetTop,e=e.offsetParent;return{left:i,top:r,width:t,height:n}};e.exports={isSingleLeftClick:function(e){return void 0===e.button&&void 0===e.buttons||(0===e.button&&void 0===e.buttons||("mouseup"===e.type&&0===e.button&&0===e.buttons||0===e.button&&1===e.buttons))},getBoundingClientRect:function(e){if(e&&e.getBoundingClientRect&&e.parentNode){var t=e.getBoundingClientRect(),n={};return["bottom","height","left","right","top","width"].forEach((function(e){void 0!==t[e]&&(n[e]=t[e])})),n.height||(n.height=parseFloat(r(e,"height"))),n.width||(n.width=parseFloat(r(e,"width"))),n}},getPointerPosition:function(e,t){var n={x:0,y:0};if(i.isIos())for(var a=e;a&&"html"!==a.nodeName.toLowerCase();){var s,l=r(a,"transform");/^matrix/.test(l)?(s=l.slice(7,-1).split(/,\s/).map(Number),n.x+=s[4],n.y+=s[5]):/^matrix3d/.test(l)&&(s=l.slice(9,-1).split(/,\s/).map(Number),n.x+=s[12],n.y+=s[13]),a=a.parentNode}var d={},c=o(t.target),u=o(e),p=u.width,h=u.height,f=t.offsetY-(u.top-c.top),v=t.offsetX-(u.left-c.left);return t.changedTouches&&(v=t.changedTouches[0].pageX-u.left,f=t.changedTouches[0].pageY+u.top,i.isIos()&&(v-=n.x,f-=n.y)),d.y=1-Math.max(0,Math.min(1,f/h)),d.x=Math.max(0,Math.min(1,v/p)),d},clamp:function(e,t,n){return e=Number(e),Math.min(n,Math.max(t,isNaN(e)?t:e))},UPDATE_REFRESH_INTERVAL:30}},function(e,t,n){var i=n(26);e.exports=function(e){e.VolumeControl=e.Component.extend({init:function(t,n){n.vertical=!0,void 0===n.volumeBar&&(n.volumeBar=n.volumeBar||{},n.volumeBar.vertical=n.vertical,n.volumeBar.handleName="volumeHandle"),e.Component.call(this,t,n),this.last=window.performance.now(),this.throttledHandleMouseMove=function(e){var t=window.performance.now();t-this.last>=i.UPDATE_REFRESH_INTERVAL&&(this.handleMouseMove(e),this.last=t)},this.handleMouseUpHandler_=function(e){this.handleMouseUp(e)},this.on("mousedown",(function(e){this.handleMouseDown(e)})),this.on("touchstart",(function(e){this.handleMouseDown(e)})),this.on("mousemove",(function(e){this.handleMouseMove(e)})),this.on(this.volumeBar,["focus","slideractive"],(function(){this.volumeBar.addClass("vjs-slider-active"),this.addClass("vjs-slider-active"),this.trigger("slideractive")})),this.on(this.volumeBar,["blur","sliderinactive"],(function(){this.volumeBar.removeClass("vjs-slider-active"),this.removeClass("vjs-slider-active"),this.trigger("sliderinactive")}))}}),e.VolumeControl.prototype.createEl=function(){var t=e.createEl("div",{className:"vjs-volume-control vjs-control vjs-volume-vertical"}),n=e.round(100*this.player_.volume(),2);return t.appendChild(e.createEl("span",{className:"vjs-volume-control-text",innerHTML:n.toString(),id:"volumeText"})),t},e.VolumeControl.prototype.handleMouseDown=function(e){var t=this.el_.ownerDocument;this.on(t,"mousemove",this.throttledHandleMouseMove),this.on(t,"touchmove",this.throttledHandleMouseMove),this.on(t,"mouseup",this.handleMouseUpHandler_),this.on(t,"touchend",this.handleMouseUpHandler_)},e.VolumeControl.prototype.handleMouseUp=function(e){var t=this.el_.ownerDocument;this.off(t,"mousemove",this.throttledHandleMouseMove),this.off(t,"touchmove",this.throttledHandleMouseMove),this.off(t,"mouseup",this.handleMouseUpHandler_),this.off(t,"touchend",this.handleMouseUpHandler_)},e.VolumeControl.prototype.handleMouseMove=function(e){this.volumeBar&&this.volumeBar.onMouseMove(e)},e.VolumeControl.prototype.options_={children:{volumeBar:{}}}}},function(e,t,n){var i=n(11);e.exports=function(e){e.MuteToggle=e.Button.extend({init:function(t,n){e.Button.call(this,t,n),this.on(t,["loadstart","volumechange"],(function(e){this.update(e)}))}}),e.MuteToggle.prototype.buildCSSClass=function(){return"vjs-mute-control "+e.Button.prototype.buildCSSClass()},e.MuteToggle.prototype.onClick=function(e){if(this.player_.muted()){var t=this.player_.volume();0===t&&(t=.5,this.player_.volume(t))}this.player_.muted(!this.player_.muted())},e.MuteToggle.prototype.update=function(e){this.updateIcon_()},e.MuteToggle.prototype.updateIcon_=function(){var t=this.player_.volume(),n=3;if(i.isIos()&&this.player_.tech_&&this.player_.tech_.el_&&this.player_.muted(this.player_.tech_.el_.muted),0===t||this.player_.muted()?n=0:t<.33?n=1:t<.67&&(n=2),this.el_){this.player_.muted()?this.el_.children[0].children[0].innerHTML!=this.localize("Unmute")&&(this.el_.children[0].children[0].innerHTML=this.localize("Unmute")):this.el_.children[0].children[0].innerHTML!=this.localize("Mute")&&(this.el_.children[0].children[0].innerHTML=this.localize("Mute"));for(var r=0;r<4;r++)e.removeClass(this.el_,"vjs-vol-"+r);e.addClass(this.el_,"vjs-vol-"+n)}},e.MuteToggle.prototype.updateControlText_=function(){var e=this.player_.muted()||0===this.player_.volume()?"Unmute":"Mute";this.controlText()!==e&&this.controlText(e)},e.MuteToggle.prototype.controlText_="Mute"}},function(e,t,n){var i=n(11);e.exports=function(e){e.VolumePanel=e.Component.extend({init:function(t,n){n.inline=!1,void 0===n.volumeControl&&(n.volumeControl=n.volumeControl||{},n.volumeControl.vertical=!0),e.Component.call(this,t,n),this.on(t,["loadstart"],(function(e){this.volumePanelState_(e)})),this.on("mouseover",(function(e){this.handleMouseOver(e)})),this.on("mouseout",(function(e){this.handleMouseOut(e)})),this.volumeControl&&(this.on(this.volumeControl,["slideractive"],this.sliderActive_),this.on(this.volumeControl,["sliderinactive"],this.sliderInactive_))}}),e.VolumePanel.prototype.sliderActive_=function(){this.addClass("vjs-slider-active")},e.VolumePanel.prototype.sliderInactive_=function(){this.removeClass("vjs-slider-active")},e.VolumePanel.prototype.volumePanelState_=function(){this.volumeControl&&this.volumeControl.hasClass("vjs-hidden")&&this.muteToggle.hasClass("vjs-hidden")&&this.addClass("vjs-hidden"),this.volumeControl&&this.volumeControl.hasClass("vjs-hidden")&&!this.muteToggle.hasClass("vjs-hidden")&&this.addClass("vjs-mute-toggle-only")},e.VolumePanel.prototype.createEl=function(){return e.createEl("div",{className:"vjs-volume-panel vjs-control vjs-volume-panel-vertical"})},e.VolumePanel.prototype.handleMouseOver=function(e){this.addClass("vjs-hover")},e.VolumePanel.prototype.handleMouseOut=function(e){this.removeClass("vjs-hover")},i.isIos()||i.isIpad()||i.isAndroid()?e.VolumePanel.prototype.options_={children:{muteToggle:{}}}:e.VolumePanel.prototype.options_={children:{muteToggle:{},volumeControl:{}}}}},function(e,t,n){var i=n(11),r=n(12),o=function(e){r.verbose("[PlayerManager_Customize]",e)};e.exports=function(e,t){return{init:function(n){var a;if(a="init",r.debug("[PlayerManager_Customize]",a),e.options.isWaterfall&&e.options.vpaid&&(n.controlBar.hide(),e.options.firstAdAttempted&&n.bigPlayButton.hide()),o("disabling scrubbing"),n.controlBar.progressControl.seekBar.off("mousedown"),n.controlBar.progressControl.seekBar.off("touchstart"),n.controlBar.progressControl.seekBar.off("click"),o("setting initial audio"),"off"===e.options.initialAudio?(n.muted(!0),t.isMuted=!0):(n.muted(!1),t.isMuted=!1),o("setting initial playback"),"mouseover"===e.options.initialPlayback){var s=function(){t.play(),n.el().removeEventListener("mouseover",s)};n.el().addEventListener("mouseover",s)}o("setting aspect ratio"),e.options.maintainAspectRatio;if(!1!==e.options.showVolume&&e.displayVolumeControls()||(o("removing volume controls"),n.controlBar.volumeControl.dispose()),!1===e.options.showPlayToggle&&n.controlBar.playToggle.hide(),!1===e.options.showBigPlayButton&&n.bigPlayButton.hide(),!0===e.options.showMute&&(e.displayVolumeControls()||e.isAndroid())){o("setting mute functionality");var l=function(){t.isMuted?n.volume()>0&&t.explicitUnmute():t.explicitMute()};n.controlBar.muteToggle.on("click",l),n.controlBar.muteToggle.on("touchend",l)}else if(t.options.useMsSkin){o("setting mute functionality for MS skin"),n.controlBar.muteToggle.dispose();var d=function(){t.muteStateChangedByButton=!0,n.muted()?(t.isMuted=!1,t.explicitMute()):(t.isMuted=!0,t.explicitUnmute())};t.adVideoPlayer.player().on("volumechange",(function(){t.muteStateChangedByButton?t.muteStateChangedByButton=!1:t.isMuted?n.volume()>0&&t.explicitUnmute():0===n.volume()&&t.explicitMute()}));var c=n.controlBar.getChild("volumePanel");c&&(c.muteToggle.on("click",d),c.muteToggle.on("touchend",d))}else o("removing mute button"),n.controlBar.muteToggle.dispose();if(!0===e.options.showVolume&&e.displayVolumeControls()&&n.controlBar.volumeControl.volumeBar.on("mousedown",(function(){var e=n.volume();e<=0&&!t.isMuted&&(o("muting from volume scrubber"),t.explicitMute()),e>0&&t.isMuted&&(o("unmuting from volume scrubber"),t.explicitUnmute())})),i.isIos()&&e.options.enableNativeInline&&parseInt(i.getIOSVersion())>9&&"click"!==e.options.initialPlayback&&(n.muted(!0),n.controlBar.muteToggle.update()),"boolean"==typeof e.options.customButton.enabled&&!0===e.options.customButton.enabled){var u=e.options.playerSkin.controlBarHeight||30,p=Math.min(50,e.options.customButton.imgWidth),h=Math.min(u,e.options.customButton.imgHeight),f=Math.floor((u-h)/2),v="a";e.isMobile()&&(v="span");var m=e.videojsOrigin.createEl("div",{innerHTML:"<"+v+' href="'+e.options.customButton.url+'" target="_blank"><img style="height:'+h+"px;width:"+p+"px;margin-top:"+f+'px" class="home-button-image" src="'+e.options.customButton.imageSrc+'" alt="'+e.options.customButton.altText+'"></'+v+">",role:"button","aria-live":"polite",tabindex:"0"});m.style.cssText="float:right;font-family:VideoJS;font-size:1.5em;line-height:2;width:50px;height:100%;text-align:center",n.controlBar.addChild("button",{el:m}),n.controlBar.el().insertBefore(m,n.controlBar.fullscreenToggle.el())}n.controlBar.progressControl.seekBar.seekHandle.hide(),n.controlBar.progressControl.seekBar.el_.style.pointerEvents="none","boolean"==typeof e.options.showProgressBar?(!1===e.options.showProgressBar&&(o("removing progress bar"),n.controlBar.currentTimeDisplay.hide(),n.controlBar.timeDivider.hide(),n.controlBar.durationDisplay.hide()),n.controlBar.progressControl.seekBar.hide()):"text"===e.options.showProgressBar?(o("removing progress text"),n.controlBar.progressControl.seekBar.hide()):"bar"===e.options.showProgressBar&&(o("removing progress bar"),n.controlBar.currentTimeDisplay.hide(),n.controlBar.timeDivider.hide(),n.controlBar.durationDisplay.hide()),!1===e.options.allowFullscreen&&(o("removing fullscreen toggle"),n.controlBar.fullscreenToggle.addClass("vjs-hidden")),e.isMobile()&&!0===e.options.allowFullscreen&&!0===e.options.showMute&&(n.controlBar.fullscreenToggle.el().style.visibility="hidden",n.controlBar.muteToggle.el().style.visibility="visible"),e.options.targetElement.addEventListener("outstream-impression",(function(){e.isMobile()&&!0===e.options.allowFullscreen&&!0===e.options.showMute&&(n.controlBar.fullscreenToggle.el().style.visibility="visible",n.controlBar.muteToggle.el().style.visibility="visible")})),e.options.targetElement.addEventListener("vastplayer-impression",(function(){e.isMobile()&&!0===e.options.allowFullscreen&&!0===e.options.showMute&&(n.controlBar.fullscreenToggle.el().style.visibility="visible",n.controlBar.muteToggle.el().style.visibility="visible")}))}}}},function(e,t,n){var i=n(12);e.exports=function(e,t){return{init:function(n,r,o){var a;a="init",i.verbose("[PlayerManager_AdIndicator]",a);var s=e.videojsOrigin.createEl("div",{className:"vjs-ad-provider"});s.id="ad_provider","inline"!==e.options.learnMore.location&&(s.style["max-width"]="28%");var l=r.createElement("div");if(l.className="vjs-ad-indicator",l.dir="auto",l.innerHTML=e.adIndicatorTextContent,"inline"!==e.options.learnMore.location&&(l.style["max-width"]="98%"),s.appendChild(l),o&&e.options.learnMore.text&&0!==e.options.learnMore.text.trim().length){var d=r.createElement("div");switch(e.options.learnMore.location){case"top-left":d.className="vjs-ad-learnmore-tl";break;case"top-right":d.className="vjs-ad-learnmore-tr";break;default:d.className="vjs-ad-learnmore"}d.dir="auto",d.innerHTML=e.options.learnMore.text,"inline"===e.options.learnMore.location?s.appendChild(d):t.adVideoPlayer.el_.appendChild(d);var c=function(n){t.click(),e.isMobile()&&(n.stopPropagation(),n.preventDefault())};d.addEventListener("touchend",c),d.addEventListener("click",c)}t.adVideoPlayer.el_.appendChild(s)}}}},function(e,t,n){var i=n(12);e.exports=function(e,t){return{init:function(n,r,o,a,s){var l;l="init",i.verbose("[PlayerManager_AdIndicator]",l),o.id="ad_indicator_text",o.innerHTML=e.adIndicatorTextContent,o.className="top-bar-text",o.role="button";var d="3em";if(e.isMobile()&&(d="5em"),o.style["text-align"]="right",o.style["margin-right"]="1em",o.style["margin-left"]="1em",o.style["font-size"]="1em",o.style.right="0px",o.style.left="",o.style["line-height"]="24px",o.style.outline="0",o.style.position="absolute",o.style.padding="0",o.style.height="auto",o.style.width="auto",o.style["max-width"]="35%",o.style["white-space"]="nowrap",o.style.overflow="hidden",o.style["text-overflow"]="ellipsis",s?o.style.cursor="pointer":o.style["pointer-events"]="none",a.style["text-align"]="right",a.style["margin-right"]="1em",a.style["margin-left"]="1em",a.style["font-size"]="1em",a.style.right="0px",a.style.left="",a.style["line-height"]="3em",a.style.outline="0",a.style.position="absolute",a.style.padding="0",a.style.height=d,a.style["max-width"]="35%",a.style.width="auto",a.style["text-overflow"]="ellipsis",a.style["white-space"]="nowrap",a.style.overflow="hidden",a.style.display="none",s){a.style.cursor="pointer";var c=function(n){t.click(),e.isMobile()&&(n.stopPropagation(),n.preventDefault())};o.addEventListener("touchend",c),a.addEventListener("touchend",c),o.addEventListener("click",c),a.addEventListener("click",c)}else a.style["pointer-events"]="none";n.addChild("button",{el:a})}}}},function(e,t,n){var i=n(12),r=n(11),o=function(e){i.debug("[PlayerManager_Skip]",e)};e.exports=function(e,t){return{init:function(n,a,s,l,d,c){var u,p,h,f;if(o("init"),e.options.useMsSkin){var v=e.options.skippable.nonSkippableText,m=!(!v||0===v.trim().length);(h=d.contentWindow.document.createElement("div")).id="non_skippable_button",h.innerHTML=v,h.className="non-skippable-button",h.role="button",h.style["pointer-events"]="none",h.style.display="none"}if(!0===e.options.skippable.enabled){f="creating and styling skip buttons and skip texts",i.verbose("[PlayerManager_Skip]",f);var g=e.options.skippable.videoThreshold,y=e.options.skippable.skipText,b=e.options.skippable.skipButtonText;(u=d.contentWindow.document.createElement("div")).id="skip_button",e.options.useMsSkin&&(u.dir="auto"),u.innerHTML=b,u.className="top-bar-text",u.role="button";var A="";e.isMobile()&&(A="5.0em"),u.style.display="none",u.style.cursor="pointer",u.style["font-weight"]="bold",u.style["margin-right"]="1em",u.style["margin-left"]="1em",u.style["font-size"]="1em",u.style.right="",u.style.left="0px",u.style["line-height"]="24px",u.style.outline="0",u.style.position="absolute",u.style.padding="0",u.style.height=A,u.style.width="auto",u.style["min-width"]="5em",u.style["text-align"]="left",e.floatingSkipButton=e.videojsOrigin.createEl("div",{className:"top-bar-text",role:"button",innerHTML:b}),e.floatingSkipButton.style.display="none",e.floatingSkipButton.style.cursor="pointer",e.floatingSkipButton.style["font-weight"]="bold",e.floatingSkipButton.style["margin-right"]="1em",e.floatingSkipButton.style["margin-left"]="1em",e.floatingSkipButton.style["font-size"]="1em",e.floatingSkipButton.style.right="",e.floatingSkipButton.style.left="0px",e.floatingSkipButton.style["line-height"]="3em",e.floatingSkipButton.style.outline="0",e.floatingSkipButton.style.position="absolute",e.floatingSkipButton.style.padding="0",e.floatingSkipButton.style.height=A,e.floatingSkipButton.style["min-width"]="5em",e.floatingSkipButton.style.width="auto",e.floatingSkipButton.style.display="none",e.floatingSkipButton.style["text-align"]="left",l.addChild("button",{el:e.floatingSkipButton}),e.options.useMsSkin&&(y=y.replace("%%TIME%%","<b>%%TIME%%</b>"),e.floatingSkipButton.dir="auto");var w=function(n){if(o("SKIP clicked, destroying player"),e.options.vpaid)return l.trigger("skip"),void(e.isMobile()&&(n.stopPropagation(),n.preventDefault(),e.options.overlayPlayer&&t.destroy()));t.destroy(),e.isMobile()&&(n.stopPropagation(),n.preventDefault(),t.isCompleted=!0)};switch(e.isMobile()&&(u.addEventListener("touchend",w),e.floatingSkipButton.addEventListener("touchend",w),e.floatingSkipButton.addEventListener("mousedown",(function(e){e.preventDefault()}))),u.addEventListener("click",w),e.floatingSkipButton.addEventListener("click",w),e.floatingAdSkipText=e.videojsOrigin.createEl("div",{className:"top-bar-text",role:"button",innerHTML:""}),e.floatingAdSkipText.style["margin-left"]="1em",e.floatingAdSkipText.style["margin-right"]="1em",e.floatingAdSkipText.style.right="",e.floatingAdSkipText.style.left="0px",e.floatingAdSkipText.style["font-size"]="1em",e.floatingAdSkipText.style["line-height"]="3em",e.floatingAdSkipText.style.outline="0",e.floatingAdSkipText.style.position="absolute",e.floatingAdSkipText.style["text-align"]="left",e.floatingAdSkipText.style.padding="0",e.floatingAdSkipText.style.height="3em",e.floatingAdSkipText.style.width="auto",e.floatingAdSkipText.style["pointer-events"]="none",e.floatingAdSkipText.style.display="none",l.addChild("button",{el:e.floatingAdSkipText}),(p=d.contentWindow.document.createElement("div")).id="ad_skip_text",e.options.useMsSkin&&(p.dir="auto"),p.innerHTML=b,p.className="top-bar-text",p.role="button",p.style["margin-left"]="1em",p.style["margin-right"]="1em",p.style.right="",p.style.left="0px",p.style["font-size"]="1em",p.style["line-height"]="24px",p.style.outline="0",p.style.position="absolute",p.style["text-align"]="left",p.style.padding="0",p.style.height="3em",p.style.width="auto",p.style["pointer-events"]="none",p.style.display="none",e.options.skippable.skipLocation){case"top-right":u.style.right="0px",u.style.left="",u.style["text-align"]="right",p.style.right="0px",p.style.left="",e.floatingSkipButton.style.right="0px",e.floatingSkipButton.style.left="",e.floatingSkipButton.style["text-align"]="right",e.floatingAdSkipText.style.right="0px",e.floatingAdSkipText.style.left=""}var T=!1,k=!1,E=!1,S={},C=function(){var n,i=Math.round(l.player().currentTime()),o=Math.round(l.player().duration()),a=(n=t.options.skippable.allowOverride?Math.round(e.options.data.skipOffsetMsec/1e3):e.options.skippable.videoOffset)-i,d=!e.options.skippable.allowOverride||e.options.data.isVastVideoSkippable;if(d=!(n>o||g>o)&&d,t.test("VIDLA163_needToShowSkip",d),!e.options.disableTopBar&&d||e.options.useMsSkin&&d){var f="native"===e.options.adType||"preview"===e.options.adType;a>0&&(!t.startedReplay&&!t.isEnded||f)?(e.floatingAdSkipText.innerHTML=y.replace("%%TIME%%",a),u.style.display="none",p.innerHTML=y.replace("%%TIME%%",a),p.style.display="block",e.options.useMsSkin&&(c.classList.remove("vjs-hidden"),c.style.cursor="default"),!e.options.useMsSkin&&r.elementsOverlap(p,s)&&(p.style.display="none")):(e.readyForSkip||(t.test("log",i),t.test("VIDLA163_skip",i)),e.readyForSkip=!0,t.isFullscreen&&!e.pendingFullscreenExit&&(e.floatingAdSkipText.style.display="none",e.floatingSkipButton.style.display="block"),p.style.display="none",u.style.display="block",e.options.useMsSkin&&(c.style.cursor="pointer",c.addEventListener("mouseover",(function(e){c.style.border="1px solid rgba(255, 255, 255, 0.9)"})),c.addEventListener("mouseout",(function(e){c.style.border="1px solid rgba(255, 255, 255, 0.5)"}))),f&&Math.abs(o-i)<.1&&(u.style.display="none",e.options.useMsSkin&&(c.style.display="none")))}e.options.useMsSkin&&!d&&m&&(c.classList.remove("vjs-hidden"),h.style.display="block",c.style.cursor="default")};l.on("resize",(function(){C()})),l.on("timeupdate",(function(){var n=t.options.data.vastProgressEvent;if(!e.options.isWaterfall||!e.options.vpaid||e.options.vpaidImpressionFired){var i=1e3*Math.round(l.player().currentTime());if(l.player().duration()){if(n&&"object"==typeof n){var r=function(){t.test("VIDLA163_Tracking",S)};for(var o in n){var a=n[o];if("number"==typeof a&&a>=0&&i>=a&&-1===Object.keys(S).indexOf(o)){S[o]=a;var s={};s.name=o,s.name&&t.dispatchEventToAdunit(s,r)}}}C()}}}))}if(!e.options.skippable.enabled&&e.options.useMsSkin&&m&&(c.classList.remove("vjs-hidden"),h.style.display="block",c.style.cursor="default"),e.options.skippable&&e.options.skippable.skipLocation)switch(e.options.skippable.skipLocation){case"top-right":s.style.right="",s.style.left="0px",a.style.right="",a.style.left="0px"}!e.options.disableTopBar&&n&&(!0===e.options.skippable.enabled&&(n.appendChild(u),n.appendChild(p)),n.appendChild(s)),e.options.useMsSkin&&c&&(e.options.skippable.enabled&&(c.appendChild(u),c.appendChild(p)),c.appendChild(h)),l.on("timeupdate",(function(){if(!(e.options.vpaid||"preview"===e.options.adType&&t.isSkipped)){var n=Math.round(l.player().currentTime()),i=l.player().duration();if(i){var r=i/4*2,o=i/4*3;!T&&n>=i/4&&n<r&&(e.dispatchEventToAdunit({name:"video-first-quartile"}),T=!0),!k&&n>=r&&n<o&&(e.dispatchEventToAdunit({name:"video-mid"}),k=!0),!E&&n>=o&&(e.dispatchEventToAdunit({name:"video-third-quartile"}),E=!0)}}}))}}}},function(e,t,n){var i=n(12),r=function(e){i.debug("[PlayerManager_EndCardSetup]",e)},o=n(35);e.exports=function(e,t){return{init:function(n){if(r("init"),e.options.endCard.enabled){var i=e.options.endCard;if(i.showDefaultButtons){for(var a=-1,s=0;s<i.buttons.length;s++)if("replay"===i.buttons[s].type){a=s;break}e.options.disableCollapse.replay?a<0&&i.buttons.splice(0,0,{type:"replay"}):a>=0&&i.buttons.splice(a,1)}r("Creating EndCard."),t.endCard=new o(i,n,t)}}}}},function(e,t,n){var i=n(36),r=n(12),o=function(e){r.debug("[EndCard]",e)},a=function(e,t,n){this.layers=[],this.buttons=[],this.options=e,this.vjsPlayer=t,this.playerManager=n,this.firedCreativeView=!1,this.onLayerClick=function(e){e.stopPropagation(),e.target===e.currentTarget&&n.click()},e.layers=[{type:"videoAd"}],e.layers.push({type:"color",width:"100%",height:"100%",color:e.color}),e.layers.push({type:"companionAd"}),e.layers.push({type:"image",width:e.imageWidth,height:e.imageHeight,imageUrl:e.imageUrl}),this.createEndCardContainer(t.player().el_),this.createLayers(),this.createButtons()};a.prototype.styleForCentering=function(e,t,n){e.style.display="block",e.style.position="absolute",e.style.top=0,e.style.bottom=0,e.style.left=0,e.style.right=0,e.style.margin="auto",e.style.maxWidth=t||"100%",e.style.maxHeight=n||"100%",t&&(e.style.width=t),n&&(e.style.height=n)},a.prototype.styleSizeLimitScaleDown=function(e,t,n){var i=this,r=e.elem,o=function(){t=t||i.endCardElem.offsetWidth,n=n||i.endCardElem.offsetHeight;var a=r.offsetWidth,s=r.offsetHeight;if(t&&n&&a&&s){var l;if(t/n<a/s)r.style.width="100%",l=s/(n*(a/t)),r.style.height=100*l+"%";else r.style.height="100%",l=a/(t*(s/n)),r.style.width=100*l+"%";e.opts.width||(r.style.maxWidth=r.naturalWidth),e.opts.height||(r.style.maxHeight=r.naturalHeight)}else setTimeout(o,5)};o()},a.prototype.selectEndCardCompanion=function(){if(Array.isArray(this.options.companionAds)&&0!==this.options.companionAds.length){var e=this.vjsPlayer.player().el_,t=this.playerManager.options.width,n=this.playerManager.options.height;e&&(e.offsetWidth&&(t=e.offsetWidth),e.offsetHeight&&(n=e.offsetHeight));var i,r,a,s,l,d,c,u,p=t*n;o("Selecting best companion for ad unit size ("+t+"x"+n+"):"),r=99999999;for(var h=0;h<this.options.companionAds.length;h++){if(d=(s=this.options.companionAds[h]).width||1,c=s.height||1,s.hasOwnProperty("StaticResource")&&0===s.StaticResource.type.indexOf("image"))u="StaticImageCompanion";else{if(!s.hasOwnProperty("HTMLResource")){o("xxx Skipping Companion: ["+h+"] - Resource type is neither a static image nor HTML.");continue}u="HtmlCompanion"}if("StaticImageCompanion"===u)d>t&&(d*=a=t/d,c*=a),c>n&&(d*=a=n/c,c*=a);else if(d>t||c>n){o("xxx Skipping Companion: ["+h+"] - Companion size ("+d+"x"+c+") won't fit in ad unit.");continue}(l=Math.abs(d*c-p))<r?(r=l,i=s,this.CompanionAdType=u,o("*** Selecting Companion: ["+h+"] size ("+d+"x"+c+"), areaDiff="+r)):o("xxx Discarding Companion: ["+h+"] size ("+d+"x"+c+"), areaDiff="+l)}return i}o("No companion ads found.")},a.prototype.prepareCompanionLayers=function(e){for(var t=this,n=0,o=1,a=function(e){if("requestTracking"===e.command&&"creative-view"===e.data){if(t.firedCreativeView)return;t.firedCreativeView=!0}t.options.companionCallback&&t.options.companionCallback(e)},s=0;s<this.layers.length;s++){var l=this.layers[s];if("companionAd"===l.opts.type&&!l.companionManager){var d=function(s){if(t.playerManager.isFullscreen)return l="Delaying companion selection since we are in "+(t.playerManager.isFullscreen?"fullscreen":"sidestream")+" mode.",r.verbose("[EndCard]",l),void setTimeout(d,100,s);var l;if(s.companionAd=t.selectEndCardCompanion(),s.companionAd){var c={companionContainers:[s.elem]},u={companions:[s.companionAd]};s.elem.style.width=s.opts.width=s.companionAd.width,s.elem.style.height=s.opts.height=s.companionAd.height,s.elem.style.maxWidth="",s.elem.style.maxHeight="",setTimeout((function(){if(s.companionManager=i.renderCompanions(u,c,a),t.styleForCentering(s.elem,s.companionAd.width,s.companionAd.height),"StaticImageCompanion"===t.CompanionAdType){var e=s.elem.childNodes.item(0);e&&(e.style.width="100%",e.style.height="100%"),t.styleSizeLimitScaleDown(s)}s.companionAd.hasOwnProperty("StaticResource")&&!s.companionAd.CompanionClickThrough&&(s.elem.style["pointer-events"]="none",s.elem.style.cursor=t.options.clickable?"pointer":"default","StaticImageCompanion"!==t.CompanionAdType||t.options.clickable||(s.elem.childNodes.item(0).style.cursor="default"))}),50),n++}else s.elem.style.display="none";0==--o&&e&&e(n)};o++,d(l)}}0==--o&&e&&e(n)},a.prototype.onVideoResized=function(e,t){for(var n=0;n<this.layers.length;n++){var i=this.layers[n];i.companionAd?"StaticImageCompanion"!==this.CompanionAdType&&(i.companionAd.width>e||i.companionAd.height>t?i.elem.style.display="none":i.elem.style.display="block"):"image"===i.type&&i.elem.style}},a.prototype.saveSetStyle=function(e,t,n){void 0!==n&&(e.styleSave||(e.styleSave={}),e.elem&&(void 0===e.styleSave[t]&&(e.styleSave[t]=e.elem.style[t]),e.elem.style[t]=n))},a.prototype.restoreStyle=function(e){if(e.styleSave){if(e.elem)for(var t in e.styleSave)e.elem.style[t]=e.styleSave[t];delete e.styleSave}},a.prototype.createEndCardContainer=function(e){this.endCardElem||(this.endCardElem=e.ownerDocument.createElement("div"),e.appendChild(this.endCardElem),this.endCardElem.className="video-js vjs-default-skin vjs-controls-enabled vjs-big-play-centered vjs-has-started vjs-paused vjs-ended vjs-user-active",this.playerManager.isIosInlineRequired()?(this.endCardElem.style["background-color"]="",this.endCardElem.style.background=this.playerManager.options.playerSkin.videoBackgroundColor,this.endCardElem.style.opacity=1):this.endCardElem.style["background-color"]="rgba(0,0,0,0)",this.endCardElem.setAttribute("name","endCardContainer"),this.endCardElem.style.width="100%",this.endCardElem.style.height="100%",this.endCardElem.style.display="none",this.endCardElem.style.cursor=this.options.clickable?"pointer":"default",this.endCardElem.style.position="relative",this.endCardElem.style["text-align"]="center",this.options.clickable&&(this.endCardElem.onclick=this.onLayerClick))},a.prototype.createImageLayer=function(e,t){var n={},i=e.ownerDocument.createElement("img");e.appendChild(i),i.setAttribute("name","ecImageLayer"),i.id=t.id||"endCardImageLayer",i.setAttribute("src",t.imageUrl||""),i.style.cursor=this.options.clickable?"pointer":"default",this.styleForCentering(i,t.width,t.height),i.style.display="none",n.elem=i,n.opts=t,this.layers.push(n)},a.prototype.createColorLayer=function(e,t){var n={},i=e.ownerDocument.createElement("div");e.appendChild(i),i.setAttribute("name","ecColorLayer"),i.id=t.id||"endCardColorLayer",i.style["background-color"]=t.color||"black",i.style.cursor=this.options.clickable?"pointer":"default",this.styleForCentering(i,t.width||"100%",t.height||"100%"),t.color||(i.style.display="none"),n.elem=i,n.opts=t,this.layers.push(n)},a.prototype.createAdVideoLayer=function(e,t){if(void 0===this.videoLayer){var n={};n.elem=e,n.opts=t,e&&this.playerManager.isIosInlineRequired()&&(n.videoParent=e.parentElement,n.videoSibling=e.nextSibling),this.videoLayer=this.layers.length,this.layers.push(n)}else o("Can't create new video layer because one already exists!")},a.prototype.createCompanionLayer=function(e,t){var n={},i=e.ownerDocument.createElement("div");e.appendChild(i),i.setAttribute("name","ecCompanionLayer"),i.id="endCardCompanionLayer",i.style.position="absolute",i.style.width=t.width||"100%",i.style.height=t.height||"100%",this.styleForCentering(i),i.style["background-color"]="rgba(0,0,0,0)",n.elem=i,n.opts=t,this.layers.push(n)},a.prototype.show=function(){if(this.vjsPlayer&&this.vjsPlayer.controlBar&&this.vjsPlayer.controlBar.hide(),void 0!==this.videoLayer){var e=this.layers[this.videoLayer],t=this.options.layers[this.videoLayer];e.elem&&(e.videoParent&&(this.videoLayer<this.layers.length-1?this.endCardElem.insertBefore(e.elem,this.layers[this.videoLayer+1].elem):this.buttonContainer?this.endCardElem.insertBefore(e.elem,this.buttonContainer):this.endCardElem.appendChild(e.elem)),this.playerManager.isIosInlineRequired()&&(this.endCardElem.style.width=e.elem.style.width,this.endCardElem.style.height=e.elem.style.height)),e.styleSave={},t.width&&this.saveSetStyle(e,"width",t.width),t.height&&this.saveSetStyle(e,"height",t.height),this.options.clickable?(this.saveSetStyle(e,"cursor","pointer"),this.saveSetStyle(e,"pointer-events","auto"),this.playerManager.options.learnMore.enabled&&e.elem.addEventListener("click",this.onLayerClick)):(this.saveSetStyle(e,"cursor","default"),this.saveSetStyle(e,"pointer-events","none")),this.playerManager.isIosInlineRequired()&&(this.endCardElem.style.width=e.elem.style.width,this.endCardElem.style.height=e.elem.style.height)}var n=this;this.prepareCompanionLayers((function(e){for(var t=0;t<n.layers.length;t++){var i=n.layers[t];"videoAd"!==i.opts.type&&"companionAd"!==i.opts.type&&("image"===i.opts.type&&(e>0?i.elem.style.display="none":i.opts.imageUrl&&(n.styleSizeLimitScaleDown(i),i.elem.style.display="block")),n.options.clickable&&i.elem&&(i.elem.addEventListener("click",n.onLayerClick),i.elem.style.cursor="pointer"))}})),this.endCardElem.style.display="block"},a.prototype.hide=function(){if(void 0!==this.videoLayer){var e=this.layers[this.videoLayer];this.restoreStyle(e),e.videoParent&&e.videoParent.insertBefore(e.elem,e.videoSibling)}for(var t=0;t<this.layers.length;t++){var n=this.layers[t];("videoAd"!==n.opts.type||this.options.clickable&&this.playerManager.options.learnMore.enabled)&&("companionAd"!==n.opts.type?this.options.clickable&&n.elem&&n.elem.removeEventListener("click",this.onLayerClick):n.companionManager&&(i.stopCompanions(n.companionManager),delete n.companionManager))}this.vjsPlayer&&this.vjsPlayer.controlBar&&this.vjsPlayer.controlBar.show(),this.endCardElem.style.display="none"},a.prototype.createLayers=function(){var e=this.options.layers;if(Array.isArray(e)&&!(e.length<0))for(var t=0;t<e.length;t++){var n=e[t],i=n.type||"color";switch(i){case"color":this.createColorLayer(this.endCardElem,n);break;case"image":this.createImageLayer(this.endCardElem,n);break;case"videoAd":if(this.playerManager.isIosInlineRequired()){o("iOS inline player using canvas in place of video element");var r=this.endCardElem.ownerDocument.getElementsByTagName("canvas");this.createAdVideoLayer(r[0],n)}else this.vjsPlayer&&this.vjsPlayer.tag&&this.createAdVideoLayer(this.vjsPlayer.tag,n);break;case"companionAd":this.options.companionAds?this.createCompanionLayer(this.endCardElem,n):o("Companion ad layer specified but no companion ads were found.");break;default:o("Invalid endCard layer type: "+i)}}},a.prototype.createButtonContainer=function(){this.buttonContainer||(this.buttonContainer=this.endCardElem.ownerDocument.createElement("div"),this.endCardElem.appendChild(this.buttonContainer),this.buttonContainer.setAttribute("name","ecButtonContainer"),this.buttonContainer.id="endCardButtonContainer",this.buttonContainer.style.cursor="default",this.buttonContainer.style["background-color"]="rgba(0,0,0,0.5)",this.buttonContainer.style.display="block",this.buttonContainer.style.position="absolute",this.buttonContainer.style.left="50%",this.buttonContainer.style.top="50%",this.buttonContainer.style.transform="translate(-50%, -50%)",this.buttonContainer.style["font-size"]="14px",this.buttonContainer.style["text-align"]="left")},a.prototype.addButton=function(e,t,n,i){var r=this.buttonContainer.ownerDocument.createElement("div"),o=this.buttonContainer.ownerDocument.createElement("span"),a=this.buttonContainer.ownerDocument.createElement("span");r.className="ec-button "+e,r.id="ec-button-"+n,i&&r.addEventListener("click",i),o.textContent="",a.textContent=t,a.style["margin-left"]="6px",r.appendChild(o),r.appendChild(a),this.buttonContainer.appendChild(r)},a.prototype.createButtons=function(){var e=this.options.buttons;if(Array.isArray(e)&&!(e.length<1)){var t=this,n=function(e){e.stopPropagation(),t.hide(),t.vjsPlayer.currentTime(0),t.vjsPlayer.trigger("revealControls"),t.playerManager.replay()},i=function(e){e.stopPropagation(),t.playerManager.click()};this.createButtonContainer();for(var r=0;r<e.length;r++){var a=e[r],s=a.type;switch(s){case"replay":this.addButton("vjs-big-play-button-replay",a.text||"Replay",s,n);break;case"learnMore":this.addButton("vjs-ec-button-learnmore",a.text||"Learn More",s,i);break;default:o("Invalid endCard button type: "+s)}}}},e.exports=a},function(e,t,n){var i=n(37),r=n(12),o="CompanionsHandler > ",a=function(e,t,i,r,o){var a=e,s=r,l=o,d={width:t,height:i},c=(new Date).getTime()+Math.floor(1e4*Math.random());l({command:"addTrackingEvents",uniqueId:c,data:s});var u=function(){s.CompanionClickTracking&&l({command:"requestTracking",uniqueId:c,data:"companion-click"}),s.hasOwnProperty("StaticResource")&&s.CompanionClickThrough&&window.open(s.CompanionClickThrough)},p=function(){s.TrackingEvents&&s.TrackingEvents.length>0&&l({command:"requestTracking",uniqueId:c,data:"creative-view"})},h=!0;if(s.hasOwnProperty("StaticResource")){var f=s.StaticResource.type;if("application/x-javascript"===f){var v=document.createElement("script");v.src=s.StaticResource.src,v.onload=p(),a.appendChild(v)}else if(0===f.indexOf("image")){var m=document.createElement("img");m.src=s.StaticResource.src,m.style.maxWidth="100%",m.style.maxHeight="100%",m.style.width="auto",m.style.height="auto",m.style.margin="auto",m.style.display="block",m.style.top=0,m.style.bottom=0,m.style.left=0,m.style.right=0,m.style.position="absolute",m.onload=p(),m.onclick=u,h=!1,m.style.cursor="pointer",a.innerHTML="",a.style.position||(a.style.position="relative"),a.appendChild(m)}}else if(s.hasOwnProperty("IFrameResource")){var g=document.createElement("iframe");g.src=s.IFrameResource,g.scrolling="no",g.style.width="100%",g.style.height="100%",g.style.border="none",g.style.overflow="hidden",g.onload=p(),h=!1,a.innerHTML="",a.appendChild(g)}else if(s.hasOwnProperty("HTMLResource")){if(0===s.HTMLResource.indexOf("http"))n(41).load(s.HTMLResource,(function(e,t){e||0===t.length||(a.style.display="inline-block",a.style.position||(a.style.position="relative"),a.innerHTML=t,p())}));else a.style.display="inline-block",a.style.position||(a.style.position="relative"),a.innerHTML=s.HTMLResource,p()}h&&(s.hasOwnProperty("StaticResource")&&s.CompanionClickThrough&&(a.style.cursor="pointer"),a.onclick=u),this.stop=function(){"concurrent"===s.renderingMode&&(a.innerHTML="")},this.getData=function(){return{container:a,companionData:s,size:d}}},s=function(e,t,n){var s=e,l=t,d=n,c=[];r.always(o,"Version: 0.1.13");for(var u=[],p=0;p<l.companionContainers.length;p++)try{var h=window.getComputedStyle(l.companionContainers[p],null),f={id:p,width:parseInt(h.width),height:parseInt(h.height),companion:null};u.push(f)}catch(e){}for(i.selectCompanionsForContainers(s,u),p=0;p<u.length;p++)if(u[p].companion){var v=new a(l.companionContainers[p],u[p].width,u[p].height,u[p].companion,d);c.push(v)}this.stop=function(){for(p=0;p<c.length;p++)c[p].stop();c.length=0},this.getCompanionsData=function(){var e=[];for(p=0;p<c.length;p++)e.push(c[p].getData());return e}};e.exports={renderCompanions:function(e,t,n){return r.log(o,"renderCompanions called."),new s(e,t,n)},stopCompanions:function(e){e&&e.stop()},parse:function(e){return function(e){if(0===e.length)return r.warn(o,"parseCompanions > empty companions xml"),null;"<CompanionAds"!==(e=function(e){var t=e.indexOf("<"),n=e.substr(-1===t?0:t);return-1!==(t=n.lastIndexOf(">"))&&(n=n.substr(0,t+1)),n.trim()}(e)).substr(0,13)&&(e="<CompanionAds>"+e+"</CompanionAds>");var t=null;if(void 0!==window.DOMParser){if("parsererror"===(t=(new DOMParser).parseFromString(e,"text/xml")).documentElement.nodeName){try{r.error(o,"parseCompanions > Error reason = "+t.documentElement.childNodes[0].nodeValue)}catch(e){}return r.warn(o,"parseCompanions > invalide xml structure"),null}}else{if(void 0===window.ActiveXObject)return r.error(o,"parseCompanions > Failed to parse vast xml by window.ActiveXObject(Microsoft.XMLDOM)"),null;try{if((t=new window.ActiveXObject("Microsoft.XMLDOM")).loadXML(e),0!==t.parseError.errorCode)return r.error(o,t.parseError),null}catch(e){return r.error(o,"parseCompanions > Failed to parse vast xml by window.ActiveXObject(Microsoft.XMLDOM)",e),null}}return t?n(42).parse(t):(r.error(o,"parseCompanions > invalid xml structure"),null)}(e)}}},function(e,t,n){var i=["video/mp4","video/webm","video/ogg","video/x-ms-wmv","video/x-msvideo","video/mpeg","video/quicktime","video/3gpp","video/3gpp2","video/x-m4v","application/javascript","application/x-javascript"],r=["audio/mpeg","audio/mp4","audio/ogg","audio/x-pn-realaudio","application/javascript","application/x-javascript"],o=[],a=0,s=n(38),l=n(12),d="Rendition Manager > ";function c(e,t){var n;if(t){for(n=0;n<r.length;n++)if(e===r[n])return!0}else for(n=0;n<i.length;n++)if(e===i[n])return!0;return!1}function u(e,t){for(var n=[],i=-1,r=0;r<o.length;r++)o[r].width>=e&&(-1===i||i>=o[r].width-e)&&(i>o[r].width-e&&(n.length=0),n.push(o[r]),i=o[r].width-e);if(n.length>0)o.length=0,o=n.slice();else{for(r=0;r<o.length;r++)o[r].width<e&&(-1===i||i>=e-o[r].width)&&(i>e-o[r].width&&(n.length=0),n.push(o[r]),i=e-o[r].width);n.length>0&&(o.length=0,o=n.slice())}if(1!==o.length){for(n.length=0,i=-1,r=0;r<o.length;r++)o[r].height>=t&&(-1===i||i>=o[r].height-t)&&(i>o[r].height-t&&(n.length=0),n.push(o[r]),i=o[r].height-t);if(n.length>0)o.length=0,o=n.slice();else{for(r=0;r<o.length;r++)o[r].height<t&&(-1===i||i>=t-o[r].height)&&(i>t-o[r].height&&(n.length=0),n.push(o[r]),i=t-o[r].height);n.length>0&&(o.length=0,o=n.slice())}}}function p(e){for(var t=[],n=-1,i=0;i<o.length;i++)o[i].bitrate<=e&&(-1===n||n>=e-o[i].bitrate)&&(n>e-o[i].bitrate&&(t.length=0),n=e-o[i].bitrate,t.push(o[i]));if(t.length>0)o.length=0,o=t.slice();else for(i=0;i<o.length;i++)o[i].bitrate>=e&&(-1===n||n>=o[i].bitrate-e)&&(n>o[i].bitrate-e&&(t.length=0),n=o[i].bitrate-e,t.push(o[i]));if(1===t.length||0===a)return t[0];if(1===a){for(i=0;i<t.length;i++)return t[i].type.toLowerCase(),t[i];return null}return t[0]}function h(e){return e?(e.requiredPlayer=1,e.success=!0,l.info(d,"Selected rendition: ",e),e):(l.error(d,"Failed to select rendition"),{success:!1,errorCode:403})}function f(e,t,n,i){var r=function(e,t,n){for(var i=null,r=[],a=0;a<o.length;)!o[a].apiFramework||o[a].apiFramework.toLowerCase().indexOf("vpaid")<0?(r.push(o[a]),o.splice(a,1)):a++;if(o.length>0){if(1===o.length)return o[0];u(e,t),i=1===o.length?o[0]:p(n)}return null===i&&(o=r.slice()),i}(e,t,n);return r?(r.type.toLowerCase(),l.info(d,"VPAID selected"),r):(a=1,0===o.length?null:1===o.length?(o[0].type.toLowerCase(),o[0]):(u(e,t),1===o.length?(l.log(d,"Rendition selected by size"),o[0].type.toLowerCase(),o[0]):(l.log(d,"Try select rendition by bitrate"),p(n))))}function v(e,t,n,i){i.playerTechnology=["html5"],a=1,function(e){for(var t=0;t<o.length;)c(o[t].type.toLowerCase(),e)?t++:o.splice(t,1)}(i.onlyAudio);var r,u=function(e){if(e&&e>0)return l.info(d,"Selected bitrate (not from cache): "+e),e;var t=1;try{var n=s.getGenericData("anxBandwidth");n?(t=n,l.info(d,"Selected bitrate (from cache): "+t)):l.info(d,"No bitrate data present in cache (use bitrate 1)")}catch(e){l.warn(d,"Exception during getting bitrate from cache (use bitrate 1)")}return t}(n),p=o.slice();o.length=0;for(var v=0;v<p.length;v++)o.push(p[v]);return l.log(d,"HTML5 rendition count = "+o.length),o.length>0&&(r=f(e,t,u))?h(r):h(null)}function m(e,t){for(var n=[],i=0;i<o.length;i++)o[i].width===e&&o[i].height===t&&n.push(o[i]);o.length=0,n.length>0&&(o=n.slice())}function g(e,t){for(var n=0;n<e.length;n++)if(e[n].id===t){e.splice(n,1);break}}e.exports={init:function(e){o=function(e){for(var t=[],n=0;n<e.length;n++){var i=e[n];i.hasOwnProperty("type")&&(i.hasOwnProperty("width")||(i.width=0),i.hasOwnProperty("height")||(i.height=0),i.hasOwnProperty("bitrate")||(i.bitrate=2147483647),t.push(i))}return t}(e)},getUrl:function(e,t,n,i){return v(e,t,n,i)},selectCompanionsForContainers:function(e,t){!function(e,t){if(e&&0!==e.companions.length&&t&&0!==t.length){o=[];for(var n=0;n<e.companions.length;n++){var i,r=e.companions[n];try{i=Object.assign({},r)}catch(e){try{var a=JSON.stringify(r);i=JSON.parse(a)}catch(e){continue}}i.id=n,i.type="unknown",r.hasOwnProperty("StaticResource")&&(i.type=r.StaticResource.type),o.push(i)}if(0!==o.length){var s=o.slice();for(n=0;n<t.length&&s.length>0;n++){var c=t[n];if(o.length=0,o=s.slice(),m(c.width,c.height),1!==o.length)if(0!==o.length){for(var u=!1,p=0;p<o.length;p++)if(o[p].apiFramework&&o[p].apiFramework.toLowerCase().indexOf("vpaid")<0){l.log(d,"Companion rendition selected by apiFramework"),c.companion=o[p],g(s,c.companion.id),u=!0;break}u||(l.log(d,"First companion rendition selected"),c.companion=o[0],g(s,c.companion.id))}else l.log(d,"Companion rendition not selected for container"),c.companion=null;else l.log(d,"Companion rendition selected by size"),c.companion=o[0],g(s,c.companion.id)}}}}(e,t)}}},function(e,t,n){var i=n(39),r=24e5,o={},a=2;function s(e,t,n){switch(a){case 0:case 1:break;default:case 2:!function(e,t){o&&(o[e]=t)}(e,t)}}function l(e){switch(a){case 0:case 1:return null;default:case 2:return function(e){if(o)return o[e]}(e)}}function d(e){switch(a){case 0:case 1:break;default:case 2:!function(e){o&&delete o[e]}(e)}}function c(e){return"apn_"+e}i.debug("Using Cache Method "+a,"Cache Manager"),e.exports={setGenericData:function(e,t){if(void 0!==e&&void 0!==t){e="___appnexus_video_cachemanager_generic_data___"+e;try{return s(e,t),!0}catch(e){}}return!1},getGenericData:function(e){if(void 0!==e)return l(e="___appnexus_video_cachemanager_generic_data___"+e)},deleteGenericData:function(e){void 0!==e&&d(e="___appnexus_video_cachemanager_generic_data___"+e)},forceStorageMethod:function(e){a=e,i.debug("Forced usage of cache method "+a,"Cache Manager")},addAd:function(e,t){e&&function(e,t){var n={};n.timestamp=(new Date).getTime(),n.ad=e;try{s(t,JSON.stringify(n))}catch(e){}}(e,c(t))},getAd:function(e){return function(e){var t,n=(new Date).getTime();try{var i=l(e);t=i&&JSON.parse(i),d(e)}catch(e){}return t&&t.timestamp&&t.timestamp>0&&n-t.timestamp<=r?t.ad:null}(c(e))},clearAd:function(e){!function(e){try{d(e)}catch(e){}}(c(e))},setTimeToLive:function(e){r=6e4*e},getNextAdToken:function(){return e=(t=l("___appnexus_video_cachemanager_ad_token___"))?parseInt(t):0,s("___appnexus_video_cachemanager_ad_token___",e+=1),e;var e,t}}},function(e,t,n){var i=n(40);function r(e){if(e)return e.responseXML?e.responseXML:e.responseText}e.exports={debug:function(){i.handleLogDebugLegacySupport.apply(this,arguments)},logDebug:function(){i.handleLogDebugLegacySupport.apply(this,arguments)},setDebugLevel:function(e){i.setDebugLevel(e)},isNotEmpty:function(e){var t=!1;return null!==e&&e&&(t=e.length>0),t},objectToString:function(e,t){var n="null";if(t=void 0!==t?t:0,null!==e){n="OBJ[";var i="";for(var r in e){var o=e[r];if("object"==typeof o)if(++t<9)try{o=this.objectToString(o)}catch(e){o="err:"+e}else o="err: max recursion hit";i.length>0&&(i+=","),i+=r+"="+o}n+=i,n+="]"}return n},getRandomString:function(){return Math.random().toString(36).substring(2)},traceVastFromXhr:function(e,t){try{if(e)if(Array.isArray(e)){if(e.length>0){var n=[];for(var o in e)n.push(e[o].responseURL);var a=e[e.length-1];if(a){var s=r(a),l=a.responseURL;i.info(t,"Tag load chain:",n,"\n","Final Tag URL: ",l,"\n","Final Tag: ",s)}}}else{var d=r(e);i.info(t,"Tag URL:",e.responseURL,"\n","Tag:",d)}}catch(e){}}}},function(e,t){var n=0,i=0,r=0,o=!1;function a(e,t){try{if(void 0!==e&&d(e)&&console){var n=o?"[XandrVideo":"[APN",i=function(e){switch(e){case 0:break;case 1:return"always";case 2:return"error";case 3:return"warn";case 4:return"info";case 5:return"log";case 6:return"debug";case 7:return"verbose"}}(e);if(console[i]||(n+="-"+i,i="log"),n+="]",n+="["+function(){var e="";try{var t=new Date;e=t.getHours()+":"+t.getMinutes()+":"+t.getSeconds()+"."+t.getMilliseconds()}catch(e){}return e}()+"]",t.splice(0,0,n),console[i].apply)console[i].apply(console,t);else{var r=Array.prototype.slice.apply(t).join("");console[i](r)}}}catch(e){}}function s(e){try{var t="";try{t=window.top.location.search}catch(e){try{t=window.location.search}catch(e){}}var n=new RegExp("[\\?&]"+e+"=([^&#]*)").exec(t);return null===n?"":decodeURIComponent(n[1].replace(/\+/g," "))}catch(e){return""}}function l(e){var t=0;try{if(void 0!==e){var n=parseInt(e);isNaN(n)?"boolean"==typeof e?t=e?6:0:"TRUE"===(e=e.toUpperCase())?t=6:"FALSE"===e&&(t=0):t=n}}catch(e){}return t}function d(e){return e<=n}e.exports={traceAtLevel:function(){try{if(arguments.length>0){var e=arguments[0],t=Array.prototype.slice.call(arguments,1);a.call(this,e,t)}}catch(e){}},always:function(){try{a.call(this,1,Array.prototype.slice.call(arguments))}catch(e){}},error:function(){try{a.call(this,2,Array.prototype.slice.call(arguments))}catch(e){}},log:function(){try{a.call(this,5,Array.prototype.slice.call(arguments))}catch(e){}},warn:function(){try{a.call(this,3,Array.prototype.slice.call(arguments))}catch(e){}},info:function(){try{a.call(this,4,Array.prototype.slice.call(arguments))}catch(e){}},debug:function(){try{a.call(this,6,Array.prototype.slice.call(arguments))}catch(e){}},verbose:function(){try{a.call(this,6,Array.prototype.slice.call(arguments))}catch(e){}},handleLogDebugLegacySupport:function(e,t){try{!function(e,t,n){try{var i="[APN-"+e+"-"+(new Date).toISOString()+"] ";null!==n&&n&&n.length>0&&(i+=n+">"),i+=t,d(e)&&console.log(i)}catch(t){d(e)&&console.log(t)}}(5,e,t)}catch(e){}},setDebugLevel:function(e){try{!function(e){try{r=l(e),n=Math.max(Math.max(i,r),n)}catch(e){}}(e)}catch(e){}},isTraceLevelActive:function(e){try{return d(e)}catch(e){return!1}},TRACE_LEVEL_ALWAYS:1,TRACE_LEVEL_ERROR:2,TRACE_LEVEL_WARN:3,TRACE_LEVEL_INFO:4,TRACE_LEVEL_LOG:5,TRACE_LEVEL_DEBUG:6,TRACE_LEVEL_VERBOSE:6},function(){try{var e=s("xdr_debug").toUpperCase();e&&e.length>0?(i=l(e),o=!0):i=l(s("ast_debug").toUpperCase()),n=Math.max(i,n)}catch(e){}}()},function(e,t,n){var i=n(12);var r,o=(r=window.document.featurePolicy)&&r.allowedFeatures&&r.allowedFeatures().includes("attribution-reporting")?(i.log("Attribution reporting is SUPPORTED"),!0):(i.log("Attribution reporting is NOT SUPPORTED"),!1);function a(e,t,i,r,o,s){var l,d=0,c=0,u=!1,p=n(39),h=n(38),f=!0,v=function(e){p.logDebug(e,"URL Loader")};if(o&&void 0!==o.withCredentials&&(f=o.withCredentials),window.XMLHttpRequest)l=new XMLHttpRequest;else if(window.ActiveXObject)try{l=new ActiveXObject("Msxml2.XMLHTTP")}catch(e){try{l=new ActiveXObject("Microsoft.XMLHTTP")}catch(e){}}l?(l.onreadystatechange=function(){if(4===l.readyState)if(200===l.status){if(v("duration: "+c+", response length: "+l.responseText.length),u&&l.responseText&&l.responseText.length>2048){var e=8*l.responseText.length*1e3/(1024*Math.max(1,c)),t=parseInt(e.toString());v("Bandwidth: "+t);try{h.setGenericData("anxBandwidth",t)}catch(e){}}i&&i.call(this,void 0,l.responseText,l)}else l.status>=400&&l.status<600&&i&&i.call(this,l.status,"",l);else 2===l.readyState?d=(new Date).getTime():3===l.readyState&&d>0&&(u=!0,c=(new Date).getTime()-d)},l.onerror=function(){if(f){var n=o||{};n.withCredentials=!1,a(e,t,i,r,n,s)}else if(i){var d=0===l.status?"404":l.status.toString();i.call(this,d,"",l)}},l.ontimeout=function(){i&&i.call(this,"Timeout","",l)},l.open(s,e),r&&(l.timeout=r),l.withCredentials=f,d=0,"POST"===s?l.send(t):l.send()):i&&i.call(this,"406","")}e.exports={load:function(e,t,n,i){var r=!0;!1===i&&(r=!1),a(e,null,t,n,{withCredentials:r},"GET")},loadPost:function(e,t,n,i){a(e,t,n,i,{withCredentials:!0},"POST")},trackPixel:function(e,t){!function(e,t){if(i.log("Logging Event: "+t+" at url:"+e),"string"==typeof e)new Image(1,1).src=e;else if("object"==typeof e){var n;if(e.url)if(o)if("SINGLE-PING"===e.attributionType){i.log("Event = "+t+" SINGLE-PING empty attributionsrc"),n=new Image(1,1);try{n.setAttribute("attributionsrc","")}catch(e){}n.src=e.url}else if("DOUBLE-PING"===e.attributionType){var r=e.attributionSrc?e.attributionSrc:"";i.log("Event = "+t+" DOUBLE-PING attributionsrc = "+r),n=new Image(1,1);try{n.setAttribute("attributionsrc",r)}catch(e){}n.src=e.url}else new Image(1,1).src=e.url;else new Image(1,1).src=e.url}}(e,t)}}},function(e,t){var n={parse:function(e){var t={companions:[]},n=new function(){this.getSubNodes=function(e,t){var n=e.getElementsByTagName(t);return n.length>0?n:null},this.getSubNode=function(e,t,n){n||(n=0);var i=e.getElementsByTagName(t);return i.length>n?i[n]:null},this.getNodeValue=function(e){return 0===e.childNodes.length?"":e.childNodes[0].nodeValue.trim()},this.getNodeValues=function(e){if(0===e.childNodes.length)return"";for(var t="",n=0;n<e.childNodes.length;n++){t+=e.childNodes[n].nodeValue}return t.trim()},this.getNodeAttributeValue=function(e,t){var n=e.getAttribute(t);return null===n&&(n=""),n},this.getNodeAttributeNumberValue=function(e,t,n){n||(n=0);var i=n,r=this.getNodeAttributeValue(e,t);return r.length>0&&(i=r.indexOf(".")>=0?parseFloat(r):parseInt(r)),i},this.getNodeAttributeBooleanValue=function(e,t,n){n||(n=!1);var i=n,r=this.getNodeAttributeValue(e,t);r.length>0&&(i="t"===r.toLowerCase().charAt(0));return i},this.getSubNodeValue=function(e,t,n){n=void 0===n?"":n;var i=this.getSubNode(e,t);return null!==i?this.getNodeValue(i):n},this.getSubNodeWholeValue=function(e,t,n){n=void 0===n?"":n;var i=this.getSubNode(e,t);return null!==i?this.getNodeValues(i):n},this.getSubNodeBooleanValue=function(e,t,n){n=void 0===n?"false":n;var i=this.getSubNodeValue(e,t);return i.length>0&&"t"===i.toLowerCase().charAt(0)||!(i.length>0&&"f"===i.toLowerCase().charAt(0))&&n}},i=n.getSubNode(e,"CompanionAds"),r=n.getNodeAttributeValue(i,"required");r&&r.length>0&&(t.required=r);var o=n.getSubNodes(i,"Companion");if(o)for(var a=0;a<o.length;a++){var s=o[a],l={},d=n.getNodeAttributeNumberValue(s,"width",-1),c=n.getNodeAttributeNumberValue(s,"height",-1);if(!(d<=0||c<=0)){l.width=d,l.height=c;var u=n.getNodeAttributeValue(s,"id");u&&(l.id=u),(u=n.getNodeAttributeNumberValue(s,"assetWidth",-1))>0&&(l.assetWidth=u),(u=n.getNodeAttributeNumberValue(s,"assetHeight",-1))>0&&(l.assetHeight=u),(u=n.getNodeAttributeNumberValue(s,"expandedWidth",-1))>0&&(l.expandedWidth=u),(u=n.getNodeAttributeNumberValue(s,"expandedHeight",-1))>0&&(l.expandedHeight=u),(u=n.getNodeAttributeValue(s,"apiFramework"))&&(l.apiFramework=u),(u=n.getNodeAttributeValue(s,"adSlotId"))&&(l.adSlotId=u),(u=n.getNodeAttributeValue(s,"required"))&&(l.required=u),(u=n.getNodeAttributeValue(s,"renderingMode"))&&(l.renderingMode=u),(u=n.getSubNodeValue(s,"AltText"))&&(l.AltText=u),(u=n.getSubNodeValue(s,"AdParameters"))&&(l.AdParameters=u);var p,h,f,v=n.getSubNode(s,"StaticResource");if(v&&(u=n.getNodeAttributeValue(v,"creativeType"))){if("video/x-flv"===u||"video/x-f4v"===u||"video/f4v"===u||"application/x-shockwave-flash"===u)continue;var m={type:u};(u=n.getNodeValues(v))&&(m.src=u,l.StaticResource=m)}(u=n.getSubNodeWholeValue(s,"IFrameResource"))&&(l.IFrameResource=u),(u=n.getSubNodeWholeValue(s,"HTMLResource"))&&(l.HTMLResource=u),(u=n.getSubNodeValue(s,"CompanionClickThrough"))&&(l.CompanionClickThrough=u);var g=n.getSubNodes(s,"CompanionClickTracking");if(g)for(l.CompanionClickTracking=[],p=0;p<g.length;p++)h=g[p],(f=n.getNodeValues(h))&&l.CompanionClickTracking.push(f);var y=n.getSubNodes(s,"Tracking");if(y)for(l.TrackingEvents=[],p=0;p<y.length;p++){h=y[p];var b=n.getNodeAttributeValue(h,"event");f=n.getNodeValues(h),b&&f&&l.TrackingEvents.push({eventType:b,url:f})}t.companions.push(l)}}return t}};e.exports=n},function(e,t,n){var i=n(12),r=n(44),o=n(11),a=function(e){i.verbose("[PlayerManager_Destroy]",e)};e.exports=function(e,t){return{init:function(n){var s;s="init",i.debug("[PlayerManager_Destroy]",s),n.on("ended",(function(){!1===e.options.vpaid&&n.trigger("customDestroy")})),n.on("customDestroy",(function(){var i=function(e){var t,n=e.activeElement;if(n){if("IFRAME"===n.tagName)return n.contentDocument?t=i(n.contentDocument):null;var r=e.getElementsByTagName("video");if(r.length>0&&r[0].webkitDisplayingFullscreen)return r[0]}var o=e.getElementsByTagName("iframe");if(o.length>0)for(var a=0;a<o.length;a++)if(o[a].contentDocument&&(t=i(o[a].contentDocument)))return t;return null},s=function(){(t.isEnded=!0,!0===e.options.disableCollapse.enabled&&(t.options.sideStreamObject&&t.options.sideStreamObject.isActivated&&t.options.sideStreamObject.moveAdUnitBack(),t.options.sideStream.wasEnabled=t.options.sideStream.enabled,t.options.sideStream.enabled=!1),!0!==e.options.disableCollapse.enabled||!0!==e.options.disableCollapse.replay||e.options.endCard.enabled)?((e.options.wcElement&&e.options.wcElement instanceof Element?e.options.wcElement.querySelector("#"+String(e.options.iframeVideoWrapperId)):document.getElementById(e.options.iframeVideoWrapperId)).style.background=e.options.videoBackgroundColor,(e.isAndroid&&e.isAndroid()||"below"===e.options.controlBarPosition)&&(n.controlBar.el().style.bottom=r.getBottomMarginForControlbar(e.options,!1)+"em"),a("hiding control bar and big play button"),n.trigger("concealControls"),n.bigPlayButton.hide(),e.options.disableCollapse.enabled||(t.isSkipped=!0,t.destroyWithoutSkip()),e.options.endCard.enabled||(a("isCompleted = true"),t.isCompleted=!0)):"preview"===e.options.adType&&e.options.onlyAudio||(n.bigPlayButton.show(),n.bigPlayButton.addClass("vjs-big-play-button-replay"),n.controlBar.playToggle.el().style["pointer-events"]="none");if(t.isFullscreen||t.adVideoPlayer.isFullscreen_)if(a("exiting fullscreen before destroy()"),document.exitFullscreen)document.exitFullscreen();else if(document.webkitExitFullscreen)document.webkitExitFullscreen();else if(document.mozCancelFullScreen)document.mozCancelFullScreen();else if(document.msExitFullscreen)document.msExitFullscreen();else if(o.isIos()){var s=i(document);s&&s.webkitExitFullscreen&&s.webkitExitFullscreen()}t.endCard&&(a("showing EndCard."),t.endCard.show())};e.options.vpaid?s():e.dispatchEventToAdunit({name:"video_complete"},(function(){s()}))}))}}}},function(e,t,n){var i=n(45),r=n(11),o=n(12),a=function(e){o.debug("Custom Skinning: "+e)},s=function(e,t){var n=e.playerSkin,i=-3.2;return"text"!==e.showProgressBar&&!0!==e.showProgressBar&&!1!==e.showProgressBar&&!1!==t||(i=-3),n.controlBarHeight&&(i=parseInt(i*n.controlBarHeight/30)),i};e.exports={render:function(e,t,n,o){if(function(e,t,n,i){var r=t.controlBar,o=e.options.playerSkin.buttonOrderLeft,a=e.options.playerSkin.buttonOrderRight,s=function(e,t,o,a){var s;r[e]&&(s=r[e].el_,i&&("playToggle"===e?s=n.getElementById("customPlayToggle"):"fullscreenToggle"===e&&(s=n.getElementById("customFullscreenToggle"))),s&&(r.el_.appendChild(s),s.style.float=a))};o&&o.forEach((function(e,t,n){s(e,0,0,"left")})),a&&a.reverse().forEach((function(e,t,n){s(e,0,0,"right")}))}(e,t,n,o),function(e,t,n,o){a("Applying custom styles/skins");var l="",d="";o&&(l=".vjs-default-skin.vjs-has-started.vjs-user-inactive.vjs-playing .vjs-control-bar {display: block;visibility: visible;opacity: 1} .vjs-loading-spinner { position: absolute; top: 50%; left: 50%; font-size: 4em; line-height: 1; width: 1em; height: 1em; margin-left: -0.5em; margin-top: -0.5em; opacity: 0.75; display: block; -webkit-animation: spin 1.5s infinite linear; -moz-animation: spin 1.5s infinite linear; -o-animation: spin 1.5s infinite linear; animation: spin 1.5s infinite linear; }\n"),r.isIpad()&&(d=".vjs-default-skin.vjs-has-started.vjs-user-inactive.vjs-playing .vjs-control-bar {display: block;visibility: visible;opacity: 1}");var c="\n",u=e.options.playerSkin;(u?(u.bigPlayButtonColor||(u.bigPlayButtonColor="#7b7a7d"),u.topBarColor&&(c+="#top_chrome { background: "+u.topBarColor+"; }\n"),u.dividerColor?c+="#top_chrome { border-bottom-color: "+u.dividerColor+"; }\n":c+="#top_chrome { border-bottom-color: "+u.bottomDividerColor+"; }\n","number"==typeof u.dividerHeight?c+="#top_chrome { border-bottom-width: "+u.dividerHeight+"; border-bottom-style: solid; }\n":c+="#top_chrome { border-bottom-width: "+u.bottomDividerWidth+"; border-bottom-style: solid; }\n",u.topBarTextColor&&(c+=".top-bar-text { color: "+u.topBarTextColor+"; }\n"),u.controlBarColor&&(c+=".vjs-default-skin .vjs-control-bar { background-color: "+u.controlBarColor+"; }\n"),u.controlBarControlsColor&&(c+=".vjs-default-skin .vjs-control-bar { color: "+u.controlBarControlsColor+"; }\n",c+=".vjs-default-skin:hover .vjs-control-bar { color: "+u.controlBarControlsColor+"; }\n"),u.bigPlayButtonColor&&(c+=".vjs-default-skin .vjs-big-play-button { color: "+u.bigPlayButtonColor+"; border-color: "+u.bigPlayButtonColor+"; }\n",c+=".vjs-default-skin:hover .vjs-big-play-button { color: "+u.bigPlayButtonColor+"; border-color: "+u.bigPlayButtonColor+"; }\n"),u.progressBarElapsedColor&&(c+=".vjs-default-skin .vjs-play-progress { background: "+u.progressBarElapsedColor+" }\n"),u.volumeBarBackground&&(c+=".vjs-default-skin .vjs-volume-level { background: "+u.volumeBarBackground+" }\n"),u.controlBarHeight&&(c+=".vjs-default-skin .vjs-control-bar { height: "+u.controlBarHeight+"px; }\n",c+=".vjs-default-skin .vjs-control { font-size: "+Math.ceil(u.controlBarHeight/3)+"px; }\n",c+=".vjs-default-skin .vjs-time-divider { height: "+u.controlBarHeight+"px; line-height: "+u.controlBarHeight/9.7+"em} \n",c+=".vjs-default-skin .vjs-progress-control { font-size: 0.3em } \n"),!u.videoBackgroundColor||void 0!==e.options.isWaterfall&&!1!==e.options.isWaterfall||(c+=".video-js {background:"+u.videoBackgroundColor+"} \n"),e.options.sideStream.dynamicBigPlayButtonOnSideStream&&!0===e.options.sideStream.dynamicBigPlayButtonOnSideStream&&(c+=".vjs-default-skin .vjs-big-play-button {-webkit-transition: all 0s;-moz-transition: all 0s;-o-transition: all 0s;transition: all 0s;} \n")):c+="#top_chrome { border-bottom-color: "+u.bottomDividerColor+"; border-bottom-width: "+u.bottomDividerWidth+"; border-bottom-style: solid; }\n",e.isAndroid&&e.isAndroid()||"below"===e.options.controlBarPosition)&&(c+=".vjs-default-skin .vjs-control-bar { display: block !important;visibility: visible !important;opacity: 1 !important ;bottom:"+s(e.options,!0)+"em }\n");a("Generating css element");var p=document.createElement("style");p.type="text/css";var h=i+d+'video::-webkit-media-controls-start-playback-button {display: none !important;-webkit-appearance: none;}\n.vjs-default-skin .vjs-big-play-button-replay:before {content: "\\e984";}\n'+c+l+'.vjs-default-skin .vjs-ec-button-learnmore:before {content: "\\e926";} .ec-button {display: block; cursor: pointer; height: 1em; font-family: VideoJS; margin: 0.5em; padding: 0.3em; border: 2px solid gray; background-color: rgba(128,128,128,0); transition: background-color 0.8s; -webkit-transition: background-color 0.5s;}\n';e.options.useMsSkin&&e.options.customPlayerSkinCss&&(h+=e.options.customPlayerSkinCss),p.innerHTML=h,n.head.appendChild(p)}(e,0,n,o),e.options.useMsSkin){var l=t.controlBar.el_,d=n.defaultView.getComputedStyle(l,null).height,c=d.indexOf("px");c>-1&&(d=d.substr(0,c)),Number(d)>0&&(e.options.playerSkin.controlBarHeight=Number(d))}},bottomMarginOfControlBarWithProgressBar:-3.2,bottomMarginOfControlBar:-3,getBottomMarginForControlbar:s}},function(e,t){e.exports='/* SKIN\n================================================================================\nThe main class name for all skin-specific styles. To make your own skin,\nreplace all occurrences of \'vjs-default-skin\' with a new name. Then add your new\nskin name to your video tag instead of the default skin.\ne.g. <video class="video-js my-skin-name">\n*/\n.vjs-default-skin {\n  color: #CCCCCC;\n}\n/* Custom Icon Font\n--------------------------------------------------------------------------------\nThe control icons are from a custom font. Each icon corresponds to a character\n(e.g. "\\e001"). Font icons allow for easy scaling and coloring of icons.\n*/\n@font-face {\n  font-family: \'VideoJS\';\n  src: url(\'font/vjs.eot\');\n  src: url(data:application/font-woff;base64, ) format("woff"), url(\'font/vjs.eot?#iefix\') format(\'embedded-opentype\'), url(\'font/vjs.ttf\') format(\'truetype\'), url(\'font/vjs.svg#icomoon\') format(\'svg\');\n  font-weight: normal;\n  font-style: normal;\n}\n/* Base UI Component Classes\n--------------------------------------------------------------------------------\n*/\n/* Slider - used for Volume bar and Seek bar */\n.vjs-default-skin .vjs-slider {\n  /* Replace browser focus highlight with handle highlight */\n  outline: 0;\n  position: relative;\n  cursor: pointer;\n  padding: 0;\n  /* background-color-with-alpha */\n  background-color: #333333;\n  background-color: rgba(51, 51, 51, 0.9);\n}\n.vjs-default-skin .vjs-slider:focus {\n  /* box-shadow */\n  -webkit-box-shadow: 0 0 2em #fff;\n  -moz-box-shadow: 0 0 2em #fff;\n  box-shadow: 0 0 2em #fff;\n}\n.vjs-default-skin .vjs-slider-handle {\n  position: absolute;\n  /* Needed for IE6 */\n  left: 0;\n  top: 0;\n}\n.vjs-default-skin .vjs-slider-handle:before {\n  content: "\\e009";\n  font-family: VideoJS;\n  font-size: 1em;\n  line-height: 1;\n  text-align: center;\n  text-shadow: 0em 0em 1em #fff;\n  position: absolute;\n  top: 0;\n  left: 0;\n  /* Rotate the square icon to make a diamond */\n  /* transform */\n  -webkit-transform: rotate(-45deg);\n  -moz-transform: rotate(-45deg);\n  -ms-transform: rotate(-45deg);\n  -o-transform: rotate(-45deg);\n  transform: rotate(-45deg);\n}\n/* Control Bar\n--------------------------------------------------------------------------------\nThe default control bar that is a container for most of the controls.\n*/\n.vjs-default-skin .vjs-control-bar {\n  /* Start hidden */\n  display: none;\n  position: absolute;\n  /* Place control bar at the bottom of the player box/video.\n     If you want more margin below the control bar, add more height. */\n  bottom: 0;\n  /* Use left/right to stretch to 100% width of player div */\n  left: 0;\n  right: 0;\n  /* Height includes any margin you want above or below control items */\n  height: 3.0em;\n  /* background-color-with-alpha */\n  background-color: #07141E;\n  background-color: rgba(7, 20, 30, 0.7);\n}\n/* Show the control bar only once the video has started playing */\n.vjs-default-skin.vjs-has-started .vjs-control-bar {\n  display: block;\n  /* Visibility needed to make sure things hide in older browsers too. */\n  visibility: visible;\n  opacity: 1;\n  /* transition */\n  -webkit-transition: visibility 0.1s, opacity 0.1s;\n  -moz-transition: visibility 0.1s, opacity 0.1s;\n  -o-transition: visibility 0.1s, opacity 0.1s;\n  transition: visibility 0.1s, opacity 0.1s;\n}\n/* Hide the control bar when the video is playing and the user is inactive  */\n.vjs-default-skin.vjs-has-started.vjs-user-inactive.vjs-playing .vjs-control-bar {\n  display: block;\n  visibility: hidden;\n  opacity: 0;\n  /* transition */\n  -webkit-transition: visibility 0.5s, opacity 0.5s;\n  -moz-transition: visibility 0.5s, opacity 0.5s;\n  -o-transition: visibility 0.5s, opacity 0.5s;\n  transition: visibility 0.5s, opacity 0.5s;\n}\n.vjs-default-skin.vjs-controls-disabled .vjs-control-bar {\n  display: none;\n}\n.vjs-default-skin.vjs-using-native-controls .vjs-control-bar {\n  display: none;\n}\n/* The control bar shouldn\'t show after an error */\n.vjs-default-skin.vjs-error .vjs-control-bar {\n  display: none;\n}\n/* Don\'t hide the control bar if it\'s audio */\n.vjs-audio.vjs-default-skin.vjs-has-started.vjs-user-inactive.vjs-playing .vjs-control-bar {\n  opacity: 1;\n  visibility: visible;\n}\n/* IE8 is flakey with fonts, and you have to change the actual content to force\nfonts to show/hide properly.\n  - "\\9" IE8 hack didn\'t work for this\n  - Found in XP IE8 from http://modern.ie. Does not show up in "IE8 mode" in IE9\n*/\n@media \\0screen {\n  .vjs-default-skin.vjs-user-inactive.vjs-playing .vjs-control-bar :before {\n    content: "";\n  }\n}\n/* General styles for individual controls. */\n.vjs-default-skin .vjs-control {\n  outline: none;\n  position: relative;\n  float: left;\n  text-align: center;\n  margin: 0;\n  padding: 0;\n  height: 3.0em;\n  width: 4em;\n}\n/* Font button icons */\n.vjs-default-skin .vjs-control:before {\n  font-family: VideoJS;\n  font-size: 1.5em;\n  line-height: 2;\n  position: absolute;\n  top: 0;\n  left: 0;\n  width: 100%;\n  height: 100%;\n  text-align: center;\n  text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.5);\n}\n/* Replacement for focus outline */\n.vjs-default-skin .vjs-control:focus:before,\n.vjs-default-skin .vjs-control:hover:before {\n  text-shadow: 0em 0em 1em #ffffff;\n}\n.vjs-default-skin .vjs-control:focus {\n  /*  outline: 0; */\n  /* keyboard-only users cannot see the focus on several of the UI elements when\n  this is set to 0 */\n}\n/* Hide control text visually, but have it available for screenreaders */\n.vjs-default-skin .vjs-control-text {\n  /* hide-visually */\n  border: 0;\n  clip: rect(0 0 0 0);\n  height: 1px;\n  margin: -1px;\n  overflow: hidden;\n  padding: 0;\n  position: absolute;\n  width: 1px;\n}\n/* Play/Pause\n--------------------------------------------------------------------------------\n*/\n.vjs-default-skin .vjs-play-control {\n  width: 5em;\n  cursor: pointer;\n}\n.vjs-default-skin .vjs-play-control:before {\n  content: "\\e001";\n}\n.vjs-default-skin.vjs-playing .vjs-play-control:before {\n  content: "\\e002";\n}\n/* Playback toggle\n--------------------------------------------------------------------------------\n*/\n.vjs-default-skin .vjs-playback-rate .vjs-playback-rate-value {\n  font-size: 1.5em;\n  line-height: 2;\n  position: absolute;\n  top: 0;\n  left: 0;\n  width: 100%;\n  height: 100%;\n  text-align: center;\n  text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.5);\n}\n.vjs-default-skin .vjs-playback-rate.vjs-menu-button .vjs-menu .vjs-menu-content {\n  width: 4em;\n  left: -2em;\n  list-style: none;\n}\n/* Volume/Mute\n-------------------------------------------------------------------------------- */\n.vjs-default-skin .vjs-mute-control,\n.vjs-default-skin .vjs-volume-menu-button {\n  cursor: pointer;\n  float: right;\n}\n.vjs-default-skin .vjs-mute-control:before,\n.vjs-default-skin .vjs-volume-menu-button:before {\n  content: "\\e006";\n}\n.vjs-default-skin .vjs-mute-control.vjs-vol-0:before,\n.vjs-default-skin .vjs-volume-menu-button.vjs-vol-0:before {\n  content: "\\e003";\n}\n.vjs-default-skin .vjs-mute-control.vjs-vol-1:before,\n.vjs-default-skin .vjs-volume-menu-button.vjs-vol-1:before {\n  content: "\\e004";\n}\n.vjs-default-skin .vjs-mute-control.vjs-vol-2:before,\n.vjs-default-skin .vjs-volume-menu-button.vjs-vol-2:before {\n  content: "\\e005";\n}\n.vjs-default-skin .vjs-volume-control {\n  width: 5em;\n  float: right;\n}\n.vjs-default-skin .vjs-volume-bar {\n  width: 5em;\n  height: 0.6em;\n  margin: 1.1em auto 0;\n}\n.vjs-default-skin .vjs-volume-level {\n  position: absolute;\n  top: 0;\n  left: 0;\n  height: 0.5em;\n  /* assuming volume starts at 1.0 */\n  width: 100%;\n  background: #66A8CC url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAYAAAAGCAYAAADgzO9IAAAAP0lEQVQIHWWMAQoAIAgDR/QJ/Ub//04+w7ZICBwcOg5FZi5iBB82AGzixEglJrd4TVK5XUJpskSTEvpdFzX9AB2pGziSQcvAAAAAAElFTkSuQmCC) -50% 0 repeat;\n}\n.vjs-default-skin .vjs-volume-bar .vjs-volume-handle {\n  width: 0.5em;\n  height: 0.5em;\n  /* Assumes volume starts at 1.0. If you change the size of the\n     handle relative to the volume bar, you\'ll need to update this value\n     too. */\n  left: 4.5em;\n}\n.vjs-default-skin .vjs-volume-handle:before {\n  font-size: 0.9em;\n  top: -0.2em;\n  left: -0.2em;\n  width: 1em;\n  height: 1em;\n}\n/* The volume menu button is like menu buttons (captions/subtitles) but works\n    a little differently. It needs to be possible to tab to the volume slider\n    without hitting space bar on the menu button. To do this we\'re not using\n    display:none to hide the slider menu by default, and instead setting the\n    width and height to zero. */\n.vjs-default-skin .vjs-volume-menu-button .vjs-menu {\n  display: block;\n  width: 0;\n  height: 0;\n  border-top-color: transparent;\n}\n.vjs-default-skin .vjs-volume-menu-button .vjs-menu .vjs-menu-content {\n  height: 0;\n  width: 0;\n}\n.vjs-default-skin .vjs-volume-menu-button:hover .vjs-menu,\n.vjs-default-skin .vjs-volume-menu-button .vjs-menu.vjs-lock-showing {\n  border-top-color: rgba(7, 40, 50, 0.5);\n  /* Same as ul background */\n}\n.vjs-default-skin .vjs-volume-menu-button:hover .vjs-menu .vjs-menu-content,\n.vjs-default-skin .vjs-volume-menu-button .vjs-menu.vjs-lock-showing .vjs-menu-content {\n  height: 2.9em;\n  width: 10em;\n}\n/* Progress\n--------------------------------------------------------------------------------\n*/\n.vjs-default-skin .vjs-progress-control {\n  position: absolute;\n  left: 0;\n  right: 0;\n  width: auto;\n  font-size: 0.3em;\n  height: 1.2em;\n  /* Increase default height of progress bar by a decision for VIDLA-1692 */\n  /* Set above the rest of the controls. */\n  top: -1em;\n  /* Shrink the bar slower than it grows. */\n  /* transition */\n  -webkit-transition: all 0.4s;\n  -moz-transition: all 0.4s;\n  -o-transition: all 0.4s;\n  transition: all 0.4s;\n}\n/* On hover, make the progress bar grow to something that\'s more clickable.\n    This simply changes the overall font for the progress bar, and this\n    updates both the em-based widths and heights, as wells as the icon font */\n.vjs-default-skin:hover .vjs-progress-control {\n  /* commented out by a decision for VIDLA-1692 */\n  /* font-size: .9em; */\n  /* Even though we\'re not changing the top/height, we need to include them in\n      the transition so they\'re handled correctly. */\n  /* .transition(all 0.2s);  */\n}\n/* Box containing play and load progresses. Also acts as seek scrubber. */\n.vjs-default-skin .vjs-progress-holder {\n  height: 100%;\n}\n/* Progress Bars */\n.vjs-default-skin .vjs-progress-holder .vjs-play-progress,\n.vjs-default-skin .vjs-progress-holder .vjs-load-progress,\n.vjs-default-skin .vjs-progress-holder .vjs-load-progress div {\n  position: absolute;\n  display: block;\n  height: 100%;\n  margin: 0;\n  padding: 0;\n  /* updated by javascript during playback */\n  width: 0;\n  /* Needed for IE6 */\n  left: 0;\n  top: 0;\n}\n.vjs-default-skin .vjs-play-progress {\n  /*\n    Using a data URI to create the white diagonal lines with a transparent\n      background. Surprisingly works in IE8.\n      Created using http://www.patternify.com\n    Changing the first color value will change the bar color.\n    Also using a paralax effect to make the lines move backwards.\n      The -50% left position makes that happen.\n  */\n  background: #66A8CC url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAYAAAAGCAYAAADgzO9IAAAAP0lEQVQIHWWMAQoAIAgDR/QJ/Ub//04+w7ZICBwcOg5FZi5iBB82AGzixEglJrd4TVK5XUJpskSTEvpdFzX9AB2pGziSQcvAAAAAAElFTkSuQmCC) -50% 0 repeat;\n}\n.vjs-default-skin .vjs-load-progress {\n  background: #646464 /* IE8- Fallback */;\n  background: rgba(255, 255, 255, 0.2);\n}\n/* there are child elements of the load progress bar that represent the\n   specific time ranges that have been buffered */\n.vjs-default-skin .vjs-load-progress div {\n  background: #787878 /* IE8- Fallback */;\n  background: rgba(255, 255, 255, 0.1);\n}\n.vjs-default-skin .vjs-seek-handle {\n  width: 1.5em;\n  height: 100%;\n}\n.vjs-default-skin .vjs-seek-handle:before {\n  padding-top: 0.1em /* Minor adjustment */;\n}\n/* Live Mode\n--------------------------------------------------------------------------------\n*/\n.vjs-default-skin.vjs-live .vjs-time-controls,\n.vjs-default-skin.vjs-live .vjs-time-divider,\n.vjs-default-skin.vjs-live .vjs-progress-control {\n  display: none;\n}\n.vjs-default-skin.vjs-live .vjs-live-display {\n  display: block;\n}\n/* Live Display\n--------------------------------------------------------------------------------\n*/\n.vjs-default-skin .vjs-live-display {\n  display: none;\n  font-size: 1em;\n  line-height: 3em;\n}\n/* Time Display\n--------------------------------------------------------------------------------\n*/\n.vjs-default-skin .vjs-time-controls {\n  font-size: 1em;\n  /* Align vertically by making the line height the same as the control bar */\n  line-height: 3em;\n}\n.vjs-default-skin .vjs-current-time {\n  float: left;\n}\n.vjs-default-skin .vjs-duration {\n  float: left;\n}\n/* Remaining time is in the HTML, but not included in default design */\n.vjs-default-skin .vjs-remaining-time {\n  display: none;\n  float: left;\n}\n.vjs-time-divider {\n  float: left;\n  line-height: 3em;\n}\n/* Fullscreen\n--------------------------------------------------------------------------------\n*/\n.vjs-default-skin .vjs-fullscreen-control {\n  width: 3.8em;\n  cursor: pointer;\n  float: right;\n}\n.vjs-default-skin .vjs-fullscreen-control:before {\n  content: "\\e000";\n}\n/* Switch to the exit icon when the player is in fullscreen */\n.vjs-default-skin.vjs-fullscreen .vjs-fullscreen-control:before {\n  content: "\\e00b";\n}\n/* Big Play Button (play button at start)\n--------------------------------------------------------------------------------\nPositioning of the play button in the center or other corners can be done more\neasily in the skin designer. http://designer.videojs.com/\n*/\n.vjs-default-skin .vjs-big-play-button {\n  left: 0.5em;\n  top: 0.5em;\n  font-size: 3em;\n  display: block;\n  z-index: 2;\n  position: absolute;\n  width: 4em;\n  height: 2.6em;\n  text-align: center;\n  vertical-align: middle;\n  cursor: pointer;\n  opacity: 1;\n  /* Need a slightly gray bg so it can be seen on black backgrounds */\n  /* background-color-with-alpha */\n  background-color: #07141E;\n  background-color: rgba(7, 20, 30, 0.7);\n  border: 0.1em solid #3b4249;\n  /* border-radius */\n  -webkit-border-radius: 0.8em;\n  -moz-border-radius: 0.8em;\n  border-radius: 0.8em;\n  /* box-shadow */\n  -webkit-box-shadow: 0px 0px 1em rgba(255, 255, 255, 0.25);\n  -moz-box-shadow: 0px 0px 1em rgba(255, 255, 255, 0.25);\n  box-shadow: 0px 0px 1em rgba(255, 255, 255, 0.25);\n  /* transition */\n  -webkit-transition: all 0.4s;\n  -moz-transition: all 0.4s;\n  -o-transition: all 0.4s;\n  transition: all 0.4s;\n}\n/* Optionally center */\n.vjs-default-skin.vjs-big-play-centered .vjs-big-play-button {\n  /* Center it horizontally */\n  left: 50%;\n  margin-left: -2.1em;\n  /* Center it vertically */\n  top: 50%;\n  margin-top: -1.4em;\n}\n/* Hide if controls are disabled */\n.vjs-default-skin.vjs-controls-disabled .vjs-big-play-button {\n  display: none;\n}\n/* Hide when video starts playing */\n.vjs-default-skin.vjs-has-started .vjs-big-play-button {\n  display: none;\n}\n/* Hide on mobile devices. Remove when we stop using native controls\n    by default on mobile  */\n.vjs-default-skin.vjs-using-native-controls .vjs-big-play-button {\n  display: none;\n}\n.vjs-default-skin:hover .vjs-big-play-button,\n.vjs-default-skin .vjs-big-play-button:focus {\n  outline: 0;\n  border-color: #fff;\n  /* IE8 needs a non-glow hover state */\n  background-color: #505050;\n  background-color: rgba(50, 50, 50, 0.75);\n  /* box-shadow */\n  -webkit-box-shadow: 0 0 3em #fff;\n  -moz-box-shadow: 0 0 3em #fff;\n  box-shadow: 0 0 3em #fff;\n  /* transition */\n  -webkit-transition: all 0s;\n  -moz-transition: all 0s;\n  -o-transition: all 0s;\n  transition: all 0s;\n}\n.vjs-default-skin .vjs-big-play-button:before {\n  content: "\\e001";\n  font-family: VideoJS;\n  /* In order to center the play icon vertically we need to set the line height\n     to the same as the button height */\n  line-height: 2.6em;\n  text-shadow: 0.05em 0.05em 0.1em #000;\n  text-align: center /* Needed for IE8 */;\n  position: absolute;\n  left: 0;\n  width: 100%;\n  height: 100%;\n}\n.vjs-error .vjs-big-play-button {\n  display: none;\n}\n/* Error Display\n--------------------------------------------------------------------------------\n*/\n.vjs-error-display {\n  display: none;\n}\n.vjs-error .vjs-error-display {\n  display: block;\n  position: absolute;\n  left: 0;\n  top: 0;\n  width: 100%;\n  height: 100%;\n}\n.vjs-error .vjs-error-display:before {\n  content: \'X\';\n  font-family: Arial;\n  font-size: 4em;\n  color: #666666;\n  /* In order to center the play icon vertically we need to set the line height\n     to the same as the button height */\n  line-height: 1;\n  text-shadow: 0.05em 0.05em 0.1em #000;\n  text-align: center /* Needed for IE8 */;\n  vertical-align: middle;\n  position: absolute;\n  left: 0;\n  top: 50%;\n  margin-top: -0.5em;\n  width: 100%;\n}\n.vjs-error-display div {\n  position: absolute;\n  bottom: 1em;\n  right: 0;\n  left: 0;\n  font-size: 1.4em;\n  text-align: center;\n  padding: 3px;\n  background: #000000;\n  background: rgba(0, 0, 0, 0.5);\n}\n.vjs-error-display a,\n.vjs-error-display a:visited {\n  color: #F4A460;\n}\n/* Loading Spinner\n--------------------------------------------------------------------------------\n*/\n.vjs-loading-spinner {\n  /* Should be hidden by default */\n  display: none;\n  position: absolute;\n  top: 50%;\n  left: 50%;\n  font-size: 4em;\n  line-height: 1;\n  width: 1em;\n  height: 1em;\n  margin-left: -0.5em;\n  margin-top: -0.5em;\n  opacity: 0.75;\n}\n/* Show the spinner when waiting for data and seeking to a new time */\n.vjs-waiting .vjs-loading-spinner,\n.vjs-seeking .vjs-loading-spinner {\n  display: block;\n  /* only animate when showing because it can be processor heavy */\n  /* animation */\n  -webkit-animation: spin 1.5s infinite linear;\n  -moz-animation: spin 1.5s infinite linear;\n  -o-animation: spin 1.5s infinite linear;\n  animation: spin 1.5s infinite linear;\n}\n/* Errors are unrecoverable without user interaction so hide the spinner */\n.vjs-error .vjs-loading-spinner {\n  display: none;\n  /* ensure animation doesn\'t continue while hidden */\n  /* animation */\n  -webkit-animation: none;\n  -moz-animation: none;\n  -o-animation: none;\n  animation: none;\n}\n.vjs-default-skin .vjs-loading-spinner:before {\n  content: "\\e01e";\n  font-family: VideoJS;\n  position: absolute;\n  top: 0;\n  left: 0;\n  width: 1em;\n  height: 1em;\n  text-align: center;\n  text-shadow: 0em 0em 0.1em #000;\n}\n@-moz-keyframes spin {\n  0% {\n    -moz-transform: rotate(0deg);\n  }\n  100% {\n    -moz-transform: rotate(359deg);\n  }\n}\n@-webkit-keyframes spin {\n  0% {\n    -webkit-transform: rotate(0deg);\n  }\n  100% {\n    -webkit-transform: rotate(359deg);\n  }\n}\n@-o-keyframes spin {\n  0% {\n    -o-transform: rotate(0deg);\n  }\n  100% {\n    -o-transform: rotate(359deg);\n  }\n}\n@keyframes spin {\n  0% {\n    transform: rotate(0deg);\n  }\n  100% {\n    transform: rotate(359deg);\n  }\n}\n/* Menu Buttons (Captions/Subtitles/etc.)\n--------------------------------------------------------------------------------\n*/\n.vjs-default-skin .vjs-menu-button {\n  float: right;\n  cursor: pointer;\n}\n.vjs-default-skin .vjs-menu {\n  display: none;\n  position: absolute;\n  bottom: 0;\n  left: 0em;\n  /* (Width of vjs-menu - width of button) / 2 */\n  width: 0em;\n  height: 0em;\n  margin-bottom: 3em;\n  border-left: 2em solid transparent;\n  border-right: 2em solid transparent;\n  border-top: 1.55em solid #000000;\n  /* Same width top as ul bottom */\n  border-top-color: rgba(7, 40, 50, 0.5);\n  /* Same as ul background */\n}\n/* Button Pop-up Menu */\n.vjs-default-skin .vjs-menu-button .vjs-menu .vjs-menu-content {\n  display: block;\n  padding: 0;\n  margin: 0;\n  position: absolute;\n  width: 10em;\n  bottom: 1.5em;\n  /* Same bottom as vjs-menu border-top */\n  max-height: 15em;\n  overflow: auto;\n  left: -5em;\n  /* Width of menu - width of button / 2 */\n  /* background-color-with-alpha */\n  background-color: #07141E;\n  background-color: rgba(7, 20, 30, 0.7);\n  /* box-shadow */\n  -webkit-box-shadow: -0.2em -0.2em 0.3em rgba(255, 255, 255, 0.2);\n  -moz-box-shadow: -0.2em -0.2em 0.3em rgba(255, 255, 255, 0.2);\n  box-shadow: -0.2em -0.2em 0.3em rgba(255, 255, 255, 0.2);\n}\n.vjs-default-skin .vjs-menu-button:hover .vjs-control-content .vjs-menu,\n.vjs-default-skin .vjs-control-content .vjs-menu.vjs-lock-showing {\n  display: block;\n}\n/* prevent menus from opening while scrubbing (FF, IE) */\n.vjs-default-skin.vjs-scrubbing .vjs-menu-button:hover .vjs-control-content .vjs-menu {\n  display: none;\n}\n.vjs-default-skin .vjs-menu-button ul li {\n  list-style: none;\n  margin: 0;\n  padding: 0.3em 0 0.3em 0;\n  line-height: 1.4em;\n  font-size: 1.2em;\n  text-align: center;\n  text-transform: lowercase;\n}\n.vjs-default-skin .vjs-menu-button ul li.vjs-selected {\n  background-color: #000;\n}\n.vjs-default-skin .vjs-menu-button ul li:focus,\n.vjs-default-skin .vjs-menu-button ul li:hover,\n.vjs-default-skin .vjs-menu-button ul li.vjs-selected:focus,\n.vjs-default-skin .vjs-menu-button ul li.vjs-selected:hover {\n  outline: 0;\n  color: #111;\n  /* background-color-with-alpha */\n  background-color: #ffffff;\n  background-color: rgba(255, 255, 255, 0.75);\n  /* box-shadow */\n  -webkit-box-shadow: 0 0 1em #ffffff;\n  -moz-box-shadow: 0 0 1em #ffffff;\n  box-shadow: 0 0 1em #ffffff;\n}\n.vjs-default-skin .vjs-menu-button ul li.vjs-menu-title {\n  text-align: center;\n  text-transform: uppercase;\n  font-size: 1em;\n  line-height: 2em;\n  padding: 0;\n  margin: 0 0 0.3em 0;\n  font-weight: bold;\n  cursor: default;\n}\n/* Subtitles Button */\n.vjs-default-skin .vjs-subtitles-button:before {\n  content: "\\e00c";\n}\n/* Captions Button */\n.vjs-default-skin .vjs-captions-button:before {\n  content: "\\e008";\n}\n/* Chapters Button */\n.vjs-default-skin .vjs-chapters-button:before {\n  content: "\\e00c";\n}\n.vjs-default-skin .vjs-chapters-button.vjs-menu-button .vjs-menu .vjs-menu-content {\n  width: 24em;\n  left: -12em;\n}\n/* Replacement for focus outline */\n.vjs-default-skin .vjs-captions-button:focus .vjs-control-content:before,\n.vjs-default-skin .vjs-captions-button:hover .vjs-control-content:before {\n  /* box-shadow */\n  -webkit-box-shadow: 0 0 1em #ffffff;\n  -moz-box-shadow: 0 0 1em #ffffff;\n  box-shadow: 0 0 1em #ffffff;\n}\n/*\nREQUIRED STYLES (be careful overriding)\n================================================================================\nWhen loading the player, the video tag is replaced with a DIV,\nthat will hold the video tag or object tag for other playback methods.\nThe div contains the video playback element (Flash or HTML5) and controls,\nand sets the width and height of the video.\n\n** If you want to add some kind of border/padding (e.g. a frame), or special\npositioning, use another containing element. Otherwise you risk messing up\ncontrol positioning and full window mode. **\n*/\n.video-js {\n  background-color: #000;\n  position: relative;\n  padding: 0;\n  /* Start with 10px for base font size so other dimensions can be em based and\n     easily calculable. */\n  font-size: 10px;\n  /* Allow poster to be vertically aligned. */\n  vertical-align: middle;\n  /*  display: table-cell; */\n  /*This works in Safari but not Firefox.*/\n  /* Provide some basic defaults for fonts */\n  font-weight: normal;\n  font-style: normal;\n  /* Avoiding helvetica: issue #376 */\n  font-family: Arial, sans-serif;\n  /* Turn off user selection (text highlighting) by default.\n     The majority of player components will not be text blocks.\n     Text areas will need to turn user selection back on. */\n  /* user-select */\n  -webkit-user-select: none;\n  -moz-user-select: none;\n  -ms-user-select: none;\n  user-select: none;\n}\n/* Playback technology elements expand to the width/height of the containing div\n    <video> or <object> */\n.video-js .vjs-tech {\n  position: absolute;\n  top: 0;\n  left: 0;\n  width: 100%;\n  height: 100%;\n}\n/* Fix for Firefox 9 fullscreen (only if it is enabled). Not needed when\n   checking fullScreenEnabled. */\n.video-js:-moz-full-screen {\n  position: absolute;\n}\n/* Fullscreen Styles */\nbody.vjs-full-window {\n  padding: 0;\n  margin: 0;\n  height: 100%;\n  /* Fix for IE6 full-window. http://www.cssplay.co.uk/layouts/fixed.html */\n  overflow-y: auto;\n}\n.video-js.vjs-fullscreen {\n  position: fixed;\n  overflow: hidden;\n  z-index: 1000;\n  left: 0;\n  top: 0;\n  bottom: 0;\n  right: 0;\n  width: 100% !important;\n  height: 100% !important;\n  /* IE6 full-window (underscore hack) */\n  _position: absolute;\n}\n.video-js:-webkit-full-screen {\n  width: 100% !important;\n  height: 100% !important;\n}\n.video-js.vjs-fullscreen.vjs-user-inactive {\n  cursor: none;\n}\n/* Poster Styles */\n.vjs-poster {\n  background-repeat: no-repeat;\n  background-position: 50% 50%;\n  background-size: contain;\n  background-color: #000000;\n  cursor: pointer;\n  margin: 0;\n  padding: 0;\n  position: absolute;\n  top: 0;\n  right: 0;\n  bottom: 0;\n  left: 0;\n}\n.vjs-poster img {\n  display: block;\n  margin: 0 auto;\n  max-height: 100%;\n  padding: 0;\n  width: 100%;\n}\n/* Hide the poster after the video has started playing */\n.video-js.vjs-has-started .vjs-poster {\n  display: none;\n}\n/* Don\'t hide the poster if we\'re playing audio */\n.video-js.vjs-audio.vjs-has-started .vjs-poster {\n  display: block;\n}\n/* Hide the poster when controls are disabled because it\'s clickable\n    and the native poster can take over */\n.video-js.vjs-controls-disabled .vjs-poster {\n  display: none;\n}\n/* Hide the poster when native controls are used otherwise it covers them */\n.video-js.vjs-using-native-controls .vjs-poster {\n  display: none;\n}\n/* Text Track Styles */\n/* Overall track holder for both captions and subtitles */\n.video-js .vjs-text-track-display {\n  position: absolute;\n  top: 0;\n  left: 0;\n  bottom: 3em;\n  right: 0;\n  pointer-events: none;\n}\n/* Captions Settings Dialog */\n.vjs-caption-settings {\n  position: relative;\n  top: 1em;\n  background-color: #000;\n  opacity: 0.75;\n  color: #FFF;\n  margin: 0 auto;\n  padding: 0.5em;\n  height: 15em;\n  font-family: Arial, Helvetica, sans-serif;\n  font-size: 12px;\n  width: 40em;\n}\n.vjs-caption-settings .vjs-tracksettings {\n  top: 0;\n  bottom: 2em;\n  left: 0;\n  right: 0;\n  position: absolute;\n  overflow: auto;\n}\n.vjs-caption-settings .vjs-tracksettings-colors,\n.vjs-caption-settings .vjs-tracksettings-font {\n  float: left;\n}\n.vjs-caption-settings .vjs-tracksettings-colors:after,\n.vjs-caption-settings .vjs-tracksettings-font:after,\n.vjs-caption-settings .vjs-tracksettings-controls:after {\n  clear: both;\n}\n.vjs-caption-settings .vjs-tracksettings-controls {\n  position: absolute;\n  bottom: 1em;\n  right: 1em;\n}\n.vjs-caption-settings .vjs-tracksetting {\n  margin: 5px;\n  padding: 3px;\n  min-height: 40px;\n}\n.vjs-caption-settings .vjs-tracksetting label {\n  display: block;\n  width: 100px;\n  margin-bottom: 5px;\n}\n.vjs-caption-settings .vjs-tracksetting span {\n  display: inline;\n  margin-left: 5px;\n}\n.vjs-caption-settings .vjs-tracksetting > div {\n  margin-bottom: 5px;\n  min-height: 20px;\n}\n.vjs-caption-settings .vjs-tracksetting > div:last-child {\n  margin-bottom: 0;\n  padding-bottom: 0;\n  min-height: 0;\n}\n.vjs-caption-settings label > input {\n  margin-right: 10px;\n}\n.vjs-caption-settings input[type="button"] {\n  width: 40px;\n  height: 40px;\n}\n/* Hide disabled or unsupported controls */\n.vjs-hidden {\n  display: none !important;\n}\n.vjs-lock-showing {\n  display: block !important;\n  opacity: 1;\n  visibility: visible;\n}\n/*  In IE8 w/ no JavaScript (no HTML5 shim), the video tag doesn\'t register.\n    The .video-js classname on the video tag also isn\'t considered.\n    This optional paragraph inside the video tag can provide a message to users\n    about what\'s required to play video. */\n.vjs-no-js {\n  padding: 2em;\n  color: #ccc;\n  background-color: #333;\n  font-size: 1.8em;\n  font-family: Arial, sans-serif;\n  text-align: center;\n  width: 30em;\n  height: 15em;\n  margin: 0 auto;\n}\n.vjs-no-js a,\n.vjs-no-js a:visited {\n  color: #F4A460;\n}\n/* -----------------------------------------------------------------------------\nThe original source of this file lives at\nhttps://github.com/videojs/video.js/blob/master/src/css/video-js.less */\n'},function(e,t,n){var i=n(12);e.exports=function(e,t){return{init:function(n,r,o){var a;a="init",i.debug("[PlayerManager_Fullscreen]",a),!1===e.isMobile()&&n.controlBar.fullscreenToggle.on("click",(function(){t.isFullscreenToggled||(t.isFullscreenToggled=!0)}));var s=function(){var a;(function(e){i.verbose("[PlayerManager_Fullscreen]",e)}("fullscreenchange"),e.isIos()&&t.isFullscreen&&t.play(),t.isFullscreen)?(e.pendingFullscreenExit=!0,e.isIos()&&!e.options.fixedSizePlayer?(n.controlBar.el().style.bottom="0.0em",e.options.disableTopBar||(r.style.display="block",e.floatingSkipButton&&(e.readyForSkip?(e.floatingSkipButton.style.display="block",e.floatingAdSkipText.style.display="none"):(e.floatingSkipButton.style.display="none",e.floatingAdSkipText.style.display="block")))):(n.controlBar.el().style.bottom="",e.options.disableTopBar||(o.style.display="block",r.style.display="none",e.floatingSkipButton&&(e.floatingSkipButton.style.display="none",e.floatingAdSkipText.style.display="none"))),a=!1===e.isMobile()?1e3:0,setTimeout((function(){e.pendingFullscreenExit=!1,t.isFullscreen=!1,t.isFullscreenToggled=!1,e.dispatchEventToAdunit({name:"fullscreenchange",fullscreenStatus:"exit"}),t.callbackForAdUnit.cbCoreVideoEvent("AdHandler","video_fullscreen_exit")}),a)):(t.isFullscreen=!t.isFullscreen,n.controlBar.el().style.bottom="0.0em",e.options.disableTopBar||(r.style.display="block",o.style.display="none",e.floatingSkipButton&&(e.readyForSkip?(e.floatingSkipButton.style.display="block",e.floatingAdSkipText.style.display="none"):(e.floatingSkipButton.style.display="none",e.floatingAdSkipText.style.display="block"))),e.dispatchEventToAdunit({name:"fullscreenchange",fullscreenStatus:"enter"}),t.callbackForAdUnit.cbCoreVideoEvent("AdHandler","video_fullscreen_enter"))};"onfullscreenchange"in document?n.on("fullscreenchange",s):"onwebkitfullscreenchange"in document&&n.on("webkitfullscreenchange",s)}}}},function(e,t,n){var i=n(12);e.exports=function(e){return{init:function(t){var n;n="init",i.debug("[PlayerManager_Controls]",n),t.on("concealControls",(function(){var n=t.player().controlBar;if(!0===t.options().disableCollapse.enabled&&!0===t.options().disableCollapse.hideControlBar&&!1===t.options().disableCollapse.replay&&(n.hide(),"below"===t.options().controlBarPosition)){var i=parseInt(e.targetElement.style.height);if(e.targetElement.style.height=i-this.controlBar.el_.offsetHeight+"px",e.options.sideStreamObject.isActivated){var r=parseInt(e.targetElement.childNodes[0].style.height)>1?0:1,o=parseInt(e.targetElement.childNodes[r].style.height);e.targetElement.childNodes[r].style.height=o-this.controlBar.el_.offsetHeight+"px"}}n&&!n.concealed&&(n.currentTimeDisplay&&n.currentTimeDisplay.hide(),n.durationDisplay&&n.durationDisplay.hide(),n.timeDivider&&n.timeDivider.hide(),n.muteToggle&&n.muteToggle.hide(),n.playToggle&&n.playToggle.hide(),n.fullscreenToggle&&n.fullscreenToggle.hide(),n.progressControl&&n.progressControl.hide(),n.volumeControl&&n.volumeControl.hide(),n.concealed=!0)})),t.on("revealControls",(function(){var n=t.player().controlBar;n.show(),n&&n.concealed&&("bar"!==e.options.showProgressBar&&!1!==e.options.showProgressBar&&(n.currentTimeDisplay&&n.currentTimeDisplay.show(),n.durationDisplay&&n.durationDisplay.show(),n.timeDivider&&n.timeDivider.show()),n.muteToggle&&e.options.showMute&&n.muteToggle.show(),n.playToggle&&e.options.showPlayToggle&&n.playToggle.show(),n.fullscreenToggle&&e.options.allowFullscreen&&n.fullscreenToggle.show(),!1!==e.options.showProgressBar&&"text"!==e.options.showProgressBar&&n.progressControl&&n.progressControl.show(),n.volumeControl&&e.options.showVolume&&e.displayVolumeControls()&&n.volumeControl.show(),n.concealed=!1)}))}}}},function(e,t,n){var i=n(12);e.exports=function(e,t){return{init:function(){var n;n="init",i.debug("[PlayerManager_Orientation]",n);var r=e.options.isWaterfall?e.options.waterfallStepId:null;window.addEventListener("orientationchange",(function(){if(!e.options.overlayPlayer&&t.isReadyToExpandForMobile){if(r&&r!==e.options.waterfallStepId)return;if(!(!e.options.sideStreamObject||"function"!=typeof e.options.sideStreamObject.shouldNotResizeWhenSideStreamActivated)&&e.options.sideStreamObject.shouldNotResizeWhenSideStreamActivated())return;e.refreshVideoLookAndFeel(e.options,t)}})),window.addEventListener("resize",(function(){if(t.options.shouldResizeVideoToFillMobileWebview){var e=window.innerWidth&&document.documentElement.clientWidth?Math.max(window.innerWidth,document.documentElement.clientWidth):window.innerWidth||document.documentElement.clientWidth||document.getElementsByTagName("body")[0].clientWidth,n=window.innerHeight&&document.documentElement.clientHeight?Math.max(window.innerHeight,document.documentElement.clientHeight):window.innerHeight||document.documentElement.clientHeight||document.getElementsByTagName("body")[0].clientHeight;t.options.width=e,t.options.height=n,t.resizeVideo(t.options.aspectRatio,!0)}}))}}}},function(e,t,n){var i=n(12),r=function(e){i.verbose("[PlayerManager_BigPlayButton]",e)};e.exports=function(e,t){return{init:function(n){var o;o="init",i.debug("[PlayerManager_BigPlayButton]",o);var a=function(){t.explicitPlay(),!0===t.isEnded&&(t.replay(),n.player().bigPlayButton.removeClass("vjs-big-play-button-replay"),!1===e.options.showBigPlayButton&&n.bigPlayButton&&n.bigPlayButton.hide()),setTimeout((function(){t.unmute()}),e.bigbuttonUnmuteTimeout)};n.player().bigPlayButton.on("click",(function(){r("big play button click"),a()})),n.player().bigPlayButton.on("touchend",(function(){r("big play button touchend"),a()}))}}}},function(e,t,n){var i=n(12),r=n(21)(),o=(n(11),function(e){i.debug("[PlayerManager_VideoPlay]",e)}),a=function(e){i.verbose("[PlayerManager_VideoPlay]",e)};e.exports=function(e,t){return{init:function(n){o("init"),n.controlBar.playToggle.on("click",(function(){a("play button click"),t.explicitPaused=!t.explicitPaused})),n.controlBar.playToggle.on("touchend",(function(){a("play button touchend"),t.explicitPaused=!t.explicitPaused})),n.on("durationchange",(function(){e.dispatchEventToAdunit({name:"durationchange"})})),n.on("firstplay",(function(){e.dispatchEventToAdunit({name:"firstplay"}),n.controlBar.muteToggle&&n.controlBar.muteToggle.update(),n.controlBar.volumeControl&&n.controlBar.volumeControl.volumeBar&&n.controlBar.volumeControl.volumeBar.update(),i()}));var i=function(){e.dispatchEventToAdunit({name:"volume-change",obj:{volume:t.isMuted?0:n.volume()},eventType:"AdUnit"})};n.on("volumechange",i),n.controlBar.playToggle.on("click",(function(){a("play button click"),!0===t.isPlayingVideo?t.explicitPause():(t.explicitPlay(),t.unmute())})),n.controlBar.playToggle.on("touchend",(function(){a("play button touchend"),!0===t.isPlayingVideo?t.explicitPause():(t.explicitPlay(),t.unmute())})),n.on("loadstart",(function(){e.dispatchEventToAdunit({name:"loadstart"})})),n.on("pause",(function(){e.options.overlayPlayer&&Math.abs(n.player().duration()-n.player().currentTime())<.5?(a("hiding big play button for overlay player at the end of the video"),n.player().bigPlayButton.el().style.display="none"):(a("showing big play button"),n.player().bigPlayButton.el().style.display="block"),t.isPlayingVideo=!1})),n.on("play",(function(){if(n.player().bigPlayButton.el().style.display="",t.options.shouldResizeVideoToFillMobileWebview){var e=window.innerWidth&&document.documentElement.clientWidth?Math.max(window.innerWidth,document.documentElement.clientWidth):window.innerWidth||document.documentElement.clientWidth||document.getElementsByTagName("body")[0].clientWidth,i=window.innerHeight&&document.documentElement.clientHeight?Math.max(window.innerHeight,document.documentElement.clientHeight):window.innerHeight||document.documentElement.clientHeight||document.getElementsByTagName("body")[0].clientHeight;t.options.width=e,t.options.height=i,t.resizeVideo(t.options.aspectRatio,!0)}t.isPlayingVideo=!0})),n.on("error",(function(n){o("error in video js");var i=r.browser.name.toLowerCase();n&&n.target&&e.options&&(e.options.vpaid||"ie"===i&&e.options.isWaterfall)&&(n.target.toString().indexOf('poster="null"')>0||"video"===n.target.nodeName.toLowerCase()&&n.target.networkState<=2||"div"===n.target.nodeName.toLowerCase())||(a("destroying due to error in video js"),t.destroyWithoutSkip(!0,e.CONST_MESSAGE_GENERAL_ERROR,null,900))})),!1===e.options.vpaid&&n.one("loadedmetadata",(function(i){var r=i.currentTarget;t.videoObjectId=r.id,t.isReadyToExpandForMobile=!0,o("loadedmetadata video.js is ready to play"),n.tech.removeControlsListeners();var a=r.videoWidth,s=a/r.videoHeight;if(a>0?(t.resizeVideo(s),"function"==typeof e.callbackForAdUnit.cbWhenReady&&e.callbackForAdUnit.cbWhenReady(t)):(t.resizeVideo(0),e.callbackForAdUnit.cbWhenReady(t)),t.verificationManager){var l={skippable:t.options.skippable.enabled,skipOffset:t.options.skippable.videoOffset,autoPlay:"auto"===t.options.initialPlayback,position:t.options.position||"standalone"};t.verificationManager.dispatchEvent("loaded",l)}}))}}}},function(e,t,n){var i=n(12);e.exports=function(e,t){return{init:function(r,o,a){var s;s="init",i.debug("[PlayerManager_PostProcess]",s),n(52)(e,t).init(r,o,a),e.isMobile()&&e.options.hasOwnProperty("overlayPlayer")&&("click"===e.options.initialPlayback||"mouseover"===e.options.initialPlayback)?r&&(r.controlBar.el_.style.setProperty("display","none","important"),e.options.hiddenControls=!0):e.options.hasOwnProperty("overlayPlayer")&&e.isIos()&&parseInt(o.getIOSVersion())<10&&"auto"===e.options.initialPlayback&&r&&(r.controlBar.el_.style.setProperty("display","none","important"),e.options.hiddenControls=!0)}}}},function(e,t,n){var i=n(12),r=n(53);e.exports=function(e,t){return{init:function(n,o,a){var s;s="init",i.debug("[PlayerManager_SettingAdIcons]",s);var l=t.options.playerSkin.controlBarHeight,d=new r;d.init(t.options.data.adIcons);var c=d.getIcons();if(c&&(!c||0!==c.length)){var u=t.options.disableTopBar?0:a,p=o.isMobile()||"below"===t.options.controlBarPosition||"fixed"===t.options.controlBarPosition?l:0;if(t.options.useMsSkin){var h=function(e,t){if(e[t])try{var n=e[t].split("px")[0],i=parseInt(n);return isNaN(i)?0:i}catch(e){return 0}return 0},f=t.iframeVideoWrapper?t.iframeVideoWrapper.contentWindow.document.getElementById("skip_Button_Wrapper"):document.getElementById(e.options.iframeVideoWrapperId).contentWindow.document.getElementById("skip_Button_Wrapper");if(f){var v=t.iframeVideoWrapper?t.iframeVideoWrapper.contentWindow.getComputedStyle(f,null):window.getComputedStyle(f,null),m=h(v,"height")+h(v,"bottom")+h(v,"padding-top")+h(v,"padding-bottom");!isNaN(m)&&m>0&&(p=m)}}if(n.controlBar.el_.style.zIndex=10,t.test("adIconOffset",d),!o.isMobile()){var g=t.iframeVideoWrapper?t.iframeVideoWrapper.contentWindow.document.getElementById(e.an_video_ad_player_id):document.getElementById(e.options.iframeVideoWrapperId).contentWindow.document.getElementById(e.an_video_ad_player_id),y=function(){if(t.isExpanded&&"below"!==t.options.controlBarPosition){var e=t.getFinalSize().height-a-l-10;d.redraw(0,e)}},b=function(){if(t.isExpanded&&"below"!==t.options.controlBarPosition){var e=t.getFinalSize().height-a-l-10;d.redraw("fixed"===t.options.controlBarPosition?0:l,e)}};n.on("useractive",(function(){b()})),n.on("userinactive",(function(){!1===n.paused()&&y()})),n.on("handleManualUserActive",(function(){b()})),n.on("handleManualUserInActive",(function(){!1===n.paused()&&y()})),g.addEventListener("mouseenter",(function(){b()})),g.addEventListener("mousemove",(function(){b()}))}n.on("timeupdate",(function(){if(!t.options.vpaid||t.options.showVpaidIcons){var e=1e3*Math.round(n.player().currentTime()),i=1e3*Math.round(n.player().duration());c&&c.length>0&&d.renderIcons((function(e){var n={};n.name=e,t.dispatchEventToAdunit(n)}),(function(e){t.click(e,!1)}),n.player().el_,u,p,e,i,t.options.useMsSkin)}}))}}}}},function(e,t,n){var i=n(11),r=n(12),o=function(e){r.debug("[AdIcon]",e)};e.exports=function(){this.icons=[],this.init=function(e){o("initalize ad icon"),e&&(this.icons=function(e){for(var t=0;t<e.length;t++){var n=e[t].StaticResource;if(n&&n.type){o("setContents for "+e[t].program);var i=e[t].width,r=e[t].height;["image/gif","image/jpeg","image/png"].indexOf(n.type.toLowerCase())>=0&&(e[t].content="<img src='"+n.src+"' width='"+i+"' height='"+r+"'",e[t].altText&&(e[t].content+=" alt='"+e[t].altText+"'"),e[t].hoverText&&(e[t].content+=" title='"+e[t].hoverText+"'"),e[t].content+=">"),e[t].isDisplay=!1}}return e}(e))},this.getIcons=function(){return this.icons},this.renderIcons=function(e,t,n,r,a,s,l,d){var c=this.getIcons(),u=this;if(a=0!==a?a+5:a,c&&!(c.length<1)){var p,h=function(n){return function(){t(n.IconClickThrough),e("IconClickTracking_"+n.program),o("fire IconClickTracking for "+n.program)}},f=function(e){setTimeout((function(){u.resolveCollision(e),o("start to check a collision of ad icon")}),500)},v=function(e,t,i){var r=0,o=n.ownerDocument.getElementsByClassName("left"===i?"vjs-ad-learnmore-tl":"vjs-ad-learnmore-tr");if(o&&o.length>0){var a=o[0],s=a.offsetTop+a.offsetHeight,l=a.offsetLeft+a.offsetWidth;e<s&&("left"===i&&t<l||"right"===i&&t>l)&&(r=s-e)}return r};for(p=0;p<c.length;p++){var m,g,y=c[p],b=y.htmlReference;if(y&&(y.duration&&(m=i.getMsecTime(y.duration)),y.offset&&(g=i.getMsecTime(y.offset))),!(m<=0||s<g||0===s)){var A;if(l>0&&s>=l){for(A=0;A<c.length;A++){var w=c[A],T=w.htmlReference;T&&(T.style.display="none",w.isDisplay=!1)}return void o("hide whole ad icons because video is finished by "+s+"ms")}if(s>g+m&&y.isDisplay&&b)b.style.display="none";else if(!y.isDisplay){var k,E="left",S=Number(S)<0?0:S,C="top",I=Number(S)<0?0:S,_=Number(r)>0?r:0,P=Number(a)>0?a:0;y&&"left"===y.xPosition&&(E="left",S=0),y&&"right"===y.xPosition&&(E="right",S=0),y&&Number(y.xPosition)>=0&&(E="left",S=Number(y.xPosition)),y&&"bottom"===y.yPosition&&(C="bottom",I=0,I+=P),y&&"top"===y.yPosition&&(C="top",I=0,I+=_),y&&Number(y.yPosition)>=0&&(C="top",I=Number(y.yPosition),I+=_),d&&y&&"top"===C&&(I+=v(I,S,E)),b?(k=b,o("reuse ad icon for "+y.program)):(k=n.ownerDocument.createElement("div"),o("create ad icon for "+y.program)),n.appendChild(k),k.setAttribute("name","adicon"),k.id="adicon_"+y.program,k.innerHTML=y.content,k.style.position="fixed",k.style.cursor="hand",k.style[E]=S+"px",k.style[C]=I+"px",d&&"right"===E&&"bottom"===C||(k.style.zIndex=2147483647),k.style.display="block",k.style.width=y.width+"px",k.style.height=y.height+"px",y.isDisplay=!0,y.htmlReference=k,y.document=n.ownerDocument,y.originalStyle={},y.originalStyle[E]=S,y.originalStyle[C]=I,y.clickRegisterd||(k.addEventListener("click",h(y)),y.clickRegisterd=!0,o("ad icon click handler registered for "+y.program)),c[p]=y,e&&"function"==typeof e&&(e("IconViewTracking_"+y.program),o("check and fire IconViewTracking for "+y.program)),p===c.length-1&&f(c)}}}}},this.elementsFromPoint=function(e,t,n){try{if(n.elementsFromPoint)return n.elementsFromPoint(e,t);var i=[],r=void 0;do{r!==n.elementFromPoint(e,t)?(r=n.elementFromPoint(e,t),i.push(r),r&&r.style&&(r.style.pointerEvents="none")):r=!1}while(r);return i.forEach((function(e){var t;return e&&e.style&&(t=e.style.pointerEvents="all"),t})),i}catch(e){return o(e),null}};var e=function(e){var t=0;return e&&Number(e)>=0&&(t=Number(e)),e&&"string"==typeof e&&e.toLowerCase()&&e.indexOf("px")&&(t=(t=Number(e.replace("px","")))>0?t:0),t};this.resolveCollision=function(t){var n,i=this,r=function(t,n){var i;for(i=0;i<t.length;i++){var r=t[i];if(r&&"adicon"===r.getAttribute("name")&&n!=r)return{result:!0,width:e(r.clientWidth),height:e(r.clientHeight),left:e(r.style.left),right:e(r.style.right)}}return{result:!1,width:0,height:0,left:0,right:0}},a=function(e,t,n,o,a,s,l,d,c){var u,p;"left"===e&&(u=t-s-1,p=n-s-1),"right"===e&&(u=t+s+1,p=n+s+1);var h=i.elementsFromPoint(u,o,d),f=i.elementsFromPoint(p,o,d),v=i.elementsFromPoint(p,a,d),m=i.elementsFromPoint(u,a,d);return{newSpaceOwner_topLeft:r(h,c),newSpaceOwner_topRight:r(f,c),newSpaceOwner_bootomRight:r(v,c),newSpaceOwner_bootomLeft:r(m,c),next_left:u,next_right:p}};for(n=1;n<t.length;n++){var s=t[n];if(s.htmlReference){var l=s.htmlReference.getBoundingClientRect(),d=l.left,c=l.top,u=l.right,p=l.bottom,h=i.elementsFromPoint(d,c,s.document),f=i.elementsFromPoint(u,c,s.document),v=i.elementsFromPoint(u,p,s.document),m=i.elementsFromPoint(d,p,s.document),g=r(h,s.htmlReference),y=r(f,s.htmlReference),b=r(v,s.htmlReference),A=r(m,s.htmlReference),w=s.program;if(g.result||b.result||y.result||A.result){o("collision detection starts for ad icon program - "+w);var T=g.width||b.width||y.width||A.width,k=(g.height||b.height||y.height||A.height,!1),E=a("left",d,u,c,p,T+=g.left||b.left||y.left||A.left,0,s.document,s.htmlReference);!1===k&&!1===E.newSpaceOwner_topLeft.result&&!1===E.newSpaceOwner_topRight.result&&!1===E.newSpaceOwner_bootomRight.result&&!1===E.newSpaceOwner_bootomLeft.result&&E.next_left>=0&&(o("collision resolved by moving icon to left for ad icon program - "+w),s.htmlReference.style.left=E.next_left+"px",k=!0),E=a("right",d,u,c,p,T,0,s.document,s.htmlReference),!1===k&&!1===E.newSpaceOwner_topLeft.result&&!1===E.newSpaceOwner_topRight.result&&!1===E.newSpaceOwner_bootomRight.result&&!1===E.newSpaceOwner_bootomLeft.result&&(o("collision resolved by moving icon to right for ad icon program - "+w),s.htmlReference.style.left=E.next_left+"px",k=!0),!1===k&&(o("hide ad-icon due to no way to avoid collision for ad icon program - "+w),s.htmlReference.style.display="none"),o("collision detection end for ad icon program - "+w)}}}},this.redraw=function(e){var t;for(t=0;t<this.icons.length;t++){var n=this.icons[t],i=n.htmlReference,r=n.originalStyle;if(r){var o=r.bottom;(o||0===o)&&("bottom"===o&&(o=0),i.style.bottom=o+e+"px")}}}}},function(e,t,n){var i=n(12);e.exports=function(e){var t;return t="init: displayVolumeControls",i.debug("Video Player: "+t),{displayVolumeControls:function(){return!e.isAndroid()||"boolean"==typeof e.options.enableAndroidVolumeControls&&!0===e.options.enableAndroidVolumeControls}}}},function(e,t,n){var i=n(56),r=n(11),o=n(12);e.exports=function(e,t){var a=this;this.options=e.options,this.topChromeHeight=24,this.iOSVideoPlayer=new i,this.videojsOrigin=e.videoPlayerObj,this.dispatchEventToAdunit=e.dispatchEventToAdunit.bind(e),this.callbackForAdUnit=e.callbackForAdUnit,this.UUID=(new Date).getTime()+Math.floor(1e4*Math.random());var s="an_video_ad_player_"+a.UUID,l="an_video_ad_player_"+a.UUID+"_html5_api";this.an_video_ad_player_id=s,this.an_video_ad_player_html5_api_id=l,e.divIdForVideo=s,e.videoId=l,this.refreshVideoLookAndFeel=r.refreshVideoLookAndFeel,this.shouldConsiderHeightOfDevice=!0,this.isDoneiOSInitialPlay=!1,this.isTogglePaused=!1,this.enabledAudio=!1,this.isFullscreen=!1,this.enableFullscreen=!0,this.fromFullscreen=!1,this.isAlreadyDoneVideoComplete=!1,this.customPlayToggle={},this.customFullscreenBtn={},this.eventSizeChange={},this.eventOrientationChange={},this.floatingAdIndicator=null,this.floatingSkipButton=null,this.floatingAdSkipText=null,this.readyForSkip=!1,this.videojsPlayer=null;var d=n(57)(a,e),c=n(58)(a,e,t),u=n(60)(a,e);this.createIframeAndRequiredObject=u.createIframeAndRequiredObject,this.fnMainProcess=c.fnMainProcess,this.handleFullScreen=d.handleFullScreen,this.handleNormalScreen=d.handleNormalScreen,this.resizeIosCanvas=d.resizeIosCanvas,this.cbWhenVideoComplete=d.cbWhenVideoComplete,this.savedBackgroundForBottomBar="",this.savedBackgroundColorForBottomBar="",this.start=function(){var e;if(e="start",o.debug("iOSInlineVideoPlayer: "+e),!1!==a.test()){var t=(new Date).getTime()+Math.floor(1e4*Math.random());a.options.iframeVideoWrapperId="iframeVideoWrapper_"+t,a.options.techOrder=["html5"],a.createIframeAndRequiredObject(a.fnMainProcess)}else!function(e){o.error("iOSInlineVideoPlayer: "+e)}("initialize error")},this.test=function(){return!!(this.createIframeAndRequiredObject&&this.fnMainProcess&&this.handleFullScreen&&this.handleNormalScreen&&this.resizeIosCanvas&&this.cbWhenVideoComplete)}}},function(e,t,n){var i=n(12),r=function(e){i.debug("iOSInlineVideoPlayer :: iOSInlineCore: "+e)},o=function(e){i.verbose("iOSInlineVideoPlayer :: iOSInlineCore: "+e)};const a=n(11);e.exports=function(){var e,t,n,s,l,d,c,u,p,h,f,v,m,g,y,b,A,w,T,k,E,S,C,I,_,P=!1,j=!1,x=0,V={keepWidth:null,keepHeight:null};this.setPubOptions=function(e){_=e};this.renderVideo=function(r,a){var u;u="renderVideo",i.log("iOSInlineVideoPlayer: "+u),navigator.appVersion.indexOf("Mobile")>-1?(I=r.cbTimeUpdate,d=r.mediaUrl,b=r.divArea,y=r.cbWhenVideoComplete,A=r.targetElement,T=r.iframeVideoWrapper,E=r.el_wholeArea,o("generating initial canvas object"),(e=document.createElement("canvas")).style["image-rendering"]="auto",b.appendChild(e),b.style.width="100%",b.style.height="100%",V.keepWidth=e.style.width,V.keepHeight=e.style.height,void 0!==r.videoElement?t=r.videoElement:(o("creating video tag"),t=document.createElement("video"),n=document.createElement("source"),t.style.display="none",t.autoplay=!1,t.preload="auto",t.controls=!0,n.src=d,t.appendChild(n),b.appendChild(t)),o("preparing audio tag"),s=document.createElement("audio"),l=document.createElement("source"),_.preloadInlineAudioForIos&&!_.vpaid&&this.activateAudio(),c=e.getContext("2d"),Date.now(),35,!1,p=!1,h=!0,f=.3,.3,.1,v=!1,m=!1,g=99999999,o("renderVideo callback"),a(!0)):a(!1)};var M=function(e){o("saveCSS");var t={};for(var n in{position:"",width:"",height:"",top:"",left:"",marginRight:"",transform:"",background:""})t[n]=e.style[n];return t},N=function(e,t){for(var n in o("loadCSS"),t)e.style[n]=t[n]},O=function(n){var i=t.videoWidth/t.videoHeight,r=0,o=0,a=_.sideStream&&_.sideStream.enabled&&_.sideStreamObject&&_.sideStreamObject.isActivated;if(!n&&a){var s,l,d=_.sideStream.width,c=_.sideStream.height,u=0;_.disableTopBar||(u=24),c-=30+u,d||c||(d=_.width,c=_.mediaHeight),d&&c?(s=d,l=c):(s=d||c/i,l=c||d/i),r=Math.round(Math.min(l*i,s)),o=Math.round(Math.min(s/i,l))}else r=e.parentElement.parentElement.style.width.replace("px",""),o=e.parentElement.parentElement.style.height.replace("px","");return{width:r,height:o}},D=function(t){var n=O(t).width,i=O(t).height;t?(e.width=n,e.height=i):(e.width=n,e.height=_.mediaHeight)},L=function(){var n=e.height/t.videoHeight*t.videoWidth,i=e.height,r=(e.width-n)/2,o=0;if(n>e.width){var a=e.width/t.videoWidth*t.videoHeight;r=0,o=Math.abs(e.height-a)/2,c.drawImage(t,r,o,e.width,a)}else c.drawImage(t,r,o,n,i)};function R(e){var n=0,i=e-x;if(j=!0,n=0===x||i>500?0:i,x=e,function(e){var n;t.currentTime=t.currentTime+e,D(m),n=Math.abs(s.currentTime-t.currentTime),!1===h&&n>=f&&n<=g&&(t.currentTime=s.currentTime+e),L(),I()}(n/=1e3),t.currentTime>=t.duration){if(o("close checking by iOSInlinePlayer"),!1!==h)return o("closed by iOSInlinePlayer"),y(),j=!1,void window.cancelAnimationFrame(u);if(s.currentTime>=s.duration)return o("closed with audio by iOSInlinePlayer"),y(),j=!1,void window.cancelAnimationFrame(u)}!1===p?u=window.requestAnimationFrame(R):(j=!1,window.cancelAnimationFrame(u))}var U=function(){this.resumeVideo()},B=function(){return{width:window.innerWidth,height:window.innerHeight-_.playerSkin.controlBarHeight,top:0,left:0}},F=function(){A.style.backgroundColor="black",A.style.width="100%",A.style.height="100%",A.style.position="fixed",A.style.top="0px",A.style.left="0px",A.style.zIndex="999999",A.style.background="rgba(0,0,0,1)",A.style.transition="height 0s ease",E.style.background="rgba(0,0,0,1)",e.style.background="rgba(0,0,0,1)",T.style.background="rgba(0,0,0,1)"},H=function(){N(A,w),A.style.height=B().height+"px"},W=function(e){if(e.target.videoWidth/e.target.videoHeight,T.hasOwnProperty("iOS14ResumeTime"))try{var t=T.iOS14ResumeTime;e.target.currentTime=t,s.currentTime=t}catch(t){e.target.currentTime=0,r(t)}finally{T.iOS14ResumeTime=0}},z=function(){var e=a.isPortrait(),t=B(),n=t.width,i=t.height,r=t.top,o=t.left,s=0;const l=T.contentWindow.document.getElementById("top_chrome");if(l){const t=l.nextSibling,i=t.getElementsByClassName("top-bar-text")[0],r=t.getElementsByClassName("top-bar-text")[1],o=t.getElementsByClassName("top-bar-text")[2];s=parseInt(l.style.height),l.style.display="none",i.style.display="block",r.style.display="block",o.style.display="block",e||(i.style.display="none",r.style.display="none",o.style.display="none",l.style.display="block",l.style.width=n+"px")}T.style.position="absolute",T.style.width="100%",T.style.height="100%",T.style.top=r+"px",T.style.left=o+"px",T.style.marginRight="",T.style.transform="",E.style.width=n+"px",E.style.height=e?String(i)+"px":String(i-s)+"px",E.style.marginLeft="",E.style.marginRight=""},q=function(){m=!1,A.ontouchmove=function(){return!0},e.ontouchmove=function(){return!0},E.ontouchmove=function(){return!0},H(),N(A,w),N(T,k),N(E,S),N(e,C)};this.exitFullscreeenAsCanvas=function(){q(),!0===p&&this.resizeAndRedraw()},this.enterFullscreenAsCanvas=function(){A.ontouchmove=function(){return!1},e.ontouchmove=function(){return!1},E.ontouchmove=function(){return!1},w=M(A),k=M(T),S=M(E),C=M(e),A.style.marginLeft="0px",A.style.marginRight="0px",A.style.marginTop="0px",A.style.marginBottom="0px",m=!0,F(),z(),!0===p&&this.resizeAndRedraw()},this.resizeAndRedraw=function(){D(m),L()},this.initialPlay=function(e){this.play(e)},this.play=function(e){j||(p=!1,e&&s&&s.play&&s.play(),u=window.requestAnimationFrame(R))},this.resumeVideo=function(){p=!1,s&&s.play&&s.play(),u=window.requestAnimationFrame(R)},this.pauseVideo=function(){p=!0,s.pause(),window.cancelAnimationFrame(u),j=!1},this.activateAudio=function(){r("activateAudio : "+t.src),s.style.display="none",s.autoplay=!1,s.preload="auto",s.controls=!0,l.src=t.src,s.appendChild(l),b.appendChild(s),s.load()},this.hearAudio=function(){if(v)return r("resume audio"),h=!1,s.currentTime=t.currentTime,void(p||s.play());s.addEventListener("playing",(function(){r("first playing audio"),s.currentTime=t.currentTime+f,h=!1,v=!0})),!1===_.preloadInlineAudioForIos&&this.activateAudio(),s.currentTime=t.currentTime,p||s.play()},this.stopAudio=function(){r("pausing audio"),s.pause(),h=!0},this.checkOrientation=function(){P&&!_.disableCollapse.enabled||(m?(H(),F(),z(),!0===p&&this.resizeAndRedraw()):(D(m),L()))},this.initiate=function(){t.addEventListener("canplaythrough",W.bind(this)),t.addEventListener("webkitendfullscreen",U,!1),t.load(),t.pause()},this.getCanvas=function(){return e},this.destroy=function(){window.cancelAnimationFrame(u),m&&q(),P=!0},this.resizeCanvas=D,this.redrawCanvas=L}},function(e,t,n){var i=n(11),r=n(12),o=function(e){r.debug("iOSInlineVideoPlayer :: EmulateHtml5Video: "+e)},a=function(e){r.verbose("iOSInlineVideoPlayer :: EmulateHtml5Video: "+e)},s=n(44);e.exports=function(e,t){return{handleFullScreen:function(n){t.isFullscreen=!0,o("handleFullScreen");var i=n.contentWindow.document.getElementById("top_chrome");e.dispatchEventToAdunit({name:"fullscreenchange",fullscreenStatus:"enter"}),e.iOSVideoPlayer.enterFullscreenAsCanvas(),e.isFullscreen=!0,i&&(i.style.display="none"),e.options.disableTopBar||(a("Hiding ad text for fullscreen"),e.floatingAdIndicator.style.display="block",e.floatingSkipButton&&(e.readyForSkip?(e.floatingSkipButton.style.display="block",e.floatingAdSkipText.style.display="none"):(e.floatingSkipButton.style.display="none",e.floatingAdSkipText.style.display="block")))},handleNormalScreen:function(n){t.isFullscreen=!1,o("handleNormalScreen");var r=n.contentWindow.document.getElementById("top_chrome");e.dispatchEventToAdunit({name:"fullscreenchange",fullscreenStatus:"exit"}),r&&(r.style.display="block"),e.options.disableTopBar||(a("Showing ad text for fullscreen"),e.floatingAdIndicator.style.display="none",e.floatingSkipButton&&(e.floatingSkipButton.style.display="none",e.floatingAdSkipText.style.display="none")),e.iOSVideoPlayer.exitFullscreeenAsCanvas(),e.isFullscreen=!1,!1===(t.options.sideStream&&t.options.sideStream.enabled&&t.options.sideStreamObject&&t.options.sideStreamObject.isActivated)&&e.refreshVideoLookAndFeel(e.options,t),e.resizeIosCanvas(e.isFullscreen);var s=document.getElementById(t.videoObjectId);s&&void 0!==s&&(s.style.width=e.options.width,s.style.height=e.options.height);var l=t.options.sideStream&&t.options.sideStream.enabled,d=t.options.sideStreamObject&&"function"==typeof t.options.sideStreamObject.moveAdUnitBack;l&&d&&t.options.sideStreamObject.moveAdUnitBack(),!1===t.options.sideStreamObject.isActivated&&i.makeIframeFlexbileSize(t)},resizeIosCanvas:function(t){e.iOSVideoPlayer.resizeCanvas(t),e.iOSVideoPlayer.redrawCanvas(t)},cbWhenVideoComplete:function(n,r){if(o("cbWhenVideoComplete"),e.isFullscreen&&(e.fromFullscreen=!0,e.handleNormalScreen(n)),!0===e.options.disableCollapse.enabled&&(t.options.sideStreamObject&&t.options.sideStreamObject.isActivated&&t.options.sideStreamObject.moveAdUnitBack(),t.options.sideStream.wasEnabled=t.options.sideStream.enabled,t.options.sideStream.enabled=!1),!0!==e.options.disableCollapse.enabled||!0!==e.options.disableCollapse.replay&&!0!==e.options.endCard.enabled){if(e.isAlreadyDoneVideoComplete)return;e.isAlreadyDoneVideoComplete=!0,"below"===e.options.controlBarPosition&&(e.videojsPlayer.controlBar.el().style.bottom=s.getBottomMarginForControlbar(e.options,!1)+"em"),a("removing control bar items"),e.videojsPlayer.trigger("concealControls"),a("destroying iOSVideoPlayer"),e.iOSVideoPlayer.destroy(),e.resizeIosCanvas(e.isFullscreen),e.options.disableCollapse.enabled||(window.removeEventListener("orientationchange",e.eventOrientationChange),window.removeEventListener("resize",e.eventSizeChange));e.dispatchEventToAdunit({name:"video_complete"},(function(){if(!e.options.disableCollapse.enabled){var n=t.options.sideStream&&t.options.sideStream.enabled&&t.options.sideStreamObject&&t.options.sideStreamObject.isActivated;t.isFullscreen=!n,t.destroyWithoutSkip()}t.isCompleted=!0,e.options.vpaid&&i.fireEvent(r,"ended")}))}else if(e.options.endCard.enabled&&t.endCard){if(!0===e.options.disableCollapse.hideControlBar){var l=Number(t.adVideoPlayer.controlBar.el_.offsetHeight);if(e.videojsPlayer.trigger("concealControls"),t.adVideoPlayer.controlBar.hide(),"below"===t.options.controlBarPosition){var d=t.options.targetElement,c=parseInt(d.style.height,10);if(d.style.height=String(c-l)+"px",e.options.sideStreamObject.enabled){var u=parseInt(d.childNodes[0].style.height)>1?0:1,p=parseInt(d.childNodes[u].style.height);d.childNodes[u].style.height=String(p-l)+"px"}}}t.endCard.show(),t.adVideoPlayer.controlBar.show(),e.dispatchEventToAdunit({name:"video_complete"})}else e.videojsPlayer.bigPlayButton.addClass("vjs-big-play-button-replay"),t.explicitPause(),e.videojsPlayer.currentTime(0),e.videojsPlayer.bigPlayButton.show(),e.videojsPlayer.player().bigPlayButton.el().style.display="block",e.dispatchEventToAdunit({name:"video_complete"});t.isEnded=!0}}}},function(e,t,n){var i=n(11),r=n(20),o=n(12),a=function(e){o.debug("iOSInlineVideoPlayer :: Events: "+e)},s=function(e){o.error("iOSInlineVideoPlayer :: Events: "+e)},l=n(53),d=n(35);e.exports=function(e,t,c){return{fnMainProcess:function(u){var p,h;h="fnMainProcess",o.log("iOSInlineVideoPlayer: "+h);var f=u.contentWindow.document.getElementById(e.an_video_ad_player_id);if(t.iframeVideoWrapper=u,e.options.vpaid)try{t.options.showVpaidIcons=!1,r(t)}catch(e){s(e)}else e.options.isWaterfall&&e.options.plugins&&(e.options.plugins=null);e.options.nativeControlsForTouch=!1,e.options.customControlsOnMobile=!1,e.videojsPlayer=e.videojsOrigin(f,e.options,(function(){})),n(59)(e,t,c,e.videojsPlayer,u).run(),t.adVideoPlayer=e.videojsPlayer;var v=e.options.wcElement&&e.options.wcElement instanceof Element?e.options.wcElement.querySelector("#"+String(e.options.iframeVideoWrapperId)):document.getElementById(e.options.iframeVideoWrapperId),m=v.contentWindow.document.getElementById(e.an_video_ad_player_id),g=v.contentWindow.document.getElementById(e.an_video_ad_player_html5_api_id);!0===e.options.enableInlineVideoForIos&&(g.style.width="0.1px",g.style.height="0.1px");var y=document.createElement("div");y.style.position="absolute",y.style.top="0px",y.style.left="0px",e.options.vpaid||(y.className="vjs-tech"),y.style.textAlign="center",m.insertBefore(y,g),e.options.targetElement.addEventListener("IOS_INLINE_RESIZE",(function(){e.resizeIosCanvas(!1)})),e.options.targetElement.addEventListener("IOS_INLINE_REFERESH",(function(){e.refreshVideoLookAndFeel(e.options,t),e.iOSVideoPlayer.checkOrientation(),e.customFullscreenBtn.style.visibility="hidden"}));var b={mediaUrl:e.options.videoUrl,divArea:y,width:e.options.width,height:e.options.height,videoElement:g,cbWhenVideoComplete:function(){e.cbWhenVideoComplete(u,g)},targetElement:e.options.targetElement,iframeVideoWrapper:u,el_wholeArea:m,cbTimeUpdate:function(){e.videojsPlayer.trigger("timeupdate")}},A=e.options.isWaterfall?e.options.waterfallStepId:null;e.iOSVideoPlayer.setPubOptions(e.options),e.iOSVideoPlayer.renderVideo(b,(function(n){n?(e.eventOrientationChange=function(){if((!A||A===e.options.waterfallStepId)&&t.isReadyToExpandForMobile){if(!(!t.options.sideStreamObject||"function"!=typeof t.options.sideStreamObject.shouldNotResizeWhenSideStreamActivated)&&t.options.sideStreamObject.shouldNotResizeWhenSideStreamActivated())return;e.refreshVideoLookAndFeel(e.options,t),e.iOSVideoPlayer.checkOrientation()}},e.eventSizeChange=function(){A&&A!==e.options.waterfallStepId||e.isFullscreen&&(t.resizeVideo(-1,e.shouldConsiderHeightOfDevice),e.iOSVideoPlayer.checkOrientation())},window.addEventListener("resize",e.eventSizeChange),window.addEventListener("orientationchange",(function(){(t.isCompleted||t.isEnded)&&!1===e.options.disableCollapse.enabled||(clearTimeout(p),p=setTimeout((function(){e.eventOrientationChange()}),250))})),g.onseeked=function(){return!1},"auto"===e.options.initialPlayback?e.videojsPlayer.player().loadingSpinner.show():e.videojsPlayer.player().loadingSpinner.hide(),e.videojsPlayer.player().off("seeked"),e.iOSVideoPlayer.initiate(),"click"===e.options.initialPlayback&&g.addEventListener("canplay",(function(){e.iOSVideoPlayer.checkOrientation()}))):a("only works in iOS")})),e.videojsPlayer.controlBar.fullscreenToggle.dispose(),!0===e.options.allowFullscreen&&e.enableFullscreen&&(e.customFullscreenBtn=e.videojsOrigin.createEl("div",{id:"customFullscreenToggle",role:"button",innerHTML:'<div class="vjs-control-content"><span class="vjs-control-text">Fullscreen</span></div>'}),e.customFullscreenBtn.style.cssText="text-align:right;float:right;margin-right:0em;font-size:1em;line-height:3em;outline:0;position:relative;padding:0;height:3em",e.customFullscreenBtn.className="vjs-fullscreen-control vjs-control",e.videojsPlayer.controlBar.addChild("button",{el:e.customFullscreenBtn}),e.customFullscreenBtn.addEventListener("touchend",(function(t){setTimeout((function(){if(e.isFullscreen){var n=document.getElementById(e.options.iframeVideoWrapperId).contentWindow.document.getElementById(e.an_video_ad_player_html5_api_id),i=n.style.visibility;n.style.visibility="hidden",setTimeout((function(){e.handleNormalScreen(u),n.style.visibility=i}),0)}else e.handleFullScreen(u);t.preventDefault()}),200)}))),e.iOSVideoPlayer.getCanvas().onclick=function(){!1===e.options.learnMore.enabled?(t.options.expandable||t.explicitPause(),t.click()):!0===e.options.learnMore.clickToPause&&(!1===e.isTogglePaused?t.explicitPause():t.explicitPlay())};var w,T=function(t){e.customPlayToggle.innerHTML=t?"<div><span>&#xe001;</span></div>":"<div><span>&#xe002;</span></div>"},k=function(){e.videojsPlayer.player().bigPlayButton.hide(),e.videojsPlayer.player().loadingSpinner.hide(),e.videojsPlayer.player().addClass("vjs-has-started"),e.videojsPlayer.player().removeClass("vjs-paused"),e.videojsPlayer.player().addClass("vjs-playing");try{T(!1);var n=e.enabledAudio;e.iOSVideoPlayer.initialPlay(n),a("override play method"),e.isDoneiOSInitialPlay?(i.fireEvent(g,"play"),i.fireEvent(g,"playing")):(i.fireEvent(g,"play"),i.fireEvent(g,"playing"),e.isDoneiOSInitialPlay=!0),t.isPlayingVideo=!0,e.isTogglePaused=!1}catch(e){s(e)}},E=function(){if(!e.isTogglePaused&&!t.isCompleted&&!t.isEnded){if(!1!==e.options.showBigPlayButton)!0===(t.options.sideStream&&t.options.sideStream.enabled&&t.options.sideStreamObject&&t.options.sideStreamObject.isActivated)&&!0===t.options.showPlayToggle&&1==t.options.sideStream.dynamicBigPlayButtonOnSideStream||(e.videojsPlayer.bigPlayButton.show(),e.videojsPlayer.player().bigPlayButton.el().style.display="block");e.iOSVideoPlayer.pauseVideo(),a("override pause method"),T(!0),t.isPlayingVideo=!1,e.isTogglePaused=!0,i.fireEvent(g,"pause")}};e.options.vpaid?(w=function(e){e&&0===e.readyState&&e.load()},g.play=function(){w(g),k()},g.pause=function(){E()},e.videojsPlayer.one("vpaid.AdStarted",(function(){w(g)})),e.videojsPlayer.one("an.readytogovpaid",(function(){e.iOSVideoPlayer.activateAudio(),w(g)}))):(g.play=k,g.pause=E),e.videojsPlayer.controlBar.el().ontouchend=function(){},e.videojsPlayer.controlBar.playToggle.dispose(),e.customPlayToggle=e.videojsOrigin.createEl("div",{id:"customPlayToggle",role:"button","aria-live":"polite",tabindex:"0",innerHTML:"<div><span>&#xe002;</span></div>",width:"5em"}),e.customPlayToggle.style.cssText="float:left;font-family:VideoJS;font-size:1.5em;line-height:2;width:3em;height:100%;text-align:center",e.videojsPlayer.controlBar.addChild("button",{el:e.customPlayToggle}),e.videojsPlayer.controlBar.el().insertBefore(e.customPlayToggle,e.videojsPlayer.controlBar.currentTimeDisplay.el()),e.customPlayToggle.ontouchend=function(n){!1===e.isTogglePaused?t.explicitPause():t.explicitPlay(),n.preventDefault()},e.customPlayToggle.onclick=function(){!1===e.isTogglePaused?t.explicitPause():t.explicitPlay()},e.videojsPlayer.controlBar.muteToggle.el().ontouchend=function(){e.enabledAudio?(e.iOSVideoPlayer.stopAudio(),e.enabledAudio=!1,e.videojsPlayer.controlBar.muteToggle.el_.style.opacity="0.3",t.dispatchEventToAdunit({name:"video_mute"})):(e.iOSVideoPlayer.hearAudio(),e.enabledAudio=!0,e.videojsPlayer.controlBar.muteToggle.el_.style.opacity="1",t.dispatchEventToAdunit({name:"video_unmute"}),!0===e.isTogglePaused&&t.explicitPause())},e.videojsPlayer.controlBar.muteToggle.el().onclick=function(){e.enabledAudio?(e.iOSVideoPlayer.stopAudio(),e.enabledAudio=!1,e.videojsPlayer.controlBar.muteToggle.el_.style.opacity="0.3"):(e.iOSVideoPlayer.hearAudio(),e.enabledAudio=!0,e.videojsPlayer.controlBar.muteToggle.el_.style.opacity="1",!0===e.isTogglePaused&&t.explicitPause())},e.videojsPlayer.one("loadedmetadata",(function(n){if(!1===e.options.showPlayToggle&&e.videojsPlayer.controlBar.playToggle.hide(),!1===e.options.showBigPlayButton&&e.videojsPlayer.bigPlayButton.hide(),!1===e.options.showMute?e.videojsPlayer.controlBar.muteToggle.hide():(e.videojsPlayer.controlBar.muteToggle.show(),e.videojsPlayer.controlBar.muteToggle.el_.style.opacity="0.3"),!0===e.options.allowFullscreen&&(e.customFullscreenBtn.style.display="none"),!0===e.options.showMute&&e.videojsPlayer.controlBar.muteToggle.show(),e.options.targetElement.addEventListener("outstream-impression",(function(){!0===e.options.allowFullscreen&&(e.customFullscreenBtn.style.display="block"),!0===e.options.showMute&&e.videojsPlayer.controlBar.muteToggle.show()})),!t.options.vpaid){t.isReadyToExpandForMobile=!0,t.videoObjectId=n.currentTarget.id,a("loadedmetadata"),a("video.js is ready to play"),e.videojsPlayer.tech.removeControlsListeners();var i=n.currentTarget.videoWidth,r=i/n.currentTarget.videoHeight;i>0?(t.resizeVideo(r,e.shouldConsiderHeightOfDevice),"function"==typeof e.callbackForAdUnit.cbWhenReady&&e.callbackForAdUnit.cbWhenReady(t)):(t.resizeVideo(0,e.shouldConsiderHeightOfDevice),e.callbackForAdUnit.cbWhenReady(t))}})),t.customSkinning.render(e,e.videojsPlayer,u.contentWindow.document,!0);c(m,g),function(){var n=t.options.playerSkin.controlBarHeight,i=e.videojsPlayer,r=new l;r.init(t.options.data.adIcons);var o=r.getIcons();if(o&&(!o||0!==o.length)){var a=t.options.disableTopBar?0:24,s=n;i.controlBar.el_.style.zIndex=10,t.test("adIconOffset",r),i.on("timeupdate",(function(){if(!t.options.vpaid||t.options.showVpaidIcons){var e=1e3*Math.round(i.player().currentTime()),n=1e3*Math.round(i.player().duration());o&&o.length>0&&r.renderIcons((function(e){var n={};n.name=e,t.dispatchEventToAdunit(n)}),(function(e){t.options.expandable||t.explicitPause(),t.click(e,!1)}),i.player().el_,a,s,e,n)}}))}}(),e.options.vpaid&&e.videojsPlayer.trigger("an.doneInitialize"),e.options.endCard.enabled&&(t.endCard=new d(e.options.endCard,e.videojsPlayer,t)),e.videojsPlayer.on("concealControls",(function(){var t=e.videojsPlayer.player().controlBar;if(!0===e.options.disableCollapse.enabled&&!0===e.options.disableCollapse.hideControlBar&&!1===e.options.disableCollapse.replay&&(t.hide(),e.options.sideStreamObject.isActivated)){var n=parseInt(e.options.targetElement.childNodes[0].style.height)>1?0:1,r=parseInt(e.options.targetElement.childNodes[n].style.height);e.options.targetElement.childNodes[n].style.height=r-30+"px"}t&&!t.concealed&&(t.currentTimeDisplay&&t.currentTimeDisplay.hide(),t.durationDisplay&&t.durationDisplay.hide(),t.timeDivider&&t.timeDivider.hide(),t.muteToggle&&t.muteToggle.hide(),t.playToggle&&t.playToggle.hide(),t.fullscreenToggle&&t.fullscreenToggle.hide(),t.progressControl&&t.progressControl.hide(),t.volumeControl&&t.volumeControl.hide(),!1===i.isEmptyAndObject(e.customPlayToggle)&&(e.customPlayToggle.style.display="none"),!1===i.isEmptyAndObject(e.customFullscreenBtn)&&(e.customFullscreenBtn.style.display="none"),e.savedBackgroundColorForBottomBar=t.el_.style.backgroundColor,e.savedBackgroundForBottomBar=t.el_.style.background,t.concealed=!0)})),e.videojsPlayer.on("revealControls",(function(){var t=e.videojsPlayer.player().controlBar;t&&t.concealed&&("bar"!==e.options.showProgressBar&&!1!==e.options.showProgressBar&&(t.currentTimeDisplay&&t.currentTimeDisplay.show(),t.durationDisplay&&t.durationDisplay.show(),t.timeDivider&&t.timeDivider.show()),t.muteToggle&&e.options.showMute&&t.muteToggle.show(),t.playToggle&&e.options.showPlayToggle&&t.playToggle.show(),t.fullscreenToggle&&e.options.allowFullscreen&&t.fullscreenToggle.show(),!1!==e.options.showProgressBar&&"text"!==e.options.showProgressBar&&t.progressControl&&t.progressControl.show(),!1===i.isEmptyAndObject(e.customPlayToggle)&&(e.customPlayToggle.style.display="block"),!1===i.isEmptyAndObject(e.customFullscreenBtn)&&(e.customFullscreenBtn.style.display="block"),t.el_.style.backgroundColor=e.savedBackgroundColorForBottomBar,t.el_.style.background=e.savedBackgroundForBottomBar,t.concealed=!1)}))}}}},function(e,t,n){var i=n(12),r=function(e){i.verbose("Video Player: "+e)},o=n(11);e.exports=function(e,t,n,a,s){return{run:function(){var n;if(n="run",i.debug("iOSInlineVideoPlayer :: CustomizeVideoArea: "+n),e.options.isWaterfall&&e.options.vpaid&&(a.controlBar.hide(),e.options.firstAdAttempted&&a.bigPlayButton.hide()),"boolean"==typeof e.options.customButton.enabled&&!0===e.options.customButton.enabled){var l=e.options.playerSkin.controlBarHeight||30,d=Math.min(50,e.options.customButton.imgWidth),c=Math.min(l,e.options.customButton.imgHeight),u=Math.floor((l-c)/2),p=e.videojsOrigin.createEl("div",{innerHTML:'<span ><img style="height:'+c+"px;width:"+d+"px;margin-top:"+u+'px" class="home-button-image" src="'+e.options.customButton.imageSrc+'" alt="'+e.options.customButton.altText+'"></span>',role:"button","aria-live":"polite",tabindex:"0"});p.style.cssText="float:right;font-family:VideoJS;font-size:1.5em;line-height:2;width:50px;height:100%;text-align:center",a.controlBar.addChild("button",{el:p}),a.controlBar.el().insertBefore(p,a.controlBar.fullscreenToggle.el())}a.controlBar.progressControl.seekBar.seekHandle.hide(),a.controlBar.progressControl.seekBar.el_.style.pointerEvents="none","boolean"==typeof e.options.showProgressBar?(!1===e.options.showProgressBar&&(r("removing progress bar"),a.controlBar.currentTimeDisplay.hide(),a.controlBar.timeDivider.hide(),a.controlBar.durationDisplay.hide()),a.controlBar.progressControl.seekBar.hide()):"text"===e.options.showProgressBar?(r("removing progress text"),a.controlBar.progressControl.seekBar.hide()):"bar"===e.options.showProgressBar&&(r("removing progress bar"),a.controlBar.currentTimeDisplay.hide(),a.controlBar.timeDivider.hide(),a.controlBar.durationDisplay.hide()),!1===e.options.showVolume&&a.controlBar.volumeControl.dispose();var h=e.videojsOrigin.createEl("div");h.className="vjs-control-bar-divider",h.style.position="absolute",h.style.left="0",h.style.right="0",a.controlBar.addChild("button",{el:h});var f=s.contentWindow.document.getElementById("top_chrome"),v=s.contentWindow.document.createElement("div");v.id="ad_indicator_text";var m,g,y=e.options.adText,b=e.options.learnMore.enabled;if(e.options.clickUrls[0]||(b=!1),b&&("top-right"===e.options.skippable.skipLocation?y=e.options.learnMore.text+" "+e.options.learnMore.separator+" "+y:y+=" "+e.options.learnMore.separator+" "+e.options.learnMore.text),v.innerHTML=y,v.className="top-bar-text",v.role="button",v.style["text-align"]="right",v.style["margin-right"]="1em",v.style["margin-left"]="1em",v.style["font-size"]="1em",v.style.right="0px",v.style.left="",v.style["line-height"]="24px",v.style.outline="0",v.style.position="absolute",v.style.padding="0",v.style.height="auto",v.style.width="auto",v.style["max-width"]="35%",v.style["white-space"]="nowrap",v.style.overflow="hidden",v.style["text-overflow"]="ellipsis",e.floatingAdIndicator=e.videojsOrigin.createEl("div",{role:"button",innerHTML:y,className:"top-bar-text"}),e.floatingAdIndicator.style["text-align"]="right",e.floatingAdIndicator.style["margin-right"]="1em",e.floatingAdIndicator.style["margin-left"]="1em",e.floatingAdIndicator.style["font-size"]="1em",e.floatingAdIndicator.style.right="0px",e.floatingAdIndicator.style.left="",e.floatingAdIndicator.style["line-height"]="3em",e.floatingAdIndicator.style.outline="0",e.floatingAdIndicator.style.position="absolute",e.floatingAdIndicator.style.padding="0",e.floatingAdIndicator.style.height="3em",e.floatingAdIndicator.style["max-width"]="35%",e.floatingAdIndicator.style.width="auto",e.floatingAdIndicator.style["text-overflow"]="ellipsis",e.floatingAdIndicator.style["white-space"]="nowrap",e.floatingAdIndicator.style.overflow="hidden",e.floatingAdIndicator.style.display="none",a.addChild("button",{el:e.floatingAdIndicator}),b){var A=function(n){e.iOSVideoPlayer.pauseVideo(),t.click(),n.stopPropagation(),n.preventDefault()};v.addEventListener("click",A),e.floatingAdIndicator.addEventListener("click",A)}if(!0===e.options.skippable.enabled){var w=e.options.skippable.videoThreshold,T=e.options.skippable.skipText,k=e.options.skippable.skipButtonText;(m=s.contentWindow.document.createElement("div")).id="skip_button",m.innerHTML=k,m.className="top-bar-text",m.role="button",m.style.display="none",m.style.cursor="pointer",m.style["font-weight"]="bold",m.style["margin-right"]="1em",m.style["margin-left"]="1em",m.style["font-size"]="1em",m.style.right="",m.style.left="0px",m.style["line-height"]="24px",m.style.outline="0",m.style.position="absolute",m.style.padding="0",m.style.height="5em",m.style.width="auto",m.style["min-width"]="5em",m.style["text-align"]="left",e.floatingSkipButton=e.videojsOrigin.createEl("div",{className:"top-bar-text",role:"button",innerHTML:k}),e.floatingSkipButton.style.display="none",e.floatingSkipButton.style.cursor="pointer",e.floatingSkipButton.style["font-weight"]="bold",e.floatingSkipButton.style["margin-right"]="1em",e.floatingSkipButton.style["margin-left"]="1em",e.floatingSkipButton.style["font-size"]="1em",e.floatingSkipButton.style.right="",e.floatingSkipButton.style.left="0px",e.floatingSkipButton.style["line-height"]="3em",e.floatingSkipButton.style.outline="0",e.floatingSkipButton.style.position="absolute",e.floatingSkipButton.style.padding="0",e.floatingSkipButton.style.height="5em",e.floatingSkipButton.style["min-width"]="5em",e.floatingSkipButton.style.width="auto",e.floatingSkipButton.style.display="none",e.floatingSkipButton.style["text-align"]="left",a.addChild("button",{el:e.floatingSkipButton});var E=function(n){window.removeEventListener("orientationchange",e.eventOrientationChange),window.removeEventListener("resize",e.eventSizeChange),e.iOSVideoPlayer.destroy(),t.pause(),t.isFullscreen=e.isFullscreen,t.forceToSkip=!0,t.destroy(),t.isCompleted=!0,n.stopPropagation(),n.preventDefault()};switch(m.addEventListener("touchend",E),m.addEventListener("click",E),e.floatingSkipButton.addEventListener("touchend",E),e.floatingSkipButton.addEventListener("click",E),(g=s.contentWindow.document.createElement("div")).id="ad_skip_text",g.innerHTML=k,g.className="top-bar-text",g.role="button",g.style["margin-left"]="1em",g.style["margin-right"]="1em",g.style.right="",g.style.left="0px",g.style["font-size"]="1em",g.style["line-height"]="24px",g.style.outline="0",g.style.position="absolute",g.style["text-align"]="left",g.style.padding="0",g.style.height="3em",g.style.width="auto",g.style["pointer-events"]="none",g.style.display="none",e.floatingAdSkipText=e.videojsOrigin.createEl("div",{role:"button",className:"top-bar-text",innerHTML:""}),e.floatingAdSkipText.style["margin-left"]="1em",e.floatingAdSkipText.style["margin-right"]="1em",e.floatingAdSkipText.style.right="",e.floatingAdSkipText.style.left="0px",e.floatingAdSkipText.style["font-size"]="1em",e.floatingAdSkipText.style["line-height"]="3em",e.floatingAdSkipText.style.outline="0",e.floatingAdSkipText.style.position="absolute",e.floatingAdSkipText.style["text-align"]="left",e.floatingAdSkipText.style.padding="0",e.floatingAdSkipText.style.height="3em",e.floatingAdSkipText.style.width="auto",e.floatingAdSkipText.style["pointer-events"]="none",e.floatingAdSkipText.style.display="none",a.addChild("button",{el:e.floatingAdSkipText}),e.options.skippable.skipLocation){case"top-right":m.style.right="0px",m.style.left="",m.style["text-align"]="right",g.style.right="0px",g.style.left="",e.floatingSkipButton.style.right="0px",e.floatingSkipButton.style.left="",e.floatingSkipButton.style["text-align"]="right",e.floatingAdSkipText.style.right="0px",e.floatingAdSkipText.style.left=""}var S=!1,C=!1,I=!1,_={},P=function(){var n,i=Math.round(a.player().duration()),r=Math.round(a.player().currentTime()),s=(n=t.options.skippable.allowOverride?Math.round(e.options.data.skipOffsetMsec/1e3):e.options.skippable.videoOffset)-r,l=!e.options.skippable.allowOverride||e.options.data.isVastVideoSkippable;l=!(n>i)&&l,t.test("VIDLA163_needToShowSkip",l),w<i&&!e.options.disableTopBar&&l&&(s>0&&!t.startedReplay&&!t.isEnded?(e.floatingAdSkipText.innerHTML=T.replace("%%TIME%%",s),m.style.display="none",g.innerHTML=T.replace("%%TIME%%",s),g.style.display="block",o.elementsOverlap(g,v)&&(g.style.display="none")):(e.readyForSkip||(t.test("log",r),t.test("VIDLA163_skip",r)),e.readyForSkip=!0,e.isFullscreen&&(e.floatingAdSkipText.style.display="none",o.isPortrait()&&(e.floatingSkipButton.style.display="block")),g.style.display="none",m.style.display="block"))};a.on("resize",(function(){P()})),a.on("timeupdate",(function(){var n=t.options.data.vastProgressEvent;if(!e.options.isWaterfall||!e.options.vpaid||e.options.vpaidImpressionFired){var i=1e3*Math.round(a.player().currentTime());if(n&&"object"==typeof n){var r=function(){t.test("VIDLA163_Tracking",_)};for(var o in n){var s=n[o];if(s&&s>=0&&i>=s&&-1===Object.keys(_).indexOf(o)){_[o]=s;var l={};l.name=o,l.name&&t.dispatchEventToAdunit(l,r)}}}P()}}))}if(e.options.skippable&&e.options.skippable.skipLocation)switch(e.options.skippable.skipLocation){case"top-right":v.style.right="",v.style.left="0px",e.floatingAdIndicator.style.right="",e.floatingAdIndicator.style.left="0px"}!e.options.disableTopBar&&f&&(!0===e.options.skippable.enabled&&(f.appendChild(m),f.appendChild(g)),f.appendChild(v)),a.on("timeupdate",(function(){if(!e.options.vpaid){var t=Math.round(a.player().currentTime()),n=a.player().duration(),i=n/4*2,r=n/4*3;!S&&t>=n/4&&t<i&&(e.dispatchEventToAdunit({name:"video-first-quartile"}),S=!0),!C&&t>=i&&t<r&&(e.dispatchEventToAdunit({name:"video-mid"}),C=!0),!I&&t>=r&&(e.dispatchEventToAdunit({name:"video-third-quartile"}),I=!0)}}));var j=function(){t.isEnded&&e.options.disableCollapse.replay&&(t.replay(),!1===e.options.showBigPlayButton&&a.player().bigPlayButton.hide(),a.player().bigPlayButton.removeClass("vjs-big-play-button-replay")),t.isDoneInitialPlay&&(t.isPlayingVideo=!1),t.explicitPlay()};a.player().bigPlayButton.on("touchend",(function(e){j(),e.preventDefault()})),a.player().bigPlayButton.on("click",(function(){j()})),a.on("error",(function(){t.destroyWithoutSkip(!0,"General error reported from HTML5 video player (iOS inline)",null,900)})),a.on("loadstart",(function(){e.dispatchEventToAdunit({name:"loadstart"})})),a.on("pause",(function(){!0===(t.options.sideStream&&t.options.sideStream.enabled&&t.options.sideStreamObject&&t.options.sideStreamObject.isActivated)&&!0===t.options.showPlayToggle&&1==t.options.sideStream.dynamicBigPlayButtonOnSideStream||t.isFullscreen||(a.player().bigPlayButton.el().style.display="block")}))}}}},function(e,t,n){var i=n(12),r=function(e){i.debug("Video Player: "+e)},o=n(61);e.exports=function(e,t){return{createIframeAndRequiredObject:function(n){var a;a="createIframeAndRequiredObject",i.log("Video Player: "+a);var s=e.options,l=document.createElement("iframe");l.src="about:blank",s.targetElement.appendChild(l),l.style.width=s.width+"px",l.style.height=s.height+"px",l.id=s.iframeVideoWrapperId,l.setAttribute("allowfullscreen","true"),l.setAttribute("webkitallowfullscreen","true"),l.setAttribute("mozallowfullscreen","true");l.contentWindow.document.open(),l.contentWindow.document.write("<html></html>"),l.contentWindow.document.close(),void 0!==s.enableInlineVideoFullscreenButton&&(e.enableFullscreen=s.enableInlineVideoFullscreenButton);var d=l.contentWindow.document,c=l.contentWindow.window;r("Creating and styling top chrome bar");var u=d.createElement("div");u.id="top_chrome",u.style.height=s.playerSkin&&"number"==typeof s.playerSkin.dividerHeight?e.topChromeHeight-s.playerSkin.dividerHeight+"px":e.topChromeHeight-1+"px",u.style.width=s.width+"px",u.style.marginRight="auto",u.style.marginLeft="auto",u.className="video-js vjs-default-skin",r("Generating and styling video object");var p=d.createElement("video");if(p.id=e.an_video_ad_player_id,p.className="video-js vjs-default-skin",p.style.marginRight="auto",p.style.marginLeft="auto",u.style["z-index"]=p.style["z-index"]+1,!s.vpaid){r("Generating source object");var h=d.createElement("source");h.type="video/mp4",h.src=s.videoUrl,p.appendChild(h)}if(r("Injecting required elements into iframe"),s.disableTopBar||d.body.appendChild(u),d.body.appendChild(p),c.videojs=e.videojsOrigin,d.body.style.margin="0px",d.body.style.overflow="hidden",s.vpaid){var f=d.createElement("script");f.innerHTML=t.videojs_vpaid,d.head.appendChild(f)}e.options.verifications?new o(e.options.verifications,{parentDoc:d,videoElement:p,viewableImpression:e.options.viewableImpression,adServingId:e.options.adServingId,player:t}).then((function(e){t.verificationManager=e,t.verificationManager&&(t.verificationManager.init(),t.verificationManager.start()),n(l)})):n(l)}}}},function(e,t,n){n(15);var i=n(17),r="[PlayerManager_Verifications]",o=n(12);const a=n(15);var s=n(62).version;Array.prototype.includes||Object.defineProperty(Array.prototype,"includes",{enumerable:!1,value:function(e){return this.filter((function(t){return t==e})).length>0}});function l(e,t,n,i){return new Promise((function(r,o){if(n.getElementById(e))r();else{var a=n.createElement("script");a.id=e,a.onerror=function(e){o(e)},a.src="https://acdn.adnxs.com/video/xandr/sdks/omsdk/web/v1/"+t,a.onload=function(){r()},i.after(a)}}))}e.exports=function(e,t){var n,d,c,u,p,h,f,v,m,g=e,y=t,b=[],A=new i(e,t.player),w={init:function(){var e;o.debug(r,"init verifications");try{e=y.parentDoc.defaultView.OmidSessionClient&&y.parentDoc.defaultView.OmidSessionClient.default}catch(e){return A.trackEvent("","verificationNotExecuted",{reason:3}),void o.error(r,"Cannot use OMSDK",e.message())}if(!e)return A.trackEvent("","verificationNotExecuted",{reason:3}),void o.error(r,"Cannot use OMSDK");n=e.AdSession,d=e.Partner,c=e.Context,u=e.VerificationScriptResource,p=e.AdEvents,h=e.MediaEvents,m=e.VastProperties;for(var t=y.parentDoc.defaultView.location.href,i=new d("Xandr",s),a=[],l=0;l<g.length;l++){var v=g[l],w=!0;if(v.jsResources)for(var T=0;T<v.jsResources.length;T++)if("OMID"===v.jsResources[T].framework.toUpperCase()&&(w=!1,!a.includes(v.vendor))){a.push(v.vendor);var k={vendor:v.vendor,url:v.jsResources[T].url,viewableImpression:y.viewableImpression,verificationParams:v.verificationParameters,adServingId:y.adServingId,started:!1};b.push(k),o.debug(r,"verification is OMID")}v.executableResources,w&&(A.trackEvent(v.vendor,"verificationNotExecuted",{REASON:2}),o.debug(r,"verification is not OMID"))}var E=[];for(l=0;l<b.length;l++){var S=new u(b[l].url,b[l].vendor,b[l].verificationParams,"full");E.push(S)}(f=new c(i,E,t)).setVideoElement(y.videoElement),f.setServiceWindow(y.parentDoc.defaultView)},start:function(){o.debug(r,"start verifications"),(v=new a(y)).start(n,f,p,h)},dispatchEvent:function(e,t,n){o.debug(r,"try to dispatch OMID event: "+e+", data: ",t),v&&v.dispatchEvent(e,t,m)},destroy:function(){o.debug(r,"destroy verifications"),v&&v.destroy()}};return Promise.all([l("omweb","omweb-v1.js",t.parentDoc,t.videoElement),l("omwebClient","omid-session-client-v1.js",t.parentDoc,t.videoElement)]).then((function(){return t.player.options.viewability=null,w})).catch((function(e){return A.trackEvent("","verificationNotExecuted",{reason:3}),o.error(r,"failed to load OMSDK files",e.message()),null}))}},function(e,t){e.exports={name:"@mobile-sdk/videoads-ad-video-player-manager",version:"1.2.0",description:"Ad Player Manager For Video Ads",main:"src/AdVideoPlayerManager.js",scripts:{test:"./node_modules/karma/bin/karma start karma.conf.js --no-auto-watch","test:chrome":"karma start --single-run=false --browsers Chrome karma.conf.js"},author:{name:"Kyungsuk Song",email:"ksong@appnexus.com"},repository:{type:"git",url:"ssh://git@stash.corp.appnexus.com:7999/video/resources_video-ad-video-player.git"},license:"TBD",devDependencies:{"@appnexus/videoads-ad-video-player-html5-vpaid-plugin":"latest","@appnexus/videoads-autoplay-handler":"latest","@appnexus/videoads-util-logging":"latest","@appnexus/videoads-util-user-agent-parser":"latest","babel-core":"^6.3.2","babel-loader":"^6.2.0","babel-preset-es2015":"^6.1.18","base64-font-loader":"^0.0.2",chai:"^2.1.2","css-loader":"^0.15.5",expect:"^1.13.0","extract-text-webpack-plugin":"^0.8.2","file-loader":"^0.8.4",gulp:"^4.0.2","preprocessor-loader":"^0.0.8","gulp-append-prepend":"latest","gulp-beautify":"^1.1.2","gulp-clean-css":"^3.10.0","gulp-jscs":"^1.4.0","gulp-jshint":"^1.9.2","gulp-less":"^3.0.3","gulp-preprocess":"^2.0.0","istanbul-instrumenter-loader":"^3.0.0","js-combinatorics":"0.6.1","jscs-loader":"^0.1.0","jshint-loader":"^0.8.3","json-loader":"^0.5.7",karma:"^1.7.0","karma-chai":"^0.1.0","karma-chrome-launcher":"^2.2.0","karma-cli":"^1.0.1","karma-coverage":"^1.1.1","karma-firefox-launcher":"^1.3.0","karma-html-reporter":"^0.2.7","karma-htmlfile-reporter":"^0.3.6","karma-mocha":"^1.3.0","karma-mocha-reporter":"^2.2.4","karma-nyan-reporter":"^0.2.5","karma-requirejs":"^1.1.0","karma-sinon":"^1.0.5","karma-verbose-reporter":"^0.0.6","karma-webpack":"^2.0.4",mocha:"^3.2.0","node-sass":"^7.0.3","postcss-loader":"^2.1.6","raw-loader":"^0.5.1",requirejs:"^2.3.6","sass-loader":"^2.0.1",sinon:"^1.17.5","style-loader":"^0.12.3","url-loader":"^0.5.6","videoads-companions-handler":"^0.1.13","videoads-standalone-vast-player":"latest","videoads-util-cache-manager":"latest","videoads-util-capability-detection":"latest","videoads-util-misc-general":"latest","videoads-util-parsers":"^3.2.19","videoads-util-rendition-manager":"latest","videoads-util-tracking-manager":"latest","videoads-util-url-loader":"latest",webpack:"^1.12.9","webpack-dev-server":"^1.10.1","webpack-preprocessor-loader":"^1.2.0","webpack-stream":"^3.2.0",yargs:"^17.6.2","@mobile-sdk/videoads-ad-handler":"latest"},dependencies:{"@mobile-sdk/videoads-ad-video-player-html5":"latest","videoads-util-misc-general":"latest","an-video-viewability":"^2.0.1","@appnexus/videoads-autoplay-handler":"latest","@appnexus/videoads-ad-video-player-html5-vpaid-plugin":"latest"}}},function(e,t,n){var i,r=n(12),o=function(e){r.debug("[UserSync]",e)},a=function(){o("initiated"),this.isComplete=!1,this.run=function(e){o("start UserSync");try{if(this.isComplete)o("stop UserSync because it's already done");else{var t=e.userSyncTargetElement?e.userSyncTargetElement:e.targetElement;e&&e.usersync_url&&"string"==typeof e.usersync_url&&""!==e.usersync_url&&t&&"object"==typeof t?(this.executeUserSync(e,t),this.isComplete=!0,o("done")):o("stop UserSync because it needs proper options.usersync_url and options.targetElement/options.userSyncTargetElement")}}catch(e){o("error: "+e)}},this.executeUserSync=function(e,t){if(t.ownerDocument&&t.ownerDocument.getElementById("apn_user_sync"))o("stop UserSync because it's already done");else{o("decode UserSync url");var n=decodeURIComponent(e.usersync_url);this.prepareIframeAndScript(n,t)}},this.prepareIframeAndScript=function(e,t){o("prepareIframeAndScript: "+e);var n=document.createElement("iframe");n.id="apn_user_sync",n.src=e,n.width="1",n.height="1",n.frameborder="0",n.scrolling="no",n.marginheight="0",n.marginwidth="0",n.topmargin="0",n.leftmargin="0",n.style.position="absolute",n.style.overflow="hidden",n.style.clip="rect(0 0 0 0)",n.style.height="1px",n.style.width="1px",n.style.margin="-1px",n.style.padding="0",n.style.border="0",t.appendChild(n),o("UserSync iframe injected into target element: "+t.id)}},s={sharedInstance:function(){return i||(i=new a),i}};e.exports=s},function(e,t,n){var i=n(11),r=n(12),o=function(e){r.verbose(e,"PlayerManager_VideoSizeHandler")},a=function(e){r.warn(e,"PlayerManager_VideoSizeHandler")};e.exports={resizeVideo:function(e,t,n,r){o("resizeVideo");Math.max(document.documentElement.clientWidth,window.innerWidth||0);var s=0;s=i.isMobile()&&parseInt(i.getIOSVersion())>=13?Math.max(document.documentElement.clientHeight||0):Math.max(document.documentElement.clientHeight,window.innerHeight||0),n.options.safeFrame&&n.options.safeFrameAutoInitialSize&&!n.isExpanded&&(s=Math.max(s,n.options.height)),o("viewportHeight: "+s);var l,d,c,u,p=n.options,h=n.isIosInlineRequired.bind(n),f=(n.decidePlayer.bind(n),n.iframeVideoWrapper),v=n.adVideoPlayer,m=p.width,g=0,y=0,b=p.fixedSizePlayer,A=p.video.width,w=p.video.height,T=function(){return!p.useMsSkin&&(i.isAndroid()||h()||"below"===p.controlBarPosition)};if(p.autoInitialSize&&(p.sideStream&&!0===p.sideStream.enabled&&p.emptyDiv?m=p.emptyDiv.offsetWidth:0===(m=p.targetElement.offsetWidth)&&(m=p.width,a("AutoInitialSize could not find parent element width, using tag width"))),c=p.aspectRatio||p.playerAspectRatio,o("options.height : "+p.height),i.isEmpty(c)&&(c=i.isEmpty(p.height)?"16:9":"none"),o("aspectRatioOption : "+c),d=void 0===A||void 0===w||0===A||0===w?16/9:A/w,p.disableTopBar||(g=24),T()&&(!0===p.disableCollapse.hideControlBar&&!0===n.isEnded?y=0:y+=p.playerSkin.controlBarHeight),p.safeFrame&&p.player_height>0&&!p.safeFrameAutoInitialSize&&d!==p.player_width/p.player_height&&(m=p.width,d=p.player_width/p.player_height),o("initial VAST width : "+A),o("initial VAST height : "+w),o("initial topOffset : "+g),o("initial bottomOffset : "+y),o("initial mediaAspectRatio : "+d),b)u=p.height,m=p.width,l=p.height-g-y;else{var k=c.split(":");if(2===k.length)try{d=k[0]/k[1]}catch(e){o(e)}l=Math.round(m/d),o("pure : "+m+","+d),o("pure mediaHeight: "+l);u=l-0+g+y,p.maxHeight.enabled&&p.maxHeight.height>0?m=((u=Math.min(u,p.maxHeight.height,s>1?s:l))-g-y)*d:u>s&&d<1&&s>1&&(m=((u=p.safeFrame&&p.safeFrameAutoInitialSize?s:Math.min(s,document.documentElement.clientHeight))-g-y)*d),l=u+0-g-y}if(n.setFinalAspectRatio(d),p.height=u,p.mediaHeight=l,p.safeFrame&&p.safeFrameAutoInitialSize&&(p.width=m),i.isMobile()&&(p.isWaterfall||p.safeFrame)&&(p.targetElement.style.height=p.height+"px"),f&&"object"==typeof f&&f.style){if(f.style.border="none",f.style.width=m+"px",f.style.height=u+"px",f.contentWindow){var E=f.contentWindow.document&&f.contentWindow.document.getElementById("top_chrome");E&&(E.style.width=m+"px",E.style.marginLeft="auto",E.style.marginRight="auto")}n.adVideoPlayer.el_.style.marginLeft="auto",n.adVideoPlayer.el_.style.marginRight="auto",o("final wrapper width for html5 : "+m),o("final wrapper height for html5 : "+u)}if(v.width(m),p.sideStream&&!0===p.sideStream.enabled&&p.emptyDiv?p.targetElement.style.width=m+"px":p.targetElement.style.width="",o("resize video.js width to : "+m),i.isMobile()&&parseInt(i.getIOSVersion())>=13&&(t=!0),o("shouldConsiderHeightOfDevice : "+t),o("hasStaticHeight : "+!1),o("mediaHeight + bottomOffset + topOffset : "+(l+y+g)),viewPortHeight=window.innerHeight&&document.documentElement.clientHeight?Math.max(window.innerHeight,document.documentElement.clientHeight):window.innerHeight||document.documentElement.clientHeight||document.getElementsByTagName("body")[0].clientHeight,t&&l+y+g>viewPortHeight){var S=viewPortHeight,C=viewPortHeight-y-g;viewPortHeight<=1&&(S=p.height+y+g,C=p.height),v.height(C),o("mobile set video.js height to : "+C),p.height=S,o("mobile options.height to : "+p.height),p.mediaHeight=C,o("mobile options.mediaHeight to : "+p.mediaHeight),parseInt(i.getIOSVersion())<13&&(f.style.height=C+"px"),o("mobile set iframeVideoWrapper to : "+f.style.height)}else{var I=l;T()||(I+=y),v.height(I),o("desktop set video.js height to : "+I)}n.isEnded&&n.endCard&&n.endCard.onVideoResized(m,l),p.targetElement.style.visibility="visible","function"==typeof r&&r()},setSizeForInitialRender:function(e){o("setSizeForInitialRender");var t=e.width;e.autoInitialSize&&(t=e.targetElement.offsetWidth)<=0&&(t=e.width,a("Width of target element was not set or zero, using tag width for player instead")),o("setSizeForInitialRender using width: "+t),e.width=t},getFinalSize:function(e){var t=e.options.wcElement&&e.options.wcElement instanceof Element?e.options.wcElement.querySelector("#"+String(e.options.iframeVideoWrapperId)):document.getElementById(e.options.iframeVideoWrapperId);return{width:t.offsetWidth,height:t.offsetHeight}},resizePlayer:function(e,t,n){if(o("resizePlayer"),n.overlayPlayer&&n.adVideoPlayer){if(n.resizeVideoWithDimensions(e,t),n.iframeVideoWrapper&&"object"==typeof n.iframeVideoWrapper){n.iframeVideoWrapper.style.border="none",n.iframeVideoWrapper.style.width=e+"px",n.iframeVideoWrapper.style.height=t+"px";var r=n&&n.iframeVideoWrapper&&n.iframeVideoWrapper.contentWindow&&n.iframeVideoWrapper.contentWindow.document&&n.iframeVideoWrapper.contentWindow.document.getElementById("top_chrome");r&&(r.style.width=e+"px",i.isIos()&&(r.style.marginLeft="",r.style.marginRight="")),i.isIos()&&(n.adVideoPlayer.el_.style.marginLeft="",n.adVideoPlayer.el_.style.marginRight="")}n.adVideoPlayer.width(e);var a=0;n.options.disableTopBar||(a=24),(i.isAndroid()||n.isIosInlineRequired()||"below"===n.options.controlBarPosition)&&(n.options.useMsSkin||(a+=n.options.playerSkin.controlBarHeight,n.adVideoPlayer.controlBar&&n.adVideoPlayer.controlBar.progressControl&&(a+=n.adVideoPlayer.controlBar.progressControl.el_.offsetHeight))),n.adVideoPlayer.height(t-a)}},resizeVideoForSideStream:function(e,t,n,r){o("resizeVideo-sidestream");var a,s,l,d,c=e.options,u=e.isIosInlineRequired.bind(e),p=(e.decidePlayer.bind(e),e.iframeVideoWrapper),h=e.adVideoPlayer,f=t,v=0,m=0,g=c.video.width,y=c.video.height,b=function(){return i.isAndroid()||u()||"below"===c.controlBarPosition};if(l=c.aspectRatio||c.playerAspectRatio,o("options.height : "+n),i.isEmpty(l)&&(l=i.isEmpty(n)?"16:9":"none"),o("aspectRatioOption : "+l),s=void 0===g||void 0===y||0===g||0===y?16/9:g/y,c.disableTopBar||(v=24),b()&&(m+=c.playerSkin.controlBarHeight),o("initial VAST width : "+g),o("initial VAST height : "+y),o("initial topOffset : "+v),o("initial bottomOffset : "+m),o("initial mediaAspectRatio : "+s),d=n,f=t,a=n-v-m,n&&t&&(c.mediaHeight=a),p&&"object"==typeof p&&p.style){if(p.style.border="none",p.style.width=f+"px",p.style.height=d+"px",p.contentWindow){var A=p.contentWindow.document&&p.contentWindow.document.getElementById("top_chrome");A&&(A.style.width=f,A.style.marginLeft="",A.style.marginRight="")}e.adVideoPlayer.el_.style.marginLeft="",e.adVideoPlayer.el_.style.marginRight="",o("final wrapper width for html5 : "+f),o("final wrapper height for html5 : "+d)}h.width(f),c.sideStream&&!0===c.sideStream.enabled&&c.emptyDiv?c.targetElement.style.width=f+"px":c.targetElement.style.width="",o("resize video.js width to : "+f),o("shouldConsiderHeightOfDevice : "+!1),o("mediaHeight + bottomOffset + topOffset : "+(a+m+v)),o("window.innerHeight : "+window.innerHeight);var w=a;b()||(w+=m),h.height(w),o("desktop set video.js height to : "+w),e.isEnded&&e.endCard&&e.endCard.onVideoResized(f,a),"function"==typeof r&&r()}}},function(e,t){e.exports="/* jshint ignore:start */\n(function(window, document, vjs, undefined) {\n    /*jshint unused:false */\n    \"use strict\";\n\n    var NODE_TYPE_ELEMENT = 1;\n\n    function noop() {}\n\n    function isNull(o) {\n        return o === null;\n    }\n\n    function isDefined(o) {\n        return o !== undefined;\n    }\n\n    function isUndefined(o) {\n        return o === undefined;\n    }\n\n    function isObject(obj) {\n        return typeof obj === 'object';\n    }\n\n    function isFunction(str) {\n        return typeof str === 'function';\n    }\n\n    function isNumber(num) {\n        return typeof num === 'number';\n    }\n\n    function isWindow(obj) {\n        return isObject(obj) && obj.window === obj;\n    }\n\n    function isArray(array) {\n        return Object.prototype.toString.call(array) === '[object Array]';\n    }\n\n    function isArrayLike(obj) {\n        if (obj === null || isWindow(obj) || isFunction(obj) || isUndefined(obj)) {\n            return false;\n        }\n\n        var length = obj.length;\n\n        if (obj.nodeType === NODE_TYPE_ELEMENT && length) {\n            return true;\n        }\n\n        return isString(obj) || isArray(obj) || length === 0 ||\n            typeof length === 'number' && length > 0 && (length - 1) in obj;\n    }\n\n    function isString(str) {\n        return typeof str === 'string';\n    }\n\n    function isEmptyString(str) {\n        return isString(str) && str.length === 0;\n    }\n\n    function isNotEmptyString(str) {\n        return isString(str) && str.length !== 0;\n    }\n\n    function arrayLikeObjToArray(args) {\n        return Array.prototype.slice.call(args);\n    }\n\n    function forEach(obj, iterator, context) {\n        var key, length;\n        if (obj) {\n            if (isFunction(obj)) {\n                for (key in obj) {\n                    // Need to check if hasOwnProperty exists,\n                    // as on IE8 the result of querySelectorAll is an object without a hasOwnProperty function\n                    if (key !== 'prototype' && key !== 'length' && key !== 'name' && (!obj.hasOwnProperty || obj.hasOwnProperty(key))) {\n                        iterator.call(context, obj[key], key, obj);\n                    }\n                }\n            } else if (isArray(obj)) {\n                var isPrimitive = typeof obj !== 'object';\n                for (key = 0, length = obj.length; key < length; key++) {\n                    if (isPrimitive || key in obj) {\n                        iterator.call(context, obj[key], key, obj);\n                    }\n                }\n            } else if (obj.forEach && obj.forEach !== forEach) {\n                obj.forEach(iterator, context, obj);\n            } else {\n                for (key in obj) {\n                    if (obj.hasOwnProperty(key)) {\n                        iterator.call(context, obj[key], key, obj);\n                    }\n                }\n            }\n        }\n        return obj;\n    }\n\n    var SNAKE_CASE_REGEXP = /[A-Z]/g;\n\n    function snake_case(name, separator) {\n        separator = separator || '_';\n        return name.replace(SNAKE_CASE_REGEXP, function(letter, pos) {\n            return (pos ? separator : '') + letter.toLowerCase();\n        });\n    }\n\n    function isValidEmail(email) {\n        if (!isString(email)) {\n            return false;\n        }\n        var EMAIL_REGEXP = /^[a-z0-9!#$%&'*+\\/=?^_`{|}~.-]+@[a-z0-9]([a-z0-9-]*[a-z0-9])?(\\.[a-z0-9]([a-z0-9-]*[a-z0-9])?)+$/i;\n        return EMAIL_REGEXP.test(email.trim());\n    }\n\n    function extend(obj) {\n        var arg, i, k;\n        for (i = 1; i < arguments.length; i++) {\n            arg = arguments[i];\n            for (k in arg) {\n                if (arg.hasOwnProperty(k)) {\n                    if (isObject(obj[k]) && !isNull(obj[k]) && isObject(arg[k])) {\n                        obj[k] = extend({}, obj[k], arg[k]);\n                    } else {\n                        obj[k] = arg[k];\n                    }\n                }\n            }\n        }\n        return obj;\n    }\n\n    function capitalize(s) {\n        return s.charAt(0).toUpperCase() + s.slice(1);\n    }\n\n    function decapitalize(s) {\n        return s.charAt(0).toLowerCase() + s.slice(1);\n    }\n\n    /**\n     * This method works the same way array.prototype.map works but if the transformer returns undefine, then\n     * it won't be added to the transformed Array.\n     */\n    function transformArray(array, transformer) {\n        var transformedArray = [];\n\n        array.forEach(function(item, index) {\n            var transformedItem = transformer(item, index);\n            if (isDefined(transformedItem)) {\n                transformedArray.push(transformedItem);\n            }\n        });\n\n        return transformedArray;\n    }\n\n    function toFixedDigits(num, digits) {\n        var formattedNum = num + '';\n        digits = isNumber(digits) ? digits : 0;\n        num = isNumber(num) ? num : parseInt(num, 10);\n        if (isNumber(num) && !isNaN(num)) {\n            formattedNum = num + '';\n            while (formattedNum.length < digits) {\n                formattedNum = '0' + formattedNum;\n            }\n            return formattedNum;\n        }\n        return NaN + '';\n    }\n\n    function debounce(callback, wait) {\n        var timeoutId;\n\n        return function() {\n            if (timeoutId) {\n                clearTimeout(timeoutId);\n            }\n            timeoutId = setTimeout(function() {\n                callback.apply(this, arguments);\n                timeoutId = undefined;\n            }, wait);\n        };\n    }\n\n    // a function designed to blow up the stack in a naive way\n    // but it is ok for videoJs children components\n    function treeSearch(root, getChildren, found) {\n        var children = getChildren(root);\n        for (var i = 0; i < children.length; i++) {\n            if (found(children[i])) {\n                return children[i];\n            } else {\n                var el = treeSearch(children[i], getChildren, found);\n                if (el) {\n                    return el;\n                }\n            }\n        }\n    }\n\n    function echoFn(val) {\n        return function() {\n            return val;\n        };\n    }\n\n    //Note: Supported formats come from http://www.w3.org/TR/NOTE-datetime\n    // and the iso8601 regex comes from http://www.pelagodesign.com/blog/2009/05/20/iso-8601-date-validation-that-doesnt-suck/\n    function isISO8601(value) {\n        if (isNumber(value)) {\n            value = value + ''; //we make sure that we are working with strings\n        }\n\n        if (!isString(value)) {\n            return false;\n        }\n\n        /*jslint maxlen: 500 */\n        var iso8086Regex = /^([\\+-]?\\d{4}(?!\\d{2}\\b))((-?)((0[1-9]|1[0-2])(\\3([12]\\d|0[1-9]|3[01]))?|W([0-4]\\d|5[0-2])(-?[1-7])?|(00[1-9]|0[1-9]\\d|[12]\\d{2}|3([0-5]\\d|6[1-6])))([T\\s]((([01]\\d|2[0-3])((:?)[0-5]\\d)?|24\\:?00)([\\.,]\\d+(?!:))?)?(\\17[0-5]\\d([\\.,]\\d+)?)?([zZ]|([\\+-])([01]\\d|2[0-3]):?([0-5]\\d)?)?)?)?$/;\n        return iso8086Regex.test(value.trim());\n    }\n\n    /**\n     * Checks if the Browser is IE9 and below\n     * @returns {boolean}\n     */\n    function isOldIE() {\n        var version = getInternetExplorerVersion(navigator);\n        if (version === -1) {\n            return false;\n        }\n\n        return version < 10;\n    }\n\n    /**\n     * Returns the version of Internet Explorer or a -1 (indicating the use of another browser).\n     * Source: https://msdn.microsoft.com/en-us/library/ms537509(v=vs.85).aspx\n     * @returns {number} the version of Internet Explorer or a -1 (indicating the use of another browser).\n     */\n    function getInternetExplorerVersion(navigator) {\n        var rv = -1;\n\n        if (navigator.appName == 'Microsoft Internet Explorer') {\n            var ua = navigator.userAgent;\n            var re = new RegExp(\"MSIE ([0-9]{1,}[\\.0-9]{0,})\");\n            var res = re.exec(ua);\n            if (res !== null) {\n                rv = parseFloat(res[1]);\n            }\n        }\n\n        return rv;\n    }\n\n    /*** Mobile Utility functions ***/\n    var _UA = navigator.userAgent;\n\n    function isIDevice() {\n        return /iP(hone|ad)/.test(_UA);\n    }\n\n    function isMobile() {\n        return /iP(hone|ad|od)|Android|Windows Phone/.test(_UA);\n    }\n\n    function isIPhone() {\n        return /iP(hone|od)/.test(_UA);\n    }\n\n    function isAndroid() {\n        return /Android/.test(_UA);\n    }\n\n    ;\n    (function e(t, n, r) {\n        function s(o, u) {\n            if (!n[o]) {\n                if (!t[o]) {\n                    var a = typeof require == \"function\" && require;\n                    if (!u && a) return a(o, !0);\n                    if (i) return i(o, !0);\n                    var f = new Error(\"Cannot find module '\" + o + \"'\");\n                    throw f.code = \"MODULE_NOT_FOUND\", f }\n                var l = n[o] = { exports: {} };\n                t[o][0].call(l.exports, function(e) {\n                    var n = t[o][1][e];\n                    return s(n ? n : e) }, l, l.exports, e, t, n, r) }\n            return n[o].exports }\n        var i = typeof require == \"function\" && require;\n        for (var o = 0; o < r.length; o++) s(r[o]);\n        return s })({\n        1: [function(require, module, exports) {\n            'use strict';\n\n            var METHODS = [\n                'handshakeVersion',\n                'initAd',\n                'startAd',\n                'stopAd',\n                'skipAd', // VPAID 2.0 new method\n                'resizeAd',\n                'pauseAd',\n                'resumeAd',\n                'expandAd',\n                'collapseAd',\n                'subscribe',\n                'unsubscribe'\n            ];\n\n            var EVENTS = [\n                'AdLoaded',\n                'AdStarted',\n                'AdStopped',\n                'AdSkipped',\n                'AdSkippableStateChange', // VPAID 2.0 new event\n                'AdSizeChange', // VPAID 2.0 new event\n                'AdLinearChange',\n                'AdDurationChange', // VPAID 2.0 new event\n                'AdExpandedChange',\n                'AdRemainingTimeChange', // [Deprecated in 2.0] but will be still fired for backwards compatibility\n                'AdVolumeChange',\n                'AdImpression',\n                'AdVideoStart',\n                'AdVideoFirstQuartile',\n                'AdVideoMidpoint',\n                'AdVideoThirdQuartile',\n                'AdVideoComplete',\n                'AdClickThru',\n                'AdInteraction', // VPAID 2.0 new event\n                'AdUserAcceptInvitation',\n                'AdUserMinimize',\n                'AdUserClose',\n                'AdPaused',\n                'AdPlaying',\n                'AdLog',\n                'AdError'\n            ];\n\n            var GETTERS = [\n                'getAdLinear',\n                'getAdWidth', // VPAID 2.0 new getter\n                'getAdHeight', // VPAID 2.0 new getter\n                'getAdExpanded',\n                'getAdSkippableState', // VPAID 2.0 new getter\n                'getAdRemainingTime',\n                'getAdDuration', // VPAID 2.0 new getter\n                'getAdVolume',\n                'getAdCompanions', // VPAID 2.0 new getter\n                'getAdIcons' // VPAID 2.0 new getter\n            ];\n\n            var SETTERS = [\n                'setAdVolume'\n            ];\n\n\n            /**\n             * This callback is displayed as global member. The callback use nodejs error-first callback style\n             * @callback NodeStyleCallback\n             * @param {string|null}\n             * @param {undefined|object}\n             */\n\n\n            /**\n             * IVPAIDAdUnit\n             *\n             * @class\n             *\n             * @param {object} creative\n             * @param {HTMLElement} el\n             * @param {HTMLVideoElement} video\n             */\n            function IVPAIDAdUnit(creative, el, video) {}\n\n\n            /**\n             * handshakeVersion\n             *\n             * @param {string} VPAIDVersion\n             * @param {nodeStyleCallback} callback\n             */\n            IVPAIDAdUnit.prototype.handshakeVersion = function(VPAIDVersion, callback) {};\n\n            /**\n             * initAd\n             *\n             * @param {number} width\n             * @param {number} height\n             * @param {string} viewMode can be 'normal', 'thumbnail' or 'fullscreen'\n             * @param {number} desiredBitrate indicates the desired bitrate in kbps\n             * @param {object} [creativeData] used for additional initialization data\n             * @param {object} [environmentVars] used for passing implementation-specific of js version\n             * @param {NodeStyleCallback} callback\n             */\n            IVPAIDAdUnit.prototype.initAd = function(width, height, viewMode, desiredBitrate, creativeData, environmentVars, callback) {};\n\n            /**\n             * startAd\n             *\n             * @param {nodeStyleCallback} callback\n             */\n            IVPAIDAdUnit.prototype.startAd = function(callback) {};\n\n            /**\n             * stopAd\n             *\n             * @param {nodeStyleCallback} callback\n             */\n            IVPAIDAdUnit.prototype.stopAd = function(callback) {};\n\n            /**\n             * skipAd\n             *\n             * @param {nodeStyleCallback} callback\n             */\n            IVPAIDAdUnit.prototype.skipAd = function(callback) {};\n\n            /**\n             * resizeAd\n             *\n             * @param {nodeStyleCallback} callback\n             */\n            IVPAIDAdUnit.prototype.resizeAd = function(width, height, viewMode, callback) {};\n\n            /**\n             * pauseAd\n             *\n             * @param {nodeStyleCallback} callback\n             */\n            IVPAIDAdUnit.prototype.pauseAd = function(callback) {};\n\n            /**\n             * resumeAd\n             *\n             * @param {nodeStyleCallback} callback\n             */\n            IVPAIDAdUnit.prototype.resumeAd = function(callback) {};\n\n            /**\n             * expandAd\n             *\n             * @param {nodeStyleCallback} callback\n             */\n            IVPAIDAdUnit.prototype.expandAd = function(callback) {};\n\n            /**\n             * collapseAd\n             *\n             * @param {nodeStyleCallback} callback\n             */\n            IVPAIDAdUnit.prototype.collapseAd = function(callback) {};\n\n            /**\n             * subscribe\n             *\n             * @param {string} event\n             * @param {nodeStyleCallback} handler\n             * @param {object} context\n             */\n            IVPAIDAdUnit.prototype.subscribe = function(event, handler, context) {};\n\n            /**\n             * startAd\n             *\n             * @param {string} event\n             * @param {function} handler\n             */\n            IVPAIDAdUnit.prototype.unsubscribe = function(event, handler) {};\n\n\n\n            /**\n             * getAdLinear\n             *\n             * @param {nodeStyleCallback} callback\n             */\n            IVPAIDAdUnit.prototype.getAdLinear = function(callback) {};\n\n            /**\n             * getAdWidth\n             *\n             * @param {nodeStyleCallback} callback\n             */\n            IVPAIDAdUnit.prototype.getAdWidth = function(callback) {};\n\n            /**\n             * getAdHeight\n             *\n             * @param {nodeStyleCallback} callback\n             */\n            IVPAIDAdUnit.prototype.getAdHeight = function(callback) {};\n\n            /**\n             * getAdExpanded\n             *\n             * @param {nodeStyleCallback} callback\n             */\n            IVPAIDAdUnit.prototype.getAdExpanded = function(callback) {};\n\n            /**\n             * getAdSkippableState\n             *\n             * @param {nodeStyleCallback} callback\n             */\n            IVPAIDAdUnit.prototype.getAdSkippableState = function(callback) {};\n\n            /**\n             * getAdRemainingTime\n             *\n             * @param {nodeStyleCallback} callback\n             */\n            IVPAIDAdUnit.prototype.getAdRemainingTime = function(callback) {};\n\n            /**\n             * getAdDuration\n             *\n             * @param {nodeStyleCallback} callback\n             */\n            IVPAIDAdUnit.prototype.getAdDuration = function(callback) {};\n\n            /**\n             * getAdVolume\n             *\n             * @param {nodeStyleCallback} callback\n             */\n            IVPAIDAdUnit.prototype.getAdVolume = function(callback) {};\n\n            /**\n             * getAdCompanions\n             *\n             * @param {nodeStyleCallback} callback\n             */\n            IVPAIDAdUnit.prototype.getAdCompanions = function(callback) {};\n\n            /**\n             * getAdIcons\n             *\n             * @param {nodeStyleCallback} callback\n             */\n            IVPAIDAdUnit.prototype.getAdIcons = function(callback) {};\n\n            /**\n             * setAdVolume\n             *\n             * @param {number} volume\n             * @param {nodeStyleCallback} callback\n             */\n            IVPAIDAdUnit.prototype.setAdVolume = function(volume, callback) {};\n\n            addStaticToInterface(IVPAIDAdUnit, 'METHODS', METHODS);\n            addStaticToInterface(IVPAIDAdUnit, 'GETTERS', GETTERS);\n            addStaticToInterface(IVPAIDAdUnit, 'SETTERS', SETTERS);\n            addStaticToInterface(IVPAIDAdUnit, 'EVENTS', EVENTS);\n\n\n            var VPAID1_METHODS = METHODS.filter(function(method) {\n                return ['skipAd'].indexOf(method) === -1;\n            });\n\n            addStaticToInterface(IVPAIDAdUnit, 'checkVPAIDInterface', function checkVPAIDInterface(creative) {\n                var result = VPAID1_METHODS.every(function(key) {\n                    return typeof creative[key] === 'function';\n                });\n                return result;\n            });\n\n            module.exports = IVPAIDAdUnit;\n\n            function addStaticToInterface(Interface, name, value) {\n                Object.defineProperty(Interface, name, {\n                    writable: false,\n                    configurable: false,\n                    value: value\n                });\n            }\n\n\n        }, {}],\n        2: [function(require, module, exports) {\n            'use strict';\n\n            var IVPAIDAdUnit = require('./IVPAIDAdUnit');\n            var Subscriber = require('./subscriber');\n            var checkVPAIDInterface = IVPAIDAdUnit.checkVPAIDInterface;\n            var utils = require('./utils');\n            var METHODS = IVPAIDAdUnit.METHODS;\n            var ERROR = 'AdError';\n            var AD_CLICK = 'AdClickThru';\n            var FILTERED_EVENTS = IVPAIDAdUnit.EVENTS.filter(function(event) {\n                return event != AD_CLICK;\n            });\n\n            /**\n             * This callback is displayed as global member. The callback use nodejs error-first callback style\n             * @callback NodeStyleCallback\n             * @param {string|null}\n             * @param {undefined|object}\n             */\n\n\n            /**\n             * VPAIDAdUnit\n             * @class\n             *\n             * @param VPAIDCreative\n             * @param {HTMLElement} [el] this will be used in initAd environmentVars.slot if defined\n             * @param {HTMLVideoElement} [video] this will be used in initAd environmentVars.videoSlot if defined\n             */\n            function VPAIDAdUnit(VPAIDCreative, el, video, iframe) {\n                this._isValid = checkVPAIDInterface(VPAIDCreative);\n                if (this._isValid) {\n                    this._creative = VPAIDCreative;\n                    this._el = el;\n                    this._videoEl = video;\n                    this._iframe = iframe;\n                    this._subscribers = new Subscriber();\n                    $addEventsSubscribers.call(this);\n                }\n            }\n\n            VPAIDAdUnit.prototype = Object.create(IVPAIDAdUnit.prototype);\n\n            /**\n             * isValidVPAIDAd will return if the VPAIDCreative passed in constructor is valid or not\n             *\n             * @return {boolean}\n             */\n            VPAIDAdUnit.prototype.isValidVPAIDAd = function isValidVPAIDAd() {\n                return this._isValid;\n            };\n\n            IVPAIDAdUnit.METHODS.forEach(function(method) {\n                //NOTE: this methods arguments order are implemented differently from the spec\n                var ignores = [\n                    'subscribe',\n                    'unsubscribe',\n                    'initAd'\n                ];\n\n                if (ignores.indexOf(method) !== -1) return;\n\n                VPAIDAdUnit.prototype[method] = function() {\n                    var ariaty = IVPAIDAdUnit.prototype[method].length;\n                    // TODO avoid leaking arguments\n                    // https://github.com/petkaantonov/bluebird/wiki/Optimization-killers#32-leaking-arguments\n                    var args = Array.prototype.slice.call(arguments);\n                    var callback = (ariaty === args.length) ? args.pop() : undefined;\n\n                    setTimeout(function() {\n                        var result, error = null;\n                        try {\n                            result = this._creative[method].apply(this._creative, args);\n                        } catch (e) {\n                            error = e;\n                        }\n\n                        callOrTriggerEvent(callback, this._subscribers, error, result);\n                    }.bind(this), 0);\n                };\n            });\n\n\n            /**\n             * initAd concreate implementation\n             *\n             * @param {number} width\n             * @param {number} height\n             * @param {string} viewMode can be 'normal', 'thumbnail' or 'fullscreen'\n             * @param {number} desiredBitrate indicates the desired bitrate in kbps\n             * @param {object} [creativeData] used for additional initialization data\n             * @param {object} [environmentVars] used for passing implementation-specific of js version, if el & video was used in constructor slot & videoSlot will be added to the object\n             * @param {NodeStyleCallback} callback\n             */\n            VPAIDAdUnit.prototype.initAd = function initAd(width, height, viewMode, desiredBitrate, creativeData, environmentVars, callback) {\n                creativeData = creativeData || {};\n                environmentVars = utils.extend({\n                    slot: this._el,\n                    videoSlot: this._videoEl\n                }, environmentVars || {});\n\n                setTimeout(function() {\n                    var error;\n                    try {\n                        this._creative.initAd(width, height, viewMode, desiredBitrate, creativeData, environmentVars);\n                    } catch (e) {\n                        error = e;\n                    }\n\n                    callOrTriggerEvent(callback, this._subscribers, error);\n                }.bind(this), 0);\n            };\n\n            /**\n             * subscribe\n             *\n             * @param {string} event\n             * @param {nodeStyleCallback} handler\n             * @param {object} context\n             */\n            VPAIDAdUnit.prototype.subscribe = function subscribe(event, handler, context) {\n                this._subscribers.subscribe(handler, event, context);\n            };\n\n\n            /**\n             * unsubscribe\n             *\n             * @param {string} event\n             * @param {nodeStyleCallback} handler\n             */\n            VPAIDAdUnit.prototype.unsubscribe = function unsubscribe(event, handler) {\n                this._subscribers.unsubscribe(handler, event);\n            };\n\n            //alias\n            VPAIDAdUnit.prototype.on = VPAIDAdUnit.prototype.subscribe;\n            VPAIDAdUnit.prototype.off = VPAIDAdUnit.prototype.unsubscribe;\n\n            IVPAIDAdUnit.GETTERS.forEach(function(getter) {\n                VPAIDAdUnit.prototype[getter] = function(callback) {\n                    setTimeout(function() {\n\n                        var result, error = null;\n                        try {\n                            result = this._creative[getter]();\n                        } catch (e) {\n                            error = e;\n                        }\n\n                        callOrTriggerEvent(callback, this._subscribers, error, result);\n                    }.bind(this), 0);\n                };\n            });\n\n            /**\n             * setAdVolume\n             *\n             * @param volume\n             * @param {nodeStyleCallback} callback\n             */\n            VPAIDAdUnit.prototype.setAdVolume = function setAdVolume(volume, callback) {\n                setTimeout(function() {\n\n                    var self = this;\n                    var result, error = null;\n                    try {\n                        this._creative.setAdVolume(volume);\n                    } catch (e) {\n                        error = e;\n                    }                    \n                    // Wait for creative volume to be set\n                    setTimeout(function() {\n                        result = self._creative.getAdVolume();\n                        // Commented this code, because, for the new MS skin, a few volume changes may happened\n                        // during 200 msecs. In this case we cannot correctly validate volume value\n                        // related to particular volume change event and ad player may go to the bad state\n                        // for volume controls.\n                        // if (!error) {\n                        //     error = utils.validate(result === volume, 'failed to apply volume: ' + volume);\n                        // }\n                        callOrTriggerEvent(callback, self._subscribers, error, result);\n                    }, 200)\n                }.bind(this), 0);\n            };\n\n            VPAIDAdUnit.prototype._destroy = function destroy() {\n                this.stopAd();\n                this._subscribers.unsubscribeAll();\n            };\n\n            function $addEventsSubscribers() {\n                // some ads implement\n                // so they only handle one subscriber\n                // to handle this we create our one\n                FILTERED_EVENTS.forEach(function(event) {\n                    this._creative.subscribe($trigger.bind(this, event), event);\n                }.bind(this));\n\n                // map the click event to be an object instead of depending of the order of the arguments\n                this._creative.subscribe($clickThruHook.bind(this), AD_CLICK);\n\n                // because we are adding the element inside the iframe\n                // the user is not able to click in the video\n                if (this._videoEl) {\n                    var documentElement = this._iframe.contentDocument.documentElement;\n                    var videoEl = this._videoEl;\n                    documentElement.addEventListener('click', function(e) {\n                        if (e.target === documentElement) {\n                            videoEl.click();\n                        }\n                    });\n                }\n            }\n\n            function $clickThruHook(url, id, playerHandles) {\n                this._subscribers.triggerSync(AD_CLICK, { url: url, id: id, playerHandles: playerHandles });\n            }\n\n            function $trigger(event) {\n                // TODO avoid leaking arguments\n                // https://github.com/petkaantonov/bluebird/wiki/Optimization-killers#32-leaking-arguments\n                this._subscribers.trigger(event, Array.prototype.slice.call(arguments, 1));\n            }\n\n            function callOrTriggerEvent(callback, subscribers, error, result) {\n                if (callback) {\n                    callback(error, result);\n                } else if (error) {\n                    subscribers.trigger(ERROR, error);\n                }\n            }\n\n            module.exports = VPAIDAdUnit;\n\n\n        }, { \"./IVPAIDAdUnit\": 1, \"./subscriber\": 4, \"./utils\": 5 }],\n        3: [function(require, module, exports) {\n            'use strict';\n\n\n            var utils = require('./utils');\n            var unique = utils.unique('vpaidIframe');\n            var VPAIDAdUnit = require('./VPAIDAdUnit');\n            //var defaultTemplate = \"<!DOCTYPE html>\\n<html lang=\\\"en\\\">\\n<head>\\n    <meta charset=\\\"UTF-8\\\">\\n</head>\\n<body>\\n    <script type=\\\"text/javascript\\\" src=\\\"{{iframeURL_JS}}\\\"><\/script>\\n    <script>\\n        parent.postMessage('{\\\"event\\\": \\\"ready\\\", \\\"id\\\": \\\"{{iframeID}}\\\"}', window.location.origin);\\n    <\/script>\\n    <div class=\\\"ad-element\\\">\\n    </div>\\n</body>\\n</html>\\n\";\n            var defaultTemplate = \"<!DOCTYPE html>\\n<html>\\n <head>\\n </head>\\n <body style=\\\"margin:0px;overflow:hidden;\\\">\\n    <script type=\\\"text/javascript\\\" src=\\\"{{iframeURL_JS}}\\\"><\/script>\\n    <script>\\n        //parent.postMessage('{\\\"event\\\": \\\"ready\\\", \\\"id\\\": \\\"{{iframeID}}\\\"}', window.location.origin);\\n        //minthe : this should have proper logic for dynamic iframe generates on runtime.\\n        console.log(\\\"send postmessage\\\");\\n        parent.postMessage('{\\\"event\\\": \\\"ready\\\", \\\"id\\\": \\\"{{iframeID}}\\\"}', \\\"*\\\");\\n    <\/script>\\n    <div class=\\\"ad-element\\\">\\n    </div>\\n</body>\\n</html>\\n\";\n\n            var AD_STOPPED = 'AdStopped';\n\n            /**\n             * This callback is displayed as global member. The callback use nodejs error-first callback style\n             * @callback NodeStyleCallback\n             * @param {string|null}\n             * @param {undefined|object}\n             */\n\n            /**\n             * VPAIDHTML5Client\n             * @class\n             *\n             * @param {HTMLElement} el that will contain the iframe to load adUnit and a el to add to adUnit slot\n             * @param {HTMLVideoElement} video default video element to be used by adUnit\n             * @param {object} [templateConfig] template: html template to be used instead of the default, extraOptions: to be used when rendering the template\n             * @param {object} [vpaidOptions] timeout: when loading adUnit\n             */\n            function VPAIDHTML5Client(el, video, templateConfig, vpaidOptions) {\n                templateConfig = templateConfig || {};\n\n                this._id = unique();\n                this._destroyed = false;\n\n                this._frameContainer = utils.createElementInEl(el, 'div');\n                this._videoEl = video;\n                this._vpaidOptions = vpaidOptions || { timeout: 10000 };\n\n                this._templateConfig = {\n                    template: templateConfig.template || defaultTemplate,\n                    extraOptions: templateConfig.extraOptions || {}\n                };\n\n            }\n\n            /**\n             * destroy\n             *\n             */\n            VPAIDHTML5Client.prototype.destroy = function destroy() {\n                if (this._destroyed) {\n                    return;\n                }\n                this._destroyed = true;\n                $unloadPreviousAdUnit.call(this);\n            };\n\n            /**\n             * isDestroyed\n             *\n             * @return {boolean}\n             */\n            VPAIDHTML5Client.prototype.isDestroyed = function isDestroyed() {\n                return this._destroyed;\n            };\n\n            /**\n             * loadAdUnit\n             *\n             * @param {string} adURL url of the js of the adUnit\n             * @param {nodeStyleCallback} callback\n             */\n            VPAIDHTML5Client.prototype.loadAdUnit = function loadAdUnit(adURL, callback) {\n                $throwIfDestroyed.call(this);\n                $unloadPreviousAdUnit.call(this);\n\n                var frame = utils.createIframeWithContent(\n                    this._frameContainer,\n                    this._templateConfig.template,\n                    utils.extend({\n                        iframeURL_JS: adURL,\n                        iframeID: this.getID()\n                    }, this._templateConfig.extraOptions)\n                );\n                this._frame = frame;\n\n                this._onLoad = utils.callbackTimeout(\n                    this._vpaidOptions.timeout,\n                    onLoad.bind(this),\n                    onTimeout.bind(this)\n                );\n\n                // Set up user activity detection Hook for the iframe;\n                handleUserActivityIframeEvents(this._frame);\n\n                window.addEventListener('message', this._onLoad);\n\n                function onLoad(e) {\n\n                    console.log(\"got postMessage from container\");\n\n                    //minthe : this should have proper logic for dynamic iframe generates on runtime.\n                    //don't clear timeout\n                    //if (e.origin !== window.location.origin) return;\n                    var result = JSON.parse(e.data);\n\n                    //don't clear timeout\n                    if (result.id !== this.getID()) return;\n\n                    var adUnit, error, createAd;\n                    if (!this._frame.contentWindow) {\n\n                        error = 'the iframe is not anymore in the DOM tree';\n\n                    } else {\n                        createAd = this._frame.contentWindow.getVPAIDAd;\n                        error = utils.validate(typeof createAd === 'function', 'the ad didn\\'t return a function to create an ad');\n                    }\n\n                    if (!error) {\n                        var adEl = this._frame.contentWindow.document.querySelector('.ad-element');\n                        adUnit = new VPAIDAdUnit(createAd(), adEl, this._videoEl, this._frame);\n                        adUnit.subscribe(AD_STOPPED, $adDestroyed.bind(this));\n                        error = utils.validate(adUnit.isValidVPAIDAd(), 'the add is not fully complaint with VPAID specification');\n                    }\n\n                    this._adUnit = adUnit;\n                    $destroyLoadListener.call(this);\n                    callback(error, error ? null : adUnit);\n\n                    //clear timeout\n                    return true;\n                }\n\n                function onTimeout() {\n                    callback('timeout', null);\n                }\n\n                // VIDLA 1106 + VIDLA 601:\n                // Root cause for video JS not detecting UserActivity.\n                // if mousemove and touch events happens inside an iframe,\n                // then it is not automatically propogated to the player element.\n                // This code is forcing the mouse and touch event up to video js\n                // so that useractivity logic works just as for Vast mp4s\n                function handleUserActivityIframeEvents(iframe){\n                    // Save any previous handler\n                    var existingOnMouseMove = iframe.contentWindow.onmousemove;\n                    var existingOnMouseOver = iframe.contentWindow.onmouseover;\n\n                    var existingOnTouchStart = iframe.contentWindow.ontouchstart;\n                    var existingOnTouchEnd = iframe.contentWindow.ontouchend;\n\n                    iframe.contentWindow.onmousemove = function(e) {\n                        if (existingOnMouseMove) existingOnMouseMove(e);\n                        forwardMouseEvent(e, \"mousemove\");\n                    };\n\n                    iframe.contentWindow.onmouseover = function(e) {\n                        if (existingOnMouseOver) existingOnMouseOver(e);\n                        forwardMouseEvent(e, \"mouseover\");\n                    };\n\n                    function forwardMouseEvent(e, nameOfEvent){\n                        var evt = document.createEvent(\"MouseEvents\");\n                        // We'll need this to offset the mouse move appropriately\n                        var boundingClientRect = iframe.getBoundingClientRect();\n                        // Initialize the event, copying exiting event values\n                        // for the most part\n                        evt.initMouseEvent(\n                            nameOfEvent,\n                            true, // bubbles\n                            false, // not cancelable\n                            window,\n                            e.detail,\n                            e.screenX,\n                            e.screenY,\n                            e.clientX + boundingClientRect.left,\n                            e.clientY + boundingClientRect.top,\n                            e.ctrlKey,\n                            e.altKey,\n                            e.shiftKey,\n                            e.metaKey,\n                            e.button,\n                            null // no related element\n                        );\n                        iframe.dispatchEvent(evt);\n                    };\n\n                    iframe.contentWindow.ontouchstart = function(e) {\n                        if (existingOnTouchStart) existingOnTouchStart(e);\n                        forwardTouch(e);\n                    };\n\n                    iframe.contentWindow.ontouchend = function(e) {\n                        if (existingOnTouchEnd) existingOnTouchEnd(e);\n                        forwardTouch(e);\n                    };\n\n                    function forwardTouch(e){\n                        var evt = document.createEvent(\"HTMLEvents\");\n                        evt.initEvent(\n                            e.type,\n                            true, // bubbles\n                            false, // not cancelable\n                            window);\n                        iframe.dispatchEvent(evt);\n                    };\n                };\n            };\n\n            /**\n             * unloadAdUnit\n             *\n             */\n            VPAIDHTML5Client.prototype.unloadAdUnit = function unloadAdUnit() {\n                $unloadPreviousAdUnit.call(this);\n            };\n\n            /**\n             * getID will return the unique id\n             *\n             * @return {string}\n             */\n            VPAIDHTML5Client.prototype.getID = function() {\n                return this._id;\n            };\n\n\n            /**\n             * $removeEl\n             *\n             * @param {string} key\n             */\n            function $removeEl(key) {\n                var el = this[key];\n                if (el) {\n                    el.remove();\n                    delete this[key];\n                }\n            }\n\n            function $adDestroyed() {\n                $removeAdElements.call(this);\n                delete this._adUnit;\n            }\n\n            function $unloadPreviousAdUnit() {\n                $removeAdElements.call(this);\n                $destroyAdUnit.call(this);\n            }\n\n            function $removeAdElements() {\n                $removeEl.call(this, '_frame');\n                $destroyLoadListener.call(this);\n            }\n\n            /**\n             * $destroyLoadListener\n             *\n             */\n            function $destroyLoadListener() {\n                if (this._onLoad) {\n                    window.removeEventListener('message', this._onLoad);\n                    utils.clearCallbackTimeout(this._onLoad);\n                    delete this._onLoad;\n                }\n            }\n\n\n            function $destroyAdUnit() {\n                if (this._adUnit) {\n                    this._adUnit.stopAd();\n                    delete this._adUnit;\n                }\n            }\n\n            /**\n             * $throwIfDestroyed\n             *\n             */\n            function $throwIfDestroyed() {\n                if (this._destroyed) {\n                    throw new Error('VPAIDHTML5Client already destroyed!');\n                }\n            }\n\n            module.exports = VPAIDHTML5Client;\n            window.VPAIDHTML5Client = VPAIDHTML5Client;\n\n\n        }, { \"./VPAIDAdUnit\": 2, \"./utils\": 5 }],\n        4: [function(require, module, exports) {\n            'use strict';\n\n            function Subscriber() {\n                this._subscribers = {};\n            }\n\n            Subscriber.prototype.subscribe = function subscribe(handler, eventName, context) {\n                this.get(eventName).push({ handler: handler, context: context });\n            };\n\n            Subscriber.prototype.unsubscribe = function unsubscribe(handler, eventName) {\n                this._subscribers[eventName] = this.get(eventName).filter(function(subscriber) {\n                    return handler === subscriber.handler;\n                });\n            };\n\n            Subscriber.prototype.unsubscribeAll = function unsubscribeAll() {\n                this._subscribers = {};\n            };\n\n            Subscriber.prototype.trigger = function(eventName, data) {\n                var that = this;\n                that.get(eventName).forEach(function(subscriber) {\n                    setTimeout(function() {\n                        if (that.get(eventName)) {\n                            subscriber.handler.call(subscriber.context, data);\n                        }\n                    }, 0);\n                });\n            };\n\n            Subscriber.prototype.triggerSync = function(eventName, data) {\n                this.get(eventName).forEach(function(subscriber) {\n                    subscriber.handler.call(subscriber.context, data);\n                });\n            };\n\n            Subscriber.prototype.get = function get(eventName) {\n                if (!this._subscribers[eventName]) {\n                    this._subscribers[eventName] = [];\n                }\n                return this._subscribers[eventName];\n            };\n\n            module.exports = Subscriber;\n\n\n        }, {}],\n        5: [function(require, module, exports) {\n            'use strict';\n\n            /**\n             * noop a empty function\n             */\n            function noop() {}\n\n            /**\n             * validate if is not validate will return an Error with the message\n             *\n             * @param {boolean} isValid\n             * @param {string} message\n             */\n            function validate(isValid, message) {\n                return isValid ? null : new Error(message);\n            }\n\n            var timeouts = {};\n            /**\n             * clearCallbackTimeout\n             *\n             * @param {function} func handler to remove\n             */\n            function clearCallbackTimeout(func) {\n                var timeout = timeouts[func];\n                if (timeout) {\n                    clearTimeout(timeout);\n                    delete timeouts[func];\n                }\n            }\n\n            /**\n             * callbackTimeout if the onSuccess is not called and returns true in the timelimit then onTimeout will be called\n             *\n             * @param {number} timer\n             * @param {function} onSuccess\n             * @param {function} onTimeout\n             */\n            function callbackTimeout(timer, onSuccess, onTimeout) {\n                var callback, timeout;\n\n                timeout = setTimeout(function() {\n                    onSuccess = noop;\n                    if (!timeouts[callback]) {\n                        // Timeout has already been resolved.\n                        return;\n                    }\n                    delete timeout[callback];\n                    onTimeout();\n                }, timer);\n\n                callback = function() {\n                    // TODO avoid leaking arguments\n                    // https://github.com/petkaantonov/bluebird/wiki/Optimization-killers#32-leaking-arguments\n                    if (onSuccess.apply(this, arguments)) {\n                        clearCallbackTimeout(callback);\n                    }\n                };\n\n                timeouts[callback] = timeout;\n\n                return callback;\n            }\n\n\n            /**\n             * createElementInEl\n             *\n             * @param {HTMLElement} parent\n             * @param {string} tagName\n             * @param {string} id\n             */\n            function createElementInEl(parent, tagName, id) {\n                var nEl = document.createElement(tagName);\n                if (id) nEl.id = id;\n                parent.appendChild(nEl);\n                return nEl;\n            }\n\n            /**\n             * createIframeWithContent\n             *\n             * @param {HTMLElement} parent\n             * @param {string} template simple template using {{var}}\n             * @param {object} data\n             */\n            function createIframeWithContent(parent, template, data) {\n                var iframe = createIframe(parent);\n                if (!setIframeContent(iframe, simpleTemplate(template, data))) return;\n                return iframe;\n            }\n\n            function isSafari() {\n                return (/version\\/([\\w\\.]+).+?(mobile\\s?safari|safari)/i.test(navigator.userAgent.toLowerCase()));\n            };\n    \n            /**\n             * createIframe\n             *\n             * @param {HTMLElement} parent\n             * @param {string} url\n             */\n            function createIframe(parent, url) {\n                var nEl = document.createElement('iframe');\n                if (isSafari()) {\n                    // Sometimes in Safari iframe is created without document element.\n                    // To make sure a document element is created, we use srcdoc property with fake data.\n                    nEl.srcdoc = '<p>.</p>';\n                }\n                nEl.src = url || 'about:blank';\n                nEl.width = '100%';\n                nEl.height = '100%';\n                nEl.style.position = 'absolute';\n                nEl.style.left = '0';\n                nEl.style.top = '0';\n                nEl.style.border = '0';\n                parent.innerHTML = '';\n                parent.appendChild(nEl);\n                return nEl;\n            }\n\n            /**\n             * simpleTemplate\n             *\n             * @param {string} template\n             * @param {object} data\n             */\n            function simpleTemplate(template, data) {\n                Object.keys(data).forEach(function(key) {\n                    var value = (typeof value === 'object') ? JSON.stringify(data[key]) : data[key];\n                    template = template.replace(new RegExp('{{' + key + '}}', 'g'), value);\n                });\n                return template;\n            }\n\n            /**\n             * setIframeContent\n             *\n             * @param {HTMLIframeElement} iframeEl\n             * @param content\n             */\n            function setIframeContent(iframeEl, content) {\n                var iframeDoc = iframeEl.contentWindow && iframeEl.contentWindow.document;\n                if (!iframeDoc) return false;\n\n                iframeDoc.write(content);\n\n                return true;\n            }\n\n\n            /**\n             * extend object with keys from another object\n             *\n             * @param {object} toExtend\n             * @param {object} fromSource\n             */\n            function extend(toExtend, fromSource) {\n                Object.keys(fromSource).forEach(function(key) {\n                    toExtend[key] = fromSource[key];\n                });\n                return toExtend;\n            }\n\n\n            /**\n             * unique will create a unique string everytime is called, sequentially and prefixed\n             *\n             * @param {string} prefix\n             */\n            function unique(prefix) {\n                var count = -1;\n                return function() {\n                    return prefix + '_' + (++count);\n                };\n            }\n\n            module.exports = {\n                noop: noop,\n                validate: validate,\n                clearCallbackTimeout: clearCallbackTimeout,\n                callbackTimeout: callbackTimeout,\n                createElementInEl: createElementInEl,\n                createIframeWithContent: createIframeWithContent,\n                createIframe: createIframe,\n                simpleTemplate: simpleTemplate,\n                setIframeContent: setIframeContent,\n                extend: extend,\n                unique: unique\n            };\n\n\n        }, {}]\n    }, {}, [3])\n\n\n    ;\n    //Small subset of async\n    var async = {};\n\n    async.setImmediate = function(fn) {\n        setTimeout(fn, 0);\n    };\n\n    async.iterator = function(tasks) {\n        var makeCallback = function(index) {\n            var fn = function() {\n                if (tasks.length) {\n                    tasks[index].apply(null, arguments);\n                }\n                return fn.next();\n            };\n            fn.next = function() {\n                return (index < tasks.length - 1) ? makeCallback(index + 1) : null;\n            };\n            return fn;\n        };\n        return makeCallback(0);\n    };\n\n\n    async.waterfall = function(tasks, callback) {\n        callback = callback || function() {};\n        if (!isArray(tasks)) {\n            var err = new Error('First argument to waterfall must be an array of functions');\n            return callback(err);\n        }\n        if (!tasks.length) {\n            return callback();\n        }\n        var wrapIterator = function(iterator) {\n            return function(err) {\n                if (err) {\n                    callback.apply(null, arguments);\n                    callback = function() {};\n                } else {\n                    var args = Array.prototype.slice.call(arguments, 1);\n                    var next = iterator.next();\n                    if (next) {\n                        args.push(wrapIterator(next));\n                    } else {\n                        args.push(callback);\n                    }\n                    async.setImmediate(function() {\n                        iterator.apply(null, args);\n                    });\n                }\n            };\n        };\n        wrapIterator(async.iterator(tasks))();\n    };\n\n    async.when = function(condition, callback) {\n        if (!isFunction(callback)) {\n            throw new Error(\"async.when error: missing callback argument\");\n        }\n\n        var isAllowed = isFunction(condition) ? condition : function() {\n            return !!condition;\n        };\n\n        return function() {\n            var args = arrayLikeObjToArray(arguments);\n            var next = args.pop();\n\n            if (isAllowed.apply(null, args)) {\n                return callback.apply(this, arguments);\n            }\n\n            args.unshift(null);\n            return next.apply(null, args);\n        };\n    };\n\n\n\n    ;\n    \"use strict\";\n\n    var dom = {};\n\n    dom.isVisible = function isVisible(el) {\n        var style = window.getComputedStyle(el);\n        return style.visibility !== 'hidden';\n    };\n\n    dom.isHidden = function isHidden(el) {\n        var style = window.getComputedStyle(el);\n        return style.display === 'none';\n    };\n\n    dom.isShown = function isShown(el) {\n        return !dom.isHidden(el);\n    };\n\n    dom.hide = function hide(el) {\n        el.__prev_style_display_ = el.style.display;\n        el.style.display = 'none';\n    };\n\n    dom.show = function show(el) {\n        if (dom.isHidden(el)) {\n            el.style.display = el.__prev_style_display_;\n        }\n        el.__prev_style_display_ = undefined;\n    };\n\n    dom.hasClass = function hasClass(el, cssClass) {\n        var classes, i, len;\n\n        if (isNotEmptyString(cssClass)) {\n            if (el.classList) {\n                return el.classList.contains(cssClass);\n            }\n\n            classes = isString(el.getAttribute('class')) ? el.getAttribute('class').split(/\\s+/) : [];\n            cssClass = (cssClass || '');\n\n            for (i = 0, len = classes.length; i < len; i += 1) {\n                if (classes[i] === cssClass) {\n                    return true;\n                }\n            }\n        }\n        return false;\n    };\n\n    dom.addClass = function(el, cssClass) {\n        var classes;\n\n        if (isNotEmptyString(cssClass)) {\n            if (el.classList) {\n                return el.classList.add(cssClass);\n            }\n\n            classes = isString(el.getAttribute('class')) ? el.getAttribute('class').split(/\\s+/) : [];\n            if (isString(cssClass) && isNotEmptyString(cssClass.replace(/\\s+/, ''))) {\n                classes.push(cssClass);\n                el.setAttribute('class', classes.join(' '));\n            }\n        }\n    };\n\n    dom.removeClass = function(el, cssClass) {\n        var classes;\n\n        if (isNotEmptyString(cssClass)) {\n            if (el.classList) {\n                return el.classList.remove(cssClass);\n            }\n\n            classes = isString(el.getAttribute('class')) ? el.getAttribute('class').split(/\\s+/) : [];\n            var newClasses = [];\n            var i, len;\n            if (isString(cssClass) && isNotEmptyString(cssClass.replace(/\\s+/, ''))) {\n\n                for (i = 0, len = classes.length; i < len; i += 1) {\n                    if (cssClass !== classes[i]) {\n                        newClasses.push(classes[i]);\n                    }\n                }\n                el.setAttribute('class', newClasses.join(' '));\n            }\n        }\n    };\n\n    dom.addEventListener = function addEventListener(el, type, handler) {\n        if (isArray(el)) {\n            forEach(el, function(e) {\n                dom.addEventListener(e, type, handler);\n            });\n            return;\n        }\n\n        if (isArray(type)) {\n            forEach(type, function(t) {\n                dom.addEventListener(el, t, handler);\n            });\n            return;\n        }\n\n        if (el.addEventListener) {\n            el.addEventListener(type, handler, false);\n        } else if (el.attachEvent) {\n            // WARNING!!! this is a very naive implementation !\n            // the event object that should be passed to the handler\n            // would not be there for IE8\n            // we should use \"window.event\" and then \"event.srcElement\"\n            // instead of \"event.target\"\n            el.attachEvent(\"on\" + type, handler);\n        }\n    };\n\n    dom.removeEventListener = function removeEventListener(el, type, handler) {\n        if (isArray(el)) {\n            forEach(el, function(e) {\n                dom.removeEventListener(e, type, handler);\n            });\n            return;\n        }\n\n        if (isArray(type)) {\n            forEach(type, function(t) {\n                dom.removeEventListener(el, t, handler);\n            });\n            return;\n        }\n\n        if (el.removeEventListener) {\n            el.removeEventListener(type, handler, false);\n        } else if (el.detachEvent) {\n            el.detachEvent(\"on\" + type, handler);\n        } else {\n            el[\"on\" + type] = null;\n        }\n    };\n\n    dom.dispatchEvent = function dispatchEvent(el, event) {\n        if (el.dispatchEvent) {\n            el.dispatchEvent(event);\n        } else {\n            el.fireEvent(\"on\" + event.eventType, event);\n        }\n    };\n\n    dom.isDescendant = function isDescendant(parent, child) {\n        var node = child.parentNode;\n        while (node !== null) {\n            if (node === parent) {\n                return true;\n            }\n            node = node.parentNode;\n        }\n        return false;\n    };\n\n    dom.getTextContent = function getTextContent(el) {\n        return el.textContent || el.text;\n    };\n\n    dom.prependChild = function prependChild(parent, child) {\n        if (child.parentNode) {\n            child.parentNode.removeChild(child);\n        }\n        return parent.insertBefore(child, parent.firstChild);\n    };\n\n    dom.remove = function removeNode(node) {\n        if (node && node.parentNode) {\n            node.parentNode.removeChild(node);\n        }\n    };\n\n    dom.isDomElement = function isDomElement(o) {\n        return o instanceof Element;\n    };\n\n    dom.click = function(el, handler) {\n        dom.addEventListener(el, 'click', handler);\n    };\n\n    dom.once = function(el, type, handler) {\n        function handlerWrap() {\n            handler.apply(null, arguments);\n            dom.removeEventListener(el, type, handlerWrap);\n        }\n\n        dom.addEventListener(el, type, handlerWrap);\n    };\n\n    //Note: there is no getBoundingClientRect on iPad so we need a fallback\n    dom.getDimension = function getDimension(element) {\n        var rect;\n        var parentNode = element.parentNode;\n        // VIDLA-910 Always initializing with 1x1 for creative to better deal with falsy cases.\n        // some creatives do not like 0x0 initializations specially inside iframe.\n        var width = 1;\n        var height = 1;\n        if (parentNode) {\n            width = parentNode.clientWidth ? parentNode.clientWidth : width;\n            height = parentNode.clientHeight ? parentNode.clientHeight : height;\n        }else {\n            width = element.offsetWidth ? element.offsetWidth : width;\n            height = element.offsetHeight ? element.offsetHeight : height;\n        }\n        return {\n            width: width,\n            height: height\n        };\n    };\n\n    \"use strict\";\n\n    var logger = {};\n\n    ;\n    \"use strict\";\n\n    //minthe2 profile\n    var profile = {};\n\n    profile.timeout = 0;\n    profile.initAdTimestamp = 0;\n    profile.adLoadedTimestamp = 0;\n\n    profile.startAdTimestamp = 0;\n    profile.adStartedTimestamp = 0;\n    profile.startAdTimeoutReported = false;\n\n    profile.adImpressionTimestamp = 0;\n\n    profile.getState = function() {\n        if (profile.adImpressionTimestamp) {\n            return 'adImpression';\n        }\n        if (profile.startAdTimestamp) {\n            return 'startAd';\n        }\n        if (profile.initAdTimestamp) {\n            return 'initAd';\n        }\n        return 'pluginInit';\n    };\n\n    profile.getRemainingTime = function(type) {\n        var offset = 0;\n        var currTime = new Date().getTime();\n        switch (type) {\n            case 'initAd':\n                offset = currTime - profile.initAdTimestamp;\n                break;\n            case 'AdLoaded':\n                offset = profile.getInitTime();\n                break;\n            case 'startAd':\n                offset = profile.getInitTime();\n                break;\n            case 'AdStarted':\n                offset = profile.getInitTime() + profile.getStartTime();\n                break;\n            case 'AdImpression':\n                offset = profile.getTotalTime();\n                break;\n            default:\n                break;\n        }\n        var remainingTime = profile.timeout - offset;\n        return remainingTime;\n    };\n\n    profile.getInitTime = function() {\n        var interval = profile.adLoadedTimestamp - profile.initAdTimestamp;\n        return interval;\n    };\n\n    profile.getStartTime = function() {\n        var interval = profile.adStartedTimestamp - profile.startAdTimestamp;\n        return interval;\n    };\n\n    profile.getAdImpressionTime = function() {\n        var interval = profile.adImpressionTimestamp - profile.startAdTimestamp;\n        return interval;\n    };\n\n    profile.getTotalTime = function() {\n\n        var interval = profile.getInitTime();\n\n        if (profile.adStartedTimestamp > profile.adImpressionTimestamp) {\n            interval = interval + profile.getStartTime();\n        } else {\n            interval = interval + profile.getAdImpressionTime();\n        }\n\n        // if (profile.adImpressionTimestamp) {\n        //     interval = interval + profile.getAdImpressionTime();\n        // }\n        return interval;\n    };\n\n    ;\n    \"use strict\";\n\n    //minthe2 timer\n    var timer = {};\n\n    timer.killUnresponsiveCreative = false;\n    timer.responseWaitingTime = 1000;\n    timer.killTimeout = null;\n    timer.adCancelTimeout = 5000;\n    timer.adLoadTimeout = null;\n    timer.adStartTimeout = null;\n    // timer.adImpressionTimeout = null;\n    timer.adStartedResponseTime = 0;\n    timer.adImpressionResponseTime = 0;\n\n\n    timer.startKillTimeout = function(adUnit) {\n        if (timer.killUnresponsiveCreative) {\n            // if already timeout is set . cleanup\n            if (timer.killTimeout) {\n                timer.stopKillTimeout();\n            }\n            timer.killTimeout = setTimeout(function() {\n                if (timer.killTimeout) {\n                    logger.log('killUnresponsiveCreative Timeout reached ');\n                    adUnit.stopAd();\n                }\n            }, timer.responseWaitingTime);\n        }\n    };\n\n    timer.stopKillTimeout = function() {\n        if (!timer.killTimeout) {\n            return;\n        }\n        timer.clearTimeout(timer.killTimeout);\n        timer.killTimeout = null;\n    };\n\n    timer.handleAdTimeout = function(cb, state) {\n        logger.error('VPAID AD TIMED OUT :: AFTER ' + state + ' ,timeout value : ' + timer.adCancelTimeout);\n        if (cb) {\n            cb(new VASTError('timeout while waiting for the video to start playing', 402));\n        }\n    };\n\n    timer.clearTimeout = function(timeout) {\n        if (timeout) {\n            clearTimeout(timeout);\n            timeout = null;\n        }\n    };\n\n    timer.startInitAdTimeout = function(cb) {\n        profile.timeout = timer.adCancelTimeout;\n        profile.initAdTimestamp = new Date().getTime();\n        timer.adLoadTimeout = setTimeout(function() {\n            timer.handleAdTimeout(cb, \"initAd\");\n        }, timer.adCancelTimeout);\n    };\n\n    timer.stopInitAdTimeout = function() {\n        profile.adLoadedTimestamp = new Date().getTime();\n        timer.adStartedResponseTime = timer.adCancelTimeout - profile.getInitTime();\n        timer.clearTimeout(timer.adLoadTimeout);\n\n    };\n\n    timer.startStartAdTimeout = function(cb) {\n        profile.startAdTimestamp = new Date().getTime();\n        var timeoutFunction;\n\n        timeoutFunction = function() {\n            if (profile.startAdTimeoutReported) {\n                // avoid ad start timeout report duplication\n                // in case of'pod' timeout report duplication may destroy next ad slot\n                return;\n            }\n            profile.startAdTimeoutReported = true;\n            if (profile.adStartedTimestamp > 0) {\n                timer.handleAdTimeout(cb, \"AdStarted\");\n            } else {\n                timer.handleAdTimeout(cb, \"startAd\");\n            }\n        }\n\n        timer.adStartTimeout = setTimeout(timeoutFunction, timer.adStartedResponseTime);\n    };\n\n    timer.stopStartAdTimeout = function() {\n        timer.clearTimeout(timer.adStartTimeout);\n        logger.debug(\"stopStartAdTimeout\");\n    };\n\n    // timer.startAdImpressionTimeout =  function(cb) {\n    //     profile.adImpressionTimestamp = new Date().getTime();\n    //     timer.adImpressionTimeout = setTimeout(function(){\n    //         timer.handleAdTimeout(cb,\"AdStarted\");\n    //     }, timer.adImpressionResponseTime);\n    // };\n\n    // timer.stopAdImpressionTimeout =  function() {\n    //     profile.adImpressionTimestamp = new Date().getTime();\n    //     timer.clearTimeout(timer.adImpressionTimeout);\n    // };\n\n    timer.stopAdTimeouts = function() {\n        logger.debug(\"stopAdTimeouts\");\n        timer.clearTimeout(timer.adLoadTimeout);\n        timer.clearTimeout(timer.adStartTimeout);\n        // timer.clearTimeout(timer.adImpressionTimeout);\n    };\n\n    ;\n    \"use strict\";\n\n    function HttpRequestError(message) {\n        this.message = 'HttpRequest Error: ' + (message || '');\n    }\n    HttpRequestError.prototype = new Error();\n    HttpRequestError.prototype.name = \"HttpRequest Error\";\n\n    function HttpRequest(createXhr) {\n        if (!isFunction(createXhr)) {\n            throw new HttpRequestError('Missing XMLHttpRequest factory method');\n        }\n\n        this.createXhr = createXhr;\n    }\n\n    HttpRequest.prototype.run = function(method, url, callback, options) {\n        sanityCheck(url, callback, options);\n        var timeout, timeoutId;\n        var xhr = this.createXhr();\n        options = options || {};\n        timeout = isNumber(options.timeout) ? options.timeout : 0;\n\n        xhr.open(method, urlParts(url).href, true);\n\n        if (options.headers) {\n            setHeaders(xhr, options.headers);\n        }\n\n        if (options.withCredentials) {\n            xhr.withCredentials = true;\n        }\n\n        xhr.onload = function() {\n            var statusText, response, status;\n\n            /**\n             * The only way to do a secure request on IE8 and IE9 is with the XDomainRequest object. Unfortunately, microsoft is\n             * so nice that decided that the status property and the 'getAllResponseHeaders' method where not needed so we have to\n             * fake them. If the request gets done with an XDomainRequest instance, we will assume that there are no headers and\n             * the status will always be 200. If you don't like it, DO NOT USE ANCIENT BROWSERS!!!\n             *\n             * For mor info go to: https://msdn.microsoft.com/en-us/library/cc288060(v=vs.85).aspx\n             */\n            if (!xhr.getAllResponseHeaders) {\n                xhr.getAllResponseHeaders = function() {\n                    return null;\n                };\n            }\n\n            if (!xhr.status) {\n                xhr.status = 200;\n            }\n\n            if (isDefined(timeoutId)) {\n                clearTimeout(timeoutId);\n                timeoutId = undefined;\n            }\n\n            statusText = xhr.statusText || '';\n\n            // responseText is the old-school way of retrieving response (supported by IE8 & 9)\n            // response/responseType properties were introduced in XHR Level2 spec (supported by IE10)\n            response = ('response' in xhr) ? xhr.response : xhr.responseText;\n\n            // normalize IE9 bug (http://bugs.jquery.com/ticket/1450)\n            status = xhr.status === 1223 ? 204 : xhr.status;\n\n            callback(\n                status,\n                response,\n                xhr.getAllResponseHeaders(),\n                statusText);\n        };\n\n        xhr.onerror = requestError;\n        xhr.onabort = requestError;\n\n        xhr.send();\n\n        if (timeout > 0) {\n            timeoutId = setTimeout(function() {\n                xhr && xhr.abort();\n            }, timeout);\n        }\n\n        function sanityCheck(url, callback, options) {\n            if (!isString(url) || isEmptyString(url)) {\n                throw new HttpRequestError(\"Invalid url '\" + url + \"'\");\n            }\n\n            if (!isFunction(callback)) {\n                throw new HttpRequestError(\"Invalid handler '\" + callback + \"' for the http request\");\n            }\n\n            if (isDefined(options) && !isObject(options)) {\n                throw new HttpRequestError(\"Invalid options map '\" + options + \"'\");\n            }\n        }\n\n        function setHeaders(xhr, headers) {\n            forEach(headers, function(value, key) {\n                if (isDefined(value)) {\n                    xhr.setRequestHeader(key, value);\n                }\n            });\n        }\n\n        function requestError() {\n            callback(-1, null, null, '');\n        }\n    };\n\n    HttpRequest.prototype.get = function(url, callback, options) {\n        this.run('GET', url, processResponse, options);\n\n        function processResponse(status, response, headersString, statusText) {\n            if (isSuccess(status)) {\n                callback(null, response, status, headersString, statusText);\n            } else {\n                callback(new HttpRequestError(statusText), response, status, headersString, statusText);\n            }\n        }\n\n        function isSuccess(status) {\n            return 200 <= status && status < 300;\n        }\n    };\n\n    function createXhr() {\n        var xhr = new XMLHttpRequest();\n        if (!(\"withCredentials\" in xhr)) {\n            // XDomainRequest for IE.\n            xhr = new XDomainRequest();\n        }\n        return xhr;\n    }\n\n    var http = new HttpRequest(createXhr);\n\n    ;\n    var playerUtils = {};\n\n    /**\n     * Returns an object that captures the portions of player state relevant to\n     * video playback. The result of this function can be passed to\n     * restorePlayerSnapshot with a player to return the player to the state it\n     * was in when this function was invoked.\n     * @param {object} player The videojs player object\n     */\n    playerUtils.getPlayerSnapshot = function getPlayerSnapshot(player) {\n        var tech = player.el().querySelector('.vjs-tech');\n        var snapshot = {\n            ended: player.ended(),\n            src: player.currentSrc(),\n            currentTime: player.currentTime(),\n            type: player.currentType(),\n            playing: !player.paused(),\n            suppressedTracks: getSuppressedTracks(player)\n        };\n\n        if (tech) {\n            snapshot.nativePoster = tech.poster;\n            snapshot.style = tech.getAttribute('style');\n        }\n\n        return snapshot;\n\n        /**** Local Functions ****/\n        function getSuppressedTracks(player) {\n            var tracks = player.remoteTextTracks ? player.remoteTextTracks() : [];\n\n            if (tracks && isArray(tracks.tracks_)) {\n                tracks = tracks.tracks_;\n            }\n\n            if (!isArray(tracks)) {\n                tracks = [];\n            }\n\n            var suppressedTracks = [];\n            tracks.forEach(function(track) {\n                suppressedTracks.push({\n                    track: track,\n                    mode: track.mode\n                });\n                track.mode = 'disabled';\n            });\n\n            return suppressedTracks;\n        }\n    };\n\n    /**\n     * Attempts to modify the specified player so that its state is equivalent to\n     * the state of the snapshot.\n     * @param {object} snapshot - the player state to apply\n     */\n    playerUtils.restorePlayerSnapshot = function restorePlayerSnapshot(player, snapshot) {\n        var tech = player.el().querySelector('.vjs-tech');\n        var attempts = 20; // the number of remaining attempts to restore the snapshot\n\n        if (snapshot.nativePoster) {\n            tech.poster = snapshot.nativePoster;\n        }\n\n        if ('style' in snapshot) {\n            // overwrite all css style properties to restore state precisely\n            tech.setAttribute('style', snapshot.style || '');\n        }\n\n        if (hasSrcChanged(player, snapshot)) {\n            // on ios7, fiddling with textTracks too early will cause safari to crash\n            player.one('contentloadedmetadata', restoreTracks);\n\n            player.one('canplay', tryToResume);\n            ensureCanplayEvtGetsFired();\n\n            // if the src changed for ad playback, reset it\n            player.src({ src: snapshot.src, type: snapshot.type });\n\n            // safari requires a call to `load` to pick up a changed source\n            player.load();\n\n        } else {\n            restoreTracks();\n\n            if (snapshot.playing) {\n                player.play();\n            }\n        }\n\n        /*** Local Functions ***/\n\n        /**\n         * Sometimes firefox does not trigger the 'canplay' evt.\n         * This code ensure that it always gets triggered triggered.\n         */\n        function ensureCanplayEvtGetsFired() {\n            var timeoutId = setTimeout(function() {\n                player.trigger('canplay');\n            }, 1000);\n\n            player.one('canplay', function() {\n                clearTimeout(timeoutId);\n            });\n        }\n\n        /**\n         * Determine whether the player needs to be restored to its state\n         * before ad playback began. With a custom ad display or burned-in\n         * ads, the content player state hasn't been modified and so no\n         * restoration is required\n         */\n        function hasSrcChanged(player, snapshot) {\n            if (player.src()) {\n                return player.src() !== snapshot.src;\n            }\n            // the player was configured through source element children\n            return player.currentSrc() !== snapshot.src;\n        }\n\n        function restoreTracks() {\n            var suppressedTracks = snapshot.suppressedTracks;\n            suppressedTracks.forEach(function(trackSnapshot) {\n                trackSnapshot.track.mode = trackSnapshot.mode;\n            });\n        }\n\n        /**\n         * Determine if the video element has loaded enough of the snapshot source\n         * to be ready to apply the rest of the state\n         */\n        function tryToResume() {\n            if (playerUtils.isReadyToResume(tech)) {\n                // if some period of the video is seekable, resume playback\n                return resume();\n            }\n\n            // delay a bit and then check again unless we're out of attempts\n            if (attempts--) {\n                setTimeout(tryToResume, 50);\n            } else {\n                (function() {\n                    try {\n                        resume();\n                    } catch (e) {\n                        videojs.log.warn('Failed to resume the content after an advertisement', e);\n                    }\n                })();\n            }\n\n\n            /*** Local functions ***/\n            function resume() {\n                player.currentTime(snapshot.currentTime);\n\n                if (snapshot.playing) {\n                    player.play();\n                }\n            }\n\n        }\n    };\n\n    playerUtils.isReadyToResume = function(tech) {\n        if (tech.readyState > 1) {\n            // some browsers and media aren't \"seekable\".\n            // readyState greater than 1 allows for seeking without exceptions\n            return true;\n        }\n\n        if (tech.seekable === undefined) {\n            // if the tech doesn't expose the seekable time ranges, try to\n            // resume playback immediately\n            return true;\n        }\n\n        if (tech.seekable.length > 0) {\n            // if some period of the video is seekable, resume playback\n            return true;\n        }\n\n        return false;\n    };\n\n    /**\n     * This function prepares the player to display ads.\n     * Adding convenience events like the 'vast.firsPlay' that gets fired when the video is first played\n     * and ads the blackPoster to the player to prevent content from being displayed before the preroll ad.\n     *\n     * @param player\n     */\n    playerUtils.prepareForAds = function(player, disableMonkeyPatchPlayerApi) {\n\n        var blackPoster = player.addChild('blackPoster');\n        var _firstPlay = true;\n        var volumeSnapshot;\n\n        var originalPlay;\n        var originalPause;\n        var originalPaused;\n\n        // VID-1955 Causes Interference with Waterfall playback\n        // VIDLA-853 Causes Interference with Mobile App playback\n        if (!disableMonkeyPatchPlayerApi) {\n            monkeyPatchPlayerApi();\n        }\n\n        player.on('play', tryToTriggerFirstPlay);\n        player.on('vast.reset', resetFirstPlay); //Every time we change the sources we reset the first play.\n        player.on('vast.firstPlay', restoreContentVolume);\n        player.on('error', hideBlackPoster); //If there is an error in the player we remove the blackposter to show the err msg\n        player.on('vast.adStart', hideBlackPoster);\n        player.on('vast.adsCancel', hideBlackPoster);\n        player.on('vast.adError', hideBlackPoster);\n        player.on('vast.adStart', addStyles);\n        player.on('vast.adEnd', removeStyles);\n        player.on('vast.adsCancel', removeStyles);\n\n        /*** Local Functions ***/\n\n        /**\n         What this function does is ugly and horrible and I should think twice before calling myself a good developer. With that said,\n         it is the best solution I could find to mute the video until the 'play' event happens (on mobile devices) and the plugin can decide whether\n         to play the ad or not.\n\n         We also need this monkeypatch to be able to pause and resume an ad using the player's API\n\n         If you have a better solution please do tell me.\n         */\n        function monkeyPatchPlayerApi() {\n\n            /**\n             * Monkey patch needed to handle firstPlay and resume of playing ad.\n             *\n             * @param prepareForAds necessary flag to prevent infinite loop when you are restoring a VAST ad.\n             * @returns {player}\n             */\n            var origPlay = player.play;\n            originalPlay = origPlay;\n            player.play = function(callOrigPlay) {\n\n                if (isFirstPlay()) {\n                    firstPlay.call(this);\n                } else {\n                    resume.call(this, callOrigPlay);\n                }\n\n                return this;\n\n                /*** local functions ***/\n                function firstPlay() {\n\n\n                    if (!isIPhone()) {\n                        volumeSnapshot = saveVolumeSnapshot();\n                        player.muted(true);\n                    }\n                    // Do not call play on the video element instead just trigger startAd and the creative will call play as it is suppose to.\n                    // VID-2515 Force the enabling of the spinner. As we do not call actual play the wait state to trigger spinner never gets activated until its too late.\n                    player.addClass('vjs-waiting');\n                    player.trigger('firstplay');\n                    player.trigger('play');\n                }\n\n                function resume(callOrigPlay) {\n                    if (isAdPlaying() && !callOrigPlay) {\n                        player.vast.adUnit.resumeAd();\n                    } else {\n                        origPlay.apply(this, arguments);\n                    }\n                }\n            };\n\n\n            /**\n             * Needed monkey patch to handle pause of playing ad.\n             *\n             * @param callOrigPlay necessary flag to prevent infinite loop when you are pausing a VAST ad.\n             * @returns {player}\n             */\n            var origPause = player.pause;\n            originalPause = origPause;\n            player.pause = function(callOrigPause) {\n                if (isAdPlaying() && !callOrigPause) {\n                    player.vast.adUnit.pauseAd();\n                } else {\n                    origPause.apply(this, arguments);\n                }\n                return this;\n            };\n\n\n            /**\n             * Needed monkey patch to handle paused state of the player when ads are playing.\n             *\n             * @param callOrigPlay necessary flag to prevent infinite loop when you are pausing a VAST ad.\n             * @returns {player}\n             */\n            var origPaused = player.paused;\n            originalPaused = origPaused;\n            player.paused = function(callOrigPaused) {\n                if (isAdPlaying() && !callOrigPaused) {\n                    return player.vast.adUnit.isPaused();\n                }\n                return origPaused.apply(this, arguments);\n            };\n        }\n\n        function isAdPlaying() {\n            return player.vast && player.vast.adUnit;\n        }\n\n        function tryToTriggerFirstPlay() {\n\n            if (isFirstPlay()) {\n                _firstPlay = false;\n                player.trigger('vast.firstPlay');\n            }\n        }\n\n        function reserOriginals () {\n            if (originalPlay) {\n                player.play = originalPlay;\n            }\n            if (originalPause) {\n                player.pause = originalPause;\n            }\n            if (originalPaused) {\n                player.paused = originalPaused;\n            }\n        }\n\n        function resetFirstPlay() {\n            _firstPlay = true;\n            reserOriginals();\n            blackPoster.show();\n            restoreContentVolume();\n        }\n\n        function isFirstPlay() {\n            return _firstPlay;\n        }\n\n        function saveVolumeSnapshot() {\n            return {\n                muted: player.muted(),\n                volume: player.volume()\n            };\n        }\n\n        function restoreContentVolume() {\n            if (volumeSnapshot) {\n                player.currentTime(0);\n                restoreVolumeSnapshot(volumeSnapshot);\n                volumeSnapshot = null;\n            }\n        }\n\n        function restoreVolumeSnapshot(snapshot) {\n            if (isObject(snapshot)) {\n                player.volume(snapshot.volume);\n                player.muted(snapshot.muted);\n            }\n        }\n\n        function hideBlackPoster() {\n            if (!dom.hasClass(blackPoster.el(), 'vjs-hidden')) {\n                blackPoster.hide();\n            }\n        }\n\n        function addStyles() {\n            dom.addClass(player.el(), 'vjs-ad-playing');\n        }\n\n        function removeStyles() {\n            dom.removeClass(player.el(), 'vjs-ad-playing');\n        }\n    };\n\n    /**\n     * Remove the poster attribute from the video element tech, if present. When\n     * reusing a video element for multiple videos, the poster image will briefly\n     * reappear while the new source loads. Removing the attribute ahead of time\n     * prevents the poster from showing up between videos.\n     * @param {object} player The videojs player object\n     */\n    playerUtils.removeNativePoster = function(player) {\n        var tech = player.el().querySelector('.vjs-tech');\n        if (tech) {\n            tech.removeAttribute('poster');\n        }\n    };\n\n    /**\n     * Helper function to listen to many events until one of them gets fired, then we\n     * execute the handler and unsubscribe all the event listeners;\n     *\n     * @param player specific player from where to listen for the events\n     * @param events array of events\n     * @param handler function to execute once one of the events fires\n     */\n    playerUtils.once = function once(player, events, handler) {\n        function listener() {\n            handler.apply(null, arguments);\n\n            events.forEach(function(event) {\n                player.off(event, listener);\n            });\n        }\n\n        events.forEach(function(event) {\n            player.on(event, listener);\n        });\n    };\n\n    ;\n    'use strict';\n\n    /**\n     * documentMode is an IE-only property\n     * http://msdn.microsoft.com/en-us/library/ie/cc196988(v=vs.85).aspx\n     */\n    var msie = document.documentMode;\n\n    /**\n     *\n     * IMPORTANT NOTE: This function comes from angularJs and was originally called urlResolve\n     *                 you can take a look at the original code here https://github.com/angular/angular.js/blob/master/src/ng/urlUtils.js\n     *\n     * Implementation Notes for non-IE browsers\n     * ----------------------------------------\n     * Assigning a URL to the href property of an anchor DOM node, even one attached to the DOM,\n     * results both in the normalizing and parsing of the URL.  Normalizing means that a relative\n     * URL will be resolved into an absolute URL in the context of the application document.\n     * Parsing means that the anchor node's host, hostname, protocol, port, pathname and related\n     * properties are all populated to reflect the normalized URL.  This approach has wide\n     * compatibility - Safari 1+, Mozilla 1+, Opera 7+,e etc.  See\n     * http://www.aptana.com/reference/html/api/HTMLAnchorElement.html\n     *\n     * Implementation Notes for IE\n     * ---------------------------\n     * IE >= 8 and <= 10 normalizes the URL when assigned to the anchor node similar to the other\n     * browsers.  However, the parsed components will not be set if the URL assigned did not specify\n     * them.  (e.g. if you assign a.href = \"foo\", then a.protocol, a.host, etc. will be empty.)  We\n     * work around that by performing the parsing in a 2nd step by taking a previously normalized\n     * URL (e.g. by assigning to a.href) and assigning it a.href again.  This correctly populates the\n     * properties such as protocol, hostname, port, etc.\n     *\n     * IE7 does not normalize the URL when assigned to an anchor node.  (Apparently, it does, if one\n     * uses the inner HTML approach to assign the URL as part of an HTML snippet -\n     * http://stackoverflow.com/a/472729)  However, setting img[src] does normalize the URL.\n     * Unfortunately, setting img[src] to something like \"javascript:foo\" on IE throws an exception.\n     * Since the primary usage for normalizing URLs is to sanitize such URLs, we can't use that\n     * method and IE < 8 is unsupported.\n     *\n     * References:\n     *   http://developer.mozilla.org/en-US/docs/Web/API/HTMLAnchorElement\n     *   http://www.aptana.com/reference/html/api/HTMLAnchorElement.html\n     *   http://url.spec.whatwg.org/#urlutils\n     *   https://github.com/angular/angular.js/pull/2902\n     *   http://james.padolsey.com/javascript/parsing-urls-with-the-dom/\n     *\n     * @kind function\n     * @param {string} url The URL to be parsed.\n     * @description Normalizes and parses a URL.\n     * @returns {object} Returns the normalized URL as a dictionary.\n     *\n     *   | member name   | Description    |\n     *   |---------------|----------------|\n     *   | href          | A normalized version of the provided URL if it was not an absolute URL |\n     *   | protocol      | The protocol including the trailing colon                              |\n     *   | host          | The host and port (if the port is non-default) of the normalizedUrl    |\n     *   | search        | The search params, minus the question mark                             |\n     *   | hash          | The hash string, minus the hash symbol\n     *   | hostname      | The hostname\n     *   | port          | The port, without \":\"\n     *   | pathname      | The pathname, beginning with \"/\"\n     *\n     */\n\n    var urlParsingNode = document.createElement(\"a\");\n\n    function urlParts(url) {\n        var href = url;\n\n        if (msie) {\n            // Normalize before parse.  Refer Implementation Notes on why this is\n            // done in two steps on IE.\n            urlParsingNode.setAttribute(\"href\", href);\n            href = urlParsingNode.href;\n        }\n\n        urlParsingNode.setAttribute('href', href);\n\n        // urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils\n        return {\n            href: urlParsingNode.href,\n            protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '',\n            host: urlParsingNode.host,\n            search: urlParsingNode.search ? urlParsingNode.search.replace(/^\\?/, '') : '',\n            hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '',\n            hostname: urlParsingNode.hostname,\n            port: isNotEmptyString(urlParsingNode.port) ? urlParsingNode.port : 80,\n            pathname: (urlParsingNode.pathname.charAt(0) === '/') ? urlParsingNode.pathname : '/' + urlParsingNode.pathname\n        };\n    }\n\n\n    /**\n     * This function accepts a query string (search part of a url) and returns a dictionary with\n     * the different key value pairs\n     * @param {string} qs queryString\n     */\n    function queryStringToObj(qs, cond) {\n        var pairs, qsObj;\n\n        cond = isFunction(cond) ? cond : function() {\n            return true;\n        };\n\n        qs = qs.trim().replace(/^\\?/, '');\n        pairs = qs.split('&');\n        qsObj = {};\n\n        forEach(pairs, function(pair) {\n            var keyValue, key, value;\n            if (pair !== '') {\n                keyValue = pair.split('=');\n                key = keyValue[0];\n                value = keyValue[1];\n                if (cond(key, value)) {\n                    qsObj[key] = value;\n                }\n            }\n        });\n\n        return qsObj;\n    }\n\n    /**\n     * This function accepts an object and serializes it into a query string without the leading '?'\n     * @param obj\n     * @returns {string}\n     */\n    function objToQueryString(obj) {\n        var pairs = [];\n        forEach(obj, function(value, key) {\n            pairs.push(key + '=' + value);\n        });\n        return pairs.join('&');\n    }\n\n\n    ;\n    var xml = {};\n\n    xml.strToXMLDoc = function strToXMLDoc(stringContainingXMLSource) {\n        //IE 8\n        if (typeof window.DOMParser === 'undefined') {\n            var xmlDocument = new ActiveXObject('Microsoft.XMLDOM');\n            xmlDocument.async = false;\n            xmlDocument.loadXML(stringContainingXMLSource);\n            return xmlDocument;\n        }\n\n        return parseString(stringContainingXMLSource);\n\n        function parseString(stringContainingXMLSource) {\n            var parser = new DOMParser();\n            var parsedDocument;\n\n            //Note: This try catch is to deal with the fact that on IE parser.parseFromString does throw an error but the rest of the browsers don't.\n            try {\n                parsedDocument = parser.parseFromString(stringContainingXMLSource, \"application/xml\");\n\n                if (isParseError(parsedDocument) || isEmptyString(stringContainingXMLSource)) {\n                    throw new Error();\n                }\n            } catch (e) {\n                throw new Error(\"xml.strToXMLDOC: Error parsing the string: '\" + stringContainingXMLSource + \"'\");\n            }\n\n            return parsedDocument;\n        }\n\n        function isParseError(parsedDocument) {\n            try { // parser and parsererrorNS could be cached on startup for efficiency\n                var parser = new DOMParser(),\n                    errorneousParse = parser.parseFromString('INVALID', 'text/xml'),\n                    parsererrorNS = errorneousParse.getElementsByTagName(\"parsererror\")[0].namespaceURI;\n\n                if (parsererrorNS === 'http://www.w3.org/1999/xhtml') {\n                    // In PhantomJS the parseerror element doesn't seem to have a special namespace, so we are just guessing here :(\n                    return parsedDocument.getElementsByTagName(\"parsererror\").length > 0;\n                }\n\n                return parsedDocument.getElementsByTagNameNS(parsererrorNS, 'parsererror').length > 0;\n            } catch (e) {\n                //Note on IE parseString throws an error by itself and it will never reach this code. Because it will have failed before\n            }\n        }\n    };\n\n    xml.parseText = function parseText(sValue) {\n        if (/^\\s*$/.test(sValue)) {\n            return null; }\n        if (/^(?:true|false)$/i.test(sValue)) {\n            return sValue.toLowerCase() === \"true\"; }\n        if (isFinite(sValue)) {\n            return parseFloat(sValue); }\n        if (isISO8601(sValue)) {\n            return new Date(sValue); }\n        return sValue.trim();\n    };\n\n    xml.JXONTree = function JXONTree(oXMLParent) {\n        var parseText = xml.parseText;\n\n        //The document object is an especial object that it may miss some functions or attrs depending on the browser.\n        //To prevent this problem with create the JXONTree using the root childNode which is a fully fleshed node on all supported\n        //browsers.\n        if (oXMLParent.documentElement) {\n            return new xml.JXONTree(oXMLParent.documentElement);\n        }\n\n        if (oXMLParent.hasChildNodes()) {\n            var sCollectedTxt = \"\";\n            for (var oNode, sProp, vContent, nItem = 0; nItem < oXMLParent.childNodes.length; nItem++) {\n                oNode = oXMLParent.childNodes.item(nItem);\n                /*jshint bitwise: false*/\n                if ((oNode.nodeType - 1 | 1) === 3) { sCollectedTxt += oNode.nodeType === 3 ? oNode.nodeValue.trim() : oNode.nodeValue; } else if (oNode.nodeType === 1 && !oNode.prefix) {\n                    sProp = decapitalize(oNode.nodeName);\n                    vContent = new xml.JXONTree(oNode);\n                    if (this.hasOwnProperty(sProp)) {\n                        if (this[sProp].constructor !== Array) { this[sProp] = [this[sProp]]; }\n                        this[sProp].push(vContent);\n                    } else { this[sProp] = vContent; }\n                }\n            }\n            if (sCollectedTxt) { this.keyValue = parseText(sCollectedTxt); }\n        }\n\n        //IE8 Stupid fix\n        var hasAttr = typeof oXMLParent.hasAttributes === 'undefined' ? oXMLParent.attributes.length > 0 : oXMLParent.hasAttributes();\n        if (hasAttr) {\n            var oAttrib;\n            for (var nAttrib = 0; nAttrib < oXMLParent.attributes.length; nAttrib++) {\n                oAttrib = oXMLParent.attributes.item(nAttrib);\n                this[\"@\" + decapitalize(oAttrib.name)] = parseText(oAttrib.value.trim());\n            }\n        }\n    };\n\n    xml.JXONTree.prototype.attr = function(attr) {\n        return this['@' + decapitalize(attr)];\n    };\n\n    xml.toJXONTree = function toJXONTree(xmlString) {\n        var xmlDoc = xml.strToXMLDoc(xmlString);\n        return new xml.JXONTree(xmlDoc);\n    };\n\n    /**\n     * Helper function to extract the keyvalue of a JXONTree obj\n     *\n     * @param xmlObj {JXONTree}\n     * return the key value or undefined;\n     */\n    xml.keyValue = function getKeyValue(xmlObj) {\n        if (xmlObj) {\n            return xmlObj.keyValue;\n        }\n        return undefined;\n    };\n\n    xml.attr = function getAttrValue(xmlObj, attr) {\n        if (xmlObj) {\n            return xmlObj['@' + decapitalize(attr)];\n        }\n        return undefined;\n    };\n\n    xml.encode = function encodeXML(str) {\n        return str.replace(/&/g, '&amp;')\n            .replace(/</g, '&lt;')\n            .replace(/>/g, '&gt;')\n            .replace(/\"/g, '&quot;')\n            .replace(/'/g, '&apos;');\n    };\n\n    xml.decode = function decodeXML(str) {\n        return str.replace(/&apos;/g, \"'\")\n            .replace(/&quot;/g, '\"')\n            .replace(/&gt;/g, '>')\n            .replace(/&lt;/g, '<')\n            .replace(/&amp;/g, '&');\n    };;\n\n    //minthe : initalize vastClient\n    vjs.plugin('vastClient', function VASTPlugin(options) {\n\n        var snapshot;\n        var player = this;\n        var vast = new VASTClient();\n        var adsCanceled = false;\n        var defaultOpts = {\n            // maximum amount of time in ms to wait to receive `adsready` from the ad\n            // implementation after play has been requested. Ad implementations are\n            // expected to load any dynamic libraries and make any requests to determine\n            // ad policies for a video during this time.\n            timeout: 500,\n\n            //TODO:finish this IOS FIX\n            //Whenever you play an add on IOS, the native player kicks in and we loose control of it. On very heavy pages the 'play' event\n            // May occur after the video content has already started. This is wrong if you want to play a preroll ad that needs to happen before the user\n            // starts watching the content. To prevent this usec\n            iosPrerollCancelTimeout: 2000,\n\n            // maximun amount of time for the ad to actually start playing. If this timeout gets\n            // triggered the ads will be cancelled\n            adCancelTimeout: 5000,\n\n            // Boolean flag that configures the player to play a new ad before the user sees the video again\n            // the current video\n            playAdAlways: false,\n\n            // Flag to enable or disable the ads by default.\n            adsEnabled: true,\n\n            // Boolean flag to enable or disable the resize with window.resize or orientationchange\n            autoResize: true,\n\n            //Boolean flag to enable/disable Controls on mouse over/out.\n            disableControlsOnMouseover: false,\n\n            initialAudio: 'off',\n\n            overlayPlayer: false,\n\n            mobileSDK: false,\n\n            controlBarPosition: \"below\",\n\n            isXandrVastPlayer: false\n        };\n\n        var settings = extend({}, defaultOpts, options || {});\n\n        if (isUndefined(settings.adTagUrl) && isDefined(settings.url)) {\n            settings.adTagUrl = settings.url;\n        }\n\n        if (isString(settings.adTagUrl)) {\n            settings.adTagUrl = echoFn(settings.adTagUrl);\n        }\n\n        if (isDefined(settings.adTagXML) && !isFunction(settings.adTagXML)) {\n            return trackAdError(new VASTError('on VideoJS VAST plugin, the passed adTagXML option does not contain a function'));\n        }\n\n        if (!isDefined(settings.adTagUrl) && !isFunction(settings.adTagXML)) {\n            return trackAdError(new VASTError('on VideoJS VAST plugin, missing adTagUrl on options object'));\n        }\n        var disableMonkeyPatchPlayerApi =  settings.mobileSDK ;\n        playerUtils.prepareForAds(player, disableMonkeyPatchPlayerApi);\n        if (settings.playAdAlways) {\n            // No matter what happens we play a new ad before the user sees the video again.\n            player.on('vast.contentEnd', function() {\n                setTimeout(function() {\n                    player.trigger('vast.reset');\n                }, 0);\n            });\n        }\n\n        player.on('vast.firstPlay', tryToPlayPrerollAd);\n\n        player.on('vast.reset', function() {\n            //If we are reseting the plugin, we don't want to restore the content\n            snapshot = null;\n            cancelAds();\n        });\n\n        player.vast = {\n            isEnabled: function() {\n                return settings.adsEnabled;\n            },\n\n            enable: function() {\n                settings.adsEnabled = true;\n            },\n\n            disable: function() {\n                settings.adsEnabled = false;\n            }\n        };\n\n        if (settings.loggerCallback) {\n            logger = settings.loggerCallback;\n        } else {\n            logger = console;\n        }\n        if (settings.terminateUnresponsiveVPAIDCreative) {\n            timer.killUnresponsiveCreative = true;\n        }\n        if (settings.adCancelTimeout) {\n            timer.adCancelTimeout = settings.adCancelTimeout;\n        }\n\n        var vastResponse = getAnVastXml();\n        var adIntegrator = isVPAID(vastResponse) ? new VPAIDIntegrator(player, settings) : new VASTIntegrator(player);\n\n        if (settings.delayExpandUntilVPAIDInit) {\n            checkAd(); //minthe : invoke init method of vpaid creative here in order to check valid ad, at the end of this checkAd process it will dispatch custom event which is called \"an.readytogovpaid\"\n        }\n\n        return player.vast;\n\n\n\n        /**** Local functions ****/\n        function tryToPlayPrerollAd() {\n            //We remove the poster to prevent flickering whenever the content starts playing\n            playerUtils.removeNativePoster(player);\n\n            playerUtils.once(player, ['vast.adsCancel', 'vast.adEnd'], function() {\n                removeAdUnit();\n                restoreVideoContent();\n            });\n\n            async.waterfall([\n                checkAdsEnabled,\n                preparePlayerForAd,\n                playPrerollAd\n            ], function(error, response) {\n                if (error) {\n                    trackAdError(error, response);\n                } else {\n                    player.trigger('vast.adEnd');\n                }\n            });\n\n            /*** Local functions ***/\n\n            function removeAdUnit() {\n                if (player.vast && player.vast.adUnit) {\n                    player.vast.adUnit = null; //We remove the adUnit\n                }\n            }\n\n            function restoreVideoContent() {\n                setupContentEvents();\n                if (snapshot) {\n                    playerUtils.restorePlayerSnapshot(player, snapshot);\n                    snapshot = null;\n                }\n            }\n\n            function setupContentEvents() {\n                playerUtils.once(player, ['playing', 'vast.reset', 'vast.firstPlay'], function(evt) {\n                    if (evt.type !== 'playing') {\n                        return;\n                    }\n\n                    player.trigger('vast.contentStart');\n\n                    playerUtils.once(player, ['ended', 'vast.reset', 'vast.firstPlay'], function(evt) {\n                        if (evt.type === 'ended') {\n                            player.trigger('vast.contentEnd');\n                        }\n                    });\n                });\n            }\n\n            function checkAdsEnabled(next) {\n                if (settings.adsEnabled) {\n                    return next(null);\n                }\n                next(new VASTError('Ads are not enabled'));\n            }\n\n            function preparePlayerForAd(next) {\n                if (canPlayPrerollAd()) {\n                    snapshot = playerUtils.getPlayerSnapshot(player);\n                    addSpinnerIcon();\n                    next(null);\n                } else {\n                    next(new VASTError('video content has been playing before preroll ad'));\n                }\n            }\n\n            function canPlayPrerollAd() {\n                return !isIPhone() || player.currentTime() <= settings.iosPrerollCancelTimeout;\n            }\n\n            function addSpinnerIcon() {\n                dom.addClass(player.el(), 'vjs-vast-ad-loading');\n                playerUtils.once(player, ['vast.adStart', 'vast.adsCancel'], removeSpinnerIcon);\n            }\n\n            function removeSpinnerIcon() {\n                //IMPORTANT NOTE: We remove the spinnerIcon asynchronously to give time to the browser to start the video.\n                // If we remove it synchronously we see a flash of the content video before the ad starts playing.\n                setTimeout(function() {\n                    dom.removeClass(player.el(), 'vjs-vast-ad-loading');\n                }, 100);\n            }\n\n        }\n\n        function cancelAds() {\n            player.trigger('vast.adsCancel');\n            adsCanceled = true;\n        }\n\n        function playPrerollAd(callback) {\n            async.waterfall([\n                //getVastResponse,//minthe : comment out, we're not using mail online's vast parser and loader\n                playAd\n            ], callback);\n        }\n\n        function getVastResponse(callback) {\n            vast.getVASTResponse(settings.adTagUrl ? settings.adTagUrl() : settings.adTagXML, callback);\n        }\n\n        function getAnVastXml() { //minthe : override vast response to use jsVpaidUrl coming from videoplayer framework\n            var vastResponse = new VASTResponse();\n            vastResponse._linearAdded = true;\n            vastResponse.ads = [{\n                \"id\": 1234567,\n                \"inLine\": {\n                    \"adTitle\": \"\",\n                    \"adSystem\": \"\",\n                    \"impressions\": [],\n                    \"creatives\": [{\n                        \"sequence\": 1,\n                        \"linear\": {\n                            \"duration\": 13000,\n                            \"mediaFiles\": [{\n                                \"src\": settings.jsVpaidUrl,\n                                \"type\": \"application/javascript\",\n                                \"apiFramework\": \"VPAID\"\n                            }],\n                            \"skipoffset\": null,\n                        }\n                    }, { \"sequence\": 1 }],\n                    \"description\": \"Vpaid Linear Video Ad\",\n                    \"surveys\": []\n                }\n            }];\n            vastResponse.errorURLMacros = [];\n            vastResponse.impressions = [];\n            vastResponse.customClicks = [];\n            vastResponse.mediaFiles = [{\n                \"src\": settings.jsVpaidUrl,\n                \"type\": \"application/javascript\",\n                \"apiFramework\": \"VPAID\"\n            }];\n            vastResponse.clickThrough = settings.clickUrl;\n            vastResponse.adTitle = \"\";\n            vastResponse.adParameters = settings.adParameters;\n\n            return vastResponse;\n        }\n\n        function playAd(vastResponse, callback) {\n\n            //minthe : override vast response to use jsVpaidUrl coming from videoplayer framework\n            vastResponse = getAnVastXml();\n\n            //TODO: Find a better way to stop the play. The 'playPrerollWaterfall' ends in an inconsistent situation\n            //If the state is not 'preroll?' it means the ads were canceled therefore, we break the waterfall\n            if (adsCanceled) {\n                return;\n            }\n\n            var adFinished = false;\n\n            //comment out for VID-1359\n            //if (isIDevice()) {\n            //preventManualProgress();\n            //}\n            callback = callback || trackAdError;\n            player.vast.adUnit = adIntegrator.playAd(vastResponse, callback);\n\n            //comment out for VID-1359\n            //function preventManualProgress() {\n            //    //IOS video clock is very unreliable and we need a 3 seconds threshold to ensure that the user forwarded/rewound the ad\n            //    var PROGRESS_THRESHOLD = 3;\n            //    var previousTime = 0;\n            //    var tech = player.el().querySelector('.vjs-tech');\n            //    var skipad_attempts = 0;\n            //\n            //    player.on('timeupdate', adTimeupdateHandler);\n            //    playerUtils.once(player, ['vast.adEnd', 'vast.adsCancel', 'vast.adError'], stopPreventManualProgress);\n            //\n            //    /*** Local functions ***/\n            //    function adTimeupdateHandler() {\n            //        var currentTime = player.currentTime();\n            //        var progressDelta = Math.abs(currentTime - previousTime);\n            //\n            //        if (progressDelta > PROGRESS_THRESHOLD) {\n            //            skipad_attempts += 1;\n            //            if (skipad_attempts >= 2) {\n            //                player.pause();\n            //            }\n            //            player.currentTime(previousTime);\n            //        } else {\n            //            previousTime = currentTime;\n            //        }\n            //    }\n            //\n            //    function stopPreventManualProgress() {\n            //        player.off('timeupdate', adTimeupdateHandler);\n            //    }\n            //}\n        }\n\n        //minthe : checkAd to check vpaid ad is ready to go\n        function checkAd(vastResponse, callback) {\n            vastResponse = getAnVastXml();\n            callback = callback || trackAdError;\n            player.vast.adUnit = adIntegrator.playAd(vastResponse, callback, true);\n        }\n\n        function trackAdError(error, vastResponse) {\n            if (!error) return;\n            player.trigger({ type: 'vast.adError', error: error });\n            cancelAds();\n            if (console && console.log) {\n                console.log('AD ERROR:', error.message, error, vastResponse);\n            }\n        }\n\n        function isVPAID(vastResponse) {\n            var i, len;\n            var mediaFiles = vastResponse.mediaFiles;\n            for (i = 0, len = mediaFiles.length; i < len; i++) {\n                if (vastUtil.isVPAID(mediaFiles[i])) {\n                    return true;\n                }\n            }\n            return false;\n        }\n    });\n\n    ;\n    vjs.AdsLabel = vjs.Component.extend({\n        /** @constructor */\n        init: function(player, options) {\n            vjs.Component.call(this, player, options);\n\n            var that = this;\n\n            // We asynchronously reposition the ads label element\n            setTimeout(function() {\n                var currentTimeComp = player.controlBar && (player.controlBar.getChild(\"timerControls\") || player.controlBar.getChild(\"currentTimeDisplay\"));\n                if (currentTimeComp) {\n                    player.controlBar.el().insertBefore(that.el(), currentTimeComp.el());\n                }\n                dom.removeClass(that.el(), 'vjs-label-hidden');\n            }, 0);\n        }\n    });\n\n    vjs.AdsLabel.prototype.createEl = function() {\n        return vjs.Component.prototype.createEl.call(this, 'div', {\n            className: 'vjs-ads-label vjs-control vjs-label-hidden',\n            innerHTML: 'Advertisement'\n        });\n    };;\n    /**\n     * The component that shows a black screen until the ads plugin has decided if it can or it can not play the ad.\n     *\n     * Note: In case you wonder why instead of this black poster we don't just show the spinner loader.\n     *       IOS devices do not work well with animations and the browser chrashes from time to time That is why we chose to\n     *       have a secondary black poster.\n     *\n     *       It also makes it much more easier for the users of the plugin since it does not change the default behaviour of the\n     *       spinner and the player works the same way with and without the plugin.\n     *\n     * @param {vjs.Player|Object} player\n     * @param {Object=} options\n     * @constructor\n     */\n    vjs.BlackPoster = vjs.Component.extend({\n        /** @constructor */\n        init: function(player, options) {\n            vjs.Component.call(this, player, options);\n\n            var posterImg = player.getChild('posterImage');\n\n            //We need to do it asynchronously to be sure that the black poster el is on the dom.\n            setTimeout(function() {\n                if (posterImg) {\n                    player.el().insertBefore(this.el(), posterImg.el());\n                }\n            }.bind(this), 0);\n        }\n    });\n\n    /**\n     * Create the black poster div element\n     * @return {Element}\n     */\n    vjs.BlackPoster.prototype.createEl = function() {\n        return vjs.createEl('div', {\n            className: 'vjs-black-poster'\n        });\n    };;\n\n    function VPAIDAdUnitWrapper(vpaidAdUnit, opts) {\n        if (!(this instanceof VPAIDAdUnitWrapper)) {\n            return new VPAIDAdUnitWrapper(vpaidAdUnit, opts);\n        }\n        sanityCheck(vpaidAdUnit, opts);\n\n        this.options = extend({}, opts);\n\n        this._adUnit = vpaidAdUnit;\n        this._adLoaded = false;\n        this._adStopped = false;\n        this._adStarted = false;\n        this._adSkipped = false;\n\n        /*** Local Functions ***/\n        function sanityCheck(adUnit, opts) {\n            if (!adUnit || !VPAIDAdUnitWrapper.checkVPAIDInterface(adUnit)) {\n                throw new VASTError('on VPAIDAdUnitWrapper, the passed VPAID adUnit does not fully implement the VPAID interface');\n            }\n\n            if (!isObject(opts)) {\n                throw new VASTError(\"on VPAIDAdUnitWrapper, expected options hash  but got '\" + opts + \"'\");\n            }\n\n            if (!(\"adCancelTimeout\" in opts) || !isNumber(opts.adCancelTimeout)) {\n                throw new VASTError(\"on VPAIDAdUnitWrapper, expected adCancelTimeout in options\");\n            }\n        }\n    }\n\n    VPAIDAdUnitWrapper.checkVPAIDInterface = function checkVPAIDInterface(VPAIDAdUnit) {\n        //NOTE: skipAd is not part of the method list because it only appears in VPAID 2.0 and we support VPAID 1.0\n        var VPAIDInterfaceMethods = [\n            'handshakeVersion', 'initAd', 'startAd', 'stopAd', 'resizeAd', 'pauseAd', 'expandAd', 'collapseAd'\n        ];\n\n        for (var i = 0, len = VPAIDInterfaceMethods.length; i < len; i++) {\n            if (!VPAIDAdUnit || !isFunction(VPAIDAdUnit[VPAIDInterfaceMethods[i]])) {\n                return false;\n            }\n        }\n\n\n        return canSubscribeToEvents(VPAIDAdUnit) && canUnsubscribeFromEvents(VPAIDAdUnit);\n\n        /*** Local Functions ***/\n\n        function canSubscribeToEvents(adUnit) {\n            return isFunction(adUnit.subscribe) || isFunction(adUnit.addEventListener) || isFunction(adUnit.on);\n        }\n\n        function canUnsubscribeFromEvents(adUnit) {\n            return isFunction(adUnit.unsubscribe) || isFunction(adUnit.removeEventListener) || isFunction(adUnit.off);\n\n        }\n    };\n\n    VPAIDAdUnitWrapper.prototype.adUnitAsyncCall = function() {\n        var args = arrayLikeObjToArray(arguments);\n        var method = args.shift();\n        var cb = args.pop();\n        var timeoutId;\n\n        sanityCheck(method, cb, this._adUnit);\n        args.push(wrapCallback());\n\n        this._adUnit[method].apply(this._adUnit, args);\n        timeoutId = setTimeout(function() {\n            timeoutId = null;\n            cb(new VASTError(\"on VPAIDAdUnitWrapper, timeout while waiting for a response on call '\" + method + \"'\"));\n            cb = noop;\n        }, this.options.adCancelTimeout);\n\n        /*** Local functions ***/\n        function sanityCheck(method, cb, adUnit) {\n            if (!isString(method) || !isFunction(adUnit[method])) {\n                throw new VASTError(\"on VPAIDAdUnitWrapper.adUnitAsyncCall, invalid method name\");\n            }\n\n            if (!isFunction(cb)) {\n                throw new VASTError(\"on VPAIDAdUnitWrapper.adUnitAsyncCall, missing callback\");\n            }\n        }\n\n        function wrapCallback() {\n            return function() {\n                if (timeoutId) {\n                    clearTimeout(timeoutId);\n                }\n                cb.apply(this, arguments);\n            };\n        }\n    };\n\n    VPAIDAdUnitWrapper.prototype.on = function(evtName, handler) {\n        var addEventListener = this._adUnit.addEventListener || this._adUnit.subscribe || this._adUnit.on;\n        addEventListener.call(this._adUnit, evtName, handler);\n    };\n\n    VPAIDAdUnitWrapper.prototype.off = function(evtName, handler) {\n        var removeEventListener = this._adUnit.removeEventListener || this._adUnit.unsubscribe || this._adUnit.off;\n        removeEventListener.call(this._adUnit, evtName, handler);\n    };\n\n    //minthe : waitForEvent\n    VPAIDAdUnitWrapper.prototype.waitForEvent = function(evtName, cb, context) {\n        var timeoutId;\n        sanityCheck(evtName, cb);\n        context = context || null;\n\n        this.on(evtName, responseListener);\n\n        timeoutId = setTimeout(function() {\n            cb(new VASTError(\"on VPAIDAdUnitWrapper.waitForEvent, timeout while waiting for event '\" + evtName + \"'\"));\n            timeoutId = null;\n            cb = noop;\n        }, this.options.adCancelTimeout);\n\n        /*** Local functions ***/\n        function sanityCheck(evtName, cb) {\n            if (!isString(evtName)) {\n                throw new VASTError(\"on VPAIDAdUnitWrapper.waitForEvent, missing evt name\");\n            }\n\n            if (!isFunction(cb)) {\n                throw new VASTError(\"on VPAIDAdUnitWrapper.waitForEvent, missing callback\");\n            }\n        }\n\n        var that = this;\n        function responseListener() {\n            var args = arrayLikeObjToArray(arguments);\n            if (timeoutId) {\n                clearTimeout(timeoutId);\n                timeoutId = null;\n            }\n            if (evtName === 'AdPlaying') {\n                // set paused flag to false only when we got AdPlaying event\n                that._adUnit._isPaused = false;\n            }\n\n            args.unshift(null);\n            cb.apply(context, args);\n        }\n    };\n\n    // VPAID METHODS\n    VPAIDAdUnitWrapper.prototype.handshakeVersion = function(version, cb) {\n        this.adUnitAsyncCall('handshakeVersion', version, cb);\n    };\n\n    /* jshint maxparams:6 */\n    VPAIDAdUnitWrapper.prototype.initAd = function(width, height, viewMode, desiredBitrate, adUnitData, environmentVars, cb) {\n        //minthe : AdLoaded\n        logger.info('Calling VPAID initAd, time remaining =' + profile.getRemainingTime('initAd'));\n        this.waitForEvent('AdLoaded', cb);\n\n        //minthe VID-1580\n        this._adUnit.initAd(width, height, viewMode, desiredBitrate, adUnitData, environmentVars);\n\n    };\n\n    VPAIDAdUnitWrapper.prototype.resizeAd = function(width, height, viewMode, cb) {\n        // NOTE: AdSizeChange event is only supported on VPAID 2.0 so for the moment we are not going to use it\n        // and will assume that everything is fine after the async call\n        this.adUnitAsyncCall('resizeAd', width, height, viewMode, cb);\n    };\n\n    VPAIDAdUnitWrapper.prototype.startAd = function(cb) {\n        logger.info('Calling VPAID startAd, time remaining =' + profile.getRemainingTime('startAd'));\n        this.waitForEvent('AdStarted', cb);\n        this._adUnit.startAd();\n    };\n\n    VPAIDAdUnitWrapper.prototype.stopAd = function(cb) {\n        logger.info(' Calling VPAID stopAd');\n        this.waitForEvent('AdStopped', cb);\n        this._adUnit.stopAd();\n    };\n\n    VPAIDAdUnitWrapper.prototype.pauseAd = function(cb) {\n        // ignore pauseAd if creative already pause\n        if (this._adStopped || !this._adStarted || this._adUnit._isPaused) return;\n        logger.log(' Calling VPAID pauseAd');\n        this._adUnit.pauseAd();\n        this._adUnit._isPaused = true;\n        timer.startKillTimeout(this._adUnit);\n    };\n\n    VPAIDAdUnitWrapper.prototype.resumeAd = function(cb) {\n        // ignore resumeAd if creative already playing\n        if (this._adStopped || !this._adStarted || this._adUnit._isPaused === false) return;\n        logger.log(' Calling VPAID resumeAd');\n        this._adUnit._resumedByPlayer = true;   // set flag about ad resumed by player\n        this.waitForEvent('AdPlaying', cb);\n        this._adUnit.resumeAd();\n        this._adUnit._isPaused = false;\n        timer.startKillTimeout(this._adUnit);\n    };\n\n    VPAIDAdUnitWrapper.prototype.expandAd = function(cb) {\n        if (this._adStopped) return;\n        this.waitForEvent('AdExpandedChange', cb);\n        this._adUnit.expandAd();\n    };\n\n    VPAIDAdUnitWrapper.prototype.collapseAd = function(cb) {\n        if (this._adStopped) return;\n        this.waitForEvent('AdExpandedChange', cb);\n        this._adUnit.collapseAd();\n    };\n\n    VPAIDAdUnitWrapper.prototype.skipAd = function(cb) {\n        var skipAnyway = function() {\n            if(!this._adSkipped){\n                logger.debug('VPAID Creative has ' + ((this._adStopped) ? 'already stopped' : 'not responded with AdSkipped') + ': Forcing AdSkipped');\n                this._adSkipped = true;\n                this.player.trigger('vpaid.AdSkipped');\n            }\n        }\n\n        if (this._adStopped) {\n            // VIDLA-990 VPAID Ads that have already stopped should be skipped anyway (to support collapsing ad unit when disableCollapse is on)\n            skipAnyway.apply(this);\n            return;\n        }\n        logger.log('Calling VPAID skipAd');\n        if (cb) {\n            this.waitForEvent('AdSkipped', cb);\n        }\n        this._adUnit.skipAd();\n        //VIDLA-442 VPAID Ads that don't respond to skipAd should be skipped anyway\n        setTimeout(function() {\n            skipAnyway.apply(this);\n        }.bind(this), 500);\n    };\n\n    //VPAID property getters\n    [\n        'adLinear',\n        'adWidth',\n        'adHeight',\n        'adExpanded',\n        'adSkippableState',\n        'adRemainingTime',\n        'adDuration',\n        'adVolume',\n        'adCompanions',\n        'adIcons'\n    ].forEach(function(property) {\n        var getterName = 'get' + capitalize(property);\n\n        VPAIDAdUnitWrapper.prototype[getterName] = function(cb) {\n            this.adUnitAsyncCall(getterName, cb);\n        };\n    });\n\n    //VPAID property setters\n    VPAIDAdUnitWrapper.prototype.setAdVolume = function(volume, cb) {\n        if (this._adStopped) return;\n        logger.debug('Calling VPAID setAdVolume :: volume :' + volume);\n        this.adUnitAsyncCall('setAdVolume', volume, cb);\n    };\n\n    ;\n\n    function VPAIDHTML5Tech(mediaFile) {\n\n        if (!(this instanceof VPAIDHTML5Tech)) {\n            return new VPAIDHTML5Tech(mediaFile);\n        }\n\n        sanityCheck(mediaFile);\n\n        this.name = 'vpaid-html5';\n        this.containerEl = null;\n        this.videoEl = null;\n        this.vpaidHTMLClient = null;\n\n        this.mediaFile = mediaFile;\n\n        function sanityCheck(mediaFile) {\n            if (!mediaFile || !isString(mediaFile.src)) {\n                throw new VASTError(VPAIDHTML5Tech.INVALID_MEDIA_FILE);\n            }\n        }\n    }\n\n    VPAIDHTML5Tech.supports = function(type) {\n        return !isOldIE() && type === 'application/javascript';\n    };\n\n    VPAIDHTML5Tech.prototype.loadAdUnit = function loadAdUnit(containerEl, videoEl, callback) {\n        sanityCheck(containerEl, videoEl, callback);\n\n        this.containerEl = containerEl;\n        this.videoEl = videoEl;\n        this.vpaidHTMLClient = new VPAIDHTML5Client(containerEl, videoEl, {});\n        this.vpaidHTMLClient.loadAdUnit(this.mediaFile.src, callback);\n\n\n\n        function sanityCheck(container, video, cb) {\n            if (!dom.isDomElement(container)) {\n                throw new VASTError(VPAIDHTML5Tech.INVALID_DOM_CONTAINER_EL);\n            }\n\n            if (!dom.isDomElement(video) || video.tagName.toLowerCase() !== 'video') {\n                throw new VASTError(VPAIDHTML5Tech.INVALID_DOM_CONTAINER_EL);\n            }\n\n            if (!isFunction(cb)) {\n                throw new VASTError(VPAIDHTML5Tech.MISSING_CALLBACK);\n            }\n        }\n    };\n\n    VPAIDHTML5Tech.prototype.unloadAdUnit = function unloadAdUnit() {\n        if (this.vpaidHTMLClient) {\n            try {\n                this.vpaidHTMLClient.destroy();\n            } catch (e) {\n                if (console && isFunction(console.log)) {\n                    console.log('VAST ERROR: trying to unload the VPAID adunit');\n                }\n            }\n\n            this.vpaidHTMLClient = null;\n        }\n\n        if (this.containerEl) {\n            dom.remove(this.containerEl);\n            this.containerEl = null;\n        }\n    };\n\n    var PREFIX = 'on VPAIDHTML5Tech';\n    VPAIDHTML5Tech.INVALID_MEDIA_FILE = PREFIX + ', invalid MediaFile';\n    VPAIDHTML5Tech.INVALID_DOM_CONTAINER_EL = PREFIX + ', invalid container HtmlElement';\n    VPAIDHTML5Tech.INVALID_DOM_VIDEO_EL = PREFIX + ', invalid HTMLVideoElement';\n    VPAIDHTML5Tech.MISSING_CALLBACK = PREFIX + ', missing valid callback';\n\n\n    ;\n\n    function VPAIDIntegrator(player, settings) {\n        if (!(this instanceof VPAIDIntegrator)) {\n            return new VPAIDIntegrator(player);\n        }\n\n        this.VIEW_MODE = {\n            NORMAL: 'normal',\n            FULLSCREEN: \"fullscreen\",\n            THUMBNAIL: \"thumbnail\"\n        };\n        this.player = player;\n        this.containerEl = createVPAIDContainerEl(player);\n        this.options = {\n            adCancelTimeout: 5000,\n            VPAID_VERSION: '2.0'\n        };\n        this.settings = settings;\n        this.volume = 1;\n        this.initVolume = 1;\n        if (this.settings.initialAudio === 'off') {\n            logger.log(\"Initial audio off\");\n            this.initVolume = 0;\n        } else if (this.settings.isXandrVastPlayer && this.settings.initVolume !== null) {\n            // using isXandrVastPlayer flag, because overlayPlayer flag always set to false for video SDK for JSVPAID initialization\n            // sync volume with content player\n            this.initVolume = this.settings.initVolume;\n        }\n        this.initAdUnitCalled = false;\n        this.initialisedAdUnit = null;\n        this.initAdTimeout = false;\n        /*** Local functions ***/\n\n        function createVPAIDContainerEl() {\n            var containerEl = document.createElement('div');\n            dom.addClass(containerEl, 'VPAID-container');\n            var smokeElem = document.getElementsByClassName('vjs-smoke-layer');\n            if (smokeElem && smokeElem.length > 0) {\n                player.el().insertBefore(containerEl,smokeElem[0]);\n            } else {\n                player.el().insertBefore(containerEl, player.controlBar.el());\n            }\n            return containerEl;\n\n        }\n        this.EVENTS = [\n            'AdLoaded', 'AdStarted', 'AdStopped', 'AdSkipped', 'AdSkippableStateChange',\n            'AdSizeChange', 'AdLinearChange', 'AdDurationChange', 'AdExpandedChange',\n            'AdRemainingTimeChange', 'AdVolumeChange', 'AdImpression', 'AdVideoStart',\n            'AdVideoFirstQuartile', 'AdVideoMidpoint', 'AdVideoThirdQuartile',\n            'AdVideoComplete', 'AdClickThru', 'AdInteraction', 'AdUserAcceptInvitation',\n            'AdUserMinimize', 'AdUserClose', 'AdPaused', 'AdPlaying', 'AdLog', 'AdError'\n        ];\n    }\n\n    //List of supported VPAID technologies\n    VPAIDIntegrator.techs = [\n        VPAIDHTML5Tech\n    ];\n\n    //minthe : protoype.playAd\n    VPAIDIntegrator.prototype.playAd = function playVPaidAd(vastResponse, callback, isTestPlay) {\n        //flag to sperate logic for checking vpaid ad is valid\n        isTestPlay = (isTestPlay && isTestPlay !== undefined ? isTestPlay : false);\n\n        var that = this;\n        var tech;\n        var player = this.player;\n\n        callback = callback || noop;\n        if (!(vastResponse instanceof VASTResponse)) {\n            return callback(new VASTError('on VASTIntegrator.playAd, missing required VASTResponse'));\n        }\n\n        tech = this._findSupportedTech(vastResponse, this.settings);\n        dom.addClass(player.el(), 'vjs-vpaid-ad');\n\n        player.on('vast.adsCancel', triggerVpaidAdEnd);\n        player.one('vpaid.adEnd', function() {\n            player.off('vast.adsCancel', triggerVpaidAdEnd);\n            removeAdUnit();\n        });\n\n        if (tech) {\n\n            //if it's test-play this routine will invoke initAd and return result to notify the creative is ready to go\n            if (isTestPlay) {\n                async.waterfall([\n                    function(next) {\n                        next(null, tech, vastResponse);\n                    },\n                    this._loadAdUnit.bind(this),\n                    this._initAdUnit.bind(this)\n                ], function(error, adUnit, vastResponse) {\n                    if (error) {\n                        that._trackError(vastResponse);\n                    } else {\n                        player.trigger('an.readytogovpaid');\n                    }\n                    callback(error, vastResponse);\n                });\n            } else {\n                var errorCallback = function(error, adUnit, vastResponse) {\n                    if (error) {\n                        that._trackError(vastResponse);\n                    }\n                    player.trigger('vpaid.adEnd');\n                    callback(error, vastResponse);\n                };\n                var taskList = [\n                    function(next) {\n                        next(null, that.initialisedAdUnit, vastResponse, true);\n                    },\n                    this._playAdUnit.bind(this)\n                ];\n                if (this.initialisedAdUnit) {\n                    async.waterfall(taskList, errorCallback);\n                } else {\n                    if (this.initAdUnitCalled) {\n                        player.one(\"an.readytogovpaid\", function() {\n                            async.waterfall(taskList, errorCallback);\n                        });\n                    } else {\n                        async.waterfall([\n                            function(next) {\n                                next(null, tech, vastResponse);\n                            },\n                            this._loadAdUnit.bind(this),\n                            this._initAdUnit.bind(this),\n                            this._playAdUnit.bind(this)\n                        ], errorCallback);\n                    }\n                }\n            }\n\n            this._adUnit = {\n                _paused: true,\n                _completed: false,\n                type: 'VPAID',\n                pauseAd: function() {\n                    player.trigger('vpaid.pauseAd');\n                    // We don't need VIDLA-1327-1329 fix for XandrVastPlayer.\n                    // Xandr Vast Player is not going to immediately pause the player here as \n                    // this is contrary to the IAB Spec and also causes problem in the VPAID \n                    // creatives - see VSSPP-2975\n                    // IAB spec says: \"If the video player does not receive the AdPaused event \n                    // after a pauseAd() call, then either the ad unit cannot be paused or it\n                    // failed to send the AdPaused event. In either case, the video player should\n                    // treat the lack of response as a failed attempt to pause the ad.\"\n                    if (!player.options_.isXandrVastPlayer) {\n                        // VIDLA-1327-1329 Reverting back the pause which caused the regression.\n                        player.pause(true);\n                    }\n                },\n                resumeAd: function() {\n                    player.trigger('vpaid.resumeAd');\n                },\n                isPaused: function() {\n                    return that.player.paused(true);\n                },\n                getSrc: function() {\n                    return tech.mediaFile;\n                }\n            };\n\n            return this._adUnit;\n        }\n\n        callback(new VASTError('on VPAIDIntegrator.playAd, could not find a supported mediaFile'));\n\n        return null;\n        /*** Local functions ***/\n        function triggerVpaidAdEnd() {\n            player.trigger('vpaid.adEnd');\n        }\n\n        function removeAdUnit() {\n            if (tech) {\n                tech.unloadAdUnit();\n            }\n            dom.removeClass(player.el(), 'vjs-vpaid-ad');\n        }\n    };\n\n    VPAIDIntegrator.prototype._findSupportedTech = function(vastResponse, settings) {\n        if (!(vastResponse instanceof VASTResponse)) {\n            return null;\n        }\n\n        var vpaidMediaFiles = vastResponse.mediaFiles.filter(vastUtil.isVPAID);\n        var i, len, mediaFile, VPAIDTech;\n\n        for (i = 0, len = vpaidMediaFiles.length; i < len; i += 1) {\n            mediaFile = vpaidMediaFiles[i];\n            VPAIDTech = findSupportedTech(mediaFile);\n            if (VPAIDTech) {\n                return new VPAIDTech(mediaFile, settings);\n            }\n        }\n\n        return null;\n\n        /*** Local functions ***/\n        function findSupportedTech(mediafile) {\n            var type = mediafile.type;\n            var i, len, VPAIDTech;\n\n            for (i = 0, len = VPAIDIntegrator.techs.length; i < len; i += 1) {\n                VPAIDTech = VPAIDIntegrator.techs[i];\n                if (VPAIDTech.supports(type)) {\n                    return VPAIDTech;\n                }\n            }\n            return null;\n        }\n    };\n\n    //minthe : loadAdUnit\n    VPAIDIntegrator.prototype._loadAdUnit = function(tech, vastResponse, next) {\n        if (this.initAdUnitCalled) {\n            return;\n        }\n        var player = this.player;\n        var vjsTechEl = player.el().querySelector('.vjs-tech');\n        var adCancelTimeout = this.settings.adCancelTimeout || this.options.adCancelTimeout;\n        var overlayPlayer = this.settings.overlayPlayer;\n        var initialPlayback = this.settings.initialPlayback;\n        var controlBarPosition = this.settings.controlBarPosition;\n        var isXandrVastPlayer = this.settings.isXandrVastPlayer;\n        tech.loadAdUnit(this.containerEl, vjsTechEl, function(error, adUnit) {\n            if (error) {\n                return next(error, adUnit, vastResponse);\n            }\n\n            try {\n                var WrappedAdUnit = new VPAIDAdUnitWrapper(adUnit, { src: tech.mediaFile.src, adCancelTimeout: adCancelTimeout, overlayPlayer: overlayPlayer, initialPlayback: initialPlayback, controlBarPosition: controlBarPosition, isXandrVastPlayer: isXandrVastPlayer });\n                WrappedAdUnit.player = player;\n                var techClass = 'vjs-' + tech.name + '-ad';\n                dom.addClass(player.el(), techClass);\n                player.one('vpaid.adEnd', function() {\n                    dom.removeClass(player.el(), techClass);\n                });\n                //Entry point for player's skip button which trigger 'skip' event;\n                player.on('skip', function() {\n                    WrappedAdUnit.skipAd();\n                });\n                //Entry point for 'stop' event\n                player.on('stop', function() {\n                    if (!WrappedAdUnit._adStopped) {\n                        WrappedAdUnit.stopAd(function(error) {\n                            if (error) {\n                                // stop anyway\n                                WrappedAdUnit._adStopped = true;\n                                player.trigger('vpaid.AdStopped'); \n                            }           \n                        });\n                    }\n                });\n                player.on('vpaid.AdPaused', function() {\n                    // if vpaid creative is paused internally by clicking on vpaid video,\n                    // set 'paused' flag to 'true' in ad unit wrapper instance\n                    if (WrappedAdUnit._adUnit) {\n                        WrappedAdUnit._adUnit._isPaused = true;\n                    }\n                });\n                next(null, WrappedAdUnit, vastResponse);\n            } catch (e) {\n                next(e, adUnit, vastResponse);\n            }\n        });\n    };\n\n\n    //minthe : _testAdUnit\n    VPAIDIntegrator.prototype._initAdUnit = function(adUnit, vastResponse, callback) {\n        if (this.initAdUnitCalled) {\n            return;\n        }\n        this.initAdUnitCalled = true;\n        async.waterfall([\n            function(next) {\n                next(null, adUnit, vastResponse);\n            },\n            this._handshake.bind(this),\n            this._setupEvents.bind(this),\n            this._initAd.bind(this)\n        ], callback);\n    };\n\n    //minthe : _playAdUnit\n    VPAIDIntegrator.prototype._playAdUnit = function(adUnit, vastResponse, callback) {\n        async.waterfall([\n            function(next) {\n                next(null, adUnit, vastResponse);\n            },\n            this._linkPlayerControls.bind(this),\n            this._startAd.bind(this)\n        ], callback);\n    };\n\n    VPAIDIntegrator.prototype._handshake = function handshake(adUnit, vastResponse, next) {\n        adUnit.handshakeVersion(this.options.VPAID_VERSION, function(error, version) {\n            if (error) {\n                return next(error, adUnit, vastResponse);\n            }\n\n            if (version && isSupportedVersion(version)) {\n                return next(null, adUnit, vastResponse);\n            }\n\n            return next(new VASTError('on VPAIDIntegrator._handshake, unsupported version \"' + version + '\"'), adUnit, vastResponse);\n        });\n\n        function isSupportedVersion(version) {\n            var majorNum = major(version);\n            return majorNum >= 1 && majorNum <= 2;\n        }\n\n        function major(version) {\n            var parts = version.split('.');\n            return parseInt(parts[0], 10);\n        }\n    };\n\n    //minthe : _initAd\n    VPAIDIntegrator.prototype._initAd = function(adUnit, vastResponse, next) {\n        var self = this;\n        var tech = this.player.el().querySelector('.vjs-tech');\n        var dimension = dom.getDimension(tech);\n        // Reset the timeout flag\n        self.initAdTimeout = false;\n\n        timer.startInitAdTimeout(function(error) {\n            self.initAdTimeout = true;\n            self._reportTimeout(adUnit, error);\n        });\n        /*\n        adUnit.initAd(dimension.width, dimension.height, this.VIEW_MODE.NORMAL, -1, {AdParameters: vastResponse.adParameters || ''}, function (error) {\n            self.initialisedAdUnit = adUnit;\n            next(error, adUnit, vastResponse);\n        });\n        */\n\n        adUnit.initAd(dimension.width, dimension.height, this.VIEW_MODE.NORMAL, -1, { AdParameters: vastResponse.adParameters || '' }, self.settings.vpaidEnvironmentVars, function(error) {\n            self.initialisedAdUnit = adUnit;\n            next(error, adUnit, vastResponse);\n        });\n    };\n\n    VPAIDIntegrator.prototype._setupEvents = function(adUnit, vastResponse, next) {\n        var adUnitSrc = adUnit.options.src;\n        var tracker = new VASTTracker(adUnitSrc, vastResponse);\n        var player = this.player;\n        var that = this;\n\n        function setupEventCallbacks() {\n            var cb = that.settings.vpaidEventCallback;\n            if (!cb) return;\n            that.EVENTS.forEach(function(event) {\n                adUnit.on(event, function(data) {\n                    cb.call(this, event, data);\n                });\n            });\n        };\n\n        setupEventCallbacks();\n\n        adUnit.on('AdLoaded', function() {\n            adUnit._adLoaded = true;\n            timer.stopInitAdTimeout();\n            logger.info('VPAID event received :: AdLoaded, time = ' + profile.getInitTime() + ', time remaining = ' + profile.getRemainingTime('AdLoaded'));\n        });\n\n        //minthe2 AdStarted Handler\n        //fix for VID-1525\n        adUnit.on('AdStarted', function() {\n\n            adUnit._adStarted = true;\n            profile.adStartedTimestamp = new Date().getTime();\n\n            if (that.settings.delayExpandUntilVPAIDImpression) {\n                if (profile.adImpressionTimestamp !== 0 && profile.adStartedTimestamp !== 0) {\n                    timer.stopStartAdTimeout();\n                }\n            } else {\n                timer.stopStartAdTimeout();\n            }\n\n            // if (profile.adImpressionTimestamp !== 0) {//if AdImpression is deliverd without AdStarted\n            //     profile.adLoadedTimestamp = profile.adImpressionTimestamp;\n            // }\n\n\n            if (!adUnit._adLoaded) {\n                var remainingTime = profile.timeout - (profile.adStartedTimestamp - profile.initAdTimestamp);\n                logger.info('VPAID event received :: AdStarted, time = ' + 0 + ', time remaining = ' + remainingTime + ', Out of order AdStarted');\n            } else {\n                if (that.settings.delayExpandUntilVPAIDImpression && profile.adImpressionTimestamp === 0) {\n                    logger.info('VPAID event received :: AdStarted');\n                } else {\n                    logger.info('VPAID event received :: AdStarted, time = ' + profile.getStartTime() + ', total time = ' + profile.getTotalTime() + ', time remaining = ' + profile.getRemainingTime('AdStarted'));\n                }\n            }\n            if (that.settings.isXandrVastPlayer) {\n                // VSSPP_3055 - immediately set volume on player when ad has started\n                player.volume(that.initVolume);\n            }\n            player.trigger('vpaid.AdStarted');\n            tracker.trackCreativeView();\n            notifyPlayToPlayer();\n\n\n            //activate impression timer if it's not already started\n            if (that.settings.delayExpandUntilVPAIDImpression && profile.adImpressionTimestamp === 0) {\n                profile.adImpressionTimestamp = new Date().getTime();\n                // timer.startAdImpressionTimeout(function (error) {\n                //     that._reportTimeout(adUnit, error);\n                // });\n            }\n            if (isAndroid()) {\n                ChiveFacebookHack();\n            }\n        });\n\n        // For creatives that do not use the video tag provided by the player.\n        function handleAdPlayPause() {\n            // Ad creatives do not creative their own video tags on devices so no need to handle AdProgess timer\n            // TODO : find  more reliable way to figure out the video src set.\n            if (isIDevice() || isAndroid()) {\n                // VIDLA-421 (do not ignore pause/resume event handlers for overlay player)\n                if (!adUnit.options.overlayPlayer) {\n                    return;\n                }\n            }\n\n            // Ad uses video JS Slot\n            if (isVideoSlotUsed()) {\n                return;\n            }\n            var creative = adUnit._adUnit ? adUnit._adUnit._creative : null;\n\n            if (adUnit.options.overlayPlayer) {\n                // since no monkeypatch api is activated.\n                player.on('pause', function() {\n                    if (adUnit._adUnit && creative) {\n                        that._adUnit.pauseAd();\n                    }\n                });\n                player.on('play', function() {\n                    if (adUnit._adUnit && creative) {\n                        that._adUnit.resumeAd();\n                    }\n                });\n            }\n\n            //IE11 has an issue to not listen this pause event - VID-2405, VID-2406\n            //video.js has their own event pooling sytem for video element and parent div of video element, the \"pause event\" area is so crowded for now - when vpaid player injects \"pause\" listener to player object on IE11, the video.js doesn't handle as well. looks like incorrect GUID setting problem in order to get events unique\n            //for handling this vpaid-creative.pause by \"pause\" signal from video.js we don't have to stick with the crowded \"pause\" signal. we can do samething with differnet signal for this\n            // player.on('pause', function(){\n            //     if(creative){\n            //         that._adUnit.pauseAd();\n            //     }\n            // });\n            player.on('apn-vpaid-pause', function() { //this \"apn-vpaid-pause\" will be dispatch from video.js pause.\n                if (creative) {\n                    // that._adUnit.pauseAd();//no need to dispatch pause again to video.js because video.js already dispatch pause before triggered \"apn-vpaid-pause\". this will also cover a case showing pause button on the UI\n                    player.trigger('vpaid.pauseAd'); //vpaid video pause\n                }\n            });\n        };\n\n        // For creatives that do not use the video tag provided by the player.\n        function handleAdProgress() {\n\n            // VSSPP-2986 (do not ignore progress for Xandr Vast player)\n            if (!adUnit.options.isXandrVastPlayer) {\n                // Ad creatives do not creative their own video tags on devices so no need to handle AdProgess timer\n                // TODO : find  more reliable way to figure out the video src set.\n                //if(isIDevice() || isAndroid()){\n                if (isIDevice()) { //for VID-2597\n                    return;\n                }\n            }\n\n            // Ad uses video JS Slot\n            if (isVideoSlotUsed()) {\n                return;\n            }\n\n            // Ad is using its own Video slot.\n            var creative = adUnit._adUnit._creative;\n            var remainingTimeUnknown = false;\n\n            var lastTime = -1;\n            function updateProgress() {\n                var duration = creative.getAdDuration ? creative.getAdDuration() : 0;\n                var remainingTime = creative.getAdRemainingTime ? creative.getAdRemainingTime() : -1;\n                remainingTime = isNumber(remainingTime) ? remainingTime : -1;\n                remainingTime = (remainingTime > duration) ? duration : remainingTime;//fix VIDLA-429\n                var currentTime = duration - remainingTime;\n\n                switch (remainingTime) {\n                    case -2:\n                        // If time is not currently known\n                        remainingTimeUnknown = true;\n                        player.controlBar.currentTimeDisplay.hide();\n                        player.controlBar.timeDivider.hide();\n                        player.controlBar.durationDisplay.hide();\n                        break;\n                    case -1:\n                        // If time is not implemeneted\n                        clearInterval(progressHandler);\n                        player.controlBar.currentTimeDisplay.hide();\n                        player.controlBar.timeDivider.hide();\n                        player.controlBar.durationDisplay.hide();\n                        break;\n                    case 0:\n                        if (lastTime > 0 && lastTime < duration) {\n                            player.currentTime(currentTime);\n                            player.trigger('timeupdate');\n                            player.controlBar.currentTimeDisplay.updateContent();\n                            player.duration(duration);\n                            player.controlBar.durationDisplay.updateContent();\n                            lastTime = currentTime;\n                            if (that._adUnit._completed) {\n                                player.pause();\n                            }\n                        }\n                        clearInterval(progressHandler);\n                        break;\n                    default:\n                        if (remainingTimeUnknown) {\n                            remainingTimeUnknown = false;\n                            player.controlBar.currentTimeDisplay.show();\n                            player.controlBar.timeDivider.show();\n                            player.controlBar.durationDisplay.show();\n                        }\n                        // because time in control bar is second base, we don't have to update it very often\n                        if (currentTime - lastTime >= 0.2) {\n                            // Fix for VSSPP-2189 (Freezing or choppy playing Celtra VPAID creatives). \n                            // Commented the setting new player time for VPAID, because it forces vjs to seeking\n                            // for the new video position on video slot. The seeking moves video position to the\n                            // closer key-frame, which generates very choppy experience. Also, moving to the new \n                            // video position forces some VPAID creatives (for example: celtra VPAID creative)\n                            // to do its own work and to fire unneeded VPAID events.\n                            // player.currentTime(currentTime);\n\n                            // To make sure, the countdown timer, progress bar, and skippability controls are\n                            // working properly for creatives are not using ad player video tag, we have to\n                            // update time and every time trigger 'timeupdate' event for our ad player.\n                            var intPlayerTime = player.currentTime();\n                            if (currentTime > intPlayerTime) {\n                                player.currentTime(currentTime);\n                                player.trigger('timeupdate');\n                                player.controlBar.currentTimeDisplay.updateContent();\n                            }\n\n                            player.duration(duration);\n                            player.controlBar.durationDisplay.updateContent();\n                            lastTime = currentTime;\n                        }\n                        break;\n                }\n            }\n            var progressHandler = setInterval(updateProgress, 200);\n            updateProgress();\n        }\n\n        adUnit.on('AdSkipped', function() {\n            logger.log('VPAID event received :: AdSkipped');\n            if(!adUnit._adSkipped) {\n                adUnit._adSkipped = true;\n                player.trigger('vpaid.AdSkipped');\n                tracker.trackSkip();\n            }\n        });\n\n\n        //minthe2 AdImpression Handler\n        adUnit.on('AdImpression', function() {\n\n            profile.adImpressionTimestamp = new Date().getTime();\n\n\n            if (that.settings.delayExpandUntilVPAIDImpression) {\n                if (profile.adImpressionTimestamp !== 0 && profile.adStartedTimestamp !== 0) {\n                    timer.stopStartAdTimeout();\n                }\n            }\n\n            // if (profile.adImpressionTimestamp !== 0) {//if AdImpression is deliverd without AdStarted\n            //     profile.adLoadedTimestamp = profile.adImpressionTimestamp;\n            // }\n            // if (profile.adStartedTimestamp === 0) {//if AdImpression is deliverd without AdStarted\n            //     profile.adStartedTimestamp = profile.adLoadedTimestamp;\n            // }\n\n            if (that.settings.delayExpandUntilVPAIDImpression && profile.adStartedTimestamp === 0) {\n                logger.info('VPAID event received :: AdImpression');\n            } else {\n                logger.info('VPAID event received :: AdImpression, time = ' + profile.getAdImpressionTime() + ', total time = ' + profile.getTotalTime() + ', time remaining = ' + profile.getRemainingTime('AdImpression'));\n            }\n\n\n            player.trigger('vpaid.AdImpression');\n            tracker.trackImpressions();\n            if(adUnit._adUnit && adUnit._adUnit._creative){\n                var creative = adUnit._adUnit._creative;\n                var creativeIcons = false;\n                if(creative.getAdIcons){\n                    creativeIcons = creative.getAdIcons();\n                }\n                player.trigger({type: 'vpaid.AdIcons', adIcons: creativeIcons});\n            }\n        });\n\n        adUnit.on('AdVideoStart', function() {\n            logger.info('VPAID event received :: AdVideoStart');\n\n            // VIDLA-441 This is definitely when the Ad video has started and all the metadata is ready. AdStarted event may be too early\n            handleAdPlayPause();\n            handleAdProgress();\n\n            player.trigger('vpaid.AdVideoStart');\n            tracker.trackStart();\n            notifyPlayToPlayer();\n            if (that.settings.initialAudio === 'off') {\n                player.muted(true);\n            } else {\n                player.muted(false);\n            }\n            linkVolumeControl();\n\n\n            var controlBarPosition = adUnit.options.controlBarPosition ? adUnit.options.controlBarPosition : \"over\";\n            if (controlBarPosition === \"over\") {\n                var handleUserActive = function() {\n                    logger.debug(\"caught useractive\");\n                    resizeAd(player, adUnit, that.VIEW_MODE, true);\n                    logger.debug(\"did resizeAd\");\n                };\n                var handleUserInActive = function() {\n                    logger.debug(\"caught userinactive\");\n                    if (player.hasClass(\"vjs-paused\") === false || player.paused() === false || that._adUnit._completed === true) {//fix unnecessary resize after pause which can cause bad user experience with transparent controlbar color\n                        resizeAd(player, adUnit, that.VIEW_MODE, true);\n                        logger.debug(\"did resizeAd\");\n                    }\n                };\n                var handleManualUserActive = function() {\n                    logger.debug(\"caught handleManualUserActive\");\n                    setTimeout(function() {\n                        resizeAd(player, adUnit, that.VIEW_MODE, true, \"useractive\");\n                        logger.debug(\"did resizeAd\");\n                    },0);\n                };\n                var handleManualUserInActive = function(e) {\n                    logger.debug(\"caught handleManualUserInActive\");\n                    setTimeout(function() {\n                        resizeAd(player, adUnit, that.VIEW_MODE, true, \"userinactive\");\n                        logger.debug(\"did resizeAd\");\n                    },0);\n                };\n\n                //handle VPAID resize by useractive event from video.js\n                player.on(\"useractive\", handleUserActive);\n\n                //handle VPAID resize by userinactive event from video.js\n                player.on(\"userinactive\", handleUserInActive);\n\n                //handle VPAID resize by useractive event from video.js\n                player.on(\"handleManualUserActive\", handleManualUserActive);\n\n                //handle VPAID resize by userinactive event from video.js\n                player.on(\"handleManualUserInActive\", handleManualUserInActive);\n\n            }\n\n            //VIDLA-2143\n            //to figure out specific creative issue which has 1px of height after AdVideoStart\n            //details here: https://stash.corp.appnexus.com/projects/VIDEO/repos/resources_video-ad-video-player-html5-plugin-vpaid/pull-requests/14/overview\n            resizeAd(player, adUnit, that.VIEW_MODE, true);\n\n            if (isIDevice()) {\n                ChiveFacebookHack();\n            }\n        });\n\n        // VID-3052 This is a temporary hack for FB creative autoplay on chive pages. Please see ticket for details.\n        function ChiveFacebookHack() {\n            var videoSlot = adUnit._adUnit._videoEl;\n            if (adUnit.options.overlayPlayer && adUnit.options.initialPlayback === 'auto' && videoSlot.paused) {\n                setTimeout(function() {\n                    // Overlay Chive hack for Facebook Creative\n                    logger.log('Applying Facebook Chive Hack');\n                    player.muted(true);\n                    that._adUnit.resumeAd();\n                }, 1000);\n            }\n        };\n\n        adUnit.on('AdPlaying', function() {\n            logger.log('VPAID event received :: AdPlaying');\n            timer.stopKillTimeout();\n            player.trigger('vpaid.AdPlaying');\n            tracker.trackResume();\n            notifyPlayToPlayer();\n            if (!adUnit._adUnit._resumedByPlayer) {\n                // notify player if ad resumed by vpaid creative (not by player)\n                player.trigger('adResumedByVpaidCreative');\n                adUnit._adUnit._isPaused = false;\n            }\n            delete adUnit._adUnit._resumedByPlayer;\n            player.trigger(\"handleManualUserInActive\");\n        });\n\n        adUnit.on('AdPaused', function() {\n            logger.log('VPAID event received :: AdPaused');\n            timer.stopKillTimeout();\n            player.trigger('vpaid.AdPaused');\n            tracker.trackPause();\n            notifyPauseToPlayer();\n            player.trigger(\"handleManualUserActive\");\n        });\n\n        function notifyPlayToPlayer() {\n            if (that._adUnit && that._adUnit.isPaused()) {\n                that._adUnit._paused = false;\n            }\n            player.trigger('play');\n\n        }\n\n        function notifyPauseToPlayer() {\n            if (that._adUnit) {\n                that._adUnit._paused = true;\n            }\n            player.trigger('pause');\n        }\n\n        adUnit.on('AdVideoFirstQuartile', function() {\n            logger.info('VPAID event received :: AdVideoFirstQuartile');\n            player.trigger('vpaid.AdVideoFirstQuartile');\n            tracker.trackFirstQuartile();\n        });\n\n        adUnit.on('AdVideoMidpoint', function() {\n            logger.info('VPAID event received :: AdVideoMidpoint');\n            player.trigger('vpaid.AdVideoMidpoint');\n            tracker.trackMidpoint();\n        });\n\n        adUnit.on('AdVideoThirdQuartile', function() {\n            logger.info('VPAID event received :: AdVideoThirdQuartile');\n            player.trigger('vpaid.AdVideoThirdQuartile');\n            tracker.trackThirdQuartile();\n        });\n\n        adUnit.on('AdVideoComplete', function() {\n            logger.info('VPAID event received :: AdVideoComplete');\n            player.trigger('vpaid.AdVideoComplete');\n            tracker.trackComplete();\n            that._adUnit._completed = true;\n        });\n\n        adUnit.on('AdClickThru', function(data) {\n            player.trigger('vpaid.AdClickThru');\n        });\n\n        adUnit.on('AdUserAcceptInvitation', function() {\n            player.trigger('vpaid.AdUserAcceptInvitation');\n            tracker.trackAcceptInvitation();\n            tracker.trackAcceptInvitationLinear();\n        });\n\n        adUnit.on('AdUserClose', function() {\n            player.trigger('vpaid.AdUserClose');\n            tracker.trackClose();\n            tracker.trackCloseLinear();\n        });\n\n        adUnit.on('AdUserMinimize', function() {\n            player.trigger('vpaid.AdUserMinimize');\n            tracker.trackCollapse();\n        });\n\n        adUnit.on('AdError', function(message) {\n            timer.stopAdTimeouts();\n            logger.error('VPAID event received :: AdError : message : ' + message);\n            //player.trigger('vast.adError');//TODO jeff's change for VID-583\n            if (message) {\n                player.trigger({type: 'vpaid.AdError', message: message});\n            } else {\n                player.trigger('vpaid.AdError');\n            }\n            //NOTE: we track errors code 901, as noted in VAST 3.0\n            tracker.trackErrorWithCode(901);\n        });\n\n        adUnit.on('AdVolumeChange', function() {\n            logger.debug('VPAID event received :: AdVolumeChange');\n            player.trigger('vpaid.AdVolumeChange');\n        });\n\n        adUnit.on('AdStopped', function() {\n            logger.info('VPAID event received :: AdStopped');\n            adUnit._adStopped = true;\n            player.trigger('vpaid.AdStopped');\n        });\n\n        var updateViewSize = resizeAd.bind(this, player, adUnit, this.VIEW_MODE);\n        var autoResize = this.settings.autoResize;\n\n        if (autoResize) {\n            dom.addEventListener(window, 'resize', updateViewSize);\n            dom.addEventListener(window, 'orientationchange', updateViewSize);\n        }\n\n        player.on('vast.resize', updateViewSize);\n        player.on('vpaid.pauseAd', pauseAdUnit);\n        player.on('vpaid.resumeAd', resumeAdUnit);\n\n        player.one('vpaid.adEnd', function() {\n            player.off('vast.resize', updateViewSize);\n            player.off('vpaid.pauseAd', pauseAdUnit);\n            player.off('vpaid.resumeAd', resumeAdUnit);\n\n            if (autoResize) {\n                dom.removeEventListener(window, 'resize', updateViewSize);\n                dom.removeEventListener(window, 'orientationchange', updateViewSize);\n            }\n        });\n\n        next(null, adUnit, vastResponse);\n\n        /*** Local Functions ***/\n        function pauseAdUnit() {\n            adUnit.pauseAd(noop);\n        }\n\n        function resumeAdUnit() {\n            adUnit.resumeAd(noop);\n        }\n\n        function isVideoSlotUsed() {\n            var videoSlot = adUnit._adUnit._videoEl;\n            var creative = adUnit._adUnit._creative;\n            var hasSource = videoSlot && videoSlot.src;\n\n            if (videoSlot && !hasSource) {\n                var sources = videoSlot.getElementsByTagName('source');\n                for (var i = 0; i < sources; i++) {\n                    if (sources[i].src) {\n                        hasSource = true;\n                    }\n                }\n            }\n\n            // Ad uses video JS Slot\n            if (!creative || !videoSlot || hasSource) {\n                return true;\n            }\n\n            return false;\n        }\n\n        function linkVolumeControl() {\n            // Ad uses video JS slot. Volume be controlled via Player Framework\n            if (isVideoSlotUsed()) {\n                return;\n            }\n            // for creatives that create own tag set initial volume appropriately\n            adUnit.setAdVolume(that.initVolume, function(error, result) {\n                if (error) {\n                    logger.log('The volume change is not implemented as part of the ad unit');\n                } else {\n                    logger.debug('The volume change is implemented as part of the ad unit');\n                }\n            });\n            // Ad is using its own Video slot. Volume be controlled by setAdVolume\n            player.on('volumechange', updateAdUnitVolume);\n\n            player.one('vpaid.adEnd', function() {\n                player.off('volumechange', updateAdUnitVolume);\n            });\n\n            /*** local functions ***/\n            function updateAdUnitVolume() {\n                var vol;\n                if (player.muted()) {\n                    vol = 0;\n                } else {\n                    that.volume = player.volume() ? player.volume() : that.volume;\n                    vol = that.volume;\n                }\n                adUnit.setAdVolume(vol, logError);\n            }\n        }\n    };\n\n    VPAIDIntegrator.prototype._linkPlayerControls = function(adUnit, vastResponse, next) {\n        var that = this;\n        linkFullScreenControl(this.player, adUnit, this.VIEW_MODE);\n\n        next(null, adUnit, vastResponse);\n\n        /*** Local functions ***/\n\n        function linkFullScreenControl(player, adUnit, VIEW_MODE) {\n            var updateViewSize = resizeAd.bind(this, player, adUnit, VIEW_MODE);\n\n            player.on('fullscreenchange', updateViewSize);\n\n            player.on('fullscreenchange', function() {\n                if (player.paused() || player.hasClass(\"vjs-paused\")) {\n                    player.trigger(\"handleManualUserActive\");\n                }\n            });\n\n            player.one('vpaid.adEnd', function() {\n                player.off('fullscreenchange', updateViewSize);\n            });\n        }\n    };\n\n    //minthe : _startAd\n    VPAIDIntegrator.prototype._startAd = function(adUnit, vastResponse, next) {\n        var self = this;\n        var player = this.player;\n\n        if (self.initAdTimeout) {\n            return;\n        }\n        // VIDLA-245 IAS hack: If AdStarted is received before calling startAd then do not cap it with a timer.\n        if (!adUnit._adStarted) {\n            timer.startStartAdTimeout(function(error) {\n                self._reportTimeout(adUnit, error);\n            });\n        } else {\n            //Just set the timestamp correctly for VIDLA-245\n            profile.startAdTimestamp = new Date().getTime();\n        }\n        adUnit.startAd(function(error) {\n            if (!error) {\n                player.trigger('vast.adStart');\n            }\n        });\n    };\n\n\n    VPAIDIntegrator.prototype._trackError = function trackError(response) {\n        vastUtil.track(response.errorURLMacros, { ERRORCODE: 901 });\n    };\n\n    VPAIDIntegrator.prototype._reportTimeout = function(adUnit, error) {\n        var player = this.player;\n        player.trigger({ type: 'vast.adTimeout', error: error });\n        try {\n            if (adUnit && adUnit._adUnit) {\n                logger.log(\"Calling VPAID stopAd on TIMEOUT\");\n                adUnit._adUnit.stopAd();\n            }\n        } catch (e) {\n            logger.log('VPAID error in calling stopAd on Timeout');\n        }\n    };\n\n    var lastSize = {\n        width: 0,\n        height: 0\n    };\n    function resizeAd(player, adUnit, VIEW_MODE, isAdVideoStart, manualUserActive) {\n\n        var tech = player.el().querySelector('.vjs-tech');\n        var dimension = dom.getDimension(tech);\n        var width = dimension.width;\n        var height = dimension.height;\n        var MODE = player.isFullscreen() ? VIEW_MODE.FULLSCREEN : VIEW_MODE.NORMAL;\n\n        var slot = adUnit._adUnit._el;\n        var videoSlot = adUnit._adUnit._videoEl;\n        var controlBar = player.controlBar;\n        var needToUserActive = player.hasClass(\"vjs-controls-enabled\") && player.hasClass(\"vjs-has-started\") && player.hasClass(\"vjs-paused\");\n\n        if (needToUserActive || player.userActive() || manualUserActive != undefined) {//if video.js's useractive status is true by mousemove\n\n            if (needToUserActive) {\n                manualUserActive = \"useractive\";\n            }\n\n            var controlBarPosition = adUnit.options.controlBarPosition ? adUnit.options.controlBarPosition : \"over\";\n            var currentControlBarHeight = (manualUserActive === \"userinactive\") ? 0 : controlBar.height();\n            var controlBarHeight = (controlBar && controlBarPosition === \"over\") ? currentControlBarHeight : 0;\n\n            if (controlBar && controlBarHeight && player.hasClass(\"vjs-ended\") === false) {\n                height = dimension.height - controlBarHeight;\n            }\n        }\n\n        // (optimization) do nothing if size did not changed\n        if (lastSize.width != width || lastSize.height != height) {\n            // save current size\n            lastSize.width = width;\n            lastSize.height = height;\n\n            //Resize both slot and video slot (Ads could use either or both)\n            if (slot && videoSlot) {\n                slot.style.height = height + 'px';\n                videoSlot.style.height = height + 'px';\n            }\n\n            //VIDLA-2143\n            //To figure out specific creative issue which has 1px of height after AdVideoStart\n            //details here: https://stash.corp.appnexus.com/projects/VIDEO/repos/resources_video-ad-video-player-html5-plugin-vpaid/pull-requests/14/overview\n            if (isAdVideoStart && isAdVideoStart === true) {\n                adUnit.resizeAd(width + 1, height + 1, MODE, logError);\n                adUnit.resizeAd(width, height, MODE, logError);\n            } else {\n                adUnit.resizeAd(width, height, MODE, logError);\n            }\n        }\n    };\n\n    function logError(error) {\n        if (error) {\n            logger.log('ERROR: ' + error.message);\n        }\n    };\n\n    function Ad(adJTree) {\n        if (!(this instanceof Ad)) {\n            return new Ad(adJTree);\n        }\n\n        this.id = adJTree.attr('id');\n        this.sequence = adJTree.attr('sequence');\n\n        if (adJTree.inLine) {\n            this.inLine = new InLine(adJTree.inLine);\n        }\n\n        if (adJTree.wrapper) {\n            this.wrapper = new Wrapper(adJTree.wrapper);\n        }\n    };\n\n    function Creative(creativeJTree) {\n        if (!(this instanceof Creative)) {\n            return new Creative(creativeJTree);\n        }\n\n        this.id = creativeJTree.attr('id');\n        this.sequence = creativeJTree.attr('sequence');\n        this.adId = creativeJTree.attr('adId');\n        this.apiFramework = creativeJTree.attr('apiFramework');\n\n        if (creativeJTree.linear) {\n            this.linear = new Linear(creativeJTree.linear);\n        }\n    };\n\n    function InLine(inlineJTree) {\n        if (!(this instanceof InLine)) {\n            return new InLine(inlineJTree);\n        }\n\n        //Required Fields\n        this.adTitle = xml.keyValue(inlineJTree.adTitle);\n        this.adSystem = xml.keyValue(inlineJTree.adSystem);\n        this.impressions = vastUtil.parseImpressions(inlineJTree.impression);\n        this.creatives = vastUtil.parseCreatives(inlineJTree.creatives);\n\n        //Optional Fields\n        this.description = xml.keyValue(inlineJTree.description);\n        this.advertiser = xml.keyValue(inlineJTree.advertiser);\n        this.surveys = parseSurveys(inlineJTree.survey);\n        this.error = xml.keyValue(inlineJTree.error);\n        this.pricing = xml.keyValue(inlineJTree.pricing);\n        this.extensions = inlineJTree.extensions;\n\n        /*** Local Functions ***/\n        function parseSurveys(inlineSurveys) {\n            if (inlineSurveys) {\n                return transformArray(isArray(inlineSurveys) ? inlineSurveys : [inlineSurveys], function(survey) {\n                    if (isNotEmptyString(survey.keyValue)) {\n                        return {\n                            uri: survey.keyValue,\n                            type: survey.attr('type')\n                        };\n                    }\n\n                    return undefined;\n                });\n            }\n            return [];\n        }\n    };\n\n    function Linear(linearJTree) {\n        if (!(this instanceof Linear)) {\n            return new Linear(linearJTree);\n        }\n\n        //Required Elements\n        this.duration = vastUtil.parseDuration(xml.keyValue(linearJTree.duration));\n        this.mediaFiles = parseMediaFiles(linearJTree.mediaFiles && linearJTree.mediaFiles.mediaFile);\n\n        //Optional fields\n        this.trackingEvents = parseTrackingEvents(linearJTree.trackingEvents && linearJTree.trackingEvents.tracking, this.duration);\n        this.skipoffset = vastUtil.parseOffset(xml.attr(linearJTree, 'skipoffset'), this.duration);\n\n        if (linearJTree.videoClicks) {\n            this.videoClicks = new VideoClicks(linearJTree.videoClicks);\n        }\n\n        if (linearJTree.adParameters) {\n            this.adParameters = xml.keyValue(linearJTree.adParameters);\n\n            if (xml.attr(linearJTree.adParameters, 'xmlEncoded')) {\n                this.adParameters = xml.decode(this.adParameters);\n            }\n        }\n\n        /*** Local functions ***/\n        function parseTrackingEvents(trackingEvents, duration) {\n            var trackings = [];\n            if (isDefined(trackingEvents)) {\n                trackingEvents = isArray(trackingEvents) ? trackingEvents : [trackingEvents];\n                trackingEvents.forEach(function(trackingData) {\n                    trackings.push(new TrackingEvent(trackingData, duration));\n                });\n            }\n            return trackings;\n        }\n\n        function parseMediaFiles(mediaFilesJxonTree) {\n            var mediaFiles = [];\n            if (isDefined(mediaFilesJxonTree)) {\n                mediaFilesJxonTree = isArray(mediaFilesJxonTree) ? mediaFilesJxonTree : [mediaFilesJxonTree];\n\n                mediaFilesJxonTree.forEach(function(mfData) {\n                    mediaFiles.push(new MediaFile(mfData));\n                });\n            }\n            return mediaFiles;\n        }\n    };\n\n    function MediaFile(mediaFileJTree) {\n        if (!(this instanceof MediaFile)) {\n            return new MediaFile(mediaFileJTree);\n        }\n\n        //Required attributes\n        this.src = xml.keyValue(mediaFileJTree);\n        this.delivery = mediaFileJTree.attr('delivery');\n        this.type = mediaFileJTree.attr('type');\n        this.width = mediaFileJTree.attr('width');\n        this.height = mediaFileJTree.attr('height');\n\n        //Optional attributes\n        this.codec = mediaFileJTree.attr('codec');\n        this.id = mediaFileJTree.attr('id');\n        this.bitrate = mediaFileJTree.attr('bitrate');\n        this.minBitrate = mediaFileJTree.attr('minBitrate');\n        this.maxBitrate = mediaFileJTree.attr('maxBitrate');\n        this.scalable = mediaFileJTree.attr('scalable');\n        this.maintainAspectRatio = mediaFileJTree.attr('maintainAspectRatio');\n        this.apiFramework = mediaFileJTree.attr('apiFramework');\n    };\n\n    function TrackingEvent(trackingJTree, duration) {\n        if (!(this instanceof TrackingEvent)) {\n            return new TrackingEvent(trackingJTree, duration);\n        }\n\n        this.name = trackingJTree.attr('event');\n        this.uri = xml.keyValue(trackingJTree);\n\n        if ('progress' === this.name) {\n            this.offset = vastUtil.parseOffset(trackingJTree.attr('offset'), duration);\n        }\n    }\n\n    ;\n\n    //minthe : VASTClient initialize\n    function VASTClient(options) {\n\n        if (!(this instanceof VASTClient)) {\n            return new VASTClient(options);\n        }\n        var defaultOptions = {\n            WRAPPER_LIMIT: 5\n        };\n\n        options = options || {};\n        this.settings = extend({}, options, defaultOptions);\n        this.errorURLMacros = [];\n    }\n\n    VASTClient.prototype.getVASTResponse = function getVASTResponse(adTagUrl, callback) {\n        var that = this;\n\n        var error = sanityCheck(adTagUrl, callback);\n        if (error) {\n            if (isFunction(callback)) {\n                return callback(error);\n            }\n            throw error;\n        }\n\n        async.waterfall([\n                this._getVASTAd.bind(this, adTagUrl),\n                buildVASTResponse\n            ],\n            callback);\n\n        /*** Local functions ***/\n        function buildVASTResponse(adsChain, cb) {\n            try {\n                var response = that._buildVASTResponse(adsChain);\n                cb(null, response);\n            } catch (e) {\n                cb(e);\n            }\n        }\n\n        function sanityCheck(adTagUrl, cb) {\n            if (!adTagUrl) {\n                return new VASTError('on VASTClient.getVASTResponse, missing ad tag URL');\n            }\n\n            if (!isFunction(cb)) {\n                return new VASTError('on VASTClient.getVASTResponse, missing callback function');\n            }\n        }\n    };\n\n    VASTClient.prototype._getVASTAd = function(adTagUrl, callback) {\n        var that = this;\n\n        getAdWaterfall(adTagUrl, function(error, vastTree) {\n            var waterfallAds = vastTree && isArray(vastTree.ads) ? vastTree.ads : null;\n            if (error) {\n                that._trackError(error, waterfallAds);\n                return callback(error, waterfallAds);\n            }\n\n            getAd(waterfallAds.shift(), [], waterfallHandler);\n\n            /*** Local functions ***/\n            function waterfallHandler(error, adChain) {\n                if (error) {\n                    that._trackError(error, adChain);\n                    if (waterfallAds.length > 0) {\n                        getAd(waterfallAds.shift(), [], waterfallHandler);\n                    } else {\n                        callback(error, adChain);\n                    }\n                } else {\n                    callback(null, adChain);\n                }\n            }\n        });\n\n        /*** Local functions ***/\n        function getAdWaterfall(adTagUrl, callback) {\n            var requestVastXML = that._requestVASTXml.bind(that, adTagUrl);\n            async.waterfall([\n                requestVastXML,\n                buildVastWaterfall\n            ], callback);\n        }\n\n        function buildVastWaterfall(xmlStr, callback) {\n            var vastTree;\n            try {\n                vastTree = xml.toJXONTree(xmlStr);\n                vastTree.ads = isArray(vastTree.ad) ? vastTree.ad : [vastTree.ad];\n                callback(validateVASTTree(vastTree), vastTree);\n            } catch (e) {\n                callback(new VASTError(\"on VASTClient.getVASTAd.buildVastWaterfall, error parsing xml\", 100), null);\n            }\n        }\n\n        function validateVASTTree(vastTree) {\n            var vastVersion = xml.attr(vastTree, 'version');\n\n            if (!vastTree.ad) {\n                return new VASTError('on VASTClient.getVASTAd.validateVASTTree, no Ad in VAST tree', 303);\n            }\n\n            if (vastVersion && (vastVersion != 3 && vastVersion != 2)) {\n                return new VASTError('on VASTClient.getVASTAd.validateVASTTree, not supported VAST version \"' + vastVersion + '\"', 102);\n            }\n\n            return null;\n        }\n\n        function getAd(adTagUrl, adChain, callback) {\n            if (adChain.length >= that.WRAPPER_LIMIT) {\n                return callback(new VASTError(\"on VASTClient.getVASTAd.getAd, players wrapper limit reached (the limit is \" + that.WRAPPER_LIMIT + \")\", 302), adChain);\n            }\n\n            async.waterfall([\n                function(next) {\n                    if (isString(adTagUrl)) {\n                        requestVASTAd(adTagUrl, next);\n                    } else {\n                        next(null, adTagUrl);\n                    }\n                },\n                buildAd\n            ], function(error, ad) {\n                if (ad) {\n                    adChain.push(ad);\n                }\n\n                if (error) {\n                    return callback(error, adChain);\n                }\n\n                if (ad.wrapper) {\n                    return getAd(ad.wrapper.VASTAdTagURI, adChain, callback);\n                }\n\n                return callback(null, adChain);\n            });\n        }\n\n        function buildAd(adJxonTree, callback) {\n            try {\n                var ad = new Ad(adJxonTree);\n                callback(validateAd(ad), ad);\n            } catch (e) {\n                callback(new VASTError('on VASTClient.getVASTAd.buildAd, error parsing xml', 100), null);\n            }\n        }\n\n        function validateAd(ad) {\n            var wrapper = ad.wrapper;\n            var inLine = ad.inLine;\n            var errMsgPrefix = 'on VASTClient.getVASTAd.validateAd, ';\n\n            if (inLine && wrapper) {\n                return new VASTError(errMsgPrefix + \"InLine and Wrapper both found on the same Ad\", 101);\n            }\n\n            if (!inLine && !wrapper) {\n                return new VASTError(errMsgPrefix + \"nor wrapper nor inline elements found on the Ad\", 101);\n            }\n\n            if (inLine && inLine.creatives.length === 0) {\n                return new VASTError(errMsgPrefix + \"missing creative in InLine element\", 101);\n            }\n\n            if (wrapper && !wrapper.VASTAdTagURI) {\n                return new VASTError(errMsgPrefix + \"missing 'VASTAdTagURI' in wrapper\", 101);\n            }\n        }\n\n        function requestVASTAd(adTagUrl, callback) {\n            that._requestVASTXml(adTagUrl, function(error, xmlStr) {\n                if (error) {\n                    return callback(error);\n                }\n                try {\n                    var vastTree = xml.toJXONTree(xmlStr);\n                    callback(validateVASTTree(vastTree), vastTree.ad);\n                } catch (e) {\n                    callback(new VASTError(\"on VASTClient.getVASTAd.requestVASTAd, error parsing xml\", 100));\n                }\n            });\n        }\n    };\n\n    VASTClient.prototype._requestVASTXml = function requestVASTXml(adTagUrl, callback) {\n        try {\n            if (isFunction(adTagUrl)) {\n                adTagUrl(requestHandler);\n            } else {\n                http.get(adTagUrl, requestHandler, {\n                    withCredentials: true\n                });\n            }\n        } catch (e) {\n            callback(e);\n        }\n\n        /*** Local functions ***/\n        function requestHandler(error, response, status) {\n            if (error) {\n                var errMsg = isDefined(status) ?\n                    \"on VASTClient.requestVastXML, HTTP request error with status '\" + status + \"'\" :\n                    \"on VASTClient.requestVastXML, Error getting the the VAST XML with he passed adTagXML fn\";\n                return callback(new VASTError(errMsg, 301), null);\n            }\n\n            callback(null, response);\n        }\n    };\n\n    VASTClient.prototype._buildVASTResponse = function buildVASTResponse(adsChain) {\n        var response = new VASTResponse();\n        addAdsToResponse(response, adsChain);\n        validateResponse(response);\n\n        return response;\n\n        //*** Local function ****\n        function addAdsToResponse(response, ads) {\n            ads.forEach(function(ad) {\n                response.addAd(ad);\n            });\n        }\n\n        function validateResponse(response) {\n            var progressEvents = response.trackingEvents.progress;\n\n            if (!response.hasLinear()) {\n                throw new VASTError(\"on VASTClient._buildVASTResponse, Received an Ad type that is not supported\", 200);\n            }\n\n            if (response.duration === undefined) {\n                throw new VASTError(\"on VASTClient._buildVASTResponse, Missing duration field in VAST response\", 101);\n            }\n\n            if (progressEvents) {\n                progressEvents.forEach(function(progressEvent) {\n                    if (!isNumber(progressEvent.offset)) {\n                        throw new VASTError(\"on VASTClient._buildVASTResponse, missing or wrong offset attribute on progress tracking event\", 101);\n                    }\n                });\n            }\n        }\n    };\n\n    VASTClient.prototype._trackError = function(error, adChain) {\n        if (!isArray(adChain) || adChain.length === 0) { //There is nothing to track\n            return;\n        }\n\n        var errorURLMacros = [];\n        adChain.forEach(addErrorUrlMacros);\n        vastUtil.track(errorURLMacros, { ERRORCODE: error.code || 900 }); //900 <== Undefined error\n\n        /*** Local functions  ***/\n        function addErrorUrlMacros(ad) {\n            if (ad.wrapper && ad.wrapper.error) {\n                errorURLMacros.push(ad.wrapper.error);\n            }\n\n            if (ad.inLine && ad.inLine.error) {\n                errorURLMacros.push(ad.inLine.error);\n            }\n        }\n    };\n\n    ;\n    var VAST = {};\n\n    function VASTError(message, code) {\n        this.message = 'VAST Error: ' + (message || '');\n        if (code) {\n            this.code = code;\n        }\n    }\n\n    VASTError.prototype = new Error();\n    VASTError.prototype.name = \"VAST Error\";;\n    /**\n     * Inner helper class that deals with the logic of the individual steps needed to setup an ad in the player.\n     *\n     * @param player {object} instance of the player that will play the ad. It assumes that the videojs-contrib-ads plugin\n     *                        has been initialized when you use its utility functions.\n     *\n     * @constructor\n     */\n    function VASTIntegrator(player) {\n        if (!(this instanceof VASTIntegrator)) {\n            return new VASTIntegrator(player);\n        }\n\n        this.player = player;\n    }\n\n    VASTIntegrator.prototype.playAd = function playAd(vastResponse, callback) {\n        var that = this;\n        callback = callback || noop;\n\n        if (!(vastResponse instanceof VASTResponse)) {\n            return callback(new VASTError('On VASTIntegrator, missing required VASTResponse'));\n        }\n\n        async.waterfall([\n            function(next) {\n                next(null, vastResponse);\n            },\n            this._selectAdSource.bind(this),\n            this._createVASTTracker.bind(this),\n            this._addClickThrough.bind(this),\n            this._setupEvents.bind(this),\n            this._playSelectedAd.bind(this)\n        ], function(error, response) {\n            if (error && response) {\n                that._trackError(error, response);\n            }\n            callback(error, response);\n        });\n\n        this._adUnit = {\n            _src: null,\n            type: 'VAST',\n            pauseAd: function() {\n                that.player.pause(true); //video.js player pause\n            },\n\n            resumeAd: function() {\n                that.player.play(true);\n            },\n\n            isPaused: function() {\n                return that.player.paused(true);\n            },\n\n            getSrc: function() {\n                return this._src;\n            }\n        };\n\n        return this._adUnit;\n    };\n\n    VASTIntegrator.prototype._selectAdSource = function selectAdSource(response, callback) {\n        var source;\n\n        var playerWidth = dom.getDimension(this.player.el()).width;\n        response.mediaFiles.sort(function compareTo(a, b) {\n            var deltaA = Math.abs(playerWidth - a.width);\n            var deltaB = Math.abs(playerWidth - b.width);\n            return deltaA - deltaB;\n        });\n\n        source = this.player.selectSource(response.mediaFiles).source;\n\n        if (source) {\n            if (this._adUnit) {\n                this._adUnit._src = source;\n            }\n            return callback(null, source, response);\n        }\n\n        // code 403 <== Couldn't find MediaFile that is supported by this video player\n        callback(new VASTError(\"Could not find Ad mediafile supported by this player\", 403), response);\n    };\n\n    VASTIntegrator.prototype._createVASTTracker = function createVASTTracker(adMediaFile, response, callback) {\n        try {\n            callback(null, adMediaFile, new VASTTracker(adMediaFile.src, response), response);\n        } catch (e) {\n            callback(e, response);\n        }\n    };\n\n    VASTIntegrator.prototype._setupEvents = function setupEvents(adMediaFile, tracker, response, callback) {\n        var previouslyMuted;\n        var player = this.player;\n        player.on('fullscreenchange', trackFullscreenChange);\n        player.on('vast.adStart', trackImpressions);\n        player.on('pause', trackPause);\n        player.on('timeupdate', trackProgress);\n        player.on('volumechange', trackVolumeChange);\n\n        playerUtils.once(player, ['vast.adEnd', 'vast.adsCancel'], unbindEvents);\n        playerUtils.once(player, ['vast.adEnd', 'vast.adsCancel', 'vast.adSkip'], function(evt) {\n            if (evt.type === 'vast.adEnd') {\n                tracker.trackComplete();\n            }\n        });\n\n        return callback(null, adMediaFile, response);\n\n        /*** Local Functions ***/\n        function unbindEvents() {\n            player.off('fullscreenchange', trackFullscreenChange);\n            player.off('vast.adStart', trackImpressions);\n            player.off('pause', trackPause);\n            player.off('timeupdate', trackProgress);\n            player.off('volumechange', trackVolumeChange);\n        }\n\n        function trackFullscreenChange() {\n            if (player.isFullscreen()) {\n                tracker.trackFullscreen();\n            } else {\n                tracker.trackExitFullscreen();\n            }\n        }\n\n        function trackPause() {\n            //NOTE: whenever a video ends the video Element triggers a 'pause' event before the 'ended' event.\n            //      We should not track this pause event because it makes the VAST tracking confusing again we use a\n            //      Threshold of 2 seconds to prevent false positives on IOS.\n            if (Math.abs(player.duration() - player.currentTime()) < 2) {\n                return;\n            }\n\n            tracker.trackPause();\n            playerUtils.once(player, ['play', 'vast.adEnd', 'vast.adsCancel'], function(evt) {\n                if (evt.type === 'play') {\n                    tracker.trackResume();\n                }\n            });\n        }\n\n        function trackProgress() {\n            var currentTimeInMs = player.currentTime() * 1000;\n            tracker.trackProgress(currentTimeInMs);\n        }\n\n        function trackImpressions() {\n            tracker.trackImpressions();\n            tracker.trackCreativeView();\n        }\n\n        function trackVolumeChange() {\n            var muted = player.muted();\n            if (muted) {\n                tracker.trackMute();\n            } else if (previouslyMuted) {\n                tracker.trackUnmute();\n            }\n            previouslyMuted = muted;\n        }\n    };\n\n    VASTIntegrator.prototype._addClickThrough = function addClickThrough(mediaFile, tracker, response, callback) {\n        var player = this.player;\n        var blocker = createClickThroughBlocker(player, tracker, response);\n        var updateBlocker = updateBlockerURL.bind(this, blocker, response, player);\n\n        player.el().insertBefore(blocker, player.controlBar.el());\n        player.on('timeupdate', updateBlocker);\n        playerUtils.once(player, ['vast.adEnd', 'vast.adsCancel'], removeBlocker);\n\n        return callback(null, mediaFile, tracker, response);\n\n        /*** Local Functions ***/\n\n        function createClickThroughBlocker(player, tracker, response) {\n            var blocker = window.document.createElement(\"a\");\n            var clickThroughMacro = response.clickThrough;\n\n            dom.addClass(blocker, 'vast-blocker');\n            blocker.href = generateClickThroughURL(clickThroughMacro, player);\n\n            if (isString(clickThroughMacro)) {\n                blocker.target = \"_blank\";\n            }\n\n            blocker.onclick = function(e) {\n                if (player.paused()) {\n                    player.play();\n\n                    //We prevent event propagation to avoid problems with the player's normal pause mechanism\n                    if (window.Event.prototype.stopPropagation !== undefined) {\n                        e.stopPropagation();\n                    }\n                    return false;\n                }\n\n                player.pause();\n                tracker.trackClick();\n            };\n\n            return blocker;\n        }\n\n        function updateBlockerURL(blocker, response, player) {\n            blocker.href = generateClickThroughURL(response.clickThrough, player);\n        }\n\n        function generateClickThroughURL(clickThroughMacro, player) {\n            var variables = {\n                ASSETURI: mediaFile.src,\n                CONTENTPLAYHEAD: vastUtil.formatProgress(player.currentTime() * 1000)\n            };\n\n            return clickThroughMacro ? vastUtil.parseURLMacro(clickThroughMacro, variables) : '#';\n        }\n\n        function removeBlocker() {\n            player.off('timeupdate', updateBlocker);\n            dom.remove(blocker);\n        }\n    };\n\n    VASTIntegrator.prototype._playSelectedAd = function playSelectedAd(source, response, callback) {\n        var player = this.player;\n\n        player.preload(\"auto\"); //without preload=auto the durationchange event is never fired\n        player.src(source);\n\n        playerUtils.once(player, ['durationchange', 'error', 'vast.adsCancel'], function(evt) {\n            if (evt.type === 'durationchange') {\n                playAd();\n            } else if (evt.type === 'error') {\n                callback(new VASTError(\"on VASTIntegrator, Player is unable to play the Ad\", 400), response);\n            }\n            //NOTE: If the ads get canceled we do nothing/\n        });\n\n        /**** local functions ******/\n        function playAd() {\n            player.play();\n            playerUtils.once(player, ['playing', 'vast.adsCancel'], function(evt) {\n                if (evt.type === 'vast.adsCancel') {\n                    return;\n                }\n\n                player.trigger('vast.adStart');\n\n                playerUtils.once(player, ['ended', 'vast.adsCancel', 'vast.adSkip'], function(evt) {\n                    if (evt.type === 'ended' || evt.type === 'vast.adSkip') {\n                        callback(null, response);\n                    }\n                    //NOTE: if the ads get cancel we do nothing\n                });\n            });\n        }\n    };\n\n    VASTIntegrator.prototype._trackError = function trackError(error, response) {\n        vastUtil.track(response.errorURLMacros, { ERRORCODE: error.code || 900 });\n    };\n\n    ;\n    (function(window) {\n        \"use strict\";\n\n\n        function VASTResponse() {\n            if (!(this instanceof VASTResponse)) {\n                return new VASTResponse();\n            }\n\n            this._linearAdded = false;\n            this.ads = [];\n            this.errorURLMacros = [];\n            this.impressions = [];\n            this.clickTrackings = [];\n            this.customClicks = [];\n            this.trackingEvents = {};\n            this.mediaFiles = [];\n            this.clickThrough = undefined;\n            this.adTitle = '';\n            this.duration = undefined;\n            this.skipoffset = undefined;\n        }\n\n        VASTResponse.prototype.addAd = function(ad) {\n            var inLine, wrapper;\n\n            if (ad instanceof Ad) {\n                inLine = ad.inLine;\n                wrapper = ad.wrapper;\n\n                this.ads.push(ad);\n\n                if (inLine) {\n                    this._addInLine(inLine);\n                }\n\n                if (wrapper) {\n                    this._addWrapper(wrapper);\n                }\n            }\n        };\n\n        VASTResponse.prototype._addErrorTrackUrl = function(error) {\n            var errorURL = error instanceof xml.JXONTree ? xml.keyValue(error) : error;\n            if (errorURL) {\n                this.errorURLMacros.push(errorURL);\n            }\n        };\n\n        VASTResponse.prototype._addImpressions = function(impressions) {\n            isArray(impressions) && appendToArray(this.impressions, impressions);\n        };\n\n        VASTResponse.prototype._addClickThrough = function(clickThrough) {\n            if (isNotEmptyString(clickThrough)) {\n                this.clickThrough = clickThrough;\n            }\n        };\n\n        VASTResponse.prototype._addClickTrackings = function(clickTrackings) {\n            isArray(clickTrackings) && appendToArray(this.clickTrackings, clickTrackings);\n        };\n\n        VASTResponse.prototype._addCustomClicks = function(customClicks) {\n            isArray(customClicks) && appendToArray(this.customClicks, customClicks);\n        };\n\n        VASTResponse.prototype._addTrackingEvents = function(trackingEvents) {\n            var eventsMap = this.trackingEvents;\n\n            if (trackingEvents) {\n                trackingEvents = isArray(trackingEvents) ? trackingEvents : [trackingEvents];\n                trackingEvents.forEach(function(trackingEvent) {\n                    if (!eventsMap[trackingEvent.name]) {\n                        eventsMap[trackingEvent.name] = [];\n                    }\n                    eventsMap[trackingEvent.name].push(trackingEvent);\n                });\n            }\n        };\n\n        VASTResponse.prototype._addTitle = function(title) {\n            if (isNotEmptyString(title)) {\n                this.adTitle = title;\n            }\n        };\n\n        VASTResponse.prototype._addDuration = function(duration) {\n            if (isNumber(duration)) {\n                this.duration = duration;\n            }\n        };\n\n        VASTResponse.prototype._addVideoClicks = function(videoClicks) {\n            if (videoClicks instanceof VideoClicks) {\n                this._addClickThrough(videoClicks.clickThrough);\n                this._addClickTrackings(videoClicks.clickTrackings);\n                this._addCustomClicks(videoClicks.customClicks);\n            }\n        };\n\n        VASTResponse.prototype._addMediaFiles = function(mediaFiles) {\n            isArray(mediaFiles) && appendToArray(this.mediaFiles, mediaFiles);\n        };\n\n        VASTResponse.prototype._addSkipoffset = function(offset) {\n            if (offset) {\n                this.skipoffset = offset;\n            }\n        };\n\n        VASTResponse.prototype._addAdParameters = function(adParameters) {\n            if (adParameters) {\n                this.adParameters = adParameters;\n            }\n        };\n\n        VASTResponse.prototype._addLinear = function(linear) {\n            if (linear instanceof Linear) {\n                this._addDuration(linear.duration);\n                this._addTrackingEvents(linear.trackingEvents);\n                this._addVideoClicks(linear.videoClicks);\n                this._addMediaFiles(linear.mediaFiles);\n                this._addSkipoffset(linear.skipoffset);\n                this._addAdParameters(linear.adParameters);\n                this._linearAdded = true;\n            }\n        };\n\n        VASTResponse.prototype._addInLine = function(inLine) {\n            var that = this;\n\n            if (inLine instanceof InLine) {\n                this._addTitle(inLine.adTitle);\n                this._addErrorTrackUrl(inLine.error);\n                this._addImpressions(inLine.impressions);\n\n                inLine.creatives.forEach(function(creative) {\n                    if (creative.linear) {\n                        that._addLinear(creative.linear);\n                    }\n                });\n            }\n        };\n\n        VASTResponse.prototype._addWrapper = function(wrapper) {\n            var that = this;\n\n            if (wrapper instanceof Wrapper) {\n                this._addErrorTrackUrl(wrapper.error);\n                this._addImpressions(wrapper.impressions);\n\n                wrapper.creatives.forEach(function(creative) {\n                    var linear = creative.linear;\n                    if (linear) {\n                        that._addVideoClicks(linear.videoClicks);\n                        that.clickThrough = undefined; //We ensure that no clickThrough has been added\n                        that._addTrackingEvents(linear.trackingEvents);\n                    }\n                });\n            }\n        };\n\n        VASTResponse.prototype.hasLinear = function() {\n            return this._linearAdded;\n        };\n\n        function appendToArray(array, items) {\n            items.forEach(function(item) {\n                array.push(item);\n            });\n        }\n\n        window.VASTResponse = VASTResponse;\n    })(window);\n\n    ;\n\n    function VASTTracker(assetURI, vastResponse) {\n        if (!(this instanceof VASTTracker)) {\n            return new VASTTracker(assetURI, vastResponse);\n        }\n\n        sanityCheck(assetURI, vastResponse);\n        this.response = vastResponse;\n        this.assetURI = assetURI;\n        this.progress = 0;\n        this.quartiles = {\n            firstQuartile: { tracked: false, time: Math.round(25 * vastResponse.duration) / 100 },\n            midpoint: { tracked: false, time: Math.round(50 * vastResponse.duration) / 100 },\n            thirdQuartile: { tracked: false, time: Math.round(75 * vastResponse.duration) / 100 }\n        };\n\n        /*** Local Functions ***/\n        function sanityCheck(assetURI, vastResponse) {\n            if (!isString(assetURI) || isEmptyString(assetURI)) {\n                throw new VASTError('on VASTTracker constructor, missing required the URI of the ad asset being played');\n            }\n\n            if (!(vastResponse instanceof VASTResponse)) {\n                throw new VASTError('on VASTTracker constructor, missing required VAST response');\n            }\n        }\n    }\n\n    VASTTracker.prototype.trackURLs = function trackURLs(urls, variables) {\n        if (isArray(urls) && urls.length > 0) {\n            variables = extend({\n                ASSETURI: this.assetURI,\n                CONTENTPLAYHEAD: vastUtil.formatProgress(this.progress)\n            }, variables || {});\n\n            vastUtil.track(urls, variables);\n        }\n    };\n\n    VASTTracker.prototype.trackEvent = function trackEvent(eventName, trackOnce) {\n        this.trackURLs(getEventUris(this.response.trackingEvents[eventName]));\n        if (trackOnce) {\n            this.response.trackingEvents[eventName] = undefined;\n        }\n\n        /*** Local function ***/\n        function getEventUris(trackingEvents) {\n            var uris;\n\n            if (trackingEvents) {\n                uris = [];\n                trackingEvents.forEach(function(event) {\n                    uris.push(event.uri);\n                });\n            }\n            return uris;\n        }\n    };\n\n    VASTTracker.prototype.trackProgress = function trackProgress(newProgressInMs) {\n        var events = [];\n        var ONCE = true;\n        var ALWAYS = false;\n        var trackingEvents = this.response.trackingEvents;\n\n        if (isNumber(newProgressInMs)) {\n            addTrackEvent('start', ONCE, newProgressInMs > 0);\n            addTrackEvent('rewind', ALWAYS, hasRewound(this.progress, newProgressInMs));\n            addQuartileEvents.call(this, newProgressInMs);\n            trackProgressEvents.call(this, newProgressInMs);\n            trackEvents.call(this);\n            this.progress = newProgressInMs;\n        }\n\n        /*** Local function ***/\n        function hasRewound(currentProgress, newProgress) {\n            var REWIND_THRESHOLD = 3000; //IOS video clock is very unreliable and we need a 3 seconds threshold to ensure that there was a rewind an that it was on purpose.\n            return currentProgress > newProgressInMs && Math.abs(newProgress - currentProgress) > REWIND_THRESHOLD;\n        }\n\n        function addTrackEvent(eventName, trackOnce, canBeAdded) {\n            if (trackingEvents[eventName] && canBeAdded) {\n                events.push({\n                    name: eventName,\n                    trackOnce: !!trackOnce\n                });\n            }\n        }\n\n        function addQuartileEvents(progress) {\n            var quartiles = this.quartiles;\n            var firstQuartile = this.quartiles.firstQuartile;\n            var midpoint = this.quartiles.midpoint;\n            var thirdQuartile = this.quartiles.thirdQuartile;\n\n            if (!firstQuartile.tracked) {\n                trackQuartile('firstQuartile', progress);\n            } else if (!midpoint.tracked) {\n                trackQuartile('midpoint', progress);\n            } else {\n                trackQuartile('thirdQuartile', progress);\n            }\n\n            /*** Local function ***/\n            function trackQuartile(quartileName, progress) {\n                var quartile = quartiles[quartileName];\n                if (canBeTracked(quartile, progress)) {\n                    quartile.tracked = true;\n                    addTrackEvent(quartileName, ONCE, true);\n                }\n            }\n        }\n\n        function canBeTracked(quartile, progress) {\n            var quartileTime = quartile.time;\n            //We only fire the quartile event if the progress is bigger than the quartile time by 5 seconds at most.\n            return progress >= quartileTime && progress <= (quartileTime + 5000);\n        }\n\n        function trackProgressEvents(progress) {\n            if (!isArray(trackingEvents.progress)) {\n                return; //Nothing to track\n            }\n\n            var pendingProgressEvts = [];\n            var that = this;\n\n            trackingEvents.progress.forEach(function(evt) {\n                if (evt.offset <= progress) {\n                    that.trackURLs([evt.uri]);\n                } else {\n                    pendingProgressEvts.push(evt);\n                }\n            });\n            trackingEvents.progress = pendingProgressEvts;\n        }\n\n        function trackEvents() {\n            events.forEach(function(event) {\n                this.trackEvent(event.name, event.trackOnce);\n            }, this);\n        }\n    };\n\n    [\n        'rewind',\n        'fullscreen',\n        'exitFullscreen',\n        'pause',\n        'resume',\n        'mute',\n        'unmute',\n        'acceptInvitation',\n        'acceptInvitationLinear',\n        'collapse',\n        'expand'\n    ].forEach(function(eventName) {\n        VASTTracker.prototype['track' + capitalize(eventName)] = function() {\n            this.trackEvent(eventName);\n        };\n    });\n\n    [\n        'start',\n        'skip',\n        'close',\n        'closeLinear'\n    ].forEach(function(eventName) {\n        VASTTracker.prototype['track' + capitalize(eventName)] = function() {\n            this.trackEvent(eventName, true);\n        };\n    });\n\n    [\n        'firstQuartile',\n        'midpoint',\n        'thirdQuartile'\n    ].forEach(function(quartile) {\n        VASTTracker.prototype['track' + capitalize(quartile)] = function() {\n            this.quartiles[quartile].tracked = true;\n            this.trackEvent(quartile, true);\n        };\n    });\n\n    VASTTracker.prototype.trackComplete = function() {\n        if (this.quartiles.thirdQuartile.tracked) {\n            this.trackEvent('complete', true);\n        }\n    };\n\n    VASTTracker.prototype.trackErrorWithCode = function trackErrorWithCode(errorcode) {\n        if (isNumber(errorcode)) {\n            this.trackURLs(this.response.errorURLMacros, { ERRORCODE: errorcode });\n        }\n    };\n\n    VASTTracker.prototype.trackImpressions = function trackImpressions() {\n        this.trackURLs(this.response.impressions);\n    };\n\n    VASTTracker.prototype.trackCreativeView = function trackCreativeView() {\n        this.trackEvent('creativeView');\n    };\n\n    VASTTracker.prototype.trackClick = function trackClick() {\n        this.trackURLs(this.response.clickTrackings);\n    };\n\n    ;\n\n    function VideoClicks(videoClickJTree) {\n        if (!(this instanceof VideoClicks)) {\n            return new VideoClicks(videoClickJTree);\n        }\n\n        this.clickThrough = xml.keyValue(videoClickJTree.clickThrough);\n        this.clickTrackings = parseClickTrackings(videoClickJTree.clickTracking);\n        this.customClicks = parseClickTrackings(videoClickJTree.customClick);\n\n        /*** Local functions ***/\n        function parseClickTrackings(trackingData) {\n            var clickTrackings = [];\n            if (trackingData) {\n                trackingData = isArray(trackingData) ? trackingData : [trackingData];\n                trackingData.forEach(function(clickTrackingData) {\n                    clickTrackings.push(xml.keyValue(clickTrackingData));\n                });\n            }\n            return clickTrackings;\n        }\n    };\n\n    function Wrapper(wrapperJTree) {\n        if (!(this instanceof Wrapper)) {\n            return new Wrapper(wrapperJTree);\n        }\n\n        //Required elements\n        this.adSystem = xml.keyValue(wrapperJTree.adSystem);\n        this.impressions = vastUtil.parseImpressions(wrapperJTree.impression);\n        this.VASTAdTagURI = xml.keyValue(wrapperJTree.vASTAdTagURI);\n\n        //Optional elements\n        this.creatives = vastUtil.parseCreatives(wrapperJTree.creatives);\n        this.error = xml.keyValue(wrapperJTree.error);\n        this.extensions = wrapperJTree.extensions;\n\n        //Optional attrs\n        this.followAdditionalWrappers = isDefined(xml.attr(wrapperJTree, 'followAdditionalWrappers')) ? xml.attr(wrapperJTree, 'followAdditionalWrappers') : true;\n        this.allowMultipleAds = xml.attr(wrapperJTree, 'allowMultipleAds');\n        this.fallbackOnNoAd = xml.attr(wrapperJTree, 'fallbackOnNoAd');\n    }\n\n\n    ;\n    \"use strict\";\n\n    var vastUtil = {\n\n        track: function track(URLMacros, variables) {\n            var sources = vastUtil.parseURLMacros(URLMacros, variables);\n            var trackImgs = [];\n            sources.forEach(function(src) {\n                var img = new Image();\n                img.src = src;\n                trackImgs.push(img);\n            });\n            return trackImgs;\n        },\n\n        parseURLMacros: function parseMacros(URLMacros, variables) {\n            var parsedURLs = [];\n\n            variables = variables || {};\n\n            if (!(variables[\"CACHEBUSTING\"])) {\n                variables[\"CACHEBUSTING\"] = Math.round(Math.random() * 1.0e+10);\n            }\n\n            URLMacros.forEach(function(URLMacro) {\n                parsedURLs.push(vastUtil._parseURLMacro(URLMacro, variables));\n            });\n\n            return parsedURLs;\n        },\n\n        parseURLMacro: function parseMacro(URLMacro, variables) {\n            variables = variables || {};\n\n            if (!(variables[\"CACHEBUSTING\"])) {\n                variables[\"CACHEBUSTING\"] = Math.round(Math.random() * 1.0e+10);\n            }\n\n            return vastUtil._parseURLMacro(URLMacro, variables);\n        },\n\n        _parseURLMacro: function parseMacro(URLMacro, variables) {\n            variables = variables || {};\n\n            forEach(variables, function(value, key) {\n                URLMacro = URLMacro.replace(new RegExp(\"\\\\[\" + key + \"\\\\\\]\", 'gm'), value);\n            });\n\n            return URLMacro;\n        },\n\n        parseDuration: function parseDuration(durationStr) {\n            var durationRegex = /(\\d\\d):(\\d\\d):(\\d\\d)(\\.(\\d\\d\\d))?/;\n            var match, durationInMs;\n\n            if (isString(durationStr)) {\n                match = durationStr.match(durationRegex);\n                if (match) {\n                    durationInMs = parseHoursToMs(match[1]) + parseMinToMs(match[2]) + parseSecToMs(match[3]) + parseInt(match[5] || 0);\n                }\n            }\n\n            return isNaN(durationInMs) ? null : durationInMs;\n\n            /*** local functions ***/\n            function parseHoursToMs(hourStr) {\n                return parseInt(hourStr, 10) * 60 * 60 * 1000;\n            }\n\n            function parseMinToMs(minStr) {\n                return parseInt(minStr, 10) * 60 * 1000;\n            }\n\n            function parseSecToMs(secStr) {\n                return parseInt(secStr, 10) * 1000;\n            }\n        },\n\n        parseImpressions: function parseImpressions(impressions) {\n            if (impressions) {\n                impressions = isArray(impressions) ? impressions : [impressions];\n                return transformArray(impressions, function(impression) {\n                    if (isNotEmptyString(impression.keyValue)) {\n                        return impression.keyValue;\n                    }\n                    return undefined;\n                });\n            }\n            return [];\n        },\n\n        parseCreatives: function parseCreatives(creativesJTree) {\n            var creatives = [];\n            var creativesData;\n            if (isDefined(creativesJTree) && isDefined(creativesJTree.creative)) {\n                creativesData = isArray(creativesJTree.creative) ? creativesJTree.creative : [creativesJTree.creative];\n                creativesData.forEach(function(creative) {\n                    creatives.push(new Creative(creative));\n                });\n            }\n            return creatives;\n        },\n\n        //We assume that the progress is going to arrive in milliseconds\n        formatProgress: function formatProgress(progress) {\n            var hours, minutes, seconds, milliseconds;\n            hours = progress / (60 * 60 * 1000);\n            hours = Math.floor(hours);\n            minutes = (progress / (60 * 1000)) % 60;\n            minutes = Math.floor(minutes);\n            seconds = (progress / 1000) % 60;\n            seconds = Math.floor(seconds);\n            milliseconds = progress % 1000;\n            return toFixedDigits(hours, 2) + ':' + toFixedDigits(minutes, 2) + ':' + toFixedDigits(seconds, 2) + '.' + toFixedDigits(milliseconds, 3);\n        },\n\n        parseOffset: function parseOffset(offset, duration) {\n            if (isPercentage(offset)) {\n                return calculatePercentage(offset, duration);\n            }\n            return vastUtil.parseDuration(offset);\n\n            /*** Local function ***/\n            function isPercentage(offset) {\n                var percentageRegex = /^\\d+(\\.\\d+)?%$/g;\n                return percentageRegex.test(offset);\n            }\n\n            function calculatePercentage(percentStr, duration) {\n                if (duration) {\n                    return calcPercent(duration, parseFloat(percentStr.replace('%', '')));\n                }\n                return null;\n            }\n\n            function calcPercent(quantity, percent) {\n                return quantity * percent / 100;\n            }\n        },\n\n        isVPAID: function isVPAIDMediaFile(mediaFile) {\n            return !!mediaFile && mediaFile.apiFramework === 'VPAID';\n        }\n    };\n})(window, document, videojs);\n\n/* jshint ignore:end */\n"},function(e,t){e.exports=function(e,t){function n(e){return"object"==typeof e}function i(e){return null===e}var r=function e(t){var r,o,a;for(o=1;o<arguments.length;o++)for(a in r=arguments[o])r.hasOwnProperty(a)&&(n(t[a])&&!i(t[a])&&n(r[a])?t[a]=e({},t[a],r[a]):t[a]=r[a]);return t}({},e,t||{});return void 0!==r.playerTechnology&&0!==r.playerTechnology.length||(r.playerTechnology=["html5"]),r.width&&void 0!==r.width&&""!==r.width&&0!==r.width||(r.autoInitialSize=!0),r.safeFrame&&r.safeFrameAutoInitialSize&&(r.autoInitialSize=!1),"number"==typeof r.disableCollapse&&(r.disableCollapse>=0&&(r.disableCollapseForDelay=r.disableCollapse),r.disableCollapse=!1),r.enableExplicitPause=!0,r}},function(e,t,n){var i=n(68),r="[PlayerManager_ANVideoViewabilityTracker]",o=n(12),a=function(e,t){if(t)try{e+=" / "+JSON.stringify(t)}catch(e){o.error(r,e,t)}o.verbose(r,e)},s=function(e,t){if(t)try{e+=" / "+JSON.stringify(t)}catch(e){o.error(r,e,t)}o.info(r,e)};e.exports=function(){var e,t,n=null,l={video_start:"start",expand:"expand",collapse:"collapse",video_unmute:"sound_on",video_mute:"sound_off",video_pause:"pause",video_resume:"resume","ad-click":"click",video_skip:"stop",video_complete:"stop",fullscreen:"fullscreen",exitFullscreen:"exitFullscreen"},d={video_start:!1,video_skip:!1,video_complete:!1},c=function(n,i,r){if(e&&i){var o=/notifyEvent.*\[(.[^\]]+)\]/.exec(i);(o=Array.isArray(o)&&o.length>1?o[1]:null)&&e("VIEW",o,t,i)}n&&"debug"===n?a(i,r):s(i,r)};this.init=function(l,d,u,p,h,f,v){s("initialize with duration: "+d+", width: "+u+", height: "+p+", event: "+h),l&&(e=l.cbNotification,t=l.ASTadId);try{var m={loggerCallback:c,getViewModeCallback:function(){return f()?i.VIEW_MODE.FULL_SCREEN:i.VIEW_MODE.NORMAL},getVolumeCallback:v};n=new i(function(e){return e&&e.viewability}(l),m);var g={errorCallback:function(e,t){!function(e,t){if(t)try{e+=" / "+JSON.stringify(t)}catch(e){o.error(r,e,t)}o.error(r,e)}(t,e)}};n.initAppNexus(function(e){return e.targetElement}(l),function(e,t,n){return{duration:e,w:t,h:n}}(d,u,p),function(e){if(e)return e.playerContextId}(l),g),this.isReady=!0}catch(e){a("error on viewability library: "),a(e)}},this.invokeEvent=function(e){if(e&&l[e])try{if(d.hasOwnProperty(e)){if(d[e])return void s("supressing fireOnceEvents event as it is already fired once by viewability library: "+l[e]);d[e]=!0}s("event invoked by viewability library: "+l[e]),n.notifyEvent(l[e])}catch(e){a("error on viewability library: "),a(e)}},this.isReady=!1}},function(e,t,n){!function(){"use strict";var t=n(69);e.exports=t}()},function(e,t,n){"use strict";var i=n(70),r=n(72),o=n(71).LOG_LEVEL,a=n(71).VIEW_EVENT,s=n(71).VPAID_EVENT,l=n(71).VIEW_MODE,d=n(71).MODULE,c=function(e,t){p.call(this,e,t)};c.prototype={initAppNexus:function(e,t,n,i){try{this._private.initAppNexus(e,t,n,i)}catch(e){this._private,_debug&&console.error("exception in initAppNexus",e)}return this},initMoat:function(e,t,n,i){try{this._private.initMoat(e,t,n,i)}catch(e){this._private._debug&&console.error("exception in initMoat",e)}return this},notifyEvent:function(e){try{this._private.notifyEvent(e)}catch(e){this._private._debug&&console.error("exception in notifyEvent",e)}return this}},e.exports=c,e.exports.LOG_LEVEL=o,e.exports.VIEW_EVENT=a,e.exports.VPAID_EVENT=s,e.exports.VIEW_MODE=l,e.exports.MODULE=d,e.exports.AppNexus=i,e.exports.Moat=r;var u=function(){this._debug=!1,this._viewabilityParams={},this._viewabilityModules={},this._service={}},p=function(e,t){try{this._private=new u,this._private._service=t,e&&this._private.configure(e)}catch(e){this.log(o.ERROR,"'_init' failed:",e)}};u.prototype={log:function(e,t,n){try{if(this._service.loggerCallback)try{this._service.loggerCallback(e,"[VVAdaptor] "+t,n)}catch(e){this._debug&&console.trace(e)}else this._debug&&console.log(e+": "+t,n)}catch(e){this._debug&&console.trace(e)}},configure:function(e){this._viewabilityParams={},this._viewabilityModules={};try{e.hasOwnProperty("config")&&""!==e.config&&(this._viewabilityParams[d.APPNEXUS]=e.config)}catch(e){this.log(o.ERROR,"'configure' failed for MODULE.APPNEXUS: ",e)}try{if(e.hasOwnProperty("marketplace_clearing_event_addon")){var t=e.marketplace_clearing_event_addon;t.hasOwnProperty("name")&&"ETV_Moat_Video_AddOn"===t.name&&t.hasOwnProperty("config")&&""!==t.config&&(this._viewabilityParams[d.MOAT_ETMP]=t.config)}}catch(e){this.log(o.ERROR,"'configure' failed for MODULE.MOAT_ETMP: ",e)}if(!this._viewabilityParams[d.MOAT_ETMP])try{if(e.hasOwnProperty("third_party_providers")){var n=e.third_party_providers;for(var i in n)n[i].hasOwnProperty("code")&&"moat"===n[i].code&&n[i].hasOwnProperty("config")&&""!==n[i].config&&(this._viewabilityParams[d.MOAT_ANALYTICS]=n[i].config)}}catch(e){this.log(o.ERROR,"'configure' failed for MODULE.MOAT_ANALYTICS: ",e)}},initAppNexus:function(e,t,n,r){try{this._viewabilityModules[d.APPNEXUS]=null;var a=this._viewabilityParams[d.APPNEXUS];if(a&&r){r.loggerCallback=this._service.loggerCallback;var s=this.getVolume(),l=this.getViewMode();this._viewabilityModules[d.APPNEXUS]=new i(a,e,t,n,s,l,r),s&&(this.lastKnownVolume=s),l&&(this.lastKnownViewMode=l)}}catch(e){this.log(o.ERROR,"'initAppNexus' failed:",e)}},initMoat:function(e,t,n,i){var a;this._viewabilityModules[d.MOAT_ANALYTICS]=null,this._viewabilityModules[d.MOAT_ETMP]=null;try{(a=this._viewabilityParams[d.MOAT_ANALYTICS])&&i&&(i.loggerCallback=this._service.loggerCallback,i.getVolumeCallback=this._service.getVolumeCallback,this._viewabilityModules[d.MOAT_ANALYTICS]=new r(t?t.duration:0,n,e,a,r.MODE.ANALYTICS,i,this._debug))}catch(e){this.log(o.ERROR,"'initMoat' failed for MODULE.MOAT_ANALYTICS: ",e)}try{(a=this._viewabilityParams[d.MOAT_ETMP])&&i&&(i.loggerCallback=this._service.loggerCallback,i.getVolumeCallback=this._service.getVolumeCallback,this._viewabilityModules[d.MOAT_ETMP]=new r(t?t.duration:0,n,e,a,r.MODE.ETMP,i,this._debug))}catch(e){this.log(o.ERROR,"'initMoat' failed for MODULE.MOAT_ETMP: ",e)}},notifyEvent:function(e){var t=null,n=null;if(this._viewabilityModules[d.APPNEXUS])try{var i=null;switch(e){case s.Ad_Video_Start:i=a.START;break;case s.Ad_Stopped:case s.Ad_Skipped:i=a.STOP;break;case s.Ad_Paused:i=a.PAUSE;break;case s.Ad_Playing:i=a.RESUME;break;case s.Ad_Click_Thru:i=a.CLICK;break;case s.Ad_Size_Change:case s.Ad_Expanded_Change:case s.Ad_User_Minimize:null!==(n=null!==n?n:this.getNewViewMode())&&this._viewabilityModules[d.APPNEXUS].onViewModeChange(n);break;case s.Ad_Volume_Change:null!==(t=null!==t?t:this.getNewVolume())&&this._viewabilityModules[d.APPNEXUS].onVolumeChange(t);break;case a.START:case a.STOP:case a.PAUSE:case a.RESUME:case a.CLICK:i=e;break;case a.FULL_SCREEN:case a.EXIT_FULL_SCREEN:null!==(n=null!==n?n:this.getNewViewMode())&&this._viewabilityModules[d.APPNEXUS].onViewModeChange(n);break;case a.SOUND_OFF:case a.SOUND_ON:null!==(t=null!==t?t:this.getNewVolume())&&this._viewabilityModules[d.APPNEXUS].onVolumeChange(t)}null!==i&&this._viewabilityModules[d.APPNEXUS].notifyEvent(i)}catch(t){this.log(o.ERROR,"'notifyEvent' failed for event '"+e+"' with MODULE.APPNEXUS: "+t.message,t.stack)}if(this._viewabilityModules[d.MOAT_ANALYTICS]||this._viewabilityModules[d.MOAT_ETMP]){var r=null;switch(e){case a.START:r=s.Ad_Video_Start;break;case a.STOP:r=s.Ad_Stopped;break;case a.PAUSE:r=s.Ad_Paused;break;case a.RESUME:r=s.Ad_Playing;break;case a.FULL_SCREEN:case a.EXIT_FULL_SCREEN:null!==(n=null!==n?n:this.getNewViewMode())&&(r=s.Ad_Expanded_Change);break;case a.CLICK:r=s.Ad_Click_Thru;break;case a.SOUND_OFF:case a.SOUND_ON:null!==(t=null!==t?t:this.getNewVolume())&&(r=s.Ad_Volume_Change);break;case s.Ad_Loaded:case s.Ad_Started:case s.Ad_Stopped:case s.Ad_Skipped:case s.Ad_Skippable_State_Change:case s.Ad_Linear_Change:case s.Ad_Duration_Change:case s.Ad_Remaining_Time_Change:case s.Ad_Impression:case s.Ad_Video_Start:case s.Ad_Video_First_Quartile:case s.Ad_Video_Midpoint:case s.Ad_Video_Third_Quartile:case s.Ad_Video_Complete:case s.Ad_Click_Thru:case s.Ad_Interaction:case s.Ad_User_Accept_Invitation:case s.Ad_User_Close:case s.Ad_Paused:case s.Ad_Playing:case s.Ad_Log:case s.Ad_Error:r=e;break;case s.Ad_Volume_Change:null!==(t=null!==t?t:this.getNewVolume())&&(r=e);break;case s.Ad_Size_Change:case s.Ad_Expanded_Change:case s.Ad_User_Minimize:case a.EXIT_FULL_SCREEN:null!==(n=null!==n?n:this.getNewViewMode())&&(r=e)}try{null!==r&&this._viewabilityModules[d.MOAT_ANALYTICS]&&this._viewabilityModules[d.MOAT_ANALYTICS].notifyVPAIDEvent(r)}catch(e){this.log(o.ERROR,"'notifyEvent' failed for event '"+r+"' with MODULE.MOAT_ANALYTICS: ",e)}try{null!==r&&this._viewabilityModules[d.MOAT_ETMP]&&this._viewabilityModules[d.MOAT_ETMP].notifyVPAIDEvent(r)}catch(e){this.log(o.ERROR,"'notifyEvent' failed for event '"+r+"' with MODULE.MOAT_ETMP: ",e)}}null!==t&&(this.lastKnownVolume=t),null!==n&&(this.lastKnownViewMode=n)},lastKnownVolume:-1,getVolume:function(){var e=this._service.getVolumeCallback();return"number"==typeof e?e:null},getNewVolume:function(){var e=this.getVolume();return null!==e&&e!==this.lastKnownVolume?e:null},lastKnownViewMode:l.NORMAL,getViewMode:function(){var e=this._service.getViewModeCallback();if("string"==typeof e){switch(e){case l.NORMAL:case l.FULL_SCREEN:break;default:e=l.NORMAL}return e}return null},getNewViewMode:function(){var e=this.getViewMode();return null!==e&&e!==this.lastKnownViewMode?e:null}}},function(e,t,n){var i=n(71).LOG_LEVEL,r=n(71).VIEW_MODE,o={NO_VIEWABILITY_DATA:100,MISSING_MANDATORY_PARAMETER_JS:101,FAILED_TO_LOAD_VIEWABILITY_JS:102,INITIALIZATION_FAILED:103,MISSING_MANDATORY_PARAMETER_CB:104,MISSING_MANDATORY_PARAMETER_RDCB:105,MISSING_MANDATORY_PARAMETER_VC:106},a=function(e,t,n,r,a,s,l){"use strict";if(this.contextKey=r,this.service=l||{},this.adUID="WR_"+(new Date).getTime()+Math.round(1e3*Math.random()),this.viewabilityMeasurementActive=!0,this.viewabilityData=this.decodePayload(e),this.viewabilityData){if(this.contextKey&&""!==this.contextKey&&(this.log(i.INFO,"contextKey is set in this app, checking contextKey in viewability config"),!this.viewabilityData.hasOwnProperty("contextKey")||-1===this.viewabilityData.contextKey.indexOf(this.contextKey)))return this.log(i.INFO,"contextKey doesn't match, disabling viewability measurement"),void(this.viewabilityMeasurementActive=!1);var d="";try{"object"==typeof t?(this.videoNodeDocument=t.ownerDocument,this.videoNodeWindow=this.videoNodeDocument.defaultView||this.videoNodeDocument.videoNodeWindow,""===t.id&&(t.id="an_video_"+this.adUID),d=t.id):(d=t,this.videoNodeDocument=document,this.videoNodeWindow=window)}catch(e){this.videoNodeDocument=document,this.videoNodeWindow=window}var c={};"function"==typeof this.service.videoElementsCallback&&(c=this.service.videoElementsCallback()),this.videoInfo=this.decodeVideoInfos(n);var u={DomID:d,adUID:this.adUID,Duration:this.videoInfo.duration,Payload:e,Dimension:{w:this.videoInfo.w,h:this.videoInfo.h},Position:{x:this.videoInfo.x,y:this.videoInfo.y}};void 0!==c.videoElement&&(u.videoElement=c.videoElement),void 0!==c.videoContainer&&(u.videoContainer=c.videoContainer),this.log(i.INFO,"ANVideoViewabilityTracker start with parameters",u);try{if(void 0===this.videoNodeWindow.anxVVAPICache){this.videoNodeWindow.anxVVAPICache={events:Array(),init:Array()};var p=this.videoNodeDocument.createElement("script");p.type="text/javascript",p.async=!0,p.src=this.viewabilityData.vjs,p.readyState&&(p.onreadystatechange=function(){"loaded"!=p.readyState&&"complete"!=p.readyState||(p.onreadystatechange=null)}),p.onerror=function(){this.log(i.DEBUG,"script load onerror"),this.error(o.FAILED_TO_LOAD_VIEWABILITY_JS,"ANVideoViewabilityTracker failed to load viewability script ("+p.src+")."),this.viewabilityMeasurementActive=!1}.bind(this),this.videoNodeDocument.getElementsByTagName("head")[0].appendChild(p)}}catch(e){this.error(o.INITIALIZATION_FAILED,{message:"ANVideoViewabilityTracker initialization failed",exception:e})}if(this.extractVersionModule(this.viewabilityData),void 0===this.videoNodeWindow.anxVVAPI){var h={a:this.adUID,params:this.viewabilityData.viewParams,id:d,v:this.VIEWABILITY_MODULE_VERSION,dur:this.videoInfo.duration,w:this.videoInfo.w,h:this.videoInfo.h,x:this.videoInfo.x,y:this.videoInfo.y};void 0!==c.videoElement&&(h.videoElement=c.videoElement),void 0!==c.videoContainer&&(h.videoContainer=c.videoContainer),this.videoNodeWindow.anxVVAPICache.init.push(h)}else this.videoNodeWindow.anxVVAPI.initializeFromParams(this.viewabilityData.viewParams,d,this.adUID,this.VIEWABILITY_MODULE_VERSION,this.videoInfo.duration,this.videoInfo.w,this.videoInfo.h,this.videoInfo.x,this.videoInfo.y,c.videoElement,c.videoContainer);null!==a&&this.onVolumeChange(a),null!==s&&this.onViewModeChange(s)}else this.viewabilityMeasurementActive=!1};a.prototype={VIEWABILITY_MODULE_VERSION:1,log:function(e,t,n){"use strict";if(this.service.loggerCallback)try{this.service.loggerCallback(e,"[AppNexus] "+t,n)}catch(e){console.trace(e)}},error:function(e,t,n){"use strict";if(this.service.errorCallback)try{this.service.errorCallback(e,t,n)}catch(e){console.trace(e)}else this.log(i.ERROR,"ERR-"+e+": "+t,n)},parseUrl:function(e){"use strict";var t={http:"",params:""};try{if(e&&"string"==typeof e){var n=e.split(/:/);if(2===n.length&&(e=n[1],t.http=n[0]),2===(n=e.split(/\?/)).length?t.params=n[1]:(""===t.http||"//"!==e.substr(0,2))&&e.indexOf("=")>-1&&(t.params=n[0]),""!==t.params)for(var r in n=t.params.split(/&/),t.params={},n){var o=n[r].split(/=/);if(2===o.length)t.params[o[0]]=decodeURIComponent(o[1]);else if(o.length>2){for(var a="",s=1;s<o.length;s++)a+="="+o[s];t.params[o[0]]=decodeURIComponent(a.substr(1))}else t.params[o[0]]=""}}}catch(e){this.log(i.DEBUG,e)}return t},parseConfigs:function(e){"use strict";try{if(e&&"string"==typeof e){"<![CDATA["===e.substring(0,9)&&(e=e.substring(9,e.length-3));var t=this.parseUrl(e);if(t.hasOwnProperty("params")&&""!==t.params)return t.params}}catch(t){return this.log(i.DEBUG,"Error parsing config:"+e),void this.log(i.DEBUG,t)}return this.error(o.NO_VIEWABILITY_DATA,"No viewability data provided"),null},createViewabilityConfig:function(e){var t,n=[],i=!1;for(t in e){var r=e[t];switch(t){case"cb":r||(this.error(o.MISSING_MANDATORY_PARAMETER_CB,"Missing mandatory parameter: "+t+"."),i=!0);break;case"rdcb":r||(this.error(o.MISSING_MANDATORY_PARAMETER_RDCB,"Missing mandatory parameter: "+t+"."),i=!0);break;case"vc":r||(this.error(o.MISSING_MANDATORY_PARAMETER_VC,"Missing mandatory parameter: "+t+"."),i=!0);var a=r.split(/;/);n.push("vc="+encodeURIComponent(a[0]));for(var s=1;s<a.length;s++)n.push(a[s]);continue}n.push(t+"="+encodeURIComponent(r))}return!0===i?null:(n.sort(),n.join("&"))},decodePayload:function(e){"use strict";var t=this.parseConfigs(e);if(!t)return null;var n=this.createViewabilityConfig(t);if(!n)return null;var i={viewParams:n};return t.hasOwnProperty("vjs")&&""!==t.vjs?(i.vjs=t.vjs,t.hasOwnProperty("vid_context")&&(i.contextKey=t.vid_context),i):(this.error(o.MISSING_MANDATORY_PARAMETER_JS,"no viewability script js to load"),this.viewabilityMeasurementActive=!1,null)},decodeVideoInfos:function(e){"use strict";var t={duration:0,w:0,h:0,x:0,y:0};return("number"==typeof e.duration||e.duration>0)&&(t.duration=e.duration),("number"==typeof e.w||e.w>0)&&(t.w=e.w),("number"==typeof e.h||e.h>0)&&(t.h=e.h),("number"==typeof e.x||e.x>0)&&(t.x=e.x),("number"==typeof e.y||e.y>0)&&(t.y=e.y),t},extractVersionModule:function(e){"use strict";if(e){var t=/.+\/(\d+)\/trk\.js/.exec(e.viewJS);t&&t[1]&&(this.VIEWABILITY_MODULE_VERSION=t[1])}},notifyEvent:function(e){"use strict";if(this.viewabilityMeasurementActive){switch(this.log(i.INFO,"notifyEvent: ["+e+"]"),"an_outstream"==this.contextKey&&"sound_off"==e&&(e="sound_on"),e){case"fullscreen":e="expand";break;case"exitFullscreen":e="collapse";break;case"expand":case"collapse":return}var t=(new Date).getTime();try{if(void 0===this.videoNodeWindow.anxVVAPI){var n={a:this.adUID,c:e,d:t};this.videoNodeWindow.anxVVAPICache.events.push(n)}else this.videoNodeWindow.anxVVAPI.notifyEvent(this.adUID,e)}catch(e){this.log(i.DEBUG,{message:"notifyEvent failed",exception:e})}}else this.log(i.INFO,"notifyEvent cancelled because viewability is not active")},lastKnownVolume:-1,onVolumeChange:function(e){"use strict";this.viewabilityMeasurementActive?(e>1&&(e=1),e<0&&(e=0),e!==this.lastKnownVolume&&(e>0?this.notifyEvent("sound_on"):this.notifyEvent("sound_off"),this.lastKnownVolume=e)):this.log(i.INFO,"onVolumeChange cancelled because viewability is not active")},onViewModeChange:function(e){"use strict";this.viewabilityMeasurementActive?e==r.NORMAL?this.notifyEvent("exitFullscreen"):this.notifyEvent("fullscreen"):this.log(i.INFO,"onViewModeChange cancelled because viewability is not active")}},e.exports=a,e.exports.LOG_LEVEL=i,e.exports.ERROR_CODE=o},function(e,t){e.exports.LOG_LEVEL={DEBUG:"debug",INFO:"info",ERROR:"error"},e.exports.VIEW_EVENT={START:"start",STOP:"stop",PAUSE:"pause",RESUME:"resume",FULL_SCREEN:"fullscreen",EXIT_FULL_SCREEN:"exitFullscreen",CLICK:"click",SOUND_OFF:"sound_off",SOUND_ON:"sound_on"},e.exports.VPAID_EVENT={Ad_Loaded:"AdLoaded",Ad_Started:"AdStarted",Ad_Stopped:"AdStopped",Ad_Skipped:"AdSkipped",Ad_Skippable_State_Change:"AdSkippableStateChange",Ad_Size_Change:"AdSizeChange",Ad_Linear_Change:"AdLinearChange",Ad_Duration_Change:"AdDurationChange",Ad_Expanded_Change:"AdExpandedChange",Ad_Remaining_Time_Change:"AdRemainingTimeChange",Ad_Volume_Change:"AdVolumeChange",Ad_Impression:"AdImpression",Ad_Video_Start:"AdVideoStart",Ad_Video_First_Quartile:"AdVideoFirstQuartile",Ad_Video_Midpoint:"AdVideoMidpoint",Ad_Video_Third_Quartile:"AdVideoThirdQuartile",Ad_Video_Complete:"AdVideoComplete",Ad_Click_Thru:"AdClickThru",Ad_Interaction:"AdInteraction",Ad_User_Accept_Invitation:"AdUserAcceptInvitation",Ad_User_Minimize:"AdUserMinimize",Ad_User_Close:"AdUserClose",Ad_Paused:"AdPaused",Ad_Playing:"AdPlaying",Ad_Log:"AdLog",Ad_Error:"AdError"},e.exports.VIEW_MODE={NORMAL:"normal",FULL_SCREEN:"fullscreen"},e.exports.MODULE={APPNEXUS:1,MOAT_ANALYTICS:2,MOAT_ETMP:3}},function(e,t,n){var i=n(71).LOG_LEVEL,r={BAD_CONFIG:1,LIBRARY_LOADING_ERROR:2,INITIALIZATION_ERROR:3},o={ANALYTICS:{id:1,name:"analytics",parameters:{advid:"level1",cpgid:"level2",cpid:"level3",crid:"level4",buyid:"zMoatMBRID",selid:"zMoatSELL",pubid:"zMoatPUB",tagid:"zMoatTAG"}},ETMP:{id:2,name:"ETMP",parameters:{buyid:"level1",advid:"level2",cpgid:"level3",cpid:"level4",selid:"slicer1",pubid:"slicer2",tagid:"slicer3",crid:"zMoatCRID",aet:"zMoatAET",aecb:"zMoatAECB"}}},a=function(e,t,n,a,s,l,d){"use strict";this.debug=d,this.hasError=!1,this.config={},this.service=l||{},this.modeName="-";var c={container:n,param:a,mode:s,service:l};for(var u in c)c.hasOwnProperty(u)&&(c[u]||(this.hasError=!0,this.log(i.ERROR,"Invalid parameter '"+u+"'='"+c[u]+"'")));if(s)switch(s.id){case o.ANALYTICS.id:case o.ETMP.id:this.modeName=s.name;break;default:this.hasError=!0,this.log(i.ERROR,"Invalid 'mode' value='"+s.id+"'")}if(l&&(l.loggerCallback&&"function"==typeof l.loggerCallback||(this.hasError=!0,this.log(i.ERROR,"Service do not implement 'loggerCallback' API")),l.getVolumeCallback&&"function"==typeof l.getVolumeCallback||(this.hasError=!0,this.log(i.ERROR,"Service do not implement 'getVolumeCallback' API")),!l.errorCallback||"function"!=typeof l.errorCallback))return this.hasError=!0,void this.log(i.ERROR,"Service do not implement 'errorCallback' API");this.hasError?this.service.errorCallback(r.BAD_CONFIG,{mode:this.modeName,message:"Invalid parameter"}):(this.container=n,this.duration=e,this.mediaUrl=t,this.config=this.parseParams(a,s),this.moatApiInstance=null,this.log(i.INFO,"MoatViewabilityTracker start with parameters",{Dom:this.container?this.container.id:"undefined",mediaUrl:this.mediaUrl,duration:this.duration,config:this.config}),this.config&&this.config.hasOwnProperty("partnerCode")?(this.init(),this.log(i.DEBUG,"Module initialized")):(this.log(i.ERROR,"Unable to initialize module (missing config)"),this.service.errorCallback(r.BAD_CONFIG,{mode:this.modeName,message:"Unable to initialize module (missing config)",config:a})))};a.prototype={log:function(e,t,n){"use strict";if(this.service.loggerCallback)try{this.service.loggerCallback(e,"[MOAT/"+this.modeName+"] "+t,n)}catch(e){this.debug&&console.trace(e)}else this.debug&&console.log(e+": "+t,n)},init:function(){"use strict";try{this.moatApiInstance=this.initMoatTracking(this.container,this.config.moatConfig,this.duration,this.config.partnerCode,this.mediaUrl),this.moatApiInstance?this.log(i.DEBUG,"Module loading done"):(this.log(i.ERROR,"Module loading failed"),this.service.errorCallback(r.LIBRARY_LOADING_ERROR,{mode:this.modeName,message:"Module loading failed"}))}catch(e){this.log(i.ERROR,"Module initialization failed:",e),this.service.errorCallback(r.INITIALIZATION_ERROR,{mode:this.modeName,message:e.message})}},notifyVPAIDEvent:function(e){"use strict";this.moatApiInstance&&(this.log(i.INFO,"notifyVPAIDEvent: ["+e+"]"),this.moatApiInstance.dispatchEvent({type:e,adVolume:this.service.getVolumeCallback()}))},parseParams:function(e,t){"use strict";if(this.debug&&this.log(i.DEBUG,"Received params",{params:e,mode:t.name}),e&&"string"==typeof e){var n={},r=e.split(/&/);for(var a in r){var s=r[a].split(/=/);2==s.length?n[s[0]]=s[1]:n[s[0]]=""}var l=!0,d={partnerCode:null,mode:t,moatConfig:{}},c="partnercode";this.sanityCheck(c,n)?d.partnerCode=n[c]:t.id==o.ANALYTICS.id?(d.partnerCode="appnexusvpaidvideo274177211956",d.moatConfig.slicer1="",d.moatConfig.slicer2=""):(l=!1,this.log(i.ERROR,"Invalid parameter detected '"+c+"'='"+n[c]+"'"));c="mbrid";this.sanityCheck(c,n)&&(n.buyid=n[c]);for(var u={},p=Object.keys(t.parameters),h=0;h<p.length;h++)u[p[h]]=t.parameters[p[h]];p=Object.keys(u);for(var f=0;f<p.length;f++){var v=p[f],m=u[v];this.sanityCheck(v,n)?d.moatConfig[m]=decodeURIComponent(n[v]):(this.log(i.ERROR,"Invalid parameter detected: '"+v+"', value='"+n[v]+"'"),l=!1)}if(l)return d}return this.log(i.ERROR,"Invalid parameters received/parsed"),null},sanityCheck:function(e,t){"use strict";return t.hasOwnProperty(e)&&""!==t[e]},initMoatTracking:function(e,t,n,i,r,o){var a,s,l=document.createElement("script"),d=[];t={adData:{ids:t,duration:n,url:r},dispatchEvent:function(e){this.sendEvent?(d&&(d.push(e),e=d,d=!1),this.sendEvent(e)):d&&d.push(e)},clientCallback:o},n="_moatApi"+Math.floor(1e8*Math.random());try{s=(a=e.ownerDocument).defaultView||a.parentWindow}catch(e){a=document,s=window}return s[n]=t,l.type="text/javascript",e&&e.insertBefore(l,e.childNodes[0]||null),l.src="https://z.moatads.com/"+i+"/moatvideo.js#"+n,t}},e.exports=a,e.exports.LOG_LEVEL=i,e.exports.ERROR_CODE=r,e.exports.MODE=o,e.exports.MODE_PARAMETERS={partnerCode:""}},function(e,t,n){var i,r=n(74),o="https://acdn.adnxs-simple.com/video/static/res/b2.mp4",a=function(e){r.verbose("[AutoplayHandler]",e)},s=function(e){r.error("[AutoplayHandler]",e)},l=function(e){r.warn("[AutoplayHandler]",e)},d=function(e){r.info("[AutoplayHandler]",e)},c=!1,u="https://acdn.adnxs-simple.com/video/static/res/av2.mp4",p={},h={stopMediaWithSound:1,neverAutoplay:2,allowAutoplay:3},f=n(75)(),v=function(){var e="safari";try{var t=navigator.platform,n=navigator.userAgent,i=navigator.appVersion;if(/CriOS/.test(n)&&(e="chrome"),/iP(hone|od|ad)/.test(t)){var r=i.match(/OS (\d+)_(\d+)_?(\d+)?/);return[parseInt(r[1],10),parseInt(r[2],10),parseInt(r[3]||0,10),e]}return[0,0,0,e]}catch(t){return s(t),[0,0,0,e]}},m=function(){return/iphone/i.test(navigator.userAgent.toLowerCase())||/ipad/i.test(navigator.userAgent.toLowerCase())},g=function(){var e=v();if(e&&Array.isArray(e)&&e.length>=4){var t=e[0];return"chrome"===e[3]&&10===t&&53===function(){var e=-1;if(m())try{var t=navigator.userAgent.match(/CriOS\/([0-9]+)\./);t&&Array.isArray(t)&&t.length>1&&(e=parseInt(t[1]))}catch(e){a(e)}return e}()}},y=function(e,t,n,i){var r=e.length,s=0,d=function(e){s===r&&"function"==typeof n&&(c=!0,l("set hasDoneFakingAutoStartForAndroid = true by "+e),n())},u=function(e,t,n){try{var r,u,p=e.contentWindow;if(!p.apn_mobile_video_placements)r=p.document.createElement("video"),p.document.body.appendChild(r),r.src=o,r.muted=!0,u=r.play(),r.pause(),void 0!==u&&u.then((function(){a("video promise done successfully by "+n),s++,d("promise done")})).catch((function(o){var a=o.code,u=o.name,h=o.message;0===a?(l("playback failed : "+a+","+u+","+h+" by "+n),function(e,t,n){l("removing failed iframe #"+(t+1)+" by "+n),document.getElementById(i).removeChild(e)}(e,t,n)):(l("waterfall steps #"+(Number(s)+1)+" by "+n+" : autoplay trick's possible due to video promise be caught with "+o.name),function(e,t,n){c||(l("successfully performed autoplay trick by "+t),n.apn_mobile_video_placements=e,s++,d(t))}(r,n,p))}))}catch(e){a(e)}};e.forEach((function(e,n){u(e,n,t)}))},b=function(){var e=navigator.appVersion.indexOf("Mobile"),t=navigator.appVersion.indexOf("Android");return e>-1||t>-1},A=function(){return/android/i.test(navigator.userAgent.toLowerCase())},w=function(){var e=-1;if(A())try{var t=navigator.userAgent.match(/Chrome\/([0-9]+)\./);t&&Array.isArray(t)&&t.length>1&&(e=parseInt(t[1]))}catch(e){a(e)}return e},T=function(e,t,n,i){if(!1===A())return!1;var r=e&&"auto"===e,o=t&&"on"===t;return w()>=53?!(!o||!r||n)||!(!r||!i||n):w()<=52?!(!r||n):void 0},k=function(e){d("Start to detect Android Data Saver option in this device");var t,n=window.document.createElement("video"),i=function(e){try{e&&document.body.removeChild(e)}catch(e){a(e)}};try{n.src=o,n.muted=!0,document.body.appendChild(n),void 0!==(t=n.play())&&t.then((function(){d("Android Data Saver option isn't detected in this device"),i(n),e(!1)})).catch((function(){d("Android Data Saver option is detected in this device, so auto-play will be initiated by user's activity like touch"),i(n),e(!0)}))}catch(t){a(t),d("failed to detect Android Data Saver option in this device, so auto-play will be initiated by user's activity like touch"),i(n),e(!0)}},E=function(e,t,n,i,r,o){if(!c){a("create iframes for Android autoplay by "+e);var s=1;a("total "+(s=n&&-1!==n?n+1:i)+" iframes will be made by waterfall structure with "+e+" event");for(var l=[],d=0;d<s;d++){var u="";u=0===d?"iframeVideoWrapper":"iframeVideoWrapper_Waterfall_"+d;var p=document.createElement("iframe");o&&o instanceof Element?o.querySelector("#"+String(r)).appendChild(p):document.getElementById(r).appendChild(p);p.contentWindow.document.open(),p.contentWindow.document.write("<html></html>"),p.contentWindow.document.close(),p.name=u,p.style.display="none",a("iframes injected for waterfall steps #"+(d+1)+" by "+e),l.push(p)}l&&Array.isArray(l)&&l.length>=1&&"general"!==e?y(l,e,t,r):"function"==typeof t&&t()}},S=function(e,t,n,r){var o,s=f.browser.name.toLowerCase(),l=!(!f.os||"Android"!==f.os.name||!parseInt||"function"!=typeof parseInt||5!==parseInt(f.os.version));if(a("hasMaxLimitOnVideo: "+l),m())return p[r]=!0,void t(n);if("firefox"===s)(i=document.createElement("video")).style.width="1px",i.style.height="1px",i.src=e,i.id=r,i.setAttribute("playsinline",""),document.body.appendChild(i);else{var d=document.createElement("iframe");d.style.display="none",d.id="iframe_"+r,document.body.appendChild(d),l&&i||(i=document.createElement("video")),i.style.width="1px",i.style.height="1px",i.src=e,i.id=r,i.setAttribute("playsinline",""),d.contentWindow.document.body.appendChild(i)}i.muted=n,!1===n&&i.volume&&(i.volume=.001),void 0!==(o=i.play())?o.then((function(){p[r]=!0,a("video promise succeeded: "+r+", muted="+n),t(!0)})).catch((function(e){var i=e.code,o=e.name,s=e.message;a("video promise failed: "+r+", muted="+n+","+i+","+o+","+s),p[r]=!0,t(!1)})):(p[r]=!0,t(!0))};e.exports={APN_MOBILE_VIDEO_PLACEMENT_ID:"apn_mobile_video_placements",APN_MOBILE_IFRAME_NAME:"iframeVideoWrapper",initialize:function(e){try{var t=e.targetElementId,n=e.windowForPublisher,i=e.callbackAdUnitEntryPoint,r=e.callbackPatchForIOSChrome,o=e.waterfallSteps,s=e.maxWaterfallIframes,l=e.initialPlayback,d=e.initialAudio,c=e.automatedTestingOnlyAndroidSkipTouchStart,u=e.androidDSOverride,p=e.wcElement;b()?A()?(a("intialize for Android"),k((function(e){var r=e;if(!1===u&&e&&w()<=55&&"on"===d&&"auto"===l)i(!1,!0);else if(!1===u&&(e=!1),w()<56&&T(l,d,c,e)){var a=function(e){E(e,(function(){i(!1,!1)}),o,s,t,p)};n.addEventListener("touchstart",(function(){a("touchstart")}),{passive:!0}),n.addEventListener("touchend",(function(){setTimeout((function(){a("touchend")}),1)}),{passive:!0})}else{var h,f;w()>=56?(h="on"===d&&"auto"===l&&!1===r,f="auto"===l&&!0===r):f="auto"===l&&!0===r,E("general",(function(){i(h,f)}),o,s,t,p)}}))):(a("intialize for iOS and etc"),i(!1),g()&&r&&"function"==typeof r&&n.addEventListener("touchstart",r)):(a("initialize for general html5 browsers"),i(!1))}catch(t){a(t),e.callbackAdUnitEntryPoint&&"function"==typeof e.callbackAdUnitEntryPoint&&e.callbackAdUnitEntryPoint(!1)}},iOSversion:v,isIOS:m,isIosInlineRequired:function(e){var t;try{t=v()[0]>=8&&!0===e}catch(e){s(e)}return t},isRequiredFakeAndroidAutoStart:T,isMobile:b,testDataSaverForAndroid:k,getAutoplayPolicy:function(e,t){var n,i;void 0===t&&(t=!1),n="videoPlacementTest_"+(new Date).getTime()+Math.floor(1e4*Math.random()),i="videoPlacementTest_"+(new Date).getTime()+Math.floor(1e4*Math.random()),(p={})[n]=!1,p[i]=!1,t?S(u,(function(t){!0===t?(a("decided to allowAutoplay"),e(h.allowAutoplay)):S(u,(function(t){!0===t?(a("decided to stopMediaWithSound"),e(h.stopMediaWithSound)):(a("decided to neverAutoplay"),e(h.neverAutoplay))}),!0,i)}),!1,n):S(u,(function(t){!0===t?(a("decided to stopMediaWithSound"),e(h.stopMediaWithSound)):(a("decided to neverAutoplay"),e(h.neverAutoplay))}),!0,i);var r=function(){document.removeEventListener("onFocus",r),setTimeout((function(){var r=document,o=document.getElementById("iframe_"+n);o&&(r=o.contentWindow.document);var s=r.getElementById(n),l=r.getElementById(i);s&&s.parentNode&&(s.parentNode.removeChild(s),a("remove test video placement :"+n)),l&&l.parentNode&&(l.parentNode.removeChild(l),a("remove test video placement for sound on case :"+i)),t?!1===p[n]&&!1===p[i]&&(a("timeout video test"),a("decided to neverAutoplay"),e(h.neverAutoplay)):!1===p[i]&&(a("timeout video test"),a("decided to neverAutoplay"),e(h.neverAutoplay))}),5e3)};document.hasFocus()?r():document.addEventListener("onFocus",r)},videoPolicy:h}},function(e,t){var n=0,i=0,r=0,o=!1;function a(e,t){try{if(void 0!==e&&d(e)&&console){var n=o?"[XandrVideo":"[APN",i=function(e){switch(e){case 0:break;case 1:return"always";case 2:return"error";case 3:return"warn";case 4:return"info";case 5:return"log";case 6:return"debug";case 7:return"verbose"}}(e);if(console[i]||(n+="-"+i,i="log"),n+="]",n+="["+function(){var e="";try{var t=new Date;e=t.getHours()+":"+t.getMinutes()+":"+t.getSeconds()+"."+t.getMilliseconds()}catch(e){}return e}()+"]",t.splice(0,0,n),console[i].apply)console[i].apply(console,t);else{var r=Array.prototype.slice.apply(t).join("");console[i](r)}}}catch(e){}}function s(e){try{var t="";try{t=window.top.location.search}catch(e){try{t=window.location.search}catch(e){}}var n=new RegExp("[\\?&]"+e+"=([^&#]*)").exec(t);return null===n?"":decodeURIComponent(n[1].replace(/\+/g," "))}catch(e){return""}}function l(e){var t=0;try{if(void 0!==e){var n=parseInt(e);isNaN(n)?"boolean"==typeof e?t=e?6:0:"TRUE"===(e=e.toUpperCase())?t=6:"FALSE"===e&&(t=0):t=n}}catch(e){}return t}function d(e){return e<=n}e.exports={traceAtLevel:function(){try{if(arguments.length>0){var e=arguments[0],t=Array.prototype.slice.call(arguments,1);a.call(this,e,t)}}catch(e){}},always:function(){try{a.call(this,1,Array.prototype.slice.call(arguments))}catch(e){}},error:function(){try{a.call(this,2,Array.prototype.slice.call(arguments))}catch(e){}},log:function(){try{a.call(this,5,Array.prototype.slice.call(arguments))}catch(e){}},warn:function(){try{a.call(this,3,Array.prototype.slice.call(arguments))}catch(e){}},info:function(){try{a.call(this,4,Array.prototype.slice.call(arguments))}catch(e){}},debug:function(){try{a.call(this,6,Array.prototype.slice.call(arguments))}catch(e){}},verbose:function(){try{a.call(this,6,Array.prototype.slice.call(arguments))}catch(e){}},handleLogDebugLegacySupport:function(e,t){try{!function(e,t,n){try{var i="[APN-"+e+"-"+(new Date).toISOString()+"] ";null!==n&&n&&n.length>0&&(i+=n+">"),i+=t,d(e)&&console.log(i)}catch(t){d(e)&&console.log(t)}}(5,e,t)}catch(e){}},setDebugLevel:function(e){try{!function(e){try{r=l(e),n=Math.max(Math.max(i,r),n)}catch(e){}}(e)}catch(e){}},isTraceLevelActive:function(e){try{return d(e)}catch(e){return!1}},TRACE_LEVEL_ALWAYS:1,TRACE_LEVEL_ERROR:2,TRACE_LEVEL_WARN:3,TRACE_LEVEL_INFO:4,TRACE_LEVEL_LOG:5,TRACE_LEVEL_DEBUG:6,TRACE_LEVEL_VERBOSE:6},function(){try{var e=s("xdr_debug").toUpperCase();e&&e.length>0?(i=l(e),o=!0):i=l(s("ast_debug").toUpperCase()),n=Math.max(i,n)}catch(e){}}()},function(e,t,n){n(74).always("UserAgentParser","Version 0.0.1");var i=function(e,t){var n="model",r="name",o="type",a="vendor",s="version",l="mobile",d="tablet",c={extend:function(e,t){var n={};for(var i in e)t[i]&&t[i].length%2==0?n[i]=t[i].concat(e[i]):n[i]=e[i];return n},has:function(e,t){return"string"==typeof e&&-1!==t.toLowerCase().indexOf(e.toLowerCase())},lowerize:function(e){return e.toLowerCase()},major:function(e){return"string"==typeof e?e.replace(/[^\d\.]/g,"").split(".")[0]:void 0},trim:function(e){return e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")}},u={rgx:function(){var e,t,n,i,r,o,a={},s=0,l=arguments;for(n=0;n<l[1].length;n++)a["object"==typeof(i=l[1][n])?i[0]:i]=void 0;for(;s<l.length&&!r;){var d=l[s],c=l[s+1];for(e=t=0;e<d.length&&!r;)if(r=d[e++].exec(this.getUA()))for(n=0;n<c.length;n++)o=r[++t],"object"==typeof(i=c[n])&&i.length>0?2===i.length?"function"==typeof i[1]?a[i[0]]=i[1].call(this,o):a[i[0]]=i[1]:3===i.length?"function"!=typeof i[1]||i[1].exec&&i[1].test?a[i[0]]=o?o.replace(i[1],i[2]):void 0:a[i[0]]=o?i[1].call(this,o,i[2]):void 0:4===i.length&&(a[i[0]]=o?i[3].call(this,o.replace(i[1],i[2])):void 0):a[i]=o||void 0;s+=2}return a},str:function(e,t){for(var n in t)if("object"==typeof t[n]&&t[n].length>0){for(var i=0;i<t[n].length;i++)if(c.has(t[n][i],e))return"?"===n?void 0:n}else if(c.has(t[n],e))return"?"===n?void 0:n;return e}},p={browser:{oldsafari:{version:{"1.0":"/8",1.2:"/1",1.3:"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"}}},device:{amazon:{model:{"Fire Phone":["SD","KF"]}},sprint:{model:{"Evo Shift 4G":"7373KT"},vendor:{HTC:"APA",Sprint:"Sprint"}}},os:{windows:{version:{XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0",7:"NT 6.1",8:"NT 6.2",8.1:"NT 6.3",10:["NT 6.4","NT 10.0"],RT:"ARM"}}}},h={browser:[[/(opera\smini)\/([\w\.-]+)/i,/(opera\s[mobiletab]+).+version\/([\w\.-]+)/i,/(opera).+version\/([\w\.]+)/i,/(opera)[\/\s]+([\w\.]+)/i],[r,s],[/(opios)[\/\s]+([\w\.]+)/i],[[r,"Opera Mini"],s],[/\s(opr)\/([\w\.]+)/i],[[r,"Opera"],s],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer)[\/\s]?([\w\.]+)*/i,/(avant\s|iemobile|slim|baidu)(?:browser)?[\/\s]?([\w\.]*)/i,/(?:ms|\()(ie)\s([\w\.]+)/i,/(rekonq)\/([\w\.]+)*/i,/(chromium|flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs)\/([\w\.-]+)/i],[r,s],[/(trident).+rv[:\s]([\w\.]+).+like\sgecko/i],[[r,"IE"],s],[/(edge)\/((\d+)?[\w\.]+)/i],[r,s],[/(yabrowser)\/([\w\.]+)/i],[[r,"Yandex"],s],[/(comodo_dragon)\/([\w\.]+)/i],[[r,/_/g," "],s],[/(micromessenger)\/([\w\.]+)/i],[[r,"WeChat"],s],[/xiaomi\/miuibrowser\/([\w\.]+)/i],[s,[r,"MIUI Browser"]],[/\swv\).+(chrome)\/([\w\.]+)/i],[[r,/(.+)/,"$1 WebView"],s],[/android.+samsungbrowser\/([\w\.]+)/i,/android.+version\/([\w\.]+)\s+(?:mobile\s?safari|safari)*/i],[s,[r,"Android Browser"]],[/(chrome|omniweb|arora|[tizenoka]{5}\s?browser)\/v?([\w\.]+)/i,/(qqbrowser)[\/\s]?([\w\.]+)/i],[r,s],[/(uc\s?browser)[\/\s]?([\w\.]+)/i,/ucweb.+(ucbrowser)[\/\s]?([\w\.]+)/i,/juc.+(ucweb)[\/\s]?([\w\.]+)/i],[[r,"UCBrowser"],s],[/(dolfin)\/([\w\.]+)/i],[[r,"Dolphin"],s],[/((?:android.+)crmo|crios)\/([\w\.]+)/i],[[r,"Chrome"],s],[/;fbav\/([\w\.]+);/i],[s,[r,"Facebook"]],[/fxios\/([\w\.-]+)/i],[s,[r,"Firefox"]],[/version\/([\w\.]+).+?mobile\/\w+\s(safari)/i],[s,[r,"Mobile Safari"]],[/version\/([\w\.]+).+?(mobile\s?safari|safari)/i],[s,r],[/webkit.+?(mobile\s?safari|safari)(\/[\w\.]+)/i],[r,[s,u.str,p.browser.oldsafari.version]],[/(konqueror)\/([\w\.]+)/i,/(webkit|khtml)\/([\w\.]+)/i],[r,s],[/(navigator|netscape)\/([\w\.-]+)/i],[[r,"Netscape"],s],[/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo\sbrowser|minimo|conkeror)[\/\s]?([\w\.\+]+)/i,/(firefox|seamonkey|k-meleon|icecat|iceape|firebird|phoenix)\/([\w\.-]+)/i,/(mozilla)\/([\w\.]+).+rv\:.+gecko\/\d+/i,/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|sleipnir)[\/\s]?([\w\.]+)/i,/(links)\s\(([\w\.]+)/i,/(gobrowser)\/?([\w\.]+)*/i,/(ice\s?browser)\/v?([\w\._]+)/i,/(mosaic)[\/\s]([\w\.]+)/i],[r,s]],device:[[/\((ipad|playbook);[\w\s\);-]+(rim|apple)/i],[n,a,[o,d]],[/applecoremedia\/[\w\.]+ \((ipad)/],[n,[a,"Apple"],[o,d]],[/(apple\s{0,1}tv)/i],[[n,"Apple TV"],[a,"Apple"]],[/(archos)\s(gamepad2?)/i,/(hp).+(touchpad)/i,/(hp).+(tablet)/i,/(kindle)\/([\w\.]+)/i,/\s(nook)[\w\s]+build\/(\w+)/i,/(dell)\s(strea[kpr\s\d]*[\dko])/i],[a,n,[o,d]],[/(kf[A-z]+)\sbuild\/[\w\.]+.*silk\//i],[n,[a,"Amazon"],[o,d]],[/(sd|kf)[0349hijorstuw]+\sbuild\/[\w\.]+.*silk\//i],[[n,u.str,p.device.amazon.model],[a,"Amazon"],[o,l]],[/\((ip[honed|\s\w*]+);.+(apple)/i],[n,a,[o,l]],[/\((ip[honed|\s\w*]+);/i],[n,[a,"Apple"],[o,l]],[/(blackberry)[\s-]?(\w+)/i,/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|huawei|meizu|motorola|polytron)[\s_-]?([\w-]+)*/i,/(hp)\s([\w\s]+\w)/i,/(asus)-?(\w+)/i],[a,n,[o,l]],[/\(bb10;\s(\w+)/i],[n,[a,"BlackBerry"],[o,l]],[/android.+(transfo[prime\s]{4,10}\s\w+|eeepc|slider\s\w+|nexus 7|padfone)/i],[n,[a,"Asus"],[o,d]],[/(sony)\s(tablet\s[ps])\sbuild\//i,/(sony)?(?:sgp.+)\sbuild\//i],[[a,"Sony"],[n,"Xperia Tablet"],[o,d]],[/(?:sony)?(?:(?:(?:c|d)\d{4})|(?:so[-l].+))\sbuild\//i],[[a,"Sony"],[n,"Xperia Phone"],[o,l]],[/\s(ouya)\s/i,/(nintendo)\s([wids3u]+)/i],[a,n,[o,"console"]],[/android.+;\s(shield)\sbuild/i],[n,[a,"Nvidia"],[o,"console"]],[/(playstation\s[34portablevi]+)/i],[n,[a,"Sony"],[o,"console"]],[/(sprint\s(\w+))/i],[[a,u.str,p.device.sprint.vendor],[n,u.str,p.device.sprint.model],[o,l]],[/(lenovo)\s?(S(?:5000|6000)+(?:[-][\w+]))/i],[a,n,[o,d]],[/(htc)[;_\s-]+([\w\s]+(?=\))|\w+)*/i,/(zte)-(\w+)*/i,/(alcatel|geeksphone|huawei|lenovo|nexian|panasonic|(?=;\s)sony)[_\s-]?([\w-]+)*/i],[a,[n,/_/g," "],[o,l]],[/(nexus\s9)/i],[n,[a,"HTC"],[o,d]],[/(nexus\s6p)/i],[n,[a,"Huawei"],[o,l]],[/(microsoft);\s(lumia[\s\w]+)/i],[a,n,[o,l]],[/[\s\(;](xbox(?:\sone)?)[\s\);]/i],[n,[a,"Microsoft"],[o,"console"]],[/(kin\.[onetw]{3})/i],[[n,/\./g," "],[a,"Microsoft"],[o,l]],[/\s(milestone|droid(?:[2-4x]|\s(?:bionic|x2|pro|razr))?(:?\s4g)?)[\w\s]+build\//i,/mot[\s-]?(\w+)*/i,/(XT\d{3,4}) build\//i,/(nexus\s6)/i],[n,[a,"Motorola"],[o,l]],[/android.+\s(mz60\d|xoom[\s2]{0,2})\sbuild\//i],[n,[a,"Motorola"],[o,d]],[/hbbtv\/\d+\.\d+\.\d+\s+\([\w\s]*;\s*(\w[^;]*);([^;]*)/i],[[a,c.trim],[n,c.trim],[o,"smarttv"]],[/hbbtv.+maple;(\d+)/i],[[n,/^/,"SmartTV"],[a,"Samsung"],[o,"smarttv"]],[/\(dtv[\);].+(aquos)/i],[n,[a,"Sharp"],[o,"smarttv"]],[/android.+((sch-i[89]0\d|shw-m380s|gt-p\d{4}|gt-n\d+|sgh-t8[56]9|nexus 10))/i,/((SM-T\w+))/i],[[a,"Samsung"],n,[o,d]],[/smart-tv.+(samsung)/i],[a,[o,"smarttv"],n],[/((s[cgp]h-\w+|gt-\w+|galaxy\snexus|sm-\w[\w\d]+))/i,/(sam[sung]*)[\s-]*(\w+-?[\w-]*)*/i,/sec-((sgh\w+))/i],[[a,"Samsung"],n,[o,l]],[/sie-(\w+)*/i],[n,[a,"Siemens"],[o,l]],[/(maemo|nokia).*(n900|lumia\s\d+)/i,/(nokia)[\s_-]?([\w-]+)*/i],[[a,"Nokia"],n,[o,l]],[/android\s3\.[\s\w;-]{10}(a\d{3})/i],[n,[a,"Acer"],[o,d]],[/android\s3\.[\s\w;-]{10}(lg?)-([06cv9]{3,4})/i],[[a,"LG"],n,[o,d]],[/(lg) netcast\.tv/i],[a,n,[o,"smarttv"]],[/(nexus\s[45])/i,/lg[e;\s\/-]+(\w+)*/i],[n,[a,"LG"],[o,l]],[/android.+(ideatab[a-z0-9\-\s]+)/i],[n,[a,"Lenovo"],[o,d]],[/linux;.+((jolla));/i],[a,n,[o,l]],[/((pebble))app\/[\d\.]+\s/i],[a,n,[o,"wearable"]],[/android.+;\s(glass)\s\d/i],[n,[a,"Google"],[o,"wearable"]],[/android.+;\s(pixel c)\s/i],[n,[a,"Google"],[o,d]],[/android.+;\s(pixel xl|pixel)\s/i],[n,[a,"Google"],[o,l]],[/android.+(\w+)\s+build\/hm\1/i,/android.+(hm[\s\-_]*note?[\s_]*(?:\d\w)?)\s+build/i,/android.+(mi[\s\-_]*(?:one|one[\s_]plus|note lte)?[\s_]*(?:\d\w)?)\s+build/i],[[n,/_/g," "],[a,"Xiaomi"],[o,l]],[/android.+a000(1)\s+build/i],[n,[a,"OnePlus"],[o,l]],[/\s(tablet)[;\/]/i,/\s(mobile)(?:[;\/]|\ssafari)/i],[[o,c.lowerize],a,n]],engine:[[/windows.+\sedge\/([\w\.]+)/i],[s,[r,"EdgeHTML"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m)\/([\w\.]+)/i,/(khtml|tasman|links)[\/\s]\(?([\w\.]+)/i,/(icab)[\/\s]([23]\.[\d\.]+)/i],[r,s],[/rv\:([\w\.]+).*(gecko)/i],[s,r]],os:[[/microsoft\s(windows)\s(vista|xp)/i],[r,s],[/(windows)\snt\s6\.2;\s(arm)/i,/(windows\sphone(?:\sos)*)[\s\/]?([\d\.\s]+\w)*/i,/(windows\smobile|windows)[\s\/]?([ntce\d\.\s]+\w)/i],[r,[s,u.str,p.os.windows.version]],[/(win(?=3|9|n)|win\s9x\s)([nt\d\.]+)/i],[[r,"Windows"],[s,u.str,p.os.windows.version]],[/\((bb)(10);/i],[[r,"BlackBerry"],s],[/(blackberry)\w*\/?([\w\.]+)*/i,/(tizen)[\/\s]([\w\.]+)/i,/(android|webos|palm\sos|qnx|bada|rim\stablet\sos|meego|contiki)[\/\s-]?([\w\.]+)*/i,/linux;.+(sailfish);/i],[r,s],[/(symbian\s?os|symbos|s60(?=;))[\/\s-]?([\w\.]+)*/i],[[r,"Symbian"],s],[/\((series40);/i],[r],[/mozilla.+\(mobile;.+gecko.+firefox/i],[[r,"Firefox OS"],s],[/(nintendo|playstation)\s([wids34portablevu]+)/i,/(mint)[\/\s\(]?(\w+)*/i,/(mageia|vectorlinux)[;\s]/i,/(joli|[kxln]?ubuntu|debian|[open]*suse|gentoo|(?=\s)arch|slackware|fedora|mandriva|centos|pclinuxos|redhat|zenwalk|linpus)[\/\s-]?(?!chrom)([\w\.-]+)*/i,/(hurd|linux)\s?([\w\.]+)*/i,/(gnu)\s?([\w\.]+)*/i],[r,s],[/(cros)\s[\w]+\s([\w\.]+\w)/i],[[r,"Chromium OS"],s],[/(sunos)\s?([\w\.]+\d)*/i],[[r,"Solaris"],s],[/\s([frentopc-]{0,4}bsd|dragonfly)\s?([\w\.]+)*/i],[r,s],[/(haiku)\s(\w+)/i],[r,s],[/(ip[honead]+)(?:.*os\s([\w]+)*\slike\smac|;\sopera)/i],[[r,"iOS"],[s,/_/g,"."]],[/(mac\sos\sx)\s?([\w\s\.]+\w)*/i,/(macintosh|mac(?=_powerpc)\s)/i],[[r,"Mac OS"],[s,/_/g,"."]],[/((?:open)?solaris)[\/\s-]?([\w\.]+)*/i,/(aix)\s((\d)(?=\.|\)|\s)[\w\.]*)*/i,/(plan\s9|minix|beos|os\/2|amigaos|morphos|risc\sos|openvms)/i,/(unix)\s?([\w\.]+)*/i],[r,s]]};if(!(this instanceof i))return new i(e,t).getResult();var f=e||(window&&window.navigator&&window.navigator.userAgent?window.navigator.userAgent:""),v=t?c.extend(h,t):h;return this.getBrowser=function(){var e=u.rgx.apply(this,v.browser);return e.major=c.major(e.version),e},this.getDevice=function(){return u.rgx.apply(this,v.device)},this.getEngine=function(){return u.rgx.apply(this,v.engine)},this.getOS=function(){return u.rgx.apply(this,v.os)},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice()}},this.getUA=function(){return f},this};e.exports=i},function(e,t,n){var i=n(77),r=n(89),o=n(90),a=n(91),s=n(85),l=n(93),d=n(95),c=n(94),u=n(84),p=n(97),h="https://rb.adnxs-simple.com/pack?log=log_rb_video_waterfall_events&format=json",f=function(e){s.debug(e,"AdHandler")},v=0,m=1,g=2,y=3,b=0,A=1,w=2,T=3,k=4,E=5,S=11,C=12;e.exports=function(e,t,n){t._vastObjArr&&Array.isArray(t._vastObjArr)||(t._vastObjArr=[]);var s,I,_,P,j,x=!1,V="2.0",M=(new Date).getTime()+Math.floor(1e4*Math.random()),N=!1,O=!1,D=!1,L=t.waterfallTimeout,R=!1,U=0,B=0,F=0,H=t.waterfallSteps,W=t.disableCollapse&&void 0!==t.disableCollapse.replay,z="",q=!1,G=!1,J=new c;W&&(j=t.disableCollapse.replay);var X,Q,Y=n.cbWhenReady,K=n.cbWhenVideoComplete,$=n.cbWhenAudio,Z=n.cbWhenQuartile,ee=n.cbWhenClickOpenUrl,te=n.cbWhenDestroy,ne=n.cbWhenImpression,ie=n.cbCoreVideoEvent,re={loaded:"loaded","creative-view":"creativeView","video-start":"start","video-mid":"midpoint","video-first-quartile":"firstQuartile","video-third-quartile":"thirdQuartile","video-complete":"complete","audio-mute":"mute","audio-unmute":"unmute","video-pause":"pause",rewind:"rewind","video-resume":"resume","video-fullscreen":"fullscreen","ad-expand":"expand","ad-collapse":"collapse","video-stopped":"close","video-exit-fullscreen":"exitFullscreen","video-skip":"skip","ad-progress":"progress",acceptInvitation:"acceptInvitation",acceptInvitationLinear:"acceptInvitationLinear",closeLinear:"closeLinear",impression:"impression",error:"error","video-failed":"error","ad-click":"ClickTracking","volume-change":"volumeChange"},oe=!1,ae=[],se=[],le=null,de=null,ce=null,ue=null,pe=!!(t&&t.viewability&&t.viewability.config),he={},fe=function(){return/iphone/i.test(navigator.userAgent.toLowerCase())||/ipad/i.test(navigator.userAgent.toLowerCase())},ve=function(e,n,i){try{if(t.hasOwnProperty("clientUA"))if(0===t.clientUA.indexOf("Vast Video Player"))return void f("Do not report to Ratbait for all endpoints in Xandr Vast Player");if(!e)throw new Error("vastObj required to track waterfall step");if(e.notImpbusWaterfall)return void f("Do not report to Ratbait for non-impbus waterfall");if(e.hasOwnProperty("fallbackIndex"))return void f("Do not report waterfall data to RATBAIT in fallback mode");var r=e.creative_id,o="",a="",l="",d=!1;if(I&&u&&u.loadPost&&"function"==typeof u.loadPost){if(!t)throw new Error("options required to track waterfall steps");switch(n){case 1:o=v,I.startWFStepTimer=(new Date).getTime();break;case 7:o=g;break;case 8:o=y,a=S;break;case 9:o=y,a=C,d=!0;break;case 10:o=g,a=E;break;case 11:o=m,a=E;break;case 6:o=g,a=T,d=!0;break;case 2:o=m,a=A;break;default:o=m}if(o===m)switch(I.startWFStepTimer&&(l=(new Date).getTime()-I.startWFStepTimer),n){case 4:a=b,d=!0;break;case 3:a=E;break;case 5:a=w,d=!0}if(o===g)switch(z){case 4:a=k;break;case 5:a=w;break;case 6:a=T;break;case 9:o=y,a=C}var c=t.auction_id,p=t&&t.waterfallTimeout?t.waterfallTimeout:15e3,_=t&&(t.waterfallSteps||0===t.waterfallSteps)?t.waterfallSteps:-1,P={auction_id_64:c,event_type:o,version:t.productVersion,timestamp:(new Date).getTime(),timeout:p,waterfall_steps:_,mediation_timeout:2e3,waterfall_position:e.waterfallPosition};""!==l&&(P.latency=l),""!==a&&(P.result_code=a),r&&(P.creative_id=r);var j=JSON.stringify(P).replace(/"auction_id_64":"(\d+)"/,'"auction_id_64":$1');f("Waterfall RATBAIT POST tracker fired path :"+h+" -- "+j),0===P.event_type&&G?f("Preventing Waterfall RATBAIT POST tracker (already tracked) :"+h+" -- "+j):u.loadPost(h,j),q&&(d=!0),d&&!G&&(z=-1===t.waterfallSteps||i<=t.waterfallSteps?n:6,function(e){G=!0;var n=t._vastObjArr.slice(0);if(s&&n.push(s),n.length)for(var i=0;i<n.length;i++){var r=n[i];r.rtb&&I.rtb||ve(r,7,e+1)}}(i))}}catch(e){f("Error in reporting to RATBAIT "+e)}},me=function(e,i,r){if(D&&I){var o;o=I.notImpbusWaterfall?"fb":I.rtb?"rtb":"csm",I.hasOwnProperty("fallbackIndex")&&(o="fallback-rtb");var a,s=I.notifyurl,l=(new Date).getTime(),d=1,c={adId:I.adId,step:U,totalAvailableSteps:F,stepLimit:H,maxTime:L,timeRemaining:L,auction_id:t.auction_id,creative_id:I.creative_id,productVersion:t.productVersion};return P&&(c.timeRemaining=L-(l-P)),e&&(d=1,c.status="stepStart",t.waterfallStepId="Waterfall_Step_"+(new Date).getTime()+Math.floor(1e4*Math.random()),f("Waterfall Step #"+U+" , type="+o+", adId="+c.adId+", timeout="+L+("fb"===o?"":", notifyurl="+s+", creativeId="+c.creative_id))),i&&(d=4,c.status="stepSuccess",f("Waterfall outcome, Step #"+U+": ACCEPTED, type= "+o+", adId="+c.adId+", timeout="+L+("fb"===o?"":", notifyurl="+s+", creativeId="+c.creative_id))),r&&(d=2,c.status="stepFail",r.code&&402===r.code&&(d=3),f("Waterfall outcome, Step #"+U+": REJECTED, type= "+o+", adId="+c.adId+", timeout="+L+", reason="+r.message+("fb"===o?"":", creativeId="+c.creative_id))),R&&(d=5,c.status="timeout",f("Waterfall outcome, Step #"+U+": TIMED-OUT, type= "+o+", timeout="+L+", ads processed="+U+("fb"===o?"":", creativeId="+c.creative_id))),ve(I,d,c.step),a=c,void(n.cbWhenWaterfall&&n.cbWhenWaterfall(a))}},ge=function(e){if(e&&e.command&&e.uniqueId){var t=e.command;switch(f("Companion callback command: "+t+", unique companion id: "+e.uniqueId),t){case"addTrackingEvents":var n=e.data;if(n){var i;if(o.init(["error","creative-view","companion-click"],e.uniqueId),n.CompanionClickTracking&&n.CompanionClickTracking.length>0)for(i=0;i<n.CompanionClickTracking.length;i++)o.addTrackingEvent("companion-click",n.CompanionClickTracking[i],e.uniqueId);if(n.TrackingEvents&&n.TrackingEvents.length>0)for(i=0;i<n.TrackingEvents.length;i++)"creativeView"===n.TrackingEvents[i].eventType&&o.addTrackingEvent("creative-view",n.TrackingEvents[i].url,e.uniqueId)}break;case"requestTracking":var r=e.data;r&&o.requestTracking(r,e.uniqueId)}}},ye=function(){if(t._vastObjArr&&t._vastObjArr.length>0)for(var e=0;e<t._vastObjArr.length;e++)o.addTrackingEvents(t._vastObjArr[e].trackingUrls,t._vastObjArr[e].adId),o.requestTracking("notUsed",t._vastObjArr[e].adId);s&&(o.addTrackingEvents(s.trackingUrls,s.adId),o.requestTracking("notUsed",s.adId))},be=function(){if(t._vastObjArr&&t._vastObjArr.length>0)for(var e=0;e<t._vastObjArr.length;e++)p.reportFallbackTracker(t._vastObjArr[e],p.AD_NOT_REACHED)},Ae=function(e,i){ie&&"function"==typeof ie&&ie("AdHandler",e.name),i=!!he.doingVpaidReplay||i,"rewind"===e.name&&(i=!1),i||f("TM>requesting - dispatch : "+e.name);var r=e.name,s={video_start:"video-start",video_impression:"impression",video_mute:"audio-mute",video_click:"video-click",video_complete:"video-complete",video_fullscreen:"video-fullscreen",quartile_event:"quartile-event",video_pause:"video-pause",video_unmute:"audio-unmute",video_failed:"video-failed",video_time:"video-time",video_resume:"video-resume",video_stopped:"video-stopped","video-first-quartile":"video-first-quartile","video-mid":"video-mid","video-third-quartile":"video-third-quartile",fullscreenchange:"video-fullscreen",video_click_open_url:"video-click-open-url",video_skip:"video-skip"}[r],l=!1;if(oe&&-1!==ae.indexOf(s)&&(l=!0),"video-fullscreen"===s&&("3.0"===V||"4.0"===V||"4.1"===V))switch(e.fullscreenStatus){case"enter":s="video-fullscreen";break;case"exit":s="video-exit-fullscreen";break;default:s="video-fullscreen"}if(void 0===s&&(s=r),e.player&&o.setPlayer(e.player),"replay-vpaid"!==s){if(!e||!e.name||"ad-click"!==e.name||e.trackClick){if(i||(l?se.push(s):o.requestTracking(s,M)),t.hasOwnProperty("cbNotification")&&("AdUnit"===e.eventType?t.cbNotification(e.eventType,s,t.targetId,e.obj,e.obj?{adUnitEventData:e.obj}:null):function(e,n){var i=re[e];i&&(t.cbNotification("VAST",i,t.targetId,n,n?{vastEventData:n}:null),"impression"!==e&&"video-complete"!==e&&"video-start"!==e||re.hasOwnProperty(e)&&delete re[e])}(s,e.obj)),t.cbApnVastPlayer&&t.cbApnVastPlayer(s),"canplay"===s&&e.companionAds&&(de.companionAds=a.parse(e.companionAds)),"impression"===s&&(N=!0,ne&&"function"==typeof ne&&ne(),D&&!O?(_&&clearTimeout(_),me(!1,!0),o.requestTracking("notifyurl",M),ye(),I&&I.hasOwnProperty("fallbackIndex")&&(p.reportFallbackTracker(I,p.AD_PLAYED),be())):t.overlayPlayer&&o.requestTracking("notifyurl",M),de.hasOwnProperty("companionAds")&&de.companionAds.companions.length>0&&t.hasOwnProperty("companionContainers")&&Array.isArray(t.companionContainers))){var d=[];t.companionContainers.forEach((function(e){if("string"==typeof e){var t=document.getElementById(e);t&&d.push(t)}else d.push(e)})),d.length>0&&(t.companionContainers=d,le=a.renderCompanions(de.companionAds,t,ge))}if("video-start"===s){if("native"===t.adType){X.adVideoPlayer.controlBar.el_.style.display="block",X.iframeVideoWrapper.style.opacity=1;var c=X&&X.iframeVideoWrapper&&X.iframeVideoWrapper.contentWindow&&X.iframeVideoWrapper.contentWindow.document&&X.iframeVideoWrapper.contentWindow.document.getElementById("top_chrome");c?(c.style.display="",X.options.hideTopBar&&(X.resizeVideo(),delete X.options.hideTopBar)):X.resizeVideo(),Q&&(t.targetElement.contains(Q)&&t.targetElement.removeChild(Q),Q=null)}O=!0,D&&!N&&(_&&clearTimeout(_),me(!1,!0),o.requestTracking("notifyurl",M),ye(),I&&I.hasOwnProperty("fallbackIndex")&&(p.reportFallbackTracker(I,p.AD_PLAYED),be()))}"video-first-quartile"!==s&&"video-mid"!==s&&"video-third-quartile"!==s||Z&&"function"==typeof Z&&Z(s),"video-complete"===s&&K&&"function"==typeof K&&K(s),"audio-mute"!==s&&"audio-unmute"!==s||$&&"function"==typeof $&&$(s),"video-click-open-url"===s&&ee(e)}}else he.options&&(he.doingVpaidReplay=!0,(t=Object.assign(t,he.options)).initialPlayback="auto",t.disableCollapse={enabled:!0,replay:!0},n.cbRenderVideo(n,t,ke))},we=function(e,t){if(oe=e)ae=t;else{for(var n=0;n<se.length;n++)o.requestTracking(se[n],M);ae=[],se=[]}},Te=function(e){V=e.vastVersion;var n,i,r=["video-pause","video-play","video-fullscreen","ad-click","rewind","video-resume","audio-mute","audio-unmute","video-fullscreen","video-exit-fullscreen","ad-expand","ad-collapse","ad-progress","creative-view"];if(e&&e.icons&&e.icons.length>0)for(var a=0;a<e.icons.length;a++){var s=e.icons[a];s&&s.IconViewTracking&&s.IconViewTracking.length>0&&r.push("IconViewTracking_"+s.program),s&&s.IconClickTracking&&s.IconClickTracking.length>0&&r.push("IconClickTracking_"+s.program)}o.init(r,M),o.addTrackingEvents(e.trackingUrls,M);var l=e.clickTrackingUrls;for(n=0;n<l.length;n++)i=l[n],f("register clickTrackingUrls : "+i),o.addTrackingEvent("ad-click",i,M);var d=e.errorUrls;for(n=0;n<d.length;n++)i=d[n],f("register errorUrls  : "+i),o.addTrackingEvent("error",i,M);var c=e.impressionUrls;for(n=0;n<c.length;n++)i=c[n],f("register impressionUrls  : "+i),o.addTrackingEvent("impression",i,M);var u=e.notifyurl;if((D||t.overlayPlayer)&&u&&(f("register notifyurl  : "+u),o.addTrackingEvent("notifyurl",u,M)),e&&e.icons&&e.icons.length>0)for(var p=0;p<e.icons.length;p++){var h=e.icons[p];if(h&&h.IconViewTracking&&h.IconViewTracking.length>0)for(var v=0;v<h.IconViewTracking.length;v++){var m=h.IconViewTracking[v];o.addTrackingEvent("IconViewTracking_"+h.program,m,M),f("register "+m+"_"+h.program+" for icon IconViewTracking")}if(h&&h.IconClickTracking&&h.IconClickTracking.length>0)for(var g=0;g<h.IconClickTracking.length;g++){var y=h.IconClickTracking[g];o.addTrackingEvent("IconClickTracking_"+h.program,y,M),f("register "+y+"_"+h.program+" for icon IconClickTracking")}}},ke=function(){D&&!_&&(P=(new Date).getTime(),_=setTimeout((function(){R=!0}),L))},Ee=function(i){var o;try{if(i.hasOwnProperty("fallbackIndex")&&0===i.mediaFiles.length){var a=function(e,t){var n=t;if(e&&Array.isArray(e)&&e.length>0)for(var i=0;i<e.length;i++){var r=e[i].indexOf("&ERRORFORFALLBACK=");if(r>0){n=parseInt(e[i].substr(r+"&ERRORFORFALLBACK=".length)),e[i]=e[i].substr(0,r);break}}return n}(i.errorUrls,0);return Te(i),x=!0,void n.cbWhenDestroy({type:1,code:a,message:"VAST parsing failed",failedBeforeRenderer:!0})}if(Te(i),t.xandrSdk&&J.isSafari()&&J.inIframe()&&Array.isArray(i.mediaFiles)&&i.mediaFiles.length>1){var s=[];i.mediaFiles.forEach((function(e){"video/webm"!=e.type&&s.push(e)})),s.length>0&&(i.mediaFiles=s)}r.init(Array.isArray(i.mediaFiles)?i.mediaFiles:[]);var l=r.getUrl(t.width,t.height,null,t);if(null!==l&&!0===l.success){if(t.xandrSdk&&t.cbApnVastPlayer&&t.cbApnVastPlayer("creativedata",l),t.finalVastUri=i.finalVastUri,t.video={},t.video.url=l.url,t.video.width=l.width,t.video.height=l.height,pe||(i.viewabilityConfig?t.viewability={config:i.viewabilityConfig}:t.viewability=null),i.userSyncUrl&&(t.usersync_url=i.userSyncUrl),t.verifications=i&&i.adVerifications?i.adVerifications:null,t.viewableImpression=i&&i.viewableImpression?i.viewableImpression:null,t.adServingId=i&&i.adServingId?i.adServingId:null,t.universalAdId=i&&i.universalAdId?i.universalAdId:null,"preview"===t.adType&&t.onlyAudio){i.icons=null,i.hasOwnProperty("companionAds")&&delete i.companionAds,t.disableTopBar=!1,t.controlBarPosition="below",t.disableCollapse={enabled:!0,replay:!0};t.width;var c=24+(t.playerSkin&&t.playerSkin.controlBarHeight?t.playerSkin.controlBarHeight:30);e.style.height=c+"px",t.height=c}t.data.adIcons=i&&i.icons?i.icons:null,t.data.skipOffset=i&&i.skipOffset?i.skipOffset:"",t.data.skipOffset&&t.skippable&&!0===t.skippable.allowOverride&&!0===t.skippable.enabled&&(t.skippable.videoOffset=t.data.skipOffset);var u={};for(var p in i.trackingUrls)p.indexOf("progress_")>=0&&(u[p]=null);return t.data.vastProgressEvent=u,l.maintainAspectRatio&&void 0!==l.maintainAspectRatio?(t.video.maintainAspectRatio=l.maintainAspectRatio,t.maintainAspectRatio=l.maintainAspectRatio):(t.video.maintainAspectRatio=!0,t.maintainAspectRatio=!0),l.scalable&&void 0!==l.scalable?(t.video.scalable=l.scalable,t.canScale=l.scalable):(t.video.scalable=!0,t.canScale=!0),t.video.apiFramework=l.apiFramework,t.video.type=l.type,t.requiredPlayer=l.requiredPlayer,t.videoUrl=l.url,t.clickUrls=i.clickUrls,t.adParameters=i.adParameters,t.extensions=i.extensions,t.data.vastDurationMsec=i.durationMsecs,t.endCard&&t.endCard.showCompanion&&i.companionAds&&(t.endCard.companionAds=i.companionAds.companions,t.endCard.companionCallback=ge),t.video.apiFramework&&t.video.apiFramework.toLowerCase().indexOf("vpaid")>=0?t.vpaid=!0:t.vpaid=!1,W&&"native"!==t.adType&&"preview"!==t.adType&&(t.disableCollapse.replay=!t.vpaid&&j),t.targetElement=e,n.cbForHandlingDispatchedEvent=Ae,n.cbDelayEventsTracking=we,n.cbWhenReady=function(n){if(n.setVastAttribute(),n.test("VIDLA163",n.options.data),Ae({name:"loaded",player:n}),"bannerstreamtest"===t.adType&&(ue=new d(e,t)).start(n),"preview"===t.adType&&t.onlyAudio&&(n.adVideoPlayer.bigPlayButton.el_.style.opacity=0,n.adVideoPlayer.bigPlayButton.el_.style.transform="scale(0.01,0.01)",n.adVideoPlayer.controlBar.el_.style.cursor="default"),X=n,ce&&(Q&&(e.contains(Q)&&e.removeChild(Q),Q=null),Q=ce.beforePlayVideo(t.adType,n),"native"===t.adType)){if(J.isSafari()&&J.inIframe()){e.style.opacity=0;var i=e.style.position;e.style.setProperty("position","fixed","important"),setTimeout((function(){e.style.setProperty("position",i,"important"),e.style.opacity=1}),0)}else e.style.opacity=1;if(n.isDoneInitialPlay=!1,n.options.hideTopBar){var r=n.options.disableTopBar,o=n.options.playerSkin.controlBarHeight;n.options.disableTopBar=!0,n.options.playerSkin.controlBarHeight=0,n.resizeVideo(),n.options.disableTopBar=r,n.options.playerSkin.controlBarHeight=o,n.adVideoPlayer.bigPlayButton.el_.style.display="none",Q||(Q=J.createNativeStartButton(e),e.appendChild(Q),Q.addEventListener("click",(function(){n.play(),e.contains(Q)&&e.removeChild(Q),Q=null})),Q.onmouseover=function(){Q.style.cursor="pointer"},Q.onmouseout=function(){Q.style.cursor="auto"},n.adVideoPlayer.controlBar.el_.style.display="none")}}Y(n)},"native"===t.adType&&(e.style.backgroundImage||(e.style.opacity=0)),n.cbRenderVideo(n,t,ke),x=!0,de=i,he={},void(t.vpaid&&(he.options=Object.assign({},t)))}return x=!0,void n.cbWhenDestroy({type:1,code:l.errorCode,message:"Unable to select rendition"})}catch(e){f(e),o="Exception error: "+e}x=!0,n.cbWhenDestroy({type:0,code:0,message:o})},Se=function(e){x=!1,e&&Ee(e)},Ce=function(){var e=null;return s&&(e=s,s=null),e},Ie=function(e){var n=null;return U<e?n=t._vastObjArr.shift():(n=Ce(),q=!0),n},_e=function(){x=!1;var e=null;if(t._vastObjArr&&D){switch(H){case 0:if(0===U)(e=t._vastObjArr.shift())||(e=Ce());else if(t._vastObjArr.length){var n=t._vastObjArr.shift();ve(n,6,U)}break;case-1:e=Ie(B);break;default:e=Ie(H<B?H:B)}e||ye()}else e=t._vastObjArr.shift();return I=e,U++,me(!0,null,null),e?M=e.adId:x=!0,e};if(n.cbWhenDestroy=function(n,i,r){if(r||(r=t),"native"!==t.adType&&"preview"!==t.adType||(e.style.opacity=1),r.stopWaterfall&&(D&&!r.isWaterfall&&ve(I,9,U),D=r.isWaterfall),D){if(r&&r.waterfallStepId!==t.waterfallStepId)return;t=r,me(!1,!1,n)}if(D&&!N&&!O&&!R){I&&I.fallbackOnNoAd&&(t.overlayWaterfall||(t.fallbackNotFirstStep=!0,o.requestTracking("notifyurl",M),o.requestErrorTracking(n.code,n.type,n.message,M),p.reportFallbackTracker(I,n.failedBeforeRenderer?p.AD_FAILED_BEFORE_RENDERER:p.AD_FAILED_IN_RENDERER,{code:n.code,message:n.message}))),t.overlayPlayer&&I.notImpbusWaterfall&&(t.fallbackNotFirstStep=!0);var s=_e();if(s)return"native"!==t.adType&&"preview"!==t.adType||(t.initialPlayback="auto"),void Se(s)}if(n&&void 0!==n.type)if(f("requesting error in whenDestroy callback : "+n.code+","+n.type+","+n.message),!N||903===n.code&&"preview"===t.adType)if(t.overlayWaterfall||(D||r.stopWaterfall)&&o.requestTracking("notifyurl",M),t.overlayPlayer){var l=o.requestErrorTrackingUrls(n.code,n.type,n.message,M);n.errorUrls=l}else o.requestErrorTracking(n.code,n.type,n.message,M);else f("not requesting error tracker because the Ad Impression was already reported");else f("requesting error in whenDestroy callback : "+n+","+!!n);le&&(a.stopCompanions(le),le=null),"function"==typeof te&&te(n||!1,i),ce&&ce.adFinished(!!n,r),ue&&ue.stop()},t&&t.banners&&(ce=new l(e,t.banners)),void 0!==t&&t&&t.vastXml&&(setTimeout((function(){x||n.cbWhenDestroy({type:0,code:0,message:"VAST Parser didn't answer until timeout"})}),3e3),f("Ad XML : "+t.vastXml),i.parse(t.vastXml,(function(e,i,r,a,l){t.finalVastXml=r&&r.vastXml?r.vastXml:"",function(e,i,r,a,l){if(p.setMessageTemplate(t,Array.isArray(r)?r.length:1),e){if(Array.isArray(r))if(r=r.map((function(e,t){return e.waterfallPosition=t+1,e.adId+="_Ad#"+e.waterfallPosition,e})),!fe()||fe()&&t.enableInlineVideoForIos){if(D=!0,t.isWaterfall=!0,t._vastObjArr=r,F=t._vastObjArr.length,t._vastObjArr.length>0&&!t._vastObjArr[0].fallbackOnNoAd)for(var d=0;d<t._vastObjArr.length;d++){var c=t._vastObjArr[d];if(c.rtb){s=c,t._vastObjArr.splice(d,1);break}}B=t._vastObjArr.length}else D=!1,t._vastObjArr=r;else D=!1,t._vastObjArr.push(r);var u=_e();u&&(u.expires&&u.expires>0&&u.expires<Date.now()?n.cbWhenDestroy({type:0,code:0,message:"Ad has been expired"}):Se(u))}else{var h;if(x=!0,l&&l.length>0&&(o.addTrackingEvent("notifyurl",l,i),o.requestTracking("notifyurl",i)),"vast"===r.substr(0,4)){h=r.substr(4);try{h=parseInt(h)}catch(e){h=null}}var v="Vast Parser error ("+(h||r)+")";"native"===t.adType&&t.badVastXml&&(v="Failed to get VAST XML",h=null),a&&a.length>0?(a.forEach((function(e){f("register errorUrls  : "+e),o.addTrackingEvent("error",e,M)})),n.cbWhenDestroy({type:1,code:h||900,message:v})):h?n.cbWhenDestroy({type:1,code:h,message:v}):n.cbWhenDestroy({type:0,code:0,message:v}),"native"===t.adType&&ce.adFinished(!0,t)}}(e,i,r,a,l)}),null,2e3,null,null,t)),void 0!==t&&t&&t.useAdObj&&t.adObj){if(t.adObj.xandrSdk&&t.adObj.errorFlag){x=!0;return void n.cbWhenDestroy({type:1,code:t.adObj.parsingErrorCode||403,message:t.adObj.parsingErrorMessage||"No suitable rendition available"})}Ee(t.adObj)}}},function(e,t,n){var i=n(78),r=n(80),o=n(81),a=n(82)(),s=function(e,t,s){var l,d,c,u,p="100",h="101",f="102",v="200",m="204",g="205",y="300",b="301",A="302",w="303",T="403",k="900",E=n(79),S="VAST Parser",C=null,I=s,_=I&&I.wrapperLimit&&I.wrapperLimit>0?I.wrapperLimit:5,P=0,j=null,x=e,V=t&&t>0?t:1e3,M=[],N=null,O=[],D=[],L={},R=[],U=[],B=[],F=[],H=[],W=[],z="",q="",G=0,J="",X=0,Q=null,Y=[],K={},$=[],Z=[],ee=[],te=[],ne=[],ie={viewable:[],notViewable:[],undetermined:[]},re=[],oe=null,ae={},se="unknown unknown",le="unknown unknown",de=null,ce={},ue=new i(s),pe=!1,he="",fe=!1,ve="video",me=[],ge=-1,ye=!1,be=n(83),Ae=I.fromMediation,we=Ae&&I.fromMediation.waterfall,Te=Ae&&I.fromMediation.rtbFallback,ke=[],Ee=!1,Se={},Ce="",Ie={},_e="",Pe={},je="",xe={},Ve="",Me={},Ne="",Oe=0,De=0,Le=s.vmap,Re="",Ue={hops:[]};function Be(e,t){if(e&&e.length>0)for(var n=0;n<e.length;n++)e[n]=e[n].replace("[ERRORCODE]",t)}function Fe(){if(!u){u="-1";var e=[];if(I){var t=!I.overlayPlayer,n=!I.overlayPlayer;I.hasOwnProperty("skippable")&&I.skippable.enabled&&e.push("skippable"),I.hasOwnProperty("initialPlayback")&&(t="auto"===I.initialPlayback),I.hasOwnProperty("initialAudio")&&(n="off"===I.initialAudio),t?e.push(n?"mautoplayed":"autoplayed"):e.push("optin"),u=e.join()}}return u}function He(e,t){for(var n=e,i="AD DETECTED="+("SUCCESS"===t.substr(0,7)?"SUCCESS":"NONE")+" :: Reason="+t+", playerTechnology="+(I.hasOwnProperty("playerTechnology")?JSON.stringify(I.playerTechnology):"unknown")+", platform="+be.getPlatformType()+", Ad tree path=",r="";-1!==n;){var o=me[n].children[0];if(o){var a=ue.getNodeAttributeValue(o,"id");r.length>0&&(r=" -> "+r),r=a+r}n=me[n].parentIdx}E.info(S,i+r)}function We(e){var t=ue.getSubNodes(e,"Extension");if(t&&t.length>0)for(var n=0;n<t.length;n++){var i=ue.getNodeAttributeValue(t[n],"type");if(i&&"waterfall"===i&&(i=ue.getNodeAttributeValue(t[n],"fallback_index"))&&i.length>0)return i=parseInt(i)}return-1}function ze(){return I.hasOwnProperty("slotNumber")?I.slotNumber:1}function qe(){return I.hasOwnProperty("slotNumber")?I.slotNumber:-1}function Ge(e,t){for(var n=0;n<e.length;n++)if(e[n].toString()===t.toString())return!0;return!1}function Je(e,t){for(var n=0;n<e.length;n++)if("string"==typeof e[n]){if(e[n]===t)return!0}else if("object"==typeof e[n]&&!(e[n]instanceof Array)&&e[n].url===t)return!0;return!1}function Xe(e,t,n,i){if(e){var r=ue.getSubNode(e,"Linear",0);if(r){var o=null,a=ue.getSubNode(r,"VideoClicks");if(a){var s,l,d=ue.getSubNode(a,"ClickThrough");d&&(o=ue.getNodeValues(d))&&!Je(t,o)&&(s=ue.prepareAttributionData(d,o),t.push(s)),0===t.length&&ce.url&&t.push(ce.url);var c=ue.getSubNodes(a,"ClickTracking");if(c)for(l=0;l<c.length;l++)if(d=c[l],(o=ue.getNodeValues(d))&&!Je(n,o)){var u={ADTYPE:ve,INVENTORYSTATE:Fe(),ADCOUNT:ze(),PODSEQUENCE:qe()};o=ue.resolveMacros(o,!0,u),s=ue.prepareAttributionData(d,o,u),n.push(s)}if(c=ue.getSubNodes(a,"CustomClick"))for(l=0;l<c.length;l++)d=c[l],(o=ue.getNodeValues(d))&&!Je(i,o)&&(s=ue.prepareAttributionData(d,o),i.push(s))}else ce.url&&t.push(ce.url)}}}function Qe(e,t){if(e){var n=function(e){var t=[],n=ue.getSubNodes(e,"Verification");if(n&&n.length>0)for(var i=0;i<n.length;i++){var r,o,a,s=n[i],l=ue.getNodeAttributeValue(s,"vendor"),d=[],c=[],u=ue.getSubNodes(s,"JavaScriptResource");if(u&&u.length>0)for(a=0;a<u.length;a++){r=ue.getNodeValues(u[a]);var p=ue.getNodeAttributeValue(u[a],"apiFramework"),h=ue.getNodeAttributeBooleanValue(u[a],"browserOptional");d.push({url:r,framework:p,browserOptional:h})}if((u=ue.getSubNodes(s,"ExecutableResource"))&&u.length>0)for(a=0;a<u.length;a++){r=ue.getNodeValues(u[a]),o=ue.getNodeAttributeValue(u[a],"apiFramework");var f=ue.getNodeAttributeValue(u[a],"type");c.push({content:r,framework:o,type:f})}var v=ue.getSubNodeWholeValue(s,"ViewableImpression"),m={},g=!1,y=ue.getSubNode(s,"TrackingEvents");if(y){var b=ue.getSubNodes(y,"Tracking");if(b&&b.length>0)for(a=0;a<b.length;a++){r=ue.getNodeValues(b[a]);var A=ue.getNodeAttributeValue(b[a],"event");A&&r&&(g=!0,r=ue.resolveMacros(r,!0,{ADTYPE:ve,INVENTORYSTATE:Fe(),ADCOUNT:ze(),PODSEQUENCE:qe()}),m.hasOwnProperty(A)?m[A].push(r):m[A]=[r])}}var w=ue.getSubNodeWholeValue(s,"VerificationParameters"),T={};l&&(T.vendor=l),d.length>0&&(T.jsResources=d),c.length>0&&(T.executableResources=c),v&&(T.viewableImpression=v),g&&(T.trackingEvents=m),w&&(T.verificationParameters=w),t.push(T)}return t.length>0?t:null}(e);n&&n.length>0&&n.forEach((function(e){t.push(e)}))}}function Ye(e,t){var n=e.indexOf("%");if(n>0)return t&&t>0?Number(e.substring(0,n)):0;var i=(n=e.indexOf("."))>0?Number(e.substring(n+1)):0;n>0&&(e=e.substring(0,n));var r=e.split(":");return 3===r.length?1e3*(3600*Number(r[0])+60*Number(r[1])+Number(r[2]))+i:0}function Ke(e){return"video/x-flv"===e||"video/x-f4v"===e||"video/f4v"===e||"application/x-shockwave-flash"===e}function $e(e,t,n,i){var r=null;if(e){if((r={}).type=ue.getNodeAttributeValue(e,"type"),-1===i.indexOf(r.type)&&i.push(r.type),!r.type||0===r.type.length)return r.error="Missing type",r;var o="video/mp4"===r.type?"":ue.getNodeAttributeValue(e,"codec");if(o&&o.length>0&&(o=(o=o.trim()).length>2?o:"").length>0&&(r.codec=o),!function(e,t){return be.canPlay(e,t)}(r.type,o))return r.error="Media is not capable. type: "+r.type+", codec: "+o,r;if(I&&!function(e){if(I.playerTechnology&&Array.isArray(I.playerTechnology)&&I.playerTechnology.length>0){for(var t=!1,n=0;n<I.playerTechnology.length;n++)if(!Ke(e.toLowerCase())){t=!0;break}if(!t)return!1}return!(I.hasOwnProperty("supportVpaid")&&!I.supportVpaid&&function(e){return"application/javascript"===e||"application/x-javascript"===e}(e.toLowerCase()))}(r.type))return r.error="Type is invalid. type: "+r.type,r;r.url=t,r.variation="Media#"+n,r.delivery=ue.getNodeAttributeValue(e,"delivery");var a=ue.getNodeAttributeNumberValue(e,"bitrate",-1);-1!==a?r.bitrate=a:(-1!==(a=ue.getNodeAttributeNumberValue(e,"minBitrate",-1))&&(r.minBitrate=a),-1!==(a=ue.getNodeAttributeNumberValue(e,"maxBitrate",-1))&&(r.maxBitrate=a)),r.width=ue.getNodeAttributeNumberValue(e,"width"),r.height=ue.getNodeAttributeNumberValue(e,"height");var s=ue.getNodeAttributeValue(e,"scalable");s.length>0&&(r.scalable=ue.getNodeAttributeBooleanValue(e,"scalable",!0)),(s=ue.getNodeAttributeValue(e,"maintainAspectRatio")).length>0&&(r.maintainAspectRatio=ue.getNodeAttributeBooleanValue(e,"maintainAspectRatio",!0));var l=ue.getNodeAttributeValue(e,"apiFramework");l&&l.length>0&&(r.apiFramework=l.toUpperCase());var d=ue.getNodeAttributeValue(e,"id");d&&d.length>0&&(r.id=d);var c=ue.getNodeAttributeNumberValue(e,"fileSize",-1);-1!==c&&(r.fileSize=c);var u=ue.getNodeAttributeNumberValue(e,"mediaType",-1);-1!==u&&(r.mediaType=u)}return r}function Ze(e,t){var n=Date.now(),i='<VAST version="'+he+'"><Ad id="'+n+'"><InLine></InLine></Ad></VAST>',r={errorFlag:!0,vastVersion:he,errorUrls:ge>0?mt(ge):e,vastXml:i,adId:Ct(c&&c.parentNode?c.parentNode.id:"unknown"),sequence:me&&me.length>0?me[0].state.sequence:1,finalVastUri:Re,extClickTrackingUrls:"",extClickUrls:"",extCustomClicks:"",extErrorUrls:"",extImpressionUrls:"",extTrackingUrls:""};if(r.errorUrls||(r.errorUrls=[]),t&&(Be(r.errorUrls,t),r.errorUrls&&r.errorUrls.length>0&&(r.errorUrls[0]+="&ERRORFORFALLBACK="+t),r.parsingErrorCode=t),he.substr(0,1)>"3"){if(c){r.universalAdId=Et(c),r.adServingId=ue.getSubNode(c,"AdServingId");var o=ue.getSubNode(c,"AdSystem");o&&(r.adSystem={name:ue.getNodeValue(o),version:ue.getNodeAttributeValue(o,"version")});var a=wt(c);a&&(r.categories=a)}r.contentId=St(),r.conditionalAd=fe}null!=l&&(r.fallbackOnNoAd=l),we&&Ce.length>0&&(r.notifyurl=Ce),Ne.length>0&&(r.creative_id=Ne),r.rtb=!0,He(ge,"SUCCESS"),r.clickTrackingUrls=[],r.clickUrls=[],r.customClicks=[],r.impressionUrls=[],jt(r),I.telemetry&&(r.telemetry=Object.assign({},Ue)),Ue={hops:[]},ke.push(r),De++,-1===ge&&(tt(),ke.length>0&&(ke.sort((function(e,t){return e.fallbackIndex-t.fallbackIndex})),delete ke[ke.length-1].fallbackOnNoAd))}function et(e,t){var n=H.concat(W);Be(n,e),Y&&Y.length>0&&(Be(Y,w),n=n.concat(Y));var i={UNIVERSALADID:se,ADSERVINGID:de,BREAKPOSITION:I.breakPosition,ADCOUNT:ze(),PODSEQUENCE:qe()};if(n=ue.resolveMacrosArray(n,["UNIVERSALADID","ADSERVINGID","BREAKPOSITION","ADCOUNT","PODSEQUENCE"],i,-1),E.error(S,"Error "+e+" - "+t),Te){Ze(n);var r=we?ke:ke[0];r.errCode=e,C(!0,x,r,null)}else C(!1,x,"vast"+e,n,Ce,Object.assign({},Ue)),Ue={hops:[]}}function tt(){for(var e=function(e){if(I.isXandrVastPlayer&&!I.overlayPlayer&&e.errorFlag&&Array.isArray(e.errorUrls)&&e.errorUrls.length>0)for(var t=n(84),i=0;i<e.errorUrls.length;i++){var r=e.errorUrls[i],o=new URL("string"==typeof r?r:r.url);o.hostname.indexOf("ib.adnxs.com")>=0||o.hostname.indexOf("ib.adnxs-simple.com")>=0||t.trackPixel(r,"error")}},t=0;t<ke.length;)if(ke[t].hasOwnProperty("fallbackIndex"))t++;else{if(!(ke.length>1))break;e(ke[t]),ke.splice(t,1)}}function nt(e){var t=me[ge].state;if(t&&Array.isArray(t.arrErrorUrls)&&t.arrErrorUrls.forEach((function(e){W.push(e)})),ge>=0){if(me[ge].children[0]=null,me[ge].children.splice(0,1),0===me[ge].children.length){var n=me[ge].parentIdx;if(me.splice(ge,1),-1===(ge=n)){if((we||Te)&&ke.length>0){var i="rtb";Ae&&x&&x.content_source&&(i=x.content_source),Te?(tt(),Ae?E.info(S,"Fallback: Vast XML ad count detected for "+i+" node: # ads: "+ke.length):E.info(S,"Fallback: Vast XML ad count detected: # fallback-"+i+" ads: "+ke.length),ke.length>0&&(ke.sort((function(e,t){return e.fallbackIndex-t.fallbackIndex})),delete ke[ke.length-1].fallbackOnNoAd)):Ae?E.info(S,"Waterfall: Vast XML ad count detected for "+i+" node: # ads: "+("rtb"===i?De:Oe)):d?E.info(S,"Waterfall: Vast XML ad count detected: "+(Oe+De)):E.info(S,"Waterfall: Vast XML ad count detected: # csm ads: "+Oe+", # rtb ads: "+De),C(!0,x,ke,null)}else if(Le&&ke.length>0)E.info(S,"VMAP: Ad XML node count detected: "+ke.length),C(!0,x,ke,null);else{var r=k;e&&(r=e.toString()),1===ke.length&&ke[0].errorFlag?C(!0,x,ke[0],null):et(r,"no Ad available")}return}return(Ee=0===ge)&&Te&&e&&Ze(W,e),void nt(e)}Ee=0===ge,P=ge,me[ge].state=it(),Ue.hops.push({}),Pt(me[ge].children[0])}}function it(){return{arrTrackings:{},arrImpressions:[],arrClickUrls:[],arrCustomClicks:[],arrClickTrackings:[],arrErrorUrls:[],sExtensions:"",sequence:Le?0:1,companions:{required:"unknown",companions:[]},icons:[],arrViewableImpressions:{viewable:[],notViewable:[],undetermined:[]},arrVerifications:[],fallback:{enabled:!1,index:-1}}}function rt(e){var t=ue.getNodeAttributeValue(e,"id");if(t.length>0){var n=ue.getNodeAttributeValue(e,"notifyurl");n&&n.length>0&&(Se[t]=n)}}function ot(e){var t=ue.getNodeAttributeValue(e,"id");if(t.length>0){var n=ue.getNodeAttributeValue(e,"creativeId");n&&n.length>0&&(Me[t]=n)}}function at(e){var t=ue.getNodeAttributeValue(e,"id");if(t.length>0){var n=ue.getNodeAttributeValue(e,"buyerMemberId");n&&n.length>0&&(Ie[t]=n)}}function st(e){var t=ue.getNodeAttributeValue(e,"id");if(t.length>0){var n=ue.getNodeAttributeValue(e,"brandCategoryId");n&&n.length>0&&(Pe[t]=n)}}function lt(e){var t=ue.getNodeAttributeValue(e,"id");if(t.length>0){var n=ue.getNodeAttributeValue(e,"viewabilityConfig");n&&n.length>0&&(xe[t]=n)}}function dt(){if(Q&&Q.length>0)for(var e=0;e<Q.length;e++){var t=Q[e],n=ue.getNodeValues(t);if(n&&!Je(Y,n)){var i=ue.prepareAttributionData(t,n);Y.push(i)}}}function ct(e){(new Date).getTime(),Y=[],j=e;var t=function(e){var t=e.indexOf("<"),n=e.substr(-1===t?0:t);return-1!==(t=n.lastIndexOf(">"))&&(n=n.substr(0,t+1)),n.trim()}(e);if(0===t.length)return _t("outcome","failed"),He(ge,"EMPTY VAST"),void(0===me.length?(_t("errCode",h),et(h,"empty VAST")):Ae?(_t("errCode",p),nt(p)):(_t("errCode",Te?h:w),nt(Te?h:w)));var n=null;if(void 0!==window.DOMParser){var i=!1;if("parsererror"===(n=(new DOMParser).parseFromString(t,"text/xml")).documentElement.nodeName){i=!0;try{E.error(S,"Error reason = "+n.documentElement.childNodes[0].nodeValue)}catch(e){}}else{var r=ue.getSubNode(n,"parsererror");if(r){i=!0;try{E.error(S,"Error reason = "+r.innerText)}catch(e){}}}if(i)return _t("outcome","failed"),_t("errCode",p),He(ge,"INVALID VAST STRUCTURE"),void(0===me.length?et(p,"VAST XML parsing error"):nt(p))}else{if(void 0===window.ActiveXObject)return _t("outcome","failed"),_t("errCode",p),E.error(S,"Failed to parse vast xml by window.ActiveXObject(Microsoft.XMLDOM)"),He(ge,"INVALID VAST STRUCTURE"),void(0===me.length?et(p,"Failed to get vast xml"):nt(p));try{if((n=new window.ActiveXObject("Microsoft.XMLDOM")).loadXML(t),0!==n.parseError.errorCode)return _t("outcome","failed"),_t("errCode",p),E.error(S,n.parseError),He(ge,"INVALID VAST STRUCTURE"),void(0===me.length?et(p,n.parseError.errorCode+", Error reason = "+n.parseError.reason):nt(p))}catch(e){return _t("outcome","failed"),_t("errCode",p),E.error(S,"Failed to parse vast xml by window.ActiveXObject(Microsoft.XMLDOM)",e),He(ge,"INVALID VAST STRUCTURE"),void(0===me.length?et(p,"Failed to parse vast xml by window.ActiveXObject(Microsoft.XMLDOM)"):nt(p))}}if(!n)return _t("outcome","failed"),_t("errCode",p),He(ge,"INVALID VAST STRUCTURE"),void(0===me.length?et(p,"VAST XML parsing error"):nt(p));var o=ue.getSubNode(n,"VAST");if(!o||!o.firstChild)return _t("outcome","empty vast"),He(ge,"EMPTY VAST"),void(x?0===me.length?(_t("errCode",h),et(h,"empty VAST")):Ae?(_t("errCode",p),nt(p)):P>0?(_t("errCode",w),nt(w)):(_t("errCode",Te?h:w),nt(Te?h:w)):(_t("errCode",w),0===me.length?et(w,"no Ad found in VAST response"):nt(w)));var a=ue.getSubNodes(o,"Error");Q=ue.returnOnlyChildren(o,a);var s=function(e){var t="unknown";return e&&(t=(t=ue.getNodeAttributeValue(e,"version")).trim()).length>3&&(t=t.substr(0,3)),t}(o);if(function(e){return"2.0"===e||"3.0"===e||"4.0"===e||"4.1"===e||"4.2"===e}(s)){Ee&&(Ae||((we=ue.getNodeAttributeBooleanValue(o,"apn_waterfall"))&&(I.waterfall=!0),Te=ue.getNodeAttributeBooleanValue(o,"apn_fallback")),ce={});var l=ue.getSubNodes(o,"Ad");if(!l||0===l.length)return _t("outcome","failed"),dt(),He(ge,"NO AD NODE"),void(0===me.length?(_t("errCode",h),et(h,"no Ad available")):(_t("errCode",w),nt(w)));for(var c=[],u=k,m=0;m<l.length;m++){if(Ee){var g=ue.getNodeAttributeValue(l[m],"id");g?g+="_suffix"+m:g="unknown_suffix"+m,l[m].id=g}else Ae||we||Te||We(l[m])>=0&&(we=!0,I.waterfall=!0,d=!0);if(s>="4.1"){var y=ue.getNodeAttributeValue(l[m],"adType");if(("preview"!==I.adType||!I.onlyAudio)&&""!==y&&"video"!==y){E.log(S,"Ignore non-video Ad node"),u=v;continue}}if(s>="4.0"&&ge>0&&!me[ge].state.allowMultiAds){if(ue.getNodeAttributeValue(l[m],"sequence"))continue;if(c.length>0)break}c.push(l[m]),we&&Ee&&rt(l[m]),Ee&&(at(l[m]),st(l[m]),ot(l[m]),lt(l[m]))}if(0===c.length)return dt(),_t("outcome","failed"),_t("errCode",u),He(ge,"NO VALID AD NODES"),void(0===me.length?et(u,"no Ad available"):nt(u));var b={parentIdx:ge,currentIdx:0,children:c,state:it()};me.push(b),b.currentIdx=me.length-1,ge=b.currentIdx,Pt(me[ge].children[0],s)}else _t("outcome","failed"),_t("errCode",f),He(ge,"INVALID VAST VERSION: "+s),0===me.length?et(f,"VAST version not supported"):nt(f)}function ut(e){for(var t in me[e].state.arrTrackings)for(var n=0;n<me[e].state.arrTrackings[t].length;n++)K.hasOwnProperty(t)?Ge(K[t],me[e].state.arrTrackings[t][n])||K[t].push(me[e].state.arrTrackings[t][n]):(K[t]=[],K[t].push(me[e].state.arrTrackings[t][n]));return K}function pt(e){for(var t=0;t<me[e].state.arrImpressions.length;t++)Ge($,me[e].state.arrImpressions[t])||$.push(me[e].state.arrImpressions[t]);return $}function ht(e){for(var t=0;t<me[e].state.arrClickUrls.length;t++)Ge(Z,me[e].state.arrClickUrls[t])||Z.push(me[e].state.arrClickUrls[t]);return Z}function ft(e){for(var t=0;t<me[e].state.arrCustomClicks.length;t++)Ge(ee,me[e].state.arrCustomClicks[t])||ee.push(me[e].state.arrCustomClicks[t]);return ee}function vt(e){for(var t=0;t<me[e].state.arrClickTrackings.length;t++)Ge(te,me[e].state.arrClickTrackings[t])||te.push(me[e].state.arrClickTrackings[t]);return te}function mt(e){for(var t=0;t<me[e].state.arrErrorUrls.length;t++)Ge(ne,me[e].state.arrErrorUrls[t])||ne.push(me[e].state.arrErrorUrls[t]);return ne}function gt(e){return me[e].state.sExtensions.length>0&&(z+=me[e].state.sExtensions),z}function yt(e,t){for(var n=0;n<e.length;n++)if(e[n].program.toLowerCase()===t.toLowerCase())return!0;return!1}function bt(e,t){for(var n=0;n<e.length;n++)if(e[n].program.toLowerCase()===t.toLowerCase())return void e.splice(n,1)}function At(e){for(var t=e;t>0;){for(var n=me[t].parentIdx,i=0;i<me[t].state.icons.length;i++)yt(me[n].state.icons,me[t].state.icons[i].program)&&bt(me[n].state.icons,me[t].state.icons[i].program),me[n].state.icons.push(me[t].state.icons[i]);t=n}return me[t].state.icons}function wt(e){var t=[],n=ue.getSubNodes(e,"Category");if(n&&n.length>0)for(var i=0;i<n.length;i++){var r=ue.getNodeValues(n[i]);if(r&&r.length>0){var o=ue.getNodeAttributeValue(n[i],"authority");t.push({category:r,authority:o})}}return t.length>0?t:null}function Tt(e){var t;for(t=0;t<me[e].state.arrViewableImpressions.viewable.length;t++)Ge(ie.viewable,me[e].state.arrViewableImpressions.viewable[t])||ie.viewable.push(me[e].state.arrViewableImpressions.viewable[t]);for(t=0;t<me[e].state.arrViewableImpressions.notViewable.length;t++)Ge(ie.notViewable,me[e].state.arrViewableImpressions.notViewable[t])||ie.notViewable.push(me[e].state.arrViewableImpressions.notViewable[t]);for(t=0;t<me[e].state.arrViewableImpressions.undetermined.length;t++)Ge(ie.undetermined,me[e].state.arrViewableImpressions.undetermined[t])||ie.undetermined.push(me[e].state.arrViewableImpressions.undetermined[t]);return ie}function kt(e){var t;for(t=0;t<me[e].state.arrVerifications.length;t++)re.push(me[e].state.arrVerifications[t]);return re}function Et(e){var t,n,i,r,o="",a="unknown",s="unknown",l=function(){return a+" "+s};if(!(n=ue.getSubNodes(e,"Creative"))||0===n.length)return l();for(t=0;t<n.length&&!(ue.getSubNode(n[t],"Linear")&&(i=ue.getSubNodes(n[t],"UniversalAdId"))&&i.length>0);t++);if(!i)return l();for(t=0;t<i.length;t++)r=i[t],a=ue.getNodeAttributeValue(r,"idRegistry")||"unknown",s=ue.getNodeValue(r)||"unknown",o.length>0&&(o+=","),o+=l();return o}function St(){var e="unknown",t="unknown";return I.content&&(I.content.registryId&&(e=I.content.registryId),I.content.contentId&&(t=I.content.contentId)),e+" "+t}function Ct(e){var t=e,n=t.indexOf("_suffix");return n>0&&(t=t.substring(0,n)),t}function It(e){return!!(oe&&ae&&ae.hasOwnProperty(e.authority))&&!!oe.split(",").find((function(t){return t===e.category}))}function _t(e,t){Ue.hops&&Ue.hops.length>0&&(Ue.hops[Ue.hops.length-1][e]=t)}function Pt(e,t){c=null;var i=ue.getSubNode(e,"Wrapper"),s=null!==i;if(s||(i=ue.getSubNode(e,"InLine")),c=i,!i)return _t("outcome","failed"),_t("errCode","101"),dt(),He(ge,"MISSING WRAPPER / INLINE NODE"),void nt("101");if(++P>_)return _t("outcome","failed"),_t("errCode",A),He(ge,"Reach Wrapper limit"),void nt(A);t>he&&(he=t);var u=ue.getNodeAttributeValue(e,"id");if(Se.hasOwnProperty(u)&&(Ce=Se[u]),Me.hasOwnProperty(u)&&(Ne=Me[u]),Ie.hasOwnProperty(u)&&(_e=Ie[u]),Pe.hasOwnProperty(u)&&(je=Pe[u]),xe.hasOwnProperty(u)&&(Ve=xe[u]),0===ge){var h=ue.getNodeAttributeValue(e,"sequence");h&&(me[ge].state.sequence=parseInt(h)),ue.getNodeAttributeValue(e,"conditionalAd")&&(fe=ue.getNodeAttributeBooleanValue(e,"conditionalAd")),(ve=ue.getNodeAttributeValue(e,"adType"))&&""!==ve||(ve="video"),Ae||Te||we||We(i)>=0&&(Te=!0)}if(function(e,t){if(e){var n=ue.getSubNodes(e,"Error"),i=ue.returnOnlyChildren(e,n);if(i)for(var r=0;r<i.length;r++){var o=i[r],a=ue.getNodeValues(o),s={ADTYPE:ve,INVENTORYSTATE:Fe(),ADCOUNT:ze(),PODSEQUENCE:qe()};if((a=ue.resolveMacros(a,!0,s))&&!Je(t,a)){var l=ue.prepareAttributionData(o,a,s);t.push(l)}}}}(i,me[ge].state.arrErrorUrls),function(e,t){if(e){var n=ue.getSubNodes(e,"Impression");if(n)for(var i=0;i<n.length;i++){var r=n[i],o=ue.getNodeValues(r),a={ADTYPE:ve,INVENTORYSTATE:Fe(),ADCOUNT:ze(),PODSEQUENCE:qe()};if((o=ue.resolveMacros(o,!0,a))&&!Je(t,o)){var s=ue.prepareAttributionData(r,o,a);t.push(s)}}}}(i,me[ge].state.arrImpressions),function(e,t){if(e){var n=ue.getSubNode(e,"Linear",0);if(n){var i=ue.getSubNode(n,"TrackingEvents");if(i){var r=ue.getSubNodes(i,"Tracking");if(r)for(var o=0;o<r.length;o++){i=r[o];var a=ue.getNodeValues(i);if(a){var s={ADTYPE:ve,INVENTORYSTATE:Fe(),ADCOUNT:ze(),PODSEQUENCE:qe()};a=ue.resolveMacros(a,!0,s);var l,d=ue.getNodeAttributeValue(i,"event");if("progress"===d){var c=ue.getNodeAttributeValue(i,"offset");d=c?"progress_"+c:""}if(d)t.hasOwnProperty(d)?Je(t[d],a)||(l=ue.prepareAttributionData(i,a,s),t[d].push(l)):(t[d]=[],l=ue.prepareAttributionData(i,a,s),t[d].push(l))}}}}}}(i,me[ge].state.arrTrackings),Xe(i,me[ge].state.arrClickUrls,me[ge].state.arrClickTrackings,me[ge].state.arrCustomClicks),function(e,t){if(e){var n=ue.getSubNode(e,"Extensions");n&&n.innerHTML&&n.innerHTML.length>0?me[t].state.sExtensions=me[t].state.sExtensions+n.innerHTML.toString():n&&n.textContent&&n.textContent.length>0&&(me[t].state.sExtensions=me[t].state.sExtensions+n.textContent.toString())}}(i,ge),function(e,t){if(e){var n=ue.getSubNode(e,"CompanionAds");n&&(n.innerHTML&&n.innerHTML.length>0||n.textContent&&n.textContent.length>0)&&r.parse(me[t].state.companions,n,ue)}}(i,ge),function(e,t){if(e){var n=ue.getSubNode(e,"Icons");n&&(n.innerHTML&&n.innerHTML.length>0||n.textContent&&n.textContent.length>0)&&o.parse(me[t].state.icons,n,ue)}}(i,ge),function(e,t){if(e){var n=ue.getSubNode(e,"ViewableImpression",0);if(n){var i,r=null,o=null,a=ue.getSubNodes(n,"Viewable");if(a&&a.length>0)for(i=0;i<a.length;i++)o=a[i],(r=ue.getNodeValues(o))&&!Ge(t.viewable,r)&&t.viewable.push(r);if((a=ue.getSubNodes(n,"NotViewable"))&&a.length>0)for(i=0;i<a.length;i++)o=a[i],(r=ue.getNodeValues(o))&&!Ge(t.notViewable,r)&&t.notViewable.push(r);if((a=ue.getSubNodes(n,"ViewUndetermined"))&&a.length>0)for(i=0;i<a.length;i++)o=a[i],(r=ue.getNodeValues(o))&&!Ge(t.undetermined,r)&&t.undetermined.push(r)}}}(i,me[ge].state.arrViewableImpressions),Qe(i,me[ge].state.arrVerifications),W=[],s){if(_t("wrapper",!0),function(e){if(e){var t=ue.getSubNode(e,"Linear",0);if(t){var n=ue.getSubNode(t,"Duration");if(n){var i=Ye(ue.getNodeValue(n),-1);i>0&&(X=i)}}}}(i),he>="4.0"&&ge>0&&me[ge-1].state.hasOwnProperty("followAdditionalWrappers")&&!1===me[ge-1].state.followAdditionalWrappers)return _t("outcome","failed"),_t("errCode",y),He(ge,"Additional Wrappers are not allowed"),void nt(y);!function(e){oe=null,ae={};var t=ue.getSubNodes(e,"BlockedAdCategories");if(t&&t.length>0){oe=[];for(var n=0;n<t.length;n++){var i=ue.getNodeValues(t[n]);oe.push(i);var r=ue.getNodeAttributeValue(t[n],"authority");r&&r.length>0&&(ae[r]=i)}oe=oe.toString()}}(i),function(e){_t("wrapperIndex",P),l=null;var t=ue.getSubNode(e,"VASTAdTagURI");if(!t)return _t("outcome","failed"),_t("errCode",y),He(ge,"INVALID WRAPPER NODE"),void(0===me.length?et(y,"invalid wrapper node"):nt(y));var i,r,o=ue.getNodeValues(t);if(!o||0===o.length)return _t("outcome","failed"),_t("errCode",y),He(ge,"EMPTY VASTAdTagURI"),void(0===me.length?et(y,"Invalid VASTAdTagURI node value"):nt(y));if(ye)return He(ge,"terminated"),void C(!1,x,"terminated",null,Ce);if(pe=!0,he>="4.0"&&(i=ue.getNodeAttributeBooleanValue(e,"followAdditionalWrappers",!0),me[ge].state.followAdditionalWrappers=i,i=ue.getNodeAttributeBooleanValue(e,"allowMultipleAds",!1),me[ge].state.allowMultipleAds=i),Te){var a=We(e);a>=0&&(""!==(i=ue.getNodeAttributeValue(e,"fallbackOnNoAd"))?(l=ue.getNodeAttributeBooleanValue(e,"fallbackOnNoAd"),me[ge].state.fallback.enabled=l):me[ge].state.fallback.enabled=!1,me[ge].state.fallback.index=a)}Re=o,r=I.overlayPlayer?1:I.expandable?3:-1,o=ue.resolveMacros(o,!1,{BLOCKEDADCATEGORIES:oe?oe.toString():-1,ADTYPE:ve,ADCOUNT:I.hasOwnProperty("slotCount")?I.slotCount:1,PLACEMENTTYPE:r,INVENTORYSTATE:Fe()}),_t("wrapperDomain",ue.getDomain(o)),_t("url",o);var s=Date.now();n(84).load(o,(function(t,n){if(_t("timeToProcess",Date.now()-s),ye)return He(ge,"terminated"),void C(!1,x,"terminated",null,Ce);if(t||0===n.length)"Timeout"===t?(_t("responseStatus","timeout"),He(ge,"VASTAdTagURI TIMED OUT: "+o),0===me.length?et(b,"Timeout of VAST URI provided in wrapper element"):nt(b)):(_t("responseStatus","failed"),_t("errCode",w),He(ge,"No response for VASTAdTagURI: "+o),0===me.length?et(w,"No VAST response for VAST URI provided in wrapper element"):nt(w));else{_t("responseStatus","success"),Ee=!1;var i=[];Xe(e,i,[],[]),i.length>0&&(ce.url=i[0]),Ue.hops.push({}),ct(n)}}),I.adServerTimeout?I.adServerTimeout:V)}(i)}else{var f;_t("inline",!0);var v=!1;Te&&(f=We(i))>=0&&(v=!0,me[ge].state.fallback.enabled=!0,me[ge].state.fallback.index=f);var k=function(e){G=0,J="",q="",M=[],N=null,O=[],D=[];var t=null,n=[];if(e){var i=ue.getSubNode(e,"Linear",0);if(i){var r=ue.getSubNode(i,"Duration");if(r){var o=ue.getNodeValue(r);G=Ye(o,-1)}var a=ue.getNodeAttributeValue(i,"skipoffset");J=a,q="";var s=ue.getSubNode(i,"AdParameters");if(s)if(q=ue.getNodeValues(s),ue.getNodeAttributeBooleanValue(s,"xmlEncoded",!1)){var l=document.createElement("textarea");l.innerHTML=q,q=l.value}if(r=ue.getSubNode(i,"MediaFiles")){var d,c=ue.getSubNodes(r,"MediaFile");if(c){var u,h;for(h=0;h<c.length;h++)if(r=c[h],(d=ue.getNodeValues(r)).length>0){var f=$e(r,d,h,n);f&&!f.error?M.push(f):f&&f.error&&(u=f.error)}if(0===M.length)t={code:T,message:u||"INCOMPATIBLE MEDIA TYPE, Available = "+JSON.stringify(n)};else{r=ue.getSubNode(i,"MediaFiles"),N=ue.getSubNodeWholeValue(r,"Mezzanine","");var v=ue.getSubNodes(r,"InteractiveCreativeFile");if(v&&v.length>0)for(var m=0;m<v.length;m++){var g=v[m];if(d=ue.getNodeValues(g)){var y=ue.getNodeAttributeValue(g,"type"),b=ue.getNodeAttributeValue(g,"apiFramework"),A=ue.getNodeAttributeBooleanValue(g,"variableDuration");O.push({url:d,type:y,apiFramework:b,variableDuration:A})}}var w=ue.getSubNode(r,"ClosedCaptionFiles");if(w){var k=ue.getSubNodes(w,"ClosedCaptionFile");if(k&&k.length>0)for(h=0;h<k.length;h++)D.push({uri:ue.getNodeValues(k[h]),type:ue.getNodeAttributeValue(k[h],"type"),language:ue.getNodeAttributeValue(k[h],"language")})}}}else t={code:T,message:"MISSING MEDIA FILES"}}else t={code:T,message:"MISSING MEDIA FILES"}}else t={code:p,message:"INVALID VAST STRUCTURE"}}return t}(i);if(k&&k.code===T&&I.cbApnVastPlayer&&I.cbApnVastPlayer("err403",k.message),(0===M.length||null!==k)&&!v)return He(ge,k.message),void nt(k.code);K=JSON.parse(JSON.stringify(L)),$=R.slice(0),Z=U.slice(0),ee=B.slice(0),te=F.slice(0),ne=H.slice(0),z="";var E=JSON.stringify(function(e){for(var t=e;t>=0;)ut(t),t=me[t].parentIdx;return K}(me[ge].parentIdx)),S=JSON.stringify(function(e){for(var t=e;t>=0;)pt(t),t=me[t].parentIdx;return $}(me[ge].parentIdx)),Q=JSON.stringify(function(e){for(var t=e;t>=0;)ht(t),t=me[t].parentIdx;return Z.reverse(),Z}(me[ge].parentIdx)),Y=JSON.stringify(function(e){for(var t=e;t>=0;)vt(t),t=me[t].parentIdx;return te}(me[ge].parentIdx)),be=JSON.stringify(function(e){for(var t=e;t>=0;)ft(t),t=me[t].parentIdx;return ee}(me[ge].parentIdx)),Be=JSON.stringify(function(e){for(var t=e;t>=0;)mt(t),t=me[t].parentIdx;return ne}(me[ge].parentIdx)),Ke=function(e){for(var t=e;t>=0;)gt(t),t=me[t].parentIdx;return z}(me[ge].parentIdx),Ze=JSON.stringify(function(e){for(var t={required:"unknown",companions:[]},n=e;n>=0;)r.mergeCompanions(t,me[n].state.companions),n=me[n].parentIdx;return t}(me[ge].parentIdx)),tt=JSON.stringify(function(e){for(var t=[],n=e;n>=0;){for(var i=0;i<me[n].state.icons.length;i++)yt(t,me[n].state.icons[i].program)||t.push(me[n].state.icons[i]);n=me[n].parentIdx}return t}(me[ge].parentIdx));z="";var it=function(e){for(var t=e;t>0;){var n=me[t].parentIdx;r.mergeCompanions(me[n].state.companions,me[t].state.companions),t=n}return"unknown"===me[t].state.companions.required&&delete me[t].state.companions.required,me[t].state.companions}(ge);it=function(e){var t,n,i,r=[],o=[],a=e.companions;if(!e.companions)return e;for(n=a.length-1;n>=0;n--)if((t=a[n]).StaticResource||t.IFrameResource||t.HTMLResource){var s=!1;for(i=0;i<r.length;i++)if(t.width===r[i].width&&t.height===r[i].height){s=!0;break}s||r.push(t)}else o.push(t);for(n=0;n<o.length;n++)for(i=0;i<r.length;i++)o[n].width===r[i].width&&o[n].height===r[i].height&&(o[n].id&&o[n].id===r[i].id||!o[n].id)&&(o[n].CompanionClickTracking&&(r[i].CompanionClickTracking||(r[i].CompanionClickTracking=[]),r[i].CompanionClickTracking=r[i].CompanionClickTracking.concat(o[n].CompanionClickTracking)),o[n].TrackingEvents&&(r[i].TrackingEvents||(r[i].TrackingEvents=[]),r[i].TrackingEvents=r[i].TrackingEvents.concat(o[n].TrackingEvents)));var l={companions:r};return e.required&&(l.required=e.required),l}(it);var rt={vastVersion:he,withWrapper:pe,mediaFiles:M,trackingUrls:ut(ge),impressionUrls:pt(ge),clickUrls:ht(ge),clickTrackingUrls:vt(ge),customClicks:ft(ge),errorUrls:mt(ge),durationMsecs:G>0?G:X,skipOffset:J,extensions:gt(ge),adParameters:q,vastXml:j,extTrackingUrls:E,extImpressionUrls:S,extClickUrls:Q,extCustomClicks:be,extClickTrackingUrls:Y,extErrorUrls:Be,extExtensions:Ke,adId:Ct(u),sequence:me[0].state.sequence,companionAds:it,extCompanions:Ze,icons:At(ge),extIcons:tt,finalVastUri:Re};d&&(rt.notImpbusWaterfall=!0);var ot,at=JSON.stringify(function(e){for(var t=e;t>=0;)kt(t),t=me[t].parentIdx;return re}(me[ge].parentIdx)),st=kt(ge);if(st&&st.length>0&&(rt.extVerifications=at,rt.adVerifications=st),he.substr(0,1)>"2"&&D&&D.length>0&&(rt.closedCaptionFiles=D),he.substr(0,1)>"3"){se=Et(i),rt.universalAdId=se,le=St(),rt.contentId=le;var lt=ue.getSubNode(i,"AdServingId");lt&&(de=ue.getNodeValue(lt)),rt.adServingId=de;var bt=ue.getSubNode(i,"AdSystem");bt&&(rt.adSystem={name:ue.getNodeValue(bt),version:ue.getNodeAttributeValue(bt,"version")});var Pt=ue.getSubNode(i,"AdTitle");Pt&&(rt.adTitle=ue.getNodeValue(Pt));var xt=ue.getSubNode(i,"Description");xt&&(rt.description=ue.getNodeValue(xt));var Vt=ue.getSubNode(i,"Advertiser");Vt&&(rt.advertiser={name:ue.getNodeValue(Vt),id:ue.getNodeAttributeValue(Vt,"id")});var Mt=ue.getSubNode(i,"Pricing");Mt&&(rt.pricing={price:ue.getNodeAttributeNumberValue(Mt,"price"),model:ue.getNodeAttributeValue(Mt,"model"),currency:ue.getNodeAttributeValue(Mt,"currency")});var Nt=ue.getSubNodes(i,"Survey");if(Nt&&Nt.length>0)for(rt.surveys=[],ot=0;ot<Nt.length;ot++)rt.surveys.push({uri:ue.getNodeValue(Nt[ot]),type:ue.getNodeAttributeValue(Nt[ot],"type")});var Ot=ue.getSubNode(i,"Expires");if(Ot){var Dt=parseInt(ue.getNodeValue(Ot));!isNaN(Dt)&&Dt>0&&(rt.expires=Date.now()+1e3*Dt)}var Lt=function(e){var t=ue.getSubNodes(e,"Creative");if(t&&t.length>0)for(var n=0;n<t.length;n++){if(ue.getSubNode(t[n],"Linear")){var i=ue.getSubNode(t[n],"CreativeExtensions");if(i){var r=ue.getSubNodes(i,"CreativeExtension");if(r&&r.length>0){for(var o=[],a=0;a<r.length;a++){var s=ue.getSubNodeValue(r[a]);s&&o.push(s)}if(o.length>0)return o}}return null}}return null}(i);Lt&&Lt.length>0&&(rt.creativeExtensions=Lt),rt.conditionalAd=fe;var Rt=wt(i);if(Rt){for(var Ut=0;Ut<Rt.length;Ut++){if(!Rt[Ut].category||!Rt[Ut].authority)return He(ge,"invalid Category node"),void nt(m);if(It(Rt[Ut]))return He(ge,"ad is skipped due category violation"),void nt(g)}rt.categories=Rt}var Bt=JSON.stringify(function(e){for(var t=e;t>=0;)Tt(t),t=me[t].parentIdx;return ie}(me[ge].parentIdx)),Ft=Tt(ge);Ft&&Ft.viewable.length+Ft.notViewable.length+Ft.undetermined.length>0&&(rt.extViewableImpression=Bt,rt.viewableImpression=Ft),N&&(rt.mezzanine=N),O&&O.length>0&&(rt.interactiveCreativeFiles=O)}null!=l&&(rt.fallbackOnNoAd=l),we&&Ce.length>0&&(rt.notifyurl=Ce),Ne.length>0&&(rt.creative_id=Ne),_e.length>0&&(rt.buyerMemberId=_e),je.length>0&&(rt.brandCategoryId=je),Ve.length>0&&(rt.viewabilityConfig=Ve);var Ht=!1;if(Ae)x.content_source&&"rtb"===x.content_source&&(Ht=!0,rt.rtb=!0);else if(we&&!Te){var Wt=ue.getNodeAttributeValue(e,"rtb");Wt&&"true"===Wt&&(Ht=!0,rt.rtb=!0)}if(ye)return He(ge,"terminated"),void C(!1,x,"terminated",null,Ce);var zt=[];for(ot=0;ot<M.length;ot++)-1===zt.indexOf(M[ot].type)&&zt.push(M[ot].type);He(ge,"SUCCESS, Available="+JSON.stringify(zt)),jt(rt),I.telemetry&&(rt.telemetry=Object.assign({},Ue)),Ue={hops:[]},we||Te?(Te&&(!(f=function(){for(var e=-1,t=ge;t>=0;){var n=me[t].state;n.fallback.index>=0&&(e=n.fallback.index),t=me[t].parentIdx}return e}())&&Ee&&We(i),f>=0&&(rt.fallbackIndex=f,rt.fallbackOnNoAd=!0)),ke.push(rt),Ht?De++:Oe++,nt()):Le?(rt.vastXml=function(e,t){for(var n=(new DOMParser).parseFromString(e,"text/xml"),i=ue.getSubNode(n,"VAST"),r=ue.getSubNodes(i,"Ad"),o=0;o<r.length;){var s=ue.getNodeAttributeValue(r[o],"sequence");s&&parseInt(s)!==t?i.removeChild(r[o]):o++}var l;l="ie"===a.browser.name.toLowerCase()?(new XMLSerializer).serializeToString(n.childNodes[0]):n.childNodes[0].outerHTML;return l}(rt.vastXml,rt.sequence),ke.push(rt),nt()):C(!0,x,rt,null)}}function jt(e){var t,n=I.mainContentURI||"-1",i=["UNIVERSALADID","CONTENTID","ADSERVINGID","CONTENTURI","ADCOUNT","PODSEQUENCE"],r={UNIVERSALADID:e.universalAdId,CONTENTID:e.contentId,ADSERVINGID:e.adServingId,CONTENTURI:n,ADCOUNT:ze(),PODSEQUENCE:qe()};for(var o in ue.resolveMacrosArray(e.clickTrackingUrls,i,r,-1),ue.resolveMacrosArray(e.clickUrls,i,r,-1),ue.resolveMacrosArray(e.customClicks,i,r,-1),ue.resolveMacrosArray(e.errorUrls,i,r,-1),ue.resolveMacrosArray(e.impressionUrls,i,r,-1),e.trackingUrls)ue.resolveMacrosArray(e.trackingUrls[o],i,r,-1);if(e.icons&&e.icons.length>0)for(t=0;t<e.icons.length;t++)e.icons[t].IconClickTracking&&ue.resolveMacrosArray(e.icons[t].IconClickTracking,i,r,-1),e.icons[t].IconViewTracking&&ue.resolveMacrosArray(e.icons[t].IconViewTracking,i,r,-1);if(e.companionAds&&e.companionAds.companions&&e.companionAds.companions.length>0){var a=e.companionAds.companions;for(t=0;t<a.length;t++)if(a[t].CompanionClickTracking&&a[t].CompanionClickTracking.length>0&&(a[t].CompanionClickTracking=ue.resolveMacrosArray(a[t].CompanionClickTracking,i,r,-1)),a[t].TrackingEvents&&a[t].TrackingEvents.length>0)for(var s=0;s<a[t].TrackingEvents.length;s++)a[t].TrackingEvents[s].url=ue.resolveMacros(a[t].TrackingEvents[s].url,i,r);e.companionAds.companions=a}e.extClickTrackingUrls=ue.replaceMacrosWithValues(e.extClickTrackingUrls,i,r,-1),e.extClickUrls=ue.replaceMacrosWithValues(e.extClickUrls,i,r,-1),e.extCustomClicks=ue.replaceMacrosWithValues(e.extCustomClicks,i,r,-1),e.extErrorUrls=ue.replaceMacrosWithValues(e.extErrorUrls,i,r,-1),e.extImpressionUrls=ue.replaceMacrosWithValues(e.extImpressionUrls,i,r,-1),e.extTrackingUrls=ue.replaceMacrosWithValues(e.extTrackingUrls,i,r,-1)}E.always(S,"Version 3.2.32"),this.parse=function(e,t,n,i){C=i,function(e,t){var n,i,r,o;if(t&&R.push(t.trim()),e)if(Array.isArray(e)&&1===e.length){var a=e[0];if(a.impression_urls)for(i=0;i<a.impression_urls.length;i++)n=a.impression_urls[i].trim(),R.push(n);if(a.error_urls)for(i=0;i<a.error_urls.length;i++)n=a.error_urls[i].trim(),H.push(n);if(a.video_click_urls)for(i=0;i<a.video_click_urls.length;i++)n=a.video_click_urls[i].trim(),F.push(n);for(o in a.video_events)for(r=a.video_events[o],i=0;i<r.length;i++)n=r[i].trim(),L.hasOwnProperty(o)?Ge(L[o],n)||L[o].push(n):L[o]=[n]}else for(o in e)if("service"!==o)if(Array.isArray(e[o]))for(r=e[o],i=0;i<r.length;i++)n=r[i].trim(),"click"===o?F.push(n):"error"===o?H.push(n):"impression"===o?R.push(n):L.hasOwnProperty(o)?Ge(L[o],n)||L[o].push(n):L[o]=[n];else n=e[o].trim(),"click"===o?F.push(n):"error"===o?H.push(n):"impression"===o?R.push(n):L.hasOwnProperty(o)?Ge(L[o],n)||L[o].push(n):L[o]=[n]}(t,n),Ee=!0,ct(e)},this.parseAdObj=function(e,t,n){C=n,Ee=!0;var i=[],r=ue.getNodeAttributeValue(e,"id");r?r+="_suffix0":r="unknown_suffix0",e.id=r,Ue.hops.push({});if(t>="4.1"){var o=ue.getNodeAttributeValue(e,"adType");if(""!==o&&"video"!==o)return _t("outcome","failed"),_t("errCode",v),E.log(S,"Ignore non-video Ad node"),void et(v,"no Ad available")}i.push(e),at(e),st(e),ot(e),lt(e);var a={parentIdx:ge,currentIdx:0,children:i,state:it()};me.push(a),a.currentIdx=me.length-1,ge=a.currentIdx,Pt(me[ge].children[0],t)},this.terminate=function(){ye=!0}},l=n(87),d=n(88);e.exports={parse:function(e,t,n,i,r,o,a){var l=new s(n,i,a);return l.parse(e,r,o,(function(e,n,i,r,o){t&&t(e,n,i,r,o),l=null})),l},parseAdObj:function(e,t,n,i,r,o){var a=new s(i,r,o);return a.parseAdObj(e,t,(function(e,t,i,r,o,s){n&&n(e,t,i,r,o,s),a=null})),a},getUnwrappedVastTag:function(e,t,n,i,r,o,a,s,d){if(!e||!e.vastXml)return null;var c=new l(e,t,n,i,r,o,a,s,d),u=c.addTrackers();return c=null,u},getMergedVastTag:function(e,t){if(!e||0===e.length)return null;var n=new d(e,t),i=n.getVastXml();return n=null,i}}},function(e,t,n){e.exports=function(e){var t=n(79),i=e;this.getSubNodes=function(e,t){var n=e.getElementsByTagName(t);return n.length>0?n:null},this.getSubNode=function(e,t,n){n||(n=0);var i=e.getElementsByTagName(t);return i.length>n?i[n]:null},this.getNodeValue=function(e){if(0===e.childNodes.length)return"";var t=e.childNodes[0].nodeValue;return t?t.trim():""},this.getNodeValues=function(e){if(0===e.childNodes.length)return"";for(var t="",n=0;n<e.childNodes.length;n++){var i=e.childNodes[n].nodeValue;i&&(t+=i)}return t.trim()},this.getNodeAttributeValue=function(e,t){var n=e.getAttribute(t);return null===n&&(n=""),n},this.getNodeAttributeNumberValue=function(e,t,n){n||(n=0);var i=n,r=this.getNodeAttributeValue(e,t);return r.length>0&&(i=r.indexOf(".")>=0?parseFloat(r):parseInt(r)),i},this.getNodeAttributeBooleanValue=function(e,t,n){n||(n=!1);var i=n,r=this.getNodeAttributeValue(e,t);r.length>0&&(i="t"===r.toLowerCase().charAt(0));return i},this.getSubNodeValue=function(e,t,n){n=void 0===n?"":n;var i=this.getSubNode(e,t);return null!==i?this.getNodeValue(i):n},this.getSubNodeWholeValue=function(e,t,n){n=void 0===n?"":n;var i=this.getSubNode(e,t);return null!==i?this.getNodeValues(i):n},this.getSubNodeBooleanValue=function(e,t,n){n=void 0===n?"false":n;var i=this.getSubNodeValue(e,t);return i.length>0&&"t"===i.toLowerCase().charAt(0)||!(i.length>0&&"f"===i.toLowerCase().charAt(0))&&n},this.returnOnlyChildren=function(e,t){var n=[];if(t&&t.length>0)for(var i=0;i<t.length;i++)t[i].parentNode===e&&n.push(t[i]);return n},this.resolveMacros=function(e,n,r){var o,a={TIMESTAMP:function(){return(new Date).toISOString()},CACHEBUSTING:function(){return Math.floor(1e8*Math.random()).toString()},DEVICEUA:function(){return i&&!i.enforcePrivacy?navigator.userAgent:-2},SERVERSIDE:function(){return 0},DOMAIN:function(){try{return top&&top.location?top.location.hostname:-1}catch(e){return-1}},VASTVERSIONS:function(){return"2,3,5,6,7,8,310,311"},ADCATEGORIES:function(){return-1},GDPRCONSENT:function(){return-1},SERVERUA:function(){return-1},MEDIAMIME:function(){return"video/mp4,video/webm,video/ogg,application/javascript,application/x-javascript"},EXTENSIONS:function(){return-1},APIFRAMEWORKS:function(){return"1,2"},VERIFICATIONVENDORS:function(){return"appnexus.com-omid"},APPBUNDLE:function(){return-1},REGULATIONS:function(){return-1},OMIDPARTNER:function(){return"Appnexus/1.4.0"},BREAKMAXDURATION:function(){return-1},BREAKMINDURATION:function(){return-1},BREAKMAXADS:function(){return-1},BREAKMINADLENGTH:function(){return-1},BREAKMAXADLENGTH:function(){return-1},IFA:function(){return-1},IFATYPE:function(){return-1},DEVICEIP:function(){return-1},LATLONG:function(){return-1},PAGEURL:function(){var e;try{e=top&&top.location&&top.location.href?top.location.href:null}catch(e){t.info("VAST Parser","Xandr VAST parser is unable to resolve PAGEURL macro because top window is not accessible. A value of -1 will be used to resolve this macro.")}return e||-1}},s="string"==typeof e?e:e.url;for(o in a)s=s.split("["+o+"]").join(encodeURIComponent(a[o]()));return s=n?this.replaceMacrosWithValues(s,["ADTYPE","INVENTORYSTATE","ADCOUNT","PODSEQUENCE"],r,-1):this.replaceMacrosWithValues(s,["BLOCKEDADCATEGORIES","ADTYPE","ADCOUNT","PLACEMENTTYPE","INVENTORYSTATE"],r,-1),"object"==typeof e?(e.url=s,e):s},this.resolveMacrosArray=function(e,t,n,i){for(var r=0;r<e.length;r++)"string"==typeof e[r]?e[r]=this.replaceMacrosWithValues(e[r],t,n,i):"object"==typeof e[r]&&(e[r].url=this.replaceMacrosWithValues(e[r].url,t,n,i));return e},this.replaceMacrosWithValues=function(e,t,n,i){var r,o,a=0,s=t.length,l=i||-1;for(a=0;a<s;a++)r=t[a],e.indexOf(r)>=0&&(o=e.split("["+r+"]"),e=o.join(encodeURIComponent(n.hasOwnProperty(r)&&n[r]?n[r]:l)));return e},this.getDomain=function(e){return new URL(e).hostname},this.prepareAttributionData=function(e,t,n){var i=this.getNodeAttributeValue(e,"attributiontype");if(!i||"SINGLE-PING"!==i&&"DOUBLE-PING"!==i&&"SINGLE_PING"!==i&&"DOUBLE_PING"!==i)return t;var r={url:t,attributionType:i="SINGLE-PING"===i||"SINGLE_PING"===i?"SINGLE-PING":"DOUBLE-PING"};if("DOUBLE-PING"===i){var o=this.getNodeAttributeValue(e,"attributionsrc");o&&(n&&(o=this.resolveMacros(o,!0,n)),r.attributionSrc=o)}return r}}},function(e,t){var n=0,i=0,r=0,o=!1;function a(e,t){try{if(void 0!==e&&d(e)&&console){var n=o?"[XandrVideo":"[APN",i=function(e){switch(e){case 0:break;case 1:return"always";case 2:return"error";case 3:return"warn";case 4:return"info";case 5:return"log";case 6:return"debug";case 7:return"verbose"}}(e);if(console[i]||(n+="-"+i,i="log"),n+="]",n+="["+function(){var e="";try{var t=new Date;e=t.getHours()+":"+t.getMinutes()+":"+t.getSeconds()+"."+t.getMilliseconds()}catch(e){}return e}()+"]",t.splice(0,0,n),console[i].apply)console[i].apply(console,t);else{var r=Array.prototype.slice.apply(t).join("");console[i](r)}}}catch(e){}}function s(e){try{var t="";try{t=window.top.location.search}catch(e){try{t=window.location.search}catch(e){}}var n=new RegExp("[\\?&]"+e+"=([^&#]*)").exec(t);return null===n?"":decodeURIComponent(n[1].replace(/\+/g," "))}catch(e){return""}}function l(e){var t=0;try{if(void 0!==e){var n=parseInt(e);isNaN(n)?"boolean"==typeof e?t=e?6:0:"TRUE"===(e=e.toUpperCase())?t=6:"FALSE"===e&&(t=0):t=n}}catch(e){}return t}function d(e){return e<=n}e.exports={traceAtLevel:function(){try{if(arguments.length>0){var e=arguments[0],t=Array.prototype.slice.call(arguments,1);a.call(this,e,t)}}catch(e){}},always:function(){try{a.call(this,1,Array.prototype.slice.call(arguments))}catch(e){}},error:function(){try{a.call(this,2,Array.prototype.slice.call(arguments))}catch(e){}},log:function(){try{a.call(this,5,Array.prototype.slice.call(arguments))}catch(e){}},warn:function(){try{a.call(this,3,Array.prototype.slice.call(arguments))}catch(e){}},info:function(){try{a.call(this,4,Array.prototype.slice.call(arguments))}catch(e){}},debug:function(){try{a.call(this,6,Array.prototype.slice.call(arguments))}catch(e){}},verbose:function(){try{a.call(this,6,Array.prototype.slice.call(arguments))}catch(e){}},handleLogDebugLegacySupport:function(e,t){try{!function(e,t,n){try{var i="[APN-"+e+"-"+(new Date).toISOString()+"] ";null!==n&&n&&n.length>0&&(i+=n+">"),i+=t,d(e)&&console.log(i)}catch(t){d(e)&&console.log(t)}}(5,e,t)}catch(e){}},setDebugLevel:function(e){try{!function(e){try{r=l(e),n=Math.max(Math.max(i,r),n)}catch(e){}}(e)}catch(e){}},isTraceLevelActive:function(e){try{return d(e)}catch(e){return!1}},TRACE_LEVEL_ALWAYS:1,TRACE_LEVEL_ERROR:2,TRACE_LEVEL_WARN:3,TRACE_LEVEL_INFO:4,TRACE_LEVEL_LOG:5,TRACE_LEVEL_DEBUG:6,TRACE_LEVEL_VERBOSE:6},function(){try{var e=s("xdr_debug").toUpperCase();e&&e.length>0?(i=l(e),o=!0):i=l(s("ast_debug").toUpperCase()),n=Math.max(i,n)}catch(e){}}()},function(e,t){e.exports={parse:function(e,t,n){function i(e){var t,i,r,o=e.parentNode&&e.parentNode.parentNode?o=e.parentNode.parentNode:null,a="",s="unknown",l="unknown",d=function(){return s+" "+l};if(!o)return d();if(!(i=n.getSubNodes(o,"UniversalAdId")))return d();for(t=0;t<i.length;t++)r=i[t],s=n.getNodeAttributeValue(r,"idRegistry")||"unknown",l=n.getNodeValue(r)||"unknown",a.length>0&&(a+=","),a+=d();return a}var r=n.getNodeAttributeValue(t,"required");r&&r.length>0&&(e.required=r);var o=n.getSubNodes(t,"Companion");if(o)for(var a=0;a<o.length;a++){var s=o[a],l={},d=n.getNodeAttributeNumberValue(s,"width",-1),c=n.getNodeAttributeNumberValue(s,"height",-1);if(!(d<=0||c<=0)){l.width=d,l.height=c;var u=n.getNodeAttributeValue(s,"id");u&&(l.id=u),(u=n.getNodeAttributeNumberValue(s,"assetWidth",-1))>0&&(l.assetWidth=u),(u=n.getNodeAttributeNumberValue(s,"assetHeight",-1))>0&&(l.assetHeight=u),(u=n.getNodeAttributeNumberValue(s,"expandedWidth",-1))>0&&(l.expandedWidth=u),(u=n.getNodeAttributeNumberValue(s,"expandedHeight",-1))>0&&(l.expandedHeight=u),(u=n.getNodeAttributeValue(s,"apiFramework"))&&(l.apiFramework=u),(u=n.getNodeAttributeValue(s,"adSlotID"))&&(l.adSlotID=u);var p=n.getNodeAttributeNumberValue(s,"pxratio",1);1!==p&&(l.pxratio=p),(u=n.getNodeAttributeValue(s,"required"))&&(l.required=u),(u=n.getNodeAttributeValue(s,"renderingMode"))&&(l.renderingMode=u),(u=n.getSubNodeValue(s,"AltText"))&&(l.AltText=u),(u=n.getSubNodeValue(s,"AdParameters"))&&(l.AdParameters=u);var h=n.getSubNode(s,"StaticResource");if(h&&(u=n.getNodeAttributeValue(h,"creativeType"))){if("video/x-flv"===u||"video/x-f4v"===u||"video/f4v"===u||"application/x-shockwave-flash"===u)continue;var f={type:u};(u=n.getNodeValues(h))&&(f.src=u,l.StaticResource=f)}(u=n.getSubNodeWholeValue(s,"IFrameResource"))&&(l.IFrameResource=u),(u=n.getSubNodeWholeValue(s,"HTMLResource"))&&(l.HTMLResource=u),(u=n.getSubNodeWholeValue(s,"CompanionClickThrough"))&&(l.CompanionClickThrough=n.prepareAttributionData(n.getSubNode(s,"CompanionClickThrough"),u));var v,m,g,y,b=["UNIVERSALADID"],A={UNIVERSALADID:i(s)},w=n.getSubNodes(s,"CompanionClickTracking");if(w)for(l.CompanionClickTracking=[],v=0;v<w.length;v++)m=w[v],(g=n.getNodeValues(m))&&(g=n.replaceMacrosWithValues(g,b,A,-1),(y=n.prepareAttributionData(m,g))&&"string"!=typeof y&&y.url&&(y.url=n.replaceMacrosWithValues(y.url,b,A,-1)),l.CompanionClickTracking.push(y));var T=n.getSubNodes(s,"Tracking");if(T)for(l.TrackingEvents=[],v=0;v<T.length;v++){m=T[v];var k=n.getNodeAttributeValue(m,"event");g=n.getNodeValues(m),k&&g&&(g=n.replaceMacrosWithValues(g,b,A,-1),(y=n.prepareAttributionData(m,g))&&"string"!=typeof y&&y.url&&(y.url=n.replaceMacrosWithValues(y.url,b,A,-1)),l.TrackingEvents.push({eventType:k,url:y}))}e.companions.push(l)}}},mergeCompanions:function(e,t){"unknown"===e.required&&(e.required=t.required),e.companions=e.companions.concat(t.companions)},createCompanionNode:function(e,t){var n,i,r,o,a=e.createElement("Companion"),s=["id","width","height","assetWidth","assetHeight","expandedWidth","expandedHeight","apiFramework","adSlotID","required"];for(n=0;n<s.length;n++)t.hasOwnProperty(s[n])&&((r=e.createAttribute(s[n])).value=t[s[n]],a.setAttributeNode(r));t.hasOwnProperty("StaticResource")&&(i=e.createElement("StaticResource"),(r=e.createAttribute("creativeType")).value=t.StaticResource.type,i.setAttributeNode(r),o=e.createCDATASection(t.StaticResource.src),i.appendChild(o),a.appendChild(i));var l=["AdParameters","IFrameResource","HTMLResource","CompanionClickThrough"];for(n=0;n<l.length;n++)t.hasOwnProperty(l[n])&&(i=e.createElement(l[n]),o=e.createCDATASection(t[l[n]]),i.appendChild(o),a.appendChild(i));if(t.hasOwnProperty("AltText")){i=e.createElement("AltText");try{i.innerHTML=t.AltText}catch(e){try{i.textContent=t.AltText}catch(e){}}a.appendChild(i)}if(t.hasOwnProperty("CompanionClickTracking"))for(n=0;n<t.CompanionClickTracking.length;n++){var d=e.createElement("CompanionClickTracking");if("string"==typeof t.CompanionClickTracking[n])o=e.createCDATASection(t.CompanionClickTracking[n]);else{if("object"!=typeof t.CompanionClickTracking[n]||!t.CompanionClickTracking[n].url)continue;o=e.createCDATASection(t.CompanionClickTracking[n].url)}d.appendChild(o),a.appendChild(d)}if(t.hasOwnProperty("TrackingEvents")){for(i=e.createElement("TrackingEvents"),n=0;n<t.TrackingEvents.length;n++){var c=e.createElement("Tracking");if((r=e.createAttribute("event")).value=t.TrackingEvents[n].eventType,c.setAttributeNode(r),"string"==typeof t.TrackingEvents[n].url)o=e.createCDATASection(t.TrackingEvents[n].url);else{if("object"!=typeof t.TrackingEvents[n].url||!t.TrackingEvents[n].url.url)continue;o=e.createCDATASection(t.TrackingEvents[n].url.url)}c.appendChild(o),i.appendChild(c)}a.appendChild(i)}return a}}},function(e,t){var n={parse:function(e,t,n){var i=n.getSubNodes(t,"Icon");if(i)for(var r=0;r<i.length;r++){var o=i[r],a={},s=n.getNodeAttributeNumberValue(o,"width",-1),l=n.getNodeAttributeNumberValue(o,"height",-1),d=n.getNodeAttributeValue(o,"program"),c=n.getNodeAttributeValue(o,"xPosition"),u=n.getNodeAttributeValue(o,"yPosition");if(!(s<=0||l<=0||0===d.length||0===c.length||0===u.length)){a.width=s,a.height=l,a.program=d,a.xPosition=c,a.yPosition=u;var p=n.getNodeAttributeValue(o,"apiFramework");p&&(a.apiFramework=p);var h=n.getNodeAttributeNumberValue(o,"pxratio",1);if(1!==h&&(a.pxratio=h),p=n.getNodeAttributeValue(o,"offset")){if(isNaN(Date.parse("January 1, 1970 "+p)))continue;a.offset=p}if(p=n.getNodeAttributeValue(o,"duration")){if(isNaN(Date.parse("January 1, 1970 "+p)))continue;a.duration=p}(p=n.getNodeAttributeValue(o,"altText"))&&(a.altText=p),(p=n.getNodeAttributeValue(o,"hoverText"))&&(a.hoverText=p);var f=n.getSubNode(o,"StaticResource");if(f&&(p=n.getNodeAttributeValue(f,"creativeType"))){if("video/x-flv"===p||"video/x-f4v"===p||"video/f4v"===p||"application/x-shockwave-flash"===p)continue;var v={type:p};(p=n.getNodeValues(f))&&(v.src=p,a.StaticResource=v)}if((p=n.getSubNodeWholeValue(o,"IFrameResource"))&&(a.IFrameResource=p),(p=n.getSubNodeWholeValue(o,"HTMLResource"))&&(a.HTMLResource=p),a.StaticResource||a.IFrameResource||a.HTMLResource){var m,g=n.getSubNode(o,"IconClicks");if(g){var y=n.getSubNode(g,"IconClickThrough");if(y&&(a.IconClickThrough=n.prepareAttributionData(y,n.getNodeValues(y))),p=n.getSubNodes(g,"IconClickTracking")){a.IconClickTracking=[];for(var b=0;b<p.length;b++)m=n.prepareAttributionData(p[b],n.getNodeValues(p[b])),a.IconClickTracking.push(m)}}var A=n.getSubNodes(o,"IconViewTracking");if(A){a.IconViewTracking=[];for(var w=0;w<A.length;w++)m=n.prepareAttributionData(A[w],n.getNodeValues(A[w])),a.IconViewTracking.push(m)}!function(e,t){for(var n=0;n<e.length;n++)e[n].program===t&&e.splice(n,1)}(e,d),e.push(a)}}}},createIconNode:function(e,t){var n,i,r,o,a=e.createElement("Icon"),s=["width","height","program","xPosition","yPosition","apiFramework","offset","duration"];for(n=0;n<s.length;n++)t.hasOwnProperty(s[n])&&((r=e.createAttribute(s[n])).value=t[s[n]],a.setAttributeNode(r));t.hasOwnProperty("StaticResource")&&(i=e.createElement("StaticResource"),(r=e.createAttribute("creativeType")).value=t.StaticResource.type,i.setAttributeNode(r),o=e.createCDATASection(t.StaticResource.src),i.appendChild(o),a.appendChild(i));var l=["IFrameResource","HTMLResource","IconViewTracking"];for(n=0;n<l.length;n++)t.hasOwnProperty(l[n])&&(i=e.createElement(l[n]),o=e.createCDATASection(t[l[n]]),i.appendChild(o),a.appendChild(i));if(t.hasOwnProperty("IconClickThrough")||t.hasOwnProperty("IconClickTracking")){var d=e.createElement("IconClicks");t.hasOwnProperty("IconClickThrough")&&(i=e.createElement("IconClickThrough"),"string"==typeof t.IconClickThrough?o=e.createCDATASection(t.IconClickThrough):"object"==typeof t.IconClickThrough&&t.IconClickThrough.url&&(o=e.createCDATASection(t.IconClickThrough.url)),i.appendChild(o),d.appendChild(i)),t.hasOwnProperty("IconClickTracking")&&(i=e.createElement("IconClickTracking"),"string"==typeof t.IconClickTracking?o=e.createCDATASection(t.IconClickTracking):"object"==typeof t.IconClickTracking&&t.IconClickTracking.url&&(o=e.createCDATASection(t.IconClickTracking.url)),i.appendChild(o),d.appendChild(i)),a.appendChild(d)}return a}};e.exports=n},function(e,t,n){n(79).always("UserAgentParser","Version 0.0.1");var i=function(e,t){var n="model",r="name",o="type",a="vendor",s="version",l="mobile",d="tablet",c={extend:function(e,t){var n={};for(var i in e)t[i]&&t[i].length%2==0?n[i]=t[i].concat(e[i]):n[i]=e[i];return n},has:function(e,t){return"string"==typeof e&&-1!==t.toLowerCase().indexOf(e.toLowerCase())},lowerize:function(e){return e.toLowerCase()},major:function(e){return"string"==typeof e?e.replace(/[^\d\.]/g,"").split(".")[0]:void 0},trim:function(e){return e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")}},u={rgx:function(){var e,t,n,i,r,o,a={},s=0,l=arguments;for(n=0;n<l[1].length;n++)a["object"==typeof(i=l[1][n])?i[0]:i]=void 0;for(;s<l.length&&!r;){var d=l[s],c=l[s+1];for(e=t=0;e<d.length&&!r;)if(r=d[e++].exec(this.getUA()))for(n=0;n<c.length;n++)o=r[++t],"object"==typeof(i=c[n])&&i.length>0?2===i.length?"function"==typeof i[1]?a[i[0]]=i[1].call(this,o):a[i[0]]=i[1]:3===i.length?"function"!=typeof i[1]||i[1].exec&&i[1].test?a[i[0]]=o?o.replace(i[1],i[2]):void 0:a[i[0]]=o?i[1].call(this,o,i[2]):void 0:4===i.length&&(a[i[0]]=o?i[3].call(this,o.replace(i[1],i[2])):void 0):a[i]=o||void 0;s+=2}return a},str:function(e,t){for(var n in t)if("object"==typeof t[n]&&t[n].length>0){for(var i=0;i<t[n].length;i++)if(c.has(t[n][i],e))return"?"===n?void 0:n}else if(c.has(t[n],e))return"?"===n?void 0:n;return e}},p={browser:{oldsafari:{version:{"1.0":"/8",1.2:"/1",1.3:"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"}}},device:{amazon:{model:{"Fire Phone":["SD","KF"]}},sprint:{model:{"Evo Shift 4G":"7373KT"},vendor:{HTC:"APA",Sprint:"Sprint"}}},os:{windows:{version:{XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0",7:"NT 6.1",8:"NT 6.2",8.1:"NT 6.3",10:["NT 6.4","NT 10.0"],RT:"ARM"}}}},h={browser:[[/(opera\smini)\/([\w\.-]+)/i,/(opera\s[mobiletab]+).+version\/([\w\.-]+)/i,/(opera).+version\/([\w\.]+)/i,/(opera)[\/\s]+([\w\.]+)/i],[r,s],[/(opios)[\/\s]+([\w\.]+)/i],[[r,"Opera Mini"],s],[/\s(opr)\/([\w\.]+)/i],[[r,"Opera"],s],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer)[\/\s]?([\w\.]+)*/i,/(avant\s|iemobile|slim|baidu)(?:browser)?[\/\s]?([\w\.]*)/i,/(?:ms|\()(ie)\s([\w\.]+)/i,/(rekonq)\/([\w\.]+)*/i,/(chromium|flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs)\/([\w\.-]+)/i],[r,s],[/(trident).+rv[:\s]([\w\.]+).+like\sgecko/i],[[r,"IE"],s],[/(edge)\/((\d+)?[\w\.]+)/i],[r,s],[/(yabrowser)\/([\w\.]+)/i],[[r,"Yandex"],s],[/(comodo_dragon)\/([\w\.]+)/i],[[r,/_/g," "],s],[/(micromessenger)\/([\w\.]+)/i],[[r,"WeChat"],s],[/xiaomi\/miuibrowser\/([\w\.]+)/i],[s,[r,"MIUI Browser"]],[/\swv\).+(chrome)\/([\w\.]+)/i],[[r,/(.+)/,"$1 WebView"],s],[/android.+samsungbrowser\/([\w\.]+)/i,/android.+version\/([\w\.]+)\s+(?:mobile\s?safari|safari)*/i],[s,[r,"Android Browser"]],[/(chrome|omniweb|arora|[tizenoka]{5}\s?browser)\/v?([\w\.]+)/i,/(qqbrowser)[\/\s]?([\w\.]+)/i],[r,s],[/(uc\s?browser)[\/\s]?([\w\.]+)/i,/ucweb.+(ucbrowser)[\/\s]?([\w\.]+)/i,/juc.+(ucweb)[\/\s]?([\w\.]+)/i],[[r,"UCBrowser"],s],[/(dolfin)\/([\w\.]+)/i],[[r,"Dolphin"],s],[/((?:android.+)crmo|crios)\/([\w\.]+)/i],[[r,"Chrome"],s],[/;fbav\/([\w\.]+);/i],[s,[r,"Facebook"]],[/fxios\/([\w\.-]+)/i],[s,[r,"Firefox"]],[/version\/([\w\.]+).+?mobile\/\w+\s(safari)/i],[s,[r,"Mobile Safari"]],[/version\/([\w\.]+).+?(mobile\s?safari|safari)/i],[s,r],[/webkit.+?(mobile\s?safari|safari)(\/[\w\.]+)/i],[r,[s,u.str,p.browser.oldsafari.version]],[/(konqueror)\/([\w\.]+)/i,/(webkit|khtml)\/([\w\.]+)/i],[r,s],[/(navigator|netscape)\/([\w\.-]+)/i],[[r,"Netscape"],s],[/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo\sbrowser|minimo|conkeror)[\/\s]?([\w\.\+]+)/i,/(firefox|seamonkey|k-meleon|icecat|iceape|firebird|phoenix)\/([\w\.-]+)/i,/(mozilla)\/([\w\.]+).+rv\:.+gecko\/\d+/i,/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|sleipnir)[\/\s]?([\w\.]+)/i,/(links)\s\(([\w\.]+)/i,/(gobrowser)\/?([\w\.]+)*/i,/(ice\s?browser)\/v?([\w\._]+)/i,/(mosaic)[\/\s]([\w\.]+)/i],[r,s]],device:[[/\((ipad|playbook);[\w\s\);-]+(rim|apple)/i],[n,a,[o,d]],[/applecoremedia\/[\w\.]+ \((ipad)/],[n,[a,"Apple"],[o,d]],[/(apple\s{0,1}tv)/i],[[n,"Apple TV"],[a,"Apple"]],[/(archos)\s(gamepad2?)/i,/(hp).+(touchpad)/i,/(hp).+(tablet)/i,/(kindle)\/([\w\.]+)/i,/\s(nook)[\w\s]+build\/(\w+)/i,/(dell)\s(strea[kpr\s\d]*[\dko])/i],[a,n,[o,d]],[/(kf[A-z]+)\sbuild\/[\w\.]+.*silk\//i],[n,[a,"Amazon"],[o,d]],[/(sd|kf)[0349hijorstuw]+\sbuild\/[\w\.]+.*silk\//i],[[n,u.str,p.device.amazon.model],[a,"Amazon"],[o,l]],[/\((ip[honed|\s\w*]+);.+(apple)/i],[n,a,[o,l]],[/\((ip[honed|\s\w*]+);/i],[n,[a,"Apple"],[o,l]],[/(blackberry)[\s-]?(\w+)/i,/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|huawei|meizu|motorola|polytron)[\s_-]?([\w-]+)*/i,/(hp)\s([\w\s]+\w)/i,/(asus)-?(\w+)/i],[a,n,[o,l]],[/\(bb10;\s(\w+)/i],[n,[a,"BlackBerry"],[o,l]],[/android.+(transfo[prime\s]{4,10}\s\w+|eeepc|slider\s\w+|nexus 7|padfone)/i],[n,[a,"Asus"],[o,d]],[/(sony)\s(tablet\s[ps])\sbuild\//i,/(sony)?(?:sgp.+)\sbuild\//i],[[a,"Sony"],[n,"Xperia Tablet"],[o,d]],[/(?:sony)?(?:(?:(?:c|d)\d{4})|(?:so[-l].+))\sbuild\//i],[[a,"Sony"],[n,"Xperia Phone"],[o,l]],[/\s(ouya)\s/i,/(nintendo)\s([wids3u]+)/i],[a,n,[o,"console"]],[/android.+;\s(shield)\sbuild/i],[n,[a,"Nvidia"],[o,"console"]],[/(playstation\s[34portablevi]+)/i],[n,[a,"Sony"],[o,"console"]],[/(sprint\s(\w+))/i],[[a,u.str,p.device.sprint.vendor],[n,u.str,p.device.sprint.model],[o,l]],[/(lenovo)\s?(S(?:5000|6000)+(?:[-][\w+]))/i],[a,n,[o,d]],[/(htc)[;_\s-]+([\w\s]+(?=\))|\w+)*/i,/(zte)-(\w+)*/i,/(alcatel|geeksphone|huawei|lenovo|nexian|panasonic|(?=;\s)sony)[_\s-]?([\w-]+)*/i],[a,[n,/_/g," "],[o,l]],[/(nexus\s9)/i],[n,[a,"HTC"],[o,d]],[/(nexus\s6p)/i],[n,[a,"Huawei"],[o,l]],[/(microsoft);\s(lumia[\s\w]+)/i],[a,n,[o,l]],[/[\s\(;](xbox(?:\sone)?)[\s\);]/i],[n,[a,"Microsoft"],[o,"console"]],[/(kin\.[onetw]{3})/i],[[n,/\./g," "],[a,"Microsoft"],[o,l]],[/\s(milestone|droid(?:[2-4x]|\s(?:bionic|x2|pro|razr))?(:?\s4g)?)[\w\s]+build\//i,/mot[\s-]?(\w+)*/i,/(XT\d{3,4}) build\//i,/(nexus\s6)/i],[n,[a,"Motorola"],[o,l]],[/android.+\s(mz60\d|xoom[\s2]{0,2})\sbuild\//i],[n,[a,"Motorola"],[o,d]],[/hbbtv\/\d+\.\d+\.\d+\s+\([\w\s]*;\s*(\w[^;]*);([^;]*)/i],[[a,c.trim],[n,c.trim],[o,"smarttv"]],[/hbbtv.+maple;(\d+)/i],[[n,/^/,"SmartTV"],[a,"Samsung"],[o,"smarttv"]],[/\(dtv[\);].+(aquos)/i],[n,[a,"Sharp"],[o,"smarttv"]],[/android.+((sch-i[89]0\d|shw-m380s|gt-p\d{4}|gt-n\d+|sgh-t8[56]9|nexus 10))/i,/((SM-T\w+))/i],[[a,"Samsung"],n,[o,d]],[/smart-tv.+(samsung)/i],[a,[o,"smarttv"],n],[/((s[cgp]h-\w+|gt-\w+|galaxy\snexus|sm-\w[\w\d]+))/i,/(sam[sung]*)[\s-]*(\w+-?[\w-]*)*/i,/sec-((sgh\w+))/i],[[a,"Samsung"],n,[o,l]],[/sie-(\w+)*/i],[n,[a,"Siemens"],[o,l]],[/(maemo|nokia).*(n900|lumia\s\d+)/i,/(nokia)[\s_-]?([\w-]+)*/i],[[a,"Nokia"],n,[o,l]],[/android\s3\.[\s\w;-]{10}(a\d{3})/i],[n,[a,"Acer"],[o,d]],[/android\s3\.[\s\w;-]{10}(lg?)-([06cv9]{3,4})/i],[[a,"LG"],n,[o,d]],[/(lg) netcast\.tv/i],[a,n,[o,"smarttv"]],[/(nexus\s[45])/i,/lg[e;\s\/-]+(\w+)*/i],[n,[a,"LG"],[o,l]],[/android.+(ideatab[a-z0-9\-\s]+)/i],[n,[a,"Lenovo"],[o,d]],[/linux;.+((jolla));/i],[a,n,[o,l]],[/((pebble))app\/[\d\.]+\s/i],[a,n,[o,"wearable"]],[/android.+;\s(glass)\s\d/i],[n,[a,"Google"],[o,"wearable"]],[/android.+;\s(pixel c)\s/i],[n,[a,"Google"],[o,d]],[/android.+;\s(pixel xl|pixel)\s/i],[n,[a,"Google"],[o,l]],[/android.+(\w+)\s+build\/hm\1/i,/android.+(hm[\s\-_]*note?[\s_]*(?:\d\w)?)\s+build/i,/android.+(mi[\s\-_]*(?:one|one[\s_]plus|note lte)?[\s_]*(?:\d\w)?)\s+build/i],[[n,/_/g," "],[a,"Xiaomi"],[o,l]],[/android.+a000(1)\s+build/i],[n,[a,"OnePlus"],[o,l]],[/\s(tablet)[;\/]/i,/\s(mobile)(?:[;\/]|\ssafari)/i],[[o,c.lowerize],a,n]],engine:[[/windows.+\sedge\/([\w\.]+)/i],[s,[r,"EdgeHTML"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m)\/([\w\.]+)/i,/(khtml|tasman|links)[\/\s]\(?([\w\.]+)/i,/(icab)[\/\s]([23]\.[\d\.]+)/i],[r,s],[/rv\:([\w\.]+).*(gecko)/i],[s,r]],os:[[/microsoft\s(windows)\s(vista|xp)/i],[r,s],[/(windows)\snt\s6\.2;\s(arm)/i,/(windows\sphone(?:\sos)*)[\s\/]?([\d\.\s]+\w)*/i,/(windows\smobile|windows)[\s\/]?([ntce\d\.\s]+\w)/i],[r,[s,u.str,p.os.windows.version]],[/(win(?=3|9|n)|win\s9x\s)([nt\d\.]+)/i],[[r,"Windows"],[s,u.str,p.os.windows.version]],[/\((bb)(10);/i],[[r,"BlackBerry"],s],[/(blackberry)\w*\/?([\w\.]+)*/i,/(tizen)[\/\s]([\w\.]+)/i,/(android|webos|palm\sos|qnx|bada|rim\stablet\sos|meego|contiki)[\/\s-]?([\w\.]+)*/i,/linux;.+(sailfish);/i],[r,s],[/(symbian\s?os|symbos|s60(?=;))[\/\s-]?([\w\.]+)*/i],[[r,"Symbian"],s],[/\((series40);/i],[r],[/mozilla.+\(mobile;.+gecko.+firefox/i],[[r,"Firefox OS"],s],[/(nintendo|playstation)\s([wids34portablevu]+)/i,/(mint)[\/\s\(]?(\w+)*/i,/(mageia|vectorlinux)[;\s]/i,/(joli|[kxln]?ubuntu|debian|[open]*suse|gentoo|(?=\s)arch|slackware|fedora|mandriva|centos|pclinuxos|redhat|zenwalk|linpus)[\/\s-]?(?!chrom)([\w\.-]+)*/i,/(hurd|linux)\s?([\w\.]+)*/i,/(gnu)\s?([\w\.]+)*/i],[r,s],[/(cros)\s[\w]+\s([\w\.]+\w)/i],[[r,"Chromium OS"],s],[/(sunos)\s?([\w\.]+\d)*/i],[[r,"Solaris"],s],[/\s([frentopc-]{0,4}bsd|dragonfly)\s?([\w\.]+)*/i],[r,s],[/(haiku)\s(\w+)/i],[r,s],[/(ip[honead]+)(?:.*os\s([\w]+)*\slike\smac|;\sopera)/i],[[r,"iOS"],[s,/_/g,"."]],[/(mac\sos\sx)\s?([\w\s\.]+\w)*/i,/(macintosh|mac(?=_powerpc)\s)/i],[[r,"Mac OS"],[s,/_/g,"."]],[/((?:open)?solaris)[\/\s-]?([\w\.]+)*/i,/(aix)\s((\d)(?=\.|\)|\s)[\w\.]*)*/i,/(plan\s9|minix|beos|os\/2|amigaos|morphos|risc\sos|openvms)/i,/(unix)\s?([\w\.]+)*/i],[r,s]]};if(!(this instanceof i))return new i(e,t).getResult();var f=e||(window&&window.navigator&&window.navigator.userAgent?window.navigator.userAgent:""),v=t?c.extend(h,t):h;return this.getBrowser=function(){var e=u.rgx.apply(this,v.browser);return e.major=c.major(e.version),e},this.getDevice=function(){return u.rgx.apply(this,v.device)},this.getEngine=function(){return u.rgx.apply(this,v.engine)},this.getOS=function(){return u.rgx.apply(this,v.os)},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice()}},this.getUA=function(){return f},this};e.exports=i},function(e,t,n){var i=n(79),r=function(e){i.debug("CapabilityDetection",e)};function o(){return!!/Android|webOS|iPhone|iPad|BlackBerry|IEMobile|Windows Phone|Kindle|Silk|Opera Mini/i.test(navigator.userAgent)}function a(){return/iphone/i.test(navigator.userAgent.toLowerCase())||/ipad/i.test(navigator.userAgent.toLowerCase())}function s(){var e,t=navigator.userAgent,n=t.match(/(opera|chrome|safari|firefox|msie|trident(?=\/))\/?\s*(\d+)/i)||[];if(/trident/i.test(n[1]))return e=/\brv[ :]+(\d+)/g.exec(t)||[],"IE";if("Chrome"===n[1]){if(null!==(e=t.match(/\bOPR\/(\d+)/)))return"Opera";if(null!==(e=t.match(/\bEdg\/(\d+)/)))return"Edge"}return n=n[2]?[n[1],n[2]]:[navigator.appName,navigator.appVersion,"-?"],null!==(e=t.match(/version\/(\d+)/i))&&n.splice(1,1,e[1]),n[0]}e.exports={supportsFlash:function(){return!1},isBrowserOnMobile:function(){return o()},getBrowserName:function(){return s()},canPlay:function(e,t){var n=function(e,t,n){var i;return r("invoke canPlayType with video("+e+") and type("+t+") and codec("+n+")"),e&&e.canPlayType?(i=n&&""!==n?e.canPlayType(t+';codecs="'+n+'"'):e.canPlayType(t),r("result : "+i),i):(r("result : failed to invoke canPlayType with "+e),"")},i=null;if(function(e){return"video/x-flv"===e||"video/x-f4v"===e||"video/f4v"===e||"application/x-shockwave-flash"===e}(e.toLowerCase()))return!1;if(function(e){return"application/javascript"===e||"application/x-javascript"===e}(e.toLowerCase()))return!0;var o=e.toLowerCase();if(!t||""===t)if("video/mp4"===o)t="avc1.42E01E,mp4a.40.2",i="avc1.42E01E";else if("video/webm"===o)t="vp8,vorbis";else if("video/ogg"===o)t="theora,vorbis";else if(!function(e){return"audio/mpeg"===e||"audio/mp4"===e||"audio/ogg"===e||"audio/x-pn-realaudio"===e}(o)&&!function(e){return"video/x-ms-wmv"===e||"video/x-msvideo"===e||"video/mpeg"===e||"video/quicktime"===e||"video/3gpp"===e||"video/3gpp2"===e||"video/x-m4v"===e}(o))return!1;var a=document.createElement("video"),l=n(a,o,t);return"probably"===l||"maybe"===l&&(i?"probably"===n(a,o,i):function(e){if("video/3gpp"===e){var t=s();if("Chrome"===t||"Edge"===t)return!1}return!0}(o))},getPlatformType:function(){return o()?/android/i.test(navigator.userAgent.toLowerCase())?"mobile-Android":a()?"mobile-iOS":"mobile-unknown":"desktop-no-flash"}}},function(e,t,n){var i=n(79);var r,o=(r=window.document.featurePolicy)&&r.allowedFeatures&&r.allowedFeatures().includes("attribution-reporting")?(i.log("Attribution reporting is SUPPORTED"),!0):(i.log("Attribution reporting is NOT SUPPORTED"),!1);function a(e,t,i,r,o,s){var l,d=0,c=0,u=!1,p=n(85),h=n(86),f=!0,v=function(e){p.logDebug(e,"URL Loader")};if(o&&void 0!==o.withCredentials&&(f=o.withCredentials),window.XMLHttpRequest)l=new XMLHttpRequest;else if(window.ActiveXObject)try{l=new ActiveXObject("Msxml2.XMLHTTP")}catch(e){try{l=new ActiveXObject("Microsoft.XMLHTTP")}catch(e){}}l?(l.onreadystatechange=function(){if(4===l.readyState)if(200===l.status){if(v("duration: "+c+", response length: "+l.responseText.length),u&&l.responseText&&l.responseText.length>2048){var e=8*l.responseText.length*1e3/(1024*Math.max(1,c)),t=parseInt(e.toString());v("Bandwidth: "+t);try{h.setGenericData("anxBandwidth",t)}catch(e){}}i&&i.call(this,void 0,l.responseText,l)}else l.status>=400&&l.status<600&&i&&i.call(this,l.status,"",l);else 2===l.readyState?d=(new Date).getTime():3===l.readyState&&d>0&&(u=!0,c=(new Date).getTime()-d)},l.onerror=function(){if(f){var n=o||{};n.withCredentials=!1,a(e,t,i,r,n,s)}else if(i){var d=0===l.status?"404":l.status.toString();i.call(this,d,"",l)}},l.ontimeout=function(){i&&i.call(this,"Timeout","",l)},l.open(s,e),r&&(l.timeout=r),l.withCredentials=f,d=0,"POST"===s?l.send(t):l.send()):i&&i.call(this,"406","")}e.exports={load:function(e,t,n,i){var r=!0;!1===i&&(r=!1),a(e,null,t,n,{withCredentials:r},"GET")},loadPost:function(e,t,n,i){a(e,t,n,i,{withCredentials:!0},"POST")},trackPixel:function(e,t){!function(e,t){if(i.log("Logging Event: "+t+" at url:"+e),"string"==typeof e)new Image(1,1).src=e;else if("object"==typeof e){var n;if(e.url)if(o)if("SINGLE-PING"===e.attributionType){i.log("Event = "+t+" SINGLE-PING empty attributionsrc"),n=new Image(1,1);try{n.setAttribute("attributionsrc","")}catch(e){}n.src=e.url}else if("DOUBLE-PING"===e.attributionType){var r=e.attributionSrc?e.attributionSrc:"";i.log("Event = "+t+" DOUBLE-PING attributionsrc = "+r),n=new Image(1,1);try{n.setAttribute("attributionsrc",r)}catch(e){}n.src=e.url}else new Image(1,1).src=e.url;else new Image(1,1).src=e.url}}(e,t)}}},function(e,t,n){var i=n(79);function r(e){if(e)return e.responseXML?e.responseXML:e.responseText}e.exports={debug:function(){i.handleLogDebugLegacySupport.apply(this,arguments)},logDebug:function(){i.handleLogDebugLegacySupport.apply(this,arguments)},setDebugLevel:function(e){i.setDebugLevel(e)},isNotEmpty:function(e){var t=!1;return null!==e&&e&&(t=e.length>0),t},objectToString:function(e,t){var n="null";if(t=void 0!==t?t:0,null!==e){n="OBJ[";var i="";for(var r in e){var o=e[r];if("object"==typeof o)if(++t<9)try{o=this.objectToString(o)}catch(e){o="err:"+e}else o="err: max recursion hit";i.length>0&&(i+=","),i+=r+"="+o}n+=i,n+="]"}return n},getRandomString:function(){return Math.random().toString(36).substring(2)},traceVastFromXhr:function(e,t){try{if(e)if(Array.isArray(e)){if(e.length>0){var n=[];for(var o in e)n.push(e[o].responseURL);var a=e[e.length-1];if(a){var s=r(a),l=a.responseURL;i.info(t,"Tag load chain:",n,"\n","Final Tag URL: ",l,"\n","Final Tag: ",s)}}}else{var d=r(e);i.info(t,"Tag URL:",e.responseURL,"\n","Tag:",d)}}catch(e){}}}},function(e,t,n){var i=n(85),r=24e5,o={},a=2;function s(e,t,n){switch(a){case 0:case 1:break;default:case 2:!function(e,t){o&&(o[e]=t)}(e,t)}}function l(e){switch(a){case 0:case 1:return null;default:case 2:return function(e){if(o)return o[e]}(e)}}function d(e){switch(a){case 0:case 1:break;default:case 2:!function(e){o&&delete o[e]}(e)}}function c(e){return"apn_"+e}i.debug("Using Cache Method "+a,"Cache Manager"),e.exports={setGenericData:function(e,t){if(void 0!==e&&void 0!==t){e="___appnexus_video_cachemanager_generic_data___"+e;try{return s(e,t),!0}catch(e){}}return!1},getGenericData:function(e){if(void 0!==e)return l(e="___appnexus_video_cachemanager_generic_data___"+e)},deleteGenericData:function(e){void 0!==e&&d(e="___appnexus_video_cachemanager_generic_data___"+e)},forceStorageMethod:function(e){a=e,i.debug("Forced usage of cache method "+a,"Cache Manager")},addAd:function(e,t){e&&function(e,t){var n={};n.timestamp=(new Date).getTime(),n.ad=e;try{s(t,JSON.stringify(n))}catch(e){}}(e,c(t))},getAd:function(e){return function(e){var t,n=(new Date).getTime();try{var i=l(e);t=i&&JSON.parse(i),d(e)}catch(e){}return t&&t.timestamp&&t.timestamp>0&&n-t.timestamp<=r?t.ad:null}(c(e))},clearAd:function(e){!function(e){try{d(e)}catch(e){}}(c(e))},setTimeToLive:function(e){r=6e4*e},getNextAdToken:function(){return e=(t=l("___appnexus_video_cachemanager_ad_token___"))?parseInt(t):0,s("___appnexus_video_cachemanager_ad_token___",e+=1),e;var e,t}}},function(e,t,n){var i=n(78),r=n(80),o=n(81);e.exports=function(e,t,a,s,l,d,c,u,p){var h=n(79),f="VAST Parser",v=e,m=t,g=a,y=p,b=l,A=d,w=s,T=c,k=u,E=new i;var S=function(e){var t=function(e){var t=e.indexOf("<"),n=e.substr(-1===t?0:t);return-1!==(t=n.lastIndexOf(">"))&&(n=n.substr(0,t+1)),n}(e),n=null;if(void 0!==window.DOMParser){if("parsererror"===(n=(new DOMParser).parseFromString(t,"text/xml")).documentElement.nodeName){try{h.error(f,"Error reason = "+n.documentElement.childNodes[0].nodeValue)}catch(e){}return null}}else{if(void 0===window.ActiveXObject)return h.error(f,"Failed to get vast xml parser"),null;try{if((n=new window.ActiveXObject("Microsoft.XMLDOM")).loadXML(t),0!==n.parseError.errorCode)return h.error(f,n.parseError),null}catch(e){return h.error(f,"Failed to parse vast xml by window.ActiveXObject(Microsoft.XMLDOM)",e),null}}return n}(e.vastXml);function C(e,t){var n=S.createCDATASection(t);e.appendChild(n)}!function(e){if(S){var t=E.getSubNode(S,"VAST");if(t){var n=S.createAttribute("version");n.value=e,t.setAttributeNode(n)}}}(e.vastVersion),function(){if(S){var e=E.getSubNode(S,"VAST");if(e){var t=E.getSubNodes(e,"Ad");if(t&&t.length>0)for(var n=0;n<t.length;n++){if(g){var i=S.createAttribute("notifyurl");i.value=g,t[n].setAttributeNode(i)}if(w&&"rtb"===w){var r=S.createAttribute("rtb");r.value="true",t[n].setAttributeNode(r)}var o=S.createAttribute("sequence");if(o.value=v.sequence.toString(),t[n].setAttributeNode(o),b){var a=S.createAttribute("buyerMemberId");a.value=b,t[n].setAttributeNode(a)}if(T){var s=S.createAttribute("viewabilityConfig");s.value=T,t[n].setAttributeNode(s)}if(y){var l=S.createAttribute("creativeId");l.value=y,t[n].setAttributeNode(l)}if(A){var d=S.createAttribute("brandCategoryId");d.value=A,t[n].setAttributeNode(d)}}}}}();var I=null;function _(e,t){var n=E.getSubNodes(e,"Icon");if(n&&n.length>0)for(var i=0;i<n.length;i++){if(E.getNodeAttributeValue(n[i],"program").toLowerCase()===t.toLowerCase())return!0}return!1}function P(e,t){var n,i,o={companions:[]};r.parse(o,e,E);var a=o.companions;if(t.StaticResource||t.IFrameResource||t.HTMLResource){var s=!1;for(i=0;i<a.length;i++)if(t.width===a[i].width&&t.height===a[i].height){s=!0;break}s||(n=r.createCompanionNode(S,t),e.appendChild(n))}else{var l=!1;for(i=0;i<a.length;i++)if(t.width===a[i].width&&t.height===a[i].height&&(t.id&&t.id===a[i].id||!t.id)){t.CompanionClickTracking&&(a[i].CompanionClickTracking||(a[i].CompanionClickTracking=[]),a[i].CompanionClickTracking=a[i].CompanionClickTracking.concat(t.CompanionClickTracking)),t.TrackingEvents&&(a[i].TrackingEvents||(a[i].TrackingEvents=[]),a[i].TrackingEvents=a[i].TrackingEvents.concat(t.TrackingEvents)),l=!0;break}if(l){for(;e.firstChild;)e.removeChild(e.firstChild);for(var d=0;d<a.length;d++)n=r.createCompanionNode(S,a[d]),e.appendChild(n)}}}this.addTrackers=function(){if(!S)return"";var e,t=function(){var e;if(m){var t=E.getSubNode(S,"VAST");(e=S.createAttribute("adtoken")).value=m,t.setAttributeNode(e)}var i,r,o,a=E.getSubNode(S,"InLine");if(!a)return null;if(v.extImpressionUrls&&"string"==typeof v.extImpressionUrls){var s=JSON.parse(v.extImpressionUrls);if(Array.isArray(s)&&s.length>0)for(i=0;i<s.length;i++)C(r=S.createElement("Impression"),s[i]),a.appendChild(r);delete v.extImpressionUrls}if(k&&k.impressions)for(i=0;i<k.impressions.length;i++)k.impressions[i]&&(C(r=S.createElement("Impression"),k.impressions[i]),a.appendChild(r));if(v.extErrorUrls&&"string"==typeof v.extErrorUrls){var l=JSON.parse(v.extErrorUrls);if(Array.isArray(l)&&l.length>0)for(i=0;i<l.length;i++)C(o=S.createElement("Error"),l[i]),a.appendChild(o);delete v.extErrorUrls}if(k&&k.errors)for(i=0;i<k.errors.length;i++)k.errors[i]&&(C(o=S.createElement("Error"),k.errors[i]),a.appendChild(o));if(v.extViewableImpression&&"string"==typeof v.extViewableImpression){var d=JSON.parse(v.extViewableImpression),c=S.createElement("ViewableImpression");if(Array.isArray(d.viewable)&&d.viewable.length>0)for(i=0;i<d.viewable.length;i++){var u=S.createElement("Viewable");C(u,d.viewable[i]),c.appendChild(u)}if(Array.isArray(d.notViewable)&&d.notViewable.length>0)for(i=0;i<d.notViewable.length;i++){var p=S.createElement("NotViewable");C(p,d.notViewable[i]),c.appendChild(p)}if(Array.isArray(d.undetermined)&&d.undetermined.length>0)for(i=0;i<d.undetermined.length;i++){var h=S.createElement("ViewUndetermined");C(h,d.undetermined[i]),c.appendChild(h)}a.appendChild(c),delete v.extViewableImpression}if(v.extVerifications&&"string"==typeof v.extVerifications){var f,g=JSON.parse(v.extVerifications),y=E.getSubNode(a,"AdVerifications");y||(y=S.createElement("AdVerifications"),a.appendChild(y));var b=function(t){var n=S.createElement("JavaScriptResource");C(n,t.url),f.appendChild(n),t.apiFramework&&((e=S.createAttribute("apiFramework")).value=t.apiFramework,n.setAttributeNode(e)),t.browserOptional&&((e=S.createAttribute("browserOptional")).value=t.browserOptional,n.setAttributeNode(e))};for(i=0;i<g.length;i++){var A=g[i];if(f=S.createElement("Verification"),A.vendor&&((e=S.createAttribute("vendor")).value=A.vendor,f.setAttributeNode(e)),A.jsResources&&A.jsResources.forEach(b),A.trackingEvents){var w=S.createElement("TrackingEvents");for(var T in A.trackingEvents){var _=S.createElement("Tracking");(e=S.createAttribute("event")).value=T,_.setAttributeNode(e),C(_,A.trackingEvents[T]),w.appendChild(_)}f.appendChild(w)}if(A.verificationParameters){var P=S.createElement("VerificationParameters");C(P,A.verificationParameters),f.appendChild(P)}a.appendChild(f)}}var j,x=n(82)().browser.name.toLowerCase();if(v.extExtensions&&"string"==typeof v.extExtensions){var V=v.extExtensions;V.length>0&&((j=E.getSubNode(a,"Extensions"))?"ie"===x?j.textContent=j.textContent.toString()+V:j.innerHTML=j.innerHTML.toString()+V:(j=S.createElement("Extensions"),a.appendChild(j),"ie"===x?j.textContent=V:j.innerHTML=V)),delete v.extExtensions}if(v.hasOwnProperty("fallbackIndex")){(j=E.getSubNode(a,"Extensions"))||(j=S.createElement("Extensions"),a.appendChild(j));var M=!1,N=E.getSubNodes(j,"Extension");if(N&&N.length>0)for(i=0;i<N.length;i++){if("waterfall"===E.getNodeAttributeValue(N[i],"type")){M=!0,N[i].setAttribute("fallback_index",v.fallbackIndex);break}}if(!M){var O=S.createElement("Extension");(e=S.createAttribute("type")).value="waterfall",O.setAttributeNode(e);var D=S.createAttribute("fallback_index");D.value=v.fallbackIndex,O.setAttributeNode(D),j.appendChild(O)}}(I=E.getSubNode(a,"Creatives"))||(I=S.createElement("Creatives"),a.appendChild(I));var L=E.getSubNode(I,"Linear");if(!L){var R=S.createElement("Creative");I.appendChild(R),L=S.createElement("Linear"),R.appendChild(L)}return L}();if(!t)return"";!function(e){var t,n;if(v.extTrackingUrls&&"string"==typeof v.extTrackingUrls&&v.extTrackingUrls.length>5){var i=JSON.parse(v.extTrackingUrls),r=E.getSubNode(e,"TrackingEvents");for(var a in r||(r=S.createElement("TrackingEvents"),e.appendChild(r)),i){var s=i[a];for(t=0;t<s.length;t++){var l=S.createElement("Tracking"),d=S.createAttribute("event");d.value=a,l.setAttributeNode(d),C(l,s[t]),r.appendChild(l)}}delete v.extTrackingUrls}if(v.extClickUrls&&"string"==typeof v.extClickUrls){var c=JSON.parse(v.extClickUrls);if(Array.isArray(c)&&c.length>0&&((n=E.getSubNode(e,"VideoClicks"))||(n=S.createElement("VideoClicks"),e.appendChild(n)),!E.getSubNode(n,"ClickThrough"))){var u=S.createElement("ClickThrough");C(u,c[0]),n.appendChild(u)}delete v.extClickUrls}if(v.extCustomClicks&&"string"==typeof v.extCustomClicks){var p=JSON.parse(v.extCustomClicks);if(Array.isArray(p)&&p.length>0)for((n=E.getSubNode(e,"VideoClicks"))||(n=S.createElement("VideoClicks"),e.appendChild(n)),t=0;t<p.length;t++){var h=S.createElement("CustomClick");C(h,p[t]),n.appendChild(h)}delete v.extCustomClicks}if(v.extClickTrackingUrls&&"string"==typeof v.extClickTrackingUrls){var f=JSON.parse(v.extClickTrackingUrls);if(Array.isArray(f)&&f.length>0)for((n=E.getSubNode(e,"VideoClicks"))||(n=S.createElement("VideoClicks"),e.appendChild(n)),t=0;t<f.length;t++){var m=S.createElement("ClickTracking");C(m,f[t]),n.appendChild(m)}delete v.extClickTrackingUrls}if(v.extIcons&&"string"==typeof v.extIcons){var g=JSON.parse(v.extIcons);if(Array.isArray(g)&&g.length>0){var y=E.getSubNode(e,"Icons");for(y||(y=S.createElement("Icons"),e.appendChild(y)),t=0;t<g.length;t++)if(!_(y,g[t].program)){var b=o.createIconNode(S,g[t]);b&&y.appendChild(b)}}delete v.extIcons}}(t),I&&function(){if(v.extCompanions&&"string"==typeof v.extCompanions){var e=JSON.parse(v.extCompanions);if(Array.isArray(e.companions)&&e.companions.length>0){var t,n=E.getSubNode(I,"CompanionAds");n||(n=S.createElement("CompanionAds"),I.appendChild(n)),"unknown"!==e.required&&((t=S.createAttribute("required")).value=e.required,n.setAttributeNode(t));for(var i=0;i<e.companions.length;i++)P(n,e.companions[i])}}}();var i=n(82)().browser.name.toLowerCase();if("edge"===i)e=S.childNodes[0].outerHTML;else if("ie"===i){for(var r=S.getElementsByTagName("AdParameters"),a=0;a<r.length;a++)r[a].textContent.indexOf("]]>")>0&&"<![CDATA["!==r[a].textContent.substr(0,9)&&(r[a].textContent=r[a].textContent.replace(/]]>/g,"]]]]><![CDATA[>"),r[a].textContent="<![CDATA["+r[a].textContent+"]]>");e=(e=(e=(new XMLSerializer).serializeToString(S)).replace(/&lt;/g,"<")).replace(/&gt;/g,">")}else e=(new XMLSerializer).serializeToString(S);return e}}},function(e,t,n){var i=n(78);e.exports=function(e,t){var r=n(79),o="VAST Parser",a=e,s=new i;function l(e){var t=function(e){var t=e.indexOf("<"),n=e.substr(-1===t?0:t);return-1!==(t=n.lastIndexOf(">"))&&(n=n.substr(0,t+1)),n}(e),n=null;if(void 0!==window.DOMParser){if("parsererror"===(n=(new DOMParser).parseFromString(t,"text/xml")).documentElement.nodeName){try{r.error(o,"Error reason = "+n.documentElement.childNodes[0].nodeValue)}catch(e){}return null}}else{if(void 0===window.ActiveXObject)return r.error(o,"Failed to get vast xml parser"),null;try{if((n=new window.ActiveXObject("Microsoft.XMLDOM")).loadXML(t),0!==n.parseError.errorCode)return r.error(o,n.parseError),null}catch(e){return r.error(o,"Failed to parse vast xml by window.ActiveXObject(Microsoft.XMLDOM)",e),null}}return n}var d=l(a[0]);if(d){var c=s.getSubNode(d,"VAST"),u=d.createAttribute("apn_waterfall");u.value=!0,c.setAttributeNode(u),t&&((u=d.createAttribute("apn_fallback")).value=!0,c.setAttributeNode(u));for(var p=[],h=0;h<a.length;h++){var f=l(a[h]),v=s.getSubNode(f,"VAST"),m=s.getSubNodes(v,"Ad");if(m&&m.length>0)for(var g=0;g<m.length;g++)p.push(m[g])}p.sort((function(e,t){return s.getNodeAttributeNumberValue(e,"sequence")-s.getNodeAttributeNumberValue(t,"sequence")}));var y=n(82)().browser.name.toLowerCase();for("ie"===y?c.textContent="":c.innerHTML="",h=0;h<p.length;h++)c.appendChild(p[h]);this.getVastXml=function(){if(!d)return"";var e;if("edge"===y)e=d.childNodes[0].outerHTML;else if("ie"===y){for(var t=d.getElementsByTagName("AdParameters"),n=0;n<t.length;n++)t[n].textContent.indexOf("]]>")>0&&"<![CDATA["!==t[n].textContent.substr(0,9)&&(t[n].textContent=t[n].textContent.replace(/]]>/g,"]]]]><![CDATA[>"),t[n].textContent="<![CDATA["+t[n].textContent+"]]>");e=(e=(e=(new XMLSerializer).serializeToString(d)).replace(/&lt;/g,"<")).replace(/&gt;/g,">")}else e=(new XMLSerializer).serializeToString(d);return e}}}},function(e,t,n){var i=["video/mp4","video/webm","video/ogg","video/x-ms-wmv","video/x-msvideo","video/mpeg","video/quicktime","video/3gpp","video/3gpp2","video/x-m4v","application/javascript","application/x-javascript"],r=["audio/mpeg","audio/mp4","audio/ogg","audio/x-pn-realaudio","application/javascript","application/x-javascript"],o=[],a=0,s=n(86),l=n(79),d="Rendition Manager > ";function c(e,t){var n;if(t){for(n=0;n<r.length;n++)if(e===r[n])return!0}else for(n=0;n<i.length;n++)if(e===i[n])return!0;return!1}function u(e,t){for(var n=[],i=-1,r=0;r<o.length;r++)o[r].width>=e&&(-1===i||i>=o[r].width-e)&&(i>o[r].width-e&&(n.length=0),n.push(o[r]),i=o[r].width-e);if(n.length>0)o.length=0,o=n.slice();else{for(r=0;r<o.length;r++)o[r].width<e&&(-1===i||i>=e-o[r].width)&&(i>e-o[r].width&&(n.length=0),n.push(o[r]),i=e-o[r].width);n.length>0&&(o.length=0,o=n.slice())}if(1!==o.length){for(n.length=0,i=-1,r=0;r<o.length;r++)o[r].height>=t&&(-1===i||i>=o[r].height-t)&&(i>o[r].height-t&&(n.length=0),n.push(o[r]),i=o[r].height-t);if(n.length>0)o.length=0,o=n.slice();else{for(r=0;r<o.length;r++)o[r].height<t&&(-1===i||i>=t-o[r].height)&&(i>t-o[r].height&&(n.length=0),n.push(o[r]),i=t-o[r].height);n.length>0&&(o.length=0,o=n.slice())}}}function p(e){for(var t=[],n=-1,i=0;i<o.length;i++)o[i].bitrate<=e&&(-1===n||n>=e-o[i].bitrate)&&(n>e-o[i].bitrate&&(t.length=0),n=e-o[i].bitrate,t.push(o[i]));if(t.length>0)o.length=0,o=t.slice();else for(i=0;i<o.length;i++)o[i].bitrate>=e&&(-1===n||n>=o[i].bitrate-e)&&(n>o[i].bitrate-e&&(t.length=0),n=o[i].bitrate-e,t.push(o[i]));if(1===t.length||0===a)return t[0];if(1===a){for(i=0;i<t.length;i++)return t[i].type.toLowerCase(),t[i];return null}return t[0]}function h(e){return e?(e.requiredPlayer=1,e.success=!0,l.info(d,"Selected rendition: ",e),e):(l.error(d,"Failed to select rendition"),{success:!1,errorCode:403})}function f(e,t,n,i){var r=function(e,t,n){for(var i=null,r=[],a=0;a<o.length;)!o[a].apiFramework||o[a].apiFramework.toLowerCase().indexOf("vpaid")<0?(r.push(o[a]),o.splice(a,1)):a++;if(o.length>0){if(1===o.length)return o[0];u(e,t),i=1===o.length?o[0]:p(n)}return null===i&&(o=r.slice()),i}(e,t,n);return r?(r.type.toLowerCase(),l.info(d,"VPAID selected"),r):(a=1,0===o.length?null:1===o.length?(o[0].type.toLowerCase(),o[0]):(u(e,t),1===o.length?(l.log(d,"Rendition selected by size"),o[0].type.toLowerCase(),o[0]):(l.log(d,"Try select rendition by bitrate"),p(n))))}function v(e,t,n,i){i.playerTechnology=["html5"],a=1,function(e){for(var t=0;t<o.length;)c(o[t].type.toLowerCase(),e)?t++:o.splice(t,1)}(i.onlyAudio);var r,u=function(e){if(e&&e>0)return l.info(d,"Selected bitrate (not from cache): "+e),e;var t=1;try{var n=s.getGenericData("anxBandwidth");n?(t=n,l.info(d,"Selected bitrate (from cache): "+t)):l.info(d,"No bitrate data present in cache (use bitrate 1)")}catch(e){l.warn(d,"Exception during getting bitrate from cache (use bitrate 1)")}return t}(n),p=o.slice();o.length=0;for(var v=0;v<p.length;v++)o.push(p[v]);return l.log(d,"HTML5 rendition count = "+o.length),o.length>0&&(r=f(e,t,u))?h(r):h(null)}function m(e,t){for(var n=[],i=0;i<o.length;i++)o[i].width===e&&o[i].height===t&&n.push(o[i]);o.length=0,n.length>0&&(o=n.slice())}function g(e,t){for(var n=0;n<e.length;n++)if(e[n].id===t){e.splice(n,1);break}}e.exports={init:function(e){o=function(e){for(var t=[],n=0;n<e.length;n++){var i=e[n];i.hasOwnProperty("type")&&(i.hasOwnProperty("width")||(i.width=0),i.hasOwnProperty("height")||(i.height=0),i.hasOwnProperty("bitrate")||(i.bitrate=2147483647),t.push(i))}return t}(e)},getUrl:function(e,t,n,i){return v(e,t,n,i)},selectCompanionsForContainers:function(e,t){!function(e,t){if(e&&0!==e.companions.length&&t&&0!==t.length){o=[];for(var n=0;n<e.companions.length;n++){var i,r=e.companions[n];try{i=Object.assign({},r)}catch(e){try{var a=JSON.stringify(r);i=JSON.parse(a)}catch(e){continue}}i.id=n,i.type="unknown",r.hasOwnProperty("StaticResource")&&(i.type=r.StaticResource.type),o.push(i)}if(0!==o.length){var s=o.slice();for(n=0;n<t.length&&s.length>0;n++){var c=t[n];if(o.length=0,o=s.slice(),m(c.width,c.height),1!==o.length)if(0!==o.length){for(var u=!1,p=0;p<o.length;p++)if(o[p].apiFramework&&o[p].apiFramework.toLowerCase().indexOf("vpaid")<0){l.log(d,"Companion rendition selected by apiFramework"),c.companion=o[p],g(s,c.companion.id),u=!0;break}u||(l.log(d,"First companion rendition selected"),c.companion=o[0],g(s,c.companion.id))}else l.log(d,"Companion rendition not selected for container"),c.companion=null;else l.log(d,"Companion rendition selected by size"),c.companion=o[0],g(s,c.companion.id)}}}}(e,t)}}},function(e,t,n){var i=n(84),r=n(85),o={},a=n(79),s=function(e){a.warn("TM",e)},l=function(e){a.info("TM",e)},d=function(e){a.verbose("TM",e)};d("Tracking Manager Version 1.0.14");var c=null;function u(e,t){o||(o={}),o[t=t||"AN_DEFAULT"]||(o[t]={});var n={isImpression:!1,reportOnce:!0,reported:!1,urls:[]};o[t][e]=n,d("tracking data created, adId="+t+", event="+e)}function p(e){var t=e;switch(e){case"impressionUrls":t="impression";break;case"clickTrackingUrls":case"click":t="ad-click";break;case"errorUrls":t="error";break;case"imp_tracking_url":t="bid-impression";break;case"init_cb":t="ad-request";break;case"result_cb":t="ad-response";break;case"start":t="video-start";break;case"firstQuartile":t="video-first-quartile";break;case"midpoint":t="video-mid";break;case"thirdQuartile":case"thirdQuartile":t="video-third-quartile";break;case"complete":t="video-complete";break;case"unmute":t="audio-unmute";break;case"mute":t="audio-mute";break;case"pause":t="video-pause";break;case"rewind":t="rewind";break;case"resume":t="video-resume";break;case"fullscreen":t="video-fullscreen";break;case"exitFullscreen":t="video-exit-fullscreen";break;case"creativeView":t="creative-view";break;case"expand":t="ad-expand";break;case"collapse":t="ad-collapse";break;case"acceptInvitation":t="user-accept-invitation";break;case"close":t="user-close";break;case"progress":t="ad-progress";break;case"skip":t="video-skip"}return t}function h(e,t,n){n=n||"AN_DEFAULT",e=p(e),o.hasOwnProperty(n)&&o[n].hasOwnProperty(e)||u(e,n),o[n][e].urls.push(t),d("Tracking added, adId="+n+", event="+e+", url="+t)}function f(e,t){var n="";return r.isNotEmpty(e)&&r.isNotEmpty(t)&&(n=(e=p(e))+"_"+t),n}function v(e,t){var n=!1,i=o[t=t||"AN_DEFAULT"][e];return i&&i.hasOwnProperty("isImpression")&&(n=!0===i.isImpression),n}function m(e,t,n){(n=n||"AN_DEFAULT",r.isNotEmpty(e))&&(o.hasOwnProperty(n)&&o[n].hasOwnProperty(e)||u(e,n),o[n][e].reportOnce=t,d("setting report once, adId="+n+", event="+e+", setting="+t))}function g(e,t,n){n=n||"AN_DEFAULT",e=p(e),o.hasOwnProperty(n)&&o[n].hasOwnProperty(e)||u(e,n),o[n][e].isImpression=t}function y(e,t){var n;n="requesting tracking for "+t+", url="+e,a.log("TM",n),i.trackPixel(e,t)}function b(e,t){if(t){var n=t.value;if(n=n&&"number"==typeof n?n.toString():n,r.isNotEmpty(n)){var i=t.macro;r.isNotEmpty(i)?e.indexOf(i)>-1&&(e=function(e,t,n){var i=e;return e.indexOf(n)>-1&&(i=e.replace(n,t)),i}(e,n,i)):e=function(e,t){var n="?";return e.indexOf("?")>-1&&(n="&"),e+n+t}(e,n)}}return e}var A,w={TIMESTAMP:(new Date).toISOString(),MEDIAPLAYHEAD:null,BREAKPOSITION:null,ADCOUNT:null,TRANSACTIONID:(A=(new Date).getTime(),"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(e){var t=(A+16*Math.random())%16|0;return A=Math.floor(A/16),("x"===e?t:3&t|8).toString(16)}))),PLACEMENTTYPE:null,IFA:-1,IFATYPE:-1,CLIENTUA:null,DEVICEIP:null,LATLONG:-1,PAGEURL:function(){try{return top&&top.location&&top.location.href?top.location.href:-1}catch(e){return-1}}(),APPNAME:-1,APIFRAMEWORKS:"2,7",EXTENSIONS:-1,PLAYERCAPABILITIES:null,CLICKTYPE:null,PLAYERSTATE:null,PLAYERSIZE:null,ADPLAYHEAD:null,ASSETURI:null,PODSEQUENCE:null,CLICKPOS:-1,LIMITADTRACKING:null};function T(e){for(var t in w)if(e.indexOf("["+t+"]")>=0){var n=w[t];null===n&&(n=c?c.resolveMacro(t):-1),e=e.split("["+t+"]").join(encodeURIComponent(n))}return e}function k(e,t,n){n=n||"AN_DEFAULT";var i=!1;if(o.hasOwnProperty(n)&&o[n].hasOwnProperty(e)){var a=o[n][e];if(a)if(a.reportOnce&&a.reported)l("Cannot report event - event has already been reported: "+e+" for adId="+n),i=!0;else{var d=a.urls;if(d){a.reported=!0;for(var c=0;c<d.length;c++){var u=d[c],p="";if("string"==typeof u?p=u:"object"==typeof u&&(p=u.url),r.isNotEmpty(p)){i=!0,t&&(p=b(p,t));var h=""+Math.floor(1e7*Math.random());if(p.indexOf("[CACHEBUSTING]")>-1)p=b(p,{macro:"[CACHEBUSTING]",value:h});else if(!a.reportOnce&&"ad-click"!==e)p=b(p,{value:"apn_rnd="+h});p=T(p),"string"==typeof u?u=p:"object"==typeof u&&(u.url=p),y(u,e)}}}}}i||s("No tracking urls found for adId="+n+", event = "+e)}function E(e,t,n,i){k(f(e,t),function(e){d("Creating params for mediation tracking from obj: "+r.objectToString(e));var t={},n="";if(e)for(var i in e){if(null!==e[i]&&"undefined"!==e[i])n.length>0&&(n+="&"),n+=i+"="+e[i]}return t.value=n,t}(n),i)}function S(e){return"progress>"+e}function C(e){if(e=e||"AN_DEFAULT",o&&o.hasOwnProperty(e)){var t=o[e];for(var n in delete o[e],t)d("Removing event: "+n+" for adId="+e)}}e.exports={init:function(e,t){if(C(t),e)for(var n=0;n<e.length;n++)m(e[n],!1,t)},setPlayer:function(e){c=e},addTrackingEvent:function(e,t,n){h(e,t,n)},addTrackingEvents:function(e,t){if(e)for(var n in e){var i=e[n];if(r.isNotEmpty(i))for(var o=0;o<i.length;o++)h(n,i[o],t)}},addMediationTrackingEvent:function(e,t,n,i){var r=f(e,t);d("creating event name for adId="+(i||"AN_DEFAULT")+", event="+e+", networkName="+t+" =>"+r),h(r,n,i)},addProgressTrackingEvent:function(e,t,n){h(S(e),t,n)},markAsImpressionEvent:function(e,t,n){d("marking event as impression: "+e+", adId="+(n||"AN_DEFAULT")+", value="+t),g(e,t,n)},markAsMediationImpressionEvent:function(e,t,n,i){r.isNotEmpty(n)&&(e=f(e,n)),d("marking event as impression: "+e+", adId="+(i||"AN_DEFAULT")+", value="+t),g(e,t,i)},reportOnlyOnce:function(e,t,n){m(e,t,n)},reportMediationOnlyOnce:function(e,t,n,i){!function(e,t,n,i){i=i||"AN_DEFAULT",r.isNotEmpty(e)&&(e=p(e),r.isNotEmpty(n)&&(e=f(e,n)),o.hasOwnProperty(i)&&o[i].hasOwnProperty(e)||u(e,i),o[i][e].reportOnce=t,d("setting report once, adId="+i+", event="+e+", setting="+t))}(e,t,n,i)},resetTrackingHistory:function(e,t){!function(e,t){if(t=t||"AN_DEFAULT",o&&o.hasOwnProperty(t)){var n=o[t];for(var i in n){if(v(i,t)&&!e)d("reset history skipping impression event="+i+", adId="+t);else o[t][i].reported=!1,d("reset history for adId= "+t+", event="+i)}}}(e,t)},requestTracking:function(e,t){l("tracking requested for "+e+", adId="+(t||"AN_DEFAULT")),k(e,null,t)},getTrackingUrls:function(e,t){return l("URLs requested for "+e+", adId="+(t||"AN_DEFAULT")),function(e,t){t=t||"AN_DEFAULT";var n=[],i=!1;if(o.hasOwnProperty(t)&&o[t].hasOwnProperty(e)){var a=o[t][e];if(a){var l=a.urls;if(l)for(var d=0;d<l.length;d++){var c=l[d],u="";"string"==typeof c?u=c:"object"==typeof c&&(u=c.url),r.isNotEmpty(u)&&(i=!0,u=T(u),"string"==typeof c?c=u:"object"==typeof c&&(c.url=u),n.push(c))}}}return i||s("No tracking urls found for adId="+t+", event = "+e),n}(e,t)},requestParamTracking:function(e,t,n){l("tracking requested for "+e+" with param="+r.objectToString(t)+", adId="+(n||"AN_DEFAULT")),k(e,t,n)},requestMediationTracking:function(e,t,n,i){l("tracking requested for mediation event: "+e+", network="+t+" , params="+r.objectToString(n)+", adId="+(i||"AN_DEFAULT")),E(e,t,n,i)},requestErrorTracking:function(e,t,n,i){l("error reported: "+e+", type="+t+", desc="+n);var r={},o="";switch(t){case 1:r.macro="[ERRORCODE]",r.value=e,o="error";break;default:r.value="error="+e,o="error"}this.requestParamTracking(o,r,i)},requestErrorTrackingUrls:function(e,t,n,i){var a={},s="";switch(t){case 1:a.macro="[ERRORCODE]",a.value=e,s="error";break;default:a.value="error="+e,s="error"}return function(e,t,n){n=n||"AN_DEFAULT";var i=[];if(o.hasOwnProperty(n)&&o[n].hasOwnProperty(e)){var a=o[n][e];if(a){var s=a.urls;if(s)for(var l=0;l<s.length;l++){var d=s[l],c="";if("string"==typeof d?c=d:"object"==typeof d&&(c=d.url),r.isNotEmpty(c)){if(t&&(c=b(c,t)),c.indexOf("[CACHEBUSTING]")>-1)c=b(c,{macro:"[CACHEBUSTING]",value:""+Math.floor(1e7*Math.random())});c=T(c),"string"==typeof d?d=c:"object"==typeof d&&(d.url=c),i.push(d)}}}}return i}(s,a,i)},requestProgressTracking:function(e,t){var n=S(e);l("Tracking requested for progress event, adId="+(t||"AN_DEFAULT")+", offset="+e),this.requestTracking(n,t)},removeEvents:function(e){C(e)},removeEventsForKey:function(e,t){!function(e,t){if(t=t||"AN_DEFAULT",o&&o.hasOwnProperty(t)){var n=o[t];for(var i in n)i.indexOf(e)>-1&&(delete o[t][i],d("Removing event: "+i+" for key="+e+" and adId="+t));0===o[t].length&&delete o[t]}}(e,t)},removeAllEvents:function(){o={}}}},function(e,t,n){var i=n(89),r=n(79),o="CompanionsHandler > ",a=function(e,t,i,a,s){var l=e,d=a,c=s,u={width:t,height:i},p=(new Date).getTime()+Math.floor(1e4*Math.random());c({command:"addTrackingEvents",uniqueId:p,data:d});var h=function(){if(d.CompanionClickTracking&&c({command:"requestTracking",uniqueId:p,data:"companion-click"}),d.hasOwnProperty("StaticResource")&&d.CompanionClickThrough){var e=d.CompanionClickThrough;if("string"==typeof e)window.open(e);else if("object"==typeof e&&e.url&&"string"==typeof e.url)if((n=window.document.featurePolicy)&&n.allowedFeatures&&n.allowedFeatures().includes("attribution-reporting"))if("SINGLE-PING"===e.attributionType)r.log(o,"Open new companion window with SINGLE-PING empty attributionsrc"),window.open(e.url,"_blank","attributionsrc");else if("DOUBLE-PING"===e.attributionType)if(e.attributionSrc){var t=encodeURIComponent(e.attributionSrc);r.log(o,"Open new companion window with DOUBLE-PING attributionsrc = "+t),window.open(e.url,"_blank","attributionsrc="+t)}else r.log(o,"Open new companion window with DOUBLE-PING empty attributionsrc"),window.open(e.url,"_blank","attributionsrc");else window.open(e.url);else window.open(e.url)}var n},f=function(){d.TrackingEvents&&d.TrackingEvents.length>0&&c({command:"requestTracking",uniqueId:p,data:"creative-view"})},v=!0;if(d.hasOwnProperty("StaticResource")){var m=d.StaticResource.type;if("application/x-javascript"===m){var g=document.createElement("script");g.src=d.StaticResource.src,g.onload=f(),l.appendChild(g)}else if(0===m.indexOf("image")){var y=document.createElement("img");y.src=d.StaticResource.src,y.style.maxWidth="100%",y.style.maxHeight="100%",y.style.width="auto",y.style.height="auto",y.style.margin="auto",y.style.display="block",y.style.top=0,y.style.bottom=0,y.style.left=0,y.style.right=0,y.style.position="absolute",y.onload=f(),y.onclick=h,v=!1,y.style.cursor="pointer",l.innerHTML="",l.style.position||(l.style.position="relative"),l.appendChild(y)}}else if(d.hasOwnProperty("IFrameResource")){var b=document.createElement("iframe");b.src=d.IFrameResource,b.scrolling="no",b.style.width="100%",b.style.height="100%",b.style.border="none",b.style.overflow="hidden",b.onload=f(),v=!1,l.innerHTML="",l.appendChild(b)}else if(d.hasOwnProperty("HTMLResource")){if(0===d.HTMLResource.indexOf("http"))n(84).load(d.HTMLResource,(function(e,t){e||0===t.length||(l.style.display="inline-block",l.style.position||(l.style.position="relative"),l.innerHTML=t,f())}));else l.style.display="inline-block",l.style.position||(l.style.position="relative"),l.innerHTML=d.HTMLResource,f()}v&&(d.hasOwnProperty("StaticResource")&&d.CompanionClickThrough&&(l.style.cursor="pointer"),l.onclick=h),this.stop=function(){"concurrent"===d.renderingMode&&(l.innerHTML="")},this.getData=function(){return{container:l,companionData:d,size:u}}},s=function(e,t,n){var s=e,l=t,d=n,c=[];r.always(o,"Version: 0.1.13");for(var u=[],p=0;p<l.companionContainers.length;p++)try{var h=window.getComputedStyle(l.companionContainers[p],null),f={id:p,width:parseInt(h.width),height:parseInt(h.height),companion:null};u.push(f)}catch(e){}for(i.selectCompanionsForContainers(s,u),p=0;p<u.length;p++)if(u[p].companion){var v=new a(l.companionContainers[p],u[p].width,u[p].height,u[p].companion,d);c.push(v)}this.stop=function(){for(p=0;p<c.length;p++)c[p].stop();c.length=0},this.getCompanionsData=function(){var e=[];for(p=0;p<c.length;p++)e.push(c[p].getData());return e}};e.exports={renderCompanions:function(e,t,n){return r.log(o,"renderCompanions called."),new s(e,t,n)},stopCompanions:function(e){e&&e.stop()},parse:function(e){return function(e){if(0===e.length)return r.warn(o,"parseCompanions > empty companions xml"),null;"<CompanionAds"!==(e=function(e){var t=e.indexOf("<"),n=e.substr(-1===t?0:t);return-1!==(t=n.lastIndexOf(">"))&&(n=n.substr(0,t+1)),n.trim()}(e)).substr(0,13)&&(e="<CompanionAds>"+e+"</CompanionAds>");var t=null;if(void 0!==window.DOMParser){if("parsererror"===(t=(new DOMParser).parseFromString(e,"text/xml")).documentElement.nodeName){try{r.error(o,"parseCompanions > Error reason = "+t.documentElement.childNodes[0].nodeValue)}catch(e){}return r.warn(o,"parseCompanions > invalide xml structure"),null}}else{if(void 0===window.ActiveXObject)return r.error(o,"parseCompanions > Failed to parse vast xml by window.ActiveXObject(Microsoft.XMLDOM)"),null;try{if((t=new window.ActiveXObject("Microsoft.XMLDOM")).loadXML(e),0!==t.parseError.errorCode)return r.error(o,t.parseError),null}catch(e){return r.error(o,"parseCompanions > Failed to parse vast xml by window.ActiveXObject(Microsoft.XMLDOM)",e),null}}return t?n(92).parse(t):(r.error(o,"parseCompanions > invalid xml structure"),null)}(e)}}},function(e,t){var n={parse:function(e){var t={companions:[]},n=new function(){this.getSubNodes=function(e,t){var n=e.getElementsByTagName(t);return n.length>0?n:null},this.getSubNode=function(e,t,n){n||(n=0);var i=e.getElementsByTagName(t);return i.length>n?i[n]:null},this.getNodeValue=function(e){return 0===e.childNodes.length?"":e.childNodes[0].nodeValue.trim()},this.getNodeValues=function(e){if(0===e.childNodes.length)return"";for(var t="",n=0;n<e.childNodes.length;n++){t+=e.childNodes[n].nodeValue}return t.trim()},this.getNodeAttributeValue=function(e,t){var n=e.getAttribute(t);return null===n&&(n=""),n},this.getNodeAttributeNumberValue=function(e,t,n){n||(n=0);var i=n,r=this.getNodeAttributeValue(e,t);return r.length>0&&(i=r.indexOf(".")>=0?parseFloat(r):parseInt(r)),i},this.getNodeAttributeBooleanValue=function(e,t,n){n||(n=!1);var i=n,r=this.getNodeAttributeValue(e,t);r.length>0&&(i="t"===r.toLowerCase().charAt(0));return i},this.getSubNodeValue=function(e,t,n){n=void 0===n?"":n;var i=this.getSubNode(e,t);return null!==i?this.getNodeValue(i):n},this.getSubNodeWholeValue=function(e,t,n){n=void 0===n?"":n;var i=this.getSubNode(e,t);return null!==i?this.getNodeValues(i):n},this.getSubNodeBooleanValue=function(e,t,n){n=void 0===n?"false":n;var i=this.getSubNodeValue(e,t);return i.length>0&&"t"===i.toLowerCase().charAt(0)||!(i.length>0&&"f"===i.toLowerCase().charAt(0))&&n},this.prepareAttributionData=function(e,t){var n=this.getNodeAttributeValue(e,"attributiontype");if(!n||"SINGLE-PING"!==n&&"DOUBLE-PING"!==n&&"SINGLE_PING"!==n&&"DOUBLE_PING"!==n)return t;var i={url:t,attributionType:n="SINGLE-PING"===n||"SINGLE_PING"===n?"SINGLE-PING":"DOUBLE-PING"};if("DOUBLE-PING"===n){var r=this.getNodeAttributeValue(e,"attributionsrc");r&&(i.attributionSrc=r)}return i}},i=n.getSubNode(e,"CompanionAds"),r=n.getNodeAttributeValue(i,"required");r&&r.length>0&&(t.required=r);var o=n.getSubNodes(i,"Companion");if(o)for(var a=0;a<o.length;a++){var s=o[a],l={},d=n.getNodeAttributeNumberValue(s,"width",-1),c=n.getNodeAttributeNumberValue(s,"height",-1);if(!(d<=0||c<=0)){l.width=d,l.height=c;var u=n.getNodeAttributeValue(s,"id");u&&(l.id=u),(u=n.getNodeAttributeNumberValue(s,"assetWidth",-1))>0&&(l.assetWidth=u),(u=n.getNodeAttributeNumberValue(s,"assetHeight",-1))>0&&(l.assetHeight=u),(u=n.getNodeAttributeNumberValue(s,"expandedWidth",-1))>0&&(l.expandedWidth=u),(u=n.getNodeAttributeNumberValue(s,"expandedHeight",-1))>0&&(l.expandedHeight=u),(u=n.getNodeAttributeValue(s,"apiFramework"))&&(l.apiFramework=u),(u=n.getNodeAttributeValue(s,"adSlotId"))&&(l.adSlotId=u),(u=n.getNodeAttributeValue(s,"required"))&&(l.required=u),(u=n.getNodeAttributeValue(s,"renderingMode"))&&(l.renderingMode=u),(u=n.getSubNodeValue(s,"AltText"))&&(l.AltText=u),(u=n.getSubNodeValue(s,"AdParameters"))&&(l.AdParameters=u);var p,h,f,v,m=n.getSubNode(s,"StaticResource");if(m&&(u=n.getNodeAttributeValue(m,"creativeType"))){if("video/x-flv"===u||"video/x-f4v"===u||"video/f4v"===u||"application/x-shockwave-flash"===u)continue;var g={type:u};(u=n.getNodeValues(m))&&(g.src=u,l.StaticResource=g)}(u=n.getSubNodeWholeValue(s,"IFrameResource"))&&(l.IFrameResource=u),(u=n.getSubNodeWholeValue(s,"HTMLResource"))&&(l.HTMLResource=u),(u=n.getSubNodeValue(s,"CompanionClickThrough"))&&(l.CompanionClickThrough=n.prepareAttributionData(n.getSubNode(s,"CompanionClickThrough"),u),l.CompanionClickThrough=u);var y=n.getSubNodes(s,"CompanionClickTracking");if(y)for(l.CompanionClickTracking=[],p=0;p<y.length;p++)h=y[p],(f=n.getNodeValues(h))&&(v=n.prepareAttributionData(h,f),l.CompanionClickTracking.push(v));var b=n.getSubNodes(s,"Tracking");if(b)for(l.TrackingEvents=[],p=0;p<b.length;p++){h=b[p];var A=n.getNodeAttributeValue(h,"event");f=n.getNodeValues(h),A&&f&&(v=n.prepareAttributionData(h,f),l.TrackingEvents.push({eventType:A,url:v}))}t.companions.push(l)}}return t}};e.exports=n},function(e,t,n){var i=n(79),r="[AdHandler_PrePostCovers]",o=n(94);e.exports=function(e,t){var n,a,s=e,l=t.preShow,d=t.postShow,c=t.fallback,u=t.postShowClickUrl,p=t.fallbackClickUrl,h=t.postShowTrackUrl,f=!1,v=new o;s&&l&&(s.style.backgroundImage="url("+l+")",s.style.backgroundRepeat="no-repeat",s.style.backgroundSize="100% 100%",i.log(r,"Preshow banner created")),this.beforePlayVideo=function(e,t){if("native"===e){var i,r=(n=t).iframeVideoWrapper;if(a=r.style.width,s.style.width=a,l&&(r.style.width="1px"),!f){f=!0;var o=function(){s.removeEventListener("click",o),s.removeEventListener("mouseover",c),s.removeEventListener("mouseout",u),n.play(),n.iframeVideoWrapper.style.width=a,s.style.width="",i&&s.contains(i)&&s.removeChild(i)},c=function(){s.style.cursor="pointer"},u=function(){s.style.cursor="auto"};if(l)return s.addEventListener("click",o),s.addEventListener("mouseover",c),s.addEventListener("mouseout",u),i=v.createNativeStartButton(s),s.appendChild(i),i;n.options.hideTopBar=!0,d||(n.options.disableCollapse.enabled=!0,n.options.disableCollapse.replay=!0)}}else"preview"!==e||t.options.pod||((n=t).options.disableCollapse.enabled=!0,n.options.disableCollapse.replay=!0)},this.adFinished=function(e,t){if(s){var n=e&&c||d;if(n&&(s.style.width=t.width+"px",s.style.height=t.height+"px",s.style.backgroundImage="url("+n+")",s.style.backgroundRepeat="no-repeat",s.style.backgroundSize="100% 100%",i.log(r,"Postshow/fallback banner created")),s.style.backgroundImage||t.badVastXml){var o=e&&p||u;o&&(s.onclick=function(){window.open(o,"_blank"),h&&(new Image(1,1).src=h)},s.onmouseover=function(){s.style.cursor="pointer"},s.onmouseout=function(){s.style.cursor="auto"})}}},i.log(r,"object has been instatiated")}},function(e,t){e.exports=function(){this.checkIsTopWindowAccessible=function(){var e=!0;try{var t=top.window,n=t.innerHeight||t.documentElement.clientHeight,i=function(){};t.addEventListener("scroll",i),t.removeEventListener("scroll",i),t&&"object"==typeof t&&"function"==typeof t.addEventListener&&"number"==typeof n||(e=!1)}catch(t){e=!1}return e},this.isFullScreen=function(e){return!!e.isFullscreen||!!(document.fullscreenElement||document.webkitFullscreenElement||document.mozFullScreenElement||document.msFullscreenElement)&&(!window.screenTop&&!window.screenY)},this.isMobile=function(){var e=navigator.appVersion.indexOf("Mobile"),t=navigator.appVersion.indexOf("Android");return e>-1||t>-1},this.isAndroid=function(){return/android/i.test(navigator.userAgent.toLowerCase())},this.isChrome=function(){return navigator.userAgent.indexOf("Chrome")>-1},this.isSafari=function(){return/version\/([\w\.]+).+?(mobile\s?safari|safari)/i.test(navigator.userAgent.toLowerCase())},this.clearDiv=function(e){for(;e.hasChildNodes();)e.removeChild(e.lastChild)},this.inIframe=function(){try{return window.self!==window.top}catch(e){return!0}},this.createNativeStartButton=function(e){var t=e.offsetWidth?Math.min(48,e.offsetWidth/4):e.offsetHeight?Math.min(48,e.offsetHeight/3):48,n=document.createElement("div");n.style.margin="0 auto",n.style.top="25%",n.style.left="30%",n.style.position="absolute",n.style.width="0px",n.style.height="0px",n.style.borderStyle="solid";var i=.8*t/3;n.style.borderWidth=i+"px 0px "+i+"px "+2*i+"px",n.style.borderColor="transparent transparent transparent #ffffff",n.style.opacity="0.85";var r=document.createElement("div");return r.style.margin="0 auto",r.style.backgroundColor="black",r.style.width=t+"px",r.style.height=t+"px",r.style.position="absolute",r.style.right="0px",r.style.bottom="0px",r.appendChild(n),r}}},function(e,t,n){var i=n(79),r=n(96),o=n(94),a="[AdHandler_Viewability_Observer]",s="adLoaded",l="ended",d="adError",c="impression";e.exports=function(e,t){var n,u,p=e,h=t,f=this,v=new r,m=new o,g=!1,y=!1,b=t.ASTadId,A=m.checkIsTopWindowAccessible(),w=window.self,T=A?top.window:f.window,k=null,E=!1,S=!1,C=!1;this.getCurrentEventFromCrossDomainWindow=function(){},this.getIsExpanded=function(){return"bannerstreamtest"===h.adType},this.getRWindowForPublisher=function(){return T},this.getIsWindowTopAccessible=function(){return A},this.getOptions=function(){return h};var I=function(e,t,n){i.log(a,"============= eventCB:"+t);try{h&&"function"==typeof h.eventCB&&h.eventCB(e,t,n)}catch(e){i.error(a,e)}},_=function(){if("auto"===h.initialPlayback&&(n.isPlayingVideo=!1),!C)try{n.load(),C=!0}catch(e){i.error(a,e)}I(b,c,h),I(b,s,h),n.pausedByViewability=!0},P=function(){!m.isFullScreen(n)&&n.isPlayingVideo&&(L(),i.log(a,"screen : blur"))},j=function(){var e=v.isElementVisible(p,f);n.isViewable=e,e&&O(),i.log(a,"screen : focus")},x=function(){h.autoInitialSize&&(h.width=h.targetElement.offsetWidth),n.isIosInlineRequired&&n.isIosInlineRequired()||(n.resizeVideo(-1),V())},V=function(){if(!(n.isFullscreen&&n.isCompleted&&m.isAndroid())){p.style.height=h.height+"px";var e=document.getElementById(n.videoObjectId);e&&void 0!==typeof e&&(e.style.width=h.width,e.style.height=h.height)}},M=function(){var e=v.isElementVisible(p,f);n.isViewable=e,n.isFullscreen&&n.isMuted?(n.unmute(),g=!1):"mute"!==h.nonViewableBehavior||n.isFullscreen||n.isPaused||(e&&!0===g?(n.unmute(),g=!1,"auto"===h.initialPlayback&&n.delayEventHandler.suppress(!1)):!1!==e||!1!==g||n.isMuted||(n.mute(),g=!0),S&&(e=!0)),e?n.pausedByViewability&&("auto"===h.initialPlayback&&n.delayEventHandler.suppress(!1),N(),n.pausedByViewability=!1,i.log(a,"set pausedByViewability false"),S=!0,m.isAndroid()&&(T.removeEventListener("touchmove",M),u=setInterval(M,50))):m.isFullScreen(n)||n.isDoneInitialPlay&&!1===n.pausedByViewability&&!n.explicitPaused&&(D(),i.log(a,"set pausedByViewability true"),n.pausedByViewability=!0)},N=function(){i.log(a,"send explicit play from pause"),("auto"===h.initialPlayback||n.isDoneInitialPlay)&&(R()||"function"==typeof n.explicitPlay&&(n.explicitPlay(),i.log(a,"sendPlaySignalToVideoPlayerExplicit")))},O=function(){i.log(a,"send play from pause"),("auto"===h.initialPlayback||n.isDoneInitialPlay)&&(R()||"function"!=typeof n.play||n.explicitPaused||(n.play(),i.log(a,"sendPlaySignalToVideoPlayer")))},D=function(){i.log(a,"send explicit pause signal"),R()&&("function"==typeof n.explicitPause&&n.explicitPause(),i.log(a,"sendPauseSignalToVideoPlayerExplicit"))},L=function(){R()&&("function"==typeof n.pause&&n.pause(),i.log(a,"sendPauseSignalToVideoPlayer"))},R=function(){return!!n&&n.isPlayingVideo};this.start=function(e){n=e,function(){m.isAndroid()&&T.addEventListener("touchmove",M),u=setInterval(M,100),m.isMobile()&&T.addEventListener("resize",x),_();var e=T!==f.window;if(e=!A||e){var t;void 0!==document.hidden?t="hidden":void 0!==document.mozHidden?t="mozHidden":void 0!==document.msHidden?t="msHidden":void 0!==document.webkitHidden&&(t="webkitHidden");document.addEventListener("visibilitychange",(function(){document[t]?P():j()}),!1)}else k=w.setInterval((function(){document.hasFocus()&&!1===E?(j(),E=!0):document.hasFocus()||!0!==E||(P(),E=!1)}),500)}()},this.stop=function(e){!function(e){if(n.forceToSkip&&(y=!1,n.forceToSkip=!1),!y){i.log(a,"terminate all"),w.clearInterval(k),T.removeEventListener("resize",x),A&&(T.removeEventListener("scroll",M),T.removeEventListener("touchmove",M)),u&&T.clearInterval(u);var r=0,o=function(){if(n.delayEventHandler.lazyTerminate(),m.isFullScreen(n)){if(!(r<=3e3))return n.isCompleted=!0,n.explicitPause(),void I(b,e?d:l,t);setTimeout((function(){r+=500,o()}),500)}else p&&(p.textContent=""),I(b,e?d:l,h)};m.isFullScreen(n)?document.exitFullscreen?document.exitFullscreen():document.webkitExitFullscreen?document.webkitExitFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.msExitFullscreen&&document.msExitFullscreen():(n.isCompleted=!0,D()),y=!0,setTimeout((function(){o()}),500)}}(e)},i.log(a,"object has been instatiated")}},function(e,t){e.exports=function(){this.isElementVisible=function(e,t){if(!e)return!1;var n,i,r,o,a,s,l=t.getCurrentEventFromCrossDomainWindow(),d=t.getIsExpanded(),c=t.getRWindowForPublisher(),u=t.getIsWindowTopAccessible(),p=t.getOptions(),h=p.playVideoVisibleThreshold/100,f=p.height*h,v=Number(p.height)-p.height*h,m=0,g={top:0};n=u?c.innerHeight||c.documentElement.clientHeight:l.windowHeight;var y=c!==window.self;if(y=!u||y){if(u){var b=function(e,t){if(!(e===c||t<=0))for(var n=e.parent.document.getElementsByTagName("iframe"),i=0;i<n.length;i++){var r=n[i],o=r.contentWindow;if(o===e){var a=r.getBoundingClientRect().top;g.top+=a,b(o.parent,--t)}}};b(window.self,100)}else g.top=l.offsetTop;r=(m=g.top-n)+(i=e.getBoundingClientRect().top),o=m+i+f,a=m+i+v}else r=s=e.getBoundingClientRect().top-n,o=s+f,a=s+v;return!d&&r<0||!(a<-1*n)&&o<0}}},function(e,t,n){var i,r=n(85),o=n(84),a="https://rb.adnxs-simple.com/pack?log=log_rb_video_outstream&format=json",s=function(e){r.debug(e,"AdHandler->RatbaitFallback")},l=1,d=2,c=3,u=4;e.exports={AD_PLAYED:l,AD_FAILED_IN_RENDERER:d,AD_FAILED_BEFORE_RENDERER:c,AD_NOT_REACHED:u,setMessageTemplate:function(e,t){if(!i&&e.rbFallbackData){var n=JSON.stringify(e.rbFallbackData);(i=JSON.parse(n)).version=e.productVersion,i.total_rtbs=t,i.message_type=0}},reportFallbackTracker:function(e,t,n){try{if(!e)throw new Error("vastObj required to track waterfall step");if(!(i&&i.hasOwnProperty("auction_id_64")&&i.hasOwnProperty("tag_id")&&i.hasOwnProperty("version")&&i.hasOwnProperty("total_rtbs")))throw new Error("Ratbait fallback message template does not exist or not contains required properties");if(!e.hasOwnProperty("fallbackIndex"))throw new Error("vastObj does not present fallback ad");if(!t||t<l||t>u)throw new Error("Invalid action code");var r=JSON.stringify(i),p=JSON.parse(r);switch(p.buyer_member_id=parseInt(e.buyerMemberId),p.brand_category_id=parseInt(e.brandCategoryId),p.creative_id=parseInt(e.creative_id),p.fallback_ad_index=e.fallbackIndex,p.action=t,p.error_code=0,p.message="",t){case d:n&&(n.code&&(p.error_code=n.code),n.message&&(p.message=n.message));break;case c:n&&(n.code&&(p.error_code=n.code),n.message?p.message=n.message:p.message="Error during processing ut response")}p.timestamp=Date.now();var h=JSON.stringify(p).replace(/"auction_id_64":"(\d+)"/,'"auction_id_64":$1');s("Fallback RATBAIT POST tracker fired path :"+a+" -- "+h),o.loadPost(a,h)}catch(e){s("Error in reporting to RATBAIT "+e)}}}},function(e,t,n){var i=n(99);function r(e){if(e)return e.responseXML?e.responseXML:e.responseText}e.exports={debug:function(){i.handleLogDebugLegacySupport.apply(this,arguments)},logDebug:function(){i.handleLogDebugLegacySupport.apply(this,arguments)},setDebugLevel:function(e){i.setDebugLevel(e)},isNotEmpty:function(e){var t=!1;return null!==e&&e&&(t=e.length>0),t},objectToString:function(e,t){var n="null";if(t=void 0!==t?t:0,null!==e){n="OBJ[";var i="";for(var r in e){var o=e[r];if("object"==typeof o)if(++t<9)try{o=this.objectToString(o)}catch(e){o="err:"+e}else o="err: max recursion hit";i.length>0&&(i+=","),i+=r+"="+o}n+=i,n+="]"}return n},getRandomString:function(){return Math.random().toString(36).substring(2)},traceVastFromXhr:function(e,t){try{if(e)if(Array.isArray(e)){if(e.length>0){var n=[];for(var o in e)n.push(e[o].responseURL);var a=e[e.length-1];if(a){var s=r(a),l=a.responseURL;i.info(t,"Tag load chain:",n,"\n","Final Tag URL: ",l,"\n","Final Tag: ",s)}}}else{var d=r(e);i.info(t,"Tag URL:",e.responseURL,"\n","Tag:",d)}}catch(e){}}}},function(e,t){var n=0,i=0,r=0,o=!1;function a(e,t){try{if(void 0!==e&&d(e)&&console){var n=o?"[XandrVideo":"[APN",i=function(e){switch(e){case 0:break;case 1:return"always";case 2:return"error";case 3:return"warn";case 4:return"info";case 5:return"log";case 6:return"debug";case 7:return"verbose"}}(e);if(console[i]||(n+="-"+i,i="log"),n+="]",n+="["+function(){var e="";try{var t=new Date;e=t.getHours()+":"+t.getMinutes()+":"+t.getSeconds()+"."+t.getMilliseconds()}catch(e){}return e}()+"]",t.splice(0,0,n),console[i].apply)console[i].apply(console,t);else{var r=Array.prototype.slice.apply(t).join("");console[i](r)}}}catch(e){}}function s(e){try{var t="";try{t=window.top.location.search}catch(e){try{t=window.location.search}catch(e){}}var n=new RegExp("[\\?&]"+e+"=([^&#]*)").exec(t);return null===n?"":decodeURIComponent(n[1].replace(/\+/g," "))}catch(e){return""}}function l(e){var t=0;try{if(void 0!==e){var n=parseInt(e);isNaN(n)?"boolean"==typeof e?t=e?6:0:"TRUE"===(e=e.toUpperCase())?t=6:"FALSE"===e&&(t=0):t=n}}catch(e){}return t}function d(e){return e<=n}e.exports={traceAtLevel:function(){try{if(arguments.length>0){var e=arguments[0],t=Array.prototype.slice.call(arguments,1);a.call(this,e,t)}}catch(e){}},always:function(){try{a.call(this,1,Array.prototype.slice.call(arguments))}catch(e){}},error:function(){try{a.call(this,2,Array.prototype.slice.call(arguments))}catch(e){}},log:function(){try{a.call(this,5,Array.prototype.slice.call(arguments))}catch(e){}},warn:function(){try{a.call(this,3,Array.prototype.slice.call(arguments))}catch(e){}},info:function(){try{a.call(this,4,Array.prototype.slice.call(arguments))}catch(e){}},debug:function(){try{a.call(this,6,Array.prototype.slice.call(arguments))}catch(e){}},verbose:function(){try{a.call(this,6,Array.prototype.slice.call(arguments))}catch(e){}},handleLogDebugLegacySupport:function(e,t){try{!function(e,t,n){try{var i="[APN-"+e+"-"+(new Date).toISOString()+"] ";null!==n&&n&&n.length>0&&(i+=n+">"),i+=t,d(e)&&console.log(i)}catch(t){d(e)&&console.log(t)}}(5,e,t)}catch(e){}},setDebugLevel:function(e){try{!function(e){try{r=l(e),n=Math.max(Math.max(i,r),n)}catch(e){}}(e)}catch(e){}},isTraceLevelActive:function(e){try{return d(e)}catch(e){return!1}},TRACE_LEVEL_ALWAYS:1,TRACE_LEVEL_ERROR:2,TRACE_LEVEL_WARN:3,TRACE_LEVEL_INFO:4,TRACE_LEVEL_LOG:5,TRACE_LEVEL_DEBUG:6,TRACE_LEVEL_VERBOSE:6},function(){try{var e=s("xdr_debug").toUpperCase();e&&e.length>0?(i=l(e),o=!0):i=l(s("ast_debug").toUpperCase()),n=Math.max(i,n)}catch(e){}}()},function(e,t,n){var i=n(99);var r,o=(r=window.document.featurePolicy)&&r.allowedFeatures&&r.allowedFeatures().includes("attribution-reporting")?(i.log("Attribution reporting is SUPPORTED"),!0):(i.log("Attribution reporting is NOT SUPPORTED"),!1);function a(e,t,i,r,o,s){var l,d=0,c=0,u=!1,p=n(98),h=n(101),f=!0,v=function(e){p.logDebug(e,"URL Loader")};if(o&&void 0!==o.withCredentials&&(f=o.withCredentials),window.XMLHttpRequest)l=new XMLHttpRequest;else if(window.ActiveXObject)try{l=new ActiveXObject("Msxml2.XMLHTTP")}catch(e){try{l=new ActiveXObject("Microsoft.XMLHTTP")}catch(e){}}l?(l.onreadystatechange=function(){if(4===l.readyState)if(200===l.status){if(v("duration: "+c+", response length: "+l.responseText.length),u&&l.responseText&&l.responseText.length>2048){var e=8*l.responseText.length*1e3/(1024*Math.max(1,c)),t=parseInt(e.toString());v("Bandwidth: "+t);try{h.setGenericData("anxBandwidth",t)}catch(e){}}i&&i.call(this,void 0,l.responseText,l)}else l.status>=400&&l.status<600&&i&&i.call(this,l.status,"",l);else 2===l.readyState?d=(new Date).getTime():3===l.readyState&&d>0&&(u=!0,c=(new Date).getTime()-d)},l.onerror=function(){if(f){var n=o||{};n.withCredentials=!1,a(e,t,i,r,n,s)}else if(i){var d=0===l.status?"404":l.status.toString();i.call(this,d,"",l)}},l.ontimeout=function(){i&&i.call(this,"Timeout","",l)},l.open(s,e),r&&(l.timeout=r),l.withCredentials=f,d=0,"POST"===s?l.send(t):l.send()):i&&i.call(this,"406","")}e.exports={load:function(e,t,n,i){var r=!0;!1===i&&(r=!1),a(e,null,t,n,{withCredentials:r},"GET")},loadPost:function(e,t,n,i){a(e,t,n,i,{withCredentials:!0},"POST")},trackPixel:function(e,t){!function(e,t){if(i.log("Logging Event: "+t+" at url:"+e),"string"==typeof e)new Image(1,1).src=e;else if("object"==typeof e){var n;if(e.url)if(o)if("SINGLE-PING"===e.attributionType){i.log("Event = "+t+" SINGLE-PING empty attributionsrc"),n=new Image(1,1);try{n.setAttribute("attributionsrc","")}catch(e){}n.src=e.url}else if("DOUBLE-PING"===e.attributionType){var r=e.attributionSrc?e.attributionSrc:"";i.log("Event = "+t+" DOUBLE-PING attributionsrc = "+r),n=new Image(1,1);try{n.setAttribute("attributionsrc",r)}catch(e){}n.src=e.url}else new Image(1,1).src=e.url;else new Image(1,1).src=e.url}}(e,t)}}},function(e,t,n){var i=n(98),r=24e5,o={},a=2;function s(e,t,n){switch(a){case 0:case 1:break;default:case 2:!function(e,t){o&&(o[e]=t)}(e,t)}}function l(e){switch(a){case 0:case 1:return null;default:case 2:return function(e){if(o)return o[e]}(e)}}function d(e){switch(a){case 0:case 1:break;default:case 2:!function(e){o&&delete o[e]}(e)}}function c(e){return"apn_"+e}i.debug("Using Cache Method "+a,"Cache Manager"),e.exports={setGenericData:function(e,t){if(void 0!==e&&void 0!==t){e="___appnexus_video_cachemanager_generic_data___"+e;try{return s(e,t),!0}catch(e){}}return!1},getGenericData:function(e){if(void 0!==e)return l(e="___appnexus_video_cachemanager_generic_data___"+e)},deleteGenericData:function(e){void 0!==e&&d(e="___appnexus_video_cachemanager_generic_data___"+e)},forceStorageMethod:function(e){a=e,i.debug("Forced usage of cache method "+a,"Cache Manager")},addAd:function(e,t){e&&function(e,t){var n={};n.timestamp=(new Date).getTime(),n.ad=e;try{s(t,JSON.stringify(n))}catch(e){}}(e,c(t))},getAd:function(e){return function(e){var t,n=(new Date).getTime();try{var i=l(e);t=i&&JSON.parse(i),d(e)}catch(e){}return t&&t.timestamp&&t.timestamp>0&&n-t.timestamp<=r?t.ad:null}(c(e))},clearAd:function(e){!function(e){try{d(e)}catch(e){}}(c(e))},setTimeToLive:function(e){r=6e4*e},getNextAdToken:function(){return e=(t=l("___appnexus_video_cachemanager_ad_token___"))?parseInt(t):0,s("___appnexus_video_cachemanager_ad_token___",e+=1),e;var e,t}}}]);
//# sourceMappingURL=http://video.devnxs.net/rel/MobileSDKVideoPlayer/1.5.1/1739398394626/MobileSDKVASTPlayer.js.map
