text: (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
  !function e(t,i,r){function n(o,a){if(!i[o]){if(!t[o]){var l="function"==typeof require&&require;if(!a&&l)return l(o,!0);if(s)return s(o,!0);var u=new Error("Cannot find module '"+o+"'");throw u.code="MODULE_NOT_FOUND",u}var c=i[o]={exports:{}};t[o][0].call(c.exports,function(e){var i=t[o][1][e];return n(i?i:e)},c,c.exports,e,t,i,r)}return i[o].exports}for(var s="function"==typeof require&&require,o=0;o<r.length;o++)n(r[o]);return n}({1:[function(e,t,i){function r(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}function n(e){return"function"==typeof e}function s(e){return"number"==typeof e}function o(e){return"object"==typeof e&&null!==e}function a(e){return void 0===e}t.exports=r,r.EventEmitter=r,r.prototype._events=void 0,r.prototype._maxListeners=void 0,r.defaultMaxListeners=10,r.prototype.setMaxListeners=function(e){if(!s(e)||0>e||isNaN(e))throw TypeError("n must be a positive number");return this._maxListeners=e,this},r.prototype.emit=function(e){var t,i,r,s,l,u;if(this._events||(this._events={}),"error"===e&&(!this._events.error||o(this._events.error)&&!this._events.error.length)){if(t=arguments[1],t instanceof Error)throw t;throw TypeError('Uncaught, unspecified "error" event.')}if(i=this._events[e],a(i))return!1;if(n(i))switch(arguments.length){case 1:i.call(this);break;case 2:i.call(this,arguments[1]);break;case 3:i.call(this,arguments[1],arguments[2]);break;default:s=Array.prototype.slice.call(arguments,1),i.apply(this,s)}else if(o(i))for(s=Array.prototype.slice.call(arguments,1),u=i.slice(),r=u.length,l=0;r>l;l++)u[l].apply(this,s);return!0},r.prototype.addListener=function(e,t){var i;if(!n(t))throw TypeError("listener must be a function");return this._events||(this._events={}),this._events.newListener&&this.emit("newListener",e,n(t.listener)?t.listener:t),this._events[e]?o(this._events[e])?this._events[e].push(t):this._events[e]=[this._events[e],t]:this._events[e]=t,o(this._events[e])&&!this._events[e].warned&&(i=a(this._maxListeners)?r.defaultMaxListeners:this._maxListeners,i&&i>0&&this._events[e].length>i&&(this._events[e].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[e].length),"function"==typeof console.trace&&console.trace())),this},r.prototype.on=r.prototype.addListener,r.prototype.once=function(e,t){function i(){this.removeListener(e,i),r||(r=!0,t.apply(this,arguments))}if(!n(t))throw TypeError("listener must be a function");var r=!1;return i.listener=t,this.on(e,i),this},r.prototype.removeListener=function(e,t){var i,r,s,a;if(!n(t))throw TypeError("listener must be a function");if(!this._events||!this._events[e])return this;if(i=this._events[e],s=i.length,r=-1,i===t||n(i.listener)&&i.listener===t)delete this._events[e],this._events.removeListener&&this.emit("removeListener",e,t);else if(o(i)){for(a=s;a-- >0;)if(i[a]===t||i[a].listener&&i[a].listener===t){r=a;break}if(0>r)return this;1===i.length?(i.length=0,delete this._events[e]):i.splice(r,1),this._events.removeListener&&this.emit("removeListener",e,t)}return this},r.prototype.removeAllListeners=function(e){var t,i;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[e]&&delete this._events[e],this;if(0===arguments.length){for(t in this._events)"removeListener"!==t&&this.removeAllListeners(t);return this.removeAllListeners("removeListener"),this._events={},this}if(i=this._events[e],n(i))this.removeListener(e,i);else if(i)for(;i.length;)this.removeListener(e,i[i.length-1]);return delete this._events[e],this},r.prototype.listeners=function(e){var t;return t=this._events&&this._events[e]?n(this._events[e])?[this._events[e]]:this._events[e].slice():[]},r.prototype.listenerCount=function(e){if(this._events){var t=this._events[e];if(n(t))return 1;if(t)return t.length}return 0},r.listenerCount=function(e,t){return e.listenerCount(t)}},{}],2:[function(e,t,i){(function(){var e;e=function(){function e(){this.id=null,this.errorURLTemplates=[],this.impressionURLTemplates=[],this.creatives=[]}return e}(),t.exports=e}).call(this)},{}],3:[function(e,t,i){(function(){var r,n,s;n=e("./parser"),s=e("./util"),r=function(){function e(){}return e.cappingFreeLunch=0,e.cappingMinimumTimeInterval=0,e.options={withCredentials:!1,timeout:0},e.get=function(e,t,r){var s,o,a;return o=+new Date,s=i.extend=function(e,t){var i,r;for(i in t)r=t[i],e[i]=r;return e},r||("function"==typeof t&&(r=t),a={}),a=s(this.options,t),this.totalCallsTimeout<o?(this.totalCalls=1,this.totalCallsTimeout=o+36e5):this.totalCalls++,this.cappingFreeLunch>=this.totalCalls?void r(null):o-this.lastSuccessfullAd<this.cappingMinimumTimeInterval?void r(null):n.parse(e,a,function(e){return function(e){return r(e)}}(this))},function(){var t,i;i=s.storage,t=Object.defineProperty,["lastSuccessfullAd","totalCalls","totalCallsTimeout"].forEach(function(r){t(e,r,{get:function(){return i.getItem(r)},set:function(e){return i.setItem(r,e)},configurable:!1,enumerable:!0})}),null==e.totalCalls&&(e.totalCalls=0),null==e.totalCallsTimeout&&(e.totalCallsTimeout=0)}(),e}(),t.exports=r}).call(this)},{"./parser":8,"./util":14}],4:[function(e,t,i){(function(){var e;e=function(){function e(){this.id=null,this.width=0,this.height=0,this.type=null,this.staticResource=null,this.htmlResource=null,this.iframeResource=null,this.companionClickThroughURLTemplate=null,this.trackingEvents={}}return e}(),t.exports=e}).call(this)},{}],5:[function(e,t,i){(function(){var e,i,r,n,s={}.hasOwnProperty,o=function(e,t){function i(){this.constructor=e}for(var r in t)s.call(t,r)&&(e[r]=t[r]);return i.prototype=t.prototype,e.prototype=new i,e.__super__=t.prototype,e};e=function(){function e(){this.trackingEvents={}}return e}(),r=function(e){function t(){t.__super__.constructor.apply(this,arguments),this.type="linear",this.duration=0,this.skipDelay=null,this.mediaFiles=[],this.videoClickThroughURLTemplate=null,this.videoClickTrackingURLTemplates=[],this.videoCustomClickURLTemplates=[],this.adParameters=null}return o(t,e),t}(e),n=function(e){function t(){return t.__super__.constructor.apply(this,arguments)}return o(t,e),t}(e),i=function(e){function t(){this.type="companion",this.variations=[],this.videoClickTrackingURLTemplates=[]}return o(t,e),t}(e),t.exports={VASTCreativeLinear:r,VASTCreativeNonLinear:n,VASTCreativeCompanion:i}}).call(this)},{}],6:[function(e,t,i){(function(){t.exports={client:e("./client"),tracker:e("./tracker"),parser:e("./parser"),util:e("./util")}}).call(this)},{"./client":3,"./parser":8,"./tracker":10,"./util":14}],7:[function(e,t,i){(function(){var e;e=function(){function e(){this.id=null,this.fileURL=null,this.deliveryType="progressive",this.mimeType=null,this.codec=null,this.bitrate=0,this.minBitrate=0,this.maxBitrate=0,this.width=0,this.height=0,this.apiFramework=null,this.scalable=null,this.maintainAspectRatio=null}return e}(),t.exports=e}).call(this)},{}],8:[function(e,t,i){(function(){var i,r,n,s,o,a,l,u,c,h,p=[].indexOf||function(e){for(var t=0,i=this.length;i>t;t++)if(t in this&&this[t]===e)return t;return-1};r=e("./urlhandler"),c=e("./response"),n=e("./ad"),h=e("./util"),a=e("./creative").VASTCreativeLinear,o=e("./creative").VASTCreativeCompanion,l=e("./mediafile"),s=e("./companionad"),i=e("events").EventEmitter,u=function(){function e(){}var t;return t=[],e.addURLTemplateFilter=function(e){"function"==typeof e&&t.push(e)},e.removeURLTemplateFilter=function(){return t.pop()},e.countURLTemplateFilters=function(){return t.length},e.clearUrlTemplateFilters=function(){return t=[]},e.parse=function(e,t,i){return i||("function"==typeof t&&(i=t),t={}),this._parse(e,null,t,function(e,t){return i(t)})},e.vent=new i,e.track=function(e,t){return this.vent.emit("VAST-error",t),h.track(e,t)},e.on=function(e,t){return this.vent.on(e,t)},e.once=function(e,t){return this.vent.once(e,t)},e._parse=function(e,i,n,s){var o,a,l;for(s||("function"==typeof n&&(s=n),n={}),a=0,l=t.length;l>a;a++)o=t[a],e=o(e);return null==i&&(i=[]),i.push(e),r.get(e,n,function(t){return function(r,o){var a,l,u,h,f,d,m,v,g,y,k;if(null!=r)return s(r);if(f=new c,null==(null!=o?o.documentElement:void 0)||"VAST"!==o.documentElement.nodeName)return s();for(y=o.documentElement.childNodes,d=0,v=y.length;v>d;d++)h=y[d],"Error"===h.nodeName&&f.errorURLTemplates.push(t.parseNodeText(h));for(k=o.documentElement.childNodes,m=0,g=k.length;g>m;m++)h=k[m],"Ad"===h.nodeName&&(a=t.parseAdElement(h),null!=a?f.ads.push(a):t.track(f.errorURLTemplates,{ERRORCODE:101}));for(l=function(e){var i,r,n;if(null==e&&(e=!1),f){for(n=f.ads,i=0,r=n.length;r>i;i++)if(a=n[i],null!=a.nextWrapperURL)return;return 0===f.ads.length&&(e||t.track(f.errorURLTemplates,{ERRORCODE:303}),f=null),s(null,f)}},u=f.ads.length;u--;)a=f.ads[u],null!=a.nextWrapperURL&&!function(r){var s,o,a;return i.length>=10||(a=r.nextWrapperURL,p.call(i,a)>=0)?(t.track(r.errorURLTemplates,{ERRORCODE:302}),f.ads.splice(f.ads.indexOf(r),1),void l()):(0===r.nextWrapperURL.indexOf("//")?(o=location.protocol,r.nextWrapperURL=""+o+r.nextWrapperURL):-1===r.nextWrapperURL.indexOf("://")&&(s=e.slice(0,e.lastIndexOf("/")),r.nextWrapperURL=""+s+"/"+r.nextWrapperURL),t._parse(r.nextWrapperURL,i,n,function(e,i){var n,s,o,a,u,c,h,p,d,m,v,g,y,k,T,L,w,R;if(s=!1,null!=e)t.track(r.errorURLTemplates,{ERRORCODE:301}),f.ads.splice(f.ads.indexOf(r),1),s=!0;else if(null==i)t.track(r.errorURLTemplates,{ERRORCODE:303}),f.ads.splice(f.ads.indexOf(r),1),s=!0;else for(f.errorURLTemplates=f.errorURLTemplates.concat(i.errorURLTemplates),a=f.ads.indexOf(r),f.ads.splice(a,1),T=i.ads,h=0,p=T.length;p>h;h++){if(u=T[h],u.errorURLTemplates=r.errorURLTemplates.concat(u.errorURLTemplates),u.impressionURLTemplates=r.impressionURLTemplates.concat(u.impressionURLTemplates),null!=r.trackingEvents)for(L=u.creatives,g=0,d=L.length;d>g;g++)if(n=L[g],"linear"===n.type)for(w=Object.keys(r.trackingEvents),y=0,m=w.length;m>y;y++)o=w[y],(c=n.trackingEvents)[o]||(c[o]=[]),n.trackingEvents[o]=n.trackingEvents[o].concat(r.trackingEvents[o]);if(null!=r.videoClickTrackingURLTemplates)for(R=u.creatives,k=0,v=R.length;v>k;k++)n=R[k],"linear"===n.type&&(n.videoClickTrackingURLTemplates=n.videoClickTrackingURLTemplates.concat(r.videoClickTrackingURLTemplates));f.ads.splice(a,0,u)}return delete r.nextWrapperURL,l(s)}))}(a);return l()}}(this))},e.childByName=function(e,t){var i,r,n,s;for(s=e.childNodes,r=0,n=s.length;n>r;r++)if(i=s[r],i.nodeName===t)return i},e.childsByName=function(e,t){var i,r,n,s,o;for(r=[],o=e.childNodes,n=0,s=o.length;s>n;n++)i=o[n],i.nodeName===t&&r.push(i);return r},e.parseAdElement=function(e){var t,i,r,n;for(n=e.childNodes,i=0,r=n.length;r>i;i++){if(t=n[i],t.id=e.getAttribute("id"),"Wrapper"===t.nodeName)return this.parseWrapperElement(t);if("InLine"===t.nodeName)return this.parseInLineElement(t)}},e.parseWrapperElement=function(e){var t,i,r,n,s,o,a;for(t=this.parseInLineElement(e),n=this.childByName(e,"VASTAdTagURI"),null!=n?t.nextWrapperURL=this.parseNodeText(n):(n=this.childByName(e,"VASTAdTagURL"),null!=n&&(t.nextWrapperURL=this.parseNodeText(this.childByName(n,"URL")))),r=null,a=t.creatives,s=0,o=a.length;o>s;s++)if(i=a[s],"linear"===i.type){r=i;break}return null!=r&&(null!=r.trackingEvents&&(t.trackingEvents=r.trackingEvents),null!=r.videoClickTrackingURLTemplates&&(t.videoClickTrackingURLTemplates=r.videoClickTrackingURLTemplates)),null!=t.nextWrapperURL?t:void 0},e.parseInLineElement=function(e){var t,i,r,s,o,a,l,u,c,h,p,f,d,m;for(t=new n,t.id=e.id,f=e.childNodes,a=0,c=f.length;c>a;a++)switch(o=f[a],o.nodeName){case"Error":t.errorURLTemplates.push(this.parseNodeText(o));break;case"Impression":t.impressionURLTemplates.push(this.parseNodeText(o));break;case"Creatives":for(d=this.childsByName(o,"Creative"),l=0,h=d.length;h>l;l++)for(r=d[l],m=r.childNodes,u=0,p=m.length;p>u;u++)switch(s=m[u],s.nodeName){case"Linear":i=this.parseCreativeLinearElement(s),i&&t.creatives.push(i);break;case"CompanionAds":i=this.parseCompanionAd(s),i&&t.creatives.push(i)}}return t},e.parseCreativeLinearElement=function(e){var t,i,r,n,s,o,u,c,h,p,f,d,m,v,g,y,k,T,L,w,R,E,x,U,C,N,_,A,b,D,O,I,B,M,S,F;if(r=new a,r.duration=this.parseDuration(this.parseNodeText(this.childByName(e,"Duration"))),-1===r.duration&&"Wrapper"!==e.parentNode.parentNode.parentNode.nodeName)return null;if(m=e.getAttribute("skipoffset"),null==m?r.skipDelay=null:"%"===m.charAt(m.length-1)?(f=parseInt(m,10),r.skipDelay=r.duration*(f/100)):r.skipDelay=this.parseDuration(m),k=this.childByName(e,"VideoClicks"),null!=k){for(r.videoClickThroughURLTemplate=this.parseNodeText(this.childByName(k,"ClickThrough")),O=this.childsByName(k,"ClickTracking"),L=0,x=O.length;x>L;L++)i=O[L],r.videoClickTrackingURLTemplates.push(this.parseNodeText(i));for(I=this.childsByName(k,"CustomClick"),w=0,U=I.length;U>w;w++)n=I[w],r.videoCustomClickURLTemplates.push(this.parseNodeText(n))}for(t=this.childByName(e,"AdParameters"),null!=t&&(r.adParameters=this.parseNodeText(t)),B=this.childsByName(e,"TrackingEvents"),R=0,C=B.length;C>R;R++)for(g=B[R],M=this.childsByName(g,"Tracking"),E=0,N=M.length;N>E;E++)if(v=M[E],s=v.getAttribute("event"),y=this.parseNodeText(v),null!=s&&null!=y){if("progress"===s){if(p=v.getAttribute("offset"),!p)continue;s="%"===p.charAt(p.length-1)?"progress-"+p:"progress-"+Math.round(this.parseDuration(p))}null==(T=r.trackingEvents)[s]&&(T[s]=[]),r.trackingEvents[s].push(y)}for(S=this.childsByName(e,"MediaFiles"),b=0,_=S.length;_>b;b++)for(h=S[b],F=this.childsByName(h,"MediaFile"),D=0,A=F.length;A>D;D++)c=F[D],u=new l,u.id=c.getAttribute("id"),u.fileURL=this.parseNodeText(c),u.deliveryType=c.getAttribute("delivery"),u.codec=c.getAttribute("codec"),u.mimeType=c.getAttribute("type"),u.apiFramework=c.getAttribute("apiFramework"),u.bitrate=parseInt(c.getAttribute("bitrate")||0),u.minBitrate=parseInt(c.getAttribute("minBitrate")||0),u.maxBitrate=parseInt(c.getAttribute("maxBitrate")||0),u.width=parseInt(c.getAttribute("width")||0),u.height=parseInt(c.getAttribute("height")||0),d=c.getAttribute("scalable"),d&&"string"==typeof d&&(d=d.toLowerCase(),"true"===d?u.scalable=!0:"false"===d&&(u.scalable=!1)),o=c.getAttribute("maintainAspectRatio"),o&&"string"==typeof o&&(o=o.toLowerCase(),"true"===o?u.maintainAspectRatio=!0:"false"===o&&(u.maintainAspectRatio=!1)),r.mediaFiles.push(u);return r},e.parseCompanionAd=function(e){var t,i,r,n,a,l,u,c,h,p,f,d,m,v,g,y,k,T,L,w,R,E,x,U,C,N,_,A,b;for(r=new o,U=this.childsByName(e,"Companion"),d=0,y=U.length;y>d;d++){for(i=U[d],t=new s,t.id=i.getAttribute("id")||null,t.width=i.getAttribute("width"),t.height=i.getAttribute("height"),C=this.childsByName(i,"HTMLResource"),m=0,k=C.length;k>m;m++)a=C[m],t.type=a.getAttribute("creativeType")||"text/html",t.htmlResource=this.parseNodeText(a);for(N=this.childsByName(i,"IFrameResource"),v=0,T=N.length;T>v;v++)l=N[v],t.type=l.getAttribute("creativeType")||0,t.iframeResource=this.parseNodeText(l);for(_=this.childsByName(i,"StaticResource"),g=0,L=_.length;L>g;g++)u=_[g],t.type=u.getAttribute("creativeType")||0,t.staticResource=this.parseNodeText(u);for(A=this.childsByName(i,"TrackingEvents"),E=0,w=A.length;w>E;E++)for(h=A[E],b=this.childsByName(h,"Tracking"),x=0,R=b.length;R>x;x++)c=b[x],n=c.getAttribute("event"),p=this.parseNodeText(c),null!=n&&null!=p&&(null==(f=t.trackingEvents)[n]&&(f[n]=[]),t.trackingEvents[n].push(p));t.companionClickThroughURLTemplate=this.parseNodeText(this.childByName(i,"CompanionClickThrough")),r.variations.push(t)}return r},e.parseDuration=function(e){var t,i,r,n,s;return null==e?-1:(t=e.split(":"),3!==t.length?-1:(s=t[2].split("."),n=parseInt(s[0]),2===s.length&&(n+=parseFloat("0."+s[1])),r=parseInt(60*t[1]),i=parseInt(60*t[0]*60),isNaN(i||isNaN(r||isNaN(n||r>3600||n>60)))?-1:i+r+n))},e.parseNodeText=function(e){return e&&(e.textContent||e.text||"").trim()},e}(),t.exports=u}).call(this)},{"./ad":2,"./companionad":4,"./creative":5,"./mediafile":7,"./response":9,"./urlhandler":11,"./util":14,events:1}],9:[function(e,t,i){(function(){var e;e=function(){function e(){this.ads=[],this.errorURLTemplates=[]}return e}(),t.exports=e}).call(this)},{}],10:[function(e,t,i){(function(){var i,r,n,s,o,a={}.hasOwnProperty,l=function(e,t){function i(){this.constructor=e}for(var r in t)a.call(t,r)&&(e[r]=t[r]);return i.prototype=t.prototype,e.prototype=new i,e.__super__=t.prototype,e};r=e("./client"),o=e("./util"),n=e("./creative").VASTCreativeLinear,i=e("events").EventEmitter,s=function(e){function t(e,t){var i,s,o;this.ad=e,this.creative=t,this.muted=!1,this.impressed=!1,this.skipable=!1,this.skipDelayDefault=-1,this.trackingEvents={},this.emitAlwaysEvents=["creativeView","start","firstQuartile","midpoint","thirdQuartile","complete","resume","pause","rewind","skip","closeLinear","close"],o=this.creative.trackingEvents;for(i in o)s=o[i],this.trackingEvents[i]=s.slice(0);this.creative instanceof n?(this.setDuration(this.creative.duration),this.skipDelay=this.creative.skipDelay,this.linear=!0,this.clickThroughURLTemplate=this.creative.videoClickThroughURLTemplate,this.clickTrackingURLTemplates=this.creative.videoClickTrackingURLTemplates):(this.skipDelay=-1,this.linear=!1),this.on("start",function(){r.lastSuccessfullAd=+new Date})}return l(t,e),t.prototype.setDuration=function(e){return this.assetDuration=e,this.quartiles={firstQuartile:Math.round(25*this.assetDuration)/100,midpoint:Math.round(50*this.assetDuration)/100,thirdQuartile:Math.round(75*this.assetDuration)/100}},t.prototype.setProgress=function(e){var t,i,r,n,s,o,a,l,u;if(s=null===this.skipDelay?this.skipDelayDefault:this.skipDelay,-1===s||this.skipable||(s>e?this.emit("skip-countdown",s-e):(this.skipable=!0,this.emit("skip-countdown",0))),this.linear&&this.assetDuration>0){if(i=[],e>0){i.push("start"),r=Math.round(e/this.assetDuration*100),i.push("progress-"+r+"%"),i.push("progress-"+Math.round(e)),u=this.quartiles;for(n in u)o=u[n],e>=o&&o+1>=e&&i.push(n)}for(a=0,l=i.length;l>a;a++)t=i[a],this.track(t,!0);e<this.progress&&this.track("rewind")}return this.progress=e},t.prototype.setMuted=function(e){return this.muted!==e&&this.track(e?"mute":"unmute"),this.muted=e},t.prototype.setPaused=function(e){return this.paused!==e&&this.track(e?"pause":"resume"),this.paused=e},t.prototype.setFullscreen=function(e){return this.fullscreen!==e&&this.track(e?"fullscreen":"exitFullscreen"),this.fullscreen=e},t.prototype.setSkipDelay=function(e){return"number"==typeof e?this.skipDelay=e:void 0},t.prototype.load=function(){return this.impressed?void 0:(this.impressed=!0,this.trackURLs(this.ad.impressionURLTemplates),this.track("creativeView"))},t.prototype.errorWithCode=function(e){return this.trackURLs(this.ad.errorURLTemplates,{ERRORCODE:e})},t.prototype.complete=function(){return this.track("complete")},t.prototype.close=function(){return this.track(this.linear?"closeLinear":"close")},t.prototype.stop=function(){},t.prototype.skip=function(){return this.track("skip"),this.trackingEvents=[]},t.prototype.click=function(){var e,t,i;return(null!=(i=this.clickTrackingURLTemplates)?i.length:void 0)&&this.trackURLs(this.clickTrackingURLTemplates),null!=this.clickThroughURLTemplate?(this.linear&&(t={CONTENTPLAYHEAD:this.progressFormated()}),e=o.resolveURLTemplates([this.clickThroughURLTemplate],t)[0],this.emit("clickthrough",e)):void 0},t.prototype.track=function(e,t){var i,r;null==t&&(t=!1),"closeLinear"===e&&null==this.trackingEvents[e]&&null!=this.trackingEvents.close&&(e="close"),r=this.trackingEvents[e],i=this.emitAlwaysEvents.indexOf(e),null!=r?(this.emit(e,""),this.trackURLs(r)):-1!==i&&this.emit(e,""),t===!0&&(delete this.trackingEvents[e],i>-1&&this.emitAlwaysEvents.splice(i,1))},t.prototype.trackURLs=function(e,t){return null==t&&(t={}),this.linear&&(t.CONTENTPLAYHEAD=this.progressFormated()),o.track(e,t)},t.prototype.progressFormated=function(){var e,t,i,r,n;return n=parseInt(this.progress),e=n/3600,e.length<2&&(e="0"+e),t=n/60%60,t.length<2&&(t="0"+t),r=n%60,r.length<2&&(r="0"+t),i=parseInt(100*(this.progress-n)),""+e+":"+t+":"+r+"."+i},t}(i),t.exports=s}).call(this)},{"./client":3,"./creative":5,"./util":14,events:1}],11:[function(e,t,i){(function(){var i,r,n;n=e("./urlhandlers/xmlhttprequest"),r=e("./urlhandlers/flash"),i=function(){function t(){}return t.get=function(t,i,s){return s||("function"==typeof i&&(s=i),i={}),i.urlhandler&&i.urlhandler.supported()?i.urlhandler.get(t,i,s):"undefined"==typeof window||null===window?e("./urlhandlers/node").get(t,i,s):n.supported()?n.get(t,i,s):r.supported()?r.get(t,i,s):s()},t}(),t.exports=i}).call(this)},{"./urlhandlers/flash":12,"./urlhandlers/xmlhttprequest":13}],12:[function(e,t,i){(function(){var e;e=function(){function e(){}return e.xdr=function(){var e;return window.XDomainRequest&&(e=new XDomainRequest),e},e.supported=function(){return!!this.xdr()},e.get=function(e,t,i){var r,n;return(n="function"==typeof window.ActiveXObject?new window.ActiveXObject("Microsoft.XMLDOM"):void 0)?(n.async=!1,r=this.xdr(),r.open("GET",e),r.timeout=t.timeout||0,r.withCredentials=t.withCredentials||!1,r.send(),r.onprogress=function(){},r.onload=function(){return n.loadXML(r.responseText),i(null,n)}):i()},e}(),t.exports=e}).call(this)},{}],13:[function(e,t,i){(function(){var e;e=function(){function e(){}return e.xhr=function(){var e;return e=new window.XMLHttpRequest,"withCredentials"in e?e:void 0},e.supported=function(){return!!this.xhr()},e.get=function(e,t,i){var r;if("https:"===window.location.protocol&&0===e.indexOf("http://"))return i(new Error("Cannot go from HTTPS to HTTP."));try{return r=this.xhr(),r.open("GET",e),r.timeout=t.timeout||0,r.withCredentials=t.withCredentials||!1,r.send(),r.onreadystatechange=function(){return 4===r.readyState?i(null,r.responseXML):void 0}}catch(n){return i()}},e}(),t.exports=e}).call(this)},{}],14:[function(e,t,i){(function(){var e;e=function(){function e(){}return e.track=function(e,t){var i,r,n,s,o,a;for(r=this.resolveURLTemplates(e,t),a=[],s=0,o=r.length;o>s;s++)i=r[s],"undefined"!=typeof window&&null!==window&&(n=new Image,a.push(n.src=i));return a},e.resolveURLTemplates=function(e,t){var i,r,n,s,o,a,l,u,c;r=[],null==t&&(t={}),"CACHEBUSTING"in t||(t.CACHEBUSTING=Math.round(1e10*Math.random())),t.random=t.CACHEBUSTING;for(u=0,c=e.length;c>u;u++)if(i=e[u],a=i){for(n in t)l=t[n],s="["+n+"]",o="%%"+n+"%%",a=a.replace(s,l),a=a.replace(o,l);r.push(a)}return r},e.storage=function(){var e,t,i,r;try{i="undefined"!=typeof window&&null!==window?window.localStorage||window.sessionStorage:null}catch(n){r=n,i=null}return t=function(e){var t,i;try{if(i="__VASTUtil__",e.setItem(i,i),e.getItem(i)!==i)return!0}catch(r){return t=r,!0}return!1},(null==i||t(i))&&(e={},i={length:0,getItem:function(t){return e[t]},setItem:function(t,i){e[t]=i,this.length=Object.keys(e).length},removeItem:function(t){delete e[t],this.length=Object.keys(e).length},clear:function(){e={},this.length=0}}),i}(),e}(),t.exports=e}).call(this)},{}],15:[function(e,t,i){var r=e("vast-client"),n=["application/x-mpegurl","video/webm","video/mp4"];t.exports={init:function(e,t,i){if("transparent"!=t.conf.wmode)throw new Error("The player must have wmove = transparent for video clicks to work in IE.");if(!t.conf.playlist||!t.conf.playlist.length)throw new Error("The player must have a playlist configured.");var r=this;this.loadPreroll(e,i,function(i){if(i){if(i.swf)return t.trigger("vpaid_swf",[i.swf]);if(i.js)return t.trigger("vpaid_js",[i.js]);if(i.video){r.attachEvents(e,t);var n=!1;t.one("resume load",function(e){return n?void 0:(n=!0,e.preventDefault(),setTimeout(function(){var e=t.conf.playlist.slice(0);e.unshift(i.video),t.setPlaylist(e),t.play(0)},0),!1)})}}})},attachEvents:function(e,t,i){i=i||{};var r=!1,n=!1,s=!1,o=!1;i.adjustable&&t.on("beforeseek",function(e){t.video.ad&&e.preventDefault()});var a=function(){i.adjustable||t.disable(!0)},l=function(){i.adjustable||t.disable(!1)};if(flowplayer.support.inlineVideo){var u=e.querySelectorAll(".fp-player")[0],c=function(e){var i="fp-ui"==e.target.className||"fp-engine"==e.target.className;i&&t.video.ad&&t.playing&&(u.removeEventListener("click",c,!0),t.video.tracker.click())};u&&u.addEventListener("click",c,!0)}flowplayer.support.inlineVideo&&t.on("pause",function(){t.video.ad&&l()}),t.on("unload",function(){l()}),t.on("progress",function(t,i,s){if(i.video.ad&&i.playing){o=!0,a(),i.video.tracker.setProgress(s);var l=e.querySelectorAll(".fp-title")[0],u=e.querySelectorAll(".fp-header")[0];if(l){if(!n){n=!0;var c=function(){i.video.skip&&i.video.time>=i.video.skip&&(r=!0,i.video.tracker.skip(),i.play(1))};l.onclick=c,u&&(u.onclick=c)}i.video.skip?i.video.skip&&s>=i.video.skip?l.innerHTML="Advertisement: <strong>Skip Ad &raquo;</strong>":l.innerHTML="Advertisement: Skippable in "+Math.round(i.video.skip-s)+" seconds...":l.innerHTML="Advertisement: Ends in "+Math.round(i.video.duration-s)+" seconds..."}}}),t.on("finish.vast_complete",function(){t.video.ad&&(t.off("finish.vast_complete"),r||t.video.tracker.complete())}),t.on("ready",function(){return t.video.ad?t.video.tracker.load():(l(),void(!s&&o&&(s=!0,i.keepPreroll!==!0&&t.removePlaylistItem(0))))})},loadPreroll:function(e,t,i,s){var o=!1,a=setTimeout(function(){o=!0,i()},s||5e3);r.client.get(t,function(t){if(!o){var s=[];if(clearTimeout(a),t&&t.ads.forEach(function(t){t.creatives.some(function(i){if("linear"==i.type){var o=new r.tracker(t,i),a={tracker:o,skip:i.skipDelay,title:"Advertisement",ad:!0,sources:[]};a.tracker.on("clickthrough",function(e){window.open(e)});var l={},u={};return i.mediaFiles.forEach(function(t){if("application/javascript"==t.mimeType)return s.push({js:{width:t.width,height:t.height,src:t.fileURL,parameters:i.adParameters,tracker:o}});if("application/x-shockwave-flash"==t.mimeType)return s.push({swf:{src:t.fileURL,width:t.width,height:t.height,parameters:i.adParameters,tracker:o}});if(n.indexOf(t.mimeType)>-1){var r={width:t.width,height:t.height,seconds:i.duration,src:t.fileURL};(!u[t.mimeType]||u[t.mimeType].width>t.width)&&(u[t.mimeType]=r),e.offsetWidth>=t.width&&(!l[t.mimeType]||t.width>l[t.mimeType].width)&&(l[t.mimeType]=r)}}),n.forEach(function(e){var t=l[e]||u[e];t&&a.sources.push({type:e,seconds:t.seconds,width:t.width,height:t.height,src:t.src})}),a.sources.length>0&&s.push({clip:a}),!0}})}),s[0]){if(s[0].swf)return i({type:"swf",swf:s[0].swf});if(s[0].js)return i({type:"js",js:s[0].js});if(s[0].clip)return i({type:"video",video:s[0].clip})}i(null)}})}}},{"vast-client":6}]},{},[15]);
  },{}]},{},[1]);
  